From 0e51c23c36932c55a01c1b3e527d97bcc3aef2a8 Mon Sep 17 00:00:00 2001 From: Adrian Date: Thu, 13 Feb 2020 14:00:51 -0500 Subject: [PATCH 001/162] Existing src files added --- src/abstract/__init__.py | 0 src/abstract/semantics.py | 226 +++++++++ src/abstract/tree.py | 217 +++++++++ src/abstract/typetree.py | 31 ++ .../transformation-checkpoint.py | 15 + src/automatons/__init__.py | 9 + src/automatons/deterministic.py | 36 ++ src/automatons/nondeterministic.py | 64 +++ src/automatons/operations.py | 87 ++++ src/automatons/state.py | 171 +++++++ src/automatons/transformation.py | 52 ++ src/baseNodeTree/__init__.py | 9 + src/baseNodeTree/astprinter.py | 28 ++ src/baseNodeTree/base.py | 33 ++ src/coolgrammar/__init__.py | 0 src/coolgrammar/grammar.py | 275 +++++++++++ .../.ipynb_checkpoints/grammar-checkpoint.py | 174 +++++++ .../.ipynb_checkpoints/symbols-checkpoint.py | 439 +++++++++++++++++ src/grammar/__init__.py | 9 + src/grammar/grammar.py | 176 +++++++ src/grammar/items.py | 75 +++ src/grammar/remrecursion.py | 74 +++ src/grammar/symbols.py | 443 ++++++++++++++++++ .../regexgenerator-checkpoint.py | 133 ++++++ .../tokenizer-checkpoint.py | 10 + src/lexer/__init__.py | 9 + src/lexer/regexgenerator.py | 140 ++++++ src/lexer/tokenizer.py | 139 ++++++ src/lexer/tokens.py | 23 + src/parserr/.#shiftreduce.py | 1 + src/parserr/__init__.py | 9 + src/parserr/ll1.py | 54 +++ src/parserr/lr.py | 293 ++++++++++++ src/parserr/shiftreduce.py | 89 ++++ src/parserr/slr.py | 88 ++++ src/testing.py | 67 +++ src/tools/__init__.py | 9 + src/tools/dtbuilder.py | 99 ++++ src/tools/evaluate.py | 52 ++ src/tools/firsts.py | 116 +++++ src/tools/follows.py | 39 ++ src/tools/gramtoregex.py | 206 ++++++++ src/tools/visitor.py | 58 +++ src/travels/__init__.py | 0 src/travels/context_actions.py | 22 + src/travels/inference.py | 368 +++++++++++++++ src/travels/typebuilder.py | 76 +++ src/travels/typecheck.py | 41 ++ src/travels/typecollector.py | 37 ++ src/typecheck/__init__.py | 0 src/typecheck/evaluator.py | 21 + src/typecheck/visitor.py | 57 +++ 52 files changed, 4899 insertions(+) create mode 100755 src/abstract/__init__.py create mode 100755 src/abstract/semantics.py create mode 100755 src/abstract/tree.py create mode 100755 src/abstract/typetree.py create mode 100755 src/automatons/.ipynb_checkpoints/transformation-checkpoint.py create mode 100755 src/automatons/__init__.py create mode 100755 src/automatons/deterministic.py create mode 100755 src/automatons/nondeterministic.py create mode 100755 src/automatons/operations.py create mode 100755 src/automatons/state.py create mode 100755 src/automatons/transformation.py create mode 100755 src/baseNodeTree/__init__.py create mode 100755 src/baseNodeTree/astprinter.py create mode 100755 src/baseNodeTree/base.py create mode 100755 src/coolgrammar/__init__.py create mode 100755 src/coolgrammar/grammar.py create mode 100755 src/grammar/.ipynb_checkpoints/grammar-checkpoint.py create mode 100755 src/grammar/.ipynb_checkpoints/symbols-checkpoint.py create mode 100755 src/grammar/__init__.py create mode 100755 src/grammar/grammar.py create mode 100755 src/grammar/items.py create mode 100755 src/grammar/remrecursion.py create mode 100755 src/grammar/symbols.py create mode 100755 src/lexer/.ipynb_checkpoints/regexgenerator-checkpoint.py create mode 100755 src/lexer/.ipynb_checkpoints/tokenizer-checkpoint.py create mode 100755 src/lexer/__init__.py create mode 100755 src/lexer/regexgenerator.py create mode 100755 src/lexer/tokenizer.py create mode 100755 src/lexer/tokens.py create mode 120000 src/parserr/.#shiftreduce.py create mode 100755 src/parserr/__init__.py create mode 100755 src/parserr/ll1.py create mode 100755 src/parserr/lr.py create mode 100755 src/parserr/shiftreduce.py create mode 100755 src/parserr/slr.py create mode 100755 src/testing.py create mode 100755 src/tools/__init__.py create mode 100755 src/tools/dtbuilder.py create mode 100755 src/tools/evaluate.py create mode 100755 src/tools/firsts.py create mode 100755 src/tools/follows.py create mode 100755 src/tools/gramtoregex.py create mode 100755 src/tools/visitor.py create mode 100755 src/travels/__init__.py create mode 100755 src/travels/context_actions.py create mode 100755 src/travels/inference.py create mode 100755 src/travels/typebuilder.py create mode 100755 src/travels/typecheck.py create mode 100755 src/travels/typecollector.py create mode 100755 src/typecheck/__init__.py create mode 100755 src/typecheck/evaluator.py create mode 100755 src/typecheck/visitor.py diff --git a/src/abstract/__init__.py b/src/abstract/__init__.py new file mode 100755 index 00000000..e69de29b diff --git a/src/abstract/semantics.py b/src/abstract/semantics.py new file mode 100755 index 00000000..310d5561 --- /dev/null +++ b/src/abstract/semantics.py @@ -0,0 +1,226 @@ +import itertools as itt + +class Attribute: + def __init__(self, name, typex): + self.name = name + self.type = typex + + def __str__(self): + return f'[attrib] {self.name} : {self.type.name};' + + def __repr__(self): + return str(self) + +class SemanticError(Exception): + @property + def text(self): + return self.args[0] + +class Method: + def __init__(self, name, param_names, params_types, return_type): + self.name = name + self.param_names = param_names + self.param_types = params_types + self.return_type = return_type + + def __str__(self): + params = ', '.join(f'{n}:{t.name}' for n,t in zip(self.param_names, self.param_types)) + return f'[method] {self.name}({params}): {self.return_type.name};' + + def __eq__(self, other): + return other.name == self.name and \ + other.return_type == self.return_type and \ + other.param_types == self.param_types + +class Type: + def __init__(self, name:str): + self.name = name + self.attributes = [] + self.methods = {} + self.parent = None + + def set_parent(self, parent): + if self.parent is not None: + raise SemanticError(f'Parent type is already set for {self.name}.') + self.parent = parent + + def get_attribute(self, name:str): + try: + return next(attr for attr in self.attributes if attr.name == name) + except StopIteration: + if self.parent is None: + raise SemanticError(f'Attribute "{name}" is not defined in {self.name}.') + try: + return self.parent.get_attribute(name) + except SemanticError: + raise SemanticError(f'Attribute "{name}" is not defined in {self.name}.') + + def define_attribute(self, name:str, typex): + try: + self.get_attribute(name) + except SemanticError: + attribute = Attribute(name, typex) + self.attributes.append(attribute) + return attribute + else: + raise SemanticError(f'Attribute "{name}" is already defined in {self.name}.') + + def get_method(self, name:str): + try: + return self.methods[name] + except KeyError: + if self.parent is None: + raise SemanticError(f'Method "{name}" is not defined in {self.name}.') + try: + return self.parent.get_method(name) + except SemanticError: + raise SemanticError(f'Method "{name}" is not defined in {self.name}.') + + def define_method(self, name:str, param_names:list, param_types:list, return_type): + if name in self.methods: + raise SemanticError(f'Method "{name}" already defined in {self.name}.') + + method = self.methods[name] = Method(name, param_names, param_types, return_type) + return method + + def conforms_to(self, other): + return other.bypass() or self == other or self.parent is not None and self.parent.conforms_to(other) + + def bypass(self): + return False + + def __str__(self): + output = f'type {self.name}' + parent = '' if self.parent is None else f' : {self.parent.name}' + output += parent + output += ' {' + output += '\n\t' if self.attributes or self.methods else '' + output += '\n\t'.join(str(x) for x in self.attributes) + output += '\n\t' if self.attributes else '' + output += '\n\t'.join(str(x) for x in self.methods.values()) + output += '\n' if self.methods else '' + output += '}\n' + return output + + def __repr__(self): + return str(self) + + def __eq__(self,other): + return isinstance(other, Type) and other.name == self.name + +class VoidType(Type): + def __init__(self): + super(VoidType, self).__init__('void') + + def __eq__(self, other): + return isinstance(other, VoidType) + + +class ObjectType(Type): + def __init__(self): + super(ObjectType, self).__init__('object') + + def __eq__(self, other): + return isinstance(other, ObjectType) + +class IntegerType(Type): + def __init__(self): + super(IntegerType, self).__init__('int') + + def __eq__(self, other): + return isinstance(other, IntegerType) + +class StringType(Type): + def __init__(self): + super(StringType, self).__init__('string') + + def __eq__(self, other): + return isinstance(other, StringType) + +class BoolType(Type): + def __init__(self): + super(BoolType, self).__init__('bool') + + def __eq__(self, other): + return isinstance(other, BoolType) + +class AutoType(Type): + def __init__(self): + super(AutoType, self).__init__('AUTO_TYPE') + + def __eq__(self, other): + return isinstance(other, AutoType) + + def conforms_to(self,other): + return True + + +class Context: + def __init__(self): + self.types = {} + + def create_type(self, name:str): + if name in self.types: + raise SemanticError(f'Type with the same name ({name}) already in context.') + typex = self.types[name] = Type(name) + return typex + + def get_type(self, name:str): + try: + return self.types[name] + except KeyError: + raise SemanticError(f'Type "{name}" is not defined.') + + def __str__(self): + return '{\n\t' + '\n\t'.join(y for x in self.types.values() for y in str(x).split('\n')) + '\n}' + + def __repr__(self): + return str(self) + +class VariableInfo: + def __init__(self, name, vtype): + self.name = name + self.type = vtype + +class Scope: + def __init__(self, parent=None): + self.locals = [] + self.parent = parent + self.children = [] + self.index = 0 if parent is None else len(parent) + + def __len__(self): + return len(self.locals) + + def create_child(self): + child = Scope(self) + self.children.append(child) + return child + + def define_variable(self, vname, vtype): + info = VariableInfo(vname, vtype) + self.locals.append(info) + return info + + def find_variable(self, vname, index=None): + locals = self.locals if index is None else itt.islice(self.locals, index) + try: + return next(x for x in locals if x.name == vname) + except StopIteration: + return self.parent.find_variable(vname, self.index) if self.parent else None + + def is_defined(self, vname): + return self.find_variable(vname) is not None + + def is_local(self, vname): + return any(True for x in self.locals if x.name == vname) + + def __str__(self): + s = ' Scope \n' + for v in self.locals: + s += f'{v.name} -> {v.type.name}\n' + if self.children: + for child in self.children: + s += str(child) + return s + diff --git a/src/abstract/tree.py b/src/abstract/tree.py new file mode 100755 index 00000000..12d83626 --- /dev/null +++ b/src/abstract/tree.py @@ -0,0 +1,217 @@ +from abstract.semantics import ObjectType, IntegerType, StringType, BoolType, VoidType +from abstract.semantics import Context +class Node: + pass + +class DeclarationNode(Node): + pass + +class ExpressionNode(Node): + pass + +class ProgramNode(Node): + + def __init__(self, class_list): + self.class_list = class_list + + def check_semantics(self, deep = 1): + from travels import typecollector, typebuilder,inference + #recolectar los tipos + type_collector = typecollector.TypeCollector() + type_collector.visit(self) + + #Construir los tipos detectados en el contexto + type_builder = typebuilder.TypeBuilder(type_collector.context,type_collector.errors) + type_builder.visit(self) + errors = type_builder.errors + if not errors: + inferer = inference.TypeInferer(type_builder.context, errors=errors) + scope = None + for d in range(1,deep + 1): + print(d) + scope = inferer.visit(self, scope = scope, deep = d) + print(scope) + #reportar los errores + return errors, type_builder.context + + +class MethodDef(DeclarationNode): + def __init__(self, idx, param_list, return_type, statements): + self.idx = idx + self.param_list = param_list + self.return_type = return_type + self.statements = statements + +class AttributeDef(DeclarationNode): + def __init__(self, idx, typex, default_value = None): + self.idx = idx + self.typex = typex + self.default_value = default_value + +class Param(DeclarationNode): + def __init__(self, idx, typex): + self.id, self.type = idx, typex + +class VariableDeclaration(DeclarationNode): + def __init__(self, var_list, block_statements=None): + self.var_list = var_list + self.block_statements = block_statements + +class BinaryNode(ExpressionNode): + def __init__(self, left, right): + self.left, self.right = left, right + +class AtomicNode(ExpressionNode): + def __init__(self, lex): + self.lex = lex + +class IfThenElseNode(ExpressionNode): + def __init__(self, cond, expr1, expr2): + self.cond = cond + self.expr1 = expr1 + self.expr2 = expr2 + +class PlusNode(BinaryNode): + def __init__(self, left, right): + super(PlusNode,self).__init__(left, right) + +class DifNode(BinaryNode): + def __init__(self, left, right): + super(DifNode,self).__init__(left, right) + +class MulNode(BinaryNode): + def __init__(self, left, right): + super(MulNode, self).__init__(left, right) + +class DivNode(BinaryNode): + def __init__(self, left, right): + super(DivNode, self).__init__(left, right) + +class FunCall(ExpressionNode): + def __init__(self, obj, idx, arg_list): + self.obj = obj + self.id = idx + self.args = arg_list + + +class ParentFuncCall(ExpressionNode): + def __init__(self, obj, parent_type, idx, arg_list): + self.obj = obj + self.parent_type = parent_type + self.idx = idx + self.arg_list = arg_list + + +class AssignNode(ExpressionNode): + def __init__(self, idx, expr): + self.idx = idx + self.expr = expr + +class IntegerConstant(AtomicNode): + def __init__(self, lex): + super(IntegerConstant, self).__init__(int(lex)) + +class StringConstant(AtomicNode): + def __init__(self, lex): + super(StringConstant, self).__init__(lex) + + +class TypeNode(AtomicNode): + def __init__(self, lex): + super(TypeNode, self).__init__(lex) + +class BoleanNode(TypeNode): + def __init__(self, val): + self.val = True if val == 'true' else False + +class FalseConstant(AtomicNode): + def __init__(self): + super(FalseConstant, self).__init__('false') + +class TrueConstant(AtomicNode): + def __init__(self): + super(TrueConstant, self).__init__('true') + +class StringTypeNode(TypeNode): + def __init__(self): + super(StringTypeNode, self).__init__('string') + +class IntegerTypeNode(TypeNode): + def __init__(self): + super(IntegerTypeNode, self).__init__('int') + +class ObjectTypeNode(TypeNode): + def __init__(self): + super(ObjectTypeNode, self).__init__('object') + +class VoidTypeNode(TypeNode): + def __init__(self): + super(VoidTypeNode, self).__init__('void') + + +class ClassDef(DeclarationNode): + def __init__(self, idx, features, parent = 'object'): + self.idx = idx + self.features = features + self.parent = parent + +class VariableCall(ExpressionNode): + def __init__(self,idx): + self.idx = idx + +class GreaterThanNode(BinaryNode): + def __init__(self,left, right): + super(GreaterThanNode, self).__init__(left, right) + +class LowerThanNode(BinaryNode): + def __init__(self,left, right): + super(LowerThanNode, self).__init__(left,right) + +class EqualToNode(BinaryNode): + def __init__(self, left, right): + super().__init__(left,right) + +class LowerEqual(BinaryNode): + def __init__(self,left,right): + super().__init__(left,right) + +class GreaterEqualNode(BinaryNode): + def __init__(self, left, right): + super().__init__(left, right) + +class NotNode(AtomicNode): + def __init__(self, lex): + super().__init__(lex) + +class InstantiateClassNode(ExpressionNode): + def __init__(self, type_, args = None): + self.type_ = type_ + self.args = args + +class WhileBlockNode(ExpressionNode): + def __init__(self, cond, statements): + self.cond = cond + self.statements = statements + + +class ActionNode(ExpressionNode): + def __init__(self, idx, typex, expresion): + self.actions = expresion + self.idx = idx + self.typex = typex + + +class CaseNode(ExpressionNode): + def __init__(self, expression, actions): + self.expression = expression + self.actions = actions + + +class BlockNode(ExpressionNode): + def __init__(self, expressions): + self.expressions = expressions + + +class IsVoidNode(ExpressionNode): + def __init__(self, expr): + self.expr = expr diff --git a/src/abstract/typetree.py b/src/abstract/typetree.py new file mode 100755 index 00000000..9946c9ca --- /dev/null +++ b/src/abstract/typetree.py @@ -0,0 +1,31 @@ +from abstract.semantics import Type, IntegerType, BoolType, VoidType, ObjectType, StringType + +class TreeNode: + def __init__(self, root, children = []): + self.root = root + self.children = children + self.parent = None + + def _add_node(self, new_node: Type): + child = TreeNode(new_node) + child.parent = self + self.children.append(new_node) + +class TypeTree: + def __init__(self): + self.tree = TreeNode(ObjectType(),[TreeNode(IntegerType()),TreeNode(StringType()),TreeNode(BoolType())]) + + def insert(self,node: Type): + stack = [self.tree] + with None as parent: + while True: + current_node = stack.pop() + parent = current_node.root + if node.parent == parent: + break + for child in current_node.children: + stack.append(child) + current_node._add_node(node) + + + \ No newline at end of file diff --git a/src/automatons/.ipynb_checkpoints/transformation-checkpoint.py b/src/automatons/.ipynb_checkpoints/transformation-checkpoint.py new file mode 100755 index 00000000..0f53b841 --- /dev/null +++ b/src/automatons/.ipynb_checkpoints/transformation-checkpoint.py @@ -0,0 +1,15 @@ +from deterministic import DFA +from nondeterministic import NFA +from tools.firsts import ContainerSet + +def compute_epsilon_closure(automaton: NFA, states): + pending = list(states) + closure = set(states) + + while pending: + state = pending.pop() + for nstate in automaton.epsilon_transitions(state): + closure.add(nstate) + pending.append(nstate) + + return closure diff --git a/src/automatons/__init__.py b/src/automatons/__init__.py new file mode 100755 index 00000000..70c8b193 --- /dev/null +++ b/src/automatons/__init__.py @@ -0,0 +1,9 @@ + +def setup(): + import os + from sys import path + BASE = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + path.append(BASE) + +if __name__ == '__main__': + setup() \ No newline at end of file diff --git a/src/automatons/deterministic.py b/src/automatons/deterministic.py new file mode 100755 index 00000000..81f9d9fa --- /dev/null +++ b/src/automatons/deterministic.py @@ -0,0 +1,36 @@ +from automatons.nondeterministic import NFA + +class DFA(NFA): + """ + Esta clase extiende la clase `NFA` para: + - Usar la función de transición propia de los autómatas finitos deterministas. + - Implementar un algoritmo de reconocimiento de cadenas. + """ + def __init__(self, states, finals, transitions, start=0): + assert all(isinstance(value, int) for value in transitions.values()) + assert all(len(symbol) > 0 for origin, symbol in transitions) + + transitions = { key: [value] for key, value in transitions.items() } + NFA.__init__(self, states, finals, transitions, start) + self.current = start + + + def epsilon_transitions(self): + raise TypeError() + + def _move(self, symbol): + try: + self.current = self.transitions[self.current][symbol][0] + return True + except KeyError: + return False + + def _reset(self): + self.current = self.start + + def recognize(self, string): + self.current = self.start + for c in string: + if not self._move(c): + return False + return self.current in self.finals diff --git a/src/automatons/nondeterministic.py b/src/automatons/nondeterministic.py new file mode 100755 index 00000000..36846b1a --- /dev/null +++ b/src/automatons/nondeterministic.py @@ -0,0 +1,64 @@ +class NFA: + """ + Un autómata finito (determinista o no determinista) es un quíntuplo $A = $ con + las siguientes características: + + -Q es un conjunto finito de estados Q = { q_0, .... , q_n }, de ahí el adjetivo de **finito**. + -q_0 in Q es el estado inicial. + -V es un conjunto finito de símbolos que pueden aparecer en la cinta. + -F Q es un subconjunto de estados que denominaremos *estados finales*. + -f es una *función de transición*, que determina, para cada par posible de estados y símbolos, + cuál es el estado de destino. En la forma de esta función radica justamente la diferencia entre + AF determinista y no determinista: + -f: Q * V -> Q denota un autómata **determinista** justamente porque en un estado particular, + para un símbolo particular, existe solamente un estado posible de destino (o ninguno), + por lo tanto, siempre existe una única decisión que tomar. + -f: Q *(V U e) -> 2^Q denota un autómata **no determinista** porque en un estado particular, + para un símbolo particular, existen potencialmente múltiples estados de destino (o ninguno). + Incluso permite realizar epsilon-transiciones (transiciones que no consumen símbolos de la cinta) + lo cual resalta aún más el carácter no determinista de estos autómatas. + """ + def __init__(self, states, finals, transitions, start=0): + self.states = states + self.start = start + self.finals = set(finals) + self.map = transitions + self.vocabulary = set() + self.transitions = { state: {} for state in range(states) } + + for (origin, symbol), destinations in transitions.items(): + assert hasattr(destinations, '__iter__'), 'Invalid collection of states' + self.transitions[origin][symbol] = destinations + self.vocabulary.add(symbol) + + self.vocabulary.discard('') + + def epsilon_transitions(self, state): + assert state in self.transitions, 'Invalid state' + try: + return self.transitions[state][''] + except KeyError: + return () + + def graph(self): + import pydot + G = pydot.Dot(rankdir='LR', margin=0.1) + G.add_node(pydot.Node('start', shape='plaintext', label='', width=0, height=0)) + + # for (start, tran), destinations in self.transitions.items(): + for start, dest in self.transitions.items(): + for tran, destinations in dest.items(): + tran = 'ε' if tran == '' else tran + G.add_node(pydot.Node(start, shape='circle', style='bold' if start in self.finals else '')) + for end in destinations: + G.add_node(pydot.Node(end, shape='circle', style='bold' if end in self.finals else '')) + G.add_edge(pydot.Edge(start, end, label=tran, labeldistance=2)) + + G.add_edge(pydot.Edge('start', self.start, label='', style='dashed')) + return G + + def _repr_svg_(self): + try: + return self.graph().create_svg().decode('utf8') + except: + pass diff --git a/src/automatons/operations.py b/src/automatons/operations.py new file mode 100755 index 00000000..f0aa278f --- /dev/null +++ b/src/automatons/operations.py @@ -0,0 +1,87 @@ +from automatons.nondeterministic import NFA + +def automata_union(a1,a2): + transitions={} + start=0 + d1=1 + d2=a1.states+d1 + u=a2.states+d2 + + for src, d in a1.transitions.items(): + for symbol, dest in d.items(): + transitions[src+d1,symbol]=[state+d1 for state in dest] + + for src, d in a2.transitions.items(): + for symbol, dest in d.items(): + transitions[src+d2,symbol]=[state+d2 for state in dest] + + transitions[start,'']=[a1.start+d1,a2.start+d2] + + for dx,S in zip([d1,d2],[a1.finals,a2.finals]): + for z in S: + try: + eps_trans=transitions[z+dx,''] + except KeyError: + eps_trans=transitions[z+dx,'']=[] + eps_trans.append(u) + + states=a1.states+a2.states+2 + finals={u} + return NFA(states,finals,transitions,start) + +def automata_concatenation(a1,a2): + transitions={} + start=0 + d1=0 + d2=a1.states+d1 + u=a2.states+d2 + + for src, d in a1.transitions.items(): + for symbol, dest in d.items(): + transitions[src+d1,symbol]=[state+d1 for state in dest] + + for src, d in a2.transitions.items(): + for symbol, dest in d.items(): + transitions[src+d2,symbol]=[state + d2 for state in dest] + + for z in a1.finals: + try: + eps_trans=transitions[z+d1,''] + except KeyError: + eps_trans=transitions[z+d1,'']=[] + eps_trans.append(a2.start+d2) + + for z in a2.finals: + try: + eps_trans=transitions[z+d2,''] + except KeyError: + eps_trans=transitions[z+d2,'']=[] + eps_trans.append(u) + + states=a1.states+a2.states+2 + finals={u} + return NFA(states,finals,transitions,start) + +def automata_closure(a1): + transitions={} + start=0 + d1=1 + u=a1.states+d1 + + for A, d in a1.transitions.items(): + for b, O in d.items(): + transitions[A+d1,b]=[F+d1 for F in O] + transitions[start,'']=[a1.start+d1,u] + + for z in a1.finals: + try: + X=transitions[z+d1,''] + except KeyError: + X=transitions[z+d1,'']=[] + X.append(u) + X.append(a1.start+d1) + + states=a1.states+2 + finals={u} + return NFA(states,finals,transitions,start) + diff --git a/src/automatons/state.py b/src/automatons/state.py new file mode 100755 index 00000000..887876aa --- /dev/null +++ b/src/automatons/state.py @@ -0,0 +1,171 @@ +class State: + def __init__(self, state, final=False): + self.state = state + self.final = final + self.transitions = {} + self.epsilon_transitions = set() + self.tag = None + + def has_transition(self, symbol): + return symbol in self.transitions + + def add_transition(self, symbol, state): + try: + self.transitions[symbol].append(state) + except: + self.transitions[symbol] = [state] + return self + + def add_epsilon_transition(self, state): + self.epsilon_transitions.add(state) + return self + + def recognize(self, string): + states = self.epsilon_closure + for symbol in string: + states = self.move_by_state(symbol, *states) + states = self.epsilon_closure_by_state(*states) + return any(s.final for s in states) + + def to_deterministic(self): + closure = self.epsilon_closure + start = State(tuple(closure), any(s.final for s in closure)) + + closures = [ closure ] + states = [ start ] + pending = [ start ] + + while pending: + state = pending.pop() + symbols = { symbol for s in state.state for symbol in s.transitions } + + for symbol in symbols: + move = self.move_by_state(symbol, *state.state) + closure = self.epsilon_closure_by_state(*move) + + if closure not in closures: + new_state = State(tuple(closure), any(s.final for s in closure)) + closures.append(closure) + states.append(new_state) + pending.append(new_state) + else: + index = closures.index(closure) + new_state = states[index] + + state.add_transition(symbol, new_state) + + return start + + @staticmethod + def from_nfa(nfa, get_states=False): + states = [] + for n in range(nfa.states): + state = State(n, n in nfa.finals) + states.append(state) + + for origin, dest in nfa.transitions.items(): + for symbol,destinations in dest.items(): + src = states[origin] + src[symbol] = [ states[d] for d in destinations ] + + if get_states: + return states[nfa.start], states + return states[nfa.start] + + @staticmethod + def move_by_state(symbol, *states): + return { s for state in states if state.has_transition(symbol) for s in state[symbol]} + + @staticmethod + def epsilon_closure_by_state(*states): + closure = { state for state in states } + + l = 0 + while l != len(closure): + l = len(closure) + tmp = [s for s in closure] + for s in tmp: + for epsilon_state in s.epsilon_transitions: + closure.add(epsilon_state) + return closure + + @property + def epsilon_closure(self): + return self.epsilon_closure_by_state(self) + + @property + def name(self): + return str(self.state) if isinstance(self.state, int) else\ + '\n'.join([str(x) for x in self.state]) + + def __getitem__(self, symbol): + if symbol == '': + return self.epsilon_transitions + try: + return self.transitions[symbol] + except KeyError: + return None + + def __setitem__(self, symbol, value): + if symbol == '': + self.epsilon_transitions = value + else: + self.transitions[symbol] = value + + def __repr__(self): + return str(self) + + def __str__(self): + return str(self.state) + + def __hash__(self): + return hash(frozenset(self.state)) if not isinstance(self.state, int) else\ + hash(self.state) + + def graph(self): + import pydot + G = pydot.Dot(rankdir='LR', margin=0.1) + G.add_node(pydot.Node('start', shape='plaintext', label='', width=0, height=0)) + + visited = set() + def visit(start): + ids = id(start) + if ids not in visited: + visited.add(ids) + G.add_node(pydot.Node(ids, label=start.name, shape='circle', style='bold' if start.final else '')) + for tran, destinations in start.transitions.items(): + for end in destinations: + visit(end) + G.add_edge(pydot.Edge(ids, id(end), label=tran, labeldistance=2)) + for end in start.epsilon_transitions: + visit(end) + G.add_edge(pydot.Edge(ids, id(end), label='ε', labeldistance=2)) + + visit(self) + G.add_edge(pydot.Edge('start', id(self), label='', style='dashed')) + + return G + + def _repr_svg_(self): + try: + return self.graph().create_svg().decode('utf8') + except: + pass + + def __iter__(self): + yield from self._visit() + + def _visit(self, visited=None): + if visited is None: + visited = set() + elif self in visited: + return + + visited.add(self) + yield self + + for destinations in self.transitions.values(): + for node in destinations: + yield from node._visit(visited) + for node in self.epsilon_transitions: + yield from node._visit(visited) \ No newline at end of file diff --git a/src/automatons/transformation.py b/src/automatons/transformation.py new file mode 100755 index 00000000..d518e87e --- /dev/null +++ b/src/automatons/transformation.py @@ -0,0 +1,52 @@ +#%% +from automatons.deterministic import DFA +from automatons.nondeterministic import NFA +from tools.firsts import ContainerSet + +def compute_epsilon_closure(automaton: NFA, states): + pending = list(states) + closure = set(states) + + while pending: + state = pending.pop() + for nstate in automaton.epsilon_transitions(state): + if nstate not in closure: + closure.add(nstate) + pending.append(nstate) + + return ContainerSet(*closure) + + +def nfa_to_deterministic(automaton: NFA): + transitions = {} + start = compute_epsilon_closure(automaton,[automaton.start]) + start.state = 0 + pending = [start] + aut_states = [start] + start.is_final = any(s in automaton.finals for s in start) + n = 1 + while pending: + state = pending.pop() + for symbol in automaton.vocabulary: + next_state = [] + for s in state: + next_state+=[x for x in automaton.transitions.get(s,{}).get(symbol,[])] + if next_state: + try: + transitions[state.state,symbol] + assert False, "Automato Finito Determinista Invalido" + except KeyError: + next_state = compute_epsilon_closure(automaton, next_state) + if not next_state in aut_states: + next_state.state = n + next_state.is_final = any(s in automaton.finals for s in next_state) + pending.append(next_state) + aut_states.append(next_state) + n+=1 + else: + next_state = aut_states[aut_states.index(next_state)] + transitions[state.state, symbol] = next_state.state + + finals = [s.state for s in aut_states if s.is_final] + dfa = DFA(n, finals, transitions) + return dfa diff --git a/src/baseNodeTree/__init__.py b/src/baseNodeTree/__init__.py new file mode 100755 index 00000000..70c8b193 --- /dev/null +++ b/src/baseNodeTree/__init__.py @@ -0,0 +1,9 @@ + +def setup(): + import os + from sys import path + BASE = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + path.append(BASE) + +if __name__ == '__main__': + setup() \ No newline at end of file diff --git a/src/baseNodeTree/astprinter.py b/src/baseNodeTree/astprinter.py new file mode 100755 index 00000000..a4b87040 --- /dev/null +++ b/src/baseNodeTree/astprinter.py @@ -0,0 +1,28 @@ +import tools.visitor as visitor + +def get_printer(AtomicNode=(), UnaryNode=(), BinaryNode=(), ): + + class PrintVisitor(object): + @visitor.on('node') + def visit(self, node, tabs): + pass + + @visitor.when(UnaryNode) + def visit(self, node, tabs=0): + ans = '\t' * tabs + f'\\__ {node.__class__.__name__}' + child = self.visit(node.node, tabs + 1) + return f'{ans}\n{child}' + + @visitor.when(BinaryNode) + def visit(self, node, tabs=0): + ans = '\t' * tabs + f'\\__ {node.__class__.__name__} ' + left = self.visit(node.left, tabs + 1) + right = self.visit(node.right, tabs + 1) + return f'{ans}\n{left}\n{right}' + + @visitor.when(AtomicNode) + def visit(self, node, tabs=0): + return '\t' * tabs + f'\\__ {node.__class__.__name__}: {node.lex}' + + printer = PrintVisitor() + return (lambda ast: printer.visit(ast)) \ No newline at end of file diff --git a/src/baseNodeTree/base.py b/src/baseNodeTree/base.py new file mode 100755 index 00000000..7a0f7812 --- /dev/null +++ b/src/baseNodeTree/base.py @@ -0,0 +1,33 @@ +class Node: + def evaluate(self): + raise NotImplementedError() + +class AtomicNode(Node): + def __init__(self, lex): + self.lex = lex + +class UnaryNode(Node): + def __init__(self, node): + self.node = node + + def evaluate(self): + value = self.node.evaluate() + return self.operate(value) + + @staticmethod + def operate(value): + raise NotImplementedError() + +class BinaryNode(Node): + def __init__(self, left, right): + self.left = left + self.right = right + + def evaluate(self): + lvalue = self.left.evaluate() + rvalue = self.right.evaluate() + return self.operate(lvalue, rvalue) + + @staticmethod + def operate(lvalue, rvalue): + raise NotImplementedError() diff --git a/src/coolgrammar/__init__.py b/src/coolgrammar/__init__.py new file mode 100755 index 00000000..e69de29b diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py new file mode 100755 index 00000000..df046ebc --- /dev/null +++ b/src/coolgrammar/grammar.py @@ -0,0 +1,275 @@ +''' +Contenedor para la funcion que construye la gramatica de cool. +''' +from grammar.grammar import Grammar +from abstract.tree import ProgramNode, ClassDef, MethodDef, AttributeDef, Param, VariableDeclaration +from abstract.tree import PlusNode, DivNode, MulNode, DifNode, IntegerConstant, FunCall +from abstract.tree import VariableCall, FalseConstant, StringConstant, GreaterThanNode, TrueConstant +from abstract.tree import GreaterEqualNode, LowerThanNode, LowerEqual, AssignNode, IfThenElseNode +from abstract.tree import NotNode, WhileBlockNode, EqualToNode, InstantiateClassNode +from abstract.tree import ActionNode, CaseNode, ParentFuncCall, BlockNode, IsVoidNode +from lexer.tokenizer import Lexer + +def build_cool_grammar(): + G = Grammar() + program = G.NonTerminal('', True) + + class_list, class_def, empty_feature_list, feature_list, meod_def = \ + G.NonTerminals(' ') + + attr_def, param_list, param, statement_list = G.NonTerminals(' ') + + var_dec, args_list, instantiation = G.NonTerminals(' ') + + exp, typex, term, factor, nested_lets = G.NonTerminals(' ') + + arith, atom, actions, action, block= G.NonTerminals(' ') + + args_list_empty, param_list_empty, case_statement = G.NonTerminals(' ') + + class_keyword, def_keyword, in_keyword = G.Terminals('class def in') + + coma, period, dot_comma, opar, cpar, obrack, cbrack, plus, minus, star, div, dd = G.Terminals(', . ; ( ) { } + - * / :') + + idx, let, intx, string, num, equal, true, false, boolean, objectx =\ + G.Terminals('id let int string num = true false bool object') + + string_const, void, auto = G.Terminals('string_const void AUTO_TYPE') + + if_, then, else_, assign, new, case, of, esac = G.Terminals('if then else assign new case of esac') + + gt, lt , ge, le, eq, not_, implies, isvoid = G.Terminals('> < >= <= == ! => isvoid') + + while_, do, inherits, arroba, fi, pool, loop = G.Terminals('while do inherits @ fi pool loop') + + # Definir un programa como un conjunto de clases. + program %= class_list, lambda s: ProgramNode(s[1]) + + # Definir un conjunto de clases como una clase o una clase mas una lista de clases. + class_list %= class_def, lambda s: [s[1]] + class_list %= class_def + class_list, lambda s: [s[1]] + s[2] + + # Definir la estructura de la declaracion de una clase. + # Una clase no es mas que un conjunto de features. + class_def %= class_keyword + idx + obrack + feature_list + cbrack + dot_comma, \ + lambda s: ClassDef(s[2], s[4]) + + # Definir la estructura de la declaracion de una clase con herencia. + class_def %= class_keyword + idx + inherits + typex + obrack + feature_list + \ + cbrack + dot_comma, lambda s: ClassDef(s[2], s[6], s[4]) + + # Definir un conjunto de features como un metodo unico. + feature_list %= meod_def + dot_comma, lambda s: [s[1]] + + # Definir un conjunto de features como un unico atributo. + feature_list %= attr_def + dot_comma, lambda s: [s[1]] + + # Definir una lista de features como la declaracion de un metodo + # mas una lista de features. + feature_list %= meod_def + dot_comma + feature_list, lambda s: [s[1]] + s[3] + + # Definir una lista de features como la declaracion de un atributo + # mas una lista de features. + feature_list %= attr_def + dot_comma +feature_list, lambda s: [s[1]] + s[3] + + # Definir la estructura de la declaracion de un metodo. + meod_def %= idx + opar + param_list_empty + cpar + dd + typex + obrack +\ + statement_list + cbrack, lambda s: MethodDef(s[1], s[3], s[6], s[8]) + + # Definir la estructura de la declaracion de un atributo. + attr_def %= idx + dd + typex, lambda s: AttributeDef(s[1],s[3]) + + # Definir la estructura de la declaracion de un atributo con valor por defecto. + attr_def %= idx + dd + typex + assign + exp, lambda s: AttributeDef(s[1], s[3], s[5]) + + # Definir la lista de parametros como una lista de parametros o una lista vacia + param_list_empty %= param_list, lambda s: s[1] + param_list_empty %= G.Epsilon, lambda s: [] + + # Definir una lista de parametros como un parametro separado por coma con una lista + # de parametros o simplemente un parametro + param_list %= param, lambda s: [s[1]] + param_list %= param + coma + param_list, lambda s: [s[1]] + s[3] + + # Definir un la estructura de un parametro como un identificador : Tipo + param %= idx + dd + typex, lambda s: Param(s[1], s[3]) + + # Definir una lista de sentencias como una expresion terminada en punto y coma o + # una expresion y una lista de sentencias separadas por punto y coma. + statement_list %= exp + dot_comma, lambda s: [s[1]] + + statement_list %= exp + dot_comma + statement_list, lambda s: [s[1]] + s[3] + + var_dec %= let + nested_lets + in_keyword + exp, lambda s: VariableDeclaration(s[2], s[4]) + + nested_lets %= idx + dd + typex, lambda s: [(s[1], s[3], None)] + + nested_lets %= idx + dd + typex + coma + nested_lets, lambda s: [(s[1], s[3], None)] + s[5] + + nested_lets %= idx + dd + typex + assign + exp, lambda s: [(s[1], s[3], s[5])] + + nested_lets %= idx + dd + typex + assign + exp + coma + \ + nested_lets, lambda s: [(s[1], s[3], s[5])] + s[7] + + # Una expresion puede ser una declaracion de una variable + exp %= var_dec, lambda s: s[1] + + # Una expresion puede ser una constante (True, False, un string, un entero, etc) + exp %= true, lambda s: TrueConstant() + + exp %= string_const, lambda s: StringConstant(s[1]) + + exp %= false, lambda s: FalseConstant() + + # Una expresion puede ser una sentencia de comparacion + exp %= atom, lambda s: s[1] + + # Una expresion puede ser un bloque IfThenElse + exp %= if_ + exp + then + exp + else_ + exp + fi, lambda s: IfThenElseNode(s[2], s[4], s[6]) + + # Una expresion puede ser una asignacion + exp %= idx + assign + exp, lambda s: AssignNode(s[1], s[3]) + + # Una expresion puede ser una instanciacion de una clase + exp %= instantiation, lambda s: s[1] + + instantiation %= new + idx + opar + args_list_empty + cpar, lambda s: InstantiateClassNode(s[2], s[4]) + + # Una expresion puede ser un bloque while + exp %= while_ + exp + loop + statement_list + pool, lambda s: WhileBlockNode(s[3], s[7]) + + exp %= arith, lambda s: s[1] + + exp %= block, lambda s: s[1] + + exp %= case_statement, lambda s: s[1] + + exp %= isvoid + exp, lambda s: IsVoidNode(s[2]) + + block %= obrack + statement_list + cbrack, lambda s: BlockNode(s[2]) + + arith %= arith + plus + term, lambda s: PlusNode(s[1], s[3]) + + arith %= arith + minus + term, lambda s: DifNode(s[1], s[3]) + + arith %= term, lambda s: s[1] + + term %= term + star + factor, lambda s: MulNode(s[1], s[3]) + + term %= term + div + factor, lambda s: DivNode(s[1], s[3]) + + term %= factor, lambda s: s[1] + + factor %= opar + arith + cpar, lambda s: s[2] + + factor %= num, lambda s: IntegerConstant(s[1]) + + factor %= idx, lambda s: VariableCall(s[1]) + + factor %= factor + period + idx + opar + args_list_empty + cpar, lambda s: FunCall(s[1], + s[3], + s[5]) + + factor %= idx + opar + args_list_empty + cpar, lambda s: FunCall('self', s[1], s[3]) + + factor %= factor + arroba + typex + period + idx + opar + args_list_empty + cpar, lambda s: \ + ParentFuncCall(s[1], s[3], s[5], s[7]) + + atom %= factor + gt + factor, lambda s: GreaterThanNode(s[1], s[3]) + + atom %= factor + lt + factor, lambda s: LowerThanNode(s[1], s[3]) + + atom %= factor + eq + factor, lambda s: EqualToNode(s[1], s[3]) + + atom %= factor + ge + factor, lambda s: GreaterEqualNode(s[1], s[3]) + + atom %= factor + le + factor, lambda s: LowerEqual(s[1], s[3]) + + atom %= not_ + factor, lambda s: NotNode(s[2]) + + + typex %= intx, lambda s: 'int' + + typex %= boolean, lambda s: 'bool' + + typex %= string, lambda s: 'string' + + typex %= objectx, lambda s: 'object' + + typex %= idx, lambda s: s[1] + + typex %= auto, lambda s: 'AUTO_TYPE' + + typex %= void, lambda s: 'void' + + args_list_empty %= args_list, lambda s: s[1] + + args_list_empty %= G.Epsilon, lambda s: [] + + args_list %= exp, lambda s: [s[1]] + + args_list %= exp + coma + args_list, lambda s: [s[1]] + s[3] + + actions %= action, lambda s: [s[1]] + + actions %= action + actions, lambda s: [s[1]] + s[2] + + action %= idx + dd + typex + implies + exp + dot_comma, lambda s: ActionNode(s[1], s[3], s[5]) + + case_statement %= case + exp + of + actions + esac, lambda s: CaseNode(s[2], s[4]) + + table = [(class_keyword, 'class'), + (def_keyword, 'def'), + (in_keyword, 'in'), + (intx, 'int'), + (boolean, 'bool'), + (objectx, 'object'), + (string, 'string'), + (true, ' true'), + (false, 'false'), + (auto, 'AUTO_TYPE'), + (if_, 'if'), + (then, 'then'), + (else_, 'else'), + (new, 'new'), + (while_, 'while'), + (do, 'do'), + (esac, 'esac'), + (case, 'case'), + (of, 'of'), + (inherits, 'inherits'), + (coma, ','), + (period, '.'), + (dd, ':'), + (dot_comma, ';'), + (arroba, '@'), + (assign, r'<\-'), + (lt, r'\<'), + (gt, r'\>'), + (ge, '>='), + (le, '<='), + (eq, '=='), + (not_, r'\!'), + (equal, '='), + (opar, r'\('), + (cpar, r'\)'), + (obrack, r'\{'), + (cbrack, r'\}'), + (plus, r'\+'), + (minus, r'\-'), + (implies, r'=>'), + (div, '/'), + (star, r'\*'), + (let, 'let'), + (fi, 'fi'), + (pool, 'pool'), + (loop, 'loop'), + (isvoid, 'isvoid'), + (idx, '(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N|n|O|o|P|p|'+ + 'Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|_)+'), + (num, '0|(1|2|3|4|5|6|7|8|9)(1|2|3|4|5|6|7|8|9|0)*'), + (string_const, r"\"(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N"+ + r"|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|\ )+\"")] + + lexer = Lexer(table, G.EOF, ignore_white_space=False) + return G, lexer diff --git a/src/grammar/.ipynb_checkpoints/grammar-checkpoint.py b/src/grammar/.ipynb_checkpoints/grammar-checkpoint.py new file mode 100755 index 00000000..08056b81 --- /dev/null +++ b/src/grammar/.ipynb_checkpoints/grammar-checkpoint.py @@ -0,0 +1,174 @@ +from grammar.symbols import (NonTerminal, Terminal, Sentence, + Epsilon, EOF, AttributeProduction) +import json + + +class Grammar(): + + def __init__(self): + + self.Productions = [] + self.nonTerminals = [] + self.terminals = [] + self.startSymbol = None + # production type + self.pType = None + self.Epsilon = Epsilon(self) + self.EOF = EOF(self) + + self.symbDict = {} + + def NonTerminal(self, name, startSymbol=False): + + name = name.strip() + if not name: + raise Exception("Empty name") + + term = NonTerminal(name, self) + + if startSymbol: + + if self.startSymbol is None: + self.startSymbol = term + else: + raise Exception("Cannot define more than one start symbol.") + + self.nonTerminals.append(term) + self.symbDict[name] = term + return term + + def NonTerminals(self, names): + + ans = tuple((self.NonTerminal(x) for x in names.strip().split())) + + return ans + + def Add_Production(self, production): + + if len(self.Productions) == 0: + self.pType = type(production) + + assert type( + production) == self.pType, "The Productions most be of only 1 type." + + production.Left.productions.append(production) + self.Productions.append(production) + + def Terminal(self, name): + + name = name.strip() + if not name: + raise Exception("Empty name") + + term = Terminal(name, self) + self.terminals.append(term) + self.symbDict[name] = term + return term + + def Terminals(self, names): + + ans = tuple((self.Terminal(x) for x in names.strip().split())) + + return ans + + def __str__(self): + + mul = '%s, ' + + ans = 'Non-Terminals:\n\t' + + nonterminals = mul * (len(self.nonTerminals) - 1) + '%s\n' + + ans += nonterminals % tuple(self.nonTerminals) + + ans += 'Terminals:\n\t' + + terminals = mul * (len(self.terminals) - 1) + '%s\n' + + ans += terminals % tuple(self.terminals) + + ans += 'Productions:\n\t' + + ans += str(self.Productions) + + return ans + + @property + def to_json(self): + + productions = [] + + for p in self.Productions: + head = p.Left.Name + + body = [] + + for s in p.Right: + body.append(s.Name) + + productions.append({'Head': head, 'Body': body}) + + d = {'NonTerminals': [symb.Name for symb in self.nonTerminals], 'Terminals': + [symb.Name for symb in self.terminals], + 'Productions': productions} + + return json.dumps(d) + + @staticmethod + def from_json(data): + data = json.loads(data) + + G = Grammar() + dic = {'epsilon': G.Epsilon} + + for term in data['Terminals']: + dic[term] = G.Terminal(term) + + for noTerm in data['NonTerminals']: + dic[noTerm] = G.NonTerminal(noTerm) + + for p in data['Productions']: + head = p['Head'] + dic[head] %= Sentence(*[dic[term] for term in p['Body']]) + + return G + + def copy(self): + G = Grammar() + G.Productions = self.Productions.copy() + G.nonTerminals = self.nonTerminals.copy() + G.terminals = self.terminals.copy() + G.pType = self.pType + G.startSymbol = self.startSymbol + G.Epsilon = self.Epsilon + G.EOF = self.EOF + G.symbDict = self.symbDict.copy() + + return G + + @property + def IsAugmentedGrammar(self): + augmented = 0 + for left, right in self.Productions: + if self.startSymbol == left: + augmented += 1 + if augmented <= 1: + return True + else: + return False + + def AugmentedGrammar(self): + if not self.IsAugmentedGrammar: + + G = self.copy() + S = G.startSymbol + G.startSymbol = None + SS = G.NonTerminal('S\'', True) + if G.pType is AttributeProduction: + SS %= S + G.Epsilon, lambda x: x + else: + SS %= S + G.Epsilon + + return G + else: + return self.copy() diff --git a/src/grammar/.ipynb_checkpoints/symbols-checkpoint.py b/src/grammar/.ipynb_checkpoints/symbols-checkpoint.py new file mode 100755 index 00000000..acb29eaa --- /dev/null +++ b/src/grammar/.ipynb_checkpoints/symbols-checkpoint.py @@ -0,0 +1,439 @@ + +class Symbol(object): + """ + Modelaremos los símbolos del lenguaje con la clase Symbol. + Esta clase funcionará como base para la definición de terminales y no terminales. + Entre las funcionalidades básicas de los símbolos tenemos que: + + -Pueden ser agrupados con el operador + para formar oraciones. + -Podemos conocer si representa la cadena especial epsilon a través de la propiedad IsEpsilon + que poseen todas las instancias. + -Podemos acceder a la gramática en la que se definió a través del campo Grammar de cada + instancia. + -Podemos consultar la notación del símbolo a través del campo Name de cada instancia. + + Los símbolos no deben ser instanciados directamente (ni sus descendiente) con la aplicación + de su constructor. + """ + + def __init__(self, name, grammar): + self.Name = name + self.Grammar = grammar + + def __str__(self): + return self.Name + + def __repr__(self): + return repr(self.Name) + + def __add__(self, other): + if isinstance(other, Symbol): + return Sentence(self, other) + + raise TypeError(other) + + def __or__(self, other): + + if isinstance(other, (Sentence)): + return SentenceList(Sentence(self), other) + + raise TypeError(other) + + @property + def IsEpsilon(self): + return False + + def __len__(self): + return 1 + + +class Terminal(Symbol): + """ + Los símbolos terminales los modelaremos con la clase Terminal. + Dicha clase extiende la clase Symbol para: + + -Incluir propiedades IsNonTerminal - IsTerminal que devolveran True - False respectivamente. + + Los terminales no deben ser instanciados directamente con la aplicación de su constructor. + """ + + def __init__(self, name, grammar): + super().__init__(name, grammar) + + @property + def IsTerminal(self): + return True + + @property + def IsNonTerminal(self): + return False + + @property + def IsEpsilon(self): + return False + + +class NonTerminal(Symbol): + """ + Los símbolos no terminales los modelaremos con la clase NonTerminal. + Dicha clase extiende la clase Symbol para: + + -Añadir noción de las producción que tiene al no terminal como cabecera. + Estas pueden ser conocidas a través del campo productions de cada instancia. + -Permitir añadir producciones para ese no terminal a través del operador %=. + -Incluir propiedades IsNonTerminal - IsTerminal que devolveran True - False respectivamente. + + Los no terminales no deben ser instanciados directamente con la aplicación de su constructor. + """ + + def __init__(self, name, grammar): + super().__init__(name, grammar) + self.productions = [] + + def __imod__(self, other): + + if isinstance(other, (Sentence)): + p = Production(self, other) + self.Grammar.Add_Production(p) + return self + + # if isinstance(other, tuple): + # assert len( + # other) == 2, "Tiene que ser una Tupla de 2 elementos (sentence, attribute)" + # + # if isinstance(other[0], Symbol): + # p = AttributeProduction(self, Sentence(other[0]), other[1]) + # elif isinstance(other[0], Sentence): + # p = AttributeProduction(self, other[0], other[1]) + # else: + # raise Exception("") + # + # self.Grammar.Add_Production(p) + # return self + + if isinstance(other, tuple): + assert len(other) > 1 + + if len(other) == 2: + other += (None,) * len(other[0]) + + assert len(other) == len(other[0]) + 2, "Debe definirse una, y solo una, regla por cada símbolo de la producción" + + if isinstance(other[0], Symbol) or isinstance(other[0], Sentence): + p = AttributeProduction(self, other[0], other[1:]) + else: + raise Exception("") + + self.Grammar.Add_Production(p) + return self + + if isinstance(other, Symbol): + p = Production(self, Sentence(other)) + self.Grammar.Add_Production(p) + return self + + if isinstance(other, SentenceList): + + for s in other: + p = Production(self, s) + self.Grammar.Add_Production(p) + + return self + + raise TypeError(other) + + @property + def IsTerminal(self): + return False + + @property + def IsNonTerminal(self): + return True + + @property + def IsEpsilon(self): + return False + + +class EOF(Terminal): + """ + Modelaremos el símbolo de fin de cadena con la clase EOF. + Dicha clase extiende la clases Terminal para heradar su comportamiento. + + La clase EOF no deberá ser instanciada directamente con la aplicación de su constructor. + En su lugar, una instancia concreta para determinada gramática G de Grammar se construirá + automáticamente y será accesible a través de G.EOF. + """ + + def __init__(self, Grammar): + super().__init__('$', Grammar) + + +class Sentence(object): + """ + Modelaremos los oraciones y formas oracionales del lenguaje con la clase Sentence. + Esta clase funcionará como una colección de terminales y no terminales. + Entre las funcionalidades básicas que provee tenemos que nos : + + -Permite acceder a los símbolos que componen la oración a través del campo _symbols de + cada instancia. + -Permite conocer si la oración es completamente vacía a través de la propiedad IsEpsilon. + -Permite obtener la concatenación con un símbolo u otra oración aplicando el operador +. + -Permite conocer la longitud de la oración (cantidad de símbolos que la componen) + utilizando la función build-in de python len(...). + + Las oraciones pueden ser agrupadas usando el operador |. + Esto nos será conveniente para definir las producciones tengan la misma cabecera + (no terminal en la parte izquierda) en una única sentencia. + El grupo de oraciones se maneja con la clase SentenceList. + + No se deben crear instancias de Sentence y SentenceList directamente + con la aplicación de los respectivos constructores. + En su lugar, usaremos el operador + entre símbolos para formar las oraciones, + y el operador | entre oraciones para agruparlas. + """ + + def __init__(self, *args): + self._symbols = tuple(x for x in args if not x.IsEpsilon) + self.hash = hash(self._symbols) + + def __len__(self): + return len(self._symbols) + + def __add__(self, other): + if isinstance(other, Symbol): + return Sentence(*(self._symbols + (other,))) + + if isinstance(other, Sentence): + return Sentence(*(self._symbols + other._symbols)) + + raise TypeError(other) + + def __or__(self, other): + if isinstance(other, Sentence): + return SentenceList(self, other) + + if isinstance(other, Symbol): + return SentenceList(self, Sentence(other)) + + raise TypeError(other) + + def __repr__(self): + return str(self) + + def __str__(self): + return ("%s " * len(self._symbols) % tuple(self._symbols)).strip() + + def __iter__(self): + return iter(self._symbols) + + def __getitem__(self, index): + return self._symbols[index] + + def __eq__(self, other): + return self._symbols == other._symbols + + def __hash__(self): + return self.hash + + @property + def IsEpsilon(self): + return False + +class SentenceList(object): + + def __init__(self, *args): + self._sentences = list(args) + + def Add(self, symbol): + if not symbol and (symbol is None or not symbol.IsEpsilon): + raise ValueError(symbol) + + self._sentences.append(symbol) + + def __iter__(self): + return iter(self._sentences) + + def __or__(self, other): + if isinstance(other, Sentence): + self.Add(other) + return self + + if isinstance(other, Symbol): + return self | Sentence(other) + +class Epsilon(Terminal, Sentence): + """ + Modelaremos tanto la cadena vacía como el símbolo que la representa: epsilon (ϵ), + en la misma clase: Epsilon. + Dicha clase extiende las clases Terminal y Sentence por lo que ser comporta como ambas. + Sobreescribe la implementación del método IsEpsilon para indicar que en efecto toda instancia + de la clase reprensenta epsilon. + + La clase Epsilon no deberá ser instanciada directamente con la aplicación de su constructor. + En su lugar, una instancia concreta para determinada gramática G de Grammar se construirá + automáticamente y será accesible a través de G.Epsilon. + """ + + def __init__(self, grammar): + super().__init__('epsilon', grammar) + + + def __str__(self): + return "e" + + def __repr__(self): + return 'epsilon' + + def __iter__(self): + yield self + + def __len__(self): + return 0 + + def __add__(self, other): + return other + + def __eq__(self, other): + return isinstance(other, (Epsilon,)) + + def __hash__(self): + return hash("") + + @property + def IsEpsilon(self): + return True + + +class Production(object): + """ + Modelaremos las producciones con la clase Production. Las funcionalidades básicas + con que contamos son: + + -Poder acceder la cabecera (parte izquierda) y cuerpo (parte derecha) de cada + producción a través de los campos Left y Right respectivamente. + -Consultar si la producción es de la forma X→ϵ a través de la propiedad IsEpsilon. + -Desempaquetar la producción en cabecera y cuerpo usando asignaciones: left, right = production. + + Las producciones no deben ser instanciadas directamente con la aplicación de su constructor. + En su lugar, se presentan las siguientes facilidades para formar producciones a partir + de una instancia G de Grammar y un grupo de terminales y no terminales: + + Para definir una producción de la forma E→E+T: + + E %= E + plus + T + + Para definir múltiples producciones de la misma cabecera en una única sentencia (E→E+T | E−T | T): + + E %= E + plus + T | E + minus + T | T + + Para usar epsilon en una producción (ejemplo S→aS | ϵ) haríamos: + + S %= S + a | G.Epsilon + """ + + def __init__(self, nonTerminal, sentence): + + self.Left = nonTerminal + self.Right = sentence + + def __str__(self): + + return '%s := %s' % (self.Left, self.Right) + + def __repr__(self): + + return '%s -> %s' % (self.Left, self.Right) + + def __iter__(self): + yield self.Left + yield self.Right + + def __eq__(self, other): + return isinstance(other, Production) and self.Left == other.Left and self.Right == other.Right + + + @property + def IsEpsilon(self): + return self.Right.IsEpsilon + +class AttributeProduction(Production): + """ + Con esta clase modelaremos las producciones de las gramáticas atributadas. + Cada una de estas producciones se compone por: + + Un no terminal como cabecera. Accesible a través del campo Left. + Una oración como cuerpo. Accesible a través del campo Right. + Un conjunto de reglas para evaluar los atributos. Accesible a través del campo atributes. + + Las producciones no deben ser instanciadas directamente con la aplicación de su constructor. + En su lugar, se presentan las siguientes facilidades para formar producciones a partir de una + instancia G de Grammar y un grupo de terminales y no terminales: + + Para definir una producción de la forma B0→B1B2...Bn que: + + -Asocia a B0 una regla λ0 para sintetizar sus atributos, y Asocia a B1…Bn las reglas λ1…λn + que hereden sus atributos respectivamentes. + + B0 %= B1 + B2 + ... + Bn, lambda0, lambda1, lambda2, ..., lambdaN + + Donde lambda0, lambda1, ..., lambdaN son funciones que reciben 2 parámetros. + + Como primer parámetro los atributos heredados que se han computado para cada instancia + de símbolo en la producción, durante la aplicación de esa instancia de producción específicamente. + Los valores se acceden desde una lista de n + 1 elementos. Los valores se ordenan según aparecen + los símbolos en la producción, comenzando por la cabecera. Nos referiremos a esta colección como inherited. + Como segundo parámetro los atributos sintetizados que se han computado para cada instancia de símbolo + en la producción, durante la aplicación de esa instancia de producción específicamente. + Sigue la misma estructura que el primer parámetro. Nos referiremos a esta colección como synteticed. + + La función lambda0 sintetiza los atributos de la cabecera. + La evaluación de dicha función produce el valor de synteticed[0]. + El resto de los atributos sintetizados de los símbolos de la producción se calcula de la siguiente forma: + + -En caso de que el símbolo sea un terminal, evalúa como su lexema. + -En caso de que el símbolo sea un no terminal, se obtiene de evaluar la función lambda0 en la + instancia de producción correspondiente. + + La función lambda_i, con i entre 1 y n, computa los atributos heredados de la i-ésima ocurrencia + de símbolo en la producción. La evaluación de dicha función produce el valor de inherited[i]. + El valor de inherited[0] se obtiene como el atributo que heredó la instancia concreta del símbolo + en la cabecera antes de comenzar a aplicar la producción. + + En caso de que no se vaya a sociar una regla a un símbolo se incluirá un None. + + E %= T X , lambda h,s: s[2] , None , lambda h,s: s[1] + # ___________ ________________ ________ ________________ + # producción | regla para E | sin regla | regla para X + + [0]: lambda h,s: s[2] al ser lambda0 sintetiza el valor de E. Lo hace en función del valor que + sintetiza X (accesible desde s[2]). + [1]: None al ser lambda1 indica que no se incluye regla para heredar valor a T. + [2]: lambda h,s: s[1] al ser lambda2 hereda un valor a X. Lo hace en función del valor que sintetiza T + accesible desde s[1]). + + No se deben definir múltiples producciones de la misma cabecera en una única sentencia. + + """ + + def __init__(self, nonTerminal, sentence, attributes): + if not isinstance(sentence, Sentence) and isinstance(sentence, Symbol): + sentence = Sentence(sentence) + super(AttributeProduction, self).__init__(nonTerminal, sentence) + + self.attributes = attributes + + def __str__(self): + return '%s := %s' % (self.Left, self.Right) + + def __repr__(self): + return '%s -> %s' % (self.Left, self.Right) + + def __iter__(self): + yield self.Left + yield self.Right + + + @property + def IsEpsilon(self): + return self.Right.IsEpsilon diff --git a/src/grammar/__init__.py b/src/grammar/__init__.py new file mode 100755 index 00000000..70c8b193 --- /dev/null +++ b/src/grammar/__init__.py @@ -0,0 +1,9 @@ + +def setup(): + import os + from sys import path + BASE = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + path.append(BASE) + +if __name__ == '__main__': + setup() \ No newline at end of file diff --git a/src/grammar/grammar.py b/src/grammar/grammar.py new file mode 100755 index 00000000..b31c0b80 --- /dev/null +++ b/src/grammar/grammar.py @@ -0,0 +1,176 @@ +from grammar.symbols import (NonTerminal, Terminal, Sentence, + Epsilon, EOF, AttributeProduction) +import json + + +class Grammar(): + + def __init__(self): + + self.Productions = [] + self.nonTerminals = [] + self.terminals = [] + self.startSymbol = None + # production type + self.pType = None + self.Epsilon = Epsilon(self) + self.EOF = EOF(self) + + self.symbDict = {} + + def NonTerminal(self, name, startSymbol=False): + + name = name.strip() + if not name: + raise Exception("Empty name") + + term = NonTerminal(name, self) + + if startSymbol: + + if self.startSymbol is None: + self.startSymbol = term + else: + raise Exception("Cannot define more than one start symbol.") + + self.nonTerminals.append(term) + self.symbDict[name] = term + return term + + def NonTerminals(self, names): + + ans = tuple((self.NonTerminal(x) for x in names.strip().split())) + + return ans + + def Add_Production(self, production): + + if len(self.Productions) == 0: + self.pType = type(production) + + assert type( + production) == self.pType, "The Productions most be of only 1 type." + + production.Left.productions.append(production) + self.Productions.append(production) + + def Terminal(self, name): + + name = name.strip() + if not name: + raise Exception("Empty name") + + term = Terminal(name, self) + self.terminals.append(term) + self.symbDict[name] = term + return term + + def Terminals(self, names): + + ans = tuple((self.Terminal(x) for x in names.strip().split())) + + return ans + + def __str__(self): + + mul = '%s, ' + + ans = 'Non-Terminals:\n\t' + + nonterminals = mul * (len(self.nonTerminals) - 1) + '%s\n' + + ans += nonterminals % tuple(self.nonTerminals) + + ans += 'Terminals:\n\t' + + terminals = mul * (len(self.terminals) - 1) + '%s\n' + + ans += terminals % tuple(self.terminals) + + ans += 'Productions:\n\t' + + ans += str(self.Productions) + + return ans + + @property + def to_json(self): + + productions = [] + + for p in self.Productions: + head = p.Left.Name + + body = [] + + for s in p.Right: + body.append(s.Name) + + productions.append({'Head': head, 'Body': body}) + + d = {'NonTerminals': [symb.Name for symb in self.nonTerminals if symb != self.startSymbol], 'Terminals': + [symb.Name for symb in self.terminals], + 'Productions': productions} + d['StartSymbol'] = self.startSymbol.Name + + return json.dumps(d) + + @staticmethod + def from_json(data): + data = json.loads(data) + + G = Grammar() + dic = {'epsilon': G.Epsilon} + dic[data['StartSymbol']] = G.NonTerminal(data['StartSymbol'],True) + + for term in data['Terminals']: + dic[term] = G.Terminal(term) + + for noTerm in data['NonTerminals']: + dic[noTerm] = G.NonTerminal(noTerm) + + for p in data['Productions']: + head = p['Head'] + dic[head] %= Sentence(*[dic[term] for term in p['Body']]) + + return G + + def copy(self): + G = Grammar() + G.Productions = self.Productions.copy() + G.nonTerminals = self.nonTerminals.copy() + G.terminals = self.terminals.copy() + G.pType = self.pType + G.startSymbol = self.startSymbol + G.Epsilon = self.Epsilon + G.EOF = self.EOF + G.symbDict = self.symbDict.copy() + + return G + + @property + def IsAugmentedGrammar(self): + augmented = 0 + for left, right in self.Productions: + if self.startSymbol == left: + augmented += 1 + if augmented <= 1: + return True + else: + return False + + def AugmentedGrammar(self): + if not self.IsAugmentedGrammar: + + G = self.copy() + S = G.startSymbol + G.startSymbol = None + SS = G.NonTerminal('S\'', True) + if G.pType is AttributeProduction: + SS %= S + G.Epsilon, lambda x: x + else: + SS %= S + G.Epsilon + + return G + else: + return self.copy() diff --git a/src/grammar/items.py b/src/grammar/items.py new file mode 100755 index 00000000..981b7ed8 --- /dev/null +++ b/src/grammar/items.py @@ -0,0 +1,75 @@ +#%% +from grammar.symbols import Production + +class Item: + """ + La clase Item representara los items LR. + Llamaremos item a una cadena de la forma X-> a.B donde: + + -a es lo que hemos visto + -B es lo que nos falta por leer + + Por cada produccion X-> w, tenemos |w| + 1 posibles items + """ + def __init__(self, production, pos, lookaheads=[]): + self.production = production + self.pos = pos + self.lookaheads = frozenset(look for look in lookaheads) + + @property + def IsReduceItem(self): + return len(self.production.Right) == self.pos + + @property + def NextSymbol(self): + if self.pos < len(self.production.Right): + return self.production.Right[self.pos] + else: + return None + + def next_item(self): + if self.pos < len(self.production.Right): + return Item(self.production,self.pos+1,self.lookaheads) + else: + return None + + def __eq__(self, other): + return ( + (self.pos == other.pos) and + (self.production == other.production) and + (self.lookaheads == other.lookaheads) + ) + + def __str__(self): + s = str(self.production.Left) + " -> " + if len(self.production.Right) > 0: + for i,c in enumerate(self.production.Right): + if i == self.pos: + s += "." + s += str(self.production.Right[i]) + if self.pos == len(self.production.Right): + s += "." + else: + s += "." + s += ", " + str(self.lookaheads) + return s + + def __repr__(self): + return str(self) + + def __hash__(self): + return hash((self.production,self.pos,frozenset(self.lookaheads))) + + def __iter__(self): + current = self + while not current.IsReduceItem: + yield current + current = current.next_item() + yield current + + def Preview(self, skip=1): + unseen = self.production.Right[self.pos+skip:] + return [ unseen + (lookahead,) for lookahead in self.lookaheads ] + + def Center(self): + return Item(self.production, self.pos) diff --git a/src/grammar/remrecursion.py b/src/grammar/remrecursion.py new file mode 100755 index 00000000..00d9bc90 --- /dev/null +++ b/src/grammar/remrecursion.py @@ -0,0 +1,74 @@ +#%% +from grammar.grammar import Grammar +from grammar.symbols import NonTerminal +from grammar.symbols import Sentence +from trie.tree import Trie +#%% +def remove_left_recursion(G:Grammar): + + def find_recursive_production(t:NonTerminal): + recursives, non_recursives = list(), list() + for production in t.productions: + head, body = production + if len(body) > 1 and head == body[0]: + recursives.append(production) + else: + non_recursives.append(production) + return recursives, non_recursives + + def remove_redundant_productions(G:Grammar): + for production in G.Productions: + while G.Productions.count(production) > 1: + G.Productions.remove(production) + + + for nt in G.nonTerminals: + recursives, non_recursives = find_recursive_production(nt) + if recursives: + new_symbol = G.NonTerminal(f'{nt}^') + for production in non_recursives: + G.Productions.remove(production) + body = production.Right + nt %= body + new_symbol + for production in recursives: + alpha = Sentence(*production.Right[1::]) + G.Productions.remove(production) + new_symbol %= alpha + new_symbol | G.Epsilon + + remove_redundant_productions(G) + +def factorize(G:Grammar): + + def lcp(sym): + prefix_len, prefix = 0, None + d = set() + t = Trie([x for x in (G.terminals + G.nonTerminals)]) + for production in sym.productions: + _, body = production + p = t.prefix_query(body) + if p: + if len(p) > prefix_len: + prefix = p + prefix_len = len(p) + t.insert(body) + if prefix: + for production in sym.productions: + if all(prefix[i] == production.Right[i] for i in range(prefix_len)): + d.add(production) + print(d) + return prefix, d + + stack = [x for x in G.nonTerminals] + while stack: + sym = stack.pop() + prefix, productions = lcp(sym) + change = not prefix is None + if change: + new_t = G.NonTerminal(f'{sym.Name}^') + sym %= prefix + new_t + for p in productions: + remainder = p.Right[len(prefix)::] + remainder = Sentence(*remainder) if remainder else G.Epsilon + new_t %= remainder + G.Productions.remove(p) + diff --git a/src/grammar/symbols.py b/src/grammar/symbols.py new file mode 100755 index 00000000..f8d56897 --- /dev/null +++ b/src/grammar/symbols.py @@ -0,0 +1,443 @@ +class Symbol(object): + """ + Modelaremos los símbolos del lenguaje con la clase Symbol. + Esta clase funcionará como base para la definición de terminales y no terminales. + Entre las funcionalidades básicas de los símbolos tenemos que: + + -Pueden ser agrupados con el operador + para formar oraciones. + -Podemos conocer si representa la cadena especial epsilon a través de la propiedad IsEpsilon + que poseen todas las instancias. + -Podemos acceder a la gramática en la que se definió a través del campo Grammar de cada + instancia. + -Podemos consultar la notación del símbolo a través del campo Name de cada instancia. + + Los símbolos no deben ser instanciados directamente (ni sus descendiente) con la aplicación + de su constructor. + """ + + def __init__(self,name,grammar): + self.Name=name + self.Grammar=grammar + + def __str__(self): + return self.Name + + def __repr__(self): + return repr(self.Name) + + def __add__(self,other): + if isinstance(other,Symbol): + return Sentence(self,other) + + raise TypeError(other) + + def __or__(self,other): + + if isinstance(other,(Sentence)): + return SentenceList(Sentence(self),other) + + raise TypeError(other) + + @property + def IsEpsilon(self): + return False + + def __len__(self): + return 1 + + def __gt__(self, other): + assert isinstance(other,Symbol) + return self.Name > other.Name + + +class Terminal(Symbol): + """ + Los símbolos terminales los modelaremos con la clase Terminal. + Dicha clase extiende la clase Symbol para: + + -Incluir propiedades IsNonTerminal - IsTerminal que devolveran True - False respectivamente. + + Los terminales no deben ser instanciados directamente con la aplicación de su constructor. + """ + + def __init__(self,name, grammar): + super().__init__(name, grammar) + + @property + def IsTerminal(self): + return True + + @property + def IsNonTerminal(self): + return False + + @property + def IsEpsilon(self): + return False + + def __hash__(self): + return hash(self.Name) + + def __eq__(self, other): + return isinstance(other, Terminal) and other.Name == self.Name + + +class NonTerminal(Symbol): + """ + Los símbolos no terminales los modelaremos con la clase NonTerminal. + Dicha clase extiende la clase Symbol para: + + -Añadir noción de las producción que tiene al no terminal como cabecera. + Estas pueden ser conocidas a través del campo productions de cada instancia. + -Permitir añadir producciones para ese no terminal a través del operador %=. + -Incluir propiedades IsNonTerminal - IsTerminal que devolveran True - False respectivamente. + + Los no terminales no deben ser instanciados directamente con la aplicación de su constructor. + """ + + def __init__(self,name,grammar): + super().__init__(name,grammar) + self.productions=[] + + def __imod__(self,other): + + if isinstance(other, Sentence): + p=Production(self,other) + self.Grammar.Add_Production(p) + return self + + if isinstance(other, SentenceList): + + for s in other: + p = Production(self, s) + self.Grammar.Add_Production(p) + + return self + + if isinstance(other,tuple): + assert len(other)>1 + + if len(other)==2: + other+=(None,)*len(other[0]) + assert len(other)==len(other[0])+2,"Reglas malformadas" + + if isinstance(other[0],Symbol) or isinstance(other[0],Sentence): + p=AttributeProduction(self,other[0],other[1:]) + else: + raise Exception("") + + self.Grammar.Add_Production(p) + return self + + if isinstance(other,Symbol): + p=Production(self,Sentence(other)) + self.Grammar.Add_Production(p) + return self + + if isinstance(other,SentenceList): + + for s in other: + p=Production(self,s) + self.Grammar.Add_Production(p) + + return self + + raise TypeError(other) + + @property + def IsTerminal(self): + return False + + + @property + def IsNonTerminal(self): + return True + + + @property + def IsEpsilon(self): + return False + + +class EOF(Terminal): + """ + Modelaremos el símbolo de fin de cadena con la clase EOF. + Dicha clase extiende la clases Terminal para heradar su comportamiento. + + La clase EOF no deberá ser instanciada directamente con la aplicación de su constructor. + En su lugar, una instancia concreta para determinada gramática G de Grammar se construirá + automáticamente y será accesible a través de G.EOF. + """ + + def __init__(self,Grammar): + super().__init__('$',Grammar) + + +class Sentence(object): + """ + Modelaremos los oraciones y formas oracionales del lenguaje con la clase Sentence. + Esta clase funcionará como una colección de terminales y no terminales. + Entre las funcionalidades básicas que provee tenemos que nos : + + -Permite acceder a los símbolos que componen la oración a través del campo _symbols de + cada instancia. + -Permite conocer si la oración es completamente vacía a través de la propiedad IsEpsilon. + -Permite obtener la concatenación con un símbolo u otra oración aplicando el operador +. + -Permite conocer la longitud de la oración (cantidad de símbolos que la componen) + utilizando la función build-in de python len(...). + + Las oraciones pueden ser agrupadas usando el operador |. + Esto nos será conveniente para definir las producciones tengan la misma cabecera + (no terminal en la parte izquierda) en una única sentencia. + El grupo de oraciones se maneja con la clase SentenceList. + + No se deben crear instancias de Sentence y SentenceList directamente + con la aplicación de los respectivos constructores. + En su lugar, usaremos el operador + entre símbolos para formar las oraciones, + y el operador | entre oraciones para agruparlas. + """ + + def __init__(self,*args): + self._symbols=tuple(x for x in args if not x.IsEpsilon) + self.hash=hash(self._symbols) + + def __len__(self): + return len(self._symbols) + + def __add__(self,other): + if isinstance(other,Symbol): + return Sentence(*(self._symbols+(other,))) + + if isinstance(other,Sentence): + return Sentence(*(self._symbols+other._symbols)) + + raise TypeError(other) + + def __or__(self,other): + if isinstance(other,Sentence): + return SentenceList(self,other) + + if isinstance(other,Symbol): + return SentenceList(self,Sentence(other)) + + raise TypeError(other) + + def __repr__(self): + return str(self) + + def __str__(self): + return ("%s "*len(self._symbols)%tuple(self._symbols)).strip() + + def __iter__(self): + return iter(self._symbols) + + def __getitem__(self,index): + return self._symbols[index] + + def __eq__(self,other): + return self._symbols==other._symbols + + def __hash__(self): + return self.hash + + @property + def IsEpsilon(self): + return False + + +class SentenceList(object): + + def __init__(self,*args): + self._sentences=list(args) + + def Add(self,symbol): + if not symbol and (symbol is None or not symbol.IsEpsilon): + raise ValueError(symbol) + + self._sentences.append(symbol) + + def __iter__(self): + return iter(self._sentences) + + def __or__(self, other): + if isinstance(other, Sentence): + self.Add(other) + return self + + if isinstance(other, Symbol): + return self|Sentence(other) + + +class Epsilon(Terminal, Sentence): + """ + Modelaremos tanto la cadena vacía como el símbolo que la representa: epsilon (ϵ), + en la misma clase: Epsilon. + Dicha clase extiende las clases Terminal y Sentence por lo que ser comporta como ambas. + Sobreescribe la implementación del método IsEpsilon para indicar que en efecto toda instancia + de la clase reprensenta epsilon. + + La clase Epsilon no deberá ser instanciada directamente con la aplicación de su constructor. + En su lugar, una instancia concreta para determinada gramática G de Grammar se construirá + automáticamente y será accesible a través de G.Epsilon. + """ + + def __init__(self,grammar): + super().__init__('epsilon',grammar) + + def __str__(self): + return "ϵ" + + def __repr__(self): + return 'epsilon' + + def __iter__(self): + yield self + + def __len__(self): + return 0 + + def __add__(self,other): + return other + + def __eq__(self,other): + return isinstance(other,(Epsilon,)) + + def __hash__(self): + return hash("") + + @property + def IsEpsilon(self): + return True + + +class Production(object): + """ + Modelaremos las producciones con la clase Production. Las funcionalidades básicas + con que contamos son: + + -Poder acceder la cabecera (parte izquierda) y cuerpo (parte derecha) de cada + producción a través de los campos Left y Right respectivamente. + -Consultar si la producción es de la forma X→ϵ a través de la propiedad IsEpsilon. + -Desempaquetar la producción en cabecera y cuerpo usando asignaciones: left, right = production. + + Las producciones no deben ser instanciadas directamente con la aplicación de su constructor. + En su lugar, se presentan las siguientes facilidades para formar producciones a partir + de una instancia G de Grammar y un grupo de terminales y no terminales: + + Para definir una producción de la forma E→E+T: + + E %= E + plus + T + + Para definir múltiples producciones de la misma cabecera en una única sentencia (E→E+T | E−T | T): + + E %= E + plus + T | E + minus + T | T + + Para usar epsilon en una producción (ejemplo S→aS | ϵ) haríamos: + + S %= S + a | G.Epsilon + """ + + def __init__(self, nonTerminal, sentence): + self.Left=nonTerminal + self.Right=sentence + + def __str__(self): + return '%s -> %s'%(self.Left,self.Right) + + def __repr__(self): + return '%s -> %s'%(self.Left,self.Right) + + def __iter__(self): + yield self.Left + yield self.Right + + def __eq__(self,other): + return isinstance(other,Production) and self.Left==other.Left and self.Right==other.Right + + def __hash__(self): + return hash((self.Left,self.Right)) + + @property + def IsEpsilon(self): + return self.Right.IsEpsilon + + +class AttributeProduction(Production): + """ + Con esta clase modelaremos las producciones de las gramáticas atributadas. + Cada una de estas producciones se compone por: + + Un no terminal como cabecera. Accesible a través del campo Left. + Una oración como cuerpo. Accesible a través del campo Right. + Un conjunto de reglas para evaluar los atributos. Accesible a través del campo atributes. + + Las producciones no deben ser instanciadas directamente con la aplicación de su constructor. + En su lugar, se presentan las siguientes facilidades para formar producciones a partir de una + instancia G de Grammar y un grupo de terminales y no terminales: + + Para definir una producción de la forma B0→B1B2...Bn que: + + -Asocia a B0 una regla λ0 para sintetizar sus atributos, y Asocia a B1…Bn las reglas λ1…λn + que hereden sus atributos respectivamentes. + + B0 %= B1 + B2 + ... + Bn, lambda0, lambda1, lambda2, ..., lambdaN + + Donde lambda0, lambda1, ..., lambdaN son funciones que reciben 2 parámetros. + + Como primer parámetro los atributos heredados que se han computado para cada instancia + de símbolo en la producción, durante la aplicación de esa instancia de producción específicamente. + Los valores se acceden desde una lista de n + 1 elementos. Los valores se ordenan según aparecen + los símbolos en la producción, comenzando por la cabecera. Nos referiremos a esta colección como inherited. + Como segundo parámetro los atributos sintetizados que se han computado para cada instancia de símbolo + en la producción, durante la aplicación de esa instancia de producción específicamente. + Sigue la misma estructura que el primer parámetro. Nos referiremos a esta colección como synteticed. + + La función lambda0 sintetiza los atributos de la cabecera. + La evaluación de dicha función produce el valor de synteticed[0]. + El resto de los atributos sintetizados de los símbolos de la producción se calcula de la siguiente forma: + + -En caso de que el símbolo sea un terminal, evalúa como su lexema. + -En caso de que el símbolo sea un no terminal, se obtiene de evaluar la función lambda0 en la + instancia de producción correspondiente. + + La función lambda_i, con i entre 1 y n, computa los atributos heredados de la i-ésima ocurrencia + de símbolo en la producción. La evaluación de dicha función produce el valor de inherited[i]. + El valor de inherited[0] se obtiene como el atributo que heredó la instancia concreta del símbolo + en la cabecera antes de comenzar a aplicar la producción. + + En caso de que no se vaya a sociar una regla a un símbolo se incluirá un None. + + E %= T X , lambda h,s: s[2] , None , lambda h,s: s[1] + # ___________ ________________ ________ ________________ + # producción | regla para E | sin regla | regla para X + + [0]: lambda h,s: s[2] al ser lambda0 sintetiza el valor de E. Lo hace en función del valor que + sintetiza X (accesible desde s[2]). + [1]: None al ser lambda1 indica que no se incluye regla para heredar valor a T. + [2]: lambda h,s: s[1] al ser lambda2 hereda un valor a X. Lo hace en función del valor que sintetiza T + accesible desde s[1]). + + No se deben definir múltiples producciones de la misma cabecera en una única sentencia. + + """ + + def __init__(self,nonTerminal, sentence, attributes): + if not isinstance(sentence, Sentence) and isinstance(sentence, Symbol): + sentence = Sentence(sentence) + super(AttributeProduction, self).__init__(nonTerminal, sentence) + + self.attributes = attributes + + def __str__(self): + return '%s := %s'%(self.Left, self.Right) + + def __repr__(self): + return '%s -> %s'%(self.Left, self.Right) + + def __iter__(self): + yield self.Left + yield self.Right + + @property + def IsEpsilon(self): + return self.Right.IsEpsilon diff --git a/src/lexer/.ipynb_checkpoints/regexgenerator-checkpoint.py b/src/lexer/.ipynb_checkpoints/regexgenerator-checkpoint.py new file mode 100755 index 00000000..4faa966c --- /dev/null +++ b/src/lexer/.ipynb_checkpoints/regexgenerator-checkpoint.py @@ -0,0 +1,133 @@ +#%% +from baseNodeTree.base import Node, AtomicNode, UnaryNode, BinaryNode +from automatons.nondeterministic import NFA +from automatons.operations import automata_union, automata_concatenation, automata_closure +from automatons.transformation import nfa_to_deterministic +from grammar.grammar import Grammar +from lexer.tokens import Token +from parser.ll1 import build_ll1_parser +from tools.evaluate import evaluate_parse +#%% +class EpsilonNode(AtomicNode): + def evaluate(self): + automaton = NFA(states = 1, finals = [0],transitions = {} ) + return automaton + +class SymbolNode(AtomicNode): + def evaluate(self): + s = self.lex + automaton = NFA(states= 2, finals= [1], transitions={(0,s):[1]}) + return automaton + +class ClosureNode(UnaryNode): + @staticmethod + def operate(value): + automaton = value + for state in automaton.finals: + try: + automaton.transitions[state][''].append(automaton.start) + except KeyError: + automaton.transitions[state][''] = [automaton.start] + try: + automaton.transitions[automaton.start][''].append(state) + except KeyError: + automaton.transitions[automaton.start][''] = [state] + + return automaton + +class UnionNode(BinaryNode): + @staticmethod + def operate(lvalue, rvalue): + automata = automata_union(lvalue, rvalue) + return automata + +class ConcatNode(BinaryNode): + @staticmethod + def operate(lvalue, rvalue): + automata = automata_concatenation(lvalue, rvalue) + return automata + +class RangeNode(Node): + def __init__(self,iterable): + self.rang = iterable + + def evaluate(self): + it = iter(self.rang) + node = SymbolNode(next(it)) + while 1: + try: + node = UnionNode(node,SymbolNode(next(it))) + except StopIteration: + automata = node.evaluate() + return automata + +class PositiveClosureNode(UnaryNode): + @staticmethod + def operate(value): + return automata_concatenation(value,automata_closure(value)) + +class QuestionNode(UnaryNode): + @staticmethod + def operate(value): + return automata_union(value, SymbolNode('').evaluate()) + +class Regex(object): + + def __init__(self, regex, ignore_white_space = True): + self.regex = regex + self.G = Grammar() + opar, cpar ,star, pipe, question, plus, symbol, epsilon, obrack, cbrack, minus = self.G.Terminals('( ) * | ? + symbol ε [ ] -') + E, T, X, F, Y, S = self.G.NonTerminals('E T X F Y S') + + E %= T + X, lambda h,s: s[2], None, s[1] + X %= pipe + E, lambda h,s: UnionNode(h[0], s[2]) + X %= self.G.Epsilon, lambda h,s: h[0] + T %= F + Y, lambda h,s: s[2], None, s[1] + Y %= star, lambda h,s: ClosureNode(h[0]) + Y %= question, lambda h,s: QuestionNode(h[0]) + Y %= plus, lambda h,s: PositiveClosureNode(h[0]) + Y %= self.G.Epsilon, lambda h,s: h[0] + F %= S + F, lambda h,s: ConcatNode(s[1],s[2]), None, s[1] + F %= self.G.Epsilon, lambda h,s: h[0] + S %= symbol, lambda h,s: SymbolNode(s[1]) + S %= epsilon, lambda h,s: EpsilonNode(s[1]) + S %= opar + E + cpar, lambda h,s : s[2] + S %= obrack + symbol + minus + symbol + cbrack, lambda h,s: RangeNode(range(s[2],s[4])) + + self.automaton = self._build_automaton(regex, ignore_white_space) + + def _build_automaton(self,regex, ignore_white_space): + + def regex_tokenizer(regex, ignore_white_space): + if ignore_white_space: + regex = regex.split(sep = ' ') + d = {term.name: term for term in self.G.terminals} + tokens = [] + symbol_term = [term for term in self.G.terminals if term.name == 'symbol'][0] + fixed_tokens = {tok.name:Token(tok.name,tok) for tok in [d['|'],d['*'],d['+'],d['?'],d['('],d[')'], + d['['],d[']'],d['-'],d['ε']]} + + for c in regex: + try: + token = fixed_tokens[c] + except KeyError: + token = Token(c, symbol_term) + tokens.append(token) + tokens.append(Token('$',self.G.EOF)) + return tokens + + toks = regex_tokenizer(regex, ignore_white_space) + parser = build_ll1_parser(self.G) + left_parse = parser(toks) + tree = evaluate_parse(left_parse, toks) + automatom = tree.evaluate() + automaton = nfa_to_deterministic(automatom) + return automaton + + def __call__(self, w:str): + return self.automaton.recognize(w) + + +#%% +reg = Regex('a*(a|b)*cd | ε') +reg('bbbbbcd') diff --git a/src/lexer/.ipynb_checkpoints/tokenizer-checkpoint.py b/src/lexer/.ipynb_checkpoints/tokenizer-checkpoint.py new file mode 100755 index 00000000..b72db4d1 --- /dev/null +++ b/src/lexer/.ipynb_checkpoints/tokenizer-checkpoint.py @@ -0,0 +1,10 @@ +from ast.base import Node, AtomicNode, UnaryNode, BinaryNode + +class EpsilonNode(AtomicNode): + def evaluate(self): + automaton = NFA(states = 1, finals = [0],transitions = {} ) + return automaton + +#%% +EPSILON = 'ε' +EpsilonNode(EPSILON).evaluate() diff --git a/src/lexer/__init__.py b/src/lexer/__init__.py new file mode 100755 index 00000000..70c8b193 --- /dev/null +++ b/src/lexer/__init__.py @@ -0,0 +1,9 @@ + +def setup(): + import os + from sys import path + BASE = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + path.append(BASE) + +if __name__ == '__main__': + setup() \ No newline at end of file diff --git a/src/lexer/regexgenerator.py b/src/lexer/regexgenerator.py new file mode 100755 index 00000000..c6326d64 --- /dev/null +++ b/src/lexer/regexgenerator.py @@ -0,0 +1,140 @@ +#%% +from baseNodeTree.base import Node, AtomicNode, UnaryNode, BinaryNode +from automatons.nondeterministic import NFA +from automatons.operations import automata_union, automata_concatenation, automata_closure +from automatons.transformation import nfa_to_deterministic +from grammar.grammar import Grammar +from lexer.tokens import Token +from parserr.ll1 import build_ll1_parser +from tools.evaluate import evaluate_parse +from baseNodeTree.astprinter import get_printer +from tools.dtbuilder import build_derivation_tree +from automatons.state import State + +#%% + +class EpsilonNode(AtomicNode): + def evaluate(self): + automaton = NFA(states = 1, finals = [0],transitions = {} ) + return automaton + +class SymbolNode(AtomicNode): + def evaluate(self): + s = self.lex + automaton = NFA(states= 2, finals= [1], transitions={(0,s):[1]}) + return automaton + +class ClosureNode(UnaryNode): + @staticmethod + def operate(value): + automaton = value + for state in automaton.finals: + try: + automaton.transitions[state][''].append(automaton.start) + except KeyError: + automaton.transitions[state][''] = [automaton.start] + try: + automaton.transitions[automaton.start][''].append(state) + except KeyError: + automaton.transitions[automaton.start][''] = [state] + + return automaton + +class UnionNode(BinaryNode): + @staticmethod + def operate(lvalue, rvalue): + automata = automata_union(lvalue, rvalue) + return automata + +class ConcatNode(BinaryNode): + @staticmethod + def operate(lvalue, rvalue): + automata = automata_concatenation(lvalue, rvalue) + return automata + +class RangeNode(Node): + def __init__(self,iterable): + self.rang = iterable + + def evaluate(self): + it = iter(self.rang) + node = SymbolNode(next(it)) + while 1: + try: + node = UnionNode(node,SymbolNode(next(it))) + except StopIteration: + automata = node.evaluate() + return automata + +class PositiveClosureNode(UnaryNode): + @staticmethod + def operate(value): + return automata_concatenation(value,automata_closure(value)) + +class QuestionNode(UnaryNode): + @staticmethod + def operate(value): + return automata_union(value, EpsilonNode('').evaluate()) +#%% +class Regex(object): + + def __init__(self, regex, ignore_white_space=True): + self.regex = regex + self.G = Grammar() + E = self.G.NonTerminal('E', True) + T, F, A, X, Y, Z = self.G.NonTerminals('T F A X Y Z') + pipe, star, opar, cpar, symbol, epsilon, plus, minus, obrack, cbrack, question = self.G.Terminals('| * ( ) symbol ε + - [ ] ?') + + E %= T + X, lambda h, s: s[2], None, lambda h, s: s[1] + X %= pipe + E, lambda h, s: UnionNode(h[0], s[2]) + X %= self.G.Epsilon, lambda h, s:h[0] + T %= F + Y, lambda h, s: s[2], None, lambda h, s: s[1] + Y %= T, lambda h, s: ConcatNode(h[0], s[1]) + Y %= self.G.Epsilon, lambda h, s:h[0] + F %= A + Z, lambda h, s: s[2], None, lambda h, s: s[1] + Z %= star, lambda h, s: ClosureNode(h[0]) + Z %= plus, lambda h, s: PositiveClosureNode(h[0]) + Z %= question, lambda h, s: QuestionNode(h[0]) + Z %= self.G.Epsilon, lambda h, s: h[0] + A %= symbol, lambda h, s: SymbolNode(s[1]) + A %= epsilon, lambda h, s: EpsilonNode(s[1]) + A %= opar + E + cpar, lambda h, s: s[2] + + self.automaton = self._build_automaton(regex, ignore_white_space) + + def _build_automaton(self, regex, ignore_white_space): + + def regex_tokenizer(regex, ignore_white_space): + d = {term.Name: term for term in self.G.terminals} + tokens = [] + symbol_term = [term for term in self.G.terminals if term.Name == 'symbol'][0] + fixed_tokens = {tok.Name:Token(tok.Name, tok) for tok in [d['|'], d['*'], + d['+'], d['?'], + d['('], d[')'], + d['['], d[']'], + d['-'], d['ε']]} + + for i, c in enumerate(regex): + if c == "\\" or \ + (ignore_white_space and c.isspace()): + continue + try: + token = fixed_tokens[c] + if regex[i-1] == '\\': + raise KeyError + except KeyError: + token = Token(c, symbol_term) + tokens.append(token) + tokens.append(Token('$', self.G.EOF)) + return tokens + + toks = regex_tokenizer(regex, ignore_white_space) + parser = build_ll1_parser(self.G) + left_parse = parser(toks) + tree = evaluate_parse(left_parse, toks) + automatom = tree.evaluate() + automaton = nfa_to_deterministic(automatom) + return automaton + + def __call__(self, w: str): + return self.automaton.recognize(w) diff --git a/src/lexer/tokenizer.py b/src/lexer/tokenizer.py new file mode 100755 index 00000000..0352278a --- /dev/null +++ b/src/lexer/tokenizer.py @@ -0,0 +1,139 @@ +#%% +from automatons.state import State +from lexer.regexgenerator import Regex +from lexer.tokens import Token +#%% + + +class TokenLine(Token): + ''' + Clase para representar el token constante de cambio de Linea + ''' + def __init__(self): + super().__init__('\n', 'Line') + +class Lexer: + + """ + El generador de lexer se basa en un conjunto de expresiones regulares. + Cada una de ellas está asociada a un tipo de token. + El lexer termina siendo un autómata finito determinista con ciertas peculiaridades: + - Resulta de transformar el autómata unión entre todas las expresiones regulares del lenguaje, + y convertirlo a determinista. + - Cada estado final almacena los tipos de tokens que se reconocen al alcanzarlo. + Se establece una prioridad entre ellos para poder desambiaguar. + - Para tokenizar, la cadena de entrada viaja repetidas veces por el autómata. + - Cada vez, se comienza por el estado inicial, pero se continúa a partir de la última sección de la + cadena que fue reconocida. + - Cuando el autómata se "traba" durante el reconocimiento de una cadena, se reporta la ocurrencia de un token. + Su lexema está formado por la concatenación de los símbolos que fueron consumidos desde el inicio y hasta pasar + por el último estado final antes de trabarse. Su tipo de token es el de mayor relevancia entre los anotados en el + estado final. + - Al finalizar de consumir toda la cadena, se reporta el token de fin de cadena. + """ + def __init__(self, table, eof, ignore_white_space=False): + self.eof = eof + self.regexs = self._build_regexs(table, ignore_white_space) + self.automaton = self._build_automaton() + self.ignore_white_space = ignore_white_space + self.line = 1 + self.column = 1 + + def _build_regexs(self, table, ignore_white_space): + regexs = [] + fixed_line_token = Regex('\n', ignore_white_space=False) + fixed_space_token = Regex(' ', ignore_white_space=False) + + for n, (token_type, regex) in enumerate(table): + + regex = Regex(regex, ignore_white_space) + + start = State.from_nfa(regex.automaton) + + for state in start: + if state.final: + state.tag = (n, token_type) + regexs.append(start) + + line_automaton = State.from_nfa(fixed_line_token.automaton) + space_automaton = State.from_nfa(fixed_space_token.automaton) + + for state in line_automaton: + if state.final: + state.tag = (len(table) + 1, 'Line') + + for state in space_automaton: + if state.final: + state.tag = (len(table) + 2, 'Space') + + regexs.append(line_automaton) + regexs.append(space_automaton) + return regexs + + def _build_automaton(self): + start = State('start') + + for regex in self.regexs: + start.add_epsilon_transition(regex) + return start.to_deterministic() + + + def _walk(self, string): + state = self.automaton + final = state if state.final else None + lex = '' + suffix = '' + + for symbol in string: + next_state = state.transitions.get(symbol, None) + if next_state: + suffix += symbol + state = next_state[0] + if state.final: + lex += suffix + suffix = '' + final = state + else: + break + + return final, lex + + def _tokenize(self, text): + while text: + string = text + final, lex = self._walk(string) + if lex == '': + print(text) + raise SyntaxError(f'Invalid token in line: {self.line} column: {self.column}') + if final: + n = 2**64 + token_type = None + for state in final.state: + try: + priority, tt = state.tag + if priority < n: + n = priority + token_type = tt + except TypeError: + pass + yield lex, token_type + text = string[len(lex):] + else: + raise SyntaxError(f'Invalid token in line: {self.line} column: {self.column}') + + yield '$', self.eof + + def __call__(self, text: str): + tokens = [] + for lex, ttype in self._tokenize(text): + if isinstance(ttype, str) and ttype == 'Line': + self.line += 1 + self.column = 1 + elif isinstance(ttype, str) and ttype == 'Space': + self.column += 1 + else: + tok = Token(lex, ttype, self.column, self.line) + tokens.append(tok) + self.column += len(lex) + + return tokens diff --git a/src/lexer/tokens.py b/src/lexer/tokens.py new file mode 100755 index 00000000..a2d29935 --- /dev/null +++ b/src/lexer/tokens.py @@ -0,0 +1,23 @@ +class Token: + """ + Basic token class. + + Parameters + ---------- + lex : str + Token's lexeme. + token_type : Enum + Token's type. + """ + + def __init__(self, lex, token_type, token_column=None, token_line=None): + self.lex = lex + self.token_type = token_type + self.token_column = token_column + self.token_line = token_line + + def __str__(self): + return f'{self.token_type}: {self.lex}' + + def __repr__(self): + return str(self) diff --git a/src/parserr/.#shiftreduce.py b/src/parserr/.#shiftreduce.py new file mode 120000 index 00000000..eb05616f --- /dev/null +++ b/src/parserr/.#shiftreduce.py @@ -0,0 +1 @@ +adrian@adrian-pc.2383:1571553273 \ No newline at end of file diff --git a/src/parserr/__init__.py b/src/parserr/__init__.py new file mode 100755 index 00000000..4ab414f6 --- /dev/null +++ b/src/parserr/__init__.py @@ -0,0 +1,9 @@ + +def setup(): + import os + from sys import path + BASE = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + path.append(BASE) + +if __name__ == '__main__': + setup() diff --git a/src/parserr/ll1.py b/src/parserr/ll1.py new file mode 100755 index 00000000..fd80549b --- /dev/null +++ b/src/parserr/ll1.py @@ -0,0 +1,54 @@ +from tools.firsts import compute_firsts +from tools.follows import compute_follows +from grammar.grammar import Grammar + +def build_ll1_parsing_table(G:Grammar, firsts: dict, follows: dict): + table = {} + + for production in G.Productions: + x,alpha = production.Left, production.Right + + for t in firsts[alpha]: + #si la tabla contiene entradas repetidas entonces la gramatica + #no es LL(1) + assert not table.get((x,t),None), "La gramatica no es LL(1)" + table[(x,t)] = production + + if firsts[alpha].contains_epsilon: + for t in follows[x]: + assert not table.get((x,t),None), "La gramatica no es LL(1)" + table[(x,t)] = production + return table + +def build_ll1_parser(G: Grammar): + firsts = compute_firsts(G) + follows = compute_follows(G, firsts) + table = build_ll1_parsing_table(G, firsts, follows) + + def parser(w: list): + #Asumimos que w termina en $ + stack = [G.startSymbol] + cursor = 0 + output = [] + + while stack: + sym = stack.pop() + if sym.IsTerminal: + assert sym == w[cursor].token_type, "La cadena no pertenece al lenguaje" + cursor += 1 + else: + try: + production = table[(sym,w[cursor].token_type)] + output.append(production) + try: + for symbol in production.Right[::-1]: + stack.append(symbol) + except AttributeError: + pass + except KeyError: + raise Exception('La cadena no pertenece al lenguaje') + + assert w[cursor].token_type == G.EOF, 'La cadena no pertenece al lenguaje' + return output + + return parser diff --git a/src/parserr/lr.py b/src/parserr/lr.py new file mode 100755 index 00000000..450df093 --- /dev/null +++ b/src/parserr/lr.py @@ -0,0 +1,293 @@ +#%% +from grammar.items import Item +from tools.firsts import ContainerSet +from automatons.state import State +from parserr.shiftreduce import ShiftReduceParser +from tools.firsts import compute_firsts, compute_local_first +from tools.follows import compute_follows + +def expand(item, firsts): + next_symbol = item.NextSymbol + if next_symbol is None or not next_symbol.IsNonTerminal: + return [] + + lookaheads = ContainerSet() + + for remainder in item.Preview(): + for lookahead in compute_local_first(firsts=firsts,alpha=remainder): + lookaheads.update(ContainerSet(lookahead)) + + assert not lookaheads.contains_epsilon + expanded = [Item(production,0,lookaheads) for production in next_symbol.productions] + return expanded + + +def compress(items): + centers = {} + + for item in items: + center = item.Center() + try: + lookaheads = centers[center] + except KeyError: + centers[center] = lookaheads = set() + lookaheads.update(item.lookaheads) + + return { Item(x.production, x.pos, set(lookahead)) for x, lookahead in centers.items() } + + +def closure_lr1(items, firsts): + closure = ContainerSet(*items) + + changed = True + while changed: + changed = False + + new_items = ContainerSet() + + for item in closure: + new_items.update(ContainerSet(*expand(item,firsts))) + + changed = closure.update(new_items) + + + return compress(closure) + +def goto_lr1(items, symbol, firsts=None, just_kernel=False): + assert just_kernel or firsts is not None, '`firsts` must be provided if `just_kernel=False`' + items = frozenset(item.next_item() for item in items if item.NextSymbol == symbol) + return items if just_kernel else closure_lr1(items, firsts) + +def build_LR1_automaton(G): + assert len(G.startSymbol.productions) == 1, 'Grammar must be augmented' + + firsts = compute_firsts(G) + firsts[G.EOF] = ContainerSet(G.EOF) + + start_production = G.startSymbol.productions[0] + start_item = Item(start_production, 0, lookaheads=(G.EOF,)) + start = frozenset([start_item]) + + closure = closure_lr1(start, firsts) + automaton = State(frozenset(closure), True) + + pending = [ start ] + visited = { start: automaton } + + while pending: + current = pending.pop() + current_state = visited[current] + + for symbol in G.terminals + G.nonTerminals: + next_item = goto_lr1(current_state.state,symbol,just_kernel=True) + if next_item: + try: + next_state = visited[next_item] + except KeyError: + next_state = State(frozenset(closure_lr1(next_item,firsts)),True) + visited[next_item] = next_state + pending += [next_item] + + current_state.add_transition(symbol.Name, next_state) + + return automaton + + + +def build_lalr_automaton(G): + + def centers(items:[Item]): + return frozenset(item.Center() for item in items) + + def lookaheads(items: [Item]): + return {item.Center(): item.lookaheads for item in items} + + def subset(items1, items2): + return all(items1[i] <= items2[i] for i in items1) + + + assert len(G.startSymbol.productions) == 1, 'Grammar must be augmented' + firsts = compute_firsts(G) + firsts[G.EOF] = ContainerSet(G.EOF) + + start_production = G.startSymbol.productions[0] + start_item = Item(start_production,0,(G.EOF,)) + + start = State((closure_lr1(start_item,firsts)),True) + + pending = [start_item] + visisted_centers = {centers(start.state): start} + visited = {start_item: start} + + while pending: + # if len(pending) > 124: + # print('ss') + current_state = visited[pending.pop()] + for symbol in G.terminals + G.nonTerminals: + next_item = frozenset(goto_lr1(current_state.state,symbol,firsts)) + + if next_item: + #Caso en que pueda mezclar el nuevo item + try: + next_state = visisted_centers[centers(next_item)] + if not subset(lookaheads(next_item),lookaheads(next_state.state)): + next_state.state = compress(list(next_state.state) + list(next_item)) + pending.append(frozenset(next_state.state)) + visited[frozenset(next_state.state)] = next_state + except KeyError: + next_state = State(next_item,True) + pending+= [next_item] + visisted_centers[centers(next_item)] = next_state + visited[next_item] = next_state + current_state.add_transition(symbol.Name, next_state) + + return start + + + +class LR1Parser(ShiftReduceParser): + def _build_parsing_table(self): + #G = self.G.AugmentedGrammar() if not self.G.IsAugmentedGrammar else self.G + + automaton = build_LR1_automaton(self.G) + for i, node in enumerate(automaton): + node.idx = i + + for node in automaton: + idx = node.idx + for item in node.state: + if item.IsReduceItem: + if item.production.Left == self.G.startSymbol: + self._register(self.action,(idx,self.G.EOF),('OK',item.production)) + else: + for lookahead in item.lookaheads: + self._register(self.action,(idx,lookahead),('REDUCE',item.production)) + else: + next_symbol = item.NextSymbol + try: + if next_symbol.IsNonTerminal: + next_state = node.transitions[next_symbol.Name][0] + self._register(self.goto,(idx,next_symbol),next_state.idx) + else: + next_state = node.transitions[next_symbol.Name][0] + self._register(self.action,(idx,next_symbol),('SHIFT',next_state.idx)) + except KeyError: + pass + + @staticmethod + def _register(table, key, value): + # assert key not in table or table[key] == value, f'Shift-Reduce or Reduce-Reduce conflict!!!\n tried to put {value} in {key} already exist with value {table[key]}' + if not (key not in table or table[key] == value): + print(f'Shift-Reduce or Reduce-Reduce conflict!!!\n tried to put {value} in {key} already exist with value {table[key]}') + print(table) + assert False + table[key] = value + + +class LALRParser(ShiftReduceParser): + def _build_parsing_table(self): + register = LR1Parser._register + G = self.G.AugmentedGrammar() + automaton = build_lalr_automaton(G) + for i, node in enumerate(automaton): + node.idx = i + + for node in automaton: + idx = node.idx + for item in node.state: + if item.IsReduceItem: + if item.production.Left == G.startSymbol: + register(self.action, (idx, G.EOF), ('OK', item.production)) + else: + for lookahead in item.lookaheads: + register(self.action, (idx, lookahead), ('REDUCE', item.production)) + else: + next_symbol = item.NextSymbol + try: + if next_symbol.IsNonTerminal: + next_state = node.transitions[next_symbol.Name][0] + register(self.goto, (idx, next_symbol), next_state.idx) + else: + next_state = node.transitions[next_symbol.Name][0] + register(self.action, (idx, next_symbol), ('SHIFT', next_state.idx)) + except KeyError: + pass + + +#%% Testing Cells + +# from grammar.grammar import Grammar +# from lexer.tokenizer import Lexer +# from tools.dtbuilder import build_derivation_tree, build_right_derivation_tree +# G = Grammar() +# E = G.NonTerminal('E',True) +# T, F = G.NonTerminals("T F") +# num, plus, star, div, minus,opar, cpar = G.Terminals('num + * / - ( )') + +# E %= E + plus + T, lambda h,s: s[1] + s[3] +# E %= T, lambda h,s: s[1] +# E %= E + minus + T, lambda h,s: s[1] - s[3] +# T %= T + star + F, lambda h,s: s[1] * s[3] +# T %= T + div + F, lambda h,s: s[1] / s[3] +# T %= F, lambda h,s: s[1] +# F %= num , lambda h,s: int(s[1]) +# F %= opar + E + cpar, lambda h,s: s[2] + +# print(G) +# #%% +# tokens = [(num,'(0|1|2|3|4|5|6|7|8|9)|(1|2|3|4|5|6|7|8|9)*'), +# (plus,'@+'), +# (star,'@*'), +# (div,'/'), +# (minus,'@-'), +# (opar,'@('), +# (cpar,'@)'),] + +# lexer = Lexer(tokens,G.EOF,ignore_white_space=True) + +# #%% +# try: +# tok = lexer(" 1 - 1 + 1 + 5 * 3 + 2 ") +# except SyntaxError as e: +# print(e) + +# parser = LR1Parser(G,verbose=False) +# #%% +# try: +# parse = parser(tok) +# except SyntaxError as e: +# print(e) + +# #%% +# print(parse) +# tree = build_right_derivation_tree(parse) + +# display(tree) +# #%% +# from tools.evaluate import evaluate_right_parse +# root = evaluate_right_parse(parse, tok) +# print(root) +# #%%LALR +# from lexer.tokens import Token +# G = Grammar() +# E = G.NonTerminal('E', True) +# A = G.NonTerminal('A') +# equal, plus, num = G.Terminals('= + int') + +# E %= A + equal + A | num +# A %= num + plus + A | num + +# print(G) + +# #%% +# item = Item(E.productions[0], 0, lookaheads=[G.EOF, plus]) +# print('item:', item) + +# for preview in item.Preview(): +# print('item.Preview:', preview) +# #%% + +# parser = LALRParser(G, verbose=False) +# derivation = parser([Token('1',num), Token('+',plus),Token('2',num), Token('=',equal), Token('3',num), Token('+',plus), Token('4',num), Token('$',G.EOF)]) +# tree = build_right_derivation_tree(derivation) +# display(tree) diff --git a/src/parserr/shiftreduce.py b/src/parserr/shiftreduce.py new file mode 100755 index 00000000..413d6779 --- /dev/null +++ b/src/parserr/shiftreduce.py @@ -0,0 +1,89 @@ +''' +Este modulo contiene la declaracion de la clase ShiftReduceParser, la cual +sirve de base para los parsers SLR, LALR y LR +''' +from grammar.grammar import AttributeProduction + +class ShiftReduceParser: + """ + Clase base para los parsers SLR(1), LALR(1) y LR(1). + No se debe instanciar directamente, en vez de eso, todo parser + cuyo funcionamiento se base en las acciones shift reduce deben heredar + de esta clase e implementar el metodo build_parsing_table. + """ + SHIFT = 'SHIFT' + REDUCE = 'REDUCE' + OK = 'OK' + + def __init__(self, G, verbose=False): + self.G = G + self.verbose = verbose + self.action = {} + self.goto = {} + self._build_parsing_table() + + def _build_parsing_table(self): + raise NotImplementedError() + + def __call__(self, tokens): + stack = [0] + cursor = 0 + output = [] + + while True: + state = stack[-1] + lookahead = tokens[cursor].token_type + try: + action, tag = self.action[state, lookahead] + except KeyError: + print(lookahead.__class__) + raise SyntaxError(f'Bad {tokens[cursor]} in line {tokens[cursor].token_line}'+ + f' column {tokens[cursor].token_column}.\n'+ + f'Expected: ' + + ' or '.join([str(y) for x,y in self.action if x == state])) + + if action == self.SHIFT: + cursor += 1 + stack.append(tag) + + elif action == self.REDUCE: + head, body = tag + + for _ in range(len(body)): + stack.pop() + + output.append(tag) + new_state = self.goto[stack[-1], head] + stack.append(new_state) + + elif action == self.OK: + output.append(tag) + return output[::-1] + + else: + raise Exception('La cadena no pertenece al lenguaje') + + def dumps_parser_state(self, file): + ''' + Devuelve un formato objeto de tipo bytes (o string) + que sirve para guardar el estado del parser en un fichero + para cargarlo posteriormente con load. + ''' + try: + import cloudpickle + except ImportError: + return False + + try: + cloudpickle.dump(self, file) + return True + except Exception as e: + return False + + @staticmethod + def load_parser_state(file): + try: + import cloudpickle as pickle + return pickle.load(file) + except ImportError: + return None diff --git a/src/parserr/slr.py b/src/parserr/slr.py new file mode 100755 index 00000000..4fb9f3df --- /dev/null +++ b/src/parserr/slr.py @@ -0,0 +1,88 @@ +#%% +from tools.firsts import compute_firsts +from tools.follows import compute_follows +from automatons.state import State +from grammar.items import Item +from parserr.shiftreduce import ShiftReduceParser + +class SLR1Parser(ShiftReduceParser): + + def build_LR0_automaton(self,G): + assert len(G.startSymbol.productions) == 1, 'Grammar must be augmented' + + start_production = G.startSymbol.productions[0] + start_item = Item(start_production, 0) + + automaton = State(start_item, True) + + pending = [ start_item ] + visited = { start_item: automaton } + + while pending: + current_item = pending.pop() + if current_item.IsReduceItem: + continue + + current_state = visited[current_item] + symbol = current_item.NextSymbol + try: + next_state = visited[current_item.next_item()] + except KeyError: + next_state = State(current_item.next_item(),True) + visited[current_item.next_item()] = next_state + + current_state.add_transition(symbol.Name,next_state) + pending.append(current_item.next_item()) + if symbol.IsNonTerminal: + for production in symbol.productions: + item = Item(production,0) + try: + state = visited[item] + except KeyError: + state = State(item,True) + visited[item] = state + pending.append(item) + current_state.add_epsilon_transition(state) + + return automaton + + + def _build_parsing_table(self): + G = self.G.AugmentedGrammar() + firsts = compute_firsts(G) + follows = compute_follows(G, firsts) + + automaton = self.build_LR0_automaton(G).to_deterministic() + for i, node in enumerate(automaton): + if self.verbose: print(i, node) + node.idx = i + + for node in automaton: + idx = node.idx + for state in node.state: + item = state.state + + if item.IsReduceItem: + head = item.production.Left + if head == G.startSymbol: + self._register(self.action,(idx,G.EOF),('OK',item.production)) + else: + for c in follows[head]: + self._register(self.action,(idx,c),('REDUCE',item.production)) + else: + symbol = item.NextSymbol + try: + trans_idx = node.transitions[symbol.Name][0].idx + if symbol.IsNonTerminal: + self._register(self.goto,(idx,symbol),trans_idx) + else: + self._register(self.action,(idx,symbol),('SHIFT',trans_idx)) + except KeyError: + pass + + @staticmethod + def _register(table, key, value): + assert key not in table or table[key] == value, 'Shift-Reduce or Reduce-Reduce conflict!!!' + table[key] = value + +#%% \ No newline at end of file diff --git a/src/testing.py b/src/testing.py new file mode 100755 index 00000000..96ab1777 --- /dev/null +++ b/src/testing.py @@ -0,0 +1,67 @@ +from coolgrammar import grammar +from lexer import tokenizer +from parserr.lr import LALRParser +from parserr.shiftreduce import ShiftReduceParser + +GRAMMAR, LEXER = grammar.build_cool_grammar() +PARSER = LALRParser(GRAMMAR, verbose=True) + +SIMPLE_PROGRAM = """ +class A inherits IO +{ + attribute : int <- 10; + + main(): SELF_TYPE + { + print("Hello There"); + }; + + a(n :int) : int + { + n; + }; + + b (): int + { + let varj : int <- 10 in + { + varj; + }; + + let varl : int in + { + varh; + }; + + let varj :int, varu : string <- "Hello There" in + { + var; + }; + + case varj of + x : int => x + 10 ; + x : string => "Hi there" ; + x : object => varj; + esac; + + + a(10); + }; + +}; +""" +# First Round of tests +import cloudpickle +TOKS = None +try: + TOKS = LEXER(SIMPLE_PROGRAM) + parse = PARSER(TOKS) + # Try to save the parser and then reuse it + #with open('.parser.dmp','wb') as file: + # cloudpickle.dump(PARSER, file) + + with open('.parser.dmp','rb') as file: + parser = cloudpickle.load(file) + print(parser(TOKS)) +except Exception as e: + print(e) diff --git a/src/tools/__init__.py b/src/tools/__init__.py new file mode 100755 index 00000000..4ab414f6 --- /dev/null +++ b/src/tools/__init__.py @@ -0,0 +1,9 @@ + +def setup(): + import os + from sys import path + BASE = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + path.append(BASE) + +if __name__ == '__main__': + setup() diff --git a/src/tools/dtbuilder.py b/src/tools/dtbuilder.py new file mode 100755 index 00000000..e619290b --- /dev/null +++ b/src/tools/dtbuilder.py @@ -0,0 +1,99 @@ +from queue import LifoQueue + +class DerivationTreeNode(object): + + def __init__(self, value, parent= None, h = 0): + self.value = value + self.children = [] + self.parent = parent + self._h = h + + #required property to do a pprint of the tree + @property + def Deep(self): + """ + Devuelve la distancia de este nodo al nodo raiz, o el + nivel en que se encuentra dicho nodo + """ + return self._h + + def add_node(self,body, count): + """ + Agrega el cuerpo de una producion a los hijos del nodo cabecera. + """ + for x in body: + count+= 1 + self.children.append(DerivationTreeNode(x,parent=self, h = count)) + return count + + def graph(self): + # realizar un recorrido en bfs por el arbol para formar el grafo + import pydot + from queue import Queue + G = pydot.Dot(rankdir='TD', margin=0.1) + q = Queue() + q.put(self) + while not q.empty(): + node = q.get() + pydotNode = pydot.Node(id(node),label=str(node.value), shape='circle', style='bold') + G.add_node(pydotNode) + for child in node.children: + child_node = pydot.Node(id(child),label=str(child.value),shape='circle', style='bold') + G.add_node(child_node) + G.add_edge(pydot.Edge(pydotNode,child_node)) + q.put(child) + return G + + def _repr_svg_(self): + try: + return self.graph().create_svg().decode('utf8') + except: + pass + +def build_derivation_tree(parse: list): + """ + Dado un conjunto de producciones que generan una cadena, + devuelve un arbol de derivacion correspondiente a dicho conjunto. + Este metodo construye el arbol para parsers que produzcan una derivacion extrema + izquierda, para parsers que producen derivaciones extremas derechas, utilizar + build_right_derivation_tree() + """ + count = 0 + q = [] + head = parse[0].Left + root = DerivationTreeNode(head) + q.append(root) + i = 0 + while q: + node: DerivationTreeNode = q.pop() + if node.value.IsNonTerminal: + _,body = parse[i] + i+=1 + count = node.add_node(body,count) + for child in node.children[::-1]: + q.append(child) + return root + +def build_right_derivation_tree(parse: list): + """ + Dado un conjunto de producciones que generan una cadena, + devuelve un arbol de derivacion correspondiente a dicho conjunto. + Este metodo construye el arbol para parsers que produzcan una derivacion extrema + derecha, para parsers que producen derivaciones extremas izquierdas, utilizar + build_derivation_tree() + """ + count = 0 + q = [] + head = parse[0].Left + root = DerivationTreeNode(head) + q.append(root) + i = 0 + while q: + node: DerivationTreeNode = q.pop() + if node.value.IsNonTerminal: + _,body = parse[i] + i+=1 + count = node.add_node(body,count) + for child in node.children: + q.append(child) + return root diff --git a/src/tools/evaluate.py b/src/tools/evaluate.py new file mode 100755 index 00000000..ed4ab996 --- /dev/null +++ b/src/tools/evaluate.py @@ -0,0 +1,52 @@ +def evaluate_parse(productions, tokens): + def evaluate_production(production,left_parse,tokens, inherited_value = None): + body = production.Right + attributes = production.attributes + + synteticed = [None] * (len(body) + 1) + inherited = [None] * (len(body) + 1) + inherited[0] = inherited_value + + for i,symbol in enumerate(body, 1): + if symbol.IsTerminal and not symbol.IsEpsilon: + assert not inherited[i] + synteticed[i] = next(tokens).lex + elif symbol.IsNonTerminal: + next_production = next(left_parse) + rule = attributes[i] + if rule: + inherited[i] = rule(inherited, synteticed) + synteticed[i] = evaluate_production(next_production, left_parse, tokens,inherited[i]) + + + rule = attributes[0] + return rule(inherited, synteticed) if rule else None + + tok = iter(tokens) + prod = iter(productions) + root = evaluate_production(next(prod), prod, tok) + + return root + +def evaluate_right_parse(productions, tokens): + def evaluate_production(production, right_parse,tokens): + body = production.Right + size = len(body) + 1 + attributes = production.attributes + synteticed = [None] * size + + for i, symbol in enumerate(body, 1): + if symbol.IsTerminal and not symbol.IsEpsilon: + synteticed[size - i] = next(tokens).lex + elif symbol.IsNonTerminal: + next_production = next(right_parse) + synteticed[size-i] = evaluate_production(next_production, right_parse, tokens) + + rule = attributes[0] + return rule([],synteticed) if rule else None + #Pasar los tokens en orden inverso y quitar el caracter de final de cadena de la lista de tokens + tok = iter(tokens[::-1][1::]) + prod = iter(productions) + root = evaluate_production(next(prod),prod, tok) + + return root diff --git a/src/tools/firsts.py b/src/tools/firsts.py new file mode 100755 index 00000000..d2a55140 --- /dev/null +++ b/src/tools/firsts.py @@ -0,0 +1,116 @@ + +class ContainerSet: + """ + Resulta conveniente manejar la pertenencia o no de epsilon a un conjunto como un caso extremo. + Para ello usaremos la clase ContainerSet implementada a continuación. + + La clase funciona como un conjunto de símbolos. + Permite consulta la pertenencia de epsilon al conjunto. + Las operaciones que modifican el conjunto devuelven si hubo cambio o no. + El conjunto puede ser actualizado con la adición de elementos individuales, add(...), + o a partir de otro conjunto,update(...) y hard_update(...). + La actualización sin epsilon (1), con epsilon (2) y de solo epsilon (3), + ocurre a través de update(...), hard_update(...) y epsilon_update(...) respectivamente. + """ + + def __init__(self, *values, contains_epsilon=False): + self.set = set(values) + self.contains_epsilon = contains_epsilon + + def add(self, value): + n = len(self.set) + self.set.add(value) + return n != len(self.set) + + def set_epsilon(self, value=True): + last = self.contains_epsilon + self.contains_epsilon = value + return last != self.contains_epsilon + + def update(self, other): + n = len(self.set) + self.set.update(other.set) + return n != len(self.set) + + def epsilon_update(self, other): + return self.set_epsilon(self.contains_epsilon | other.contains_epsilon) + + def hard_update(self, other): + return self.update(other) | self.epsilon_update(other) + + def __len__(self): + return len(self.set) + int(self.contains_epsilon) + + def __str__(self): + return '%s-%s' % (str(self.set), self.contains_epsilon) + + def __repr__(self): + return str(self) + + def __iter__(self): + return iter(self.set) + + def __eq__(self, other): + return isinstance(other, ContainerSet) and self.set == other.set and \ + self.contains_epsilon == other.contains_epsilon + + +def compute_local_first(firsts, alpha): + + first_alpha = ContainerSet() + + try: + alpha_is_epsilon = alpha.IsEpsilon + except: + alpha_is_epsilon = False + + if alpha_is_epsilon: + first_alpha.set_epsilon() + else: + i = 0 + while i < len(alpha): + sym = alpha[i] + if sym.IsTerminal: + first_alpha.add(sym) + break + else: + first_alpha.update(firsts[sym]) + if firsts[sym].contains_epsilon: + first_alpha.set_epsilon() + i += 1 + else: + break + + return first_alpha + + +def compute_firsts(grammar): + firsts = {} + change = True + + for terminal in grammar.terminals: + firsts[terminal] = ContainerSet(terminal) + + for nonterminal in grammar.nonTerminals: + firsts[nonterminal] = ContainerSet() + + while change: + change = False + + for production in grammar.Productions: + X = production.Left + alpha = production.Right + + first_X = firsts[X] + + try: + first_alpha = firsts[alpha] + except: + first_alpha = firsts[alpha] = ContainerSet() + + local_first = compute_local_first(firsts, alpha) + + change |= first_alpha.hard_update(local_first) + change |= first_X.hard_update(local_first) + + return firsts diff --git a/src/tools/follows.py b/src/tools/follows.py new file mode 100755 index 00000000..69d78989 --- /dev/null +++ b/src/tools/follows.py @@ -0,0 +1,39 @@ +#%% +from tools.firsts import ContainerSet, compute_firsts, compute_local_first +from grammar.grammar import Grammar +from grammar.symbols import Sentence +#%% +def compute_follows(G: Grammar,firsts): + follows = {} + change = True + + for nonterminal in G.nonTerminals: + follows[nonterminal] = ContainerSet() + follows[G.startSymbol] = ContainerSet(G.EOF) + + while change: + change = False + + for production in G.Productions: + + X = production.Left + alpha = production.Right + + i = 0 + while i < len(alpha): + sym = alpha[i] + if sym.IsNonTerminal: + if i == len(alpha)-1: + follows[sym].update(follows[X]) + else: + try: + local = firsts[alpha[i+1::]] + except KeyError: + local = compute_local_first(firsts, alpha[i+1::]) + + change |= follows[sym].update(local) + if local.contains_epsilon: + change |= follows[sym].update(follows[X]) + i+= 1 + + return follows diff --git a/src/tools/gramtoregex.py b/src/tools/gramtoregex.py new file mode 100755 index 00000000..60036d64 --- /dev/null +++ b/src/tools/gramtoregex.py @@ -0,0 +1,206 @@ +#%% +from grammar.grammar import Grammar +from automatons.nondeterministic import NFA +from automatons.transformation import nfa_to_deterministic +from lexer.regexgenerator import Regex +from automatons.deterministic import DFA + +class AlgebraicRegex: + + def __init__(self, string): + self.string = string + + @property + def is_void(self): + return self.string == '' + + @property + def empt(self): + return self.string == 'ε' + + def __str__(self): + return self.string + + def __repr__(self): + return str(self) + + def __or__(self, other): + assert isinstance(other, AlgebraicRegex) + if self.is_void and other.is_void: + return self + elif self.is_void: return other + elif other.is_void: return self + if self.empt and other.empt: return self + + return AlgebraicRegex(f'(({self.string}|{other.string}))') + + def __gt__(self, other): + assert isinstance(other, AlgebraicRegex) + if self.is_void and other.is_void: return self + elif self.is_void or other.is_void: return other + + if self.empt: return other + if other.empt: return self + + return AlgebraicRegex(f'(({self.string})({other.string}))') + + def star(self): + if self.empt or self.is_void: return self + if len(self.string) == 1: return AlgebraicRegex(f'({self.string})*') + + return AlgebraicRegex(f'({self.string})*') + + +def assert_regular(G: Grammar): + for production in G.Productions: + if len(production.Right) > 2: + return False + if len(production.Right) == 2 and (production.Right[0].IsNonTerminal or production.Right[1].IsTerminal): + return False + return True + +def grammar_to_automaton(G:Grammar): + d = {sym.Name: i for i,sym in enumerate(G.nonTerminals)} + s = {i:sym for i,sym in enumerate(G.nonTerminals)} + if assert_regular(G): + states = len(G.nonTerminals) + transitions = {} + finals = [] + for i in range(states): + sym = s[i] + for production in sym.productions: + if len(production.Right) == 1: + next_sym = production.Right[0] + if next_sym.IsTerminal: + try: + transitions[(i,next_sym.Name)].append(i) + except: + transitions[(i,next_sym.Name)] = [i] + finals.append(i) + else: + try: + transitions[(i,'')].append(d[next_sym.Name]) + except: + transitions[(i,'')] = [d[next_sym.Name]] + if len(production.Right) == 2: + next_sym = production.Right[0] + next_state = d[production.Right[1].Name] + try: + transitions[(i,next_sym.Name)].append(next_state) + except: + transitions[(i,next_sym.Name)] = [next_state] + if len(production.Right) == 0: + finals.append(i) + start = d[G.startSymbol.Name] + return nfa_to_deterministic(NFA(states,finals, transitions, start=start)) + else: + print('La Gramatica no es regular') + +def regex_to_grammar(regex:Regex): + automaton = regex.automaton + G = Grammar() + start = G.NonTerminal(f'A{automaton.start}',True) + n = {} + n[automaton.start] = start + for i in range(automaton.states): + if i != automaton.start: + n[i] = G.NonTerminal(f'A{i}') + t = {} + for sym in automaton.vocabulary: + t[sym] = G.Terminal(sym) + + for src, d in automaton.transitions.items(): + for sym, dest in d.items(): + nt = n[src] + nt1 = n[dest[0]] + s = t[sym] + nt %= s + nt1 if nt1 != nt else s + for f in automaton.finals: + nt = n[f] + nt %= G.Epsilon + return G + +def grammar_to_regex(G:Grammar,aut = None): + if assert_regular(G): + automaton = grammar_to_automaton(G) if not aut else aut + n = automaton.states + + # Crear la tabla para la dinamica: tener en cuenta que el caracter $ indica + # la cadena vacia, que luego habra que simplificar de acuerdo a las reglas + # algebraicas de las expresiones regulares + dp = {(i,j,k): AlgebraicRegex('') for i in range(1,n+1) for j in range(1,n+1) for k in range(n+1)} + + # Construir el caso BASE de la dinamica dp[i,j,0] + for i, dest in automaton.transitions.items(): + i = i + 1 + for sym,l in dest.items(): + j = l[0] + 1 + if i != j: + dp[i,j,0] = AlgebraicRegex(sym) + else: + dp[i,j,0] = AlgebraicRegex(sym)|AlgebraicRegex('ε') + + + # aplicar el paso inductivo de la dinamica: + # dp[i,j,k] = dp[i,j,k-1]|dp[i,k-1,k-1]dp[k,k,k-1]*dp[k,j,k-1] para todo k >= 1 + + for k in range(1,n+1): + for i in range(1,n+1): + for j in range(1,n+1): + right = dp[i,k,k-1]>dp[k,k,k-1].star() + right = right >dp[k,j,k-1] + dp[i,j,k] = dp[i,j,k-1]|right + + + # La expresion regular del automata es el resultado de concatenar todos los pares dp[i,j,n] tales que j + # sea un estado final + finals = [dp[automaton.start+1,j+1,n] for j in automaton.finals] + + result = finals[0] + for s in finals[1::]: + result = result | s + return result + + else: + print('La gramatica no es regular') + + +# #%% +# G = Grammar() +# A = G.NonTerminal('A',True) +# B, C, D = G.NonTerminals('B C D') +# a,b = G.Terminals('a b') + +# A %= a + A | b + A | a + B +# B %= b + C +# C %= b + D +# D %= G.Epsilon + +# aut = DFA(2,[0],{(0,'a'):0,(0,'b'):1,(1,'a'):1,(1,'b'):0}) +# display(aut) +# print(grammar_to_regex(G,aut=aut)) +# display(Regex(grammar_to_regex(G,aut=aut).string).automaton) + +# #%% + +# print(grammar_to_regex(G)) +# regex = Regex(grammar_to_regex(G).string) +# a = grammar_to_automaton(G) +# display(a) +# display(regex.automaton) +# print(a.recognize('abababaaaaabb')) +# print(regex('abababaaaaabb')) + +# #%% +# print(G) +# print(assert_regular(G)) + +# #%% +# a = grammar_to_automaton(G) +# display(a) + +# #%% +# r = Regex('(a|b)+') +# g = regex_to_grammar(r) +# print(g) +# display(grammar_to_automaton(g)) \ No newline at end of file diff --git a/src/tools/visitor.py b/src/tools/visitor.py new file mode 100755 index 00000000..ce33b78a --- /dev/null +++ b/src/tools/visitor.py @@ -0,0 +1,58 @@ +import inspect + +__all__ = ['on', 'when'] + +def on(param_name): + def f(fn): + dispatcher = Dispatcher(param_name, fn) + return dispatcher + return f + + +def when(param_type): + def f(fn): + frame = inspect.currentframe().f_back + func_name = fn.func_name if 'func_name' in dir(fn) else fn.__name__ + dispatcher = frame.f_locals[func_name] + if not isinstance(dispatcher, Dispatcher): + dispatcher = dispatcher.dispatcher + dispatcher.add_target(param_type, fn) + def ff(*args, **kw): + return dispatcher(*args, **kw) + ff.dispatcher = dispatcher + return ff + return f + + +class Dispatcher(object): + def __init__(self, param_name, fn): + frame = inspect.currentframe().f_back.f_back + top_level = frame.f_locals == frame.f_globals + self.param_index = self.__argspec(fn).args.index(param_name) + self.param_name = param_name + self.targets = {} + + def __call__(self, *args, **kw): + typ = args[self.param_index].__class__ + d = self.targets.get(typ) + if d is not None: + return d(*args, **kw) + else: + issub = issubclass + t = self.targets + ks = t.keys() + ans = [t[k](*args, **kw) for k in ks if issub(typ, k)] + if len(ans) == 1: + return ans.pop() + return ans + + def add_target(self, typ, target): + self.targets[typ] = target + + @staticmethod + def __argspec(fn): + # Support for Python 3 type hints requires inspect.getfullargspec + if hasattr(inspect, 'getfullargspec'): + return inspect.getfullargspec(fn) + else: + return inspect.getargspec(fn) \ No newline at end of file diff --git a/src/travels/__init__.py b/src/travels/__init__.py new file mode 100755 index 00000000..e69de29b diff --git a/src/travels/context_actions.py b/src/travels/context_actions.py new file mode 100755 index 00000000..33268c2c --- /dev/null +++ b/src/travels/context_actions.py @@ -0,0 +1,22 @@ +from abstract.semantics import * + +def update_attr_type(current_type_: Type, attr_name: str, new_type: Type): + for attr in current_type_.attributes: + attr.type = new_type if attr.name == attr_name else attr.type + +def update_method_param(current_type : Type, method: str, param_name: str, new_type: Type): + m = current_type.methods[method] + for i,(pname, ptype) in enumerate(zip(m.param_names, m.param_types)): + if pname == param_name: + m.param_types[i] = new_type + +def update_scope_variable(vname: str, new_type: Type, scope: Scope, index= None): + if not index: + index = 0 + for i in range(index,len(scope.locals)): + if scope.locals[i].name == vname: + scope.locals[i].type = new_type + print(f'Changed {scope.locals[i].name} to type {new_type.name}') + return + if scope.parent: + update_scope_variable(vname, new_type, scope.parent, scope.index) \ No newline at end of file diff --git a/src/travels/inference.py b/src/travels/inference.py new file mode 100755 index 00000000..2309bcdd --- /dev/null +++ b/src/travels/inference.py @@ -0,0 +1,368 @@ + +from abstract.semantics import * +from abstract.tree import * +import typecheck.visitor as visitor +from travels.context_actions import update_attr_type, update_method_param, update_scope_variable + +void = VoidType() + +class TypeInferer: + """ + Para inferir los tipos en un programa se aprovecha el AST devuelto al evaluar el parse de dicho programa. + Para este propósito, se toma el programa como una gran expresión, y entonces se realiza un recorrido en bottom-up + para inferir los tipos de las subexpresiones que sean necesarias. Empezando por las hojas que corresponden a las constantes + y tipos previamente definidos, que por supuesto ya tienen su tipo bien calculado, se procede a ir subiendo por el árbol + calculando el tipo de cada subexpresión en dependencia de su regla funcional y de los tipos previamente calculados + en el contexto del programa. Como ejemplo tomemos el de la expresion "if bool then e1 else e2": + + La regla de dicha expresion se puede representar como : + C|-bool: BOLEAN, C|-e1:T1, C|-e2:T2 + -------------------------------------- + C|- if bool then e1 else e2: T3 + donde T1 <= T2 <= T3. + + O sea que si en el contexto conocemos el tipo de e1 y el de e2 y además aseguramos que bool es una expresión de tipo + BOLEAN entonces el tipo de la expresión completa sera el Ancestro Común Mas Cercano a los tipos T1 y T2, o en otras palabras, + el menor tipo T3 tal que T1 se conforme en T3 y T2 se conforme en T3. + """ + def __init__(self,context: Context, errors = []): + self.context: Context = context + self.current_type: Type = None + self.INTEGER = self.context.get_type('int') + self.OBJECT = self.context.get_type('object') + self.STRING = self.context.get_type('string') + self.BOOL = self.context.get_type('bool') + self.AUTO_TYPE = self.context.get_type('AUTO_TYPE') + self.errors = errors + self.current_method = None + + @visitor.on('node') + def visit(self,node, scope,infered_type = None): + pass + #--------------------------------------------------------------------------------------------------------------------------# + #-----------------------------------------------------EXPRESIONES----------------------------------------------------------# + #--------------------------------------------------------------------------------------------------------------------------# + + #--------------------------------------------------------------- + # Calcular todos los tipos en el contexto del programa. | + #--------------------------------------------------------------- + @visitor.when(ProgramNode) + def visit(self, node, scope = None, infered_type = None, deep = 1): + program_scope = Scope() if scope is None else scope + print(f"Este es el scope en la vuelta {deep} :\n {program_scope}") + if deep == 1: + for class_ in node.class_list: + self.visit(class_,program_scope.create_child()) + else: + for class_, child_scope in zip(node.class_list, program_scope.children): + self.visit(class_,child_scope, deep = deep) + return program_scope + + #----------------------------------------------------------------- + #Calcular los tipos en esta clase, visitar primero los atributos | + #y luego los métodos para garantizar que al revisar los métodos | + #ya todos los atributos estén definidos en el scope. | + #----------------------------------------------------------------- + @visitor.when(ClassDef) + def visit(self, node, scope: Scope, infered_type = None, deep = 1): + self.current_type:Type = self.context.get_type(node.idx) + for feature in node.features: + if isinstance(feature, AttributeDef): + self.visit(feature, scope, deep=deep) + if deep == 1: + for feature in node.features: + if isinstance(feature, MethodDef): + self.visit(feature, scope.create_child(), deep=deep) + else: + methods = (f for f in node.features if isinstance(f, MethodDef)) + for feature, child_scope in zip(methods, scope.children): + self.visit(feature, child_scope, deep=deep) + + #--------------------------------------------------------- + #Definir un atributo en el scope. | + #--------------------------------------------------------- + @visitor.when(AttributeDef) + def visit(self,node: AttributeDef, scope: Scope, infered_type = None, deep = 1): + atrib = self.current_type.get_attribute(node.idx) + if deep == 1: + scope.define_variable(atrib.name,atrib.type) + + + #--------------------------------------------------------------------- + #Si el método no tiene un tipo definido, entonces tratar de inferir | + #su tipo en dependencia del tipo de su expresién de retorno. | + #Notar que al revisar el body del método se pueden inferir también | + #los argumentos que no hayan sido definidos con tipos específicos. | + #--------------------------------------------------------------------- + @visitor.when(MethodDef) + def visit(self, node: MethodDef, scope, infered_type = None, deep = 1): + print(node.idx) + method = self.current_type.get_method(node.idx) + self.current_method = method + for param in node.param_list: + self.visit(param, scope, deep=deep) + + last = None + for statement in node.statements: + last = self.visit(statement, scope, deep=deep) + if not method.return_type != self.AUTO_TYPE: + print(f'Infered type {last.name} for {node.idx}') + method.return_type = last + else: + if not last.conforms_to(method.return_type): + self.errors.append(f'Method {method.name} cannot return {last}') + print(scope) + + @visitor.when(Param) + def visit(self, node: Param, scope: Scope, infered_type = None, deep = 1): + type_ = self.context.get_type(node.type) + if deep == 1: + scope.define_variable(node.id, type_) + + #------------------------------------------------------------------------- + #Checkear si la variable a la que se le va a asignar el resultado de la | + #expresión tiene un tipo bien definido: en caso de tenerlo, verificar que| + #el tipo de la expresión coincide con el tipo de la variable, de lo con- | + #trario asignarle a la variable el tipo de retorno de la expresión. | + #------------------------------------------------------------------------- + @visitor.when(AssignNode) + def visit(self, node: AssignNode, scope: Scope, infered_type = None, deep = 1): + var_info = scope.find_variable(node.idx) + if var_info: + e = self.visit(node.expr, scope, infered_type) + if var_info.type == self.AUTO_TYPE: + print(f'Infered type {e.name} for {node.idx}') + var_info.type = e + if not scope.is_local(var_info.name): + update_attr_type(self.current_type, var_info.name, var_info.type) + else: + update_method_param(self.current_type, self.current_method.name, var_info.name, var_info.type) + update_scope_variable(var_info.name, e, scope) + return void + else: + if not e.conforms_to(var_info.type): + self.errors.append(f'Expresion of type {e.name} cannot be assigned to variable {var_info.name} of type {var_info.type.name}') + return void + else: + self.errors.append(f'Undefined variable name: {node.idx}') + + @visitor.when(VariableCall) + def visit(self, node, scope: Scope, infered_type = None, deep = 1): + var_info = scope.find_variable(node.idx) + if var_info: + if infered_type and var_info.type == self.AUTO_TYPE: + print(f'Infered type {infered_type.name} for {var_info.name}') + var_info.type = infered_type + if not scope.is_local(var_info.name): + update_attr_type(self.current_type, var_info.name, var_info.type) + else: + update_method_param(self.current_type,self.current_method.name, var_info.name, var_info.type) + update_scope_variable(var_info.name, infered_type, scope) + return var_info.type + else: + self.errors.append(f'Name {node.idx} is not define.') + + @visitor.when(IfThenElseNode) + def visit(self, node: IfThenElseNode, scope: Scope, infered_type = None, deep = 1): + cond = self.visit(node.cond, scope, infered_type, deep) + e1 = self.visit(node.expr1, scope, infered_type, deep) + e2 = self.visit(node.expr2,scope, infered_type, deep) + if cond != self.BOOL: + self.errors.append(f'Se esperaba una expresion de tipo bool y se obtuvo una de tipo {cond}.') + if e1.conforms_to(e2): + return e2 + elif e2.conforms_to(e1): + return e1 + else: + e1_parent = e1.parent + e2_parent = e2.parent + while e2_parent != e1_parent: + e1_parent = e1_parent.parent + e2_parent = e2_parent.parent + return e1_parent + + @visitor.when(VariableDeclaration) + def visit(self, node : VariableDeclaration, scope:Scope, infered_type = None, deep = 1): + type_ = self.context.get_type(node.type) + if type_ != self.AUTO_TYPE: + if deep == 1: + scope.define_variable(node.idx, type_) + return void + else: + if deep == 1: + type_ = self.visit(node.expr, scope, infered_type, deep) + print(f'Infered type {type_.name} for {node.idx}') + scope.define_variable(node.idx,type_) + return void + + @visitor.when(FunCall) + def visit(self, node:FunCall, scope:Scope, infered_type = None, deep = 1): + if isinstance(node.obj, Type): + method = node.obj.get_method(node.id) + elif node.obj == 'self': + method = self.current_type.get_method(node.id) + else: + method = self.context.get_type(node.obj).get_method(node.id) + + for arg in node.args: + self.visit(arg, scope, infered_type, deep) + + if method.return_type != self.AUTO_TYPE: + return method.return_type + elif infered_type: + print(f'Infered type {infered_type.name} for {node.id}') + method.return_type = infered_type + return infered_type + else: + return self.AUTO_TYPE + + + + @visitor.when(InstantiateClassNode) + def visit(self, node: InstantiateClassNode, scope, infered_type = None, deep = 1): + ret_type = self.context.get_type(node.type_) + if ret_type in (self.AUTO_TYPE, void, self.STRING, self.INTEGER, self.OBJECT, self.BOOL): + self.errors.append(f'Cannot instantiate {ret_type}') + return ret_type + + @visitor.when(WhileBlockNode) + def visit(self, node: WhileBlockNode, scope, infered_type= None, deep = 1): + ret_type = None + for st in node.statements: + ret_type = self.visit(st, scope, infered_type, deep) + return ret_type + + #---------------------------------------------------------------------------------------------------------------------------# + #---------------------------------------OPERACIONES ARITMÉTICAS-------------------------------------------------------------# + #---------------------------------------------------------------------------------------------------------------------------# + + #------------------------------------------------------------------------------------------------- + # Todas las operaciones aritméticas estan definidas solamente para los enteros, luego, de checkeo| + # de cada operación se realiza evaluando sus operandos y viendo si sus tipos son consistentes con| + # INTEGER. | + #------------------------------------------------------------------------------------------------- + @visitor.when(PlusNode) + def visit(self,node, scope, infered_type = None, deep = 1): + left = self.visit(node.left, scope, self.INTEGER,deep) + right = self.visit(node.right, scope, self.INTEGER,deep) + if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): + return self.INTEGER + else: + self.errors.append(f'Invalid operation :{left.name} + {right.name}') + return self.INTEGER + + @visitor.when(DifNode) + def visit(self,node, scope, infered_type = None, deep = 1): + left = self.visit(node.left, scope, self.INTEGER, deep) + right = self.visit(node.right, scope, self.INTEGER, deep) + if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): + return self.INTEGER + else: + self.errors.append(f'Invalid operation :{left.name} - {right.name}') + return self.INTEGER + + @visitor.when(DivNode) + def visit(self,node, scope, infered_type=None, deep = 1): + left = self.visit(node.left, scope, self.INTEGER, deep) + right = self.visit(node.right, scope, self.INTEGER, deep) + if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): + return self.INTEGER + else: + self.errors.append(f'Invalid operation :{left.name} / {right.name}') + return self.INTEGER + + @visitor.when(MulNode) + def visit(self, node, scope, infered_type = None, deep = 1): + left = self.visit(node.left, scope, self.INTEGER, deep) + right = self.visit(node.right, scope, self.INTEGER, deep) + if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): + return self.INTEGER + else: + self.errors.append(f'Invalid operation :{left.name} * {right.name}') + return self.INTEGER + #-------------------------------------------------------------------------------------------# + #-----------------------------------OPERACIONES COMPARATIVAS -------------------------------# + #-------------------------------------------------------------------------------------------# + + #--------------------------------------------------------------------------------------------- + # Para poder comparar dos expresiones, estas deben ser del mismo tipo. El tipo de retorno de | + # toda operación comparativa es BOOLEAN. | + #--------------------------------------------------------------------------------------------- + @visitor.when(GreaterThanNode) + def visit(self, node: GreaterThanNode, scope, infered_type = None, deep = 1): + left = self.visit(node.left, scope, infered_type, deep) + right = self.visit(node.right, scope, infered_type, deep) + if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: + return self.BOOL + else: + self.errors.append(f'Invalid operation: {left.name} > {right.name}') + return self.BOOL + + @visitor.when(GreaterEqualNode) + def visit(self, node: GreaterEqualNode, scope, infered_type = None, deep = 1): + left = self.visit(node.left, scope, infered_type, deep) + right = self.visit(node.right, scope, infered_type, deep) + if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: + return self.BOOL + else: + self.errors.append(f'Invalid operation: {left.name} >= {right.name}') + return self.BOOL + + + @visitor.when(LowerThanNode) + def visit(self, node: LowerThanNode, scope, infered_type = None, deep = 1): + left = self.visit(node.left, scope, infered_type, deep) + right = self.visit(node.right, scope, infered_type, deep) + if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: + return self.BOOL + else: + self.errors.append(f'Invalid operation: {left.name} < {right.name}') + return self.BOOL + + @visitor.when(LowerEqual) + def visit(self, node: LowerEqual, scope, infered_type = None, deep = 1): + left = self.visit(node.left, scope, infered_type, deep) + right = self.visit(node.right, scope, infered_type, deep) + if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: + return self.BOOL + else: + self.errors.append(f'Invalid operation: {left.name} <= {right.name}') + return self.BOOL + + @visitor.when(EqualToNode) + def visit(self, node: EqualToNode, scope, infered_type = None, deep = 1): + left = self.visit(node.left, scope, infered_type, deep) + right = self.visit(node.right, scope, infered_type, deep) + if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: + return self.BOOL + else: + self.errors.append(f'Invalid operation: {left.name} == {right.name}') + return self.BOOL + + @visitor.when(NotNode) + def visit(self, node: NotNode, scope, infered_type = None, deep = 1): + val_type = self.visit(node.lex, scope, infered_type, deep) + if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: + return self.BOOL + else: + self.errors.append(f'Invalid operation: ! {val_type.name}') + return self.BOOL + #-----------------------------------------------------------------------------------------------------------------------# + #--------------------------------------------------CONSTANTES-----------------------------------------------------------# + #-----------------------------------------------------------------------------------------------------------------------# + + @visitor.when(IntegerConstant) + def visit(self, node, scope, infered_type = None, deep = 1): + return self.INTEGER + + @visitor.when(StringConstant) + def visit(self,node, scope, infered_type = None, deep = 1): + return self.STRING + + @visitor.when(TrueConstant) + def visit(self, node, scope, infered_type = None, deep = 1): + return self.BOOL + + @visitor.when(FalseConstant) + def visit(self, node, scope, infered_type = None, deep = 1): + return self.BOOL \ No newline at end of file diff --git a/src/travels/typebuilder.py b/src/travels/typebuilder.py new file mode 100755 index 00000000..b478303f --- /dev/null +++ b/src/travels/typebuilder.py @@ -0,0 +1,76 @@ +import typecheck.visitor as visitor +from abstract.tree import * +from abstract.semantics import SemanticError, Type, VoidType, IntegerType, StringType, ObjectType, Attribute, Method, Context, BoolType + +class TypeBuilder: + def __init__(self, context: Context, errors = []): + self.context = context + self.errors = errors + self.current_type = None + + + @visitor.on('node') + def visit(self, node): + pass + + @visitor.when(ProgramNode) + def visit(self,node): + for class_ in node.class_list: + self.visit(class_) + + @visitor.when(ClassDef) + def visit(self, node: ClassDef): + self.current_type = self.context.get_type(node.idx) + parent = self.context.get_type(node.parent) + + #Detectar dependencias circulares + if parent.conforms_to(self.current_type): + self.errors.append(f'Circular dependency: class {self.current_type.name} cannot inherit from {parent.name}') + else: + self.current_type.set_parent(parent) + + # for method in parent.methods.values(): + # try: + # self.current_type.define_method(method.name, method.param_names, method.param_types, method.return_type) + # except SemanticError as e: + # self.errors.append(e.text) + + # for att in parent.attributes: + # try: + # self.current_type.define_attribute(att.name, att.type) + # except SemanticError as e: + # self.errors.append(e.text) + + for feature in node.features: + self.visit(feature) + + + @visitor.when(AttributeDef) + def visit(self, node): + try: + attr_type = self.context.get_type(node.typex) if isinstance(node.typex, str) else node.typex + self.current_type.define_attribute(node.idx, attr_type) + except SemanticError as e: + self.errors.append(e.text) + + @visitor.when(MethodDef) + def visit(self, node): + params = [param.id for param in node.param_list] + try: + params_type = [self.context.get_type(param.type) if isinstance(param.type, str) else param.type \ + for param in node.param_list] + try: + return_type = self.context.get_type(node.return_type) if isinstance(node.return_type,str) else node.return_type + try: + self.current_type.define_method(node.idx,params, params_type,return_type) + except SemanticError as e: + self.errors.append(e.text) + + except SemanticError as e: + self.errors.append(e.text) + + except SemanticError as e: + self. errors.append(e.text) + + + diff --git a/src/travels/typecheck.py b/src/travels/typecheck.py new file mode 100755 index 00000000..24490d46 --- /dev/null +++ b/src/travels/typecheck.py @@ -0,0 +1,41 @@ +from typecheck.visitor import on, when +from abstract.semantics import * +from abstract.tree import * + +class TypeChecker: + def __init__(self, context:Context, errors = []): + self.current_type = None + self.context = context + self.AUTO_TYPE = self.context.get_type('AUTO_TYPE') + self.errors = errors + + @on('node') + def visit(self, node, scope): + pass + + @when(ProgramNode) + def visit(self, node: ProgramNode, scope = None): + scope = Scope() + for class_ in node.class_list: + self.visit(class_, scope.create_child()) + + @when(ClassDef) + def visit(self, node: ClassDef, scope: Scope): + self.current_type = self.context.get_type(node.idx) + for feature in node.features: + self.visit(feature,scope) if isinstance(feature, AttributeDef) else pass + + for feature in node.features: + self.visit(feature, scope.create_child()) if isinstance(feature, MethodDef) else pass + + @when(AttributeDef) + def visit(self, node: AttributeDef, scope: Scope): + att = self.current_type.get_attribute(node.idx) + if att.type == self.AUTO_TYPE: + self.errors.append(f'Cannot infer type of attribute {att.name}') + scope.define_variable(typ.name, typ.type) + + @when(MethodDef) + def visit(self, node: MethodDef, scope:Scope): + m = self.current_type.get_method(node.idx) + \ No newline at end of file diff --git a/src/travels/typecollector.py b/src/travels/typecollector.py new file mode 100755 index 00000000..713c0bb5 --- /dev/null +++ b/src/travels/typecollector.py @@ -0,0 +1,37 @@ +import typecheck.visitor as visitor +from abstract.tree import * +from abstract.semantics import SemanticError, Type, VoidType, IntegerType, StringType, ObjectType, Attribute, Method, Context, BoolType, AutoType + +class TypeCollector: + def __init__(self, errors= []): + self.context = None + self.errors = errors + + @visitor.on('node') + def visit(self,node): + pass + + @visitor.when(ProgramNode) + def visit(self,node): + self.context = Context() + OBJECT, INTEGER, STRING, BOOL, VOID = ObjectType(), IntegerType(), StringType(), BoolType(), VoidType() + INTEGER.set_parent(OBJECT) + STRING.set_parent(OBJECT) + BOOL.set_parent(OBJECT) + + self.context.types['object'] = OBJECT + self.context.types['int'] = INTEGER + self.context.types['string'] = STRING + self.context.types['bool'] = BOOL + self.context.types['void'] = VOID + self.context.types['AUTO_TYPE'] = AutoType() + for class_ in node.class_list: + self.visit(class_) + + @visitor.when(ClassDef) + def visit(self,node): + try: + self.context.create_type(node.idx) + except SemanticError as e: + self.errors.append(e.text) + diff --git a/src/typecheck/__init__.py b/src/typecheck/__init__.py new file mode 100755 index 00000000..e69de29b diff --git a/src/typecheck/evaluator.py b/src/typecheck/evaluator.py new file mode 100755 index 00000000..d254de85 --- /dev/null +++ b/src/typecheck/evaluator.py @@ -0,0 +1,21 @@ +import grammar.grammar as gr + +def evaluate_right_parse(parse: [], tokens): + + def evaluate_production(productions, production: gr.AttributeProduction, tokens): + synteticed = [None] * (len(production.Right) + 1) + rules = production.attributes + + for i,symbol in enumerate(production.Right[::-1],1): + if symbol.IsTerminal: + synteticed[len(synteticed) - i] = next(tokens).lex + else: + synteticed[len(synteticed) - i] = evaluate_production(productions, next(productions), tokens) + + rule = rules[0] + return rule(synteticed) if rule else None + + parse = iter(parse) + tokens = iter(tokens[::-1]) + + return evaluate_production(parse, next(parse),tokens) \ No newline at end of file diff --git a/src/typecheck/visitor.py b/src/typecheck/visitor.py new file mode 100755 index 00000000..0b82fbfd --- /dev/null +++ b/src/typecheck/visitor.py @@ -0,0 +1,57 @@ +import inspect + +__all__ = ['on', 'when'] + +def on(param_name): + def f(fn): + dispatcher = Dispatcher(param_name, fn) + return dispatcher + return f + + +def when(param_type): + def f(fn): + frame = inspect.currentframe().f_back + func_name = fn.func_name if 'func_name' in dir(fn) else fn.__name__ + dispatcher = frame.f_locals[func_name] + if not isinstance(dispatcher, Dispatcher): + dispatcher = dispatcher.dispatcher + dispatcher.add_target(param_type, fn) + def ff(*args, **kw): + return dispatcher(*args, **kw) + ff.dispatcher = dispatcher + return ff + return f + + +class Dispatcher(object): + def __init__(self, param_name, fn): + frame = inspect.currentframe().f_back.f_back + top_level = frame.f_locals == frame.f_globals + self.param_index = self.__argspec(fn).args.index(param_name) + self.param_name = param_name + self.targets = {} + + def __call__(self, *args, **kw): + typ = args[self.param_index].__class__ + d = self.targets.get(typ) + if d is not None: + return d(*args, **kw) + else: + issub = issubclass + t = self.targets + ks = t.keys() + ans = [t[k](*args, **kw) for k in ks if issub(typ, k)] + if len(ans) == 1: + return ans.pop() + return ans + + def add_target(self, typ, target): + self.targets[typ] = target + + @staticmethod + def __argspec(fn): + if hasattr(inspect, 'getfullargspec'): + return inspect.getfullargspec(fn) + else: + return inspect.getargspec(fn) From 015c95ac6819a28221d6b3845d6d4ae348cbb2e3 Mon Sep 17 00:00:00 2001 From: Adrian Date: Thu, 13 Feb 2020 15:07:26 -0500 Subject: [PATCH 002/162] "Starting comments development" --- cool-comp.sublime-project | 17 + cool-comp.sublime-workspace | 1745 ++++++++++++++++++++++++++++ src/abstract/semantics.py | 70 +- src/automatons/deterministic.py | 7 +- src/automatons/nondeterministic.py | 18 +- src/automatons/transformation.py | 15 +- src/baseNodeTree/astprinter.py | 3 +- src/baseNodeTree/base.py | 3 + src/coolgrammar/grammar.py | 88 +- src/grammar/grammar.py | 6 +- src/grammar/remrecursion.py | 74 -- src/grammar/symbols.py | 132 ++- src/lexer/regexgenerator.py | 54 +- src/parserr/.#shiftreduce.py | 1 - src/parserr/shiftreduce.py | 8 +- src/testing.py | 20 +- src/tools/dtbuilder.py | 32 +- src/tools/evaluate.py | 24 +- src/tools/gramtoregex.py | 206 ---- 19 files changed, 2038 insertions(+), 485 deletions(-) create mode 100644 cool-comp.sublime-project create mode 100644 cool-comp.sublime-workspace delete mode 100755 src/grammar/remrecursion.py delete mode 120000 src/parserr/.#shiftreduce.py delete mode 100755 src/tools/gramtoregex.py diff --git a/cool-comp.sublime-project b/cool-comp.sublime-project new file mode 100644 index 00000000..78978f58 --- /dev/null +++ b/cool-comp.sublime-project @@ -0,0 +1,17 @@ +{ + "build_systems": + [ + { + "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", + "name": "Anaconda Python Builder", + "selector": "source.python", + "shell_cmd": "\"python3\" -u \"$file\"" + } + ], + "folders": + [ + { + "path": "." + } + ] +} diff --git a/cool-comp.sublime-workspace b/cool-comp.sublime-workspace new file mode 100644 index 00000000..8e31f962 --- /dev/null +++ b/cool-comp.sublime-workspace @@ -0,0 +1,1745 @@ +{ + "auto_complete": + { + "selected_items": + [ + [ + "E5", + "E501" + ], + [ + "PY", + "PYTHON" + ], + [ + "W", + "WKGENERATOR" + ], + [ + "py", + "pyinstaller" + ], + [ + "whi", + "which" + ], + [ + "fi", + "finish_time" + ], + [ + "jo", + "jobLength" + ], + [ + "job", + "jobLength\tstatement" + ], + [ + "Sjc", + "SjcfJobAssumption\tclass" + ], + [ + "q", + "queueGatherStatistics\tfunction" + ], + [ + "Base", + "BaseScheduler\tclass" + ], + [ + "io", + "ioTimings\tstatement" + ], + [ + "tes", + "test_job\tstatement" + ], + [ + "spl", + "split_by_io\tfunction" + ], + [ + "asse", + "assertEqual\tfunction" + ], + [ + "sp", + "split_by_io\tfunction" + ], + [ + "as", + "assertEqual\tfunction" + ], + [ + "arr", + "arrival\tstatement" + ], + [ + "cl", + "__class__" + ], + [ + "clas", + "__class__\tclass" + ], + [ + "Log", + "LogRecord\tclass" + ], + [ + "Loge", + "Logger\tclass" + ], + [ + "for", + "format\tfunction" + ], + [ + "str", + "string\tmodule" + ], + [ + "progre", + "progressbar" + ], + [ + "req", + "require_relative\t (fname)" + ], + [ + "gsu", + "gsub\tfunc" + ], + [ + "uni", + "unit\tfunc" + ], + [ + "ker", + "kernel/fs.h\t/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19" + ], + [ + "pri", + "printf\tvoid printf(const char *, ...)" + ], + [ + "kernel", + "kernel/defs.h\t/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19" + ], + [ + "inc", + "inc\t#include \"…\"" + ], + [ + "fo", + "fork\tint fork()" + ], + [ + "kern", + "kernel/types.h\t/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19" + ], + [ + "std", + "stdlib.h\t/usr/include" + ], + [ + "strin", + "string.h\tstandard header (deprecated)" + ], + [ + "vec", + "vector\tstandard header" + ], + [ + "m", + "map\tstd::map" + ], + [ + "cstd", + "cstdio\tstandard header" + ], + [ + "ma", + "main\tmain()" + ] + ] + }, + "buffers": + [ + { + "file": "src/lexer/regexgenerator.py", + "settings": + { + "buffer_size": 5047, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "src/parserr/shiftreduce.py", + "settings": + { + "buffer_size": 2646, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "/home/adrian/.config/sublime-text-3/Packages/Anaconda/Anaconda.sublime-settings", + "settings": + { + "buffer_size": 21782, + "encoding": "UTF-8", + "line_ending": "Unix" + } + } + ], + "build_system": "", + "build_system_choices": + [ + [ + [ + [ + "Anaconda Python Builder", + "" + ], + [ + "Packages/Makefile/Make.sublime-build", + "" + ], + [ + "Packages/Makefile/Make.sublime-build", + "Clean" + ], + [ + "Packages/Python/Python.sublime-build", + "" + ], + [ + "Packages/Python/Python.sublime-build", + "Syntax Check" + ] + ], + [ + "Packages/Makefile/Make.sublime-build", + "" + ] + ], + [ + [ + [ + "Anaconda Python Builder", + "" + ], + [ + "Packages/Makefile/Make.sublime-build", + "" + ], + [ + "Packages/Makefile/Make.sublime-build", + "Clean" + ], + [ + "Packages/Python/Python.sublime-build", + "" + ], + [ + "Packages/Python/Python.sublime-build", + "Syntax Check" + ], + [ + "Packages/User/Make(Linux).sublime-build", + "" + ], + [ + "Packages/User/Make(Linux).sublime-build", + "test" + ], + [ + "Packages/User/Make(Linux).sublime-build", + "clean" + ], + [ + "Packages/User/make_test.sublime-build", + "" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "all" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "clean" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "echo \"*** Error" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "genwk-fifo" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "genwk-io" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "genwk-mlfq" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "genwk-sjcf" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "genwk-sjf" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "test" + ] + ], + [ + "Packages/User/Make(Linux).sublime-build", + "test" + ] + ], + [ + [ + [ + "Anaconda Python Builder", + "" + ], + [ + "Packages/Makefile/Make.sublime-build", + "" + ], + [ + "Packages/Makefile/Make.sublime-build", + "Clean" + ], + [ + "Packages/Python/Python.sublime-build", + "" + ], + [ + "Packages/Python/Python.sublime-build", + "Syntax Check" + ], + [ + "Packages/User/make.sublime-build", + "" + ], + [ + "Packages/User/make.sublime-build", + "test" + ], + [ + "Packages/User/make.sublime-build", + "clean" + ] + ], + [ + "Packages/User/make.sublime-build", + "" + ] + ], + [ + [ + [ + "Anaconda Python Builder", + "" + ], + [ + "Packages/Makefile/Make.sublime-build", + "" + ], + [ + "Packages/Makefile/Make.sublime-build", + "Clean" + ], + [ + "Packages/Python/Python.sublime-build", + "" + ], + [ + "Packages/Python/Python.sublime-build", + "Syntax Check" + ], + [ + "Packages/User/make_test.sublime-build", + "" + ] + ], + [ + "Packages/User/make_test.sublime-build", + "" + ] + ], + [ + [ + [ + "Anaconda Python Builder", + "" + ], + [ + "Packages/Makefile/Make.sublime-build", + "" + ], + [ + "Packages/Makefile/Make.sublime-build", + "Clean" + ], + [ + "Packages/Python/Python.sublime-build", + "" + ], + [ + "Packages/Python/Python.sublime-build", + "Syntax Check" + ], + [ + "Packages/User/make_test.sublime-build", + "" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "all" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "clean" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "echo \"*** Error" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "genwk-fifo" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "genwk-io" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "genwk-mlfq" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "genwk-sjcf" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "genwk-sjf" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "test" + ] + ], + [ + "Packages/User/make_test.sublime-build", + "" + ] + ], + [ + [ + [ + "Packages/Makefile/Make.sublime-build", + "" + ], + [ + "Packages/Makefile/Make.sublime-build", + "Clean" + ], + [ + "Packages/ShellScript/ShellScript.sublime-build", + "" + ] + ], + [ + "Packages/Makefile/Make.sublime-build", + "" + ] + ], + [ + [ + [ + "Packages/Makefile/Make.sublime-build", + "" + ], + [ + "Packages/Makefile/Make.sublime-build", + "Clean" + ], + [ + "Packages/ShellScript/ShellScript.sublime-build", + "" + ], + [ + "Packages/User/make.sublime-build", + "" + ], + [ + "Packages/User/make.sublime-build", + "test" + ], + [ + "Packages/User/make.sublime-build", + "clean" + ] + ], + [ + "Packages/User/make.sublime-build", + "" + ] + ], + [ + [ + [ + "Packages/Makefile/Make.sublime-build", + "" + ], + [ + "Packages/Makefile/Make.sublime-build", + "Clean" + ], + [ + "Packages/User/Make(Linux).sublime-build", + "" + ], + [ + "Packages/User/Make(Linux).sublime-build", + "Clean" + ], + [ + "Packages/User/Make(Linux).sublime-build", + "Test" + ], + [ + "Packages/User/make_test.sublime-build", + "" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "all" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "clean" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "echo \"*** Error" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "genwk-fifo" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "genwk-io" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "genwk-mlfq" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "genwk-sjcf" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "genwk-sjf" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "test" + ] + ], + [ + "Packages/User/Make(Linux).sublime-build", + "Test" + ] + ], + [ + [ + [ + "Packages/Makefile/Make.sublime-build", + "" + ], + [ + "Packages/Makefile/Make.sublime-build", + "Clean" + ], + [ + "Packages/User/make.sublime-build", + "" + ], + [ + "Packages/User/make.sublime-build", + "test" + ], + [ + "Packages/User/make.sublime-build", + "clean" + ] + ], + [ + "Packages/Makefile/Make.sublime-build", + "" + ] + ], + [ + [ + [ + "Packages/Makefile/Make.sublime-build", + "" + ], + [ + "Packages/Makefile/Make.sublime-build", + "Clean" + ], + [ + "Packages/User/make_test.sublime-build", + "" + ] + ], + [ + "Packages/User/make_test.sublime-build", + "" + ] + ], + [ + [ + [ + "Packages/Makefile/Make.sublime-build", + "" + ], + [ + "Packages/Makefile/Make.sublime-build", + "Clean" + ], + [ + "Packages/User/make_test.sublime-build", + "" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "all" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "clean" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "echo \"*** Error" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "genwk-fifo" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "genwk-io" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "genwk-mlfq" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "genwk-sjcf" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "genwk-sjf" + ], + [ + "Packages/User/MakeTargets.sublime-build", + "test" + ] + ], + [ + "Packages/User/MakeTargets.sublime-build", + "test" + ] + ], + [ + [ + [ + "Packages/User/make_test.sublime-build", + "" + ] + ], + [ + "Packages/User/make_test.sublime-build", + "" + ] + ] + ], + "build_varint": "", + "command_palette": + { + "height": 0.0, + "last_filter": "", + "selected_items": + [ + [ + "Git merge", + "Git: Merge Branch" + ], + [ + "Git stat", + "Git: Status" + ], + [ + "Git", + "Git: Commit" + ], + [ + "git", + "Git: Status" + ], + [ + "vie", + "View: Toggle Side Bar" + ], + [ + "Vie", + "View: Toggle Side Bar" + ], + [ + "Remov", + "Package Control: Remove Package" + ], + [ + "Make-", + "Build With: MakeTargets - all" + ], + [ + "Make", + "Build With: MakeTargets - test" + ], + [ + "make", + "Build With: Make - Clean" + ], + [ + "Install", + "Package Control: Install Package" + ], + [ + "Remo", + "Package Control: Remove Package" + ], + [ + "MakeTar", + "Build With: MakeTargets - test" + ], + [ + "VIe", + "View: Toggle Side Bar" + ], + [ + "Insta", + "Package Control: Install Package" + ], + [ + "vier", + "View: Toggle Side Bar" + ], + [ + "UI", + "UI: Select Theme" + ], + [ + "Color", + "UI: Select Color Scheme" + ], + [ + "Sett", + "Preferences: Settings" + ], + [ + "LSP", + "LSP: Restart Servers" + ], + [ + "Enabl", + "LSP: Enable Language Server Globally" + ], + [ + "Pac", + "Package Control: Remove Package" + ], + [ + "LanguageSe", + "LSP: Enable Language Server Globally" + ], + [ + "view", + "View: Toggle Menu" + ], + [ + "View", + "View: Toggle Menu" + ], + [ + "ui", + "UI: Select Color Scheme" + ], + [ + "Col", + "UI: Select Color Scheme" + ], + [ + "insta", + "Package Control: Install Package" + ], + [ + "Remove", + "Package Control: Remove Package" + ], + [ + "Packa", + "Package Control: Remove Package" + ], + [ + "ins", + "Package Control: Install Package" + ], + [ + "color", + "UI: Select Color Scheme" + ], + [ + "colo", + "UI: Select Color Scheme" + ], + [ + "Colo", + "UI: Select Color Scheme" + ], + [ + "Ter", + "Terminal: Open" + ], + [ + "Settig", + "Preferences: Settings" + ], + [ + "Anaconda: Pytho", + "Anaconda: Set Python interpreter" + ], + [ + "Prefer", + "Preferences: Settings" + ], + [ + "Settings", + "Preferences: Settings" + ], + [ + "Vi", + "View: Toggle Menu" + ], + [ + "Ana", + "Anaconda: Autoformat PEP8 Errors" + ], + [ + "COlo", + "UI: Select Color Scheme" + ], + [ + "Theme", + "UI: Select Color Scheme" + ], + [ + "Color T", + "UI: Select Color Scheme" + ], + [ + "Them", + "UI: Select Theme" + ], + [ + "install", + "Package Control: Install Package" + ] + ], + "width": 0.0 + }, + "console": + { + "height": 193.0, + "history": + [ + "make -j1 test", + "print(HellO)", + "class A:", + "a(range(5))", + "a = [].__class__", + "[].__class__", + "sum(range(10,40,10))", + "ls", + "print(\"Hello\")", + "print(Hello)", + "print Hello" + ] + }, + "distraction_free": + { + "menu_visible": true, + "show_minimap": false, + "show_open_files": false, + "show_tabs": false, + "side_bar_visible": false, + "status_bar_visible": false + }, + "expanded_folders": + [ + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/parserr" + ], + "file_history": + [ + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/grammar/symbols.py", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/grammar/remrecursion.py", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/grammar/grammar.py", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/coolgrammar/grammar.py", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/baseNodeTree/astprinter.py", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/baseNodeTree/base.py", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/automatons/nondeterministic.py", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/automatons/deterministic.py", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/abstract/semantics.py", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/automatons/transformation.py", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/tests/lexer/comment1.cl", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/tests/lexer/comment1_error.txt", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/Readme.md", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/src/mlfq.py", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/src/makefileGenerator.py", + "/etc/avahi/hosts", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/.gitignore", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/dist/wkgenerator", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/wkgenerator.spec", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/src/sjcf.py", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/src/sjf.py", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/src/fifo.py", + "/home/adrian/Documents/Universidad/3er año/2do Semestre/SO/Scheduler/policies/algorithms.py", + "/home/adrian/.config/sublime-text-3/Packages/User/Make(Linux).sublime-build", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/src/jobs.py", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/src/schedtools.py", + "/home/adrian/Documents/Universidad/3er año/2do Semestre/SO/Scheduler/README.txt", + "/home/adrian/Documents/Universidad/3er año/2do Semestre/SO/Scheduler/policies/deprecated.py", + "/home/adrian/Documents/Universidad/3er año/2do Semestre/SO/Scheduler/scheduler.py", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/out.sjf", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/sjf.json", + "/home/adrian/.config/sublime-text-3/Packages/Anaconda/Default (Linux).sublime-keymap", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/scheduler.sublime-project", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/build.sublime_build", + "/home/adrian/.config/sublime-text-3/Packages/User/make_test.sublime-build", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/src/testing.py", + "/usr/local/lib/python3.7/dist-packages/progressbar/__init__.py", + "/usr/local/lib/python3.7/dist-packages/progressbar/progressbar.py", + "/home/adrian/.config/sublime-text-3/Packages/Anaconda/Anaconda.sublime-settings", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/src/workload_generator.py", + "/home/adrian/.config/sublime-text-3/Packages/User/Anaconda.sublime-settings", + "/home/adrian/Documents/Universidad/Softwares/Packages/vscode_extension/settings.txt", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/workload_generator.py", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/schedtools.py", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/fifo.py", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/jobs.py", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/test.go", + "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/grade-lab-util", + "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/user/ls.c", + "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/.gitignore", + "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/.cvsignore", + "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/user/xargstest.sh", + "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/gradelib.py", + "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/user/kill.c", + "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/user/ulib.c", + "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/user/sleep.c", + "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/user/primes.c", + "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/.clang_complete", + "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/kernel/file.c", + "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/kernel/defs.h", + "/home/adrian/.config/sublime-text-3/Packages/SublimeAStyleFormatter/SublimeAStyleFormatter.sublime-settings", + "/home/adrian/.config/sublime-text-3/Packages/Terminal/Terminal.sublime-settings", + "/home/adrian/.config/sublime-text-3/Packages/SideBarEnhancements/Side Bar.sublime-settings", + "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/user/initcode.S", + "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/.gdbinit.tmpl-riscv", + "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/conf/lab.mk", + "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/LICENSE", + "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/user/cat.c", + "/home/adrian/Documents/ACMICPC/solutions/diff2000/449B/main.cpp", + "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/user/text.c", + "/home/adrian/Documents/MyProjects/JavaScript/test/t.js", + "/home/adrian/Documents/MyProjects/JavaScript/test/testingc.c", + "/home/adrian/Documents/MyProjects/JavaScript/test/test.cpp", + "/home/adrian/Documents/Universidad/Docencia/MITXv6/xv6-pdx_modified/user.h" + ], + "find": + { + "height": 38.0 + }, + "find_in_files": + { + "height": 129.0, + "where_history": + [ + ] + }, + "find_state": + { + "case_sensitive": false, + "find_history": + [ + ], + "highlight": true, + "in_selection": false, + "preserve_case": false, + "regex": false, + "replace_history": + [ + ], + "reverse": false, + "show_context": true, + "use_buffer2": true, + "whole_word": false, + "wrap": true + }, + "groups": + [ + { + "selected": 1, + "sheets": + [ + { + "buffer": 0, + "file": "src/lexer/regexgenerator.py", + "semi_transient": false, + "settings": + { + "buffer_size": 5047, + "regions": + { + }, + "selection": + [ + [ + 4598, + 4598 + ] + ], + "settings": + { + "bracket_highlighter.busy": false, + "bracket_highlighter.clone": -1, + "bracket_highlighter.clone_locations": + { + "close": + { + "1": + [ + 214, + 215 + ] + }, + "icon": + { + "1": + [ + "Packages/BracketHighlighter/icons/round_bracket.png", + "region.yellowish" + ] + }, + "open": + { + "1": + [ + 152, + 153 + ] + }, + "unmatched": + { + } + }, + "bracket_highlighter.clone_regions": + [ + "bh_c_define", + "bh_c_define_center", + "bh_c_define_open", + "bh_c_define_close", + "bh_c_define_content", + "bh_angle", + "bh_angle_center", + "bh_angle_open", + "bh_angle_close", + "bh_angle_content", + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_round_content", + "bh_double_quote", + "bh_double_quote_center", + "bh_double_quote_open", + "bh_double_quote_close", + "bh_double_quote_content", + "bh_tag", + "bh_tag_center", + "bh_tag_open", + "bh_tag_close", + "bh_tag_content", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_regex_content", + "bh_single_quote", + "bh_single_quote_center", + "bh_single_quote_open", + "bh_single_quote_close", + "bh_single_quote_content", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_unmatched_content", + "bh_default", + "bh_default_center", + "bh_default_open", + "bh_default_close", + "bh_default_content", + "bh_square", + "bh_square_center", + "bh_square_open", + "bh_square_close", + "bh_square_content", + "bh_curly", + "bh_curly_center", + "bh_curly_open", + "bh_curly_close", + "bh_curly_content" + ], + "bracket_highlighter.locations": + { + "close": + { + "1": + [ + 4597, + 4598 + ] + }, + "icon": + { + "1": + [ + "Packages/BracketHighlighter/icons/round_bracket.png", + "region.yellowish" + ] + }, + "open": + { + "1": + [ + 4591, + 4592 + ] + }, + "unmatched": + { + } + }, + "bracket_highlighter.regions": + [ + "bh_c_define", + "bh_c_define_center", + "bh_c_define_open", + "bh_c_define_close", + "bh_c_define_content", + "bh_angle", + "bh_angle_center", + "bh_angle_open", + "bh_angle_close", + "bh_angle_content", + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_round_content", + "bh_double_quote", + "bh_double_quote_center", + "bh_double_quote_open", + "bh_double_quote_close", + "bh_double_quote_content", + "bh_tag", + "bh_tag_center", + "bh_tag_open", + "bh_tag_close", + "bh_tag_content", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_regex_content", + "bh_single_quote", + "bh_single_quote_center", + "bh_single_quote_open", + "bh_single_quote_close", + "bh_single_quote_content", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_unmatched_content", + "bh_default", + "bh_default_center", + "bh_default_open", + "bh_default_close", + "bh_default_content", + "bh_square", + "bh_square_center", + "bh_square_open", + "bh_square_close", + "bh_square_content", + "bh_curly", + "bh_curly_center", + "bh_curly_open", + "bh_curly_close", + "bh_curly_content" + ], + "syntax": "Packages/Python/Python.sublime-syntax", + "tab_size": 4, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 761.0, + "zoom_level": 1.0 + }, + "stack_index": 2, + "type": "text" + }, + { + "buffer": 1, + "file": "src/parserr/shiftreduce.py", + "semi_transient": false, + "settings": + { + "buffer_size": 2646, + "regions": + { + }, + "selection": + [ + [ + 1355, + 1355 + ] + ], + "settings": + { + "bracket_highlighter.busy": false, + "bracket_highlighter.clone": -1, + "bracket_highlighter.clone_locations": + { + "close": + { + }, + "icon": + { + }, + "open": + { + }, + "unmatched": + { + } + }, + "bracket_highlighter.clone_regions": + [ + "bh_c_define", + "bh_c_define_center", + "bh_c_define_open", + "bh_c_define_close", + "bh_c_define_content", + "bh_angle", + "bh_angle_center", + "bh_angle_open", + "bh_angle_close", + "bh_angle_content", + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_round_content", + "bh_double_quote", + "bh_double_quote_center", + "bh_double_quote_open", + "bh_double_quote_close", + "bh_double_quote_content", + "bh_tag", + "bh_tag_center", + "bh_tag_open", + "bh_tag_close", + "bh_tag_content", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_regex_content", + "bh_single_quote", + "bh_single_quote_center", + "bh_single_quote_open", + "bh_single_quote_close", + "bh_single_quote_content", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_unmatched_content", + "bh_default", + "bh_default_center", + "bh_default_open", + "bh_default_close", + "bh_default_content", + "bh_square", + "bh_square_center", + "bh_square_open", + "bh_square_close", + "bh_square_content", + "bh_curly", + "bh_curly_center", + "bh_curly_open", + "bh_curly_close", + "bh_curly_content" + ], + "bracket_highlighter.locations": + { + "close": + { + "1": + [ + 1399, + 1400 + ] + }, + "icon": + { + "1": + [ + "Packages/BracketHighlighter/icons/square_bracket.png", + "region.bluish" + ] + }, + "open": + { + "1": + [ + 1354, + 1355 + ] + }, + "unmatched": + { + } + }, + "bracket_highlighter.regions": + [ + "bh_c_define", + "bh_c_define_center", + "bh_c_define_open", + "bh_c_define_close", + "bh_c_define_content", + "bh_angle", + "bh_angle_center", + "bh_angle_open", + "bh_angle_close", + "bh_angle_content", + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_round_content", + "bh_double_quote", + "bh_double_quote_center", + "bh_double_quote_open", + "bh_double_quote_close", + "bh_double_quote_content", + "bh_tag", + "bh_tag_center", + "bh_tag_open", + "bh_tag_close", + "bh_tag_content", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_regex_content", + "bh_single_quote", + "bh_single_quote_center", + "bh_single_quote_open", + "bh_single_quote_close", + "bh_single_quote_content", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_unmatched_content", + "bh_default", + "bh_default_center", + "bh_default_open", + "bh_default_close", + "bh_default_content", + "bh_square", + "bh_square_center", + "bh_square_open", + "bh_square_close", + "bh_square_content", + "bh_curly", + "bh_curly_center", + "bh_curly_open", + "bh_curly_close", + "bh_curly_content" + ], + "syntax": "Packages/Python/Python.sublime-syntax", + "tab_size": 4, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 624.0, + "zoom_level": 1.0 + }, + "stack_index": 0, + "type": "text" + }, + { + "buffer": 2, + "file": "/home/adrian/.config/sublime-text-3/Packages/Anaconda/Anaconda.sublime-settings", + "semi_transient": false, + "settings": + { + "buffer_size": 21782, + "regions": + { + }, + "selection": + [ + [ + 8619, + 8619 + ] + ], + "settings": + { + "bracket_highlighter.busy": false, + "bracket_highlighter.clone": -1, + "bracket_highlighter.clone_locations": + { + "close": + { + }, + "icon": + { + }, + "open": + { + }, + "unmatched": + { + } + }, + "bracket_highlighter.clone_regions": + [ + "bh_c_define", + "bh_c_define_center", + "bh_c_define_open", + "bh_c_define_close", + "bh_c_define_content", + "bh_angle", + "bh_angle_center", + "bh_angle_open", + "bh_angle_close", + "bh_angle_content", + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_round_content", + "bh_double_quote", + "bh_double_quote_center", + "bh_double_quote_open", + "bh_double_quote_close", + "bh_double_quote_content", + "bh_tag", + "bh_tag_center", + "bh_tag_open", + "bh_tag_close", + "bh_tag_content", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_regex_content", + "bh_single_quote", + "bh_single_quote_center", + "bh_single_quote_open", + "bh_single_quote_close", + "bh_single_quote_content", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_unmatched_content", + "bh_default", + "bh_default_center", + "bh_default_open", + "bh_default_close", + "bh_default_content", + "bh_square", + "bh_square_center", + "bh_square_open", + "bh_square_close", + "bh_square_content", + "bh_curly", + "bh_curly_center", + "bh_curly_open", + "bh_curly_close", + "bh_curly_content" + ], + "bracket_highlighter.locations": + { + "close": + { + "1": + [ + 8618, + 8619 + ] + }, + "icon": + { + "1": + [ + "Packages/BracketHighlighter/icons/double_quote.png", + "region.greenish" + ] + }, + "open": + { + "1": + [ + 8613, + 8614 + ] + }, + "unmatched": + { + } + }, + "bracket_highlighter.regions": + [ + "bh_c_define", + "bh_c_define_center", + "bh_c_define_open", + "bh_c_define_close", + "bh_c_define_content", + "bh_angle", + "bh_angle_center", + "bh_angle_open", + "bh_angle_close", + "bh_angle_content", + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_round_content", + "bh_double_quote", + "bh_double_quote_center", + "bh_double_quote_open", + "bh_double_quote_close", + "bh_double_quote_content", + "bh_tag", + "bh_tag_center", + "bh_tag_open", + "bh_tag_close", + "bh_tag_content", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_regex_content", + "bh_single_quote", + "bh_single_quote_center", + "bh_single_quote_open", + "bh_single_quote_close", + "bh_single_quote_content", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_unmatched_content", + "bh_default", + "bh_default_center", + "bh_default_open", + "bh_default_close", + "bh_default_content", + "bh_square", + "bh_square_center", + "bh_square_open", + "bh_square_close", + "bh_square_content", + "bh_curly", + "bh_curly_center", + "bh_curly_open", + "bh_curly_close", + "bh_curly_content" + ], + "syntax": "Packages/JavaScript/JSON.sublime-syntax", + "tab_size": 4, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 5826.0, + "zoom_level": 1.0 + }, + "stack_index": 1, + "type": "text" + } + ] + } + ], + "incremental_find": + { + "height": 38.0 + }, + "input": + { + "height": 52.0 + }, + "layout": + { + "cells": + [ + [ + 0, + 0, + 1, + 1 + ] + ], + "cols": + [ + 0.0, + 1.0 + ], + "rows": + [ + 0.0, + 1.0 + ] + }, + "menu_visible": true, + "output.astyle_error_message": + { + "height": 0.0 + }, + "output.diagnostics": + { + "height": 181.0 + }, + "output.exec": + { + "height": 625.0 + }, + "output.find_results": + { + "height": 0.0 + }, + "output.git": + { + "height": 181.0 + }, + "output.language servers": + { + "height": 181.0 + }, + "output.mdpopups": + { + "height": 0.0 + }, + "pinned_build_system": "", + "project": "cool-comp.sublime-project", + "replace": + { + "height": 72.0 + }, + "save_all_on_build": true, + "select_file": + { + "height": 0.0, + "last_filter": "", + "selected_items": + [ + ], + "width": 0.0 + }, + "select_project": + { + "height": 500.0, + "last_filter": "", + "selected_items": + [ + ], + "width": 380.0 + }, + "select_symbol": + { + "height": 0.0, + "last_filter": "", + "selected_items": + [ + ], + "width": 0.0 + }, + "selected_group": 0, + "settings": + { + }, + "show_minimap": true, + "show_open_files": true, + "show_tabs": true, + "side_bar_visible": true, + "side_bar_width": 261.0, + "status_bar_visible": true, + "template_settings": + { + } +} diff --git a/src/abstract/semantics.py b/src/abstract/semantics.py index 310d5561..c5b070e0 100755 --- a/src/abstract/semantics.py +++ b/src/abstract/semantics.py @@ -1,21 +1,24 @@ import itertools as itt + class Attribute: def __init__(self, name, typex): self.name = name self.type = typex - + def __str__(self): return f'[attrib] {self.name} : {self.type.name};' def __repr__(self): return str(self) + class SemanticError(Exception): @property def text(self): return self.args[0] - + + class Method: def __init__(self, name, param_names, params_types, return_type): self.name = name @@ -24,16 +27,18 @@ def __init__(self, name, param_names, params_types, return_type): self.return_type = return_type def __str__(self): - params = ', '.join(f'{n}:{t.name}' for n,t in zip(self.param_names, self.param_types)) + params = ', '.join(f'{n}:{t.name}' for n, t in zip( + self.param_names, self.param_types)) return f'[method] {self.name}({params}): {self.return_type.name};' def __eq__(self, other): return other.name == self.name and \ other.return_type == self.return_type and \ other.param_types == self.param_types - + + class Type: - def __init__(self, name:str): + def __init__(self, name: str): self.name = name self.attributes = [] self.methods = {} @@ -44,18 +49,20 @@ def set_parent(self, parent): raise SemanticError(f'Parent type is already set for {self.name}.') self.parent = parent - def get_attribute(self, name:str): + def get_attribute(self, name: str): try: return next(attr for attr in self.attributes if attr.name == name) except StopIteration: if self.parent is None: - raise SemanticError(f'Attribute "{name}" is not defined in {self.name}.') + raise SemanticError( + f'Attribute "{name}" is not defined in {self.name}.') try: return self.parent.get_attribute(name) except SemanticError: - raise SemanticError(f'Attribute "{name}" is not defined in {self.name}.') + raise SemanticError( + f'Attribute "{name}" is not defined in {self.name}.') - def define_attribute(self, name:str, typex): + def define_attribute(self, name: str, typex): try: self.get_attribute(name) except SemanticError: @@ -63,24 +70,29 @@ def define_attribute(self, name:str, typex): self.attributes.append(attribute) return attribute else: - raise SemanticError(f'Attribute "{name}" is already defined in {self.name}.') + raise SemanticError( + f'Attribute "{name}" is already defined in {self.name}.') - def get_method(self, name:str): + def get_method(self, name: str): try: return self.methods[name] except KeyError: if self.parent is None: - raise SemanticError(f'Method "{name}" is not defined in {self.name}.') + raise SemanticError( + f'Method "{name}" is not defined in {self.name}.') try: return self.parent.get_method(name) except SemanticError: - raise SemanticError(f'Method "{name}" is not defined in {self.name}.') + raise SemanticError( + f'Method "{name}" is not defined in {self.name}.') - def define_method(self, name:str, param_names:list, param_types:list, return_type): + def define_method(self, name: str, param_names: list, param_types: list, return_type): if name in self.methods: - raise SemanticError(f'Method "{name}" already defined in {self.name}.') + raise SemanticError( + f'Method "{name}" already defined in {self.name}.') - method = self.methods[name] = Method(name, param_names, param_types, return_type) + method = self.methods[name] = Method( + name, param_names, param_types, return_type) return method def conforms_to(self, other): @@ -105,9 +117,10 @@ def __str__(self): def __repr__(self): return str(self) - def __eq__(self,other): + def __eq__(self, other): return isinstance(other, Type) and other.name == self.name + class VoidType(Type): def __init__(self): super(VoidType, self).__init__('void') @@ -123,13 +136,15 @@ def __init__(self): def __eq__(self, other): return isinstance(other, ObjectType) + class IntegerType(Type): def __init__(self): super(IntegerType, self).__init__('int') - + def __eq__(self, other): return isinstance(other, IntegerType) + class StringType(Type): def __init__(self): super(StringType, self).__init__('string') @@ -137,6 +152,7 @@ def __init__(self): def __eq__(self, other): return isinstance(other, StringType) + class BoolType(Type): def __init__(self): super(BoolType, self).__init__('bool') @@ -144,6 +160,7 @@ def __init__(self): def __eq__(self, other): return isinstance(other, BoolType) + class AutoType(Type): def __init__(self): super(AutoType, self).__init__('AUTO_TYPE') @@ -151,7 +168,7 @@ def __init__(self): def __eq__(self, other): return isinstance(other, AutoType) - def conforms_to(self,other): + def conforms_to(self, other): return True @@ -159,13 +176,14 @@ class Context: def __init__(self): self.types = {} - def create_type(self, name:str): + def create_type(self, name: str): if name in self.types: - raise SemanticError(f'Type with the same name ({name}) already in context.') + raise SemanticError( + f'Type with the same name ({name}) already in context.') typex = self.types[name] = Type(name) return typex - def get_type(self, name:str): + def get_type(self, name: str): try: return self.types[name] except KeyError: @@ -177,11 +195,13 @@ def __str__(self): def __repr__(self): return str(self) + class VariableInfo: def __init__(self, name, vtype): self.name = name self.type = vtype + class Scope: def __init__(self, parent=None): self.locals = [] @@ -203,7 +223,8 @@ def define_variable(self, vname, vtype): return info def find_variable(self, vname, index=None): - locals = self.locals if index is None else itt.islice(self.locals, index) + locals = self.locals if index is None else itt.islice( + self.locals, index) try: return next(x for x in locals if x.name == vname) except StopIteration: @@ -214,7 +235,7 @@ def is_defined(self, vname): def is_local(self, vname): return any(True for x in self.locals if x.name == vname) - + def __str__(self): s = ' Scope \n' for v in self.locals: @@ -223,4 +244,3 @@ def __str__(self): for child in self.children: s += str(child) return s - diff --git a/src/automatons/deterministic.py b/src/automatons/deterministic.py index 81f9d9fa..e96549b3 100755 --- a/src/automatons/deterministic.py +++ b/src/automatons/deterministic.py @@ -1,4 +1,5 @@ -from automatons.nondeterministic import NFA +from automatons.nondeterministic import NFA + class DFA(NFA): """ @@ -6,15 +7,15 @@ class DFA(NFA): - Usar la función de transición propia de los autómatas finitos deterministas. - Implementar un algoritmo de reconocimiento de cadenas. """ + def __init__(self, states, finals, transitions, start=0): assert all(isinstance(value, int) for value in transitions.values()) assert all(len(symbol) > 0 for origin, symbol in transitions) - transitions = { key: [value] for key, value in transitions.items() } + transitions = {key: [value] for key, value in transitions.items()} NFA.__init__(self, states, finals, transitions, start) self.current = start - def epsilon_transitions(self): raise TypeError() diff --git a/src/automatons/nondeterministic.py b/src/automatons/nondeterministic.py index 36846b1a..57b4f9bc 100755 --- a/src/automatons/nondeterministic.py +++ b/src/automatons/nondeterministic.py @@ -18,16 +18,18 @@ class NFA: Incluso permite realizar epsilon-transiciones (transiciones que no consumen símbolos de la cinta) lo cual resalta aún más el carácter no determinista de estos autómatas. """ + def __init__(self, states, finals, transitions, start=0): self.states = states self.start = start self.finals = set(finals) self.map = transitions self.vocabulary = set() - self.transitions = { state: {} for state in range(states) } + self.transitions = {state: {} for state in range(states)} for (origin, symbol), destinations in transitions.items(): - assert hasattr(destinations, '__iter__'), 'Invalid collection of states' + assert hasattr( + destinations, '__iter__'), 'Invalid collection of states' self.transitions[origin][symbol] = destinations self.vocabulary.add(symbol) @@ -43,16 +45,20 @@ def epsilon_transitions(self, state): def graph(self): import pydot G = pydot.Dot(rankdir='LR', margin=0.1) - G.add_node(pydot.Node('start', shape='plaintext', label='', width=0, height=0)) + G.add_node(pydot.Node('start', shape='plaintext', + label='', width=0, height=0)) # for (start, tran), destinations in self.transitions.items(): for start, dest in self.transitions.items(): for tran, destinations in dest.items(): tran = 'ε' if tran == '' else tran - G.add_node(pydot.Node(start, shape='circle', style='bold' if start in self.finals else '')) + G.add_node(pydot.Node(start, shape='circle', + style='bold' if start in self.finals else '')) for end in destinations: - G.add_node(pydot.Node(end, shape='circle', style='bold' if end in self.finals else '')) - G.add_edge(pydot.Edge(start, end, label=tran, labeldistance=2)) + G.add_node(pydot.Node(end, shape='circle', + style='bold' if end in self.finals else '')) + G.add_edge(pydot.Edge( + start, end, label=tran, labeldistance=2)) G.add_edge(pydot.Edge('start', self.start, label='', style='dashed')) return G diff --git a/src/automatons/transformation.py b/src/automatons/transformation.py index d518e87e..08e2a64c 100755 --- a/src/automatons/transformation.py +++ b/src/automatons/transformation.py @@ -3,6 +3,7 @@ from automatons.nondeterministic import NFA from tools.firsts import ContainerSet + def compute_epsilon_closure(automaton: NFA, states): pending = list(states) closure = set(states) @@ -19,7 +20,7 @@ def compute_epsilon_closure(automaton: NFA, states): def nfa_to_deterministic(automaton: NFA): transitions = {} - start = compute_epsilon_closure(automaton,[automaton.start]) + start = compute_epsilon_closure(automaton, [automaton.start]) start.state = 0 pending = [start] aut_states = [start] @@ -30,19 +31,21 @@ def nfa_to_deterministic(automaton: NFA): for symbol in automaton.vocabulary: next_state = [] for s in state: - next_state+=[x for x in automaton.transitions.get(s,{}).get(symbol,[])] + next_state += [x for x in automaton.transitions.get( + s, {}).get(symbol, [])] if next_state: try: - transitions[state.state,symbol] + transitions[state.state, symbol] assert False, "Automato Finito Determinista Invalido" except KeyError: next_state = compute_epsilon_closure(automaton, next_state) - if not next_state in aut_states: + if next_state not in aut_states: next_state.state = n - next_state.is_final = any(s in automaton.finals for s in next_state) + next_state.is_final = any( + s in automaton.finals for s in next_state) pending.append(next_state) aut_states.append(next_state) - n+=1 + n += 1 else: next_state = aut_states[aut_states.index(next_state)] transitions[state.state, symbol] = next_state.state diff --git a/src/baseNodeTree/astprinter.py b/src/baseNodeTree/astprinter.py index a4b87040..d904d4a1 100755 --- a/src/baseNodeTree/astprinter.py +++ b/src/baseNodeTree/astprinter.py @@ -1,5 +1,6 @@ import tools.visitor as visitor + def get_printer(AtomicNode=(), UnaryNode=(), BinaryNode=(), ): class PrintVisitor(object): @@ -25,4 +26,4 @@ def visit(self, node, tabs=0): return '\t' * tabs + f'\\__ {node.__class__.__name__}: {node.lex}' printer = PrintVisitor() - return (lambda ast: printer.visit(ast)) \ No newline at end of file + return (lambda ast: printer.visit(ast)) diff --git a/src/baseNodeTree/base.py b/src/baseNodeTree/base.py index 7a0f7812..60b824ed 100755 --- a/src/baseNodeTree/base.py +++ b/src/baseNodeTree/base.py @@ -2,10 +2,12 @@ class Node: def evaluate(self): raise NotImplementedError() + class AtomicNode(Node): def __init__(self, lex): self.lex = lex + class UnaryNode(Node): def __init__(self, node): self.node = node @@ -18,6 +20,7 @@ def evaluate(self): def operate(value): raise NotImplementedError() + class BinaryNode(Node): def __init__(self, left, right): self.left = left diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index df046ebc..ac91a61c 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -10,37 +10,48 @@ from abstract.tree import ActionNode, CaseNode, ParentFuncCall, BlockNode, IsVoidNode from lexer.tokenizer import Lexer + def build_cool_grammar(): G = Grammar() program = G.NonTerminal('', True) class_list, class_def, empty_feature_list, feature_list, meod_def = \ - G.NonTerminals(' ') + G.NonTerminals( + ' ') - attr_def, param_list, param, statement_list = G.NonTerminals(' ') + attr_def, param_list, param, statement_list = G.NonTerminals( + ' ') - var_dec, args_list, instantiation = G.NonTerminals(' ') + var_dec, args_list, instantiation = G.NonTerminals( + ' ') - exp, typex, term, factor, nested_lets = G.NonTerminals(' ') + exp, typex, term, factor, nested_lets = G.NonTerminals( + ' ') - arith, atom, actions, action, block= G.NonTerminals(' ') + arith, atom, actions, action, block = G.NonTerminals( + ' ') - args_list_empty, param_list_empty, case_statement = G.NonTerminals(' ') + args_list_empty, param_list_empty, case_statement = G.NonTerminals( + ' ') class_keyword, def_keyword, in_keyword = G.Terminals('class def in') - coma, period, dot_comma, opar, cpar, obrack, cbrack, plus, minus, star, div, dd = G.Terminals(', . ; ( ) { } + - * / :') + coma, period, dot_comma, opar, cpar, obrack, cbrack, plus, minus, star, div, dd = G.Terminals( + ', . ; ( ) { } + - * / :') idx, let, intx, string, num, equal, true, false, boolean, objectx =\ - G.Terminals('id let int string num = true false bool object') + G.Terminals('id let int string num = true false bool object') string_const, void, auto = G.Terminals('string_const void AUTO_TYPE') - if_, then, else_, assign, new, case, of, esac = G.Terminals('if then else assign new case of esac') + if_, then, else_, assign, new, case, of, esac = G.Terminals( + 'if then else assign new case of esac') - gt, lt , ge, le, eq, not_, implies, isvoid = G.Terminals('> < >= <= == ! => isvoid') + gt, lt, ge, le, eq, not_, implies, isvoid = G.Terminals( + '> < >= <= == ! => isvoid') - while_, do, inherits, arroba, fi, pool, loop = G.Terminals('while do inherits @ fi pool loop') + while_, do, inherits, arroba, fi, pool, loop = G.Terminals( + 'while do inherits @ fi pool loop') # Definir un programa como un conjunto de clases. program %= class_list, lambda s: ProgramNode(s[1]) @@ -52,11 +63,11 @@ def build_cool_grammar(): # Definir la estructura de la declaracion de una clase. # Una clase no es mas que un conjunto de features. class_def %= class_keyword + idx + obrack + feature_list + cbrack + dot_comma, \ - lambda s: ClassDef(s[2], s[4]) + lambda s: ClassDef(s[2], s[4]) # Definir la estructura de la declaracion de una clase con herencia. class_def %= class_keyword + idx + inherits + typex + obrack + feature_list + \ - cbrack + dot_comma, lambda s: ClassDef(s[2], s[6], s[4]) + cbrack + dot_comma, lambda s: ClassDef(s[2], s[6], s[4]) # Definir un conjunto de features como un metodo unico. feature_list %= meod_def + dot_comma, lambda s: [s[1]] @@ -66,21 +77,24 @@ def build_cool_grammar(): # Definir una lista de features como la declaracion de un metodo # mas una lista de features. - feature_list %= meod_def + dot_comma + feature_list, lambda s: [s[1]] + s[3] + feature_list %= meod_def + dot_comma + \ + feature_list, lambda s: [s[1]] + s[3] # Definir una lista de features como la declaracion de un atributo # mas una lista de features. - feature_list %= attr_def + dot_comma +feature_list, lambda s: [s[1]] + s[3] + feature_list %= attr_def + dot_comma + \ + feature_list, lambda s: [s[1]] + s[3] # Definir la estructura de la declaracion de un metodo. meod_def %= idx + opar + param_list_empty + cpar + dd + typex + obrack +\ - statement_list + cbrack, lambda s: MethodDef(s[1], s[3], s[6], s[8]) + statement_list + cbrack, lambda s: MethodDef(s[1], s[3], s[6], s[8]) # Definir la estructura de la declaracion de un atributo. - attr_def %= idx + dd + typex, lambda s: AttributeDef(s[1],s[3]) + attr_def %= idx + dd + typex, lambda s: AttributeDef(s[1], s[3]) # Definir la estructura de la declaracion de un atributo con valor por defecto. - attr_def %= idx + dd + typex + assign + exp, lambda s: AttributeDef(s[1], s[3], s[5]) + attr_def %= idx + dd + typex + assign + \ + exp, lambda s: AttributeDef(s[1], s[3], s[5]) # Definir la lista de parametros como una lista de parametros o una lista vacia param_list_empty %= param_list, lambda s: s[1] @@ -100,16 +114,19 @@ def build_cool_grammar(): statement_list %= exp + dot_comma + statement_list, lambda s: [s[1]] + s[3] - var_dec %= let + nested_lets + in_keyword + exp, lambda s: VariableDeclaration(s[2], s[4]) + var_dec %= let + nested_lets + in_keyword + \ + exp, lambda s: VariableDeclaration(s[2], s[4]) nested_lets %= idx + dd + typex, lambda s: [(s[1], s[3], None)] - nested_lets %= idx + dd + typex + coma + nested_lets, lambda s: [(s[1], s[3], None)] + s[5] + nested_lets %= idx + dd + typex + coma + \ + nested_lets, lambda s: [(s[1], s[3], None)] + s[5] - nested_lets %= idx + dd + typex + assign + exp, lambda s: [(s[1], s[3], s[5])] + nested_lets %= idx + dd + typex + assign + \ + exp, lambda s: [(s[1], s[3], s[5])] nested_lets %= idx + dd + typex + assign + exp + coma + \ - nested_lets, lambda s: [(s[1], s[3], s[5])] + s[7] + nested_lets, lambda s: [(s[1], s[3], s[5])] + s[7] # Una expresion puede ser una declaracion de una variable exp %= var_dec, lambda s: s[1] @@ -125,7 +142,8 @@ def build_cool_grammar(): exp %= atom, lambda s: s[1] # Una expresion puede ser un bloque IfThenElse - exp %= if_ + exp + then + exp + else_ + exp + fi, lambda s: IfThenElseNode(s[2], s[4], s[6]) + exp %= if_ + exp + then + exp + else_ + exp + \ + fi, lambda s: IfThenElseNode(s[2], s[4], s[6]) # Una expresion puede ser una asignacion exp %= idx + assign + exp, lambda s: AssignNode(s[1], s[3]) @@ -133,10 +151,12 @@ def build_cool_grammar(): # Una expresion puede ser una instanciacion de una clase exp %= instantiation, lambda s: s[1] - instantiation %= new + idx + opar + args_list_empty + cpar, lambda s: InstantiateClassNode(s[2], s[4]) + instantiation %= new + idx + opar + args_list_empty + \ + cpar, lambda s: InstantiateClassNode(s[2], s[4]) # Una expresion puede ser un bloque while - exp %= while_ + exp + loop + statement_list + pool, lambda s: WhileBlockNode(s[3], s[7]) + exp %= while_ + exp + loop + statement_list + \ + pool, lambda s: WhileBlockNode(s[3], s[7]) exp %= arith, lambda s: s[1] @@ -170,10 +190,11 @@ def build_cool_grammar(): s[3], s[5]) - factor %= idx + opar + args_list_empty + cpar, lambda s: FunCall('self', s[1], s[3]) + factor %= idx + opar + args_list_empty + \ + cpar, lambda s: FunCall('self', s[1], s[3]) factor %= factor + arroba + typex + period + idx + opar + args_list_empty + cpar, lambda s: \ - ParentFuncCall(s[1], s[3], s[5], s[7]) + ParentFuncCall(s[1], s[3], s[5], s[7]) atom %= factor + gt + factor, lambda s: GreaterThanNode(s[1], s[3]) @@ -187,7 +208,6 @@ def build_cool_grammar(): atom %= not_ + factor, lambda s: NotNode(s[2]) - typex %= intx, lambda s: 'int' typex %= boolean, lambda s: 'bool' @@ -214,9 +234,11 @@ def build_cool_grammar(): actions %= action + actions, lambda s: [s[1]] + s[2] - action %= idx + dd + typex + implies + exp + dot_comma, lambda s: ActionNode(s[1], s[3], s[5]) + action %= idx + dd + typex + implies + exp + \ + dot_comma, lambda s: ActionNode(s[1], s[3], s[5]) - case_statement %= case + exp + of + actions + esac, lambda s: CaseNode(s[2], s[4]) + case_statement %= case + exp + of + actions + \ + esac, lambda s: CaseNode(s[2], s[4]) table = [(class_keyword, 'class'), (def_keyword, 'def'), @@ -245,7 +267,7 @@ def build_cool_grammar(): (arroba, '@'), (assign, r'<\-'), (lt, r'\<'), - (gt, r'\>'), + (gt, r'\>'), (ge, '>='), (le, '<='), (eq, '=='), @@ -265,10 +287,10 @@ def build_cool_grammar(): (pool, 'pool'), (loop, 'loop'), (isvoid, 'isvoid'), - (idx, '(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N|n|O|o|P|p|'+ + (idx, '(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N|n|O|o|P|p|' + 'Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|_)+'), (num, '0|(1|2|3|4|5|6|7|8|9)(1|2|3|4|5|6|7|8|9|0)*'), - (string_const, r"\"(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N"+ + (string_const, r"\"(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N" + r"|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|\ )+\"")] lexer = Lexer(table, G.EOF, ignore_white_space=False) diff --git a/src/grammar/grammar.py b/src/grammar/grammar.py index b31c0b80..119c2140 100755 --- a/src/grammar/grammar.py +++ b/src/grammar/grammar.py @@ -1,5 +1,5 @@ from grammar.symbols import (NonTerminal, Terminal, Sentence, - Epsilon, EOF, AttributeProduction) + Epsilon, EOF, AttributeProduction) import json @@ -109,7 +109,7 @@ def to_json(self): productions.append({'Head': head, 'Body': body}) d = {'NonTerminals': [symb.Name for symb in self.nonTerminals if symb != self.startSymbol], 'Terminals': - [symb.Name for symb in self.terminals], + [symb.Name for symb in self.terminals], 'Productions': productions} d['StartSymbol'] = self.startSymbol.Name @@ -121,7 +121,7 @@ def from_json(data): G = Grammar() dic = {'epsilon': G.Epsilon} - dic[data['StartSymbol']] = G.NonTerminal(data['StartSymbol'],True) + dic[data['StartSymbol']] = G.NonTerminal(data['StartSymbol'], True) for term in data['Terminals']: dic[term] = G.Terminal(term) diff --git a/src/grammar/remrecursion.py b/src/grammar/remrecursion.py deleted file mode 100755 index 00d9bc90..00000000 --- a/src/grammar/remrecursion.py +++ /dev/null @@ -1,74 +0,0 @@ -#%% -from grammar.grammar import Grammar -from grammar.symbols import NonTerminal -from grammar.symbols import Sentence -from trie.tree import Trie -#%% -def remove_left_recursion(G:Grammar): - - def find_recursive_production(t:NonTerminal): - recursives, non_recursives = list(), list() - for production in t.productions: - head, body = production - if len(body) > 1 and head == body[0]: - recursives.append(production) - else: - non_recursives.append(production) - return recursives, non_recursives - - def remove_redundant_productions(G:Grammar): - for production in G.Productions: - while G.Productions.count(production) > 1: - G.Productions.remove(production) - - - for nt in G.nonTerminals: - recursives, non_recursives = find_recursive_production(nt) - if recursives: - new_symbol = G.NonTerminal(f'{nt}^') - for production in non_recursives: - G.Productions.remove(production) - body = production.Right - nt %= body + new_symbol - for production in recursives: - alpha = Sentence(*production.Right[1::]) - G.Productions.remove(production) - new_symbol %= alpha + new_symbol | G.Epsilon - - remove_redundant_productions(G) - -def factorize(G:Grammar): - - def lcp(sym): - prefix_len, prefix = 0, None - d = set() - t = Trie([x for x in (G.terminals + G.nonTerminals)]) - for production in sym.productions: - _, body = production - p = t.prefix_query(body) - if p: - if len(p) > prefix_len: - prefix = p - prefix_len = len(p) - t.insert(body) - if prefix: - for production in sym.productions: - if all(prefix[i] == production.Right[i] for i in range(prefix_len)): - d.add(production) - print(d) - return prefix, d - - stack = [x for x in G.nonTerminals] - while stack: - sym = stack.pop() - prefix, productions = lcp(sym) - change = not prefix is None - if change: - new_t = G.NonTerminal(f'{sym.Name}^') - sym %= prefix + new_t - for p in productions: - remainder = p.Right[len(prefix)::] - remainder = Sentence(*remainder) if remainder else G.Epsilon - new_t %= remainder - G.Productions.remove(p) - diff --git a/src/grammar/symbols.py b/src/grammar/symbols.py index f8d56897..d08e7f9e 100755 --- a/src/grammar/symbols.py +++ b/src/grammar/symbols.py @@ -15,9 +15,9 @@ class Symbol(object): de su constructor. """ - def __init__(self,name,grammar): - self.Name=name - self.Grammar=grammar + def __init__(self, name, grammar): + self.Name = name + self.Grammar = grammar def __str__(self): return self.Name @@ -25,16 +25,16 @@ def __str__(self): def __repr__(self): return repr(self.Name) - def __add__(self,other): - if isinstance(other,Symbol): - return Sentence(self,other) + def __add__(self, other): + if isinstance(other, Symbol): + return Sentence(self, other) raise TypeError(other) - def __or__(self,other): + def __or__(self, other): - if isinstance(other,(Sentence)): - return SentenceList(Sentence(self),other) + if isinstance(other, (Sentence)): + return SentenceList(Sentence(self), other) raise TypeError(other) @@ -46,7 +46,7 @@ def __len__(self): return 1 def __gt__(self, other): - assert isinstance(other,Symbol) + assert isinstance(other, Symbol) return self.Name > other.Name @@ -60,7 +60,7 @@ class Terminal(Symbol): Los terminales no deben ser instanciados directamente con la aplicación de su constructor. """ - def __init__(self,name, grammar): + def __init__(self, name, grammar): super().__init__(name, grammar) @property @@ -95,14 +95,14 @@ class NonTerminal(Symbol): Los no terminales no deben ser instanciados directamente con la aplicación de su constructor. """ - def __init__(self,name,grammar): - super().__init__(name,grammar) - self.productions=[] + def __init__(self, name, grammar): + super().__init__(name, grammar) + self.productions = [] - def __imod__(self,other): + def __imod__(self, other): if isinstance(other, Sentence): - p=Production(self,other) + p = Production(self, other) self.Grammar.Add_Production(p) return self @@ -114,30 +114,30 @@ def __imod__(self,other): return self - if isinstance(other,tuple): - assert len(other)>1 + if isinstance(other, tuple): + assert len(other) > 1 - if len(other)==2: - other+=(None,)*len(other[0]) - assert len(other)==len(other[0])+2,"Reglas malformadas" + if len(other) == 2: + other += (None,) * len(other[0]) + assert len(other) == len(other[0]) + 2, "Reglas malformadas" - if isinstance(other[0],Symbol) or isinstance(other[0],Sentence): - p=AttributeProduction(self,other[0],other[1:]) + if isinstance(other[0], Symbol) or isinstance(other[0], Sentence): + p = AttributeProduction(self, other[0], other[1:]) else: raise Exception("") self.Grammar.Add_Production(p) return self - if isinstance(other,Symbol): - p=Production(self,Sentence(other)) + if isinstance(other, Symbol): + p = Production(self, Sentence(other)) self.Grammar.Add_Production(p) return self - if isinstance(other,SentenceList): + if isinstance(other, SentenceList): for s in other: - p=Production(self,s) + p = Production(self, s) self.Grammar.Add_Production(p) return self @@ -148,12 +148,10 @@ def __imod__(self,other): def IsTerminal(self): return False - @property def IsNonTerminal(self): return True - @property def IsEpsilon(self): return False @@ -169,8 +167,8 @@ class EOF(Terminal): automáticamente y será accesible a través de G.EOF. """ - def __init__(self,Grammar): - super().__init__('$',Grammar) + def __init__(self, Grammar): + super().__init__('$', Grammar) class Sentence(object): @@ -197,28 +195,28 @@ class Sentence(object): y el operador | entre oraciones para agruparlas. """ - def __init__(self,*args): - self._symbols=tuple(x for x in args if not x.IsEpsilon) - self.hash=hash(self._symbols) + def __init__(self, *args): + self._symbols = tuple(x for x in args if not x.IsEpsilon) + self.hash = hash(self._symbols) def __len__(self): return len(self._symbols) - def __add__(self,other): - if isinstance(other,Symbol): - return Sentence(*(self._symbols+(other,))) + def __add__(self, other): + if isinstance(other, Symbol): + return Sentence(*(self._symbols + (other,))) - if isinstance(other,Sentence): - return Sentence(*(self._symbols+other._symbols)) + if isinstance(other, Sentence): + return Sentence(*(self._symbols + other._symbols)) raise TypeError(other) - def __or__(self,other): - if isinstance(other,Sentence): - return SentenceList(self,other) + def __or__(self, other): + if isinstance(other, Sentence): + return SentenceList(self, other) - if isinstance(other,Symbol): - return SentenceList(self,Sentence(other)) + if isinstance(other, Symbol): + return SentenceList(self, Sentence(other)) raise TypeError(other) @@ -226,16 +224,16 @@ def __repr__(self): return str(self) def __str__(self): - return ("%s "*len(self._symbols)%tuple(self._symbols)).strip() + return ("%s " * len(self._symbols) % tuple(self._symbols)).strip() def __iter__(self): return iter(self._symbols) - def __getitem__(self,index): + def __getitem__(self, index): return self._symbols[index] - def __eq__(self,other): - return self._symbols==other._symbols + def __eq__(self, other): + return self._symbols == other._symbols def __hash__(self): return self.hash @@ -247,10 +245,10 @@ def IsEpsilon(self): class SentenceList(object): - def __init__(self,*args): - self._sentences=list(args) + def __init__(self, *args): + self._sentences = list(args) - def Add(self,symbol): + def Add(self, symbol): if not symbol and (symbol is None or not symbol.IsEpsilon): raise ValueError(symbol) @@ -265,7 +263,7 @@ def __or__(self, other): return self if isinstance(other, Symbol): - return self|Sentence(other) + return self | Sentence(other) class Epsilon(Terminal, Sentence): @@ -281,8 +279,8 @@ class Epsilon(Terminal, Sentence): automáticamente y será accesible a través de G.Epsilon. """ - def __init__(self,grammar): - super().__init__('epsilon',grammar) + def __init__(self, grammar): + super().__init__('epsilon', grammar) def __str__(self): return "ϵ" @@ -296,11 +294,11 @@ def __iter__(self): def __len__(self): return 0 - def __add__(self,other): + def __add__(self, other): return other - def __eq__(self,other): - return isinstance(other,(Epsilon,)) + def __eq__(self, other): + return isinstance(other, (Epsilon,)) def __hash__(self): return hash("") @@ -338,24 +336,24 @@ class Production(object): """ def __init__(self, nonTerminal, sentence): - self.Left=nonTerminal - self.Right=sentence + self.Left = nonTerminal + self.Right = sentence def __str__(self): - return '%s -> %s'%(self.Left,self.Right) + return '%s -> %s' % (self.Left, self.Right) def __repr__(self): - return '%s -> %s'%(self.Left,self.Right) + return '%s -> %s' % (self.Left, self.Right) def __iter__(self): yield self.Left yield self.Right - def __eq__(self,other): - return isinstance(other,Production) and self.Left==other.Left and self.Right==other.Right + def __eq__(self, other): + return isinstance(other, Production) and self.Left == other.Left and self.Right == other.Right def __hash__(self): - return hash((self.Left,self.Right)) + return hash((self.Left, self.Right)) @property def IsEpsilon(self): @@ -421,7 +419,7 @@ class AttributeProduction(Production): """ - def __init__(self,nonTerminal, sentence, attributes): + def __init__(self, nonTerminal, sentence, attributes): if not isinstance(sentence, Sentence) and isinstance(sentence, Symbol): sentence = Sentence(sentence) super(AttributeProduction, self).__init__(nonTerminal, sentence) @@ -429,10 +427,10 @@ def __init__(self,nonTerminal, sentence, attributes): self.attributes = attributes def __str__(self): - return '%s := %s'%(self.Left, self.Right) + return '%s := %s' % (self.Left, self.Right) def __repr__(self): - return '%s -> %s'%(self.Left, self.Right) + return '%s -> %s' % (self.Left, self.Right) def __iter__(self): yield self.Left diff --git a/src/lexer/regexgenerator.py b/src/lexer/regexgenerator.py index c6326d64..16fee798 100755 --- a/src/lexer/regexgenerator.py +++ b/src/lexer/regexgenerator.py @@ -1,29 +1,33 @@ #%% from baseNodeTree.base import Node, AtomicNode, UnaryNode, BinaryNode from automatons.nondeterministic import NFA -from automatons.operations import automata_union, automata_concatenation, automata_closure +from automatons.operations import ( + automata_union, + automata_concatenation, + automata_closure +) from automatons.transformation import nfa_to_deterministic from grammar.grammar import Grammar from lexer.tokens import Token from parserr.ll1 import build_ll1_parser from tools.evaluate import evaluate_parse -from baseNodeTree.astprinter import get_printer -from tools.dtbuilder import build_derivation_tree -from automatons.state import State #%% + class EpsilonNode(AtomicNode): def evaluate(self): - automaton = NFA(states = 1, finals = [0],transitions = {} ) + automaton = NFA(states=1, finals=[0], transitions={}) return automaton + class SymbolNode(AtomicNode): def evaluate(self): s = self.lex - automaton = NFA(states= 2, finals= [1], transitions={(0,s):[1]}) + automaton = NFA(states=2, finals=[1], transitions={(0, s): [1]}) return automaton + class ClosureNode(UnaryNode): @staticmethod def operate(value): @@ -40,20 +44,23 @@ def operate(value): return automaton + class UnionNode(BinaryNode): @staticmethod def operate(lvalue, rvalue): automata = automata_union(lvalue, rvalue) return automata + class ConcatNode(BinaryNode): @staticmethod def operate(lvalue, rvalue): automata = automata_concatenation(lvalue, rvalue) return automata + class RangeNode(Node): - def __init__(self,iterable): + def __init__(self, iterable): self.rang = iterable def evaluate(self): @@ -61,21 +68,25 @@ def evaluate(self): node = SymbolNode(next(it)) while 1: try: - node = UnionNode(node,SymbolNode(next(it))) + node = UnionNode(node, SymbolNode(next(it))) except StopIteration: automata = node.evaluate() return automata + class PositiveClosureNode(UnaryNode): @staticmethod def operate(value): - return automata_concatenation(value,automata_closure(value)) + return automata_concatenation(value, automata_closure(value)) + class QuestionNode(UnaryNode): @staticmethod def operate(value): return automata_union(value, EpsilonNode('').evaluate()) #%% + + class Regex(object): def __init__(self, regex, ignore_white_space=True): @@ -83,14 +94,15 @@ def __init__(self, regex, ignore_white_space=True): self.G = Grammar() E = self.G.NonTerminal('E', True) T, F, A, X, Y, Z = self.G.NonTerminals('T F A X Y Z') - pipe, star, opar, cpar, symbol, epsilon, plus, minus, obrack, cbrack, question = self.G.Terminals('| * ( ) symbol ε + - [ ] ?') + pipe, star, opar, cpar, symbol, epsilon, plus, minus, obrack, cbrack, question = self.G.Terminals( + '| * ( ) symbol ε + - [ ] ?') E %= T + X, lambda h, s: s[2], None, lambda h, s: s[1] X %= pipe + E, lambda h, s: UnionNode(h[0], s[2]) - X %= self.G.Epsilon, lambda h, s:h[0] + X %= self.G.Epsilon, lambda h, s: h[0] T %= F + Y, lambda h, s: s[2], None, lambda h, s: s[1] Y %= T, lambda h, s: ConcatNode(h[0], s[1]) - Y %= self.G.Epsilon, lambda h, s:h[0] + Y %= self.G.Epsilon, lambda h, s: h[0] F %= A + Z, lambda h, s: s[2], None, lambda h, s: s[1] Z %= star, lambda h, s: ClosureNode(h[0]) Z %= plus, lambda h, s: PositiveClosureNode(h[0]) @@ -107,20 +119,22 @@ def _build_automaton(self, regex, ignore_white_space): def regex_tokenizer(regex, ignore_white_space): d = {term.Name: term for term in self.G.terminals} tokens = [] - symbol_term = [term for term in self.G.terminals if term.Name == 'symbol'][0] - fixed_tokens = {tok.Name:Token(tok.Name, tok) for tok in [d['|'], d['*'], - d['+'], d['?'], - d['('], d[')'], - d['['], d[']'], - d['-'], d['ε']]} + symbol_term = [ + term for term in self.G.terminals if term.Name == 'symbol'][0] + fixed_tokens = {tok.Name: Token(tok.Name, tok) + for tok in [d['|'], d['*'], + d['+'], d['?'], + d['('], d[')'], + d['['], d[']'], + d['-'], d['ε']]} for i, c in enumerate(regex): - if c == "\\" or \ + if c == "\\" or \ (ignore_white_space and c.isspace()): continue try: token = fixed_tokens[c] - if regex[i-1] == '\\': + if regex[i - 1] == '\\': raise KeyError except KeyError: token = Token(c, symbol_term) diff --git a/src/parserr/.#shiftreduce.py b/src/parserr/.#shiftreduce.py deleted file mode 120000 index eb05616f..00000000 --- a/src/parserr/.#shiftreduce.py +++ /dev/null @@ -1 +0,0 @@ -adrian@adrian-pc.2383:1571553273 \ No newline at end of file diff --git a/src/parserr/shiftreduce.py b/src/parserr/shiftreduce.py index 413d6779..7ccf8b65 100755 --- a/src/parserr/shiftreduce.py +++ b/src/parserr/shiftreduce.py @@ -2,7 +2,7 @@ Este modulo contiene la declaracion de la clase ShiftReduceParser, la cual sirve de base para los parsers SLR, LALR y LR ''' -from grammar.grammar import AttributeProduction + class ShiftReduceParser: """ @@ -37,10 +37,10 @@ def __call__(self, tokens): action, tag = self.action[state, lookahead] except KeyError: print(lookahead.__class__) - raise SyntaxError(f'Bad {tokens[cursor]} in line {tokens[cursor].token_line}'+ - f' column {tokens[cursor].token_column}.\n'+ + raise SyntaxError(f'Bad {tokens[cursor]} in line {tokens[cursor].token_line}' + + f' column {tokens[cursor].token_column}.\n' + f'Expected: ' + - ' or '.join([str(y) for x,y in self.action if x == state])) + ' or '.join([str(y) for x, y in self.action if x == state])) if action == self.SHIFT: cursor += 1 diff --git a/src/testing.py b/src/testing.py index 96ab1777..42dcc507 100755 --- a/src/testing.py +++ b/src/testing.py @@ -2,6 +2,7 @@ from lexer import tokenizer from parserr.lr import LALRParser from parserr.shiftreduce import ShiftReduceParser +import cloudpickle GRAMMAR, LEXER = grammar.build_cool_grammar() PARSER = LALRParser(GRAMMAR, verbose=True) @@ -51,17 +52,16 @@ class A inherits IO }; """ # First Round of tests -import cloudpickle TOKS = None try: - TOKS = LEXER(SIMPLE_PROGRAM) - parse = PARSER(TOKS) - # Try to save the parser and then reuse it - #with open('.parser.dmp','wb') as file: - # cloudpickle.dump(PARSER, file) + TOKS = LEXER(SIMPLE_PROGRAM) + parse = PARSER(TOKS) + # Try to save the parser and then reuse it + # with open('.parser.dmp','wb') as file: + # cloudpickle.dump(PARSER, file) - with open('.parser.dmp','rb') as file: - parser = cloudpickle.load(file) - print(parser(TOKS)) + with open('.parser.dmp', 'rb') as file: + parser = cloudpickle.load(file) + print(parser(TOKS)) except Exception as e: - print(e) + print(e) diff --git a/src/tools/dtbuilder.py b/src/tools/dtbuilder.py index e619290b..f97e2d0f 100755 --- a/src/tools/dtbuilder.py +++ b/src/tools/dtbuilder.py @@ -1,14 +1,14 @@ -from queue import LifoQueue + class DerivationTreeNode(object): - def __init__(self, value, parent= None, h = 0): + def __init__(self, value, parent=None, h=0): self.value = value self.children = [] self.parent = parent self._h = h - #required property to do a pprint of the tree + # required property to do a pprint of the tree @property def Deep(self): """ @@ -17,13 +17,13 @@ def Deep(self): """ return self._h - def add_node(self,body, count): + def add_node(self, body, count): """ Agrega el cuerpo de una producion a los hijos del nodo cabecera. """ for x in body: - count+= 1 - self.children.append(DerivationTreeNode(x,parent=self, h = count)) + count += 1 + self.children.append(DerivationTreeNode(x, parent=self, h=count)) return count def graph(self): @@ -35,12 +35,12 @@ def graph(self): q.put(self) while not q.empty(): node = q.get() - pydotNode = pydot.Node(id(node),label=str(node.value), shape='circle', style='bold') + pydotNode = pydot.Node(id(node), label=str(node.value), shape='circle', style='bold') G.add_node(pydotNode) for child in node.children: - child_node = pydot.Node(id(child),label=str(child.value),shape='circle', style='bold') + child_node = pydot.Node(id(child), label=str(child.value), shape='circle', style='bold') G.add_node(child_node) - G.add_edge(pydot.Edge(pydotNode,child_node)) + G.add_edge(pydot.Edge(pydotNode, child_node)) q.put(child) return G @@ -50,6 +50,7 @@ def _repr_svg_(self): except: pass + def build_derivation_tree(parse: list): """ Dado un conjunto de producciones que generan una cadena, @@ -67,13 +68,14 @@ def build_derivation_tree(parse: list): while q: node: DerivationTreeNode = q.pop() if node.value.IsNonTerminal: - _,body = parse[i] - i+=1 - count = node.add_node(body,count) + _, body = parse[i] + i += 1 + count = node.add_node(body, count) for child in node.children[::-1]: q.append(child) return root + def build_right_derivation_tree(parse: list): """ Dado un conjunto de producciones que generan una cadena, @@ -91,9 +93,9 @@ def build_right_derivation_tree(parse: list): while q: node: DerivationTreeNode = q.pop() if node.value.IsNonTerminal: - _,body = parse[i] - i+=1 - count = node.add_node(body,count) + _, body = parse[i] + i += 1 + count = node.add_node(body, count) for child in node.children: q.append(child) return root diff --git a/src/tools/evaluate.py b/src/tools/evaluate.py index ed4ab996..622372bb 100755 --- a/src/tools/evaluate.py +++ b/src/tools/evaluate.py @@ -1,5 +1,5 @@ def evaluate_parse(productions, tokens): - def evaluate_production(production,left_parse,tokens, inherited_value = None): + def evaluate_production(production, left_parse, tokens, inherited_value=None): body = production.Right attributes = production.attributes @@ -7,7 +7,7 @@ def evaluate_production(production,left_parse,tokens, inherited_value = None): inherited = [None] * (len(body) + 1) inherited[0] = inherited_value - for i,symbol in enumerate(body, 1): + for i, symbol in enumerate(body, 1): if symbol.IsTerminal and not symbol.IsEpsilon: assert not inherited[i] synteticed[i] = next(tokens).lex @@ -16,20 +16,21 @@ def evaluate_production(production,left_parse,tokens, inherited_value = None): rule = attributes[i] if rule: inherited[i] = rule(inherited, synteticed) - synteticed[i] = evaluate_production(next_production, left_parse, tokens,inherited[i]) - + synteticed[i] = evaluate_production( + next_production, left_parse, tokens, inherited[i]) rule = attributes[0] return rule(inherited, synteticed) if rule else None - + tok = iter(tokens) prod = iter(productions) root = evaluate_production(next(prod), prod, tok) return root - + + def evaluate_right_parse(productions, tokens): - def evaluate_production(production, right_parse,tokens): + def evaluate_production(production, right_parse, tokens): body = production.Right size = len(body) + 1 attributes = production.attributes @@ -40,13 +41,14 @@ def evaluate_production(production, right_parse,tokens): synteticed[size - i] = next(tokens).lex elif symbol.IsNonTerminal: next_production = next(right_parse) - synteticed[size-i] = evaluate_production(next_production, right_parse, tokens) + synteticed[size - i] = evaluate_production( + next_production, right_parse, tokens) rule = attributes[0] - return rule([],synteticed) if rule else None - #Pasar los tokens en orden inverso y quitar el caracter de final de cadena de la lista de tokens + return rule([], synteticed) if rule else None + # Pasar los tokens en orden inverso y quitar el caracter de final de cadena de la lista de tokens tok = iter(tokens[::-1][1::]) prod = iter(productions) - root = evaluate_production(next(prod),prod, tok) + root = evaluate_production(next(prod), prod, tok) return root diff --git a/src/tools/gramtoregex.py b/src/tools/gramtoregex.py deleted file mode 100755 index 60036d64..00000000 --- a/src/tools/gramtoregex.py +++ /dev/null @@ -1,206 +0,0 @@ -#%% -from grammar.grammar import Grammar -from automatons.nondeterministic import NFA -from automatons.transformation import nfa_to_deterministic -from lexer.regexgenerator import Regex -from automatons.deterministic import DFA - -class AlgebraicRegex: - - def __init__(self, string): - self.string = string - - @property - def is_void(self): - return self.string == '' - - @property - def empt(self): - return self.string == 'ε' - - def __str__(self): - return self.string - - def __repr__(self): - return str(self) - - def __or__(self, other): - assert isinstance(other, AlgebraicRegex) - if self.is_void and other.is_void: - return self - elif self.is_void: return other - elif other.is_void: return self - if self.empt and other.empt: return self - - return AlgebraicRegex(f'(({self.string}|{other.string}))') - - def __gt__(self, other): - assert isinstance(other, AlgebraicRegex) - if self.is_void and other.is_void: return self - elif self.is_void or other.is_void: return other - - if self.empt: return other - if other.empt: return self - - return AlgebraicRegex(f'(({self.string})({other.string}))') - - def star(self): - if self.empt or self.is_void: return self - if len(self.string) == 1: return AlgebraicRegex(f'({self.string})*') - - return AlgebraicRegex(f'({self.string})*') - - -def assert_regular(G: Grammar): - for production in G.Productions: - if len(production.Right) > 2: - return False - if len(production.Right) == 2 and (production.Right[0].IsNonTerminal or production.Right[1].IsTerminal): - return False - return True - -def grammar_to_automaton(G:Grammar): - d = {sym.Name: i for i,sym in enumerate(G.nonTerminals)} - s = {i:sym for i,sym in enumerate(G.nonTerminals)} - if assert_regular(G): - states = len(G.nonTerminals) - transitions = {} - finals = [] - for i in range(states): - sym = s[i] - for production in sym.productions: - if len(production.Right) == 1: - next_sym = production.Right[0] - if next_sym.IsTerminal: - try: - transitions[(i,next_sym.Name)].append(i) - except: - transitions[(i,next_sym.Name)] = [i] - finals.append(i) - else: - try: - transitions[(i,'')].append(d[next_sym.Name]) - except: - transitions[(i,'')] = [d[next_sym.Name]] - if len(production.Right) == 2: - next_sym = production.Right[0] - next_state = d[production.Right[1].Name] - try: - transitions[(i,next_sym.Name)].append(next_state) - except: - transitions[(i,next_sym.Name)] = [next_state] - if len(production.Right) == 0: - finals.append(i) - start = d[G.startSymbol.Name] - return nfa_to_deterministic(NFA(states,finals, transitions, start=start)) - else: - print('La Gramatica no es regular') - -def regex_to_grammar(regex:Regex): - automaton = regex.automaton - G = Grammar() - start = G.NonTerminal(f'A{automaton.start}',True) - n = {} - n[automaton.start] = start - for i in range(automaton.states): - if i != automaton.start: - n[i] = G.NonTerminal(f'A{i}') - t = {} - for sym in automaton.vocabulary: - t[sym] = G.Terminal(sym) - - for src, d in automaton.transitions.items(): - for sym, dest in d.items(): - nt = n[src] - nt1 = n[dest[0]] - s = t[sym] - nt %= s + nt1 if nt1 != nt else s - for f in automaton.finals: - nt = n[f] - nt %= G.Epsilon - return G - -def grammar_to_regex(G:Grammar,aut = None): - if assert_regular(G): - automaton = grammar_to_automaton(G) if not aut else aut - n = automaton.states - - # Crear la tabla para la dinamica: tener en cuenta que el caracter $ indica - # la cadena vacia, que luego habra que simplificar de acuerdo a las reglas - # algebraicas de las expresiones regulares - dp = {(i,j,k): AlgebraicRegex('') for i in range(1,n+1) for j in range(1,n+1) for k in range(n+1)} - - # Construir el caso BASE de la dinamica dp[i,j,0] - for i, dest in automaton.transitions.items(): - i = i + 1 - for sym,l in dest.items(): - j = l[0] + 1 - if i != j: - dp[i,j,0] = AlgebraicRegex(sym) - else: - dp[i,j,0] = AlgebraicRegex(sym)|AlgebraicRegex('ε') - - - # aplicar el paso inductivo de la dinamica: - # dp[i,j,k] = dp[i,j,k-1]|dp[i,k-1,k-1]dp[k,k,k-1]*dp[k,j,k-1] para todo k >= 1 - - for k in range(1,n+1): - for i in range(1,n+1): - for j in range(1,n+1): - right = dp[i,k,k-1]>dp[k,k,k-1].star() - right = right >dp[k,j,k-1] - dp[i,j,k] = dp[i,j,k-1]|right - - - # La expresion regular del automata es el resultado de concatenar todos los pares dp[i,j,n] tales que j - # sea un estado final - finals = [dp[automaton.start+1,j+1,n] for j in automaton.finals] - - result = finals[0] - for s in finals[1::]: - result = result | s - return result - - else: - print('La gramatica no es regular') - - -# #%% -# G = Grammar() -# A = G.NonTerminal('A',True) -# B, C, D = G.NonTerminals('B C D') -# a,b = G.Terminals('a b') - -# A %= a + A | b + A | a + B -# B %= b + C -# C %= b + D -# D %= G.Epsilon - -# aut = DFA(2,[0],{(0,'a'):0,(0,'b'):1,(1,'a'):1,(1,'b'):0}) -# display(aut) -# print(grammar_to_regex(G,aut=aut)) -# display(Regex(grammar_to_regex(G,aut=aut).string).automaton) - -# #%% - -# print(grammar_to_regex(G)) -# regex = Regex(grammar_to_regex(G).string) -# a = grammar_to_automaton(G) -# display(a) -# display(regex.automaton) -# print(a.recognize('abababaaaaabb')) -# print(regex('abababaaaaabb')) - -# #%% -# print(G) -# print(assert_regular(G)) - -# #%% -# a = grammar_to_automaton(G) -# display(a) - -# #%% -# r = Regex('(a|b)+') -# g = regex_to_grammar(r) -# print(g) -# display(grammar_to_automaton(g)) \ No newline at end of file From 3ef77a63d746b46a315855af66c725f51a8af803 Mon Sep 17 00:00:00 2001 From: Adrian Date: Thu, 13 Feb 2020 18:01:56 -0500 Subject: [PATCH 003/162] "added some project management and building files. Done some tunnigs to makefile" --- .gitignore | 2 + src/.builds | 4 + src/coolc.sh | 9 +- src/install.py | 28 ++++++ src/lexer/tokenizer.py | 12 +-- src/makefile | 28 +++++- src/parserr/lr.py | 194 ++++++++++++++--------------------------- 7 files changed, 138 insertions(+), 139 deletions(-) create mode 100644 src/.builds create mode 100644 src/install.py diff --git a/.gitignore b/.gitignore index 4acafde1..3567f524 100644 --- a/.gitignore +++ b/.gitignore @@ -408,3 +408,5 @@ dmypy.json # Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option) +### Sublime Text Projects ### +*.sublime-project \ No newline at end of file diff --git a/src/.builds b/src/.builds new file mode 100644 index 00000000..98fb6a68 --- /dev/null +++ b/src/.builds @@ -0,0 +1,4 @@ +1 +1 +1 +1 diff --git a/src/coolc.sh b/src/coolc.sh index 3088de4f..cd6002f7 100755 --- a/src/coolc.sh +++ b/src/coolc.sh @@ -2,10 +2,13 @@ INPUT_FILE=$1 OUTPUT_FILE=${INPUT_FILE:0: -2}mips +VERSION=0.2 # Release, branch +BUILD=$(wc -l .builds | awk '{ print $1 }') # Si su compilador no lo hace ya, aquí puede imprimir la información de contacto -echo "LINEA_CON_NOMBRE_Y_VERSION_DEL_COMPILADOR" # TODO: Recuerde cambiar estas -echo "Copyright (c) 2019: Nombre1, Nombre2, Nombre3" # TODO: líneas a los valores correctos - +echo "pycoolc: version $VERSION" # TODO: Recuerde cambiar estas +echo "Build: $BUILD" +echo "Copyright (c) 2020 School of Math and Computer Science, University of Havana" # TODO: líneas a los valores correctos +echo "Authors: Eliane Puerta, Adrian Gonzalez, Liset Alfaro" # Llamar al compilador echo "Compiling $INPUT_FILE into $OUTPUT_FILE" diff --git a/src/install.py b/src/install.py new file mode 100644 index 00000000..61e777ae --- /dev/null +++ b/src/install.py @@ -0,0 +1,28 @@ +import cloudpickle +from coolgrammar.grammar import build_cool_grammar +from parserr.lr import LALRParser +from argparse import ArgumentParser + + +def generate_py(f): + gram, lexer = build_cool_grammar() + parser = LALRParser(gram, verbose=True) + lexer_str = cloudpickle.dumps(lexer) + parser_str = cloudpickle.dumps(parser) + f.write( +""" +import cloudpickle +import sys +sys.path.append('..') +PARSER = cloudpickle.loads(%s) +LEXER = cloudpickle.loads(%s) +""" + % (parser_str, lexer_str)) + + +if __name__ == '__main__': + parser = ArgumentParser() + parser.add_argument('file', type=str) + arg = parser.parse_args() + with open(arg.file, "w+") as f: + generate_py(f) diff --git a/src/lexer/tokenizer.py b/src/lexer/tokenizer.py index 0352278a..6d27b209 100755 --- a/src/lexer/tokenizer.py +++ b/src/lexer/tokenizer.py @@ -1,17 +1,17 @@ -#%% from automatons.state import State from lexer.regexgenerator import Regex from lexer.tokens import Token -#%% class TokenLine(Token): ''' Clase para representar el token constante de cambio de Linea ''' + def __init__(self): super().__init__('\n', 'Line') + class Lexer: """ @@ -31,6 +31,7 @@ class Lexer: estado final. - Al finalizar de consumir toda la cadena, se reporta el token de fin de cadena. """ + def __init__(self, table, eof, ignore_white_space=False): self.eof = eof self.regexs = self._build_regexs(table, ignore_white_space) @@ -77,7 +78,6 @@ def _build_automaton(self): start.add_epsilon_transition(regex) return start.to_deterministic() - def _walk(self, string): state = self.automaton final = state if state.final else None @@ -104,7 +104,8 @@ def _tokenize(self, text): final, lex = self._walk(string) if lex == '': print(text) - raise SyntaxError(f'Invalid token in line: {self.line} column: {self.column}') + raise SyntaxError( + f'Invalid token in line: {self.line} column: {self.column}') if final: n = 2**64 token_type = None @@ -119,7 +120,8 @@ def _tokenize(self, text): yield lex, token_type text = string[len(lex):] else: - raise SyntaxError(f'Invalid token in line: {self.line} column: {self.column}') + raise SyntaxError( + f'Invalid token in line: {self.line} column: {self.column}') yield '$', self.eof diff --git a/src/makefile b/src/makefile index 021189d6..7abcd550 100644 --- a/src/makefile +++ b/src/makefile @@ -1,7 +1,33 @@ +# Find a python3 version on the System +ifndef PYTHON + PYTHON:=$(shell if which python3 > "/dev/null" 2>&1; \ + then echo "python3"; \ + else \ + echo "No python3 on system Path"; \ + exit 1; \ + fi) +endif + +# also find pip +PIP:=$(shell which pip) + +ifeq ($(PIP), "") + echo "*** Please install pip and make sure it is in your System PATH ***"; + exit 1; +endif + .PHONY: clean +#define some macros +COMPSTRUCTFILE=compiler_struct.py +PIPREQUIREMENTS=cloudpickle pyinstaller + main: - # Compiling the compiler :) + @# Compiling the compiler :) + $(PIP) install --user $(PIPREQUIREMENTS) + $(PYTHON) install.py build/$(COMPSTRUCTFILE) + @# account the numbers of builds + @echo 1 >> .builds clean: rm -rf build/* diff --git a/src/parserr/lr.py b/src/parserr/lr.py index 450df093..442e45c4 100755 --- a/src/parserr/lr.py +++ b/src/parserr/lr.py @@ -4,21 +4,23 @@ from automatons.state import State from parserr.shiftreduce import ShiftReduceParser from tools.firsts import compute_firsts, compute_local_first -from tools.follows import compute_follows +from progressbar.progressbar import ProgressBar + def expand(item, firsts): next_symbol = item.NextSymbol if next_symbol is None or not next_symbol.IsNonTerminal: return [] - + lookaheads = ContainerSet() for remainder in item.Preview(): - for lookahead in compute_local_first(firsts=firsts,alpha=remainder): + for lookahead in compute_local_first(firsts=firsts, alpha=remainder): lookaheads.update(ContainerSet(lookahead)) assert not lookaheads.contains_epsilon - expanded = [Item(production,0,lookaheads) for production in next_symbol.productions] + expanded = [Item(production, 0, lookaheads) + for production in next_symbol.productions] return expanded @@ -32,88 +34,89 @@ def compress(items): except KeyError: centers[center] = lookaheads = set() lookaheads.update(item.lookaheads) - - return { Item(x.production, x.pos, set(lookahead)) for x, lookahead in centers.items() } + + return {Item(x.production, x.pos, set(lookahead)) for x, lookahead in centers.items()} def closure_lr1(items, firsts): closure = ContainerSet(*items) - + changed = True while changed: changed = False - + new_items = ContainerSet() for item in closure: - new_items.update(ContainerSet(*expand(item,firsts))) + new_items.update(ContainerSet(*expand(item, firsts))) changed = closure.update(new_items) - return compress(closure) + def goto_lr1(items, symbol, firsts=None, just_kernel=False): assert just_kernel or firsts is not None, '`firsts` must be provided if `just_kernel=False`' - items = frozenset(item.next_item() for item in items if item.NextSymbol == symbol) + items = frozenset(item.next_item() + for item in items if item.NextSymbol == symbol) return items if just_kernel else closure_lr1(items, firsts) + def build_LR1_automaton(G): assert len(G.startSymbol.productions) == 1, 'Grammar must be augmented' - + firsts = compute_firsts(G) firsts[G.EOF] = ContainerSet(G.EOF) - + start_production = G.startSymbol.productions[0] start_item = Item(start_production, 0, lookaheads=(G.EOF,)) start = frozenset([start_item]) - + closure = closure_lr1(start, firsts) automaton = State(frozenset(closure), True) - - pending = [ start ] - visited = { start: automaton } - + + pending = [start] + visited = {start: automaton} + while pending: current = pending.pop() current_state = visited[current] - + for symbol in G.terminals + G.nonTerminals: - next_item = goto_lr1(current_state.state,symbol,just_kernel=True) + next_item = goto_lr1(current_state.state, symbol, just_kernel=True) if next_item: try: next_state = visited[next_item] except KeyError: - next_state = State(frozenset(closure_lr1(next_item,firsts)),True) + next_state = State( + frozenset(closure_lr1(next_item, firsts)), True) visited[next_item] = next_state pending += [next_item] - + current_state.add_transition(symbol.Name, next_state) - + return automaton - def build_lalr_automaton(G): - - def centers(items:[Item]): + + def centers(items: [Item]): return frozenset(item.Center() for item in items) - + def lookaheads(items: [Item]): return {item.Center(): item.lookaheads for item in items} def subset(items1, items2): return all(items1[i] <= items2[i] for i in items1) - assert len(G.startSymbol.productions) == 1, 'Grammar must be augmented' firsts = compute_firsts(G) firsts[G.EOF] = ContainerSet(G.EOF) start_production = G.startSymbol.productions[0] - start_item = Item(start_production,0,(G.EOF,)) + start_item = Item(start_production, 0, (G.EOF,)) - start = State((closure_lr1(start_item,firsts)),True) + start = State((closure_lr1(start_item, firsts)), True) pending = [start_item] visisted_centers = {centers(start.state): start} @@ -124,53 +127,58 @@ def subset(items1, items2): # print('ss') current_state = visited[pending.pop()] for symbol in G.terminals + G.nonTerminals: - next_item = frozenset(goto_lr1(current_state.state,symbol,firsts)) + next_item = frozenset( + goto_lr1(current_state.state, symbol, firsts)) if next_item: - #Caso en que pueda mezclar el nuevo item + # Caso en que pueda mezclar el nuevo item try: next_state = visisted_centers[centers(next_item)] - if not subset(lookaheads(next_item),lookaheads(next_state.state)): - next_state.state = compress(list(next_state.state) + list(next_item)) + if not subset(lookaheads(next_item), lookaheads(next_state.state)): + next_state.state = compress( + list(next_state.state) + list(next_item)) pending.append(frozenset(next_state.state)) visited[frozenset(next_state.state)] = next_state except KeyError: - next_state = State(next_item,True) - pending+= [next_item] + next_state = State(next_item, True) + pending += [next_item] visisted_centers[centers(next_item)] = next_state visited[next_item] = next_state current_state.add_transition(symbol.Name, next_state) - - return start + return start class LR1Parser(ShiftReduceParser): def _build_parsing_table(self): - #G = self.G.AugmentedGrammar() if not self.G.IsAugmentedGrammar else self.G - + # G = self.G.AugmentedGrammar() if not self.G.IsAugmentedGrammar else self.G + automaton = build_LR1_automaton(self.G) for i, node in enumerate(automaton): node.idx = i - - for node in automaton: + progress = ProgressBar(term_width=30) + for node in progress(automaton): idx = node.idx for item in node.state: if item.IsReduceItem: if item.production.Left == self.G.startSymbol: - self._register(self.action,(idx,self.G.EOF),('OK',item.production)) + self._register( + self.action, (idx, self.G.EOF), ('OK', item.production)) else: for lookahead in item.lookaheads: - self._register(self.action,(idx,lookahead),('REDUCE',item.production)) + self._register( + self.action, (idx, lookahead), ('REDUCE', item.production)) else: next_symbol = item.NextSymbol try: if next_symbol.IsNonTerminal: next_state = node.transitions[next_symbol.Name][0] - self._register(self.goto,(idx,next_symbol),next_state.idx) + self._register( + self.goto, (idx, next_symbol), next_state.idx) else: next_state = node.transitions[next_symbol.Name][0] - self._register(self.action,(idx,next_symbol),('SHIFT',next_state.idx)) + self._register( + self.action, (idx, next_symbol), ('SHIFT', next_state.idx)) except KeyError: pass @@ -178,7 +186,8 @@ def _build_parsing_table(self): def _register(table, key, value): # assert key not in table or table[key] == value, f'Shift-Reduce or Reduce-Reduce conflict!!!\n tried to put {value} in {key} already exist with value {table[key]}' if not (key not in table or table[key] == value): - print(f'Shift-Reduce or Reduce-Reduce conflict!!!\n tried to put {value} in {key} already exist with value {table[key]}') + print( + f'Shift-Reduce or Reduce-Reduce conflict!!!\n tried to put {value} in {key} already exist with value {table[key]}') print(table) assert False table[key] = value @@ -197,97 +206,22 @@ def _build_parsing_table(self): for item in node.state: if item.IsReduceItem: if item.production.Left == G.startSymbol: - register(self.action, (idx, G.EOF), ('OK', item.production)) + register(self.action, (idx, G.EOF), + ('OK', item.production)) else: for lookahead in item.lookaheads: - register(self.action, (idx, lookahead), ('REDUCE', item.production)) + register(self.action, (idx, lookahead), + ('REDUCE', item.production)) else: next_symbol = item.NextSymbol try: if next_symbol.IsNonTerminal: next_state = node.transitions[next_symbol.Name][0] - register(self.goto, (idx, next_symbol), next_state.idx) + register(self.goto, (idx, next_symbol), + next_state.idx) else: next_state = node.transitions[next_symbol.Name][0] - register(self.action, (idx, next_symbol), ('SHIFT', next_state.idx)) + register(self.action, (idx, next_symbol), + ('SHIFT', next_state.idx)) except KeyError: pass - - -#%% Testing Cells - -# from grammar.grammar import Grammar -# from lexer.tokenizer import Lexer -# from tools.dtbuilder import build_derivation_tree, build_right_derivation_tree -# G = Grammar() -# E = G.NonTerminal('E',True) -# T, F = G.NonTerminals("T F") -# num, plus, star, div, minus,opar, cpar = G.Terminals('num + * / - ( )') - -# E %= E + plus + T, lambda h,s: s[1] + s[3] -# E %= T, lambda h,s: s[1] -# E %= E + minus + T, lambda h,s: s[1] - s[3] -# T %= T + star + F, lambda h,s: s[1] * s[3] -# T %= T + div + F, lambda h,s: s[1] / s[3] -# T %= F, lambda h,s: s[1] -# F %= num , lambda h,s: int(s[1]) -# F %= opar + E + cpar, lambda h,s: s[2] - -# print(G) -# #%% -# tokens = [(num,'(0|1|2|3|4|5|6|7|8|9)|(1|2|3|4|5|6|7|8|9)*'), -# (plus,'@+'), -# (star,'@*'), -# (div,'/'), -# (minus,'@-'), -# (opar,'@('), -# (cpar,'@)'),] - -# lexer = Lexer(tokens,G.EOF,ignore_white_space=True) - -# #%% -# try: -# tok = lexer(" 1 - 1 + 1 + 5 * 3 + 2 ") -# except SyntaxError as e: -# print(e) - -# parser = LR1Parser(G,verbose=False) -# #%% -# try: -# parse = parser(tok) -# except SyntaxError as e: -# print(e) - -# #%% -# print(parse) -# tree = build_right_derivation_tree(parse) - -# display(tree) -# #%% -# from tools.evaluate import evaluate_right_parse -# root = evaluate_right_parse(parse, tok) -# print(root) -# #%%LALR -# from lexer.tokens import Token -# G = Grammar() -# E = G.NonTerminal('E', True) -# A = G.NonTerminal('A') -# equal, plus, num = G.Terminals('= + int') - -# E %= A + equal + A | num -# A %= num + plus + A | num - -# print(G) - -# #%% -# item = Item(E.productions[0], 0, lookaheads=[G.EOF, plus]) -# print('item:', item) - -# for preview in item.Preview(): -# print('item.Preview:', preview) -# #%% - -# parser = LALRParser(G, verbose=False) -# derivation = parser([Token('1',num), Token('+',plus),Token('2',num), Token('=',equal), Token('3',num), Token('+',plus), Token('4',num), Token('$',G.EOF)]) -# tree = build_right_derivation_tree(derivation) -# display(tree) From 44434d8bb65c7bad2c638eb216bf2b0891248245 Mon Sep 17 00:00:00 2001 From: Adrian Date: Sun, 16 Feb 2020 23:09:34 -0500 Subject: [PATCH 004/162] Added function to process coments --- cool-comp.sublime-workspace | 1329 +++++++++++++++++++++++++++-------- src/.builds | 6 + src/comments.py | 85 +++ src/coolc.sh | 1 + src/install.py | 6 +- src/makefile | 9 +- src/parserr/lr.py | 47 +- src/pycoolc.py | 36 + 8 files changed, 1208 insertions(+), 311 deletions(-) create mode 100644 src/comments.py create mode 100644 src/pycoolc.py diff --git a/cool-comp.sublime-workspace b/cool-comp.sublime-workspace index 8e31f962..5ad31e5d 100644 --- a/cool-comp.sublime-workspace +++ b/cool-comp.sublime-workspace @@ -3,6 +3,34 @@ { "selected_items": [ + [ + "a", + "append\tfunction" + ], + [ + "com", + "compiler_struct\tmodule" + ], + [ + "Pip", + "PIP" + ], + [ + "prase", + "parse_args\tfunction" + ], + [ + "Arguem", + "ArgumentParser\tclass" + ], + [ + "if", + "ifmain\tif __name__ == '__main__'" + ], + [ + "ter", + "term_width\tparam" + ], [ "E5", "E501" @@ -168,19 +196,18 @@ "buffers": [ { - "file": "src/lexer/regexgenerator.py", + "file": "src/makefile", "settings": { - "buffer_size": 5047, - "encoding": "UTF-8", + "buffer_size": 721, "line_ending": "Unix" } }, { - "file": "src/parserr/shiftreduce.py", + "file": "src/comments.py", "settings": { - "buffer_size": 2646, + "buffer_size": 30, "encoding": "UTF-8", "line_ending": "Unix" } @@ -189,13 +216,41 @@ "file": "/home/adrian/.config/sublime-text-3/Packages/Anaconda/Anaconda.sublime-settings", "settings": { - "buffer_size": 21782, + "buffer_size": 21784, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "src/coolgrammar/grammar.py", + "settings": + { + "buffer_size": 10948, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "src/install.py", + "settings": + { + "buffer_size": 688, "encoding": "UTF-8", "line_ending": "Unix" } + }, + { + "contents": "adrian@adrian-Inspiron-7548:~/Documents/Universida ​‌​\nd/4to/Compilacion/cool-comp2020/src$ ls \nabstract coolc.sh makefile travels \nautomatons coolgrammar parserr typecheck \nbaseNodeTree grammar Readme.md \nbuild install.py testing.py \ncomments.py lexer tools \nadrian@adrian-Inspiron-7548:~/Documents/Universida ​‌​\nd/4to/Compilacion/cool-comp2020/src$ ", + "settings": + { + "buffer_size": 963, + "line_ending": "Unix", + "name": "Login Shell", + "scratch": true + } } ], - "build_system": "", + "build_system": "Packages/User/make-src.sublime-build", "build_system_choices": [ [ @@ -454,6 +509,50 @@ "" ] ], + [ + [ + [ + "Anaconda Python Builder", + "" + ], + [ + "Packages/Python/Python.sublime-build", + "" + ], + [ + "Packages/Python/Python.sublime-build", + "Syntax Check" + ], + [ + "Packages/User/make-src.sublime-build", + "" + ], + [ + "Packages/User/make-src.sublime-build", + "test" + ], + [ + "Packages/User/make-src.sublime-build", + "clean" + ], + [ + "Packages/User/make.sublime-build", + "" + ], + [ + "Packages/User/make.sublime-build", + "test" + ], + [ + "Packages/User/make.sublime-build", + "clean" + ] + ], + [ + "Packages/User/make-src.sublime-build", + "clean" + ] + ], [ [ [ @@ -474,6 +573,50 @@ "" ] ], + [ + [ + [ + "Packages/Makefile/Make.sublime-build", + "" + ], + [ + "Packages/Makefile/Make.sublime-build", + "Clean" + ], + [ + "Packages/ShellScript/ShellScript.sublime-build", + "" + ], + [ + "Packages/User/make-src.sublime-build", + "" + ], + [ + "Packages/User/make-src.sublime-build", + "test" + ], + [ + "Packages/User/make-src.sublime-build", + "clean" + ], + [ + "Packages/User/make.sublime-build", + "" + ], + [ + "Packages/User/make.sublime-build", + "test" + ], + [ + "Packages/User/make.sublime-build", + "clean" + ] + ], + [ + "Packages/User/make-src.sublime-build", + "" + ] + ], [ [ [ @@ -588,6 +731,18 @@ "Packages/Makefile/Make.sublime-build", "Clean" ], + [ + "Packages/User/make-src.sublime-build", + "" + ], + [ + "Packages/User/make-src.sublime-build", + "test" + ], + [ + "Packages/User/make-src.sublime-build", + "clean" + ], [ "Packages/User/make.sublime-build", "" @@ -602,7 +757,35 @@ ] ], [ - "Packages/Makefile/Make.sublime-build", + "Packages/User/make-src.sublime-build", + "" + ] + ], + [ + [ + [ + "Packages/Makefile/Make.sublime-build", + "" + ], + [ + "Packages/Makefile/Make.sublime-build", + "Clean" + ], + [ + "Packages/User/make.sublime-build", + "" + ], + [ + "Packages/User/make.sublime-build", + "test" + ], + [ + "Packages/User/make.sublime-build", + "clean" + ] + ], + [ + "Packages/User/make.sublime-build", "" ] ], @@ -706,6 +889,66 @@ "last_filter": "", "selected_items": [ + [ + "Yapf", + "PyYapf: Format Document" + ], + [ + "Insta", + "Package Control: Install Package" + ], + [ + "terminus tu", + "Terminus Utilities: Select Theme" + ], + [ + "Toggle s", + "View: Toggle Side Bar" + ], + [ + "Terminus", + "Terminus: Toggle Panel" + ], + [ + "Preference Termin", + "Preferences: Terminus Command Palette" + ], + [ + "TerminusCol", + "Terminus: Close" + ], + [ + "termi", + "Terminal: Open" + ], + [ + "Ter", + "Terminal: Open" + ], + [ + "Install", + "Package Control: Install Package" + ], + [ + "git commit", + "Git: Commit" + ], + [ + "Git add", + "Git: Add All" + ], + [ + "Git co", + "Git: Commit" + ], + [ + "git add", + "Git: Add All" + ], + [ + "Git Bran", + "Git: New Branch" + ], [ "Git merge", "Git: Merge Branch" @@ -746,10 +989,6 @@ "make", "Build With: Make - Clean" ], - [ - "Install", - "Package Control: Install Package" - ], [ "Remo", "Package Control: Remove Package" @@ -762,10 +1001,6 @@ "VIe", "View: Toggle Side Bar" ], - [ - "Insta", - "Package Control: Install Package" - ], [ "vier", "View: Toggle Side Bar" @@ -842,10 +1077,6 @@ "Colo", "UI: Select Color Scheme" ], - [ - "Ter", - "Terminal: Open" - ], [ "Settig", "Preferences: Settings" @@ -923,14 +1154,42 @@ "expanded_folders": [ "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/parserr" + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src" ], "file_history": [ + "/home/adrian/.config/sublime-text-3/Packages/Anaconda/Anaconda.sublime-settings", + "/home/adrian/.config/sublime-text-3/Packages/User/Anaconda.sublime-settings", + "/home/adrian/.config/sublime-text-3/Packages/Terminal/Default (Linux).sublime-keymap", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/coolc.sh", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/makefile", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/lexer/tokenizer.py", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/testing.py", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/build/test.py", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/build/compiler_struct.py", + "/home/adrian/Documents/Universidad/Docencia/Scheduler/Makefile", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/.gitignore", + "/home/adrian/.config/sublime-text-3/Packages/User/make-src.sublime-build", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/lexer/regexgenerator.py", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/install.py", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/cool-comp.sublime-project", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/parserr/lr.py", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/grammar/grammar.py", + "/home/adrian/Documents/Universidad/3er año/Compilacion/CoolLanguage/PyCOOLC-master/docs/Grammar.md", + "/home/adrian/Documents/Universidad/3er año/Compilacion/CoolLanguage/PyCOOLC-master/setup.py", + "/usr/local/lib/python3.7/dist-packages/setuptools-44.0.0-py3.7.egg", + "/home/adrian/Documents/Universidad/3er año/Compilacion/CoolLanguage/PyCOOLC-master/pycoolc/ast.py", + "/home/adrian/Documents/Universidad/3er año/Compilacion/CoolLanguage/PyCOOLC-master/pycoolc/pycoolc.py", + "/home/adrian/Documents/Universidad/3er año/Compilacion/CoolLanguage/PyCOOLC-master/pycoolc/parser.py", + "/home/adrian/Documents/Universidad/3er año/Compilacion/CoolLanguage/PyCOOLC-master/pycoolc/lexer.py", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/doc/Readme.md", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/img/img1.png", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/tools/gramtoregex.py", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/tools/evaluate.py", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/tools/dtbuilder.py", + "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/parserr/shiftreduce.py", "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/grammar/symbols.py", "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/grammar/remrecursion.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/grammar/grammar.py", "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/coolgrammar/grammar.py", "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/baseNodeTree/astprinter.py", "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/baseNodeTree/base.py", @@ -966,9 +1225,7 @@ "/home/adrian/Documents/Universidad/Docencia/Scheduler/src/testing.py", "/usr/local/lib/python3.7/dist-packages/progressbar/__init__.py", "/usr/local/lib/python3.7/dist-packages/progressbar/progressbar.py", - "/home/adrian/.config/sublime-text-3/Packages/Anaconda/Anaconda.sublime-settings", "/home/adrian/Documents/Universidad/Docencia/Scheduler/src/workload_generator.py", - "/home/adrian/.config/sublime-text-3/Packages/User/Anaconda.sublime-settings", "/home/adrian/Documents/Universidad/Softwares/Packages/vscode_extension/settings.txt", "/home/adrian/Documents/Universidad/Docencia/Scheduler/workload_generator.py", "/home/adrian/Documents/Universidad/Docencia/Scheduler/schedtools.py", @@ -1005,7 +1262,7 @@ ], "find": { - "height": 38.0 + "height": 49.0 }, "find_in_files": { @@ -1019,6 +1276,9 @@ "case_sensitive": false, "find_history": [ + "pep", + "format", + "unión" ], "highlight": true, "in_selection": false, @@ -1036,24 +1296,24 @@ "groups": [ { - "selected": 1, + "selected": 2, "sheets": [ { "buffer": 0, - "file": "src/lexer/regexgenerator.py", + "file": "src/makefile", "semi_transient": false, "settings": { - "buffer_size": 5047, + "buffer_size": 721, "regions": { }, "selection": [ [ - 4598, - 4598 + 358, + 358 ] ], "settings": @@ -1064,27 +1324,12 @@ { "close": { - "1": - [ - 214, - 215 - ] }, "icon": { - "1": - [ - "Packages/BracketHighlighter/icons/round_bracket.png", - "region.yellowish" - ] }, "open": { - "1": - [ - 152, - 153 - ] }, "unmatched": { @@ -1092,87 +1337,72 @@ }, "bracket_highlighter.clone_regions": [ - "bh_c_define", - "bh_c_define_center", - "bh_c_define_open", - "bh_c_define_close", - "bh_c_define_content", "bh_angle", "bh_angle_center", "bh_angle_open", "bh_angle_close", "bh_angle_content", - "bh_round", - "bh_round_center", - "bh_round_open", - "bh_round_close", - "bh_round_content", - "bh_double_quote", - "bh_double_quote_center", - "bh_double_quote_open", - "bh_double_quote_close", - "bh_double_quote_content", - "bh_tag", - "bh_tag_center", - "bh_tag_open", - "bh_tag_close", - "bh_tag_content", - "bh_regex", - "bh_regex_center", - "bh_regex_open", - "bh_regex_close", - "bh_regex_content", "bh_single_quote", "bh_single_quote_center", "bh_single_quote_open", "bh_single_quote_close", "bh_single_quote_content", - "bh_unmatched", - "bh_unmatched_center", - "bh_unmatched_open", - "bh_unmatched_close", - "bh_unmatched_content", - "bh_default", - "bh_default_center", - "bh_default_open", - "bh_default_close", - "bh_default_content", "bh_square", "bh_square_center", "bh_square_open", "bh_square_close", "bh_square_content", - "bh_curly", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_regex_content", + "bh_double_quote", + "bh_double_quote_center", + "bh_double_quote_open", + "bh_double_quote_close", + "bh_double_quote_content", + "bh_curly", "bh_curly_center", "bh_curly_open", "bh_curly_close", - "bh_curly_content" + "bh_curly_content", + "bh_tag", + "bh_tag_center", + "bh_tag_open", + "bh_tag_close", + "bh_tag_content", + "bh_c_define", + "bh_c_define_center", + "bh_c_define_open", + "bh_c_define_close", + "bh_c_define_content", + "bh_default", + "bh_default_center", + "bh_default_open", + "bh_default_close", + "bh_default_content", + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_round_content", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_unmatched_content" ], "bracket_highlighter.locations": { "close": { - "1": - [ - 4597, - 4598 - ] }, "icon": { - "1": - [ - "Packages/BracketHighlighter/icons/round_bracket.png", - "region.yellowish" - ] }, "open": { - "1": - [ - 4591, - 4592 - ] }, "unmatched": { @@ -1180,88 +1410,292 @@ }, "bracket_highlighter.regions": [ - "bh_c_define", - "bh_c_define_center", - "bh_c_define_open", - "bh_c_define_close", - "bh_c_define_content", "bh_angle", "bh_angle_center", "bh_angle_open", "bh_angle_close", "bh_angle_content", - "bh_round", - "bh_round_center", - "bh_round_open", - "bh_round_close", - "bh_round_content", + "bh_single_quote", + "bh_single_quote_center", + "bh_single_quote_open", + "bh_single_quote_close", + "bh_single_quote_content", + "bh_square", + "bh_square_center", + "bh_square_open", + "bh_square_close", + "bh_square_content", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_regex_content", "bh_double_quote", "bh_double_quote_center", "bh_double_quote_open", "bh_double_quote_close", "bh_double_quote_content", + "bh_curly", + "bh_curly_center", + "bh_curly_open", + "bh_curly_close", + "bh_curly_content", "bh_tag", "bh_tag_center", "bh_tag_open", "bh_tag_close", "bh_tag_content", - "bh_regex", - "bh_regex_center", - "bh_regex_open", - "bh_regex_close", - "bh_regex_content", + "bh_c_define", + "bh_c_define_center", + "bh_c_define_open", + "bh_c_define_close", + "bh_c_define_content", + "bh_default", + "bh_default_center", + "bh_default_open", + "bh_default_close", + "bh_default_content", + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_round_content", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_unmatched_content" + ], + "syntax": "Packages/Makefile/Makefile.sublime-syntax", + "translate_tabs_to_spaces": false + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 5, + "type": "text" + }, + { + "buffer": 1, + "file": "src/comments.py", + "semi_transient": false, + "settings": + { + "buffer_size": 30, + "regions": + { + }, + "selection": + [ + [ + 29, + 29 + ] + ], + "settings": + { + "auto_complete_triggers": + [ + { + "characters": ".>:", + "selector": "source.c++ - string - comment - constant.numeric" + }, + { + "characters": ".>:", + "selector": "source.c - string - comment - constant.numeric" + }, + { + "characters": ".>: ", + "selector": "source.objc++ - string - comment - constant.numeric" + }, + { + "characters": ".>: ", + "selector": "source.objc - string - comment - constant.numeric" + }, + { + "characters": ".>: ", + "selector": "source.cuda-c++ - string - comment - constant.numeric" + }, + { + "characters": ".", + "selector": "source.python - string - comment - constant.numeric" + } + ], + "bracket_highlighter.busy": false, + "bracket_highlighter.clone": -1, + "bracket_highlighter.clone_locations": + { + "close": + { + }, + "icon": + { + }, + "open": + { + }, + "unmatched": + { + } + }, + "bracket_highlighter.clone_regions": + [ + "bh_angle", + "bh_angle_center", + "bh_angle_open", + "bh_angle_close", + "bh_angle_content", "bh_single_quote", "bh_single_quote_center", "bh_single_quote_open", "bh_single_quote_close", "bh_single_quote_content", - "bh_unmatched", - "bh_unmatched_center", - "bh_unmatched_open", - "bh_unmatched_close", - "bh_unmatched_content", + "bh_square", + "bh_square_center", + "bh_square_open", + "bh_square_close", + "bh_square_content", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_regex_content", + "bh_double_quote", + "bh_double_quote_center", + "bh_double_quote_open", + "bh_double_quote_close", + "bh_double_quote_content", + "bh_curly", + "bh_curly_center", + "bh_curly_open", + "bh_curly_close", + "bh_curly_content", + "bh_tag", + "bh_tag_center", + "bh_tag_open", + "bh_tag_close", + "bh_tag_content", + "bh_c_define", + "bh_c_define_center", + "bh_c_define_open", + "bh_c_define_close", + "bh_c_define_content", "bh_default", "bh_default_center", "bh_default_open", "bh_default_close", "bh_default_content", + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_round_content", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_unmatched_content" + ], + "bracket_highlighter.locations": + { + "close": + { + }, + "icon": + { + }, + "open": + { + }, + "unmatched": + { + } + }, + "bracket_highlighter.regions": + [ + "bh_angle", + "bh_angle_center", + "bh_angle_open", + "bh_angle_close", + "bh_angle_content", + "bh_single_quote", + "bh_single_quote_center", + "bh_single_quote_open", + "bh_single_quote_close", + "bh_single_quote_content", "bh_square", "bh_square_center", "bh_square_open", "bh_square_close", "bh_square_content", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_regex_content", + "bh_double_quote", + "bh_double_quote_center", + "bh_double_quote_open", + "bh_double_quote_close", + "bh_double_quote_content", "bh_curly", "bh_curly_center", "bh_curly_open", "bh_curly_close", - "bh_curly_content" + "bh_curly_content", + "bh_tag", + "bh_tag_center", + "bh_tag_open", + "bh_tag_close", + "bh_tag_content", + "bh_c_define", + "bh_c_define_center", + "bh_c_define_open", + "bh_c_define_close", + "bh_c_define_content", + "bh_default", + "bh_default_center", + "bh_default_open", + "bh_default_close", + "bh_default_content", + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_round_content", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_unmatched_content" ], + "open_with_edit": true, "syntax": "Packages/Python/Python.sublime-syntax", - "tab_size": 4, - "translate_tabs_to_spaces": true + "translate_tabs_to_spaces": false }, "translation.x": 0.0, - "translation.y": 761.0, + "translation.y": 0.0, "zoom_level": 1.0 }, - "stack_index": 2, + "stack_index": 1, "type": "text" }, { - "buffer": 1, - "file": "src/parserr/shiftreduce.py", + "buffer": 2, + "file": "/home/adrian/.config/sublime-text-3/Packages/Anaconda/Anaconda.sublime-settings", "semi_transient": false, "settings": { - "buffer_size": 2646, + "buffer_size": 21784, "regions": { }, "selection": [ [ - 1355, - 1355 + 12068, + 12068 ] ], "settings": @@ -1285,61 +1719,252 @@ }, "bracket_highlighter.clone_regions": [ - "bh_c_define", - "bh_c_define_center", - "bh_c_define_open", - "bh_c_define_close", - "bh_c_define_content", "bh_angle", "bh_angle_center", "bh_angle_open", "bh_angle_close", "bh_angle_content", - "bh_round", - "bh_round_center", - "bh_round_open", - "bh_round_close", - "bh_round_content", + "bh_single_quote", + "bh_single_quote_center", + "bh_single_quote_open", + "bh_single_quote_close", + "bh_single_quote_content", + "bh_square", + "bh_square_center", + "bh_square_open", + "bh_square_close", + "bh_square_content", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_regex_content", "bh_double_quote", "bh_double_quote_center", "bh_double_quote_open", "bh_double_quote_close", "bh_double_quote_content", + "bh_curly", + "bh_curly_center", + "bh_curly_open", + "bh_curly_close", + "bh_curly_content", "bh_tag", "bh_tag_center", "bh_tag_open", "bh_tag_close", "bh_tag_content", - "bh_regex", - "bh_regex_center", - "bh_regex_open", - "bh_regex_close", - "bh_regex_content", + "bh_c_define", + "bh_c_define_center", + "bh_c_define_open", + "bh_c_define_close", + "bh_c_define_content", + "bh_default", + "bh_default_center", + "bh_default_open", + "bh_default_close", + "bh_default_content", + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_round_content", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_unmatched_content" + ], + "bracket_highlighter.locations": + { + "close": + { + }, + "icon": + { + }, + "open": + { + }, + "unmatched": + { + } + }, + "bracket_highlighter.regions": + [ + "bh_angle", + "bh_angle_center", + "bh_angle_open", + "bh_angle_close", + "bh_angle_content", "bh_single_quote", "bh_single_quote_center", "bh_single_quote_open", "bh_single_quote_close", "bh_single_quote_content", - "bh_unmatched", - "bh_unmatched_center", - "bh_unmatched_open", - "bh_unmatched_close", - "bh_unmatched_content", + "bh_square", + "bh_square_center", + "bh_square_open", + "bh_square_close", + "bh_square_content", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_regex_content", + "bh_double_quote", + "bh_double_quote_center", + "bh_double_quote_open", + "bh_double_quote_close", + "bh_double_quote_content", + "bh_curly", + "bh_curly_center", + "bh_curly_open", + "bh_curly_close", + "bh_curly_content", + "bh_tag", + "bh_tag_center", + "bh_tag_open", + "bh_tag_close", + "bh_tag_content", + "bh_c_define", + "bh_c_define_center", + "bh_c_define_open", + "bh_c_define_close", + "bh_c_define_content", "bh_default", "bh_default_center", "bh_default_open", "bh_default_close", "bh_default_content", + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_round_content", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_unmatched_content" + ], + "syntax": "Packages/JavaScript/JSON.sublime-syntax" + }, + "translation.x": 0.0, + "translation.y": 8484.0, + "zoom_level": 1.0 + }, + "stack_index": 0, + "type": "text" + }, + { + "buffer": 3, + "file": "src/coolgrammar/grammar.py", + "semi_transient": false, + "settings": + { + "buffer_size": 10948, + "regions": + { + }, + "selection": + [ + [ + 9901, + 9901 + ] + ], + "settings": + { + "bracket_highlighter.busy": false, + "bracket_highlighter.clone": -1, + "bracket_highlighter.clone_locations": + { + "close": + { + "1": + [ + 10867, + 10868 + ] + }, + "icon": + { + "1": + [ + "Packages/BracketHighlighter/icons/square_bracket.png", + "region.bluish" + ] + }, + "open": + { + "1": + [ + 9128, + 9129 + ] + }, + "unmatched": + { + } + }, + "bracket_highlighter.clone_regions": + [ + "bh_angle", + "bh_angle_center", + "bh_angle_open", + "bh_angle_close", + "bh_angle_content", + "bh_single_quote", + "bh_single_quote_center", + "bh_single_quote_open", + "bh_single_quote_close", + "bh_single_quote_content", "bh_square", "bh_square_center", "bh_square_open", "bh_square_close", "bh_square_content", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_regex_content", + "bh_double_quote", + "bh_double_quote_center", + "bh_double_quote_open", + "bh_double_quote_close", + "bh_double_quote_content", "bh_curly", "bh_curly_center", "bh_curly_open", "bh_curly_close", - "bh_curly_content" + "bh_curly_content", + "bh_tag", + "bh_tag_center", + "bh_tag_open", + "bh_tag_close", + "bh_tag_content", + "bh_c_define", + "bh_c_define_center", + "bh_c_define_open", + "bh_c_define_close", + "bh_c_define_content", + "bh_default", + "bh_default_center", + "bh_default_open", + "bh_default_close", + "bh_default_content", + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_round_content", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_unmatched_content" ], "bracket_highlighter.locations": { @@ -1347,8 +1972,8 @@ { "1": [ - 1399, - 1400 + 10867, + 10868 ] }, "icon": @@ -1363,8 +1988,8 @@ { "1": [ - 1354, - 1355 + 9128, + 9129 ] }, "unmatched": @@ -1373,104 +1998,144 @@ }, "bracket_highlighter.regions": [ - "bh_c_define", - "bh_c_define_center", - "bh_c_define_open", - "bh_c_define_close", - "bh_c_define_content", "bh_angle", "bh_angle_center", "bh_angle_open", "bh_angle_close", "bh_angle_content", - "bh_round", - "bh_round_center", - "bh_round_open", - "bh_round_close", - "bh_round_content", + "bh_single_quote", + "bh_single_quote_center", + "bh_single_quote_open", + "bh_single_quote_close", + "bh_single_quote_content", + "bh_square", + "bh_square_center", + "bh_square_open", + "bh_square_close", + "bh_square_content", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_regex_content", "bh_double_quote", "bh_double_quote_center", "bh_double_quote_open", "bh_double_quote_close", "bh_double_quote_content", + "bh_curly", + "bh_curly_center", + "bh_curly_open", + "bh_curly_close", + "bh_curly_content", "bh_tag", "bh_tag_center", "bh_tag_open", "bh_tag_close", "bh_tag_content", - "bh_regex", - "bh_regex_center", - "bh_regex_open", - "bh_regex_close", - "bh_regex_content", - "bh_single_quote", - "bh_single_quote_center", - "bh_single_quote_open", - "bh_single_quote_close", - "bh_single_quote_content", - "bh_unmatched", - "bh_unmatched_center", - "bh_unmatched_open", - "bh_unmatched_close", - "bh_unmatched_content", + "bh_c_define", + "bh_c_define_center", + "bh_c_define_open", + "bh_c_define_close", + "bh_c_define_content", "bh_default", "bh_default_center", "bh_default_open", "bh_default_close", "bh_default_content", - "bh_square", - "bh_square_center", - "bh_square_open", - "bh_square_close", - "bh_square_content", - "bh_curly", - "bh_curly_center", - "bh_curly_open", - "bh_curly_close", - "bh_curly_content" + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_round_content", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_unmatched_content" ], - "syntax": "Packages/Python/Python.sublime-syntax", - "tab_size": 4, - "translate_tabs_to_spaces": true + "syntax": "Packages/Python/Python.sublime-syntax" }, "translation.x": 0.0, - "translation.y": 624.0, + "translation.y": 2947.0, "zoom_level": 1.0 }, - "stack_index": 0, + "stack_index": 3, "type": "text" }, { - "buffer": 2, - "file": "/home/adrian/.config/sublime-text-3/Packages/Anaconda/Anaconda.sublime-settings", + "buffer": 4, + "file": "src/install.py", "semi_transient": false, "settings": { - "buffer_size": 21782, + "buffer_size": 688, "regions": { }, "selection": [ [ - 8619, - 8619 + 328, + 328 ] ], "settings": { + "auto_complete_triggers": + [ + { + "characters": ".>:", + "selector": "source.c++ - string - comment - constant.numeric" + }, + { + "characters": ".>:", + "selector": "source.c - string - comment - constant.numeric" + }, + { + "characters": ".>: ", + "selector": "source.objc++ - string - comment - constant.numeric" + }, + { + "characters": ".>: ", + "selector": "source.objc - string - comment - constant.numeric" + }, + { + "characters": ".>: ", + "selector": "source.cuda-c++ - string - comment - constant.numeric" + }, + { + "characters": ".", + "selector": "source.python - string - comment - constant.numeric" + } + ], "bracket_highlighter.busy": false, "bracket_highlighter.clone": -1, "bracket_highlighter.clone_locations": { "close": { + "1": + [ + 437, + 440 + ] }, "icon": { + "1": + [ + "Packages/BracketHighlighter/icons/double_quote.png", + "region.greenish" + ] }, "open": { + "1": + [ + 341, + 344 + ] }, "unmatched": { @@ -1478,16 +2143,11 @@ }, "bracket_highlighter.clone_regions": [ - "bh_c_define", - "bh_c_define_center", - "bh_c_define_open", - "bh_c_define_close", - "bh_c_define_content", - "bh_angle", - "bh_angle_center", - "bh_angle_open", - "bh_angle_close", - "bh_angle_content", + "bh_default", + "bh_default_center", + "bh_default_open", + "bh_default_close", + "bh_default_content", "bh_round", "bh_round_center", "bh_round_open", @@ -1498,41 +2158,46 @@ "bh_double_quote_open", "bh_double_quote_close", "bh_double_quote_content", - "bh_tag", - "bh_tag_center", - "bh_tag_open", - "bh_tag_close", - "bh_tag_content", + "bh_c_define", + "bh_c_define_center", + "bh_c_define_open", + "bh_c_define_close", + "bh_c_define_content", "bh_regex", "bh_regex_center", "bh_regex_open", "bh_regex_close", "bh_regex_content", - "bh_single_quote", - "bh_single_quote_center", - "bh_single_quote_open", - "bh_single_quote_close", - "bh_single_quote_content", - "bh_unmatched", - "bh_unmatched_center", - "bh_unmatched_open", - "bh_unmatched_close", - "bh_unmatched_content", - "bh_default", - "bh_default_center", - "bh_default_open", - "bh_default_close", - "bh_default_content", + "bh_curly", + "bh_curly_center", + "bh_curly_open", + "bh_curly_close", + "bh_curly_content", "bh_square", "bh_square_center", "bh_square_open", "bh_square_close", "bh_square_content", - "bh_curly", - "bh_curly_center", - "bh_curly_open", - "bh_curly_close", - "bh_curly_content" + "bh_angle", + "bh_angle_center", + "bh_angle_open", + "bh_angle_close", + "bh_angle_content", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_unmatched_content", + "bh_single_quote", + "bh_single_quote_center", + "bh_single_quote_open", + "bh_single_quote_close", + "bh_single_quote_content", + "bh_tag", + "bh_tag_center", + "bh_tag_open", + "bh_tag_close", + "bh_tag_content" ], "bracket_highlighter.locations": { @@ -1540,24 +2205,24 @@ { "1": [ - 8618, - 8619 + 327, + 328 ] }, "icon": { "1": [ - "Packages/BracketHighlighter/icons/double_quote.png", - "region.greenish" + "Packages/BracketHighlighter/icons/round_bracket.png", + "region.yellowish" ] }, "open": { "1": [ - 8613, - 8614 + 320, + 321 ] }, "unmatched": @@ -1566,71 +2231,160 @@ }, "bracket_highlighter.regions": [ - "bh_c_define", - "bh_c_define_center", - "bh_c_define_open", - "bh_c_define_close", - "bh_c_define_content", "bh_angle", "bh_angle_center", "bh_angle_open", "bh_angle_close", "bh_angle_content", - "bh_round", - "bh_round_center", - "bh_round_open", - "bh_round_close", - "bh_round_content", + "bh_single_quote", + "bh_single_quote_center", + "bh_single_quote_open", + "bh_single_quote_close", + "bh_single_quote_content", + "bh_square", + "bh_square_center", + "bh_square_open", + "bh_square_close", + "bh_square_content", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_regex_content", "bh_double_quote", "bh_double_quote_center", "bh_double_quote_open", "bh_double_quote_close", "bh_double_quote_content", + "bh_curly", + "bh_curly_center", + "bh_curly_open", + "bh_curly_close", + "bh_curly_content", "bh_tag", "bh_tag_center", "bh_tag_open", "bh_tag_close", "bh_tag_content", - "bh_regex", - "bh_regex_center", - "bh_regex_open", - "bh_regex_close", - "bh_regex_content", - "bh_single_quote", - "bh_single_quote_center", - "bh_single_quote_open", - "bh_single_quote_close", - "bh_single_quote_content", - "bh_unmatched", - "bh_unmatched_center", - "bh_unmatched_open", - "bh_unmatched_close", - "bh_unmatched_content", + "bh_c_define", + "bh_c_define_center", + "bh_c_define_open", + "bh_c_define_close", + "bh_c_define_content", "bh_default", "bh_default_center", "bh_default_open", "bh_default_close", "bh_default_content", - "bh_square", - "bh_square_center", - "bh_square_open", - "bh_square_close", - "bh_square_content", - "bh_curly", - "bh_curly_center", - "bh_curly_open", - "bh_curly_close", - "bh_curly_content" + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_round_content", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_unmatched_content" ], - "syntax": "Packages/JavaScript/JSON.sublime-syntax", - "tab_size": 4, - "translate_tabs_to_spaces": true + "syntax": "Packages/Python/Python.sublime-syntax" }, "translation.x": 0.0, - "translation.y": 5826.0, + "translation.y": 0.0, "zoom_level": 1.0 }, - "stack_index": 1, + "stack_index": 4, + "type": "text" + } + ] + }, + { + "selected": 0, + "sheets": + [ + { + "buffer": 5, + "semi_transient": false, + "settings": + { + "buffer_size": 963, + "regions": + { + }, + "selection": + [ + [ + 963, + 963 + ] + ], + "settings": + { + "__vi_external_disable": true, + "auto_complete": false, + "auto_complete_commit_on_tab": false, + "bracket_highlighter.busy": false, + "bracket_highlighter.clone": -1, + "bracket_highlighter.clone_locations": + { + }, + "bracket_highlighter.ignore": true, + "color_scheme": "Terminus.sublime-color-scheme", + "default_dir": "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src", + "draw_centered": false, + "draw_indent_guides": false, + "draw_unicode_white_space": false, + "draw_white_space": "none", + "gutter": false, + "highlight_line": false, + "is_widget": true, + "result_base_dir": "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src", + "result_file_regex": null, + "result_line_regex": null, + "scroll_past_end": true, + "syntax": "Packages/Text/Plain text.tmLanguage", + "terminus.highlight_counter": 52, + "terminus_view": true, + "terminus_view.args": + { + "auto_close": true, + "cancellable": false, + "cmd": + [ + "/usr/bin/bash", + "-i", + "-l" + ], + "config_name": "Login Shell", + "cwd": "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src", + "env": + { + "LANG": "en_US.UTF-8", + "TERM": "linux", + "TERMINUS_SUBLIME": "1", + "TERM_PROGRAM": "Terminus-Sublime" + }, + "file_regex": null, + "line_regex": null, + "panel_name": null, + "tag": null, + "timeit": false, + "title": null + }, + "terminus_view.cancellable": false, + "terminus_view.key.ctrl+k": true, + "terminus_view.key.ctrl+p": true, + "terminus_view.natural_keyboard": true, + "terminus_view.panel_name": null, + "terminus_view.tag": null, + "terminus_view.viewport_y": 0.0, + "word_wrap": false + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 2, "type": "text" } ] @@ -1638,7 +2392,7 @@ ], "incremental_find": { - "height": 38.0 + "height": 36.0 }, "input": { @@ -1653,11 +2407,18 @@ 0, 1, 1 + ], + [ + 1, + 0, + 2, + 1 ] ], "cols": [ 0.0, + 0.601688639323, 1.0 ], "rows": @@ -1667,6 +2428,10 @@ ] }, "menu_visible": true, + "output.Terminus": + { + "height": 181.0 + }, "output.astyle_error_message": { "height": 0.0 @@ -1699,7 +2464,7 @@ "project": "cool-comp.sublime-project", "replace": { - "height": 72.0 + "height": 68.0 }, "save_all_on_build": true, "select_file": @@ -1736,7 +2501,7 @@ "show_minimap": true, "show_open_files": true, "show_tabs": true, - "side_bar_visible": true, + "side_bar_visible": false, "side_bar_width": 261.0, "status_bar_visible": true, "template_settings": diff --git a/src/.builds b/src/.builds index 98fb6a68..d3d17122 100644 --- a/src/.builds +++ b/src/.builds @@ -2,3 +2,9 @@ 1 1 1 +1 +1 +1 +1 +1 +1 diff --git a/src/comments.py b/src/comments.py new file mode 100644 index 00000000..0be04796 --- /dev/null +++ b/src/comments.py @@ -0,0 +1,85 @@ +''' +Process a source file removing coments. +Because coments in COOL can be nested, there is +no regular expresion to represet them, so we have +to preprocess the file and strip them out. +''' + + +def find_comments(program: str) -> str: + ''' + This functions detects every comment in a Cool program\ + and replace it with empty lines. This is done in a way\ + so is posible for the other components of the\ + compiler to correctly detect errors on exact Line and\ + Column.\ + In Cool a comment can be of the form (*...*) or -- ending\ + with a newline. Comments can be nested, so there is no regular\ + expression to detect them. + ''' + pairs = [] + stack = [] + line = 1 + column = 1 + program = list(program) + iter_char = iter(enumerate(program)) + while 1: + try: + i, char = next(iter_char) + column += 1 + if char == '\n': + line += 1 + column = 1 + elif char == '(': + i, char = next(iter_char) + column += 1 + if char == '*': + stack.append(i - 1) + elif char == '\n': + line += 1 + column = 1 + elif char == '*': + i, char = next(iter_char) + column += 1 + if char == ')': + first = stack.pop() + pairs.append((first, i)) + elif char == '\n': + line += 1 + column = 1 + except StopIteration: + break + assert not stack, "(%d, %d) - LexicographicError: EOF in comment" % ( + line, column) + iter_char = iter(enumerate(program)) + column = 1 + line = 1 + while 1: + try: + i, char = next(iter_char) + column += 1 + if char == '-': + i, char = next(iter_char) + column += 1 + if char == '-': + stack.append(i - 1) + elif char == '\n': + if stack: + first = stack.pop() + pairs.append((first, i)) + column = 1 + line += 1 + elif char == '\n': + if stack: + first = stack.pop() + pairs.append((first, i)) + column = 1 + line += 1 + except StopIteration: + break + while pairs: + i, j = pairs.pop() + for k in range(i, j + 1): + if not program[k] == '\n': + program[k] = ' ' + return ''.join(program) diff --git a/src/coolc.sh b/src/coolc.sh index cd6002f7..d838e21f 100755 --- a/src/coolc.sh +++ b/src/coolc.sh @@ -12,3 +12,4 @@ echo "Copyright (c) 2020 School of Math and Computer Science, University of Hava echo "Authors: Eliane Puerta, Adrian Gonzalez, Liset Alfaro" # Llamar al compilador echo "Compiling $INPUT_FILE into $OUTPUT_FILE" +python3 pycoolc.py $INPUT_FILE diff --git a/src/install.py b/src/install.py index 61e777ae..a313d994 100644 --- a/src/install.py +++ b/src/install.py @@ -9,15 +9,13 @@ def generate_py(f): parser = LALRParser(gram, verbose=True) lexer_str = cloudpickle.dumps(lexer) parser_str = cloudpickle.dumps(parser) - f.write( -""" + f.write(""" import cloudpickle import sys sys.path.append('..') PARSER = cloudpickle.loads(%s) LEXER = cloudpickle.loads(%s) -""" - % (parser_str, lexer_str)) +""" % (parser_str, lexer_str)) if __name__ == '__main__': diff --git a/src/makefile b/src/makefile index 7abcd550..e51b3ea8 100644 --- a/src/makefile +++ b/src/makefile @@ -23,10 +23,11 @@ COMPSTRUCTFILE=compiler_struct.py PIPREQUIREMENTS=cloudpickle pyinstaller main: - @# Compiling the compiler :) - $(PIP) install --user $(PIPREQUIREMENTS) - $(PYTHON) install.py build/$(COMPSTRUCTFILE) - @# account the numbers of builds + @echo "[*] Installing python dependencies" + @$(PIP) install --user $(PIPREQUIREMENTS) + @echo "[*] Compiling Cool Lexical structures" + @$(PYTHON) install.py build/$(COMPSTRUCTFILE) + @touch build/__init__.py @echo 1 >> .builds clean: diff --git a/src/parserr/lr.py b/src/parserr/lr.py index 442e45c4..467112d4 100755 --- a/src/parserr/lr.py +++ b/src/parserr/lr.py @@ -1,4 +1,3 @@ -#%% from grammar.items import Item from tools.firsts import ContainerSet from automatons.state import State @@ -19,8 +18,10 @@ def expand(item, firsts): lookaheads.update(ContainerSet(lookahead)) assert not lookaheads.contains_epsilon - expanded = [Item(production, 0, lookaheads) - for production in next_symbol.productions] + expanded = [ + Item(production, 0, lookaheads) + for production in next_symbol.productions + ] return expanded @@ -35,7 +36,10 @@ def compress(items): centers[center] = lookaheads = set() lookaheads.update(item.lookaheads) - return {Item(x.production, x.pos, set(lookahead)) for x, lookahead in centers.items()} + return { + Item(x.production, x.pos, set(lookahead)) + for x, lookahead in centers.items() + } def closure_lr1(items, firsts): @@ -57,8 +61,8 @@ def closure_lr1(items, firsts): def goto_lr1(items, symbol, firsts=None, just_kernel=False): assert just_kernel or firsts is not None, '`firsts` must be provided if `just_kernel=False`' - items = frozenset(item.next_item() - for item in items if item.NextSymbol == symbol) + items = frozenset(item.next_item() for item in items + if item.NextSymbol == symbol) return items if just_kernel else closure_lr1(items, firsts) @@ -69,7 +73,7 @@ def build_LR1_automaton(G): firsts[G.EOF] = ContainerSet(G.EOF) start_production = G.startSymbol.productions[0] - start_item = Item(start_production, 0, lookaheads=(G.EOF,)) + start_item = Item(start_production, 0, lookaheads=(G.EOF, )) start = frozenset([start_item]) closure = closure_lr1(start, firsts) @@ -99,7 +103,6 @@ def build_LR1_automaton(G): def build_lalr_automaton(G): - def centers(items: [Item]): return frozenset(item.Center() for item in items) @@ -114,7 +117,7 @@ def subset(items1, items2): firsts[G.EOF] = ContainerSet(G.EOF) start_production = G.startSymbol.productions[0] - start_item = Item(start_production, 0, (G.EOF,)) + start_item = Item(start_production, 0, (G.EOF, )) start = State((closure_lr1(start_item, firsts)), True) @@ -127,14 +130,15 @@ def subset(items1, items2): # print('ss') current_state = visited[pending.pop()] for symbol in G.terminals + G.nonTerminals: - next_item = frozenset( - goto_lr1(current_state.state, symbol, firsts)) + next_item = frozenset(goto_lr1(current_state.state, symbol, + firsts)) if next_item: # Caso en que pueda mezclar el nuevo item try: next_state = visisted_centers[centers(next_item)] - if not subset(lookaheads(next_item), lookaheads(next_state.state)): + if not subset(lookaheads(next_item), + lookaheads(next_state.state)): next_state.state = compress( list(next_state.state) + list(next_item)) pending.append(frozenset(next_state.state)) @@ -162,23 +166,23 @@ def _build_parsing_table(self): for item in node.state: if item.IsReduceItem: if item.production.Left == self.G.startSymbol: - self._register( - self.action, (idx, self.G.EOF), ('OK', item.production)) + self._register(self.action, (idx, self.G.EOF), + ('OK', item.production)) else: for lookahead in item.lookaheads: - self._register( - self.action, (idx, lookahead), ('REDUCE', item.production)) + self._register(self.action, (idx, lookahead), + ('REDUCE', item.production)) else: next_symbol = item.NextSymbol try: if next_symbol.IsNonTerminal: next_state = node.transitions[next_symbol.Name][0] - self._register( - self.goto, (idx, next_symbol), next_state.idx) + self._register(self.goto, (idx, next_symbol), + next_state.idx) else: next_state = node.transitions[next_symbol.Name][0] - self._register( - self.action, (idx, next_symbol), ('SHIFT', next_state.idx)) + self._register(self.action, (idx, next_symbol), + ('SHIFT', next_state.idx)) except KeyError: pass @@ -187,7 +191,8 @@ def _register(table, key, value): # assert key not in table or table[key] == value, f'Shift-Reduce or Reduce-Reduce conflict!!!\n tried to put {value} in {key} already exist with value {table[key]}' if not (key not in table or table[key] == value): print( - f'Shift-Reduce or Reduce-Reduce conflict!!!\n tried to put {value} in {key} already exist with value {table[key]}') + f'Shift-Reduce or Reduce-Reduce conflict!!!\n tried to put {value} in {key} already exist with value {table[key]}' + ) print(table) assert False table[key] = value diff --git a/src/pycoolc.py b/src/pycoolc.py new file mode 100644 index 00000000..060bc23d --- /dev/null +++ b/src/pycoolc.py @@ -0,0 +1,36 @@ +from build.compiler_struct import LEXER, PARSER +from comments import find_comments +from argparse import ArgumentParser +import sys + + +def pipeline(program: str) -> None: + try: + program = find_comments(program) + except AssertionError as e: + print(e) + sys.exit(1) + + # Right now, program has no comments, so is safe to pass it to the LEXER + try: + tokens = LEXER(program) + except Exception as e: + print(e) + sys.exit(1) + + # Parse the tokens to obtain a derivation tree + try: + parse = PARSER(tokens) + except Exception as e: + print(e) + sys.exit(1) + + +if __name__ == '__main__': + parser = ArgumentParser() + parser.add_argument('file', type=str) + args = parser.parse_args() + with open(args.file, "r") as f: + program = f.read() + pipeline(program) + sys.exit(0) From 606586c29ca6380916ddcc1c225912cfb8593ae4 Mon Sep 17 00:00:00 2001 From: Adrian Date: Mon, 17 Feb 2020 13:29:33 -0500 Subject: [PATCH 005/162] "Passes first 4 Lexer tests" --- src/.builds | 2 + src/coolc.sh | 1 + src/coolgrammar/grammar.py | 80 ++++++++++++-------------------------- src/install.py | 3 ++ src/lexer/tokenizer.py | 10 ++--- 5 files changed, 34 insertions(+), 62 deletions(-) diff --git a/src/.builds b/src/.builds index d3d17122..4dff9ef3 100644 --- a/src/.builds +++ b/src/.builds @@ -8,3 +8,5 @@ 1 1 1 +1 +1 diff --git a/src/coolc.sh b/src/coolc.sh index d838e21f..02340a2e 100755 --- a/src/coolc.sh +++ b/src/coolc.sh @@ -1,3 +1,4 @@ +#!/bin/bash # Incluya aquí las instrucciones necesarias para ejecutar su compilador INPUT_FILE=$1 diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index ac91a61c..a5d69ade 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -48,7 +48,7 @@ def build_cool_grammar(): 'if then else assign new case of esac') gt, lt, ge, le, eq, not_, implies, isvoid = G.Terminals( - '> < >= <= == ! => isvoid') + '> < >= <= == ~ => isvoid') while_, do, inherits, arroba, fi, pool, loop = G.Terminals( 'while do inherits @ fi pool loop') @@ -186,9 +186,8 @@ def build_cool_grammar(): factor %= idx, lambda s: VariableCall(s[1]) - factor %= factor + period + idx + opar + args_list_empty + cpar, lambda s: FunCall(s[1], - s[3], - s[5]) + factor %= factor + period + idx + opar + args_list_empty + cpar, lambda s: FunCall( + s[1], s[3], s[5]) factor %= idx + opar + args_list_empty + \ cpar, lambda s: FunCall('self', s[1], s[3]) @@ -240,58 +239,27 @@ def build_cool_grammar(): case_statement %= case + exp + of + actions + \ esac, lambda s: CaseNode(s[2], s[4]) - table = [(class_keyword, 'class'), - (def_keyword, 'def'), - (in_keyword, 'in'), - (intx, 'int'), - (boolean, 'bool'), - (objectx, 'object'), - (string, 'string'), - (true, ' true'), - (false, 'false'), - (auto, 'AUTO_TYPE'), - (if_, 'if'), - (then, 'then'), - (else_, 'else'), - (new, 'new'), - (while_, 'while'), - (do, 'do'), - (esac, 'esac'), - (case, 'case'), - (of, 'of'), - (inherits, 'inherits'), - (coma, ','), - (period, '.'), - (dd, ':'), - (dot_comma, ';'), - (arroba, '@'), - (assign, r'<\-'), - (lt, r'\<'), - (gt, r'\>'), - (ge, '>='), - (le, '<='), - (eq, '=='), - (not_, r'\!'), - (equal, '='), - (opar, r'\('), - (cpar, r'\)'), - (obrack, r'\{'), - (cbrack, r'\}'), - (plus, r'\+'), - (minus, r'\-'), - (implies, r'=>'), - (div, '/'), - (star, r'\*'), - (let, 'let'), - (fi, 'fi'), - (pool, 'pool'), - (loop, 'loop'), - (isvoid, 'isvoid'), - (idx, '(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N|n|O|o|P|p|' + - 'Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|_)+'), - (num, '0|(1|2|3|4|5|6|7|8|9)(1|2|3|4|5|6|7|8|9|0)*'), - (string_const, r"\"(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N" + - r"|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|\ )+\"")] + table = [ + (class_keyword, 'class'), (def_keyword, 'def'), (in_keyword, 'in'), + (intx, 'int'), (boolean, 'bool'), (objectx, 'object'), + (string, 'string'), (true, ' true'), (false, 'false'), + (auto, 'AUTO_TYPE'), (if_, 'if'), (then, 'then'), (else_, 'else'), + (new, 'new'), (while_, 'while'), (do, 'do'), (esac, 'esac'), + (case, 'case'), (of, 'of'), (inherits, 'inherits'), (coma, ','), + (period, '.'), (dd, ':'), (dot_comma, ';'), (arroba, '@'), + (assign, r'<\-'), (lt, r'\<'), (gt, r'\>'), (ge, '>='), (le, '<='), + (eq, '=='), (not_, r'\~'), (equal, '='), (opar, r'\('), (cpar, r'\)'), + (obrack, r'\{'), (cbrack, r'\}'), (plus, r'\+'), (minus, r'\-'), + (implies, r'=>'), (div, '/'), (star, r'\*'), (let, 'let'), (fi, 'fi'), + (pool, 'pool'), (loop, 'loop'), (isvoid, 'isvoid'), + (idx, + '(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N|n|O|o|P|p|' + + 'Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|_)+'), + (num, '(1|2|3|4|5|6|7|8|9|0)+'), + (string_const, + r"\"(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N" + + r"|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|\ )+\"") + ] lexer = Lexer(table, G.EOF, ignore_white_space=False) return G, lexer diff --git a/src/install.py b/src/install.py index a313d994..7441196b 100644 --- a/src/install.py +++ b/src/install.py @@ -2,6 +2,9 @@ from coolgrammar.grammar import build_cool_grammar from parserr.lr import LALRParser from argparse import ArgumentParser +from setuptools import setup +from distutils.extension import Extension +from Cython.Distutils import build_ext def generate_py(f): diff --git a/src/lexer/tokenizer.py b/src/lexer/tokenizer.py index 6d27b209..7c1852f3 100755 --- a/src/lexer/tokenizer.py +++ b/src/lexer/tokenizer.py @@ -7,13 +7,11 @@ class TokenLine(Token): ''' Clase para representar el token constante de cambio de Linea ''' - def __init__(self): super().__init__('\n', 'Line') class Lexer: - """ El generador de lexer se basa en un conjunto de expresiones regulares. Cada una de ellas está asociada a un tipo de token. @@ -31,7 +29,6 @@ class Lexer: estado final. - Al finalizar de consumir toda la cadena, se reporta el token de fin de cadena. """ - def __init__(self, table, eof, ignore_white_space=False): self.eof = eof self.regexs = self._build_regexs(table, ignore_white_space) @@ -103,9 +100,9 @@ def _tokenize(self, text): string = text final, lex = self._walk(string) if lex == '': - print(text) raise SyntaxError( - f'Invalid token in line: {self.line} column: {self.column}') + f'({self.line},{self.column}) LexicographicError: ERROR "{string[0]}"' + ) if final: n = 2**64 token_type = None @@ -121,7 +118,8 @@ def _tokenize(self, text): text = string[len(lex):] else: raise SyntaxError( - f'Invalid token in line: {self.line} column: {self.column}') + f'({self.line},{self.column}) LexicographicError: ERROR "{string[:len(lex)]}"' + ) yield '$', self.eof From e8ea7bf52045cd10311fe2199ae550a8eb340f3c Mon Sep 17 00:00:00 2001 From: Adrian Date: Mon, 17 Feb 2020 15:23:49 -0500 Subject: [PATCH 006/162] "Tunning makefile" --- src/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/makefile b/src/makefile index e51b3ea8..df4864ec 100644 --- a/src/makefile +++ b/src/makefile @@ -1,7 +1,7 @@ # Find a python3 version on the System ifndef PYTHON PYTHON:=$(shell if which python3 > "/dev/null" 2>&1; \ - then echo "python3"; \ + then python3 "echo"; \ else \ echo "No python3 on system Path"; \ exit 1; \ From 9074018b147f7ec680526722dc1f453bd3d09f4b Mon Sep 17 00:00:00 2001 From: Adrian Date: Thu, 20 Feb 2020 23:35:48 -0500 Subject: [PATCH 007/162] * src/makefile: Lexer passed tests. So LEXER DONE? --- src/.builds | 48 ++++++++++++++++++++++++ src/coolc.sh | 5 +-- src/coolgrammar/grammar.py | 19 ++++++---- src/lexer/regexgenerator.py | 31 ++++++++-------- src/lexer/tokenizer.py | 52 ++++++++++++++++++++------ src/makefile | 2 +- src/pycoolc.py | 2 +- src/testing.py | 73 +++++++++++++++++++++++++++++++------ 8 files changed, 180 insertions(+), 52 deletions(-) diff --git a/src/.builds b/src/.builds index 4dff9ef3..3d331db9 100644 --- a/src/.builds +++ b/src/.builds @@ -10,3 +10,51 @@ 1 1 1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 diff --git a/src/coolc.sh b/src/coolc.sh index 02340a2e..383f63ad 100755 --- a/src/coolc.sh +++ b/src/coolc.sh @@ -8,9 +8,8 @@ BUILD=$(wc -l .builds | awk '{ print $1 }') # Si su compilador no lo hace ya, aquí puede imprimir la información de contacto echo "pycoolc: version $VERSION" # TODO: Recuerde cambiar estas -echo "Build: $BUILD" +# echo "Build: $BUILD" echo "Copyright (c) 2020 School of Math and Computer Science, University of Havana" # TODO: líneas a los valores correctos -echo "Authors: Eliane Puerta, Adrian Gonzalez, Liset Alfaro" +#echo "Authors: Eliane Puerta, Adrian Gonzalez, Liset Alfaro" # Llamar al compilador -echo "Compiling $INPUT_FILE into $OUTPUT_FILE" python3 pycoolc.py $INPUT_FILE diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index a5d69ade..d54b9594 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -239,6 +239,10 @@ def build_cool_grammar(): case_statement %= case + exp + of + actions + \ esac, lambda s: CaseNode(s[2], s[4]) + scaped_chars = r"(\a)|(\b)|(\c)|(\d)|(\e)|(\f)|(\g)|(\h)|(\i)|(\j)" +\ + r"|(\k)|(\l)|(\m)|(\n)|(\o)|(\p)|(\q)|(\r)|(\s)|(\t)|(\u)|(\v)|(\x)|(\y)|(\z)" +\ + r'|(!\")' + r"|(!\')" + table = [ (class_keyword, 'class'), (def_keyword, 'def'), (in_keyword, 'in'), (intx, 'int'), (boolean, 'bool'), (objectx, 'object'), @@ -247,18 +251,19 @@ def build_cool_grammar(): (new, 'new'), (while_, 'while'), (do, 'do'), (esac, 'esac'), (case, 'case'), (of, 'of'), (inherits, 'inherits'), (coma, ','), (period, '.'), (dd, ':'), (dot_comma, ';'), (arroba, '@'), - (assign, r'<\-'), (lt, r'\<'), (gt, r'\>'), (ge, '>='), (le, '<='), - (eq, '=='), (not_, r'\~'), (equal, '='), (opar, r'\('), (cpar, r'\)'), - (obrack, r'\{'), (cbrack, r'\}'), (plus, r'\+'), (minus, r'\-'), - (implies, r'=>'), (div, '/'), (star, r'\*'), (let, 'let'), (fi, 'fi'), + (assign, r''), (ge, '>='), (le, '<='), + (eq, '=='), (not_, r'!~'), (equal, '='), (opar, r'!('), (cpar, r'!)'), + (obrack, r'!{'), (cbrack, r'!}'), (plus, r'!+'), (minus, r'!-'), + (implies, r'=>'), (div, '/'), (star, r'!*'), (let, 'let'), (fi, 'fi'), (pool, 'pool'), (loop, 'loop'), (isvoid, 'isvoid'), (idx, '(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N|n|O|o|P|p|' + - 'Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|_)+'), + 'Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z)(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N|n|O|o|P|p|' + + 'Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|_)*'), (num, '(1|2|3|4|5|6|7|8|9|0)+'), (string_const, - r"\"(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N" + - r"|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|\ )+\"") + r'"(1|2|3|4|5|6|7|8|9|0|A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N' + + r'|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|! |' + scaped_chars + ')*"') ] lexer = Lexer(table, G.EOF, ignore_white_space=False) diff --git a/src/lexer/regexgenerator.py b/src/lexer/regexgenerator.py index 16fee798..843cac29 100755 --- a/src/lexer/regexgenerator.py +++ b/src/lexer/regexgenerator.py @@ -1,11 +1,8 @@ #%% from baseNodeTree.base import Node, AtomicNode, UnaryNode, BinaryNode from automatons.nondeterministic import NFA -from automatons.operations import ( - automata_union, - automata_concatenation, - automata_closure -) +from automatons.operations import (automata_union, automata_concatenation, + automata_closure) from automatons.transformation import nfa_to_deterministic from grammar.grammar import Grammar from lexer.tokens import Token @@ -84,11 +81,12 @@ class QuestionNode(UnaryNode): @staticmethod def operate(value): return automata_union(value, EpsilonNode('').evaluate()) + + #%% class Regex(object): - def __init__(self, regex, ignore_white_space=True): self.regex = regex self.G = Grammar() @@ -115,26 +113,27 @@ def __init__(self, regex, ignore_white_space=True): self.automaton = self._build_automaton(regex, ignore_white_space) def _build_automaton(self, regex, ignore_white_space): - def regex_tokenizer(regex, ignore_white_space): d = {term.Name: term for term in self.G.terminals} tokens = [] symbol_term = [ - term for term in self.G.terminals if term.Name == 'symbol'][0] - fixed_tokens = {tok.Name: Token(tok.Name, tok) - for tok in [d['|'], d['*'], - d['+'], d['?'], - d['('], d[')'], - d['['], d[']'], - d['-'], d['ε']]} + term for term in self.G.terminals if term.Name == 'symbol' + ][0] + fixed_tokens = { + tok.Name: Token(tok.Name, tok) + for tok in [ + d['|'], d['*'], d['+'], d['?'], d['('], d[')'], d['['], + d[']'], d['-'], d['ε'] + ] + } for i, c in enumerate(regex): - if c == "\\" or \ + if c == "!" or \ (ignore_white_space and c.isspace()): continue try: token = fixed_tokens[c] - if regex[i - 1] == '\\': + if regex[i - 1] == '!': raise KeyError except KeyError: token = Token(c, symbol_term) diff --git a/src/lexer/tokenizer.py b/src/lexer/tokenizer.py index 7c1852f3..c60b7c17 100755 --- a/src/lexer/tokenizer.py +++ b/src/lexer/tokenizer.py @@ -1,6 +1,7 @@ from automatons.state import State from lexer.regexgenerator import Regex from lexer.tokens import Token +from grammar.grammar import Terminal class TokenLine(Token): @@ -39,6 +40,7 @@ def __init__(self, table, eof, ignore_white_space=False): def _build_regexs(self, table, ignore_white_space): regexs = [] + # fixed blank tokens fixed_line_token = Regex('\n', ignore_white_space=False) fixed_space_token = Regex(' ', ignore_white_space=False) @@ -80,11 +82,31 @@ def _walk(self, string): final = state if state.final else None lex = '' suffix = '' + continues = 0 - for symbol in string: + for i, symbol in enumerate(string): + # handle special character for regex !: + if symbol == '!' and suffix and suffix[0] == '"': + suffix += symbol + self.column += 1 + continue + if symbol == '\\': + if suffix and suffix[0] == '"' and i < len( + string) - 1 and string[i + 1] not in ('n', '"'): + self.column += 1 + continues += 1 + continue + # Handle spcial case with a newline in a string + if symbol == '\n' and suffix and suffix[0] == '"': + if string[i - 1] == '\\': + self.column = 1 + self.line += 1 + continues += 1 + continue next_state = state.transitions.get(symbol, None) if next_state: suffix += symbol + self.column += 1 state = next_state[0] if state.final: lex += suffix @@ -93,16 +115,12 @@ def _walk(self, string): else: break - return final, lex + return final, lex, suffix, continues def _tokenize(self, text): while text: string = text - final, lex = self._walk(string) - if lex == '': - raise SyntaxError( - f'({self.line},{self.column}) LexicographicError: ERROR "{string[0]}"' - ) + final, lex, suffix, continues = self._walk(string) if final: n = 2**64 token_type = None @@ -114,12 +132,21 @@ def _tokenize(self, text): token_type = tt except TypeError: pass + # suffix contains characters that didnt match + # so they would be count twice. We must substract + # them from column + self.column -= (len(suffix) + continues) yield lex, token_type - text = string[len(lex):] + text = string[len(lex) + continues:] else: + if len(text) == len(suffix) + continues and suffix[0] == '"': + raise SyntaxError( + f'({self.line},{self.column}) - LexicographicError: String contains EOF' + ) + #self.column += len(suffix) raise SyntaxError( - f'({self.line},{self.column}) LexicographicError: ERROR "{string[:len(lex)]}"' - ) + f'({self.line},{self.column}) - LexicographicError: ERROR "%r"' + % text[len(suffix) + continues]) yield '$', self.eof @@ -130,10 +157,11 @@ def __call__(self, text: str): self.line += 1 self.column = 1 elif isinstance(ttype, str) and ttype == 'Space': - self.column += 1 + #self.column += 1 + pass else: tok = Token(lex, ttype, self.column, self.line) tokens.append(tok) - self.column += len(lex) + #self.column += len(lex) return tokens diff --git a/src/makefile b/src/makefile index df4864ec..e51b3ea8 100644 --- a/src/makefile +++ b/src/makefile @@ -1,7 +1,7 @@ # Find a python3 version on the System ifndef PYTHON PYTHON:=$(shell if which python3 > "/dev/null" 2>&1; \ - then python3 "echo"; \ + then echo "python3"; \ else \ echo "No python3 on system Path"; \ exit 1; \ diff --git a/src/pycoolc.py b/src/pycoolc.py index 060bc23d..4f02c11b 100644 --- a/src/pycoolc.py +++ b/src/pycoolc.py @@ -13,7 +13,7 @@ def pipeline(program: str) -> None: # Right now, program has no comments, so is safe to pass it to the LEXER try: - tokens = LEXER(program) + tokens = LEXER(r"%s" % program) except Exception as e: print(e) sys.exit(1) diff --git a/src/testing.py b/src/testing.py index 42dcc507..f94732a9 100755 --- a/src/testing.py +++ b/src/testing.py @@ -3,11 +3,57 @@ from parserr.lr import LALRParser from parserr.shiftreduce import ShiftReduceParser import cloudpickle +from comments import find_comments GRAMMAR, LEXER = grammar.build_cool_grammar() -PARSER = LALRParser(GRAMMAR, verbose=True) +#PARSER = LALRParser(GRAMMAR, verbose=True) +TEST = r""" -SIMPLE_PROGRAM = """ +"This \ +is OK" +"This is not +OK" +""" + +string2 = r""" +" May the Triforce \ + 0 \ + 0v0 \ + 0vvv0 \ + 0vvvvv0 \ + 0vvvvvvv0 \ + 0vvvvvvvvv0 \ + 0vvvvvvvvvvv0 \ + 000000000000000 \ + 0v0 0v0 \ + 0vvv0 0vvv0 \ + 0vvvvv0 0vvvvv0 \ + 0vvvvvvv0 0vvvvvvv0 \ + 0vvvvvvvvv0 0vvvvvvvvv0 \ + 0vvvvvvvvvvv0 0vvvvvvvvvvv0 \ + 00000000000000000000000000000 \ + be with you!""" + +TEST_PROGRAM = r""" +"lkjdsafkljdsalfj\u0000dsafdsaf\u0000djafslkjdsalf\nsdajf\" lkjfdsasdkjfl"123 +adsfasklj# +LKldsajf iNhERITS +"lkdsajf" + +(* +#1 STR_CONST "lkjdsafkljdsalfju0000dsafdsafu0000djafslkjdsalf\nsdajf\" lkjfdsasdkjfl" +#1 INT_CONST 123 +#2 OBJECTID adsfasklj +#2 ERROR "#" +#3 TYPEID LKldsajf +#3 INHERITS +#4 STR_CONST "lkdsajf" +*) +""" + +SIMPLE_PROGRAM = r""" +"kjsafkljd\saa\aa" +"helloworld" class A inherits IO { attribute : int <- 10; @@ -51,17 +97,20 @@ class A inherits IO }; """ + +space_test = r"t t t t ?" # First Round of tests TOKS = None try: - TOKS = LEXER(SIMPLE_PROGRAM) - parse = PARSER(TOKS) - # Try to save the parser and then reuse it - # with open('.parser.dmp','wb') as file: - # cloudpickle.dump(PARSER, file) - - with open('.parser.dmp', 'rb') as file: - parser = cloudpickle.load(file) - print(parser(TOKS)) + program = find_comments(space_test) + TOKS = LEXER(program) + # parse = PARSER(TOKS) + # Try to save the parser and then reuse it + # with open('.parser.dmp','wb') as file: + # cloudpickle.dump(PARSER, file) + + #with open('.parser.dmp', 'rb') as file: + # parser = cloudpickle.load(file) + print(TOKS) except Exception as e: - print(e) + print(e) From 5f265f8d9d34185310bd950654a6dec21fea8efb Mon Sep 17 00:00:00 2001 From: Adrian Date: Fri, 21 Feb 2020 00:38:56 -0500 Subject: [PATCH 008/162] Added install function to makefile. --- src/.builds | 7 +++++++ src/coolc.sh | 8 +++----- src/install.py | 3 --- src/lexer/tokenizer.py | 5 ++--- src/makefile | 26 ++++++++++++++++++++++++-- 5 files changed, 36 insertions(+), 13 deletions(-) diff --git a/src/.builds b/src/.builds index 3d331db9..78eb8779 100644 --- a/src/.builds +++ b/src/.builds @@ -58,3 +58,10 @@ 1 1 1 +1 +1 +1 +1 +1 +1 +1 diff --git a/src/coolc.sh b/src/coolc.sh index 383f63ad..639ecc05 100755 --- a/src/coolc.sh +++ b/src/coolc.sh @@ -3,13 +3,11 @@ INPUT_FILE=$1 OUTPUT_FILE=${INPUT_FILE:0: -2}mips -VERSION=0.2 # Release, branch +VERSION=0.2 # Release, Minor BUILD=$(wc -l .builds | awk '{ print $1 }') # Si su compilador no lo hace ya, aquí puede imprimir la información de contacto -echo "pycoolc: version $VERSION" # TODO: Recuerde cambiar estas +echo "pycoolc: version $VERSION Developed by Eliane Puerta, Liset Alfaro, Adrian Gonzalez" # echo "Build: $BUILD" -echo "Copyright (c) 2020 School of Math and Computer Science, University of Havana" # TODO: líneas a los valores correctos -#echo "Authors: Eliane Puerta, Adrian Gonzalez, Liset Alfaro" -# Llamar al compilador +echo "Copyright (c) 2020 School of Math and Computer Science, University of Havana" python3 pycoolc.py $INPUT_FILE diff --git a/src/install.py b/src/install.py index 7441196b..a313d994 100644 --- a/src/install.py +++ b/src/install.py @@ -2,9 +2,6 @@ from coolgrammar.grammar import build_cool_grammar from parserr.lr import LALRParser from argparse import ArgumentParser -from setuptools import setup -from distutils.extension import Extension -from Cython.Distutils import build_ext def generate_py(f): diff --git a/src/lexer/tokenizer.py b/src/lexer/tokenizer.py index c60b7c17..0495cf3f 100755 --- a/src/lexer/tokenizer.py +++ b/src/lexer/tokenizer.py @@ -143,7 +143,7 @@ def _tokenize(self, text): raise SyntaxError( f'({self.line},{self.column}) - LexicographicError: String contains EOF' ) - #self.column += len(suffix) + # self.column += len(suffix) raise SyntaxError( f'({self.line},{self.column}) - LexicographicError: ERROR "%r"' % text[len(suffix) + continues]) @@ -157,11 +157,10 @@ def __call__(self, text: str): self.line += 1 self.column = 1 elif isinstance(ttype, str) and ttype == 'Space': - #self.column += 1 + # IGNORE WHITE SPACE pass else: tok = Token(lex, ttype, self.column, self.line) tokens.append(tok) - #self.column += len(lex) return tokens diff --git a/src/makefile b/src/makefile index e51b3ea8..6d0a486c 100644 --- a/src/makefile +++ b/src/makefile @@ -9,10 +9,10 @@ ifndef PYTHON endif # also find pip -PIP:=$(shell which pip) +PIP:=$(shell which pip3) ifeq ($(PIP), "") - echo "*** Please install pip and make sure it is in your System PATH ***"; + echo "*** Please install pip3 and make sure it is in your System PATH ***"; exit 1; endif @@ -22,6 +22,12 @@ endif COMPSTRUCTFILE=compiler_struct.py PIPREQUIREMENTS=cloudpickle pyinstaller +# pyinstaller modules +COOLCIMPORTS= ~/.pycoocl +PYFLAGS= --onefile -n pycoolc --paths $(COOLCIMPORTS) +$MODULES= abstract automatons baseNodeTree coolgrammar grammar lexer parserr tools travels typecheck + +# This is intended for setting a local compiler for testing. main: @echo "[*] Installing python dependencies" @$(PIP) install --user $(PIPREQUIREMENTS) @@ -32,7 +38,23 @@ main: clean: rm -rf build/* + rm -rf dist/* test: pytest ../tests -v --tb=short -m=${TAG} +# install a user wide cool compiler +install: + @echo "[*] Installing python dependencies." + @$(PIP) install --user $(PIPREQUIREMENTS) + @echo "[*] Compiling Cool Lexical structures." + @$(PYTHON) install.py build/$(COMPSTRUCTFILE) + @touch build/__init__.py + @echo "[*] Generating binary." + @pyinstaller $(PYFLAGS) pycoolc.py + @echo "[*] Setting config folder." + @mkdir $(COOLCIMPORTS) + @echo "[*] Copying require modules for compiler imports." + @cp -r $(MODULES) $(COOLCIMPORTS) + @echo "[*] Making binary accesible from user current path." + @cp dist/pycoolc /usr/bin/ From 7eedfc240373dbb7d3295bfa0dd165ecff7554e5 Mon Sep 17 00:00:00 2001 From: Adrian Date: Fri, 21 Feb 2020 15:41:50 -0500 Subject: [PATCH 009/162] Fixed requirements --- requirements.txt | 2 ++ src/makefile | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 9eb0cad1..3a5d8702 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,4 @@ pytest pytest-ordering +cloudpickle +pyinstaller diff --git a/src/makefile b/src/makefile index 6d0a486c..8422b664 100644 --- a/src/makefile +++ b/src/makefile @@ -20,7 +20,7 @@ endif #define some macros COMPSTRUCTFILE=compiler_struct.py -PIPREQUIREMENTS=cloudpickle pyinstaller +# PIPREQUIREMENTS=cloudpickle pyinstaller # pyinstaller modules COOLCIMPORTS= ~/.pycoocl @@ -29,8 +29,6 @@ $MODULES= abstract automatons baseNodeTree coolgrammar grammar lexer parserr too # This is intended for setting a local compiler for testing. main: - @echo "[*] Installing python dependencies" - @$(PIP) install --user $(PIPREQUIREMENTS) @echo "[*] Compiling Cool Lexical structures" @$(PYTHON) install.py build/$(COMPSTRUCTFILE) @touch build/__init__.py From 3918cbe6327e236d9feb5288a660e94b923c5ea6 Mon Sep 17 00:00:00 2001 From: Adrian Date: Fri, 21 Feb 2020 15:45:11 -0500 Subject: [PATCH 010/162] Another requirement * src/.builds: --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 3a5d8702..4e62277d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ pytest pytest-ordering cloudpickle pyinstaller +progressbar From f04517968f819a63b235869be6f1ec7de209d45d Mon Sep 17 00:00:00 2001 From: Adrian Date: Fri, 21 Feb 2020 15:53:23 -0500 Subject: [PATCH 011/162] fixing makefile --- src/makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/makefile b/src/makefile index 8422b664..70435226 100644 --- a/src/makefile +++ b/src/makefile @@ -20,7 +20,7 @@ endif #define some macros COMPSTRUCTFILE=compiler_struct.py -# PIPREQUIREMENTS=cloudpickle pyinstaller +PIPREQUIREMENTS=cloudpickle pyinstaller # pyinstaller modules COOLCIMPORTS= ~/.pycoocl @@ -29,14 +29,16 @@ $MODULES= abstract automatons baseNodeTree coolgrammar grammar lexer parserr too # This is intended for setting a local compiler for testing. main: + @mkdir build + touch build/$(COMPSTRUCTFILE) @echo "[*] Compiling Cool Lexical structures" @$(PYTHON) install.py build/$(COMPSTRUCTFILE) @touch build/__init__.py @echo 1 >> .builds clean: - rm -rf build/* - rm -rf dist/* + rm -rf build + rm -rf dist test: pytest ../tests -v --tb=short -m=${TAG} From 312fd0b505d77a5d8be50dbcde53d128f9401c8c Mon Sep 17 00:00:00 2001 From: Adrian Date: Fri, 21 Feb 2020 23:13:15 -0500 Subject: [PATCH 012/162] Fixing grammar, first parser test ok. --- src/.builds | 3 + src/abstract/tree.py | 73 +++++++++++++++++------ src/coolgrammar/grammar.py | 119 ++++++++++++++++++++++++++----------- src/lexer/tokenizer.py | 2 +- src/parserr/lr.py | 3 +- src/parserr/shiftreduce.py | 9 ++- src/testing.py | 89 ++++++++++++++------------- 7 files changed, 190 insertions(+), 108 deletions(-) diff --git a/src/.builds b/src/.builds index 78eb8779..a491e603 100644 --- a/src/.builds +++ b/src/.builds @@ -65,3 +65,6 @@ 1 1 1 +1 +1 +1 diff --git a/src/abstract/tree.py b/src/abstract/tree.py index 12d83626..6a7c262c 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -1,35 +1,41 @@ from abstract.semantics import ObjectType, IntegerType, StringType, BoolType, VoidType from abstract.semantics import Context + + class Node: pass + class DeclarationNode(Node): pass + class ExpressionNode(Node): pass -class ProgramNode(Node): +class ProgramNode(Node): def __init__(self, class_list): self.class_list = class_list - def check_semantics(self, deep = 1): - from travels import typecollector, typebuilder,inference + def check_semantics(self, deep=1): + from travels import typecollector, typebuilder, inference #recolectar los tipos type_collector = typecollector.TypeCollector() type_collector.visit(self) #Construir los tipos detectados en el contexto - type_builder = typebuilder.TypeBuilder(type_collector.context,type_collector.errors) + type_builder = typebuilder.TypeBuilder(type_collector.context, + type_collector.errors) type_builder.visit(self) errors = type_builder.errors if not errors: - inferer = inference.TypeInferer(type_builder.context, errors=errors) + inferer = inference.TypeInferer(type_builder.context, + errors=errors) scope = None - for d in range(1,deep + 1): + for d in range(1, deep + 1): print(d) - scope = inferer.visit(self, scope = scope, deep = d) + scope = inferer.visit(self, scope=scope, deep=d) print(scope) #reportar los errores return errors, type_builder.context @@ -42,51 +48,62 @@ def __init__(self, idx, param_list, return_type, statements): self.return_type = return_type self.statements = statements + class AttributeDef(DeclarationNode): - def __init__(self, idx, typex, default_value = None): + def __init__(self, idx, typex, default_value=None): self.idx = idx self.typex = typex self.default_value = default_value + class Param(DeclarationNode): def __init__(self, idx, typex): self.id, self.type = idx, typex + class VariableDeclaration(DeclarationNode): def __init__(self, var_list, block_statements=None): self.var_list = var_list self.block_statements = block_statements + class BinaryNode(ExpressionNode): def __init__(self, left, right): self.left, self.right = left, right + class AtomicNode(ExpressionNode): def __init__(self, lex): self.lex = lex + class IfThenElseNode(ExpressionNode): def __init__(self, cond, expr1, expr2): self.cond = cond self.expr1 = expr1 self.expr2 = expr2 + class PlusNode(BinaryNode): def __init__(self, left, right): - super(PlusNode,self).__init__(left, right) + super(PlusNode, self).__init__(left, right) + class DifNode(BinaryNode): def __init__(self, left, right): - super(DifNode,self).__init__(left, right) + super(DifNode, self).__init__(left, right) + class MulNode(BinaryNode): def __init__(self, left, right): super(MulNode, self).__init__(left, right) + class DivNode(BinaryNode): def __init__(self, left, right): super(DivNode, self).__init__(left, right) + class FunCall(ExpressionNode): def __init__(self, obj, idx, arg_list): self.obj = obj @@ -107,10 +124,12 @@ def __init__(self, idx, expr): self.idx = idx self.expr = expr + class IntegerConstant(AtomicNode): def __init__(self, lex): super(IntegerConstant, self).__init__(int(lex)) + class StringConstant(AtomicNode): def __init__(self, lex): super(StringConstant, self).__init__(lex) @@ -120,74 +139,90 @@ class TypeNode(AtomicNode): def __init__(self, lex): super(TypeNode, self).__init__(lex) + class BoleanNode(TypeNode): def __init__(self, val): self.val = True if val == 'true' else False + class FalseConstant(AtomicNode): def __init__(self): super(FalseConstant, self).__init__('false') + class TrueConstant(AtomicNode): def __init__(self): super(TrueConstant, self).__init__('true') + class StringTypeNode(TypeNode): def __init__(self): super(StringTypeNode, self).__init__('string') + class IntegerTypeNode(TypeNode): def __init__(self): super(IntegerTypeNode, self).__init__('int') + class ObjectTypeNode(TypeNode): def __init__(self): super(ObjectTypeNode, self).__init__('object') + class VoidTypeNode(TypeNode): def __init__(self): super(VoidTypeNode, self).__init__('void') class ClassDef(DeclarationNode): - def __init__(self, idx, features, parent = 'object'): + def __init__(self, idx, features, parent='object'): self.idx = idx self.features = features self.parent = parent + class VariableCall(ExpressionNode): - def __init__(self,idx): + def __init__(self, idx): self.idx = idx + class GreaterThanNode(BinaryNode): - def __init__(self,left, right): + def __init__(self, left, right): super(GreaterThanNode, self).__init__(left, right) + class LowerThanNode(BinaryNode): - def __init__(self,left, right): - super(LowerThanNode, self).__init__(left,right) + def __init__(self, left, right): + super(LowerThanNode, self).__init__(left, right) + class EqualToNode(BinaryNode): def __init__(self, left, right): - super().__init__(left,right) + super().__init__(left, right) + class LowerEqual(BinaryNode): - def __init__(self,left,right): - super().__init__(left,right) + def __init__(self, left, right): + super().__init__(left, right) + class GreaterEqualNode(BinaryNode): def __init__(self, left, right): super().__init__(left, right) + class NotNode(AtomicNode): def __init__(self, lex): super().__init__(lex) + class InstantiateClassNode(ExpressionNode): - def __init__(self, type_, args = None): + def __init__(self, type_, args=None): self.type_ = type_ self.args = args + class WhileBlockNode(ExpressionNode): def __init__(self, cond, statements): self.cond = cond diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index d54b9594..b75998c1 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -31,18 +31,19 @@ def build_cool_grammar(): arith, atom, actions, action, block = G.NonTerminals( ' ') - args_list_empty, param_list_empty, case_statement = G.NonTerminals( - ' ') + args_list_empty, param_list_empty, case_statement, string_const = G.NonTerminals( + ' ') class_keyword, def_keyword, in_keyword = G.Terminals('class def in') coma, period, dot_comma, opar, cpar, obrack, cbrack, plus, minus, star, div, dd = G.Terminals( ', . ; ( ) { } + - * / :') - idx, let, intx, string, num, equal, true, false, boolean, objectx =\ - G.Terminals('id let int string num = true false bool object') + idx, let, intx, string, num, equal, true, false, boolean, objectx, classid =\ + G.Terminals('id let int string num = true false bool object classid') - string_const, void, auto = G.Terminals('string_const void AUTO_TYPE') + tilde_string_const, quoted_string_const, void, auto = G.Terminals( + 'tilde_string_const quoted_string_const void AUTO_TYPE') if_, then, else_, assign, new, case, of, esac = G.Terminals( 'if then else assign new case of esac') @@ -57,16 +58,16 @@ def build_cool_grammar(): program %= class_list, lambda s: ProgramNode(s[1]) # Definir un conjunto de clases como una clase o una clase mas una lista de clases. - class_list %= class_def, lambda s: [s[1]] - class_list %= class_def + class_list, lambda s: [s[1]] + s[2] + class_list %= class_def + dot_comma, lambda s: [s[1]] + class_list %= class_def + dot_comma + class_list, lambda s: [s[1]] + s[2] # Definir la estructura de la declaracion de una clase. # Una clase no es mas que un conjunto de features. - class_def %= class_keyword + idx + obrack + feature_list + cbrack + dot_comma, \ - lambda s: ClassDef(s[2], s[4]) + class_def %= class_keyword + classid + obrack + feature_list + cbrack, lambda s: ClassDef( + s[2], s[4]) # Definir la estructura de la declaracion de una clase con herencia. - class_def %= class_keyword + idx + inherits + typex + obrack + feature_list + \ + class_def %= class_keyword + classid + inherits + typex + obrack + feature_list + \ cbrack + dot_comma, lambda s: ClassDef(s[2], s[6], s[4]) # Definir un conjunto de features como un metodo unico. @@ -87,7 +88,7 @@ def build_cool_grammar(): # Definir la estructura de la declaracion de un metodo. meod_def %= idx + opar + param_list_empty + cpar + dd + typex + obrack +\ - statement_list + cbrack, lambda s: MethodDef(s[1], s[3], s[6], s[8]) + statement_list + cbrack , lambda s: MethodDef(s[1], s[3], s[6], s[8]) # Definir la estructura de la declaracion de un atributo. attr_def %= idx + dd + typex, lambda s: AttributeDef(s[1], s[3]) @@ -110,7 +111,7 @@ def build_cool_grammar(): # Definir una lista de sentencias como una expresion terminada en punto y coma o # una expresion y una lista de sentencias separadas por punto y coma. - statement_list %= exp + dot_comma, lambda s: [s[1]] + statement_list %= exp, lambda s: [s[1]] statement_list %= exp + dot_comma + statement_list, lambda s: [s[1]] + s[3] @@ -134,7 +135,11 @@ def build_cool_grammar(): # Una expresion puede ser una constante (True, False, un string, un entero, etc) exp %= true, lambda s: TrueConstant() - exp %= string_const, lambda s: StringConstant(s[1]) + exp %= string_const, lambda s: s[1] + + string_const %= quoted_string_const, lambda s: StringConstant(s[1]) + + string_const %= tilde_string_const, lambda s: StringConstant(s[1]) exp %= false, lambda s: FalseConstant() @@ -149,11 +154,14 @@ def build_cool_grammar(): exp %= idx + assign + exp, lambda s: AssignNode(s[1], s[3]) # Una expresion puede ser una instanciacion de una clase - exp %= instantiation, lambda s: s[1] + #exp %= instantiation, lambda s: s[1] + factor %= instantiation, lambda s: s[1] - instantiation %= new + idx + opar + args_list_empty + \ + instantiation %= new + classid + opar + args_list_empty + \ cpar, lambda s: InstantiateClassNode(s[2], s[4]) + instantiation %= new + classid, lambda s: InstantiateClassNode(s[2], []) + # Una expresion puede ser un bloque while exp %= while_ + exp + loop + statement_list + \ pool, lambda s: WhileBlockNode(s[3], s[7]) @@ -215,7 +223,7 @@ def build_cool_grammar(): typex %= objectx, lambda s: 'object' - typex %= idx, lambda s: s[1] + typex %= classid, lambda s: s[1] typex %= auto, lambda s: 'AUTO_TYPE' @@ -243,27 +251,68 @@ def build_cool_grammar(): r"|(\k)|(\l)|(\m)|(\n)|(\o)|(\p)|(\q)|(\r)|(\s)|(\t)|(\u)|(\v)|(\x)|(\y)|(\z)" +\ r'|(!\")' + r"|(!\')" + operators = r"!+|!*|!-|!/|!{|!}|!(|!)|!<|!=|!>|!@|!;|!,|!:|!&|!^|!%|!$|!#|!~" + quoted_string = r'"(1|2|3|4|5|6|7|8|9|0|A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N' + r'|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|! |' + scaped_chars + r'|' + operators + ')*"' + + tilde_string = r"'(1|2|3|4|5|6|7|8|9|0|A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N' + r'|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|! |' + scaped_chars + r'|' + operators + ')*'" + table = [ - (class_keyword, 'class'), (def_keyword, 'def'), (in_keyword, 'in'), - (intx, 'int'), (boolean, 'bool'), (objectx, 'object'), - (string, 'string'), (true, ' true'), (false, 'false'), - (auto, 'AUTO_TYPE'), (if_, 'if'), (then, 'then'), (else_, 'else'), - (new, 'new'), (while_, 'while'), (do, 'do'), (esac, 'esac'), - (case, 'case'), (of, 'of'), (inherits, 'inherits'), (coma, ','), - (period, '.'), (dd, ':'), (dot_comma, ';'), (arroba, '@'), - (assign, r''), (ge, '>='), (le, '<='), - (eq, '=='), (not_, r'!~'), (equal, '='), (opar, r'!('), (cpar, r'!)'), - (obrack, r'!{'), (cbrack, r'!}'), (plus, r'!+'), (minus, r'!-'), - (implies, r'=>'), (div, '/'), (star, r'!*'), (let, 'let'), (fi, 'fi'), - (pool, 'pool'), (loop, 'loop'), (isvoid, 'isvoid'), - (idx, - '(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N|n|O|o|P|p|' + - 'Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z)(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N|n|O|o|P|p|' + - 'Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|_)*'), + (class_keyword, 'class'), + (def_keyword, 'def'), + (in_keyword, 'in'), + (intx, 'int'), + (boolean, 'bool'), + (objectx, 'object'), + (string, 'string'), + (true, ' true'), + (false, 'false'), + (auto, 'AUTO_TYPE'), + (if_, 'if'), + (then, 'then'), + (else_, 'else'), + (new, 'new'), + (while_, 'while'), + (do, 'do'), + (esac, 'esac'), + (case, 'case'), + (of, 'of'), + (inherits, 'inherits'), + (coma, ','), + (period, '.'), + (dd, ':'), + (dot_comma, ';'), + (arroba, '@'), + (assign, r''), + (ge, '>='), + (le, '<='), + (eq, '=='), + (not_, r'!~'), + (equal, '='), + (opar, r'!('), + (cpar, r'!)'), + (obrack, r'!{'), + (cbrack, r'!}'), + (plus, r'!+'), + (minus, r'!-'), + (implies, r'=>'), + (div, '/'), + (star, r'!*'), + (let, 'let'), + (fi, 'fi'), + (pool, 'pool'), + (loop, 'loop'), + (isvoid, 'isvoid'), + (idx, '(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|' + + 'q|r|s|t|u|v|w|x|y|z)(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N|n|O|o|P|p|' + + 'Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|_|1|2|3|4|5|6|7|8|9|0)*'), (num, '(1|2|3|4|5|6|7|8|9|0)+'), - (string_const, - r'"(1|2|3|4|5|6|7|8|9|0|A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N' + - r'|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|! |' + scaped_chars + ')*"') + (tilde_string_const, tilde_string), + (quoted_string_const, quoted_string), + (classid, '(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|' + + 'Q|R|S|T|U|V|W|X|Y|Z)(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N|n|O|o|P|p|' + + 'Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|_|1|2|3|4|5|6|7|8|9|0)*'), ] lexer = Lexer(table, G.EOF, ignore_white_space=False) diff --git a/src/lexer/tokenizer.py b/src/lexer/tokenizer.py index 0495cf3f..0c398737 100755 --- a/src/lexer/tokenizer.py +++ b/src/lexer/tokenizer.py @@ -143,7 +143,6 @@ def _tokenize(self, text): raise SyntaxError( f'({self.line},{self.column}) - LexicographicError: String contains EOF' ) - # self.column += len(suffix) raise SyntaxError( f'({self.line},{self.column}) - LexicographicError: ERROR "%r"' % text[len(suffix) + continues]) @@ -161,6 +160,7 @@ def __call__(self, text: str): pass else: tok = Token(lex, ttype, self.column, self.line) + print(tok) tokens.append(tok) return tokens diff --git a/src/parserr/lr.py b/src/parserr/lr.py index 467112d4..30c6e4e1 100755 --- a/src/parserr/lr.py +++ b/src/parserr/lr.py @@ -160,8 +160,7 @@ def _build_parsing_table(self): automaton = build_LR1_automaton(self.G) for i, node in enumerate(automaton): node.idx = i - progress = ProgressBar(term_width=30) - for node in progress(automaton): + for node in automaton: idx = node.idx for item in node.state: if item.IsReduceItem: diff --git a/src/parserr/shiftreduce.py b/src/parserr/shiftreduce.py index 7ccf8b65..62dfbb09 100755 --- a/src/parserr/shiftreduce.py +++ b/src/parserr/shiftreduce.py @@ -36,11 +36,10 @@ def __call__(self, tokens): try: action, tag = self.action[state, lookahead] except KeyError: - print(lookahead.__class__) - raise SyntaxError(f'Bad {tokens[cursor]} in line {tokens[cursor].token_line}' + - f' column {tokens[cursor].token_column}.\n' + - f'Expected: ' + - ' or '.join([str(y) for x, y in self.action if x == state])) + col = tokens[cursor].token_column - len(tokens[cursor].lex) + raise SyntaxError( + f'({tokens[cursor].token_line},{col}) - ' + + f' SyntaxError: ERROR "%s"' % tokens[cursor].lex) if action == self.SHIFT: cursor += 1 diff --git a/src/testing.py b/src/testing.py index f94732a9..1b181253 100755 --- a/src/testing.py +++ b/src/testing.py @@ -1,56 +1,54 @@ from coolgrammar import grammar from lexer import tokenizer -from parserr.lr import LALRParser +from parserr.lr import LALRParser, LR1Parser from parserr.shiftreduce import ShiftReduceParser import cloudpickle from comments import find_comments GRAMMAR, LEXER = grammar.build_cool_grammar() -#PARSER = LALRParser(GRAMMAR, verbose=True) -TEST = r""" +PARSER = LALRParser(GRAMMAR, verbose=True) -"This \ -is OK" -"This is not -OK" +test_String = r""" +'Hello World' """ -string2 = r""" -" May the Triforce \ - 0 \ - 0v0 \ - 0vvv0 \ - 0vvvvv0 \ - 0vvvvvvv0 \ - 0vvvvvvvvv0 \ - 0vvvvvvvvvvv0 \ - 000000000000000 \ - 0v0 0v0 \ - 0vvv0 0vvv0 \ - 0vvvvv0 0vvvvv0 \ - 0vvvvvvv0 0vvvvvvv0 \ - 0vvvvvvvvv0 0vvvvvvvvv0 \ - 0vvvvvvvvvvv0 0vvvvvvvvvvv0 \ - 00000000000000000000000000000 \ - be with you!""" - -TEST_PROGRAM = r""" -"lkjdsafkljdsalfj\u0000dsafdsaf\u0000djafslkjdsalf\nsdajf\" lkjfdsasdkjfl"123 -adsfasklj# -LKldsajf iNhERITS -"lkdsajf" - -(* -#1 STR_CONST "lkjdsafkljdsalfju0000dsafdsafu0000djafslkjdsalf\nsdajf\" lkjfdsasdkjfl" -#1 INT_CONST 123 -#2 OBJECTID adsfasklj -#2 ERROR "#" -#3 TYPEID LKldsajf -#3 INHERITS -#4 STR_CONST "lkdsajf" -*) -""" +test_program = r""" +class Main { + main(): Object { + (new Alpha).print() + }; +}; + +class Test { + test1: Object; + + testing1(): Int { + 2 + 2 + }; + + test2: Int <- 1; + + test3: String <- "1"; + + testing2(a: Alpha, b: Int): Int { + 2 + 2 + }; + testing3(): String { + "2 + 2" + }; + + testing4(): String { + Test1 <- 'Hello World' -- Identifiers begin with a lower case letter + }; +}; + +class Alpha inherits IO { + print() : Object { + out_string("reached!!\n") + }; +}; +""" SIMPLE_PROGRAM = r""" "kjsafkljd\saa\aa" "helloworld" @@ -98,19 +96,18 @@ class A inherits IO }; """ -space_test = r"t t t t ?" # First Round of tests TOKS = None try: - program = find_comments(space_test) + program = find_comments(test_program) TOKS = LEXER(program) - # parse = PARSER(TOKS) + parse = PARSER(TOKS) # Try to save the parser and then reuse it # with open('.parser.dmp','wb') as file: # cloudpickle.dump(PARSER, file) #with open('.parser.dmp', 'rb') as file: # parser = cloudpickle.load(file) - print(TOKS) + print(parse) except Exception as e: print(e) From 1071bc38c33b9f3d681bdf06482bddce30565cf8 Mon Sep 17 00:00:00 2001 From: Adrian Date: Fri, 21 Feb 2020 23:23:18 -0500 Subject: [PATCH 013/162] fixed tilde strings --- src/coolgrammar/grammar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index b75998c1..df7476d6 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -254,7 +254,7 @@ def build_cool_grammar(): operators = r"!+|!*|!-|!/|!{|!}|!(|!)|!<|!=|!>|!@|!;|!,|!:|!&|!^|!%|!$|!#|!~" quoted_string = r'"(1|2|3|4|5|6|7|8|9|0|A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N' + r'|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|! |' + scaped_chars + r'|' + operators + ')*"' - tilde_string = r"'(1|2|3|4|5|6|7|8|9|0|A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N' + r'|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|! |' + scaped_chars + r'|' + operators + ')*'" + tilde_string = r"'(1|2|3|4|5|6|7|8|9|0|A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N' + r'|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|! |" + scaped_chars + r'|' + operators + ")*'" table = [ (class_keyword, 'class'), From 48513eebf568cab053b1374610604977e4530210 Mon Sep 17 00:00:00 2001 From: Adrian Date: Fri, 21 Feb 2020 23:45:47 -0500 Subject: [PATCH 014/162] Some parser test ok, Keep fixing. --- src/.builds | 14 ++++++++++++++ src/coolgrammar/grammar.py | 6 +++--- src/lexer/tokenizer.py | 1 - src/parserr/shiftreduce.py | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/.builds b/src/.builds index a491e603..7fea98fb 100644 --- a/src/.builds +++ b/src/.builds @@ -68,3 +68,17 @@ 1 1 1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index df7476d6..331c6060 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -251,10 +251,10 @@ def build_cool_grammar(): r"|(\k)|(\l)|(\m)|(\n)|(\o)|(\p)|(\q)|(\r)|(\s)|(\t)|(\u)|(\v)|(\x)|(\y)|(\z)" +\ r'|(!\")' + r"|(!\')" - operators = r"!+|!*|!-|!/|!{|!}|!(|!)|!<|!=|!>|!@|!;|!,|!:|!&|!^|!%|!$|!#|!~" - quoted_string = r'"(1|2|3|4|5|6|7|8|9|0|A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N' + r'|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|! |' + scaped_chars + r'|' + operators + ')*"' + operators = r"!+|!*|!-|!/|!(|!)|!=|!:|!>|!<|!||!?|!#|!," + quoted_string = r'"(1|2|3|4|5|6|7|8|9|0|A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N' + r'|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|! |' + scaped_chars + "|" + operators + ')*"' - tilde_string = r"'(1|2|3|4|5|6|7|8|9|0|A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N' + r'|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|! |" + scaped_chars + r'|' + operators + ")*'" + tilde_string = r"'(1|2|3|4|5|6|7|8|9|0|A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N' + r'|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|! |" + scaped_chars + ")*'" table = [ (class_keyword, 'class'), diff --git a/src/lexer/tokenizer.py b/src/lexer/tokenizer.py index 0c398737..77915191 100755 --- a/src/lexer/tokenizer.py +++ b/src/lexer/tokenizer.py @@ -160,7 +160,6 @@ def __call__(self, text: str): pass else: tok = Token(lex, ttype, self.column, self.line) - print(tok) tokens.append(tok) return tokens diff --git a/src/parserr/shiftreduce.py b/src/parserr/shiftreduce.py index 62dfbb09..f1591d3c 100755 --- a/src/parserr/shiftreduce.py +++ b/src/parserr/shiftreduce.py @@ -39,7 +39,7 @@ def __call__(self, tokens): col = tokens[cursor].token_column - len(tokens[cursor].lex) raise SyntaxError( f'({tokens[cursor].token_line},{col}) - ' - + f' SyntaxError: ERROR "%s"' % tokens[cursor].lex) + + f' SyntacticError: ERROR "%s"' % tokens[cursor].lex) if action == self.SHIFT: cursor += 1 From a1cf1b00bea1470fc58f16a822efba69ca5f36c8 Mon Sep 17 00:00:00 2001 From: Adrian Date: Sat, 22 Feb 2020 01:57:50 -0500 Subject: [PATCH 015/162] Almost there --- src/.builds | 5 ++ src/coolgrammar/grammar.py | 80 +++++++++++++-------------- src/testing.py | 108 +++++++++++++++++++------------------ 3 files changed, 103 insertions(+), 90 deletions(-) diff --git a/src/.builds b/src/.builds index 7fea98fb..40d6559e 100644 --- a/src/.builds +++ b/src/.builds @@ -82,3 +82,8 @@ 1 1 1 +1 +1 +1 +1 +1 diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index 331c6060..b0e7a3c8 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -25,8 +25,8 @@ def build_cool_grammar(): var_dec, args_list, instantiation = G.NonTerminals( ' ') - exp, typex, term, factor, nested_lets = G.NonTerminals( - ' ') + exp, typex, term, factor, nested_lets, loop_statements = G.NonTerminals( + ' ') arith, atom, actions, action, block = G.NonTerminals( ' ') @@ -39,8 +39,8 @@ def build_cool_grammar(): coma, period, dot_comma, opar, cpar, obrack, cbrack, plus, minus, star, div, dd = G.Terminals( ', . ; ( ) { } + - * / :') - idx, let, intx, string, num, equal, true, false, boolean, objectx, classid =\ - G.Terminals('id let int string num = true false bool object classid') + idx, let, intx, string, num, true, false, boolean, objectx, classid =\ + G.Terminals('id let int string num true false bool object classid') tilde_string_const, quoted_string_const, void, auto = G.Terminals( 'tilde_string_const quoted_string_const void AUTO_TYPE') @@ -49,7 +49,7 @@ def build_cool_grammar(): 'if then else assign new case of esac') gt, lt, ge, le, eq, not_, implies, isvoid = G.Terminals( - '> < >= <= == ~ => isvoid') + '> < >= <= = ~ => isvoid') while_, do, inherits, arroba, fi, pool, loop = G.Terminals( 'while do inherits @ fi pool loop') @@ -68,7 +68,7 @@ def build_cool_grammar(): # Definir la estructura de la declaracion de una clase con herencia. class_def %= class_keyword + classid + inherits + typex + obrack + feature_list + \ - cbrack + dot_comma, lambda s: ClassDef(s[2], s[6], s[4]) + cbrack, lambda s: ClassDef(s[2], s[6], s[4]) # Definir un conjunto de features como un metodo unico. feature_list %= meod_def + dot_comma, lambda s: [s[1]] @@ -132,16 +132,13 @@ def build_cool_grammar(): # Una expresion puede ser una declaracion de una variable exp %= var_dec, lambda s: s[1] - # Una expresion puede ser una constante (True, False, un string, un entero, etc) - exp %= true, lambda s: TrueConstant() - - exp %= string_const, lambda s: s[1] + factor %= true, lambda s: TrueConstant() string_const %= quoted_string_const, lambda s: StringConstant(s[1]) string_const %= tilde_string_const, lambda s: StringConstant(s[1]) - exp %= false, lambda s: FalseConstant() + factor %= false, lambda s: FalseConstant() # Una expresion puede ser una sentencia de comparacion exp %= atom, lambda s: s[1] @@ -162,9 +159,13 @@ def build_cool_grammar(): instantiation %= new + classid, lambda s: InstantiateClassNode(s[2], []) + loop_statements %= exp + dot_comma, lambda s: [s[1]] + loop_statements %= exp + dot_comma + loop_statements, lambda s: [s[1]] + s[ + 3] + # Una expresion puede ser un bloque while - exp %= while_ + exp + loop + statement_list + \ - pool, lambda s: WhileBlockNode(s[3], s[7]) + exp %= while_ + exp + loop + obrack + loop_statements + cbrack + \ + pool, lambda s: WhileBlockNode(s[2], s[5]) exp %= arith, lambda s: s[1] @@ -174,7 +175,7 @@ def build_cool_grammar(): exp %= isvoid + exp, lambda s: IsVoidNode(s[2]) - block %= obrack + statement_list + cbrack, lambda s: BlockNode(s[2]) + block %= obrack + loop_statements + cbrack, lambda s: BlockNode(s[2]) arith %= arith + plus + term, lambda s: PlusNode(s[1], s[3]) @@ -197,6 +198,8 @@ def build_cool_grammar(): factor %= factor + period + idx + opar + args_list_empty + cpar, lambda s: FunCall( s[1], s[3], s[5]) + factor %= string_const, lambda s: s[1] + factor %= idx + opar + args_list_empty + \ cpar, lambda s: FunCall('self', s[1], s[3]) @@ -251,32 +254,32 @@ def build_cool_grammar(): r"|(\k)|(\l)|(\m)|(\n)|(\o)|(\p)|(\q)|(\r)|(\s)|(\t)|(\u)|(\v)|(\x)|(\y)|(\z)" +\ r'|(!\")' + r"|(!\')" - operators = r"!+|!*|!-|!/|!(|!)|!=|!:|!>|!<|!||!?|!#|!," + operators = r"!+|!*|!-|!/|!(|!)|!=|!.|!>|!<|!||!?|!#|!," quoted_string = r'"(1|2|3|4|5|6|7|8|9|0|A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N' + r'|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|! |' + scaped_chars + "|" + operators + ')*"' tilde_string = r"'(1|2|3|4|5|6|7|8|9|0|A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N' + r'|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|! |" + scaped_chars + ")*'" table = [ - (class_keyword, 'class'), - (def_keyword, 'def'), - (in_keyword, 'in'), - (intx, 'int'), - (boolean, 'bool'), - (objectx, 'object'), - (string, 'string'), + (class_keyword, '(c|C)(l|L)(a|A)(s|S)(s|S)'), + (def_keyword, '(d|D)(e|E)(f|F)'), + (in_keyword, '(i|I)(n|N)'), + (intx, 'Int'), + (boolean, 'Bool'), + (objectx, 'Object'), + (string, 'String'), (true, ' true'), (false, 'false'), (auto, 'AUTO_TYPE'), - (if_, 'if'), - (then, 'then'), - (else_, 'else'), - (new, 'new'), - (while_, 'while'), - (do, 'do'), - (esac, 'esac'), - (case, 'case'), - (of, 'of'), - (inherits, 'inherits'), + (if_, '(i|I)(f|F)'), + (then, '(t|T)(h|H)(e|E)(n|N)'), + (else_, '(e|E)(l|L)(s|S)(e|E)'), + (new, '(n|N)(e|E)(w|W)'), + (while_, '(w|W)(h|H)(i|I)(l|L)(e|E)'), + (do, '(d|D)(o|O)'), + (esac, '(e|E)(s|S)(a|A)(c|C)'), + (case, '(c|C)(a|A)(s|S)(e|E)'), + (of, '(o|O)(f|F)'), + (inherits, '(i|I)(n|N)(h|H)(e|E)(r|R)(i|I)(t|T)(s|S)'), (coma, ','), (period, '.'), (dd, ':'), @@ -287,9 +290,8 @@ def build_cool_grammar(): (gt, r'!>'), (ge, '>='), (le, '<='), - (eq, '=='), + (eq, '='), (not_, r'!~'), - (equal, '='), (opar, r'!('), (cpar, r'!)'), (obrack, r'!{'), @@ -299,11 +301,11 @@ def build_cool_grammar(): (implies, r'=>'), (div, '/'), (star, r'!*'), - (let, 'let'), - (fi, 'fi'), - (pool, 'pool'), - (loop, 'loop'), - (isvoid, 'isvoid'), + (let, '(l|L)(e|E)(t|T)'), + (fi, '(f|F)(i|I)'), + (pool, '(p|P)(o|O)(o|O)(l|L)'), + (loop, '(l|L)(o|O)(o|O)(p|P)'), + (isvoid, '(i|I)(s|S)(v|V)(o|O)(i|I)(d|D)'), (idx, '(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|' + 'q|r|s|t|u|v|w|x|y|z)(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N|n|O|o|P|p|' + 'Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|_|1|2|3|4|5|6|7|8|9|0)*'), diff --git a/src/testing.py b/src/testing.py index 1b181253..568cb104 100755 --- a/src/testing.py +++ b/src/testing.py @@ -7,12 +7,9 @@ GRAMMAR, LEXER = grammar.build_cool_grammar() PARSER = LALRParser(GRAMMAR, verbose=True) +prog = r""" +(* Case expressions provide runtime type tests on objects *) -test_String = r""" -'Hello World' -""" - -test_program = r""" class Main { main(): Object { (new Alpha).print() @@ -38,68 +35,77 @@ class Test { "2 + 2" }; - testing4(): String { - Test1 <- 'Hello World' -- Identifiers begin with a lower case letter + testing4(x: Int, y: Int): Test { + self }; -}; -class Alpha inherits IO { - print() : Object { - out_string("reached!!\n") + testing5(a: String, b: String): IO { + If a.length() < b.length() THeN + new IO.out_string("La cadena \"".concat(b).concat("\" es mas larga que la cadena \"").concat(a).concat("\".")) + eLSe + if a.length() = b.length() THeN + new IO.out_string("La cadena \"".concat(a).concat("\" mide igual que la cadena \"").concat(b).concat("\".")) + ElsE + new IO.out_string("La cadena \"".concat(a).concat("\" es mas larga que la cadena \"").concat(b).concat("\".")) + fI + Fi }; -}; -""" -SIMPLE_PROGRAM = r""" -"kjsafkljd\saa\aa" -"helloworld" -class A inherits IO -{ - attribute : int <- 10; - - main(): SELF_TYPE - { - print("Hello There"); - }; - - a(n :int) : int - { - n; + + testing6(a: Int): IO { + let count: Int <- 0, pow: Int + in { + -- count <- 0; + pow <- 1; + while pow < a + loop + { + count <- count + 1; + pow <- pow * 2; + } + pool; + new IO.out_string("El logaritmo en base 2 de ").out_int(a).out_string(" es ").out_int(count); + } }; - b (): int - { - let varj : int <- 10 in - { - varj; - }; + testing7(): Object { + case true of + x: Int => new IO.out_string("Es un entero!"); + y: String => new IO.out_string("Es una cadena!"); + Mazinger_Z: Bool => new IO.out_string("Es un booleano!"); -- Identifiers starts with a lowercase letter + esac + }; +}; - let varl : int in - { - varh; - }; +class Test2 { + test1: Test <- new Test; - let varj :int, varu : string <- "Hello There" in - { - var; - }; + testing1(): Test { + test1.testing4(1 + 1, 1 + 2).testing4(2 + 3, 3 + 5).testing4(5 + 8, 8 + 13) + }; - case varj of - x : int => x + 10 ; - x : string => "Hi there" ; - x : object => varj; - esac; + testing2(x: Int, y: Int): Test2 { + self + }; + testing3(): Test2 { + testing2(1 + 1, 1 + 2).testing2(2 + 3, 3 + 5).testing2(5 + 8, true + fALSE) + }; - a(10); - }; + testing4(): Object { + test1@Object.copy() + }; +}; +class Alpha inherits IO { + print() : Object { + out_string("reached!!\n") + }; }; """ - # First Round of tests TOKS = None try: - program = find_comments(test_program) + program = find_comments(prog) TOKS = LEXER(program) parse = PARSER(TOKS) # Try to save the parser and then reuse it From ac216aecaf6169dfa75b63dbf763ae1819db0e04 Mon Sep 17 00:00:00 2001 From: Adrian Date: Sat, 22 Feb 2020 16:47:41 -0500 Subject: [PATCH 016/162] Just two more to go. --- src/.builds | 9 +++ src/abstract/tree.py | 5 ++ src/coolgrammar/grammar.py | 86 ++++++++++------------------ src/parserr/shiftreduce.py | 11 +++- src/testing.py | 114 +++++++------------------------------ 5 files changed, 72 insertions(+), 153 deletions(-) diff --git a/src/.builds b/src/.builds index 40d6559e..5dea9418 100644 --- a/src/.builds +++ b/src/.builds @@ -87,3 +87,12 @@ 1 1 1 +1 +1 +1 +1 +1 +1 +1 +1 +1 diff --git a/src/abstract/tree.py b/src/abstract/tree.py index 6a7c262c..63c6f976 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -217,6 +217,11 @@ def __init__(self, lex): super().__init__(lex) +class NegNode(AtomicNode): + def __init__(self, lex): + super().__init__(lex) + + class InstantiateClassNode(ExpressionNode): def __init__(self, type_, args=None): self.type_ = type_ diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index b0e7a3c8..aac0a2f4 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -8,6 +8,7 @@ from abstract.tree import GreaterEqualNode, LowerThanNode, LowerEqual, AssignNode, IfThenElseNode from abstract.tree import NotNode, WhileBlockNode, EqualToNode, InstantiateClassNode from abstract.tree import ActionNode, CaseNode, ParentFuncCall, BlockNode, IsVoidNode +from abstract.tree import NegNode from lexer.tokenizer import Lexer @@ -48,72 +49,52 @@ def build_cool_grammar(): if_, then, else_, assign, new, case, of, esac = G.Terminals( 'if then else assign new case of esac') - gt, lt, ge, le, eq, not_, implies, isvoid = G.Terminals( - '> < >= <= = ~ => isvoid') + gt, lt, ge, le, eq, not_, implies, isvoid, not_operator = G.Terminals( + '> < >= <= = ~ => isvoid not') while_, do, inherits, arroba, fi, pool, loop = G.Terminals( 'while do inherits @ fi pool loop') - # Definir un programa como un conjunto de clases. program %= class_list, lambda s: ProgramNode(s[1]) - # Definir un conjunto de clases como una clase o una clase mas una lista de clases. class_list %= class_def + dot_comma, lambda s: [s[1]] class_list %= class_def + dot_comma + class_list, lambda s: [s[1]] + s[2] - # Definir la estructura de la declaracion de una clase. - # Una clase no es mas que un conjunto de features. class_def %= class_keyword + classid + obrack + feature_list + cbrack, lambda s: ClassDef( s[2], s[4]) - # Definir la estructura de la declaracion de una clase con herencia. class_def %= class_keyword + classid + inherits + typex + obrack + feature_list + \ cbrack, lambda s: ClassDef(s[2], s[6], s[4]) - # Definir un conjunto de features como un metodo unico. feature_list %= meod_def + dot_comma, lambda s: [s[1]] - # Definir un conjunto de features como un unico atributo. feature_list %= attr_def + dot_comma, lambda s: [s[1]] - # Definir una lista de features como la declaracion de un metodo - # mas una lista de features. feature_list %= meod_def + dot_comma + \ feature_list, lambda s: [s[1]] + s[3] - # Definir una lista de features como la declaracion de un atributo - # mas una lista de features. feature_list %= attr_def + dot_comma + \ feature_list, lambda s: [s[1]] + s[3] - # Definir la estructura de la declaracion de un metodo. meod_def %= idx + opar + param_list_empty + cpar + dd + typex + obrack +\ statement_list + cbrack , lambda s: MethodDef(s[1], s[3], s[6], s[8]) - # Definir la estructura de la declaracion de un atributo. attr_def %= idx + dd + typex, lambda s: AttributeDef(s[1], s[3]) - # Definir la estructura de la declaracion de un atributo con valor por defecto. attr_def %= idx + dd + typex + assign + \ exp, lambda s: AttributeDef(s[1], s[3], s[5]) - # Definir la lista de parametros como una lista de parametros o una lista vacia param_list_empty %= param_list, lambda s: s[1] param_list_empty %= G.Epsilon, lambda s: [] - # Definir una lista de parametros como un parametro separado por coma con una lista - # de parametros o simplemente un parametro param_list %= param, lambda s: [s[1]] param_list %= param + coma + param_list, lambda s: [s[1]] + s[3] - # Definir un la estructura de un parametro como un identificador : Tipo param %= idx + dd + typex, lambda s: Param(s[1], s[3]) - # Definir una lista de sentencias como una expresion terminada en punto y coma o - # una expresion y una lista de sentencias separadas por punto y coma. - statement_list %= exp, lambda s: [s[1]] + statement_list %= exp, lambda s: s[1] - statement_list %= exp + dot_comma + statement_list, lambda s: [s[1]] + s[3] + # statement_list %= exp + dot_comma + statement_list, lambda s: [s[1]] + s[3] var_dec %= let + nested_lets + in_keyword + \ exp, lambda s: VariableDeclaration(s[2], s[4]) @@ -129,44 +110,27 @@ def build_cool_grammar(): nested_lets %= idx + dd + typex + assign + exp + coma + \ nested_lets, lambda s: [(s[1], s[3], s[5])] + s[7] - # Una expresion puede ser una declaracion de una variable exp %= var_dec, lambda s: s[1] - factor %= true, lambda s: TrueConstant() - string_const %= quoted_string_const, lambda s: StringConstant(s[1]) string_const %= tilde_string_const, lambda s: StringConstant(s[1]) - factor %= false, lambda s: FalseConstant() - - # Una expresion puede ser una sentencia de comparacion - exp %= atom, lambda s: s[1] - - # Una expresion puede ser un bloque IfThenElse - exp %= if_ + exp + then + exp + else_ + exp + \ - fi, lambda s: IfThenElseNode(s[2], s[4], s[6]) - - # Una expresion puede ser una asignacion - exp %= idx + assign + exp, lambda s: AssignNode(s[1], s[3]) - - # Una expresion puede ser una instanciacion de una clase - #exp %= instantiation, lambda s: s[1] - factor %= instantiation, lambda s: s[1] - - instantiation %= new + classid + opar + args_list_empty + \ - cpar, lambda s: InstantiateClassNode(s[2], s[4]) - - instantiation %= new + classid, lambda s: InstantiateClassNode(s[2], []) + instantiation %= new + typex, lambda s: InstantiateClassNode(s[2], []) loop_statements %= exp + dot_comma, lambda s: [s[1]] loop_statements %= exp + dot_comma + loop_statements, lambda s: [s[1]] + s[ 3] - # Una expresion puede ser un bloque while - exp %= while_ + exp + loop + obrack + loop_statements + cbrack + \ + exp %= idx + assign + exp, lambda s: AssignNode(s[1], s[3]) + + exp %= while_ + exp + loop + statement_list + \ pool, lambda s: WhileBlockNode(s[2], s[5]) + exp %= atom, lambda s: s[1] + + exp %= opar + atom + cpar, lambda s: s[2] + exp %= arith, lambda s: s[1] exp %= block, lambda s: s[1] @@ -189,12 +153,21 @@ def build_cool_grammar(): term %= factor, lambda s: s[1] + term %= not_ + factor, lambda s: NotNode(s[2]) + + term %= not_operator + factor, lambda s: NegNode(s[2]) + + factor %= if_ + exp + then + exp + else_ + exp + fi, lambda s: IfThenElseNode( + s[2], s[4], s[6]) + factor %= opar + arith + cpar, lambda s: s[2] factor %= num, lambda s: IntegerConstant(s[1]) factor %= idx, lambda s: VariableCall(s[1]) + factor %= true, lambda s: TrueConstant() + factor %= factor + period + idx + opar + args_list_empty + cpar, lambda s: FunCall( s[1], s[3], s[5]) @@ -206,17 +179,17 @@ def build_cool_grammar(): factor %= factor + arroba + typex + period + idx + opar + args_list_empty + cpar, lambda s: \ ParentFuncCall(s[1], s[3], s[5], s[7]) - atom %= factor + gt + factor, lambda s: GreaterThanNode(s[1], s[3]) + factor %= false, lambda s: FalseConstant() - atom %= factor + lt + factor, lambda s: LowerThanNode(s[1], s[3]) + factor %= instantiation, lambda s: s[1] - atom %= factor + eq + factor, lambda s: EqualToNode(s[1], s[3]) + atom %= arith + lt + arith, lambda s: LowerThanNode(s[1], s[3]) - atom %= factor + ge + factor, lambda s: GreaterEqualNode(s[1], s[3]) + atom %= arith + eq + arith, lambda s: EqualToNode(s[1], s[3]) - atom %= factor + le + factor, lambda s: LowerEqual(s[1], s[3]) + atom %= arith + ge + arith, lambda s: GreaterEqualNode(s[1], s[3]) - atom %= not_ + factor, lambda s: NotNode(s[2]) + atom %= arith + le + arith, lambda s: LowerEqual(s[1], s[3]) typex %= intx, lambda s: 'int' @@ -254,7 +227,7 @@ def build_cool_grammar(): r"|(\k)|(\l)|(\m)|(\n)|(\o)|(\p)|(\q)|(\r)|(\s)|(\t)|(\u)|(\v)|(\x)|(\y)|(\z)" +\ r'|(!\")' + r"|(!\')" - operators = r"!+|!*|!-|!/|!(|!)|!=|!.|!>|!<|!||!?|!#|!," + operators = r"!+|!*|!-|!/|!(|!)|!=|!.|!>|!<|!:|!?|!#|!," quoted_string = r'"(1|2|3|4|5|6|7|8|9|0|A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N' + r'|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|! |' + scaped_chars + "|" + operators + ')*"' tilde_string = r"'(1|2|3|4|5|6|7|8|9|0|A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N' + r'|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|! |" + scaped_chars + ")*'" @@ -286,6 +259,7 @@ def build_cool_grammar(): (dot_comma, ';'), (arroba, '@'), (assign, r''), (ge, '>='), diff --git a/src/parserr/shiftreduce.py b/src/parserr/shiftreduce.py index f1591d3c..b9a30c7f 100755 --- a/src/parserr/shiftreduce.py +++ b/src/parserr/shiftreduce.py @@ -2,6 +2,7 @@ Este modulo contiene la declaracion de la clase ShiftReduceParser, la cual sirve de base para los parsers SLR, LALR y LR ''' +from grammar.grammar import EOF class ShiftReduceParser: @@ -30,6 +31,10 @@ def __call__(self, tokens): cursor = 0 output = [] + if isinstance(tokens[0].token_type, EOF): + raise SyntaxError( + "(0,0) - SyntacticError: Cool program must not be empty.") + while True: state = stack[-1] lookahead = tokens[cursor].token_type @@ -37,9 +42,9 @@ def __call__(self, tokens): action, tag = self.action[state, lookahead] except KeyError: col = tokens[cursor].token_column - len(tokens[cursor].lex) - raise SyntaxError( - f'({tokens[cursor].token_line},{col}) - ' - + f' SyntacticError: ERROR "%s"' % tokens[cursor].lex) + raise SyntaxError(f'({tokens[cursor].token_line},{col}) - ' + + f' SyntacticError: ERROR "%s"' % + tokens[cursor].token_type) if action == self.SHIFT: cursor += 1 diff --git a/src/testing.py b/src/testing.py index 568cb104..bbd97864 100755 --- a/src/testing.py +++ b/src/testing.py @@ -1,107 +1,33 @@ from coolgrammar import grammar -from lexer import tokenizer -from parserr.lr import LALRParser, LR1Parser -from parserr.shiftreduce import ShiftReduceParser -import cloudpickle +from parserr.lr import LALRParser from comments import find_comments GRAMMAR, LEXER = grammar.build_cool_grammar() PARSER = LALRParser(GRAMMAR, verbose=True) prog = r""" -(* Case expressions provide runtime type tests on objects *) - -class Main { - main(): Object { - (new Alpha).print() - }; -}; - -class Test { - test1: Object; - - testing1(): Int { - 2 + 2 - }; - - test2: Int <- 1; - - test3: String <- "1"; - - testing2(a: Alpha, b: Int): Int { - 2 + 2 - }; - - testing3(): String { - "2 + 2" - }; - - testing4(x: Int, y: Int): Test { - self - }; - - testing5(a: String, b: String): IO { - If a.length() < b.length() THeN - new IO.out_string("La cadena \"".concat(b).concat("\" es mas larga que la cadena \"").concat(a).concat("\".")) - eLSe - if a.length() = b.length() THeN - new IO.out_string("La cadena \"".concat(a).concat("\" mide igual que la cadena \"").concat(b).concat("\".")) - ElsE - new IO.out_string("La cadena \"".concat(a).concat("\" es mas larga que la cadena \"").concat(b).concat("\".")) - fI - Fi - }; - - testing6(a: Int): IO { - let count: Int <- 0, pow: Int - in { - -- count <- 0; - pow <- 1; - while pow < a - loop - { - count <- count + 1; - pow <- pow * 2; - } - pool; - new IO.out_string("El logaritmo en base 2 de ").out_int(a).out_string(" es ").out_int(count); +class Main inherits IO { + main() : Object { + { + out_string("Enter number of numbers to multiply\n"); + out_int(prod(in_int())); + out_string("\n"); + } + }; + + prod(i : Int) : Int { + let y : Int <- 1 in { + while (not (i = 0) ) loop { + out_string("Enter Number: "); + y <- y * in_int(Main : Int); -- the parser correctly catches the error here + i <- i - 1; + } + pool; + y; } }; - - testing7(): Object { - case true of - x: Int => new IO.out_string("Es un entero!"); - y: String => new IO.out_string("Es una cadena!"); - Mazinger_Z: Bool => new IO.out_string("Es un booleano!"); -- Identifiers starts with a lowercase letter - esac - }; -}; - -class Test2 { - test1: Test <- new Test; - - testing1(): Test { - test1.testing4(1 + 1, 1 + 2).testing4(2 + 3, 3 + 5).testing4(5 + 8, 8 + 13) - }; - - testing2(x: Int, y: Int): Test2 { - self - }; - - testing3(): Test2 { - testing2(1 + 1, 1 + 2).testing2(2 + 3, 3 + 5).testing2(5 + 8, true + fALSE) - }; - - testing4(): Object { - test1@Object.copy() - }; -}; - -class Alpha inherits IO { - print() : Object { - out_string("reached!!\n") - }; }; """ + # First Round of tests TOKS = None try: From a5c258acadf152e807dbc26e01e911dcb3697f88 Mon Sep 17 00:00:00 2001 From: Adrian Date: Sat, 22 Feb 2020 17:22:06 -0500 Subject: [PATCH 017/162] Passed every parser test. --- src/.builds | 2 ++ src/comments.py | 2 +- src/coolgrammar/grammar.py | 8 +++++--- src/makefile | 10 ++++++---- src/parserr/shiftreduce.py | 2 +- src/testing.py | 24 +++++++----------------- 6 files changed, 22 insertions(+), 26 deletions(-) diff --git a/src/.builds b/src/.builds index 5dea9418..f6d8fb48 100644 --- a/src/.builds +++ b/src/.builds @@ -96,3 +96,5 @@ 1 1 1 +1 +1 diff --git a/src/comments.py b/src/comments.py index 0be04796..e24dde7e 100644 --- a/src/comments.py +++ b/src/comments.py @@ -58,7 +58,7 @@ def find_comments(program: str) -> str: try: i, char = next(iter_char) column += 1 - if char == '-': + if char == '-' and i > 0 and program[i-1] != '<': i, char = next(iter_char) column += 1 if char == '-': diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index aac0a2f4..33e9fa0d 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -129,9 +129,9 @@ def build_cool_grammar(): exp %= atom, lambda s: s[1] - exp %= opar + atom + cpar, lambda s: s[2] + #exp %= opar + atom + cpar, lambda s: s[2] - exp %= arith, lambda s: s[1] + #exp %= arith, lambda s: s[1] exp %= block, lambda s: s[1] @@ -160,7 +160,7 @@ def build_cool_grammar(): factor %= if_ + exp + then + exp + else_ + exp + fi, lambda s: IfThenElseNode( s[2], s[4], s[6]) - factor %= opar + arith + cpar, lambda s: s[2] + factor %= opar + atom + cpar, lambda s: s[2] factor %= num, lambda s: IntegerConstant(s[1]) @@ -191,6 +191,8 @@ def build_cool_grammar(): atom %= arith + le + arith, lambda s: LowerEqual(s[1], s[3]) + atom %= arith, lambda s: s[1] + typex %= intx, lambda s: 'int' typex %= boolean, lambda s: 'bool' diff --git a/src/makefile b/src/makefile index 6d0a486c..4e1a5d30 100644 --- a/src/makefile +++ b/src/makefile @@ -20,7 +20,7 @@ endif #define some macros COMPSTRUCTFILE=compiler_struct.py -PIPREQUIREMENTS=cloudpickle pyinstaller +PIPREQUIREMENTS=cloudpickle pyinstaller progressbar # pyinstaller modules COOLCIMPORTS= ~/.pycoocl @@ -30,15 +30,17 @@ $MODULES= abstract automatons baseNodeTree coolgrammar grammar lexer parserr too # This is intended for setting a local compiler for testing. main: @echo "[*] Installing python dependencies" - @$(PIP) install --user $(PIPREQUIREMENTS) + @$(PIP) install $(PIPREQUIREMENTS) @echo "[*] Compiling Cool Lexical structures" + @mkdir build + @touch build/$(COMPSTRUCTFILE) @$(PYTHON) install.py build/$(COMPSTRUCTFILE) @touch build/__init__.py @echo 1 >> .builds clean: - rm -rf build/* - rm -rf dist/* + rm -rf build + rm -rf dist test: pytest ../tests -v --tb=short -m=${TAG} diff --git a/src/parserr/shiftreduce.py b/src/parserr/shiftreduce.py index b9a30c7f..8c5b83da 100755 --- a/src/parserr/shiftreduce.py +++ b/src/parserr/shiftreduce.py @@ -44,7 +44,7 @@ def __call__(self, tokens): col = tokens[cursor].token_column - len(tokens[cursor].lex) raise SyntaxError(f'({tokens[cursor].token_line},{col}) - ' + f' SyntacticError: ERROR "%s"' % - tokens[cursor].token_type) + tokens[cursor].lex) if action == self.SHIFT: cursor += 1 diff --git a/src/testing.py b/src/testing.py index bbd97864..049630ac 100755 --- a/src/testing.py +++ b/src/testing.py @@ -5,25 +5,15 @@ GRAMMAR, LEXER = grammar.build_cool_grammar() PARSER = LALRParser(GRAMMAR, verbose=True) prog = r""" -class Main inherits IO { - main() : Object { - { - out_string("Enter number of numbers to multiply\n"); - out_int(prod(in_int())); - out_string("\n"); - } +class Test { + testing4(): Int { + test1 <-- ~(1 + 2 + 3 + 4 + 5) -- The left side must be an expression }; +}; - prod(i : Int) : Int { - let y : Int <- 1 in { - while (not (i = 0) ) loop { - out_string("Enter Number: "); - y <- y * in_int(Main : Int); -- the parser correctly catches the error here - i <- i - 1; - } - pool; - y; - } +class Alpha inherits IO { + print() : Object { + out_string("reached!!\n") }; }; """ From bced31311880c2daf923a86dcaa8601f6bb193e9 Mon Sep 17 00:00:00 2001 From: Adrian Date: Sat, 29 Feb 2020 19:19:19 -0500 Subject: [PATCH 018/162] Added names to doc/Readme.md. Added semantic check to pipeline. --- doc/Readme.md | 9 ++++++--- src/.builds | 4 ++++ src/abstract/tree.py | 10 +++------- src/abstract/typetree.py | 17 ++++++++++------- src/lexer/regexgenerator.py | 5 ----- src/pycoolc.py | 29 ++++++++++++++++++++++++++--- src/typecheck/evaluator.py | 20 +++++++++----------- 7 files changed, 58 insertions(+), 36 deletions(-) diff --git a/doc/Readme.md b/doc/Readme.md index 402477c8..9a65f094 100644 --- a/doc/Readme.md +++ b/doc/Readme.md @@ -4,9 +4,12 @@ **Nombre** | **Grupo** | **Github** --|--|-- -Nombre1 Apellido1 Apellido2 | C4xx | [@github_user](https://github.com/) -Nombre2 Apellido1 Apellido2 | C4xx | [@github_user](https://github.com/) -Nombre3 Apellido1 Apellido2 | C4xx | [@github_user](https://github.com/) + +Adrian Gonzalez Sanchez | C412 | [@adriangs1996](https://github.com/adriangs1996) + +Eliane Puerta Cabrera | C412 | [@NaniPuerta](https://github.com/NaniPuerta) + +Liset Alfaro | C411 | [@LisetAlfaro](https://github.com/LisetAlfaro) ## Readme diff --git a/src/.builds b/src/.builds index f6d8fb48..7d43bf4d 100644 --- a/src/.builds +++ b/src/.builds @@ -98,3 +98,7 @@ 1 1 1 +1 +1 +1 +1 diff --git a/src/abstract/tree.py b/src/abstract/tree.py index 63c6f976..7d4a1009 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -1,7 +1,3 @@ -from abstract.semantics import ObjectType, IntegerType, StringType, BoolType, VoidType -from abstract.semantics import Context - - class Node: pass @@ -20,11 +16,11 @@ def __init__(self, class_list): def check_semantics(self, deep=1): from travels import typecollector, typebuilder, inference - #recolectar los tipos + # recolectar los tipos type_collector = typecollector.TypeCollector() type_collector.visit(self) - #Construir los tipos detectados en el contexto + # Construir los tipos detectados en el contexto type_builder = typebuilder.TypeBuilder(type_collector.context, type_collector.errors) type_builder.visit(self) @@ -37,7 +33,7 @@ def check_semantics(self, deep=1): print(d) scope = inferer.visit(self, scope=scope, deep=d) print(scope) - #reportar los errores + # reportar los errores return errors, type_builder.context diff --git a/src/abstract/typetree.py b/src/abstract/typetree.py index 9946c9ca..1a277374 100755 --- a/src/abstract/typetree.py +++ b/src/abstract/typetree.py @@ -1,7 +1,8 @@ from abstract.semantics import Type, IntegerType, BoolType, VoidType, ObjectType, StringType + class TreeNode: - def __init__(self, root, children = []): + def __init__(self, root, children=[]): self.root = root self.children = children self.parent = None @@ -11,21 +12,23 @@ def _add_node(self, new_node: Type): child.parent = self self.children.append(new_node) + class TypeTree: def __init__(self): - self.tree = TreeNode(ObjectType(),[TreeNode(IntegerType()),TreeNode(StringType()),TreeNode(BoolType())]) + self.tree = TreeNode(ObjectType(), [ + TreeNode(IntegerType()), + TreeNode(StringType()), + TreeNode(BoolType()) + ]) - def insert(self,node: Type): + def insert(self, node: Type): stack = [self.tree] with None as parent: while True: - current_node = stack.pop() + current_node = stack.pop() parent = current_node.root if node.parent == parent: break for child in current_node.children: stack.append(child) current_node._add_node(node) - - - \ No newline at end of file diff --git a/src/lexer/regexgenerator.py b/src/lexer/regexgenerator.py index 843cac29..5212d4a5 100755 --- a/src/lexer/regexgenerator.py +++ b/src/lexer/regexgenerator.py @@ -9,8 +9,6 @@ from parserr.ll1 import build_ll1_parser from tools.evaluate import evaluate_parse -#%% - class EpsilonNode(AtomicNode): def evaluate(self): @@ -83,9 +81,6 @@ def operate(value): return automata_union(value, EpsilonNode('').evaluate()) -#%% - - class Regex(object): def __init__(self, regex, ignore_white_space=True): self.regex = regex diff --git a/src/pycoolc.py b/src/pycoolc.py index 4f02c11b..ef17e1ea 100644 --- a/src/pycoolc.py +++ b/src/pycoolc.py @@ -1,10 +1,16 @@ from build.compiler_struct import LEXER, PARSER +from typecheck.evaluator import evaluate_right_parse from comments import find_comments from argparse import ArgumentParser import sys -def pipeline(program: str) -> None: +def report(errors: list): + for error in errors: + print(error) + + +def pipeline(program: str, deep: int) -> None: try: program = find_comments(program) except AssertionError as e: @@ -24,13 +30,30 @@ def pipeline(program: str) -> None: except Exception as e: print(e) sys.exit(1) + # build the AST from the obtained parse + try: + ast = evaluate_right_parse(parse, tokens[:-1]) + except Exception as e: + print(e) + sys.exit(1) + ##################### + # Start the visitors # + ###################### + + # Run type checker visitor + errors, context = ast.check_semantics(deep) + if errors: + report(errors) + sys.exit(1) if __name__ == '__main__': parser = ArgumentParser() - parser.add_argument('file', type=str) + parser.add_argument('file', type=str, help="Cool source file.") + parser.add_argument('--deep', type=int) args = parser.parse_args() + deep = 3 if args.deep is None else args.deep with open(args.file, "r") as f: program = f.read() - pipeline(program) + pipeline(program, deep) sys.exit(0) diff --git a/src/typecheck/evaluator.py b/src/typecheck/evaluator.py index d254de85..570fc3ac 100755 --- a/src/typecheck/evaluator.py +++ b/src/typecheck/evaluator.py @@ -1,21 +1,19 @@ -import grammar.grammar as gr - def evaluate_right_parse(parse: [], tokens): - - def evaluate_production(productions, production: gr.AttributeProduction, tokens): + def evaluate_production(productions, production, tokens): synteticed = [None] * (len(production.Right) + 1) rules = production.attributes - - for i,symbol in enumerate(production.Right[::-1],1): + + for i, symbol in enumerate(production.Right[::-1], 1): if symbol.IsTerminal: synteticed[len(synteticed) - i] = next(tokens).lex else: - synteticed[len(synteticed) - i] = evaluate_production(productions, next(productions), tokens) - + synteticed[len(synteticed) - i] = evaluate_production( + productions, next(productions), tokens) + rule = rules[0] return rule(synteticed) if rule else None - + parse = iter(parse) tokens = iter(tokens[::-1]) - - return evaluate_production(parse, next(parse),tokens) \ No newline at end of file + + return evaluate_production(parse, next(parse), tokens) From 63244e4a2d178acedcb673fa80fa964f023edca7 Mon Sep 17 00:00:00 2001 From: Adrian Date: Mon, 13 Apr 2020 17:18:23 -0400 Subject: [PATCH 019/162] [CHANGE] Used re to implement tokenizer instead of Lexer Class. --- src/.builds | 19 +++++ src/comments.py | 10 +-- src/coolgrammar/grammar.py | 170 +++++++++++++++++++++++++------------ src/pycoolc.py | 2 +- src/testing.py | Bin 816 -> 853 bytes src/tknizer.py | 93 ++++++++++++++++++++ 6 files changed, 232 insertions(+), 62 deletions(-) create mode 100644 src/tknizer.py diff --git a/src/.builds b/src/.builds index 7d43bf4d..98e6694b 100644 --- a/src/.builds +++ b/src/.builds @@ -102,3 +102,22 @@ 1 1 1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 diff --git a/src/comments.py b/src/comments.py index e24dde7e..b81ec68e 100644 --- a/src/comments.py +++ b/src/comments.py @@ -58,7 +58,7 @@ def find_comments(program: str) -> str: try: i, char = next(iter_char) column += 1 - if char == '-' and i > 0 and program[i-1] != '<': + if char == '-' and i > 0 and program[i - 1] != '<': i, char = next(iter_char) column += 1 if char == '-': @@ -67,14 +67,14 @@ def find_comments(program: str) -> str: if stack: first = stack.pop() pairs.append((first, i)) - column = 1 - line += 1 + column = 1 + line += 1 elif char == '\n': if stack: first = stack.pop() pairs.append((first, i)) - column = 1 - line += 1 + column = 1 + line += 1 except StopIteration: break while pairs: diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index 33e9fa0d..07db1edd 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -10,6 +10,7 @@ from abstract.tree import ActionNode, CaseNode, ParentFuncCall, BlockNode, IsVoidNode from abstract.tree import NegNode from lexer.tokenizer import Lexer +from tknizer import Tokenizer def build_cool_grammar(): @@ -234,64 +235,121 @@ def build_cool_grammar(): tilde_string = r"'(1|2|3|4|5|6|7|8|9|0|A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N' + r'|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|! |" + scaped_chars + ")*'" + # table = [ + # (class_keyword, '(c|C)(l|L)(a|A)(s|S)(s|S)'), + # (def_keyword, '(d|D)(e|E)(f|F)'), + # (in_keyword, '(i|I)(n|N)'), + # (intx, 'Int'), + # (boolean, 'Bool'), + # (objectx, 'Object'), + # (string, 'String'), + # (true, ' true'), + # (false, 'false'), + # (auto, 'AUTO_TYPE'), + # (if_, '(i|I)(f|F)'), + # (then, '(t|T)(h|H)(e|E)(n|N)'), + # (else_, '(e|E)(l|L)(s|S)(e|E)'), + # (new, '(n|N)(e|E)(w|W)'), + # (while_, '(w|W)(h|H)(i|I)(l|L)(e|E)'), + # (do, '(d|D)(o|O)'), + # (esac, '(e|E)(s|S)(a|A)(c|C)'), + # (case, '(c|C)(a|A)(s|S)(e|E)'), + # (of, '(o|O)(f|F)'), + # (inherits, '(i|I)(n|N)(h|H)(e|E)(r|R)(i|I)(t|T)(s|S)'), + # (coma, ','), + # (period, '.'), + # (dd, ':'), + # (dot_comma, ';'), + # (arroba, '@'), + # (assign, r''), + # (ge, '>='), + # (le, '<='), + # (eq, '='), + # (not_, r'!~'), + # (opar, r'!('), + # (cpar, r'!)'), + # (obrack, r'!{'), + # (cbrack, r'!}'), + # (plus, r'!+'), + # (minus, r'!-'), + # (implies, r'=>'), + # (div, '/'), + # (star, r'!*'), + # (let, '(l|L)(e|E)(t|T)'), + # (fi, '(f|F)(i|I)'), + # (pool, '(p|P)(o|O)(o|O)(l|L)'), + # (loop, '(l|L)(o|O)(o|O)(p|P)'), + # (isvoid, '(i|I)(s|S)(v|V)(o|O)(i|I)(d|D)'), + # (idx, '(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|' + + # 'q|r|s|t|u|v|w|x|y|z)(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N|n|O|o|P|p|' + # + 'Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|_|1|2|3|4|5|6|7|8|9|0)*'), + # (num, '(1|2|3|4|5|6|7|8|9|0)+'), + # (tilde_string_const, tilde_string), + # (quoted_string_const, quoted_string), + # (classid, '(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|' + + # 'Q|R|S|T|U|V|W|X|Y|Z)(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N|n|O|o|P|p|' + # + 'Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|_|1|2|3|4|5|6|7|8|9|0)*'), + # ] + + # lexer = Lexer(table, G.EOF, ignore_white_space=False) table = [ - (class_keyword, '(c|C)(l|L)(a|A)(s|S)(s|S)'), - (def_keyword, '(d|D)(e|E)(f|F)'), - (in_keyword, '(i|I)(n|N)'), - (intx, 'Int'), - (boolean, 'Bool'), - (objectx, 'Object'), - (string, 'String'), - (true, ' true'), - (false, 'false'), - (auto, 'AUTO_TYPE'), - (if_, '(i|I)(f|F)'), - (then, '(t|T)(h|H)(e|E)(n|N)'), - (else_, '(e|E)(l|L)(s|S)(e|E)'), - (new, '(n|N)(e|E)(w|W)'), - (while_, '(w|W)(h|H)(i|I)(l|L)(e|E)'), - (do, '(d|D)(o|O)'), - (esac, '(e|E)(s|S)(a|A)(c|C)'), - (case, '(c|C)(a|A)(s|S)(e|E)'), - (of, '(o|O)(f|F)'), - (inherits, '(i|I)(n|N)(h|H)(e|E)(r|R)(i|I)(t|T)(s|S)'), - (coma, ','), - (period, '.'), - (dd, ':'), - (dot_comma, ';'), - (arroba, '@'), - (assign, r''), - (ge, '>='), - (le, '<='), - (eq, '='), - (not_, r'!~'), - (opar, r'!('), - (cpar, r'!)'), - (obrack, r'!{'), - (cbrack, r'!}'), - (plus, r'!+'), - (minus, r'!-'), + (class_keyword, r'(?i)class'), + (def_keyword, r'(?i)def'), + (in_keyword, r'(?i)in'), + (intx, r'Int'), + (boolean, r'Bool'), + (objectx, r'Object'), + (string, r'String'), + (true, r'true'), + (false, r'false'), + (auto, r'AUTO_TYPE'), + (if_, r'(?i)if'), + (then, r'(?i)then'), + (else_, r'(?i)else'), + (new, r'(?i)new'), + (while_, r'(?i)while'), + (do, r'(?i)do'), + (esac, r'(?i)esac'), + (case, r'(?i)case'), + (of, r'(?i)of'), + (inherits, r'(?i)inherits'), + (coma, r','), + (period, r'\.'), + (dd, r'\:'), + (dot_comma, r';'), + (arroba, r'@'), + (assign, r'<-'), + (not_operator, r'(?i)not'), + (lt, r'<'), + (gt, r'>'), + (ge, r'>='), + (le, r'<='), + (eq, r'='), + (not_, r'\~'), + (opar, r'\('), + (cpar, r'\)'), + (obrack, r'\{'), + (cbrack, r'\}'), + (plus, r'\+'), + (minus, r'\-'), (implies, r'=>'), (div, '/'), - (star, r'!*'), - (let, '(l|L)(e|E)(t|T)'), - (fi, '(f|F)(i|I)'), - (pool, '(p|P)(o|O)(o|O)(l|L)'), - (loop, '(l|L)(o|O)(o|O)(p|P)'), - (isvoid, '(i|I)(s|S)(v|V)(o|O)(i|I)(d|D)'), - (idx, '(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|' + - 'q|r|s|t|u|v|w|x|y|z)(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N|n|O|o|P|p|' - + 'Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|_|1|2|3|4|5|6|7|8|9|0)*'), - (num, '(1|2|3|4|5|6|7|8|9|0)+'), - (tilde_string_const, tilde_string), - (quoted_string_const, quoted_string), - (classid, '(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|' + - 'Q|R|S|T|U|V|W|X|Y|Z)(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N|n|O|o|P|p|' - + 'Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|_|1|2|3|4|5|6|7|8|9|0)*'), + (star, r'\*'), + (let, r'(?i) let'), + (fi, r'(?i)fi'), + (pool, r'(?i)pool'), + (loop, r'(?i)loop'), + (isvoid, r'(?i)isvoid'), + (idx, r'[a-z]\w*'), + (num, r'\d+'), + (tilde_string_const, r"('(?:[^'\\]|\\'|\\|\\\n)*')"), + (quoted_string_const, r'("(?:[^\n"\\]|\\"|\\|\\\n)*")'), + (classid, r'[A-Z]\w*'), + ("StringError", r'("(?:[^"\\]|\\|\\"|\\\n)*\n)'), + ("StringEOF", r'("(?:[^\n"\\]|\\\n|\\"|\\)*)') ] - - lexer = Lexer(table, G.EOF, ignore_white_space=False) + lexer = Tokenizer(table, G.EOF) return G, lexer diff --git a/src/pycoolc.py b/src/pycoolc.py index ef17e1ea..87a0e0dd 100644 --- a/src/pycoolc.py +++ b/src/pycoolc.py @@ -19,7 +19,7 @@ def pipeline(program: str, deep: int) -> None: # Right now, program has no comments, so is safe to pass it to the LEXER try: - tokens = LEXER(r"%s" % program) + tokens = LEXER(program) except Exception as e: print(e) sys.exit(1) diff --git a/src/testing.py b/src/testing.py index 049630acbd8868a706f13a137da227e8e532aa7a..aedceb221534cbadf454ca22fbafa639a2276c22 100755 GIT binary patch delta 289 zcmX|6Jx+r$4CPOi2$!&eguZq_1y0a~rAQ1gdU3xbZBjRpl6*s_UID4+K;jY{fy*%A zw4#=*_x${9%U`3P(Z}~rYu!y?2Bl^nm$0EN#8jbAv67EaR~F*H3|+sXOntQ(a5}z+ zS=>UBZiZ7swc&*YAA25*H9~;?7f;4YXqTiFhmnxpMTfXt5Xy zf*M3?zG4Jf1MxCtUpEOf;sQ}T<>B!Ov1&!8I4W{Uz06r=f@|l`4ooZgTB%!j_WRFs Wdo7>W?)`QCw!gXfy*dzedG`myv|*+I delta 248 zcmYk0Jqp4=6ogUHBBvO)kOUF&55(A5TG?0%vc{)biJP!*1wqs+2)T%@2k;1<#0$8H ziVr?`%)rb%D%Z;8eufc3cu^vmF(tM*cyMRktMt0-2Lp`tSN%FI3>yuc{1)nHJ35Z8 zqZh#G)0mLZ%7WFBu-&=P1wm@iJ~PCuQvL2YhTd@=dY|%9lEo5A$7Gacj3=KZnNiyM u0S1^XHWd9&Nq2V6*7<8+7?M#;%W8F|MevIc^IIX!`^9HDlZGj8mTE6>K1cfi diff --git a/src/tknizer.py b/src/tknizer.py new file mode 100644 index 00000000..ed2b60fd --- /dev/null +++ b/src/tknizer.py @@ -0,0 +1,93 @@ +import re +from lexer.tokens import Token +from grammar.grammar import Terminal + + +class Tokenizer: + def __init__(self, regex_table, eof): + self.regexs = self._build_regexs(regex_table) + self.eof = eof + self.line = 1 + self.column = 1 + + def _build_regexs(self, regex_table): + regexs = regex_table + fixed_line_token = '\n' + fixed_space_token = ' ' + + regexs.append(("Line", fixed_line_token)) + regexs.append(("Space", fixed_space_token)) + return regexs + + def _walk(self, string): + matched_suffix = '' + tt = None + + for token_type, regex in self.regexs: + match = re.match(regex, string) + if match is not None: + msuffix = match.group() + if len(msuffix) > len(matched_suffix): + matched_suffix = msuffix + tt = token_type + + return matched_suffix, tt + + def _tokenize(self, text): + while text: + string = text + suffix, token_type = self._walk(string) + if token_type is None: + next_token = string.split()[0] + raise SyntaxError( + f'({self.line},{self.column}) - LexicographicError: Unexpected Token %s' + % next_token) + elif token_type in ("StringError", "StringEOF"): + newlines = re.split(r"\\\n|\n", suffix.strip()) + if len(newlines) > 1: + self.line += len(newlines) - 1 + self.column = len(newlines[-1]) + 1 + else: + self.column += len(newlines[0]) + raise SyntaxError( + f'{self.line, self.column} - LexicographicError: {token_type} {suffix}' + ) + elif token_type == "Line": + self.column = 1 + self.line += 1 + elif token_type == "Space": + self.column += 1 + elif isinstance(token_type, Terminal) and token_type.Name in ( + "quoted_string_const", "tilde_string_const"): + if '\0' in suffix: + newlines = re.split(r"\\\n", suffix) + for line in newlines: + if '\0' in line: + self.column = line.index('\0') + 1 + raise SyntaxError( + f'{self.line, self.column} - LexicographicError: String contains null character' + ) + line += 1 + # Strings may have some troubles with rows and columns + newlines = re.split(r"\\\n", suffix) + # Now we have a list with every line of the string + # we need to sum every line to the lines and make + # columns equal to the length of the last line. + # Note that in case no scaped newline is found in + # string, then splits return a single element list + # with the full list, so next code should do + # the work. + self.line += len(newlines) - 1 + self.column = len(newlines[-1]) + else: + self.column += len(suffix) + yield suffix, token_type + text = text[len(suffix):] + yield '$', self.eof + + def __call__(self, text): + tokens = [] + for lex, token_type in self._tokenize(text): + if token_type not in ("Line", "Space"): + tokens.append(Token(lex, token_type, self.column, self.line)) + return tokens From 7a30adf046ab4e1a352c88493f74b1d66c42a8f9 Mon Sep 17 00:00:00 2001 From: Adrian Date: Sat, 9 May 2020 15:51:00 -0400 Subject: [PATCH 020/162] Formatting and CIL AST template. --- src/.builds | 1 + src/cil/nodes.py | 161 ++++++++++++++++++++++++++++ src/coolgrammar/grammar.py | 69 ------------ src/travels/context_actions.py | 17 ++- src/travels/inference.py | 185 ++++++++++++++++++++------------- 5 files changed, 286 insertions(+), 147 deletions(-) create mode 100644 src/cil/nodes.py diff --git a/src/.builds b/src/.builds index 98e6694b..090fb49d 100644 --- a/src/.builds +++ b/src/.builds @@ -121,3 +121,4 @@ 1 1 1 +1 diff --git a/src/cil/nodes.py b/src/cil/nodes.py new file mode 100644 index 00000000..d441e1ae --- /dev/null +++ b/src/cil/nodes.py @@ -0,0 +1,161 @@ +""" +Define a hierachy to represent each CIL instruction. +Every CIL Instruction would be a Node of an AST, and every\ +node would known how to generate its corresponding MIPS Code. +""" + + +class CilNode: + pass + + +class CilProgramNode(CilNode): + def __init__(self, dottypes, dotdata, dotcode): + self.dottypes = dottypes + self.dotdata = dotdata + self.dotcode = dotcode + + +class TypeNode(CilNode): + def __init__(self, name): + self.name = name + self.attributes = [] + self.methods = [] + + +class DataNode(CilNode): + def __init__(self, vname, value): + self.name = vname + self.value = value + + +class FunctionNode(CilNode): + def __init__(self, fname, params, lvars, instr): + self.name = fname + self.params = params + self.localvars = lvars + self.instructions = instr + + +class ParamNode(CilNode): + def __init__(self, name): + self.name = name + + +class LocalNode(CilNode): + def __init__(self, name): + self.name + + +class InstructionNode(CilNode): + pass + + +class ArithmeticNode(InstructionNode): + def __init__(self, dest, left, right): + self.dest = dest + self.left = left + self.dest = right + + +class AssignNode(InstructionNode): + def __init__(self, dest, source): + self.dest = dest + self.source = source + + +class PlusNode(ArithmeticNode): + pass + + +class MinusNode(ArithmeticNode): + pass + + +class StarNode(ArithmeticNode): + pass + + +class DivNode(ArithmeticNode): + pass + +class GetAttributeNode(InstructionNode): + pass + +class SetAttributeNode(InstructionNode): + pass + +class GetIndexNode(InstructionNode): + pass + +class SetIndexNode(InstructionNode): + pass + +class AllocateNode(InstructionNode): + def __init__(self, itype, dest): + self.itype = itype + self.dest = dest + +class ArrayNode(InstructionNode): + pass + +class TypeOfNode(InstructionNode): + pass + +class LabelNode(InstructionNode): + pass + +class GotoNode(InstructionNode): + pass + +class GotoIfNode(InstructionNode): + pass + +class StaticCallNode(InstructionNode): + def __init__(self, function, dest): + self.function = function + self.dest = dest + +class DynamicCallNode(InstructionNode): + def __init__(self, xtype, method, dest): + self.xtype = xtype + self.method = method + self.dest = dest + +class ArgNode(InstructionNode): + def __init__(self, name): + self.name = name + +class ReturnNode(InstructionNode): + def __init__(self, value=None): + self.value = value + +class LoadNode(InstructionNode): + def __init__(self, dest, message): + self.dest = dest + self.message = message + +class LengthNode(InstructionNode): + pass + +class ConcatNode(InstructionNode): + pass + +class PrefixNode(InstructionNode): + pass + +class SubstringNode(InstructionNode): + pass + +class ToStrNode(InstructionNode): + def __init__(self, dest, ivalue): + self.dest = dest + self.ivalue = ivalue + +class ReadNode(InstructionNode): + def __init__(self, dest): + self.dest = dest + +class PrintNode(InstructionNode): + def __init__(self, string_address): + self.string_address = string_address diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index 07db1edd..c70c0f71 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -226,75 +226,6 @@ def build_cool_grammar(): case_statement %= case + exp + of + actions + \ esac, lambda s: CaseNode(s[2], s[4]) - scaped_chars = r"(\a)|(\b)|(\c)|(\d)|(\e)|(\f)|(\g)|(\h)|(\i)|(\j)" +\ - r"|(\k)|(\l)|(\m)|(\n)|(\o)|(\p)|(\q)|(\r)|(\s)|(\t)|(\u)|(\v)|(\x)|(\y)|(\z)" +\ - r'|(!\")' + r"|(!\')" - - operators = r"!+|!*|!-|!/|!(|!)|!=|!.|!>|!<|!:|!?|!#|!," - quoted_string = r'"(1|2|3|4|5|6|7|8|9|0|A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N' + r'|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|! |' + scaped_chars + "|" + operators + ')*"' - - tilde_string = r"'(1|2|3|4|5|6|7|8|9|0|A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N' + r'|n|O|o|P|p|Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|! |" + scaped_chars + ")*'" - - # table = [ - # (class_keyword, '(c|C)(l|L)(a|A)(s|S)(s|S)'), - # (def_keyword, '(d|D)(e|E)(f|F)'), - # (in_keyword, '(i|I)(n|N)'), - # (intx, 'Int'), - # (boolean, 'Bool'), - # (objectx, 'Object'), - # (string, 'String'), - # (true, ' true'), - # (false, 'false'), - # (auto, 'AUTO_TYPE'), - # (if_, '(i|I)(f|F)'), - # (then, '(t|T)(h|H)(e|E)(n|N)'), - # (else_, '(e|E)(l|L)(s|S)(e|E)'), - # (new, '(n|N)(e|E)(w|W)'), - # (while_, '(w|W)(h|H)(i|I)(l|L)(e|E)'), - # (do, '(d|D)(o|O)'), - # (esac, '(e|E)(s|S)(a|A)(c|C)'), - # (case, '(c|C)(a|A)(s|S)(e|E)'), - # (of, '(o|O)(f|F)'), - # (inherits, '(i|I)(n|N)(h|H)(e|E)(r|R)(i|I)(t|T)(s|S)'), - # (coma, ','), - # (period, '.'), - # (dd, ':'), - # (dot_comma, ';'), - # (arroba, '@'), - # (assign, r''), - # (ge, '>='), - # (le, '<='), - # (eq, '='), - # (not_, r'!~'), - # (opar, r'!('), - # (cpar, r'!)'), - # (obrack, r'!{'), - # (cbrack, r'!}'), - # (plus, r'!+'), - # (minus, r'!-'), - # (implies, r'=>'), - # (div, '/'), - # (star, r'!*'), - # (let, '(l|L)(e|E)(t|T)'), - # (fi, '(f|F)(i|I)'), - # (pool, '(p|P)(o|O)(o|O)(l|L)'), - # (loop, '(l|L)(o|O)(o|O)(p|P)'), - # (isvoid, '(i|I)(s|S)(v|V)(o|O)(i|I)(d|D)'), - # (idx, '(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|' + - # 'q|r|s|t|u|v|w|x|y|z)(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N|n|O|o|P|p|' - # + 'Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|_|1|2|3|4|5|6|7|8|9|0)*'), - # (num, '(1|2|3|4|5|6|7|8|9|0)+'), - # (tilde_string_const, tilde_string), - # (quoted_string_const, quoted_string), - # (classid, '(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|' + - # 'Q|R|S|T|U|V|W|X|Y|Z)(A|a|B|b|C|c|D|d|E|e|F|f|G|g|H|h|I|i|J|j|K|k|L|l|M|m|N|n|O|o|P|p|' - # + 'Q|q|R|r|S|s|T|t|u|U|V|v|W|w|X|x|Y|y|Z|z|_|1|2|3|4|5|6|7|8|9|0)*'), - # ] - - # lexer = Lexer(table, G.EOF, ignore_white_space=False) table = [ (class_keyword, r'(?i)class'), (def_keyword, r'(?i)def'), diff --git a/src/travels/context_actions.py b/src/travels/context_actions.py index 33268c2c..67bdc583 100755 --- a/src/travels/context_actions.py +++ b/src/travels/context_actions.py @@ -1,22 +1,29 @@ from abstract.semantics import * + def update_attr_type(current_type_: Type, attr_name: str, new_type: Type): for attr in current_type_.attributes: attr.type = new_type if attr.name == attr_name else attr.type -def update_method_param(current_type : Type, method: str, param_name: str, new_type: Type): + +def update_method_param(current_type: Type, method: str, param_name: str, + new_type: Type): m = current_type.methods[method] - for i,(pname, ptype) in enumerate(zip(m.param_names, m.param_types)): + for i, (pname, ptype) in enumerate(zip(m.param_names, m.param_types)): if pname == param_name: m.param_types[i] = new_type -def update_scope_variable(vname: str, new_type: Type, scope: Scope, index= None): + +def update_scope_variable(vname: str, + new_type: Type, + scope: Scope, + index=None): if not index: index = 0 - for i in range(index,len(scope.locals)): + for i in range(index, len(scope.locals)): if scope.locals[i].name == vname: scope.locals[i].type = new_type print(f'Changed {scope.locals[i].name} to type {new_type.name}') return if scope.parent: - update_scope_variable(vname, new_type, scope.parent, scope.index) \ No newline at end of file + update_scope_variable(vname, new_type, scope.parent, scope.index) diff --git a/src/travels/inference.py b/src/travels/inference.py index 2309bcdd..2f9b7d39 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -1,4 +1,3 @@ - from abstract.semantics import * from abstract.tree import * import typecheck.visitor as visitor @@ -6,6 +5,7 @@ void = VoidType() + class TypeInferer: """ Para inferir los tipos en un programa se aprovecha el AST devuelto al evaluar el parse de dicho programa. @@ -25,7 +25,7 @@ class TypeInferer: BOLEAN entonces el tipo de la expresión completa sera el Ancestro Común Mas Cercano a los tipos T1 y T2, o en otras palabras, el menor tipo T3 tal que T1 se conforme en T3 y T2 se conforme en T3. """ - def __init__(self,context: Context, errors = []): + def __init__(self, context: Context, errors=[]): self.context: Context = context self.current_type: Type = None self.INTEGER = self.context.get_type('int') @@ -37,8 +37,9 @@ def __init__(self,context: Context, errors = []): self.current_method = None @visitor.on('node') - def visit(self,node, scope,infered_type = None): + def visit(self, node, scope, infered_type=None): pass + #--------------------------------------------------------------------------------------------------------------------------# #-----------------------------------------------------EXPRESIONES----------------------------------------------------------# #--------------------------------------------------------------------------------------------------------------------------# @@ -47,25 +48,26 @@ def visit(self,node, scope,infered_type = None): # Calcular todos los tipos en el contexto del programa. | #--------------------------------------------------------------- @visitor.when(ProgramNode) - def visit(self, node, scope = None, infered_type = None, deep = 1): + def visit(self, node, scope=None, infered_type=None, deep=1): program_scope = Scope() if scope is None else scope print(f"Este es el scope en la vuelta {deep} :\n {program_scope}") if deep == 1: for class_ in node.class_list: - self.visit(class_,program_scope.create_child()) + self.visit(class_, program_scope.create_child()) else: - for class_, child_scope in zip(node.class_list, program_scope.children): - self.visit(class_,child_scope, deep = deep) + for class_, child_scope in zip(node.class_list, + program_scope.children): + self.visit(class_, child_scope, deep=deep) return program_scope - + #----------------------------------------------------------------- #Calcular los tipos en esta clase, visitar primero los atributos | #y luego los métodos para garantizar que al revisar los métodos | #ya todos los atributos estén definidos en el scope. | #----------------------------------------------------------------- @visitor.when(ClassDef) - def visit(self, node, scope: Scope, infered_type = None, deep = 1): - self.current_type:Type = self.context.get_type(node.idx) + def visit(self, node, scope: Scope, infered_type=None, deep=1): + self.current_type: Type = self.context.get_type(node.idx) for feature in node.features: if isinstance(feature, AttributeDef): self.visit(feature, scope, deep=deep) @@ -82,11 +84,14 @@ def visit(self, node, scope: Scope, infered_type = None, deep = 1): #Definir un atributo en el scope. | #--------------------------------------------------------- @visitor.when(AttributeDef) - def visit(self,node: AttributeDef, scope: Scope, infered_type = None, deep = 1): + def visit(self, + node: AttributeDef, + scope: Scope, + infered_type=None, + deep=1): atrib = self.current_type.get_attribute(node.idx) if deep == 1: - scope.define_variable(atrib.name,atrib.type) - + scope.define_variable(atrib.name, atrib.type) #--------------------------------------------------------------------- #Si el método no tiene un tipo definido, entonces tratar de inferir | @@ -95,7 +100,7 @@ def visit(self,node: AttributeDef, scope: Scope, infered_type = None, deep = 1): #los argumentos que no hayan sido definidos con tipos específicos. | #--------------------------------------------------------------------- @visitor.when(MethodDef) - def visit(self, node: MethodDef, scope, infered_type = None, deep = 1): + def visit(self, node: MethodDef, scope, infered_type=None, deep=1): print(node.idx) method = self.current_type.get_method(node.idx) self.current_method = method @@ -110,15 +115,16 @@ def visit(self, node: MethodDef, scope, infered_type = None, deep = 1): method.return_type = last else: if not last.conforms_to(method.return_type): - self.errors.append(f'Method {method.name} cannot return {last}') + self.errors.append( + f'Method {method.name} cannot return {last}') print(scope) - + @visitor.when(Param) - def visit(self, node: Param, scope: Scope, infered_type = None, deep = 1): + def visit(self, node: Param, scope: Scope, infered_type=None, deep=1): type_ = self.context.get_type(node.type) if deep == 1: scope.define_variable(node.id, type_) - + #------------------------------------------------------------------------- #Checkear si la variable a la que se le va a asignar el resultado de la | #expresión tiene un tipo bien definido: en caso de tenerlo, verificar que| @@ -126,7 +132,7 @@ def visit(self, node: Param, scope: Scope, infered_type = None, deep = 1): #trario asignarle a la variable el tipo de retorno de la expresión. | #------------------------------------------------------------------------- @visitor.when(AssignNode) - def visit(self, node: AssignNode, scope: Scope, infered_type = None, deep = 1): + def visit(self, node: AssignNode, scope: Scope, infered_type=None, deep=1): var_info = scope.find_variable(node.idx) if var_info: e = self.visit(node.expr, scope, infered_type) @@ -134,41 +140,55 @@ def visit(self, node: AssignNode, scope: Scope, infered_type = None, deep = 1): print(f'Infered type {e.name} for {node.idx}') var_info.type = e if not scope.is_local(var_info.name): - update_attr_type(self.current_type, var_info.name, var_info.type) + update_attr_type(self.current_type, var_info.name, + var_info.type) else: - update_method_param(self.current_type, self.current_method.name, var_info.name, var_info.type) + update_method_param(self.current_type, + self.current_method.name, + var_info.name, var_info.type) update_scope_variable(var_info.name, e, scope) return void else: if not e.conforms_to(var_info.type): - self.errors.append(f'Expresion of type {e.name} cannot be assigned to variable {var_info.name} of type {var_info.type.name}') + self.errors.append( + f'Expresion of type {e.name} cannot be assigned to variable {var_info.name} of type {var_info.type.name}' + ) return void else: self.errors.append(f'Undefined variable name: {node.idx}') @visitor.when(VariableCall) - def visit(self, node, scope: Scope, infered_type = None, deep = 1): + def visit(self, node, scope: Scope, infered_type=None, deep=1): var_info = scope.find_variable(node.idx) if var_info: if infered_type and var_info.type == self.AUTO_TYPE: print(f'Infered type {infered_type.name} for {var_info.name}') var_info.type = infered_type if not scope.is_local(var_info.name): - update_attr_type(self.current_type, var_info.name, var_info.type) + update_attr_type(self.current_type, var_info.name, + var_info.type) else: - update_method_param(self.current_type,self.current_method.name, var_info.name, var_info.type) + update_method_param(self.current_type, + self.current_method.name, + var_info.name, var_info.type) update_scope_variable(var_info.name, infered_type, scope) return var_info.type else: self.errors.append(f'Name {node.idx} is not define.') @visitor.when(IfThenElseNode) - def visit(self, node: IfThenElseNode, scope: Scope, infered_type = None, deep = 1): + def visit(self, + node: IfThenElseNode, + scope: Scope, + infered_type=None, + deep=1): cond = self.visit(node.cond, scope, infered_type, deep) e1 = self.visit(node.expr1, scope, infered_type, deep) - e2 = self.visit(node.expr2,scope, infered_type, deep) + e2 = self.visit(node.expr2, scope, infered_type, deep) if cond != self.BOOL: - self.errors.append(f'Se esperaba una expresion de tipo bool y se obtuvo una de tipo {cond}.') + self.errors.append( + f'Se esperaba una expresion de tipo bool y se obtuvo una de tipo {cond}.' + ) if e1.conforms_to(e2): return e2 elif e2.conforms_to(e1): @@ -182,7 +202,11 @@ def visit(self, node: IfThenElseNode, scope: Scope, infered_type = None, deep = return e1_parent @visitor.when(VariableDeclaration) - def visit(self, node : VariableDeclaration, scope:Scope, infered_type = None, deep = 1): + def visit(self, + node: VariableDeclaration, + scope: Scope, + infered_type=None, + deep=1): type_ = self.context.get_type(node.type) if type_ != self.AUTO_TYPE: if deep == 1: @@ -192,18 +216,18 @@ def visit(self, node : VariableDeclaration, scope:Scope, infered_type = None, de if deep == 1: type_ = self.visit(node.expr, scope, infered_type, deep) print(f'Infered type {type_.name} for {node.idx}') - scope.define_variable(node.idx,type_) + scope.define_variable(node.idx, type_) return void @visitor.when(FunCall) - def visit(self, node:FunCall, scope:Scope, infered_type = None, deep = 1): + def visit(self, node: FunCall, scope: Scope, infered_type=None, deep=1): if isinstance(node.obj, Type): method = node.obj.get_method(node.id) elif node.obj == 'self': method = self.current_type.get_method(node.id) else: method = self.context.get_type(node.obj).get_method(node.id) - + for arg in node.args: self.visit(arg, scope, infered_type, deep) @@ -216,70 +240,80 @@ def visit(self, node:FunCall, scope:Scope, infered_type = None, deep = 1): else: return self.AUTO_TYPE - - @visitor.when(InstantiateClassNode) - def visit(self, node: InstantiateClassNode, scope, infered_type = None, deep = 1): + def visit(self, + node: InstantiateClassNode, + scope, + infered_type=None, + deep=1): ret_type = self.context.get_type(node.type_) - if ret_type in (self.AUTO_TYPE, void, self.STRING, self.INTEGER, self.OBJECT, self.BOOL): + if ret_type in (self.AUTO_TYPE, void, self.STRING, self.INTEGER, + self.OBJECT, self.BOOL): self.errors.append(f'Cannot instantiate {ret_type}') return ret_type @visitor.when(WhileBlockNode) - def visit(self, node: WhileBlockNode, scope, infered_type= None, deep = 1): + def visit(self, node: WhileBlockNode, scope, infered_type=None, deep=1): ret_type = None for st in node.statements: ret_type = self.visit(st, scope, infered_type, deep) return ret_type - + #---------------------------------------------------------------------------------------------------------------------------# #---------------------------------------OPERACIONES ARITMÉTICAS-------------------------------------------------------------# #---------------------------------------------------------------------------------------------------------------------------# - - #------------------------------------------------------------------------------------------------- - # Todas las operaciones aritméticas estan definidas solamente para los enteros, luego, de checkeo| - # de cada operación se realiza evaluando sus operandos y viendo si sus tipos son consistentes con| - # INTEGER. | - #------------------------------------------------------------------------------------------------- + + +#------------------------------------------------------------------------------------------------- +# Todas las operaciones aritméticas estan definidas solamente para los enteros, luego, de checkeo| +# de cada operación se realiza evaluando sus operandos y viendo si sus tipos son consistentes con| +# INTEGER. | +#------------------------------------------------------------------------------------------------- + @visitor.when(PlusNode) - def visit(self,node, scope, infered_type = None, deep = 1): - left = self.visit(node.left, scope, self.INTEGER,deep) - right = self.visit(node.right, scope, self.INTEGER,deep) + def visit(self, node, scope, infered_type=None, deep=1): + left = self.visit(node.left, scope, self.INTEGER, deep) + right = self.visit(node.right, scope, self.INTEGER, deep) if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): return self.INTEGER else: - self.errors.append(f'Invalid operation :{left.name} + {right.name}') + self.errors.append( + f'Invalid operation :{left.name} + {right.name}') return self.INTEGER @visitor.when(DifNode) - def visit(self,node, scope, infered_type = None, deep = 1): + def visit(self, node, scope, infered_type=None, deep=1): left = self.visit(node.left, scope, self.INTEGER, deep) right = self.visit(node.right, scope, self.INTEGER, deep) if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): return self.INTEGER else: - self.errors.append(f'Invalid operation :{left.name} - {right.name}') + self.errors.append( + f'Invalid operation :{left.name} - {right.name}') return self.INTEGER @visitor.when(DivNode) - def visit(self,node, scope, infered_type=None, deep = 1): + def visit(self, node, scope, infered_type=None, deep=1): left = self.visit(node.left, scope, self.INTEGER, deep) right = self.visit(node.right, scope, self.INTEGER, deep) if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): return self.INTEGER else: - self.errors.append(f'Invalid operation :{left.name} / {right.name}') + self.errors.append( + f'Invalid operation :{left.name} / {right.name}') return self.INTEGER @visitor.when(MulNode) - def visit(self, node, scope, infered_type = None, deep = 1): + def visit(self, node, scope, infered_type=None, deep=1): left = self.visit(node.left, scope, self.INTEGER, deep) right = self.visit(node.right, scope, self.INTEGER, deep) if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): return self.INTEGER else: - self.errors.append(f'Invalid operation :{left.name} * {right.name}') + self.errors.append( + f'Invalid operation :{left.name} * {right.name}') return self.INTEGER + #-------------------------------------------------------------------------------------------# #-----------------------------------OPERACIONES COMPARATIVAS -------------------------------# #-------------------------------------------------------------------------------------------# @@ -289,80 +323,85 @@ def visit(self, node, scope, infered_type = None, deep = 1): # toda operación comparativa es BOOLEAN. | #--------------------------------------------------------------------------------------------- @visitor.when(GreaterThanNode) - def visit(self, node: GreaterThanNode, scope, infered_type = None, deep = 1): + def visit(self, node: GreaterThanNode, scope, infered_type=None, deep=1): left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append(f'Invalid operation: {left.name} > {right.name}') + self.errors.append( + f'Invalid operation: {left.name} > {right.name}') return self.BOOL @visitor.when(GreaterEqualNode) - def visit(self, node: GreaterEqualNode, scope, infered_type = None, deep = 1): + def visit(self, node: GreaterEqualNode, scope, infered_type=None, deep=1): left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append(f'Invalid operation: {left.name} >= {right.name}') + self.errors.append( + f'Invalid operation: {left.name} >= {right.name}') return self.BOOL - @visitor.when(LowerThanNode) - def visit(self, node: LowerThanNode, scope, infered_type = None, deep = 1): + def visit(self, node: LowerThanNode, scope, infered_type=None, deep=1): left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append(f'Invalid operation: {left.name} < {right.name}') + self.errors.append( + f'Invalid operation: {left.name} < {right.name}') return self.BOOL @visitor.when(LowerEqual) - def visit(self, node: LowerEqual, scope, infered_type = None, deep = 1): + def visit(self, node: LowerEqual, scope, infered_type=None, deep=1): left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append(f'Invalid operation: {left.name} <= {right.name}') + self.errors.append( + f'Invalid operation: {left.name} <= {right.name}') return self.BOOL @visitor.when(EqualToNode) - def visit(self, node: EqualToNode, scope, infered_type = None, deep = 1): + def visit(self, node: EqualToNode, scope, infered_type=None, deep=1): left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append(f'Invalid operation: {left.name} == {right.name}') + self.errors.append( + f'Invalid operation: {left.name} == {right.name}') return self.BOOL @visitor.when(NotNode) - def visit(self, node: NotNode, scope, infered_type = None, deep = 1): + def visit(self, node: NotNode, scope, infered_type=None, deep=1): val_type = self.visit(node.lex, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: self.errors.append(f'Invalid operation: ! {val_type.name}') return self.BOOL + #-----------------------------------------------------------------------------------------------------------------------# #--------------------------------------------------CONSTANTES-----------------------------------------------------------# #-----------------------------------------------------------------------------------------------------------------------# @visitor.when(IntegerConstant) - def visit(self, node, scope, infered_type = None, deep = 1): + def visit(self, node, scope, infered_type=None, deep=1): return self.INTEGER @visitor.when(StringConstant) - def visit(self,node, scope, infered_type = None, deep = 1): + def visit(self, node, scope, infered_type=None, deep=1): return self.STRING - + @visitor.when(TrueConstant) - def visit(self, node, scope, infered_type = None, deep = 1): + def visit(self, node, scope, infered_type=None, deep=1): return self.BOOL - + @visitor.when(FalseConstant) - def visit(self, node, scope, infered_type = None, deep = 1): - return self.BOOL \ No newline at end of file + def visit(self, node, scope, infered_type=None, deep=1): + return self.BOOL From 8d3e318b1b5e2df57efe25b91bea4bad841182cc Mon Sep 17 00:00:00 2001 From: Adrian Date: Sun, 10 May 2020 02:48:41 -0400 Subject: [PATCH 021/162] Started cool to CIL travel. --- src/cil/__init__.py | 0 src/cil/baseCilVisitor.py | 66 +++++++++++++++++++++ src/travels/ctcill.py | 115 +++++++++++++++++++++++++++++++++++++ src/travels/typebuilder.py | 9 ++- 4 files changed, 185 insertions(+), 5 deletions(-) create mode 100644 src/cil/__init__.py create mode 100644 src/cil/baseCilVisitor.py create mode 100644 src/travels/ctcill.py diff --git a/src/cil/__init__.py b/src/cil/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py new file mode 100644 index 00000000..1559ea27 --- /dev/null +++ b/src/cil/baseCilVisitor.py @@ -0,0 +1,66 @@ +import cil.nodes as nodes +from abstract.semantics import VariableInfo + +class BaseCoolToCilVisitor: + + def __init__(self, context): + self.dot_types = [] + self.dot_data = [] + self.dot_code = [] + self.context = context + self.current_type = None + self.current_method = None + self.current_function = None + + @property + def params(self): + return self.current_function.params + + @property + def localvars(self): + return self.current_function.localvars + + @property + def instructions(self): + return self.current_function.instructions + + def register_params(self, vinfo): + vinfo.name = f'param_{self.current_function.name[9:]}_{vinfo.name}_{len(self.params)}' + param_node = nodes.ParamNode(vinfo.name) + self.params.append(param_node) + return vinfo.name + + def register_local(self, vinfo): + vinfo.name = f'local_{self.current_function.name[9:]}_{vinfo.name}_{len(self.localvars)}' + local_node = nodes.LocalNode(vinfo.name) + self.localvars.append(local_node) + return vinfo.name + + def define_internal_local(self): + vinfo = VariableInfo('internal', None) + self.register_local(vinfo) + + def to_function_name(self, method_name, type_name): + return f"function_{method_name}_at_{type_name}" + + def register_instruction(self, instruction): + self.instructions.append(instruction) + return instruction + + def register_function(self, function_name): + function_node = nodes.FunctionNode(function_name, [], [], []) + self.dot_code.append(function_node) + return function_node + + def register_type(self, name): + type_node = nodes.TypeNode(name) + self.dot_types.append(type_node) + return type_node + + def register_data(self, value): + vname = f'data_{len(self.dot_data)}' + data_node = nodes.DataNode(vname, value) + self.dot_data.append(data_node) + return data_node + + diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py new file mode 100644 index 00000000..08f7d8e9 --- /dev/null +++ b/src/travels/ctcill.py @@ -0,0 +1,115 @@ +import cil.baseCilVisitor as baseCilVisitor +import typecheck.visitor as visitor +import abstract.tree as coolAst +import cil.nodes as cil + + +class CoolToCILVisitor(baseCilVisitor.BaseCoolToCilVisitor): + @visitor.on("node") + def visit(self, node): + pass + + @visitor.when(coolAst.ProgramNode) + def visit(self, node, scope): + # node.class_list -> [ClassDef ...] + + # Define the entry point for the program. + self.current_function = self.register_function("entry") + instance = self.define_internal_local() + result = self.define_internal_local() + + # The first method to call need to be the method main in a Main Class + + # allocate memory for the main object + self.register_instruction(cil.AllocateNode('Main', instance)) + self.register_instruction(cil.ArgNode(instance)) + + # call the main method + self.register_instruction( + cil.StaticCallNode(self.to_function_name('main', 'Main'), result)) + self.register_instruction(cil.ReturnNode(0)) + self.current_function = None + + for klass, child_scope in zip(node.class_list, scope.children): + self.visit(klass, child_scope) + + return cil.CilProgramNode(self.dot_types, self.dot_data, self.dot_code) + + @visitor.when(coolAst.ClassDef) + def visit(self, node, scope): + # node.idx -> String with the Class Name + # node.features -> [AttributeDef ... MethodDef ...] List with attributes and method declarations + + # Register the new type in .Types section + self.current_type = self.context.get_type(node.idx) + new_type_node = self.register_type(node.idx) + + methods = (feature.idx for feature in node.feature + if isinstance(feature, coolAst.MethodDef)) + attributes = (feature for feature in node.feature + if isinstance(feature, coolAst.AttributeDef)) + + # Handle inherited features such as attributes and methods first + if self.current_type.parent is not None: + for attribute in self.current_type.parent.attributes: + new_type_node.attributes.append(attribute.name) + + for method in self.current_type.parent.methods.keys(): + # Handle methods overload + if method not in methods: + new_type_node.methods.append( + (method, + self.to_function_name(method, + self.current_type.parent.name))) + + # Register every attribute and method for this type + # so the .Type section must look like: + ##################################################################### + # .TYPES # + # type A { # + # attribute x; # + # method f : function_f_at_A; # + # } # + ##################################################################### + for attribute in attributes: + new_type_node.attributes.append(attribute.idx) + for method in methods: + new_type_node.methods.append( + (method.idx, self.to_function_name(method.idx, node.idx))) + + # TODO: It is necessary to visit attributes?? Think so cuz they can be initialized + # and their value could perhaps go to .DATA section + + # Visit every method for generate its code in the .CODE section + for feature, child_scope in zip(methods, scope.children): + self.visit(feature, child_scope) + + self.current_type = None + + @visitor.when(coolAst.MethodDef) + def visit(self, node, scope): + # node.idx -> String with the method name + # node.param_list -> [Param ... ] params of the method + # node.return_type -> Type: method's return type + # node.statements -> ExpressionList with the body of the method + + self.current_method = self.current_type.get_method(node.idx) + + # Register the new function in .CODE + function_node = self.register_function( + self.to_function_name(node.idx, self.current_type.name)) + + # Define the method params + function_node.params = [ + cil.ParamNode(param.idx) for param in node.param_list + ] + + # Get the instructions that conforms the body of the method + for exp, child_scope in zip(node.statements, scope.children): + # every exp return a tuple: the instruction set and the localvars + # needed + instructions, local_vars = self.visit(exp, child_scope) + function_node.instructions += instructions + function_node.localvars += local_vars + + self.current_method = None diff --git a/src/travels/typebuilder.py b/src/travels/typebuilder.py index b478303f..9eae9fc6 100755 --- a/src/travels/typebuilder.py +++ b/src/travels/typebuilder.py @@ -7,7 +7,6 @@ def __init__(self, context: Context, errors = []): self.context = context self.errors = errors self.current_type = None - @visitor.on('node') def visit(self, node): @@ -17,7 +16,7 @@ def visit(self, node): def visit(self,node): for class_ in node.class_list: self.visit(class_) - + @visitor.when(ClassDef) def visit(self, node: ClassDef): self.current_type = self.context.get_type(node.idx) @@ -28,13 +27,13 @@ def visit(self, node: ClassDef): self.errors.append(f'Circular dependency: class {self.current_type.name} cannot inherit from {parent.name}') else: self.current_type.set_parent(parent) - + # for method in parent.methods.values(): # try: # self.current_type.define_method(method.name, method.param_names, method.param_types, method.return_type) # except SemanticError as e: # self.errors.append(e.text) - + # for att in parent.attributes: # try: # self.current_type.define_attribute(att.name, att.type) @@ -43,7 +42,7 @@ def visit(self, node: ClassDef): for feature in node.features: self.visit(feature) - + @visitor.when(AttributeDef) def visit(self, node): From 522a42331f1d1f88eaca6b1695a56d508d0fe5e1 Mon Sep 17 00:00:00 2001 From: Adrian Date: Mon, 11 May 2020 04:02:49 -0400 Subject: [PATCH 022/162] Annotated and formated all travels built so far. --- src/abstract/semantics.py | 138 ++++++++--------- src/cil/baseCilVisitor.py | 56 +++---- src/travels/ctcill.py | 49 +++--- src/travels/inference.py | 285 +++++++++++++++-------------------- src/travels/typebuilder.py | 47 +++--- src/travels/typecollector.py | 24 +-- src/typecheck/visitor.py | 96 ++++++------ 7 files changed, 326 insertions(+), 369 deletions(-) diff --git a/src/abstract/semantics.py b/src/abstract/semantics.py index c5b070e0..5cf232f0 100755 --- a/src/abstract/semantics.py +++ b/src/abstract/semantics.py @@ -1,16 +1,5 @@ import itertools as itt - - -class Attribute: - def __init__(self, name, typex): - self.name = name - self.type = typex - - def __str__(self): - return f'[attrib] {self.name} : {self.type.name};' - - def __repr__(self): - return str(self) +from typing import List, Dict, Optional class SemanticError(Exception): @@ -19,50 +8,32 @@ def text(self): return self.args[0] -class Method: - def __init__(self, name, param_names, params_types, return_type): - self.name = name - self.param_names = param_names - self.param_types = params_types - self.return_type = return_type - - def __str__(self): - params = ', '.join(f'{n}:{t.name}' for n, t in zip( - self.param_names, self.param_types)) - return f'[method] {self.name}({params}): {self.return_type.name};' - - def __eq__(self, other): - return other.name == self.name and \ - other.return_type == self.return_type and \ - other.param_types == self.param_types - - class Type: def __init__(self, name: str): self.name = name - self.attributes = [] - self.methods = {} - self.parent = None + self.attributes: List[Attribute] = [] + self.methods: Dict[str, Method] = {} + self.parent: Optional[Type] = None - def set_parent(self, parent): + def set_parent(self, parent) -> None: if self.parent is not None: raise SemanticError(f'Parent type is already set for {self.name}.') self.parent = parent - def get_attribute(self, name: str): + def get_attribute(self, name): + # type: (str) -> Attribute try: return next(attr for attr in self.attributes if attr.name == name) except StopIteration: if self.parent is None: - raise SemanticError( - f'Attribute "{name}" is not defined in {self.name}.') + raise SemanticError(f'Attribute "{name}" is not defined in {self.name}.') try: return self.parent.get_attribute(name) except SemanticError: - raise SemanticError( - f'Attribute "{name}" is not defined in {self.name}.') + raise SemanticError(f'Attribute "{name}" is not defined in {self.name}.') - def define_attribute(self, name: str, typex): + def define_attribute(self, name, typex): + # type: (str, Type) -> Optional[Attribute] try: self.get_attribute(name) except SemanticError: @@ -70,35 +41,32 @@ def define_attribute(self, name: str, typex): self.attributes.append(attribute) return attribute else: - raise SemanticError( - f'Attribute "{name}" is already defined in {self.name}.') + raise SemanticError(f'Attribute "{name}" is already defined in {self.name}.') - def get_method(self, name: str): + def get_method(self, name): + # type: (str) -> Method try: return self.methods[name] except KeyError: if self.parent is None: - raise SemanticError( - f'Method "{name}" is not defined in {self.name}.') + raise SemanticError(f'Method "{name}" is not defined in {self.name}.') try: return self.parent.get_method(name) except SemanticError: - raise SemanticError( - f'Method "{name}" is not defined in {self.name}.') + raise SemanticError(f'Method "{name}" is not defined in {self.name}.') - def define_method(self, name: str, param_names: list, param_types: list, return_type): + def define_method(self, name, param_names, param_types, return_type): + # type: (str, List[str], List[Type], Type) -> Method if name in self.methods: - raise SemanticError( - f'Method "{name}" already defined in {self.name}.') + raise SemanticError(f'Method "{name}" already defined in {self.name}.') - method = self.methods[name] = Method( - name, param_names, param_types, return_type) + method = self.methods[name] = Method(name, param_names, param_types, return_type) return method - def conforms_to(self, other): + def conforms_to(self, other) -> bool: return other.bypass() or self == other or self.parent is not None and self.parent.conforms_to(other) - def bypass(self): + def bypass(self) -> bool: return False def __str__(self): @@ -121,6 +89,33 @@ def __eq__(self, other): return isinstance(other, Type) and other.name == self.name +class Method: + def __init__(self, name: str, param_names: List[str], params_types: List[Type], return_type: Type): + self.name = name + self.param_names = param_names + self.param_types = params_types + self.return_type = return_type + + def __str__(self): + params = ', '.join(f'{n}:{t.name}' for n, t in zip(self.param_names, self.param_types)) + return f'[method] {self.name}({params}): {self.return_type.name};' + + def __eq__(self, other): + return other.name == self.name and other.return_type == self.return_type and other.param_types == self.param_types + + +class Attribute: + def __init__(self, name: str, typex: Type): + self.name: str = name + self.type: Type = typex + + def __str__(self): + return f'[attrib] {self.name} : {self.type.name};' + + def __repr__(self): + return str(self) + + class VoidType(Type): def __init__(self): super(VoidType, self).__init__('void') @@ -168,22 +163,21 @@ def __init__(self): def __eq__(self, other): return isinstance(other, AutoType) - def conforms_to(self, other): + def conforms_to(self, other: Type) -> bool: return True class Context: def __init__(self): - self.types = {} + self.types: Dict[str, Type] = {} - def create_type(self, name: str): + def create_type(self, name: str) -> Type: if name in self.types: - raise SemanticError( - f'Type with the same name ({name}) already in context.') + raise SemanticError(f'Type with the same name ({name}) already in context.') typex = self.types[name] = Type(name) return typex - def get_type(self, name: str): + def get_type(self, name: str) -> Type: try: return self.types[name] except KeyError: @@ -197,43 +191,45 @@ def __repr__(self): class VariableInfo: - def __init__(self, name, vtype): + def __init__(self, name: str, vtype: Optional[Type] = None): self.name = name self.type = vtype class Scope: def __init__(self, parent=None): - self.locals = [] - self.parent = parent - self.children = [] - self.index = 0 if parent is None else len(parent) + self.locals: List[VariableInfo] = [] + self.parent: Optional[Scope] = parent + self.children: List[Scope] = [] + self.index: int = 0 if parent is None else len(parent) def __len__(self): return len(self.locals) def create_child(self): - child = Scope(self) + # type: () -> Scope + child: Scope = Scope(self) self.children.append(child) return child - def define_variable(self, vname, vtype): + def define_variable(self, vname: str, vtype: Type) -> VariableInfo: info = VariableInfo(vname, vtype) self.locals.append(info) return info - def find_variable(self, vname, index=None): + def find_variable(self, vname: str, index: int = None) -> Optional[VariableInfo]: locals = self.locals if index is None else itt.islice( self.locals, index) try: return next(x for x in locals if x.name == vname) except StopIteration: - return self.parent.find_variable(vname, self.index) if self.parent else None + return self.parent.find_variable( + vname, self.index) if self.parent else None - def is_defined(self, vname): + def is_defined(self, vname: str) -> bool: return self.find_variable(vname) is not None - def is_local(self, vname): + def is_local(self, vname: str) -> bool: return any(True for x in self.locals if x.name == vname) def __str__(self): diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 1559ea27..d7b1c744 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -1,66 +1,70 @@ +from typing import List, Optional, Any import cil.nodes as nodes -from abstract.semantics import VariableInfo +from abstract.semantics import VariableInfo, Context, Type, Method -class BaseCoolToCilVisitor: - def __init__(self, context): - self.dot_types = [] - self.dot_data = [] - self.dot_code = [] - self.context = context - self.current_type = None - self.current_method = None - self.current_function = None +class BaseCoolToCilVisitor: + def __init__(self, context: Context): + self.dot_types: List[nodes.TypeNode] = [] + self.dot_data: List[Any] = [] + self.dot_code: List[nodes.FunctionNode] = [] + self.context: Context = context + self.current_type: Optional[Type] = None + self.current_method: Optional[Method] = None + self.current_function: Optional[nodes.FunctionNode] = None @property - def params(self): + def params(self) -> List[nodes.ParamNode]: + assert self.current_function is not None return self.current_function.params @property - def localvars(self): + def localvars(self) -> List[nodes.LocalNode]: + assert self.current_function is not None return self.current_function.localvars @property - def instructions(self): + def instructions(self) -> List[nodes.InstructionNode]: + assert self.current_function is not None return self.current_function.instructions - def register_params(self, vinfo): + def register_params(self, vinfo: VariableInfo) -> str: + assert self.current_function is not None vinfo.name = f'param_{self.current_function.name[9:]}_{vinfo.name}_{len(self.params)}' - param_node = nodes.ParamNode(vinfo.name) + param_node: nodes.ParamNode = nodes.ParamNode(vinfo.name) self.params.append(param_node) return vinfo.name - def register_local(self, vinfo): + def register_local(self, vinfo: VariableInfo) -> str: + assert self.current_function is not None vinfo.name = f'local_{self.current_function.name[9:]}_{vinfo.name}_{len(self.localvars)}' local_node = nodes.LocalNode(vinfo.name) self.localvars.append(local_node) return vinfo.name - def define_internal_local(self): - vinfo = VariableInfo('internal', None) - self.register_local(vinfo) + def define_internal_local(self) -> str: + vinfo = VariableInfo('internal') + return self.register_local(vinfo) - def to_function_name(self, method_name, type_name): + def to_function_name(self, method_name: str, type_name: str) -> str: return f"function_{method_name}_at_{type_name}" - def register_instruction(self, instruction): + def register_instruction(self, instruction: nodes.InstructionNode) -> nodes.InstructionNode: self.instructions.append(instruction) return instruction - def register_function(self, function_name): + def register_function(self, function_name: str) -> nodes.FunctionNode: function_node = nodes.FunctionNode(function_name, [], [], []) self.dot_code.append(function_node) return function_node - def register_type(self, name): + def register_type(self, name: str) -> nodes.TypeNode: type_node = nodes.TypeNode(name) self.dot_types.append(type_node) return type_node - def register_data(self, value): + def register_data(self, value: Any) -> nodes.DataNode: vname = f'data_{len(self.dot_data)}' data_node = nodes.DataNode(vname, value) self.dot_data.append(data_node) return data_node - - diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 08f7d8e9..bbd48975 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -1,20 +1,22 @@ import cil.baseCilVisitor as baseCilVisitor import typecheck.visitor as visitor import abstract.tree as coolAst +import abstract.semantics as semantics import cil.nodes as cil +from typing import List class CoolToCILVisitor(baseCilVisitor.BaseCoolToCilVisitor): @visitor.on("node") - def visit(self, node): + def visit(self, node: coolAst.Node) -> None: pass - @visitor.when(coolAst.ProgramNode) - def visit(self, node, scope): + @visitor.when(coolAst.ProgramNode) # type: ignore + def visit(self, node: coolAst.ProgramNode, scope: semantics.Scope) -> cil.CilProgramNode: # noqa: F811 # node.class_list -> [ClassDef ...] # Define the entry point for the program. - self.current_function = self.register_function("entry") + self.current_function: cil.FunctionNode = self.register_function("entry") instance = self.define_internal_local() result = self.define_internal_local() @@ -35,8 +37,8 @@ def visit(self, node, scope): return cil.CilProgramNode(self.dot_types, self.dot_data, self.dot_code) - @visitor.when(coolAst.ClassDef) - def visit(self, node, scope): + @visitor.when(coolAst.ClassDef) # type: ignore + def visit(self, node: coolAst.ClassDef, scope: semantics.Scope) -> None: # noqa: F811 # node.idx -> String with the Class Name # node.features -> [AttributeDef ... MethodDef ...] List with attributes and method declarations @@ -44,10 +46,8 @@ def visit(self, node, scope): self.current_type = self.context.get_type(node.idx) new_type_node = self.register_type(node.idx) - methods = (feature.idx for feature in node.feature - if isinstance(feature, coolAst.MethodDef)) - attributes = (feature for feature in node.feature - if isinstance(feature, coolAst.AttributeDef)) + methods: List[str] = [feature.idx for feature in node.feature if isinstance(feature, coolAst.MethodDef)] + attributes: List[semantics.Attribute] = [feature for feature in node.feature if isinstance(feature, coolAst.AttributeDef)] # Handle inherited features such as attributes and methods first if self.current_type.parent is not None: @@ -57,10 +57,7 @@ def visit(self, node, scope): for method in self.current_type.parent.methods.keys(): # Handle methods overload if method not in methods: - new_type_node.methods.append( - (method, - self.to_function_name(method, - self.current_type.parent.name))) + new_type_node.methods.append((method, self.to_function_name(method, self.current_type.parent.name))) # Register every attribute and method for this type # so the .Type section must look like: @@ -74,8 +71,7 @@ def visit(self, node, scope): for attribute in attributes: new_type_node.attributes.append(attribute.idx) for method in methods: - new_type_node.methods.append( - (method.idx, self.to_function_name(method.idx, node.idx))) + new_type_node.methods.append((method.idx, self.to_function_name(method.idx, node.idx))) # TODO: It is necessary to visit attributes?? Think so cuz they can be initialized # and their value could perhaps go to .DATA section @@ -86,23 +82,19 @@ def visit(self, node, scope): self.current_type = None - @visitor.when(coolAst.MethodDef) - def visit(self, node, scope): - # node.idx -> String with the method name - # node.param_list -> [Param ... ] params of the method - # node.return_type -> Type: method's return type - # node.statements -> ExpressionList with the body of the method - + @visitor.when(coolAst.MethodDef) # type: ignore + def visit(self, node: coolAst.MethodDef, scope: semantics.Scope) -> None: # noqa: F811 self.current_method = self.current_type.get_method(node.idx) # Register the new function in .CODE - function_node = self.register_function( - self.to_function_name(node.idx, self.current_type.name)) + function_node = self.register_function(self.to_function_name(node.idx, self.current_type.name)) + + # Stablish this method as the current function so we can properly set + # names for variables and stuffs. + self.current_function = function_node # Define the method params - function_node.params = [ - cil.ParamNode(param.idx) for param in node.param_list - ] + function_node.params = [cil.ParamNode(param.idx) for param in node.param_list] # Get the instructions that conforms the body of the method for exp, child_scope in zip(node.statements, scope.children): @@ -113,3 +105,4 @@ def visit(self, node, scope): function_node.localvars += local_vars self.current_method = None + self.current_function = None diff --git a/src/travels/inference.py b/src/travels/inference.py index 2f9b7d39..61953584 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -1,15 +1,16 @@ -from abstract.semantics import * -from abstract.tree import * +import abstract.semantics as semantic +import abstract.tree as coolAst import typecheck.visitor as visitor from travels.context_actions import update_attr_type, update_method_param, update_scope_variable +from typing import Optional -void = VoidType() +void = semantic.VoidType() class TypeInferer: """ Para inferir los tipos en un programa se aprovecha el AST devuelto al evaluar el parse de dicho programa. - Para este propósito, se toma el programa como una gran expresión, y entonces se realiza un recorrido en bottom-up + Para este propósito, se toma el programa como una gran expresión, y entonces se realiza un recorrido en bottom-up para inferir los tipos de las subexpresiones que sean necesarias. Empezando por las hojas que corresponden a las constantes y tipos previamente definidos, que por supuesto ya tienen su tipo bien calculado, se procede a ir subiendo por el árbol calculando el tipo de cada subexpresión en dependencia de su regla funcional y de los tipos previamente calculados @@ -25,82 +26,77 @@ class TypeInferer: BOLEAN entonces el tipo de la expresión completa sera el Ancestro Común Mas Cercano a los tipos T1 y T2, o en otras palabras, el menor tipo T3 tal que T1 se conforme en T3 y T2 se conforme en T3. """ - def __init__(self, context: Context, errors=[]): - self.context: Context = context - self.current_type: Type = None + def __init__(self, context: semantic.Context, errors=[]): + self.context: semantic.Context = context + self.current_type: Optional[semantic.Type] = None self.INTEGER = self.context.get_type('int') self.OBJECT = self.context.get_type('object') self.STRING = self.context.get_type('string') self.BOOL = self.context.get_type('bool') self.AUTO_TYPE = self.context.get_type('AUTO_TYPE') self.errors = errors - self.current_method = None + self.current_method: Optional[semantic.Method] = None @visitor.on('node') def visit(self, node, scope, infered_type=None): pass - #--------------------------------------------------------------------------------------------------------------------------# - #-----------------------------------------------------EXPRESIONES----------------------------------------------------------# - #--------------------------------------------------------------------------------------------------------------------------# + # --------------------------------------------------------------------------------------------------------------------------# + # -----------------------------------------------------EXPRESIONES----------------------------------------------------------# + # --------------------------------------------------------------------------------------------------------------------------# - #--------------------------------------------------------------- + # --------------------------------------------------------------- # Calcular todos los tipos en el contexto del programa. | - #--------------------------------------------------------------- - @visitor.when(ProgramNode) - def visit(self, node, scope=None, infered_type=None, deep=1): - program_scope = Scope() if scope is None else scope + # --------------------------------------------------------------- + @visitor.when(coolAst.ProgramNode) #type: ignore # noqa + def visit(self, node, scope=None, infered_type=None, deep=1): # noqa: F811 + program_scope = semantic.Scope() if scope is None else scope print(f"Este es el scope en la vuelta {deep} :\n {program_scope}") if deep == 1: for class_ in node.class_list: self.visit(class_, program_scope.create_child()) else: - for class_, child_scope in zip(node.class_list, - program_scope.children): + for class_, child_scope in zip(node.class_list, program_scope.children): self.visit(class_, child_scope, deep=deep) return program_scope - #----------------------------------------------------------------- - #Calcular los tipos en esta clase, visitar primero los atributos | - #y luego los métodos para garantizar que al revisar los métodos | - #ya todos los atributos estén definidos en el scope. | - #----------------------------------------------------------------- - @visitor.when(ClassDef) - def visit(self, node, scope: Scope, infered_type=None, deep=1): - self.current_type: Type = self.context.get_type(node.idx) + # ----------------------------------------------------------------- + # Calcular los tipos en esta clase, visitar primero los atributos | + # y luego los métodos para garantizar que al revisar los métodos | + # ya todos los atributos estén definidos en el scope. | + # ----------------------------------------------------------------- + @visitor.when(coolAst.ClassDef) #type: ignore # noqa + def visit(self, node, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + self.current_type = self.context.get_type(node.idx) for feature in node.features: - if isinstance(feature, AttributeDef): + if isinstance(feature, coolAst.AttributeDef): self.visit(feature, scope, deep=deep) if deep == 1: for feature in node.features: - if isinstance(feature, MethodDef): + if isinstance(feature, coolAst.MethodDef): self.visit(feature, scope.create_child(), deep=deep) else: - methods = (f for f in node.features if isinstance(f, MethodDef)) + methods = (f for f in node.features if isinstance(f, coolAst.MethodDef)) for feature, child_scope in zip(methods, scope.children): self.visit(feature, child_scope, deep=deep) - #--------------------------------------------------------- - #Definir un atributo en el scope. | - #--------------------------------------------------------- - @visitor.when(AttributeDef) - def visit(self, - node: AttributeDef, - scope: Scope, - infered_type=None, - deep=1): + # --------------------------------------------------------- + # Definir un atributo en el scope. | + # --------------------------------------------------------- + @visitor.when(coolAst.AttributeDef) #type: ignore # noqa + def visit(self, node: coolAst.AttributeDef, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 atrib = self.current_type.get_attribute(node.idx) if deep == 1: scope.define_variable(atrib.name, atrib.type) - #--------------------------------------------------------------------- - #Si el método no tiene un tipo definido, entonces tratar de inferir | - #su tipo en dependencia del tipo de su expresién de retorno. | - #Notar que al revisar el body del método se pueden inferir también | - #los argumentos que no hayan sido definidos con tipos específicos. | - #--------------------------------------------------------------------- - @visitor.when(MethodDef) - def visit(self, node: MethodDef, scope, infered_type=None, deep=1): + # --------------------------------------------------------------------- + # Si el método no tiene un tipo definido, entonces tratar de inferir | + # su tipo en dependencia del tipo de su expresién de retorno. | + # Notar que al revisar el body del método se pueden inferir también | + # los argumentos que no hayan sido definidos con tipos específicos. | + # --------------------------------------------------------------------- + @visitor.when(coolAst.MethodDef) #type: ignore # noqa + def visit(self, node: coolAst.MethodDef, scope, infered_type=None, deep=1): # noqa: F811 print(node.idx) method = self.current_type.get_method(node.idx) self.current_method = method @@ -115,24 +111,23 @@ def visit(self, node: MethodDef, scope, infered_type=None, deep=1): method.return_type = last else: if not last.conforms_to(method.return_type): - self.errors.append( - f'Method {method.name} cannot return {last}') + self.errors.append(f'Method {method.name} cannot return {last}') print(scope) - @visitor.when(Param) - def visit(self, node: Param, scope: Scope, infered_type=None, deep=1): + @visitor.when(coolAst.Param) #type: ignore # noqa + def visit(self, node: coolAst.Param, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 type_ = self.context.get_type(node.type) if deep == 1: scope.define_variable(node.id, type_) - #------------------------------------------------------------------------- - #Checkear si la variable a la que se le va a asignar el resultado de la | - #expresión tiene un tipo bien definido: en caso de tenerlo, verificar que| - #el tipo de la expresión coincide con el tipo de la variable, de lo con- | - #trario asignarle a la variable el tipo de retorno de la expresión. | - #------------------------------------------------------------------------- - @visitor.when(AssignNode) - def visit(self, node: AssignNode, scope: Scope, infered_type=None, deep=1): + # ------------------------------------------------------------------------- + # Checkear si la variable a la que se le va a asignar el resultado de la | + # expresión tiene un tipo bien definido: en caso de tenerlo, verificar que| + # el tipo de la expresión coincide con el tipo de la variable, de lo con- | + # trario asignarle a la variable el tipo de retorno de la expresión. | + # ------------------------------------------------------------------------- + @visitor.when(coolAst.AssignNode) #type: ignore # noqa + def visit(self, node: coolAst.AssignNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 var_info = scope.find_variable(node.idx) if var_info: e = self.visit(node.expr, scope, infered_type) @@ -140,55 +135,41 @@ def visit(self, node: AssignNode, scope: Scope, infered_type=None, deep=1): print(f'Infered type {e.name} for {node.idx}') var_info.type = e if not scope.is_local(var_info.name): - update_attr_type(self.current_type, var_info.name, - var_info.type) + update_attr_type(self.current_type, var_info.name, var_info.type) else: - update_method_param(self.current_type, - self.current_method.name, - var_info.name, var_info.type) + update_method_param(self.current_type, self.current_method.name, var_info.name, var_info.type) update_scope_variable(var_info.name, e, scope) return void else: if not e.conforms_to(var_info.type): - self.errors.append( - f'Expresion of type {e.name} cannot be assigned to variable {var_info.name} of type {var_info.type.name}' - ) + self.errors.append(f'Expresion of type {e.name} cannot be assigned to variable {var_info.name} of type {var_info.type.name}') return void else: self.errors.append(f'Undefined variable name: {node.idx}') - @visitor.when(VariableCall) - def visit(self, node, scope: Scope, infered_type=None, deep=1): + @visitor.when(coolAst.VariableCall) #type: ignore # noqa + def visit(self, node, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 var_info = scope.find_variable(node.idx) if var_info: if infered_type and var_info.type == self.AUTO_TYPE: print(f'Infered type {infered_type.name} for {var_info.name}') var_info.type = infered_type if not scope.is_local(var_info.name): - update_attr_type(self.current_type, var_info.name, - var_info.type) + update_attr_type(self.current_type, var_info.name, var_info.type) else: - update_method_param(self.current_type, - self.current_method.name, - var_info.name, var_info.type) + update_method_param(self.current_type, self.current_method.name, var_info.name, var_info.type) update_scope_variable(var_info.name, infered_type, scope) return var_info.type else: self.errors.append(f'Name {node.idx} is not define.') - @visitor.when(IfThenElseNode) - def visit(self, - node: IfThenElseNode, - scope: Scope, - infered_type=None, - deep=1): + @visitor.when(coolAst.IfThenElseNode) #type: ignore # noqa + def visit(self, node: coolAst.IfThenElseNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 cond = self.visit(node.cond, scope, infered_type, deep) e1 = self.visit(node.expr1, scope, infered_type, deep) e2 = self.visit(node.expr2, scope, infered_type, deep) if cond != self.BOOL: - self.errors.append( - f'Se esperaba una expresion de tipo bool y se obtuvo una de tipo {cond}.' - ) + self.errors.append(f'Se esperaba una expresion de tipo bool y se obtuvo una de tipo {cond}.') if e1.conforms_to(e2): return e2 elif e2.conforms_to(e1): @@ -201,12 +182,8 @@ def visit(self, e2_parent = e2_parent.parent return e1_parent - @visitor.when(VariableDeclaration) - def visit(self, - node: VariableDeclaration, - scope: Scope, - infered_type=None, - deep=1): + @visitor.when(coolAst.VariableDeclaration) #type: ignore # noqa + def visit(self, node: coolAst.VariableDeclaration, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 type_ = self.context.get_type(node.type) if type_ != self.AUTO_TYPE: if deep == 1: @@ -219,9 +196,9 @@ def visit(self, scope.define_variable(node.idx, type_) return void - @visitor.when(FunCall) - def visit(self, node: FunCall, scope: Scope, infered_type=None, deep=1): - if isinstance(node.obj, Type): + @visitor.when(coolAst.FunCall) #type: ignore # noqa + def visit(self, node: coolAst.FunCall, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + if isinstance(node.obj, semantic.Type): method = node.obj.get_method(node.id) elif node.obj == 'self': method = self.current_type.get_method(node.id) @@ -240,168 +217,154 @@ def visit(self, node: FunCall, scope: Scope, infered_type=None, deep=1): else: return self.AUTO_TYPE - @visitor.when(InstantiateClassNode) - def visit(self, - node: InstantiateClassNode, - scope, - infered_type=None, - deep=1): + @visitor.when(coolAst.InstantiateClassNode) #type: ignore # noqa + def visit(self, node: coolAst.InstantiateClassNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 ret_type = self.context.get_type(node.type_) - if ret_type in (self.AUTO_TYPE, void, self.STRING, self.INTEGER, - self.OBJECT, self.BOOL): + if ret_type in (self.AUTO_TYPE, void, self.STRING, self.INTEGER, self.OBJECT, self.BOOL): self.errors.append(f'Cannot instantiate {ret_type}') return ret_type - @visitor.when(WhileBlockNode) - def visit(self, node: WhileBlockNode, scope, infered_type=None, deep=1): + @visitor.when(coolAst.WhileBlockNode) #type: ignore # noqa + def visit(self, node: coolAst.WhileBlockNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 ret_type = None for st in node.statements: ret_type = self.visit(st, scope, infered_type, deep) return ret_type - #---------------------------------------------------------------------------------------------------------------------------# - #---------------------------------------OPERACIONES ARITMÉTICAS-------------------------------------------------------------# - #---------------------------------------------------------------------------------------------------------------------------# + # ---------------------------------------------------------------------------------------------------------------------------# + # ---------------------------------------OPERACIONES ARITMÉTICAS-------------------------------------------------------------# + # ---------------------------------------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------------- +# ------------------------------------------------------------------------------------------------- # Todas las operaciones aritméticas estan definidas solamente para los enteros, luego, de checkeo| # de cada operación se realiza evaluando sus operandos y viendo si sus tipos son consistentes con| # INTEGER. | -#------------------------------------------------------------------------------------------------- +# ------------------------------------------------------------------------------------------------- - @visitor.when(PlusNode) - def visit(self, node, scope, infered_type=None, deep=1): + @visitor.when(coolAst.PlusNode) #type: ignore # noqa + def visit(self, node: coolAst.PlusNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 left = self.visit(node.left, scope, self.INTEGER, deep) right = self.visit(node.right, scope, self.INTEGER, deep) if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): return self.INTEGER else: - self.errors.append( - f'Invalid operation :{left.name} + {right.name}') + self.errors.append(f'Invalid operation :{left.name} + {right.name}') return self.INTEGER - @visitor.when(DifNode) - def visit(self, node, scope, infered_type=None, deep=1): + @visitor.when(coolAst.DifNode) #type: ignore # noqa + def visit(self, node: coolAst.DifNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 left = self.visit(node.left, scope, self.INTEGER, deep) right = self.visit(node.right, scope, self.INTEGER, deep) if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): return self.INTEGER else: - self.errors.append( - f'Invalid operation :{left.name} - {right.name}') + self.errors.append(f'Invalid operation :{left.name} - {right.name}') return self.INTEGER - @visitor.when(DivNode) - def visit(self, node, scope, infered_type=None, deep=1): + @visitor.when(coolAst.DivNode) #type: ignore # noqa + def visit(self, node: coolAst.DivNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 left = self.visit(node.left, scope, self.INTEGER, deep) right = self.visit(node.right, scope, self.INTEGER, deep) if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): return self.INTEGER else: - self.errors.append( - f'Invalid operation :{left.name} / {right.name}') + self.errors.append(f'Invalid operation :{left.name} / {right.name}') return self.INTEGER - @visitor.when(MulNode) - def visit(self, node, scope, infered_type=None, deep=1): + @visitor.when(coolAst.MulNode) #type: ignore # noqa + def visit(self, node: coolAst.MulNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 left = self.visit(node.left, scope, self.INTEGER, deep) right = self.visit(node.right, scope, self.INTEGER, deep) if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): return self.INTEGER else: - self.errors.append( - f'Invalid operation :{left.name} * {right.name}') + self.errors.append(f'Invalid operation :{left.name} * {right.name}') return self.INTEGER - #-------------------------------------------------------------------------------------------# - #-----------------------------------OPERACIONES COMPARATIVAS -------------------------------# - #-------------------------------------------------------------------------------------------# + # -------------------------------------------------------------------------------------------# + # -----------------------------------OPERACIONES COMPARATIVAS -------------------------------# + # -------------------------------------------------------------------------------------------# - #--------------------------------------------------------------------------------------------- + # --------------------------------------------------------------------------------------------- # Para poder comparar dos expresiones, estas deben ser del mismo tipo. El tipo de retorno de | # toda operación comparativa es BOOLEAN. | - #--------------------------------------------------------------------------------------------- - @visitor.when(GreaterThanNode) - def visit(self, node: GreaterThanNode, scope, infered_type=None, deep=1): + # --------------------------------------------------------------------------------------------- + @visitor.when(coolAst.GreaterThanNode) #type: ignore # noqa + def visit(self, node: coolAst.GreaterThanNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append( - f'Invalid operation: {left.name} > {right.name}') + self.errors.append(f'Invalid operation: {left.name} > {right.name}') return self.BOOL - @visitor.when(GreaterEqualNode) - def visit(self, node: GreaterEqualNode, scope, infered_type=None, deep=1): + @visitor.when(coolAst.GreaterEqualNode) #type: ignore # noqa + def visit(self, node: coolAst.GreaterEqualNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append( - f'Invalid operation: {left.name} >= {right.name}') + self.errors.append(f'Invalid operation: {left.name} >= {right.name}') return self.BOOL - @visitor.when(LowerThanNode) - def visit(self, node: LowerThanNode, scope, infered_type=None, deep=1): + @visitor.when(coolAst.LowerThanNode) #type: ignore # noqa + def visit(self, node: coolAst.LowerThanNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append( - f'Invalid operation: {left.name} < {right.name}') + self.errors.append(f'Invalid operation: {left.name} < {right.name}') return self.BOOL - @visitor.when(LowerEqual) - def visit(self, node: LowerEqual, scope, infered_type=None, deep=1): + @visitor.when(coolAst.LowerEqual) #type: ignore # noqa + def visit(self, node: coolAst.LowerEqual, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append( - f'Invalid operation: {left.name} <= {right.name}') + self.errors.append(f'Invalid operation: {left.name} <= {right.name}') return self.BOOL - @visitor.when(EqualToNode) - def visit(self, node: EqualToNode, scope, infered_type=None, deep=1): + @visitor.when(coolAst.EqualToNode) #type: ignore # noqa + def visit(self, node: coolAst.EqualToNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append( - f'Invalid operation: {left.name} == {right.name}') + self.errors.append(f'Invalid operation: {left.name} == {right.name}') return self.BOOL - @visitor.when(NotNode) - def visit(self, node: NotNode, scope, infered_type=None, deep=1): + @visitor.when(coolAst.NotNode) #type: ignore # noqa + def visit(self, node: coolAst.NotNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 val_type = self.visit(node.lex, scope, infered_type, deep) - if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: + if val_type == self.AUTO_TYPE or val_type == self.BOOL: return self.BOOL else: self.errors.append(f'Invalid operation: ! {val_type.name}') return self.BOOL - #-----------------------------------------------------------------------------------------------------------------------# - #--------------------------------------------------CONSTANTES-----------------------------------------------------------# - #-----------------------------------------------------------------------------------------------------------------------# + # -----------------------------------------------------------------------------------------------------------------------# + # --------------------------------------------------CONSTANTES-----------------------------------------------------------# + # -----------------------------------------------------------------------------------------------------------------------# - @visitor.when(IntegerConstant) - def visit(self, node, scope, infered_type=None, deep=1): + @visitor.when(IntegerConstant) #type: ignore # noqa + def visit(self, node, scope, infered_type=None, deep=1): # noqa: F811 return self.INTEGER - @visitor.when(StringConstant) - def visit(self, node, scope, infered_type=None, deep=1): + @visitor.when(StringConstant) #type: ignore # noqa + def visit(self, node, scope, infered_type=None, deep=1): # noqa: F811 return self.STRING - @visitor.when(TrueConstant) - def visit(self, node, scope, infered_type=None, deep=1): + @visitor.when(TrueConstant) #type: ignore # noqa + def visit(self, node, scope, infered_type=None, deep=1): # noqa: F811 return self.BOOL - @visitor.when(FalseConstant) - def visit(self, node, scope, infered_type=None, deep=1): + @visitor.when(FalseConstant) #type: ignore # noqa + def visit(self, node, scope, infered_type=None, deep=1): # noqa: F811 return self.BOOL diff --git a/src/travels/typebuilder.py b/src/travels/typebuilder.py index 9eae9fc6..f5011e40 100755 --- a/src/travels/typebuilder.py +++ b/src/travels/typebuilder.py @@ -1,28 +1,30 @@ +from typing import List, Any, Optional import typecheck.visitor as visitor -from abstract.tree import * -from abstract.semantics import SemanticError, Type, VoidType, IntegerType, StringType, ObjectType, Attribute, Method, Context, BoolType +import abstract.tree as coolAst +from abstract.semantics import SemanticError, Type, Context + class TypeBuilder: - def __init__(self, context: Context, errors = []): - self.context = context - self.errors = errors - self.current_type = None + def __init__(self, context: Context, errors=[]): + self.context: Context = context + self.errors: List[Any] = errors + self.current_type: Optional[Type] = None @visitor.on('node') def visit(self, node): pass - @visitor.when(ProgramNode) - def visit(self,node): + @visitor.when(coolAst.ProgramNode) # type: ignore + def visit(self, node: coolAst.ProgramNode): # noqa: F811 for class_ in node.class_list: self.visit(class_) - @visitor.when(ClassDef) - def visit(self, node: ClassDef): + @visitor.when(coolAst.ClassDef) # type: ignore + def visit(self, node: coolAst.ClassDef): # noqa: F811 self.current_type = self.context.get_type(node.idx) parent = self.context.get_type(node.parent) - #Detectar dependencias circulares + # Detectar dependencias circulares if parent.conforms_to(self.current_type): self.errors.append(f'Circular dependency: class {self.current_type.name} cannot inherit from {parent.name}') else: @@ -43,33 +45,28 @@ def visit(self, node: ClassDef): for feature in node.features: self.visit(feature) - - @visitor.when(AttributeDef) - def visit(self, node): + @visitor.when(coolAst.AttributeDef) # type: ignore + def visit(self, node: coolAst.AttributeDef): # noqa: F811 try: attr_type = self.context.get_type(node.typex) if isinstance(node.typex, str) else node.typex self.current_type.define_attribute(node.idx, attr_type) except SemanticError as e: self.errors.append(e.text) - @visitor.when(MethodDef) - def visit(self, node): + @visitor.when(coolAst.MethodDef) # type: ignore + def visit(self, node): # noqa: F811 params = [param.id for param in node.param_list] try: - params_type = [self.context.get_type(param.type) if isinstance(param.type, str) else param.type \ - for param in node.param_list] + params_type = [self.context.get_type(param.type) if isinstance(param.type, str) else param.type for param in node.param_list] try: - return_type = self.context.get_type(node.return_type) if isinstance(node.return_type,str) else node.return_type + return_type = self.context.get_type(node.return_type) if isinstance(node.return_type, str) else node.return_type try: - self.current_type.define_method(node.idx,params, params_type,return_type) + self.current_type.define_method(node.idx, params, params_type, return_type) except SemanticError as e: self.errors.append(e.text) - + except SemanticError as e: self.errors.append(e.text) except SemanticError as e: - self. errors.append(e.text) - - - + self.errors.append(e.text) diff --git a/src/travels/typecollector.py b/src/travels/typecollector.py index 713c0bb5..b1485ca3 100755 --- a/src/travels/typecollector.py +++ b/src/travels/typecollector.py @@ -1,37 +1,37 @@ import typecheck.visitor as visitor -from abstract.tree import * -from abstract.semantics import SemanticError, Type, VoidType, IntegerType, StringType, ObjectType, Attribute, Method, Context, BoolType, AutoType +import abstract.tree as coolAst +from abstract.semantics import SemanticError, VoidType, IntegerType, StringType, ObjectType, Context, BoolType, AutoType + class TypeCollector: - def __init__(self, errors= []): + def __init__(self, errors=[]): self.context = None self.errors = errors @visitor.on('node') - def visit(self,node): + def visit(self, node): pass - - @visitor.when(ProgramNode) - def visit(self,node): + + @visitor.when(coolAst.ProgramNode) # type: ignore + def visit(self, node): # noqa: F811 self.context = Context() OBJECT, INTEGER, STRING, BOOL, VOID = ObjectType(), IntegerType(), StringType(), BoolType(), VoidType() INTEGER.set_parent(OBJECT) STRING.set_parent(OBJECT) BOOL.set_parent(OBJECT) - self.context.types['object'] = OBJECT self.context.types['int'] = INTEGER self.context.types['string'] = STRING self.context.types['bool'] = BOOL self.context.types['void'] = VOID self.context.types['AUTO_TYPE'] = AutoType() + for class_ in node.class_list: self.visit(class_) - - @visitor.when(ClassDef) - def visit(self,node): + + @visitor.when(coolAst.ClassDef) # type:ignore + def visit(self, node: coolAst.ClassDef): # noqa: F811 try: self.context.create_type(node.idx) except SemanticError as e: self.errors.append(e.text) - diff --git a/src/typecheck/visitor.py b/src/typecheck/visitor.py index 0b82fbfd..7d652011 100755 --- a/src/typecheck/visitor.py +++ b/src/typecheck/visitor.py @@ -2,56 +2,60 @@ __all__ = ['on', 'when'] + def on(param_name): - def f(fn): - dispatcher = Dispatcher(param_name, fn) - return dispatcher - return f + def f(fn): + dispatcher = Dispatcher(param_name, fn) + return dispatcher + return f def when(param_type): - def f(fn): - frame = inspect.currentframe().f_back - func_name = fn.func_name if 'func_name' in dir(fn) else fn.__name__ - dispatcher = frame.f_locals[func_name] - if not isinstance(dispatcher, Dispatcher): - dispatcher = dispatcher.dispatcher - dispatcher.add_target(param_type, fn) - def ff(*args, **kw): - return dispatcher(*args, **kw) - ff.dispatcher = dispatcher - return ff - return f + def f(fn): + frame = inspect.currentframe().f_back + func_name = fn.func_name if 'func_name' in dir(fn) else fn.__name__ + dispatcher = frame.f_locals[func_name] + if not isinstance(dispatcher, Dispatcher): + dispatcher = dispatcher.dispatcher + dispatcher.add_target(param_type, fn) + + def ff(*args, **kw): + return dispatcher(*args, **kw) + + ff.dispatcher = dispatcher + return ff + + return f class Dispatcher(object): - def __init__(self, param_name, fn): - frame = inspect.currentframe().f_back.f_back - top_level = frame.f_locals == frame.f_globals - self.param_index = self.__argspec(fn).args.index(param_name) - self.param_name = param_name - self.targets = {} - - def __call__(self, *args, **kw): - typ = args[self.param_index].__class__ - d = self.targets.get(typ) - if d is not None: - return d(*args, **kw) - else: - issub = issubclass - t = self.targets - ks = t.keys() - ans = [t[k](*args, **kw) for k in ks if issub(typ, k)] - if len(ans) == 1: - return ans.pop() - return ans - - def add_target(self, typ, target): - self.targets[typ] = target - - @staticmethod - def __argspec(fn): - if hasattr(inspect, 'getfullargspec'): - return inspect.getfullargspec(fn) - else: - return inspect.getargspec(fn) + def __init__(self, param_name, fn): + frame = inspect.currentframe().f_back.f_back + top_level = frame.f_locals == frame.f_globals + self.param_index = self.__argspec(fn).args.index(param_name) + self.param_name = param_name + self.targets = {} + + def __call__(self, *args, **kw): + typ = args[self.param_index].__class__ + d = self.targets.get(typ) + if d is not None: + return d(*args, **kw) + else: + issub = issubclass + t = self.targets + ks = t.keys() + ans = [t[k](*args, **kw) for k in ks if issub(typ, k)] + if len(ans) == 1: + return ans.pop() + return ans + + def add_target(self, typ, target): + self.targets[typ] = target + + @staticmethod + def __argspec(fn): + if hasattr(inspect, 'getfullargspec'): + return inspect.getfullargspec(fn) + else: + return inspect.getargspec(fn) From e1be7c39e8d5842a560171d59a56aa362be816a3 Mon Sep 17 00:00:00 2001 From: Adrian Date: Mon, 11 May 2020 04:30:05 -0400 Subject: [PATCH 023/162] Added .builds file to gitignore. --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3567f524..b69dae7c 100644 --- a/.gitignore +++ b/.gitignore @@ -409,4 +409,6 @@ dmypy.json # Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option) ### Sublime Text Projects ### -*.sublime-project \ No newline at end of file +*.sublime-project + +.builds \ No newline at end of file From 26f8f81e5d706b0061c6329662acb749ce374990 Mon Sep 17 00:00:00 2001 From: Adrian Date: Mon, 11 May 2020 04:30:55 -0400 Subject: [PATCH 024/162] Added src/.builds to gitignore. --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b69dae7c..4cd1681f 100644 --- a/.gitignore +++ b/.gitignore @@ -411,4 +411,4 @@ dmypy.json ### Sublime Text Projects ### *.sublime-project -.builds \ No newline at end of file +src/.builds \ No newline at end of file From ddd1c079d87f12f6c3344de8eaa208a50138f3fa Mon Sep 17 00:00:00 2001 From: Adrian Date: Tue, 12 May 2020 01:33:30 -0400 Subject: [PATCH 025/162] IfThenElseNode to CIL. --- src/.builds | 1 + src/cil/baseCilVisitor.py | 5 ++++ src/cil/nodes.py | 40 +++++++++++++++++++++++++--- src/travels/ctcill.py | 56 ++++++++++++++++++++++++++++++--------- 4 files changed, 86 insertions(+), 16 deletions(-) diff --git a/src/.builds b/src/.builds index 090fb49d..a3bd9481 100644 --- a/src/.builds +++ b/src/.builds @@ -122,3 +122,4 @@ 1 1 1 +1 diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index d7b1c744..200b06b0 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -12,6 +12,7 @@ def __init__(self, context: Context): self.current_type: Optional[Type] = None self.current_method: Optional[Method] = None self.current_function: Optional[nodes.FunctionNode] = None + self.__labels_count: int = 0 @property def params(self) -> List[nodes.ParamNode]: @@ -68,3 +69,7 @@ def register_data(self, value: Any) -> nodes.DataNode: data_node = nodes.DataNode(vname, value) self.dot_data.append(data_node) return data_node + + def do_label(self, label: str) -> str: + self.__labels_count += 1 + return f"label_{label}_{self.__labels_count}" diff --git a/src/cil/nodes.py b/src/cil/nodes.py index d441e1ae..dee8ce79 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -79,83 +79,117 @@ class StarNode(ArithmeticNode): class DivNode(ArithmeticNode): pass + class GetAttributeNode(InstructionNode): pass + class SetAttributeNode(InstructionNode): pass + class GetIndexNode(InstructionNode): pass + class SetIndexNode(InstructionNode): pass + class AllocateNode(InstructionNode): - def __init__(self, itype, dest): + def __init__(self, itype: str, dest: str): self.itype = itype self.dest = dest + class ArrayNode(InstructionNode): pass + class TypeOfNode(InstructionNode): pass + class LabelNode(InstructionNode): - pass + def __init__(self, label: str): + self.label: str = label + + +class NotZeroJump(InstructionNode): + def __init__(self, variable: str, label: str): + self.variable: str = variable + self.label: str = label + + +class UnconditionalJump(InstructionNode): + def __init__(self, label: str): + self.label: str = label + class GotoNode(InstructionNode): pass + class GotoIfNode(InstructionNode): pass + class StaticCallNode(InstructionNode): - def __init__(self, function, dest): + def __init__(self, function: str, dest: str): self.function = function self.dest = dest + class DynamicCallNode(InstructionNode): def __init__(self, xtype, method, dest): self.xtype = xtype self.method = method self.dest = dest + class ArgNode(InstructionNode): def __init__(self, name): self.name = name + class ReturnNode(InstructionNode): def __init__(self, value=None): self.value = value + class LoadNode(InstructionNode): def __init__(self, dest, message): self.dest = dest self.message = message + class LengthNode(InstructionNode): pass + class ConcatNode(InstructionNode): pass + class PrefixNode(InstructionNode): pass + class SubstringNode(InstructionNode): pass + class ToStrNode(InstructionNode): def __init__(self, dest, ivalue): self.dest = dest self.ivalue = ivalue + class ReadNode(InstructionNode): def __init__(self, dest): self.dest = dest + class PrintNode(InstructionNode): def __init__(self, string_address): self.string_address = string_address diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index bbd48975..e1c6bffc 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -3,16 +3,19 @@ import abstract.tree as coolAst import abstract.semantics as semantics import cil.nodes as cil -from typing import List +from typing import List, Tuple + +ExpressionReturn = Tuple[List[cil.InstructionNode], List[cil.LocalNode]] +Scope = semantics.Scope class CoolToCILVisitor(baseCilVisitor.BaseCoolToCilVisitor): @visitor.on("node") - def visit(self, node: coolAst.Node) -> None: + def visit(self, node: coolAst.Node, local_vm_holder: str = '') -> None: pass @visitor.when(coolAst.ProgramNode) # type: ignore - def visit(self, node: coolAst.ProgramNode, scope: semantics.Scope) -> cil.CilProgramNode: # noqa: F811 + def visit(self, node: coolAst.ProgramNode, scope: Scope, local_vm_holder: str = '') -> cil.CilProgramNode: # noqa: F811 # node.class_list -> [ClassDef ...] # Define the entry point for the program. @@ -38,7 +41,7 @@ def visit(self, node: coolAst.ProgramNode, scope: semantics.Scope) -> cil.CilPro return cil.CilProgramNode(self.dot_types, self.dot_data, self.dot_code) @visitor.when(coolAst.ClassDef) # type: ignore - def visit(self, node: coolAst.ClassDef, scope: semantics.Scope) -> None: # noqa: F811 + def visit(self, node: coolAst.ClassDef, scope: Scope, local_vm_holder: str = '') -> None: # noqa: F811 # node.idx -> String with the Class Name # node.features -> [AttributeDef ... MethodDef ...] List with attributes and method declarations @@ -83,7 +86,7 @@ def visit(self, node: coolAst.ClassDef, scope: semantics.Scope) -> None: # noqa self.current_type = None @visitor.when(coolAst.MethodDef) # type: ignore - def visit(self, node: coolAst.MethodDef, scope: semantics.Scope) -> None: # noqa: F811 + def visit(self, node: coolAst.MethodDef, scope: Scope, local_vm_holder: str = '') -> None: # noqa: F811 self.current_method = self.current_type.get_method(node.idx) # Register the new function in .CODE @@ -93,16 +96,43 @@ def visit(self, node: coolAst.MethodDef, scope: semantics.Scope) -> None: # noq # names for variables and stuffs. self.current_function = function_node - # Define the method params - function_node.params = [cil.ParamNode(param.idx) for param in node.param_list] + # Define method's params + params: List[semantics.VariableInfo] = [scope.find_variable(param.idx) for param in node.param_list] + + # Register function's params + for param in params: + self.register_params(param) # Get the instructions that conforms the body of the method - for exp, child_scope in zip(node.statements, scope.children): - # every exp return a tuple: the instruction set and the localvars - # needed - instructions, local_vars = self.visit(exp, child_scope) - function_node.instructions += instructions - function_node.localvars += local_vars + for exp in node.statements: + self.visit(exp, scope) self.current_method = None self.current_function = None + + @visitor.when(coolAst.IfThenElseNode) # type: ignore + def visit(self, node: coolAst.IfThenElseNode, scope: Scope, local_vm_holder: str = '') -> None: # noqa: F811 + + # Define a holder for the result of condition value + internal_cond_bool = self.define_internal_local() + + # Create a jumping label + false_label = self.do_label("FALSE") + end_label = self.do_label("END") + + # Save the instructions related to the condition + self.visit(node.cond, scope, internal_cond_bool) + + # Do the check and jump if necesary + self.register_instruction(cil.NotZeroJump(internal_cond_bool, false_label)) + + # Save the instructions related to the then branch + self.visit(node.expr1, scope) + + self.register_instruction(cil.UnconditionalJump(end_label)) + + # Save the instructions related to the else branch + self.register_instruction(cil.LabelNode(false_label)) + self.visit(node.expr2, scope) + + self.register_instruction(cil.LabelNode(end_label)) From 4a73815bf6e1e61ea35e2dfca7e81e4f6413af3d Mon Sep 17 00:00:00 2001 From: Adrian Date: Tue, 12 May 2020 02:01:24 -0400 Subject: [PATCH 026/162] Annotated typecheck.py. --- src/coolgrammar/grammar.py | 4 +-- src/travels/ctcill.py | 4 +++ src/travels/typecheck.py | 53 ++++++++++++++++++++++++-------------- 3 files changed, 39 insertions(+), 22 deletions(-) diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index c70c0f71..79cd9cb2 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -4,12 +4,12 @@ from grammar.grammar import Grammar from abstract.tree import ProgramNode, ClassDef, MethodDef, AttributeDef, Param, VariableDeclaration from abstract.tree import PlusNode, DivNode, MulNode, DifNode, IntegerConstant, FunCall -from abstract.tree import VariableCall, FalseConstant, StringConstant, GreaterThanNode, TrueConstant +from abstract.tree import VariableCall, FalseConstant, StringConstant, TrueConstant from abstract.tree import GreaterEqualNode, LowerThanNode, LowerEqual, AssignNode, IfThenElseNode from abstract.tree import NotNode, WhileBlockNode, EqualToNode, InstantiateClassNode from abstract.tree import ActionNode, CaseNode, ParentFuncCall, BlockNode, IsVoidNode from abstract.tree import NegNode -from lexer.tokenizer import Lexer +# from lexer.tokenizer import Lexer from tknizer import Tokenizer diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index e1c6bffc..54703c87 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -136,3 +136,7 @@ def visit(self, node: coolAst.IfThenElseNode, scope: Scope, local_vm_holder: str self.visit(node.expr2, scope) self.register_instruction(cil.LabelNode(end_label)) + + @visitor.when(coolAst.VariableDeclaration) # type: ignore + def visit(self, node: coolAst.VariableDeclaration, scope: Scope, local_vm_holder: str = '') -> None: # noqa: F811 + node. diff --git a/src/travels/typecheck.py b/src/travels/typecheck.py index 24490d46..fb7f83d3 100755 --- a/src/travels/typecheck.py +++ b/src/travels/typecheck.py @@ -1,9 +1,21 @@ from typecheck.visitor import on, when -from abstract.semantics import * -from abstract.tree import * +import abstract.semantics as semantics +import abstract.tree as coolAst + + +# Types aliases +Context = semantics.Context +Scope = semantics.Scope + +# AST aliases +ProgramNode = coolAst.ProgramNode +ClassDef = coolAst.ClassDef +AttributeDef = coolAst.AttributeDef +MethodDef = coolAst.MethodDef + class TypeChecker: - def __init__(self, context:Context, errors = []): + def __init__(self, context: Context, errors=[]): self.current_type = None self.context = context self.AUTO_TYPE = self.context.get_type('AUTO_TYPE') @@ -13,29 +25,30 @@ def __init__(self, context:Context, errors = []): def visit(self, node, scope): pass - @when(ProgramNode) - def visit(self, node: ProgramNode, scope = None): + @when(ProgramNode) # type: ignore + def visit(self, node: ProgramNode, scope=None): # noqa: F811 scope = Scope() for class_ in node.class_list: self.visit(class_, scope.create_child()) - - @when(ClassDef) - def visit(self, node: ClassDef, scope: Scope): + + @when(ClassDef) # type: ignore + def visit(self, node: ClassDef, scope: Scope): # noqa: F811 self.current_type = self.context.get_type(node.idx) for feature in node.features: - self.visit(feature,scope) if isinstance(feature, AttributeDef) else pass - + if isinstance(feature, AttributeDef): + self.visit(feature, scope) + for feature in node.features: - self.visit(feature, scope.create_child()) if isinstance(feature, MethodDef) else pass - - @when(AttributeDef) - def visit(self, node: AttributeDef, scope: Scope): + if isinstance(feature, MethodDef): + self.visit(feature, scope.create_child()) + + @when(AttributeDef) # type: ignore + def visit(self, node: AttributeDef, scope: Scope): # noqa: F811 att = self.current_type.get_attribute(node.idx) if att.type == self.AUTO_TYPE: self.errors.append(f'Cannot infer type of attribute {att.name}') - scope.define_variable(typ.name, typ.type) - - @when(MethodDef) - def visit(self, node: MethodDef, scope:Scope): - m = self.current_type.get_method(node.idx) - \ No newline at end of file + scope.define_variable(att.name, att.type) + + @when(MethodDef) # type: ignore + def visit(self, node: MethodDef, scope: Scope): # noqa: F811 + method = self.current_type.get_method(node.idx) From 16530c6bb977c94cb1744a7c6b3268ae783fd7cb Mon Sep 17 00:00:00 2001 From: Adrian Date: Tue, 12 May 2020 02:11:05 -0400 Subject: [PATCH 027/162] Correctly annotated comments.py. --- src/comments.py | 3 ++- src/typecheck/evaluator.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/comments.py b/src/comments.py index b81ec68e..f92d2ce4 100644 --- a/src/comments.py +++ b/src/comments.py @@ -1,3 +1,4 @@ +from typing import Any ''' Process a source file removing coments. Because coments in COOL can be nested, there is @@ -6,7 +7,7 @@ ''' -def find_comments(program: str) -> str: +def find_comments(program: Any) -> str: ''' This functions detects every comment in a Cool program\ and replace it with empty lines. This is done in a way\ diff --git a/src/typecheck/evaluator.py b/src/typecheck/evaluator.py index 570fc3ac..f25ccc46 100755 --- a/src/typecheck/evaluator.py +++ b/src/typecheck/evaluator.py @@ -1,4 +1,7 @@ -def evaluate_right_parse(parse: [], tokens): +from typing import Iterable, Any + + +def evaluate_right_parse(parse: Iterable[Any], tokens): def evaluate_production(productions, production, tokens): synteticed = [None] * (len(production.Right) + 1) rules = production.attributes From 8bce4675a4306b13f9ccc71697b22600bb13c192 Mon Sep 17 00:00:00 2001 From: Adrian Date: Tue, 12 May 2020 02:15:29 -0400 Subject: [PATCH 028/162] [TODO] Added TODO: REIMPLEMENT visitor over VariableDeclaration on inference.py --- src/travels/inference.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/travels/inference.py b/src/travels/inference.py index 61953584..7ce61261 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -183,6 +183,7 @@ def visit(self, node: coolAst.IfThenElseNode, scope: semantic.Scope, infered_typ return e1_parent @visitor.when(coolAst.VariableDeclaration) #type: ignore # noqa + # TODO FIX THIS, IT is not working after change in grammar, REIMPLEMENT IT!!!! def visit(self, node: coolAst.VariableDeclaration, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 type_ = self.context.get_type(node.type) if type_ != self.AUTO_TYPE: From 82ec77c79c8bd59705a41f36ebc1e95a6f30cc27 Mon Sep 17 00:00:00 2001 From: Adrian Date: Tue, 12 May 2020 22:36:12 -0400 Subject: [PATCH 029/162] Added visitor over VariableCallNode on ctcill.py --- src/travels/ctcill.py | 24 +++++++++++++++++++++--- src/travels/inference.py | 22 +++++++++++----------- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 54703c87..9e351cf6 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -30,8 +30,7 @@ def visit(self, node: coolAst.ProgramNode, scope: Scope, local_vm_holder: str = self.register_instruction(cil.ArgNode(instance)) # call the main method - self.register_instruction( - cil.StaticCallNode(self.to_function_name('main', 'Main'), result)) + self.register_instruction(cil.StaticCallNode(self.to_function_name('main', 'Main'), result)) self.register_instruction(cil.ReturnNode(0)) self.current_function = None @@ -139,4 +138,23 @@ def visit(self, node: coolAst.IfThenElseNode, scope: Scope, local_vm_holder: str @visitor.when(coolAst.VariableDeclaration) # type: ignore def visit(self, node: coolAst.VariableDeclaration, scope: Scope, local_vm_holder: str = '') -> None: # noqa: F811 - node. + for var_idx, var_type, var_init_expr in node.var_list: + + # Register the variables in order + var_info = scope.find_variable(var_idx) + local_var = self.register_local(var_info) + + # Allocate memory for the variable type + self.register_instruction(cil.AllocateNode(var_info.type.name, local_var)) + + # Generate the code of the initialization expr if exists + if var_init_expr is not None: + self.visit(var_init_expr, scope, local_vm_holder) + # assign the corresponding value to the defined local_var + self.register_instruction(cil.AssignNode(local_var, local_vm_holder)) + + # Process the associated block, if any, to the let declaration + self.visit(node.block_statements, scope, local_vm_holder) + + @visitor.when(coolAst.BlockNode) # type:ignore + def visit(self, node: coolAst.BlockNode, scope: Scope, local_vm_holder: str = '') -> None: # noqa: F811 diff --git a/src/travels/inference.py b/src/travels/inference.py index 7ce61261..edaf08f5 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -185,17 +185,17 @@ def visit(self, node: coolAst.IfThenElseNode, scope: semantic.Scope, infered_typ @visitor.when(coolAst.VariableDeclaration) #type: ignore # noqa # TODO FIX THIS, IT is not working after change in grammar, REIMPLEMENT IT!!!! def visit(self, node: coolAst.VariableDeclaration, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 - type_ = self.context.get_type(node.type) - if type_ != self.AUTO_TYPE: - if deep == 1: - scope.define_variable(node.idx, type_) - return void - else: - if deep == 1: - type_ = self.visit(node.expr, scope, infered_type, deep) - print(f'Infered type {type_.name} for {node.idx}') - scope.define_variable(node.idx, type_) - return void + for var_idx, var_type, var_init_exp in node.var_list: + type_ = self.context.get_type(var_type) + if type_ != self.AUTO_TYPE: + if deep == 1: + scope.define_variable(var_idx, type_) + else: + if deep == 1: + type_ = self.visit(node.block_statements, scope, infered_type, deep) + print(f'Infered type {type_.name} for {var_idx}') + scope.define_variable(node.idx, type_) + return void @visitor.when(coolAst.FunCall) #type: ignore # noqa def visit(self, node: coolAst.FunCall, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 From b55a831b0717c8cd6066d9daf3ac60ee8be5991a Mon Sep 17 00:00:00 2001 From: Adrian Date: Wed, 13 May 2020 15:15:21 -0400 Subject: [PATCH 030/162] Implemented visitor over BlockNode on ctcill.py --- src/travels/ctcill.py | 50 +++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 9e351cf6..c963226e 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -11,7 +11,7 @@ class CoolToCILVisitor(baseCilVisitor.BaseCoolToCilVisitor): @visitor.on("node") - def visit(self, node: coolAst.Node, local_vm_holder: str = '') -> None: + def visit(self, node: coolAst.Node) -> None: pass @visitor.when(coolAst.ProgramNode) # type: ignore @@ -40,7 +40,7 @@ def visit(self, node: coolAst.ProgramNode, scope: Scope, local_vm_holder: str = return cil.CilProgramNode(self.dot_types, self.dot_data, self.dot_code) @visitor.when(coolAst.ClassDef) # type: ignore - def visit(self, node: coolAst.ClassDef, scope: Scope, local_vm_holder: str = '') -> None: # noqa: F811 + def visit(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 # node.idx -> String with the Class Name # node.features -> [AttributeDef ... MethodDef ...] List with attributes and method declarations @@ -85,7 +85,7 @@ def visit(self, node: coolAst.ClassDef, scope: Scope, local_vm_holder: str = '') self.current_type = None @visitor.when(coolAst.MethodDef) # type: ignore - def visit(self, node: coolAst.MethodDef, scope: Scope, local_vm_holder: str = '') -> None: # noqa: F811 + def visit(self, node: coolAst.MethodDef, scope: Scope) -> None: # noqa: F811 self.current_method = self.current_type.get_method(node.idx) # Register the new function in .CODE @@ -110,20 +110,17 @@ def visit(self, node: coolAst.MethodDef, scope: Scope, local_vm_holder: str = '' self.current_function = None @visitor.when(coolAst.IfThenElseNode) # type: ignore - def visit(self, node: coolAst.IfThenElseNode, scope: Scope, local_vm_holder: str = '') -> None: # noqa: F811 - - # Define a holder for the result of condition value - internal_cond_bool = self.define_internal_local() - + def visit(self, node: coolAst.IfThenElseNode, scope: Scope) -> None: # noqa: F811 # Create a jumping label false_label = self.do_label("FALSE") end_label = self.do_label("END") - # Save the instructions related to the condition - self.visit(node.cond, scope, internal_cond_bool) + # Save the instructions related to the condition, + # Each expr returns the name of the holder varaiable + internal_cond_vm_holder = self.visit(node.cond, scope) # Do the check and jump if necesary - self.register_instruction(cil.NotZeroJump(internal_cond_bool, false_label)) + self.register_instruction(cil.NotZeroJump(internal_cond_vm_holder, false_label)) # Save the instructions related to the then branch self.visit(node.expr1, scope) @@ -137,24 +134,41 @@ def visit(self, node: coolAst.IfThenElseNode, scope: Scope, local_vm_holder: str self.register_instruction(cil.LabelNode(end_label)) @visitor.when(coolAst.VariableDeclaration) # type: ignore - def visit(self, node: coolAst.VariableDeclaration, scope: Scope, local_vm_holder: str = '') -> None: # noqa: F811 + def visit(self, node: coolAst.VariableDeclaration, scope: Scope) -> None: # noqa: F811 for var_idx, var_type, var_init_expr in node.var_list: # Register the variables in order var_info = scope.find_variable(var_idx) local_var = self.register_local(var_info) - # Allocate memory for the variable type + # Allocate memory for the variable type and give default initialization self.register_instruction(cil.AllocateNode(var_info.type.name, local_var)) # Generate the code of the initialization expr if exists if var_init_expr is not None: - self.visit(var_init_expr, scope, local_vm_holder) + expr_init_vm_holder = self.visit(var_init_expr, scope) # assign the corresponding value to the defined local_var - self.register_instruction(cil.AssignNode(local_var, local_vm_holder)) + self.register_instruction(cil.AssignNode(local_var, expr_init_vm_holder)) - # Process the associated block, if any, to the let declaration - self.visit(node.block_statements, scope, local_vm_holder) + # Process the associated expr, if any, to the let declaration + # A block defines a new scope, so it is important to manage it + self.visit(node.block_statements, scope.children[0]) @visitor.when(coolAst.BlockNode) # type:ignore - def visit(self, node: coolAst.BlockNode, scope: Scope, local_vm_holder: str = '') -> None: # noqa: F811 + def visit(self, node: coolAst.BlockNode, scope: Scope) -> str: # noqa: F811 + last = '' + # A block is simply a list of statements, so visit each one + for stmt in node.expressions: + last = self.visit(stmt, scope) + # Return value of a block is its last statement + return last + + @visitor.when(coolAst.AssignNode) # type:ignore + def visit(self, node: coolAst.AssignNode, scope: Scope): # noqa: F811 + # Assignments had the form : + # id <- expr + # So here we assume that a local variable named "id" + # has already been defined + + # TODO: need to diferentiate between attributes and method vars? + pass From fbe9cc399f245a39b0dec457ff20aa45b0ec12cb Mon Sep 17 00:00:00 2001 From: Adrian Date: Wed, 13 May 2020 16:12:05 -0400 Subject: [PATCH 031/162] Implemented visitor over AssignNode in ccil.py --- src/cil/nodes.py | 10 ++++++++-- src/travels/ctcill.py | 9 +++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/cil/nodes.py b/src/cil/nodes.py index dee8ce79..802681d4 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -81,11 +81,17 @@ class DivNode(ArithmeticNode): class GetAttributeNode(InstructionNode): - pass + def __init__(self, itype: str, attrname: str, dest: str): + self.itype = itype + self.attrname = attrname + self.dest = dest class SetAttributeNode(InstructionNode): - pass + def __init__(self, itype: str, attrname: str, source: str): + self.source = source + self.itype = itype + self.attrname = attrname class GetIndexNode(InstructionNode): diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index c963226e..be7b5b11 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -165,10 +165,15 @@ def visit(self, node: coolAst.BlockNode, scope: Scope) -> str: # noqa: F811 @visitor.when(coolAst.AssignNode) # type:ignore def visit(self, node: coolAst.AssignNode, scope: Scope): # noqa: F811 - # Assignments had the form : + # Assignments looks like: # id <- expr # So here we assume that a local variable named "id" # has already been defined # TODO: need to diferentiate between attributes and method vars? - pass + + # Generate the code for the rvalue (expr) + rvalue_vm_holder = self.visit(self, node.expr) + + # register the assignment instruction + self.register_instruction(cil.AssignNode(node.idx, rvalue_vm_holder)) From c103070390b17f927dac6dfe984b42be706a0a9d Mon Sep 17 00:00:00 2001 From: Adrian Date: Wed, 13 May 2020 16:28:27 -0400 Subject: [PATCH 032/162] Implemented visitor over WhileBlockNode on ctcill.py --- src/cil/nodes.py | 8 ++++++++ src/travels/ctcill.py | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 802681d4..c4c85b3c 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -121,6 +121,12 @@ def __init__(self, label: str): self.label: str = label +class IfZeroJump(InstructionNode): + def __init__(self, variable: str, label: str): + self.variable = variable + self.label = label + + class NotZeroJump(InstructionNode): def __init__(self, variable: str, label: str): self.variable: str = variable @@ -199,3 +205,5 @@ def __init__(self, dest): class PrintNode(InstructionNode): def __init__(self, string_address): self.string_address = string_address + + diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index be7b5b11..4076173b 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -177,3 +177,24 @@ def visit(self, node: coolAst.AssignNode, scope: Scope): # noqa: F811 # register the assignment instruction self.register_instruction(cil.AssignNode(node.idx, rvalue_vm_holder)) + + @visitor.when(coolAst.WhileBlockNode) # type: ignore + def visit(self, node: coolAst.WhileBlockNode, scope: Scope): # noqa: F811 + + # First evaluate the condition and set a label + # to return to + while_label = self.do_label('WHILE') + end_label = self.do_label('WHILE_END') + self.register_instruction(cil.LabelNode(while_label)) + cond_vm_holder = self.visit(node.cond, scope) + + # Compare condition, if true then execute, else jump to end + self.register_instruction(cil.IfZeroJump(cond_vm_holder, end_label)) + + # Register the instructions of the body + self.visit(node.statements, scope) + + # Do am unconditional jump to condition check + self.register_instruction(cil.UnconditionalJump(while_label)) + # Register the end label + self.register_instruction(cil.LabelNode(end_label)) From 5038fbbf629613fd641c725d0a10a5530497daac Mon Sep 17 00:00:00 2001 From: Adrian Date: Thu, 14 May 2020 21:27:09 -0400 Subject: [PATCH 033/162] Added LCA tables to baseCilVisitor.py to support runtime-type-checking. --- src/cil/baseCilVisitor.py | 161 +++++++++++++++++++++++++++++++++++++- src/cil/nodes.py | 4 +- src/travels/ctcill.py | 13 +++ 3 files changed, 176 insertions(+), 2 deletions(-) diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 200b06b0..ecc68da7 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -1,7 +1,132 @@ -from typing import List, Optional, Any +from typing import List, Optional, Any, Dict, Tuple import cil.nodes as nodes from abstract.semantics import VariableInfo, Context, Type, Method +LCA_TABLE = Dict[Tuple[str, str], str] + + +# Esta clase no debe ser utilizada directamente en el desarrollo del compilador. +# Solo esta pensada para dar soporte a un grafo que represente la jerarquia de +# clases de Cool, sobre la cual se construira una tabla LCA para poder consultar +# la jerarquia en runtime. InheritanceGraph representa grafos no dirigidos ya que +# las restricciones de Cool permiten hacer transformaciones al Grafo Dirigido que +# se obtiene de la jerarquia de clases para trabajar sobre arboles. +class __InheritanceGraph: + def __init__(self): + # Lista de adyacencia del grafo + self._adytable: Dict[str, List[str]] = {} + + # Tabla LCA + self._lcatable: LCA_TABLE = {} + + def add_edge(self, parent: str, child: str) -> None: + # Agregar una arista a la lista de adyacencia. + try: + # Caso de que se hallan inicializado las listas de cada nodo. + self._adytable[parent].append(child) + self._adytable[child].append(parent) + except KeyError: + # Hay k inicializar las listas de cada nodo. + self._adytable[parent] = [child] + self._adytable[child] = [parent] + + def __do_euler_trip(self, root: str, visited: Dict[str, bool], tour: List[str]): + # Este metodo realiza el tour de euler en el grafo representado esta instancia. + + # Marcar el nodo desde el que partimos como visitado. + visited[root] = True + + # Agregar el nodo al tour cuando lo vemos por primera vez. + tour.append(root) + + for v in self._adytable[root]: + # Realizar el tour por todos los subarboles que no hayamos visitado. + if not visited[v]: + self.__do_euler_trip(v, visited, tour) + # Volver a agregar el nodo del que partimos cuando regresamos a el. + tour.append(root) + + def __compute_nodes_levels(self, root: str, visited: Dict[str, bool], levels: List[int], lvl: int = 0): + # Es la misma idea que el tour de euler, visitar los nodos en DFS y agregar para cada nodo + # su distancia desde la raiz + + # marcar el nodo raiz de este subarbol como visitado + visited[root] = True + + # agregar el nivel de este nodo a la lista de niveles + levels.append(lvl) + + # Visitar los nodos adyacentes en DFS + for v in self._adytable[root]: + # Realizar el recorrido por los subarboles que no hayamos visitado + if not visited[v]: + self.__compute_nodes_levels(v, visited, levels, lvl + 1) + # Volver a agregar el nivel del nodo cuando regresamos a el. + levels.append(lvl) + + def __compute_representative_array(self, tour: List[str]) -> Dict[str, int]: + # El representativo de cada nodo es la primera ocurrencia j del nodo tour[j] + visited: Dict[str, bool] = {node: False for node in self._adytable.keys()} + representative: Dict[str, int] = {} + for i, node in enumerate(tour): + if not visited[node]: + representative[node] = i + return representative + + def build_lca_table(self): + # Realizar el preprocesamiento necesario para crear la Tabla LCA. + # Este preprocesamiento coincide con una DP para preprocesar un array para RMQ. + # La implementacion del preprocesamiento es O(n^2). Existen algoritmos para preprocesar en + # O(n) y responder las querys en O(1), pero dado que vamos a preguntar las n(n-1)/2 querys + # para almacenarlas en la tabla, hacer el preprocesamiento en O(n^2) no afecta el orden del + # tiempo total de construccion. No obstante la DP es necesaria para no realizar el preprocesamiento + # en O(n^3). + + # Verificar que se halla construido el grafo + assert self._adytable + visited: Dict[str, bool] = {node: False for node in self._adytable.keys()} + + # Crear el tour de euler + tour: List[str] = [] + # La raiz de la jerarquia es Object + root = 'Object' + self.__do_euler_trip(root, visited, tour) + + # crear el array de niveles + levels: List[int] = [] + for node in visited.keys(): + visited[node] = False + self.__compute_nodes_levels(root, visited, levels) + + # crear el array de nodos representativos + representative = self.__compute_representative_array(tour) + nodes = len(representative) + + # Preprocesar la tabla para responder las rmq-querys. + # rmq_table[i][j] contiene el indice del menor elemento en el intervalo[i, j] + rmq_table: List[List[int]] = [[0 for _ in range(nodes)] for _ in range(nodes)] + + # Sabemos que rmq[i,0] = i. Entonces podemos inicializar la tabla + for i in range(nodes): + rmq_table[i][0] = i + + # Para calcular la tabla solo tenemos que aplicar la DP: + # rmq[i, j] = min(A[rmq[i, j-1]], A[j]) donde A es nuestro array + for i in range(nodes): # Iterar de menor a mayor longitud del intervalo + for j in range(1, nodes): + m1 = rmq_table[i][j-1] + if levels[m1] < levels[j]: + rmq_table[i][j] = m1 + else: + rmq_table[i][j] = j + + # Con la tabla construida, pasemos a hacer todas las preguntas + for node1 in self._adytable.keys(): + for node2 in self._adytable.keys(): + # El LCA lo podemos calcular como LCA(x,y) = E[RMQ(r[x], r[y])] donde E es el tour de euler + # y r es el array representativo. + self._lcatable[node1, node2] = tour[rmq_table[representative[node1][representative[node2]]]] + class BaseCoolToCilVisitor: def __init__(self, context: Context): @@ -13,6 +138,8 @@ def __init__(self, context: Context): self.current_method: Optional[Method] = None self.current_function: Optional[nodes.FunctionNode] = None self.__labels_count: int = 0 + self.__build_CART() + self.__build_builtins() @property def params(self) -> List[nodes.ParamNode]: @@ -73,3 +200,35 @@ def register_data(self, value: Any) -> nodes.DataNode: def do_label(self, label: str) -> str: self.__labels_count += 1 return f"label_{label}_{self.__labels_count}" + + def __build_CART(self) -> None: + """ + CART: Context Aware Runtime Table.\ + This structure stores data related to the Class Hierarchy defined in the program. This structure is meant to be stored \ + on the .DATA section and would be used by methods related to runtime type-checking. It is the first defined data in the \ + .DATA section. The structure is a table where for class i,j table[i,j] contains the LCA of class i and class j, i.e, \ + table[i,j] = C where i < C, j < C, and C is the lowest Class that satisfy this condition and the operator "<" stands \ + for 'conforms to'. + """ + + # Crear el grafo de herencia basado en el contexto que tenemos hasta el momento. + graph = __InheritanceGraph() + for itype in self.context.types: + if self.context.types[itype].parent is not None: + graph.add_edge(self.context.types[itype].parent.name, itype) # type: ignore + + # Crear la tabla LCA + graph.build_lca_table() + + # Procesar la tabla LCA para hacerla accesible en runtime + + def __build_builtins(self): + pass + + +if __name__ == '__main__': + context = Context() + object_type = context.create_type('Object') + int_type = context.create_type('Integer') + string_type = context.create_type('String') + a_type = context.create_type('A') diff --git a/src/cil/nodes.py b/src/cil/nodes.py index c4c85b3c..92ca52e4 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -113,7 +113,9 @@ class ArrayNode(InstructionNode): class TypeOfNode(InstructionNode): - pass + def __init__(self, variable: str, dest: str): + self.variable = variable + self.dest = dest class LabelNode(InstructionNode): diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 4076173b..bf9c90b7 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -198,3 +198,16 @@ def visit(self, node: coolAst.WhileBlockNode, scope: Scope): # noqa: F811 self.register_instruction(cil.UnconditionalJump(while_label)) # Register the end label self.register_instruction(cil.LabelNode(end_label)) + + @visitor.when(coolAst.CaseNode) # type: ignore + def visit(self, node: coolAst.CaseNode, scope: Scope): # noqa: F811 + # First need to evaluate expr0 + expr_vm_holder = self.visit(node.expression, scope) + + # Store the type of the returned value + type_internal_local_holder = self.define_internal_local() + self.register_instruction(cil.TypeOfNode(expr_vm_holder, type_internal_local_holder)) + + # Iterate over every action + for action_node in node.actions: + pass From 9abd7c8b70e8f6a172a77cf97d11285a29fe7ff5 Mon Sep 17 00:00:00 2001 From: Adrian Date: Fri, 15 May 2020 17:24:16 -0400 Subject: [PATCH 034/162] LCA table build seems to work. --- src/cil/baseCilVisitor.py | 31 +++++++++++++++---------------- src/testing.py | Bin 853 -> 713 bytes 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index ecc68da7..460d15fa 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -11,7 +11,7 @@ # la jerarquia en runtime. InheritanceGraph representa grafos no dirigidos ya que # las restricciones de Cool permiten hacer transformaciones al Grafo Dirigido que # se obtiene de la jerarquia de clases para trabajar sobre arboles. -class __InheritanceGraph: +class InheritanceGraph: def __init__(self): # Lista de adyacencia del grafo self._adytable: Dict[str, List[str]] = {} @@ -24,10 +24,12 @@ def add_edge(self, parent: str, child: str) -> None: try: # Caso de que se hallan inicializado las listas de cada nodo. self._adytable[parent].append(child) - self._adytable[child].append(parent) except KeyError: # Hay k inicializar las listas de cada nodo. self._adytable[parent] = [child] + try: + self._adytable[child].append(parent) + except KeyError: self._adytable[child] = [parent] def __do_euler_trip(self, root: str, visited: Dict[str, bool], tour: List[str]): @@ -71,6 +73,7 @@ def __compute_representative_array(self, tour: List[str]) -> Dict[str, int]: for i, node in enumerate(tour): if not visited[node]: representative[node] = i + visited[node] = True return representative def build_lca_table(self): @@ -100,20 +103,20 @@ def build_lca_table(self): # crear el array de nodos representativos representative = self.__compute_representative_array(tour) - nodes = len(representative) + nodes = len(levels) # Preprocesar la tabla para responder las rmq-querys. # rmq_table[i][j] contiene el indice del menor elemento en el intervalo[i, j] rmq_table: List[List[int]] = [[0 for _ in range(nodes)] for _ in range(nodes)] - # Sabemos que rmq[i,0] = i. Entonces podemos inicializar la tabla + # Sabemos que rmq[i,i] = i. Entonces podemos inicializar la tabla for i in range(nodes): - rmq_table[i][0] = i + rmq_table[i][i] = i # Para calcular la tabla solo tenemos que aplicar la DP: # rmq[i, j] = min(A[rmq[i, j-1]], A[j]) donde A es nuestro array for i in range(nodes): # Iterar de menor a mayor longitud del intervalo - for j in range(1, nodes): + for j in range(i + 1, nodes): m1 = rmq_table[i][j-1] if levels[m1] < levels[j]: rmq_table[i][j] = m1 @@ -125,7 +128,10 @@ def build_lca_table(self): for node2 in self._adytable.keys(): # El LCA lo podemos calcular como LCA(x,y) = E[RMQ(r[x], r[y])] donde E es el tour de euler # y r es el array representativo. - self._lcatable[node1, node2] = tour[rmq_table[representative[node1][representative[node2]]]] + m1 = min(representative[node1], representative[node2]) + m2 = max(representative[node1], representative[node2]) + self._lcatable[node1, node2] = tour[rmq_table[m1][m2]] + self._lcatable[node2, node1] = tour[rmq_table[m1][m2]] class BaseCoolToCilVisitor: @@ -212,23 +218,16 @@ def __build_CART(self) -> None: """ # Crear el grafo de herencia basado en el contexto que tenemos hasta el momento. - graph = __InheritanceGraph() + graph = InheritanceGraph() for itype in self.context.types: if self.context.types[itype].parent is not None: graph.add_edge(self.context.types[itype].parent.name, itype) # type: ignore # Crear la tabla LCA graph.build_lca_table() + self.lca_table = graph._lcatable # Procesar la tabla LCA para hacerla accesible en runtime def __build_builtins(self): pass - - -if __name__ == '__main__': - context = Context() - object_type = context.create_type('Object') - int_type = context.create_type('Integer') - string_type = context.create_type('String') - a_type = context.create_type('A') diff --git a/src/testing.py b/src/testing.py index aedceb221534cbadf454ca22fbafa639a2276c22..134e7b74068b07d9bcbbd6e7bff3fe26ce7ae5cd 100755 GIT binary patch literal 713 zcmaKqJ#GXc42646K{sqO2Z%I9cG9FukyTm*#Ith5&j_qla{DmADnv@4w7>V{XS2oN zxIsH>m0(5th6yP|j&2W;`1z=YU@zgP$F@VGbfTyX%?X_HgeKiJYw!f0#29W|O0OJ9 z$(MysQaXiR%ISge{7mKe!ka>zNCz6lnzBba vWwmM%hfK}aBh|P%)Leb{*SzKUw|w%yKAmX)pgQgOh9qvYHQ8Tj3n%ss&2IDO literal 853 zcmZ`%O>dkq5bfE&Vgv^uTA{SPRoVlGO%K_$5!pizNRh#2*Q`H~ZIbT4@7Ta5QClQ5 z_M12J=EJ=;3OZxt(Nd+T1))Y`JuFw!2meT|fTrT`Z1z2qcciz?cEyQ3(cNa zkdW_n_3%*D8`$rD?P}Pr>C1K!G7yb?UKI0!JXZBnWWA~6*9G1+?+lmiAO=@Fxy>k`nUnL@n(+x6s@cB~4uq+~+S}o5m-EGS^dwLS%n0F=pt4`lonG2sTYf3U|Uf54D*z1Ji@&&O37W zdH;k{{$VsH-d?^Dz%R@SmyGy_?c@P3B4Y`QONubkXU~X(^?C3w_pp1+G_UHNBZY&# zfH&ai3y+hZ9}iHh4@a%R@(DwQkBTY03V#AKa-C=8Of8ujvrYEeW(81(#Y#RmkU}TT z#75DbB`?{e#(dV_L=rA1w3+@dBV_g;DVOrLA971WSssM{?wC5jWGB+94z(C HL&BIpKw}ht From 4aebce53cf5829fe0b8bd72648e175dae046e79a Mon Sep 17 00:00:00 2001 From: Adrian Date: Mon, 18 May 2020 14:35:51 -0400 Subject: [PATCH 035/162] Added some comments in baseCilVisitory.py --- src/cil/baseCilVisitor.py | 30 +++++++++++++++++++++++++----- src/cil/nodes.py | 2 -- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 460d15fa..9e351647 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -123,6 +123,12 @@ def build_lca_table(self): else: rmq_table[i][j] = j + # TODO: Sera mejor representar en CIL la tabla rmq, el tour y los representativos e implementar una rutina + # para procesar una query, de modo que no halla que construir la tabla LCA en O(n^2), se puedan hacer + # las querys en O(1) y poder hacer el preprocesamiento en O(n)?? + # Tener en cuenta que esto implica mas estructura en el codigo del programa, o sea, mas espacio en memoria + # y es un poco mas complejo. + # Con la tabla construida, pasemos a hacer todas las preguntas for node1 in self._adytable.keys(): for node2 in self._adytable.keys(): @@ -135,6 +141,9 @@ def build_lca_table(self): class BaseCoolToCilVisitor: + """ + Clase base para el visitor que transforma un AST de COOL en un AST de CIL. + """ def __init__(self, context: Context): self.dot_types: List[nodes.TypeNode] = [] self.dot_data: List[Any] = [] @@ -149,20 +158,24 @@ def __init__(self, context: Context): @property def params(self) -> List[nodes.ParamNode]: + # Obtener los parametros de la funcion que esta actualmente en construccion assert self.current_function is not None return self.current_function.params @property def localvars(self) -> List[nodes.LocalNode]: + # Obtener las variables locales definidas en la funcion que esta actualmente en construccion assert self.current_function is not None return self.current_function.localvars @property def instructions(self) -> List[nodes.InstructionNode]: + # Obtiene las instrucciones de la funcion que esta actualmente en construccion assert self.current_function is not None return self.current_function.instructions def register_params(self, vinfo: VariableInfo) -> str: + # Registra un parametro en la funcion en construccion y devuelve el nombre procesado del parametro assert self.current_function is not None vinfo.name = f'param_{self.current_function.name[9:]}_{vinfo.name}_{len(self.params)}' param_node: nodes.ParamNode = nodes.ParamNode(vinfo.name) @@ -210,11 +223,11 @@ def do_label(self, label: str) -> str: def __build_CART(self) -> None: """ CART: Context Aware Runtime Table.\ - This structure stores data related to the Class Hierarchy defined in the program. This structure is meant to be stored \ - on the .DATA section and would be used by methods related to runtime type-checking. It is the first defined data in the \ - .DATA section. The structure is a table where for class i,j table[i,j] contains the LCA of class i and class j, i.e, \ - table[i,j] = C where i < C, j < C, and C is the lowest Class that satisfy this condition and the operator "<" stands \ - for 'conforms to'. + Esta estructura almacena datos relacionados con la jerarquia de clases definida en el programa. CART se debe almacenar \ + en la seccion .DATA y sera usada por metodos relacionados con chequeo de tipos en tiempo de ejecucion. La estructura es una \ + tabla LCA, o sea, una tabla donde dadas dos clases A y B, CART[A, B] = C donde C es otra clase y se cumple que \ + A < C, B < C, y C es la primera clase en la jerarquia que partiendo de A o de B, cumple esa condicion; el operador \ + '<' significa "se conforma en" o "es subclase de". """ # Crear el grafo de herencia basado en el contexto que tenemos hasta el momento. @@ -228,6 +241,13 @@ def __build_CART(self) -> None: self.lca_table = graph._lcatable # Procesar la tabla LCA para hacerla accesible en runtime + # Para crear la tabla solo tenemos que definir varias etiquetas que describan + # los tipos, y cada celda de la tabla contiene la direccion de estas etiquetas + data_nodes_dict: Dict[str, nodes.DataNode] = {} + for itype in self.context.types: + data_node = self.register_data(itype) + data_nodes_dict[itype] = data_node + def __build_builtins(self): pass diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 92ca52e4..8d0f7f33 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -207,5 +207,3 @@ def __init__(self, dest): class PrintNode(InstructionNode): def __init__(self, string_address): self.string_address = string_address - - From 01272bee5065aef84665b5262a5c369447e6c4c3 Mon Sep 17 00:00:00 2001 From: Adrian Date: Tue, 19 May 2020 00:35:43 -0400 Subject: [PATCH 036/162] Done some reformats. --- src/.builds | 1 + src/automatons/state.py | 80 +++++++++++++++++++------------------- src/cil/nodes.py | 11 +++++- src/grammar/grammar.py | 10 ++--- src/parserr/ll1.py | 30 ++++++++------ src/parserr/lr.py | 1 - src/parserr/shiftreduce.py | 4 +- src/travels/ctcill.py | 26 ++++++++----- 8 files changed, 91 insertions(+), 72 deletions(-) diff --git a/src/.builds b/src/.builds index a3bd9481..aae3d45d 100644 --- a/src/.builds +++ b/src/.builds @@ -123,3 +123,4 @@ 1 1 1 +1 diff --git a/src/automatons/state.py b/src/automatons/state.py index 887876aa..4a7d7715 100755 --- a/src/automatons/state.py +++ b/src/automatons/state.py @@ -12,7 +12,7 @@ def has_transition(self, symbol): def add_transition(self, symbol, state): try: self.transitions[symbol].append(state) - except: + except Exception: self.transitions[symbol] = [state] return self @@ -31,13 +31,13 @@ def to_deterministic(self): closure = self.epsilon_closure start = State(tuple(closure), any(s.final for s in closure)) - closures = [ closure ] - states = [ start ] - pending = [ start ] + closures = [closure] + states = [start] + pending = [start] while pending: state = pending.pop() - symbols = { symbol for s in state.state for symbol in s.transitions } + symbols = {symbol for s in state.state for symbol in s.transitions} for symbol in symbols: move = self.move_by_state(symbol, *state.state) @@ -64,9 +64,9 @@ def from_nfa(nfa, get_states=False): states.append(state) for origin, dest in nfa.transitions.items(): - for symbol,destinations in dest.items(): + for symbol, destinations in dest.items(): src = states[origin] - src[symbol] = [ states[d] for d in destinations ] + src[symbol] = [states[d] for d in destinations] if get_states: return states[nfa.start], states @@ -74,11 +74,11 @@ def from_nfa(nfa, get_states=False): @staticmethod def move_by_state(symbol, *states): - return { s for state in states if state.has_transition(symbol) for s in state[symbol]} + return {s for state in states if state.has_transition(symbol) for s in state[symbol]} @staticmethod def epsilon_closure_by_state(*states): - closure = { state for state in states } + closure = {state for state in states} l = 0 while l != len(closure): @@ -86,7 +86,7 @@ def epsilon_closure_by_state(*states): tmp = [s for s in closure] for s in tmp: for epsilon_state in s.epsilon_transitions: - closure.add(epsilon_state) + closure.add(epsilon_state) return closure @property @@ -122,35 +122,35 @@ def __hash__(self): return hash(frozenset(self.state)) if not isinstance(self.state, int) else\ hash(self.state) - def graph(self): - import pydot - G = pydot.Dot(rankdir='LR', margin=0.1) - G.add_node(pydot.Node('start', shape='plaintext', label='', width=0, height=0)) - - visited = set() - def visit(start): - ids = id(start) - if ids not in visited: - visited.add(ids) - G.add_node(pydot.Node(ids, label=start.name, shape='circle', style='bold' if start.final else '')) - for tran, destinations in start.transitions.items(): - for end in destinations: - visit(end) - G.add_edge(pydot.Edge(ids, id(end), label=tran, labeldistance=2)) - for end in start.epsilon_transitions: - visit(end) - G.add_edge(pydot.Edge(ids, id(end), label='ε', labeldistance=2)) - - visit(self) - G.add_edge(pydot.Edge('start', id(self), label='', style='dashed')) - - return G - - def _repr_svg_(self): - try: - return self.graph().create_svg().decode('utf8') - except: - pass + # def graph(self): + # import pydot + # G = pydot.Dot(rankdir='LR', margin=0.1) + # G.add_node(pydot.Node('start', shape='plaintext', label='', width=0, height=0)) + + # visited = set() + # def visit(start): + # ids = id(start) + # if ids not in visited: + # visited.add(ids) + # G.add_node(pydot.Node(ids, label=start.name, shape='circle', style='bold' if start.final else '')) + # for tran, destinations in start.transitions.items(): + # for end in destinations: + # visit(end) + # G.add_edge(pydot.Edge(ids, id(end), label=tran, labeldistance=2)) + # for end in start.epsilon_transitions: + # visit(end) + # G.add_edge(pydot.Edge(ids, id(end), label='ε', labeldistance=2)) + + # visit(self) + # G.add_edge(pydot.Edge('start', id(self), label='', style='dashed')) + + # return G + + # def _repr_svg_(self): + # try: + # return self.graph().create_svg().decode('utf8') + # except: + # pass def __iter__(self): yield from self._visit() @@ -168,4 +168,4 @@ def _visit(self, visited=None): for node in destinations: yield from node._visit(visited) for node in self.epsilon_transitions: - yield from node._visit(visited) \ No newline at end of file + yield from node._visit(visited) diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 8d0f7f33..7cd53481 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -200,10 +200,17 @@ def __init__(self, dest, ivalue): class ReadNode(InstructionNode): - def __init__(self, dest): + def __init__(self, dest: str): self.dest = dest class PrintNode(InstructionNode): - def __init__(self, string_address): + def __init__(self, string_address: str): self.string_address = string_address + + +class LCANode(InstructionNode): + def __init__(self, itypeA: str, variable: str, dest: str): + self.itypeA = itypeA + self.variable = variable + self.dest = dest diff --git a/src/grammar/grammar.py b/src/grammar/grammar.py index 119c2140..1ef5888e 100755 --- a/src/grammar/grammar.py +++ b/src/grammar/grammar.py @@ -1,5 +1,4 @@ -from grammar.symbols import (NonTerminal, Terminal, Sentence, - Epsilon, EOF, AttributeProduction) +from grammar.symbols import NonTerminal, Terminal, Sentence, Epsilon, EOF, AttributeProduction import json @@ -48,8 +47,7 @@ def Add_Production(self, production): if len(self.Productions) == 0: self.pType = type(production) - assert type( - production) == self.pType, "The Productions most be of only 1 type." + assert type(production) == self.pType, "The Productions most be of only 1 type." production.Left.productions.append(production) self.Productions.append(production) @@ -108,8 +106,8 @@ def to_json(self): productions.append({'Head': head, 'Body': body}) - d = {'NonTerminals': [symb.Name for symb in self.nonTerminals if symb != self.startSymbol], 'Terminals': - [symb.Name for symb in self.terminals], + d = {'NonTerminals': [symb.Name for symb in self.nonTerminals if symb != self.startSymbol], + 'Terminals': [symb.Name for symb in self.terminals], 'Productions': productions} d['StartSymbol'] = self.startSymbol.Name diff --git a/src/parserr/ll1.py b/src/parserr/ll1.py index fd80549b..9519b97c 100755 --- a/src/parserr/ll1.py +++ b/src/parserr/ll1.py @@ -1,32 +1,38 @@ +from typing import Dict, Tuple from tools.firsts import compute_firsts from tools.follows import compute_follows -from grammar.grammar import Grammar +from grammar.grammar import Grammar, NonTerminal, Terminal +from grammar.symbols import Sentence -def build_ll1_parsing_table(G:Grammar, firsts: dict, follows: dict): - table = {} +TableEntry = Tuple[NonTerminal, Terminal] + + +def build_ll1_parsing_table(G: Grammar, firsts: Dict, follows: Dict): + table: Dict[TableEntry, Sentence] = {} for production in G.Productions: - x,alpha = production.Left, production.Right + x, alpha = production.Left, production.Right for t in firsts[alpha]: - #si la tabla contiene entradas repetidas entonces la gramatica - #no es LL(1) - assert not table.get((x,t),None), "La gramatica no es LL(1)" - table[(x,t)] = production + # si la tabla contiene entradas repetidas entonces la gramatica + # no es LL(1) + assert not table.get((x, t), None), "La gramatica no es LL(1)" + table[(x, t)] = production if firsts[alpha].contains_epsilon: for t in follows[x]: - assert not table.get((x,t),None), "La gramatica no es LL(1)" - table[(x,t)] = production + assert not table.get((x, t), None), "La gramatica no es LL(1)" + table[(x, t)] = production return table + def build_ll1_parser(G: Grammar): firsts = compute_firsts(G) follows = compute_follows(G, firsts) table = build_ll1_parsing_table(G, firsts, follows) def parser(w: list): - #Asumimos que w termina en $ + # Asumimos que w termina en $ stack = [G.startSymbol] cursor = 0 output = [] @@ -38,7 +44,7 @@ def parser(w: list): cursor += 1 else: try: - production = table[(sym,w[cursor].token_type)] + production = table[(sym, w[cursor].token_type)] output.append(production) try: for symbol in production.Right[::-1]: diff --git a/src/parserr/lr.py b/src/parserr/lr.py index 30c6e4e1..38b51930 100755 --- a/src/parserr/lr.py +++ b/src/parserr/lr.py @@ -3,7 +3,6 @@ from automatons.state import State from parserr.shiftreduce import ShiftReduceParser from tools.firsts import compute_firsts, compute_local_first -from progressbar.progressbar import ProgressBar def expand(item, firsts): diff --git a/src/parserr/shiftreduce.py b/src/parserr/shiftreduce.py index 8c5b83da..0453937f 100755 --- a/src/parserr/shiftreduce.py +++ b/src/parserr/shiftreduce.py @@ -74,14 +74,14 @@ def dumps_parser_state(self, file): para cargarlo posteriormente con load. ''' try: - import cloudpickle + import cloudpickle # type: ignore except ImportError: return False try: cloudpickle.dump(self, file) return True - except Exception as e: + except Exception: return False @staticmethod diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index bf9c90b7..4962c9a4 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -188,26 +188,34 @@ def visit(self, node: coolAst.WhileBlockNode, scope: Scope): # noqa: F811 self.register_instruction(cil.LabelNode(while_label)) cond_vm_holder = self.visit(node.cond, scope) - # Compare condition, if true then execute, else jump to end + # Probar la condicion, si es true continuar la ejecucion, sino saltar al LABEL end self.register_instruction(cil.IfZeroJump(cond_vm_holder, end_label)) - # Register the instructions of the body + # Registrar las instrucciones del cuerpo del while self.visit(node.statements, scope) - # Do am unconditional jump to condition check + # Realizar un salto incondicional al chequeo de la condicion self.register_instruction(cil.UnconditionalJump(while_label)) - # Register the end label + # Registrar el LABEL final self.register_instruction(cil.LabelNode(end_label)) @visitor.when(coolAst.CaseNode) # type: ignore def visit(self, node: coolAst.CaseNode, scope: Scope): # noqa: F811 - # First need to evaluate expr0 + # Evalauar la expr0 expr_vm_holder = self.visit(node.expression, scope) - # Store the type of the returned value + # Almacenar el tipo del valor retornado type_internal_local_holder = self.define_internal_local() self.register_instruction(cil.TypeOfNode(expr_vm_holder, type_internal_local_holder)) - # Iterate over every action - for action_node in node.actions: - pass + # Iterar por cada accion que se toma en la expresion case + # para generar el codigo de cada action, ademas se agrega + # en cada accion un chequeo en runtime que indica si el branch + # que analizamos es el LCA entre el tipo que se deduce de la expresion + # calculada y el tipo actual que se chequea en la rama + branch_type = self.define_internal_local() + for i, action_node in enumerate(node.actions): + next_i_label = self.do_label(f'NEXT{i}') + self.register_instruction(cil.LabelNode(next_i_label)) + self.register_instruction(cil.LCANode(action_node.itype.name, type_internal_local_holder, branch_type)) + # Comparar el LCA con From 3e7773e2b3b83bb617d19a542289cfd411ebbf41 Mon Sep 17 00:00:00 2001 From: Adrian Date: Tue, 19 May 2020 02:54:27 -0400 Subject: [PATCH 037/162] Changed LCA table for TDT for runtime-type-checking. --- src/cil/baseCilVisitor.py | 159 +++++++++++++------------------------- src/testing.py | 2 +- src/travels/ctcill.py | 19 +++-- 3 files changed, 64 insertions(+), 116 deletions(-) diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 9e351647..68d407a6 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -2,7 +2,7 @@ import cil.nodes as nodes from abstract.semantics import VariableInfo, Context, Type, Method -LCA_TABLE = Dict[Tuple[str, str], str] +TDT = Dict[Tuple[str, str], int] # Esta clase no debe ser utilizada directamente en el desarrollo del compilador. @@ -17,7 +17,12 @@ def __init__(self): self._adytable: Dict[str, List[str]] = {} # Tabla LCA - self._lcatable: LCA_TABLE = {} + self.tdt: TDT = {} + + self._discover: Dict[str, int] = {} + self._finalization: Dict[str, int] = {} + self.__time = 0 + self.root_distance: Dict[str, int] = {} def add_edge(self, parent: str, child: str) -> None: # Agregar una arista a la lista de adyacencia. @@ -32,112 +37,57 @@ def add_edge(self, parent: str, child: str) -> None: except KeyError: self._adytable[child] = [parent] - def __do_euler_trip(self, root: str, visited: Dict[str, bool], tour: List[str]): - # Este metodo realiza el tour de euler en el grafo representado esta instancia. - - # Marcar el nodo desde el que partimos como visitado. + def __ancestor(self, node_x: str, node_y: str) -> bool: + # Devuelve true si x es ancestro de y. + # Para realizar este calculo nos basamos en el arbol + # construido por el DFS, y tenemos en cuenta los tiempo + # de descubrimiento y finalizacion + return self._discover[node_x] < self._discover[node_y] < self._finalization[node_y] < self._finalization[node_x] + + def __distance_from(self, node_x: str, node_y: str) -> int: + # Si x es ancestro de y, entonces la distancia entre ellos + # se calcula como d[y] - d[x], si x no es ancenstro de y, + # entonces podemos definir la distancia entre ellos como infinito + if self.__ancestor(node_x, node_y): + return self.root_distance[node_y] - self.root_distance[node_x] + else: + return -1 + + def __dfs(self, root: str, visited: Dict[str, bool], deep=0): visited[root] = True - - # Agregar el nodo al tour cuando lo vemos por primera vez. - tour.append(root) + self._discover[root] = self.__time + self.root_distance[root] = deep + self.__time += 1 for v in self._adytable[root]: - # Realizar el tour por todos los subarboles que no hayamos visitado. if not visited[v]: - self.__do_euler_trip(v, visited, tour) - # Volver a agregar el nodo del que partimos cuando regresamos a el. - tour.append(root) - - def __compute_nodes_levels(self, root: str, visited: Dict[str, bool], levels: List[int], lvl: int = 0): - # Es la misma idea que el tour de euler, visitar los nodos en DFS y agregar para cada nodo - # su distancia desde la raiz - - # marcar el nodo raiz de este subarbol como visitado - visited[root] = True - - # agregar el nivel de este nodo a la lista de niveles - levels.append(lvl) - - # Visitar los nodos adyacentes en DFS - for v in self._adytable[root]: - # Realizar el recorrido por los subarboles que no hayamos visitado - if not visited[v]: - self.__compute_nodes_levels(v, visited, levels, lvl + 1) - # Volver a agregar el nivel del nodo cuando regresamos a el. - levels.append(lvl) - - def __compute_representative_array(self, tour: List[str]) -> Dict[str, int]: - # El representativo de cada nodo es la primera ocurrencia j del nodo tour[j] - visited: Dict[str, bool] = {node: False for node in self._adytable.keys()} - representative: Dict[str, int] = {} - for i, node in enumerate(tour): - if not visited[node]: - representative[node] = i - visited[node] = True - return representative - - def build_lca_table(self): - # Realizar el preprocesamiento necesario para crear la Tabla LCA. - # Este preprocesamiento coincide con una DP para preprocesar un array para RMQ. - # La implementacion del preprocesamiento es O(n^2). Existen algoritmos para preprocesar en - # O(n) y responder las querys en O(1), pero dado que vamos a preguntar las n(n-1)/2 querys - # para almacenarlas en la tabla, hacer el preprocesamiento en O(n^2) no afecta el orden del - # tiempo total de construccion. No obstante la DP es necesaria para no realizar el preprocesamiento - # en O(n^3). - - # Verificar que se halla construido el grafo - assert self._adytable - visited: Dict[str, bool] = {node: False for node in self._adytable.keys()} - - # Crear el tour de euler - tour: List[str] = [] - # La raiz de la jerarquia es Object + self.__dfs(v, visited, deep + 1) + self.__time += 1 + self._finalization[root] = self.__time + + def build_tdt(self): + # Construir una tabla de distancia para cada Nodo del arbol. + # En dicha tabla, tdt[x, y] = d donde d es la distancia entre + # el nodo x y el nodo y, si x es ancestro de y, entonces d >= 1, + # si x == y, d = 0 y d = -1 en otro caso + visited = {node: False for node in self._adytable} + + # Realizar un recorrido dfs para inicializar los array d y f root = 'Object' - self.__do_euler_trip(root, visited, tour) - - # crear el array de niveles - levels: List[int] = [] - for node in visited.keys(): - visited[node] = False - self.__compute_nodes_levels(root, visited, levels) - - # crear el array de nodos representativos - representative = self.__compute_representative_array(tour) - nodes = len(levels) - - # Preprocesar la tabla para responder las rmq-querys. - # rmq_table[i][j] contiene el indice del menor elemento en el intervalo[i, j] - rmq_table: List[List[int]] = [[0 for _ in range(nodes)] for _ in range(nodes)] - - # Sabemos que rmq[i,i] = i. Entonces podemos inicializar la tabla - for i in range(nodes): - rmq_table[i][i] = i - - # Para calcular la tabla solo tenemos que aplicar la DP: - # rmq[i, j] = min(A[rmq[i, j-1]], A[j]) donde A es nuestro array - for i in range(nodes): # Iterar de menor a mayor longitud del intervalo - for j in range(i + 1, nodes): - m1 = rmq_table[i][j-1] - if levels[m1] < levels[j]: - rmq_table[i][j] = m1 + self.__dfs(root, visited) + + print(self._discover) + print("\t\t**********\n\n") + print(self._finalization) + print("\t\t**********\n\n") + + # Construir la tabla + for nodex in self._adytable: + for nodey in self._adytable: + if nodey == nodex: + self.tdt[(nodex, nodey)] = 0 else: - rmq_table[i][j] = j - - # TODO: Sera mejor representar en CIL la tabla rmq, el tour y los representativos e implementar una rutina - # para procesar una query, de modo que no halla que construir la tabla LCA en O(n^2), se puedan hacer - # las querys en O(1) y poder hacer el preprocesamiento en O(n)?? - # Tener en cuenta que esto implica mas estructura en el codigo del programa, o sea, mas espacio en memoria - # y es un poco mas complejo. - - # Con la tabla construida, pasemos a hacer todas las preguntas - for node1 in self._adytable.keys(): - for node2 in self._adytable.keys(): - # El LCA lo podemos calcular como LCA(x,y) = E[RMQ(r[x], r[y])] donde E es el tour de euler - # y r es el array representativo. - m1 = min(representative[node1], representative[node2]) - m2 = max(representative[node1], representative[node2]) - self._lcatable[node1, node2] = tour[rmq_table[m1][m2]] - self._lcatable[node2, node1] = tour[rmq_table[m1][m2]] + self.tdt[(nodex, nodey)] = self.__distance_from(nodex, nodey) class BaseCoolToCilVisitor: @@ -237,8 +187,8 @@ def __build_CART(self) -> None: graph.add_edge(self.context.types[itype].parent.name, itype) # type: ignore # Crear la tabla LCA - graph.build_lca_table() - self.lca_table = graph._lcatable + graph.build_tdt() + self.tdt_table = graph.tdt # Procesar la tabla LCA para hacerla accesible en runtime # Para crear la tabla solo tenemos que definir varias etiquetas que describan @@ -248,6 +198,5 @@ def __build_CART(self) -> None: data_node = self.register_data(itype) data_nodes_dict[itype] = data_node - def __build_builtins(self): pass diff --git a/src/testing.py b/src/testing.py index 134e7b74..9ff34e70 100755 --- a/src/testing.py +++ b/src/testing.py @@ -18,4 +18,4 @@ d_type.set_parent(object_type) v = BaseCoolToCilVisitor(context) - print(v.lca_table) + print(v.tdt_table) diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 4962c9a4..fe346c1a 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -165,24 +165,23 @@ def visit(self, node: coolAst.BlockNode, scope: Scope) -> str: # noqa: F811 @visitor.when(coolAst.AssignNode) # type:ignore def visit(self, node: coolAst.AssignNode, scope: Scope): # noqa: F811 - # Assignments looks like: + # La asignacion tiene la siguiente forma: # id <- expr - # So here we assume that a local variable named "id" - # has already been defined + # Aqui asumimos que una variable interna llamada id + # ya ha sido definida - # TODO: need to diferentiate between attributes and method vars? + # TODO: Es necesario diferenciar entre variable y atributo ? - # Generate the code for the rvalue (expr) + # Generar el codigo para el rvalue (expr) rvalue_vm_holder = self.visit(self, node.expr) - # register the assignment instruction + # registrar la instruccion de asignacion self.register_instruction(cil.AssignNode(node.idx, rvalue_vm_holder)) @visitor.when(coolAst.WhileBlockNode) # type: ignore def visit(self, node: coolAst.WhileBlockNode, scope: Scope): # noqa: F811 - - # First evaluate the condition and set a label - # to return to + # Evaluar la condicion y definir un LABEL al cual + # retornar while_label = self.do_label('WHILE') end_label = self.do_label('WHILE_END') self.register_instruction(cil.LabelNode(while_label)) @@ -218,4 +217,4 @@ def visit(self, node: coolAst.CaseNode, scope: Scope): # noqa: F811 next_i_label = self.do_label(f'NEXT{i}') self.register_instruction(cil.LabelNode(next_i_label)) self.register_instruction(cil.LCANode(action_node.itype.name, type_internal_local_holder, branch_type)) - # Comparar el LCA con + # Comparar el LCA con From 581154fd3f2d91999451949e1ab072d4d78c8529 Mon Sep 17 00:00:00 2001 From: Adrian Date: Tue, 19 May 2020 03:03:00 -0400 Subject: [PATCH 038/162] Added some comments to baseCilVisitor.py --- src/cil/baseCilVisitor.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 68d407a6..39e6ab48 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -76,11 +76,6 @@ def build_tdt(self): root = 'Object' self.__dfs(root, visited) - print(self._discover) - print("\t\t**********\n\n") - print(self._finalization) - print("\t\t**********\n\n") - # Construir la tabla for nodex in self._adytable: for nodey in self._adytable: @@ -175,9 +170,8 @@ def __build_CART(self) -> None: CART: Context Aware Runtime Table.\ Esta estructura almacena datos relacionados con la jerarquia de clases definida en el programa. CART se debe almacenar \ en la seccion .DATA y sera usada por metodos relacionados con chequeo de tipos en tiempo de ejecucion. La estructura es una \ - tabla LCA, o sea, una tabla donde dadas dos clases A y B, CART[A, B] = C donde C es otra clase y se cumple que \ - A < C, B < C, y C es la primera clase en la jerarquia que partiendo de A o de B, cumple esa condicion; el operador \ - '<' significa "se conforma en" o "es subclase de". + TDT (type distance table), donde dadas dos clases A y B, CART[A, B] = d donde d es la distancia entre la clase A y \ + la clase B, si la clase A es ancestro de la clase B en la jerarquia de tipos, 0 si A = B y -1 en otro caso. """ # Crear el grafo de herencia basado en el contexto que tenemos hasta el momento. @@ -186,13 +180,17 @@ def __build_CART(self) -> None: if self.context.types[itype].parent is not None: graph.add_edge(self.context.types[itype].parent.name, itype) # type: ignore - # Crear la tabla LCA + # Crear la TDT graph.build_tdt() self.tdt_table = graph.tdt - # Procesar la tabla LCA para hacerla accesible en runtime - # Para crear la tabla solo tenemos que definir varias etiquetas que describan - # los tipos, y cada celda de la tabla contiene la direccion de estas etiquetas + # Procesar la TDT para hacerla accesible en runtime. + # La tabla nos es mas que una matriz de NxN (N es la cantidad de tipos definidos en el programa) + # donde cada subindice indica el indice del Tipo en la seccion .Types: + # m[i, j] = d significa que la distancia entre el tipo en el indice i de la seccion .Types y el tipo + # en el indice j es d. + # Tener en cuenta que los tipos son definidos en la seccion .TYPES en el orden en que son definidos en + # el programa, y recolectados por el TypeBuilder. data_nodes_dict: Dict[str, nodes.DataNode] = {} for itype in self.context.types: data_node = self.register_data(itype) From bad9519a87b18f57e3812824d133a45639a77a1c Mon Sep 17 00:00:00 2001 From: Adrian Date: Wed, 20 May 2020 04:05:03 -0400 Subject: [PATCH 039/162] First attempt to implement a Case Node in CIL. --- src/cil/baseCilVisitor.py | 11 ++++--- src/cil/nodes.py | 33 ++++++++++++-------- src/travels/ctcill.py | 64 +++++++++++++++++++++++++++++++++------ 3 files changed, 82 insertions(+), 26 deletions(-) diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 39e6ab48..743428d8 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -191,10 +191,13 @@ def __build_CART(self) -> None: # en el indice j es d. # Tener en cuenta que los tipos son definidos en la seccion .TYPES en el orden en que son definidos en # el programa, y recolectados por el TypeBuilder. - data_nodes_dict: Dict[str, nodes.DataNode] = {} - for itype in self.context.types: - data_node = self.register_data(itype) - data_nodes_dict[itype] = data_node + table = [[-1 for _ in self.context.types] for _ in self.context.types] + self.types_indexes: Dict[str, int] = {} + for i, itype in enumerate(self.context.types): + self.types_indexes[itype] = i + for j, atype in enumerate(self.context.types): + table[i][j] = self.tdt_table[itype, atype] + self.tdt_data_node = self.register_data(table) def __build_builtins(self): pass diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 7cd53481..906c1bba 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -69,7 +69,10 @@ class PlusNode(ArithmeticNode): class MinusNode(ArithmeticNode): - pass + def __init__(self, x: str, y: str, dest: str): + self.x = x + self.y = y + self.dest = dest class StarNode(ArithmeticNode): @@ -123,6 +126,12 @@ def __init__(self, label: str): self.label: str = label +class JumpIfGreaterThanZeroNode(InstructionNode): + def __init__(self, variable: str, label: str): + self.label = label + self.variable = variable + + class IfZeroJump(InstructionNode): def __init__(self, variable: str, label: str): self.variable = variable @@ -140,14 +149,6 @@ def __init__(self, label: str): self.label: str = label -class GotoNode(InstructionNode): - pass - - -class GotoIfNode(InstructionNode): - pass - - class StaticCallNode(InstructionNode): def __init__(self, function: str, dest: str): self.function = function @@ -209,8 +210,14 @@ def __init__(self, string_address: str): self.string_address = string_address -class LCANode(InstructionNode): - def __init__(self, itypeA: str, variable: str, dest: str): - self.itypeA = itypeA - self.variable = variable +class TdtLookupNode(InstructionNode): + def __init__(self, index_varA: str, index_varB: str, dest: str): + self.i = index_varA + self.j = index_varB + self.dest = dest + + +class GetTypeIndex(InstructionNode): + def __init__(self, itype: str, dest: str): + self.itype = itype self.dest = dest diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index fe346c1a..466afad1 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -207,14 +207,60 @@ def visit(self, node: coolAst.CaseNode, scope: Scope): # noqa: F811 type_internal_local_holder = self.define_internal_local() self.register_instruction(cil.TypeOfNode(expr_vm_holder, type_internal_local_holder)) - # Iterar por cada accion que se toma en la expresion case - # para generar el codigo de cada action, ademas se agrega - # en cada accion un chequeo en runtime que indica si el branch - # que analizamos es el LCA entre el tipo que se deduce de la expresion - # calculada y el tipo actual que se chequea en la rama + branch_type_index = self.define_internal_local() + expr_type_index = self.define_internal_local() branch_type = self.define_internal_local() + min_ = self.define_internal_local() + tdt_result = self.define_internal_local() + min_check_local = self.define_internal_local() + + self.register_instruction(cil.AssignNode(min_, len(self.context.types))) + self.register_instruction(cil.GetTypeIndex(type_internal_local_holder, expr_type_index)) + + for i, action_node in enumerate(node.actions): + self.register_instruction(cil.AssignNode(branch_type, action_node.itype.name)) + # Obtener el indice del tipo en el contexto + self.register_instruction(cil.GetTypeIndex(branch_type, branch_type_index)) + # Calcular la distancia hacia el tipo, y actualizar el minimo de ser necesario + self.register_instruction(cil.TdtLookupNode(branch_type_index, expr_type_index, tdt_result)) + + self.register_instruction(cil.MinusNode(min_, tdt_result, min_check_local)) + not_min_label = self.do_label('Not_min{i}') + self.register_instruction(cil.JumpIfGreaterThanZeroNode(min_check_local, not_min_label)) + self.register_instruction(cil.AssignNode(min_, tdt_result)) + self.register_instruction(cil.LabelNode(not_min_label)) + + # Ya tenemos la menor distancia entre el tipo calculado en la expr0, y todos los tipos definidos + # en los branches del case. + # Comprobar que tengamos una coincidencia + self.register_instruction(cil.AssignNode(tdt_result, len(self.context.types))) + self.register_instruction(cil.MinusNode(tdt_result, min_, type_internal_local_holder)) + error_label = self.do_label("ERROR") + self.register_instruction(cil.IfZeroJump(type_internal_local_holder, error_label)) + + end_label = self.do_label('END') + + # Procesar cada accion y ejecutar el tipo cuya distancia sea igual a min_ for i, action_node in enumerate(node.actions): - next_i_label = self.do_label(f'NEXT{i}') - self.register_instruction(cil.LabelNode(next_i_label)) - self.register_instruction(cil.LCANode(action_node.itype.name, type_internal_local_holder, branch_type)) - # Comparar el LCA con + next_label = self.do_label(f'NEXT{i}') + self.register_instruction(cil.AssignNode(branch_type, action_node.itype.name)) + self.register_instruction(cil.GetTypeIndex(branch_type, branch_type_index)) + self.register_instruction(cil.TdtLookupNode(branch_type_index, expr_type_index, tdt_result)) + self.register_instruction(cil.MinusNode(min_, tdt_result, min_check_local)) + self.register_instruction(cil.NotZeroJump(min_check_local, next_label)) + # Implemententacion del branch. + # Registrar la variable + var_info = scope.find_variable(action_node.idx) + idk = self.register_local(var_info) + # Asignar al identificador idk el valor de expr0 + self.register_instruction(cil.AssignNode(idk, expr_vm_holder)) + # Generar el codigo de la expresion asociada a esta rama + self.visit(action_node.actions) + # Generar un salto de modo que no se chequee otra rama + self.register_instruction(cil.UnconditionalJump(end_label)) + self.register_instruction(cil.LabelNode(next_label)) + + self.register_instruction(cil.LabelNode(error_label)) + # TODO: Define some form of runtime errors + + self.register_instruction(cil.LabelNode(end_label)) From 11aa0a6f9a90521da6af4e5a8165f0694bd67c06 Mon Sep 17 00:00:00 2001 From: Adrian Date: Wed, 20 May 2020 17:51:02 -0400 Subject: [PATCH 040/162] Implemented DifNode and PlusNode in CIL. --- cool-comp.sublime-project | 17 - cool-comp.sublime-workspace | 2510 ----------------------------------- src/cil/baseCilVisitor.py | 2 +- src/travels/ctcill.py | 40 + 4 files changed, 41 insertions(+), 2528 deletions(-) delete mode 100644 cool-comp.sublime-project delete mode 100644 cool-comp.sublime-workspace diff --git a/cool-comp.sublime-project b/cool-comp.sublime-project deleted file mode 100644 index 78978f58..00000000 --- a/cool-comp.sublime-project +++ /dev/null @@ -1,17 +0,0 @@ -{ - "build_systems": - [ - { - "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", - "name": "Anaconda Python Builder", - "selector": "source.python", - "shell_cmd": "\"python3\" -u \"$file\"" - } - ], - "folders": - [ - { - "path": "." - } - ] -} diff --git a/cool-comp.sublime-workspace b/cool-comp.sublime-workspace deleted file mode 100644 index 5ad31e5d..00000000 --- a/cool-comp.sublime-workspace +++ /dev/null @@ -1,2510 +0,0 @@ -{ - "auto_complete": - { - "selected_items": - [ - [ - "a", - "append\tfunction" - ], - [ - "com", - "compiler_struct\tmodule" - ], - [ - "Pip", - "PIP" - ], - [ - "prase", - "parse_args\tfunction" - ], - [ - "Arguem", - "ArgumentParser\tclass" - ], - [ - "if", - "ifmain\tif __name__ == '__main__'" - ], - [ - "ter", - "term_width\tparam" - ], - [ - "E5", - "E501" - ], - [ - "PY", - "PYTHON" - ], - [ - "W", - "WKGENERATOR" - ], - [ - "py", - "pyinstaller" - ], - [ - "whi", - "which" - ], - [ - "fi", - "finish_time" - ], - [ - "jo", - "jobLength" - ], - [ - "job", - "jobLength\tstatement" - ], - [ - "Sjc", - "SjcfJobAssumption\tclass" - ], - [ - "q", - "queueGatherStatistics\tfunction" - ], - [ - "Base", - "BaseScheduler\tclass" - ], - [ - "io", - "ioTimings\tstatement" - ], - [ - "tes", - "test_job\tstatement" - ], - [ - "spl", - "split_by_io\tfunction" - ], - [ - "asse", - "assertEqual\tfunction" - ], - [ - "sp", - "split_by_io\tfunction" - ], - [ - "as", - "assertEqual\tfunction" - ], - [ - "arr", - "arrival\tstatement" - ], - [ - "cl", - "__class__" - ], - [ - "clas", - "__class__\tclass" - ], - [ - "Log", - "LogRecord\tclass" - ], - [ - "Loge", - "Logger\tclass" - ], - [ - "for", - "format\tfunction" - ], - [ - "str", - "string\tmodule" - ], - [ - "progre", - "progressbar" - ], - [ - "req", - "require_relative\t (fname)" - ], - [ - "gsu", - "gsub\tfunc" - ], - [ - "uni", - "unit\tfunc" - ], - [ - "ker", - "kernel/fs.h\t/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19" - ], - [ - "pri", - "printf\tvoid printf(const char *, ...)" - ], - [ - "kernel", - "kernel/defs.h\t/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19" - ], - [ - "inc", - "inc\t#include \"…\"" - ], - [ - "fo", - "fork\tint fork()" - ], - [ - "kern", - "kernel/types.h\t/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19" - ], - [ - "std", - "stdlib.h\t/usr/include" - ], - [ - "strin", - "string.h\tstandard header (deprecated)" - ], - [ - "vec", - "vector\tstandard header" - ], - [ - "m", - "map\tstd::map" - ], - [ - "cstd", - "cstdio\tstandard header" - ], - [ - "ma", - "main\tmain()" - ] - ] - }, - "buffers": - [ - { - "file": "src/makefile", - "settings": - { - "buffer_size": 721, - "line_ending": "Unix" - } - }, - { - "file": "src/comments.py", - "settings": - { - "buffer_size": 30, - "encoding": "UTF-8", - "line_ending": "Unix" - } - }, - { - "file": "/home/adrian/.config/sublime-text-3/Packages/Anaconda/Anaconda.sublime-settings", - "settings": - { - "buffer_size": 21784, - "encoding": "UTF-8", - "line_ending": "Unix" - } - }, - { - "file": "src/coolgrammar/grammar.py", - "settings": - { - "buffer_size": 10948, - "encoding": "UTF-8", - "line_ending": "Unix" - } - }, - { - "file": "src/install.py", - "settings": - { - "buffer_size": 688, - "encoding": "UTF-8", - "line_ending": "Unix" - } - }, - { - "contents": "adrian@adrian-Inspiron-7548:~/Documents/Universida ​‌​\nd/4to/Compilacion/cool-comp2020/src$ ls \nabstract coolc.sh makefile travels \nautomatons coolgrammar parserr typecheck \nbaseNodeTree grammar Readme.md \nbuild install.py testing.py \ncomments.py lexer tools \nadrian@adrian-Inspiron-7548:~/Documents/Universida ​‌​\nd/4to/Compilacion/cool-comp2020/src$ ", - "settings": - { - "buffer_size": 963, - "line_ending": "Unix", - "name": "Login Shell", - "scratch": true - } - } - ], - "build_system": "Packages/User/make-src.sublime-build", - "build_system_choices": - [ - [ - [ - [ - "Anaconda Python Builder", - "" - ], - [ - "Packages/Makefile/Make.sublime-build", - "" - ], - [ - "Packages/Makefile/Make.sublime-build", - "Clean" - ], - [ - "Packages/Python/Python.sublime-build", - "" - ], - [ - "Packages/Python/Python.sublime-build", - "Syntax Check" - ] - ], - [ - "Packages/Makefile/Make.sublime-build", - "" - ] - ], - [ - [ - [ - "Anaconda Python Builder", - "" - ], - [ - "Packages/Makefile/Make.sublime-build", - "" - ], - [ - "Packages/Makefile/Make.sublime-build", - "Clean" - ], - [ - "Packages/Python/Python.sublime-build", - "" - ], - [ - "Packages/Python/Python.sublime-build", - "Syntax Check" - ], - [ - "Packages/User/Make(Linux).sublime-build", - "" - ], - [ - "Packages/User/Make(Linux).sublime-build", - "test" - ], - [ - "Packages/User/Make(Linux).sublime-build", - "clean" - ], - [ - "Packages/User/make_test.sublime-build", - "" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "all" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "clean" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "echo \"*** Error" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "genwk-fifo" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "genwk-io" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "genwk-mlfq" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "genwk-sjcf" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "genwk-sjf" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "test" - ] - ], - [ - "Packages/User/Make(Linux).sublime-build", - "test" - ] - ], - [ - [ - [ - "Anaconda Python Builder", - "" - ], - [ - "Packages/Makefile/Make.sublime-build", - "" - ], - [ - "Packages/Makefile/Make.sublime-build", - "Clean" - ], - [ - "Packages/Python/Python.sublime-build", - "" - ], - [ - "Packages/Python/Python.sublime-build", - "Syntax Check" - ], - [ - "Packages/User/make.sublime-build", - "" - ], - [ - "Packages/User/make.sublime-build", - "test" - ], - [ - "Packages/User/make.sublime-build", - "clean" - ] - ], - [ - "Packages/User/make.sublime-build", - "" - ] - ], - [ - [ - [ - "Anaconda Python Builder", - "" - ], - [ - "Packages/Makefile/Make.sublime-build", - "" - ], - [ - "Packages/Makefile/Make.sublime-build", - "Clean" - ], - [ - "Packages/Python/Python.sublime-build", - "" - ], - [ - "Packages/Python/Python.sublime-build", - "Syntax Check" - ], - [ - "Packages/User/make_test.sublime-build", - "" - ] - ], - [ - "Packages/User/make_test.sublime-build", - "" - ] - ], - [ - [ - [ - "Anaconda Python Builder", - "" - ], - [ - "Packages/Makefile/Make.sublime-build", - "" - ], - [ - "Packages/Makefile/Make.sublime-build", - "Clean" - ], - [ - "Packages/Python/Python.sublime-build", - "" - ], - [ - "Packages/Python/Python.sublime-build", - "Syntax Check" - ], - [ - "Packages/User/make_test.sublime-build", - "" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "all" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "clean" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "echo \"*** Error" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "genwk-fifo" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "genwk-io" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "genwk-mlfq" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "genwk-sjcf" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "genwk-sjf" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "test" - ] - ], - [ - "Packages/User/make_test.sublime-build", - "" - ] - ], - [ - [ - [ - "Anaconda Python Builder", - "" - ], - [ - "Packages/Python/Python.sublime-build", - "" - ], - [ - "Packages/Python/Python.sublime-build", - "Syntax Check" - ], - [ - "Packages/User/make-src.sublime-build", - "" - ], - [ - "Packages/User/make-src.sublime-build", - "test" - ], - [ - "Packages/User/make-src.sublime-build", - "clean" - ], - [ - "Packages/User/make.sublime-build", - "" - ], - [ - "Packages/User/make.sublime-build", - "test" - ], - [ - "Packages/User/make.sublime-build", - "clean" - ] - ], - [ - "Packages/User/make-src.sublime-build", - "clean" - ] - ], - [ - [ - [ - "Packages/Makefile/Make.sublime-build", - "" - ], - [ - "Packages/Makefile/Make.sublime-build", - "Clean" - ], - [ - "Packages/ShellScript/ShellScript.sublime-build", - "" - ] - ], - [ - "Packages/Makefile/Make.sublime-build", - "" - ] - ], - [ - [ - [ - "Packages/Makefile/Make.sublime-build", - "" - ], - [ - "Packages/Makefile/Make.sublime-build", - "Clean" - ], - [ - "Packages/ShellScript/ShellScript.sublime-build", - "" - ], - [ - "Packages/User/make-src.sublime-build", - "" - ], - [ - "Packages/User/make-src.sublime-build", - "test" - ], - [ - "Packages/User/make-src.sublime-build", - "clean" - ], - [ - "Packages/User/make.sublime-build", - "" - ], - [ - "Packages/User/make.sublime-build", - "test" - ], - [ - "Packages/User/make.sublime-build", - "clean" - ] - ], - [ - "Packages/User/make-src.sublime-build", - "" - ] - ], - [ - [ - [ - "Packages/Makefile/Make.sublime-build", - "" - ], - [ - "Packages/Makefile/Make.sublime-build", - "Clean" - ], - [ - "Packages/ShellScript/ShellScript.sublime-build", - "" - ], - [ - "Packages/User/make.sublime-build", - "" - ], - [ - "Packages/User/make.sublime-build", - "test" - ], - [ - "Packages/User/make.sublime-build", - "clean" - ] - ], - [ - "Packages/User/make.sublime-build", - "" - ] - ], - [ - [ - [ - "Packages/Makefile/Make.sublime-build", - "" - ], - [ - "Packages/Makefile/Make.sublime-build", - "Clean" - ], - [ - "Packages/User/Make(Linux).sublime-build", - "" - ], - [ - "Packages/User/Make(Linux).sublime-build", - "Clean" - ], - [ - "Packages/User/Make(Linux).sublime-build", - "Test" - ], - [ - "Packages/User/make_test.sublime-build", - "" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "all" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "clean" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "echo \"*** Error" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "genwk-fifo" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "genwk-io" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "genwk-mlfq" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "genwk-sjcf" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "genwk-sjf" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "test" - ] - ], - [ - "Packages/User/Make(Linux).sublime-build", - "Test" - ] - ], - [ - [ - [ - "Packages/Makefile/Make.sublime-build", - "" - ], - [ - "Packages/Makefile/Make.sublime-build", - "Clean" - ], - [ - "Packages/User/make-src.sublime-build", - "" - ], - [ - "Packages/User/make-src.sublime-build", - "test" - ], - [ - "Packages/User/make-src.sublime-build", - "clean" - ], - [ - "Packages/User/make.sublime-build", - "" - ], - [ - "Packages/User/make.sublime-build", - "test" - ], - [ - "Packages/User/make.sublime-build", - "clean" - ] - ], - [ - "Packages/User/make-src.sublime-build", - "" - ] - ], - [ - [ - [ - "Packages/Makefile/Make.sublime-build", - "" - ], - [ - "Packages/Makefile/Make.sublime-build", - "Clean" - ], - [ - "Packages/User/make.sublime-build", - "" - ], - [ - "Packages/User/make.sublime-build", - "test" - ], - [ - "Packages/User/make.sublime-build", - "clean" - ] - ], - [ - "Packages/User/make.sublime-build", - "" - ] - ], - [ - [ - [ - "Packages/Makefile/Make.sublime-build", - "" - ], - [ - "Packages/Makefile/Make.sublime-build", - "Clean" - ], - [ - "Packages/User/make_test.sublime-build", - "" - ] - ], - [ - "Packages/User/make_test.sublime-build", - "" - ] - ], - [ - [ - [ - "Packages/Makefile/Make.sublime-build", - "" - ], - [ - "Packages/Makefile/Make.sublime-build", - "Clean" - ], - [ - "Packages/User/make_test.sublime-build", - "" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "all" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "clean" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "echo \"*** Error" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "genwk-fifo" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "genwk-io" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "genwk-mlfq" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "genwk-sjcf" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "genwk-sjf" - ], - [ - "Packages/User/MakeTargets.sublime-build", - "test" - ] - ], - [ - "Packages/User/MakeTargets.sublime-build", - "test" - ] - ], - [ - [ - [ - "Packages/User/make_test.sublime-build", - "" - ] - ], - [ - "Packages/User/make_test.sublime-build", - "" - ] - ] - ], - "build_varint": "", - "command_palette": - { - "height": 0.0, - "last_filter": "", - "selected_items": - [ - [ - "Yapf", - "PyYapf: Format Document" - ], - [ - "Insta", - "Package Control: Install Package" - ], - [ - "terminus tu", - "Terminus Utilities: Select Theme" - ], - [ - "Toggle s", - "View: Toggle Side Bar" - ], - [ - "Terminus", - "Terminus: Toggle Panel" - ], - [ - "Preference Termin", - "Preferences: Terminus Command Palette" - ], - [ - "TerminusCol", - "Terminus: Close" - ], - [ - "termi", - "Terminal: Open" - ], - [ - "Ter", - "Terminal: Open" - ], - [ - "Install", - "Package Control: Install Package" - ], - [ - "git commit", - "Git: Commit" - ], - [ - "Git add", - "Git: Add All" - ], - [ - "Git co", - "Git: Commit" - ], - [ - "git add", - "Git: Add All" - ], - [ - "Git Bran", - "Git: New Branch" - ], - [ - "Git merge", - "Git: Merge Branch" - ], - [ - "Git stat", - "Git: Status" - ], - [ - "Git", - "Git: Commit" - ], - [ - "git", - "Git: Status" - ], - [ - "vie", - "View: Toggle Side Bar" - ], - [ - "Vie", - "View: Toggle Side Bar" - ], - [ - "Remov", - "Package Control: Remove Package" - ], - [ - "Make-", - "Build With: MakeTargets - all" - ], - [ - "Make", - "Build With: MakeTargets - test" - ], - [ - "make", - "Build With: Make - Clean" - ], - [ - "Remo", - "Package Control: Remove Package" - ], - [ - "MakeTar", - "Build With: MakeTargets - test" - ], - [ - "VIe", - "View: Toggle Side Bar" - ], - [ - "vier", - "View: Toggle Side Bar" - ], - [ - "UI", - "UI: Select Theme" - ], - [ - "Color", - "UI: Select Color Scheme" - ], - [ - "Sett", - "Preferences: Settings" - ], - [ - "LSP", - "LSP: Restart Servers" - ], - [ - "Enabl", - "LSP: Enable Language Server Globally" - ], - [ - "Pac", - "Package Control: Remove Package" - ], - [ - "LanguageSe", - "LSP: Enable Language Server Globally" - ], - [ - "view", - "View: Toggle Menu" - ], - [ - "View", - "View: Toggle Menu" - ], - [ - "ui", - "UI: Select Color Scheme" - ], - [ - "Col", - "UI: Select Color Scheme" - ], - [ - "insta", - "Package Control: Install Package" - ], - [ - "Remove", - "Package Control: Remove Package" - ], - [ - "Packa", - "Package Control: Remove Package" - ], - [ - "ins", - "Package Control: Install Package" - ], - [ - "color", - "UI: Select Color Scheme" - ], - [ - "colo", - "UI: Select Color Scheme" - ], - [ - "Colo", - "UI: Select Color Scheme" - ], - [ - "Settig", - "Preferences: Settings" - ], - [ - "Anaconda: Pytho", - "Anaconda: Set Python interpreter" - ], - [ - "Prefer", - "Preferences: Settings" - ], - [ - "Settings", - "Preferences: Settings" - ], - [ - "Vi", - "View: Toggle Menu" - ], - [ - "Ana", - "Anaconda: Autoformat PEP8 Errors" - ], - [ - "COlo", - "UI: Select Color Scheme" - ], - [ - "Theme", - "UI: Select Color Scheme" - ], - [ - "Color T", - "UI: Select Color Scheme" - ], - [ - "Them", - "UI: Select Theme" - ], - [ - "install", - "Package Control: Install Package" - ] - ], - "width": 0.0 - }, - "console": - { - "height": 193.0, - "history": - [ - "make -j1 test", - "print(HellO)", - "class A:", - "a(range(5))", - "a = [].__class__", - "[].__class__", - "sum(range(10,40,10))", - "ls", - "print(\"Hello\")", - "print(Hello)", - "print Hello" - ] - }, - "distraction_free": - { - "menu_visible": true, - "show_minimap": false, - "show_open_files": false, - "show_tabs": false, - "side_bar_visible": false, - "status_bar_visible": false - }, - "expanded_folders": - [ - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src" - ], - "file_history": - [ - "/home/adrian/.config/sublime-text-3/Packages/Anaconda/Anaconda.sublime-settings", - "/home/adrian/.config/sublime-text-3/Packages/User/Anaconda.sublime-settings", - "/home/adrian/.config/sublime-text-3/Packages/Terminal/Default (Linux).sublime-keymap", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/coolc.sh", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/makefile", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/lexer/tokenizer.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/testing.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/build/test.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/build/compiler_struct.py", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/Makefile", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/.gitignore", - "/home/adrian/.config/sublime-text-3/Packages/User/make-src.sublime-build", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/lexer/regexgenerator.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/install.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/cool-comp.sublime-project", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/parserr/lr.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/grammar/grammar.py", - "/home/adrian/Documents/Universidad/3er año/Compilacion/CoolLanguage/PyCOOLC-master/docs/Grammar.md", - "/home/adrian/Documents/Universidad/3er año/Compilacion/CoolLanguage/PyCOOLC-master/setup.py", - "/usr/local/lib/python3.7/dist-packages/setuptools-44.0.0-py3.7.egg", - "/home/adrian/Documents/Universidad/3er año/Compilacion/CoolLanguage/PyCOOLC-master/pycoolc/ast.py", - "/home/adrian/Documents/Universidad/3er año/Compilacion/CoolLanguage/PyCOOLC-master/pycoolc/pycoolc.py", - "/home/adrian/Documents/Universidad/3er año/Compilacion/CoolLanguage/PyCOOLC-master/pycoolc/parser.py", - "/home/adrian/Documents/Universidad/3er año/Compilacion/CoolLanguage/PyCOOLC-master/pycoolc/lexer.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/doc/Readme.md", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/img/img1.png", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/tools/gramtoregex.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/tools/evaluate.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/tools/dtbuilder.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/parserr/shiftreduce.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/grammar/symbols.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/grammar/remrecursion.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/coolgrammar/grammar.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/baseNodeTree/astprinter.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/baseNodeTree/base.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/automatons/nondeterministic.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/automatons/deterministic.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/abstract/semantics.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src/automatons/transformation.py", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/tests/lexer/comment1.cl", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/tests/lexer/comment1_error.txt", - "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/Readme.md", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/src/mlfq.py", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/src/makefileGenerator.py", - "/etc/avahi/hosts", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/.gitignore", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/dist/wkgenerator", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/wkgenerator.spec", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/src/sjcf.py", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/src/sjf.py", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/src/fifo.py", - "/home/adrian/Documents/Universidad/3er año/2do Semestre/SO/Scheduler/policies/algorithms.py", - "/home/adrian/.config/sublime-text-3/Packages/User/Make(Linux).sublime-build", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/src/jobs.py", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/src/schedtools.py", - "/home/adrian/Documents/Universidad/3er año/2do Semestre/SO/Scheduler/README.txt", - "/home/adrian/Documents/Universidad/3er año/2do Semestre/SO/Scheduler/policies/deprecated.py", - "/home/adrian/Documents/Universidad/3er año/2do Semestre/SO/Scheduler/scheduler.py", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/out.sjf", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/sjf.json", - "/home/adrian/.config/sublime-text-3/Packages/Anaconda/Default (Linux).sublime-keymap", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/scheduler.sublime-project", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/build.sublime_build", - "/home/adrian/.config/sublime-text-3/Packages/User/make_test.sublime-build", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/src/testing.py", - "/usr/local/lib/python3.7/dist-packages/progressbar/__init__.py", - "/usr/local/lib/python3.7/dist-packages/progressbar/progressbar.py", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/src/workload_generator.py", - "/home/adrian/Documents/Universidad/Softwares/Packages/vscode_extension/settings.txt", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/workload_generator.py", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/schedtools.py", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/fifo.py", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/jobs.py", - "/home/adrian/Documents/Universidad/Docencia/Scheduler/test.go", - "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/grade-lab-util", - "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/user/ls.c", - "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/.gitignore", - "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/.cvsignore", - "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/user/xargstest.sh", - "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/gradelib.py", - "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/user/kill.c", - "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/user/ulib.c", - "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/user/sleep.c", - "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/user/primes.c", - "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/.clang_complete", - "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/kernel/file.c", - "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/kernel/defs.h", - "/home/adrian/.config/sublime-text-3/Packages/SublimeAStyleFormatter/SublimeAStyleFormatter.sublime-settings", - "/home/adrian/.config/sublime-text-3/Packages/Terminal/Terminal.sublime-settings", - "/home/adrian/.config/sublime-text-3/Packages/SideBarEnhancements/Side Bar.sublime-settings", - "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/user/initcode.S", - "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/.gdbinit.tmpl-riscv", - "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/conf/lab.mk", - "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/LICENSE", - "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/user/cat.c", - "/home/adrian/Documents/ACMICPC/solutions/diff2000/449B/main.cpp", - "/home/adrian/Documents/Universidad/Docencia/MIT 6.S081_2019/xv6-riscv-fall19/user/text.c", - "/home/adrian/Documents/MyProjects/JavaScript/test/t.js", - "/home/adrian/Documents/MyProjects/JavaScript/test/testingc.c", - "/home/adrian/Documents/MyProjects/JavaScript/test/test.cpp", - "/home/adrian/Documents/Universidad/Docencia/MITXv6/xv6-pdx_modified/user.h" - ], - "find": - { - "height": 49.0 - }, - "find_in_files": - { - "height": 129.0, - "where_history": - [ - ] - }, - "find_state": - { - "case_sensitive": false, - "find_history": - [ - "pep", - "format", - "unión" - ], - "highlight": true, - "in_selection": false, - "preserve_case": false, - "regex": false, - "replace_history": - [ - ], - "reverse": false, - "show_context": true, - "use_buffer2": true, - "whole_word": false, - "wrap": true - }, - "groups": - [ - { - "selected": 2, - "sheets": - [ - { - "buffer": 0, - "file": "src/makefile", - "semi_transient": false, - "settings": - { - "buffer_size": 721, - "regions": - { - }, - "selection": - [ - [ - 358, - 358 - ] - ], - "settings": - { - "bracket_highlighter.busy": false, - "bracket_highlighter.clone": -1, - "bracket_highlighter.clone_locations": - { - "close": - { - }, - "icon": - { - }, - "open": - { - }, - "unmatched": - { - } - }, - "bracket_highlighter.clone_regions": - [ - "bh_angle", - "bh_angle_center", - "bh_angle_open", - "bh_angle_close", - "bh_angle_content", - "bh_single_quote", - "bh_single_quote_center", - "bh_single_quote_open", - "bh_single_quote_close", - "bh_single_quote_content", - "bh_square", - "bh_square_center", - "bh_square_open", - "bh_square_close", - "bh_square_content", - "bh_regex", - "bh_regex_center", - "bh_regex_open", - "bh_regex_close", - "bh_regex_content", - "bh_double_quote", - "bh_double_quote_center", - "bh_double_quote_open", - "bh_double_quote_close", - "bh_double_quote_content", - "bh_curly", - "bh_curly_center", - "bh_curly_open", - "bh_curly_close", - "bh_curly_content", - "bh_tag", - "bh_tag_center", - "bh_tag_open", - "bh_tag_close", - "bh_tag_content", - "bh_c_define", - "bh_c_define_center", - "bh_c_define_open", - "bh_c_define_close", - "bh_c_define_content", - "bh_default", - "bh_default_center", - "bh_default_open", - "bh_default_close", - "bh_default_content", - "bh_round", - "bh_round_center", - "bh_round_open", - "bh_round_close", - "bh_round_content", - "bh_unmatched", - "bh_unmatched_center", - "bh_unmatched_open", - "bh_unmatched_close", - "bh_unmatched_content" - ], - "bracket_highlighter.locations": - { - "close": - { - }, - "icon": - { - }, - "open": - { - }, - "unmatched": - { - } - }, - "bracket_highlighter.regions": - [ - "bh_angle", - "bh_angle_center", - "bh_angle_open", - "bh_angle_close", - "bh_angle_content", - "bh_single_quote", - "bh_single_quote_center", - "bh_single_quote_open", - "bh_single_quote_close", - "bh_single_quote_content", - "bh_square", - "bh_square_center", - "bh_square_open", - "bh_square_close", - "bh_square_content", - "bh_regex", - "bh_regex_center", - "bh_regex_open", - "bh_regex_close", - "bh_regex_content", - "bh_double_quote", - "bh_double_quote_center", - "bh_double_quote_open", - "bh_double_quote_close", - "bh_double_quote_content", - "bh_curly", - "bh_curly_center", - "bh_curly_open", - "bh_curly_close", - "bh_curly_content", - "bh_tag", - "bh_tag_center", - "bh_tag_open", - "bh_tag_close", - "bh_tag_content", - "bh_c_define", - "bh_c_define_center", - "bh_c_define_open", - "bh_c_define_close", - "bh_c_define_content", - "bh_default", - "bh_default_center", - "bh_default_open", - "bh_default_close", - "bh_default_content", - "bh_round", - "bh_round_center", - "bh_round_open", - "bh_round_close", - "bh_round_content", - "bh_unmatched", - "bh_unmatched_center", - "bh_unmatched_open", - "bh_unmatched_close", - "bh_unmatched_content" - ], - "syntax": "Packages/Makefile/Makefile.sublime-syntax", - "translate_tabs_to_spaces": false - }, - "translation.x": 0.0, - "translation.y": 0.0, - "zoom_level": 1.0 - }, - "stack_index": 5, - "type": "text" - }, - { - "buffer": 1, - "file": "src/comments.py", - "semi_transient": false, - "settings": - { - "buffer_size": 30, - "regions": - { - }, - "selection": - [ - [ - 29, - 29 - ] - ], - "settings": - { - "auto_complete_triggers": - [ - { - "characters": ".>:", - "selector": "source.c++ - string - comment - constant.numeric" - }, - { - "characters": ".>:", - "selector": "source.c - string - comment - constant.numeric" - }, - { - "characters": ".>: ", - "selector": "source.objc++ - string - comment - constant.numeric" - }, - { - "characters": ".>: ", - "selector": "source.objc - string - comment - constant.numeric" - }, - { - "characters": ".>: ", - "selector": "source.cuda-c++ - string - comment - constant.numeric" - }, - { - "characters": ".", - "selector": "source.python - string - comment - constant.numeric" - } - ], - "bracket_highlighter.busy": false, - "bracket_highlighter.clone": -1, - "bracket_highlighter.clone_locations": - { - "close": - { - }, - "icon": - { - }, - "open": - { - }, - "unmatched": - { - } - }, - "bracket_highlighter.clone_regions": - [ - "bh_angle", - "bh_angle_center", - "bh_angle_open", - "bh_angle_close", - "bh_angle_content", - "bh_single_quote", - "bh_single_quote_center", - "bh_single_quote_open", - "bh_single_quote_close", - "bh_single_quote_content", - "bh_square", - "bh_square_center", - "bh_square_open", - "bh_square_close", - "bh_square_content", - "bh_regex", - "bh_regex_center", - "bh_regex_open", - "bh_regex_close", - "bh_regex_content", - "bh_double_quote", - "bh_double_quote_center", - "bh_double_quote_open", - "bh_double_quote_close", - "bh_double_quote_content", - "bh_curly", - "bh_curly_center", - "bh_curly_open", - "bh_curly_close", - "bh_curly_content", - "bh_tag", - "bh_tag_center", - "bh_tag_open", - "bh_tag_close", - "bh_tag_content", - "bh_c_define", - "bh_c_define_center", - "bh_c_define_open", - "bh_c_define_close", - "bh_c_define_content", - "bh_default", - "bh_default_center", - "bh_default_open", - "bh_default_close", - "bh_default_content", - "bh_round", - "bh_round_center", - "bh_round_open", - "bh_round_close", - "bh_round_content", - "bh_unmatched", - "bh_unmatched_center", - "bh_unmatched_open", - "bh_unmatched_close", - "bh_unmatched_content" - ], - "bracket_highlighter.locations": - { - "close": - { - }, - "icon": - { - }, - "open": - { - }, - "unmatched": - { - } - }, - "bracket_highlighter.regions": - [ - "bh_angle", - "bh_angle_center", - "bh_angle_open", - "bh_angle_close", - "bh_angle_content", - "bh_single_quote", - "bh_single_quote_center", - "bh_single_quote_open", - "bh_single_quote_close", - "bh_single_quote_content", - "bh_square", - "bh_square_center", - "bh_square_open", - "bh_square_close", - "bh_square_content", - "bh_regex", - "bh_regex_center", - "bh_regex_open", - "bh_regex_close", - "bh_regex_content", - "bh_double_quote", - "bh_double_quote_center", - "bh_double_quote_open", - "bh_double_quote_close", - "bh_double_quote_content", - "bh_curly", - "bh_curly_center", - "bh_curly_open", - "bh_curly_close", - "bh_curly_content", - "bh_tag", - "bh_tag_center", - "bh_tag_open", - "bh_tag_close", - "bh_tag_content", - "bh_c_define", - "bh_c_define_center", - "bh_c_define_open", - "bh_c_define_close", - "bh_c_define_content", - "bh_default", - "bh_default_center", - "bh_default_open", - "bh_default_close", - "bh_default_content", - "bh_round", - "bh_round_center", - "bh_round_open", - "bh_round_close", - "bh_round_content", - "bh_unmatched", - "bh_unmatched_center", - "bh_unmatched_open", - "bh_unmatched_close", - "bh_unmatched_content" - ], - "open_with_edit": true, - "syntax": "Packages/Python/Python.sublime-syntax", - "translate_tabs_to_spaces": false - }, - "translation.x": 0.0, - "translation.y": 0.0, - "zoom_level": 1.0 - }, - "stack_index": 1, - "type": "text" - }, - { - "buffer": 2, - "file": "/home/adrian/.config/sublime-text-3/Packages/Anaconda/Anaconda.sublime-settings", - "semi_transient": false, - "settings": - { - "buffer_size": 21784, - "regions": - { - }, - "selection": - [ - [ - 12068, - 12068 - ] - ], - "settings": - { - "bracket_highlighter.busy": false, - "bracket_highlighter.clone": -1, - "bracket_highlighter.clone_locations": - { - "close": - { - }, - "icon": - { - }, - "open": - { - }, - "unmatched": - { - } - }, - "bracket_highlighter.clone_regions": - [ - "bh_angle", - "bh_angle_center", - "bh_angle_open", - "bh_angle_close", - "bh_angle_content", - "bh_single_quote", - "bh_single_quote_center", - "bh_single_quote_open", - "bh_single_quote_close", - "bh_single_quote_content", - "bh_square", - "bh_square_center", - "bh_square_open", - "bh_square_close", - "bh_square_content", - "bh_regex", - "bh_regex_center", - "bh_regex_open", - "bh_regex_close", - "bh_regex_content", - "bh_double_quote", - "bh_double_quote_center", - "bh_double_quote_open", - "bh_double_quote_close", - "bh_double_quote_content", - "bh_curly", - "bh_curly_center", - "bh_curly_open", - "bh_curly_close", - "bh_curly_content", - "bh_tag", - "bh_tag_center", - "bh_tag_open", - "bh_tag_close", - "bh_tag_content", - "bh_c_define", - "bh_c_define_center", - "bh_c_define_open", - "bh_c_define_close", - "bh_c_define_content", - "bh_default", - "bh_default_center", - "bh_default_open", - "bh_default_close", - "bh_default_content", - "bh_round", - "bh_round_center", - "bh_round_open", - "bh_round_close", - "bh_round_content", - "bh_unmatched", - "bh_unmatched_center", - "bh_unmatched_open", - "bh_unmatched_close", - "bh_unmatched_content" - ], - "bracket_highlighter.locations": - { - "close": - { - }, - "icon": - { - }, - "open": - { - }, - "unmatched": - { - } - }, - "bracket_highlighter.regions": - [ - "bh_angle", - "bh_angle_center", - "bh_angle_open", - "bh_angle_close", - "bh_angle_content", - "bh_single_quote", - "bh_single_quote_center", - "bh_single_quote_open", - "bh_single_quote_close", - "bh_single_quote_content", - "bh_square", - "bh_square_center", - "bh_square_open", - "bh_square_close", - "bh_square_content", - "bh_regex", - "bh_regex_center", - "bh_regex_open", - "bh_regex_close", - "bh_regex_content", - "bh_double_quote", - "bh_double_quote_center", - "bh_double_quote_open", - "bh_double_quote_close", - "bh_double_quote_content", - "bh_curly", - "bh_curly_center", - "bh_curly_open", - "bh_curly_close", - "bh_curly_content", - "bh_tag", - "bh_tag_center", - "bh_tag_open", - "bh_tag_close", - "bh_tag_content", - "bh_c_define", - "bh_c_define_center", - "bh_c_define_open", - "bh_c_define_close", - "bh_c_define_content", - "bh_default", - "bh_default_center", - "bh_default_open", - "bh_default_close", - "bh_default_content", - "bh_round", - "bh_round_center", - "bh_round_open", - "bh_round_close", - "bh_round_content", - "bh_unmatched", - "bh_unmatched_center", - "bh_unmatched_open", - "bh_unmatched_close", - "bh_unmatched_content" - ], - "syntax": "Packages/JavaScript/JSON.sublime-syntax" - }, - "translation.x": 0.0, - "translation.y": 8484.0, - "zoom_level": 1.0 - }, - "stack_index": 0, - "type": "text" - }, - { - "buffer": 3, - "file": "src/coolgrammar/grammar.py", - "semi_transient": false, - "settings": - { - "buffer_size": 10948, - "regions": - { - }, - "selection": - [ - [ - 9901, - 9901 - ] - ], - "settings": - { - "bracket_highlighter.busy": false, - "bracket_highlighter.clone": -1, - "bracket_highlighter.clone_locations": - { - "close": - { - "1": - [ - 10867, - 10868 - ] - }, - "icon": - { - "1": - [ - "Packages/BracketHighlighter/icons/square_bracket.png", - "region.bluish" - ] - }, - "open": - { - "1": - [ - 9128, - 9129 - ] - }, - "unmatched": - { - } - }, - "bracket_highlighter.clone_regions": - [ - "bh_angle", - "bh_angle_center", - "bh_angle_open", - "bh_angle_close", - "bh_angle_content", - "bh_single_quote", - "bh_single_quote_center", - "bh_single_quote_open", - "bh_single_quote_close", - "bh_single_quote_content", - "bh_square", - "bh_square_center", - "bh_square_open", - "bh_square_close", - "bh_square_content", - "bh_regex", - "bh_regex_center", - "bh_regex_open", - "bh_regex_close", - "bh_regex_content", - "bh_double_quote", - "bh_double_quote_center", - "bh_double_quote_open", - "bh_double_quote_close", - "bh_double_quote_content", - "bh_curly", - "bh_curly_center", - "bh_curly_open", - "bh_curly_close", - "bh_curly_content", - "bh_tag", - "bh_tag_center", - "bh_tag_open", - "bh_tag_close", - "bh_tag_content", - "bh_c_define", - "bh_c_define_center", - "bh_c_define_open", - "bh_c_define_close", - "bh_c_define_content", - "bh_default", - "bh_default_center", - "bh_default_open", - "bh_default_close", - "bh_default_content", - "bh_round", - "bh_round_center", - "bh_round_open", - "bh_round_close", - "bh_round_content", - "bh_unmatched", - "bh_unmatched_center", - "bh_unmatched_open", - "bh_unmatched_close", - "bh_unmatched_content" - ], - "bracket_highlighter.locations": - { - "close": - { - "1": - [ - 10867, - 10868 - ] - }, - "icon": - { - "1": - [ - "Packages/BracketHighlighter/icons/square_bracket.png", - "region.bluish" - ] - }, - "open": - { - "1": - [ - 9128, - 9129 - ] - }, - "unmatched": - { - } - }, - "bracket_highlighter.regions": - [ - "bh_angle", - "bh_angle_center", - "bh_angle_open", - "bh_angle_close", - "bh_angle_content", - "bh_single_quote", - "bh_single_quote_center", - "bh_single_quote_open", - "bh_single_quote_close", - "bh_single_quote_content", - "bh_square", - "bh_square_center", - "bh_square_open", - "bh_square_close", - "bh_square_content", - "bh_regex", - "bh_regex_center", - "bh_regex_open", - "bh_regex_close", - "bh_regex_content", - "bh_double_quote", - "bh_double_quote_center", - "bh_double_quote_open", - "bh_double_quote_close", - "bh_double_quote_content", - "bh_curly", - "bh_curly_center", - "bh_curly_open", - "bh_curly_close", - "bh_curly_content", - "bh_tag", - "bh_tag_center", - "bh_tag_open", - "bh_tag_close", - "bh_tag_content", - "bh_c_define", - "bh_c_define_center", - "bh_c_define_open", - "bh_c_define_close", - "bh_c_define_content", - "bh_default", - "bh_default_center", - "bh_default_open", - "bh_default_close", - "bh_default_content", - "bh_round", - "bh_round_center", - "bh_round_open", - "bh_round_close", - "bh_round_content", - "bh_unmatched", - "bh_unmatched_center", - "bh_unmatched_open", - "bh_unmatched_close", - "bh_unmatched_content" - ], - "syntax": "Packages/Python/Python.sublime-syntax" - }, - "translation.x": 0.0, - "translation.y": 2947.0, - "zoom_level": 1.0 - }, - "stack_index": 3, - "type": "text" - }, - { - "buffer": 4, - "file": "src/install.py", - "semi_transient": false, - "settings": - { - "buffer_size": 688, - "regions": - { - }, - "selection": - [ - [ - 328, - 328 - ] - ], - "settings": - { - "auto_complete_triggers": - [ - { - "characters": ".>:", - "selector": "source.c++ - string - comment - constant.numeric" - }, - { - "characters": ".>:", - "selector": "source.c - string - comment - constant.numeric" - }, - { - "characters": ".>: ", - "selector": "source.objc++ - string - comment - constant.numeric" - }, - { - "characters": ".>: ", - "selector": "source.objc - string - comment - constant.numeric" - }, - { - "characters": ".>: ", - "selector": "source.cuda-c++ - string - comment - constant.numeric" - }, - { - "characters": ".", - "selector": "source.python - string - comment - constant.numeric" - } - ], - "bracket_highlighter.busy": false, - "bracket_highlighter.clone": -1, - "bracket_highlighter.clone_locations": - { - "close": - { - "1": - [ - 437, - 440 - ] - }, - "icon": - { - "1": - [ - "Packages/BracketHighlighter/icons/double_quote.png", - "region.greenish" - ] - }, - "open": - { - "1": - [ - 341, - 344 - ] - }, - "unmatched": - { - } - }, - "bracket_highlighter.clone_regions": - [ - "bh_default", - "bh_default_center", - "bh_default_open", - "bh_default_close", - "bh_default_content", - "bh_round", - "bh_round_center", - "bh_round_open", - "bh_round_close", - "bh_round_content", - "bh_double_quote", - "bh_double_quote_center", - "bh_double_quote_open", - "bh_double_quote_close", - "bh_double_quote_content", - "bh_c_define", - "bh_c_define_center", - "bh_c_define_open", - "bh_c_define_close", - "bh_c_define_content", - "bh_regex", - "bh_regex_center", - "bh_regex_open", - "bh_regex_close", - "bh_regex_content", - "bh_curly", - "bh_curly_center", - "bh_curly_open", - "bh_curly_close", - "bh_curly_content", - "bh_square", - "bh_square_center", - "bh_square_open", - "bh_square_close", - "bh_square_content", - "bh_angle", - "bh_angle_center", - "bh_angle_open", - "bh_angle_close", - "bh_angle_content", - "bh_unmatched", - "bh_unmatched_center", - "bh_unmatched_open", - "bh_unmatched_close", - "bh_unmatched_content", - "bh_single_quote", - "bh_single_quote_center", - "bh_single_quote_open", - "bh_single_quote_close", - "bh_single_quote_content", - "bh_tag", - "bh_tag_center", - "bh_tag_open", - "bh_tag_close", - "bh_tag_content" - ], - "bracket_highlighter.locations": - { - "close": - { - "1": - [ - 327, - 328 - ] - }, - "icon": - { - "1": - [ - "Packages/BracketHighlighter/icons/round_bracket.png", - "region.yellowish" - ] - }, - "open": - { - "1": - [ - 320, - 321 - ] - }, - "unmatched": - { - } - }, - "bracket_highlighter.regions": - [ - "bh_angle", - "bh_angle_center", - "bh_angle_open", - "bh_angle_close", - "bh_angle_content", - "bh_single_quote", - "bh_single_quote_center", - "bh_single_quote_open", - "bh_single_quote_close", - "bh_single_quote_content", - "bh_square", - "bh_square_center", - "bh_square_open", - "bh_square_close", - "bh_square_content", - "bh_regex", - "bh_regex_center", - "bh_regex_open", - "bh_regex_close", - "bh_regex_content", - "bh_double_quote", - "bh_double_quote_center", - "bh_double_quote_open", - "bh_double_quote_close", - "bh_double_quote_content", - "bh_curly", - "bh_curly_center", - "bh_curly_open", - "bh_curly_close", - "bh_curly_content", - "bh_tag", - "bh_tag_center", - "bh_tag_open", - "bh_tag_close", - "bh_tag_content", - "bh_c_define", - "bh_c_define_center", - "bh_c_define_open", - "bh_c_define_close", - "bh_c_define_content", - "bh_default", - "bh_default_center", - "bh_default_open", - "bh_default_close", - "bh_default_content", - "bh_round", - "bh_round_center", - "bh_round_open", - "bh_round_close", - "bh_round_content", - "bh_unmatched", - "bh_unmatched_center", - "bh_unmatched_open", - "bh_unmatched_close", - "bh_unmatched_content" - ], - "syntax": "Packages/Python/Python.sublime-syntax" - }, - "translation.x": 0.0, - "translation.y": 0.0, - "zoom_level": 1.0 - }, - "stack_index": 4, - "type": "text" - } - ] - }, - { - "selected": 0, - "sheets": - [ - { - "buffer": 5, - "semi_transient": false, - "settings": - { - "buffer_size": 963, - "regions": - { - }, - "selection": - [ - [ - 963, - 963 - ] - ], - "settings": - { - "__vi_external_disable": true, - "auto_complete": false, - "auto_complete_commit_on_tab": false, - "bracket_highlighter.busy": false, - "bracket_highlighter.clone": -1, - "bracket_highlighter.clone_locations": - { - }, - "bracket_highlighter.ignore": true, - "color_scheme": "Terminus.sublime-color-scheme", - "default_dir": "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src", - "draw_centered": false, - "draw_indent_guides": false, - "draw_unicode_white_space": false, - "draw_white_space": "none", - "gutter": false, - "highlight_line": false, - "is_widget": true, - "result_base_dir": "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src", - "result_file_regex": null, - "result_line_regex": null, - "scroll_past_end": true, - "syntax": "Packages/Text/Plain text.tmLanguage", - "terminus.highlight_counter": 52, - "terminus_view": true, - "terminus_view.args": - { - "auto_close": true, - "cancellable": false, - "cmd": - [ - "/usr/bin/bash", - "-i", - "-l" - ], - "config_name": "Login Shell", - "cwd": "/home/adrian/Documents/Universidad/4to/Compilacion/cool-comp2020/src", - "env": - { - "LANG": "en_US.UTF-8", - "TERM": "linux", - "TERMINUS_SUBLIME": "1", - "TERM_PROGRAM": "Terminus-Sublime" - }, - "file_regex": null, - "line_regex": null, - "panel_name": null, - "tag": null, - "timeit": false, - "title": null - }, - "terminus_view.cancellable": false, - "terminus_view.key.ctrl+k": true, - "terminus_view.key.ctrl+p": true, - "terminus_view.natural_keyboard": true, - "terminus_view.panel_name": null, - "terminus_view.tag": null, - "terminus_view.viewport_y": 0.0, - "word_wrap": false - }, - "translation.x": 0.0, - "translation.y": 0.0, - "zoom_level": 1.0 - }, - "stack_index": 2, - "type": "text" - } - ] - } - ], - "incremental_find": - { - "height": 36.0 - }, - "input": - { - "height": 52.0 - }, - "layout": - { - "cells": - [ - [ - 0, - 0, - 1, - 1 - ], - [ - 1, - 0, - 2, - 1 - ] - ], - "cols": - [ - 0.0, - 0.601688639323, - 1.0 - ], - "rows": - [ - 0.0, - 1.0 - ] - }, - "menu_visible": true, - "output.Terminus": - { - "height": 181.0 - }, - "output.astyle_error_message": - { - "height": 0.0 - }, - "output.diagnostics": - { - "height": 181.0 - }, - "output.exec": - { - "height": 625.0 - }, - "output.find_results": - { - "height": 0.0 - }, - "output.git": - { - "height": 181.0 - }, - "output.language servers": - { - "height": 181.0 - }, - "output.mdpopups": - { - "height": 0.0 - }, - "pinned_build_system": "", - "project": "cool-comp.sublime-project", - "replace": - { - "height": 68.0 - }, - "save_all_on_build": true, - "select_file": - { - "height": 0.0, - "last_filter": "", - "selected_items": - [ - ], - "width": 0.0 - }, - "select_project": - { - "height": 500.0, - "last_filter": "", - "selected_items": - [ - ], - "width": 380.0 - }, - "select_symbol": - { - "height": 0.0, - "last_filter": "", - "selected_items": - [ - ], - "width": 0.0 - }, - "selected_group": 0, - "settings": - { - }, - "show_minimap": true, - "show_open_files": true, - "show_tabs": true, - "side_bar_visible": false, - "side_bar_width": 261.0, - "status_bar_visible": true, - "template_settings": - { - } -} diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 743428d8..bc8700d3 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -40,7 +40,7 @@ def add_edge(self, parent: str, child: str) -> None: def __ancestor(self, node_x: str, node_y: str) -> bool: # Devuelve true si x es ancestro de y. # Para realizar este calculo nos basamos en el arbol - # construido por el DFS, y tenemos en cuenta los tiempo + # construido por el DFS, y tenemos en cuenta los tiempos # de descubrimiento y finalizacion return self._discover[node_x] < self._discover[node_y] < self._finalization[node_y] < self._finalization[node_x] diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 466afad1..cafe505f 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -207,6 +207,7 @@ def visit(self, node: coolAst.CaseNode, scope: Scope): # noqa: F811 type_internal_local_holder = self.define_internal_local() self.register_instruction(cil.TypeOfNode(expr_vm_holder, type_internal_local_holder)) + # Variables internas para almacenar resultados intermedios branch_type_index = self.define_internal_local() expr_type_index = self.define_internal_local() branch_type = self.define_internal_local() @@ -224,9 +225,12 @@ def visit(self, node: coolAst.CaseNode, scope: Scope): # noqa: F811 # Calcular la distancia hacia el tipo, y actualizar el minimo de ser necesario self.register_instruction(cil.TdtLookupNode(branch_type_index, expr_type_index, tdt_result)) + # Comparar el resultado obtenido con el minimo actual. self.register_instruction(cil.MinusNode(min_, tdt_result, min_check_local)) not_min_label = self.do_label('Not_min{i}') self.register_instruction(cil.JumpIfGreaterThanZeroNode(min_check_local, not_min_label)) + + # Si mejora el minimo, entonces actualizarlo. self.register_instruction(cil.AssignNode(min_, tdt_result)) self.register_instruction(cil.LabelNode(not_min_label)) @@ -264,3 +268,39 @@ def visit(self, node: coolAst.CaseNode, scope: Scope): # noqa: F811 # TODO: Define some form of runtime errors self.register_instruction(cil.LabelNode(end_label)) + + @visitor.when(coolAst.PlusNode) # type: ignore + def visit(self, node: coolAst.PlusNode, scope: Scope): # noqa: F811 + # Definir una variable interna local para almacenar el resultado + sum_internal_local = self.define_internal_local() + + # Obtener el resultado del primero operando + left_vm_holder = self.visit(node.left, scope) + + # Obtener el resultado del segundo operando + right_vm_holder = self.visit(node.right, scope) + + # registrar la instruccion de suma + self.register_instruction(cil.PlusNode(sum_internal_local, left_vm_holder, right_vm_holder)) + + # Devolver la variable interna que contiene la suma + return sum_internal_local + + @visitor.when(coolAst.DifNode) # type: ignore + def visit(self, node: coolAst.DifNode, scope: Scope): # noqa: F811 + # Definir una variable interna local para almacenar el resultado intermedio + minus_internal_vm_holder = self.define_internal_local() + + # Obtener el resultado del minuendo + left_vm_holder = self.visit(node.left, scope) + + # Obtener el resultado del sustraendo + right_vm_holder = self.visit(node.right, scope) + + # Registrar la instruccion de resta + self.register_instruction(cil.MinusNode(left_vm_holder, right_vm_holder, minus_internal_vm_holder)) + + # Devolver la variable que contiene el resultado + return minus_internal_vm_holder + + From c83a519d17411b7f99ce05a916b22fc0c24c60da Mon Sep 17 00:00:00 2001 From: Adrian Date: Wed, 20 May 2020 18:05:34 -0400 Subject: [PATCH 041/162] Implemented MulNode and DivNode in CIL. --- src/cil/nodes.py | 5 ++++- src/travels/ctcill.py | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 906c1bba..4df7197c 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -76,7 +76,10 @@ def __init__(self, x: str, y: str, dest: str): class StarNode(ArithmeticNode): - pass + def __init__(self, x: str, y: str, dest: str): + self.x = x + self.y = y + self.dest = dest class DivNode(ArithmeticNode): diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index cafe505f..1446ebb8 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -303,4 +303,36 @@ def visit(self, node: coolAst.DifNode, scope: Scope): # noqa: F811 # Devolver la variable que contiene el resultado return minus_internal_vm_holder - + @visitor.when(coolAst.MulNode) # type: ignore + def visit(self, node: coolAst.MulNode, scope: Scope): # noqa: F811 + # Definir una variable interna local para almacenar el resultado intermedio + mul_internal_vm_holder = self.define_internal_local() + + # Obtener el resultado del primer factor + left_vm_holder = self.visit(node.left, scope) + + # Obtener el resultado del segundo factor + right_vm_holder = self.visit(node.right, scope) + + # Registrar la instruccion de multimplicacion + self.register_instruction(cil.StarNode(left_vm_holder, right_vm_holder, mul_internal_vm_holder)) + + # Retornarl el resultado + return mul_internal_vm_holder + + @visitor.when(coolAst.DivNode) # type: ignore + def visit(self, node: coolAst.DivNode, scope: Scope): # noqa: F811 + # Definir una variable interna local para almacenar el resultado intermedio + div_internal_vm_holder = self.define_internal_local() + + # Obtener el resultad del dividendo + left_vm_holder = self.visit(node.left, scope) + + # Obtener el resultado del divisor + right_vm_holder = self.visit(node.right, scope) + + # Registrar la instruccion de division + self.register_instruction(cil.DivNode(div_internal_vm_holder, left_vm_holder, right_vm_holder)) + + # Devolver el resultado + return div_internal_vm_holder From a7f2e6b5a6219a29f020548e5f20a4a7b18fa5dd Mon Sep 17 00:00:00 2001 From: Adrian Date: Wed, 20 May 2020 21:16:35 -0400 Subject: [PATCH 042/162] Implemented constants (strings, integers, true and false). --- src/cil/nodes.py | 2 +- src/travels/ctcill.py | 54 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 4df7197c..0cb67062 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -176,7 +176,7 @@ def __init__(self, value=None): class LoadNode(InstructionNode): - def __init__(self, dest, message): + def __init__(self, dest: str, message: DataNode): self.dest = dest self.message = message diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 1446ebb8..de3fe3c9 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -39,6 +39,8 @@ def visit(self, node: coolAst.ProgramNode, scope: Scope, local_vm_holder: str = return cil.CilProgramNode(self.dot_types, self.dot_data, self.dot_code) + # *************** IMPLEMENTACION DE LAS DEFINICIONES DE CLASES ***************** + @visitor.when(coolAst.ClassDef) # type: ignore def visit(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 # node.idx -> String with the Class Name @@ -84,6 +86,8 @@ def visit(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 self.current_type = None + # ****************** IMPLEMENTACION DE LAS DEFINICIONES DE METODOS ****************** + @visitor.when(coolAst.MethodDef) # type: ignore def visit(self, node: coolAst.MethodDef, scope: Scope) -> None: # noqa: F811 self.current_method = self.current_type.get_method(node.idx) @@ -109,6 +113,10 @@ def visit(self, node: coolAst.MethodDef, scope: Scope) -> None: # noqa: F811 self.current_method = None self.current_function = None + # ************** IMPLEMENTACION DE LAS EXPRESIONES CONDICIONAES (IF, WHILE, CASE) Y LAS DECLARACIONES + # DE VARIABLES (let) + # ************** + @visitor.when(coolAst.IfThenElseNode) # type: ignore def visit(self, node: coolAst.IfThenElseNode, scope: Scope) -> None: # noqa: F811 # Create a jumping label @@ -269,6 +277,10 @@ def visit(self, node: coolAst.CaseNode, scope: Scope): # noqa: F811 self.register_instruction(cil.LabelNode(end_label)) + # *************** IMPLEMENTACION DE LAS EXPRESIONES ARITMETICAS + # + # *************** + @visitor.when(coolAst.PlusNode) # type: ignore def visit(self, node: coolAst.PlusNode, scope: Scope): # noqa: F811 # Definir una variable interna local para almacenar el resultado @@ -336,3 +348,45 @@ def visit(self, node: coolAst.DivNode, scope: Scope): # noqa: F811 # Devolver el resultado return div_internal_vm_holder + + # ********************* IMPLEMENTACION DE LAS CONSTANTES + # + # ********************* + + @visitor.when(coolAst.IntegerConstant) # type: ignore + def visit(self, node: coolAst.IntegerConstant, scope: Scope): # noqa: F811 + # Variable interna que guarda el valor de la constante + int_const_vm_holder = self.define_internal_local() + + # Asignarle el valor a la variable + self.register_instruction(cil.AssignNode(int_const_vm_holder, int(node.lex))) + + # devolver el valor + return int_const_vm_holder + + @visitor.when(coolAst.StringConstant) # type: ignore + def visit(self, node: coolAst.StringConstant, scope: Scope): # noqa: F811 + # Variable interna que apunta al string + str_const_vm_holder = self.define_internal_local() + + # Registrar el string en la seccion de datos + s1 = self.register_data(node.lex) + + # Cargar el string en la variable interna + self.register_instruction(cil.LoadNode(str_const_vm_holder, s1)) + + # Devolver la variable que contiene el string + return str_const_vm_holder + + @visitor.when(coolAst.TrueConstant) # type: ignore + def visit(self, node: coolAst.TrueConstant, scope: Scope): # noqa: F811 + # variable interna que devuelve el valor de la constante + true_const_vm_holder = self.define_internal_local() + self.register_instruction(cil.AssignNode(true_const_vm_holder), 1) + return true_const_vm_holder + + @visitor.when(coolAst.FalseConstant) # type: ignore + def visit(self, node: coolAst.FalseConstant, scope: Scope): # noqa: F811 + false_const_vm_holder = self.define_internal_local() + self.register_instruction(cil.AssignNode(false_const_vm_holder), 0) + return false_const_vm_holder From eb787bd1ea278600d07566e891291327ec50f918 Mon Sep 17 00:00:00 2001 From: Adrian Date: Mon, 25 May 2020 13:59:22 -0400 Subject: [PATCH 043/162] Implemented "==" in CIL. --- src/travels/ctcill.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index de3fe3c9..7a6902c4 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -390,3 +390,25 @@ def visit(self, node: coolAst.FalseConstant, scope: Scope): # noqa: F811 false_const_vm_holder = self.define_internal_local() self.register_instruction(cil.AssignNode(false_const_vm_holder), 0) return false_const_vm_holder + + # ******************* Implementacion de las comparaciones + # + # ******************* + + @visitor.when(coolAst.EqualToNode) # type: ignore + def visit(self, node: coolAst.EqualToNode, scope: Scope): # noqa: F811 + # Debemos devolver una variable que contenga 0 si los valores a comparar + # son iguales. + expr_result_vm_holder = self.define_internal_local() + + # Obtener el valor de la expresion izquierda + left_vm_holder = self.visit(node.left, scope) + + # obtener el valor de la expresion derecha + right_vm_holder = self.visit(node.right, scope) + + # Realizar una resta y devolver el resultado + self.register_instruction(cil.MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) + + # Devolver la variable con el resultado + return expr_result_vm_holder From 14cbb7360088d3e5af4f562ffe33ffc572dbbb57 Mon Sep 17 00:00:00 2001 From: Adrian Date: Mon, 25 May 2020 14:43:32 -0400 Subject: [PATCH 044/162] Implemented "<" and "<=" in CIL. --- src/travels/ctcill.py | 76 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 71 insertions(+), 5 deletions(-) diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 7a6902c4..ae231f6f 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -128,7 +128,7 @@ def visit(self, node: coolAst.IfThenElseNode, scope: Scope) -> None: # noqa: F8 internal_cond_vm_holder = self.visit(node.cond, scope) # Do the check and jump if necesary - self.register_instruction(cil.NotZeroJump(internal_cond_vm_holder, false_label)) + self.register_instruction(cil.IfZeroJump(internal_cond_vm_holder, false_label)) # Save the instructions related to the then branch self.visit(node.expr1, scope) @@ -391,15 +391,16 @@ def visit(self, node: coolAst.FalseConstant, scope: Scope): # noqa: F811 self.register_instruction(cil.AssignNode(false_const_vm_holder), 0) return false_const_vm_holder - # ******************* Implementacion de las comparaciones - # + # ******************* Implementacion de las comparaciones ******************** + # Todas las operaciones de comparacion devuelven 1 si el resultado es verdadero, + # o 0 si es falso. # ******************* @visitor.when(coolAst.EqualToNode) # type: ignore def visit(self, node: coolAst.EqualToNode, scope: Scope): # noqa: F811 - # Debemos devolver una variable que contenga 0 si los valores a comparar - # son iguales. expr_result_vm_holder = self.define_internal_local() + true_label = self.do_label("TRUE") + end_label = self.do_label("END") # Obtener el valor de la expresion izquierda left_vm_holder = self.visit(node.left, scope) @@ -410,5 +411,70 @@ def visit(self, node: coolAst.EqualToNode, scope: Scope): # noqa: F811 # Realizar una resta y devolver el resultado self.register_instruction(cil.MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) + # Si la resta da 0, entonces son iguales y se devuelve 1, si no, se devuelve 0 + self.register_instruction(cil.IfZeroJump(expr_result_vm_holder, true_label)) + + # si la resta no da 0, almacenar 0 y retornar + self.register_instruction(cil.AssignNode(expr_result_vm_holder, 0)) + self.register_instruction(cil.UnconditionalJump(end_label)) + + # Si la resta da 0, devolver 1 + self.register_instruction(cil.LabelNode(true_label)) + self.register_instruction(cil.AssignNode(expr_result_vm_holder, 1)) + + self.register_instruction(cil.LabelNode(end_label)) + # Devolver la variable con el resultado return expr_result_vm_holder + + @visitor.when(coolAst.LowerThanNode) # type: ignore + def visit(self, node: coolAst.LowerThanNode, scope: Scope): # noqa: F811 + expr_result_vm_holder = self.define_internal_local() + false_label = self.do_label("FALSE") + end_label = self.do_label("END") + + # Obtener el valor de la expresion izquierda + left_vm_holder = self.visit(node.left, scope) + + # Obtener el valor de la expresion derecha + right_vm_holder = self.visit(node.right, scope) + + # Comparar los resultados restando + self.register_instruction(cil.MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) + + self.register_instruction(cil.JumpIfGreaterThanZeroNode(expr_result_vm_holder, false_label)) + self.register_instruction(cil.IfZeroJump(expr_result_vm_holder, false_label)) + + self.register_instruction(cil.AssignNode(expr_result_vm_holder, 1)) + self.register_instruction(cil.UnconditionalJump(end_label)) + + self.register_instruction(cil.LabelNode(false_label)) + self.register_instruction(cil.AssignNode(expr_result_vm_holder, 0)) + self.register_instruction(cil.LabelNode(end_label)) + + return expr_result_vm_holder + + @visitor.when(coolAst.LowerEqual) # type: ignore + def visit(self, node: coolAst.LowerEqual, scope:Scope): # noqa: F811 + expr_result_vm_holder = self.define_internal_local() + false_label = self.do_label("FALSE") + end_label = self.do_label("END") + + # Obtener el valor de la expresion izquierda + left_vm_holder = self.visit(node.left, scope) + + # Obtener el valor de la expresion derecha + right_vm_holder = self.visit(node.right, scope) + + self.register_instruction(cil.MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) + + self.register_instruction(cil.JumpIfGreaterThanZeroNode(expr_result_vm_holder, false_label)) + + self.register_instruction(cil.AssignNode(expr_result_vm_holder, 1)) + self.register_instruction(cil.UnconditionalJump(end_label)) + + self.register_instruction(cil.LabelNode(false_label)) + self.register_instruction(cil.AssignNode(expr_result_vm_holder, 0)) + self.register_instruction(cil.LabelNode(end_label)) + + return expr_result_vm_holder From d347d3edade189e38dbece5c8a6834a6cff3f1f9 Mon Sep 17 00:00:00 2001 From: Adrian Date: Mon, 25 May 2020 17:02:41 -0400 Subject: [PATCH 045/162] Implemented ">" and ">=" in CIL. --- src/travels/ctcill.py | 55 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index ae231f6f..7fe9a23e 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -478,3 +478,58 @@ def visit(self, node: coolAst.LowerEqual, scope:Scope): # noqa: F811 self.register_instruction(cil.LabelNode(end_label)) return expr_result_vm_holder + + @visitor.when(coolAst.GreaterThanNode) # type: ignore + def visit(self, node: coolAst.GreaterThanNode, scope: Scope): # noqa: F811 + expr_result_vm_holder = self.define_internal_local() + true_label = self.do_label("TRUE") + end_label = self.do_label("END") + + # Obtener el valor de la expresion izquierda + left_vm_holder = self.visit(node.left, scope) + + # Obtener el valor de la expresion derecha + right_vm_holder = self.visit(node.right, scope) + + self.register_instruction(cil.MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) + + self.register_instruction(cil.JumpIfGreaterThanZeroNode(expr_result_vm_holder, true_label)) + + # False Branch + self.register_instruction(cil.AssignNode(expr_result_vm_holder, 0)) + self.register_instruction(cil.UnconditionalJump(end_label)) + + # True Branch + self.register_instruction(cil.LabelNode(true_label)) + self.register_instruction(cil.AssignNode(expr_result_vm_holder, 1)) + self.register_instruction(cil.LabelNode(end_label)) + + return expr_result_vm_holder + + @visitor.when(coolAst.GreaterEqualNode) # type: ignore + def visit(self, node: coolAst.GreaterEqualNode, scope: Scope): # noqa: F811 + expr_result_vm_holder = self.define_internal_local() + true_label = self.do_label("TRUE") + end_label = self.do_label("END") + + # Obtener el valor de la expresion izquierda + left_vm_holder = self.visit(node.left, scope) + + # Obtener el valor de la expresion derecha + right_vm_holder = self.visit(node.right, scope) + + self.register_instruction(cil.MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) + + self.register_instruction(cil.JumpIfGreaterThanZeroNode(expr_result_vm_holder, true_label)) + self.register_instruction(cil.IfZeroJump(expr_result_vm_holder, true_label)) + + # False Branch + self.register_instruction(cil.AssignNode(expr_result_vm_holder, 1)) + self.register_instruction(cil.UnconditionalJump(end_label)) + + # True Branch + self.register_instruction(cil.LabelNode(true_label)) + self.register_instruction(cil.AssignNode(expr_result_vm_holder, 1)) + self.register_instruction(cil.LabelNode(end_label)) + + return expr_result_vm_holder From 2455fe37631547c46cdda2cf6ee72a1acf303ce7 Mon Sep 17 00:00:00 2001 From: Adrian Date: Wed, 27 May 2020 00:02:15 -0400 Subject: [PATCH 046/162] [TODO] NEED TO CHECK THE TYPE_INFERER. Fixed a lot of bugs with grammar and Type System. --- src/.builds | 3 + src/abstract/semantics.py | 10 +- src/abstract/tree.py | 32 +++--- src/coolgrammar/grammar.py | 103 +++++++----------- src/testing.py | 102 ++++++++++++++---- src/travels/ctcill.py | 204 +++++++++++++++++++++++++++++++---- src/travels/inference.py | 8 +- src/travels/typecollector.py | 10 +- 8 files changed, 335 insertions(+), 137 deletions(-) diff --git a/src/.builds b/src/.builds index aae3d45d..0df35d7d 100644 --- a/src/.builds +++ b/src/.builds @@ -124,3 +124,6 @@ 1 1 1 +1 +1 +1 diff --git a/src/abstract/semantics.py b/src/abstract/semantics.py index 5cf232f0..53b96487 100755 --- a/src/abstract/semantics.py +++ b/src/abstract/semantics.py @@ -118,7 +118,7 @@ def __repr__(self): class VoidType(Type): def __init__(self): - super(VoidType, self).__init__('void') + super(VoidType, self).__init__('Void') def __eq__(self, other): return isinstance(other, VoidType) @@ -126,7 +126,7 @@ def __eq__(self, other): class ObjectType(Type): def __init__(self): - super(ObjectType, self).__init__('object') + super(ObjectType, self).__init__('Object') def __eq__(self, other): return isinstance(other, ObjectType) @@ -134,7 +134,7 @@ def __eq__(self, other): class IntegerType(Type): def __init__(self): - super(IntegerType, self).__init__('int') + super(IntegerType, self).__init__('Int') def __eq__(self, other): return isinstance(other, IntegerType) @@ -142,7 +142,7 @@ def __eq__(self, other): class StringType(Type): def __init__(self): - super(StringType, self).__init__('string') + super(StringType, self).__init__('String') def __eq__(self, other): return isinstance(other, StringType) @@ -150,7 +150,7 @@ def __eq__(self, other): class BoolType(Type): def __init__(self): - super(BoolType, self).__init__('bool') + super(BoolType, self).__init__('Bool') def __eq__(self, other): return isinstance(other, BoolType) diff --git a/src/abstract/tree.py b/src/abstract/tree.py index 7d4a1009..274fef13 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -25,15 +25,15 @@ def check_semantics(self, deep=1): type_collector.errors) type_builder.visit(self) errors = type_builder.errors - if not errors: - inferer = inference.TypeInferer(type_builder.context, - errors=errors) - scope = None - for d in range(1, deep + 1): - print(d) - scope = inferer.visit(self, scope=scope, deep=d) - print(scope) - # reportar los errores + # if not errors: + # inferer = inference.TypeInferer(type_builder.context, + # errors=errors) + # scope = None + # for d in range(1, deep + 1): + # print(d) + # scope = inferer.visit(self, scope=scope, deep=d) + # print(scope) + # # reportar los errores return errors, type_builder.context @@ -143,36 +143,36 @@ def __init__(self, val): class FalseConstant(AtomicNode): def __init__(self): - super(FalseConstant, self).__init__('false') + super(FalseConstant, self).__init__('False') class TrueConstant(AtomicNode): def __init__(self): - super(TrueConstant, self).__init__('true') + super(TrueConstant, self).__init__('True') class StringTypeNode(TypeNode): def __init__(self): - super(StringTypeNode, self).__init__('string') + super(StringTypeNode, self).__init__('String') class IntegerTypeNode(TypeNode): def __init__(self): - super(IntegerTypeNode, self).__init__('int') + super(IntegerTypeNode, self).__init__('Int') class ObjectTypeNode(TypeNode): def __init__(self): - super(ObjectTypeNode, self).__init__('object') + super(ObjectTypeNode, self).__init__('Object') class VoidTypeNode(TypeNode): def __init__(self): - super(VoidTypeNode, self).__init__('void') + super(VoidTypeNode, self).__init__('Void') class ClassDef(DeclarationNode): - def __init__(self, idx, features, parent='object'): + def __init__(self, idx, features, parent='Object'): self.idx = idx self.features = features self.parent = parent diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index 79cd9cb2..ab5303cd 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -17,73 +17,54 @@ def build_cool_grammar(): G = Grammar() program = G.NonTerminal('', True) - class_list, class_def, empty_feature_list, feature_list, meod_def = \ - G.NonTerminals( - ' ') + class_list, class_def, empty_feature_list, feature_list, meod_def = G.NonTerminals(' ') - attr_def, param_list, param, statement_list = G.NonTerminals( - ' ') + attr_def, param_list, param, statement_list = G.NonTerminals(' ') - var_dec, args_list, instantiation = G.NonTerminals( - ' ') + var_dec, args_list, instantiation = G.NonTerminals(' ') - exp, typex, term, factor, nested_lets, loop_statements = G.NonTerminals( - ' ') + exp, typex, term, factor, nested_lets, loop_statements = G.NonTerminals(' ') - arith, atom, actions, action, block = G.NonTerminals( - ' ') + arith, atom, actions, action, block = G.NonTerminals(' ') - args_list_empty, param_list_empty, case_statement, string_const = G.NonTerminals( - ' ') + args_list_empty, param_list_empty, case_statement, string_const = G.NonTerminals(' ') class_keyword, def_keyword, in_keyword = G.Terminals('class def in') - coma, period, dot_comma, opar, cpar, obrack, cbrack, plus, minus, star, div, dd = G.Terminals( - ', . ; ( ) { } + - * / :') + coma, period, dot_comma, opar, cpar, obrack, cbrack, plus, minus, star, div, dd = G.Terminals(', . ; ( ) { } + - * / :') - idx, let, intx, string, num, true, false, boolean, objectx, classid =\ - G.Terminals('id let int string num true false bool object classid') + idx, let, intx, string, num, true, false, boolean, objectx, classid = G.Terminals('id let int string num true false bool object classid') - tilde_string_const, quoted_string_const, void, auto = G.Terminals( - 'tilde_string_const quoted_string_const void AUTO_TYPE') + tilde_string_const, quoted_string_const, void, auto = G.Terminals('tilde_string_const quoted_string_const void AUTO_TYPE') - if_, then, else_, assign, new, case, of, esac = G.Terminals( - 'if then else assign new case of esac') + if_, then, else_, assign, new, case, of, esac = G.Terminals('if then else assign new case of esac') - gt, lt, ge, le, eq, not_, implies, isvoid, not_operator = G.Terminals( - '> < >= <= = ~ => isvoid not') + gt, lt, ge, le, eq, not_, implies, isvoid, not_operator = G.Terminals('> < >= <= = ~ => isvoid not') - while_, do, inherits, arroba, fi, pool, loop = G.Terminals( - 'while do inherits @ fi pool loop') + while_, do, inherits, arroba, fi, pool, loop = G.Terminals('while do inherits @ fi pool loop') program %= class_list, lambda s: ProgramNode(s[1]) class_list %= class_def + dot_comma, lambda s: [s[1]] - class_list %= class_def + dot_comma + class_list, lambda s: [s[1]] + s[2] + class_list %= class_def + dot_comma + class_list, lambda s: [s[1]] + s[3] - class_def %= class_keyword + classid + obrack + feature_list + cbrack, lambda s: ClassDef( - s[2], s[4]) + class_def %= class_keyword + classid + obrack + feature_list + cbrack, lambda s: ClassDef(s[2], s[4]) - class_def %= class_keyword + classid + inherits + typex + obrack + feature_list + \ - cbrack, lambda s: ClassDef(s[2], s[6], s[4]) + class_def %= class_keyword + classid + inherits + typex + obrack + feature_list + cbrack, lambda s: ClassDef(s[2], s[6], s[4]) feature_list %= meod_def + dot_comma, lambda s: [s[1]] feature_list %= attr_def + dot_comma, lambda s: [s[1]] - feature_list %= meod_def + dot_comma + \ - feature_list, lambda s: [s[1]] + s[3] + feature_list %= meod_def + dot_comma + feature_list, lambda s: [s[1]] + s[3] - feature_list %= attr_def + dot_comma + \ - feature_list, lambda s: [s[1]] + s[3] + feature_list %= attr_def + dot_comma + feature_list, lambda s: [s[1]] + s[3] - meod_def %= idx + opar + param_list_empty + cpar + dd + typex + obrack +\ - statement_list + cbrack , lambda s: MethodDef(s[1], s[3], s[6], s[8]) + meod_def %= idx + opar + param_list_empty + cpar + dd + typex + obrack + statement_list + cbrack , lambda s: MethodDef(s[1], s[3], s[6], s[8]) attr_def %= idx + dd + typex, lambda s: AttributeDef(s[1], s[3]) - attr_def %= idx + dd + typex + assign + \ - exp, lambda s: AttributeDef(s[1], s[3], s[5]) + attr_def %= idx + dd + typex + assign + exp, lambda s: AttributeDef(s[1], s[3], s[5]) param_list_empty %= param_list, lambda s: s[1] param_list_empty %= G.Epsilon, lambda s: [] @@ -97,19 +78,15 @@ def build_cool_grammar(): # statement_list %= exp + dot_comma + statement_list, lambda s: [s[1]] + s[3] - var_dec %= let + nested_lets + in_keyword + \ - exp, lambda s: VariableDeclaration(s[2], s[4]) + var_dec %= let + nested_lets + in_keyword + exp, lambda s: VariableDeclaration(s[2], s[4]) nested_lets %= idx + dd + typex, lambda s: [(s[1], s[3], None)] - nested_lets %= idx + dd + typex + coma + \ - nested_lets, lambda s: [(s[1], s[3], None)] + s[5] + nested_lets %= idx + dd + typex + coma + nested_lets, lambda s: [(s[1], s[3], None)] + s[5] - nested_lets %= idx + dd + typex + assign + \ - exp, lambda s: [(s[1], s[3], s[5])] + nested_lets %= idx + dd + typex + assign + exp, lambda s: [(s[1], s[3], s[5])] - nested_lets %= idx + dd + typex + assign + exp + coma + \ - nested_lets, lambda s: [(s[1], s[3], s[5])] + s[7] + nested_lets %= idx + dd + typex + assign + exp + coma + nested_lets, lambda s: [(s[1], s[3], s[5])] + s[7] exp %= var_dec, lambda s: s[1] @@ -120,13 +97,11 @@ def build_cool_grammar(): instantiation %= new + typex, lambda s: InstantiateClassNode(s[2], []) loop_statements %= exp + dot_comma, lambda s: [s[1]] - loop_statements %= exp + dot_comma + loop_statements, lambda s: [s[1]] + s[ - 3] + loop_statements %= exp + dot_comma + loop_statements, lambda s: [s[1]] + s[3] exp %= idx + assign + exp, lambda s: AssignNode(s[1], s[3]) - exp %= while_ + exp + loop + statement_list + \ - pool, lambda s: WhileBlockNode(s[2], s[5]) + exp %= while_ + exp + loop + statement_list + pool, lambda s: WhileBlockNode(s[2], s[5]) exp %= atom, lambda s: s[1] @@ -158,8 +133,7 @@ def build_cool_grammar(): term %= not_operator + factor, lambda s: NegNode(s[2]) - factor %= if_ + exp + then + exp + else_ + exp + fi, lambda s: IfThenElseNode( - s[2], s[4], s[6]) + factor %= if_ + exp + then + exp + else_ + exp + fi, lambda s: IfThenElseNode(s[2], s[4], s[6]) factor %= opar + atom + cpar, lambda s: s[2] @@ -169,16 +143,13 @@ def build_cool_grammar(): factor %= true, lambda s: TrueConstant() - factor %= factor + period + idx + opar + args_list_empty + cpar, lambda s: FunCall( - s[1], s[3], s[5]) + factor %= factor + period + idx + opar + args_list_empty + cpar, lambda s: FunCall(s[1], s[3], s[5]) factor %= string_const, lambda s: s[1] - factor %= idx + opar + args_list_empty + \ - cpar, lambda s: FunCall('self', s[1], s[3]) + factor %= idx + opar + args_list_empty + cpar, lambda s: FunCall('self', s[1], s[3]) - factor %= factor + arroba + typex + period + idx + opar + args_list_empty + cpar, lambda s: \ - ParentFuncCall(s[1], s[3], s[5], s[7]) + factor %= factor + arroba + typex + period + idx + opar + args_list_empty + cpar, lambda s: ParentFuncCall(s[1], s[3], s[5], s[7]) factor %= false, lambda s: FalseConstant() @@ -194,19 +165,19 @@ def build_cool_grammar(): atom %= arith, lambda s: s[1] - typex %= intx, lambda s: 'int' + typex %= intx, lambda s: 'Int' - typex %= boolean, lambda s: 'bool' + typex %= boolean, lambda s: 'Bool' - typex %= string, lambda s: 'string' + typex %= string, lambda s: 'String' - typex %= objectx, lambda s: 'object' + typex %= objectx, lambda s: 'Object' typex %= classid, lambda s: s[1] typex %= auto, lambda s: 'AUTO_TYPE' - typex %= void, lambda s: 'void' + typex %= void, lambda s: 'Void' args_list_empty %= args_list, lambda s: s[1] @@ -220,11 +191,9 @@ def build_cool_grammar(): actions %= action + actions, lambda s: [s[1]] + s[2] - action %= idx + dd + typex + implies + exp + \ - dot_comma, lambda s: ActionNode(s[1], s[3], s[5]) + action %= idx + dd + typex + implies + exp + dot_comma, lambda s: ActionNode(s[1], s[3], s[5]) - case_statement %= case + exp + of + actions + \ - esac, lambda s: CaseNode(s[2], s[4]) + case_statement %= case + exp + of + actions + esac, lambda s: CaseNode(s[2], s[4]) table = [ (class_keyword, r'(?i)class'), diff --git a/src/testing.py b/src/testing.py index 9ff34e70..1aeb7a84 100755 --- a/src/testing.py +++ b/src/testing.py @@ -1,21 +1,81 @@ -from cil.baseCilVisitor import BaseCoolToCilVisitor -from abstract.semantics import Context - -if __name__ == '__main__': - context = Context() - object_type = context.create_type('Object') - int_type = context.create_type('Integer') - string_type = context.create_type('String') - a_type = context.create_type('A') - b_typpe = context.create_type('B') - c_type = context.create_type('C') - d_type = context.create_type('D') - int_type.set_parent(object_type) - string_type.set_parent(object_type) - a_type.set_parent(string_type) - b_typpe.set_parent(string_type) - c_type.set_parent(a_type) - d_type.set_parent(object_type) - - v = BaseCoolToCilVisitor(context) - print(v.tdt_table) +# type: ignore +from build.compiler_struct import LEXER, PARSER +from typecheck.evaluator import evaluate_right_parse +from comments import find_comments +from travels.ctcill import CilDisplayFormatter, CoolToCILVisitor +import sys + + +def report(errors: list): + for error in errors: + print(error) + + +def pipeline(program: str, deep: int) -> None: + try: + program = find_comments(program) + except AssertionError as e: + print(e) + sys.exit(1) + + # Right now, program has no comments, so is safe to pass it to the LEXER + try: + tokens = LEXER(program) + except Exception as e: + print(e) + sys.exit(1) + + # Parse the tokens to obtain a derivation tree + try: + parse = PARSER(tokens) + print("PARSING DONE!!!") + except Exception as e: + print(e) + sys.exit(1) + # build the AST from the obtained parse + try: + ast = evaluate_right_parse(parse, tokens[:-1]) + print("BUILDING AST DONE!!!") + except Exception as e: + print(e) + sys.exit(1) + ##################### + # Start the visitors # + ###################### + + # Run type checker visitor + errors, context = ast.check_semantics(deep) + if errors: + print("FOUND ERRORS!!!") + report(errors) + sys.exit(1) + + print("SEMENATIC CHECK DONE!!!") + print(context) + cil_travel = CoolToCILVisitor(context) + cil_program_node = cil_travel.visit(ast) + formatter = CilDisplayFormatter() + print(formatter(cil_program_node)) + + +text = """ +class A { + a : Int ; + suma ( a : Int , b : Int ) : Int { + a + b + }; + b : Int ; +}; + +class B inherits A { + c : Int ; + f ( d : Int , a : A ) : Int { + { + let f : Int in 8 ; + let c : Int in (new A) . suma ( 5 , f ) ; + c; + } + }; +}; +""" +pipeline(text, 5) diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 7fe9a23e..340e8bb0 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -92,26 +92,29 @@ def visit(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 def visit(self, node: coolAst.MethodDef, scope: Scope) -> None: # noqa: F811 self.current_method = self.current_type.get_method(node.idx) - # Register the new function in .CODE + # Registrar la nueva funcion en .CODE function_node = self.register_function(self.to_function_name(node.idx, self.current_type.name)) - # Stablish this method as the current function so we can properly set - # names for variables and stuffs. + # Establecer el metodo actual y la funcion actual en construccion + # para poder establecer nombres de variables y otras cosas. self.current_function = function_node - # Define method's params + # Definir los parametros del metodo. params: List[semantics.VariableInfo] = [scope.find_variable(param.idx) for param in node.param_list] - # Register function's params + # Establecer los parametros de la funcion. for param in params: self.register_params(param) - # Get the instructions that conforms the body of the method - for exp in node.statements: - self.visit(exp, scope) + # Registrar las instrucciones que conforman el cuerpo del metodo. + last = self.visit(node.statements, scope) self.current_method = None self.current_function = None + if last is not None: + self.register_instruction(cil.ReturnNode(last)) + else: + self.register_instruction(cil.ReturnNode()) # ************** IMPLEMENTACION DE LAS EXPRESIONES CONDICIONAES (IF, WHILE, CASE) Y LAS DECLARACIONES # DE VARIABLES (let) @@ -119,23 +122,23 @@ def visit(self, node: coolAst.MethodDef, scope: Scope) -> None: # noqa: F811 @visitor.when(coolAst.IfThenElseNode) # type: ignore def visit(self, node: coolAst.IfThenElseNode, scope: Scope) -> None: # noqa: F811 - # Create a jumping label + # Crear un LABEL al cual realizar un salto. false_label = self.do_label("FALSE") end_label = self.do_label("END") - # Save the instructions related to the condition, - # Each expr returns the name of the holder varaiable + # Salvar las instrucciones relacionadas con la condicion, + # cada expresion retorna el nombre de la variable interna que contiene el valor ?? internal_cond_vm_holder = self.visit(node.cond, scope) - # Do the check and jump if necesary + # Chequear y saltar si es necesario. self.register_instruction(cil.IfZeroJump(internal_cond_vm_holder, false_label)) - # Save the instructions related to the then branch + # Salvar las instrucciones relacionadas con la rama TRUE. self.visit(node.expr1, scope) self.register_instruction(cil.UnconditionalJump(end_label)) - # Save the instructions related to the else branch + # Registrar las instrucciones relacionadas con la rama ELSE self.register_instruction(cil.LabelNode(false_label)) self.visit(node.expr2, scope) @@ -145,17 +148,16 @@ def visit(self, node: coolAst.IfThenElseNode, scope: Scope) -> None: # noqa: F8 def visit(self, node: coolAst.VariableDeclaration, scope: Scope) -> None: # noqa: F811 for var_idx, var_type, var_init_expr in node.var_list: - # Register the variables in order + # Registrar las variables en orden. var_info = scope.find_variable(var_idx) local_var = self.register_local(var_info) - # Allocate memory for the variable type and give default initialization + # Reservar memoria para la variable y realizar su inicializacion si tiene self.register_instruction(cil.AllocateNode(var_info.type.name, local_var)) - # Generate the code of the initialization expr if exists if var_init_expr is not None: expr_init_vm_holder = self.visit(var_init_expr, scope) - # assign the corresponding value to the defined local_var + # Assignar el valor correspondiente a la variable reservada self.register_instruction(cil.AssignNode(local_var, expr_init_vm_holder)) # Process the associated expr, if any, to the let declaration @@ -455,7 +457,7 @@ def visit(self, node: coolAst.LowerThanNode, scope: Scope): # noqa: F811 return expr_result_vm_holder @visitor.when(coolAst.LowerEqual) # type: ignore - def visit(self, node: coolAst.LowerEqual, scope:Scope): # noqa: F811 + def visit(self, node: coolAst.LowerEqual, scope: Scope): # noqa: F811 expr_result_vm_holder = self.define_internal_local() false_label = self.do_label("FALSE") end_label = self.do_label("END") @@ -533,3 +535,167 @@ def visit(self, node: coolAst.GreaterEqualNode, scope: Scope): # noqa: F811 self.register_instruction(cil.LabelNode(end_label)) return expr_result_vm_holder + + # ********************* IMPLEMENTACION DE LOS METODOS DE DISPATCH ******************* + # + # ********************* + + @visitor.when(coolAst.FunCall) # type: ignore + def visit(self, node: coolAst.FunCall, scope: Scope): # noqa: F811 + type_vm_holder = self.define_internal_local() + return_vm_holder = self.define_internal_local() + # Evaluar la expresion a la izquierda del punto + expr = self.visit(node.obj, scope) + + self.register_instruction(cil.TypeOfNode(expr, type_vm_holder)) + + # Evaluar los argumentos + for arg in node.args: + arg_expr = self.visit(arg, scope) + self.register_instruction(cil.ArgNode(arg_expr)) + + self.register_instruction(cil.DynamicCallNode(type_vm_holder, node.id, return_vm_holder)) + + return return_vm_holder + + @visitor.when(coolAst.ParentFuncCall) # type: ignore + def visit(self, node: coolAst.ParentFuncCall, scope: Scope): # noqa: F811 + local_type_identifier = self.define_internal_local() + return_expr_vm_holder = self.define_internal_local() + expr = self.visit(node.obj, scope) + + # Evaluar los argumentos + for arg in node.arg_list: + arg_expr = self.visit(arg, scope) + self.register_instruction(cil.ArgNode(arg_expr)) + + # Asignar el tipo a una variable + type_ = self.context.get_type(node.parent_type) + self.register_instruction(cil.AssignNode(local_type_identifier, type_)) + + self.register_instruction(cil.DynamicCallNode(local_type_identifier, node.idx, return_expr_vm_holder)) + + return return_expr_vm_holder + + +class CilDisplayFormatter: + @visitor.on("node") + def visit(self, node): + pass + + @visitor.when(cil.CilProgramNode) # type: ignore + def visit(self, node: cil.CilProgramNode): # noqa: F811 + # Primero imprimir la seccion .TYPES + dottypes = '\n'.join(self.visit(type_) for type_ in node.dottypes) + + # Imprimir la seccion .DATA + dotdata = '\n'.join(self.visit(data) for data in node.dotdata) + + # Imprimir la seccion .CODE + dotcode = '\n'.join(self.visit(code) for code in node.dotcode) + + return f'.TYPES\n{dottypes}\n\n.DATA\n{dotdata}\n\n.CODE\n{dotcode}' + + @visitor.when(cil.TypeNode) # type: ignore + def visit(self, node: cil.TypeNode): # noqa: F811 + attributes = '\n\t'.join(f'attribute {x}' for x in node.attributes) + methods = '\n\t'.join(f'method {x}: {y}' for x, y in node.methods) + + return f'type {node.name} {{\n\t{attributes}\n\n\t{methods}\n}}' + + @visitor.when(cil.FunctionNode) # type: ignore + def visit(self, node: cil.FunctionNode): # noqa: F811 + params = '\n\t'.join(self.visit(x) for x in node.params) + localvars = '\n\t'.join(self.visit(x) for x in node.localvars) + instructions = '\n\t'.join(self.visit(x) for x in node.instructions) + + return f'function {node.name} {{\n\t{params}\n\n\t{localvars}\n\n\t{instructions}\n}}' + + @visitor.when(cil.ParamNode) # type: ignore + def visit(self, node: cil.ParamNode): # noqa : F811 + return f'PARAM {node.name}' + + @visitor.when(cil.LocalNode) # type: ignore + def visit(self, node: cil.LocalNode): # noqa: F811 + return f'LOCAL {node.name}' + + @visitor.when(cil.AssignNode) # type: ignore + def visit(self, node: cil.AssignNode): # noqa: F811 + return f'{node.dest} = {node.source}' + + @visitor.when(cil.PlusNode) # type: ignore + def visit(self, node: cil.PlusNode): # noqa: F811 + return f'{node.dest} = {node.left} + {node.right}' + + @visitor.when(cil.MinusNode) # type: ignore + def visit(self, node: cil.MinusNode): # noqa: F811 + return f'{node.dest} = {node.x} - {node.y}' + + @visitor.when(cil.StarNode) # type: ignore + def visit(self, node: cil.StarNode): # noqa: F811 + return f'{node.dest} = {node.x} * {node.y}' + + @visitor.when(cil.DivNode) # type: ignore + def visit(self, node: cil.DivNode): # noqa: F811 + return f'{node.dest} = {node.left} / {node.right}' + + @visitor.when(cil.AllocateNode) # type: ignore + def visit(self, node: cil.AllocateNode): # noqa: F811 + return f'{node.dest} = ALLOCATE {node.itype}' + + @visitor.when(cil.TypeOfNode) # type: ignore + def visit(self, node: cil.TypeOfNode): # noqa: F811 + return f'{node.dest} = TYPEOF {node.variable}' + + @visitor.when(cil.DynamicCallNode) # type: ignore + def visit(self, node: cil.DynamicCallNode): # noqa: F811 + return f'{node.dest} = VCALL {node.xtype} {node.method}' + + @visitor.when(cil.StaticCallNode) # type: ignore + def visit(self, node: cil.StaticCallNode): # noqa: F811 + return f'{node.dest} = CALL {node.function}' + + @visitor.when(cil.ArgNode) # type: ignore + def visit(self, node: cil.ArgNode): # noqa: F811 + return f'ARG {node.name}' + + @visitor.when(cil.ReturnNode) # type: ignore + def visit(self, node: cil.ReturnNode): # noqa: F811 + return f'RETURN {node.value if node.value is not None else ""}' + + @visitor.when(cil.DataNode) # type: ignore + def visit(self, node: cil.DataNode): # noqa: F811 + if isinstance(node.value, str): + return f'{node.name} = "{node.value}" ;' + elif isinstance(node.value, list): + data = "\n\t".join(x for x in node.value) + return f'{node.name} = {data}' + elif isinstance(node.value, int): + return f'{node.name} = {node.value}' + + @visitor.when(cil.GetTypeIndex) # type: ignore + def visit(self, node: cil.GetTypeIndex): # noqa: F811 + return f'{node.dest} = GETTYPEINDEX {node.itype}' + + @visitor.when(cil.TdtLookupNode) # type: ignore + def visit(self, node: cil.TdtLookupNode): # noqa: F811 + return f'{node.dest} = TYPE_DISTANCE {node.i} {node.j}' + + @visitor.when(cil.IfZeroJump) # type: ignore + def visit(self, node: cil.IfZeroJump): # noqa: F811 + return f'IF_ZERO {node.variable} GOTO {node.label}' + + @visitor.when(cil.UnconditionalJump) # type: ignore + def visit(self, node: cil.UnconditionalJump): # noqa: F811 + return f'GOTO {node.label}' + + @visitor.when(cil.JumpIfGreaterThanZeroNode) # type: ignore + def visit(self, node: cil.JumpIfGreaterThanZeroNode): # noqa: F811 + return f'IF_GREATER_ZERO {node.variable} GOTO {node.label}' + + @visitor.when(cil.LabelNode) # type: ignore + def visit(self, node: cil.LabelNode): # noqa: F811 + return f'{node.label}:' + + def __call__(self, node): + return self.visit(node) diff --git a/src/travels/inference.py b/src/travels/inference.py index edaf08f5..0915f1bc 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -354,18 +354,18 @@ def visit(self, node: coolAst.NotNode, scope: semantic.Scope, infered_type=None, # --------------------------------------------------CONSTANTES-----------------------------------------------------------# # -----------------------------------------------------------------------------------------------------------------------# - @visitor.when(IntegerConstant) #type: ignore # noqa + @visitor.when(coolAst.IntegerConstant) #type: ignore # noqa def visit(self, node, scope, infered_type=None, deep=1): # noqa: F811 return self.INTEGER - @visitor.when(StringConstant) #type: ignore # noqa + @visitor.when(coolAst.StringConstant) #type: ignore # noqa def visit(self, node, scope, infered_type=None, deep=1): # noqa: F811 return self.STRING - @visitor.when(TrueConstant) #type: ignore # noqa + @visitor.when(coolAst.TrueConstant) #type: ignore # noqa def visit(self, node, scope, infered_type=None, deep=1): # noqa: F811 return self.BOOL - @visitor.when(FalseConstant) #type: ignore # noqa + @visitor.when(coolAst.FalseConstant) #type: ignore # noqa def visit(self, node, scope, infered_type=None, deep=1): # noqa: F811 return self.BOOL diff --git a/src/travels/typecollector.py b/src/travels/typecollector.py index b1485ca3..1d7a6c2e 100755 --- a/src/travels/typecollector.py +++ b/src/travels/typecollector.py @@ -19,11 +19,11 @@ def visit(self, node): # noqa: F811 INTEGER.set_parent(OBJECT) STRING.set_parent(OBJECT) BOOL.set_parent(OBJECT) - self.context.types['object'] = OBJECT - self.context.types['int'] = INTEGER - self.context.types['string'] = STRING - self.context.types['bool'] = BOOL - self.context.types['void'] = VOID + self.context.types['Object'] = OBJECT + self.context.types['Int'] = INTEGER + self.context.types['String'] = STRING + self.context.types['Bool'] = BOOL + self.context.types['Void'] = VOID self.context.types['AUTO_TYPE'] = AutoType() for class_ in node.class_list: From 06e5848d363675644fb9e4be9089e2c0853eddd7 Mon Sep 17 00:00:00 2001 From: Adrian Date: Thu, 28 May 2020 21:44:59 -0400 Subject: [PATCH 047/162] A first attempt of pipeline from COOL to CIL. --- src/abstract/semantics.py | 7 ++- src/abstract/tree.py | 20 +++--- src/cil/baseCilVisitor.py | 17 +++--- src/cil/nodes.py | 4 +- src/testing.py | 6 +- src/travels/ctcill.py | 53 ++++++++++++---- src/travels/inference.py | 125 ++++++++++++++++++++++++++++---------- 7 files changed, 163 insertions(+), 69 deletions(-) diff --git a/src/abstract/semantics.py b/src/abstract/semantics.py index 53b96487..abaa2272 100755 --- a/src/abstract/semantics.py +++ b/src/abstract/semantics.py @@ -191,9 +191,10 @@ def __repr__(self): class VariableInfo: - def __init__(self, name: str, vtype: Optional[Type] = None): + def __init__(self, name: str, vtype: Optional[Type] = None, location=None): self.name = name self.type = vtype + self.location = location class Scope: @@ -212,8 +213,8 @@ def create_child(self): self.children.append(child) return child - def define_variable(self, vname: str, vtype: Type) -> VariableInfo: - info = VariableInfo(vname, vtype) + def define_variable(self, vname: str, vtype: Type, location=None) -> VariableInfo: + info = VariableInfo(vname, vtype, location) self.locals.append(info) return info diff --git a/src/abstract/tree.py b/src/abstract/tree.py index 274fef13..bb153dad 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -25,16 +25,16 @@ def check_semantics(self, deep=1): type_collector.errors) type_builder.visit(self) errors = type_builder.errors - # if not errors: - # inferer = inference.TypeInferer(type_builder.context, - # errors=errors) - # scope = None - # for d in range(1, deep + 1): - # print(d) - # scope = inferer.visit(self, scope=scope, deep=d) - # print(scope) - # # reportar los errores - return errors, type_builder.context + scope = None + if not errors: + inferer = inference.TypeInferer(type_builder.context, + errors=errors) + for d in range(1, deep + 1): + print(d) + scope = inferer.visit(self, scope=scope, deep=d) + print(scope) + # reportar los errores + return errors, type_builder.context, scope class MethodDef(DeclarationNode): diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index bc8700d3..428e97b8 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -122,17 +122,17 @@ def instructions(self) -> List[nodes.InstructionNode]: def register_params(self, vinfo: VariableInfo) -> str: # Registra un parametro en la funcion en construccion y devuelve el nombre procesado del parametro assert self.current_function is not None - vinfo.name = f'param_{self.current_function.name[9:]}_{vinfo.name}_{len(self.params)}' - param_node: nodes.ParamNode = nodes.ParamNode(vinfo.name) + name = f'param_{self.current_function.name[9:]}_{vinfo.name}_{len(self.params)}' + param_node: nodes.ParamNode = nodes.ParamNode(name) self.params.append(param_node) - return vinfo.name + return name def register_local(self, vinfo: VariableInfo) -> str: assert self.current_function is not None - vinfo.name = f'local_{self.current_function.name[9:]}_{vinfo.name}_{len(self.localvars)}' - local_node = nodes.LocalNode(vinfo.name) + name = f'local_{self.current_function.name[9:]}_{vinfo.name}_{len(self.localvars)}' + local_node = nodes.LocalNode(name) self.localvars.append(local_node) - return vinfo.name + return name def define_internal_local(self) -> str: vinfo = VariableInfo('internal') @@ -196,7 +196,10 @@ def __build_CART(self) -> None: for i, itype in enumerate(self.context.types): self.types_indexes[itype] = i for j, atype in enumerate(self.context.types): - table[i][j] = self.tdt_table[itype, atype] + try: + table[i][j] = self.tdt_table[itype, atype] + except KeyError: + table[i][j] = -1 self.tdt_data_node = self.register_data(table) def __build_builtins(self): diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 0cb67062..00cbc1a9 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -44,7 +44,7 @@ def __init__(self, name): class LocalNode(CilNode): def __init__(self, name): - self.name + self.name = name class InstructionNode(CilNode): @@ -55,7 +55,7 @@ class ArithmeticNode(InstructionNode): def __init__(self, dest, left, right): self.dest = dest self.left = left - self.dest = right + self.right = right class AssignNode(InstructionNode): diff --git a/src/testing.py b/src/testing.py index 1aeb7a84..0cb54912 100755 --- a/src/testing.py +++ b/src/testing.py @@ -44,16 +44,16 @@ def pipeline(program: str, deep: int) -> None: ###################### # Run type checker visitor - errors, context = ast.check_semantics(deep) + errors, context, scope = ast.check_semantics(deep) if errors: print("FOUND ERRORS!!!") report(errors) sys.exit(1) print("SEMENATIC CHECK DONE!!!") - print(context) + print(scope) cil_travel = CoolToCILVisitor(context) - cil_program_node = cil_travel.visit(ast) + cil_program_node = cil_travel.visit(ast, scope) formatter = CilDisplayFormatter() print(formatter(cil_program_node)) diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 340e8bb0..31906298 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -11,11 +11,11 @@ class CoolToCILVisitor(baseCilVisitor.BaseCoolToCilVisitor): @visitor.on("node") - def visit(self, node: coolAst.Node) -> None: + def visit(self, node: coolAst.Node, scope: Scope) -> None: pass @visitor.when(coolAst.ProgramNode) # type: ignore - def visit(self, node: coolAst.ProgramNode, scope: Scope, local_vm_holder: str = '') -> cil.CilProgramNode: # noqa: F811 + def visit(self, node: coolAst.ProgramNode, scope: Scope) -> cil.CilProgramNode: # noqa: F811 # node.class_list -> [ClassDef ...] # Define the entry point for the program. @@ -50,8 +50,8 @@ def visit(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 self.current_type = self.context.get_type(node.idx) new_type_node = self.register_type(node.idx) - methods: List[str] = [feature.idx for feature in node.feature if isinstance(feature, coolAst.MethodDef)] - attributes: List[semantics.Attribute] = [feature for feature in node.feature if isinstance(feature, coolAst.AttributeDef)] + methods: List[str] = [feature.idx for feature in node.features if isinstance(feature, coolAst.MethodDef)] + attributes: List[semantics.Attribute] = [feature for feature in node.features if isinstance(feature, coolAst.AttributeDef)] # Handle inherited features such as attributes and methods first if self.current_type.parent is not None: @@ -75,13 +75,13 @@ def visit(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 for attribute in attributes: new_type_node.attributes.append(attribute.idx) for method in methods: - new_type_node.methods.append((method.idx, self.to_function_name(method.idx, node.idx))) + new_type_node.methods.append((method, self.to_function_name(method, node.idx))) # TODO: It is necessary to visit attributes?? Think so cuz they can be initialized # and their value could perhaps go to .DATA section # Visit every method for generate its code in the .CODE section - for feature, child_scope in zip(methods, scope.children): + for feature, child_scope in zip((x for x in node.features if isinstance(x, coolAst.MethodDef)), scope.children): self.visit(feature, child_scope) self.current_type = None @@ -100,7 +100,7 @@ def visit(self, node: coolAst.MethodDef, scope: Scope) -> None: # noqa: F811 self.current_function = function_node # Definir los parametros del metodo. - params: List[semantics.VariableInfo] = [scope.find_variable(param.idx) for param in node.param_list] + params: List[semantics.VariableInfo] = [scope.find_variable(param.id) for param in node.param_list] # Establecer los parametros de la funcion. for param in params: @@ -108,14 +108,15 @@ def visit(self, node: coolAst.MethodDef, scope: Scope) -> None: # noqa: F811 # Registrar las instrucciones que conforman el cuerpo del metodo. last = self.visit(node.statements, scope) - - self.current_method = None - self.current_function = None if last is not None: self.register_instruction(cil.ReturnNode(last)) else: self.register_instruction(cil.ReturnNode()) + self.current_method = None + self.current_function = None + + # ************** IMPLEMENTACION DE LAS EXPRESIONES CONDICIONAES (IF, WHILE, CASE) Y LAS DECLARACIONES # DE VARIABLES (let) # ************** @@ -162,7 +163,33 @@ def visit(self, node: coolAst.VariableDeclaration, scope: Scope) -> None: # noq # Process the associated expr, if any, to the let declaration # A block defines a new scope, so it is important to manage it - self.visit(node.block_statements, scope.children[0]) + return self.visit(node.block_statements, scope) + + @visitor.when(coolAst.VariableCall) # type: ignore + def visit(self, node: coolAst.VariableCall, scope: Scope): # noqa: F811 + vinfo = scope.find_variable(node.idx) + # Diferenciar la variable si es un parametro, un atributo o una variable local + # en el scope actual + if vinfo.location == "PARAM": + for param_node in self.params: + if vinfo.name in param_node.name: + return param_node.name + if vinfo.location == "ATTRIBUTE": + local = self.define_internal_local() + self.register_instruction(cil.GetAttributeNode(self.current_type.name, vinfo.name, local)) + return local + if vinfo.location == "LOCAL": + for local_node in self.localvars: + if vinfo.name in local_node.name: + return local_node.name + + @visitor.when(coolAst.InstantiateClassNode) # type: ignore + def visit(self, node: coolAst.InstantiateClassNode, scope: Scope): # noqa: F811 + # Reservar una variable que guarde la nueva instancia + type_ = self.context.get_type(node.type_) + instance_vm_holder = self.define_internal_local() + self.register_instruction(cil.AllocateNode(type_, instance_vm_holder)) + return instance_vm_holder @visitor.when(coolAst.BlockNode) # type:ignore def visit(self, node: coolAst.BlockNode, scope: Scope) -> str: # noqa: F811 @@ -269,7 +296,7 @@ def visit(self, node: coolAst.CaseNode, scope: Scope): # noqa: F811 # Asignar al identificador idk el valor de expr0 self.register_instruction(cil.AssignNode(idk, expr_vm_holder)) # Generar el codigo de la expresion asociada a esta rama - self.visit(action_node.actions) + self.visit(action_node.actions, scope) # Generar un salto de modo que no se chequee otra rama self.register_instruction(cil.UnconditionalJump(end_label)) self.register_instruction(cil.LabelNode(next_label)) @@ -668,7 +695,7 @@ def visit(self, node: cil.DataNode): # noqa: F811 if isinstance(node.value, str): return f'{node.name} = "{node.value}" ;' elif isinstance(node.value, list): - data = "\n\t".join(x for x in node.value) + data = "\n\t".join(str(x) for x in node.value) return f'{node.name} = {data}' elif isinstance(node.value, int): return f'{node.name} = {node.value}' diff --git a/src/travels/inference.py b/src/travels/inference.py index 0915f1bc..9d411739 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -29,10 +29,10 @@ class TypeInferer: def __init__(self, context: semantic.Context, errors=[]): self.context: semantic.Context = context self.current_type: Optional[semantic.Type] = None - self.INTEGER = self.context.get_type('int') - self.OBJECT = self.context.get_type('object') - self.STRING = self.context.get_type('string') - self.BOOL = self.context.get_type('bool') + self.INTEGER = self.context.get_type('Int') + self.OBJECT = self.context.get_type('Object') + self.STRING = self.context.get_type('String') + self.BOOL = self.context.get_type('Bool') self.AUTO_TYPE = self.context.get_type('AUTO_TYPE') self.errors = errors self.current_method: Optional[semantic.Method] = None @@ -87,7 +87,7 @@ def visit(self, node, scope: semantic.Scope, infered_type=None, deep=1): # noqa def visit(self, node: coolAst.AttributeDef, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 atrib = self.current_type.get_attribute(node.idx) if deep == 1: - scope.define_variable(atrib.name, atrib.type) + scope.define_variable(atrib.name, atrib.type, "ATTRIBUTE") # --------------------------------------------------------------------- # Si el método no tiene un tipo definido, entonces tratar de inferir | @@ -103,9 +103,7 @@ def visit(self, node: coolAst.MethodDef, scope, infered_type=None, deep=1): # n for param in node.param_list: self.visit(param, scope, deep=deep) - last = None - for statement in node.statements: - last = self.visit(statement, scope, deep=deep) + last = self.visit(node.statements, scope, deep=deep) if not method.return_type != self.AUTO_TYPE: print(f'Infered type {last.name} for {node.idx}') method.return_type = last @@ -114,11 +112,19 @@ def visit(self, node: coolAst.MethodDef, scope, infered_type=None, deep=1): # n self.errors.append(f'Method {method.name} cannot return {last}') print(scope) + @visitor.when(coolAst.BlockNode) # type: ignore + def visit(self, node: coolAst.BlockNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + # Visitar cada expr del bloque, el tipo del bloque es el tipo de la ultima expresion + last = None + for expr in node.expressions: + last = self.visit(expr, scope, infered_type, deep) + return last + @visitor.when(coolAst.Param) #type: ignore # noqa def visit(self, node: coolAst.Param, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 type_ = self.context.get_type(node.type) if deep == 1: - scope.define_variable(node.id, type_) + scope.define_variable(node.id, type_, "PARAM") # ------------------------------------------------------------------------- # Checkear si la variable a la que se le va a asignar el resultado de la | @@ -182,37 +188,94 @@ def visit(self, node: coolAst.IfThenElseNode, scope: semantic.Scope, infered_typ e2_parent = e2_parent.parent return e1_parent - @visitor.when(coolAst.VariableDeclaration) #type: ignore # noqa - # TODO FIX THIS, IT is not working after change in grammar, REIMPLEMENT IT!!!! + # @visitor.when(coolAst.VariableDeclaration) #type: ignore # noqa + # # TODO FIX THIS, IT is not working after change in grammar, REIMPLEMENT IT!!!! + # def visit(self, node: coolAst.VariableDeclaration, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + # for var_idx, var_type, var_init_exp in node.var_list: + # type_ = self.context.get_type(var_type) + # if type_ != self.AUTO_TYPE: + # if deep == 1: + # scope.define_variable(var_idx, type_, "LOCAL") + # else: + # if deep == 1: + # type_ = self.visit(node.block_statements, scope, infered_type, deep) + # print(f'Infered type {type_.name} for {var_idx}') + # scope.define_variable(node.idx, type_, "LOCAL") + # return void + @visitor.when(coolAst.VariableDeclaration) # type: ignore def visit(self, node: coolAst.VariableDeclaration, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 - for var_idx, var_type, var_init_exp in node.var_list: + for var_id, var_type, var_init_expr in node.var_list: type_ = self.context.get_type(var_type) - if type_ != self.AUTO_TYPE: - if deep == 1: - scope.define_variable(var_idx, type_) + # Revisar que la expresion de inicializacion (de existir) se conforme con el tipo + # de la variable. + # Se pueden dar varios casos: + # - La variable se inicializa en AUTO_TYPE y existe la expresion de inicializacion, + # en este caso la variable adquiere el tipo de la expresion + # - La variable se inicializa en un tipo T_1 y existe la expresion de inicializacion con tipo estatico T_2, + # en este caso T_2 < T_1. + # - La variable se inicializa en un tipo T y no existe expr de inicializacion (solo se define la variable). + # - La variable se inicializa en AUTO_TYPE y no existe la expr, en este caso se define la variable + # y su tipo se deja a inferir por el contexto. + if var_init_expr: + init_expr_type: semantic.Type = self.visit(var_init_expr, scope, infered_type, deep) + if type_ != self.AUTO_TYPE: + if not init_expr_type.conforms_to(type_): + self.errors.append(f"Init expression of {var_id} must conform to type {type_}") + else: + if deep == 1: + scope.define_variable(var_id, type_, "LOCAL") + else: + if deep == 1: + scope.define_variable(var_id, init_expr_type, "LOCAL") else: - if deep == 1: - type_ = self.visit(node.block_statements, scope, infered_type, deep) - print(f'Infered type {type_.name} for {var_idx}') - scope.define_variable(node.idx, type_) - return void - - @visitor.when(coolAst.FunCall) #type: ignore # noqa + # No hay expresion de inicializacion, entonces solo queda definir la variable, y si es necesario, + # se actualizara su tipo al chequear el contexto. + if not (scope.is_defined(var_id) and scope.is_local(var_id)): + scope.define_variable(var_id, type_, "LOCAL") + + # Visitar la expresion asociada. + return_type = self.visit(node.block_statements, scope, infered_type, deep) + return return_type + + # @visitor.when(coolAst.FunCall) #type: ignore # noqa + # def visit(self, node: coolAst.FunCall, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + # if isinstance(node.obj, semantic.Type): + # method = node.obj.get_method(node.id) + # elif node.obj == 'self': + # method = self.current_type.get_method(node.id) + # else: + # method = self.context.get_type(node.obj).get_method(node.id) + + # for arg in node.args: + # self.visit(arg, scope, infered_type, deep) + + # if method.return_type != self.AUTO_TYPE: + # return method.return_type + # elif infered_type: + # print(f'Infered type {infered_type.name} for {node.id}') + # method.return_type = infered_type + # return infered_type + # else: + # return self.AUTO_TYPE + + @visitor.when(coolAst.FunCall) # type: ignore def visit(self, node: coolAst.FunCall, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 - if isinstance(node.obj, semantic.Type): - method = node.obj.get_method(node.id) - elif node.obj == 'self': - method = self.current_type.get_method(node.id) - else: - method = self.context.get_type(node.obj).get_method(node.id) + # Detectar el tipo estatico de la expr0. + static_expr0_type: semantic.Type = self.visit(node.obj, scope, infered_type, deep) + + # Encontrar el metodo en el tipo. + method: semantic.Method = static_expr0_type.get_method(node.id) - for arg in node.args: - self.visit(arg, scope, infered_type, deep) + # Iterar por cada parametro del metodo y chequear que cada expresion corresponda en tipo. + for expr_i, type_i, param_name in zip(node.args, method.param_types, method.param_names): + type_expr_i = self.visit(expr_i, scope, infered_type, deep) + if not type_expr_i.conforms_to(type_i): + raise semantic.SemanticError(f"Expression corresponding to param {param_name} in call to {node.id} must conform to {type_i}") + # Procesar el tipo de retorno de la funcion if method.return_type != self.AUTO_TYPE: return method.return_type elif infered_type: - print(f'Infered type {infered_type.name} for {node.id}') method.return_type = infered_type return infered_type else: From 58070aeec7ace01dd235e9b44f83da7ec8f38357 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 29 May 2020 15:57:33 -0400 Subject: [PATCH 048/162] MIPS INSTRUCTIONS wrappers. --- doc/mipsassemblytutorial.pdf | Bin 0 -> 864382 bytes src/mips/__init__.py | 0 src/mips/arithmetic.py | 186 +++++++++++++++++++++++++++++++++++ src/mips/branch.py | 86 ++++++++++++++++ src/mips/comparison.py | 79 +++++++++++++++ src/mips/instruction.py | 137 ++++++++++++++++++++++++++ 6 files changed, 488 insertions(+) create mode 100755 doc/mipsassemblytutorial.pdf create mode 100644 src/mips/__init__.py create mode 100644 src/mips/arithmetic.py create mode 100644 src/mips/branch.py create mode 100644 src/mips/comparison.py create mode 100644 src/mips/instruction.py diff --git a/doc/mipsassemblytutorial.pdf b/doc/mipsassemblytutorial.pdf new file mode 100755 index 0000000000000000000000000000000000000000..e00949c75880c3f433651e6fb9fed01b91771139 GIT binary patch literal 864382 zcma&MbyS>9(XdBKR<^F@&cMH|v8%bHxv7JhIi-jQ#KqOw+}IA{2@{s8q<)h~PI`y5#Q~iS330#A|!8!R$0kpawiyf->0dFn?LeCDZ7G-Q$U{BLnSz zw_G`66J7+n*3>P!ZR?vY*g_sO`Q9BNGk>22Lu{~hvYrZiqphHT=577}>h|c}Ne?Pj zlIp$aPsGn>7L1fls@Y;K@@BYiP7qC%doTrxS2!!g3WjgmqiqQx4Fci@zv%bIH(_g# zw#+|iPX7q>o`#hD_&BH1ZLe#FQm*MHE^V$WS?*i&OQHYcWG)(q&ZeV$Q6VSokV6$q z*MRl&hGgi+k3&h3$M|?ecSizFeK49MtgfdKm&!}#p(5#0SrXMow0SIV+tKp8X@-9% z;0qYY=x|H+VWuy+N@T_|6q7Z6n?b2BSraR*OIU3MUYhl7)n zm!DG~0!ZtB`+2GNuav7gJD9#Tccs(?I+K*9WYaMBbfwe>V0 zG$%mw{g>tfX#Rg_pymI+aSo3E(fWUN2pGculM+?vE7dZ~IIWCVe%kpN!+U&!!GoR{ z)@jTxJKh<5DlXmChEDsroFU?@@`hhqe^Gc=+mI_5e3>|7S)*)eo-;I5_H=M{Gv97N z^59|Ja?t8Nf8+2ypwZvsvA5rbclo!u{Z8)Po61o)(s12cy*K_ok1d9qD)ZNOXXEp4 z3=Bl>pYQ_wZ;!9;9Oe_AT^}DzQ45dKm!?qP;{KUFsBdZWbxF9)Z{k*(9|-tP@oc6u zKXy?;H0LJKw!HNB{7=OELH~1?=V>EXrJch8pF5}Ivn8t2Cjzp~0V)Ibo^;Ke_%{nY z7k0MkI}eTQu70;bg^26(^VtKp#x|owiaVy~@gP9!2{eg7)UFtvthg zj<=kLonTaG=W*4qQW5M&@~0y3r$E%-CV%v316??mo}kYY?q>ZZGQ50J;bpb*)A>jKN-+E;3Jy(80WW< z`q_C#D$bDKoL)u$Xdxo}ZC}QT)QO*{y7tE9X95DB6N!FCuHPjwaekt#f95COz8AiR z8T>{j>{fr`N7%BIRWB@X8O3EWz(GKEH$ntQb+h0~kw_Zhb(&P;y@z5sVk9|4onDOF zxj>_wGVASmFcAlLt|y3a@?a31Dv#~hEBaKv7kaWCkPY@)s;Rm6VO0yrRvC?) zR2qg7-R2wGCc_VDjvP*Qf6hy!(9xi}s$^}*dPl2)t4?iddh9gqqc3k}o7x`&PT^kt($lHpoGlpkYU)c5j2xqt@9PR# z`I*~*zgL2lQC<&}jMXD&+n^m zSoy0%qEQ2WemG=ha7T3GbkD^#HFfyh-G`UZ4TH({<-u9+h+K0|SEm*CYyWrs{4-Gn z_}kifl(d}^Q7jB(jusI+d%uwA^e_*v+gv?+BKB8id>2lv2l|}S_WAD|zG^dD?xg*7 z3~%`JFdmAtasP(k%Vd2!8Vkg|Q`IdhckJd`pyDS>%|!AKtY25iTT*|hlCZ=K1>F$u zFV!dd#XoCmKha8k;{AZAQO%=vo_cO{kI~Ci;Y}VJKB4f{BArY+P*dOb!%4N zR^~_}xhZD7Q96nQL@c3M553XBt&RJ^c(OAOQ9_|-@5KeIfa0+7rlPZIO6oHLguIch z$!Z$JdK|oAQ&YM1-zk+CbqhSdIKRu$_QQLn{>s#p9ZQKaBLIu##qUV?= zi?=F!hDj1#VBT(?z)lye=gOJS#JXu>28Dq;V-iiaP(x$mnF}>G1*A2_uuqW!zb^XTjH%yjrwJGln|L%a77rmM@2$g~q}>1lvXu zjlfvYXRPJNl@WeN*mgD{SsH5(>)(?$~Q(la* zaS9#>Y54I(^>@W(0atz)#sd|MOD0vh=niyv?6x$^X-QnOPf1h6TJ6f2xV2t`nw{Za zk*bj-j{V}6zWOAOd;pa~UN2|-isJ{z`pQYcu6K+w;ux`&N!C-rt@j+2qKaye)$mL> zhFHUaSGY5!2tjIfnxLK9*TI}1R_1o;h{UKo)Ic%<9<@M4ViQnSW8EO!Co5UlJZ5`p zS_?QzY${^9-%Rc~Nmv*#6G>2*3C6dE90N=mYV9jiOdn3IVeYACknZDZQaxZx~d8VX6u6)X<@XSaD{dCNOEqHJCsTVGrt9ygC8)* zKt$M|gBX~DA)t{%F2yVb)z{>C8Ioq}_8mD*NE1}4$pfgZdD5=1P`addcj)g5_(U^$ zs-@l`#l@=ymVQ8nrJ5bb!FQ#rr#3Tc#~s|0d|$q+kr15DCN?sa^o?JYAmO<~li_KM z&Doh=B68#{N^x|?VNZ7gY~)YNZ`mS09ojcv&D?U&Aovx}dEPno7*J`HKD%8FjOHuH zKx^A3Lehw)X%J0c`DGR!5(2tilAA5@Yf6BbzYOFcD2)=0NSjTuu(X; z^Vuq+k0(w>wjW`|nFxv)d5kbX{k_VgU2^bTyg1ZaYzk+tQl}&d!HfKn1S49(Wbn0$ z^R14n#WvvM&HU!k0D;?BeTHlNrR?%FA5(_ShPnm(!ygpj)zYU9(;?D(PtRGF0xR4n zuXafqRm2e9|1C8u1M`PEEtM@UUliRF()$rT(ORX#Lx zx1~Ju1NgjJC>L5&^Osd*w256e{9j3t_ckaQZ9<|f2-u^7b$(tTw-9kiQLE5ZDU})2 z=(V9YZI2L=1#Pmu?RSOq@g-8u43!leAm#lh#rP*>+dE=h@7Pu?xSi=G<0lzi;Sd5D z6DD=aUax8gIq~`j+WEkzMq-hxai;e2u*b7a}P^vKou<$jsBU4e;`<& z$MYbUemhbo#~0dl%3yw+hA@RG$}b!7hS8nWVx&FfTFCrWD1o(ZM?5ZyJQ zin7<25hHAqMvzU}n{&er^#Y|xs=;z0Y#^#CP!BJ|U3=k)@m=B@gLO@280IHG4FI7@|K@BS$pO6;6P9lNj>B~o0r~Ve*4|Q?Omz=xzD;$1V zoJW(>3(Tb}yAS*J(@3XR&;^xm7?^86av@p73QanG6M@6fg_EL_J3pJf<*^K}u=VEZ zfC2ot9om~f`^sowAR5a>=p%0eY-?FuMx6fAab~NR9Djzu)xHjnWO3P_8D)p`&}9F+01_}KxnS3C%>UUV&3 zsUS6WF|P(@CV5Z3Z@Cb{0=<-6lz7v_;)g5)!4@~HL)ial2^SAS&S(2&(g_3iCfFL1 z$0AM6aS9R$1(c3O)tV1(4|B?&_Sa^VXDB^Hk#4A5=4arPi8x9HQpwjq!9BEDwLNJ> zgs`asJ1u{%GgdYhNc-)929FgCA#;0iVV$Fe9Mz)Rb%6})+vb%bgiR&fLtf|5MV4uO z>D3xH#}7-8Kdl)ShfQwPok;$uy3ad)!*?Dne;l3}x+t}wJcS7@vtPvi)*z)SnHC_- zAx6#c@MBQEZ&_c?K`OZt^k_n%-9qj-6^wB!Mp%&kwA(>DX%%$kgq@AQ{&g{gRz5qw zdlZ>GFHN!-p#-^*v}h}R8di$*m$qUNh8}7(}pv8^?19=>fgTWsu z0A&o?z1a-!4ubWIvJMn+aDmDPBGe-ByT1H6!iSLx&~*fBgYzV0Tar>>HA2-uJ005- zaxkyDgaYLXT&JU`mqEdVS!f?>HrQ1s!tepBLWY#{S{NoZ8LAVAR}1XxK;l1?5Fnr* zfI9(*Eb|f}y%eu~f9s)%7Krcn`@&^(cDPmr~ z3#UWt*(oI#M0#zb1DsBnL;)2Z4?&dD+va|S+NHq$cP%p7Q?W%A?Amy!wgE?6b0HlK zOQV_M|B3hsvKt46$?*|@DOoBGNdUvF^57%Mj+0=)wmN(Rb!72Qy&os(2TrFbYIrTX z8&ExMG^SDgBfP4t$#~lxel-nxB2|*Sk>nv1R3%r0t)&L=%+l6WlcVK9RF$Z8F)TEe zej-2soJDfr1*Z*YBlVX+Zdh*7TwZ=$x(?leR+xIyXzX=;L2^+>Xx3-}yan^KG9Yr7 zwqLOcJqff)Mft0~z{kLT(1&`i{!Zi$BC2=CP#vYpsLa6cb$g-0M7_a8=#221u7+96 z6X}T?iQ;+vvw{eqd5KrC_2w?^`8)3#Ia=}W;XK4UeCv;O5FtTck}0>w?VWMMxUk+2 zH;F$-uW0x2n1~~=*W0~&nLWKiusi6$LXRpHXHUQH1{>b_K8fIwGwNzPofU$~P?rz} zw=NPz4{=_9a7@8{efWr2g`180xw`hu!|Zg;3+;6{+~v`2<19l&B+XMJ6B28qSa=A$ zk#pjA0(3MX@;rC^CIi0Lr&%CZ>>|sggD?p=6;ja%qvrB|NSHvPXg#*&C*J|%1~OHh zjb99WW+K7Nvayt-`Lwj57x1DP5{oc~6Mh%ah~z|p%Q~Mx9c*(e0q#is`|XkzRtfJ7 z)o+3@xB>-0bJeWC2B~ELIZPmSGPR+Zy=V16Yiyz#Z`=cA{M3EOao{*~E*pf3jX@Me zFrzzZ;ND?5b8IV=TG}0J)>Ty#OJf!Y(+ehyLV-R^)#bfKzYRF5s&#>#{rlwd=e3A| zkdsGg^ROzb#n$*|tra)EJT4AJ+Ys<7>-nJmqCh}LRC<~O(g_V1)3AoozNhR*J~q17 zJ4nOjFq5Xs7ENwrFME9b%BX>3NGUUqEs+zO z$!H7853zh(yIe9c#O{r{xE$`@GOVATE)o=})sZFq% zfBX|K(^B!_rd=1Ebs@3uhvEVpy7&)@(m3T-HOIqhhTkyO1cv9c*tS;LIq%auNR%$q z*6n!>Dso_CFVkf8eR^^}{m9FJwRfysz_|d;;;v6!HOb)IA_Hc)A3uqh>)=;IIVnzk z_RfUtTKzYhU6_#tYPX{#wurd5MzNXuey6kw{^*^2R=9#`j{_QZ`yJa%dCjMlRse z>h%~WYf(Gd)O!KYyjSitDS51eGhMj|5v&AavlsfYN)sli>|ZZ=Tcakp^vQ7)q;*)V5M5xz6-QC@Gh;O)zVF6`DAACAe?$~t;^t&K^} z{pO`w)^4v9}w6=~$$whG#H@;z4&*dlGz^n3=OMX*A`)Zy8Hyt2Vah9_M3!27| zte89z7Uho8u;EHi-oTWXE7GxPN=1c{m)o9%_phcx&&%(nRf9;hf(k($v}!ZN$DQhc zB1=__>dA+b;wD3_<9Lm-K!EkHpDWB2csXaS?S4cznE%1;7o~al4knz&;nu9pY+UpMfH|eM841 zONXeW6SV@OwGOoB111tAzr`&pt%AxJjf}y(giz56iYT2zErmErDVW}0vA=)Pikcv^ znpE_jp<}2j0a=k-WaN}mVpjT*YfzE(mBEkr`}^NfI#IFg$0LSI@jaGFXERVzB3R+q z@qWbR8MR4A5k?`6F}nG!sq zthSGfpfb5o-0mlQY@-ii`O!uad$BahmVxRrJ?~Cb3mH|EQ)C(E&>H=IzlN_Dg;B(o zie_o_>V=z0mSyDG5)eZuxspsWX$_y&%>%4Z9YZwkmIwSMXefw3b1`7rLoXxDKko%f zQh!DP&bj2XQflA<(1LF!N!e;Enx1S38$1O<#GluKFirEa3E0C>@ zQm93eBW;|t(aCLBQna>Mu#5$5zu%?qE>h^OGeU}7p{M7JUHf_^QIZ{b__Nb;#pB79 z9Pci1fSnadon~Nw{cw(i|IeX#15%X*kF(FQ8b%(fZW9zG!bny1Rkx?Y2FwW~5#oxI zM@l)@aH26?1+PK4U0(fD%`p2?8H5NQcJE%fKTAJc3TBGKGTqnn;0qdGSR3#KR3Z!U&Q~c35AK?pa87c}OzZyjN02Bpk003u`wVMZ! zS`Q+89aUN2Lp)IY}-S1!8-II9L-L*R#whkl3$&8R#9v+42 zlM4GXB1D9DoVNWw(&6=0mBI!kCnKC@T5{<#^xZ-qj$GAS#MYCHOw9g*K$&8*D z&;P0$a56pt?>7N$X%Zie0W>I45uOc_=f8X@-6CT!U~gK)rsV3Ia%N z&s>WXumVFsaSE^&FDUZglmVFWyYOBZPFimwO~5ehnSVkmp`RRP2Xv$$-T1{M{6vj` zGn2jK1OOGS+DkEA66eU9@`u4wCbLgys#M+1AZ=iFd}JmZM3Ib1Ls$&i*OBj$3Z2WDz04A~xH zlezxfdsuE{k|s$^3n`24Vwfk4c46Qjwr@VbKG@|fj`0ib)c9UDHvBc~97w+JcSzWk z?4(>3`{T~;AhupH=v4Kl)qrEKMPav7^w>_3%Ui;6uYW82c)a^)&}H$%P`_7-8q8Rs zt0j&;!$x&3W-%e>Tt3FhTmqjvW;Hr)^GWaHj)NC-R#1n>`*e8Vts&cbnRU-)m$f0F z=26%q@%-e9*Yv>5{g4giZs+Ht{1`_oT|vrapxa*h4QS(FkesQTz+keWrroeUk6ly& zLo1{l)QSKBka?vKw0=U$ND&S}6{+?|>#~ev4rP+Ck&xhi1OQTt=GgN(yWyaK6&JTw z0@_vq07AIr4OSL|Z0JmvKE6ug0C^SS3Z*}|o>tv@gN835Wq_RBm+`L?_R3&@Ssgq1 zfr6?`T`#o>dwh;0jjTIUL}tPOqiSqELYV(H`comvHaswj`y@RT!F&>0^gPl}DU)Om zyaoltd4NZMZo3|+E7S@zYY%T6lCYlYqy_zPdb_t$$?@Z4CvEt`r@xK=yAlfwqO!?N z;H_CgyTw$_!NRUaRPZBBDx7Pqf@JOxTXFxW{V@(cxxhLF(Uroa+>?#@$ {zmM-M+H>bm$k%Sy4|-yV5yPu-=9*+zv-5^)ZFev_>)$8G`hw4ddA^_Is}eE0 ziZp4Xzu$Q!%KrBdKFwDoKjh3zYy+UiP|8$Z&^f%tpCTDTSEj)j1L@2H~RV>GIbz-chNEpo{+_Y0Qz>T*q&1K{&K(gjk^>{_;J5C9eav~Fyg zWa7@!a%OL}^u2ftQ(o=s=%@}suuvo`nN-)+tArHjA761p<7HSs6#A&-F_KF>Z{Wmf ziU|`~-J+Ej$^9gFY_h}wTnd}1c!acd@c~ys-UZtiFn(bOfSvrX|GU5Q;bNAQGq=z| z24*G!LPL$Qu7vXo0=Okcd?r>RxsIKwaS=Yg%LMr@x1TJO?7QEA{sSg^xN?+l8)cCNE$lUquEF3pRO1>xSxug;q2&iX442R zkOb~b(>2&kG@_h9o|^4gBDyY1GJE`v)eteK^;_fZ-iBZ$N3b08j$Laz!Uz z9whHrUmhkQNogj=tiCbUL9pv z!QZtpfQ!zV1pz&gg-Cut z_iZ^w#xCVo#TL;8V6lhI-*+*8F*#{#LfH%5cwQuwcF2Adr*<)$TH@dvZ{8f1l=Hf> z2SSOPq(>|&LA56euIR3MhQuGkwCE433AX5r{OHJ=wt;PMgkIMY9?<~HUn~t5X#apC zRt%CV3gmHujHcVF2e|f$Sgs~=BIW@4(1Xw+wL^$PT%rpP-Kk=u4F!c8MjO?l)*V|A zvhQ>LR^%m828SRNL-*KV!u?2AGa_1SR$c|%zk#}2!lPl6;J%Lk>iy6`1m#^0hrd)n zFYiaFZpEgJzY1Go^;#-B6&*7!SSj2!XTwso$D-rq6|hYh`L>jEyM#;9(B6@0I&Nq0 z>+PY7_+-DVH2SAKxmp{40q4ENk^^Fv#k=(TP?Yx;`IBKdimXFYwc|v2j=_UcP0KD| z;NoujTZ>9#mF!hTeH= zv?VwX==Epv33bpk*{>^+0u}|}P%TmdL6Lf!;t8JnP_1`J&YR5oPuh+2Ck=LU7|yFi z&V9C)8mqKVU@uOdDGCnxvH#CdfPbFHUmoOn`8hcLeWd4jdA$GkmHz)F8i3=!@d5u| zIKV$I@&6+p0P?@Z1H449{5KxppPK)6^?wft;07N4IsOfcdHwS7-@pTD-j|PmVg(>< z(mXF8{|QkL5&56Jy#x*X+uMHw1UO$N3k>!D7G?7iAVBuRX{FuJDLnyYW#mT2Jxbxb zvwVYT%y(uzZB=YLE-I`THzHM6M7kkg$u=JGq3S<{%MJGX^o*h@nG!%j1>i zMsB{n{nqlb!Rp%6!S&YB+S=;=oyd(JO+d?o&{n|Vz0ds0s(Bi{v(sPsFBM;r880t{N)HL;D|I!89>T>hag+ssv;$6;Kn^%`Zo4<>V!}xISX=S^g z%l*mH((^!_`j70osk$2{u%B!w{LgiIHwQ%#SKQwG#br1bcH= zmot_wR7`sMZ>FB-G2RS0JnPw(S>5}*Q?jcmoo|n%-($&}039@+OlLo-{P`7g!rd&b zVX%ro1G!s*+_msePVe4l>bk$GbMtU0Zn_Q+H*TI)$�HitU+Dyin7#*ra|+{nTZ* zv|MaVjIvqkwe0>0b9&~WP~+Iwa4nM__1tPHVt*Aa1vY#1+PE!YRx6m*>Yi_9*FNj} zFA=31@2+N7n?H3&7oH~>)q>HPwkKs9BB(Ta6RZ55NDYdasYm)NYrEE;xq<61bf0<0 zUQ`rkOQnu=hKe5Y5Lj(tMCGmS6vT={1Up z{%;rBx!_sR5zc$XcG2|OpTRfZnQq;D?tc=C+&4GRzsm)#S?O|W3p@pq=TPM&!Zu2N z`_xKr>ZPWXyibRd5nkK%?qepHO{$M{U;9gVrmy`D<()pp`xMokuC0DHbEQYe+&la{ zy4SZNkI>1pi0rmXKB%3)YKBuAh9k4!<5rha&YPd6@G_!Is4TxV?{Z)Ug{$Uhmpe>2RA(hk-;`%~cGKyo-gy__CfojbXqO;s=74`$wnkGbtxlOlV zFmNnSldHtM_bpSax#~gx<7s7211zW5 zt7tci?JPAiLjnZt zfbS)yi6epBj0>_tV()-icj@{JwTcfd+-0+|)@2PTY8AOHf^x|vkWLm2$Ha+yWrio3sg!5~@vHUeW~cX- zy!F=&5uSG*xV)oZEf9au6-HLAA?E5`cDOqx#dWX{kCiOeUj#2{chlL%FXZg{FOP3VRz^{`Z&sF-hKa^Dljis7ss738KJqFo3LkFyk7VDzct zVo(b@Nh@)N$9$!+hM4lz*(YR}p&~g=`&!Q6_9YUiptVSjlHV`bG$_o_z7*GFtGy-c z7F)Iue5nsG{2D9a58=?O^IMOGd10u{R&#+j<%?XhmHAH#0E1kgYQqXKH&&;cIa-&F z*SOkyn(1ueMbVg_GMpcXv9q%@wI+$o0}|Q)z!veBYh!HvJQCwhQxV0wus~8W8_Qe+@F)?uFZLH_?+<@imC*`wK z1O%#tvS!EAIG?q5S~2DbWjGE3ihIa%6;hp6nD@5^+<0@Q%Wzu_Kd9`8%dSf(jZ{Hc zJ*Abh`kUnN2nd*R*{Rx&xbsxBZp6I9znMcvzJ%m`$Kh9`p$YBETbJYnZ&Tr-bEov` zg{o?4`1lb+;`Rs4e36t*WvRn(O;sI2pZh3`T~;-|7ydw_U2Fi_v4hT(YY7H{V!b=T!$UB$weRa8U0RI}Y6 zd=D9Itkz0dGJJa4x%Z%WqjTus>8>_Cc*okmbyr!?yHmpAXR{wAIDr?^=yKx!H@~U< zK3L-Fe2+aS`0@2uy8@3dLacA0kBXdM5@bJP1S2c53~GGqXmlNfFH7RjD+;bU*ARg+ zU~<=rnj`E_(c$d*Br{f0l5b*1n!zf5AYJ0MJJ}{Ip#CiIN{iRC$rKY42ABR5k=uZqWQ3(xKkVEN6Y$YjJ4yCl7JE{yR}f%Fv~=Kt4&>FBHVT z4ZV!-#BVPuCpypfLP*vk+6-npTBHh}_rnL$XPeeqDeW|?48~4--8~1F7SUPw^o-N0liHHz|ly8Q~(Ff8~aZ>eJ1&E+Zm zhT=_ubP)3NHv*B0wk>GYd@bai0oxqt}6Z7%239w>Ish}e7h`n?AOU}GKamnO~73bP9^4wqd;m-J`Sb^WLNlo&%x0!L6 z!)s!lp6SXjqNfh(oO|w`-_1@fWq7aAPCUb#i=12|P;6Xnx)lfLffBHio)i-@{Rc?-oi5LAyKuNtftd@2={XNVjHmUB; z13uE)I$0u!{9C#F4l*hxS_-oh#<%ZL$TRt3pIDhD9tAxD-?@-UB1S^$8T-izfhm6Y zdM6NxO<8sagZWwXNQ=@HPZAz{m_rUqf)U^M*(BEzGlTueP+k4tPHsNMAtXy?7LxRK zeVQZl?`dk&&(QMMR2&|i!U=Ih5}ft^r+`aU@*qz~0!H1c=w)4p{KI80(I_7bu}}X+CKcaubH15~cAu?qSG3HC{AwDH2MLlzpq~dXyJGjdw zSEz2dY0eI|{xLLv`ggh|fx`b`W9Opy=C?p0GBMM)<}W{zwmgMqUr|L{bxEQ~&G)?C z0Dc9Od@_YLCXwQJ${re+LK6PkXW|Y^1%X==A$gR{C~mM^N&_aEA+7rvwBoZQ2$Rr{ z9NYAX?|lKSFo^`ujzF2;K*5;X9I4>h0%D#D$^OHMheBq7)}LvGpj9RV!bWHX$(pJii9VwA$Y>B(OsxD@^vM6HQ|PAf#tU%3%D=1r z5!8sRHpsy2*iW!{g8Nlv+>Rs+ibqIMkcSv{(g@$Qs_$%y^5$2olUx^nXvs`3b31Ym zJKe`7hA(wUsm%A^nsXh631SuxJPI58k~}JN-+cO(Lm7g^7)%{&p&@j>jvsTyN47Hd zz4&?;bz43$bc9g8aI0H^WuW}WX;wAtR>984Jnz0F8yzwK$szrHd`8I-SU3A2Gdnh5<6ZPTnJdY*B0NB#P!(0^rU!ulr>pV?~Y=ErzxF_N6W6I z#P))m_!aoy#!!ca1RIHe?nnJ*4Iq~gS#qx0vXwkh1T|$r?b)`Mlk2b!4;+`kmDqRr z&D!u6hAAc`JZzH?>$rgSY|gtxIU+e0_VQoALSupAthBP5pxpGmLd12`{ zIvMW&zEValQ4nJlevf7pdv8P9kH~=RHgEK*57H(2dj*C~*whl7o1u~Df#m$>v!yN~ zf&gOc`=w<%6#2atNWp7$#T|rf-rH5)`J| z5TFiFiF$VvP@o@0SP`Zb2q14Ge@=56Byl8$naWIZ`tu4lkGD~%Qj}0}poJ!%cR8n@ z41DedF4FRm&OQU|0(_Uf4ofg0Lr_&F7Pp@Q1`pHV+UH>jQTORt#kr3hsv&u&nVN>f z2Ngd@C^(XU3<#2j=;q~m`DzQ_Yn+ca5ZF_C*?;)X^Qg~$d^Z|Y6v ztvAR`Z;$QUFi#Yjg3V*9m1EhE}4<| z#I6kA?{JFV-Nv-^Am>lb=ij~1R%>1k94Dmh#&JLm2$N?dh&PQ$(wJnO{Lx6@ zAW_!F3*p6_PGS3ia>}h#x&SV&MnkE<%W#DInBaARZ(#O-?%>B4k@P1XY^ib7wz_4H znUP!ni^iM%o(j{yJEhSR^BX3(-FTB<(Ytc^FU+vd%@x z#9F37EYg4bHdYqWG=iUe$tVhjjf`Ix0u^AAO1rFuOjANSH?;L^gYhJ(_=I9&@U+Bm zgS%@Ri-Pfb&^qOEB+mG;HD$hD)~m;AwZ6;a*pCA>>ZxM+4yi=V#*hLY=hyR8?1c{`T~(B?KbX|5fj^Q z9Ood_JJ-j}(npKmI3;8~4szmdL`5(30q{2Qb}Yn+ijjOSSR}GFozHgAnv zf{&4;=-)Wo6;lLh_|Ub1IpI`I*lEHCbJ{N9UDDj@d$VGhu7H~8Su6_F5ww= zR6W=@$|(hcyVw1(BxM}0H+sFyXn@rNI5-AWB-4S)DzBh{d*CrRU>O%1Lu$*ll}k>^ zA`1aA4O_38ppWW=6nq8<>DdTz5>mz^Yq8nIo%j;I*JwGJD>;?Iknay+ z4NI{mLqRd$yqGKQE~e3;TBjPoObEvm`O;^?i?~IHpuDjHyp%tb0?`*BAiqgqJVudhbt|QK>l!9;8}ue-RnXYP`WOL(-3zxC2d$;e0C5Tg7V%Dq){@4YX}Fv) zxhDU^oj|zw;tV+<2ksEhM$nf!eQFAiQUW9bUAm;-vl0P-X{J@(el4K~Yf@yyW(d{cIS$gWe z!(VsuT)eEpAT{L7${g03QY;1%E6rhb z^=K|K8QdZh-49r@i)I(Z;u_ODQ$ntvE>fIZe+cRQzjg502$6MvqQeUno8N-I;r_Mt zjv@qhHo!|H+_()~uxom{0if(>xM-*L6d4V zNTO!Ju__k&*-=b%F~v1b^h3MSG8$H-fVsxCC@3_e56EM+%r`q==4<)%UL2psNN*%3 zk&%^~GO@TfCs99Q0;dLv5?9>ak67M2c1@OF5tb=DK0!Dzf6MgXH6Lf!!|T+`g;2BG z&QSJfv7p;u*{3a@I$nNA;$Jxtb16b%k{Gmk88VcWsKvrJkNljPqJWS0{D~tU~BC zW+Ob2h5s@f6MTFk6>1;g#CSc2m1`>|((Uf0eJW4U8)K4bO-?=TY`)gO)DK5}>dypr zSY{ygvn|3TR?V{HP{#vC_E})q^Y#frt#)$MObLr!TIcw* z63;XY&_(zJ|5XhCF}$*xGLBlJ+$ZcAg;zElGWkeiJ*{)=uH@qL^d?<<*fEjV($@KP z)?DPxC$)%hl}*u&n`3Sz+%Nf0Xlwn9J4fr&s&6B9O0Lr@IiGbzf-aaYiTBTJ=>(tc z)HqfTJKtt_{&G}1{JIC()@_@;^7KniTF*eEN8;Ydw?WTYCu<0F% zB(Q=r8wgL)%C<0$)YyV9^Q^$+#M?3&SdKo5!KVp}p1;p-s#-&Qhm1G(*6tRFko@9i zKHkopr@5u}L1+-!Q~9-S-i#IOQL_ZerPcctBRo0(VZhM` z!Kw6!P;<`Sfk|@G?prE(uBbs9-}c?JoJC-HM^CP;KqdAddV1j5n8OFUWN~nhH2`>rbwFeeN*9TsQGmbK0WJi#FJiTVQ^hPi*2lUPCfg__ZZMO%1q!9 zr8wL3aLrzt{TRw*L3A?vR5r+1uwTKgP#V4uMig&QOQqNjl278tq~f%zny^az?0?x;-`Na(cCES>StWy^ZDOOc(-d z!&BKcO~>e#1BWY;v778w1xYp8D=-!_TBrgsk$|RLLUqkRWj4)`dF20aBHe_M*0M!MvoHoi;lSSL!8kjbdrM6eb?YgzdDr)PTU%?kTd z{Fl~16I?`zuI!%Z1ybu*5xR433Pq8<9+j70a*h&J8Jwt@a^h3@YLlTX~($Ed)a{Btx};2M1D?RRUq2wiM+IbVx$~5B%*h zWv?g;uJ6gIO1zH#Gwo-EA`y&-AwKiEdQ{}{CUgn`HjX=}J&#AlN`aQjqEY63pAbKt zjrbgJ%V>#RP|*5!%9-3B-w5BI)}w(-olC=Otw2TJpVgSg*QobXx5PqZr2EM&!?D2R za)&Y!LRE*UYKsF0oH08vZ!3?58=}KSsHR{#IgV47WMSIYS~NmpxIyuSn*WvO5DVc-1$D4`&+VPWVb3LtIU+ZgwFb@Qpy~6>{AZk??(lH z_+a*ZQvE3e0vr=HDQHMdFt)q;PB#vmCvI#}3pphdg*M=a2+i9zuKHN;1xjRQZac5Dd7d9lam1)aFox;!UyD zI8->osY_U`a2Mle(SAshghm!ykWJT4hca+!P!2B{9P5&3v;)KVOq^zD?QdQr~i8`Nz3YG4wmD!Qzi|tzz5e z-nY(czYw4%l!9J6KepkPwV5B0lM}&)!)>!ox{bBHZ_{qmg;2X=zA(O98iweg zC{}hq8dE4{7=27I-f2`D@4`4QYxer?fUIKp<1q$~(o=okPg#G_59I+@m4 z>v>pOai*A<@LMk4{Po+DwUo}Z2a!>-{YsFJG^~8zKEH?x2lX9loln0xY4`OP^Ala{ zY3RH>kf2DQ3F<=HZcm@KY_BzlWDGW?n&51`q`4pu7AtDsW1#(Cl)ZC!Crj5Z98EAW zCbn(c_JkALwrwX9+xEnm*v7=RZJl5C`|M|*@A}?z-sk+)b#-;ss=C*zTC2P7Ufn*& z?!m=xdL768QhsUGn%_Ju#@No>9%5_iMV56Nw|aJ?f5@_ep)I;D@cB|vt4At|EdzeL zZGvnEG>pAEaKAsHF(GtE@2$L%sa=WPg6q@Jh1+{2Rz6=nratyr`PSLGT#+E+cl9Ye zoD@vTx&fie#N;)hG9N+V@3&Osx~iE&QF7_^L2Fw zjZj~>orH|2NUGxEF3xLExKDgE)Ep&SyH9B~{hl-scRgi`l^c1b@}p2m@tDyTO(9kV zEt2bThg7iJd8Lt-=D>SZ2z!OrLBi!UWQ0k?y=l&=O&yblE7V|x%dF$T{_r3@n$%>; zlH+>kerxepw;3k~^5OzPLv&VMihP9@Y2inXDBlx^|qqRQIrDROH;Vq6M*Z z&8Q#sXNq1{>yQar0b;*JzXZmM^g{0kJ1UE#ItUZdToCO}-xmnuOH8}AU|K2peF|@C zi^KXrLt{nS+a;0Rend+th;SywaOo?ciA3Hu(=o&QC*C%-u^bcw<$)y;{h})UCB_L} z1Zb6Fq1-^df&6AIp=>vVMF!0Nx?o-@$N>wDSe`W#sIIYqzBA0{)9q@;Y8Wr)>83d& zhr_jjy!pw8(D*&ggi*zK&#ex?t(bdlCbi{>W_-M`^ulceapgOy!noBpJh#@gFxEx~ z=drc6`Ph_A4*4SSY`kC6Xq zdjMWP9ChhlNUD{!Fa2ZlUSC0tE&Ud;%DP%FO5A_x_eiSM>KN;D+!dybpEagVIWyR@!1^|;8A ze;Bu0W|cb$VbgZ{Cnqcj#K}wNFgIeV-7$fJ1O2Ity|PbOV<=7}ESk_5k9)XVZf4F`vMv)%GjVN&ukqH#2Vom~y!i0id* z`?|Zg1y&8YN|DO2k~y#{x9sDAo`_UpbeJ*?p<-m@20PQGUEsHJIxq8%aB!P&YB5G4 zii0!RQWe&k@m-upp!GoH<}m51olzMgneK(sT-_Sl79bTGbx>4Q+dLu=bY5(?i)A3p zdK{3T?bA6-FrD>eT*(MG9t^($o1@!un5WjI54fC=upAf2usf>7a#^%q79pB6hD@wT zli8&yH25HFIPscsDas)K-pu+WYBX7kdam_`WjEqL6{Ds<8l14MNMv1}kOQ{XQz*95 zuiL-8gt8UC?6qyB^<2td30uI!%! zqhsIeWP7qvt{87LpT0|I8f8)Wv>Ll_%GsS1>6z>gUlpsZGM~n~BfbCp24K6iqmchI zOu&Fp`4&63V*oCI5E?L%x^0S;Pb~gxPPLYMa^bEVNtLgq#8m@~4=_wOatoh*Sg$dk z5`3UYrHguvf8vmj`#8%o3+fZD@h|-9KJjxL0YIw7=(Ps`ffN8SO2l6Spvw9MsI_Pe zdHoKE-|u5T5p9I{#AO*Uu<85nuM+dltRH=tiHUqcTy#?FW=}S%v;mlC@5Gdoj43Q1 zzb@jg8Ug@w-7Z4Z{?sc=kKd=9@lSIgefU&tI$*w^`Vkt*+z5MI(o2Td7<$tB6xa2a zLHtz<5bF4OV*8IwV>JL6w!eVkGp91vPH<|&MGKpPc{l9@v5B?n7c9EXWjhy<`Tut>8VE%wEnyl*q zjn!UtUnt%S%(>Ei%&#z~MzZ6d$l4#(D2d=-CBC~60(8u_mo5D2hz@`EX-*ruof}#OZSXYGJDgFleA0exsT2{aMc?K{{LqJh-XHTv1noOh} zdsO9J2}#vpDeWJNg?}nmTV_7C`0NP#t}DChb6Ei3yZwYO0kFJ`3cnWtrWb!i1yDNM zCt84eCxE%D1DJjU9{^YZYSjQ(+V#H;OJW7ohjQ6FoUe4*-7uW>Zs+$4L{cZX?*E@g z`xlAylUT|?&&K-iq*@H0`Ktb=oBk&}TE@==Rsb&QKRnw1%5wGZyjuT99_?Q({}%N> z^Jv)t1X;$vGh_WjodvL9|6$nvUwE{P|4p(w#=mK~|3kLAN-d29+!iaZY@I8f=(4)( z7jL&)k*Yo;E;|)vH`_hEv-yDp)5^Pw)4mVh178{MHR44u4{B8jqDo+p%`YK9q3@$- zE=|8zF<))W+g940n-*f4KAPX2?(5;38at|Y7KeTA_^KcIqIbN|t?@d4zwIWEcC<7! z!Eda2f84&_xHN6uzXI5?AwF*J_&#nQ=YKY`9zL$`+E#qld0&t3--WCLYtPQL*erXw zhv^gW_Mi6l_SVjNeX^(MPQ3c7pIDvVys|Pfb~@aUII=@P+*ZaOYPFJ5JijBSy&bK6 zcky^vQz|$MdEs=iNSd|L%`86fadUb3`uYy*)1_kc^2@geHR<>q$)GHISg zS`oRyLi9t`S)1BGmu15FuK0-`+v1 zM(_)Fg%!6aJ?q$(CCym2q*Sr`xe$}lB2UbY!Fl$p|NhJa-{`6f>|y#{G>NOG2R#ic z{Cs{?tKA!e7DVvKw~!3B#=g5Gub z&-pPHH z&$Ows`R6rHUa3-Z>hlnf)eUz^5om^He_m=kT)a+bnwZ)F<*W`- zj!7C#d;LdHHR$Jf_;Tz9N%rXAZg4N*}7tfC|F$yx!J!*Zq`OOvH z2Xws`K}VbQR}Dc2veLTKjaR>2D@APdo@Wavi*FoB4DaSX1KT<-V%vewo5paV98O=i zWK7Y(6HCcCnA?}^tNV7n$`6`wl6BT%!>7f<`hLtmL6ixzON~+46U%306V5QC<8cS~ zI&wB#JBv=JQ6_!6R&U4b(QitBGCG}s7G;f@csZ3SWOcY`j(DTwB~=`rmuXMO&Bu={ zi&qt?Ph?F-%X?bRizl4b{(!j2x^S)-b#u5`{pnwF9!-h1c3^jGoXtDk?rk@53aQ6Q zDl}}ZICpGZJC#x8x&X~QW1duXDz3LO?ssHeJF*N}!pj-NdGIY(U)!=OHo7n3nq51z zI%>TWVU|rw-`TgcA^LU#-1WN0bJgf|h3>MB%8|7L~bgqtACWcCDdA+ z{mK~FuxU%naoNy8hvRr>nePU)a@Kjey5!R`TL1glhPTQzx=KvE!mM_V^=MX)vV(1` zR+j5U6ec1Bm+ls4D>a!s?Tisr`v^j}E>M8|Hd{775{K??6vPGa+`3PwH}afBJ~Mjt z#IBNUs(cI84|DcaSKdNM`z!<;ct#kc$>1LI5DCF%2r-_ey9M@(-KBT7I07j_pt~~G zy--N=oSy35KL3KRs;4$bJJ38U@ueE62uL}s+xSJ%;GeJ194R@vLjEyk{?KExg5ANs zcsK?{;NY!@Q2fDHt%!S_zatl-$l2bl+pUHD2xeW^Lfh})VYg{iqu4LkH(+h(3A-Vk z4JiHWNZ^_gS;lj)AqEmdbJnY1m1N-kGTX4mXk zLXbK-BZGeTmnPh}*a3R1x4l@4g)%lXKs|zt@qtR!y)eY+1WwiEFkX5m3V>F7l@Vi3 z!>L5dLBNgF9OdlIvq5pKfwQ&33b3uhYRc~dT`m0%K5$0$60&!@v-r8{qFk!jB%;GtNYg9tWg%wyrA-64>bx zfCz=Ke-0~3%x~HT7(I}lWi^%pP|vb9TOJTtk^L*PXtA*!$ya_|#zCf%wFwY}<@;8| zFZj3O!^B8|g`S;A5FlVsw8jsDx;fS+z>rAVtLREtaXn4EcCH`MaaOUUpRfif!iIe)&S|uf~f{SG`%gXw6FC92Me%5j>MJ z7UZ%jvXasuHKmo-65*H|0pZuid^3WJnMw2Hp^oD-}gFoJwDVsSv*-?y!#mhIJ_V^OjxcUNwpw!(M6B4SZho zCw7azkbzNU?NeOU^RY9QrMt|nQ4Y7DS%Ftmv4+kpaV z;Bs8WDdix@#i5QWNgK`AGp|aLnOwz?tZ&478C#Kd?l>9S3G5<5NNXG-*jVaCd_E6> zgv~VNXPVpa+ho6&Mz$LlTX-(UbARlkHZkOrT%)q3j#`8zBX?Dvm|ffRP!%%@CS!=N zp#i&4``Kwl04i{p=&LLw#PY3a0RXvHSm=DTRCle8{HDG=zB0a1fe7@aReOxekXESYdvSyq%Lz|P7aA{01pgMnZWFm z)cwTy(?h3M*eA8y>R?ya#=ET&r#c)e=wa`NiOW?$#7XN*C>r#1AGT%&6&IUfRc1tQ zZk*9`{la*1ODk=!OtnA~hLImf*5r_X_JQP8Uj79X3tO&#$Ld%AB8a$77ENA-g5lkx z06i4Nk3?51)e6*C*CY2~cXrKv&=p5fS{<|c&NPyVKq+{cW5pEeHo-5lx(LIXtLxhb z2vu+}dBYS;x}gr+Jox2;-Q!c!EP$_#F#_)re~)i%`T1${5cW^fv_n{eD6PbLSMBiN z|LJlUuG@73TyLz)L#TecdWjorWNR&SaAZ4_e58!UDb}Ph)WGT(9bI}0ungG#=`&{= zwILNO$-A3daIElr14B0+z?R3(Sv14;X_bVgMKcCaC`9MjYe!a9dO?=~8}B(@ ztnQrdg>fb@xTXX>Pmp%t5C|dcTgNlWDrM8HsPOMUI3J?i44GY%-ILiWs4e=u=iHLC zaG`$&XUgj_P$K7Q@$HUJ_iXnp8tTzxW|xie=W!xR5sczfi{2?E!tC~e^fH1v>AS*; z1QFKQ421Tl=^EoJs34%vVJi4n3Rjt6W`KpdLTf2lI8SU6^Ap$p(Q~JMHML60r0U^J z86Fg@UoH4$y~<)F>@> z(H89w76@`czQhf8K{8>5VU=%+Ullq^)ra*5^3!f0$aGk!;WRY>_znp^IO_8-68dHN z_8aDmQu!K!_M4d+e8MFB20v?|KV-1fq2x?cQQ{ZvHTc_Qh+COr!WN(bHQxX>=aQv{ z5U0GQCtU85by=Z&@St>%`La@zr)#k8X2Ql|kLbjpa#7gfLOZCL=>p!k&agoQN&nkX z8OyHBk=*0f(!wQB2|=#QJWJrra7G{|bb{pe<<4_kqmK`s9Ze1+;}P|05_&>pGUpH2 zb~aZ=M3z7$6fp+pmZmg17#8=RdT{&0?58OvIUjG@a34_&7hS+Mfr=o^V40H@v7POw1bcg2yEw~NKQhf!(n#=jGxxhY_;S)9z+g-Y z;g24D_Y))1Ml5sYZb~=%Mz&ZYegvJH5JTE@$<75WOLYA(|1Ob3Kfw zmya}cnt~n~aP+pFG9}iBMRABRsNU{g+Ic?hQ^aP*b|P48QHC_*e!7R__URzuXj-Js zt0SLzDkd}lQqD3}gGm21&Fo)KH2_;Fy2?cidf?siK;-3|!34R*NR|~ z0u!ojpKk~*16LB8x}iYdZcR3#z?-N5>JCNn!?kU@hVcjcGn+l>N7fU1DoBYQhj#z@y7(!#NmlBwM?0E17a5r zhbB)2wZJefNq=qEv`&>lG7DC6?Y|Jo-xYGv*DBYRzt6h7Q@#7 zf6!;PT7#Ahuo@xlxGT=NS=DMG(Hd2h4A=kan9KgJj(r@lq>|%x(4PcYJIQRcVAM2GFyU0l+-E_B zAxoeE5m1oCpWL*>!OZlCU?ueM_82tlz>9Dw{=mV~L~wa9U~9Vk&1;MEVFssbaAPw@ zlwZ1_9^sIE`HJ7`@H>4j73E-k^U2S|mKCwgCh3)#lo60)ZcHu0WZL4{ISD6|kv&3N z${mvgI7`6rPaV`FYN(Oe=Ni^@#~cqp0`CTgFDP4*&){-+bpt=Za+i`rGv4Y8rRD3; zcx(`Ld@|d8ME(|8oag!wgh166`&IPkE3-Y|(l10aZF1z?jDW}_9;^!sT;TQiIr zPY5lJ4P60gPTE+DIZsNSi9QM7Ec$2!yw*Z#g`#?h=mgFr9Wl&}>-E1yQcZKX0t$dA z@f4do&N@k;J9K+9(Fg$y^7dHpCpac_y?QzzKt}nPuvDq=n-AXJNF5Ic#2mP7OQ#zc zNs3Qf*Ki*ia9)xn?z;rDJ7XI!E@VlM4+j3rFHiRUzog{z2TTS%V+6Wh&j@rK%Qf8~ zR(4~^{-6SjrsLle!)oe>sD1@B5nvV}=+ki&(NQuR;e( zLY?R4GXNhc8|B#c-g`bFaYd( zs@M$iL=>Rqh!`T-Zr%f*(J#>qV*Y${5MW1gtG-nOpJz2h@!EUBu+VKFc(a|nVFH9E zm+bGqg2eeEDbG(>QTSHtF!8AbQo!beZ+mI%bNmD<5lO;3>#*@Z!{w`9no(eVa1|oP za9+TvQT#>zwefRh+MQ@4z^#JY^f|`h#%F}9;OPC-%M==OJY$CspY&q@ww{t(C2t6~pa9j!ryiTkh8s^&wH>%Hez_R-tRQ?jqJ% zs9&K|z)uYEbQsYzfT96({@P!}6HM$I{#7#IL^A47AfQgr;bO*;D%quZP<;eao`k4f zu8}RY7?E;)FcqwZd#qfMfY27XWH5yr-#A186m%`vaY$NQ695|nSEM_5Lve~`swYRtHIHA$n-Lkf;)2bdm-M$}LQK+rx0cckgvAP#2q{v(Hv=4m{^ z2IWpaIv+EJ&*{2C)I~T={$j6VA>IVzOASlMz;c7H+2I=<){2 zngtb4wHx(-C8*|Osp~PGh}we(xh3V(xpkKibkSF~eG0+H0Q!$z_DLU*t1IACG& z%qW)mfuaIS0k$|;1C$mWO>C^o3`oEPo?3rN&v}4@BXv^bXJ7*qg(5Wo)5A!<80#w< zPVyOk6X(R~4}W?PFlI&S7KW0wvD3gXGGxFlEHJD;@DVk+=r0gVH~-u;Fko=u-ErXH z_h1{i?Owk&=}u$|G+ln(Zndlf5SSqZ(!UI~y1$ewyVHv}pAjR7$|M zh~RRn6BY(U7*=pVAq*)=KwO>vMD~ol_UeSDE%|!58CtCFAnOMRmKr`t1+AZUx;eJ>4Fw3_3nmljmg-YydzGLBtuiZ55!Yu|dgA@MhG&bn(h+4B2F&+>-@hN5sY4?)s@ z!1s)JK4ml{6IJ}khmXVJ!Cun#r^F+q_-c*i<%Hsuqj{*Vc7f5CMBR$;p>8pWpVH;} zd?gse6LG^<-t%;HU=A)n7iV(0*t|UQ4Zk~qh>AZ)75;Z+?-7>e5Ht_;2{Kd#>(6*# z;ZY>;ty9WHc}eilv{6?1HTt8+R144!Yat2@em>X99CsYaVIVu(3cymYG6dp5Kmr%V zYK;d*`E!5~=v1&gl?aoA*Y4+ME)0zHy4zp^0Jdei{?|I->A~2w6?CJS47yqrdF4i^ z_>LJ2%vaIfs7@h)#?OGVh&=WV7N#s}2#bd=FI7CJLii*qYr|#nifh$@bhT@Af#gA5 zHW23ps)P5QzbA}@&D|wo(1h1TmGf-KQRlZHB;({*F*&`>K8i?$n~!*tDq|q{HOJS{ z`Pn_{(C4w2v-rE9_bx?2zn{Xxd@sbL(6BzyeglEx&d zG2@^@_`R5Y38n;XXPBlG>G@d!B}PC=Hx~96{hDw1Kv$0YH^j`yTS>qJ6=mYXz$~7k zjcUIH6G0GJgh~z*+v^^Yu3>4qUlQ^bAQEgj9m2W@Nq+NSuS4RK>{5RKp~tY7>j^BW zZey+pMl@Q^GFTreQ7?5ZAbdhdui$$4W{D1n4*(~5E+Re$xkFv6j~v!&_{d?Y4`aXi zbHLz*R`D1}S~C!I++7mrOOdwS?@7CM#Y_I`7#j_JWKl)yEm+m9OBcJ>a}zY8jhQdm zyjytC`Zgk8(+SKMlFQ|FvFVWz@bc*J>Sv6B+<>B%Wn1 z`jR*`tW(zur&hB%t6x+S3lQ-_R;@2-a)9(YsLnYr`lh^wFTH3VFy_=>y;AD3`#;pUj>e!`XTlk@Cr(xVPm6M6|6a zW9Oi#VzhCuRjmRoc?Uh?x0F4oSjso10S;z0>XpteHb&rO4)ljKEa0Xa_A)jU^!)C> zg)2{Fd?s1z1+^-hsA%LD(gbW&RdpBFRoG${0?NKQZ-pQOwFco?^IT&{t@rK-t*1wf z`MIIFZ*Ju}C~m`<=u4Op+n8`RZAkL;?05fef34JPA7%purPO2zh6%)Py?hrs&ztT^ zAi#i<`krCh4+NP@i989S6;u=v=!pZ9v=e5E-UC^}JaSp_6fX(YsXKkwPIf#aq=E*s zoh%b!FQu=mPcFZuB5fIJv3HOb_}siX(k7+|;`)-WkSr%90a=qC%y{qjgNJ1onBW;y zdoI1yx4SyWyhB}~hW=ZnWk|=kGF>+i32&`dV_Fs4cOcI_TdU3^ji)|=xOVOh`;Pq= z@StaUgR=G8%17FT#`73fKKXL@2%G-VU@3E{q3lUalx|q_dRtwB_jblL`|R^jKIpmD z<;dH7fi;niqaV|^8W_tttku(=13B_|`%>9f*!IXPUdbhuc=Wy6lZ&6>A8MPlYx zl?!XmMBR-`MAALKMspUms9PXhSw3C^))t{T3m7)Ma&+`=Nh1p-L*BS}1;ozPB(fmX zo^1db%1HJ=6A&}UbQs~_!ekjD5 zK7DD7jvp?8foMrS6m@tDjVh%0QN$3a`jory^Yuq)c?CgDLr5*HrKug=$s})Sl`5I+ zVI2br(^j*c_Jf-NBv378%MwB1y1$KMibuK~%g#X(QB_((kIbFORMNQqH1{R39ntEV zZ7Y+LHXX_S`gKX`D4C^k9m%qFdkc8Ql<8`=ZAFf|R>TD~>o12?w9C4-1nWL@%HG?K z%t+IY5Oz7=3d%GMJ&-1Jdu@$2##~n*LckYV=xQV&6{e|mB`m|f^OjaVuc-Y7m`(!W=7VCJ^G9hW2oAF$C9f%f+ zg8G@evM?hR+Q%Q)ioypX?+lKeb+V3aC zvScet0jYhm`wAcrRuvJ$u@Vwwl(P7K4OY7rLvkeh*<30+sh_-s`FKMPA+&aGlM_>D zP7t(WN&2#4Y&fk*t$jljPXdpph5pl0&RU#oS}HCeH{g@QbjK5qB%D^J0m*v7?QjO! zuu<(WOa;$rTCCx_WdXU#=1T@UX~+JfOL{~YYs_azy?r#?xvb-@#J)>fI~m+;Csk%z zDQqsbi!N;iz7W6YWJH@vC$KO5_Y0v~WLyRquJA81ILkSAQe5LY;#A9Jl_n7Q8CzwX zL>ZT4i3r$AY27xz;7CmlJG4sCBQNNRX_dEvF_AG-$$$guYT5-L@d*GO+L8(Z9qg*l zV@w%BZswgwnlggLMq1Bi9_a=HA=#&&OGDBA+dMw zXd^~aIW6j+mwHY^%0`0;EF#^Oop68}<(r3?2|;%(E6=>sZ^hVZ)(c5)9%fm61UQkG zcALRn&c%-iRLiDyCP2}!@73B|c{733k$QfWb}oHl?~$c=poAtLXhMzUR(Y(5(lo;} zke^ofVt0?vT0po01x_@&gU0^KLB1t*s;?QLOK1AWrf`VK{K7BNG{6_2pUw(Y<`?;;YUpSJjSkqM zJgs7$3R${52+0Z>TNBC>+gP)vVmiM*Ke%Kr>me+D_o_yinzDvIm8TBn+&n!$uf^o! z)3=5%!pyGhmGa5+s4xth^NwKvUnX+Tjzo7n-YnU>_(akHg-_os3K;BTt`<6n+#v6# zgDLSputB>6cTXW57@w_;X>ar%0eGR$!E;9ahY#`MDE7>9OjYL>R<;Fr{+1F?1(sR5c%X}XQg zBYR1W^@#1gC9WO+%>Kd263%8qCceRiyaD`NmLchn^?b^w@Uh!-rpXsqZ&+vJoSZ!~ zyje`cB8!7$oa&)S1mK*X`cwg9jwd{mPtc6Br8{kms)nf9>v`{-7){jm?P&)2XMv5D zCeJqmI2`l*{=mRcn1e-(q0*`oX%|$4y>W7(soIQ8Yp#<@hk&v5HDv16F!D5mg`LQ8 zdb7i~==3XzF==!>44K-My}=|~kar>+jIW}4r!aqt)(jTNP1seIWMLl~ zSf{v9i&w4dkgWSoenBZ!4x~EsK^st}I~t#fj+PiyvJY4nCO{?_1e?8}H$iFISq04*j{Gn+*q*B!+CBr-H7Uxk=6_cH|ucG^KsSyf0& zjALEsn%*q+uRL{|0=CfCbzx~m*l6?waig*E>Gqn6K@32=!~oAy-@~NJ2+XHBr`08u z60(M};%M>>ysGTWR=pn8%Bnklg>%r5dp zhRv(S$uT(H4O&WCH87XLgl!T|5XL|NmzQvimDbX_z{b84GrZiJI+VLFD?RE&@FSWz%xSUYwvu08g)r*1`ipJR%fZ|)+5?&xar)& z9P^O2PIC#d2&I-CcCc9QH?((9^0wZ!jmi!INUZ8k;`qjUu-a4;ss9vkRM*O-Sr4n- zwzfAsE^LT6YR$R7H!LG$h?sz9I9Uql?YFT@FkkF}(uQqRlV;^P+(Jnno{jtud^vg8 zY~gGRxas-Oq+3nHm=D4hcbA`NY^RqOL**!80CN8rTHqAx&9?mnhN-9Z4no3%N z%;aJ%C9S7FFkWunRwYB4!wy?Rv(%uNXYA+`U)ta-mJna@-CX&1bD?7p2+7dAnO$DSv;{k|X}WT>J?Zb)X9wj@;f z@nE-w8`%t8Eoj>$ z1SG;tFmXyYg)h6LJEm2q`ng7yzv7tu>)WyoDIlVKLTVwPOc3!{wF`0dZ{06cO8VA= z=0rxX-zAFC-oCas4Qmm|avgAb?2M+_N4Q1UQpRaFJwmx5;=mM)E)rCZD1P~GW_M%qT~_a*=}&Q>yeX3SB=N_{`hnk z!Li;etTb6KNgOp#<7^s7#>HJ89sUEaa3mckOPQg?Y^_<0i@jX7)InBI($&Oz(V~n= zJ3#Qt(Q(#{V9Ib;-HFokym`|?*AoZf{q84sc^mhtK<7)|dBveo4;RK-K^s4^aXYg8 z>@R3$y^)s;?qaUo;h~HNmbEWww?p=y*pV?~xCL-$Hm|lb8O}=5KLa}9%9V&2garf< z3geOPZNjeU=goIjG~qhP_ABkkX_2NkPO@3^nIykYc|B!Zx=AhhG9s;KwDeh-IPr*g zN!Pxl*8pE}0BBp?q=$g-YMqMmjBme4eg;35{^yPqEiz8}35Zef@zd~tP|!~XVdplf z{La>22EjxIu-8n)!cs;kUI$#Ro{QSfY<^F|u#Wh-7A?xG5mqG7^TxJ(}6>Jcp#Kl-BRP^@(|X+M=BrQ{Y`AZ zpCsAm(y4zkB?^Hdq~m9ZXd#6Z9W}#z>Q26`fQ!TUC9q*9X~=)0yT8-xGB9%dTXUZ| zdH;saQzW9PZcR1~io*jSl`V)#N@EoYMZGR9G$bmcTpx2Bu8mX+oC_G%*h;mC>&tA4e^#gQ&z zOvjb#Mf&_bucwob&!^=&>ADm=;10v^Fxt(2AN7e_$9scAbZwy{u^;q2G*Ze0jo~Lb z)#Tam%IVWJ*JFU(A~I`l%)>h#gZ|Ts>VvxK8Y7H=(3Zm#f}HZm4NukalM70uRk0@; zd5O2MR6fGx0IXl435>|;-nW51?9BEDxME3SSh$7BlyRExHnEyGRgZh!&Nsv(;^_9# zK7xCEBBMc>IN$krGvkiahZ6Yg>_2?OH5nTM6VwF#94d>fSx3+6CzEZscVNxTI~?n? zif5)j{;;<+7HJsUC8sAC>^>A0h2&x>AGK|h>u~mS7-i9JaIU_tOAJNaoR#Rq;+l== zf`s^X8(XO|+p5-zo>tiN6C`m2m0#-TeBo(~NG{jHl2}>7;5&B~ihQ7LWFdT`;MtDc1V5H|p76vQ z0!e&*pm=7QEU_F3ES3KS{c`CTDC&+DUsn;DJiA_422eh0V-M`^`F>`_9sZ)vxQMp@hv5K6y7>DSMzNT4{|-KkNp;_AHYs5udDG^)W)*HN#KaM zi2BpK$du{`m-85zoa&Nh+3Bb-U6_VOROg9%MTOPK`0kX9F-4J;UN{UW zTe1b6F^gK?H_IR(9O3ipwWUf~`rBTmK+h5}TSejmOmyJ8#E))X7r1J2Z>PqIltr#i z^3H9rtpnBEW8w=_&|%=(_{4N~`%O#;c<9Kb5qX_#wgv1%Y@W(6X&%V{>;9eio7q?t z(QCsh|2Rs5arA0M)kPereLScF!mFIdZzccnXx~RKF$wQp#K#l(<^`pa6sg8a z*k}$K;jHkIDqhwXu)`5V2t{hTmXj?Q`R~yy65Ht>l0|aFDJox8Pnm&>KnYe4JF!@_ z0tlZ*#gMSE+Yx&t665-WRce#_%J#$@_?gnI(UtUrxWE7N3DHWBRh9anp@elh}?j%z3{8owYoNL^DFB5yP?k;fOewq;6X=<8~`tLvS@F~4K(U8#FL;spE7n6R!SOE#RQgwGF?LjN-} zSTR{9e?e28vXj@t0tmGs_}jdi{V-Rg=q%*dqy(YbFHi9sWoBID>$SayTC??C5WLX^ z1xVw{2)-aIYVazIAo)jx>fzzr4_bNKojO$5uwk`n`;@>+dkx-NO#aBJl5JF`CAH)F z=44ziDz8_R>DuBD!l%L=y?rs&Zkb*{r?8K#_aL(^uOQdAxTVNk;#d(4?z8tlRSZR_ zmR8%NSu84lv<5w!ktC#|jX;?x+v0~IjvNfVo@HZ;b4*J550)v|YA8XSGG|P}p?p&_ z9~qFnt!(uzORi9s+|V4Ms&4yw*tTX{Xn5~jlr@{~X_K#5LjCdXNVxIy(XNDvxw$Ah+mE*J$Z&F9KIh`VsJ3+7z{mY_woeR==39!{yj~7mD_}(29 zm$||H;yCN8oCFM2TIs$=1ZKH0B_jEe@7>)#_o>G#7HNPFNBTUO za*;C^B?dN)$#|`J@P)9u#Ou^~uLjJg6og4_g0&4UX#(=Sz|%t8SP$#Fe&QB$#=oDw z86&$)%b!iv|DabHwgsOoKHw04l1(3F&x+TlA;z!ujPRO5jc0cj8Ng0 z5=Z4Isw?r@{56$cY*mIzn5DA$1*6J6Pg@r~{4_L!3_~FW4d1;df-nVjJp=soo8wG% zjZ(gqR8VN2g9rd=cUnbBfX016&y!B=&|nrHXYuP^eu8ys85J10rQ_?h<@Q#T6ep-1 z*dU5Yz0_NnDCIs#w)U9F#O=&B(zRyh{N+^Yh`O4UKnoH*ZLhs7oo`%7iqzhZsw3-$ zcS9m!sch3~$z!A+TsKs~P?O1Hluh+>RRFjSC5FGp*%t4c3g}I@r&Bn%)DMNdnFVPm z126`@6%^5<#d$^p(zjrPZ4~Nys+dFij$|_V~m3o^&w&% z;LjEwLf{Nt{6Ync3@LNQ>8bGq*pSxfD|x0Sf)SDMW$n)f5K_0W4+wCAHFx4dLss0Q z_Z6yer!@1~-_Uflg@7L5&7lY4<6He}+{0aR6OX?wpT9}G=>3{`qDWX}`GD(6z%daW zW)vx(;!5(+zbtwste_aBx z+MbDKk9;|9{|kd2th zBu1L{Y_j4{-C#lquMzPdfh;Cs!5kwwMt${}#3a7p$jo=;>oSQFRjgF0FiK(1{TZ8` z)mF%?%rXaNK#$fEBa6Q?Q_;;I3oqEn)TRxsc9HJ+QA-0f7{rroj0zk^BQ;)Jc(Bam z#g;mTulXa$`*AZ1{O7n=Su`Y^a|XII&TICXV5*P0UPMIIYFhD1P=Qm2>uwECLUFlV z?SF3p>B2dJrSi`M-z;AH!!w(+TM!1*kgni*dH!tfd|X6L;#$Ul7^fwjspt}Z#;DpM z;_Zbjr`OK1sn%GIQoun+8NoIBJ+?pLFjEpKGRzt7lV;*eT&`!h3&(sR?tWsjMCN0) z@Dufr9!TFQK5MY|r~rud0lA0^#ib<_J|w&K#S#V!m}po&^FywJeoQ#6KeS4;B^7uW z73L;oNX=hOZ@x4O@VAfe__fNG_^lTBTTE1p&>w!>SWl;(fv=J7RO{OI0kTIbj;lP9 zu;u(R825eht32jDw+}g{fpvB=0|b0SBYRMb)vv+8qcN9Q?uo?%q=s9iX({X$hzjfh zXw&B~YBk&ft8YwafABEHrsI8ODjerRwO=7`admc&W<5i|QV<{QO|+UAdxis)7=5bN zJ@nP(>wmK!DTf(;u}~9o8$t;H{9S&sl=$nMk?_Db#Hl>lH$EIKGR@n;dD1M9qU*j( z8|*M0{;GlAf*BJxg*A^wn+~tXVzB2&pcojWQTsnVsfL^SsLy{~CT{Vp=M!uR1|a8t zu_w=gpqIw4UOb|v*ju$^DF+WJ)fmh*|KZe*HX0?bFbTYdraJF7p$3gNiw^(tK5Rxh zw;^`#hu)<(=cPNw|5~s%g}?(WLzoekA8|KtSaJo%d)#t>eT1@i+BqATP}(Ch_zEqLA*R%|&Ot;< z)4?e7pLn%L`R~8$o3v<%9(3R@jhfH@7jthJm1WoM@hTnC-7VeSNH<6~(%l_`bW3-K zba%Hj(%lWx-FR+!)c4VMpRxBD<9zTF*BV#-nD@F?%=uq)l|yXCZ28UIDMgjxJ?@m# zMY@=Fe64;}LL6O$S&rvbAC}p@DxNgOfUHm5CT$k~0+%e$pmN}a$%NRpHX?&kYK+R+ zHPddVNZNEL!L0E77#Sjdu)MidfEwhDai_-S69cd^XkY9xyl7J4XZBBv@#?RyPOLtb z_f#$9^io^A{>o7~iQj-y$GU&zY8@s`qke6_Iq-m6pYBCY<6l@J$;YDA5_um>n)PC= z)MAebM|GpohZB9rR6@kMmjQllKzgaR^)5KqaiOE+6~LeDzQ0-;Wp!mY3u`!-2;+ zXL+`A3rc0ZzyR|Ziy{5$<{-bGcIH}YzJu-}@ec$GGLNFb6j7~S#gkuxkyXl*!Gm)| zb^KD8&)L%y`uNl;5LNSHU!!E6dND?B3vIE4Q;}S7S$`wuA?7^$TAq%Y*{5Eu%deif z++38Gxc0U~!2sW|io-*UKuyhJocbenF_c(JmjlqJw~OU)4J~~w0!y#2&ctoHnD;=vsS*T_!l*lC+wGa?;jLQ!Em1s%M8j=hh~!= zT#Z{2t~z~OoP&hbk_sCh+lyGI0$W;jY3xFkot0MNhpFCMs8;}==LJMd5RE$Ltf%rO zY$Cw%)4K%DicpCj1md_Ny34GnmL!Cgb^m>Fe5bAe)=(W^hlSJ=Ck~B9qF8^OG$7k0 z#%rheoq*}`;zgHnL}SWIQ=F=yuZi-abgTVKD6lTAnF} z*+|CjJNUuh8>{HsmeoI~XYO|DYB-!=Xx_EP3%(QSL@Y?Cq%s#evb)8>if%*$E|;l_ z>d=rYu zF=xZ?|YE^p7r2B!w$&WG+4 zR69d10kp#SrY*BR%h1}i%-2z=b3NYt@a;|p7@g9*b`o>hA@FCuZ{Q}}p zYZRZtOECEdInjL}SUR9=AXhI*N4ZICpp==a>&Df|vDa|*%q=K)25i!a>bU10kSc9t z=-mURN!OWTk)?$FTO4S*7%E3dI%!QdIaU*@?F|^WzX<4p?@!p-tBxh2-EpA`zmaCXN2rgj*Wam75&%0GnV5ubf*n~_{%zo^2Dwf9reNC@LTNRE+< z6Pa#4mx-UHT>l580{1L96;&mq)j|$aEd?gfFA`A=)*Z%fGV&I*!Il_a_NdNY=fXOQ zb4e)83vIU}0n4?lD-)vJdM5kzF5h z--orJNVp)jV z%0W5@`OPe79Gpi@p3O_ua~k5(YNS`T*><5~8&t%c;Ft^`nvQ;^0my2ZLDgFv0bnGR zBA;1!PLykvA$BqrncvP?qm3TJ!~|(Ab1!b_AP85`tLdGuHj5uk%f38Ph??WAhb0u! z0kaaV`cx9>m~j*@Mc9C=5MNqm*?A5Nf>PTS;B`3%^?AD%CPb>a=Pf2!gJS6^jZ|;h z9&MWPH`>E)_ti_aMaGh^2azX)ib$8;*4uuh<6Cs>L&ecOybrvPR$F8L?N5JpG=Fz! zGqbS$+MJK^dybHwUhe;sL;c4VdA}U$&pz${lSBRAX+HjUhdMnyAgc)D4{!ay_u%`! zAs;9Yf+y{u6uzxT7Oe8|j2q-cA+@6n~;rqFtp%K6-sDF-s z+u)Dse{k0`{U6=+HK~J9RCPA~*N@1DnliKI$}b%pe9>~m{Pz6J)kyiF<)MQ)VtVO` zhu21#9%DR!01o@^5?Qj04?M5r5$yZ}_#FvpJ+&hEzF9x6-*we&c*>WRo)?yu9hbGW zc{n|8F4Y_#@3T>yYd;=Se(SYqhU>aqs+(zh9JW6$eY{*^ok@0WY`zcQH#!!Fp5j=% z_o#C|4f%HHdLNLtZ{6~^fi!7}$E$gBODm)NzNLlH^IPKWqjq|!XMO8E={3Pp%l_S$ z2fO#z4soj7($|V3Rrix2I_&OWOWJrf*BYX?409yx^hIdCd0#STyd*;Zc9&)#6eLg~`sFNq+ zyHTIj=Fw`UWK|Om;o$>OKC#2A{`NtCx3#rwT+y`=uBem9w{*$i=iwd!f>F&q3x+*L8guu85X$ zd>&=A=ACxvsO`CUb=6ffQ-oja4BCW^3T>-PZ`ujZN#(9ustw$p?zy1N`}lPC8T1w0 zH<7ARyd%E4;=P#Sy(4JPdFFv)a>C2<NRz~1R-uqf>W>-q%1^-G zs}#Ey#ulDwb{^iNmueh7KwLhd2efqMuY$}D&DI_eM|I(X7`Dmy$f)5S%@ zW(qVv36cKHMMIQZSr3Of^7+-5f_;dPdO<|Vrr~@VTr|DV$pk*u5;L9K6{|tu;-fg3 zyVi^SgE-PvJLq&RgrbEK#=@W_ElCC&!@vzmF05vPFVu)hcTH(>xL%*n`_PE><3xbs z=&a4+Wg8bk-hbO8sXO@f;KpWwZF397|5S!cKN*1rzTRzv)hib zywIjReZ2(ag^QCk5w2X+L5MfPu@pEX zYVC;7VXMH})jp%K)3%LWeCk*dc*21i6O;O2zg0AxZe-dCLEUC1TLJ8XtYUvp<@IJt z{(K`Yln@QkXFL9Gq2BsK9p~|#5|yNgYm-!Qu9iF(+2d|9A#Ht(D;D_Bd;X0Z4NoZN zy_vU0*Ti@Cb4;jd+FEHev9%dVU`h0LUJ8pS1E?p#4E1^5BX)$T;qn3s(EhU$)}hT@ zN4Vo*RWQgL%n5L9o>mKFR<$eD$J0XaDhD|QZ)97#Pn0jpzTQo^W~LXnNa3`TPp`OZ z?|dYbzC(R-;*RKy=oi&p^;VOi?AMWpnZF1eQhc+1O`D!FBmwzS%0O&_`EiRWLzlg_ z=oN=r1?N8bcvjDTlMeM;qzEQ9LQiz;hD9}NU+1!!PqdM-wbiYQPZP4N-)vhl>qqTB z%b6O=RPQO~9g-5O!st5NWn5n!99YOOFjONtlVgILwpWK`M9b9IbTlV5y7A&}uAac5 zj-;9$bx)qlAzML#vrxa2>`KNZHj-uUYVi7OYrf4GAcxvYLGcMF2qK79N>p-gs_ShU z0bI8?FlnCLhogLOBd}h4T9Z!0hI^ItL1iWwt0mx9ss!BX*0%?m{i)qmc_tWDgB1hZ zKx#z1oOa119$&p*P7aAkXxE(=$piOXONYr!I2`93rbKoN@ikYvZkAKD%?q-&HTKJa z810>I*SK@4iTgOgVP{ei8IdO*B4oFkoch1XKFq{BW8x1vjdq&r<9uaXsHqZGA{b}Z zUg5n7Tw=d9R=5kXdIVPNQk%cq^k&BZMxBPRc?}9hoXAEzn%d|y@F(;W))A@(R2b9& zvNLR$j}{~t%N7$ZZqhsLPg9`i_Xr7hJ*HRKS;`adlawD=WFGGGLa-lIu4~A{IJ-Bi zYlM?Q!W4ihZK`Qct2@<)qg@+G1_|%jDqr_H!mc?64y8@S*Z2TXOFCkMGS9j4gGuErN_4S z-*Heuy|D}qrB8kARkV8lfp}+u>B|K%cb{*6fQ4mhf+LbhpPX40dt+)2#iqEw@CgvO z?b~Hqc|uL)z4i<2kD0(Da^hd|>~^}Wx&0`85L8yvNP$!14@a|Q`!2>;G)XfUt28j_ zl+3jK>b1R!(hkhVqi%L~=V*q4I4>1kfxFoKwq`d>(D!W2gjJfo5u+hJsGo=;wJ5SQ z$8d~voBSnN1Qg!wH;&4T94jJb%Ue$ISx^Swr@4(N^Vh$vRM>YKCfA_ABAw4SH+@@+OCC8xSkvRUDrm~(>htQu=6HE4rULtP zN=^VOdGd$prb|!7Q}7nL1S3~;RktwE_51K9En=5=`YXs!>dPiJ3wm*bEW2_q`0r{t zTLq40P8ru5`w5V|~5GutgY>Brt=*-En*6)J=y1wwuX{0wFcYtz`+YW9_ zjXQ08UDCHgS?lZ=-cvS+zNcn#YaGaqL3Eo=6}x!v#F`wQUmIh&J?eKpR5YEG-8Q+y zTZPg+Yyoy1OVf3DIeOM6LKj zZkc_FL)n*Mgd}Um!He{HTcf2sWmXAg@j*6LRvijlWG=Gge#$~I3DARecRiQP7Fiaa zjY&8{vLww+L!*NzUSb8;9VBbpf2F@dU7x_6&spbQezXU8%1yfV+NHU*6M#!9) z;IJwdmO}{*qyP#NMt!}{Vl#!$FsQTbY43ET70h9r-{WwoCCDPdtS>G?Yr}Tp6~Qwqm|;|BLb?_@oXcK3H61VG<}=U` zI++qpZUhCjc4SU=iiu2Rkf*gJS<82PKNHt1|C(wy4#{fGiZ~R9dYobwOd}wVMau1D z)h7~_=S_5UV>m}}-K}VG{C0pnT1XDhD446|wo?z-SqvV}eMEUD$SYh0{8`j#5*9i{ zFAENapfpFFmMsuLn`3)bkWOfKoDn|E;&F|vb^9{WSYe?MRSI0n)!buY(k081Z&XAD zhPpaP%2D0*gk9T^w3oVkYZRt(02$UAj{S||ZGdmW+ie>OsDdp#HJY*g)V_x}DfzNE z4^eA1a1&8O1H&f1HipNDDAB!!-Fm!ftIXl{GhF+( zS{1@#+~|y_6yV9c9)nA%1Ll>NOG5BQQY&qC+WDrB^tLcQWN64U3%|!`;Gls*s6I5X zCT4~^?COp59(1>r=WQ8k_Q5GuX}uMpWQ;aWRD6By_yv?ZUwbxijh}+Uw+$?K;=VFi z919QmvPu**IpH3Dpxf-=371fnDE68@1nQD&i$TbK(|f;UQF|*wAf3TX!Uzmpv9iaU zt3l~DH@JS(!C=6;%RMqjUXj=P*pGn1Ntk$MJj2P55p>Py<2i#TS{Tw-!C9{2oB0L7kTlA)u_+vMu zr4v~fqzXKy?7K7AGg8Iwf$c;hY_b-(S0?d=C#LaPVPoXM^ys(UKXe4Rji3wR!#AG; zkMQo&T35=fS2paGLf$QBX@3S4RoKcP)9d(HQV(T9-l%^S*2?-OAbz3}!ZmNXIUYMQhRacr z;=sq%Tb6a7xlz9;6cm+l7Gw~(lbWj?lK+ai=??8mkEivRWm8QIO zK0^F9=eH8PxhYLc+LTZ?!Oy>cDh+p27{g|uRZ>FQ!LaJT0?I(HZG)EqYM(>eRW6+o zUw=w}-Vd%<8f&xQHu0_#HLLD)=IZe9xYSL?xsY5Si89-_zWE^I=~GjLIrj#JWYK8M z>0`srX)Tac!xFN$+n0GJ4~|n=ZT$8)y_h8fL)A*a`{62hvijnxE7^RE#~A~l zK9WhrZC7|zb1ACDhE*yHfplL|QHD;qhz2BxfKwP&ODTo%izv7zhc!fFE|i-O64Kn< zhrll>X;c<+GuN!~Y%t%6S`H4M&8B_(Fo`ygJBWe4uj6Y7yp&A~Qj&02S&G6Xu~^iN z&RGU#-%zbN_Sly&!zJ+)=~UGylw3~+uES8y06l;BzB9k?V2&mGMs+QyPB4elmyR{q zrWEXR{fp4g2A{`6+7n$A@MCy zBeEgKxQ=ss9n9)WevIVh*liFbaSIdH(}BweDU-vMS;>dXIgZ|imajPDA$ZmLz_;9b z9>a+W@I*UP%cB_TnnEx)}Rn&wf@%y<4Ytrn# zoCAyVQ}_IY!4VJ&m(60n6SM7Ao%-Iz1a-K0iGw(lqQ;LiX9+rzD9;b3klxgF&Bs+?aj4mf6_ce5%}L2~3s2be zFo~zEEH7|1tS>+@X*7VN^kEZ@I|Oh$HPnVVdu6^wA-UkSFtflygdLd}ocqMwefb02Lj8N!%prs7-xkFe(*P z)^usTNwj6z$i#+pndj5v$MTuPC^k}XnH`fxEmc~RirZ4xdGD~%T)MEsWs2%bEUO%n~n5=Ibjg7=U1Z=}?biw+8m zv<#F&@o%|7<6eCpEHPc!Zo#Ff<$7sCJKKGIX)yzD+}@(4wUF~ZlE`8VnNv^;1v-+l z0!jXnoxw72P?$bn2cuT}e1rY!_yG1RMhM9A+|Ao%e)t~nxDVo+hcslL^$Vyg{Kx!aTt9ky^MF0alUm`C? zR(mWyXwnZVSS<)vPZE)QKI7d>aZbua{&*)kNV9L3 zyOH{%g`C*@RGRoI3$fVn*T^8z0hh@QHgV&A**o&az9#us5jZmog6%x#uC^5I3rEda zYFcAi3v+OV}4W7Bu0k=o?UP{F!udMm(O5R$DtsSyK5GR}J6NgAD;Sqbl<=0sS-(w$dtz5&w6?H)D^W6@(RG;=*& z2BR0Q&ROb<*RZU@fEAa5-O8vY!J^}StCdd;-^}z8ErAr$SP8W+!6o|~o&bVOq}MNu zfI&HN$thM9wsH0_~9-_cNg<;EZkhD0W-K6+*!EE`BXvk2Ls7C9BM9^;R4>k2D zHOSx}E^>&1IaMDasi%c#uDMTxL!EL}Q<|H`?de6*vXVDzlXeb_&D*M4xXjw#5Je7e z#o(hck@v8KvyIo7mMk$C5sirmLE7ythfDHN6?H!;xbd`X#yFGia~aFS+5~YD?Zdxt zBu5sdbWh7EanA$OdHb~!NUtVXFT;;Ad(`8-Sk77Z>w)lApYB?JLiTM1L!TfJsn&ud ziGw{a%=(QlGmn}bVDC1Yy^m$tvTwblJ}q;x^!mI2wcKaV+ABHLPbP(5C1sl^D`WW7 zA~k_rOg&J|{WhA^`qV=q9dkm57gLtmpJW53#Sih(^`ux(aKs!`IB6wG49q#?itl z?E>BH2x@wCBTYjZF231w^yywVmP*@bOV@nyaZpTD%VtwERq8A7QXthF7s+q>y=?^pJ&81NW2J}L&(y56%yk$}T~C;Zq% z8$;AuRffBWyq_H#`3dk~wInV#k6QZc6guaRx0KO@`E;otvD zWc&HfpF#BhF|ti7W}#zbz>ojWUx6Qg#qc!&QEDqodweb~z`<|ZXaJUwLDBzMcKEM= zH{i10mIcx?0b=3oKlk3C|9+1BXN3A+5pO`8{P$q^zrx>ukT z9|3tW3l=EmU&l=N%)ed&*nNcU*9pK{O}1Z;V#8Tq;%}epzLiO09W#x z*xSh(*a}!#SX)^d04fULn*VK~px%oYFJ8WQ`QM+(GuC(1U&|?v#C?ztf-aKfd9=4gNdUZ}86_&L8kBe<%Di)^G67ANn8gY=0;GGuChL&kfTb@T@;% zL4RAd`HuA){BuM4C;Z>p+OU4d`VIcM<^Kbo=|>m$ms$Q9>o@r4uIdkX=D!pE8S8iW z@7>#<@PB7J&-@+hH~8nVz#s5zf2ZZ2v3`gDKKl3rp8fA^ZJx1ygMS`u{Q=MNcfvno z{RaO$I{X8k`R{~(#`+EZc{uwAJj>tt!9HXC4*z{*{U`k2*-5edS10v6UHAi@?eDBM z&se`%{&{}$2R!rNY58ZY-{7AoWPiXj{hjd7SiiwPPayw*XZt%p*k`QY;Gbu_f50>U zo#Xjutl!|DXXt;xv;LjKgJ-PY;GaDTf55Z+o$$|CzrnMAcZd7|&;A4ce{)iNQlI;X zD}vH`oM(J=r@Ss+vNQ!jLs#(@oDreae=_ zxjk+@-07<|4V8w?trLSp-g8Q~d4bU#Vi}d;t?;gjuuEUFj$dSdt7}^kewbP)RqI@Z zFq>3KiA^C--~=5TqmNKQtrc%QV(S3xEb7vZm7iH!?oXa=FLt!V-a>k|MogyMPn%R=LUuz+JbIE~HCBJIC1~sCA8coXU z={aH^Kk}9wrz6^N#fF&>L7O3c2c2OsND(I&h%D-9_tEV=)(Z%po?{)VO^=f;tWB#| z6^!N#(6H;iQouUVHnWpdFWq$lMRNjt-eeN7Nu@Io_3HO+ybX-)PjuHeM__{J;k~Jz zH4tLfdhsBM$qbI+Pn!lEtA8UQ1NLsYlB|NfeC_7CjsR3l@kx~~M&pK&qHT=-#%|uP zN(j@ap5N(gn!QAb`E42tXf3q&+BZ>M1>4;yRU7&3F$^k{=y@RH6rI(`u$h{RSO^Ep zcruuIfxYcxv=FoxVS4S#6CBUFO!y9{8jkS2 z;NXXJp5s9SstF!osET$MWkYWG$EuOB&Ixy+nqn{h{5d-GMiyGOPz-vQo+epsrh$f0 z=<)~a&Wk5-qd{q#u@|-$Lp&Vv@yLa{pk<~Ok)*KSfSfs2ZQrH=qa_viL9aF5+_d;_ zeIA0WH+&7;AX$&5=gl!7%0G+MHdCc5K7_o4#Xb+LEs?9OPkS9?an!G`oAEWRC+swGm3u`TO%AYu?&E|c5 zrzgRjMY9pp@im@XOt$2+cjCZ=n^dVXn3wmkpYJuJfcYm#=k?B7WnF4jU7Cc)3EwIZdi9Oq{sx zZgmyvA@3zqOAyAYFa~`ZCr;=>pvfa1e8@@$Sw?A5VC!|tjH)y+BR!IuB8a6>jzrX{ zqX>{;I@`xWVG5&^O5*xsl9z>GtSXnzcZ44s4L0PgJxL_5_*^;vv^pw|GhetqlI`J~vAP z_S>)Hg2Z&-RM=g%h>-HH6WLewt&$M<5T&5qhv_kA(R~vp*CoBeuJ$CoY9qD@*5N~= zh8skyxh4t={2uRKk+OdshiLHR)dkUPEMa za2N#Xm_tf*=)0smF0Kgo*02scCM*=d95mCH$B}n7qUr^7<(Kp^HC7z3$|6Fxp;xf5 z^Vog9Td5n%X{xGj>w%nX%1St%xtcSdFs&geZdgYgqm;Xvn{gbm^a`y!M4@>N%Yoq7xxcIc*NVHOjVeL@bzNaootW?@3oa`F z7S4-kaRQP^sOxKJn3LjLYxld|5G$tQA@o-TigAz7nql!Tl~l%jyPz~A>ja8eBi>s=8SXgJaR^lgZb(%2g}+W`n;uuk>{N^cCVUEN*C zdKLe`=oAIcKsSRaCXW-yH4!N$992F0^OxaJvSb^A?cri)Vh&cuz!Mt$6yHH(S7<>J zimsSxGsv})kGIfhS2nhAQ$1}at524hb=g1zr9jt~l>>#WJZlwjU2+I>HKcIYV$#0R zou77tJDK|3@+heaVOoe!^3aUwFKLvS6pb6@I3SKO+n4uTJGP275fUwyDss?WPq(x2 z{XaINa^yESLgP4y#}FWCLAbK_ofP!B_*mp5BQUfYwtE5DGgKC(x0u+rBOS59}K*DQdY)xAA2Gj_+|e+M?cbMe&nz31)3*`M<-iin`KF_r;4T!?!S_Z`m8@H6>C)(%HASo z6>D7zSruzJC~=FBygS)6i0DCRP1JgcZv7drEO6WmLPJ%MwTpNPuqe^LaZ~k!GKx&Q zEa}Jy4=@;MgEFVs5voQiOd_!V{Fs2#q;$J15nkRa^ul1$clpsqjzyT9G57a=#GhHsW;AoL|%!%8yn`^>BQY3NmBCV#oC&fCpt7n{h>2Wx4Ep zDK*-_+gO6aI8ClY66^HJ7!7xUeo|Ev+`ol5d>?(+637bU@qV^MPxNNxC76>vMrO;4 zl@FOQ5A-+!0=6i?)gq6J; zFG?V;;MTB+YNj&Q>{ph4{1pH2qNhT_>@uE-KU1PetQC9%`tixtu9SmuI?rt$D&n zFL=_HzjD%tFbu6bhpEo5ME2I!pg>usr6Rc`zG2_hga8W*gJnfdP{bd{?a`&XfC?&u ztcciME57T7jXnag?m`Ue+@0eD{H$M*lxASE>=BQq9!T+alc2JG$_VnL=Fn;k$N-JEp95L*m&>j)|utlV@W zTWQL&;?OzOMRd}XE#b5?W=k-`x>{!21uhs2Q7QqVPD44>(Zb%@Lt3|ulK4&|JJrbP z7QSASO4xU&8iGvF_O`+41SRr>0Ce*81*98j7l-f-n8)CGVJx=z#<{-8Yn_TpZs!Jk zL|pNA4Z>kEnpCZU7?r5wvf>ZhN+E{~cO> zp7wp83NkX&|B5cN|BQNmS2z3<;E@HWAn<8rb!@-KvVX+cav{$CUr&v*WuivItkz@P`D8Gxdv`$75tmVw}Z5M%%(7(e6$!vB(I03;ayuksAQ zL;jtR;J+0afZPrA^gn!I0DT4QWPZq#G`%jXH@3IOefXRM369FZ_eLo|QfD+(7 zfZ4v^_nWliAB+F2RX?;H^Z>QU^BexMh~+v#U&QlS5||8vF|K%4xx+5cB2oB!1R=eF)o z`vc@?f2IAOxqi3*bL;#k|MTVrf1&+AUof9Lwc{@=TnKluTD z&R@y@%=H`pbD#YOKKtL<`afg+2LI0(;}3fJpPME8b&bzYE#ki_|MyYRpZow}>|a@V zp1J<8|MwBtpZq^FX8m>c|0%QikNtlWW&iBFeu|I(HvV7Ixc~6~5`}!9J^keWDU$x% z_@B9cuRqVD`#EItQE&X%w@H|WXlb`M{9sE3V{ciu~dG&ws|D}T;y6;@S^FMn6 z{^Y0sOY6@w*YEt#zKcKkf2Owl+uEOJuHX58X{7$$fBjst^SAN;5{v$){rn{X|Be4I zt^dEYbN}Ig_GtZA{rOAl|8ths-|NpWrPsgh|8v3E|0XXgNm&4FmS*FBd`}KFDFw$D zM^RNN4dz}^O`PCQpgxVskZ}nrRI*DSr(wr*@#Z-D`V{L%@j*z~&_T&j$zZscIK#;? z4h01xfcN7ZFH@VThcU+!FXn<|h(+2mYnw@{Rjc~~`UFkayT`VkbhM`~9phB9WsjMM z3pBk2=3JNifbFliG*;hQZf_S_zz^5e^jP3VPS;jgX4+hgHS8W2!1Fa%xHN7adINH; zO06D`J&!z}@&dNClj}Uuw8m>RjX1uwZ6C4<8Q$xd$9p7os?(-zU6v?M@GzY$_HW#W zUQdiB*LPw1Sskt5jliSV+xU8}!8k|YE z&a~F+)D--EpKj{840??di>w8VD}$`_9M}4K@_HmK5)L8B?|gW7#pK=K(X;$; z&Z@s9_}X}*YV(owU>F9cT?Qx`l1P>l?EuXM0ig;5HG_?qJs|@vXjiFkwRnLyLIJcS z^jydNmA#@;B+cANFU8^pM6R7vsNck+5n)kOA&ft-I?_s6q1MVs!}5I!^gY@T2>p%w z1u4oGiU8mxwT;(qNb_5HZ7M<9yx!eourp-oNfkAE3nPw=+%kq3>1dhJdSXd0Q%-Ng zo`f2J1x2yExOwW1UI!Ovc%^PTTH7Ium&O?W2==TL8rwTYxQ>sh#_U{BCJUAk7ImpL=gE}fI5(S^@Oa? z0pGWF-ta=;RowX2jXU&VpoV8MsL-7sPK@?a;=`?20p35e2>JF6J^5A#7cOdkvxLB+316-^2HH!^~1 zVmGZ`+v-YeCCGKIdh1L!GWmOZ^Fua?!@dXhcsMQ>(npo+ayhoqj|1(I*kYQVt*t{u z4>=(As!&l>5n!ehdq>3$%Slg{t4l4P^?7Zmnl#>&&tA`r3)W58mhCP)xNg3qc2Jaz z3|nB7p*>4!CVT{gEOy9u8|X&ZD>d?!p|=L?TGzUGX>t%W=*MnWk7MA@JP_wj=><*+ zLseu|C~G6csk9HP!a@2%wxqyZmh(;*bX9ub1ugZUbmB>ZWlfSt`hn@9cO~s=Z&2cq z2yhiKIVL{u@Dg-$N(eKH!>VjT7b`(?3Yxkia*tv~%rl9IO6Ao!gaNmM6~PL>#1jGX z{8+Z&NrvwyiI%o&M2iDImg zal_pyA{MCx1y8T@5zr5*O^FZC6dII|TfP46nby5f%D5JM`s;c~2IGkb$^EpQKJrM& zKc!`A;arGhCAEw@ViP%eaI?jSl0#;G<69F;ua*s zC4GIJ#M6TO_2u30IRYUGt0%!EW7XWaczarAdts(r&xe}T2V}}f{?c`dMTu~|OhyFA z;yL}3Da=kWz&3Z{G$V?*<5e6yo!!Gg|eEQQFH#Pp5AQKQ-d6R=M-jWkdiT)6grwF! zw}-%{9ocfR`zhP$x~&w0DAL#-xdar5Xa4}vlUD7#JH=|2^aIzjpPC?301#_1Wt4uP zp6hEwPOdlO*?U{Ax|kzb$V>8&HP?txk$X<9pU*^jG`b8aGmk z*tx_jY7NyOY}AV5Ip^>Mwt&2rcSZgX=kNlwg7H_4-O>JQXDbYaDM zb0@kzu|!1_8`%7DR-RK5UB7c^u-W|oVeXxSBaPF3{bYiPJ+bYiV_O~DwkFoZnAo;$ zO)#--+qRPlf7#u4chCFo*6*BCb^h4Dx}K`;>PP)l-}m=(UssL+ef!=Q&`XocDpq!| zx^JdcH%2LHYkwaBESJK*lhBbMi6zc3Pxe*JfGlImF{<;rM`;2wqs5tO{FP@+~Z=V@oEM4Jrowz zTGrFeo*3)%xHBq8fry}yEJ_4+WJ=s+Wi*ydmJLO5_?uAClpSU1n@cUue}^`?h3WwR zPE(2}&99&>@o1DVimv6)J|F1y8%F;gtz}fg1#{T^PVz~zvL=DM-f$+WjxkkU0&lku z6Sg9QqOSK#U<@OUj>S;EXDC5$J4zA_EfiBM9ORkgATUu<3D0YYvci9z$q;7?y8(owt~7w3%QM^b?p$XcM(Ay$`D*?m&UCUNv18z%!_aaoV7B5 z#S4qg7|q7-ydGP#_AN}PX>#+Y{Hc;gaH&=|^~sIR_#>O01}Kdrm1L?mR1K2x*7+^c zC0yl3ERJ|&g2)W2{EN2S^(t(Oy!^03N?zql281uQQat@GY(O0CNWfRDZc<7W;ZC?U zxOX+a?6ecVN}Mnb&11Jw1i!LUYz@1k<7hFMV0kSx8oxx-`AjsMEw8$*6$hM>)m}fY$J4&UT^3#)ua%38;LiK`Eo{|Eg)@Y8 z_7*l##mSWfZ$p}dyS{Pe)IS*fVz}Sy&B6-om!tV>t$=lmqj&C?-#X{i z7z2ZKz0@jQ!Ehi+;YHokc^BjKrkqKjYT{ZbG`{I@;OA9JFlxuAVE4*ldbh!rnZvjl zD3yiX$HSL0W(ns&|3SryzvKHv{AG90A^IKOkPXvQRy}ASKohNX*V|%et(37AIO4mF zjtSbp)0l;63}ZGI11>V|_dF3!Pa*YdO0vot)KPj<=bv8f!RwcmN>)Ri&!+5^sCSLX zNHagA&>j}(B~7iN9m3H9MBOt^IRq0DQRst`2nN7ZMZayzXc?z87vx2oiG>V*3d}yy z#(!X0P^B0YOzeY18CMWQ%hD@D4ZW9`%bl#x)(NNu$Z6%xJ|2acE5s^ylMWFnCh^$&Bx5U=(*eW*DP>J({~Wp?_yla zV~TO#!F=Mb8yu17tayYcvE{DkR6>$iv$EW>c-v1j3Y>rQm8#7@4o9q2#AhtO26S$qQ=ph{W0zAh5P+wVrju{ z&zA%77}`{P|8V#qLVSzr9J`X=Yk&C%3dPB!uDaLF3)@{?f?0?BUyK4 z;GB2cIOv{|dl9iEMM{Sn+z&l-8S)q@ez&;!+_1)SDMq#6qKkAHeXpVv1IrMv|B6u9 zocVfl>N_K`XZ6L-59RpOgQxrg)Ehb-??r%AO1tdX$d=;SJ$x zkD|wLtQOSh$u2r)JAu~doih7i{Hnb*68-CjRPVd}?;t;pP=QFCp2S-12zk!xHA>zi zTny_3cUnrxx9#}^UIao*>YeQ?2g8&huPwVWT(%BtQA*cx2*+Z9|f=} zIz&7&05K%z>gB*0izw<{^O(lFo=%Ch7-C>h67{aW^d*UY8@>0(le8yMg7pOcim}|{ ze@!Q6y^rgUYl9Q}%;q1T8r^e?r<}}qLYt|g&Mud-d;0EAC2J^|*2}Iq-8}ROdDV7o zIBg1}U~M?yP!3Uf;F8LB|I}4137TL~lu`;=f#PNWEP7oiG{tS)W9slr^sDB823vuW zuqQRLc@je;wrx1gNUzEx_BK1RuNl`zcx2>UM?$tz5Gm^zQbg?uXi9RVzX}GYPk!9$ zJQC^(X~G*}`9{^FN#7KC6ff9ej$yu3#u{OAM!^M2?fpC#9(DATS{_Rv<8_gaHnA=t zQs8IJ;Q{6bCZWx~H;rrxcnwwh6E3~%R+UxbDGO$Jk&~$P^kRsJ>YBv!F&5ERk9l)^ zcu{r0Gl!=p4|TSc3rqQBUgFuvZ6LAKbsjdqR`FD3;nAk|*r`-yLn?RVhFoSAD4Ikl zle=EjF`=?HvOLL_M}$10b#M#DufGv8pd!rHLMpiH&XqjpQ&Ie(rUJuv$@@JfDq$G- zQ?j~4McJ?N*|IL1?rPqy@X(87BitR)KlM7U<&1Zt^uqSfT$O-ki@CS73I|e1s+-FX zvheFt*|@OD;zp&hS6~vxA0c3(_(9WrxffF?Cf?g3w|x*$$WC?sa=>wtoT(2rEvW(% zjZRyq*DNdGAE=K{ni$L9abkdffGPgc zkNjKz`oE=F0e|O4{WH%B_&XrvAAwfD-^XfYOpGlIglyelwEmKjVf&0wvU4)&eC7}T z`F;Ou_~idlr1k$CD)#R)tbfU={!^p%e+L!&Tp|Yiliu~Yx()azjf<7(lXdpDrLq5> z!2EXv3c!CTg5q!c^*@@}e_xmSZ%yp~%F_O)ErR^(NdDh0%KuzM_zwk90RELk@%j7x zuXVxy_5A-A#_fL#QY+M2k6Ld;?pRd1Qv4c;^$sKsKOh#2?-5m)yZ=HJb1u5Wb&PJ+ zy0HTFEa2U*`-t<7Cn*&=#|3(}yS{IJke+JmUE(#VTk|Nr^`SxC$kC6lTYtH%^)L<} zAJ=N3_}+S4--{@V${w`dW}xS7_FF%0{dLS6Q|yPqBq`31=a-)M37hw!j`rnvvi+V0 zms`~xB+|O;YQdc*jH2ZyjE}<;DFz0&C(MpFvyVRqJ#aYLFOzqP2Cu?O@MLE6k&Ifb zc?N3sQ&w<@P|-h+%-l4e#FgQwSu3*k`qs~8b|Is8Gwg7SVO#%T_&sD{;nnz%H`n^V z8!gzI(WNJa%JtN#U3K5G$D4Ng4C=zY(5I7+U+=yvD7nueTEAkWgRFQ&FEU)>U&-|k zw8CmU6M0@{V+1j@TcnXu^i~E^r<<9WNnT{RMyqf~z$SDaUfAt1O085C+tR*k8DM7-(+=SJ#)lX$;L03c$;O%z;NqAgs~A z5iumHo;plV;v*CS;Mj>6M2njW04yPMowoE17VM1msc3nyJ=s~i)=SBsUXNNEwe zm7)AZ_jjYaUtNKyuKN35#&?sIs6)|7qN=NQ+sk-<}C6gc1zRA~6t)$i~8E zjJ@ipQvhh<(mRQ_u%`UduF5l2rou|M9L+6G7Vq~bQB}b zhxOJ(Bz`#nz;6yW#+&x5{lkq|X} z@QWr}NB$3Ok7sz$*LsaVYhxH!W4pVxPJ&*%1z0<|W{gFpI;UJ2U|-1Y6a9!=JaC~{ z!t(nL73gNVi&fk9hUg~De1-RBv{!AMs$;bzsI|Ss({KxFSky&4fbCurQ9K0Hw??$jOT%kdTH2Yf5c7bStb5?3Ut^b`P} zo!OSo$obyGa&yN)HDPwiLnjLZ6wM&K!Li?YlJ=&LG85(MF&;o!^3{90&SyL>>310L zHrAAHESvHE8NN!F*7vhH1){dTkz;ftrDQw@b z?&$Sbe)|PFr)Ip%686!6DA8|uNUcc>$$AtK1vCXKbo83>0uc8aavBr?oK9;0ny={^ zcES5kQ7qkFskEB+_^DX7bM$NWPZ6Ry;$ZW@wnd?~RApOPHuA1kq=b6(T`d}kasMDx z(}crni_>caHF{x0wiHX;mi89Lu5)4gt`nYL5xm6AYnWgMZZZjIxME%?7hy;zV4aIQ>#PpfRWzqkgSLG#ZsRF|nJnC91uOwS%>(1TLD4Uks8J2|q7<_1|U+8lcmlG)BH!3SjtGpn0TUu8%X(eM*>Y8AYpcJ=z` zsiX&rCsSVSLKjuN87A!M{4XZ6DfVH{-VTaNc^>$h&sOX`%h9O%whgDbld^8dcJT;8 z%zW+=m$b(dP+`{d){!vmC+O0M(IRWv$>3Icc{Lc?3zVp~86%Q*9HbG9Y9Gg{XxFJR z?(PQCA$jsF5>wV3%lqmiC%#VY(Lq4<*-{1dem*9+1*GFmP2|du;d-y^^Tie!2s4~` zYSe=AdEsbYD-xHclkE-!{EG8ASrXkXo|qL+g$Y-hjYTPzO1NQE@P)-aXM)TI5o6q! z;_~GBM7svA3yZvy4=w>XVfx}Qbt7qLsaWEKYmT$)KEH0?@d-4E6MKX-k7*+I$D#FK zS=XBLnu(}a)Q^W59^>2K)ngu!4tS{_uOw2=xGnK?)sV#m&J2HtcHcZ9B&jO$!rDMb zb8W|jtJyD3d2QUc`1VZ?V}cV7H`h5?1Jl1DtYVVbqsrrUmR-#cXK6u?p8HEBma$y- zH||$e7MIv?1c0`ZgJq2xNZz9Ev{6vk z*b2N}<1#|DRVMV);J6_deCcBhThQQ8%{AA~C+2?~kxY;k9;8;662vIt_LjkI75}5D z&lF>0BC+kSO1FSQAERF7p~Y6(cGAry22)wv_KOO)v1cYhh~WuW`LXLu2y~0G#CI%n z!h^Nq9##r-eU0IOro3h)9*_jd!WplFDH~@nWFAH0U)M(ZUwnmRFS-60QR07$Wr#K7-#Onj>AAAKMrWWjSc>tmC!H7gay1K<>%83?DXvoJEE`-b_RoBCI`TPx*{a@+(vvh^IDc+3YQ_ zwjPadiYPs)xq?;uCK1FWEX9!K0gv(VtCP(BU-u|O5HUf$*3c)JWrX&h%m7~`cU18@ z`%jI3-e311XGX;2okEQc95?=Gp4QsA!->k2hXUqhuHz3puu~=0&?P!hGyxcN0n& z+sxC?AXY*9SoRXJ9oe{Y>7M$_O^yrw!@AMcZ0V*uvoiURG%ShPP1r|nVLn@UvX$VM zdyc3rRh0ml4*r?U`CU?M>`LW?*{rIgYh*BKRcb}Ql+yO~>R2nDR?SYOXa4ogq3RoE zH1KUbrOQLeU)P>)Qg8lo@#|OH4$8LTHubx!`CU8f*YRJkpUTS9x9(~UVB1*UHNNGm zOf=PN(O~!o7&)E((Z8wf{{dWLW(530f(`g@G~WNi+WzmDrhnGLpSOj6NzYgk*`n5%jT!Ak+iqp!j0>fjpNP4m>8K| z2Xu5Q9>eE-n%{4pgROc$iW*xdtX#dkJl-Bp)fS^SwO1cHqKwSm=ih$pe{e)S8Z>wO zxp{u%PrVp#Xz%!Qe$U3Mv+?@=yvzRkYpZi})A_}AKksY#={Z4mRqy?SoSZ=G+tqPT z^~bBzd36)}!KIJ&`zwRo;zwJ@pHeTNqitFv;6rEAGfSkAp!j8Fvfk^oKj&=I-Re?K z&CX`;nrG*YXJgd@-)OG;GZ#n#w!3#-*g1LH))%c+_a=|unZeW1_-L=eEGL|)l=pb* zZrif3jgQ*Z_PTcjrk(v_!`1N_4BW=X{R5>+<&p3gE4x~++}mMxI)8wDmoSA2vCqXM z82IVxaQmG>29f$|!O?en)zIfY{ae@=m}#twH%1M=CLi5}mzFB#BPT`&#oDinVt){k zSBkA%+liz?tey_5pjyutJ(|V>0xQM8Em7lk1^E(yzAl4&^t2t(yp=Z{1aBs6g7OC0 z3*ExKhq`*=cJvB;jI~{S5WTy}CW^bj>PuL znTb8?pU?~?63X1_ppAlsF}}pt-Y|Z%6F^PB`GIw`lAHD!o|CTsfDt9_p02{W$d?G= z*4~<+XH>R#_x>scTYUO_!8hTB9_PCy;!!Gr+=dhE!OZeQqPnYVMlsy9xa=EB?tN;*SZM7cP_#;Z5uIQ-YVMJ_M&+O&#saaFrTD2DR!i&!U$Z4JjgAL zTuqA~k!^DR#Fpuym;)x{%HjPGc3Dyb=oone&cyOMFSyON*Sg;tmyRBpv@+WEmP+go zJ5j_fwO$un?yh%r9X9xM7{RMe2In89jLnl+3RansWWlCf2!C2DfRa`5hYXUcUPyI+ z*_IEvWV*7MykxV{v232F-}S;<0L%T>xoTTum{E1V!O zpu@g?h`^jgzP@ithNt$GK~H&nuK1<{#ZKFD_D4sbQ1pXau3SqR)|&f=TbF7r@y_c6 zfga?Vglx&$C_^e~omRSsct}>kD10Elm+K}AII5!+LA2cagxxD?`LUMWW$W&0<=dyX zjpoN8Bf`bEuW(XdGX^{sD=vJIZENClmm89n{wy5UDdD7DY`Emt(*az_iphZni<4Gq z-u~%_x{>b)=bo41DCH8E6}c7ljl!FoTF?+Agac6856eP5D+pjj?w5EH0(PgxDsQ!o z7($gE3hcxDmwmz+78fA|QCFlI&1;_Olu2zB*XL8~$qmA^h9#}N#vo7JsH6ekYi>Pr+-d9R_QRYJQ8o&_k<1k z{GN$5{yI*Hz!5sTx`+{Km z=U2qiY32F9}8)c{RmUI@2Sgq?v%6oCs#?p7%M*3 zPP84ldlqaac2%SUhYnhS(qlp5@@271cS&&bzYiOViN(uF;1$C7JLOr|JZ2862|y-7P) zY+bnfSN}k9ZOCLX3^55DM9s+V^~dF3{TP)3VB)nLY{;SL6l#EJSg#k39ry+H&)ngh z03gDo^HN+cF-pU&gQLT`xh-gu{ix7(!r3Cj$I%oT%Fr`&d93c>DnA;7@ z^`${1d4OEIFdbgzt^P@EH$P;howuD%qD+dqm4iWmcrx%YkoGM zs+mIPG%G0oq8enM)WaP!h1UjRui#s3bg#RcCT6*i`=ydnZ$6=7?YhggPCPcmHxt93 zZm&o%04Wdpz#{%=V)z3Q>T~|!OIs5QOT{UIiGffWOLp6Et0VaXy9%)HpZU43C3<>7 z4Oi^ME!3OLWCG;Gh{c@Rx#yjGnNG^hJqRm-PDfX8MoqD9w&Q(vuPc}cRMN@%3ZlB$ z*nY?P+r3nTKlGG|cEQ}+89QS^-F`Rlm((sHg^QK`R0YP3Vi94Yk2@ec(`Gp3Ft=`cG%SRCkiQHQ+!%a>OU_El5t>E1WG=wPkxea($$!^VskrV0>*cUw-@7im?KGmX zX&MElO13B0C5)ASy|lx?GwqDzZ5{$+DF&2Edg&TeasHOEvG;!nti|)tA{%6)uMeB* zH>c4PTy3miUydIs`@ZKfsTXseRO?@ARg+|4Ob~mHpgVmvM)0bz%ogPyXU!F);7T-1Ru;j5;jgKnbBP?+c;c>Br(juh911poFV4Yr!_0W%QI-b%A?h?iR?BP1jIL!n{PdQqO3TVe*(o1UvPD13+GeX?kz1kMTp>RQ9#-t=qW87oF(9F9zWQ?v5Xo< zwo&J0wN(LZR~os$9dTo|la z|fb{&*90bwvOvw<&B2Ng>3h+JN^xtOcz@*|c^3sGee(xa^;gI66z`jLF-l6zp| z6}phScqvC2rVb~{mBFz9_gU633pvC5-sJhL5#^NB4yamalb!9B34x%MM@6Ca7!O2L zA}mWQ@>DiP?lz%=d68?Dm(=_CxLZiOU^N{yTc$ZN$s3#$Jl%eWs!BlqpuR{bXBi+} zY=Y_q*kH!xDbE29B0AkAIX=GY9jwW$kvHeOi!t~7X}3gyfdoKqjn|8{ybyt)?E6=W z5f7agj1hpzsxwB=I#CM#ObZ9{v4!NS3yfLn#DSx~2)M-t-Ph0$$C%VJ8SjG(pcl`q zGiBB?1s`HKC0WR|S#kkh;i?7tja$v#x2u{ zQXP9pZ0M)c?|qoN3!WQ}P=>fGk&ilmTPw4^o3!f3rZ3u<1!a*c@wI7vACehu`jZq1 zcg&1*o*hjIlG-4FBirY1)y-gEo7e-|ayk{(g&uDL#5a&W1$BE+#`S$@Xj`Y}?xrGCI;P0HgVt2t`-213{eW23dQV__eJ&e`h#4xqU>zaRw7o zc{V&I%NmQPGJr`vi_tHyCO1>El~^YzrDa_UIt0USN>ICr7vPEto>FDl|E_y9ClI`# ztZ>?pIYSfCIPs$dUO;@CjW&caNDSWU9}06QO%v;l0MD!ekOaq!&nN%Z(BMLVG%}qy z2FEN)Z8<2v-&Wp-B^3AECL{|1_h!pg@_4|;{Iv$sI?T{#H|1eGMsFbXeO98N$~Q%O z9(%9M0Y4>iJ#555DmZCXm7<2v)2%77mD@bjXILRkX}8s`Jj2sT1hQP@dlV-0(!9w- zRJmENBndm>SQ*|9nEP}28;w*k41>P|`x@(H`~HJ0_=v{V-JSu-J^=Z#f@j$@7X266 zG{#;7p%(A_nlmYpt8et4atQUa>cmtjigpoxS|BVgRPm&-*-PGS;UQ}sz zW@9R)wQMtvEnV8IHp=LvE#J*O@d6Jr>s!MBzv)g$ZX|fObQAE8dl_i%Ghbny+Jns6 z(b&H|A5a7+fd}?WnI=lLB3az;5S{0?`P3WC7_8A?(I})FLk76f!9!q4QBec5eZSYi z3wGB5F4$q0vbA5cB9RgVesYmrp~2yZHAlIXyMDDTe=(^&JxZ^nt9%B7w=Mut)P0ok zR%&KgAI+gwdl2?*y{oJGGRs`tHdX-SZ0muM4*SZ>oI?x0w2e&WxGL)RrMv&CEPCuF z-n7)BX;na_-(%NbI_vBS8|uf!Oez|Zn59wFm)M;RK4A_6nNl|dd-97WE=pY`TA%P( zLc!<0g#Z$ea!dJZB2X;%=LzOyFa%5sx((eK`mFG<6~bljFL3c#aXfS4-}j^>aN^0K z_1QAuluWI@(N?Q`Puw+k5KNlGX9j0sBxS}szwRZItIrV_Vc_(2hFQcW%VRp~BBbPQ zr=!ZCr^=B+1%X1N$Ane6N$eFz|5no-l=Kd2Sa_EAuAOm=^cnbNc)g@*b?PZShW`m7 z?n_M3RL#Q6aAZ8X&-SbVt}V_;+}f`g_{1N9!j%BNW%{5k*QCn!+j)2iK0nu@rr^Q7 z&C^1h_+1R<*#gQxrB4DwtrFhI-^@86>}*4`2#zNaOl-JN+sFcGS=<(+hiN8MRJOgB z_Ulnf;zXxWfV#XVSHsTqjr(&=u_&+VjUTQ<;=R6xT+N-|o160WKIAM5A`Z!eW~16G zN-UCf-C>()LIu*JSOKUAb=*AMH^x*2!aHhlEp5`+eHxt2he6cXD26!DCe?k)zWm{_ zWG>HW#n1IZh!gvD_)sWoH*jeO!^?7|8@?(0of{>8cT0QDavA;#*a(^}svN~~3rK9D zR1%m<9@TI5v1{5p&)wuC*HoQVC+tsUa!riJiDl0}qt>6@N5h|%SOb0VJd%9pIvB-X z&UvE_EqA`#$DI<=j{3e8SjGxSZT~YhlVl6JG3uijV8ixH6ND zk7d*|jm5I0!=B=gr8bls(73+r_2dM*ZdoQWx>SPaC{C^&b>^%7t{)A!?UG3Y@rUh{ zHdmbSO8r70V_pCGf2ZxSq@JZ>dEf6k!fyqMe(o*ddaJBXdshakD9A4TUZtD%>sFmR zdW1^>!UWYt*+%iKqhZUJS#*L)eTtfj6>CDoQvH*qC!+E7a*EiRKAMS zwfw0XQ-IcA^S!=M_LN$e8XL*s*v;T*xpO;XwV^i9KA~=ChzQ?rJ@}S&Ld=WY5kOAa zV=;i_+^tFFYFmn2iMtXI8o@YIc`d3Q<4KV&dQLAd!q*0(heTAR$*4a_9}Bn8Hemxc z-K2_6;pm(mxm=R_Gs5xFIQb6zwhMOZgm4jR-p zNcwPSQ29iHF0W2S@2sz~r-9pW+RWtWL+qimqgxB}GuD5T+E>?R#!gNlC(%|CeY)5$ zG#7QhkZp`tUaapD^3W_dXxAvF?9X6X8f2|V2F@#BS7U|vyupZFj(UFsI5JFQVw~3N z(OTw1wSlz!hvP2<3}j zpd4(P3YO)SRD-z>Kh*^$0{v;%@;+>!soa@xqf?s1`6wD(ay)NkVYKt5iJOJRYFtXq z!z8tHV`P#~k$s~fyp2v^xHS_?=Z1No5(~|+`eLRchatl1@k8sVHdql)i7wr*h^cyp z$a+e1AGQTlFrYQlGYjAL;e)%rhJZ#(An8F7S{X@QJ%UPU(j+9@ z=5%aMz_3PS#iDD7Iu`iGEuhT1Q?i;(vRN)tN(O?_)rw%?=xv)6hA=T&9Uxuh8Pf6j zW#5f74pCt}HPCuymZBYYamc3O{DCNCe2JNkz@G4iy2*?M9nDC8- ze%Jkhhma>4>5b!F{u;o{_VIWaMw1jUru^L*VWdzw~Mo_QZ`aBwmHz7~4+bgoV* zrva52W7ee2uf!o{uJ7RH>2}BL%=@zrVm^L__lnR29o?v=jyN}Og+wXy?v$tm0zErg z|84G}VK2lQLF}2$nmEc@l6rr@;f_!$`It1P0xKiz-pn5ER@!P!FvJ?kXug=!eGLqF3eV^zv#Z!AuQkJo*$%U{S^Hj^Vzk9&ynq#D$U{21SqNVk9*F z=p$nV5Kg0)DQid`u!^@-*2H3sX9pL_=;@|vA&`=4zdncPn=4Zlf&cYEg3&l`u$+aA z(6w;ff2Fs(t+Es!A%U7Z8y8qJE%w&`9jc>@J|DB_&bisOF;K!3M@W#Ru%n|U?jsG9 zaub{5V+{6OA}ut7Dl&F$lr!=B>=_&6z?YE3d={4>dT};}kb*wUCH;~RP%r!X$5)W9 zxp3k40~<(vraD5@eA3o9Z@*iI;K%{cwAdoAZ>Navzp3++ea0(3&jz}f17-&O7j}OlRgc?!QzOSP}iWxgnQD%1YnHq{z zO_u)3zpcmUe6-CqW5SYo`gvs?DEdIJwC^@#@@>Q850K`JVcKw;($?p>XeBO4%gP3EcB~tnplF8J*lhb;ffri?`v0f*OM+ zYB#i-!SY?#SmE>I=$_`weQtjQtVTs(_L3m`T5i6D9{t2utiUm5Ga)yWNWqTNpP8cL z+VB8BaGEClHa1T222I=C zvg505WD3uUPb4T_TF?&d0@9PUO{Gvu^Y#_mjzWphW4e%K)#_luQj9V%cM}@?4u6Vnb5Q8=~1;~%cB`EOoX0_GB+zXUp zoag7((zlgo^2@8yrG5I&-{4T|d#$qzAU?(0MuF!h{(+fI=4F0Wjf=t<8FGl@YRAT# zK$Ir^I)vy)C1a8QARgGC^)p*6nZX#)Ej45eyGdF%VU zA-h9N+j2EExjO77sJG`hLGxS6mFvqq@Vmd#ZLXc!L_3;BKkaN{Aq78Go{-B=W+iIy zL1l1x*Ite0ka+uj3FLP6^@FC6lL`MVDRD@Ce`jOJft7Z5wx2>i*gW(sWKV?b`F-4N?3-g`CM!Q&FGt!rYo2kGMKU1Hyq}eeRk6_oot2IU zE77DuPFZT-hMuOIr1h@T2?~n z+S;46B*uqC?VwuUtGj*JtWO;-)Zb)d-hs^+`cc)tk2pq!FA+xwramznM_{u$G8P4` zJYiZPz?;_2SuDsnCF*yGgaBCdkLeMoGj`#<^<7W|^4Fh4#inA7rMD2Y+VVG0^zP%L zKO9OUtLqz&2jhdtVZ-Eu@fjV`dPq$y*2+2_VV(=4yWMJbb@o=nQsX>t;t=J@5Nw8` z#BYtOYgwD2vA8(xrd4lF=$%FqG@`t3YU!gD%2=otiP4uCV@Z7Ut?6yOsk3o;SlOiQ zSPT3Ymc}-gz^l?@BML?>Ot!!{bNqt;nk z=umPb5@Yj$!N?`5`a6D%OzW{ZE9iwbMTvyc)8i$9&hyqEJg`wU4f{i%V3JB@ROpMC z{bTjx00b8s2qteU{xOSQ6cA}|c~{bvCQh{@ZL zsbueBaQY~I>Idqk0|aZJjfqflH3=64+^?mOc4~X?ACffBqh+DxYg802%Q&EW50RyM zRxPpU-rx#D=W>y5cCAicg?2NPJ03?w9uAu);~kzY=f386ZB;U`&k! ztphJ&f@0cqdx^_a+-#uDVyQ|q)i9pOR0=vS!BwHRx-np1--dcjQgdKAE%86H#>7Tu z;H8s?ZZ=|w(=%hP(QK#Vqj3mE@uHE;Zrc>DcT#Axzvq(^=9-BOj<1V#5)A7eD0O}g z`lZg3XF%7i7RL40a`fb85fzd;BpbddGBssQR*(`T&z<|oaNSgldN;VV&(p(>m`3h8 zncQTPPU47f8s1x~&S@=#?Ep%z4+Kn}&$*5kr^0 z2I4p}h$;r>ejSh@Z4E`_HJZax)=lU}Q|JWuX7x{*-7T=hy;RF5w!&(oJ|Sk#4zr>RjPbgqnc4IW{z-a z;Ke~1?U)=Irp6>ZZ9O3;OtkX3Ep?6&ynA0g@^Y+!tEz3(L((*H;T2h98#5YqSE9BOwT|be**IiykhOE2}dNhPlm19Sr{lI?bl~b9Hdui6=&*!2#C8 z)R&Ft4c+BU$LSaOJ1C4w&Tvu;`xmt;10#)TNz|(qY(ib; zwl?)sN_$hniBgF~?NDf4dd>p@4HDnyU6Z>-ak23~Vl=e5vej3Kg?vw&4zSh%q~DGT zUd6UE^q|3k?AA91#o>*pCYcQTgU-2QNSQ;}Vr`G5%Q0mP@ia$B@%xNg{evqBTXqcTJeAY(-1;NRlri2$rEQ5(BfANm~6g8~|V%CWea;JJH|2V0WE* zIw}+Cp=$IERl&YyuA(qcJW=@o;>EuIIP{JChG3ylNwaEdl6aE~`D%aMiu#?TT!c&_ zX)yoDnqmXOelInJjR7l|dW4}p^YROSKIJ2|jE z519B{`On=CUu*e8hJI4Z=H_EmKG_sQ_~%W{*5uo-yd3qz(=csmykaElyFN-x>2(v) z_gmY`1W-WZ>{}jq?!BfEk^Ekv&Y=iDrfTaK(eQ_G?>`?I1|p^ZCdBs-1(3`OgsFUn55UC&~%HKWvWw4?}za06inj-wg`?FO(CU^o)dmg{yrY z(*HWU_ZQOvgSwodrHPRf;a?5_`2BNO5%5>P{O4Ogw>}jKe|6#hZR=B?@K?p@|5POW zJ0U&buj=>D&;6$jxc#e={%?o)KNE5Pp}t?hzY2fPXk~^}G+C4L;Nzo`a$OlD z&;CxnE_7W87?mBm5Uy*C=w6^<YAliW2an)Tnyo=XVNReaM|b%8N&}Pd{D*7 zh?BYPAMcX^_p28a>$a`2KBk4OCbR3OgBN-&n@;@h7YW#n7Bd&NkJ;?+gBI8o=UG1M zZ&$a@nB4QcA9*i}Qq@^4h-Ih2Z=G`MlP!lnM|>Xi(~6c@5z7Y&JN-&$&ptP3{2nLL ziy!$fkH^v8&wZmFAB%d;+1c4#tM~ja{G-|0&z;qEx$``f+$#x@b~QAdPbY7%uQWt& zeocQi!3Xq99ZrBUy==BGr}VN>xAcSFKTfhf-m<0!Oi~hfs>W-^bm1?q!%K2c`GaZt z?r)?R+BP{g+Po`n3M=piWa#|tdN6*vwx@BGY9OK>(#Ab6lpd=^HQ37T@kR7Ld&F3~8ef#(a zUXsZws~t_-W;2P0SOAgt{`vKJ{|BBAHlRa_Feyl|>XhyK4_SZ&1L#NG=Hf6GYYGqp z0fAHQi1q4EsjMB-Rq|ogVN5U%cY0Mx|5#pY<(AjmrT2OsdOabawLZbT@S`cDu%bpJL(2GSrBYs_WnNdL+% zdaJIra2{H=oRrY(er*(ypI-=o%QgtoS`jegh$e#~xp8!hAgGT7ebp)QB}Ds=Vo1O# zoAoN&cHl1CQA{l21CEYHB$SGOa(?VjFp;Zb%DuJ);glIz>B!F2%6Pu&kwej0!v5C}UOApr`AC_M(BRB^^psT~W=mnu=<}RVS5J z!Bgt&5J6T;>1jYIDxTBg3(xH^js^gbPyv04#{yt)d%U8*e2-ixxCXmX1CDI$5?uLb z&`0WiZLcbNO7d~B?+-4uZnOZ!GF8nHs^8z7;rCfYj{&t}2KK=2#T+Bo`k#JWYG^Gh z1*kEkiK`vxN&sv7D8N0E=e`n%p^-MWA9O>-5bl71D~4M*P1Yhy9dC zT`&r{9nt^+Yh}gG zAHm|20`p%Qf*s>}AZ{c27c%RGljBY85h*fvwLyPyKDIx}ip3xLOGI*fg@)A6zDxFG z#2PG?Y8N*&#dcDPo%61e%2hM(8gMC+lHVc?>*B06UkRvZ!K&C1p)z-y;slk;7hHr; zynGm!N^&$jC=$cdO)ksXN+r{mb!L;MG08IHD?IoD_y}{%GcTZ9(A@FV=t$N9V>6O3W6f{sKX@r09 zg3BscNFNpUk)c2p5OwfdTF$-g&P=H3y5!5Te3QSo=!d!1V(HM$>W1bIXp0J633G@Y z_EF7(pJpNAKGktsdj=D9{Nc}6cGqpo+WTaB5wPLMj^C(vP3d(|u>0l*d!=3X&Mu2BN zQNu)w`1tLHA;C$TPrmc5+suq>uBJAb*L$=o00;#3rai&{Q5MbKiO7RW6o#Pu!<6Ke3NL>$il*%-zXTmip!Tgt<1lXQ6lfq!cj_QUlDk1B zfN{&K5y$8_R(hqX6NH=>le6R|Ej9#)_RIK-woS8cDPUAAFKX1|^D!KrSK_}$i< z>o@e);!dUV^1+6VG=;q9+ihtcD{SJHXn={tlv8eSdmB9qY^;6Ju0kFP+{0)#o{CC? zVGr`XxhunO1;~}Bpn%qFp-`!!A+qe>3H|)OGSr{)N?(Y#rX!00*pn3XwO9AWC%w&? z31c`WCW;2;uzElu-kt)aDZbu4KUUPi(9RP(y6VTpd@wO`nw|`znTz7xC273nyl{MP zj}4Kp&SI&ti=|)K=%{v7>ph)M>LN^Lr3n&ufGe_t=lBkIDVXD4UC3hr<;}oJl@Ms1 z^Ck(+nidH+`p@MgZIN@ALOgZp@A!^GssOahzyf&VtidSb5_@fWDq?hzzE;ZoNZBAL z8A=^3TQ3>&6K_}3@ia+Ra0jR*8!j)VJ_KE*Lo7&jJu=l zkNY+SlOrJFgyxq~WFDw|a{~vHnh4f0bNvZ=JPh&a*8a7k-!C4^Ky3sSBS7rW+D77= zvr?l`nNfHSu!{Y(@ec`uH^qt}nG>0ee>a?uMh!mdZFK#ZA)gdZhHETNUe*Q^r#}>#46NF2L*eDOyaoG~cS-00Bxn>E4qx0)Qb_PCOgN{yRlXq{q e9I??uh8`kVmepsl|( zAwW|bWcr8k0m(Xh9BZQNd_z%3u(EP+S5$gZr#olRuh3LM!zNG$L@si3^WXvpz-lhY zYlz7of){y>;v+~L5&O?Mq@zjUr~ZI}dYlUbU91G-9z(RAeiPeHN@?N1Ro~zGpY`LL z-tv^Dnj$1Nzja#cgIm>WttDR-2J1g+OC9P!`rLnxvcC{#`NK1Yfpoc3lR-<@;T=-F z*SPL{MY*a7CS;oGg22&sKEcrID&dREG$MBu2MmY`C-hXaAbX(G)M{kg`dX@USdQZ^$QmqCtz;cqAx z8{_(hs_1b{cA}=1dVR&ToQZ37{&&Qmm9?-)+%nD5hLmN3zjAW-!l-nbeB4p-@0j%Y zwUY>CvJpCz#h+-4IhIW(>nJ2$9=o{uHxB(nRDxnxkGXI-*$};a!CWf>0;9Q%6Mo0* zE_R+oZcUB!K_@ZB0<3wu$P5$X=_#cZ-~g>BPxcpwD*?-7K|{@Uk&S{R?G`1F3x)7y z_Sy4|7O0$bH}hr(Q)AiKJv<-gi#q?Ibo;EOWj%PBlL@(JdYe+^z)tQB(j20rY`*tJ zSIgSwVQkRI-0-xxyHo#-V)^in5NHZ;)?p^B9SZUoOD#7&r?vd4l+w4X;+Qk;8)Gzo z>+&cxq|2Cou&aldwS^dfrzMeVZWZyq`%)=>QoV2`P*Vih8LZgKd||4*qz|Rz%V5nN zAP#zK_HX&xSQqmjc}T=iX?%R}na_m95hOWl4UtRE$?=Xq?nXs~#g^(YODfI8oxO_# zgklaO{qp!3t61lLoo}0r^M2UFEg87<-k2>tcKxz(9J&t6HLwz{24=}wL+Hq1N9t0$ zUT?NBP6r6eG*_6fN)>VbUKwX3;3%+eYDHMp#H23r8qPaqrpbzQB5#}hzoi`v$bDDF z&8c|FETndsF-gIP&*W~l^(gFmnA=rNG%&zwk61|L83*F-nk=$VFgK8Z}vuNt{HE4u)s(?@{(0A1MPn zg7MZ)UWkqep5Q0wT7ws~DJ^z@?jc4Hg}8dnZm%9%kIwj1QOjDlKy!M#>gFOg+dv)1 z#A8ZbB%Y&NVH&DPYhUg(0?+qraGvlZUXtQ**2lQy!Y3c2TcZ|$bBe||?@)e!lnRew z25sy!(E6BUU3uWXtE=*0O40q$dAjlYFijgx3m^BdTWj|f^y6E1?fcDhF%1#6=9>(g zC1KyY$aj?~Xmj;uH2)=nBKBx1J8cr zuV9FT=!FJh5NvkUA=tk0w)gc52#U8111u;5lXu~&{S%#J;DNa$T;<=eUvK%IB(AL- z`k)LFrgN%9H#VGWmbh$rz{5p@J9-khxC?3qa(-svUQuw0`W7SXHH z^?dDd95~Sn^LVl*>6;8MGa|{FhO~zHDM={@@&dcX(n~*@3luY23;q;~;yHF}Q&)oW z-D1j&EKC6Fy=4YEgv8s@BTUwpIlQodBwG0xKG>xdAQ_2yC2|fDXjQddV7i2VbMNyo zmv-HqcX)|chX~$Bk)kZF=Ci->oA*;;c_;baWa`~ls6?YV! zMN)EmK~X7ZK7gTL;MAJN90+2M-90|Tjt4rjUyYCH8F>kJiaGaGm=3}4VMY@!HzRav z5;L+^E3i#8W+Ua$99;?^(U-0i0M+tw0a8Jq>%JR(_&3X`VDwyb%USPgwW%WWj3kQhoS^hLqER=iu0-)=Qw;6}Q37?X z9<{biz3O~^EGvrsbY@)uc%u!fz?1k# zf8EJ<3mlIgI8muv@M-X)iSZgO`p|KN;Vg$oU4(N6Ga0#v`3U-we1_-yP_m(faW+{u zHgBzqM`uto0={qSmGWwujYgs;JO_9 z$yPu`tMFNz;P1Fyi#a-KY$Mb}wwBg<%!#(BGtCi3N8p58qImI{hi$x``KHr66|jJjK zgKCGysOcZ5!YeJA2UW>8sB>Cb8(wd-$-(WKO$_Z)F&F{j*vGIEP=r>EaX7LPr+p7Q zryz>p=a#_WoN2{VxOcI^Qy)?KgD#AFW%I{aY3P zZ|LLi#Xp?qZ;bGNkoo?T=>FYr_s?7Zh6w*Z@y*QNC;6{H&;OkAznA3wvts;5)cgH{*@{KNwyAOZ78z96;Rc%>VR&DpFl0l;uDgCnw@2aEe%j4ls@u zf*yqi6b&?m;5aTYSHjGbw7_GOQA)oFfRWc4qC~*6|&D zp597^OLuO0`nbHV!~MK?cuXihv+MlmN1n04=hJz9k&{#N?Cf;@`Y^qG`i}p7ET66W zF2p)LRh@A?O+Q?qYZzUyZ>n)kzb-}!adeJ8?z!MyeK5yTobHf2eJ%8| zb9Ak|bxcWlXsjnN8JnmN6eGEjdP-w}L-tp-CLEGmZ2=u-_ zzi7pmy_ur>j{ofI{w4Dvb>^i<#)Q&+pH|QC;{{#??qLHCZ%eb-$T$aK~z)_zyl zLC~r6#Hjv$#<{nyXi`?`K1Jc|Tb6fM(+IaOuN7F_yVP;vb9exB9>M*Z6*mtnul566 z6a-iJmn@8pyT)=3+#@eFk1$usmYopJfE_B{>rdscyO+b4&M(Qp*1lkOyqndd>+O$T zA>|(YEIn?$Q$;rUnRTFLrRM-aMM3&mD5;5tjp5nfi5z~-S41opVQVH?5bjDqo$IFJ zm3WP?202uQ)@R}EzcQ- zIBf^D!sb7#rYT*%w$mB(Lf*I~NtK@wil)f2c$87!L&1EF=oeav_(pp>foR#|*kJSU zC%m#%Z!R_LwsY5=XW>hp%$8t_h3}nn58xDmwGhtH)e@_! z`bQj&o$=|tMxf7)QvSkm z?TF1D5mjkJRsI-8UEhU+y7u_Y&A!&3z;x)t2&X5}SJ{e7(`=^&;{T1da)+%5nL+<7 z9=4M*InmYm7~(YEYz$G>zvuZ2rSqv4IS%(^-r*(SbD~%;_Uxhf>f~l-D!fJ6BGqlP z6^ZA{DWC~1wk*a@Tz#Q}(+M9c=l3UsrZDMCaZoZt=Jg-;1d;Q}g&@FnG5RmzZjuu{ zot@|E%-B236uD4cUNh1Io;^!|oAyA|_FOEw#@As$9_HvAnSHQl#R%3wyU+ne z%EZFI zEmc)X_aHj$9T36BQ0riy*$*BLB}uG;S(u=8PyIGx)U)t@C7mU&Lk@M zefyJ2EV;~+M5}%)cxhMdc5%LQWlRX=*zSIi{<%kH3TDx~UWWBiAAVz= zf4_4hjw@T;;OFy5gP;Lt%;;P`w-^Yn#;r{0w>K_v)Js`U2FY${5-K;(apI6>(hoPI z!Ii-G=>&d(2JHBxUOLfCF8W?Z+0q!KLq-*brh)(U%xSC@m9yuRIV<6x)7PtS@*ybC zZsXv&)WLb5Ut1CbcwC_{wI+aBF@rjF+*~O)RG!x0Mo1b-9$@cfrt2Qhsd)Kgp1jH^ z4OB@ne|YSW#dm^5e4;sz0M}#8ol&I^A^-!oDA!|Ar6--|;4gv8`ZN{a&|U(!`-ymQ zk1tz=He*rj*H3hNO9)}Oszj>ufZpk|CP*;vp$V#*@0ii(OkI`$VFmH!)^NhQ(`K{g z#WNY~#KVHaPBZ7ral6@$a*Fsu&A5oLIf4T|rLR)IG}UT+G;+M^UMq!3W)_#5c%?&! zTneV}UWoW(ORKf?-s!Z)&T)UpjHjza%?ai;Cw+vl@6AJ)k_L8$?#DN^jNE1~?vH!Z zOEXIDA?6($ePov-@)wE1R@QE<1l-PCaNsAe!zE!4mO!uNZJh-QpG#qcn>s208_IVP zk}opK0USlV$t7V*?~eoxEkh~hSE^m`+|X6UI7 z5u_Ze>~)s%0Ko8kv7&7m+JWb|Q95w6QX8%W6Cs=ghn4DDVIcd}$4Snr#kB4W@ohX$ zGYlnpu$eNG($h6^tlQgId%0v#LR^o>Adp0Kn?36WlCvkYY=ZD6&m`2P)D^HLJHtoL zuWbluE7zz5+Hg(Y*}F#S{-oV7yIQ!;MC0t=0}ll`dPYxX0;6@zL)7Eu!A{I+n?=Q) zsu1SI4>;eCgL6i4B*cOj-eO%kM^GpX`o6b@7n@YEaR79JdTp= zvGOYppnIpyU2kk$=OzfH4q59Sq8|!^=4UgAe&fbhzO*zhEG_L-Fix~9Ln}}b z+12B)=cgl_%#sYlN^O^=1h;N1Zyp~oYt#}`ePG3q6@^9tlO@1k%=wUwqD;$x6GONZ5GsC^0NB|DyTNWdXG7w6(;gocs^ zTPGArn|@=Lq71>Z#)YywQ>d=qqW26HJBz-WD>VSB*{>xE9>JLhy_oI#J@9(6D)XT_ zf31OWySEAmANS)KU#X48X29#6h6C-qh0t&GHSQtxhLyq-boc;J2X;S?g+x(Pq~IiJ zdj$<471vO6wmcRu;hde=Bo9^kl>3XP10K)NG}#+1Xd!DWbaw(Jw{Nv=PQ+(~Qaw*V zQTZwIG%26wWHlao+WI`HK(Bv8r$5B)fi+_Rs8RQsHKZ&3oa;5!N$Z%iSu14{@fI3p zZt`vvK5ijp(x^-i=+_X4 z$e(-3Z8PyB$Gc`B=KVn2(;%Zt8ssq zA6|QVkc+Xr+)@0h7nR>O4_fi&CKfc1ER58B5S}CX3={~#3~OIFpF=t{ zo*kUynhbo?)2no4G~){gPCRG&)2D#}ucfAtX%DTz@H!ac(BO{xWHwNM+WdnYx{~VM zac1onT}W0WRE9y)YtZH;ztD^c1#o~rR)VrttF*R*9>vUSYMufSPchPT;+K0;qi+Mb z9;kMGx$|Ot)!@)%I}_xbRA)PU`@_6`({)8=FdAcxb)4LW7`UwM!^BQdz^Zo|v_7H7 zYc~0;t7TGwy$z?0|QTT_{8{E>mz zR7j6_tTl8qS)0?;r8{X2&_lRI6q$F0_ZA??g?~CYPfDMbrkVWk%cqN1<%kWEL&uYl zC#15m>#ZA>GzC{R?qM@A;kh8-q&3U$fq+q3?QS^?tcS2lE54tzTg8QMa$wB1CWzY$ z6m`w=tpstXjj5$%FbT~?I-VH;nQ=i*N2}X$e_Fct;qoJQ_3A-uxq(2 ziaR8Jl&<=DU!zVbiPMn)tEPJw!≠YTY-W7h9O_WqT3lzCFIUY7S*>e_VnSt>TOo zr4Cs#R1>sjAIw!eSK#K%^s+x!gsp+uF4j*i(KYc~{b>fAEU`z5UdhAoc58IhJ@ZYT z33aS<0dZD-8B8)KGZ`(j(M?%sX;oP{mAh5q+WUW{v%kXf`G}rRrv=1UfmqjrXzwHi zD3w}7I_ar29oHm561@0k9XExS!i;Hebr5muuTiT|HM3*2wGMK9KH?b2`ONK=Hr_l4HCDf;9kTaOMNj zM*6v{!V1!qy4aH#BHXYe)wL(}(DfpY?&<>F$+cAqQI31zlb4trzI53@$^4T$^XBDw zR5B$gQFCLa3Fo^e=eb_SK-x%%MWl~)VO1LcqNtX& z#sE9|>rI7W!in{^L0SCJHU+B<2nQ`rBYeCwW6Bd4J+wy@iq;K!>M|eS+&nxtE3-8t zk;GFz@6M{y2H!*#X@4VkZoe|6) zh%Py&fa^zmefZiBUHXT)?QQG=kQn)&c^wh??ql1+>?}275$dq8l@L2smfuJipr|!I zSow!OPWgD|{jxyg*KyL>#dGARBG;vG9#H+8#r=$I`tz0ts?`UuUpIUz9FkYrf6jjB zEB4yXou5DEo4s@=@n}Pk_q1yOwyzG>Xw5=T4mfT*K zB_XJcwlI{ZXmG$hLNdR)uVduMfjF9Z8uP?)f41c~1mFK5Oc*&}@&Q^Ll}$=MCIlpG z=FW1NpNSrYe7t87)Q!idQz(bu*;!~lSj?X3p|UWqRLF{lDn5J0c3$v6?QDPMMiFqU z;Rhy+59H-$5grusmu7jByHbSNAAJyzQM0nwS?wTE2_kV5$<%-Ks-mpJDWgXVUq+Lb)qgY6m9br-(gBd1uCOz1q$1{6a7)?4vx$VeowQDR=yjvTD{Hy)w+Gd!rQf ziPt%8`ROH+$0K*f(`wN8%f^;h!40hJvO{@bq$7okq>ffD84XJazB^Jr7uhpcAzM>VVB(#i4q9jesXEazJx(6B$b5kGYSfGSiE+>M3OJ5b9?A4z(H!jmE1azyTT)OctyW zwYX_G_!v4471Jk+0z^x>N`b{yKJpf->&~GL<_<^Gw8)#X z*$^E;!!j@Yg?jRLPn~8G8sbuvt8(03%Yj`i86n?5qf2j+xOo>m_*bmHmuQ=MP?y8Q*o zkS*39KT;f2mLsl_>gU@NAM#x1TAeJkoM5dO9fo1|CvfFZrH1ZP{#=Q(Y(vMf?W(oX zI6VigeF>#1r~(=lJl5)>?SB-E-Jm;%6%?C`J)&~o4-7DVp$Y zu&F5Uo&>^yAC||B7bWd-ptT&v;D1!df_xSiD?SyQABqgHnn@k+V` zdObI3END#4B5}IHDOyme$ci&L_9z)&BTQe1Y_07}$nIm?j892Bh+{7CZ_YDgtG}yk zOuwNocN0zL6b_Tw1zde}dntonglO`34)efQtT;JiByQtXty}y|aC9M6|# zXPpf1>Z0pBg|}8Z5(4KK@rMgOFpM-I^nADjI?_>@Hr}>5O@>_`sF`)#27732TQ*kA zBKJBx2c)Qp69=&3`oD7Poka-Q>mo%R7P3=$DrofjmCMmTzMbG5g~a2b(jdRf9L2EL zHx8ok$8WmnqVM^!J~%LR1>J*LSjLNYbsIC$O^3Dgo%@q?80#lA-2+YjeBg3E+b=bQ zl4@G3|4~j;rodXGt}wSB{;9?j@5>9wb>b7JBIT^A8sNKdZ#|jMGDVhJ*4WbGlSr>lA2)aNY-d>_D7(O6&T&G-Ztf}T5^28ehR*wAK_LKfZrH}dI5G0X6 z{Yj}Z_Tt|0tH^|JKh`h2oHus1Pg+%hp=(orkr2r>&ZCWW9TU`@?x)9RoTK)mF%YAepd?>vES8@E@y z8reMS-QaUD3IJ(1u6%DaPDJzMg0M2fBgy-4Ge%m0SXCph;_mI+-U?HTnc}OlBROBa zBoN3w!}v2i>>A;b2=!VlERL)Fwdx{dq9^u5@@L;m&}lMBWcoVDsdeU zd#NnK2foJ+uY}9Y!#~%u=UMPx(QAkbRv*L6bm_Qjf|5mP)-U?_%NB#~eKAZU1gN&^ zjKg&#(1Y3=1X*qXY6Tn`9<~dNA(pyA^AWC2yjhnexdv!cm?%U=;s}g4DKtA=H?B?Q5?CkgM*lEtT&d$1H;cn{<2DqK zn#Uk7^*OP|>6-$ySwr1HuSSC;P8YpS61_aIsSoLeH(cH$k|K``Tt3Ie18xAPYa}Q{5yT}pXUGPru~F@yVqcj)D8@ z*aX36!6URI4B=b%EQqDx576uS)!tOzrHK7Ra}{9k$C3rPn0U%6gbDdRUw|gykMuHp z*`MBB@h03?Ctmv7@93ttvwd$LxnVY0WrjXjy}ECFGm56x?$)oS_&%L3UhnLD-X>qv zipQ^=e3&xmbe>H5s-`CfMUzBx4=jhkM2z8pBcv{Pc6q_+1yvYPhOolC-X(Z2rlCMnpyX8q`80+UKo zk?UWuzC+V>b#TZC#GzZCf4S)1K-P?%VRhe#+GIRqg;CAotA$VTmCN#-clGAGzvMe= z)|$+R1!!KKI(f4WZ7h1 z!zSHB^D0fh{zy3QT~@(_ufISulu66JJ0$CyKAG}JF8ou($%ns1L6xN(+0xwFKlixq zy7}?6&7HaO8POus?M(D_o{S#;J|+Rd!NZrCLHqfvgu)$hOP4{uPZ#i!MOOjJlt6NG z_*NDbo!RcJsWvTKHC&xU!qM~L-eG5nV4*HY!e*R?+?wD@!9n|vdv z>lB#|WrUK%iz>0y&Y!9I5SG^ww&0#{1^5|1z}N44vikWxq|IJ93^v5;Fj|Jq3_3R$ z$G+k*Du@WLfJo24@`YG+X#Cwu%3a?Teif!E{_P^IxGKTzB4OWrQ_u`Z1!n_g5r`>)n6|Bv7eR}}}tZkL2cskE)b<#3ObCL55p z=qC7catw#QdjVmRBQ>%6604Xpj1mh?5AOK6evf<$-#wQA9Rt1&$}2%g+p><|7%4XN zV9A?QjL5=~i_FY(rS<&lMvnLBTN2yAhLI;8^?3&1w(^lMMI&-7$<3u&eoCPropSwn zl!+iM6VNSXBk3jEL|YT7Kx#aA3cym3t&%MWe>6bjaIIgQeJvxAyIZV|9VFZbv<3!~ zoK`1#1WamEOhG(c4QXU8e##qJ^46^JHjLw>-6 z#nHfja&x0_mBbU$KaI;16|THt(v;2o8L@0O=DjvTiob&LK^9(6T1u5i9D`Yw);b`e zkoD>yQ6hCD($KXXd69m3GUK_Yyfm>Zg3oH-g{0zB0p6mo*sP0pO2SL27;WF%UQ~b| z3mWe|b=Yljn0m<*y-Yk=h=YThU#m<`)hIwmci}9dg1uXqJag-bp{BZ28Fhz)PG^*E zp>9r>4hIeU&W|*UIVsAll29&JCC00q`hl2o-zs8OUWdD7u$C!Zs+rWt^Gz*bMU|spehX?0;&q zeuI(6yVZuq;&a^R!zOEcXM$d!56=IcsRY7#a#UCB>M!kWNaQ~kx3QF{8h>0?{aLH* zb#7!E5EZLTAxA<5a_;vv6! zd+?)fXy{byKcBVQbuf?DlT{hls9;c08bFxfc^Duk2*pOz)@IZ(nhFrq#v z8*EiR0pA_bT}9HK zypD@36n8z>y~$F%r1m>f6~=22M*SAfa5a@vN*uQ4L96%l$|TJYN<2+1jroS#wNJhsr)18v%HajFlFF^se7BpCL4MNvE-xbbzvonEUfuU4GIY84p zgD^dbe&{Ke@uTYzAy&|T&C#TPk?pV)ENx=iZ8C5bipA$Y_j@O}a zZ~>G}=q%!rQci(10RLQe2+ny(b{PEO(VSmEClUj}uY7sBVw#g~rG4|{Cv7(tUoDvc z|15`FSODS!57|KDB~ip7-uU20cjM{$=bPcf3P!36N1g)>)zQJ_oy$h&{M=T|%6#!l zbH-68kLd>4Izp? za*7S|d9j316W&m+D0+mZAW=)#jOZ~Da3|PG0qBkW&{%OKHcrR%V;YZDkn-A@c>dIedAZ6(2MxQ;BYvN!`y+awlpOZF$i5(++@JZk6gZ~IZW zB&gufB{Vl|&@BMVDP&a3$mi5^C}J>|nPKs(RM!J=%1`i`5XPC_3*;6(MhNjYb&0lj zmSzi@wsZr3vH=UT<d6sPG-$)JiO5@eYMZ8G~4otHLRg(vqoLWzh2%l z+EqdhO!LCOe-ju`!TQ4I6ABGFCoky;(g(vvmyA@DtVwRN5!CNf89|99>GeOu)_Z&A9C zpakf=cFWz-L9Y~=sUc`Q>O-%$V3gS(O&4?VsgSFwfUSZHUjh~bLB&k`*fSY)z4e@y z6%K_G%R|^h*TWo5+W}w*dyJY7t0}prYxah^HPX9Y?(UzoaAkYJAWJjsciG__jyHcKH@K2C4iQ&ZNhGw7Ab`6^0vSrS!half}!(0 zQy$@;Tukgo0%U!pnw1nO81>3EE1=j!dU%qIjHiCW{8EUd#^ z<1ipT#q6BO7W#^~5gYK?9|Q_75$6ciXdK^dLQ{aw+ko#o&*<)yo*~ zk_*ZGL;}bs;b5qhT2T)NyqmBE+mynsG?9=LGz>0++lo`)OS^%4>#2Ey4 z3sg6`v)2%jZqe$>3#6;GR35@5;v0X;dsrY;3`6o|0>IMZ=t|-bxyN0P2tSaIAXZqv zwOt@75W^ISLMluBi5c9?LSY}FN$cO(>8cNezsB$3GyOMD4^%_5_xe6Bg-` zrRsEKz$}7|6=Nd+{6iyUJUOiQ7KNy$xpl;mxF^i=wh(nuJ-bI$_y|Lg>98yWsU}A4 zLWr=hjNW&nR3RxHCNiysfKzN_S36X zWFF(MC7N5sDRe9#88Jd0RbyC==M_jYsF1ww$^BGuvFQo6T%1J}20!s9l9I;TZH$iZ z4|C}`lPMOB$uaqK9zN0?G4}$D8Ihj|^lDZlF_abdqG7iyTVrb2@Xf1=q_6iUP|L~d zTz7w^t@~}TMo5xF#1Zv^7o6S}hqdflCM5`mdp~Sa-Jsqt5z~QfC`mH;Jt8=uDg_NFG?8)+JaCXFMLv^9391P4A?K?7Zi3TunB zz~iuk@!ZAGy1B7LlYp*c<(~*guRj(GMh~u#L#x9N-{7|wd z^ns8ZrK;&*%r+kJhR{JXy zsjd)7TGLF44WjJ!4SLL5>a522JEMF=6a@rz#g^cB9lO$8WZKPrCwyGeLeKKIEe&_M z=l2NT(sPI-o)(PYEt_~FArargV9}2|lR~`CGL`^vbEEeqn&tJ5Hr|is@;Zt;0Z};O z#MO7=UcthT0fTGy{U9-`GM{HC^T57noDKB>$O|_1(?74bI?z&TS07=YU3djXd7c`j zmuSn;v5Kg-bd3}m)MEJj>AgNSsFvWAy6>~p4K%Y=U^qPpKS~wl(Y&E^ls`re z*Ij+R5<<(s@;oXNgZO%$c0MkWPE+*q1Kyt1<`7(6!X>2TM7(j7=WriNBfSLlyZ{7z zi}mQOsTSBwr2F=oj|>wko*(kB2C8o2d}+OHxxSA&C}^_-Z#q2pshmICb|XE zb-YO+?1x}ntgF^yNYou-;sl94_=c7|CQ{II?7j(BE^S+hZLe9K$;mg7N1lTpl*MCl~NppaWJ}~ z2gSPsLW@nsIDW56>C@TBV87-rlW}0mI#mOrkHx%dG&t(wc(Qu3jci=-$2E~0Pu^kG zK1M|zF=@LlyDKu%Pce;0Q=>km$dDCP?oEnQ1$=XDw(v8cO-^)%G7X8K+%X-EF?Bpp z6SM1-_pFc}#5w(i^MQN8;>m7|DRg z(<^gc()7sKieqRX3?%c#-k{Z5At9#DA^eJWh(4=LK8S@_sP$Zbf-Co@G&Mk@Jts%( z?2rsUtTMzJr9tNyNTSoiNiZUL$}Z{~Col8$Ol+4!%TvVJswUYNc9OT%y);xL$md{* zG8~UqHX#a?SaOnKT@h?9A}XR@+|{sQpy8=pCw>9pEW?drdyfwGa3D~VTuoXM7i0-` z*b-~lx|-%G6@0t&N}k-hKG9C6F+$)1iS~o6|cA1Tj5> zxgKNPt0RsAv3TH(CfsdhI?ZEtsWDoxc4IyA1T3Hw1koRy^5?P{w~I>V{zl0&n^j(e zG=xtXOGwV(misbCl6uWpW~W$?w@gmG3f{NZm4%7a4qYQS4waJ9fJW7*~V}jtXB*z<|6X%=fUIg?%3Ao zcO&=eVoq!xu>@;9Bv+g`XBU+knE3%=bRB6nI+ctThM;s`?QHiIQsz`1&d5R~>!L6a zZV8D-@QaM5DMJ$qafOsUT_J~&<9lTxpQ3I;F^h{JFfBw*^LPmB(lIxAYb#&a(V;7A{Yg#yIU`>h=F( z?kvNq+M-6SbR*p<4HA3PB_%D5fPhF!cY}0GBPA(~AT2FONOyO4HwXfE%RU|toO8eL z-hcezc~b$FL$6p4n?gyj7DtUN5WHWD;;5`UOq}P`$cX z+vL8KlJ1ayjzT%Wu8KRoj6QrtSjVx$ZrLtK0dPu@d`uT^Mo5sc2aw{(qIo)G8A~=y zmZhEMw<*T*vxp>D_j4#rJG|VEd%d=pcfWaEp;A*UT9n(O@%Gut5LOBP6GLYA?;8H^ zO->PwJu-hnv*BXG5shS9>>*gI!x_py@)YSZ_fgJcs-z1b5Z3#^G#Z%-p9}hDZj9B0 z^a&$}X+YN2YrkP_P4Xa$oI_D+e4;k_iUx1PLM@u2Ju2~$bi1!|5~F*~%BE4j^AAYm zJW%be%Wec%XAK6H;>-o^Wz;+(<4Y7~wl%27u+A$~nl!l;qk)r-eH47Opp3emlB}bF z`y;jQHUzk$7o;rFH+n_LcrB`7Tb1>toEwpO1%c^LkLU!KhA*z&_UmbIzd8Pg9rVU( z^2-#&4&>ta+YZY0|8EBcF#pRA%Ju(h2L=E3w?XPZ?V$g6dnX4dM3LneFUa=xKLj?i z{kjcoj08n1{!ej@zwZ2P#Jq`eL}2}^Yoh z9uVh9?QlJNUAE*Au}_)AQ{8LboG$k#_IIaHNA(E`n05>5Yp#BruMd8yanPJycQ25g zeRXkF_k1w*y5!=rWi@M^KXf#Em#O~Dwa#Jm>inp6^YiYEM#@$5?6P+XA3WPBnp)?j z+gOWBy<+9n!l5#aM(Uo$=p@suM(gHw%B;Y_N#NCPeO=Y3&25S6pTNtD*}AH$i{tfC z`w*DWVb<9SZMCgWvDv%RpZs=R5ND0!cP`7MX*Y37e`p!uFPr5lPsiG+4ThU8045}wR|cDHMV}}jw}B&W4*36Z!pR4BFnF#kFDm25qf&2uO@6|)cq5N#!AhG z%Mw*EF+BdP7fa>kMZ%`-*SEUj*Mg;{S99u@t-Z7LRVY`#{wnEZh-&DGKhtAK{5)oN z)x{l4kT;yu-T8KNlqI5)`jnt)$=_l|qxo!R7s|bs&i9c4vbsghMJ2w#=CHNa_q6J( znZnIu_4jArPY*3Ghf!hBFK01@T_?jFQf2vBQ4c=u)S+yCcN33C#S$nW*+2QgZ8rUO zCggkR)p{wKS9DvayMOKOPd|+Su3Zhz5wX_qnGazu%mn$M3(U#Mk%ds|;nBF9keXac z!V;xJqnLd(5Xki8ATwk+8#cVf6&CbhVye9jRtTvxU$ei~+jN|3_Ns1fq>>RS;h~n{ zK}^)BGeye#qhqGUQqrJ`%HPr78nMWiDi&5v5lsiU1C(CO;4L3@BJi!Q_G^Pq8}l7AAg|YRnkhKBHJ$ze>m# z_U*;>s2NEH?G(vU&aVOW1CiK|qbMEpIv6DoSbELdMb0ZemS;dWi4^fbEypNbTJB~I zM0PN$q2~*K)r;jB(TgQ)4->7>qfb$-iBAQx$PJgo86k= z=#I6DQ`~URWR71e~%?i12W32RT z70o&?61~n_U+U1(yBK4NXHH;%p0y-M?1h1PkgD3Cuuw&asmibn)golck5}4?fRTdl zx;=in>J-#85Spg{yb+&vzIPn^-4A?w5&AcQ?|*W&nCHF!NnPBVo})G>VLA4Zz9!2g zc%5yqRwu6vk5_}rgx^OVQqbk2R`{%a0;FS+G_DiUM?+bMfzFN&k{nY`nf+zcv>&Z| zfjdW>gt%5`dVuu~_$XN*Mqr%Mnh+VTfY6V%*Nba&-vWfGlU`}j1)og;wU<~-7v?IN zCIe{CO@ha4yrCF4BYH)OBSl)^Nx3Hi6hkDMO@b>K*dhWNxFt($0tji}W6vfgl+F7Z?~dXa5y4BfdJnrSf|!%Y&V_R3{Z=RIW&(@x%ZY&yR>tEm`zt@k=!D zQ~jce#u?JI9iFG~iv8t^(J5yWBb!WE12e`Lmbx!@5C8-nIHK_nB5= zact;x+|N`Fg)iKZX4^lQPqCM-2z0&FUl`6ef>3I{h85O=`7whMOQ4$)ZH5%pWo3!3 zLLtFTmQe?+wa#y%Et&TFK>|apKhV!;#-V!+!-Is^)?)^FMZ{Gx5jUe2)r=Ya^Chas zRmL?U*GiEZEh&DSVY^X0OP#DS!J)}iohL)Y^tj=?cv!W^fSFQEKrc%0W>b!K=;h;7 zl4H0$?TMcvqV$CvKtf|T^iHZV(e^>-Dcf;z^N<`~*pXHDGu=V`i1LK0Bo#*`n%FS6#f%rVft(nU|XC3EVQ54^0x_1*kt! zR9huk4Msh|e;D0OuwCKZ!75AQmc!y(ULME;;oqyC6}KEy zj4}tk8QEZdMa|k=J(L;3%M={`<_k@aJsmq&jUr(UA=eO(-rH*{gXFwX&iB&m%*9EO zr4LW24eCFtSShnvczo#C^BH1P7FIxVVP>$LYdFJ;dENZ;V3Y%=Z;j+JYsZhkwEV;h zjL!4DBz_Zso_Fr1*T*nO#Yl{%A5Q6&s_%_XcqW)mi{F%;2=u;^EP6jf(9~!EdDd;_ zNI}fBY5#yOuld8{u%W%O{G?}8$%cgE&)TI$@J1uTPUE+sLTgW5QwNfIV#rI>c}Oc!s688B`g!5W~N%ZlbD_W=jloc zaZKJ&VIlH{w%HYybgV%uUIv?qZ+BU}=ACGNsTHpmK|?}Sf%Q;)SMsxl4xPN+6?z^Y zb#SuZGVAHyh@yQk^#d(y25Ga5QxM=&)bqP*$2|rAJKWbis zY}}ODe1MqYn%aQ#DwYMovWu)V;&NmG$umhuy6b7v-13QGBMlr>Fb~FYT50l39J7vk znVA&tFgo@#vW&{Wgz3olDExhFRKaVHqUbi|Aj4vm6+IN7^n%19!-CriQ_H$AlcokK zlL(ww4i89L)q9^Zw)T5NF@JT2Am=!kJ`A&2ET84v;>@3UAtcc#`eZKV6lOs;xZC7t z8T7I7^s$^N92=;<=x79d;LnpfmKMca)joDuREUjYKUV~8;gEHjX5?@}#!!qS?459D z=Z|4J5ya3?m0HRiG8!sG?CmMm#`=M%FVZA1=%R`fmQ)3UHVP}=a=A~dcEl?p&TsIW zp&3Ybw?ZOMo@YKGA4$VjMvsjxZeoaH3tlrSdlKZP9n<~^=co(SX7y1(e;%w$*|QKR zZinNoVu4Xd3`{72E)Bnq-FlXF;tWNXM_wF#6){jwC)^*K|4l99m=v8L{zWlsQD1 zV+J%@3WhSntK+45$(N;S?+O?A&4P@MNKj9Xs(T(OkMP=jXWjQ`h2WDxvaEUn%}c~B z{L(BaEy-OnME}`&E@vR^-chJdY5_Z2=W_(cE((Id>R6u{>@;@z0`K|-7#xRr#7M7H zT9|ycT9Gx`z?a1cG@aT~!yVGk1>X2R@curW(=qu(S{>W;^8^i1Zct3JR23}Q1nz4E zW_n>LxkZ1IhC%a-8M*u~X!0`szVG}_%_4}!Q3{@m@T_A$uiYr>QXpIA4~1C_I4M7e z@e3@9d^oV(t*Lq96;T&Ok3oPSvTxOG=vOed6UAT5vNgg(%St9l7`Vj3MMBawNP-qR zeECt!5UyibR+z2f*?LmSMoBDxJ6%X*9PKrCxPGgxgS6ktOh@Sqa`-^u?vk9CqHNrS z>Kme>6n%X_zR2_eF?ZfR<{^eRrrr1UvW5`{8PQBl+IKn_%z!|ERDNaXl|%P41$*t_I-BD6W$-S>fB`GqjspA=n~ihAUQs;1YT_Ssxhd|V|HJ(|N;=i>8O*PsPC@kjGG88kCQRyJ)T zI)6E?_27qR;;~wfYYFEiSo&a*tXQ3AyN^`PKPvpP*LI6)aV+_jDh5K5qVBrBfexXS zZyZrd7VfjkcPV6PLrv~sDbESg)BGICnWY0u&G6DKxuk|oo!|O3U)G^Ftn9eS((Gn5 zt(6l=BKHJ;jr*pTdidfJ|nrs*H&V*?JFaYolOv=b@MVWBWFy61x;LxV&_o-fjbh?xoQ zZw;5jbz#AMSRD!ePSu=V(ZbKWJFlQ*46Kx6rWASY7-DT>bF!AC=F)q70$qW;=@sEQ zW|xRC@Ex1zlbiZ;II(2%Np8WM#5A2P`w-EKfJByqvr5`*(RlwPcG|H8N?x~kQ_|*L zZn-wgZHlIIN=<+T)f<4t4_~n*ji(Cto@y?t??c_G1Dj zvjL3`o3*I$g{GvbCof%Al2HlDoT8gs-!(0iE*4ckLk))8S2fVi=6r70-#y*y$wRit zkZI9#)SRc@Ne$iB7T^hNpiqd9W_RS#sULrE;eK(z|=W>iYXw@?~BFyoK%(0kiXQ`OQ+G2&kva!M>d z(ffcU;FSDwvah8`8`sTy=1cJSh@F5lOQb>4+5^b~BzRwaxdLM0Be_7r1bvQmw%7eb zu~=BG3QFyz3zk_TY@fuT&P||H3|x3nC`zD6hVv5}3ToLjQ%ADYoOYd}Uj=K^%71Q_ zP)GVMR>@7Lbbj{OVUzX?(K=MD`R+s-1X_u153o0d2#uG^;0={HAiin!dEmDz&Pa45 z_hPQ4SFaA5Rq65b*##)q+b$(?ox!l<$j#%g8cWmP{8mlGBYc z!}gt?K~d3GPR&Mv1;Phpmh1-0mzM{3(rmx}1-FRYDri&uPBfkBc)a(C5anL`yh zE0H#pz^dT4u0|t{UuE2?NiJ+}*l1Rpm9HqTwBfRgI~h^GHYUZ1rWaAe8+jAHXhe)-WSqyhdoO!24pC@AUCp zB%5f0%Ws9IG)HHbX5?5p@=>f7a$rc8C$ois9KC7vmnQOT)nY-a{nIbzPmBs8Gm4wF zht)-AnqI|z!^Zd`!Xake!qC?%01aP+6-hmpv`qaLb(G!{K*`lvNKpPfN&;z#_Sp^( zb*d%;sudu=$(#4I<7sAk@GBXzGl;SQN$Z>`bYjlnxV9iZyyi%nY5Z&}k;B>5J%+?I z#!z#v{nLY^afXNr8eFLfFMro4wO!>y)blwZUF*GVH*62a9Rx@oa}P7~n#JjukTHbH z82lm3s<&+wBF__=>lhwZ?dS@@4~OoI;>EIDv)Ks}YT*A&$mYa*xq#X7IUZNp;sqCg!$F^fV~T0D>H}aWjA~a%mzo#SGp=*{vL4zViGZ3XszxA1tPuMfKV$5 z9z;U1nB*vJ*+R>N_zX)--taR*`VE(1E6pBr{d^!PuAq8%i+-2IGCi&^glAv}Lk-%j z)K^~or3Iu@2w6jYU|Y5xtm7r;Ty+QYYE=d8L}#O4+yomqchV^$viOgR6mIr9gER!=mb|nFCwB(3tmFno`x@9HJrLKVzGH)liobl4C9*(af(CCrI=gII1_HupGBV3>)$E4J(U=7Qrz+D}}^-Zxz3Grp|RvqSIS)zaTAru2CN^V>te*e!hUxwI69^pLxPN=4kFKL;->o(v8_+v)$S+Uac=)5FsAvG@BN;cwBGdR;0nTQ)#<0&L3&}B;?H@ z!Q)iUCuS_Sco-X3kzpUNVcM!Xf+!F|&E?eR^06y1lhiwY zTz7;W{>RG#b>nap_Rs@Kk6fQSKMn)fv63N}jxYr?5KX4*Z^JqAO>X%G@0ArYRwNn~ z&&|J(OZMn}*frQF19_s7V1$2|znCJzQrC@Z%DB-)Gy5p`-FNJtxSS+w55fl^DxSt+ zYd#?PV5*<5r85bL;KM$v`|7=2Ibg96qs~-{R2|dC?k8h_pl_BwV+b52WLY*y5u@9V# zMXVBJCW;&C9=DG+B1N6&$P851E{)H-)O>%_`oj9PIpGS{$CwC`YP@G!rmpnT#BfV= z-$Da&_kBk>Ub>ns!H{!YJE%)4dN@!)B582?5BcDRYFCb+iL)yqM}EmsMtyt`guV+Q zY9H5k9s;j;45y<*8}dHcVRbB9`YCnU!jWlxwFJM%qLOsUYI8!dEknnE>~|F+^#x?N z7D0-*Ey54N2wMGPh8EreNP}GZZA}uj8{U8e>5suDP+o^$o*nq}<{CG&2U+zm;QZMK+0QpHSP1a^!Bo@tZUgf znlpVYV)k+@Vm}75JaGnOE6qo0mDpLe?3<*e3GAOx~ML4J^T|H1y0%Q<9p8V-gWDP<)j< zJq^iA$DGI@?~I=~gE=nrDP_G=u7zux=EB9(`MPNEYc+zK^QyL*^wWB$7w~zMA79O@ zw*>Wf<9%O~-pncSV{-(h5YiTZ^-d!NR_P_@u`*^|hn+d#>jItV=iUVqtYW!ORzXb1 zwh^i{fh({Am?|UL$_mxw)1yk+kL`=w;N3h;zwj<^zo@g7JuiYFshFxYG5BJXN(b+PqrT83zILs=BO0aE0A1@7M$&=m8>VcvP=OLz!ZyD(qVUXi zMK)Y-dj%>v0f#OIibTOPtkg8e46kn*6zk_7&~k8_%Hp+b-?YG~zc#3!n^J(bIqHUN zBWLRjjQzmpY(nrf#^PEjk$tJHZ!@w@*R<*2YM}r>j;N};t~pw%2Unjxuuzf@Lo;6s zsmKcs5`SeKnztec`SHxxnaqbHmURu^9g`d3d|b*1sZn>SQPc7lq7R(U$T+?|db~sE^~SVo6on+kGjvKJImb)N zrJ(5%6N%Lq+tFYLn%>M|C+kt*o2~PBSf|i$Mswn(94A511h`R6>`qz;)5Jz!VOlCf zyG~&p(*k`}6kjkNMG3%JVpchG>YKG)xn#jtC@Va#G3{_z6h3=j8Vm|~<2luCLD}Lm zG-=(}3>(*lHu67EPQVNNVdyIDCy8p<_T)hM6%Rc7BPFEsCxL@AUtVV?3s^&;3&NlW zgeh)Vsm#DENmOc9!mqD=l9S3;Y}VK*2yexFKXb+gJovJGpgbCi6pBg5cW%%ala)~W zv_2xu$!lFSjH!0{-8N+5kNU%Fps3kjQE)7bFHrmQ6ePsUihjnB!s8$r72r3 zuWvig`1ebl0IkWaFnI4F{+jG%btq{p`7@^;MR*A584i3*@~_G;ZuT`2>tB*!H?%*< zPs})l6!mMtL}!22l4hS%w5~X0x+duu;2!+9Uk%vz$l+aP!7bN5TwLXcNGC;~#?nLSO*`NP(<>dFM!&as0|${!3J#PJ%9iJc|H-73RD- zWCb1m73>YV3g9FKf^mMe1S)L`0Q|WK1cKWA`=KnL`+#hJKL!*T4`Bbty`YBv0RF1F z3gq}3f}MjD@Y{U|^iUQMFZ16Gv9NNH0y+M)1iAwFlN14zJs!Yz)6h*HeKvfr|wJ@aKpHJE^OAV}JOB*+R9(w_pVEFixp!0$?y zpw57*umb;dm5ZGe@Q;?*Kt264jG#6F{}>9;(M`qMn}@Q4TKywkPG$rEsOx`g1E|&C z?peQvA2h;%fAE0@hW+n>0Tn|9{8rUpcq|A&u+sg~D^Mc<(6Ih)7XZThqjVt20zf16 z*F{k3eE{1ZiLro$0CqXMkr+tqK$gD&*+H^q{#({8K#+9*h#r*i0{}{k@%xz|Spjd# z2!LhH0z?4*c_<4gdp{8HcV9rBdVoJV2Kp7?k79%L3Ghc(SwN!+1Z&aFlmJ}>{&^-d zNG3P_ePB_8j(&U3fiiZ0ZvE2}&^QBr*VX-{sUYe7c4_-1OwdEv{`3>nWx($g48Mj2 zq(z{~_g6(4s;)Y9v6WI0RKk0R9<%kV*sop>d$e z3;4$vf(8uuN80S5j)SKmcy57|^^eMNfaLJk_}=y=ym<@#er^BuCS?1|oARFJ=K$Pr z{et~FKL_~5ewQCK95>o<-}rC1Zt;Wv6W!qlg5Hbwksr);iy!>I^A11YcP)_nCjT3* z+x$2GCGPUy6jlbkv+f)JzY9KtS0{J*f9Hw1Z~TAfp!$3Mf|pZw_<_GGw%;>;FxPGU zxmnHJ;Rk^J&D_WN3+B4T4_>j};Rk|NUiXn7%ypapW?grepY5K$KX15h@q<4K?(hRZ zA0_uu{$Q?K{NS&cJN&?Vx_$t2-R8ep%HHJ%t(NYi{DC)IxA?&yig)+{Eca9Y!Cbfa z!C$s__<_v#lON1=oB!rB=`KI#{hYtR8?IaY;Jt%8{D6C!9}&!ToBw7D;4VMg{hYsm z8?M{@H`_CJ`9ZrG_woG$xZ%3R58h9@!wahD%tnYxei2i|bq;s@J%?(hR{>iFKj^#hpe7C+cPb%!4a zvIX5w`Tyd&#SgZq-QfrPE**W})<1ujrT+W<2{r-V;RoK+^*@;Fw*3EV{sQjl`~`E} z;s;w<@5=w4?wfW_74H~bpH^{bxZzWOZFZ413)&=`}qC=bKT~@vAy5rzo+{@ zfE%vc{5RI*yZo&8bpPRo>o)&?)t3O=)N#0n|9}5oUjpopaYz0@ke|+d)PFG7E%}2T zNbd53O!@bc|Ay-pKiK8v4nN?Y+V8+zxA?(6I(PVi_tbv?%yo+&>{WD!AHaS;^&iZ2 ziy!O;b%!5#PyGkLT(|haj$3#50U*Dp`#68WT(|jee2wn%v)#|{N5Bo&Eq<_X+#P-( z$Z76A${);ihyRzi+`stm=lTH%az(xS{dnUOcZVMUax}e<@&|L>mj8{v7o; zbKT+xdwAaA2Y{Sf@1^{2xNh--T~hDx13^B-_mLmWb({ajhxRW2J$?TJZ@6yr-#CTd z|BYkyUH*IOe+9VVy3PMz{xg7k>OTYKy2TIn zUB4rL;61hfg1K(-gT3wV@B=_0F86W%g1K(<-%9`c+yDG`HsAZU|9r!BoBt-D;jaAe z>G~6J!*z%MKh~dsn|0nj-2eHH_2*4o#a;P>f++5%{{P~-C4X>~%N>5;?>M}BrvG5B z+x#~HGk5txwR!KO{DC)IxA?(vM0fdr=NG?s^8Y2*Tm0a_r@Q>1K(Ko${~NAb{NPZn zJN$rq$`9tc&3_YIc9;L2?%x9by?+aihP%TLyr=dHFxM^lgTwdk^54_%U*NyLf58EV zclZJK^!*9ux+Q;bh~!=Vd+PrHxZ%3R502@)!w%-_!UP;0@Pp`QL>3{)_*9u0Me{egU`n|7-mWyr=7DFxM@9a3u8|`2#@l_4jf8 z1LnHL4-Wml!wm5t!>1KRCMnj{E`l)PDfXb({Yt9l%}wd%AxP zxZ%3R56)k3haY%P_piWQxA?&s7w+%_Zv4FOcFp%= zIFF$AC+5{L;`QNnck$C?{=KJz7AV=f6itppi3wRIKebvXd!Gjs5cQhP9-S1)kZ8kI z)cYyyIT9yqPF2|~iUy31%ttM*3nOizwRCt8UyxmY(}l{9UNLOmK1M@*a+Qw94xh#4 zI2hc|nvESZ&Y}ZnMAYD?HdY%>*5XLA=!>`Gh8KMBnPhKrv|TklHvH-L6wRke2@TH$ z3-Adr(WVXHtgovXERB2Ku2v_0n}e)BSe#_3&3uYFy<|P$rR|l?7c%n&AnQ}*H^t?U zJYmJIAL-DD?=-qzy}~Pt#3Ws6C}o|<9PnUwRq&0)kCYUb(<)d)+zm7Ni0Rw}$Fg~R;*%}i_ui~X9oJ{o`&f7o*pw^k92_(NIN(=s(ebtT~ z7~TNqBsz*<`~T*kDA(o|>nLj3QZzgNCQGl*J~!hs-s> zeK;iUPa}eGjnfDoN#P4pbFV+QtqK?lg`?_D^+(TI$sL#8Wvk2Yinkqp=BoYb)%%l; zrrn(ee@ClVNSny87B>1{r&I~4Rko zBRi9=xJ#&A-y}s|uBnTM-L(cPO}?;6>|^mkF!?RY?BUz9YM6+QqFE*1LX(w4PIEu> z{bSUIQLbj_QB$9i%VhTe=K6!6uAiHJC%m{P37dP!ubbUE#w{El)fsUz%{_aJ zjao-6Un({<)Nhm9ILfhDHHktwVc`l_H*>sd)jqMiKj=Q;Td36&8o;XWU!2?IAN*z8 z;PXa+h4Z7jTprZUO8A$i_0+u%`@;2IZz{f!G@qYE?r*fkHzCz{YQ_OsAc69yuk~rW z;s+h=)q4^#Hgh;*^|j}v71uB*Fqdg30s4SS@%Z$lM@ux{6%F2nCxrTZ9%N`2$E?kl zPV4d%D!}X**G*Qoi5@ zvscsr=*wto@glLhFV+UjXnLEw+hUMpg%I^2)g7yt1x&{)UPocRLVD6$*wEPlr7i=R zDfcP|Mi<qMj?dQozT5+wh~&M zV^N`V#8`%CjrH$RY>dXJR>LVs4A4HEOsujt?Ts32F)AF1<$71q7@gJkW>)r+#-A}V zQ)u;*G~;n5Nsy}l^U#xi$c@4m8=Xot2|vdN%Z$6{Fv^wAXz+4!>UG}6qfjomw4MX7 z=+35+Y3Xfq_vGDEA+++D20x0p?y72K2|;UBz^3eFHj1r(b8}VD$`TGdn<=i7_C=_3 z!{IMrg7qydcq-ttzS(I@gEq@E5}Pa6a=Nfzcm8fuDg< zTMD#fCKeL{D5B`NP<*JDITnvx-{A26bqjSD9x?xkThjeH(-=jlRZu&b#CT z*@WQysLr0Agt|kEnikOE4xP?wJ^!&{>_7g-XuvG!Stow-y1@t2nBb>qxUe?z8n`kI zIh%VIRCG@^R6p1n9mf>=QJ48vo5Lg7cRj_zJ(;Luj`z|o++I!W;E;0hIoE^h&n=>* zLiUYe%A;LWa)04L7M%HdD0;1qR&vUyaZJe(8;Lxp$_xBSI(_nV|gmK4$bNFq`&tJ*SanFVi#5 z9ms^%qLRcIClxos-TL58%e;k0sh9qG%w&0-<~hAR-v+W&6yxVj0CRw;hA`QH!gsCc z*Uh5oUh*o(&Lw!^0rAYq>uG(~bh7MbWjQ@cB=AU+xjv?tNC`k2ndNo^Q7aRpflNed zJQK$fE2U1VPp`AN5y7_v%QbJnsP*LXj`x*U=)pytb0~-FBlohq#U^A1ok}w6RHeVR zJgshKANv;gHkmMce!>8NOz>(GMW?>l7}-8Srxn6&{(}L=M{f^T{3jym4~E#@UZ&xp zg*KirX}Jb` z)ymO@h-{&SmZFCu9^sl0N;vAXd8~sQrZyjaz|0fJPc&AZ_tC%F7bcWo$;l z!Zz#r#BHJFfnLP&Ig7Q70$X??+a40Vr3Nw4e&&rBiO1=B9t;dP zrt-zs2P0Aq<(Nv?l!kc%?>J$ent;ybzAiphp5~QC)s7HAZQo`&ei+Sih8D;Dj}&>5j3zAi}m5N!s9Da)ZaJ1o9F zMee>LPVu6UxfJpfkg|duN(NdgQ#7R|?tXR3GvtkY9prWt_?rZ5Frl`WJJI;Fyro~z z8n3WOHI`}K*+x@H<~6P*>wB1%ud5YMZUfcD;Vzs;(RU=Ccn$N?YxR6*m?xh6ve7{V z?W0L=TX=vSNW^LuA&H*(bz?0xmqlcBqW-n;lQL2fu_vxs?ri;-JM!4t=ufOr>-0gD zZ<}Hs`n$QegsM0jUIr`&A)botMcakpq&4_kcpSa}-OIc&f|9vY?5Q-umlb~2{g#m{ zx?1dEu>>nep^uBS{z>8CJWiy(Zb<;3<~Ay2XlWAR%w%E@=Bee^ty z2~ofY)HpXf*6)t)h3L-^`GU?#qKDXp<#v56*^%(H%y3aI3IIJ(K`gBi)J4t#WRR?K zLnhI~RY5(B1`Xn0J^T^pxpV-WCkAVSv_8s>lr%TRpx=p4M?v7xNwALmk&&AQMB^sk z*PD(c6KgHL+91wXQ57VZviZEzaAiRF3B$!4%~gMT(RVHUG77>G)NXo#4c(M3WNyBT zG}+T9UG$(+%~bswjHFY#bT*(~DUk9OURAwD`*q%YWu@d{uFC*O6+VIPH*-~ZKt7f3 z@hFi0_19LI$PvEyDmveH_!5+e=uW|d#T8;D^_Es;IYyt3O1&g~c|mf)K3Xb1;v(%m z&F?wqgWx1$e!QfGP^#P}{4iHfFkH;vY@{6EZ##>Ja?zwBe4bP9)>t8;y8Epn=<1Bz zTq~sZJKLh1LP18;sXx&?Pkfi+{^keb3u>z&WsR(M5_>)OrwgcXTUKSu8%2*ppXlmW zMI!7s%v+wTHNg7plLoL=_0ibs;U(@l6|;v163G#|Iy=-{uZj75FSV) ztiNL(6#9-+fKHCRk65l#Er{zNr0g?%B*_^|Ob$>JQ()h)2#S(O~hdWvq;04uw#tfS>{0(N$ccA>mnM@>aem0CZLdDAV&L zLpdgttont1m5woFHoDd}Hatjmf6faAyrkTD=)!8v`MHyX*!HtVgM7lFLB-(>FSp(z z^IYB>NTHBERiF5q-pqt59fT_So1x1nu%rDoaQO@>zXr}t^G3^bMm4LPD3>L<{WuHh zIKIf-D#ae=(ogz;6+k14<;%V@ytqb|yZ~Ki`50ZPrxN2}oKPL8-{844my8lpzOQh) zggRfPa5|@IUsW=HpuDQ2a!NxsgN2gq&ZNp>joK7oC%aOXq>=G%N;hQQ@x#VOGO0+^ z8V59KgbOQZCWTBzJycLR9TS?to?@{MgHe!3(>NXLNZi;UhW2?pZGnItIF;@>6k)hT z{Oi4^s5z}`vRDV@vq_Ac5ea%*QbA@E>=gUDs#|_;(|}Hwv%9H7G3&FNW9$)|Z6EwNQ!h#3Tq`7+vI=ec`l6SL^zXpR^gm#j8&X_`ylV#*xmn96GJmpQymfb16Q=?=k z%A|}V8nWRfK`(=I6N*vw9uJWeIFq;-+S-R6Pbh7CtqtLu68UWwV!KvT~6bdWCJbroZ2B$@7K@yuI_VNu$N%|{p6GZ^) zmyPO&t&FcB{g8ib7V)a4ij1ZUj-L<=`dFf#z+u=_obqfLv>qp?ju~z=x$M5XMoZGP z(}Lw;)$DOW&E|;pB(EJ19qRBnsw zXZC(zYj=;bFrjrmjelxzb9nW#D1%?a*V$a2(}Lv9Qwmo9L1^R^Y@$FFh-a{_3}Xef zqR8p!)PbRzBd9ww4Q4@@MCtDN&#=;UcVRSoB>P$35=x^-COs105!&--!VEu#{Am_2 zGTJ}D(Ki1kqWDpYEZGyd@5`-~Rj})NqBKap9!2QJ2V#g7$<>~|0r4Vvr_IJ` z9vl`OYCs|454xN_Q-nD0Fg{{(htR?hE z~3H&15Lzz69c~TdPO(*QeP$OuJOhMgeYS7~h!!ZOkWmC}ziojn>yJ z=~k-V%Bq;ivgE8uU`(^WAtz7I?B+uW@yR7L;8Hp8|4Eo3yFi4U@|=~wxQ07WPR|#= zUx`u_15|_QqK1{$MX8Jzqr1PmlI!Im5|ozgCW84eH-#WKKrkKhIMMZn znPk$SQ+&X;wTZ(s8=i%1eb02#{oR(inkO<5^Lw~4WrtZGjr9?FqYz$%E)3Qla@T1O z+PpLHs836F$A;EnvgfUY`NC08gx`EY@^OaKA@>QAyqW(qa{qyzWxe?(L5I}pC@%^C z={an*nNq_c(?|Jp%4>L;YW9eInU@`@x<^g)YEGN;k1?YhI~K%?Bo`S1;mpUzVAEYN z{o2A@-91~oyV~4Z>V1wQkRO}R?+P^ITHCP2z5b>o7M9R!5e|UGhD&N@em1sfjza(S zfw}ioz*UFcvier^7VJ<)3%#6_5Z#Iet&NbAcMkIRv8JEP-JYyO>Grr5G)+w0sfJZ= zYTMolMg(viF=F+~UUbM4O1wjr34fZs7%jqd6ue`9bVPWvnTk6+fgusCNwi^-wrm)h zr~0Lm_(MF66?6Whm)t4~l?2X5Q~^~X*_0@-)Q`by$3GFDt5gA&dr+3#2jb)|u%tE7pjhP_b4{jKJQUW)#ro9o9woG}Sn*bw7QA$#kl50GjEgLY+DFZ6_ z;EwyIzP|eKMRm)vK#Unc%(24AX28^-ufl{K-7%nO_IYM5Dq&zM^DW7mv6tx3;MDy7 z*Cbq-omm)U7#u}5CQ(gG7NCk^Q`2Xen6o6M)Hb$jzP&f)m1sj5b0DV=~=zr zUsqOuTY^=k@>psh-SBZmIwG>Q?3GXD>?mk>3wKy#1pSyNb{-+K4E zICneI)NBFIx0{3m-wr=+AyQC%!(k)oBWGg7O%=XyQf1f07`Yx(iAp6g-0mhiX^mad z2GuY*9m4W1`!=Z}#6N-|SA?-S85&H3C_$0M95D0bjje%*&n&w=RkMoW&sVdCMs#w=sGfR?ys(t9_5_Rm_-&BiiK zyoBnNI-jIDa#FaC#W!rukv{iNZ*F3KX(dL~%Bo#BuWmx|H*Y?ug+H-{eN*>|q06We zkk+{JL+bI4F?U#}n*Y>dpB?Gs+6%28q*k8=wU>EA4?>~0x!FYFeI}9k>c--94UC2H zxFhRw{I)?;kB&;zUv?0dI_v*1ca~vQbZ@v<1VtniFleMZcK}jKOG-$C2&f>Uw6r2f z2uLHHA}O8HDIFpmN=OL`C`gEB*z+Rn?f<&Y`EWkWCmCn&*}r*atu-@iJRayR?O~{+v#6(N6R2@jUEUQI6 zW)(&8nPwuNWs>SnQPZ+j`y5SF_*?2>jb{Y5PK}pu8Sbtv>#MM<>*4ahhxg=3%drV* zJv4vX7*xwJ%C_P8=+{&qp;h9jfL2vnv%Z-EnTt~YrQmRz0UpNVHODHYERTObX4x7# z^^Dj|EX7+@CdTLF3xbleNw1N7o~^vl4PitoT#O066_RPuLVEQgi8j9FZqe)I82ZL@ z1f0n%m*c1Z1chJ8wB)cbZf&`FE8o^ZOSQI3-8eCx$F0$$va3;LhModemO$!Fjx-()u*cPel?Z zpW}rcSG#=M8A;c6n?4J_?OY$j;d7>k#r0w*)mY!Z6XZL-1S6@^H@$V4K*;rY(0QQ2p(^rMfye%r-qU0@7g^uYmhMF2?+!u(V zTEHgj?Vo!XFo0B^q;WgD`-@{FAHgq#SDtmTC`lZ|P4ZfVb z9HhoI-PpImqi-!1$a3;v{hLKDf%=9eyzcq!lk=oq=r)_Y1_jhVeV;gGcw6p9;JK!?)ENodkcTYvE{o6vlBR5*M7izOW%9d%OB z-KVmj?y(!(PGey^_hN5cp)~Z@IrIECliT{wZnLOieU$ZaAy4UdH=2#z5W4k_cFa5C zx0&davKhr#Sl}YDFU5V8mqgTfxs~tb$NNHL9DSBDp3uFx=P0M#uN0lTEv9)uc{Y`1%!%-TM>eG}G@qyES{9nr1Md^fdl zyMNE{`lXv1q3{*z;D?v;JdLj-h)=5FmfTPv$T3SbVA>#h#Q2d})0jenlRbjhE9JcZ zvcjz>{0*nMDP&(k#8xxe))hjHo<|;<%coxz#ZXTKoi-ySVVuZJ?IQ0Mr!kt+qEtKn zW-vGDn2)YTNyJ%~@sZ@D^4l!=O89baqD=fv>O_IA$BI?m9<;JIYgSNW(KOxaN_$yo z@9I)T+^eHQ+a+3U`r>D`fIPQ)%F7`MqnCHapCA*`zWWpH)=x*@=ZU^Pho4sKz~nZq z=MyyBSl7#jRZ+==Ykm&fEyC9CnoGrcbN!c~z+2plQfwg`3{qJ@~!^>E^r=7j^h4$O9>d13oo|2fI*Z}HNC zqQrQ>CjnO|z+VMS@ss8i0JabZie=Kgz|R4jpq0(P&QSXjZV1rwW#1)bU;Y?z=#s(< zR5QYk_^kkWZ2SjEz=r{?F2teV3NN5W14GGosiF=Ah@K-3-Iexh&Ebc}Li?qMh(oie zedinaq5TdYkQfUGO>0nx0$hIJM+}yLGlv~yNJWze)RN#QvhvzP=^9CZD9vZ6tE})+6L@M+W@SMUiV7$tgdbX1@dEt-cBE?nRbjA0|EB#UE%;$1_iKLOht^&DZc>QD zPPZ=-hByq}zLo*v@C12*6n@yDgVVnK3E~J9AUq8_;@1W=6BzhI`zBobvQ`MN!=g5U zDm&Pb-VL~Q!BN%BV0Q*`aN++sChdP0=ydSIPPd=Q1wRUj1iHpwPbWU0P80#!kDif! z;RS9YFz_YM|b+khQf)9vd=BaU=fptHh{3|~OO z0pds_1X?TNND~E40daT=yuhJgM-B!22;$JTjTg8+up^@=5HF~SzMLvkb@tF@OkAxk$pg4Z4EOY#ED zFz|O#hXV8l;74KwbU65t3kux45QqI}-&ziSqz?l3ZaCPx!4m{VhND*>*gP_*0&N)v z4kM@w3gmyok9I4dryObRK&%jlvEl{V1?=zyd4b=Af!7E;6mY&r1~(w&@WTOlUr--$ zx) zl_%_9mmzRc_aA;}zJI~~RVf2!p)vU35LM{|xzO4VIBkx>k3gL#^s0nGE_8m>L^mcs zM8|&wiVKY&T$sS%he1^31>{2G2Uk)s_~8(Bi3hpR_`#(g41NSeRcb&kbbiz#5hg!G zpFa^OE;N2{aSekX2GQ{oIR|7Hl`623(3UZS2K2^%kPD3;TyMqT zM?jPxI7l<+VVF!s45PSaxxzPDhOG23Z5N-c36c-vlxCD>EkASF3BFKft59SPD z@WUbc{04HN^Z&2=7aXGZFOUn3AI!?Yh(8RX^H(4jIzMWq6_X#LDr+zl7dk&`=^v9H zqR*eOe_f`*L>&x%I7HuHKrZz7qt>-C_+b!Li37RN`BAAdnEViR34@`y(D_j*D46^Z zUH^iixX}4g2}PLvU_vD=H`JbgP+VyIV0Ih^KOCa(k02KsKbX#k!4HGz`WMKB#t-Hn zV(`Nuy8Z}qq49$WlNkIkh^oAUTxk4Yh9?F;9HR4AAQw76DlP3FerURs!2flb0CQ+D z_z@6YzW}+=;twYMV(`Nt`u+uSq4T41FERNcx_$>kaiQ^pY1J6~aERW2K`u0YFb^Dq z9|6((7s!Ri4<@c-@WX-pQ7EcJgIwtRsH|p8eu%oH!ckmk{9tJS20sj<`FkK2IzKAA z8IOSCZf5fHuqf?R0)U`-hY zKMbg*gW~uDa-sA8ukjNG(eV@HLgNRk_Aug)fN1_a$c4ramKkF3!ysCJ0dk@7gLRP@ z{BVf6yn{DIMIkWw;SkM#1G&)nK@|%Oei%g8e?cyEew4%kCO<^$Phlu7G=5Mg z1cM(A=z2i$`2plY;|GOJF!&J=oxcUS(D_mN5}5pekO~yzk3ex@@bBw!{lgDUmsG^R z`D38g4F*3yMCX4%F0}ZA;yf7q2#DT)K`u0YP)!JfABNKDfZ+4zzxpAd{1FB}{6Mn~ zV)<7f7h3#5y(Ub4h|a&kQCw*JpuiLcKLVop!yp$r|NmP5ML=}@7vw_Y2PM2P;tz*t z{v^nS&X3X@!{mo({tO(&h0c%CJ==(by#f8QXs=8tD!ywxJK`u0YP=*eJ9|6(% zE07DFAElgz$q&)ze*}sPjUN>H!{CQORKEq}Lgz;*6Jqj1bp9Xq@BBX~rHH|gfav-o z$b}YvQ2P;+AENn(h=21BL9t2da8Qe}Pt8@FG=5OeAA=tO(fLD=3ymK%Ai&^A7uoC$q&)`3pk1kjURNb!Qh8Mbo~Y7Lgz`hcL$rPkhT=lw2hEHy_~8)EUj@0)`BCmmnEVjUzk;K<(D*^SC=7lCMBjfw zE;N47-wJ~t2GQqdkPDsvf6afwAUgjEa-s2q4q_PbheNb}9OOdh|6lt5aER*XfLv(& zphp`<{1FhXzW}+=_(4-S41O3y*DpXWG=9YY8vhXo?tr1YbU&|sc@@6?1~hR+ZnuDYDW%E z8vL>Ty|8oN=3zA8Q?5Vh?)qSKM<_6Et6^m>e6D#_6n}7YQr~T@$@byf<)6Q4a!X5` zE2{tSyGNW7bLZ|KqhI6Nv?(Rrv`=~TyY=D=l``?qlewktZWV-sqcy@;*EW>DB-FT6 zYz&S%ukUnscGtL7?Covu-QA!%Pq{g5YxvHwzTPGyJuZdo|heb+y8?XA=IooVLa>#)A7-|s5tZl*n;`j&sJqg|Prre}Q2 zPRVV4ytUh$AfQshD3e-aXhpMzH@g4N@7ynU1qf~DE$E9vk3ap{IfK2y(~X<0twvlZ zoF(OIRUIsACZ!;gP7uAW$O`sQsHHPxc=`_f)JQu*T7-4mXY zVY%Jz>;?TB>93o-=p!omU5&?P8{8vV39{dQ3;OA172mhn{5!tJxx#*M)SW!a^@-Ef zJIfwVoW4u7X5xt$ZZ?aR`O*E_p8c=1%bB;HsN#^39gxAO|ZcMUj=dYle{vpM7n(%Whe~r+z$t3tXro5|vlH zKkw?l;(uL3KI+Liv$I{9Q$^ctq_^?`PbszB<@qjaOoM`+?mN-;G`5Xz%7eY{f=&6> zHvN7HAYLtosO{zC`YquF(O<5uX8BzI>+hjzhfr$?Hp&^v=)Y zGwlk6%haby>FKonu*v6lLRvowVaXt05T#<ZK+|#T zNr|QGIa#ICf+l}d)YW9Rd;E!W`ET2O(Ms({9=qfd`uc}^vvpV^51)Rrrad&g{Gs5s59wp&dx^pHY%kh!pZniEL$&?RT6}SERW#5>y3CY_%Ea;a zjO1c|{Tv0G>QXdb9q|BO881GAr0ch@+xH}Mq`&Q${LxPxB6b|Lqk20ne6I5)Y0VR2 zl_|ae^P8<{jPwbGp7b~WZjIe;n}A*={BBk zmCe^{U!{DeE917*pL5UIBE_yVtlVAmGHa9FevYO5Oir2b3deFqe&)oC;zv`@Xo`0n zr-!$Q_z3(nm zF27yt$LDp-q(5V=T>M7aj`K@%LW%O0gWa~eWtNg(zrM`G`!o8&gDg%BUjAcT<#**+ zr0O!fKeX1qX=jSLRW~j$$y~y;>ak-p@Mf>t|6XUM*xKl*mWmT{bJNON`CFu0>m%ib zMl-~WoBmJ}bvezay|pa8fYgW2oomu2-8ro%jal{Q;sXcv&ThKaj7545`@bpp<{jMA z9<5fPxzf!>HT|UKPQ0i!cNoi^*CyQYVmhbJ=$i`7xm_;FscnkkkfECvf6Y+5(ZX?e z{?T{O@$NSf{6RZYysevtRUf{5wVZF+VN;3H*}1Wy%GdVZ?W~G!<+yXLw)%#YLZfHn zcgl*K;+LO)#(DRZ5MLkOEi`<@eV;Sz&Xb(*+f%kw&UsdXLXkPnW=y6emm<@bxDD%j zf?#?t2ijhdP=`~Kklo5=x*0mNDV*%@gkShG^Cg4ZRkot@I9D#@hF)LQy2SeW zi5Gp0_drzpjSC?!3@yzsy^Fov`AninmYBMiE91I(H=#|mEI$ACrz#72yFWV?OM1D= zksiXrqEeN(qO-+VhzVBayT!K+a~+GmxZ6KeRS)uxmAzUV^x+0QkxH$Ek}8QP!O{i$ zI%+GS7XoB4wnM$DEy5!nOjVO2`sw`Uhz$Fro#MNZI&1A7=E8209S>@6zM!GX*b5vk zt@B>{e5^!`@`@J`!fNMYLgJ~rSDCfN=X&UGPYJuj=6RpS7i`nF)sP9(1!&>6A4~9# z_4$c4BfIV8{aUbe=lZ)7ZY>+(Shrm{O_(l!#qRFwFDz!$6m5PTw|d9LlkRM9!-5#` z@8yrCD`dfrXMH4@aOJA?JFdvavA%bdFTNGw7JAFm~XN0gS(HF7Ef- z{0(}oh~n-(wQJp!kzp)1=5%E^xLcy0wb5#~^GNaHXES(wk^QYi=sK&{Ds4|O_d8$m z>Bm5!hx`PNaYK5GO*hkzg%V3$5OWB#v!NW72r2MjoJa6;(g|L-cIs%;FWGwhI<`;! z3M{H=Qna8IuZJz=vTtq!U&T)+jsb>KStWw`;~Der!$AveZkaHB#k|7yDyydHH*Q^R zj6B@dYm*|&wl|MYNie_RlaF?rZ6)*`a0ujzTMN8Btj#H)#glcFO^ChN5`J>tOGQUG zpNfes&vhwww9uIET1LjM0CS1@c1FA39MO7JLg3lERq8G!d7mPjzR^}O3#yV|;iw}T zxR{qptS@Ly@s3pyN+ScWVo^VODVe_=?t3PFYei_zCQlCJnGVS{S%K_ zjL!OWKK>}3OG|2Y?Y<288S5}N%1f8-X)es*^KM1!mRmie=lkkgJ7aq>{-RtuvW2NU z^L)ws)4D$dyiPCqkPnEuCyZW^R~pPij#jxkQ=Z>0J=GPwL=sdKc7e$oX+B6%{4k-0 z`O-?gMZsR`dm%biL6U+Tn|S=2(jMNtb+NY9+A%_cm+uKunR!#o9^gqmBz& z`jLF1^9wn_{N1t-UzQ{<;k;}6At$7{ZE5TA<}nb9^TF4pXdx2Xm?jITR|rg}$bBv$WeFL~q!lpRxJf!G- z!8`S1dLpmc*O)7QPtAf0h6Uhp`El=&X5;>niB&|mdEdNbU+Lyh6n45FRg$kT<1n($ z_0u=wGcIhavXMZbcEX^R^faZp>qcZWUHAw2jAq4k{IRc5Kg{>=&(fdj(+uy;iZj#X z;j{UXJf?WsQ8M^R;-5M$ewDjk4JzK@@q#@~m2B7AMrG(HZ&M^_AzdYge|ocix=@Iv z6j~;9_535nLZ(dla6j__4k}qaIXRNI9fQO8H{3$ZBR<^dzkHX-qJ1^xBGE#V1YcM` zEN9GMEhoBMd^}XDk7`j%Wd0S_bt&wmdxMI$j5B2l=Jc;M`P2k;edd1|u;_L>83T_f z5%e1L@_P^NQ{CgFa29f>qplLu%(V;3Nn*t{vE6xmj7RVptabGwx$>QM`sQH*gK5z* z-TqxdUAFtN$!o5+XoAl%BCnYTQCto&4`sCUCf!)`*C;w=@YLvIg?A~|wO8%zA&ybV z#tJ5OQPaHT1+9eF^&v)iI_-LjpUUL&XeH$8hMn>(3+w{2ky^$$_QhY9nd%y6LYCHI z0{Mgm34fK|9gHdcs8F#ksiFS7I56@3mS|x7?eo9(&Jl_U3B4u{^a#xz>e}Lq@r=(g zqvv!ArW7XiitbC$Zz^%2x-RYzoobz+U0r;#llMo$mH9LJM$GG>`pe=mf*P87_PN># zZ(5j3BfXU@Ul+e1p!gI`>z;9MIASEFzm@o9dy`^}z3Yx`u*h2{ACa2jQC+W;o`>yk zJDeTx3GJF(tsSm~o4j-mta_v6JQQ?IwKY!p4PBz5`J4OQUXiT5bKj@V_T{?+ z4bYTRW{dR1&ewL)s2#Binn&sh4SZSYwBi~4emdt!o7%@bzLEvlB+yj_ZnurxG86QO zX*?5q!@Hq%Sa60#J06BV?hyOYqWh;pXtZDX=$VP8hz(N>r>3-@qCfkuQj$%XhW%iU z)cbroElpDS4KtOEmS!R%hO%5SVvYwE?HBjDe>+3PA^vv9&|4LqLRF7x+Q@3k7rb>R zFR?O<64UTj4~GhVz#&w&z)+k)Jm^p)cB zi{b4*utieN`n(djYjS&q{quBC;&=*zf%gS&5B@w~tid1a#N zE7~?ac0?9DEv4i#3tS5wh!5CK@?YMU7N2F`WJ&6y zbWS*ysu1-7FYsP^%iW&GsohqhMoe)u#>DaIDv6HkN{;HZEUC)4!C+ z-)JXeE6w>P!l)x7yk_qCePGv*{PZlm?h}nk4eVUhyOV)w;Hltx~~NG%SdB&XA91D)tzn+?MzU$C>yili}w0?t*m4I|hN7%kP6OlG9TC zPPyZ7wb=X%uG9r%U$cx^f5ur?Dx6lMr1yDuyPZodE-KG5=XE_${(gs940nhFukbsz zdA;Y@aedZk>>opB7Wl66!N)up%a+U8I7A4KN4+=T?DEk3M0!5ZBitHKfsL;GeMt|M zv6LJy_cMymyz-W&U;H{GLXrhvrO;D48~ZR?hWshX3L*WyvcynULO=aov!dJWF)Qih zotwCd6f2Cu7sFl{&4>1f<cHn|Iwv*fwqG zs}CD&*wSK~<&S{NBdb&EUstKxJA(&U-M+fOTRD6bG>|oV!#@(Z9bPNih4ciOT1DE1 zIjpH#Mkz#8-@rffq$#d4qvVl+n@Q`8cBC%v$7!EeK}wVDMmI#&Nai%J7i^y8#Ljy~ z3};22zaVt0561ZGqjz|?q;3Ury(n9sMSA!`t%3a@hLgq z5@=qu{;^mxb>ek(NobtZ2-Dg4mDBe0l|}yII)TqEbRQGwgr@OL_SLY3)Y3Z@v{3kS ze7;~noaQ|KE=1IqtZLfur5>$Cd1+nh)y5Flr{D0C5M?BR)I}NnUqw}CO^tiKm%FUL z^s6*)$vzBpExxC3Lj49NjLQS-s>6Qb3=VVNvaLGb+^ka4h&pX#2w3zPX ztv93?b1PC-k=`rVU{Vx>Jr4h!{iZWP(%4vFt#IwKdAE9vW3Vj6{Sof1+1gqV)c$2E4OYJTXQXt%K04n)gigNqlVT#(f+Nk zbzcR~OWUa`-|n#Po>lovi{06MOhGq~AvEiy<%Zfs1$%a-F5a>K{PNd~IP!-AV_mK& zFSS4)%DuPW3{5O(jlQ{9&?*XkjlR<5|Ex}@|4Db+PgxrV z`cxsMOcIB^8rn@}8TWx>REPkRW_2F94?lvmna1?kyS`JAoVV`RzF5e2eu0CqflO4K z#zs!)!gHma_v1OCY43eG#$_97h92f_HeaJMxV37*)mh(xm8{Xxxb^)knS9*}>`jOW z$=6;=#9fBo_8xj;g=UUQ>95~YIuMz6yA~TA^`wbIP7CvW@T0gACPgoZ?-rt3Ag@y) zHp8a+9H*1gj(MwAmR(%xWL;BsZ1-iO{wNoHx;Mnmd}%lYO}B7nKK($ZQ1MIdrc+hC z&Ca@b)6rr2TeUI9gIH8mkhk18)d*H(2l)wXoEw zo^M+t)s8(=1|u3w=9U8f+)_)+jUx60bDt246*^`w zoV<0F9Cj-ek@%J~g>sSi9zOQ1-AJ=**j3ji%Im$tDBRyIDA7$n?Hf83G=8@;mOrvm z%HKkk#-yNp6|X9`!1`;#9flEuJF3`3&cPxN5~+AXYD`#)lTXl>WR5PTKh$jK;+;Cn z5#p0pSpJ?fMUDb*&FoxQN8Pki(Jun{{kD;@y%2j3Dk5FQoh-4SN^I|zs9EQ;!`$w~ zxY@_g2{O=qD5T{Z_UB*cYfhZM6ZmEbOX#eTo+*J(&|ALR-Us%-_h#RaF87p4Jd6Ak ztsY2F8mER3UiUElIe}Zo7yoDE^-zV`x7*<|bdSkg7$*_E5AvhZy7z`#86J7Y%2;1( zW!aUKdx)+a9m zULAVE${{s=e(V%!8PRs%$8sJTN-}p8u&K0}PpZ*hd`T4?ShDQkrDuC{;c29}jNQrU zUV7pVr~GnBqZFBC**jX=KVFqqvI{qMobFe$4^tJMTX)tg`#AYzanPumEtn-c^mgUX zF{za;RWXGR0a+qZ=3aVk<|ey(Mb|zOcZiI9Y*=oT$y)zw>?e8u|G_cP3VINnxj`2Y5N}B%5%>nS8N-T#K5; zXDHYGlKBK?Hhal=_fg+3+0UxgF0Xt?6&~#Bym(?4xwdtTp|E?4DRzz8u{Fn*H6iJw zUd?B9F`bHujbJ{nC4E`T(qCi55?Vgq-YuP69z~PF@tyrFl-&xSGJ2Jm2|-ubUDPFSAMp@XY5(y&bY- zO%n?@F-R+xf{S%kVLg+tlW9kIZB;v3UzfeCCC5xu$ga*}$o~2*?wwSDT&iw~E6r`G zhVqTxcXR6re9o|cGvV0naEvSu=NOIZU9yXrxV_VEf4+xL?Ed+bg?n5K-iKu< z@S^$thrVQg>aX>DNd{d5zrN70nEFWG@9>JkTS@Osk~eQBTj8nXbFkjYCM%nYo#s-K zd~~)8`-EU0yiq`1gxFRr3%Pc=IpQ>drDcxGqmKK}T|GYaxw7<`Gj_D*_;TbVOw(9D z3#dk5)pXvdb#%O%XH5E=;qmgLR^PPO!oLk)Ntny`Ox#EneJ%IA^4FI857TY=0{Ro> zG#`IG8dcG;mQ)boqD;G+`q6qapuN*KH`>a;N+`silQvXauvhW&H0ST%D!1kO-C9W(=P`L*}69 zo8Tv1q(bq*tXR}AUC%n=p{UGD=cT>9g{hW8SG;DUUsA?VPM^|hPP4^$r!qM9zb|H5 z=<0Z+GJ3~Y^!oJcNBxl^rhT=>>;*;yOfMeWk_Hx$&3&zH=5ZKDMvF(_1^bVrY3Lqn z()tpt5uP@i|J7Pmn6`?^^YwiA`c0uxiaTYL1mbsY$W1t!i(%hds1baXP)g&gnKrSU zgBy$!7(yDXcP2C<_}LBe__pzF)zQx?>)(GN$gcW*mpt$9Fi1O{Q&F4bze6_bFUo2A zXkFd>M82o!1jDn)JjHFDXY|hmjgtGQat5zGLC8gNakgE0ye(x+o+*VjEKa75kl zPAu%y`OFkABg1AR*NCuRT#@4a{vqp8svAm5wEDSu@7}Bw_7LFn3>Ey5y+vmBe0*MN z_Q^JtXLGrJbgIajS8wH*<+SySp$~3y1M$_^gKXrRW@ldygd{yxQF_qlQu}OIQtdR1!)& zw6q021N;wa!4>!)MN<eh+nCW9%T5h=q0Km2X{+0OeUpZQRV96HvL0Vy9;12;V9@+yz2Wcc14<7ISc>n~` zyga}zlz{C1mf-%zzM9nj1_IbPP;mh^cxnGDi4hg0<_cP=GP0 zz(H{Wuov)oK^}O$0GogpB=R727}x|Z8qog03$nin>;)6cP=^BIggmIz2KMf^pCe%h zYz>hIS%AP^;5U&6Ng=={kY9uZYwW>80qyTVvJ=<~Sn?r`gdK(iK70fN_}zp2B;dn< z)BqAJHw9xQ05pdGs@H(MfIF(d5ez`=Mc|+*0(*IZGdi*fWcLbyZ3A^Epa>CpkcbR? zm>)Q!17Fqs-vy3*U^4)00yZLu1Jwp#6Ud50f=Qep6%6>@|1|aX_X1b&pu}HkYMu$55*7s?%@gY0DF(LSip@7d91JBZJals6zn_ zP~hm*2flkC{Im}V9QnWp6xal!h&+&W05*ZN9|5p0pbiE6i8v_w1@;2?$b%fL{SO1D ze;`Q)Yyv7a0!Lab@FPgDU=MXDpv55%@-Kl810w?Rpd5XF6QDX!=K(eW^*rQ3vJS8b zG%*3NO`;CP2kiY%iW(R<4o5a{xY!?4_Xj8iQ_H)y_W-2-h9!uJc7a^`u!098GdR9s z@*fPVP~%5&q49$QG6p~L;8q1Oevk{DA2mu~@&h9;6pLn&C@yq<)L@IrkIJM6?!AzU z|9)K2_`!QL2EPC>6hblnAQu`x_)vktk3>1aLoxmb3ZH++AMhy%lON@z1wsD54qu1- ze|5-?jQ>a^G}{lzh2DNp&k~sNM=1$HF#dlP4iDpxdP4h$Ul5Z07x}ls<&YosB#+6D zQc{Cp{QoMv9rB}IJuvxEm3R>3|63t=$d7tg!sI`Av4z_G>u-khAwTLB43i(FgaX0% z|5a%D%MZSdV(<$9Z&Q%G|Dw3|VgK@jug@6#NK_>Q1mpj=!s3u0_4b6xk8(nSApc*7 zrbB+z3oIr-Fl7M6_Jc%mp|_vEI*3P~9|R%FkK#h(2d98A;x7Qv@dxBW;|J%gF!+%u zCrAjk|Gy5EhwcBb57N>0BLLC&M-&%&{86)lnDIZD$c5Vd7sZ9nkDA8B_+ULKP7FBBJg`$tX1 zW5yp?{D34siVL0puMY0f_@kWgAlUx@I`sW*|KMT=M*I;Foqq$l(BcoS&ium<&F6mv zYF-VEA6!nt;76jCSE1N`_WLC|KWhC8lOI^UgJl0jaiR00mWnX>QA+3#jQ?MS_P_lX zTw%oE7eLJuL60BgLW@7RB#Oxo(fgOczxOY24HuIiSnY#i`xiiQp~W9ubjILELX;om zLgNQl$ual^AiDkqa-s2q%la7nNR$#f^!hKzh0c%4L%`%mDWO1+|F1&J;rNNlcEI2l z0CE=~*?&=7Xz>R#JuvtY5S{-4xzPB*)D#SUB#`X{#rT62gJJSRG=B++;zHvG z6WB2L1t2>A4|1XLgBf=i{78uApMYHG{HPQ`On!*2-y#3U`rTh0;-m9FK&~ew?_Ve` z^!WevAwS9wq`g9tAH{{n4`z*Gv>yS8uD^g>X#8NBD+WIj<)jG3=jVU#zkhvp0uarA0J+fk!J;G#ek4#}2Fd3)6c-x50BWiVgJ0mFRPg^nw6}m^ zU$pl(Y1LQXv$`7TJ0TIQF@Zs5BhxBF$rnil!vck8e7q&(Hq@M^a}t^i>2Azp3H8>J z1><#=cc|Z_3*MSLKmV;eA)!XhVfW$6xa08H)>h}%;M}(^_x0_u&A|uJv42K??*zCD zC=OZ)*X(WVt{c7`Tp3F+bhp{-T*z9^`d#wcC5SzT__8zE&Zb^(}IV$HGQw zHI=kG(y&U1Xs(@kPx<#=q5E64IPaxAE{Q~^>syt(qgm@qV#2r0qjJYflmyl0_8R%P z>uaayNGR52W z>Tb|y1B>kRA(iyEbh6A5e}9o4Bz`hJU&nHM!9l& zRY`HlE{BIh*Yv+kNIJr?${o11?hx772@Z27@T;@%bgmGvvX zGq0&Uou_cW>E0q>_{Ng8nod^TOaEfJt`IigODU&s?%x=b`Ba#eJT3`2#BEnA{LH6i zyG`A^R}nb=)+~yc_6zNa;WF}!Vg1t2b%6_hC+gl*2z%RAadn-4{I2ru91Yw2P{5$0 zfqknKJD$pq(UIwN#*zH{pFUgFC7;1seJFN5$jx?TggeHF`goh=$XRUNRL`Wh_nY6B zNZ>jD;AA@1(-16h_Rog};;&P~S!3>u?*@+<)1QSASQgrCt*ubhY~%SWj@!oRsgJYN z;Tk*8v6KtpG#*!5F3CF6wT|n9$8FRpTN}qM^9Vojmy6;|&&xq0>`ajr&u`N)X*kQ; zA8C6$$CVSBlqIOH`%oHE)y!?moZ-Ey@c8+er{ikGI%*({>8TZHE{xsSW7Kw!r z*q#zIsk%?~_P77`Fn6JSPvVr2MdG(@aVZCt)N`dlWpwk@9Q2P#gY-W+lPVYSeiS~l zpfN=it3){HPIPrKh~AzW+bDR+xt?7-MN;vGtOmoa-qF%mgzqxky&8#f1%}!(KCSJL z;ZtohR`O*!KH7Rv(no>}u$l97nY3WE)@d;r^wJXpx@BF z%FDp#G++DNw6C32Sr`X?lqup1RVc%4W*}cc6uf2ko=?{3%J$v_D+?|-F zJ=&u&VRE4NLA?<{gVUQ6=ftO181sxXKKLP4X%??=X!eOFM2%m$8sM2Akxnpr3Rd`j z1Dj1>jP9{A;zL2Zv-XTc?+e}0lJl;4zlg65Yf ziw1&0lW-?neY|mMq-KgG5w5 z0M=CZY>w^qO2`?znA&7B+y`zhuW(cH`eN0JH`{fF-y2cqiu?@SUA;$8K`P?q%kDgZN*H4@9 zpSb3o^3gj{sz#xv z$1kT!PKB~Li(RgMkUXG$XYJ{#?pLz`wpF_021IY~eEqoWQ?xB4UrB*0c`HyL^DSR= z;On3Z_kY(0mgRJeB(N!^)4a<{+1_|kT-(2{hW)vX@W=W!5zX)85f{y`DatKUJ4;*zqG4OvsBbXjk)42Pj2Q+yQujod>$6ZaWNJ7FyfRddiJrsNI*(lr}Oq{ z(~^>8>IP}X^w7kzbQ(XozD1woFSzLBR*c(ch7vDP-L_MYZ0{dkJ>5>L$aHKM$R%^{rABO13tzF3~ zEPNWj1RyFr{hOKtx%lG6Hb&)>l>1}K~e#4cG%`XH_@-f4DG{Ep^Xg|Eed#~Q>J=PSzJ z-y$AieRZ2dJd<>Qi0zgXdxHnHtz^mTkE3RWye~Fde+wVz9cb zD}AaW^xc|QF2UY8TL*d^ZM9uwj-~H}a~ds^W=~DULv=C!q|=FmNzRwpX?;b$jwcqm znPgZhH-C7b@QY=>1PP0gm^{Hy-nXYVKdroXgYbS`$Jw;S8|$R3&Rs<&z0 zX!^l}dafXa%Pliv)^)2@qQxIRL0;O6zcEF!$VBFV!{Owo%-__tu0_kdQKY$GsOprQ zVBRO3l#V!N7OQn?I-bQg>Jq+M1V7_xaauREC!ZuTl^&;?9y?Jf$+s48>C>@aIVsPg zeBrmBNKY(&{JA5No;heUcFowE$>eE+vDC1?F6EbY@sC`!xGKF)AIBHn<~QFp!G7F5 zDZD$NjI)(5;z!`9bF=ru)y$|E0iyewiRAOFAJ_&-ACiA^*J7L?J$1LLacKKOG(`^M z={SXuXZL+;q(3=XcLatNEzB}9ZOBFo1mC(@xUG;QQ<@n_NB>MG20LniZa6kkG^vBq z4Nva&_-bo^d)bZqY{4~lYwS9hLL;NK^y92Z&dou*<6&%@QrzFRv>LF@}MY??!L@yx%z!0U1dRo?{NJn zhg(xr9zTe}c|wY0q{t~|CP1;+l+K#O2Sem!%{c?Y-KWFGyd_EB7p30};uwBOQKU-a!!-NvGc4+- z)nAA$y0m@^OSgi^6UU+5_e$ACV+Kptw!X2GQSzJt!@tL)t*wgB8~2NepZL)fWEr5( zT_jSjzU<`4`5Xb$VG5dQy?fH#EUQV@&+~GkF6+y4Ay_V%;e#4AZ_W~REGy)Hp^tuc z%|6dS1}SZ4l}{gJl(RAWec<7If&x+G{P6diz2?c8OKp__ip7K$f#*&sEYpfEkCkA> z#9Vr_I>9sEb?*YPN1S~^*-pfEiBNQ!fB3MDDh?6b+~CA(h7RcISJnQofclBOgLMcH8;SK6*B@0YX zhMpLTOkZDW?2l+NF)r)twurG67YV>MJVzcqJ!4RG_m+nMBPmIvF>dfw;;eqgO<9do zTIaVW3+?cw78hzl(`pN_o*;@ZN-OsB=Z=qgDOTR?l0Hw@=hVaCxIKfNZ&7uBf{?6G z9}!r#EZ;>t(v`lNLOzT{nlfHDe#A2mcy927jl*E(4AXC;L`eQDW?39(nM8VP(4S(n zd-h8?Cf4#}043HjmM#7lOdM2HtV7wZj=5nfiNE7>&l^Mu%gEzAAutf>7nZC%*GfRb zPrDOHQ-ybB^>N#7t?r361rfQxSS>#7--(~e15z3{9ky1VwF{R>)`-XiTEsk~*Yaz7N`-UbF87*G%q5Q33ZI&) za(IwUM}{MiY1%Mx+Sc*~!;(WIg)vfY(@ZRFBRP1~>RX4-AWI2C_DS)J9|E(9r^go7 zVimRqkmd|e>3b@e*`z9{3|&s-1ak9n$%cjNS_w=LAAg=>F|X~#X6YWm30HbhnF#Y+ z(!IIsA+>Ol`?W+EUjknM>E?$PqGL8w{^Eo@*K%-fF}!;vL#XMv7}a*tN09E?v*@&&(fsg*WD1RNM_8cHYvpen+#k5Ox#Z=nd6gY>=Qk546g4#JtxtC8 zc=vm{(5~Ea|9O1o@y`{u-LN=$c$%eCCYH%NoMd<9S;aL)WpX0ft$-pKx1WSr_{PfZ>6}a#b%CDECn>jjW>sKTmCQ>N>aS7@jgCT-ut3`jEAaE== zu`}VpuBj=@j2m^^axG-c!(I8pjm-r`b!iev-QErHL(8%pC69T$&ykyFex9qqrT3_!)vrMtiC=RK&8MJA-d3 z&3ak=7wP-Q>4t%qHQMfeGFe-}t=6gPVUV-vY4JX=E4;= z8`fWu5@s)q^FEG@v{Mwf>l7&!y4W}Fux7D2;mF8gFRjz^mGD?`%Sf}_T#665#VPsJ ztXPd?F+%9{)zjM7YCStF7%o2csYoGxb+cgGw$-f#$FAXQi%nHEC&{TZtggNx=A9qh zcRZzz3qQE5J753AmvW{1UNgbz&ZdoN(nS;OoO{ypWb|31or|Burp{PR8T89Os=ck2 zmbnv7K_)!xLKIkLA*$HZc3wcs<(4@&XX`IA=O@(*bpwx{N;G|Pifv@NcqVlQ>j^`g zS||niJNgEN;puZH5X-97T9Wu=3j8<(p;?(eJtqPQQ@f=jlAok1r8o_!5MCWR^WbdE zJ&W%w!XH0QUjC_FP!%iVj;Oiw+>-8&!E-GBI()fH6u%O)-rIGjwW27yt*md4r6LvuzxuU@rUXziyQmV^73?Ot zlob7DDbeHY6+CUgr*YcO%lz!a%fxDI-&t6b&US8`jhje0*}s)|pY!UoiW93JDhFp% z1JaYc(qo4&Cp41{NsiW=bBU&Ey+Hnyye&kk63ZxNyHw;?esgwj6*p?~R)I;m-?79G zS04>rkmU~JV=|2jqf%CO>90OTU?h6=!h;*?sp5;wzU!xju5fV_Y#wv_vnXr$97ZWY zzQKfizU|*5q}r!PY7~0EJT>%#lJ)iR5R+&H1S7X?nGlx`OVCc>YO0g<*GKE)9ChCL z@1~yYb!&3&tzBPyl<8`hkjC0*snUBvJ?ga8{X#rhGHw-^EM#LaT{qofOhJU8g=du%u~SnI1|XGhpr2fAMmBPi3Cv zj-F04gZt@zo?TpXg1(U6P`hAp__#k6-SCTwB55uH;|;sgY4uVQ-{UNORWn`=gA>-* zjvHBJNHr^YzBl}ZHIVDFN0NNEo+yLaZI$i#r{~2sZIr)!(-O8M4U4mL$DPH>o3B29 z!7{qsV0ZON@vCr43S-rxwStzEm#5eL39e?%C})kO>(WUT2Ke0%5gth4d>$YuEDmQ% z$y|E3{NTI3mS*P}>%d%k!oVK|D(6qoW)jXkT8CT53Vjh+SK^**bW&;*NbtlBjuUzK zgY^_SMNVsjdyex6uZplW$wO(bdksYW5ld{0`b%B|x=IY>Pp?(uEy}q*-OF6TnZaV= zN*XF%e?4Vws}m7FbVb+j)fonF|EYqGn0kg;0>an{5$a|K5fztX^DkP)OrA5*Q_k$Y zm0Jl(>f{TEJJ&j+l=kKLoNGF~*yL_M(~L3 z5Zv8eW`esz@Zgf*1h){J;O?#=xVyW1aCdk2z-7bU`<&$Lv(EqCbwA`2tEj5(Usu=6 zbiei1^B_XZn4|nKZ)TA`^|yVkX=`-mg8H%=e#I>2>i|z)QLY-f?OUhUI!?U?5$md08Jpln_H|K%N}5i!PIhpY@h5POnB@muy!5m26U%xBpb<4A-SW}1Y;{eV zy3>3t7FzRR;bX;k@iEDBSxhNhcu8Wa1WHm80i3jqbQd8K1k0n7YfQIXY1&}jekDLN zm0kyUw9jV=w6~&=yiE#s*_1VvBNY(|e)@DTdVJSFLjC*YfXRd&I)c={;^6R+92MSf5DsKZTm&=!W5 zHArQInOWU!1b%AC!f&Z)@ZsWg&?s_vNx{&zjl>Xp(MlnDLX1GNmGPwwu~j?UyKiG; zmQKDqmyX)w6vBZXqj+^>n>TM^LDoS+z<^ejx(SpM9kWG`+so5$P zE0nvVi6pSxola^2ywsp(%4?u`P8bHq6fp5uIuiQ~Smy_ylieh;_d?b6fYwIwQf~_% ztz{6wFnOtC%igyi2=aFkl)Kt}%{vu{-^3AU#%xiWDqIF#_*PjO<@q7p3=MEQ)wa}h z#pAkc!jYn66l}F*K`9RV0`VK^WVk)7lyF4WjWZ9^50b2~13bi6ZoXu8+?O9@BhEL7 zsja9gM5tRO4s=vr$v1p%*kH1nX1b|8+~lgE|IoS2MyWnIB}S*3X`##fZv5T3F=tQ$ zfyrWkKI5>``Af)lRch4FzQYwh2#1``Es$Ajj@05X;k;FP}XzZACT!-2W!@U-|Mrx zHV%$Th;;{#aW}t$3zx#Rk zZo~yN`t3?TEG*8!YL6OhU2e?C{!(;mt8U&$vh95ix*$5Msyc>OqpNHYIL-;{@^#{{ zT-yC&M8gRXQ(3QKgWglUA~%7dTd3CxuS-mfAf!3nHY^emkYddvEXBf%T}=&YsBp;0 z97LCwNL>J{`w%bPscAM9I4jEaR${FX!7UEv8t{dVr@`sEgwpD;r{anRyu1U&&x~X& zbb;r4(r1j9-Q>hp79hA{Fcj~Ksh98J&lfDMsp5(7W4lmEjMa?PJe2kFN-6nE=w5Crz3>g8q*o?5s?B3`DRlTwB1x(SgOmNDuYO^$_1x$ zMI*ihC!FLEzTQrIcq``)K{|e*R|zx4=ZrnE)Un^9{C*@a6OC(L zK5+^OFGQMfLQ410zxdV&k)9ONU|s|UYZZnoDl#h9b3mmaeRYqEORe8?7Sc4TR8^!&~FqjlIa&Dx30Un)XGs|LP5)lr1mHJIWcs^}<+!Thk{+M$ zFVEMFJsU(w%Te_~XxDTxOk(sprTT4};&;6CduhGC>|A=I?Sh`9l^P#iHXFtMpqQ_B zH(4MmQZYT@j%#%&yoAylG}_Mzq3$pRd)MIX+jJgCtIVt&I9H|<{!lDX$wbTAy?HRr zGAljpU5gl=f#-1PKK_Onw;~gwHr7~Q0d8!1yM+08X@9-1sHroE?}(v!oJQ zCc$H_$TeXcR_iZ)m+ZgtnZf6;#8&5r=TDH$Y$a9m>k`^E6|heSU@4VQm=UFFA$3%s zPYIOlgs7&-iM%T70Hdm+iHtv_$(jm*4PwV*(JZFID*(H-k|sXu*x7{o#B!k=oHK)? zWNx@YB%m6r?r25cSx$l_*Ra&>SB2iMeL9gtri0@JBx#yU3<4+_9=uoX7|=9j+99QyO-fg6XD8YqW_*&fTGL zt{D$^aJ7K8uu?j@joGeV26ScuxHiL(8MpoZ5S1%)$=menA5d`uUn>R-I{99_4eSd=E^v3 zKQy3gt>(vP$Zs{TynL1})U?4JU~^8^k*ZSK(R!_Pw6vdv`!#PA?swKNmZJoN-Z7$9ZPkjF@52QF-^dSMS|6(p zX2q$cha0JE(7Q32EW+FCA*Ug&7WwqAIol}bdJ$F0?2IU%ehaZj_bdoWkzyLgi|?zlbF zsEU!Wy9A2H=8=FjzPZdqdUlmsLV;%RlPZ5zaRFc6g7Oei?(|Oq?bXClA$JH97@U0v zII$umS7OX)^17(dMvYOVoiNBP#BtNY)Tr%?;+ATWB)5{tyAVvQ400n1gd21eapsly zn{OLGRMaS4<)W+DN4{I|D9!%pAZ?b`!$k>v4K0rzo%r^f8k{$_;GIURUnl;-SV`=w z$wAq6WY&!sY?kEDWR|_qFQ4vN3P?h}z z1mUnkPZg6f{?f7t!EK%_Z9~`W5)U7%F8?lF$4duhvL^gET04DNZ#m#i8^)P$;ts6U z{TCXpjgdT5A@d~tc1?REt7|qPw6pqRH{x;cSYiK(6G8}5E4~-C7l;dJKZY|iu=o@@naMC2E(Og*aoW5DyUu(>2&G`Jz=Y=Bza4gX z&ppe8?ONcGm`ZW{gQ;LO`JUWo!=}Wd}*4Swj?q$h|2*cz0UkuShIvRQ&zN z2a~n)sxE9|(VgCtY2#|DUCW~iWImVshlXj}!2gube$GVrBR%0!JC*rw(bOl!-M^9+ zo;TV2FZpc1Uz#R=%V$5QK0IbA{ZIMq=e~cP@Bb(HY(~aM{p>#_ZU4JSHoY+GAM)9M z=CcVi{!#i%UEpV#ZN^7&?w4$TsVfUJKFV`HDuh3G{8?)I4{dMe$E|#Te-zYx`sZKQ z`j?>YZ<^2o_=kj+zxUYuTS6V+S?u~zjQoGNP*)`O{gu$NuaN>>rcgchk+M(jo#s?D z@Rh2s>RT4lASY4rwy=*4-`F*870*bKdDC*=2E8F+4FrrP#`TJSxc_tudX{p~RQ<5M zaJp!?=d8N-qb=rAYoV#}p{?%o;(5b%ThVPD{XwTqAH&p9$mpimrgz%u{ry4SY={e+ z-H-XX#UB^<4EO8z2Z(oScz4?zVbOSD_TPr=j+0bK=UmUqR7mDRkMeF;$?5G~UGGL= ziST(4cpmoG4-P`?mxo-jxF2r&eoS84Kj17{^1WvdoY&2wY&^d>$U9RSud7S1O7I?p z8!cA;ks0vNMX>5LZDu#mB6E6wY{)TjbAVVy9zvgqow>edl<&Em!qs5Yz$kXv0NUD@ z!g+8!|KVdPzKhI7fMy$U$`XTZ$Q#pBkrYUo9jyn6tH4e#L=-mhLydF*4w}~@fLQ3eVqZ>%e&<}!1v6!)PnSNdF66a6Y2<>-AR*_ zK!&fCZlVdcm$0Y_nrn$xj;OsZI9jB6aB=@u==_v@rwP&ZQw`!}*Mr$u;dN(!dok;K z4Vl2>>bU_I25yC7| zL7fRT8ei3F0$CLiY?+k0HhlC|L*I6hsrQ3y$@RUNl0Q-2@ zE)M_Oiz#rQB+lch(HARx5o%zK7N7bv4BFzD*-YmBnNb}BT!fwwQOBxTYrHj2X0&BlYD~reqg`~AV!8=sh zlxH7ywc&yvs}+A~nT^QGP9eyq1O4{x*=u|DJ)@xAy=s!r2P}H)db}plw;`2pt87k* zNE<4hz7$#r_rabBW1k-S)$i&VR?hF?z>oN4Y;7r~f@Ifd`@DAMaWZh_kQf49Y~Cxm zlC9Tf@@JB-%UU0TX$GeH*9vqO~2AnWGly zS2P29Vp+nPPMJ8sl(2?DWMsh5hgmAa!3?oxvcRA#ktYI#UCLbwHZ5~zIZ3m~@Ipdw9r(!Cgi>E20|M~v@fdu!_Z+=u#~ z>~PDQ&eKK4331MRCbBr-IE>cI3p}D~5$yIa$#x(md>v2^0;`%9d>omNu2n7}qCCpr z+`MIE7J+d_8<$Z9^myS%j1eDRo+KwaN-1)>W6A{3!`#AfeN{Dd}X!^(Ohp~CY+SEj4 z?ivtd2?7p8Evt>i6#2Z+sct*zH!rl_nQv;%q13?|ox%=*Gz_HEPosjj0ygYBs;7*J6#Nw1S)v)E@sPoE6Nq>jPOwti8s5q9wB>pwW z`(mQdYuB7yq4M%*R;GQ*N&fPwQ>p zj_>`Hw$jMhqBr#SjGM3<_1#Hdw*p@&yG!}c(P^|MqiHVW377INrUVC71YDp#^8 z0X$8&z!zMSHJ9^%7;HZP-R|n`l%XcZY3hM6J@a*raubR@R0u+cgMSUHWOy&Og0eML z{+VR*Q2fDkh;=g5OoCgJum$l}Du)M?1fFv`?XD$_$DY@Cj#S-)ZHLvsvG zov7br^#U07ppSWzNximZoCdK8k3P7xZ*<7@Mjz*!zl(v?F!XL~J_nQsjyJleX4(XS z9Bk8B^HIL8b~lp#&4c#R32GwUz(v)qN{0FVCvBW6Pl3kh8pJ z1FLn_SzxQ876HAT$nI8JlF;%AtYOtzbfZsuQRDhCd`+)t&X#B;jP-yt)wZF$ zGc>uFkaO$%R2bScbVECxe8TLsI5-95PA^%lROW>NcY@jcsGF_odxbBI0EeTAtP*<| z+vD8TQ=4(aD7Yi2C&f2p2&A`WT9F;QEE;#&PzV~pT)pxSvE^h|WI4*JTke04w=jq| zvPX~odM*?bfRli?xJ>Ue8)X*hd}g_fkw8@%F}5cJA6R!7M~o2C$H;~X16j+Z$tnTX z5v?OU?Kt2~c?R>sJj`72%cNr=wUD&x(ZXiT-koDb1u5yd^ohQO&IF5{P61I@*keL2 zj+fo71A;CQsO*ZncTfJ;uZbBm6C_@AyW5~z5^v&g>Nv(Xk9Ba$t(Ym2mJ2cKF&X2yo6(w038=s~=>vJvxOD zrz}{c^@p01-yzAG(|Ww|lPgED=)EY{07u^{TfiTKfo^1#_sR0w&uQ769rY`XeIw`o zib#~WL8IcsDt=%R^lR?z3mcXbFf#8spkgisRiuKVgtZzirs6J|5G;U}?f2 z9;dHD`RrORR(O13aaDFi((@&SG%P% z_ulz$JZqg5CKI2=ErNo_kIT5GXH~ibftX8I2&7AxJ-V-q>u@z|tcjJ)a*f$*M2+^_ zTDm-0-!Inb5Xp;X!y^;dbnw9^1k0!3Xi09pDZDKkV4U2Q^h=u=o*6?A8JbWjku~Mi zfDmD#Z~=`Mfp^8h@Rn&CN&)Bg!KS56v$6MXJ6DWDOmSGU}0g$n9| zG4!8j8?%}ba~b#4U=*)(na`(Zi9fhrhLOr=B1f>Ov@>Y$LXQC`=*UBdk&w`0X&O+`|PdI3C`Ry0)XFM9W!rYS+ z>roZT7tD>yALi%+aa(Z{#6)YB7FvxRzf%R{mM+>g!t7&OPnYJzazl%K8JO;nA0mT{ zc{xOj)Iw_HqM>1%2t8LGR&oqp026FnURl-9-|8tDLjI!Sg^67~uLlA+*%DB;_>-gP zwZXRU)|$@UD62c1mDkzJ7Vidt8QrAwy9Fi9#5ZcU8~o)AGR5)xtE#Lvou4KIUT_1? z)SR)_OgG7?IRt@DWxYjQPf zu}GS43jyXFiZu$=UY(m{at}{doU1_^o4pTB_5ihGef`xK(hph;PGeGmUCyez!a`M~ zr0$k7-DDQB(>hwpBaM!k>XQ)CXm@#cZi;yAU|CPaS55D)wVVakF>N$Bn@n=dR4egW zUov9LHU$&AM}_($G`z;H3wil+=dQ)&`Y_8Ij{DseO}?4o*oKE!oIt0&!bxWL=$ExH zwKbYkB?Ut&FW^Fx*1xb~EX#bQ+$4#?(nhIr z0ku{RElZhYIBQz!u4&U6ifZ@nwW-uLQbZy@1l{s>zUn*8?_Oq6x=oqOIBf&wTalCj zv;o(|47M`gvkO?sOJ7z%PvuYCT7))P<&p^*$qPu}VRFJt=~SM1YyZe!j7l_I&wI57 z%a%J*s3+9-Nv#k`NMs`;gTiP7epDhj21Jle;2!x=tl`Eueu_Z>ANpXZB=bc$AY7-LdDi8P zc9N&%$?jh0nOlxgj&%Ob{Sqxfj-^nuXsrH7fFAAjyFMa=7 zjzs{wJWwOWbT$E2QtVzD36fXf-GAZfR3UPHOk~=_k>|dfZrFj=1*xJqMs^J0(7B&g z)<>k&cx}FN=BzOnqt2tF7vxX77!Q!fL3m3jl4X8W6O^V(W;N{51_%0y%zPb8*+j9% zqAQjYDArGIp`cFv@@q6f8L1-OIpW2K25h^f)(g+o$`sron|eTduh}sJpYGvZY+a^d z=}O_?wi38K&XhlZU{BX*eHiC9R=sw?2w8xXq@LUf5Hq$ur|W;5xO;ZYI=MaVZx%GC zb@v*<){){L!k~Yv9J8>q{3{IlllIO3F%0^bH1fZ~pnr+w{O>U6-}1$Ogx3Bs4Eo>Q z0)Mgu{3G^B@Em=7`QKxoKO24htv&fuT<=dax&IZ{D^Q;g-zb08a4COvl0Y@_&b2bJ z?x-wkK+1nlffU@Tq!|RP%oM{LNt1bQQ^iWvxTlmx?Z%FfGFHQ)Zv2gN?XBnn{;kXn z{_U%WgfDxWLKh+SKNfHBZxGEs6MA=GY~O#p`qbiT*q>_adRy!IP=nj4c~+%$nPQ7> zIm(0bLyzHZDB(Wk$9~FfhfqbH^@mD^>`=&78pa{uFWkf2u??cp%aP34dVnmu` zwQgMJ9@boA9!OoH8l@4%W#Az0fwg96`)zQc;D9r5sQUL7YQAsVQ;u(QmS1!#wUuGy zv*WJbs7$r6FYHeao;A(Y;w^E2oPKdt&?GF!A)|GacWE1~B9vz3h``Y|iDLgUzq{a? zTzgXyLV0_0A-!hR2wmVL}=P)L3lSvr_MLq!sQ!D=7FhA-7gjRQBpzlP8rYC#6=J3x1XWWt4QU&J3FE!Y)JO3>R;R}bgb z8p-$Z0t=(-X(uI>9KmJqD;CAUjotzhq;C;r%rL-g)uO8BbhQv=my;fm-0&pb6cv;9 z$XiNmoMs{AeVXsSqWgRksl?_?)o22A?hSn7OjX|(yqsh0W;{&Ash6$tDw(R2;RUJ; zCGLAe%!$`-R6g>`7IJPbAa1z_R)-9J^$;kIlE@D$=uMRZ%+>*?8z4wTyrVp?1uPJ@ zpug^E2=U@a2_s>YzQ~XL0`7Lfy3h2I?*U)!E$(p~t?tgCFQniaV+5CN@Q&}0>Go!J z@Kyi9Ygy-D86!WQ7rEaxlM1L;P-M0#(;ambl#eKR;nbz&o$g8X2FYKTfNZ_a*v9qm z%N}!g>o>*RbO`S5U$70{gid`tEhqk~a{kvEsMX_M79zv7eyPM1%nw5_Z#kK zMNZcdMGo=#S#gma`M>2Rmm1ryKp!R+sCm)*3Q-LIJ8GosNyc{Go7#zCR$MDwbn`m)p|d3(JfFod$K!SC3Xu?3en4X=Er>!`Ni1*04Cd>4q>l$b5yrT~8Dy`3-N6_~Pc zzyYlc){CB191c{i44XQ5RkH2%pG<)C`FH%tD~|BtlOq(w~Cm15k0UM+Na9M z{qvBCU}$9t{sWn4aMrEjIxfNmlaS6MHXTPa?9h_J0bl3Pw~`rA4MoA2n+$`zn{ARa zxbND1mB+chyn_VNiU@0^cFbeJb3`13hr;@M!3gV$t)m?;>ZEwc?5GF4>g5$5fu(0* zx1ZcVshu!NR5WX+RG)_^2$Rvg8bc=AD+osxwJ8aqJ5Tr2wEHx^F_I6-6)<0$zSX&U z3l<52y!g)0q22%jjM&1fBqPxWGg8qTdMvu&i+kKR{m^s@o9P7zgbspe3qnFVy0RDU z(dm%(E_U-fZKGTg+_A}$u0|6As75BEEynC>>L=2KA?qX;gM2Uc=|c6TCm~tjtSAeD zP!(qCjvSPofZjRZ@wo5=z|=vZLl09O=UlBvU(wthezM)m+d-hBhBAo;YUxLkG`wqP zGyvx&dr$L9lW%g=3WtmoES6a(BoS`ce1(uUONZ^mklyv;t;G3cxD3*Zfl?WU4Z?hu z8wK@nO~?X4&_Zd{Lwb95+|C@4CR_p5Gevgdz_oiN*r}1gi;9+-tfSFZ(X0)vWA+Jxk-V1KMt?8nq9oqI+);F zkvKhkau%FEiBn|6x@SO!1PG1853RzHpMl}3e-Po9p5zKw9UiVyvw43n8nnaAA4LsZ z%P5&WtX)MRF$#5o%(XtY%=hUdkRQKfpO-B#>?VU4P@@ivyw?LBX?-dbEzSAz%BvZc zC9I|^Os&S_mPt9J>4j_BsuV*VpJ2fpl_yFxBZLB^Z~feYfX?L&(s)$XXFK${B;G2* zSS+bELq8!L$72c(JeEJ#>#7N5yord8ObphdI91L9pV+>h2Z#I4k7j;fZHcj0Vc@ z8rnrzR*=0V3N1@5NnLwQYp!-(JbgC#-HCjgU`h&8%{tIai*IX|)3{qI=PfA>X!~?O z-;J?B*%$aXFF@+n`aU$}$}(ZZ(o%h*6mN`{(>gyoTF`G&b%cO3?^VbQz!@MZm)PPAD2q{pq# zEiV-|LzHg*_k%5%DlMl#X8Pk7$!+-T$6kj^yjp?WO_-JDlvDz5b%f`s=cJJ)y9JEj z*Anh%;-xF=gkql7p~cuE`Rd!O>V2h;uN;9DBp@^=nLv{+u0rt*e8XTL#mllO?7(}} zzFapRJteRcOS&;>>ZSZr(CTf#TtPsT_SmnbxdMDo#K5Uile=MC_jHn%0Be-~03R~nyudcbd2*QOaO+d+V@7>o z^^(-*F|xxgA>M6l`+SA1U{zH%&wAujZd21j#f3C$ScwXRkx~^QBK^bK`me&N*t8$F zuNTD@<1D)1+w`5<$SxE=iSSlKP`I6syyPQDW@$}o>Z+|LAdI1wh%B$@4lB|N5tJ|% zR;L=oGpOf?JCs~-Zw>GyYc{;KqcdwNsu!>Z-BF)fNc=dnhHJzKEzz4?&=sb_?ySRg zZ!>31X6XN2(;s?|VxB_d^}VCBg8z&uPUI)gX(}BHHRqb%e0s6YOIm@b5E=r5zE2BY zo|jEh>#~3ZcDt7p0ITaH1w28B45(=P+31Fqo7Qgx;C@Sre_RzK~wipa5% z!iFXC9-q^j!Xcf?)nudD=-PPCADK z;0hLg5(|&$L;UKL+XF_qJJH=rawy&sYO|`fB>9-x=73_NZdy6W5k6Rfa{>LMWdV9f#zrtB{B)?0eWOT zZMjLu>$+>mB#y64LXjL0AqY_^nhdlnjw2VAneW-$HoSf zP_cs$_+UHtx&5}~5w@JP=53LM^Rx1uFI2DNA#w`({ifx8S=# z4=jTpEs{#86G3S*IaChcI#prSrQtd+zOT(M8{UK^Hd*i&WKWY@`c-c<-+MW6LZpG8 zFO!L~AVoy%TF1+Gpz*D2NrJSucpADzoJcY4M|X=8EkwjmAn8Hss-{CpZ>N2$jaX_N zhGEiX;5)8bn6p6<(3C{RDPZ*$F)r&T< z=^+DUltA+l2+DgNfBa2;MNZX8+fsl$zx=b=bfp$NW}c<6p9$!jMq0!Vv**B|N@$eZ zT6`6pSPr8kl~S}NDpjS*7p=at1pCBnoG`N(=Z$%1~Fpf?fv8At>N(N z;l8#@1%h=UF_NuavIUsteB2s=`f6cVTsA;jcD$y(%Awexy|Xxd45fAS3Ki7i*3-Dw zLSY(#i;prb!~!M2C`%$*H*YmswPq#zJN?T2F;*vM0k)!rQ#bc_R4mLFW`D z+<9~e7(>hF6goVkZ=G4iAtTVo+%l34qMTByCJp!^BoP5$x!4 zfNMm_q#~oYT?lm#Yq;AmpuUktCXpcjl6c$w_*`Zc?&NCsYjk31-KBPj zdrt;c|3;5`9}RwM*@aVy*|3II_RVU@pqp9`yEb?XGU7)=cIhiBoNzq4Y4FdOsMy%# z5avhUhHKxLI_#h!4Tzmw%tUoYFAW(1`r=J)ap%6YbMZJ~Iu<)t@2eyv6_KZtIS=!8 za8-6ov%!sHWnI3s9`!5Pf4lEGp6e8<CheYKrRvu9l^;RX0r~|Lx6?dGDMBI*P7>5wkn3*+!Y|dYlms~7(vpoLW`i@ zC6AhWSbpc8&3(<|SA`z*PqCvvVkCbgbg?iqGya`I_ml6)|21~>r!3aL#g6_=O#45? zj{dSf`LD5~$E-9R13msfveO>_3jFz3jNre=lpd4eUj8dJj^U4((w~IF{}y3-%=%(` zta>u4dd&8FEHD!MDRA_2Ufdr>^DK{gkU$2&vwYJZMP>rvlSKAo&&T4UF#_<(G3w7E z>tm7SUya!x8$b1Z@~nTf<_0|3n?5yWel)KE0RL{x{HW0gcrqV+u6?vD2C)8pUgk$z zIlz-NuH4h19t~{(PfB0UjUSH+crs4TzIzPx^t+7(j+c zs()SJBOu^O-R{p?w#V!JGhFw_i5~ktd7nLB;G<$Ifc4+{K4vGf{aa(UN2gw?jSNqbIMx=h{anKERXp z!*lV`Z~*wEMEYm#<7lw|Yczn5qw$>B`3Dutqq-!J;dwNE3Xwj~+h0;QfxoGi?=#mQ zuzzdWJ%7-C<^N5!=z&jMKlA^SmmKgn_2PNv`i1|GDfjF6|E69Bz`up-{%!vJ@%{NL z|8J^A5ByIr+UFmOU-$vPsTcM$*H823`Pc1N{wL42$FH^D%nJkXpI&m$Kga*U|9fgV z0{+1Z`04rKSN`AB3m)*FUhvNkJiqe)rd|Mm|MUWQenR_||2NfQ1^j~+>pyvM0)A63 z&S$Pa2K(>t|L14mU&sG9)glHwas9;q{LuajKkzrz5`X6Ung8i6<5&LQ)XNF@#PtjR zAMXYK!T)<|(F6a}i}3k9?pOZbbn6!IKeui@zj*%2|C@Rd0-v~koc#xb^)vs|QrEBij|-E(<>&W_>nHx_wYgvT zflR+={PvmaC;sQf#9#OUEWaoJGuO}j|KtS;_)WbapSgbKe_F2nb^O_W)8DTruAljz z)|Y?fe_Uz)EkD0cTtD+aEr|ch|0q=STk=0~{lx#gg8vIY@Hh1medhX!|2gI07kZSY4^)vrdj>ND0kEt`i<@|Z#`icKJspA)Z;BV?h{>=3=|367@0spVkTTya-(rpY# z^|#a;u{cwXKYUl;yDK$=QoLJn11MT#D`cEJK(X1;hzouV7yaIQ+&?(D2a1i8y1qX} zAm~|SU%!MB0~24apM;-58%ybEezLAA((*}WkZ^xocRmb~*g18%P-vz{1GI3YS&2}f zNHt;0*A=7q-6fbOvbQpeGA&Mgf)Yi7-aU6^v7sEd*7{9O2lmMP)GA!ZggvSh^n2x~ ziwcwPQkz?qEhx83StE*=_iwBd@n$cg`SEWkozA57r8ro@LL|A{Q4B3b0#gJ;M*0R(xk>B}cfnV%y0m)Td7B^K<@%7%>uR6#iV(8l{!{1iv zGfH+f;b61I1l0~0;|VH6m0d$Bg{SrWXKLT`*#2=3n1Fw0_5uGt>VP5-p@6ZmAD{TNsIUt2%FCC!Gfby|8K-csI_lJmp9@G3LM zL8a`a4&W14_n{Ni$`|X!`s{#(Ak`7dA#h*6pMf%M*c|nDUni|m+j|%qo z$2sEUVG-*CK9)VMfxYwn&P~=X`=nM=O>H4oR>`qzom0xL$)c?ym&T%#v-2TwqejAR zLX-M~Q;qY{WYuB=r~3T)#rSF4c}kJFi~Wy*1mZUXoQk87-)w7Ye0CFD>rRiigP>GhSX{!S2_t2Q;xy zpGaKlb2f7ipv!y02!e@LTnoCn~^fD!B$2cAeHIDnU5ceXF`t9z%$eMKxS7{D3fmL92 ztq%HXD52f$WmK5N#dN1)8-oLkDLY|cJv8DSgF82mKkiXLmXCyAR%1~oC z&DiCtuigxFdRn^+5OE)65HwY$_~Br5NxPt5eP-g)UJkugR`lQLz3+7K(LzPr5kv|C zL$pf1Nzz)HJ~J0g`3V2T9r^r}u~>Ik!`C0!VlOWrq@k}xb=hG#J>kzJQhrkl)e{_f zl@3z&if;l6HNW;^W>8>UrCQTTWvVsN!>Hk6k!JzmCSukq!h3+DT3xwwRQ`hq-O6KD zxf`+FH;qFigLKGnlM6mYS>62M*a8%Qhwhvst-$9WdY7q<2!9ioRanJ}eAM_V8LT*H zoO2>J8$5gcGc$Y!RC;)Ap=g*BiK!!~Yts;!BewzGz?_1BGJPNUpiAD~F>!!JzT+Jr zcg`zWqPxLr55TVEi5)Tpn&8P&8d6obI=WhUf{z0^+<<^- z+7X%vU#(t^55|qEyDaZ}Kd(ogAj;ry;B@MN7SA}6dkFG=Ws!Gs#;xzgcJ^c#Yd_u0 z^?E~yE`du-wa>lF>#}68`{XU<5Ho|r7H!(X1}eD`0)C=#X}U2d#zSK{8LV%9A2G1o zJG^1?AYj;OJJ|tFw{F#wcyVK2AsR4FwZc(PzTmRUYe{`ztkl${tup7!Eyb0XpQ&Q~ zZro>6{2uI0Sv}z6qt(cF?TH2rkp}jlfH@Q;M$?LQktkpOJ$X!4aOh3%K>4`Eh;hy( zE~y4?%G2o;H)O>Inv1ouH#9>d)gRfyyE`(@GiGnb$q;+I2!_>BdIVvOm#fI(VH;KZ z9Yr}R6hjg+RN?S+IrBaYS&>?>RG|i`6er{0;3p|9yt5UQ-#@UBf|3{KvWtSu&22H&A(`gekQhOwk0k zHGaj?OK%3~Mx4SEY2tSGvwUC`@ef7mz5-9~k9d+@C7iSs0ZY zc2OcBsfk(n?k0YU3P)rY8OYRgk(U!z-<40OB1CX`5UnvO$2j;QBnJplT`Nx-1y=Nx z%;=k>#uho;N_WB%Hu+1cFQ!7#qpq{xUy-0RmPM{dbVn7g_m$D5?vlGV(m3{h5V!3a zIY~$4XuBCY7vNx5-XHdm|KvX-(zH5LEwjF3r$;HMtC%@vVqcK9+YH&8-ONXTgpAOy z=-(Z*pUXKOd|cu&VD}}tCMGp{k<5cR$(%U^C60Oi1Ec$RJc>zOgO?)7TQ?%l9cphi zTShsk6kq%Li+~vEYBDCVWE3&dnI55FET-W3rI;U&CR8Wd%b%17^iR9I(LS?>P_W1d zuV$kP(AR!@c|LF6dxa<8Wi-p!v#5J~|BjbN$SbY0k#7UpV> zRbS*_sllkp*2vp0jn%OC9e|y2@EX8V-HsnQIas**SXaWtzn)oQvjA*)bxW@AVMTBDn=$9*V ziuSXX2m*JA;K-ldiD3(S!(F&l?ZNelp$3=$9)k*R?6)NJ0yOuQtHI51@dM- z8D)GFUK+^BG=p8lRz;|FstjB}3m&n7XeG3B8K=pu3hPB7W4d*EKzA$Rcpd#4q6BWw zeI}0O`1dG0e*1}bV;LwV8_1?S8pn3vjFS-41#^#*(bEAIGef9+cq;sO*1K%z`hFC{xMpu*8aYHm%CjyA>v^%;dk0{l!$BD!7UuSJ6cB& zt3v3gpLprl@>tc<-FZk`nipp>Bh48CNqq%9%04c0+039EVA5q58Kf!1eyF>a@9Z0) zYJ&`-=+R$%ifLw1KIN1!1H~!qB5e7H^y4A>(JwD+ z;01gu)|{RyU%c&yHVE{OTMrdn0vnu>Hx~Q|!3sqk>^hf=7K1=cusr8IbaE z`tioFnDxYrulwH6?7TCxXf4InUa&gA7tKY!C0r><3rX;!!{26$SwTzLsoFAr2~UIziQo9a7~rb}+VDPyA9wsn1RN z@nrv0L)z*y4^xGDe*0_R*76SY7ody+&S`cJXNH6?xnUEc{D;ov&T$ydiO^ni67)^* z-p?=tDnqBr^iEW3_+M@06hSX1>Y&yUh;Yd;3fH=%27M&RFT7c_=PNCs?8;w!2g|bA zlX~XtXkYR|pi0hLskXmAT8ulC4jJ`|d4wYqgBp@u35MhzZa0N~Ti&hLL#2F7$$7Fc zvogyl$$JTm)IX^lKLj40Zjtq(CsA-SHbARAj^Ps-luo-bDn&oFpmdVwehS}%-2rCm z^bJ4UY!!YBJ_XvaR=kBIGXANT07Rn|_q3(v>_8&(J{#Iw*^m!3--~HRoJxJMG-N6$ z%Z^~L1y3lL#e#cDpf+T0F>%-xNk{^M(xo%?g%NnrUVuV-SR2*4Nl#j&ZuDKiZshq0 zCWh0F$zPC6R_7tpieXY%C_un96rv*`-z%W!`VZmzC$dUO==4%7^0Tk!JM<1){O~JB zHQ-q@jS%2YDm;kS%msJMfz?~5Ev!-ki`?p8Scgi8!8a5a=fRv=l9?SN3t3_E=sh!h zC-ad&lU{jIV{N5#DEm-d1V)}YtJXARoozw$wP`D1O3CUG8&Pw^|HIrnMOX5!>)Wwy zbH=uvj@?N*wr$(CZQD*dwylosq+@*jTiSc=vB$Ue;s5ZhQE$yTs^-BQbzjeQH0UHmcf3sAhP7X_I+O z$9zsys2{6dBFt)5AdikRrt7*&Hf*0LD7;W~XOAHg*XZuk(YZckw;h3ARY0tyf2!*O zK5+2awvUtSXk0hgb6z#b$i?I}=F{1|+hV+AzISc1X=-svjjiEhEYpxB4QM6{R15G< zU#X(f+zr!KW|MS$iYp*fW1mAD#WTY}=oe(?`CQ`eVd}+;+ zV8v^?fG&Ht^`*g5qcJB1zaaMKWSBUDW2Vz~bUh3UC^J{|8O2~)#*&7WI&b^F=(-8M z8a{Td)c+p7ujy6PG!39o4QO`vZa}~p%4m1eBlg2b57XF&xnE45TrCx+`b4^@Nn~@D z_NP`!QIx0xYne1*`{~}wS}N2wK+9#4BT$wr=V*kJL=T&P7`I&D!WOKXbTmqm25~lC ztC~{PN3$<)=b4G3s`2X)gOg;(#sfcOkj5VAo%HtC@R5Y_h)eZUxyzbb&-X z`*#Yg#>Zg(8A)~0xWk%+!BS@V2g^Vneu93EWwL|R z4GrHM16vNZa$bCg2d+cdhue4Lti4F-^lq(j?)8%&$2x_xE0hu?Lm1r9hLmOtVs6b9 zJ8zZ)HRQhg2q~SC4CG@}Eb3A$DAXmVci;?O9v{x)6DI?3iuIq~a0?_t3;Vrfgs6A^jRiD)#zxYM<>rY>7SIW(=wb~OEzS%IJtnP_e~!umgm8g?%q=5pN>b| zH%(K|LxA858;dfN-%}-YHBJ;m(SZ@^K(>q!emkO_FgmrghhY~W)vyuG+=;m}l?9}; zVmJEIz*Td6S@v22!k%Q;jui=dgatg*bZNwRxq@)?BCrmWuX8=1{|0(t+cGJ=P3WPd zF$;{++N^{LwFI_EC)ZtHE(PXVdSBZfq(L(aPIWk|y6k=KqOVIB*1_3QB+fb?DYTMQ zIoW>E{6LUgdsFcB+chFOZ+j{w6Ihu%c)ogsmHxnMWptNgLH$q4fG)vrAysQt9>d?U ziE(OdSgwPs9Kpy^VbslIav`3`sQ%b~-SFln^A=g*jhY7)FxkQLe~u0|NZYl?N!q`& zPUvIWyMdG)@+PG6;|!DovHZ|%poOk_+~k&Y!N2(4YSvCfO=XST95Y}hrB+<_z@Dy` zf{)E*7a6oXGG)M2f8#N-xj#>db^Hx*x}R3DMrm7&8oAZeO(KmHc7}Z=GgSC4I6F!F zloLkVo$?wLiH+-FKL%mZT|fwH1snoxVGOMl!$e^xdP8C_Z9~HC+ure*>-%G|VBZ_K zNqdSzHm1&8!%Kj95%2q54KhXRy+L7w>)81OR5^;q8W|o&RK+2F4BcOYrADBQ^@r>QCed9|~yZBXIb( z05bjQpLl1l-BNR9q_pu_d%TOryVmk7o#5PxT0`7A2dI=|>ZvP=5;UTo1=-E*>7+IF z;V(51zEeZw`)hH!-|yJqMqQT6rXo^S6rCnsjiH$t1lRkVigg774UH0>_k>;Vl_)Ui zFKVzQrMxUiI|Dlo%In8`ccRr~*JwX^zGxaf8=X}R9?eLnA_uEaWP`YN$NQ=>+rKbv z>1lo6zyg%cB~=TrZ$?q#15wDY?nUdEI()dXg6WY`(gHeeeDz)4ryuir7piSosxB(J z_{!74!$>-zsw_Eg&fOPy;?XDc=SL@}kh>9=@RjEUC>uK(nH#GG$}|tUCJ#pQ#zIP>%sa&g$GK^!IIxh*?1v%;a0(x#JpvJ7tu{75GAu*2d(x4c_us zBGx#V%xkKesgS(+-DH?w4&PZ!TPc40IHXH<_kpsKu5lmZmowQeUB=zfyp#|W{V6Q~ z&kN@cN5Q1^ay>pg+l*%vJ;^(ilA?|*wIj9W(3$f*r2c};1xqxX+kXvB@BU&+>ewu9 z^!2mw1wu2~@GUuf$fv4MPh6W8+(V4qjH9L&Hu~`HWs2b?(Z>JB+R$ZEmW?-q^tNCI z1$L~DiFM%9kMWK0(a~772KE4Obi_|gMeGR8A*3NcmS!*xR_@&6*Ke+Rw-{8pW_{5Q zh>)lHWL2RS{m*amlNdJ8)Lt4mNVK+FVry{tr~p3Ot|oL>ul>15(xXgm#__pzomHw4 z&DKaw7E5w_;prp|Ja385+|>IkG?E#%Z@BII+k+r0y_CL**zYyT8H^Kv8)dnj&)T%$ zCN0I>LzUXlN-vkv!2Lk6{NRCI7%CF+%NKMT-2ge`!j#=H4f+boWHxNres=LiFqcG{ zROH&^mtIArYl-EE&m+KVD9cgm5XNUTa0I>$XtC#<2m8H49$vqs<>c)QJl?(4W`*xP zw!dOZUe_Okk71ir+n+S4@R4H+lR0v zVVc0+a#-(hAlYq64rM&R!A=@!%1F}2Ch-t#m63M&Q7dcy*cBgk=gkIhXI6$}g{1bk zyE7b7Y@a-z5Qbn!u{&pvS+I`2qt^TpkfeitZ@bJ-@BqP0D2;gV39^nXSGF$ZBMCFk zsV!L^m>@~9H4xnt6`BV0OeBY`ZfuHKqqP-wnkUJgXq1B_u@@cLyN>?%d#I0A9r~m9 z8D)DY!uHWvw${Y`DOz^~k><&%dJ5}8U*-Ev&PqB}>mr7DJ{b0P5j$V|==B>Zdu#ka z##uYdVcDXWfiKY6TbsYRJRO}JjP%?JKO$u7V1A$9&xe$ zBl`T8uYv1tNy?wlN8vbX%1M?5_0>l5PGGhJ9(D09mcQK}a zQ#t&*IrLA<(VtqQzfHgYQHTCp%h8|ZU*~fDeSrT@GQ{%N>Tl`qzl$FJu5$RJMfk_` zK0p7T!0Es4^#3+R{QoG0!}YiC_19zi*AyJr|3=|({gcA^Pia|owsa!ii2ca*J(ZX~ zJ_Pb!*)PO5z*v!ND0&Jlrx%j9pX8_(Hee8)a{SjkrtXLO`^5CcS;bjJxrUmaUA>xK zL*w1;jJUCiuj|L}-<_5NzTY>rkDELBd%Hi+e{Y=6=;~&AE;LO&p1;0MSZ-{u*k82x zcKP<+wcB?g4*dSjk(%qnzLja|>HX1pUahU8t^1YZI{_)+O}F?MJKFeo{g&T5Ga4`=K9<@9#BlyfSbc@js<~%J!Ym1MA`pv~6mZm2d@? z)x7Dl7rcH5)W6He#qdiQKg13}(w%#2ub6kp;os#dgN0u8Yy#p|*10#Cl6>l73q1gB z-kT4PzlV1hS~qNMBQKgRJqR=NBTu>Xd*;4Tch`oKeOP^}jU3@8Ed-cY*_SWZ8U3bLf-fTuX zh9)ID4>($4tN^Z9axgz-!)Y(n#8#T}^RjH<=3h(fNVq_VgGL-Q?e6v1;7Kr}9%5?d-$y2&O=KPgjn~r~GV|SL7$R zu0N)B8e{GhEG$xV&V?y_XpA)z08=XN^8Vxz*OuYTDNn+NGdUK8$~$~iDxbJs=edJM zPdp0esWmUU!#RO5>pm1`QPk0+Grs)3hb@GESKKH@Hbbj`J8v;uRW4u!*98>zr=B$W zBbjyrVeZ=-D_6Z3A*8g|vmYkQlUB`aplmf*=%7ZCj)J8xJB{blP-Sjc2O6(g+$M{0 zy%HRr9!2@_p{g8TsJ{_ZF}j-9{TYe6=Nj=C>$UVsmQ|m84gHIZcN%3WP%bM^YpIeK zj!BWD+b*^)D_EqH#9WW3GyW44e#q-f&$R4@P4WKc$LgcobAUQIsVNTJC{>Xv z%h+)LrFbo$7W1$X`UII8^<{4k}D;}T`?)=7blS$H8F@d z#qg<-5hs{L{#Kl0c=YB6GFhu$LiHk@OMIO};{Aa;u;&fH6uIFg>JW5PioCRe!-95K z(Dmvb43Y+8SiNqCq6x710Uh^?uJw1cd1#~os*rTt8X0f1wdd+(`6*@Duo@PcI1b%u zZYc*}1O6K3t~)}AWhrL~F*P89VHNWZRH3%Z(G9277id}_Cg{YE zg#F^gWW~0kAnXJnetEiIzj`Q&%ln>@6*SG?kDjS9aK7gf=ea~#_If-2Bn268uNca= z$!^wdxOZiDpjoAb0nP+Be#GKBbk|9@J5!E_QSuIDlgP9_rdl?ZH1Uo-mM**$?Hjvz z`?2~BD#AGK(mtXc_ip@sr@>Uz8Qqq#)Yr!qS0{0a14Cr1o%5sC+4Fuc>_QPK185voUujt(m zkFLz7JyVR@e(u=0blnHRM_rzRLCCExHG7VE(6eqvI)kRvd}ih(G4}y8Mc`q>v?Xak zi)WSI4TYzyQ}7|l#k!Y?AWZ|~T7o$#>ZuyZAip{t;+w1!YbMo=pnhBk)kV%tedvcC zr+v)c=vqAS4UMo$s;6R{S7%#XNOtU0UQ}Nhk$6)75c(M8?CWm}5GTe_D_gF0qV&+Z zm6@QfFla2(ErzDZUme_A+)2>R6HC}CgdZX7hbb&sVi{F+p=s72@_j^m5NbV|k!@`` zP*r&rSqS5mLD})!WMUJhf2;GuRz+#o=e`-D+dPb#ci7_42Y2BEk_H9^MVr4QQGH^) zc}7nk20n~H^glNLRF5$PiF914xABw!i%jsvx$-KT(b9-0sj;pvWL;`dX_TgT73?0_ z`_r3fnAqbXb5uN{OTgd<3yB*^2;ZZxDubsWkN@b$1crbUP3BgVPBtay z!Mls4o>~ts#8QNeHPG6+3X1Q_B`3HLqG8 z5HgIFct-N*3))CG=uCH>0`nZD7OCI^VAN}F6LPsRdh*Xe$U7c82m=Wr?+Ft^wE)l3 zQ)bKkbls^d4_IzRIlWoz2wn4y3Zk);?l>`-;WAOxDG&6YtXpr_cfzga9q3bdV5Cuu z`Ni|^IE?RnW7)zmgs^3&)ERyxINHv4wvstgOA~wsj4$UW8cUn@7zx{N1 zh|fs3OV^*toi4K*MCfMFj!iT@=^il_rYgDUFoZPQws0eLl+*uo-MDVrDfXcZm!W!| zPu6J7vB>BpT~>a}YpPobhrXRmAT}SZ)KZ;fkVMLCtsZ1e&DSgiTMb-0Z!m%{!Bd5@ zaGm#Pr8c$q%`a=PwwUL3K@6ME)5JG=dR}3c-ecl10zQE@JuGZ9;iM<* zu0Fu#Mmt&+W@3$yMrHPB)p$`(+UP&92p)DFpV}R9cBeeR@ZHgHfWKE&6uCMNN=dxh zOrS{(IMMrL4oX}MF7fwNU=m>~T*llJKW8j~!m=X|!;^l>qfeI$&D4i_H~_Y(`X{Fh z9l0Jji}8zyrgb`?-xh)RTgnlvdFEGyMkH|A${d{?=(iU4A+pLF^IsUqLuuikwr6{zq(W#`^xZFf@8dX|f>Fg$0wYd;C z9Esq=>o--qwF>Ei9C`Pco+Dz%(ysZ)GeoklDgtoMa*?&wf&{6-)SdG*#P^;BChUb4 zJnivwakhKBkODxpe!jg#aaySgd{{P|AiY)bp}F^DPA)5$3Ar@hTH{(8w8eIv+hW@5Mo z6$#W2U^Kwe8(KR_4+t9 zy#Y07!SAu1hbNzH*+40&sN?~U-aPz7n{0&N(wKd));_%Y?6+JpVyO0ev!XOk%d+Tp zn^zRdPcm9%8k`b2D-@$B(!;;1POV~Q_RybruR{bGj>)Tg4~kCdc$}$Q)Q_Pr z5QPxCHhB_Egn!kB0+CF07#)r2vCyu7+RB3;^_;Gn?5ge6l(2k!ZFYpLX9RRW=12wr z2&Yoeie+#0)TrjcZYfp!>O}>Puo0rg@O~gnPau#$__j^1L7NlK(X+K{h{CVQ!uSad zsJPJGq5NK$!M|Wr3cjnBe1y=-#me^Hyv({#i6?8R=?18qvu#fs9-?<7F5Iw?XBWSg z)GW#V=6~3)KWeX#@BTK0i3rug8v2SvO>;iLS8+Jj7QEFF$-SaTRCPo3??L zG%i*;j;A!HK41Vf(^jX-B-VF&qk*@R!|@R*!GoCEtT;)ZW>B(`Gz!tlyj(EYCVJa z8(Mc8_f3JSme4v#&E11ppc4WC$&w-c zwg|m*0hNCwoTlmj?Um^%9E3rHX+y0hY)VOF(t+N|l%0LOgSj<%{|K~mhzEQ5VjvWC zj~{I>MJ|v}v=pbLxOZdW*H*5JK?W2`N*tARNmVja&~`i*%VmL>_$O$8L4{((46H%I}J#HE`Q_{KW-~W zJh*3(cb`5v+u9`+UL-CCf-hnyi9w^pL!1&UVR>z8cwq$g6@soa=Si?14A>%8V;`lV z=zLiuwy|g>42UsifvJ>TDJt&x3=Fl6q&kLqq#Ib5m5y*CNO+6`u5i7DZ8sJ4{K*kN zS4S7mmYM%7+tYd_*cNc}DNIBDJSf!kW|nG+{2#~@<-)WE%}9<$#H~3P(mRjws<@~R zST-#QD!D{!y1649YsIm|wiM~*hIk~xxq+%%CJSPGLCJC1OHw{6xY4ux+oMbnn*+5T z1#bDe_4zRhJryq_dRkX372;W5LPTM!A01L-Q2Q61v2sk{7M)U-X3%q^(aHGAVnAg)~`$ z#6E)&TYI5?(q8ltPD&$HIc&yMZ>vPEVx#1TpK%hop(K-`B9S%b#0s{+NI7o5kw<`h zjbV4oXm8HsXd;PDPE(XWG1AfNuCQG?A0dHtXR1`ZpSad{E741`ZVy~gSxpc*VHb+h zWCJTh(hf-&$o=hJ<{g!Q*@J}}SlF0u-u(8Yc@VT?e~fX3^Cm7)8H^0WyoC*bYM4CX z*ocr;+o_LBD~ZY7nWj~5UK=6(xC#fEM1;MUeW27AQr1Elf)V;VY)$*bMM8f8&R{Kjk{8 z?RWQpAb3qj-h;axr(6l-(K`G+>aJXp?n1%bi@8L>0Y@7^YR)yvcNPokw^_Xk!)aor zn9r0;=ipoRAda{d;zsvq*rKLb05|FVxY_D`BnF?E_$$`b0a9a9OC?7w<{r*cH2|!* zq_-({6`FV>+}Ln)G(J?equqK^KZVJ3Muv1Z>FM5z^@6cr)Oj2m{&+!A!2r2Npn~7J zvF0c&9CS3eCM^UH7)8;5|n4^FtooLV^U`53y0eOm7x$tlvmaLk*;AMlhkFXjt~f=&RwQOg{Y zXM_*$N^sIm5HTghugw9{+u=--)A?G%!Zg;aV?XgjPF>SIsbP-K>Kijk+=s?;xKPk9dvQb#0y{lrSz6QhN6R2MuJbe;;8cf01>Hrjb zDUXB2OEu0vfNkMFld^3tv>z`tnRI$9*n)yh9Zu&}Qsi9caq8;NxL6z@w&VKYRAT0P z{42M(@9BPnPiP?c-UnsvWwiV881i@ali-F}T7O+{h>5w%FHR_7w;6@KrMk-VFRZX( zZOnqQsO;%CD=l!QRJOKZ8$CIAtIo2!2x^?zN&E;Pj^4_j*3$GHSfv*U?r%gY!dPec zaFK-?#7jz~hDh$JSZdL&8x7#sY!AyGa9e{^aWy$uzPMBk!<#rGAY4n0cZy{3a&wd- zO4i2Ku@U?nQT9i%hq8#9#R$k@t&d0dX}R6uzY6#W{8@<8mryyE9z01~&vV&U`rcRw z%W3<^3qSWwm_^9BaMm>8;pQp6@OUJnP@+sD*&kudJSMAE&(%ry5DvsAXPyE=$J%v+ zhRW!HMf`LpeAq8T_ZtCy@%bo`bcU6?ZrzB3D zr`}qu0Bb24Z@f4>nw<#Sa}zh0ITh-ecRH?`2_oyk8UFOMK;ks<_%P0Dn`Vc)@|85B}kN`rt6G&rc8 z_MydL5H$t>49j~ogDA;D!U@zc9XwfxJsZ-vUhkjn5Y=X+afGj3d+lS zlhK{&2Pr^EGW_@;tL$s`FJ^cv3ODU|hb_3U?FTI1X2xf`k)*-{ zsCaaw1NL(iNf-(d(drQOh>o@VGehdO(?&o)n7k_qc-P3I91c#{3ENKei?k$*AyW2WDap}Ik*<^g4i21+U5RMKB)!SNT%kiB z@FenFO`$XTDu8lw{d5o=EqRgcjBfl}+#L>WiDOM*eizE*q6Vhm_2P^NEdMEAaG5{U zm*W~+jbyg6xJw@&w8soiM>+5Sk^LFh<=mKDUtR=6#^htR{^4?Ydy%%WVAcLROr^qu zt%thMi_RV}B6~V%R5fCOUtA^B3W?SycLC8JjlnCFeZw_<(hF7r zju9!^jAJQwzTp~GXW#Sxfqd6ck9Co?keyI=q0t&x*fqU(5kGZd-z^?`SuG8 zRt`IzO<51YQ5^-kT|bg~=?5LB8Y3njixeuKcxOi<#mZBha6lk7z3%)N={SCRjA&T| zK@iYw$NY^l#GYTN?1D7()CnTXb;krL`5wGEpq2a}=hmI1R{oBt@6dEEBrrC?GiW?h z$Yp8dA`dT=fqz?2JQB5@#lIjvgN<=yfb?5 zqL{!9nT5prHV6ri)$a^gOee=?CJt>KW){M|&!w>8EGo287)B}%T86e_vRS;qP8=uo zO#H}3(u5l5P138C;xmh;-cDMrLx}Bx_Ks=7SL2f@9AwLW2On&Pc|WtvQ~<*2wupPd zh!dMQ9|yHHii{*JjyWjE!X*l&=gIQ(JGeMWppa4|cZamvH0It)>M$e2A%q~aH z7yBS?N4NJbz-{K;2*s5UDF?UjW(yZnxV)Qv4P7X_g*rOKrzFzgw|mK}gV9zzoh@*= z00OAUGqH|)kbG*oPrb!lR>w`ORh?X-ul{EwfzC~%9`n`}I8cX)>q&?>Lq7nop5RKW z;@T%fX=C!2gpD!x=bl+7P9u3_-KHe8(Dpl%O9FclEjd(q4!pFe?03{WBVAhAOZa)% zKfhZe7*QW%^8~G1>hLJpU!QH?Bzl#jP+HJ(H~3+OghFN0H?XD1^UGPD~;8hE0X;1zsGNcG? zkFjr`Zga{}I^PlGTjmxItq|q%r#Tn`FjgTM5A}zeAy|suB;vhKh}1}+Y{B45FE~(* z)RM@)36?BOz-}eFfV>zfrW6gf*I0k@i=RSTPl|@}Diw*Pck9y@fJIZo4jNNoQ|%Ks6BfQ@*lExuz}h0|D1 z7!#G>#M~}Xv@7-mD9`NSCyo`)PJ5f|rY()ljJHZK`SYetVOxU+LVX&|EtGmKZSc`9 z9OJ6%b8wlt-iiZr>ClfYR8zjiU~#%r1AQ%Y(`tj!sh$N(aQ||Og#g)vkZNFEM}R)F zn+F{hgq||}J7+HXDR#ig%wnEw54q03uIEl7oAjO-;xPLZ?LJ`lv3y(VV8}ZERCc;l zm2>pDdQ&tXaHqp2l~Zb`o^6V#`1@UWrx+ju(M5#`URUfrZx9$RJ5el-{@rt$LNoKy%=YMH2l zk|0`+j(gR}!I6Rfv$|anfmaitvC?t@$tCBAq2&HvXSR$IM2JV6AFSrAdD|jWA(Hw~ zk6mP%!V@=NNyhswH3CZW=92YBU#6N;BvqBS%Ev`+I6|5YM|eVwBIQ`%GX0BFL?U<7 zx?hC*_sJT6K@a}}KlvLe@E1|Q$;83&FDT+~7Mp+KApb}FpXpZpuB!t~$R zlt1*zpXHyThJWg}|0k-#{MS~lzsv3Z8h2(;lQ*z1HgqETs~_c0$-^H#Jl8+eW&b`5 z{kMbvyfZS!Hl|Kyf6n|zbIAW|lB9nb$^Q#a`IookzxDWX{jfCGI;p4G(;KIW((##zm zIy8H~?rhek$u-S zJeC*8t$4MXcJ<}{+I2G5$r4~XmTrFk*n7`C?);S_&?)_s*`#XSg+MrrBG|3x9Tutc z{;(1A_|dD~)Becw<8=sj+v6qsW1PWy`(9Fesk!_z_kOFj6x^0;_pTdzq@t2b?E#Q# z>o&5L`|{Cgi+`t?N8!@}v<{ptyOdEc4dnge48;mjR6b&HaR%P_U2y;KSt{;_RJJc~ zPVevI*n)K@=cT4X`?535;o!v7)LI=ChTa$EL09=z%AM^S>FhO70$x3qP)0-6w8L*~ z{hX}UYzWk*K#JvUo4$2|H4-XY%3G_lyZ3T(GpV+^SxBW%)YaEjaKNZ*9beO*`_bsF z;vbQO)eV2GfSIMhFKj%&$tt>x_)|^u1i{(hw#AA^zvNp)>Fz;)si=aaJ&AiD#)X7)r=*{ z=|>0Z_yAEDH|qPV9Yn&*nVcjV#IHo(rOhAR&09?6ke0zk40E-`c-J`Jmke8x07R5| zxmR041fS%QrYln_-SY=f7l$EOn!NGzaLt|2kpdiQonX*O)8K;_b0iB((8zm(h*y0U z)%;@x?8FcEyhPBywb-_97k^dCP_5wGJvDZvrI(az)N?}b2xuhmbI&>G5pHQJzvVlH zbeLEHUL^>B{-jZW4YVY9#qgIRsxoqZj`-Q~>T=zqNK$Tfk&YcrpRuin0to{A#(v$~ z^`*$*cuje8dMsi*EoQ|R^{H7Om%@B^Pu8L_S!Qr|lSHP&(z>+B`dqXc&Y+&Vh!WZ~ z(57JJ2oYL(9}@%VPO;V^yX3l;^dx$lpF<#veT%dj6IIkS0MxK2Xc&s_dAkf#BuvL- zJ=pDhZz-W8F37s*jMLm*aZ@{~-q}*QUNfKsn63!*+MGCb$L*6+!;LhABB{tvY@>mA zy~AIxi;XB03~9G`^T^M}#G5gVhD_RM1qbnl*Axq1H++W9{C!cOGYF2YR1rPs_2l?N z78$p^d|1^bYw-&jR0ywe725k!;2D!#q}rw|BP2{!_r!dkq`B9G1be|%g=G=i%R4Vs zrX{4sV#I{IXREvkr>%6T>L@xYZK>u@vbkq&*mUQA&TD|e`|)(ZsXe<;soz*66)2=t zxG0L3N5S;5|FQ7Vi5d0_Tp%evtOQr(_B#<100cVZm3B|`tB+V5! zYN;!aYmw-~K)-h|Goeq`<|yZyi;IE=2OlFjzkKMq6o8R0>R4)@!=`E`(VwODxfOz( zkl}3U&CUA}7n+0EYDgDN^{L)97tgBvW`R!4U)1|E?$C z>E`wkrrwUvx@aABq6PCnG3dY%XbsqByhImXoGOieak>)TVG1b+8-4K{%oXTO0BbV$ ztL=TO@%Y#c-QP8Q#@?N=gYQj!Ov}(uWyF(Kn*m&mfqp$df4+^Zw3Qy$m)I!2qcP=f z_Y5~}BeaoGS#Z1MfV^M65&FD8KR~ef@Yul^+&cvm$=lYuw+3dHT98D^?7#2sJBDrI z$e?2z;9PlLoD*!N88y>!S@9L*#FRV}X{`=FV#AiGHLTZABWAP- zR?r7;KC7swH;sKDX+QAs2nQj*RE#src=XAM#Bwqi-S&%1-C*>77?&*R`^QIUDM### zzia_#%N9Dq=f`*Nn+hglrQHJG*~9{@`^t7?S{<0372Ai+87BAXN-d$M{ZNiy$O4yZ z&W8s?QrZVUxY|`JUts!5JHVI%Vd81?g%Roldn_Lmt$s~{S-xQh=5UuI(TP?IuHoJp zot>D;!PL>HTV*hl>17hUIR(eq{u1DY)t2JDH=4}=bj&!WwH%Q_0Kk7(FTlfaW$|>` zEqrRchG9y9c-_-pn@~Ol=;VfYJ{*B}aj>iRjgZYbE1FT(w5TSW=3ytyY$Gu_8)`>? z2yc?%7aG5$n)(N$nOGz!{KDH5uYw?@7%_1nh^puox2X=hgvp{eF4~SC6NQJT>H37x z+;fp zir~%+`D7*vBD9A_U!I6id6Ajo~0dW zwR_GFoRI5{;$b~m-Y0>12Vg3=iD-t=(t|*7m+OUZKugUrss6@BM+NEYG<7Z}Ikd!( z@i&d9r@lq?oj(C1)3(FqXC`~454cSpo?n95jDa>Hx_xk$YdGk{4`PevM z+|&5ww1qyW;V~g5KSTm{f!!n@912GkwgXtUJclCVtFeuUD%*!GR?evHx~3KvqV=qZ z?WK%vFdfuAe71-}h=oQjC=rF=$g4)kIiaK^xLeXWg3`hpY- z3rIL?;J%{{duqYIe}syB&^)Gh1!E;eMN*~;zf>7{c1A~ z%PRn>ryd{(XiEF}^LcvUEKA9|um<}SRwAo0#~c+uOx+oz>J|JM{?<_WY&1t^rPg8B z{y}T2LR?3`6Pac`s#D}zLvhWAV_1Tkqf+RR@@2XU_sGt)*h&(T@mg3_`d9cB0cx;k zwQ|X~e!XoEk(EM6Bwh=t>WS`@3N&FPAaTBGCb}g7drO)@{PuB;ZZLr*HI~*U;KG32 zwKC+{Xy7{it|olIyJQ@#sgFGbAW78Z{1(ICxmxZRiSQN{SG^cw+C9oTmhM+(e8dbd zapinhF<;3dg|Oxk@ggv zSsdsn6rjbHVkWamKjPBwoj_0|T}xnSaQm!ArG;yC$54|z7EDLrHubsGAvbjy_Wr=# zUyW<2{phtKhHe`xGaFUQ2!s+&8D60!hH_1d{BAVXBM=-G)N?BL4a_nnaX(@b$e%8k4b(naN12f|$ zv*?Xc0`6I0{rqgy`*Fo2DfXgBftn9ivGM72_w%D^t-$${U-pl%m1P`=l+vjKxD^d5 z)3G%X2qdl#NyW%?<;}1z($cP;^zweuTe)>msCQC#>`BNlY%hkVnfiyQs}nF=D>JzS zed7eF>zSpVIgOyPG!I`jVnP5SxJn#a2nl8?v@YedZoq4`OG{@8 zrSl_;`L;}U>%i_b6OoqGkoetszC+y}TJR9>Ib>xH6DctMj3OAxh^zKu6;0X6sIJH6 z)R+DQA_0Wa)IeHlhskMag-L5R9`=@+juuUJ=e$6LGmoOlh(_BN;i{Rg=CXNRV=pWm8qw^%GgO4Oe^9pI~SM|8k^OZXV ztCK0VtfB_32|~VGxiS?x!1ly!!d57F=$w_*5eA~41>KDXGK$HjMtUQXJm_r+Qsfmv zDigw_fk+-A$`G_qOK`3_Vt!=J>0oI};cJ|wATDba*4z9Tb()lG=!Se3zBtTsGg$ zgq;;(`+YyYQK;_%U2(K3AA1&*ovwpnk>vX>6=F&k4Yknl){1oW++l#YIJvCf01|=GuNnN_QX{T3JdWj+nZplUUlIk);b0Js@>_`QD$I!yHpTO1#^?4 z_SBw*fYmur>Ys}bCr?s)$vN1x>XpgyzYlh;Q>~g8kegdg9E>>1$kbDWqDfPv1uG>T zsS?xgNiwtQ6A|qC4tRmd@~z>`*Fbi|G9n$&8bNSZz6)lI&axx95+6@jek(IJLT~}x ztOKnMhr92~U&uhC)4`5aQ#Cm0(e)+_=Ngrix~72n)p>^47QQIMkI7i+As3MW6OhLh zs^fr5Z;}8Tp6O+DYDw~1M$B7Ddjk1)?eJxtl%G~Ln3U8HShHqgB*h^0*2m1J8!hqa zBq(--ymp#H9WK~KR@;c|Mt$O&kk^o9y-J@C_tvF-W_}P zBc#D;OD@nw7j}$!w(6AxIXQBGe|8TkHLxc7`VX}CF)7WZ8)q^{H{i;sVT9&h!BQtO zhy9S2$uvrdFk>`CgC$L0Ee{F5&0wYN1ZkGwLtq*xiGgdx<%sY)c#*A#Y(K$)FP)6< zK!g^P%(9kiVG1=8QxBAyl8K;xb@Q{|&RAZ&v6S@cZ@qp~!vR8@OsQuPbxm{s0Lmk$ zdx_>tTSrtD3mD0^7U#VB^rG`C2_F936NbOO^7^gZvICf0y7&4b`Qga|_d40YPB>y} zn6S^DU7Z>qVe)Qo8<(9$uiu|ZtKq_DiNb)>FqJ}?`jZ*wsx+V>JxVMV4g-+aO_A15 zyuA0d_-55@P%%r}6KL^E2#JFfOaNP=2>GpgzZD^0-&2UjP)atn;xMt?{NrT_-d zz#-=o9!oQw)rr+?OKD-PD4M5b_<`rE7O^;QQ6`+#bPlQ@>GH%xjIy&C&z^y~BTziW zq;!Dn%dJoc4JJOzYGt5qv#l9x2eY#s3iXixn@LH2etS>Hi-DlcnBB2Rj_N!6~WXHMw*eC_S5hl zGfCJilB&z58IG>Vf1_78iMKGj4;{=!>~&#s4lMLOPK#K={Y`nhlVh>h6wNSyjXhKZ zC7<`_L`T`RF-0K}d}MSXX9A^2Ygbr!qq6>5ric(mQ;LEaVN?=Lm~}QATlpFY6Q`N7 zkV9yZn+>lkXk~-^c(sXj%UWS+3J-$CID~zHcb;I<3dm_SvMHYE^oGh|9sx)0QLBWV zHS7iKRuU>f7EBn6+BUoi)JlWN6rW~f1w@j_Mb1^EkmUKqurZS)Xwvlj7`PBuk=imI zg;cxZ9jGL%xrg3yb^yY+qRBbpaqSU2YnTd0z6p3S>Up`$z-eJP-j{8t6Fj%J94>x3 z9*hs{U3ucyosjf{gnIZYkn`;U9L?g``ZC5l1;n3v>LL@S?Z^orahQXdd%@bmDH&pH zL6i?)6i?%VQVa<~d9kNyOQYICsKz@$#sWvDO=6iYLny`v^r#Xz;;>xs31RrH1umgE zK-yQ}Gdo#8PHr}`2RaZ13X&J*^V5>7w$bf4qmoK%L%>%CH6ZClC(5!)%Zf)}p*=}2 zPa!WA?IV?7c#p#6hq%Xw`M<<$4OlI$XNA(I24K6AG$7f8+>=`-R2w`91@>)}+5r!V z`9dWIN-&D-;}bA2(r%oTzQcWmW$E4Znu`YAP*_SAn-F;5{d0RT7Hi~Ts5LU22mJIn zNs(P4$bgZDRA%u@0k=;b#%)8 zCygFkmWP$Sp$5fUDnzJX_^D@q`bTk}7JaaxHUYdcZS)~ZCX@wT3pO{wT=ub-e=K{J z3Ry{j=-Ep}R~o1&QKtJn9I}l6n#7N*Xh2N|(KvBsF-rFG2VmUF?Oa(CWX&8O!!Hd; zlD8`D*sxA+29u+{UBW33Ta|5LZ-hL((Y}XT5ZS$BsIPVCg{5lEO-0_=(0!x-R~<1CF0^nClFAXy#53 zzgJEQ^Ls0{f`dqapGq}CM|4Ai4bg*ZwGdEZ)EKmvaif_^<{TSL`bAu!J$1jhG1D|peskTks(N+KT9JCWPdOH@DbN%c8x#vD z$pwY9wB}fLxDE|A-A_H5J#;$itd-nzyB+8iI!~WN$+$2T7$n?GZ{`Rn;omgcNeSW# zPNlcS?)P^Twc&|SlP0bV8`l>0XD9}nCR#yzd@+F2bxr?;|_-O3I6Ns{D)gUN##D`_U4gLitSC|s*QH;JJA==2-MGwhAx^NQhyDbL9 zI13?V48ahhY-{hI3;8Ho2+CO8m;}7Ad))zk_S*i8kqP4Knzqm%8ihznQ;a7D&MnfW zAa4m4Wks!#ha853H)80N-WM6_>9`9Q@&sDOZwWQvqiMXQ>OIs?$(jl%<4dzwP4hO% zxxD`iE^*1;IND(MdmdxqcStd>5rekzu$Hbpvo z!rnZLtXnN6-Fn~C;aS>?NDdO^ESzIqYKX%xp;+&>GzeqxOohJf03Js}UtICRG;E3S zbe8dUWlJ?h&#|;amudy0e%WTIvOab^uZYm6SMTjT^*&6kk`!u?LW)#}&=?9{1%Fq2 zL^JQwOWdDtvJ0T%j)cf3UEQ&Ty?tUDIxy6U(F|8fH+^)G0FdP0-CG!q7<$4o^<2@9bh4c z=M^pHCoK_~g5W{pCDRR&8B8_t=4H6(1I4#QBR8XEvx2Ec4qJMR&)%^HX5)qJ^Dtvk z@DSTVgl2SajAxZ!fcA3YMWZ4pxVmC~5~ji@Cj@QoR=I>I!l05(n!{Ci%dQ)D0htqy zg4RPE%pWeXVvyq6(&(Coji#wZ4gP9mBvexz3(+wumb}HFS9LzzHOvgJD<&Y)&;&|0 zMId#JZJ^{7EL>ug*WfY}lNSS{e7=tX!@tu08$Z)3$Rm|**q~q!VoJ4ueq%_N0AIRJ z`8pIoAfIC#@PwA&66?-8IZAe8ntzS>cPH=NK@64r(>kCqV$-DriP_l~FGsd(%yX~I zKqkVKJBU-6;Jrlq5r30*un?!%BqT(w@O0M*nlLNAnIlUcO~1b~S(1JZ##ogZvlwH# zG_;Y4^Ys@YH@l^sxlKPfA>4ylm)N{E@Z=9I@@|g{3{*I3jGa^il5AHbcT2NpvcPVU zN^yX|E;NOnU{&3k_+@pLf|Y1#Z0<_|X=_|i<*DhnJF?3Dzo#8P@lTp7w%<@NWd29=p-Uyq^nF~ zAJvnK`8<*(b{Zv76{FH{C+{F#K`+i%hr==Wh3AMEap&B1+#9$gm%5(e%7-wCnPo)W z0Z{6s)K`4E9p=i%6rc)(%#&>#NCVeYt!;i*#3&uBuQ9}Z?JazbGRk4;4sG;@G#g2| zAzzI_1b6ODhPsoaGjSHYFhlsNhwyxP!(F<$&` z*6$GbKO6AFjNvF!QmTzAq_h@(a|C{!7uXNS(P)B=qn!v${7AOouF$r(Dx_qBQxOy3 zdF1{#iLtMTW8KmIU}mnv3)gqHPY&;C)yQ#r6x-7z`OK)b}o4$mR)$6zPc5Dmt z*2L7;1JraW*#Ow-1;6|}-gnvLqEv2}^8hC9yA%p9*xL`wT~SEM%sN8wxvUG?i35_^ z)F@K5HA+S0+h7K$o@V65s7yL|8C zgz}#W*7nW?=!;l-lOmbRGq%bS*T>IB9m{^UxpJwoTVMS8ZHk|zP7p~QwA^y!q>!*# z(=>!%#vr8V>AsUi)iF9LWdZn@zIBMUo&4)4gB%+}Y=xS0fHMy{$MCe^N6dFJS6lpV z^z|x+{I*l#_-|N8QCV_7jn)kl@0e~8qgBUnaUDQ6(zZil=S8$*gmaNNU^jA!wxTT& z1jvG72XxDHoWXUhBSqiCJl77PCmrDg=DgK?-BP;k%LZfXx~mxPSZ;g6!xBS)4r}>3 zWR)vo06wL_M~&h47^A)&6j6bs;erF`EaLn+Elr3*Dx58TBp>vdm=M{6!19a`x^xZU zp&SFgSVUloL%XfUOrZA5Ut)RWo(5tT2Fm960%HY8)}N#L4hB{3qR|NF?~U-3(l2yU z@TY@+U}lG@lf(=9DBU~7yX?0%WfSHtQ7h`c@yAt2$NmRJ#J|Dme-L*zHg<;pR7CtQ zWg-8Uiim%95&xGW;-Bpz|7S(SfA$6cgPZ?a;C~a`@n7j2 z|IkDHzg0jG{I3cKsDCIR{;yUY>tZK>SYu zBmb;9|G!W`IFYoujP9N)NvnJ^R14SGKJln{*rRk1r70)alzzrf1Gf~CP;Kc%Ou8h} zXU!(=0?wJ|W1H)Xud7&D(&loor~PyQJzl=ao$Af9{NQ4_;F-DjcJlo^e|~??ww-oX zUY4%>aP0Q*u*tBz{9gEZczB$;efC*)Io)(CoBd%>e(vDd{kHEZe?Rg5VE&=&eLb#` z*YXwNwR-Eg-muJ8MLPX^7i0u7$@ii6+ri0J4*icO@bu*EbKdSw_U7ZU>d#l&`zhaU z_RpjDhu8-pD2>~*e2gW|by=?ME^VGAMx7+at+JZT^_raq-}&O;J6mQ)9e3#u5<{nW zUz+HuoC@$VyBPw@>9^b8u<=hjoFC?5Bi^yGv&$=RmTBz@hm#Ui_TmE|pcU9v$bM~O--}$xEwnl*c3X| z;M_tpP8C35weN|$#)S9o5Gm$%3CVHORPZo1U9;6cY0AFBnR zAYAY)jG_xbz=t#61|lG6P*fulLF6uy+>`H0gEC~FE;wvkSxV2U{6VVeA`4!jhY_t@v)0xc+P%P?Th(?o$W zf*`&*ATHM9B!6tS)hz8#nn+(D{U)>QtL*DN>(HzQc0IU`@alhqh6$Af4Nb!$Uh9(&>`?vH7>h+zKsbe9yup37IJLc&CFO7s9TAI~6843v(u^coJ~5Z?oOp<1JRh(3Wk;Zr zvXVc;H!$qmrqxBmnn_N;=_^`_pSeD-2db|@k|7ebV(pC0O-#P*%@G+jHaQ?|tO>Ni zBElh%>=fD;RR^X^AhP`R1($g$U}jmrH(V@71N~B(F^7rP4eVs_EC+k2 zp>yCI!yT!>`lyZjdEYUe4;r36HOx|(R&V*@SBKGPu8lL|NRQ5ur;InU_AkC$ZCQ+3 z-FO;#NP1CP22Lni^A650?)oW%e`p*6`? z2wa%Eiol3Ia)!>uJRR?XHNjo(H{6}!r&W4eh`sQ!L;^Fl>;nF<=2D5lQX=j|I>u&m zX?344uf|1ikgC93{5|)9IagNrUCeA6HKW00PL4$>v=Aj5k1XzBpJI?$U1^D(c!Zm@ zPz+5_(pM=iKUV%{sT$~Zj|$(TtCjFKT6o-E+CUaD$qYWmkYVRL+*iD(qHTKIv~rC0}vDTSOf% zWVhWxQ(XYq<(I9e{Fc(jXE(n7@B){h>p#k9r+884W(S7qvAW-$PMpDBS3MVA68gv> z@_mAP%83WRikovRIphQPyeyM9^W-qKms=c!)QChzga(w9nJ|3oJe~1Qfj0|V1P3f0 z;M0-P+51L9=lCc*`yc}q;pq}NKN2}f$)FXpL~(5IkTOO+`t?1PuJtIqhE~xMfjYqIP*#9Af2C8(;lc{j2Uz! z4tPmIh!89-G9)>Ilg|jl0vwCt%qI<07%70SRkYfY={6rV12Q=CyKCi}2F{iHv>B?Y zs!c7J$^|T6LG;!=ThA%ONMCIr+n?rDn;V?R+%lKgYi+yGIa=*g zTwEy{VzH7ar5_~EFp1cnla+}j=MGjwWrbLhRi^6A_mlF)>k?2hkbE7%Z2R^Xj2%%W zYg)5NrAZ)OQT4f1f$WQ3tpoX2eql!_uay?nw-Gc9Hr6(=mb(CKvnJ$$($smF z?!#1PD3_S_4JWSO`HYigGPk^Ji6xuOpR)o}FO8`bVRX^pShxK2FZxDQQ7Z1*Mk6nU zY`$zhQC?U^B3hOaoi-v~HZN(q`o`DosjxB2V@KQsOl%eN<;5drVUbFFrTV*|7?w}| zGRhTY9kW&;HK}=|WK_%n&LIJvIaU%*@ks1Z%O<6OGR}>Rx?Np2`Q|q=&Qm23lY-5aFM#0=K z^kcnNV@ZaoqYmV?esewH+|0BhLJoMDnHV+=XM?q%X>CSYZ&sr-!pf=C>1r*sN1i`E z$41B9{DTc+t1P7@q{ehFm*9LXFA}NjPl;S zjLCWCkHMmpXYWc5EwP86ZCM3S_KJ`Vz%OiFtv?=Pi$*k;-GDc6GD0iV79V2TL!~gb z#AoN{fa%lW^+woIu!<3)A{5UnmSm(h8lvx#64wYNqgyL$zNP#(XJVD_XYsBG!R?OZ zIFzKOloCZa<2ZZZrhQek+)(ew;S*<#X-rO1OT*;Am#nGs)y5PX@5Ov>>KKznih0%t zzahm(y#1E9h4}ttgrj5`ds<4l0t-~v+62kLPu%FFab7&Y+RQc-g&g7zkOx&0_dgpm zx*=;%JNz)lXXm#Wc2azG9iOT=2LGwm5v)E~L#z0nd89-XZM*rR74{CSRz?W1XB`5OExD!ssTgtWjC?`)P${3fmk2hf&C7IX`xqR3wG!q7 zwof2=@$!*gOrdHZrfJF@KTHDodwRb+T*U48oK#im;{ zd+??YYOcof0Sk?Z%*uVoEHyElO4_C6#Dz<7e)A<|UtB`XAbT}O7o9mYZls*x6Jiz)U0QkJT2YU zgWBCDxOV^P{Byr}NViO-ufcUr;hsli^O3FAsSx%q*8hRBUiN{H&&#`e>k2I8o=R9u zLQlET>s9M!z+$1@NIPTL{L8_*LY z)^uj$Dz8_FkY!UcLo!i&@3NDA>T6WVBX$NUL8{@Eiz#Gj3B+c{Vv2w5v?5X*%DP&{ z-vBwvfx5;?V2BHnX(E>n&ba89%=1 z@`9=iErel`i6*sb$uSaqF2yA&rAK9XjADtRCe&Q>(Ddv`w7?vNIoCRvj_21-r>rtJ z_k-JTv_;Y5)8i2iHi?Ws=AepplpgC(*4}~6?%XE4-F^ww6EPF9OO^)CW?trxs4H%^ zB8AdZZqCG7p`eZoh&t8uB5BSxWGfe!Tbqh7 zSK`m0(nK4_nD6Hcqrv2je&R<-!?r9#VXKRSTafnibqXEBCS$TwRa7PqH!CY}&g&Qm zQA7t4tv#lu)dn(<%L$Wr1-bGkV1u?f)0L)@>C3aqKFYkEUjT5NEEiIcm_c48L-UOp zUtj+OOWw@F7yZAVxWhw+{N8%5ZR8FV5e!kBS+TFg|S-4i}#9ILTkxjM~Q z@T}_8QSF)T$0SrI_L25IXO3#+%t>0aU_e%RTYMl|miiLHn#tMGW@i{^3w{D?6shlv zF{R3fJk*c4CeGjNTy8G$W?5+?reAdC4=nJ$)neSSMH2VoPV`U~pVl~Ps-AZolI+lu zNUJqV*2|2h-DtN;_$5o{UWP%v)onU9{=kJS92c7*-`Rg{*~>om12&^MMER0xh2?mI z+{#J231h634r_;2z$5A-vxhT8%7C|qUQS+LeS)teopjmCT!&8!!sab-XUV`Y?Y?4B zd_IWGzj-jwg35T#h0GU%`;8uM!RIO%t)RfY>2ve997(&)+bHA^I?~w)%+SQA_SxlHKw!O`__uV7Q_sTbQvTlaauc?xC z3hvimT^h~shQcr(jNf5(dFU^8bXE)iL!j69*(vO89jqG4M|j9yS7IbGn%}Rlj5Mso zCMkEru`IqhMhM}$@YpVplGvuwPs9t&)gb#(@1}rFjTem~$y+p=^R73hx|H?z*$XU# zH3S<|XkBs+hj!nxEr=HVptK#zW{C;KB6S@Gv7-?cIf-}i#m|~JB<*o5YJ$jl1a^GJ z_VEWnB2r>~8tqEah&iA?E>84Le{AE$&`K&La&<^ZU5e;0U?N>%MlG?t03p@bF>A9TmT$CT(I`Mcg)=%0 zr8A18Qdgk#9!r?iSqCKckVir@K3D=P=S9MM@BlZAc-Kv+6s#3;t_J04BOR6%-1}%djR5Wrpg@Oxjz$&2pFmp1OjLrbDH$D5sasC z`oI_9O*d25=%U*o=b9$TXk-K>W)vvtfsm4<-IagY)1!@zB`ocftWMIcETRy&Q-lRp zQaebsjwN47cBXMrH$o+fM^h`2M=0TdT+!r99noCql|htY)7CNtDti5@h1r>GC-G;X zN=O7>3wILlwDoLta9vj;mQ8alM z72xjC=qro5#P9qPe-=_mUTpNV5Nb$4xykE4-8wDlR8GCbw%6OeqdC-xE%QLyQCxy>J-tM?Dr4l!9!cFXnPkt_ zdN&Y&1td;NH0ZDk7qLwm>Fo);PF!k{5K^XgTt|T29D^#rqZqHPvHRG*GePHxD)8oo3N;I0Vj3z`@H`{4 zJUjr3B3w?rZ0Gcu^`J2z2=D9yMlV zITvc(V??3EH9~@j?8wqogA2XDGt7J1H&`Ew3&Yvrn>?RE#DRYddVg&GH_C2l9)b>E z?-^Y=9*X?}yI%)iuj7~yI2AaMK6}F@5u%!Cn^{vksYUua{)}pYr$$Zg`bYwjRRX=_ zny=qjXfpVR@|~1}biVK~RW3}fl(+H;8XsWa(^$uF-#w@wL-5x!dFH9Z=yCWvj}?F~ zeXJT(cY)QImvlY-b;TJuMjFE*`(x8N&^pw-*8}xo!h)!Y2|#^>pK9x?`Py=POWyHI zj#yVi!oFP$YG61<^r*T(1A*5C&#glH?7H~xy97KkToQR|)X{6G=;Php!Jed}ovx(K zMwy)>j%fTyh*C1S*;wo}Z_qmSQ8j_WL4FTfdz_EGd|$Lc@ap>&H4z$u7R7wo#DyUn z5W{18(l%f+O>sin&*dBsjU>3FX&`Ki@uoLlD1DZ_#d)&zC9L}qTGEPwt1ubhn%wxS z=ZXSvKzO&`s^6^j$v#TTo~_z2>LKV@QxZLh&vOSy2|~Gmq(%)$Od#38bHxcgxsW=i z1>KCaMM?`Zv^JOUUgx9HHA&7!##U4$P0`1)pkF8+twA;&AfVe!yi%)#<$bB^%Xc_7K$v2R^p1W14lD94ZSrpPo zRWO#FQw6AyEJ>{!%2(Ud5s6SJFIR-692RzeJ42iY)g}j8DuBRO(+n{HxMti0^2>#j z9LV&7kIUO1y9o5x%gbXz4Leri%x)oDYmoml2|KvOuX(3DYK*AD} zw%24$Pvpg;&kZ;NEVJ6a69FqkS?8qZtMd-_Cop0+qOrpB?7km)Spm|JhT@6!PJ4Wu za{?R~8{Ux66?-}Z)rT8^fHFe}&2ic=0GOg8&!dKBpcCZsFVHcX`8grmZQbYEer2Vy zSQ$x~C=0GaCDkWhb$VNgR~g2xhrDS_Wsl$voZF+Mq@({Z>oH8MGGFJAt$SiEsnYHZ2^u;=T3laDupInti>@pvyHzcesDhR3IbUh zoGKm6QE!W5BG&7KVqW#}DfUkD=BXd~eK>{%48(b2PF8k0Ve|RYVhv{_Ao>X)tUrUT zwI;H+nD>qUxAVF0f8yc)=v4SO9?rzh^j|#uADs;U^rim~Je-5|KdkqPCQf!Pjz%U< z1RQJ(|JKex|1UiJKltW!qZyo`g`~M6w$B2#>(oY4gXKxmv4F2?~PsGwx7+~1-1`0OTFdATegqhTf5#3 zKZmRV#mc%E%q|Rv(eRH8c>d;(i>R#M>uPOmUY}FFz8*n#HQ#5x!+KCXrz%QpF_v3D zf7VvpjgeL%9|Ps@(68f|=iIDQL<&Gq(JwH142cr7u%)sOkoH7!B)UTznblRkfuS z2QSB_uQO~`jc$gr&H~f20>-4>ml zI9sGHg9Qi}V>IrK!MJVHk^wTNzvCzv7GSRo(0sIJn2EaVc}fM_@{Py1UjB zzCMi#3XyJWFfUi4A$Nc;zD>g@zS3V9T0`Q53lj<>1V3vHXBt*H@9cK_R}2i3H16@g zIi)2G0o!{SCqX-J_UzUG3$Aj{cgb$T4= zVx6+<9`o(3eeCp4;C^x9fix)(1p2QNLMoVY+Jl7KXY8k4jB2s~Yr7vL<8)~B>89sx z_2ciF$W^Im!Aq9NUE0L-2Ko8C_Hc_wKeNlnv(HN1V$Fm^!4=+swTFTr(aeg}mK<}4 zWlQabqCEt}#m859l@l&;gu{xY6OVUmBzj3g@@>7nV)RMM4w#FVU6O4ekPK*7O=M!( z0?(O{Vn7UsCDEO}*=e>@NBT6ty-!YrNEBo4rDv^^ot(9)?LZ>u9H`~u!^TG^-G8gO3yb1+J| zY}CQ)bVlQ<=8A5$`vCVL$|g#D@&>jT=1uUI95e)F!FQy2t7b~ zy!DE5IF~?>eF?(SYVQKsK5v(Yr`pE?vi|&{VHKfC`c!Q!K2=oZVYIL*< zIPmni9oP{o#8NhJO|6dA|6*jNs8Jpu132bex@uMwTS&^#P;4&l0}Wk=t2=&4$=vOB zXW0#(uUd{ap;Vj<*8?-7dG*HI+lvCx!7LtaP=S2Umz~?suRRF(xB8eYUX0Ac-RpO( zQztN1a| z1tpjz$e)txk|Noc3ba)Rc1X2D7+KE>{4g{)A7D4?L7tu6uh+X^iYAh3{$A8>wM`3Q zh_G%)p3P)=!UBt!P{xV!u#dPrJhm*OxCt#F_ndz8JAh*(k|T;W5`OrXT|RH_9b%jA z^xvMs9_Uypf#1gs8X^4=kn%e@hK8cND5co_Qw^dkz@Q5CF_>@Er9hcBpzWVu#M3!uP#a_&Vnvd{=t61 zY66$ku$rd*%I0FLaubY^s{M>xgcqRC^?y*7|uD1NX|OA3fOEK3$aU1PN7*<*utv_6+EQ(~2PtdFap?NK?j zwlI+Dau=nvX%}~V$VU!yMwhJwp@<|x|@E!r32zFG^ z-$Ab{=j>}3v*p6^^KMmpR7jvLM)dcjjd19;RrVX8NX+fqmT{lhLm!QKxNRDZjWV&= zlKKa0QQ!o(3P)vkJyG0f=#&HT4tu&34mqjN$mJ6{YJS!Fw-o#HWTslIF^Q}kp=upn zOYcY~Fy;luPpyZSGgglwa#nft7VMl#yUDT`~;A5^{iQ<^E*-hgsf zvIr%^l3-%)4Oian9-qOzf?PkvCeSVvsK@N$>=+(Xs(u&_q`PD(fCxkD7AFa;fXP4g zyd+srOPBi~OtAd=r3~w-If(~kv2W2MYn^Vz)Me^#hnS(kie56$F9HQN%Y=(}4q|*A z0~eN?(@p{{)5y<>UMVQYl#?>E7-CH#q!#8?p!?`ysyrvLk%N0$j7NzxLh>gZDVyPn_gzzddteqsKD4pe(C8ysJW7XAJ7H&L$ zm#}Zey;Izqjrom%8m5_;{#15O5s`>@w0v`*P_N7N=v+YtI;m(#!Bss54D&s@ z=sW-ROcPo)16i;H1Uo>4E>rv?ewffI)N<=`+ea*q)1p`B0T~_G%S9olKk{)aKR~xTmi0jCy8;7 z%2Wr@Muz66d6Ir(g~;;j`(5>+AGB!?L``u3$x=(0XGhUU%>MCNxn-1KwIGQ{+cU*b z1vFh+$P#k7Gx4mL#jw>dVzu_SRFd%l%cW7Shd)vP_-+IBhw7-!ha&7jd-Fyof`OYV ze1vVm9pJ}|h#(PSZ21~A0o6giJ7${Eni_6?sc;c&@CCCp^;A>}&qCzciP?%G5N0`8 zANEs#Yhb@u?a}6ASUm85XA#xpNz;r?DwJU=Lz6cTJ#X~cD6D{zPe}un%TN0=6ub~^ zk+<)3Go07@J7l2B$o6k}pJ}MhYx9U&BmmG^+`UIMbe$g_RM%gWYxzsC-XGpQW_#iD zM15@~=b_RmxPxk3Gz8T~KKUGZGZo!Mg5_LcQZXKF6RjSvZ+RzHIZ)bcvxpNxm6evW zo@(I;JlbjrwG-~O0DEF0wyJ&R ztr0LQ@}~|EDg*YE3^(nuTT8^#zJXXn>a!zISC zl*hsnAFD`NFpS!-9UsrfxgD#_=J$la9T?XkI`oN@B+?hPKQIBS|G>d}=kfCHz44Qw zHk@@|rMcTppm#>x$#0U3b?D7W<8BmToyn{neT*!5{~Zmq|!M|#)x9Em49j$p+Wa|v~(p=O{dv-$}!FU8vJ zWti#;o3IC~>4iZX(_#KTpUW_pPe)5Yo6W=NVuA;}3r1$XDUThy(v;hY_%&|@giOjGffjcr_#mSzRfhgc3w^ zEFRPdlt?p0g2IjNf-Y+kN8UPVM1tiJ>qyq%uRNHPpjz-dZQ=cw=d;s zGjN*nV#ghISlaoquNKsOa_LU97qUGBuD98Lk$-#owV4UX$eqm+_QzO7fo| z@#^QB`5%lH1XnNaD9Kcay{>c* zh2PiXZJRP3qzBQdb)JsC2|Vb4M8-arcSU44xOas8gn5GHCz|E^kV+;X(otqDBJ7rB z;;2iI`i~gsn4~ch5A-Ric8?z4fF*DyA8JXx1r^!G3@sQ0<+_-u4lX(3P=UfK=galK zBMh7ss09_8d4p}6!+30f4CA~(&B(IF_jBZdERZ0LWl#hDQtcA~lIx{MIA#`~IL3}~ z$VFKO^}t#~sUM-N-yKTOyfi8xA8P@rvj48JMh+9Psp@Blk$yi=JT#w3UcJ{uj^fEg z+48bywNq}c0(+@gwAE#Q)Zk5nDk-RCXV;$ zrg(nr=zfWQJD@4uQRoW5Cun!sqwK+&6Kr0Q-Kjz%`Q^H)mNujRs2GhrCvpzuV6ks>N@K)qy|*4BT=P7nbqlrgZ+Uz{RI8jS?Pg)yh0STS%S z|&Jv2vN4e7)0xLFmfc7mYYWVm-8y(0Wsu5}0CmRW}bv+GN zgV0mx-ZtJVat!-D=$#z0(-EXsubsz~chFLk(-$kCwQ_ABm#%Jk5}Q`)_Ycp=Jjk$qv?s6c`@ zYHG#p^|w+OMZ@ds)#-XpDmbo8-EIS+a&S=2{hr6Tb-h5-;#?*sBoyi0)Ee_&pRYz_ zUM{l;9o&!Sz7z==HcVB~Q+hM~pWT^^+s{7)>52%p!tz%~mYx@fW7T5f#qzF=t1!9C z;c7f!mZaR7JX{XdeR>NNAypEPLn?0aQQcj|VpKL#*YbeCOzA=R9A(aT(6KuFY_25> z$(=t7YiubZHnFHn&*t)-g*;>XHTmo+3hjYbRD&QCGxcMW4HHAYBkN>!Xww_F&=+xp2>qFn$`=W!1X=&m%Zmi!oq<&cCWRtY<}tT?DOv35g(X} ziVn|bU(Zir>P`+`vrJ<(st;gIyG$*~5XIJdHTf>$2qySSF|nO_t;GT*3R^Pa96yRM z&xO)Z-HZ3>GFLohDo6%dPOlZU^&P~eGkAT{#EOhVE`lO63sq@F%Zf`kqP$t)6D-!Z zYfsTVomS_$LBE;*bqNoWaiMx{>n;m@pZxXX4o`4>Byx0f-dvS`gUIzx5eyl{n*Z8M zDVN@LQ&$gTZ8?1%EXePh%!Q+0kw}{7%Ff>2+T}rAi+5(u;3bd=q#Z+J{D`?YJL^5l z{=F~tfa(#l9XAL;$1rcj4R^_FVNm#!g`Nz=EFE^m2s*i*%lFdT_+CxePv>%R^???X za6PZDFP$vCLhvgQkbB~675_zzDv^lp&ck*wG9QgAFj0Ky`dk1zYi!BjG}1?*3oLTG zXo=>Lcap}ldo@3#wRB!i%eGfZKChI~-HE_b#Nc+b4=8@J_G~ijrUaXQ%#T84`Hln9 zGoeESUB^wyLT(a;wAbiP6GDM~I5=;9ai%N?jER+J!#hFrqYCQk!a6npoa`4z>pT00 zqHSaLx%k``*59*nQkDGD?v8QKE_&4cm$Dh+M1x=7HdsLJNHSy6Z4lq58JRa#wd3Fu zcee(R+LWl|O&Zi;I7Y`%0`SoyXp{4K-9Ttes%<(<5C&q%>-C6;i1DfxEM+z}PsoT! z9M)axg;Q{d1yU@~zzbn?+ZQ%dAdYx9PiVFn))t`3>Fw+aX|KqP)OU1|fS zKufXPo~_@;2M-=L25wTZOgl{SQyo>4iida)Wz#Xms$@e4KjSmd6GI4%ij_ZSRh3>h#PgY|*` z6Iys3!E&S=n!ZYVO|R1yoQqK>Bnzb5i@*W-rGk43o;(I(tGw}WutHe~mL&Y!m(mf* z^EW}e|DFe}Ba-W&p)m+)wEFLSu;TkxS~1zg7tXOVsP-^3!frec$X6if#H6*=T5(yR z-l4=JlGhOxAM@4@mT`$KYIIU^ht*}Z@w-!%ab&oUwZ0df&P5x|RBpi9?DLe%#H98# zTItfjfO#cp$eE8QXc-I5jK9}rK7gc>lGZkp9d)y^hkpAyI3i`I^^74Mle`~$C8MI zldr0Id3DM4>9iYUD7+$x3BO%zvBo_8s+p@*6x(`K5<4CcxZBDfij$K{Mb2NXD3o1z z$3uOc41&v)AYSf78tNI!JqCFy1#Rh`1Do|ht)yO5Y~)`Z7MWC36yFSkbrtf+PZ{lI z2=BNaq$nmC^L(66)3Zx}qbgAc2R$Dv8-}_Hs*BMnEox>%by}-;zFgKh=2`!EUu!;2OENgBUbIebvfjAMBkB+2eDt zkXS**Zl%2jG+R>vbKVZM=_@p*rO0L|QR@T#xy9r^G+w%7wI19o)u-R6hZS*UrxsZe z@XS;+w${yzb%Xk;J+7BYK&9Lho>4TS+pOntFcVpBh25-QK~YJw{(qQz%iu=ZG+onn z*=4&-WoBk(W@ct)W@ct)W@ct)W@fw0%*^YrXL_b*wqvJv&&G-KONvw~;#Eo+k;?17 zo_ht_rIX>+61{1;;z`JRG{~}JH8<3FVJ~^`C>-QCYWX_12dL9Tw6I^ zj3S=dqJPU!#Wva&$2!CsdZ}JWO9QQ&w zN{UOHUVS(gus(zhz)n8cL+$tsH0|U@!a!X_0opGVpP3UC6=UkgPFGcU44uiJ%cJo} zUQ$LMC(j2r(!)VtLrR#%f|%Kt(cP?FoS*CC`u0|7O|#um)Y_Qqj~$Tyb6+kW9oL<@ zEKeUd2kHIA+?dmowVYk=uP$<@gEt4*&&?h;^~rusUV>STUYD-uCKA5U&z!^n>Y7zUoXb5chy=LUq{ck#*es&1W%JLSqluS#aLQh zs@Y~>+{?eW%0D@r=YPj}&6Eeuyj2JUeFD&)V#-oh`0wBE$sED0k| zXTyWzZq2x1{==CjPZQVCk~u5U$o1F9{pA^Qa9vx&haFZr;3pBU4jxK&=R}o_%9LmD zL{S%1ch{o0yPI*-{?qNAjT?|6!Fi;$jy{(@S+ObkgK5 z{_y<_lT^*1KKuqrSXDr9$(AGu85>QGhK%Q1JRo0AUO2pZIH?XvgRRZvlZRT z{A{k7y;#XS3LPO-sb4j*g+>m9yz|Tw_S-lcaSRXwtROs7Ex#v>W_@g_Faqno>gZ)&gQ`B~ zGjVo{dGv*UzryD-?ctZomlN3?I20^&mW!EK`ZyT0RpCY#Wn7Dy_4&1VA@mt5ARAQd z%O`?EjHfcQVRbrH79P_4CU?&*04E+@3)!@2Io|B1-oXRyZ`?fk3_@Y1Tm1^HDLa{= zMS`(q0oEp`D+#)L_TA|0QXDsZDSQJ{OQAkVeN!=PEG>C@#&)Le=|tslN!-QtAfI+n zoJaHk0V^DCFDV8!!H`v;6(8h;V}EJCK~bv@D{7r~$s$67xB8aGzPj+1^xjCAem)Fa zyOiT=Rx={tw=-(Ui??11nEgutPMa>m??KqQ&5GBWE}TiW&%fmXh_p;~YMVa<1K;>=qaAq#O@(*!#?M+%%NXF&l|n=kd(o1rE0R!hLZZt3jU&$4Kcvd)R_Rt zEq00&WDP>bJjF1!=>Xs&-5Kz7R8{g9198nI9%M;7@j-Vh(i{UUoE;y9yW7Sprve~$ zBUI2pZ+cRZm}r-RMKJa78pi$_&QX?wMHbj*#ly6)T>xH4u^QUN`Z#ZDlBQENjv|=Y7&qaYYdt%49@6XL9RwKjtYlIg7XX~ zIQq=Q3z_u%YYFoXcPfU$>-NWF7hIZXsFjB>NYw5xr113*2_ZB{R~rgRFyJsdQH|mB zQ!5$aPL&m$s&JQ$E!5`{L`@|3ln*y4$rvV}*7bC+UERrtnh26L49(uae+Y})3^Gxy zNL-||ql+SWxU=UTMG82m;&Cq0Q!svO@#ZmF8R2q;2vgYw3!D^NEc5CN(zK?N^{e9K zZAC}@GFb2b@`ZbwKnz~Zpxvzq|mywfzD2pPbKhiozMXO4k zM8H?~tO607`_({3L}_7efHDjsHX`X8BS6^OWV4cX8-Wd!bSzz2+Y{jzC^W_2=iiP;;kakMNYy`IG6H;DqbOBY}hen3;?`^FFRD zQA7-I6U#3mL=NFNoyX=e&K5!LZqchM)`bcFsZ=;g z?DzbfrCUx^MKLw?&rz#&xoCNUVFQ@;J-%7$C8Y(1Y*5XXbuj3PC9WX4Y^cT{JJ?#x zMEJ;=ATSxUfwQA3Oj+-fI0uq4`$Gkc<&&(g-{;N-5SutiWRivEc87ZLQeo5a3Ql|g z#W`P6;sJ2!s=2gNhj(b@LAa$z%6c*{iQ)8ZsUa=N8?#)@8#zxaKeSck-!^cSG^uyS zguHZep(>TGO2=l3RwBY3vd5qkIs0H}W@@+yah$@93K-hf?-54jnsa+%HC=V?D0isH zNOJJ&7)*?J`x&&E<&?!$2vpQpR1G3}G0o0&M_lP1!o^it>~SKi22_BLKq|0D7pU#} z@E^iWlN!AG*RNhl%d`nL+Y@GkLzQ}i;7nQ$WCbDG2Yu-&d{Za@C=)@@-tX`dD+ok~x4mo(d11wvC^OR^zya@MOI~GEgb(*RL`5NuG)BzSBIzkW zG3tk>d-t;C>alYBxb(nhwp0<__Wk zpI?h9BG!rt-@#m3p<(VWt_EtEb+simQ(9D$(A00y+_PP+k9zRH>%27_8R5^$lV>Ij zn4)Sep@Of4IUp_&iRkL6(ZO-b(a!GMIZ7&3j z{`eS>y2wy%=~^yOK4{S&XB*h2+dES_fiuW&V^Uo=-)xK=P1?o11T1Zu4kI*SM1EUv zb+^McFga4i^Ptc`+74^?r^X@M&5}h{stZwn2;P9%fYT$cgfA5}hNTaxFJqaf+oy}k z!*H(^c@I;4pTo8wpIMg+xH3{xMdhhZO$>um=abr1I{*LzB%hM1%Vjx3@Bu%stqfcO zzYsNAZchP%sFBW{`@jW?60%*>HS|;W=jDmD#OjjY&uGs5m|*!`MGy0sScT`AOMF$3 z?r`3$15!|I03-++VuKMHN z=kpILL`kxC3GD{oC@7ueE{uU_*3K%`l>OQXrX4~)o^)jIV1oqz*d)A}J`R@vJ^ZSV zifW>Anu~e3Iw{V|FtC|8#AOz8zq_Q?J5xAsJ!JG#%S{1ecAEB_V}U9flPfReSe0@E ztq@tI-J~5W)AZ^VK-WKLKg{oYROqWY_d)YX*>h{+?5UOLCV^~2iW-lVOD6EgAAOa` zBC%~-Oy6(!v*M_~Yon7gEE`s|BCrG0cM=t7-0j_diluv>k9sQoQ3)ao-vF5!n-vpdO(zY!Zx6o*#bz?=UbdR(t$jiKKXua~&Sjhc3l zLBMqcbbwTO-un}a7bl@`8fHuWK7~YG@AqyeEW|PJoZxTKhmBH+ri=MF1G8?++#j-> zo%~f}S^{faz?&7e`8L>szXMl48u%2rBY3j^RH(_GG6eFVx6(2?-K{S1NWi&Jt#h~J zl%yVE$2#jGN+_-TfY#K3n-?!Js6*hrXU#zTN&74!p|n7L;;w%?hk%r#QA3FVnA_1) ziRgMS=~Zr)+yE!STsV+W^mHHM*49B=DBmD50$+Mj4OT0q3dQ_kxecvo(dMvcT4)Ue z#&|aMEu3HuWnG7*Q-Kkji|t8nyC|=Krm|p`j%)R_Ey;-?XM_C0gTA=H4s*ZmYbfp!rp_bnXhRABE0)G;j|L?CTb_y zVP3&mEK)GJD5pRxvAMg6?Xj(}YA_^)n82Rlb6vL`8!8``HWFSqa1z3vZnc(a6updy zUT(f;@>y1MgCP`yk0H|1yyck@lg328OBUhQ9ik|`r?e1J7_%9=4Yh0?&NL|R9)?@s znzX?!url_roYY4u;sB+uVmfj=01y>*tU#fiL}d9=#S)H#iFJ`jAA-$6i-WJYH&B|G zc-S+OP)>tkphG3`>mE0fDyS|uRCe2@tQ2QpbHWx+3XJ_Zq({!*4-azQWBpfVm8$A` zbI@E+7|_pox@3ckMlN;B54G=XEF}j}a{k1ET<_Yhlsw2_$CunwFhw4U4^XyRlyVf5 zaVWk>Gt^RMrLP`p+*DLoi)kRF3QVFlh$e;Spkk=pIn5JHO}^6&ZAEN?=LV`m$TMhQ z@r+L)?KE!pyF3Lx+0UZ=v4EynnN|E%%_%_Qk|FNAp82B9`D)!XLd(2@8~3JVqDIVLRxh&_19a9tL{lrR1_ z@t%dTWUURIBn5JCp^+@fgON{F7V5NLuI^~Zl%S_n9JzS7)Kmq*ox%kUqiOr6-qeMG{Q;RvCdGc`OKjZPzT(%d-=3iQW0g9j>7!fI4(Y5gAE zqMYKg&b+6&0&aC?IAS&2gmPAnJ{K<~wgm4?Qc3WW+_6K0(%g>g^jy`~(!L zUpZ65BtWl~v!UtA-UBAAEs-&vlPR?twG_-)hUw;B`m3OJ#lgywcWIsg@bJKJ2qO(Y zj{6=Z=DS2-xRoS;P7dp1ni|>w-)PK$-kq>DrgS|@$tu7c-YZON>Q5oqo*R9ef<%=d zfD^IGjv>HW;W(ZCpYM|jW&z7AL0VSj)I{#^`m(_UgK1V|i53Am5_XwltSTlB0rcl1 zq2ZvEVUl9i+9-zt@u@Ye-ew(dqU7y6p0!>5K&ss{dvpo|38RKK3n5|U4x~e2v3~1@ zra+}}VCdvRWvpj0b3lN1VAQIqf}OVLD&CtPmgB-vXmQ=K7e@=TZEKdva3}qSZj5k6 zdSt?ToNT=1w0>04=~~eEa&}%)E>4x<1{ShS>n%c~h9XOdsx~uuPTTnb;n&eQ|6Iii z#H)mxo|2hF{fosw&%1Xd;20q)`e`oUG36Ul7Q;0mPGP2i%kl5v3?<;B1q~rygHE8)EQuW^~VqOz6qhk6s-OViT1k@9OcIec8M;TtwJ0RVDf^qXL zk^;x~fSah|4)=YP9|fu5($He^%eF-R*je2O9ikMqx zTpPI6@9Hr;Ml6FIc4i7AOp^V8iE0aiLlkQOdbLE1oNVbsWem6&KD)*hTG6*L4XN$L z*`7GlVgWZc^VKm$MXv(a514DgmQo;y;%9@Ypd;Y6jZl;#uv+S*Uuo8}SnV*zJGdg~ zgFsl%9KoZ#tfJ~ZB;3U62l*kx6Da!%SAA+7JW7inMo@1i83xGf7eU;u+iNeH;5E2{ z@IYr-Xq!yq`kQfS@pb|l@fhO#L&GOVFOfQ!`-+>&Vy)i8U6fn}Lw<$uwRtrk&Kce$ zBRl@lqgPqZcG7wE{G*i1U|Kv@4_(6YbR^7RTFTV8ll z9-IYJ5J{`J0dfjqGe&h7_{}!$VY}dz+N5dDf7JNsbRHhMdo51g;AGgpaYU zE~68KKG*(=Teo=@YG%bl_l7z4$an-9!%-!y`9K}RVbY-0C-QPvSROVdNXv|r-iwL( zS@K7>c>8=qL<~pGvpH-40FKl0XZPc`gK$XW$8vgoX2(b=j@ao)ZPxRFjM0tZfrU>r%U=|B}wzp7dXC!0ShM@E0sDg<445X%L4*)H=Ln}0V+ph%j{ zksPY{OU$?QRe%=xYGoK0ua9W;dOk_=;%a}DP$#O7jwgz7l~(tR9n3FWS8m;ZFh`x} z0n+=!YTv4o^+Nb+>;(VHZwDYR{zRwKE3D$FZKmY1K#Z8MZlCOojNq1t;6p7yr_`#v zl0a-kGVF#L>*@ebuL@x?*}F1(QWm$UhE2@_67}T8gs?Mr(I?bF~GL?-EX( zyB`P$|HQ|XrN16?L;7-yYlGhQ4}>FBjRq)3sHfPEFGzT2&SM;Uy9pa(9&UG!4tF}u zhRk0}G7##C2q^OdUbmxA17u`W7zTY{g}mqwrDoikA{m}s73%fdMD=GaNQBg7HP*lz zmh+bFT!()ywYs^sJH6ql*#*_f)9K>UjZEHRwQ^dq%Z$he!s*OX{ofu>Hm|ZTO$J^y z%6XR1@st4!z&t;RvXrZR2b~!gEbVHlw>n=Q+mGB4-rd4XD`p>0>}IC7|3Fj=ANW*u z4AJ!mJ=uyW_JWY^P1ph8`J+ka6&r{~CDKkbjkS*Q3r<-!NGOILD2>M@93Zy^CzXI* zUS3cR`9&p2Kvf6`G0Dr`-!c<6D&)@%WMU971Z9W=I*E5G6~^*?oK`???0sxL!C2cq za2X=9kFS%X+~r#8#pEAs5d~0^5*nM)^18jip3Z-~U13RLpR>tRA+ItgkkPj=v9!X) z!>`Q?ye0s8wtao{za8Cw`~(4=D3ptXFUPot$x0uQKO79r!!K0Wx_gS<1!55H7hJz1 zZ{Jm~NOMFH@j`oRe|oA05AfjatT956E%U_gGRo(xQ0*5q_lgoTCCwAioJn%UA6qtu z7gI>5`Khsg;A<7gl~O~tuMj9U-Wsb^?qF0{^krKZH-mmONJk=ycAxHSHyYDj&e$+k zxKR)0g!agE*RKMH35C{#s-W+6${1}Rq{bX4B0vA?GcqxPgGXsn3x)>TvYrBg7viTH z=aJhg_8!oyCyps}`em7bDqulwslWn`RbMQkHV~Cvj zd`lQ;K?`>-gR^kG%5V)iC!G)e*QRO1bICSHst~P5oCU}iQ|gdXph??EI_c}83OTJG zgCV5Nz^C<YA`=#V;{viOxAi?0Jv{) z$FL4Rl4&+(kwr+7+a-q+m@J=5_=0@%){ocAubWLxgnI%}{)wa1s`<7Sl9(0hD!;4O zMWx%v97LKrK^SXG>a(AXCn+{lK=rxUI6eUIw?vcZhNb8Xvp@GmbfA+l$m4o`A({K0 z3*g-KIOa`mQq9#{+=+-$Zx}#{zVzmhqsD5OzL4ZmTFzkRP_H#rIrc}b7##*4Y#}X# z3mz>_*5|Xvy`Y<`7vP9djcU2V?hGwf{(6aJgKIW9l$9+|ZxQcz-94AWdTOdm-mvDn z*=^vk(s(ZW1B8XbJn^oa)Cz7VPp0#oIrZMBymhkJPF^9eY(I$%5pM9AZIWN^)b-!j z0l?2dX~U@MJbhy8r$FwObsF*CGP+`28j4lJTcfZk6Hu(ZVfw=(h5ClEL5S0C^T-bb z9U%^#6dRsC$vKzpA4yy(Cs(Hbn++D4*zR6gtTd{F)$|AepR|)ReKshq-1TpRl7Ml(k12)hqAQGEJx^g-GI)K^^m*p&P+VPQ;fP{ZG(t_{1F7W6 zLjpp_gj=eHnmQszkqmO!YZa?f%4JmQZvQl_ULa<60zA9Yvr%UqL7rlg!FIF2sxdC* zUHw@gd04UjG=Y9!@2VO7Olrh!;L(M8)L+g#EY0oRZ?k(td=;fVMhP>=VyvL;ZT+z^ z$6qwKBDcBYhx|cgayhDz{@E66u??KL#>YBK6rJ#+#M(4r%(Hp zVw70_mQJHm$G(YNoR}+qt_DEr){y-BZV$mPW*%HfmJ}Ux3;a}k=9M#%!+L=edAnVp zIU7g1Z~c6bM_LHhP~$c+cGN8O=#p6rhJ1=!GMPCnaTi|MTURDYrK!U5`R3Bc@bwJ? zDDIF)#OK3Hw1~}WaldabWA2sOUkr|CHSA~@c%y074k;iVS?T0^z-qn0&M8yc99dRo z={te)J>YLkM-OoWXU?S*K8VzWCk~s@Mo%?_uflWxluSRoG1T6q@@meNNj_z=yeYKe zj>8(0;*iph#G8$-fy9u!MW zMY5fguDQ$JHW;r2fCJCj`T}=15OAKfV?8oTy{OkdeUxHRm?8 z62#{?LbNwSTde5AMylZ`$N;VJqEs|O0`@*Gf=$Lh8nD^|#0P_c5yR8^5h1{AM5=qz zg{{8b#=k(Dl;B1GS<>Mzp#N9WfrW;Jg>(k$V4{W&MkZ<=;Qj|BE*7zYO62 z-sVk5`-_$NFKzn2&$9m8#=jr#%`9;+V`R=-fZWO6}C{FvvAL{;1`J5XbSmdYOg(m;Q= z{c8V?wx)eK3|+p>USeN8darb^f8AYdrI=Z$pM5Q#JjH(LuPaSmSZ`luf1SxJy4QDq zSbYs|_HLbLr+(y`^<^`^abH+>uXuZrH)Jg;YNoG!)pvVl7FbGXGfu7qGM^_|v%G&E zgl~VYPkugvqWJmEWj@EjOLV6@m8|7jM`c{5d+&L}p%OARpep^-%AT2urixsV$VGYMZ_Zl*ITtCy(B-{_&2oQejDD!%W0I4}RUY%{|!Q@D`!;=5l=XI?Ci zwq8!4{cWy>xO?yZJ8!d@^U*93VJ#KX9vj`rAa?$4%MM6$zGZBsYI^?lL%3r766WdZ zewv#al33IprL1>BKa1#)grHW~t4k$q*I>TZ^DNY|-da=L(aO?2TTm(9%>$#%r~(t{ zF1mctb$)YaB)GV5ujsO@%DlK)INBY4U{#=cQ51i;Qz?d2t5C z{?)BIu6=h;pK-;A#gn51Sg~c3_nr>oApVOQ28XYpfRe-#>ecz9py5Hb+xsAulBc1O zf06Mc^c3j&qtQkuJe!Gsxd_JN`gZN$M}VW`;=MlK#@6LMurZc3r4AQ&R}zotY7;#i z1hIN3hDd@Z!}@Ud#<{v6+CmdhS^)EEZTZh-sbaNS5Y2aRzUW?Z9Fm>a*!i(+9m->Q z!%5v_@U=*EGJXwl_9<)ERXS)lcnDt#ad>OHqzQb<*x?0c>Z+Bjh+s^iMO2Ea2r%R7M6X6F_5dB5W+GjFS@XNf>Nnt zjN{Vs+j@aU^WUBjzo|;6h{}SM0?Sa6sIuskJU9aiz*ByHd}<(St;W;XOJ~j&rA+B@->O z9#JFs2pf^uUBwJ5?c=H1UJ-4Jb;;9-eCq661spL0gW;y8&>h#MByBsRjVOS=stLIj zr4(9Z51kv2pIUk-IDBaNLq$k`cK0oIxfwVW6pV_ZidtF|+T$=8xVT+xasaaq8h@Z_ zhNn)GMmX zKNBWW`kIwH_;#9|v*$1vGRdq_XabG+6KuVc3e|}hA_<31H@a&av0zkM4~3#WB#eJF zR;GtNJL}PE*|JX+xOjbC%P{CiGW?7(Q)es}!7tzoLsZ0Q6$;B05L|m!3R7tPMGs7B z9T_^DPjEXAMMboLS0SO=Y${YUyPHGm2I_J27)+15(o$>ZF9{*EB8#lh^6XNN?`6jD zOA0k^w(c!`R*`@|<#m9#GZWn7Kv0Z{z~~9a_w#3f8HHinfU&eoCKVDr!x@1pLr?zz z$_4GT%E&468_q{?*ejUGh)muN-iIH6Eey=N+)Py==q%Lk68vc5f*(XlH7 z=10Gx0bvZQzjtBk$Lrm+*T=z;IcY(~f<9vA3kG2}axl{FPx3~_O4$A$>i!ky>?%6> z()qKXP^qBvGwt8tDPamtXLS_a?q3dHua|D@g+@H`r2HR~Z_3t}TP9R4x?{LTg!s*n z2S?l8-tJHD^TWfJFK5w}s_1=4f)R5H?;f7z)hCr=!{Cd-rmvjax6BDSv~Xq zbfD-{dO9#es|sm*whT?8ozl_Qti-Z@p7dDx7onv!Xma}1m_Bs7+e@}sf(6|N)M+_7 zM=BiIh?J_q5bs>4`zJUTvx?V==0(~z8@sT~ho!@KU-LJ#t`4>AY;FLqW2cx2Il65O zOge%>VV)(K8oJ~r#oR%_6yJ*2O-A(0OiSB)&RD#qm?S1Su$gkCLe@Tg4+wM0-Z%LJ zX}MV)&FJjk82TgN)mM_D5rI{`S&`bN+AOt@Azr*mOYh}~DGoSBJ#2Z(AT6DZaVK@@?#_F9$(lR{`eOF322sL(>m`ES(W~_EoK+MX%xQK{9y!j|kD&y6v9yo2^o!-rt|ftvI{3yZ zXm$8p7osX`QdSsFRGV-*$?iehYlqi+nb%*c&~O5w6n`)`kE64^$X*e>ENiv1!P|3) zBcvlApB^T9dT5M6!6%{Uof#9TxLNs|O72_g?l&_|%JL9uTcDfD))MVw`bJsR?8UL@?w`2rgE%l#wt<`%SE^;ZNDWyi43!Ne&t zj6zJLXZj88R!B=tj7L)EIS??rbU}M^POm%icFv>x`0u(z_sL5A835L1YT`;WGUUX5 zJ`oTKRT3%5Md;Qb7&+qtWLF6zqBusNN@hN#_88Ok6s$Pb;SD1xy#5i4cY^bx|FtnH z@>n6r9$aBCN?qz5@Zdj{jd!Ziw$Lc;f9j;IZMRw;E^)x;7_9ZQcoZnH1lg00#9|I&lQZHvK0| zXO=92A*i#U=uYybmnerm0nQ*5<>mFJrX6oJqnS!_MP5O`hsD4UYXK(j-?Sk6RjLx2;xR6W8gn1eWGu3g#fM-`TAxUN!y1IwYW=4XV znzcnp$hm#37cMVaf(8QCMsWx=p`-fb1g8CS8Rbd?d+;4FTt_(5%}-P2Z2-|ytv*P0 zTURmJwZ^SyvDx@my0;V4#ut3IXG2y^$Ok_};ULEIV0&#{$Nf7(qd37lcgcBsK@%wk zaoJ-7QRWA@<%NYSq#O=`(V~TI+#?riDN{KDq^Ih_T_eYhR)#Bp$ko z=(#}R7?+>YKjimG=bI$mE}-g*i?K%W&7MTD$ryiv@8Tl&u6d{sSP1mDDc~FUHO&OwQ%iNj`DXV}@-c{)*G1<3@X)>vc7@(8d)cR1s7oP|gTP2^;CeRMm@fnq%=#dT} z@{433VvMPR^fuFN9Ffh=OGtU=vC|=K6yf*=QIhrD82m1VdtMSo2KSjE$JSI5C)H|a zs2)578HE=;e0N#k1e**e!NRsSC{kGWx#MJJi(*134(|EW7bGJnD#JOL?oe-(uHaUG z!~s&Ng%*t|F4I3!aypb8Z+4qGUpWDv=6^pou(cfz@*2$u} zlOIHof6oiXWo7BCD(7^^C)v(ZDoUlL!biXOU5I6D+ zg{8pT>tKy5l2d(H9SKL{JD7djVNHQlz4SY&Wb)hqefEvN*Eyk{r#BT!_maz=TmVDI zGmZ!ROQ7qtoZ5pL3!CasIN^_T(9=8&*_sWhhmvq$HPG64;pM0X08C)jS(O`@T0`sE&35fvdZ)>~KqH=&3U%~k)5-y<;K@^Q&d62^HllT5@|YX2txDKF zl7qk$qK8w7*uz4PD-qOiiT%u+oqg<6tip_7L`lp=*z6@$X@aCp3tF!dm4oA__G4eK zA77ArDjN0V%b6jUqE+F?l19XQ$F^6$RcMhRxFG6wF6XFh=&;S?6S}zP?Y)V(Da54@ zlon7Liju1{6d_F!@&Bp4I2B{y3?j*7=eZ_|#2p*S>sbpKvmd5gy#sW9b5jbY;*xwT zgg{}-f9E4vJ6g5G_cbjNjNTWvF*+nBU4TuYw{GSaZyD(7kWV17R#nDUc>=t6^b98ii3_JRjMP;*(FZG=+TdWKj4|SiC?)G3Xgp1 zRt@d6>VWO~)b+w}T2>+WX*%pN=isL%`}a3@PiWnzjV?BZNDjdX~piNsS(?d9hy5K#3sM+JV5N}WQTvUMF(b!5*1cqz~y)nY55C5-z3 z=vIY5!4~*pv8lL-XtIXt<{tUVbD;=@g8M50iz;c;iOUP`HMZnR;$_3HW?_Uc=PQSj zK+8H}nieInrx1mctW6rKy4NvxH=4GIK5P!F^s90_O&VALnnWS$t$jP|(rXeV1qy3p z$pB>Ihr-WLhwA4dDQVU~Bf`l_)8roGB**W`BFCd+nvM~UFQ2SwCEjK+9xY$uFZP&p zsHoB~4DbpBzrCq-pbGT{Z=ps~bSY6r%F{C&{KhT~e!dRmDuiI9=v!&EGH`TTq2v+rG3tV?p=6ZIeJ!i9_SEi zjR$U)Tt9UU1rJu|3!D04f%x?~6}-c$l3?KvbKMeq#ZYjf34o<%h}k(rK{$C=oFz~~ zkw49V$dbq|G_gVSYMv6Kx7$Is??sF5R{S1l+V|oTrB9JdX-Zk4$4YDuSe?ljZ7bA{ zJEd}p`DL2P&}eBZ)O0!Guw0x~kH?ts2R27u6vC^XSHrumTT!Wirg#+sOc7@}W-Cr# z@~{IAMI1T^CinA_P z)lFKsl97Rghub(iqg%3R-_JRZley?E`UK`vE*#5d=6k63VHBk#FZ7GF1j@}BcwO;& zsC_BQ59Gf5ol~j)B#)#|+UxLS1kTJ_WK&7XH+KkSS#=+lY1w8`FxBcd$Ge}`-6mv zUJ=agUhz5d={>ZemQGyh*`xf!Kx)&l-p1Zg;bFw?_@jP=2;T4r0>9RhbFg3#+FGIs zAm8*T#(KoKSH19ISYVSVXw{~Ka&4gSf<6nR{Yt|f9C>>S+6gi-T*x|DD(AqZ>`Htg zD`>uzFT8$)K|lyNJ%ZsAecC_7nI4|l zJNvUGttV4}M&nDfmJ1Gdt}h)>jA+ZV&GY5F7Y& z{FDqQjM+upQF^L{Ch_D}Q~P5T)4-Rd)fV?$padBGlxwH~-Lv6{r>$?)M8KjPom@nE z>zR_3J1Idugn`0w=ncY(+WNF66J>ysj_)&_O%)BG(7eebO;;ME$5!A;xkfL3*?>l_ zWfWWOGmcsK(2tw=O9xv`C|#M>0D24RzDM2wW*bRIX=qEMhW4a*Z%C+&EMrey9P;d+)+|<~=WId{!+gvudN=oASI(UAENCC{i(iO0&-(wLRYfZ z3A%%NE?4sL5z)Qa>7y(W_GgG#NwH|CfE4B%&UX3g2VWk0-`~Pa4p#&uj#6^|@)Sh+ zZ&U0V3*Ku8=7n!W5R0&rdm&c(6_%nf7Sqh(_;~Umq~3?BKM?GpU$P!-C+N@@7rx@9 zbFGGmxDSd-QwmZ~c&%fRp~%bVo#2W40@C%ZZhbkK;%e>CV<7q`x?0QGV_TabLb5H7 zTdxy~YvJFK!K>@L@t&_|4b{r@@X0|yu4Q8uC2}^JcH1}_BNVV8%;ZT6#xq~0U+}wf!ZxhUUzR!xAZxPOzt z^Av@Qmes^hu@tXIV)x{hay*YoRGCNNa$w2peOr1c7I%x#ZOa)LWY9}hH!Z}q;KQmYybP+YjT%uEkonHG&Qkn9(vDUOepcg zTYeJjIiCR8mn7cp>K{~C!c4)m7dsFW&mtWfv=2s)LaF{O%HJc~jrCq$ODE==sWA#@ zi?nb2(P>-cV$>dlHqsidK|d6QQ(iZ}03}sDYX2Em`HPqQ#Z{Q-S!w@+$+7%@u#Z{( zZ}#!u0L{O|FzoV%Cy-e=EVmMlwzlv!8E*}3Ul>7g^V3rPtmE|w+`QM@3-!}gJ zNc;zs`*#xfe;kziYh8aW_8*|!Kho9zSpUD_$Nv%kRc4OIeHY9IJv|^G>Qa^U8_@yo zFG5orq(X}8ropZLqGZrwFiuO0bE7)FgdGK4T$*u^7?A_ocv-deEKMPihg?IzTCe0+H=xYcC0jeTmF1}&?^0gbCzFwCr7bIYfWZp z9~bSL$l8vIoyu?P*pHx_8|T(vect2#+FQRGPhee_@9Rw^7Ga3t-l)6K0tTSryw|Y3 zJnO9=gTLB*4|kLwr?)rHCqHe>y}t@SUe?n;zAml3&$Q)w?BtyltKYV|9i88-+{*Pk z$aFhqB^gt?H0!(Si-RAkDeb$#Q$DSFj|qHb&?MOvewEoy;hau=fQm1Cyh9CtVVtxe zv!Z@H?F!<>4w2dhQw^D&J1naZN^!%y(?n@DUoo5>%MilNavVFpoL=AGJYOzKlB8rd z!$_+waKy&rOLCKMDq7|%gxwDh@4X$RZ_dd9CB-|eccDcxp|?o^22W?5#jKB}(Qjk{ z`?|eOr3&GMSYLg06tQ7C*qSIR^Q$wrB*fTO!N#Ccz#bva9yONzLGYBA4t`z1{N!}$ z5>OJ-EoZc9!aFil{Mw($XFBUo{4H#xhKhiJyjt$BiY7&dP|{Yd#`yT=WMY&%d1Juz z*}U|8g-rC>dTlxdN@jR!R*^mx?_73a4Dalu^1D`HS;vK#Xckgp%Ia&a?E~~E;mYdK z&D+L%t5v(R`Mg`TCi)MPts;2=?H^_-w5UxPw3wcYXlW)muZFMd9(F$&lft>I zy)#5w_Rpxd;>!`YYo%gmws^aJ!XybtDRX%VL2ak*dGi)O$ZxpvTz0v&NO-5SKUY6) zZEassT>ZbvnJE?7!jHC{nkmZ4Yr59y<1VxzH;I_HfZe;kdeoT(cxmz-%r5P_1X}y~ zCB^kfeht51_W*?+dE>IFdvwMXhnjvwZ=O$;Cg!_fP%kh@YO>ed%G27+4QtN{Y--L! z6SBhKfKklLo2Yl%^fZU^Gbc)N=ZU~$ePJ^N`4gjZ)@%lEE=*HoPYpZEPAJ09o4xwG zP6j8l2^B^%T~88I*sz+5h@iA2iOo{d221=X=XxNq&Z-F-i8d`+wtW~OAe1*;Jue^# znBf`e{5VVy^!s=NBlWwuMyf{f@x%ei1RTq1zZiFnUbp(>5+XWI{;{3Vq>QEI#G4+n zh+TUff|3u1dh;jHY+?-;XWvQE+m;c07*$WQ-*W2B$Maq8g&Mc$> zGYl)i;m|q>S%hu`K1AQMzK-(00^gbym1x>PYp;cG8NcdXCgIEm&Y?^cQ<0uCcGr)( zLw6{Ghje_4@Y@K1Z!!;N7WtrGyfcZ{pcYGbCrIyc0Uj_j+jSj+9cJA_v4;P*s>hpKu3Gl(Uf-&%Psa!(G%VT3|9U4%RUm_k{*p!0u z>^1!pWwxTQ`h%;~ADhzX{v02)k0l4k7H09D#h4g2QT(9L#kw_2nWn1!l>JjG+Sa63ywF8RgyG}?3 zjp-u5BOGySrHD&RM2s9M*7z1<{2|V*E2H<#@q2<0W%+ELUU}?oC z8V6s0auR6d*9_R56beH@bz;#+iTkf7wzLB|o6Or(kwDQRMo3lU_w1PN_;f-J%EYal zrDM`8s&9{LXvMOd;Y__VAxr!ycIK>;cvE>G2$zLrm6D)to2j-c>)AanHCb%iI=Ziy z4{%YhEK6c4kq2gdTUeNdj#Ox9=&wP|E#k2XM;QT>PEbZHSQO~_p)xmc1dA@K zkcF+&(_v)QW!A_eu@v4#C8{PPXRnl`T=sQhPOvq`?@3~p!ebDIf@lWHW$g5x?C<<* zPd$L0Zso7!?Clz{4=(nMRC^LTcV&9}m1~wGBjhRRXM}MZ3wNHZU@5g;B2x>m(KN}# z*{}ue2tX;|!<>Eo|BJPA3KAt)(DZ5Bwr$(CZQIsqowjY;wr$(C?e0DI#@^YTotfB) zjeV<^e5uIFs>(0F|3Bh80Y_&x_iN8E@&sCFUdoZ}Z$|(sNR&i~6=&5@ZLG=dz8*O32Kaz&Xz5yPjsTu?{3iSGJL> zG0jI$zaem5PUWx=SxHgn;Oi>YbPbt(CCiS6TlMZ$@rQI~QaqSvjVa%qo|0muoXtum z7zjF#W4Li z2*yoIwuvDbXgKornK}n-W@3(vBu&q|%47_Oa=4aTp&c!t3ws}qbSMdArWCUTS!=RL zYaN{>?>k5=Gh-2lnkV785#oKJ0d!jA*w9o1a%afTNub~Kx{c@sGR!{8=MF3`J}Wmx z(IjZOq|U5U7NL@c!RaRY)BJYUA+6O$oIzPOs2SBvIEj1B;Up2dNFFY_F?cdw@NKJA zGy*Zh#leZ^C^}@v$XIlkyFp~YK78ziV%(D|Nxb^kpL~lKIuQ)12`G^g#BA+q;2*0X z;lADznj2NcLKnQo3N|h|lj|s}xv1pOQ#w;+=HDT4<&~Ze+l2TatB49J+$Ot zq}h&ys7iFqwJ|POAR9U{s)neIId0xTg#5QMn@RH#ml3{qSXs*)vkT@AZ@y>tL$Qoq za9G1HwStzrw%qy>O>M%wR9uyjKiRlCpEO4r`oGHD_VMZpIyNu&2N~JWL>Qapj4f-E z2J)bBm~ty;>yr+(XI}yFBly=w&f0N>8o{78r#Lg75Hz$R$C9Vbmg;~oyp~mxPSQ~$ ztFQpbv99zwm4syxjs~gENd zy*gMwr_q3Zw$f81K-7>FEh@2oIv3NGSt;@J7lSl0+yt_wzMJ*0*+iz-kR!JwWjMT9 zSqYrJ@d)6kqqGyjp3lij=s8*`CC3n#uc(xejDI zdTxD_YLnxrZ+F>NP3E{^*7W)ea z6VD6%3Phu05GXDEB0IP`&lc-TC)9$!g^%32y%&hW#$}{(6CtfFL+4hDP19w1Kgv-9 zO*krsH23UL*cAnbHr&+OM}BzbGKj^Z`KZiK>Jgq4VXCAd)FMSC%Ub!l-jt`u2S5X8 z6=UkFo?^*$Y((deb194U?gUA0skBC(kdi+&>Lzl4oM~N^HeEQD463iA#4!C=1jM1T zcObuzRy2+%(1j;JABE($TnVZo@3uua-8F*@S%wRbmZJmX+@hY1*Dx7jZ56(MXvvcx ziv2=W$Da^B)BaFv6wKH{UvJ*+O=MSG&G{F7y^zfT!}bGXDaeV!nO*R9J}B;Pux4iI zDa7Zbwy2{!A=^eFB;q9Z`I|Y5eD|8F5Wq!!F-*xHsnQihk7x6e!2o)u0Qvq87k!VWOA#_ZNqvPwMiMV@G z)uF{&^z}>{6E3r_2f}F&F$+CFv~ndH5XfNmqup?auFrv<|4tNd8+Cv|F5t#Xh;#x&;KL z>I;6UT^Z2OS#8>c*PrG>sJmsf5+F!@@DEwF1tU{Z3pB%1{q*{#>S~T)Fnx-fkvy81 z8$y5oX_9Kz`zgYhDg)vGWkhLx3O>pY`mT;NCLTkPZJ1i7OW8nl$e-5PSN#e4dq6!ztU%t0{-HqmSw9unV5%AT#fGrR;=|bH-@rv+2(-N_UpOo z28C@;+>|~;v(U#_s+VTc+MxtNmKB1gk}fam$}nu|93w;vY*UFXbT04GsXduF7*e}P z1)}GZCoV2sIt+(Dr+Q9U!%@dsiCJpU$Xqo7HQmh^0V(>RwjC*AJQ*|zY{ZJ-gQBfd+aa_rO4HQm1^&*bcN0^Ue_jk8AeKz*03S+z*NggCqX4 zdkiIx&hlDOV`hmcW9CYnSv5A(|6ZY!*(XW>mN*d_K91JPduB)SE&@h$`CQb!F=)-7 zF7KYl62j8fQk^}e?*v-kOE^44MYs%b|0TEOu;r)V^5{@IuB;@bRdgzi%v^qeg~Z@m zs(-3?7{``z_b7;tDH2BApTle+xg2-OwTNs*5davT7N{kRrvpGELArTbfxaMXrbm`= z`&(YL%v!S^18mvlv)Vr*0_jY06RzG}d%4DB%-)d_?z7tg^oH_0VAj0HQQ*c}#O|5! zrtmlA;m_CvLk-SazUiMBSL%+7h2vs6)S!r=DmX1vU-+hEIFmu#lwXID0X7yJ?q1rm z3PyLzwzsFM+>HIPI!QcUVM&fzNi3?z2Y=HhVaiBTOnG!|e_Bh_>JQn)kx~o}Xe^KC z9&XoCRomAU;@1czloIz*77nzGoK;&(3v^t<4eAqu%1ra?FJmGvNr}-XY2z_9IRdr0 zw#7GfOFk$US{ao^tR0aAjow8MZF}peUaS2Kq+-9#`<+d%+NP`A8af47H(@SClktt9 zkCpyd``8l^`0$pL_@DTb#W8?6?xf|%7w}e;@wS%$S(LQk;^Q^J#`@DhpnaMBfi*Ys z5S&Nhk>)nMjl(aFX4YCkr#=(%@b*A)LQm}Tt(h;R9Pu%rcf}T%S!aNSQJ_z+MR3tt zNX(sMS1;uNs4gb~xxiOJ#)yMM1wrrMH3~1kl`0!An-0`5xgpTs}VrJcg z3N^eKR^6`*+W>NO7ZxFPhGt9g)dKZ=8h43oT4pq0zUBr_ji+=FmbaQC3tAw>(!ebC z_sakeL}`gW)*ZjsmdgE0mb~PSbqCLmdlimrp*W|2R#qHoMOf6`3(1)K`^Y+q!D>sw zRpYIeAt_E;QQ~P9ipi+gnH%o*%l;@puC;CBls6{9X>7=9Q;PPYEOgbs$b42K1U6p> zbn(#1+|<})w95cQ_8|**na}e5N(M{oRk8DaOV4kYc#g&E27-5DeQAF3Qitk1 z!r+(c;LK;i$EHwhrV(C2R@|R`+|I9QCROQ@CAnSLALKtiVM_pV433T$=*n!@NQd7K z*I#$v20rVE{gc`w*`}F9m&D}W>$Zd6w;Sh}`Oadk3Vy&>du+lz-tMhl#NE^`O8qp3 zO*vCC@P7-!s6s8@W~1^`W#Frx&@_D*Sgqz6csQCKy0nKz_)GS*@TV^pqwx<8i#xbB zoJLZS%#JT+C=7e*!JK)*5p`}&xHV5D9P#k@KHu)5?Vak9i$F%n&_j?5X6&|Leca7D z{S2bY0uSQ*y}$OhM&xETW>6DjNue#?k_{x~ZffdW0}bZU``HfGTlDluVRWhWH7d?9 zAwPllPFi5+ff=g#!M#1>><$^GWaWLiG@unJ7)ty2{pjoo&Z`8jZ8#h= z)Em3>RqU0Az;e%INX2=7TF1CZnD0u0i>{HEUUIg5eCaX-&?>Y(CGIrZk&jAZUTR|a zuv>C|Xm&MuA@wm4wFOaEJjypcY)V@Zh4J{hPVUE5SS8yS8AV{K==#DedPf&-y4<>BblgziX zYBw?`XI`=z`&f9S#fV2_(H$c#RSB{R@BEInNuChG;s~gN0!1S8%DNb16FKW9CAl5A zyBoWb)guL#I87XpU~(k*1}rI-Y-Y*bN%3+>7LHa_v>o$#?$qGoHrho}%h>eE@+Ycc zSEFOH|0I=t1_6b|j9&0g^EqI3sHdyHDg2dvt>@c{ST_%o_**!01L{(Xx4TzQANARQ z2-L%ZfCQlP#E2fkF^9))Ie2=N?Yvg|i}88tX&zYZ@90AfJ;Uw7>Q-J|;~i%PBx60p z9SL2cAaRKKqaW@9JQDX25_=Vbz9Rxl(qs!n;To=<&31jc40BvF7Q`tiVEscPsC$q> z;H8cW!C>zmt>kYc<-17}!OyQBpds^Br~ix){i|}3m7bCQe-Wa8xm?`b_;mkGYm4JQ zR4%grw<{O_Ird*%-+g+ z)#s`54^r|nbN7@%+^nc$GC3Q}hW*z<`dV4(`8crqJLCse0Dsb62B77vqWESKumy{P z&*zIz@8<+f&j*Dlh6;5%vgblmrMN5vWPUJkp@%E->d#qwO?%!os=Zl%_v^isj?di_ zp5ZuaZN0*$*gAFGhQ(NW7(;OOmB>PXJWJ=j*}fY$JW)C7hNQi${K&e zMnN}d%Z*}d&%M`glF}>6jb$I$#}>C4F818@?s`!cj>VQ2IXt(${<-R99oUzz61SaA zo-2IyjOO{}a_rlUk`XsAeJ!0d)`{T1t!UZbHgK1I(`;4K3Lkq5xW||#3fr!udD}g{ zzc&Rc>s*%3XsHZxcvid;sm+0EamqWF>(R`Cx>MXp1cZKiHn+SzHpfcTaBI1k%$(+hpu+ zN91mF@k8{_yA`bzy!~~m6^58kbF$@!aky1<^q!*nr;8l$+&C1;4w_6$=1WVbC)gv_ z_tyRR(}qs5en$!B;V-zwQ)#B8IQ!C15mut^HAwG2@x9 z@OgN>;(f9%Z*E!Z(qM9kz_370o;IXeXx#SQBoHaKkx;+_jAK6C7~v6Ui{lP4W(4wl z@qL;3csex)lNs%COv0cT<$wvKo50se3y9b_)yxX=a{Gwk5iA@-dEYL@PU7MLYXkH@ zi4}s;*0zxgkK)xK#jiJxD%QCgP4X^`CTTN+y|Ps+tZFQ`jw%?PeSLKeStgI4&Rfw? z3|n`0`Ea-jHt4P^^sRnJ`38{Ki+3!@AZq=A}zg50>j1qBzEpTPK_fAFKo(lz#YFz z216Iw53#Y2K-Vx-r)NTP#{CMbT;vY3fIfF);R*bGJawzpGtJ7tx68_H-l2y|no#`Y zDk!_oGs-Qrgy$XR?2xs&Zx&QR&)bI<^OB`<3pmB+b}aI#AN{A2`GB}`u5-SiO3hJR z#aoEMfu5SNg@6=y$pKXXFZ0yH5~L(%&qmrJ$<#~0q}&4Ag&l_o9nDZAxNSpaomWWE zkK2hyke-EcM0q{xKGZxEhG(5D%3MX2Ww733GK`qQ88YN|<1FYkY@+-%Y^}&WXFM8< z9Ej>PtR72|<65)2^_CvpFCUj4SA&r0f~vVqOkVYQNt<357V zJtyJU(Rk$G_L=B$aq^EM@qfb;jA;$VO~0GmUa?SZRzp6&GuoS!~eMu3sYr$uF=WlZj>x zenbiMSSl5hd)vTZ?hYwIQ%{28%Ytwg`Ug)z)VcKVEX**8 z_yz%w%mHTDG}7=U(9k16p}9>lr~fHtQ(KCb(CazTq+<^UJL&g=6=5HE4LJ*YBW`jX z-SwS?Q`Z(b=olp57Bpl93STx{{ERG@)#se8qyog^ZVEU7!v`%(nuPc`ZF#V$_(bJ+ zIDd)q<-W114!s8WCNib2QlCz5Ub6ri<5MrPL90$@D|!UU2_Pb=Jt6fQI}MrVEqcV! z0fFHMWSRHZ3lu?!JcY3wSLw*Hn0R>c&@P4 z<^lh~w)kWtFzhAbpNP-+@(xR4Mh#xRw2_mIjKJ7GX-6kQ8sbrTCQB?8FwUWdbCr5V zOTl~;Sz}P+3gNE^$W*bIR?ZAQ{ZZsXWS&imWOvk;j0NKDW!Cz_Op%Bi-rxjkX;S;# z>HZvr*w_epq08p7Xy2X@qLP#%d~V3lGc?SM>EtOi&oHH zldbxV)y$XBWQ-T$HzfT~h&RGj9fZNChLFfKW;7W7mo3d zV&iE@LGjBb{IZ!ov}sEstF493h{YB;C%C1JDzE@??ognE^^uSwcr$Igq9_L8%7uJ` zd4&!kgj`xneHCvTWYR$?7RK0r-T5=+7GNqS(A4Tu$+HZtF3#T;l9V?Vzn>#!0b3=D zq*)BQGT2Hf<=$ZMJl(`tV@^P7p?wBCqBz_dR81U-i0;KcMwjAm0aQ*$ZZ;^0LzfoI zhk^_?!b5T%H;&P>qXzBVj)T+cMj+>eg-P9O?L;o z+Csq44~w*y(LSWtD;+P-u_&#d)>6`;IeF1uLSKCsj;U^|P)c25X?9e4V2i-=Pa=p) zJfn5hQ}|i5#RQE$N^Q^f^hag6gj8;AN+usK4;gQL$3XfIa@O({T3I(L^Np#**Zy zj3k7VSWo>C3GM~`CVrh zZK$>Ty~n+OM2#A{lO)r@L0m(cA;eAs#Mlrjo@no+hxlYefh7!9{seq}CY0@}>QD8( zC?&_DFb)0(tey9ud90QPU1TD1Gtxt-NkY6-_^X+%UMqU^? zn3-aH2gmYPA!q%Nl2$l|=D30c^G%r)5oo)KsASlJc)(=-hcl)ub3qlk?Yo0oVK&|m z%rni3&x$ZxI>rsO?*5^yWd^iDUKz=-qjJ@elT&nWE;Nb0g^g+KZ`XaYEcY@~y0KtCaa6h`?}aXxNxqZ6i16&s0>M-EHCu6 zKun1aDqv}jt*3CO*K?c_G?b63B^V*|?kR-eN?nt0#NcuH_a4J};7f5G5+-y(%G6<$ zp2Wd;dv~k7C@5;A-58D%_RNJX+w<@4vr_vHl>&N>KYwPTsNy?@L>Buz<|*s#_jN{*9%r2@#SA}>XhHA3J$%jy&cs*-lzG4`h>-1q zy8Po#tt|ALOLGM7U5vzBp0OO7OKxy|Z|ju%a?_)4SD$c4Os1J6!J+pI>}TY7Rdga? ztjNU*liRihY#DAh)uCpR%0PJVF}J1NNbkbSf=C_}nLAf9keE#jN_>QW-#mf3A|nsU zm^~{l%1Sudo+vRQL-+7lzJCZ=zY1u^hH+8I7l&RMQxbxqg;!(w!C&VUT;>RKj#>DP zx!Z*fA3a9z*C#-4He*nVh~I$Lamys6JXk_Cpz6Anxl$ZU)j7l(Bty{6$6U#@A$L}w zj9a8LLrn~4)0A3GPfH&<$jq&s(qwwxe>uv8B;u;hfc=~SmJ6{nAiBFne~pPA38ugR zo=8q=dNOWOHmZK|wG-C2(Px+lJOxHc-BmhxQVGTH}WeE&pR}|H=nVmtSK~uOM z+obBT9HVZg5(*dOp=Gv>IT<@KUSNb3sZxAC%!2kJU}<(l;3)p2QAOb^6~;)?yeO#u7u-Id1`b0N zR(frEuFNp%L$CX!h8r6u$^&d7)&t}ol$cGZj|9WWi}3ysVDiw0BPcnJDq}U1+DdG8 zd#vmGBIq4OETxm)6@Le}kmXvGAv+h*o^t0F!5&>$Ey3Mss-Y%OE4z3`;17}90YM_PduZLq`^<0`>5^T5RrRR%cJJYuCn8uJ=}ys>SBGRc48ul z1?N~&ghnCRBtcxmUPhW~9oo=UGOfMP+HXTi;*g=*mHFUY8z<0Ia`1aa=`Hhtj}3r_ zkNC{F+jj+3mH;|y%AyhkKHdFQ>WM6R3wGp9QQJPPCyKOZ#m^cT7`Yqhw5)mh>MX7S z2BI)>Gq9FUCGqE#*mq(8OcBDn zB|gr3x@E*Nl1my8(nh`dPR%Y`=scm!Sg8$GJjQh zH*^m>*2!F9**ckJe@UxdrW{-5XsQpWI@X7V%PMjj^Ug=KYxildg5$x8X9XYyxb%!h zkr-jKxkMZ#d$^{Yo8%>HNXD^?IFBWji%UeZr$xppc%-e`7eu`}S91%&02()jRK5@p z2l93&M7)}EZ|>t3Iz;N21uop6+jXWV2`O$=Quww;3%lN(a0ARpHuuhactEA~q>%VU zG^Hx-1DgeFve%DEN(R*xiX!8>xcTh?~+fUXciBO zUjX+A2P(sT*|y7R;eyLE-~Ab;g1WRY|D%bfU%2Ml-G{tU zOe}^_LGKatKJtr6jv7qv)AYV!ki1wYszFPlH%)8}`@~|%8h_eW=Af}A$9C(?85{=(D3-CglW+Rtf&O@rZ^5omnLg}4h@uqjy*)51vSknDB{J$|Hl5eE(_rL`J{`@KqS zP3_%!IIz#VG<_Z)>W5vKcs4mKM@UZo{cQQt%Z}!p;ey6NGe2;qdG!)SD0!zc88Wqo zs9)f(o$A`gna2k>$c79z5&&@XeiBH90p{cMNCdJ0smAtow`d7&nQP80PEk$p^G5+4tQ5f4g;TNL64!1J9LyRIt3j_?0}Thm*n_9vdks2|SAJ|BcCmsKq8A(-eUG^L ze_us+xm)2YXb7AaGUsWfLwO7`BncUr>1&}=HY8lePWk6FXXPhJyc;y1jw05c?q*Dc zSArY2buCFFSJm}DW%R}Kildk`UnUZdGyE=wr@Na~!=0`Zfkb-0yK!p z7OXujSTGUd^{VU1zoTQrhF-uwx@7X|Nyoqm8#7h1r{I^4*S^|00_f@V@%4R)g?y2m zMIO`H;E=kwso<$q^tvqVGBfb~y0!oKL!|>&N)ld2hKVyO)Z^I%wCtlKy;t0Tyz=f; z#fvw3kiuNzIyq7REQ4(5D}m7Zi~To?LDxI7e>ClYM-R2XUaQM{g-!D)c}g+5ETQQg zFE`Kckr5K3Ya74hZ-ODgM~acjlN-A*&XkRM5OvWtu7E&l`&Vle)E`g#$oynk6Vy*v zA9fRHKkCQQ>#;MTD+}rjm&t>8dYLgb+vr@ zm6%-4JHQD_51$eBYw**+1dQGGp)P}%*FU-1H_ImmIlhBHx-?4HANh_rKFQiYX9GML zbeh8k0*92hu0!E5c-PyTJzYH;MomrL2+G}C@gh4VecI0A%+VI32w#t9Uk_hghN%^4 zG7dp?Ag1m0t2?iCccs0Gw|e(We~R~(H>odWNea}htNI^8#T_ zn1<8;1XNhiG|#NX1urmb?9yMkWUar}=t%a) z7rcCkQA}x99Uo2#_aauE_`RGJm^P+K#nIgw+^pnou{=ulCu0w7Luuz-Y-SREd2p<} z80x$b&WIlULNc4C3*|<{^!rT^XIA2r*d=|q7K?o=C7f+e2KK=i*He2!hxi8Nz4|p~ z*7msmya?IQDL(d@^MhBs!xa6WK*4|Ft$*M+R(3|le}jS?{}0+2$A8eq{>jt+TiVz^ z$Nv9-f(-wFf=vH}k$;)szhiy>H6r}?6_yOkZD;D^kkuk^8Pvk9;pdW!{|$OyL2k10odWilG8?;5R(W|WvMkpS!ipuY zdgm*d{!-=f<^BGCJu#a4(JG4B%8ik88?lSYiSc!Fs;p>NZTi@`JO28gIPmWEq1Q=9 zNyDr2&G~hxX1$!Z{9tP2K%&JihV5sl=cv!l7TCsHnAhraO#5jkxe#yjjNq#!y45!m;j0EpPz-jm%^;&&F?aZHfo0Ce4tD9!TMoxJ zSL*@a=));n1RQ30-cpr|B9`yMuACL=XLfdy;5W`JYfTduM7_Gbzmx+wbHjU!)o)+x zel0EvnSf<1`ZI!}E2#~$qWfxtY;#v2Y9b`}t16YYM;vh6Ms2gRTGd9f$>A|$uQ7o2poYctWK#j5#m!)?P5gr_V zyMNq1U4vkTQT~%?2A7dwQV383yc|E1aB?UNoTsvk44eDl6StKHgmAz zr1vCEm27;>_-f_y&@P;U+G};7w5GgLA8iVh)$5oT2q53#U1v*$T7QgV-lw9+;oanP zBm3tc>Qu@986D&E{dx>xJTX|8)GEj?#mm8s0Q9J!66(hwO3b`Cvx8JGC*g=)CjxyR zSV0WNG#O((5N!X^P8`C}Qqq98GE(mLsFtFpFy~H<+BW|j@ByIHSzK%iBSiFIyAKQ2 zRS>I?$NsZVNiMPI^WSM>E7wW zv9M>tE6`YV1F@ntIZ(EFAbDy9#&sX*=%KpFy|wlGRqnBxKeu>AWrH2onz>Lu!DdTM zhb$d?j??*&Q>OVTc>3>g3v;+ejX_GC5DY9m^vAAedAFfj-mUMlQf|lfKo5~<4RyQS za!w&Vd{7K_HR`x-P_+g3)%Fy*7`|ls-jXB3cn5Xvz2T9|u*H4HMs*WFSG_s>X)qwN zMD|p*IeeR26Nhq0k5lc~B23xdWGY3fHKokuedd1ocFP4)|Dm=d_U35zIcJG&R4z89 zwQ9Nh=XCL{6>?RX0}Cq|J~~-BopeO7E>fYSU)W-QXY_Yn=|*l}!QLOSFd#Im)aG)_ z#KCEHdxz?El_~+dgVLij$|WZmDl&hq^g6|p`4(9}R862L>hwOGJ?3ekbd909qJrxB zz~aGG;Li)i72wl|2DO-mFn|uE)iV!Ka3xenb`%o=;7Jzk(UK8nS6-Pl1o{$Y*1js? z=_VkLabu*>n%GIwSg0iLaWkaamEy+c8Y9W<-P@r`RsfYkMdD_NRw}0rU`r3x{rL^x zb1UQ4ENq(s<)mh`+ao-J}&_)lnxNnhiiR z(^ne97Vvfb@3q$DwP0|DUl(byRIpW5l*YnUNIdlpMnd@*@_wmwX?WDwEWJ!Ws!ASm zE@Ro%d~L>>-uTvqYUDW1JBxKA4*D1=?8o;V5{H=t10B+0adAsBKP|ITTJC(kq#vU| zH|+^ATEj-!01HYg$2$AzO*Z{}z`iO&%LP_YMfd?Ps!LN67LxfOida;Xmm9IS5}GFB z-&zzXBfpq}N^@fUv^JECZc`B=kPbV%A-8a5)^pe|OjgMsN(mJLI3H}3g_wxqS$-2v z!VPqYMJgbRghRo#-69*RPP{eSOfWv=^-=>!Tj!KRK?`?NkI8jhqNs$3b+isXh#6D! z3Y%&#nV~IGdOdY}He6F930`AUFww2YSF6O00aTe~Sh>G*+9yCMOwm5%24<*P<`>r% zZ8o-xirzv?l$CUuC)L0;xXlLpIZKnPUf{Uyj%o+er_7P=@b1ciILQ$LRx(861*8oz z5|2%r(oN)$fUrPKb%O>zYgJ^gUc-i%7Bv8-6ED~0Sdn;rWRjms$Fuh)v{r-WnS#AV zA6ZbgP8cc+wIT5?;(6CWE3LmBO*a#5`b!L6_&Fek=}X})#3~Ki%Pgf6@p3#;>Wd!a zy){vrzyz-(;NyYO*mBm{U1mAfQIo=JN6#i-%830lWuysU4@==6+`_HQQf2INVIeIe zMSC?4&N~SQ%9=apRCjFVqccNmY+<`4zwgoUAJ^DBK~~3{fFpX$28h;<{I-nw^7ydYUB^B-f$q(vA)I-+z|@F_}vYHb9LcI5pVT&0ZXU zwlR4I?=+p$Py-4gpyfS4R5zOKvxBg9ZF~m%x2x}lpAEiuzJ2M#o!Vgc?^dD917{kc z{%)8;FSQv2q zKu*wX4>5Al4GC+AKO6YGdWCQp4=q`gr5ifP+e&h@Q=!h0+MGp@@)U7+oyPcE9$n!9 z?C;L|7lMNv)_SA4X;P|RooRKp8cu(YX5}Ak$DAqj1!=w>bwHe*We*#nh8IyRq_HcM zz`q7E2($M$(*!}cAR#6Kza6?P)M5+>^5+^=i2Yo#4C_e%!J@bnr|%^a6SO16kYsB1 zWp_`BPmbb78X7S=E&S#p1N)TC@~7aAu>&ewUjT2(>ynbbp3cfN6mZE|x>j?$vI@xd9(?HQxvs zQads24;nhz1^C__^%%X#=toGc)&r7_uhre5v{ec(DL+j#mOVvX52Hc~d$39~Gr5EI zx?y$)OT$4>8%DX_r1}D3#^w@UzAeE==4{1?XE|S`;w)fz>||43?KTmtONLnCaB~;h za=ZxVDvc`{!t&(hd9S5FO5D`IY~D#jExx@K26r=FjTZO6a)Vj%%74U>HJb^h@*H0< z6E|%|XdQCus%a~T(kv3tFWO&#ENOw_S)Lu|)-5>YUH8#~WkL!Z8<*dTmS zOl@B20?T!c;6`&{06~#0DEF3ul}9BB)}~BT^|o3jAFvB2k{9@@BwjhFrYeH{=KyZM z`&8H1TxnuUQEX&+^6vrW^G+#UH|iGz&`DNEGD`Qf)Z$~+8sai71*t^>Us5^u;wIjA z-IF|0)S_!|En2WVR0+L%sT(f5dj8ET66$$pOo&Xc_R0-&dn|3fn2Ahc$wt~N;Vd8k z%1t?pyTo_*Z2f3;67^3>>*-clkvjwGEXZ|9tjXNLyi)t&q_%WArjBXyLcG8aKdFh0 zr2OC2YweMOlUYLqrmE$6xvG<%`7v^;6yc0~vjlh50E*j?ApsZRIOO$87)2KPzxmW1 zRRPx0SJ!e(3q`&_tqO_37blx;un~PEk9|>IB1zo`_Ey%&T1f{EsS7p}qmAgsTrVFt z0Qp?qw{7E>MAI74S5aZon-Qg!lh2NoLT4#($L^lW z8iu_g`Nc9pNo%gT&n>msh^~}$&~Y7p zaKc4y^T0;RG*OSLf!%f$xgWbxD0GR&!9(RjBpvj3`xt`9n8RD=b|xM%jbjsy^`1gd z#K0p1`Vide-I;nt<0_A*>@v06@g07zs5J#>o(Ltr+&yHzvlnmfFrt=1e)O`H%CWK7_cAJ6N~4F~ zL3nTvWgRKd#mv?+d2nqW?L6l291l%TPgz||fF{cZX}#&P%g`B#9;-6&FT_P}tBOXy zZ_C{D2Hv+2wQ*iX1u#F;h4YFoY(*QA$K(*bBQKl{e1mydjYCfI8R(GAM=y1qwU`h0 zDDg(~2qu(L^<|rtm3nc=MAIBArE?k1VO*-U)G)Uyw8Ax+Bg_|R6RK%3nncas(d@3t z>CE`yTfw`1?|QsvFppxgseC-ZwxBw-MiM>{92FcHF&jtrzH6S3qaBUTCJXeNek(@T zF^jrA*+ii8!jubyra*E(0ggsQUQE+lEier>jhMgm626oBSe(=ck^W(|M0H?g(2z_s z(>lA?k#B$sLz_b3B%D8v;DMVtu_P6uVt*R6k980WHSzFiVCTQ`Ub$!LN4UvRNS!bU zq?Ol_BIyK9?H{hX5%JRes<{{jY!YvZwU5jQm$fe#gHo0|Z^o7Ei%KcNuodaNiZ|C1 z(y-Dm)~MX%4s+ef+;;l?+@L2X^q}GHP@V;ldR2^+e zSvMzegzcmuIx1Rc3?WcJGf?|IO`V08mIZm7%qDmM88u~OZ6R0ySw`%J;CH*v72^Wt zCJIdpO5Aob!TqHYQ$JJJ9x9AX5^_A8&6p)=Ay~&qxGJhNXn5P{9gx?I#z@54-ZpU~?Y(S6)&eEwmRZ?h5C!4BHuK)_BbbSdglREs8hT^a z3tpLMY{ynrg%oM(2X`|IP~9N;aJor+%j)bU9G`dyha*{_+|GCh(53;dQ9zlk_~;Rh z7CE1^fcl^Ylijyo-Nd&{|CNV$Ee4$&*mlFMG!xtXW24}dnFpWS*X^&9wsX_!_}syn z?5U+AAB4&UL#qOd%16?J@lW6HYa3n>)<>Z9Xj;8QMd{-p(1Ys1F)zJ*ca1;;E2ZYF z<`Ysw98@aFJ6pi9l08k~M~^Uf-E4vmuh^|P9VMak=0*(*R+~ctXa5c^ahAra*?y9s z)ZN845@~+KKN4X=mGL{e*qohKM@xp#pcSNrSqCNb*g&{FNn?$zN2`yU+0gjB&c7Jf zbZ=)~kKD}S8RBYD-WlBpK8mxFx%EZwIaJn9XpIxc&G9%mVyW`8EIG)n4iYvvX7~cMo{J>5C(o*8d-d;Q-*dMhBQeCmB}XCR>6Y>9 z3Nu7(ngi9TWaeCDL}$_o*!;v8su=^6SOH3~Ex{znlQnnI4(qjYJ3F$YXx}d~M)b%4 zQaD>}EqX*aTG)gNNBxAb2+5dssxXr;C_59KmFuep__cKvzBA`MdTD_D-CbEo!%@1q6#3w1$=)Db;$$yC6h)E1Q@Vqwv>4W zuy4+a3{5yP6s^}ngE$g$9J$UE_>$c4!dbZ(;Bg#s>KTc6kAgG+KNO`2h^r#@Od5cD z3I(a0olav_Lp1K90~univ?vT#E}c+Zr}@ZHb=q|$d!G&nM;1y!%icIXz^rc=xx#p1 zwb+jO4Bio=Q;W8gWGqf9fgWjc4m-4R^(*p5%;s|fu@!QUs=BC- zx#*g%cfD&^(-m{u(+KCrHiUHRbiWyiPk~Ma@FTCdkkMhXNb%L*b{(n8k8k~6wDr|umtyp^*yYac1#%en&b~7fg5ohVed5Rk?+DNfF zIX;K`&IScXrW&(?(Lm`r`}kQ~EMtYzau_!`C2=Kf7YZ5XYC`<-UpaAyX%%~r9rda4 z)Z3M5SZnHI^vb&Vi_4wAh@xMDfDSRjuj&Z;*QLT?zMXkxw;rw-6hDqyunI8-n12<; zWTA+78t@W`K=_juaksH%6+_HB0l4^#kL^uQU28wd_LIPyYKP>tvnV6p0hzr#9#VDA z+F++0tQ4*gY)!r-kn63!qq|r=dyldm`E5F-22F1IrzS3nYEPsS{!Q54MQ#W@cu#!_3Ug%uH#f@hiR8RXtrZRqAPJ z{$AZLLRX>CmDWCIFFr&uIuqpN&IQpe&3(e{p}@@jQHHj>-EnmbQrn;$S}(UWRpY~R zOtun7==;>$VpTqGFk}%@7G{%;MCx`}!ox0N=_5br!a6FR85WJ9NBq$^1KO}EQaGD1 zf(3h9c1hKR+7~iWET(%}NV>P1U?H1q2^3LTFOOF-;|Tdw`@yI9BrYIqB^jtQXS z)^*PN*m8V}Lv}t9pZ@5=Q!$VqzVV{v?_H4&%zWfhaK9l`tLvr_on?jiHv$19lC5bs zBiJ=_rbuS(X7*m7sOQQCH&T4kTZGqSA@?6JUGTp?{W=a>>}=c;;o}}z9RI$g!}-6VR^t5UO3uHlmHv%v|Mz(Oe=Ps{|6xhz-}~CW zRYU(1#s8mJJtG6dKQ@v66&(B%)_-69M||=9p#PPns7ZS@nzSX!d%6Zn-6s@eBX0*~ zy~BN|Dh^I_3uY$JQ*XhkWZ`gBM_Gk-^gieQ%=WgmgEX+0C}Dyo3eK$IY~XN{y}rx# zbHQu-@AEc=5i@PQI|th~%XNltxAmWsWc}EqFK6HG9e%uE+4G}E?fVx@$7S~X){o|w z^SmVXN!Z!OO}#IV`FAzPxAmh#YXqs#G9?Ra!vRndwo6?bpslSfmNxURiBjD(--o7` zd*40X-LKuRv+c2*j3FDXW!l6RE%t2hgYd>sOtJqnM*d=XmCN!ZrzM&F9hE zl8?K?YoDi(jHAbEJ#wT}Y861+b)qVhjLVxCg9+@}FA*VUU;2hUliL$_q7t0nBK-bK1VoC?^CRI9NX1DDz{k8LDmWI@ zCC|eea_fkH_e1ecs`*{n(ZRcJ`#NVPx5|b!_-cvz7%4I^_b2=z0*9y zF_tr8mcyfi_(#W3cVfbXT{%4B;-3&Mqx{g|jiwRz@Z=46WMz(|CA%jyrg#rHS|?M3 zbeK395;rKy%-;{xq42dfGoUG zsh>WX@3fwy`;)-EJ2^v!9_!S2(q^*{_aL6@LhBqJUkl)HHKV@<1pGB18*Mlq?m}?L zkP=P?c#KQ?{52vGzX0YCgw|*MgoQx@H-*U82G`}d zj_o!eHV1n$S+4Y3%En#gxq)lSC;C!C$D}43=|NL27s%iJZEy+SQBsskfxoayC#wH7 z_2-x2Tr^(Hu@ZL1V^U{Iz?XmCHOEn0M+;E5k3q&-tXhF%x`Q4gCt(XLklb)ixwIf6 zY^cf<7m3<=*5={fA{4xX6CF>phu!ROd!kbaK~P>Umy@NUPFsx^$7(HI(BQ0*@?^ zqBu)#p#Of7o^@(7f95b0sB^!0$dCl~-4fbPA+&eIkatJ)xPO7%Szz-i>m;So1@CvE zp=pv-LJJO3>&J2eRj+&HPG#V2St$w{CtSQfkSR0Nr%udgan>0kWtkyUX`$=B{K$TxXFG5qBAr?Kyf6Vst|~T zw`O2MN6C#B(Kbhr8q^lrlnJj8;w}PnZ8SrMI<*j~a^@}x4D$iO#mESlR$(QXEf<90 zgMhhsnLWj!`UHNCh{%RXt34R1HeSX^E9K?=KqfL_ta&}tFs4q9_YEkyTnO!w>`C7- zLTik?=4-r&9&>?yI3wzaind15?r<=1Z!^WO_7ly9`>n=#CG%NePmIX6r4H^>o3jVu zunH@GF9~nZw0pum$X0+M6~d+^M8g-^Dmw9HmDo~#CJ&k(iv`3HH@JYWV3yRN%nRl8 z%oD1HC%2oN^js1U_hbL^yM%~V7*lx^<`t|8uBRL!%EKnxInN7Zw zx#QrXK`+>Br*{cb9#X81h#G=j7&5S6y>T%7dzinRoaXyCowJsr_!QC~-5VxGY$uZd z`c)($J9CmGz$TetEX-uen=5eal=q__p{Hc@#EHab+mSk8yylC##MEF&Pn3eAkHuKW zl4GDwG5e}@(EbapO!4eOaTI|S#37yK{wBz-9&8MDE;cZq*dob=6h8j36Ws|MhuEL( zyB%mNXcocR5RwOO_)8osoWIhj0~ZaF~o4QJd@($+7I*rM=!fsDkYhbeWI8( z&vRHxtBnBvX*JuXiTfeDE|eea1}~#48g9s`5|FNjB*!n~hzW_>IxNFeWxwu`pKhbh z%3^ZHhf~NRFwGKPLCzbEL&~5EnIe$2FiuF*I7J2RJ8CpUlHO1GgO}5pBh5 zWWE<#Zc77dKyFn@sh5Cs4l^|-N|VO+rVI%bj0%P|L9iHk{7OvkVtsyL`p1RLTC^+2 zQWl5l&J7F`ESTh&6-GJ!JlNhyo?(0Sg0N!l4BnJ?!N~wwm9+lE1@I%!&V9D6_c8!3 zjBTb??<{3k%oB`ztUB^1x7qxov6h`hkAXUF}n;_CK=EL zPJni*M3NP2ha%2B)EbL}ZsW10<&m?Dm)NV+Q&9T3toW2x z9G(A;OvqOdQWdts7lqFVaIj-3LQ~0m>?OSAREWr|N=vTmpF$sj2Iww2+A} zpqCdGY$U|A+f+pLNB5?M!;w-~&K?Hh+itQ6tSX^S7=R7iVbj9#qE_kjzav<)g@I$T z-~6i)|1DId`5~5y$l5gzH1i|n-J!N0TFUF^HaSDygfNpYzGIraHWS_-|r&6Op9Smer>Xod?UBVImTNf;wP}yySJ_id6w42$s>I*o| z@elT~To$4VmMP&Y%b$u8O!67b*grL;uc{SV+~yWCWJth%JO6&kl+q!yKo`L;rolRP zRaIalrY;D2r!K9BLycq|~__?lKx)Ud*6>$$F@hyfcze z4QD)0m60IS8{A>P7|&~v`dh1+NVJ_qSdO-gr8R>!H?hp(w+^n^0y^x7%evh}L!58{ znzAy^0ROc%Ys*jB5=65f^r-w(aZmmi` zoAN^8Pdv@rA_6`V7X-h+^XgLmd#cWS7Qe#enCM)IBCPqI zsMaO5#CHFk=s|G-gg>QKcM$Eifp+rVJdu6ehisIbc8RU`t)ZDRu7ysr8tx8gi=!1a zdPblXe`=r#&^Ky^(n7N!@Ebk0f%4k5712xXo!)=8$4@okUQc4YveYaiy=^VMX$#XC#0Y^7Pum)6|qUT zmu2j*d+4h6q^{!nWYZHb6L)Lrb)S`YgqF)P+z7U)Rs-RkW-5!9PPK^z=f{3yg-MV3 zBX6B!%_>y_^Q*wf*Zm4!RL=Gg@_y(Kk`1RLrAy@AQW~*zE?Sa!JV?~hx)0(T5Y{Zk zgv^4UE^c+2uYRX4X*ADdmD@xOjtq<%q3Fk1s3?#$2i8D+@idf&J&B5|aH@>C3@2R> zzeJ)(Ur|!*tSXtI!!ofp-+=7qQ&y~$NPT^V1c04_psrF~t|K?AA9@cNNgp0+mD^w# zj(BdS90=f%(cCJacaHHz%ntB++^&YSQ|o&VlMI{tWUEddB)tl~pPv`EbVvwO6GP$Y z9v@lPWS)#)XHFiCmH=UiLVDLgE#$E#oJrxi5m5l(vcev|7RZ~s``M>H=^%VMymrxL z#lGDk9F;L;3YL6y$g*mnJW2FvQoH-5jb~}l85_j&g939#hY_k2Xpnm+j1f4i@5$A~ZV}q?+|(<5R79WgJNh~3neWC8YWoN$(HkDnQS{UY zZuI3!vsD>AO**;4swU#!FWgi65a$p#ST#0CV6g3DUKs$v3{X#2`}1h!eKz&FeVvp} zZ4~4_3ndpt5H-u6<#e0mPkZ8AWr?i?g+0+fM3AID2`r@!Da{rRm>Anit06WNCj-~O zG7VwFw*!7lZLlS+q;m$2ywOzmTc4lm=~n#(w-SB;#gdn&^5#oCYQ7MuYv(x=e@7J3~teN}~wzMIhI8^9E z0>U6Xu`a?5yX*CJOzbS%N2PzUVDBGbag5iN8|IXL15NKtih>b^_dBOHPXVGfJe-T9 z#GvC?-3|bV3NgF7nFuZH`uKFwvzK7xT6`u7mL(9zz^z-~bQ$oDDZgDP45EUPEO4BCO;oO;Z8=gg+{Mh zCTv(qyKo8PK@e zmeOTMqfC$lP(*;^Rm_*0m$z7++jujKzc`N{gHpvZa(n-$8>BXm(AILU9H2VpN*&|< z>Vx$Y%YJm}lyj9IFNcqp2uybZQAG3RZ@gIY0pXQw&f{ioN3g-RF0GTu=)(|*2!Ms6 zA-tSthyMCZWud@MM$%|i=fU}vQdodRC%}QJ^_+u-@)PV2Mai`ebW&F<~N1ek*)6X~>s5%Q~aoe>xq1Q2*Z z9366f{k~EU`X!h)W?pleWn+Jtw#OFN815{o7rL-vu>-$zRSf{FH|7>>Pc}3cibl_T zNc(vJaJUOjg{gl{qh7i?f_P~Iz}0q33l(j0^C(P9SQh;88d#ZvMgu5WXPSYd0to#C z$FQ($__CH}_6C00Xf1t|rj*o95dM=^?CPG3 zm95brC2@gSYc^g?#yuZ~Ky%m$LS0z}dx&>dHj?|X8mUXP6Sm67c5$@GcfFxNt#zTP}?D z1xgQ`Tm6S!fq;Q@!mmf;0hK>W(*%>-JUkFEWvtyWb43gZs#p%uf6tGB0ndSK{n+)B zJUfdOPwjC6TW1WtNdO<_A{=7OR|fv-aS(!U<*Nv} zC0}4{RZG91K4`iRUYk~j8x7aPLps5XqAnerA@1f_ne@5z-4eOw$Z*irL+vb4o-Os4 zq*|Y&^^enlmUOKCt+iKs;J{1CMaY?YXXxjLajYU>ri`EFNtLjPa5hm*2(n+WpP` z!Z(o34FNZ6311(OyQnWPit~vO*GLA*byFYsxEk^>mYOwzO~>`YGvj6Ze>Q2Js-8RK zhNSGp$PROFep6NP9>iFdjG7|d=-qS_T8$GvHMwiAamHLmqf^5vwgeclR-4VFQaR3S z=A+ZbtWTm#yTa@|SCN3!q|Sh-4fK3CXg*|P42@#F3!yiRRD9JBV2l(F2bu&m%M;8o zwHoM0v-Q{uf?K2)#dIbG(NL4Tc=5Of>ZOR%@ZC``91R5Zj)D#}hv3spK;N~QT^Y>L zr`e;q0WFDOt$Li!YPn)foI4cTNT)#>1IJ&PkpjKM0iRsEIK}H%a zu)U&yvugH+LG>F0#5#G}$#bq(fV0nR{%+jV{Zi2_3c;xIwR5rh&hQ;@`D>ccL<1q( zUVMjF;fO$HbE5{Qw9TjV?1z63Yn{sYqxwZp|2iG8$s{jD zo8q6mk#e#3C}(Cq?Ez)MeQZ_yaGu~P3`WYJmK0jS(lnlL8QB?iT$2?mZ;*Hla-`EP zd5jsVm>S^0_`mh&Btz8n>zb``ktD#?IwK|Q1?ZSC-rhD|Q?=zjk;C<;c};Gx;L z?UIHQ8!RasxKjsBh*_AJ{oP4&MaRPH0QbNn;TSe_Ht@h3W1?qKS@+*7)X8`|XRPMr z-gQ?`Md`t7Od(v*r1rqD4ZI2dUS$kyN5A?@5Zk1D`IzOE4KdC()FPXoBT>RqFHJc%O1*)QiZE*BAV4ZfTq3V9^}X6{i& z$et12&+hbu6K|8gx z`=kC*9QK_z{Ew*RpTWd`Cu{lV>3?My|DVE^e>iVAS^v#O^Z(L__J5C1{$sZE?-9yB zO*Q{jgi@8Y8I3<|KYTr{gvZdu0sCh^?doMBiQU?sVLHL?dG61|mJu683S#WHNn z^N4LaUf20);xw&n>y$TyO`w|M!MFUpy`ntBcl*o!>&bicYklmZz4wC9_Q`kaTlMnb zp^IUxk#yzzcFz7*P8D3tc*RfPOQ62YBBFg=!++uP=B%0cX5ss>|Ec#{@$uk$zg>S* zVJV24GSV`XV{IK#%`bT2`{qoK#7*>B&+p~lRPz*KTiwIswd?b7WnudiV)=Be+nV#W zZ}Fx3cJ2#HI7-w?x1P_ejoH=K{>k9;z435>q?6HhV!ccwvE8~U{CbUNzb*R9m!HJx zKwu)O?KA>LIg3f)qwDKH;A7fX@2zGx`YZN$wtJe76tAok$#uklB6z8>33cz;ad9=j z33Qt^v_K@$ZlIQ7q#p3{eB>6nS`WL1>?blpl4@o4zN%a*s;NS`qvq@5*5UbfX2HIk zX#WCNehL$~qA34$F!FZBl~UhK-8KhD2{?ahkt!z^{rR;1Br?C^5_Gn>cQf9X3ue7OFnLdyP92lhtvpkl1rjB3w#ei6Kzv&22z zcl(oKeZzX7yBz0xu0!1K-2r7$78WZ>P?>B?tE9I=itAOinfA=WZ_x%;=TKHNw2Ke? zfC<9&K5FIkYmC=2_Si*$3JG_rBg z&MMrJ^mjA{Y9UWs{x%XdwtC;X208xri=Wmg>LksZg)~%qi59V>EF$wRBn6l-P$dDg z8{ST7Ja`dqh3-(JEvu7eoR$K=rWJN?pGgH#_6Llu1e@Vy1J$cNyZ7gV=gYV|L|3Cd zwL(uD#kvQ5(`He@tCi_AR?AP?37&^y8{Y86!sKorkIajpu>pW!{gc7dWfg_$`^cvj zS64*ex0_phwCVXfI6Dc0o}dygw>&aNY(O#T(C@&_bHHJVhx3-QBP^$gGDedN$4I2G z<-h_*%jl1YgZe7kBPh$f-_Q7UoSTv(8Xj>(>fgQIrERbH~Q{Fv=@W8 z1gdzw771^Uhe@jG=^d+)U_sWv;-X_}6j56#G=X7S{-()zXi5>{{2wGC_nhBG^2Wju zF5S5FUeYwTE@IZI9~$!-Zehd^Y@-2cEtn^>U1cLk%TrfEtU~WxbQXUP#}`I+z4%z? zM%$F5oED@O#l9DQcy zw@`2B2byohR4|E(8kloRtOWNt#m6B&4W=hykMJ3zBR2^P{Yn{xp5O`6@_8j*pMfu0 zMLubO>UIyVy`Su)t+2^=EK| zy)2F$m+RUhP|1iN{y{Q?dXX1oI>`=@GoQ{S_8{{k~D1 zG~?Bu-}1I5DL5*1qI~%!7qUwoke{e|iP$Ech!zVFz7KX1^2~ir6GXA}Jk66Pjq?Di zFAWJX*maSpF+cCv_H{b`;Yu;6qnS_DszQJZurzQMm{N}CbZ7Sjr!dh zWZImxQR$q77hcuZsI4I_R&JV1&cY|B*n#q7{n@6KnbhrL{aYA;EV|?!ZUN?sV}4YF zk0Tx|J))nr7h)hOuPv)Xe~a9c)gt5mFyal9EYZ)KFf$Oi5UV~2*>%b2?>5TF?eTtTke$6X1$ z^Bs;^HXXi5^V*`qo4-94z$mqe$y0W4pFfus4Ey=iz zI0ol3ZYlqQKguro*B< zziOb6We$-e+!WuIjMA6dqN}j?#hUHq{Vtg@Q#OCd!QHNrZhQl}ftW-!trrg#J;9z3 z)+BPNmV0A!GMA~|TWPNm>r;CUD|0Cj*JTaoF)6L5OALO|`)X>s7~WC3$k>NGd7E?9 zX?P*Pn8!5VE)EH=-%ilR$#Ch9M0EB^A>~q{z8mv1zbQ(c{)AF$YbpvTRlFYq8KbqH z2|T-o&N`djJQ)gf{-RP$aZECFSbf1^=33V_VEfK7Lq%rWA=m(m+}~$peiWw-nwYvM z)64MDgv_@3jrE$m5RQHvPT6R$?kj;3Icl&vJnVW-!|QpMP=nZ(;kx>_XKmPH4>^rEfj|D)+J*spqT9*PFcOu95p@6QEP zV6jkYHFBIx_p%udte_>YU4-BbvDC4jnLosM?r;>d#N{&aZPETz_Ik?a&9nP*TrbcL z#@gtuNgN6vm8~!F9*>z6TE%}I;Py>nN(BAXkIgG+Kp%14nM~rV;`aoppd%Dpms_R+r{JVLx>?V?Tg-6n#}4a|<8|a{-Mu(| z0Nhg`9R5=(bjjakcqfNANaSp{A1U-K%m#pTA^Z{mmSy~Q@ARK+5cyK#LOR`NY}K$} zrspls+h6<1LEjCtWN%XNQR86p2BJSiQsSfpc|{8o9_G0$QM5N!tN`W#1q%u}-@|a* zlW0u$)#=73Sw~EFi~ccBXhoQ6C&V5~phFl7zmV^|ITf-xPpGxB z_tP^9B`;{7N&`B%&y)ye_?>tp4<6g3;vaAp^sQjGhE>@)`@}#t0)vlFlIAX1#EQj2 z;>e?HkEWYN;1cFqGkn_O?HP&J889+M%GHKbf|7GZ--v|t%LA%%<=n(nEV zlEfuLRewNvdaa~Zovj9&9d+54@iB{#fR2;d$#Dy>dI)u!(1Wi+kx@x|)SaX&yo zqZ``Ccj6dZq35^bG$g=U`W>L-veTE!od$MSTA?%~7gKt>&Bu3(dl-!ANhF2XeMsj3 z^08k-xV^ElshvCRDg33RaO~GXs)62>88eV{E?#$Kw30@RFk&bU4QMefN}0g9ML}>W zo_8xIDG?rC$KYVVe{eVjnk;&9$!glt-m$KAz*oL!!$yIff;>8_RY|K7nK*QdO@M@6 za*xJf{ac7?XPM5#X7MWm;E=jzc2eC*Q;ntND)IFL+@sh+a#ilCv(?#m%0@eh|+%5NKfGK%&dlCbNU7SH09EHTM|;(>l`8HC4A zmHJ!LXcDGh){p4?LHT$}HTt6Isv)Y?ZE=4lmIt3wx4>Vknyf#EFHt(CWwISw+P)8;u#WJb z<`iRKH%T#qTQ@Ty9QxUvbe+U>I4^;E69IA1D&hKgIv0{A=nPO9cE}Pg=!R? zP0!|f3_w*PzvX6U8JiVe!3XfVguWBP%s+)(+T0*bVXVFyppH zwQ>^-U{6;DOqRGtDk%-^eK^=c$`We`I|OstY2G~_Sh$~1OJaJsa+o;f!T&Ha<7x*U zRAPc{kT)_rxq-h6mQJt4PpHx`f+wvjmQ5H8{FC6~z8EW1(k@vmQ_Arto`MkSq2$jB zQGE!t5f7Xc0eGuudc|eg7MOtv!p96qwoV_^#3soRV2 zqOMlo>=OXgvXfTM+BS4}h@_sCUBMBGmht?6JbU2<30*SW9;& zY&pZp3xx1!Wr<{0J+Tx=)h%MZm7OgE;x!yji3txCp=s7ql8`9^*ypFWAgbcF! z7TG})ot5>di94B0Os53R^US?$N;LY(ecNA_xeGdVYfBpV!+_y#l$iuVM>9hL6uwZy zmDrq#K!eAeAZPvHuG<|D(H3<O~r>Lnyo{KT%AMwQJ(PZPEl${;HM1$ zhZpsc;QG5m8Lk2LweE%M%|Q~zr-i<-mQW@;{r%01BmH@uJac8xNc%9+Dh_$@7h{V#CfSWsvQQ=gNF$Zkav=a%ua)w<`FZ8155%zyuwA+B0*vG#+qeGSR{ZtxVJ! z`4`?YA6}Ba)nDoLIAH6J^>Vx5eN1$9Sk1CcKg5k?RuggB_Mak@gy97DIuU$VI*1M3 zdmPQ&k`2n3e*itxc)R={IT*$UJxVS|W*>1{o4L5)@_%Q=JtP|L&0USi-AlSll&u+y z<)n))hiKf}MTZ~D{QRl5gG59*J^?aqXAf}BRF?0ih=4Un%UWzH@R~f>CL(9cs&r1= zMwoavrbSoW%|Cbh`_P^^f6(9)TmjOdJUw+(5jgIIi24V1{ubat#V{(&(m@#hDQbsj z3xYRKJ``0!&vlVLs)km8<95hA+!f_4c zAX%K*?*8~|IH$S;f_kJUK?lBRhDx^( z1>NFe7%oE7)4@A0)Rv?TosgkWwPACk`3?<5 zu(GhQ{EJP0lj46l-v1xq^!FYAEa6c!cC>YNFf?`~`o6~gztZV{W5h)CGR8*c`a-sD zFq;3EqyGlsMC_bQ+TU7?|L~pvIQ@TwPXC|wb$mbBe}wh_16?!z(@yeVq3b5?_4tiu zWbd3By`+bps&I-uq1cHG{Bc>WE>k6mq$J5GRTB5iPInj5al-UvFDY42q7dQS5Ij2r zHFwv}^gz)9dPw-(2g^s{M@!W`T@oYJ7N&LU`fk&wRnz4(BoR%OxzFaeu0g`ea-s8! zS31vI5v9bmk?L&|{wfFeBwkDn9jvbhsy9=Y50%He^nR3lxdt@Uld^~W`TQ}?rngR;g_P^HDGn0C}r+#!7pQ_|sAt=*L;`S3O% z?(1Yo>y|kwiZZ=zVL#1d)3`NbI_D#`!hbJ2MMR@~?lVDq`xmB2Sh-pH5mr}mk%qqc zT@C-o?RW~mj`4E09wqSZK_<9XTA%ppkaLnRp`VM15X7Q)jfDn_@x1@v;CcFcSKYQE za2)Jd%@NyZjQB(%S?WBh_57q_+@Y$9(+lR5OLgEZFJTQ_y+-SKBhm7FHd$3a4vqWH z!JXyS#UL~18}pWl7u&z5sH()08sZuiw>zKvh^T?Ec`zieF)`?N{LcXGH)wB|S&XLg zP6orqCszy`Jvl~a7!`CC>i}$b=PrU!v=2aX5Jo8CaKx%p8M-6qb~Z2BZha5Qv5XffYhorTqZhbgk@dY3^~t%l(&=MG!Fc6s4nNTy z$UL_uhh~7>GBMDf*akh^(A}G9pD$^qX_8W)SMVuXSj9P!z-YVvWQGyPGTi3A>Tx=* zlvODgVrkR#4zZdiukwjrOhY~YZgVc`!68AGn2vc}0DgJ@)md`6wQkOhf6=m~oEPDL z!$=Dya{>Zu5(2&GR|=BeNMf1D4z{t2ZKJpak@z89Ue9L>%Z&-^-H4ddbcM?wFsxc9r44TxS1xwSj%i))cRUr;( z6l#Jqq0|+>&0jP;u+a#XI#4G;VQoeaLMYB^-jO#zgQxOpSygBgPj6Qy0U-C0!zggqB0zKJ!$zO7wB~E8b zecML5oPxB@$X8%3@q2r6tzrM=I}M@QMiXhniRw%%58sodb`vP4}*b`$>qhnvm7@L!M(=bTU#+ArM78f zXBFzb*iZNV`U7BM`{^@?ZiU~00iJ)}z8FCd(Mm$QgN=xZH4~HJx?bX)o(DT7u9~2_ z0EFx4vw!#Ex0jvDoDAlE58~*e8qKK*5U4hNbC{CUYu8Ohv5JiwBNJ`GPt|wT>kTRe z+mq3vnp;w@#I9A;+t>C-Wv+cITnXKnQAQEPN_jYjBu+LJ6V=E&lW<0aV4Ho2{Vqf= zrwn{`Y4?;2vus38&NrAGF%D(UOwTP8wSl6!(<*U+h&~MK=UtDuJsa4V!sVcu>jTUC zIoVU!W?zQlz<3u}EeljCgOFrR+ObyGMiEW02&}4b*Ivmy%FO;z*&wi2@&d$H(hW#6 z5hr>=sC$z)SI6z!9;6_MP2#5aYdfoAI;X{_eo(_GD3Dk6V7OMAzn{+Pq&E)?HbPMz zhPh--SfBnN`Q#aZDCu=%qx^Dq@f(+%TsHH1kWV8%w?9wc=mo|H6gJz@X_ zNb?(s;`Jbp;KnJKY@&b89_=qGvyZLXDbz6q9t3!+moPBbOKxxq_#I;GpFWjju;R;R zUrNCo4;7Q??$x?xJY@Lx@+tM;-gLv5OzV@Uchbd~SulAbV3{;dTzWnoCFL>r_z{+9E7lGJBWF1Liqihh^epoi}*B#1(?q zAro*NdqT?uBh%x+tja}%c!1yazl%bMQ%Hk1B(T8J(fZ@jg?_Lf{?c9>DYB;y0+(%} z2_#`9U{7m8dPs&LO+!xuF_2^!s0%7zLzR?`4u-*XO}y0z!;AwOTXOQlbgTm>P2))k z)E0`T%yR^cHX(aT%I~*f!)9680`%pT`+Cwi%MvskqAuxPpdd4+;*ss8Hca&5lr$Wq zBvL|ToREsBExULaBnwYDq1JhWz``}X^bvj!#cQlIXfQ>vWRST+VH%Et_UtoP716YU zB8(xyxn{(*c_vR7==za0tc00tHyB~KQA()-$T3(wMd!&im|&BIOipBxVF9sZ4S-Xv zp?V{XClneDY`p9W@jsGAF1%7E{>Vz0bw&iw(#adZ+L2_geu91y3&zv&8aqzo^)zXN zGA6X&cjcvgALZc0@kpKkp(h5`8~w$cPuCnt)=+CsI-V5Y8?Uj!V%X5)hy&A}i4%`# zL%PWyt1>7|j=!mXM5~Z(Ko+e9pC*W5Csrok#K>c_b{l1-oW~MAPktc7W!3j7uoKJ= zn{i_QXa;A}3rf#z2U7d(i-wey;z4*l)YCnTX*th;--KMbK#>Fj@GIsv0ukl@d)+GM$JjvS@nBqm{*jy5zJB?tb(>FI@ z{=?cM#W$rPn4G6hGdr8W(JmUwp5VN__ULp{`}!l$Dx}45QLyR&9vZi}UC7fU9G;X| zH%Zio4YDMh6&y%UlOl-E!5^&)eD2xMBzI7lcz@%p)l^3z;(o ztgi>4lj#KNIRbL5UL6!RWC)PzNi^k)daeP>Q{bhF>iI@algk!2cYna8Di(WuIZl%o zEpp`$IC!BKV1^HAuJ#O~Ksa;=M3*gqYrrQB^w|kp%-`XEE+Ucd9LOj!5jpLE?^sF@vO&H8|yDfnzivMkNg(tA;otgNU(2WH6wr zn@ps+d5YA$Xk283uv418v2nBfYUIchHlB)0nTot6iW1rU`HfFsO(<6F`ntTuSA)tS zB&2sla3Z8`_0nu-E&Eb!8QFTtal=9I)D`Q?Vmmo{L`H*MAn@#d<2gN<&X@)b9>&W^ z=R7i132}-h18Q)&VK|g>u3A~Bd}wxlo~G9eL_lTI^k;DhCX9K5EGua881CsKUVDS? z$8?Q}d6N7MF=JLZ7wkNofjVx;T5sZa%LAs3Vt^{l+PMINnn#^PCau;w``zHtp)L$5 z@lc$=#LX&f#8L=Ml8(~BO7VBE9H|Cu+qeIG@#`Q3xx^3^R303C8c2N-z$Zrjx<(Py z%mL__lj5kSw*dF2E|?NHZlqGg!MvUAFU+VTLGIK({DSA@GkJQ1D;{+5@(Uy|?c7{P zAn4Rn0Mnu!1nmn1eq_Gq4X%GbwFr8|vthK|h@Z0k%p0Z9+|W8Fg@f1PHl=K<8T*Qi zdL3x9SSNuZM}&Je5=OGNvuwcz`rF{Dma@wP$X{xCwKKVNs$Fk0`5{e$X29JQHyM8F ze}n>^Jr)7u4)K=gV^{LZ12tW-0t17`jTMwd3F;WCAohbanoOUI_I3SMeOn#Y&ikUP zW&6vyUL&sO{Bmsvgc>no=(qg6jdxRikNdWBdKv?ee+pC85ITT^;o;UkO4CHli*kk( z#v2^8XN$;$ZLpUnvy})^c0y>*lMrmtXJ$sM+ByP{9rHNMJ2VR@#F$8XU)7Mk0BIv+ zeqHmRmXc+o-jW3-0&dNTRD@cz12+Q8yJp8stuXa)-wp{e$9``KdY)T8=FqEAYKqUh zXUxiDC?idw1m6nuCz>BVX?Bg8IN6rD*xAI#TY?}JmeY9Hq)+&K z>8Q6D_$va}072|hrbkNfY6iGn&21utPJ*8%T6r0Wbaw<=1}yu+Ubhxmvd?UH3e;@= z%va_7Zg9pQW*MpQhc55o&~1#JQ0i712|6ovnbi2sZVvr3j_>|15R6&pmXvm!*h|31 z_))=E(tO3;2rlUgd9&r!Y#a-xdK(6h3^T22Y{X;_FT%3v5*!LdDy-QcE+e}ZU1#kO z1e1I}OTg+ZG_?l#MRCVoA`;+Wz%l;}^A2NT{S~NE&@*zOr9dD&t!s(h$ho-F1Tnt> zgQx%C@>8(lc$_bV`m2i4{sz=jL#ntaVPZ@@gCb+X0R+>6FT{dd5FG^}Vg}q#)B}Tu zd5SkZTaR8e4gEpIBj1zs6AZs*TZh-i#jhDReKA)IpEV^DqWb2HgR0JU{iNWn*Q|C+BFoEV?@3} ziUCr^>gl&d>mjv3vn<;}POT({uSRS-%2%IYOuHZ!(TcsJ=j#4|} z?ht@`pZQHhO+qP}nTxDZbt@5pX?%wyD=>DSb*AX2Z_t$twOpKXh&WL>8C-ccB^Mz`2>vhdup{c?S4 z`ncJ&&N*_A&-Asny=fJRcUCT*(!KuLy6dc%XxiD~wdr}OnYp*F@BV1oPJWqwdb)Yn z_W5&Fo%fqB-uAaIt#dld6{f-4v}-lLmEWHWm*>dL>YZyJZ{XwW-YLGX6BA7v*Vbd- zua)-~S+>ou&7IE`ZxTVH>{a!`j1g~V$G0`#Wr&&vjQ-{Ybxqb~t;c9}o`SC(i091s zIo}+J4NJW$SnXzYzzSVP{;Q5J1OBVrufF@;LfkjP%EH}hpR%#cDoRe?qB&n{W%^58 z{MW(6ml2-;l>E&CCH2aP8Tc;GPn5z>rrbk?AU9**L66N1Q8GcKvP$3V7CO%x<=%ul6 ziY&NU!~GX3V#`~|+6_*sNZQ-_Z9tIAm5fWz_4|8k_`D9*N^EV}mM+ZqzR=myG#)x= zp9J`!^sA+rjbGS4!gmiXr>;hS+MPv599Z3u@NErN)Ko-N9%`vp*G{EU2U+0-;kshB zj+0?mif1CAW>M;{5)I$@$dtn618eT9ln9S6X&hC!dup6joC7ISCG1ALho1Rw%E9mN z)D5HDm7}_b+2QJc+qD0@l;bXD$$3s3ezV)8z37l}p}Ju#P8I!hYg88H9~xRvbtxuy zxQ$?haBWzDU0jVr0V{<94+1j1X!h^_>AcGrDN)}+*)`>>iEdszn6g@ANx6~^zS7<} zLtr%~l8Fo?&RDeq?y;7n_k1|U;jX&al1@3apDB&~u{GqPReWci$9zZShhGszGPp?RKabG1(Fq?odztXW=@-m=9c<9kmJi%(|uubJEdWPF?7dKw2 zWtO1aL86^WwOVYsVicP~$){T!QE^daeSw&0YVU)T!dG*s-vEkvuHKVwEPMiMyknwW zDN2=1$iqHwP+dU%P&JJzGjSqSBCuNes*p&?JT0g^LmhWKot^lnIQiy8P}I$OwGk1j zYRy$#LYeiT_k_ewE(HXBecB|*s9;ipLcV3Fy5qN;)@k#bw9>Vjghk0@oLiQy3kPM=^)r*WaZ~aR#dMqVo#E)9GVarIY^gECi_1pQ$7gYkxH}bV^=ZIREBcIbk@dc+E?6RUI%8Ff z$`J8sKT{FJi_Z=-u^^QE?Fv0K-Wkd|d=1%fl;F0BO!^$q*E18%-)~06trS~r_v-V_ z1$8zNEpQSxEJluGrPy!rp<#84%j)^cz44OGQ_4L=R_aOV7LdPnSQKxy&nYD$h@p6K z0lY+}*Otg_W62+j?G=?oX4}^bTwU!&bVWLpm!pxb>dGgj^Q_FU=YupbN++dW-Ea|i zI}+ZV%~OPAClc=Ux3!o78w!h&Q6>1gfVb|~rPx?X zC@7ch(1+k+sCW{(I;$FyVy;=?Uxv(-T{uQ4%gj|nS~B_N$M|*wPI6c~F)zq~m{-Hs z=0PfheWcJvw}`-rz-;2cSY#fBp77v`pK96(#Otsy(|W|GsHMHt8C^gVSI}=GYH1WC z`xdibjF|xE&X9RLRSWJnKs|j%&u(K0j;a(_6nPLOr$z9cQ&y97MW7YfOg8cZH-hgX z^?sI@$GV|Wt`vEdIbOYV9Nk^7cic8kZvSc0STHQn4FcwPuu5_g+qphW$CpghIuVg0 zsY|&wYa}++B(w_$Cp17D3KX0uv3+HYGIq3@Anf+g%EBs~m74aL2)r8cVraR)tyQis zM{JN#Huav;0(=#_fW0Wm8%g12Fmn$?+`B2|of-wQFJIDd)Wqoc-HD9-Y$8J~lMI$_ z8VP22duPU8go!WjB>1JZUu*Hoy&!sxybn0}dmWBXij}a$FYhF`8TF?e&mSvAm$&w9 zH)CogTHfS5mlS)^j6Ys^eaOlZFr)s{Mgios#A>dI$7{nRb4!O=y;FzqYD{eAm`KTx zC|FY=IU+~ky0+c&@~kY=wRn0h%@@Toh9DTQ^_Il@EDg7s>(?VI3NnZAgqpC5Ygr} zNFbiA2$Z*nMkNcSk= zSSTm3y@CdExKLH!ICItK{EVM8krr>Q9L<(DS|*doccP)4rb}awWy^M5kJCtp@rB!q zIvZd2T_s(o?CYNNfIjoKKl zmP!VC#Ah0*&W^w6yHSM@PHVp6bQKiam^In)mTSZ6M2ZtnHXi!%RVrRMo8m-lnv$@| zj;k|4v#p{|I6BAES7&4zZMn73)F2_zN9wl?Ty^|uA_U`5uJ0r{WCBUrCoC&7&#fN7 zwd)9(xmZ}uis(7agH~~vCE9=x%BP4M@Y9reiKcCXEe?pN0PR95%b`e-dC5G1%{C+- zW%oK!A#Pn_pG|dM?AZaxVvmhWlHpBulK#?3L^{H6${&K&{&Qrg{QzK>SwR{7RFpH) z)GwYzY;#dWO#V58Icr)Oc99p4ezhcghq=5CE3s!56njA~271Slck@O@crIB8Ys7Zv zAV8C*!n9Jm;0-@98F|J+*^-H5`AgjyM@k;Src&?@Tv8=r$w%efw9pzswR9F4ohRtm z-bXH}39E>V-2EVptb_qSYBqZL-bdPvOgo~(FJ4c3vI2QmAuKg(Jv*^m>!yXTF1zAn z5J+w#u`(bwu4xT}lnsZJ2x!QDANC!d?ZJ~sf9Lu5U@@!TlNXfD@o>aN%f(Y{W>aJU z8DCd}`wu4{3?ir^;r^`#dmLN3jEhX&$b=38GYaT92Ox5UiV1aT@JeqrdUy(1oj26S|8pHQ7OL zuJd_wQ=0&JIi%laG7+N1Q3c1MUKRUkxyl*^C|ZkDsU*N_;9CXA?-(@4dC8{@_ep># z8$|l7{Zcc<&{6aP@mow2(^y?`G6v4up^2RfsQx*YX7oCD7y^ziOY3?!!?8ikT=xzc3Cll;y7WC?$e|MF14~m|BBnY0D+Z^ zfqaer^I-c-_*pX{#^G0ZxQG1uIfw$Bw@0+2Zo&e_Lck>hY-fHbO+R^V?65~kQvudj z@KhY~{?D|NL0)(oZ&YVOD(m4uER@N~{f)lYDBMFBr(FH1#}grrnRNejjC1gCYgAhE zXNi5yrpF|xi8Rc6xr&@go%4^d20TE_HvIkQNDm7Ks`b^h%>AjtgCN@mhQaa0_Se|6 z*g_DC8hWJ-d(H7AopeRp*m5Q@a$Kx;ceky!q>5G(5a$*an;M7TX3^$8n7q25Thf{7 z+1q0wQS3;Dh@{Ap%0D>P!=lrI9_oeqGCIL>_07npOZY_v&|^pJ(5B1SrJw4h49O=u z)8;X@O^j*m&6+wG7TVNrE-xK$C#dtCSC6S!i#yh;m83l9n05aI_j_o|k`I7YDVpq6 z|C)g*++QqQTz;`Up3;!!<$h~+mU|-5M=s%nCHA^J*bMaSWP7I3>b#7^Y~)Z|u8r-p zZ=+T{x2QFn+6v%I(}#J3UfXpjVe02<+(kz6?mEE(_=(G$>kYLjb&Vn-!pp6u>7tlV zP|Y-MygL0Ov0zkgLcL43WZ9o4q?x_(k#0OD8dC(^mK4MHr^c_hE|{dXnG(Z(af3|> z>`W?w2>)$@J@OW70|RVN75kh!)}5_F50>a?a}O>7lFp@Wj=iw#$^^ImB}4u%-|ei~ zQe!XME3b^+h8!NT{NYE@ixvIuw7X>5ktpvYKq@>DtXv&tbVW0zC+3{}YEdZ;f=aH0 zbkIO8?(~;idG+Q_-O|ubRc&{Pd`Xe^|Mt-rGf^Wf8LLYw^?l0egP4H}K@ zkkC~>Ic(rbsu79L_~|IqSilt1qDx(Pf38r0q%*YAiGSyW!^kcA#G3NAU zyvlUdP7WdNz7>ODgcqujAqFr2IkvLb;u%NN&DOAXt6uIe<+!7L(}@x)JQ~Qpd{LSH#?I8yqGZS4NrRr{=3nVt^^wB3jANd$hTB;fN~Sl;B*1 zbBnPpLU!rK zYdnsPG%R3S(XtvA`0hXQ8lJ}?cLW!WKIw?@D{)k2%+Ax7DAqE$2Y;Gu6eHB=8da6w zORXT^{SMc^+zk%w$de${EICJs>Yo-hPl?N0z!IO|GW zo@2nd(7O|R&szA>WXenwM0lL?v7i(-2yLC_Q&F|mJ~Ly3q_s*Gvuw3nJ@+7=J{0s- z6!#JVabiPz_En_FTy-6a$qyd2kO9ccIuzDdjWQnd_d%J1`KO-~pa;%4HC<_{_G`Vj zsUIJX8vqE3-BOQl=)Me*6sIT@qh6n^(IY<8vlLU<%qGB5+`54y(dZYPScT6eT5;D< zScaB(eW{C$TV7&z!(B#Y?j7Uc84`vW$hh7N_(l#defwx1H5AI#PFoGkNZgmmJXBKUE@o95)MW;{5SQwx# z&{A+1O8)RuQdLA+J<`45A0IXmW@q4Xjaa(v@y&Hesy8Y9kfm5}D%WwRG@y$0aI?d| zfs>6)xJ9ye%n4K9VSY(3UNBDYHP>8Xwo1l-RDDB%75gEVIsndRVUax$?3)u3=P(g# znb-y5n7XPU2A7wP|7Y<1ws+VM;KL(;Na2|-)v2+RdZONse5*QE8%s{US z*brK7&u%85z0L1j-x~!mHa>g(rMS14=3@r@PU@j_69V{ISBh;|$OPELLO|nUPj5V& zRN`jNAg`@m?{{pcEL)KvyqP|P7w|KPLMBq&{jy9A030#qgwea0nB+^x5uNf&!s)6q3BZv=o= z+HNO|c*zE+bXTJS!CI47|E!u;)<_TioH9Uaq5~vIS}`XlE^iN_w^*(;e$frM^b2K3 z3p{b`@Fc#i3&nM`F7V(NvtP#fmD_39s6jy8YOs@2pQIF?W(Uz=u@;=4PV#;MU~k#D zw3H+LDt!hbfXp$v%Iq3+t0Pd~I0fyX_I-~m04vXMal?s>H3S>W@KJe!=s=V2Cel^@ z5T08hDTHJ!4Nr?)R{E+2T6G{5la@Q6iNCvh02O^C07C9=N3L)2qf3m*2z%|cO*a*c zkq#ompR6sYTLbVO37ZQM8Ios?=HCT6+3OCi7UjWy9=kGD-C`8&VJ4sQI_SC+&dwSa zBGR%VV;1)CI&-xNOZT_Ng=jd^Q)5>6S_v9_)He4WMXUgx<_ebI)BsJeSi;h4u!K^+ zv_*J}&yo{S{NjK+pM}HBzJtaDEZ=Rjcr`xD@+|E4;DR{x_2=h^Cl&rXf$+c20{@+%_#Z6rzv$HeCJX$Zn)d(yCG`ydnKSus;`i@@%>P^B zS4-1&YXsG2SGS+YM-7!_y8TwA3Dj!I9GN{jvFubx0mRas#|S>pGidLw9NizIB3tx-Tk|QNG{m#BZzB?9BL)~ z&s1%l`m8vS%t+DL{fij<$=c74^ZUrvS{)zPcmRh(*+O2pVsv#m-MU;VK+z!2Tl5E&h{R#=2h8{qxB1qQ*DNV36(@m6iW-oL zyM_m65-J;J>d&2WM79?s+K^+_2(gM~> zHBM^KIXH?-%BY;^*5!gtHZG&yK=l%+?MTazBNNP8SGDRu;$!D7A=1@cq-&u3d_Q z$)U5uS|@?`X7RP(3c{jXJt2}WJ2qD|!hv3`xX9D5?{kj)-_AH{K6Q;A(Cfrydl?X1&I-abmhK6vu zs5(I?e4gN_D@6pvmyS4MkhIH?=pfY)Y!0NkPn+3&i2}VSUQ+TOm`(xO-InM81Cv}SJd*1%E$wj9Q5r&R5(%rM-;}- znVz_70r5u%dDV;2eH;7&q5EDbv7c~(z-;xnfu$Ys?c%wW!?~4Kg85_J)|ylj9EsHp;{qu^YVc*yeLBif$VCLpcDTo1Yz4Uqm;I zI+EKT6GN`Z#-$1KQBQBc`E$JJ{~ZLA8CR_ z6sT84&idPzzB2-gA0eX|RLllI+MM4uua+%3rQ-s>b2UXLi2CpA?b_>TcG1WKA1g1)Db8!aNQn}X5DJTtl6Mf0}>)5ykPZf_A)+MWVOD5pr0gxlOli=e%|G=-DaC# zpi2bsOA+JU3!O^I%>Hn<{^C?$(T5ODWk*kY0-ufO^1EedA@*w98w)QM%_gc7WD*Wq z>O@V*?7Xsn(C=)aW%RO3Y)dY4rH-j~6;*Kaj`t^W6DgRj@6X=+us2Rgvl(G-oK!aA z9OFqIxeuIde^t)7>5L}51+dMi^Ycd*Ji%}RpC=%W41}%JrE6f+3>X(`aY(~h)x#+X z%##D~!z1$o01xA`M}vS#jhhO&i+y^8qnD{0TC3onpFr+yWNF=xS)asi7Ne}2266u z`|*U-q4FFHUu2yG`n1Al(*i)8>0B|?0T>JW3R-bs$u4$y?ARV6nb z6=qEs(|Sk+^q?TGCEj~h3IE+IVUYsx%fH!R?c7goLEQ9imN*nuIUI~2M0D_kOJ`nx z*Z(=Gvh9?c7^iT6nnYzYBy2?@N-|QOBoaw8OHBlmcUQ5gNhm;MO@@TE24&==@B~~1 z%ez-SKPVY1M5CO53Tfu#op3-dd|5?me`JCUL2OD~j2U^avEvyY2q^f=Sf-ZG*#iV1 z`r~~5%=20xC)FgddlK9bPi^78vabS@3Z}2xDy5~nh3vcu1T)xMNJ|?fs{+XkPiklG zn?N+Ntq^1@!MnwO3lRciN2*37-o(S8G1Z$8ZUhtQ=f@9mGc~EzFtF_%4$yG-am*5M}Ds5#p<$Tq>dX^@~$PUubC$2aS)*0W3qx2cYASGG}@; z9^qKaWe$S9xDO(f=WJn@`+!7q0UvukyS8-JT_(cw$6?UAp_!%{)G zNZpL5pEbmilNu5j_%t>d5&(Fy$P9x(ApqnF!n}#YGb|jgFir<}f*njPD7?H0$ldja z5D`3yM}@MGv5z14XrL$fFHk(StDTNsdHp~wCLe_Lg0Lb@%=}d~0&q*+hINBw#sPw0 zKuv*i=AYeX?paF=#itDr%_Jq9CI;o1X`$9~gyzCLP(tavHxc8tQq{(ElKE7CI^O7f z$TpBH9ehf*?CEwPJO>F!$;P_eIA%c_TDMU2FqE<9fetn7C*{6T%X%O{DZk0$a>xgp zE9!HWH6wh*ZXtu>Qu|`520Ji$n}H~$cijpMhD*lR%~3AH7t4Tmd=)a8L4HuAfhYBk zS=Vo6Ky}4lkw@7Lun%VQRWUKumNt1Jx%;xh5>L_#?}r^hI0;9hS+=9u9K4Har*R}R zG}|IZD*;^dKmgqkCD+TXh0Ps&2B``Ajk+Qdlkr%U_o3$*?=X$=!aXTipif)b^AWDL z@s07pZ>CMqq-;Zm!C2k^hetzTiSoDfjN~ZOTDtju^2a&V#t0$O2(A*(6D!j&`r_H> zJP1lqujRox6DT%^v(V9x5Mw%PoMd)88=2`0J*H;Zjwx~mKg4IHHa*$xdP6K# zmv(WEUdh@!+DV8aZ@lOvV+n+Db!`4eI?5kIzfYT4#%3k5u8 z0I~NKhe9xk-?p%t;jys{xgZY*ZOpj)>Cs-6l>S+;AgplVw{7b_7qwA`jlcP(2G}Rv z1i$}BfkFZFXhF;Y+bI7$vsp?)7_5BHTa(i}Zy{}pNOUFTDR5|>kKhZ4HD=1FeP_Zc z@_r{6ZUr55sf*nMV!1-N;sUNfjv{&N8~ud6M8RdKWXR|qJ8CXlzM+x<%c}2IGK8oi z`b?%{24~?ag>;F4e7a)&5mepXr6elUFcsAGxWF5PS)<)aTva>Y)F~?GWAXqQyzKFO zf_uf*08x|@Ua+@u(3@_NdCZXgvw0d(a1TL#9EcKZP0t<3H30W_uGeuecIzPEP52Ex{IIb>!=1Pky3ow3NoBA<-6kF;{j=nnVs6wt9k0oC33;+ppPsvPVKnv&>sR+~R z96`q);NER3k~_e|(nq$6#nsn-@!VRy0RmJE;-No3f@Hh)1QqvSe^Os~?3jfV%^BtM zvOY$XzW*6-oaQJyjVUw*e|ac-q7C^;_k$wbd7!0)d`yUk?VzQ{8qU}b3oBUxg7!{@ zg4ZaIobH#omwsqbAf-20v4r5ZBxR=ioUjBUrG|Ka*iRPCmmIz0xJVJ`rky~j2`#w8 zA#2z~1(8cO3}5cg>j5FyMBZA(d^*#8?w?66jsEXs*Eg=h9%bg0;ZBI1MTi=HD?8y* zxLYu1X|;YRe;lL%Hgh)|2J#8@)#H%QgAQ$)+MwR^Tf)-yBUS7nuDA7Lxy^9A)EeyQ z>dEa>EhJK=bx$2-0o>Cf^PnR5iYo8HMyBSCc#{@key`O}I8CDwXRMvbf2siO5~L~Y zci8wknHD(sguG9y$}@YE0k)yHtFuMmOkn-sJXIhn?w(D?k;0tJ=;VMZgMt~gnENBQ19a*8>Wf*7>yok8x&{P`f=`02(us&fjyw8j}T z{a5O;@aT(Hos#MGS{BqxaIqxX&v`Dz{F*Zu(Ts)w(O=vftrr*5SN77|+u*tDO8}_X zskd{ktrx93-A~BiE124uk9-pMbHJNz+Um@*j%o0)cFgIrnR^c*Jkp1D#*uL^B~d6^ zNohN-KX3{WOOgK2G4LQfB2ovQXD`LFGA#{zKU6~M_3YXvk{8=a@0#yXcz*(P@_$NS z%(fMJ+H_n0E`sf6&~4|+Czor5RHoG^HHZ4c=kG}S%B}1V0CQ=04&?y=IM z@;*Ae@?a=HwhpSwlQ$t_Nev6Ok3kn?|J42yWP>&T9EU|qddnR9$k4KcJ~Z*%aw5-#IdfnE&j`!*%O2!NU^@yV*J1 zIvwC~bopsU(v%JD`<6b@2K zYVcQnXy&rX$ucK=L28Z5YunlGZ3VgUz5u-Cmm^)4tSc;p8)YEy7iJ8kmBY+`6~O$b`4M+Lm*X{nX;(u{@jQ`x$+{($=;k(nAmA;d)u(6@7k?~*ZX-6jqV|{BV zH^6N5$%HLtl!BX^=l&F(jHT#+^sv z3dv_vQuw>0949*EyN#xoJjj16N$Y2jxq6NG8rd%U;~{B-Q10Nldh`?=Y+;6V@pL@9 zW-)45xOCWD@zrV5j7C+fl%4cOdv8144hIeSv3HPiSh`d+?q;G9F0YBv39$Iz2R7*7 zr5c|yf$2Bj?sjkBrRtwBdcWvyWrV6y(?^s$&< zE16ErWv1~6e$j$GyCFTsHu8r;Nqu+jJwz(IhzDdo`cMRsuFWO-;3|{xkgJ$ayc4)d zS1H$b1zDwSUU0w8HWWp$xXC~t`?_l;8}9LdX0&pGie8a%*q<|7nuLiKRdPGWWj=D^ zzrVU@HGNN2^F%G|66bq+=)0}HV5o~O6$@wNtJw=b5@L3o&_o@wSsj(n)uF3GCkA+tiqUtrFB zIp5+XZSZ)SNV}hVW!N+Tomp;>f+F0;^{W;lnU$|?2eZp>YO@o-Z84QO`9&#oi0q(y zE6D0Ao!)#}tN5Y~vF=QK8Orf=(^G;d%ND{ijs(&}#gG^+CYVd(u`OTNzA3{ zNe7l6^Li{*U7FeBYfcMJz!gKc0fx|=xn?vsih;S(m_F@x4JBei#-I$7O?|X_P~YfO zTA;7);und_ny`i@$Sr4ov^tdZuAmua(J8FbojhaU`&${*c8D>DX}gM9Iqs-iAegA1 z@P3yR>3N7WGiP79jKNueiZbSMk>_$<*J1qNh5Rx{lvZ&+gJI4JNq~N-C98|zK-NQ| z%ZbeI$U!jgjA&$=-rtng?Lz@d1?eBZAU$sY6dhh6Q{E=8Mlf6#3Yd%uUdGmQ;T0Nt z%QDGh>KKSc5?tMs=@F8AcAjYeyvv0S2J9u@tO2MNL9{u!@qstiPQyepbvTkU_OVZRwfdHQUSrvAcV0LV0X}dQh?-YmC}zcwdv1P+uALpHnh(4 z3amFRP0U}}DCCxWv~zB7EKLMcM#G|*(Q8=A=ztVBV(&3Hm_isK+Qv3nNzo_BRStw6)&}jqnlqv(cWt>ig@hQ7OWytb@>BV_;3}0~FT45+YaA zc*Z$tYfuV_bM>C9$L|&w_El;xI5-e?&`3Uu=0-4$%IaL(2q{+zg%TnEPFLyYDs(MmlQmMi+`!OR8En&ix zWo_!%yTKs%Dg=Y)Hw(cWRRuE-gk;#jD0nZj4WJkkcSxT7PB{HY3?;5_3^B4g8h?~4 zi(4Mcbt6Hmt%CgL$M7G(VDZ%D*-!9(azFC_3I+VjJ^kgh7+9Iu{*3|{|8jW$__F_Y zD30+j8N+wn?LSb!zntQKFBJE$tN&T^zYN9EiCgQN8VeHq&r#^_QJg^g+pXH#I1&5> zSwz{tz4!lex@_Oh`(H7(??(`2{XW9*Pqk{+Zj`0c+8{lA;= zH7|QhDgrU`1nu%LOs6MN; za;QFYWcHfg^E9YQst`{fo7w;!sL%q#P?u+H`b<ek--9P&PDf?hE~R&PlBaebal7)P6ochN4r{wxU#31P)L2s zeSamb^8+u<9n zD9S@FbWvUvWG<8D)}hi|f4%;tV?nXe0#fp=B*ZNl2%MpaK!3aPUF~C)v!pPFd7791 zG=`-{*^aAs({Js)j8R5{C9l5;iHtlPa^D?mD%lJ^O5URbD62qK(+aq7di}`FxQ}3qS)4&=TR*$FOWKOPgU_3bK9iiQZ93L}`OtwPnyCX@ zI(JV3&ddAdqZrW=5-Mu-S-STUEMLUASm}72hQB?y3An*p)we)E5YjBHV-8ZN{YW`lC21`)8yb_0S_?GjaI^X=P2+hZonwV)w90w1 zcNYyR&=727Lhius!0FL-0?a;y+E%idaO~c|*Ygc*8Rs?t$sDk(RDLXM!UgKpUosh; zC_@yZB8Ov$Ep+=r9Z8qSWHI0jMQS|E{mliH#NHviYerz;PL*7-pTJoN%(Uper_H;W z3$K-JS2uWW$ig3}tmi1ow;|C2G>MC4Ir3^&RekAIUMck&p$u6`H+hS0yI%v%Mbw|l ze7KYgfd{_R+gnHUCZgVyDi;~qonCIiC-%md4 zYAX;UnAgY0Cg(xWm&S?pNnu!c&c;iBHjw2X^6Gdo1RfaHjyQDW@67b~ik@v(uqsI1 z%WY!$tl@85T{qJ+9jNs`5*n;QXkf&iUcivETSNip>1NOgyg@YR?6b+=xR-evM0wM> zZ>TiiJ};*petofQ<@&zQ_Fn*hMJ?l(ScxpMbPvmVEv&Ae2vUG?N|8&Ig519`*KQYr z^pjHqO(+v$ngWC+k`e6To_x{O=G5T%%_-!}`-SWm_9-vXPOzS&pH8KMQPPZI8!w+5rvq9pQk0h#! z`;<(QG2R{r`d!r)jvd;<4Ic{pg3%D!B+g29)^IaK3m7i|Lu#zRnMz6s2hT0&$Hw+W z5_K}tg46b?zA6(xS^^1G7Qsw%ELSZfKxy)vUEvN{s|j-OlAjixo;u^_*sx+f%!16#tk&1{jPrq zgUgVY5vRnIqJ+n0_a=kbkH2#RW>#wGMXDKSun7aq-l_}OGC!_=Pwzi1yXf(&x;f}| zkO9pb*2TN&suu{BCB!8n*z-9>h>wOdVd;S4Up)g3(08@e^rTr7BUUp~LV=eC4bABK zwogzA&#%>{X&ac|3I%WBC*I{K2{;>*j@uJ+-XW z;cy26ny6!wnc$MtvBQzi><8;Vbg|?qeGX)T>lC**3`5{5Xe!^S4H}&23+nvfH5UoC zk-%nB+@Kr@Iynf zTmunR%{2pxwYHXh7#UPa4G&uIpx>>irkEj!SA#hzfIa`TD|oe2(^2CM%&BN@X6A0} zCm}vT2>)~V{oVxCgxhs2P`3kTpP1y*n#TQ2TB`rAv6MntTdXjs4op=>|04ru6;KML zU~Ll>@nIT((P8W#&BRI$PHt+upFvUQDL3L=(qu>(BULOhC+p@3h3t4DxK-FFXAI+A z*(t9{!WU{Qw~jXXXGGATDdbd9=-UqhS!x-Qp!Bflb-9Dw*O0*t1AD7uJu4Sknor8b zj$*0N!WsQ#zn9h!4$)2(Q%#6q*OF#l9R$Y2KQ2Yhd?a zhRY|v)M%Ay)##ET4(0Z?RKD{dnl#zPLeFW2p5dUAc|@&>yQK>oC_44q6Hlc(Lsi^7 zBZ-Xy`O`kv*)@LQjcKfT|HAv>4a<>MLZ8JMHZ&5) zjXD)Cm0}j_Tq&$+Kx|opa|2r=L^wMG)g~BVZoZ&P^~lA*J_&;cIrHl^stJ4#A->EG z$0+99aj3mx;%T`5g?dH|%oIG|8byK{c)LALqHIC$dB|zaKC8<6G!Td9@>$MYFdB>$ zuH#ZYDnt$?nn3M!xKyhw@e@8Bz`ps5JlXI7Lz*FA7fc(tN`Ly~pItPpHCJ*h^ZMcGh! zWg2e&pLld|H&&0z#WM+759P?0wtNu%qinLUuQpZ+#BMA!1{zi+@Q-$Ch9IpxK8Q@2 zd#pswB&{%gnaJTE0x58m5*f`7mQBGVNWMnVlavzLm{AR3#~$%ymQFB76D{&}9V2V9 zjP<7IYGH|JhZKbI?C$2}XBZO~CtNL+)r7!sbYQB^*YBLlhx@dJ)Sx z)t+^06Lu3WYWJjI8Tr0qoW>RMZ*1isq+pMzxX0{U1{{ZC{OTGdd(+X8-hxrBH};hJ ziGiAZ4@p4uOX>zU;_*o@X%QEt!}W_b2XN?ZiksX~8oU;r5zQBmM_SB5H*oaf6-Uy5EHEdqZ|S=!b)3y9Ki1T7NuZ zrDcv1zn~XqDsC?oP|hnfJmFPbs!c4=!0Nx20te~6#Y$YX)NAbV2M|nHD6b=({?_UdPG)Lx3YtzTFMKFm|Cy~FYfzR^oaz_5v@?D z{b$<5!*m;`Lc5cdIa{lWSJ&HP-~-xwX@wSc0Y&#KFGEZ6t##4D~mG?GFQ%R122MWFUbrZaoO>V8e@| zQNywUNQds*!Hlz9c^AilDcx#ZJ`==l6vGz4PK{-yVsr!BWJjngNw+D5rX4nczlE5e z!CPAX9PJ!iahVGpCVO*2?{~6h(oQjL3if1l`cCBl!KZRdIAS>_T4M;`v>1t8(%~|m zaziX<(%w1bq}sN){IJ3k*LP^y^!IZXnGj3S-*ff2z;Qs$NCzv&!r~OiLG5b#o{``=ra5~-eC`_dvHG86`D)0L&9H9fRsWzO&a(h_-2<% zL1b$ZhGYhuIN1?|?QZRQ3Hv63N*Ip~!7R|1hn~MmQ(m{?tOYKrv4a(1(h}}H92c7w zo41!}K|@NEg9CDYZt5*VSD-7I8jBnT`xF^frFd_!63j|wp5=l zVhlw^8}??^OotsR!P@R@^!&Ub0ou0dQ^Mc@4j8!(BR<`E=|vTsMF4>S=4eIrjWf zKSyOR4-&)0$NW zHXDc`n~ggzZ!)LN#-t)AAwTYOJAUz#4OOFo5RP=yYc|3erL9`JSuV@%y$QSrq8EP4 zEbg*hvJxf!DbG`476L&^7=Z$jd-KESLvQw3&}SzbPB=W>BXssKYwxGdhN^Y_c?4N^ zcF8zAaklo3yD{OZL{*G;))Qvd$DGt=`3@nj^F+=4*_?;7h$o88<*!rHY)~_WDl2?8pTNS(gHxN1?AOA*Q^f3sbRVpV z-A4-tPHw!N`v5FX_z9Sl<_n;;xl2DnWpLTpgoOq7= zNK!bamoO3+5T}hFK0>7`wBRnAdDbw07(xWm11URrQb z`kutsF-M@t!u@Z@kpS<8PdgWv&HT0Q)qB$55Dp9=s=d6OZENq%>b4VaMG%V=a3v5g z-dr-D{U5j1qh)X$A@$Ge+%VU;lac&7P&(RIKMMnnK@(O(mE~4Y5OjSwb#6RLYyRv@ zL&jU);)z5tiUu?7DsD9ErRPhqrMnz^1?n{GwO`jl&n8d4YL67Z>Jm;>ocunZ>Z4s0*M$p=U!O} zdKUw(;(7P7`k6O$_iSxt+=`J={2QWWWnlYfX88Yv`(Cn`pkc!?*D}e|A%() z-{|^PnH%*-Y>2@(D@v`qKsWvv7rV$RZ4e>Kf}nz<#ko`iLkRX5s|jP5mk7IFcbYuV zdQ$Z?9%IQX0*b69k(yO}AD=E#(--Fj=T1v^HZ_i{((Udam2ZZRDv$T?<<{$}P1iZ+ zUkj3DCg)sNUw0oDVNNRMYpogWWd-R9IPTRyr=!`mv)J_k4Tztx_JtaXVzrh3?x zSq54|OTFK&DTwGoUkb~8?9|rEy>H;s9=WeacD7WC%Wt-FzQ;e`o?Vu5D&F-%WMoUN zHo7q%7y@eL58#n*}UjH=?2hEp(X! z-yFXCARl|aVh?(PoIXUiMe%8{yQ(X1;XEp=FHdziWv5u8RoGKa77vb;roX?WD&Egi zY9NAf<@U@xcMyoDb+<0f8Vy!jY{v(1Luz_lA4hGRRC;VR`Ch-Dj&z3byR=a@)lxHD#zjWpnTyGRN7>bU>dda!M zYURutS!H;i2Y1$ST(Q&X<=_phbyH+dQ7lN`k9iL2f23;vXgJ|}3aj%ki%i2Z$kRfR zuCq{JfbjGb+!H>8lxGaE5H&VU^4g`_d&0q$%iS9d*N0oXFa&=jarOjJc`S&*wb^Z2 zZcD9mHydsye$}D#V6A(MT*pT@7&aKKUb%lO%@@0T1I5BAPP$SyoSLPN2Jk>;9=n_H zR$bR+9rtgiL>W4IxwSM+|5*awFGDc4aS@k^TKJ%GJO!3Y@@pE?3TdYWrE3~SIVwtT z4Ur&E_*FXY0R51Xl|^#`()nZ8H_a+A3k=2*`|UMFzZg7pOB z&9r;lSE2FpT*1&HVN6?@v@3NOmZTp8mZTCs)fQ{h^81f8A6!iOTPLxR-t~U2Wef0=T{`VJK&qM07i8&1NOQmoG8kXmqK5D*9-uS82{S zE**Y9TIAW{-RJD+kX+yc9}*_YXJT&2sUkY~i&7ZaXOfUPoOoSNSmu=|^6Ch)Tgl;$ zEoAg3lOd6XFkx=hiscgZAsDC5fsGf+)ZUPN;=o3a#Y0P5b8ix(cpTt~%}VK45fbrY zX;_7z}La2Fuv-^0z~|$ z+C>~n$0YgocdcaJB^>eXFHN6qnPjybZJ@3*;t&{~O?p)g!CCq_Fw5((*aW4}_-*PI_yuPs6L%lf~H zN`8i02lMIA55OdG4zNhPT8x-T@3N~i$!q(Zsy8v7!xY2Qe_ic1S^*8=nAaB@58)JLYJlbiefY$f$myj}L^uzbK z`$d{G-VY?E*_7#R?5e6Gw<=`6b!U09vm2*BNbJS1*i@*5r=hlw6KQtmn9n$Y>k^jh zM3G&3x-Qe$I5u9TH^*4Tz#=QU(3X20Qf$c7!FB}pr=N?PJEB2wq~zUuV7a5r6vGj4 zz4y_Ggu~GqWu)kjHkuD(u_cvpe%`Dca3^1T8=HIC>51T$M4%=L2#4tEJ6yJ3HJ?njkrmUC+}ivO-Zd ztT>&O90Tz|hH`byNQ$6AgACs#_a=z=$>y?{3&GXL^Koa{P=bt> zA4~j6alg^&j#tRHone$L#`4G$&#`5gv}@pL6tI@1rp(A&_l^UDj@UJ?q34lB?NxHD z&{NU-kow$A$$X@Zv5#~VzDpgYSH*TDwj@^QiA7A01K<>X?3A`#e5MGo+&|U8S2NK7 ztdXf<8XC2e`)hnm3MVu^t*Dz5ERWyl`SOBZo_V(;?WZ3?FC75mw;xF~)x$`0rROVW zVKkz*S#rX09k)A*x*B?A&Q|wy(ah94Eoq7OY^`-8oqKfh78GO?AvEt02|1D-9e~Z4 zk)>-Xs^xT)Xz?5b4w6K3I3$=71mn=gkz_-<-QCBV69Bn44!YHQhdG?26|fKv`e~Ot zICI)+*up%QbJ6W^4KKug_H|%kT0H{2Y-|Ciz-J0UxdSG%68AYXVRC~g-2X15k@x{q z;w@IzzM5l3{Ap+6wm#G$)jl7WX(=Z8w9NHmKA^%R~^dJoi&8jK;R1U0yy3#McL>pm$1G)Y%|HTiB@ z<@-q*5x}9L+zQ=*wTKk>r$T(pom-?*wbSyvox}p(lov9l>ERE()&rVjK8aX*;-CP6 z89Qh=)>pC zEiqPZ!alCA`zhsGGSemISs+lyODQtxdXH~OPEAEB)i%KtkyVUauhw+!YNs093Xqve zNimI!&E=Ne>IZ1g2ZzEI!fFW_i6N`biI(ERVA(V6-0a7E%8=pGhcH+{a>T}uNh!bp;>%A}7ADFY_- z{$3mupJTg?1BSCvr-#J#BX zMrIhImb8XoMo!Utf6@5Nznvn!Eb^VfQpRo6++gAg+>LtCP8^J=&NHT{t&_B+Re7kr zG|%jxXrvbLgen+Kxz?8znEgfu9E$JkPcQJe2z3ymG|aP|B&r_~y~(Z15$l>$9v@Yg zWVZRO<;u!@+x`rfpdPf3wQHT_SfclnG09+)dBhUQHc!oNMF{rL-m;{kq7h0HUR7*D$`WkSRID;LFtVvc37W~TC^g9yjh zJ?emaF>=a-2Y;tgv07epqI4O)aC8l8Tcio(*&bJ#<%U1Z4Z-v# zc7J8J_hA}uJ|Z~DEKle{uu(Cj#bmKKo@}i#syks3^9$I6CSiefl|1QMN4R8%C+9&m zi8>wSJ0wF~u9*ByA4lGl&-eOH&2D?`uEoQt5zOvBRA|y@IkjVJwjcH#h%6$=>VT>N zh}EQTVRMT6(E8FK?9yJLgPnuxI__ePTnna{KmEBMhuX18FKl$GQ^@@85Ch}ol1--A z7(*XB4X1f7Sz#c++G2BptR34)IbpW?3tJO*Qj$bte5h3D($KI9#OTPLhl2O73+9D{ zl|ZO;2mCu&u-x-CQg4#4z|`2S{%Y8I^6rSC%R?i;sEQ z$xKpr3niz0DQeV|?2NVU{MGRIq^a%LQJ}MZ2k=t`OlGukAkDKIWt%hP5>ll@d5P-< zs}?-Zm&Y=?9pAMU$pzn|MhX}&@X>MTGVGfes-0aX25`uECOw>6;JT5G)^~Iw%w$VX zDcQ``v4w%yK#BH`2Ll3)5E}e~ksGMmZxj>&ksuws+y~5)aw6Nu)sv4yYF0uq2M;)%}f+Wb0jP}n)>k3NvX(WE$!AcQw zqT>qp-+>LlTEU;T?Pq2v6?xn|vsZY@oX&qY?onL>YxJ;Z4r|`#K*4V>Mg|+zHq4N6 zx|a9;%5x%VBw<0=>@9;$JE*BOd(=cGWb-f)T# zXFwM?LJzF0I~adDMnK@x!31~5IlDxetlDiB5+-TfhLbM0muC>63jVV|i)JikU!kAP zLDFn!B?^U_?>ti_6v*IMpig{YAwkM|m;HAYZrHpZU14<~O(M#+001pD`wSnFMoU2w zFt!lm);P>hCC@1{SFu^A#&>$$xQ=9VF z)N6tD3=r65&5D%O4TX8&*pms%*Gyvt%C`@z*`FB9b6+!5!hkIxQS$Fiz8{#*2BLg} z2VwJ~{faa`^82nZ%cU<9gwj!5=HIXK7svV!%OJ}? z*x3I#%i!M!_P62wGyeORu1DtosjkPr5A1)N!r#~GzpldnRQoK;Urh0zR^jj4>%UIn zA4N+4^ET37KGT1m!asjA{O7aqkLT*Yvl~}sZT!L=NeaGsRjQOT)jcV|BUNX||5snI-9O7iCVdVN`7 zJn>PES^WSxzph|F(I4PyVi@VK$7W-@)U5^-4Gz*?+lvKiGjI zce49v<;bod{&u(fc)vaR#_4gz9H0v4T4=924h4^JeLGk|A4&OEe|M{5PN4VRM0Vuy zat53~bBQ&KF0rA1xnJ-p3@evbJ#k7c?!lF#r;pD4?92CJ{PE5)^Cu$pDd%9Kg5W(| z)ijEd_pR@)_S)6;?YM#8`?X}}^XQ_cdzA0}iQ3~$I~E7JWw%1qRHb6^5V$K=cIU$w zZhcIJCHK9{VxzJw1FkToF#($A4=6+o8wF9$7BQ&A^ziBGY;R9fZunLzr?G0H zGakC6z^B;MC+8g%Sy*fN4J@SsWgir6n zj|3}W-Ikcdh<5L8IY~Iclby!Ehky$kNQb(X0Ao<2n(0bG2e+p+{gIzX*$P%<<_L0a z+g>l*kBtN*(JSGtSTWBXG8Z>QBv*rsrH7WPrGnPi02xu~kC$)We8|Z8rbGRp|6n(R zB@NE1<(E^=;18PSj2KcL``Q%_!mtx!j~zWRe3`txyL9Z&B18JRT>gsM+PMJ=t|(rVJ) z2~$ANZTG}e7$-Yl9m?l05bObNhKUpLrI9I(j`fQ}`2LJHnsiFbn#4UEIlDZeW@i|! zUgY;WfpJxB3&G~&09m>%WzpDxyIZfq>-oddkWGUB604KEVd#~TzZET^`m}bZkDxVD zxPd)sU%sKc&0@CR?gJA{Sv{eUSyZ7QpnWtsdcT@Mk^(BDt3G5k(>{yryA1*_;_>m* z-9Et(uC^R*1(C=^ip8!kDTYHeYx_@!rAmb3fNW^SK<83>wl_y+j$V+s>T?E$8Y^*% zlTJA@29aOlmJ>rW&zs0Okop`?h@@JJ-MuIosz?op#_Ikn;Ws|5-hxc#mNb(6Dq;1} zKie%d6P<=dAoz14s75Z7`r2(Kd9qR-BnL!MW6fwiWeeo&-*XvF3`WrsTeI`CvYjE2 zzLOY8RgTl9v3XW9V->cYIe1~)fHv(3SH9E}vUafmS%MDKAiIIhkSc z7gwOgpv3!=us@9$a>oA>mte)6*o_(3Atb-LvY&$8%fePc^cGwMI7w=d5?;wI^ixc} zICtW4di5n~YbYef&4e+Jr{W%)`oxSgPx|w&oK~Ml;i#UHU5y*dM*OIh`4}IkS*(<# zr-$?6vaTzMqFhGR&#Grwjc}yhiP6M}`ANE=eZ`ZTINQRf>3Z*)AZs6?7!QfU63B7u z5)$jgxw0)vA*nVM^ow$h6tHeb&mBRFO-jT3y*59sbUvY`hisTXLRjBEgNV5arJ>+J zvxG|b7RAgV7_KTb(T&a^5}|8rOe)^OavCAt(L>cqTj8)H(akY)n>!C)7nkIRM5~0c zcor3|d?1}|kSpF{bgMLJHKDMwCMn8TJfS14&$d|gPdubT;r0&^p<1?tTjXK5aofmB}e2y1p$^ z`Gco!bD&XprxPxJ?U;P(eHqDS&=D4V0@(lcP9qt}YA3`r9Gz;NJ12`BKoHwUGcQjM6Q{<4n9(I~EsF z6%V#Yg(dcbU!6`;PSOkmHkKDm3QlP^JITu7FByAB$$-Lpq#kPhC}+Wq9}mreB8tUY zbErCuMQRxD)KHqWn+BEHaHwV&W6fTAs^lG`8^bo$i5N4c&^0TTFP*?7q>~6d* ztg3@#0TX8-UvT@{5+5W+74FOAUO#;mliqBiCkSK~SZN&MD3q+qM4$+R@3Ghh(|lyk zW{*1GS!9xrN*ZU`-*9U#1SKs%`=<+nIl#}pQl+0~Kik~bQrK6w#5V*(dyN|PhEj;JGYTYrW*j0$fn>ngU;HnTaVx_B&3>TXQ}5vJ&$kzfC|-# zn;*FFP2fJJ4*+nc+}Oe>K>{D*Fd$S!_ia*%0B957baK{ip*T4wxkYXG({ z*Px_JDGS}h4ce5Hw1~v%RaP=2l*$_&QH@2f=S+)PZnYy zG&OXkkeS>KQdm7#na(UEg$X-w6>8~lMkUM6-_5*!DWjbS1O@Sro(6?BPGDUx~`5P*=*9!XijSVLX+<#B-cauNIW~I5X2Ke=M|#j4lxuEWqyE#kj3x z(AkxvlD39nfLl0Yo^z|VM16IGEYsQ0UElA5UPDn;k!>ef$2mdwd(2Ei8d{es7?l?b zHT3@RYsE9`d;pDBloi9X`V71|W%=jO=*A+-k{uR1xVQ*(E0yh#9S#2W7%4hRSYm z(_gA2ieS8h#H|g|>3B=;FYOB$(l_?A0`IE7Tx5I5DR|)fY!&BVvsFLn(rDJ(6LMX% zhIX7NhsGANi|^5K4TP=TjsT>7wh@dsbUF15ioHOLOtjNyR0oSK%rdpa@=i|Xu*_5V zIkI=-&w1b+oQoAMj$<@Bh1ZTNl*GUVfd%sN9SUsyw!dAEO6TkUw+J$z{5mPGlH*cRVS*>U14kFCgEyP3U8l+=CYK) z4pe*B&Pfdk$2`o9AA0@Elv&afJ9nYAy#?e{R8aK85PJ3X&ZS*gZNM?w^Gtp(yUTk% zW_NPlRy)xZq{%iZnwU%gW$DX%%^S?>KKvVyQ(@y;hSZue_XcBoVV$qV3z9G%_pnYL zP`ngf*-#Gx-6A`Oj)+upt;TSkkSvYWLX=fq8pk|b2Ahn^5FmcdGs&ywTZDnFf}0NC z_GLW>bSk?klS4ov3#Lt#8M?59_vgjJWB%lpuhlAP(Lj&j-Scxq)Gcl6rFIi*)hor& z`yG!`9KXE}8PtW9^`4i%7a=#_t}_HWkZqq%=9LNQyzpzfE&?y|3SK`Xx#WW&mkd)_ z1OeImq&<9d;hiHq~$;-)CR`zK9r(oKIbqQ!C zy(D?S3@taSHd}7qIDtnXM_9j2v(stX?^&K0=E*I8Ed_)0157#7O1sFo;I6l0RKh7b zT3YF}yJ)x-*r9e%yOLaUt=Y{B21mve^{zNrM}3%I1be0l(;qL-qpvpNafQ=lrWk?D z4tjnm2+h*QFz^Y#&wDqQgDJ0CJ2O{m2+_%YC3~<^)4_nxJ=^$0d=Mrbhz`LKa*Rw0 z1`X$g8|rFi?m(V{1t9bDcFDE{MJRr!(4voZz;o@vXnWo^nhVu3ps z4ZdiBgBFk)w>~ffoi=7>5s#$>Pudsy64Idw|Jhg=ogQvKbO0Xv~qc2XA zgdcRb%m)*ntz5-1eFnOM7Ao%QI%I0cGCNl(VYfcXWnUD3VvW%x8qtRB3IQ`;LPC*> zt`r<1Az(c$@bd19YxLu-B1!ZcSQ95%-{ZV;06A%8;}Gr)%}ZIxaU>gisAu9uJ|F9q z@M!kXae$l{Ole;zLH^lBEqiYhG#<#q5~GGfYQroII&Putg8b5e0z{o?U2TXI>-JcS z+?t2Hj}_C#N97!$^<{U?b?(G(I4xAP*vI7-{g%ej_-PoG9}ZkIlwoEn-@I8+7|k6( z2$JUIU}utRzMI#wP^TOKaY$_~QjuGrFJMc#eYS8vXwebsx(%_t_dpA}*qDN2U;8yh zVGdU-iWTaAFrqcDN;j@LVWE#9zZr6mJx!paH-QdRO(kApJ`b6XJvGNW$1FGRGf;zJ zQ(E@hO*3In7-4}msglOd4g@uWx!y%~p~K8vRq{_;B^C$n(IZCkONWrsi}ufe>!P#o$q*ji&m8RlBOBLiL&in?N{3Cy;s$$*eo&WQU9o8fLnuV0R6$Y}vQ1zdTdAo_Aj zz!fo`;0ytNwT!6(^-Uz&H~3R>1T%B`A5vup&LGcIuHNp}Z`%eJNxmlu%w5KLS(Ta` z5hliCWAi#OUoP0I5sZ>Ph)x)i7YNCo7b$OO;h`T+Wpk#qQ$}^cx0m-j-nJo#!P^S= zmF~u)Yz6VTfEPV45jzLL4bw^}swfCpWTic23ggDNKfwg$Z~QHEf8JS?egT4JI;La%#4j$3qARO1J1CjXfKq9n`N^f z;N8VfS9J%1TZDq|n+}i{nPGMcX zZK9MjDau->5pyNX@G$mk3w3Y~$SQQuUu}N%W2g`e$#nh6;x%46JVInlxp}W&GQ_>w z8|4&y!ZdYFAUOiG3xjNhSWkzhn53k%ZLd%~L?%%#j8$Uw*~K14OPq0v+Ld3d-j<)Wp@}7Q7t4w~L3*_piE0jQB*I zWmf6Vf>8XZ`3hLE78ig*qELm_PU;>|)Tom(JQ#kk4x58W1>Oe5;&=t^lRC7{O@W5z z?VtA+lIrRaW*wl*ZZ=lbVDI}9`~~bVF^0W0vLIk#=}IxEOVn(bSe%4!XbO0o)eq;)en#`ckCx=ZWfNHPP(3aOTbHTNN0# z_6pk|B>nM~a=WMy4cRPBB$XA_ybAH!BQl4&L|q8V-dK=$(bT=>2ML?cczh0E`q zVN`5Kw);sm;Zi`sK+b1XS-&;)!XtSFXUGamg$3HV7k;_6pMShN#Kyt~1+DhHTMwT; z;p~C(ydd}7JDvmxMrF5ZoMIg?FF85C2@)~T?cLhhkx%Z*7I5@>8Qfz=0O$4Xy{E+% zOEVQHs=8SKvz>%Gn&5GHRGC_H_+!Qarg6-FWr=R5GjEYQW8eua#|ehEeANZbfO{u$mlgG^u?Cg6AW8as(n zV9i#br#HKajH+JM-cIZtV7khmE^=Wm9}uDv; zU3h6WqJS=}%7=8=q`l#(EzPl;JBN(5HiX9x5y<9`zf%Z@;XmH)&V5{j9Ww%LvFYGG zuJ7y;VnvWKC;bO68C->)w4W*IaT*3tz&AD4$9WPtkHLe@U4CS6U^@KV+zX(kfa0 z5h?O-M9cmC?7u{nf2mden=bQzN`Co&Zu86fH^K3*!Tg6j!uk)X@V}Qwv>ZrUoJMv| zlp-hGF^cn@fup+HsLJAzHWbFA=?%u=*Am0mi%7_{?Wb@>ocT-?y{AmaZU9byIkL~5 zVvf^EJxJc?1UU2nek|NRkMQG4eQi*9S$TMQw()=6zBqn-JgK7@mr1_o99(S_D2nK< ztba`m%<$$^T=b_NT)hv>c(0)xDd5`laAubuAG^Nee{^{MMsM+F^Azs3d}(7+nR7-S zyfy8)1lb1|{G&{K+d8m}Ebwpny1h+)J-V=uoV&I+`FugY-{b#^{`T(tH2o&!7H2b7 zYHYXuY{C1r1HWSdxiW;;AH^o3*7O+v5Wve@_&tpDEF$ob!Yl|57r4pbq(&iskO+7_ z{aJ&y`1zp~{Y|-Pr+4W3aB+!VR!?iObT5MS#U2e>aQTw&Q>S-(Sv&LW)>}?TwUtJ) z`^p{RdV+ZGE2D8*eC6QFEpGXqUn9SH&kjG9yiUTjcr#y1!vdBMq0LRVbYeiNan0?Y|r zxBxCS6}*<>G`EB`(DKIaz4;3FaPxXhp!wNb2XqjvplGg=m{lDwZ*~JH(R~;o}H8)&(D~I!bUl{W?9ZbaXv3Kziy=&Q>yHjWiO$*C+tHzg`WBi7B`LCGlc2eqKSPQlOQ=(Z3JTiN_F7laR3@~E&I zTdiXH-##3@fUJ`m0$Dh@t&zCCxcN1T>&z`~6JOF?MIJhf#{4Vsj0`#1p`&iNWgM9b zM)n7kLhL?ogadDqO$-uoI55)o_%72LC{`P=7Q#Cu{9h@XEov%rO~(Cra;77Gu=G~H z_nmO_woekj-5e^x=|R+ozm;W#<}JbeBHd2~O|nz+@wo&e3)4@r>ls24CZaN>HuD@s z)AFl5;;V{$4?~y33P{Y+Ft_ZA>1zGud*w+nXZuVA=&!&$TUz6e0tg^meWIqjEJ%;_XFt&k&d;-ML{_=p<( zaoof^hONXJ0or)^Ou`f;(Tf$maHx!C2$NwbL?SI!kiR+Nb5@Z@IpI|D0*e&wN*7*j zn4PPol`tA-eY|m9$kj3t6D=SLj9KOD1>!vo7qFDIP!Gj`3H=;92W%Ij;)z|Y);9W#t~P#`t8pBW?IT;WIK{6*6qD*OE~SnWwR~y?`>BAS@v(nhup-5@PcUE(1z+LFiN} zJbE<_;{7Djzy0CI2jN&@*_$`zm6hp_yaH?MS+p32^|!+;(wj`d^cm~p$Af73e3<=; zz&%LK8#Ay&jcSW{VA5)HqL+LY#W1>aPJvW$gOr*xNi)W`YKd?VR~Dyoxvruc@f=ne ziuLS;v6TMqMXDxOD247ofv2>hVHFmm0b&>|7Ua>QU)y8N1%v^;dSb}dz&)cIf~&E5y>B0?k?i2hv2(MQ zu;SW3Idz^yrTi0tFGu+_(|LgR702%IicEtICMl^DOiMq>Fo=_tk-6ku9a3IIaspp0rh`asIx>ll-W`dx9hPxPN@N?ijWN7$WgMk z$w~xvHAPMqriNP3go_}ugA}?Rt0otolWtQ-Gfs@W89f zBICoN*NI|k4tK=_lB}2qmN6?zVJsjET$SV zBc*9I6me%~IjYxwxPc*x6dp{@Iv}MKFxCE^VMf!(u$x7e(h`Q!g zO2{~GvMLDf<&<3(77=7aU5hW#i>U8RvIkAeV*ymo5-1`uz|&9hI>&osQQ7^MV_l=?nq?<%Z`@qhK>Giu1t+@%) zdjyYMJxN4GlH9z^B>-7lRa?QM(3fCea)%TScqfaaOT}H{7ibcgZf$O@A4itohlIMK!Rm)2eWf-P!gk zeis*)m)C7R#6}@MzKXJEQE5zCyFsK5wsxWp8J72O%tVhbe)2Jsp~guw$q2@Uq2 zzo8*bCi0DOT0kpn0GFLHXf;H`_d{azyjmNGvKtH$l1N4eX4*}&7bW|X1mDdOZk-vF z!BU${AQC|e&+20r1f<2)hZt2Tamyrjm1X^Y@^!>AEN7Oo-P)8Te0}cFLT)(d_UBcn zYLMyk_lS-=JCE%Wz`omlQCCyZ>t}3&J?N)6@a-cHXL^qK$!Nq8H*vh6;8)#sdAND| z$gwe!+k$tuIC`;^np6ZQYY@DMt<<*8;tkCjR}ezJkF~XnD$0vt1gME4N6vJp$mqtBaoWGR>>nGCR7XT)x=SZ2iE%*QLLDN zEau)4f6NBycG%jScqkW?qD~7c*5B#!X!~xRP=&SYyj+JR?V3GH(_|Z6otII3{(VRt zKM`%cE}9;W9qwMm*(LxFZRYs7di*CIEGKh{x)T3gGLCw=hQ7|bcu%6XqB19w5AucT zqQpuLsAu?%@e74r&-4S^z&+@;K{Bl{Wvh205?@Is>(k-lag)PAjKHZ`jx-s>GwDjn zn#7N>_(F((0;xW9@GUwg88q+vqQp|Wr}7Uk2eedbUE!k6IFxFY1=c%K)sB}_B7yvP z@a$%oun`AJuvOzo)|^w51FCNLz@?&=@L7xCEqc|^L4Mazr^<*r_&zLO?9qn=mTW2Q zl6)IfdHS8YO1kFzkYW{Dlu%3(RLst`+sXB83NFKHRRZT*Vc|yn9D_*lS{*+j70juz zxL+ebsY+=S5A;DBcXkvK67#GUg7 zS$O*s1D_;L86h_xLOcUD;4D@tW|ZBIE~z;XjCRN$eMGVkKYP1-v!};LGi?GcO}VPL zV%T}kw|o9+MmJBWx1N4>VM4QSnC;PJ_QDC`SE28ia815?e`fXUo0M+>)~+K2tT^G- zV%}LSe>@x_4vz#iuDi>(1uoH}IIim!UO3~llL$$WJ`|y3Lq5~y{%QryJ{r%qB;<(m zRkncPJDOu)g4qg2^X7yU&^E8mQd4g4wUm&sH17M+*TAP!lfZ;(WZWhxsF$&Xa6sRz zm~6kKlvk4VNO6<1UhsxdW!5@cJMt^XW~ZmE7=sZU0CR$`&6UBrRrf9!V$9(!Q~kcp zpA0T-Xld9BR7;^E6EEWz)f0eW!_4hFr-tiU{TVP4mtRK8;d-|r8vWf3Nh5@234^Yc zW3B3Da*E&y<~}~-q$)iw@jV-6mVU(|b^D2cV;@prPux#&t;7=O+KPK5tKbo=FhL*P z7qw=6krc6NiNL%ET%=8++SJGB6$TKf6&vNWw`5XSBaklzJCb)os@gw-%b}hvL-mP| z1z+#kZCZnA9Bg=O5MmOzMjODR9F9x)%lr&h-~p*Vi}h;jO&&F+ zkn4@ioGYtX_i8)Q3IXAft-H^LxL0fM-L2XHQP(W+kC7zFe{x$n5xRv&L53x&&Qck4 zWVmPA#!>h==1?NA+L8gE{+u;ci+67>D5!d5dYGvt8M}y+rR_(GLtH)I+EQm-99Tw8 z|4k_LDPhaG;Giu(dxx9C7=rRLo+^okQu4<1K>bjrMtr_09m)ii%ox`zKo$mH&T@a zs=Uim9BEj}O3pkT_4PuKa|&(5K~tmvD=mUgx%RN_Oq&xD`TL)y5}wK}kdq=}6qx#G z?OEu7ATah*VR{85!y%EKB*lfI%@=o)`I`G~Q$IQEgeM0rGoc;b^hil1SL%=wL^C5n zi0;F(K;W{Y)&(El$l2oSplB;EM>&xXB}jw|&n{fk>3Go{7_@6F3TU)3CiGh7ov69_ zTH{FjQ(s@}Cv;kP(HoSm%8*$tL8|B$N88c_JNqO!{!7lk9$xAtE0UlMOftIZ$I~GyP+{##ygOlZc$$$~{X^P)PIk9jTaU*x zs^K9o)r|#&gfPTY+>-0`C6pN*|NVH#`x^I-Cs>{kDwk#4VJ2ErIzyM#~0@fo8&n|ho+5VnBsZ5uSudqiSXx96f=^itR&R0gE>m~%^ zRpKcg6Xq|irA5P%IhcuT^(ThN7aVj;58cL*hZHBc_L+e| zqpW$G1)1@wZLL6Zs6Wm8T%0qlqJS+kNja=;s%mIR-tw3lXF7Lbu?aYv2nwL5QXfem z%gZZ>@8;`cThQh$p~W~Z{@LP@C6~-^Ywq!75NiROMMn?if_(H*C7uIx8pr2GIp#v@ zC3e4I-EvG+og3NfDss5=6&So_!;@%FnrH&W*pFA+dh{wLGMzvEtMD@!pvk0UZ1zg3 z`RaHpHc$Z8ZvJcNflEtWBxUL~O6fS1Qu9XLxROXq%*$ec{#v|pSqlb>)=tS(IgR_< zMt3?QS@bX#+$k2Fz5E}O6&P-EtFdhG;992)olkw9zigi(`)C^|*qULjkyp@HOJX{B zO7M-kn2>(1Ik@W)t6E%&qoXSEWseR+k@v=4m2j8br=f_}Jq{Ubzp(bT zV)f0TiqCjB+idJH&tb+Cs0$q70;!+(7?zo>&6dVmtfU0ykt9{4{T{S?fRQOAFw#Z3 zAs@tiuaBAABh*Ce514^(N(y`*W4QM+VS}O+q9j6AU+W9&gzewxqV#o5oMwcemkS-{ zmWF|X6BmiVv^s%%IKtkZl_3f=h-sgJ!Yv`jWyDg`F~w9OEZinrg`AQa3Q|T6At%>J zO@q+1xTB&GPLRn!{LSS&nwEBV)DLv!{d}yg&EfZisv))eXaO>1M&p-6YvB4A$bLg= z6J+qF`Opit7$%et&bxgFH}E`J z;{l*Sx~|BpY_r2(%MklM#g?w0leb3RP*Nq23zS{J24}VEKt?u-qPJ%9t+3 ztT~$@c_B=N7?O1UCTgNBJ)I?nX#o43z6MUsz@!hTo!I-GL>Kht_?scnA;JdEQnGV( z^ke>>*&!=6F(tb@4-NS=R$m*C&ZeG;K77c7Q3eUTo`##Q5kyj5j%semOL@NduW;wB z^g)FRuK{ygIykq~!5NC?A<5O|2#R7BX05m20YL5Dto5m!OsNYZe@7QFB%Qj*mGOld zht)aG>}B9rb<&|5q&&>&;75Ri54GQp3n`f2Dq{y$ya($5`lHR4$XSUl8E~;DuoU2@ z2qY?CZlgEfFL8%IWWvpvKO%pELwr$(CZSS&e8@p`V zwq3Q$+-2LYU7mX1=`(Yt`^0p|HxXa-pNv=$xiZ&^=SSv!aj<7Rl=V6Zd?pUnnbJN6 znSHDl$m88OG&^)HZDjQTJe4ggF|3Oc8d5R96ZW2RGOB>R2hE; z)g$srdbJJ+^UmM_&RzC806(-o2Rmd8gZpNT8z-I!*~HK{&q-75!bzAWTB3EF#)GxP z| z{Q;Kkg)RsFYNX%TzWrZk^pk ziLZ}41ZIc7CR4aRXd>jXrkIu=p!&r5`5gEB2}g&n`}Sblzm=$JXi(2vFBLcZ-f(2> zD5DnT`1nzNQ8)Ig#(Xc_JmzjfYk8;Ey)`m9gXF@BE)<*2m^|R{Fyk&E)rtgN0{0VZ zihdPI0;uQg5R1-*JfOC##A3U;piF+R=j;@#<4JO-*CBb$)OVp~nD5I+ z5q5=r^}t#y`iaBXJGrGnt*4iu3=L>BZrk1|6W)61?#hog7>*-@OI!u0E|&Qouloy6 zn6P(7BjjFWM9@1O?U#4zTJwc%hP!i0@QvhazoksLJ18AuOl7HM{b}Nf>o5Ew4D;-N z#V-BLm;A+|urYJ~lM{~hKg}>={WmL(lBtuOi=(lr)3>LK_20t!|A}4to2B`$IpO}^ z{SQLt|Ak%pcNs>EfAtvs!;bcU=`Hw=RYm_OC-|R{Mo^rr|K@-aV`BQN_M3*j^j30Lr)pP!vwJmgv?eA+m6O5= z5@FlX$<*JjL-R5Eb|XF;Ef6}|&ca>AAntB z%11O?I;znro)fUW8NPquTjr0u92`7+dG9V%rIL_vGiQGOQNJOI4r6gV6TS}Gw)GaE z+Zm;s#p$)EKV=qFPt+y26#M-wGmc>MN3eZIr&T7(Nrsx+;r*Gj;PWIV;r?ccyJ*@s z#XNw1xR&xKh~pP^)d`?D^yZ(;@L0E`q|Y#1C>r;=GBofJ((>L1yxmM4l%joSysL zqglXXN^&xRnZenr=3_K@3`)==E;Mt@s6{M{sI5!XrgLLhMS~YLpd%ab zr=P;=cwrcPP9pZ=TNzsne`>cbbjov}wXr0S!Jp-n@ngVKWxgcnX}S=|C2s zhEdXiSU}_H5stTxpi8)nTpLV1c_Xq&?f!YH0?^TkvWvfs)|L^haw@E98+*JKh+>N* zR`k%m%m&P)I{EQ&8kr)XRxO~*PbongCWVr}7uZUQSjl~%b262f)=0D}G(yZ0{2se2 zVF+oCojKnEpDjUB4A8E2NjlGL-{VU}Da&IwH+NO#E>~3M=)ZPz4O{X|twswmuhWkW zo*!ZJA&XI%nwqhKfsIt;*YFH1w=#7zharXC@BMTo!jfJ{ zfVOO}HCyoG#XOOaya6lugjFw3gQ0#C{J7uoU((Mk7$G^k_g2(kdrn~yQ?O))L5d{~ z88H+a&K;awj+1jESJ`m7CkAk?mh)L17#4b~uwSDs(h^%%Cli5pWCu3VmIKDr2`td` zp*IX%jal)pG};n%)^pQkfN1&QjJYL(R@{n>$OMEiNK}@62;Y2cU#~8j5Cv)yj-3E_A(tGNya@EQQ~1Z7tR@uZW*C z|I`n)F2o-}7vrK@N+YqUV3MY7m$|ki;SfjaguAm1`v7!V( z>Loy6+0m%&EZuI*?i<9Vs2a>fARRJmWDWY0qx0tfdPl?3i}Spl1?C=kL1}3YFIz`Q z)s4AYoEDO7LJ3kXpCdP|7sxgyR?3<2VDUvPl-Kkg;Ri!8Wiu0ByZB&6`Q#*Ke%lD_ z9U^s}M?go-J-82rPyl==7;HuazvH%LNvyuNViuMkn&15vgAt&!z$jqtssXpMP{ug= z@)aM+yzQ2z#?&c;mYD-?qVPt?$=RH8aP(@TI5y43rI{(%zh5ws9L>r}5tHrrsjwfb z3vD0Duyh%%L>^P$G5E$eB%FOM(!yhabWkU3tRo*(r;6j}^7*{oqR;@&N>(Jqh`Nf4WB=ZYB0;BRPc&AIvXFN5*=#B%=UUH8*nJAc;E|4*G+Eu z=qHavMkz;QC6CmFyIc)%;72DDgyuR(DcI`b>X&>^-3=2%NC2BxTS)2Jo|awIhqJWO z%}1Joq)*w4bMfbvCULR{0BfpSEi1<#!}KJAiUe zUeEiBf5jq{G1#+WSj&wDPRg;9PpFzZ3to`8g{W-7pLfsq(-md>B%n;2MSa6ha+nOG z<-|F$qMD+XHC;t;w&^0)moDy5g8Cy=|Yv}zQjR}5`qYqRc3LHUxiV(}1IbOSos zst-oe0_UfWA+kj$H2&o9(<2^6K8tjprZTMq=jfGm?8nCSLCYnfFE;`m2>lF)Ne6WA z2R6#(bwC!w?dO7hFqej!;;fkgDm-~M-+1(2S4L~15n1QIml1#HE$%(u-|uj}n8ddiKMmQI+SXNPKqiZs^ixrkCzx<1=;AvDP((c; zjV*ga@=v0de1uCHvzhp)V-uCLRX{>sWIY zF2oe5auxM!X5HTFW9AmwMwu4W{T`U}MPuHJn^A*>&#T9nW{=8WjvfoW7!BfAzk8Tq)9-CBM}x&F*=DCPFHXTwy!h zqKO3stYF~{%7603>{z*YK(I)vTXm2eC=N;=f*($9t1H$@zuv6l1Ruhr0eyGpv&DUD z-K3udijpQKnBTA3M&azyuhZ43OFsPvjebVL3Fo3=R{a#%3_*n^HWDHC9}2~g&L`*` zWD`M(i0*HH@Vcj7uLUPDGKh)dVz#y(&S15u9R->JfqNEw^r|NT3KY`u2>YHwG$9Ql zdVK=9RQy(cNbX}q+Ym!(mZ(K@(+D_qdnO9UE^62504U#-812gtuKXlZupAaW?7ALi zd}^2lDJ%z94*1e2vp3H}+s8p-TI|pg+sUhHjhMu_5^fO}1NTdJjV6GA-gpyNI8gI0 zl2r$le1jyRFcB(9iiZ-e!Qq26cyWCcOK`F%(|i@4&5+#d>@@>CeEv;aFHdg`B@Y%( zl@O|4A-1TK-tEixw`dQT6>;_7#*?u4@)$}NYjS(V4P4T~qU3l2p1Pu7&nR*bl{O|x zmO?q-4}YyrP*^rFF=QvfUo)JkB3vsV52vy4FWv9p<#@A=#?@(0ldq4)5uQQV=` zJ^?8x!PH*u)JxXJ$L~;}xQ1xH8)JwG8}~3Auu^1L9VNASr-S+OW=(M9tRVq^KdM#( zesn@(JO0*Z@F#PtKGfk^kE;K*1SXw*7J~&Bq1rsC;O`@L!G^2{!6lf%)#qV z_!Q8UkbgM>|3hHO{9Q5k*BkztLBEH)|5RZ4FGt}2D6sr{9{ewkz<=%jzmCBF?ZaTc zLy;L7*!~R&_zrvd4l({-|L<@Z=D!AKw!gz){(WoT-@E>C`~RirWc%+LJM#Cz{yOeI zWp@01(f@db|E~EpY=0f>-(TUMp`ZW#6#ly=r?CBtAw>SPP{HHJ9M!U=w)asX+&!hEjgsDZB z`S*$Y8D!tubFAuTc6>MfH`DDVuln8>TR(;UrO%_Uo9jLFZ^X9gMg2tkenzU&3!*-?H{O?5hjtXcztHTO_kq`LR3l{_^|i_^W5_>-zJk_d=XXWZ7mL z#u4K}-HjdpxE8D5RGGLfr2}(mHl*Ns@{I7cHpbqLC;zJs$$8no7Irfx2EbB_$^Wk7 zYt;X4rg!+RHXrvB;rv9s5cd}+XBzTkU)cFS2^@{jEZfHMI~ zg1NQ#cIVsN?13L*y)tCYL{|S*gISz4Y^r_F^7dyFO@TH;u0nGI;$dOE6+X9R=Sg_M ziuYP0`0bN)qn-*idZk|ShpN5j20?{oy)klI_!I%sBYdwHFu2aWd z8gkMJz?uz^W?*kNGnGuNSmgJ(li^5*!K)(}|i&MYhewXU-Kj`BwOC-(EpIS~3P# zwZ=I5QrbMI6t-B+iEWYPmGTn&(yHskesN6k5KIlZ_%~ae42Nir!~Ka5Fx2pLWu`Ly z>;p7z1m;q2Jq=`C?zv;Yz`|dyj z=!r$j|1}e40gJ#AKNQ^%!wd#NEav**0W&*>Y-mG15X&(k(aP56=Me&!@hCRph!p=( z>}+Pt$Up++uC%VjK-PU`vWSr>!Z~dpuabH=4q+QKW~7U?87$T-)@L~-MLcJV-{PLC zq|5A#ioRFd6^O|2ip*j48aiN_3A4vSV^`7QQb(jnK2i`P;GIRuRS*yNwoP& zI^P>&h|(;un2CHj>kQ;tq!>73T6#X4pZ$QnAR+W2i(7>3yvsVD;9p^Pz~QRdhwSJf zu&FhKy2DD^9AZo4h{Mu1!tzNt=O-Z*VLQE|4O4CdZKszsyJLX>d#P|8lyKvW>< zN{qG)K~(UkHaBFvs8A|0TAz)Ut<>kMrFtFp(tu~br>26H!i+k1Q&6t#J$gX_;=6;X z5#M z9<0BFkWEp8T>qJ!wFD-TO9;1d{R^A7*sloc@`o(l z!t4qcLMqBO%fV1Xbp+J8|KvoJ?rb)Q$0?mlF#XUtq12!F=;u0A)^s{~Xy$lzq}GKr zWlCh8q$9`iGOM!uD%}i_3>YN9e&;!_~D0ogWK}=tXbMDXJ*cCy+q2kVV zxwPs)W0WPrc-2J)Kym6{M4jKThk0{6B#4r7meGNLF3ItA*Tp59nWNKS7Pp_;^ z8^M)w(s?>+SU@QEBaXRcWGx&g2>PpoF{)N#&`ZfrAG^7;@bKA&Z`*71*=xp4||4vN6-7W5CLS;og+_ zc}>{LV-7;9^P;^V0S3|+@s}o zEg^(<&Ba_T^%%hefdm&1SfMB(Kf_Q4%$Z;qt{29Y2%$@bw_MYf2Rh39+A4|QK>5FU z=_X3G7*h77H1JbU(*Q|iLiSC?#Pidzf*?z*RY7qk=*Plx|J%Pt~z|=eiEDGftl9Y&ffbtnlwuLbQ&V2cIzF|{2bvgMVY=zY7xZ6_DevYTu zJXo7B!1RiCGeCy$InxB3<7*o_4)L#rIm@KP={t7O()cTa#WZ=amT38&?E5GviW3*6 zm{AlpPKoG6pJHz&oo+*vi`sS6{bEo!G~|J;aEN-b#+sYS2w%dB{Nun#pR8sliH6+~_3z;>8$X8H-%VZFqHpk}&P7gs0jxc7wwC8~fJ++dN5$05zE zx2Fg9F0|$?*_fO9Vez6agq<*xoDoGgnBX4EkA(kNSRL z&KG!6{iiz7B|e43aWCS6m?&=;Gnl&}TFXjvyo52x^kTM7KJu%m6Y6>%7=F1)Hae7m zGn6oU1tTfUT46V6fvzwoc_8#3k_nXwLG!5uN?@fEy&VGDN=|=%#)3_+&qXTfrmvYZ zn7G&**DE23vx&v8!KL77{gl*Nqn&N;h!s*q5UvE4pgqbFasLZ7mi0xV1xMK0w+t10 zx&Vw;^U?GWLXZmVHebCYWqSar&k%vWa1*l@cs3^=vJ@pDaq<}8l{Mf8?RkKMk4z`B z#Q{*v^iGLd3I)%fwv)Pa)Xd{!mdDwLyGd0Bg@0%<2YW6UqPWlg(M&3W7*4L$6P)K(Q2Z_9$1sb3bHRn`Dd>BMj{ zGnB@|Krl1IY^VSstma7;91wyR<2C)|z?88u-L8VAJ1acJez0iR-wyx`b7q;}vu}tJ zmvRaT3`}fP4X#gQbRaxlthz?aIg&>pw+W8kAl@;dnEWT@(r>)U3hv8RMCFWAttK3? zNlHpZYOwxLxy}kdP zv^p0Ltc3#!@Dx1A%f&D~nh4R>7CvFxeo4~V`0HiYGAu}A;x>;t4xifd<7hsekl2bX zzh;kcDX9$u+tMD@_OOf(R8Yst#}rIGt;BznmTh4C^WxzRc)qQ%Lm8tUOC~4X1(dC! z)X_`Jko?h8S5HZX@;u}P9+x)nB?OBHWx9j=|X1$I#GStde%9G`Y`CKy(CV>h2*j7A{Q)rzmM~Mq~{(z+ygrQ*O38 z<-;bOVtLvmrO&xV1Pge82dYiV-!nMP_NQ4_Te0KOxeJ)*{ZT`pil7~``tw$Rm$)tU}wXC%g!_NDrFjZ@OCQf?oMBo>+DX84gZ(|p}uldE+Uj? zA=8xWT6baCdtX5!{aiK$KS8nQg1I*ZNM#;#2_0BAEiaIOh1w@hw4U+U;2f2r6e3gy zC#Q1^6KlvgsvXB~?~Vjq)NCd+@&?I4l7WuMYsaX)m$C93?&0LcXOc<7N;|ZNNFl0g zxaWlT1~+y5^-ddz@0jo&C;{u6KVp0$&dW z!7v&wqV5Eso@Y$vI5H_?ZTs1JBP%L3lxxVJkuxJu5@3aMpp%*^o_{kn2rpDvfz!1v zLIVqW_5AWsg)p?2}~Hv_oFg(kl0i60EGgO}ss0V4VuwXD%2!4k$? z0~5_xmxO(Oj#5IAhzj*ecO9>~tLzrSCuWtB0TPy}+Qa z-eFsHhx=mN9)Ct-rTs8ml)78fa;u)c=x|lC7^RSm^>;iHyRR}aCgN;uf7W?Hv%gtmFd3kxhpZMrB_9o;oW!DZYJ_Y_>n-x{lmLwQt8fn7Squ?1p3F>k8UTWbi0>f-qb zzaGA$32X-HDYr0gvsiWZGEaQ67TFvzhJA3IcIn{?Q>_dAFMs8vL>a_&F++{lsUC~7 zS`CfEl66adp)u$fZ?YMA_r@bk_6Hvw+8N7g3Kas{$hV7&)o|n5N?>r5dZ(gd=!wb8$M=p_8>)fMX z37In%jU^Fps<+3(fM{kx_F0#;sV9L~UsRVrkHJEl7NZ&n8?ya{_b3WR=et8gipmup zbH(6~-H$Qxm|%B7?0Dt45Q#^lz#F4s0@8RLa!CJTxB+3~*0qO9SjTR-?GBR4xjv$= zO&lB>ufy_$RF$?Z?MIyefGqbsR}ew^uEQq~=brDE~1UFMO9W4vk}lSU7@`W&3yJ5d9VUR+Z}Un&T@gjD#yF>J3syeF*k~ zD;XfR=|Q=8-I$^(^dA zGi(68mXtN!0Je06G?lDdVcF_66G@OW`JF?}FoYEv*9A7Bx@=I3lVRw|Dw0Lh%icxm z_&_}Fp!(?vhXDrGfq-dpER~e~yDLtg&XY@gfl?M>WTwGzG<7iy^AWi6)vJCfepbR* zJY8HyLPVdwipmm%2s(}Dj8n5HK&SMv#4rh zQ4!g&p7A+5DC(@Fng^0V?x3p=C2DEO@efX-_cw)f9?&8B7vT?uW%A z(NQ3+CxfR$Inm*=05N?ac?McJbO7Yc&PiHI^v%Yixl2u^<7Qj#HfV1@E;VV>0+>y= z1Qp|;VBm7PdP^z{hZDZ6e#aac+7`{V%>AvAId0@MmClPP9_ypAA# zK}A%q(})bXuyH&Bq=G19YABjEtNJn;l&X^=qXB=y1Wf$|=M%5JM4vxthe}VjpcI@mpeKDNI zxIw2=K&;d8y?c1sy?U6sza12Q2sR4gni9?>KFl(wG_2V;BF1~QqQP-Z4;n7lS!|QB zN%ZJOu$&^kC9YdqH&KUSDnuVipgsy6Gj$!8&oWx%fbP77HLC2S?wqj`~u8soWs`h+kC zw=y0*05vWs>-V=oA`JfIPOl1PVhaGD0qNrGcm}1`z?gGIrK>_A)byGW-dp!8{3RUv zxzRt1+v|L52gIESkS{~~mKfsclz#O1kAJ<*#ji-JPsY2Vw0#zVA*vwu**nk)g3W5gt1+FPNMhk1P#9%APHx&TT?a ze%s<}2gg+=(uB=<`+$hiC8HsW@2NP}f^Mc*Qx7z)V?M7xK6~rT8EeZ5aWg`)L$(Y& z7b%A=xM@hp8*!<6Wy~aX?R4^f71%a%Z~QK_C~&H1`@lG?M2!`C9(Mq67lXYOPGYT- z*dj~H)MV}Ie7m|mwY{Y1{qoBoa9;dZjN#u*!e6ur8zb94iDudUKQV@E|B*5Lo4@$4 zF@}Hd{s-ao|00_GCzb4XBn#VL`qsa$^L>i%1tY=#YUunw%00h@vHv$EEc-vWng65g zll|Yw!2dL&Mfcp6v^D|#r$&_*YShE?5`N`%CEC|{NL8q$TIu>(=2_2c?YUI= zcgLs2=kf>NuKq=b*!kJ3@MB}`NJ+Jb%SY?kOqiCQYORPWd*X+O>PKgeDgLF$PKt7&=a@4va6bkR_}HD-sPpaK zo{E~U*h@hFa+*L~XJ$Cd1{LP2W8sgmFWn%nWyHkIYa=Atby>I}<^{Wt=Uy=MdXGFr zZ$3lxf5cU~RiKApxlXM}W{0X;8D+amOl({uEjB9&s+cXzHVn@6Xoa6K0}oW_6L>7i$+A-< z7o6QbS;(qFR#;+ZZ=Ef;wR#C~&y5MfODe@}Z(RrA?$npim5bub!{gh@yYaJFS^szr zfHw~-LALkXTp7%-i9sfVU+3B9C6p*%oAaHf8(Mh^cz00k?W|By<*x&Nu~!|h_%z=b z!{vzV^%#iD3cD&TQJ=4_CqlGh*cqq0qpfx6xV197DfW-b5yAR8m#*k_aN4vofd7C_i1c3LA1qz&iJGZfslkpxs> z?Shl+>ZjJ6q!#0k-;!&mO8pbcY4O+ALb_oY7GW8Phj`s3k58hINtjFHVbuvU)6;fp zursW*b#e+I-e-8BgU|hgy*FuQrZ@(oJ^G8#WR(j)n~*E^ktTyH>~a;W$@V(P#OL&` z>W-6%9+_!B5#4wN#dty(7Qrl?h}{aySFC&84oCZ@sVj=6cv*S8F+85@{D}SO@-D93 z_uu|j=5|L*F@$J{ePo!Gb@ouPM6{K}&gpAqa;Uj@DL%0_6%3y3QGbKsqa%#h={)oDM?QFbVsImU4 zgd2a$5RigzP+F9@dSet+_y}4G0InD!0M9fP#yIz0nnV^Y9l&^`rC8Qw~8WDCIZ6!eOhDZx|pz-iIP zUSnq(Uks%P#mbY#)`D5%eRzJo4wI=uW{~5}AJV%HW7zrNJTJ;Juqdb+#}r2041YlL z31w}Xvi%ChL7uxFf)vNlpm;xYa?b*Z2Km{KG< z-ek@JXmG%v)9^gj+gufCd{=^z1kTpj*+JExq%!?ykNEAGpBYewP;Vt_cCndZlfoUa zC{(W1hQvl!j*i z_$@VH4z(?B)s{n&%!uhNI z?%lUUW}GV`{I!fg-8qIN@W(eP#jq}X(`(%rE#S1L$zz5REFrT4eg`WVHSC-@%z7uEWi++%j{K`1U_HZ%weTLKj(F^xsdD(Bz~{UqADQvn%S0%|B| z{vdb)LK5o=%t}cy$o-RL4}}S?K?0$G7ZH$svp`PL=L#uU#dfM34u_GxHvzmVdmTXh z4LBo7(f$|58f3XT)NBWQI8|5?si(pHNFWN``nbqyRmpffA{BM9y><7Nj$_k<&w>Rc zJR(&r{MMJ9)OFz_n4wjZKr)FLR0pJoLXuSoFKkE+Lc?+lojXzCcQ7y|iA!?G{*jdQ z+1K0VIe#^BbHauEBa|V|@R8$hLpujpY-k85IYn2AnJ)X33LwpG-1dmw_g%=3mgv6b zz`GaYbk{~hrD9!|oah&;hVsjMR>}=xOjdJ|ea~c6?2+`Zf3|Zkw#Yyme+0-QqNV2=3 z`UU$M#mUPf<4jZx$G+L<^(r?~Yqgi3qKx2E&}997F(ojMU9v-5iFi;X_tlH`L1y5U zGu`-3P!h*Xf?|QaW9A+Huafg|_5rIFb){V!#m$R0d3|WdA7VL-Thb`9o&(O>NnCy@ z@sYMj6MA=T;9ZRD>uolnf3rW2E66TStWH4CwJs% z$z^u?S9d#7A5uo+wIsAdQ_w?JV@UTyvX3C76wTy6E>y~s#;X>FYzlrltevx~W3F1s zMCLgl#q)CV$J*=!$&TFhR1`*FJLCL*(C`v-d$E4qo*PTJV(+m%jhd0MSuG38@;9?y zR)p^~95nKR?YhzJAto|`XYS9x^sql8|CtJ@ZNu1&j8TYfZ=VU0bswn{jIlF5M=wuQ zKhclU0*lKz;kj2!=GL08Df#-UtVhuSI zf-ov_-d+{2Memdr5jC2ZM+RVD&FHpSeHhgPr(3d z?qK#1wTVx?x~Yu3gC#naC9haMuXIdM;{0e;M*BWcP!>LC>BA!Mv(vDxpS65>?rEq6 zd&0)J4oDZ4bGPZI;qP>R{xC_>0-?FO3jk!;@jFhRhS4DQpIOVW_kN^1Ut1 zbG#cH3!r3Nc`<^5ex4lH5r>bIGVoxgKCd8=M+?heQEkLei3BPKAuZ$=`H9HL?(CYk z8gNYn$6JW##3CKSe<_E>Ksl*mcuF|^lFE{eOLOM%8VxU)kXHGsoWli+hf-n#6M7eSV5 zyS%o-;qJiZGJk^@R3x{Wp{5amU{C+X?GE2U#u zaEBb7lIc*ZEr-r*7?2^2EXoj69|Oe(cc9FkF^*A!I3G)RIAf-@^i zOk)W<{76l2O$l*uZmugdY>bmh+^b89;xzdM6)hc=16PgY|1_D=E+Jlm$y>5QU=c_U zYRER7;&`%XA1u@+txO+?FE{?&+O&F7VS}DDX11fr@TiW%4c$* zliXS9Mj8RPd2h~&YdUPAbbrZv_3I}fEmp@>=;~byCN^dT{>F*mb2u$}#g$kLj%g=7 zXsr1F<)lMq-Qdnb(vYjVK=_uiwVoYs&5Ia~X6^V-UdBDm{~QS6k^XqVgjF%GBkmI7p8XpZ>i>Gk%3 zr{Y9u2xPop<^_y=C>uFn&r!94Dlj{}S2zfAcGn)sO1~FiAd(VS7zDBvD*!+$I*+sc z;J}QiZXoZx7KzL(lFC5=(zIm>Nu^~#n{h$8sQ>8*Pcd!C7@ay0EWC=WPNCs~91DyD z=RohK$1&D~Z$xzutcWG;JB}CbOT$Ql>kdA!ql7c-aL~{=g^Q7zElV z-%sV@$GUm=OJ)G9A(BHfN?SP1;w5X?ydZzNxb)u58A^yQe9^jREHjA7q6VD zNGq4%R#>Lr1!S4Z$s;YNKL;~@Zuue7n#yFz`~@hNplxfWP8M_dUQf^fM{!@2q}5Plx*0+Wh*^HHe<*u(*mYaU2aKgnp|$+rUe&QNb8Jq z!a?_>a|cQ?dPeN}<%lzxv0rM2oMUURXTWJu%PZ1EIZ1OdyX$=*dH)TU7SMwzePI3! zF1ZVN1uVyGE(LJQ@Q=ys4BLVMULjznRtD=C!?5DK5WpW|BsQ}-2V5v9Btl7T1yE8p z_obbSh)xK`aca_$E^mnhI8J+(>@^?OEO)maZo(a+#Eb#2O!9CwBN3aBRxU_A6mU@+ zmeoL#)kB7{A**doyp|EJ&XE_4WFwmIRBY(QJj2xeatG-J)5Lp}}Q97%Z@> zaP>+{0b@ZnpkH5rw-6-qa%}mxwk{|!%fhw`;^Kj}JWRqeEG`s>$;LL<9d73QGzww$f%d_9pE{rZ)Cuh{BwbLUf{T}`yTl) zk0~Kq*vo;pl6t$+gPV0+xpTwfm|*JQ?aoMUc-CUy6nGi~uEgMy@wZeQ7B9@M+M4)xvjiJV0Q&M^QBO*@lHvgPJ?GC9$FzvA-G#xVBb`NEWS56XV4gZozz4L@o z0XNtRI<`aJaZrn#vo8}vfc{}n2(!+Q-D7%KzOx6xTeH0PDV;^fkv=QDPRaEte1L_S zPt7Ch|CJyhL?ZC~e3s_DNW>}Pc?+ESbMGP4n`B`^2cZvyHz#$}U|(sZQKRKlW%7*W z)BeVDPjoOAEVF6wS&a&ZM`#OG!7@j2aQF(P*njE`TxLFSz8cL#DXLgkh!OVFkcqK> zjVSO`mX&o^Gbee?D=_K)=Wb*>g@Lm7qp%Zqo9cEs&c z;2ZBE{w#0ou(HH5#0BUNyLSu|w;pN}wfNqV`$AeG*4ptd=uMZ12#GHCa6z0EO`)3N z8J4d00Zk*Z2$ba$uILULi=0jQCqS)@{E@d64yvaiI#9UZ#xLGoof8W}9buJkRy1}5 zf*p`M!&^{Y0R`&iH&7}@m8R^usJb?}3a_gvm$Os(QPN$YZHCDQ#NAry%``g~3&e(&r@a9j8P3a$PdZ~Y4*W@TaiC$yUV zpLPEKvk+Cm@Q3Ml39+H0sjc&0@dp1Q;(`6&tPKAY@$fgw`(Hz=|K9!oCtCeaLF3;* z_J4w1fBRAXxBZ9xAEmPYCwBc0Ox(iS+0^m-BdracO+`$N?MzGwzIQu0JDM8WK)C}} zXG))pS zluZ>-aGDhwrzjw}yMWoBQKpVpl8s{C<=DSX#ZCYx^VMi=O}eFk3*|muOq- zv;A`IoTHjxn*Yra34vVT{mT1gRQ>q-wN$;Y>wV+>aa%uo{r+(J{kr!%LJ+@p`pc*1 z4gD=1D5=x3Eq01ytv2Usi&mdCoc%Y_P-jV}+~rDGS?=Vi;Ky&UcE6{epEIxp(4gLy z&L7Uz0a&9jd7f8aOahO&Uorc=p1_#)b|tVGyV$IuX|k_y+HxP+3y9q8(jVE`#q7{$`PF49NfD^$)QqU) z*^F5Ic1;V$Af@9s0YRpz-DGGXte7qk5WEyik334r;c-x(JIVM&9SO#Gizl}hY0&F9{dY;zW1H) zK1+LAWwmd|tz}MubzD^#7uGACbCGt6ti!C8IZIT$#ZHBHc>LVmw{>>CgEiD-;Nvf= zPPmpC4rwltr2{3kt)kF}kA!Tek_k2=HC>^{ajhG4dK{C@fb@ zs@L&IjgSmR;w)IB$9_8ba{_oEc3G=gj&s2t?JQ(S z!iT&S!DrmC!}8}ooZD%cDOr0FA!tex`QCw{KA`_zO;^0mWXw*_nM%jAcyXSI)gUeUL zG4fCLTP=PV<-HS!%hxm9EZcO>w}$~wf=-IuF?XM1Ge$Th>4wS%*xo~HJKpJ~#y+oW z*ZRcatC)GUJ=c*vQMn@6aHv3$^+t#RHwrTdu?XQ>UMg}WZuPjPP5x8V)-CrzwyV_( zIg7&#QCFFW8ug5o(39I!L%gU%7wTMreXcfB97v2onj7#UeCES6r|P%9+} z?Q9Qw?2jmnP3Hv{tV_4Akuokrz)8Tfh1URfmk&<=V#%_}^odQ~yRu);o)ih}xOvv~ zl72!gs5gNw!jjNN`ezvsxBSe4?DD`HKy7%p@*~pgrlgXNYIlhcMD5hKD=wxYH$BJi z_`VIpLtl7|`DfVQwamOXr*v_@{ah03?=n@-W5bc_8ij`hKmHzJ#j`H7GSnu`c(wTo zmD&g+xm6vnI0>-2bd@dpwR4W*G|HkyD@hq^f)OOgsOZq{yHHlP-C2`kfd4KKkvUXA zB46}~Rw4uN8@l1cGNq>eqB9G5Z zEYpr9-TLWT&eK=3YVCV^Mh(3rIjejwrRKx4>qZ+Ud1Rm-G1WYqI1p!nPtuRr_ zOz2(bFHlAbJ8h{58Ab*y`xH=mB;}i-@Yah$^|wuE(W0e;Vq=1cI402>9!$4ZRQsFP{}1012` zA!2@ktG2kP-qOKN+jW@Fe?5_i7e=bk=Df47OBD#qxjwI4fTYKsaxudUg926}yy0PH z71N@M?CyLVODtPBRDW8=U&{0s;BWIZviFxW(2>s4O15X}L_iVAwAg7Q;a0s@jnL=h zja|osTAY<$tMCsKVM){g>z6eb(par%_U8t?9H{!>WVh1TqOvxV=}9G7@fNhCL=bC8 z$~Q9&Wn~HiS0P!gd>ONZpq(77p7FDn=$&6e~zy zBLJImKrTrYQ&ZMSk4SQidBR8}gk$fhQ0g&rYrsb#QE3S)YH=hg)TfeGbkr}PJo1*y z-*swmpdYFh_Zzv@Ek*K&_aklY9>xoc?PqNOsb;?wln%CqaR<_L5!+CxNhIo7KB^*? z<2$3Z+LAOJ#)n=X$PNm%JQU(DsH8rcFO>lVB#rmLliIT$tiZ^bW~^-kD?sE%mT>k( zs2i+FQ)L0hG<`ONR}Jp~K!64dh}3>=8<%bv3`^b3?>BK zion!(C9!fqtg7HWq(ve6@)5wL2R*GT^;ecof2%2v=ZKBZ6s<*Qws@!l((tVJA;?3m zi1NfW(SV{M8xs6Vgi;UBP6>zKO>P%s;vF)SQJijvW7XhS?3EJJInnfP7}jRJI*C;c zDvVT=$>vk1v?a+p-SYxa!!MuQ9fC_7G>gX*3y%+Q>sU&8A!K^)YAsFHlYNV$$bP)t zLV;o`#!18DQ+=&3gVdf7L>&ZS>gm6f>Dyz zuc|1PY6mwMEN90Ovy7kBXHG^EA1@{pV}nYd1hnuCS5}vXm?_r733T^M!pcMvgv&yk zPG)lkN)06n<4e^LgW{ZDgrH+F|(6kI;ET6>{e z)7s_{U%mvCaumtd1CZhp5Bth?kdMCV2Zkn?3O{4Q1uD4~5{M zvaN)QX3hALAnr1CKFCzPV~rxmBbL$+A~1*Y69kR35!1~LvEes%BKtBBlbvcthdZG$ z%=0Eg>C~~;R&Fmi>;!@srb`Qf5G;%6p8y30??YU21^Th-lHh}`I89Ad3A+m^W=4R{ zJGtPgHIJHxAYAn`S)D^;JuOyZTEX#+RF9Vg$sB56Es zPaDlQJByh%6Dg|6h)bORKGrUEH$H7=0UT!*8upDvPH#86-*RDME+9xksmO^h;IlC3v4bj-hfop z;lv{#+s+pzQ}{zj{n_EgHYK3U z$9Nc+P&LbNA~B|_gEx`%tGId#QrV9jWFopoLz7Dsu(Ux`-$tlP0IeZS-h6U#GSK8m z%0#~CL8F$m_~S-fbTWB73l4uVWiANz-@$Z1eVX5-A$C3GFX=?(19S%3zp2O9knXk1 z3R3_*sHapEkNdU=hy_YbYBp;BY&Q(n)pYyM@Zu1JY`)#?evmdFbijN@LNVJKcadv& zR*A^;IsTzOpu2&MHyv8YDTXpY0_~cGV_Usl z6TXT>Z}WG#KAD*Uv-wE9{6)QDWu`sa!;0Xt^zWFnYS1R}60g#FlIcAusTXLBBl7SE znhwS!yzVCw#p ze8~^|nCdlVu9EC{OKyZBx!I#rlH%b3WHl&|3e#B4u@O_LnN{4@6qM^a6Cg9dMfcDx zI3TE~C>dFr!G!FapRtS)p)lU?oT&uK7V5LMiLC{Qm-~@_YByBPz?KmIR+|}X8AO83 zf}0VHjAp_K5ijoI4fWNdMCr)J_o;%K7!A|;o6@##s6)h9%xE27ZL1xwEWvAt&@Ej}Swe;#_b}(; zCmAzB=;~x3P2hoc^jDqr=L<}+2DgZ@+R1DN#0O*P`lnxx2xOktG$LG?z%;{DJE9tz zdgT)UEyi%08n_@ajej@N?&J8POScD2PO-YwC2%%?1|nOj3(i$%0|n~PHxzqGVTS;X zpW^MdWUOO1c(V}nmyjxvVvPs07&VT6u|r|rX^SV~L!HD;4WIWT=K_$gIU4j!7jNlJ z?k%Z+S$=Gq9IJ7gdEzg)>-2fICa)GB)2>3}41Lerr9Na{*pbG(gHA$BDN&|D!8&PN zM!eSBq)d_#e3TJIq;$f8B5krDqce!g(%fceuAQMrq_EHvHzeD-pfCV}5h6#VL@jCy zD+L}1Y>AP&fp3J0g#b~2%#yl|5Z&wXbw(pf)@SRhbW{4Dx`#i3me271-!JQe17T+s+?Y$f74ke zy>3d@@an`mn2Q>XPqu?ZKla^SfX`u!qsFFIt$n1-)Oq(>3A(4Wv$z=&*}zi1|70R) z;{6ikwXah|+RTl=Sm3n8tx2K)#7I2D-6gi%GJKmT^StxYR10MR%t8x%>bJ&F}90dLMJMZ#wZ< z888dV>WGPtO?sO!*~=Qcu}V8SBe(VGp^=5LcGT2}t(d^d5@7CfK69qb&LtK&C}rP> z{9P8Ek#?oRp&GRcDQh(*y+i84fw16eA)xncPMS>a!i-XFfjiEh@$n#wNJysZjaB^? zxp#FU32`>L^YkJL#9I;|{zIW_`Au3~^vmf9t`&^;QXtfs@94oK)V#$4&rJ%BpzYJK zw{u2c;pWyMIAw|Rpxm6d;x{9)lBwUVWvfgqLB%GGBW#ZnHq!9`)N8z2@=NL^0cX^B z7z_3th$NL6{CYeGd!vc1+k`|r!mxjGAT4wGM6Qf0pV;ZlN|Gswuol*1A8a~@2xEos zM$h$$`EhKghk$vrTL7MhVt$$zJgyiIK#AeIXAoT;@)^p;??Wlf!<-(aATWvH% z8$2iX6u6@#qb~`JdN-H|PCh?zMbb4*Jpde1J`2zE={Q`bG|>g0u52U7T&8Z^78bT} zc9o0mCb&>>Q4cJi&M@lnxO_>kR+nw?5*ax!NS$%lc-n@oXc13C^`>ztm4_jZ%jf3T zJItMaVftV*Oyi6qi$s8575+YEBQ<}NQx)0-)9$U1TU@XhNkcf=P@BjFEUtN4&}UnrF5? z)C2%gPX4}B;5c?7R>_YDQ2Xn(PgWHtGG|Dgt~_quZw7tEYQ0oibjlDDPq}E!nLZJ( zx%N#O2RX>ZL#y6Ubj4IQW~`djQ-XOTGmIq(#$kZ(25{{FLY+4juzudafQ1v(|4={$ zMFGO5widDf$e8E_eDS%sv7TF_+5%bm6bybr&KVC0L11d4v)jRjHx=x{AZwA_ivC+< zsWs>}xm$;wu#jFE5M5BUK(Yhvi+l73Fv(uh?e6%T(mBe*x+R-H5v3JCTkyc zvQYWW6dHwWr)ab%dscBq?SNys;7#gERs>a%z?`{xr49yxkPcBFvTvOLqkl3qNmGA- z3iY>DuhIzj`iW73Fb#2?QnLvI1yS8eaX(yDqIYA`T%^)x?%PYe>3i|k`W5!gpolw# zse(zfMgj{|nnj!o%O?d7KbZ*|s>B@9_qVOG5N7C-&1bn79V7iN6c6O-N)#}sO#8DEg|OTV<&%#reuo(Vmcky^L1+YgeW@6J$=7+3{y!i4?|+`HftRc9()__h zSDXabP-^vg+~@-)6+paJ4Sk_*HsNpcc6qu+)eK$?Zr)q^2*GDx=`&UCc|!zPo}3w&0>IZP{whT zqa&+Z>GzbWRZUiEOZI)giJU1Z6Tflh4xENmyD+z#+q=XfT|k}dAE11c{d?VSgnLMb ztxg6;fX>JfsdsuD0G4On9Y0<=Kijrmx^+u6oaowI(PiBHd)M_(CyM)@ybSh11$paGGo8|9!&-799y0Q2CgM%f!P;%rctY-6WF}aOasHY zH<6SzuowpXh@iPX1GtfyYY>>|(KUEB%L)B-{$X4Ip)){2^?}XK|n8W|C))5w{YAz6|kWK9n9WWT%BvMX+I ztDrni9K|>aKz;GY_up;KyqcTNyi%$gw4o-)wyWY#2yHR>o{&cJ&LlFOWP7sPcb%87@0W|0bMpX;6ea}#&`+o z$Ay0JkX$05D?_=(~` z632Dhp&sMScx-;cC;|^au0WG@AF=z>t5PtLYV?nu)Gn9jG*NU*RF0yuo_7l1QjCag z{KSjkk2 z##~|)xEv6B)X8u0E0W7rH!4GulTf+AoZ5`c9%2E2kB8DR4hdZyyeO@5gf|aNPp1zY zP&tXDpz#6l`8A(#N6bc-R@2c)E|&@n0*wrpsCP z^@#`!E(Wojq$Y@?e;B{jhpTA-WXy|sFqD@mH4Q)qs`^<*d!$i;$G3YIvs(dzjRptr z*cKksHsVMu#jKj%zn)Ba#m^kok*`*pcemxd2fy*0q{rv1kv}B(yH{HoK^pd<v60DKC`E;yySMnF32d?}j-4K+?ZR0Er)X?ynjpX6+{t;a<)+WrAUo?W* z1T-sqP?e?#Js6DH24HI9rie32X>63bq5}5B@KEHj^A)zSm9XCpg(?S_+T^53l8OEa z!C!hQtw14OlF<0~a1CK(!63)qUv?tO$Xo$J9re+>hB0%UPb-?T?4vpS-WmXz0XH zUs^kwb3vi|=cHE*{iB+TQ1Izj=Xjtc(X7{V6@?MX@mIxL49xu~2On~;+nW3dO4BXD z#vYKawCkf=4e~x^E9iu5mdynXwqmlcy>osZJs|2|_3rY~9=8FC5#7GeRFgw;c$q0B ziwb!9dOegl17s*izbU7Vphdh{V}i_Z9UKtssx{; zSF3tAU8ta{J*H7mZ+!=?9{UyWUx*D% zBRDqoqRJy2+tsqoF@TTe5?^f(M39ECR07e3RW2~7PHY?>8^|%Ru!m_8VMJB72bqSO zLJ3wg%kCX{D^fA4p%dIYxs%@(K|8k#&|Swv^{Tx{-AB% z5fdf#K!9mnq!iVaFvI}*=_q4^ZYVRUwVSMe>?=bj$poJx{Ul&8F?JdeA8vno} zM)=3+k{YeaRLby%wWD4^p9l%o#VyskFjG-$`*!5m2x;D)JoNkww_hki!KwASOJqOd zS8F0XJ;@VkVZJaOeNOZOv8Hb?0|J`FFgj-8hzYdKyOH#yGIQ6=;r`(!{oZ<~K2{9K z=P$!{a~o(KY3?!RJjl?iuooi`8*&UHdTKBbdl^YTgUqO+LhHa&lhSEMuzac8#z{7cl$Xp&CK50t6P`%ch`ElkVC5mv!=pl%iHW7X~ z_q9pf>$TaE!>T~TMc(DW8jYd+iPrnj6;YInm3>janG~KTFtW(xydrUKsf$btPU8vt z9j{dr%_8xp#Gjq6`4H6!`zo^>#HKo1B#r>6MylXh!9>N{P{mr5%#+9zYR(j$2BTL_ zX5ncRP|6iyjkH$e0DLra!9ByN=V2 z3!$i>cFkjpJYD15WWA<@I~}QuQ<}3ndkSVZvj{Qz(px&zB}kr~e0!{S5wNJEDv@sN zzuQCv#~?RH=ovqcr-Iksr(ij~DgZ1Fg1~ue+y)OWzsX9F%E=Z>RMY%FIN9^(Ryiv5 zukcrB1zPs&iL0oT71AUfh1KeU@$x29OJqpiAYpz^*mlN}!2+1r2z>Y4?EaL?^$S<+ z4OQ!yO$efp!@V4mL%tyvV)rk=813sm+|BNG&l?@b7&LrUd)+Fp@pXZe%NRR_VOe94 z_YaP~^7lZ{q1x7(k{|#1{%*5_h`)_+ZheZO?7$rXOJ}gL3;PxAVue*sJV;4tKRNKU zNseZ{ey|$VDvm&lqn;eV{x@Zl3^d5;d78_XpfMMNmN7de8&Pv*!on4K;9JN)@^{gp z#6!k|EwnJT63$G;bQOnQOoQk*a0iLD(Mrk3h#~V$mm#pR{4j6du;AxmRZ>?@nW7#a z3X!X!HKvpFW|5|SHS(H@(tI?IrxHu*s;sbkTP&FLe53W5ONc*7*aUrYkTJ2-Y6AXG zaodmSRnLxuuN``m_+h8^#oDEIr z#MNSB2jYNgt^xW7<(XOh#gJS)tlfOdgkU zX|6PZZ`{3Dzz(#5R7z^~-ufZ!y6TBPCqIDYtqtr@fAPrw3_1NzP%`_!)}A?8nE#ER z%>EAs@V~NN|9QUbAL!PH+%yh?o5@r9kZePImsER9%k$;voNxk^LXy zWHG9fzcv{Vx-O|-BmkdNZ$}wH7tj@oDM60npXNFwFNq?sM@9X5rIl0&w3|)vN%|fv zT+LkHK+^6&vU}7d>;(sI&}#P(cbo}8z>G~kTDHJF=P;JAI>6n(SBSv@w{dmYWm@Zz z`WT*8(Rzel5obEFQW4-%pk5Ff#>4wM&{*nUX}be+;`Y>VIMsQ4^0noaP&W#hYWvtD z>Zya*HQnwDLT=b&!~rsni8RXQxluh=FkR;YeEv8>Xcb2hrFkKOI3h!h5u7l5409_b zgpxN?Txc%rElLDY1aQy>AU-MBAG2mu;gZZ5A*$cZg^#IHk#Hu(f-u=nvwcgU*omV| zwinH#j`p?G4O~MA1A57w{K%HSeoh;AymJQXo27}P24CpAQS^IuN&w-{kVbHDkDkAdF-pHkiMnr_L4i!e^;!NJEVx)!jSUK^Q1pxt@Re4o5|}iznLHnM8d;Lj=qYoZV~J`KRFk(iS<}fLU-}bE3tm(P|KoG0Kb$I7e-bF zBIPQ=PgyOcfz(pC`{@*l!O>o{(q@xPDg~O*4#akQ%fwj?vo=Zz*!_kMP5YRIQySYe zB`X`&q9}JWREvvUP0gp*V|@eDHB{Sq3;j4&eelRVKLd$*z0upuneoo|B4@jm6H{j0ggNWv_h^b?4JgQP`t%D&rTHZ}m zreW(GC!?nvWh00Y>j-OEtspuLyP3QR`_=bTq_W*ye)G`y+40%)dDV(N#4y(Xy}HeJ zTZ|IbGVy)*dc8{LCOCa?;QM;nplxJhb8F?A6h~Gi5R~Pa}mBidKke4+EH#Fo@mkEGr_s@~Q z`{iuGA7G6zcq8m@LOu&5DXl@hNB!9-jZ{;dPR0H|#90CZu2($SAh(Fs@n4?`A<0LQ z9yT;C$PsHv zO-3+n59WN%UKFY3yIyt21QvuGi)3;ikFfe36GFM;rqtyhn8~m-F=I zb7()36*4;2hc*YzRt1xH$ zPDm+UA(+h?&Cg(m#qbSlyWAmi>U?zMj9G%9evTg@k!}#t$_3__!B-|L@v=t(1_V_K zEg;75t5d;!N_^(X5M$^lysBTOXr$3%gK^Mm^%#{b z9gp9jfc``)tHAzMHl5dUO9`T-i*KX=O6yTI(Rf?}n_+dtT2=ht?KkV#(D+$w} zJA-;X^kWnwsvDMU4w%~|Ud>5Juk_)VIHd}b13n*!23|}mQwOL+a!In&!HG8W)?QS$ zjW^qzSwd>9P7z%a;Uu8!ehw7ya7ugh9Fu{1HLB6MhP}_fw2gx&V2m(bu!sw!9rfNT zHD1dCg-Z!pjRhu;E>Lg(mgG|0OZb0;O@ghyQ+bs1H&w`(A9AV+c!_TIQv|o`d1E{v1gR<_nJw?`k84Cocw3zDdzNlt)!<3BDHV2DK%^B;eGi zcl)UfB1AcT-ofVszmz1?jKxdb@;;+VW^}C zLF#dz@Vw)HjLEG>t>19+tOf%V-5s_yz_gqaF`3dM=+v#`@F8BIM*U&ttYv!ww~wS0 z!-)YtU2x}@?R4!wK~MpjmJMCDlrw1)cZSvBFGx;_*4+V5qE#A>X8&tz8TKt!cEw1H?Z541f)ro^Xh!6=C-JUu8(zESw$ zJrioOq4OHIAfV!j%qIAED@f@4S2?{Dy^vfbh2hVM&qW;Bf^^kH#)Yij{U7a_A*pqx z*bpoJ7>{E{;py}#nub0e0Gzj?%~$`z^&~q|2c@GU zA|t2^T+=JPS~~`ZV7x}@dYV+c`gK)Bs;l~POV3&-bv-;oJ9Im5t?cSk$+HX&zy5Ll z0jlSR;}uw|b)otO?-m5)zr{AlE){{{v+&K0qE0ZE5YR+aplj%3M;eczIxJ{es_cj; z3VCd>uA#1yo?BaqYe^$1Rf2Z$tY$+UZp(DP0#OvVfNyR@bbz8hjd@+o`ggD zfM~x%sa0_5kkEr#pD`f8$e6tC@L2uvpx#*rNn9{0%^#Zu?!(yWqAAalsB>4pKtxHH zFhF$B2a#(gcEL8Z3u=cjNdcSGvKRK@>92!t*GRF<96Au7O@Ejq>TzQ{jqqko>ch0; z%uE;)eX8hbN@%8{@Y!KiSPhbP!*AXnz6Oc(m_OU;TEim*x$QHdUIz352Zf0PfQtWP z25!?%vBXixVQi-&AYdcf2JpvvUurx2Jp!xf^ZE5uI3Ep|){7l* zr%rGg{YQh;zPsnTJGL$3fuJ8g;6Q-s0#5#gHt*2z5aAkN z5BmdtW0Zl;3GrMx%?6Vaw0S)x!jhW@$;+Wh zO*Ab%xl#1}WzjgQhj<0K6~>K*g%+6OEj%8}vZpdn>z>iVI0*GrQDdr;%`J2EdI~JzMDipB_mVchA~AJMwHurS_jbQ9?~1DOySpj5b^(gFOiX6Dfou}h3q_}~sMIqj%Rm<=yhq@~qF+Li zw+bkleUNBR@T4)=>FU|oPCi!sIL7&MK^ zKf*_A`d>?0am@Fr20UHg^YOwRCmtS`C>i1IRGur2XlsmBmA?dkujE#6TmXgG4Orde$`k@3mkE}}UnR)gi!^l>Eyv1V4$cPh-Uf=nL z4M|oxUJ%jXXHeIU>Ax9>Rjlj$S3zrQBW2c#X1W89&yG zMfU9X^)nip8IH1G}^aCZP~Yk7pkYQM6)?x4fe9CZg#kRbhr z@2;hhOkR2RFM6*;URL>LzCP|IP%HcCRA~*UOxN6Bk%Zaed4$>X-vFZ)AiJ@&EOHsw zdZN#es`4pFKW8Lr7?u)J2|>|E-|hjsBDDaK%U*92N?bl7ko-?V@-Vdwm43&U3fAgy z973|@2Ek|HbYh)nV4}xBd$FC=%4X8JyD{HF8C0G(z0Tq_pG9uscOegj&hustF6$Ov zswHa}p{>0(PWtc~maD*rX3MytaS$Y+fZIR@QNhBu&=ON1!istzu99=0_l0tYdyFV~ zi>aU^5=#bXQ=*B?UWY#$Va}t=ZP2as*@O1Xp}GTBlbh?nN`K@J)z}L_7-E*&78`Vz z%*!XjxMTK+Z<#Y>UkZmnYj*!Kz7V$Tx0RBVZd_8Oz3+jR_b+GlWXEfXruzAFLK_UF zb=-Pa!x5?lbQ3d&6zR}(0!`oSeG@f(tp5l8HfjLie`^^3HS}R-W?=sBxeUiYkZ=ET zZ~wVt{O6eE-yGwA*|Ps^*O22MSO4pt|2K~DKPBV+zxPM~uio%y3iwbbL;Sf!HA}&4mv%3k6B&W(Kn%t)4fDHWYQ7D>_I>gK%3ZIuH$eJJ#AF?_C0$4Ow*Csd~Hg5 zxhC~{d0ntx4zZ1~9ks-G0P<3c5TtQ1<~-LpZQ$BXw2Ys5oQ2=J{=hkUe8NzvZ;PPW zwzM(lrsM9QcI_40asQNPojGO-Z+hm^0c}$nb9FUF**#Xr z7w;PH9%P*ddRxt_OtY)1?l82>$#Ljr7XvWl!I9}1R#tsFIH_fwL@99GyR|hy=o7q& zi_{yIe`DXba{<^>P)uH3tN~U~_JZ<+V#ymo90S6=kPql_M7kj@ASHh-Xu9T+0O8p1 zAaWx`>slp!8;f3qnD@5X66%AB5Um{T#@s3}310QRh)Nb%imXlBp%Bn56vju_K|*J` z%JjAB9Nw<466onsd`%b$!AUUuwe2npe8ZCVF)7T-oDvw-ioR>Mbg-<~;m55z|FiTI=kv8k3|}XYbxB@w935ad#u*v`MSG zb^jh|fX1KA1oM5gp+BqKRr7J0hI?>HjyIQPR*trQeIAK1wY)xv!SED6!nT$fX;Uh* z5{x9QvJ~)pdu!VILQ|pnf{Pr-oUyHh8X{~n;me5qB9mo>3d*4p6(y2bR|fqSEE-Nu zK@itiVtbKuYnVySR2HN+bT`2Cs(ip;S228z@grJ$`X<}i^W9T#fcY9@)DNfs1Sw^9Ky;-p*sCwr(HBC?cwB ze3Y4_f@j;Nf(M?x+qdXWZtR%h7ek{clLM*a7=LXq$?GJaoGbs-3LZW@UgvM$Z~Fuj ziQ$?*TFdWW7=1N<)mhO6JN6?+Grup5Vz@6WTjfEhjd`9X6cLh~SdMeQpI;i|D+N zqS)K1O5CPqhR3VYgHR?-gaIXcM<0G$wZz)nyo-`?S7MvvigRd$n zzid)|u9g`VkM5s8x0qLjLOq8;QgJES)ime7yI3-w>Jq2Somh^$Mb*4h!q;yjaSrs# zSCOUVEqCiA#Rc`}(Y2HmyNM($Qx!=;jsKz<#%i2CL~H7Wc`3T+-JJYLC*Sp(Bg8Wn zC}+x{lqU*B1*}*ZoBs{y{*r_FJ%m&`D&R=dmo%4mS^I=U`i_BjOa@GSn0KMnbEUKZm&SILo5YVeR)Fr$sV+MEsG+=gDZVF< zRLmeh(mf(Gk*rC^V>y%;R!QR7tCF(ES{dn$`R+T6mpt`+l%0}UBGENq8opLP&Ybk!@4(HBV4yA~!i_lyFn>6?FhAxnM>^ zlV0RkE4v1IQ^r`olz~f~9Uh&PPNWXs&onnIhK{++j(3&@{c7Oy7Le#Z)dpQiX-C_Tf9Db5FC1Ux1cnL-3cWK6$PsFeei@b5_jl z;j`(HLK_deL0|1|v3vU;?$CXa5YFIdT!<|3Y;C;4?9!9=(m~e1RIsuHDSG)k-OG_3 zOo8J_7&EKUE8fq7oV0FuAQhIIC4^dh6@g{=C0Mn{OZ&QRQr%i6iQmwZzE6vNK!Cfc z=mdIlL-2)s3P~jFlhJbn+=5hZ)y)SoPi_OH!o`_b0z!+oWRyIXi=|E|A|}fTQ-DjV zSzt4ciLr}H*4_^=(aEWV|N zhGNAGS=UJ7f%NlQ+rk*3s!y~dK@79T>r*o4+?mr6Y)arBCCkp}6JY4F^ZY0fZ_(4p z6l_lYwx?qs4>%D1gEW%gv1Gzptmu8&i}}|XYOrKZQ<;QzMe$Hr)f90({jj6d6?28F zvB4{LpBR~@4u}SeVv)}9=^D88NLyhgID%8r1A&eCG76Hz9`ZhCr+58RWLvn2m1MA} zQod!q$mY?!#x`o~6EZn`B&Yz-uM2?I4efh9v9M2gkBKN8L9Ew6z3 zU-C)dP7Z}y9F5_wcJ$@`8`~2rDQvdCrb|>(L7V`s0tN)DDeisX58CV!q(lKq&DV}K zKq!%w%RxoDgumh?Hes3Xi^j|eD%sTSOd zid@_Yb!z3w)oAStjDezn)6@f2s`$4LBYo_JlziLsI(*taUZ@n@v>W7Bu7n`GMY7N&HGPQ3r7mPK|vLy_smaB$MBz84fN|I?UK?zG( zu2q~W+VWH^N`%4>#r?I!;@`sn-b1~p1vT$V@dCQIjoYC$C^4q1U*i=)CFri4X9c3E zzm^-^em@5{kOMNyJgX&w&n+u+XqGf}7i)-@RAX>%L*Ig1#?2$qEpDL7S$TP$x=HAG zqMeQi2I}jzEZFyEwZbtim^XNm+E+mg>xHYU)>p`*1=?7Dvex^kqx&^Il96xxME9EI zWrIeF5A%gWs(8%LA?(|-7p=!o+6IHLUnmDNY~11EO^CefJA4eF?f&iFBW=Ib{RtF8 z^tNRU@wgY6r6EmvXfeYhd_#;cT zo?S3;S8480DDnJEd9MlPVsr;uQmQ`9Nq8xC62@Ijw#|4zG`_BT*uav7o@b8FsbOq= zFih8Yq#xr1uuR_M5!txn%AVH3l2=wiJaY``U%q!d$n-`^2WJ7H!0cByQJ&mcU4I+g zJD5S!zKxnIqbWWrBpkX}A6VdFv^KKtHZ%ikr9qilJdbGN;EZ$1=88*C@K%#40fzp& z*Xp|T%;c&wN0v+=Dc7~$E(U0Ubz`Ssf-r5E%xK$;uT74-A6K9jxK3QenBRsZuCel> zi5$o!iDXXv2oxXs<_1WJOrWVcbPGYF=3Gv$IZRy6f@XHkDk;#o$|Dfz0qcqvJb=|a$sp7d%ny|aH`(dWHs=iskJyuZ4+y{*QRQU-k zzAF7|$Zs?MEXI;_mRG>c5w#4Ul4KF=U(=K+`#Fq)VfXxez-wg9Z-qs3g*hvqKTJ{GSwg14~E1@v*9Xcv73=3DHbp=vfGfj z^Xg&!r;g)uN@fct`r9M~=whk!0@Av!06l7)vZJ?4P&kHi-sa{!NJ>(G^>7S|+k{o} zQmpe3Wm#ISNLs*nZFH_GSwvh2)jH+j(|~CTUiC==^U;ZrrXQM9v#4Kg$knr4efK@RPdp3&i*czxtx@klHGDOXSU<;T;Mx$F&A{&a$=OPO}$hdXG z>J~EnRSM^$I;O+Ak%vdap(y_dr6*>}j{PIFgSm-|{h7o%mI=p?cK5H=1EGUcCVwu9~5BKJ%V zzegyF33&+X7H#AI8Gl1c~Wf`Rd8w;~fifLd6a}Iu*kXs!0)g7pj zkAw6T_@&(K-OZ)GPm0^~y86;Cu`bn_KnTgFM`}Vj3ch1INlHSRE2xlwGGa06->W2< z_+sN4H&5RI%1fOFYIF=@2#vPPc!>X5?hETW-F2e+^rD*LtOaL=ES|JY#LJpd9gRh*v%*&)p4XJld?% z&+-_Z)uDR7-Vf$|At2~?i&wV*X{~gx4-w$n;e#!&{*4#41CDpfFw%Dr(;n7j54F?d zbn%FxqOFp#gfg;E`v>t)6sB$ZUzCM*y3R6pw@7j|PyNa#7@Q2E|S0THgB z-z_MSk=Pim`Bo5JsUHUxLHl$aO7sxKgZ1owv~g;@C66n%szF**Er@Jib@|h-qo_Q) zi)^|?bHUN-8xC@VZ8J=#P86McUNs2s$L|IFL; z{f;!*O@F4nyp^|{K1_`Wfd!~uyYd(rQC&4s>zuC%i|wvlW#>ozkwiM2ssUF>@>BDd z02Fs@b=4&@dBU{pnqg6lq`dOR>!!Oxe&m7R^8-0lB}EB?KW1oY|_CQjxAj0E%&rWQZU|A;OA>x!(QqZN!3!1>Re zLKaSr3Z?*II~#jD+rI@F|7T9r7zhXm7zp@3eQkdS_E)(7_Nj6HQ?2=LkQ?VebnE{B zr8Z=5G?KDA3|&1bpTp8UYEs*_7JZIq6aE%blOf0nf(?O%Jl{_<#)*N1a+lvE?>bfb zwP0x>?dfH-n1PANSEN*Ss*hi;^mX$(c7|U~`-RQznElPs`{VZY*BO2lzlW<$X5+=` zL+)AImR?(xW=K!P*UjTma4vR8@m2LzXUqF_iSe9X+gV$6Ra2*LYv)_WR|@|72zP$t zM_5I}$BInx$!m81LnwcCa6dRoSLdeByVFH=ldo66;lMjbkOW?tKWls|;N8tCp#)3Yuz+|Q3_T8{WDk~#y_9Xq^#(RBITIUQ_uPW!%HpMPe2Ii-G( zlD^sYw9AB^t6#?Ro?-#M1TnWLsC%UKmU1Tupl6hMHKkB>zpQj*QcE*rsbf#|K38( zWQawxvhS{!J9^ysvdT>IXc%So_ zEU)nBwP?6E|6>bSWYgMXHM3Hx66qAJ{sZO9eL6R(@yX2c)sQ=vSrq}S@;$fY%)a9! zH`!752>A2Oq6gNEFk9Wj*VEQ1xOn(s8i62c1L0hzLQC*RvsMb8s$J^f{SPTQ<_-6g z#*M8Gw3qYo<*2(bH|F^-PgQ8~tA&rM;iB5-ysnP&?DuT_n*@jJ4I`|!`sJ@yqi-Dq zXZ8%@BTn9+a7LPxQce8dqk5gBnK2bu>h5GisAjUWM>&S?h3m#elxj7PGB^c`XL_XtU@RS;Kz33Ojqc?pPV~UZ z4dM%Ew8NH*#|s<7m@)9loIei7`6ozHq)j~ajhG>%L%X3Mkpy1M`HdFe?56D9Tq7ec z43KCHqLIHvsI|Yn%B?p>O<4bEmjC2{$$Q<`y(qFbz=fH9&{fYP?|e+SZD`GEeR+}> z{WvDOFWmD>{*c%jojp5*4wYT@UhPyyat_a&;Xb2U^AGCV`weH&i3daHId^~2>`=lfa1uee9pw?71MBs6WAmu75e#_ZdUj& zHYP2in^VA>RS&xp&ei(Fa{AuhF)m#mqwdWCMJ|l*2dJ@lyGd^$Ch};+}4?ZJGs3VzxS!h_K_^`tt1>dzqBi z@1nWh=@N+?WUik8CQ>65Zh8OB+zv8G?D?6|JPK76E2trM#;h0a;ui4)^gKh#k(Czm zq>-#w%m}5|%_imsggRy{e~18?9B(tgz*%#q(EhGvxKWZ+Gvl z;`n}Z#t!cMd)~#+>Y4FJp<*E8Z9Nau34NGM>(OE+5>2@fU{sTC+x;{PrEz*`_8Xnv zl@4&H`opUbaNhAm_iA0L^EBV?Qi@K7Oa<5&fpaf>8qM0YP?z4~ry^aJG>sMrMcKq0 zC))1S2UHQ73>G%RxPSH@rt@XyjrsQsp;V?nx1&~Hf!P-q9kyHK-6am4F6fnw9xOp< z)ctgIU3@XOVtJNhj$|r&vj0^l#*B5l1iZfDOgJwIvQUBo^B zBVCL8#3QZuJ9&ZJf!nOUO-@unrJiK1iDEXsTg{jtJs#;ycAeN@apG?B2MJ%wOw>M5 znx(#yP}~`$4{QZdoCBRKYO{U{TO`U4O!B?_&LP{%Am+9JaH53F&LsGs7XH9!11_w$ z!$(HHl)6_Eue4gYR?|3P0g*mk>RN&dkvm(AlU#Ou25gHGoTjO|CRx~Rh^cl9k;6A2 zB!Fbh@LjL=kymx`kFiEn6lW76)KMI}jBlLY{1Rk2MF${`p+lLrZFwK1yJgp<*hNNL zpcyB!SL<9Yczewxk|0fs_H7B|n)t1w!Tk&X#!T|Z#S@r#8}4*nc%#IG)!fj-B%pB` zQkn20DW*!OjhSNi_;tSP!XJxl2A;&L_cqr{>(f}(61NmBGp=1wY0 zZdN+_**`t>Jpn~4qJM0BCLTRYzCJ(8IJbRezrxQP3|P5G;dh}4ebmseq-EVSk8f6n zvygjRD%EM<%d?<@L4A{z+HH@^qNUt&cCJ93uF9*rfzk84L-k&~`(G<8LPG+p&aXAd zjKWlD+?8`CKvF~A&IVwV+PrgGWZb7o`ZMrKHYePYXlO&#uw?kVcv1mwOm zNCzUoZ)Dr1>yvj*T{uQmUEkh#iBfho$v4s#quG3%y1LSS_5Ok>*Q6OS5X#dQ@3H1?KVv@dWInvcOK!?)*`Y?@}@7 zjH${GGJCA&W|DvEU}6`iI5M!qA+?zT%0D~TmO&aiz`uf&f`V zW|&?DRj22}*&2`GnvDMRJxehG!$x}j_V)x0qig1QtHk<5l-L!Wn$qOhNh?cAlv-`e zxe*F{zHaMiWL1IQ*a!cC3(1_LBdcUmrfw15q<98Jw4iBSJ)d-gVr_6O2bl24S9cDL z1G?X66HcebvCN-_aLs@P?j{L`^9f!`u3+b9jYU@O1Ro@o{pGfgP6I`kg6z@@N%@UW z9xqNi2YX{m=OemK3-Olw2ue4g`O6VVg%$6jP7DF^@uMi%h zz-hWx#3Kh@edMBf^G-fHGR?pQnX!S+v4Z2uC0l-vg~=>2 z8sVLn>pqKhq%M+>$64c0+FRkc2Alu2K70eC3Dto^yP?Jj6DGxM0u4n+=Q!OhquS<$ z#al!lR|A_0HG@q?xJ$fBHC@~;kM6nU>eQXAPQuHp!6JF#0SHNFhdTBYv_GBm`C_a? z)Qi72XGdQ5F=6bmy8%9c)3~I$nRqd#9AwG(5%z2z%kJl$=S}x1(R!fbMM6uPB<#1F zmNG>BAh}jQz<8>iY}TyLd2C*)^wUAQAMn(>=2Iz?$q1mZFFeB)@swqw6vY}L) z8S;nuA^%1Tw5rha!^KWt4EzmBfce+V%!$U3Y-L<9!fT@XP)*6jx-7U=C z)E}{Yq1w_f0{g&RVYq;1+X)MQlfrV^EeFI*K7#)ZiBn-zX?T97gUP8tB}PaM34tlF z`EFh+U1>E&8_n2!b@f{q&~$`&W~$lD$3j#k7|+`x@wGQ-tWDaVWXCD- z8r99GaBMb8UcQrfAkFWZI`>k#R20}MTHB!)PjVC zye^`i@Ic1VNm{JB#w(F|&WZJ2{ zWBt<{IIJAC^Ol;AOn?QYuN9LKP4W7Kf$3g{YCl9tdA3zbt}5|;mW>nTm(>dLcdZh6 zHXq_%_Tr*Tt=yLARNazS~630TAA4Zp7ONjCN^7Wek|l z`JV8w5eK`Nj$(I}2+WpcDlDPawaX=clyh%X@i zet`txTeEpbnQ6L3?9ZmFPw*opkNqm4Y7C9E$wPu(TKdB54*$|slxN{_8{RKKNK!Em z_atn%qH*s9sFK zm6qjF3blOaB2ggr*YmE2siy9#9MT@_OD(IHW_ki~6vC6MflR#U6{cl@c-0ApY~uN2 z_cGtwBQp+2s7BnICMSkP~f)^fznr7Qtj>F^jUEP@MMExF#)Hs2<`pa-1JZ-sm|+0`_o z5nK`N7EEsklSi*%zhT7X()_qFFKHhA66Wee^Bul>#N15>z8?Dv&DGp`!#O1=12H+x z7!{-|cP{8!OE}bEl+AxTB&b<*_uf4efBO;QVi_7tp_Wf?CormTlB|u6`?C5d{m4}A zUPawDnR%xUEwGI_8GV~BH2xZ^s`*8OL~6o8mA%+#UodnbX||W^c}KuX`IMB{vC>Hz zUvo95y;EGJOoL0A>eriJW4X)ZB*`(y{h!yCl07^xQbBfYvvEO7rKwzCMT zb|xH?I)?ZOZNY5STL=c5tVP-T-kWrG!=m_zXb9EkwJPVK*(l*i7ruS%)P&Y))2nQJqM|*a06i}?-!CMwemy(b$vN?t_ELiC{-QFI zIy;@9ValrfWml^P#7GSFtOL^bi^Z@hRpMX*O4@d6sU?yVEW2PF=u4>khwsjv0ZX~f zgnVI4t)XsRx{NF44kcJdp7vZ6&_*&IneQALpDu_d&pt~k)Arh;Am_O-*~9R zr^Pn6j8eEodoTx=cG?OuXcM8(S=@0EQ(K3^nSay_6qA%NVDn z+m6naXIpY&ImiZyU&=NPtpboUC}6N@H_%{cwa|(i+vCHNz@47cY8hP7u?1N-AxC@B zfdm7^x0ugFXd@f23m?>8rmjgI5^&L5y9@2KQLXKdXC(E3O0pTU7mMD3-B zduthH8{#>0Cu`j7D-f3$M%yW;UjJB6i&3M3)3uP3k?^E57cOAd#j8l<=xk|l%>hiQ zd5K{RIW!&&43mq&Nb5mkZpQ~3W%f;{y^QF;GS^OCP$t+s3i`!@=g1rha3~iuN~a^@;@UncQEi5L zUpYL$^vp-d(v0V;e*EB}htO`JrHPW3Hs!7OjT5$JC1M&m@rg^Lop6Pfd0AaJY8cPti%ojw&&i6_FYU`bp5MEyDzqOpZatQeC?4I{uzz{Z3HXobo#Nvv z=hzWQ;kg<)rLisXREon_|8Q#8KPDWHqrt+{n$>6-UxRY%aEgHE+5%6^DTc?(+jO2l zy^gqOMfn+@M{wakCB)FTl-+XE-z|<=#Ru_8nYbhqd#T%ZJphs=9;Ijo-}+{$1ZlC1 z)5=KH{09JBL+n&GOb!sdjG+`ZP~;qRv)=vW8R=vP_*^#Zbr^2*>t}D3AEjzXE9du0 z5o1Q=ke(!19~Hz3D%^sZPxm@q!$>CFwkos2%}|Sr#@xj4&<@}(RS{jufsLvubEjtB z_@`>Tqab^&e}YX!m;-)d28cWGV&2o;2cN$xQtRLG9BT27q}9!uRPK%x;M%lc2jAKLdYDv_ zVpG$xsOZxJ$TU`$G&xORF`6I1q-)>on0Q#J6d?ZgwF0td$55TKav!bE3H+PRFW1fcu*_AQbl zf_enKnvn($HfO}GXl4-}QZXa*y%J7wyu{v0Nc>|^|0k(=;q2_boGAK(utrbq}>&`C|At~^0$ z+yKWpItEfnzs?DeW(Y+h-2TbY4bMDFi_;J0m2;TDcjOi6X*5~8v-6FHMp98H3D3fV ziF1U+lnyTuB+WR%Hg%vh{f4shXL!Z{*gM_EKwsItA}i4FLt(SD-|7tinILFjpF?i_>Nl!$L=tg4rSI7A~zi~0LxRusVWz|n*Z6-Dkpha5qYdwA2 zi$XIfh{4**PSk`4i>U^~JZW{keFAGnQ1aaP)e31+oD##F*>_Nl^;K1mfBpy;-*Bb< z+>BB*J;(uUorE*q5SX$aa!Eqexh98UQnL&0P|gJREwUxO4UoYhTKGcTPHa^*}16}6DPh73pm=yCdNu&kfud}O! z`8-f=Wx<5BjE+TI|I;2_-4`$~55fg0LLE@yL^A{ZV-hW^!B_dWi!_70@mLnIU#pc7 zDZ}7{oT4BtDs^^LYwqK|tPg9}*hMhjazLYYi|lqP4x^2Led6L-54t$@J}w_b?CknX z>J%S!JFz>X{^)Rg{8ils;f1l!{x#ls^sE69;fPg5-EuHBW*%jW;p#@>B*_$85ZeM7}ZN9uA!Vq3G!OJH0as& z5E2QyyN-IeAkDV7rwW3y3llv=>Kx&3`Vy_pLSt#KzqCdBKz(Q{3AbD`2NX7l;`Kdn z`nl2#lVf#oDIqA-zEffGkTHIV4N&Ju^F?BqQG75aMvj^cJcU*sWmt-r@|o7$P;$Iz zVe8qD;}sjDS5_w}y~q$S4$2Wm8ArMji4{+|vG9uuc>G}9KoqPnIOF*>G|WY57EsvW zqwr+Xd4JG@P2jS*Ji3$%iuCIyf(uR7kV4SjhPi4iugH=<_f=K_xzWdaMXQ!k=A^Zd zM)5ap3)f|-Z?+^CE-m=NI6}guBLCR63S9ZYT!RW@qEx*tm0ORBfOykk6?*KSlHeIn z4s`YrWl{7R6jgVj_>layYm}D1HbYjZC$z*`a8)-)>I@ z=vO+<-QJm~(y!I0eM2i}YP$zs2KP0`Jd2S#cfJT(U@h`VOTE60M5-4Gn7+9m8GM3m zAZb)u56mz*^y^07WW>zaN}&k1&xxd@Pq_Gft}IN`H8sKMbib$Ps3(i6tjb!VbB5Ofu&AZ1FUzgFMA$MPPnK@E6ojFDKkd70! zRd9i;A2yNBlv&d43}0Qgj?y)pBgA@o1=TWYVAy5VS2z?9`D`YJ!g2BpsHqe=1cV7Q z#~=ej(y-;ncrULkfsSqbfAWkI<}gZLD_Q60@DCF#6tnm@GyVd4X~e(>!Wb!i*~^ z$eZR6$y2*Bt4~9@gHkic7uhz!oAue8mV4PKF$#_k%o7u1FZ@K zz6ZP~zD0$3{mN>TjG`hdE%$xP)?kp`24tuwxVoM8({|?41;}54Db+}HX z=+t9mO688{2F5E~$3Z)wP8r?;3UU;^Xer&YBSl2lsSiWZ>=+$$;1?a7t;}C+A&YbA zznE$C!nME-2=>(J>oOy@nAGL1@9)%607a}J@?>45-VlN6!PuhzLWGbri29G^{C~O| zIT%>}t8 z?2q6`SQ6NgN@_Xx*Ygo)K_}nW>H9;=-j^ePR;mpLzpuw<>>d8(*Zu4I(~?aF#7EQR zTeL5Sta{O8br;Xq@y5ey_S@ar)MOW@?qKNMuTQU*$H%GAJKr4ruk-i0B~lIVE}bEV zOyw|g&>JuJ?-F}2w`Y)(&F$4)pZhx%lc`IuXP&R*UEB1Qkd<@J=S?GcPErc|`aZAr zhd7SCT~?(KkC3Xc5% zOG#E@2&wp8UsH%jOZo&XeENqUP*+Qx>Z0vm6ZYK(U)5qi`D5bHb&`8jCjnSQt^1w$ zipdt~uq8U5;6DAO5cjDDavkr5bRnGFyzQlw!6$Lh$Y+qj%V1Eq+Gd60KsV)2GY8T6 zFNL9D$21H@Rhg$DM8EYdcYF)ccZv{f^{Up|^OeBY_4tL}8#{5(U zUWWQLGzC(R#bS*FTmkAMSvS!fnLW(@n{shAO9^hwWg~^SOstR27eQgv2Pbs_(I~g( zxFWePaY;YRmcawNYHu16r$_UOga->{G#9_^ldBq6j%+L-wVLWUmN#@_4j}SH(zEMT zlkvoDY!YkNAneNs;u`~2<-MzM$2{h&$&KUXce(4`%k6urCBjB`*KqYs+-dg@stYs0 z`(rBmxS)gcY7|8bHK}cfN<``C}v+@MQ-*R|6>g0h+^urVLg-wMu}CEi#FcfSV?aE zuzOnT*w`)k4qj7FFE&W;DYO8F8>Z)-Ep& z#G^6%Gbp+-=gknNfUX6B%5Q#F(cAD`;;cvU?eCpNd?t!Zm3J%B+H9=8l?TmOhfMd^M+eE$dXw~R#QXSLRoz*W3t+2hU%F9#!;Juawsz9BNJcUAKiRuRwJp+kw zx;*xI>9#s>7386}eB*j^=q%@Za?t&OdF0iqQDR+*Y75R)NNO_{ri8UIb?2<3u1au= z{Von#xES9b8J2FpCcRo94)O?-n-qPuavqA~n~X(H4{Y3G3JnKZtFK-`rwWqkt>G25 ziz&-puHQXP6T_fj;hQ{{V2orVVceAS4jQTol-6*HV`=2q#}b1~0#Y(1LZHS3{v5XE zKC3t6MLH-Afo!4t2o@X@>o$N>{+(!A78aA72A~c54aH4V@ao{|*K(R=6(nAxu;NkF z=C7TP1)MTRXbf5Zt2B?Y2|;-;=@I865e6p_GPLPk_aGCNRjoYf-JGk5t@#L2r9li^ zl9Kh@F4!smS%x%` z0j50qt8@UX`8JqC_3D(s@qfT`wRrL?|hLD^%QGDW6SPRKUK?147?5C&oCT}oDoz@~ZxLOJX z9Tt`u6d9%_?V5NwbRyVxiLw~9ybm83lo@pV_0gSoX4W%m4YnrJ8;T?Sz1K_pUL5W} z0XoIZ0M)Z3z)EQ_+T!P&|4TAVLRsMfr;K=YVf;%u?L>;3;4%-anQ#G@;-mm`>OM6? z22h{TvBppDjsghG-7pP#D*y~XYu(JjPyfzZL)pS!01Q# z0WceppQX6Vih(}m*gjt$_QefPMA^tA_VDi^{@|!(rdevS=g2;eesL8pxreT=ux$At-vTh;$-Imdc`jHsRa9 zZCaZh&D{afWva@8BOHs)xI9>Re$IHTkUWnV9MSinAbd<~AfGSPa}crKdU8SI>CnzB zF=Gs*u6@2f`o!T4C0zkc07$H&HBXC5VQ6Fs&T7y^j(}Gckid)(yxx+B*3`k2L~?E^ zyBvxbl7O=)^O)(MH|9Eno4v3^igHvPj5I8yAU__?H+KZ&9VC~a^bYd8SCdYpv@3Fl zag8u?bPauL#n#0{S&&~~^K{PCGjLkg`G$TA4n9W65QJD@iV2=7C!Uw2E7&lT+Pqs> zC3}##TNO*(j$C)-Nv0RymHieLvTj$>C{cPEw4oxf))ptUiA9T9956a{LMcO~TF2); zZMf*B)V>fc1H`Bj)Ak2bnx&}H9dPNI*kcmRD!s>w6gtyNTqhE2P(861`LfxVlCr8j z+en?q&%5WvAEJ?rbJCfBurFAxtF1TouMB@yc=VL7S+G-br`J-YYr|^`|8|!b z+oPIucvo10XW>gy>kuY*Jy!^-SAqYHW0+_KCh#OUhFwS_h)PXPB)kM}8TTJ(f-flkRlG@oroGkY9ywo>L1qCet=9@#tSbiD(JBY9S0+nUc< zB((;~yNp&1#`dDR6s7UrPiEEdMlz;ZX2*ti&C7{1#TxSZ|1e-~PrJCOrWlt+!DraP z_(2DXFe_?ja@1P>*daIUs5= z>d0j`6c#Pv8!mHPWWa;FKCIG5p6mDUQ(z9c-`kt+Z7hVr7#0e9xS$ktJsc-&moaKF zOC2=$%(WvRaU0mb`rVK-bRD?)VeRt$^wMcL5wET{qlDQM~&(Ihg=*C>MJqY_-428xQZ z2q4nG5M&Ca;y~~RJOVe8T3l~wrO}pCxDVP|$u*lx$ed9mdm38Ei#KUprpx6i*aHN> zy9zzA9DK*dccc7siQJn!u_O}*{qrrL=#i@3gi9VydBoG zmy+QWCbwx}y`^=VFxPU-CH+z}l54z8biIRUcvf>>(84 ze0?V6f?i*Gnr~|B%qQa8O^)>=Iry#;-BnPVb?L%Yi~?}N@ee1`l#iaVSHpDR>{c|L zSsiw^(XAigG+gjH^#!H3TcO8hc~4H=kPf@-d0!%RftE1MEUVpE5F>|pHV7TvB~#w> z`r*R2#7y}FkfErMwfmD$BP*wfY+7jX4|Lsm$BM4oGZ8SfPT|)R&y?cQ5F~}b({&ms zF~IUVza42`K$$FutW92-pj?J9z#|xZ_3K7%A#+p(Vpyh6JkG}@1hF#h&x$ZzVx(YP zQ+#oixG(tN@?57Uv2v$Z(vlzDL_*wJMoz6d$d`GDk-kQ8Gf-H_&qT)4$3o7JrIp2# z307Y5F@=jKnq|(}^--aZKU-eeMyjC)Ntis|`g8v&OVjSTh0T_y)EBGI<6 zI>~rE08~i8Th4K5lYb}?$604IPLx+p^fum^p4UDTRGD6Ga)eWbZAcpOW;FGfPK;|0 zEA@y)85O~d`I!F0Q^@hqZ|U)_(yL~w`cMV)%F|)x%mcQ4=-F@j>0I1N$gWdr-@-;c z;1=Bzjf$E-xD~)#Vnfk}z^&=bsmegU+3G;xBg%zxzup_E=Zru`n!D`}D{HQsqVKZZ z$~?7}<)zgeO<*t#;KS;)6w0fL&g`v$to?MkU(~Xiwx^78w+|Bu@h-w%0=T;5WEaXO zN$lAtdb0`kC@W+-@+vecMLqWo3+FYAN^p?Cx$A2(I`YC1tT=Wf9;*heCB{G1CS3yI z)Vv)V>BJ(MZc}X*hG1%2pt>^gm;|okMqRByXpq}34K*WEdS*&}*$C(gOK#4+%xuI1 z85}p!XS0S#orQ*^S9~{6aF4g7_g1D1@hAL-`3daDC{?(IMCqZhbC(zPR6DB|VmgQ; zR#Xm*d9sL09T`BfX5D-z1T;`S)q2va(RAD8Z|?N<%cWsZ2cL*S1nCKH(xH$0i0Uog zDq@z=-eCG@S)JQXlj$i3E76o4q(rp8IAV3}EPB)zO2TTU6}oN99BmLNf86rM0P7vS zD3LVs#V=(~ejQdQBu-Ni=kVKWuUb^fa>>B2ZwnA=55+MbFBk#Bl8qnKb5@!sSiYG*dcMLwz^ajgsxt~TnB#e7G=F%hl_#TmGV0LNb*)^2{& z4|+PJmDoYFLStS%YtGr-!C2e4A<}%%YXGiB{?I|EokGdpUO2q2Y*Rk+hpJ^44HMyX zO`TKrMj7`A0r@l}V5AG2}p%@G8T6wXz{7rEPS-Ztd4&>T%FUC}o zQ8edLgq9m&|4G+PO^rV&wdOHB>&LG8ay<@f=)*2Sypx?&YL`3UFZvU_D;0^5V;M+G znzdgrdMu&bf+Tk>h3F0P{vjeoh=?=o_w`I)gU6T@8EJ)D37R`3Ts`mp@T!{QFlLLz z(5tvqS>Sl_E}i`slG5|zG{>F_+oFoGstb_Q@?1^+pQ=%`$e`?lDiDxO(0AxO7UBM{ zR&JSFVh^KR$msY+DC)lNk7F)<(!}T4@iO_oxWRFKyx^|t1c_D2GN8$2qJ1DxWI;A# zCW_2Iz<5U{$5XmM(=?EQGFv$tR8#{JjHsKvWV{--a8{=gP1I^DfQ6-=`NckJQ%!`j z_r@7!Ecd0MkDeW3XuvKpC^2_9%jb}U*5;0cHGyPMS}wAHx0NM^QG~_tUp!o~<7E47 zk=bn*D0lQ4dWaE1kM3Mr$j}P-8XMkBQpK%>A6{n2q(`m^=KQc`aJ4wNQBg=Z_n6N! zav}qDE3?p~O~xoN<#KEVutK!Lii?Z~%|eFgC%ko5rcX-iZL=DVqS2X^j{Ew#DWEF| zEEkEsc{TyYVk^vC2@IKkZ6XvJkOcDiY+CKN(eM{U##Wab{my13p_V5O%4W^nxCYG2 zz8NSr)V6{1-vY%ICg)*-`nFkw|8xM1{ZY_3&Q&?Z8!MIz*BQ}k;n4zlhJS_VmqH-> z&QB)b#;~l10b4-DaHQ)Ybju;_l75imL?SbGlJ3DiJx+#oK*+)N&U2n*!9UoN~F~eH!IJRVd{$eRN5+gbEfS zvv7#t@-UmQk#>;5reVg-B>1KGX2`c(vtO1!w08H;*r8jh`D7EyuiU^u(G=^}Tqf&8 zSisYB(SY*G*xJ_y;!B3UW`Jjot0l=!2iWNwXC@K?x_8sV;*DkCe*Y1+I$(@ylfN8- z9|5N})PYB^rsq6G*$5cdypnielJFe)D-F!ws89M}b-(dQlWEr7H4)}$d{yqXGsbTqtc+oW3?eIzv!Q5Po z4x#RK8cL_*dWQDlwuA3a89}`}NH58<^>ZqQ7>D^Xfm*mDFoxE+w^fc*PnM>HV`FR& z5a?taFq~MqTc%h$ypxSxqrV?Z&1uS zRNlU&3?ZVy2TNbGI9#Y;w`#kr+GS)TJ?06LSFmOTh5;K;gZ8SrIEGoKAzjYJ(=ySs zX4(c#ituvj5$qAq6v?e5XQ$+6^Dz2TUp>XkSiNg_X8{B=8x01}Y!TRxAev^8nv>tS zpxi_rl>Q~HL<~ja3Q}9Gta#(&vGK*a9MU5Ds9gpj;xD}wzt#ag>_clTWBrYa zqYzLl&v!W>xOR!I5#PR_F%bm`F2k>Q>V1(0XB)zFo^jwC1svz&V)>hHh=IR-m&G`g zgfpT+=g1ju~*tFREoJIxs~`lCnj@6CbbpIrTOHKvK0w zsw-du6Srx01XEyegZ@*H!ifpZPWOYTNVCkuSDT{g0!a_$nWMklCQOpm?{Q4aUIQZ_ zrx^wk-@wm@&&%U`-*iXItc#7k@=ONXc@lkXN3=RGHdeoCE2qvBdmGRRKd4}-Xzz9e zai!Cr6xJnrHQPrHNh1*O;BKKn!($3OrtfgHpis*rUL9+K3$m1ogY;Pk5^!@x*OLOb zRR_fVk&3Pc%ppCl>#SE=n3Zh=to7OeH43$#iark^p!OoGT&l)QrJlj@puATOSc^zT zM1*}1O~3G#Q23{fxxB@6WZV*yH~@=;q9G*ByaG1@3PfpciFaW zE33=4tIM`++qP|Y+32!u*Xfy^XLokr-Pk#CBHqi)$bV$yMP7XM`2jfh64tX*#+M^= zNV6XB1w#(kG^rvdT#U4PG@879_I?E3E$n6 z1J4=B{s38aC~jLA;!S0Y^B|Qe80SJwrtNRP#qQu4MrL&q6IWG4s;4j$uVM&8yR4Gc z5@9z0nWc^nk&DO2;IEBc0#n!8+;)&l<#)$$qeiT%p-RuMS8SzVdR4 zw?QvZs%{uKK9SPg1Z^$uH;U^JXLF-J;DXWHujiE+(`$+BhASw36_)f{64m3+q<2y1 z{4^r`-r}huw66AHvl>xpA@TUL1Fc-`bFW3_yz?Owx&dSUdHRPCs>;Ss3eeIe+FMm< z#AH{o!eFI@sB^yS%T0vdgl+gB%A~I$spWDXhPbGgs=`x8)N|On9a}d{KcW3tyo>D^ zDx)@50pzHox>)!s!hK!K&_EK$utBtAsJN@W4$rkw>N^9QtT|KDjB2};1L1+y@VE(Z zU+=uC-Cj)MCl2v|)#6&ppmHAMZ6Gokvk!o>k%^WMIS*RVJuqc=n;{I2k7=tphqN5s z88IfckMI;(vgPOSmPOr*djfM2Ru>J+IEct7PZm3`_H}X1md@`^(&B|PxdPAlYI|`} ztOEyLVVunV18$1a!erhoE1k_j0cGDUp2A=NZHVVGe5Z7i+JVJ>wdO12Kqfa;AjboHgoEhi>5SktoHU>7J4p; zWDTH_pGiK*W+=`z^8nc~^^s262lkSYlG4z%M~{K_cuvX?Ed4^)OooJVRfHs#>09f4 zg{BzMbGT9W_5tf07%9|?6guBE!^}b)b>1ZtMM!NTKvl7kY}pTIv3Zk|T0mvC<(1rP zHsG0~+cu{Y>P28+!IzMw;w5&xOR7K5cImx0?h)WJH|uH<*%Ou3pqo>x9W4RE`MpMH zFrOVdn04Lj>}xHrP#E32LEpC9L#4HZm_2^AL`kS&T~FDp+E(8v%wd97JYYF-NM7HB ztz;Jyg6C3?a!KfZW{o^#bv!B|oK8BliG;Eeg@@(+#>lH&ZNt%>rgx=$v57Q0g56fR zXwA!<15z2$N$bXJO>Q+-ERSjyuZFoUg+`8|ZT{8ZBOtq@#4WFzIJwW0^p4EGJvQ3ORW3r9C9==1RBq*ryte;bkhHEL&P;NbY%2mY2({s}w(wn+ag zuKZUcQbvYS>7Q}@|2&odlb^!;BR~C5 z3;X}Pc4uVxXM*ovYj;M5zgGMIOPJcEwf>V>@|)N44@WTXSdfi%r?XSC?Y>^QS}>Z9 z1`vD(M#A;mNQmF6@h%vj312%#fEH30!0sg#BMM_dTCJR^adxMQs3W_%Ck1C z`id(0y35wyf;8_zH_!ATrzojt1~POv!UbONPZ0TJ@VPFU7x8lS2YaX6%HN}oTAoV3 z`Q>xM*Q1O2MUm`tjL#%wROGn2wB#(GMSJyD!qo@hM1A*!D^)BqtI`*s_htvXV704+ zH?EjlaW0KcTRzss1FMlX&f`)X+ga`s%$ho8fP%J@G9_v?_as#6D*#nVXxPcQE_*dS2vPNrO1X% zHwxv(*`u?$S+#uBv50tv`rb@y3H>ADY}>o*>)zF&4U_08f=^XIdZLV~6iACRi7%|h zzV+!WCS%jPYZKlWrvN}afh~Plo8xkpp^ISuHIiL9&Z{Lb)&O7? zqtXYc{{T!#9)ukW4`W)hwxfzc$(2tHnDhX{ez7K6gEgx-QCbdFKNCWAbYhW^SXHuv z8nCD3MZ_sC%ickTl%7lO_1)s%BYzr5;G@FBqtM;j-aYL1QEy(v4ndtmChrp9~^VRRI4x zsPE!b!Z%K+(PT_={fL3_@Z?FYS~7O>Dhv>mD~o`(Zs?qFfvk&tOj@VN+8W08N}ul3 zJiaV!97yT2+ECa)XO)ZSBalefP7&SrU*z9_GkxH9s8++M?@4l@@cQBheNUuOQS~xl z2K&2rf{-?mCq7Avobkj5LrDES`9N+7N< zAFZD5BT&^A2vp;ra!^&JL>#J+Zgy)e66YnMen^6g+fzVRloXi(npRNE2mLrUXb<|q z@Tj!)>magGbkA+>u7KFk!vNZb6N&?t?k_qhx65+Pv-)D{n&s#SqoGAcF#0O%iRH~* z$e`{%-djZ+MAopZ;re1r6%P+E;Lhq0ZHA5FLI#TBc()^98Qd<3$LtKbrt5%kXYjUy zVX^?fq^SekY(5)@gAMVxw?PcPx_+n2`PjF?o$ThbP4|q(0+nLAC^4jP;wygePv-t} zysxq9~vxp`eM-_X(ieY$ zAHp59xi_j{lDuh21tfoQWv^iM>+T#s1dVCz(!SQHV`N88|A~VsG0oUz!R%W{jg1Xc zb3pT0EQMzHW-@&bi77zlwB|FJd|OH2Yb9m>HIE2 z@Lf#!nn>w~ZCB=Qb`jbNhywITm6r99H!!k%#z10d$9_yTm&?q$^{-fw9QhByo>To|@^ZZfWWbTfiDBZ@|TaI_$Hc!TDLKhmKZTu-ol%Kd@w)MtN zAhF8Pjp5~YmO>Hybq^bf34%ZkEg2#PSMJCt;ZYFf;Kv=t2`gfdl8glywcDRHU5L#tAnc~a z0uwz8`{3ScajHl**A9Roi5?I=X3KwdD3PP99Xw%TgHoU{XR-7xQ_S_tF>s7#7O?U) z88qPj4MbCXlrGW3N6y>NV877$9{MK^k&}+i%^QIB9FQmMOe1_d$RZQ%-|;Y)%OrYp zf&d5P`#j^WPT=H5KOp9ico;&6rJjCg@tx6&=(Pjg6QzWnin47M5Zxo+#aA~+b`C2j zUM-S7i3NPkv8v)<_pdc4h#MAWMefo61uklw`G`QD|$1OBan) zQNGKxoXAxllt>!JShLdz+WHp2wG_iBUx-%BlG-HqUQwP!|V z2Q?pMQsSD~mo|w+XUVeerUh=p?3lJ|kH%I;-`|A~C3C}Jtkx{bmRcv9AtpacVWo^! z=6(5Y=@>I5tGvisQr;LF!V&b1_I~9SPGE#pY(*JMfEejVlQBFJtQ#Y&BRG&9QhZ!( zNWw(-EbAJGcXC}2G_IDyQ6Jd%=CXmGpHZBh`(!s7hG^M@-=3v^bEURKS8d6I8(u~V z%9MgdijwyBTF0l?HGYZOX7$P7BG0q*lnb1;QlVtjRihQN!b)$hB<>&Xf^{X1g=WZ5 zMp2b9B`?~%x<*(7m(SY3d2ZVzXt8c7Ok#)<>s7N-oMT|Q;NE%ue9{Zk#;4tzj zW_`c9y{L6kor+OHaUN*O9i7eVd~K?J*9!uj%jG&9f?1?OPFBlr6ACti`MA)YZU}@t zQnvtOs=r8a`Pz4N;ULc;H6lN2QSkIQVLFf%F_Sy^50D2bs`v4|@Eb<>w!T9!F^kR* z(*xPmVRQ!UmUoujTi3SEp*$#R%U=@B)<9Yz7AV_&Ihw$ejmMTN#eNIiE-94P>&pam()S3= zzJ5_m<^aRztf5~Nk#=jtd)_U&+F#820p~EprwR4Qra#0mLs4MhCsMgRx5!4%$@>|Q zNBRxexdx-G&&py*sW#%5K(qWcoAP+!TJ(PZgcds+-jE`ricqD1*af#9&~bhY(OjeR zmrgQR_JPI?G^oTMYY(`I;Oli=eAzNa1moqA z^cq0Ga_QPsq(}S;@#(UcPU{6XD;BD#@(FjD|D<%3$C|1Kp5MEgCGY@M+J%=1I16?i z7Sfy5$|})4^^qTIh#tYok%_1z`76K+yNn~O!;B%wz1Fsrqh~w^ zJ?P}(=LJjHa;RR$2ZTep5l8B&1oVQ(=_O(&;}hiW9M%T9V9~grhWI4KVc!H=17;s8 z>+1GCE?n7?rJ+OZd}Ldq!Xmc+9blM1cMN6?9#N!M95NmyAsH>&^77~De*VVg)~E0oTYgyjWOFdT6w{#L3zfU(kezx+cNCLjMAxS79_gzr z*nCft8Cr;J@Ykij@sCwJM-R>sLGqJt36A&62OzRjI(ff8F#?I~s{b2x_ixhUZ<30c zk@@duY5%V77#aRX1p7;A{p;%PAHcEyPbjVEF;4|W3>J+)!qMmLH6$**gv(` zzp!O&e+XyH|Mud)YO}w+``2&&4{i1rdF_AEW>wl}(d)x#pEV@}3K%mWtSJsVRT#N8 z78sHVEOjkoF&t2h9U7V^I=GT&gQB|3SMyhsaFp>5!?;m%K#w|;@}|E&*v{owmsjQ0 z{l2IO8`_growK|$HcfpxMgvFJ>k|)KHkWBX_0}o{5D;ES{*W7y^BCfMsliF(Ukp$fzGJe4HQ3~{KYq5O4GyQ^5B~(6ci_ymXX+D7r)}VjU^{;cZtcR? zeE9ups9HWiQ{$w83!YH>v|CjnslFN{r~V!CnUT!N?i0y`^7uQN;bi&zKv8u`s`ZvC zG7FOa=5p1Lf;#xiViLe4?7POM=I55L+T$!gUS>l8X1}0On<_XanAzcfjAQe6GNu_!5=k=5XUqiidFw^0(% z%sLb6BXXUYR()~g`q-q%U45JlF?{VXt9v(>=vsI$!x35qKj- zQUih;r5xtx_TAzmW7taZn3G})p@A;FE%ZyxkB;}FsY@zdU2;2-MG0=~!F(WbeBB&b z#Xo141S+Tsof)8hN8Diq^qRe3<8{AT<%-x0VGcB`uTuiP^~nfSq$>$jxGtm^=}^Wa zW4k#}>vsTeKiG76^>oY4R)bQX#v2Y*I7#L5)cT8W_Q(o}s)-ZL8Ii`MV=jV&Gtuhn z@tjW_O@Dq4-IWR1Sy*HO0(J>}8<_}ZEl%r+TT!xWGe$^wli0Z930Epmg#4@&@BvP- z`)?s1hZb4YrK2(9QXaEscOi=pudgx6SVNe!Cy4}*L%rEOUagur{Flv(FN@V8SssqB zqH)Dbq_`N6K3N9f$f6+raEXzAGQ>&%J1w+b_5jz<(~3lg0y7HM6JXG^#8IjJEo;EQ zGuGhUx-3lGC~HN%pY9)O;IuMQ1{*tJ67YttGEiLA33?V>^x$F#s<2Z2q^Ra~@cmMI zsUS09e{dqrofN8F?quCnjj}^c;B*c^i&v|&_0@< zX&_~#@&!A=n4_DJ^jN}fqmBY)A0ivn>9`+C2_DJX@`oK(WqLu!&tbE=xz5#+=4vbc zK@iL3(@4wBf`SE;$#%BSp&oY+8E(hzL4xDa`_L>-%HKx&yM*-TWbWZ!Q3~!XDKr(1 z*foi){IDH4XVSgcrQzEVM{8ziGI}4Ze?yv0DB~h`L;7CgEI2X4C1O|kqa#BzUX$tp zo0WMPs++BbQKeu{J+fbdUf9M8d-fc6tQ7NCn7C(i=%_2Bp4@|OlxKOIq>G` zU$HN|oo6MB>BZ4qao+RsKco|8f<%DGm5Vi53R+#E5L7>y!yXGOovzIi#%~|pN#z@l z6!7xMO(l{_o_12q#-{nE@*RO-H~$vGGHbUpemzE7h-3;?I>0vH0IOZD`_L?C&}=k@ zMpxODS3~v+(4ER_VQp6`O``2&E!9B~sR_y{K{hOjC<` z#eNB72M(G}DKQ=O?UYD7`iC5+kyjS(yVMmW4)nL_dcyJ087Q&f60y;&Z^lL< zj21!osDlgh?6Z!c(2qjV!?(yZ=V&y&KcXSa#e9>wdIJw2YP(#bxZDGZ`89Bav!msH zwIp)Ru>>XNTZyT4rPEonGo3#*i9Kp0HFXMCK(T7C)f7~Ot1qyI4WE)+#Vqpr6 zjBcPuzx60xa4G1c*9m^_IZ_JpV!oDnno?XbFs7rEkwKNyN7aF#V2 zGjse?(BEWogRj*34Rk`#; zJ-ppFsqNb4Z*_Tnu95&edaqqGGjM=QsG*-jBc&@~QE3InEY?S3MVZgTq-cg3HBk}F zE>0h$G$t%JEjp$r6HXh+fj?09r;H9*Gt$h5NDa1fUYJemc9UP#BVUSPAX}svh=HyR z!C?%43?;VNG3KhK`xV!Q-^R`3W9=U1)Laquu_tH@j@~|l(yFU*-diISPm|8f=PKoT zNW)O%R=#4Ebl7cx=?Omhsak!g9oZ6w!D)5H&turEz%4Zn)UofHN=V?Hra@AEkXUmI zHMnrgh+wB15UWWZTkN@8)gDm=+DV~%(10UjY4Z%uEilfdAIWAGEHE_R@66H*g$9}X zQAPz}?xDy8=oG#@k?^LAA;`sGXMH?zOIyCMz9ILKg((#vt<<+< zg`tj8!?5tUZCw$ln4RVt5BcZrnw=sPuy1EST*>y!j%8HAnt=I!z(g+AjW2vh1uf&7 z=W_j!j7J&hhbajVUARx z*j*2g7kg|iuu4y$F0MiX)ul|J|0>w9raOsK7Zw0e6YY2of5hop4#>P^Gxnosum$zYe6hYJ2NM?D< zn^s`aJd>N0|4NK7YVj=)u|8iD2wUnm)OgBB`KfD<-HQYU=;1thqLP{?YPQXT95Gi* z(`=lCa0bZHBNh0$eA?F5%EJhh3IS`G`J6$XwGsAWjPjG2!cjX9Oi}Kf0=Mur%a(SB zom`PY)Ks5^L_)Llu!?23k*`{yYsO4SUb^a`-q3J<0@$2 zts(|_oz^<)LOGVS)AlY?({VUzsMD{#{Jhe1okfWKR^Gj?y=e}do#*P>JT-hwWngLpn~{kp)v}{Huf^Rf%^(d=M}!XP8BywSvpOH88~w`!>V%db6z% zGphyPaRldG;pFC3OlK<*8A@0ZTEp^8@F}+O*oFo02btoSj`xi6?&=P-tauBnamiC* z8NtmN6QwiF-w~@L0w9d5t?M$a?_0dNy7%X`C&(uCMUAe>`~{a_98 zm`&(vW3WO|iA6Eq%7C=ANJ(&B`iPr2#Imu3u9jcF@HC0kX->IFHcP}$!$p?oP1ry= zzawvxdtmK_8b|%o5WOn~mNEs8C|b9G^FRty)m>M;CYZcqF>o^J;nu_*FB5*of+89& zBc`#K7dHh=*Nk&A<}#)ka$IG#E_cU`Z?yj*l>-euV*vEasVVXF!lLfz$F1U&!!{^kxonEwPj%ySdWt=w||67LcT;TC+v)SfV{-280*_>+WL^+C9r4%Z;jPTfH!_bK|{b_Q(< zM#SYK!qoA(1)-J-w9wglw+LZ0#`tU^O)#gLFHE%05>V1B@>58K*{`)%FFUXM{;Ow z7IZCqnf0v(P4D3tItdYBRHDu)5H2oxO$G01}LI?XL_bZ1tiOx4G@lZ!=Hv*ye#PBCiVWCooTEv|#uyE*E zwaxWs>*ADqF&hxhk3(*knG~sFX6haH0*WpR6l0TB*l0&Rp_R|6Z`U_gYD-wo)Hn(@O&%1&? zYBB#jIWDOLR6=Ga2Qw)`*WXXVWdKf@3H-3~m99EAa$#~=c(?`B^y;xTTzxDNR1jgR zW>F!e61HqwYIihNZ{fEOF&5^PHjr9Lf++cGs@HAOKtl+(q0%WI7AyBu!UTGcIBp4| zluMGHK=HG3gi>sTiCzrPO|=Bm&WZ;RuNVnMY}ew@D|BALSfeufbf#-{w%dxdcaPZm zZplTEzF!fVYGu;;F`zxP$*W_)z`z!RNte1JE0-AJRqtVX^f1B*{PYqxVR-h?5|q>` zy=1o04Bbmr!#lB>4`zR@IV10ID2$(t-ZM2tV$~MBZ9}0z78)Er9=s)t#PKKP(M3$= zt}dsdnRN``Q{U5tGjGPi%VTgf{f@)%{hMHTH$|hVfa!?v^u*_Lt8|?xHj;rK@+wo! zX3ALwn$i`|6Ol9+c_yei(;WFBFEDq9xl7?rEbknSI!La3a|P-rw#Py#KS*u8TUTJ& z2ta$-8}*zV$k`~+iT!O2X``dcD?l(DT0b+OTSh^|+!ou8Od%M`yKRf#rVEuysGwFh zkPLr(70570TQ>ls10@k{rl+o$3jJnG)_rA0t@o%j@zoVCXg}?b^DR@-lfLvz;v5A*EE<6V-L9`AeL%(Y6pK zSIoFUF5e{1nG#FqaD^mCWe4Q_OY}4iWmPr9c5Un)HVptxn+o)+w|1(`0OZfE({j!Z zVkycX8g`HDrqsSDP`Fd;LJ70HjxgApJLW|G$Y2+qNtj0FcFACF3FRF7(Z9IlTDK&& zRKD6jSm>tKEP>QiOrn$GcoiB#9Sx>0iT^yKDFvaSjK6CK=x#i_ z)V^Tukm9C{AB_aQS^{F*rWw%%dMTtOB@ZX)(rdfYdBe`1Oo#$`URM`|-jvjm#BH&&y-euZH z9Z)+QE4ye9Y+S|r@U;A4sWQ&*hRsnmByVO7(^NoJ^Trswon{8z*r~WFL+ndKUKR>G88o@$ z;c%JlOZ%21p46l4nYTW!A3*nsz4?spP`%^3&+S}+NqU^FWeIS7X=nkGK%tFU={f`W z9CiGG~~D9SF|LIr3+UDMnt~h-#n!@*gyEB$b@QT>L=Z$ELu}ay=bFT zme%4*qax4m7A%(SSU>LQK%MqxP`&!R(_>7k$Fz7ix;zTki$=tMtVI@CiUE5UwTZZ6 zMbgA=f+-Md=jXHAP!_U()Q#+%N~D;%U$h2e=flu3`UMR0*s*e=sLh&8?uq*hF>Ub> zVBoXL(m`s>eqZ`LtClZU7)y3jvqB>IgP74o=g%fOZ(|hsS55E3q`rYVB%v`T1xd`%<-&ZkR9@T{4$B00vH-BVS}OB1-be_!<}&=RTriH5{OBW+Wd zVh0|}eV>Q1bNWu46rKkJ<3^ib4_*-Fz_1}O8|HbTO{96&}|6}$t{&fiBe=~ct z&TMeSokx16m1U4<8ASS3e>goDqpJ~&S4TDJkLZN0ejq`@h8NPfQ!3&kG}*^4-@om< zl$YBs0_LX<$9-AQS-$w5G_x!|J3r&b=Ort8M&(CxzhPwKYm-arqj88DdW)G^&I9ifzi{7)cE-4O#Nd+ zwNtSSVx8BEF)rP9%7i}`vX9}b1fbX4mVG((zeUvH-gK`E#{GkT;+ysbPXKs!heb!s`%}W)hNU65` zRsU&sXCCoS0kW>42}qa$UQNfW5!3WNr_0Z}^UQ;@*o^wtOO=g_c4T6jolqTCjV_$2 z;?4l(Y!gUQj>i$$s>TVfvpVw+7XI^@Z6*fZhnYzs-#KaT(S89V#jW&Fv^M`y2*eQN zks~O|LMugG*`ji8m!k)dp{i?`lt;XW9^KG!LT8&QL)((kx;`~7xhb^^Q%^ejiKk|* z;teqeKZc$9ULlccKFS;`%j{|M0{a5ph+MmQLtemV#S2a{3cAkhw32dMH4TL{6EU&2 zH#Wj60Zn!l#$G6i3==HP1-RTL#zHgywm2>K)6uO3VzEs;PDr~XIa@XEJaGx}2`n3p z2+6>~vn_I)}(r0(g)6d6bbbVcfCL99F0$ZVBrxoj;ndQ%L8k1cT; zQA|C9JQUV*vp6<(4tHFA)KHAAip$~I@Wnr$BX=QY#$|+_92}#8h(hBGob3UIB)wt` zZ&J=}&CtQ$3Z2Tyf<+2bXq+wVKo0`w=$}FN57vlMe)kbMmL}^S`_pyYY z$?jd69o#hzX-FLq#%|Q&*#aKz{Lrn}68UI+6K5wcDLI)-Xb>6Ba}VCbXr!`fBAd!} zJhDZbDnZ%Y;*x^Wu8mG!Qo7aD=hATi3|bVRme`>i!;Dx$G)qJWqRsTFp@V~@M2L-; z%v8!u!b*`m2ABcZ#@`}T{FfM@^)H=Y;lS|-HCyv z*_~hz48P8H4xe3*JsPIKcmO9X47Ijqi{l%EW@y(fDTwSoUAry6=@dgEIAJdLLakTa z#wUwZ?Y@U}WUY)M%ab>kE1~d!D166`x%z>|RV)-38G?ICq8o-gK+zVcb}}X_xM&uZ z)f;ZI)M(De;^>~<3qke(mQ!3ZRtBte&u5srm|C?O!9upMwOJioNqv_=298|;k&j?I z&p%)wj*Bqe*Qt!hNl;;M&4{=0fbg}>DzmQ7urrtlfcxMaYLN2l=FqBU zR9t2#5^%cPca{WD*0Ry?8rLpUIHIQPo|!gFi^d7*U}ab#^?51nN8gU1Wb)e9x9c0E z0(m=m$%^09b`PPXupfT6DrG^1p24`{t72OaA`-|{wa&IFR};Xs$|}px=h$fA=Ii8( ze#ccN{Y|RS!=vS`mLR_Fnd1BL`T4kab9fCWy_x=JZ_VYOFYl#=Qd;&l-j!;Bo2*>B zSX}-X`t%*favhMc2W-Ex3k^?Q;)75`pOrJ;K*ckL%gM*;mRe>k-PY5Bf#zuBMg&NU{G)%WUnpX08lo*E*sJxv=Nz``=C0_WS- z->NAE3@14T(id}y_~qj$dkeNZg3HFNY0S}^X>he+wAqxdNQT2EVzFe3n~-VM=xFUs z=bQ6<**%IqU^2SjQSZ4!V(7Ly8n+LJq5)9Xt|vzZ=ic(>SU;sDu|BkuaEK~b=D4bo z>FV}`#ZQQ+E}z_=bjshq_ImXCJhIY+k-U95wHml8L}GF7>~aamb)dE0pWIUNo2~bp z8&w9SUft}0-J}$2sr+W|Yj`mkq;!7*!pz0V^=SLuWU;T4e7?MvZE?pDM%(P;4u3KHE|f1EQ^SN$UF1WL&9YiCTxIB@nq4`jtNIh?G+!t&GmW}o`gl7GJ$acj8lri=3ps!x5dIV?Nqklu@~il2y3M zmHNYYSc0{A)(mE`RB09l*jd>3g4d(hFcM$(K^YbG2V?KlchbYZrG5-jL4UKSYT`Xuz0aM+qdEmo4jm-hqxf3BYY#0|G6f9e>w{b# ztgpw=OYT~#Ua=4_cFheg`>NQ!BIXowVA5kFEF`3tTbfw4RgKbAI(+mAT)%H#;3Ypf zZorJxCJE!FjBUR#c6h1@H#8_LF~gvHgh6ymU@CkZzSVSV3pVDzDoOoRgL$524+&X+ zlPuLBFasEm#k~FAkvBSY8w9bc{LpSZy6Z=t$UM#0nBoneo88n5trh%wF zq$~QdNjYc9h57+sV86UVvy=6q>F`HzfB$N*rWBy z3j2@%bfo(E&o9B=eplny_x$G5GG@0#7lc__PZyh0Ic1EQADUCMq0em@b=VjLjoTc7 z6p-t#=2Fvx?N;mcW!0RmQ+PkUvsD^989G=xmPzBHe%y7CJkAKo7&yu} zV{Kl770F|^VUl4w&B$PVX~d9#aoNP3wgK86r(8%n`EA0Tu=kU4ds(;hb)ZEzu=pFZ z2F@_Hxs$RQ3z;@^bFY~f<&X+7`17TG(&DQ@_;V6Sx4T&V3|tutM*H0H_p6weAM9sS zs#4{dn+vI{-VQ!)UJhNam_H=%rSy9|eZF=M5B3J~+}$1&+L@0_jtbW#KIQrL+@scK zB_zfAAC+3qMro-oy+>n-z~64Cp7LyI>a4J1=R(5@?S3o{r5kwD;~B#|9F!M9$X;k9 zp~Z0oy*(aa6CwrNX_(|tuI!~t_Cy|=bI2=ryqHIwp@p|O5raOWwq0p^dZde^(jWlZ zBDs`mzt=1qnUvuo4M7{WsuOGHuxC^y+q=^M+4C5bqaAL$Y?N2oaBOWalMpjMXaz*n zEGlFS^KMkOrxNojY1={A`ELUlk*AX2IXT1LBsLp_kT2^AamXa~4qq(o4nSa?Gl#vN zjg^4u+K|qt8-bFGJDJ10+us&PVmDR_W$gh89frjL_KS{?13a_S8Irtk-FZnk^PbsQ zR8(mLniJs(VP_llx+`@YhMX!<<~z#KcFy`f#r|2i1)~5y4&GB~RGA z=paA#F*6+ID1ERdL5B5*C9p1jBBDI+p96R7IM$Y`8QNgs;f%afcErsW@S-{3>bWj- z$L;;tXN^^fEQx=EC@z$dA?C}p*6MXGNk&Pc3yY|(-T4U@F-s%abRhm6!x;G!DI;(s zG&zBb^hzAF;6aWXXIdqRIiz^r@*9_|^qwM1S@$S5c+d0o z*YP#q9f!$BZiBeg92n|p&15+x2CyQzrNPAsCBMJ%hpXdJ zYl<~o%@c8p2|7E6(DXEfx*~{=6;?QaKuUk{1a=Av*ynt;XgciHwEG01T<&{@*)mzW zL46RfR&)Kxz>5gJW!P{esI`X*TdE9iYp<5Hghp^l zxzhf|DiI^C$LTUwhBaTiEMefuh3o*LBh$+gVm24g{;(DycybbsP{s?P6uPTqu!x3o zjm{pbq-Iw!2d-Bcn&hOM3FNSI=St1I$T`Q6Yla<6V?L*KAxeXuM8By?xViEZx-3;@)KhE4u%eHL#k@M9}EV+C?b^%_ELfc?adt2mzWx#Q+C+ZoQ_r)7tgvt+lOb zc7hz`;bD5d<8;y~M;MerU6@j)5hrLV$DEC81gBVNVzunzSb4*B^bae9Xiw}6G~N-> zOl=e;!&hyjxdV7t+#N7omro+U?cEZT^%|y+ZFrTknrT`I^duSGV}w1E`Jk2sZsME! zNbTp*y$?;|fo(E>F9W;1EK{C>wGngA@Xgw@NvoKruEDk}SnFUEpu|n&`1*{a5VqB- zNGuykTVbPciFF$bIrbg{0xwT;)+Dabm@bZ#KsKEY1^e~w@ zQ*CMgRw|AdX zRvFE6$Jv)Xd}kHuFSdZ2`u0*5#m{(S*s2aN^#SL-3J(r*B@U>z&+2oV!!p>ae472Dx) zM@*<;_uG#3pX!R%6{693m+9rZu!Uz;px?C3g~D%_ z?t{?4<|w}b@sK7lpDM}4l^ zqJX+%JaC*vV(sSuwNCeFDGQB6BXGu|_(0#w07aKb^(gE4_g!7p?12=Qfy(c>+-~E} z-NaGdyrW@N6CqIqL8D@5@~a6o^NpiQvq zLr8uhEvY2)t3Of4;FbY9&JB@VBEtpF!)WYux zg}8~1Dp`||I|;A`QSPTSl}!}+?e;`K{R!l79*HFxC}&ualv(In_O{c95#2O zjamsRRvnm!P8Hz1T}~=Jio<*zUrC=IVoBRZyP?WF;;fSRz>O#4DS=8qW zpOTrlW?=#*;z3lmB4+G1Euq%HgEl={wUKIbL!`0n`=)e03h#}WDaj3BG_#zX@;a_Q z&{I1mivT#`LY2lI?De~SMjh-Wf?}tC?i`eSpFZ~vYH(jZq^aWKKqme%cE8cU)2PM? z!kbnlB?ThY9LLRMYZnstxCyhlj3F_pTIoUQaZs9zH9FZX?67(q`29HU0!vg@@cdmA z{ud{DtO&huWRe9D33TJsC0~0w=e+zltNJjU+A8Kec-`hbT78`Yt?k8j$aHQCW2oh? zH=%GAc_AGJw!8?!YB|gcBFmiHQmYRpz)Zb?LjXhL-~nqCg62+DeZTvKyW%v}6~gZ4 zt_UjLi5vvq;xBS=T6%*5I_{QHJ&?0z!_XK%dTGqe#q^}JF3&bDTic4NT%nb?M@pvh zWq6qh$c3OTiQ4>?{Vg%s*ljJFBr&$x+~cGAB29QmE)iEY`2NMPGH!K9AZ2jT-#v7I z#&dv=bf(WnU#lprB_#t?siXBYKeJ%gI6?R54%tgob(Ogp)0|>7q&eqeB1g-!BdI4N zuA-AHC}(fZf?5wt%TxkiAzF{*n!EnUG_bh$Y+sK-tT9#K2jOs}647RMSGPdy5}C2q zzQ_s!Osy}L4tzwBQyL6JeWPj?1mj2e;Vss|3@D2ceDL(7Cb8_^M71Z{TR7`RI{&qFI+EtV>h;xMoO$qoagaAWQb$7)hLAZ#T11v^N-8$p9YFX8sy90 zvK3q`P5gSePnN#Q7V@? z)To^y!7u!3a1;9Ce1!AC;n@+*K4=@A;?Fo+&jmNqHf}FJt6QqXo15-=-DGR?Ml9I5 z>%2sB)P>DcZ~HQ0)hqfcU_Chk)t6MYHZC%4!WZgZ_|)hFgqIs-$A99#Vur7A^M|NI zy-L3zHCTNxEKXrIpcT`r88WIU^?L)%v#T)iPavCbC*V}k?@{3<2>^ri1&50kn>$c zcHm!kw9QzkkOlgGh5UN9j@Ky6X_kyD{NwU}ro@Pql=Oi{zExm7{QyB+u=~nBDF5~T zgZ%}$YFxMrzID>GU=?yCYHy~b&tK9#C- zAiKokbmpBE<5JwSWz$=96-k)ccOh?U=bly=qY8bEWH2HRsR7kiPE}DkHeq6S+R*dG zL2e5$in7osdf4A2=!+#L)Nqym;gn{+U(>DYh!`SSb+>87zJJ7U9%*Q4Ca;rnT_7rHGcL8~c-DWh=gdqV?QfH`8+8Koy*Za*ZV^`}%`}N3SbyQi^2w%Bp@s?7 z6=tp}TRE(f;RB_pU${LTDsY$UCG4F0j?1GAf`wxKpW7HJI)SnCBkb!_JRfT!g6>2< zb^v+Z&Sf&s?8y4Zr(75V#R;5&z;EH0dD{*3VuNtA*4RYo>5guB6P0D}F)rV{S-yGy zvRTdwq073S<&HX}?1nNdqPBv_eX(NEM~ z?R83j3AMhmAs?0Y^*PePh^hjaO3CiCjxtn+5Esmkga3-!Z=gc}ZnT1}l%RORUPMi#;m;XcCJH?6;h1;6Twr$(C zZQHhO+qP}nwr%fauf5d!oZQp*Cf$8=I_Z9@r%GWaH7jF`{~I%cEdnY5X&Myj6kKY0 zGcH&vq$H-11`}}Ctsy`zluV+k1_-xvS^j0tg>a5OIX?S zpxLrWabdOP^TAmw!~^uA!lVD3&9)-On59CZDn-oKnI4f`qIv{450zYVE!No!!^`w& z3RQ^_uTY?dP(X4!KJQKWbUAP~`7RsJEpGcJOXt1?6w~BXP_2PiPGiS&ATa{P)K(mb zC`&L9*K7DcGE3nDB7mpLo01Gv-U!a^W%W+yqmy1}kce3`56@*#5hls>2)eH=wU>w2 zISubYK1Hr&P#^^5&C7=IK0CQyk?Rs0f~QK28Gble8<~}XHKJsSlg>#$9TS+OMojA$ z4_X-enDbOQjB!Y;8j2`5XfMd~77z~rn%OPmSNkB1DzE|Nkt;jbYIU4?#&CG*it_ejJN{g>2da-#xTU`ye6#HN|4sbWPYCBB=+6`(3a zsZ%Pu1VI=*;_(GRMwSR&OUhhRixv{QHSk zI{+y{xxxM+{M*S^kyPk9JCGODD^h3Ie({O|^islXLWPN_A0esVaOPxlu7FXIdutm`_5%7xR;+JHX>~>2#n@wm{l6V->?sHrc88!l^17$Rn(vEIXIh0!5#Ry(}(i*#WF zPjoO=lT}e=$cBXmcR#V7AIQ5Na?7ct2uCB=lH7!20kh; z1S$U}HRaC`rZ;wki}7O$u)mJGlc%Zc7VPPl&2dv-4Wp#w2)nuBXV{6!OleB6FOpE5 z1-RbcHUW}nR+R+g>+OH;KWrT9Na5)|qMGy$jts8Lg? z4P{h#>GehilF+EG1sOW(m)zOg_it|Xcrvqh9|DZUkb^c_i1Hz%eZ8Ii`?-5K_Pzop z1dzI9{uyxv0}3(1zYW~I-aX!}u>ovkB1f`OIHpHWSqOfJVBcnMZvH$s6$kwq=s;Z- z45dd6`ElLd`eFxeQ46lIeean*n5d$Mmnd!PJPI6pz=JT3e+SB z;y5cus&AqM?v_K0FbwUR5N01%&fNYm&>Kd<0DMS8YlyckpHW63r&Co!wWQ$h#Dq5r|35RYT zL4h;3bWBGG@cm{J(~$bWa1?4bR8fJmPzXoq5CG3eF-!-~f-R21kfCfal(}IAhU)$K zZ0Ppo!s*>&pDf`Ae$@(;!{bPjIHbG=kxY1a9kIinaoCu<#iL#IQU0gB*OirW55{2?tyg; zhQq+U(ZO(IQ5#cq(`pd9dtKg4)w3cr!Ikw@1!`EQmMeU%mxZT6DKOOZwq_jJi~(_M zQA0be<#Qh69F|p<5wu$RmPxS#nEG4m#5ZPC)^5C)1Kcb0YK+q1(sHq@}hzJN5D)*1$kkzUn_CvVkU zbynxSEMv>`;pls{9>4+)js(Y%!c?a8ikgJBm|byLN6X>v8U_kO6fbY*9nUNs0}5%y z3zT~}*u7ngdg3matdjBa^^WY$4PY2q!|}AyUM|0wLm*{_fZBXqjO{NCcoMDymO?aG zU>Q-O#6<0!^8&ReG#ls(##BiKM7E-;k};JQtcPU zx#(9|s|QF)pehzBbnemyW>q5MgGXbpCCLBZWfO6Wvs}!M$I| z_(m;QtZ5on(m&~X0+X5N+{vFi_uR<`)IaEmGM0y=t(u7_bk8@U*k`5*e_tGb1ElLw z`=Ij#BvGDsv%9-dUl4nOfc1`hk=Ap09CS`ip-HL+IV0(*5)KUE&NHD%NEqcB;Nu;6 zao)Fdt6Wb695AJi%ygL^@1064eMB;P^ncVB@4d7@^4v3=Qx?odd@aLvllH+;V=&&?-x@pIbivY$9FA#T z(9q-H-C2Fo^w-VFRFpy=8HqCW&5StYfxq^5(_tJw-$1uO>;QSvp&}MkFeh$y5YuZz zmFnUJmR`e+BVR8GvU|-)DV`mIL_gtX*`u@WIhr`8i?K&hEzE~d($Pjaq^cfsL zF2G}2-kp&TPZYXSNC7D}h!$sTE*!}ApcbCxUh=>q$1E_R7ALDs{maxYb zV+Cp&N=Ine@Dm+b4AC?~VC|CvYfsl>5yRQ4VQdM|lha8bZ!|1IM&o8$vi&6X*eOl4 z+rm$4x*lpZ@~)Y zheSPlAzaWMU7vuv%?Aoq?0+s1sD**vCj#a|Jw$_3o-Op0S)to90okz%tfI| z$OGst0~e%Qk-Pv=2Olj04Tx_iruW>MXc1B&|E&N`6=)GtATrIIrww!n`i$mI>7lI_ zfe)i8^hxgf(tR84LI|Z=D7yoxo(|+LSdB%XgYU>tT~##2s?*~biWrZU$VdU55RLOu zt!Fr5?7->6UoyNld-Qr8^M>X@7W(70@|#gk&X z`>8#Udr<1!^JMQs{9|?04^;0XQ_dkBFR7ipHi0~obR|YzuO(Ow=nGc0M3ortEGlyQ zbGe?3sE0o2o3(a$eB?3=^U?ZWc)tk)sQ+8V@V^qw zEbJUC|BI0LANaigQt$rzisAoAG5@cM;s4-Q{5OKl|H+g1uWSDQqZs}_7PQfe{cn@a z|7+y>e~N_v?Y=hcWSn-_@%?jU8B(cL8`X_#vHje1iZ+!*DJPReN4y#pD@nRpS2Yse z?v^4IJ`=r1-$(9_e}SU`0Olqg(mM5PfBYQoIZlCJ&)@Fv{5RHLY^+v%^H%=7n_t^s zzh8O!H&@kl+1lUDexF|ZEUR1Z(%+^}&$G_H`YyZQ$MM}K`tYhf_Rnwx#+pZh=AzU};9Pp}!`^Dq7V-J9*7!_wcM z^w0DA``5p|zmL|RNkB>4ZPjOnI5*nv^!_gPt0C>G67S7O3w^a&p4Z3)`M+c!t~mFd zi*c^2@y-)*xrY~btRh+IHxPfav_j*t0|#d3?FG2L)Sea{)*KMFc;Ln${-~(O4qt1S znbd-k(g6R}rj4rSLF}CfepOy&>D9I)02hc&`Be?h%Krs5GHe#I6e<)bp3C|bOObv*$Wv%Fv4fJ#C`ThiOJ0FZn z<@hT?yfZ(`qi(#;LaD*}?eKp6a177R-rd^B34kvHsMZceIfnkzt~Thl_DqYf+|v4@ z^O7v}_~7yO{(R_xuB6s*)n-q{>V}~#P|+H4cbCV9yAOW7vPUKU$fB04#tCbqGKc(q zZoen+ay$l%vf#5s1!IB3wqV{$HF{*WSjBN+ZqFa4r8)#wt?CiQQFE1}21@r8qb5tq zP_9Z>a3WID3dJ3je3n8*P$M9qRvCu!m_ELZe^<9esR}Ecuk-7Uf4k4Wi|ZdKC;N#v zom&$8q`7_lZ^|HEB$p^Y!l>jP9tI9z=Je9oMPIrn$ zi@Qw*`Ubt~a*;IT`QY;Tmwy;Fz2Y|{>s4esgznpk6;x~IkDBbSOHa_==nJU;WCfv> z)UE7tOB!2prw86IR42S}Fw}A7LrhPD--->ay37XH^P?}uqsIQ!4ap+0g6Q|`x#G%3S#_Q=!9v07JoRr_Dv;4HJSePFUtGvwO{*^z^LeY+AxpsMid z+ch(CgH^M7Y;EhMN~n*5xopm1Z3hzd_HU;{Eias>Q0B44y#8*#f7~WfysMdhgPv;h zuq{^#!`#?-{1F^oxaqMJYXwT!80Bcdkl6@A44rU3SLf9!Laa1UyI(=h*01X$ zsL``S&~&MP2<85~sas;Yt+faz0q*bM@#~6Sv#9FwB9R=8{5W_ZocQ~EYka%>zISyI z-*jdW-%xnAi4?s{^C`kZDHsFRhOV`xnFtOeEL0qLbv7PaJKnc-0{j%*QfJS5S>*Hc zgovbK0CKTPa-oiX>B;=TVr1RbXl)+C9dW$FyNmPh^mdLl(`1wRw6i0&@o;pPjj^G@ zKFW~4s~bw;svu$;6ReLpiv?+rgN0nV>wo`Z-}ghL5|ZI=jn3i+j`M|;B|GmMk-Xk0YQ+oJ1!@Z|t3>(EOv|iLk*`^~-i~UrI z|Ci{RTf*^hx2#MRfk+auy0CJ-;`Wn$J!CH}rL&eY zmvpkXJFJ_HkEq2kj=P{Nulo?nb>Y^$2z(texTr1`?}oJlBYVXwxnaC}+Zv;0B5oiQ znbJ#@RadZ{WQOHTAp+%=d?}kcKz2NSR}QJ8ZiTg@HpQ2#M>FbRJfB@tuja3rbrnGC z(S*#}!Mck66_lYTsPa|S424EdftYs!7DXMmZk+YsuA!KOhT?Fw=CW}(jtr-q6j_R{ zPNW^+?0TJ4w0U;9R$w?t=29eKb;-+QmH@^WtoZUvm_t6nGcJ+Q4En@QYm`O*UJY%$ z;7fDQQj1Bprd?P({W0{tz3V*1x)z;!TOq$iJcDHZiHSUreMs-n)n#)6;FHScZA*JvtXgt}FiZYTa%n zjP+iR!4-KKRN`AWTZxaUNfNDV38s7Dj~qh1>^?zU@v=w|%*_(IyK1q;O9sQf+4Qp;2;(!23XAw_ss_|8vk~Rj*9rQz>)j6hB8syC1!KmGV)+E<$=!Da7 z*Sc*RK|9VgDyYt`TrG`Y@v_AUNo@Vi?g3YJaLvmgdj{=Mh{VL?s1|4ZSL-7CxZ!GD zt0@4#dA22Eds{*gSTc%D7o~(GNP=x;?)bwfh~L)fV4I9$)r; ztTa~gi{|}Lx^FMheSSzoiYF#527qt#?$P*`>k4OkJ^O6Cfk`Ybac^XOOjGB= zVw?iH`UVboEMMgMiZ#b?WOd2#Cx0RYHAn;~4-NP4=FMN)e7v=e4~Wbs7KqOT4U5DT*$> z7)CWNbIA{&1r(`@)~(}{*Se&ZaA_kQFO6U_JT4m(`pH(9CWyrh zYd|iN_TwLzeYe3ul5*>`tXz^VOdp!wfn=UjSX8rAkvUO~ufO7sI1sFRxoF0?;UETb zblh!rpEA5|fSK#?~^B=HrJG8Rg6T2t*~YdQG`^D75hL^Qz9+_h^rM(gsm>+YdOB4Fr0rKu#j0GdgD|^i%;X`c&ONpSQ?@R=A17l zh_*;4kuGK&Nw+-0Vl1F#$&zOZwqo8*4Z20lVqWB!%F3eqUJ})wjwFqYN%mbUSC#vH z2CTn4RajRk52PiiajLy7CWALCK1VP*6ObET*UbV+jPScW6zjMio%9I(IewDmoflmx}OsXEbzevmZK z1a*~Wmjp|^xb6XknCv|c4mg}`In2IIgKXZ1L28V<2Syp3=}tlJnRWxmHimICS8Fb5xoIN#|q>0nFw2A6D#Uhx%g$_ot!^f*=06&Rscd~5RO*~ZWQ5qm6I zs|VYb$T!7dvUkGXMi4u9(~~CNQCv*Qnly!^pk{B;c}hreRncjR7Swe1`Y_%_#er)L z829dmIzc2(8W@oPr0Y!&88gULKO9;W3U%|?in&l|Oufl3D$Q$c1+TABKwHPfb zu^TKL|BO7eFi5Md>hh{Aq9zW}$;9i1BB?x4?%a(6*86^HjC78PxO^I;{#%ekZ|F7& z611}lrDPeR^k60dS$oMy#({2Mv0Qg`mWcx=!Keou%55*-iQOt)ep=E|6uA?OmiK)w z#?~gl0wQ2p1QpE*hwp0Kn(9`}VVYe&sil~$rDWHAlSZ($KlE`aHeK%WbPvF{*Q@rB z{CAXs;1rAy+3Fv)rg@NDx`P_*&_#xS9WhdjA_+lU$t;UB4`}$J<;aEcccbdk1{~D3 zTI;JMxcLDcrt+6-melr%15)Sn6IA`>$}{4Xa!zLz7JbhVw2p5ig*%}K7~P1^W_T21 z{GvPN)slD_2rZM$ztZhYG|V!fgC==y3#9t$cAR4B%%F)H-Ph4`QdOxR5?v*Pg;xv%~5L+2kk8Ey`!K%GZFQ_XQjv z(u9sVVAnzc4vl>@08w)HG+{Ryy^lP3tW&rojF>|>V02=S2%l>5AtbUrDBm+^V2-KD zB_HHyEI50uk}h*16@>?S7d+u47bxh+yw-%U$?`hxL4l%Z2k-sJx^ov;ktoFkGEJlb zX#V}(Lrc$#grd+kuy)EjHQna+weZVz`Fcj(ArHCDZAZ1E5TN8g~_)m~W;2IL%#nAM1!*@@6uSCUi9d&j!}wx3UI#w_OYX6?++ zTXlK*(V*Z=89DVaZKL|v$;YdRVeK1~7`C%x8fWB^ex!xt3NdV3H~K~H;$)o08jL*R zmeGf(U8it&qI$lEsde11X;syUytP9LWpl`@m^tlyJ*x#WB*~;X$}WlM>Yakk7-yN> z+6Vw!;zU(fmy~b6$ruLH0>N_u#332jBN>==WmhNO(BiRZg(MS>UxMIiHoz$>@!*e` z7cgcPvu2?uAeA_D6-^5xMB-m1jtCkwCw;HreXwOPH0*s{5%%936AmYIwV8IxD`eUA zA}KWuJZ~u|ksa^xGyIphWNRm)>PYn&2&ZQU8w!cB19(%~!?aJy3u^7&y<1+`NW6Wf zxW z;w7Uz7e8deIZ`Pv1d`^dxN5-;-ymAW9DnJe6U~yt1K+{4kOQI7MJVzJx=q~3*J|YB zvpAM4e|9(-*(P$j1X9;EZ+xSEqJ0;H`v;;r(5S**NU=q7nEE=aX! zR%MO!zu-o&i1~(tC;$KW zz=%}fDLc7C(tNQM{va(rw2TYB4oJtLXo);Cj&i}p{S0a)L@(p ztO!6|J4fK0b5e5pn`S2Q{;qWYQQ#Ng6xpxvy&3LX=NMV<~n<@9_51H41w zVr0=Sz-Vfg?q@1w5n8$>S5>MqDm<%|G@d+vU!shJZVCmqtttKI$kO8Yh=gNd>y|Sk z0v)o=d~FglmPyPGM>?ogQJple4$!s9wnA~o2Zu2`jrBP>Tdd`~#fiUh z{?_*-Pw6&Qw1sfsi0#^>+!dP-{Asx>33dJ)EyFgn@$^g~bR;}sK=jiG+_6ys6<0e> zAQ@^@G+_L~)@slcEYEA41w^yRA7@M^`1^pglar;4s8jZ_<+-*GbKUq2Wf2&ek?AEB zdj)nbVN#1!!sRR;->&LqOHn%#9)BxmqSx)&Pf`m{|#bG z*v0}y*SPtDUVxZz)@*%(6u8EZ0RL(FMc^0z=l(VQjsBsW`v)%D}jrymU4tYI(a~m`&gMfp{$VG1#moF!D9< z<}`%PePd!65>f0E=Sx{o5rSxo8A%qmR=Uea{V`1EUU(A&w@i5d3&$Mh95piCgvj&Y zU0{+kP&Wg*;XjGQq^{4IVOzt#InlsgMTsk6Q1Uh<8|~iUJNyQ-Jj34(?oTxe&c0}Nvv2u2`Tb1(4dGL_4-S5(G)r_N}DktUN@A>v<17s#7 zykH(;V;~sb8Rz#N8hto!21=M$&&P@HC zg%d-dmGrWWqc$no`h-v6^$U)H#5(!c)mD=6>*54RtxW>1j6{0g8NV{7{fUXr^eQM` zKr_O&028DT!!aJQ*lod40p1$glp?oq<%8CzyIbPCJ&GoH>_W1Wtt)YtZ~PMZe$P?F zYFZ!ZF9RWL?zri;Yds4cl(es4-J4rA9LZ!=tzae!O}-^!4wV%2IYO;>;&(Z^kkQJd zon_W&=-BL!LH#{1^C!`9K@1Wtgf?PL5jG-^ICA!CWTKV0QbCJDjYiqcgep7nagJq8 z$6dsu6jklYGJ1nR$_GljabBc~qiCG|A_rygB4e@yrmXf#u!oAzYXdQHLA6Iye1M6b zMX2-h@^{db2mLn7Whd91U7~*7ITw=>J79!YVT$kjd(^Jcr#5Q0P4Vs++S3-vL-=s- zg*gs;KB7}3JUeI*E7Ac;{(eYBZuZ->S*ENNx0GC&+FAmMS^{}(> z@z!i!l{;22Jjd_<76{8%7@FO=zlT`XD|KA38aQD_VexkB<-~^?5{*dH8CT7%Zrb#8 z*c}Q9iZ*)1ZA#eE#-36uTPBgLVXpVbs#B8+ z!HLvLJR(=wAZvy-TNLJbG+Ttj4&)4LieQumJaDKo^Brek0~mzek}%o!=5}bdd6fH+ z=dtUfBs8zL=*v~1Iq=~tofr^U$7&2R)w;NHksCT^bT|(-5~LithF;=rPT6)-t~7PE zTqa5;#vn!vim2#Yt}9=Gifu6zOU4DvX$?5Ewnuo_mN51vYKz~uTi6BB?YoNrMvTRn z79o=Z(5of{XN=JNq|a12oWaYH zP`V{9HVql3>%$W3E7p4VAtw5T6K=l~e*z&#oL=q6a5+>$nM0A*#?ll1sZPxi{6}5m z?WYLN{rAB#Z;s3 z{fGgzV+YhYqglYg4A7_bJsokH6Dljql;*h1ANSF|>~A0@!kSkM zpkEi6@>Pjz)^4hWXYUMIwsRpEK2k0YIh>14s@IsPe>X-?=o@U zk^ix#f#rb81VauJzN_IdcP+~L(U$*Ni}$~Ct(pE~e&@fQ z;{SB5nf{x_c(u8j$)uyM0sD9L9r5ju@`|5E{E|R6CWM4#s9p$ApmylGna`dgDku&mC5G&k1KEI`+5ER?O*=4f1jFO&d0l-?&j_1`1^U? zb(>|C>wngMdLHoQl$qnsx9#Wg{hHWrI=T0MKEA@2O*=UIFXqzA*!}l%em(lWPd|>g zacb(cvkW)RFpeaJdGz)60KS~Oo$=<=>8B3H+A!A*r-D9nf!?4&<$zcF0b2-u9%eli z?w%L?7TIjKTd(}jx7Ep|!3ZLtTk^mC*@2e?Dfp#%|X+HGmGrg}o|lTLiNK+%x1gq%xKVj3uQgC-Cp2bZ*F zfe?)BF6!XB&2Gyt$O_Mhzq3p%z)|^g4nJklvl@1UNQBaGGv2rvX32O!Tqkr~&r%U? z|D2EZ_?^rLkP_OrFxGdDbzE+1o94=^IVNvD{SI~cXRGmY{RzZ#TNT??JWLuK%#`)A ztM>Bz20$e8K63cyOMEo-Grax{m@tiXL)NxAHWw6k@!@ebo9gSV^s?Me3Loi<=0#8* z8s3Nf8lF)Ol8k9HW_btm0x?S97v9%H0kq@r^LQUfisaB}pvw`v$$=NLRViuFHDg)k z+XAvc@fxi9@yPJ-5tY8-=y0t#C8s;NFO6^>Oy(`?;tc+U z6yQBW%`BIJOe+Vzr{OBxwi=LV%JS=!l1IRe)Y>%jNnEw<*21qo5y zhnvinBu;Ntj{S{7KWF~3d3VpCOm$PEYw@FG(%>|R@0aoLy34au4+==K(Tl2bdCWjO z$d|vS(>!qkVz2+AoFP)yFLpp{>l*}(30J1d`!v2JD(QFu1b;%^ft+0!jhD``lOx5* z4E;(f@dtN~7g%Nh;W?odlNhLNN#VM)*+zr_BXNLISi3SMNvq=lnzwhnp$+NzG(j&RslLhKyIKI8;JA5EzK)c%u?|j<@;8 zkCKQ~;$Je=aGK()G;DBhQ)pjhEZP%!-{4p~O$29V zSS7UAWuO_Ykq|9@P_W*p3&P^w-Lz}wI2K(rFf&)&?k~?&8UltH*q1lVEl4Uh4VoY# zNv!qSVa)ne$edXunY(Orn^~HQFtj}ItD!n^P{<)9m2)_BuTGps(CVlu6`>;32pe0# z42Ob%;K%UJ+e|6klURl`gDFtuvj!A!?0^Tof)brcd^F{HN_vk2oXrlk>>sy z7M;u1g3);v9nr3)49%;S*ZS{a~8*Ql={VbW2W|1BBw1N zpcG5|oBV{upeC#m^o9h!Q^Wl({ls)DuAlQTqU_a^i+v6}&q4ZqnZY|4j?4N{L2^oX zul|;V^tl@R-&`$1p>$7DM`GtP3nNSK6|Q32zo>s<$^Led(^BFXhTIMFn7DLN91v@M zFetL|B5aeSA~uHBVJ#9j8s4X~gRp|eusbH#ZVaHtbK_qYPFibd%AU$qQU$uh)j*R- zLAZ^?C81ghWW+3o=XX@V7BWy^g5dj#i=@^${EZVHW`^eF`Yy%samQvYG7UA3@|i2b zl%*$aQgRxW)41v$*ZnGMZm~XeUy^~RLLXTpZ=~A7mjV+O$HU>hZTJ^iPCBYnyY5#{ z`H46y1MJTQ@}MFcQ>w;H;|z|kSCyP!r>8zsxR#QD^~I^&AOo(lK{raxNm^imy%k4k z8cI~Uy%djDqH*_&QAZw20#tgNlXTR@;C>cfelxldroxn5I~3&O#RAj$bn)4loN=FG z<-y`z1swpNq*I;cskt_j!WovbHp#BR5m6aNdlywbY2MO`y?`zyaegM=u`*^=%GQNU zdrAmG^0LS)rl7+Vj9n=ikA$i?Qwq5%rQ;$@DA$%`$v11Y$3u||ja!X?#ZkAKv~+Oa zg76B>PMOTovYC_GrUoiH5ody-rHUt z%FC4qXxj1dJ?q&-xX}AmcjBfZ3JGmAD8?tNuKgT2EhrxDS)v^KPUVm&b6wK>A%e-P zm9V{Hl*<-(vMNwq4DZLVaG(c5zPC$miHmPDXzPb?T#%-7;yrA5nB#=sg zzddgPlmk_Idx@*;(l!%=Diwv3;Z!g67!l6{V^yOKa9Zqg(g;J+vD6g1!3H^xrcBrL zh_wwE)W-@*aw#3T9#PWXJJO4}hWT}91&Vdj#}s}tt;z0qhi!TVw`4dcL1PA#d2*bz z^_moE+TeY7Hge|hQqi1`tdqeqVVNktwK84e$#&J#mMSaPBUti?7<4c) zn~(IUjM9Q;>v*|WOy&5)z#sQtOmZ=<17$ycrWE0nbu~^ODN=Q6m{THaTC>Xw1s1r^ zMWi~Y7PKEFXr%5=B_2z;8U+?38N-MFW@Jh3uTlqQB$F+h29Swa?1m5a}QXW!c!i?YEUd07x^ z_}mlAEUv`sMly)cthT(+EvLa=ERZ#^PUT$!uq47X-r*z%&8BK(q_m5|oJ3iE5yRWk z@9iETEm^s!%$6&5NbwAEEW#o~3OpKSzS)dY!)Ui$bc799TH6_T5sk8b<(cc6(3x=K z0Y<>r%68#-zD-Ys&$Intgkr5cP+vkKC#jO7eB~@{GgMFulTwGCKLFz%YBLGtNjr=N z7GeBX>he#d^OhtNSZJ{KPDFkawt7kZT?q-fqsNt_3E=_$k$OTn-s@}?lpAWE(dMK| zZqiQ+h364M#=XQc-bg-YI*Y=Mjzz5Lp_j9y3D?1`BFXdHWQ{(|%NAFV_>}r)c?sRF zOYTaUFcr7C#q-S~f*>k?>5MvK1}hO_^mA;o5Ue3<_wBE^sh1Xfb^ufh<^@H1w{qU zh#%@FZubu4UqOl@){ks6we5WHCUYeUZ8t`;OXWFL!*zo(g3fyQ5M!!gm#(j&=2pq^ zA%OK2xxwYON9R{sSEeep=C_qmrug)r#=3k8=Y$uF9b-~at(<&`BR+>`(vMr^#uEbB zq{N58ljEd3Z1=Zfsv$Ava!H%BR3&P~jClxgDF7=8ty<13^ZBHI+@X>7gjzVP!r@CU zO9}=#kV#IRFNz;>SD_HutA0QAngGN2$eYU^(L0AR#e5a=3=4V4t(g4H3Sp8#&`E{R zkMiR^14HJ4KA_enGsd<}8BQW8)fTQ*RnCQp9%&c0+TuHq%J4I$kepzXtz0n=e7yHU zf%iZlo@NK|PFEk6QGHs1#6;Ph8_WybSlr;js|Ej|9u164;IK_?xG)6s=l04MeOykFC(uO}57(>gz7 zY*K{Pplilo;rKkj6)>wb*rGcy3+3zJycGol1nId6n>Z>I_s7i#MRqz8!y_e<4m9j* z1k!^pm?P08fqcDv{O_$$4aB9Pu323;8|?P|eb#w{jgEPe=w>aHvA5v(e83e-->sk& zn430MRCzYIs`^@Ts45Co^sFr~2GyUQ)~TxCjG)-PwJ;~}c(*@a&pf=wG}egY31y?r zFEH?7EG2<{Z)n=i;mNSJ2B4vtOGJ}~G?c)bDV)6GYQQO3?(IwpS-^jJng!U~N#iC3 zQR8@nftLPUnYd5|Ustd1*m~Dhxe~Y5!W_IQvd+lTr~AX3efg@w7H5Nf?Nz0Teguzy z+UxP_ubWA_EOY$F5z=N^U|)G1ZLyW*(?{SUd@(ah*wh671Z*fg4E@nVNKJUj{#&Wt?5Nn=*tPhGe|oFw#9|*Q(LSA6 zo9$%?B|AAAQRej4DS?#u>LRnJ1Lfu9sC=~22!g`j)~etix$h_Sek!Aqn~sE}sN*gw zYfJ|bW)gl-8AoeeZNw(r0NdZ?zI3kQMq43|dc0IFeR1W;=vsseh?$*mhT`B;Ce85> zdR%!E+OSiXDHSm5F(LBKPx-neKs6Q8l?3f&BQYbJ7)xWOYpOq;2#X9*Io^0of23Mf zhOPm`FYGZedsBPQm?xu!od8^EPXYKKb#4E zz%N}0B=cNm{5b#+aS>RQ88R#?O<18kyW9{Qdg&}?S!)6xH_-wkAF8kBgB8_6@C=y% za0qvz)2i;>$_$C5(+5q|j)*zECLqq?D2rTc(dq4u9x;GzIl!4)gr;-lQ#t|+ds3YK zzDPVEhgFG!&lO2UUi}MGQxt!lv43%n7v4*JELlF{5N0v|nivA2LpIQ1DssA^SkWld zi_vZxk=e-IX7WNRI-GZPD-}F-Y>irOIAS;?4c zL1YTTIEG2aTMx*?@Gh0g5dFxEi@lfonUZvB-r$>OYzz-zm{C%J+29&ydoXnon>f~Rvph?6w1iZFxecnYdQ=d=nP!@@}U1zz%4 z6W_!OB~T~AOk}W|10GOi2>$$q{UZVtL0w!&%nb=)<8-b_?6N*jygXcd0*nbs)hSwu zv;ZfGKyr+h?H(8PY=^3*(3lk*8!o=C%h?m&e(Dqwe57%Q!0IR5q{NL>PlGu1e=RO0LC%Ix$^hX3@OtW|zLH=I!oj6@#R9-lc3HMrNWT`ks3TRe(K3@t3hBCJ za5}dCA_SAHqte5p7$pa0Eh z#v_D=Q`aQso(m+3-gY_`9zJvcT+HlEv9it@Mwyn{$ZQHhOSK3CU zZQHhO+qO|@RvML=m98{i);@cmyYKnV`_6rTUc0{{MvGVzYt9ujS|5G%ekl&M!x(@N zZ9qyX9MN387MQNp*6>W##jG2cF9%^BiYL!P`EyHnibu*G#gv; zDZ^=DLbuApAM-@bkOYT5<{Ijvaqec9TL-DKgUbATDf*E-2&vE2*TDwR2~N{~ku+3k zXbHo)AEF$$PO^EXVomyAArV9=*Ra2OcFbX$Us<1`|zAr z?I?;nV`E#esud(K&4mS!Jye>(ia(02yl6y@(bjF7lm++IaDqyZ-#DkXEO?aE>u-msFF*rm$t83Ge9QAxy3r#UU^ zw3NW8FlvyZ@dYlVI!IqsKs^M3ZP6rOvZxLl{R#r3=_D131>{gFWzGm?sFU^pkI1V6 zU7g*RC^FbxuN|f2&315cB{8!Ci2JJLKw=cBdqHZW$T5{8Hmi#PyE1b+nR&x%fRadw z=0pkWrZ<-(I}kp|{^TJE26S@^kFlK}!luN|)iV^tM(U2G9yK|N+;9vc%>u8FZfi(+ z9J9kJBF3q$i@^J&6q=+6Jk;97q~GxM*CoJ3(jf@ zZ6a<=sJP>SjY>40ep}$86D`(~Jj;we%7oyhfUJtuzA%vo%bqU`DN9z?CVSXR9Of>a zK&FBJBJVhQCk32uUpr2b?5pUA@9>uHZbOUc$sTe>F_D0B3TT0f@Rr!vAx7)CYoOGo z-j&c5u3P%i1zR^Ik#HT|5nwzhiSD#3M12$~!LNPfmk%f~-gWUK|n8P5T!6aE@TPCjE}YUZ3g^`Ekgh))ZHVrJ$B7_~zVPi_*dfwudx zO1P854n!=Okx^e&e`2SfaMpUyBCbynXq7|rVg_cDKPC48krYv)W8N+_a}dZ9RYl9W zNhhqQw2aO_sMg$|9|!%z>ZZBB)PZYb@U3}p=j#b6cYG~)%>k5~6ICN7M4pk@pwrXz zonSO3{Grltc(Av6gNBo_Yn-Q^mDd@YA?*3^!5LbAzqhY?%?r$CPtkZgbtgGKnVZCl zw?zj66WN5}2drj;Mk66+`4U9a)C~+E*3ilI-3b%>^c9s(yh!nQ-9nyX*LiUv< zm{C9IEX&3t<6J$UwNp3_n2)}Dz9)!^V|J!Sa^QhrGht^9D3`cRz~$@L(@Z3eKxVHX zIA2vohCQ3&YM=V9GhKPB>&mEx8yiqTpIaZcmjh`NL2CR25W92g|;UTY=yk8X)d01HCWG~pwiN(YP>_k{>0M|@{lgkpT zasgH4RQx6)_ZT?P%ulI~7-<^rvk8)&1i9uhpqW*aP!^B8o%Z-EYSVehKOdl{*tsY? z#)8h-@&cR>d&2n8r(+C0&s?(>FO%MuYAR7?UdqY1=m*4fs~lLv`=DgaI*94S7w%36 zQf0<@XvzrB;$wa|Cs|b}#`(w~bn~RhYEwQ_IVZ|p#VSF$Ibf4fJJceb3VmRFyc@!2 zInU>@!GKOe^a#oYdho480^9jfKn3xd716^%SOX6^n6gfaGM)d<^!mmstd*&_Q>a;`b#v7#a-# z#1ugsEn*g$wgMSh+i$=a5YzVGd56CPE)|>x`+tFEURM(`&WsNT+*Nt9;bT{9yV^T86tiF}YMfuwg zLJpp+tdj(#wQYuPGchH7X^;M=qL~S?ww0lPCQ(9S6SO8mQSz_cJ;_1CG=~A_YR6j0 z8XOWCRaYwh=9~xE_LHX#&Ty5zZq9*F?~$3Rxwx`}MosAeMSF2Fc(;<)UEWo4HEBaT zxC;kd1gwN~BZG;{Nf{RCvWcpEd+p<7)}C6^?&{TfV20^_xGvdmpXx?%jCJ_>Zd;2aBQ_XPHGR;P;@lX-m>|t&hd4hCCEh{__qUMj5z>tv>~xb> z(qThUdfmwWv~*g8!i^ICaS{>07Bi#F${YL2iwQVP$GRIOV^^;7?izAiLD45$+^qMd zw(aQoM=P6>NfpX7#{obej?pNC;$?@G`q2O%*< zLk(aPe6R$jzQ))BdQJfC3`>!7*0{@Bq@<06(Oz z7}v7Brj-X*m_~VqV_MqljR*!zZ`t7Osv^e&?Tk?MgilJ~ka|xN+Fy=!OeKVh??$K7 zah_9GxFT=6oS-76Tx7jqe+U@=G!1}u9zU*!Z}d_npC-ZW(T>MycV#K};vF@9Wq4n> z>a)WEhbnbmwp=xQ2R82CmqRiVBkV}V#WuGIt5%qEjg1Zq#^Z)enSexwPKjeo1f;IP zlE2P4Az^@|J~*Q_#|bQB`qjlEshPh1t9_4_=Ox$_IB|Bt{=y{C@53t(i(a00^~Me# z=9V1&ZQ_&-jLYE&aQOl^mxM_hOy5^gZYZyc5nzBl09^JfEzYA3Bbd26B}9bHj`T5k zc}v%diPR08_n~GfG1E|_Uj@C)pu?MVpb7G#vl93bUXB+pxNF)%_%`KLM}P6J!Btg9 zw~wypL$Sv@Jq(@ji5*F02$3g%Bo(xMjI3ywkj(kn#&@lr)12a6=|e2O6`7a2#)9Vv z*A3-e6wK_Yk|`Y)+0@0VC#igqYpEKU{WBE5Hwn6iWfW$VU_(&O_)8}FI6oaU0>Jqg zLFZfv2>_rh|v_%`0}EdE&J9;YCOAnL&-K8^$sJ;wYjge z5)g7IvjoT|)yNO=t8(NQiGG9JOs0V5)ujfIBnHKGFYjnZbz(((m__?%@r$jrSnf<}uAB(2)P zMep5)mfc*nuq9Aj=XW5`m%=0zLzGSOLPC_U$ewgvrXax|xQtk9 z<`#chIv2ZZ{eWj&w&nPD43|Hs7rzM^9ITAY|HW`&`t6YR7f<7VthK=Or?A4`v=;s# zeEiSUS^v2DuRi~+)&jkxwSlRL5WzoQh5vk&B+wzC7qk837yYK=h;e)}Q~v5z?9*Hh zit(Q`mEX)4=07PnVr-wmAMy^Lqx%dP37G#>iV$P{{mDP<{Dl9N0gW z^RM3Nm7EQo-0e*MyqN^_YUajHW(14`^b#iKre;pR-~DmhWeprHp`09?Kfftt?&K(M z;vj5mZD(s^@_FMwza#b^WND26000010RP<{{9|Chhx<2q;6En*e@ubt&&B&+H-$e2 z_ODa;OUC5)w*2QRF#Wk({`XDc_rU&j3V-q6{@WCo|0J^gubaXj1N)aLd_G41^-K28 zRru$#{vUR2wf05~i8!M7WvyAbcUg*E`;8(yO&knH{TLft6kzzTL67ui><5o7=0>m& zQu=p%Ib&lLlds|~M^md3jr+siR7`tAtcA}%-*4YGyhA@=r7lM`E^TWce7AjDKYlLt zSa!-eU*x_mRdy@>+of>U9!h2YZ+)p%9=CpRxadPnX7 z)=mA4kAhfYzm(rZ^VFG|w_h&8g|_$@$bgbWrKHcc~YcEd7)SBf7XDDid z;ww)TlaTxSt(~L@BT;iK8a*&^WUhFV{Bm03tY_&XtGAEZmjrX66Q)QDHhZ4Uv&_r~ zAK(-(yH(yz_Oaa(xYdO)JvJ-f#Zq~YXV*N_E>D-z9D#UBa7%m{L=IiCA*qPftnWP) zg%Dj7-(C_a8qB z5F5$a)>d!;MUYzfLW!Oi*rgM-j@I_N1Bs*D#Spnfr)pcVxyH^iL*XG2J=fh8krd|7 z>*gx#?_!Shk!IPI&EV_Z%EK~Hb(YbMXc~4FO37bIn~$D+YT`>8(H$?Mla1W{WPpj3 zmwbOAKrJn?u}crZFtmrWFat{F4JN$$vXQNEE6EvxL8Q+|)bB?)U_Usfkk2)XfH;8| zMC56aKqJi6P(iS0gfU-;lv3B@0VM2Krof-geWD~0KtL17*Xb#hBj}W1fS+S3z=`>p zYZuH)-NiA`&Z;$$VTZqB#Qe!vR4=@YRXgKG+&oo*y`f8;=cE%EvUrFcCCyx{z89Ot|I9F=Azu_JUn1ShK%HKzw2&+RhlrfQBhN z(z)M56m~;2w%Dxdd}Z+CYC6_m=4SMz<&rT%iti#4O3m?US>*LGicK$nCJKKhH{>WE z35&?S?0EQt6Bw9H(i z#VF;2z5H%U_D@f7&{t@Cf8N*+c)OxLXd{@#ud}Ny&riHTBpqA$?BA0aLLrgKr~z9T^w*loOi@P?tya21Mp*s#Y%>-hpQ!-3E{?4s^ne(<-t5%33j9C^{hpRfd31k@e(;1mRO5}{iM~tx+F(21Bwt@(sia9olWvd^{h#xmRjk=wx55tvnU zX*!aiY$zMJIT5Pw;c_)R%{k!1K@10=BQ2UnkT_u2903z_NBhS}KCL80LoWoox$&mE zf{TMOKuFFfKs_fJAlw`-EgUuFcvFptA`a#Rpk{#Ik;=3T!{p(pG%RPSK!Opaf$ULz ze@zusv+@WPamqPd(6BVk!O0E95gy`}0?keQP7Z?liC8X^+5n zxLDgl{7QOD=M+^=hdZA)tEfq=$)%eueHh7&KgUxWQDYt_T;e`4$YlBMx%%)Dvf;lF z-yi#cidxkFmiqH0YM1h|11i#@D1&Y@&ul^=hmmNkhnwI2G2^A*0Y-#91|V24#I0}I$AkpG%0Fltz_`N% zqnU2~73LcX>-REy;l5aohYfKNC02d7AWC1f+omMe^KScFf;H*<=xlBWrP45wi7@}0 zQN$w;mKRQ5F~Yafg>sD4CNXUx&<4T~I#6uiGa{taAOZSA{78pM!%6`@{B8R~+$1KL z0t_6M!NgAi1jIHXv3ZuS8887EMP6B`dj?cPbi)0ucIt(7$t((b1iOecqT8Z?OGH-S z6?)p+wz;B4L8mQ3d(naw+2#Idpx#$JregRKgwi6Fk)BEVNtkHy%VBkB-ByuCpuyEx zngoaWJPKtq!S0hJEnfo?6;&?bAl8s_A+Sll8n?SOgpp#MPnywYBubMtt)}+(z(UQ7 zmc`L7+Uk;EL&;{;(8aW$Zp>Dt{puX4jDT+=g<5Q}K8IU;&_~&60e`#H5{*e?Qjf9b zh|qHk^u=Uv2SU1Xdi6Z90Afqt_b8}g2=xxG8kv!FL> zy-%fGB@SOT)i-6+`f~B>b^ofSD_M0)-G%eYOiJBRd_9fe4s3bo>WM^^U?%q*%6>>c zZm2nQjhZr&1tVR&`{i68j&mSu=?k%PJ=g}E7~RyvzA@~0UL$O`0j!8H@KSuD?FuX| zLxv*u;Zo-z);)y*6$4jI>P;9IVj$D1b5<}lcs#Sd64}_KIKdlqoF1P3J#^g6X#Wz% zI#JQB>d|@?;%KMM!TH8*Wm$ZdO;g?T#5ufscMsl(Cy1I=mc3>YQoQ=9H3XBuTWM{U zut)FI+q-1hH3jei=v&&H9;w&@?RCPCaYgjE*dqg6s-q-upHWD#-V-);@Zq`O1Z9~* z)+~A5^`~)?#!|BDc~m^-e9AJ*1u7)^325Qlx4YY(VWO>zl*#m=R8ic8;Gk?!()KrB zZ6ICcgtG}Vs9Z#Hmv!jWL^^*nrv9>FgAuC!=gt12rk?rthzH4GYUf0>PHd zyo6Gdd0r+sCRT({6@Y3+#9h=1!q!kCyZR-Zg~K5~ocp1mCR*Jo{%<~#ExCWUd{yt~|oi9gR3rl=K z>F9^uiMXT=DrrKMwyIBWipNMgp6}BI7Y==c87a@R^D`0$sdaJ`iW@^2Bcz}M0#)|B zh{CXsn*`LKqsKFfMf9o4j%6bsXxU;{GyxeKD_b{8T6H%YoJH0v>({=FG0{@T3_b4X z-WHtbTlnKO>u5dxl^Oq@s%-9RXOBv0tokIbLv8Z=E)BOF6YH<^VV;i6xx|o>VLf;2 zu&p2g?QO+=vb5WF(wZXVUt+pARc6Lrmmu@;@woa(A^ArV=)!80VFNS?2X{5F)k~yMIVhJb6dDh1DB9WU|2tNZ(aw34A%pmltN`B4n zPi{RM)=(h60tSwCiI`2LW~miZucIg|2Q)MUO*c;#4AY8LDGO*}`zm4&up6~Qz3{sc zqt*lg+R4?pUgbtafAJU}F{EbzM~>=pEf^qgyYo{MVgjhs$8n*M(r(EYT=VA^M1jLh z&W+(|b8LkxPzKwm+X})h!~rQ%U!=V#{f52eGQc+k6!*x@b|AHsSg$_c-*XRDpV6hA zV~2AW4jM{(U=@gBa{e_?d3E00Jl&zmtSogQC-T`)9o{rnA4y9kA^%mW@cYo$9g>*%d|>_Xp(br+LyT^zuv_x-7}^GuN~g0OV2)MX z6JenTQv5mdGnk+54)0B3+}S7I+dve_-Vr@ogz#8u38=~VEh%;Pv8$AmYa%}69nq(Z zv`p&F>I6tc3M_hWH6ue70wMh=wtnD)R%kxAH%=Y)@ioRq!NDsrEpvutv}$kk2(nCt z7i5bz>YOkDDeGv-`or^8lP*sAw8V3*cmn)iSFUEl$T8Glc~}6Tp}XePQ!l|PR85HY zFtxBX1`1s1>MUFVBZoCJP+v9tL_B30Q9+KX+|JF5!o2q{D>(wM^pf3W=9s(B;@!oR zG;P?t#V2nz+Lh4gO=NBO*Y28tge1S^I)Gkn5k>SY!IIQqp2zJpYWU4X6yJO!5Qbm9 zoP+|7rW;W1UKWgec|47&vYX~sn@W-*iu7bPe(KWpPpOn*o!Y#rW?alSZSwh}&GoP#t(pN83D0omA?rhB(|V^6qHL8yP9WHebt zt(cH{33n^ZDJXtTZ|(X-DYQh@p$JuQ5H(DxYX_bfvXn2*6MU_D8#;#O5n}gc41MOr z`gb+N$&IjUuPPyIGm<$WrTjY*PfTSS+!lYdBuAg{Bcw*cZh^Udm3p3K;WGqH?j^AKS*vB40X@*Uf$ub|q`bLD?=7-vRTy zb|qp3sw*g>yPO%sg`LjEPi)DK5Wzu;Ft;!tP?u86yv6XT70l~vdo;T$)vG_7VF)I7 z<0NsyeRX-H-h@+Gh8<;RpYjO(I3Wtu;`jMQS8it{=r@r0W2z%2_-|Bn4JfL!o$+Kb zc>J79GzUxJ7nNqjUY2N3@*NA)1;gbb(or0Ck`{AchxBs|WzaazaUNaqt<7JfUsf{K z=xNgpxo;BKY64gnn9N~4T+c%MHQE;msklKs9o~9|8~If#{uxP9klU zBO}Xel-_85=-O5MoOTbM2Rmq<^g^3(dOJ1I5Kx8&h~j>~3`IKyS^M!V?I?7uDNNND zSn2D}!voR4q83&3i5No|Br+&qyS0ZsveArAiWAiJEUm*g8YYoJgKd#<5m6ifv?O|K zU!S35bT`6#Vo1=;amxU&rwv9kJ1MMY3v3ZwNtPG3=6QB?vOxKY&Fs!dT{-U7(MLF_ z`>=4;kKY1@NBYAW3o7bd1MHLS=6_k^ z@Jn!yl%n*P$qqX>Q^+ZAC-Y!CIz1!B%hFbU_ht{KM{k=_sbVImjU8-rSPW&j&?H+2na*OFqImMlGozDG;Fqwz<%tqz%IMY zZaedT7~+n|InQpp^mhI_D)%hy@LBEUbN*Q4{m^=Natu#VoYbFUD@C!DsXycQJ(XGc zID(9gyZk7WbHV~|rX&@yh0N6XSW`0Xe3ur#tMp^(fq%pewO1~D(R+A(siGhYCZ{Fy zneT!w$|VRr{s_6cvXAd)GGo<9DfQ~L8EoNnX~s-RFNPW@L?57&^MZX0JdtZkst=sM zU7RM>%>9_geFSDH?tD*1z4v@~_=xwV`UvX{j%^IAZ%hmDy41*Jn=}lGKR=p_=iI>z zR5Ez%j)3U3M7X=o6NRPbKaIOh-OfG8s@G!8FvuveAwr@tiMtXSF*iWr;5vuB>C3f! zh^0Y~g9nW-v|iGmZeh3%>fPp)3=fub4^XOX-$svn*iPVaV2*G`S$qHl3oGCRlh49VSY(9w%Sw<_o zVrKqzQi7znr`GFI&{>Q&_Uf#SHHKYI6F3mDFZnNVr?B z+4fl1xf%Q+VcWWXUl6Lj#$7$?5eNZXHrA56wfPrziJuwW<1qVd#rWv3KEk;@Iyg21 zgRnwk=U+SDEoXC54Kh=s`MsB4H}FN-R4}WUjS=eXU!Ksx_51v4MCMv7XJ-ZRk@#OUj;#X@Cb{P=EU7P#*XI+_1mzT2`gt77Gm}tOgXyO%fPP zWkQWX=MqWj3lF~~4U{fHeT*+43k^9(C!~XS6C9yYjQ4|1ANIYHf;hiR24QQQsMbB3 zYaiH$FFm-1Tr?b?A=0tW%(=dAPCqYuV5Wfj2s-tNopiv1)DkAxrkQL){m9ZC?T-S$ zcV}qOvW0j{m4z!O95i8tpur@(^R3>6BO0u52_D62Q?PM})|9|XO~;`d^hqK`u^)K;;JDIX!q0ge0(*!+edgUh zRLikkp(p_g;km1FaoF@eR3H-4G|qK)$q^EMO98GCeP9n&__GG<@AuvmFX0rme#K`p z?&UoBY1$Bc!d$4Gs*R!*!eB}yPXNoc3k-B1e4>U(tGbs7mA$Xs69vl)b$J!^$R@-) z2>nh^o<0~K?YTrAx@?Jz^wFxdU**x6e){SV*X0A{e9PjnCwRI% z%T^4OCW9erTV@vMvWs{?U19bR`=v?-z;NU+>^?Sa!hmYTj4Xi#Y&UxglHlt=N8>Zl zkz@=3UK77vVt_|aYZ7Ws6+PH+fUNJKIB1wcttV0>lC)=)d)__JqjS!nRWWw+T{x+0 zB6A1(qOJX)OP~(6zf=L%f(tIA4~yYdpE@;D?oL>Q#h31jz$+wy4=!lTOt>z%@jQ3~ z6X+@|cY9g^eIYfH8bpdmfpW3H0~swSAiPi5XbP5d5`Lp<7`V_|)Ux^GfPKbbs-~J5 zx_2AX6GeFlD;Ny9b)41X3bCJSkzFFczz1M8ySniz_SB+lh9VNmP!7ypZqZzTxjDEW zQia4J%lF|yj|#BgQ0Loa(fQ%&pM%dZ6_uWrKjytZR8*KGet|2?m^Ab(^<5xyA>yzq zTZmnp_`@&oVELXjBIjocdq+{!9sk5^9%iZ80Ig0Xwg-|eA89{|^Nr74DvZxr2CRN~ z+B5fc$hxEz$bY4Rub3Rk!|bB*m(4aAO#dc`SZx(jTb6L4IoGF-lES=W#m?`u-q5M` z@$)Uybxc|}^npL%fs0Pvm|~J`Jt*&ia&^DZ8afi~o`Z;Qh$nz#b%mW75OfN3ku1<|bB_YZkYhJ{^i06c| zNfp#yUzd+~JlIEB-E4rUc#X2CEY#sK!4K;v0}(2}cMhgsIKW+5^mquKmU9d-OiGBk z=;D-8QU5@`BuRLl79tN;Qypw}{>dcYjFITY6|5U!Cm*%ux|cKaV%$iF0aFXJuZtVw zrK-LB=bvs$75ftgAjPB#Ws>}#OjSuIsH2UFti&Ey#Dq>Bc(%QIdHc}ZoxZnDl{jO0D;E_5 zOpJ_-2MczPjG%0Ml*JWXBC%Ma5E(=-!ZTzebK?dF;NW>yBd^FUJU-gI5}HAE)?zRD zuWbl0qPd8skJZX zkw=f+AYh9^OYrlYW)2(y_~5DA(n&lyVpQx1zMTin3fdC7G^S|F?aHW=&gs1RaiqSi zW{eqlg7mSF4t4PYHu)MBRQh`nuNyG7?gICufB~>; zAY_1zLW|vSmoh}wEm~s;2&RN_hJHoz^J6gJ-^Cjtc)@rXKytUWd(QI44Bi4sI>?zG z>cJZM7{eYx96a2~lsRts z5K0QvHyC8!vf0WFJox6Tqc9b_uWJ~EDo8^GdqPpXM6tnzqSR!Y7@%A$faE@o7}=nH z?4foGq%@h>k9fZrz$(~&Jx$*L8kK@Jm?V1NQ=k{;3pC;Joskn`T6GKRH61g0o(B`l zN7%QCoM?6GNp#Dw43NzhTc0r5uT@Zi2$~>dJWJ1PUA>Vi!Q3#=3S6kwfTE~=w18bX zhC4AF4 zNRl-i_b%yIG280FC|=1g#K@f}4IwBtC`c_Z0b~s3^sU{41`tcM zug4WN+pQ;l*N}1$^jieR+b;MTIB%y-@g*iGuI$OQ+Pr&s6W9E0mrKpVW}IAmPq?S5 zolE+MIa`({pP+E3JE#<7dZTu)gZD49HdS!y;5}VxSY)a?^chaAm`FLOdtH46P!D_q zNrjwLR+(VyAkg6!az{Qo*Lu#lK?z{HvG$07N(Kt_$AP>nq(oK^wzLNvaPCei71RoGi|_ z@=Jt3X8H5%zgx&}Vu;GC^025Wy1Q93SO>Z@plN?PX7RRHXNw_|2E#dpf1@(PZlj@! zJSh@fUiOkEm{XcDvTFtR{)xHET$@U~h0m zQQVaF5Xw7VKwm%4_bx~7PpE0tB?6n8Q^7b;FQOK&G9o@*4jN8+ddvhTdbFUww9uAM zr4X92K+FcjHcXy@ie&+7sI~(Wt1S}o0@w|leFRsrL*9ow^efOXNo?>tok=Z?wZ6Qe zFM@gx#&#RjdHhe z!4g*$@$&(9a3c{ZDGh751&tzJRk?q>={1LKReV;onNtLMFli=J^;oyAZickljayUu z?z1Rc`rWs}GMp^BhdJ$PfjaowmL@-(C@}6zfA7)`o6ZK&v+#uiK!woEqWcw}>>2%c z4p|h|2*bn<~ISm^(MiB%*$5+MWKAb#cL@x|dDoT4`Dd z^F$SO9-IM@|v9=tV5*WubR1oIE0)jnW6Tz*YBEN#mC;hg;6Ke=<=|( zU6e-iLXgbJ_v!~ZL9{BO`Eq;_SZ3l|ZecQW_M}Aib0Xom;Vo=ca~Y-~Sz<+IudvackOQGYT$sQXg}PC3l8Nn_~

^JS^9_H|}Gd?a3{iwydv|3)QaVv1osob<5xTW-1%g(BZ2+KV|-@(sZFD9=- zdNot!7&U-^M;X;`a5_-ZJo!+1gq&AX@)M8zTWM$aT@j{qudf}YR<)}=*^;Bjc&W+_kSAq6H?sxQD58OGTN5lnL=~|JdZ6sNgYD9EF zT`Mb;%2B@sBVA}%#;bGjM_n~L(`KGX+)YjuV#QQ+^=n7>GAB99D7&M{OSg!AXh8iG z`~628mlCEDgW++hNQ<>GfA*wkyixSU@eyHuREl)T53~k5*!zZfyrKia-`gxjL^r-C zAf?#V72m^2|M{Zeak$i$f0Mv~j7e-uttP9k$uf#ESz0&XgB|gBt%F7qx=}{3k)-oe zRhexM1KORhLZhErRN~M~WIf2+sFeHQT?nnnIG?NwvOPMccX#tMuVHDmSx4!*Bp!!qDc`qiOC+c#__i~^mYS}F;$S>pFn)A2EDL`uJbWKc zf!Y6aQ3ayGCi@4o4;^C?$;Pzix!OjU_)its_Z3t2xr%Plp*L37`k;@j?zPMETUi?B zf2Vq2_3|725QEL!it%kngN6ufzI=-M!I)3XRmwTGfS(Dr1RAPSqrRcWqSHTmghqRE zKQqYSYNoC)L6AS@N}Nc43CzxMbYeDzw;)^uU)^)x1w3aHJ9-?7+W?ALddBTHRK{cm>tmK7* zkqU?W5|`dmX%LGACyXU%%ELo9u9xVf+rvN3Jwo(u^UEb?o?a$6I=XwWj*$54)Ewl6 z)mJw zjm0ci*60 z(Xm{gruF%x>9YElaW53h5LG?xp_vJzB14J1)ul~7ai<`Uf%mEvdhQdimBgBWj2l8K zA~#f{ZIdfC5;pObY#T69m^;OsDwC|`yrO@=k6N;PA7a;tYc<^9#jIOLO#>kc{@Nb| z`7xfY6%@qVdDxlX+vSj`cA}da(xR+2vUdh}<zp!&&ar?5EoroOMP{{Go&5?6D~n#0yfLvt_HJz= zewRiCzImKdqj|xQ2AL!?d($!%mu%1wu((svitj~rluA@(2=;hfT4h$-CLMy-gP$Mp zfNo+Y3Rw4t+?va^SXU(dhkb(*IMJtW?Jy=bI1_x4Ld|e9RLVd>o}*SM@_H#Pt$5>3!h2k+~nxCc|v!4 zzIs*~D5F&iUlO-%EFG~j!GYsDFP@%kTTuhokIZ6UPtjP7@;La-YWX9D(vkI(Wa`gG zicXW*MXIi5i*bX~GNWdC0}6N3h+j#@*DtaqJELU0#w#ooh9mfl{j)KdTA?HZg%_c0 zO!~)mqgJ+B$`8Xk6k0fH6pJho*8S+B$WM3rMl*C>X&Bn(4g?#k<@j)U2bsb;iK<0# ze)xa{B%3gblB0T=+M{~KC3ORw?{fp3UFcChdke`DE8V$uD<{g2zYiFXG>plq z=7#a<-dLXZH?VwTf^a#$H*V&bJ%1ki?y579ww-&-Ljxn}lTwBjf`hH3e z%=uKAHZo-Ac1Op2QC-$gD4RR&b>e+bH6 z$|kM6Jrb7YO6yW+^%8vb9>0<^`iS}6)BYVZO*n^kNMN2uKC)?=31i51OEKrL*=NLT zGsEL}>`n1RolHB2Vl9SOHD(!2cb3e&)^@*f4eg2sl3V5XbW)gtaB6aW?%Du82RIn@t;GLYPi!RNleERtE&zH{68OuWPIMh-C{u4x`lKT z{g}ZpA^re&vu?cS&Cy|9VqgoB*sWIj7+>{lMC_iFIYKU6Au)hqtT_V)mXc^ECVeVZ zUOJiQRR4v%#+u4KaikR|e@U-VyT&7hgT%@wEg5h2R?xynk7(?NHo&MtW)b3gQmbq~FZ|{h{w%6Ho<=w#;N*THUc&rlP zd$^qW<1hVE15Ze6sPjFQc<~W_RtTZ8$wv<{X>yD0W{|l?5+2giRoFVMji!gtZCKZY z!>!Dqn%*%2fb^@HJ|IuNL^gTtNG;RU+7=WV=Z0}VmyrCiq*u0LEQUkiv+9v`l>i-T zL&k1@A2VYqL!eL|!!uKTYKvsgVor;0v{i{SGc#u{lxIR{m6#S&!6%zIudQnHsA_ey zG5dQulk8*txYQJP3@ei&9*0D2mzj{|)hD~vS!vv6jvTQ}>1fpoE{rZW%}aK#d-Jn% zsgKvwPLm^@Eo$DKzj~l!cN#eU;!&}&7*pLxXw||A)D^46EY(!bVAHr6fe8yL0aiNJ}>e2na|^mvkcy(jYBJmxMG3ihxo|Hz+L~ z0!p5}*?)g1aGm!(AI^2{PhR89Jagak46~nEYu)!UE3kwAi7E5gM<*%T9gW!DnQkra zS;3mrbQNFPSOz}A=3q8nW(_Ah^B0?!Z`PlEN|?B-Tc@ZUz-VUg92d}`9;F@4BU#Su z6*0EM?#D#>%L#FM(P(wY4Ne+W>a~&(mT!HuU4ZT^TtJV?eSXYWMx(yJz`}c#0()>E34zE!x?vg@JVTr+A+Wv7KtrN08*V2WOf9^T7C2zD(%;MQ zh|suouPXH|I8@-5M*wGJY_sv*$DhwWOf1D{c$)bZ0^0j;g2F=lvzUYOxVJjJ5Z;r2 zmwau8AEaQf{?Zwxj~lBaU^=nAI@l%0PEIncipEgmb6Ow@DNTse{^4yGf^P>Kt;)%( zt~6rt@9Pw#fchVIpbYn(-Yo2O9zR zwqM<0k=&xaC;D6;%nKRI4D;14KTD)c{J)5&IhsBziP-SwQxCRo`4ierP zd)3Q`b}_LZ;^j_$E77{)Ke-B@A1~-xQ_n>^5dOI#Z))+gZ>)y@lqVdkbiYOg`lor{ zftfjgoWscSozM9wT8Rny5!4@mtyYTo&&HZem;qn(+m?eZolFA!pVlTJi;{Vu9*T2e z$(#l~| z{MC*uIuo!@LrvWA`V>)vCuWA1_oUV##pu@HuRh&~MQid^Ik6JV<1)I01>;wb6qxRW zzU;|6h}wxSnEVt~!IqLy`#E7&X25TT*l&T5IAz^^hA!+17@gPpo!?46TYt^F(kFoQ9z}Sd5c{#O(VO5{9aF0hi zcI+%+zD8cUp2eYLPcBn>?mgcpRv`653gRT`5RvKcYrPakT05QqPIK8rn2!Ds54g2gn#v+LNEh1Y>drh`6SCTL;d>9Vl zt|M~jU@37uz<7_`8pIVa=GejZJS^QV`~jy(nhCM)%gkiowMPpdPJG_evyUK$%;Dw= z!V#IrGsX+k)|)w6)V%gw?2RP4k+IWX(n}tE&BWD*x-x0i*VHiFEH&tVKqV zSK26?*gRh;JwR`&j(P*+$bV(uIK82=A9v?_FjUj6K z2@8{cIYsrv%bGhhnKu*l7U?L9HR|)~k|roBipm=edr8m;^=Kk>$V!<<6f3VGpzTznf+g zmTAgS3+A?kza)IVcoUI;Zbre=hnh`?X1n~fzPc1w+_kp<#Z5;19GPY(TS&)>jznMya!eg9xVzxHKTjb#p6y^`rjNDHan zX8i$+_6-~@+Lfv%w1KAMt%o6o{qvH_lGfi5m^wKCHg~8AVlkev6X@zL4z5&@QvS*ff3J(M# zrMl#5(>T#2>_iE4H=>g*%jK?_!7Y%?h*YY-N~Z`Gs{e zswWs^OR*FbYme22;W=?r-yN)w09g=!fGV74xi>|Zvxj+x5SX}uJ&~Kb(fk#n@_2mj zf4H?CqVDI_Ref_Loa|D!$9;aUw}B`%S7EKU>`~;`VW4M}c2^|ccN9)JzMPoJq)OI8_9s>H*$uAja+`u$!IlIH}Ca>QAc)lDRM8Cy{llL&0t?g<2@)VFX z+srn3JC`z*cV@cb6^d=L<2#(xUZqCFybwK11&cWJWZ$<2^cYL~<-Vneo8z1k3R5_n zh1S#>1ikR@7@kKq`p3lZtH|B1HyXDza%sUGt4~o~jv+&t89O_m5=)itF3+zto2`o6qC6`q z1ujJO_VU5$b-ywbzmBDvW^gvd*vWCUP7uMT?csCfMbQ@U=#Op7HMw&!GS2tH8+&Oc z3s?b^_G@|3lCb>=@?P$2;L*=7VHeyaIeW%=IQ=#s=Qd&DOWe;dA2y$PYcOR_UE_EF zO#(u)n*a_Dp8p&V0ROaZ{=aoR0Q_kZcHwvcO+Ef!IUYdI{*!3^|HJWsmldKhhgKL$ z@Un7{|B-M@@IdzbPirp0!42MmD#OXyAX^;d(1bNQn*<2F>whK&S3M2@VCf$R@Xt8X zRse7jFbCj5lMVpe2XFwOo&gXII{;h+$pN^~7!TZ6pzybNs^O{KTHrR)P z190In005KW06^iKj|aa0;Pd~};l_VU%zpe+a*#?hyj{h7V*bxJa_b+^4 z%{}C%{NV?#E(RZeu?_KP0RDv!Eb8NcfB+wVJ|4ug0r=Pb09WsW`TgfX00392aR4qn z3IJe@1sMOu_~6=FF#i8M007|HP4M{_e85z|=U;4t?JB_YcX2+re-rqAU(63!&jddH zf-m^_0^h%j{orzB@b(3N@TI`#|2013_`f_ZARY)ns7D3#{z0w}^*}hEKk%i%`!D!{ zseyY`236K z1q=;5e;5299umL{PYuY+0DS%hU+_?1J{QM>ry6{{^YPF5f>nCp`+aeJ@S))S7yQ6F z0r38d@xY2n@cq5O2c`nve=#56M;naiVn6uN0ngXP_+Z-s@csV_4`jRxPYTGb0*`-w zJ@kJ)BA|cue_mdHJR*R9-Zro%Du)7tz`YQOKwngsDF9%#=nD$$5{2`3>lF&HD&Yj2 z1G_}wT9F6Q5oCCW=;ru0fg#xVh>jRtvyF}qyEieF9 zwZKqdmnd9oyaV{NYJ<54=^WT43jbJ#{rO#hEX-h1=K=+GiNg7U4)TBhR1d6hT-bb&t`Uhqzbvj$fK{~-;2O0N^ke7> z1z4>r2V7HC4*h<+LIGC2g8=8iAaE~Ms?bl)%M^gHs(*w6yF}sImnsleU#d`G|5AW{ z*k7In0IcdmS3ERNtOZ6I2IW&B7Wfox7cn5He@eVZNbA87RoHxxuIaK4jS*j_0EAVGNGPyN57Mf)imE>SqocU++WtA=cVYYf?-DVi%3U^O@oN$XwK#Y3}7 zS17=$*C-?tdWFJyBJ2tUSQXL&t`pLp=kBgjfYqP2Ys^NV>BcJ*VD;M>aE*5mG(&oY z0<3ya1I~d#;Qk%KfFvO=QvjaZ+rnZ%@*LQ|6rg$N%M>6b1hBcxyT+*lnmWHs0SK#! zDk!jjX91e+zd`|46IH-#5>?Owg)0=mwJ9+9AOX*T{W}ZLnu^O5AmtMcxz^dab;2OtQ zXsPKH3b1O(2DrwM4O$(0l>)4;RIjm=hZgi+rSQMPeppM90M3o#A#nft{6DWjzDxlK ztKZI0VEj$`|uOINgx{SXoB!N(21Xx1!)Y8$|9{jK66GvllV?!GwV@P{R2Sf5B;x8MMMm_cEndZ&2G4HiAk0CDJQW?8l)ic*NHbx$q zF}4)BX8s4jVI`Kvv)#0MW4vgiMxJTbt2D`j| zt)jgl(j9F3?22#B5Oy>>80O{j^rNS-U~?(P<6*m`=T3Z1p9`C6n@KXUQRGX8&+Yp-(5iesp$qgW=q?UEN{;- zKb%HrWs?ve^YKWQ;BZJ1yr+J6illwB#w2qyf<|7!k@6-2KzefA3@qp0Ui@rA*rKtkSNP-=B8r7WzAnyM}2I=>QBnu@Hms;t;nw$ApUI!rFE z3(>d4K&9xGYDzqXT(mkXqO~HapONXA_vTv0?b2WL)a$p8+HR1)%R^m5k)o{evQ?-# zbFpbAakk;mEnTCq$JLD4mx^}#y{E_m$4Fd#98i7ix1ugh@{%ky+S;jpk(rW)%oL}B zt`BRG_q&Y&iN2Hdt+UClK_toE_s5BB4(73hj8A5()y9})&VH-lhoj$`rV?h1A&OH` zsmP+XR6uts`(;rQ{)MLi!9&@9+h~uZm%z$Ow~8G3^{0o(Pa{U<#nG6%(a@5HQ1LBs zUVpPqf2`~>x$*wtEB$1{L?g;GAOg$OjJfdpyk|((Z(Mz8txry;7W|?e1kH0ikZ4xN zeA*2fc7NgE${+_KQg@G|?A%o!!TJ#DndqNo4_im@_#MulwX>Wa6YOrzh-GciIt5bH2sADq!M0Y>Yvywp|TZ zY@){hn!6F?q@s;3-+*!YkOdu-cjTOZrZ>%6xt1|AMl1SDo{>JC17E7KLkyz{*U>V~ zafwW2pMsmXdxuHKw-e5d%TKkTU5p+-h>dNhTsr&12ZB%^mtsN4%ViX)!ht5 zN%HpNHX^CQUD$~F7^v_bH|%F^kct(_f9l&W&SA-`UJ$KO^{AIRwpi;SIH7Ud9EJQD6Z zEhu*NaQsd|TeGZntHeJrHYV6uBaKoaX`*x{Rp+LoAUo5yCkPI-``BocJ3IRugoEGQ z<;+_^66GO`W^~W?%s4#`PQOPo&{s)4KsT`14XeSqRbah-%l2fBXXuqsvh9~*q4?h~ z){TY@Cf)iPyps43nFA!K+kP>ZOG_r)O5rw`tnRtn^y{f4a|MIHL<{v-gq}_kF9%;= zb(3^}2u3emwvI@eL+(O!BKMo+l~>se(iLst+An20sBYxGpD%BS|5+hmBx`|wlIr^r zsgxy{c%B-|wBfhb#=QrI8fFwK4~l-NC^5HAY8lzbO(8ta(`;);Wm{oLu!}b!BTVV0 z{vcbeYA}B%La<2lL*f22MX+nx0Qz^|*>KG_b`O%DwFEsLkB<}GVAWyew?OX29q?uT zdE=#GMS^RKV4!OuhKsNzxfDi7i{z-8>;#l{j`oUg(W_m8aWI0(6;&=ZE#H)|-O z@;vf;e!c`Y8X3lH?>(}UoA#d|M^dkEacu0z?W?zfw@lhxJ*bb(-%C}dUUhYr9Gon!X8KJ zD2{y*RxJpx)yPtecf`Hdq$4S+sA!NDdk3KOjOJkdw{uLd{PJR8E8n{~3%QbfdL-VX z)KA%;3NqhTC7PCx-$n{p?=RDg=rnV;3s%ae^ZjWky(V`O9A3+NvnaU7H2qymD3ufq zIzL)jMdK@^OpA{L?3(6TOF0kVJiCkK(VDR(zo5F^5&VL1%tN=%vDH1<>ach*Z(Szp$#PMoWj{`;o54D)$oYjiz+l6?e^j87FwII{m;Fd$NrT3JWs zYxSdMscXH4!W==HM^u$ih`}78%;W*BvMRg%tL9bPZ1LRn6DV`znT>r^%m}akMN<|r|DL9-c}{l?H65IV zLJ4JA0_6m@9>Q>{R#LASZ;8AfT+0fNOfOX>fsIr&TyeB@#N_K*om<6^z$6EKcxoo^ z_gOIn*kwQQ<-x7V?4qeQy8q3WCkDsh9jRt)>Mc(nv2>?54cc^P%mZ^l7#q0RO|`3dhS!M9=`(5?dWKk*m#|}yHxR{p(%umQQI2x%xMCY zBetW#f;6P@v)wps@1v5d!y^sx@S|1Vy6Eq?3_ z_8VCdT4zPOTS@*X-vm+<7)!Q4MBA;})k>U&1ZIYZ+pgWcdy~*cvRjc4YsuWmY&x%< zUvP5)!Lwgn~NFb6bYyjILm>IKxd$1^`{YQ;5hGWaU z2SqwYPi7GYNTdn3PVcaW-wcs`-q!Hhd=?Lp)x~S1iP0)+o>q{hDO{Hn4$tdD0D2If z)X?r1lj;*e-+=Cb+o>E`k@tO3Z_n#y@cF^r38nu1va&QSuJ~o?H&GKBr?2=Dexc3D zXwqF$Yt3+zTYg4@Zj;j*>~uHEtuSd`VEF?&IG%?Hmt(2vt5cAPNx44{mCQpsdha9< zl<7> z-un<(x7Z~x_04<<>5!5i=wrIcfwMxi)QQI7FWND;fPq;g6G;V^i9{R0Ug?7~h2rr2 z!yf9&dlq(e-|Z!uqC3bnSZ1d0Qc~zWWG694D%2ySBaF(QXuDYTf5=5WEj7yUSvP4) zX!Ffgx))h_6iOVI{OK7*B4b|W)bVW8dm;vr=VGXsooYz^ntUmBBOEwV{`x_t1uRcFt8*h#i32y_8EAq`!ou!KCJ=cO zpp$-xp(eSbM=ap^^aIkEHpja$N$TE*0qrfZuQ|&B2V){h{i&oLzR`O+328<_o)6=w z2(fLVS%p3P8kDtP@{6(z1e%ChS7~u|gqbePKAV$K>XYoLK z?9!_BX_LQKytmZNpaY9=+?o9?;TxKp4R7R+$Ail{rs)M6X^|1_?vy_I>e!7=`i=&X zbU$+``VIZTPNbxm)o<%AzquGWN>_R}s;iouKnp9jsc z?tpX6+*Yx1dq<6ir{$@g`yCdq-Gr{uy1qnQJoS*SjbwY2O^&mfl51R?%cpNQR&Km zKu9<#%*}n~58t!pU&3YN(6`}?RL~)*_%&Tqd&h|o_hhTxfytlVgp>5P8e-pvCe#oN zHJUo?pxcKN(ZSQ7wm?EMYny&I5;(oG&)VRp*mLhAHIPhs`3rkgJ`0t}VM!|~zS~ix zYdKk6+Ak6t<45!+RYD`yhD3IWsLuFkm<(X6V4P!On)#%&Nhxu;;dOp$=CWJKhqGo1 zR{`LlwQV)h3#zuP`Z;YI1&)|JLh}7?`UgB3(dt?b2(daZgVA5DX*s+(#V9CV8o9=y z1o{~bi4SlAdAR;_C;|Q>-GB!Dl%ALxld~y3u{XAMB|pcE-q6?qEdKwK z!@F=OfquM$voZ3ZmTC%+P~L&;x$CE$?5|GQra*b0LK^p{@*xI&Ku2=%*w`fEV^C;sw( z0LMN!fKY#sbH50%wF!9tgVC_5y@WM|8V&%aB`paJeEQbU0`)@n| zIJykx1NC!&_@RKUA~=9he}{8^-~c)p--SN}xRMJz{$JOFjQ^LP3fPJQeEj+SIKO{j z?HYLh#ra@s3h?zVt`9CT1mn3F4_sad=KJ3^5aQBTumA8stZTs6`)eCAKGfd? zIv#`{)NkYb{()<8!P^(l12}>S#&a<~7#eu{zx|LpcJTeWm=AFMA{g&~$3w&sV17{k z|N3u0pW;7%ntycGAXu$~f&zoU{VOSOZ4Wgdtk#M{fnB0-{;s$@3&8U#5g5#OLxEkQ zaBWLOAgqd%p};OtxV8=o2&;8aP+*rSKwbh@A0$|neq1L;yVkq{2&?85P+*s4;o6!& z;GgvgtYuoEz%Eg^R=om*RrLxK*uNB@3!=+^3m{mn*oOl9mjZMRcbNhZR%<_?!2YEG zU3Olk0D{#LUnsCk6wX)5S17=0WhUsF%1r3u{xSt1th!@CfnAz~YYXZ?uv$bS%6hB8t@u18uY903I$j-y91sByEF^uAF5X zwGU4yuzx8)!?c$v0AbZB4hrlNg=;lLKv>lfL4o~C0U8XyJPROLbwPmw`9Z>oVAbpnc%9kZwMH&LST%Bi0)yP~zjAHoNy;m;a4yw>#lMB? zG(_il)vFX>HAQlb7!8^VzCr<31vtQK1US&_^;HV6It$mh=|U6kmnnc?Riq3B27&w6 zpYwT*z-0F!pGYk z2M4NVu8-q!RGe34zjh|Ui%*pwOmmK$>Xpo2FRCm#IX674y!u^CJIK5DWWRM-p*q%)LksdAIFUto%eJ0)RjO*^v)CoNt z{T;lVyJ?G9!j@&|Y{An<;DA-1gTQtf2rA5M2ji_F>^gc_4m7LhAz z#NyT8U?t#~GWPkANqJ&C7)sR}K~t!21HHi(*Q9s=+}@*^eu$${kV9(X-zUrb?x>RL z#~DiOjt|*Noaum*TY6Vqvu*aYOU!{qOzx1$Pta%Y^hBpe1e6|{;Q+a2Ud&XSMI+pB zJfVY!ADVQvcocJmN11L5X8w*i2|Xt2J?V*jb{J;9^uU-{NNDui&jN0$suel@6<3@^ zsdj1}(eAoAG-nUvg#Z+eE{%ukaregS^bT2gGLnSA&8eqy#GCbSJSpHQK>)ceV0AJI{XMf*?gAw=}>w_cd>3< zzwq<#QHcqGAaW_qvjPrtOS+}(<+g4GrrA8;DLW4QoW~(2no|0Xj5w`r z1YY`gcay{KQho&8y~(nnl-bR?Y&uvH8AyS419u5y(8pQn>9+d2tQ>9po)hcxsu7oV>vL@U&qxzUkQIK%)~<>OdK!o&yY zDBCs&CT7MpfA0sXIglF+>T6Ze$2j;-j?8Z4?P_o5FCH&qk@-my8YBn$61=4oGnJCL zdtwf1Y#n$d1uFbHFc|68&+o>OIDH@6LHyn$1W85F(w0}b&)L~@e#tH&YD9|B|xs<3UidteI@dSPBlTtswh>hw#7l$Ri#auQyV9_yyu+c;<~tWamQ-P zRn$o600pCoz5DO=L4DlcX^kG|0~hFso3Yu^zw`9yy*T}yS>jTVY^K1E*V|BU{*dne z#P6oF;a)ZsoAz#3p^=aemgQoCDWzHaUgd=zyIVnpxK$=9*>9LpA4P~8jt4yICY$*b z><)bBzAn2W8}4Q#ac^ljKMPA&xz+9rJ@WaW{xpr~4$)JW8AGwgM)*0$1 zH=cvvO2n4Valxswk`l^*x0K?QUW@3@>fE`=dC^I&a(1iI6%O6}zB+zDta5&R*Pt&G zg_m4$sR1C!N#m=G9bHa4BECX-V96j^?B+=~B}s=xgE=5;E_q42h!L9G04& z;jBI0m7n??Z@$+blxO+;-A~*DLFD@G<62H?o?4VO24Y6L9YltquepWNA2>OV;%VP0 zkpwAJ`LEOZXR5P&Bi(T2+0-d?MiJ`c<6W1kT z6gvB?_odX5Ld=Iiu3J?)0#R}gmjWqDc(fMVZ-bTs_ta|;XHtp259b*=5u~MxI`2L| zl-bs#Wr#?xi^n-w*z@uBJynk6W_kbMDAJkjJ|}CD@6W^mEfP7+m+W)-_vqxp=D+66 z2W{}g_`mn@o&9=W_db5mBWK2MLev`;k)fE@=@0#q;f8WKULgc-;^v1e_6UXw%PYfU z#2M3~E5VDI%Zb3df9V%&Jhd88pxI~b3wtFjx)<8yOyH1(%;PrZw=={6q<3}XOF^Z! z#f?ix(%aNP!X@I4680S*0nov>c%%VCQJGbqaN%d5qJ|^-v?S{=n?-gYzI;gh0b||+ zO8^N4j>IB9&k+eLiug9ZcTaGa9jjP+=gFJ&TFK<)#)>?SqamX&4^TWOIO_&dwCosW z$|;`NGKXZ~>ONJF7vehWyQA5@pUoD*J#Ti)Vt)By&qw+=Dh-=wJ;D$1$n}e8`NQwE zz?;Zn-YmPnk%y#>zs|0OCnoHKjHyI9UwCW-$P;T-wWJEiKXILsL=~h+z!2MU5QdZV zHf%#AZ|Sb`K|mVacE&{dns$Tt-sdso-$tdVJNJo^z9nlgZL1wcl|((n_W3v#i9bRb z`OeUu){_sF-FaD9K&Wf_o$P0x0JkS)L_ZvP<=WR=pRStUn;eLFD(r(x0}w?L5=2G7 zo^tqtuNPGw(~e0fti|xbVU>2cr;r>@b)@)c>!&CFnAR3Gw$H-Np&z7%%Ii$n-yZN_ z9J&PE6YQ#*aQhtK;(g}@d;g9+-i~(R1YG_cDyM}^Bv~E0OLe4AYj4hIs8VHSGV<^0 zxO+<)TFN|bhs#(^`C#n~YF0y1*w@C5d$*|IQj(ugG*(mtQK?45+zB*f49IwcpYXQa z^GzeVqwL#!E1bO_p+}$YQ6`(`CkK6`r0g=)&z~P}ZXOnAud}TuJy`BB!&+rED*bta zOeBJ3uSZ$(nx-;j$$?Y?j{Kfmso(5xY&LG%FCTG??DM8*op5pHJd{yzjp(enyEpi! zogRHBifO41)BX7(-Jy*yj@-X4VVfeKPdWar%*Kn=AI5G5O~yo9Z;I>pjSqbie>_qr zZqT33b4&VR!VnpBWua zTtY*1zerL8r4}+xd;Iq^9T`#!k4LE!9PxxmBZZu zD$Czr^whRT9pr@Lf4cAfk;iE4f$WoV#nI~Kr>0RPC7AaGj||_p;q@HxEj6vd#W?<8 zH2Q5k8H)>m>v4Fz+S=5hU`J6`_u;!Fqmv3o%7+uwnf)gu&+<<2Ls7dmui) z{P|FkN0UQX-;}N4OVxq($AYfB?G)p0H@dg+(ArT?j=S|yyX}K~8SDFXLTg3Kc;&Kh zzoyEGo9)Yyh2ON! zql3jm`EUDi&2J6r^iPj-o9N5o>`?~2G3-0AKCI#+}EtgPEj=f)gF?NE=a=*)yuHaNF}xuwi2hNxq@Q7c)zkOnR_6 zu~{lSABywXH_B8IkGR)=^KrU^s_@C8wsaHeXd8=iybFK8&AArA#B4<$Bvo>k&=i;c z3<0#xA^mTy`hIr+Xw5el{kGo9)@-X;JPfPwbTq}XGak@tC$7#xPq1B|yv>guI2O59 zo2d3q;e!VKXQTl;No~q``XXie4#;Nr!^y_fImpGyy+V$17iN#!*h*ImiW8(?Dq=JsBx4(jwJx%%k#uEQD6#gF z)&0PcGm4UTkaS$lhP4k%k0r?Al8WsiDM(?RAwM0IjI7XN#~YsXV2 zrhC;Ce7DOeh|>sI6?c}{T$ySanliIhRm9p7xwX5B8{^TuO;ib!vq1LM+9g_gML$ca z+ePaOLPly3L@90`#cG}uQ4b!A#ZRY&#!uTIuN98x_P@!EZQ4^_Emm32#Cagi(3En8sm-1GQY^&&QGsIQMRt9%3%|j_4Toz z#?-1K-%i$V06oMr$sWy2;+2VEJ=ipF&3$yTVf4)7;Fuewqj%dpbICkWzL}Fo!^eMp zB_Mr;U3N)nD?qluT_V%;(UT(|(;?RhF66)rnhm9`4LDbpb zSJ>5Qy=W{ve5%{ErV*rRnU==$lq1t<^H|`kkL~oG4?~TQTUu@=r-ddYY#-qCuzE}9IDAufp)&BdxEH0?XIR-7 z)k&Q3%qxIkwfb9?vu}gcS_lg{F5N95imtFQ1H7R2BjG~DgUJMC5iH-NQOX^9p0j1G zoJN8c_0I7^hMZRtK)J(xD#0Gyn_XD=V|OE$Mx-8%yl%&Li}OoZ#>sf$);K#bHtbs$ zV}ZkI@v5c}pff#|l=t&U1Jk*;`#yE4tw3FN{E?-N$jEz+Tsp?C^42hswcBV$Wx0fH z4zcen5K8NxCGgoa*=lH&wY15Ko|ab17L6TnQfNBWJlHOEx=mq2^AZi)g{m~eQ)3lL za(1xEAfKe|KK&cZiETl?4%ftJbpK-9$q+C52ei+HPo8N6r0nYUB!}7R6ef|Vc@n;8 zR`>7&8zY2crKlB3eR&h3`-8!lEz5MeGb4!X%&BNsIkd_%GuA`-yR5}@7jhGQ|A|h; z&2)#~8__HJe~;eoz}Rw*w^9PFybO zn`@dfM$+u;FVZEc6sFlMGml2m7)5O(BtTf|#nr8>_PTnW|pR2@hLPOW1R@IP0`Ns5k5{~xnzFShm{D6j! ztdne`Mw*Y$$L7uGRM_zU|o=4+N=kt11U&tB(P991W0BztRKL<5t36eeM2*c8epeRm}2n4%1n`C{N~+o6KtG zIPPeg=P+##sr6&m47)ou$L$I8b!kl6?p!s8pqmbMy5?4?+%FNQ1po;*mhlWt?c27|S*a(ursx-TaBuyJsth@{W*w;_nB<)&at)C2 z@{f@${n6@CU(1KZgx`bgE=4HUxIajDhGL-B%XE$U4;np!#F@CkioE}nc%bv9(0`(3 z|F`Nt(4S5)7wSLIpB6p;XZ0WS>_69p9rYhOL^Ak4&D8(9-VdUF}*K^OhHA<|3m@#kYh^jwfeX5iy5wjuqJK^J;BNP3O~^tYZ5a{PIxv-5u4kiKo; z^Z(PMLAr{8uXiyXr2jbRLVpHnsti82<8Am`-emHW{`q^@bxav2bb1zfG+wu zLzE?8e1BaJa{ga>GDv@J5LDj>9S?%ia^&?S17=0=@;ml(l6*T z@CpT36*YsdY3=}Bxn7|FtKDWn|GAo86k0$R+gB*SsslFYnxZ4<_rVnkuv&}?x~3Qv z`bl$z0<4w z`4tMVD%b&Cf;0j zcA3JpzYDM`n*v=Un}TL7t~^MvYB>VB#&QIjXt_!OMx`R4bK}8F57ML3I<2X=|Vwe2ZEf2?g`P91*^>>mo?fc>9dMt?~~!2kQdROA0yDl!p6 zU1JxxdBiY|Q@>YM@5yyGa7mK#2px$CEYcUpH-D9J;t!d!L$XF9QLFMRafGD734F zFzocS?Y!SM^YwX;;+JT83CZU&9y%*9%Iw@2CY$kpj5|;*KjBnz(mc1mI$OH;c*3zn zx7i%k-TBU8%G~=-g9}kb-bk%>fz6?L-C>QY9WzT@NCShPAlF85;cxQ;WQgD2*C+ zGu`;~bw~0Dplf#^x#>NsR%b&PTsEP+z#u$NS$0_GKS~hZ{k@=D09`V)B_=3FW6$dC zi#^PBf!FP#?4Cl;NOrJ6?K-=M~aB%ZWi%} zY6sM>X4-x3<>n5U?2FzNDI?>+T(6lHN61oBTGHuPEjHyF!koe{OSjsPruhlr-5qsG z%Q@Yu{E=(&QcHy7>F|7OQ0Ti^x%p*P=4ris&}&rX&QNUuwmYjo*M{zekwiqf4%W3< ziSvJhZw4A!%?|a2)M(2CK@Ltsz!Tp@kL?M?8 zwh(+}<~RE7TS29vV%7+@0QwP`*U7|#Hrlaw_fzR6Gcg4wZXpT^eYtrn;fPvF=e?)- z1_{k?7kRamWp%A&Yxgq!QHeKQpl@Vtj-#L9h0s#i$L^ic9wce2jBf?rJ+V}>wJkR{ z#c>oknMhdF?E6{4z{J#UW%tN;t!&_|4-wwa9^`jCG)G$QY9ZFNKKv z0O*Hwmae}*%z|}FrZ*G)6G=y>6LX>+`Al31^VAZ{rHX`<^Qa8tHc7i>3k$OeVpHW4 z78lvx8eO?iu|&*QXvDi6DTvJp2F9Q7`#v79i14QC(iSIsCAr;mWR);fGRxg^V~Bb^ zGOEy`J0H&c0bR!K@q`Y(mAues_*86hUD~XPgjCW5l!n8^3udW11wssY|oO3n0n<(k~|JSm684Q|(27 zk>fgh42gR8=4|W9Nu|8J<@_*L7Wbnpp~`IjAFB721!01N*0P+ICvbn5KC#3(wPVX`aX4$_iaD`n|`fP)+x|YFUb1!l6i!7(TCl*fvlTs;V%NQeW?%B4}B;^(YW8&fFb`n2h?qSldW7E<4KuAt`Y zEC;^i4|y`HC^SX><86w#d>DQ8t1nV&;v#VpD@^yhy&%V@sFAT|d9lt$6Ry&4=ZYfnXljyTKsNR5HBSoU@Sh?nTVyC)OT)7AK$KA_R_;`B@pWMq z&G6m*g|qq}?gsMa)oRit7M73Q#OPSo@j`fbqgkpB$?eRX)3?5l*1nX zd24IDkPc^sT4hM1X0YmQ4_S3_+fDmB1^I{*O+fkCx*)tCOI+sVtnRfF(FC$ZYMoMJ zqD|%1RIffnKb>Cq!Y{@mu%?QVc<+9#@X73=%AHjYhTQVrMA2yp6g$a=&Zu4mG{hrw zB@4fUCpQhf{BF{a)*p5bKjj}f}QMJRWp{Ka_4b2m_H zD~WlF@ep|?H$bp*$$5Zns4QAR_s~P8*)$Lo{A6F%=H0HWbb%&$=1#u~w`@sL#kh^7 z=X}A_cf``F=2>a4HyE3QoA9TKVoIfUc_Mr;x=x;R>xnf55{;d6F?TO>QiP;+eoIEB_7S^J^q<>$C-PYu>>H zlpB81c5doHAvJ zDJaDby**^!9={Kn?V<*p;YO;D)YlE)t# zDeRF@8Qa69dQ#W&p1B=&#h7p{gtD&&36rrTJbh@m*&jh_bCCXS)v#5jPZJ`1`&(`t zGyNgzI-1|SGybway+)rC-iK4bhyOix+L`&2QXo9l693^?vP$ny1!6^qvaP^AL*HSg z=XW3G;=h{v^x)H2gSee^4si~Bs4Sm71>4liI@Q!PkWi}{&7Q&+jzcFqpL^(SXwr1W zQA8w^X3bT$#<}RJf;B?k#@?p~^1EZFVabe#(xY}S8zyd+*VAPz8+nJx-bN$b&O})p zHbM3*)*$}AX(&kB3fQbk`6ZXZq4i$ag7zy};?{Q9VHBt8^H?#j(#VWeEy9v}o>dv) zMu-)GS`nC!Na3n+>pioZNDyfeSI3DxLlTCp(YB@bS7o1%sRP1Rq@YGf5tTNtxB&+`2KhXwgj{zlbGLo7?FA}fe%Zp zN5$?I>H8?wyb&!-r=ceNm@#durLg9HLl5QS%QvOb!0L(D=mp9K5*>v*0~IVN8*FMX zVqUN`#LMKa(Q-HSh}~)Bx=|-8&lrqK9pi+WB?lT6)qO;jqAJiN^OUP0-ssENNNQYH z(MMOdFO5$no((cT{V3xrHS~U!)Oa&^$njIo6K$M>+3W>&k0{Us5MFHHV~zamucHcY z)BTQ__@BuEiBv^~Md}}9EKsjC(x)Cu2%R3m=dgv(IyglsA7di}%O=Ki)pkEm^XpqK zp`LuviR&}+={9a~$Hlgr`3Z)@q7C0FTTLyVS8Ag3eA$KzvTzM_U}F#@Hm+ z(*|n)3Zs5hXYtsXtwJoTBp{_4yZEC%r)O~tlN+{)`Yw%mXq$MX3eUY_NVSY@l(WmV z%A2>BiZwK_*Ed?&`R0w>C$kgvKMc<|sNhNnr(=1}7nVgfd(1P_-=Jx3eSYxy4O)Z; z(0oN3lXAj>RyIN0oSGpzl``gt;jMua{_#R)_5yn2Yr6O)H7WJ5166j^8-e(m0nN(a z%MH#xyi{Bczdn2-8=h8;W@e4Pp)KJT91d35`{_LN_5)NZl! zr!UbyWj`I?rv5Q06*^R$w196=shvWyiGyU#rjBUe#LR0wvA~#aQkitf)=Yfs6fulv zRhHlSy$h;r00lya+E;2rH~U0-N!7-e4r8x_cR#n?RTy#?2o3tlnZh3*L}dPH?s=9k z@?KF+fC<~;@uzR|b7xy;?oL#E(E~KXHY==)`NJX0joJSXbAK6@Rr9?8!*q9dqte$! zBOQV?0@B^xf*=S8NSA;h-JpbkpoDa%q#z*@0@B^_Zsb-}c;4UtIgaN8-`MPH&tB)O znb~XBtaB}-CK3hutvauf2jDU!yHB5Mo90Sov^8t}YMXq^Fx_A5<;AWff0qE6bmEKi zxhqvcGw3O!5N5xX`{c~6;_yBrB*E_>NSg|V&6saMC3&+|n~5|EMg|#q6?{vNN;ec= zELPYSKHFt)O;-p0c8;v?KoR2YQQX&X$nk?Z?8b0v`$plAjPcu2uptgyO(*F@iD--iB9;2xGZLQYiR0+SI2OzPx9f@oz+hWxmvHZw=>Jf zCT@9ECMUy%)tO7PLJmq)FbGwALlWY7M3w5i9tA<)rw@ta@2@?@%vFz#AO#V#5CO4R zX*d5cuyayUp*>IVc5+E|0L&xsjG|BXD}K@L0@GY1wj&BU^!CX5Azwn!o&Hh3_#%=g z`X6X#O72bhe_)x^O0aW%n0|^}9qr(eUD%NJV~#Amfa`OD%zYt#bpdPQZK6z z=NYLF>-B?A96h|0bX0Sd31h}lmha@7AlrwCR4?8mz>dOG*#G98vYZxzw?_G~Tpisn z6FK)g9V@soEb_5MdA#|E@)pkm5^+oe%JH2M9Re~M?o-ua9V0}L3%T0AQ@0Ne z6oQNJtCTjPR-OREMi#Cx67n0JJYO+zkb(W&`=Ca(>Vbl)d!{~NdE&!mS*9!(%|Kn$ zJL}%znFef1^8C-ro|Zhw4=}aN5pN6pArL@RmcU-< zUh~uirrCTKO+z|~>Wis#ZJ1uOu*7Pr(Gq&!U0x*Z&E8jVD)hAZVyo`8McwP4Al9r3 zhLha2ldBY25pStxSA3C^)+!2YZ}w4<*bAxH3PArf8DqB^W$2n4tSgj2x2hd%{bnjp z39szLvn?s%#MJ$*s50MXhyEw`P-|@O;#3JQIQ;#W2sJZZG3IHpQW}91R?C>f$)lf= zhm4-2$Kt%p41^_XjWY9Mdl8deSbcXI{n?Qu=Z8ShBpL>3Y}_oXkUwgQT?9 zyWG4|mZN@lS_wg+r3%Cj1HHI!P+*!=o<96sfckX!!)6{-?RzNgC-@(O)4$xS?svcy z#c1s64lB_z|4>Qw&^T=qQVbDTS?Aq)Ot6%TzNmikv?UI3vgNXBX@3z8?vv^?Zl0BB zG0UPANvA&B$cq-I4bHN@?YS^kR}a;B?DcVi%d9zk;M7WA&O6~524;mqVaTWX8jqv$ z#a@+k*iz0-OZru&qG};t!PTPyXRjs*w zz^<)Ml(B1$U0Kp3cX;G3nsvtqw}n^1zn~0ktRIJ!C-ovtopaQ~Y<|NVb>79M>14y^ zi`kL9iXH=jqTMG6`NqzkcY{v|jcz4<xJ~>BX-V z;h%@Rx)+dskE>Lq1J7^%4Ns#R_Vit1-Yk8rCqAnsd~d%Q%8B}|^o|eqL6bjWkkWdm z@WZ|%&#<*`3&q#lFF&E;mFs>0Y1@7-O>`i0i`J4#@Z(bMFLl%k7U}wy>Z~)7-F5Cm z2X~JdD>a4Jp~K}X>{qQ<aYh`x0Cv4QROX+e}IQuY8hDSy0nqGdJ#G3hd&O%cuMLvkY+ga@vZv zK1SD(ST4#UX=*BeaIeBI&8Nx+nIu7qw&K1TRvMCLbTsg_~)NRq_rsbED<*ABQTRr$GiM|X+;^m#uR1< z;IrYA&^GK-?zayU8}=x=@u$dHIo(d9#1Pr_j&Fqze<2jSNm_H{HD`^nS&;fXUJ=x< zAw1WH`NY*b!=1~ouP*)B?GHjN@ozFey&5hJfyGUM&$ZFk7Zw{RkO{(c7XQxfs@-lR z&3-bc+sLv7zDmye&tH4)+2vs8VgE(W0{(r@Ao=BD|38wmfT!4jr+|2u-{dUdU;m|` z{-5Nm|DOK!&YMHdVh6}s7lfKCrP;uj#I3&zwE;EU*nr1=9nXn_S7c3rtb;F`2 zZ(w0;=!A6cI+wIQuYbl0{#9!pxCTf=tl&%1);a%*75oPY2{@W!1znJ`ev*hdK}f8i zOVZFe{|I>gH|gg*3>3KjO(HrkUBwE%eEvM@8@PW-8sg#v+Pfrmoo9+-1^+>M0#3St z`@h>i&u_{KzAQp_ewYumcS&O6IG69D2-*eSb9pX`!2P@iNJ#+xOA-?h;m->CgY*UP z(}3S!zK@gj9Pe*D=M|J#L4V2z-~s)C2jDOP*O&4DUC9digJi}7;00e4ExVBCyg&XR znE@v_!2Qej0}=7SaQ)rhdHOY=KYz;uLad{0S(gVil<@-SF=lcDP|D09|^vC7<0Foo{ z``_)K7aaiJ_xtzfN!Ee>zr4@I1K|B*z5*mb;Q8P0KQCqjjE~FqfmZ|XyOam$O5pl; zdq6b+K)yf54=@#g{`~#?dA&lQ|1RYLx(bl*_xsLscLVq@+XDmgf&Z8VdR z0ssB)LwCatYX1}LT-@JLk-$QHu81oTZYUiO5cfQq;vWbp4Og{rVPRZ>a6`kWfCcD0%In5I{GS6bXF) zudYZJdy;=40A<608FCZ93s*zU0a(`=7@!*(Y7U5d&5HDMCv-&%H?(jwU^rg)T{t&( zuRyq=`S5}1d=8r0dzyDsldMOx`A}vq6)sDnb?7?>eWT{!o77x3%@*yH*Mnyx*G5gcsQ=p z0_diGoi7AC@9{ruq@Pa2D_XdzW*+D|Gw-M0^D2b%S#twzB+zxAwx6!2D-dod-yiTq zU7gMs-sOKGfNyAp4!}mb`dzqih+lzlL;3!Izw+vq=fa171;VdmtDCl{f`1BjF76*I z(zV7m=%yOm7lQo_;o_v^iWY7tH5IUtt}*kjs{jrdg#R6O-nfDEQ?S3aaB&{>uNFWz zlq?TyJg=M1*Sf-f7M;I=pEmGM!T!<0&r`oETDYkYK-WR|dC+tf!uc2E25JEWWI+Ab zr+RU=dIiD_%}fOt)>r4k#c}Wz2sbqKC14|6T~selu&+Y6p^GZ$8Uy3v(ESR8n|js; zy6&v)XPm&l5WqLpk8~l}xwwDWNY`cW1ZK@mU6HP4@BA+s zu4v(=4kYk31L-1u>t6_g`2vlg0ERrF9NQwK)9(M4DdA`jEflYD-dq#q6)rlQT-W~eFeg= z8cR3L%me=v>|ET->3k81e+9x#4QvBn7ua@P#zNpE;)bqB7lQq*g$usJzghs@(A?U< zYJc_6_JX2u1;P!jd;vJPt}!sK%b^NzH_pM{z_0U#V1Ey!3nI+FS^(eFNSF)3{)TYD z-T4;+=%$|jUkLU$gbTXSzYxGT^|(m=NDw# zD-dpK*g5E$u=5Lk@V^kiH#G+1La=`Z(zSbM&`sStUkLUOgr6+zD_XdzRU^Sa1^WlW zPvZE$5I{FI`2Rw%e;{1TcLv?iDlouy^6C-E1wH>?Er5TegSl~jq~F=hFa1at83q1@ z0J^E?3m1a@J&-PvAp8pfd{d7LF9iD=!bRSOe<6TwXtsaAgucd)bX_eT;7IGH8r#J5Hw`PnJ|(65(hp4SJbhx@^G*!*QI;7yDGc& z3@$6d{&RO@-rU%n?AC$xfQ!f5!|y3`yT%#HT)a84f*((xwtV6lRv#O$sd3*mS~wKv z_%O+}0vc!kAUOSL8lHR-YxI!X>GRyu0)5q~UC-@l)s7 zlM1^Tx4qqLR~X|~&rIaKavT(eDXNU2QF26v=NwIYda$jj!>U~P1XGRzt5tSlS*;XN z!-l%$Mn}6xL|7JannYf)#lpgz%6V_{OcRbQyN3w&h;H4Vc3b0d-GDdCS%m(4MZ&UC za1jGV=aD8RhWk?VqopNM+;wn^VbThmSWf>$9%225$6k@H;?Y+A2D*YS@dmmE9LaVl z%`Kv}wWSQOYipjU`&r*|y9T>YV8WAlzC)2W?tc0Tu@2=OlWkmnj-D1N*)KC|d_Kwo;B24NFXkb0-2O!Rjea!b9&a89AeBAZ@%JSUyx z=qrNH$~q7GY*tCAW>QPN>jcs~PPtMRxA<76oYAHYQn5O=wDJlFUCmtDB zJbZ%vo_vvXjSizgX`(aXK&X|O*mO5#QY(PMio4!D)#YP0MbXf#aSH;k3SS}G5cKG~ znY0G{%9@0TZ5(y@vk;m%{ykCxW<+i(^0bdMC2@72XFMM2ysvsJg7PBGSp?f@bhOo(5UgduZCph-^`4^tO=L+_ zj@TzoG%isDzQ=ByYUGfwq+Jpz_ycUqW}onjbw2x`YQ!R}&2u}ot5-HNW%-j&hJ60@7s5{^P^yxDUXFqXwhm5PaufuP<#p7VRtGNTolmieF9T+`&|(> z%j-kTW)`r?VkCW!&5ja{(AbTHvtKnX-)4a$yHpdZQmiZFM2i+YTVT-=Ax zCni#Cdo;X8VM(bu)3$@YuIA2oK*VCco+F}KB*Wx+HaRibsmFFG1PAN)_~7VCk#u?f zJrrj)tWhYUn5W)9a9eC1JlrJ$5;W_ywT|t<8@?6hxC0mZwJQ*}JgsJsgSlz+wPTn_ z@Sas5@zIPB91(w;9H3I}P#P2|P z9n52S2}XrNgc-4GkqGBRLkTw2ep7h0H z+SdVm;VL4cF02tbuur&V8J$6+e9Hb=|d$Vh`3+3d)HnmXQ(vkwv2iJf$NKQbCpeiOnZaeuQUG58rRrWY~4w$wDd zHvpI2z$7%jGnsV$#{os&umK1%)-ziNT?I2N{|7He#);x*mI3qFmtgEdNuRu1SRqJ3 zcSt|SS8{{&@gULTX$6so-fX#td~?Z=_=H$2xBI)l{bjdd(ulO?qi^in7$j! zRk{>92%BN>S&{241flNYi-Dk)V})*G2=0fDAxE)?bh`LOpBVj~tcIgjL#3gK3C zc=Ke-5R)`%?&O49vTvrCw-r&xofZ0ywjL4jrb3A<$)dmZJu}9HWdq%5RF-dFY)MNZ z3`lOSQ$_O;e*6{VvzDXzkfgI0U)caN`nM>AM(h4?8C<5F3A4B=skmIE=+`0X&l28$ zGYL<&`a#i`LqWWBn7;$_`LV`8n@mItB~OA?Q^dDT=(s)P<;}eS4xDWsZY}VrC)=qc z&e&<4EsLGPPJoSL_}&Hx!>Lucv`a2D)J<|`T9V5v=9ylv@i1#1!kLtQW?JsP?1q}- zilbRRRZ}WjoSRr2jxl1zrk$v|vV9N{hB^eygD|IXTRM@!ab!G;`J`lO4oYcH?SU2* z&^~4!CvCBwTxai8f4Y0BcdS+y9Zm99zElMM8}c4PuOuXYqZ%5eD#ZZyGKI0;ez95* z8*!@}yQh}!3xuIg(a^$D5e;@lN}b0I+NK_uT}aOeQK;x@@E|77lxbs|k?QYHeBeX* z8i7?B9G>NJO8Z^1xTUw1=M93=w{K4G`9KbOxXap~v$_J}meZ7MxA0KazR;s4`aRD< z0|kEAQ1yRQpsrN<2}?53FtmQOS8pDb7ZY>jHZxZ+f?;F%$H(RrPxA#{k19Ejl)pk4 z`}|{|L9usvgeH3XRWN5oo+cw{9oVWa(7n9!EtPw*2%GRWuKPfX3*l4h7Rg!HJG)f2 zo_zCT#s&?JXv|u>2O4t6wA?Qw8iE3OTg30Dv@2C76^w~&(h+QX*^j`|lPmGJtD0%W zzgqm7-d5u+6OAn+tlw_ii}P_)&z=_ZC1^%gj3e!>|4Ivlos2GPOcT5lM%ikl5O(b* z)|_seqZON>Fgp8u+&5b(V5;K`=ME#13NXi=bV0TP0zQdrrwXb0$vIT|A-xz#&AJ4i`t>$-*rdeK@*XPa8@0 zU4bRuYzWir1S__Q^>dK-7dYO->W`Sv%zmNHqm}QTLpizK-CGVrX?t&kQ*vrg=eY&a zgIF5IeyNJXtRKan^Tl|hr+1q+oKRKEHLXb5%MX*lnG8b2*kY4|oWGC&Sw@IH{1&XA zq^DK`49UF5!W)=KEw?7les-&IZjrgx0*;t6aeklDw+LUKw&F%As1G2FsW~Vmyu_X{ zCFCi4UBkPR{5;t`Dzk_GhodqpfpeH#MnAp5hCy>Yj_aqQLrCAOB9U(K53&nVNlHYw zx6zLBmtNI-_}lEuQLi<(yoRlxGsZO>aMIHB(bK7_6M1py5~&-|zW}RW`<9WKYuVMc z5*yNW25!bWSbqp4-V<_!iLt>sx*nw~Cmh_9?)MY|{LW=3YJKd`mxpclj*d-|p)9EIVZ(=r?P-idO?0jJUnU^Mu22(tn}1Hd zZ4Qs`i=evI4)KC{RG0~UiD?sJ7AnCF+xLV+NYJ)uFR!g6`=xxs^8lPF1QSOB^B4hk zq50g#j-gi}<+nBl-(m&eb?= zr|1_oZZm?iqQWO*j1qr~+YSyDkN#?MlBUY+?rItFIyGF)NcL#jR3swG!xGuYtIxb`Lqf*t&F3%pW=)cv2u$1prcq_wu8U%Ha6qj%W${Ng~n-3a(9t; z)Z$$#uEXJ1KsWi(rO6#Qs_yffz>*RCt{B7_$muVe++%`d^h|sbKUx5BY9CvW@tv1I-%;~zNt9^0t3<=8>YKo z-iSJ&aDJ;rxZ6jqQOicF<$4k%O{2EvYpx_W1sTS;FX)bF)@z#M7rzq`ov%95Yi=d# z51Hh~$Xb9P0nT$Z!nnPmUWbUoODw;$PSKzwbhqU8p!q>g0NHWJ+zfg-zAoWp9A!xq z8@okgebW#~?0Na=NC9@FsgoY3Mu-c9c%A5E@n${$`h zh{2pm?R-|!dlaEOq$ie^CH|&tYx;w(7Zh%o@`Fup`3lvz3~FuEK-vPc*S#O+q$y)! zQLOfzawL);X%WF5h-!TKLAk~GGBH_VA15crq>HX6HBL$=2Dfu~olINMAnHjBv;CsN zH2hs!9}bh?of+(=K|0F&9drnH-4UAOXmDt(&G%;6kJS#@RV7}~vQW-P;f*DmeW$*g zY5QYoPB*=hhiE(+NnKh~kiD{VMn4I0WwP3Sh(>U*tYwm^nBT&{YK39e_sNJABD4)R zifCBB-*Uy%uJA6xFKoEhuNR@zIMI|R@Pi5YJ=CiV*aG|T_C9ScG&`2S9&`vau;W2n z9DZhhK$2fSY&nh;v}8bslIjMED=ci2;58KNKFHwurme?ax>kEi9>EcTdQDF53zx*X zuZ11>^LI{e@XrLYzg#dE4paqwQ)3Di1$_r&8z%}N@7aGTTNRBRZ67%p8ao1MP=7_S zUgqS!aD)J-y#G5V_r=q{-g#|KZfzj*wJq@WbEk?pH<0G~mrqEX3%K}|gjSsAJOTDk z@qjGaoacA`i)8~Yz!d)lwgIWJ|IEGmJKFefhs}R^TmP5CCQD1x_WOIxr-HR2=tmS8 zfem^0cZ!?g%z_~#hlMm@JVvY%TMAqz5_hsCpL*2xDMX7!`j^T><%jQWnsX1^n%p@X z^cXl9L_8Lh8mf?dG+(u9JK?{I{vj#4(WoH)%;|t{ibaE$U|^zVt!BR;Jw0k-1%2W} z&ew6Ll+HqO_kFj4lXq1oj(dmieQC3ZOOso0Hktyo&knN(w9od4`Ka7aElCH1gyj_B zdX=b5hR-&#*|g7c2)Dc8h*G#VgM<<2=FTd|T+|<`1>WYV_UtdelSw`y>vCj!2mOq1 zp$=6_qwx?W<%C^kfU&UOhgdxi0`CDLahc7m&mx+dVuJ9SK4(M3r5%_W6GK_fgY66kb2yP`8$4|{SL))*HHDo?c z<&emtar~pTSxOUm)+?X*H~=DE9?$!(YkI));gdV?Y0ydyGbueOb8C7wFhc_;hJ)m1 zF&*!s6@Az_`53@b=!SK}ooR*9#1UL!FQ{A+4^u49G?s+Lk!^Z-Oq0WswS~A<|d6)7!%HNux{%El$D3k1tk@~Qafi;_(5m)1rLBOk5p(JPG^Bsn8c+`(VYe1$w7cS8@n#}x`;ovI> zt$e+f1$_sBx5dfG-~6-;QthU;=BWJExLYQeBiY5mHyj|6Pz!N7MeUwT+{qyuHz9&w z5hD`ld$DFKcYj5==Q+i+QGOZ-TF_;n6my9-AGygYwMAG>&WdoA$&yKZ@EIl`iA$WSUYxJ-XR)yPf>G>WFpnLCtSh6 zvcXv%+d&dlS~K3-j#wQX7vbnUV)MiJa4%d?w5RedonOmHR4v|4F`Zv5fvX=EU3kfK z-vSf5)G_3!-b->Rd@MKE2gtmS@4-0b_}pi^!=x=k<7QKGOs^P%T&T=%StKJ}3dICo z7{f=T5(*i5g7!IS$x2ea5nR8wGk$+IT+*hA`HRAWkdA~D%)L7%Z@LP6ri2+8UV@}3 zsKfKf!rq4(TLp6rL`kb-B78P-CM6HPSiv~~mE1kKGqn5P#0FiKq zclQY!saflV#zogeW=Iwfza;I6r8leM?69c3MK==E^7tNOW{*qDzYz9}*MH!4p-9D< zfk9g4n^LXs0q~||5KCva0(9uItC9PhyX`|*#>W&p2py$Cz7KAN5i8^kin*OzwDVFXfV415`6GZrOxR*`V0 z5JW{2)C^U^RC(xP5E#Jn0uRN`4UN|nb_!Od#rZ7 zjh$$2*J?4MZ5oV6W&4<5%}$5UU_Gz4bjx1SVvu`Qu`>p17f&8!fL()KBvHvnVY_7t zBM3C=m&gNhWO|yzgal(I3@Td{wAO@O+}d?W^E&Zy6M>pYI6>Ubq?Oygr%VA4`StHp zQ;Br-QD)fqFZ0YuFP1@nI5sbl>?XNE?GDb zhWA1F;SauByEZ!^k9$*JS7jHf$f=pDRmF$sf2)f->zNnr#LW{|nOT=Hj^t)TO8>zz z{2jSKa0A*9JU$9tguo^u3$y$dE?k5J^F_d_rz#IL6E35PAtuGcTWrw|^bd*NakxMT zxiI=nR*&v$%Y`Cs(TBFsVN$;JQ^JEBQqWyy#lWu|}csMpogxdqFVn7o1y#vtsO zm&X)T@?4|_)eCm_VXQBYV{FD$C@m^zQD>76z6jX8dshE7s`+~~EEgt9d6(0gs@xF! z-JH<(n9dL9F(2O>H;PS+KpN2F(hn%Y#~Rp(gQ28Z$$o$f?40Cv$v_%jMG7b$E}wLZ z&~nzES%{$8AON)(^%JG*d!QZ!kQr(((sH@xK*l%^p!rmPH!_d3PQV>_{0X6pWfv4| z6+O`S;{ka<^9P1I7#rOW4C9>g8>sJ`k9HRkg@!II z?JX_M+E9Qj#>agwg9>kurM^xQb-l$L&M%0DbL?7E?HaVHUnxZnI`u)u zj%-4dT79Q~d}?Ld%!t>A8Q+dqWR_aFaA)k@H)gzD1T!*e2n=J$fW64~u`qVlSfbiF z)OE$%to#UUsAP45gSX|R^w^%S?nBvq6GN8~U-!~5muL_%Phl3q8;wX@#T7TOX-c<# zFtIUPKVC{(KkD+vHb#e871;l5I12t(aS^Ru1J%TJZ&m1)M<-&UVTrJl&IWv zdvJR3U<1tKove)V?sm~|JvwZ0tnV3X{?_Q|kKh~Jy%4N65)rhWQy&@M+g{t_-TGiO z(`!#D(JMp2>0sIVD3wdAm>~-jAG;WlfYK9k_s#QQW`$U%E$h z5Dh0prH?vsiO87Pwd$&+8mWyBq1GP}wNRu7X!Y9pkv_-6FDj4D*-oE|k*Phvg#56k z@4zEtU>QJ)_`n>v)D1rVBV zN~@@cBYeNRS1VANWuLrL*3uWMhEzzquu zZF2eZObcx0!7{{{#e)eS<1ugLA232WK8`$cU}$sN?ucbCk8EJnZTwpCfSG@pl?|VW z0aGdwa_Y|dn`c2PKeP$owrSjB6gVnTt8Sgmdmae0Sa+YwWV&tWi3wILmz^Ol9vxEi zhroT*;%U+U2mFlO6hOY3q z3fA$c(O8Km6E`i8SO1AOJI}2m1|I%NQk4>>{%0qe`6JjP#)Scx(k5g5&v>Ub!s4_r z_YCjSFKZ|y)#DOmPF35enzJE4#~VQu=AH6O#99vaeR%)9j^3<-h)0g1gjr5^>t~i z)(cCJ3b&biv6rRLzh=GNE+k!E)J9j+Syp$DzVodi25gr9gRFsm*?6tP9;{KF7U-V< z2RJPm;Z!N?);b@iz_~>|o6m<>pvQw4?eUc)LE^MFRWL9UFRn!za+oDJ`L=^`q(|6dJeB|yH>HTtHGL2cIefVX*M|oUbFXY0P-TLZBv_*!a5PXvY>V0#n(%EQlF}(Lk zmmwR^Xl-C~X8%+qfH zV?me{#qBmd(b9}tbA&E;!y&fB?tBcBTyZ^NR})XAt;c%;*21}EpuKUo3KHJYDa}k+ z-U;^mnr?^IJkAC#o8y68O+5nXKc?~=G-tO!twb2xBuCvTOq*)F+>JMMWVCPiF2)~6$*#aBr30wbmY8qbhad@B@ zE*DK=rES0L45H%{l)+>F-3DWONx>Kx=-L2`B;K%qWc(v1o)Ps;)6o)>Zp^YSCWwWh!aB zNQz>UWhWNVnECNGHK{(g>pf0XQJ-E9v=@jjx@%1QRThacSZ?IN@UGWq(d?A5soX1Ws#}VxQy(MsuqAigoT69EJ_R0PVmsaIQ(i# z{rZD~z`WHU+0V=r&!Jqf!U0v*TIKfaJRia8cHpVsKw~uN3g!ujjn?35fgdkDgxkj!1WH9eTOW;CEJKV6S!J{K`$o4kWw!!-?}}F_!Ci30|odvSig`2UX=2Pl4aSu+iA3ISJOieK4U#Q(0Dc3vh8=@*sj4<`}e2l~qu z^s{)+F9^TO@caq_`(Li0&==j(jY1gBYX=Np!4)!lhMWl`4>gq6GafbjY%6b5DCeG? z)wf&4W;g3$A&8EgbU(43^Ws1QZNC3Zxr-)9{w`&ly}=Km6iW;z z0$l64QKz~V)#gR_Dg}4r(nfY<>YMw^q>lO@K4RjROl$Ik%88~} zjlA`nxpz1#Hw$fYt!q} zUR*bbe+RR%^87J||H{X6%@}3{|I+rKj>up2-2NEDze+OwU&ipC+^zqYj>!K9cOy{e z>F+W2=hVC$WB<*w|24)6)U|DKxNtmDbf;R?Uzg9=9z`lf1S!AHW!UgK#1Ofo$%JSn zYJTPsF4(fP;WmwEO=XOq#^Wg1!@s9<#O8WWAPTWI-rj)Zb`J4o{P+v|*JiTpwBTt@enh>OTlpi|PQYVIR<&YkPF6+LSKjI*nV=Q|g$Pr>8 zvFpjVUX-xlOD>)n75!rrhxPQM&%+t{swu?$gYUyN946^*(|M2OU7)>A$0Kih$&z!C zR~2b#ES4AO`xAg!Yxu>RJP+^74M8XUzE(0#)PX; zwYz28woej9A>t|FStvlY88DbLJBccyvhFQOpE>8Py5+Kz+lbCM7}U^P$2|3g!%KT+ ztN}1t*+eVOe|)OAtVt8jRmA{YHiAeJ&k$kR+_v zox6Ijcnh>_vDyWQw@{6RpA)bP49SQyRBWrp#)?p@(3{eJ)@=z2;X6p*<#;EQ_b3;a zD;Nq(q-@$5{%!0lv&ta2LLQuV-+!1aO2XkdZNSQWE|yP2lM8%u$9QdNnQhc|xt+8i zLP0vGIY=$hfI=x{75{$rhWFn?Z>oL z6`==dZ+4vFvh+U}cYZj!71UD1!xCai?`yLUroKm8E?>bzYH};x=Mh#zNNS=yoAY;? ze0QS$r|#^pU(Mh+%`)_jwO9(!S;VnDLUH__ML@=hAoxL9HuguG!dXtK0~6h+ro3l| zp^F`%>GArDAy$RLGb1C|YO4g_qbyq;xAnW;Jq;eHF-~=7*^Im$na6EO<_O~5#!h{& z?3_JWA_gxw!*3NXG_e@d+K!-|LT-!XixH9K9Lu0PYES) z{i8Xv;Ei#m9uZ{ZlMakyX4#1L$-ynum@$Qq>GIqPVd=4nLS6CK&;Jgk&6PgXR4JOX z;zIGfC)A!eEm8K3+pKe0RLwntsvw*Mq5iutMNvrEU^vin)R&TbMMz<##^ZJtF{1ct zcV8YEd`Ut3F6i)%9%VcNEzIdo@PsEVX#yM+TG>EXszR)aX&KHWeM*UmgIi3E@5sm4MPJBBaaCu z8Re)tf#uI>NEK^B&4{0c;wcSA<#txrCK7l_zLcalzfviLep*jcE4(6V@iDl)@Xfc% zcO1}6A(P!mUegMVDG6fFlN8F6D8Nqk9AFdCU|Wl0H&*iC+A_>$WgenwO6lAeFNhow{WN0iNHQr*e?-d?eJ?b?k%$fP z-L`mvY{OVi8HjuS`_sp^#BiT!MOri9k5_Pl>c9x;k6&idC#XN16Zt`PxJ#RKcTA0P zx9lELEqtf{^m|vlD5NF)N@c=gi!Ql7LDH8*AeUypMol!tDZVhdZMSA^GTiq#DpR1Q z>5laKkBlGl@a)33ju3c2HxLSJ<;3A*>pJkfC=ty4mJ3DNzNU=0K{cSa-KY&S?C@e{ z*-bo`-lz#-1LTzxv^jCQtlZb;zEmE3^oT?+ocN>2&|*8fZ)`-Y3lFNXK{-)mIk`Ec z?-&WYm%C<}ewF@Hu*xaHTz{&U%cCmdLyIOM2x|M08mK6G4+8luZ{xF%acmM5^$*pE z9SKejMtu-xMHC9`;l{+*5mESE?|;A#uhy?qPZ}sEr2i&O3xBLG)teUUl3q}PL-4R* zP17=QO;+xi{w@--Xj0GM!CYrenUdn<0XIRsY}>sk-pOZMC+tX82q7#P%F2D;!gU<* zd|*0y_z^kvm^8fFTi=4EcC01W4q=DOu?)3$KjI}?cPv)rT1T6%c4QUx`<>d}Q57Vg z!WhR?_(Uc1o>Q?3qx;LA>KW8oPmkiYmd^QS{@lO>^KkxY>ikNnaDD{&e>ZjhJEHv4 z)HydU{%>cle^Idhx2bbpX!yVPiJ#luzlctMoU;Bj*8d+)S%FGC{~`bLlocodcp>lq zG<&qHZHZekPYZSJg^s9`)b4-%Eqri+ArqFP1S|jM%Hp@wv&pFB8=F z9870t60z&>thT0>yV%}sIqwx8R2+;r?N8E8?B^!zq#tN*^}2fuIav?CW)Bed~Jo4Syg!E+UQ9>sz6=} zWjxp9a~ONb08h?$f;ybc9j#RO(~d{6Tpbu3o-|=6kvnnaYbwV$nD<0%uLo4x!-$ zL9vi=tl^|kv%EwuaD@8)UBOy`LC!mZ^Nr;tQ47SB@j>aaP6h^eb>np5P3b->^1$DH`}>?4V*@rW z!H)t}*?IZODKZeXjz||3%xz% zyw$<_D{RZLGPyM-2fJw;Grh>}@33;}a#}r=+Gul-yQa%&9#++gydIx-KSO7%tRJyW zx3X^ zpuARX0jFDexRb6xMc6GsYz-gLFu6M4q&MUOB0}98QjNuLRUwA9P$sS$Lvkvb9y@4s zuy>L22iGx|!VMc^zRx}Twmhji+(yu)H^#h}B*M^ZySh5J6jVj+#X;lPQuk5440nBL z7z)*F2E*LmgDo}bX~s|j!YQeywdor5m?;(QnC3V_8Wx7pSBY56dD2{%d;NB){ecRG zLdY?xVnj~(`A3P^=wK7}^0he~7za>`XcsxNHLg7Xfo@^TR@?$Ue=$wimnTf?(N40d2&RSL+7 zDRR})VzG^Vw8-{M`Yy~YBEJYkC=(I{Tv-4T8fGw@wjjS%>>kx3b$ZK!y8YzIt)fKx zH!B``&A4vnz1ArP32Cbs$L zy9q zAZ(llLok0;O!2Un-tQ}lAKli;U_cOajJ$8$ht3`G7b=7UW!YWixAs+@8iQ0hUS%8aEH0+!NjE4;%~Zb6P6B=GF20?`%|aJw_VBS&AOQsU=jQ0 zmBr_o8GV>$(^vbVq`uyl{-|S>@);e={(*QEa|IgevH8=zQf~iwAqOJpiJ(^x#GKSp zo+pSnU0hL>1@UZ=l$$bpWd#kd9-qLgIs@W_KbLO=?*MliDmAJ!9{k9!oyo-P`D_uN`~e#Emkb+(V{Q< zaNN^jt5VJ+*emGS{n+}78mI^$xgT#g5)KLnJ7gFRniPE!C#?2Ge^5F|vT(8(C04%c&mazlF8}iZLM6P6{hcMSsn}y zjCW$1qVdW3HOkrNUJbz?vjwV5xXlEiZ+E$npFx$uOQj((736-p6+;#$(id-_ID#42 zs^D4&EBQ{2g%1OK-zcpSj3!y%L{Wm(h2(kQKoLEli1>&*nk2vab}yUtBwIs}V?o-iUKyxhR!={R zvI4l{aGMtVI#p>w4^x1i@J;j!YHw$=SnL+kDVb$49{nhav1gz?0qOU<#s zQThtS7S!^#5P2K35Y2Aw-09_tP|b%tu=KV=4KW10bURgZLY`9S6A0X?#T=N1trmK; z@lG*3RD6LCAj=xqsQOsu8oJ+j_=irtc~|&dR%NyvC3n4&Op#1Q#fmRLG(~zh{UOM~ z*8aZhAjH-^gXqShph&6QM#}Gyp$m;j(8}>p1f)EJuj$b9V81xwuVkTpdgs_bm$L#B zW?Lrv7Nl23A)8tB!eC>Z{Wh~1OV}xyJgWtxxk56_j|sG9w1s;Ll_Oc zj&-m3N;9d96T3_((P&j8p;J=Ev5>&em=DxG+36aPgo-5h;SJ~$*sDfoV=UUh@f?LZ zkrjXvK8ze07iHD>)D7}5eq$?AA`&HI0rldo*;Cla9)wWw(4ck@tionLgJzFTJ%*Dt z&zDT1WEUeGLBx-2jq?#s8YSKwiM!8&x41|O!(^T^zs=w??Z<+%;EQLNVctatCJ4z9 zeoeqfl{uS_7aU7sRqfK=PrCO1W9}`3>RPj{VcdedJHg#8xJz(%cXtRH+}+*X-95Ow zLkRBfAIUlCK7G62>b_O?tLk5ywf0(@XD+Dyj5)@fV-{e@l!#Jfx$_$Q*hCk>wp~@g zbqfn^+R>`CB3=P!r*kH!n;9ssXA@R}ZmOR3LFe~_wccf~e6oykD~7cW(&e>Qj^TFX z@(Ec8Oiu4EAvC(^+*L{=WN!;1>AWiRWxjN(0^gZ&|4JblpiXt9d5ME4#{bAPRxni{ zu0O>Ls9z&L-`60_@KYXP|LqST%<%r^`{AE8xqnH=-Y@;f zqE}j#&w6Ht`VLS(ABUJF`+K1*!@HgIAJP6iX8L*jhiBhElGcA*^*gHHr1iTa!yotl zk+J^y>G-trj(QHRHt!X~zXHXlRW>znFu|wCrxi6cH8y##ApY|mDP4PWC}+T%w%n@VaSjx*K0cVr+M9j) zjnhs9-4hxu&(_xh^*eVnLFXvM-mEEgk9MnZ;9C*1V#sL4P(P&v#+JctvPY8S4F>z3 zfw<7qQ`obRk@dHc`;eRU+lqRUC>fB>~((17gF-9BgR zR5U2i907=Jekq=sWlH888(QG4IjNdZ9yKj{?PAN!3QHz(dkf!zlgGz{2xlsdzfC(d zbBl`w+6E0aXNUV*bGNkzHUgT~MzFskdRhLsU@hZz;1s~KBAy#{xTo(=Z=d4--f&E7 z&4dy#((&c%XD-O0Yl_82Hli5GEgFwb=!w+b4Uqwutz6!(UuUJBYC5Vvv>hb{H3vcI z7Re{vQAZ%8(^%sURmp^5MjPc(bDr&jXbDH=R<;_Z;_C3kz)i6&+f4P>?h$S;q1Y?0 z-UT@e4i&)!<=0f#l;@7C<&Rw|sr_Y**FfF7CFZ^R|^`_$r2`K)v}Y$m63;%f@%oSIyyv9Qo$U*M*FxvAf^LOPTo#pdj)nJ#2A1HYqQ6Y zxG-@;x~~QnYgA4fEViPD;m?uR7N*c4O^{;Z&@Z2~zo>^HfOgrmy*(z;CWTO7LfNHv zbNG)!;1~zTPW&KR3@gA0>&YHR6I3r(G!T~kUM2mJ(amUJggbdAfc@(@HWcck2$b>LPngT@;JTR^H?bFL>}Hb_1FHG zji{qclW5cAZkiuEdbl)_bQWq0%SyVuyD&SkBRW|gECpX!uJ2j$WKwPJt*+T>si)rp zi90BSQX!z5e~OiI;P!#3y(&Dil+$j0hN3LiD>2c>J`KFHRfvr*Azx}xn<#b5T_6p2 zQnzW=%Apb%q|O?ztSB)8uG1jJl=ap0st|3dBc$PlYCw(s#7l+TV1rs(5z{@{g=wf5 zpbO*c$k%N!$rC*fIL~q1;SB{j1s$I`nMr!$31BiQA={@xO(};uykRqIx-Jv8B=%q| zF}u*(??kapytA;SO8Dfey&cXQ49*FgkH~p6bY0a~n<*m2`H?qrb#JK7{S73v956e9 zO+$h_Yt@zQ*m$tAATM)1k1J^E0>s&ucTo?h*WtX_EkSlv4t}Y@M>J?vI^>2~kAQF5 z$eeiT8ctM0ok(c1#~?LdA&VHb5cCO_oV|+y0X^jAGvH~7aK|&k1RZ3?4}BFe^0do1 zCHQ`>!(y?$4l%tY8mS&qTr{tp@kl;PU^0;#p~IP)NouMlAb}^cqJ%p zLj>})Xc-}r+5SjFyCw`oA21QfoxN_4iq92Ns}2+&ZKUGnjVyAQ4ZnhF06Mhcqh(V- z9Qr!_SmWl4;^w=`ir0Yh4cj7vb2A$U-4WdOXoL|HGO{9R0nyAlJT=>c;9>VIOu(HC?oN#&=Pmt3Iy?0nnW33*E?;uLp}FE zV1WbokDhk1`=D!gk}3DxvCeP6(zI-6{|aLKZA9UF^Ay9+3x4j)@9^n2!T-O4ob*4* z@po+ZSIGG%+5Yc~7TyPY{{-44^KbL{ z{u;t>Sp5$g&Tm`be}_NIHC7_tHJmSd%FsI8HnAp5Uy>!jFZ@tOs$jr_Pe5bvVS&VR zNH|vW1?@;k-;&>k4o0GS4@wL_M_TZziKg@(mT)*8VRq1V(5|DQyjp*yQX>j|X}LGI z)#mD?E~zOI+YGbh%ZOSMn#b@}fy7ZzH$z>hA3K zqqU+|dkcCgdo?aTFXIwGp6EEF>H~s*BTMjVBX_8NegsPzpg~QUk8lCZ5D<_9F4fV1dYdvPBn?V(i zm#aLN|GS9O#WWkt>`^GsaOoY3`SS3}at`37bOyfh(1~l>K%HMy?>uu}TkR>^-HlZ| z+;G8yb}w*NE@KH3ojoU~IV`CInJ+<5egLi_cdatg8hB!RW!3sAuC#Xz#XsYF2@KPU zYqK=5ugdz&M$45oY+?<91G0_8QeDpG`8s>v%XsE(_?u(M$gZxgDCDJMHv}Ib?nqM0W>U*7^9uv3^LK&RopAX@Y#0aZud9HBgr- zT|b7sfXgm6J7RfuhCrkzh(k(IT7Hj?dJOS~!ah*QRcYFETiFcR`u;RF_4MqRs9-7I zkYmKN+3gy4M^b6H_!2VP5|e+xHrRZ)tG17*SFfMR?mx5?7$6eQPw*|e0*3O&32k9w zdCt(1Edk(=w5fvNhTvV+cPb|aV{==s+~pnQ_J%{1``=FqMZx45!OskIfn{G z-tTU3b;zI zzhuYLR%NNKJxq__HURgl%g%p8sDx+iY-TK>>{!iq5is=cv^Lmb)Ouq)WKoZwYq{8q zDKu#O`nd_e9fD-N%kyQXf#Sfcfn8`8Wsz6s%WX2KdRUn=jBId?pE`U{=x$=^)0i74 z?ASbMMK+6Ou}r5{5Jt~+mAOyD_>e`2_~E`c_=S5t z05=CS(CqpA(`aP5UW@d)ZeTP( zkY}wsXMMuF&UqY`FD#PCXV&}h0y#L>xeyc-yC!BvOrc05Pv3-xpkA0uh%~F&yL|k* zb-L?@Hzbj)ovkHTV5s=i&vZqp+lql|>6qDzo8O($AYhXpfB)=^!J**j=V2)`H=UK7 zlfx2g!ooi5{51AL&mai|TE`1Flas95x5kYLU#i_Ot@-3XTRc z*X5#?J~qBZC$C>cgKBcl$#6wAGf}vkM<^9fa&Qkia?ZXX#;m--a909z3O8D;Nw70d zBp-QbZX`LDB_(~J9St;pLYk-zB(qXE3-;>7Q~H?~_#7ZfLXQl8QVZ*)DwQ_vO7S4F zh~Sl64)%5)hp=oyoLDwY4fC9eqLofnQ&g}Au5C$qstOd3jmqoCH1cXN`Kr!+OmQJA zlbg0SRSga*k~sag8U)B(xIq_(4Zp))G)P)2B>&5Ybl{OvXzq>dTTy;ad=<~w?|V+e zGFVv5gvgcDg;YHGqCt&7j#*u!VS?&ZZ|4t5?&L`yuc`>XJgMTVGWCrjx_xq7llS)+12r)hS zfCqcD(1|y5Xe;Do;@d;rho8sX9O7UTt$B%j;D?DU=J$zRNlc`kK!C`?J*i0Rs$Abr zA$C4gT@YWG!rZr71v0^LtSCCfFMP%ts)*VPnh>7oXl0E>LJ66UpUj28GKsdp2IGfi zy>oYzq5#?8z9U0oeYdJ<6FW^1z!oo2r>EVuKsIH33Z?DI{VVZ`;Yie;Z<rVy z1GyA%UyF8&%r0QcsIhJ#xiNb_5L8U3h!1v2fjcy%Wzp#rD5pB?t9Z2(vT@7>)zR^? zyh?$Vq~gN541-y?^LK+|U*^wMn5C9}iuVvS z>4mz!6j(gOQVPe<@g)1Q-6-|4y9F_%2opC$Vdv7Z13J4mk8~SuD z44~IsN7!4I495he&28}vL4SaqJ=<3?yh{eE*9)xK+LU&7!`CA*c) zJU~EPT$LiNbvQB|Y%oad6XYyGSz$(enG;kRn!by3jjQ3p$Fjb%akRBAb4M1b{P74#w!C zCm)H5IE~9-NcUplf&&I_)fToQCU968u5Cs|AA)N}teY~}xj(hhs!*++4(eRoic^*?f zscSmgx)xYODgi%dD}k}^9gv@60#sI~VNQp=qr)S(3v;mIji90qLx*4-m`9Y^NY$Hj z`|yA?wz)>mnppHvEo|bM{`{eLFLYPINvAQVIB#>aE9@rq=93>zgfmd6f<7NGx2G%H z_c)V=%YHqf%Fb`m#dd_6txB=}a z8!+vs%@$A!s$-(wamo5c;aiGYeuIQQ&YKOGJk%k){8-SS6;`|RmHvB`H34}5jHFL_ z=+z$FP-g0~OvcS%^Vih$ns2O)s7AsE#j3A4{x7D;q%#1AWIO?#PZ1^?Z)DkwyEkonq^9 z4AGY3x+qH<8bh-{ zvAY}?eCtlrP2a;8>`x_CxeXg&vM$bf5{o}*=FP6U>wgF-5+wJ?g=(NYw4cfy8)ECVcEo{ORl zZm??`iaAvf=9E`;vB>*l`NFAgTb{2 z59-$XVC`8F6UqQX7;3Xb`U`(BxD$K!ZYUwq4>Ufd{tZ5@`3nZ^%Hx z9t`uhVv6QA@9u~7Rak@#j#GY_Zao$+?sv@Yljv3_G*1-0Swbf5sSG{oN^PQXkSwGX-pTeY||v9gz>52(fs z)fvJr$@9*Y1tQZXE_yWK!f&~dCcjwv9L{Q)L`9V4jHUo!RWLHcjf_r<=BgyhMh>w_ zu0l@xOY|iqp2D8(83|$5Md7Rl&Ka$n`#`~9tP9C<(agGPv_9%@w@x}Wf5!CChNrA) zml=zQ#?jJ7$^to2dl10+u(B;hqR}mctjIXP;T!m+*)wwsQK{UevwFvN?FfOS$R)*9;B90R$Tyg7Q z=<20C-hH8_*kXX3<2@oQDvNoeny#;cNITvzy!A~#J5qK24|xC8F`kIDD4#JnUj0Z`$vZo zi=`qmJqr-@PBA%m5f-#e4`^BG;8iIzGJnv0=I1Bj;3^FP99oaP;LH!$5%&@J9v9d( zLv_DY22Y<&{Clu?DH?LZ_k#QME{au`b{M< zva!KnIQA>!WgksuTeu(BR^K<$lDJx=|VnNJ&}fKzrC7WUN$OEY)s>A zbaddycIu*w;_z%fyzMX#rk1^+TA!YyIu%Mf>bM<-(@_NIzb%_nlr1En6BIM24*^Xa zBDcI5Ks>xMF9hZ8V`%CC>mw6!zQQAbv!2lhyMHdH-a$ROF$$8E>tcnGb*R7@ zCG`0EH4=|!l!~0$F{~71!JXYY^`y>nzu1(Z`p#vQgbxTN-Y6zZ1vJiHp!xcn1@3Yg zjR0|HCGW;kX*9(i;uM({U^wP>RU?3=q zZR){zB*EcwIuc+?K{J0Fl2s#4?Rvjsh5)xpH&`>{>*Ib|^?f_~ro8-m1xOMJqZ`1| zg&gnvaie-N=`|dgsCLxocrFL}N*`hBgs9K2V)02xlBC=}+@)hMP^ga>VxK&YLt+G4 zr|Neqg6P>w4npQ_4Q@deocq`I)+}07(gG;WRpEnCL^5L(7Y$zQ$Hks*4NfFtc^hBJ>ohP#UjTd8vBv1FY(y~2Oa>$T^~S1v zg;2D_dwX$xQ8Rbr z*b!YN^m~4B;Akn#B>PwlizP8IG%R;?9U2>i8gVI^SaX9IknL(hKp+$?iY*3J6k_GC z3Olw--D=rkRk|G7jiD0Qov~NJQ*SwDN89^V3F?GoqTQ;&7<&+XS(lC9aQc*DdfgmS zrl4l>dlq-r)HPBi#Ftg_Oe;kO&he)f&mPt&X5WRr(+9P8K5<*oP@-iR7tLwQBGmMDWS9v=wr*nD>FCRg z2MP`UxO}KGKVLGEe9919#AV-@Jf4!$HPHI0TLDtCuyx7fbyq>RS(gmCP%Q-UK-M5` zqQ8k8dLj2|f|PUNVh^0Sam3eKkAH>{Qd(J4qK}GgMj$r+G0Z$J2_hhQVJS81Lohmg za1t7gOYrmlTB{=3YG8OVO;6HCaV$Z$YLx}-EI66`n#q({E7p7*z0|-A`h1*a5!{fY zwV4u(D5?rjX4nlKp`Rl9j=a(iu10&<#H_g8p_5ZJA8HPW} z`M=0AzrKL~vr3>}cmLj~|Bp7!f0SkZ*OfniQ(oAAZj!$$fBr{%>K|u+uljG5J`6vZ z|M#%}`!>nnlEhy($-knNzlHF74#vORB+E6--&;*kUMjS!rLNywO>V~ZwL#^&tPuP7 ze7UHys1JLx3$8S139i2GwLV6CJF0Jrak2iF>uFScsP0qK>NGA0?wfOm& zx~FCmEo6L`d?_vE^&e1g)3qoi)C3H5DSizC$wVr{iyEd3F8~syxaLl*ovIbV;;8z$<-5_QqECNZt!NLZA2XwXP!t7d^Y9bG5%LyB$n@oz*kX3OWP z<~g!jN(NsfJaynGl_B_5+Fm~{obn{-U90%&4VIWkAFsQ`ak%E7 za4g-Sddju;S$=v}QL8lO1@taLHbX*dr0NN>*fRU7VJpZ!W>;wmTW@YKZRu%fC=e{y z&Tw-#XEq?-t#xNY-q>=u&7xTysE9R-OjFPr9^C|Bzasm~GiHKNymI+Ty=~vr(%CB* z41@ny{Pj(vMoSnq<|>7~$vaQ`23R`%DG@%pxjLB~;3e&`FV`32HH=CklQVJ31K;zN z*sLX4$Y$?bgJc8<_Qr%>v!)}HnLqXV8d>hx({fn&QEHX835GQVOn5kcpiTMGEPNX< z3-#7M9S`UFG9kK3MonqCJCT1kWmUkD=s3UY0{nE7Sx}evmaG>-@nJOpVty|ZX>lp~ zMw$RKo;6DdIB7$lT1eCCh+wbL0(PyCK;3%QldZD-w ziFVadV48laJc-q`gy)Xl?zv9}Bp!3$EU>zFo&!mCOp@z>?K8-2+=pr)d=#b`PDgn3lD-lyob6b+>^`F!ulQ#%K zFjJTM{lzKM2dW3 zPF|%uJDEN%z}4WS$QF2=&zsUjnceZlwd40HDBVCo%T)4=vR;`dPt1n%83T~u5?yE@ zniuD;C4k*gR|Gt?I;ZxtKr}&SAXlTE$X$b>f0sQ4C9CJgcNzSqCTOF=4a@4kDFu#+ z{^GIcCxh8-``K+N!*}ys8TS3xAa=Whf)#z{J=X#RyhZly6&RSKOWrJN(&u7x6)7nM zgGr3oH0glaCN0Aaj78EwIX8o4q8oj%_K#%<-)tgnxA@F!qf~T)w{r9lo`)gm&%n`i z9(=L0-W|9>LnzIafG2wp3?^Y6#p^sVxP-RmI4g|m5HZrAdVKmmGQvEs$-IOEi)jU8 zbK?i=UFb5(i}^Il_<8f^a0Qf8nD|ZJONXg{-IkYa&}>jFojrl zm`)t!?Tnf1V5Dy|dgF?@aNe*?Ev#!~c9YNYJ`6~_>1)M}UEb1FoNgbW_aC_0ks0IK zTY-6k*C@rYb{O5iN$fry2}TI+?vRov zbGa!}sPyu#Bo<=LkDnB9W~$DT zT{1ega2rWrJtmrwg+VMj?&Drd6?92i4ue#BBXjBWi4~Cn%Hsx#!wAF^hYbNFl+6$8 zsy@TX&hVrS)+aDSUZ8@jQS^MqB-W14JczLz`6LXJO=+U1uT)L)n6Gs{wR$q``Ri6^ zKNe!fLhmouL!OIs|)Q)%TwG*4uf*ddUdbZ@L_aLV)___9AUJNZm)H zwqj0X0!F1=qZ0}5+pdU;I*I`9Zh>nsaM)JuQ#Z^g=HLi_vXgZwH@M+|h^GIL)YNfC zC%p3sq!(k0nK4AET>drmjJ8o4hO3eov=ehsG8(GyWwBz#5f-LlJTeeP-O z0Dq%M;a|{{r^1;GFT`8IcASdQGm{#s@1yG3U_weSqyG>*TGX%@X1rMtr-mA7fUbfe z0CR!66(i98sE>Ak1L8J)XyQjIid|;n@2w{ie9QVF1Sc8UJ=SZG!OZ$>h(0J}2<(gk zy;qX_V`vOF^=Wup67isHgX|!|8BWYjke?Ryr`NMZ21qKqir&p7XkgBM$IU4e@KBj& zC-|KR&^--NK2F`RJRmgR!eSj0jm#PxTMN{EphzY3$#1XPzTuML?WS%h-C3SnP|eYB zf<VLnOu4sWB;rz&kI=^qF@xW<6s92%LAQ``~q{2G|U4nWAlUPE`jBA4h z&pH{HAPLg)1k%mEc=9s$6#`J$rfbF*Y^QkibAq3HxPZ$hs()C9O^=dF(@J}Odn2)d+Z0j-tclD)JCM7Z1V6>@+y@-k&xj- zQ1W1dMDb-mu!dG$>BEgzM0j+JI#Fd`G#>lan#Q%-{9W^K*tX`ZbCS+E+AeJQX8nCn zCN8OH#lQfY8ehpKi+fjB@em<+i6)n<1y$tJ!C2~cY@gs_io9r>i-D?6Ls05sirx)? zt8!)^GiZJ-6dI3}`_S`PC1Y-dp6-FJb6ab=4HB2G*dgXdXh32=Abpremx!EwmGT)$ zI0u8e<vwwcHoE3do$4LjeM5sMUK~nHaVamRa45|=6=0Zl_Xe#VX7~|L zEb-+Nc%k}uw=_BiLOI(adHM#XB?W5IfUsHLVo--$2q@A$>~YIhgxz2U69+%vIFLl_ zyHRHLM`K&k@JPCNJs+X^4m|v5r0>X*l``_%0eA$_f!k5SkH(GBL9|OdfTZEkQJ1wb zP-k*`a=a9EojWv!J!HWm>D#h8w9+bEu!(hGFKW02D^%x;d`$DIE_BHveDOUv?lmG? z-i2<+u+Be!Aaz4Vb*dBDiW-=Iw4##2^#@KnmSxjfC9&-etjrldpKA*fNv0FomaP=j zj`~4KdI(@M4TV!`PmY2bga?@LK+#t+PePT}S9)V*aH60?;2$r)Szdyu-7*9e&@ay~ zF14`}KrIp1v|7CzYpt1uH?;jKrXV+UjMd7>RYs?vdMJToE^E53nCS9F(=Q^fDAPOhdFsmLQn#C1nl*snj1OUl;deX)q`Th89?$%~B= zsj3;GB!}j63!l4(8XmS<3rV$BQx$7;bw4hK>LSiql6Q(x7=&(9mc1!*9d~9cDkkr? zx6TO?wSRulr-C@uR6pQeua)N=FaP7fN}=*x5uMx3hE*H;#~9BGo=Wsc@#76U zdECH(6iTKO=H+O`QIfv{Se>vff{DKwzkS|V(`q<&lF(H0_K9_eUH z%GfjUVKEyI6H99kJUr_oE!lh2jPj@Ggufz*Yx%Ksv@J55;Vs=CKbProK!v`R;9W5x z`Ol%c<#m@jbN6bLB9G`4Rc|j7q&k<}Da&1gVFE+WK}*D6 z@?$t~iwKa8)Rta2*ga7DX@ZpESA#vBW-a!%MSYO>oul5L)9axW=lek9XkqILM43O1 zv5;f6>dvCxv8%v+)IPb)`p`zzFzG9vjnVXaHWZSHy6ixcWr}F3i%x+h?(`MkWZz-b z=SR1Z`0R6uvZ4WT zQjEM`P4;&^`p;5Wt)dd@lD_1~E$Lyp2}TPJ<|T`u3&b@3n&Ea_TMQ2xn`46>wF?1Sc= zlyW-O9hsp(K1>BDcaCGgtS|07x4wqGOo#OynKbatQW=>TxZOC1Irt&!^|w!Iqc^fi zZo0cA@(Qi-di)Lka`n7QoI(RkHiHfd*6^5nL&m$KEBQPqMfJpS%q9u?MS&kpO`HIp zAj||}M=EZI^zI*gtJ4O)S0CO$#s}R3)-LW)B_b=yz#Pu$y*kln*rut+ZN3jUKyCOm z&i;BG#@-0Xo#UW)vF0t8Zy(9PlO|x7T!@oZvd%Xbqbn8j!6aLu{`+KmhOJ6>_GcEG znTMp#r4@8lm_28^fc34SPrB8{1~Y++KSnWBj-mYRp-|#sVF<_9b=aT{P>o5&FX#9y z;4omu#tDQ>O>&o*>+|f}b7irq>rHDfwA0E_a5ZLvuhDCcojb1+AaWws0;Ezvp&zzuuwC_&hf{~5@KGvr#xtO?!Rd= z=;dFsp-#q_oEAC**jFv8xu&YoY(gpte8xrNfKjI%pd9}pryj{3Hxb_u^GTgi?%OSJ{R}%dPrUP%Gr346-K1_vid>yrZV(CLp=O&yiECv>JeD$*> zoCQg=Z*iIK>PW(N3Gr+xleQG+({+dLxix(vrN&+xx4KsNgnNYZ6(|*AqdywxXcW2? zp+5{FsL!o`ObZ8C{bN1!a2flYYT8s~yHbVWe2(^QXk;3c36Pdlb3-lWThZPc(W4S3 zw3ifZ$7|RJJ7EWJWLf>pjUd=cD7CiRovVBqzu_Yw78hhnY$?oH0^oaK;c;c!ArC`p zBbEno#zy5pkzLAgw4L1tgG)F8L=xThuc@Y&=?F)lzS9``(rlQVf|0tFK@Mp$}zfm0Fs1(tby{GZakY|0qZR?I-x9`0#oEn9na0=@WLT#k!gg_f$2{O`0rJR3mBFFn{TQ*7CXQ}*^p-={Sni>D`IzkyM0QRVp0u0`wfKO*^Ju65C}cLHi$b}3$d z%kw$0L(_b#GfpX>OobxogM5bPqI^_PU_JKYw@{zUuRsBITVA8?sV>*}!R21V^|Uz8 zY-r9mxLWNFM^^~9;>)?LHNTozVJz!9MOZb->q>xqGP9+kT;WjeSXWdFM;`+=*ApbT z?qs;&sPot|XP7AZWx}~uDnQH-A6~6kEsh((;IsG>G_n}u5{2u&X{Pc(9P>0hHI@hN z$BT!8V4e!v5kK(_l=(i24=MGQWu4Eu>i2|fbqy!|Filsxnt{s)r7#q1amx43g_@G? zFXqVB9ZUk}{q_f622y>XfmF5gIIML#U)MUA4zwv}IZGi&v{}R*`8*DxR zUFhA;d9-VkMUXE)^^q$qBn+tAlNse4S!eGIrtyGP)f>(oXayJ9f{Q=9)u&k3N-_W` z0{3A6yDxul1fJcS0JSsQk-6={BkLP(E4mIH$KAP||6*{k$+$k9Jszw;7X_PEGjT~I zoq`Sin7fs82L1GvK5Ob%4^RV6UgvnBK}Hl~IVZri{_|xcU9zCEW_t2 z`(5)80OZgCA6H%l`O)0+D;U1Pp?b9nKBvfjOkI5K)HEM&7Ss)D~OpKMeq+l|YfB}zIe@v3`Vh(k^jG0VsB&WMlvTNDf<>47pYO5O8 zgwV_?*s94=%5*VwB(-BUktY2b*qrEqSXI&=gn~pck2Bk2m!6G_PJxIH9FepMa&Q z=$mZP6eFo_qk#`7N?ce^_B;OvYRDz}m{#hkr`zFi3~?4sff-=xhw zLIegKAs9jIET=;dDjo=Wdfc&{4UeuHa9Pb((B~x;f|0?L5Q0hB8!9v8EQ$<>6_J|b z`vS;xm1o?#NEaTO@`%4e8iYBKU#DO!BvsjUT*eBwa-v5~Zu+HjQa7qU$o5r@A0jh0u8e7kUClo#lM|6pt zBCrZRo>?O$8PybQgernubUZAk{WXu~af)z+CU9M5bRT$@5%PD}wj$)VDyDr3mTtc& zEa1Z{r4!&}urDl?#9uCNMm>Z)YBfo#hg&{?Yj+(}>q=NEjSHU-%XhV;Vr zPJ4a8G^s%gm7i>~_%g@lT(@|8OT-5YtkllIQcQ8K)wblQ3i}oZKKDve`3=YRafy^d zC?j4iJ*DXv3C4?pg6!*l+++WYxvX=&-uYsi@nPn<`%`~#G-pAI;mo5i4`i*#)j~_{ zoUkY=R8iAf9`jA|URI{Qh1W+L>(FA^y-Fj~`_!@Wui>^s!6QHuLV2#TcM`((sL+Kd zG>E1OY*I?t;X2{y43pm7xIhRDF?3-BGfvPyUIw31AIwPT7Wh=c1R->Hp7qo`@aUow zQ#_jTYG4Ww)VNK&!MF>V==~?MzUC!`rFHkG_StF7 z7AQ7V!jN=PY;)PO&%xht*E=V07W-S1AT_{}zZu#T?{KUb#?5T9s2T6eMh1s-)X+Xt z`2UELT|xsixF()NE3WUY3XVPuo1Fxh-Nu~wv8!N_SIBM`1`B64sR^G|-JSuKvaH00 z4+E9^+_r47K5XttTh)X92~8#R@mQr)KnK&oUy2nPHznQWld8BIyKlEhz(bZRJL0^D}#>qv7g8lmRJ& z79|vu>RWeHKTg9h1EU}M`25DLt*gJ2<-&%Vdx71iO(SAuBFT`m_B@g_tb3#d3K(0> z(pK9(S^GF)u8sKIWom1igx3_Kk#^@l`Yy7g^VNbmlQ_=!84Wo#cP!DI8tC72At_DrpUB^Aw*SRTGp-ga(?OV1IE>@V;zBXbJLr;0V$)O&`YMSPtrUr zvXsMamC~#RdwsK=&O6ICA{?VHi1On>25-j}3ruk+fI;Qk`^7b5ktkHKTH^sXq*!zKNC!1|fAdZpaub5M;^p4C2p zpkiWb)R{$CJG^oZbnWZo3#=};dUjuo%R8y9x=WbOfAGzI)PXIggWBRHk=9Y?g7c2? z1-`Lta~WTI04U;&DeSA=0WhOaoj9bR#>08)@$GAKSAjgvEP^W})OB=zZLP|jzFF5)I$`# z$uW(;sEd3rT{d)ao$Do@YGXIV_T(KLXbdSiWI&G$gZY8pWDH{T3H(8_+;>-O@=6@c zWsg)S+{aHYOz@?A_|S;O?p#Jr@PRmbr%;Qp0GfJ(1P6niY>z#aD^Up6h-p!L%aIfg zr&5B;K4|aVD?=z~V9nMI`ff{y9t=^?Z5UAoD9~Li$AuqGZgc-K$W?3GVsya0-S{2^ zMEOe_Gnp6$)CAA9ck)5MDsV@n%QoyYc=OX!)V7YZI5vO^$a#j)V`ubgMqWm(%wkZM ztjH3VW3o|X>=Ktz*i@qpfv1M@86acoXUip>2-3-d7UJ6nj_{0_x%WVWt37ryyY*}v zLmNL#34Qg#9(x2gP&HXHgr*4>KUvX5y=(gf{BFk64J;Fo3*{N?0xU9 z^Pacvd8*D+b^l3a&9!Fz#;lbZncvS4QdUscdS`0XmT+yJ(NVyR){-l~EN6IpWlY1T zOqCxj`+SPS3@V_jHLFHFu83*3G9FMjn$1k)$@X|?FFlxSA}MlEKe7s4(_-se`(NN& zay*p%hq7y~1;TQg?+Z{CS}7;}_|{KvABg@Ijd41DTD{)vMg{)qiTTOc{cOQ{C7gNE=lxj8f)dC>zI+Sp~H>oN;Q z(CP|*sGI=t4uD2b@9saDEqG%nBPrqwZPeKiukSq{f;`iK)7*O+AjOas-uUum5CrB^ zjfXj0?%pD_m!8ZWu$^=^p-p}7yzG7tEWlY4+9*C;Rs@^6(hk>WK@Ks=bR~Q{06A>i z)9ENFT~~4gYBxnz?dy{_DWT^r;CPlFZDNc&{wcnQt1#_y*6{ts?=!AO-M>=(zqQ>T zijRer>u&`pzvt-uB?SMK>Sz8C!oRac|2CI}ne`uiJ^tR}y_o67jcmMUw|B&kc ze-%Yx{-6MVj>!I}D9Z2EzfSRA6oB>55XApF3h>*oKg|6*1^9ai?Z1!kC&>7pC_qu# zw!)$y(#ZC8&8k151j)qoPyKC1>A-NNU<&>)rbjBxF6%s7#UJO{w%4NbdQuP`fL;3B z>FF=WJPqCx)2no-FV;fLm}KWPPw{LQu6;lrjN&o5S2>_x=CG>SKCxe%3_ADuqib9& ze6~bbC9Wmke&;jH)w+%8q9Zw1bRbT`^3$x7t_Q}`pjo}d#n{K)xPqV9-y1k3zS+Nj zhOB&vQ6e@AlwkjnYb)pgbem@Tt3F$X=@FFW#;|C~nBHxs&*2pO=YsT5cJ^K})?`vb z5eyg=)?`^QUPI5d#-W!Skbr2UcY2t5C27c_ zenKiAvG_Syh}yK(8O1bdxN7|_p;p~=PB2Tkt?5c^=~}6`&$+5`BH-N20$P)fjbqqk zC|qY6dbQLO6HfemZ)>JY0U3~Z^7E6jVSpCSg?Un0W^|7N4KcDO{mo zT*gn?#sXu_BsWBhu=KT-3kM|C;+f0gVp5gd6M1UjtSyR_cz!IFbZ(RjnX>Ua&|`3_ z%@kH7mC!-zp&|-EMdmB(0~b6O_ThI$w?exMG7au!<n;xekfg~lx6c5?WtjhFqynTFJb{}Vg{&uMLYc}+Wy^1ZXi26!ZT z97PERo&vc#;r~^jS5)-ia z{wJqirK|Ht!Nix98bf?OMZu=6wu>qY7*@GJ&X3s~7_%6zMv5qO4SAC3g$c#K7HZz< z-lr$&#T=)JQ_Zu1QjkIkXR_XGj|NUg=0cTX{A7$J)Qlx6PEYI$hE5_YlyVN+#s&lm zDl+4lv{ca8f6Q!N!}DvPr9T%`yfvg6q-yaq7gV?xII0;$RsW3sg-Q71EMm4jcGlgs zM<;Y>W9UTDR9OSKLo#@4opr3w`wof1|i#i?O5;DE|0cv zgXGyFQ6a z%g{-{tam_yI}$%w?ufp8!`#Myhsb@ar0GQdn9$+iqNTf~n$7^*;&;Xu@cuXvIY$l# zx#uQ2ki9D6Ze@-Nzgo|fbA8Q&gEWKlxYO~n;+<8+Yz;%W)cD>-+%=lFQ{<|pCZ3M_ zW2Cgo&=xqMZ>iEpo+ZdMYbJ_(?%Ggm!6=$C^YCKcJn``z+0HJU2B)@ZtAS`1ZRv+E z=MS6rEXHAsXzKcY4KuXcJ>nJ&=+038M(yE(ts%k+sUOf*u}~996fB<9JF(%ynw^z= z#mrh-N3Jr2)35`u4^2m3a8EKJCV;V6PbhwLXXpu#UL_QsBJfaTYG|GARB4(;mAq6F zT#cvB@o zYFjZc_qNa?5KF@25k5blt+{ncO;IW!T-t#CpgfP;+l0eu&sKlfYtYzEMprKSZGQ*j->+FH|`=^un75vWVMRC5!WrwRCFj2UfWsEu;4v8bidBF7vFJZ z@3f*~s)lxIp7CcB_U_QQ7;jEcN)YrwRA^q=SVG^s3qPLf?`@|KNJ;Qo65xEM;A{a_ z_$7-O6ccpHAp=R`=P~2lL|$kF?P|h$S`psju{09g8XUYseEAZWEE+4>U+hiqE&D@7 zp7uV4T1?|3H(a@^VylV}Ne`;5*;=u)+eYzO!zSQMEcj+Pom{yG4Q`-uEe7|!Ua)}htUI%e zAZ3qPy)Z!B+Wa^)Val9-eoVF5!?MyckJ*@}Pq)>-wJin?Za#>pmU`CSrSr zydA3FR5;}*SIGefP+xU!1sTa1^d%V$dTj__&AU!gm(&s9ZBWbvObX1qj@fr z34YGYBojLop>DF5rMG$~lX~;=_X=tjOpMeP(6K3YUr-}qmA^HnC8br39i}L83rH+^ zC1;EeUHD!EV#{vaD@x!}KMMw{vZSS_JTzFqU)d`W?M4zm?GvLb0<_hs@r_?BzrU~O z=AcOM7Kby)W0TGcy^h8mX-~m_Cmw#z=gjLl~g={Z=rJ+MCgXOt) z0!g$JQ%awA%RoWne31T4aE0DEDHMivTb^S9H@TTxr?=G*oR_7V5@+418_;fgDBPm^t$k1*ZegMEswQT-6ewFRD(%HiE*y!O*2fmpTwMM{8Vmw^JK#L+3;)?pMxPOvEdb^GuyH$ zl&o1DS2xxZ*0l*Q_IDw$XojZ@`zJ7|;+P?zLo7W@}MK)!ZBu@fHh1auXm~HHIXynnw$q+BZoj zS<_V1;T7@MIqE~Eh>Mq*m_#nyVlipJ+qPh*L%c4gEhmXJtVUq^xJ*ycp|g2oG!_M^?!_{TuJ z4KoyxICkg|Gv*|Pka=4gk5K>k`vp)id_0v26iuJk*NzQ>&=*QsBEwDn z)MR>a>o^>PFde37PYBWhy+Q=!ec-LHLXqU8|$(` z3oeGaaY#X_6|K$1K$Be7cjZg!a_y8e*gHY{0!M2Y+1PLom3Z22&WUh6>*PbhE|1wq`}52(pK1r`zFE+=oMqgF zL5jAlc@aYe0D`wKoP`awrDtytf~0Ua80L;X zomu8L6aKfFVQszr`mE(xu$#tc-vn`NTKU3{*2~$MSh0p`yeDxUV9|R*bL;Y~5s{R( zyn#_5@+h%;0mg*6Z$4oXR9iXxzo1D_K*ceYhl9|EcfQ6AGCjOL;p4g+mOneWlr;aa znpyukIRh$w-4@!y|4CZ<2hWp0=)_VT@XE5dg}2ShO^X)DQy3dxPFgweB70c3*T7t+sfArnNub83AEhO5RlExF9E%0M#PONt#vigv{jweseh5lJ7(YMH zl+kj$(OHWiqQ+s^WZf zZ83?8*;4Eoi!Xo%DDr$Is>lLo!I2Q+vpI1Guk_|(X_z)|w*Pvl9F7(wYnSOFaUHsm z5D5mZS%$|#ip7l`ibMP7k#zSH53D;BI{DAL8ALkDqbX22_9>s#7J@Dojf*Kr&MU`_ zc-1&me@LMrt{O%LannAA?UZGC1;c4C)1FMxA~*X&o-}?59ATZCzw|@KIOFaeVkM1m zt(@at(j{hBFjak6*_uwB2nCLTU=4n0{DkBj0iL_IKFB~Eq=ky$0dl)r{R zXHFYl_h?KNJ^KoG(?xA+Sk(Z{mj`;$`O~)GHpWG#-VLiDEGw;48YyF%vk;H@;?g#O z$T6Oxm39LwIbJ`Mx8m1MSPJ^hgFhUni2-EB9^>M{3Hi!lYqL0oS_?xAaC6BFy-s%40WO)^ zcDA1|*VSyAzQ{&(%r&J<@WZp!9@=zKf$D$PC0@6W=h{YAJ?20FN)4oO$mNv8G$&hFCX! zNTizi=5c@X8m)IO>GliK(>=J#vO>cw4T@1s2_f3SSN&{>8u>xBBZxczgHl*zuXqbl zC`Y*!ZyoKvJm#vX?RlYZj001uHUyWl9JW&Y-~dJ(wlocZ&<6#g zM%uJi&)dXp<~Woq1pD##a6dJki0#CF_xBVyJVP0xIo6C{h(}_ZM#gkE?R^`YDTf0) zbPhj6i=TZoUMn`;2j-$Tz~j8Tg0Llol&PU+^T^a8yNtzwlvzmR_Ry4KEq6eQM)R4( zx0jV?69{MHOQY%2--fSMTI~+znG{F7*)?Vv6p!zfL_4=ZtLcge<%Ya74la7gF47XVMSHun_8fKKwcAVdNL6^+Y)NzXDIcN7np7B3PMNSpWFI zAHRQ4mcMfM|L@4tpAh|TI&aunSmHipIp9RiMO-n=VuTO899LeSM)fK-wIo)f@ zSIW6--d~O@&U%)H1Sd$Fqb=WGpc(EcgZC-3{M>K%5o>JU zH)no%sp|bsp%cz z)fqpyzdr-PSk7h_3~XTF^Y(sicbp05qyVVVZDv9UWeZ58Id$;tcy*!C-aA?W6jY1s z_sYF`0VIISZDlXBIPlJjL{&H3ssLsX+y;fuj zo_uh{;u!grul!l{b4>AgaYcSz&bZ3@;vCo0;KaE~UUA%_=L;7m7xuGGIEEZllWpg* zBI5OHwBYJRlB;1^L5S}a;;AsMyUQ?sN27bURz7mNL z2U~7`6EjKBU*a!R6vcD#Ye6+4k%O|GG^Y>q@K}+;OHeDeQyPtTq8AHew6D>Af!jNn zct2`@LOT;h4J>{x?m0!6Kr%FPlXOE=;*~q z4twj6fi{U~qc%heGlwK+zFgFVqBi6wEfz_vY`PHyJ32nPKONIj2&mTXr?P4(DPAp; z%foAxGsGuzZR~?~Jx7LP*&Co3KkvyQZ~)PXdY;v~Gi#haP*0#i$F~;4l175!E>0wZ zgJ09rlTu`9V2e>Gn2roFoV)Kw01K5lHiT8?>vycB8sL=>1e@9=uqYG7ZwNRYbF-Kg zm?nC=-3jU8qvF~GF6SM4qS`&2C4&gCnANf*gi9399&u9#bx!C>Qkd^|`o0ZT!tunp zD}y7WpYEfHv^L({zHEAR9bp7)npu#!Kq`$K`1OXbO(o||TSyDR&adT5$C{nJ0=0B_ zO2&&eHpY3`9I{@5I_^yPvMm|HCeb5o8oWb`f3ZA+w67elwe?P1+By1iURfxik|bm4 zsoeoTbr~@`8Fr)~Q=g40vuFhgf1IN^+LYjMfiuQ>dHg~J962XDuTNl!=y zS!+eJ;x^Ob*>9f}pC>Y-{l(fqZ9#O2=q@hpyw|VQa}NlBf@C8pNK9pik`roJzC*8DEtmeMq80L_Jw_yAzMD*^^u_KE{ zOZ*x`qlFsX(S@2<44fh{H3k^BS!Az^fe5mOXj;DzcuK&g#))f!j#s9%mQ#6v>H>nX31BI4OIm#i3%c^|Ela6Vz|^fHdgFv6Ir zwgipJ9#F&@3bE<8#?YQjX5EU3sarId%qrgP|5>MkBB2=j(7e)OQjOAel)xAc$2mqI zMx3cM^XI-*8}%Nf*i>f$+K!0jcd~EM&2&K&w083zd_+IyN&4-j>yd(zDYr>#3Y3cK zNM~Re7Yz-=XN5K+*qZI&i?Os?Nu=f zTLX$KHJkqdZVrFWViys$R(gX`iVr;YM3{Z~UMU9)p250Jw^pmKn_;48E2XGp$?U@0 z>x}cT8bsTUzjzq+&VnI}V#Moah5aohv*IwH2d&ON@Uk!riPdcY%i{Eb)AR&Grxvc# zh5?3SpH|u#;=w~KFlq=wt%E`g_UH*SvSYKl2W2D@BGXCSGNJlzk(}y z{LmIh7huY#zrOzXQ{2HdD00qFEQsDY9o^g0Xtox>LQ>yfG?&0nM@IT0*!jwrQeOipq!@xpD%h+K(yR^Ye5T5R0T8ZS}WfB`AzlC+#h#@hNEb%a6S z8G9^M)-Zdw&3488U@UOI3&iC0+<&9G{ zA@^~EgJAjnDK(5L2TYL9U*oWn5VQeR&DlN#5poLJz6^=z-AOlmu_Cv4A;V%FTJ;;Y zD$K{V(!vFM^+jzM`YI%8M&IH9UP{_>M2f{;YdVEY>59Ykqf`h|{rPE}QaP@}U#!B$ z5aUZ(vNA=0MS_GwLch=f%)Vf*y>QC*x!FQPU?k3!`YKpi$R>UFsRm}>B>{dXwTv8xg(L)N5C<_rF5B|z{hIoxmwpj z6VHX{%oKLecW&3CN$-c+8i{7rdm{00dpDICO(u>&jp1L=e}-hbkx%2I$m-J9_p{qA zvVae$PpE&?X_HS&wH&&n3n?Z5o+U`ig%+96a00~yEx}g7BhMUyr1m-!Oe6#?yXzVBHv{dB zzGp;Ul83_*kseH4)eLvyIhfAT`p_+m842IsdnI-Bda`MVC^9)v?;}ng%@E#w>8}?z zKxr-jF$44dLwGx`zRz_7ySv`$E>hZ5o;>r7J7AEXq@$72YnMNqJC|mq9!yxVZpLeV zwV9(>c)WC`4c29C>84S~AjgQyTWHz)TO)Ep&m8!+d{EKSLq&vxpkxesxp0X27_864 z6ykX!+v77`H_dU$FHn?e-1mQ_SAO3@e`^$W7WTjCmA~TW|5tj2{m=OD-}K7wyYIiJ zSAOsQ>ze!@(kuU|NIBbwK4Je|74*-M^53g}S^Z!7g#FLNu>W=Xe0; zA7A!=AK@Qz?0=kCTBWxhvp@WYK0zAAng!C&@ZF`e?ZQP|LAeaS6R*P$}rz!wr$>H2L984I(w;Vy7~O#`kTtr(8rYI zKN<`6TpY2h(AZBXclfovwGHKdn%G#oIC8xG#-XNfLetSUlOpGsz4;@`57Y1F99Q`K zClp`Bn-=a5Ej~e$T;Bzx!H)q*<0%IE=IlB@PjS*FW;Sd5I;LftI~{v|HNAZgJ-^ug zHkJD>Vis1pPO;Kl{jP$^5xc39y<^HR;ZRVHhjpm=5W>SJ`YRIkY8^Dsj~AtJp*N2` z%JyCySBTla{*T6jH#L=@Usf@<<@o>6S1|aGzJhw)^c80t>P6VOUM@y{?`PcJL6JcY zkQ%5wb>Qwe1)vZQRtNX*`~JW_>PLO696`wrq&X_0Do3S}BXzhqI(wKS#e?KNjffKJBU6%W%yTon$IEd~Vppih~?<>$J|MgEOG972+tX`LaF&w>7NH&HR%TZA?EN}75< z#RZ*oS%3BgTZs3av)_SVW4}#rUJT5+vKR?ue-SM@$@!!do3m>pH@zRT;rTZJ&vPmP~gdJDe&OuG&9plQ!k?l!vob zJ?D9j?|prl5=#Fv6}17dbyjH>U7*@H-^7o);jBsrt#HY-hHr=}=+72ooI0I^6`he& z3CdBLeHx z=^IU_tG7hIys@9j!BsiMVmb1r+=66qdx)02wct8)jrGzT)gn*_SBm#qou#I;G5n8u z00e*KGqTOv!uXPWn@O+|2%n%kXIT~;4wj=WxAL?3g>xSr;q@rn%XX%lVG>M>E4i*n z?$8aX;3Kt$e%>^rI3q?c(`@rZKrwJ81;cqhk8hf(Cs{Z4&*WU-R950ju~J%^2>80l zfZDKqNj38W&}BulIi1f`MI~?(E!$4x{a|bELTR=(ujAvwq>)uT4TywKER-QXkbaFy znbroCBozk^Pc-B2(m&h8Gb^B52`SofRK=VbtHHgS| z4$ghqI%}rY$G1~o)>~~L`kb=sc@kLceoGbR0nb!L3uWM=s^ltgipXEPnb+2AaZ)dyMIBBx@PS!(S(P2AQ^8{cI-5Jih?1P#ybs|W!{CndoCP_}MdP0;AbOaD$qMx| znR<+rB%9TkbR8`$?@7OkA#s>aN~VQPyzd^04_PYtptF<6Ta8kouh|WO6A!dhe<+v? zqptwLHrfp37-%=8b=1o-m9(&vgW=-3os#=`tv0G{J}_Lb{Y>~Y z7Gi+V5#*g%br4;>KqJF(OemPMg)w8OP&6xVz$R%ukAgjc6(=T#5dMNX8ZV@63@=^q z;{q_fgP^koySB6Z{n#1~IKAni{^st$v>d@1$;wRz%AU*JERm;0*(0}^zk9CU5($?> zIblv;r(1EMNAzbUH|j~&aDh3_X- zUE9rm@Il0SpJ7x$M7YcnjIRgB3AWuqZ84a4=-r8btFuSR98Vc~k)i}iu?Mx>ZD$ef zDO7nb-sGb)BxP6;JnN${ClX-;S*&k@fyFj)dj6L=fI@Yh_cq~@xhf7#)W)j%;OFWq zUxe}QbP?aw6!}E-EmYZjnD3G;18l^W0-k1(`Z7z3eWc@Uo;ws4spR%0p#{rOcN4ul0wKF^0d%2Es zsJygB$r)}Kg#!v0c^8%8W15+zyR@&Ri}y(3aOj@08Q7baVrmvL?|g_{>N}0s;QrP~ z5zL-7t8-+sEC^^EBU0*E2j3u;sls??q-Y+%&Qc;agl^`tXV|Uu45c>>fn|m>GVMK4 zw`WgA&c$p(^8qxO1)&5kKkK`5aH`^^mg2;HKIyWtQXN1s%$}1R?ZiPJ6lL-b8wKy6 z4&~pfpPR*!q~w~pS_RExypybDd6><=9&oriP0-RlHLls!gVKQLwhU%{?v*rN ziJ7CqFxBYanGwZGoqzbhRf5h?50utdc=9I7OAA-)hAP{%Qh@2^ZSbC_EdQuJs`RC#gIJ4rZH!G%KY0s+qfsyh>r!jnv>8CQ^C%h%2XBFv2)2WZhl>qnD4|j@G@=aE#)K<|5PZ-NS-VlCGFS0|py%GDiyGyWHTnO#L?Jn%NmJBsEbLS|6gaiic=Od2`U%&}d?tr3+)^VaNgCW7B ze6E8KxXLPU#Di!7cChnEBtA**|(T;iRMoW(K8Cpd%uPIl*BX-VG;McyP?_am;B;IxX@P-Tyu6HG)?H*;oozx zeCpqYaNiXKO}^F3+9k~Dp4CMtuuk^cpwjkOJ3+7I>Ai&_s|}l(L4zh<)RsQWw-|%S zQ_^dU9-b19J-hbz$TYOw`s9%p1l#TB+fH7Ct~rS3E#jtq0yE7{^Q@rYetv1!8 zvP-m*4H`38U9J;6NcA#P(*cOe39w4;1A+W%IHN9?;1Zw)U9L-kTm_)aWmtr#0P*rj0B#TMa(R_&U{h zkVYq1yxAZu1EE(h4)ks^(v^Sj5uZX3JnqbA-L?8P3&_`)g5~Rk$!I>R8iy=QiQ5Tk>Vw0YA2Ai0mCUKS~(4^{%$WEul zg>qYpay(U2^Z7F(&-~^3Igt?teng)R1H_naRnW;6w`ir>@MkA_!4gm31Nf7OeRO)@M?KEU z>^z9b)J@rtWJX}NsoM@w3CwyYLPgtHTee}!$W&dM$UM48cj{aVupmCX+eSR3}uu(Q(QueuJ0-XkwMH{LFB>oXr9v;8Ij?qk7 zSX}ayrt|W_v-e=WM7n2#a8LEQ>g=u-Vmho4t^}-P0$bOvo1MB+0x!FcExX6}@`7fK zeXSwJx@c!(4_k5A>6O_tuY{HsN>pruod zV{59p54&Y_->+{{II-C`D-SXUgzE}#6JVB(0XD!i>|iub%$FK-FB)pMuS z2YMA~@kgR^aZ!%T`fvqaup#A+&GD|Sih5^y<+6{=@o3U>9a|4z-A(!VohZs2ntXpr ztE}86k4#T)U-UAnw8pS#2=HPeN9~z^>G1iIS2k{S|Kvrx^}``}R(F<1$cVEZ8URYV z4>*mA+SjXM#ln7hTD|m$4Zpz+l{O}GD(2iMiW+Ph2|&eyb{nai-XOY-3TB8Mc&CpV z#Kd4TBVrQ2W8@i=U`Mf_Aw5kD(FW<##-3$%IHk0p9#0jOQL2^EvMfTSteuzCG=Dnc z`y>N>ine$;0!vQqQy9Afw0FVJ@zc}T`~ZO8B>KA5@Im9 zY4WdF;6QUE>htpuGK8J;CuGI_RG}JvVhJ?Gd)YjH_x)%{sfRZV{le}+5Yvh_)0*%R znnf9s%|9lh{EC*B#eH%)>2TfI794=*8_PF1`F#Eh?C=zBRY=u`nkRTkC|v;58Hp_- zy=R-ZMhKr$9s1#jUNiM5 zCL|;SdmAs{AgY1ut4X{0`JKcqN7Tc$DiyqdzV&$1kb0d#-ywIV>28l8%;p=bqy(b{ zilmnp>6jWrcq@1tjPu@>AGQhiARuz8r&Ux+h|i6W3H@rv<~TlX;zm)}9BTmfO#4Rl zubaD|Jm%YY**(Ld&8Djrmo#GVcHn{fnrKUg59{PVgjQ#x$Q`G9t$sXHi?*VHE{s-- z^=_USYyZlv0%psA@{MQ9GF(3T?v{+={0)b(5`|n}z}IJ$UqH#5x9!B@=822{b9k9G z?F+=xj!%LAcDx}26AYDhU{||Btg#&Myi{*Ha@6Oq?5p>HTfm77g%UYrpA7^prI!br zdT^KMSgnPWc9aCe4KGm$SmkArw7Md*a_BD0DkOv8Ng+nm#8|B{eZM}yq*6MfHtm-D zQ#!vgImr2*F!{|BarKM^TK zC*`usq$s{m$WJKbxp5dGX|PFf%92)!%K6L#p4_IZ}VM@{NK<;eVA{p(2o1#mh3tXunE$Dn^3 z_J_HD`%B>XmyNhM{>?^QO}guL2OkW2yM_n}d=`gks=HPSVl)WV1Q^l*X$0gh4j!Xn zUJ^%S-XfILKI_-wuLD&M^Tv#79F?W|cf-EsX^aYm>}uTaWv_X!s%$SjSURpjRqPXI z21|O6#|`6YUKTpIzs|3YfqxmVFK=m>w=8j7zqXgjy1Hq-zfD=bHNUQ@mbh}f-`hUs zo?X~48O%VPpBLNVtPJ*)H#lRgr&YVzK`rFoQ2d16yi(wN9}(zzd;8Y$x=z^Rr<45- zRsodQ3%!mvVkf79yTChw;C->>koFVWxir);D7Jg`owu>+68Fc1q26YQNlggT7S*4hI-dqKLb<-`f^Cifs)u~j9=b&_&#Ncx-Qc7THrH~n=vM)%1ZFNzPc z#daM4DeIWK7FIT)VRHt7Ead8?Jeo?XnM!h7bd&pC56p8u-XPrbxc55-H%YIaEe0Xt z6p806+o~au^%^w0^Ujl3nb4)}rj9lF;?U9AuA65I{;yIX1#`RC@=Hkw=0r8o3}LjZ zLm~SW0c$)X<*@!P-ixtSv|y@M@?QE3k&!D4Pe~;fPL@9ZeEV+C=a1qcfW>iMcA#2n z%eqL#5o05~D^FM~w;e}C$0u<5xl-J()mA|>T*10~o?$b!E_+C_rbrV|V7bg`lm*m= zi1~>Fx+d7+viLkm!`70x9-uhPnsE`60BrMJfHi)?5ZL#u3j^ka*bCU zd(rkzTX15XMo5vK1BN+K)lnQD8)V92?}rP33Q%s)Jq85-{B-b-XbI4Iyni9O@W@ozuI9m8G1x8s!TGfyOI7R2F!n;T4(`d3S=W^bp)Vnu5k&`i(d zeKg2F>wZtgh32(-Q&D|!MJCGkFoSeG8hE{_eO-9smpPjMv(DuYOSUhyK$pTYOCWV zD&5_XwER=#hl{a8Q$PT?G=#5fhoEq|uA1il#TBTSbwFMPr?K)Hl+zI{4<ymIm3glecM^V^X)939Zc=TbjQrNxn|O{oJ~TJ{p!b7Uf)v|_u}A~amd5c$y3w{ z072AdhYvFFT&-8<0W;*M#Vlfv?h#xH3!=UB#7;W1ZSx5K?s)7L`I#cnH}h}RPKT

N%A-&mdhy%ZaiW01qR%t$$;crk zIP&K$e_lCz)v!m77 zGzzwIMAnl=vOrFM8hKaS4!eMAZFoP0^MYo5GU}IkWn6}R zq6RB>W{0w{275ocx6&;K1IG?w`hryJ=Y^%Fhst6oxb_4>b5b^1z!&l*mY-Ik@bXc5 zf%S=au{q%3wlqnJ+D0z#Iv|3#b^`LT%1j-pgS?c2Y&Jnrc=SF6;{aK6A4L$}*0hH# zRc4!C87rFV$^Ql#<383MUo!!4pg;arM*cDK)RXjl=z@Z-aVVt zrtp|BqiP}ORrst~(qLf#XVAd9eSiU@wR_b!nCIQ1(Jt2FE>l8QyEt2c{+tgbhN9O`T`9`78 zNiLdwXQdf1TXELnxmd98IK%lr4x*OaGsi$7>>C&fM%$8@P5tF zo2(ECd$g9J6q3gdkRIDavJ`EFJK*H=(0W2GJDN>-oTQm?ReHi6*LE*p{PGo9(q7m> zpUB$Is3ruL18ee~34oB3Fj~8SP6pz}_nM=D_+iLoYJHb3t;j~Z*HP%9B?m;OH5A7< zarR3nP|fBuC$tQvLO$k5ky(xX+8|Q&51+2t15u`cf&i#}86%3hm8iB~zJ(v*y2xgIaV(fxq>F!8q~6=wQ-WX6lXgE@Rln zW4|`g`(5_rB9+GifeFw@*?X44vxg(T z>PgfQn%pilg+M5ZxKT5APpt)YwHt!rtVMywrq`XsiBvjb$n7kw=&ndRjz!R50usLP z`SM_EC_OK|&hY$(nL4)I`xp+Q8NV2Zx0pi3?u6iTu8w0}CEK-o}^}7iA z($wDmQ5a)j$r;2&2a%ir+cZGrMOQggA>7#ou0!q{RKB#gFFfgZzD}v>zsn?phJQ&- z&{$Y`R$6I7`0F;`P$^n8TP#}?U*nCqtx&T+2ghSPkoq&UwblH$6ShrdyFu+z7ZSQD zo;AvSr2Z5&B7vGzCMlg_&jG* zg!F4?IAUFgkBZ84RqyPRLtI1WUzpv&Om$k%qmL$o=@fqA^nz}Y)z~qDZaqQAq3sFp zO|0Eu;5ZIlN=!%0 z%*-s6n3<`>%&HQUn3dR>eVPepo<`%7>iDcV1cN?xQ57qNy zd^i(@1(*leE0?T$Zz9TpcXWC;y9TN^!;jF3q{XNsgQp7z_n^2yH)CemvxsSf)Qw|o{sJ5Bi>KSE^%Y!UVUR)tG z9B1jIw+M0G71=6m5jr?HSZx8k*+QZrClu_fc2O*65Lh=!Fed0;sz0eH)nXA6@a9)z z>4M_Cac3`u(R)+h7Mp%WsZH6@_3)0ydKkYA`)bPY=85U!h?sZ6YcS|KXm+Cv-8^lC zH0oGuQ2Z$m!%2y`=`6hg;DHT*mAl_R4$_EEL{)J82{Ry{kwlk{N#`Xel~Te499Oah(ECFzfA#f{A=*m z?+EhWQ=0wW`j2P+B?X}S0o?6A2#DVlQDT4(nErdM-QN)WhoX$=k0SH`jM@LsQ2#%{ zb&kK(TXFomdaI98uB1)Bm2zbgFztp|9l2scyw{$iFpmVY(E_!Zp~KM9o@{L(7f;|A zMx6L{Ow4IKvfE)bX^LV%OjedRHs+)sn(>tLT=|@1d1Y7Ryuht{zPP|&DtmX}vM?{3 z_w7pF#YdT1wXJbshe7^3e&G{erIELo3G$&%dK`5MvL!N)y}?cE<}}6*GaU7iJ%ZHvBUVpi1l3SIqvuWE@L&mh=Z@%saFe)@ z!FHDGLweuFOX&GM^-wF5nkRzou5qD@aXA3Nwt-V#opYSYM!hL0b1}oZf5O$Nd5foN z3Nu3xZ!N90VR(O>fRHajp`k*1!3yEd!KEu6YmMC>9}V)9ql3tETmO3|R4#Wwjqxo| zy|}7`V5k^S=`=C*T0P#;uqE0B29U} z)kOYHLcXlNgtEJ~$U)Ek@QFJ~2tDw)<>G_1;8kOEOGM+v0h?M#?BaNKd93f(xb9+-UMVU^DmJ0Tm_xkyY-wet?q+n$H)xxY;Inw z9@pZV{7d>m5SjTK(k%D)vhZ^eZCCc8&q)3ErH!^w>FFX6P$W~YbnGn)(4V<%%rrQ~ zaG@XV88lp>8srT3pixu5&uZj>kb+?r8X!8F>|$XR-G~gr7>CRbD`141lQSB|B~`cl9>=CzNX}c9BfX*c*dy`L%a(w--^sj}9sf zHDn5)Qot(dhd#O2GX=a5JSfE+IuB)17TOSt%An!@ra!(X%G4xZ9RS2HvW zPqJ_F45?^=WKsW+L^E`_^4{qCnIMHt2t2tAL_?kwxcbR0+9`_Zht^R11!R{7;Wp7sVG2FLklSi`cs2CB( zCQX}8YcN{|t+B3ebVz)M&20@}AL$-N@Ey-SbXwB#lr{cHaZMI%`@Q{5h?3XJWH@Ox=l;Ftr2gg)G3%Av!dG79i~k_-v?v{4g@} z>Fa@aK5dW)9(!JUAvT_MuG+MAn}@G^+{sIam9wdidQnht;;<`e6J3yIe$qAsq>V+q zLLhe-+zDSi)<_4!kmaaol8I9MwHA}PXgxt%uu}QtFnmr1HJ1eawF(*q+4%A|CYYKXvd`f>y(^r`_`p3K z7LuQN(8Zh0=O9v1i>kis<>}~5MmHjSOYKVjnjH+fX_Iiq;(gf%!oeGlI1E0jCGLk> zV&#GemWEvRi0hOo=S8uQrqD_5hFbBbhHNf)9TK{l^w&ah79-ZiI~;-;^!TW2N2U&ZaQ=zl$TZtQ_^b1O=r+C7v~YS@o?uZs=^|@orDmap5rM z!hz>a0Zs{c4xi&6?(@G`Y??}6Tlf(->WuxwtW+=jk~6)oP$El~{*o?RD%hK^c)%qA z3!el`mq+y~y~d>tdRGb)M80FOjcTJ64smj6#;i7qqq&9ehVa0GHO~w`|F{`Rdt)0?K18?-w^jNuxB#N{77(`wRXx_`l07BOtYsS>e{ zjqSs;YAner3}<7H_P*Pbduk&HKj5MSQK11Zs%sKPmFjN9n#*`ZpzG+lU5ImC^2M(` zNstaZ1Pzi)8u^?ujm)|hO)*+Is+rxpO9RCQFRK_3id&@-!8Wt`1Sfo1TAm7*TYLu{ zDi+<5FMRX?-X6IrjC z=gf9$u}|=f14>!KfRn%ls$Lken;q7J9+?YR23as`W6tv&$UmK_C{@f6qIuTc)fTqO48nmF2%%_1PV_miF;J0>5kQRn;0lh2|)Fe^= zR3;@zc5zL_1`iWqE9%z%+6RV#f(PHW>D{_z!|^Ul>IjdsEvtaVh1&-yA0?wqHpH+cxdt=>6H@s>c~jkH$&(4lOH7?ec<{UM8_@h zCGq3_sycNAfKXbjB`=n9U5L=B+PysgldgUDKr*6mkmc)Mhe;z+bfbd;SUjgr`{cDI z7ah)er9lAGV)#ZBEJ_!k(yuSCE4LpcoeaND*gP^Z6Pgmao-D{5RMZDV24=waty=HA zppNPS!{>7<%-{?H!?mH!CZQU~FVrgDDhumX_}oKns3&jYvNN!O%OL^jfz_5u3X78fksA1QX;Y+HuG}MqDFgHL z<2GZiMY=hV9IEq^q`jaJUx2now<3fHR#f~!)g9LrVYFZcaeCkTbRJNkHH=$FCw4c1 zAffIZufNyuoyIgHJ9u2y6gK*V)&jR-?LzO&3Eiu7n1|m^<4b7m4 zdr#rkN(dNA_@(vB$UV)#y#BauuvP6TT znFpph)Dc_@`;jf5rP689r&h(PWLBz%a;Eiw&3F6ra5t%8bt+sql~E#f`udVl%CZOV z09n)EbKGI3Z`~A*4v90+t8B?6v7vn(wTRl%3hpc}}Q`$esgc;!^u2*Yl$J@#Y=#lKUTS#2HT& zy=O8eR}^u(8@qjSbMzuydCK!W>z_IlQ&@Bg7F)PCN!*!`=i86L;s*FFL ze-VCrAz9h~JT?AXemTIu`sIFq`~JPD@q6q4>(pS7wE0j|2oe45DE#-MB+>ts-GKQ^ zcH^Js&+jLHoe-{7+iIr7cc00~I5$vILbRDaE!V(eyT*M4hLf-`~Gy zWI;$EvB&~}jvXwdK-x64FRQ@ez=%WJ#qApLb@trybU@_R3v ztGZ{n_;z1qe~ zsg~MkvdinP^ES%61Rfq^^+eMs8SMMaV9I%gy>n2mr{d>ybs*I@2rS_YE?N{s6JZOi zKmY~uKGLrF6W*_=2gz4|l^t8B5q$9DUNCjjR4r^AmeoJa>U)2Gl68a~5^RpK62j58 zFJfLb?jDIM-|FImGtm7Csei5i@JYK+>mbEq)mtBxff=cNnt~4YzNMFtS=(?GkEE~E z!iCxiNE$nxMz-?Oz+%COZp&_S<6?GU$Duoo^6O6=wF*yQu=unC!iU=GiEUo){I?jkw-~>*sz)~o?rmDtG}b8?U_VI|l5NwU#mw?9@v70@)0hs2 z`&PMcJtIx70icXXN1HxfTkUN~7bzJQm51c;jl?ZS)l4Z?JXRvEv!YsSwMWw9XF9f7 z5Uh*r(y%^1CB%(KS+9n7J_FNf8ZX{8Tdaeg0s9@*%1IY!c|E_g!xyMtKHN`1e$TFD zo=}aZRN<;fFFt0rq!C8u45kNbM~18Iw@>Ey>3k*$rxiG|1f7OyQIK@!*X}U1Hb@)| zi-gj8Hz^+zix(-|kGHi6r=@TT_e5t$e(y8S6Cr%lyd!Sw>(Xwf=U);eGOVnc4FNGJMpT99wr9CQdab- zc;WY@0h!_u&=NC~P(B#OY#n&$*f5=e0OsG;NEg&QQR$5V$F2IgK|>andt2^Ox|rce zzdR}8?eO){U1~tsF@;O@fV$edV~Yqh$L93l`om7NU{O&r3`KpIL9kOofuf1{-ilp+ z(sF^J`t8tVBhhU|_Ox;l?yg(3G>%-+3alH`798TEnCh9L@Ert1y!(t&9*o`{hozv_ zBKqtpb~atjuzjR2Ro)D~eYsFCo5WYX-4emm6rd|pC?uJYPcSE%y_FGhS6V{WsCEFz z;G_Hsp?6Ur=qzmdofauoT_Vmb^3Un)oMwz|xkvNtT?#FGXeS`99I%$WP5viob}FgL zLLK9J5=#w-j?wwNxl<+6KT@8*r6Z#v)i_LE3r)vu$f|u*^pRh(*6qn=TZR*vWKE}g z@ZCpvCDxjYAr5@3wk(v{l!IXgX9+2k#hZV8lSRWUN72l+N}Aaa z&sZgF4dM_UlM{*;0bY$jyf2@a$eOd3uD53u@GqsO_lfG!mw;j5Ef)>E2)E~-SUJNw zW<*HWuA6qum%d8&)L8MYxNXclW~Fb~rcTJWAGrtd&45eMHzefp4UMT~S~SEV7PX2| zs3uAF#YrO_nC!_lwITg5!ZCYpKT6A=`i3v#6aO_R0>{)LicJg!*4pfa&08!c$GjuA zxTl|vA$b`55XYwg?eZq8%9B>}|oU|9ZzmK)0Z?eiX z5mK>!{AL~A8TP=~4_=VSv{6^Vq&RG;c?0=*U*I7lQ4z+a(6q~o!1}Ja77eMtd#`vf zGtP!WMOF=)ElPN_0?E{;9My_`HwBf@??9&ISI}j4fK%9L**pM&4e^}&XahFzXjYh* zhMGg8)Nr)!YU78EWQ{vpKYDEm-8q}GqoM6A1{$F`vjYFzDq5|Ka44y4=nnIlE*BpB z58mh*Vbx%rQPEpgU#+k<1UwEa?CtqrhaeGFje2~2<A+~ke6lquFDLx-%-tG2%Fl0O^cO%RF>&0f3tJk!9i3dPnQNjkn zRX;cz#xK-qH9_17bS>Med)aC632ET?U|eWy%bWslZHh^h%|zv4V#>xHFSUB>uJJja zUczp1lk_|^mNN3+fz2a)(H=y8W>=|2!7E1F!7o%I56E(r?PLq0S;C;jBOQG_W=&>m z3}?H03k3iE&~|xGi`F_)K5si4dl&8ReXA9XOfU<8z>Zdo0`lzg`cSXm0yK3%g{hPy zb~{(v*LW)~E}1eiVxkp8siz5{mH0b&I<+qm_0AyQrjj7l!rKp(H)U@8gr9T*BlCD# zvDUeY$*1KNZ7FaSlb3akMu-D0vTD3mUQepPho+^BLo29@d&Sf-A>Gp?=Qk2^E+cprapMw?-pK*|3m z>+H@^ei?q`D~ToSGH%6m2TuJFp^vC|PX4)(H4sezap>&_GC}>?SWi@!EE%as@U{o1{!fcR{K=-Bw~SF?(^7EfIQtjmh>%}Vf%$q zvDAr?k3r7L`dBD(5=$ydsKxQ#CyRB+t)LgL#$$ynAGGM)Y#Nv{47cQEwB( zlzHiOx#_UC1Uk3dAlDgAV>gnoh6w6+ z#7_C3s~LinH#$X2hoe8`TuG8i9z`+MQpq79GWzPS~XuduJA>2hWrhwI#?RO7r zT&zQj^DTA$5r9>Nc);@G$gzSYLz`ut5+&cWYfDsioM~T4i>ii zOwfSJEUfkg#UIPb;my&Ud({4=xegz}*T~(3-dE#P5g^HMFU>Dl#wMxCbgO=fdPx`z zMKM%#Jg?or0uTgEo%V?lII^O!`{aXIy;?f!cEG%tqN@oZ_s#a7O}DYXsJa_!p`|@s zGI3&X%sR(3gh9zd^FUy6ILn4xDU;Yc{~T=S#5vD~;wi)IWiyLLHwHL*RO6txKruq! zzbvr#cGKHCt@EKe)QDW}MS%D0ewqe(qrX;F-j~J^zkt;BUO;O`VN{8cUu}-@$BgT( zTw>{}0K2#93B#Ei$1pI6TuT=O zol2`C-jb?ziebpE0^`1ZbQHDwfj$M=pFMOKnql&k8N;wGmzR+$`U79T8-L_uUyeJF zf8rXPTEEvdviIl)c4H(Lg(_z#r5omf>{GG;wEN~0c;g`Yl0A=TteUD1xSIVA`VT$e zNDIj0Z8{p>%h$lTxN^=s{BZ|avHnay-+<|QA`#ImE49~djHZ(YW)SP!;l*SjXxA~j zK-sgE^-gMGf5~bm7~;*qQ zT^8uTcr=#29U$^$5VO7MYTYS-fnGo~q5>4PG%m~xvMlD*<~6cTF7|7gpb@EnTYwf` z)m{`d$TQeijA>e*P6N_gw&l{@U$oEc-?i8)#IV=LrX0O3GpTH>O?H&2nZ14E!rI2&pM1+eg@CsXH zLoqyd4JdXdt7FvZc}5AB`Z=QmGS3ME!e>J%i;4nX1!|qOOodg){%u1 z@TXKHz<)`A0{-sp_;Zmsz~4L@f3~aq&LI4oEYF{rrN7jw{QqZp{$HiI0zOzD&cC@% z{u8PC`_+G8eK`M4s{XHYsQlis|HS%m{zhm0>k$4TrY&+jR&hw5t|`3H)4)|LJevCD^GoLN1POaa2w?j(2BIoO%!KX54BkW4FW%+TJiMSG-pAu zo2Cx9VXYWFE2N4PWqv%{cvaVDC>px)d1+-(-mM4a`9ADCV?5uKKB9It$dzp%v#s{0 z{q`!<;X29AY(8{ZkcEZ(=jvs8f|Qp7R~l{Bht%p!6i@#|HJLgLxM^!UctRmYg?rbJ zpO*x3B0-HW96jmDiWZC~I3egT z_OYguAL4QLqCZK#RV_f(xk_Fm*#}v&Y#A$8Jpoecne|Zh| zBnR5GGm{mX5aUpni_2!`fAM(l(B0&*bsH5@a-FY(5cR4XH z43mDP5py%thqWK4Z;YR zXohX-%a9E*wJF?Qrog4ZiUZR(l6zSv1n2?D4f$~{f&_GaPV|7|p$j{y8`&Owvta;* zJJm#~ki|n;$>Ee>)JB*z35Ne+S5kObt>7pRac!jYeiS4YJKgpRs}VfOD?m5FBNOAM8S>JLrI4a!`z!U9cpNJ2wY zHOE~VWHp};`R5=_JXvNQifcD~9c~B*nT&a)5_xy#+T&w9Fuf%B<_0DDzja2@ z12_ieMoc+ucVxPYJxGLNClH>Zkd`fb#vqWVD4kG@+YKWhFMY;pY@A_w%k5kT6|v@G zLy2?%uaYkOE$Xa>y%)2U*di7QXhE=vi2o85A}h}8cZbh5q@XjyXRMYKBW3!4W$L-S zqory)j5gDp;gvx|MqfLLy}HkpoGj{sZm~vnZ0UW4XCi zSb;*Lg@!JQKTB;dbMq*YQYBvX#2|$G3Qi`gqr^IKh4xu*4c*GNV2UVXBUb}9k;?Ch zwys59yV3k1H(rN4+pwb4{JSN0VqVI?jqUY&gjBSSd&t^c&A zDd_?0Bw1K?o0NY1-gn4CFS24+@Y5zyIvux1~T= zBYYmE)|>Po^vTRD(U>C8XhFk1lyCl|0{*m$kT+Y~Na%}jdMJG?WNHCp#z@S85kQ@M{ils{S0-8b9gSOx~ z8KVsWnAoX`rTtl7%iFfyoIQAu144Ihxu(>lxZF51x@%^ua;5;Bnc3_BI$)f@$$8TZ zZMtt$W?%JHOnCJ(z`pY4IvZFu$DH$%R{@DI{LR~L7V#05#TB8FLe|%t;~Lm7j&I&A za`mr@EE-ba^#v?p+M_U^E?jQ7gE~t=bc()eMUJu^7q0tzh^ACZuxD5s3V6_jX1ayy zk^)->Ur8_0Egy#C;@}@bHzEu<^#Jbf9kTT}kH=LKZBM8^ZDmca4kGuU3bpg8#Fvt< z0L|Z-)L##+GOe0Vdri8NlH=lzalx+&Aq$tEvVICBAt9VL$Owy^l+80tuGz9~sX(tZ zB1y8?hX^z`bU~F+-<1h-VhhX0xfC27$fFC9Z;%Pg!aS6v5?wT02IplMm+5Ojro3&J zSh;oh`t<3cJ=>V|WZawmzI_-y)VS%OZv7^AbVg~17p&`Wpuu#VIFDx#y}`+M4i)|$YKV7DSEMTq> zJWF`^)%jn&(dH^yHADAXt~6ju!0^gz3ZOPt{yy*+RZ_S(+odpaR{nQXx;vK{C#H<_ zWmum#VOQ6IjQdg)Bi8#){Y~Lx4ugy#bzD-vLYtlWFVxxFL@~K_7k>6n`4Z%i-rHNk z;O0_kSgQ+eV-b)er!|Ywi&ec<+3g5L$_zqBO8G-23InII1yYQ4Zdf)7c~AP_)3I#E z@%fyLil%HJ`-BK>cC+^Y)z+TOvJ1M(3H5dqNY)lvP}s-1lDOC&BPf=G&V5q`WicCJ z<%V4#ag6spHSI-Z`-fVWJ7izZV?iD-ESu7g#8bG+BgAEDxgD|5@d}p5&jB+~c3Qt! zPGwpZtj8(MY|2=!lWT|4DZ|jWoN1J96&;q+ z{B|#y>6klI@{2L@UhPgGYFv(!K-cAiBFK^dZV?+=(|SpgKgb` z3=B_c64+YFUS*}eUBA)8bTwoM-?~8A3J2V*DZU!xUB(7Hue=K2+_qfO#I=cwMh|zR zYO%bEKi^OuAG@$kv%=T-Q7nJ4xga*I@_4tbtn5x5Zok|V){b3G!}}vOM>vZ&=LT7A z&xQqh?Ar|a-ct_3S^}*zzH7^8_+QrE^zYaf90MG8Kalz#rRe*?ROaZ!2sst;IQxel zpDBEZaR}Q6BbOhGV2fRkbgn?awt}F|I37*55D`H`Sp7D)$JY4Y2!}<4ZT|{5bN&X0 zegjD?%mB83D2F)z?C$?dlgD2HXU^Z?_6JJ-Q_jQhAne}*&cC<*1F!uL0q6gzIAPA; zfb#ED!GDeu{{8A7z5Wk*1n1wqA^-b;@*h%&KglCF|IAqYF$5OIzo$|Bmq1z9%1(O- z`NQ7g5D5hgKELEf_^^;m_-#-S4`7FGqlgYnr_7ETk@QrZ{{Eb`(xFb#!m@v$0Br!< z=mOyO`ccDDSN52Y;K`TdYP-;ZftvYilp z!of&S^ZMiXl>WsoNuX;YU(=afPZ-(D?7txN9eV&fp0QGykMQAfOA(d z*4g53!a`cY@wlRSzsvf3y8dnUqspKD-vWip$4+T3T6ze@8ig9jMMBhWT-85Ai~+vm zN^5roo65$rX)#bHE*P~;4wb!-K6|5;S?4TMMBJGR$I+m?>1w|Ms)54(OX9ktSjek4smVrRG+VpZ@^WzF=y!e;EK-kjX#?qL@k zzq95-)RzgQ>)@oxYH+b#UHv&mh`cIzUEb8!j+bk>}nj#i}W1kJ*n!UoK!(Y7>2)y=NH|2q}HWF7-}bTv0A(J zl5~m>YlctjwSUYt`wPHb{g=S9>u;y=i}eBg38?=1BIP*@V1W2-qp!!0`o`FfG*um;{zK)-ao;Ic8x9|4Rd(9W3o|h|Pr& zRbz;`vs1F4((%i9TN8DY!Y!J8M_wLCk(|B27j~ww z8_hLBVi41hIh-5$6y{E18C)!9YoR?pdDImU<2H9jY{bsTptVMe?D3LUv(NM2%VX%xx8XNe`n<=m6H*cVR z6;p^VdQrPNH@t1hwOk*z+)mKx^VBy5qv^Bbcu3uKXgE~1u>XE{_Rwz;E_SNrPfX6p z&ZK1mQiNLpmh$b)Fy7v^--0m286Tp?{{*G<*vnSSs95E$=6|7d|tsl+62uL=` z^-ZqNPMO0)8GD&Dwv;t}I{^oPNZ``x&LSA%+WL@Ptw^$gWIyB_!-?PUWkdrqai_p# zijUsep{^hSEP@8)%Ccj9y^>>WgoY^{_>28M--#BQwm4L1KMFN23cen;+uQ++cyD6z zS@amLF#FUVjp`YGIW~e;;5iIt(UU@{t}20^K%7hFw{J(vJdUV@Cka>7ZBJMUCvzKk zcmiLf@wz$n3gQKdZtnKaO-h#S`?K*V(G}Mb_g2JAD~1ar7F84aBe{dCQ)Uy?l9E@h zfFUf)a9DpfkWqUG%5DmnUMyy3kRloKERj7;W{Yg7o<%#^)gRUFxFx6S~Lbl1R-Y&{d7?{<8?&lJb8v4m2WIj6Qwjy2<0Z_BIZUH;Q#gN6kLZGKZ4uOqc?xq+2xzV%`*3%eM}C_at|Pj zQt;Fw;YIK7SR1#SDNnOPIk9gSt)&z=mCJ4vp@nMT1$KUuOHOK;-7n0M=)GLsa4wXj zJZe9KN%92Oz_aEkl@gb5S4>Ow=VZfcR7NX^zdtjJj~NIn z%~hc!S;(l-NmTMf!_G1_6~2Is=VJe5U6okLug<6*(ESwb8N&jgy8d~Bg`*4e&DuVoTsqu_q(XW} z(1kv@lmfj4jUcHP{~7+USu$Wgb~tnKN_qrvamrqdTk`4Vf}cFU)EKolif?26hEi4?YTE*dW(v zY5-0+xG+&Iec(gF-M629yt7SCzaSg7TBuG3*+Ij_Rgf(nG!rfH#kQT+z| z*=Y>MskR-0y=+8D7)(7cJ(Tnt(2J6CnhU&TF`XEhyQ0f!Y!5825&UAdWW16SP*cWX2@B=J~-H0~BF;kTHo|&pHm{stusrKG85JF^S9})>Cuw4wq!2 z7r1Jsdbe6PyaipDvn0ZciHEsLped5Vqo=M1ryy{jPmh0|4?m_D4~wJ`0NzU-u4a7p zbnFjj|6yR_JVAo*&ODM_3XEI?+ceFDSjtjoFHoJEFPDflhzc?o2`=fU5!eb-h4pNG zL@(Xks$o3SW&Q~w9^4|Co>&IU;7UA zjzz-2QBN2m`2{vJ!KcPZHV+U^TmqHDp5E|)40yy+THH`lP{k<74*V(m0y=73#H(H1 zQlbdyoS&(X1wn9km9-#*?lp7Ll%Qk?VmiC@SwN-E@Yl;kmKvPf$g6F{gokX|xL4h0 zj<(wCp(rZZ_*Y?SA@^VUdYGz(L=Af{BcgInEfmHJ40KEoCvm_~Y*h zx{OBi0u_H$+0`M>bv&P96g?>3MmI=kNph#NzM9W2sJV(z!qlTF2o97OYxrkH(otL1c%D>80^38Fj0B-8e;i1FRd`p7(DM)aG*V@PEF+HYA zatz%1P|J(Fv9sqZW48ou6AxLTVWJr+7AA^k8N)|qkZ%gd14&?tNr6(* zvqefI86HhHlWGkWyEr+2_MCk}A3M}3KfBv$RfLs(!N^F+e=)}Gmb4e-3_i<$TDFc` zr5~m=0e1LiKwP$f#5so-;$z*my>RWWA;Wv3Va)~C&~-|sAMnT^1)tuHa&!tfG`4mp zC;58aQ0jmtg{xSG%=qzT?D~ddd#g-FyBR?>YaxG%ZdgE=gU)ENs+ze6*^xp=TUM&M zc$z$vAh$iy;lCqO z=FrEoC~LjTM-f}X)2Zx)(^rrHFIW4#CP)F&wPRib*PuHq+bF%+$J+MQG%mfhUlxbe8pi8$+Sdk&Fg zvj{!?%foS}rIX!{Ok2$G(v*I;KMb zW5}08_~ubh#J|WNyQF$p4u^7RH3GZof7InR z?|f|l=-Zbw=DzV(fsTAu9-z9stW?9P90F$=NiR;m0~PW9_&5k9M44lxtPsy)dTZbd zrPvDQ@O9ewkO&2w3$`QTJAZk}&ej15tkEv_%rxjB`Vw!1141~_kTsO0C;FDnw=LyPKfNO5*OXrgTdB!;HRc@m?|@1bby zEDHvq+puB(`USq*d84M>f^(!&F;sb18;)G<;}a%x<7}B?A|gX9Ubjyk zHeR-cbvvhn0Oplt=}RM3%-%w{aQ8Q9c2=<%H%f%%kV)7%A`exCPNEe&a`JCbc=TDj z9dgL-ANEyN50xuE_!X9rQrda;MDNv-$me34@Zv)N;c_t9nYgSe?Kp5Y8f9Ol%9QF5 z4NVKHqz?YXCxQZKepB&&-XcO#OhwxD7?hr=6N#KT(8`?<%qcb>Re}c%k!6#2o6|ONuo9cS0y_9<9Hi(Edi0{Kf#WvatM_LiVJqr`+uZ8Vf%<^VPX86pX#5rCx5&8$0+{6NB!*;K^T*v`b1h>s7($=T7=&<4gGxI$aj z4sQg$<3*jdnoB}peeF&+(*O~An->f!umOA@30zFua;z>z?B}h7oUi%2yq@ZW#3&kd z)AA~Bc|b#!#y)AJclrC`>!P<6*XwDrtx#3^#PVyNCWjxVO_HV8M+xDs7ygIG$jOF9 z_M)YUsjk6BD;1~bmZ!sXW4GCM)d`2S%XhEY*D}sGtD6f}!;bUSN*3MsB2He)nq-&? zrjD(*5RNB~FK>1LKA&F~8=+lY{5HQ{ckC!9jxVcW1;F`o$_{5Td-Wr(f6cssdcvU< z`t+ZzZCcsYaoqb|=#~jHYoxP38dVQgQS))K+l$&9A~GibtfT@CazLL8SV`Az|Rl}BG_>A1AN&CB~$eHWmch!o5#$Jr*Qu< z6uxjotjH@gh;zRm$5Xhk?d+qx?>tn$u5RpN{5*f&ga`14l`~bsD+a?{$jasH9rMpU z*}JeEnoxXMgt*x^;U05Uke6p4s>NFEWVsV`v+sI!G@pl4So^x@R(P1(j2#*oTXxro zZh%ShQ0kB^6{Y$^lN^Xn<^m3KwBIa*_9K}hkJ{;u#K~g%H2p;pBt2njm)V~6Y$m^S zKYb@KBT|pl2=2^B)w?-Kr6Yzrji!K{+5*{Ou()Iw*&^wt;#77!ie}};UHPq8&Rxe7 zC%jLiK^{-go-iCs$)fyb@Ds>gqgXvi|BwtB5`Xj-SzP!c!YwIMssa~Pe|Z0VE~|ri zD{~k0xI-ok1&)8;O=5okK>?SvHl+k=y-)pv+IPf>uZjq8lO@qk`Inv2Cn?vR=h1mn z=}KZorgp279xAvbIBN_jEEUYnmY_aY7CLt7r`J-wc#$_{^SsK9zJZ{fqYPTHFvrfB zYXuX4qdq@{4Od<&BpY?o=RPWj`9&YD(*KXSw+x7DS=vT%_uv-XZEy|l?ry=|EfCz@ z-3FH+!67&Sg1dx3u;3&(1izDn?6dd#?(d#`&Ub%Y{?IeCdUbVmcXf4F)l>aP3NBLC z!|olC{!3GraDafum1uHSdweeS;jwkk=ei44vbpDnp07Rbt(L<@>;M7Ru6F25%gf8Q z6ABNmyMuU_sUIx$On93j;hIgwhKuzs7l)`iKVXxP8a8I?ig8cLX}@$ z;tQxXeRFF|7NfYS4UtYH7MMT}g&ydq*;1C<%aG6xlvD<5+eDWu7EU{XD;Mh{Mn-H~ znH6KJo%!+K*fd>p1HIa5sX~nxMO1WtbvfU9{!QBDJF9fJZOZY?gyG^$VQHrvN^Kep zi^N6Xt65n5^Q-m!$pAJv^;WKs@ZS6vF31V%(sP5Nghp#nT&7BBu(;eZ_32KQo20n3 zaG-n9B+(H9oK1pH2O0}55tSH@p<^Mc@a*msmg-F9-w$Q9mw{?Tqos1dkDD*e71z3n zq5DK%s+3UnBjVt|QW?kgb7(EA6S=Z|julmRGJoF#^`8CIi6pEDuSL4fdHfr>YGbLi z2UZdQX6%Wh`uP%+%%7zBL+`%WyDUnJLdszBg>4nuD>)*8Dy+;0jRw^ z{BF5Fu7JX5&ioOsdKz1XNjpe6C?Kh%OIqGng&9}RxPS_{QY==CnkNzes1Rn5t*oh} zqEbHuRZ{MDdFt7=4!9MYx6OvR2i! zX@=(69w1!4k21&)R{=GDQdGBKB@qz~=wLZY*+0yZK4P6>uCy5?i)G4rGg+WACk`Vo z1Jo~msgyQLdx*Ce#LTFwXZzkm@bj18a8^(VXswJe3Hy{v1jT}qh!G3U9L@NoCXF)9 zoYf&xWA0wRiilKxC%Ld831$8oPO^1xsuaAI2f%W(OHilQV!`RFjSgn}vr4*6`8<~zxU3V3x9eYEmcr!56gfFgx)#PhGcTQm??!0cRPP*48H%|`3IVk37 zPGV2lpkdD}zRKC^sr;kCk+}vUE|Jqv;>wpWH}?2Ul0z3N6%f2g$N{;h)nb4lL!$J2 zZlw$lS#=}Eke9D^wf2ce6RTriS?IcuAk6P_%SI{D1VbPFw$S1@Jdr;uxe_J&}sg`0Kd#AqvVLp=&Yoaojrt&b` zf}8IL2ru@XU=j$4@!U z`~`4CQF&I>k@3Qxg`(t*)8H`fgr|@_hRYJljv*>@8Q!2`C5>FFUb3J=sLgeMoS9mo zo8sHj3RE^*MgsED3U(^@0S^e&F9e@FQ7$aouwo89voZAxz`T5Et#3BSioOMkabVP> z?uV|F4^UT$<;u=h=oiIbQEXG-eIBXH4&q-z+F%JuzApmu9_85|s9z&BnRhJ_Bkk(h z7`^7ufl4q>Gjw|iJJic`T#d+oIA!5Q1{K%hWIuT=(2GI6nS>g$FU6-_#D__JRwnCX z>!pQ+hp2TIjpLezT`ubrO+7(ZF^?blp#YEP7FRJ!Ymrhxga5FAd6z$~@=oP>;YXED z3m=BeUm#8K6E z50OCcgcdjFzIBA@yzPY)+?anR|Mugc7JXf9Uw=sZt*m-@y~j|;4&gpDBEunr3u?G; z3Uq37z;{QHjPp0y;ks{1^sJ#6Ay=PeTbJRq_eEf@R@R5=+lQXIu9;1g%tX@aM1eU` zV~<;Dv5JSl#PoL%O{+l{yJN^!z{pB~@`sa?tH*4!EzM2WQ46}%%696o4NVXpCstEe zF?p>Sb6TheSJ%S6LLP_V&+-L(qw|F9R?tuu)eLK3TENKcBZN3l z5{BZofCfC4ee!5YT+tUJoTNlZgK0{0mAY=xlw3Vh#-e4AvlR~Jw1~`n-3_A7blo{n zn2OROBRx6WEG7Tp(<7KrGH(9g9+7?nD6(>K0RHeYU}O31eDI$gk)CYp|2iW5Qn&w+ zmjN5gZv*&`HvjgB^#2OB@P7#<$;R@xwsycjwYBTnIS>q@KY(oQLgxVx`y*d(^#e+z zmT=`03L?n!87oBci;}9uFw7F`)*o(OczgH&JO=c~>A;al0nf+A`Pukx4;fZ91vQT< zVIE%jnsckIC#X7poo zU!Gu&dP!yu>f`|D%_&~xnPH;{`-0*mQ11Z5LO@2XK!n=f38{cwyGFI5;JHEcXT+sJAWBssYAF2D{X z&f|5Ljr%JlQ!APqB9o98vc6$0gYCgbI|Q?*c#jk{RyTaTCuNNAOe3TMlp z+Mqo0uK8#_%-oE@eNd!G;@E_A$pXj-?zSfXsU%+ktgV<6@|7Pocnk=o@Fk1l&RF-s zJtIY5Ib@CQoKr1boKSw_{E{5aI|#sulE^_m5$x6C6&D05KI&&Ele2})b)jcUn?Y7Q zla-1GzLYHUoQw$L1JLly4mh&#WiVmMh}mxsJi;hFEUn!?L2A#wv9aEHYr!(>b0{cd zi(KJORU7Q5w|p*rlz?9QHk#eYhu}l>6@*D?Gzg+?GBA3FQQ$tlgujtefd?fLWgw<% z$6)<16gn;o<>I=<%Bs-g`ReMunYTt1vAN9{6xUqj+}tUbFjVLl`?vM1=q*VU>+#D~ z#(ix!4Q;urtB9kG6_su~S}yNctzlj1-Ri6T7b{QxchqA%S0 z%7=SD=!4weP3h6PW0J4%d^i&aBmG~uL?3Ile0kZ^>GR}wED@n|5}HwpvukZTlMg?` zjCFl|St=~#i%AL-BN_{f1uxceG--twVaKb=g)OOwajM~uds}H_B^mqnz7WjqL&or4 zlZF+xyG$(HeXxjJ+ZmFff_8YIL{K%w%2Ir2X8>rMpHW|`G+pFvWGcgDw{;0%t8V4y zb7e>iv))CsWDur<399EZ(K%E!e0}!)&T)>qir4J($zmu?C?YA4xmZs- zyX5IuMkF_t`mNaEpT92RLYB-(8I#CPuq`E3Eqxs+hPl*~fMf|y39>8R<0)_hEahF zicn=owk1$95IM2ef5zQn=C?YbnYbthKcX##JnC$gSkqHntIDuzEzp%3?#a17!&n`Q zYvPc07WQxjLH8A*tkHBb>EJ5bHFF7SG8d*J?Rk+>p5^Gwmfq)vjm)rsInk_R*Z0D7 zLRe7bU61NisnAz>w56!^UeStFSlW;wT5hR z1I8p4II%+cB3^((P2}N`bwvEs!0^w{FQv!*Vj2pJFC1<8VjtgdncZ33YmNG`L>joE zKWZCx#)|7G6`Gt}G1USetpZ*Y7)E}7Ug`C$FV2QJ@G*S}1DBt|Ka!dkUp*JBZyv;F zI4kgG`{=4yO4G5@U~zm7Fmj1t2n@xVdLJHPhWUb!42M5L(UQx!Q)E$y9DOKRRGliL zwC(*2s%dFNn%i%swN<$9h?(_rMlxt<5sG)pvDoz`4l=0LY-7rvPY&@{b@KV|DF~oR zk)|YOB`SMfX@sj(97mmKQESS-v7sVIZa;Kfm@a|PCtuP?5rg4HaTOfIV}V~EES{Z1 z$<@>nW6U7%;A)bKzjB7E<6qsMd#9#Y)_Bv^tNMUjp(-qFK}9 zb5W9#3(K0yNP^7ZizzPZ`;JK=xvbYuRl-cd-ljtVWpZ{^C=EUnEYGr(8O9t4+G8O4 zZ`Py2H25V)i_(|ctdc36-{2&c<6|*nFSVe~8d9@@i_;+U0cImq zL`-6PCVbhZ`sI|kE$}uEI6D9u^3LG#34DBN%OUY)WFcN7RQQeY^6a~4h3^K{yX3Z^ zSP6l=QEUL1N~9QHKp$h0t1b%n2wTfY|I61-RILP)#7U5gnLJ;@t{uGi?SL>w-Il$= zTYZRvQutY#Dkc}B+g3gvu!1i)^NDD)D!9`523$~QRbjANy|lL23hduh@_nkUeSS25 zL{YoAO%R7pJfLHR13XaZ$Ctld`??bLploE<4#P1<^)N((;K}^CG_wqqMqU#;!BbEJ zI~#OMmN*>fIF;{k)9gVn)dI0v;V+M`IE(vbXYQ`*@Fh#)yS=rrlAe)43QL)YV`D4@=~C z=wmWvB*cqq?F)MIQ^iBTL+Ctr{h1}qg1ySiSS0$#PA4l0djq59s5&In_H25P)Ebcy zV{~w_@!8MJ4mq{Y!OmV917mtqU$75~15aX6Vx%5Fg@#HnA|WGZ@(eX1j)5Kk0%Ica z&h`nkIiiqDtWM@-XBKhl!+qh8T_4EE{RRqQ&BGe{$l>Ye#WPoMZ&F1W;XAg46g4Bt z4QWzWpw2{ql0KHO)zxWd7mY=JbIRvulZkj=N>5~ThKG{_1&xasn!? zk?6geR&tz_mX!u|kOa_f;Ld3ElRMPlDbYP=cF`fM>Ah^&=??s+LcC~ztD@ zEG9{NnU%V}meM3>YKVb_k30SAmr3;s^+pcN6gTIhiSC^J*i9$Ij?oNV_AKm=x0|L)}TQ?vhJ%V6c< z`d45w8_R!X90L3=4V#pPmEyiJWAYnmwzM0N86XOzvT_61E>RE*ajq)K~rS>yW zP|CbdMfIzTk8^iQ_gb&Z@b4Dzb=^8ZfV=z8=j<*@M~2hePn46;KmnZ@vhlDe$CYNrj zOY_urhkmi&fz$z2mG9iq7B?1zYb z0<`$V7rrDWU6D0*H}_Vns7um_NE%a~y64+xCib$4FbH zVz9AP@}P|1F5nh!YcvkHgiTTvlk=oEB+?iB0hr#gHt2TIu>D@;FUB+nRj|0ng?h); z!C_((A}}&1*%BvZ%Vwl#5WG7%USS6=2cnGcY-`mU8XF7t-uY?m#?Z_)$yEe|C@0GF z_maRjYS(xSw$YgZt-8||-!iyn4CVwck&dz~yNlx!vXU$&D1}Z3PLF9eThhpVrr3cG0(K;Cka+#EH5@UG3sdI2NM3vs#Hka@Oz zhFu>^Cohb_B2Ih@lRFcu4rnhkw`^KS#sbh%T9M_oj8KZDLpd;>6V0D0Ds7{q70k!= z_2*b}Y1U>)RAa8;in?ZcR^8pfZ^}VMrOigJHx?hq-m~aYf+C-%mI17YM2bs)nMI5q zPb%x;c5=AL0&SsaH3P=FC?~a<4dEn}ft`>Nke$ptRE{@#)+&=FIuu%w($DZFTBRd3 zmUr$fR0sJr$@`(&^u+KesPeix@Q7P96WgR*!))LgUCne`^(9bT&A7JAk)omS^Krsw zDyOl60#xGXMFZ}ZT`K94ALf&g@8siA`P$}Gf~4++^IgAWjgl(~nF0OT#5Ob}_co4; zOy1+u`S+kLhn2(EriOccU!RJ+rFb1`-__mmtdckR8{xe53Dq381+2L#bU~m1l;?Bu zNn-{JK{@_NU@@x24ZoUrk5#DATrVf*d?=z;dTh4b2*5~qm46=!Uz@_6_}s@{(FlXL z7aZ39EPgW#-*hhTLooL7w=)m>uz=~0<>IR!s9_j+PRzZ|IO(&r--fH?7U-)?7_&>g z#ClsnF5{e6WA5Du!gdm3aORl_)RNp#W82gbZzqTdp>Yi6g$XoNi?PQy@R{B1X)Bm7%ZB;=0g@I|LGWdo^%fJ= zOfn4iuXQCAQ6@&N@@5!bm_DGSp5!*mar!egM~7F`A+?$uOkThhOurr*=>=rOpsPb! zB?w*`pJ_W9AWpN-_aS?6V|*QYPLk#OA}R#^h+&&XEw zV+BS>qi0PMOn$}-nJHD+N2rf^?ZJ1g+iK2=EbwfNrY1l@a>OU6I@?yZJWx{g8kBSb zJw}VnD};FPGjhc?G}iDZM}?$83Z(0#jo|b#@ESu&xVH z>=oG5JMuO=N4XNXCW5D^PVwS+`}xVr#;0h*FHKzxrYrGGE&{<4L-$;X7}g#nHh1@& zXOu*CLhcV%{k{VyhxlfL%EiAVs42v%Al|;_SU_#Cem*FJk6N*z#41buGLe}`cDRju z1?dWxm12s@n>(}1QrYAf78-mmcV*4}qj>Ux9K^x|raYQZ>7rO~yTR(W)aK_nuZY0# zT#wSd32HKQky~MBUV(FHLP!D|1dP8aeUp6LjDP5g2@v=TNYL}3bI()eV%*hf3bAwcKy25p(>dL4N#g49;)5;`-EK|Rp7C;&X#zd~gV ztB0_1IX?uxhE)-V= zw)jeH7+Az9B@oy+?t!)yg&X)_iZr#$6NKt3jDoP5(Wn%~qFu93yRNfYJB8 zIyD5mjR9{Yadeg>x-@gNV)#(POQ)kiKpW`oMz^w;tGkXOBGCxx#2bug9{IB8lM0aK5vp(8xGxe2ezX58Ul!eG_BG_k#}u zKyspie$I19ru6grdSIDTOVk>woTlfX2$ohjzO5)dEdT!8;mA!POjBHAe{TTTtyj6u zv$L`s{Z(lM{i?I3CL!o#QoZMtR2^BXzRH$Hj>`T^xo49aD+eWQq0l)S1(UQeGyfx*w640C#Jd5`Bm2A3GOe;35|uru$s~;FK#-v1wM9skS`-*wb77CckeZY zP?2q+AFFQzT!{8z9A3|xd7nZz;1V0Hz3qZq)*Cw>ZaPj4P1OdBVfBRS4{VS+Efq9l z<`tP7)kMa*ARLsW6E>m8$%{4Yz?bOpTQ?#x4T^UgH#vJyambD?Uh|c0KHVr+-{Y~9 z^^~I(*ZNu!E*chH+Eo?(Mh6?{B{AdM|6Ml?wlwg=4svH2)O{1fw=tbYH0c^sf-pIH zYfsY@-&_S1NmcK`?JC>L;VBM%gz3sp0!kW9NUOstgh)xZu+iyP{@N1#Z$E+)QX90f zSx?4CS|WJtLr^i3a3jzoy2r z8wlfFd&kEbnV}&lNNyPKSc+vw24bHg-IAD54b74mOH8Tq6cq$3fs8FuJ~QjyvA(c( zK7&|}PR*3b@IVG%ceLP@=9IO?*K#GN7S{D^9^+j+vt`XF)W;W00f^3PN_FedsWiu! zp)d%miB#J)hItw~K%Dp~OiVj+Ea61Yo2AIkJF#GOhaF|R5MU&bv&0 zp>ogfwH7aK5FC|Lq|FEss=ZUpN%huSziaTeq!-B|tPf_J)yuw`epT~Mu1+-xaln0% z<~njb**l?JO|(=6Plx27rJ{6Xdli(lDe<{I4}_WIeDWQQ4`nNgxvMy~^bEO{SnrHu zf1)^rkQuHFrC_zE=~_^dV6>Rv1L_0sq0--;|9+de*jWE;`2zem@wFgu|Nj|Z`|F7H z56^#p_DTB>&wu~-Nz~YWqLlwWe*WPS2l#Oi2GRd-qfE13I}o&@4?JF#E`DzH*JJk{ zNz-@MT?W5O%x9dwWZEfU-0z+IXfvoO=}f@`u5s=_g==Tp++-Hv5 zgo$2;cS`Ndba(dAj3PEs>Y8_rT9~WZ*yD!I- zl_{K>%sM(br&sEuOZ!FK_js#O&wadP8dl;aExvX(p$OVMNAJg}AtR0T|1Jr*y(~KJ zKlGqB8t+u_^Yv3{dFh_{@L+axGbVj9v2l+22{ps0&d$W@HQXmf0p8cmx3i|6`U-&M zj1s6q;!NLU3DlX#^yu6B+$lldm%HPTx1Sw584KM4&HOK4fWbZNJ|4cF^jqYrc|4;2 zKAZ-;l)$}RotfNn^m-<En-tw^6h1Oz#G1J@-EfjPT}QsAiehl5wm0?_9s zU)_$|9(NQ4WHF9WD+H`Zn%>4JR;;{UnZ8n+^fuAQ!?(o2sQo@t-}SYcvx|r4#pwr3$wlzvwS6CY9!5)} zJ;%s2v9RLfc5->=-rAn^(s(+mQoKlnSzgQ;`_8>%nIX(v9xlvA?xPq2$Me{p?lUrC z7J}CB1%$rmZnK^eVlfb{WBrquLG1>)HTKo3Way{}dGHFp4UJ9FRl)&2vw}hGV^Te6 zxT5?9x6yZqZh%ow&r|V0(U45*sgBm_bmObVQT|LgT(BASQ?g7lVrE1*c ziTjEw=&oHY83=52zB8H`gceO2JhR>nHD1v}9?L*OeZx{*WkbOj>d9$x&JT?*vL_Nm z+bh&{c+t^(l_eq;pc2v@R*0`@^enzJ(hRQbJr8-x2+*T5+U`pRYQ@xqSY&%l{4+KJ zUGekgdUX4(@}tz}yvR*?@n!m+43Xv+&O*rwQv0vYX!P7}BgpXoA+s*=8*8AwVnCUkRe>9KbU!=)IdfoVG>=-jND zPW~Jq(zA&v&8LL`9jCgDPuCG7Ua?;8Z88qW9xb67j(n~vk5;aqK&P#m(c2tPt?D^w z{LEBEHh_OkF1`#kLQ~&|I?1Fz>&;PM{187!A!1<1Td=YHK<8r`OSlzAV>70S!f$4FlKw~`;G?4l7@UW61el-2KJ6%LKy~3F7j0YwYDr)p?s_>9qL7zCr!S%Km4>Nx~J`P~w_Oq?Nw6hsSo}77Sr~#4={u zyelRWbq#teuyTsnNRkz9VpzeVtBfqK-)hV)N|nx*kw968CMpTTO=fR1sG~v5vxnKh zdj)%xD#(3s<7d*9Pv7Uq8=oD4e~q!A)}DPXPaTGKGE2x~TyQ%1rex+BaV_i!y!D2> zS~QW7}=3FBr z;8}x4^SwQUmyvYpq{Ws|_?#cFS}iI#*Nyhc_=bXDLASE zA0?xmleMpN9)KMcMPz505B<5(UM)VdDjW9GoEJq+*P_aO;ai3V$^Tdt-^BQHwrA`L76=I)__=Z1O)_b z3aT%sDGfJIIwjXWS4|3aY3tFqM-@~ycv4dW)2<3X#XWP*2qUM{+e?Y8W^E~O$TQv-7ObPb3%1&pr` z_0{@pNyi*G$Jj>C&%wAs3rn+&X(n>W2JPAvnito=E_^>;ctIq7T641@WPEb@hTvuQ zTQX`Gb*=^+NDVw}UTjFNEIB%8h7Ga!smt$zVe%zkxq+1Yqr@||#n!U|(MkD*8SKP6 z!BV9IGV*=q85JIk$?2e|Pn6t`2P&k*2jvHQ=oa(yhL*(5i!hpt$9X7lqk{Ka7Y9~2 z4h#lEVr{hbQQQwRAsu1%boXoPT*-k56?T$SO(_)u3$k#uq8k-zVy#t9EqG)v+0F=M zFoI<5$T}C)9(QjJ#ry`Jz0(d7LLk<>aCj9b*fVzW{n=tenPt-j=UU3MZ!?jx+*z+L zM@H)F`z8mFx&2vhbwfZwXbYhc%8$6ke%i zY&q-Zk0$9=Tg}@>IkxC+#OjY%e=T3J0=6<*%$DEPn0q26539QiAtzT=xy;O(tqCk)ib5L< z`o&PR=mo9ITgN@V6);^}tm~G8s}G7s&vCFXI*E^Bt+bP6i}COJXD(;e%HR1cXWrXpcG~#b z*=N>R#LU}Wenxt9yLB0Oe%|R;ouSWV=#!)~w`=bH@y^|KLov&ujmPS2d$n}z`Pkv7 z?fy5lx#b$Pm7!gkA9;r6d7I|9Yp;0`$gvnpR z2Y4{JXRwJ{d>&8yZBJWOuGwUp6ZYA1e$3Yic)>4ZwQuc^3cF#t%x8xprY48fCKZJm z!!#P}2;JPSZWIE?T4S&!%!36CR(zSd@i#wxiFxRHOFWLFO{7JR=GLI0;OHiwMGsd- z;36K|c0&??ZQ_MoHC;e_qt zokc}OvZH9`hg3NkIA{?`RraM1Fj801#Oh?zeqgx^nT*^7J82#rQ?Sh zq;=)V9Cq&S+H^hc(;!Zb&@k!Qqk;t}V&>AX+{h9ZMy?VkYQkVXvd2 z;#*6<|79(5xA75HGkU%U3m*H$W~Wp0`Y{Q+kEMW4TUfNb?Csq-T*mS7B;4+5V;F%S z!$fG~w|Dm4UpY?m;9{me`MZ9997c0qb$XtIOKyd96hYN!8Gi)Kay5!xS@;Bw&fms@ zZz8Bf9dOd-eFZ{i_XK2zl+0fPhUsG%OL*UXt+AiCSQ+c@Tr9#N?WxdOBF&`v@U}-x zD`!Ao{~My4e*{BCk}|q>XebKG&H1nc`LU9%_TP#-H&bWnOr->gXm*Lx?zNuG^BAM2FhREV{CQPEvKNkpHEBDASih z<2@wH-IMl$o+cLD7@`s!4kF~%#f2$SFw0bu%R(n91@`Kr@uQoRB1)QseOIB@qM@j7 z&Wu;eIQVJuHf2=momMQNg`GLfP`QE);^U^VZL;?e-*MjzaWT>ApeI&!$KtElM08|j zME7N9W$L}S_7`3eyeZ4DG&KRcIY8%N;@w{-voCo4)X z6X8bKP?3xoRt$oB<4~ldeBsQXOndUi?h63_7y}Lc_FOX6tBjGJJ?tSFh$2j9chlZ$ zf(n_d=zRydv`5OAcKU^I@5-Ikml$j%TDcZiUSAJhWnbxxKa&XN)t&E>s4@s2{Vv@8 zHh~(;RPQw*KVuxi`}scY8Qz!ZR$K3q6XPuR_w(kieMqf{+)rOZQE#QlZSqCU%=Whr zZ?HEo&Gmp=9?D-CJGrsZ79}&M#8BucnMY%^{408M$i6nr4UnJVM)! ze)&D;rqAnIJ5IA64$mcr2=f)0?TcFqVNn|w`~jORLfR@*)LK03~sfvEARoqsn z3r&sf5yz$t4~jSWLcwq7>M}&P2s0`{N-95f)BY}noy>C-iIiM^O6emMTLZcTDTL*I zOJgqXj#6ITFgy0G`*3--4|g34o_tjq7-j3^WW^_PZhCn$hd8YXR4q6FOTbQHrTF`q zx{DR-jzenwJ8<*o*rRknh)L6R0}_+3cqiEJl?+kh=mX1~=NmuL%u5;S>j~k|dl4Yl z4PZeesO9)H^i#r#Rvr7b@3Bp0B4&k`dcll*4imrtI|kFqsRI+@EOu%HM@zV~a+U{M zOHBj%s>W(lJUBQL=t;aNF21*lz&Wl?yY-XSmH`qfyhET~O)&}@QL=#m+l$9;+#Vp= zP>$}w{}z0d0Omh9%{mML)+4=X4G9*75{hINxiUninw4znQL!i^7OUe{4>!WrD-(w} z^+5cFmWnE4ss`T22E6j*>jo_NwuT*~ zi@8_64{6-O^z)o^@c1qjJ<9%MsYeQ(rM+@vN~@O;jJCPVYu_8nb|@&%*Gu!ToH^H;dd$5P3WeZ{@wX` z@ux_Ae6qCQVb=pE)Fj!p#Lo~OKn-B2AFtg@_PLreGjw&Nz5%~*Vw$AFDGtbO^6-S(W z8+x_~%cI=h!Z^`|&paRf1*?*tSl4BH&C_<}HfO7cPd-n-<}=)~7Xy~3*PL|oc;XAP z)r7T&kgfUlCQTC#~&9!Rf4CMUw0Zt*t#v^GdWS?g}oy2FXTZPoOyrUSdnhZB?4;N5fwk96It9xa$ z{!Y#Psnh+?^jO(BxPLtGv&_c&=bW+s6yK7K^(h4XPipQ@P4b`JzyGZLTj~4{)!hFN z?%!Getl9rd=Y0yM`FHp4#p!kqvl1Yk_g0kw$o!3>?(huqDBnN7punF}Cxwoe5``z3 z@7b!dOqWHMqD6=MVYWv(Uz${c8_(n2YR2Pe>{VzxDOYe$&3d2~vy^JWm8ooQa6 z0OrJ4(cpgP8K&y2bw8WUW0n4^7y6O97160-l`o_g4@za75h5U+3TKNn-gNURL`Fc` z_u(#F9eeNjc9*Y_N-ijG5iu{!sSp9Oi>u*vOdQgS)AQLIUWX&XbKtpOE{cxu(aX-_3S zVCcTCUJYtd(^n%nTNS!1;yWyePoh9j`mx)-yhCsZdZ@+s2(@-mF_e70r<`D$=1Gx- zP?2j8)=fAIW&&+?PF?EQD}v*@86(AJX%R7y;{j-|g} zYGQ@%Gq@QDvq@1?E)oT(>jf|yXAK#7th(=19vn!g<)SZF$FolvsqRoYp@ot|tzxT$ zF2PI0!*-C)(sm@tyGvlgbXe`*Yr#I&XK6_{hV?F3SvGbELHT=&Hx7v$$U><)O0;6I zmY%z)`q^q^dBeGmrm2bP?rN6%NJDYh)APgj7t1;?dU$Ejvg+$7ZRX2c%*PGmaK*~N z>hnP&+rg|N8J$l`Q1S+dn9^+vk~B(@a6o(R%x8?b)ESg>VBTID z)60|4PAdc{tkWoRU_>S08!F_dPS4t1T)gV2VhKPN?K%No&RDiB<Y6Sib1(FzbQqJO@-i#rM=|ABn+^V{EB#2+%6?I}9&|98kIKMDIm?jILOe|Gr& z*S6{c;<~Z3nY}Bh<7|KUFuQ?1bCWR3TA8|#=#uS6nt zV(PDSaB}~7zWrxx;CyO_o9&mEG&lRt!AIa`|Mi*Y*Jl!*-=9IV>4yQGhx6AY`7=Lw zIDap}zpk}^G8{adzp!d}xSrn6^>d~p@cc}t4r=d-PM)WfP&`lA-#kCTr2onf0L%X& z(D$DZ0;>EpA}l|h=0QWj^3!`l1p!p}MI?abr#|=Nr>C_7D*WOXfQ9|nGk<0bNFx2{ z)$fJ&pN$Zx@-J5ZkZV7A4`BJlED%9lzklNT-8|PX$pv6}${i0X{2f7mNmlir67&Pi#RcyZ` z0%&{r&9h%8yuZpJ(60NR&LP0R_9wQVn#=!uX{~Q32FnQ|cleGG|zW-QPzc}z0cC)elg9-T;T0qP6_x1}~B2Pp4YhM4DZNGL} z&;)prSWo=>Uo80X&c9{BZ`%)v?vJ_62^u6W9##;%!msrS5>~%k|3fVR6@HF3!vE;m zkM91p2~lHLV_OG{ADV@QnadBw;#b%Hr4E3;`txxAOP%_);+R$4Ub=cYn*BnQ1Bm{6 zAG8!LFD+Hg&z+=SoGWP%Ix@AWHOoz~4gzJX)T7jA3shw7D*egGG{Ch@;Yr{q0w}n; zmZ3znOcBunz+PfG`rYX*DO9=XVA<)@HCBI(zLD4clyq*Id#w;Y-f(|2>Poy87wkQ8 z&3JVC@YzKyxfzENBOT&6Jfde2{`x-7McJ z!<&V&rs7D*6o*!3R;n-GDKDi>#TSk#DoT#V7r$1XQ0k-gqw~j?RLS=#quA%00= zP*z{$9=ulRm9C@o1FHIny};hiDZR_%6)bZ)F6$BReCW(1MHlrY%-rDWt?50wHU8L_ z-6x6c=klHQ(dohM5sfiImf!}pCdLBCe}(pK6rqBtas95{vu7+(q5&Dw)U+`d5@^wl z%S3~n(<|z!l_WN$@|WzsbQFOM(1E0?lSNWh=V4g;wgxp@h%I~7^s}I|{du)Tn?6aTv>UJ1d}pN#4VPH3!dR@(2uh}$GOhBIAnvfKAXx0!vyo+qA|V_6O6EJOKi<(&&gb+T;Vuj3)gYjIhZ)muPVu5DuMFwL?jRBsgJ zBNa0X)2vib;8KnSNo+#mfEgA@4dwC$F&tmZ0clwyJPi<(g``@Pmh%1i3BtY-pQ$|X zYoGDpA~(4)HC_~1og;FuA$P-+^_X{n+U z{H%zzPJtVY$R|S|zkbTOHoBoP_T9lEHDGc#qw5y;3@H;K9uG*!;I^x~!%`lA;;etI zO`jEFLqV27RGq+%v?Y>aWL&qmpthw^*keiKAzEbX(YmD?ue~?;IH0;`JLzxD_fUV3 zoxEoBSOS28-Fagv7@)gA1VC^Pt?i1uTL3#PMh|Q6x_^i&eh#DVD5&Fb-lI91b|yH0 z!86{6vv~hOZ^;<&6%y~X)S-zfDjSOxa)vNB(4qbj;@EhWPMCg=`6`r=fXimw^BX+P zilt+IG5EDv!TO>;i&cY<LvVMu5Znpw?(XjH?ht~zyUW|jKIiOx&fWKp`@dtn1G=kw)#~c1 zRsG>vzh}<5w92^QpY$sB&gH)B>K({m&tFiX&b|db?GK-ejAFlbTl*Vzk#v_F=_-dj*+`8ke6& zBj5$emwa6f*PDG4t`!NsTW}H;HGEY-KFET`QTmIq)S;lH99r@>fyrL3JB%$?0PM(n zkKJb7y9H))ZnvXc>yWA1H?eouc;VecZW}@rKIECYF35p8n&WN^6WrNPQ52AYrQ-vN z2@~7I33OUqSc#n(;_OS+Mvp84EiY^i@sp=LEqVrm7-}pTBCjUBJlme;r^3er8(bap zkvdFMWLnNw9iHzxI=bF|L|FQS^hew}1*Kj=kx7%J zCvp7rq=2Fm$vvw3#K6D0LvnAtaxJrWj^o(yH=FS4N}9yri5#nz_` zBYfzt5o$TM_2#-)q98(4$%YFq3Cz{?e1Spco3Nh+#kg013FAUHv7eda+)GbbmMAGwxW~QK$QDOFgx6XeRFhp zt2S5Y$E4Tw2}bgP0WZ~x6^*MD4bOKcvEaA@zWYz}q`?xFZsN!VW3#z@_{=w*FpF6UPrNPhUaH-(YMI#jir zc|j$*apu7=Wdlc$N+uk77lbTZ{TSNhw>I%%w~a71-v#u`S{_rc9Er`l%Cd0?a)!V6 zMYQWs;Z*n&*LirlT)x8N!44+(^y||fqfJ#eac2BzGgJkJB53#hlqkvnY|jgo&tQ)( zo6`Dz#_2jxMxQcq$504YSxCt7att7xO*NAu1t};U*IM4xoYm~~HcZVG5z`CWF5EuY zpyI`FL6OkBARN-Maq>{6-OY7+Ac|KPz=v2~}Gn7%IEQ9-ppL zzz)!2TiFEWRuaRuHT@sW;?;GOA zzL#1<@Lf=}RG%%BEz5uJ?K-{d@OGQhgQ)kL1x~9B!%@|PlxG>IXr5vmsy&^T#|7%) zTbk*cbEKuHZm+{5A;&2NHEL~UENL%_=EZiQZ4_L$BFP$x6?+?`ope&57*)3Q@C<5M z1Ag`=HlmJ}j76clb`kx-N}g}0)i;ySw9wK+NKjN{=aw|kAsO24;zaCxSk{pFZFPAy zDoxZ`gd!~t^L5Hz!Z~00qD2Y%v~kxuv%YzXw)>)tic)`aK|oYL?>=&kQ$IP8ZdpEr z!BKSJ-mkknjY)87haG)AEset(uDoYm>7P40r!+V;yrPmjlDy6|P%@Mgbvs6g9>r+- zS(T34hn(hJ%7>uR+pIpDNjb$AC2^{!Rb`gv1cf>%N1Mj3%wXDJJ`Fp&!S~!wmY0+& zHE5b`xsJ;>d2tW-#iFpO@8u-;ia^#J*H;}3?-ZM+i<9Y%r;nevVG>8B*Hgt5txG%i zSt^VPcW((@SydcIw{F|WD_q=o8p%DMc5|L$KF%V*5NRROTqV94Pm>X8obuy^IAsMm z52KB6Z)ZHTPm|Qw!(&rLW(MQK1YvSCI*O3J=ziK2Z0Sgpc3ID{Li!!*_r5<4n=KyZ zuu6!Ctsf6m&yZK32qAgyeqKt>tf?g=MQ`uE@}b~umEM)#EeqLzoU{{>?Hf5D@D5Sljw`bi^*{i{^&5iyUv~pOiw3-h~3k$~mr6Nc{6*g;Fnk z3|UKHt1Gi&7Y7rf4X%Q;zP{Pr*xJ#5$pgzNy4o^-O|9C1Utko6$lQn&9Nmg0#7}^% zOkVki_WYE2{K6+Q;hEFdbAua|0s`@4n>+bfcdf9m0(7^RtCD9u38Ooc`ZZMxS2I2W z?lH3cBUKcf*Jz33qpi)CMB+lv>?8-@J)AG(U9I3#R0v+I&``U7taErHZCG|I{uW*UwC>&eo zmkB!H1-LE1b`LdBpL#^};1Uz2>q8T|G7TeX#XnU8BF!|?u^7WVaq+YND zlESzeZ}IFp%Cc@xyE%bV2>kBy0cYA#6*t@TCUruY;mbsLKd?`pzJu!5hdPtP_s30TDVTNJzTIR33tb*uNHB>r++u3Mn36NrnL;$ zb{x(pNt-WI#q%`2%YfXC5j@)SE6rfFg$aZ`uSX8ofQLyE6hb5wq{#iyFq=6mfo)w# zqH2E0zgjbPaO9a$jd+N&VsLwNa)mdI!YBU*^`KRL_jg7V^RM~-FL=Ph!0=~%erD$X z3dcpPtsI05?e*l?T}vQuP|(m&7FVSflvb1i zA`yCVAjmM)=eIJpFa(|`y`qDmr3wr?aEG+6i>j%Cg9#AqGO+!zLyQn;5z(vt<4joC zfz7|Z66oF=GXG*Ae=wYXV<5i}*{`byS}eeWG7z$G{O=xr^!^2I{`g}DGDkKbre4o8+bo=I4v!Yf^G~%GEiEGYABsO`ASo)h9HV%L0vD$jTV-PE63>?id0@7becnI>R-6cneKn2~2*1QqT` z@(Bpv>(L#M+1^DeT(ihl95A;Uk02P6>WT9Q&RO9c80egV;w+799CU zP(u*XCXXJ<2ci4*i1#5uB&X3s+hFYeKN3mArcZfiUc3XBx5{gkIQd`VIi)7D>7`&@ zB<)JsgEq)yY6%i%@Fcg7D(gG{>ShDJUe)Xq<->XpG~+yR*bnj7kHP1X*FmPO z(*-5q9^&`V)NU2owc|I_gtir;s#FX<-A)gB?2H_wl$7<%T;7iju3xj-Shdqs9Vrx(a>VvICY>*~2l;42 zpC0zKy((c}(d}lvfy?Z5BRhCwjdswxl?ScGM)sJI=Vlj73(9Cy(T8pJvQf!v*Mj(3 zuDdfTaa~J$|IDO2*^~pn*%=%IW~FLj^o10^-R9pZiYH?1Zelgn`P_zplX7A(`YUT_ zqfcgk*WwgjW2C~%PS`p+e3(fL69K^A&~e81G>OPyPRmoA5!6UtJqUapWd^OFXU+21 zlWcDuVmv@SQ$q2=*Eq)tAXC+?M1BNppw2nNSyemP(#1h&Sn5V3a=Wf!AZ{fq7gfV} zqa&B+#2+COy+1LIlt=)S7kM|0-X>!O2^Z8w^A<*b3jN?z+ObvP3PkMb+_r) z!BtiF))G&oi5(?3K?O~g(w^v*oTXIsxMpfPt`8<2BUOtmacG7rS$7%QO5X~2adsH< z@;ZHkU%wuK$v+CBJGtUm&igjOT8som@`C0o7r>>uEW&6Ipr z1tfM;(gPddAuX%C{YOC`x{{x%YQ`p4=t_Pzn7tk5ddP%|6^Xrx%BS^3n|XIpR{LBs zs4JER+0L1$p7of;y2bgOUb>+=7IkR)keJXa#@IjGuunRRRIE0XG%GGQ?#|;Y^2GY! z4~NVx=a>Nm_TmZ33Yn6r%^WFa2|rKJBPzuCef;f4AsYMK!>|j^m95!b>rU=o0(ted*BLf zP7*zS$3~X-bJE<68kiaIeRa+)W{fqh*yrbL8g?Im{i`- z?k}E0E3R8k<*rxrWa&_&Jqnt_>;D=_VzE?x|5O?;aH>%*tzA$!SYz1z+3l{YEEF`x zI*fX8Q)05{n~G^&AmBn-B5USw#DP;EtAxJ7Y%;}cMrKg-+v~XPtE{i7bdwQX9_>)& z4@})xPg1R{leiv~Py2f#E-I=@`LrO-xDv&-p?)>C=)3bJC~Y3!aq(g^g}X`g6=w|$ zjHsEI%9d{GvCVm?Wl$Oz?96)aYg_=nKbPO}D1L>X+n2TTK{c+VwvJd#gT)cs7j1YV z?RML{G;V}tJIIDAB^`u=w`cai~wBjgm^H+7 zMGf|{rz7$TQ97SJht|r6e+Ad%O>bUe;7HoJkczFwejE5T^TWeZMh2XrGj-X@=@H{D zg*|^TWH)t#iV@~?io%b}A6aRyCi`3T=_~hXfR+&2E-;p70F>%TVsQdjhA0Uqd1-f0 z0jMoc9m{Up+!?9|pf}q+7SNM-Xk`Mb4N5B_SBbuPT!hvXeyMp5f!kqNn&Swfux)r< zshA~t^Md=>VoqjG1Mt;W2RI4(IK2m*F%HlKtQsbZEe6Vx3~F6`9eMW1+u=tV?{)f$ z#CeY8=aitF(P9|FT7Yqiu2?_Wl>VXZYwhxO$By$yHqA5HOZQfEiwkl*&j)f?Bg{w446j{$u^XIbjV;MpfsN)*J9iu%0T( zCN(Oht9B}GL;YwyD3WPv0wc}wx=6$0;-R$73!N<&f2o^pb;+Pu#>El*aoY_Mo>0{V2@u)jDW5jdh#AbyK zV(`xna{sN5Sd{|ehT01|QPtR)ns07GE5xV0E%#sS!XC226zA71b@ST3tEHCEWRHa@ zgex$X<9el5rJsfj=A{(K*0^)F(&Qh^;GxYJU$4{Gd4aT34+Z_5K>jUNehC;RpbPjf z4aWR8cJhD7s(%S&prre&KnB{>e-X$)8}siKGSCX8Wdcf805HIZof+_N8d*a@K}K2~ zsF4+bVG4gQk%4;iPl*fw8tT8LGf*J|b=;o{`IkKZt3v+6r~a#c`yHC_heH0PZ~v)x z|JeQ!dB#A<3Y6M_-ysV?BlEWn4{ZA#Oz`jhf4_tI^~?ga&Hveh1*qTuXaTNz^^c?c z+Oh)``L8~|`u_S1GwUxM{pp|hW`}Ce^}T5@4`4d!CgsF^>*Nll;qCG2eFk3 z?F?-VjX>=Me!1wzd$UAsmWry-`%wTK6AhGrN^Bq@A`zi*Cj}u1h10jgS(&;V zl@jI|v!m*|@ru0VqCU?DJfjCL49y>Nuk+SpoYZe5cgANgJTzO!y_Gaa?Pfgz ztdhQ-&tMp(DX$@yW0U?C3h(_q%XiTAENIW!Vsg)uHwEkP0C-;;*CJb!Lpu1D`B}p zVIXP}7yLZIE9f<{Y*RB32S&AhyLrlXJ~hGC0bP z4a5qiUkAHDtEo5y@d>xl35GjBXU+UB2>p7j7`mxoD|SXLZ3wxzW@2eSVAv(Xb#dN6 z1d@$6V(JlM`+PzC>EPefxoWH4JiAYmX55`W_)XXb$ssb{oN)n-AH_PfM&u+!GU&Y} z{L}iWdxHkG&>cQ2z(5tp9Z!8FcVz?oGjcn$R|4Px>NF99D0xy`aMz%)ZY9vQQka+k z%A|>EL>j=qV1Eb3;3K$OGfo{o-`GT4^zZ^Xu01|(5gEuTNB^{?=b${qH7QIX0p?jf zlske9|KvoU1j&5?nd)&HjTN|2*(%vj6EkGMBEGZ)r9c>u$W_;|yzEeWLbqYJ5cy5m zj~w^n(Fj|n^WbK1FZgsK)w6X^-ntpr!a3zxh$A0?2V5^wwm@@+2!vbQufFB37;;lO zp9d-?EI6NJ9atDbIo|8~;mTBp^Uh9UbjvOqF=BucLAjQ3%eFF#*lJtArdCe+CtE1c(|R{mlOUiVQDuYiD`hKy)G zh%g22)%nseVpj~83k|hqR*kt6@(~H{Xpp{+&ymr!d)QmPgFoKCU>>Ak+MObpyb{oC zItfD^)#WQ+?t;Kx4nd!1TeVpob~Z*5YOdPdWL(ZO)a7%?m&zq?@7Mpf2Oi{=f`A_%Rh>xi!bkySBqXvq%-cqI$)p^iF z4g&y`h(?MzPECzb<5Kt?a#>Z*bxPF8*WDWl7k1ibtS{G*ZIhC7xw$o(Akyh$8=8O* zQ0p>MgfX`7prgemI|8BYFl07Qdj>v)chzm|;Cy?}r={TI?034@Xt3uXH_8-nRNE8B zqDxK-f8EJ;t)ffYPQQMH{k-+*?B(0&w!1<7EZ4(>da}ldqDkfvn^fp^+HM3dn&t;R^%oLN8 zKjF+&Ya=pOWdk2mQDngGS}up+N|_`gCi?-=r~s?FT3@1JXIdkOIOZE1UO3p+QB7_# zjpiHXhbHp~8hVc!r12{PPY4yI9lDUZpk1&Bm>reDA_a=GEA67=HTK;L z9CQ)N_OAsGtg~lt=w<_6(}@{H=%L}9nm%ASmW%6{rIS;Bt3BKb+s@}1wbHDMR^9H; zTT?obz$MXNK);iFx;)?GB3f*7kL!JsW=@?|J}nB(RJ4QE-Z=Sy$90-a<^85Q<-1uO zmJ0SH6#zy?Y5r2~hpC1TP=bZX%mv@@UO%U-Lx7NOk*_RMXZ$#`L5g{Z!1SW(w*7X9 z!^R52J#fAyMceX`5@w%_eOXGfkox3jRtPYr@8yMC25;%I*Z%9FH&udI9J zGelmX<=0s#6i+rRjGUr~3!~j&&)eQGSKI7%%2 z-Xf+d%hol_uxcLN=w9uDc%o5PURQ^Ci1&e6X3J3g=sX2bFvxa`hwi9oz(I|~Zk!^= z1&x&qZx?lk4Om#0GE^&M(3(=xI7Y&!yN`6KAS+k@s!JYYc4$^6y%V7S1S_oBWt&;4 zWxm9z>6Y@bA`&Ylco^fM_sGj@VO4|3671woucbd3F;1yBSHe0m3$@s#`!j0(J*lwO z`-Ze9?4-vt1jX^VNV)O1fv!z3a4MFmnsXEW*S+G;UP>9+XRz}LlqYzKnF*{82*=czA3l7ucM)#$Jy%Th96&L^Ec+^yaUZL>|Lyw;fU>o7`Ocb2rA(YehWT zU&|%Ds90oc8?=12);oN@6&Cv99N^sv9Wz?79!dr0`}U7oFm&>N^`euzS#xHT2+Kda z@ZCdI!`N`h8etSquP9=}3z23L2$3PtZnG|~TNGpQo3pEn7p;BC@DcTlc1A|~ZWqR9 zg(L@)IWdC+cweyCF6t-`@xvBDKNd8DDgmZ|$t)8*LXpG0F0Z|Hiw5F>0rfyiWN1>3vRUgnn^5JT2zuh4BQ{0Zuc!`kPJ3eY zI(!_@sY>5P$46tM#U(as5){0r+aU?@h{&n)$vZ=-gCV%F5h(jW-1jgNEa57AIuma$ zBWP@OCEwlHT#mR?=LO4S= z5sXsFKzfEH?fKD~)W7iYS%b@CB-W*FlM` z1CEf3d|q+yT{*90^ltF52647repwsJ{gdK{H6fFIX@%EZ-xNO zDP#B@4i3CRwqIBP05sg#fKlx1zf&as{-CVD2>xGvSb-S@zqgFczYq57^&j;@fuI5S zl^npY`@J7{%D=XM0E%C!5-k7R^E=6k75Mz?@h=GRdjW@k8eV_os{FdO{}YAykNfc- zzXae2{x&XQ{(>R?5v2Vmh5%ZQ|3?h*S7`DlhWLm7_wSbC|H7Y3Q!`aVRh=)-&ngD* zgODUOt81jDL&8fSA*1r4hVF+zn}WpPV}n=%U$Tfloe8h55U2^FDJ$gLil#8j4kqg- z3V9U*0Laqk_c)&004$Zib{tBbjd2m_m!hcXS9S8E;_Y3FcXwu&;PDzJ zr$u8S_6CF9>^`IZKzIhjl+dTfKe;SS({Bni?MJbC=5b>q_ykXFo5YL2_y`U**87CDi`IG%BUi4?Y^b1(&g~YFiJcM?Sy)h zMv^)dTg*$k{nl_}#)ER3Qd@RepnAb#SpAaG%*v0FyExvQ$K!qb(fM(J(j7eNo6;ocCaeh|m0Ll&FY@^h=Acdh!n+!HkN2mhN{F4a?wD zgA=H1p-ZlkgnlC+s>^9h(k}2sQRz`3r18UaaTHZ;@zr>Yt$7h{(&7Rg-8YDjkEP6o zPpg3#`+CxD^B&Bym@Htw=;2@y7K!9(*7=tY2>@$BuGz7Ufdn&jsEq_^TBU7w7eK+>1|62 zWXnz(Q-kU$sH*bbINLn9y|CSg?F1iSF`VC;K(Y~N)tHRG$0a{;!?KkOva++P>NbKv z9qeaQjg1?S!vnA4?CiOZd-6j`MD3wWwq%zBH zpihS3wtbiC@a%&RwY6RfyR4KZQ!rOFJ+rk%7FS4K}s}+?*l@b=EE3Znu6LSbJFc-XMwgoqB1O0cbI<5zyIA7K zfD;eVDhxn_XJ8RyBZCkFju?|^c4Q0`DC>6>pZ3KEKr2BM?XMJ z(u`;nzk$sU1Bd=3#Ps!dQJ8~v-f*DDj&~#;TFaSK*4*uDa2b3(x6zYKpU%PQzoJj} zLNlEzNI4j4IX1grNWt)UPzCOgjl$SNid})fw%h#upMfk~7 zHk#T38Bs(M{4u0l)Mw(!eDh`h`0F<(o#~1M0_C~1j!1P7=}Bb$WeQ{B+Glo$+*GCP zCi{TM*n%0+sRgI!Pv3Mmb9uDa_DJ^~A-?E9C!tXtAVBT7y?D1h!5colbgCvUr7d&R z@(FI>EsDd|`jq6G7D-iz&m0l@oFx-oP2>uZb%muHHueU!Gob*)9*qo*74{smK$(bp zo9L)zXp2)tH(COvi1Y_lHbYSc!Dq8^>`X%ENhu#2b4kQzi=u}}h+Q~)kQ3{@`bgh$ zy!U_@sA~TxW{-Z&E!iE$3gq^ph!hrXh$B*#{e6H0+8BhoWj`ZXlYk-qU~W=>Pp`a9 zPn?CakmRE9y6t_awJlAEB7SrhzIiq%d(pU!!7BCV{o$`|$3Jt)HU^94H}yNcY`c8n zi1fAQX_QMwWFd$kHuss@}w1zAtOyN(FsF<>fRqRKea)%3Cg}dyMu?n#C z2j4MmCZTXrG|a{+KVWP1hpbF@ZN#%Q2NTM&mOrfv*ZtuCK$f{q4$i+T1 zAb;Jd=b&fHlo*ft!Q0wMkYT9!=ec{U34#1}G_hq=-bWw68 zt#Ao~v9-cfRXMIG_n>xBhJMB!S(UVE=*C(c|VB2{HYt)_k|Rar*rxDut;@gZ)S9G8vW(h+=f+x!&Xzt(IYF?mx-9?KFn*!{u8Kk)p+7)jMY zvi-`|arl*cG^5vqh^Q^8e>Vks0sq{yz;qy)ugIGcwIG&J@K7HajT zLTw~2d43+bnZk@zWEd*@A?cky{ETcjdedQX7s#1n0T25Qkr!P-^uaq7O&*F5^Q%- zzJ>;V5i-m-PvoB+FdnHj@(Y7Wns449YDiowNvS$Q2OqJyk9u)Nf4X)=XMSTp+{M@t zxDfN9oDLI}TKs}fh%qVefN6n2ju%;EWa4`OnYxn^(JH#qM^~bXcHP?I^SY|Y@8Va( z6~Silah5#xtPnm^!TtkYdjZ(^{n}g{*jvN1s6VMY(`JrivP&A3qotey1r5Yl9FHYs zS#pXWqx_2!S>)$MKGm)ytQsDb!~B>A%J-;aKRr{Kx7-awxMJ6zSg5CD$-Yk+F=4CT zS2kaK-Wn*l`f(b`Ilgf^j>E1wzJ{vl$=%e~MZ{0g83$8bj#`6k2pKK&=9hz}nnBIj zsz}LVS@Po;2er~rQk!pvQBgZa3_Y^1HdyDLy~-tyYRA{6DaB%iR5XH&tZQY6m1_ON z*B7y1^=T$u57$R{if!2xy4r?MYO;_xePLpgaqUv1ZZ=G{ECA` z%~wuCxnLAs`TDVn#A+oj5+ja%BSL+)qi?fyZ8j=T>a_l=s0pcuvxv9oHi|_)`X0g7 zB1N`We+oz(I?+e-Ihu4xOrz*_SbvINgTb|1?SX-{fBIt zCgQ3+zAX4ArbaKdTb+Rsw(Fw)2pUdxD3YuTUtD0u9Ju`u<`a4VhlQBB*D2!p3>4ZRLz0~zPL85HT7=zl!I_g1Kv@9oy+iYfYbr%L<#$dx@1X ziv~C#!Cs5pxhn<1XR_*Tm^IONIlL1#6>Ny?*)S=HMV~_Y$yTGgJcT4Cd@iL%E-H2` zu}kI-VU>L~sv`UK;020dIbDeZNbsQjM2t zy2)@+u5`d#vFV7#99e|ho+(c7H1tDZiPvLcQ=U{E+U%#`0(E`1SVi_a%{nQ>KDjQG zK3Cn#(Zo*2_IwmC{`}JcPdi+b2ujsw3zhYc;D;_#ycLAxPnwnN_S7cnU?wngND@7r zaoCEivnJ+s#Rn+;`UE9L97C|C(Z0IMcVS1koKc8HbC?O0nmI`jw`Ql=UGE%~I$3)7 zL#XID?R4Vtuho}|3rzeam}ZAX$5gP(<>rg>!ll!~M zOqoC$sXD@d><_8B!$7Bn5IuMJe!cl7c~{bCzdIdu8N~56^)h^W|CV}Qed<0sIk%Tc zK5{lzVfavBRGwR#TibYieP|yXUj4k^7^rV^zb$IeIPkd7r!&V(zj0o~{FHKF{qk** zcJ&=WfVDD&Ynd#JpMT}e?5UjwPIa}o33mW70>A?iijAG(a1!*VVV!Ewoe5D7MFspi zU*cdNR$!~rZfZ7X$Z&onwoXPQQbv)is{9G(Q%VQ-3&k-MQ=P_h`D4w*2F`2z2x&HP zd=1a4hC9tI-`K`93YvJ}ym9cDv<^SnIbs(r05FzvYAf1_aDr~>Lno1tFD(uQpL@~5 zRP=JZgeeU7!xPq*+@P{KyJpfVonlPC#KFBsuNEnRF#5I}v2@nOuTqEzWn9flb=$FZ~=M{V$yT^Xpw+C<*Pu+GgDs@3MLivJZg~|ptc}6q*3Bfx`JgcE}cWh zyA|;g#X&<%8o5n>fwcS^Vi&cwXK;U{l^D>{iFPUygSEsBHf)0Qw5m_kS)8;ZxMxdz zj(`m#_H3Y|ekS3Y)0k9St;}&VKd(=`ndwLhW&`BC5Zwy?P)8g*m;USyI#*3`w2F;9 zqh8BP@q`TWLLs~E@m#>C-M6N=fl>=R_kE1b;CHY5bi>}>lwLA3%F#uVY#%Muc!9;G+T)*Ojqn`Yx0XEi8_=yh zR@|*ThlaH%VG2YVGmVoIGbP9|*J^`9d8e_5??0)48FaUU3od@POlM2D({1>WIp&l8 zq#^!UX1AgC(p76zf%*)I0B3uH|K7k@ZGfH=eo5IMLS0>tpK(r?_FD|>)a5koQb*}{ z2XLtY^PJl1uymJNWJL-}9GC;BtNX3?{!GHPpzv#f?n+JWIYY~!`GN!=Ps)8}xV-0q zZObgi%C9r|ot@GthhR83M@KlqnnREnwNrT-arY2(NXueJv#O>QLPz#w&jq-eT-O8M z5~d9J=vv-1A7%KzF7-v}N#{?!zwzj~4e7-D;biH+)3A$`#<`<8+5)P^rxy&^usnoQ z{=TPow);J_d?D0Nn>H+v>l1GPRAHmmh3@8OWvj|Ay!wlBqAlZBi5Vpv#|*khkp{Nq zR@%XZ1yqMpO`Nt_IRJLrXX%*xwTX{q@zv#SCqJ!b6LZOV0$dwBa1?{s{RX~Kl0=b! zOi4L_M}G@WEF5SgC-!vFc<*=aL!qyxY{B>iRLgf{$rvVMWss`CIXYtiZ9KPqo7ROu zOmF3MeZ8>oM0}%qA+|#(n5kz)po#`ya)+w``A=i5Xy9BJ*fcT1fv zluN`If+ZyKG1M7vTXNM?Ed{>rJ$ppQ`QnVIZKerZ4-1=*B&qA-xZg2p=5+7M$(*eg z7ViHXuoz%?18s;-ul-v}{LeH5VEO^WUt-LDLCyb)68{pq|Nkc?Ruj}vmkX5nN_qQI$V9?cagqzqSFx#Mqc&{>gOz zd8}Vh831Izf5pnbk}iNPfZu4Dko9*FCpKV6+i$%5s~G?!ut3BN1jT z{QJ%T8~)_Yzlx*$D;0=kYSd{FBG*P0vv+k?{Kii2)|ueG6Y@_X;#x5&70lLNob_iTO3td=x<@B z^z^O(z7bJoO|s|$6uv~8(g9aXj*&fVj`>>8JXRaC`+dBiL*?<7Yjy3a^*f1>9wuoI3SFg_rGVYZtj}KN)#%zL>65E#ND8dJ>EOB9|3RmEkk0K%$Mqu*rfD zF+VZZ#r?ToT;CG{#qgD6K{@^S2>nl4q+TI$9~MS&HXjd*?ZPSj{s^2;y2Sk4!Ujks zLH@lg#Nmnjtx}^TY#-=9Tm?h)a_Uh>$xQaj1{t&x=z-gcDbO^}>q6uQ&VlkrT=Q_U<;d^NJ~mADqHf18!F{R4IwpNJ%_O!*hBZL6@H{!U0Kf30^RIX7Q4F~u@-T~@u4=S z^;5F~nqgb4y$Sg-h<~+NL$O>82;2~WhOS|3o<#0O6^9-Vta_+ywP12D>2^9mz%wf= zQvQ&MmP#?$ic3u_To&Ve0UCt8kBcWTjYzen<>#DC#EZ(b!v1XFap>67U|G=)*;V1663%s|@<4XS-WVpLfEX zFd<9Ewo72o9XoYzk?8UWu-nMO1c3{=__~>#KmAx1jAHi8vdKN@-VxhABTmrM z$8%fn%#=IP6|adP;4Zp^p1qGI-tDmO)QxC?CEAQ$4poXXIv$bN) zfP41c;)T0R#Te`)-{wb#WHWS@S%fA0#lAC$>0F4o)jntko*!SpNeA+6$W$t3HgUx7 z@2${xpGDr^)JlhGH+rpqkBR;iOxi2dRPduq|Lf!yQ!IE5TqwFUhN6jWGh9))9SQWy z4!Vcb>Ss@3sqEf61BsqVQiyUN`2nA#qWr!gu)vt;jupc%H}p~}hm6OdekRvVa6G;u z#Frz8D(TwW`F#bw?sm4-QeZCe(#BgZHol=4E)&uY00_&-tSCYH)oY!TO^qzP?-S>kROso6|bx^3dJPt1pmMj==x+UCM-KR>DTY0Y$T^9X%eAp zUfG73rqZ=z!*Z#FSq9E^2EmKgQRI}#wV=@Zbs}MoNpb zt@i2{OIBDd+L@97%k9-oVPf^F(N`l<$5CWX@DEI-7s^z(s)kmL3N{#Hr^3N|U^X_g zP|Db}_Exu1LplUV)!c2ee%Na-rF)IdlaeO}S4|n=`SfY8K|>|wo`6k0%Mq|4YZhmlP7wpuJXZFh?fQZ%>tL-XaN-HG#21qI)!0X79< zspf3Z+#aSEtDhf+n@vlE%I$5Cu~c6ctf3$`f3PqUHUq-RIa%FO#cKhM_f+7Mqx{fJ zIHNyzrlnGB0)>P`kBFDKqNHCpgqLM`c{VL?gR)QbQ&gP}HUWkX^s1tZ1r z5?ob>6JZ@TGA?yoqG-M8>eV#kViSUy3M=-snOP=X{~lzjz?1D7SfeqmL?=vANIdzL z1kjc-XzqhAX(C_)dYtt^OP!3Yoq5|6-!h63AR zq*eWt$2q20!y#LW+l#ZvVA8f?K#fj6$JK-S1t= z7uSc?TO0JJID-bPJRc!JUWO`;Mw^kXY4O=FldRxE9QWNg6~ni6x_^Umr^+vg#&!`@ zLBKUu$qO}C0L&MIMbrXld{UfeIScVw$UHvefx2p=-}sEflnM)n%ECDuUa7srL~59I z%N&3i+ruJ`u}H+Q3R3@o%bf_t>428l^&$TPmXPxmDaecNqm6OvgZC#tCxRHl8%_38 zNqJ+B@|E3n2%G57Je68mamw<_TC63T!)hpjp&{-;cet3>qwAZo0LyhqMIMvNq7cY_ zcex;3JH>P>ks04~_XQU{0t+x^hIzAR9NOFO;i8x0X<@gsO+_}&C&D(7J;#h@0n@D- z7v1QD)aI?CJ`q75`M9vVAiwT=?c8v@mWwS+HFxH%;hzAYr3n+YcR@uILE{9==ddjg zO{lFWR$`MHT+s3s(6=#6AlnR_h*esswO6u%5tM~Cn%6~vOuIOB8R=O41CmK{T0mhiGrGI^+kPDv2l zKlGbPA~OWNe?Zv~orVDCu54 zDQIPWT72^=X!L7jE&Rzg-QC^Yg1ZF>8r+@W z?(XguT!OpHSLCszJ8$3a@s0cE4n{%Msp3?fI(yH3)>?DU#TnaUM3}?ATMn`M#@nG_ z2}lS&P4;aWBdS}xh}BfX7gai(^WeMJt;YHEUJx55_TL|yhDoMiOfOr%p~($ml^ghS z--TJ?gkI)lfPM;U8t8+S1i`NI2|)LVlr`J73Bz}{thF*WaczsZ5YcUVMCkIUqj2npZ@`cs_v zLtFme#fkq>tPkLj{8p^b1Q6@907y6hIs3ne^`)gGRd^KvF`|UX|H&kJQONu))@ObZ z<^RDWdI=i-Q6d30zr-PbY4!g!?)@cl_=`%V_Cq)SLi%}8?7z^P0J`}f9;Por9e~#J zqMiSjpBGL3AKMtI0ji=O2DH>K@!XI9_}5nh0>K})uYYZ)`>{ucA1<-X07q5^=D*&7 z9v~5VVRrrXN(R8Qe@AD3OUM3urT)Ksp}&S^01tyd>@a_#0s%BpKVr3iLNkEZ@z0^z ze=pVlVb}fFF#0Dn`;%+*KU0AiV%)^#oRE8u4|8f~Ln1Pjh(D{z)M5lCC7`F!by%<4 zSFG_Tn}eYEz1h+!i4B}1lw8Cm1E1p!HRDP5QsB|%LqHJN_9aV#%tSgZC+N|!FIyqz zLQ|sazb=hV-uyU9x?(5XA;BF<^c}ZJ=ddAt6;27%z4F51aCj8?L=#y&U-5i$$0_}XLv?ylN(j7baYZ1u277MK}F_BGT)fz1C$=;bZ(njG2*<^d!B25q)V)KX- zE9+v?q$Kb-BO-SACh!Jn06`$=5Ix~nf>eUInvyGU18lxr_$-sG(ryH)yVInVR(O#M z-5d&hiammB9wjpPb`jia4Ia%YZrNGsyH*@EKX9mMZnNi-he}C`hF-W}_!)2B+OG<% zB&J@A<~ZTtFsuhOHV&?niQqz~I-?}!0@sX;!*ojut>F@C}VWX1keSn?@?odkWLJu&q1lHZ9^%z4f7ALQsVY-&hS{==>0ltKL{LrnkR_P z6MS_(5}R^dcf1~u3nSYUg{K20@nJm&dL%D4y-#u5e1HLYuQ<%-Q#VZqCTp+m9{C6A zEeGFje?`gBZtUFhQOPFoI5$I|gCPuKTDxIFZo3G=)A^Bdn&~Xv+4aL+St$Rz@z#Ux z0W8X~LH4ATtElUBFOYG8@~vR?U{)nhVn``i5m+x6XjFVt9K!MJjFzaP^6>A(>WR~l z&2{1JcyJZL#B4>Yz;@L|Pqp97GKyvb13^e_J$TH&;*J-IR?WDVoSraL>drf*QJgh? zY`xbNnk{#FC(kC>4U3qXUO|eS=51MV5>Z2Uq}sJ%kVD|b!Ciy@_8kc~7aU_d=EnVS zTI$n*gOid?#6))O@X@j=syjvaiCqAV_iwqXv z2c7EoMlFdjd-L8HHhOLC{djgy2X8(!i)HL*A=b#Ir3_hwLN9*@5>L)YTv(MQKEEs5 zho$FCX8&YK&FM!HkIUn`54%Z-mr{SFk-f_4O7jpO?WdFNDwu&}3}seL&sx&0w7~YE zEe#s;xgCe1{b&&F10+BtHm9jqV73g6`E_sR@~pCr-9ocPU(yQ?bpt~7z&p>RDjh6` zlq#oa%rwJi=5S=8Smc&q5N^V|-TQ*S+I?#D(|ZcC@6_S7iRy5{NR5>JN`iF}b|G#( zY-dZ$ZpBAPn7Qy>p8Zwo2ESdH|KhmP(9+ZXlfY$o$t(VasQ;wrev`m`NjLsX^98tU z|0ELrKUlsrKTLG~w2k?N;VUgCDlQ@YA`k|w>A$nk0W6-7|E$UkFPz>#R^^w(-ruV- zU={v#RsMGe9frSB*8p}e!0!3~>Gt>9_!~?2m&NWs(PV!)sDED>U%qSEpI62|IjsMz zjK7d%0Soni$XWiHnEp8r|M$Z9XHS9uJ!i=f=`M_9gWcolwBwj3p=KAFX_MzE@5yhh zuOcXbj?v=hzb~PyI-F6EN2h|EG!lFGz)GWKNIx7ubt{`1V2s|3k$@2e0ur4~4NSvR zao}Xji?Nml$A0pW6VCgMFh9H>Iq?X*6SIq&`9$!pCyV+5zo;vu51wjHP0lhThp0x8 z&^uF(0p;0J(q8%?B5?mJEsnU+{`XDh6@J90XcBSievv--1+PGORkQi_qd@%$w+6s7 zqtGZ39lGehoCT6SJ+W`X)iXWUSKo8wTGzo%LUrQs&%W9Al&gc0`u;!#qf^1kxN+m3 zk{V@i*>_kECn4^{BgQzY#nJk>LxUYwe@u7&1l%fKQ`UNS$JtIshrmK8M_avEMpbz$ zYNVtWTH3h~b7<%W+RM@0#*X!+lM&6Ti;WG6cX-i$h(p}dE?7;lXvX=RVn5x zcfF-82r+3%pjTk@(T$=|&MSkqxr`f3Qm))m-l*E#B@LxPSm+4F>$dmCQYH3``pdNK zHhtck*je4liq@#>Yx%}5i#rXAkcR+*Z?%RnNav@19A*D%W^GinGTm7z6$^F+bJ~ic zBiSP6y3CeaI{#M60*6ChmQfNS!MGH#9`P05TIvJ6xT0N(GAjcKLjyh*O|@|-4KIeT z+q8o8<7#VHkJF^B>-F6jQCcSfP512|*-*H8(tO!!9;!2sx~@e@=6E_Z(y!vI>RPy*150RUG_)V~^z z$qOk6@&CZe|HDfG;LH9CRstaPPpkw$$lq8AD4P6=m46gbevV*%#49gH{-T5c_#gbs z?Qd*k{Ne8Z@9V~Y0>@vD;@`mW$G7`4IR5x3zf^QyKL6hpofr3rzwNvL>%@OB_yUx) z{yA~~fa9NG$^RTRD9ES@%h_N*r43({7A(*C(vMIO?w+Nh%=rqu6KSBOf@y*kX&RB3 zT4q18b$lqXuuMHP*R-y*aQVX2v_&jij!Q`6(-D{+58l8&@I{<@Qq%QDlauqt5;z12 z-v?hd1Ty6K+eqW**rcSC(|Beyj`u+!{*koe0$GhLy)jh82yO{kpPq z$}FN*`+gn0tKhzCGPX1j$9ddISI_LgH`22ji}b9>Emq=k*r8C<0sltVI3Y}92`L1# z(%Ym-Zzkb#?2}k-q1N+VtM8eifB>;}^EU)c+bg@bh>TqUOV49SCt=)png!TY4eGdJ zvp53Bh8Fray@O-a+Eiwi=?zu#DVy30Vqc==6VmRtq0Y}hd;&-Jx%?kGjufH*AqLQU z$1x7qhM5ks{=lk`jD~bdiG7e!!~|B#wuHsLx!dOJs%`DVuT_qvj`-`CmkT0}jCC8S z8gv#lKFCAbhGe0i#(gk$hT|=UK!re=ZH+6gDeX71^u#Ub3!)j8qhDLn-tr|+Z-5II zJGxQTtquA=5$B6+uOdwR!ihXF`VI`+g|io4n!ceEK4M&Tr$PQy?$8Erx<) z`c~2cW2u<|9je08>0@!2L|d@F>=Hv>COwM{y~(}vTxxPtN;0iGXa?6cl32=bLGNWg z`~W@bpF!{U<=fv~9|9ysKYJIJphpR~Km_C`7y(yzOtim(p0a|< zAD|~8@_$|-GXI2njDY;gU#RzU-UcxHe?h$;Xz;84>qq;aKTwbE2kbEXNMZo;G=Qr5 z-Ht82%me{#7;gXVa#is@N|Lfc^nJKpUX{gnGY}v43eE^$+U( zdCB=dqh3h@pp31Q+N*|&I&9D;2?Qzb#0&0iO#u%ntjq}CVGUwV9q-LhK@(^-e-mdQ zGEV)Nlo5Sz3L}nn8&CguVkCf z@obnXUAf0uIo_FNH&ur3-Zs%=vhgslAnA10iPnmu^BzJnb7j}20;kkX(NK6wGIM2;^0nm7^O*{6<%y~T z7I;f?zGc+N?&teYG45HI0$skYj!F~{&+8zIJ4nEkoIZ0rkpxq@-M?k%bcAh0GKcjb znIoxVXE(jUVU2$33<`(}kZF=p$m-V14J!`-=N0Wq?D>XXtG^U6>T>^K7|I3r;&2B1 zBqN3MInfmNB4RCzk}LtCnQ8)eY7i!XoqCK_FQc-i9a?h+Ork+Bosw93OWtRquOJ*u zd=)6Ldn=!LNoG-Ik|zt>8>tm7*&VWxG;L?2J>q%j*`{e_bS~-Os))N0$G3cV zyojrX0I1e$=;yoTfJ%Q1h2`Y{jkYWx*4qO zG5nq9L&P~I+{5H;KAr=0ylaD{uP=#<{2(;wmqdv<_4FuifUUJ%Q^i?RXE1ju{BZw= zs_%y%vic3y4pIXaQ1b&sbA)V&Rzw_=)0D{Kg-;NhoMkuTG~RRbyvNpdz?7&VteMi7 zorlCN8+<=GSUG6h=k4kAS|a~loVTRm7>aTIQohD1VIOEPb(#}&9j4MnmciCZJ~Obt-3!a0@ZRVsf&Z;C?Zumsx#9ii0ao~mrh{IBaJP;-nsvA*gwT-;!#N3V7h1} zj*)SKq}KE~#=l-@r6ZU|=F8TLVT3*I#=7AFEvq!K&vKI>y$Q=$`kK3W7+$)dl*sXUX zuPK%oBh&(Kp$OxmKOfG*LdZP_QQaEfq76lYj`?D)dfCFdlXE9Y6NQkPwVr;%qv>4R zr;^EbL&EMg?|GYz1Oj&?un~;#j``!b+S14{UJnI`Ya%|x5MxpOoG}b`f#q16YV&Sk z#7^s@8fSy|9r}gT8{`m@XM}L)syobWo4R}A()MVug(uM*)x}}!WV5&A0;*>_=>Q?%d2)?7@qK0LDx)@~9 zgl%-TjhmV+-lO$BQ*DuQ*LmrCav&sRh-DX4e+s@YnFgILR*@n50@0_`?AW7irBtlV zcQf@!hab?KaAIl4ol|ISHYzCbmkL`C4@~*rF6GrPK#{VEka0OsC_ZJMrb-=U)i)b) zG&Q2h?2>+b27b0Cktsq(Qi)SLHzjZSij=1tQQG}h*T~{Iet*K1!A*9&z^lYQ)A@VV zkVKpv;#D#TYml)5N{qfi_O^i40m})7Ya@z(vTH>#?M!>FD%{)}u*Swwv({{8kX=ip zKTkNU@jG(d?BGz(z~prdASq~9K7w6;TOp6w#_SFg!_a}mF<`Yv_$cPY@Z5piy<8+E ztEaa?`orzM{UZ7sJWk!2;&41wmT;`cP?xQN&O)uJ=y5z9jBRt6ha_0_iRqBLX03rN zriV)Vw3Z>f8S24#Ucp>rC5ID?!7r}d zXwuJ-S0W4F+-$6t?aNS7mu$MrKmD?tTZ@W}PEU)Ig!Uyl0ocCc>(_p>uQYBf=Q@KT z)}7tHIBeuVjMwAqmY*>*;7W?Or#%OR0A#lzJs$t)K3f9ex*Q)=`mFqzsZ4`1)JYT- z;GOjow)Rk9m)8y8WP|SQqDzKjro{Ltf;jVTPh2C-UR)UHwz1|%Uz-P+fG7hNY_Vb% z_kgPF+IDaY!Pk7pMndzrKDjW{3`O8(FeRk%=!H0=dJE=EDeq9S$WC;)aN0x{)p;ja zqdcCrEIit+pNbE|6DNv>D)%BBJ8^Kcr6h*&ogpj0l1hEfBcp>v)ZhGkG&w+!^rzs-dNjAku-irHgN8`h4t0vnnrsh3gEU{piug z=fuRpaN6M0V>}%%PZ09xtaYoo3}Pu7$@(yv8YRh^W;Ls@$(l1F&dfckb~WR(HJJ2# zUY0X*px>@fABAcQup6ELyK!dwmZyYa4{S7zS~6`&kFuzeH@GOTK2dS0`s9)xoPIW5 zL{`N!ojTK%bFaTWf5{R@6xf5T6*mifc+tuB{B&dTxQAi_8p{~XAnfaTG{_UJ>6dhU zyHyeT(X-r>R<8n+Qad+gpyEJZAw+i6!;6ifKAnmJemgst==e2j!^vjUpis-#!>t2L zv3C%+^T27wM?CC&kMWUcTw1nbOyG4a}|T5)zdt_-DDv@~iCR8%DkH2jl7&Q8fdun5SSR-a{1 zoM!s_wL$Y|GQ<4wU9Vlz!gU5v#vOiL7M+7p6Ra9MHDk&s!^^oKh>7NaMznPR0DMzjew%(( z1MJ5#D^Y@s#mBE32C?Jh^Lj{$Nep6)X7Mf=ZZ+rBa`QY9*Lux%?@(Hvo3y&COvZqR ziq#vipgQJL>;#;NDbk}~+3ilRuv-XOX&NoInh8Lyz78LS%TM5!xm*scm7Xmht&dYf zW7k)-vXazn)kU#H9p0vO5;~lFnw0+RGKq>lIc5WQ%<~rWkjLs{k5J`vILrMs+F^?* z{dGT+(kmKz%$9==TJ{YM?B)-P+t#Z z9j%B^##-JO*a(_j82_M%-o{L^w|r2gSP1Og2DS)(AaCnR^Kwe}(Ora=sOBv8Pvco`LJ=lVS^3YPhBXJ0zs({1RcfJQq^A3)$n?YdHF4|1Nb(3CJ}7ykuVJ@POhF6aBAVGRi!1Vxl5|N|U_E zOZfb|S`#Fo2f{zKCP2&$c-@}~R6u>{?*u9nAf@pV#Q#MB`J>b4FNK&N4TS$lCH!Fl z`==2sAa(H958V$g|6h*)@opb zNHF|JQ~a}!U+?|#p7ek;_RGDOzW}-jBQ@m9qrcvr7EoPc2K4EE+0)DRKmP|nd7%f8 zNM71_GW_Vd@W-BCw*8$5VfkAI@!zvX{^cb6dn)8dF8Zh1*q@!4e@cb?QXBh!AoTxw zPJT|@|D6f>(M$u7U;dvnA$t1SI{MoB`kR-K5ROg|V~$rapQ>I#kUd2j-Vt;z4KFS~ zR&L(QDq;i(dtd}mzs3kaZ?C3>Ugm`s4+}HT)V>_Ktp~{=E)alhxqVk4-~tWJ4TO#! z=Pgfda{6dgBPw>I*%DoTpGSW_>UF%8Nr&c0r7FLm@&0*-R?Wi1Nu07Vy%aCMxYqdG@bt-`}}DKtk^2M87mtfmEXe)LtoH2036L(=xOC zQVbTAm-{2vC#Uj%<@#RSo&MrzK{5fljr=)5U%Gz$H9=_ru1dd5&_DYe|6Jkt!K?aX zf-(b~rvDz)fP??{ROdeh27VJmLjzj_OFclZS~bA*z^Ae>v2?KerGGtO7k?GmUna&s zBkf1s7x2kU%<#!00L@7ZUdE}Ny{&PHK4mMz{KKdLNvQwZ7t1?L3SPEsdS~QoalXOHcAur6fFZn3{OqbhA2`V zgNZhBa3UbmKGjJJ-TO1j{V7gz{w z7Undx${)VRYKvaEJl_@ig{L9&{@Yf))FP*xC)HOq;4Q%~%4k60)<^qwU13PgcZm!=-4mti|_UGSk&99+*0dcD6LbT41T%Xd!;=t1-6paVem zpBw*sF!^=3{2P}17{x!AlKyPw{u7q`A`W_aAaA8$Y4YQY{CO4u$ne+M2k4Fd?34Y= zK>BN~`}JJ^QB(WhQ6<(DOc~i|_No}FQm-`HD-oj+F-xR)PR$%2wJX3YB%Gv~!ou4k z#z=)#%&1@j_X%Y=Wmv?&gQxAX?G=as5+K5 zm21uLX?v33>vd=F+9QDv`bO7WPNprTt-L$3sw4TD%@Ooo4ta}Ym!zs9S3vw4m&5Jy zXtGx8`85z&`Ej$A9-DLD7#y?5+zG;4p>SL}$K>U}4X#A$(+w%k6nd9|DU-=VqoHI5 zw~-~6b2JL|i}`h8v3N=+YxT7%+vz=q5i^aMl9e)>=zT+`kVNkAboBy-DWfT9Q$mK% z3*sfYsB&}#5d|_+n5Ga6p?7|m5-f6J1yThxQ>vyI48fRU_0od{{Zq`QI9uEj83*~7 zF>e`S?;;lfCaAeG8wKGpNY#;vlJ5K#nToQZWNsmOpfbw^lvC6pIj+*31=snhQ|5c_ zg=h?c6&bE_%lY*&l+%HTvgi5j@>&BSiBd2bcQP~b&*cT+B6Z1} zbS-Vai&jG}0hcV3II90qIWPIX_<|=#AJ_Or?^H>eABUpOv!Q7fm zwdILjzVJ+# z!jp@%G~>%lX}Pu*Jg`m8%U#mx6#*vpC^Z#VP%ih5WM^yTh}#uks(0`?AAz$nr!#Kf%M6%co9HDXhh_v4@RE`> zP|*)D+8YA$@Ijt^Iyh_Y%2(50g64`q)HRCF!*?FC2b$~_$g7MY+2EKVRw(~6c0 z^z+E+zCng)w@jK;Fm(VOFc`>!;`7zZy9M-u&rbcS&ZJG6kzNKGwB<*IKBt2|aHKi7Yh_xWxrRC2atM-r z#SBCb&QxY35>+&X#Mc*521Ysb7d^V>p<*T7aaLLhHCSPUH)yL@n2jnz4zET&4hD6C zpW{j>b1c6hrsTa@YAZ(^-5rL+TNj-#cqbj1jH-p}oe5w0ttwMgzPq-cpQqiB+TB9c zjv8_u27z2AAdOYC@*WhnTqM>2YziNSd|-fFlIjKlQ<`%U_38-CAd`IKD6CFZ>X?{~4zA3dFD2wEQ=qE$C=z2|gV4jIV zA64be2`duLdtwa1vG7Sll1i z=arPcYCW6YcAZL|qkTaW>2Xd6%Ed`E5oARFTHz3aeO${z9sTLU#ZoOIO(z#_1lVee z)Pct=6CTC;wOWFHf+JBh*)dq{&aVz>G@j#$YEqt-7R?!4Ev|f|hYLInDdLsM{1v*a zR#Y|$uRfn>P?JMksF6TGJ0e&`1$L!s!ZbHq(h~Os8QB-yvSba0n4kwzscppSkgO|Y zzQF~y=K-tf)ZS7nYg&5a4IEblT{~arjzES@18X0K;3^mwU)|p!p3ek(UgXcN14V{U{OJQIcyPi=g%c>Y=rqIRt>44)v=Bu8&vl8q6V~ z;fjL9=d??nVaa1g>-6w#&gjp;`FNw6b9XkJrLcpFF@(9VQQ{MqLwp^mMZj{&gdQMq znG+7hu~S$1lz@+}t$2pgMm5{GciA4}qo9^+iG*)KZ8jk!{AM0*dBJ$b;;9I{H{`VN?c7rbc5jP=AI6h_ou)$ z=A@Ls31KfLn(yAhB7>CTtPn1Q59ySejw`#>TC|(|T zIv3YFW09xqd*BbAKnILZf7G0aE_YH>idXfvIL5rKojU9g8Vw*5w4co&23CL52;mHW zbpFT;zr?zvp1Wle6qql^-PVgbT$fk{Y5f`fkJrgum* zTmAwD!;6qily=`LXHvL~6RpBPNVGO)T;kpfmn&QQxdbv-fW%eps$;tfC$a>Jd1RczLAa1%0X*%c6CL$(O)P6C7bDpYG)A2c8sCxBi!ctI%vWCMvhBhg_V9X?@Bt*5En+GR)jp}2dcW6cU;V*tb^!zp-?g+ zf}1Tjh`6C`X|X$`gfzOF_U1&0?-fK$i9MYi8<2D09}|*4BX$c+;t`5uT_|^mTrjZu ze#pdPA+>WbFc=+&%7z)%h~5a<&bS136B6dlVpD;6%?eN_Tkh)QKQXtDQ{)@y>^9oa zBR}w5N?}*4s94J{k}T@g`$VDkS~9ZDB;Pnlrz2q=!00WUiv$tU`!8y)eIf*(%?q4& zb5jI9KsvvSVi*wm?0W`=xY==Vc9pnWS8`^^oHryj03#R%hbVNC#XnAFUP^+6^I`SV z;R9g-EX}H4y3z<QdArMMqj8n(B>xB-IM~rg zss2>sfGfmaGO7-IFI?vbPK~fVX?JcH=64}AncaP@U5(WFa}`F>$#9>>ir0#8)( zLQ`AFFttY8!OM+(4Jt8jQ{&m{<&O;i*aP_1ZN-Jbljy`r9N0 zc;_T;)H0S>&zP`f54~8EhtK5qU@eyw_WQy+hA3{%7BY%tF_o=k_>csaU3q_(G+?lj z2D~)LRXy4pmQE#e1AY^0Ykq!fYZHD00}~VCz@3c@k~Ir)AkQ^Lai`aADF*L0R@E9f zdJ;DqSp>8KI^)C70AhiTXoJOd=2^oXajHy-o#CXW1{gtra3o#!)!%8sMNz~MfMR88Qss2=FO0KQr=dw8)M{50rc)Gl`I6|BI4&U z+iR82un0Qt_CBQ9xh8%TnPKUH4i@nsNI7G#qXaRfI+04&;G*9tsUCg&Msi-J-i|&< z%Z@vFZOJFa-oH?rH4mg1w+1xKMqDgzrX-E%<0P~mZaN5GmuIkR`tZ5uO`rqT3|lHt zh;RHfA=KH5>ycBYW$Txdy=kV=j9M1sFC;v0IuKv^-T#=bj$WF%`Vy3IjW$Qht;Nfd`7tBI*L{d0hSim7LiM zEU3|fA`vrjViCBp5lW3Xat^N$>30K5E8nNC?wnQG9)=8e*4nDzJM zcSA}oBCFa^KM8lNNv*b8n1)X#47zW88|;rJ$24CYsB|)efHEHpny#Rfr&c{AT;lsnM3q?I~abR372#<69mbz`j-b^GA&oc2S zFn#r_iWIjqy7@s%c&%j>w3mOb3OP98c0}TRqeK0Cz{g%3Jxud#i0Pha+WBt_i@cb- zhM1(tAZJqAZF1~wtaHMG8(8>NLu&?(?v3C`$ri7BZlsLofGN!}-W2s~ej9Im!y>>l z=RMp9bbC9P{qAy&43UQ4C=pt{cSAACD#7KX7w7!$w2b$n?)%Vqvx=rAc3d#)qG#=s zQiMJ4N@*%Sq(r5?E(R{xZkbYw}tnE)ro->Qe{#lu$^BLQ9q@Rh-%Ofzv4ix zWk1WVFbDYI%$Xj!Yfdgzg{7dxgxs;bIfT~Z^}2x~!Q6NGQ&Y&~lSq^G4-)|uMM1Zv zBvff$tLO!vd$aP0=d;3xERh$d{6Yrm%-QeLROi@BU>m+ey9bkTjS;fHvW=@M`P{$P ze1=%WBHXjAsPYEoqhZD)`L1KHEd$<@08?LOQ@u1R@H@HnF6h+BnRw!@?ctENSqa|2bF7u>Gi`OQrPE^+N@$M-_QBAMa~cyAsZ^q#jDCngxjZrKz+Ap9hTlYY zi`L+?PiF_Qap@hHyrCL$5*iK;7TWg+{X%3(lnhm0-tv>ga9&EW__rjCH|&!f&zj< zcIEk11#bls5yRQl65GMh>ZY7chhZybo6G4S-(=|YCwXWLRYYDziMijl;s|(PK-@Dc z8}lI5xarNlJ6)XvNe}?7gE0VR=2(MB0%BZwyo2iR*b)I54<6tr4$J}# zkC5s(j+Vlkc(34PeHz-T`B6-=s6p!1V^h$m{9f@>@&b--pntn`tZ3|~DfR(jB38fg zlxdCzC(HSRcd$jMU-&;DZ&waOHa@CAbeOtz3Acok(EF;Oe4=F_b)h7V#F@CEM}J*) z8dkDek=TMChKxZ

QT6v=FKweo8AtOkC~DG*^hN-Ku3TL@_}w=aXSwfpHg9BQRcL z>tUHj{JwuKYTkDXJy=sNt-)D77L0YZn*ev|(_4(G4)%)Hz{ZWED?7ttmhv@AGNvA< z9mJ}*@_Q3V5pH)6*R#E)ulrg1^|uTM2i2sbsgo&nZc4TD1}T;M*tlBdi4E%$u~ zSgmt>RnS%w5LBfd)r?m&K1sCIRQ5{XSKD~8R`jWN$8?$c`sj9LBqcIFLS)wiQ4|N# zQ#8=WR$b<;Y1Z{R$vrX8W^%X&b!H(SV8<6-x3)U2%`my;-58x062%n5%Dj{97H%)L z*JNu1;sJIAFZQ>t_O}2pKDma0y;_z-kzbUS(U?39LKXb3(}XLC1p5SKSms1|p(cuk zRN^*p=1-~t-aLUx$Pm@X_=*^WSS<7O6_$AO`F=erSM@}cbJHcsAX?ye<0Y}R@t~gh?101)G#-{s|JKdz|OJ+wOaCCg%6K1 z+7z{Ne((B2ZjE1u$m*CS><_L2NAXFvwfJo(Q#jxb=oWUKy^VGxyv`9KdHsIPF{%ko zSeTUy7&S-d6) zSat!1v8TK^PKc7)Yt9Psdr_pLw9q>a|F}p{-)GI3-s2i5b>s?zPB>W$^~3K_dG?z- zDDfSZRP$vv=R%e$W}+!|L1QOlL6JdY;CNN3D$e$6vpb1!Qwr9XY_NwWBpNq``@Q?V z3L?QeeN93!2SojNsnG=RUAztac( zhULWgpQKW>0D8~wSxx{>4khgisRuw4`d77-puDW0klYK&N&dgHxnW=ikeUAAH~|!= ze^V&v|5YyagL3q%T+{`fZk z`VAOnf1COI!Or^s5v3sQ-=V@ngpQO!W9MG6Bque+(6VA$rgPtd#y{b-d7t{)1@vM}xMPLH-N9gZYK5 z0(gU8Kl6Xlbu9c(dItqmB~s%$S^k&ur2ODzvhrCkT?#TqY2@$Clx1Qndqonbog}sW7V`XKLNFqoQCmk|YCHBx zV=d}*3N;O${z2?mx`8-u<^r@CgX2u5by&E-pfehNG9FQHjMy30DzhH{!Ryc}KSOd0 zR4Brk{n+5RdU*GSf`olLS;O!kZQU%VO zEUVQ?Q+stWkegj!89_MT69>KaE*j&8`JQ?294-!{r}AFed1oNB7F&~HR~Z77kbW!M z!*axmd%ucZQ9ZxM>$DM123q4yt*iqfl<;qKstk8`3G;d#&?t}4D8fdO`}|sa1R_)c zC;@WjSQ_%7n3%qiVZD{#ci}hpmBK@A<0Nl2&!aNnnyJ`ogO4L)-j>9ZhJf!Vt`Y^? zG_N?Mdy?^jTG8ynz^Qce)GwgjW*KK&_qwxHGuk4De2%dZ5jiCbI4$DAJVMb>6~M*t zX1^I&DbZ%sVCfln>%(3L8GBZ0ECFLmCO#56ycs>w83|3}TtML09L!bO!AS2y6t@R` z??5<=RIU^3ZHTqIZd#!V97)5K(hr)l1t&{HI3Ej;2sr%ggJ9fv zx@K;(vUi;g_zB~Y-!8YH(^STPyF0SS5!SA|f|orp9i??a(Jib>yld2pgwnithf4!= zeXD~F{l?>&3iF%(5IP6_F8|JAdV>UXFSMe0abO2mf11qrX`UgsH|_fta`b+L%Jxko zN>e~1YQ(gY4`b}Kw~W}gCjt1?M4r742QdiINUFQ3UlL-aBbB`%Wn?5JWn5>NA{DGt zWt>3At(sLnm`r5$1Zck*fT_X~je75cK8Y2u-zLDcYsb-du^7|~LmjP+4mzR;e1)FEX1>AbaOlHq)jmJ5D|03q7Gp0cJkW212OVEZyyjY-oi@3do4nB^!XgbosQH zWZ%t;s(iOotDLyz;e>-7UhSC~gQ9J{H%%Kp&}mKOK)3gPw6)P@<0@qzR*uVFy-L}+ zo5<(?$J<+g=aHjZ!g0*Z%*@Qp%*@O&GutsUGc!A8W@e6=nIUG!_&Yt*Gu<Ql*8Dph@@qgO}g2tI0osZQMJ;O zPn}+V%9PP;TJUH~Jj03-jwdm+;M!X5=Us_fSXjK;GHj8m?J=J8GtS<)csyQ+)LhhL zWlOE5r5lN40V7pYw`uMhyofIZB`_&u2QBB^?>Wfl9ZyBI1e5z--OAW7T_>dMZ;1&p z3ws?@@kQK)BAOvy*2(m%#PBm)CjJoE(^OR$v_cNKz<7b_I!mNMU4Abz*!>XoG~SeRk}fe&%^W2bfqra{r<6Cg?Nv+UbZv%6ieHheZt zBFg$#G<;7#PP=NDA}|5ugUVOS_EDluBX|jiNY5?4o;@)@BP4jp+KO7mA!ff``Bb{)GXuv&=rkP z4WBwrP`Q8}vX}rKhF*1|Kv67ZxXV#$c^L4O(}shsHcG(w!l&~XXEqs5$}MNsDN$|k z<39Ja7zU0X-)mC?q>yTvd{88?o%^GDtteA3kAMkmx2LwB0&50{xcMjb@2=d4Me zWu`*|>9T$=BEB9!(4ZmlP#s|Erz%F2gOU)7&m}_AL{crF5H%+w{66AExqsQBu>*Bo&r-XP^X1@o-wU#*zUCT4RQT@9~c5JJyie)ib%}ULsE0ZCmS&z zNiC2x__`{^3o9N!*a02H3&`T)Al_IUi-x18C71i{cQ*?GRR%23t8I%O zC-=}lVf|Y6W)oiU`oZ?2vdKb4dZ1f~Pm(@Y&hNI@M#UW57FEfiv*gsq_0FDh<5NqCoykeHi)4{k*8gfCttXwLEkS)car@J{Z`Fp_1GBHr17 zd40WVSZ!>rNFSvw>=_CEFcmEl6iu-~<>~EUYi~ErCD^ajlozn6>+|nPZ{)f8N+Sqe zLY_l_6_~3%4Dd7Yr`gL%-UH!*#{7i8bb-)7Faa-ecFr0m@>iLxt{{7)L@i6N5|u0) z1G|)5|J{$3S@aa}E{$cgYRjSSmsXP*`HobLYpq_024^Urff2X-tGqp?J*kltF?gsc zC>x6?le#he(X+4)iFdg$ol!3ddd?V8V2AEq?=F{6+;urt2LEJ;M}_#j`!uIv#$giIUH{yO;OovnB4j8!*;= z$}GQt@M*i)4(F%49e_aaJ)E{i8^k~djb>qlQQLN2YXWVQO%F9-vU;7(sjq-62Ll6x zgaj)AD=#lEDM4i0Py+(Z#gwz}dkv~~rJSpE64w>YNsYLfY`FQ{Xfk(k;5=W1rJPvC zRHl$kGiQKFXh~TcmS*45=iPdA3e-5BS&Y5N9W{t@Z5<3)cbLquKzlCXg51oSuh?j+ zDZ3e@Gl2VOVt1_nQ+(g1-O5lRbC0YGX!4tzp)cfBqw7rja&|`jJ4e8j+$)ww!iwTy z7#JG2c*Z$6l*c_aH-UDfb~S19%j>E&6b7)`!^|c;I!qQ@dob7YY7>bcURZ5MTT5)O zu5`tUXt)IYcSX70{3b97+Sx^^y70Ty;Cp5}xt~)N11+~iUc>8zqSq%H0ZS=q90+c6 zGsw@2AY&IxvaACdWHodJH-H$z_z!qfd@j1Pnos#lOzIf1yXIu+rI7Oh!9l`5XhbkwUrK(p>^-k<1>& z0PlR!^)AjEd$t#wSTECf_$LxaU*4X}bj{b^M-otJvpiv6+pe=JWWP4}Rq!5nEi|!K zy_ehwy5FxEnfJ0N?M@jRnHc3E6iH~{U}2ElsCzj)herjYb|Ruk&GZ^@hXgkFheC4( z;0H`s2IYtmm>dto<-JqLqi;&s^q78Aa+HuBA6X)dT~xT?mgg!>w$m>SZKF>{;D7pJ z%4RYDB`r9B!2ID{W3F3w02@8`xVCTjo=#$ldS01V8MRQA?hD8F7T~V*?TY0@_FgPMqo|DLIu9Ctgr>IjUcpvI@3f1+X@QHgPollu+aTd2 zjlB=`CwL!vqam>cq?^dusaf6rReSe?L#}6&c4nd3EUjhDG)=-2xmXRYT;IgBL+s&i z2G}=^+waKRxsV?=8O)c$EMTfMR_ZWi?d*gwy@~KgFgryHyQX#8F8ukOny?$T5V+g#5or-|$v)b^A*f zlT390%@eL_C|8K9%nnwl-Ge)eS z|AR=&@!baXH9MIoej8`{`|Fy)J&^N`H8)!B)?UX-78LgnWvF7?H@SiAZ@V^#Vyrl!| zb1|YSf3JL84PXwPEc=A;UU0gqUrr$@j~<3ZG(aH7C0=vx>QPH5PM=UpA=$oViMH%; z&pL%v$&oNte$1J4Fy&^gULJ4$PhXbW~B zooisg95pPL%m|S%QDDqS!of)NK5V#~6AFj_Ns1|g<0oWXGIlvn4e3E=^?h|^X#5jb z9-&C;*#xUz%6fC?%Kd&(#etwZxxNDv5MQVh>@TL3} zB%2~trMe1_ot8bkypl7~3yi)B=I0|w;DE%g8`p&)6ZW~ueNIXrw43@f`)Swp4}^Ow z`*d zaR3pQ8xV*!&5u+Uba)#F>Vo$P#@BVH;$1Pr5eZykPjO9Iwzic}1JU=0!-Lnp^p7jy z9O%i@X9=%FfqT$L2g@c7kP;E1$HyScYr}H(fY<{sk{(Z<48uKAjdV3$uIRa?FVQW) zjT9Audv<%C(Lri%Z#11ZvIy)%P2w79(7Qn5)6L?r_n z$&o@VWEqd6^cg9)M{mrXU{R=v4rDyjpW1cbfAD2Wd2I`!<#C;?GNXI&-SOvtclDSlNL5V zziBtjn3I8i(4h+l(w4Le(_j}W)=-s*_SmmPBss^4Hy%-kIWt08q3Aw!8iwo5!A580 zy_OKsFs8nU3&cu^nF~ofwG`#f@Ae8Y0AL3_8=y`;F-L)p5qJ3=B@a!59-(6|^)9oI zP6YbLK7yToy{{KJN>DGOx{lY+pHw!cWF}i}d_75}#mRa%x}ti%lLVgPn(KYhtp3Vo zx=x*!m>U*2NbBAv+gHbW(rZyE{w%=Pb*Lh+M;1Q^uBN zKD94V_fvAdtt8?4Ke82<_S%7@(F_QT@7N^PJhPjMp#e0o~>t6>IZukz~BYL@8O#%KQ%CuF*S}_%{NrsQ6!8PFB=WZXOga>`5I_F zg}=C->&w!wz7OYuCLmW17j~3v4V0whcj%&ub z^8B_7M{DJvePhN6{GC?!zI+Ao+Y!Qz**)MI=EG03to5gO%{SzJ_4h_H&-oSMJ`$d6 z06_ie2U(xaOIzcbr1aqQCH8wO_w{{?O)nqwyENo`%mc8jz%tDu1%~AQd91lrM;Exj za4?|SkOp3!CwZv1pi|2y@~RB9Jk!_RS#8Lg@<@#&9G&1Yd6QBN!h++;_g9EoB6??Q z&U&yx4i~<0z}%Av;(00@*p&ATB84&Txou+f)Kqn&szQodE;2TP(Wzobbo9>Um^ga4 zMg&Je1e8-!!>dPjpo`n@$9i@b83)7QFwqlw=PX{%mm}wmoI@u9gc6S!mwppQOvOs% z@(dD_c$^6l-v{p;B65j7@zKda!LBT$bYb8==;>~DK=Vt3mSbW@Zd&NyQlt4mia>U+ zQ?RIYi=LsHysUmNq}w>D{~5rk4HP$?6vKsHdnZi(R;Gr2VZnI+%@j3d{RJI6bV$>R zIh##LboY%6xHM%rkIc%@-HRVX_48|mx5t6n?dA3h*|sV^cv z=%jb153Y!3y5KmwrR~o;-gNCe5wc+NM00{(1Y>$}qW!lz0(y-=IX^2SJ0&+^XFL5Q z@`tJ;s8Awq(A?8lfh!JN6ylhniS2YYN4H=&jqsD6QJ+wk-KayHRGl)-Mj~# z&iiRcThqo6;tvm)=0#6@-^2R8BWE$IVEXd{>!zkxes3}GX9v9W*yJQ}5JCYX0ffSu z5vsN$@(1C%4-qw|~U)6Rs zUz4R4sspfLiVqWTJku5|;~E0836l-w$0Nve5(64@KAEHih?%5{)(2aLhe?3|d!4Bk zj_z70;YmoZ4(oA(UklP4zC;J_17s1B`^@qL!Id$WvO3x)?$nNBegCqS-52p%V3G_bpos|HuxE z%YyinVZ)6uJR)vs8-Qxr!$UxLAGdD)LP@eQ9q*my&;?!daK&6)Be8rc?d?=g3}G#Yk)8N z>cNh8&0=G1+2eGFiKIohWcVOVHtS1!NQ$WLMM{n5DTfE?w!E!8q=jyX&QbplfBeu_ zdzD=vbbK^ouC!uC+`5yp1EOv#asAo^77Y|CMyHmA1nZV zbBg(Wrt_b=rvHPy1?Io=7Cux~{*|{NA*Cw%H*prF|5}{o57G~KAHp)f^A-xYL0xcd;WVwg+vt(B}7w{Y$78DJlKJ#yPni$tLW&4a1|;E zO;uDSAYr&^ZDhG>vP(Xo&%^m&w`0c?`^Dr0!0>{=Mk#2x$5bMBRU(Tzzsx(&*LkU} zYSfqOI`iJ2$$&BFFTTw<*xOIC-b{GCdOx^SeYHhE`0T4Udon%D+{1tKS%83WQ$y_t z)yCs7%_(U5BP7m>JlW9r#;A5COvcq7QWB~Yps!H17(gd0Kn5pPw8RS$Q&?nbJUC_= zG`ta=TnrCHFO7%99x4vLf5y-=Ke2AOLo_u~HLa+V$q|Xif|%P6K@g!PUO}n??<)jU zlNLhc7XmFrR}-ry836az&q44t2i&FC{|6Dt$4US`aPS&gJoqy>v;f5b6WhLCLpR_5pw$-h z(>b^NrgR>E@vTCEUtKzbUl}%`QuzDN5vrxIWZ@5U$(rZBf%)UM#zaQ3G&eUiylIvq%R+_Xk+pKNw%!b@Vw zEUW@+baJ6b2m7z~U4z%wv0NOn<+{>%VLc3@K^?Nwo}V45XVu7F2pyJld5q}NBt(Ut zsbST8cFQlRk}M8j`@DI>J|)$eZ9^ilnUaBwnFr63#6H~`nv>*YaeD@k5JnI1wqM|O zG&Bo+0h)0242tI1x*1QC&1Os;UsQi@IsgW#RO{S*+bR)-`I>4v14Y9L`K5)bmPR1f z(E<`naFT!1o;a`F)X?ROoe9+q@2QWL^MulgoPCu0r$nizm#sPsm2XZsuBV7{W+Chv zE38fcZti@OGa~aKDP*{gKCoHQ&k=3-&rw^$k+i_hm_#2{Z|XU?78D+=T`6%{HNwj+ZzqfPIozFhF_d< zDwiOYG;jE|eJpQ^=C@1XXJ&au!2If5+nTD4(R~CcHpVRSb!;oazcJL1AekcErpgDj zTxNg;`beP)_oXJKt*n5QHg>BmLC!6z+HjevV$?>?Mv-_$7M1Z7N-6^5+JEsyo?%y-YY5rclTQLx35@kRVV*#@zDyGBT|Jvo|7$dXdZe zLqg0T4^G@BjNR$&rMr|j`yv_!b`zyTekCyYsO7B~gvp6}Xr;g^P2>@%q>B*$QRvww zb1Z&o!IWyYn&1@Sl&Tfou~vIj3b{@j7aAhx$4&)tsGa-r43@czwdyizpqIx5iU3gq zA$^aBwB_@iWl=?`K^ImD(XhPOX3SYoMc;{+tw0}CzmJmsCy2mL_Es<8vX<+$swes2 zRsr!!#ktR`q7C%u^HL2va)B6RgjlmtB1{A+(WHZ&GzjB1!xv2R#qEUoIz-ZbZ%3qc!p42ca@@#+2Nm?!q_TNn$ zsj*sD?*WVlyUPK=kQSoZA@o#BIZa26FAeVRT+)p2uI1Dm>iYTJ)*Q-5pzcv0*&({! z3sJfoa$uxQ1Qg4DXX0b^R6|38g@tZq#49Zm>XfsY!o#-0*@bOq_v%(w^!yq2eX3W# z?M??AcD_yE<^ZFC4|Msg=C#w^;7PnP)SR+%gGzZh%vX$+Ei$zI4u%+h4YmEJYq)`; zc4kie7!5o6Tm6T?){SU1t69B$yPRA1=kYN)rA1URf7M;EIvQ6f+_Mic7g*i4zvdn6y4&KW zLZ%K{o1GhYn;_|%7H6k2YmGswmxC_44@u|kn!#!-44;#=DE0bY%YY~w=$8PdP`c6y z#{N)ztH*i`XSy&KGh!IgmMfwd&HXW}4~tQlTWs*6WFQOTlme`mX$aWv&od3ZK8Um` z;S@+E6|_eL$f_dJ64n2i&j7yFATRRxsotoCi@kwxH$;AOnYj^J-TWRL_13YH?6AVc z4BD|^pIj0mQEIZWAQE%zMtM0ghJT+KT_~6h@J07HwN^Gk97(f37DhSM0eIY);7kP+4kS` z?MliSPYtrVTU*n#*WF1G`+Wc^NOb;^JpCIm`8C>Lpl4wDT?FidJpD&Ct$%{9|G`1X ze;`kb$twL_A@YMf?alr{Mg41$$Pf9+-zDfi3^xDw_|w11IR48x4sVEgS6`M}Jo=0=WY4j)dVACiE-VcdVReLw6v{$Q5zVUYSC*uH-<%V7U?8NZK# z{~_GR{!2LWzr*%bPVkUJR7D!RJg8CM@LQj(XGo7aS1Xn(4Ff)dqV`k74axCSq*SO8 z-q%OyB?KT=B8ss^a6<(Y@B>E~-My)(8c*?ABJU|)>Kg<;5}$Yh1N%2UPtVsE zKsX5zOnC?iVT)-Eq~M(y$Pi&)GN1`z-#oAaK5(;`u;PrlY=nF!u{6?G$t2?P_*Wv? zS4{$Q0bfR0!f2m8a$Cb-O^SkTEfi2%cQH8raFjSb1bbdf`|GzVwg5s+F(%AxSHqp2 z;eoMaQI+6e;=w^mZsxB;`CNhMtU4ZwVGdXBD9`IH3_6;i^9^ghnW9p6-B{M#b9Nm0 zPB&%HZLHSHS#q}+>9x(kj^;QeO4@pg8+iGbZmP{`jZXZsvN#D8hu_~7M|V+lD1;y( zmsF1A4lyCiTB0*G`9YyVDIz9UE|hS;Q)&-zCpJNoQVc@H^qvi`AZNwQxHW{7*QfG) z{~QnPo_WnYfJ4SLy9P$8+02+~D&5h&CG??WaA7kpYqcxPeIo9iw`{*z z(Y(y!aj`fNc=B#>*7Sm#3s3e+_J#H~aQ!z;C~3l=B=6u(H|XbB;_Hl;Wd^ka>Z&V~ zCzyB3Al{DQO$5)3jvD=l@iAAxjm7%Q^ODoLtXf++iyF3yi6sANsNik1TXWF491!JN zH!tNpYX|XO8MTp$N19{bQ-Skt^~o%5BOIW?%mvt1J5C0AQdGW!=9JWa7IV3w?&^$KQP*>6FtAMceDdK6?Y1 zWLPv@--(bgY^0jHSX*3K&_A_a-vmRsINEwx5bTbCIhRsA&OcNob4htfDd#h-Wa1;w zx9`qXr{5WtaK#rha2?2S9!P^NnGzbH2w z-hnvsEUBRR&PZfJ5i&sWA|#VV#^tq3!wTHnd+gY@o%uoVTq7zg$k1=<*Gi1Ew(vful)w#wW1BO3WX2M>Phc>W9z{^2|NH+b;R4)%|o@&9Xh z@W_XS=5y@mg+_y6q)_+#(?TQmJBg!bp& z|Cf^Z?+UK}zSif@z5nmlXMbAj!~W|!{yV+Dmx`MjqA5-mehfOiP4WD~q+a={vT&Q@ zm6`B>d%l)V$r>3>N{&!GMKZtOK{B5hTjVxe9++PUClBtx_Hy`PW>)pwEu}#+-Ac(>o!55M{fPGOf5$Jpq`My$cB|Kyy>Y@YrtT}`) zJPlvd_&bE}^4S6RsJ7z!<9Hr)O2 zmX7Y&Y%PFDBFrGlgpy?|F+mxH{bUSsg_@%Tl>MPUYcA|dHm z)yz;!KNU5n#cuUI6eTCrjX#v?o*NY1W3Vbp)+1!pk2O)J^PR;Fi&;^Jv_^d4w&(Rp zh|o>0?2bG@pxd91X8Ocg*CTts`*qd#Lf>B$z>Hrlf%=T#BPy1%Vr|dx9Y;4PdUl|? z8%m%>;o8S)2o`=Vi=n;A^L~jy2hd3&DY*rftX(m9VB(ZfT%f3V&T+!RV7stM8N6+V z--CO_jpk>{!{rrzb;I)OYfgk~;q5f}9$Ifw5@`4&avIv}&x{NmFx!_dVKA!NtF`n= zent2ixmHlw4^oqnato~fvb`(K#lgz;LLlc|&^CEIji4p1(~*;AW{<#j z>KG6Tzhk4x%*Kfo_Cbk0=;s3gang16z`BsuObmG`iG9HizbRS{CS(vpn={{`EikM= zt{-Mh(2-t#8^Tg7MrU$@D=_kMh7a(#hG9^_9V>D;qoVOu-qBhY5xoMwIkKOvP^#H; zn%I`kRDumy)0TzJDBw+a6Z(yfzT(s_ABN-V9m`emZt*;RBQ?|^I9y2<9?Z;ATev$gMp;pCj0H}V8on9LF)`gZT~7A#gt ze`MGXANUjBhwGD9KnD=lQFdROuwIo9A-w6aHWLe4@=h*1fJ95Rn_%}2EcU5=*n<>_ zLItHjGB(-K3p6-{$T`+^0>MR_O%~TxbMz*Ptz^b+(~8mPEejcGGW00cMOq>hDG)Wq zwwyZa4&$}=-EHWu;NjK=Oe?`!`DRKp0DUsC8I#087LJ$ex*5{<2re>(T^7`Wvq@@} ziz+qU<^_-S+Y}^zp?ajcE{pT{{w3q-PtRCeJmNqZdKKU_1heTWvVHgoo??EJtEBG) z{^#PJX(pl)X(nFAAr}sMHAJ(UKD{^8#+-qWp#y0I$~p=)pBJjP(@{NKt(zTn2a5Oo zWuPlGkeVP|(eh_QQ$aE(jkXx;oRf`AP)Eym(tKZMoS(`;es=b2;Wu&(qFFebHxoo#<(?8Qj4iEAc(`U zL&hNcVNjT}Aq^XY$JyF3-sku;8kgtn-Zo}LZsNAUT^YsQH)_ziyU^t{#&lRJKfVRi zWhL1Mcps6A(snZxr_wGsv{~UCc^k5+L#N{$S~e}-hx7mrJ$SF1nK6<5Sfg;b4UD)p z0#;^iNZ+5~H@lJP_amc<6ghq!ORnE`_Y2LNH?4Ux&w3thIK-J_BD+*yi!i3i+XzM4 z;!SXNkr@o13g&1r+#G{@IJ8-8YEpl&e1AYj;a0-(JqC*uLBPC z*g*zgMUHK-gI2|$ar|+QG<1mTIb&?g!28pdXQeOnNjsJAvBjBw%(3Vqrl*XMlb{9Q z!;TLoE_OWTbeWArcU(pAbDLAS!k&2E70ta6$ivG#d6l=KU!l=v!@Ihl%y=SX;uxhr zEDdHx`KZiSA(cW2$&)gvU=}Jl>I-=A3kk8wuy0NQt@#||X6Y@}=N56!hjIbuEbvnf#-`D9V7fx%3JQ9vWmo_T z%FIJy`od%4Av9|r5*QP)wPOUBi>$^#X!mF*0^C*$?cOodt(s9nT>{#8()!t>3iN$R zxwj~!gj&Dg{2)VVeH>1D1xoKmB69yZfqnGx9Gqc_a#y$WaT_31zeyH1S_h>_t8PKx zxp#%d;c%ky+yc9OCL8aQyXWM+ZHKaes1g zZ%w-M;t2d1nV61=W;WCjDFv(~Vee&ERnvKfDq(Bxips{U14~v`%`DBTd_b}jQ*y4& zgujI8zhgWG2IfCVAh7>+;O8%3I_rlC${+kASQtJu2!0j&%`KLJ?w50frM{^H9wP(9 zKRhJxG^tsbei^+mgkxE6}rg8~zs{{g-X@KVo=nAES-G zYao1BLHv_T@L?PACmV?mxrSdz@Q>>Mzj?C!8jxt>F){y&L;daNkK4cJ{hqQgGvTrP zqCotM|I6R^f5h;9wZgAYfAeDb{r~hwT=IIu#{1Hx?Y*?q>vY4R^Ct7MjbU)sFLuP}m5Y0w)xFZr(N6b_+iUPGRkJWS ze;^lShmL&-1z}S^NnSfkr7tCerw?tjvoB@wRjLoY`g zVjEzUpbsr56~8VYI{hZxZdfd)CH>)P{XXFRkl1{YXmn2Nmw?cC zEK=E2jtTQ8sG!u|2m=;|OM1za(s8pve>>wMdc&0Y2u#K#^-(F)L3)c+<8fCL?7EE9 zkqT24y1JCm2+|u+6NKG?3Ih|ys0hxwl;!UBv1U3zv@G;tC<9A$P!q84!N)_lre~?C zx6={CnYX@{v1cKHk%9b^BTXZh8bRuBX8SgGsRj`Q!ZVYTCJt=4m8HopRpAR1ry8fY z9;hp7tCltFCO2#M+^d&ojmw#J9y6r%Rl=LK-eKOzuii(n_l@_I=e*d}j@^?0y4Qj~ zv1*#uWl`og8TAl2rD|ocs4jP^!yXh%)^~=XYN49p4L~_kkT97UyAc}!<@r*w6rG%1 zB9uaLYn*vUR4qilf@ezYgh8Y>w^-0r(R{}W@e`XaC^rnPe7@6j!ZPb+BxGdNgSD-p z7|?%JF7elRL?~m*2wewU#cRi-#JznwW5HrWgATLkANdj{VW+eSK)Ox#0>33-4Znkyerremh?!$r+;D7gM{D9lW{|GE}FAOb$QXjM6F zKzs)MC>#a?GIo9Gz~#wnxQhk_P#X;;2D?T68Of+^U41a2YvB9jyO+WCPN$)MOpY)l zaBB9KLId8Bz)!?Kd!+|dj&1tjIozWzgZQZ!&aD<@(ehBh3htW_)i~)HzsY0GiOHJ# zOU`J}Ty*Pr>LU;hnKy(U`?+6M8h`&vNC-fh-ICYG&qnqTMxtFl|D}F(eEjtaZsaHS zs;VKITge@dzQY0{t7u7Q}( zGh2LqW*atSdeJJFvGC=gGlQR-Gz&{+-$y*NswR%tCM4*iM2t&4IA>3l z$uNy10UXIGR$?36}h}Kd2}{i?VKC zAyv_aAww=4OI&+F+P>Mg@eFu;*7@~5d!|V>ONm9RGfoj$dK$rEjX;>X{W@8ys9|(w zjyYYHX8Oe7Xp`U#SDdNV;LC$91cK9w;FcUTyRyU;4rC(7`t})vS70SnGex{XlL-%X zk*zDH^LK+X0}FoG`BW!#4(hY*R#QnW`VYnpQ?4p-C0$OJQUjr|c3nGViv@}=(`+l`%ScL19L$QY*zES! zZ8P&sWF_~Mw`?CzZEUe16mjEoaW?3CG!s$PYL5;vE+(IyLR&+nUqT(Mh>O2I--dyr zOAWTVRwyZgL^3C{m$@b1rBaF~2iCHp(IC6@QVCTk~>sC4tx;OkD%*jHr8z$B!GX}e7&ssGIb{1WEF3zJazU7EJ z@36oT?9<=8Z6 z>^XX5i$}!iU@du99UV|c~El+)5Cgo(9NSGdS!1D zj#m5g`AO@rKu@td@p!?j2V}viQcEalF4nc<0B|tdS!UmqU%Kg3?}TV{_rxOVnh7~A zBJSH5?Y+nOQcW6xkL}ie{9+Y<4baP2eBtBbjI8X7>FlGX%fw+D?n6Kv2?Db1=ant` zc3DPotm+GdXDXYqoh&0Nne`pAihMb=Z{4YKbqh^K9keJ2b^rpXtb<9-ibD2(W!9r49*`0R~GhRl#9T3Zog0CcF*#*)QN~ zssGRc$k^raf&xi6Y!*2IUVq~XHGzszCZ35v$3fVCS3!?hZ6;Fk>w5_EF-?s2o}egt z7eap_(xu1{V-iXK5de=V{aW~$Ba{$yc_=*iiniW|8N;Se_+p?0v|szE@u|g6CzbN3 ziW@nARPC8@Nz)D^ibO?Z4pct1F#_iOh9A{=ZBga(gW-03-t1h(t4G7htA_DYP|T67 z8u$rjsqFWaITtX)f|Yzf(vIrbO20{U2kr%P(^xkopjs0LU1RCy90BKOgi5PAEI{IG zG(!SI+i%$doIR$!0aDh7+_T+L?Oo6JnMq?V0W7?<&TeLE!ydNzVHAkV8APGJ{WrW@ zXv-6-_7Nv>H`1J#pI-$18m%nAzHk^@njs7$)Ml{EQ@)ebTPq~G0ad1t3~D57Vn^4ak;^w?hlBx$P!KMTw>lJKm&47A9eU$M!J!)N0*4`C5kUNy4g#uRwjgS( z=3rzdq!!GVk3%-fNGy5!unh=CAc9)#m9A@c?!&hf*T2dgWvC~X@pn)xom;RUp^w2U zS^Dy7>bT=Z=4axr#{y%3C!QRW7@Md>6bd-cA1xG5mUcxH#UUAw?|k*19+dvxhEa(t zDH5$IT@fk?0`pT0?(hZXq^Qowmb8XX*U^WMS<^?O6Qwc<6d^KL9*#Ag85ib5#<)4c zq-wn&WG=#2uPixJKR&W4gDPJ z%a>-BR$iIgMlG$Dy1shjRYkAS&+X=`TKg(V8at_)A#30*De1Z$n`;WWYcOTF0XGnW zI7$lf2{~GY{s<*IA!iJ{1MDoW`CV6M*|Fx2Z(osueR2hZWZ_C;g@gSBf4Xgob*o9@ zqY2Fv`q^TDG_J)|7QLl@HeBcjH?x?h+O{Dd&?T#2ooXJ)LsS>k9(n8sYH){PD_JUc z=Vp?#nuiiCc)5(^i75xvw$8c+*2v9(YPeP;FS}zU!(aHGMLA)YC{eGov*6>lM4ga# zth#X*^R!e9fEu#jEG_B38_*mq8LsL_=-MLsZ2O*Dnz-I(doHw}^|Q<33-RK!kBqCJ zICtmq0VP#Tf_ryW?Ta9zriPA&j)L9Bjl!(CIJy&0cMY58C?dm};r9(apM3z_x5pMp zTS)kJ)r^f-Tga!cN1Ir2nmWbM#m+1#(M(Y)ON6Opwb^?WYkAt>8` zqx5turi>9pQn%L?hCC9A-gbb(#)@j0UAk&1oAs!tr4?DvciFn_xIeK|RVY0*pRY)N zFuN@7W5^?nwcyxTu_3!OU%38UF55Fqw+}ohn!*Qd9@;{|NZXctK!ZohT`m%z8#H5N zGEdD3g0j|ynO+6H86?Xl8&9TmRry>_DRamv72hu$hGFGwQ~|Ps2s}IUnw1D43kMu4 zp7EaH{9yQF&9anK{ySOF%^nIs>8Ekhj=)#juq)7dii#L*w(xC)R2gK+N5j$vC0!Lo zOppB1+?QT-h&@2Ll#+Qq_u4JYCVF$~3V>`s>B28wMLdYjLSh@mMAY@g#L8H6r!WWL zfx?m0u)ZD;iW|o~29&fhDlGHY06&RrwCW~?U(89d8n zzf?=ih97*xr`HiWC7jg;jrL6-wWWXa500+mVYjcT{rOTVYtGDKq9STN76KWpt)+K< zkslmcNUhrB%@uY_cykz^XUrEyj}GedPKxDANV1OKVW`r3_U-fNu(CI?kk0t9B%J`~ zp2Je{d2iw&oy`kS3hNVeKAbEdO&$f{w0M-}n46XBQ$|bW36nA7ozc3ff73uy3%8a=NaZE*t}x}93B-t5!L z!vzpn|Cc@;)*pE;bhHZ!rVQKioWy|3xEdYNU`ET5JVkiz5D{9>7GCpx4(Z9yLuCtR zNMcpIKcH)LOHT|VJ*4H8jK|Yaj~Vo>Ru^@%*gY!m522Ov?}!QC1R-*`FS-Hj?ci_@ zwS6l-RMUOkh-U<}qk2AxwhU@3_rP;LSlM;#y~fF8K0%|bec}?@38AyYL6=FGLdlc9 z0UcySuS!@-el;*uS}n zWrzGsnyrGcz+YGcz+YGqYpH*Unm5aMs@Y zo^#&2zuwoMTHR80sidlwW{o-Km=JX-cIkU}$4kPFgttP@;j~u_X6=of5gTyaJla~e z_yR)T<=(>TR*}hwcn7JODfXW`APvqMVk;GQ0R4mf#5^EEc_x zR!xi>o+RtsCQ1WU^&IY*s~IVO+{59M32nc0q@z_jhDl8-NP#||QWKL&`f|U^frym$ zm^eDxN&B%_U@1ed&uC(xKPBh3z=ywce&-X9V2$~`v2u-jjKCmw>|F}QGYLKzK6O8F zRbVg65!`N>t-rTwAcT-9yJ^1Ur&Se4dU6G2mR)|+@_pS3e#KMmI|c@#!isYGdD3M3x$mTKZ2&mYVuC(eH1%w68gZf2H=N`v)fbiUj@* zlcl5jmFF3dpckO@N%i|XJwVd--z@;F_4mDhM_HKwSSk}0Aon()9wtDBYyj5$J8sJa z5FMohoHzYXtx*O5-bzgc$Y}h!`87%RYez8AG6SGofJQGM291f~6)6Y2{z1{CrvoJP zehoGQ^wQ5Y;83)50C*PApx5ueodP`odw%`I3~0d5QVg`nucOggH+a(#Yb zymUX)1pjZ?7}WsfRoU5@YZQSUbSE+a9LLeQ#`2pG^6LN)s5CbPjlB;@stv35+P9Cy3J&8$P|4O+Fg-K%#NVRJggih}`G-t6%D4O(JlHJ!FyNeD# zlk7It{~^Zunqe1`)?9SUtJO7^hocvi0?Rg=41eZ0D)ru6MnAK4l2ZBH7jPrp7D+&@jI@14%S^tfRH^MAb6T#Ie(-!TK*yHzF~ z9jt7d+0%$*YbHf14YOvKO-F$jYn)(i3zn%nl(`}8uAMj1o&iqp$dTOd?O-_br2b^Q zC98Ms7@=2Kk)O0&FgXNco6jq`hI?B33~AieNiae`*o7G^a_dFrA`H*#u9mwj)|{Ba z!f$d8tzx_;d-TAMd*o}$1f=UY(qk$PS+SN2PnA#+3Ikw?N+)G!iaBvXvkqZNAWt9gisQDu z7S0+Qi3|LZ*C*!#qa_gKObO`r+^)T9umqr~Ey3+9I`;Qp!}nz6LG;>tKo3;gv6{|( z&@44SGEq{MD-2uHMaY7;@v=dzR$>#{kY!TFFho z&WJ$;ny>2ifG$--p(gND+f$;;Md%)lejQb<3#+RrS#AFAmN(_djz?0g!34&bBq*-o8_#*M&9-CbLcWMu zSCnHq(ii!@QGmpees^d+-~I{g!0YxFc_C%QCX20~K-H3)BreI4%wZb&hsG0~q~_G_ ze0tA{7i6(6p`th``aWGjDCELE^TJw|7Bm{|I=sTVB`rDwTBZmN7L8aw@xIQd`F%kG zNfTkw3?SGf4Kv=XSg!`yO%q5RX6Fz1uwL?>0Zd(apqk-wXL#;T3;lZ7Eb=<(* z-kG>^dVI7?aPx2G=$29q9akL}Mt-(DM*p*vZqtFYNClw0~)KSElSZ95PhxC~ZNynZy=5E16%xE^V=6*`;28+H=0gkqA2a zu6+RGZY|~fm2E|Ly+KH}1YNXs>o{86Scmz+=BW!sCT1AZLoxajFkeQbBB&N={hT6t zSFXMXOho+ zScDd)B&j1J)Xxg5j*`Ph)BBO9xbpeaC8m>oc*9(4g?v$=&SNhvau$d%%3*}+RW(76895a-;g>eeGZ`r zk1XpMcNVR|p@z3(=gww=%+?6rO!!z<@bb|-`>F%sQLZbSTCAEgfCVBBzQ%)oZti=LI>$-B2y zh8s|hVohr-!^cY=1~LaY~7El2dDE43va58=>o+93+*6wWPdZ!$x=j@!V5QDA!i<+?02TMVW|Y+ zvQdluRCRPS`az;0MvyOC3#e zbH-IPKIKVUh@RmyIbEa^X&?AgYMwih1t=mstE0HkW^AO!2sY<%81Pm*2X0o$?z!hn z`h(j}$sr ztBP$>L85~#gNl%Gk#6X(Hzq4^V5IBO$-N-NM9Ks`%LQfpdA3z)fEd4sk54_!)_lbA z_tE0A?j{-TB?-=S>ENH>^9$UU1~#E{@Iqh|?-V~*xO5;hQxRy{@F&C&?~&BkiNLW& zUlv{Nr(#JM!hz`1powY1A7j15;c#R5E;iwxLUhV;7jua&QB9Y4jmj)5+&_ynT9p^f zs&yl9!BdJyeUa%QieDO;u0w3m-a{23E;Vt|dTp{pbS_Ej`BYQ~?RrzBY;R2g`A$N? z1i9SkI%IgTRb3bb8JT3cDYO~uct+S`;1IY>Q%kT-o*i}{ z^m$s-*rG4j1AVTzQ;CI-M5Ta6<2zRDF0;Z2vxlWzGB~{?--ix!B3N$>#;R6@CkRjZ zbyW+l%ym=1dG6<})myW?&G}j>j@KPJS4!*BOByJsmZ#OUU>8Rfum?Z<)FZ?N%C+sI zvXDwD{VqboH>UyVkkn~JN6T{x`?~2yF;KGMRswQe7Pgy%^>%NQ4i`DXd(Lb5{8L+g zz_f#&RZaEhv?Xm1BOUuD4QxvgmnVddeGXo!10L&2@4BR?CGH@^`NgmONrmslwLl`g zA1zir!@!n0NwJ)bgNv8zB^=h)EU36DE(>Sz4CvE#GH9-MvJv6}z%vGFi+?QC6AGV^ zuEYc{>t7~9=oJ+#B*0`YH4<`zsFhWa5Q#m=Un;Ygg(SY{AnfxlxH#?T87?&rl6qh1 zqG@~~^JMZPn$qcl_W-$&xuCVIGoyc0xNWI>b8t~Sz^%;Z15!t+p&|Ir*dJ2Tr|^+Z zvrUnB-IqDlnQ+)XtwvNaD)Qs3TcZTJ#!^6hB0mW$gDqd$)FzhG$qamdH*}b7V$lnx zqgPMthZ>UGx5h*Pk8>9HMMn74-`m;y=cvn>v*GAj`9Ek2@rwwvk_x((6%VJoP-Vx} z#t9J^*TaG9m`CxVM@Kep$g+0!`uO&Afwg3}5VOLNVK^g}NOjgMm<+f)oAqJ@G8c}_ zM4yn%MPh(ICkc%8ltVDid`BX|gXhe^kxET^!?HG&7A!fTX8g{8R@C1=#<@KTyl1It zK@5uMx-L~BwRN&gTV1qaB9{hRS2IRE!0KaDubff{8(u{eqjNB~mN5w)P%K!^Td>K| z>^i)U&z`7Q&?$i#&dk7fT;ofSN0v?f7flQ=Hu=aUgd( z={|hf2yfh#>|c)>f@01C|U?Lh{|w-M5eiw#oU!>MiPHg zSL}J~eu@t}n@x3aJzQ_VJ%q0Vvzplly2&a;Lg(5Ht?$4r-#Fb4;Lc(`R(Xw(!UY|~ zvLzYJt&+ZzyQ-+{46jAXc!wOk+#4Ch=Uukf+1MRx6a~V1b1Dc-0VRE5E(PnG*5|y; zPY|!0s!Grtu%(m0+wEdp1+55MKoxX`!XVsxd>g5h-jQXKZ>&Qxsjz zlGnmNr^N~N8Mu>KRKDkqeKT&+5u%GmNj7BJ%h{J3gi=Pm+T0_fxGjh9Lz7qTXg)9L zb`vL>qAVe?+V%vmHap%|)jK*Dt_1BG4G-$3DQf8`J1W9pNEjhvl8oN4emVuI)-_}y z?P@tUYx)640Qj1;7Sm?%a=<=azkD$awVx0>cbvrj^K)0NC~1JklMedyqsGOlDo{as zF17p1>Nho(_oXMIS#C)=Aft_)g{6ieM6eR0yVasAFv;p4oB}WM z#-;aDPD9Jg;!#upXGdTaetUSG!i_rr-fYph+o9SGas+le5XQ|fjy}ISGd=9aA6Zub zc*)hv-dx~|>^mgT2VZZ{cZl9Ga_})xAFRVLpcyAEoXrkKOQc5C@^8G8KBW&u$$z+0 zvC!c%m(<}s>+xxuoLy}`6Z|wyevh0D^P?t6Rtx0HFsXx)O@?3GZNn!gy48|yQ7~ERzQ7Y7c@Js!eXPR5!?s24$JNorr1(t`v$zAO>D4>% zTM!Oq%0u62pHO2x2mwL+TNvhjkECG8%2stb70lpM>ZEYNHYNE){-Nn0)8TSL~gUM1ZH{DDi@8wr^Y8}xry*>;19F0 z*7yUgS+jN?bKx#8+D>_IuPB&I^V_z&>k!h8h`8hKp0K)`xA zch|OA)yB?aVKEr%E43Ml&B2tzZC51n#^m8S>AzMqT0049OwH8C#4~D#|WboS52N1Zz}UytxZlsec&sU|4gMnWQR*u$o84){#jg z@FT=-?Z!^swPEU>r^A7~cW1pWxiQEl6j_}ZPWnJwXQ&R+{Bo1|UIHGxKas>`46ZC` z^p4ko!kWI3go$AQZDb2PQ2c@?$oKs%z6~gES4?Tm%Yu*y$b>;M-Z(Rc^cCo@ft^>ZgbE>eXZLkO|HsP zbD#_C*+^bS`uT5U?=7*Z^Xq$12~!*lKi$9+Uer6hH@dJKUw%+_xWmA0QO#b3FjY_? zO$Z#+BJy*WoP$GxL**ZxgbUe1bfSS{uWr4%3HErRgA4mCqVSbowCnzE)4W4mwo?e- zLQg8JQir%$FhnAR)+jj$%wNfG_t8b8_9-Q_Y&b@9pdc&3%3W}B1dcL4J(yR}0+u?@ zLHRh{hg)R1d^7(654WcileT|y85@X1ITb0CU0o-Lh28cXzIUJFAYyY8XBtde6a-=T zP3+?!Qjs+{_*KlC37-&ix`W6~sqBLs=yBf0#=1f_ywGyQ#pFl6zf?fKPu4E&f`9TXDj(Z zQM~xx2-l^$JBjCWytyXl+OJc+6nrAjqfJ|Shg+2OBd+EfrmA=#dmW-rG9c{aT9K0j zhmkUYwV2n>nfSQsmBa==Y_rF`d$09}hDh_-wOGMax<{S%6By|eJzb(2o!ML%v4Kqs z1FHCy&G{phJRcY34`Ph&x>cV=^v^LIVrhtVS1`^GCW4-Bpg>s5m8u#PT+lIA zvMjUUc&YIAC&P+JMmYU3YAef?WSMg2Rf}oEG6#bMgT=3guhX9rGi(cc zc_-n1bmZ5=U61RBtV|k$*?bYJ zd8`249K$B8CB}@$bEl?p9lI&)*TKf*oWT_Eb;C8GO#qI_peNv!NTKbLQ{bS=VjL5v zBJizYU4BqqcwYI8z8@*p18>M#w~_9ne?z`?{giln^zb$CJFkil969u9jPv=^u%(D1 ze$vj$s&nLZ?ofb3pi5DC{T;p{Lf(o;mfWFt#^kQZNSc=I8~sxRnDua&0g#b&vo;!2 z+<-%`AyGl{Peyx0Eo4=PxLpUpMS_M8?uZPVx6%?>!>@WStDlyn$;3ImWG z>auZ4iwTy%C%#|k(wl=Rxio#eybB*V1x?9}ba#BC+UPINchg)<0NO9u+nspXKYvr= zY9-Bd#Y3&>R%OPe6Bk{k9ww)k(G+hOlUx(AoQK)yKYQCLB?lTrZc+E0gHX{dp!cna zpH#`ml{^S9@3MaM6vS9BYG4Y)jq&}G-Z$O)>)5H$I8n10l=<(!a9M~24&4Y_cgrxC zDQur29&93Pg)maGpq_^drFyjOUKFF4#rp1o@V)D?7rW)85y5D23CPG>o-%tVv4p;W zj=CU07}0=;zY@L9t2bu}Xua^an4`@&e`h)Hct<^)*wsLty;{!&kHr1av7mzo7#N&~ zv}oSjUwZv9`!G=*RS)4Iv9;mr*Uz3#c}op*XJ*wKn3*L?kuXwzaOCuIGdOGth@UrazhD8qzN zl3!?^V?N=9qOwnwCV?#mwwX_;m{MTRwRMD@TSVw%rQa<3P)D+D6D86Unyxc-u)g8@ zF?~XK%XDz{1~Br|ERRcw`FKNO#&BBZ3bAqDkI-kRf`mY->sg?q4Ls)9%6a04X=TKSxuvB)e?(4#$*2khj%{qs79G>1gJojP zGF`?ll3kCmaeMsS6Q?UQ8peYraQ^Vtva`cElYtOyTFlfxoZlE&97RJ^m~5?J-<(zA z3l^TT{e}agF&$8iFa(QEJJwyVSDoEKLVgVR;kp%+XoBmCe! z#Yzb?jHkST4;J_U0eDu0~W5d>Z@-s6T96<2W5@VI1OmVai_UCq`5Hn zcY%>j^j)x73ka}VUs2VJ$t$8->)Z@d=+$v;pKb#8JZDN9VBokT$y$qI7*-W2SQs15 z2@Hd1EawxV<_uIttK`$5U$%>aW5zbK!~=(i#0UCBO&ttrFODgnKO)@}APF#3ub;oM zI;l`Rk4Vj`&1An?fSSnRw`;$0NQckK!As2Y75+fY*b;JB&o^;aW(RfW=lihG$X;8s zlq$0YPO4dAbcpwYpODRof}C)m!gkX(RM?(7u93%K!m92vc?*@ad&YDI+6sq=-~|_d z&sOJ6al=*@eq;I^EfXEl$Bre<#O{Q!kOZ+N7MHJvD6UKnwn|W*ftU0(vES^yP{Eyu zO1DErj-P1Ma||PD|C^MuLd+qX6juM5Y>ZNg=I>8SJfD%y7AYa_h<0T+M0eCA`q`8@ znq5<`XjP-=gQ=Z`8>qoVug#6DmBfn5>>s@p%+PImJEImgW5$9w*PbuGB(~^%ZN8|u zVJ?Pxa<9yxeSm`s5i9(j42zXH>pmltjF}j2DlA41mc8NkwYio#B<}@!Aq0EVrjdlu zCisgwq<^E=nj4hz18~U4ZYJPl^34Qr1+3+ja*tABO?viDDJ>3XD0y@O=lOCL>&wJc ze9WpPR(J16Pr{4{#8WP(?PHt(EU-lm%2}X&tVA#vqrNcIB!-7RG{T6`J0zE^eXH)k z7M$-Pdb6Z2xw_+65$Y*xKyi>MVHkZ=B7Jm^KH(HJw!wOKDnlf6x=anSn&jVKq!q!w zXJ_5iPo9yd^o86bUwx?6IJ>q-eZma*0LaY+0D!nGJMwH;#GUaEpLS z8i*&NsF{hLa^mtm>sin=L_YRnce44w1Oe?!Gp>iHS6jk#&YLx#@tMQ>$5@r)E2on0 z-GbI*h2*G475APzXghh4g^cgc@_u+tD@SC(QrSfXNriaI-emW zHvBkv^O8KEDwjBXtLn!{)Yx+4S|9t8e)|kkgVz@mKr`ZXO$*?5ye_YV4w|3)X#w$pujS|fdL92} z0spVtU(5ei_iHVH-~D`NqyYYw!|NWvLQMrA@cb+W_(IS8%K7;D`pG(Z zZP@D%=m3F}zt%L&0QSi5+kZ9`@SPqIi1+&W^)mb{_xt|W?SRVxP7Ba7d%Y~L`(C%b zHsE#ry1dr?`!WB|>wj=z{@cI&uXX<~YkEENKRfa@Y?9_5HT^tGz?uF}+V->Fp9A3! z{>{%J^-m7gf8yW#snz0I9LGsmY&}0Vu-E!*CvLTXl$)(`IB*Gt;?&cZKk99`fDp|OI=M9aC;!tuy&(Ps!zP9_W^73n0G* z*$u7n1|P6kB3CZYcLm0CHDo-jY}ZRHvdg$qmMFj5=8tFkLNdQr#;c9vLzq`%*l=xq z06+JHhLBC?N-!^n=R0*}^!@xQXcxNcQ=kMJ$4i5D@4vh~|6=peQ2lXtrhWbA|KA@* zuSfa!!w7J1p_Da~Gd29#CxF558wc-?k@ZRp`%QQHFQL+O0A2S#oBl^{1A>r$9_oJ_ zvuh*kA}aG0-Zk{C%i9d?eLcpR+#wLg%yUmSYJvo+Xuf5-??a&jMU{ftRbz-S>Bonj z7Yixh$4X}rGpo|tto=$R4J!6`HdK~!WGdsSJ-h0ecCj9*mtD*oLw)_`W8$1%>Q0lK zR_~rhPLp_G_YL0(MbzsSGDI~u+uH6YTq*C2qE*6wpv(okgN=inV^w15(A$DT%H4v? z&DnvoOF0}IRf!bP3D3F&akL$;sJL3Z32G&q{yIAqKjpLk?XqzSGJ^Mya`>ww?o;5WzcG2Iu7=4)(EJ{JyY1<4Xz8SjFumaT!NKqE5!@t60HxG zNh0}6X^rH1ggvk=`{{%n`E#NYqN0;&nPag$|a5liBwEfth(J&S~-;9hMcw7o0=mjlwR1k(P&Gsg#A zl|lr4d`+|FB@Et*<83r|RL-}0-*Al!s&BX^HYQUi3Z5;g4N{muX2&nn;c|H7{$tTSl z)JAKTOsU*Mn(J#@n=5g*l08^D47fDP{xwj%hL2cZ=H_jNXLqje+9b}0HON)U>ZkJC zwC0${6bcy=zZuC}$%+IHGKe2kX&X?&OWPO1&$#b6ckdsVC4|030DH?3@=Zv&8>MEo z-Sd5jjG)dFP?D7o`DzJEMWBG9i#diP?^uM;=e;K(>Ulw$3zh}SKn#zN5EqRcnOvIT zhqRXGPhETGPU&@JdZICo{*q)DJd0rwyKI;r1{@f==&aBONy?;E7Q-XflT-A<7LCa! zk2blmzp5J=0WS`ruZVz5?_w;kLr zVU?Y3zMg_jqpF6FWP%VW(Ig(=r#;P3^e1xBEnkeDvn$#WnSLYb*WfQ0<&8HO4zIr% z4{=t+0^yP+ZF_Mr>`MfkCy?68(rSJe5pm4Q%0ZlaB``>N_>hOds&f!60#UY?T7G_` z?o$f2#Qsojc!<&<;G}00x+Apm&|MX30?WT6$S>@TUvZsVe5R3suwb}eJ5}Wh)08?- zH;&fzd3P8!?J*WRIIdN=nkm&SbxRpS-wQOhlnpp5Zmp zy>Po1Rc^F~hdYlOsQc`vJQWWGf`Q!FiUJbhHM@n}EFK>X6p7p_O(GkzG0fAu8$d6R#AYEjeC(!CaV z{Y*m#Fl+yOBK$`+KgRz&(Rj72@XtmFSO&kz)m75pjYC!_dp z6OI6~GyHXy0Whw9G137C{I|1=pU=6!&oX|p(0{k3ev%qo)69 zyJ#4h{g2ZO>09lQ!8UlE5KJXb6ry{8)IW#YivqQOG`65V_iLKK+pWm2K%e|_@@o_dy(3G8n-q`z3)|3-53KTX{J=Og;}dEB20)_2DLi zzxDOMoLvDRm;ar;ova9mpU|Ia*=$=P^?NGdZ3e!kh*5|@W|fDug&%YS3C~Hx#&#j1 z)dxj))F=9^3lEP>2BsxJM}57_8~hwY@6TI_$`<=HxAk(emhd!u!v63$3X;;xs^4Nc z;@XcCp2BeUeuBG(b&`$n>gmQ*>(Lz2Vq zqI$94hwe+BbY_-^o{mzj^;!CKj7zW0hCiMymOIVHaK4Xq8&-b%gyIuVc8FbDAz!8< zfVL=Zo7`x9Jku;7(em|_{rdFkcvfAKh3O+QlfhY7dZ$k)GBY4#qg;HmM;X_Rt@BK6Q zA;2LOrM*ZGkv0;UvBx{UyGS#JsxqEfRHDayJzh=JEC*V9w5iux^PXlo?nD$?5Bv&9 zn@@}*aySZOZ!F(aYNUU*KU6WejKzd)cA>~z78!nY{?3^Af%L{fpf_aKxM$8;w{f{< zCdQhi=Fo80WY&PtR&DYwmI6q%(I$EEN|dqIl(Mn(@HylC<!IX59I#$_H<^>S%T_UZ%o!$lwG|VJ#18N-c1>EdV!1pmrhL0R zHu%}BRl!#i@(_}9^u;^IJLzEHxbc263bF`)G^N~&gSW#i*dN}Bd9Xz7EvVf{`Favy z6H^hx*a9OJNFU9ryMYt=qDf|~4;`7#y#h4k7+A?3i3Lz5f~*D<|;a zo`d4Dg`cQ!z$^i=kU&M~WtZ^bq#j?G9_BkYj=BzUBWr)Y*qU}QDVS$4sq1z$=cHZk z&%9h!T&0CW9-T?VeS5oT@JG!h?H=_q?siN@ z&^_zd{B4h%b^S|Kc;I3gZYly4^}3RYtVh~PrS`MJnjh|3UgoaN9GX*Z3V>T#trRRD z9|d2J^p-i)Q&YF6bH4W!cBU+XX%rt_Q>YcIcS92WtG7zQ*d1eGcnIyv+FISM^g<4- z(-|*0W&nK;H`N@R8S2d-_+0Vyi74c>mjRFaVzzYDUTgW%uCfS|U3tW)XT+0C6${Z$ z*CY$#;DXv|AVb%drwcnW&9$zU?l)g{7BKDr%O?>g!PHnuah@ZhnkE`JGX`WW9EP~e zJ?RvBX=@j~4p^`h)ic+!)JMTXvS+Bb%L+-3yW^8sxhgoe`@-n5-`6P6cT+@L#0bE3 z@b3b8VO82%sKk|N?S2?fND28wp4vY`E-N0zNyI?~HgjMXMX(?n@hV3`cI8`Ilrwoq zjJ{(-uIoUa!wpkM7}xQ!@$5L$w!j^5cPhe`Gch)%YtCI@$HNGCH!dF@`mLA^-Xf$i zHu9v6S?CNMYj~`#Ss*ssVz5KpvK$@Q{)qJ&1x0{B0$tECd_{tPlPT$O4aFA8FNJJd zh_WrjF0@nMn|@%UArnN834)&W0yv;agTBs6#tk$i)*Q(!gLHF%U~mHzoXwe{ej93p zp{x;tQJzUg5)zrlohi(Hlpy_Sf73e$cVL=~1+8efC=fM-=v9EHrnjjVwpNhRXc?ib z_p9~IM(02Q?Jg9)By@0kPOvoI+W=PqfkzAG1ZBc=>Ubs94^ImtFYl>Di;!opUG$>F z6QQoNHHf4F>=cM*_OEl{_X4d!+M?qS8tEntJV4t7$^r=tz?8*1r4wYs^Cmk?OH3lV zI5IQhiD*kGI=uNWqvG16rs(^WwUr1j@WYyv~8e-BAFVec2Tm2BaiVQixq6BnzDwWQylJ3p!Nz8bZ~)nS#Lg|MikdrC zttaWVzlwEdva>(X0LgUi4AxgiIpx$h@xe$cZ7d_AOg z6e^#N#K}Rwm7k*MdPldY*>x$%D7fU!L6+hqTTc{+ceLF0x8!vetKwf+z$0a3HdViC z-L*i2G5-LD$Cbr_BHZMM#PUgCi3{t!H7})mRruf|w}MLbcF{wy7Z%aHONw*p^I=cn z?BGZzMqOILoMa>2Ac#*#*&gw?B;e++c{xDK5;YC+>0mF6w4m`ijOy&%;vwHRG%ykL zv>v$6FABfNcoy)l*MRhts|%{Un$fKfeSaoNusjPIUu-8>`t#GqLv#w z7ACG0jcV)2D;=A*g4V9&C1g8eYW^g@#*E1!zvjET>gqm}_n=cyVIs@gPDFB9n(o71 zn$EpJh`0);Y>y5hvrF#QuTvC3RIWI1^}c1?dL5K@Cpm0@NId(Kif(>ZyUy*5p-v1u zgfUa8eZo4k>bzStW&jE`CN9X=As#}I5YWjEl@2Q?aMz%6(+BU9=Ps#fBeB>R)quJ4 zoW3S!oO*5AlO3^qCLmUDnDGOu58GeFG<9`z9`AFe-!E}o*k1dk*$9+i%dBi1iY+_L zV!-l*UrjST_ZJ%hjZPU6-!G^q9+pk<;{I3rt5I^i!RF1ocZG4s*)tfeuQ*kd?*E7vctZ7K)-)hVYY=V z`C|WOi?NYQ5uPO*S3=y?rvX^Zw^8VH69!sI3?9`^l3Ru&Eb@;>p_@ zf#Z@acV3VwZrU#%5{7vGZ1PEZsW~P|)0jbu7H9(Cq(tzbB<63Uh6iwL>5!)$2oq3* zt3O85+@f~2#su1KShswVzUldfZCe@^2VX2M2;R47ly_|}1HWk>A(F;n{#)2aIjmhiHeTGdx(=?Bn_ zU*MSD6N9Ik63t%hHDrfUO|Mjy+!U9M?D>eWSpnGYWN&5v!&Xh>g4Wt|!W9!C2L-cb zs60l#96`}J)JHeIv=;OmycR{5NGbvn>j3)+m~VR|Ow0}ihv3J&7dRm9&a*?LRq%C* z-6zL38ckXH+EhU={1J{H*MLPdfXLFL-(kG3l%05I3=Zjk8GP=hOGVbZ-LsR)l{%>e zMR`$*Y4Us%6#9JRT0$1vI&4z%74woAEecWvQDeAv78^|0jOso~3-z+i7oe6Xqy_J&R2xH<>e$y{Y zUZuTSjq$*u>gW>|AD^NsZ)^IrESN9L;&OE`4NVd1UnClk&u6t=5z6Bv!42MLLT0b4x9UI%CU%YSxi`~35&db?sh^r|wSLtKOx<5(<$#3I z_TC47QV%aC8S#u*B*|5O4%v23_hmMlaXmzF%q6WYzV#a!Y5s-vbwRe_{aF^|w`?@y zoZyL7UlMLXNQ9VuB9X>WPq)U&>#!hMV$(x)NufvPM=(0Z3-64ct~vx z(=5>2?8sQjOi&1`M#l307*&;Vu<%fVSnxv5|2BaA1v9E4M>V0os{Fz?JEmm+bD-5i zL+paDiKLmFqc%~Enh#M>+O1pA}s*`lDKOHvIpJv$?A1J-)D809F8 zM7ad`Sme~aaiV^1nl2^TCoG4lk*}~mgX;m=!{$9Vb4^7{M;mXeaK&AuH}jBZEva!n z;pELpKYg7l1G7wXSBr!4{p2^phet>tuqznBAH9yMi^vC&(goCOK-DGxyh=Q3_#*9K ztKHv*BjOJgpX_&<4A({c^44ZkVPY3y-|cXG8&fV}+3;Rit9tp^T7s3Go`d-+Y0K7C z49~lqaIBTi)c8L4lhASsawa-w1z4bO@u={-9pUB^{?mG&g(UsR&1=4#E`nbDcU*4` zBBmCy_H_)gIyBOCngeZXSc%r_JyW|;1!`?Xpv0t*JY5LLF%0=i%iK~ZC|znVB_6Z{ z8L|)s?+3Z5v_zc79+i+TT#L|V$t>z-FyDiT0-sEx`loC&NkwE@UPiHKBBX4k4&8e& zQ4lhKMY0v}43d%t`9e&CXvTXGH%B2lo*dqj%S0zCuo%RZh4&?gLDXODN}!n>sa3}JfjfsC>sp(3QqO8_|` zIB}Kwl8}5xTXXZuW@~?twn-BalVKP578ThtgGs`d|4f5FD@;Oxmsl^|@KyNBQ)qu1 zzwpiF*A>T9@%Jgl>_SC8MTxs`6ke;Tv5g=2JB(sA>`q$I5&BM&niQ0qoE89|1uMN? z49?#J%$I7BVoq4K7%+9E+@Ez6Zuce&O*mtVS2d3FUd_=+;5ht#9!#wH-17?+tGNgE5wXE6C06~^$Cz67}z;8dM2}0@8Tds>zg!8Z> z7>gBQ5KvHa&>2BNI}t~Gr+am{6J+~uP@=_jSk!lAnhhgEM{~rc*==m5r)?&H^7M&x zNy#F=d?DCAQ$g>ojT7*rMbKS{YLkRI3WgOFStOhxDZ&T;964}6TX6ERgLd#y?_Dy1 zAJCV2e$EY$z`{~ZMs$;Vl;X+&9l}seH`&r2KZnQmI?Dz1sENCt?fZg`NCCs|r=CSb z#h|cSURUeiGGk?;>hu8`?}w3>LT!9pqHz&)((|8Gqta(}v%nOY>4R_Fo!(}0BtQWR z#TExzjX07fRvrd?vyCykTEuKH-KdQmN9?Wo(or(!FaSK^8tIf2Dtv%MCcvY`;?3|r zYb8d2@(8C_@s?DAb(->H5{an+%LP7uenQqn8@c~FP?_fsl2y6p)u>f_&BSF#wD6 z<}p!boF~H+rL_}_DXqW6-6bT;dK&DkNIEEuvw9Re6<=h2|JoP$MKH;H&Qlk94%+22 z41C^?NJM)~ebh8dv(wS$<(nGhjICf31C|vsGTujDgpY#VGOflAHi~Qekg&!NS9&07 zv*mjNUW{Mjm2Q2UsB6Oe{GO8baphxNEv+g!i)N23e5S1hZ=IQs^?cdt#2nL>j;X^Rj8-g%Jhy7+{>Z5RAo&H9^1A^+g6A?D+8}bB#nr zm^J>#k)shchP`V!qdv`XHb>eMxc>^;`YsY|1ulVLLTD9Xew?vsRvt>gjHUC;zy$*8 z8H^sqXG_D576G|Drgy_W4aOzKaYS;)p3g{3;;CN|nR)M9g~WuZ?7@x`v()-ARkH>6 z#(hVgBR!@|oU}KlCN(Hcc6&)aetp@NsE;RlIXNV-A4m`Gq+f7W4ppEtigqv)k_$dp z@GKo?IavgE1xjMU&WiS#eMSikrf^t23rQCFh*E3e@{ zd$Im6s4EEqNZGvHf2b<~=x_frDb@c@U5SqRH)h9QVPyd8>^F@3m%7p~<)r`9`Zpn? z-@Hro0M{IVXZII%C4j5tcWosm0GscZy3%XuziBHm0g^lYJ9Q;$YKDK(w_Yi4|KAHN zz3M^zl303m4E^B~qW$GT_#gPc{?UVfcYy)W{hvb&0Qmn(c}e%P6aMA`qXP(c{ow(l zrU7^iet8F8eVE$PW+s}Zzqb6%B?Kt?rxW%Mmk_|A_P=uz6e~Jd%g8;u;?RBhMB)+7 zf5yfS1S9}*qs#l={0;Ggd`(3(MHSt0VvSHGCFN?Yp2SU#SZ!2Im34YHCqzII3Al%` z=}IavLG%AZYDj`Vijk2c)j+?^{0x1wXiHw=hWL_6LiHEHBGr^fY{=B#+XiC%) zEv)#o+WHGy_!n`>hW+q-Y{aMpn3x18T%qVTvwPI*cA?GsOSewhH)4Ka%N!OHz>utW zcF^o}x(8LhxubD+eWzG1N9T%_srC^Wm{|;xgL!vT+Ee^S%vU5=O!VGLTu=T9d}7)1 z(hzy`QzS+>)d@a^~PR6gx|U2BZ7sBB`A*3 zFJd$-awOfFP@A1XLa8J}8OxL@gv=6UEM&?Qk)#2?bve&@&awA-p3nFD z`MvL7Z=E`|TGt-dUejJ{?Y(a%hFN4!Ha4l*d(m48rEOre+bF=CFQg>=CVug6Tf^r( z<;F7wW871#gMTTFZB86mxB9M_oSo?MO)Y~gnF2>n?9+{i$eDhy$F}^5KF_r#S6Wod zFQqPqVJ1ocBCYKBv34=x#j?lWo+;9q&ANek@}B1ww~bLs3oY-zLGre{}?@@*UcbjDrJ*K0fEc@!4Reqev6 z{=7bB^LsAo`h%|O0q%M`T@5xXeLufyaNwQF&hPVk2CyD>=ST&+Ad%8fo@@ zpeQNpP^gvi?d#&6>+97Dgb#df@0m)^9HVt!qz!K6xZJ;^m6g5V+EW*S%;SCx``%eO z=$H13E)8nhB^ez2X{lyhuY1|J)dPE8qhvAbNc|C$_YMYL>uba_jZL|}gxzkfKy@4b|bO)dcrdrl^tk(KzFP zTWxJQes1aPd*4ktAMVyX%IqI_Z{Rt@wP{)F@|F_1RsJW;oM@tMa%A_FeC`t3E$qen zJ2Zmmrajgd_CNia(u+eh{(9S+spg^7{^6L(gvy zOz2Jo-*NjwrJ964+^yZMQZ{>I-4+RUjoTuIYi3mH8$Fh66aC^V689+g#1XQ4^vWkJ z)eZj6Q;TMPXiMzrqP9(LOjNQqYh+KV2~!XejM}brHP-IHO>+H3FZ*5ftsg$jmI>V7 zva!lGo2$a}&{szFD*jlZO%r>Es~%UbPWXLw@9Xy2@JkPxM|&I&?;5tZNm+S`yUL~P zRn~FQAHo#X$MA-)Q?a;@;;AxU>(WbWDQbnLzx#!=M_F~plB9xPzLA_<6Zz_Bk$!{2 zs-4!3hpmPqI{XYCc-qsF-$w?OupCTp|D+OIRuX*V8p}pSC$$|e-(%}ss;P7^*~&_)>G8(KOU9Lq*S@U$EqHHAQLDE#D5!1pT#}=0 zHg%Ch7c(1O^%NVI_Yw~qo+J)s{$El``J4mly2q44VqQGBVrt4ud9=gRgRb5_r`q@O zrZ))*|~9(Pp9U`CmEA^@rm!0Zz>3X4Kcbo*3T31fl)Qf z@&V(<18er>v=}5FS(+zjt!*6WK3z1l@^|C`YoVtTMwZPtxK9o~UTU%a8ux~Q*+L6( z`Glaoq@|s0@6N8gu}84$^D!6qxrwBsb3JlvP1b(To_rlLL6?8$%eC@FoYu>uyv}?s zEA7!{Obt1w*yDcJE7P56aF?&(4`)xDt(Z_6dTIil^vSWvU zY^>-M|GAwFrnV!e-g&kg#vf@5y7#-yn90R+?>#Y&!bMk)yBCTG*Uw!RT6n<26w1KFM2amiJZS?dQYvkF7o#Vp=!I^?CyOgnDxdD^YOdS3kEy*xkVw6U}2 zlfN?5b4Qu_2z0rImu+@myMK|#?p9K1@JnX)vWoV(XOrw##=N||v(rO2sTsZ9D!0F$ zo;8@&=I7TVT~2I;xd(l8QpzNY z^aa%bJ0IJI>Ko!?8h!3Y-K}HCx91HFPHaB0Ekk$dHveVbBsz(Vhla*%D?@3SWy`W; zZ}^Sv7ZWowWM$i4$>>0KaWCKYbw%mWvAZIUkJZyP3br%VTz~cHc6ROvV^^H8UdQ`@ zfV-xoWRA_v9xG{k3NG^=)DM>lGkjQQH)(KyFW*%oASlLJXEI^g2k$MjLCWVc1|}`p zvS;?K$zIj`dNjD@enB$ThF7SOO^1WFHpN(|q)qK*{Ze`E95r@{#pg^X%-U0qN#&}< z7(BJA4hu}LI2Ul!XU!fCwgk>@~doJ z3?9FDl%J9i>*lrp#To1VTtj8Iv-YZ0n`^s7jV}Ak`5W#Zt#F$iJ8$;n$RvMpu*n92 zojfwi1Lg6eRh1R5tNJ!1DsI|m-@!0BCKedqZ5zyeczh~kbg2mYohxIFe4o$$pu29% zvsmYxK36ce|KJu=TjkS-PIT90qXrL!OT)dlY|>Ha-QaSzKyi(O=Ip^`Z)$9> z@^srSZQk+2fN96Gv%$GZ9Y({?NbzgN7}k`3*;a8r-Pk05CsmG1e(Z5?pV6&lg^ts2 zhKokHnPj4^hevuyg81ILs@ zd(~RoT4c^$;tix!xIVqEQRpK5dElL&JLfnfpJ{#k3on&Z>h4kjizS!B)h!ygRe!rO+}k`=Q*ZA#-4$ucH7a&&9k*4O zLrVM9&*sZ-TvRH~Uf*n|9w5El>Xm(IV4{h}wyBE+J~Ce`>V3)VilzmZf0YiLEi^n7 zJ<-?ysK1h2S^6Wf+Ma_`s_VuOnU~vT(myLH?)CW-6S~%^e34I1>ov1whjN?GsLZGc z2YJ{XKhZtw;r6af=EZ6)+J`XhjrNY$19a%GT-%WQQN()V8_&ZZr;n!{X*O~M3laX$ojmKbo`id&ftd;dFRV*wXRR9 zEO;XCeQO9ca_-MQ*OU29Dv_gOv+|45M<0{USXpfjdU{B5ck%X<^weFi**zjg*SWUm ztxLVg5GYsjreNTO@UGnE+s{1O6K~O5KeW~*nLLs$I5lG-vGL27M`tT20_3}ECDR&8 zTl3B;obEAbIxBqT(ADpQZvMY+o@ZO{a@0S#k0&V5H!4f=!MD=H8Hr7b=GGfhZr|M- z7k!0yQ^1C~bDPHI*KJhy~E&56STx8YDnvy8K zXj`e9J3Nh#%b3-6ZZzKY{b&0ojw3bqk_z08CSFjanw=i|CGX3<)@j}64>Nun&h4)^ zP1;#oRZ&xQ;AiOUUVZ)b-pzAjDoE^rFn+KHD$Sc17fU-4PuAz0cXoW)s=# zOrIP*u`=eOo8I25BNy|XYXbyX^1q!(ylMIF6ua)ZxS46Q2ln)=5q60U;d1IB`%d=V z9NMCGaCp*oRf5tQI+mUK^7Gr#TrmG6nR@uxWAH zyes2iT)oeCFQ9F8I5krF>?s9)@>FZQ?S^>AoY;c z&@u9mQz>$bf;D+<&dNuurSe=+xg6}>A=*z;rf7E@muZTR4(%FcJ$>}46jSfyTjmMr zH>+3FGiTCtr(;(u&B}e-Cv!5)J*x8&*Et)N%sw5i9id*U)bECUiCm>O`8#E@scER~ zm3Z94oB>9s_iQP8!t3{EFNuno`uupw9c$73qg70Mo=>ayS-GXX<+d5K9kd&h*=ruF zQsTUd|J+8w6@f}T2i_Pa+O#}7TisSms(Iqu`jc~aC8=gj%j*K8rtg)cjEi^s1tnDM zS{yV4v%b*f*qWP?MjUrC`A=FTB=WEy9D5=>WMRtKHfDAE$PBR?9Ld58ju0tf;^sW{~($AX=<1`%!=N_+fn!N}PyiKfCVN zRn6;`3!hnfLh!(?yDDwhe7&cB4XiNdRd!d5w5@r~%W}S2dn##aTdG#uy@!?(8mgYn zOJ}}#?5Jj{T)%yr+UDb3-rg&i7j0hI>rhiaS}*W4u4b7`NTWSVLzChVRQuw%cYGno$y|b|E;KeS z^CClh-%^t5Vt1*R>b z@|7je?Nl-`dt5zce!SzHOfarmYq+eV+1bm$e&mb&`ha3P^Ek$u`Z75o8_Po3=RaBBd=`^fy_;2SU^siM zqT1rQSKgyHPhz4RUQ9hHOrtw|C%b6aVb__#3Q=Dtoi7ERJGUi1n=5`W@Qd~1-HaLe z#Dc2+?%gt>Z$xyx-k5js+z2T-vFWj6fL+C#+$7B=2Z!t;kpr7Dt#*rWR$QrIkxcA7 zC1OkAGKNcs-@okR2lHK ztHJJ|Qfm7?b?%Ndw&tZ)W>?+LRAv>uoZ0X1m9=a7z{rblu>;4mH_-iZ)rsMn{0XWU(!;m0R7ZPfs-1Z+`@CNEQm|-@{#S{A%wx zN7CXKyh*xoS~`yT-d`@zM=>kdX8ZcADbN1lUA(2gIkJkkuFSZe@;JNt!>3^(X`Qp( z7xt0!xrbO=8hT*eGE*wO;Rhq0q7i!{#3oXKie~N=E5hp<*hA!jZvm^`Pg- z>K(jvgdvaL*j6VBm@xk)*n_Qm#ioQ0ytgR=nm1l6<*J9lYZ!+sZMf=_HAC)}OnuP<0 zHgEi_qT9(9Gj_l$Bkp-_Qtrryt-BqItS4`WjP3T~o?Y58(U!91M~Cp|fzg6nZMzSp z7a!--H92Z-qIOvIl>t}qWhJ2pwbXL+^72m4@ZR@$@s=?O{8%y>rPI_>lAA zPPh8DEs@L~`^S!?x{S+c_-Tgkkx1?Ie{=ig_lCQJA^X?qX5`B8lcdyx%yqu)uNUN= zJbtxypL*qvy2Rvf?(ZMHwJqh_Lzg?t9KYS*mW$9Xx$he5z_D9ga%j@@{Of@? z@hZW#+*;amtH1IU*Zx!fWIm=$oR*+aB}jjr0uul82*$#Y`TvjW2GGZXY5%%!fJB^< zN6rDM>#FWo*Mj_so+=zi`sd^cyu|Rgb3o$ozQq6Jwt@M;`oeQS^A9%saSn)#oYx_q zQuyOJ1>&p|@vmg~KV&c9Pk;aQNB-o`-vMvI`5hX(hYXn%_=d=){DDQl$TR{@{FH=0 z5fGvmDohM8iChNJ*L+J-|Hk|S|Bv5^5l8?I@$1h&6Jz}I@AKpR*Wcm&VS0EoW4_Hl zM?U{8^h3;$3{;@NF9JsWSDO+v_&fX?_H)7Puz$tz|1;$OT1&*-@t+i!(O+4iKW~{> z$m0L)3<<)Q3sXXHDr#P8{(dTIp0^gHgch735hspF{h0v5Q$h>Q<-;Wx|CACUSO_}! zU!T-YHd>{p`zdP=?+xb+e>EApxBPa==?23WvksLR4JS$J$gS0mxP0ZxUPXDoC?D13 z5%L$smMznBx@Q-aoNebIoK<(|TtQv(hmW)G-+jNosO`mY-uGnBPV=2jOEl{))OB>u zzHq#7C7j9>u#ay@%)0;OwwnS>cO^WF)1qIBdbH+Bwd7ul_7)}0YP=8cYKc-EYl$*y zc${}-*ra);K+^h^9N&#EQ_Sl0tLXI=fBJq8-~8;As7$z7c(4*vH#LYQ%)WgzYHIUc z>C;0aJ3hZG9PS=!$~6A|-Ex9!w`W1;FK^i8%bMzO{3RIb7}Dp9M*p8GA;H* zA3JK;@7y0GSS2^oHCzvGh{~Q=*V-Rqk?c~ z&Q7(T`_8mKN?Jt5%(*02@@xk^4z?Tut*&y!mpZ^$bCjlA#DzLro&4NaPYh;?h|CXU!Es}C8C zUFbdgq4H*#_)op1feOWT&PfNuqc+vO&h#RLQu7|YD^;K<~-0ZTRQ^fKkli^Z(^RLwK{u0G66RRR> zRa0lHZroEV-#c~6qx)1&G*2PQiXL_g}*ikn1 zYiitgcE@bCOPSh=PxY;YXSD;KyqZ0G$wS^4$Dp)scIC%3QS=n7l)YO+`TE#MWuP4-Jy zPP=bMw(rd{&w6$JjE2GSZ9RNui*ieCSQ=bjy{nAV4r}p?^mR*lzCDYsYdKfmvc=7TDl4Pp zRJ-Vo!I|9ceAjPrrL3BI>VA6bXOC|JG9h~gFW*@G%grFH;%OSAQJGG?-K{&`21$C; zMQUHN6-Ve38}Ir^Cs6Kg?>u7jLH`?_p27^x0I#p*axS%+MN1z&UmwOd7EkU$_hS2lhQ`I(<=8*5mnaL8pVSnFN9!m9V-oACc8HO_0f2GkLU| zEmQUCf=Myd^@h3X1o?=GkNjjGxN8tY>l+_jQ0Ij!a>h(onSL9oc@xsA->Jy ztKiccSrw|Io24^ehcCS<^~~MXh1175Bu6{8Pb#jvEmQwme88diy2>q2y_zdCo2)-1 z%i0Kf?{-=wA-VDjhd( z9!!;*$jn!J64nfM2y*g1V6dbo=q^IVh_5@1}^X&k=wJ7c^o;FJ2lO9+M!dYZ~bGs4#zjouceMY-}k-8XF1p9G_B#W3-_%SMajjzQ7Ti| zz^?PW?Cy~p`bHdvqvSUials6twSMRoMO`YK;7CV0>ww-FJ?@_-$@!i~*B(^OFkem1ZI| zS;bc*yBBqoDQ%m6(bcrEd_rTz>{Dh|e#TIr;Vyw)s~nH6kUO2p>FU-}Xq7S5d~Vp! z>sd&6TSMm*3+JM3tDUa~Ox>nxtJHe6QlAuY_-|o0W0>jRQV?wKL~=CfyyB($zQOfH z&-)pzjt;&?%i$Z@OW0RjeRHb2>V#iu4Qs)R2Yao=F7g&0?R+wmD_`|+#H;YEvrNL4 zJ^NoopVIjG#6{D?!K{CBMAtNNr>k2%?=iy%a&cNMn!|O+6x6(aO9|U3++geOvE2Br zX<6p0)Z>)n(eADjcV0M|p4j(T{xF9@+)w^2CCBXpBX+_M`NrH-kN@J-otE9m>-Oc| zrk>Y>UvhexBiloprBmh}k3DqA{jgilEG|&`#48H}Yw31r7tXnfR5tcOtANsjGFDFy zEHkpQ@QdbDFWOy1wVNn@dnH&^_D8zp?8%cQMmAluYJA!Ij&S^_9N3g3R3&gwPBm#BY9{+jqzHu}k;6y7mqBOyzj8TEZ{EA?+SD_t%*)pA;5 zO8Y%?${Y5ugFA&DD6zV=Y0*g+`+PKLUtwS^v^8dQg&uuYU-6ke#!t&>>z;qUes62} z)sfNO(9{G0!$jjpj7yGepqq8soM6el;g)^h{ihAyj~GMveQNls6F)C0NE)hflx5s{ zPUD&E5cx#r_viX^ONDk94yb&)z{H`nXG>y&K_E}b$>Mk1JL28wmqod2sWRFhS?6bX zGDFqn7t86LYhy0&eKTfU`AbsRH*%?HHUEe9^DgdTaHwn;)+k2J;kV zHhzqk8G5OdFQyS1omL|J>E}V+1hS`(?r~@L1_hpbsac6()mL-Yv)%eB%24)JSD)5C z&M_4F;nd()%XX0$;`w5H2i9(6vtvpRyTxjdwc+g0Nxv{D?`K=FYlwxtsomOnkrIYJR9NzP=Z%rQa znAFedQojRd;(prv?yJ2!scmbnWZv5LGA)2H&FfD7@f)6BrbA1v9s62XZ&LqmKs?JU z&XucRnxW1r^ow4S4a zOg~Q@Y0Wvcm{IThU|hK8Yc{hL%VcDxhSlk>7JfXmn8n-2_;9=C!MHfCkt&~%``eV{ zPlxXiXoZIWr1ocQ=i`$WI$n93SD^9+m5GUN^N*~> zzjbN?w<`u8S{r)w=Q;Iw9hpZb89IG#XefR(+|uf`)%l4NPj6$NsDg3A@@>l zvu@YW4(M2)UA$tTd4EDo_gMARrOms1cV8B-4Eo&*cZsttnsKl5+iYn`zLq-1)poq& zdXA{FZ@sQXziUL9+Am7jX&1(T%qr+44_Lcc1j-plVp4xLBkAp70X1wF;`q1FEYPQ(}orMNz1QSktEHCGzdrDw`hYyAV%aOl{d~Kx z-b~y%5&WxZ(`f2LgJe#jqroSb8P`X;jou#dUDxc>ImsVS5)yu_Zp8qBirzdZ$;lqOWS8l>LY&lN3z(z=YLRgJ@Q$PRMYbpJeieh z9}k{rJ$hVOom@uqkNhYedy;?7pfa_An-;ovRV}C85tW_tdyjS;FT41%Va4T|IwyxR z1(!mX%u=O|F{QgYzgE78O=Mbf(EW6I@Pudy`?Iel`c;fWGuy={%^%N>PNkZrdm4?> zZ@j1REpn}8+wtwyG^1xXp6qF^-k->9-BA1MOC^Q7vRS9nK;)hJn;QDav^{56xjS>q zGRa;TFS_SV_e_zq_WQ9F8ixu`{TLeBDlp{O9j;f!`_ixZ*)?syQ3vNwC#5|e#dFL4 zjOhrp(u-Uqtv;K!sHu_bnWxL+kn4*`#@RX}NBGK3#;Xd8K5n`_-b7g{@Kj>xl&QpO?@6xL8RXn|yMv}7Wyz|tRwL)H$!9nK8Q~TzR=GQXgL_R&Z z7%k>-T_nKV{3)+y(Sc~{?jS!Ol5x)sz4Y>&AWuyN?xl}%c8l9|n0-!a%QPO z&G9tK72oA&PT@7%pRh*WV4zSUe6Zt%@j+gOECIz$TdL_)dOu3N9%b$5bv-@vcy`Wz zWVX>s>r2L+8S^m@%apU5C(nJCz4XFrMlbSs!Dl1A5~Upv)>fF^Jvv;}(^Er!SYpdTP(I^bPxuuRc@VuQQj> zk}PyfJ^tOGOOdUa%Bf>*v`?=q)0a`jPT8tfs#d+}QO(OK6aH@S>GmPZ=hGi9e6pB4 ztJJ#QzpF#3W%Nf5i?v#K%;7Ep=JG<95SHcNyHkG$Ht62|DD7r3eS7Jzfcv}7d!NzG zd1omi+f8R|*;K-wZhtXxSM&z9)F|%$oy>=x9$uHy9(S#t|0UJ*Ayd|=2L4!a#tF+` zd^EfGZvr3UmwWzFuh>piY4~(Z(y#o|T6w=A z-gZIvYZjsTLm!`ifG2X-yMddb()1#0ebOo&3l<4^b(K1aWVg~AZda8rZ8SD6m)$L` z`RMiGU}dh2p)F=>rR&OqwiZ6Dj#f)Hu-$9CX6J>5F+L8aQs#>3OiOW%TTwmTwg(=6 z)TMYOTo6Yn-LwaZF5`hBMw&62shc#vbslEDi;PNUn0woa58208!G z<-2gc`rOA`D-T~i`R3&8&Zeo_;tdU_qG|`ZMc=>W>wiq!^gTkQo9bEe`NNO?6}?rN zogP_xH2fD&dKg9SX}o@qKjZ#0M|f*c)kmb$fBdKg`-=?>A$Se5+GT!&&Ix^Ss>28}NJXtyyIH z+}EQadi0CExBi+|o;i5An(DPfdEK^fvs-)eCA`|Ymu<9I8|JDLzN!3g0T}ubI>Hcvo9o!U$rlT~~bPvuS=h69(x6;Ae;(ukMq~LnH zefNX>t~lx{wxk0hi1JkA6MdEl{i;un#|Ag*&GL+XI|Kk;`Wh4WVm>hFn;KQaD* zK|%>qEHub^(Wr2>HH?c&f$OW`4!!w=7F=UZfy>s2`_zbc%cbV8+M53xU=rynxNDjM zcUKeN&$mRhN_@HS=X^p5@Q4@B34G%JWH?s!CwzYN#NS~Ni9bt{;Tmng`}5xkI2o?= zA`|ba!;I(u4PZpS#J>^07WVkJzx`iJA^ok7|J?gO{|k(1es1%tv~WfKXqA}ZzY|eZ zxVrnV)XrbLjb?RtMCHw#j}b{H9?^v?i6^26f-Oiy5qz{D5hVeF@b9xp;y~&DX(EbD zOyOVmCQ6e3nufT<{Q0r}`OSN9|MbGEr^)|#>IvBXUqkLJ;Kr`$c$^KNZIR zJd63i<(>HjU%)#Hl9du zGs8UfSU+*RvOay(I)9C*B$ve9h;Hpup(TsUj79X99^SGz-`r=7$fk$* zI`Qn(x;0L2txBialSA0O=8bR@0>6rHo9jVOqQ6?!lzn8MUf&LxT}> z{WY|)uY1OR{kGcoQdRys-{3RX_Tr-C_WUK6zNZ}SdHz)0U4P4S-L4xx!n3^Do1IS! zSblwf^?QHbI>yx=AFRKL^6~L)KX!lfO3BDAS_fan&+eGEF**ArfM;b`=mE_-oyZ7^ zXPwFIgZ;Hf(&}B;?qBn1UdB(4^s>VHDX;*3+ru*pYl23fr>2Hmtl~fu&4aTdlvasShr*%S> z??RvF)kf<#l5G#}u+k@6{jY0<>ZoIrj&?zpzdrX3+TpWTQ#sr2a`6&_4SoiJEhTw$ z_2n^ZevW_IYGJ{+LP65x%aMBw-g<)e7Wae&#aHfG9{N_{C0|3Ju1!Tp51Icvk1 zT?!YAYwU%`w~R;^u&DBjG7W8-{wy((;F{I2%Rh02`^Pbt2QzHKhvMqAw051{$F@9R z$-2yeqS~Ka7AqW~%#_=QG!T$foBVpMM)i4ZPVTfV+}>RdE{63Is=SQnqt10)kxkzJ zIWUi&;URY&4_l7M9LLS`YvqI}7ouL}mjsJG2~ruK+A7=HXB8brw>z|%lKG8s;PsNP zeaDWB_c`Sn zhyC1H{`F~lrvWd0?Vy69v%am8>eILky%J$+eoVk({#T8cI{Lr4%XtRdI9a<+X;uCQd4Ys$OP;H9c5e2*)`rBU)>_8;krWfZv3u{ckDUk4V}fAEgezkjEmQqn;nVx-jN+#IwGC1nA3M- z^Yo?lfyUZyyQF3q>1jGyz5{%BL^MiX*cy+&E|bdLf4_h^VziNY=tlFn^4m}m(}Uq7 zWk0rLP8u<0DEc4vo=Q{Bze`eEFId~!Axz$Pf7s#N7o9pfxbj5@v-jH8+Efo z6?!&X&~mgIzc(&^7XEy*m}}&^PVv`VJN=J&TpwnT+I}Lp@Tj#hSzTrQAjd>#SW?(& z)5MSxPNucr=Y}d-NOsnTQ^J(mMVBWtDSx~jltA}H==J!ebu%(@90u)nw1T!f3;SN^ZHxON>5_#mh4@wa&%{f(v!@_3o_c*E81fQC~NZ+ z$fuhF;+z~}9i#`$51o3=w|)JORmK9B#%9hBiQo9$m0FwgDI&-CxYx+n&^<9>1wW1$ zFkK;^@Rm#ay?5tH$C(Fhj&S`3HO#LLZrEQ() zqDGmvFBI7uFM>Pn7~JJ%RtPldT9nr?x6frdI^}$?AN8G^Ev)^00pnT5N+zLp^Ye;* zfosx*X(Drp2Q2F60_*35s|CtKG#?G#k=^(*BP1o^DT9ID9Tt(&Ie|luXVyL@speBd z={DO8M;^)*Ike)Ut*6Pw?}fUoH^VBd`OEn)%L#Ih){ri=FsyfKTdZ~R#1?1C#5Kow zw7*j5cV~_#aS46B_U^!envZ6l57QYaKN?m=Zn+TRtaEcJYx>=@qGnNXt_LZf`^RK6 zJQ{YU{tz7k`LU9?-GA4R^cPj2WtrL3NY>%gP6_0z?b*B}NM-NrzK(=Z;?9mUuR8)9E{hW}1zy zFUyjg+~0UmSN7iLZ2WZ3_xynO+5yMU?;>iO%%)kB%rey!B$F=7SSjS+?yNpub6rd! z`oZF+q~n^mjtS}N)>%f>yt1lZ9o^mi%}~^zD)RHLd;v9#B6o)WHb3)zL#A$7Kh=O5 zxE>@WX5Blw^Cr*K?V9TLUUuKTD1Ae$Wt*0%Xt#JwYgP_NHuYglrVgjBz^vWL^eC!c zymD>Sv8dgoa;H*V$lw1)^!5h^@w>zy&lW*Te~yOu|DO*a{fYUbCevH@UkD!G!MQo>;vxA7`Y1{1()gZ1WcRa--2!C~QHW9Qp+0H`|krFrOQE+rRbIR7* z#)U^*OiY|d$IQ~!05uW zLJ^VV(RMXE<>J9}Kv7u%_Ls-pUH(F@w6{VrZR!odUk|fb6@RrOWF);!7 z4_ei5wEXWVf2(73KXuHCSWpSFBt2Z^{;wYpm7u_4Tk*`pBuNx;aacFv2hWK=VDLvO z6_)q!FdB&>MeK?G4kP{yds!3)wapleh=?q}qlrVsErLg*L6t6o2jdf?zy_Q6@z?ky zCE@)u1STd)0l`A?2oXSFQiQnu9YzzEq7nP91u!z)nu3lGE@mMLh8N&bXcAHoQusRz zUUid#TUr*v#H7UF#kYkpz#~e+7kmpWMM3Z&G(#n}o(u5EBr&4Yc>xTVhIm?S0Sxen zH?a^HQ3#I0Bp|Ma!o)H9kx3E~I3C0g(Qj$Mb|{R5@s${vCP75P7LJcbLFp$cCLxKA zg(fK_2DiQ}_?8CoK;m(@zqdytUiU+20HcEk<`6uHhhaPHC z6yolth2K)CM2vR<4789K4ilHe`=t?~!v)_;{1d-G7Z@H*3?7C=zNL~NDu}|!#6vL) z`=F9B{VV~e2C#2Im!L4fBAz2z*d7fOB?c3R7%74W?=50@QY2K~2%d!38IW(Kh$9sU zj7q$ch{7a^7(4Of-?|-m60;u?l48V5IScV9Qt-Sc0)uxVF+52zRJVgFA&#&t_?9L` z5~m=t1u!X8uhHOPH{yWEg0WD@Ko}GzCQiIQiQq}XgO>;l9_2*FA_f@~qN6Yh1>-*eVSGiApklfN+yhLu zfL4%ILHdQe^02W`Xf%8*QkbovNQ$982&^w|lYv$!?-D$O`3Ept%q~D5m|Xw|5z}=P z_<`w3NN{0%0CJA;fz~|hUsGX7W3<<61c2VDY$;2QmB{>1#biO*TmpkOozd@nBJfQQ=&Q% z%qm7Jz{6x3@bIyKpNP_rDkXvGA*vLN2BoQ#I40-tE#}j}x0s%!N=d?dvkUnEv<7C& z01wjC7Lls9NF50uAgFb}+6DrUF9Stjz!#E*aLY=B|=065Hu*?37vW~1K% z9%Q)}wg-5a?v#YnkEpD|)G%8n3A~2RjUWNq2kfFS+DnO3F<(GRoQCNGDR>_br70{q zrVpgxlq1R;z>%0fm6D?3eUM3*F93KnlqaR6K;bW>A4yCSwkjxWe#I8hnZQH+2!KhV zcA7+j_q37u0t^fT(g#V3jIKF}1TGh{9whLjP#X_0aa6XzF{7gN0~l=0kbcE!SWJN= zPJ^BiJQBWcAXwPCK_3#>eBpgOY`z2t;b#&I8KXTA6}9nT6fpmuM1uGR!s7tLbOg+8 z{-Npl75!KI1z_0z4aOpY`h)3h0E3MH(jE!+rWpSLk7N7?E(6*xJf4Z#0N`CojITf{F}@;+Q7}G*WyAOs`apFe zi6lWm?KwmmVRw(rO&r26*gPOEfbtc1Yk0q8FlI=5B%nRU_fiyej}3B(?X7?=;^@8y zU=rB+lE4MQ=nT6$blt>(28jM6i9^T;lVA82qYK0nF}g_5@OeN?8pQ)%!`1^t8e0z% z?8UKpNRe=U0oM$}g9fqrLf8VEFT`Wf`I4v*6hzmJ1|dKUCV|=`SP$65B6#8uc0|V~ z4uJ-Id|=?vZwcl_V4#~&Umo;x+8*rK@%E^&+eODmmBiZvorvOruZQ7*0ONK>9E+KQI+eiqfN*3{ z{sUct`5WR8mPhFV&0%&Ld;!c(6Yda77hsKlST{1(FOVMZ7q&APUEoe1Y&}4iV0aL) zL-BwHm>vhygXwXQE!CM+7u9ZU*9p*lA$%1sTNVOM%b`MrScB z)=YxPE6#tQo3QawV8exu55y9kFBQxd$}g}>!D3_}zG(i4SR;&2DX?ck`2a$o*!ZZR z@KO3v!5zo=9%hWT2d@ob?SXE>=m(k!jnxw_HJY;qeG2~}w4#8Ig!W4Tmmj4w@FYfO zNIPS6h7=#xFGM%+e!+%f{enqG`-Ny2&Zn@2Me!iQjpi3XR&hN9CII6D*u7zVK$Ll) zd<8ZNmm@+GAvBeMZ5c{upaCu);9{clfNBPe|G@fU{0CYH)00FA0ctO);1Z(p2HPGq zrVmv-WHf#cFbbNthwYmfHeZkhe7;n0YEZgB`~a0p(7M<>pi%>y2aE;dQwcD782y0P z(D{No!2Afv(PQ(4bQC^ch}~d(3LzP+Unm$r=L@+z%$}2>o(64?3|o7&Jqg$fq4R*! z0L&gi)(^MmP?CVsSpq`qSbG3M`2}Anb_Q zBiJyY{tHBC(fm0O0JJPBTM$~u)>ldrqaRT|it(v9ctmJ>5avS12X}0ud04PoxIH3r zz1aFfZU^OiDs0s-zK1v$HV=q%VeLV{1ZxkrOlW)H=HU7i#*FD_kU@05z~LC3VT*&& z86LjF=nTAp(GOH2Mn4J2Ghy=uk;di=F&S*W5CX;K3qBz>4=LjG@j~AgMvU1(kS*K} z!X5(S7osp1X%E&CvzJs5OB4@G3N}92F=68a8-URdWEGkAtlTC{L8mkSfRR z5h!C64`daa2Slo{c|cVGw!Tnaf~_ws2e!W831I6>1=&L9L51xlIzA{z$K)KcZ@8R8 z3>4GjptDgr1DUb)0Go`h2c&B;zmo#ALgfv399uW={;+ieT48t~gBTu#C~QV#3-(Mn zT_DDd=>sT9z{e+r@d2nIj1NF&aCxI*bvLlXnSXq9!9E#wJ(zuik`7$n#OGfsUGObz z-!OX#Qi-((Az#d1!Y&lEm%u}qJ_U7(=~JT47vmTB7Uvh7esD22Mn8x_Ve1Q4A6s7t zTVQ+&u@;O^!I#I@1NM@*{)4(wln;Q1a6SOtiSiZf4KO_pJ}_oyK$qZl26Q&s9tE~D znEXPF2i0p3>BH6oVoR7_gFOze*C3aV%@;~`P`(GBAJ^mmP!j{X4qp#QBcgl&<()YH zL97MU_Y&fGdXdUktHWBDNAj*a5 z7jVNcy8y8f+%CXcqU!;>OKd&Bf@1s!du-H?puy-+-hd=KcnApX0TGS;gTs&27emYg zkMF{_n7k3kaZp}^N1V~IfR_!?dSomB!}JDmG7Y6ORG(sU2`&ScCni`Nl_NODg5|*= zTY;^cBq&8xzkrp&{5l$p1=SlsDJrCAMx*GKE2j&T1TbSySs7&AUTIL3ml8x7Ahfy;oeFX%9IJ%EQW`vIbgtuL?;w!Sbo zOkaU2!SofZC2l`RWZZs0oj#_Y@w3e&I6Z^;2a=L_eI3|FTt2{bqxJ}R2-B0G#c@3e zn`d-qT+E!IQEIp7mfm;>j5Li)&pc8)Aw*<6w~)09+>>XxddE(!B(L2fV3$t zM=%ylAJ8BGgUJz|C;5jn!LS;5-X1PI#QhwgDY~zagn$kvZ)7}A3_cAmZ*ZIwn+I7O zvmdZqz~mf`A7OG1BgX7Glxkr19Bd=*=Ri;kn+I%Ou=#@1is8Xs5ZJnjV`qXvKJYUL zP<4p&Go1NB`z1==@qY0<1Y}5YdoGUW=|D|ldI)$Dn=klq*nHvCCvLmJA3|jY@UYky zR90Ye4%O(`TEaPXw3d!2EyMT)@KC)A84M`CTqq0hEhMN>7#xen@t~R$$3yFa;MzMZ zXARl_BnkPJxEBIhH^75RJPePF$_LoFkd+Ai^8B3 z3>zPu{KUow&0+0w1Y6K6Wf0#Z1w;1OGD6PQw04lk$_DJ9aqkX`+ zZH%wLgktT1Yk|?348%g)gY&Q${on`@Nhk z<{<%980b7muqnY{uxUqO5a7V@;7mFW!+b{wgiE2d$#9er+m``R#IW`N53NUsZ?TvW zz_5B?a2&zQueRz{BVQJ32J>I`5(*^aJl@{t?%|=Z_$eLEKcm z&^AIy8l@HNtUyE%Jc#OHIu?!wEso=fV?HYcV=*3woi45?C7@0V zl`Z%djo(9i5UfY$2D?1W1`yYIpzRSQ>ZnW;_iCVe24Fpzm2Qb{X zCC>gM>kD`gaYyC>Bx=Y}k?DwhTA}t%CAy88o1~Lod<-Ba6E{n zp?DCoL}>+;F8KJM4jH90;GsSPSS@fukUl^Yqw)b}3)>?C3_BA7FzhY?!ZM=gw+J(c z`VjzwmBYqDyw0$|zJZB?NFfR%V|Ta^c&J?f7?$gW-858vE^H5Em5Qw!)IDH4N!&e# z(ix;2J?9EhJ;;n$gW4SCC3k1G#Jk*bXZ|AQ^{ktzfhNGpZFAp#fVXQsuTp;l+ zYWJZJxQGw`7UMstBg57R`bB+5I3a=MNdShO?}11L7MlY+tmd7-L;X5{Vf$L5auDNZ zsJcdD4}b?ZP$KgM&lX#Ah-hJJ4yX4q8o-e$bk7M3j@6|>GC&gD(*Yh<*GJ%Cw1==1 z#^X?GkM2px@F`kH1_^NNZZD$T0=0RtE5pv>0Sw56&&4*GK83;>r3FFwh>?;=nH88m1Pi#Lt$jd z2%s>y_XwdMe2bl_fm=Ud^MZW~#Q_Km@KE0tzQyhX0M5m7;DCqS_X>De`~_gxJ`X$< z?2ZLOI#9oaz(e^DU~oemG7sP?G2rPd@XbsfAf?YBu zA4FCI)oa9V8m(yq7V}u`?^+$zyv1fB{FNag{poTCxC+sh_9%=s&KMrp z84M5Nm>3=$eZXN*$cXd-xp$1miCPHkTZk2)-$FecMl0~BvG!makF^JRXS8M!zQpdf zCc=N%JcwE_Y%GwY$6?srm0+~6bKn4j6Q?L$pq?6s!7c*91DV0_Aj*&9L8t)x7SCUT z^26ee0K;lOKu2KrV}g8O_m%LLLT%QFG&A9xpHjM%zC%?Z{AY*cXAKj>_@P7rMmbSI|&Ko&5XLZ}Mk z4WKYtSGymuUCmG~jRVte38NbDt8e45guk}nCyo%ObF zHj122!357No_-W|FQmS)!#VQDUjdf7Gcw8I#{rA2fXRpg4vmMn7GAZ~8wL~XH*JOV zwr}zXwjXG0Yz1Bf9`66nAQo713tX8}Q}#UI>re5wkI3qh zp%zcLz_c|+iGv3d4EwgN4LLCr@Dh`HGR>Hqfon4|S08juuKv)yssYtM?%L@GyyV4z zrRK%05!EXxN&7#y)!<#7)WtLPt1oBVd@DbuX45~g)UmlaUAe_8+ZC4oMCt|e;?M^a~8ej`O>E!{+GB&|4Tl*edb{; z;SUWB8&_cj^OhH~${7TVY5pyq#o(Ljy|Ob)L&W=oOdr;En@?!e*LE_^|E#gmQ;{DT zUuTQ9l>)sy+uok$R@Vc0i{V+ATmC1FAb4CI!6W?O)i-88PwYND=-Eta_|8FN`Lu_o zUWWfY@gg~Q^uV0SxH+qI{u+>N>ns|%aD6_&9`-!t^z%PQ`N;1Qg@I+BWwiON>Uhc{?@dEE}X&Rq{1EGS=!;7{X2XH3%^>tho!_6lK%Xs;a;Mi)=*r?llzDJ(TKR6e#q z@Bf64hsLMZCg0wpWKwJ_lL|tKj|EFC9aw7OU-hAlM-uR!H|D^So94uj+QMLoH8AFh z$267?JgWx~8MGb%eaX83U^cUrY2UXZd$VEjt~lhvoX8hX*ht1#W=8czamf6S**5=k zq***!v!P+kGe$~=RL8|Ul}7u9=kVv&9sXQNLPMBa=cRQc{a_bZUM%gwvug!UXisFo z+L^Xs?T7uSbQ5#O8QQ*ahei)#c>8v@(X05ZjRG+y?mcI*wiu~AV7SA={0hStS z=4#$EG(X%_qT`jR5U-BM6@#0$tew#{I$2qn(rH^8*_D!tthlTnWR)5ug7i~s7fiI@ z@~mL#%D|X+ZrNxS?}DfIe^rIDD_n+wHLEMj@#Wh!3Z z9J09N-7ow-texz7;m_m>UHARqxvB+^9XNPQ`h`8nRF2N#SxYJdB^DO%QtXx&dua4Z zuz2-~>0$rJqMEgxu4PZTXF@_(VTkGftME4%<{qTHYUrSfz)Y9Mv z3ol|nwym`!H12JQhqj@6$D!a|@aoDy*Osm*fa*B=%eFOBL-&rmi+7=POT(GEx~taE z;&CNZ|I{^I8r-Xqm0;5cSkLm#QW=jcLASgJSJ^xV`%!AG31I2nS!~q$!R(-2UwA_! zdj{={xeIXCPBSL57c7*y4;DFJ$@G<}Q%Ptz?nd^m3#B0jcmKzs*S5^mD`zsu8pbn` zwM2Am#*L-ELLm%L^LOKMsNFh6I)UA04ku1ynEI#np$dTG@ql zk8&IjFXmwNRA_DJGNpxvX}Nd|fSpIeMbnmxAZ;a&6xOv#rhaupTtV6@2O7G<7=vdi z30`Z#2`Wt;43>unUQE`d!INK}Ta&{MT6>N;lkvU4$OjtLU2$Z=Qxa?Yd(QX8W2A`Q zGYmxU1s`S11=BsX4P7z~U29nORaUdiEwin75+c&KD}X=yJ{^i~2-j=h#KUb{SI&(k zIX#H%m5L32W?TF-_k7R9qu-0go7>Eym3(Kg)Q9`Z-!=~jjA4FcAZ%%4=z09@j*I6a zKd~S9%X`*t0X-k^E^I9JrFh0JdU?2^an6q6<;txuf0qzZn4q0$s|ri-gt-;(4*hAH zT+ox%#^i&gCKe-l>I8y0DJ~6G#?Wn@z#Gd48E|0k{}>cQL#Eu~d5$2w(4gwZo$Qu| zQ1SlHC42Cgz9K6pr0BhhA=P_v6!{;+ZFmuXuy|aqk%36H%79_M|4aUx6zJ4IWOYpL zKUi`z%n#8_BNvhErQ0{i?uK0%Fi?Q_0nZ!&kwf!u)?-22gBk?HR`x|2yp3g2Sg|B z0g)e1YITUecIiq3uO2u`1y9+=@N&lM8FPC@`pYYsb&V-J>)Mr;%l{lfLRWlZ@CYz? zmW{$5_9*E%!Q-tA4I!k#^X_`^_}L4~`^g;iJ%fm}Z(C*BO1E?2Li`uc*{5SpO&5<9 z>0!*118p5o4zzweoEcmumxj6Zutt=INQjLAm%))*7EYZ#W3u$c7cEUadivqP#|#!7 z=f%m~x^R^pUtuzts~0}Gc*26Br_z8TdtH0rMG>o+Z%iZ6$$MsbWlsieD}FL~O3#Ld z1+}mTS#h)Hf4tjiD;_g=%7ZN4U8fgM)OyEK2-UWgl@K{|y=P7{`DSjBebxhG*|y?4 zmp@x=@l^K;f1LhlE1obg&kUq(^Kco_?S!iv;*0Y?>5aj2;VP`Mzxty2pTa_ED?Pa| z%q)M*NQK$>7tiksOC4cpm0y&G!&%yzzJ+zn&Haw05TNkvuv}Q@zSM`dwatVV#*Dx& z0(#}*AQn6+CczUgRak0}*cCiFv@{s?)AovT1TVFGR1K}}${+0iTuwv7Wg|2^Dqk4O z%JL!(s<6~GZ~)=h*tU*qq46c-+~O%$pSFUI3rlTbJ4I^qfvGsMG=z&5mimso;ty*{ z>tMih;2j!5CN_siP-%T~P9U*|aht|oCqg~;I-a(+b<-Pr)15%p7711#8f#+gQcNDP zONot-T}s>7rL-;2Y9z1y%JH;#a&Ck7V8gq#_vtS=*DophGh3GY`HU*MREPgD*?!O>CRmmY0iKT)GcF7F8T7`v+UNxlp}g^9T(&qm@D9 zGF*i!(+3}wERhHOt1rf>xUzrnLDG%#{9wCwgsWZ&XHDP4(nSXK@mYrw&v39Eqg%t` zC%F`?&|p3YFAu&zSJ=u~DnS0ntT+D?O_+1tt*1LL4{zhW!SZI#Re#?6Rj|~T_fpFH zwey3i7V%b}QOMg8U=kA+&wYP#EgiTR9|ljj-sYQ1;B~7TJb7rF<7wh2ul#rkje8Pl z|HsU_`KC^yc{A}$H|fWf8friCo``;U3~c+sPE(i_X7IT4HZS#_lrJxwPumvHdlx5r ziBv;F=3HgKOt^R|ngmbUd-`_jlD3X7fjNps22#xzkEK2|jAiuz=%MZA4lBr(9Nv2& zD004n@Zpa?AT(HggXbs}JocgDRi<{M%mwc5@F%k+{5cYa7jA=&hb3ZpxzO71Y-$zu zFb7TP{ojSyY+K>p(JOg@(JLpU{*OJj|NAQZ@c>0P%*yDRII_$cy73@;S&B1f{VUzexEdN)Vmfpkl^4$%R=wgE+P3%3*|rs86Fkwe#d8EnTbHoV;9n?S zYJYMEXgvM3`&I_*&x?0zx-_m1^Wt5J+Qqx_goUMEhKd*61B8u~hOUJ!f56gkJIegM z;>X)owoqtXefj;LITQKO()P_JRT=_mNA~7wY48(oTUk#JeS4Uzmw>c1?g5L1T{cQ! z-SbSN@O))g)AkaY_J0Zo1dphKcLCqqR@2})^aqb0B6v(Ui>Iz%@UR!WD|@+ZiL`Tz zpFMc|?90oQ4PCqo`CPoKwOiPOPP&%u|IDqlRsSzExcIWRGlQfbS3-Arv9_n}r4TKi zwIs6Qtqlz!pOMRjxbFX?6n1VgxkU!9rfExc7Y{GdwPP=B>rYYa>tPLJyj~i2T+9EM zRf^X=&zV1Z%8gw;y_J0DOyA3bMau`zoX!}z9d$hT5tjz5USzK}L3lq&#<%;0Cg-P-x^JW4(N&~|HK!b`0KPH_&iwC()mdWvq`lk#J? z<%N(`xc^fCf8_@+V`K|mzk&ayHoa4h;sis(6?@-VxwetZr95tbFI+zV;|~bWt!XUV zPt@`9;(k8%XLw$u4_;~ubJE4vp{>cfZ5`JN>)IryeBY2c*ZbDOlx-Rx{U;ZF+&13vc?yoE_OS-bBu4_TDjq*M2ZU z?L3mLk$qnTTJ|0c?&!0$Fko{g7+4^XO8>Rn8mm_Wdm(d^{jC<}`Qf8YpiYe-v2!QLJW(aX7rS^B-Q;7jYE1 z<0yTXHI`*Avbqv^yN6!9!0PFhvEH$~TC6KScv*8EVjN`qrKT8I>O8s7rIxKZXr&z4 zYn!!Q+w~s_K}(&93rkxcE?8m%cz{T2>GH{~tl+KBT3eT^Y3n+ZGofo)_F7AJ<}bX= zb9mXi&$qMtz8Rf4ed(stw+kiS8Xr~ziEVHDad^8=gT?nLY*=~gwDmyK!i0B@PHJl< zUpxvOUR)(Z!vqP9zNhIBmRutT^t_*ZcpLWsmYV68F_r!@)2zSe@X}u=%=A~N#_n6@ zg6RE`3m?I*vG29rJq0W^VZh>Z089N&baQtBi!B^1v1K+!)w7moQ)b7_R<`?*z?8i6 zePOh_UV%vn8ya@Y=o;Aitt7xCrU)!CRCcoL(+A5K8I9ey;KlZEPh_k=`CyTOvLqXe zBXA)xV+N8DYGeSm>lM7@dWb^F`A@iG_UVIdoEw;n&(L+g58ZoTZO)?iB*?DW_ngSC zYhXrXX{cwk^PJXie2GOeHg2$-4+K>)W-JZ&qx8*wv~qSl-Mi`ST3gTPVEg95{cY`V z2itugOh)4Jr?gUJs%+G*rQQWks9YsyK-#(l6odxJ5E4bMyfS(~l| z$@T+mZ2%Wpk+t3C9UXEe+`EAl%;OTni*w?hY2fjeFJ5aqxLC!e3YOR{u+9bQvganZ z#@rW#7w1fUA;;Ngn8Wt$r~*@LEnrS()3*=m3#`6?t!)W=3YBkLq3rpeC2ZvHaj*+ZGBx6YWLNITs0gR57@3ru`TURn{PE`(8ujV> zcQ1c=`S!=xFJJ%u&Fky?j~~8x{o&)+?|=C4!^aO_z5Y!+%r_tZ_WIqs|Bv$W*O%|U gd-tzjUw`@a-@knP@!f^Se)ay{XP^E4Pk(s#U$&cx;s5{u literal 0 HcmV?d00001 diff --git a/src/mips/__init__.py b/src/mips/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/mips/arithmetic.py b/src/mips/arithmetic.py new file mode 100644 index 00000000..afe7c26b --- /dev/null +++ b/src/mips/arithmetic.py @@ -0,0 +1,186 @@ +from mips.instruction import ArithmeticNode, BinaryNode + + +class ADD(ArithmeticNode): + """ + dest = src1 + src2 (Con signo). + """ + pass + + +class ADDU(ArithmeticNode): + """ + dest = src1 + src2 (Sin signo). + """ + pass + + +class AND(ArithmeticNode): + """ + dest = src1 AND src2 bit a bit. + """ + pass + + +class DIV(ArithmeticNode): + """ + dest = src1 / src2. + El resto que almacenado en el registro hi. + Esta operacion es con signo. + """ + pass + + +class DIVU(ArithmeticNode): + """ + dest = src1 / src2. Sin signo + """ + pass + + +class ABS(BinaryNode): + """ + dest almacena el valor absoluto de src1. + """ + pass + + +class MUL(ArithmeticNode): + """ + dest = src1 * src2. + """ + pass + + +class MULO(ArithmeticNode): + """ + dest = src1 * src2 con overflow. + """ + pass + + +class MULT(BinaryNode): + """ + Multiplica $dest y $src1 dejando los primeros 4 bytes en registro lo + y el resto en hi. Operacion con signo. + """ + pass + + +class MULTU(BinaryNode): + """ + Multiplica $dest y $src1 dejando los primeros 4 bytes en registro lo + y el resto en hi. Operacion sin signo. + """ + pass + + +class NEG(BinaryNode): + """ + $dest almacena el negativo de $src1. + """ + pass + + +class NEGU(BinaryNode): + """ + Almacena el negativo sin signo de $src1 en $dest + """ + pass + + +class NOR(ArithmeticNode): + """ + Almacena en $dest el resultado de aplicar la operacion logica NOR bit a bit entre $src1 y $src2 + """ + pass + + +class NOT(BinaryNode): + """ + Almacena en $dest la negacion logica de $src1. + """ + pass + + +class OR(ArithmeticNode): + """ + Almacena en $dest el resultado de hacer OR bit a bit entre $src1 y $src2. + """ + pass + + +class REM(ArithmeticNode): + """ + Almacena en $dest el resto de dividir $src1 entre $src2. + Operacion con signo. + """ + pass + + +class REMU(ArithmeticNode): + """ + Almacena en $dest el resti de dividir $src1 entre $src2. + Operacion sin signo. + """ + pass + + +class ROL(ArithmeticNode): + """ + Almacena en $dest el resultado de rotar a la izquierda el contenido de $src1 por + $src2 bits. + """ + pass + + +class ROR(ArithmeticNode): + """ + Almacena en $dest el resultado de rotar a la derecha el contenido de $src1 por + $src2 bits. + """ + pass + + +class SLL(ArithmeticNode): + """ + Almacena en $dest lo que halla en $src1 shifteado a la izquierda $src2 bits. + """ + pass + + +class SRA(ArithmeticNode): + """ + Right Shift aritmetico. + """ + pass + + +class SRL(ArithmeticNode): + """ + Right Shift logico. + """ + pass + + +class SUB(ArithmeticNode): + """ + $dest = src1 - src2. + Operacion con signo. + """ + pass + + +class SUBU(ArithmeticNode): + """ + $dest = $src1 - $src2. + Operacion sin signo. + """ + pass + + +class XOR(ArithmeticNode): + """ + $dest = $src1 XOR $src2 bit a bit. + """ + pass diff --git a/src/mips/branch.py b/src/mips/branch.py new file mode 100644 index 00000000..75413796 --- /dev/null +++ b/src/mips/branch.py @@ -0,0 +1,86 @@ +from mips.instruction import UnconditionalJumpNode, UnaryJumpNode, BinaryJumpNode + + +class B(UnconditionalJumpNode): + """ + Mueve el flujo de ejecucion hacia LABEL, incondicionalmente. + """ + pass + + +class BEQ(BinaryJumpNode): + """ + Salta hacia label si $src1 es identico a $src2. + """ + pass + + +class BNE(BinaryJumpNode): + """ + Salta hacia label si $src1 != $src2. + """ + pass + + +class BGE(BinaryJumpNode): + """ + Salta hacia label si $src1 >= $src2. + Operacion con signo. + """ + pass + + +class BGEU(BinaryJumpNode): + """ + Salta hacia label si $src1 >= $src2. + Operacion sin signo. + """ + pass + + +class BGT(BinaryJumpNode): + """ + Salta hacia label si $src1 > $src2. + Operacion con signo. + """ + pass + + +class BGTU(BinaryJumpNode): + """ + Salta hacia label si $src1 > $src2. + Operacion sin signo. + """ + pass + + +class BLE(BinaryJumpNode): + """ + Salta hacia label si $src1 <= $src2. + Operacion con signo. + """ + pass + + +class BLEU(BinaryJumpNode): + """ + Salta hacia label si $src1 <= $src2. + Operacion sin signo. + """ + pass + + +class BLT(BinaryJumpNode): + """ + Salta hacia label si $src1 < $src2. + Operacion con signo. + """ + pass + + +class BLTU(BinaryJumpNode): + """ + Salta hacia label si $src1 < $src2. + Operacion sin signo. + """ + pass diff --git a/src/mips/comparison.py b/src/mips/comparison.py new file mode 100644 index 00000000..677238c5 --- /dev/null +++ b/src/mips/comparison.py @@ -0,0 +1,79 @@ +from mips.instruction import ComparisonNode + + +class SEQ(ComparisonNode): + """ + $dest <-- 1 si $src1 = $src2, 0 en otro caso. + """ + pass + + +class SNE(ComparisonNode): + """ + $dest <-- 1 si $src1 != $src2, 0 en otro caso. + """ + pass + + +class SGE(ComparisonNode): + """ + $dest <-- 1 si $src1 >= $src2, 0 en otro caso. + Operacion con signo. + """ + pass + + +class SGEU(ComparisonNode): + """ + $dest <-- 1 si $src1 >= $src2, 0 en otro caso. + Operacion sin signo. + """ + pass + + +class SGT(ComparisonNode): + """ + $dest <-- 1 si $src1 > $src2, 0 en otro caso. + Operacion con signo. + """ + pass + + +class SGTU(ComparisonNode): + """ + $dest <-- 1 si $src1 > $src2, 0 en otro caso. + Operacion sin signo. + """ + pass + + +class SLE(ComparisonNode): + """ + $dest <-- 1 si $src1 <= $src2, 0 en otro caso. + Operacion con signo. + """ + pass + + +class SLEU(ComparisonNode): + """ + $dest <-- 1 si $src1 <= $src2, 0 en otro caso. + Operacion sin signo. + """ + pass + + +class SLT(ComparisonNode): + """ + $dest <-- 1 si $src1 < $src2, 0 en otro caso. + Operacion con signo. + """ + pass + + +class SLTU(ComparisonNode): + """ + $dest <-- 1 si $src1 < $src2, 0 en otro caso. + Operacion sin signo. + """ + pass diff --git a/src/mips/instruction.py b/src/mips/instruction.py new file mode 100644 index 00000000..333f53a8 --- /dev/null +++ b/src/mips/instruction.py @@ -0,0 +1,137 @@ +""" +Este modulo ofrece wrappers a las instrucciones de mips de modo que se puedan +parametrizar y sea facil su uso a la hora de escribir en ensamblador. +""" + +# ********************** REGISTROS ********************************* + +zero = 0 # Siempre almacena la constante 0. +at = 1 # Reservado para el assembler. + +# Registros para almacenar resultados +v0 = 2 +v1 = 3 + +# Registros para almacenar argumentos +a0 = 4 +a1 = 5 +a2 = 6 +a3 = 7 + +# Registros temporales +t0 = 8 +t1 = 9 +t2 = 10 +t3 = 11 +t4 = 12 +t5 = 13 +t6 = 14 +t7 = 15 +t8 = 24 +t9 = 25 + +# Saved Registers +s0 = 16 +s1 = 17 +s2 = 18 +s3 = 19 +s4 = 20 +s5 = 21 +s6 = 22 +s7 = 23 + +# Registros del kernel +k0 = 26 +k1 = 27 + +# Global Data Pointer +gp = 28 + +# Stack Pointer +sp = 29 + +# Frame Pointer +fp = 30 + +# Direccion de retorno +ra = 31 + + +class MipsNode: + pass + + +# ********************** INSTRUCCIONES ARITMETICAS ***************************** +class ArithmeticNode(MipsNode): + def __init__(self, dest: int, src1: int, src2: int, const_src2=False): + self.dest = dest + self.src1 = src1 + self.src2 = src2 + self.action = self.__class__.__name__.lower() + self.const_src2 = const_src2 + if '_' in self.action: + self.action = self.action.replace('_', "") + + def __str__(self): + if self.const_src2: + return f'{self.action} ${self.dest}, ${self.src1}, {self.src2}' + return f'{self.action} ${self.dest}, ${self.src1}, ${self.src2}' + + +class BinaryNode(MipsNode): + def __init__(self, dest: int, src1: int): + self.dest = dest + self.src1 = src1 + self.action = self.__class__.__name__.lower().replace('_', "") + + def __str__(self): + return f'{self.action} ${self.dest}, ${self.src1}' + + +# ************************* INSTRUCCIONES DE COMPARACION ****************** +class ComparisonNode(MipsNode): + def __init__(self, dest: int, src1: int, src2: int, const_src2=False): + self.dest = dest + self.src1 = src1 + self.src2 = src2 + self.action = self.__class__.__name__.lower() + self.const_src2 = const_src2 + + def __str__(self): + if self.const_src2: + return f'{self.action} ${self.dest}, ${self.src1}, {self.src2}' + return f'{self.action} ${self.dest}, ${self.src1}, ${self.src2}' + + +# ************************ INSTRUCCIONES DE SALTO ********************* +class UnconditionalJumpNode(MipsNode): + def __init__(self, label: str): + self.label = label + self.action = self.__class__.__name__.lower() + + def __str__(self): + return f'{self.action} {self.label}' + + +class UnaryJumpNode(MipsNode): + def __init__(self, src1: int, label: str): + self.src1 = src1 + self.label = label + self.action = self.__class__.__name__.lower() + + def __str__(self): + return f'{self.action} ${self.src1}, {self.label}' + + +class BinaryJumpNode(MipsNode): + def __init__(self, src1: int, src2: int, label: str, const_src2=False): + self.src1 = src1 + self.src2 = src2 + self.label = label + self.const_src2 = const_src2 + self.action = self.__class__.__name__.lower() + + def __str__(self): + if self.const_src2: + return f'{self.action} ${self.src1}, {self.src2}, {self.label}' + return f'{self.action} ${self.src1}, ${self.src2}, {self.label}' From 6676bc6622abab29de8b274fe22cfba2bd102c4e Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sun, 31 May 2020 00:07:04 -0400 Subject: [PATCH 049/162] Implemented Branch and Jump MIPS Instructions --- .vscode/settings.json | 3 ++ src/mips/arithmetic.py | 2 +- src/mips/branch.py | 92 ++++++++++++++++++++++++++++++++++++++++- src/mips/instruction.py | 19 +++++++++ src/mips/load_store.py | 0 5 files changed, 114 insertions(+), 2 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 src/mips/load_store.py diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..d2a6c127 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.pythonPath": "/usr/bin/python" +} \ No newline at end of file diff --git a/src/mips/arithmetic.py b/src/mips/arithmetic.py index afe7c26b..85439398 100644 --- a/src/mips/arithmetic.py +++ b/src/mips/arithmetic.py @@ -33,7 +33,7 @@ class DIV(ArithmeticNode): class DIVU(ArithmeticNode): """ - dest = src1 / src2. Sin signo + dest = src1 / src2. Sin signo. """ pass diff --git a/src/mips/branch.py b/src/mips/branch.py index 75413796..a7f929e2 100644 --- a/src/mips/branch.py +++ b/src/mips/branch.py @@ -1,4 +1,4 @@ -from mips.instruction import UnconditionalJumpNode, UnaryJumpNode, BinaryJumpNode +from mips.instruction import UnconditionalJumpNode, UnaryJumpNode, BinaryJumpNode, UnconditionalJumpRegisterNode class B(UnconditionalJumpNode): @@ -8,6 +8,33 @@ class B(UnconditionalJumpNode): pass +class J(UnconditionalJumpNode): + """ + Salta hacia label. + """ + pass + + +class JAL(UnconditionalJumpNode): + """ + Salta hacia label y almacena la direccion de la proxima instruccion en $ra. + """ + pass + + +class JR(UnconditionalJumpRegisterNode): + """ + Salta a la ubicacion apuntada por $src1. + """ + pass + + +class JALR(UnconditionalJumpRegisterNode): + """ + Salta a la ubicacion apuntada por $src1 y almacena la direccion de la proxima instruccion en $ra. + """ + + class BEQ(BinaryJumpNode): """ Salta hacia label si $src1 es identico a $src2. @@ -84,3 +111,66 @@ class BLTU(BinaryJumpNode): Operacion sin signo. """ pass + + +class BEQZ(UnaryJumpNode): + """ + Saltar hacia label si $src1 = 0. + """ + pass + + +class BNEZ(UnaryJumpNode): + """ + Saltar hacia label si $src1 != 0. + """ + pass + + +class BGEZ(UnaryJumpNode): + """ + Saltar hacia label si $src1 >= 0. + """ + pass + + +class BGTZ(UnaryJumpNode): + """ + Saltar hacia label si $src1 > 0. + """ + pass + + +class BLEZ(UnaryJumpNode): + """ + Saltar hacia label si $src1 <= 0. + """ + pass + + +class BLTZ(UnaryJumpNode): + """ + Saltar hacia label si $src1 < 0. + """ + pass + + +class BGEZAL(UnaryJumpNode): + """ + Si $src1 >= 0 entonces pone la direccion de la proxima instruccion en $ra y salta a label. + """ + pass + + +class BGTZAL(UnaryJumpNode): + """ + Si $src1 > 0 entonces pone la direccion de la proxima instruccion en $ra y salta a label. + """ + pass + + +class BLTZAL(UnaryJumpNode): + """ + Si $src1 < 0 entonces pone la direccion de la proxima instruccion en $ra y salta a label. + """ + pass \ No newline at end of file diff --git a/src/mips/instruction.py b/src/mips/instruction.py index 333f53a8..317ef05b 100644 --- a/src/mips/instruction.py +++ b/src/mips/instruction.py @@ -113,6 +113,15 @@ def __str__(self): return f'{self.action} {self.label}' +class UnconditionalJumpRegisterNode(MipsNode): + def __init__(self, src1: int): + self.src1 = src1 + self.action = self.__class__.__name__.lower() + + def __str__(self): + return f'{self.action} ${self.src1}' + + class UnaryJumpNode(MipsNode): def __init__(self, src1: int, label: str): self.src1 = src1 @@ -135,3 +144,13 @@ def __str__(self): if self.const_src2: return f'{self.action} ${self.src1}, {self.src2}, {self.label}' return f'{self.action} ${self.src1}, ${self.src2}, {self.label}' + + +class AbstractLoadNode(MipsNode): + def __init__(self, dest: int, src: int): + self.dest = dest + self.src = src + self.action = self.__class__.__name__.lower() + + def __str__(self): + return f'{self.action} {self.dest}, {self.}' \ No newline at end of file diff --git a/src/mips/load_store.py b/src/mips/load_store.py new file mode 100644 index 00000000..e69de29b From 65841595234d18320ef3696b730169f73bca3e58 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Tue, 2 Jun 2020 22:29:50 -0400 Subject: [PATCH 050/162] More MIPS Instructions --- .vscode/settings.json | 3 +- src/mips/instruction.py | 4 +-- src/mips/load_store.py | 69 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index d2a6c127..525bd2bd 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "python.pythonPath": "/usr/bin/python" + "python.pythonPath": "/bin/python", + "cmake.configureOnOpen": false } \ No newline at end of file diff --git a/src/mips/instruction.py b/src/mips/instruction.py index 317ef05b..a78cfa12 100644 --- a/src/mips/instruction.py +++ b/src/mips/instruction.py @@ -147,10 +147,10 @@ def __str__(self): class AbstractLoadNode(MipsNode): - def __init__(self, dest: int, src: int): + def __init__(self, dest: int, src): self.dest = dest self.src = src self.action = self.__class__.__name__.lower() def __str__(self): - return f'{self.action} {self.dest}, {self.}' \ No newline at end of file + return f'{self.action} {self.dest}, {self.src}' \ No newline at end of file diff --git a/src/mips/load_store.py b/src/mips/load_store.py index e69de29b..c1d99434 100644 --- a/src/mips/load_store.py +++ b/src/mips/load_store.py @@ -0,0 +1,69 @@ +from mips.instruction import AbstractLoadNode + + +class LA(AbstractLoadNode): + """ + Carga la direccion de un label (indicado por src). + """ + pass + + +class LB(AbstractLoadNode): + """ + Carga el byte desde src en $dest. + Operacion con signo. + """ + pass + + +class LBU(AbstractLoadNode): + """ + Carga el byte desde src en $dest. + Operacion sin signo. + """ + pass + + +class LH(AbstractLoadNode): + """ + Carga media palabra (2 bytes) desde src en $dest. + Operacion con signo. + """ + pass + + +class LHU(AbstractLoadNode): + """ + Carga media palabra (2 bytes) desde src en $dest. + Operacion sin signo. + """ + pass + + +class LI(AbstractLoadNode): + """ + Carga la constante src en $dest. + """ + pass + + +class LUI(AbstractLoadNode): + """ + Carga la constante src en los dos bytes superiores de $dest, y setea los 2 bytes inferiores + a 0. + """ + pass + + +class LW(AbstractLoadNode): + """ + Carga los 4 bytes a partir de src en $dest. + """ + pass + + +class ULH(AbstractLoadNode): + """ + Carga 2 bytes empezando en src en $dest + """ + pass \ No newline at end of file From 0d6eb67373380701c9b121d0a7dcaa7d2cb810dd Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Mon, 8 Jun 2020 18:59:23 -0400 Subject: [PATCH 051/162] Added more mips instructions and started CIL to MIPS visitor --- src/mips/baseMipsVisitor.py | 89 +++++++++++++++++++++++++++++++++++++ src/mips/instruction.py | 58 +++++++++++++++++++++++- src/mips/load_store.py | 35 +++++++++++++++ src/travels/ciltomips.py | 29 ++++++++++++ 4 files changed, 210 insertions(+), 1 deletion(-) create mode 100644 src/mips/baseMipsVisitor.py create mode 100644 src/travels/ciltomips.py diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py new file mode 100644 index 00000000..0205088a --- /dev/null +++ b/src/mips/baseMipsVisitor.py @@ -0,0 +1,89 @@ +import mips.instruction as instrNodes +import mips.branch as branchNodes +import mips.comparison as cmpNodes +import mips.arithmetic as arithNodes +import mips.load_store as lsNodes +from typing import List +import time + + +class AbstractDirective(instrNodes.MipsNode): + def __init__(self, addr: str = None): + self.addr = addr + + def __str__(self): + raise NotImplementedError + + +class DotDataDirective(AbstractDirective): + def __str__(self): + return '.data' if self.addr is None else f'.data {self.addr}' + + +class DotTextDirective(AbstractDirective): + def __str__(self): + return '.text' if self.addr is None else f'.text {self.addr}' + + +class DotGlobalDirective(AbstractDirective): + def __str__(self): + assert self.addr is not None + return f'.global {self.addr}' + + +class BaseCilToMipsVisitor: + """ + Clase base para un visitor que transforma un AST de CIL en un AST de MIPS, a partir del cual se obtendra + luego el programa mips que se guardara en el archivo de salida. + + Un programa de mips contiene varias directivas: + + .data + Esta seccion son ensamblados en la seccion de datos del programa. Por defecto, + comienza en la proxima direccion disponible en el segmento de datos. Si el argumento + addr esta presente, entonces comienza en addr. + + .text + Los elementos de esta seccion son ensamblados en el segmento de texto. Por defecto, comienza en la proxima + direccion disponible en el segmento de texto, a menos que el argumento opcional este presente, en cuyo + caso, la proxima direccion es addr. (En SPIM, lo unico que se puede ensamblar en la seccion de texto son + instrucciones y palabras, por medio de la directiva .word). + + .kdata + Es igual a la seccion .data, pero solo es usado por el Sistema Operativo. + + .ktext + Es igual a la seccion .text, pero solo es usado por el Sistema Operativo. + + .extern sym size + Declara el label sym como global y declara que tiene size bytes de longitud (esta informacion es util para + el assembler). + + .globl sym + Declara el label sym como global. + """ + + def __init__(self): + # Un programa de MIPS es una lista de Instrucciones de MIPS. + self.program: List[instrNodes.MipsNode] = [] + + # Construir el header del programa. + self.__program_header() + + # Metodos Publicos + def register_instruction(self, node: instrNodes.MipsNode): + self.program.append(node) + return node + + # Metodos Privados + def __program_header(self): + date = time.asctime() + coolc = 'Code generated by PyCoolc.' + ad = 'Adrian Gonzalez' + ep = 'Eliane Puerta' + la = 'Liset Alfaro' + institution = 'School of Math and Computer Science, University of Havana' + self.register_instruction(instrNodes.LineComment(coolc)) + self.register_instruction(instrNodes.LineComment(f'{ep}, {la}, {ad} --- {date}')) + self.register_instruction(instrNodes.LineComment(institution)) + diff --git a/src/mips/instruction.py b/src/mips/instruction.py index a78cfa12..aefde6b5 100644 --- a/src/mips/instruction.py +++ b/src/mips/instruction.py @@ -146,6 +146,8 @@ def __str__(self): return f'{self.action} ${self.src1}, ${self.src2}, {self.label}' + +# ******************** INSTRUCCIONES PARA ALMACENAR Y CARGAR DATOS EN REGISTROS ************ class AbstractLoadNode(MipsNode): def __init__(self, dest: int, src): self.dest = dest @@ -153,4 +155,58 @@ def __init__(self, dest: int, src): self.action = self.__class__.__name__.lower() def __str__(self): - return f'{self.action} {self.dest}, {self.src}' \ No newline at end of file + return f'{self.action} ${self.dest}, {self.src}' + + +class MOVE(BinaryNode): + """ + Copia el contenido de $src1 en $dest. + """ + pass + + +# ******************** MANEJO DE EXCEPCIONES ************************* +class RFE(MipsNode): + """ + Retorna de una excepcion. + """ + def __str__(self): + return "rfe" + + +class SYSCALL(MipsNode): + """ + Realiza una llamada a sistema. + """ + def __str__(self): + return "syscall" + + +class BREAK(MipsNode): + """ + Usado por el debugger. + """ + def __init__(self, const: int): + self.const = const + + def __str__(self): + return f'break {self.const}' + + +class NOP(MipsNode): + """ + Instruccion que no hace nada, salvo consumir un ciclo del reloj. + """ + def __str__(self): + return "nop" + + +class LineComment(MipsNode): + """ + Representa un comentario en una linea + """ + def __init__(self, string: str): + self.text = string + + def __str__(self): + return f'# {self.text}' \ No newline at end of file diff --git a/src/mips/load_store.py b/src/mips/load_store.py index c1d99434..78e9d863 100644 --- a/src/mips/load_store.py +++ b/src/mips/load_store.py @@ -66,4 +66,39 @@ class ULH(AbstractLoadNode): """ Carga 2 bytes empezando en src en $dest """ + pass + + +class SB(AbstractLoadNode): + """ + Almacena el primer byte del registro $dest en addr. + """ + pass + + +class SH(AbstractLoadNode): + """ + Almacena los primeros dos bytes del registro $dest en addr. + """ + pass + + +class SW(AbstractLoadNode): + """ + Almacena los 4 bytes del registro $dest en addr. + """ + pass + + +class SWL(AbstractLoadNode): + """ + Almacena los ultimos dos bytes del registro $dest en addr (esta direccion esta probablemente desalineada). + """ + pass + + +class USW(AbstractLoadNode): + """ + Almacena los 4 bytes del registro $dest en addr (esta direccion esta probablemente desalineada). + """ pass \ No newline at end of file diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py new file mode 100644 index 00000000..4d85de78 --- /dev/null +++ b/src/travels/ciltomips.py @@ -0,0 +1,29 @@ +from mips.baseMipsVisitor import (BaseCilToMipsVisitor, DotDataDirective, + DotGlobalDirective, DotTextDirective, + instrNodes, arithNodes, cmpNodes, + branchNodes, lsNodes) +import typecheck.visitor as visitor +import cil.nodes as cil + + +class CilToMipsVisitor(BaseCilToMipsVisitor): + @visitor.on('node') + def visit(self, node): + pass + + @visitor.when(cil.CilProgramNode) + def visit(self, node: cil.CilProgramNode): + # El programa de CIL se compone por las 3 secciones + # .TYPES, .DATA y .CODE + + # Visitar cada nodo de la seccion .TYPES + for type_node in node.dottypes: + self.visit(type_node) + + # Visitar cada nodo de la seccion .DATA + for data_node in node.dotdata: + self.visit(data_node) + + # Visitar cada nodo de la seccion .CODE + for code_node in node.dotcode: + self.visit(code_node) \ No newline at end of file From 4effc9c4a1b85a791659b08d45a1cdd059384841 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Mon, 22 Jun 2020 14:59:24 -0400 Subject: [PATCH 052/162] Checkpoint --- src/mips/baseMipsVisitor.py | 8 ++++++-- src/mips/instruction.py | 13 ++++++++++++- src/travels/ciltomips.py | 22 +++++++++++++++++++--- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 0205088a..046d187f 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -3,8 +3,9 @@ import mips.comparison as cmpNodes import mips.arithmetic as arithNodes import mips.load_store as lsNodes -from typing import List +from typing import List, Optional import time +import cil.nodes as cil class AbstractDirective(instrNodes.MipsNode): @@ -12,7 +13,7 @@ def __init__(self, addr: str = None): self.addr = addr def __str__(self): - raise NotImplementedError + raise NotImplementedError() class DotDataDirective(AbstractDirective): @@ -66,6 +67,9 @@ class BaseCilToMipsVisitor: def __init__(self): # Un programa de MIPS es una lista de Instrucciones de MIPS. self.program: List[instrNodes.MipsNode] = [] + # Necesitamos saber si estamos construyendo un tipo, para poder acceder + # a nombres de funciones, atributos, etc. + self.current_type: Optional[cil.TypeNode] = None # Construir el header del programa. self.__program_header() diff --git a/src/mips/instruction.py b/src/mips/instruction.py index aefde6b5..f4734686 100644 --- a/src/mips/instruction.py +++ b/src/mips/instruction.py @@ -209,4 +209,15 @@ def __init__(self, string: str): self.text = string def __str__(self): - return f'# {self.text}' \ No newline at end of file + return f'# {self.text}' + + +class Label(MipsNode): + """ + Representa un label. (almacena una direccion de memoria a la cual se puede referenciar) + """ + def __init__(self, label: str): + self.label = label + + def __str__(self): + return f"{self.label}: " \ No newline at end of file diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 4d85de78..20add848 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -11,8 +11,8 @@ class CilToMipsVisitor(BaseCilToMipsVisitor): def visit(self, node): pass - @visitor.when(cil.CilProgramNode) - def visit(self, node: cil.CilProgramNode): + @visitor.when(cil.CilProgramNode) # type: ignore + def visit(self, node: cil.CilProgramNode): # noqa: F811 # El programa de CIL se compone por las 3 secciones # .TYPES, .DATA y .CODE @@ -26,4 +26,20 @@ def visit(self, node: cil.CilProgramNode): # Visitar cada nodo de la seccion .CODE for code_node in node.dotcode: - self.visit(code_node) \ No newline at end of file + self.visit(code_node) + + # registrar instrucciones para terminar la ejecucion + self.register_instruction(instrNodes.LineComment("syscall code 10 is for exit")) + self.register_instruction(lsNodes.LI(instrNodes.v0, 10)) + self.register_instruction(instrNodes.SYSCALL()) + + @visitor.when(cil.TypeNode) # type: ignore + def visit(self, node: cil.TypeNode): # noqa: F811 + # registrar el tipo actual que estamos construyendo + self.current_type = node + + # Los tipos los definiremos en la seccion .data + self.register_instruction(DotDataDirective()) + # Declarar la direccion de memoria donde comienza el tipo + self.register_instruction(instrNodes.Label(self.current_type.name)) + # From 1ec28e1e0c0781490eeada8e0955d81734f1c28c Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Wed, 24 Jun 2020 12:40:06 -0400 Subject: [PATCH 053/162] Implemented VTABLES & TYPE RECORDS --- .vscode/settings.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 525bd2bd..25b7a441 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,6 @@ { "python.pythonPath": "/bin/python", - "cmake.configureOnOpen": false + "cmake.configureOnOpen": false, + "python.linting.enabled": true, + "python.linting.mypyEnabled": true } \ No newline at end of file From 4a4463ba2d7b25ac501278df2a3fda34d3724429 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Wed, 24 Jun 2020 12:40:40 -0400 Subject: [PATCH 054/162] Checkpoint on MIPS Types --- src/cil/nodes.py | 4 +++- src/mips/instruction.py | 17 ++++++++++++++++- src/travels/ciltomips.py | 37 ++++++++++++++++++++++++++++++++++++- src/travels/ctcill.py | 4 ++-- 4 files changed, 57 insertions(+), 5 deletions(-) diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 00cbc1a9..47e7aeaa 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -1,3 +1,5 @@ +from typing import List +from abstract.semantics import Attribute """ Define a hierachy to represent each CIL instruction. Every CIL Instruction would be a Node of an AST, and every\ @@ -19,7 +21,7 @@ def __init__(self, dottypes, dotdata, dotcode): class TypeNode(CilNode): def __init__(self, name): self.name = name - self.attributes = [] + self.attributes: List[Attribute] = [] self.methods = [] diff --git a/src/mips/instruction.py b/src/mips/instruction.py index f4734686..f4322ad9 100644 --- a/src/mips/instruction.py +++ b/src/mips/instruction.py @@ -220,4 +220,19 @@ def __init__(self, label: str): self.label = label def __str__(self): - return f"{self.label}: " \ No newline at end of file + return f"{self.label}: " + +class FixedData(MipsNode): + """ + Representa un dato en la seccion .data. + Por ejemplo: + msg: .asciiz "Hello World!\n" + """ + def __init__(self, name: str, value, type_="word"): + assert type_ in ("word", "asciiz", "byte", "space") + self.name = name + self.value = value + self.type = type_ + + def __str__(self): + return f"{self.name}: .{self.type} {self.value}" \ No newline at end of file diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 20add848..b55ecc15 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -4,6 +4,7 @@ branchNodes, lsNodes) import typecheck.visitor as visitor import cil.nodes as cil +from typing import List class CilToMipsVisitor(BaseCilToMipsVisitor): @@ -40,6 +41,40 @@ def visit(self, node: cil.TypeNode): # noqa: F811 # Los tipos los definiremos en la seccion .data self.register_instruction(DotDataDirective()) + + # Construir la VTABLE para este tipo. + self.register_instruction(instrNodes.LineComment(f" **** VTABLE for type {node.name} ****")) + + # Los punteros a funciones estaran definidos en el orden en que aparecen declaradas en las clases + # de modo que la VTABLE sea indexable y podamos efectuar VCALL en O(1). + self.register_instruction(instrNodes.FixedData(f'{node.name}_vtable', ", ".join(x[1] for x in node.methods))) + + self.register_instruction((instrNodes.LineComment(f" **** Type RECORD for type {node.name} ****"))) # Declarar la direccion de memoria donde comienza el tipo self.register_instruction(instrNodes.Label(self.current_type.name)) - # + # Declarar los atributos: Si los atributos son de tipo string, guardarlos como asciiz + # de lo contrario son o numeros o punteros y se inicializan como .words + for attrib in self.current_type.attributes: + if attrib.name == "String": + self.register_instruction(instrNodes.FixedData(f'{node.name}_attrib_{attrib.name}', r"", 'asciiz')) + else: + self.register_instruction(instrNodes.FixedData(f'{node.name}_attrib_{attrib.name}', 0)) + + # Registrar un puntero a la VTABLE del tipo. + self.register_instruction(instrNodes.FixedData(f'{node.name}_vtable_pointer', f"{node.name}_vtable")) + # Registrar la direccion de memoria donde termina el tipo para calcular facilmente + # sizeof + self.register_instruction(instrNodes.Label(f"{node.name}_end")) + + +class MipsCodeGenerator(CilToMipsVisitor): + """ + Clase que complete el pipeline entre un programa en CIL y un programa en MIPS. + El Generador visita el AST del programa en CIL para obtener el conjunto de nodos + correspondientes a cada instruccion de MIPS y luego devuelve una version en texto + plano del AST de MIPS, la cual se puede escribir a un archivo de salida y debe estar + lista para ejecutarse en SPIM. + """ + def __call__(self, ast: cil.CilProgramNode) -> str: + self.visit(ast) + return "".join(str(x) for x in self.program) \ No newline at end of file diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 31906298..42ae48b4 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -56,7 +56,7 @@ def visit(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 # Handle inherited features such as attributes and methods first if self.current_type.parent is not None: for attribute in self.current_type.parent.attributes: - new_type_node.attributes.append(attribute.name) + new_type_node.attributes.append(attribute) for method in self.current_type.parent.methods.keys(): # Handle methods overload @@ -73,7 +73,7 @@ def visit(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 # } # ##################################################################### for attribute in attributes: - new_type_node.attributes.append(attribute.idx) + new_type_node.attributes.append(attribute) for method in methods: new_type_node.methods.append((method, self.to_function_name(method, node.idx))) From cfdb3de8b7715a603813e5d3c34e6edbb98037fa Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Wed, 24 Jun 2020 18:46:47 -0400 Subject: [PATCH 055/162] Implemented DataNodes --- src/cil/baseCilVisitor.py | 17 +---------------- src/travels/ciltomips.py | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 428e97b8..4bed4c69 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -185,22 +185,7 @@ def __build_CART(self) -> None: self.tdt_table = graph.tdt # Procesar la TDT para hacerla accesible en runtime. - # La tabla nos es mas que una matriz de NxN (N es la cantidad de tipos definidos en el programa) - # donde cada subindice indica el indice del Tipo en la seccion .Types: - # m[i, j] = d significa que la distancia entre el tipo en el indice i de la seccion .Types y el tipo - # en el indice j es d. - # Tener en cuenta que los tipos son definidos en la seccion .TYPES en el orden en que son definidos en - # el programa, y recolectados por el TypeBuilder. - table = [[-1 for _ in self.context.types] for _ in self.context.types] - self.types_indexes: Dict[str, int] = {} - for i, itype in enumerate(self.context.types): - self.types_indexes[itype] = i - for j, atype in enumerate(self.context.types): - try: - table[i][j] = self.tdt_table[itype, atype] - except KeyError: - table[i][j] = -1 - self.tdt_data_node = self.register_data(table) + self.tdt_data_node = self.register_data(self.tdt_table) def __build_builtins(self): pass diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index b55ecc15..69bc33cb 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -65,7 +65,25 @@ def visit(self, node: cil.TypeNode): # noqa: F811 # Registrar la direccion de memoria donde termina el tipo para calcular facilmente # sizeof self.register_instruction(instrNodes.Label(f"{node.name}_end")) - + + self.current_type = None + + @visitor.when(cil.DataNode) #type: ignore + def visit(self, node: cil.DataNode): + # Registrar los DataNode en la seccion .data + self.register_instruction(DotDataDirective()) + if isinstance(node.value, str): + self.register_instruction(instrNodes.FixedData(node.name, rf"{node.value}", type_='asciiz')) + elif isinstance(node.value, dict): + # Lo unico que puede ser un diccionario es la TDT. Me parece..... mehh !!?? + # La TDT se contiene para cada par (typo1, tipo2), la distancia entre tipo1 y tipo2 + # en caso de que tipo1 sea ancestro de tipo2, -1 en otro caso. Para hacerla accesible en O(1) + # podemos representarlas como la concatenacion de los nombres de tipo1 y tipo2 (Al final en cada) + # programa los tipos son unicos. + for (type1, type2), distance in node.value.items(): + self.register_instruction(instrNodes.FixedData(f"__{type1}_{type2}_tdt_entry__", distance)) + + class MipsCodeGenerator(CilToMipsVisitor): """ From 74def887a97e7450b299e2ad20abb00f8c3135fd Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Wed, 24 Jun 2020 23:14:34 -0400 Subject: [PATCH 056/162] Implemented FunctionNode --- src/travels/ciltomips.py | 52 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 69bc33cb..e22f7ed9 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -5,6 +5,12 @@ import typecheck.visitor as visitor import cil.nodes as cil from typing import List +from mips.instruction import ( + a0, a1, a2, a3, at, + t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, + s0, s1, s2, s3, s4, s5, s6, s7, sp, + ra, fp, k0, k1, gp, v0, v1, zero +) class CilToMipsVisitor(BaseCilToMipsVisitor): @@ -31,7 +37,7 @@ def visit(self, node: cil.CilProgramNode): # noqa: F811 # registrar instrucciones para terminar la ejecucion self.register_instruction(instrNodes.LineComment("syscall code 10 is for exit")) - self.register_instruction(lsNodes.LI(instrNodes.v0, 10)) + self.register_instruction(lsNodes.LI(v0, 10)) self.register_instruction(instrNodes.SYSCALL()) @visitor.when(cil.TypeNode) # type: ignore @@ -76,13 +82,49 @@ def visit(self, node: cil.DataNode): self.register_instruction(instrNodes.FixedData(node.name, rf"{node.value}", type_='asciiz')) elif isinstance(node.value, dict): # Lo unico que puede ser un diccionario es la TDT. Me parece..... mehh !!?? - # La TDT se contiene para cada par (typo1, tipo2), la distancia entre tipo1 y tipo2 + # La TDT contiene para cada par (typo1, tipo2), la distancia entre tipo1 y tipo2 # en caso de que tipo1 sea ancestro de tipo2, -1 en otro caso. Para hacerla accesible en O(1) - # podemos representarlas como la concatenacion de los nombres de tipo1 y tipo2 (Al final en cada) - # programa los tipos son unicos. + # podemos representarlas como la concatenacion de los nombres de tipo1 y tipo2 (Al final en cada + # programa los tipos son unicos). for (type1, type2), distance in node.value.items(): self.register_instruction(instrNodes.FixedData(f"__{type1}_{type2}_tdt_entry__", distance)) - + elif isinstance(node.value, int): + self.register_instruction(instrNodes.FixedData(node.name, node.value)) + + @visitor.when(cil.FunctionNode) # type: ignore + def visit(self, node: cil.FunctionNode): + ret = 0 + # El codigo referente a cada funcion debe ir en la seccion de texto. + self.register_instruction(DotTextDirective()) + # Documentar la signatura de la funcion (parametros que recibe, valor que devuelve) + self.register_instruction(instrNodes.LineComment(f"{node.name} implementation.")) + self.register_instruction(instrNodes.LineComment("@Params:")) + for i, param in enumerate(node.params): + if i < 4: + self.register_instruction(instrNodes.LineComment(f"\t$a{i} = {param}")) + else: + self.register_instruction(instrNodes.LineComment(f"\t{(i-4) * 4}($fp) = {param}")) + # Direccion de memoria de la funcion. + self.register_instruction(instrNodes.Label(node.name)) + # Crear el marco de pila para la funcion + locals_count = len(node.localvars) + self.register_instruction(instrNodes.LineComment("Allocate stack frame for function.")) + # Salvar primero espacio para las variables locales + if locals_count * 4 < 24: # MIPS fuerza a un minimo de 32 bytes por stack frame + self.register_instruction(arithNodes.SUBU(sp, sp, 32, True)) + ret = 32 + else: + self.register_instruction(arithNodes.SUBU(sp, sp, locals_count * 4 + 8, True)) + ret = locals_count * 4 + 8 + + # Salvar ra y fp + self.register_instruction(lsNodes.SW(ra, "8($sp)")) + self.register_instruction(lsNodes.SW(fp, "4($sp)")) + # mover fp al inicio del frame + self.register_instruction(arithNodes.ADDU(fp, sp, ret, True)) + + for instruction in node.instructions: + self.visit(instruction) class MipsCodeGenerator(CilToMipsVisitor): From cebaf8123c7c3f86c0b381e688c9d5791420c49a Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 25 Jun 2020 01:02:26 -0400 Subject: [PATCH 057/162] Implemented labels and added current function to MIPS visitor --- src/mips/baseMipsVisitor.py | 4 ++++ src/travels/ciltomips.py | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 046d187f..da14097d 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -71,6 +71,10 @@ def __init__(self): # a nombres de funciones, atributos, etc. self.current_type: Optional[cil.TypeNode] = None + # Necesitamos acceso a las variables locales y parametros de la funcion que estamos + # construyendo + self.current_function: Optional[cil.FunctionNode] = None + # Construir el header del programa. self.__program_header() diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index e22f7ed9..cf43575c 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -94,6 +94,7 @@ def visit(self, node: cil.DataNode): @visitor.when(cil.FunctionNode) # type: ignore def visit(self, node: cil.FunctionNode): ret = 0 + self.current_function = node # El codigo referente a cada funcion debe ir en la seccion de texto. self.register_instruction(DotTextDirective()) # Documentar la signatura de la funcion (parametros que recibe, valor que devuelve) @@ -125,6 +126,12 @@ def visit(self, node: cil.FunctionNode): for instruction in node.instructions: self.visit(instruction) + + self.current_function = None + + @visitor.when(cil.LabelNode) #type: ignore + def visit(self, node: cil.LabelNode): + self.register_instruction(instrNodes.Label(node.label)) class MipsCodeGenerator(CilToMipsVisitor): From dae119cf4e75b9738b593bf0d67d17bf010246a1 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 25 Jun 2020 14:10:11 -0400 Subject: [PATCH 058/162] Fixed return values for visitor in ctcill.py --- src/cil/baseCilVisitor.py | 6 ++--- src/travels/ciltomips.py | 4 ++++ src/travels/ctcill.py | 48 +++++++++++++++++---------------------- 3 files changed, 28 insertions(+), 30 deletions(-) diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 4bed4c69..9089483e 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -127,14 +127,14 @@ def register_params(self, vinfo: VariableInfo) -> str: self.params.append(param_node) return name - def register_local(self, vinfo: VariableInfo) -> str: + def register_local(self, vinfo: VariableInfo) -> nodes.LocalNode: assert self.current_function is not None name = f'local_{self.current_function.name[9:]}_{vinfo.name}_{len(self.localvars)}' local_node = nodes.LocalNode(name) self.localvars.append(local_node) - return name + return local_node - def define_internal_local(self) -> str: + def define_internal_local(self) -> nodes.LocalNode: vinfo = VariableInfo('internal') return self.register_local(vinfo) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index cf43575c..bbfaa1ba 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -133,6 +133,10 @@ def visit(self, node: cil.FunctionNode): def visit(self, node: cil.LabelNode): self.register_instruction(instrNodes.Label(node.label)) + @visitor.when(cil.AllocateNode) #type: ignore + def visit(self, node: cil.AllocateNode): + pass + class MipsCodeGenerator(CilToMipsVisitor): """ diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 42ae48b4..01ff56f4 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -173,7 +173,7 @@ def visit(self, node: coolAst.VariableCall, scope: Scope): # noqa: F811 if vinfo.location == "PARAM": for param_node in self.params: if vinfo.name in param_node.name: - return param_node.name + return param_node if vinfo.location == "ATTRIBUTE": local = self.define_internal_local() self.register_instruction(cil.GetAttributeNode(self.current_type.name, vinfo.name, local)) @@ -181,7 +181,7 @@ def visit(self, node: coolAst.VariableCall, scope: Scope): # noqa: F811 if vinfo.location == "LOCAL": for local_node in self.localvars: if vinfo.name in local_node.name: - return local_node.name + return local_node @visitor.when(coolAst.InstantiateClassNode) # type: ignore def visit(self, node: coolAst.InstantiateClassNode, scope: Scope): # noqa: F811 @@ -384,14 +384,8 @@ def visit(self, node: coolAst.DivNode, scope: Scope): # noqa: F811 @visitor.when(coolAst.IntegerConstant) # type: ignore def visit(self, node: coolAst.IntegerConstant, scope: Scope): # noqa: F811 - # Variable interna que guarda el valor de la constante - int_const_vm_holder = self.define_internal_local() - - # Asignarle el valor a la variable - self.register_instruction(cil.AssignNode(int_const_vm_holder, int(node.lex))) - # devolver el valor - return int_const_vm_holder + return int(node.lex) @visitor.when(coolAst.StringConstant) # type: ignore def visit(self, node: coolAst.StringConstant, scope: Scope): # noqa: F811 @@ -410,15 +404,11 @@ def visit(self, node: coolAst.StringConstant, scope: Scope): # noqa: F811 @visitor.when(coolAst.TrueConstant) # type: ignore def visit(self, node: coolAst.TrueConstant, scope: Scope): # noqa: F811 # variable interna que devuelve el valor de la constante - true_const_vm_holder = self.define_internal_local() - self.register_instruction(cil.AssignNode(true_const_vm_holder), 1) - return true_const_vm_holder + return 1 @visitor.when(coolAst.FalseConstant) # type: ignore def visit(self, node: coolAst.FalseConstant, scope: Scope): # noqa: F811 - false_const_vm_holder = self.define_internal_local() - self.register_instruction(cil.AssignNode(false_const_vm_holder), 0) - return false_const_vm_holder + return 0 # ******************* Implementacion de las comparaciones ******************** # Todas las operaciones de comparacion devuelven 1 si el resultado es verdadero, @@ -449,7 +439,7 @@ def visit(self, node: coolAst.EqualToNode, scope: Scope): # noqa: F811 # Si la resta da 0, devolver 1 self.register_instruction(cil.LabelNode(true_label)) - self.register_instruction(cil.AssignNode(expr_result_vm_holder, 1)) + expr_result_vm_holder = 1 self.register_instruction(cil.LabelNode(end_label)) @@ -648,39 +638,39 @@ def visit(self, node: cil.LocalNode): # noqa: F811 @visitor.when(cil.AssignNode) # type: ignore def visit(self, node: cil.AssignNode): # noqa: F811 - return f'{node.dest} = {node.source}' + return f'{self.visit(node.dest)} = {self.visit(node.source)}' @visitor.when(cil.PlusNode) # type: ignore def visit(self, node: cil.PlusNode): # noqa: F811 - return f'{node.dest} = {node.left} + {node.right}' + return f'{self.visit(node.dest)} = {self.visit(node.left)} + {self.visit(node.right)}' @visitor.when(cil.MinusNode) # type: ignore def visit(self, node: cil.MinusNode): # noqa: F811 - return f'{node.dest} = {node.x} - {node.y}' + return f'{self.visit(node.dest)} = {self.visit(node.x)} - {self.visit(node.y)}' @visitor.when(cil.StarNode) # type: ignore def visit(self, node: cil.StarNode): # noqa: F811 - return f'{node.dest} = {node.x} * {node.y}' + return f'{self.visit(node.dest)} = {self.visit(node.x)} * {self.visit(node.y)}' @visitor.when(cil.DivNode) # type: ignore def visit(self, node: cil.DivNode): # noqa: F811 - return f'{node.dest} = {node.left} / {node.right}' + return f'{self.visit(node.dest)} = {self.visit(node.left)} / {self.visit(node.right)}' @visitor.when(cil.AllocateNode) # type: ignore def visit(self, node: cil.AllocateNode): # noqa: F811 - return f'{node.dest} = ALLOCATE {node.itype}' + return f'{self.visit(node.dest)} = ALLOCATE {node.itype}' @visitor.when(cil.TypeOfNode) # type: ignore def visit(self, node: cil.TypeOfNode): # noqa: F811 - return f'{node.dest} = TYPEOF {node.variable}' + return f'{self.visit(node.dest)} = TYPEOF {node.variable}' @visitor.when(cil.DynamicCallNode) # type: ignore def visit(self, node: cil.DynamicCallNode): # noqa: F811 - return f'{node.dest} = VCALL {node.xtype} {node.method}' + return f'{self.visit(node.dest)} = VCALL {node.xtype} {node.method}' @visitor.when(cil.StaticCallNode) # type: ignore def visit(self, node: cil.StaticCallNode): # noqa: F811 - return f'{node.dest} = CALL {node.function}' + return f'{self.visit(node.dest)} = CALL {node.function}' @visitor.when(cil.ArgNode) # type: ignore def visit(self, node: cil.ArgNode): # noqa: F811 @@ -702,11 +692,11 @@ def visit(self, node: cil.DataNode): # noqa: F811 @visitor.when(cil.GetTypeIndex) # type: ignore def visit(self, node: cil.GetTypeIndex): # noqa: F811 - return f'{node.dest} = GETTYPEINDEX {node.itype}' + return f'{self.visit(node.dest)} = GETTYPEINDEX {node.itype}' @visitor.when(cil.TdtLookupNode) # type: ignore def visit(self, node: cil.TdtLookupNode): # noqa: F811 - return f'{node.dest} = TYPE_DISTANCE {node.i} {node.j}' + return f'{self.visit(node.dest)} = TYPE_DISTANCE {node.i} {node.j}' @visitor.when(cil.IfZeroJump) # type: ignore def visit(self, node: cil.IfZeroJump): # noqa: F811 @@ -724,5 +714,9 @@ def visit(self, node: cil.JumpIfGreaterThanZeroNode): # noqa: F811 def visit(self, node: cil.LabelNode): # noqa: F811 return f'{node.label}:' + @visitor.when(int) #type: ignore + def visit(self, node: int): + return str(node) + def __call__(self, node): return self.visit(node) From d88effec9cc19c6201b8605650d726a4d60a9657 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 25 Jun 2020 14:28:30 -0400 Subject: [PATCH 059/162] Implemented ParamNode --- src/cil/baseCilVisitor.py | 4 ++-- src/cil/nodes.py | 2 +- src/mips/baseMipsVisitor.py | 6 ++++++ src/travels/ciltomips.py | 24 ++++++++++++++++++++++++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 9089483e..a71d3d95 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -119,13 +119,13 @@ def instructions(self) -> List[nodes.InstructionNode]: assert self.current_function is not None return self.current_function.instructions - def register_params(self, vinfo: VariableInfo) -> str: + def register_params(self, vinfo: VariableInfo) -> nodes.ParamNode: # Registra un parametro en la funcion en construccion y devuelve el nombre procesado del parametro assert self.current_function is not None name = f'param_{self.current_function.name[9:]}_{vinfo.name}_{len(self.params)}' param_node: nodes.ParamNode = nodes.ParamNode(name) self.params.append(param_node) - return name + return param_node def register_local(self, vinfo: VariableInfo) -> nodes.LocalNode: assert self.current_function is not None diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 47e7aeaa..87d738c8 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -34,7 +34,7 @@ def __init__(self, vname, value): class FunctionNode(CilNode): def __init__(self, fname, params, lvars, instr): self.name = fname - self.params = params + self.params: List[ParamNode] = params self.localvars = lvars self.instructions = instr diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index da14097d..fddad9b4 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -75,6 +75,12 @@ def __init__(self): # construyendo self.current_function: Optional[cil.FunctionNode] = None + # Llevar un record de los registros que hemos utilizado en la funcion actual + # Cada funcion es libre de usar los registros t0 -- t9 (temporales, estos registros) + # no guardan valores de retornos ni son utilizados como confiables, solo se usan para + # almacenar valores intermedios y valores de variables, para evitar accesos a memoria. + self.used_registers = [False] * 32 + # Construir el header del programa. self.__program_header() diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index bbfaa1ba..57d6e33a 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -12,6 +12,7 @@ ra, fp, k0, k1, gp, v0, v1, zero ) +TEMP_REGISTERS = (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) class CilToMipsVisitor(BaseCilToMipsVisitor): @visitor.on('node') @@ -133,6 +134,29 @@ def visit(self, node: cil.FunctionNode): def visit(self, node: cil.LabelNode): self.register_instruction(instrNodes.Label(node.label)) + @visitor.when(cil.ParamNode) #type: ignore + def visit(self, node: cil.ParamNode): + # Este nodo solo tiene sentido en el contexto de una funcion. + assert self.current_function is not None + index = -1 + # Buscar el indice del parametro al que corresponde + for i, param in enumerate(self.current_function.params): + if param.name == node.name: + index = i + + assert index > -1 + # Buscar un registro que no haya sido utilizado, mover el parametro a ese registro + # y devolver el registro + for register in TEMP_REGISTERS: + if not self.used_registers[register]: + self.used_registers[register] = True + self.register_instruction(lsNodes.SW(register, f"{index * 4}($fp)")) + return register + + # Si todos los registros estan utilizados entonces devolver simplemente la direccion de + # memoria del parametro + return f"{index * 4}($fp)" + @visitor.when(cil.AllocateNode) #type: ignore def visit(self, node: cil.AllocateNode): pass From 8b9973e1a461d143c5022cbfb8b0991f0c813ef1 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 25 Jun 2020 14:52:18 -0400 Subject: [PATCH 060/162] Added support function get_location_address --- src/mips/baseMipsVisitor.py | 26 ++++++++++++++++++++++++- src/mips/instruction.py | 2 ++ src/travels/ciltomips.py | 39 ++++++++++++++++++++++++------------- 3 files changed, 52 insertions(+), 15 deletions(-) diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index fddad9b4..678c7848 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -3,7 +3,7 @@ import mips.comparison as cmpNodes import mips.arithmetic as arithNodes import mips.load_store as lsNodes -from typing import List, Optional +from typing import List, Optional, Union import time import cil.nodes as cil @@ -101,3 +101,27 @@ def __program_header(self): self.register_instruction(instrNodes.LineComment(f'{ep}, {la}, {ad} --- {date}')) self.register_instruction(instrNodes.LineComment(institution)) + # Funcion de ayuda para obtener la direccion de memoria de un parametro o una variable + def get_location_address(self, node: Union[cil.ParamNode, cil.LocalNode]) -> str: + assert self.current_function is not None + index = -1 + if isinstance(node, cil.ParamNode): + # Buscar el indice del parametro al que corresponde + for i, param in enumerate(self.current_function.params): + if param.name == node.name: + index = i + break + + assert index > -1 + + return f"{index * 4}($fp)" + else: + # Buscar el indice de la variable local + for i, local_var in enumerate(self.current_function.localvars): + if local_var.name == node.name: + index = i + break + + assert index > -1 + index += 1 + return f"-{index * 4}($fp)" diff --git a/src/mips/instruction.py b/src/mips/instruction.py index f4322ad9..c16c7141 100644 --- a/src/mips/instruction.py +++ b/src/mips/instruction.py @@ -56,6 +56,8 @@ # Direccion de retorno ra = 31 +TEMP_REGISTERS = (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) + class MipsNode: pass diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 57d6e33a..2080ba91 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -9,11 +9,10 @@ a0, a1, a2, a3, at, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, s0, s1, s2, s3, s4, s5, s6, s7, sp, - ra, fp, k0, k1, gp, v0, v1, zero + ra, fp, k0, k1, gp, v0, v1, zero, + TEMP_REGISTERS ) -TEMP_REGISTERS = (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) - class CilToMipsVisitor(BaseCilToMipsVisitor): @visitor.on('node') def visit(self, node): @@ -136,26 +135,38 @@ def visit(self, node: cil.LabelNode): @visitor.when(cil.ParamNode) #type: ignore def visit(self, node: cil.ParamNode): - # Este nodo solo tiene sentido en el contexto de una funcion. - assert self.current_function is not None - index = -1 - # Buscar el indice del parametro al que corresponde - for i, param in enumerate(self.current_function.params): - if param.name == node.name: - index = i - - assert index > -1 + address = self.get_location_address(node) # Buscar un registro que no haya sido utilizado, mover el parametro a ese registro # y devolver el registro for register in TEMP_REGISTERS: if not self.used_registers[register]: self.used_registers[register] = True - self.register_instruction(lsNodes.SW(register, f"{index * 4}($fp)")) + self.register_instruction(lsNodes.SW(register, address)) return register # Si todos los registros estan utilizados entonces devolver simplemente la direccion de # memoria del parametro - return f"{index * 4}($fp)" + return address + + @visitor.when(cil.LocalNode) #type: ignore + def visit(self, node: cil.LocalNode): + address = self.get_location_address(node) + # Buscar un registro que no haya sido utilizado, mover la variable local + # a ese registro y devolver el registro + for register in TEMP_REGISTERS: + if not self.used_registers[register]: + self.used_registers[register] = True + self.register_instruction(lsNodes.SW(register, address)) + return register + + # Si todos los registros estan utilizados entonces devolver la direccion de memoria + # de la variable + return address + + @visitor.when(cil.AssignNode) #type: ignore + def visit(self, node: cil.AssignNode): + assert self.current_function is not None + # Una asignacion simplemente conciste en mover un resultado de un lugar a otro @visitor.when(cil.AllocateNode) #type: ignore def visit(self, node: cil.AllocateNode): From e52a160eb96b32df3c3f3d3e8b136d932f576f90 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 25 Jun 2020 16:03:58 -0400 Subject: [PATCH 061/162] Implemented Arithmetic Operations --- .vscode/settings.json | 2 +- src/mips/baseMipsVisitor.py | 7 ++ src/travels/ciltomips.py | 183 +++++++++++++++++++++++++++++++----- 3 files changed, 166 insertions(+), 26 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 25b7a441..2752b3e9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,6 @@ { "python.pythonPath": "/bin/python", "cmake.configureOnOpen": false, - "python.linting.enabled": true, + "python.linting.enabled": false, "python.linting.mypyEnabled": true } \ No newline at end of file diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 678c7848..1ca335f7 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -125,3 +125,10 @@ def get_location_address(self, node: Union[cil.ParamNode, cil.LocalNode]) -> str assert index > -1 index += 1 return f"-{index * 4}($fp)" + + def get_available_register(self): + for register in instrNodes.TEMP_REGISTERS: + if not self.used_registers[register]: + self.used_registers[register] = True + return register + return None diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 2080ba91..1f48483f 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -135,38 +135,171 @@ def visit(self, node: cil.LabelNode): @visitor.when(cil.ParamNode) #type: ignore def visit(self, node: cil.ParamNode): - address = self.get_location_address(node) - # Buscar un registro que no haya sido utilizado, mover el parametro a ese registro - # y devolver el registro - for register in TEMP_REGISTERS: - if not self.used_registers[register]: - self.used_registers[register] = True - self.register_instruction(lsNodes.SW(register, address)) - return register - - # Si todos los registros estan utilizados entonces devolver simplemente la direccion de - # memoria del parametro - return address + return self.get_location_address(node) @visitor.when(cil.LocalNode) #type: ignore def visit(self, node: cil.LocalNode): - address = self.get_location_address(node) - # Buscar un registro que no haya sido utilizado, mover la variable local - # a ese registro y devolver el registro - for register in TEMP_REGISTERS: - if not self.used_registers[register]: - self.used_registers[register] = True - self.register_instruction(lsNodes.SW(register, address)) - return register - - # Si todos los registros estan utilizados entonces devolver la direccion de memoria - # de la variable - return address + return self.get_location_address(node) @visitor.when(cil.AssignNode) #type: ignore def visit(self, node: cil.AssignNode): assert self.current_function is not None - # Una asignacion simplemente conciste en mover un resultado de un lugar a otro + # Una asignacion simplemente consiste en mover un resultado de un lugar a otro + dest = self.visit(node.dest) + source = self.visit(node.source) + + # Puede que se asigne una constante o lo que hay en alguna direccion de memoria + if isinstance(source, int): + reg = self.get_available_register() + if reg is not None: + # Si tenemos registro temporal disponible entonces movemos + # lo que hay en la direccion de memoria source a reg y luego + # asignamos el valor de reg a dest. + self.register_instruction(lsNodes.LI(reg, source)) + self.register_instruction(lsNodes.SW(reg, dest)) + self.used_registers[reg] = False + else: + # Si no hay registro temporal disponible entonces tenemos que hacer + # dos instrucciones mas pues hay que salvar el registro s0 + # utlizarlo para hacer la transaccion y luego restaurarlo. + self.register_instruction(lsNodes.SW(s0, "0($sp)")) + self.register_instruction(lsNodes.LI(s0, source)) + self.register_instruction(lsNodes.SW(s0, dest)) + self.register_instruction(lsNodes.LI(s0, "0($sp)")) + elif isinstance(source, str): + # Source es una direccion de memoria + reg1 = self.get_available_register() + self.register_instruction(lsNodes.LW(reg, source)) + self.register_instruction(lsNodes.SW(reg, dest)) + self.used_registers[reg] = False + + @visitor.when(cil.PlusNode) #type: ignore + def visit(self, node: cil.PlusNode): + assert self.current_function is not None + dest = self.visit(node.dest) + left = self.visit(node.left) + right = self.visit(node.right) + + if isinstance(left, str): + # left es una direccion de memoria + reg = self.get_available_register() + right_reg = self.get_available_register() + self.register_instruction(lsNodes.LW(reg, left)) + if not isinstance(right, int): + self.register_instruction(lsNodes.LW(right_reg, right)) + self.register_instruction(arithNodes.ADD(reg, reg, right_reg)) + else: + self.register_instruction(arithNodes.ADD(reg, reg, right, True)) + self.register_instruction(lsNodes.SW(reg, dest)) + self.used_registers[reg] = self.used_registers[right_reg] = False + else: + # left es una constante + reg = self.get_available_register() + right_reg = self.get_available_register() + self.register_instruction(lsNodes.LI(reg, left)) + if not isinstance(right, int): + self.register_instruction(lsNodes.LW(right_reg, right)) + self.register_instruction(arithNodes.ADD(reg, reg, right_reg)) + else: + self.register_instruction(arithNodes.ADD(reg, reg, right, True)) + self.register_instruction(lsNodes.SW(reg, dest)) + self.used_registers[reg] = self.used_registers[right_reg] = False + + @visitor.when(cil.MinusNode) #type: ignore + def visit(self, node: cil.MinusNode): + assert self.current_function is not None + dest = self.visit(node.dest) + left = self.visit(node.x) + right = self.visit(node.y) + + if isinstance(left, str): + # left es una direccion de memoria + reg = self.get_available_register() + right_reg = self.get_available_register() + self.register_instruction(lsNodes.LW(reg, left)) + if not isinstance(right, int): + self.register_instruction(lsNodes.LW(right_reg, right)) + self.register_instruction(arithNodes.SUB(reg, reg, right_reg)) + else: + self.register_instruction(arithNodes.SUB(reg, reg, right, True)) + self.register_instruction(lsNodes.SW(reg, dest)) + self.used_registers[reg] = self.used_registers[right_reg] = False + else: + # left es una constante + reg = self.get_available_register() + right_reg = self.get_available_register() + self.register_instruction(lsNodes.LI(reg, left)) + if not isinstance(right, int): + self.register_instruction(lsNodes.LW(right_reg, right)) + self.register_instruction(arithNodes.SUB(reg, reg, right_reg)) + else: + self.register_instruction(arithNodes.SUB(reg, reg, right, True)) + self.register_instruction(lsNodes.SW(reg, dest)) + self.used_registers[reg] = self.used_registers[right_reg] = False + + @visitor.when(cil.StarNode) #type: ignore + def visit(self, node: cil.StarNode): + assert self.current_function is not None + dest = self.visit(node.dest) + left = self.visit(node.x) + right = self.visit(node.y) + + if isinstance(left, str): + # left es una direccion de memoria + reg = self.get_available_register() + right_reg = self.get_available_register() + self.register_instruction(lsNodes.LW(reg, left)) + if not isinstance(right, int): + self.register_instruction(lsNodes.LW(right_reg, right)) + self.register_instruction(arithNodes.MUL(reg, reg, right_reg)) + else: + self.register_instruction(arithNodes.MUL(reg, reg, right, True)) + self.register_instruction(lsNodes.SW(reg, dest)) + self.used_registers[reg] = self.used_registers[right_reg] = False + else: + # left es una constante + reg = self.get_available_register() + right_reg = self.get_available_register() + self.register_instruction(lsNodes.LI(reg, left)) + if not isinstance(right, int): + self.register_instruction(lsNodes.LW(right_reg, right)) + self.register_instruction(arithNodes.MUL(reg, reg, right_reg)) + else: + self.register_instruction(arithNodes.MUL(reg, reg, right, True)) + self.register_instruction(lsNodes.SW(reg, dest)) + self.used_registers[reg] = self.used_registers[right_reg] = False + + @visitor.when(cil.DivNode) #type: ignore + def visit(self, node: cil.DivNode): + assert self.current_function is not None + dest = self.visit(node.dest) + left = self.visit(node.left) + right = self.visit(node.right) + + if isinstance(left, str): + # left es una direccion de memoria + reg = self.get_available_register() + right_reg = self.get_available_register() + self.register_instruction(lsNodes.LW(reg, left)) + if not isinstance(right, int): + self.register_instruction(lsNodes.LW(right_reg, right)) + self.register_instruction(arithNodes.DIV(reg, reg, right_reg)) + else: + self.register_instruction(arithNodes.DIV(reg, reg, right, True)) + self.register_instruction(lsNodes.SW(reg, dest)) + self.used_registers[reg] = self.used_registers[right_reg] = False + else: + # left es una constante + reg = self.get_available_register() + right_reg = self.get_available_register() + self.register_instruction(lsNodes.LI(reg, left)) + if not isinstance(right, int): + self.register_instruction(lsNodes.LW(right_reg, right)) + self.register_instruction(arithNodes.DIV(reg, reg, right_reg)) + else: + self.register_instruction(arithNodes.DIV(reg, reg, right, True)) + self.register_instruction(lsNodes.SW(reg, dest)) + self.used_registers[reg] = self.used_registers[right_reg] = False @visitor.when(cil.AllocateNode) #type: ignore def visit(self, node: cil.AllocateNode): From f0e817b78e943836cead25f4fed9d6012ff8778c Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 25 Jun 2020 19:08:01 -0400 Subject: [PATCH 062/162] Added prototypes for remaining nodes. --- src/travels/ciltomips.py | 84 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 82 insertions(+), 2 deletions(-) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 1f48483f..ec69992a 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -6,7 +6,7 @@ import cil.nodes as cil from typing import List from mips.instruction import ( - a0, a1, a2, a3, at, + a0, a1, a2, a3, at, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, s0, s1, s2, s3, s4, s5, s6, s7, sp, ra, fp, k0, k1, gp, v0, v1, zero, @@ -301,10 +301,90 @@ def visit(self, node: cil.DivNode): self.register_instruction(lsNodes.SW(reg, dest)) self.used_registers[reg] = self.used_registers[right_reg] = False + @visitor.when(cil.GetAttributeNode) # type: ignore + def visit(self, node: cil.GetAttributeNode): + pass + + @visitor.when(cil.SetAttributeNode) #type: ignore + def visit(self, node: cil.SetAttributeNode): + pass + @visitor.when(cil.AllocateNode) #type: ignore def visit(self, node: cil.AllocateNode): pass + @visitor.when(cil.TypeOfNode) #type: ignore + def visit(self, node: cil.TypeOfNode): + pass + + @visitor.when(cil.JumpIfGreaterThanZeroNode) #type: ignore + def visit(self, node: cil.JumpIfGreaterThanZeroNode): + pass + + @visitor.when(cil.IfZeroJump) # type: ignore + def visit(self, node: cil.IfZeroJump): + pass + + @visitor.when(cil.NotZeroJump) # type: ignore + def visit(self, node: cil.NotZeroJump): + pass + + @visitor.when(cil.UnconditionalJump) # type: ignore + def visit(self, node: cil.UnconditionalJump): + pass + + @visitor.when(cil.StaticCallNode) # type: ignore + def visit(self, node: cil.StaticCallNode): + pass + + @visitor.when(cil.DynamicCallNode) # type: ignore + def visit(self, node: cil.DynamicCallNode): + pass + + @visitor.when(cil.ArgNode) # type: ignore + def visit(self, node: cil.ArgNode): + pass + + @visitor.when(cil.ReturnNode) # type: ignore + def visit(self, node: cil.ReturnNode): + pass + + @visitor.when(cil.LoadNode) # type: ignore + def visit(self, node: cil.LoadNode): + pass + + @visitor.when(cil.LengthNode) # type: ignore + def visit(self, node: cil.LengthNode): + pass + + @visitor.when(cil.SubstringNode) # type: ignore + def visit(self, node: cil.LengthNode): + pass + + @visitor.when(cil.ConcatNode) # type: ignore + def visit(self, node: cil.ConcatNode): + pass + + @visitor.when(cil.PrefixNode) # type: ignore + def visit(self, node: cil.PrefixNode): + pass + + @visitor.when(cil.ToStrNode) # type: ignore + def visit(self, node: cil.ToStrNode): + pass + + @visitor.when(cil.ReadNode) # type: ignore + def visit(self, node: cil.ReadNode): + pass + + @visitor.when(cil.PrintNode) # type: ignore + def visit(self, node: cil.PrintNode): + pass + + @visitor.when(cil.TdtLookupNode) # type: ignore + def visit(self, node: cil.TdtLookupNode): + pass + class MipsCodeGenerator(CilToMipsVisitor): """ @@ -316,4 +396,4 @@ class MipsCodeGenerator(CilToMipsVisitor): """ def __call__(self, ast: cil.CilProgramNode) -> str: self.visit(ast) - return "".join(str(x) for x in self.program) \ No newline at end of file + return "".join(str(x) for x in self.program) From 8fc7a974f8ed47c4de4068a2ff8bf3a707888398 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sat, 25 Jul 2020 18:43:09 -0400 Subject: [PATCH 063/162] change visitors to use singledispatchmethod instead --- .vscode/settings.json | 8 +- .vscode/tasks.json | 17 ++ src/cil/baseCilVisitor.py | 12 +- src/mips/baseMipsVisitor.py | 13 +- src/parserr/lr.py | 5 +- src/travels/ciltomips.py | 100 ++++++---- src/travels/ctcill.py | 376 ++++++++++++++++++++--------------- src/travels/inference.py | 301 ++++++++++++++++++++-------- src/travels/typebuilder.py | 40 ++-- src/travels/typecheck.py | 21 +- src/travels/typecollector.py | 15 +- 11 files changed, 585 insertions(+), 323 deletions(-) create mode 100644 .vscode/tasks.json diff --git a/.vscode/settings.json b/.vscode/settings.json index 2752b3e9..b29fe355 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,5 +2,11 @@ "python.pythonPath": "/bin/python", "cmake.configureOnOpen": false, "python.linting.enabled": false, - "python.linting.mypyEnabled": true + "python.linting.mypyEnabled": true, + "python.testing.pytestArgs": [ + "tests" + ], + "python.testing.unittestEnabled": false, + "python.testing.nosetestsEnabled": false, + "python.testing.pytestEnabled": true } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..0252b4c2 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,17 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "test", + "type": "shell", + "command": "cd src && make test", + "problemMatcher": [], + "group": { + "kind": "build", + "isDefault": true + } + } + ] +} \ No newline at end of file diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index a71d3d95..41c44e8f 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -42,7 +42,8 @@ def __ancestor(self, node_x: str, node_y: str) -> bool: # Para realizar este calculo nos basamos en el arbol # construido por el DFS, y tenemos en cuenta los tiempos # de descubrimiento y finalizacion - return self._discover[node_x] < self._discover[node_y] < self._finalization[node_y] < self._finalization[node_x] + return self._discover[node_x] < self._discover[ + node_y] < self._finalization[node_y] < self._finalization[node_x] def __distance_from(self, node_x: str, node_y: str) -> int: # Si x es ancestro de y, entonces la distancia entre ellos @@ -82,7 +83,8 @@ def build_tdt(self): if nodey == nodex: self.tdt[(nodex, nodey)] = 0 else: - self.tdt[(nodex, nodey)] = self.__distance_from(nodex, nodey) + self.tdt[(nodex, + nodey)] = self.__distance_from(nodex, nodey) class BaseCoolToCilVisitor: @@ -141,7 +143,8 @@ def define_internal_local(self) -> nodes.LocalNode: def to_function_name(self, method_name: str, type_name: str) -> str: return f"function_{method_name}_at_{type_name}" - def register_instruction(self, instruction: nodes.InstructionNode) -> nodes.InstructionNode: + def register_instruction( + self, instruction: nodes.InstructionNode) -> nodes.InstructionNode: self.instructions.append(instruction) return instruction @@ -178,7 +181,8 @@ def __build_CART(self) -> None: graph = InheritanceGraph() for itype in self.context.types: if self.context.types[itype].parent is not None: - graph.add_edge(self.context.types[itype].parent.name, itype) # type: ignore + graph.add_edge(self.context.types[itype].parent.name, + itype) # type: ignore # Crear la TDT graph.build_tdt() diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 1ca335f7..91f8b85c 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -63,7 +63,6 @@ class BaseCilToMipsVisitor: .globl sym Declara el label sym como global. """ - def __init__(self): # Un programa de MIPS es una lista de Instrucciones de MIPS. self.program: List[instrNodes.MipsNode] = [] @@ -98,11 +97,13 @@ def __program_header(self): la = 'Liset Alfaro' institution = 'School of Math and Computer Science, University of Havana' self.register_instruction(instrNodes.LineComment(coolc)) - self.register_instruction(instrNodes.LineComment(f'{ep}, {la}, {ad} --- {date}')) + self.register_instruction( + instrNodes.LineComment(f'{ep}, {la}, {ad} --- {date}')) self.register_instruction(instrNodes.LineComment(institution)) # Funcion de ayuda para obtener la direccion de memoria de un parametro o una variable - def get_location_address(self, node: Union[cil.ParamNode, cil.LocalNode]) -> str: + def get_location_address(self, node: Union[cil.ParamNode, + cil.LocalNode]) -> str: assert self.current_function is not None index = -1 if isinstance(node, cil.ParamNode): @@ -111,17 +112,17 @@ def get_location_address(self, node: Union[cil.ParamNode, cil.LocalNode]) -> str if param.name == node.name: index = i break - + assert index > -1 - return f"{index * 4}($fp)" + return f"{index * 4}($fp)" else: # Buscar el indice de la variable local for i, local_var in enumerate(self.current_function.localvars): if local_var.name == node.name: index = i break - + assert index > -1 index += 1 return f"-{index * 4}($fp)" diff --git a/src/parserr/lr.py b/src/parserr/lr.py index 38b51930..29cb8c03 100755 --- a/src/parserr/lr.py +++ b/src/parserr/lr.py @@ -3,6 +3,7 @@ from automatons.state import State from parserr.shiftreduce import ShiftReduceParser from tools.firsts import compute_firsts, compute_local_first +from typing import Iterable, Optional, List, Union, Set, FrozenSet def expand(item, firsts): @@ -102,10 +103,10 @@ def build_LR1_automaton(G): def build_lalr_automaton(G): - def centers(items: [Item]): + def centers(items: Iterable[Optional[Item]]): return frozenset(item.Center() for item in items) - def lookaheads(items: [Item]): + def lookaheads(items: Iterable[Optional[Item]]): return {item.Center(): item.lookaheads for item in items} def subset(items1, items2): diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index ec69992a..af06699c 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -5,13 +5,10 @@ import typecheck.visitor as visitor import cil.nodes as cil from typing import List -from mips.instruction import ( - a0, a1, a2, a3, at, - t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, - s0, s1, s2, s3, s4, s5, s6, s7, sp, - ra, fp, k0, k1, gp, v0, v1, zero, - TEMP_REGISTERS -) +from mips.instruction import (a0, a1, a2, a3, at, t0, t1, t2, t3, t4, t5, t6, + t7, t8, t9, s0, s1, s2, s3, s4, s5, s6, s7, sp, + ra, fp, k0, k1, gp, v0, v1, zero, TEMP_REGISTERS) + class CilToMipsVisitor(BaseCilToMipsVisitor): @visitor.on('node') @@ -36,7 +33,8 @@ def visit(self, node: cil.CilProgramNode): # noqa: F811 self.visit(code_node) # registrar instrucciones para terminar la ejecucion - self.register_instruction(instrNodes.LineComment("syscall code 10 is for exit")) + self.register_instruction( + instrNodes.LineComment("syscall code 10 is for exit")) self.register_instruction(lsNodes.LI(v0, 10)) self.register_instruction(instrNodes.SYSCALL()) @@ -49,25 +47,35 @@ def visit(self, node: cil.TypeNode): # noqa: F811 self.register_instruction(DotDataDirective()) # Construir la VTABLE para este tipo. - self.register_instruction(instrNodes.LineComment(f" **** VTABLE for type {node.name} ****")) - + self.register_instruction( + instrNodes.LineComment(f" **** VTABLE for type {node.name} ****")) + # Los punteros a funciones estaran definidos en el orden en que aparecen declaradas en las clases # de modo que la VTABLE sea indexable y podamos efectuar VCALL en O(1). - self.register_instruction(instrNodes.FixedData(f'{node.name}_vtable', ", ".join(x[1] for x in node.methods))) - - self.register_instruction((instrNodes.LineComment(f" **** Type RECORD for type {node.name} ****"))) + self.register_instruction( + instrNodes.FixedData(f'{node.name}_vtable', + ", ".join(x[1] for x in node.methods))) + + self.register_instruction((instrNodes.LineComment( + f" **** Type RECORD for type {node.name} ****"))) # Declarar la direccion de memoria donde comienza el tipo self.register_instruction(instrNodes.Label(self.current_type.name)) # Declarar los atributos: Si los atributos son de tipo string, guardarlos como asciiz # de lo contrario son o numeros o punteros y se inicializan como .words for attrib in self.current_type.attributes: if attrib.name == "String": - self.register_instruction(instrNodes.FixedData(f'{node.name}_attrib_{attrib.name}', r"", 'asciiz')) + self.register_instruction( + instrNodes.FixedData(f'{node.name}_attrib_{attrib.name}', + r"", 'asciiz')) else: - self.register_instruction(instrNodes.FixedData(f'{node.name}_attrib_{attrib.name}', 0)) - + self.register_instruction( + instrNodes.FixedData(f'{node.name}_attrib_{attrib.name}', + 0)) + # Registrar un puntero a la VTABLE del tipo. - self.register_instruction(instrNodes.FixedData(f'{node.name}_vtable_pointer', f"{node.name}_vtable")) + self.register_instruction( + instrNodes.FixedData(f'{node.name}_vtable_pointer', + f"{node.name}_vtable")) # Registrar la direccion de memoria donde termina el tipo para calcular facilmente # sizeof self.register_instruction(instrNodes.Label(f"{node.name}_end")) @@ -79,7 +87,10 @@ def visit(self, node: cil.DataNode): # Registrar los DataNode en la seccion .data self.register_instruction(DotDataDirective()) if isinstance(node.value, str): - self.register_instruction(instrNodes.FixedData(node.name, rf"{node.value}", type_='asciiz')) + self.register_instruction( + instrNodes.FixedData(node.name, + rf"{node.value}", + type_='asciiz')) elif isinstance(node.value, dict): # Lo unico que puede ser un diccionario es la TDT. Me parece..... mehh !!?? # La TDT contiene para cada par (typo1, tipo2), la distancia entre tipo1 y tipo2 @@ -87,9 +98,12 @@ def visit(self, node: cil.DataNode): # podemos representarlas como la concatenacion de los nombres de tipo1 y tipo2 (Al final en cada # programa los tipos son unicos). for (type1, type2), distance in node.value.items(): - self.register_instruction(instrNodes.FixedData(f"__{type1}_{type2}_tdt_entry__", distance)) + self.register_instruction( + instrNodes.FixedData(f"__{type1}_{type2}_tdt_entry__", + distance)) elif isinstance(node.value, int): - self.register_instruction(instrNodes.FixedData(node.name, node.value)) + self.register_instruction( + instrNodes.FixedData(node.name, node.value)) @visitor.when(cil.FunctionNode) # type: ignore def visit(self, node: cil.FunctionNode): @@ -98,26 +112,31 @@ def visit(self, node: cil.FunctionNode): # El codigo referente a cada funcion debe ir en la seccion de texto. self.register_instruction(DotTextDirective()) # Documentar la signatura de la funcion (parametros que recibe, valor que devuelve) - self.register_instruction(instrNodes.LineComment(f"{node.name} implementation.")) + self.register_instruction( + instrNodes.LineComment(f"{node.name} implementation.")) self.register_instruction(instrNodes.LineComment("@Params:")) for i, param in enumerate(node.params): if i < 4: - self.register_instruction(instrNodes.LineComment(f"\t$a{i} = {param}")) + self.register_instruction( + instrNodes.LineComment(f"\t$a{i} = {param}")) else: - self.register_instruction(instrNodes.LineComment(f"\t{(i-4) * 4}($fp) = {param}")) + self.register_instruction( + instrNodes.LineComment(f"\t{(i-4) * 4}($fp) = {param}")) # Direccion de memoria de la funcion. self.register_instruction(instrNodes.Label(node.name)) # Crear el marco de pila para la funcion locals_count = len(node.localvars) - self.register_instruction(instrNodes.LineComment("Allocate stack frame for function.")) + self.register_instruction( + instrNodes.LineComment("Allocate stack frame for function.")) # Salvar primero espacio para las variables locales if locals_count * 4 < 24: # MIPS fuerza a un minimo de 32 bytes por stack frame self.register_instruction(arithNodes.SUBU(sp, sp, 32, True)) ret = 32 else: - self.register_instruction(arithNodes.SUBU(sp, sp, locals_count * 4 + 8, True)) + self.register_instruction( + arithNodes.SUBU(sp, sp, locals_count * 4 + 8, True)) ret = locals_count * 4 + 8 - + # Salvar ra y fp self.register_instruction(lsNodes.SW(ra, "8($sp)")) self.register_instruction(lsNodes.SW(fp, "4($sp)")) @@ -126,7 +145,7 @@ def visit(self, node: cil.FunctionNode): for instruction in node.instructions: self.visit(instruction) - + self.current_function = None @visitor.when(cil.LabelNode) #type: ignore @@ -139,7 +158,7 @@ def visit(self, node: cil.ParamNode): @visitor.when(cil.LocalNode) #type: ignore def visit(self, node: cil.LocalNode): - return self.get_location_address(node) + return self.get_location_address(node) @visitor.when(cil.AssignNode) #type: ignore def visit(self, node: cil.AssignNode): @@ -189,7 +208,8 @@ def visit(self, node: cil.PlusNode): self.register_instruction(lsNodes.LW(right_reg, right)) self.register_instruction(arithNodes.ADD(reg, reg, right_reg)) else: - self.register_instruction(arithNodes.ADD(reg, reg, right, True)) + self.register_instruction(arithNodes.ADD( + reg, reg, right, True)) self.register_instruction(lsNodes.SW(reg, dest)) self.used_registers[reg] = self.used_registers[right_reg] = False else: @@ -201,7 +221,8 @@ def visit(self, node: cil.PlusNode): self.register_instruction(lsNodes.LW(right_reg, right)) self.register_instruction(arithNodes.ADD(reg, reg, right_reg)) else: - self.register_instruction(arithNodes.ADD(reg, reg, right, True)) + self.register_instruction(arithNodes.ADD( + reg, reg, right, True)) self.register_instruction(lsNodes.SW(reg, dest)) self.used_registers[reg] = self.used_registers[right_reg] = False @@ -221,7 +242,8 @@ def visit(self, node: cil.MinusNode): self.register_instruction(lsNodes.LW(right_reg, right)) self.register_instruction(arithNodes.SUB(reg, reg, right_reg)) else: - self.register_instruction(arithNodes.SUB(reg, reg, right, True)) + self.register_instruction(arithNodes.SUB( + reg, reg, right, True)) self.register_instruction(lsNodes.SW(reg, dest)) self.used_registers[reg] = self.used_registers[right_reg] = False else: @@ -233,7 +255,8 @@ def visit(self, node: cil.MinusNode): self.register_instruction(lsNodes.LW(right_reg, right)) self.register_instruction(arithNodes.SUB(reg, reg, right_reg)) else: - self.register_instruction(arithNodes.SUB(reg, reg, right, True)) + self.register_instruction(arithNodes.SUB( + reg, reg, right, True)) self.register_instruction(lsNodes.SW(reg, dest)) self.used_registers[reg] = self.used_registers[right_reg] = False @@ -253,7 +276,8 @@ def visit(self, node: cil.StarNode): self.register_instruction(lsNodes.LW(right_reg, right)) self.register_instruction(arithNodes.MUL(reg, reg, right_reg)) else: - self.register_instruction(arithNodes.MUL(reg, reg, right, True)) + self.register_instruction(arithNodes.MUL( + reg, reg, right, True)) self.register_instruction(lsNodes.SW(reg, dest)) self.used_registers[reg] = self.used_registers[right_reg] = False else: @@ -265,7 +289,8 @@ def visit(self, node: cil.StarNode): self.register_instruction(lsNodes.LW(right_reg, right)) self.register_instruction(arithNodes.MUL(reg, reg, right_reg)) else: - self.register_instruction(arithNodes.MUL(reg, reg, right, True)) + self.register_instruction(arithNodes.MUL( + reg, reg, right, True)) self.register_instruction(lsNodes.SW(reg, dest)) self.used_registers[reg] = self.used_registers[right_reg] = False @@ -285,7 +310,8 @@ def visit(self, node: cil.DivNode): self.register_instruction(lsNodes.LW(right_reg, right)) self.register_instruction(arithNodes.DIV(reg, reg, right_reg)) else: - self.register_instruction(arithNodes.DIV(reg, reg, right, True)) + self.register_instruction(arithNodes.DIV( + reg, reg, right, True)) self.register_instruction(lsNodes.SW(reg, dest)) self.used_registers[reg] = self.used_registers[right_reg] = False else: @@ -297,7 +323,8 @@ def visit(self, node: cil.DivNode): self.register_instruction(lsNodes.LW(right_reg, right)) self.register_instruction(arithNodes.DIV(reg, reg, right_reg)) else: - self.register_instruction(arithNodes.DIV(reg, reg, right, True)) + self.register_instruction(arithNodes.DIV( + reg, reg, right, True)) self.register_instruction(lsNodes.SW(reg, dest)) self.used_registers[reg] = self.used_registers[right_reg] = False @@ -383,6 +410,7 @@ def visit(self, node: cil.PrintNode): @visitor.when(cil.TdtLookupNode) # type: ignore def visit(self, node: cil.TdtLookupNode): + # Los nodos TDT siempre tienen pass diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 01ff56f4..4def8af7 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -1,25 +1,27 @@ import cil.baseCilVisitor as baseCilVisitor -import typecheck.visitor as visitor import abstract.tree as coolAst import abstract.semantics as semantics import cil.nodes as cil from typing import List, Tuple +from functools import singledispatchmethod ExpressionReturn = Tuple[List[cil.InstructionNode], List[cil.LocalNode]] Scope = semantics.Scope class CoolToCILVisitor(baseCilVisitor.BaseCoolToCilVisitor): - @visitor.on("node") - def visit(self, node: coolAst.Node, scope: Scope) -> None: + @singledispatchmethod + def visit(self, node, scope: Scope) -> None: pass - @visitor.when(coolAst.ProgramNode) # type: ignore - def visit(self, node: coolAst.ProgramNode, scope: Scope) -> cil.CilProgramNode: # noqa: F811 + @visit.register + def _(self, node: coolAst.ProgramNode, + scope: Scope) -> cil.CilProgramNode: # noqa: F811 # node.class_list -> [ClassDef ...] # Define the entry point for the program. - self.current_function: cil.FunctionNode = self.register_function("entry") + self.current_function: cil.FunctionNode = self.register_function( + "entry") instance = self.define_internal_local() result = self.define_internal_local() @@ -30,7 +32,8 @@ def visit(self, node: coolAst.ProgramNode, scope: Scope) -> cil.CilProgramNode: self.register_instruction(cil.ArgNode(instance)) # call the main method - self.register_instruction(cil.StaticCallNode(self.to_function_name('main', 'Main'), result)) + self.register_instruction( + cil.StaticCallNode(self.to_function_name('main', 'Main'), result)) self.register_instruction(cil.ReturnNode(0)) self.current_function = None @@ -41,8 +44,8 @@ def visit(self, node: coolAst.ProgramNode, scope: Scope) -> cil.CilProgramNode: # *************** IMPLEMENTACION DE LAS DEFINICIONES DE CLASES ***************** - @visitor.when(coolAst.ClassDef) # type: ignore - def visit(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 + @visit.register + def _(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 # node.idx -> String with the Class Name # node.features -> [AttributeDef ... MethodDef ...] List with attributes and method declarations @@ -50,8 +53,14 @@ def visit(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 self.current_type = self.context.get_type(node.idx) new_type_node = self.register_type(node.idx) - methods: List[str] = [feature.idx for feature in node.features if isinstance(feature, coolAst.MethodDef)] - attributes: List[semantics.Attribute] = [feature for feature in node.features if isinstance(feature, coolAst.AttributeDef)] + methods: List[str] = [ + feature.idx for feature in node.features + if isinstance(feature, coolAst.MethodDef) + ] + attributes: List[semantics.Attribute] = [ + feature for feature in node.features + if isinstance(feature, coolAst.AttributeDef) + ] # Handle inherited features such as attributes and methods first if self.current_type.parent is not None: @@ -61,7 +70,10 @@ def visit(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 for method in self.current_type.parent.methods.keys(): # Handle methods overload if method not in methods: - new_type_node.methods.append((method, self.to_function_name(method, self.current_type.parent.name))) + new_type_node.methods.append( + (method, + self.to_function_name(method, + self.current_type.parent.name))) # Register every attribute and method for this type # so the .Type section must look like: @@ -75,32 +87,38 @@ def visit(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 for attribute in attributes: new_type_node.attributes.append(attribute) for method in methods: - new_type_node.methods.append((method, self.to_function_name(method, node.idx))) + new_type_node.methods.append( + (method, self.to_function_name(method, node.idx))) # TODO: It is necessary to visit attributes?? Think so cuz they can be initialized # and their value could perhaps go to .DATA section # Visit every method for generate its code in the .CODE section - for feature, child_scope in zip((x for x in node.features if isinstance(x, coolAst.MethodDef)), scope.children): + for feature, child_scope in zip( + (x for x in node.features if isinstance(x, coolAst.MethodDef)), + scope.children): self.visit(feature, child_scope) self.current_type = None # ****************** IMPLEMENTACION DE LAS DEFINICIONES DE METODOS ****************** - @visitor.when(coolAst.MethodDef) # type: ignore - def visit(self, node: coolAst.MethodDef, scope: Scope) -> None: # noqa: F811 + @visit.register + def _(self, node: coolAst.MethodDef, scope: Scope) -> None: # noqa: F811 self.current_method = self.current_type.get_method(node.idx) # Registrar la nueva funcion en .CODE - function_node = self.register_function(self.to_function_name(node.idx, self.current_type.name)) + function_node = self.register_function( + self.to_function_name(node.idx, self.current_type.name)) # Establecer el metodo actual y la funcion actual en construccion # para poder establecer nombres de variables y otras cosas. self.current_function = function_node # Definir los parametros del metodo. - params: List[semantics.VariableInfo] = [scope.find_variable(param.id) for param in node.param_list] + params: List[semantics.VariableInfo] = [ + scope.find_variable(param.id) for param in node.param_list + ] # Establecer los parametros de la funcion. for param in params: @@ -116,13 +134,13 @@ def visit(self, node: coolAst.MethodDef, scope: Scope) -> None: # noqa: F811 self.current_method = None self.current_function = None - # ************** IMPLEMENTACION DE LAS EXPRESIONES CONDICIONAES (IF, WHILE, CASE) Y LAS DECLARACIONES # DE VARIABLES (let) # ************** - @visitor.when(coolAst.IfThenElseNode) # type: ignore - def visit(self, node: coolAst.IfThenElseNode, scope: Scope) -> None: # noqa: F811 + @visit.register + def _(self, node: coolAst.IfThenElseNode, + scope: Scope) -> None: # noqa: F811 # Crear un LABEL al cual realizar un salto. false_label = self.do_label("FALSE") end_label = self.do_label("END") @@ -132,7 +150,8 @@ def visit(self, node: coolAst.IfThenElseNode, scope: Scope) -> None: # noqa: F8 internal_cond_vm_holder = self.visit(node.cond, scope) # Chequear y saltar si es necesario. - self.register_instruction(cil.IfZeroJump(internal_cond_vm_holder, false_label)) + self.register_instruction( + cil.IfZeroJump(internal_cond_vm_holder, false_label)) # Salvar las instrucciones relacionadas con la rama TRUE. self.visit(node.expr1, scope) @@ -145,8 +164,9 @@ def visit(self, node: coolAst.IfThenElseNode, scope: Scope) -> None: # noqa: F8 self.register_instruction(cil.LabelNode(end_label)) - @visitor.when(coolAst.VariableDeclaration) # type: ignore - def visit(self, node: coolAst.VariableDeclaration, scope: Scope) -> None: # noqa: F811 + @visit.register + def _(self, node: coolAst.VariableDeclaration, + scope: Scope) -> None: # noqa: F811 for var_idx, var_type, var_init_expr in node.var_list: # Registrar las variables en orden. @@ -154,19 +174,21 @@ def visit(self, node: coolAst.VariableDeclaration, scope: Scope) -> None: # noq local_var = self.register_local(var_info) # Reservar memoria para la variable y realizar su inicializacion si tiene - self.register_instruction(cil.AllocateNode(var_info.type.name, local_var)) + self.register_instruction( + cil.AllocateNode(var_info.type.name, local_var)) if var_init_expr is not None: expr_init_vm_holder = self.visit(var_init_expr, scope) # Assignar el valor correspondiente a la variable reservada - self.register_instruction(cil.AssignNode(local_var, expr_init_vm_holder)) + self.register_instruction( + cil.AssignNode(local_var, expr_init_vm_holder)) # Process the associated expr, if any, to the let declaration # A block defines a new scope, so it is important to manage it return self.visit(node.block_statements, scope) - @visitor.when(coolAst.VariableCall) # type: ignore - def visit(self, node: coolAst.VariableCall, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: coolAst.VariableCall, scope: Scope): # noqa: F811 vinfo = scope.find_variable(node.idx) # Diferenciar la variable si es un parametro, un atributo o una variable local # en el scope actual @@ -176,23 +198,25 @@ def visit(self, node: coolAst.VariableCall, scope: Scope): # noqa: F811 return param_node if vinfo.location == "ATTRIBUTE": local = self.define_internal_local() - self.register_instruction(cil.GetAttributeNode(self.current_type.name, vinfo.name, local)) + self.register_instruction( + cil.GetAttributeNode(self.current_type.name, vinfo.name, + local)) return local if vinfo.location == "LOCAL": for local_node in self.localvars: if vinfo.name in local_node.name: return local_node - @visitor.when(coolAst.InstantiateClassNode) # type: ignore - def visit(self, node: coolAst.InstantiateClassNode, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: coolAst.InstantiateClassNode, scope: Scope): # Reservar una variable que guarde la nueva instancia type_ = self.context.get_type(node.type_) instance_vm_holder = self.define_internal_local() self.register_instruction(cil.AllocateNode(type_, instance_vm_holder)) return instance_vm_holder - @visitor.when(coolAst.BlockNode) # type:ignore - def visit(self, node: coolAst.BlockNode, scope: Scope) -> str: # noqa: F811 + @visit.register + def _(self, node: coolAst.BlockNode, scope: Scope) -> str: last = '' # A block is simply a list of statements, so visit each one for stmt in node.expressions: @@ -200,8 +224,8 @@ def visit(self, node: coolAst.BlockNode, scope: Scope) -> str: # noqa: F811 # Return value of a block is its last statement return last - @visitor.when(coolAst.AssignNode) # type:ignore - def visit(self, node: coolAst.AssignNode, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: coolAst.AssignNode, scope: Scope): # La asignacion tiene la siguiente forma: # id <- expr # Aqui asumimos que una variable interna llamada id @@ -215,8 +239,8 @@ def visit(self, node: coolAst.AssignNode, scope: Scope): # noqa: F811 # registrar la instruccion de asignacion self.register_instruction(cil.AssignNode(node.idx, rvalue_vm_holder)) - @visitor.when(coolAst.WhileBlockNode) # type: ignore - def visit(self, node: coolAst.WhileBlockNode, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: coolAst.WhileBlockNode, scope: Scope): # Evaluar la condicion y definir un LABEL al cual # retornar while_label = self.do_label('WHILE') @@ -235,37 +259,38 @@ def visit(self, node: coolAst.WhileBlockNode, scope: Scope): # noqa: F811 # Registrar el LABEL final self.register_instruction(cil.LabelNode(end_label)) - @visitor.when(coolAst.CaseNode) # type: ignore - def visit(self, node: coolAst.CaseNode, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: coolAst.CaseNode, scope: Scope): # Evalauar la expr0 expr_vm_holder = self.visit(node.expression, scope) # Almacenar el tipo del valor retornado type_internal_local_holder = self.define_internal_local() - self.register_instruction(cil.TypeOfNode(expr_vm_holder, type_internal_local_holder)) + sub_vm_local_holder = self.define_internal_local() + self.register_instruction( + cil.TypeOfNode(expr_vm_holder, type_internal_local_holder)) # Variables internas para almacenar resultados intermedios - branch_type_index = self.define_internal_local() - expr_type_index = self.define_internal_local() branch_type = self.define_internal_local() min_ = self.define_internal_local() tdt_result = self.define_internal_local() min_check_local = self.define_internal_local() - self.register_instruction(cil.AssignNode(min_, len(self.context.types))) - self.register_instruction(cil.GetTypeIndex(type_internal_local_holder, expr_type_index)) + self.register_instruction(cil.AssignNode(min_, + len(self.context.types))) for i, action_node in enumerate(node.actions): - self.register_instruction(cil.AssignNode(branch_type, action_node.itype.name)) - # Obtener el indice del tipo en el contexto - self.register_instruction(cil.GetTypeIndex(branch_type, branch_type_index)) # Calcular la distancia hacia el tipo, y actualizar el minimo de ser necesario - self.register_instruction(cil.TdtLookupNode(branch_type_index, expr_type_index, tdt_result)) + self.register_instruction( + cil.TdtLookupNode(action_node.itype, + type_internal_local_holder, tdt_result)) # Comparar el resultado obtenido con el minimo actual. - self.register_instruction(cil.MinusNode(min_, tdt_result, min_check_local)) + self.register_instruction( + cil.MinusNode(min_, tdt_result, min_check_local)) not_min_label = self.do_label('Not_min{i}') - self.register_instruction(cil.JumpIfGreaterThanZeroNode(min_check_local, not_min_label)) + self.register_instruction( + cil.JumpIfGreaterThanZeroNode(min_check_local, not_min_label)) # Si mejora el minimo, entonces actualizarlo. self.register_instruction(cil.AssignNode(min_, tdt_result)) @@ -274,21 +299,26 @@ def visit(self, node: coolAst.CaseNode, scope: Scope): # noqa: F811 # Ya tenemos la menor distancia entre el tipo calculado en la expr0, y todos los tipos definidos # en los branches del case. # Comprobar que tengamos una coincidencia - self.register_instruction(cil.AssignNode(tdt_result, len(self.context.types))) - self.register_instruction(cil.MinusNode(tdt_result, min_, type_internal_local_holder)) + self.register_instruction( + cil.AssignNode(tdt_result, len(self.context.types))) + self.register_instruction( + cil.MinusNode(tdt_result, min_, sub_vm_local_holder)) error_label = self.do_label("ERROR") - self.register_instruction(cil.IfZeroJump(type_internal_local_holder, error_label)) + self.register_instruction( + cil.IfZeroJump(sub_vm_local_holder, error_label)) end_label = self.do_label('END') # Procesar cada accion y ejecutar el tipo cuya distancia sea igual a min_ for i, action_node in enumerate(node.actions): next_label = self.do_label(f'NEXT{i}') - self.register_instruction(cil.AssignNode(branch_type, action_node.itype.name)) - self.register_instruction(cil.GetTypeIndex(branch_type, branch_type_index)) - self.register_instruction(cil.TdtLookupNode(branch_type_index, expr_type_index, tdt_result)) - self.register_instruction(cil.MinusNode(min_, tdt_result, min_check_local)) - self.register_instruction(cil.NotZeroJump(min_check_local, next_label)) + self.register_instruction( + cil.TdtLookupNode(action_node.itype, + type_internal_local_holder, tdt_result)) + self.register_instruction( + cil.MinusNode(min_, tdt_result, min_check_local)) + self.register_instruction( + cil.NotZeroJump(min_check_local, next_label)) # Implemententacion del branch. # Registrar la variable var_info = scope.find_variable(action_node.idx) @@ -310,8 +340,8 @@ def visit(self, node: coolAst.CaseNode, scope: Scope): # noqa: F811 # # *************** - @visitor.when(coolAst.PlusNode) # type: ignore - def visit(self, node: coolAst.PlusNode, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: coolAst.PlusNode, scope: Scope): # Definir una variable interna local para almacenar el resultado sum_internal_local = self.define_internal_local() @@ -322,13 +352,14 @@ def visit(self, node: coolAst.PlusNode, scope: Scope): # noqa: F811 right_vm_holder = self.visit(node.right, scope) # registrar la instruccion de suma - self.register_instruction(cil.PlusNode(sum_internal_local, left_vm_holder, right_vm_holder)) + self.register_instruction( + cil.PlusNode(sum_internal_local, left_vm_holder, right_vm_holder)) # Devolver la variable interna que contiene la suma return sum_internal_local - @visitor.when(coolAst.DifNode) # type: ignore - def visit(self, node: coolAst.DifNode, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: coolAst.DifNode, scope: Scope): # Definir una variable interna local para almacenar el resultado intermedio minus_internal_vm_holder = self.define_internal_local() @@ -339,13 +370,15 @@ def visit(self, node: coolAst.DifNode, scope: Scope): # noqa: F811 right_vm_holder = self.visit(node.right, scope) # Registrar la instruccion de resta - self.register_instruction(cil.MinusNode(left_vm_holder, right_vm_holder, minus_internal_vm_holder)) + self.register_instruction( + cil.MinusNode(left_vm_holder, right_vm_holder, + minus_internal_vm_holder)) # Devolver la variable que contiene el resultado return minus_internal_vm_holder - @visitor.when(coolAst.MulNode) # type: ignore - def visit(self, node: coolAst.MulNode, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: coolAst.MulNode, scope: Scope): # Definir una variable interna local para almacenar el resultado intermedio mul_internal_vm_holder = self.define_internal_local() @@ -356,13 +389,15 @@ def visit(self, node: coolAst.MulNode, scope: Scope): # noqa: F811 right_vm_holder = self.visit(node.right, scope) # Registrar la instruccion de multimplicacion - self.register_instruction(cil.StarNode(left_vm_holder, right_vm_holder, mul_internal_vm_holder)) + self.register_instruction( + cil.StarNode(left_vm_holder, right_vm_holder, + mul_internal_vm_holder)) # Retornarl el resultado return mul_internal_vm_holder - @visitor.when(coolAst.DivNode) # type: ignore - def visit(self, node: coolAst.DivNode, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: coolAst.DivNode, scope: Scope): # Definir una variable interna local para almacenar el resultado intermedio div_internal_vm_holder = self.define_internal_local() @@ -373,7 +408,9 @@ def visit(self, node: coolAst.DivNode, scope: Scope): # noqa: F811 right_vm_holder = self.visit(node.right, scope) # Registrar la instruccion de division - self.register_instruction(cil.DivNode(div_internal_vm_holder, left_vm_holder, right_vm_holder)) + self.register_instruction( + cil.DivNode(div_internal_vm_holder, left_vm_holder, + right_vm_holder)) # Devolver el resultado return div_internal_vm_holder @@ -382,13 +419,13 @@ def visit(self, node: coolAst.DivNode, scope: Scope): # noqa: F811 # # ********************* - @visitor.when(coolAst.IntegerConstant) # type: ignore - def visit(self, node: coolAst.IntegerConstant, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: coolAst.IntegerConstant, scope: Scope): # devolver el valor return int(node.lex) - @visitor.when(coolAst.StringConstant) # type: ignore - def visit(self, node: coolAst.StringConstant, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: coolAst.StringConstant, scope: Scope): # Variable interna que apunta al string str_const_vm_holder = self.define_internal_local() @@ -401,13 +438,13 @@ def visit(self, node: coolAst.StringConstant, scope: Scope): # noqa: F811 # Devolver la variable que contiene el string return str_const_vm_holder - @visitor.when(coolAst.TrueConstant) # type: ignore - def visit(self, node: coolAst.TrueConstant, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: coolAst.TrueConstant, scope: Scope): # variable interna que devuelve el valor de la constante return 1 - @visitor.when(coolAst.FalseConstant) # type: ignore - def visit(self, node: coolAst.FalseConstant, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: coolAst.FalseConstant, scope: Scope): return 0 # ******************* Implementacion de las comparaciones ******************** @@ -415,8 +452,8 @@ def visit(self, node: coolAst.FalseConstant, scope: Scope): # noqa: F811 # o 0 si es falso. # ******************* - @visitor.when(coolAst.EqualToNode) # type: ignore - def visit(self, node: coolAst.EqualToNode, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: coolAst.EqualToNode, scope: Scope): expr_result_vm_holder = self.define_internal_local() true_label = self.do_label("TRUE") end_label = self.do_label("END") @@ -428,10 +465,13 @@ def visit(self, node: coolAst.EqualToNode, scope: Scope): # noqa: F811 right_vm_holder = self.visit(node.right, scope) # Realizar una resta y devolver el resultado - self.register_instruction(cil.MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) + self.register_instruction( + cil.MinusNode(left_vm_holder, right_vm_holder, + expr_result_vm_holder)) # Si la resta da 0, entonces son iguales y se devuelve 1, si no, se devuelve 0 - self.register_instruction(cil.IfZeroJump(expr_result_vm_holder, true_label)) + self.register_instruction( + cil.IfZeroJump(expr_result_vm_holder, true_label)) # si la resta no da 0, almacenar 0 y retornar self.register_instruction(cil.AssignNode(expr_result_vm_holder, 0)) @@ -446,8 +486,8 @@ def visit(self, node: coolAst.EqualToNode, scope: Scope): # noqa: F811 # Devolver la variable con el resultado return expr_result_vm_holder - @visitor.when(coolAst.LowerThanNode) # type: ignore - def visit(self, node: coolAst.LowerThanNode, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: coolAst.LowerThanNode, scope: Scope): expr_result_vm_holder = self.define_internal_local() false_label = self.do_label("FALSE") end_label = self.do_label("END") @@ -459,10 +499,14 @@ def visit(self, node: coolAst.LowerThanNode, scope: Scope): # noqa: F811 right_vm_holder = self.visit(node.right, scope) # Comparar los resultados restando - self.register_instruction(cil.MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) + self.register_instruction( + cil.MinusNode(left_vm_holder, right_vm_holder, + expr_result_vm_holder)) - self.register_instruction(cil.JumpIfGreaterThanZeroNode(expr_result_vm_holder, false_label)) - self.register_instruction(cil.IfZeroJump(expr_result_vm_holder, false_label)) + self.register_instruction( + cil.JumpIfGreaterThanZeroNode(expr_result_vm_holder, false_label)) + self.register_instruction( + cil.IfZeroJump(expr_result_vm_holder, false_label)) self.register_instruction(cil.AssignNode(expr_result_vm_holder, 1)) self.register_instruction(cil.UnconditionalJump(end_label)) @@ -473,8 +517,8 @@ def visit(self, node: coolAst.LowerThanNode, scope: Scope): # noqa: F811 return expr_result_vm_holder - @visitor.when(coolAst.LowerEqual) # type: ignore - def visit(self, node: coolAst.LowerEqual, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: coolAst.LowerEqual, scope: Scope): expr_result_vm_holder = self.define_internal_local() false_label = self.do_label("FALSE") end_label = self.do_label("END") @@ -485,9 +529,12 @@ def visit(self, node: coolAst.LowerEqual, scope: Scope): # noqa: F811 # Obtener el valor de la expresion derecha right_vm_holder = self.visit(node.right, scope) - self.register_instruction(cil.MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) + self.register_instruction( + cil.MinusNode(left_vm_holder, right_vm_holder, + expr_result_vm_holder)) - self.register_instruction(cil.JumpIfGreaterThanZeroNode(expr_result_vm_holder, false_label)) + self.register_instruction( + cil.JumpIfGreaterThanZeroNode(expr_result_vm_holder, false_label)) self.register_instruction(cil.AssignNode(expr_result_vm_holder, 1)) self.register_instruction(cil.UnconditionalJump(end_label)) @@ -498,8 +545,8 @@ def visit(self, node: coolAst.LowerEqual, scope: Scope): # noqa: F811 return expr_result_vm_holder - @visitor.when(coolAst.GreaterThanNode) # type: ignore - def visit(self, node: coolAst.GreaterThanNode, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: coolAst.GreaterThanNode, scope: Scope): expr_result_vm_holder = self.define_internal_local() true_label = self.do_label("TRUE") end_label = self.do_label("END") @@ -510,9 +557,12 @@ def visit(self, node: coolAst.GreaterThanNode, scope: Scope): # noqa: F811 # Obtener el valor de la expresion derecha right_vm_holder = self.visit(node.right, scope) - self.register_instruction(cil.MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) + self.register_instruction( + cil.MinusNode(left_vm_holder, right_vm_holder, + expr_result_vm_holder)) - self.register_instruction(cil.JumpIfGreaterThanZeroNode(expr_result_vm_holder, true_label)) + self.register_instruction( + cil.JumpIfGreaterThanZeroNode(expr_result_vm_holder, true_label)) # False Branch self.register_instruction(cil.AssignNode(expr_result_vm_holder, 0)) @@ -525,8 +575,8 @@ def visit(self, node: coolAst.GreaterThanNode, scope: Scope): # noqa: F811 return expr_result_vm_holder - @visitor.when(coolAst.GreaterEqualNode) # type: ignore - def visit(self, node: coolAst.GreaterEqualNode, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: coolAst.GreaterEqualNode, scope: Scope): expr_result_vm_holder = self.define_internal_local() true_label = self.do_label("TRUE") end_label = self.do_label("END") @@ -537,10 +587,14 @@ def visit(self, node: coolAst.GreaterEqualNode, scope: Scope): # noqa: F811 # Obtener el valor de la expresion derecha right_vm_holder = self.visit(node.right, scope) - self.register_instruction(cil.MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) + self.register_instruction( + cil.MinusNode(left_vm_holder, right_vm_holder, + expr_result_vm_holder)) - self.register_instruction(cil.JumpIfGreaterThanZeroNode(expr_result_vm_holder, true_label)) - self.register_instruction(cil.IfZeroJump(expr_result_vm_holder, true_label)) + self.register_instruction( + cil.JumpIfGreaterThanZeroNode(expr_result_vm_holder, true_label)) + self.register_instruction( + cil.IfZeroJump(expr_result_vm_holder, true_label)) # False Branch self.register_instruction(cil.AssignNode(expr_result_vm_holder, 1)) @@ -557,8 +611,8 @@ def visit(self, node: coolAst.GreaterEqualNode, scope: Scope): # noqa: F811 # # ********************* - @visitor.when(coolAst.FunCall) # type: ignore - def visit(self, node: coolAst.FunCall, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: coolAst.FunCall, scope: Scope): type_vm_holder = self.define_internal_local() return_vm_holder = self.define_internal_local() # Evaluar la expresion a la izquierda del punto @@ -571,12 +625,13 @@ def visit(self, node: coolAst.FunCall, scope: Scope): # noqa: F811 arg_expr = self.visit(arg, scope) self.register_instruction(cil.ArgNode(arg_expr)) - self.register_instruction(cil.DynamicCallNode(type_vm_holder, node.id, return_vm_holder)) + self.register_instruction( + cil.DynamicCallNode(type_vm_holder, node.id, return_vm_holder)) return return_vm_holder - @visitor.when(coolAst.ParentFuncCall) # type: ignore - def visit(self, node: coolAst.ParentFuncCall, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: coolAst.ParentFuncCall, scope: Scope): local_type_identifier = self.define_internal_local() return_expr_vm_holder = self.define_internal_local() expr = self.visit(node.obj, scope) @@ -590,18 +645,20 @@ def visit(self, node: coolAst.ParentFuncCall, scope: Scope): # noqa: F811 type_ = self.context.get_type(node.parent_type) self.register_instruction(cil.AssignNode(local_type_identifier, type_)) - self.register_instruction(cil.DynamicCallNode(local_type_identifier, node.idx, return_expr_vm_holder)) + self.register_instruction( + cil.DynamicCallNode(local_type_identifier, node.idx, + return_expr_vm_holder)) return return_expr_vm_holder class CilDisplayFormatter: - @visitor.on("node") - def visit(self, node): - pass + @singledispatchmethod + def visit(self, node) -> str: + return "" - @visitor.when(cil.CilProgramNode) # type: ignore - def visit(self, node: cil.CilProgramNode): # noqa: F811 + @visit.register + def _(self, node: cil.CilProgramNode): # Primero imprimir la seccion .TYPES dottypes = '\n'.join(self.visit(type_) for type_ in node.dottypes) @@ -613,110 +670,109 @@ def visit(self, node: cil.CilProgramNode): # noqa: F811 return f'.TYPES\n{dottypes}\n\n.DATA\n{dotdata}\n\n.CODE\n{dotcode}' - @visitor.when(cil.TypeNode) # type: ignore - def visit(self, node: cil.TypeNode): # noqa: F811 + @visit.register + def _(self, node: cil.TypeNode): attributes = '\n\t'.join(f'attribute {x}' for x in node.attributes) methods = '\n\t'.join(f'method {x}: {y}' for x, y in node.methods) return f'type {node.name} {{\n\t{attributes}\n\n\t{methods}\n}}' - @visitor.when(cil.FunctionNode) # type: ignore - def visit(self, node: cil.FunctionNode): # noqa: F811 + @visit.register + def _(self, node: cil.FunctionNode): params = '\n\t'.join(self.visit(x) for x in node.params) localvars = '\n\t'.join(self.visit(x) for x in node.localvars) instructions = '\n\t'.join(self.visit(x) for x in node.instructions) return f'function {node.name} {{\n\t{params}\n\n\t{localvars}\n\n\t{instructions}\n}}' - @visitor.when(cil.ParamNode) # type: ignore - def visit(self, node: cil.ParamNode): # noqa : F811 + @visit.register + def _(self, node: cil.ParamNode) -> str: return f'PARAM {node.name}' - @visitor.when(cil.LocalNode) # type: ignore - def visit(self, node: cil.LocalNode): # noqa: F811 + @visit.register + def _(self, node: cil.LocalNode) -> str: return f'LOCAL {node.name}' - @visitor.when(cil.AssignNode) # type: ignore - def visit(self, node: cil.AssignNode): # noqa: F811 + @visit.register + def _(self, node: cil.AssignNode) -> str: return f'{self.visit(node.dest)} = {self.visit(node.source)}' - @visitor.when(cil.PlusNode) # type: ignore - def visit(self, node: cil.PlusNode): # noqa: F811 + @visit.register + def _(self, node: cil.PlusNode) -> str: return f'{self.visit(node.dest)} = {self.visit(node.left)} + {self.visit(node.right)}' - @visitor.when(cil.MinusNode) # type: ignore - def visit(self, node: cil.MinusNode): # noqa: F811 + @visit.register + def _(self, node: cil.MinusNode) -> str: return f'{self.visit(node.dest)} = {self.visit(node.x)} - {self.visit(node.y)}' - @visitor.when(cil.StarNode) # type: ignore - def visit(self, node: cil.StarNode): # noqa: F811 + @visit.register + def _(self, node: cil.StarNode) -> str: return f'{self.visit(node.dest)} = {self.visit(node.x)} * {self.visit(node.y)}' - @visitor.when(cil.DivNode) # type: ignore - def visit(self, node: cil.DivNode): # noqa: F811 + @visit.register + def _(self, node: cil.DivNode) -> str: return f'{self.visit(node.dest)} = {self.visit(node.left)} / {self.visit(node.right)}' - @visitor.when(cil.AllocateNode) # type: ignore - def visit(self, node: cil.AllocateNode): # noqa: F811 + @visit.register + def _(self, node: cil.AllocateNode) -> str: return f'{self.visit(node.dest)} = ALLOCATE {node.itype}' - @visitor.when(cil.TypeOfNode) # type: ignore - def visit(self, node: cil.TypeOfNode): # noqa: F811 + @visit.register + def _(self, node: cil.TypeOfNode) -> str: return f'{self.visit(node.dest)} = TYPEOF {node.variable}' - @visitor.when(cil.DynamicCallNode) # type: ignore - def visit(self, node: cil.DynamicCallNode): # noqa: F811 + @visit.register + def _(self, node: cil.DynamicCallNode) -> str: return f'{self.visit(node.dest)} = VCALL {node.xtype} {node.method}' - @visitor.when(cil.StaticCallNode) # type: ignore - def visit(self, node: cil.StaticCallNode): # noqa: F811 + @visit.register + def _(self, node: cil.StaticCallNode) -> str: return f'{self.visit(node.dest)} = CALL {node.function}' - @visitor.when(cil.ArgNode) # type: ignore - def visit(self, node: cil.ArgNode): # noqa: F811 + @visit.register + def _(self, node: cil.ArgNode) -> str: return f'ARG {node.name}' - @visitor.when(cil.ReturnNode) # type: ignore - def visit(self, node: cil.ReturnNode): # noqa: F811 + @visit.register + def _(self, node: cil.ReturnNode) -> str: return f'RETURN {node.value if node.value is not None else ""}' - @visitor.when(cil.DataNode) # type: ignore - def visit(self, node: cil.DataNode): # noqa: F811 + @visit.register + def _(self, node: cil.DataNode) -> str: if isinstance(node.value, str): return f'{node.name} = "{node.value}" ;' elif isinstance(node.value, list): data = "\n\t".join(str(x) for x in node.value) return f'{node.name} = {data}' - elif isinstance(node.value, int): - return f'{node.name} = {node.value}' + return f'{node.name} = {node.value}' - @visitor.when(cil.GetTypeIndex) # type: ignore - def visit(self, node: cil.GetTypeIndex): # noqa: F811 + @visit.register + def _(self, node: cil.GetTypeIndex) -> str: return f'{self.visit(node.dest)} = GETTYPEINDEX {node.itype}' - @visitor.when(cil.TdtLookupNode) # type: ignore - def visit(self, node: cil.TdtLookupNode): # noqa: F811 + @visit.register + def _(self, node: cil.TdtLookupNode) -> str: return f'{self.visit(node.dest)} = TYPE_DISTANCE {node.i} {node.j}' - @visitor.when(cil.IfZeroJump) # type: ignore - def visit(self, node: cil.IfZeroJump): # noqa: F811 + @visit.register + def _(self, node: cil.IfZeroJump) -> str: return f'IF_ZERO {node.variable} GOTO {node.label}' - @visitor.when(cil.UnconditionalJump) # type: ignore - def visit(self, node: cil.UnconditionalJump): # noqa: F811 + @visit.register + def _(self, node: cil.UnconditionalJump) -> str: return f'GOTO {node.label}' - @visitor.when(cil.JumpIfGreaterThanZeroNode) # type: ignore - def visit(self, node: cil.JumpIfGreaterThanZeroNode): # noqa: F811 + @visit.register + def _(self, node: cil.JumpIfGreaterThanZeroNode) -> str: return f'IF_GREATER_ZERO {node.variable} GOTO {node.label}' - @visitor.when(cil.LabelNode) # type: ignore - def visit(self, node: cil.LabelNode): # noqa: F811 + @visit.register + def _(self, node: cil.LabelNode) -> str: return f'{node.label}:' - @visitor.when(int) #type: ignore - def visit(self, node: int): + @visit.register + def _(self, node: int) -> str: return str(node) - def __call__(self, node): + def __call__(self, node) -> str: return self.visit(node) diff --git a/src/travels/inference.py b/src/travels/inference.py index 9d411739..959f24a4 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -1,8 +1,8 @@ import abstract.semantics as semantic import abstract.tree as coolAst -import typecheck.visitor as visitor from travels.context_actions import update_attr_type, update_method_param, update_scope_variable from typing import Optional +from functools import singledispatchmethod void = semantic.VoidType() @@ -37,7 +37,7 @@ def __init__(self, context: semantic.Context, errors=[]): self.errors = errors self.current_method: Optional[semantic.Method] = None - @visitor.on('node') + @singledispatchmethod def visit(self, node, scope, infered_type=None): pass @@ -48,15 +48,20 @@ def visit(self, node, scope, infered_type=None): # --------------------------------------------------------------- # Calcular todos los tipos en el contexto del programa. | # --------------------------------------------------------------- - @visitor.when(coolAst.ProgramNode) #type: ignore # noqa - def visit(self, node, scope=None, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.ProgramNode, + scope=None, + infered_type=None, + deep=1): # noqa: F811 program_scope = semantic.Scope() if scope is None else scope print(f"Este es el scope en la vuelta {deep} :\n {program_scope}") if deep == 1: for class_ in node.class_list: self.visit(class_, program_scope.create_child()) else: - for class_, child_scope in zip(node.class_list, program_scope.children): + for class_, child_scope in zip(node.class_list, + program_scope.children): self.visit(class_, child_scope, deep=deep) return program_scope @@ -65,8 +70,12 @@ def visit(self, node, scope=None, infered_type=None, deep=1): # noqa: F811 # y luego los métodos para garantizar que al revisar los métodos | # ya todos los atributos estén definidos en el scope. | # ----------------------------------------------------------------- - @visitor.when(coolAst.ClassDef) #type: ignore # noqa - def visit(self, node, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.ClassDef, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 self.current_type = self.context.get_type(node.idx) for feature in node.features: if isinstance(feature, coolAst.AttributeDef): @@ -76,15 +85,20 @@ def visit(self, node, scope: semantic.Scope, infered_type=None, deep=1): # noqa if isinstance(feature, coolAst.MethodDef): self.visit(feature, scope.create_child(), deep=deep) else: - methods = (f for f in node.features if isinstance(f, coolAst.MethodDef)) + methods = (f for f in node.features + if isinstance(f, coolAst.MethodDef)) for feature, child_scope in zip(methods, scope.children): self.visit(feature, child_scope, deep=deep) # --------------------------------------------------------- # Definir un atributo en el scope. | # --------------------------------------------------------- - @visitor.when(coolAst.AttributeDef) #type: ignore # noqa - def visit(self, node: coolAst.AttributeDef, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.AttributeDef, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 atrib = self.current_type.get_attribute(node.idx) if deep == 1: scope.define_variable(atrib.name, atrib.type, "ATTRIBUTE") @@ -95,8 +109,12 @@ def visit(self, node: coolAst.AttributeDef, scope: semantic.Scope, infered_type= # Notar que al revisar el body del método se pueden inferir también | # los argumentos que no hayan sido definidos con tipos específicos. | # --------------------------------------------------------------------- - @visitor.when(coolAst.MethodDef) #type: ignore # noqa - def visit(self, node: coolAst.MethodDef, scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.MethodDef, + scope, + infered_type=None, + deep=1): # noqa: F811 print(node.idx) method = self.current_type.get_method(node.idx) self.current_method = method @@ -109,19 +127,28 @@ def visit(self, node: coolAst.MethodDef, scope, infered_type=None, deep=1): # n method.return_type = last else: if not last.conforms_to(method.return_type): - self.errors.append(f'Method {method.name} cannot return {last}') + self.errors.append( + f'Method {method.name} cannot return {last}') print(scope) - @visitor.when(coolAst.BlockNode) # type: ignore - def visit(self, node: coolAst.BlockNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.BlockNode, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 # Visitar cada expr del bloque, el tipo del bloque es el tipo de la ultima expresion last = None for expr in node.expressions: last = self.visit(expr, scope, infered_type, deep) return last - @visitor.when(coolAst.Param) #type: ignore # noqa - def visit(self, node: coolAst.Param, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.Param, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 type_ = self.context.get_type(node.type) if deep == 1: scope.define_variable(node.id, type_, "PARAM") @@ -132,8 +159,12 @@ def visit(self, node: coolAst.Param, scope: semantic.Scope, infered_type=None, d # el tipo de la expresión coincide con el tipo de la variable, de lo con- | # trario asignarle a la variable el tipo de retorno de la expresión. | # ------------------------------------------------------------------------- - @visitor.when(coolAst.AssignNode) #type: ignore # noqa - def visit(self, node: coolAst.AssignNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.AssignNode, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 var_info = scope.find_variable(node.idx) if var_info: e = self.visit(node.expr, scope, infered_type) @@ -141,41 +172,59 @@ def visit(self, node: coolAst.AssignNode, scope: semantic.Scope, infered_type=No print(f'Infered type {e.name} for {node.idx}') var_info.type = e if not scope.is_local(var_info.name): - update_attr_type(self.current_type, var_info.name, var_info.type) + update_attr_type(self.current_type, var_info.name, + var_info.type) else: - update_method_param(self.current_type, self.current_method.name, var_info.name, var_info.type) + update_method_param(self.current_type, + self.current_method.name, + var_info.name, var_info.type) update_scope_variable(var_info.name, e, scope) return void else: if not e.conforms_to(var_info.type): - self.errors.append(f'Expresion of type {e.name} cannot be assigned to variable {var_info.name} of type {var_info.type.name}') + self.errors.append( + f'Expresion of type {e.name} cannot be assigned to variable {var_info.name} of type {var_info.type.name}' + ) return void else: self.errors.append(f'Undefined variable name: {node.idx}') - @visitor.when(coolAst.VariableCall) #type: ignore # noqa - def visit(self, node, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.VariableCall, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 var_info = scope.find_variable(node.idx) if var_info: if infered_type and var_info.type == self.AUTO_TYPE: print(f'Infered type {infered_type.name} for {var_info.name}') var_info.type = infered_type if not scope.is_local(var_info.name): - update_attr_type(self.current_type, var_info.name, var_info.type) + update_attr_type(self.current_type, var_info.name, + var_info.type) else: - update_method_param(self.current_type, self.current_method.name, var_info.name, var_info.type) + update_method_param(self.current_type, + self.current_method.name, + var_info.name, var_info.type) update_scope_variable(var_info.name, infered_type, scope) return var_info.type else: self.errors.append(f'Name {node.idx} is not define.') - @visitor.when(coolAst.IfThenElseNode) #type: ignore # noqa - def visit(self, node: coolAst.IfThenElseNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.IfThenElseNode, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 cond = self.visit(node.cond, scope, infered_type, deep) e1 = self.visit(node.expr1, scope, infered_type, deep) e2 = self.visit(node.expr2, scope, infered_type, deep) if cond != self.BOOL: - self.errors.append(f'Se esperaba una expresion de tipo bool y se obtuvo una de tipo {cond}.') + self.errors.append( + f'Se esperaba una expresion de tipo bool y se obtuvo una de tipo {cond}.' + ) if e1.conforms_to(e2): return e2 elif e2.conforms_to(e1): @@ -202,8 +251,12 @@ def visit(self, node: coolAst.IfThenElseNode, scope: semantic.Scope, infered_typ # print(f'Infered type {type_.name} for {var_idx}') # scope.define_variable(node.idx, type_, "LOCAL") # return void - @visitor.when(coolAst.VariableDeclaration) # type: ignore - def visit(self, node: coolAst.VariableDeclaration, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.VariableDeclaration, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 for var_id, var_type, var_init_expr in node.var_list: type_ = self.context.get_type(var_type) # Revisar que la expresion de inicializacion (de existir) se conforme con el tipo @@ -217,10 +270,13 @@ def visit(self, node: coolAst.VariableDeclaration, scope: semantic.Scope, infere # - La variable se inicializa en AUTO_TYPE y no existe la expr, en este caso se define la variable # y su tipo se deja a inferir por el contexto. if var_init_expr: - init_expr_type: semantic.Type = self.visit(var_init_expr, scope, infered_type, deep) + init_expr_type: semantic.Type = self.visit( + var_init_expr, scope, infered_type, deep) if type_ != self.AUTO_TYPE: if not init_expr_type.conforms_to(type_): - self.errors.append(f"Init expression of {var_id} must conform to type {type_}") + self.errors.append( + f"Init expression of {var_id} must conform to type {type_}" + ) else: if deep == 1: scope.define_variable(var_id, type_, "LOCAL") @@ -234,7 +290,8 @@ def visit(self, node: coolAst.VariableDeclaration, scope: semantic.Scope, infere scope.define_variable(var_id, type_, "LOCAL") # Visitar la expresion asociada. - return_type = self.visit(node.block_statements, scope, infered_type, deep) + return_type = self.visit(node.block_statements, scope, infered_type, + deep) return return_type # @visitor.when(coolAst.FunCall) #type: ignore # noqa @@ -258,19 +315,27 @@ def visit(self, node: coolAst.VariableDeclaration, scope: semantic.Scope, infere # else: # return self.AUTO_TYPE - @visitor.when(coolAst.FunCall) # type: ignore - def visit(self, node: coolAst.FunCall, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.FunCall, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 # Detectar el tipo estatico de la expr0. - static_expr0_type: semantic.Type = self.visit(node.obj, scope, infered_type, deep) + static_expr0_type: semantic.Type = self.visit(node.obj, scope, + infered_type, deep) # Encontrar el metodo en el tipo. method: semantic.Method = static_expr0_type.get_method(node.id) # Iterar por cada parametro del metodo y chequear que cada expresion corresponda en tipo. - for expr_i, type_i, param_name in zip(node.args, method.param_types, method.param_names): + for expr_i, type_i, param_name in zip(node.args, method.param_types, + method.param_names): type_expr_i = self.visit(expr_i, scope, infered_type, deep) if not type_expr_i.conforms_to(type_i): - raise semantic.SemanticError(f"Expression corresponding to param {param_name} in call to {node.id} must conform to {type_i}") + raise semantic.SemanticError( + f"Expression corresponding to param {param_name} in call to {node.id} must conform to {type_i}" + ) # Procesar el tipo de retorno de la funcion if method.return_type != self.AUTO_TYPE: @@ -281,15 +346,24 @@ def visit(self, node: coolAst.FunCall, scope: semantic.Scope, infered_type=None, else: return self.AUTO_TYPE - @visitor.when(coolAst.InstantiateClassNode) #type: ignore # noqa - def visit(self, node: coolAst.InstantiateClassNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.InstantiateClassNode, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 ret_type = self.context.get_type(node.type_) - if ret_type in (self.AUTO_TYPE, void, self.STRING, self.INTEGER, self.OBJECT, self.BOOL): + if ret_type in (self.AUTO_TYPE, void, self.STRING, self.INTEGER, + self.OBJECT, self.BOOL): self.errors.append(f'Cannot instantiate {ret_type}') return ret_type - @visitor.when(coolAst.WhileBlockNode) #type: ignore # noqa - def visit(self, node: coolAst.WhileBlockNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.WhileBlockNode, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 ret_type = None for st in node.statements: ret_type = self.visit(st, scope, infered_type, deep) @@ -306,44 +380,64 @@ def visit(self, node: coolAst.WhileBlockNode, scope: semantic.Scope, infered_typ # INTEGER. | # ------------------------------------------------------------------------------------------------- - @visitor.when(coolAst.PlusNode) #type: ignore # noqa - def visit(self, node: coolAst.PlusNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.PlusNode, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 left = self.visit(node.left, scope, self.INTEGER, deep) right = self.visit(node.right, scope, self.INTEGER, deep) if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): return self.INTEGER else: - self.errors.append(f'Invalid operation :{left.name} + {right.name}') + self.errors.append( + f'Invalid operation :{left.name} + {right.name}') return self.INTEGER - @visitor.when(coolAst.DifNode) #type: ignore # noqa - def visit(self, node: coolAst.DifNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.DifNode, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 left = self.visit(node.left, scope, self.INTEGER, deep) right = self.visit(node.right, scope, self.INTEGER, deep) if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): return self.INTEGER else: - self.errors.append(f'Invalid operation :{left.name} - {right.name}') + self.errors.append( + f'Invalid operation :{left.name} - {right.name}') return self.INTEGER - @visitor.when(coolAst.DivNode) #type: ignore # noqa - def visit(self, node: coolAst.DivNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.DivNode, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 left = self.visit(node.left, scope, self.INTEGER, deep) right = self.visit(node.right, scope, self.INTEGER, deep) if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): return self.INTEGER else: - self.errors.append(f'Invalid operation :{left.name} / {right.name}') + self.errors.append( + f'Invalid operation :{left.name} / {right.name}') return self.INTEGER - @visitor.when(coolAst.MulNode) #type: ignore # noqa - def visit(self, node: coolAst.MulNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.MulNode, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 left = self.visit(node.left, scope, self.INTEGER, deep) right = self.visit(node.right, scope, self.INTEGER, deep) if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): return self.INTEGER else: - self.errors.append(f'Invalid operation :{left.name} * {right.name}') + self.errors.append( + f'Invalid operation :{left.name} * {right.name}') return self.INTEGER # -------------------------------------------------------------------------------------------# @@ -354,58 +448,87 @@ def visit(self, node: coolAst.MulNode, scope: semantic.Scope, infered_type=None, # Para poder comparar dos expresiones, estas deben ser del mismo tipo. El tipo de retorno de | # toda operación comparativa es BOOLEAN. | # --------------------------------------------------------------------------------------------- - @visitor.when(coolAst.GreaterThanNode) #type: ignore # noqa - def visit(self, node: coolAst.GreaterThanNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.GreaterThanNode, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append(f'Invalid operation: {left.name} > {right.name}') + self.errors.append( + f'Invalid operation: {left.name} > {right.name}') return self.BOOL - @visitor.when(coolAst.GreaterEqualNode) #type: ignore # noqa - def visit(self, node: coolAst.GreaterEqualNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.GreaterEqualNode, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append(f'Invalid operation: {left.name} >= {right.name}') + self.errors.append( + f'Invalid operation: {left.name} >= {right.name}') return self.BOOL - @visitor.when(coolAst.LowerThanNode) #type: ignore # noqa - def visit(self, node: coolAst.LowerThanNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.LowerThanNode, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append(f'Invalid operation: {left.name} < {right.name}') + self.errors.append( + f'Invalid operation: {left.name} < {right.name}') return self.BOOL - @visitor.when(coolAst.LowerEqual) #type: ignore # noqa - def visit(self, node: coolAst.LowerEqual, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.LowerEqual, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append(f'Invalid operation: {left.name} <= {right.name}') + self.errors.append( + f'Invalid operation: {left.name} <= {right.name}') return self.BOOL - @visitor.when(coolAst.EqualToNode) #type: ignore # noqa - def visit(self, node: coolAst.EqualToNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.EqualToNode, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append(f'Invalid operation: {left.name} == {right.name}') + self.errors.append( + f'Invalid operation: {left.name} == {right.name}') return self.BOOL - @visitor.when(coolAst.NotNode) #type: ignore # noqa - def visit(self, node: coolAst.NotNode, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.NotNode, + scope: semantic.Scope, + infered_type=None, + deep=1): # noqa: F811 val_type = self.visit(node.lex, scope, infered_type, deep) if val_type == self.AUTO_TYPE or val_type == self.BOOL: return self.BOOL @@ -417,18 +540,34 @@ def visit(self, node: coolAst.NotNode, scope: semantic.Scope, infered_type=None, # --------------------------------------------------CONSTANTES-----------------------------------------------------------# # -----------------------------------------------------------------------------------------------------------------------# - @visitor.when(coolAst.IntegerConstant) #type: ignore # noqa - def visit(self, node, scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.IntegerConstant, + scope, + infered_type=None, + deep=1): # noqa: F811 return self.INTEGER - @visitor.when(coolAst.StringConstant) #type: ignore # noqa - def visit(self, node, scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.StringConstant, + scope, + infered_type=None, + deep=1): # noqa: F811 return self.STRING - @visitor.when(coolAst.TrueConstant) #type: ignore # noqa - def visit(self, node, scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.TrueConstant, + scope, + infered_type=None, + deep=1): # noqa: F811 return self.BOOL - @visitor.when(coolAst.FalseConstant) #type: ignore # noqa - def visit(self, node, scope, infered_type=None, deep=1): # noqa: F811 + @visit.register + def _(self, + node: coolAst.FalseConstant, + scope, + infered_type=None, + deep=1): # noqa: F811 return self.BOOL diff --git a/src/travels/typebuilder.py b/src/travels/typebuilder.py index f5011e40..cb6a4fc5 100755 --- a/src/travels/typebuilder.py +++ b/src/travels/typebuilder.py @@ -1,7 +1,7 @@ from typing import List, Any, Optional -import typecheck.visitor as visitor import abstract.tree as coolAst from abstract.semantics import SemanticError, Type, Context +from functools import singledispatchmethod class TypeBuilder: @@ -10,23 +10,25 @@ def __init__(self, context: Context, errors=[]): self.errors: List[Any] = errors self.current_type: Optional[Type] = None - @visitor.on('node') + @singledispatchmethod def visit(self, node): pass - @visitor.when(coolAst.ProgramNode) # type: ignore - def visit(self, node: coolAst.ProgramNode): # noqa: F811 + @visit.register + def _(self, node: coolAst.ProgramNode): # noqa: F811 for class_ in node.class_list: self.visit(class_) - @visitor.when(coolAst.ClassDef) # type: ignore - def visit(self, node: coolAst.ClassDef): # noqa: F811 + @visit.register + def _(self, node: coolAst.ClassDef): # noqa: F811 self.current_type = self.context.get_type(node.idx) parent = self.context.get_type(node.parent) # Detectar dependencias circulares if parent.conforms_to(self.current_type): - self.errors.append(f'Circular dependency: class {self.current_type.name} cannot inherit from {parent.name}') + self.errors.append( + f'Circular dependency: class {self.current_type.name} cannot inherit from {parent.name}' + ) else: self.current_type.set_parent(parent) @@ -45,23 +47,31 @@ def visit(self, node: coolAst.ClassDef): # noqa: F811 for feature in node.features: self.visit(feature) - @visitor.when(coolAst.AttributeDef) # type: ignore - def visit(self, node: coolAst.AttributeDef): # noqa: F811 + @visit.register + def _(self, node: coolAst.AttributeDef): # noqa: F811 try: - attr_type = self.context.get_type(node.typex) if isinstance(node.typex, str) else node.typex + attr_type = self.context.get_type(node.typex) if isinstance( + node.typex, str) else node.typex self.current_type.define_attribute(node.idx, attr_type) except SemanticError as e: self.errors.append(e.text) - @visitor.when(coolAst.MethodDef) # type: ignore - def visit(self, node): # noqa: F811 + @visit.register + def _(self, node: coolAst.MethodDef): # noqa: F811 params = [param.id for param in node.param_list] try: - params_type = [self.context.get_type(param.type) if isinstance(param.type, str) else param.type for param in node.param_list] + params_type = [ + self.context.get_type(param.type) if isinstance( + param.type, str) else param.type + for param in node.param_list + ] try: - return_type = self.context.get_type(node.return_type) if isinstance(node.return_type, str) else node.return_type + return_type = self.context.get_type( + node.return_type) if isinstance(node.return_type, + str) else node.return_type try: - self.current_type.define_method(node.idx, params, params_type, return_type) + self.current_type.define_method(node.idx, params, + params_type, return_type) except SemanticError as e: self.errors.append(e.text) diff --git a/src/travels/typecheck.py b/src/travels/typecheck.py index fb7f83d3..b09eb0ba 100755 --- a/src/travels/typecheck.py +++ b/src/travels/typecheck.py @@ -1,7 +1,6 @@ -from typecheck.visitor import on, when import abstract.semantics as semantics import abstract.tree as coolAst - +from functools import singledispatchmethod # Types aliases Context = semantics.Context @@ -21,18 +20,18 @@ def __init__(self, context: Context, errors=[]): self.AUTO_TYPE = self.context.get_type('AUTO_TYPE') self.errors = errors - @on('node') + @singledispatchmethod def visit(self, node, scope): pass - @when(ProgramNode) # type: ignore - def visit(self, node: ProgramNode, scope=None): # noqa: F811 + @visit.register + def _(self, node: ProgramNode, scope=None): # noqa: F811 scope = Scope() for class_ in node.class_list: self.visit(class_, scope.create_child()) - @when(ClassDef) # type: ignore - def visit(self, node: ClassDef, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: ClassDef, scope: Scope): # noqa: F811 self.current_type = self.context.get_type(node.idx) for feature in node.features: if isinstance(feature, AttributeDef): @@ -42,13 +41,13 @@ def visit(self, node: ClassDef, scope: Scope): # noqa: F811 if isinstance(feature, MethodDef): self.visit(feature, scope.create_child()) - @when(AttributeDef) # type: ignore - def visit(self, node: AttributeDef, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: AttributeDef, scope: Scope): # noqa: F811 att = self.current_type.get_attribute(node.idx) if att.type == self.AUTO_TYPE: self.errors.append(f'Cannot infer type of attribute {att.name}') scope.define_variable(att.name, att.type) - @when(MethodDef) # type: ignore - def visit(self, node: MethodDef, scope: Scope): # noqa: F811 + @visit.register + def _(self, node: MethodDef, scope: Scope): # noqa: F811 method = self.current_type.get_method(node.idx) diff --git a/src/travels/typecollector.py b/src/travels/typecollector.py index 1d7a6c2e..6f886f1f 100755 --- a/src/travels/typecollector.py +++ b/src/travels/typecollector.py @@ -1,6 +1,6 @@ -import typecheck.visitor as visitor import abstract.tree as coolAst from abstract.semantics import SemanticError, VoidType, IntegerType, StringType, ObjectType, Context, BoolType, AutoType +from functools import singledispatchmethod class TypeCollector: @@ -8,14 +8,15 @@ def __init__(self, errors=[]): self.context = None self.errors = errors - @visitor.on('node') + @singledispatchmethod def visit(self, node): pass - @visitor.when(coolAst.ProgramNode) # type: ignore - def visit(self, node): # noqa: F811 + @visit.register # type: ignore + def _(self, node: coolAst.ProgramNode): # noqa: F811 self.context = Context() - OBJECT, INTEGER, STRING, BOOL, VOID = ObjectType(), IntegerType(), StringType(), BoolType(), VoidType() + OBJECT, INTEGER, STRING, BOOL, VOID = ObjectType(), IntegerType( + ), StringType(), BoolType(), VoidType() INTEGER.set_parent(OBJECT) STRING.set_parent(OBJECT) BOOL.set_parent(OBJECT) @@ -29,8 +30,8 @@ def visit(self, node): # noqa: F811 for class_ in node.class_list: self.visit(class_) - @visitor.when(coolAst.ClassDef) # type:ignore - def visit(self, node: coolAst.ClassDef): # noqa: F811 + @visit.register + def _(self, node: coolAst.ClassDef): # noqa: F811 try: self.context.create_type(node.idx) except SemanticError as e: From 34acb8c2e74d52fdc07b7a7e6907134bbbf0a4c8 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Tue, 28 Jul 2020 15:10:17 -0400 Subject: [PATCH 064/162] completed visitor implementation with singledispatchmethod --- src/travels/ciltomips.py | 139 +++++++++++++++++++-------------------- 1 file changed, 69 insertions(+), 70 deletions(-) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index af06699c..8cac6489 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -2,21 +2,20 @@ DotGlobalDirective, DotTextDirective, instrNodes, arithNodes, cmpNodes, branchNodes, lsNodes) -import typecheck.visitor as visitor import cil.nodes as cil -from typing import List from mips.instruction import (a0, a1, a2, a3, at, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, s0, s1, s2, s3, s4, s5, s6, s7, sp, ra, fp, k0, k1, gp, v0, v1, zero, TEMP_REGISTERS) +from functools import singledispatchmethod class CilToMipsVisitor(BaseCilToMipsVisitor): - @visitor.on('node') + @singledispatchmethod def visit(self, node): pass - @visitor.when(cil.CilProgramNode) # type: ignore - def visit(self, node: cil.CilProgramNode): # noqa: F811 + @visit.register + def _(self, node: cil.CilProgramNode): # El programa de CIL se compone por las 3 secciones # .TYPES, .DATA y .CODE @@ -38,8 +37,8 @@ def visit(self, node: cil.CilProgramNode): # noqa: F811 self.register_instruction(lsNodes.LI(v0, 10)) self.register_instruction(instrNodes.SYSCALL()) - @visitor.when(cil.TypeNode) # type: ignore - def visit(self, node: cil.TypeNode): # noqa: F811 + @visit.register + def _(self, node: cil.TypeNode): # noqa: F811 # registrar el tipo actual que estamos construyendo self.current_type = node @@ -82,14 +81,14 @@ def visit(self, node: cil.TypeNode): # noqa: F811 self.current_type = None - @visitor.when(cil.DataNode) #type: ignore - def visit(self, node: cil.DataNode): + @visit.register + def _(self, node: cil.DataNode): # Registrar los DataNode en la seccion .data self.register_instruction(DotDataDirective()) if isinstance(node.value, str): self.register_instruction( instrNodes.FixedData(node.name, - rf"{node.value}", + f"{node.value}", type_='asciiz')) elif isinstance(node.value, dict): # Lo unico que puede ser un diccionario es la TDT. Me parece..... mehh !!?? @@ -105,8 +104,8 @@ def visit(self, node: cil.DataNode): self.register_instruction( instrNodes.FixedData(node.name, node.value)) - @visitor.when(cil.FunctionNode) # type: ignore - def visit(self, node: cil.FunctionNode): + @visit.register + def _(self, node: cil.FunctionNode): ret = 0 self.current_function = node # El codigo referente a cada funcion debe ir en la seccion de texto. @@ -148,20 +147,20 @@ def visit(self, node: cil.FunctionNode): self.current_function = None - @visitor.when(cil.LabelNode) #type: ignore - def visit(self, node: cil.LabelNode): + @visit.register + def _(self, node: cil.LabelNode): self.register_instruction(instrNodes.Label(node.label)) - @visitor.when(cil.ParamNode) #type: ignore - def visit(self, node: cil.ParamNode): + @visit.register + def _(self, node: cil.ParamNode): return self.get_location_address(node) - @visitor.when(cil.LocalNode) #type: ignore - def visit(self, node: cil.LocalNode): + @visit.register + def _(self, node: cil.LocalNode): return self.get_location_address(node) - @visitor.when(cil.AssignNode) #type: ignore - def visit(self, node: cil.AssignNode): + @visit.register + def _(self, node: cil.AssignNode): assert self.current_function is not None # Una asignacion simplemente consiste en mover un resultado de un lugar a otro dest = self.visit(node.dest) @@ -192,8 +191,8 @@ def visit(self, node: cil.AssignNode): self.register_instruction(lsNodes.SW(reg, dest)) self.used_registers[reg] = False - @visitor.when(cil.PlusNode) #type: ignore - def visit(self, node: cil.PlusNode): + @visit.register + def _(self, node: cil.PlusNode): assert self.current_function is not None dest = self.visit(node.dest) left = self.visit(node.left) @@ -226,8 +225,8 @@ def visit(self, node: cil.PlusNode): self.register_instruction(lsNodes.SW(reg, dest)) self.used_registers[reg] = self.used_registers[right_reg] = False - @visitor.when(cil.MinusNode) #type: ignore - def visit(self, node: cil.MinusNode): + @visit.register + def _(self, node: cil.MinusNode): assert self.current_function is not None dest = self.visit(node.dest) left = self.visit(node.x) @@ -260,8 +259,8 @@ def visit(self, node: cil.MinusNode): self.register_instruction(lsNodes.SW(reg, dest)) self.used_registers[reg] = self.used_registers[right_reg] = False - @visitor.when(cil.StarNode) #type: ignore - def visit(self, node: cil.StarNode): + @visit.register + def _(self, node: cil.StarNode): assert self.current_function is not None dest = self.visit(node.dest) left = self.visit(node.x) @@ -294,8 +293,8 @@ def visit(self, node: cil.StarNode): self.register_instruction(lsNodes.SW(reg, dest)) self.used_registers[reg] = self.used_registers[right_reg] = False - @visitor.when(cil.DivNode) #type: ignore - def visit(self, node: cil.DivNode): + @visit.register + def _(self, node: cil.DivNode): assert self.current_function is not None dest = self.visit(node.dest) left = self.visit(node.left) @@ -328,88 +327,88 @@ def visit(self, node: cil.DivNode): self.register_instruction(lsNodes.SW(reg, dest)) self.used_registers[reg] = self.used_registers[right_reg] = False - @visitor.when(cil.GetAttributeNode) # type: ignore - def visit(self, node: cil.GetAttributeNode): + @visit.register + def _(self, node: cil.GetAttributeNode): pass - @visitor.when(cil.SetAttributeNode) #type: ignore - def visit(self, node: cil.SetAttributeNode): + @visit.register + def _(self, node: cil.SetAttributeNode): pass - @visitor.when(cil.AllocateNode) #type: ignore - def visit(self, node: cil.AllocateNode): + @visit.register + def _(self, node: cil.AllocateNode): pass - @visitor.when(cil.TypeOfNode) #type: ignore - def visit(self, node: cil.TypeOfNode): + @visit.register + def _(self, node: cil.TypeOfNode): pass - @visitor.when(cil.JumpIfGreaterThanZeroNode) #type: ignore - def visit(self, node: cil.JumpIfGreaterThanZeroNode): + @visit.register + def _(self, node: cil.JumpIfGreaterThanZeroNode): pass - @visitor.when(cil.IfZeroJump) # type: ignore - def visit(self, node: cil.IfZeroJump): + @visit.register + def _(self, node: cil.IfZeroJump): pass - @visitor.when(cil.NotZeroJump) # type: ignore - def visit(self, node: cil.NotZeroJump): + @visit.register + def _(self, node: cil.NotZeroJump): pass - @visitor.when(cil.UnconditionalJump) # type: ignore - def visit(self, node: cil.UnconditionalJump): + @visit.register + def _(self, node: cil.UnconditionalJump): pass - @visitor.when(cil.StaticCallNode) # type: ignore - def visit(self, node: cil.StaticCallNode): + @visit.register + def _(self, node: cil.StaticCallNode): pass - @visitor.when(cil.DynamicCallNode) # type: ignore - def visit(self, node: cil.DynamicCallNode): + @visit.register + def _(self, node: cil.DynamicCallNode): pass - @visitor.when(cil.ArgNode) # type: ignore - def visit(self, node: cil.ArgNode): + @visit.register + def _(self, node: cil.ArgNode): pass - @visitor.when(cil.ReturnNode) # type: ignore - def visit(self, node: cil.ReturnNode): + @visit.register + def _(self, node: cil.ReturnNode): pass - @visitor.when(cil.LoadNode) # type: ignore - def visit(self, node: cil.LoadNode): + @visit.register + def _(self, node: cil.LoadNode): pass - @visitor.when(cil.LengthNode) # type: ignore - def visit(self, node: cil.LengthNode): + @visit.register + def _(self, node: cil.LengthNode): pass - @visitor.when(cil.SubstringNode) # type: ignore - def visit(self, node: cil.LengthNode): + @visit.register + def _(self, node: cil.LengthNode): pass - @visitor.when(cil.ConcatNode) # type: ignore - def visit(self, node: cil.ConcatNode): + @visit.register + def _(self, node: cil.ConcatNode): pass - @visitor.when(cil.PrefixNode) # type: ignore - def visit(self, node: cil.PrefixNode): + @visit.register + def _(self, node: cil.PrefixNode): pass - @visitor.when(cil.ToStrNode) # type: ignore - def visit(self, node: cil.ToStrNode): + @visit.register + def _(self, node: cil.ToStrNode): pass - @visitor.when(cil.ReadNode) # type: ignore - def visit(self, node: cil.ReadNode): + @visit.register + def _(self, node: cil.ReadNode): pass - @visitor.when(cil.PrintNode) # type: ignore - def visit(self, node: cil.PrintNode): + @visit.register + def _(self, node: cil.PrintNode): pass - @visitor.when(cil.TdtLookupNode) # type: ignore - def visit(self, node: cil.TdtLookupNode): + @visit.register + def _(self, node: cil.TdtLookupNode): # Los nodos TDT siempre tienen pass From 9bf7396ef64025f30bb5e4a7ab800492ade254c1 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sat, 1 Aug 2020 23:10:05 -0400 Subject: [PATCH 065/162] Added type annotations to cool AST --- src/abstract/tree.py | 97 ++++++++++++++++++++----------------- src/mips/baseMipsVisitor.py | 2 +- src/travels/ciltomips.py | 11 +++-- 3 files changed, 61 insertions(+), 49 deletions(-) diff --git a/src/abstract/tree.py b/src/abstract/tree.py index bb153dad..d7a79fed 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -1,3 +1,6 @@ +from typing import List, Optional, Tuple, Union + + class Node: pass @@ -12,7 +15,7 @@ class ExpressionNode(Node): class ProgramNode(Node): def __init__(self, class_list): - self.class_list = class_list + self.class_list: List[ClassDef] = class_list def check_semantics(self, deep=1): from travels import typecollector, typebuilder, inference @@ -21,6 +24,7 @@ def check_semantics(self, deep=1): type_collector.visit(self) # Construir los tipos detectados en el contexto + assert type_collector.context is not None type_builder = typebuilder.TypeBuilder(type_collector.context, type_collector.errors) type_builder.visit(self) @@ -37,35 +41,38 @@ def check_semantics(self, deep=1): return errors, type_builder.context, scope -class MethodDef(DeclarationNode): - def __init__(self, idx, param_list, return_type, statements): - self.idx = idx - self.param_list = param_list - self.return_type = return_type - self.statements = statements +class Param(DeclarationNode): + def __init__(self, idx, typex): + self.id, self.type = idx, typex -class AttributeDef(DeclarationNode): - def __init__(self, idx, typex, default_value=None): - self.idx = idx - self.typex = typex - self.default_value = default_value +class MethodDef(DeclarationNode): + def __init__(self, idx: str, param_list: List[Param], return_type: str, + statements: List[ExpressionNode]): + self.idx: str = idx + self.param_list: List[Param] = param_list + self.return_type: str = return_type + self.statements: List[ExpressionNode] = statements -class Param(DeclarationNode): - def __init__(self, idx, typex): - self.id, self.type = idx, typex +class AttributeDef(DeclarationNode): + def __init__(self, idx: str, typex: str, default_value=None): + self.idx: str = idx + self.typex: str = typex + self.default_value: Optional[ExpressionNode] = default_value -class VariableDeclaration(DeclarationNode): +class VariableDeclaration(ExpressionNode): def __init__(self, var_list, block_statements=None): - self.var_list = var_list - self.block_statements = block_statements + self.var_list: List[Tuple[str, str, + Optional[ExpressionNode]]] = var_list + self.block_statements: Optional[ExpressionNode] = block_statements class BinaryNode(ExpressionNode): def __init__(self, left, right): - self.left, self.right = left, right + self.left: ExpressionNode = left + self.right: ExpressionNode = right class AtomicNode(ExpressionNode): @@ -75,9 +82,9 @@ def __init__(self, lex): class IfThenElseNode(ExpressionNode): def __init__(self, cond, expr1, expr2): - self.cond = cond - self.expr1 = expr1 - self.expr2 = expr2 + self.cond: ExpressionNode = cond + self.expr1: ExpressionNode = expr1 + self.expr2: ExpressionNode = expr2 class PlusNode(BinaryNode): @@ -102,23 +109,23 @@ def __init__(self, left, right): class FunCall(ExpressionNode): def __init__(self, obj, idx, arg_list): - self.obj = obj - self.id = idx - self.args = arg_list + self.obj: Union[str, ExpressionNode] = obj + self.id: str = idx + self.args: List[ExpressionNode] = arg_list class ParentFuncCall(ExpressionNode): def __init__(self, obj, parent_type, idx, arg_list): - self.obj = obj - self.parent_type = parent_type - self.idx = idx - self.arg_list = arg_list + self.obj: ExpressionNode = obj + self.parent_type: str = parent_type + self.idx: str = idx + self.arg_list: List[ExpressionNode] = arg_list class AssignNode(ExpressionNode): def __init__(self, idx, expr): - self.idx = idx - self.expr = expr + self.idx: str = idx + self.expr: ExpressionNode = expr class IntegerConstant(AtomicNode): @@ -173,14 +180,14 @@ def __init__(self): class ClassDef(DeclarationNode): def __init__(self, idx, features, parent='Object'): - self.idx = idx - self.features = features - self.parent = parent + self.idx: str = idx + self.features: List[Union[MethodDef, AttributeDef]] = features + self.parent: str = parent class VariableCall(ExpressionNode): def __init__(self, idx): - self.idx = idx + self.idx: str = idx class GreaterThanNode(BinaryNode): @@ -220,34 +227,34 @@ def __init__(self, lex): class InstantiateClassNode(ExpressionNode): def __init__(self, type_, args=None): - self.type_ = type_ + self.type_: str = type_ self.args = args class WhileBlockNode(ExpressionNode): def __init__(self, cond, statements): - self.cond = cond - self.statements = statements + self.cond: ExpressionNode = cond + self.statements: ExpressionNode = statements class ActionNode(ExpressionNode): def __init__(self, idx, typex, expresion): - self.actions = expresion - self.idx = idx - self.typex = typex + self.actions: ExpressionNode = expresion + self.idx: str = idx + self.typex: str = typex class CaseNode(ExpressionNode): def __init__(self, expression, actions): - self.expression = expression - self.actions = actions + self.expression: ExpressionNode = expression + self.actions: ActionNode = actions class BlockNode(ExpressionNode): def __init__(self, expressions): - self.expressions = expressions + self.expressions: List[ExpressionNode] = expressions class IsVoidNode(ExpressionNode): def __init__(self, expr): - self.expr = expr + self.expr: ExpressionNode = expr diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 91f8b85c..0e7e2e0e 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -127,7 +127,7 @@ def get_location_address(self, node: Union[cil.ParamNode, index += 1 return f"-{index * 4}($fp)" - def get_available_register(self): + def get_available_register(self) -> Optional[int]: for register in instrNodes.TEMP_REGISTERS: if not self.used_registers[register]: self.used_registers[register] = True diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 8cac6489..32f25267 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -187,9 +187,10 @@ def _(self, node: cil.AssignNode): elif isinstance(source, str): # Source es una direccion de memoria reg1 = self.get_available_register() - self.register_instruction(lsNodes.LW(reg, source)) - self.register_instruction(lsNodes.SW(reg, dest)) - self.used_registers[reg] = False + assert reg1 is not None + self.register_instruction(lsNodes.LW(reg1, source)) + self.register_instruction(lsNodes.SW(reg1, dest)) + self.used_registers[reg1] = False @visit.register def _(self, node: cil.PlusNode): @@ -201,12 +202,16 @@ def _(self, node: cil.PlusNode): if isinstance(left, str): # left es una direccion de memoria reg = self.get_available_register() + assert reg is not None right_reg = self.get_available_register() + assert right_reg is not None self.register_instruction(lsNodes.LW(reg, left)) if not isinstance(right, int): + # right no es una constante self.register_instruction(lsNodes.LW(right_reg, right)) self.register_instruction(arithNodes.ADD(reg, reg, right_reg)) else: + # rigth es una constante self.register_instruction(arithNodes.ADD( reg, reg, right, True)) self.register_instruction(lsNodes.SW(reg, dest)) From 14e93390edb742816bb2d1c0e2ab8627d879d558 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sat, 1 Aug 2020 23:25:47 -0400 Subject: [PATCH 066/162] Fixed Pylance errors over inference.py --- src/travels/inference.py | 62 +++++++++----------------------------- src/travels/typebuilder.py | 12 -------- 2 files changed, 15 insertions(+), 59 deletions(-) diff --git a/src/travels/inference.py b/src/travels/inference.py index 959f24a4..0e64ea44 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -1,4 +1,5 @@ import abstract.semantics as semantic +from abstract.semantics import Type import abstract.tree as coolAst from travels.context_actions import update_attr_type, update_method_param, update_scope_variable from typing import Optional @@ -38,8 +39,10 @@ def __init__(self, context: semantic.Context, errors=[]): self.current_method: Optional[semantic.Method] = None @singledispatchmethod - def visit(self, node, scope, infered_type=None): - pass + def visit(self, node, scope, infered_type=None) -> Type: + # Devolver un tipo por defecto, en verdad + # no importa ya que este metodo nunca sera llamado. + return Type('') # --------------------------------------------------------------------------------------------------------------------------# # -----------------------------------------------------EXPRESIONES----------------------------------------------------------# @@ -166,6 +169,7 @@ def _(self, infered_type=None, deep=1): # noqa: F811 var_info = scope.find_variable(node.idx) + assert self.current_type is not None if var_info: e = self.visit(node.expr, scope, infered_type) if var_info.type == self.AUTO_TYPE: @@ -196,6 +200,7 @@ def _(self, infered_type=None, deep=1): # noqa: F811 var_info = scope.find_variable(node.idx) + assert self.current_type is not None if var_info: if infered_type and var_info.type == self.AUTO_TYPE: print(f'Infered type {infered_type.name} for {var_info.name}') @@ -237,20 +242,6 @@ def _(self, e2_parent = e2_parent.parent return e1_parent - # @visitor.when(coolAst.VariableDeclaration) #type: ignore # noqa - # # TODO FIX THIS, IT is not working after change in grammar, REIMPLEMENT IT!!!! - # def visit(self, node: coolAst.VariableDeclaration, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 - # for var_idx, var_type, var_init_exp in node.var_list: - # type_ = self.context.get_type(var_type) - # if type_ != self.AUTO_TYPE: - # if deep == 1: - # scope.define_variable(var_idx, type_, "LOCAL") - # else: - # if deep == 1: - # type_ = self.visit(node.block_statements, scope, infered_type, deep) - # print(f'Infered type {type_.name} for {var_idx}') - # scope.define_variable(node.idx, type_, "LOCAL") - # return void @visit.register def _(self, node: coolAst.VariableDeclaration, @@ -270,7 +261,7 @@ def _(self, # - La variable se inicializa en AUTO_TYPE y no existe la expr, en este caso se define la variable # y su tipo se deja a inferir por el contexto. if var_init_expr: - init_expr_type: semantic.Type = self.visit( + init_expr_type: Optional[Type] = self.visit( var_init_expr, scope, infered_type, deep) if type_ != self.AUTO_TYPE: if not init_expr_type.conforms_to(type_): @@ -294,27 +285,6 @@ def _(self, deep) return return_type - # @visitor.when(coolAst.FunCall) #type: ignore # noqa - # def visit(self, node: coolAst.FunCall, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 - # if isinstance(node.obj, semantic.Type): - # method = node.obj.get_method(node.id) - # elif node.obj == 'self': - # method = self.current_type.get_method(node.id) - # else: - # method = self.context.get_type(node.obj).get_method(node.id) - - # for arg in node.args: - # self.visit(arg, scope, infered_type, deep) - - # if method.return_type != self.AUTO_TYPE: - # return method.return_type - # elif infered_type: - # print(f'Infered type {infered_type.name} for {node.id}') - # method.return_type = infered_type - # return infered_type - # else: - # return self.AUTO_TYPE - @visit.register def _(self, node: coolAst.FunCall, @@ -364,9 +334,7 @@ def _(self, scope: semantic.Scope, infered_type=None, deep=1): # noqa: F811 - ret_type = None - for st in node.statements: - ret_type = self.visit(st, scope, infered_type, deep) + ret_type = self.visit(node.statements, scope, infered_type, deep) return ret_type # ---------------------------------------------------------------------------------------------------------------------------# @@ -513,7 +481,7 @@ def _(self, node: coolAst.EqualToNode, scope: semantic.Scope, infered_type=None, - deep=1): # noqa: F811 + deep=1) -> Type: left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: @@ -528,7 +496,7 @@ def _(self, node: coolAst.NotNode, scope: semantic.Scope, infered_type=None, - deep=1): # noqa: F811 + deep=1) -> Type: val_type = self.visit(node.lex, scope, infered_type, deep) if val_type == self.AUTO_TYPE or val_type == self.BOOL: return self.BOOL @@ -545,7 +513,7 @@ def _(self, node: coolAst.IntegerConstant, scope, infered_type=None, - deep=1): # noqa: F811 + deep=1) -> Type: return self.INTEGER @visit.register @@ -553,7 +521,7 @@ def _(self, node: coolAst.StringConstant, scope, infered_type=None, - deep=1): # noqa: F811 + deep=1) -> Type: return self.STRING @visit.register @@ -561,7 +529,7 @@ def _(self, node: coolAst.TrueConstant, scope, infered_type=None, - deep=1): # noqa: F811 + deep=1) -> Type: return self.BOOL @visit.register @@ -569,5 +537,5 @@ def _(self, node: coolAst.FalseConstant, scope, infered_type=None, - deep=1): # noqa: F811 + deep=1) -> Type: return self.BOOL diff --git a/src/travels/typebuilder.py b/src/travels/typebuilder.py index cb6a4fc5..edeeba9e 100755 --- a/src/travels/typebuilder.py +++ b/src/travels/typebuilder.py @@ -32,18 +32,6 @@ def _(self, node: coolAst.ClassDef): # noqa: F811 else: self.current_type.set_parent(parent) - # for method in parent.methods.values(): - # try: - # self.current_type.define_method(method.name, method.param_names, method.param_types, method.return_type) - # except SemanticError as e: - # self.errors.append(e.text) - - # for att in parent.attributes: - # try: - # self.current_type.define_attribute(att.name, att.type) - # except SemanticError as e: - # self.errors.append(e.text) - for feature in node.features: self.visit(feature) From 1a86fbd70fa3757643bab3d0fb6917c79fb54629 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sun, 30 Aug 2020 13:07:31 -0400 Subject: [PATCH 067/162] More type annotations --- src/abstract/semantics.py | 51 +++++--- src/abstract/tree.py | 2 +- src/abstract/typetree.py | 34 ------ src/automatons/nondeterministic.py | 32 +---- src/automatons/operations.py | 100 ++++++++-------- src/automatons/state.py | 39 ++---- src/automatons/transformation.py | 11 +- src/cil/nodes.py | 33 +++--- src/grammar/grammar.py | 92 ++++++++------- src/grammar/items.py | 51 ++++---- src/grammar/symbols.py | 183 ++++++++++++++--------------- src/lexer/regexgenerator.py | 1 - src/lexer/tokens.py | 10 +- src/parserr/ll1.py | 19 ++- src/parserr/lr.py | 21 ++-- src/parserr/shiftreduce.py | 17 ++- src/parserr/slr.py | 46 ++++---- src/tknizer.py | 14 ++- src/travels/ctcill.py | 38 +++--- src/travels/inference.py | 10 +- 20 files changed, 389 insertions(+), 415 deletions(-) delete mode 100755 src/abstract/typetree.py diff --git a/src/abstract/semantics.py b/src/abstract/semantics.py index abaa2272..93f4f7c9 100755 --- a/src/abstract/semantics.py +++ b/src/abstract/semantics.py @@ -21,19 +21,19 @@ def set_parent(self, parent) -> None: self.parent = parent def get_attribute(self, name): - # type: (str) -> Attribute try: return next(attr for attr in self.attributes if attr.name == name) except StopIteration: if self.parent is None: - raise SemanticError(f'Attribute "{name}" is not defined in {self.name}.') + raise SemanticError( + f'Attribute "{name}" is not defined in {self.name}.') try: return self.parent.get_attribute(name) except SemanticError: - raise SemanticError(f'Attribute "{name}" is not defined in {self.name}.') + raise SemanticError( + f'Attribute "{name}" is not defined in {self.name}.') def define_attribute(self, name, typex): - # type: (str, Type) -> Optional[Attribute] try: self.get_attribute(name) except SemanticError: @@ -41,30 +41,35 @@ def define_attribute(self, name, typex): self.attributes.append(attribute) return attribute else: - raise SemanticError(f'Attribute "{name}" is already defined in {self.name}.') + raise SemanticError( + f'Attribute "{name}" is already defined in {self.name}.') def get_method(self, name): - # type: (str) -> Method try: return self.methods[name] except KeyError: if self.parent is None: - raise SemanticError(f'Method "{name}" is not defined in {self.name}.') + raise SemanticError( + f'Method "{name}" is not defined in {self.name}.') try: return self.parent.get_method(name) except SemanticError: - raise SemanticError(f'Method "{name}" is not defined in {self.name}.') + raise SemanticError( + f'Method "{name}" is not defined in {self.name}.') def define_method(self, name, param_names, param_types, return_type): - # type: (str, List[str], List[Type], Type) -> Method if name in self.methods: - raise SemanticError(f'Method "{name}" already defined in {self.name}.') + raise SemanticError( + f'Method "{name}" already defined in {self.name}.') - method = self.methods[name] = Method(name, param_names, param_types, return_type) + method = self.methods[name] = Method(name, param_names, param_types, + return_type) return method def conforms_to(self, other) -> bool: - return other.bypass() or self == other or self.parent is not None and self.parent.conforms_to(other) + return other.bypass( + ) or self == other or self.parent is not None and self.parent.conforms_to( + other) def bypass(self) -> bool: return False @@ -90,14 +95,16 @@ def __eq__(self, other): class Method: - def __init__(self, name: str, param_names: List[str], params_types: List[Type], return_type: Type): + def __init__(self, name: str, param_names: List[str], + params_types: List[Type], return_type: Type): self.name = name self.param_names = param_names self.param_types = params_types self.return_type = return_type def __str__(self): - params = ', '.join(f'{n}:{t.name}' for n, t in zip(self.param_names, self.param_types)) + params = ', '.join(f'{n}:{t.name}' + for n, t in zip(self.param_names, self.param_types)) return f'[method] {self.name}({params}): {self.return_type.name};' def __eq__(self, other): @@ -173,7 +180,8 @@ def __init__(self): def create_type(self, name: str) -> Type: if name in self.types: - raise SemanticError(f'Type with the same name ({name}) already in context.') + raise SemanticError( + f'Type with the same name ({name}) already in context.') typex = self.types[name] = Type(name) return typex @@ -184,7 +192,8 @@ def get_type(self, name: str) -> Type: raise SemanticError(f'Type "{name}" is not defined.') def __str__(self): - return '{\n\t' + '\n\t'.join(y for x in self.types.values() for y in str(x).split('\n')) + '\n}' + return '{\n\t' + '\n\t'.join(y for x in self.types.values() + for y in str(x).split('\n')) + '\n}' def __repr__(self): return str(self) @@ -208,17 +217,21 @@ def __len__(self): return len(self.locals) def create_child(self): - # type: () -> Scope child: Scope = Scope(self) self.children.append(child) return child - def define_variable(self, vname: str, vtype: Type, location=None) -> VariableInfo: + def define_variable(self, + vname: str, + vtype: Type, + location=None) -> VariableInfo: info = VariableInfo(vname, vtype, location) self.locals.append(info) return info - def find_variable(self, vname: str, index: int = None) -> Optional[VariableInfo]: + def find_variable(self, + vname: str, + index: int = None) -> Optional[VariableInfo]: locals = self.locals if index is None else itt.islice( self.locals, index) try: diff --git a/src/abstract/tree.py b/src/abstract/tree.py index d7a79fed..e42bb98b 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -247,7 +247,7 @@ def __init__(self, idx, typex, expresion): class CaseNode(ExpressionNode): def __init__(self, expression, actions): self.expression: ExpressionNode = expression - self.actions: ActionNode = actions + self.actions: List[ActionNode] = actions class BlockNode(ExpressionNode): diff --git a/src/abstract/typetree.py b/src/abstract/typetree.py deleted file mode 100755 index 1a277374..00000000 --- a/src/abstract/typetree.py +++ /dev/null @@ -1,34 +0,0 @@ -from abstract.semantics import Type, IntegerType, BoolType, VoidType, ObjectType, StringType - - -class TreeNode: - def __init__(self, root, children=[]): - self.root = root - self.children = children - self.parent = None - - def _add_node(self, new_node: Type): - child = TreeNode(new_node) - child.parent = self - self.children.append(new_node) - - -class TypeTree: - def __init__(self): - self.tree = TreeNode(ObjectType(), [ - TreeNode(IntegerType()), - TreeNode(StringType()), - TreeNode(BoolType()) - ]) - - def insert(self, node: Type): - stack = [self.tree] - with None as parent: - while True: - current_node = stack.pop() - parent = current_node.root - if node.parent == parent: - break - for child in current_node.children: - stack.append(child) - current_node._add_node(node) diff --git a/src/automatons/nondeterministic.py b/src/automatons/nondeterministic.py index 57b4f9bc..144ba1c0 100755 --- a/src/automatons/nondeterministic.py +++ b/src/automatons/nondeterministic.py @@ -18,7 +18,6 @@ class NFA: Incluso permite realizar epsilon-transiciones (transiciones que no consumen símbolos de la cinta) lo cual resalta aún más el carácter no determinista de estos autómatas. """ - def __init__(self, states, finals, transitions, start=0): self.states = states self.start = start @@ -28,8 +27,8 @@ def __init__(self, states, finals, transitions, start=0): self.transitions = {state: {} for state in range(states)} for (origin, symbol), destinations in transitions.items(): - assert hasattr( - destinations, '__iter__'), 'Invalid collection of states' + assert hasattr(destinations, + '__iter__'), 'Invalid collection of states' self.transitions[origin][symbol] = destinations self.vocabulary.add(symbol) @@ -41,30 +40,3 @@ def epsilon_transitions(self, state): return self.transitions[state][''] except KeyError: return () - - def graph(self): - import pydot - G = pydot.Dot(rankdir='LR', margin=0.1) - G.add_node(pydot.Node('start', shape='plaintext', - label='', width=0, height=0)) - - # for (start, tran), destinations in self.transitions.items(): - for start, dest in self.transitions.items(): - for tran, destinations in dest.items(): - tran = 'ε' if tran == '' else tran - G.add_node(pydot.Node(start, shape='circle', - style='bold' if start in self.finals else '')) - for end in destinations: - G.add_node(pydot.Node(end, shape='circle', - style='bold' if end in self.finals else '')) - G.add_edge(pydot.Edge( - start, end, label=tran, labeldistance=2)) - - G.add_edge(pydot.Edge('start', self.start, label='', style='dashed')) - return G - - def _repr_svg_(self): - try: - return self.graph().create_svg().decode('utf8') - except: - pass diff --git a/src/automatons/operations.py b/src/automatons/operations.py index f0aa278f..5b45f06f 100755 --- a/src/automatons/operations.py +++ b/src/automatons/operations.py @@ -1,87 +1,89 @@ from automatons.nondeterministic import NFA -def automata_union(a1,a2): - transitions={} - start=0 - d1=1 - d2=a1.states+d1 - u=a2.states+d2 + +def automata_union(a1: NFA, a2: NFA): + transitions = {} + start = 0 + d1 = 1 + d2 = a1.states + d1 + u = a2.states + d2 for src, d in a1.transitions.items(): for symbol, dest in d.items(): - transitions[src+d1,symbol]=[state+d1 for state in dest] + transitions[src + d1, symbol] = [state + d1 for state in dest] for src, d in a2.transitions.items(): for symbol, dest in d.items(): - transitions[src+d2,symbol]=[state+d2 for state in dest] + transitions[src + d2, symbol] = [state + d2 for state in dest] + + transitions[start, ''] = [a1.start + d1, a2.start + d2] - transitions[start,'']=[a1.start+d1,a2.start+d2] - - for dx,S in zip([d1,d2],[a1.finals,a2.finals]): + for dx, S in zip([d1, d2], [a1.finals, a2.finals]): for z in S: try: - eps_trans=transitions[z+dx,''] + eps_trans = transitions[z + dx, ''] except KeyError: - eps_trans=transitions[z+dx,'']=[] + eps_trans = transitions[z + dx, ''] = [] eps_trans.append(u) - states=a1.states+a2.states+2 - finals={u} - return NFA(states,finals,transitions,start) + states = a1.states + a2.states + 2 + finals = {u} + return NFA(states, finals, transitions, start) -def automata_concatenation(a1,a2): - transitions={} - start=0 - d1=0 - d2=a1.states+d1 - u=a2.states+d2 + +def automata_concatenation(a1, a2): + transitions = {} + start = 0 + d1 = 0 + d2 = a1.states + d1 + u = a2.states + d2 for src, d in a1.transitions.items(): for symbol, dest in d.items(): - transitions[src+d1,symbol]=[state+d1 for state in dest] + transitions[src + d1, symbol] = [state + d1 for state in dest] for src, d in a2.transitions.items(): for symbol, dest in d.items(): - transitions[src+d2,symbol]=[state + d2 for state in dest] - + transitions[src + d2, symbol] = [state + d2 for state in dest] + for z in a1.finals: try: - eps_trans=transitions[z+d1,''] + eps_trans = transitions[z + d1, ''] except KeyError: - eps_trans=transitions[z+d1,'']=[] - eps_trans.append(a2.start+d2) - + eps_trans = transitions[z + d1, ''] = [] + eps_trans.append(a2.start + d2) + for z in a2.finals: try: - eps_trans=transitions[z+d2,''] + eps_trans = transitions[z + d2, ''] except KeyError: - eps_trans=transitions[z+d2,'']=[] + eps_trans = transitions[z + d2, ''] = [] eps_trans.append(u) - - states=a1.states+a2.states+2 - finals={u} - return NFA(states,finals,transitions,start) + + states = a1.states + a2.states + 2 + finals = {u} + return NFA(states, finals, transitions, start) + def automata_closure(a1): - transitions={} - start=0 - d1=1 - u=a1.states+d1 + transitions = {} + start = 0 + d1 = 1 + u = a1.states + d1 for A, d in a1.transitions.items(): for b, O in d.items(): - transitions[A+d1,b]=[F+d1 for F in O] - transitions[start,'']=[a1.start+d1,u] - + transitions[A + d1, b] = [F + d1 for F in O] + transitions[start, ''] = [a1.start + d1, u] + for z in a1.finals: try: - X=transitions[z+d1,''] + X = transitions[z + d1, ''] except KeyError: - X=transitions[z+d1,'']=[] + X = transitions[z + d1, ''] = [] X.append(u) - X.append(a1.start+d1) - - states=a1.states+2 - finals={u} - return NFA(states,finals,transitions,start) + X.append(a1.start + d1) + states = a1.states + 2 + finals = {u} + return NFA(states, finals, transitions, start) diff --git a/src/automatons/state.py b/src/automatons/state.py index 4a7d7715..8fba8785 100755 --- a/src/automatons/state.py +++ b/src/automatons/state.py @@ -44,7 +44,8 @@ def to_deterministic(self): closure = self.epsilon_closure_by_state(*move) if closure not in closures: - new_state = State(tuple(closure), any(s.final for s in closure)) + new_state = State(tuple(closure), + any(s.final for s in closure)) closures.append(closure) states.append(new_state) pending.append(new_state) @@ -74,7 +75,11 @@ def from_nfa(nfa, get_states=False): @staticmethod def move_by_state(symbol, *states): - return {s for state in states if state.has_transition(symbol) for s in state[symbol]} + return { + s + for state in states if state.has_transition(symbol) + for s in state[symbol] + } @staticmethod def epsilon_closure_by_state(*states): @@ -122,36 +127,6 @@ def __hash__(self): return hash(frozenset(self.state)) if not isinstance(self.state, int) else\ hash(self.state) - # def graph(self): - # import pydot - # G = pydot.Dot(rankdir='LR', margin=0.1) - # G.add_node(pydot.Node('start', shape='plaintext', label='', width=0, height=0)) - - # visited = set() - # def visit(start): - # ids = id(start) - # if ids not in visited: - # visited.add(ids) - # G.add_node(pydot.Node(ids, label=start.name, shape='circle', style='bold' if start.final else '')) - # for tran, destinations in start.transitions.items(): - # for end in destinations: - # visit(end) - # G.add_edge(pydot.Edge(ids, id(end), label=tran, labeldistance=2)) - # for end in start.epsilon_transitions: - # visit(end) - # G.add_edge(pydot.Edge(ids, id(end), label='ε', labeldistance=2)) - - # visit(self) - # G.add_edge(pydot.Edge('start', id(self), label='', style='dashed')) - - # return G - - # def _repr_svg_(self): - # try: - # return self.graph().create_svg().decode('utf8') - # except: - # pass - def __iter__(self): yield from self._visit() diff --git a/src/automatons/transformation.py b/src/automatons/transformation.py index 08e2a64c..50de0b0c 100755 --- a/src/automatons/transformation.py +++ b/src/automatons/transformation.py @@ -1,4 +1,3 @@ -#%% from automatons.deterministic import DFA from automatons.nondeterministic import NFA from tools.firsts import ContainerSet @@ -31,8 +30,10 @@ def nfa_to_deterministic(automaton: NFA): for symbol in automaton.vocabulary: next_state = [] for s in state: - next_state += [x for x in automaton.transitions.get( - s, {}).get(symbol, [])] + next_state += [ + x + for x in automaton.transitions.get(s, {}).get(symbol, []) + ] if next_state: try: transitions[state.state, symbol] @@ -41,8 +42,8 @@ def nfa_to_deterministic(automaton: NFA): next_state = compute_epsilon_closure(automaton, next_state) if next_state not in aut_states: next_state.state = n - next_state.is_final = any( - s in automaton.finals for s in next_state) + next_state.is_final = any(s in automaton.finals + for s in next_state) pending.append(next_state) aut_states.append(next_state) n += 1 diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 87d738c8..c8852e18 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -1,5 +1,5 @@ from typing import List -from abstract.semantics import Attribute +from abstract.semantics import Attribute, Type """ Define a hierachy to represent each CIL instruction. Every CIL Instruction would be a Node of an AST, and every\ @@ -13,9 +13,9 @@ class CilNode: class CilProgramNode(CilNode): def __init__(self, dottypes, dotdata, dotcode): - self.dottypes = dottypes - self.dotdata = dotdata - self.dotcode = dotcode + self.dottypes: List[TypeNode] = dottypes + self.dotdata: List[DataNode] = dotdata + self.dotcode: List[FunctionNode] = dotcode class TypeNode(CilNode): @@ -71,14 +71,14 @@ class PlusNode(ArithmeticNode): class MinusNode(ArithmeticNode): - def __init__(self, x: str, y: str, dest: str): + def __init__(self, x: LocalNode, y: LocalNode, dest: LocalNode): self.x = x self.y = y self.dest = dest class StarNode(ArithmeticNode): - def __init__(self, x: str, y: str, dest: str): + def __init__(self, x: LocalNode, y: LocalNode, dest: LocalNode): self.x = x self.y = y self.dest = dest @@ -89,7 +89,7 @@ class DivNode(ArithmeticNode): class GetAttributeNode(InstructionNode): - def __init__(self, itype: str, attrname: str, dest: str): + def __init__(self, itype: str, attrname: str, dest: LocalNode): self.itype = itype self.attrname = attrname self.dest = dest @@ -111,7 +111,7 @@ class SetIndexNode(InstructionNode): class AllocateNode(InstructionNode): - def __init__(self, itype: str, dest: str): + def __init__(self, itype: Type, dest: LocalNode): self.itype = itype self.dest = dest @@ -121,7 +121,7 @@ class ArrayNode(InstructionNode): class TypeOfNode(InstructionNode): - def __init__(self, variable: str, dest: str): + def __init__(self, variable: CilNode, dest: LocalNode): self.variable = variable self.dest = dest @@ -132,21 +132,21 @@ def __init__(self, label: str): class JumpIfGreaterThanZeroNode(InstructionNode): - def __init__(self, variable: str, label: str): + def __init__(self, variable: LocalNode, label: str): self.label = label self.variable = variable class IfZeroJump(InstructionNode): - def __init__(self, variable: str, label: str): + def __init__(self, variable: LocalNode, label: str): self.variable = variable self.label = label class NotZeroJump(InstructionNode): - def __init__(self, variable: str, label: str): - self.variable: str = variable - self.label: str = label + def __init__(self, variable: LocalNode, label: str): + self.variable = variable + self.label = label class UnconditionalJump(InstructionNode): @@ -155,7 +155,7 @@ def __init__(self, label: str): class StaticCallNode(InstructionNode): - def __init__(self, function: str, dest: str): + def __init__(self, function: str, dest: LocalNode): self.function = function self.dest = dest @@ -216,7 +216,8 @@ def __init__(self, string_address: str): class TdtLookupNode(InstructionNode): - def __init__(self, index_varA: str, index_varB: str, dest: str): + def __init__(self, index_varA: str, index_varB: LocalNode, + dest: LocalNode): self.i = index_varA self.j = index_varB self.dest = dest diff --git a/src/grammar/grammar.py b/src/grammar/grammar.py index 1ef5888e..4b1b82cb 100755 --- a/src/grammar/grammar.py +++ b/src/grammar/grammar.py @@ -1,23 +1,23 @@ -from grammar.symbols import NonTerminal, Terminal, Sentence, Epsilon, EOF, AttributeProduction +from typing import Dict, List, Optional, Type, Union +from grammar.symbols import NonTerminal, Production, Symbol, Terminal, Sentence, Epsilon, EOF, AttributeProduction import json class Grammar(): - def __init__(self): - self.Productions = [] - self.nonTerminals = [] - self.terminals = [] - self.startSymbol = None + self.Productions: List[Union[AttributeProduction, Production]] = [] + self.nonTerminals: List[NonTerminal] = [] + self.terminals: List[Terminal] = [] + self.startSymbol: Optional[NonTerminal] = None # production type - self.pType = None + self.pType: Optional[Type] = None self.Epsilon = Epsilon(self) self.EOF = EOF(self) - self.symbDict = {} + self.symbDict: Dict[str, Symbol] = {} - def NonTerminal(self, name, startSymbol=False): + def NonTerminal(self, name: str, startSymbol=False): name = name.strip() if not name: @@ -36,23 +36,25 @@ def NonTerminal(self, name, startSymbol=False): self.symbDict[name] = term return term - def NonTerminals(self, names): + def NonTerminals(self, names: str): ans = tuple((self.NonTerminal(x) for x in names.strip().split())) return ans - def Add_Production(self, production): + def Add_Production(self, production: Union[Production, + AttributeProduction]): if len(self.Productions) == 0: self.pType = type(production) - assert type(production) == self.pType, "The Productions most be of only 1 type." + assert type(production + ) == self.pType, "The Productions most be of only 1 type." production.Left.productions.append(production) self.Productions.append(production) - def Terminal(self, name): + def Terminal(self, name: str): name = name.strip() if not name: @@ -63,7 +65,7 @@ def Terminal(self, name): self.symbDict[name] = term return term - def Terminals(self, names): + def Terminals(self, names: str): ans = tuple((self.Terminal(x) for x in names.strip().split())) @@ -91,47 +93,53 @@ def __str__(self): return ans - @property - def to_json(self): + # @property + # def to_json(self): - productions = [] + # productions = [] - for p in self.Productions: - head = p.Left.Name + # for p in self.Productions: + # head = p.Left.Name - body = [] + # body = [] - for s in p.Right: - body.append(s.Name) + # for s in p.Right: + # body.append(s.Name) - productions.append({'Head': head, 'Body': body}) + # productions.append({'Head': head, 'Body': body}) - d = {'NonTerminals': [symb.Name for symb in self.nonTerminals if symb != self.startSymbol], - 'Terminals': [symb.Name for symb in self.terminals], - 'Productions': productions} - d['StartSymbol'] = self.startSymbol.Name + # d = { + # 'NonTerminals': [ + # symb.Name for symb in self.nonTerminals + # if symb != self.startSymbol + # ], + # 'Terminals': [symb.Name for symb in self.terminals], + # 'Productions': + # productions + # } + # d['StartSymbol'] = self.startSymbol.Name - return json.dumps(d) + # return json.dumps(d) - @staticmethod - def from_json(data): - data = json.loads(data) + # @staticmethod + # def from_json(data): + # data = json.loads(data) - G = Grammar() - dic = {'epsilon': G.Epsilon} - dic[data['StartSymbol']] = G.NonTerminal(data['StartSymbol'], True) + # G = Grammar() + # dic = {'epsilon': G.Epsilon} + # dic[data['StartSymbol']] = G.NonTerminal(data['StartSymbol'], True) - for term in data['Terminals']: - dic[term] = G.Terminal(term) + # for term in data['Terminals']: + # dic[term] = G.Terminal(term) - for noTerm in data['NonTerminals']: - dic[noTerm] = G.NonTerminal(noTerm) + # for noTerm in data['NonTerminals']: + # dic[noTerm] = G.NonTerminal(noTerm) - for p in data['Productions']: - head = p['Head'] - dic[head] %= Sentence(*[dic[term] for term in p['Body']]) + # for p in data['Productions']: + # head = p['Head'] + # dic[head] %= Sentence(*[dic[term] for term in p['Body']]) - return G + # return G def copy(self): G = Grammar() diff --git a/src/grammar/items.py b/src/grammar/items.py index 981b7ed8..d347ab28 100755 --- a/src/grammar/items.py +++ b/src/grammar/items.py @@ -1,5 +1,7 @@ -#%% -from grammar.symbols import Production +from __future__ import annotations +from typing import Iterable, List, Optional, Union +from grammar.symbols import NonTerminal, Production, Symbol, Terminal + class Item: """ @@ -11,39 +13,40 @@ class Item: Por cada produccion X-> w, tenemos |w| + 1 posibles items """ - def __init__(self, production, pos, lookaheads=[]): + def __init__(self, + production: Production, + pos: int, + lookaheads: Iterable[Union[Terminal, NonTerminal]] = []): self.production = production self.pos = pos self.lookaheads = frozenset(look for look in lookaheads) - + @property def IsReduceItem(self): return len(self.production.Right) == self.pos - + @property - def NextSymbol(self): + def NextSymbol(self) -> Optional[Union[Terminal, NonTerminal]]: if self.pos < len(self.production.Right): return self.production.Right[self.pos] else: return None - - def next_item(self): + + def next_item(self) -> Optional[Item]: if self.pos < len(self.production.Right): - return Item(self.production,self.pos+1,self.lookaheads) + return Item(self.production, self.pos + 1, self.lookaheads) else: return None - - def __eq__(self, other): - return ( - (self.pos == other.pos) and - (self.production == other.production) and - (self.lookaheads == other.lookaheads) - ) + + def __eq__(self, other: Item): + return ((self.pos == other.pos) + and (self.production == other.production) + and (self.lookaheads == other.lookaheads)) def __str__(self): s = str(self.production.Left) + " -> " if len(self.production.Right) > 0: - for i,c in enumerate(self.production.Right): + for i, c in enumerate(self.production.Right): if i == self.pos: s += "." s += str(self.production.Right[i]) @@ -53,12 +56,12 @@ def __str__(self): s += "." s += ", " + str(self.lookaheads) return s - + def __repr__(self): return str(self) - + def __hash__(self): - return hash((self.production,self.pos,frozenset(self.lookaheads))) + return hash((self.production, self.pos, frozenset(self.lookaheads))) def __iter__(self): current = self @@ -67,9 +70,9 @@ def __iter__(self): current = current.next_item() yield current - def Preview(self, skip=1): - unseen = self.production.Right[self.pos+skip:] - return [ unseen + (lookahead,) for lookahead in self.lookaheads ] + def Preview(self, skip=1) -> List[Symbol]: + unseen = self.production.Right[self.pos + skip:] + return [unseen + (lookahead, ) for lookahead in self.lookaheads] - def Center(self): + def Center(self) -> Item: return Item(self.production, self.pos) diff --git a/src/grammar/symbols.py b/src/grammar/symbols.py index d08e7f9e..c374e1ef 100755 --- a/src/grammar/symbols.py +++ b/src/grammar/symbols.py @@ -1,3 +1,7 @@ +from __future__ import annotations +from typing import Any, Callable, List, Optional, Tuple, Union + + class Symbol(object): """ Modelaremos los símbolos del lenguaje con la clase Symbol. @@ -14,9 +18,8 @@ class Symbol(object): Los símbolos no deben ser instanciados directamente (ni sus descendiente) con la aplicación de su constructor. """ - - def __init__(self, name, grammar): - self.Name = name + def __init__(self, name: str, grammar): + self.Name: str = name self.Grammar = grammar def __str__(self): @@ -59,8 +62,7 @@ class Terminal(Symbol): Los terminales no deben ser instanciados directamente con la aplicación de su constructor. """ - - def __init__(self, name, grammar): + def __init__(self, name: str, grammar): super().__init__(name, grammar) @property @@ -82,81 +84,6 @@ def __eq__(self, other): return isinstance(other, Terminal) and other.Name == self.Name -class NonTerminal(Symbol): - """ - Los símbolos no terminales los modelaremos con la clase NonTerminal. - Dicha clase extiende la clase Symbol para: - - -Añadir noción de las producción que tiene al no terminal como cabecera. - Estas pueden ser conocidas a través del campo productions de cada instancia. - -Permitir añadir producciones para ese no terminal a través del operador %=. - -Incluir propiedades IsNonTerminal - IsTerminal que devolveran True - False respectivamente. - - Los no terminales no deben ser instanciados directamente con la aplicación de su constructor. - """ - - def __init__(self, name, grammar): - super().__init__(name, grammar) - self.productions = [] - - def __imod__(self, other): - - if isinstance(other, Sentence): - p = Production(self, other) - self.Grammar.Add_Production(p) - return self - - if isinstance(other, SentenceList): - - for s in other: - p = Production(self, s) - self.Grammar.Add_Production(p) - - return self - - if isinstance(other, tuple): - assert len(other) > 1 - - if len(other) == 2: - other += (None,) * len(other[0]) - assert len(other) == len(other[0]) + 2, "Reglas malformadas" - - if isinstance(other[0], Symbol) or isinstance(other[0], Sentence): - p = AttributeProduction(self, other[0], other[1:]) - else: - raise Exception("") - - self.Grammar.Add_Production(p) - return self - - if isinstance(other, Symbol): - p = Production(self, Sentence(other)) - self.Grammar.Add_Production(p) - return self - - if isinstance(other, SentenceList): - - for s in other: - p = Production(self, s) - self.Grammar.Add_Production(p) - - return self - - raise TypeError(other) - - @property - def IsTerminal(self): - return False - - @property - def IsNonTerminal(self): - return True - - @property - def IsEpsilon(self): - return False - - class EOF(Terminal): """ Modelaremos el símbolo de fin de cadena con la clase EOF. @@ -166,7 +93,6 @@ class EOF(Terminal): En su lugar, una instancia concreta para determinada gramática G de Grammar se construirá automáticamente y será accesible a través de G.EOF. """ - def __init__(self, Grammar): super().__init__('$', Grammar) @@ -194,7 +120,6 @@ class Sentence(object): En su lugar, usaremos el operador + entre símbolos para formar las oraciones, y el operador | entre oraciones para agruparlas. """ - def __init__(self, *args): self._symbols = tuple(x for x in args if not x.IsEpsilon) self.hash = hash(self._symbols) @@ -202,16 +127,16 @@ def __init__(self, *args): def __len__(self): return len(self._symbols) - def __add__(self, other): + def __add__(self, other: Union[Symbol, Sentence]): if isinstance(other, Symbol): - return Sentence(*(self._symbols + (other,))) + return Sentence(*(self._symbols + (other, ))) if isinstance(other, Sentence): return Sentence(*(self._symbols + other._symbols)) raise TypeError(other) - def __or__(self, other): + def __or__(self, other: Union[Symbol, Sentence]): if isinstance(other, Sentence): return SentenceList(self, other) @@ -244,11 +169,10 @@ def IsEpsilon(self): class SentenceList(object): - - def __init__(self, *args): + def __init__(self, *args: Sentence): self._sentences = list(args) - def Add(self, symbol): + def Add(self, symbol: Optional[Sentence]): if not symbol and (symbol is None or not symbol.IsEpsilon): raise ValueError(symbol) @@ -257,7 +181,7 @@ def Add(self, symbol): def __iter__(self): return iter(self._sentences) - def __or__(self, other): + def __or__(self, other: Union[Sentence, Symbol]): if isinstance(other, Sentence): self.Add(other) return self @@ -278,7 +202,6 @@ class Epsilon(Terminal, Sentence): En su lugar, una instancia concreta para determinada gramática G de Grammar se construirá automáticamente y será accesible a través de G.Epsilon. """ - def __init__(self, grammar): super().__init__('epsilon', grammar) @@ -298,7 +221,7 @@ def __add__(self, other): return other def __eq__(self, other): - return isinstance(other, (Epsilon,)) + return isinstance(other, (Epsilon, )) def __hash__(self): return hash("") @@ -334,8 +257,7 @@ class Production(object): S %= S + a | G.Epsilon """ - - def __init__(self, nonTerminal, sentence): + def __init__(self, nonTerminal: NonTerminal, sentence: Sentence): self.Left = nonTerminal self.Right = sentence @@ -349,8 +271,10 @@ def __iter__(self): yield self.Left yield self.Right - def __eq__(self, other): - return isinstance(other, Production) and self.Left == other.Left and self.Right == other.Right + def __eq__(self, other: Production): + return isinstance( + other, Production + ) and self.Left == other.Left and self.Right == other.Right def __hash__(self): return hash((self.Left, self.Right)) @@ -418,8 +342,9 @@ class AttributeProduction(Production): No se deben definir múltiples producciones de la misma cabecera en una única sentencia. """ + def __init__(self, nonTerminal: NonTerminal, + sentence: Union[Sentence, Symbol], attributes): - def __init__(self, nonTerminal, sentence, attributes): if not isinstance(sentence, Sentence) and isinstance(sentence, Symbol): sentence = Sentence(sentence) super(AttributeProduction, self).__init__(nonTerminal, sentence) @@ -439,3 +364,69 @@ def __iter__(self): @property def IsEpsilon(self): return self.Right.IsEpsilon + + +class NonTerminal(Symbol): + """ + Los símbolos no terminales los modelaremos con la clase NonTerminal. + Dicha clase extiende la clase Symbol para: + + -Añadir noción de las producción que tiene al no terminal como cabecera. + Estas pueden ser conocidas a través del campo productions de cada instancia. + -Permitir añadir producciones para ese no terminal a través del operador %=. + -Incluir propiedades IsNonTerminal - IsTerminal que devolveran True - False respectivamente. + + Los no terminales no deben ser instanciados directamente con la aplicación de su constructor. + """ + def __init__(self, name: str, grammar): + super().__init__(name, grammar) + self.productions = [] + + def __imod__(self, other: Union[Sentence, SentenceList, Tuple, Symbol]): + + if isinstance(other, Sentence): + p = Production(self, other) + self.Grammar.Add_Production(p) + return self + + if isinstance(other, SentenceList): + + for s in other: + p = Production(self, s) + self.Grammar.Add_Production(p) + + return self + + if isinstance(other, tuple): + assert len(other) > 1 + + if len(other) == 2: + other += (None, ) * len(other[0]) + assert len(other) == len(other[0]) + 2, "Reglas malformadas" + + if isinstance(other[0], Symbol) or isinstance(other[0], Sentence): + p = AttributeProduction(self, other[0], other[1:]) + else: + raise Exception("") + + self.Grammar.Add_Production(p) + return self + + if isinstance(other, Symbol): + p = Production(self, Sentence(other)) + self.Grammar.Add_Production(p) + return self + + raise TypeError(other) + + @property + def IsTerminal(self): + return False + + @property + def IsNonTerminal(self): + return True + + @property + def IsEpsilon(self): + return False \ No newline at end of file diff --git a/src/lexer/regexgenerator.py b/src/lexer/regexgenerator.py index 5212d4a5..c31a36d4 100755 --- a/src/lexer/regexgenerator.py +++ b/src/lexer/regexgenerator.py @@ -1,4 +1,3 @@ -#%% from baseNodeTree.base import Node, AtomicNode, UnaryNode, BinaryNode from automatons.nondeterministic import NFA from automatons.operations import (automata_union, automata_concatenation, diff --git a/src/lexer/tokens.py b/src/lexer/tokens.py index a2d29935..a697a7a5 100755 --- a/src/lexer/tokens.py +++ b/src/lexer/tokens.py @@ -1,3 +1,6 @@ +from grammar.symbols import Terminal + + class Token: """ Basic token class. @@ -9,8 +12,11 @@ class Token: token_type : Enum Token's type. """ - - def __init__(self, lex, token_type, token_column=None, token_line=None): + def __init__(self, + lex: str, + token_type: Terminal, + token_column=None, + token_line=None): self.lex = lex self.token_type = token_type self.token_column = token_column diff --git a/src/parserr/ll1.py b/src/parserr/ll1.py index 9519b97c..8add2c56 100755 --- a/src/parserr/ll1.py +++ b/src/parserr/ll1.py @@ -1,14 +1,17 @@ -from typing import Dict, Tuple +from typing import Dict, List, Tuple, Union, Optional +from lexer.tokens import Token from tools.firsts import compute_firsts from tools.follows import compute_follows from grammar.grammar import Grammar, NonTerminal, Terminal -from grammar.symbols import Sentence +from grammar.symbols import AttributeProduction, Production, Sentence, Symbol TableEntry = Tuple[NonTerminal, Terminal] +ProductionType = Union[Production, AttributeProduction] +Symb = Union[Terminal, NonTerminal] def build_ll1_parsing_table(G: Grammar, firsts: Dict, follows: Dict): - table: Dict[TableEntry, Sentence] = {} + table: Dict[TableEntry, ProductionType] = {} for production in G.Productions: x, alpha = production.Left, production.Right @@ -31,7 +34,7 @@ def build_ll1_parser(G: Grammar): follows = compute_follows(G, firsts) table = build_ll1_parsing_table(G, firsts, follows) - def parser(w: list): + def parser(w: List[Token]): # Asumimos que w termina en $ stack = [G.startSymbol] cursor = 0 @@ -39,10 +42,13 @@ def parser(w: list): while stack: sym = stack.pop() + assert isinstance(sym, Terminal) or isinstance(sym, NonTerminal) if sym.IsTerminal: - assert sym == w[cursor].token_type, "La cadena no pertenece al lenguaje" + assert sym == w[ + cursor].token_type, "La cadena no pertenece al lenguaje" cursor += 1 else: + assert isinstance(sym, NonTerminal) try: production = table[(sym, w[cursor].token_type)] output.append(production) @@ -54,7 +60,8 @@ def parser(w: list): except KeyError: raise Exception('La cadena no pertenece al lenguaje') - assert w[cursor].token_type == G.EOF, 'La cadena no pertenece al lenguaje' + assert w[ + cursor].token_type == G.EOF, 'La cadena no pertenece al lenguaje' return output return parser diff --git a/src/parserr/lr.py b/src/parserr/lr.py index 29cb8c03..e6990c2f 100755 --- a/src/parserr/lr.py +++ b/src/parserr/lr.py @@ -1,16 +1,21 @@ +from grammar.grammar import Grammar from grammar.items import Item +from grammar.symbols import NonTerminal, Terminal from tools.firsts import ContainerSet from automatons.state import State from parserr.shiftreduce import ShiftReduceParser from tools.firsts import compute_firsts, compute_local_first -from typing import Iterable, Optional, List, Union, Set, FrozenSet +from typing import Dict, Iterable, Optional, List, Union, Set, FrozenSet +Symb = Optional[Union[Terminal, NonTerminal]] -def expand(item, firsts): + +def expand(item: Item, firsts): next_symbol = item.NextSymbol if next_symbol is None or not next_symbol.IsNonTerminal: return [] + assert isinstance(next_symbol, NonTerminal) lookaheads = ContainerSet() for remainder in item.Preview(): @@ -25,8 +30,8 @@ def expand(item, firsts): return expanded -def compress(items): - centers = {} +def compress(items: Iterable[Item]) -> Set[Item]: + centers: Dict[Item, Set] = {} for item in items: center = item.Center() @@ -42,7 +47,7 @@ def compress(items): } -def closure_lr1(items, firsts): +def closure_lr1(items: Iterable[Item], firsts) -> Set[Item]: closure = ContainerSet(*items) changed = True @@ -59,14 +64,14 @@ def closure_lr1(items, firsts): return compress(closure) -def goto_lr1(items, symbol, firsts=None, just_kernel=False): +def goto_lr1(items, symbol: Symb, firsts=None, just_kernel=False): assert just_kernel or firsts is not None, '`firsts` must be provided if `just_kernel=False`' items = frozenset(item.next_item() for item in items - if item.NextSymbol == symbol) + if item.NextSymbol == symbol and item) return items if just_kernel else closure_lr1(items, firsts) -def build_LR1_automaton(G): +def build_LR1_automaton(G: Grammar): assert len(G.startSymbol.productions) == 1, 'Grammar must be augmented' firsts = compute_firsts(G) diff --git a/src/parserr/shiftreduce.py b/src/parserr/shiftreduce.py index 0453937f..c51a6881 100755 --- a/src/parserr/shiftreduce.py +++ b/src/parserr/shiftreduce.py @@ -2,7 +2,14 @@ Este modulo contiene la declaracion de la clase ShiftReduceParser, la cual sirve de base para los parsers SLR, LALR y LR ''' -from grammar.grammar import EOF +from typing import Dict, List, Literal, Tuple, Union +from grammar.grammar import EOF, Grammar +from grammar.symbols import Production, Terminal +from lexer.tokens import Token + +Action = Union[Literal['SHIFT'], Literal['REDUCE'], Literal['OK']] +Tag = Union[Production, int] +ActionTableEntry = Tuple[int, Terminal] class ShiftReduceParser: @@ -16,17 +23,17 @@ class ShiftReduceParser: REDUCE = 'REDUCE' OK = 'OK' - def __init__(self, G, verbose=False): + def __init__(self, G: Grammar, verbose: bool = False): self.G = G self.verbose = verbose - self.action = {} + self.action: Dict[ActionTableEntry, Tuple[Action, Tag]] = {} self.goto = {} self._build_parsing_table() def _build_parsing_table(self): raise NotImplementedError() - def __call__(self, tokens): + def __call__(self, tokens: List[Token]): stack = [0] cursor = 0 output = [] @@ -48,9 +55,11 @@ def __call__(self, tokens): if action == self.SHIFT: cursor += 1 + assert isinstance(tag, int) stack.append(tag) elif action == self.REDUCE: + assert isinstance(tag, Production) head, body = tag for _ in range(len(body)): diff --git a/src/parserr/slr.py b/src/parserr/slr.py index 4fb9f3df..bc18b5d7 100755 --- a/src/parserr/slr.py +++ b/src/parserr/slr.py @@ -1,13 +1,12 @@ -#%% from tools.firsts import compute_firsts from tools.follows import compute_follows from automatons.state import State from grammar.items import Item from parserr.shiftreduce import ShiftReduceParser -class SLR1Parser(ShiftReduceParser): - def build_LR0_automaton(self,G): +class SLR1Parser(ShiftReduceParser): + def build_LR0_automaton(self, G): assert len(G.startSymbol.productions) == 1, 'Grammar must be augmented' start_production = G.startSymbol.productions[0] @@ -15,8 +14,8 @@ def build_LR0_automaton(self,G): automaton = State(start_item, True) - pending = [ start_item ] - visited = { start_item: automaton } + pending = [start_item] + visited = {start_item: automaton} while pending: current_item = pending.pop() @@ -28,30 +27,29 @@ def build_LR0_automaton(self,G): try: next_state = visited[current_item.next_item()] except KeyError: - next_state = State(current_item.next_item(),True) + next_state = State(current_item.next_item(), True) visited[current_item.next_item()] = next_state - - current_state.add_transition(symbol.Name,next_state) + + current_state.add_transition(symbol.Name, next_state) pending.append(current_item.next_item()) if symbol.IsNonTerminal: for production in symbol.productions: - item = Item(production,0) + item = Item(production, 0) try: state = visited[item] except KeyError: - state = State(item,True) + state = State(item, True) visited[item] = state pending.append(item) current_state.add_epsilon_transition(state) - - return automaton + return automaton def _build_parsing_table(self): G = self.G.AugmentedGrammar() firsts = compute_firsts(G) follows = compute_follows(G, firsts) - + automaton = self.build_LR0_automaton(G).to_deterministic() for i, node in enumerate(automaton): if self.verbose: print(i, node) @@ -61,28 +59,30 @@ def _build_parsing_table(self): idx = node.idx for state in node.state: item = state.state - + if item.IsReduceItem: - head = item.production.Left + head = item.production.Left if head == G.startSymbol: - self._register(self.action,(idx,G.EOF),('OK',item.production)) + self._register(self.action, (idx, G.EOF), + ('OK', item.production)) else: for c in follows[head]: - self._register(self.action,(idx,c),('REDUCE',item.production)) + self._register(self.action, (idx, c), + ('REDUCE', item.production)) else: symbol = item.NextSymbol try: trans_idx = node.transitions[symbol.Name][0].idx if symbol.IsNonTerminal: - self._register(self.goto,(idx,symbol),trans_idx) + self._register(self.goto, (idx, symbol), trans_idx) else: - self._register(self.action,(idx,symbol),('SHIFT',trans_idx)) + self._register(self.action, (idx, symbol), + ('SHIFT', trans_idx)) except KeyError: pass - + @staticmethod def _register(table, key, value): - assert key not in table or table[key] == value, 'Shift-Reduce or Reduce-Reduce conflict!!!' + assert key not in table or table[ + key] == value, 'Shift-Reduce or Reduce-Reduce conflict!!!' table[key] = value - -#%% \ No newline at end of file diff --git a/src/tknizer.py b/src/tknizer.py index ed2b60fd..16ccd90d 100644 --- a/src/tknizer.py +++ b/src/tknizer.py @@ -1,10 +1,14 @@ import re +from typing import List, Tuple, Union +from grammar.symbols import EOF from lexer.tokens import Token from grammar.grammar import Terminal +RegexTypes = Tuple[Union[str, Terminal], str] + class Tokenizer: - def __init__(self, regex_table, eof): + def __init__(self, regex_table: List[RegexTypes], eof: EOF): self.regexs = self._build_regexs(regex_table) self.eof = eof self.line = 1 @@ -19,7 +23,7 @@ def _build_regexs(self, regex_table): regexs.append(("Space", fixed_space_token)) return regexs - def _walk(self, string): + def _walk(self, string: str): matched_suffix = '' tt = None @@ -50,7 +54,7 @@ def _tokenize(self, text): else: self.column += len(newlines[0]) raise SyntaxError( - f'{self.line, self.column} - LexicographicError: {token_type} {suffix}' + f'({self.line},{self.column}) - LexicographicError: {token_type} {suffix}' ) elif token_type == "Line": self.column = 1 @@ -65,9 +69,9 @@ def _tokenize(self, text): if '\0' in line: self.column = line.index('\0') + 1 raise SyntaxError( - f'{self.line, self.column} - LexicographicError: String contains null character' + f'({self.line},{self.column}) - LexicographicError: String contains null character' ) - line += 1 + newlines += 1 # Strings may have some troubles with rows and columns newlines = re.split(r"\\\n", suffix) # Now we have a list with every line of the string diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 4def8af7..c2648398 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -2,17 +2,21 @@ import abstract.tree as coolAst import abstract.semantics as semantics import cil.nodes as cil -from typing import List, Tuple +from typing import List, Optional, Tuple from functools import singledispatchmethod +from cil.nodes import CilNode, LocalNode + ExpressionReturn = Tuple[List[cil.InstructionNode], List[cil.LocalNode]] Scope = semantics.Scope class CoolToCILVisitor(baseCilVisitor.BaseCoolToCilVisitor): @singledispatchmethod - def visit(self, node, scope: Scope) -> None: - pass + def visit(self, node, scope: Scope) -> CilNode: + # Devolver un nodo vacio, al final este metodo no + # se debe llamar nunca. + return CilNode() @visit.register def _(self, node: coolAst.ProgramNode, @@ -20,8 +24,7 @@ def _(self, node: coolAst.ProgramNode, # node.class_list -> [ClassDef ...] # Define the entry point for the program. - self.current_function: cil.FunctionNode = self.register_function( - "entry") + self.current_function = self.register_function("entry") instance = self.define_internal_local() result = self.define_internal_local() @@ -57,8 +60,8 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 feature.idx for feature in node.features if isinstance(feature, coolAst.MethodDef) ] - attributes: List[semantics.Attribute] = [ - feature for feature in node.features + attributes: List[str] = [ + feature.idx for feature in node.features if isinstance(feature, coolAst.AttributeDef) ] @@ -116,13 +119,14 @@ def _(self, node: coolAst.MethodDef, scope: Scope) -> None: # noqa: F811 self.current_function = function_node # Definir los parametros del metodo. - params: List[semantics.VariableInfo] = [ + params: List[Optional[semantics.VariableInfo]] = [ scope.find_variable(param.id) for param in node.param_list ] # Establecer los parametros de la funcion. for param in params: - self.register_params(param) + if param: + self.register_params(param) # Registrar las instrucciones que conforman el cuerpo del metodo. last = self.visit(node.statements, scope) @@ -150,6 +154,7 @@ def _(self, node: coolAst.IfThenElseNode, internal_cond_vm_holder = self.visit(node.cond, scope) # Chequear y saltar si es necesario. + assert isinstance(internal_cond_vm_holder, LocalNode) self.register_instruction( cil.IfZeroJump(internal_cond_vm_holder, false_label)) @@ -166,11 +171,12 @@ def _(self, node: coolAst.IfThenElseNode, @visit.register def _(self, node: coolAst.VariableDeclaration, - scope: Scope) -> None: # noqa: F811 + scope: Scope) -> CilNode: # noqa: F811 for var_idx, var_type, var_init_expr in node.var_list: # Registrar las variables en orden. var_info = scope.find_variable(var_idx) + assert var_info is not None local_var = self.register_local(var_info) # Reservar memoria para la variable y realizar su inicializacion si tiene @@ -216,8 +222,8 @@ def _(self, node: coolAst.InstantiateClassNode, scope: Scope): return instance_vm_holder @visit.register - def _(self, node: coolAst.BlockNode, scope: Scope) -> str: - last = '' + def _(self, node: coolAst.BlockNode, scope: Scope) -> CilNode: + last: CilNode = CilNode() # A block is simply a list of statements, so visit each one for stmt in node.expressions: last = self.visit(stmt, scope) @@ -249,6 +255,7 @@ def _(self, node: coolAst.WhileBlockNode, scope: Scope): cond_vm_holder = self.visit(node.cond, scope) # Probar la condicion, si es true continuar la ejecucion, sino saltar al LABEL end + assert isinstance(cond_vm_holder, LocalNode) self.register_instruction(cil.IfZeroJump(cond_vm_holder, end_label)) # Registrar las instrucciones del cuerpo del while @@ -282,7 +289,7 @@ def _(self, node: coolAst.CaseNode, scope: Scope): for i, action_node in enumerate(node.actions): # Calcular la distancia hacia el tipo, y actualizar el minimo de ser necesario self.register_instruction( - cil.TdtLookupNode(action_node.itype, + cil.TdtLookupNode(action_node.typex, type_internal_local_holder, tdt_result)) # Comparar el resultado obtenido con el minimo actual. @@ -313,7 +320,7 @@ def _(self, node: coolAst.CaseNode, scope: Scope): for i, action_node in enumerate(node.actions): next_label = self.do_label(f'NEXT{i}') self.register_instruction( - cil.TdtLookupNode(action_node.itype, + cil.TdtLookupNode(action_node.typex, type_internal_local_holder, tdt_result)) self.register_instruction( cil.MinusNode(min_, tdt_result, min_check_local)) @@ -322,6 +329,7 @@ def _(self, node: coolAst.CaseNode, scope: Scope): # Implemententacion del branch. # Registrar la variable var_info = scope.find_variable(action_node.idx) + assert var_info is not None idk = self.register_local(var_info) # Asignar al identificador idk el valor de expr0 self.register_instruction(cil.AssignNode(idk, expr_vm_holder)) @@ -370,6 +378,8 @@ def _(self, node: coolAst.DifNode, scope: Scope): right_vm_holder = self.visit(node.right, scope) # Registrar la instruccion de resta + assert isinstance(left_vm_holder, LocalNode) and isinstance( + right_vm_holder, LocalNode) self.register_instruction( cil.MinusNode(left_vm_holder, right_vm_holder, minus_internal_vm_holder)) diff --git a/src/travels/inference.py b/src/travels/inference.py index 0e64ea44..5e72c927 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -1,9 +1,11 @@ +from functools import singledispatchmethod +from typing import Optional + import abstract.semantics as semantic -from abstract.semantics import Type import abstract.tree as coolAst -from travels.context_actions import update_attr_type, update_method_param, update_scope_variable -from typing import Optional -from functools import singledispatchmethod +from abstract.semantics import Type +from travels.context_actions import (update_attr_type, update_method_param, + update_scope_variable) void = semantic.VoidType() From da94009d9cb63de1bcd864ab7bcc5bf18461d7d5 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Mon, 31 Aug 2020 14:08:30 -0400 Subject: [PATCH 068/162] Refactoring arithmetic nodes --- src/cil/nodes.py | 6 +- src/mips/baseMipsVisitor.py | 82 +++++++++++++++++ src/travels/ciltomips.py | 178 +++++++++++------------------------- src/travels/ctcill.py | 73 +++++++++------ 4 files changed, 184 insertions(+), 155 deletions(-) diff --git a/src/cil/nodes.py b/src/cil/nodes.py index c8852e18..5b78b6ff 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -19,7 +19,7 @@ def __init__(self, dottypes, dotdata, dotcode): class TypeNode(CilNode): - def __init__(self, name): + def __init__(self, name: str): self.name = name self.attributes: List[Attribute] = [] self.methods = [] @@ -121,7 +121,7 @@ class ArrayNode(InstructionNode): class TypeOfNode(InstructionNode): - def __init__(self, variable: CilNode, dest: LocalNode): + def __init__(self, variable: LocalNode, dest: LocalNode): self.variable = variable self.dest = dest @@ -178,7 +178,7 @@ def __init__(self, value=None): class LoadNode(InstructionNode): - def __init__(self, dest: str, message: DataNode): + def __init__(self, dest: LocalNode, message: DataNode): self.dest = dest self.message = message diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 0e7e2e0e..68e2504c 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -1,3 +1,5 @@ +from cil.nodes import TypeNode +from cil.nodes import CilNode, FunctionNode import mips.instruction as instrNodes import mips.branch as branchNodes import mips.comparison as cmpNodes @@ -6,6 +8,7 @@ from typing import List, Optional, Union import time import cil.nodes as cil +from travels.ctcill import CilDisplayFormatter class AbstractDirective(instrNodes.MipsNode): @@ -83,6 +86,8 @@ def __init__(self): # Construir el header del programa. self.__program_header() + self.__cil_display_formatter = CilDisplayFormatter() + # Metodos Publicos def register_instruction(self, node: instrNodes.MipsNode): self.program.append(node) @@ -104,6 +109,9 @@ def __program_header(self): # Funcion de ayuda para obtener la direccion de memoria de un parametro o una variable def get_location_address(self, node: Union[cil.ParamNode, cil.LocalNode]) -> str: + """ + Devuelve el offset del parametro o variable local que estamos buscando, accediendo a este en el stack. Offset es positivo si se trata de un parametro, negativo en caso de una variable local. + """ assert self.current_function is not None index = -1 if isinstance(node, cil.ParamNode): @@ -128,8 +136,82 @@ def get_location_address(self, node: Union[cil.ParamNode, return f"-{index * 4}($fp)" def get_available_register(self) -> Optional[int]: + """ + Obtiene un registro disponible. + """ for register in instrNodes.TEMP_REGISTERS: if not self.used_registers[register]: self.used_registers[register] = True return register return None + + def add_source_line_comment(self, source: CilNode): + """ + Muestra en el archivo mips un comentario con la linea que se esta transcribiendo. + """ + self.register_instruction( + instrNodes.LineComment(self.__cil_display_formatter.visit(source))) + + def cil_func_signature(self, func: FunctionNode): + """ + Genera un comentario en el archivo mips que indica la signatura de la funcion que se esta creando. + """ + self.register_instruction( + instrNodes.LineComment(f"{func.name} implementation.")) + self.register_instruction(instrNodes.LineComment("@Params:")) + for i, param in enumerate(func.params): + if i < 4: + self.register_instruction( + instrNodes.LineComment(f"\t$a{i} = {param}")) + else: + self.register_instruction( + instrNodes.LineComment(f"\t{(i-4) * 4}($fp) = {param}")) + + def operate(self, dest, left, right, operand): + """ + Realiza la operacion indicada por operand entre left y right + y la guarda en dest. + """ + if isinstance(left, str): + # left es una direccion de memoria + reg = self.get_available_register() + assert reg is not None + right_reg = self.get_available_register() + assert right_reg is not None + self.register_instruction(lsNodes.LW(reg, left)) + if not isinstance(right, int): + # right no es una constante + self.register_instruction(lsNodes.LW(right_reg, right)) + self.register_instruction(operand(reg, reg, right_reg)) + else: + # rigth es una constante + self.register_instruction(operand(reg, reg, right, True)) + self.register_instruction(lsNodes.SW(reg, dest)) + self.used_registers[reg] = self.used_registers[right_reg] = False + else: + # left es una constante + reg = self.get_available_register() + right_reg = self.get_available_register() + assert right_reg is not None + assert reg is not None + self.register_instruction(lsNodes.LI(reg, left)) + if not isinstance(right, int): + self.register_instruction(lsNodes.LW(right_reg, right)) + self.register_instruction(operand(reg, reg, right_reg)) + else: + self.register_instruction(operand(reg, reg, right, True)) + self.register_instruction(lsNodes.SW(reg, dest)) + self.used_registers[reg] = self.used_registers[right_reg] = False + + def create_type_array(self, types: List[TypeNode]): + """ + Crea en la seccion .data una secuencia de labels que referencian + los distintos tipos del programa, de modo que se puedan referenciar en + mips como mismo se referenciarian en una lista. + """ + self.register_instruction(DotDataDirective()) + + # Generar por cada tipo, un label que lo identifique, en el mismo orden que aparecen + # en la lista de tipos. + for t in types: + self.register_instruction(instrNodes.Label(t.name)) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 32f25267..59e26e7c 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -19,6 +19,9 @@ def _(self, node: cil.CilProgramNode): # El programa de CIL se compone por las 3 secciones # .TYPES, .DATA y .CODE + # Generar los tipos + self.create_type_array(node.dottypes) + # Visitar cada nodo de la seccion .TYPES for type_node in node.dottypes: self.visit(type_node) @@ -58,11 +61,12 @@ def _(self, node: cil.TypeNode): # noqa: F811 self.register_instruction((instrNodes.LineComment( f" **** Type RECORD for type {node.name} ****"))) # Declarar la direccion de memoria donde comienza el tipo - self.register_instruction(instrNodes.Label(self.current_type.name)) + self.register_instruction( + instrNodes.Label(f"{self.current_type.name}_start")) # Declarar los atributos: Si los atributos son de tipo string, guardarlos como asciiz # de lo contrario son o numeros o punteros y se inicializan como .words for attrib in self.current_type.attributes: - if attrib.name == "String": + if attrib.type.name == "String": self.register_instruction( instrNodes.FixedData(f'{node.name}_attrib_{attrib.name}', r"", 'asciiz')) @@ -110,23 +114,19 @@ def _(self, node: cil.FunctionNode): self.current_function = node # El codigo referente a cada funcion debe ir en la seccion de texto. self.register_instruction(DotTextDirective()) + # Documentar la signatura de la funcion (parametros que recibe, valor que devuelve) - self.register_instruction( - instrNodes.LineComment(f"{node.name} implementation.")) - self.register_instruction(instrNodes.LineComment("@Params:")) - for i, param in enumerate(node.params): - if i < 4: - self.register_instruction( - instrNodes.LineComment(f"\t$a{i} = {param}")) - else: - self.register_instruction( - instrNodes.LineComment(f"\t{(i-4) * 4}($fp) = {param}")) + self.cil_func_signature(node) + # Direccion de memoria de la funcion. self.register_instruction(instrNodes.Label(node.name)) + # Crear el marco de pila para la funcion locals_count = len(node.localvars) self.register_instruction( - instrNodes.LineComment("Allocate stack frame for function.")) + instrNodes.LineComment( + f"Allocate stack frame for function {node.name}.")) + # Salvar primero espacio para las variables locales if locals_count * 4 < 24: # MIPS fuerza a un minimo de 32 bytes por stack frame self.register_instruction(arithNodes.SUBU(sp, sp, 32, True)) @@ -139,6 +139,7 @@ def _(self, node: cil.FunctionNode): # Salvar ra y fp self.register_instruction(lsNodes.SW(ra, "8($sp)")) self.register_instruction(lsNodes.SW(fp, "4($sp)")) + # mover fp al inicio del frame self.register_instruction(arithNodes.ADDU(fp, sp, ret, True)) @@ -153,11 +154,23 @@ def _(self, node: cil.LabelNode): @visit.register def _(self, node: cil.ParamNode): - return self.get_location_address(node) + label = self.get_location_address(node) + + # Agregar la linea que vamos a traducir. + self.register_instruction( + instrNodes.LineComment(f"PARAM {node.name} --> {label}")) + + return label @visit.register def _(self, node: cil.LocalNode): - return self.get_location_address(node) + label = self.get_location_address(node) + + # Agregar la linea que vamos a traducir. + self.register_instruction( + instrNodes.LineComment(f"LOCAL {node.name} --> {label}")) + + return label @visit.register def _(self, node: cil.AssignNode): @@ -166,6 +179,9 @@ def _(self, node: cil.AssignNode): dest = self.visit(node.dest) source = self.visit(node.source) + # Agregar la linea que vamos a traducir. + self.add_source_line_comment(source=node) + # Puede que se asigne una constante o lo que hay en alguna direccion de memoria if isinstance(source, int): reg = self.get_available_register() @@ -199,36 +215,12 @@ def _(self, node: cil.PlusNode): left = self.visit(node.left) right = self.visit(node.right) - if isinstance(left, str): - # left es una direccion de memoria - reg = self.get_available_register() - assert reg is not None - right_reg = self.get_available_register() - assert right_reg is not None - self.register_instruction(lsNodes.LW(reg, left)) - if not isinstance(right, int): - # right no es una constante - self.register_instruction(lsNodes.LW(right_reg, right)) - self.register_instruction(arithNodes.ADD(reg, reg, right_reg)) - else: - # rigth es una constante - self.register_instruction(arithNodes.ADD( - reg, reg, right, True)) - self.register_instruction(lsNodes.SW(reg, dest)) - self.used_registers[reg] = self.used_registers[right_reg] = False - else: - # left es una constante - reg = self.get_available_register() - right_reg = self.get_available_register() - self.register_instruction(lsNodes.LI(reg, left)) - if not isinstance(right, int): - self.register_instruction(lsNodes.LW(right_reg, right)) - self.register_instruction(arithNodes.ADD(reg, reg, right_reg)) - else: - self.register_instruction(arithNodes.ADD( - reg, reg, right, True)) - self.register_instruction(lsNodes.SW(reg, dest)) - self.used_registers[reg] = self.used_registers[right_reg] = False + assert left is not None and right is not None + + # Agregar la linea que vamos a traducir. + self.add_source_line_comment(source=node) + + self.operate(dest, left, right, arithNodes.ADD) @visit.register def _(self, node: cil.MinusNode): @@ -237,32 +229,12 @@ def _(self, node: cil.MinusNode): left = self.visit(node.x) right = self.visit(node.y) - if isinstance(left, str): - # left es una direccion de memoria - reg = self.get_available_register() - right_reg = self.get_available_register() - self.register_instruction(lsNodes.LW(reg, left)) - if not isinstance(right, int): - self.register_instruction(lsNodes.LW(right_reg, right)) - self.register_instruction(arithNodes.SUB(reg, reg, right_reg)) - else: - self.register_instruction(arithNodes.SUB( - reg, reg, right, True)) - self.register_instruction(lsNodes.SW(reg, dest)) - self.used_registers[reg] = self.used_registers[right_reg] = False - else: - # left es una constante - reg = self.get_available_register() - right_reg = self.get_available_register() - self.register_instruction(lsNodes.LI(reg, left)) - if not isinstance(right, int): - self.register_instruction(lsNodes.LW(right_reg, right)) - self.register_instruction(arithNodes.SUB(reg, reg, right_reg)) - else: - self.register_instruction(arithNodes.SUB( - reg, reg, right, True)) - self.register_instruction(lsNodes.SW(reg, dest)) - self.used_registers[reg] = self.used_registers[right_reg] = False + assert left is not None and right is not None + + # Agregar la linea que vamos a traducir. + self.add_source_line_comment(source=node) + + self.operate(dest, left, right, arithNodes.SUB) @visit.register def _(self, node: cil.StarNode): @@ -271,32 +243,12 @@ def _(self, node: cil.StarNode): left = self.visit(node.x) right = self.visit(node.y) - if isinstance(left, str): - # left es una direccion de memoria - reg = self.get_available_register() - right_reg = self.get_available_register() - self.register_instruction(lsNodes.LW(reg, left)) - if not isinstance(right, int): - self.register_instruction(lsNodes.LW(right_reg, right)) - self.register_instruction(arithNodes.MUL(reg, reg, right_reg)) - else: - self.register_instruction(arithNodes.MUL( - reg, reg, right, True)) - self.register_instruction(lsNodes.SW(reg, dest)) - self.used_registers[reg] = self.used_registers[right_reg] = False - else: - # left es una constante - reg = self.get_available_register() - right_reg = self.get_available_register() - self.register_instruction(lsNodes.LI(reg, left)) - if not isinstance(right, int): - self.register_instruction(lsNodes.LW(right_reg, right)) - self.register_instruction(arithNodes.MUL(reg, reg, right_reg)) - else: - self.register_instruction(arithNodes.MUL( - reg, reg, right, True)) - self.register_instruction(lsNodes.SW(reg, dest)) - self.used_registers[reg] = self.used_registers[right_reg] = False + assert left is not None and right is not None + + # Agregar la linea que vamos a traducir. + self.add_source_line_comment(source=node) + + self.operate(dest, left, right, arithNodes.MUL) @visit.register def _(self, node: cil.DivNode): @@ -305,32 +257,12 @@ def _(self, node: cil.DivNode): left = self.visit(node.left) right = self.visit(node.right) - if isinstance(left, str): - # left es una direccion de memoria - reg = self.get_available_register() - right_reg = self.get_available_register() - self.register_instruction(lsNodes.LW(reg, left)) - if not isinstance(right, int): - self.register_instruction(lsNodes.LW(right_reg, right)) - self.register_instruction(arithNodes.DIV(reg, reg, right_reg)) - else: - self.register_instruction(arithNodes.DIV( - reg, reg, right, True)) - self.register_instruction(lsNodes.SW(reg, dest)) - self.used_registers[reg] = self.used_registers[right_reg] = False - else: - # left es una constante - reg = self.get_available_register() - right_reg = self.get_available_register() - self.register_instruction(lsNodes.LI(reg, left)) - if not isinstance(right, int): - self.register_instruction(lsNodes.LW(right_reg, right)) - self.register_instruction(arithNodes.DIV(reg, reg, right_reg)) - else: - self.register_instruction(arithNodes.DIV( - reg, reg, right, True)) - self.register_instruction(lsNodes.SW(reg, dest)) - self.used_registers[reg] = self.used_registers[right_reg] = False + assert left is not None and right is not None + + # Agregar la linea que vamos a traducir. + self.add_source_line_comment(source=node) + + self.operate(dest, left, right, arithNodes.DIV) @visit.register def _(self, node: cil.GetAttributeNode): diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index c2648398..cbe376fc 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -21,7 +21,6 @@ def visit(self, node, scope: Scope) -> CilNode: @visit.register def _(self, node: coolAst.ProgramNode, scope: Scope) -> cil.CilProgramNode: # noqa: F811 - # node.class_list -> [ClassDef ...] # Define the entry point for the program. self.current_function = self.register_function("entry") @@ -31,7 +30,8 @@ def _(self, node: coolAst.ProgramNode, # The first method to call need to be the method main in a Main Class # allocate memory for the main object - self.register_instruction(cil.AllocateNode('Main', instance)) + main_type = self.context.get_type('Main') + self.register_instruction(cil.AllocateNode(main_type, instance)) self.register_instruction(cil.ArgNode(instance)) # call the main method @@ -56,14 +56,8 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 self.current_type = self.context.get_type(node.idx) new_type_node = self.register_type(node.idx) - methods: List[str] = [ - feature.idx for feature in node.features - if isinstance(feature, coolAst.MethodDef) - ] - attributes: List[str] = [ - feature.idx for feature in node.features - if isinstance(feature, coolAst.AttributeDef) - ] + methods = self.current_type.methods + attributes = self.current_type.attributes # Handle inherited features such as attributes and methods first if self.current_type.parent is not None: @@ -89,6 +83,7 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 ##################################################################### for attribute in attributes: new_type_node.attributes.append(attribute) + for method in methods: new_type_node.methods.append( (method, self.to_function_name(method, node.idx))) @@ -180,8 +175,9 @@ def _(self, node: coolAst.VariableDeclaration, local_var = self.register_local(var_info) # Reservar memoria para la variable y realizar su inicializacion si tiene + assert var_info.type is not None self.register_instruction( - cil.AllocateNode(var_info.type.name, local_var)) + cil.AllocateNode(var_info.type, local_var)) if var_init_expr is not None: expr_init_vm_holder = self.visit(var_init_expr, scope) @@ -214,7 +210,7 @@ def _(self, node: coolAst.VariableCall, scope: Scope): # noqa: F811 return local_node @visit.register - def _(self, node: coolAst.InstantiateClassNode, scope: Scope): + def _(self, node: coolAst.InstantiateClassNode, scope: Scope) -> LocalNode: # Reservar una variable que guarde la nueva instancia type_ = self.context.get_type(node.type_) instance_vm_holder = self.define_internal_local() @@ -274,11 +270,12 @@ def _(self, node: coolAst.CaseNode, scope: Scope): # Almacenar el tipo del valor retornado type_internal_local_holder = self.define_internal_local() sub_vm_local_holder = self.define_internal_local() + + assert isinstance(expr_vm_holder, LocalNode) self.register_instruction( cil.TypeOfNode(expr_vm_holder, type_internal_local_holder)) # Variables internas para almacenar resultados intermedios - branch_type = self.define_internal_local() min_ = self.define_internal_local() tdt_result = self.define_internal_local() min_check_local = self.define_internal_local() @@ -349,7 +346,7 @@ def _(self, node: coolAst.CaseNode, scope: Scope): # *************** @visit.register - def _(self, node: coolAst.PlusNode, scope: Scope): + def _(self, node: coolAst.PlusNode, scope: Scope) -> LocalNode: # Definir una variable interna local para almacenar el resultado sum_internal_local = self.define_internal_local() @@ -367,7 +364,7 @@ def _(self, node: coolAst.PlusNode, scope: Scope): return sum_internal_local @visit.register - def _(self, node: coolAst.DifNode, scope: Scope): + def _(self, node: coolAst.DifNode, scope: Scope) -> LocalNode: # Definir una variable interna local para almacenar el resultado intermedio minus_internal_vm_holder = self.define_internal_local() @@ -388,7 +385,7 @@ def _(self, node: coolAst.DifNode, scope: Scope): return minus_internal_vm_holder @visit.register - def _(self, node: coolAst.MulNode, scope: Scope): + def _(self, node: coolAst.MulNode, scope: Scope) -> LocalNode: # Definir una variable interna local para almacenar el resultado intermedio mul_internal_vm_holder = self.define_internal_local() @@ -398,16 +395,19 @@ def _(self, node: coolAst.MulNode, scope: Scope): # Obtener el resultado del segundo factor right_vm_holder = self.visit(node.right, scope) + assert isinstance(left_vm_holder, LocalNode) and isinstance( + right_vm_holder, LocalNode) + # Registrar la instruccion de multimplicacion self.register_instruction( cil.StarNode(left_vm_holder, right_vm_holder, mul_internal_vm_holder)) - # Retornarl el resultado + # Retornar el resultado return mul_internal_vm_holder @visit.register - def _(self, node: coolAst.DivNode, scope: Scope): + def _(self, node: coolAst.DivNode, scope: Scope) -> LocalNode: # Definir una variable interna local para almacenar el resultado intermedio div_internal_vm_holder = self.define_internal_local() @@ -430,12 +430,12 @@ def _(self, node: coolAst.DivNode, scope: Scope): # ********************* @visit.register - def _(self, node: coolAst.IntegerConstant, scope: Scope): + def _(self, node: coolAst.IntegerConstant, scope: Scope) -> int: # devolver el valor return int(node.lex) @visit.register - def _(self, node: coolAst.StringConstant, scope: Scope): + def _(self, node: coolAst.StringConstant, scope: Scope) -> LocalNode: # Variable interna que apunta al string str_const_vm_holder = self.define_internal_local() @@ -449,12 +449,12 @@ def _(self, node: coolAst.StringConstant, scope: Scope): return str_const_vm_holder @visit.register - def _(self, node: coolAst.TrueConstant, scope: Scope): + def _(self, node: coolAst.TrueConstant, scope: Scope) -> int: # variable interna que devuelve el valor de la constante return 1 @visit.register - def _(self, node: coolAst.FalseConstant, scope: Scope): + def _(self, node: coolAst.FalseConstant, scope: Scope) -> int: return 0 # ******************* Implementacion de las comparaciones ******************** @@ -463,7 +463,7 @@ def _(self, node: coolAst.FalseConstant, scope: Scope): # ******************* @visit.register - def _(self, node: coolAst.EqualToNode, scope: Scope): + def _(self, node: coolAst.EqualToNode, scope: Scope) -> int: expr_result_vm_holder = self.define_internal_local() true_label = self.do_label("TRUE") end_label = self.do_label("END") @@ -475,6 +475,9 @@ def _(self, node: coolAst.EqualToNode, scope: Scope): right_vm_holder = self.visit(node.right, scope) # Realizar una resta y devolver el resultado + assert isinstance(left_vm_holder, LocalNode) and isinstance( + right_vm_holder, LocalNode) + self.register_instruction( cil.MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) @@ -497,7 +500,7 @@ def _(self, node: coolAst.EqualToNode, scope: Scope): return expr_result_vm_holder @visit.register - def _(self, node: coolAst.LowerThanNode, scope: Scope): + def _(self, node: coolAst.LowerThanNode, scope: Scope) -> LocalNode: expr_result_vm_holder = self.define_internal_local() false_label = self.do_label("FALSE") end_label = self.do_label("END") @@ -509,6 +512,8 @@ def _(self, node: coolAst.LowerThanNode, scope: Scope): right_vm_holder = self.visit(node.right, scope) # Comparar los resultados restando + assert isinstance(left_vm_holder, LocalNode) and isinstance( + right_vm_holder, LocalNode) self.register_instruction( cil.MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) @@ -528,7 +533,7 @@ def _(self, node: coolAst.LowerThanNode, scope: Scope): return expr_result_vm_holder @visit.register - def _(self, node: coolAst.LowerEqual, scope: Scope): + def _(self, node: coolAst.LowerEqual, scope: Scope) -> LocalNode: expr_result_vm_holder = self.define_internal_local() false_label = self.do_label("FALSE") end_label = self.do_label("END") @@ -539,6 +544,9 @@ def _(self, node: coolAst.LowerEqual, scope: Scope): # Obtener el valor de la expresion derecha right_vm_holder = self.visit(node.right, scope) + assert isinstance(left_vm_holder, LocalNode) and isinstance( + right_vm_holder, LocalNode) + self.register_instruction( cil.MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) @@ -556,7 +564,7 @@ def _(self, node: coolAst.LowerEqual, scope: Scope): return expr_result_vm_holder @visit.register - def _(self, node: coolAst.GreaterThanNode, scope: Scope): + def _(self, node: coolAst.GreaterThanNode, scope: Scope) -> LocalNode: expr_result_vm_holder = self.define_internal_local() true_label = self.do_label("TRUE") end_label = self.do_label("END") @@ -567,6 +575,9 @@ def _(self, node: coolAst.GreaterThanNode, scope: Scope): # Obtener el valor de la expresion derecha right_vm_holder = self.visit(node.right, scope) + assert isinstance(left_vm_holder, LocalNode) and isinstance( + right_vm_holder, LocalNode) + self.register_instruction( cil.MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) @@ -586,7 +597,7 @@ def _(self, node: coolAst.GreaterThanNode, scope: Scope): return expr_result_vm_holder @visit.register - def _(self, node: coolAst.GreaterEqualNode, scope: Scope): + def _(self, node: coolAst.GreaterEqualNode, scope: Scope) -> LocalNode: expr_result_vm_holder = self.define_internal_local() true_label = self.do_label("TRUE") end_label = self.do_label("END") @@ -597,6 +608,9 @@ def _(self, node: coolAst.GreaterEqualNode, scope: Scope): # Obtener el valor de la expresion derecha right_vm_holder = self.visit(node.right, scope) + assert isinstance(left_vm_holder, LocalNode) and isinstance( + right_vm_holder, LocalNode) + self.register_instruction( cil.MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) @@ -622,12 +636,13 @@ def _(self, node: coolAst.GreaterEqualNode, scope: Scope): # ********************* @visit.register - def _(self, node: coolAst.FunCall, scope: Scope): + def _(self, node: coolAst.FunCall, scope: Scope) -> LocalNode: type_vm_holder = self.define_internal_local() return_vm_holder = self.define_internal_local() # Evaluar la expresion a la izquierda del punto expr = self.visit(node.obj, scope) + assert isinstance(expr, LocalNode) self.register_instruction(cil.TypeOfNode(expr, type_vm_holder)) # Evaluar los argumentos @@ -641,7 +656,7 @@ def _(self, node: coolAst.FunCall, scope: Scope): return return_vm_holder @visit.register - def _(self, node: coolAst.ParentFuncCall, scope: Scope): + def _(self, node: coolAst.ParentFuncCall, scope: Scope) -> LocalNode: local_type_identifier = self.define_internal_local() return_expr_vm_holder = self.define_internal_local() expr = self.visit(node.obj, scope) From 5653e63e892d5c64afe8d4478ad9a34b85ccce01 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Mon, 31 Aug 2020 15:36:05 -0400 Subject: [PATCH 069/162] Primera aproximacion a la instanciacion de clases --- src/mips/baseMipsVisitor.py | 21 +++++++++++++++ src/mips/instruction.py | 6 ++--- src/travels/ciltomips.py | 53 ++++++++++++++++++++++++++++++++++++- 3 files changed, 76 insertions(+), 4 deletions(-) diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 68e2504c..60389031 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -1,9 +1,12 @@ +from json import load from cil.nodes import TypeNode from cil.nodes import CilNode, FunctionNode +from mips import load_store import mips.instruction as instrNodes import mips.branch as branchNodes import mips.comparison as cmpNodes import mips.arithmetic as arithNodes +from mips.instruction import a0, v0 import mips.load_store as lsNodes from typing import List, Optional, Union import time @@ -215,3 +218,21 @@ def create_type_array(self, types: List[TypeNode]): # en la lista de tipos. for t in types: self.register_instruction(instrNodes.Label(t.name)) + + def allocate_memory(self, bytes_num: int): + """ + Reserva @bytes_num bytes en heap y devuelve la direccion de memoria asignada + en $v0. + """ + self.register_instruction( + instrNodes.LineComment(f"Allocating {bytes_num} of memory")) + + # Cargar la cantidad de bytes en el registro $a0 + self.register_instruction(load_store.LI(a0, bytes_num)) + + # $v0 = 9 (syscall 9 = sbrk) + self.register_instruction(load_store.LI(v0, 9)) + + # syscall + self.register_instruction(instrNodes.SYSCALL()) + # la direccion del espacio en memoria esta ahora en v0 diff --git a/src/mips/instruction.py b/src/mips/instruction.py index c16c7141..d30687dc 100644 --- a/src/mips/instruction.py +++ b/src/mips/instruction.py @@ -5,8 +5,8 @@ # ********************** REGISTROS ********************************* -zero = 0 # Siempre almacena la constante 0. -at = 1 # Reservado para el assembler. +zero = 0 # Siempre almacena la constante 0. +at = 1 # Reservado para el assembler. # Registros para almacenar resultados v0 = 2 @@ -148,7 +148,6 @@ def __str__(self): return f'{self.action} ${self.src1}, ${self.src2}, {self.label}' - # ******************** INSTRUCCIONES PARA ALMACENAR Y CARGAR DATOS EN REGISTROS ************ class AbstractLoadNode(MipsNode): def __init__(self, dest: int, src): @@ -224,6 +223,7 @@ def __init__(self, label: str): def __str__(self): return f"{self.label}: " + class FixedData(MipsNode): """ Representa un dato en la seccion .data. diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 59e26e7c..de4e71f7 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -274,7 +274,58 @@ def _(self, node: cil.SetAttributeNode): @visit.register def _(self, node: cil.AllocateNode): - pass + + # Cada instancia debe almacenar lo siguiente: + # - Un puntero a la vTable de su tipo + # - Espacio para cada atributo + # - Un puntero a su tipo en el array de tipos, de modo que sea facil calcular typeof + + ################################# address + # TYPE_POINTER # + ################################# address + 4 + # VTABLE_POINTER # + ################################# address + 8 + # ATTRIBUTE_1 # + ################################# address + 12 + # ATTRIBUTE_2 # + ################################# + # ... # + # ... # + # ... # + ################################# + + num_bytes = 8 # inicialmente necesita al menos dos punteros + dest = self.visit(node.dest) + + instance_type = node.itype + + assert dest is not None + + num_bytes += len(instance_type.attributes) + + # Reservar memoria para la instancia + self.allocate_memory(num_bytes) + + reg = self.get_available_register() + assert reg is not None, "Out of registers." + + # Inicializar la instancia + + # Cargar el puntero al tipo de la instancia + self.register_instruction(lsNodes.LA(dest=reg, src=instance_type.name)) + self.register_instruction(lsNodes.SW(dest=reg, src="0($v0)")) + + # Cargar el puntero a la VTABLE + self.register_instruction( + lsNodes.LA(dest=reg, src=f"{instance_type.name}_start")) + self.register_instruction(lsNodes.SW(dest=reg, src="4($v0)")) + + # TODO: Manejar los atributos + + # mover la direccion que almacena la instancia hacia dest + self.register_instruction(lsNodes.SW(v0, dest)) + + self.used_registers[reg] = False @visit.register def _(self, node: cil.TypeOfNode): From 2a5fa29ffcdd82db3af040ef36c0c566c7d17b06 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Mon, 31 Aug 2020 15:54:05 -0400 Subject: [PATCH 070/162] Implemented TypeOFNode --- src/travels/ciltomips.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index de4e71f7..64486b8a 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -301,6 +301,8 @@ def _(self, node: cil.AllocateNode): assert dest is not None + self.add_source_line_comment(node) + num_bytes += len(instance_type.attributes) # Reservar memoria para la instancia @@ -329,7 +331,22 @@ def _(self, node: cil.AllocateNode): @visit.register def _(self, node: cil.TypeOfNode): - pass + local_addr = self.get_location_address(node=node.variable) + return_addr = self.get_location_address(node=node.dest) + reg = self.get_available_register() + reg2 = self.get_available_register() + + assert reg is not None, "Out of registers" + assert reg2 is not None, "Out of registers" + + self.add_source_line_comment(node) + + self.register_instruction(lsNodes.LW(reg, local_addr)) + self.register_instruction(lsNodes.LW(reg2, f"0(${reg})")) + self.register_instruction(lsNodes.SW(reg2, return_addr)) + + self.used_registers[reg] = False + self.used_registers[reg2] = False @visit.register def _(self, node: cil.JumpIfGreaterThanZeroNode): From 780d032f3ec9ea48951a541c69f0929b1d7b8dce Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Mon, 31 Aug 2020 16:15:00 -0400 Subject: [PATCH 071/162] Implemented branching nodes --- src/mips/baseMipsVisitor.py | 19 +++++++++++++++++++ src/travels/ciltomips.py | 9 +++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 60389031..75834f10 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -236,3 +236,22 @@ def allocate_memory(self, bytes_num: int): # syscall self.register_instruction(instrNodes.SYSCALL()) # la direccion del espacio en memoria esta ahora en v0 + + def conditional_jump(self, node, condition, value=0, const=True): + """ + Realiza un salto condicional en dependencia de la condicion especificada + en @condition y toma por valor de comparacion @value. @const indica si @value + debe tomarse como una constante o como un registro. + """ + addr = self.get_location_address(node.variable) + reg = self.get_available_register() + + assert reg is not None, "Out of registers" + + self.add_source_line_comment(node) + + self.register_instruction(lsNodes.LW(reg, addr)) + # Comparar y saltar + self.register_instruction(condition(reg, value, node.label, const)) + + self.used_registers[reg] = False diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 64486b8a..e8368157 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -350,19 +350,20 @@ def _(self, node: cil.TypeOfNode): @visit.register def _(self, node: cil.JumpIfGreaterThanZeroNode): - pass + self.conditional_jump(node, branchNodes.BGT) @visit.register def _(self, node: cil.IfZeroJump): - pass + self.conditional_jump(node, branchNodes.BEQ) @visit.register def _(self, node: cil.NotZeroJump): - pass + self.conditional_jump(node, branchNodes.BNE) @visit.register def _(self, node: cil.UnconditionalJump): - pass + self.add_source_line_comment(node) + self.register_instruction(branchNodes.J(node.label)) @visit.register def _(self, node: cil.StaticCallNode): From 0961f9ddf7230f9f02ed25eb2675549640e12bda Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Tue, 1 Sep 2020 12:14:36 -0400 Subject: [PATCH 072/162] Implemented stack frames and StaticCallNode --- src/mips/baseMipsVisitor.py | 55 ++++++++++++++++++++++++++++++++- src/travels/ciltomips.py | 61 ++++++++++++++++++++----------------- 2 files changed, 87 insertions(+), 29 deletions(-) diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 75834f10..181202ee 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -6,7 +6,7 @@ import mips.branch as branchNodes import mips.comparison as cmpNodes import mips.arithmetic as arithNodes -from mips.instruction import a0, v0 +from mips.instruction import a0, fp, ra, sp, v0 import mips.load_store as lsNodes from typing import List, Optional, Union import time @@ -255,3 +255,56 @@ def conditional_jump(self, node, condition, value=0, const=True): self.register_instruction(condition(reg, value, node.label, const)) self.used_registers[reg] = False + + def allocate_stack_frame(self, node: FunctionNode): + """ + Crea el marco de pila necesario para ejecutar la funcion representada por @node. + """ + # Crear el marco de pila para la funcion + locals_count = len(node.localvars) + self.register_instruction( + instrNodes.LineComment( + f"Allocate stack frame for function {node.name}.")) + + # Salvar primero espacio para las variables locales + if locals_count * 4 < 24: # MIPS fuerza a un minimo de 32 bytes por stack frame + self.register_instruction(arithNodes.SUBU(sp, sp, 32, True)) + ret = 32 + else: + self.register_instruction( + arithNodes.SUBU(sp, sp, locals_count * 4 + 8, True)) + ret = locals_count * 4 + 8 + + # Salvar ra y fp + self.register_instruction(lsNodes.SW(ra, "8($sp)")) + self.register_instruction(lsNodes.SW(fp, "4($sp)")) + + # mover fp al inicio del frame + self.register_instruction(arithNodes.ADDU(fp, sp, ret, True)) + + def deallocate_stack_frame(self, node: FunctionNode): + """ + Deshace el marco de pila creado por un llamado a @allocate_stack_frame anterior. + Esta funcion solo es un espejo de lo que realiza @allocate_stack_frame. + """ + locals_count = len(node.localvars) + self.register_instruction( + instrNodes.LineComment( + f"Deallocate stack frame for function {node.name}.")) + + # Calcular cuantos bytes fueron reservados + if locals_count * 4 < 24: # MIPS fuerza a un minimo de 32 bytes por stack frame + ret = 32 + else: + ret = locals_count * 4 + 8 + + # restaurar ra y fp + self.register_instruction(instrNodes.LineComment("Restore $ra")) + self.register_instruction(lsNodes.LW(ra, "8($sp)")) + self.register_instruction(instrNodes.LineComment("Restore $fp")) + self.register_instruction(lsNodes.LW(fp, "4($sp)")) + + # restaurar el Stack Pointer + self.register_instruction( + instrNodes.LineComment("Restore Stack pointer $sp")) + self.register_instruction(arithNodes.ADDU(sp, sp, ret, True)) \ No newline at end of file diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index e8368157..9d4ebe9e 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -1,3 +1,4 @@ +from cil.nodes import LocalNode from mips.baseMipsVisitor import (BaseCilToMipsVisitor, DotDataDirective, DotGlobalDirective, DotTextDirective, instrNodes, arithNodes, cmpNodes, @@ -110,7 +111,6 @@ def _(self, node: cil.DataNode): @visit.register def _(self, node: cil.FunctionNode): - ret = 0 self.current_function = node # El codigo referente a cada funcion debe ir en la seccion de texto. self.register_instruction(DotTextDirective()) @@ -121,27 +121,8 @@ def _(self, node: cil.FunctionNode): # Direccion de memoria de la funcion. self.register_instruction(instrNodes.Label(node.name)) - # Crear el marco de pila para la funcion - locals_count = len(node.localvars) - self.register_instruction( - instrNodes.LineComment( - f"Allocate stack frame for function {node.name}.")) - - # Salvar primero espacio para las variables locales - if locals_count * 4 < 24: # MIPS fuerza a un minimo de 32 bytes por stack frame - self.register_instruction(arithNodes.SUBU(sp, sp, 32, True)) - ret = 32 - else: - self.register_instruction( - arithNodes.SUBU(sp, sp, locals_count * 4 + 8, True)) - ret = locals_count * 4 + 8 - - # Salvar ra y fp - self.register_instruction(lsNodes.SW(ra, "8($sp)")) - self.register_instruction(lsNodes.SW(fp, "4($sp)")) - - # mover fp al inicio del frame - self.register_instruction(arithNodes.ADDU(fp, sp, ret, True)) + # Crear el marco de pila de la funcion. + self.allocate_stack_frame(node) for instruction in node.instructions: self.visit(instruction) @@ -367,7 +348,18 @@ def _(self, node: cil.UnconditionalJump): @visit.register def _(self, node: cil.StaticCallNode): - pass + + # Registrar un comentario con la linea fuente + self.add_source_line_comment(node) + dest = self.visit(node.dest) + + assert dest is not None + + # Saltar hacia la direccion de memoria correspondiente a la funcion + self.register_instruction(branchNodes.JAL(node.function)) + + # EL resultado viene en v0 + self.register_instruction(lsNodes.SW(v0, dest)) @visit.register def _(self, node: cil.DynamicCallNode): @@ -379,14 +371,27 @@ def _(self, node: cil.ArgNode): @visit.register def _(self, node: cil.ReturnNode): - pass + # Generar dos formas de codigo en dependencia de si se devuelve un valor o no + self.add_source_line_comment(node) + val = node.value + if val is not None: + if isinstance(val, LocalNode): + src = self.get_location_address(val) + # almacenar el resultado en $v0 + self.register_instruction(lsNodes.LW(v0, src)) + else: + # val es una constante + self.register_instruction(lsNodes.LI(v0, val)) - @visit.register - def _(self, node: cil.LoadNode): - pass + # Liberar el marco de pila + assert self.current_function is not None + self.deallocate_stack_frame(self.current_function) + + # salir del llamado de la funcion + self.register_instruction(branchNodes.JR(ra)) @visit.register - def _(self, node: cil.LengthNode): + def _(self, node: cil.LoadNode): pass @visit.register From 45f9b97190c34f7449cd6a4c31010dfdaf80463f Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Wed, 2 Sep 2020 17:38:46 -0400 Subject: [PATCH 073/162] Implemented DinamicCall and VTABLE --- src/abstract/semantics.py | 1 + src/cil/nodes.py | 8 ++-- src/mips/baseMipsVisitor.py | 23 ++++++++-- src/travels/ciltomips.py | 89 +++++++++++++++++++++++++++++-------- src/travels/ctcill.py | 4 -- 5 files changed, 96 insertions(+), 29 deletions(-) diff --git a/src/abstract/semantics.py b/src/abstract/semantics.py index 93f4f7c9..2f8c2eec 100755 --- a/src/abstract/semantics.py +++ b/src/abstract/semantics.py @@ -101,6 +101,7 @@ def __init__(self, name: str, param_names: List[str], self.param_names = param_names self.param_types = params_types self.return_type = return_type + self.vtable_index = 0 def __str__(self): params = ', '.join(f'{n}:{t.name}' diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 5b78b6ff..686f186c 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -1,5 +1,5 @@ -from typing import List -from abstract.semantics import Attribute, Type +from typing import List, Tuple +from abstract.semantics import Attribute, Method, Type """ Define a hierachy to represent each CIL instruction. Every CIL Instruction would be a Node of an AST, and every\ @@ -22,7 +22,7 @@ class TypeNode(CilNode): def __init__(self, name: str): self.name = name self.attributes: List[Attribute] = [] - self.methods = [] + self.methods: List[Tuple[str, str]] = [] class DataNode(CilNode): @@ -161,7 +161,7 @@ def __init__(self, function: str, dest: LocalNode): class DynamicCallNode(InstructionNode): - def __init__(self, xtype, method, dest): + def __init__(self, xtype: LocalNode, method: str, dest: LocalNode): self.xtype = xtype self.method = method self.dest = dest diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 181202ee..cba2416e 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -8,7 +8,7 @@ import mips.arithmetic as arithNodes from mips.instruction import a0, fp, ra, sp, v0 import mips.load_store as lsNodes -from typing import List, Optional, Union +from typing import List, Optional, Type, Union import time import cil.nodes as cil from travels.ctcill import CilDisplayFormatter @@ -86,6 +86,9 @@ def __init__(self): # almacenar valores intermedios y valores de variables, para evitar accesos a memoria. self.used_registers = [False] * 32 + # Necesitamos acceso a los tipos del programa + self.types: List[TypeNode] = [] + # Construir el header del programa. self.__program_header() @@ -170,7 +173,7 @@ def cil_func_signature(self, func: FunctionNode): self.register_instruction( instrNodes.LineComment(f"\t{(i-4) * 4}($fp) = {param}")) - def operate(self, dest, left, right, operand): + def operate(self, dest, left, right, operand: Type): """ Realiza la operacion indicada por operand entre left y right y la guarda en dest. @@ -307,4 +310,18 @@ def deallocate_stack_frame(self, node: FunctionNode): # restaurar el Stack Pointer self.register_instruction( instrNodes.LineComment("Restore Stack pointer $sp")) - self.register_instruction(arithNodes.ADDU(sp, sp, ret, True)) \ No newline at end of file + self.register_instruction(arithNodes.ADDU(sp, sp, ret, True)) + + def get_method_index(self, method: str): + """ + Devuelve el indice de un metodo en las tablas virtuales. + Los metodos, ocupan el mismo indice en todas las vtables que aparezcan. + """ + for typ in self.types: + for i, (methodName, _) in enumerate(typ.methods): + if methodName == method: + return i + return 0 + + def comment(self, message: str): + self.register_instruction(instrNodes.LineComment(message)) \ No newline at end of file diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 9d4ebe9e..5d9c536e 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -1,3 +1,4 @@ +from abstract.semantics import Type from cil.nodes import LocalNode from mips.baseMipsVisitor import (BaseCilToMipsVisitor, DotDataDirective, DotGlobalDirective, DotTextDirective, @@ -20,6 +21,8 @@ def _(self, node: cil.CilProgramNode): # El programa de CIL se compone por las 3 secciones # .TYPES, .DATA y .CODE + self.types = node.dottypes + # Generar los tipos self.create_type_array(node.dottypes) @@ -36,8 +39,7 @@ def _(self, node: cil.CilProgramNode): self.visit(code_node) # registrar instrucciones para terminar la ejecucion - self.register_instruction( - instrNodes.LineComment("syscall code 10 is for exit")) + self.comment("syscall code 10 is for exit") self.register_instruction(lsNodes.LI(v0, 10)) self.register_instruction(instrNodes.SYSCALL()) @@ -50,8 +52,7 @@ def _(self, node: cil.TypeNode): # noqa: F811 self.register_instruction(DotDataDirective()) # Construir la VTABLE para este tipo. - self.register_instruction( - instrNodes.LineComment(f" **** VTABLE for type {node.name} ****")) + self.comment(f" **** VTABLE for type {node.name} ****") # Los punteros a funciones estaran definidos en el orden en que aparecen declaradas en las clases # de modo que la VTABLE sea indexable y podamos efectuar VCALL en O(1). @@ -59,11 +60,23 @@ def _(self, node: cil.TypeNode): # noqa: F811 instrNodes.FixedData(f'{node.name}_vtable', ", ".join(x[1] for x in node.methods))) - self.register_instruction((instrNodes.LineComment( - f" **** Type RECORD for type {node.name} ****"))) + # FORMA DE UN TIPO EN ASSEMBLY + ##################################### Type address + # VTABLE_POINTER # + ##################################### Type address + 4 + # ATTRIBUTE_LIST_POINTER # + ##################################### + + self.comment(f" **** Type RECORD for type {node.name} ****") # Declarar la direccion de memoria donde comienza el tipo self.register_instruction( instrNodes.Label(f"{self.current_type.name}_start")) + + # Registrar un puntero a la VTABLE del tipo. + self.register_instruction( + instrNodes.FixedData(f'{node.name}_vtable_pointer', + f"{node.name}_vtable")) + # Declarar los atributos: Si los atributos son de tipo string, guardarlos como asciiz # de lo contrario son o numeros o punteros y se inicializan como .words for attrib in self.current_type.attributes: @@ -76,10 +89,6 @@ def _(self, node: cil.TypeNode): # noqa: F811 instrNodes.FixedData(f'{node.name}_attrib_{attrib.name}', 0)) - # Registrar un puntero a la VTABLE del tipo. - self.register_instruction( - instrNodes.FixedData(f'{node.name}_vtable_pointer', - f"{node.name}_vtable")) # Registrar la direccion de memoria donde termina el tipo para calcular facilmente # sizeof self.register_instruction(instrNodes.Label(f"{node.name}_end")) @@ -138,8 +147,7 @@ def _(self, node: cil.ParamNode): label = self.get_location_address(node) # Agregar la linea que vamos a traducir. - self.register_instruction( - instrNodes.LineComment(f"PARAM {node.name} --> {label}")) + self.comment(f"PARAM {node.name} --> {label}") return label @@ -148,11 +156,14 @@ def _(self, node: cil.LocalNode): label = self.get_location_address(node) # Agregar la linea que vamos a traducir. - self.register_instruction( - instrNodes.LineComment(f"LOCAL {node.name} --> {label}")) + self.comment(f"LOCAL {node.name} --> {label}") return label + @visit.register + def _(self, node: Type): + return node.name + @visit.register def _(self, node: cil.AssignNode): assert self.current_function is not None @@ -181,8 +192,9 @@ def _(self, node: cil.AssignNode): self.register_instruction(lsNodes.LI(s0, source)) self.register_instruction(lsNodes.SW(s0, dest)) self.register_instruction(lsNodes.LI(s0, "0($sp)")) + elif isinstance(source, str): - # Source es una direccion de memoria + # Source es una direccion de memoria (Puede ser un label, en caso de que sea un tipo) reg1 = self.get_available_register() assert reg1 is not None self.register_instruction(lsNodes.LW(reg1, source)) @@ -255,7 +267,6 @@ def _(self, node: cil.SetAttributeNode): @visit.register def _(self, node: cil.AllocateNode): - # Cada instancia debe almacenar lo siguiente: # - Un puntero a la vTable de su tipo # - Espacio para cada atributo @@ -323,7 +334,8 @@ def _(self, node: cil.TypeOfNode): self.add_source_line_comment(node) self.register_instruction(lsNodes.LW(reg, local_addr)) - self.register_instruction(lsNodes.LW(reg2, f"0(${reg})")) + self.comment("Load pointer to type") + self.register_instruction(lsNodes.LW(reg2, f"4(${reg})")) self.register_instruction(lsNodes.SW(reg2, return_addr)) self.used_registers[reg] = False @@ -331,14 +343,17 @@ def _(self, node: cil.TypeOfNode): @visit.register def _(self, node: cil.JumpIfGreaterThanZeroNode): + self.add_source_line_comment(node) self.conditional_jump(node, branchNodes.BGT) @visit.register def _(self, node: cil.IfZeroJump): + self.add_source_line_comment(node) self.conditional_jump(node, branchNodes.BEQ) @visit.register def _(self, node: cil.NotZeroJump): + self.add_source_line_comment(node) self.conditional_jump(node, branchNodes.BNE) @visit.register @@ -363,7 +378,45 @@ def _(self, node: cil.StaticCallNode): @visit.register def _(self, node: cil.DynamicCallNode): - pass + type_src = self.visit(node.xtype) + dest = self.visit(node.dest) + + assert type_src is not None and dest is not None + + # Generar el comentario de la linea fuente + self.add_source_line_comment(node) + + # obtener el indice que le corresponde a la funcion que estamos llamando + i = self.get_method_index(node.method) + + # Reservar registros para operaciones intermedias + reg1 = self.get_available_register() + reg2 = self.get_available_register() + reg3 = self.get_available_register() + assert reg1 is not None and reg2 is not None and reg3 is not None, "out of registers" + + # Cargar el puuntero al tipo en el primer registro + self.comment("Get pointer to type") + self.register_instruction(lsNodes.LW(reg1, type_src)) + + # Cargar el puntero a la VTABLE en el segundo registro + self.comment("Get pointer to type's VTABLE") + self.register_instruction(lsNodes.LW(reg2, f"0(${reg1})")) + + # Cargar el puntero a la funcion correspondiente en el tercer registro + self.comment("Get pointer to function address") + self.register_instruction(lsNodes.LW(reg3, f"{i * 4}(${reg2})")) + + # saltar hacia la direccion de memoria correspondiente a la funcion + self.comment("Call function. Result is on $v0") + self.register_instruction(branchNodes.JALR(reg3)) + + # El resultado viene en $v0 + self.register_instruction(lsNodes.SW(v0, dest)) + + self.used_registers[reg1] = False + self.used_registers[reg2] = False + self.used_registers[reg3] = False @visit.register def _(self, node: cil.ArgNode): diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index cbe376fc..ad2266a2 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -49,9 +49,6 @@ def _(self, node: coolAst.ProgramNode, @visit.register def _(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 - # node.idx -> String with the Class Name - # node.features -> [AttributeDef ... MethodDef ...] List with attributes and method declarations - # Register the new type in .Types section self.current_type = self.context.get_type(node.idx) new_type_node = self.register_type(node.idx) @@ -659,7 +656,6 @@ def _(self, node: coolAst.FunCall, scope: Scope) -> LocalNode: def _(self, node: coolAst.ParentFuncCall, scope: Scope) -> LocalNode: local_type_identifier = self.define_internal_local() return_expr_vm_holder = self.define_internal_local() - expr = self.visit(node.obj, scope) # Evaluar los argumentos for arg in node.arg_list: From cacca3b684232373894648542a66df760749e431 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Wed, 2 Sep 2020 19:46:56 -0400 Subject: [PATCH 074/162] Implemented LoadNode --- src/travels/ciltomips.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 5d9c536e..e579435e 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -64,8 +64,10 @@ def _(self, node: cil.TypeNode): # noqa: F811 ##################################### Type address # VTABLE_POINTER # ##################################### Type address + 4 - # ATTRIBUTE_LIST_POINTER # - ##################################### + # ATTRIBUTE_LIST # + # .......... # + # .......... # + ##################################### Type_end self.comment(f" **** Type RECORD for type {node.name} ****") # Declarar la direccion de memoria donde comienza el tipo @@ -445,7 +447,17 @@ def _(self, node: cil.ReturnNode): @visit.register def _(self, node: cil.LoadNode): - pass + dest = self.visit(node.dest) + assert dest is not None + + # message es un string, asi que solo hay que cargar el puntero a dicho string + reg = self.get_available_register() + assert reg is not None, "Out of registers" + self.add_source_line_comment(node) + self.register_instruction(lsNodes.LW(reg, node.message.name)) + self.register_instruction(lsNodes.SW(reg, dest)) + + self.used_registers[reg] = False @visit.register def _(self, node: cil.LengthNode): From 7f87411e3079fb175b21d80de73300b1c9222770 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 3 Sep 2020 11:50:36 -0400 Subject: [PATCH 075/162] Implement ArgNode --- src/mips/baseMipsVisitor.py | 4 ++-- src/mips/instruction.py | 1 + src/travels/ciltomips.py | 23 ++++++++++++++++++++++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index cba2416e..e49a7eec 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -302,9 +302,9 @@ def deallocate_stack_frame(self, node: FunctionNode): ret = locals_count * 4 + 8 # restaurar ra y fp - self.register_instruction(instrNodes.LineComment("Restore $ra")) + self.comment("Restore $ra") self.register_instruction(lsNodes.LW(ra, "8($sp)")) - self.register_instruction(instrNodes.LineComment("Restore $fp")) + self.comment("Restore $fp") self.register_instruction(lsNodes.LW(fp, "4($sp)")) # restaurar el Stack Pointer diff --git a/src/mips/instruction.py b/src/mips/instruction.py index d30687dc..dc2f9d77 100644 --- a/src/mips/instruction.py +++ b/src/mips/instruction.py @@ -57,6 +57,7 @@ ra = 31 TEMP_REGISTERS = (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) +ARGS_REGISTERS = (a0, a1, a2, a3) class MipsNode: diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index e579435e..c2c1e9eb 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -422,7 +422,22 @@ def _(self, node: cil.DynamicCallNode): @visit.register def _(self, node: cil.ArgNode): - pass + # Pasar los argumentos en la pila. #TODO: Pasarlos en registros + self.add_source_line_comment(node) + src = self.visit(node.name) + reg = self.get_available_register() + assert src is not None and reg is not None + + if isinstance(src, int): + self.register_instruction(lsNodes.LI(reg, src)) + else: + self.register_instruction(lsNodes.LW(reg, src)) + + self.comment("Push arg into stack") + self.register_instruction(arithNodes.SUBU(sp, sp, 4, True)) + self.register_instruction(lsNodes.SW(reg, "0($sp)")) + + self.used_registers[reg] = False @visit.register def _(self, node: cil.ReturnNode): @@ -459,6 +474,8 @@ def _(self, node: cil.LoadNode): self.used_registers[reg] = False + ## NODOS REFERENTES A OPERACIONES BUILT-IN DE COOL ## + @visit.register def _(self, node: cil.LengthNode): pass @@ -488,6 +505,10 @@ def _(self, node: cil.TdtLookupNode): # Los nodos TDT siempre tienen pass + @visit.register + def _(self, node: int): + return node + class MipsCodeGenerator(CilToMipsVisitor): """ From 8fb849697f089590a975d8cddc868f609cfd71d1 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 3 Sep 2020 14:24:02 -0400 Subject: [PATCH 076/162] Complete compiler pipeline --- src/pycoolc.py | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/pycoolc.py b/src/pycoolc.py index 87a0e0dd..b8baa871 100644 --- a/src/pycoolc.py +++ b/src/pycoolc.py @@ -1,4 +1,7 @@ from build.compiler_struct import LEXER, PARSER +from cil.nodes import CilProgramNode +from travels.ciltomips import MipsCodeGenerator +from travels.ctcill import CoolToCILVisitor from typecheck.evaluator import evaluate_right_parse from comments import find_comments from argparse import ArgumentParser @@ -10,7 +13,7 @@ def report(errors: list): print(error) -def pipeline(program: str, deep: int) -> None: +def pipeline(program: str, deep: int, file_name: str) -> None: try: program = find_comments(program) except AssertionError as e: @@ -41,11 +44,28 @@ def pipeline(program: str, deep: int) -> None: ###################### # Run type checker visitor - errors, context = ast.check_semantics(deep) + errors, context, scope = ast.check_semantics(deep) if errors: report(errors) sys.exit(1) + # Run Cool to CIL visitor + cil_visitor = CoolToCILVisitor(context) + try: + cil_program = cil_visitor.visit(ast) + except Exception as e: + print(e) + sys.exit(1) + + assert isinstance(cil_program, CilProgramNode) + + # Run CIL to MIPS visitor + code_gen = MipsCodeGenerator() + file_str = code_gen(cil_program) + + with open(f"{file_name}.mips", "w+") as f: + f.write(file_str) + if __name__ == '__main__': parser = ArgumentParser() @@ -55,5 +75,5 @@ def pipeline(program: str, deep: int) -> None: deep = 3 if args.deep is None else args.deep with open(args.file, "r") as f: program = f.read() - pipeline(program, deep) + pipeline(program, deep, args.file) sys.exit(0) From 0c6c0067719e8fe4f01af20574a4f14c69512258 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 3 Sep 2020 14:34:01 -0400 Subject: [PATCH 077/162] Remove printing in Inferer Visitor --- src/abstract/tree.py | 2 -- src/travels/inference.py | 6 ------ 2 files changed, 8 deletions(-) diff --git a/src/abstract/tree.py b/src/abstract/tree.py index e42bb98b..727d6386 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -34,9 +34,7 @@ def check_semantics(self, deep=1): inferer = inference.TypeInferer(type_builder.context, errors=errors) for d in range(1, deep + 1): - print(d) scope = inferer.visit(self, scope=scope, deep=d) - print(scope) # reportar los errores return errors, type_builder.context, scope diff --git a/src/travels/inference.py b/src/travels/inference.py index 5e72c927..0b3d2478 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -60,7 +60,6 @@ def _(self, infered_type=None, deep=1): # noqa: F811 program_scope = semantic.Scope() if scope is None else scope - print(f"Este es el scope en la vuelta {deep} :\n {program_scope}") if deep == 1: for class_ in node.class_list: self.visit(class_, program_scope.create_child()) @@ -120,7 +119,6 @@ def _(self, scope, infered_type=None, deep=1): # noqa: F811 - print(node.idx) method = self.current_type.get_method(node.idx) self.current_method = method for param in node.param_list: @@ -128,13 +126,11 @@ def _(self, last = self.visit(node.statements, scope, deep=deep) if not method.return_type != self.AUTO_TYPE: - print(f'Infered type {last.name} for {node.idx}') method.return_type = last else: if not last.conforms_to(method.return_type): self.errors.append( f'Method {method.name} cannot return {last}') - print(scope) @visit.register def _(self, @@ -175,7 +171,6 @@ def _(self, if var_info: e = self.visit(node.expr, scope, infered_type) if var_info.type == self.AUTO_TYPE: - print(f'Infered type {e.name} for {node.idx}') var_info.type = e if not scope.is_local(var_info.name): update_attr_type(self.current_type, var_info.name, @@ -205,7 +200,6 @@ def _(self, assert self.current_type is not None if var_info: if infered_type and var_info.type == self.AUTO_TYPE: - print(f'Infered type {infered_type.name} for {var_info.name}') var_info.type = infered_type if not scope.is_local(var_info.name): update_attr_type(self.current_type, var_info.name, From d79b122e25cfde596827377d7c4718bba0191637 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 3 Sep 2020 15:41:26 -0400 Subject: [PATCH 078/162] Tunning cil and mips display formatter --- src/abstract/tree.py | 15 +++++++++++++++ src/mips/baseMipsVisitor.py | 8 ++++---- src/testing.py | 29 +++++++++++++++++++++-------- src/travels/ciltomips.py | 10 +++++++++- src/travels/ctcill.py | 31 +++++++++++++++++++------------ src/typecheck/evaluator.py | 16 +++++++++------- 6 files changed, 77 insertions(+), 32 deletions(-) diff --git a/src/abstract/tree.py b/src/abstract/tree.py index 727d6386..32066548 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -1,5 +1,7 @@ from typing import List, Optional, Tuple, Union +from abstract.semantics import SemanticError + class Node: pass @@ -28,6 +30,19 @@ def check_semantics(self, deep=1): type_builder = typebuilder.TypeBuilder(type_collector.context, type_collector.errors) type_builder.visit(self) + + # Garantizar que exista un tipo Main que contenga un + # metodo main + context = type_builder.context + try: + context.get_type('Main') + context.get_type('Main').methods['main'] + except SemanticError as e: + type_builder.errors.append(str(e)) + except KeyError: + type_builder.errors.append( + f"Main class must contain a main method.") + errors = type_builder.errors scope = None if not errors: diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index e49a7eec..a5ffe651 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -107,10 +107,10 @@ def __program_header(self): ep = 'Eliane Puerta' la = 'Liset Alfaro' institution = 'School of Math and Computer Science, University of Havana' - self.register_instruction(instrNodes.LineComment(coolc)) - self.register_instruction( - instrNodes.LineComment(f'{ep}, {la}, {ad} --- {date}')) - self.register_instruction(instrNodes.LineComment(institution)) + self.comment(coolc) + self.comment(f'{ep}, {la}, {ad} --- {date}') + self.comment(institution) + self.comment("\n") # Funcion de ayuda para obtener la direccion de memoria de un parametro o una variable def get_location_address(self, node: Union[cil.ParamNode, diff --git a/src/testing.py b/src/testing.py index 0cb54912..69c1efab 100755 --- a/src/testing.py +++ b/src/testing.py @@ -1,5 +1,6 @@ # type: ignore from build.compiler_struct import LEXER, PARSER +from travels.ciltomips import MipsCodeGenerator from typecheck.evaluator import evaluate_right_parse from comments import find_comments from travels.ctcill import CilDisplayFormatter, CoolToCILVisitor @@ -33,12 +34,12 @@ def pipeline(program: str, deep: int) -> None: print(e) sys.exit(1) # build the AST from the obtained parse - try: - ast = evaluate_right_parse(parse, tokens[:-1]) - print("BUILDING AST DONE!!!") - except Exception as e: - print(e) - sys.exit(1) + # try: + ast = evaluate_right_parse(parse, tokens[:-1]) + print("BUILDING AST DONE!!!") + # except Exception as e: + # print(e) + # sys.exit(1) ##################### # Start the visitors # ###################### @@ -51,12 +52,15 @@ def pipeline(program: str, deep: int) -> None: sys.exit(1) print("SEMENATIC CHECK DONE!!!") - print(scope) cil_travel = CoolToCILVisitor(context) cil_program_node = cil_travel.visit(ast, scope) formatter = CilDisplayFormatter() print(formatter(cil_program_node)) + mips_gen = MipsCodeGenerator() + source = mips_gen(cil_program_node) + print(source) + text = """ class A { @@ -72,10 +76,19 @@ class B inherits A { f ( d : Int , a : A ) : Int { { let f : Int in 8 ; - let c : Int in (new A) . suma ( 5 , f ) ; + let c : Int in a. suma ( 5 , f ) ; c; } }; }; + +class Main { + + main(): Object { + { + (new B).f(5, (new A)); + } + }; +}; """ pipeline(text, 5) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index c2c1e9eb..17ee8934 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -26,13 +26,17 @@ def _(self, node: cil.CilProgramNode): # Generar los tipos self.create_type_array(node.dottypes) + self.comment("\n\n") + # Visitar cada nodo de la seccion .TYPES for type_node in node.dottypes: self.visit(type_node) + self.comment("\n\n") # Visitar cada nodo de la seccion .DATA for data_node in node.dotdata: self.visit(data_node) + self.comment("\n\n") # Visitar cada nodo de la seccion .CODE for code_node in node.dotcode: @@ -60,6 +64,8 @@ def _(self, node: cil.TypeNode): # noqa: F811 instrNodes.FixedData(f'{node.name}_vtable', ", ".join(x[1] for x in node.methods))) + self.comment("\n\n") + # FORMA DE UN TIPO EN ASSEMBLY ##################################### Type address # VTABLE_POINTER # @@ -140,6 +146,8 @@ def _(self, node: cil.FunctionNode): self.current_function = None + self.comment("\n\n") + @visit.register def _(self, node: cil.LabelNode): self.register_instruction(instrNodes.Label(node.label)) @@ -520,4 +528,4 @@ class MipsCodeGenerator(CilToMipsVisitor): """ def __call__(self, ast: cil.CilProgramNode) -> str: self.visit(ast) - return "".join(str(x) for x in self.program) + return "\n".join(str(x) for x in self.program) diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index ad2266a2..20c5c555 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -693,7 +693,7 @@ def _(self, node: cil.CilProgramNode): @visit.register def _(self, node: cil.TypeNode): - attributes = '\n\t'.join(f'attribute {x}' for x in node.attributes) + attributes = '\n\t'.join(f'{x}' for x in node.attributes) methods = '\n\t'.join(f'method {x}: {y}' for x, y in node.methods) return f'type {node.name} {{\n\t{attributes}\n\n\t{methods}\n}}' @@ -704,7 +704,7 @@ def _(self, node: cil.FunctionNode): localvars = '\n\t'.join(self.visit(x) for x in node.localvars) instructions = '\n\t'.join(self.visit(x) for x in node.instructions) - return f'function {node.name} {{\n\t{params}\n\n\t{localvars}\n\n\t{instructions}\n}}' + return f'{node.name} {{\n\t{params}\n\n\t{localvars}\n\n\t{instructions}\n}}' @visit.register def _(self, node: cil.ParamNode) -> str: @@ -712,7 +712,7 @@ def _(self, node: cil.ParamNode) -> str: @visit.register def _(self, node: cil.LocalNode) -> str: - return f'LOCAL {node.name}' + return f'{node.name}' @visit.register def _(self, node: cil.AssignNode) -> str: @@ -736,15 +736,15 @@ def _(self, node: cil.DivNode) -> str: @visit.register def _(self, node: cil.AllocateNode) -> str: - return f'{self.visit(node.dest)} = ALLOCATE {node.itype}' + return f'{self.visit(node.dest)} = ALLOCATE {node.itype.name}' @visit.register def _(self, node: cil.TypeOfNode) -> str: - return f'{self.visit(node.dest)} = TYPEOF {node.variable}' + return f'{self.visit(node.dest)} = TYPEOF {node.variable.name}' @visit.register def _(self, node: cil.DynamicCallNode) -> str: - return f'{self.visit(node.dest)} = VCALL {node.xtype} {node.method}' + return f'{self.visit(node.dest)} = VCALL {node.xtype.name} {node.method}' @visit.register def _(self, node: cil.StaticCallNode) -> str: @@ -752,11 +752,18 @@ def _(self, node: cil.StaticCallNode) -> str: @visit.register def _(self, node: cil.ArgNode) -> str: - return f'ARG {node.name}' + if isinstance(node.name, int): + return f'ARG {self.visit(node.name)}' + else: + return f'ARG {node.name.name}' @visit.register def _(self, node: cil.ReturnNode) -> str: - return f'RETURN {node.value if node.value is not None else ""}' + if isinstance(node.value, int): + return f'RETURN {node.value}' + elif isinstance(node.value, LocalNode): + return f'RETURN {node.value.name}' + return "RETURN" @visit.register def _(self, node: cil.DataNode) -> str: @@ -769,15 +776,15 @@ def _(self, node: cil.DataNode) -> str: @visit.register def _(self, node: cil.GetTypeIndex) -> str: - return f'{self.visit(node.dest)} = GETTYPEINDEX {node.itype}' + return f'{node.dest} = GETTYPEINDEX {node.itype}' @visit.register def _(self, node: cil.TdtLookupNode) -> str: - return f'{self.visit(node.dest)} = TYPE_DISTANCE {node.i} {node.j}' + return f'{node.dest.name} = TYPE_DISTANCE {node.i} {node.j}' @visit.register def _(self, node: cil.IfZeroJump) -> str: - return f'IF_ZERO {node.variable} GOTO {node.label}' + return f'IF_ZERO {node.variable.name} GOTO {node.label}' @visit.register def _(self, node: cil.UnconditionalJump) -> str: @@ -785,7 +792,7 @@ def _(self, node: cil.UnconditionalJump) -> str: @visit.register def _(self, node: cil.JumpIfGreaterThanZeroNode) -> str: - return f'IF_GREATER_ZERO {node.variable} GOTO {node.label}' + return f'IF_GREATER_ZERO {node.variable.name} GOTO {node.label}' @visit.register def _(self, node: cil.LabelNode) -> str: diff --git a/src/typecheck/evaluator.py b/src/typecheck/evaluator.py index f25ccc46..11b62f4a 100755 --- a/src/typecheck/evaluator.py +++ b/src/typecheck/evaluator.py @@ -1,17 +1,19 @@ from typing import Iterable, Any -def evaluate_right_parse(parse: Iterable[Any], tokens): +def evaluate_right_parse(parse, tokens): def evaluate_production(productions, production, tokens): synteticed = [None] * (len(production.Right) + 1) rules = production.attributes - for i, symbol in enumerate(production.Right[::-1], 1): - if symbol.IsTerminal: - synteticed[len(synteticed) - i] = next(tokens).lex - else: - synteticed[len(synteticed) - i] = evaluate_production( - productions, next(productions), tokens) + if not production.Right.IsEpsilon: + + for i, symbol in enumerate(production.Right[::-1], 1): + if symbol.IsTerminal: + synteticed[len(synteticed) - i] = next(tokens).lex + else: + synteticed[len(synteticed) - i] = evaluate_production( + productions, next(productions), tokens) rule = rules[0] return rule(synteticed) if rule else None From 6ea05547e5aafd425b0abadcfb085fc601c47e44 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 3 Sep 2020 16:42:25 -0400 Subject: [PATCH 079/162] Fix allignment in Type's memory allocation --- src/cil/nodes.py | 4 ++-- src/mips/baseMipsVisitor.py | 2 +- src/travels/ciltomips.py | 2 +- src/travels/ctcill.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 686f186c..01cec983 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -1,4 +1,4 @@ -from typing import List, Tuple +from typing import List, Tuple, Union from abstract.semantics import Attribute, Method, Type """ Define a hierachy to represent each CIL instruction. @@ -121,7 +121,7 @@ class ArrayNode(InstructionNode): class TypeOfNode(InstructionNode): - def __init__(self, variable: LocalNode, dest: LocalNode): + def __init__(self, variable: Union[LocalNode, ParamNode], dest: LocalNode): self.variable = variable self.dest = dest diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index a5ffe651..cc47b5ab 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -228,7 +228,7 @@ def allocate_memory(self, bytes_num: int): en $v0. """ self.register_instruction( - instrNodes.LineComment(f"Allocating {bytes_num} of memory")) + instrNodes.LineComment(f"Allocating {bytes_num} bytes of memory")) # Cargar la cantidad de bytes en el registro $a0 self.register_instruction(load_store.LI(a0, bytes_num)) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 17ee8934..8623af2d 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -305,7 +305,7 @@ def _(self, node: cil.AllocateNode): self.add_source_line_comment(node) - num_bytes += len(instance_type.attributes) + num_bytes += len(instance_type.attributes) * 4 # Reservar memoria para la instancia self.allocate_memory(num_bytes) diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 20c5c555..6004bbeb 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -5,7 +5,7 @@ from typing import List, Optional, Tuple from functools import singledispatchmethod -from cil.nodes import CilNode, LocalNode +from cil.nodes import CilNode, LocalNode, ParamNode ExpressionReturn = Tuple[List[cil.InstructionNode], List[cil.LocalNode]] Scope = semantics.Scope @@ -639,7 +639,7 @@ def _(self, node: coolAst.FunCall, scope: Scope) -> LocalNode: # Evaluar la expresion a la izquierda del punto expr = self.visit(node.obj, scope) - assert isinstance(expr, LocalNode) + assert isinstance(expr, LocalNode) or isinstance(expr, ParamNode) self.register_instruction(cil.TypeOfNode(expr, type_vm_holder)) # Evaluar los argumentos From 15f04544ed216cb313c0ea4f3257334b60a2eb08 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 3 Sep 2020 22:52:32 -0400 Subject: [PATCH 080/162] Remove unused imports in baseMipsVisitor.py --- src/mips/baseMipsVisitor.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index cc47b5ab..37610cd9 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -3,8 +3,6 @@ from cil.nodes import CilNode, FunctionNode from mips import load_store import mips.instruction as instrNodes -import mips.branch as branchNodes -import mips.comparison as cmpNodes import mips.arithmetic as arithNodes from mips.instruction import a0, fp, ra, sp, v0 import mips.load_store as lsNodes From 4053ffd8057a590afc9acd76190f89099fb959eb Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 4 Sep 2020 13:07:02 -0400 Subject: [PATCH 081/162] Fix args deallocation --- src/mips/baseMipsVisitor.py | 20 +++++++++++++------- src/travels/ciltomips.py | 9 ++++++--- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 37610cd9..994b7f95 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -1,4 +1,6 @@ from json import load + +from typed_ast.ast3 import arg from cil.nodes import TypeNode from cil.nodes import CilNode, FunctionNode from mips import load_store @@ -277,8 +279,8 @@ def allocate_stack_frame(self, node: FunctionNode): ret = locals_count * 4 + 8 # Salvar ra y fp - self.register_instruction(lsNodes.SW(ra, "8($sp)")) - self.register_instruction(lsNodes.SW(fp, "4($sp)")) + self.register_instruction(lsNodes.SW(ra, "4($sp)")) + self.register_instruction(lsNodes.SW(fp, "0($sp)")) # mover fp al inicio del frame self.register_instruction(arithNodes.ADDU(fp, sp, ret, True)) @@ -301,13 +303,12 @@ def deallocate_stack_frame(self, node: FunctionNode): # restaurar ra y fp self.comment("Restore $ra") - self.register_instruction(lsNodes.LW(ra, "8($sp)")) + self.register_instruction(lsNodes.LW(ra, "4($sp)")) self.comment("Restore $fp") - self.register_instruction(lsNodes.LW(fp, "4($sp)")) + self.register_instruction(lsNodes.LW(fp, "0($sp)")) # restaurar el Stack Pointer - self.register_instruction( - instrNodes.LineComment("Restore Stack pointer $sp")) + self.comment("Restore Stack pointer $sp") self.register_instruction(arithNodes.ADDU(sp, sp, ret, True)) def get_method_index(self, method: str): @@ -322,4 +323,9 @@ def get_method_index(self, method: str): return 0 def comment(self, message: str): - self.register_instruction(instrNodes.LineComment(message)) \ No newline at end of file + self.register_instruction(instrNodes.LineComment(message)) + + def deallocate_args(self, func: FunctionNode): + args = len(func.params) + if args > 0: + self.register_instruction(arithNodes.ADDU(sp, sp, 4 * args, True)) \ No newline at end of file diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 8623af2d..55b2e388 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -1,13 +1,13 @@ from abstract.semantics import Type from cil.nodes import LocalNode from mips.baseMipsVisitor import (BaseCilToMipsVisitor, DotDataDirective, - DotGlobalDirective, DotTextDirective, - instrNodes, arithNodes, cmpNodes, - branchNodes, lsNodes) + DotTextDirective, instrNodes, arithNodes, + lsNodes) import cil.nodes as cil from mips.instruction import (a0, a1, a2, a3, at, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, s0, s1, s2, s3, s4, s5, s6, s7, sp, ra, fp, k0, k1, gp, v0, v1, zero, TEMP_REGISTERS) +import mips.branch as branchNodes from functools import singledispatchmethod @@ -465,6 +465,9 @@ def _(self, node: cil.ReturnNode): assert self.current_function is not None self.deallocate_stack_frame(self.current_function) + # Liberar el espacio de los argumentos de la funcion + self.deallocate_args(self.current_function) + # salir del llamado de la funcion self.register_instruction(branchNodes.JR(ra)) From b83c4dca0440223227db73619a319dc3953bc367 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Mon, 7 Sep 2020 17:27:34 -0400 Subject: [PATCH 082/162] Fix entry point --- src/mips/baseMipsVisitor.py | 12 +++++++++++- src/pycoolc.py | 2 +- src/testing.py | 8 ++------ src/travels/ciltomips.py | 7 ++----- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 994b7f95..c31995a4 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -4,6 +4,7 @@ from cil.nodes import TypeNode from cil.nodes import CilNode, FunctionNode from mips import load_store +from mips.branch import JAL, JALR import mips.instruction as instrNodes import mips.arithmetic as arithNodes from mips.instruction import a0, fp, ra, sp, v0 @@ -328,4 +329,13 @@ def comment(self, message: str): def deallocate_args(self, func: FunctionNode): args = len(func.params) if args > 0: - self.register_instruction(arithNodes.ADDU(sp, sp, 4 * args, True)) \ No newline at end of file + self.register_instruction(arithNodes.ADDU(sp, sp, 4 * args, True)) + + def define_entry_point(self): + self.register_instruction(instrNodes.Label("main")) + # Realizar un jump a entry + self.register_instruction(JAL("entry")) + # registrar instrucciones para terminar la ejecucion + self.comment("syscall code 10 is for exit") + self.register_instruction(lsNodes.LI(v0, 10)) + self.register_instruction(instrNodes.SYSCALL()) \ No newline at end of file diff --git a/src/pycoolc.py b/src/pycoolc.py index b8baa871..47078530 100644 --- a/src/pycoolc.py +++ b/src/pycoolc.py @@ -52,7 +52,7 @@ def pipeline(program: str, deep: int, file_name: str) -> None: # Run Cool to CIL visitor cil_visitor = CoolToCILVisitor(context) try: - cil_program = cil_visitor.visit(ast) + cil_program = cil_visitor.visit(ast, scope) except Exception as e: print(e) sys.exit(1) diff --git a/src/testing.py b/src/testing.py index 69c1efab..57d46ee2 100755 --- a/src/testing.py +++ b/src/testing.py @@ -29,14 +29,12 @@ def pipeline(program: str, deep: int) -> None: # Parse the tokens to obtain a derivation tree try: parse = PARSER(tokens) - print("PARSING DONE!!!") except Exception as e: print(e) sys.exit(1) # build the AST from the obtained parse # try: ast = evaluate_right_parse(parse, tokens[:-1]) - print("BUILDING AST DONE!!!") # except Exception as e: # print(e) # sys.exit(1) @@ -47,15 +45,13 @@ def pipeline(program: str, deep: int) -> None: # Run type checker visitor errors, context, scope = ast.check_semantics(deep) if errors: - print("FOUND ERRORS!!!") report(errors) sys.exit(1) - print("SEMENATIC CHECK DONE!!!") cil_travel = CoolToCILVisitor(context) cil_program_node = cil_travel.visit(ast, scope) - formatter = CilDisplayFormatter() - print(formatter(cil_program_node)) + # formatter = CilDisplayFormatter() + # print(formatter(cil_program_node)) mips_gen = MipsCodeGenerator() source = mips_gen(cil_program_node) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 55b2e388..7f9b1ffa 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -38,15 +38,12 @@ def _(self, node: cil.CilProgramNode): self.visit(data_node) self.comment("\n\n") + self.define_entry_point() + # Visitar cada nodo de la seccion .CODE for code_node in node.dotcode: self.visit(code_node) - # registrar instrucciones para terminar la ejecucion - self.comment("syscall code 10 is for exit") - self.register_instruction(lsNodes.LI(v0, 10)) - self.register_instruction(instrNodes.SYSCALL()) - @visit.register def _(self, node: cil.TypeNode): # noqa: F811 # registrar el tipo actual que estamos construyendo From 97a4eb0f5ca278fd432656a4fdad6dd5eb66856c Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 10 Sep 2020 14:51:10 -0400 Subject: [PATCH 083/162] Builtin types and methods --- .vscode/settings.json | 3 +- src/abstract/semantics.py | 13 ++++ src/testing.py | 17 ++--- src/travels/inference.py | 2 +- src/travels/typebuilder.py | 7 +++ src/travels/typecollector.py | 116 ++++++++++++++++++++++++++++++++++- 6 files changed, 147 insertions(+), 11 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index b29fe355..5d53261d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,5 +8,6 @@ ], "python.testing.unittestEnabled": false, "python.testing.nosetestsEnabled": false, - "python.testing.pytestEnabled": true + "python.testing.pytestEnabled": true, + "python.formatting.provider": "yapf" } \ No newline at end of file diff --git a/src/abstract/semantics.py b/src/abstract/semantics.py index 2f8c2eec..bd1c39da 100755 --- a/src/abstract/semantics.py +++ b/src/abstract/semantics.py @@ -124,6 +124,11 @@ def __repr__(self): return str(self) +class SelfType(Type): + def __init__(self) -> None: + super(SelfType, self).__init__('SELF_TYPE') + + class VoidType(Type): def __init__(self): super(VoidType, self).__init__('Void') @@ -175,6 +180,14 @@ def conforms_to(self, other: Type) -> bool: return True +class IoType(Type): + def __init__(self) -> None: + super(IoType, self).__init__('IO') + + def __eq__(self, other): + return isinstance(other, IoType) + + class Context: def __init__(self): self.types: Dict[str, Type] = {} diff --git a/src/testing.py b/src/testing.py index 57d46ee2..f8ed541d 100755 --- a/src/testing.py +++ b/src/testing.py @@ -1,5 +1,5 @@ -# type: ignore from build.compiler_struct import LEXER, PARSER +from cil.nodes import CilProgramNode from travels.ciltomips import MipsCodeGenerator from typecheck.evaluator import evaluate_right_parse from comments import find_comments @@ -48,12 +48,15 @@ def pipeline(program: str, deep: int) -> None: report(errors) sys.exit(1) + print(scope) + cil_travel = CoolToCILVisitor(context) cil_program_node = cil_travel.visit(ast, scope) # formatter = CilDisplayFormatter() # print(formatter(cil_program_node)) mips_gen = MipsCodeGenerator() + assert isinstance(cil_program_node, CilProgramNode) source = mips_gen(cil_program_node) print(source) @@ -61,7 +64,7 @@ def pipeline(program: str, deep: int) -> None: text = """ class A { a : Int ; - suma ( a : Int , b : Int ) : Int { + suma ( a : AUTO_TYPE , b : Int ) : AUTO_TYPE { a + b }; b : Int ; @@ -69,13 +72,11 @@ class A { class B inherits A { c : Int ; - f ( d : Int , a : A ) : Int { - { - let f : Int in 8 ; - let c : Int in a. suma ( 5 , f ) ; + f ( d : Int , a : A ) : AUTO_TYPE { { + let f : AUTO_TYPE <- 10 in 8 ; + let c : AUTO_TYPE <- a. suma ( 5 , f ) in c ; c; - } - }; + } }; }; class Main { diff --git a/src/travels/inference.py b/src/travels/inference.py index 0b3d2478..9944c66d 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -321,7 +321,7 @@ def _(self, ret_type = self.context.get_type(node.type_) if ret_type in (self.AUTO_TYPE, void, self.STRING, self.INTEGER, self.OBJECT, self.BOOL): - self.errors.append(f'Cannot instantiate {ret_type}') + self.errors.append(f'Cannot instantiate {ret_type.name}') return ret_type @visit.register diff --git a/src/travels/typebuilder.py b/src/travels/typebuilder.py index edeeba9e..8492ef62 100755 --- a/src/travels/typebuilder.py +++ b/src/travels/typebuilder.py @@ -3,6 +3,8 @@ from abstract.semantics import SemanticError, Type, Context from functools import singledispatchmethod +INHERITABLES = ('Int', 'Bool', 'String', 'AUTO_TYPE') + class TypeBuilder: def __init__(self, context: Context, errors=[]): @@ -24,6 +26,11 @@ def _(self, node: coolAst.ClassDef): # noqa: F811 self.current_type = self.context.get_type(node.idx) parent = self.context.get_type(node.parent) + # No se puede heredar de Int ni de BOOL ni de AutoType ni de String + if parent.name in INHERITABLES: + self.errors.append(f"Cannot inherit from builtin {parent.name}") + return + # Detectar dependencias circulares if parent.conforms_to(self.current_type): self.errors.append( diff --git a/src/travels/typecollector.py b/src/travels/typecollector.py index 6f886f1f..ca630765 100755 --- a/src/travels/typecollector.py +++ b/src/travels/typecollector.py @@ -1,7 +1,110 @@ +from typing import List import abstract.tree as coolAst -from abstract.semantics import SemanticError, VoidType, IntegerType, StringType, ObjectType, Context, BoolType, AutoType +from abstract.semantics import IoType, Method, SelfType, SemanticError, Type, VoidType, IntegerType, StringType, ObjectType, Context, BoolType, AutoType from functools import singledispatchmethod +BUILTINS = ('Int', 'Bool', 'Object', 'String', 'IO', 'AUTO_TYPE') + + +def bootstrap_string(obj: StringType): + def length() -> Method: + method_name = 'length' + param_names = [] + params_types = [] + return_type = IntegerType() + + return Method(method_name, param_names, params_types, return_type) + + def concat() -> Method: + method_name = 'concat' + param_names = ['s'] + params_types: List[Type] = [StringType()] + return_type = IntegerType() + + return Method(method_name, param_names, params_types, return_type) + + def substr() -> Method: + method_name = 'substr' + param_names = ['i', 'l'] + params_types: List[Type] = [IntegerType(), IntegerType()] + return_type = IntegerType() + + return Method(method_name, param_names, params_types, return_type) + + obj.methods['length'] = length() + obj.methods['concat'] = concat() + obj.methods['substr'] = substr() + + +def bootstrap_io(io: IoType): + def out_string() -> Method: + method_name = "out_string" + param_names = ['x'] + param_types: List[Type] = [StringType()] + return_type = SelfType() + + return Method(method_name, param_names, param_types, return_type) + + def out_int() -> Method: + method_name = 'out_int' + param_names = ['x'] + params_types: List[Type] = [IntegerType()] + return_type = SelfType() + + return Method(method_name, param_names, params_types, return_type) + + def in_string() -> Method: + method_name = 'in_string' + param_names = [] + params_types = [] + return_type = StringType() + + return Method(method_name, param_names, params_types, return_type) + + def in_int() -> Method: + method_name = 'in_int' + param_names = [] + params_types = [] + return_type = IntegerType() + + return Method(method_name, param_names, params_types, return_type) + + # Crear el metodo out_string + io.methods['out_string'] = out_string() + io.methods['out_int'] = out_int() + io.methods['in_string'] = in_string() + io.methods['in_int'] = in_int() + + +def bootstrap_object(obj: ObjectType): + def abort() -> Method: + method_name = 'abort' + param_names = [] + params_types = [] + return_type = ObjectType() + + return Method(method_name, param_names, params_types, return_type) + + def type_name() -> Method: + method_name = 'type_name' + param_names = [] + params_types = [] + return_type = StringType() + + return Method(method_name, param_names, params_types, return_type) + + def copy() -> Method: + method_name = 'copy' + param_names = [] + params_types = [] + return_type = SelfType() + + return Method(method_name, param_names, params_types, return_type) + + obj.methods['abort'] = abort() + obj.methods['type_name'] = type_name() + obj.methods['copy'] = copy() + class TypeCollector: def __init__(self, errors=[]): @@ -17,15 +120,24 @@ def _(self, node: coolAst.ProgramNode): # noqa: F811 self.context = Context() OBJECT, INTEGER, STRING, BOOL, VOID = ObjectType(), IntegerType( ), StringType(), BoolType(), VoidType() + ioType = IoType() INTEGER.set_parent(OBJECT) STRING.set_parent(OBJECT) BOOL.set_parent(OBJECT) + ioType.set_parent(OBJECT) + + # Agregar los metodos builtin + bootstrap_string(STRING) + bootstrap_io(ioType) + bootstrap_object(OBJECT) + self.context.types['Object'] = OBJECT self.context.types['Int'] = INTEGER self.context.types['String'] = STRING self.context.types['Bool'] = BOOL self.context.types['Void'] = VOID self.context.types['AUTO_TYPE'] = AutoType() + self.context.types['IO'] = ioType for class_ in node.class_list: self.visit(class_) @@ -33,6 +145,8 @@ def _(self, node: coolAst.ProgramNode): # noqa: F811 @visit.register def _(self, node: coolAst.ClassDef): # noqa: F811 try: + if node.idx in BUILTINS: + raise SemanticError(f"Cannot redefine class {node.idx}") self.context.create_type(node.idx) except SemanticError as e: self.errors.append(e.text) From 3805e3b45523e4db988b5860f8c9d929b2e0167f Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 2 Oct 2020 12:42:59 -0400 Subject: [PATCH 084/162] Fix ilegal attribute redefinition --- src/travels/typebuilder.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/travels/typebuilder.py b/src/travels/typebuilder.py index 8492ef62..273e68a4 100755 --- a/src/travels/typebuilder.py +++ b/src/travels/typebuilder.py @@ -43,13 +43,23 @@ def _(self, node: coolAst.ClassDef): # noqa: F811 self.visit(feature) @visit.register - def _(self, node: coolAst.AttributeDef): # noqa: F811 + def _(self, node: coolAst.AttributeDef): + # Detectar si el atributo que vamos a crear + # redefine algun atributo heredadoo definido + # anteriormente try: - attr_type = self.context.get_type(node.typex) if isinstance( - node.typex, str) else node.typex - self.current_type.define_attribute(node.idx, attr_type) - except SemanticError as e: - self.errors.append(e.text) + self.current_type.get_attribute(node.idx) + self.errors.append(f"Can not redefine {node.idx} attribute") + except SemanticError: # Al lanzar la excepcion indica que el atributo no se ha definido + try: + # Extraer el tipo del atributo del contexto + attr_type = self.context.get_type(node.typex) if isinstance( + node.typex, str) else node.typex + + # Definir el atributo en el tipo actual + self.current_type.define_attribute(node.idx, attr_type) + except SemanticError as e: + self.errors.append(e.text) @visit.register def _(self, node: coolAst.MethodDef): # noqa: F811 From ada8f965d8144efc3e642a59332b0b76a5bc6822 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 2 Oct 2020 12:44:27 -0400 Subject: [PATCH 085/162] Fix duplicated attribute redefinition check --- src/travels/typebuilder.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/travels/typebuilder.py b/src/travels/typebuilder.py index 273e68a4..52c5af4b 100755 --- a/src/travels/typebuilder.py +++ b/src/travels/typebuilder.py @@ -45,21 +45,17 @@ def _(self, node: coolAst.ClassDef): # noqa: F811 @visit.register def _(self, node: coolAst.AttributeDef): # Detectar si el atributo que vamos a crear - # redefine algun atributo heredadoo definido + # redefine algun atributo heredado definido # anteriormente try: - self.current_type.get_attribute(node.idx) - self.errors.append(f"Can not redefine {node.idx} attribute") - except SemanticError: # Al lanzar la excepcion indica que el atributo no se ha definido - try: - # Extraer el tipo del atributo del contexto - attr_type = self.context.get_type(node.typex) if isinstance( - node.typex, str) else node.typex + # Extraer el tipo del atributo del contexto + attr_type = self.context.get_type(node.typex) if isinstance( + node.typex, str) else node.typex - # Definir el atributo en el tipo actual - self.current_type.define_attribute(node.idx, attr_type) - except SemanticError as e: - self.errors.append(e.text) + # Definir el atributo en el tipo actual + self.current_type.define_attribute(node.idx, attr_type) + except SemanticError as e: + self.errors.append(e.text) @visit.register def _(self, node: coolAst.MethodDef): # noqa: F811 From 7cd4ff6187d1561f218560cbb39211e953064807 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 2 Oct 2020 13:02:24 -0400 Subject: [PATCH 086/162] Fix type inference and type check in attributes init expressions --- src/travels/inference.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/travels/inference.py b/src/travels/inference.py index 9944c66d..3b3d6e72 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -107,6 +107,21 @@ def _(self, if deep == 1: scope.define_variable(atrib.name, atrib.type, "ATTRIBUTE") + # Checkear que el valor de retorno de la expresion + # de inicializacion del atributo (si existe) se + # conforme con el tipo del atributo + if node.default_value is not None: + return_type = self.visit(node.default_value, scope, infered_type, + deep) + + if atrib.type == self.AUTO_TYPE: + # Inferir el tipo del atributo segun su expresion de inicializacion + atrib.type = return_type + elif not return_type.conforms_to(atrib.type): + self.errors.append( + f'Attribute {node.idx} of type {atrib.type.name} can not be initialized with \ + an expression of type {return_type.name}') + # --------------------------------------------------------------------- # Si el método no tiene un tipo definido, entonces tratar de inferir | # su tipo en dependencia del tipo de su expresién de retorno. | From cd94d577852eb1cdab6ce201f5ebd247713e2ec7 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 2 Oct 2020 14:18:09 -0400 Subject: [PATCH 087/162] Inference for IsVoidNode --- src/travels/ctcill.py | 20 ++++++++++---------- src/travels/inference.py | 29 +++++++++-------------------- 2 files changed, 19 insertions(+), 30 deletions(-) diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 6004bbeb..957cea25 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -22,19 +22,19 @@ def visit(self, node, scope: Scope) -> CilNode: def _(self, node: coolAst.ProgramNode, scope: Scope) -> cil.CilProgramNode: # noqa: F811 - # Define the entry point for the program. + # Definir el punto de entrada del programa. self.current_function = self.register_function("entry") instance = self.define_internal_local() result = self.define_internal_local() - # The first method to call need to be the method main in a Main Class + # El primer metodo que se invoca es el metodo main de la clase Main - # allocate memory for the main object + # Reservar memoria para el objeto Main main_type = self.context.get_type('Main') self.register_instruction(cil.AllocateNode(main_type, instance)) self.register_instruction(cil.ArgNode(instance)) - # call the main method + # Llamar al metodo main self.register_instruction( cil.StaticCallNode(self.to_function_name('main', 'Main'), result)) self.register_instruction(cil.ReturnNode(0)) @@ -49,28 +49,28 @@ def _(self, node: coolAst.ProgramNode, @visit.register def _(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 - # Register the new type in .Types section + # Registrar el tipo que creamos en .Types section self.current_type = self.context.get_type(node.idx) new_type_node = self.register_type(node.idx) methods = self.current_type.methods attributes = self.current_type.attributes - # Handle inherited features such as attributes and methods first + # Manejar los features heredados como atributos y metodos if self.current_type.parent is not None: for attribute in self.current_type.parent.attributes: new_type_node.attributes.append(attribute) for method in self.current_type.parent.methods.keys(): - # Handle methods overload + # Manejar la redefinicion de metodos if method not in methods: new_type_node.methods.append( (method, self.to_function_name(method, self.current_type.parent.name))) - # Register every attribute and method for this type - # so the .Type section must look like: + # Registrar cada atributo y metodo para este tipo + # la seccion .Type debe tener la siguiente forma: ##################################################################### # .TYPES # # type A { # @@ -88,7 +88,7 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 # TODO: It is necessary to visit attributes?? Think so cuz they can be initialized # and their value could perhaps go to .DATA section - # Visit every method for generate its code in the .CODE section + # Visitar cada metodo para generar su codigo en la seccion .CODE for feature, child_scope in zip( (x for x in node.features if isinstance(x, coolAst.MethodDef)), scope.children): diff --git a/src/travels/inference.py b/src/travels/inference.py index 3b3d6e72..852b6d37 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -4,6 +4,7 @@ import abstract.semantics as semantic import abstract.tree as coolAst from abstract.semantics import Type +from abstract.tree import IsVoidNode from travels.context_actions import (update_attr_type, update_method_param, update_scope_variable) @@ -520,33 +521,21 @@ def _(self, # -----------------------------------------------------------------------------------------------------------------------# @visit.register - def _(self, - node: coolAst.IntegerConstant, - scope, - infered_type=None, - deep=1) -> Type: + def _(self, node: coolAst.IntegerConstant, scope, infered_t=None, deep=1): return self.INTEGER @visit.register - def _(self, - node: coolAst.StringConstant, - scope, - infered_type=None, - deep=1) -> Type: + def _(self, node: coolAst.StringConstant, scope, infered_t=None, deep=1): return self.STRING @visit.register - def _(self, - node: coolAst.TrueConstant, - scope, - infered_type=None, - deep=1) -> Type: + def _(self, node: coolAst.TrueConstant, scope, infered_type=None, deep=1): return self.BOOL @visit.register - def _(self, - node: coolAst.FalseConstant, - scope, - infered_type=None, - deep=1) -> Type: + def _(self, node: coolAst.FalseConstant, scope, infered_type=None, deep=1): + return self.BOOL + + @visit.register + def _(self, node: coolAst.IsVoidNode, scope, infered_type=None, deep=1): return self.BOOL From 1d65f7911a2b1a3d3fd2716d15ef41fa7f316e87 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 2 Oct 2020 15:57:09 -0400 Subject: [PATCH 088/162] Add attribute visitor in ctcill.py --- requirements.txt | 2 -- src/makefile | 2 +- src/travels/ctcill.py | 8 ++++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 4e62277d..02a7f1e0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,3 @@ pytest pytest-ordering cloudpickle -pyinstaller -progressbar diff --git a/src/makefile b/src/makefile index 4e1a5d30..3a4442c3 100644 --- a/src/makefile +++ b/src/makefile @@ -20,7 +20,7 @@ endif #define some macros COMPSTRUCTFILE=compiler_struct.py -PIPREQUIREMENTS=cloudpickle pyinstaller progressbar +PIPREQUIREMENTS=cloudpickle # pyinstaller modules COOLCIMPORTS= ~/.pycoocl diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 957cea25..33886e60 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -1,3 +1,4 @@ +from cloudpickle.cloudpickle import instance import cil.baseCilVisitor as baseCilVisitor import abstract.tree as coolAst import abstract.semantics as semantics @@ -85,8 +86,11 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 new_type_node.methods.append( (method, self.to_function_name(method, node.idx))) - # TODO: It is necessary to visit attributes?? Think so cuz they can be initialized - # and their value could perhaps go to .DATA section + # Visitar los atributos definidos en la clase para generar sus funciones + # de inicializacion + for feature in node.features: + if isinstance(feature, coolAst.AttributeDef): + self.visit(feature, scope) # Visitar cada metodo para generar su codigo en la seccion .CODE for feature, child_scope in zip( From e182e0625ad330e4077eca609dca74453766793d Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 2 Oct 2020 16:35:23 -0400 Subject: [PATCH 089/162] Implement attribute initialization --- src/cil/baseCilVisitor.py | 1 + src/cil/nodes.py | 2 +- src/travels/ciltomips.py | 6 +++++- src/travels/ctcill.py | 22 +++++++++++++++++++++- 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 41c44e8f..963dffe8 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -99,6 +99,7 @@ def __init__(self, context: Context): self.current_type: Optional[Type] = None self.current_method: Optional[Method] = None self.current_function: Optional[nodes.FunctionNode] = None + self.null = self.register_data("") self.__labels_count: int = 0 self.__build_CART() self.__build_builtins() diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 01cec983..8c985338 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -26,7 +26,7 @@ def __init__(self, name: str): class DataNode(CilNode): - def __init__(self, vname, value): + def __init__(self, vname: str, value): self.name = vname self.value = value diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 7f9b1ffa..b8775202 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -454,9 +454,13 @@ def _(self, node: cil.ReturnNode): src = self.get_location_address(val) # almacenar el resultado en $v0 self.register_instruction(lsNodes.LW(v0, src)) - else: + elif isinstance(val, int): # val es una constante self.register_instruction(lsNodes.LI(v0, val)) + else: + # val es un str que representa la direccion + # de un hardcoded string en la seccion .DATA + self.register_instruction(lsNodes.LW(v0, val)) # Liberar el marco de pila assert self.current_function is not None diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 33886e60..455eddbc 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -6,7 +6,7 @@ from typing import List, Optional, Tuple from functools import singledispatchmethod -from cil.nodes import CilNode, LocalNode, ParamNode +from cil.nodes import CilNode, LocalNode, ParamNode, ReturnNode ExpressionReturn = Tuple[List[cil.InstructionNode], List[cil.LocalNode]] Scope = semantics.Scope @@ -102,6 +102,26 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 # ****************** IMPLEMENTACION DE LAS DEFINICIONES DE METODOS ****************** + @visit.register + def _(self, node: coolAst.AttributeDef, scope: Scope) -> None: + self.current_function = self.register_function( + f"__attrib__{node.idx}__init") + if node.default_value is not None: + # Generar el codigo de la expresion de inicializacion + # y devolver el valor de esta + value = self.visit(node.default_value, scope) + self.register_instruction(ReturnNode(value)) + + else: + # Si no tiene expresion de inicializacion entonces devolvemos + # 0 en caso de que sea Int, Bool u otro tipo excepto String + # (0 = false y 0 = void) + attribute_type = self.context.get_type(node.typex) + if attribute_type.name == "String": + self.register_instruction(ReturnNode(self.null.name)) + else: + self.register_instruction(ReturnNode(0)) + @visit.register def _(self, node: coolAst.MethodDef, scope: Scope) -> None: # noqa: F811 self.current_method = self.current_type.get_method(node.idx) From e2c0dc3a4fa317003296b8d25b171a2b6cebce62 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 2 Oct 2020 17:00:55 -0400 Subject: [PATCH 090/162] Implement MIPS code for attribute initialization --- src/travels/ciltomips.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index b8775202..c6860f9d 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -308,7 +308,8 @@ def _(self, node: cil.AllocateNode): self.allocate_memory(num_bytes) reg = self.get_available_register() - assert reg is not None, "Out of registers." + temp = self.get_available_register() + assert reg is not None and temp is not None, "Out of registers." # Inicializar la instancia @@ -321,12 +322,22 @@ def _(self, node: cil.AllocateNode): lsNodes.LA(dest=reg, src=f"{instance_type.name}_start")) self.register_instruction(lsNodes.SW(dest=reg, src="4($v0)")) - # TODO: Manejar los atributos + self.register_instruction(instrNodes.MOVE(temp, v0)) + + # Los atributos comienzan en el indice 8($v0) + for i, attribute in enumerate(instance_type.attributes): + # llamar la funcion de inicializacion del atributo + self.register_instruction( + branchNodes.JAL(f"__attrib__{attribute.name}__init")) + # El valor de retorno viene en v0 + self.register_instruction( + lsNodes.SW(dest=v0, src=f"{8 + i*4}(${temp})")) # mover la direccion que almacena la instancia hacia dest - self.register_instruction(lsNodes.SW(v0, dest)) + self.register_instruction(lsNodes.SW(temp, dest)) self.used_registers[reg] = False + self.used_registers[temp] = False @visit.register def _(self, node: cil.TypeOfNode): From 043eb84058ac4321902975edaf581bc57f0bbed3 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 2 Oct 2020 17:46:11 -0400 Subject: [PATCH 091/162] Formatt MIPS output --- src/mips/baseMipsVisitor.py | 5 ++-- src/mips/instruction.py | 51 +++++++++++++++++++++++++++++-------- src/travels/ciltomips.py | 34 +++++++++++++++++++------ 3 files changed, 70 insertions(+), 20 deletions(-) diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index c31995a4..8dac833f 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -169,7 +169,7 @@ def cil_func_signature(self, func: FunctionNode): for i, param in enumerate(func.params): if i < 4: self.register_instruction( - instrNodes.LineComment(f"\t$a{i} = {param}")) + instrNodes.LineComment(f"\t$a{i} = {param.name}")) else: self.register_instruction( instrNodes.LineComment(f"\t{(i-4) * 4}($fp) = {param}")) @@ -338,4 +338,5 @@ def define_entry_point(self): # registrar instrucciones para terminar la ejecucion self.comment("syscall code 10 is for exit") self.register_instruction(lsNodes.LI(v0, 10)) - self.register_instruction(instrNodes.SYSCALL()) \ No newline at end of file + self.register_instruction(instrNodes.SYSCALL()) + self.comment("main END\n") \ No newline at end of file diff --git a/src/mips/instruction.py b/src/mips/instruction.py index dc2f9d77..1fc56315 100644 --- a/src/mips/instruction.py +++ b/src/mips/instruction.py @@ -59,6 +59,37 @@ TEMP_REGISTERS = (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) ARGS_REGISTERS = (a0, a1, a2, a3) +REG_TO_STR = { + v0: "v0", + v1: "v1", + s0: "s0", + s1: "s1", + s2: "s2", + s3: "s3", + s4: "s4", + s5: "s5", + s6: "s6", + s7: "s7", + sp: "sp", + fp: "fp", + ra: "ra", + gp: "gp", + t0: "t0", + t1: "t1", + t2: "t2", + t3: "t3", + t4: "t4", + t5: "t5", + t6: "t6", + t7: "t7", + t8: "t8", + t9: "t9", + a0: "a0", + a1: "a1", + a2: "a2", + a3: "a3" +} + class MipsNode: pass @@ -77,8 +108,8 @@ def __init__(self, dest: int, src1: int, src2: int, const_src2=False): def __str__(self): if self.const_src2: - return f'{self.action} ${self.dest}, ${self.src1}, {self.src2}' - return f'{self.action} ${self.dest}, ${self.src1}, ${self.src2}' + return f'{self.action} ${REG_TO_STR[self.dest]}, ${REG_TO_STR[self.src1]}, {self.src2}' + return f'{self.action} ${REG_TO_STR[self.dest]}, ${REG_TO_STR[self.src1]}, ${REG_TO_STR[self.src2]}' class BinaryNode(MipsNode): @@ -88,7 +119,7 @@ def __init__(self, dest: int, src1: int): self.action = self.__class__.__name__.lower().replace('_', "") def __str__(self): - return f'{self.action} ${self.dest}, ${self.src1}' + return f'{self.action} ${REG_TO_STR[self.dest]}, ${REG_TO_STR[self.src1]}' # ************************* INSTRUCCIONES DE COMPARACION ****************** @@ -102,8 +133,8 @@ def __init__(self, dest: int, src1: int, src2: int, const_src2=False): def __str__(self): if self.const_src2: - return f'{self.action} ${self.dest}, ${self.src1}, {self.src2}' - return f'{self.action} ${self.dest}, ${self.src1}, ${self.src2}' + return f'{self.action} ${REG_TO_STR[self.dest]}, ${REG_TO_STR[self.src1]}, {self.src2}' + return f'{self.action} ${REG_TO_STR[self.dest]}, ${REG_TO_STR[self.src1]}, ${REG_TO_STR[self.src2]}' # ************************ INSTRUCCIONES DE SALTO ********************* @@ -122,7 +153,7 @@ def __init__(self, src1: int): self.action = self.__class__.__name__.lower() def __str__(self): - return f'{self.action} ${self.src1}' + return f'{self.action} ${REG_TO_STR[self.src1]}' class UnaryJumpNode(MipsNode): @@ -132,7 +163,7 @@ def __init__(self, src1: int, label: str): self.action = self.__class__.__name__.lower() def __str__(self): - return f'{self.action} ${self.src1}, {self.label}' + return f'{self.action} ${REG_TO_STR[self.src1]}, {self.label}' class BinaryJumpNode(MipsNode): @@ -145,8 +176,8 @@ def __init__(self, src1: int, src2: int, label: str, const_src2=False): def __str__(self): if self.const_src2: - return f'{self.action} ${self.src1}, {self.src2}, {self.label}' - return f'{self.action} ${self.src1}, ${self.src2}, {self.label}' + return f'{self.action} ${REG_TO_STR[self.src1]}, {self.src2}, {self.label}' + return f'{self.action} ${REG_TO_STR[self.src1]}, ${REG_TO_STR[self.src2]}, {self.label}' # ******************** INSTRUCCIONES PARA ALMACENAR Y CARGAR DATOS EN REGISTROS ************ @@ -157,7 +188,7 @@ def __init__(self, dest: int, src): self.action = self.__class__.__name__.lower() def __str__(self): - return f'{self.action} ${self.dest}, {self.src}' + return f'{self.action} ${REG_TO_STR[self.dest]}, {self.src}' class MOVE(BinaryNode): diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index c6860f9d..e24f1fff 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -4,9 +4,10 @@ DotTextDirective, instrNodes, arithNodes, lsNodes) import cil.nodes as cil -from mips.instruction import (a0, a1, a2, a3, at, t0, t1, t2, t3, t4, t5, t6, - t7, t8, t9, s0, s1, s2, s3, s4, s5, s6, s7, sp, - ra, fp, k0, k1, gp, v0, v1, zero, TEMP_REGISTERS) +from mips.instruction import (REG_TO_STR, a0, a1, a2, a3, at, t0, t1, t2, t3, + t4, t5, t6, t7, t8, t9, s0, s1, s2, s3, s4, s5, + s6, s7, sp, ra, fp, k0, k1, gp, v0, v1, zero, + TEMP_REGISTERS) import mips.branch as branchNodes from functools import singledispatchmethod @@ -143,7 +144,7 @@ def _(self, node: cil.FunctionNode): self.current_function = None - self.comment("\n\n") + self.comment("Function END\n\n") @visit.register def _(self, node: cil.LabelNode): @@ -331,7 +332,7 @@ def _(self, node: cil.AllocateNode): branchNodes.JAL(f"__attrib__{attribute.name}__init")) # El valor de retorno viene en v0 self.register_instruction( - lsNodes.SW(dest=v0, src=f"{8 + i*4}(${temp})")) + lsNodes.SW(dest=v0, src=f"{8 + i*4}(${REG_TO_STR[temp]})")) # mover la direccion que almacena la instancia hacia dest self.register_instruction(lsNodes.SW(temp, dest)) @@ -419,11 +420,12 @@ def _(self, node: cil.DynamicCallNode): # Cargar el puntero a la VTABLE en el segundo registro self.comment("Get pointer to type's VTABLE") - self.register_instruction(lsNodes.LW(reg2, f"0(${reg1})")) + self.register_instruction(lsNodes.LW(reg2, f"0(${REG_TO_STR[reg1]})")) # Cargar el puntero a la funcion correspondiente en el tercer registro self.comment("Get pointer to function address") - self.register_instruction(lsNodes.LW(reg3, f"{i * 4}(${reg2})")) + self.register_instruction( + lsNodes.LW(reg3, f"{i * 4}(${REG_TO_STR[reg2]})")) # saltar hacia la direccion de memoria correspondiente a la funcion self.comment("Call function. Result is on $v0") @@ -543,4 +545,20 @@ class MipsCodeGenerator(CilToMipsVisitor): """ def __call__(self, ast: cil.CilProgramNode) -> str: self.visit(ast) - return "\n".join(str(x) for x in self.program) + # return "\n".join(str(x) for x in self.program) + return self.to_str() + + def to_str(self) -> str: + program = "" + indent = 0 + for instr in self.program: + line = str(instr) + if '.data' in line or '.text' in line: + indent = 0 + program += "\n" + " " * (3 * indent) + line + if '#' not in line and (':' in line and 'end' not in line): + if 'word' not in line and 'asciiz' not in line and 'byte' not in line: + indent += 1 + if "END" in line or "end" in line: + indent -= 1 + return program From ad49f4b06e5a347468ec63e05396a0cd8a4bf1e8 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 2 Oct 2020 17:46:43 -0400 Subject: [PATCH 092/162] Remove comment from formatter --- src/travels/ciltomips.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index e24f1fff..de45d4a4 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -545,7 +545,6 @@ class MipsCodeGenerator(CilToMipsVisitor): """ def __call__(self, ast: cil.CilProgramNode) -> str: self.visit(ast) - # return "\n".join(str(x) for x in self.program) return self.to_str() def to_str(self) -> str: From c11308b8ebdd3b69ef7c3b001ed85fb3c74af51a Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 2 Oct 2020 21:47:30 -0400 Subject: [PATCH 093/162] Fix CIL AssignNode implementation --- src/cil/nodes.py | 2 +- src/travels/ctcill.py | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 8c985338..5310302b 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -96,7 +96,7 @@ def __init__(self, itype: str, attrname: str, dest: LocalNode): class SetAttributeNode(InstructionNode): - def __init__(self, itype: str, attrname: str, source: str): + def __init__(self, itype: str, attrname: str, source: LocalNode): self.source = source self.itype = itype self.attrname = attrname diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 455eddbc..4cd3fe65 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -254,13 +254,21 @@ def _(self, node: coolAst.AssignNode, scope: Scope): # Aqui asumimos que una variable interna llamada id # ya ha sido definida - # TODO: Es necesario diferenciar entre variable y atributo ? - # Generar el codigo para el rvalue (expr) rvalue_vm_holder = self.visit(self, node.expr) + assert isinstance(rvalue_vm_holder, LocalNode) - # registrar la instruccion de asignacion - self.register_instruction(cil.AssignNode(node.idx, rvalue_vm_holder)) + # Es necesario diferenciar entre variable y atributo. + # Las variables se diferencian en si son locales al + # metodo que estamos creando o si son atributos. + if scope.is_local(node.idx): + # registrar la instruccion de asignacion + self.register_instruction( + cil.AssignNode(node.idx, rvalue_vm_holder)) + else: + self.register_instruction( + cil.SetAttributeNode(self.current_type.name, node.idx, + rvalue_vm_holder)) @visit.register def _(self, node: coolAst.WhileBlockNode, scope: Scope): From 53cf33935b02eea74a0171c2c1ce0f3824ccfbde Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 2 Oct 2020 22:09:01 -0400 Subject: [PATCH 094/162] Fix formatting in TypeOf Node --- src/travels/ciltomips.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index de45d4a4..715f88fd 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -354,7 +354,7 @@ def _(self, node: cil.TypeOfNode): self.register_instruction(lsNodes.LW(reg, local_addr)) self.comment("Load pointer to type") - self.register_instruction(lsNodes.LW(reg2, f"4(${reg})")) + self.register_instruction(lsNodes.LW(reg2, f"4(${REG_TO_STR[reg]})")) self.register_instruction(lsNodes.SW(reg2, return_addr)) self.used_registers[reg] = False From 7d74001419184cbbf4120ae83a26c0a4f6f1e3b2 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sat, 3 Oct 2020 11:47:08 -0400 Subject: [PATCH 095/162] Implement SetAttribute and GetAttribute --- src/cil/nodes.py | 4 ++-- src/mips/baseMipsVisitor.py | 20 +++++++++++++++++- src/travels/ciltomips.py | 42 +++++++++++++++++++++++++++++++++++-- src/travels/ctcill.py | 7 ++++--- 4 files changed, 65 insertions(+), 8 deletions(-) diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 5310302b..f9cf37c8 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -89,14 +89,14 @@ class DivNode(ArithmeticNode): class GetAttributeNode(InstructionNode): - def __init__(self, itype: str, attrname: str, dest: LocalNode): + def __init__(self, itype: Type, attrname: str, dest: LocalNode): self.itype = itype self.attrname = attrname self.dest = dest class SetAttributeNode(InstructionNode): - def __init__(self, itype: str, attrname: str, source: LocalNode): + def __init__(self, itype: Type, attrname: str, source: LocalNode): self.source = source self.itype = itype self.attrname = attrname diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 8dac833f..1f74c66a 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -1,6 +1,7 @@ from json import load from typed_ast.ast3 import arg +from abstract.semantics import Attribute from cil.nodes import TypeNode from cil.nodes import CilNode, FunctionNode from mips import load_store @@ -339,4 +340,21 @@ def define_entry_point(self): self.comment("syscall code 10 is for exit") self.register_instruction(lsNodes.LI(v0, 10)) self.register_instruction(instrNodes.SYSCALL()) - self.comment("main END\n") \ No newline at end of file + self.comment("main END\n") + + def locate_attribute(self, attrname: str, attributes: List[Attribute]): + # Para ubicar el atributo que vamos a manejar + # buscamos el offset del atributo en el tipo + # y luego apuntamos a ese offset en el registro + # que contiene el objeto self. Recordar que en + # COOL los atributos solo pueden ser accedidos + # directamente desde el interior de la clase. + + # Hallar el offset del atributo en el tipo que se + # esta ejecutando + offset: int = 8 + for i, attribute in enumerate(attributes): + if attribute.name == attrname: + offset += i * 4 + break + return offset \ No newline at end of file diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 715f88fd..93b01cbd 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -267,11 +267,49 @@ def _(self, node: cil.DivNode): @visit.register def _(self, node: cil.GetAttributeNode): - pass + # Registrar la linea que estamos traduciendo + self.add_source_line_comment(node) + + # Localizar el atributo + offset = self.locate_attribute(node.attrname, + self.current_type.attributes) + + dest = self.visit(node.dest) + reg = self.get_available_register() + assert reg is not None and dest is not None + + # Cargar el atributo en un registro temporal para + # luego moverlo hacia dest. El objeto self siempre + # esta en el registro a0 + self.register_instruction( + lsNodes.LW(reg, f"{offset}(${REG_TO_STR[a0]})")) + + self.register_instruction(lsNodes.SW(dest, reg)) + + self.used_registers[reg] = False @visit.register def _(self, node: cil.SetAttributeNode): - pass + # registrar la linea que estamos traduciendo + self.add_source_line_comment(node) + + # Localizar el atributo + offset = self.locate_attribute(node.attrname, + self.current_type.attributes) + + source = self.visit(node.source) + reg = self.get_available_register() + + assert reg is not None and source is not None + + # Cargar el valor de source en un registro temporal + # y luego moverlo a la direccion de memoria del + # atributo + self.register_instruction(lsNodes.LW(reg, source)) + self.register_instruction( + lsNodes.SW(reg, f"{offset}(${REG_TO_STR[a0]})")) + + self.used_registers[reg] = False @visit.register def _(self, node: cil.AllocateNode): diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 4cd3fe65..a0b1066e 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -221,9 +221,9 @@ def _(self, node: coolAst.VariableCall, scope: Scope): # noqa: F811 return param_node if vinfo.location == "ATTRIBUTE": local = self.define_internal_local() + assert self.current_type is not None self.register_instruction( - cil.GetAttributeNode(self.current_type.name, vinfo.name, - local)) + cil.GetAttributeNode(self.current_type, vinfo.name, local)) return local if vinfo.location == "LOCAL": for local_node in self.localvars: @@ -266,8 +266,9 @@ def _(self, node: coolAst.AssignNode, scope: Scope): self.register_instruction( cil.AssignNode(node.idx, rvalue_vm_holder)) else: + assert self.current_type is not None self.register_instruction( - cil.SetAttributeNode(self.current_type.name, node.idx, + cil.SetAttributeNode(self.current_type, node.idx, rvalue_vm_holder)) @visit.register From f0a82f2969615801cd7515f4ac274bc32277b0ec Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sat, 3 Oct 2020 11:57:36 -0400 Subject: [PATCH 096/162] Remove unused imports in ciltomips.py --- src/travels/ciltomips.py | 113 +++++++++++++++++++-------------------- 1 file changed, 56 insertions(+), 57 deletions(-) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 93b01cbd..e5231760 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -1,16 +1,15 @@ from abstract.semantics import Type from cil.nodes import LocalNode +from mips.arithmetic import ADD, DIV, MUL, SUB, SUBU from mips.baseMipsVisitor import (BaseCilToMipsVisitor, DotDataDirective, - DotTextDirective, instrNodes, arithNodes, - lsNodes) + DotTextDirective) import cil.nodes as cil -from mips.instruction import (REG_TO_STR, a0, a1, a2, a3, at, t0, t1, t2, t3, - t4, t5, t6, t7, t8, t9, s0, s1, s2, s3, s4, s5, - s6, s7, sp, ra, fp, k0, k1, gp, v0, v1, zero, - TEMP_REGISTERS) +from mips.instruction import (FixedData, Label, MOVE, REG_TO_STR, a0, s0, sp, ra, v0) import mips.branch as branchNodes from functools import singledispatchmethod +from mips.load_store import LA, LI, LW, SW + class CilToMipsVisitor(BaseCilToMipsVisitor): @singledispatchmethod @@ -59,7 +58,7 @@ def _(self, node: cil.TypeNode): # noqa: F811 # Los punteros a funciones estaran definidos en el orden en que aparecen declaradas en las clases # de modo que la VTABLE sea indexable y podamos efectuar VCALL en O(1). self.register_instruction( - instrNodes.FixedData(f'{node.name}_vtable', + FixedData(f'{node.name}_vtable', ", ".join(x[1] for x in node.methods))) self.comment("\n\n") @@ -76,11 +75,11 @@ def _(self, node: cil.TypeNode): # noqa: F811 self.comment(f" **** Type RECORD for type {node.name} ****") # Declarar la direccion de memoria donde comienza el tipo self.register_instruction( - instrNodes.Label(f"{self.current_type.name}_start")) + Label(f"{self.current_type.name}_start")) # Registrar un puntero a la VTABLE del tipo. self.register_instruction( - instrNodes.FixedData(f'{node.name}_vtable_pointer', + FixedData(f'{node.name}_vtable_pointer', f"{node.name}_vtable")) # Declarar los atributos: Si los atributos son de tipo string, guardarlos como asciiz @@ -88,16 +87,16 @@ def _(self, node: cil.TypeNode): # noqa: F811 for attrib in self.current_type.attributes: if attrib.type.name == "String": self.register_instruction( - instrNodes.FixedData(f'{node.name}_attrib_{attrib.name}', + FixedData(f'{node.name}_attrib_{attrib.name}', r"", 'asciiz')) else: self.register_instruction( - instrNodes.FixedData(f'{node.name}_attrib_{attrib.name}', + FixedData(f'{node.name}_attrib_{attrib.name}', 0)) # Registrar la direccion de memoria donde termina el tipo para calcular facilmente # sizeof - self.register_instruction(instrNodes.Label(f"{node.name}_end")) + self.register_instruction(Label(f"{node.name}_end")) self.current_type = None @@ -107,7 +106,7 @@ def _(self, node: cil.DataNode): self.register_instruction(DotDataDirective()) if isinstance(node.value, str): self.register_instruction( - instrNodes.FixedData(node.name, + FixedData(node.name, f"{node.value}", type_='asciiz')) elif isinstance(node.value, dict): @@ -118,11 +117,11 @@ def _(self, node: cil.DataNode): # programa los tipos son unicos). for (type1, type2), distance in node.value.items(): self.register_instruction( - instrNodes.FixedData(f"__{type1}_{type2}_tdt_entry__", + FixedData(f"__{type1}_{type2}_tdt_entry__", distance)) elif isinstance(node.value, int): self.register_instruction( - instrNodes.FixedData(node.name, node.value)) + FixedData(node.name, node.value)) @visit.register def _(self, node: cil.FunctionNode): @@ -134,7 +133,7 @@ def _(self, node: cil.FunctionNode): self.cil_func_signature(node) # Direccion de memoria de la funcion. - self.register_instruction(instrNodes.Label(node.name)) + self.register_instruction(Label(node.name)) # Crear el marco de pila de la funcion. self.allocate_stack_frame(node) @@ -148,7 +147,7 @@ def _(self, node: cil.FunctionNode): @visit.register def _(self, node: cil.LabelNode): - self.register_instruction(instrNodes.Label(node.label)) + self.register_instruction(Label(node.label)) @visit.register def _(self, node: cil.ParamNode): @@ -189,24 +188,24 @@ def _(self, node: cil.AssignNode): # Si tenemos registro temporal disponible entonces movemos # lo que hay en la direccion de memoria source a reg y luego # asignamos el valor de reg a dest. - self.register_instruction(lsNodes.LI(reg, source)) - self.register_instruction(lsNodes.SW(reg, dest)) + self.register_instruction(LI(reg, source)) + self.register_instruction(SW(reg, dest)) self.used_registers[reg] = False else: # Si no hay registro temporal disponible entonces tenemos que hacer # dos instrucciones mas pues hay que salvar el registro s0 # utlizarlo para hacer la transaccion y luego restaurarlo. - self.register_instruction(lsNodes.SW(s0, "0($sp)")) - self.register_instruction(lsNodes.LI(s0, source)) - self.register_instruction(lsNodes.SW(s0, dest)) - self.register_instruction(lsNodes.LI(s0, "0($sp)")) + self.register_instruction(SW(s0, "0($sp)")) + self.register_instruction(LI(s0, source)) + self.register_instruction(SW(s0, dest)) + self.register_instruction(LI(s0, "0($sp)")) elif isinstance(source, str): # Source es una direccion de memoria (Puede ser un label, en caso de que sea un tipo) reg1 = self.get_available_register() assert reg1 is not None - self.register_instruction(lsNodes.LW(reg1, source)) - self.register_instruction(lsNodes.SW(reg1, dest)) + self.register_instruction(LW(reg1, source)) + self.register_instruction(SW(reg1, dest)) self.used_registers[reg1] = False @visit.register @@ -221,7 +220,7 @@ def _(self, node: cil.PlusNode): # Agregar la linea que vamos a traducir. self.add_source_line_comment(source=node) - self.operate(dest, left, right, arithNodes.ADD) + self.operate(dest, left, right, ADD) @visit.register def _(self, node: cil.MinusNode): @@ -235,7 +234,7 @@ def _(self, node: cil.MinusNode): # Agregar la linea que vamos a traducir. self.add_source_line_comment(source=node) - self.operate(dest, left, right, arithNodes.SUB) + self.operate(dest, left, right, SUB) @visit.register def _(self, node: cil.StarNode): @@ -249,7 +248,7 @@ def _(self, node: cil.StarNode): # Agregar la linea que vamos a traducir. self.add_source_line_comment(source=node) - self.operate(dest, left, right, arithNodes.MUL) + self.operate(dest, left, right, MUL) @visit.register def _(self, node: cil.DivNode): @@ -263,7 +262,7 @@ def _(self, node: cil.DivNode): # Agregar la linea que vamos a traducir. self.add_source_line_comment(source=node) - self.operate(dest, left, right, arithNodes.DIV) + self.operate(dest, left, right, DIV) @visit.register def _(self, node: cil.GetAttributeNode): @@ -282,9 +281,9 @@ def _(self, node: cil.GetAttributeNode): # luego moverlo hacia dest. El objeto self siempre # esta en el registro a0 self.register_instruction( - lsNodes.LW(reg, f"{offset}(${REG_TO_STR[a0]})")) + LW(reg, f"{offset}(${REG_TO_STR[a0]})")) - self.register_instruction(lsNodes.SW(dest, reg)) + self.register_instruction(SW(dest, reg)) self.used_registers[reg] = False @@ -305,9 +304,9 @@ def _(self, node: cil.SetAttributeNode): # Cargar el valor de source en un registro temporal # y luego moverlo a la direccion de memoria del # atributo - self.register_instruction(lsNodes.LW(reg, source)) + self.register_instruction(LW(reg, source)) self.register_instruction( - lsNodes.SW(reg, f"{offset}(${REG_TO_STR[a0]})")) + SW(reg, f"{offset}(${REG_TO_STR[a0]})")) self.used_registers[reg] = False @@ -353,15 +352,15 @@ def _(self, node: cil.AllocateNode): # Inicializar la instancia # Cargar el puntero al tipo de la instancia - self.register_instruction(lsNodes.LA(dest=reg, src=instance_type.name)) - self.register_instruction(lsNodes.SW(dest=reg, src="0($v0)")) + self.register_instruction(LA(dest=reg, src=instance_type.name)) + self.register_instruction(SW(dest=reg, src="0($v0)")) # Cargar el puntero a la VTABLE self.register_instruction( - lsNodes.LA(dest=reg, src=f"{instance_type.name}_start")) - self.register_instruction(lsNodes.SW(dest=reg, src="4($v0)")) + LA(dest=reg, src=f"{instance_type.name}_start")) + self.register_instruction(SW(dest=reg, src="4($v0)")) - self.register_instruction(instrNodes.MOVE(temp, v0)) + self.register_instruction(MOVE(temp, v0)) # Los atributos comienzan en el indice 8($v0) for i, attribute in enumerate(instance_type.attributes): @@ -370,10 +369,10 @@ def _(self, node: cil.AllocateNode): branchNodes.JAL(f"__attrib__{attribute.name}__init")) # El valor de retorno viene en v0 self.register_instruction( - lsNodes.SW(dest=v0, src=f"{8 + i*4}(${REG_TO_STR[temp]})")) + SW(dest=v0, src=f"{8 + i*4}(${REG_TO_STR[temp]})")) # mover la direccion que almacena la instancia hacia dest - self.register_instruction(lsNodes.SW(temp, dest)) + self.register_instruction(SW(temp, dest)) self.used_registers[reg] = False self.used_registers[temp] = False @@ -390,10 +389,10 @@ def _(self, node: cil.TypeOfNode): self.add_source_line_comment(node) - self.register_instruction(lsNodes.LW(reg, local_addr)) + self.register_instruction(LW(reg, local_addr)) self.comment("Load pointer to type") - self.register_instruction(lsNodes.LW(reg2, f"4(${REG_TO_STR[reg]})")) - self.register_instruction(lsNodes.SW(reg2, return_addr)) + self.register_instruction(LW(reg2, f"4(${REG_TO_STR[reg]})")) + self.register_instruction(SW(reg2, return_addr)) self.used_registers[reg] = False self.used_registers[reg2] = False @@ -431,7 +430,7 @@ def _(self, node: cil.StaticCallNode): self.register_instruction(branchNodes.JAL(node.function)) # EL resultado viene en v0 - self.register_instruction(lsNodes.SW(v0, dest)) + self.register_instruction(SW(v0, dest)) @visit.register def _(self, node: cil.DynamicCallNode): @@ -454,23 +453,23 @@ def _(self, node: cil.DynamicCallNode): # Cargar el puuntero al tipo en el primer registro self.comment("Get pointer to type") - self.register_instruction(lsNodes.LW(reg1, type_src)) + self.register_instruction(LW(reg1, type_src)) # Cargar el puntero a la VTABLE en el segundo registro self.comment("Get pointer to type's VTABLE") - self.register_instruction(lsNodes.LW(reg2, f"0(${REG_TO_STR[reg1]})")) + self.register_instruction(LW(reg2, f"0(${REG_TO_STR[reg1]})")) # Cargar el puntero a la funcion correspondiente en el tercer registro self.comment("Get pointer to function address") self.register_instruction( - lsNodes.LW(reg3, f"{i * 4}(${REG_TO_STR[reg2]})")) + LW(reg3, f"{i * 4}(${REG_TO_STR[reg2]})")) # saltar hacia la direccion de memoria correspondiente a la funcion self.comment("Call function. Result is on $v0") self.register_instruction(branchNodes.JALR(reg3)) # El resultado viene en $v0 - self.register_instruction(lsNodes.SW(v0, dest)) + self.register_instruction(SW(v0, dest)) self.used_registers[reg1] = False self.used_registers[reg2] = False @@ -485,13 +484,13 @@ def _(self, node: cil.ArgNode): assert src is not None and reg is not None if isinstance(src, int): - self.register_instruction(lsNodes.LI(reg, src)) + self.register_instruction(LI(reg, src)) else: - self.register_instruction(lsNodes.LW(reg, src)) + self.register_instruction(LW(reg, src)) self.comment("Push arg into stack") - self.register_instruction(arithNodes.SUBU(sp, sp, 4, True)) - self.register_instruction(lsNodes.SW(reg, "0($sp)")) + self.register_instruction(SUBU(sp, sp, 4, True)) + self.register_instruction(SW(reg, "0($sp)")) self.used_registers[reg] = False @@ -504,14 +503,14 @@ def _(self, node: cil.ReturnNode): if isinstance(val, LocalNode): src = self.get_location_address(val) # almacenar el resultado en $v0 - self.register_instruction(lsNodes.LW(v0, src)) + self.register_instruction(LW(v0, src)) elif isinstance(val, int): # val es una constante - self.register_instruction(lsNodes.LI(v0, val)) + self.register_instruction(LI(v0, val)) else: # val es un str que representa la direccion # de un hardcoded string en la seccion .DATA - self.register_instruction(lsNodes.LW(v0, val)) + self.register_instruction(LW(v0, val)) # Liberar el marco de pila assert self.current_function is not None @@ -532,8 +531,8 @@ def _(self, node: cil.LoadNode): reg = self.get_available_register() assert reg is not None, "Out of registers" self.add_source_line_comment(node) - self.register_instruction(lsNodes.LW(reg, node.message.name)) - self.register_instruction(lsNodes.SW(reg, dest)) + self.register_instruction(LW(reg, node.message.name)) + self.register_instruction(SW(reg, dest)) self.used_registers[reg] = False From eb90bf15cf6d03811140ec9e812b35a5b2e7358a Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sat, 3 Oct 2020 12:01:03 -0400 Subject: [PATCH 097/162] Add testing.py to gitignore --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4cd1681f..94d6a526 100644 --- a/.gitignore +++ b/.gitignore @@ -411,4 +411,6 @@ dmypy.json ### Sublime Text Projects ### *.sublime-project -src/.builds \ No newline at end of file +src/.builds + +src/testing.py \ No newline at end of file From 7567b73eb6d90bd13a42ded16232f91dbb248479 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sat, 3 Oct 2020 12:07:52 -0400 Subject: [PATCH 098/162] Add .text directive to entry point --- src/mips/baseMipsVisitor.py | 1 + src/testing.py | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 1f74c66a..4858afff 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -333,6 +333,7 @@ def deallocate_args(self, func: FunctionNode): self.register_instruction(arithNodes.ADDU(sp, sp, 4 * args, True)) def define_entry_point(self): + self.register_instruction(DotTextDirective()) self.register_instruction(instrNodes.Label("main")) # Realizar un jump a entry self.register_instruction(JAL("entry")) diff --git a/src/testing.py b/src/testing.py index f8ed541d..2732b944 100755 --- a/src/testing.py +++ b/src/testing.py @@ -48,8 +48,6 @@ def pipeline(program: str, deep: int) -> None: report(errors) sys.exit(1) - print(scope) - cil_travel = CoolToCILVisitor(context) cil_program_node = cil_travel.visit(ast, scope) # formatter = CilDisplayFormatter() From d4a930f6ff40629f8179e2b7fc23869d079eeab5 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Wed, 28 Oct 2020 21:07:19 -0400 Subject: [PATCH 099/162] Fix allocation of builtin types --- src/travels/ctcill.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index a0b1066e..53ca6f5e 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -1,4 +1,5 @@ from cloudpickle.cloudpickle import instance +from abstract.tree import AssignNode import cil.baseCilVisitor as baseCilVisitor import abstract.tree as coolAst import abstract.semantics as semantics @@ -197,8 +198,16 @@ def _(self, node: coolAst.VariableDeclaration, # Reservar memoria para la variable y realizar su inicializacion si tiene assert var_info.type is not None - self.register_instruction( - cil.AllocateNode(var_info.type, local_var)) + + # Si la variable es int, string o boolean, su valor por defecto es 0 + if var_info.type.name not in ("String", "Int", "Bool"): + self.register_instruction( + cil.AllocateNode(var_info.type, local_var)) + else: + # Si la variable tiene una expresion de inicializacion + # entonces no es necesario ponerle valor por defecto + if var_init_expr is None: + self.register_instruction(cil.AssignNode(local_var, 0)) if var_init_expr is not None: expr_init_vm_holder = self.visit(var_init_expr, scope) From 070f6d6f06684f836c6be98fa40147f3abef8188 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Wed, 28 Oct 2020 22:42:27 -0400 Subject: [PATCH 100/162] Fix attributes inheritance --- src/testing.py | 4 ++++ src/travels/ciltomips.py | 20 ++++++++----------- src/travels/context_actions.py | 1 - src/travels/ctcill.py | 4 ++++ src/travels/inference.py | 36 +++++++++++++++------------------- src/travels/typebuilder.py | 12 +++++++++--- 6 files changed, 41 insertions(+), 36 deletions(-) diff --git a/src/testing.py b/src/testing.py index 2732b944..f5c8ca4b 100755 --- a/src/testing.py +++ b/src/testing.py @@ -75,6 +75,10 @@ class B inherits A { let c : AUTO_TYPE <- a. suma ( 5 , f ) in c ; c; } }; + + get_a() : Int { + a + }; }; class Main { diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index e5231760..fafe2448 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -74,8 +74,7 @@ def _(self, node: cil.TypeNode): # noqa: F811 self.comment(f" **** Type RECORD for type {node.name} ****") # Declarar la direccion de memoria donde comienza el tipo - self.register_instruction( - Label(f"{self.current_type.name}_start")) + self.register_instruction(Label(f"{node.name}_start")) # Registrar un puntero a la VTABLE del tipo. self.register_instruction( @@ -84,7 +83,7 @@ def _(self, node: cil.TypeNode): # noqa: F811 # Declarar los atributos: Si los atributos son de tipo string, guardarlos como asciiz # de lo contrario son o numeros o punteros y se inicializan como .words - for attrib in self.current_type.attributes: + for attrib in node.attributes: if attrib.type.name == "String": self.register_instruction( FixedData(f'{node.name}_attrib_{attrib.name}', @@ -270,8 +269,7 @@ def _(self, node: cil.GetAttributeNode): self.add_source_line_comment(node) # Localizar el atributo - offset = self.locate_attribute(node.attrname, - self.current_type.attributes) + offset = self.locate_attribute(node.attrname, node.itype.attributes) dest = self.visit(node.dest) reg = self.get_available_register() @@ -280,10 +278,9 @@ def _(self, node: cil.GetAttributeNode): # Cargar el atributo en un registro temporal para # luego moverlo hacia dest. El objeto self siempre # esta en el registro a0 - self.register_instruction( - LW(reg, f"{offset}(${REG_TO_STR[a0]})")) + self.register_instruction(LW(reg, f"{offset}($a0)")) - self.register_instruction(SW(dest, reg)) + self.register_instruction(SW(reg, dest)) self.used_registers[reg] = False @@ -293,8 +290,7 @@ def _(self, node: cil.SetAttributeNode): self.add_source_line_comment(node) # Localizar el atributo - offset = self.locate_attribute(node.attrname, - self.current_type.attributes) + offset = self.locate_attribute(node.attrname, node.itype.attributes) source = self.visit(node.source) reg = self.get_available_register() @@ -305,8 +301,7 @@ def _(self, node: cil.SetAttributeNode): # y luego moverlo a la direccion de memoria del # atributo self.register_instruction(LW(reg, source)) - self.register_instruction( - SW(reg, f"{offset}(${REG_TO_STR[a0]})")) + self.register_instruction(SW(reg, f"{offset}($a0)")) self.used_registers[reg] = False @@ -588,6 +583,7 @@ def to_str(self) -> str: program = "" indent = 0 for instr in self.program: + print(instr) line = str(instr) if '.data' in line or '.text' in line: indent = 0 diff --git a/src/travels/context_actions.py b/src/travels/context_actions.py index 67bdc583..3ed03650 100755 --- a/src/travels/context_actions.py +++ b/src/travels/context_actions.py @@ -23,7 +23,6 @@ def update_scope_variable(vname: str, for i in range(index, len(scope.locals)): if scope.locals[i].name == vname: scope.locals[i].type = new_type - print(f'Changed {scope.locals[i].name} to type {new_type.name}') return if scope.parent: update_scope_variable(vname, new_type, scope.parent, scope.index) diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 53ca6f5e..58117c9f 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -844,5 +844,9 @@ def _(self, node: cil.LabelNode) -> str: def _(self, node: int) -> str: return str(node) + @visit.register + def _(self, node: cil.GetAttributeNode): + return f'{node.dest.name} = GETATTRIBUTE {node.attrname} {node.itype.name}' + def __call__(self, node) -> str: return self.visit(node) diff --git a/src/travels/inference.py b/src/travels/inference.py index 852b6d37..8c3de731 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -3,7 +3,7 @@ import abstract.semantics as semantic import abstract.tree as coolAst -from abstract.semantics import Type +from abstract.semantics import SemanticError, Type from abstract.tree import IsVoidNode from travels.context_actions import (update_attr_type, update_method_param, update_scope_variable) @@ -80,8 +80,12 @@ def _(self, node: coolAst.ClassDef, scope: semantic.Scope, infered_type=None, - deep=1): # noqa: F811 + deep=1): self.current_type = self.context.get_type(node.idx) + # Definir los atributos heredados + for attribute in self.current_type.attributes: + scope.define_variable(attribute.name, attribute.type, "ATTRIBUTE") + for feature in node.features: if isinstance(feature, coolAst.AttributeDef): self.visit(feature, scope, deep=deep) @@ -103,10 +107,8 @@ def _(self, node: coolAst.AttributeDef, scope: semantic.Scope, infered_type=None, - deep=1): # noqa: F811 + deep=1): atrib = self.current_type.get_attribute(node.idx) - if deep == 1: - scope.define_variable(atrib.name, atrib.type, "ATTRIBUTE") # Checkear que el valor de retorno de la expresion # de inicializacion del atributo (si existe) se @@ -121,7 +123,7 @@ def _(self, elif not return_type.conforms_to(atrib.type): self.errors.append( f'Attribute {node.idx} of type {atrib.type.name} can not be initialized with \ - an expression of type {return_type.name}') + an expression of type {return_type.name}' ) # --------------------------------------------------------------------- # Si el método no tiene un tipo definido, entonces tratar de inferir | @@ -130,11 +132,7 @@ def _(self, # los argumentos que no hayan sido definidos con tipos específicos. | # --------------------------------------------------------------------- @visit.register - def _(self, - node: coolAst.MethodDef, - scope, - infered_type=None, - deep=1): # noqa: F811 + def _(self, node: coolAst.MethodDef, scope, infered_type=None, deep=1): method = self.current_type.get_method(node.idx) self.current_method = method for param in node.param_list: @@ -153,7 +151,7 @@ def _(self, node: coolAst.BlockNode, scope: semantic.Scope, infered_type=None, - deep=1): # noqa: F811 + deep=1): # Visitar cada expr del bloque, el tipo del bloque es el tipo de la ultima expresion last = None for expr in node.expressions: @@ -165,7 +163,7 @@ def _(self, node: coolAst.Param, scope: semantic.Scope, infered_type=None, - deep=1): # noqa: F811 + deep=1): type_ = self.context.get_type(node.type) if deep == 1: scope.define_variable(node.id, type_, "PARAM") @@ -181,7 +179,7 @@ def _(self, node: coolAst.AssignNode, scope: semantic.Scope, infered_type=None, - deep=1): # noqa: F811 + deep=1): var_info = scope.find_variable(node.idx) assert self.current_type is not None if var_info: @@ -211,16 +209,13 @@ def _(self, node: coolAst.VariableCall, scope: semantic.Scope, infered_type=None, - deep=1): # noqa: F811 + deep=1): var_info = scope.find_variable(node.idx) assert self.current_type is not None if var_info: if infered_type and var_info.type == self.AUTO_TYPE: var_info.type = infered_type - if not scope.is_local(var_info.name): - update_attr_type(self.current_type, var_info.name, - var_info.type) - else: + if scope.is_local(var_info.name): update_method_param(self.current_type, self.current_method.name, var_info.name, var_info.type) @@ -228,13 +223,14 @@ def _(self, return var_info.type else: self.errors.append(f'Name {node.idx} is not define.') + raise SemanticError(f'Name {node.idx} is not define in {scope}') @visit.register def _(self, node: coolAst.IfThenElseNode, scope: semantic.Scope, infered_type=None, - deep=1): # noqa: F811 + deep=1): cond = self.visit(node.cond, scope, infered_type, deep) e1 = self.visit(node.expr1, scope, infered_type, deep) e2 = self.visit(node.expr2, scope, infered_type, deep) diff --git a/src/travels/typebuilder.py b/src/travels/typebuilder.py index 52c5af4b..02213934 100755 --- a/src/travels/typebuilder.py +++ b/src/travels/typebuilder.py @@ -1,6 +1,6 @@ from typing import List, Any, Optional import abstract.tree as coolAst -from abstract.semantics import SemanticError, Type, Context +from abstract.semantics import Method, SemanticError, Type, Context from functools import singledispatchmethod INHERITABLES = ('Int', 'Bool', 'String', 'AUTO_TYPE') @@ -22,7 +22,7 @@ def _(self, node: coolAst.ProgramNode): # noqa: F811 self.visit(class_) @visit.register - def _(self, node: coolAst.ClassDef): # noqa: F811 + def _(self, node: coolAst.ClassDef): self.current_type = self.context.get_type(node.idx) parent = self.context.get_type(node.parent) @@ -39,6 +39,12 @@ def _(self, node: coolAst.ClassDef): # noqa: F811 else: self.current_type.set_parent(parent) + # Definir los atributos y metodos del padre + for attrib in parent.attributes: + self.current_type.attributes.append(attrib) + + self.current_type.methods.update(parent.methods) + for feature in node.features: self.visit(feature) @@ -58,7 +64,7 @@ def _(self, node: coolAst.AttributeDef): self.errors.append(e.text) @visit.register - def _(self, node: coolAst.MethodDef): # noqa: F811 + def _(self, node: coolAst.MethodDef): params = [param.id for param in node.param_list] try: params_type = [ From c83d7e1c1482f4cca32d672555da1cc70ef402d2 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Wed, 28 Oct 2020 23:25:48 -0400 Subject: [PATCH 101/162] Add comment when deallocating args --- src/mips/baseMipsVisitor.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 4858afff..9d5a5345 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -8,7 +8,7 @@ from mips.branch import JAL, JALR import mips.instruction as instrNodes import mips.arithmetic as arithNodes -from mips.instruction import a0, fp, ra, sp, v0 +from mips.instruction import LineComment, a0, fp, ra, sp, v0 import mips.load_store as lsNodes from typing import List, Optional, Type, Union import time @@ -168,12 +168,8 @@ def cil_func_signature(self, func: FunctionNode): instrNodes.LineComment(f"{func.name} implementation.")) self.register_instruction(instrNodes.LineComment("@Params:")) for i, param in enumerate(func.params): - if i < 4: - self.register_instruction( - instrNodes.LineComment(f"\t$a{i} = {param.name}")) - else: - self.register_instruction( - instrNodes.LineComment(f"\t{(i-4) * 4}($fp) = {param}")) + self.register_instruction( + instrNodes.LineComment(f"\t{i * 4}($fp) = {param.name}")) def operate(self, dest, left, right, operand: Type): """ @@ -330,6 +326,7 @@ def comment(self, message: str): def deallocate_args(self, func: FunctionNode): args = len(func.params) if args > 0: + self.register_instruction(LineComment("Deallocate function args")) self.register_instruction(arithNodes.ADDU(sp, sp, 4 * args, True)) def define_entry_point(self): From ede3815438c84664dd79273e9600feb6eaf2d7ec Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 29 Oct 2020 21:54:43 -0400 Subject: [PATCH 102/162] Update self pointer in dinamic func calls --- src/travels/ciltomips.py | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index fafe2448..a47a90c7 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -4,7 +4,8 @@ from mips.baseMipsVisitor import (BaseCilToMipsVisitor, DotDataDirective, DotTextDirective) import cil.nodes as cil -from mips.instruction import (FixedData, Label, MOVE, REG_TO_STR, a0, s0, sp, ra, v0) +from mips.instruction import (FixedData, Label, MOVE, REG_TO_STR, a0, s0, sp, + ra, v0, a1) import mips.branch as branchNodes from functools import singledispatchmethod @@ -59,7 +60,7 @@ def _(self, node: cil.TypeNode): # noqa: F811 # de modo que la VTABLE sea indexable y podamos efectuar VCALL en O(1). self.register_instruction( FixedData(f'{node.name}_vtable', - ", ".join(x[1] for x in node.methods))) + ", ".join(x[1] for x in node.methods))) self.comment("\n\n") @@ -78,20 +79,18 @@ def _(self, node: cil.TypeNode): # noqa: F811 # Registrar un puntero a la VTABLE del tipo. self.register_instruction( - FixedData(f'{node.name}_vtable_pointer', - f"{node.name}_vtable")) + FixedData(f'{node.name}_vtable_pointer', f"{node.name}_vtable")) # Declarar los atributos: Si los atributos son de tipo string, guardarlos como asciiz # de lo contrario son o numeros o punteros y se inicializan como .words for attrib in node.attributes: if attrib.type.name == "String": self.register_instruction( - FixedData(f'{node.name}_attrib_{attrib.name}', - r"", 'asciiz')) + FixedData(f'{node.name}_attrib_{attrib.name}', r"", + 'asciiz')) else: self.register_instruction( - FixedData(f'{node.name}_attrib_{attrib.name}', - 0)) + FixedData(f'{node.name}_attrib_{attrib.name}', 0)) # Registrar la direccion de memoria donde termina el tipo para calcular facilmente # sizeof @@ -105,9 +104,7 @@ def _(self, node: cil.DataNode): self.register_instruction(DotDataDirective()) if isinstance(node.value, str): self.register_instruction( - FixedData(node.name, - f"{node.value}", - type_='asciiz')) + FixedData(node.name, f"{node.value}", type_='asciiz')) elif isinstance(node.value, dict): # Lo unico que puede ser un diccionario es la TDT. Me parece..... mehh !!?? # La TDT contiene para cada par (typo1, tipo2), la distancia entre tipo1 y tipo2 @@ -116,11 +113,9 @@ def _(self, node: cil.DataNode): # programa los tipos son unicos). for (type1, type2), distance in node.value.items(): self.register_instruction( - FixedData(f"__{type1}_{type2}_tdt_entry__", - distance)) + FixedData(f"__{type1}_{type2}_tdt_entry__", distance)) elif isinstance(node.value, int): - self.register_instruction( - FixedData(node.name, node.value)) + self.register_instruction(FixedData(node.name, node.value)) @visit.register def _(self, node: cil.FunctionNode): @@ -446,6 +441,14 @@ def _(self, node: cil.DynamicCallNode): reg3 = self.get_available_register() assert reg1 is not None and reg2 is not None and reg3 is not None, "out of registers" + # Salvar el puntero a self en a1 + self.comment("Save current self pointer in $a1") + self.register_instruction(MOVE(a1, a0)) + + # Actualizar el puntero a self en a0 + self.comment("Save new self pointer in $a0") + self.register_instruction(LW(a0, type_src)) + # Cargar el puuntero al tipo en el primer registro self.comment("Get pointer to type") self.register_instruction(LW(reg1, type_src)) @@ -456,8 +459,7 @@ def _(self, node: cil.DynamicCallNode): # Cargar el puntero a la funcion correspondiente en el tercer registro self.comment("Get pointer to function address") - self.register_instruction( - LW(reg3, f"{i * 4}(${REG_TO_STR[reg2]})")) + self.register_instruction(LW(reg3, f"{i * 4}(${REG_TO_STR[reg2]})")) # saltar hacia la direccion de memoria correspondiente a la funcion self.comment("Call function. Result is on $v0") @@ -466,6 +468,10 @@ def _(self, node: cil.DynamicCallNode): # El resultado viene en $v0 self.register_instruction(SW(v0, dest)) + # Restaurar el valor antiguo del puntero a self + self.comment("Restore self pointer after function call") + self.register_instruction(MOVE(a0, a1)) + self.used_registers[reg1] = False self.used_registers[reg2] = False self.used_registers[reg3] = False From a24257d9dbdfc22a72914b115a785eaba95f6843 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 30 Oct 2020 18:27:33 -0400 Subject: [PATCH 103/162] Fix attributes initialization calling wrong methods --- src/abstract/semantics.py | 4 ++++ src/mips/baseMipsVisitor.py | 17 ++++++++++++++++- src/travels/ciltomips.py | 9 ++++++--- src/travels/ctcill.py | 2 +- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/abstract/semantics.py b/src/abstract/semantics.py index bd1c39da..f86fd696 100755 --- a/src/abstract/semantics.py +++ b/src/abstract/semantics.py @@ -1,3 +1,4 @@ +from __future__ import annotations import itertools as itt from typing import List, Dict, Optional @@ -120,6 +121,9 @@ def __init__(self, name: str, typex: Type): def __str__(self): return f'[attrib] {self.name} : {self.type.name};' + def __eq__(self, o: Attribute) -> bool: + return o.name == self.name and o.type.name == self.type.name + def __repr__(self): return str(self) diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 9d5a5345..2dd2e695 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -2,6 +2,7 @@ from typed_ast.ast3 import arg from abstract.semantics import Attribute +from abstract.semantics import Type as SemanticType from cil.nodes import TypeNode from cil.nodes import CilNode, FunctionNode from mips import load_store @@ -355,4 +356,18 @@ def locate_attribute(self, attrname: str, attributes: List[Attribute]): if attribute.name == attrname: offset += i * 4 break - return offset \ No newline at end of file + return offset + + +def locate_attribute_in_type_hierarchy(attribute: Attribute, + base_type: SemanticType): + # El atributo se define por primera vez en el primer tipo que lo contiene + # por lo que vamos subiendo por la jerarquia de tipos hasta encontrar + # un tipo que no contenga dicho atributo. Este proceso siempre + # termina porque la raiz de la jerarquia es Object que no tiene + # ningun atributo + last = base_type + while 1: + if attribute not in last.parent.attributes: + return last.name + last = last.parent \ No newline at end of file diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index a47a90c7..dad3c63d 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -2,7 +2,8 @@ from cil.nodes import LocalNode from mips.arithmetic import ADD, DIV, MUL, SUB, SUBU from mips.baseMipsVisitor import (BaseCilToMipsVisitor, DotDataDirective, - DotTextDirective) + DotTextDirective, + locate_attribute_in_type_hierarchy) import cil.nodes as cil from mips.instruction import (FixedData, Label, MOVE, REG_TO_STR, a0, s0, sp, ra, v0, a1) @@ -354,9 +355,12 @@ def _(self, node: cil.AllocateNode): # Los atributos comienzan en el indice 8($v0) for i, attribute in enumerate(instance_type.attributes): + attrib_type_name = locate_attribute_in_type_hierarchy( + attribute, instance_type) # llamar la funcion de inicializacion del atributo self.register_instruction( - branchNodes.JAL(f"__attrib__{attribute.name}__init")) + branchNodes.JAL( + f"__{attrib_type_name}__attrib__{attribute.name}__init")) # El valor de retorno viene en v0 self.register_instruction( SW(dest=v0, src=f"{8 + i*4}(${REG_TO_STR[temp]})")) @@ -589,7 +593,6 @@ def to_str(self) -> str: program = "" indent = 0 for instr in self.program: - print(instr) line = str(instr) if '.data' in line or '.text' in line: indent = 0 diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 58117c9f..c59f00d8 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -106,7 +106,7 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 @visit.register def _(self, node: coolAst.AttributeDef, scope: Scope) -> None: self.current_function = self.register_function( - f"__attrib__{node.idx}__init") + f"__{self.current_type.name}__attrib__{node.idx}__init") if node.default_value is not None: # Generar el codigo de la expresion de inicializacion # y devolver el valor de esta From e7f0427769f2621dd9f39d00243ce6f160a28063 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sat, 31 Oct 2020 16:02:15 -0400 Subject: [PATCH 104/162] Fix missing NegNode and fix bug with grammar --- src/.builds | 2 + src/abstract/tree.py | 4 + src/cil/nodes.py | 27 +++- src/coolgrammar/grammar.py | 8 +- src/mips/instruction.py | 1 + src/pycoolc.py | 28 ++-- src/testing.mips | 239 +++++++++++++++++++++++++++++++++++ src/testing.py | 54 ++++---- src/travels/ciltomips.py | 36 +++++- src/travels/ctcill.py | 63 +++++++-- src/travels/inference.py | 22 +++- src/travels/typecollector.py | 5 +- 12 files changed, 427 insertions(+), 62 deletions(-) create mode 100644 src/testing.mips diff --git a/src/.builds b/src/.builds index 0df35d7d..ca2727cd 100644 --- a/src/.builds +++ b/src/.builds @@ -127,3 +127,5 @@ 1 1 1 +1 +1 diff --git a/src/abstract/tree.py b/src/abstract/tree.py index 32066548..6c6714b3 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -271,3 +271,7 @@ def __init__(self, expressions): class IsVoidNode(ExpressionNode): def __init__(self, expr): self.expr: ExpressionNode = expr + + +class SelfNode(ExpressionNode): + pass \ No newline at end of file diff --git a/src/cil/nodes.py b/src/cil/nodes.py index f9cf37c8..a701c7c7 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -1,3 +1,4 @@ +from __future__ import annotations from typing import List, Tuple, Union from abstract.semantics import Attribute, Method, Type """ @@ -11,6 +12,11 @@ class CilNode: pass +class BuiltInNode(CilNode): + def __init__(self, dest: LocalNode) -> None: + self.dest = dest + + class CilProgramNode(CilNode): def __init__(self, dottypes, dotdata, dotcode): self.dottypes: List[TypeNode] = dottypes @@ -71,7 +77,8 @@ class PlusNode(ArithmeticNode): class MinusNode(ArithmeticNode): - def __init__(self, x: LocalNode, y: LocalNode, dest: LocalNode): + def __init__(self, x: Union[LocalNode, int, ParamNode], + y: Union[LocalNode, int, ParamNode], dest: LocalNode): self.x = x self.y = y self.dest = dest @@ -183,19 +190,19 @@ def __init__(self, dest: LocalNode, message: DataNode): self.message = message -class LengthNode(InstructionNode): +class LengthNode(BuiltInNode): pass -class ConcatNode(InstructionNode): +class ConcatNode(BuiltInNode): pass -class PrefixNode(InstructionNode): +class PrefixNode(BuiltInNode): pass -class SubstringNode(InstructionNode): +class SubstringNode(BuiltInNode): pass @@ -227,3 +234,13 @@ class GetTypeIndex(InstructionNode): def __init__(self, itype: str, dest: str): self.itype = itype self.dest = dest + + +class SelfNode(InstructionNode): + def __init__(self, dest: LocalNode) -> None: + self.dest = dest + + +class NotNode(InstructionNode): + def __init__(self, src: LocalNode) -> None: + self.src = src \ No newline at end of file diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index ab5303cd..cff10921 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -2,7 +2,7 @@ Contenedor para la funcion que construye la gramatica de cool. ''' from grammar.grammar import Grammar -from abstract.tree import ProgramNode, ClassDef, MethodDef, AttributeDef, Param, VariableDeclaration +from abstract.tree import ProgramNode, ClassDef, MethodDef, AttributeDef, Param, SelfNode, VariableDeclaration from abstract.tree import PlusNode, DivNode, MulNode, DifNode, IntegerConstant, FunCall from abstract.tree import VariableCall, FalseConstant, StringConstant, TrueConstant from abstract.tree import GreaterEqualNode, LowerThanNode, LowerEqual, AssignNode, IfThenElseNode @@ -101,7 +101,8 @@ def build_cool_grammar(): exp %= idx + assign + exp, lambda s: AssignNode(s[1], s[3]) - exp %= while_ + exp + loop + statement_list + pool, lambda s: WhileBlockNode(s[2], s[5]) + exp %= while_ + exp + loop + statement_list + pool, lambda s: WhileBlockNode( + s[2], s[4]) exp %= atom, lambda s: s[1] @@ -147,7 +148,8 @@ def build_cool_grammar(): factor %= string_const, lambda s: s[1] - factor %= idx + opar + args_list_empty + cpar, lambda s: FunCall('self', s[1], s[3]) + factor %= idx + opar + args_list_empty + cpar, lambda s: FunCall( + SelfNode(), s[1], s[3]) factor %= factor + arroba + typex + period + idx + opar + args_list_empty + cpar, lambda s: ParentFuncCall(s[1], s[3], s[5], s[7]) diff --git a/src/mips/instruction.py b/src/mips/instruction.py index 1fc56315..0e31ddf3 100644 --- a/src/mips/instruction.py +++ b/src/mips/instruction.py @@ -60,6 +60,7 @@ ARGS_REGISTERS = (a0, a1, a2, a3) REG_TO_STR = { + zero: "zero", v0: "v0", v1: "v1", s0: "s0", diff --git a/src/pycoolc.py b/src/pycoolc.py index 47078530..7c61a4ed 100644 --- a/src/pycoolc.py +++ b/src/pycoolc.py @@ -16,40 +16,47 @@ def report(errors: list): def pipeline(program: str, deep: int, file_name: str) -> None: try: program = find_comments(program) + # Tratar los \t en el programa como 4 espacios por comodidad + # a la hora de reportar errores de fila y columna + program = program.replace('\t', ' ' * 4) except AssertionError as e: print(e) sys.exit(1) - # Right now, program has no comments, so is safe to pass it to the LEXER + # El programa no contiene comentarios en esta fase + # por lo que es seguro pasarselo al LEXER try: tokens = LEXER(program) except Exception as e: print(e) sys.exit(1) - # Parse the tokens to obtain a derivation tree + # Parsear los tokens para obtener un arbol de derivacion try: parse = PARSER(tokens) except Exception as e: print(e) sys.exit(1) - # build the AST from the obtained parse + # Construir el AST a partir del arbol de derivacion obtenido try: ast = evaluate_right_parse(parse, tokens[:-1]) except Exception as e: print(e) sys.exit(1) - ##################### - # Start the visitors # - ###################### + ######################## + # Empezar los visitors # + ######################## - # Run type checker visitor + # Ejecutar los visitors que recolectan los tipos, + # los crean y luego realizan un chequeo semantico + # sobre el programa y la inferencia de tipos errors, context, scope = ast.check_semantics(deep) if errors: report(errors) sys.exit(1) - # Run Cool to CIL visitor + # Correr el visitor que transforma el AST de COOL + # en un AST de CIL cil_visitor = CoolToCILVisitor(context) try: cil_program = cil_visitor.visit(ast, scope) @@ -59,8 +66,11 @@ def pipeline(program: str, deep: int, file_name: str) -> None: assert isinstance(cil_program, CilProgramNode) - # Run CIL to MIPS visitor + # Convertir el AST de CIL en instrucciones de MIPS code_gen = MipsCodeGenerator() + + # Obtener la representacion en str de las instrucciones + # en MIPS file_str = code_gen(cil_program) with open(f"{file_name}.mips", "w+") as f: diff --git a/src/testing.mips b/src/testing.mips new file mode 100644 index 00000000..33c3a001 --- /dev/null +++ b/src/testing.mips @@ -0,0 +1,239 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Oct 31 12:55:44 2020 +# School of Math and Computer Science, University of Havana +# + +.data +Main: + # + + +.data +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_Main, function_out_int_at_Main, function_in_string_at_Main, function_in_int_at_Main, function_main_at_Main, function_fib_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + Main_end: +# + + +.data +data_0: .asciiz +# + + +.data +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_Main_tdt_entry__: .word 1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +.data +data_2: .asciiz "Enter n to find nth fibonacci number!\n" +# + + +.data +data_3: .asciiz "\n" +# + + +.text +main: + jal entry + li $v0, 10 + syscall + +.text +entry: + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + li $a0, 8 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -4($fp) + lw $t0, -4($fp) + subu $sp, $sp, 4 + sw $t0, 0($sp) + jal function_main_at_Main + sw $v0, -8($fp) + li $v0, 0 + lw $ra, 4($sp) + lw $fp, 0($sp) + addu $sp, $sp, 32 + jr $ra + + +.text +function_main_at_Main: + subu $sp, $sp, 76 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 76 + sw $a0, -12($fp) + lw $t0, -12($fp) + lw $t1, 4($t0) + sw $t1, -4($fp) + lw $t0, data_2 + sw $t0, -16($fp) + lw $t0, -16($fp) + subu $sp, $sp, 4 + sw $t0, 0($sp) + move $a1, $a0 + lw $a0, -4($fp) + lw $t0, -4($fp) + lw $t1, 0($t0) + lw $t2, 0($t1) + jalr $t2 + sw $v0, -8($fp) + move $a0, $a1 + sw $a0, -28($fp) + lw $t0, -28($fp) + lw $t1, 4($t0) + sw $t1, -20($fp) + sw $a0, -40($fp) + lw $t0, -40($fp) + lw $t1, 4($t0) + sw $t1, -32($fp) + sw $a0, -52($fp) + lw $t0, -52($fp) + lw $t1, 4($t0) + sw $t1, -44($fp) + move $a1, $a0 + lw $a0, -44($fp) + lw $t0, -44($fp) + lw $t1, 0($t0) + lw $t2, 12($t1) + jalr $t2 + sw $v0, -48($fp) + move $a0, $a1 + lw $t0, -48($fp) + subu $sp, $sp, 4 + sw $t0, 0($sp) + move $a1, $a0 + lw $a0, -32($fp) + lw $t0, -32($fp) + lw $t1, 0($t0) + lw $t2, 20($t1) + jalr $t2 + sw $v0, -36($fp) + move $a0, $a1 + lw $t0, -36($fp) + subu $sp, $sp, 4 + sw $t0, 0($sp) + move $a1, $a0 + lw $a0, -20($fp) + lw $t0, -20($fp) + lw $t1, 0($t0) + lw $t2, 4($t1) + jalr $t2 + sw $v0, -24($fp) + move $a0, $a1 + sw $a0, -64($fp) + lw $t0, -64($fp) + lw $t1, 4($t0) + sw $t1, -56($fp) + lw $t0, data_3 + sw $t0, -68($fp) + lw $t0, -68($fp) + subu $sp, $sp, 4 + sw $t0, 0($sp) + move $a1, $a0 + lw $a0, -56($fp) + lw $t0, -56($fp) + lw $t1, 0($t0) + lw $t2, 0($t1) + jalr $t2 + sw $v0, -60($fp) + move $a0, $a1 + lw $v0, -60($fp) + lw $ra, 4($sp) + lw $fp, 0($sp) + addu $sp, $sp, 76 + jr $ra + + +.text +function_fib_at_Main: + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + li $t0, 1 + sw $t0, -4($fp) + li $t0, 0 + sw $t0, -8($fp) + li $t0, 0 + sw $t0, -12($fp) + label_WHILE_1: + lw $t0, 0($fp) + sub $t0, $t0, 0 + sw $t0, -16($fp) + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_3 + li $t0, 0 + sw $t0, -16($fp) + j label_END_4 + label_TRUE_3: + li $t0, 1 + sw $t0, -16($fp) + label_END_4: + lw $t0, -16($fp) + nor $t0, $t0, $zero + sw $t0, -16($fp) + lw $t0, -16($fp) + beq $t0, 0, label_WHILE_END_2 + j label_WHILE_1 + label_WHILE_END_2: + lw $v0, -4($fp) + lw $ra, 4($sp) + lw $fp, 0($sp) + addu $sp, $sp, 32 + addu $sp, $sp, 4 + jr $ra \ No newline at end of file diff --git a/src/testing.py b/src/testing.py index f5c8ca4b..e48f31a6 100755 --- a/src/testing.py +++ b/src/testing.py @@ -15,6 +15,7 @@ def report(errors: list): def pipeline(program: str, deep: int) -> None: try: program = find_comments(program) + program = program.replace('\t', ' ' * 4) except AssertionError as e: print(e) sys.exit(1) @@ -59,35 +60,36 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = """ -class A { - a : Int ; - suma ( a : AUTO_TYPE , b : Int ) : AUTO_TYPE { - a + b - }; - b : Int ; -}; +text = r""" +class Main inherits IO { + -- the class has features. Only methods in this case. + main(): Object { + { + out_string("Enter n to find nth fibonacci number!\n"); + out_int(fib(in_int())); + out_string("\n"); + } + }; -class B inherits A { - c : Int ; - f ( d : Int , a : A ) : AUTO_TYPE { { - let f : AUTO_TYPE <- 10 in 8 ; - let c : AUTO_TYPE <- a. suma ( 5 , f ) in c ; - c; - } }; + fib(i : Int) : Int { -- list of formals. And the return type of the method. + let a : Int <- 1, + b : Int <- 0, + c : Int <- 0 + in + { + while (not (i = 0)) loop -- expressions are nested. + { + c <- a + b; + i <- i - 1; + b <- a; + a <- c; + } + pool; + c; + } + }; - get_a() : Int { - a - }; }; -class Main { - - main(): Object { - { - (new B).f(5, (new A)); - } - }; -}; """ pipeline(text, 5) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index dad3c63d..14b2a2b0 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -1,12 +1,12 @@ from abstract.semantics import Type from cil.nodes import LocalNode -from mips.arithmetic import ADD, DIV, MUL, SUB, SUBU +from mips.arithmetic import ADD, DIV, MUL, NOR, SUB, SUBU from mips.baseMipsVisitor import (BaseCilToMipsVisitor, DotDataDirective, DotTextDirective, locate_attribute_in_type_hierarchy) import cil.nodes as cil from mips.instruction import (FixedData, Label, MOVE, REG_TO_STR, a0, s0, sp, - ra, v0, a1) + ra, v0, a1, zero) import mips.branch as branchNodes from functools import singledispatchmethod @@ -411,6 +411,28 @@ def _(self, node: cil.UnconditionalJump): self.add_source_line_comment(node) self.register_instruction(branchNodes.J(node.label)) + @visit.register + def _(self, node: cil.NotNode): + self.add_source_line_comment(node) + # Hay que cambiar lo que hay en dest, si es 1 poner 0 + # y si es 0 poner 1 + dest = self.visit(node.src) + assert dest is not None + reg = self.get_available_register() + assert reg is not None + + self.comment("Load value in register") + self.register_instruction(LW(reg, dest)) + + # a nor 0 = not (a or 0) = not a + self.comment("a nor 0 = not (a or 0) = not a") + self.register_instruction(NOR(reg, reg, zero)) + + self.comment("Store negated value") + self.register_instruction(SW(reg, dest)) + + self.used_registers[reg] = False + @visit.register def _(self, node: cil.StaticCallNode): @@ -576,6 +598,14 @@ def _(self, node: cil.TdtLookupNode): def _(self, node: int): return node + @visit.register + def _(self, node: cil.SelfNode): + dest = self.visit(node.dest) + assert dest is not None + # El puntero a self siempre se guarda en el registro $a0 + self.add_source_line_comment(node) + self.register_instruction(SW(a0, dest)) + class MipsCodeGenerator(CilToMipsVisitor): """ @@ -600,6 +630,6 @@ def to_str(self) -> str: if '#' not in line and (':' in line and 'end' not in line): if 'word' not in line and 'asciiz' not in line and 'byte' not in line: indent += 1 - if "END" in line or "end" in line: + if '#' not in line and ("END" in line or "end" in line): indent -= 1 return program diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index c59f00d8..f8da475b 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -1,5 +1,6 @@ +import re from cloudpickle.cloudpickle import instance -from abstract.tree import AssignNode +from abstract.tree import AssignNode, SelfNode import cil.baseCilVisitor as baseCilVisitor import abstract.tree as coolAst import abstract.semantics as semantics @@ -7,7 +8,20 @@ from typing import List, Optional, Tuple from functools import singledispatchmethod -from cil.nodes import CilNode, LocalNode, ParamNode, ReturnNode +from cil.nodes import CilNode, ConcatNode, LengthNode, LocalNode, ParamNode, PrintNode, ReadNode, ReturnNode, SubstringNode + +BUILT_IN_METHODS = { + 'concat': ConcatNode, + 'length': LengthNode, + 'substr': SubstringNode, + 'out_string': PrintNode, + 'out_int': PrintNode, + 'in_string': ReadNode, + 'in_int': ReadNode +} + +BUILTINS = ('concat', 'length', 'substr', 'out_string', 'out_int', 'in_string', + 'in_int') ExpressionReturn = Tuple[List[cil.InstructionNode], List[cil.LocalNode]] Scope = semantics.Scope @@ -225,6 +239,7 @@ def _(self, node: coolAst.VariableCall, scope: Scope): # noqa: F811 # Diferenciar la variable si es un parametro, un atributo o una variable local # en el scope actual if vinfo.location == "PARAM": + for param_node in self.params: if vinfo.name in param_node.name: return param_node @@ -265,17 +280,17 @@ def _(self, node: coolAst.AssignNode, scope: Scope): # Generar el codigo para el rvalue (expr) rvalue_vm_holder = self.visit(self, node.expr) - assert isinstance(rvalue_vm_holder, LocalNode) # Es necesario diferenciar entre variable y atributo. # Las variables se diferencian en si son locales al # metodo que estamos creando o si son atributos. - if scope.is_local(node.idx): + if isinstance(rvalue_vm_holder, ParamNode) or scope.is_local(node.idx): # registrar la instruccion de asignacion self.register_instruction( cil.AssignNode(node.idx, rvalue_vm_holder)) else: assert self.current_type is not None + assert isinstance(rvalue_vm_holder, LocalNode) self.register_instruction( cil.SetAttributeNode(self.current_type, node.idx, rvalue_vm_holder)) @@ -290,7 +305,8 @@ def _(self, node: coolAst.WhileBlockNode, scope: Scope): cond_vm_holder = self.visit(node.cond, scope) # Probar la condicion, si es true continuar la ejecucion, sino saltar al LABEL end - assert isinstance(cond_vm_holder, LocalNode) + assert isinstance(cond_vm_holder, + LocalNode), cond_vm_holder.__class__.__name__ self.register_instruction(cil.IfZeroJump(cond_vm_holder, end_label)) # Registrar las instrucciones del cuerpo del while @@ -502,7 +518,22 @@ def _(self, node: coolAst.FalseConstant, scope: Scope) -> int: # ******************* @visit.register - def _(self, node: coolAst.EqualToNode, scope: Scope) -> int: + def _(self, node: coolAst.NegNode, scope: Scope): + # Obtener el valor de la expresion + expr_result = self.visit(node.lex, scope) + result_vm_holder = self.define_internal_local() + + if isinstance(expr_result, int): + self.register_instruction( + cil.AssignNode(result_vm_holder, abs(expr_result - 1))) + return result_vm_holder + else: + assert isinstance(expr_result, LocalNode) + self.register_instruction(cil.NotNode(expr_result)) + return expr_result + + @visit.register + def _(self, node: coolAst.EqualToNode, scope: Scope) -> LocalNode: expr_result_vm_holder = self.define_internal_local() true_label = self.do_label("TRUE") end_label = self.do_label("END") @@ -514,8 +545,8 @@ def _(self, node: coolAst.EqualToNode, scope: Scope) -> int: right_vm_holder = self.visit(node.right, scope) # Realizar una resta y devolver el resultado - assert isinstance(left_vm_holder, LocalNode) and isinstance( - right_vm_holder, LocalNode) + assert (isinstance(left_vm_holder, LocalNode) or isinstance(left_vm_holder, int) or isinstance(left_vm_holder, ParamNode)) and (isinstance( + right_vm_holder, LocalNode) or isinstance(right_vm_holder, int) or isinstance(right_vm_holder, ParamNode)) self.register_instruction( cil.MinusNode(left_vm_holder, right_vm_holder, @@ -531,7 +562,7 @@ def _(self, node: coolAst.EqualToNode, scope: Scope) -> int: # Si la resta da 0, devolver 1 self.register_instruction(cil.LabelNode(true_label)) - expr_result_vm_holder = 1 + self.register_instruction(cil.AssignNode(expr_result_vm_holder, 1)) self.register_instruction(cil.LabelNode(end_label)) @@ -714,6 +745,12 @@ def _(self, node: coolAst.ParentFuncCall, scope: Scope) -> LocalNode: return return_expr_vm_holder + @visit.register + def _(self, node: SelfNode, scope: Scope) -> LocalNode: + return_expr_vm_holder = self.define_internal_local() + self.register_instruction(cil.SelfNode(return_expr_vm_holder)) + return return_expr_vm_holder + class CilDisplayFormatter: @singledispatchmethod @@ -848,5 +885,13 @@ def _(self, node: int) -> str: def _(self, node: cil.GetAttributeNode): return f'{node.dest.name} = GETATTRIBUTE {node.attrname} {node.itype.name}' + @visit.register + def _(self, node: cil.SelfNode): + return f'{node.dest.name} = SELF' + + @visit.register + def _(self, node: cil.NotNode): + return f'NOT {node.src.name}' + def __call__(self, node) -> str: return self.visit(node) diff --git a/src/travels/inference.py b/src/travels/inference.py index 8c3de731..110fe034 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -3,8 +3,8 @@ import abstract.semantics as semantic import abstract.tree as coolAst -from abstract.semantics import SemanticError, Type -from abstract.tree import IsVoidNode +from abstract.semantics import Scope, SemanticError, Type +from abstract.tree import IsVoidNode, SelfNode from travels.context_actions import (update_attr_type, update_method_param, update_scope_variable) @@ -38,6 +38,7 @@ def __init__(self, context: semantic.Context, errors=[]): self.STRING = self.context.get_type('String') self.BOOL = self.context.get_type('Bool') self.AUTO_TYPE = self.context.get_type('AUTO_TYPE') + self.SELF_TYPE = self.context.get_type('SELF_TYPE') self.errors = errors self.current_method: Optional[semantic.Method] = None @@ -123,7 +124,7 @@ def _(self, elif not return_type.conforms_to(atrib.type): self.errors.append( f'Attribute {node.idx} of type {atrib.type.name} can not be initialized with \ - an expression of type {return_type.name}' ) + an expression of type {return_type.name}' ) # --------------------------------------------------------------------- # Si el método no tiene un tipo definido, entonces tratar de inferir | @@ -133,12 +134,15 @@ def _(self, # --------------------------------------------------------------------- @visit.register def _(self, node: coolAst.MethodDef, scope, infered_type=None, deep=1): + assert self.current_type is not None method = self.current_type.get_method(node.idx) self.current_method = method for param in node.param_list: self.visit(param, scope, deep=deep) last = self.visit(node.statements, scope, deep=deep) + if last.name == 'SELF_TYPE': + last = self.current_type if not method.return_type != self.AUTO_TYPE: method.return_type = last else: @@ -298,11 +302,15 @@ def _(self, node: coolAst.FunCall, scope: semantic.Scope, infered_type=None, - deep=1): # noqa: F811 + deep=1): + assert self.current_type is not None # Detectar el tipo estatico de la expr0. static_expr0_type: semantic.Type = self.visit(node.obj, scope, infered_type, deep) + if static_expr0_type.name == "SELF_TYPE": + static_expr0_type = self.current_type + # Encontrar el metodo en el tipo. method: semantic.Method = static_expr0_type.get_method(node.id) @@ -501,7 +509,7 @@ def _(self, @visit.register def _(self, - node: coolAst.NotNode, + node: coolAst.NegNode, scope: semantic.Scope, infered_type=None, deep=1) -> Type: @@ -535,3 +543,7 @@ def _(self, node: coolAst.FalseConstant, scope, infered_type=None, deep=1): @visit.register def _(self, node: coolAst.IsVoidNode, scope, infered_type=None, deep=1): return self.BOOL + + @visit.register + def _(self, node: SelfNode, scope, infered_type=None, deep=1): + return self.SELF_TYPE diff --git a/src/travels/typecollector.py b/src/travels/typecollector.py index ca630765..8050651c 100755 --- a/src/travels/typecollector.py +++ b/src/travels/typecollector.py @@ -118,8 +118,8 @@ def visit(self, node): @visit.register # type: ignore def _(self, node: coolAst.ProgramNode): # noqa: F811 self.context = Context() - OBJECT, INTEGER, STRING, BOOL, VOID = ObjectType(), IntegerType( - ), StringType(), BoolType(), VoidType() + OBJECT, INTEGER, STRING, BOOL, VOID, SELF_TYPE = ObjectType( + ), IntegerType(), StringType(), BoolType(), VoidType(), SelfType() ioType = IoType() INTEGER.set_parent(OBJECT) STRING.set_parent(OBJECT) @@ -138,6 +138,7 @@ def _(self, node: coolAst.ProgramNode): # noqa: F811 self.context.types['Void'] = VOID self.context.types['AUTO_TYPE'] = AutoType() self.context.types['IO'] = ioType + self.context.types['SELF_TYPE'] = SELF_TYPE for class_ in node.class_list: self.visit(class_) From faacd8051846a697658647556edb8650dd190ac8 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Mon, 9 Nov 2020 21:59:53 -0500 Subject: [PATCH 105/162] implement read-write builtin funcs, fix typecollector and bootstrap --- src/cil/baseCilVisitor.py | 82 ++++++++- src/cil/nodes.py | 24 ++- src/testing.mips | 165 +++++++++++++++++- src/testing.py | 1 - src/travels/ciltomips.py | 65 +++++-- src/travels/ctcill.py | 320 ++++++++++++++++++----------------- src/travels/typebuilder.py | 4 +- src/travels/typecollector.py | 12 +- 8 files changed, 487 insertions(+), 186 deletions(-) diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 963dffe8..b6d65588 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -1,6 +1,7 @@ from typing import List, Optional, Any, Dict, Tuple import cil.nodes as nodes from abstract.semantics import VariableInfo, Context, Type, Method +from cil.nodes import CopyNode, PrintIntNode, PrintNode, ReadIntNode, ReadNode, ReturnNode, SelfNode, TypeNode TDT = Dict[Tuple[str, str], int] @@ -102,7 +103,7 @@ def __init__(self, context: Context): self.null = self.register_data("") self.__labels_count: int = 0 self.__build_CART() - self.__build_builtins() + self.build_builtins() @property def params(self) -> List[nodes.ParamNode]: @@ -192,5 +193,82 @@ def __build_CART(self) -> None: # Procesar la TDT para hacerla accesible en runtime. self.tdt_data_node = self.register_data(self.tdt_table) - def __build_builtins(self): + def __implement_out_string(self): + # Registrar el parametro que espera la funcion + self.current_function = self.register_function( + 'function_out_string_at_IO') + param = self.register_params( + VariableInfo('x', self.context.get_type('String'), 'PARAM')) + # Esta funcion espera que se llame con un argumento que apunta + # a la direccion de memoria de un string, luego solo realiza + # los procedimientos necesarios para imprimir en consola + # dicho string. Creamos el nodo PrintNode y dejamos la + # implementacion y la llamada a sistema a MIPS + self.register_instruction(PrintNode(param)) + self.register_instruction(ReturnNode()) + self.current_function = None + + def __implement_out_int(self): + # Registrar el parametro que espera la funcion y la + # funcion como tal + self.current_function = self.register_function( + 'function_out_int_at_IO') + param = self.register_params( + VariableInfo('x', self.context.get_type('Int'), 'PARAM')) + + # Espera como unico parametro un entero. + self.register_instruction(PrintIntNode(param)) + self.register_instruction(ReturnNode()) + self.current_function = None + + def __implement_in_string(self): + # Registrar la funcion + self.current_function = self.register_function( + 'function_in_string_at_IO') + # Declarar una variable para devolver el valor + return_vm_holder = self.define_internal_local() + # Registrar el nodo que realiza el trabajo en MIPS + self.register_instruction(ReadNode(return_vm_holder)) + self.register_instruction(ReturnNode(return_vm_holder)) + self.current_function = None + + def __implement_in_int(self): + # Registrar la funcion + self.current_function = self.register_function('function_in_int_at_IO') + # Declarar una variable para devolver el valor + return_vm_holder = self.define_internal_local() + self.register_instruction(ReadIntNode(return_vm_holder)) + self.register_instruction(ReturnNode(return_vm_holder)) + self.current_function = None + + def __implement_abort(self): + # la funcion abort no recibe ningun paramentro + # Simplemente llama trap y le pasa la causa "abortion" + self.current_function = self.register_function( + 'function_abort_at_Object') + # TODO: Implementarlo + self.current_function = None pass + + def __implement_copy(self): + # La funcion copy es llamada sore un objeto + # para obtener una copia superficial de la misma, + # o sea, que se copia el propio objeto, pero no + # recursivamente algun objeto que este pueda contener + self.current_function = self.register_function( + 'function_copy_at_Object') + # Obtener una referencia al objeto que queremos clonar + self_vm_holder = self.define_internal_local() + clone_vm_holder = self.define_internal_local() + self.register_instruction(SelfNode(self_vm_holder)) + self.register_instruction(CopyNode(self_vm_holder, clone_vm_holder)) + self.register_instruction(ReturnNode(clone_vm_holder)) + self.current_function = None + + def build_builtins(self): + self.__implement_in_string() + self.__implement_out_int() + self.__implement_out_string() + self.__implement_in_int() + self.__implement_abort() + self.__implement_copy() diff --git a/src/cil/nodes.py b/src/cil/nodes.py index a701c7c7..65316481 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -213,13 +213,23 @@ def __init__(self, dest, ivalue): class ReadNode(InstructionNode): - def __init__(self, dest: str): + def __init__(self, dest): + self.dest = dest + + +class ReadIntNode(InstructionNode): + def __init__(self, dest) -> None: self.dest = dest class PrintNode(InstructionNode): - def __init__(self, string_address: str): - self.string_address = string_address + def __init__(self, src) -> None: + self.src = src + + +class PrintIntNode(InstructionNode): + def __init__(self, src) -> None: + self.src = src class TdtLookupNode(InstructionNode): @@ -243,4 +253,10 @@ def __init__(self, dest: LocalNode) -> None: class NotNode(InstructionNode): def __init__(self, src: LocalNode) -> None: - self.src = src \ No newline at end of file + self.src = src + + +class CopyNode(InstructionNode): + def __init__(self, selfsrc: LocalNode, dest: LocalNode) -> None: + self.selfsrc = selfsrc + self.dest = dest \ No newline at end of file diff --git a/src/testing.mips b/src/testing.mips index 33c3a001..af0d33e8 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,6 +1,8 @@ +[] +[('out_string', 'function_out_string_at_Main'), ('out_int', 'function_out_int_at_Main'), ('in_string', 'function_in_string_at_Main'), ('in_int', 'function_in_int_at_Main'), ('abort', 'function_abort_at_Main'), ('type_name', 'function_type_name_at_Main'), ('copy', 'function_copy_at_Main'), ('main', 'function_main_at_Main'), ('fib', 'function_fib_at_Main')] # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Oct 31 12:55:44 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Nov 7 14:53:21 2020 # School of Math and Computer Science, University of Havana # @@ -11,7 +13,7 @@ Main: .data # **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_Main, function_out_int_at_Main, function_in_string_at_Main, function_in_int_at_Main, function_main_at_Main, function_fib_at_Main +Main_vtable: .word function_out_string_at_Main, function_out_int_at_Main, function_in_string_at_Main, function_in_int_at_Main, function_abort_at_Main, function_type_name_at_Main, function_copy_at_Main, function_main_at_Main, function_fib_at_Main # @@ -80,15 +82,23 @@ data_3: .asciiz "\n" .text main: jal entry + # syscall code 10 is for exit li $v0, 10 syscall + # main END .text +# entry implementation. +# @Params: entry: + # Allocate stack frame for function entry. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 8 bytes of memory li $a0, 8 li $v0, 9 syscall @@ -98,142 +108,289 @@ entry: sw $t0, 4($v0) move $t1, $v0 sw $t1, -4($fp) + # ARG local__internal_0 + # LOCAL local__internal_0 --> -4($fp) lw $t0, -4($fp) + # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) jal function_main_at_Main sw $v0, -8($fp) + # RETURN 0 li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra lw $ra, 4($sp) + # Restore $fp lw $fp, 0($sp) + # Restore Stack pointer $sp addu $sp, $sp, 32 jr $ra + # Function END .text +# function_main_at_Main implementation. +# @Params: function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. subu $sp, $sp, 76 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 76 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF sw $a0, -12($fp) + # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 lw $t0, -12($fp) + # Load pointer to type lw $t1, 4($t0) sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # lw $t0, data_2 sw $t0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) lw $t0, -16($fp) + # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save current self pointer in $a1 move $a1, $a0 + # Save new self pointer in $a0 lw $a0, -4($fp) + # Get pointer to type lw $t0, -4($fp) + # Get pointer to type's VTABLE lw $t1, 0($t0) + # Get pointer to function address lw $t2, 0($t1) + # Call function. Result is on $v0 jalr $t2 sw $v0, -8($fp) + # Restore self pointer after function call move $a0, $a1 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_6 = SELF sw $a0, -28($fp) + # local_main_at_Main_internal_4 = TYPEOF local_main_at_Main_internal_6 lw $t0, -28($fp) + # Load pointer to type lw $t1, 4($t0) sw $t1, -20($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = SELF sw $a0, -40($fp) + # local_main_at_Main_internal_7 = TYPEOF local_main_at_Main_internal_9 lw $t0, -40($fp) + # Load pointer to type lw $t1, 4($t0) sw $t1, -32($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = SELF sw $a0, -52($fp) + # local_main_at_Main_internal_10 = TYPEOF local_main_at_Main_internal_12 lw $t0, -52($fp) + # Load pointer to type lw $t1, 4($t0) sw $t1, -44($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 in_int + # Save current self pointer in $a1 move $a1, $a0 + # Save new self pointer in $a0 lw $a0, -44($fp) + # Get pointer to type lw $t0, -44($fp) + # Get pointer to type's VTABLE lw $t1, 0($t0) + # Get pointer to function address lw $t2, 12($t1) + # Call function. Result is on $v0 jalr $t2 sw $v0, -48($fp) + # Restore self pointer after function call move $a0, $a1 + # ARG local_main_at_Main_internal_11 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) lw $t0, -48($fp) + # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 fib + # Save current self pointer in $a1 move $a1, $a0 + # Save new self pointer in $a0 lw $a0, -32($fp) + # Get pointer to type lw $t0, -32($fp) + # Get pointer to type's VTABLE lw $t1, 0($t0) - lw $t2, 20($t1) + # Get pointer to function address + lw $t2, 32($t1) + # Call function. Result is on $v0 jalr $t2 sw $v0, -36($fp) + # Restore self pointer after function call move $a0, $a1 + # ARG local_main_at_Main_internal_8 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) lw $t0, -36($fp) + # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 out_int + # Save current self pointer in $a1 move $a1, $a0 + # Save new self pointer in $a0 lw $a0, -20($fp) + # Get pointer to type lw $t0, -20($fp) + # Get pointer to type's VTABLE lw $t1, 0($t0) + # Get pointer to function address lw $t2, 4($t1) + # Call function. Result is on $v0 jalr $t2 sw $v0, -24($fp) + # Restore self pointer after function call move $a0, $a1 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = SELF sw $a0, -64($fp) + # local_main_at_Main_internal_13 = TYPEOF local_main_at_Main_internal_15 lw $t0, -64($fp) + # Load pointer to type lw $t1, 4($t0) sw $t1, -56($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # lw $t0, data_3 sw $t0, -68($fp) + # ARG local_main_at_Main_internal_16 + # LOCAL local_main_at_Main_internal_16 --> -68($fp) lw $t0, -68($fp) + # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 out_string + # Save current self pointer in $a1 move $a1, $a0 + # Save new self pointer in $a0 lw $a0, -56($fp) + # Get pointer to type lw $t0, -56($fp) + # Get pointer to type's VTABLE lw $t1, 0($t0) + # Get pointer to function address lw $t2, 0($t1) + # Call function. Result is on $v0 jalr $t2 sw $v0, -60($fp) + # Restore self pointer after function call move $a0, $a1 + # RETURN local_main_at_Main_internal_14 lw $v0, -60($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra lw $ra, 4($sp) + # Restore $fp lw $fp, 0($sp) + # Restore Stack pointer $sp addu $sp, $sp, 76 jr $ra + # Function END .text +# function_fib_at_Main implementation. +# @Params: +# 0($fp) = param_fib_at_Main_i_0 function_fib_at_Main: + # Allocate stack frame for function function_fib_at_Main. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # local_fib_at_Main_a_0 = 1 li $t0, 1 sw $t0, -4($fp) + # LOCAL local_fib_at_Main_b_1 --> -8($fp) + # local_fib_at_Main_b_1 = 0 li $t0, 0 sw $t0, -8($fp) + # LOCAL local_fib_at_Main_c_2 --> -12($fp) + # local_fib_at_Main_c_2 = 0 li $t0, 0 sw $t0, -12($fp) label_WHILE_1: + # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # local_fib_at_Main_internal_3 = PARAM param_fib_at_Main_i_0 - 0 lw $t0, 0($fp) sub $t0, $t0, 0 sw $t0, -16($fp) + # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 + # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 lw $t0, -16($fp) beq $t0, 0, label_TRUE_3 + # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # local_fib_at_Main_internal_3 = 0 li $t0, 0 sw $t0, -16($fp) + # GOTO label_END_4 j label_END_4 label_TRUE_3: + # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # local_fib_at_Main_internal_3 = 1 li $t0, 1 sw $t0, -16($fp) label_END_4: + # NOT local_fib_at_Main_internal_3 + # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # Load value in register lw $t0, -16($fp) + # a nor 0 = not (a or 0) = not a nor $t0, $t0, $zero + # Store negated value sw $t0, -16($fp) + # IF_ZERO local_fib_at_Main_internal_3 GOTO label_WHILE_END_2 + # IF_ZERO local_fib_at_Main_internal_3 GOTO label_WHILE_END_2 lw $t0, -16($fp) beq $t0, 0, label_WHILE_END_2 + # = + # = + # = + # = + # GOTO label_WHILE_1 j label_WHILE_1 label_WHILE_END_2: + # RETURN local_fib_at_Main_a_0 lw $v0, -4($fp) + # Deallocate stack frame for function function_fib_at_Main. + # Restore $ra lw $ra, 4($sp) + # Restore $fp lw $fp, 0($sp) + # Restore Stack pointer $sp addu $sp, $sp, 32 + # Deallocate function args addu $sp, $sp, 4 - jr $ra \ No newline at end of file + jr $ra + # Function END + + diff --git a/src/testing.py b/src/testing.py index e48f31a6..6ac78a3e 100755 --- a/src/testing.py +++ b/src/testing.py @@ -88,7 +88,6 @@ class Main inherits IO { c; } }; - }; """ diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 14b2a2b0..7a1ed8b0 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -5,8 +5,8 @@ DotTextDirective, locate_attribute_in_type_hierarchy) import cil.nodes as cil -from mips.instruction import (FixedData, Label, MOVE, REG_TO_STR, a0, s0, sp, - ra, v0, a1, zero) +from mips.instruction import (FixedData, Label, MOVE, REG_TO_STR, SYSCALL, a0, + s0, sp, ra, v0, a1, zero, s1) import mips.branch as branchNodes from functools import singledispatchmethod @@ -273,8 +273,8 @@ def _(self, node: cil.GetAttributeNode): # Cargar el atributo en un registro temporal para # luego moverlo hacia dest. El objeto self siempre - # esta en el registro a0 - self.register_instruction(LW(reg, f"{offset}($a0)")) + # esta en el registro s1 + self.register_instruction(LW(reg, f"{offset}($s1)")) self.register_instruction(SW(reg, dest)) @@ -297,7 +297,7 @@ def _(self, node: cil.SetAttributeNode): # y luego moverlo a la direccion de memoria del # atributo self.register_instruction(LW(reg, source)) - self.register_instruction(SW(reg, f"{offset}($a0)")) + self.register_instruction(SW(reg, f"{offset}($s1)")) self.used_registers[reg] = False @@ -469,11 +469,11 @@ def _(self, node: cil.DynamicCallNode): # Salvar el puntero a self en a1 self.comment("Save current self pointer in $a1") - self.register_instruction(MOVE(a1, a0)) + self.register_instruction(MOVE(a1, s1)) - # Actualizar el puntero a self en a0 - self.comment("Save new self pointer in $a0") - self.register_instruction(LW(a0, type_src)) + # Actualizar el puntero a self en s1 + self.comment("Save new self pointer in $s1") + self.register_instruction(LW(s1, type_src)) # Cargar el puuntero al tipo en el primer registro self.comment("Get pointer to type") @@ -496,7 +496,7 @@ def _(self, node: cil.DynamicCallNode): # Restaurar el valor antiguo del puntero a self self.comment("Restore self pointer after function call") - self.register_instruction(MOVE(a0, a1)) + self.register_instruction(MOVE(s1, a1)) self.used_registers[reg1] = False self.used_registers[reg2] = False @@ -585,9 +585,48 @@ def _(self, node: cil.ToStrNode): def _(self, node: cil.ReadNode): pass + @visit.register + def _(self, node: cil.PrintIntNode): + # El valor a imprimir se encuentra en la direccion + # de memoria src + self.add_source_line_comment(node) + src = self.visit(node.src) + assert src is not None + + # En mips, syscall 1 se usa para imprimir el entero + # almacenado en $a0 + # Cargar el entero en $a0 + self.register_instruction(LW(a0, src)) + # $v0 = 1; syscall 1 + self.register_instruction(LI(v0, 1)) + self.register_instruction(SYSCALL()) + + @visit.register + def _(self, node: cil.ReadIntNode): + dest = self.visit(node.dest) + assert dest is not None + + self.add_source_line_comment(node) + + # Cargar syscall read_int en $v0 + self.register_instruction(LI(v0, 5)) + self.register_instruction(SYSCALL()) + + # Almacenar el numero leido en dest + self.register_instruction(SW(v0, dest)) + @visit.register def _(self, node: cil.PrintNode): - pass + src = self.visit(node.src) + assert src is not None + + self.add_source_line_comment(node) + + # Cargar la direccion del string en a0 + self.register_instruction(LW(a0, src)) + # syscall 4 = print_string + self.register_instruction(LI(v0, 4)) + self.register_instruction(SYSCALL()) @visit.register def _(self, node: cil.TdtLookupNode): @@ -602,9 +641,9 @@ def _(self, node: int): def _(self, node: cil.SelfNode): dest = self.visit(node.dest) assert dest is not None - # El puntero a self siempre se guarda en el registro $a0 + # El puntero a self siempre se guarda en el registro $s1 self.add_source_line_comment(node) - self.register_instruction(SW(a0, dest)) + self.register_instruction(SW(s1, dest)) class MipsCodeGenerator(CilToMipsVisitor): diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index f8da475b..3fa61a27 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -1,29 +1,24 @@ import re from cloudpickle.cloudpickle import instance -from abstract.tree import AssignNode, SelfNode +from abstract.tree import SelfNode import cil.baseCilVisitor as baseCilVisitor import abstract.tree as coolAst import abstract.semantics as semantics -import cil.nodes as cil -from typing import List, Optional, Tuple +from typing import List, Optional, Tuple, no_type_check from functools import singledispatchmethod -from cil.nodes import CilNode, ConcatNode, LengthNode, LocalNode, ParamNode, PrintNode, ReadNode, ReturnNode, SubstringNode +import cil.nodes -BUILT_IN_METHODS = { - 'concat': ConcatNode, - 'length': LengthNode, - 'substr': SubstringNode, - 'out_string': PrintNode, - 'out_int': PrintNode, - 'in_string': ReadNode, - 'in_int': ReadNode -} +from cil.nodes import ( + AllocateNode, ArgNode, AssignNode, CilNode, CilProgramNode, ConcatNode, + DataNode, DivNode, DynamicCallNode, FunctionNode, GetAttributeNode, + GetTypeIndex, IfZeroJump, InstructionNode, JumpIfGreaterThanZeroNode, + LabelNode, LengthNode, LoadNode, LocalNode, MinusNode, NotNode, + NotZeroJump, ParamNode, PlusNode, PrintIntNode, PrintNode, ReadIntNode, + ReadNode, ReturnNode, SetAttributeNode, StarNode, StaticCallNode, + SubstringNode, TdtLookupNode, TypeNode, TypeOfNode, UnconditionalJump) -BUILTINS = ('concat', 'length', 'substr', 'out_string', 'out_int', 'in_string', - 'in_int') - -ExpressionReturn = Tuple[List[cil.InstructionNode], List[cil.LocalNode]] +ExpressionReturn = Tuple[List[InstructionNode], List[LocalNode]] Scope = semantics.Scope @@ -36,7 +31,7 @@ def visit(self, node, scope: Scope) -> CilNode: @visit.register def _(self, node: coolAst.ProgramNode, - scope: Scope) -> cil.CilProgramNode: # noqa: F811 + scope: Scope) -> CilProgramNode: # noqa: F811 # Definir el punto de entrada del programa. self.current_function = self.register_function("entry") @@ -47,19 +42,19 @@ def _(self, node: coolAst.ProgramNode, # Reservar memoria para el objeto Main main_type = self.context.get_type('Main') - self.register_instruction(cil.AllocateNode(main_type, instance)) - self.register_instruction(cil.ArgNode(instance)) + self.register_instruction(AllocateNode(main_type, instance)) + self.register_instruction(ArgNode(instance)) # Llamar al metodo main self.register_instruction( - cil.StaticCallNode(self.to_function_name('main', 'Main'), result)) - self.register_instruction(cil.ReturnNode(0)) + StaticCallNode(self.to_function_name('main', 'Main'), result)) + self.register_instruction(ReturnNode(0)) self.current_function = None for klass, child_scope in zip(node.class_list, scope.children): self.visit(klass, child_scope) - return cil.CilProgramNode(self.dot_types, self.dot_data, self.dot_code) + return CilProgramNode(self.dot_types, self.dot_data, self.dot_code) # *************** IMPLEMENTACION DE LAS DEFINICIONES DE CLASES ***************** @@ -101,6 +96,10 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 new_type_node.methods.append( (method, self.to_function_name(method, node.idx))) + print(self.current_type) + print(new_type_node.attributes) + print(new_type_node.methods) + # Visitar los atributos definidos en la clase para generar sus funciones # de inicializacion for feature in node.features: @@ -162,9 +161,9 @@ def _(self, node: coolAst.MethodDef, scope: Scope) -> None: # noqa: F811 # Registrar las instrucciones que conforman el cuerpo del metodo. last = self.visit(node.statements, scope) if last is not None: - self.register_instruction(cil.ReturnNode(last)) + self.register_instruction(ReturnNode(last)) else: - self.register_instruction(cil.ReturnNode()) + self.register_instruction(ReturnNode()) self.current_method = None self.current_function = None @@ -187,18 +186,18 @@ def _(self, node: coolAst.IfThenElseNode, # Chequear y saltar si es necesario. assert isinstance(internal_cond_vm_holder, LocalNode) self.register_instruction( - cil.IfZeroJump(internal_cond_vm_holder, false_label)) + IfZeroJump(internal_cond_vm_holder, false_label)) # Salvar las instrucciones relacionadas con la rama TRUE. self.visit(node.expr1, scope) - self.register_instruction(cil.UnconditionalJump(end_label)) + self.register_instruction(UnconditionalJump(end_label)) # Registrar las instrucciones relacionadas con la rama ELSE - self.register_instruction(cil.LabelNode(false_label)) + self.register_instruction(LabelNode(false_label)) self.visit(node.expr2, scope) - self.register_instruction(cil.LabelNode(end_label)) + self.register_instruction(LabelNode(end_label)) @visit.register def _(self, node: coolAst.VariableDeclaration, @@ -216,18 +215,18 @@ def _(self, node: coolAst.VariableDeclaration, # Si la variable es int, string o boolean, su valor por defecto es 0 if var_info.type.name not in ("String", "Int", "Bool"): self.register_instruction( - cil.AllocateNode(var_info.type, local_var)) + AllocateNode(var_info.type, local_var)) else: # Si la variable tiene una expresion de inicializacion # entonces no es necesario ponerle valor por defecto if var_init_expr is None: - self.register_instruction(cil.AssignNode(local_var, 0)) + self.register_instruction(AssignNode(local_var, 0)) if var_init_expr is not None: expr_init_vm_holder = self.visit(var_init_expr, scope) # Assignar el valor correspondiente a la variable reservada self.register_instruction( - cil.AssignNode(local_var, expr_init_vm_holder)) + AssignNode(local_var, expr_init_vm_holder)) # Process the associated expr, if any, to the let declaration # A block defines a new scope, so it is important to manage it @@ -247,7 +246,7 @@ def _(self, node: coolAst.VariableCall, scope: Scope): # noqa: F811 local = self.define_internal_local() assert self.current_type is not None self.register_instruction( - cil.GetAttributeNode(self.current_type, vinfo.name, local)) + GetAttributeNode(self.current_type, vinfo.name, local)) return local if vinfo.location == "LOCAL": for local_node in self.localvars: @@ -259,7 +258,7 @@ def _(self, node: coolAst.InstantiateClassNode, scope: Scope) -> LocalNode: # Reservar una variable que guarde la nueva instancia type_ = self.context.get_type(node.type_) instance_vm_holder = self.define_internal_local() - self.register_instruction(cil.AllocateNode(type_, instance_vm_holder)) + self.register_instruction(AllocateNode(type_, instance_vm_holder)) return instance_vm_holder @visit.register @@ -284,16 +283,15 @@ def _(self, node: coolAst.AssignNode, scope: Scope): # Es necesario diferenciar entre variable y atributo. # Las variables se diferencian en si son locales al # metodo que estamos creando o si son atributos. - if isinstance(rvalue_vm_holder, ParamNode) or scope.is_local(node.idx): + if isinstance(rvalue_vm_holder, ParamNode) or scope.is_local(node.idx): # registrar la instruccion de asignacion - self.register_instruction( - cil.AssignNode(node.idx, rvalue_vm_holder)) + self.register_instruction(AssignNode(node.idx, rvalue_vm_holder)) else: assert self.current_type is not None assert isinstance(rvalue_vm_holder, LocalNode) self.register_instruction( - cil.SetAttributeNode(self.current_type, node.idx, - rvalue_vm_holder)) + SetAttributeNode(self.current_type, node.idx, + rvalue_vm_holder)) @visit.register def _(self, node: coolAst.WhileBlockNode, scope: Scope): @@ -301,21 +299,21 @@ def _(self, node: coolAst.WhileBlockNode, scope: Scope): # retornar while_label = self.do_label('WHILE') end_label = self.do_label('WHILE_END') - self.register_instruction(cil.LabelNode(while_label)) + self.register_instruction(LabelNode(while_label)) cond_vm_holder = self.visit(node.cond, scope) # Probar la condicion, si es true continuar la ejecucion, sino saltar al LABEL end assert isinstance(cond_vm_holder, LocalNode), cond_vm_holder.__class__.__name__ - self.register_instruction(cil.IfZeroJump(cond_vm_holder, end_label)) + self.register_instruction(IfZeroJump(cond_vm_holder, end_label)) # Registrar las instrucciones del cuerpo del while self.visit(node.statements, scope) # Realizar un salto incondicional al chequeo de la condicion - self.register_instruction(cil.UnconditionalJump(while_label)) + self.register_instruction(UnconditionalJump(while_label)) # Registrar el LABEL final - self.register_instruction(cil.LabelNode(end_label)) + self.register_instruction(LabelNode(end_label)) @visit.register def _(self, node: coolAst.CaseNode, scope: Scope): @@ -328,43 +326,41 @@ def _(self, node: coolAst.CaseNode, scope: Scope): assert isinstance(expr_vm_holder, LocalNode) self.register_instruction( - cil.TypeOfNode(expr_vm_holder, type_internal_local_holder)) + TypeOfNode(expr_vm_holder, type_internal_local_holder)) # Variables internas para almacenar resultados intermedios min_ = self.define_internal_local() tdt_result = self.define_internal_local() min_check_local = self.define_internal_local() - self.register_instruction(cil.AssignNode(min_, - len(self.context.types))) + self.register_instruction(AssignNode(min_, len(self.context.types))) for i, action_node in enumerate(node.actions): # Calcular la distancia hacia el tipo, y actualizar el minimo de ser necesario self.register_instruction( - cil.TdtLookupNode(action_node.typex, - type_internal_local_holder, tdt_result)) + TdtLookupNode(action_node.typex, type_internal_local_holder, + tdt_result)) # Comparar el resultado obtenido con el minimo actual. self.register_instruction( - cil.MinusNode(min_, tdt_result, min_check_local)) + MinusNode(min_, tdt_result, min_check_local)) not_min_label = self.do_label('Not_min{i}') self.register_instruction( - cil.JumpIfGreaterThanZeroNode(min_check_local, not_min_label)) + JumpIfGreaterThanZeroNode(min_check_local, not_min_label)) # Si mejora el minimo, entonces actualizarlo. - self.register_instruction(cil.AssignNode(min_, tdt_result)) - self.register_instruction(cil.LabelNode(not_min_label)) + self.register_instruction(AssignNode(min_, tdt_result)) + self.register_instruction(LabelNode(not_min_label)) # Ya tenemos la menor distancia entre el tipo calculado en la expr0, y todos los tipos definidos # en los branches del case. # Comprobar que tengamos una coincidencia self.register_instruction( - cil.AssignNode(tdt_result, len(self.context.types))) + AssignNode(tdt_result, len(self.context.types))) self.register_instruction( - cil.MinusNode(tdt_result, min_, sub_vm_local_holder)) + MinusNode(tdt_result, min_, sub_vm_local_holder)) error_label = self.do_label("ERROR") - self.register_instruction( - cil.IfZeroJump(sub_vm_local_holder, error_label)) + self.register_instruction(IfZeroJump(sub_vm_local_holder, error_label)) end_label = self.do_label('END') @@ -372,29 +368,28 @@ def _(self, node: coolAst.CaseNode, scope: Scope): for i, action_node in enumerate(node.actions): next_label = self.do_label(f'NEXT{i}') self.register_instruction( - cil.TdtLookupNode(action_node.typex, - type_internal_local_holder, tdt_result)) + TdtLookupNode(action_node.typex, type_internal_local_holder, + tdt_result)) self.register_instruction( - cil.MinusNode(min_, tdt_result, min_check_local)) - self.register_instruction( - cil.NotZeroJump(min_check_local, next_label)) + MinusNode(min_, tdt_result, min_check_local)) + self.register_instruction(NotZeroJump(min_check_local, next_label)) # Implemententacion del branch. # Registrar la variable var_info = scope.find_variable(action_node.idx) assert var_info is not None idk = self.register_local(var_info) # Asignar al identificador idk el valor de expr0 - self.register_instruction(cil.AssignNode(idk, expr_vm_holder)) + self.register_instruction(AssignNode(idk, expr_vm_holder)) # Generar el codigo de la expresion asociada a esta rama self.visit(action_node.actions, scope) # Generar un salto de modo que no se chequee otra rama - self.register_instruction(cil.UnconditionalJump(end_label)) - self.register_instruction(cil.LabelNode(next_label)) + self.register_instruction(UnconditionalJump(end_label)) + self.register_instruction(LabelNode(next_label)) - self.register_instruction(cil.LabelNode(error_label)) + self.register_instruction(LabelNode(error_label)) # TODO: Define some form of runtime errors - self.register_instruction(cil.LabelNode(end_label)) + self.register_instruction(LabelNode(end_label)) # *************** IMPLEMENTACION DE LAS EXPRESIONES ARITMETICAS # @@ -413,7 +408,7 @@ def _(self, node: coolAst.PlusNode, scope: Scope) -> LocalNode: # registrar la instruccion de suma self.register_instruction( - cil.PlusNode(sum_internal_local, left_vm_holder, right_vm_holder)) + PlusNode(sum_internal_local, left_vm_holder, right_vm_holder)) # Devolver la variable interna que contiene la suma return sum_internal_local @@ -433,8 +428,8 @@ def _(self, node: coolAst.DifNode, scope: Scope) -> LocalNode: assert isinstance(left_vm_holder, LocalNode) and isinstance( right_vm_holder, LocalNode) self.register_instruction( - cil.MinusNode(left_vm_holder, right_vm_holder, - minus_internal_vm_holder)) + MinusNode(left_vm_holder, right_vm_holder, + minus_internal_vm_holder)) # Devolver la variable que contiene el resultado return minus_internal_vm_holder @@ -455,8 +450,7 @@ def _(self, node: coolAst.MulNode, scope: Scope) -> LocalNode: # Registrar la instruccion de multimplicacion self.register_instruction( - cil.StarNode(left_vm_holder, right_vm_holder, - mul_internal_vm_holder)) + StarNode(left_vm_holder, right_vm_holder, mul_internal_vm_holder)) # Retornar el resultado return mul_internal_vm_holder @@ -474,8 +468,7 @@ def _(self, node: coolAst.DivNode, scope: Scope) -> LocalNode: # Registrar la instruccion de division self.register_instruction( - cil.DivNode(div_internal_vm_holder, left_vm_holder, - right_vm_holder)) + DivNode(div_internal_vm_holder, left_vm_holder, right_vm_holder)) # Devolver el resultado return div_internal_vm_holder @@ -498,7 +491,7 @@ def _(self, node: coolAst.StringConstant, scope: Scope) -> LocalNode: s1 = self.register_data(node.lex) # Cargar el string en la variable interna - self.register_instruction(cil.LoadNode(str_const_vm_holder, s1)) + self.register_instruction(LoadNode(str_const_vm_holder, s1)) # Devolver la variable que contiene el string return str_const_vm_holder @@ -525,11 +518,11 @@ def _(self, node: coolAst.NegNode, scope: Scope): if isinstance(expr_result, int): self.register_instruction( - cil.AssignNode(result_vm_holder, abs(expr_result - 1))) + AssignNode(result_vm_holder, abs(expr_result - 1))) return result_vm_holder else: assert isinstance(expr_result, LocalNode) - self.register_instruction(cil.NotNode(expr_result)) + self.register_instruction(NotNode(expr_result)) return expr_result @visit.register @@ -545,26 +538,29 @@ def _(self, node: coolAst.EqualToNode, scope: Scope) -> LocalNode: right_vm_holder = self.visit(node.right, scope) # Realizar una resta y devolver el resultado - assert (isinstance(left_vm_holder, LocalNode) or isinstance(left_vm_holder, int) or isinstance(left_vm_holder, ParamNode)) and (isinstance( - right_vm_holder, LocalNode) or isinstance(right_vm_holder, int) or isinstance(right_vm_holder, ParamNode)) + assert (isinstance(left_vm_holder, LocalNode) + or isinstance(left_vm_holder, int) + or isinstance(left_vm_holder, ParamNode)) and ( + isinstance(right_vm_holder, LocalNode) + or isinstance(right_vm_holder, int) + or isinstance(right_vm_holder, ParamNode)) self.register_instruction( - cil.MinusNode(left_vm_holder, right_vm_holder, - expr_result_vm_holder)) + MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) # Si la resta da 0, entonces son iguales y se devuelve 1, si no, se devuelve 0 - self.register_instruction( - cil.IfZeroJump(expr_result_vm_holder, true_label)) + self.register_instruction(IfZeroJump(expr_result_vm_holder, + true_label)) # si la resta no da 0, almacenar 0 y retornar - self.register_instruction(cil.AssignNode(expr_result_vm_holder, 0)) - self.register_instruction(cil.UnconditionalJump(end_label)) + self.register_instruction(AssignNode(expr_result_vm_holder, 0)) + self.register_instruction(UnconditionalJump(end_label)) # Si la resta da 0, devolver 1 - self.register_instruction(cil.LabelNode(true_label)) - self.register_instruction(cil.AssignNode(expr_result_vm_holder, 1)) + self.register_instruction(LabelNode(true_label)) + self.register_instruction(AssignNode(expr_result_vm_holder, 1)) - self.register_instruction(cil.LabelNode(end_label)) + self.register_instruction(LabelNode(end_label)) # Devolver la variable con el resultado return expr_result_vm_holder @@ -585,20 +581,19 @@ def _(self, node: coolAst.LowerThanNode, scope: Scope) -> LocalNode: assert isinstance(left_vm_holder, LocalNode) and isinstance( right_vm_holder, LocalNode) self.register_instruction( - cil.MinusNode(left_vm_holder, right_vm_holder, - expr_result_vm_holder)) + MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) self.register_instruction( - cil.JumpIfGreaterThanZeroNode(expr_result_vm_holder, false_label)) + JumpIfGreaterThanZeroNode(expr_result_vm_holder, false_label)) self.register_instruction( - cil.IfZeroJump(expr_result_vm_holder, false_label)) + IfZeroJump(expr_result_vm_holder, false_label)) - self.register_instruction(cil.AssignNode(expr_result_vm_holder, 1)) - self.register_instruction(cil.UnconditionalJump(end_label)) + self.register_instruction(AssignNode(expr_result_vm_holder, 1)) + self.register_instruction(UnconditionalJump(end_label)) - self.register_instruction(cil.LabelNode(false_label)) - self.register_instruction(cil.AssignNode(expr_result_vm_holder, 0)) - self.register_instruction(cil.LabelNode(end_label)) + self.register_instruction(LabelNode(false_label)) + self.register_instruction(AssignNode(expr_result_vm_holder, 0)) + self.register_instruction(LabelNode(end_label)) return expr_result_vm_holder @@ -618,18 +613,17 @@ def _(self, node: coolAst.LowerEqual, scope: Scope) -> LocalNode: right_vm_holder, LocalNode) self.register_instruction( - cil.MinusNode(left_vm_holder, right_vm_holder, - expr_result_vm_holder)) + MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) self.register_instruction( - cil.JumpIfGreaterThanZeroNode(expr_result_vm_holder, false_label)) + JumpIfGreaterThanZeroNode(expr_result_vm_holder, false_label)) - self.register_instruction(cil.AssignNode(expr_result_vm_holder, 1)) - self.register_instruction(cil.UnconditionalJump(end_label)) + self.register_instruction(AssignNode(expr_result_vm_holder, 1)) + self.register_instruction(UnconditionalJump(end_label)) - self.register_instruction(cil.LabelNode(false_label)) - self.register_instruction(cil.AssignNode(expr_result_vm_holder, 0)) - self.register_instruction(cil.LabelNode(end_label)) + self.register_instruction(LabelNode(false_label)) + self.register_instruction(AssignNode(expr_result_vm_holder, 0)) + self.register_instruction(LabelNode(end_label)) return expr_result_vm_holder @@ -649,20 +643,19 @@ def _(self, node: coolAst.GreaterThanNode, scope: Scope) -> LocalNode: right_vm_holder, LocalNode) self.register_instruction( - cil.MinusNode(left_vm_holder, right_vm_holder, - expr_result_vm_holder)) + MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) self.register_instruction( - cil.JumpIfGreaterThanZeroNode(expr_result_vm_holder, true_label)) + JumpIfGreaterThanZeroNode(expr_result_vm_holder, true_label)) # False Branch - self.register_instruction(cil.AssignNode(expr_result_vm_holder, 0)) - self.register_instruction(cil.UnconditionalJump(end_label)) + self.register_instruction(AssignNode(expr_result_vm_holder, 0)) + self.register_instruction(UnconditionalJump(end_label)) # True Branch - self.register_instruction(cil.LabelNode(true_label)) - self.register_instruction(cil.AssignNode(expr_result_vm_holder, 1)) - self.register_instruction(cil.LabelNode(end_label)) + self.register_instruction(LabelNode(true_label)) + self.register_instruction(AssignNode(expr_result_vm_holder, 1)) + self.register_instruction(LabelNode(end_label)) return expr_result_vm_holder @@ -682,22 +675,21 @@ def _(self, node: coolAst.GreaterEqualNode, scope: Scope) -> LocalNode: right_vm_holder, LocalNode) self.register_instruction( - cil.MinusNode(left_vm_holder, right_vm_holder, - expr_result_vm_holder)) + MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) self.register_instruction( - cil.JumpIfGreaterThanZeroNode(expr_result_vm_holder, true_label)) - self.register_instruction( - cil.IfZeroJump(expr_result_vm_holder, true_label)) + JumpIfGreaterThanZeroNode(expr_result_vm_holder, true_label)) + self.register_instruction(IfZeroJump(expr_result_vm_holder, + true_label)) # False Branch - self.register_instruction(cil.AssignNode(expr_result_vm_holder, 1)) - self.register_instruction(cil.UnconditionalJump(end_label)) + self.register_instruction(AssignNode(expr_result_vm_holder, 1)) + self.register_instruction(UnconditionalJump(end_label)) # True Branch - self.register_instruction(cil.LabelNode(true_label)) - self.register_instruction(cil.AssignNode(expr_result_vm_holder, 1)) - self.register_instruction(cil.LabelNode(end_label)) + self.register_instruction(LabelNode(true_label)) + self.register_instruction(AssignNode(expr_result_vm_holder, 1)) + self.register_instruction(LabelNode(end_label)) return expr_result_vm_holder @@ -713,15 +705,15 @@ def _(self, node: coolAst.FunCall, scope: Scope) -> LocalNode: expr = self.visit(node.obj, scope) assert isinstance(expr, LocalNode) or isinstance(expr, ParamNode) - self.register_instruction(cil.TypeOfNode(expr, type_vm_holder)) + self.register_instruction(TypeOfNode(expr, type_vm_holder)) # Evaluar los argumentos for arg in node.args: arg_expr = self.visit(arg, scope) - self.register_instruction(cil.ArgNode(arg_expr)) + self.register_instruction(ArgNode(arg_expr)) self.register_instruction( - cil.DynamicCallNode(type_vm_holder, node.id, return_vm_holder)) + DynamicCallNode(type_vm_holder, node.id, return_vm_holder)) return return_vm_holder @@ -733,22 +725,22 @@ def _(self, node: coolAst.ParentFuncCall, scope: Scope) -> LocalNode: # Evaluar los argumentos for arg in node.arg_list: arg_expr = self.visit(arg, scope) - self.register_instruction(cil.ArgNode(arg_expr)) + self.register_instruction(ArgNode(arg_expr)) # Asignar el tipo a una variable type_ = self.context.get_type(node.parent_type) - self.register_instruction(cil.AssignNode(local_type_identifier, type_)) + self.register_instruction(AssignNode(local_type_identifier, type_)) self.register_instruction( - cil.DynamicCallNode(local_type_identifier, node.idx, - return_expr_vm_holder)) + DynamicCallNode(local_type_identifier, node.idx, + return_expr_vm_holder)) return return_expr_vm_holder @visit.register def _(self, node: SelfNode, scope: Scope) -> LocalNode: return_expr_vm_holder = self.define_internal_local() - self.register_instruction(cil.SelfNode(return_expr_vm_holder)) + self.register_instruction(cil.nodes.SelfNode(return_expr_vm_holder)) return return_expr_vm_holder @@ -758,7 +750,7 @@ def visit(self, node) -> str: return "" @visit.register - def _(self, node: cil.CilProgramNode): + def _(self, node: CilProgramNode): # Primero imprimir la seccion .TYPES dottypes = '\n'.join(self.visit(type_) for type_ in node.dottypes) @@ -771,14 +763,14 @@ def _(self, node: cil.CilProgramNode): return f'.TYPES\n{dottypes}\n\n.DATA\n{dotdata}\n\n.CODE\n{dotcode}' @visit.register - def _(self, node: cil.TypeNode): + def _(self, node: TypeNode): attributes = '\n\t'.join(f'{x}' for x in node.attributes) methods = '\n\t'.join(f'method {x}: {y}' for x, y in node.methods) return f'type {node.name} {{\n\t{attributes}\n\n\t{methods}\n}}' @visit.register - def _(self, node: cil.FunctionNode): + def _(self, node: FunctionNode): params = '\n\t'.join(self.visit(x) for x in node.params) localvars = '\n\t'.join(self.visit(x) for x in node.localvars) instructions = '\n\t'.join(self.visit(x) for x in node.instructions) @@ -786,58 +778,58 @@ def _(self, node: cil.FunctionNode): return f'{node.name} {{\n\t{params}\n\n\t{localvars}\n\n\t{instructions}\n}}' @visit.register - def _(self, node: cil.ParamNode) -> str: + def _(self, node: ParamNode) -> str: return f'PARAM {node.name}' @visit.register - def _(self, node: cil.LocalNode) -> str: + def _(self, node: LocalNode) -> str: return f'{node.name}' @visit.register - def _(self, node: cil.AssignNode) -> str: + def _(self, node: AssignNode) -> str: return f'{self.visit(node.dest)} = {self.visit(node.source)}' @visit.register - def _(self, node: cil.PlusNode) -> str: + def _(self, node: PlusNode) -> str: return f'{self.visit(node.dest)} = {self.visit(node.left)} + {self.visit(node.right)}' @visit.register - def _(self, node: cil.MinusNode) -> str: + def _(self, node: MinusNode) -> str: return f'{self.visit(node.dest)} = {self.visit(node.x)} - {self.visit(node.y)}' @visit.register - def _(self, node: cil.StarNode) -> str: + def _(self, node: StarNode) -> str: return f'{self.visit(node.dest)} = {self.visit(node.x)} * {self.visit(node.y)}' @visit.register - def _(self, node: cil.DivNode) -> str: + def _(self, node: DivNode) -> str: return f'{self.visit(node.dest)} = {self.visit(node.left)} / {self.visit(node.right)}' @visit.register - def _(self, node: cil.AllocateNode) -> str: + def _(self, node: AllocateNode) -> str: return f'{self.visit(node.dest)} = ALLOCATE {node.itype.name}' @visit.register - def _(self, node: cil.TypeOfNode) -> str: + def _(self, node: TypeOfNode) -> str: return f'{self.visit(node.dest)} = TYPEOF {node.variable.name}' @visit.register - def _(self, node: cil.DynamicCallNode) -> str: + def _(self, node: DynamicCallNode) -> str: return f'{self.visit(node.dest)} = VCALL {node.xtype.name} {node.method}' @visit.register - def _(self, node: cil.StaticCallNode) -> str: + def _(self, node: StaticCallNode) -> str: return f'{self.visit(node.dest)} = CALL {node.function}' @visit.register - def _(self, node: cil.ArgNode) -> str: + def _(self, node: ArgNode) -> str: if isinstance(node.name, int): return f'ARG {self.visit(node.name)}' else: return f'ARG {node.name.name}' @visit.register - def _(self, node: cil.ReturnNode) -> str: + def _(self, node: ReturnNode) -> str: if isinstance(node.value, int): return f'RETURN {node.value}' elif isinstance(node.value, LocalNode): @@ -845,7 +837,7 @@ def _(self, node: cil.ReturnNode) -> str: return "RETURN" @visit.register - def _(self, node: cil.DataNode) -> str: + def _(self, node: DataNode) -> str: if isinstance(node.value, str): return f'{node.name} = "{node.value}" ;' elif isinstance(node.value, list): @@ -854,27 +846,27 @@ def _(self, node: cil.DataNode) -> str: return f'{node.name} = {node.value}' @visit.register - def _(self, node: cil.GetTypeIndex) -> str: + def _(self, node: GetTypeIndex) -> str: return f'{node.dest} = GETTYPEINDEX {node.itype}' @visit.register - def _(self, node: cil.TdtLookupNode) -> str: + def _(self, node: TdtLookupNode) -> str: return f'{node.dest.name} = TYPE_DISTANCE {node.i} {node.j}' @visit.register - def _(self, node: cil.IfZeroJump) -> str: + def _(self, node: IfZeroJump) -> str: return f'IF_ZERO {node.variable.name} GOTO {node.label}' @visit.register - def _(self, node: cil.UnconditionalJump) -> str: + def _(self, node: UnconditionalJump) -> str: return f'GOTO {node.label}' @visit.register - def _(self, node: cil.JumpIfGreaterThanZeroNode) -> str: + def _(self, node: JumpIfGreaterThanZeroNode) -> str: return f'IF_GREATER_ZERO {node.variable.name} GOTO {node.label}' @visit.register - def _(self, node: cil.LabelNode) -> str: + def _(self, node: LabelNode) -> str: return f'{node.label}:' @visit.register @@ -882,16 +874,32 @@ def _(self, node: int) -> str: return str(node) @visit.register - def _(self, node: cil.GetAttributeNode): + def _(self, node: GetAttributeNode): return f'{node.dest.name} = GETATTRIBUTE {node.attrname} {node.itype.name}' @visit.register - def _(self, node: cil.SelfNode): + def _(self, node: cil.nodes.SelfNode): return f'{node.dest.name} = SELF' @visit.register - def _(self, node: cil.NotNode): + def _(self, node: NotNode): return f'NOT {node.src.name}' + @visit.register + def _(self, node: PrintIntNode): + return f'PRINT_INT {node.src.name}' + + @visit.register + def _(self, node: ReadIntNode): + return f'{node.dest.name} = READ_INT' + + @visit.register + def _(self, node: ReadNode): + return f'{node.dest.name} = READ_STR' + + @visit.register + def _(self, node: PrintNode): + return f'PRINT_STR {node.src.name}' + def __call__(self, node) -> str: return self.visit(node) diff --git a/src/travels/typebuilder.py b/src/travels/typebuilder.py index 02213934..90ee8d25 100755 --- a/src/travels/typebuilder.py +++ b/src/travels/typebuilder.py @@ -1,6 +1,6 @@ from typing import List, Any, Optional import abstract.tree as coolAst -from abstract.semantics import Method, SemanticError, Type, Context +from abstract.semantics import Method, ObjectType, SemanticError, Type, Context from functools import singledispatchmethod INHERITABLES = ('Int', 'Bool', 'String', 'AUTO_TYPE') @@ -43,7 +43,7 @@ def _(self, node: coolAst.ClassDef): for attrib in parent.attributes: self.current_type.attributes.append(attrib) - self.current_type.methods.update(parent.methods) + # self.current_type.methods.update(parent.methods) for feature in node.features: self.visit(feature) diff --git a/src/travels/typecollector.py b/src/travels/typecollector.py index 8050651c..5c188791 100755 --- a/src/travels/typecollector.py +++ b/src/travels/typecollector.py @@ -121,16 +121,20 @@ def _(self, node: coolAst.ProgramNode): # noqa: F811 OBJECT, INTEGER, STRING, BOOL, VOID, SELF_TYPE = ObjectType( ), IntegerType(), StringType(), BoolType(), VoidType(), SelfType() ioType = IoType() - INTEGER.set_parent(OBJECT) - STRING.set_parent(OBJECT) - BOOL.set_parent(OBJECT) - ioType.set_parent(OBJECT) # Agregar los metodos builtin bootstrap_string(STRING) bootstrap_io(ioType) bootstrap_object(OBJECT) + INTEGER.set_parent(OBJECT) + STRING.set_parent(OBJECT) + BOOL.set_parent(OBJECT) + ioType.set_parent(OBJECT) + + # Agregar al objeto IO los metodos de OBJECT + ioType.methods.update(OBJECT.methods) + self.context.types['Object'] = OBJECT self.context.types['Int'] = INTEGER self.context.types['String'] = STRING From 82aba0aa9b0b253899c1ba4768b4500f23946b22 Mon Sep 17 00:00:00 2001 From: Alejandro Piad Date: Tue, 24 Nov 2020 09:48:30 -0500 Subject: [PATCH 106/162] Update Readme.md --- Readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index 5b1cbbce..55093d31 100644 --- a/Readme.md +++ b/Readme.md @@ -106,13 +106,13 @@ En este proyecto se realizarán entregas parciales a lo largo del curso. Para re ### 2. Asegúrese de tener la siguiente configuración antes de hacer click en **Create pull request**. - **base repository**: `matcom/cool-compiler-2020` (repositorio original) - - **branch**: `entrega-parser` + - **branch**: `entrega-final` - **head repository**: `/cool-compiler-2020` (repositorio propio) - **branch**: `master` (o la que corresponda) > Asegúrese que se indica **Able to merge**. De lo contrario, existen cambios en el repositorio original que usted no tiene, y debe actualizarlos. -> **NOTA**: Asegúrese que el _pull request_ se hace a la rama `entrega-parser`. +> **NOTA**: Asegúrese que el _pull request_ se hace a la rama `entrega-final`. ![](img/img6.png) From 2a2af0325d316de28844f9022796be7296f31853 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Wed, 25 Nov 2020 12:17:18 -0500 Subject: [PATCH 107/162] Change formatter to black --- .vscode/settings.json | 1 - src/cil/baseCilVisitor.py | 66 ++++--- src/mips/baseMipsVisitor.py | 54 +++--- src/pycoolc.py | 8 +- src/travels/ciltomips.py | 74 +++++--- src/travels/ctcill.py | 320 ++++++++++++++++++------------- src/travels/inference.py | 352 +++++++++++++++++------------------ src/travels/typecollector.py | 89 +++++---- 8 files changed, 536 insertions(+), 428 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 5d53261d..d15d2da2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,5 +9,4 @@ "python.testing.unittestEnabled": false, "python.testing.nosetestsEnabled": false, "python.testing.pytestEnabled": true, - "python.formatting.provider": "yapf" } \ No newline at end of file diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index b6d65588..23e19d0a 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -1,7 +1,16 @@ from typing import List, Optional, Any, Dict, Tuple import cil.nodes as nodes from abstract.semantics import VariableInfo, Context, Type, Method -from cil.nodes import CopyNode, PrintIntNode, PrintNode, ReadIntNode, ReadNode, ReturnNode, SelfNode, TypeNode +from cil.nodes import ( + CopyNode, + PrintIntNode, + PrintNode, + ReadIntNode, + ReadNode, + ReturnNode, + SelfNode, + TypeNode, +) TDT = Dict[Tuple[str, str], int] @@ -43,8 +52,12 @@ def __ancestor(self, node_x: str, node_y: str) -> bool: # Para realizar este calculo nos basamos en el arbol # construido por el DFS, y tenemos en cuenta los tiempos # de descubrimiento y finalizacion - return self._discover[node_x] < self._discover[ - node_y] < self._finalization[node_y] < self._finalization[node_x] + return ( + self._discover[node_x] + < self._discover[node_y] + < self._finalization[node_y] + < self._finalization[node_x] + ) def __distance_from(self, node_x: str, node_y: str) -> int: # Si x es ancestro de y, entonces la distancia entre ellos @@ -75,7 +88,7 @@ def build_tdt(self): visited = {node: False for node in self._adytable} # Realizar un recorrido dfs para inicializar los array d y f - root = 'Object' + root = "Object" self.__dfs(root, visited) # Construir la tabla @@ -84,14 +97,14 @@ def build_tdt(self): if nodey == nodex: self.tdt[(nodex, nodey)] = 0 else: - self.tdt[(nodex, - nodey)] = self.__distance_from(nodex, nodey) + self.tdt[(nodex, nodey)] = self.__distance_from(nodex, nodey) class BaseCoolToCilVisitor: """ Clase base para el visitor que transforma un AST de COOL en un AST de CIL. """ + def __init__(self, context: Context): self.dot_types: List[nodes.TypeNode] = [] self.dot_data: List[Any] = [] @@ -126,27 +139,30 @@ def instructions(self) -> List[nodes.InstructionNode]: def register_params(self, vinfo: VariableInfo) -> nodes.ParamNode: # Registra un parametro en la funcion en construccion y devuelve el nombre procesado del parametro assert self.current_function is not None - name = f'param_{self.current_function.name[9:]}_{vinfo.name}_{len(self.params)}' + name = f"param_{self.current_function.name[9:]}_{vinfo.name}_{len(self.params)}" param_node: nodes.ParamNode = nodes.ParamNode(name) self.params.append(param_node) return param_node def register_local(self, vinfo: VariableInfo) -> nodes.LocalNode: assert self.current_function is not None - name = f'local_{self.current_function.name[9:]}_{vinfo.name}_{len(self.localvars)}' + name = ( + f"local_{self.current_function.name[9:]}_{vinfo.name}_{len(self.localvars)}" + ) local_node = nodes.LocalNode(name) self.localvars.append(local_node) return local_node def define_internal_local(self) -> nodes.LocalNode: - vinfo = VariableInfo('internal') + vinfo = VariableInfo("internal") return self.register_local(vinfo) def to_function_name(self, method_name: str, type_name: str) -> str: return f"function_{method_name}_at_{type_name}" def register_instruction( - self, instruction: nodes.InstructionNode) -> nodes.InstructionNode: + self, instruction: nodes.InstructionNode + ) -> nodes.InstructionNode: self.instructions.append(instruction) return instruction @@ -161,7 +177,7 @@ def register_type(self, name: str) -> nodes.TypeNode: return type_node def register_data(self, value: Any) -> nodes.DataNode: - vname = f'data_{len(self.dot_data)}' + vname = f"data_{len(self.dot_data)}" data_node = nodes.DataNode(vname, value) self.dot_data.append(data_node) return data_node @@ -183,8 +199,9 @@ def __build_CART(self) -> None: graph = InheritanceGraph() for itype in self.context.types: if self.context.types[itype].parent is not None: - graph.add_edge(self.context.types[itype].parent.name, - itype) # type: ignore + graph.add_edge( + self.context.types[itype].parent.name, itype + ) # type: ignore # Crear la TDT graph.build_tdt() @@ -195,10 +212,10 @@ def __build_CART(self) -> None: def __implement_out_string(self): # Registrar el parametro que espera la funcion - self.current_function = self.register_function( - 'function_out_string_at_IO') + self.current_function = self.register_function("function_out_string_at_IO") param = self.register_params( - VariableInfo('x', self.context.get_type('String'), 'PARAM')) + VariableInfo("x", self.context.get_type("String"), "PARAM") + ) # Esta funcion espera que se llame con un argumento que apunta # a la direccion de memoria de un string, luego solo realiza # los procedimientos necesarios para imprimir en consola @@ -211,10 +228,10 @@ def __implement_out_string(self): def __implement_out_int(self): # Registrar el parametro que espera la funcion y la # funcion como tal - self.current_function = self.register_function( - 'function_out_int_at_IO') + self.current_function = self.register_function("function_out_int_at_IO") param = self.register_params( - VariableInfo('x', self.context.get_type('Int'), 'PARAM')) + VariableInfo("x", self.context.get_type("Int"), "PARAM") + ) # Espera como unico parametro un entero. self.register_instruction(PrintIntNode(param)) @@ -223,8 +240,7 @@ def __implement_out_int(self): def __implement_in_string(self): # Registrar la funcion - self.current_function = self.register_function( - 'function_in_string_at_IO') + self.current_function = self.register_function("function_in_string_at_IO") # Declarar una variable para devolver el valor return_vm_holder = self.define_internal_local() # Registrar el nodo que realiza el trabajo en MIPS @@ -234,7 +250,7 @@ def __implement_in_string(self): def __implement_in_int(self): # Registrar la funcion - self.current_function = self.register_function('function_in_int_at_IO') + self.current_function = self.register_function("function_in_int_at_IO") # Declarar una variable para devolver el valor return_vm_holder = self.define_internal_local() self.register_instruction(ReadIntNode(return_vm_holder)) @@ -244,8 +260,7 @@ def __implement_in_int(self): def __implement_abort(self): # la funcion abort no recibe ningun paramentro # Simplemente llama trap y le pasa la causa "abortion" - self.current_function = self.register_function( - 'function_abort_at_Object') + self.current_function = self.register_function("function_abort_at_Object") # TODO: Implementarlo self.current_function = None pass @@ -255,8 +270,7 @@ def __implement_copy(self): # para obtener una copia superficial de la misma, # o sea, que se copia el propio objeto, pero no # recursivamente algun objeto que este pueda contener - self.current_function = self.register_function( - 'function_copy_at_Object') + self.current_function = self.register_function("function_copy_at_Object") # Obtener una referencia al objeto que queremos clonar self_vm_holder = self.define_internal_local() clone_vm_holder = self.define_internal_local() diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 2dd2e695..02618afd 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -27,18 +27,18 @@ def __str__(self): class DotDataDirective(AbstractDirective): def __str__(self): - return '.data' if self.addr is None else f'.data {self.addr}' + return ".data" if self.addr is None else f".data {self.addr}" class DotTextDirective(AbstractDirective): def __str__(self): - return '.text' if self.addr is None else f'.text {self.addr}' + return ".text" if self.addr is None else f".text {self.addr}" class DotGlobalDirective(AbstractDirective): def __str__(self): assert self.addr is not None - return f'.global {self.addr}' + return f".global {self.addr}" class BaseCilToMipsVisitor: @@ -71,7 +71,8 @@ class BaseCilToMipsVisitor: .globl sym Declara el label sym como global. - """ + """ + def __init__(self): # Un programa de MIPS es una lista de Instrucciones de MIPS. self.program: List[instrNodes.MipsNode] = [] @@ -105,19 +106,18 @@ def register_instruction(self, node: instrNodes.MipsNode): # Metodos Privados def __program_header(self): date = time.asctime() - coolc = 'Code generated by PyCoolc.' - ad = 'Adrian Gonzalez' - ep = 'Eliane Puerta' - la = 'Liset Alfaro' - institution = 'School of Math and Computer Science, University of Havana' + coolc = "Code generated by PyCoolc." + ad = "Adrian Gonzalez" + ep = "Eliane Puerta" + la = "Liset Alfaro" + institution = "School of Math and Computer Science, University of Havana" self.comment(coolc) - self.comment(f'{ep}, {la}, {ad} --- {date}') + self.comment(f"{ep}, {la}, {ad} --- {date}") self.comment(institution) self.comment("\n") # Funcion de ayuda para obtener la direccion de memoria de un parametro o una variable - def get_location_address(self, node: Union[cil.ParamNode, - cil.LocalNode]) -> str: + def get_location_address(self, node: Union[cil.ParamNode, cil.LocalNode]) -> str: """ Devuelve el offset del parametro o variable local que estamos buscando, accediendo a este en el stack. Offset es positivo si se trata de un parametro, negativo en caso de una variable local. """ @@ -159,18 +159,21 @@ def add_source_line_comment(self, source: CilNode): Muestra en el archivo mips un comentario con la linea que se esta transcribiendo. """ self.register_instruction( - instrNodes.LineComment(self.__cil_display_formatter.visit(source))) + instrNodes.LineComment(self.__cil_display_formatter.visit(source)) + ) def cil_func_signature(self, func: FunctionNode): """ Genera un comentario en el archivo mips que indica la signatura de la funcion que se esta creando. """ self.register_instruction( - instrNodes.LineComment(f"{func.name} implementation.")) + instrNodes.LineComment(f"{func.name} implementation.") + ) self.register_instruction(instrNodes.LineComment("@Params:")) for i, param in enumerate(func.params): self.register_instruction( - instrNodes.LineComment(f"\t{i * 4}($fp) = {param.name}")) + instrNodes.LineComment(f"\t{i * 4}($fp) = {param.name}") + ) def operate(self, dest, left, right, operand: Type): """ @@ -211,7 +214,7 @@ def operate(self, dest, left, right, operand: Type): def create_type_array(self, types: List[TypeNode]): """ Crea en la seccion .data una secuencia de labels que referencian - los distintos tipos del programa, de modo que se puedan referenciar en + los distintos tipos del programa, de modo que se puedan referenciar en mips como mismo se referenciarian en una lista. """ self.register_instruction(DotDataDirective()) @@ -227,7 +230,8 @@ def allocate_memory(self, bytes_num: int): en $v0. """ self.register_instruction( - instrNodes.LineComment(f"Allocating {bytes_num} bytes of memory")) + instrNodes.LineComment(f"Allocating {bytes_num} bytes of memory") + ) # Cargar la cantidad de bytes en el registro $a0 self.register_instruction(load_store.LI(a0, bytes_num)) @@ -241,7 +245,7 @@ def allocate_memory(self, bytes_num: int): def conditional_jump(self, node, condition, value=0, const=True): """ - Realiza un salto condicional en dependencia de la condicion especificada + Realiza un salto condicional en dependencia de la condicion especificada en @condition y toma por valor de comparacion @value. @const indica si @value debe tomarse como una constante o como un registro. """ @@ -265,8 +269,8 @@ def allocate_stack_frame(self, node: FunctionNode): # Crear el marco de pila para la funcion locals_count = len(node.localvars) self.register_instruction( - instrNodes.LineComment( - f"Allocate stack frame for function {node.name}.")) + instrNodes.LineComment(f"Allocate stack frame for function {node.name}.") + ) # Salvar primero espacio para las variables locales if locals_count * 4 < 24: # MIPS fuerza a un minimo de 32 bytes por stack frame @@ -274,7 +278,8 @@ def allocate_stack_frame(self, node: FunctionNode): ret = 32 else: self.register_instruction( - arithNodes.SUBU(sp, sp, locals_count * 4 + 8, True)) + arithNodes.SUBU(sp, sp, locals_count * 4 + 8, True) + ) ret = locals_count * 4 + 8 # Salvar ra y fp @@ -291,8 +296,8 @@ def deallocate_stack_frame(self, node: FunctionNode): """ locals_count = len(node.localvars) self.register_instruction( - instrNodes.LineComment( - f"Deallocate stack frame for function {node.name}.")) + instrNodes.LineComment(f"Deallocate stack frame for function {node.name}.") + ) # Calcular cuantos bytes fueron reservados if locals_count * 4 < 24: # MIPS fuerza a un minimo de 32 bytes por stack frame @@ -359,8 +364,7 @@ def locate_attribute(self, attrname: str, attributes: List[Attribute]): return offset -def locate_attribute_in_type_hierarchy(attribute: Attribute, - base_type: SemanticType): +def locate_attribute_in_type_hierarchy(attribute: Attribute, base_type: SemanticType): # El atributo se define por primera vez en el primer tipo que lo contiene # por lo que vamos subiendo por la jerarquia de tipos hasta encontrar # un tipo que no contenga dicho atributo. Este proceso siempre diff --git a/src/pycoolc.py b/src/pycoolc.py index 7c61a4ed..7b97802d 100644 --- a/src/pycoolc.py +++ b/src/pycoolc.py @@ -18,7 +18,7 @@ def pipeline(program: str, deep: int, file_name: str) -> None: program = find_comments(program) # Tratar los \t en el programa como 4 espacios por comodidad # a la hora de reportar errores de fila y columna - program = program.replace('\t', ' ' * 4) + program = program.replace("\t", " " * 4) except AssertionError as e: print(e) sys.exit(1) @@ -77,10 +77,10 @@ def pipeline(program: str, deep: int, file_name: str) -> None: f.write(file_str) -if __name__ == '__main__': +if __name__ == "__main__": parser = ArgumentParser() - parser.add_argument('file', type=str, help="Cool source file.") - parser.add_argument('--deep', type=int) + parser.add_argument("file", type=str, help="Cool source file.") + parser.add_argument("--deep", type=int) args = parser.parse_args() deep = 3 if args.deep is None else args.deep with open(args.file, "r") as f: diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 7a1ed8b0..2a1b178b 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -1,12 +1,28 @@ from abstract.semantics import Type from cil.nodes import LocalNode from mips.arithmetic import ADD, DIV, MUL, NOR, SUB, SUBU -from mips.baseMipsVisitor import (BaseCilToMipsVisitor, DotDataDirective, - DotTextDirective, - locate_attribute_in_type_hierarchy) +from mips.baseMipsVisitor import ( + BaseCilToMipsVisitor, + DotDataDirective, + DotTextDirective, + locate_attribute_in_type_hierarchy, +) import cil.nodes as cil -from mips.instruction import (FixedData, Label, MOVE, REG_TO_STR, SYSCALL, a0, - s0, sp, ra, v0, a1, zero, s1) +from mips.instruction import ( + FixedData, + Label, + MOVE, + REG_TO_STR, + SYSCALL, + a0, + s0, + sp, + ra, + v0, + a1, + zero, + s1, +) import mips.branch as branchNodes from functools import singledispatchmethod @@ -60,8 +76,8 @@ def _(self, node: cil.TypeNode): # noqa: F811 # Los punteros a funciones estaran definidos en el orden en que aparecen declaradas en las clases # de modo que la VTABLE sea indexable y podamos efectuar VCALL en O(1). self.register_instruction( - FixedData(f'{node.name}_vtable', - ", ".join(x[1] for x in node.methods))) + FixedData(f"{node.name}_vtable", ", ".join(x[1] for x in node.methods)) + ) self.comment("\n\n") @@ -80,18 +96,20 @@ def _(self, node: cil.TypeNode): # noqa: F811 # Registrar un puntero a la VTABLE del tipo. self.register_instruction( - FixedData(f'{node.name}_vtable_pointer', f"{node.name}_vtable")) + FixedData(f"{node.name}_vtable_pointer", f"{node.name}_vtable") + ) # Declarar los atributos: Si los atributos son de tipo string, guardarlos como asciiz # de lo contrario son o numeros o punteros y se inicializan como .words for attrib in node.attributes: if attrib.type.name == "String": self.register_instruction( - FixedData(f'{node.name}_attrib_{attrib.name}', r"", - 'asciiz')) + FixedData(f"{node.name}_attrib_{attrib.name}", r"", "asciiz") + ) else: self.register_instruction( - FixedData(f'{node.name}_attrib_{attrib.name}', 0)) + FixedData(f"{node.name}_attrib_{attrib.name}", 0) + ) # Registrar la direccion de memoria donde termina el tipo para calcular facilmente # sizeof @@ -105,7 +123,8 @@ def _(self, node: cil.DataNode): self.register_instruction(DotDataDirective()) if isinstance(node.value, str): self.register_instruction( - FixedData(node.name, f"{node.value}", type_='asciiz')) + FixedData(node.name, f"{node.value}", type_="asciiz") + ) elif isinstance(node.value, dict): # Lo unico que puede ser un diccionario es la TDT. Me parece..... mehh !!?? # La TDT contiene para cada par (typo1, tipo2), la distancia entre tipo1 y tipo2 @@ -114,7 +133,8 @@ def _(self, node: cil.DataNode): # programa los tipos son unicos). for (type1, type2), distance in node.value.items(): self.register_instruction( - FixedData(f"__{type1}_{type2}_tdt_entry__", distance)) + FixedData(f"__{type1}_{type2}_tdt_entry__", distance) + ) elif isinstance(node.value, int): self.register_instruction(FixedData(node.name, node.value)) @@ -347,8 +367,7 @@ def _(self, node: cil.AllocateNode): self.register_instruction(SW(dest=reg, src="0($v0)")) # Cargar el puntero a la VTABLE - self.register_instruction( - LA(dest=reg, src=f"{instance_type.name}_start")) + self.register_instruction(LA(dest=reg, src=f"{instance_type.name}_start")) self.register_instruction(SW(dest=reg, src="4($v0)")) self.register_instruction(MOVE(temp, v0)) @@ -356,14 +375,16 @@ def _(self, node: cil.AllocateNode): # Los atributos comienzan en el indice 8($v0) for i, attribute in enumerate(instance_type.attributes): attrib_type_name = locate_attribute_in_type_hierarchy( - attribute, instance_type) + attribute, instance_type + ) # llamar la funcion de inicializacion del atributo self.register_instruction( - branchNodes.JAL( - f"__{attrib_type_name}__attrib__{attribute.name}__init")) + branchNodes.JAL(f"__{attrib_type_name}__attrib__{attribute.name}__init") + ) # El valor de retorno viene en v0 self.register_instruction( - SW(dest=v0, src=f"{8 + i*4}(${REG_TO_STR[temp]})")) + SW(dest=v0, src=f"{8 + i*4}(${REG_TO_STR[temp]})") + ) # mover la direccion que almacena la instancia hacia dest self.register_instruction(SW(temp, dest)) @@ -465,7 +486,9 @@ def _(self, node: cil.DynamicCallNode): reg1 = self.get_available_register() reg2 = self.get_available_register() reg3 = self.get_available_register() - assert reg1 is not None and reg2 is not None and reg3 is not None, "out of registers" + assert ( + reg1 is not None and reg2 is not None and reg3 is not None + ), "out of registers" # Salvar el puntero a self en a1 self.comment("Save current self pointer in $a1") @@ -597,7 +620,7 @@ def _(self, node: cil.PrintIntNode): # almacenado en $a0 # Cargar el entero en $a0 self.register_instruction(LW(a0, src)) - # $v0 = 1; syscall 1 + # syscall 1 = print_int self.register_instruction(LI(v0, 1)) self.register_instruction(SYSCALL()) @@ -654,6 +677,7 @@ class MipsCodeGenerator(CilToMipsVisitor): plano del AST de MIPS, la cual se puede escribir a un archivo de salida y debe estar lista para ejecutarse en SPIM. """ + def __call__(self, ast: cil.CilProgramNode) -> str: self.visit(ast) return self.to_str() @@ -663,12 +687,12 @@ def to_str(self) -> str: indent = 0 for instr in self.program: line = str(instr) - if '.data' in line or '.text' in line: + if ".data" in line or ".text" in line: indent = 0 program += "\n" + " " * (3 * indent) + line - if '#' not in line and (':' in line and 'end' not in line): - if 'word' not in line and 'asciiz' not in line and 'byte' not in line: + if "#" not in line and (":" in line and "end" not in line): + if "word" not in line and "asciiz" not in line and "byte" not in line: indent += 1 - if '#' not in line and ("END" in line or "end" in line): + if "#" not in line and ("END" in line or "end" in line): indent -= 1 return program diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 3fa61a27..b4f148b8 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -1,6 +1,6 @@ import re from cloudpickle.cloudpickle import instance -from abstract.tree import SelfNode +from abstract.tree import EqualToNode, SelfNode import cil.baseCilVisitor as baseCilVisitor import abstract.tree as coolAst import abstract.semantics as semantics @@ -10,13 +10,44 @@ import cil.nodes from cil.nodes import ( - AllocateNode, ArgNode, AssignNode, CilNode, CilProgramNode, ConcatNode, - DataNode, DivNode, DynamicCallNode, FunctionNode, GetAttributeNode, - GetTypeIndex, IfZeroJump, InstructionNode, JumpIfGreaterThanZeroNode, - LabelNode, LengthNode, LoadNode, LocalNode, MinusNode, NotNode, - NotZeroJump, ParamNode, PlusNode, PrintIntNode, PrintNode, ReadIntNode, - ReadNode, ReturnNode, SetAttributeNode, StarNode, StaticCallNode, - SubstringNode, TdtLookupNode, TypeNode, TypeOfNode, UnconditionalJump) + AllocateNode, + ArgNode, + AssignNode, + CilNode, + CilProgramNode, + ConcatNode, + DataNode, + DivNode, + DynamicCallNode, + FunctionNode, + GetAttributeNode, + GetTypeIndex, + IfZeroJump, + InstructionNode, + JumpIfGreaterThanZeroNode, + LabelNode, + LengthNode, + LoadNode, + LocalNode, + MinusNode, + NotNode, + NotZeroJump, + ParamNode, + PlusNode, + PrintIntNode, + PrintNode, + ReadIntNode, + ReadNode, + ReturnNode, + SetAttributeNode, + StarNode, + StaticCallNode, + SubstringNode, + TdtLookupNode, + TypeNode, + TypeOfNode, + UnconditionalJump, +) ExpressionReturn = Tuple[List[InstructionNode], List[LocalNode]] Scope = semantics.Scope @@ -30,8 +61,7 @@ def visit(self, node, scope: Scope) -> CilNode: return CilNode() @visit.register - def _(self, node: coolAst.ProgramNode, - scope: Scope) -> CilProgramNode: # noqa: F811 + def _(self, node: coolAst.ProgramNode, scope: Scope) -> CilProgramNode: # Definir el punto de entrada del programa. self.current_function = self.register_function("entry") @@ -41,13 +71,14 @@ def _(self, node: coolAst.ProgramNode, # El primer metodo que se invoca es el metodo main de la clase Main # Reservar memoria para el objeto Main - main_type = self.context.get_type('Main') + main_type = self.context.get_type("Main") self.register_instruction(AllocateNode(main_type, instance)) self.register_instruction(ArgNode(instance)) # Llamar al metodo main self.register_instruction( - StaticCallNode(self.to_function_name('main', 'Main'), result)) + StaticCallNode(self.to_function_name("main", "Main"), result) + ) self.register_instruction(ReturnNode(0)) self.current_function = None @@ -59,7 +90,7 @@ def _(self, node: coolAst.ProgramNode, # *************** IMPLEMENTACION DE LAS DEFINICIONES DE CLASES ***************** @visit.register - def _(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 + def _(self, node: coolAst.ClassDef, scope: Scope) -> None: # Registrar el tipo que creamos en .Types section self.current_type = self.context.get_type(node.idx) new_type_node = self.register_type(node.idx) @@ -76,9 +107,13 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 # Manejar la redefinicion de metodos if method not in methods: new_type_node.methods.append( - (method, - self.to_function_name(method, - self.current_type.parent.name))) + ( + method, + self.to_function_name( + method, self.current_type.parent.name + ), + ) + ) # Registrar cada atributo y metodo para este tipo # la seccion .Type debe tener la siguiente forma: @@ -94,7 +129,8 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 for method in methods: new_type_node.methods.append( - (method, self.to_function_name(method, node.idx))) + (method, self.to_function_name(method, node.idx)) + ) print(self.current_type) print(new_type_node.attributes) @@ -109,7 +145,8 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 # Visitar cada metodo para generar su codigo en la seccion .CODE for feature, child_scope in zip( (x for x in node.features if isinstance(x, coolAst.MethodDef)), - scope.children): + scope.children, + ): self.visit(feature, child_scope) self.current_type = None @@ -119,7 +156,8 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: # noqa: F811 @visit.register def _(self, node: coolAst.AttributeDef, scope: Scope) -> None: self.current_function = self.register_function( - f"__{self.current_type.name}__attrib__{node.idx}__init") + f"__{self.current_type.name}__attrib__{node.idx}__init" + ) if node.default_value is not None: # Generar el codigo de la expresion de inicializacion # y devolver el valor de esta @@ -137,12 +175,13 @@ def _(self, node: coolAst.AttributeDef, scope: Scope) -> None: self.register_instruction(ReturnNode(0)) @visit.register - def _(self, node: coolAst.MethodDef, scope: Scope) -> None: # noqa: F811 + def _(self, node: coolAst.MethodDef, scope: Scope) -> None: self.current_method = self.current_type.get_method(node.idx) # Registrar la nueva funcion en .CODE function_node = self.register_function( - self.to_function_name(node.idx, self.current_type.name)) + self.to_function_name(node.idx, self.current_type.name) + ) # Establecer el metodo actual y la funcion actual en construccion # para poder establecer nombres de variables y otras cosas. @@ -173,8 +212,7 @@ def _(self, node: coolAst.MethodDef, scope: Scope) -> None: # noqa: F811 # ************** @visit.register - def _(self, node: coolAst.IfThenElseNode, - scope: Scope) -> None: # noqa: F811 + def _(self, node: coolAst.IfThenElseNode, scope: Scope) -> None: # noqa: F811 # Crear un LABEL al cual realizar un salto. false_label = self.do_label("FALSE") end_label = self.do_label("END") @@ -185,8 +223,7 @@ def _(self, node: coolAst.IfThenElseNode, # Chequear y saltar si es necesario. assert isinstance(internal_cond_vm_holder, LocalNode) - self.register_instruction( - IfZeroJump(internal_cond_vm_holder, false_label)) + self.register_instruction(IfZeroJump(internal_cond_vm_holder, false_label)) # Salvar las instrucciones relacionadas con la rama TRUE. self.visit(node.expr1, scope) @@ -200,8 +237,7 @@ def _(self, node: coolAst.IfThenElseNode, self.register_instruction(LabelNode(end_label)) @visit.register - def _(self, node: coolAst.VariableDeclaration, - scope: Scope) -> CilNode: # noqa: F811 + def _(self, node: coolAst.VariableDeclaration, scope: Scope) -> CilNode: for var_idx, var_type, var_init_expr in node.var_list: # Registrar las variables en orden. @@ -214,8 +250,7 @@ def _(self, node: coolAst.VariableDeclaration, # Si la variable es int, string o boolean, su valor por defecto es 0 if var_info.type.name not in ("String", "Int", "Bool"): - self.register_instruction( - AllocateNode(var_info.type, local_var)) + self.register_instruction(AllocateNode(var_info.type, local_var)) else: # Si la variable tiene una expresion de inicializacion # entonces no es necesario ponerle valor por defecto @@ -225,15 +260,14 @@ def _(self, node: coolAst.VariableDeclaration, if var_init_expr is not None: expr_init_vm_holder = self.visit(var_init_expr, scope) # Assignar el valor correspondiente a la variable reservada - self.register_instruction( - AssignNode(local_var, expr_init_vm_holder)) + self.register_instruction(AssignNode(local_var, expr_init_vm_holder)) - # Process the associated expr, if any, to the let declaration + # Compute the associated expr, if any, to the let declaration # A block defines a new scope, so it is important to manage it return self.visit(node.block_statements, scope) @visit.register - def _(self, node: coolAst.VariableCall, scope: Scope): # noqa: F811 + def _(self, node: coolAst.VariableCall, scope: Scope): vinfo = scope.find_variable(node.idx) # Diferenciar la variable si es un parametro, un atributo o una variable local # en el scope actual @@ -246,7 +280,8 @@ def _(self, node: coolAst.VariableCall, scope: Scope): # noqa: F811 local = self.define_internal_local() assert self.current_type is not None self.register_instruction( - GetAttributeNode(self.current_type, vinfo.name, local)) + GetAttributeNode(self.current_type, vinfo.name, local) + ) return local if vinfo.location == "LOCAL": for local_node in self.localvars: @@ -290,21 +325,20 @@ def _(self, node: coolAst.AssignNode, scope: Scope): assert self.current_type is not None assert isinstance(rvalue_vm_holder, LocalNode) self.register_instruction( - SetAttributeNode(self.current_type, node.idx, - rvalue_vm_holder)) + SetAttributeNode(self.current_type, node.idx, rvalue_vm_holder) + ) @visit.register def _(self, node: coolAst.WhileBlockNode, scope: Scope): # Evaluar la condicion y definir un LABEL al cual # retornar - while_label = self.do_label('WHILE') - end_label = self.do_label('WHILE_END') + while_label = self.do_label("WHILE") + end_label = self.do_label("WHILE_END") self.register_instruction(LabelNode(while_label)) cond_vm_holder = self.visit(node.cond, scope) # Probar la condicion, si es true continuar la ejecucion, sino saltar al LABEL end - assert isinstance(cond_vm_holder, - LocalNode), cond_vm_holder.__class__.__name__ + assert isinstance(cond_vm_holder, LocalNode), cond_vm_holder.__class__.__name__ self.register_instruction(IfZeroJump(cond_vm_holder, end_label)) # Registrar las instrucciones del cuerpo del while @@ -326,7 +360,8 @@ def _(self, node: coolAst.CaseNode, scope: Scope): assert isinstance(expr_vm_holder, LocalNode) self.register_instruction( - TypeOfNode(expr_vm_holder, type_internal_local_holder)) + TypeOfNode(expr_vm_holder, type_internal_local_holder) + ) # Variables internas para almacenar resultados intermedios min_ = self.define_internal_local() @@ -338,15 +373,15 @@ def _(self, node: coolAst.CaseNode, scope: Scope): for i, action_node in enumerate(node.actions): # Calcular la distancia hacia el tipo, y actualizar el minimo de ser necesario self.register_instruction( - TdtLookupNode(action_node.typex, type_internal_local_holder, - tdt_result)) + TdtLookupNode(action_node.typex, type_internal_local_holder, tdt_result) + ) # Comparar el resultado obtenido con el minimo actual. + self.register_instruction(MinusNode(min_, tdt_result, min_check_local)) + not_min_label = self.do_label("Not_min{i}") self.register_instruction( - MinusNode(min_, tdt_result, min_check_local)) - not_min_label = self.do_label('Not_min{i}') - self.register_instruction( - JumpIfGreaterThanZeroNode(min_check_local, not_min_label)) + JumpIfGreaterThanZeroNode(min_check_local, not_min_label) + ) # Si mejora el minimo, entonces actualizarlo. self.register_instruction(AssignNode(min_, tdt_result)) @@ -355,23 +390,20 @@ def _(self, node: coolAst.CaseNode, scope: Scope): # Ya tenemos la menor distancia entre el tipo calculado en la expr0, y todos los tipos definidos # en los branches del case. # Comprobar que tengamos una coincidencia - self.register_instruction( - AssignNode(tdt_result, len(self.context.types))) - self.register_instruction( - MinusNode(tdt_result, min_, sub_vm_local_holder)) + self.register_instruction(AssignNode(tdt_result, len(self.context.types))) + self.register_instruction(MinusNode(tdt_result, min_, sub_vm_local_holder)) error_label = self.do_label("ERROR") self.register_instruction(IfZeroJump(sub_vm_local_holder, error_label)) - end_label = self.do_label('END') + end_label = self.do_label("END") # Procesar cada accion y ejecutar el tipo cuya distancia sea igual a min_ for i, action_node in enumerate(node.actions): - next_label = self.do_label(f'NEXT{i}') - self.register_instruction( - TdtLookupNode(action_node.typex, type_internal_local_holder, - tdt_result)) + next_label = self.do_label(f"NEXT{i}") self.register_instruction( - MinusNode(min_, tdt_result, min_check_local)) + TdtLookupNode(action_node.typex, type_internal_local_holder, tdt_result) + ) + self.register_instruction(MinusNode(min_, tdt_result, min_check_local)) self.register_instruction(NotZeroJump(min_check_local, next_label)) # Implemententacion del branch. # Registrar la variable @@ -408,7 +440,8 @@ def _(self, node: coolAst.PlusNode, scope: Scope) -> LocalNode: # registrar la instruccion de suma self.register_instruction( - PlusNode(sum_internal_local, left_vm_holder, right_vm_holder)) + PlusNode(sum_internal_local, left_vm_holder, right_vm_holder) + ) # Devolver la variable interna que contiene la suma return sum_internal_local @@ -426,10 +459,11 @@ def _(self, node: coolAst.DifNode, scope: Scope) -> LocalNode: # Registrar la instruccion de resta assert isinstance(left_vm_holder, LocalNode) and isinstance( - right_vm_holder, LocalNode) + right_vm_holder, LocalNode + ) self.register_instruction( - MinusNode(left_vm_holder, right_vm_holder, - minus_internal_vm_holder)) + MinusNode(left_vm_holder, right_vm_holder, minus_internal_vm_holder) + ) # Devolver la variable que contiene el resultado return minus_internal_vm_holder @@ -446,11 +480,13 @@ def _(self, node: coolAst.MulNode, scope: Scope) -> LocalNode: right_vm_holder = self.visit(node.right, scope) assert isinstance(left_vm_holder, LocalNode) and isinstance( - right_vm_holder, LocalNode) + right_vm_holder, LocalNode + ) # Registrar la instruccion de multimplicacion self.register_instruction( - StarNode(left_vm_holder, right_vm_holder, mul_internal_vm_holder)) + StarNode(left_vm_holder, right_vm_holder, mul_internal_vm_holder) + ) # Retornar el resultado return mul_internal_vm_holder @@ -468,7 +504,8 @@ def _(self, node: coolAst.DivNode, scope: Scope) -> LocalNode: # Registrar la instruccion de division self.register_instruction( - DivNode(div_internal_vm_holder, left_vm_holder, right_vm_holder)) + DivNode(div_internal_vm_holder, left_vm_holder, right_vm_holder) + ) # Devolver el resultado return div_internal_vm_holder @@ -518,7 +555,8 @@ def _(self, node: coolAst.NegNode, scope: Scope): if isinstance(expr_result, int): self.register_instruction( - AssignNode(result_vm_holder, abs(expr_result - 1))) + AssignNode(result_vm_holder, abs(expr_result - 1)) + ) return result_vm_holder else: assert isinstance(expr_result, LocalNode) @@ -538,19 +576,22 @@ def _(self, node: coolAst.EqualToNode, scope: Scope) -> LocalNode: right_vm_holder = self.visit(node.right, scope) # Realizar una resta y devolver el resultado - assert (isinstance(left_vm_holder, LocalNode) - or isinstance(left_vm_holder, int) - or isinstance(left_vm_holder, ParamNode)) and ( - isinstance(right_vm_holder, LocalNode) - or isinstance(right_vm_holder, int) - or isinstance(right_vm_holder, ParamNode)) + assert ( + isinstance(left_vm_holder, LocalNode) + or isinstance(left_vm_holder, int) + or isinstance(left_vm_holder, ParamNode) + ) and ( + isinstance(right_vm_holder, LocalNode) + or isinstance(right_vm_holder, int) + or isinstance(right_vm_holder, ParamNode) + ) self.register_instruction( - MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) + MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder) + ) # Si la resta da 0, entonces son iguales y se devuelve 1, si no, se devuelve 0 - self.register_instruction(IfZeroJump(expr_result_vm_holder, - true_label)) + self.register_instruction(IfZeroJump(expr_result_vm_holder, true_label)) # si la resta no da 0, almacenar 0 y retornar self.register_instruction(AssignNode(expr_result_vm_holder, 0)) @@ -579,14 +620,16 @@ def _(self, node: coolAst.LowerThanNode, scope: Scope) -> LocalNode: # Comparar los resultados restando assert isinstance(left_vm_holder, LocalNode) and isinstance( - right_vm_holder, LocalNode) + right_vm_holder, LocalNode + ) self.register_instruction( - MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) + MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder) + ) self.register_instruction( - JumpIfGreaterThanZeroNode(expr_result_vm_holder, false_label)) - self.register_instruction( - IfZeroJump(expr_result_vm_holder, false_label)) + JumpIfGreaterThanZeroNode(expr_result_vm_holder, false_label) + ) + self.register_instruction(IfZeroJump(expr_result_vm_holder, false_label)) self.register_instruction(AssignNode(expr_result_vm_holder, 1)) self.register_instruction(UnconditionalJump(end_label)) @@ -610,13 +653,16 @@ def _(self, node: coolAst.LowerEqual, scope: Scope) -> LocalNode: right_vm_holder = self.visit(node.right, scope) assert isinstance(left_vm_holder, LocalNode) and isinstance( - right_vm_holder, LocalNode) + right_vm_holder, LocalNode + ) self.register_instruction( - MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) + MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder) + ) self.register_instruction( - JumpIfGreaterThanZeroNode(expr_result_vm_holder, false_label)) + JumpIfGreaterThanZeroNode(expr_result_vm_holder, false_label) + ) self.register_instruction(AssignNode(expr_result_vm_holder, 1)) self.register_instruction(UnconditionalJump(end_label)) @@ -640,13 +686,16 @@ def _(self, node: coolAst.GreaterThanNode, scope: Scope) -> LocalNode: right_vm_holder = self.visit(node.right, scope) assert isinstance(left_vm_holder, LocalNode) and isinstance( - right_vm_holder, LocalNode) + right_vm_holder, LocalNode + ) self.register_instruction( - MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) + MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder) + ) self.register_instruction( - JumpIfGreaterThanZeroNode(expr_result_vm_holder, true_label)) + JumpIfGreaterThanZeroNode(expr_result_vm_holder, true_label) + ) # False Branch self.register_instruction(AssignNode(expr_result_vm_holder, 0)) @@ -672,15 +721,17 @@ def _(self, node: coolAst.GreaterEqualNode, scope: Scope) -> LocalNode: right_vm_holder = self.visit(node.right, scope) assert isinstance(left_vm_holder, LocalNode) and isinstance( - right_vm_holder, LocalNode) + right_vm_holder, LocalNode + ) self.register_instruction( - MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder)) + MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder) + ) self.register_instruction( - JumpIfGreaterThanZeroNode(expr_result_vm_holder, true_label)) - self.register_instruction(IfZeroJump(expr_result_vm_holder, - true_label)) + JumpIfGreaterThanZeroNode(expr_result_vm_holder, true_label) + ) + self.register_instruction(IfZeroJump(expr_result_vm_holder, true_label)) # False Branch self.register_instruction(AssignNode(expr_result_vm_holder, 1)) @@ -713,7 +764,8 @@ def _(self, node: coolAst.FunCall, scope: Scope) -> LocalNode: self.register_instruction(ArgNode(arg_expr)) self.register_instruction( - DynamicCallNode(type_vm_holder, node.id, return_vm_holder)) + DynamicCallNode(type_vm_holder, node.id, return_vm_holder) + ) return return_vm_holder @@ -732,8 +784,8 @@ def _(self, node: coolAst.ParentFuncCall, scope: Scope) -> LocalNode: self.register_instruction(AssignNode(local_type_identifier, type_)) self.register_instruction( - DynamicCallNode(local_type_identifier, node.idx, - return_expr_vm_holder)) + DynamicCallNode(local_type_identifier, node.idx, return_expr_vm_holder) + ) return return_expr_vm_holder @@ -752,88 +804,88 @@ def visit(self, node) -> str: @visit.register def _(self, node: CilProgramNode): # Primero imprimir la seccion .TYPES - dottypes = '\n'.join(self.visit(type_) for type_ in node.dottypes) + dottypes = "\n".join(self.visit(type_) for type_ in node.dottypes) # Imprimir la seccion .DATA - dotdata = '\n'.join(self.visit(data) for data in node.dotdata) + dotdata = "\n".join(self.visit(data) for data in node.dotdata) # Imprimir la seccion .CODE - dotcode = '\n'.join(self.visit(code) for code in node.dotcode) + dotcode = "\n".join(self.visit(code) for code in node.dotcode) - return f'.TYPES\n{dottypes}\n\n.DATA\n{dotdata}\n\n.CODE\n{dotcode}' + return f".TYPES\n{dottypes}\n\n.DATA\n{dotdata}\n\n.CODE\n{dotcode}" @visit.register def _(self, node: TypeNode): - attributes = '\n\t'.join(f'{x}' for x in node.attributes) - methods = '\n\t'.join(f'method {x}: {y}' for x, y in node.methods) + attributes = "\n\t".join(f"{x}" for x in node.attributes) + methods = "\n\t".join(f"method {x}: {y}" for x, y in node.methods) - return f'type {node.name} {{\n\t{attributes}\n\n\t{methods}\n}}' + return f"type {node.name} {{\n\t{attributes}\n\n\t{methods}\n}}" @visit.register def _(self, node: FunctionNode): - params = '\n\t'.join(self.visit(x) for x in node.params) - localvars = '\n\t'.join(self.visit(x) for x in node.localvars) - instructions = '\n\t'.join(self.visit(x) for x in node.instructions) + params = "\n\t".join(self.visit(x) for x in node.params) + localvars = "\n\t".join(self.visit(x) for x in node.localvars) + instructions = "\n\t".join(self.visit(x) for x in node.instructions) - return f'{node.name} {{\n\t{params}\n\n\t{localvars}\n\n\t{instructions}\n}}' + return f"{node.name} {{\n\t{params}\n\n\t{localvars}\n\n\t{instructions}\n}}" @visit.register def _(self, node: ParamNode) -> str: - return f'PARAM {node.name}' + return f"PARAM {node.name}" @visit.register def _(self, node: LocalNode) -> str: - return f'{node.name}' + return f"{node.name}" @visit.register def _(self, node: AssignNode) -> str: - return f'{self.visit(node.dest)} = {self.visit(node.source)}' + return f"{self.visit(node.dest)} = {self.visit(node.source)}" @visit.register def _(self, node: PlusNode) -> str: - return f'{self.visit(node.dest)} = {self.visit(node.left)} + {self.visit(node.right)}' + return f"{self.visit(node.dest)} = {self.visit(node.left)} + {self.visit(node.right)}" @visit.register def _(self, node: MinusNode) -> str: - return f'{self.visit(node.dest)} = {self.visit(node.x)} - {self.visit(node.y)}' + return f"{self.visit(node.dest)} = {self.visit(node.x)} - {self.visit(node.y)}" @visit.register def _(self, node: StarNode) -> str: - return f'{self.visit(node.dest)} = {self.visit(node.x)} * {self.visit(node.y)}' + return f"{self.visit(node.dest)} = {self.visit(node.x)} * {self.visit(node.y)}" @visit.register def _(self, node: DivNode) -> str: - return f'{self.visit(node.dest)} = {self.visit(node.left)} / {self.visit(node.right)}' + return f"{self.visit(node.dest)} = {self.visit(node.left)} / {self.visit(node.right)}" @visit.register def _(self, node: AllocateNode) -> str: - return f'{self.visit(node.dest)} = ALLOCATE {node.itype.name}' + return f"{self.visit(node.dest)} = ALLOCATE {node.itype.name}" @visit.register def _(self, node: TypeOfNode) -> str: - return f'{self.visit(node.dest)} = TYPEOF {node.variable.name}' + return f"{self.visit(node.dest)} = TYPEOF {node.variable.name}" @visit.register def _(self, node: DynamicCallNode) -> str: - return f'{self.visit(node.dest)} = VCALL {node.xtype.name} {node.method}' + return f"{self.visit(node.dest)} = VCALL {node.xtype.name} {node.method}" @visit.register def _(self, node: StaticCallNode) -> str: - return f'{self.visit(node.dest)} = CALL {node.function}' + return f"{self.visit(node.dest)} = CALL {node.function}" @visit.register def _(self, node: ArgNode) -> str: if isinstance(node.name, int): - return f'ARG {self.visit(node.name)}' + return f"ARG {self.visit(node.name)}" else: - return f'ARG {node.name.name}' + return f"ARG {node.name.name}" @visit.register def _(self, node: ReturnNode) -> str: if isinstance(node.value, int): - return f'RETURN {node.value}' + return f"RETURN {node.value}" elif isinstance(node.value, LocalNode): - return f'RETURN {node.value.name}' + return f"RETURN {node.value.name}" return "RETURN" @visit.register @@ -842,32 +894,32 @@ def _(self, node: DataNode) -> str: return f'{node.name} = "{node.value}" ;' elif isinstance(node.value, list): data = "\n\t".join(str(x) for x in node.value) - return f'{node.name} = {data}' - return f'{node.name} = {node.value}' + return f"{node.name} = {data}" + return f"{node.name} = {node.value}" @visit.register def _(self, node: GetTypeIndex) -> str: - return f'{node.dest} = GETTYPEINDEX {node.itype}' + return f"{node.dest} = GETTYPEINDEX {node.itype}" @visit.register def _(self, node: TdtLookupNode) -> str: - return f'{node.dest.name} = TYPE_DISTANCE {node.i} {node.j}' + return f"{node.dest.name} = TYPE_DISTANCE {node.i} {node.j}" @visit.register def _(self, node: IfZeroJump) -> str: - return f'IF_ZERO {node.variable.name} GOTO {node.label}' + return f"IF_ZERO {node.variable.name} GOTO {node.label}" @visit.register def _(self, node: UnconditionalJump) -> str: - return f'GOTO {node.label}' + return f"GOTO {node.label}" @visit.register def _(self, node: JumpIfGreaterThanZeroNode) -> str: - return f'IF_GREATER_ZERO {node.variable.name} GOTO {node.label}' + return f"IF_GREATER_ZERO {node.variable.name} GOTO {node.label}" @visit.register def _(self, node: LabelNode) -> str: - return f'{node.label}:' + return f"{node.label}:" @visit.register def _(self, node: int) -> str: @@ -875,31 +927,31 @@ def _(self, node: int) -> str: @visit.register def _(self, node: GetAttributeNode): - return f'{node.dest.name} = GETATTRIBUTE {node.attrname} {node.itype.name}' + return f"{node.dest.name} = GETATTRIBUTE {node.attrname} {node.itype.name}" @visit.register def _(self, node: cil.nodes.SelfNode): - return f'{node.dest.name} = SELF' + return f"{node.dest.name} = SELF" @visit.register def _(self, node: NotNode): - return f'NOT {node.src.name}' + return f"NOT {node.src.name}" @visit.register def _(self, node: PrintIntNode): - return f'PRINT_INT {node.src.name}' + return f"PRINT_INT {node.src.name}" @visit.register def _(self, node: ReadIntNode): - return f'{node.dest.name} = READ_INT' + return f"{node.dest.name} = READ_INT" @visit.register def _(self, node: ReadNode): - return f'{node.dest.name} = READ_STR' + return f"{node.dest.name} = READ_STR" @visit.register def _(self, node: PrintNode): - return f'PRINT_STR {node.src.name}' + return f"PRINT_STR {node.src.name}" def __call__(self, node) -> str: return self.visit(node) diff --git a/src/travels/inference.py b/src/travels/inference.py index 110fe034..b5bb9a1e 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -5,8 +5,11 @@ import abstract.tree as coolAst from abstract.semantics import Scope, SemanticError, Type from abstract.tree import IsVoidNode, SelfNode -from travels.context_actions import (update_attr_type, update_method_param, - update_scope_variable) +from travels.context_actions import ( + update_attr_type, + update_method_param, + update_scope_variable, +) void = semantic.VoidType() @@ -30,15 +33,16 @@ class TypeInferer: BOLEAN entonces el tipo de la expresión completa sera el Ancestro Común Mas Cercano a los tipos T1 y T2, o en otras palabras, el menor tipo T3 tal que T1 se conforme en T3 y T2 se conforme en T3. """ + def __init__(self, context: semantic.Context, errors=[]): self.context: semantic.Context = context self.current_type: Optional[semantic.Type] = None - self.INTEGER = self.context.get_type('Int') - self.OBJECT = self.context.get_type('Object') - self.STRING = self.context.get_type('String') - self.BOOL = self.context.get_type('Bool') - self.AUTO_TYPE = self.context.get_type('AUTO_TYPE') - self.SELF_TYPE = self.context.get_type('SELF_TYPE') + self.INTEGER = self.context.get_type("Int") + self.OBJECT = self.context.get_type("Object") + self.STRING = self.context.get_type("String") + self.BOOL = self.context.get_type("Bool") + self.AUTO_TYPE = self.context.get_type("AUTO_TYPE") + self.SELF_TYPE = self.context.get_type("SELF_TYPE") self.errors = errors self.current_method: Optional[semantic.Method] = None @@ -46,7 +50,7 @@ def __init__(self, context: semantic.Context, errors=[]): def visit(self, node, scope, infered_type=None) -> Type: # Devolver un tipo por defecto, en verdad # no importa ya que este metodo nunca sera llamado. - return Type('') + return Type("") # --------------------------------------------------------------------------------------------------------------------------# # -----------------------------------------------------EXPRESIONES----------------------------------------------------------# @@ -56,18 +60,13 @@ def visit(self, node, scope, infered_type=None) -> Type: # Calcular todos los tipos en el contexto del programa. | # --------------------------------------------------------------- @visit.register - def _(self, - node: coolAst.ProgramNode, - scope=None, - infered_type=None, - deep=1): # noqa: F811 + def _(self, node: coolAst.ProgramNode, scope=None, infered_type=None, deep=1): program_scope = semantic.Scope() if scope is None else scope if deep == 1: for class_ in node.class_list: self.visit(class_, program_scope.create_child()) else: - for class_, child_scope in zip(node.class_list, - program_scope.children): + for class_, child_scope in zip(node.class_list, program_scope.children): self.visit(class_, child_scope, deep=deep) return program_scope @@ -77,11 +76,9 @@ def _(self, # ya todos los atributos estén definidos en el scope. | # ----------------------------------------------------------------- @visit.register - def _(self, - node: coolAst.ClassDef, - scope: semantic.Scope, - infered_type=None, - deep=1): + def _( + self, node: coolAst.ClassDef, scope: semantic.Scope, infered_type=None, deep=1 + ): self.current_type = self.context.get_type(node.idx) # Definir los atributos heredados for attribute in self.current_type.attributes: @@ -95,8 +92,7 @@ def _(self, if isinstance(feature, coolAst.MethodDef): self.visit(feature, scope.create_child(), deep=deep) else: - methods = (f for f in node.features - if isinstance(f, coolAst.MethodDef)) + methods = (f for f in node.features if isinstance(f, coolAst.MethodDef)) for feature, child_scope in zip(methods, scope.children): self.visit(feature, child_scope, deep=deep) @@ -104,27 +100,29 @@ def _(self, # Definir un atributo en el scope. | # --------------------------------------------------------- @visit.register - def _(self, - node: coolAst.AttributeDef, - scope: semantic.Scope, - infered_type=None, - deep=1): + def _( + self, + node: coolAst.AttributeDef, + scope: semantic.Scope, + infered_type=None, + deep=1, + ): atrib = self.current_type.get_attribute(node.idx) # Checkear que el valor de retorno de la expresion # de inicializacion del atributo (si existe) se # conforme con el tipo del atributo if node.default_value is not None: - return_type = self.visit(node.default_value, scope, infered_type, - deep) + return_type = self.visit(node.default_value, scope, infered_type, deep) if atrib.type == self.AUTO_TYPE: # Inferir el tipo del atributo segun su expresion de inicializacion atrib.type = return_type elif not return_type.conforms_to(atrib.type): self.errors.append( - f'Attribute {node.idx} of type {atrib.type.name} can not be initialized with \ - an expression of type {return_type.name}' ) + f"Attribute {node.idx} of type {atrib.type.name} can not be initialized with \ + an expression of type {return_type.name}" + ) # --------------------------------------------------------------------- # Si el método no tiene un tipo definido, entonces tratar de inferir | @@ -141,21 +139,18 @@ def _(self, node: coolAst.MethodDef, scope, infered_type=None, deep=1): self.visit(param, scope, deep=deep) last = self.visit(node.statements, scope, deep=deep) - if last.name == 'SELF_TYPE': + if last.name == "SELF_TYPE": last = self.current_type if not method.return_type != self.AUTO_TYPE: method.return_type = last else: if not last.conforms_to(method.return_type): - self.errors.append( - f'Method {method.name} cannot return {last}') + self.errors.append(f"Method {method.name} cannot return {last}") @visit.register - def _(self, - node: coolAst.BlockNode, - scope: semantic.Scope, - infered_type=None, - deep=1): + def _( + self, node: coolAst.BlockNode, scope: semantic.Scope, infered_type=None, deep=1 + ): # Visitar cada expr del bloque, el tipo del bloque es el tipo de la ultima expresion last = None for expr in node.expressions: @@ -163,11 +158,7 @@ def _(self, return last @visit.register - def _(self, - node: coolAst.Param, - scope: semantic.Scope, - infered_type=None, - deep=1): + def _(self, node: coolAst.Param, scope: semantic.Scope, infered_type=None, deep=1): type_ = self.context.get_type(node.type) if deep == 1: scope.define_variable(node.id, type_, "PARAM") @@ -179,11 +170,9 @@ def _(self, # trario asignarle a la variable el tipo de retorno de la expresión. | # ------------------------------------------------------------------------- @visit.register - def _(self, - node: coolAst.AssignNode, - scope: semantic.Scope, - infered_type=None, - deep=1): + def _( + self, node: coolAst.AssignNode, scope: semantic.Scope, infered_type=None, deep=1 + ): var_info = scope.find_variable(node.idx) assert self.current_type is not None if var_info: @@ -191,56 +180,65 @@ def _(self, if var_info.type == self.AUTO_TYPE: var_info.type = e if not scope.is_local(var_info.name): - update_attr_type(self.current_type, var_info.name, - var_info.type) + update_attr_type(self.current_type, var_info.name, var_info.type) else: - update_method_param(self.current_type, - self.current_method.name, - var_info.name, var_info.type) + update_method_param( + self.current_type, + self.current_method.name, + var_info.name, + var_info.type, + ) update_scope_variable(var_info.name, e, scope) return void else: if not e.conforms_to(var_info.type): self.errors.append( - f'Expresion of type {e.name} cannot be assigned to variable {var_info.name} of type {var_info.type.name}' + f"Expresion of type {e.name} cannot be assigned to variable {var_info.name} of type {var_info.type.name}" ) return void else: - self.errors.append(f'Undefined variable name: {node.idx}') + self.errors.append(f"Undefined variable name: {node.idx}") @visit.register - def _(self, - node: coolAst.VariableCall, - scope: semantic.Scope, - infered_type=None, - deep=1): + def _( + self, + node: coolAst.VariableCall, + scope: semantic.Scope, + infered_type=None, + deep=1, + ): var_info = scope.find_variable(node.idx) assert self.current_type is not None if var_info: if infered_type and var_info.type == self.AUTO_TYPE: var_info.type = infered_type if scope.is_local(var_info.name): - update_method_param(self.current_type, - self.current_method.name, - var_info.name, var_info.type) + update_method_param( + self.current_type, + self.current_method.name, + var_info.name, + var_info.type, + ) update_scope_variable(var_info.name, infered_type, scope) return var_info.type else: - self.errors.append(f'Name {node.idx} is not define.') - raise SemanticError(f'Name {node.idx} is not define in {scope}') + self.errors.append(f"Name {node.idx} is not define.") + raise SemanticError(f"Name {node.idx} is not define in {scope}") @visit.register - def _(self, - node: coolAst.IfThenElseNode, - scope: semantic.Scope, - infered_type=None, - deep=1): + def _( + self, + node: coolAst.IfThenElseNode, + scope: semantic.Scope, + infered_type=None, + deep=1, + ): cond = self.visit(node.cond, scope, infered_type, deep) e1 = self.visit(node.expr1, scope, infered_type, deep) e2 = self.visit(node.expr2, scope, infered_type, deep) if cond != self.BOOL: self.errors.append( - f'Se esperaba una expresion de tipo bool y se obtuvo una de tipo {cond}.' + f"Se esperaba una expresion de tipo bool y se obtuvo una de tipo {cond}." ) if e1.conforms_to(e2): return e2 @@ -255,11 +253,13 @@ def _(self, return e1_parent @visit.register - def _(self, - node: coolAst.VariableDeclaration, - scope: semantic.Scope, - infered_type=None, - deep=1): # noqa: F811 + def _( + self, + node: coolAst.VariableDeclaration, + scope: semantic.Scope, + infered_type=None, + deep=1, + ): for var_id, var_type, var_init_expr in node.var_list: type_ = self.context.get_type(var_type) # Revisar que la expresion de inicializacion (de existir) se conforme con el tipo @@ -274,7 +274,8 @@ def _(self, # y su tipo se deja a inferir por el contexto. if var_init_expr: init_expr_type: Optional[Type] = self.visit( - var_init_expr, scope, infered_type, deep) + var_init_expr, scope, infered_type, deep + ) if type_ != self.AUTO_TYPE: if not init_expr_type.conforms_to(type_): self.errors.append( @@ -293,20 +294,18 @@ def _(self, scope.define_variable(var_id, type_, "LOCAL") # Visitar la expresion asociada. - return_type = self.visit(node.block_statements, scope, infered_type, - deep) + return_type = self.visit(node.block_statements, scope, infered_type, deep) return return_type @visit.register - def _(self, - node: coolAst.FunCall, - scope: semantic.Scope, - infered_type=None, - deep=1): + def _( + self, node: coolAst.FunCall, scope: semantic.Scope, infered_type=None, deep=1 + ): assert self.current_type is not None # Detectar el tipo estatico de la expr0. - static_expr0_type: semantic.Type = self.visit(node.obj, scope, - infered_type, deep) + static_expr0_type: semantic.Type = self.visit( + node.obj, scope, infered_type, deep + ) if static_expr0_type.name == "SELF_TYPE": static_expr0_type = self.current_type @@ -315,8 +314,9 @@ def _(self, method: semantic.Method = static_expr0_type.get_method(node.id) # Iterar por cada parametro del metodo y chequear que cada expresion corresponda en tipo. - for expr_i, type_i, param_name in zip(node.args, method.param_types, - method.param_names): + for expr_i, type_i, param_name in zip( + node.args, method.param_types, method.param_names + ): type_expr_i = self.visit(expr_i, scope, infered_type, deep) if not type_expr_i.conforms_to(type_i): raise semantic.SemanticError( @@ -333,23 +333,33 @@ def _(self, return self.AUTO_TYPE @visit.register - def _(self, - node: coolAst.InstantiateClassNode, - scope: semantic.Scope, - infered_type=None, - deep=1): # noqa: F811 + def _( + self, + node: coolAst.InstantiateClassNode, + scope: semantic.Scope, + infered_type=None, + deep=1, + ): ret_type = self.context.get_type(node.type_) - if ret_type in (self.AUTO_TYPE, void, self.STRING, self.INTEGER, - self.OBJECT, self.BOOL): - self.errors.append(f'Cannot instantiate {ret_type.name}') + if ret_type in ( + self.AUTO_TYPE, + void, + self.STRING, + self.INTEGER, + self.OBJECT, + self.BOOL, + ): + self.errors.append(f"Cannot instantiate {ret_type.name}") return ret_type @visit.register - def _(self, - node: coolAst.WhileBlockNode, - scope: semantic.Scope, - infered_type=None, - deep=1): # noqa: F811 + def _( + self, + node: coolAst.WhileBlockNode, + scope: semantic.Scope, + infered_type=None, + deep=1, + ): ret_type = self.visit(node.statements, scope, infered_type, deep) return ret_type @@ -357,71 +367,58 @@ def _(self, # ---------------------------------------OPERACIONES ARITMÉTICAS-------------------------------------------------------------# # ---------------------------------------------------------------------------------------------------------------------------# - -# ------------------------------------------------------------------------------------------------- -# Todas las operaciones aritméticas estan definidas solamente para los enteros, luego, de checkeo| -# de cada operación se realiza evaluando sus operandos y viendo si sus tipos son consistentes con| -# INTEGER. | -# ------------------------------------------------------------------------------------------------- + # ------------------------------------------------------------------------------------------------- + # Todas las operaciones aritméticas estan definidas solamente para los enteros, luego, de checkeo| + # de cada operación se realiza evaluando sus operandos y viendo si sus tipos son consistentes con| + # INTEGER. | + # ------------------------------------------------------------------------------------------------- @visit.register - def _(self, - node: coolAst.PlusNode, - scope: semantic.Scope, - infered_type=None, - deep=1): # noqa: F811 + def _( + self, node: coolAst.PlusNode, scope: semantic.Scope, infered_type=None, deep=1 + ): left = self.visit(node.left, scope, self.INTEGER, deep) right = self.visit(node.right, scope, self.INTEGER, deep) if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): return self.INTEGER else: - self.errors.append( - f'Invalid operation :{left.name} + {right.name}') + self.errors.append(f"Invalid operation :{left.name} + {right.name}") return self.INTEGER @visit.register - def _(self, - node: coolAst.DifNode, - scope: semantic.Scope, - infered_type=None, - deep=1): # noqa: F811 + def _( + self, node: coolAst.DifNode, scope: semantic.Scope, infered_type=None, deep=1 + ): left = self.visit(node.left, scope, self.INTEGER, deep) right = self.visit(node.right, scope, self.INTEGER, deep) if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): return self.INTEGER else: - self.errors.append( - f'Invalid operation :{left.name} - {right.name}') + self.errors.append(f"Invalid operation :{left.name} - {right.name}") return self.INTEGER @visit.register - def _(self, - node: coolAst.DivNode, - scope: semantic.Scope, - infered_type=None, - deep=1): # noqa: F811 + def _( + self, node: coolAst.DivNode, scope: semantic.Scope, infered_type=None, deep=1 + ): left = self.visit(node.left, scope, self.INTEGER, deep) right = self.visit(node.right, scope, self.INTEGER, deep) if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): return self.INTEGER else: - self.errors.append( - f'Invalid operation :{left.name} / {right.name}') + self.errors.append(f"Invalid operation :{left.name} / {right.name}") return self.INTEGER @visit.register - def _(self, - node: coolAst.MulNode, - scope: semantic.Scope, - infered_type=None, - deep=1): # noqa: F811 + def _( + self, node: coolAst.MulNode, scope: semantic.Scope, infered_type=None, deep=1 + ): left = self.visit(node.left, scope, self.INTEGER, deep) right = self.visit(node.right, scope, self.INTEGER, deep) if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): return self.INTEGER else: - self.errors.append( - f'Invalid operation :{left.name} * {right.name}') + self.errors.append(f"Invalid operation :{left.name} * {right.name}") return self.INTEGER # -------------------------------------------------------------------------------------------# @@ -433,91 +430,90 @@ def _(self, # toda operación comparativa es BOOLEAN. | # --------------------------------------------------------------------------------------------- @visit.register - def _(self, - node: coolAst.GreaterThanNode, - scope: semantic.Scope, - infered_type=None, - deep=1): # noqa: F811 + def _( + self, + node: coolAst.GreaterThanNode, + scope: semantic.Scope, + infered_type=None, + deep=1, + ): left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append( - f'Invalid operation: {left.name} > {right.name}') + self.errors.append(f"Invalid operation: {left.name} > {right.name}") return self.BOOL @visit.register - def _(self, - node: coolAst.GreaterEqualNode, - scope: semantic.Scope, - infered_type=None, - deep=1): # noqa: F811 + def _( + self, + node: coolAst.GreaterEqualNode, + scope: semantic.Scope, + infered_type=None, + deep=1, + ): left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append( - f'Invalid operation: {left.name} >= {right.name}') + self.errors.append(f"Invalid operation: {left.name} >= {right.name}") return self.BOOL @visit.register - def _(self, - node: coolAst.LowerThanNode, - scope: semantic.Scope, - infered_type=None, - deep=1): # noqa: F811 + def _( + self, + node: coolAst.LowerThanNode, + scope: semantic.Scope, + infered_type=None, + deep=1, + ): left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append( - f'Invalid operation: {left.name} < {right.name}') + self.errors.append(f"Invalid operation: {left.name} < {right.name}") return self.BOOL @visit.register - def _(self, - node: coolAst.LowerEqual, - scope: semantic.Scope, - infered_type=None, - deep=1): # noqa: F811 + def _( + self, node: coolAst.LowerEqual, scope: semantic.Scope, infered_type=None, deep=1 + ): left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append( - f'Invalid operation: {left.name} <= {right.name}') + self.errors.append(f"Invalid operation: {left.name} <= {right.name}") return self.BOOL @visit.register - def _(self, - node: coolAst.EqualToNode, - scope: semantic.Scope, - infered_type=None, - deep=1) -> Type: + def _( + self, + node: coolAst.EqualToNode, + scope: semantic.Scope, + infered_type=None, + deep=1, + ) -> Type: left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append( - f'Invalid operation: {left.name} == {right.name}') + self.errors.append(f"Invalid operation: {left.name} == {right.name}") return self.BOOL @visit.register - def _(self, - node: coolAst.NegNode, - scope: semantic.Scope, - infered_type=None, - deep=1) -> Type: + def _( + self, node: coolAst.NegNode, scope: semantic.Scope, infered_type=None, deep=1 + ) -> Type: val_type = self.visit(node.lex, scope, infered_type, deep) if val_type == self.AUTO_TYPE or val_type == self.BOOL: return self.BOOL else: - self.errors.append(f'Invalid operation: ! {val_type.name}') + self.errors.append(f"Invalid operation: ! {val_type.name}") return self.BOOL # -----------------------------------------------------------------------------------------------------------------------# diff --git a/src/travels/typecollector.py b/src/travels/typecollector.py index 5c188791..5539bbb5 100755 --- a/src/travels/typecollector.py +++ b/src/travels/typecollector.py @@ -1,14 +1,27 @@ from typing import List import abstract.tree as coolAst -from abstract.semantics import IoType, Method, SelfType, SemanticError, Type, VoidType, IntegerType, StringType, ObjectType, Context, BoolType, AutoType +from abstract.semantics import ( + IoType, + Method, + SelfType, + SemanticError, + Type, + VoidType, + IntegerType, + StringType, + ObjectType, + Context, + BoolType, + AutoType, +) from functools import singledispatchmethod -BUILTINS = ('Int', 'Bool', 'Object', 'String', 'IO', 'AUTO_TYPE') +BUILTINS = ("Int", "Bool", "Object", "String", "IO", "AUTO_TYPE") def bootstrap_string(obj: StringType): def length() -> Method: - method_name = 'length' + method_name = "length" param_names = [] params_types = [] return_type = IntegerType() @@ -16,45 +29,45 @@ def length() -> Method: return Method(method_name, param_names, params_types, return_type) def concat() -> Method: - method_name = 'concat' - param_names = ['s'] + method_name = "concat" + param_names = ["s"] params_types: List[Type] = [StringType()] return_type = IntegerType() return Method(method_name, param_names, params_types, return_type) def substr() -> Method: - method_name = 'substr' - param_names = ['i', 'l'] + method_name = "substr" + param_names = ["i", "l"] params_types: List[Type] = [IntegerType(), IntegerType()] return_type = IntegerType() return Method(method_name, param_names, params_types, return_type) - obj.methods['length'] = length() - obj.methods['concat'] = concat() - obj.methods['substr'] = substr() + obj.methods["length"] = length() + obj.methods["concat"] = concat() + obj.methods["substr"] = substr() def bootstrap_io(io: IoType): def out_string() -> Method: method_name = "out_string" - param_names = ['x'] + param_names = ["x"] param_types: List[Type] = [StringType()] return_type = SelfType() return Method(method_name, param_names, param_types, return_type) def out_int() -> Method: - method_name = 'out_int' - param_names = ['x'] + method_name = "out_int" + param_names = ["x"] params_types: List[Type] = [IntegerType()] return_type = SelfType() return Method(method_name, param_names, params_types, return_type) def in_string() -> Method: - method_name = 'in_string' + method_name = "in_string" param_names = [] params_types = [] return_type = StringType() @@ -62,7 +75,7 @@ def in_string() -> Method: return Method(method_name, param_names, params_types, return_type) def in_int() -> Method: - method_name = 'in_int' + method_name = "in_int" param_names = [] params_types = [] return_type = IntegerType() @@ -70,15 +83,15 @@ def in_int() -> Method: return Method(method_name, param_names, params_types, return_type) # Crear el metodo out_string - io.methods['out_string'] = out_string() - io.methods['out_int'] = out_int() - io.methods['in_string'] = in_string() - io.methods['in_int'] = in_int() + io.methods["out_string"] = out_string() + io.methods["out_int"] = out_int() + io.methods["in_string"] = in_string() + io.methods["in_int"] = in_int() def bootstrap_object(obj: ObjectType): def abort() -> Method: - method_name = 'abort' + method_name = "abort" param_names = [] params_types = [] return_type = ObjectType() @@ -86,7 +99,7 @@ def abort() -> Method: return Method(method_name, param_names, params_types, return_type) def type_name() -> Method: - method_name = 'type_name' + method_name = "type_name" param_names = [] params_types = [] return_type = StringType() @@ -94,16 +107,16 @@ def type_name() -> Method: return Method(method_name, param_names, params_types, return_type) def copy() -> Method: - method_name = 'copy' + method_name = "copy" param_names = [] params_types = [] return_type = SelfType() return Method(method_name, param_names, params_types, return_type) - obj.methods['abort'] = abort() - obj.methods['type_name'] = type_name() - obj.methods['copy'] = copy() + obj.methods["abort"] = abort() + obj.methods["type_name"] = type_name() + obj.methods["copy"] = copy() class TypeCollector: @@ -118,8 +131,14 @@ def visit(self, node): @visit.register # type: ignore def _(self, node: coolAst.ProgramNode): # noqa: F811 self.context = Context() - OBJECT, INTEGER, STRING, BOOL, VOID, SELF_TYPE = ObjectType( - ), IntegerType(), StringType(), BoolType(), VoidType(), SelfType() + OBJECT, INTEGER, STRING, BOOL, VOID, SELF_TYPE = ( + ObjectType(), + IntegerType(), + StringType(), + BoolType(), + VoidType(), + SelfType(), + ) ioType = IoType() # Agregar los metodos builtin @@ -135,14 +154,14 @@ def _(self, node: coolAst.ProgramNode): # noqa: F811 # Agregar al objeto IO los metodos de OBJECT ioType.methods.update(OBJECT.methods) - self.context.types['Object'] = OBJECT - self.context.types['Int'] = INTEGER - self.context.types['String'] = STRING - self.context.types['Bool'] = BOOL - self.context.types['Void'] = VOID - self.context.types['AUTO_TYPE'] = AutoType() - self.context.types['IO'] = ioType - self.context.types['SELF_TYPE'] = SELF_TYPE + self.context.types["Object"] = OBJECT + self.context.types["Int"] = INTEGER + self.context.types["String"] = STRING + self.context.types["Bool"] = BOOL + self.context.types["Void"] = VOID + self.context.types["AUTO_TYPE"] = AutoType() + self.context.types["IO"] = ioType + self.context.types["SELF_TYPE"] = SELF_TYPE for class_ in node.class_list: self.visit(class_) From 76a3dd105684900cc72918ac5ba4ddc387d22789 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 26 Nov 2020 11:06:18 -0500 Subject: [PATCH 108/162] Implement line and columns for class features. Change Grammar to allow empty classes --- src/.builds | 7 + src/abstract/semantics.py | 22 +-- src/abstract/tree.py | 52 +++--- src/coolgrammar/grammar.py | 327 ++++++++++++++++++++++++------------- src/makefile | 1 - src/testing.py | 43 ++--- src/tknizer.py | 29 ++-- src/travels/typebuilder.py | 4 +- src/typecheck/evaluator.py | 8 +- 9 files changed, 298 insertions(+), 195 deletions(-) diff --git a/src/.builds b/src/.builds index ca2727cd..5f89e314 100644 --- a/src/.builds +++ b/src/.builds @@ -129,3 +129,10 @@ 1 1 1 +1 +1 +1 +1 +1 +1 +1 diff --git a/src/abstract/semantics.py b/src/abstract/semantics.py index f86fd696..61930405 100755 --- a/src/abstract/semantics.py +++ b/src/abstract/semantics.py @@ -10,15 +10,17 @@ def text(self): class Type: - def __init__(self, name: str): + def __init__(self, name: str, line=0, column=0): self.name = name self.attributes: List[Attribute] = [] self.methods: Dict[str, Method] = {} self.parent: Optional[Type] = None + self.line = line + self.column = column - len(self.name) def set_parent(self, parent) -> None: if self.parent is not None: - raise SemanticError(f'Parent type is already set for {self.name}.') + raise SemanticError(f'({self.line}, {self.column}) - SemanticError: Parent type is already set for {self.name}.') self.parent = parent def get_attribute(self, name): @@ -27,14 +29,14 @@ def get_attribute(self, name): except StopIteration: if self.parent is None: raise SemanticError( - f'Attribute "{name}" is not defined in {self.name}.') + f'({self.line}, {self.column}) - SemanticError: Attribute "{name}" is not defined in {self.name}.') try: return self.parent.get_attribute(name) except SemanticError: raise SemanticError( - f'Attribute "{name}" is not defined in {self.name}.') + f'({self.line}, {self.column}) - SemanticError: Attribute "{name}" is not defined in {self.name}.') - def define_attribute(self, name, typex): + def define_attribute(self, name, typex, line, column): try: self.get_attribute(name) except SemanticError: @@ -43,7 +45,7 @@ def define_attribute(self, name, typex): return attribute else: raise SemanticError( - f'Attribute "{name}" is already defined in {self.name}.') + f'({line}, {column}) - SemanticError: Attribute "{name}" is already defined in {self.name}.') def get_method(self, name): try: @@ -51,17 +53,17 @@ def get_method(self, name): except KeyError: if self.parent is None: raise SemanticError( - f'Method "{name}" is not defined in {self.name}.') + f'({self.line}, {self.column}) - SemanticError: Method "{name}" is not defined in {self.name}.') try: return self.parent.get_method(name) except SemanticError: raise SemanticError( - f'Method "{name}" is not defined in {self.name}.') + f'({self.line}, {self.column}) - SemanticError: Method "{name}" is not defined in {self.name}.') - def define_method(self, name, param_names, param_types, return_type): + def define_method(self, name, param_names, param_types, return_type, line, column): if name in self.methods: raise SemanticError( - f'Method "{name}" already defined in {self.name}.') + f'({line}, {column}) - SemanticError: Method "{name}" already defined in {self.name}.') method = self.methods[name] = Method(name, param_names, param_types, return_type) diff --git a/src/abstract/tree.py b/src/abstract/tree.py index 6c6714b3..a758fd56 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -21,33 +21,33 @@ def __init__(self, class_list): def check_semantics(self, deep=1): from travels import typecollector, typebuilder, inference + # recolectar los tipos type_collector = typecollector.TypeCollector() type_collector.visit(self) # Construir los tipos detectados en el contexto assert type_collector.context is not None - type_builder = typebuilder.TypeBuilder(type_collector.context, - type_collector.errors) + type_builder = typebuilder.TypeBuilder( + type_collector.context, type_collector.errors + ) type_builder.visit(self) # Garantizar que exista un tipo Main que contenga un # metodo main context = type_builder.context try: - context.get_type('Main') - context.get_type('Main').methods['main'] + context.get_type("Main") + context.get_type("Main").methods["main"] except SemanticError as e: type_builder.errors.append(str(e)) except KeyError: - type_builder.errors.append( - f"Main class must contain a main method.") + type_builder.errors.append(f"Main class must contain a main method.") errors = type_builder.errors scope = None if not errors: - inferer = inference.TypeInferer(type_builder.context, - errors=errors) + inferer = inference.TypeInferer(type_builder.context, errors=errors) for d in range(1, deep + 1): scope = inferer.visit(self, scope=scope, deep=d) # reportar los errores @@ -60,25 +60,35 @@ def __init__(self, idx, typex): class MethodDef(DeclarationNode): - def __init__(self, idx: str, param_list: List[Param], return_type: str, - statements: List[ExpressionNode]): + def __init__( + self, + idx: str, + param_list: List[Param], + return_type: str, + line, + column, + statements: List[ExpressionNode], + ): self.idx: str = idx self.param_list: List[Param] = param_list self.return_type: str = return_type self.statements: List[ExpressionNode] = statements + self.line = line + self.column = column - len(self.idx) class AttributeDef(DeclarationNode): - def __init__(self, idx: str, typex: str, default_value=None): + def __init__(self, idx: str, typex: str, line, column, default_value=None): self.idx: str = idx self.typex: str = typex self.default_value: Optional[ExpressionNode] = default_value + self.line = line + self.column = column - len(idx) class VariableDeclaration(ExpressionNode): def __init__(self, var_list, block_statements=None): - self.var_list: List[Tuple[str, str, - Optional[ExpressionNode]]] = var_list + self.var_list: List[Tuple[str, str, Optional[ExpressionNode]]] = var_list self.block_statements: Optional[ExpressionNode] = block_statements @@ -158,41 +168,41 @@ def __init__(self, lex): class BoleanNode(TypeNode): def __init__(self, val): - self.val = True if val == 'true' else False + self.val = True if val == "true" else False class FalseConstant(AtomicNode): def __init__(self): - super(FalseConstant, self).__init__('False') + super(FalseConstant, self).__init__("False") class TrueConstant(AtomicNode): def __init__(self): - super(TrueConstant, self).__init__('True') + super(TrueConstant, self).__init__("True") class StringTypeNode(TypeNode): def __init__(self): - super(StringTypeNode, self).__init__('String') + super(StringTypeNode, self).__init__("String") class IntegerTypeNode(TypeNode): def __init__(self): - super(IntegerTypeNode, self).__init__('Int') + super(IntegerTypeNode, self).__init__("Int") class ObjectTypeNode(TypeNode): def __init__(self): - super(ObjectTypeNode, self).__init__('Object') + super(ObjectTypeNode, self).__init__("Object") class VoidTypeNode(TypeNode): def __init__(self): - super(VoidTypeNode, self).__init__('Void') + super(VoidTypeNode, self).__init__("Void") class ClassDef(DeclarationNode): - def __init__(self, idx, features, parent='Object'): + def __init__(self, idx, features, parent="Object"): self.idx: str = idx self.features: List[Union[MethodDef, AttributeDef]] = features self.parent: str = parent diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index cff10921..d4f4a338 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -1,56 +1,112 @@ -''' +""" Contenedor para la funcion que construye la gramatica de cool. -''' +""" from grammar.grammar import Grammar -from abstract.tree import ProgramNode, ClassDef, MethodDef, AttributeDef, Param, SelfNode, VariableDeclaration +from abstract.tree import ( + ProgramNode, + ClassDef, + MethodDef, + AttributeDef, + Param, + SelfNode, + VariableDeclaration, +) from abstract.tree import PlusNode, DivNode, MulNode, DifNode, IntegerConstant, FunCall from abstract.tree import VariableCall, FalseConstant, StringConstant, TrueConstant -from abstract.tree import GreaterEqualNode, LowerThanNode, LowerEqual, AssignNode, IfThenElseNode +from abstract.tree import ( + GreaterEqualNode, + LowerThanNode, + LowerEqual, + AssignNode, + IfThenElseNode, +) from abstract.tree import NotNode, WhileBlockNode, EqualToNode, InstantiateClassNode from abstract.tree import ActionNode, CaseNode, ParentFuncCall, BlockNode, IsVoidNode from abstract.tree import NegNode + # from lexer.tokenizer import Lexer from tknizer import Tokenizer def build_cool_grammar(): G = Grammar() - program = G.NonTerminal('', True) - - class_list, class_def, empty_feature_list, feature_list, meod_def = G.NonTerminals(' ') - - attr_def, param_list, param, statement_list = G.NonTerminals(' ') - - var_dec, args_list, instantiation = G.NonTerminals(' ') - - exp, typex, term, factor, nested_lets, loop_statements = G.NonTerminals(' ') - - arith, atom, actions, action, block = G.NonTerminals(' ') - - args_list_empty, param_list_empty, case_statement, string_const = G.NonTerminals(' ') - - class_keyword, def_keyword, in_keyword = G.Terminals('class def in') - - coma, period, dot_comma, opar, cpar, obrack, cbrack, plus, minus, star, div, dd = G.Terminals(', . ; ( ) { } + - * / :') - - idx, let, intx, string, num, true, false, boolean, objectx, classid = G.Terminals('id let int string num true false bool object classid') - - tilde_string_const, quoted_string_const, void, auto = G.Terminals('tilde_string_const quoted_string_const void AUTO_TYPE') - - if_, then, else_, assign, new, case, of, esac = G.Terminals('if then else assign new case of esac') - - gt, lt, ge, le, eq, not_, implies, isvoid, not_operator = G.Terminals('> < >= <= = ~ => isvoid not') - - while_, do, inherits, arroba, fi, pool, loop = G.Terminals('while do inherits @ fi pool loop') + program = G.NonTerminal("", True) + + class_list, class_def, empty_feature_list, feature_list, meod_def = G.NonTerminals( + " " + ) + + attr_def, param_list, param, statement_list = G.NonTerminals( + " " + ) + + var_dec, args_list, instantiation = G.NonTerminals( + " " + ) + + exp, typex, term, factor, nested_lets, loop_statements = G.NonTerminals( + " " + ) + + arith, atom, actions, action, block = G.NonTerminals( + " " + ) + + args_list_empty, param_list_empty, case_statement, string_const = G.NonTerminals( + " " + ) + + class_keyword, def_keyword, in_keyword = G.Terminals("class def in") + + ( + coma, + period, + dot_comma, + opar, + cpar, + obrack, + cbrack, + plus, + minus, + star, + div, + dd, + ) = G.Terminals(", . ; ( ) { } + - * / :") + + idx, let, intx, string, num, true, false, boolean, objectx, classid = G.Terminals( + "id let int string num true false bool object classid" + ) + + tilde_string_const, quoted_string_const, void, auto = G.Terminals( + "tilde_string_const quoted_string_const void AUTO_TYPE" + ) + + if_, then, else_, assign, new, case, of, esac = G.Terminals( + "if then else assign new case of esac" + ) + + gt, lt, ge, le, eq, not_, implies, isvoid, not_operator = G.Terminals( + "> < >= <= = ~ => isvoid not" + ) + + while_, do, inherits, arroba, fi, pool, loop = G.Terminals( + "while do inherits @ fi pool loop" + ) program %= class_list, lambda s: ProgramNode(s[1]) class_list %= class_def + dot_comma, lambda s: [s[1]] class_list %= class_def + dot_comma + class_list, lambda s: [s[1]] + s[3] - class_def %= class_keyword + classid + obrack + feature_list + cbrack, lambda s: ClassDef(s[2], s[4]) + class_def %= ( + class_keyword + classid + obrack + empty_feature_list + cbrack, + lambda s: ClassDef(s[2].lex, s[4]), + ) - class_def %= class_keyword + classid + inherits + typex + obrack + feature_list + cbrack, lambda s: ClassDef(s[2], s[6], s[4]) + class_def %= ( + class_keyword + classid + inherits + typex + obrack + empty_feature_list + cbrack, + lambda s: ClassDef(s[2].lex, s[6], s[4]), + ) feature_list %= meod_def + dot_comma, lambda s: [s[1]] @@ -60,11 +116,31 @@ def build_cool_grammar(): feature_list %= attr_def + dot_comma + feature_list, lambda s: [s[1]] + s[3] - meod_def %= idx + opar + param_list_empty + cpar + dd + typex + obrack + statement_list + cbrack , lambda s: MethodDef(s[1], s[3], s[6], s[8]) - - attr_def %= idx + dd + typex, lambda s: AttributeDef(s[1], s[3]) - - attr_def %= idx + dd + typex + assign + exp, lambda s: AttributeDef(s[1], s[3], s[5]) + empty_feature_list %= G.Epsilon, lambda s: [] + empty_feature_list %= feature_list, lambda s: s[1] + + meod_def %= ( + idx + + opar + + param_list_empty + + cpar + + dd + + typex + + obrack + + statement_list + + cbrack, + lambda s: MethodDef( + s[1].lex, s[3], s[6], s[1].token_line, s[1].token_column, s[8] + ), + ) + + attr_def %= idx + dd + typex, lambda s: AttributeDef( + s[1].lex, s[3], s[1].token_line, s[1].token_column + ) + + attr_def %= idx + dd + typex + assign + exp, lambda s: AttributeDef( + s[1].lex, s[3], s[1].token_line, s[1].token_column, s[5] + ) param_list_empty %= param_list, lambda s: s[1] param_list_empty %= G.Epsilon, lambda s: [] @@ -72,43 +148,54 @@ def build_cool_grammar(): param_list %= param, lambda s: [s[1]] param_list %= param + coma + param_list, lambda s: [s[1]] + s[3] - param %= idx + dd + typex, lambda s: Param(s[1], s[3]) + param %= idx + dd + typex, lambda s: Param(s[1].lex, s[3]) statement_list %= exp, lambda s: s[1] # statement_list %= exp + dot_comma + statement_list, lambda s: [s[1]] + s[3] - var_dec %= let + nested_lets + in_keyword + exp, lambda s: VariableDeclaration(s[2], s[4]) + var_dec %= let + nested_lets + in_keyword + exp, lambda s: VariableDeclaration( + s[2], s[4] + ) - nested_lets %= idx + dd + typex, lambda s: [(s[1], s[3], None)] + nested_lets %= idx + dd + typex, lambda s: [(s[1].lex, s[3], None)] - nested_lets %= idx + dd + typex + coma + nested_lets, lambda s: [(s[1], s[3], None)] + s[5] + nested_lets %= ( + idx + dd + typex + coma + nested_lets, + lambda s: [(s[1].lex, s[3], None)] + s[5], + ) - nested_lets %= idx + dd + typex + assign + exp, lambda s: [(s[1], s[3], s[5])] + nested_lets %= idx + dd + typex + assign + exp, lambda s: [ + (s[1].lex, s[3], s[5]) + ] - nested_lets %= idx + dd + typex + assign + exp + coma + nested_lets, lambda s: [(s[1], s[3], s[5])] + s[7] + nested_lets %= ( + idx + dd + typex + assign + exp + coma + nested_lets, + lambda s: [(s[1].lex, s[3], s[5])] + s[7], + ) exp %= var_dec, lambda s: s[1] - string_const %= quoted_string_const, lambda s: StringConstant(s[1]) + string_const %= quoted_string_const, lambda s: StringConstant(s[1].lex) - string_const %= tilde_string_const, lambda s: StringConstant(s[1]) + string_const %= tilde_string_const, lambda s: StringConstant(s[1].lex) instantiation %= new + typex, lambda s: InstantiateClassNode(s[2], []) loop_statements %= exp + dot_comma, lambda s: [s[1]] loop_statements %= exp + dot_comma + loop_statements, lambda s: [s[1]] + s[3] - exp %= idx + assign + exp, lambda s: AssignNode(s[1], s[3]) + exp %= idx + assign + exp, lambda s: AssignNode(s[1].lex, s[3]) exp %= while_ + exp + loop + statement_list + pool, lambda s: WhileBlockNode( - s[2], s[4]) + s[2], s[4] + ) exp %= atom, lambda s: s[1] - #exp %= opar + atom + cpar, lambda s: s[2] + # exp %= opar + atom + cpar, lambda s: s[2] - #exp %= arith, lambda s: s[1] + # exp %= arith, lambda s: s[1] exp %= block, lambda s: s[1] @@ -134,24 +221,32 @@ def build_cool_grammar(): term %= not_operator + factor, lambda s: NegNode(s[2]) - factor %= if_ + exp + then + exp + else_ + exp + fi, lambda s: IfThenElseNode(s[2], s[4], s[6]) + factor %= if_ + exp + then + exp + else_ + exp + fi, lambda s: IfThenElseNode( + s[2], s[4], s[6] + ) factor %= opar + atom + cpar, lambda s: s[2] - factor %= num, lambda s: IntegerConstant(s[1]) + factor %= num, lambda s: IntegerConstant(s[1].lex) - factor %= idx, lambda s: VariableCall(s[1]) + factor %= idx, lambda s: VariableCall(s[1].lex) factor %= true, lambda s: TrueConstant() - factor %= factor + period + idx + opar + args_list_empty + cpar, lambda s: FunCall(s[1], s[3], s[5]) + factor %= factor + period + idx + opar + args_list_empty + cpar, lambda s: FunCall( + s[1], s[3].lex, s[5] + ) factor %= string_const, lambda s: s[1] factor %= idx + opar + args_list_empty + cpar, lambda s: FunCall( - SelfNode(), s[1], s[3]) + SelfNode(), s[1].lex, s[3] + ) - factor %= factor + arroba + typex + period + idx + opar + args_list_empty + cpar, lambda s: ParentFuncCall(s[1], s[3], s[5], s[7]) + factor %= ( + factor + arroba + typex + period + idx + opar + args_list_empty + cpar, + lambda s: ParentFuncCall(s[1], s[3], s[5].lex, s[7]), + ) factor %= false, lambda s: FalseConstant() @@ -167,19 +262,19 @@ def build_cool_grammar(): atom %= arith, lambda s: s[1] - typex %= intx, lambda s: 'Int' + typex %= intx, lambda s: "Int" - typex %= boolean, lambda s: 'Bool' + typex %= boolean, lambda s: "Bool" - typex %= string, lambda s: 'String' + typex %= string, lambda s: "String" - typex %= objectx, lambda s: 'Object' + typex %= objectx, lambda s: "Object" - typex %= classid, lambda s: s[1] + typex %= classid, lambda s: s[1].lex - typex %= auto, lambda s: 'AUTO_TYPE' + typex %= auto, lambda s: "AUTO_TYPE" - typex %= void, lambda s: 'Void' + typex %= void, lambda s: "Void" args_list_empty %= args_list, lambda s: s[1] @@ -193,65 +288,67 @@ def build_cool_grammar(): actions %= action + actions, lambda s: [s[1]] + s[2] - action %= idx + dd + typex + implies + exp + dot_comma, lambda s: ActionNode(s[1], s[3], s[5]) + action %= idx + dd + typex + implies + exp + dot_comma, lambda s: ActionNode( + s[1].lex, s[3], s[5] + ) case_statement %= case + exp + of + actions + esac, lambda s: CaseNode(s[2], s[4]) table = [ - (class_keyword, r'(?i)class'), - (def_keyword, r'(?i)def'), - (in_keyword, r'(?i)in'), - (intx, r'Int'), - (boolean, r'Bool'), - (objectx, r'Object'), - (string, r'String'), - (true, r'true'), - (false, r'false'), - (auto, r'AUTO_TYPE'), - (if_, r'(?i)if'), - (then, r'(?i)then'), - (else_, r'(?i)else'), - (new, r'(?i)new'), - (while_, r'(?i)while'), - (do, r'(?i)do'), - (esac, r'(?i)esac'), - (case, r'(?i)case'), - (of, r'(?i)of'), - (inherits, r'(?i)inherits'), - (coma, r','), - (period, r'\.'), - (dd, r'\:'), - (dot_comma, r';'), - (arroba, r'@'), - (assign, r'<-'), - (not_operator, r'(?i)not'), - (lt, r'<'), - (gt, r'>'), - (ge, r'>='), - (le, r'<='), - (eq, r'='), - (not_, r'\~'), - (opar, r'\('), - (cpar, r'\)'), - (obrack, r'\{'), - (cbrack, r'\}'), - (plus, r'\+'), - (minus, r'\-'), - (implies, r'=>'), - (div, '/'), - (star, r'\*'), - (let, r'(?i) let'), - (fi, r'(?i)fi'), - (pool, r'(?i)pool'), - (loop, r'(?i)loop'), - (isvoid, r'(?i)isvoid'), - (idx, r'[a-z]\w*'), - (num, r'\d+'), + (class_keyword, r"(?i)class"), + (def_keyword, r"(?i)def"), + (in_keyword, r"(?i)in"), + (intx, r"Int"), + (boolean, r"Bool"), + (objectx, r"Object"), + (string, r"String"), + (true, r"true"), + (false, r"false"), + (auto, r"AUTO_TYPE"), + (if_, r"(?i)if"), + (then, r"(?i)then"), + (else_, r"(?i)else"), + (new, r"(?i)new"), + (while_, r"(?i)while"), + (do, r"(?i)do"), + (esac, r"(?i)esac"), + (case, r"(?i)case"), + (of, r"(?i)of"), + (inherits, r"(?i)inherits"), + (coma, r","), + (period, r"\."), + (dd, r"\:"), + (dot_comma, r";"), + (arroba, r"@"), + (assign, r"<-"), + (not_operator, r"(?i)not"), + (lt, r"<"), + (gt, r">"), + (ge, r">="), + (le, r"<="), + (eq, r"="), + (not_, r"\~"), + (opar, r"\("), + (cpar, r"\)"), + (obrack, r"\{"), + (cbrack, r"\}"), + (plus, r"\+"), + (minus, r"\-"), + (implies, r"=>"), + (div, "/"), + (star, r"\*"), + (let, r"(?i) let"), + (fi, r"(?i)fi"), + (pool, r"(?i)pool"), + (loop, r"(?i)loop"), + (isvoid, r"(?i)isvoid"), + (idx, r"[a-z]\w*"), + (num, r"\d+"), (tilde_string_const, r"('(?:[^'\\]|\\'|\\|\\\n)*')"), (quoted_string_const, r'("(?:[^\n"\\]|\\"|\\|\\\n)*")'), - (classid, r'[A-Z]\w*'), + (classid, r"[A-Z]\w*"), ("StringError", r'("(?:[^"\\]|\\|\\"|\\\n)*\n)'), - ("StringEOF", r'("(?:[^\n"\\]|\\\n|\\"|\\)*)') + ("StringEOF", r'("(?:[^\n"\\]|\\\n|\\"|\\)*)'), ] lexer = Tokenizer(table, G.EOF) return G, lexer diff --git a/src/makefile b/src/makefile index 6f0d822b..394c6346 100644 --- a/src/makefile +++ b/src/makefile @@ -32,7 +32,6 @@ main: @echo "[*] Installing python dependencies" @$(PIP) install $(PIPREQUIREMENTS) @echo "[*] Compiling Cool Lexical structures" - @mkdir build @touch build/$(COMPSTRUCTFILE) @$(PYTHON) install.py build/$(COMPSTRUCTFILE) @touch build/__init__.py diff --git a/src/testing.py b/src/testing.py index 6ac78a3e..136ea7b6 100755 --- a/src/testing.py +++ b/src/testing.py @@ -8,7 +8,7 @@ def report(errors: list): - for error in errors: + for error in set(errors): print(error) @@ -60,35 +60,22 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r""" +text = r"""(* +The comparison = is a special +case. If either or has static type Int, Bool, or String, then the other must have the +same static type. Any other types, including SELF TYPE, may be freely compared. +*) + +class A { }; +class B inherits A { }; + class Main inherits IO { - -- the class has features. Only methods in this case. - main(): Object { - { - out_string("Enter n to find nth fibonacci number!\n"); - out_int(fib(in_int())); - out_string("\n"); - } - }; + main(): IO { out_string("Hello World!")}; - fib(i : Int) : Int { -- list of formals. And the return type of the method. - let a : Int <- 1, - b : Int <- 0, - c : Int <- 0 - in - { - while (not (i = 0)) loop -- expressions are nested. - { - c <- a + b; - i <- i - 1; - b <- a; - a <- c; - } - pool; - c; - } - }; + x: Bool <- 1 = 2; + y: Bool <- "1" = "2"; + test: Bool <- "1" = new B; + z: Bool <- true = not false; }; - """ pipeline(text, 5) diff --git a/src/tknizer.py b/src/tknizer.py index 16ccd90d..72624b58 100644 --- a/src/tknizer.py +++ b/src/tknizer.py @@ -16,15 +16,15 @@ def __init__(self, regex_table: List[RegexTypes], eof: EOF): def _build_regexs(self, regex_table): regexs = regex_table - fixed_line_token = '\n' - fixed_space_token = ' ' + fixed_line_token = "\n" + fixed_space_token = " " regexs.append(("Line", fixed_line_token)) regexs.append(("Space", fixed_space_token)) return regexs def _walk(self, string: str): - matched_suffix = '' + matched_suffix = "" tt = None for token_type, regex in self.regexs: @@ -44,8 +44,9 @@ def _tokenize(self, text): if token_type is None: next_token = string.split()[0] raise SyntaxError( - f'({self.line},{self.column}) - LexicographicError: Unexpected Token %s' - % next_token) + f"({self.line},{self.column}) - LexicographicError: Unexpected Token %s" + % next_token + ) elif token_type in ("StringError", "StringEOF"): newlines = re.split(r"\\\n|\n", suffix.strip()) if len(newlines) > 1: @@ -54,7 +55,7 @@ def _tokenize(self, text): else: self.column += len(newlines[0]) raise SyntaxError( - f'({self.line},{self.column}) - LexicographicError: {token_type} {suffix}' + f"({self.line},{self.column}) - LexicographicError: {token_type} {suffix}" ) elif token_type == "Line": self.column = 1 @@ -62,14 +63,16 @@ def _tokenize(self, text): elif token_type == "Space": self.column += 1 elif isinstance(token_type, Terminal) and token_type.Name in ( - "quoted_string_const", "tilde_string_const"): - if '\0' in suffix: + "quoted_string_const", + "tilde_string_const", + ): + if "\0" in suffix: newlines = re.split(r"\\\n", suffix) for line in newlines: - if '\0' in line: - self.column = line.index('\0') + 1 + if "\0" in line: + self.column = line.index("\0") + 1 raise SyntaxError( - f'({self.line},{self.column}) - LexicographicError: String contains null character' + f"({self.line},{self.column}) - LexicographicError: String contains null character" ) newlines += 1 # Strings may have some troubles with rows and columns @@ -86,8 +89,8 @@ def _tokenize(self, text): else: self.column += len(suffix) yield suffix, token_type - text = text[len(suffix):] - yield '$', self.eof + text = text[len(suffix) :] + yield "$", self.eof def __call__(self, text): tokens = [] diff --git a/src/travels/typebuilder.py b/src/travels/typebuilder.py index 90ee8d25..0912d7de 100755 --- a/src/travels/typebuilder.py +++ b/src/travels/typebuilder.py @@ -59,7 +59,7 @@ def _(self, node: coolAst.AttributeDef): node.typex, str) else node.typex # Definir el atributo en el tipo actual - self.current_type.define_attribute(node.idx, attr_type) + self.current_type.define_attribute(node.idx, attr_type, node.line, node.column) except SemanticError as e: self.errors.append(e.text) @@ -78,7 +78,7 @@ def _(self, node: coolAst.MethodDef): str) else node.return_type try: self.current_type.define_method(node.idx, params, - params_type, return_type) + params_type, return_type, node.line, node.column) except SemanticError as e: self.errors.append(e.text) diff --git a/src/typecheck/evaluator.py b/src/typecheck/evaluator.py index 11b62f4a..a9c7cc9c 100755 --- a/src/typecheck/evaluator.py +++ b/src/typecheck/evaluator.py @@ -1,6 +1,3 @@ -from typing import Iterable, Any - - def evaluate_right_parse(parse, tokens): def evaluate_production(productions, production, tokens): synteticed = [None] * (len(production.Right) + 1) @@ -10,10 +7,11 @@ def evaluate_production(productions, production, tokens): for i, symbol in enumerate(production.Right[::-1], 1): if symbol.IsTerminal: - synteticed[len(synteticed) - i] = next(tokens).lex + synteticed[len(synteticed) - i] = next(tokens) else: synteticed[len(synteticed) - i] = evaluate_production( - productions, next(productions), tokens) + productions, next(productions), tokens + ) rule = rules[0] return rule(synteticed) if rule else None From 308e932e5c36e9f5dc4f5f9a7b5ea14caf9339a6 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 26 Nov 2020 17:44:56 -0500 Subject: [PATCH 109/162] Change errors to SemanticErrors in Inferer --- src/.builds | 8 +++ src/abstract/tree.py | 73 ++++++++++++-------- src/comments.py | 51 ++++++++------ src/coolgrammar/grammar.py | 44 ++++++------ src/lexer/tokens.py | 2 +- src/testing.py | 13 ++-- src/tknizer.py | 2 +- src/travels/inference.py | 125 ++++++++++++++++++++++++++--------- src/travels/typecollector.py | 18 ++--- 9 files changed, 220 insertions(+), 116 deletions(-) diff --git a/src/.builds b/src/.builds index 5f89e314..d9fb3c8f 100644 --- a/src/.builds +++ b/src/.builds @@ -136,3 +136,11 @@ 1 1 1 +1 +1 +1 +1 +1 +1 +1 +1 diff --git a/src/abstract/tree.py b/src/abstract/tree.py index a758fd56..bd544a20 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -1,3 +1,4 @@ +from __future__ import annotations from typing import List, Optional, Tuple, Union from abstract.semantics import SemanticError @@ -47,16 +48,24 @@ def check_semantics(self, deep=1): errors = type_builder.errors scope = None if not errors: - inferer = inference.TypeInferer(type_builder.context, errors=errors) - for d in range(1, deep + 1): - scope = inferer.visit(self, scope=scope, deep=d) + try: + inferer = inference.TypeInferer(type_builder.context, errors=errors) + for d in range(1, deep + 1): + scope = inferer.visit(self, scope=scope, deep=d) + except SemanticError as e: + errors.append(e.text) # reportar los errores return errors, type_builder.context, scope class Param(DeclarationNode): - def __init__(self, idx, typex): + def __init__(self, idx, typex, line, column): self.id, self.type = idx, typex + self.line = line + self.column = column - len(idx) + + def __eq__(self, o: Param) -> bool: + return self.id == o.id class MethodDef(DeclarationNode): @@ -93,9 +102,11 @@ def __init__(self, var_list, block_statements=None): class BinaryNode(ExpressionNode): - def __init__(self, left, right): + def __init__(self, left, right, line, column): self.left: ExpressionNode = left self.right: ExpressionNode = right + self.line = line + self.column = column class AtomicNode(ExpressionNode): @@ -111,30 +122,32 @@ def __init__(self, cond, expr1, expr2): class PlusNode(BinaryNode): - def __init__(self, left, right): - super(PlusNode, self).__init__(left, right) + def __init__(self, left, right, line, column): + super(PlusNode, self).__init__(left, right, line, column) class DifNode(BinaryNode): - def __init__(self, left, right): - super(DifNode, self).__init__(left, right) + def __init__(self, left, right, line, column): + super(DifNode, self).__init__(left, right, line, column) class MulNode(BinaryNode): - def __init__(self, left, right): - super(MulNode, self).__init__(left, right) + def __init__(self, left, right, line, column): + super(MulNode, self).__init__(left, right, line, column) class DivNode(BinaryNode): - def __init__(self, left, right): - super(DivNode, self).__init__(left, right) + def __init__(self, left, right, line, column): + super(DivNode, self).__init__(left, right, line, column) class FunCall(ExpressionNode): - def __init__(self, obj, idx, arg_list): + def __init__(self, obj, idx, arg_list, line, column): self.obj: Union[str, ExpressionNode] = obj self.id: str = idx self.args: List[ExpressionNode] = arg_list + self.line = line + self.column = column - len(idx) class ParentFuncCall(ExpressionNode): @@ -146,9 +159,11 @@ def __init__(self, obj, parent_type, idx, arg_list): class AssignNode(ExpressionNode): - def __init__(self, idx, expr): + def __init__(self, idx, expr, line, column): self.idx: str = idx self.expr: ExpressionNode = expr + self.line = line + self.column = column - len(idx) class IntegerConstant(AtomicNode): @@ -202,40 +217,44 @@ def __init__(self): class ClassDef(DeclarationNode): - def __init__(self, idx, features, parent="Object"): + def __init__(self, idx, features, line, colum, parent="Object"): self.idx: str = idx self.features: List[Union[MethodDef, AttributeDef]] = features self.parent: str = parent + self.line = line + self.column = colum - len(idx) class VariableCall(ExpressionNode): - def __init__(self, idx): + def __init__(self, idx, line, column): self.idx: str = idx + self.line = line + self.column = column - len(idx) class GreaterThanNode(BinaryNode): - def __init__(self, left, right): - super(GreaterThanNode, self).__init__(left, right) + def __init__(self, left, right, line, column): + super(GreaterThanNode, self).__init__(left, right, line, column) class LowerThanNode(BinaryNode): - def __init__(self, left, right): - super(LowerThanNode, self).__init__(left, right) + def __init__(self, left, right, line, column): + super(LowerThanNode, self).__init__(left, right, line, column) class EqualToNode(BinaryNode): - def __init__(self, left, right): - super().__init__(left, right) + def __init__(self, left, right, line, column): + super().__init__(left, right, line, column) class LowerEqual(BinaryNode): - def __init__(self, left, right): - super().__init__(left, right) + def __init__(self, left, right, line, column): + super().__init__(left, right, line, column) class GreaterEqualNode(BinaryNode): - def __init__(self, left, right): - super().__init__(left, right) + def __init__(self, left, right, line, column): + super().__init__(left, right, line, column) class NotNode(AtomicNode): diff --git a/src/comments.py b/src/comments.py index f92d2ce4..fab2c85c 100644 --- a/src/comments.py +++ b/src/comments.py @@ -1,14 +1,15 @@ from typing import Any -''' + +""" Process a source file removing coments. Because coments in COOL can be nested, there is no regular expresion to represet them, so we have to preprocess the file and strip them out. -''' +""" def find_comments(program: Any) -> str: - ''' + """ This functions detects every comment in a Cool program\ and replace it with empty lines. This is done in a way\ so is posible for the other components of the\ @@ -17,7 +18,7 @@ def find_comments(program: Any) -> str: In Cool a comment can be of the form (*...*) or -- ending\ with a newline. Comments can be nested, so there is no regular\ expression to detect them. - ''' + """ pairs = [] stack = [] line = 1 @@ -28,30 +29,29 @@ def find_comments(program: Any) -> str: try: i, char = next(iter_char) column += 1 - if char == '\n': + if char == "\n": line += 1 column = 1 - elif char == '(': + elif char == "(": i, char = next(iter_char) column += 1 - if char == '*': + if char == "*": stack.append(i - 1) - elif char == '\n': + elif char == "\n": line += 1 column = 1 - elif char == '*': + elif char == "*": i, char = next(iter_char) column += 1 - if char == ')': + if char == ")": first = stack.pop() pairs.append((first, i)) - elif char == '\n': + elif char == "\n": line += 1 column = 1 except StopIteration: break - assert not stack, "(%d, %d) - LexicographicError: EOF in comment" % ( - line, column) + assert not stack, "(%d, %d) - LexicographicError: EOF in comment" % (line, column) iter_char = iter(enumerate(program)) column = 1 line = 1 @@ -59,18 +59,29 @@ def find_comments(program: Any) -> str: try: i, char = next(iter_char) column += 1 - if char == '-' and i > 0 and program[i - 1] != '<': + if char == "-" and i > 0 and program[i - 1] != "<": + i, char = next(iter_char) + column += 1 + if char == "-": + stack.append(i - 1) + elif char == "\n": + if stack: + first = stack.pop() + pairs.append((first, i)) + column = 1 + line += 1 + elif char == '-' and i == 0: i, char = next(iter_char) column += 1 - if char == '-': + if char == "-": stack.append(i - 1) - elif char == '\n': + elif char == "\n": if stack: first = stack.pop() pairs.append((first, i)) column = 1 line += 1 - elif char == '\n': + elif char == "\n": if stack: first = stack.pop() pairs.append((first, i)) @@ -81,6 +92,6 @@ def find_comments(program: Any) -> str: while pairs: i, j = pairs.pop() for k in range(i, j + 1): - if not program[k] == '\n': - program[k] = ' ' - return ''.join(program) + if not program[k] == "\n": + program[k] = " " + return "".join(program) diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index d4f4a338..b95661c0 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -100,12 +100,18 @@ def build_cool_grammar(): class_def %= ( class_keyword + classid + obrack + empty_feature_list + cbrack, - lambda s: ClassDef(s[2].lex, s[4]), + lambda s: ClassDef(s[2].lex, s[4], s[2].token_line, s[2].token_column), ) class_def %= ( - class_keyword + classid + inherits + typex + obrack + empty_feature_list + cbrack, - lambda s: ClassDef(s[2].lex, s[6], s[4]), + class_keyword + + classid + + inherits + + typex + + obrack + + empty_feature_list + + cbrack, + lambda s: ClassDef(s[2].lex, s[6], s[2].token_line, s[2].token_column, s[4]), ) feature_list %= meod_def + dot_comma, lambda s: [s[1]] @@ -148,7 +154,9 @@ def build_cool_grammar(): param_list %= param, lambda s: [s[1]] param_list %= param + coma + param_list, lambda s: [s[1]] + s[3] - param %= idx + dd + typex, lambda s: Param(s[1].lex, s[3]) + param %= idx + dd + typex, lambda s: Param( + s[1].lex, s[3], s[1].token_line, s[1].token_column + ) statement_list %= exp, lambda s: s[1] @@ -165,9 +173,7 @@ def build_cool_grammar(): lambda s: [(s[1].lex, s[3], None)] + s[5], ) - nested_lets %= idx + dd + typex + assign + exp, lambda s: [ - (s[1].lex, s[3], s[5]) - ] + nested_lets %= idx + dd + typex + assign + exp, lambda s: [(s[1].lex, s[3], s[5])] nested_lets %= ( idx + dd + typex + assign + exp + coma + nested_lets, @@ -185,7 +191,7 @@ def build_cool_grammar(): loop_statements %= exp + dot_comma, lambda s: [s[1]] loop_statements %= exp + dot_comma + loop_statements, lambda s: [s[1]] + s[3] - exp %= idx + assign + exp, lambda s: AssignNode(s[1].lex, s[3]) + exp %= idx + assign + exp, lambda s: AssignNode(s[1].lex, s[3], s[2].token_line, s[2].token_column) exp %= while_ + exp + loop + statement_list + pool, lambda s: WhileBlockNode( s[2], s[4] @@ -205,15 +211,15 @@ def build_cool_grammar(): block %= obrack + loop_statements + cbrack, lambda s: BlockNode(s[2]) - arith %= arith + plus + term, lambda s: PlusNode(s[1], s[3]) + arith %= arith + plus + term, lambda s: PlusNode(s[1], s[3], s[2].token_line, s[2].token_column - 1) - arith %= arith + minus + term, lambda s: DifNode(s[1], s[3]) + arith %= arith + minus + term, lambda s: DifNode(s[1], s[3], s[2].token_line, s[2].token_column - 1) arith %= term, lambda s: s[1] - term %= term + star + factor, lambda s: MulNode(s[1], s[3]) + term %= term + star + factor, lambda s: MulNode(s[1], s[3], s[2].token_line, s[2].token_column - 1) - term %= term + div + factor, lambda s: DivNode(s[1], s[3]) + term %= term + div + factor, lambda s: DivNode(s[1], s[3], s[2].token_line, s[2].token_column - 1) term %= factor, lambda s: s[1] @@ -229,18 +235,18 @@ def build_cool_grammar(): factor %= num, lambda s: IntegerConstant(s[1].lex) - factor %= idx, lambda s: VariableCall(s[1].lex) + factor %= idx, lambda s: VariableCall(s[1].lex, s[1].token_line, s[1].token_column) factor %= true, lambda s: TrueConstant() factor %= factor + period + idx + opar + args_list_empty + cpar, lambda s: FunCall( - s[1], s[3].lex, s[5] + s[1], s[3].lex, s[5], s[3].token_line, s[3].token_column ) factor %= string_const, lambda s: s[1] factor %= idx + opar + args_list_empty + cpar, lambda s: FunCall( - SelfNode(), s[1].lex, s[3] + SelfNode(), s[1].lex, s[3], s[1].token_line, s[1].token_column ) factor %= ( @@ -252,13 +258,13 @@ def build_cool_grammar(): factor %= instantiation, lambda s: s[1] - atom %= arith + lt + arith, lambda s: LowerThanNode(s[1], s[3]) + atom %= arith + lt + arith, lambda s: LowerThanNode(s[1], s[3], s[2].token_line, s[2].token_column - 1) - atom %= arith + eq + arith, lambda s: EqualToNode(s[1], s[3]) + atom %= arith + eq + arith, lambda s: EqualToNode(s[1], s[3], s[2].token_line, s[2].token_column - 1) - atom %= arith + ge + arith, lambda s: GreaterEqualNode(s[1], s[3]) + atom %= arith + ge + arith, lambda s: GreaterEqualNode(s[1], s[3], s[2].token_line, s[2].token_column - 2) - atom %= arith + le + arith, lambda s: LowerEqual(s[1], s[3]) + atom %= arith + le + arith, lambda s: LowerEqual(s[1], s[3], s[2].token_line, s[2].token_column - 2) atom %= arith, lambda s: s[1] diff --git a/src/lexer/tokens.py b/src/lexer/tokens.py index a697a7a5..0e8be8f6 100755 --- a/src/lexer/tokens.py +++ b/src/lexer/tokens.py @@ -23,7 +23,7 @@ def __init__(self, self.token_line = token_line def __str__(self): - return f'{self.token_type}: {self.lex}' + return f'{(self.token_line, self.token_column)} - {self.token_type}: {self.lex}' def __repr__(self): return str(self) diff --git a/src/testing.py b/src/testing.py index 136ea7b6..2785b8a8 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,22 +60,17 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""(* -The comparison = is a special -case. If either or has static type Int, Bool, or String, then the other must have the -same static type. Any other types, including SELF TYPE, may be freely compared. -*) +text = r"""--The identifiers used in the formal parameter list must be distinct class A { }; class B inherits A { }; +class C inherits B { }; +class D inherits B { }; class Main inherits IO { main(): IO { out_string("Hello World!")}; - x: Bool <- 1 = 2; - y: Bool <- "1" = "2"; - test: Bool <- "1" = new B; - z: Bool <- true = not false; + test(a: A, a: B): Int { 4 }; }; """ pipeline(text, 5) diff --git a/src/tknizer.py b/src/tknizer.py index 72624b58..6568be9c 100644 --- a/src/tknizer.py +++ b/src/tknizer.py @@ -85,7 +85,7 @@ def _tokenize(self, text): # with the full list, so next code should do # the work. self.line += len(newlines) - 1 - self.column = len(newlines[-1]) + self.column += len(newlines[-1]) else: self.column += len(suffix) yield suffix, token_type diff --git a/src/travels/inference.py b/src/travels/inference.py index b5bb9a1e..fac00448 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -14,6 +14,10 @@ void = semantic.VoidType() +def TypeError(s, l, c): + return f"({l}, {c}) - TypeError: {s}" + + class TypeInferer: """ Para inferir los tipos en un programa se aprovecha el AST devuelto al evaluar el parse de dicho programa. @@ -119,9 +123,12 @@ def _( # Inferir el tipo del atributo segun su expresion de inicializacion atrib.type = return_type elif not return_type.conforms_to(atrib.type): - self.errors.append( - f"Attribute {node.idx} of type {atrib.type.name} can not be initialized with \ - an expression of type {return_type.name}" + raise SemanticError( + TypeError( + f"Attribute {node.idx} of type {atrib.type.name} can not be initialized with an expression of type {return_type.name}", + node.default_value.line, + node.default_value.column - node.column, + ) ) # --------------------------------------------------------------------- @@ -135,8 +142,16 @@ def _(self, node: coolAst.MethodDef, scope, infered_type=None, deep=1): assert self.current_type is not None method = self.current_type.get_method(node.idx) self.current_method = method + params = [] for param in node.param_list: + if param in params: + raise SemanticError( + TypeError( + f"Param {param.id} multiply defined.", param.line, param.column + ) + ) self.visit(param, scope, deep=deep) + params.append(param) last = self.visit(node.statements, scope, deep=deep) if last.name == "SELF_TYPE": @@ -145,7 +160,7 @@ def _(self, node: coolAst.MethodDef, scope, infered_type=None, deep=1): method.return_type = last else: if not last.conforms_to(method.return_type): - self.errors.append(f"Method {method.name} cannot return {last}") + raise SemanticError(f"Method {method.name} cannot return {last}") @visit.register def _( @@ -192,12 +207,12 @@ def _( return void else: if not e.conforms_to(var_info.type): - self.errors.append( + raise SemanticError( f"Expresion of type {e.name} cannot be assigned to variable {var_info.name} of type {var_info.type.name}" ) return void else: - self.errors.append(f"Undefined variable name: {node.idx}") + raise SemanticError(f"Undefined variable name: {node.idx}") @visit.register def _( @@ -222,7 +237,6 @@ def _( update_scope_variable(var_info.name, infered_type, scope) return var_info.type else: - self.errors.append(f"Name {node.idx} is not define.") raise SemanticError(f"Name {node.idx} is not define in {scope}") @visit.register @@ -237,7 +251,7 @@ def _( e1 = self.visit(node.expr1, scope, infered_type, deep) e2 = self.visit(node.expr2, scope, infered_type, deep) if cond != self.BOOL: - self.errors.append( + raise SemanticError( f"Se esperaba una expresion de tipo bool y se obtuvo una de tipo {cond}." ) if e1.conforms_to(e2): @@ -278,7 +292,7 @@ def _( ) if type_ != self.AUTO_TYPE: if not init_expr_type.conforms_to(type_): - self.errors.append( + raise SemanticError( f"Init expression of {var_id} must conform to type {type_}" ) else: @@ -382,8 +396,13 @@ def _( if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): return self.INTEGER else: - self.errors.append(f"Invalid operation :{left.name} + {right.name}") - return self.INTEGER + raise SemanticError( + TypeError( + f"Invalid operation: {left.name} + {right.name}", + node.line, + node.column, + ) + ) @visit.register def _( @@ -394,8 +413,13 @@ def _( if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): return self.INTEGER else: - self.errors.append(f"Invalid operation :{left.name} - {right.name}") - return self.INTEGER + raise SemanticError( + TypeError( + f"Invalid operation: {left.name} - {right.name}", + node.line, + node.column, + ) + ) @visit.register def _( @@ -406,8 +430,13 @@ def _( if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): return self.INTEGER else: - self.errors.append(f"Invalid operation :{left.name} / {right.name}") - return self.INTEGER + raise SemanticError( + TypeError( + f"Invalid operation: {left.name} / {right.name}", + node.line, + node.column, + ) + ) @visit.register def _( @@ -418,8 +447,13 @@ def _( if left.conforms_to(self.INTEGER) and right.conforms_to(self.INTEGER): return self.INTEGER else: - self.errors.append(f"Invalid operation :{left.name} * {right.name}") - return self.INTEGER + raise SemanticError( + TypeError( + f"Invalid operation: {left.name} * {right.name}", + node.line, + node.column, + ) + ) # -------------------------------------------------------------------------------------------# # -----------------------------------OPERACIONES COMPARATIVAS -------------------------------# @@ -442,8 +476,13 @@ def _( if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append(f"Invalid operation: {left.name} > {right.name}") - return self.BOOL + raise SemanticError( + TypeError( + f"Invalid operation: {left.name} > {right.name}", + node.line, + node.column, + ) + ) @visit.register def _( @@ -458,8 +497,13 @@ def _( if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append(f"Invalid operation: {left.name} >= {right.name}") - return self.BOOL + raise SemanticError( + TypeError( + f"Invalid operation: {left.name} >= {right.name}", + node.line, + node.column, + ) + ) @visit.register def _( @@ -474,8 +518,13 @@ def _( if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append(f"Invalid operation: {left.name} < {right.name}") - return self.BOOL + raise SemanticError( + TypeError( + f"Invalid operation: {left.name} < {right.name}", + node.line, + node.column, + ) + ) @visit.register def _( @@ -486,8 +535,13 @@ def _( if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: return self.BOOL else: - self.errors.append(f"Invalid operation: {left.name} <= {right.name}") - return self.BOOL + raise SemanticError( + TypeError( + f"Invalid operation: {left.name} <= {right.name}", + node.line, + node.column, + ) + ) @visit.register def _( @@ -499,10 +553,22 @@ def _( ) -> Type: left = self.visit(node.left, scope, infered_type, deep) right = self.visit(node.right, scope, infered_type, deep) - if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: - return self.BOOL + if left in (self.BOOL, self.INTEGER, self.STRING) or left in ( + self.BOOL, + self.INTEGER, + self.STRING, + ): + if left == right or left == self.AUTO_TYPE or right == self.AUTO_TYPE: + return self.BOOL + else: + raise SemanticError( + TypeError( + f"Invalid operation: {left.name} = {right.name}", + node.line, + node.column, + ) + ) else: - self.errors.append(f"Invalid operation: {left.name} == {right.name}") return self.BOOL @visit.register @@ -513,8 +579,7 @@ def _( if val_type == self.AUTO_TYPE or val_type == self.BOOL: return self.BOOL else: - self.errors.append(f"Invalid operation: ! {val_type.name}") - return self.BOOL + raise SemanticError(f"Invalid operation: ! {val_type.name}") # -----------------------------------------------------------------------------------------------------------------------# # --------------------------------------------------CONSTANTES-----------------------------------------------------------# diff --git a/src/travels/typecollector.py b/src/travels/typecollector.py index 5539bbb5..8faa5dbb 100755 --- a/src/travels/typecollector.py +++ b/src/travels/typecollector.py @@ -32,7 +32,7 @@ def concat() -> Method: method_name = "concat" param_names = ["s"] params_types: List[Type] = [StringType()] - return_type = IntegerType() + return_type = obj return Method(method_name, param_names, params_types, return_type) @@ -40,7 +40,7 @@ def substr() -> Method: method_name = "substr" param_names = ["i", "l"] params_types: List[Type] = [IntegerType(), IntegerType()] - return_type = IntegerType() + return_type = obj return Method(method_name, param_names, params_types, return_type) @@ -49,7 +49,7 @@ def substr() -> Method: obj.methods["substr"] = substr() -def bootstrap_io(io: IoType): +def bootstrap_io(io: IoType, strType: StringType): def out_string() -> Method: method_name = "out_string" param_names = ["x"] @@ -70,7 +70,7 @@ def in_string() -> Method: method_name = "in_string" param_names = [] params_types = [] - return_type = StringType() + return_type = strType return Method(method_name, param_names, params_types, return_type) @@ -89,12 +89,12 @@ def in_int() -> Method: io.methods["in_int"] = in_int() -def bootstrap_object(obj: ObjectType): +def bootstrap_object(obj: ObjectType, strType: StringType): def abort() -> Method: method_name = "abort" param_names = [] params_types = [] - return_type = ObjectType() + return_type = obj return Method(method_name, param_names, params_types, return_type) @@ -102,7 +102,7 @@ def type_name() -> Method: method_name = "type_name" param_names = [] params_types = [] - return_type = StringType() + return_type = strType return Method(method_name, param_names, params_types, return_type) @@ -143,8 +143,8 @@ def _(self, node: coolAst.ProgramNode): # noqa: F811 # Agregar los metodos builtin bootstrap_string(STRING) - bootstrap_io(ioType) - bootstrap_object(OBJECT) + bootstrap_io(ioType, STRING) + bootstrap_object(OBJECT, STRING) INTEGER.set_parent(OBJECT) STRING.set_parent(OBJECT) From 4c68e8a319a57beef21880c877383c49a40f0c38 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 26 Nov 2020 17:56:02 -0500 Subject: [PATCH 110/162] Added line and column to blockNode --- src/.builds | 2 ++ src/abstract/tree.py | 8 +++++-- src/coolgrammar/grammar.py | 44 ++++++++++++++++++++++++++++---------- src/testing.py | 4 ++-- src/travels/inference.py | 8 ++++++- 5 files changed, 50 insertions(+), 16 deletions(-) diff --git a/src/.builds b/src/.builds index d9fb3c8f..407cce46 100644 --- a/src/.builds +++ b/src/.builds @@ -144,3 +144,5 @@ 1 1 1 +1 +1 diff --git a/src/abstract/tree.py b/src/abstract/tree.py index bd544a20..1e6cac27 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -268,9 +268,11 @@ def __init__(self, lex): class InstantiateClassNode(ExpressionNode): - def __init__(self, type_, args=None): + def __init__(self, type_, line, column, args=None): self.type_: str = type_ self.args = args + self.line = line + self.column = column class WhileBlockNode(ExpressionNode): @@ -293,8 +295,10 @@ def __init__(self, expression, actions): class BlockNode(ExpressionNode): - def __init__(self, expressions): + def __init__(self, expressions, line, column): self.expressions: List[ExpressionNode] = expressions + self.line = line + self.column = column class IsVoidNode(ExpressionNode): diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index b95661c0..a5fa6e40 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -186,12 +186,16 @@ def build_cool_grammar(): string_const %= tilde_string_const, lambda s: StringConstant(s[1].lex) - instantiation %= new + typex, lambda s: InstantiateClassNode(s[2], []) + instantiation %= new + typex, lambda s: InstantiateClassNode( + s[2], s[1].token_line, s[1].token_column - 3, [] + ) loop_statements %= exp + dot_comma, lambda s: [s[1]] loop_statements %= exp + dot_comma + loop_statements, lambda s: [s[1]] + s[3] - exp %= idx + assign + exp, lambda s: AssignNode(s[1].lex, s[3], s[2].token_line, s[2].token_column) + exp %= idx + assign + exp, lambda s: AssignNode( + s[1].lex, s[3], s[2].token_line, s[2].token_column + ) exp %= while_ + exp + loop + statement_list + pool, lambda s: WhileBlockNode( s[2], s[4] @@ -209,17 +213,27 @@ def build_cool_grammar(): exp %= isvoid + exp, lambda s: IsVoidNode(s[2]) - block %= obrack + loop_statements + cbrack, lambda s: BlockNode(s[2]) + block %= obrack + loop_statements + cbrack, lambda s: BlockNode( + s[2], s[1].token_line, s[1].token_column - 1 + ) - arith %= arith + plus + term, lambda s: PlusNode(s[1], s[3], s[2].token_line, s[2].token_column - 1) + arith %= arith + plus + term, lambda s: PlusNode( + s[1], s[3], s[2].token_line, s[2].token_column - 1 + ) - arith %= arith + minus + term, lambda s: DifNode(s[1], s[3], s[2].token_line, s[2].token_column - 1) + arith %= arith + minus + term, lambda s: DifNode( + s[1], s[3], s[2].token_line, s[2].token_column - 1 + ) arith %= term, lambda s: s[1] - term %= term + star + factor, lambda s: MulNode(s[1], s[3], s[2].token_line, s[2].token_column - 1) + term %= term + star + factor, lambda s: MulNode( + s[1], s[3], s[2].token_line, s[2].token_column - 1 + ) - term %= term + div + factor, lambda s: DivNode(s[1], s[3], s[2].token_line, s[2].token_column - 1) + term %= term + div + factor, lambda s: DivNode( + s[1], s[3], s[2].token_line, s[2].token_column - 1 + ) term %= factor, lambda s: s[1] @@ -258,13 +272,21 @@ def build_cool_grammar(): factor %= instantiation, lambda s: s[1] - atom %= arith + lt + arith, lambda s: LowerThanNode(s[1], s[3], s[2].token_line, s[2].token_column - 1) + atom %= arith + lt + arith, lambda s: LowerThanNode( + s[1], s[3], s[2].token_line, s[2].token_column - 1 + ) - atom %= arith + eq + arith, lambda s: EqualToNode(s[1], s[3], s[2].token_line, s[2].token_column - 1) + atom %= arith + eq + arith, lambda s: EqualToNode( + s[1], s[3], s[2].token_line, s[2].token_column - 1 + ) - atom %= arith + ge + arith, lambda s: GreaterEqualNode(s[1], s[3], s[2].token_line, s[2].token_column - 2) + atom %= arith + ge + arith, lambda s: GreaterEqualNode( + s[1], s[3], s[2].token_line, s[2].token_column - 2 + ) - atom %= arith + le + arith, lambda s: LowerEqual(s[1], s[3], s[2].token_line, s[2].token_column - 2) + atom %= arith + le + arith, lambda s: LowerEqual( + s[1], s[3], s[2].token_line, s[2].token_column - 2 + ) atom %= arith, lambda s: s[1] diff --git a/src/testing.py b/src/testing.py index 2785b8a8..a1379a96 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,7 +60,7 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""--The identifiers used in the formal parameter list must be distinct +text = r"""--The type of the method body must conform to the declared return type. class A { }; class B inherits A { }; @@ -70,7 +70,7 @@ class D inherits B { }; class Main inherits IO { main(): IO { out_string("Hello World!")}; - test(a: A, a: B): Int { 4 }; + test(a: A, b: B): C { new D }; }; """ pipeline(text, 5) diff --git a/src/travels/inference.py b/src/travels/inference.py index fac00448..e673d998 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -160,7 +160,13 @@ def _(self, node: coolAst.MethodDef, scope, infered_type=None, deep=1): method.return_type = last else: if not last.conforms_to(method.return_type): - raise SemanticError(f"Method {method.name} cannot return {last}") + raise SemanticError( + TypeError( + f"Inferred return type {last.name} of method {node.idx} does not conform to declared return type {method.return_type.name}", + node.statements.line, + node.statements.column, + ) + ) @visit.register def _( From 29d88ebe4863c7d7f7fc6bc958b1e271c54b3ad0 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 26 Nov 2020 19:46:31 -0500 Subject: [PATCH 111/162] Fix Redefined method check --- src/testing.py | 17 ++++++++++---- src/travels/typebuilder.py | 48 ++++++++++++++++++++++++++++---------- 2 files changed, 48 insertions(+), 17 deletions(-) diff --git a/src/testing.py b/src/testing.py index a1379a96..857faceb 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,17 +60,24 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""--The type of the method body must conform to the declared return type. +text = r"""(* +The rule is +simple: If a class C inherits a method f from an ancestor class P, then C may override the inherited +definition of f provided the number of arguments, the types of the formal parameters, and the return +type are exactly the same in both definitions. +*) -class A { }; -class B inherits A { }; +class A { + f(x: Int, y: Int): Int { x + y }; +}; +class B inherits A { + f(x: Int, y: Object): Int { x }; +}; class C inherits B { }; class D inherits B { }; class Main inherits IO { main(): IO { out_string("Hello World!")}; - - test(a: A, b: B): C { new D }; }; """ pipeline(text, 5) diff --git a/src/travels/typebuilder.py b/src/travels/typebuilder.py index 0912d7de..362a88ab 100755 --- a/src/travels/typebuilder.py +++ b/src/travels/typebuilder.py @@ -3,7 +3,7 @@ from abstract.semantics import Method, ObjectType, SemanticError, Type, Context from functools import singledispatchmethod -INHERITABLES = ('Int', 'Bool', 'String', 'AUTO_TYPE') +INHERITABLES = ("Int", "Bool", "String", "AUTO_TYPE") class TypeBuilder: @@ -34,7 +34,7 @@ def _(self, node: coolAst.ClassDef): # Detectar dependencias circulares if parent.conforms_to(self.current_type): self.errors.append( - f'Circular dependency: class {self.current_type.name} cannot inherit from {parent.name}' + f"Circular dependency: class {self.current_type.name} cannot inherit from {parent.name}" ) else: self.current_type.set_parent(parent) @@ -55,11 +55,16 @@ def _(self, node: coolAst.AttributeDef): # anteriormente try: # Extraer el tipo del atributo del contexto - attr_type = self.context.get_type(node.typex) if isinstance( - node.typex, str) else node.typex + attr_type = ( + self.context.get_type(node.typex) + if isinstance(node.typex, str) + else node.typex + ) # Definir el atributo en el tipo actual - self.current_type.define_attribute(node.idx, attr_type, node.line, node.column) + self.current_type.define_attribute( + node.idx, attr_type, node.line, node.column + ) except SemanticError as e: self.errors.append(e.text) @@ -68,17 +73,36 @@ def _(self, node: coolAst.MethodDef): params = [param.id for param in node.param_list] try: params_type = [ - self.context.get_type(param.type) if isinstance( - param.type, str) else param.type + self.context.get_type(param.type) + if isinstance(param.type, str) + else param.type for param in node.param_list ] try: - return_type = self.context.get_type( - node.return_type) if isinstance(node.return_type, - str) else node.return_type + return_type = ( + self.context.get_type(node.return_type) + if isinstance(node.return_type, str) + else node.return_type + ) try: - self.current_type.define_method(node.idx, params, - params_type, return_type, node.line, node.column) + # Manejar la redefinicion de metodos + if node.idx in self.current_type.parent.methods: + for param, parent_param in zip( + node.param_list, + self.current_type.parent.methods[node.idx].param_types, + ): + if param.type != parent_param.name: + raise SemanticError( + f"({param.line}, {param.column}) - SemanticError: In redefined method {node.idx}, parameter type {param.type} is different from original type {parent_param.name}." + ) + self.current_type.define_method( + node.idx, + params, + params_type, + return_type, + node.line, + node.column, + ) except SemanticError as e: self.errors.append(e.text) From 75abba1739a3393bf15ed5c6044d5a839c418bdd Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 26 Nov 2020 21:22:36 -0500 Subject: [PATCH 112/162] Pass methods --- src/.builds | 2 + src/abstract/semantics.py | 2 +- src/abstract/tree.py | 2 + src/coolgrammar/grammar.py | 16 +- src/testing.py | 17 +- src/travels/inference.py | 2 +- src/travels/typebuilder.py | 33 +- tests/semantic/let2.cl.mips | 693 +++++++++++++++++++++++++++++++++++ tests/semantic/self2.cl.mips | 378 +++++++++++++++++++ tests/semantic/self3.cl.mips | 352 ++++++++++++++++++ tests/semantic/self4.cl.mips | 356 ++++++++++++++++++ 11 files changed, 1829 insertions(+), 24 deletions(-) create mode 100644 tests/semantic/let2.cl.mips create mode 100644 tests/semantic/self2.cl.mips create mode 100644 tests/semantic/self3.cl.mips create mode 100644 tests/semantic/self4.cl.mips diff --git a/src/.builds b/src/.builds index 407cce46..e999e906 100644 --- a/src/.builds +++ b/src/.builds @@ -146,3 +146,5 @@ 1 1 1 +1 +1 diff --git a/src/abstract/semantics.py b/src/abstract/semantics.py index 61930405..2f394e47 100755 --- a/src/abstract/semantics.py +++ b/src/abstract/semantics.py @@ -209,7 +209,7 @@ def get_type(self, name: str) -> Type: try: return self.types[name] except KeyError: - raise SemanticError(f'Type "{name}" is not defined.') + raise SemanticError(f'TypeError "{name}" is not defined.') def __str__(self): return '{\n\t' + '\n\t'.join(y for x in self.types.values() diff --git a/src/abstract/tree.py b/src/abstract/tree.py index 1e6cac27..516a1862 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -77,6 +77,7 @@ def __init__( line, column, statements: List[ExpressionNode], + ret_col ): self.idx: str = idx self.param_list: List[Param] = param_list @@ -84,6 +85,7 @@ def __init__( self.statements: List[ExpressionNode] = statements self.line = line self.column = column - len(self.idx) + self.ret_col = ret_col class AttributeDef(DeclarationNode): diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index a5fa6e40..32051fb7 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -32,7 +32,7 @@ def build_cool_grammar(): G = Grammar() program = G.NonTerminal("", True) - class_list, class_def, empty_feature_list, feature_list, meod_def = G.NonTerminals( + class_list, class_def, empty_feature_list, feature_list, method_def = G.NonTerminals( " " ) @@ -114,18 +114,18 @@ def build_cool_grammar(): lambda s: ClassDef(s[2].lex, s[6], s[2].token_line, s[2].token_column, s[4]), ) - feature_list %= meod_def + dot_comma, lambda s: [s[1]] + feature_list %= method_def + dot_comma, lambda s: [s[1]] feature_list %= attr_def + dot_comma, lambda s: [s[1]] - feature_list %= meod_def + dot_comma + feature_list, lambda s: [s[1]] + s[3] + feature_list %= method_def + dot_comma + feature_list, lambda s: [s[1]] + s[3] feature_list %= attr_def + dot_comma + feature_list, lambda s: [s[1]] + s[3] empty_feature_list %= G.Epsilon, lambda s: [] empty_feature_list %= feature_list, lambda s: s[1] - meod_def %= ( + method_def %= ( idx + opar + param_list_empty @@ -136,7 +136,13 @@ def build_cool_grammar(): + statement_list + cbrack, lambda s: MethodDef( - s[1].lex, s[3], s[6], s[1].token_line, s[1].token_column, s[8] + s[1].lex, + s[3], + s[6], + s[1].token_line, + s[1].token_column, + s[8], + s[7].token_column - (len(s[6]) + 2) ), ) diff --git a/src/testing.py b/src/testing.py index 857faceb..61fd2181 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,24 +60,17 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""(* -The rule is -simple: If a class C inherits a method f from an ancestor class P, then C may override the inherited -definition of f provided the number of arguments, the types of the formal parameters, and the return -type are exactly the same in both definitions. -*) +text = r"""-- Missing type -class A { - f(x: Int, y: Int): Int { x + y }; -}; -class B inherits A { - f(x: Int, y: Object): Int { x }; -}; +class A { }; +class B inherits A { }; class C inherits B { }; class D inherits B { }; class Main inherits IO { main(): IO { out_string("Hello World!")}; + + test(a: A, b: B): Integrer { 4 }; }; """ pipeline(text, 5) diff --git a/src/travels/inference.py b/src/travels/inference.py index e673d998..2569dd22 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -345,7 +345,7 @@ def _( # Procesar el tipo de retorno de la funcion if method.return_type != self.AUTO_TYPE: - return method.return_type + return static_expr0_type elif infered_type: method.return_type = infered_type return infered_type diff --git a/src/travels/typebuilder.py b/src/travels/typebuilder.py index 362a88ab..ba967b77 100755 --- a/src/travels/typebuilder.py +++ b/src/travels/typebuilder.py @@ -85,16 +85,34 @@ def _(self, node: coolAst.MethodDef): else node.return_type ) try: - # Manejar la redefinicion de metodos - if node.idx in self.current_type.parent.methods: + # Manejar la redefinicion de metodos + try: + m = self.current_type.parent.get_method(node.idx) + redefined = True + except SemanticError: + redefined = False + + if redefined: + # verificar la cantidad de parametros + if len(node.param_list) != len(m.param_types): + raise SemanticError(f"({node.line}, {node.column}) - SemanticError: Incompatible number of formal parameters in redefined method {node.idx}.") + # Verificar el tipo de los parametros for param, parent_param in zip( node.param_list, - self.current_type.parent.methods[node.idx].param_types, + m.param_types, ): if param.type != parent_param.name: raise SemanticError( f"({param.line}, {param.column}) - SemanticError: In redefined method {node.idx}, parameter type {param.type} is different from original type {parent_param.name}." ) + # Verificar el tipo de retorno + if ( + return_type.name + != m.return_type.name + ): + raise SemanticError( + f"({node.line}, {node.ret_col}) - SemanticError: In redefined method {node.idx}, return type {return_type.name} is different from original return type {m.return_type.name}" + ) self.current_type.define_method( node.idx, params, @@ -107,7 +125,12 @@ def _(self, node: coolAst.MethodDef): self.errors.append(e.text) except SemanticError as e: - self.errors.append(e.text) + self.errors.append(f"({node.line}, {node.ret_col}) - TypeError: Undefined return type {node.return_type} in method {node.idx}.") except SemanticError as e: - self.errors.append(e.text) + for param in node.param_list: + if isinstance(param.type, str): + try: + self.context.get_type(param.type) + except: + self.errors.append(f"({param.line}, {param.column + len(param.id) + 2}) - TypeError: Class {param.type} of formal parameter {param.id} is undefined") diff --git a/tests/semantic/let2.cl.mips b/tests/semantic/let2.cl.mips new file mode 100644 index 00000000..fc5a9369 --- /dev/null +++ b/tests/semantic/let2.cl.mips @@ -0,0 +1,693 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Nov 26 21:22:25 2020 +# School of Math and Computer Science, University of Havana +# + +.data +A: + B: + C: + D: + E: + F: + Main: + # + + +.data +# **** VTABLE for type A **** +A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# + + +# **** Type RECORD for type A **** +A_start: + A_vtable_pointer: .word A_vtable + A_end: +# + + +.data +# **** VTABLE for type B **** +B_vtable: .word +# + + +# **** Type RECORD for type B **** +B_start: + B_vtable_pointer: .word B_vtable + B_end: +# + + +.data +# **** VTABLE for type C **** +C_vtable: .word +# + + +# **** Type RECORD for type C **** +C_start: + C_vtable_pointer: .word C_vtable + C_end: +# + + +.data +# **** VTABLE for type D **** +D_vtable: .word +# + + +# **** Type RECORD for type D **** +D_start: + D_vtable_pointer: .word D_vtable + D_end: +# + + +.data +# **** VTABLE for type E **** +E_vtable: .word +# + + +# **** Type RECORD for type E **** +E_start: + E_vtable_pointer: .word E_vtable + E_end: +# + + +.data +# **** VTABLE for type F **** +F_vtable: .word +# + + +# **** Type RECORD for type F **** +F_start: + F_vtable_pointer: .word F_vtable + F_end: +# + + +.data +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + Main_attrib_b: .word 0 + Main_attrib_test: .word 0 + Main_end: +# + + +.data +data_0: .asciiz +# + + +.data +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_A_tdt_entry__: .word 1 +__Object_B_tdt_entry__: .word 2 +__Object_C_tdt_entry__: .word 3 +__Object_D_tdt_entry__: .word 3 +__Object_E_tdt_entry__: .word 3 +__Object_F_tdt_entry__: .word 2 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_A_tdt_entry__: .word -1 +__Int_B_tdt_entry__: .word -1 +__Int_C_tdt_entry__: .word -1 +__Int_D_tdt_entry__: .word -1 +__Int_E_tdt_entry__: .word -1 +__Int_F_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_A_tdt_entry__: .word -1 +__String_B_tdt_entry__: .word -1 +__String_C_tdt_entry__: .word -1 +__String_D_tdt_entry__: .word -1 +__String_E_tdt_entry__: .word -1 +__String_F_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_A_tdt_entry__: .word -1 +__Bool_B_tdt_entry__: .word -1 +__Bool_C_tdt_entry__: .word -1 +__Bool_D_tdt_entry__: .word -1 +__Bool_E_tdt_entry__: .word -1 +__Bool_F_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_A_tdt_entry__: .word -1 +__IO_B_tdt_entry__: .word -1 +__IO_C_tdt_entry__: .word -1 +__IO_D_tdt_entry__: .word -1 +__IO_E_tdt_entry__: .word -1 +__IO_F_tdt_entry__: .word -1 +__IO_Main_tdt_entry__: .word 1 +__A_Object_tdt_entry__: .word -1 +__A_Int_tdt_entry__: .word -1 +__A_String_tdt_entry__: .word -1 +__A_Bool_tdt_entry__: .word -1 +__A_IO_tdt_entry__: .word -1 +__A_A_tdt_entry__: .word 0 +__A_B_tdt_entry__: .word 1 +__A_C_tdt_entry__: .word 2 +__A_D_tdt_entry__: .word 2 +__A_E_tdt_entry__: .word 2 +__A_F_tdt_entry__: .word 1 +__A_Main_tdt_entry__: .word -1 +__B_Object_tdt_entry__: .word -1 +__B_Int_tdt_entry__: .word -1 +__B_String_tdt_entry__: .word -1 +__B_Bool_tdt_entry__: .word -1 +__B_IO_tdt_entry__: .word -1 +__B_A_tdt_entry__: .word -1 +__B_B_tdt_entry__: .word 0 +__B_C_tdt_entry__: .word 1 +__B_D_tdt_entry__: .word 1 +__B_E_tdt_entry__: .word 1 +__B_F_tdt_entry__: .word -1 +__B_Main_tdt_entry__: .word -1 +__C_Object_tdt_entry__: .word -1 +__C_Int_tdt_entry__: .word -1 +__C_String_tdt_entry__: .word -1 +__C_Bool_tdt_entry__: .word -1 +__C_IO_tdt_entry__: .word -1 +__C_A_tdt_entry__: .word -1 +__C_B_tdt_entry__: .word -1 +__C_C_tdt_entry__: .word 0 +__C_D_tdt_entry__: .word -1 +__C_E_tdt_entry__: .word -1 +__C_F_tdt_entry__: .word -1 +__C_Main_tdt_entry__: .word -1 +__D_Object_tdt_entry__: .word -1 +__D_Int_tdt_entry__: .word -1 +__D_String_tdt_entry__: .word -1 +__D_Bool_tdt_entry__: .word -1 +__D_IO_tdt_entry__: .word -1 +__D_A_tdt_entry__: .word -1 +__D_B_tdt_entry__: .word -1 +__D_C_tdt_entry__: .word -1 +__D_D_tdt_entry__: .word 0 +__D_E_tdt_entry__: .word -1 +__D_F_tdt_entry__: .word -1 +__D_Main_tdt_entry__: .word -1 +__E_Object_tdt_entry__: .word -1 +__E_Int_tdt_entry__: .word -1 +__E_String_tdt_entry__: .word -1 +__E_Bool_tdt_entry__: .word -1 +__E_IO_tdt_entry__: .word -1 +__E_A_tdt_entry__: .word -1 +__E_B_tdt_entry__: .word -1 +__E_C_tdt_entry__: .word -1 +__E_D_tdt_entry__: .word -1 +__E_E_tdt_entry__: .word 0 +__E_F_tdt_entry__: .word -1 +__E_Main_tdt_entry__: .word -1 +__F_Object_tdt_entry__: .word -1 +__F_Int_tdt_entry__: .word -1 +__F_String_tdt_entry__: .word -1 +__F_Bool_tdt_entry__: .word -1 +__F_IO_tdt_entry__: .word -1 +__F_A_tdt_entry__: .word -1 +__F_B_tdt_entry__: .word -1 +__F_C_tdt_entry__: .word -1 +__F_D_tdt_entry__: .word -1 +__F_E_tdt_entry__: .word -1 +__F_F_tdt_entry__: .word 0 +__F_Main_tdt_entry__: .word -1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_A_tdt_entry__: .word -1 +__Main_B_tdt_entry__: .word -1 +__Main_C_tdt_entry__: .word -1 +__Main_D_tdt_entry__: .word -1 +__Main_E_tdt_entry__: .word -1 +__Main_F_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +.data +data_2: .asciiz "Hello World!" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # main END + +.text +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +.text +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + jal __Main__attrib__b__init + sw $v0, 8($t1) + jal __Main__attrib__test__init + sw $v0, 12($t1) + sw $t1, -4($fp) + # ARG local__internal_0 + # LOCAL local__internal_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# __Main__attrib__b__init implementation. +# @Params: +__Main__attrib__b__init: + # Allocate stack frame for function __Main__attrib__b__init. + subu $sp, $sp, 40 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 40 + # LOCAL local_ttrib__b__init_a_0 --> -4($fp) + # local_ttrib__b__init_a_0 = 0 + li $t0, 0 + sw $t0, -4($fp) + # LOCAL local_ttrib__b__init_a_1 --> -8($fp) + # local_ttrib__b__init_a_1 = 5 + li $t0, 5 + sw $t0, -8($fp) + # LOCAL local_ttrib__b__init_a_2 --> -12($fp) + # local_ttrib__b__init_a_2 = 0 + li $t0, 0 + sw $t0, -12($fp) + # LOCAL local_ttrib__b__init_internal_4 --> -20($fp) + # local_ttrib__b__init_internal_4 = ALLOCATE F + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, F + sw $t0, 0($v0) + la $t0, F_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -20($fp) + # LOCAL local_ttrib__b__init_a_3 --> -16($fp) + # LOCAL local_ttrib__b__init_internal_4 --> -20($fp) + # local_ttrib__b__init_a_3 = local_ttrib__b__init_internal_4 + lw $t0, -20($fp) + sw $t0, -16($fp) + # LOCAL local_ttrib__b__init_b_5 --> -24($fp) + # local_ttrib__b__init_b_5 = ALLOCATE B + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, B + sw $t0, 0($v0) + la $t0, B_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -24($fp) + # LOCAL local_ttrib__b__init_internal_6 --> -28($fp) + # local_ttrib__b__init_internal_6 = ALLOCATE E + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, E + sw $t0, 0($v0) + la $t0, E_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -28($fp) + # LOCAL local_ttrib__b__init_b_5 --> -24($fp) + # LOCAL local_ttrib__b__init_internal_6 --> -28($fp) + # local_ttrib__b__init_b_5 = local_ttrib__b__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + # local_ttrib__b__init_internal_7 = GETATTRIBUTE b Main + # LOCAL local_ttrib__b__init_internal_7 --> -32($fp) + lw $t0, 8($s1) + sw $t0, -32($fp) + # RETURN local_ttrib__b__init_internal_7 + lw $v0, -32($fp) + # Deallocate stack frame for function __Main__attrib__b__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 40 + jr $ra + # Function END + + +.text +# __Main__attrib__test__init implementation. +# @Params: +__Main__attrib__test__init: + # Allocate stack frame for function __Main__attrib__test__init. + subu $sp, $sp, 40 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 40 + # LOCAL local_ttrib__test__init_a_0 --> -4($fp) + # local_ttrib__test__init_a_0 = 0 + li $t0, 0 + sw $t0, -4($fp) + # LOCAL local_ttrib__test__init_a_1 --> -8($fp) + # local_ttrib__test__init_a_1 = 5 + li $t0, 5 + sw $t0, -8($fp) + # LOCAL local_ttrib__test__init_a_2 --> -12($fp) + # local_ttrib__test__init_a_2 = 0 + li $t0, 0 + sw $t0, -12($fp) + # LOCAL local_ttrib__test__init_internal_4 --> -20($fp) + # local_ttrib__test__init_internal_4 = ALLOCATE F + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, F + sw $t0, 0($v0) + la $t0, F_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -20($fp) + # LOCAL local_ttrib__test__init_a_3 --> -16($fp) + # LOCAL local_ttrib__test__init_internal_4 --> -20($fp) + # local_ttrib__test__init_a_3 = local_ttrib__test__init_internal_4 + lw $t0, -20($fp) + sw $t0, -16($fp) + # LOCAL local_ttrib__test__init_b_5 --> -24($fp) + # local_ttrib__test__init_b_5 = ALLOCATE B + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, B + sw $t0, 0($v0) + la $t0, B_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -24($fp) + # LOCAL local_ttrib__test__init_internal_6 --> -28($fp) + # local_ttrib__test__init_internal_6 = ALLOCATE E + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, E + sw $t0, 0($v0) + la $t0, E_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -28($fp) + # LOCAL local_ttrib__test__init_b_5 --> -24($fp) + # LOCAL local_ttrib__test__init_internal_6 --> -28($fp) + # local_ttrib__test__init_b_5 = local_ttrib__test__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + # local_ttrib__test__init_internal_7 = GETATTRIBUTE b Main + # LOCAL local_ttrib__test__init_internal_7 --> -32($fp) + lw $t0, 8($s1) + sw $t0, -32($fp) + # RETURN local_ttrib__test__init_internal_7 + lw $v0, -32($fp) + # Deallocate stack frame for function __Main__attrib__test__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 40 + jr $ra + # Function END + + +.text +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 + lw $t0, -12($fp) + # Load pointer to type + lw $t1, 4($t0) + sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # + lw $t0, data_2 + sw $t0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, -4($fp) + # Get pointer to type's VTABLE + lw $t1, 0($t0) + # Get pointer to function address + lw $t2, 0($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/semantic/self2.cl.mips b/tests/semantic/self2.cl.mips new file mode 100644 index 00000000..d999b4b2 --- /dev/null +++ b/tests/semantic/self2.cl.mips @@ -0,0 +1,378 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Nov 26 21:22:21 2020 +# School of Math and Computer Science, University of Havana +# + +.data +Main: + # + + +.data +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main, function_test_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + Main_end: +# + + +.data +data_0: .asciiz +# + + +.data +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_Main_tdt_entry__: .word 1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +.data +data_2: .asciiz "Hello World!" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # main END + +.text +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +.text +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -4($fp) + # ARG local__internal_0 + # LOCAL local__internal_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 + lw $t0, -12($fp) + # Load pointer to type + lw $t1, 4($t0) + sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # + lw $t0, data_2 + sw $t0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, -4($fp) + # Get pointer to type's VTABLE + lw $t1, 0($t0) + # Get pointer to function address + lw $t2, 0($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_test_at_Main implementation. +# @Params: +function_test_at_Main: + # Allocate stack frame for function function_test_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_test_at_Main_self_0 --> -4($fp) + # local_test_at_Main_self_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -4($fp) + # LOCAL local_test_at_Main_internal_1 --> -8($fp) + # local_test_at_Main_internal_1 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -8($fp) + # LOCAL local_test_at_Main_self_0 --> -4($fp) + # LOCAL local_test_at_Main_internal_1 --> -8($fp) + # local_test_at_Main_self_0 = local_test_at_Main_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # RETURN local_test_at_Main_self_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_test_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/semantic/self3.cl.mips b/tests/semantic/self3.cl.mips new file mode 100644 index 00000000..cbbf1148 --- /dev/null +++ b/tests/semantic/self3.cl.mips @@ -0,0 +1,352 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Nov 26 21:22:20 2020 +# School of Math and Computer Science, University of Havana +# + +.data +Main: + # + + +.data +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main, function_test_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + Main_end: +# + + +.data +data_0: .asciiz +# + + +.data +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_Main_tdt_entry__: .word 1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +.data +data_2: .asciiz "Hello World!" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # main END + +.text +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +.text +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -4($fp) + # ARG local__internal_0 + # LOCAL local__internal_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 + lw $t0, -12($fp) + # Load pointer to type + lw $t1, 4($t0) + sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # + lw $t0, data_2 + sw $t0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, -4($fp) + # Get pointer to type's VTABLE + lw $t1, 0($t0) + # Get pointer to function address + lw $t2, 0($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_test_at_Main implementation. +# @Params: +# 0($fp) = param_test_at_Main_self_0 +function_test_at_Main: + # Allocate stack frame for function function_test_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN + lw $v0, + # Deallocate stack frame for function function_test_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + diff --git a/tests/semantic/self4.cl.mips b/tests/semantic/self4.cl.mips new file mode 100644 index 00000000..f41f1fd3 --- /dev/null +++ b/tests/semantic/self4.cl.mips @@ -0,0 +1,356 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Nov 26 21:22:22 2020 +# School of Math and Computer Science, University of Havana +# + +.data +Main: + # + + +.data +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + Main_attrib_self: .word 0 + Main_end: +# + + +.data +data_0: .asciiz +# + + +.data +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_Main_tdt_entry__: .word 1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +.data +data_2: .asciiz "Hello World!" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # main END + +.text +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +.text +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + jal __Main__attrib__self__init + sw $v0, 8($t1) + sw $t1, -4($fp) + # ARG local__internal_0 + # LOCAL local__internal_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# __Main__attrib__self__init implementation. +# @Params: +__Main__attrib__self__init: + # Allocate stack frame for function __Main__attrib__self__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_ttrib__self__init_internal_0 = GETATTRIBUTE self Main + # LOCAL local_ttrib__self__init_internal_0 --> -4($fp) + lw $t0, 8($s1) + sw $t0, -4($fp) + # RETURN local_ttrib__self__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__self__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 + lw $t0, -12($fp) + # Load pointer to type + lw $t1, 4($t0) + sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # + lw $t0, data_2 + sw $t0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, -4($fp) + # Get pointer to type's VTABLE + lw $t1, 0($t0) + # Get pointer to function address + lw $t2, 0($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + From 3314cc3f2ef9d8adb1dace0f4df644f439b83133 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 27 Nov 2020 09:51:38 -0500 Subject: [PATCH 113/162] Fix arithmetic error messages --- src/.builds | 3 + src/abstract/tree.py | 8 +- src/coolgrammar/grammar.py | 4 +- src/testing.py | 11 +- src/travels/inference.py | 24 +- src/travels/typebuilder.py | 19 +- tests/semantic/let2.cl.mips | 693 ----------------------------------- tests/semantic/self2.cl.mips | 378 ------------------- tests/semantic/self3.cl.mips | 352 ------------------ tests/semantic/self4.cl.mips | 356 ------------------ 10 files changed, 50 insertions(+), 1798 deletions(-) delete mode 100644 tests/semantic/let2.cl.mips delete mode 100644 tests/semantic/self2.cl.mips delete mode 100644 tests/semantic/self3.cl.mips delete mode 100644 tests/semantic/self4.cl.mips diff --git a/src/.builds b/src/.builds index e999e906..acce4cfc 100644 --- a/src/.builds +++ b/src/.builds @@ -148,3 +148,6 @@ 1 1 1 +1 +1 +1 diff --git a/src/abstract/tree.py b/src/abstract/tree.py index 516a1862..9cd0cb32 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -98,9 +98,11 @@ def __init__(self, idx: str, typex: str, line, column, default_value=None): class VariableDeclaration(ExpressionNode): - def __init__(self, var_list, block_statements=None): + def __init__(self, var_list, line, column, block_statements=None): self.var_list: List[Tuple[str, str, Optional[ExpressionNode]]] = var_list self.block_statements: Optional[ExpressionNode] = block_statements + self.line = line + self.column = column class BinaryNode(ExpressionNode): @@ -260,8 +262,10 @@ def __init__(self, left, right, line, column): class NotNode(AtomicNode): - def __init__(self, lex): + def __init__(self, lex, line, column): super().__init__(lex) + self.line = line + self.column = column class NegNode(AtomicNode): diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index 32051fb7..18e7ad4f 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -169,7 +169,7 @@ def build_cool_grammar(): # statement_list %= exp + dot_comma + statement_list, lambda s: [s[1]] + s[3] var_dec %= let + nested_lets + in_keyword + exp, lambda s: VariableDeclaration( - s[2], s[4] + s[2], s[1].token_line, s[1].token_column - 3, s[4] ) nested_lets %= idx + dd + typex, lambda s: [(s[1].lex, s[3], None)] @@ -243,7 +243,7 @@ def build_cool_grammar(): term %= factor, lambda s: s[1] - term %= not_ + factor, lambda s: NotNode(s[2]) + term %= not_ + factor, lambda s: NotNode(s[2], s[1].token_line, s[1].token_column) term %= not_operator + factor, lambda s: NegNode(s[2]) diff --git a/src/testing.py b/src/testing.py index 61fd2181..88a2ecfb 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,17 +60,20 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""-- Missing type +text = r"""(* +The expression ~ is the integer +complement of . The expression must have static type Int and the entire expression +has static type Int. +*) class A { }; class B inherits A { }; class C inherits B { }; -class D inherits B { }; class Main inherits IO { main(): IO { out_string("Hello World!")}; - - test(a: A, b: B): Integrer { 4 }; + test: Int <- let x: Bool <- 1 / 2 - 3 + 4 < new A.type_name().concat(new B.type_name().concat(new C.type_name())).length() + in 1 + ~new A.type_name().concat(new B.type_name().concat(new C.type_name())); }; """ pipeline(text, 5) diff --git a/src/travels/inference.py b/src/travels/inference.py index 2569dd22..047ed91e 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -127,7 +127,7 @@ def _( TypeError( f"Attribute {node.idx} of type {atrib.type.name} can not be initialized with an expression of type {return_type.name}", node.default_value.line, - node.default_value.column - node.column, + node.default_value.column, ) ) @@ -299,7 +299,11 @@ def _( if type_ != self.AUTO_TYPE: if not init_expr_type.conforms_to(type_): raise SemanticError( - f"Init expression of {var_id} must conform to type {type_}" + TypeError( + f"Declared type {init_expr_type.name} does not conform to type {type_.name} in var {var_id}.", + node.line, + node.column + ) ) else: if deep == 1: @@ -345,7 +349,7 @@ def _( # Procesar el tipo de retorno de la funcion if method.return_type != self.AUTO_TYPE: - return static_expr0_type + return method.return_type elif infered_type: method.return_type = infered_type return infered_type @@ -577,6 +581,20 @@ def _( else: return self.BOOL + @visit.register + def _(self, node: coolAst.NotNode, scope: semantic.Scope, infered_type=None, deep=1): + val_type = self.visit(node.lex, scope, infered_type, deep) + if val_type == self.AUTO_TYPE or val_type == self.INTEGER: + return self.INTEGER + else: + raise SemanticError( + TypeError( + f"Argument of ~ has type {val_type.name} instead of Int.", + node.line, + node.column + ) + ) + @visit.register def _( self, node: coolAst.NegNode, scope: semantic.Scope, infered_type=None, deep=1 diff --git a/src/travels/typebuilder.py b/src/travels/typebuilder.py index ba967b77..09b0ee3f 100755 --- a/src/travels/typebuilder.py +++ b/src/travels/typebuilder.py @@ -85,7 +85,7 @@ def _(self, node: coolAst.MethodDef): else node.return_type ) try: - # Manejar la redefinicion de metodos + # Manejar la redefinicion de metodos try: m = self.current_type.parent.get_method(node.idx) redefined = True @@ -95,7 +95,9 @@ def _(self, node: coolAst.MethodDef): if redefined: # verificar la cantidad de parametros if len(node.param_list) != len(m.param_types): - raise SemanticError(f"({node.line}, {node.column}) - SemanticError: Incompatible number of formal parameters in redefined method {node.idx}.") + raise SemanticError( + f"({node.line}, {node.column}) - SemanticError: Incompatible number of formal parameters in redefined method {node.idx}." + ) # Verificar el tipo de los parametros for param, parent_param in zip( node.param_list, @@ -106,10 +108,7 @@ def _(self, node: coolAst.MethodDef): f"({param.line}, {param.column}) - SemanticError: In redefined method {node.idx}, parameter type {param.type} is different from original type {parent_param.name}." ) # Verificar el tipo de retorno - if ( - return_type.name - != m.return_type.name - ): + if return_type.name != m.return_type.name: raise SemanticError( f"({node.line}, {node.ret_col}) - SemanticError: In redefined method {node.idx}, return type {return_type.name} is different from original return type {m.return_type.name}" ) @@ -125,7 +124,9 @@ def _(self, node: coolAst.MethodDef): self.errors.append(e.text) except SemanticError as e: - self.errors.append(f"({node.line}, {node.ret_col}) - TypeError: Undefined return type {node.return_type} in method {node.idx}.") + self.errors.append( + f"({node.line}, {node.ret_col}) - TypeError: Undefined return type {node.return_type} in method {node.idx}." + ) except SemanticError as e: for param in node.param_list: @@ -133,4 +134,6 @@ def _(self, node: coolAst.MethodDef): try: self.context.get_type(param.type) except: - self.errors.append(f"({param.line}, {param.column + len(param.id) + 2}) - TypeError: Class {param.type} of formal parameter {param.id} is undefined") + self.errors.append( + f"({param.line}, {param.column + len(param.id) + 2}) - TypeError: Class {param.type} of formal parameter {param.id} is undefined" + ) diff --git a/tests/semantic/let2.cl.mips b/tests/semantic/let2.cl.mips deleted file mode 100644 index fc5a9369..00000000 --- a/tests/semantic/let2.cl.mips +++ /dev/null @@ -1,693 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Nov 26 21:22:25 2020 -# School of Math and Computer Science, University of Havana -# - -.data -A: - B: - C: - D: - E: - F: - Main: - # - - -.data -# **** VTABLE for type A **** -A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# - - -# **** Type RECORD for type A **** -A_start: - A_vtable_pointer: .word A_vtable - A_end: -# - - -.data -# **** VTABLE for type B **** -B_vtable: .word -# - - -# **** Type RECORD for type B **** -B_start: - B_vtable_pointer: .word B_vtable - B_end: -# - - -.data -# **** VTABLE for type C **** -C_vtable: .word -# - - -# **** Type RECORD for type C **** -C_start: - C_vtable_pointer: .word C_vtable - C_end: -# - - -.data -# **** VTABLE for type D **** -D_vtable: .word -# - - -# **** Type RECORD for type D **** -D_start: - D_vtable_pointer: .word D_vtable - D_end: -# - - -.data -# **** VTABLE for type E **** -E_vtable: .word -# - - -# **** Type RECORD for type E **** -E_start: - E_vtable_pointer: .word E_vtable - E_end: -# - - -.data -# **** VTABLE for type F **** -F_vtable: .word -# - - -# **** Type RECORD for type F **** -F_start: - F_vtable_pointer: .word F_vtable - F_end: -# - - -.data -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - Main_attrib_b: .word 0 - Main_attrib_test: .word 0 - Main_end: -# - - -.data -data_0: .asciiz -# - - -.data -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_A_tdt_entry__: .word 1 -__Object_B_tdt_entry__: .word 2 -__Object_C_tdt_entry__: .word 3 -__Object_D_tdt_entry__: .word 3 -__Object_E_tdt_entry__: .word 3 -__Object_F_tdt_entry__: .word 2 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_A_tdt_entry__: .word -1 -__Int_B_tdt_entry__: .word -1 -__Int_C_tdt_entry__: .word -1 -__Int_D_tdt_entry__: .word -1 -__Int_E_tdt_entry__: .word -1 -__Int_F_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_A_tdt_entry__: .word -1 -__String_B_tdt_entry__: .word -1 -__String_C_tdt_entry__: .word -1 -__String_D_tdt_entry__: .word -1 -__String_E_tdt_entry__: .word -1 -__String_F_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_A_tdt_entry__: .word -1 -__Bool_B_tdt_entry__: .word -1 -__Bool_C_tdt_entry__: .word -1 -__Bool_D_tdt_entry__: .word -1 -__Bool_E_tdt_entry__: .word -1 -__Bool_F_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_A_tdt_entry__: .word -1 -__IO_B_tdt_entry__: .word -1 -__IO_C_tdt_entry__: .word -1 -__IO_D_tdt_entry__: .word -1 -__IO_E_tdt_entry__: .word -1 -__IO_F_tdt_entry__: .word -1 -__IO_Main_tdt_entry__: .word 1 -__A_Object_tdt_entry__: .word -1 -__A_Int_tdt_entry__: .word -1 -__A_String_tdt_entry__: .word -1 -__A_Bool_tdt_entry__: .word -1 -__A_IO_tdt_entry__: .word -1 -__A_A_tdt_entry__: .word 0 -__A_B_tdt_entry__: .word 1 -__A_C_tdt_entry__: .word 2 -__A_D_tdt_entry__: .word 2 -__A_E_tdt_entry__: .word 2 -__A_F_tdt_entry__: .word 1 -__A_Main_tdt_entry__: .word -1 -__B_Object_tdt_entry__: .word -1 -__B_Int_tdt_entry__: .word -1 -__B_String_tdt_entry__: .word -1 -__B_Bool_tdt_entry__: .word -1 -__B_IO_tdt_entry__: .word -1 -__B_A_tdt_entry__: .word -1 -__B_B_tdt_entry__: .word 0 -__B_C_tdt_entry__: .word 1 -__B_D_tdt_entry__: .word 1 -__B_E_tdt_entry__: .word 1 -__B_F_tdt_entry__: .word -1 -__B_Main_tdt_entry__: .word -1 -__C_Object_tdt_entry__: .word -1 -__C_Int_tdt_entry__: .word -1 -__C_String_tdt_entry__: .word -1 -__C_Bool_tdt_entry__: .word -1 -__C_IO_tdt_entry__: .word -1 -__C_A_tdt_entry__: .word -1 -__C_B_tdt_entry__: .word -1 -__C_C_tdt_entry__: .word 0 -__C_D_tdt_entry__: .word -1 -__C_E_tdt_entry__: .word -1 -__C_F_tdt_entry__: .word -1 -__C_Main_tdt_entry__: .word -1 -__D_Object_tdt_entry__: .word -1 -__D_Int_tdt_entry__: .word -1 -__D_String_tdt_entry__: .word -1 -__D_Bool_tdt_entry__: .word -1 -__D_IO_tdt_entry__: .word -1 -__D_A_tdt_entry__: .word -1 -__D_B_tdt_entry__: .word -1 -__D_C_tdt_entry__: .word -1 -__D_D_tdt_entry__: .word 0 -__D_E_tdt_entry__: .word -1 -__D_F_tdt_entry__: .word -1 -__D_Main_tdt_entry__: .word -1 -__E_Object_tdt_entry__: .word -1 -__E_Int_tdt_entry__: .word -1 -__E_String_tdt_entry__: .word -1 -__E_Bool_tdt_entry__: .word -1 -__E_IO_tdt_entry__: .word -1 -__E_A_tdt_entry__: .word -1 -__E_B_tdt_entry__: .word -1 -__E_C_tdt_entry__: .word -1 -__E_D_tdt_entry__: .word -1 -__E_E_tdt_entry__: .word 0 -__E_F_tdt_entry__: .word -1 -__E_Main_tdt_entry__: .word -1 -__F_Object_tdt_entry__: .word -1 -__F_Int_tdt_entry__: .word -1 -__F_String_tdt_entry__: .word -1 -__F_Bool_tdt_entry__: .word -1 -__F_IO_tdt_entry__: .word -1 -__F_A_tdt_entry__: .word -1 -__F_B_tdt_entry__: .word -1 -__F_C_tdt_entry__: .word -1 -__F_D_tdt_entry__: .word -1 -__F_E_tdt_entry__: .word -1 -__F_F_tdt_entry__: .word 0 -__F_Main_tdt_entry__: .word -1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_A_tdt_entry__: .word -1 -__Main_B_tdt_entry__: .word -1 -__Main_C_tdt_entry__: .word -1 -__Main_D_tdt_entry__: .word -1 -__Main_E_tdt_entry__: .word -1 -__Main_F_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -.data -data_2: .asciiz "Hello World!" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # main END - -.text -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -.text -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - jal __Main__attrib__b__init - sw $v0, 8($t1) - jal __Main__attrib__test__init - sw $v0, 12($t1) - sw $t1, -4($fp) - # ARG local__internal_0 - # LOCAL local__internal_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# __Main__attrib__b__init implementation. -# @Params: -__Main__attrib__b__init: - # Allocate stack frame for function __Main__attrib__b__init. - subu $sp, $sp, 40 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 40 - # LOCAL local_ttrib__b__init_a_0 --> -4($fp) - # local_ttrib__b__init_a_0 = 0 - li $t0, 0 - sw $t0, -4($fp) - # LOCAL local_ttrib__b__init_a_1 --> -8($fp) - # local_ttrib__b__init_a_1 = 5 - li $t0, 5 - sw $t0, -8($fp) - # LOCAL local_ttrib__b__init_a_2 --> -12($fp) - # local_ttrib__b__init_a_2 = 0 - li $t0, 0 - sw $t0, -12($fp) - # LOCAL local_ttrib__b__init_internal_4 --> -20($fp) - # local_ttrib__b__init_internal_4 = ALLOCATE F - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, F - sw $t0, 0($v0) - la $t0, F_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -20($fp) - # LOCAL local_ttrib__b__init_a_3 --> -16($fp) - # LOCAL local_ttrib__b__init_internal_4 --> -20($fp) - # local_ttrib__b__init_a_3 = local_ttrib__b__init_internal_4 - lw $t0, -20($fp) - sw $t0, -16($fp) - # LOCAL local_ttrib__b__init_b_5 --> -24($fp) - # local_ttrib__b__init_b_5 = ALLOCATE B - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, B - sw $t0, 0($v0) - la $t0, B_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -24($fp) - # LOCAL local_ttrib__b__init_internal_6 --> -28($fp) - # local_ttrib__b__init_internal_6 = ALLOCATE E - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, E - sw $t0, 0($v0) - la $t0, E_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -28($fp) - # LOCAL local_ttrib__b__init_b_5 --> -24($fp) - # LOCAL local_ttrib__b__init_internal_6 --> -28($fp) - # local_ttrib__b__init_b_5 = local_ttrib__b__init_internal_6 - lw $t0, -28($fp) - sw $t0, -24($fp) - # local_ttrib__b__init_internal_7 = GETATTRIBUTE b Main - # LOCAL local_ttrib__b__init_internal_7 --> -32($fp) - lw $t0, 8($s1) - sw $t0, -32($fp) - # RETURN local_ttrib__b__init_internal_7 - lw $v0, -32($fp) - # Deallocate stack frame for function __Main__attrib__b__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 40 - jr $ra - # Function END - - -.text -# __Main__attrib__test__init implementation. -# @Params: -__Main__attrib__test__init: - # Allocate stack frame for function __Main__attrib__test__init. - subu $sp, $sp, 40 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 40 - # LOCAL local_ttrib__test__init_a_0 --> -4($fp) - # local_ttrib__test__init_a_0 = 0 - li $t0, 0 - sw $t0, -4($fp) - # LOCAL local_ttrib__test__init_a_1 --> -8($fp) - # local_ttrib__test__init_a_1 = 5 - li $t0, 5 - sw $t0, -8($fp) - # LOCAL local_ttrib__test__init_a_2 --> -12($fp) - # local_ttrib__test__init_a_2 = 0 - li $t0, 0 - sw $t0, -12($fp) - # LOCAL local_ttrib__test__init_internal_4 --> -20($fp) - # local_ttrib__test__init_internal_4 = ALLOCATE F - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, F - sw $t0, 0($v0) - la $t0, F_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -20($fp) - # LOCAL local_ttrib__test__init_a_3 --> -16($fp) - # LOCAL local_ttrib__test__init_internal_4 --> -20($fp) - # local_ttrib__test__init_a_3 = local_ttrib__test__init_internal_4 - lw $t0, -20($fp) - sw $t0, -16($fp) - # LOCAL local_ttrib__test__init_b_5 --> -24($fp) - # local_ttrib__test__init_b_5 = ALLOCATE B - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, B - sw $t0, 0($v0) - la $t0, B_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -24($fp) - # LOCAL local_ttrib__test__init_internal_6 --> -28($fp) - # local_ttrib__test__init_internal_6 = ALLOCATE E - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, E - sw $t0, 0($v0) - la $t0, E_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -28($fp) - # LOCAL local_ttrib__test__init_b_5 --> -24($fp) - # LOCAL local_ttrib__test__init_internal_6 --> -28($fp) - # local_ttrib__test__init_b_5 = local_ttrib__test__init_internal_6 - lw $t0, -28($fp) - sw $t0, -24($fp) - # local_ttrib__test__init_internal_7 = GETATTRIBUTE b Main - # LOCAL local_ttrib__test__init_internal_7 --> -32($fp) - lw $t0, 8($s1) - sw $t0, -32($fp) - # RETURN local_ttrib__test__init_internal_7 - lw $v0, -32($fp) - # Deallocate stack frame for function __Main__attrib__test__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 40 - jr $ra - # Function END - - -.text -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 - lw $t0, -12($fp) - # Load pointer to type - lw $t1, 4($t0) - sw $t1, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # - lw $t0, data_2 - sw $t0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, -4($fp) - # Get pointer to type's VTABLE - lw $t1, 0($t0) - # Get pointer to function address - lw $t2, 0($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_main_at_Main_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - diff --git a/tests/semantic/self2.cl.mips b/tests/semantic/self2.cl.mips deleted file mode 100644 index d999b4b2..00000000 --- a/tests/semantic/self2.cl.mips +++ /dev/null @@ -1,378 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Nov 26 21:22:21 2020 -# School of Math and Computer Science, University of Havana -# - -.data -Main: - # - - -.data -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main, function_test_at_Main -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - Main_end: -# - - -.data -data_0: .asciiz -# - - -.data -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -.data -data_2: .asciiz "Hello World!" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # main END - -.text -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -.text -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -4($fp) - # ARG local__internal_0 - # LOCAL local__internal_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 - lw $t0, -12($fp) - # Load pointer to type - lw $t1, 4($t0) - sw $t1, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # - lw $t0, data_2 - sw $t0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, -4($fp) - # Get pointer to type's VTABLE - lw $t1, 0($t0) - # Get pointer to function address - lw $t2, 0($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_main_at_Main_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_test_at_Main implementation. -# @Params: -function_test_at_Main: - # Allocate stack frame for function function_test_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_test_at_Main_self_0 --> -4($fp) - # local_test_at_Main_self_0 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -4($fp) - # LOCAL local_test_at_Main_internal_1 --> -8($fp) - # local_test_at_Main_internal_1 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -8($fp) - # LOCAL local_test_at_Main_self_0 --> -4($fp) - # LOCAL local_test_at_Main_internal_1 --> -8($fp) - # local_test_at_Main_self_0 = local_test_at_Main_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # RETURN local_test_at_Main_self_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_test_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - diff --git a/tests/semantic/self3.cl.mips b/tests/semantic/self3.cl.mips deleted file mode 100644 index cbbf1148..00000000 --- a/tests/semantic/self3.cl.mips +++ /dev/null @@ -1,352 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Nov 26 21:22:20 2020 -# School of Math and Computer Science, University of Havana -# - -.data -Main: - # - - -.data -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main, function_test_at_Main -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - Main_end: -# - - -.data -data_0: .asciiz -# - - -.data -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -.data -data_2: .asciiz "Hello World!" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # main END - -.text -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -.text -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -4($fp) - # ARG local__internal_0 - # LOCAL local__internal_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 - lw $t0, -12($fp) - # Load pointer to type - lw $t1, 4($t0) - sw $t1, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # - lw $t0, data_2 - sw $t0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, -4($fp) - # Get pointer to type's VTABLE - lw $t1, 0($t0) - # Get pointer to function address - lw $t2, 0($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_main_at_Main_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_test_at_Main implementation. -# @Params: -# 0($fp) = param_test_at_Main_self_0 -function_test_at_Main: - # Allocate stack frame for function function_test_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN - lw $v0, - # Deallocate stack frame for function function_test_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - diff --git a/tests/semantic/self4.cl.mips b/tests/semantic/self4.cl.mips deleted file mode 100644 index f41f1fd3..00000000 --- a/tests/semantic/self4.cl.mips +++ /dev/null @@ -1,356 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Nov 26 21:22:22 2020 -# School of Math and Computer Science, University of Havana -# - -.data -Main: - # - - -.data -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - Main_attrib_self: .word 0 - Main_end: -# - - -.data -data_0: .asciiz -# - - -.data -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -.data -data_2: .asciiz "Hello World!" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # main END - -.text -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -.text -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - jal __Main__attrib__self__init - sw $v0, 8($t1) - sw $t1, -4($fp) - # ARG local__internal_0 - # LOCAL local__internal_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# __Main__attrib__self__init implementation. -# @Params: -__Main__attrib__self__init: - # Allocate stack frame for function __Main__attrib__self__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_ttrib__self__init_internal_0 = GETATTRIBUTE self Main - # LOCAL local_ttrib__self__init_internal_0 --> -4($fp) - lw $t0, 8($s1) - sw $t0, -4($fp) - # RETURN local_ttrib__self__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Main__attrib__self__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 - lw $t0, -12($fp) - # Load pointer to type - lw $t1, 4($t0) - sw $t1, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # - lw $t0, data_2 - sw $t0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, -4($fp) - # Get pointer to type's VTABLE - lw $t1, 0($t0) - # Get pointer to function address - lw $t2, 0($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_main_at_Main_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - From 1932b242e453acbad2dc2cfe1d997229c7edf9b2 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 27 Nov 2020 19:13:42 -0500 Subject: [PATCH 114/162] Fix Arithmetic and basic error message. Fix bugs in grammar with postfix operators --- src/.builds | 27 ++ src/abstract/tree.py | 17 +- src/coolgrammar/grammar.py | 102 ++++-- src/testing.py | 16 +- src/travels/inference.py | 22 +- src/travels/typebuilder.py | 3 +- src/travels/typecollector.py | 4 +- tests/semantic/let2.cl.mips | 693 +++++++++++++++++++++++++++++++++++ tests/semantic/self2.cl.mips | 378 +++++++++++++++++++ tests/semantic/self3.cl.mips | 352 ++++++++++++++++++ tests/semantic/self4.cl.mips | 356 ++++++++++++++++++ 11 files changed, 1910 insertions(+), 60 deletions(-) create mode 100644 tests/semantic/let2.cl.mips create mode 100644 tests/semantic/self2.cl.mips create mode 100644 tests/semantic/self3.cl.mips create mode 100644 tests/semantic/self4.cl.mips diff --git a/src/.builds b/src/.builds index acce4cfc..2831ce7e 100644 --- a/src/.builds +++ b/src/.builds @@ -151,3 +151,30 @@ 1 1 1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 diff --git a/src/abstract/tree.py b/src/abstract/tree.py index 9cd0cb32..6746db9c 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -25,14 +25,23 @@ def check_semantics(self, deep=1): # recolectar los tipos type_collector = typecollector.TypeCollector() - type_collector.visit(self) + try: + type_collector.visit(self) + except SemanticError as e: + type_collector.errors.append(e.text) + + if type_collector.errors: + return type_collector.errors, type_collector.context, None # Construir los tipos detectados en el contexto assert type_collector.context is not None type_builder = typebuilder.TypeBuilder( type_collector.context, type_collector.errors ) - type_builder.visit(self) + try: + type_builder.visit(self) + except SemanticError as e: + type_builder.errors.append(e.text) # Garantizar que exista un tipo Main que contenga un # metodo main @@ -269,8 +278,10 @@ def __init__(self, lex, line, column): class NegNode(AtomicNode): - def __init__(self, lex): + def __init__(self, lex, line, column): super().__init__(lex) + self.line = line + self.column = column class InstantiateClassNode(ExpressionNode): diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index 18e7ad4f..89294c6a 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -32,7 +32,13 @@ def build_cool_grammar(): G = Grammar() program = G.NonTerminal("", True) - class_list, class_def, empty_feature_list, feature_list, method_def = G.NonTerminals( + ( + class_list, + class_def, + empty_feature_list, + feature_list, + method_def, + ) = G.NonTerminals( " " ) @@ -48,8 +54,8 @@ def build_cool_grammar(): " " ) - arith, atom, actions, action, block = G.NonTerminals( - " " + arith, atom, actions, action, block, postfix = G.NonTerminals( + " " ) args_list_empty, param_list_empty, case_statement, string_const = G.NonTerminals( @@ -99,19 +105,19 @@ def build_cool_grammar(): class_list %= class_def + dot_comma + class_list, lambda s: [s[1]] + s[3] class_def %= ( - class_keyword + classid + obrack + empty_feature_list + cbrack, + class_keyword + typex + obrack + empty_feature_list + cbrack, lambda s: ClassDef(s[2].lex, s[4], s[2].token_line, s[2].token_column), ) class_def %= ( class_keyword - + classid + + typex + inherits + typex + obrack + empty_feature_list + cbrack, - lambda s: ClassDef(s[2].lex, s[6], s[2].token_line, s[2].token_column, s[4]), + lambda s: ClassDef(s[2].lex, s[6], s[2].token_line, s[2].token_column, s[4].lex), ) feature_list %= method_def + dot_comma, lambda s: [s[1]] @@ -138,20 +144,20 @@ def build_cool_grammar(): lambda s: MethodDef( s[1].lex, s[3], - s[6], + s[6].lex, s[1].token_line, s[1].token_column, s[8], - s[7].token_column - (len(s[6]) + 2) + s[7].token_column - (len(s[6].lex) + 2), ), ) attr_def %= idx + dd + typex, lambda s: AttributeDef( - s[1].lex, s[3], s[1].token_line, s[1].token_column + s[1].lex, s[3].lex, s[1].token_line, s[1].token_column ) attr_def %= idx + dd + typex + assign + exp, lambda s: AttributeDef( - s[1].lex, s[3], s[1].token_line, s[1].token_column, s[5] + s[1].lex, s[3].lex, s[1].token_line, s[1].token_column, s[5] ) param_list_empty %= param_list, lambda s: s[1] @@ -161,7 +167,7 @@ def build_cool_grammar(): param_list %= param + coma + param_list, lambda s: [s[1]] + s[3] param %= idx + dd + typex, lambda s: Param( - s[1].lex, s[3], s[1].token_line, s[1].token_column + s[1].lex, s[3].lex, s[1].token_line, s[1].token_column ) statement_list %= exp, lambda s: s[1] @@ -172,18 +178,20 @@ def build_cool_grammar(): s[2], s[1].token_line, s[1].token_column - 3, s[4] ) - nested_lets %= idx + dd + typex, lambda s: [(s[1].lex, s[3], None)] + nested_lets %= idx + dd + typex, lambda s: [(s[1].lex, s[3].lex, None)] nested_lets %= ( idx + dd + typex + coma + nested_lets, - lambda s: [(s[1].lex, s[3], None)] + s[5], + lambda s: [(s[1].lex, s[3].lex, None)] + s[5], ) - nested_lets %= idx + dd + typex + assign + exp, lambda s: [(s[1].lex, s[3], s[5])] + nested_lets %= idx + dd + typex + assign + exp, lambda s: [ + (s[1].lex, s[3].lex, s[5]) + ] nested_lets %= ( idx + dd + typex + assign + exp + coma + nested_lets, - lambda s: [(s[1].lex, s[3], s[5])] + s[7], + lambda s: [(s[1].lex, s[3].lex, s[5])] + s[7], ) exp %= var_dec, lambda s: s[1] @@ -193,7 +201,7 @@ def build_cool_grammar(): string_const %= tilde_string_const, lambda s: StringConstant(s[1].lex) instantiation %= new + typex, lambda s: InstantiateClassNode( - s[2], s[1].token_line, s[1].token_column - 3, [] + s[2].lex, s[1].token_line, s[1].token_column - 3, [] ) loop_statements %= exp + dot_comma, lambda s: [s[1]] @@ -243,15 +251,29 @@ def build_cool_grammar(): term %= factor, lambda s: s[1] - term %= not_ + factor, lambda s: NotNode(s[2], s[1].token_line, s[1].token_column) + # term %= not_ + factor, lambda s: NotNode(s[2], s[1].token_line, s[1].token_column) - term %= not_operator + factor, lambda s: NegNode(s[2]) + # term %= not_operator + factor, lambda s: NegNode(s[2], s[1].token_line, s[1].token_column + 1) factor %= if_ + exp + then + exp + else_ + exp + fi, lambda s: IfThenElseNode( s[2], s[4], s[6] ) - factor %= opar + atom + cpar, lambda s: s[2] + exp %= not_operator + exp, lambda s: NegNode( + s[2], s[1].token_line, s[1].token_column + 1 + ) + + exp %= not_ + exp, lambda s: NotNode(s[2], s[1].token_line, s[1].token_column) + + postfix %= not_ + factor, lambda s: NotNode( + s[2], s[1].token_line, s[1].token_column + ) + + postfix %= not_operator + atom, lambda s: NegNode( + s[2], s[1].token_line, s[1].token_column + 1 + ) + + factor %= opar + exp + cpar, lambda s: s[2] factor %= num, lambda s: IntegerConstant(s[1].lex) @@ -271,44 +293,60 @@ def build_cool_grammar(): factor %= ( factor + arroba + typex + period + idx + opar + args_list_empty + cpar, - lambda s: ParentFuncCall(s[1], s[3], s[5].lex, s[7]), + lambda s: ParentFuncCall(s[1], s[3].lex, s[5].lex, s[7]), ) factor %= false, lambda s: FalseConstant() factor %= instantiation, lambda s: s[1] - atom %= arith + lt + arith, lambda s: LowerThanNode( + exp %= atom + lt + atom, lambda s: LowerThanNode( + s[1], s[3], s[2].token_line, s[2].token_column - 1 + ) + + exp %= atom + eq + atom, lambda s: EqualToNode( + s[1], s[3], s[2].token_line, s[2].token_column - 1 + ) + + exp %= atom + ge + atom, lambda s: GreaterEqualNode( + s[1], s[3], s[2].token_line, s[2].token_column - 2 + ) + + exp %= atom + le + atom, lambda s: LowerEqual( + s[1], s[3], s[2].token_line, s[2].token_column - 2 + ) + + exp %= atom + lt + postfix, lambda s: LowerThanNode( s[1], s[3], s[2].token_line, s[2].token_column - 1 ) - atom %= arith + eq + arith, lambda s: EqualToNode( + exp %= atom + eq + postfix, lambda s: EqualToNode( s[1], s[3], s[2].token_line, s[2].token_column - 1 ) - atom %= arith + ge + arith, lambda s: GreaterEqualNode( + exp %= atom + ge + postfix, lambda s: GreaterEqualNode( s[1], s[3], s[2].token_line, s[2].token_column - 2 ) - atom %= arith + le + arith, lambda s: LowerEqual( + exp %= atom + le + postfix, lambda s: LowerEqual( s[1], s[3], s[2].token_line, s[2].token_column - 2 ) atom %= arith, lambda s: s[1] - typex %= intx, lambda s: "Int" + typex %= intx, lambda s: s[1] - typex %= boolean, lambda s: "Bool" + typex %= boolean, lambda s: s[1] - typex %= string, lambda s: "String" + typex %= string, lambda s: s[1] - typex %= objectx, lambda s: "Object" + typex %= objectx, lambda s: s[1] - typex %= classid, lambda s: s[1].lex + typex %= classid, lambda s: s[1] - typex %= auto, lambda s: "AUTO_TYPE" + typex %= auto, lambda s: s[1] - typex %= void, lambda s: "Void" + typex %= void, lambda s: s[1] args_list_empty %= args_list, lambda s: s[1] @@ -323,7 +361,7 @@ def build_cool_grammar(): actions %= action + actions, lambda s: [s[1]] + s[2] action %= idx + dd + typex + implies + exp + dot_comma, lambda s: ActionNode( - s[1].lex, s[3], s[5] + s[1].lex, s[3].lex, s[5] ) case_statement %= case + exp + of + actions + esac, lambda s: CaseNode(s[2], s[4]) diff --git a/src/testing.py b/src/testing.py index 88a2ecfb..84a98d06 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,20 +60,14 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""(* -The expression ~ is the integer -complement of . The expression must have static type Int and the entire expression -has static type Int. -*) - -class A { }; -class B inherits A { }; -class C inherits B { }; +text = r"""-- It is an error to inherit from or redefine String. class Main inherits IO { main(): IO { out_string("Hello World!")}; - test: Int <- let x: Bool <- 1 / 2 - 3 + 4 < new A.type_name().concat(new B.type_name().concat(new C.type_name())).length() - in 1 + ~new A.type_name().concat(new B.type_name().concat(new C.type_name())); +}; + +class A inherits String { + is_palindrome(): Bool { false }; }; """ pipeline(text, 5) diff --git a/src/travels/inference.py b/src/travels/inference.py index 047ed91e..696ecc17 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -146,9 +146,7 @@ def _(self, node: coolAst.MethodDef, scope, infered_type=None, deep=1): for param in node.param_list: if param in params: raise SemanticError( - TypeError( - f"Param {param.id} multiply defined.", param.line, param.column - ) + f"({param.line}, {param.column}) - SemanticError: Param {param.id} multiply defined." ) self.visit(param, scope, deep=deep) params.append(param) @@ -302,7 +300,7 @@ def _( TypeError( f"Declared type {init_expr_type.name} does not conform to type {type_.name} in var {var_id}.", node.line, - node.column + node.column, ) ) else: @@ -582,18 +580,20 @@ def _( return self.BOOL @visit.register - def _(self, node: coolAst.NotNode, scope: semantic.Scope, infered_type=None, deep=1): + def _( + self, node: coolAst.NotNode, scope: semantic.Scope, infered_type=None, deep=1 + ): val_type = self.visit(node.lex, scope, infered_type, deep) if val_type == self.AUTO_TYPE or val_type == self.INTEGER: return self.INTEGER else: raise SemanticError( - TypeError( - f"Argument of ~ has type {val_type.name} instead of Int.", - node.line, - node.column + TypeError( + f"Argument of ~ has type {val_type.name} instead of Int.", + node.line, + node.column, + ) ) - ) @visit.register def _( @@ -603,7 +603,7 @@ def _( if val_type == self.AUTO_TYPE or val_type == self.BOOL: return self.BOOL else: - raise SemanticError(f"Invalid operation: ! {val_type.name}") + raise SemanticError(f"{node.line, node.column} - TypeError: Argument of 'not' has type {val_type.name} instead of Bool.") # -----------------------------------------------------------------------------------------------------------------------# # --------------------------------------------------CONSTANTES-----------------------------------------------------------# diff --git a/src/travels/typebuilder.py b/src/travels/typebuilder.py index 09b0ee3f..983c066e 100755 --- a/src/travels/typebuilder.py +++ b/src/travels/typebuilder.py @@ -28,8 +28,7 @@ def _(self, node: coolAst.ClassDef): # No se puede heredar de Int ni de BOOL ni de AutoType ni de String if parent.name in INHERITABLES: - self.errors.append(f"Cannot inherit from builtin {parent.name}") - return + raise SemanticError(f"{node.line, node.column + len(node.idx) + 10} - SemanticError: Cannot inherit from builtin {parent.name}") # Detectar dependencias circulares if parent.conforms_to(self.current_type): diff --git a/src/travels/typecollector.py b/src/travels/typecollector.py index 8faa5dbb..32fc03e6 100755 --- a/src/travels/typecollector.py +++ b/src/travels/typecollector.py @@ -170,7 +170,9 @@ def _(self, node: coolAst.ProgramNode): # noqa: F811 def _(self, node: coolAst.ClassDef): # noqa: F811 try: if node.idx in BUILTINS: - raise SemanticError(f"Cannot redefine class {node.idx}") + raise SemanticError( + f"{node.line, node.column} - SemanticError: Redefinition of basic class {node.idx}." + ) self.context.create_type(node.idx) except SemanticError as e: self.errors.append(e.text) diff --git a/tests/semantic/let2.cl.mips b/tests/semantic/let2.cl.mips new file mode 100644 index 00000000..1e55623f --- /dev/null +++ b/tests/semantic/let2.cl.mips @@ -0,0 +1,693 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 19:12:22 2020 +# School of Math and Computer Science, University of Havana +# + +.data +A: + B: + C: + D: + E: + F: + Main: + # + + +.data +# **** VTABLE for type A **** +A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# + + +# **** Type RECORD for type A **** +A_start: + A_vtable_pointer: .word A_vtable + A_end: +# + + +.data +# **** VTABLE for type B **** +B_vtable: .word +# + + +# **** Type RECORD for type B **** +B_start: + B_vtable_pointer: .word B_vtable + B_end: +# + + +.data +# **** VTABLE for type C **** +C_vtable: .word +# + + +# **** Type RECORD for type C **** +C_start: + C_vtable_pointer: .word C_vtable + C_end: +# + + +.data +# **** VTABLE for type D **** +D_vtable: .word +# + + +# **** Type RECORD for type D **** +D_start: + D_vtable_pointer: .word D_vtable + D_end: +# + + +.data +# **** VTABLE for type E **** +E_vtable: .word +# + + +# **** Type RECORD for type E **** +E_start: + E_vtable_pointer: .word E_vtable + E_end: +# + + +.data +# **** VTABLE for type F **** +F_vtable: .word +# + + +# **** Type RECORD for type F **** +F_start: + F_vtable_pointer: .word F_vtable + F_end: +# + + +.data +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + Main_attrib_b: .word 0 + Main_attrib_test: .word 0 + Main_end: +# + + +.data +data_0: .asciiz +# + + +.data +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_A_tdt_entry__: .word 1 +__Object_B_tdt_entry__: .word 2 +__Object_C_tdt_entry__: .word 3 +__Object_D_tdt_entry__: .word 3 +__Object_E_tdt_entry__: .word 3 +__Object_F_tdt_entry__: .word 2 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_A_tdt_entry__: .word -1 +__Int_B_tdt_entry__: .word -1 +__Int_C_tdt_entry__: .word -1 +__Int_D_tdt_entry__: .word -1 +__Int_E_tdt_entry__: .word -1 +__Int_F_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_A_tdt_entry__: .word -1 +__String_B_tdt_entry__: .word -1 +__String_C_tdt_entry__: .word -1 +__String_D_tdt_entry__: .word -1 +__String_E_tdt_entry__: .word -1 +__String_F_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_A_tdt_entry__: .word -1 +__Bool_B_tdt_entry__: .word -1 +__Bool_C_tdt_entry__: .word -1 +__Bool_D_tdt_entry__: .word -1 +__Bool_E_tdt_entry__: .word -1 +__Bool_F_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_A_tdt_entry__: .word -1 +__IO_B_tdt_entry__: .word -1 +__IO_C_tdt_entry__: .word -1 +__IO_D_tdt_entry__: .word -1 +__IO_E_tdt_entry__: .word -1 +__IO_F_tdt_entry__: .word -1 +__IO_Main_tdt_entry__: .word 1 +__A_Object_tdt_entry__: .word -1 +__A_Int_tdt_entry__: .word -1 +__A_String_tdt_entry__: .word -1 +__A_Bool_tdt_entry__: .word -1 +__A_IO_tdt_entry__: .word -1 +__A_A_tdt_entry__: .word 0 +__A_B_tdt_entry__: .word 1 +__A_C_tdt_entry__: .word 2 +__A_D_tdt_entry__: .word 2 +__A_E_tdt_entry__: .word 2 +__A_F_tdt_entry__: .word 1 +__A_Main_tdt_entry__: .word -1 +__B_Object_tdt_entry__: .word -1 +__B_Int_tdt_entry__: .word -1 +__B_String_tdt_entry__: .word -1 +__B_Bool_tdt_entry__: .word -1 +__B_IO_tdt_entry__: .word -1 +__B_A_tdt_entry__: .word -1 +__B_B_tdt_entry__: .word 0 +__B_C_tdt_entry__: .word 1 +__B_D_tdt_entry__: .word 1 +__B_E_tdt_entry__: .word 1 +__B_F_tdt_entry__: .word -1 +__B_Main_tdt_entry__: .word -1 +__C_Object_tdt_entry__: .word -1 +__C_Int_tdt_entry__: .word -1 +__C_String_tdt_entry__: .word -1 +__C_Bool_tdt_entry__: .word -1 +__C_IO_tdt_entry__: .word -1 +__C_A_tdt_entry__: .word -1 +__C_B_tdt_entry__: .word -1 +__C_C_tdt_entry__: .word 0 +__C_D_tdt_entry__: .word -1 +__C_E_tdt_entry__: .word -1 +__C_F_tdt_entry__: .word -1 +__C_Main_tdt_entry__: .word -1 +__D_Object_tdt_entry__: .word -1 +__D_Int_tdt_entry__: .word -1 +__D_String_tdt_entry__: .word -1 +__D_Bool_tdt_entry__: .word -1 +__D_IO_tdt_entry__: .word -1 +__D_A_tdt_entry__: .word -1 +__D_B_tdt_entry__: .word -1 +__D_C_tdt_entry__: .word -1 +__D_D_tdt_entry__: .word 0 +__D_E_tdt_entry__: .word -1 +__D_F_tdt_entry__: .word -1 +__D_Main_tdt_entry__: .word -1 +__E_Object_tdt_entry__: .word -1 +__E_Int_tdt_entry__: .word -1 +__E_String_tdt_entry__: .word -1 +__E_Bool_tdt_entry__: .word -1 +__E_IO_tdt_entry__: .word -1 +__E_A_tdt_entry__: .word -1 +__E_B_tdt_entry__: .word -1 +__E_C_tdt_entry__: .word -1 +__E_D_tdt_entry__: .word -1 +__E_E_tdt_entry__: .word 0 +__E_F_tdt_entry__: .word -1 +__E_Main_tdt_entry__: .word -1 +__F_Object_tdt_entry__: .word -1 +__F_Int_tdt_entry__: .word -1 +__F_String_tdt_entry__: .word -1 +__F_Bool_tdt_entry__: .word -1 +__F_IO_tdt_entry__: .word -1 +__F_A_tdt_entry__: .word -1 +__F_B_tdt_entry__: .word -1 +__F_C_tdt_entry__: .word -1 +__F_D_tdt_entry__: .word -1 +__F_E_tdt_entry__: .word -1 +__F_F_tdt_entry__: .word 0 +__F_Main_tdt_entry__: .word -1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_A_tdt_entry__: .word -1 +__Main_B_tdt_entry__: .word -1 +__Main_C_tdt_entry__: .word -1 +__Main_D_tdt_entry__: .word -1 +__Main_E_tdt_entry__: .word -1 +__Main_F_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +.data +data_2: .asciiz "Hello World!" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # main END + +.text +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +.text +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + jal __Main__attrib__b__init + sw $v0, 8($t1) + jal __Main__attrib__test__init + sw $v0, 12($t1) + sw $t1, -4($fp) + # ARG local__internal_0 + # LOCAL local__internal_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# __Main__attrib__b__init implementation. +# @Params: +__Main__attrib__b__init: + # Allocate stack frame for function __Main__attrib__b__init. + subu $sp, $sp, 40 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 40 + # LOCAL local_ttrib__b__init_a_0 --> -4($fp) + # local_ttrib__b__init_a_0 = 0 + li $t0, 0 + sw $t0, -4($fp) + # LOCAL local_ttrib__b__init_a_1 --> -8($fp) + # local_ttrib__b__init_a_1 = 5 + li $t0, 5 + sw $t0, -8($fp) + # LOCAL local_ttrib__b__init_a_2 --> -12($fp) + # local_ttrib__b__init_a_2 = 0 + li $t0, 0 + sw $t0, -12($fp) + # LOCAL local_ttrib__b__init_internal_4 --> -20($fp) + # local_ttrib__b__init_internal_4 = ALLOCATE F + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, F + sw $t0, 0($v0) + la $t0, F_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -20($fp) + # LOCAL local_ttrib__b__init_a_3 --> -16($fp) + # LOCAL local_ttrib__b__init_internal_4 --> -20($fp) + # local_ttrib__b__init_a_3 = local_ttrib__b__init_internal_4 + lw $t0, -20($fp) + sw $t0, -16($fp) + # LOCAL local_ttrib__b__init_b_5 --> -24($fp) + # local_ttrib__b__init_b_5 = ALLOCATE B + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, B + sw $t0, 0($v0) + la $t0, B_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -24($fp) + # LOCAL local_ttrib__b__init_internal_6 --> -28($fp) + # local_ttrib__b__init_internal_6 = ALLOCATE E + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, E + sw $t0, 0($v0) + la $t0, E_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -28($fp) + # LOCAL local_ttrib__b__init_b_5 --> -24($fp) + # LOCAL local_ttrib__b__init_internal_6 --> -28($fp) + # local_ttrib__b__init_b_5 = local_ttrib__b__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + # local_ttrib__b__init_internal_7 = GETATTRIBUTE b Main + # LOCAL local_ttrib__b__init_internal_7 --> -32($fp) + lw $t0, 8($s1) + sw $t0, -32($fp) + # RETURN local_ttrib__b__init_internal_7 + lw $v0, -32($fp) + # Deallocate stack frame for function __Main__attrib__b__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 40 + jr $ra + # Function END + + +.text +# __Main__attrib__test__init implementation. +# @Params: +__Main__attrib__test__init: + # Allocate stack frame for function __Main__attrib__test__init. + subu $sp, $sp, 40 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 40 + # LOCAL local_ttrib__test__init_a_0 --> -4($fp) + # local_ttrib__test__init_a_0 = 0 + li $t0, 0 + sw $t0, -4($fp) + # LOCAL local_ttrib__test__init_a_1 --> -8($fp) + # local_ttrib__test__init_a_1 = 5 + li $t0, 5 + sw $t0, -8($fp) + # LOCAL local_ttrib__test__init_a_2 --> -12($fp) + # local_ttrib__test__init_a_2 = 0 + li $t0, 0 + sw $t0, -12($fp) + # LOCAL local_ttrib__test__init_internal_4 --> -20($fp) + # local_ttrib__test__init_internal_4 = ALLOCATE F + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, F + sw $t0, 0($v0) + la $t0, F_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -20($fp) + # LOCAL local_ttrib__test__init_a_3 --> -16($fp) + # LOCAL local_ttrib__test__init_internal_4 --> -20($fp) + # local_ttrib__test__init_a_3 = local_ttrib__test__init_internal_4 + lw $t0, -20($fp) + sw $t0, -16($fp) + # LOCAL local_ttrib__test__init_b_5 --> -24($fp) + # local_ttrib__test__init_b_5 = ALLOCATE B + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, B + sw $t0, 0($v0) + la $t0, B_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -24($fp) + # LOCAL local_ttrib__test__init_internal_6 --> -28($fp) + # local_ttrib__test__init_internal_6 = ALLOCATE E + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, E + sw $t0, 0($v0) + la $t0, E_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -28($fp) + # LOCAL local_ttrib__test__init_b_5 --> -24($fp) + # LOCAL local_ttrib__test__init_internal_6 --> -28($fp) + # local_ttrib__test__init_b_5 = local_ttrib__test__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + # local_ttrib__test__init_internal_7 = GETATTRIBUTE b Main + # LOCAL local_ttrib__test__init_internal_7 --> -32($fp) + lw $t0, 8($s1) + sw $t0, -32($fp) + # RETURN local_ttrib__test__init_internal_7 + lw $v0, -32($fp) + # Deallocate stack frame for function __Main__attrib__test__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 40 + jr $ra + # Function END + + +.text +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 + lw $t0, -12($fp) + # Load pointer to type + lw $t1, 4($t0) + sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # + lw $t0, data_2 + sw $t0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, -4($fp) + # Get pointer to type's VTABLE + lw $t1, 0($t0) + # Get pointer to function address + lw $t2, 0($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/semantic/self2.cl.mips b/tests/semantic/self2.cl.mips new file mode 100644 index 00000000..22f28443 --- /dev/null +++ b/tests/semantic/self2.cl.mips @@ -0,0 +1,378 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 19:12:18 2020 +# School of Math and Computer Science, University of Havana +# + +.data +Main: + # + + +.data +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main, function_test_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + Main_end: +# + + +.data +data_0: .asciiz +# + + +.data +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_Main_tdt_entry__: .word 1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +.data +data_2: .asciiz "Hello World!" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # main END + +.text +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +.text +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -4($fp) + # ARG local__internal_0 + # LOCAL local__internal_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 + lw $t0, -12($fp) + # Load pointer to type + lw $t1, 4($t0) + sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # + lw $t0, data_2 + sw $t0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, -4($fp) + # Get pointer to type's VTABLE + lw $t1, 0($t0) + # Get pointer to function address + lw $t2, 0($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_test_at_Main implementation. +# @Params: +function_test_at_Main: + # Allocate stack frame for function function_test_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_test_at_Main_self_0 --> -4($fp) + # local_test_at_Main_self_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -4($fp) + # LOCAL local_test_at_Main_internal_1 --> -8($fp) + # local_test_at_Main_internal_1 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -8($fp) + # LOCAL local_test_at_Main_self_0 --> -4($fp) + # LOCAL local_test_at_Main_internal_1 --> -8($fp) + # local_test_at_Main_self_0 = local_test_at_Main_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # RETURN local_test_at_Main_self_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_test_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/semantic/self3.cl.mips b/tests/semantic/self3.cl.mips new file mode 100644 index 00000000..c100355c --- /dev/null +++ b/tests/semantic/self3.cl.mips @@ -0,0 +1,352 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 19:12:17 2020 +# School of Math and Computer Science, University of Havana +# + +.data +Main: + # + + +.data +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main, function_test_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + Main_end: +# + + +.data +data_0: .asciiz +# + + +.data +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_Main_tdt_entry__: .word 1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +.data +data_2: .asciiz "Hello World!" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # main END + +.text +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +.text +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -4($fp) + # ARG local__internal_0 + # LOCAL local__internal_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 + lw $t0, -12($fp) + # Load pointer to type + lw $t1, 4($t0) + sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # + lw $t0, data_2 + sw $t0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, -4($fp) + # Get pointer to type's VTABLE + lw $t1, 0($t0) + # Get pointer to function address + lw $t2, 0($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_test_at_Main implementation. +# @Params: +# 0($fp) = param_test_at_Main_self_0 +function_test_at_Main: + # Allocate stack frame for function function_test_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN + lw $v0, + # Deallocate stack frame for function function_test_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + diff --git a/tests/semantic/self4.cl.mips b/tests/semantic/self4.cl.mips new file mode 100644 index 00000000..63a03d3d --- /dev/null +++ b/tests/semantic/self4.cl.mips @@ -0,0 +1,356 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 19:12:19 2020 +# School of Math and Computer Science, University of Havana +# + +.data +Main: + # + + +.data +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + Main_attrib_self: .word 0 + Main_end: +# + + +.data +data_0: .asciiz +# + + +.data +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_Main_tdt_entry__: .word 1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +.data +data_2: .asciiz "Hello World!" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # main END + +.text +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +.text +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + jal __Main__attrib__self__init + sw $v0, 8($t1) + sw $t1, -4($fp) + # ARG local__internal_0 + # LOCAL local__internal_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# __Main__attrib__self__init implementation. +# @Params: +__Main__attrib__self__init: + # Allocate stack frame for function __Main__attrib__self__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_ttrib__self__init_internal_0 = GETATTRIBUTE self Main + # LOCAL local_ttrib__self__init_internal_0 --> -4($fp) + lw $t0, 8($s1) + sw $t0, -4($fp) + # RETURN local_ttrib__self__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__self__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 + lw $t0, -12($fp) + # Load pointer to type + lw $t1, 4($t0) + sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # + lw $t0, data_2 + sw $t0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, -4($fp) + # Get pointer to type's VTABLE + lw $t1, 0($t0) + # Get pointer to function address + lw $t2, 0($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + From 46d08ab9c942ec38668cf26286bce5c41f24818e Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 27 Nov 2020 19:22:54 -0500 Subject: [PATCH 115/162] Fix precedence with ~operator --- src/.builds | 1 + src/abstract/tree.py | 4 +++- src/coolgrammar/grammar.py | 12 +++--------- src/testing.py | 16 +++++++++++----- tests/semantic/let2.cl.mips | 2 +- tests/semantic/self2.cl.mips | 2 +- tests/semantic/self3.cl.mips | 4 ++-- tests/semantic/self4.cl.mips | 2 +- 8 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/.builds b/src/.builds index 2831ce7e..4a917e61 100644 --- a/src/.builds +++ b/src/.builds @@ -178,3 +178,4 @@ 1 1 1 +1 diff --git a/src/abstract/tree.py b/src/abstract/tree.py index 6746db9c..0586e096 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -185,8 +185,10 @@ def __init__(self, lex): class StringConstant(AtomicNode): - def __init__(self, lex): + def __init__(self, lex, line, column): super(StringConstant, self).__init__(lex) + self.line = line + self.column = column class TypeNode(AtomicNode): diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index 89294c6a..9b12c1e3 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -196,9 +196,9 @@ def build_cool_grammar(): exp %= var_dec, lambda s: s[1] - string_const %= quoted_string_const, lambda s: StringConstant(s[1].lex) + string_const %= quoted_string_const, lambda s: StringConstant(s[1].lex, s[1].token_line, s[1].token_column) - string_const %= tilde_string_const, lambda s: StringConstant(s[1].lex) + string_const %= tilde_string_const, lambda s: StringConstant(s[1].lex, s[1].token_line, s[1].token_column) instantiation %= new + typex, lambda s: InstantiateClassNode( s[2].lex, s[1].token_line, s[1].token_column - 3, [] @@ -251,7 +251,7 @@ def build_cool_grammar(): term %= factor, lambda s: s[1] - # term %= not_ + factor, lambda s: NotNode(s[2], s[1].token_line, s[1].token_column) + term %= not_ + factor, lambda s: NotNode(s[2], s[1].token_line, s[1].token_column) # term %= not_operator + factor, lambda s: NegNode(s[2], s[1].token_line, s[1].token_column + 1) @@ -263,12 +263,6 @@ def build_cool_grammar(): s[2], s[1].token_line, s[1].token_column + 1 ) - exp %= not_ + exp, lambda s: NotNode(s[2], s[1].token_line, s[1].token_column) - - postfix %= not_ + factor, lambda s: NotNode( - s[2], s[1].token_line, s[1].token_column - ) - postfix %= not_operator + atom, lambda s: NegNode( s[2], s[1].token_line, s[1].token_column + 1 ) diff --git a/src/testing.py b/src/testing.py index 84a98d06..88a2ecfb 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,14 +60,20 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""-- It is an error to inherit from or redefine String. +text = r"""(* +The expression ~ is the integer +complement of . The expression must have static type Int and the entire expression +has static type Int. +*) + +class A { }; +class B inherits A { }; +class C inherits B { }; class Main inherits IO { main(): IO { out_string("Hello World!")}; -}; - -class A inherits String { - is_palindrome(): Bool { false }; + test: Int <- let x: Bool <- 1 / 2 - 3 + 4 < new A.type_name().concat(new B.type_name().concat(new C.type_name())).length() + in 1 + ~new A.type_name().concat(new B.type_name().concat(new C.type_name())); }; """ pipeline(text, 5) diff --git a/tests/semantic/let2.cl.mips b/tests/semantic/let2.cl.mips index 1e55623f..3e43a16a 100644 --- a/tests/semantic/let2.cl.mips +++ b/tests/semantic/let2.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 19:12:22 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 19:22:29 2020 # School of Math and Computer Science, University of Havana # diff --git a/tests/semantic/self2.cl.mips b/tests/semantic/self2.cl.mips index 22f28443..761db245 100644 --- a/tests/semantic/self2.cl.mips +++ b/tests/semantic/self2.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 19:12:18 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 19:22:24 2020 # School of Math and Computer Science, University of Havana # diff --git a/tests/semantic/self3.cl.mips b/tests/semantic/self3.cl.mips index c100355c..d9d73870 100644 --- a/tests/semantic/self3.cl.mips +++ b/tests/semantic/self3.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 19:12:17 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 19:22:23 2020 # School of Math and Computer Science, University of Havana # @@ -337,7 +337,7 @@ function_test_at_Main: sw $fp, 0($sp) addu $fp, $sp, 32 # RETURN - lw $v0, + lw $v0, # Deallocate stack frame for function function_test_at_Main. # Restore $ra lw $ra, 4($sp) diff --git a/tests/semantic/self4.cl.mips b/tests/semantic/self4.cl.mips index 63a03d3d..3656d301 100644 --- a/tests/semantic/self4.cl.mips +++ b/tests/semantic/self4.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 19:12:19 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 19:22:26 2020 # School of Math and Computer Science, University of Havana # From 56083e4724b8ca67f6f3ee9dbef531beeee264d8 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 27 Nov 2020 19:26:34 -0500 Subject: [PATCH 116/162] Fix StringConstant line and column --- src/.builds | 1 + src/coolgrammar/grammar.py | 4 +- src/testing.py | 17 +- tests/semantic/let2.cl.mips | 693 ----------------------------------- tests/semantic/self2.cl.mips | 378 ------------------- tests/semantic/self3.cl.mips | 352 ------------------ tests/semantic/self4.cl.mips | 356 ------------------ 7 files changed, 8 insertions(+), 1793 deletions(-) delete mode 100644 tests/semantic/let2.cl.mips delete mode 100644 tests/semantic/self2.cl.mips delete mode 100644 tests/semantic/self3.cl.mips delete mode 100644 tests/semantic/self4.cl.mips diff --git a/src/.builds b/src/.builds index 4a917e61..b2b31b61 100644 --- a/src/.builds +++ b/src/.builds @@ -179,3 +179,4 @@ 1 1 1 +1 diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index 9b12c1e3..2e86e6be 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -196,9 +196,9 @@ def build_cool_grammar(): exp %= var_dec, lambda s: s[1] - string_const %= quoted_string_const, lambda s: StringConstant(s[1].lex, s[1].token_line, s[1].token_column) + string_const %= quoted_string_const, lambda s: StringConstant(s[1].lex, s[1].token_line, s[1].token_column - len(s[1].lex)) - string_const %= tilde_string_const, lambda s: StringConstant(s[1].lex, s[1].token_line, s[1].token_column) + string_const %= tilde_string_const, lambda s: StringConstant(s[1].lex, s[1].token_line, s[1].token_column - len(s[1].lex)) instantiation %= new + typex, lambda s: InstantiateClassNode( s[2].lex, s[1].token_line, s[1].token_column - 3, [] diff --git a/src/testing.py b/src/testing.py index 88a2ecfb..7e1737e6 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,20 +60,13 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""(* -The expression ~ is the integer -complement of . The expression must have static type Int and the entire expression -has static type Int. -*) - -class A { }; -class B inherits A { }; -class C inherits B { }; +text = r"""--The static type of the expression must conform to the declared type of the identifier class Main inherits IO { main(): IO { out_string("Hello World!")}; - test: Int <- let x: Bool <- 1 / 2 - 3 + 4 < new A.type_name().concat(new B.type_name().concat(new C.type_name())).length() - in 1 + ~new A.type_name().concat(new B.type_name().concat(new C.type_name())); -}; + + test: Int <- "String"; +}; + """ pipeline(text, 5) diff --git a/tests/semantic/let2.cl.mips b/tests/semantic/let2.cl.mips deleted file mode 100644 index 3e43a16a..00000000 --- a/tests/semantic/let2.cl.mips +++ /dev/null @@ -1,693 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 19:22:29 2020 -# School of Math and Computer Science, University of Havana -# - -.data -A: - B: - C: - D: - E: - F: - Main: - # - - -.data -# **** VTABLE for type A **** -A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# - - -# **** Type RECORD for type A **** -A_start: - A_vtable_pointer: .word A_vtable - A_end: -# - - -.data -# **** VTABLE for type B **** -B_vtable: .word -# - - -# **** Type RECORD for type B **** -B_start: - B_vtable_pointer: .word B_vtable - B_end: -# - - -.data -# **** VTABLE for type C **** -C_vtable: .word -# - - -# **** Type RECORD for type C **** -C_start: - C_vtable_pointer: .word C_vtable - C_end: -# - - -.data -# **** VTABLE for type D **** -D_vtable: .word -# - - -# **** Type RECORD for type D **** -D_start: - D_vtable_pointer: .word D_vtable - D_end: -# - - -.data -# **** VTABLE for type E **** -E_vtable: .word -# - - -# **** Type RECORD for type E **** -E_start: - E_vtable_pointer: .word E_vtable - E_end: -# - - -.data -# **** VTABLE for type F **** -F_vtable: .word -# - - -# **** Type RECORD for type F **** -F_start: - F_vtable_pointer: .word F_vtable - F_end: -# - - -.data -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - Main_attrib_b: .word 0 - Main_attrib_test: .word 0 - Main_end: -# - - -.data -data_0: .asciiz -# - - -.data -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_A_tdt_entry__: .word 1 -__Object_B_tdt_entry__: .word 2 -__Object_C_tdt_entry__: .word 3 -__Object_D_tdt_entry__: .word 3 -__Object_E_tdt_entry__: .word 3 -__Object_F_tdt_entry__: .word 2 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_A_tdt_entry__: .word -1 -__Int_B_tdt_entry__: .word -1 -__Int_C_tdt_entry__: .word -1 -__Int_D_tdt_entry__: .word -1 -__Int_E_tdt_entry__: .word -1 -__Int_F_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_A_tdt_entry__: .word -1 -__String_B_tdt_entry__: .word -1 -__String_C_tdt_entry__: .word -1 -__String_D_tdt_entry__: .word -1 -__String_E_tdt_entry__: .word -1 -__String_F_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_A_tdt_entry__: .word -1 -__Bool_B_tdt_entry__: .word -1 -__Bool_C_tdt_entry__: .word -1 -__Bool_D_tdt_entry__: .word -1 -__Bool_E_tdt_entry__: .word -1 -__Bool_F_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_A_tdt_entry__: .word -1 -__IO_B_tdt_entry__: .word -1 -__IO_C_tdt_entry__: .word -1 -__IO_D_tdt_entry__: .word -1 -__IO_E_tdt_entry__: .word -1 -__IO_F_tdt_entry__: .word -1 -__IO_Main_tdt_entry__: .word 1 -__A_Object_tdt_entry__: .word -1 -__A_Int_tdt_entry__: .word -1 -__A_String_tdt_entry__: .word -1 -__A_Bool_tdt_entry__: .word -1 -__A_IO_tdt_entry__: .word -1 -__A_A_tdt_entry__: .word 0 -__A_B_tdt_entry__: .word 1 -__A_C_tdt_entry__: .word 2 -__A_D_tdt_entry__: .word 2 -__A_E_tdt_entry__: .word 2 -__A_F_tdt_entry__: .word 1 -__A_Main_tdt_entry__: .word -1 -__B_Object_tdt_entry__: .word -1 -__B_Int_tdt_entry__: .word -1 -__B_String_tdt_entry__: .word -1 -__B_Bool_tdt_entry__: .word -1 -__B_IO_tdt_entry__: .word -1 -__B_A_tdt_entry__: .word -1 -__B_B_tdt_entry__: .word 0 -__B_C_tdt_entry__: .word 1 -__B_D_tdt_entry__: .word 1 -__B_E_tdt_entry__: .word 1 -__B_F_tdt_entry__: .word -1 -__B_Main_tdt_entry__: .word -1 -__C_Object_tdt_entry__: .word -1 -__C_Int_tdt_entry__: .word -1 -__C_String_tdt_entry__: .word -1 -__C_Bool_tdt_entry__: .word -1 -__C_IO_tdt_entry__: .word -1 -__C_A_tdt_entry__: .word -1 -__C_B_tdt_entry__: .word -1 -__C_C_tdt_entry__: .word 0 -__C_D_tdt_entry__: .word -1 -__C_E_tdt_entry__: .word -1 -__C_F_tdt_entry__: .word -1 -__C_Main_tdt_entry__: .word -1 -__D_Object_tdt_entry__: .word -1 -__D_Int_tdt_entry__: .word -1 -__D_String_tdt_entry__: .word -1 -__D_Bool_tdt_entry__: .word -1 -__D_IO_tdt_entry__: .word -1 -__D_A_tdt_entry__: .word -1 -__D_B_tdt_entry__: .word -1 -__D_C_tdt_entry__: .word -1 -__D_D_tdt_entry__: .word 0 -__D_E_tdt_entry__: .word -1 -__D_F_tdt_entry__: .word -1 -__D_Main_tdt_entry__: .word -1 -__E_Object_tdt_entry__: .word -1 -__E_Int_tdt_entry__: .word -1 -__E_String_tdt_entry__: .word -1 -__E_Bool_tdt_entry__: .word -1 -__E_IO_tdt_entry__: .word -1 -__E_A_tdt_entry__: .word -1 -__E_B_tdt_entry__: .word -1 -__E_C_tdt_entry__: .word -1 -__E_D_tdt_entry__: .word -1 -__E_E_tdt_entry__: .word 0 -__E_F_tdt_entry__: .word -1 -__E_Main_tdt_entry__: .word -1 -__F_Object_tdt_entry__: .word -1 -__F_Int_tdt_entry__: .word -1 -__F_String_tdt_entry__: .word -1 -__F_Bool_tdt_entry__: .word -1 -__F_IO_tdt_entry__: .word -1 -__F_A_tdt_entry__: .word -1 -__F_B_tdt_entry__: .word -1 -__F_C_tdt_entry__: .word -1 -__F_D_tdt_entry__: .word -1 -__F_E_tdt_entry__: .word -1 -__F_F_tdt_entry__: .word 0 -__F_Main_tdt_entry__: .word -1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_A_tdt_entry__: .word -1 -__Main_B_tdt_entry__: .word -1 -__Main_C_tdt_entry__: .word -1 -__Main_D_tdt_entry__: .word -1 -__Main_E_tdt_entry__: .word -1 -__Main_F_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -.data -data_2: .asciiz "Hello World!" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # main END - -.text -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -.text -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - jal __Main__attrib__b__init - sw $v0, 8($t1) - jal __Main__attrib__test__init - sw $v0, 12($t1) - sw $t1, -4($fp) - # ARG local__internal_0 - # LOCAL local__internal_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# __Main__attrib__b__init implementation. -# @Params: -__Main__attrib__b__init: - # Allocate stack frame for function __Main__attrib__b__init. - subu $sp, $sp, 40 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 40 - # LOCAL local_ttrib__b__init_a_0 --> -4($fp) - # local_ttrib__b__init_a_0 = 0 - li $t0, 0 - sw $t0, -4($fp) - # LOCAL local_ttrib__b__init_a_1 --> -8($fp) - # local_ttrib__b__init_a_1 = 5 - li $t0, 5 - sw $t0, -8($fp) - # LOCAL local_ttrib__b__init_a_2 --> -12($fp) - # local_ttrib__b__init_a_2 = 0 - li $t0, 0 - sw $t0, -12($fp) - # LOCAL local_ttrib__b__init_internal_4 --> -20($fp) - # local_ttrib__b__init_internal_4 = ALLOCATE F - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, F - sw $t0, 0($v0) - la $t0, F_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -20($fp) - # LOCAL local_ttrib__b__init_a_3 --> -16($fp) - # LOCAL local_ttrib__b__init_internal_4 --> -20($fp) - # local_ttrib__b__init_a_3 = local_ttrib__b__init_internal_4 - lw $t0, -20($fp) - sw $t0, -16($fp) - # LOCAL local_ttrib__b__init_b_5 --> -24($fp) - # local_ttrib__b__init_b_5 = ALLOCATE B - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, B - sw $t0, 0($v0) - la $t0, B_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -24($fp) - # LOCAL local_ttrib__b__init_internal_6 --> -28($fp) - # local_ttrib__b__init_internal_6 = ALLOCATE E - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, E - sw $t0, 0($v0) - la $t0, E_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -28($fp) - # LOCAL local_ttrib__b__init_b_5 --> -24($fp) - # LOCAL local_ttrib__b__init_internal_6 --> -28($fp) - # local_ttrib__b__init_b_5 = local_ttrib__b__init_internal_6 - lw $t0, -28($fp) - sw $t0, -24($fp) - # local_ttrib__b__init_internal_7 = GETATTRIBUTE b Main - # LOCAL local_ttrib__b__init_internal_7 --> -32($fp) - lw $t0, 8($s1) - sw $t0, -32($fp) - # RETURN local_ttrib__b__init_internal_7 - lw $v0, -32($fp) - # Deallocate stack frame for function __Main__attrib__b__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 40 - jr $ra - # Function END - - -.text -# __Main__attrib__test__init implementation. -# @Params: -__Main__attrib__test__init: - # Allocate stack frame for function __Main__attrib__test__init. - subu $sp, $sp, 40 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 40 - # LOCAL local_ttrib__test__init_a_0 --> -4($fp) - # local_ttrib__test__init_a_0 = 0 - li $t0, 0 - sw $t0, -4($fp) - # LOCAL local_ttrib__test__init_a_1 --> -8($fp) - # local_ttrib__test__init_a_1 = 5 - li $t0, 5 - sw $t0, -8($fp) - # LOCAL local_ttrib__test__init_a_2 --> -12($fp) - # local_ttrib__test__init_a_2 = 0 - li $t0, 0 - sw $t0, -12($fp) - # LOCAL local_ttrib__test__init_internal_4 --> -20($fp) - # local_ttrib__test__init_internal_4 = ALLOCATE F - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, F - sw $t0, 0($v0) - la $t0, F_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -20($fp) - # LOCAL local_ttrib__test__init_a_3 --> -16($fp) - # LOCAL local_ttrib__test__init_internal_4 --> -20($fp) - # local_ttrib__test__init_a_3 = local_ttrib__test__init_internal_4 - lw $t0, -20($fp) - sw $t0, -16($fp) - # LOCAL local_ttrib__test__init_b_5 --> -24($fp) - # local_ttrib__test__init_b_5 = ALLOCATE B - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, B - sw $t0, 0($v0) - la $t0, B_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -24($fp) - # LOCAL local_ttrib__test__init_internal_6 --> -28($fp) - # local_ttrib__test__init_internal_6 = ALLOCATE E - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, E - sw $t0, 0($v0) - la $t0, E_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -28($fp) - # LOCAL local_ttrib__test__init_b_5 --> -24($fp) - # LOCAL local_ttrib__test__init_internal_6 --> -28($fp) - # local_ttrib__test__init_b_5 = local_ttrib__test__init_internal_6 - lw $t0, -28($fp) - sw $t0, -24($fp) - # local_ttrib__test__init_internal_7 = GETATTRIBUTE b Main - # LOCAL local_ttrib__test__init_internal_7 --> -32($fp) - lw $t0, 8($s1) - sw $t0, -32($fp) - # RETURN local_ttrib__test__init_internal_7 - lw $v0, -32($fp) - # Deallocate stack frame for function __Main__attrib__test__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 40 - jr $ra - # Function END - - -.text -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 - lw $t0, -12($fp) - # Load pointer to type - lw $t1, 4($t0) - sw $t1, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # - lw $t0, data_2 - sw $t0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, -4($fp) - # Get pointer to type's VTABLE - lw $t1, 0($t0) - # Get pointer to function address - lw $t2, 0($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_main_at_Main_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - diff --git a/tests/semantic/self2.cl.mips b/tests/semantic/self2.cl.mips deleted file mode 100644 index 761db245..00000000 --- a/tests/semantic/self2.cl.mips +++ /dev/null @@ -1,378 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 19:22:24 2020 -# School of Math and Computer Science, University of Havana -# - -.data -Main: - # - - -.data -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main, function_test_at_Main -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - Main_end: -# - - -.data -data_0: .asciiz -# - - -.data -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -.data -data_2: .asciiz "Hello World!" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # main END - -.text -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -.text -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -4($fp) - # ARG local__internal_0 - # LOCAL local__internal_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 - lw $t0, -12($fp) - # Load pointer to type - lw $t1, 4($t0) - sw $t1, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # - lw $t0, data_2 - sw $t0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, -4($fp) - # Get pointer to type's VTABLE - lw $t1, 0($t0) - # Get pointer to function address - lw $t2, 0($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_main_at_Main_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_test_at_Main implementation. -# @Params: -function_test_at_Main: - # Allocate stack frame for function function_test_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_test_at_Main_self_0 --> -4($fp) - # local_test_at_Main_self_0 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -4($fp) - # LOCAL local_test_at_Main_internal_1 --> -8($fp) - # local_test_at_Main_internal_1 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -8($fp) - # LOCAL local_test_at_Main_self_0 --> -4($fp) - # LOCAL local_test_at_Main_internal_1 --> -8($fp) - # local_test_at_Main_self_0 = local_test_at_Main_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # RETURN local_test_at_Main_self_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_test_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - diff --git a/tests/semantic/self3.cl.mips b/tests/semantic/self3.cl.mips deleted file mode 100644 index d9d73870..00000000 --- a/tests/semantic/self3.cl.mips +++ /dev/null @@ -1,352 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 19:22:23 2020 -# School of Math and Computer Science, University of Havana -# - -.data -Main: - # - - -.data -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main, function_test_at_Main -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - Main_end: -# - - -.data -data_0: .asciiz -# - - -.data -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -.data -data_2: .asciiz "Hello World!" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # main END - -.text -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -.text -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -4($fp) - # ARG local__internal_0 - # LOCAL local__internal_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 - lw $t0, -12($fp) - # Load pointer to type - lw $t1, 4($t0) - sw $t1, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # - lw $t0, data_2 - sw $t0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, -4($fp) - # Get pointer to type's VTABLE - lw $t1, 0($t0) - # Get pointer to function address - lw $t2, 0($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_main_at_Main_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_test_at_Main implementation. -# @Params: -# 0($fp) = param_test_at_Main_self_0 -function_test_at_Main: - # Allocate stack frame for function function_test_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN - lw $v0, - # Deallocate stack frame for function function_test_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - diff --git a/tests/semantic/self4.cl.mips b/tests/semantic/self4.cl.mips deleted file mode 100644 index 3656d301..00000000 --- a/tests/semantic/self4.cl.mips +++ /dev/null @@ -1,356 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 19:22:26 2020 -# School of Math and Computer Science, University of Havana -# - -.data -Main: - # - - -.data -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - Main_attrib_self: .word 0 - Main_end: -# - - -.data -data_0: .asciiz -# - - -.data -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -.data -data_2: .asciiz "Hello World!" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # main END - -.text -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -.text -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - jal __Main__attrib__self__init - sw $v0, 8($t1) - sw $t1, -4($fp) - # ARG local__internal_0 - # LOCAL local__internal_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# __Main__attrib__self__init implementation. -# @Params: -__Main__attrib__self__init: - # Allocate stack frame for function __Main__attrib__self__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_ttrib__self__init_internal_0 = GETATTRIBUTE self Main - # LOCAL local_ttrib__self__init_internal_0 --> -4($fp) - lw $t0, 8($s1) - sw $t0, -4($fp) - # RETURN local_ttrib__self__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Main__attrib__self__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 - lw $t0, -12($fp) - # Load pointer to type - lw $t1, 4($t0) - sw $t1, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # - lw $t0, data_2 - sw $t0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, -4($fp) - # Get pointer to type's VTABLE - lw $t1, 0($t0) - # Get pointer to function address - lw $t2, 0($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_main_at_Main_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - From ef927edb9ab2c76478f7d69b9d3aee08ab807945 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 27 Nov 2020 19:36:57 -0500 Subject: [PATCH 117/162] Fix assignment report error message --- src/.builds | 2 ++ src/coolgrammar/grammar.py | 2 +- src/testing.py | 11 ++++++++--- src/travels/inference.py | 4 ++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/.builds b/src/.builds index b2b31b61..f2e1cd3f 100644 --- a/src/.builds +++ b/src/.builds @@ -180,3 +180,5 @@ 1 1 1 +1 +1 diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index 2e86e6be..cfb24e48 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -208,7 +208,7 @@ def build_cool_grammar(): loop_statements %= exp + dot_comma + loop_statements, lambda s: [s[1]] + s[3] exp %= idx + assign + exp, lambda s: AssignNode( - s[1].lex, s[3], s[2].token_line, s[2].token_column + s[1].lex, s[3], s[1].token_line, s[1].token_column ) exp %= while_ + exp + loop + statement_list + pool, lambda s: WhileBlockNode( diff --git a/src/testing.py b/src/testing.py index 7e1737e6..039e1f85 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,13 +60,18 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""--The static type of the expression must conform to the declared type of the identifier +text = r"""--The static type of an assignment is the static type of . + +class A { }; +class B inherits A { }; +class C inherits B { }; +class D inherits B { }; class Main inherits IO { main(): IO { out_string("Hello World!")}; - test: Int <- "String"; + test(a: A): B { a <- new C }; + test2(a: A): D { a <- new C }; }; - """ pipeline(text, 5) diff --git a/src/travels/inference.py b/src/travels/inference.py index 696ecc17..3da56046 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -208,13 +208,13 @@ def _( var_info.type, ) update_scope_variable(var_info.name, e, scope) - return void + return e else: if not e.conforms_to(var_info.type): raise SemanticError( f"Expresion of type {e.name} cannot be assigned to variable {var_info.name} of type {var_info.type.name}" ) - return void + return e else: raise SemanticError(f"Undefined variable name: {node.idx}") From b04ea250483bcc89e53ace5f8d52915f55a62e77 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 27 Nov 2020 20:07:58 -0500 Subject: [PATCH 118/162] Fix attributes error message --- src/.builds | 2 ++ src/abstract/tree.py | 2 +- src/coolgrammar/grammar.py | 2 +- src/testing.py | 46 +++++++++++++++++++++++++++++--------- src/travels/inference.py | 10 +++++++-- 5 files changed, 48 insertions(+), 14 deletions(-) diff --git a/src/.builds b/src/.builds index f2e1cd3f..b9e6c993 100644 --- a/src/.builds +++ b/src/.builds @@ -182,3 +182,5 @@ 1 1 1 +1 +1 diff --git a/src/abstract/tree.py b/src/abstract/tree.py index 0586e096..132e1a11 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -244,7 +244,7 @@ class VariableCall(ExpressionNode): def __init__(self, idx, line, column): self.idx: str = idx self.line = line - self.column = column - len(idx) + self.column = column class GreaterThanNode(BinaryNode): diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index cfb24e48..3c6127f6 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -271,7 +271,7 @@ def build_cool_grammar(): factor %= num, lambda s: IntegerConstant(s[1].lex) - factor %= idx, lambda s: VariableCall(s[1].lex, s[1].token_line, s[1].token_column) + factor %= idx, lambda s: VariableCall(s[1].lex, s[1].token_line, s[1].token_column - len(s[1].lex)) factor %= true, lambda s: TrueConstant() diff --git a/src/testing.py b/src/testing.py index 039e1f85..49648d19 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,18 +60,44 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""--The static type of an assignment is the static type of . +text = r"""--Attributes are local to the class in which they are defined or inherited. -class A { }; -class B inherits A { }; -class C inherits B { }; -class D inherits B { }; +class A { + a: Int <- 5; +}; +class B inherits A { + b: Bool <- true; + test(x1: Int, y1: Int): Int { + let x: Int <- x1, y: Int <-y1 in { + x <- x + a; + y <- y + a; + if b then x + y else x - y fi; + } + }; +}; +class D inherits B { + d: IO <- new Main.main(); + test3(x1: Int, y1: Int): IO { + let x: Int <- x1, y: Int <-y1, c: String <- "C" in { + x <- x + a; + y <- y + a; + if b then new IO.out_string(c) else d fi; + } + }; +}; +class C inherits B { + c: String <- "C"; + test2(x1: Int, y1: Int): IO { + let x: Int <- x1, y: Int <-y1 in { + x <- x + a; + y <- y + a; + if b then new IO.out_string(c) else d fi; + } + }; +}; class Main inherits IO { - main(): IO { out_string("Hello World!")}; - - test(a: A): B { a <- new C }; - test2(a: A): D { a <- new C }; -}; + main(): IO { out_string("Hello World!") }; +}; """ pipeline(text, 5) diff --git a/src/travels/inference.py b/src/travels/inference.py index 3da56046..ecd24c7f 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -241,7 +241,9 @@ def _( update_scope_variable(var_info.name, infered_type, scope) return var_info.type else: - raise SemanticError(f"Name {node.idx} is not define in {scope}") + raise SemanticError( + f"{node.line, node.column} - NameError: Undeclared identifier {node.idx}." + ) @visit.register def _( @@ -346,6 +348,8 @@ def _( ) # Procesar el tipo de retorno de la funcion + if method.return_type == self.SELF_TYPE: + return static_expr0_type if method.return_type != self.AUTO_TYPE: return method.return_type elif infered_type: @@ -603,7 +607,9 @@ def _( if val_type == self.AUTO_TYPE or val_type == self.BOOL: return self.BOOL else: - raise SemanticError(f"{node.line, node.column} - TypeError: Argument of 'not' has type {val_type.name} instead of Bool.") + raise SemanticError( + f"{node.line, node.column} - TypeError: Argument of 'not' has type {val_type.name} instead of Bool." + ) # -----------------------------------------------------------------------------------------------------------------------# # --------------------------------------------------CONSTANTES-----------------------------------------------------------# From 555bdb50c49e60fdeb10627654fc2a427205136d Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 27 Nov 2020 22:14:21 -0500 Subject: [PATCH 119/162] fix case error messages --- src/.builds | 2 + src/abstract/semantics.py | 3 + src/abstract/tree.py | 8 +- src/coolgrammar/grammar.py | 30 +- src/testing.py | 54 +-- src/travels/inference.py | 70 +++- src/travels/typecollector.py | 2 +- tests/semantic/let2.cl.mips | 693 ++++++++++++++++++++++++++++++++++ tests/semantic/loops1.cl.mips | 394 +++++++++++++++++++ tests/semantic/loops2.cl.mips | 426 +++++++++++++++++++++ tests/semantic/self2.cl.mips | 378 +++++++++++++++++++ tests/semantic/self3.cl.mips | 352 +++++++++++++++++ tests/semantic/self4.cl.mips | 356 +++++++++++++++++ 13 files changed, 2705 insertions(+), 63 deletions(-) create mode 100644 tests/semantic/let2.cl.mips create mode 100644 tests/semantic/loops1.cl.mips create mode 100644 tests/semantic/loops2.cl.mips create mode 100644 tests/semantic/self2.cl.mips create mode 100644 tests/semantic/self3.cl.mips create mode 100644 tests/semantic/self4.cl.mips diff --git a/src/.builds b/src/.builds index b9e6c993..c4bc166a 100644 --- a/src/.builds +++ b/src/.builds @@ -184,3 +184,5 @@ 1 1 1 +1 +1 diff --git a/src/abstract/semantics.py b/src/abstract/semantics.py index 2f394e47..25fc586a 100755 --- a/src/abstract/semantics.py +++ b/src/abstract/semantics.py @@ -96,6 +96,9 @@ def __repr__(self): def __eq__(self, other): return isinstance(other, Type) and other.name == self.name + def __hash__(self) -> int: + return hash(self.name) + class Method: def __init__(self, name: str, param_names: List[str], diff --git a/src/abstract/tree.py b/src/abstract/tree.py index 132e1a11..aeecb9ec 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -301,16 +301,20 @@ def __init__(self, cond, statements): class ActionNode(ExpressionNode): - def __init__(self, idx, typex, expresion): + def __init__(self, idx, typex, expresion, line, column): self.actions: ExpressionNode = expresion self.idx: str = idx self.typex: str = typex + self.line = line + self.column = column class CaseNode(ExpressionNode): - def __init__(self, expression, actions): + def __init__(self, expression, actions, line, column): self.expression: ExpressionNode = expression self.actions: List[ActionNode] = actions + self.line = line + self.column = column class BlockNode(ExpressionNode): diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index 3c6127f6..3eb64e03 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -110,14 +110,10 @@ def build_cool_grammar(): ) class_def %= ( - class_keyword - + typex - + inherits - + typex - + obrack - + empty_feature_list - + cbrack, - lambda s: ClassDef(s[2].lex, s[6], s[2].token_line, s[2].token_column, s[4].lex), + class_keyword + typex + inherits + typex + obrack + empty_feature_list + cbrack, + lambda s: ClassDef( + s[2].lex, s[6], s[2].token_line, s[2].token_column, s[4].lex + ), ) feature_list %= method_def + dot_comma, lambda s: [s[1]] @@ -196,9 +192,13 @@ def build_cool_grammar(): exp %= var_dec, lambda s: s[1] - string_const %= quoted_string_const, lambda s: StringConstant(s[1].lex, s[1].token_line, s[1].token_column - len(s[1].lex)) + string_const %= quoted_string_const, lambda s: StringConstant( + s[1].lex, s[1].token_line, s[1].token_column - len(s[1].lex) + ) - string_const %= tilde_string_const, lambda s: StringConstant(s[1].lex, s[1].token_line, s[1].token_column - len(s[1].lex)) + string_const %= tilde_string_const, lambda s: StringConstant( + s[1].lex, s[1].token_line, s[1].token_column - len(s[1].lex) + ) instantiation %= new + typex, lambda s: InstantiateClassNode( s[2].lex, s[1].token_line, s[1].token_column - 3, [] @@ -271,7 +271,9 @@ def build_cool_grammar(): factor %= num, lambda s: IntegerConstant(s[1].lex) - factor %= idx, lambda s: VariableCall(s[1].lex, s[1].token_line, s[1].token_column - len(s[1].lex)) + factor %= idx, lambda s: VariableCall( + s[1].lex, s[1].token_line, s[1].token_column - len(s[1].lex) + ) factor %= true, lambda s: TrueConstant() @@ -355,10 +357,12 @@ def build_cool_grammar(): actions %= action + actions, lambda s: [s[1]] + s[2] action %= idx + dd + typex + implies + exp + dot_comma, lambda s: ActionNode( - s[1].lex, s[3].lex, s[5] + s[1].lex, s[3].lex, s[5], s[3].token_line, s[3].token_column - len(s[3].lex) ) - case_statement %= case + exp + of + actions + esac, lambda s: CaseNode(s[2], s[4]) + case_statement %= case + exp + of + actions + esac, lambda s: CaseNode( + s[2], s[4], s[1].token_line, s[1].token_column - 4 + ) table = [ (class_keyword, r"(?i)class"), diff --git a/src/testing.py b/src/testing.py index 49648d19..4e45da7d 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,44 +60,28 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""--Attributes are local to the class in which they are defined or inherited. +text = r"""-- Missing type -class A { - a: Int <- 5; -}; -class B inherits A { - b: Bool <- true; - test(x1: Int, y1: Int): Int { - let x: Int <- x1, y: Int <-y1 in { - x <- x + a; - y <- y + a; - if b then x + y else x - y fi; - } - }; -}; -class D inherits B { - d: IO <- new Main.main(); - test3(x1: Int, y1: Int): IO { - let x: Int <- x1, y: Int <-y1, c: String <- "C" in { - x <- x + a; - y <- y + a; - if b then new IO.out_string(c) else d fi; - } - }; -}; -class C inherits B { - c: String <- "C"; - test2(x1: Int, y1: Int): IO { - let x: Int <- x1, y: Int <-y1 in { - x <- x + a; - y <- y + a; - if b then new IO.out_string(c) else d fi; - } - }; -}; +class A { }; +class B inherits A { }; +class C inherits B { }; +class D inherits B { }; +class E inherits B { }; +class F inherits A { }; class Main inherits IO { - main(): IO { out_string("Hello World!") }; + main(): IO { out_string("Hello World!")}; + + b: B <- case "true" of + i: Int => New C; + b: Bool => New D; + s: String => New E; + esac; + + test: A <- case 0 of + b: Bool => new F; + i: Ball => new E; + esac; }; """ pipeline(text, 5) diff --git a/src/travels/inference.py b/src/travels/inference.py index ecd24c7f..a195717f 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -1,10 +1,10 @@ from functools import singledispatchmethod -from typing import Optional +from typing import List, Optional import abstract.semantics as semantic import abstract.tree as coolAst from abstract.semantics import Scope, SemanticError, Type -from abstract.tree import IsVoidNode, SelfNode +from abstract.tree import ActionNode, CaseNode, IsVoidNode, SelfNode from travels.context_actions import ( update_attr_type, update_method_param, @@ -14,6 +14,30 @@ void = semantic.VoidType() +def find_common_parent(e1, e2): + if e1.conforms_to(e2): + return e2 + elif e2.conforms_to(e1): + return e1 + else: + e1_types: List[Type] = [] + while e1: + e1_types.append(e1.parent) + e1 = e1.parent + + while e2 not in e1_types: + e2 = e2.parent + return e2 + # e1_parent = e1.parent + # e2_parent = e2.parent + # while e2_parent != e1_parent: + # if e1_parent.name != "Object": + # e1_parent = e1_parent.parent + # if e2_parent.name != "Object": + # e2_parent = e2_parent.parent + # return e1_parent + + def TypeError(s, l, c): return f"({l}, {c}) - TypeError: {s}" @@ -260,17 +284,39 @@ def _( raise SemanticError( f"Se esperaba una expresion de tipo bool y se obtuvo una de tipo {cond}." ) - if e1.conforms_to(e2): - return e2 - elif e2.conforms_to(e1): - return e1 + return find_common_parent(e1, e2) + + @visit.register + def _(self, node: CaseNode, scope: Scope, infered_type=None, deep=1): + types: List[Type] = [ + self.visit(action, scope, infered_type, deep) for action in node.actions + ] + + actions_types = [action.typex for action in node.actions] + + for i, action in enumerate(node.actions): + try: + self.context.get_type(action.typex) + except SemanticError: + raise SemanticError(f"{action.line, action.column} - TypeError: Class {action.typex} of case branch is undefined.") + if action.typex in actions_types[:i]: + raise SemanticError( + f"{action.line, action.column} - SemanticError: Duplicate branch {action.typex} in case statement." + ) + + if len(types) == 1: + return types[0] + elif len(types) == 2: + return find_common_parent(types[0], types[1]) else: - e1_parent = e1.parent - e2_parent = e2.parent - while e2_parent != e1_parent: - e1_parent = e1_parent.parent - e2_parent = e2_parent.parent - return e1_parent + common = find_common_parent(*types[:2]) + for type_ in types[2:]: + common = find_common_parent(type_, common) + return common + + @visit.register + def _(self, node: ActionNode, scope: Scope, infered_type=None, deep=1): + return self.visit(node.actions, scope, infered_type, deep) @visit.register def _( diff --git a/src/travels/typecollector.py b/src/travels/typecollector.py index 32fc03e6..8ff4c38c 100755 --- a/src/travels/typecollector.py +++ b/src/travels/typecollector.py @@ -167,7 +167,7 @@ def _(self, node: coolAst.ProgramNode): # noqa: F811 self.visit(class_) @visit.register - def _(self, node: coolAst.ClassDef): # noqa: F811 + def _(self, node: coolAst.ClassDef): try: if node.idx in BUILTINS: raise SemanticError( diff --git a/tests/semantic/let2.cl.mips b/tests/semantic/let2.cl.mips new file mode 100644 index 00000000..5a4b6faa --- /dev/null +++ b/tests/semantic/let2.cl.mips @@ -0,0 +1,693 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 21:49:06 2020 +# School of Math and Computer Science, University of Havana +# + +.data +A: + B: + C: + D: + E: + F: + Main: + # + + +.data +# **** VTABLE for type A **** +A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# + + +# **** Type RECORD for type A **** +A_start: + A_vtable_pointer: .word A_vtable + A_end: +# + + +.data +# **** VTABLE for type B **** +B_vtable: .word +# + + +# **** Type RECORD for type B **** +B_start: + B_vtable_pointer: .word B_vtable + B_end: +# + + +.data +# **** VTABLE for type C **** +C_vtable: .word +# + + +# **** Type RECORD for type C **** +C_start: + C_vtable_pointer: .word C_vtable + C_end: +# + + +.data +# **** VTABLE for type D **** +D_vtable: .word +# + + +# **** Type RECORD for type D **** +D_start: + D_vtable_pointer: .word D_vtable + D_end: +# + + +.data +# **** VTABLE for type E **** +E_vtable: .word +# + + +# **** Type RECORD for type E **** +E_start: + E_vtable_pointer: .word E_vtable + E_end: +# + + +.data +# **** VTABLE for type F **** +F_vtable: .word +# + + +# **** Type RECORD for type F **** +F_start: + F_vtable_pointer: .word F_vtable + F_end: +# + + +.data +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + Main_attrib_b: .word 0 + Main_attrib_test: .word 0 + Main_end: +# + + +.data +data_0: .asciiz +# + + +.data +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_A_tdt_entry__: .word 1 +__Object_B_tdt_entry__: .word 2 +__Object_C_tdt_entry__: .word 3 +__Object_D_tdt_entry__: .word 3 +__Object_E_tdt_entry__: .word 3 +__Object_F_tdt_entry__: .word 2 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_A_tdt_entry__: .word -1 +__Int_B_tdt_entry__: .word -1 +__Int_C_tdt_entry__: .word -1 +__Int_D_tdt_entry__: .word -1 +__Int_E_tdt_entry__: .word -1 +__Int_F_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_A_tdt_entry__: .word -1 +__String_B_tdt_entry__: .word -1 +__String_C_tdt_entry__: .word -1 +__String_D_tdt_entry__: .word -1 +__String_E_tdt_entry__: .word -1 +__String_F_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_A_tdt_entry__: .word -1 +__Bool_B_tdt_entry__: .word -1 +__Bool_C_tdt_entry__: .word -1 +__Bool_D_tdt_entry__: .word -1 +__Bool_E_tdt_entry__: .word -1 +__Bool_F_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_A_tdt_entry__: .word -1 +__IO_B_tdt_entry__: .word -1 +__IO_C_tdt_entry__: .word -1 +__IO_D_tdt_entry__: .word -1 +__IO_E_tdt_entry__: .word -1 +__IO_F_tdt_entry__: .word -1 +__IO_Main_tdt_entry__: .word 1 +__A_Object_tdt_entry__: .word -1 +__A_Int_tdt_entry__: .word -1 +__A_String_tdt_entry__: .word -1 +__A_Bool_tdt_entry__: .word -1 +__A_IO_tdt_entry__: .word -1 +__A_A_tdt_entry__: .word 0 +__A_B_tdt_entry__: .word 1 +__A_C_tdt_entry__: .word 2 +__A_D_tdt_entry__: .word 2 +__A_E_tdt_entry__: .word 2 +__A_F_tdt_entry__: .word 1 +__A_Main_tdt_entry__: .word -1 +__B_Object_tdt_entry__: .word -1 +__B_Int_tdt_entry__: .word -1 +__B_String_tdt_entry__: .word -1 +__B_Bool_tdt_entry__: .word -1 +__B_IO_tdt_entry__: .word -1 +__B_A_tdt_entry__: .word -1 +__B_B_tdt_entry__: .word 0 +__B_C_tdt_entry__: .word 1 +__B_D_tdt_entry__: .word 1 +__B_E_tdt_entry__: .word 1 +__B_F_tdt_entry__: .word -1 +__B_Main_tdt_entry__: .word -1 +__C_Object_tdt_entry__: .word -1 +__C_Int_tdt_entry__: .word -1 +__C_String_tdt_entry__: .word -1 +__C_Bool_tdt_entry__: .word -1 +__C_IO_tdt_entry__: .word -1 +__C_A_tdt_entry__: .word -1 +__C_B_tdt_entry__: .word -1 +__C_C_tdt_entry__: .word 0 +__C_D_tdt_entry__: .word -1 +__C_E_tdt_entry__: .word -1 +__C_F_tdt_entry__: .word -1 +__C_Main_tdt_entry__: .word -1 +__D_Object_tdt_entry__: .word -1 +__D_Int_tdt_entry__: .word -1 +__D_String_tdt_entry__: .word -1 +__D_Bool_tdt_entry__: .word -1 +__D_IO_tdt_entry__: .word -1 +__D_A_tdt_entry__: .word -1 +__D_B_tdt_entry__: .word -1 +__D_C_tdt_entry__: .word -1 +__D_D_tdt_entry__: .word 0 +__D_E_tdt_entry__: .word -1 +__D_F_tdt_entry__: .word -1 +__D_Main_tdt_entry__: .word -1 +__E_Object_tdt_entry__: .word -1 +__E_Int_tdt_entry__: .word -1 +__E_String_tdt_entry__: .word -1 +__E_Bool_tdt_entry__: .word -1 +__E_IO_tdt_entry__: .word -1 +__E_A_tdt_entry__: .word -1 +__E_B_tdt_entry__: .word -1 +__E_C_tdt_entry__: .word -1 +__E_D_tdt_entry__: .word -1 +__E_E_tdt_entry__: .word 0 +__E_F_tdt_entry__: .word -1 +__E_Main_tdt_entry__: .word -1 +__F_Object_tdt_entry__: .word -1 +__F_Int_tdt_entry__: .word -1 +__F_String_tdt_entry__: .word -1 +__F_Bool_tdt_entry__: .word -1 +__F_IO_tdt_entry__: .word -1 +__F_A_tdt_entry__: .word -1 +__F_B_tdt_entry__: .word -1 +__F_C_tdt_entry__: .word -1 +__F_D_tdt_entry__: .word -1 +__F_E_tdt_entry__: .word -1 +__F_F_tdt_entry__: .word 0 +__F_Main_tdt_entry__: .word -1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_A_tdt_entry__: .word -1 +__Main_B_tdt_entry__: .word -1 +__Main_C_tdt_entry__: .word -1 +__Main_D_tdt_entry__: .word -1 +__Main_E_tdt_entry__: .word -1 +__Main_F_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +.data +data_2: .asciiz "Hello World!" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # main END + +.text +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +.text +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + jal __Main__attrib__b__init + sw $v0, 8($t1) + jal __Main__attrib__test__init + sw $v0, 12($t1) + sw $t1, -4($fp) + # ARG local__internal_0 + # LOCAL local__internal_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# __Main__attrib__b__init implementation. +# @Params: +__Main__attrib__b__init: + # Allocate stack frame for function __Main__attrib__b__init. + subu $sp, $sp, 40 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 40 + # LOCAL local_ttrib__b__init_a_0 --> -4($fp) + # local_ttrib__b__init_a_0 = 0 + li $t0, 0 + sw $t0, -4($fp) + # LOCAL local_ttrib__b__init_a_1 --> -8($fp) + # local_ttrib__b__init_a_1 = 5 + li $t0, 5 + sw $t0, -8($fp) + # LOCAL local_ttrib__b__init_a_2 --> -12($fp) + # local_ttrib__b__init_a_2 = 0 + li $t0, 0 + sw $t0, -12($fp) + # LOCAL local_ttrib__b__init_internal_4 --> -20($fp) + # local_ttrib__b__init_internal_4 = ALLOCATE F + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, F + sw $t0, 0($v0) + la $t0, F_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -20($fp) + # LOCAL local_ttrib__b__init_a_3 --> -16($fp) + # LOCAL local_ttrib__b__init_internal_4 --> -20($fp) + # local_ttrib__b__init_a_3 = local_ttrib__b__init_internal_4 + lw $t0, -20($fp) + sw $t0, -16($fp) + # LOCAL local_ttrib__b__init_b_5 --> -24($fp) + # local_ttrib__b__init_b_5 = ALLOCATE B + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, B + sw $t0, 0($v0) + la $t0, B_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -24($fp) + # LOCAL local_ttrib__b__init_internal_6 --> -28($fp) + # local_ttrib__b__init_internal_6 = ALLOCATE E + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, E + sw $t0, 0($v0) + la $t0, E_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -28($fp) + # LOCAL local_ttrib__b__init_b_5 --> -24($fp) + # LOCAL local_ttrib__b__init_internal_6 --> -28($fp) + # local_ttrib__b__init_b_5 = local_ttrib__b__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + # local_ttrib__b__init_internal_7 = GETATTRIBUTE b Main + # LOCAL local_ttrib__b__init_internal_7 --> -32($fp) + lw $t0, 8($s1) + sw $t0, -32($fp) + # RETURN local_ttrib__b__init_internal_7 + lw $v0, -32($fp) + # Deallocate stack frame for function __Main__attrib__b__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 40 + jr $ra + # Function END + + +.text +# __Main__attrib__test__init implementation. +# @Params: +__Main__attrib__test__init: + # Allocate stack frame for function __Main__attrib__test__init. + subu $sp, $sp, 40 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 40 + # LOCAL local_ttrib__test__init_a_0 --> -4($fp) + # local_ttrib__test__init_a_0 = 0 + li $t0, 0 + sw $t0, -4($fp) + # LOCAL local_ttrib__test__init_a_1 --> -8($fp) + # local_ttrib__test__init_a_1 = 5 + li $t0, 5 + sw $t0, -8($fp) + # LOCAL local_ttrib__test__init_a_2 --> -12($fp) + # local_ttrib__test__init_a_2 = 0 + li $t0, 0 + sw $t0, -12($fp) + # LOCAL local_ttrib__test__init_internal_4 --> -20($fp) + # local_ttrib__test__init_internal_4 = ALLOCATE F + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, F + sw $t0, 0($v0) + la $t0, F_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -20($fp) + # LOCAL local_ttrib__test__init_a_3 --> -16($fp) + # LOCAL local_ttrib__test__init_internal_4 --> -20($fp) + # local_ttrib__test__init_a_3 = local_ttrib__test__init_internal_4 + lw $t0, -20($fp) + sw $t0, -16($fp) + # LOCAL local_ttrib__test__init_b_5 --> -24($fp) + # local_ttrib__test__init_b_5 = ALLOCATE B + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, B + sw $t0, 0($v0) + la $t0, B_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -24($fp) + # LOCAL local_ttrib__test__init_internal_6 --> -28($fp) + # local_ttrib__test__init_internal_6 = ALLOCATE E + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, E + sw $t0, 0($v0) + la $t0, E_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -28($fp) + # LOCAL local_ttrib__test__init_b_5 --> -24($fp) + # LOCAL local_ttrib__test__init_internal_6 --> -28($fp) + # local_ttrib__test__init_b_5 = local_ttrib__test__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + # local_ttrib__test__init_internal_7 = GETATTRIBUTE b Main + # LOCAL local_ttrib__test__init_internal_7 --> -32($fp) + lw $t0, 8($s1) + sw $t0, -32($fp) + # RETURN local_ttrib__test__init_internal_7 + lw $v0, -32($fp) + # Deallocate stack frame for function __Main__attrib__test__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 40 + jr $ra + # Function END + + +.text +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 + lw $t0, -12($fp) + # Load pointer to type + lw $t1, 4($t0) + sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # + lw $t0, data_2 + sw $t0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, -4($fp) + # Get pointer to type's VTABLE + lw $t1, 0($t0) + # Get pointer to function address + lw $t2, 0($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/semantic/loops1.cl.mips b/tests/semantic/loops1.cl.mips new file mode 100644 index 00000000..9dfafc8f --- /dev/null +++ b/tests/semantic/loops1.cl.mips @@ -0,0 +1,394 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 21:49:06 2020 +# School of Math and Computer Science, University of Havana +# + +.data +Main: + # + + +.data +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + Main_attrib_i: .word 0 + Main_attrib_test: .word 0 + Main_end: +# + + +.data +data_0: .asciiz +# + + +.data +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_Main_tdt_entry__: .word 1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +.data +data_2: .asciiz "true" +# + + +.data +data_3: .asciiz "Hello World!" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # main END + +.text +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +.text +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + jal __Main__attrib__i__init + sw $v0, 8($t1) + jal __Main__attrib__test__init + sw $v0, 12($t1) + sw $t1, -4($fp) + # ARG local__internal_0 + # LOCAL local__internal_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# __Main__attrib__i__init implementation. +# @Params: +__Main__attrib__i__init: + # Allocate stack frame for function __Main__attrib__i__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 1 + li $v0, 1 + # Deallocate stack frame for function __Main__attrib__i__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# __Main__attrib__test__init implementation. +# @Params: +__Main__attrib__test__init: + # Allocate stack frame for function __Main__attrib__test__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + label_WHILE_1: + # LOCAL local_ttrib__test__init_internal_0 --> -4($fp) + # + lw $t0, data_2 + sw $t0, -4($fp) + # IF_ZERO local_ttrib__test__init_internal_0 GOTO label_WHILE_END_2 + # IF_ZERO local_ttrib__test__init_internal_0 GOTO label_WHILE_END_2 + lw $t0, -4($fp) + beq $t0, 0, label_WHILE_END_2 + # = + # GOTO label_WHILE_1 + j label_WHILE_1 + label_WHILE_END_2: + # RETURN + # Deallocate stack frame for function __Main__attrib__test__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 + lw $t0, -12($fp) + # Load pointer to type + lw $t1, 4($t0) + sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # + lw $t0, data_3 + sw $t0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, -4($fp) + # Get pointer to type's VTABLE + lw $t1, 0($t0) + # Get pointer to function address + lw $t2, 0($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/semantic/loops2.cl.mips b/tests/semantic/loops2.cl.mips new file mode 100644 index 00000000..20352871 --- /dev/null +++ b/tests/semantic/loops2.cl.mips @@ -0,0 +1,426 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 21:48:59 2020 +# School of Math and Computer Science, University of Havana +# + +.data +Main: + # + + +.data +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + Main_attrib_i: .word 0 + Main_attrib_test: .word 0 + Main_attrib_test2: .word 0 + Main_end: +# + + +.data +data_0: .asciiz +# + + +.data +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_Main_tdt_entry__: .word 1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +.data +data_2: .asciiz "Hello World!" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # main END + +.text +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +.text +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + jal __Main__attrib__i__init + sw $v0, 8($t1) + jal __Main__attrib__test__init + sw $v0, 12($t1) + jal __Main__attrib__test2__init + sw $v0, 16($t1) + sw $t1, -4($fp) + # ARG local__internal_0 + # LOCAL local__internal_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# __Main__attrib__i__init implementation. +# @Params: +__Main__attrib__i__init: + # Allocate stack frame for function __Main__attrib__i__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 1 + li $v0, 1 + # Deallocate stack frame for function __Main__attrib__i__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# __Main__attrib__test__init implementation. +# @Params: +__Main__attrib__test__init: + # Allocate stack frame for function __Main__attrib__test__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + label_WHILE_1: + # LOCAL local_ttrib__test__init_internal_0 --> -4($fp) + # local_ttrib__test__init_internal_0 = 1 + li $t0, 1 + sw $t0, -4($fp) + # IF_ZERO local_ttrib__test__init_internal_0 GOTO label_WHILE_END_2 + # IF_ZERO local_ttrib__test__init_internal_0 GOTO label_WHILE_END_2 + lw $t0, -4($fp) + beq $t0, 0, label_WHILE_END_2 + # = + # GOTO label_WHILE_1 + j label_WHILE_1 + label_WHILE_END_2: + # RETURN + # Deallocate stack frame for function __Main__attrib__test__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# __Main__attrib__test2__init implementation. +# @Params: +__Main__attrib__test2__init: + # Allocate stack frame for function __Main__attrib__test2__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + label_WHILE_3: + # LOCAL local_ttrib__test2__init_internal_0 --> -4($fp) + # local_ttrib__test2__init_internal_0 = 1 + li $t0, 1 + sw $t0, -4($fp) + # IF_ZERO local_ttrib__test2__init_internal_0 GOTO label_WHILE_END_4 + # IF_ZERO local_ttrib__test2__init_internal_0 GOTO label_WHILE_END_4 + lw $t0, -4($fp) + beq $t0, 0, label_WHILE_END_4 + # = + # GOTO label_WHILE_3 + j label_WHILE_3 + label_WHILE_END_4: + # RETURN + # Deallocate stack frame for function __Main__attrib__test2__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 + lw $t0, -12($fp) + # Load pointer to type + lw $t1, 4($t0) + sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # + lw $t0, data_2 + sw $t0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, -4($fp) + # Get pointer to type's VTABLE + lw $t1, 0($t0) + # Get pointer to function address + lw $t2, 0($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/semantic/self2.cl.mips b/tests/semantic/self2.cl.mips new file mode 100644 index 00000000..f7f835f6 --- /dev/null +++ b/tests/semantic/self2.cl.mips @@ -0,0 +1,378 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 21:49:03 2020 +# School of Math and Computer Science, University of Havana +# + +.data +Main: + # + + +.data +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main, function_test_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + Main_end: +# + + +.data +data_0: .asciiz +# + + +.data +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_Main_tdt_entry__: .word 1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +.data +data_2: .asciiz "Hello World!" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # main END + +.text +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +.text +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -4($fp) + # ARG local__internal_0 + # LOCAL local__internal_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 + lw $t0, -12($fp) + # Load pointer to type + lw $t1, 4($t0) + sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # + lw $t0, data_2 + sw $t0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, -4($fp) + # Get pointer to type's VTABLE + lw $t1, 0($t0) + # Get pointer to function address + lw $t2, 0($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_test_at_Main implementation. +# @Params: +function_test_at_Main: + # Allocate stack frame for function function_test_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_test_at_Main_self_0 --> -4($fp) + # local_test_at_Main_self_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -4($fp) + # LOCAL local_test_at_Main_internal_1 --> -8($fp) + # local_test_at_Main_internal_1 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -8($fp) + # LOCAL local_test_at_Main_self_0 --> -4($fp) + # LOCAL local_test_at_Main_internal_1 --> -8($fp) + # local_test_at_Main_self_0 = local_test_at_Main_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # RETURN local_test_at_Main_self_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_test_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/semantic/self3.cl.mips b/tests/semantic/self3.cl.mips new file mode 100644 index 00000000..ce9f8e6a --- /dev/null +++ b/tests/semantic/self3.cl.mips @@ -0,0 +1,352 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 21:49:02 2020 +# School of Math and Computer Science, University of Havana +# + +.data +Main: + # + + +.data +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main, function_test_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + Main_end: +# + + +.data +data_0: .asciiz +# + + +.data +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_Main_tdt_entry__: .word 1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +.data +data_2: .asciiz "Hello World!" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # main END + +.text +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +.text +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + sw $t1, -4($fp) + # ARG local__internal_0 + # LOCAL local__internal_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 + lw $t0, -12($fp) + # Load pointer to type + lw $t1, 4($t0) + sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # + lw $t0, data_2 + sw $t0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, -4($fp) + # Get pointer to type's VTABLE + lw $t1, 0($t0) + # Get pointer to function address + lw $t2, 0($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_test_at_Main implementation. +# @Params: +# 0($fp) = param_test_at_Main_self_0 +function_test_at_Main: + # Allocate stack frame for function function_test_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN + lw $v0, + # Deallocate stack frame for function function_test_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + diff --git a/tests/semantic/self4.cl.mips b/tests/semantic/self4.cl.mips new file mode 100644 index 00000000..ff5aad27 --- /dev/null +++ b/tests/semantic/self4.cl.mips @@ -0,0 +1,356 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 21:49:04 2020 +# School of Math and Computer Science, University of Havana +# + +.data +Main: + # + + +.data +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + Main_attrib_self: .word 0 + Main_end: +# + + +.data +data_0: .asciiz +# + + +.data +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_Main_tdt_entry__: .word 1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +.data +data_2: .asciiz "Hello World!" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # main END + +.text +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +.text +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +.text +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + la $t0, Main + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + move $t1, $v0 + jal __Main__attrib__self__init + sw $v0, 8($t1) + sw $t1, -4($fp) + # ARG local__internal_0 + # LOCAL local__internal_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# __Main__attrib__self__init implementation. +# @Params: +__Main__attrib__self__init: + # Allocate stack frame for function __Main__attrib__self__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_ttrib__self__init_internal_0 = GETATTRIBUTE self Main + # LOCAL local_ttrib__self__init_internal_0 --> -4($fp) + lw $t0, 8($s1) + sw $t0, -4($fp) + # RETURN local_ttrib__self__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__self__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +.text +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 + lw $t0, -12($fp) + # Load pointer to type + lw $t1, 4($t0) + sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # + lw $t0, data_2 + sw $t0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, -4($fp) + # Get pointer to type's VTABLE + lw $t1, 0($t0) + # Get pointer to function address + lw $t2, 0($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + From 8c47c7b70486a4ba8cb2a043df56bcc92d316214 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 27 Nov 2020 22:28:48 -0500 Subject: [PATCH 120/162] fix conditionals error messages --- src/.builds | 1 + src/abstract/tree.py | 4 +++- src/coolgrammar/grammar.py | 2 +- src/testing.py | 23 ++++++++++++----------- src/travels/inference.py | 2 +- src/travels/typecollector.py | 2 +- tests/semantic/let2.cl.mips | 2 +- tests/semantic/loops1.cl.mips | 2 +- tests/semantic/loops2.cl.mips | 2 +- tests/semantic/self2.cl.mips | 2 +- tests/semantic/self3.cl.mips | 4 ++-- tests/semantic/self4.cl.mips | 2 +- 12 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/.builds b/src/.builds index c4bc166a..7bf9f7ef 100644 --- a/src/.builds +++ b/src/.builds @@ -186,3 +186,4 @@ 1 1 1 +1 diff --git a/src/abstract/tree.py b/src/abstract/tree.py index aeecb9ec..a2afe96f 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -128,10 +128,12 @@ def __init__(self, lex): class IfThenElseNode(ExpressionNode): - def __init__(self, cond, expr1, expr2): + def __init__(self, cond, expr1, expr2, line, column): self.cond: ExpressionNode = cond self.expr1: ExpressionNode = expr1 self.expr2: ExpressionNode = expr2 + self.line = line + self.column = column class PlusNode(BinaryNode): diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index 3eb64e03..ec6f6183 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -256,7 +256,7 @@ def build_cool_grammar(): # term %= not_operator + factor, lambda s: NegNode(s[2], s[1].token_line, s[1].token_column + 1) factor %= if_ + exp + then + exp + else_ + exp + fi, lambda s: IfThenElseNode( - s[2], s[4], s[6] + s[2], s[4], s[6], s[1].token_line, s[1].token_column - 2 ) exp %= not_operator + exp, lambda s: NegNode( diff --git a/src/testing.py b/src/testing.py index 4e45da7d..ce035e9a 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,7 +60,10 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""-- Missing type +text = r"""(* +Let T and F be the static types of the branches of the conditional. Then the static type of the +conditional is T t F. (think: Walk towards Object from each of T and F until the paths meet.) +*) class A { }; class B inherits A { }; @@ -72,16 +75,14 @@ class F inherits A { }; class Main inherits IO { main(): IO { out_string("Hello World!")}; - b: B <- case "true" of - i: Int => New C; - b: Bool => New D; - s: String => New E; - esac; + b: B <- if true then + new C + else + if false then new D + else new E fi + fi; - test: A <- case 0 of - b: Bool => new F; - i: Ball => new E; - esac; -}; + test: B <- if not true then new F else new E fi; +}; """ pipeline(text, 5) diff --git a/src/travels/inference.py b/src/travels/inference.py index a195717f..b97d8b36 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -282,7 +282,7 @@ def _( e2 = self.visit(node.expr2, scope, infered_type, deep) if cond != self.BOOL: raise SemanticError( - f"Se esperaba una expresion de tipo bool y se obtuvo una de tipo {cond}." + f"{node.cond.line, node.cond.column} - TypeError: Predicate of 'if' does not have type Bool." ) return find_common_parent(e1, e2) diff --git a/src/travels/typecollector.py b/src/travels/typecollector.py index 8ff4c38c..f6339aa2 100755 --- a/src/travels/typecollector.py +++ b/src/travels/typecollector.py @@ -175,4 +175,4 @@ def _(self, node: coolAst.ClassDef): ) self.context.create_type(node.idx) except SemanticError as e: - self.errors.append(e.text) + raise SemanticError(f"{node.line, node.column - 2} - SemanticError: Classes may not be redefined") diff --git a/tests/semantic/let2.cl.mips b/tests/semantic/let2.cl.mips index 5a4b6faa..5550f03c 100644 --- a/tests/semantic/let2.cl.mips +++ b/tests/semantic/let2.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 21:49:06 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 22:27:49 2020 # School of Math and Computer Science, University of Havana # diff --git a/tests/semantic/loops1.cl.mips b/tests/semantic/loops1.cl.mips index 9dfafc8f..d4495265 100644 --- a/tests/semantic/loops1.cl.mips +++ b/tests/semantic/loops1.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 21:49:06 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 22:27:49 2020 # School of Math and Computer Science, University of Havana # diff --git a/tests/semantic/loops2.cl.mips b/tests/semantic/loops2.cl.mips index 20352871..4990ccea 100644 --- a/tests/semantic/loops2.cl.mips +++ b/tests/semantic/loops2.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 21:48:59 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 22:27:41 2020 # School of Math and Computer Science, University of Havana # diff --git a/tests/semantic/self2.cl.mips b/tests/semantic/self2.cl.mips index f7f835f6..3e0cdb18 100644 --- a/tests/semantic/self2.cl.mips +++ b/tests/semantic/self2.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 21:49:03 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 22:27:45 2020 # School of Math and Computer Science, University of Havana # diff --git a/tests/semantic/self3.cl.mips b/tests/semantic/self3.cl.mips index ce9f8e6a..c0a41a38 100644 --- a/tests/semantic/self3.cl.mips +++ b/tests/semantic/self3.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 21:49:02 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 22:27:44 2020 # School of Math and Computer Science, University of Havana # @@ -337,7 +337,7 @@ function_test_at_Main: sw $fp, 0($sp) addu $fp, $sp, 32 # RETURN - lw $v0, + lw $v0, # Deallocate stack frame for function function_test_at_Main. # Restore $ra lw $ra, 4($sp) diff --git a/tests/semantic/self4.cl.mips b/tests/semantic/self4.cl.mips index ff5aad27..9edf3cf6 100644 --- a/tests/semantic/self4.cl.mips +++ b/tests/semantic/self4.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 21:49:04 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 22:27:46 2020 # School of Math and Computer Science, University of Havana # From 5d3883f5ec7343673649a96aeb600d83d580d095 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 27 Nov 2020 23:14:16 -0500 Subject: [PATCH 121/162] Fix error messages for dispatchs --- src/.builds | 5 + src/abstract/tree.py | 10 +- src/coolgrammar/grammar.py | 15 +- src/testing.py | 41 ++-- src/travels/inference.py | 81 +++++++- tests/semantic/let2.cl.mips | 2 +- tests/semantic/loops1.cl.mips | 2 +- tests/semantic/loops2.cl.mips | 2 +- tests/semantic/self2.cl.mips | 378 ---------------------------------- tests/semantic/self3.cl.mips | 352 ------------------------------- tests/semantic/self4.cl.mips | 356 -------------------------------- 11 files changed, 128 insertions(+), 1116 deletions(-) delete mode 100644 tests/semantic/self2.cl.mips delete mode 100644 tests/semantic/self3.cl.mips delete mode 100644 tests/semantic/self4.cl.mips diff --git a/src/.builds b/src/.builds index 7bf9f7ef..e4e87116 100644 --- a/src/.builds +++ b/src/.builds @@ -187,3 +187,8 @@ 1 1 1 +1 +1 +1 +1 +1 diff --git a/src/abstract/tree.py b/src/abstract/tree.py index a2afe96f..c5e5aac3 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -162,15 +162,17 @@ def __init__(self, obj, idx, arg_list, line, column): self.id: str = idx self.args: List[ExpressionNode] = arg_list self.line = line - self.column = column - len(idx) + self.column = column class ParentFuncCall(ExpressionNode): - def __init__(self, obj, parent_type, idx, arg_list): + def __init__(self, obj, parent_type, idx, arg_list, line, column): self.obj: ExpressionNode = obj self.parent_type: str = parent_type self.idx: str = idx self.arg_list: List[ExpressionNode] = arg_list + self.line = line + self.column = column class AssignNode(ExpressionNode): @@ -332,4 +334,6 @@ def __init__(self, expr): class SelfNode(ExpressionNode): - pass \ No newline at end of file + def __init__(self, line, column) -> None: + self.line = line + self.column = column \ No newline at end of file diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index ec6f6183..6a6a4e04 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -62,7 +62,7 @@ def build_cool_grammar(): " " ) - class_keyword, def_keyword, in_keyword = G.Terminals("class def in") + class_keyword, def_keyword, in_keyword, self_ = G.Terminals("class def in self") ( coma, @@ -278,18 +278,22 @@ def build_cool_grammar(): factor %= true, lambda s: TrueConstant() factor %= factor + period + idx + opar + args_list_empty + cpar, lambda s: FunCall( - s[1], s[3].lex, s[5], s[3].token_line, s[3].token_column + s[1], s[3].lex, s[5], s[1].line, s[1].column ) factor %= string_const, lambda s: s[1] factor %= idx + opar + args_list_empty + cpar, lambda s: FunCall( - SelfNode(), s[1].lex, s[3], s[1].token_line, s[1].token_column + SelfNode(s[1].token_line, s[1].token_column - len(s[1].lex)), + s[1].lex, + s[3], + s[1].token_line, + s[1].token_column, ) factor %= ( factor + arroba + typex + period + idx + opar + args_list_empty + cpar, - lambda s: ParentFuncCall(s[1], s[3].lex, s[5].lex, s[7]), + lambda s: ParentFuncCall(s[1], s[3].lex, s[5].lex, s[7], s[1].line, s[1].column), ) factor %= false, lambda s: FalseConstant() @@ -328,6 +332,8 @@ def build_cool_grammar(): s[1], s[3], s[2].token_line, s[2].token_column - 2 ) + factor %= self_, lambda s: SelfNode(s[1].token_line, s[1].token_column - len(s[1].lex)) + atom %= arith, lambda s: s[1] typex %= intx, lambda s: s[1] @@ -366,6 +372,7 @@ def build_cool_grammar(): table = [ (class_keyword, r"(?i)class"), + (self_, r"(?i)self"), (def_keyword, r"(?i)def"), (in_keyword, r"(?i)in"), (intx, r"Int"), diff --git a/src/testing.py b/src/testing.py index ce035e9a..a1cd5e55 100755 --- a/src/testing.py +++ b/src/testing.py @@ -61,28 +61,37 @@ def pipeline(program: str, deep: int) -> None: text = r"""(* -Let T and F be the static types of the branches of the conditional. Then the static type of the -conditional is T t F. (think: Walk towards Object from each of T and F until the paths meet.) +e@B.f() invokes the method +f in class B on the object that is the value of e. For this form of dispatch, the static type to the left of +“@”must conform to the type specified to the right of “@”. *) -class A { }; -class B inherits A { }; -class C inherits B { }; -class D inherits B { }; -class E inherits B { }; -class F inherits A { }; +class A { + f(x: Int, y: Int): Int { x + y }; + g(x: Int): Int { x + x }; +}; +class B inherits A { + f(a: Int, b: Int): Int { a - b }; + sum(m: Int, n: Int, p: Int): Int { m + n + p }; +}; +class C inherits B { + ident(m: Int): Int { m }; + f(m: Int, n: Int): Int { m * n }; +}; +class D inherits B { + ident(v: String): IO { new IO.out_string(v) }; + f(v: Int, w: Int): Int { v / w }; + g(v: Int): Int { v + v + v }; + sum(v: Int, w: Int, z: Int): Int { v - w - z }; +}; class Main inherits IO { main(): IO { out_string("Hello World!")}; - b: B <- if true then - new C - else - if false then new D - else new E fi - fi; - - test: B <- if not true then new F else new E fi; + a: A <- new D; + b: Int <- new D@B.sum(1, 2, 3); + test: Int <- a@B.sum(1, 2, 3); }; + """ pipeline(text, 5) diff --git a/src/travels/inference.py b/src/travels/inference.py index b97d8b36..79af0c15 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -4,7 +4,7 @@ import abstract.semantics as semantic import abstract.tree as coolAst from abstract.semantics import Scope, SemanticError, Type -from abstract.tree import ActionNode, CaseNode, IsVoidNode, SelfNode +from abstract.tree import ActionNode, CaseNode, IsVoidNode, ParentFuncCall, SelfNode from travels.context_actions import ( update_attr_type, update_method_param, @@ -269,6 +269,10 @@ def _( f"{node.line, node.column} - NameError: Undeclared identifier {node.idx}." ) + @visit.register + def _(self, node: SelfNode, scope: Scope, infered_type=None, deep=1): + return self.current_type + @visit.register def _( self, @@ -298,7 +302,9 @@ def _(self, node: CaseNode, scope: Scope, infered_type=None, deep=1): try: self.context.get_type(action.typex) except SemanticError: - raise SemanticError(f"{action.line, action.column} - TypeError: Class {action.typex} of case branch is undefined.") + raise SemanticError( + f"{action.line, action.column} - TypeError: Class {action.typex} of case branch is undefined." + ) if action.typex in actions_types[:i]: raise SemanticError( f"{action.line, action.column} - SemanticError: Duplicate branch {action.typex} in case statement." @@ -367,6 +373,63 @@ def _( return_type = self.visit(node.block_statements, scope, infered_type, deep) return return_type + @visit.register + def _(self, node: ParentFuncCall, scope: Scope, infered_type=None, deep=1): + assert self.current_type is not None + + # Encontrar el tipo que hace el dispatch + try: + dispatch_type = self.context.get_type(node.parent_type) + except SemanticError: + raise SemanticError( + f"{node.line, node.column} - TypeError: Type {node.parent_type} is undefined." + ) + + # Evaluar la expresion sobre la que se hace el dispatch + static_expr0_type = self.visit(node.obj, scope, infered_type, deep) + + if static_expr0_type.name == "SELF_TYPE": + static_expr0_type = self.current_type + + if not static_expr0_type.conforms_to(dispatch_type): + raise SemanticError( + f"{node.line, node.column} - TypeError: Expression type {static_expr0_type.name} does not conform to declared static dispatch type {dispatch_type.name}." + ) + + # Encontrar el metodo en el tipo. + try: + method: semantic.Method = dispatch_type.get_method(node.idx) + except SemanticError: + raise SemanticError( + f"{node.line, node.column} - AttributeError: Dispatch to undefined method {node.idx}." + ) + + if len(method.param_names) != len(node.arg_list): + raise SemanticError( + f"{node.line, node.column} - SemanticError: Method {node.idx} called with wrong number of arguments." + ) + + # Iterar por cada parametro del metodo y chequear que cada expresion corresponda en tipo. + for expr_i, type_i, param_name in zip( + node.arg_list, method.param_types, method.param_names + ): + type_expr_i = self.visit(expr_i, scope, infered_type, deep) + if not type_expr_i.conforms_to(type_i): + raise semantic.SemanticError( + f"{expr_i.line, expr_i.column} - TypeError: Expression corresponding to param {param_name} in call to {node.idx} must conform to {type_i.name}" + ) + + # Procesar el tipo de retorno de la funcion + if method.return_type == self.SELF_TYPE: + return static_expr0_type + if method.return_type != self.AUTO_TYPE: + return method.return_type + elif infered_type: + method.return_type = infered_type + return infered_type + else: + return self.AUTO_TYPE + @visit.register def _( self, node: coolAst.FunCall, scope: semantic.Scope, infered_type=None, deep=1 @@ -381,7 +444,17 @@ def _( static_expr0_type = self.current_type # Encontrar el metodo en el tipo. - method: semantic.Method = static_expr0_type.get_method(node.id) + try: + method: semantic.Method = static_expr0_type.get_method(node.id) + except SemanticError: + raise SemanticError( + f"{node.line, node.column} - AttributeError: Dispatch to undefined method {node.id}." + ) + + if len(method.param_names) != len(node.args): + raise SemanticError( + f"{node.line, node.column} - SemanticError: Method {node.id} called with wrong number of arguments." + ) # Iterar por cada parametro del metodo y chequear que cada expresion corresponda en tipo. for expr_i, type_i, param_name in zip( @@ -390,7 +463,7 @@ def _( type_expr_i = self.visit(expr_i, scope, infered_type, deep) if not type_expr_i.conforms_to(type_i): raise semantic.SemanticError( - f"Expression corresponding to param {param_name} in call to {node.id} must conform to {type_i}" + f"{expr_i.line, expr_i.column} - TypeError: Expression corresponding to param {param_name} in call to {node.id} must conform to {type_i.name}" ) # Procesar el tipo de retorno de la funcion diff --git a/tests/semantic/let2.cl.mips b/tests/semantic/let2.cl.mips index 5550f03c..51d631ea 100644 --- a/tests/semantic/let2.cl.mips +++ b/tests/semantic/let2.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 22:27:49 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:13:47 2020 # School of Math and Computer Science, University of Havana # diff --git a/tests/semantic/loops1.cl.mips b/tests/semantic/loops1.cl.mips index d4495265..b6c18e1c 100644 --- a/tests/semantic/loops1.cl.mips +++ b/tests/semantic/loops1.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 22:27:49 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:13:46 2020 # School of Math and Computer Science, University of Havana # diff --git a/tests/semantic/loops2.cl.mips b/tests/semantic/loops2.cl.mips index 4990ccea..4c15595c 100644 --- a/tests/semantic/loops2.cl.mips +++ b/tests/semantic/loops2.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 22:27:41 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:13:40 2020 # School of Math and Computer Science, University of Havana # diff --git a/tests/semantic/self2.cl.mips b/tests/semantic/self2.cl.mips deleted file mode 100644 index 3e0cdb18..00000000 --- a/tests/semantic/self2.cl.mips +++ /dev/null @@ -1,378 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 22:27:45 2020 -# School of Math and Computer Science, University of Havana -# - -.data -Main: - # - - -.data -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main, function_test_at_Main -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - Main_end: -# - - -.data -data_0: .asciiz -# - - -.data -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -.data -data_2: .asciiz "Hello World!" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # main END - -.text -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -.text -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -4($fp) - # ARG local__internal_0 - # LOCAL local__internal_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 - lw $t0, -12($fp) - # Load pointer to type - lw $t1, 4($t0) - sw $t1, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # - lw $t0, data_2 - sw $t0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, -4($fp) - # Get pointer to type's VTABLE - lw $t1, 0($t0) - # Get pointer to function address - lw $t2, 0($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_main_at_Main_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_test_at_Main implementation. -# @Params: -function_test_at_Main: - # Allocate stack frame for function function_test_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_test_at_Main_self_0 --> -4($fp) - # local_test_at_Main_self_0 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -4($fp) - # LOCAL local_test_at_Main_internal_1 --> -8($fp) - # local_test_at_Main_internal_1 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -8($fp) - # LOCAL local_test_at_Main_self_0 --> -4($fp) - # LOCAL local_test_at_Main_internal_1 --> -8($fp) - # local_test_at_Main_self_0 = local_test_at_Main_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # RETURN local_test_at_Main_self_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_test_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - diff --git a/tests/semantic/self3.cl.mips b/tests/semantic/self3.cl.mips deleted file mode 100644 index c0a41a38..00000000 --- a/tests/semantic/self3.cl.mips +++ /dev/null @@ -1,352 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 22:27:44 2020 -# School of Math and Computer Science, University of Havana -# - -.data -Main: - # - - -.data -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main, function_test_at_Main -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - Main_end: -# - - -.data -data_0: .asciiz -# - - -.data -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -.data -data_2: .asciiz "Hello World!" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # main END - -.text -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -.text -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -4($fp) - # ARG local__internal_0 - # LOCAL local__internal_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 - lw $t0, -12($fp) - # Load pointer to type - lw $t1, 4($t0) - sw $t1, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # - lw $t0, data_2 - sw $t0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, -4($fp) - # Get pointer to type's VTABLE - lw $t1, 0($t0) - # Get pointer to function address - lw $t2, 0($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_main_at_Main_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_test_at_Main implementation. -# @Params: -# 0($fp) = param_test_at_Main_self_0 -function_test_at_Main: - # Allocate stack frame for function function_test_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN - lw $v0, - # Deallocate stack frame for function function_test_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - diff --git a/tests/semantic/self4.cl.mips b/tests/semantic/self4.cl.mips deleted file mode 100644 index 9edf3cf6..00000000 --- a/tests/semantic/self4.cl.mips +++ /dev/null @@ -1,356 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 22:27:46 2020 -# School of Math and Computer Science, University of Havana -# - -.data -Main: - # - - -.data -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - Main_attrib_self: .word 0 - Main_end: -# - - -.data -data_0: .asciiz -# - - -.data -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -.data -data_2: .asciiz "Hello World!" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # main END - -.text -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -.text -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - jal __Main__attrib__self__init - sw $v0, 8($t1) - sw $t1, -4($fp) - # ARG local__internal_0 - # LOCAL local__internal_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# __Main__attrib__self__init implementation. -# @Params: -__Main__attrib__self__init: - # Allocate stack frame for function __Main__attrib__self__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_ttrib__self__init_internal_0 = GETATTRIBUTE self Main - # LOCAL local_ttrib__self__init_internal_0 --> -4($fp) - lw $t0, 8($s1) - sw $t0, -4($fp) - # RETURN local_ttrib__self__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Main__attrib__self__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 - lw $t0, -12($fp) - # Load pointer to type - lw $t1, 4($t0) - sw $t1, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # - lw $t0, data_2 - sw $t0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, -4($fp) - # Get pointer to type's VTABLE - lw $t1, 0($t0) - # Get pointer to function address - lw $t2, 0($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_main_at_Main_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - From 71699d1eb245c1155325d544ed3f7ad3403b9dff Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 27 Nov 2020 23:21:59 -0500 Subject: [PATCH 122/162] Fix features --- src/abstract/tree.py | 8 +++++--- src/testing.py | 38 +++++++++-------------------------- src/travels/typebuilder.py | 12 +++++------ tests/semantic/let2.cl.mips | 2 +- tests/semantic/loops1.cl.mips | 2 +- tests/semantic/loops2.cl.mips | 2 +- 6 files changed, 24 insertions(+), 40 deletions(-) diff --git a/src/abstract/tree.py b/src/abstract/tree.py index c5e5aac3..a203e958 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -13,7 +13,9 @@ class DeclarationNode(Node): class ExpressionNode(Node): - pass + def __init__(self, line, column) -> None: + self.line = line + self.column = column class ProgramNode(Node): @@ -85,13 +87,13 @@ def __init__( return_type: str, line, column, - statements: List[ExpressionNode], + statements: ExpressionNode, ret_col ): self.idx: str = idx self.param_list: List[Param] = param_list self.return_type: str = return_type - self.statements: List[ExpressionNode] = statements + self.statements: ExpressionNode = statements self.line = line self.column = column - len(self.idx) self.ret_col = ret_col diff --git a/src/testing.py b/src/testing.py index a1cd5e55..0e67fd3d 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,38 +60,20 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""(* -e@B.f() invokes the method -f in class B on the object that is the value of e. For this form of dispatch, the static type to the left of -“@”must conform to the type specified to the right of “@”. -*) +text = r"""-- Missing type -class A { - f(x: Int, y: Int): Int { x + y }; - g(x: Int): Int { x + x }; -}; -class B inherits A { - f(a: Int, b: Int): Int { a - b }; - sum(m: Int, n: Int, p: Int): Int { m + n + p }; -}; -class C inherits B { - ident(m: Int): Int { m }; - f(m: Int, n: Int): Int { m * n }; -}; -class D inherits B { - ident(v: String): IO { new IO.out_string(v) }; - f(v: Int, w: Int): Int { v / w }; - g(v: Int): Int { v + v + v }; - sum(v: Int, w: Int, z: Int): Int { v - w - z }; +class Main inherits IO { + main(): IO { out_string("hi!") }; + + main: IO <- out_string("bye!"); }; -class Main inherits IO { - main(): IO { out_string("Hello World!")}; +class A { + x: Int <- 3; - a: A <- new D; - b: Int <- new D@B.sum(1, 2, 3); - test: Int <- a@B.sum(1, 2, 3); -}; + x(): Int { 3 }; + c: Cadena; +}; """ pipeline(text, 5) diff --git a/src/travels/typebuilder.py b/src/travels/typebuilder.py index 983c066e..f2c6026d 100755 --- a/src/travels/typebuilder.py +++ b/src/travels/typebuilder.py @@ -59,13 +59,13 @@ def _(self, node: coolAst.AttributeDef): if isinstance(node.typex, str) else node.typex ) + except SemanticError: + raise SemanticError(f"{node.line, node.column + len(node.idx) + 2} - TypeError: Class {node.typex} of attribute {node.idx} is undefined.") - # Definir el atributo en el tipo actual - self.current_type.define_attribute( - node.idx, attr_type, node.line, node.column - ) - except SemanticError as e: - self.errors.append(e.text) + # Definir el atributo en el tipo actual + self.current_type.define_attribute( + node.idx, attr_type, node.line, node.column + ) @visit.register def _(self, node: coolAst.MethodDef): diff --git a/tests/semantic/let2.cl.mips b/tests/semantic/let2.cl.mips index 51d631ea..d1a34e04 100644 --- a/tests/semantic/let2.cl.mips +++ b/tests/semantic/let2.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:13:47 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:21:39 2020 # School of Math and Computer Science, University of Havana # diff --git a/tests/semantic/loops1.cl.mips b/tests/semantic/loops1.cl.mips index b6c18e1c..0652d76b 100644 --- a/tests/semantic/loops1.cl.mips +++ b/tests/semantic/loops1.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:13:46 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:21:39 2020 # School of Math and Computer Science, University of Havana # diff --git a/tests/semantic/loops2.cl.mips b/tests/semantic/loops2.cl.mips index 4c15595c..82e9a119 100644 --- a/tests/semantic/loops2.cl.mips +++ b/tests/semantic/loops2.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:13:40 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:21:32 2020 # School of Math and Computer Science, University of Havana # From babbb3ff83f0fa91ba2769fe46ccfcc8461bc9aa Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 27 Nov 2020 23:30:11 -0500 Subject: [PATCH 123/162] Fix inheritance error messages --- src/testing.py | 14 ++++++++++---- src/travels/typebuilder.py | 9 ++++++--- tests/semantic/let2.cl.mips | 2 +- tests/semantic/loops1.cl.mips | 2 +- tests/semantic/loops2.cl.mips | 2 +- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/testing.py b/src/testing.py index 0e67fd3d..edff09ba 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,7 +60,7 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""-- Missing type +text = r"""--The parent-child relation on classes defines a graph. This graph may not contain cycles. class Main inherits IO { main(): IO { out_string("hi!") }; @@ -68,12 +68,18 @@ class Main inherits IO { main: IO <- out_string("bye!"); }; -class A { +class A inherits B { x: Int <- 3; - x(): Int { 3 }; + x(): String { ":)" }; +}; + +class B inherits C { + y: Int <- 2; - c: Cadena; + div(a: Int, b: Int): Int { a / b}; }; + +class C inherits A { }; """ pipeline(text, 5) diff --git a/src/travels/typebuilder.py b/src/travels/typebuilder.py index f2c6026d..eae8627c 100755 --- a/src/travels/typebuilder.py +++ b/src/travels/typebuilder.py @@ -24,7 +24,10 @@ def _(self, node: coolAst.ProgramNode): # noqa: F811 @visit.register def _(self, node: coolAst.ClassDef): self.current_type = self.context.get_type(node.idx) - parent = self.context.get_type(node.parent) + try: + parent = self.context.get_type(node.parent) + except SemanticError: + raise SemanticError(f"{node.line, node.column + len(node.idx) + 10} - TypeError: Cannot inherit from undefined {node.parent}") # No se puede heredar de Int ni de BOOL ni de AutoType ni de String if parent.name in INHERITABLES: @@ -32,8 +35,8 @@ def _(self, node: coolAst.ClassDef): # Detectar dependencias circulares if parent.conforms_to(self.current_type): - self.errors.append( - f"Circular dependency: class {self.current_type.name} cannot inherit from {parent.name}" + raise SemanticError( + f"{node.line, node.column + len(node.idx) + 10} - SemanticError: Circular dependency. Class {node.idx} can not inherit from {parent.name}" ) else: self.current_type.set_parent(parent) diff --git a/tests/semantic/let2.cl.mips b/tests/semantic/let2.cl.mips index d1a34e04..ab06cbe1 100644 --- a/tests/semantic/let2.cl.mips +++ b/tests/semantic/let2.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:21:39 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:29:45 2020 # School of Math and Computer Science, University of Havana # diff --git a/tests/semantic/loops1.cl.mips b/tests/semantic/loops1.cl.mips index 0652d76b..4af7195f 100644 --- a/tests/semantic/loops1.cl.mips +++ b/tests/semantic/loops1.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:21:39 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:29:44 2020 # School of Math and Computer Science, University of Havana # diff --git a/tests/semantic/loops2.cl.mips b/tests/semantic/loops2.cl.mips index 82e9a119..a279fd17 100644 --- a/tests/semantic/loops2.cl.mips +++ b/tests/semantic/loops2.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:21:32 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:29:37 2020 # School of Math and Computer Science, University of Havana # From ea3e391b5b5935451cf19f380fb2216c80cbaff1 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 27 Nov 2020 23:34:01 -0500 Subject: [PATCH 124/162] Fix isvoid expression --- src/.builds | 1 + src/abstract/tree.py | 3 ++- src/coolgrammar/grammar.py | 2 +- src/testing.py | 41 ++++++++++++++++++++--------------- tests/semantic/let2.cl.mips | 2 +- tests/semantic/loops1.cl.mips | 2 +- tests/semantic/loops2.cl.mips | 2 +- 7 files changed, 30 insertions(+), 23 deletions(-) diff --git a/src/.builds b/src/.builds index e4e87116..e5498e91 100644 --- a/src/.builds +++ b/src/.builds @@ -192,3 +192,4 @@ 1 1 1 +1 diff --git a/src/abstract/tree.py b/src/abstract/tree.py index a203e958..7f97ca30 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -331,7 +331,8 @@ def __init__(self, expressions, line, column): class IsVoidNode(ExpressionNode): - def __init__(self, expr): + def __init__(self, expr, line, column): + super().__init__(line, column) self.expr: ExpressionNode = expr diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index 6a6a4e04..edd48a5e 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -225,7 +225,7 @@ def build_cool_grammar(): exp %= case_statement, lambda s: s[1] - exp %= isvoid + exp, lambda s: IsVoidNode(s[2]) + exp %= isvoid + exp, lambda s: IsVoidNode(s[2], s[1].token_line, s[1].token_column - 6) block %= obrack + loop_statements + cbrack, lambda s: BlockNode( s[2], s[1].token_line, s[1].token_column - 1 diff --git a/src/testing.py b/src/testing.py index edff09ba..3f5653f3 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,26 +60,31 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""--The parent-child relation on classes defines a graph. This graph may not contain cycles. +text = r"""--evaluates to true if expr is void and evaluates to false if expr is not void. -class Main inherits IO { - main(): IO { out_string("hi!") }; - - main: IO <- out_string("bye!"); -}; +class A { }; +class B inherits A { }; +class C inherits B { }; +class D inherits B { }; +class E inherits B { }; +class F inherits A { }; -class A inherits B { - x: Int <- 3; - - x(): String { ":)" }; -}; - -class B inherits C { - y: Int <- 2; - - div(a: Int, b: Int): Int { a / b}; +class Main inherits IO { + main(): IO { out_string("Hello World!")}; + + b: B <- if isvoid new F then + new C + else + if false then new D + else new E fi + fi; + + test: B <- isvoid if isvoid new F then + new C + else + if false then new D + else new E fi + fi; }; - -class C inherits A { }; """ pipeline(text, 5) diff --git a/tests/semantic/let2.cl.mips b/tests/semantic/let2.cl.mips index ab06cbe1..066eb449 100644 --- a/tests/semantic/let2.cl.mips +++ b/tests/semantic/let2.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:29:45 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:33:47 2020 # School of Math and Computer Science, University of Havana # diff --git a/tests/semantic/loops1.cl.mips b/tests/semantic/loops1.cl.mips index 4af7195f..77d9228b 100644 --- a/tests/semantic/loops1.cl.mips +++ b/tests/semantic/loops1.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:29:44 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:33:47 2020 # School of Math and Computer Science, University of Havana # diff --git a/tests/semantic/loops2.cl.mips b/tests/semantic/loops2.cl.mips index a279fd17..69cdf231 100644 --- a/tests/semantic/loops2.cl.mips +++ b/tests/semantic/loops2.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:29:37 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:33:39 2020 # School of Math and Computer Science, University of Havana # From ab54eba47cb96ed7fc98c92231885774da5a0380 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 27 Nov 2020 23:44:00 -0500 Subject: [PATCH 125/162] Fix lets --- src/testing.py | 17 +++-------------- src/travels/inference.py | 2 ++ tests/semantic/loops1.cl.mips | 2 +- tests/semantic/loops2.cl.mips | 2 +- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/testing.py b/src/testing.py index 3f5653f3..cca3d90b 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,7 +60,7 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""--evaluates to true if expr is void and evaluates to false if expr is not void. +text = r"""--The type of let is the type of the body. class A { }; class B inherits A { }; @@ -72,19 +72,8 @@ class F inherits A { }; class Main inherits IO { main(): IO { out_string("Hello World!")}; - b: B <- if isvoid new F then - new C - else - if false then new D - else new E fi - fi; - - test: B <- isvoid if isvoid new F then - new C - else - if false then new D - else new E fi - fi; + b: B <- let a: Bool, a: Int <- 5, a: String, a: A <- new F, b: B <- new E in b; + test: B <- let a: Bool, a: Int <- 5, a: String, a: A <- new F, b: A <- new E in b; }; """ pipeline(text, 5) diff --git a/src/travels/inference.py b/src/travels/inference.py index 79af0c15..ec5cb608 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -332,6 +332,8 @@ def _( infered_type=None, deep=1, ): + if deep == 1: + scope = scope.create_child() for var_id, var_type, var_init_expr in node.var_list: type_ = self.context.get_type(var_type) # Revisar que la expresion de inicializacion (de existir) se conforme con el tipo diff --git a/tests/semantic/loops1.cl.mips b/tests/semantic/loops1.cl.mips index 77d9228b..29cc11e8 100644 --- a/tests/semantic/loops1.cl.mips +++ b/tests/semantic/loops1.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:33:47 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:43:41 2020 # School of Math and Computer Science, University of Havana # diff --git a/tests/semantic/loops2.cl.mips b/tests/semantic/loops2.cl.mips index 69cdf231..0707122b 100644 --- a/tests/semantic/loops2.cl.mips +++ b/tests/semantic/loops2.cl.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:33:39 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:43:34 2020 # School of Math and Computer Science, University of Havana # From e702afe5f7cb83032904f63d51f36fe131fb5c11 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sat, 28 Nov 2020 00:15:56 -0500 Subject: [PATCH 126/162] fix new --- src/.builds | 3 + src/abstract/tree.py | 9 +- src/coolgrammar/grammar.py | 30 +- src/testing.py | 17 +- src/travels/inference.py | 21 +- tests/semantic/let2.cl.mips | 693 ---------------------------------- tests/semantic/loops1.cl.mips | 394 ------------------- tests/semantic/loops2.cl.mips | 426 --------------------- 8 files changed, 54 insertions(+), 1539 deletions(-) delete mode 100644 tests/semantic/let2.cl.mips delete mode 100644 tests/semantic/loops1.cl.mips delete mode 100644 tests/semantic/loops2.cl.mips diff --git a/src/.builds b/src/.builds index e5498e91..557eb158 100644 --- a/src/.builds +++ b/src/.builds @@ -193,3 +193,6 @@ 1 1 1 +1 +1 +1 diff --git a/src/abstract/tree.py b/src/abstract/tree.py index 7f97ca30..9378fec9 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -88,7 +88,7 @@ def __init__( line, column, statements: ExpressionNode, - ret_col + ret_col, ): self.idx: str = idx self.param_list: List[Param] = param_list @@ -110,7 +110,9 @@ def __init__(self, idx: str, typex: str, line, column, default_value=None): class VariableDeclaration(ExpressionNode): def __init__(self, var_list, line, column, block_statements=None): - self.var_list: List[Tuple[str, str, Optional[ExpressionNode]]] = var_list + self.var_list: List[ + Tuple[str, str, Optional[ExpressionNode], int, int] + ] = var_list self.block_statements: Optional[ExpressionNode] = block_statements self.line = line self.column = column @@ -301,7 +303,8 @@ def __init__(self, type_, line, column, args=None): class WhileBlockNode(ExpressionNode): - def __init__(self, cond, statements): + def __init__(self, cond, statements, line, column): + super().__init__(line, column) self.cond: ExpressionNode = cond self.statements: ExpressionNode = statements diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index edd48a5e..f2e40e09 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -174,20 +174,28 @@ def build_cool_grammar(): s[2], s[1].token_line, s[1].token_column - 3, s[4] ) - nested_lets %= idx + dd + typex, lambda s: [(s[1].lex, s[3].lex, None)] + nested_lets %= idx + dd + typex, lambda s: [ + (s[1].lex, s[3].lex, None, s[3].token_line, s[3].token_column - len(s[3].lex)) + ] nested_lets %= ( idx + dd + typex + coma + nested_lets, - lambda s: [(s[1].lex, s[3].lex, None)] + s[5], + lambda s: [ + (s[1].lex, s[3].lex, None, s[3].token_line, s[3].token_column - len(s[3].lex)) + ] + + s[5], ) nested_lets %= idx + dd + typex + assign + exp, lambda s: [ - (s[1].lex, s[3].lex, s[5]) + (s[1].lex, s[3].lex, s[5], s[3].token_line, s[3].token_column - len(s[3].lex)) ] nested_lets %= ( idx + dd + typex + assign + exp + coma + nested_lets, - lambda s: [(s[1].lex, s[3].lex, s[5])] + s[7], + lambda s: [ + (s[1].lex, s[3].lex, s[5], s[3].token_line, s[3].token_column - len(s[3].lex)) + ] + + s[7], ) exp %= var_dec, lambda s: s[1] @@ -212,7 +220,7 @@ def build_cool_grammar(): ) exp %= while_ + exp + loop + statement_list + pool, lambda s: WhileBlockNode( - s[2], s[4] + s[2], s[4], s[1].token_line, s[1].token_column - 5 ) exp %= atom, lambda s: s[1] @@ -225,7 +233,9 @@ def build_cool_grammar(): exp %= case_statement, lambda s: s[1] - exp %= isvoid + exp, lambda s: IsVoidNode(s[2], s[1].token_line, s[1].token_column - 6) + exp %= isvoid + exp, lambda s: IsVoidNode( + s[2], s[1].token_line, s[1].token_column - 6 + ) block %= obrack + loop_statements + cbrack, lambda s: BlockNode( s[2], s[1].token_line, s[1].token_column - 1 @@ -293,7 +303,9 @@ def build_cool_grammar(): factor %= ( factor + arroba + typex + period + idx + opar + args_list_empty + cpar, - lambda s: ParentFuncCall(s[1], s[3].lex, s[5].lex, s[7], s[1].line, s[1].column), + lambda s: ParentFuncCall( + s[1], s[3].lex, s[5].lex, s[7], s[1].line, s[1].column + ), ) factor %= false, lambda s: FalseConstant() @@ -332,7 +344,9 @@ def build_cool_grammar(): s[1], s[3], s[2].token_line, s[2].token_column - 2 ) - factor %= self_, lambda s: SelfNode(s[1].token_line, s[1].token_column - len(s[1].lex)) + factor %= self_, lambda s: SelfNode( + s[1].token_line, s[1].token_column - len(s[1].lex) + ) atom %= arith, lambda s: s[1] diff --git a/src/testing.py b/src/testing.py index cca3d90b..394948a6 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,20 +60,15 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""--The type of let is the type of the body. - -class A { }; -class B inherits A { }; -class C inherits B { }; -class D inherits B { }; -class E inherits B { }; -class F inherits A { }; +text = r"""(* +But it is an error to assign to self or to bind self in a let, a +case, or as a formal parameter. It is also illegal to have attributes named self. +*) class Main inherits IO { main(): IO { out_string("Hello World!")}; - b: B <- let a: Bool, a: Int <- 5, a: String, a: A <- new F, b: B <- new E in b; - test: B <- let a: Bool, a: Int <- 5, a: String, a: A <- new F, b: A <- new E in b; -}; + test(): IO { let self: Main <- new Main in self }; +}; """ pipeline(text, 5) diff --git a/src/travels/inference.py b/src/travels/inference.py index ec5cb608..ccad8f35 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -334,8 +334,15 @@ def _( ): if deep == 1: scope = scope.create_child() - for var_id, var_type, var_init_expr in node.var_list: - type_ = self.context.get_type(var_type) + for var_id, var_type, var_init_expr, l , c in node.var_list: + try: + type_ = self.context.get_type(var_type) + except SemanticError: + raise SemanticError(TypeError( + f"Class {var_type} of let-bound identifier b is undefined.", + l, + c + )) # Revisar que la expresion de inicializacion (de existir) se conforme con el tipo # de la variable. # Se pueden dar varios casos: @@ -487,7 +494,10 @@ def _( infered_type=None, deep=1, ): - ret_type = self.context.get_type(node.type_) + try: + ret_type = self.context.get_type(node.type_) + except SemanticError: + raise SemanticError(f"{node.line, node.column + 4} - TypeError: 'new' used with undefined class {node.type_}.") if ret_type in ( self.AUTO_TYPE, void, @@ -507,8 +517,11 @@ def _( infered_type=None, deep=1, ): + cond_type = self.visit(node.cond, scope, infered_type, deep) + if cond_type != self.BOOL: + raise SemanticError(f"{node.cond.line, node.cond.column} - TypeError: Loop condition does not have type Bool.") ret_type = self.visit(node.statements, scope, infered_type, deep) - return ret_type + return self.OBJECT # ---------------------------------------------------------------------------------------------------------------------------# # ---------------------------------------OPERACIONES ARITMÉTICAS-------------------------------------------------------------# diff --git a/tests/semantic/let2.cl.mips b/tests/semantic/let2.cl.mips deleted file mode 100644 index 066eb449..00000000 --- a/tests/semantic/let2.cl.mips +++ /dev/null @@ -1,693 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:33:47 2020 -# School of Math and Computer Science, University of Havana -# - -.data -A: - B: - C: - D: - E: - F: - Main: - # - - -.data -# **** VTABLE for type A **** -A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# - - -# **** Type RECORD for type A **** -A_start: - A_vtable_pointer: .word A_vtable - A_end: -# - - -.data -# **** VTABLE for type B **** -B_vtable: .word -# - - -# **** Type RECORD for type B **** -B_start: - B_vtable_pointer: .word B_vtable - B_end: -# - - -.data -# **** VTABLE for type C **** -C_vtable: .word -# - - -# **** Type RECORD for type C **** -C_start: - C_vtable_pointer: .word C_vtable - C_end: -# - - -.data -# **** VTABLE for type D **** -D_vtable: .word -# - - -# **** Type RECORD for type D **** -D_start: - D_vtable_pointer: .word D_vtable - D_end: -# - - -.data -# **** VTABLE for type E **** -E_vtable: .word -# - - -# **** Type RECORD for type E **** -E_start: - E_vtable_pointer: .word E_vtable - E_end: -# - - -.data -# **** VTABLE for type F **** -F_vtable: .word -# - - -# **** Type RECORD for type F **** -F_start: - F_vtable_pointer: .word F_vtable - F_end: -# - - -.data -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - Main_attrib_b: .word 0 - Main_attrib_test: .word 0 - Main_end: -# - - -.data -data_0: .asciiz -# - - -.data -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_A_tdt_entry__: .word 1 -__Object_B_tdt_entry__: .word 2 -__Object_C_tdt_entry__: .word 3 -__Object_D_tdt_entry__: .word 3 -__Object_E_tdt_entry__: .word 3 -__Object_F_tdt_entry__: .word 2 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_A_tdt_entry__: .word -1 -__Int_B_tdt_entry__: .word -1 -__Int_C_tdt_entry__: .word -1 -__Int_D_tdt_entry__: .word -1 -__Int_E_tdt_entry__: .word -1 -__Int_F_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_A_tdt_entry__: .word -1 -__String_B_tdt_entry__: .word -1 -__String_C_tdt_entry__: .word -1 -__String_D_tdt_entry__: .word -1 -__String_E_tdt_entry__: .word -1 -__String_F_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_A_tdt_entry__: .word -1 -__Bool_B_tdt_entry__: .word -1 -__Bool_C_tdt_entry__: .word -1 -__Bool_D_tdt_entry__: .word -1 -__Bool_E_tdt_entry__: .word -1 -__Bool_F_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_A_tdt_entry__: .word -1 -__IO_B_tdt_entry__: .word -1 -__IO_C_tdt_entry__: .word -1 -__IO_D_tdt_entry__: .word -1 -__IO_E_tdt_entry__: .word -1 -__IO_F_tdt_entry__: .word -1 -__IO_Main_tdt_entry__: .word 1 -__A_Object_tdt_entry__: .word -1 -__A_Int_tdt_entry__: .word -1 -__A_String_tdt_entry__: .word -1 -__A_Bool_tdt_entry__: .word -1 -__A_IO_tdt_entry__: .word -1 -__A_A_tdt_entry__: .word 0 -__A_B_tdt_entry__: .word 1 -__A_C_tdt_entry__: .word 2 -__A_D_tdt_entry__: .word 2 -__A_E_tdt_entry__: .word 2 -__A_F_tdt_entry__: .word 1 -__A_Main_tdt_entry__: .word -1 -__B_Object_tdt_entry__: .word -1 -__B_Int_tdt_entry__: .word -1 -__B_String_tdt_entry__: .word -1 -__B_Bool_tdt_entry__: .word -1 -__B_IO_tdt_entry__: .word -1 -__B_A_tdt_entry__: .word -1 -__B_B_tdt_entry__: .word 0 -__B_C_tdt_entry__: .word 1 -__B_D_tdt_entry__: .word 1 -__B_E_tdt_entry__: .word 1 -__B_F_tdt_entry__: .word -1 -__B_Main_tdt_entry__: .word -1 -__C_Object_tdt_entry__: .word -1 -__C_Int_tdt_entry__: .word -1 -__C_String_tdt_entry__: .word -1 -__C_Bool_tdt_entry__: .word -1 -__C_IO_tdt_entry__: .word -1 -__C_A_tdt_entry__: .word -1 -__C_B_tdt_entry__: .word -1 -__C_C_tdt_entry__: .word 0 -__C_D_tdt_entry__: .word -1 -__C_E_tdt_entry__: .word -1 -__C_F_tdt_entry__: .word -1 -__C_Main_tdt_entry__: .word -1 -__D_Object_tdt_entry__: .word -1 -__D_Int_tdt_entry__: .word -1 -__D_String_tdt_entry__: .word -1 -__D_Bool_tdt_entry__: .word -1 -__D_IO_tdt_entry__: .word -1 -__D_A_tdt_entry__: .word -1 -__D_B_tdt_entry__: .word -1 -__D_C_tdt_entry__: .word -1 -__D_D_tdt_entry__: .word 0 -__D_E_tdt_entry__: .word -1 -__D_F_tdt_entry__: .word -1 -__D_Main_tdt_entry__: .word -1 -__E_Object_tdt_entry__: .word -1 -__E_Int_tdt_entry__: .word -1 -__E_String_tdt_entry__: .word -1 -__E_Bool_tdt_entry__: .word -1 -__E_IO_tdt_entry__: .word -1 -__E_A_tdt_entry__: .word -1 -__E_B_tdt_entry__: .word -1 -__E_C_tdt_entry__: .word -1 -__E_D_tdt_entry__: .word -1 -__E_E_tdt_entry__: .word 0 -__E_F_tdt_entry__: .word -1 -__E_Main_tdt_entry__: .word -1 -__F_Object_tdt_entry__: .word -1 -__F_Int_tdt_entry__: .word -1 -__F_String_tdt_entry__: .word -1 -__F_Bool_tdt_entry__: .word -1 -__F_IO_tdt_entry__: .word -1 -__F_A_tdt_entry__: .word -1 -__F_B_tdt_entry__: .word -1 -__F_C_tdt_entry__: .word -1 -__F_D_tdt_entry__: .word -1 -__F_E_tdt_entry__: .word -1 -__F_F_tdt_entry__: .word 0 -__F_Main_tdt_entry__: .word -1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_A_tdt_entry__: .word -1 -__Main_B_tdt_entry__: .word -1 -__Main_C_tdt_entry__: .word -1 -__Main_D_tdt_entry__: .word -1 -__Main_E_tdt_entry__: .word -1 -__Main_F_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -.data -data_2: .asciiz "Hello World!" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # main END - -.text -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -.text -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - jal __Main__attrib__b__init - sw $v0, 8($t1) - jal __Main__attrib__test__init - sw $v0, 12($t1) - sw $t1, -4($fp) - # ARG local__internal_0 - # LOCAL local__internal_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# __Main__attrib__b__init implementation. -# @Params: -__Main__attrib__b__init: - # Allocate stack frame for function __Main__attrib__b__init. - subu $sp, $sp, 40 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 40 - # LOCAL local_ttrib__b__init_a_0 --> -4($fp) - # local_ttrib__b__init_a_0 = 0 - li $t0, 0 - sw $t0, -4($fp) - # LOCAL local_ttrib__b__init_a_1 --> -8($fp) - # local_ttrib__b__init_a_1 = 5 - li $t0, 5 - sw $t0, -8($fp) - # LOCAL local_ttrib__b__init_a_2 --> -12($fp) - # local_ttrib__b__init_a_2 = 0 - li $t0, 0 - sw $t0, -12($fp) - # LOCAL local_ttrib__b__init_internal_4 --> -20($fp) - # local_ttrib__b__init_internal_4 = ALLOCATE F - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, F - sw $t0, 0($v0) - la $t0, F_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -20($fp) - # LOCAL local_ttrib__b__init_a_3 --> -16($fp) - # LOCAL local_ttrib__b__init_internal_4 --> -20($fp) - # local_ttrib__b__init_a_3 = local_ttrib__b__init_internal_4 - lw $t0, -20($fp) - sw $t0, -16($fp) - # LOCAL local_ttrib__b__init_b_5 --> -24($fp) - # local_ttrib__b__init_b_5 = ALLOCATE B - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, B - sw $t0, 0($v0) - la $t0, B_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -24($fp) - # LOCAL local_ttrib__b__init_internal_6 --> -28($fp) - # local_ttrib__b__init_internal_6 = ALLOCATE E - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, E - sw $t0, 0($v0) - la $t0, E_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -28($fp) - # LOCAL local_ttrib__b__init_b_5 --> -24($fp) - # LOCAL local_ttrib__b__init_internal_6 --> -28($fp) - # local_ttrib__b__init_b_5 = local_ttrib__b__init_internal_6 - lw $t0, -28($fp) - sw $t0, -24($fp) - # local_ttrib__b__init_internal_7 = GETATTRIBUTE b Main - # LOCAL local_ttrib__b__init_internal_7 --> -32($fp) - lw $t0, 8($s1) - sw $t0, -32($fp) - # RETURN local_ttrib__b__init_internal_7 - lw $v0, -32($fp) - # Deallocate stack frame for function __Main__attrib__b__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 40 - jr $ra - # Function END - - -.text -# __Main__attrib__test__init implementation. -# @Params: -__Main__attrib__test__init: - # Allocate stack frame for function __Main__attrib__test__init. - subu $sp, $sp, 40 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 40 - # LOCAL local_ttrib__test__init_a_0 --> -4($fp) - # local_ttrib__test__init_a_0 = 0 - li $t0, 0 - sw $t0, -4($fp) - # LOCAL local_ttrib__test__init_a_1 --> -8($fp) - # local_ttrib__test__init_a_1 = 5 - li $t0, 5 - sw $t0, -8($fp) - # LOCAL local_ttrib__test__init_a_2 --> -12($fp) - # local_ttrib__test__init_a_2 = 0 - li $t0, 0 - sw $t0, -12($fp) - # LOCAL local_ttrib__test__init_internal_4 --> -20($fp) - # local_ttrib__test__init_internal_4 = ALLOCATE F - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, F - sw $t0, 0($v0) - la $t0, F_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -20($fp) - # LOCAL local_ttrib__test__init_a_3 --> -16($fp) - # LOCAL local_ttrib__test__init_internal_4 --> -20($fp) - # local_ttrib__test__init_a_3 = local_ttrib__test__init_internal_4 - lw $t0, -20($fp) - sw $t0, -16($fp) - # LOCAL local_ttrib__test__init_b_5 --> -24($fp) - # local_ttrib__test__init_b_5 = ALLOCATE B - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, B - sw $t0, 0($v0) - la $t0, B_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -24($fp) - # LOCAL local_ttrib__test__init_internal_6 --> -28($fp) - # local_ttrib__test__init_internal_6 = ALLOCATE E - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t0, E - sw $t0, 0($v0) - la $t0, E_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -28($fp) - # LOCAL local_ttrib__test__init_b_5 --> -24($fp) - # LOCAL local_ttrib__test__init_internal_6 --> -28($fp) - # local_ttrib__test__init_b_5 = local_ttrib__test__init_internal_6 - lw $t0, -28($fp) - sw $t0, -24($fp) - # local_ttrib__test__init_internal_7 = GETATTRIBUTE b Main - # LOCAL local_ttrib__test__init_internal_7 --> -32($fp) - lw $t0, 8($s1) - sw $t0, -32($fp) - # RETURN local_ttrib__test__init_internal_7 - lw $v0, -32($fp) - # Deallocate stack frame for function __Main__attrib__test__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 40 - jr $ra - # Function END - - -.text -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 - lw $t0, -12($fp) - # Load pointer to type - lw $t1, 4($t0) - sw $t1, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # - lw $t0, data_2 - sw $t0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, -4($fp) - # Get pointer to type's VTABLE - lw $t1, 0($t0) - # Get pointer to function address - lw $t2, 0($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_main_at_Main_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - diff --git a/tests/semantic/loops1.cl.mips b/tests/semantic/loops1.cl.mips deleted file mode 100644 index 29cc11e8..00000000 --- a/tests/semantic/loops1.cl.mips +++ /dev/null @@ -1,394 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:43:41 2020 -# School of Math and Computer Science, University of Havana -# - -.data -Main: - # - - -.data -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - Main_attrib_i: .word 0 - Main_attrib_test: .word 0 - Main_end: -# - - -.data -data_0: .asciiz -# - - -.data -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -.data -data_2: .asciiz "true" -# - - -.data -data_3: .asciiz "Hello World!" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # main END - -.text -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -.text -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - jal __Main__attrib__i__init - sw $v0, 8($t1) - jal __Main__attrib__test__init - sw $v0, 12($t1) - sw $t1, -4($fp) - # ARG local__internal_0 - # LOCAL local__internal_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# __Main__attrib__i__init implementation. -# @Params: -__Main__attrib__i__init: - # Allocate stack frame for function __Main__attrib__i__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 1 - li $v0, 1 - # Deallocate stack frame for function __Main__attrib__i__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# __Main__attrib__test__init implementation. -# @Params: -__Main__attrib__test__init: - # Allocate stack frame for function __Main__attrib__test__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - label_WHILE_1: - # LOCAL local_ttrib__test__init_internal_0 --> -4($fp) - # - lw $t0, data_2 - sw $t0, -4($fp) - # IF_ZERO local_ttrib__test__init_internal_0 GOTO label_WHILE_END_2 - # IF_ZERO local_ttrib__test__init_internal_0 GOTO label_WHILE_END_2 - lw $t0, -4($fp) - beq $t0, 0, label_WHILE_END_2 - # = - # GOTO label_WHILE_1 - j label_WHILE_1 - label_WHILE_END_2: - # RETURN - # Deallocate stack frame for function __Main__attrib__test__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 - lw $t0, -12($fp) - # Load pointer to type - lw $t1, 4($t0) - sw $t1, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # - lw $t0, data_3 - sw $t0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, -4($fp) - # Get pointer to type's VTABLE - lw $t1, 0($t0) - # Get pointer to function address - lw $t2, 0($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_main_at_Main_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - diff --git a/tests/semantic/loops2.cl.mips b/tests/semantic/loops2.cl.mips deleted file mode 100644 index 0707122b..00000000 --- a/tests/semantic/loops2.cl.mips +++ /dev/null @@ -1,426 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Nov 27 23:43:34 2020 -# School of Math and Computer Science, University of Havana -# - -.data -Main: - # - - -.data -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_IO, function_type_name_at_IO, function_copy_at_IO, function_main_at_Main -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - Main_attrib_i: .word 0 - Main_attrib_test: .word 0 - Main_attrib_test2: .word 0 - Main_end: -# - - -.data -data_0: .asciiz -# - - -.data -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -.data -data_2: .asciiz "Hello World!" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # main END - -.text -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -.text -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -.text -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - jal __Main__attrib__i__init - sw $v0, 8($t1) - jal __Main__attrib__test__init - sw $v0, 12($t1) - jal __Main__attrib__test2__init - sw $v0, 16($t1) - sw $t1, -4($fp) - # ARG local__internal_0 - # LOCAL local__internal_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# __Main__attrib__i__init implementation. -# @Params: -__Main__attrib__i__init: - # Allocate stack frame for function __Main__attrib__i__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 1 - li $v0, 1 - # Deallocate stack frame for function __Main__attrib__i__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# __Main__attrib__test__init implementation. -# @Params: -__Main__attrib__test__init: - # Allocate stack frame for function __Main__attrib__test__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - label_WHILE_1: - # LOCAL local_ttrib__test__init_internal_0 --> -4($fp) - # local_ttrib__test__init_internal_0 = 1 - li $t0, 1 - sw $t0, -4($fp) - # IF_ZERO local_ttrib__test__init_internal_0 GOTO label_WHILE_END_2 - # IF_ZERO local_ttrib__test__init_internal_0 GOTO label_WHILE_END_2 - lw $t0, -4($fp) - beq $t0, 0, label_WHILE_END_2 - # = - # GOTO label_WHILE_1 - j label_WHILE_1 - label_WHILE_END_2: - # RETURN - # Deallocate stack frame for function __Main__attrib__test__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# __Main__attrib__test2__init implementation. -# @Params: -__Main__attrib__test2__init: - # Allocate stack frame for function __Main__attrib__test2__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - label_WHILE_3: - # LOCAL local_ttrib__test2__init_internal_0 --> -4($fp) - # local_ttrib__test2__init_internal_0 = 1 - li $t0, 1 - sw $t0, -4($fp) - # IF_ZERO local_ttrib__test2__init_internal_0 GOTO label_WHILE_END_4 - # IF_ZERO local_ttrib__test2__init_internal_0 GOTO label_WHILE_END_4 - lw $t0, -4($fp) - beq $t0, 0, label_WHILE_END_4 - # = - # GOTO label_WHILE_3 - j label_WHILE_3 - label_WHILE_END_4: - # RETURN - # Deallocate stack frame for function __Main__attrib__test2__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -.text -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 - lw $t0, -12($fp) - # Load pointer to type - lw $t1, 4($t0) - sw $t1, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # - lw $t0, data_2 - sw $t0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, -4($fp) - # Get pointer to type's VTABLE - lw $t1, 0($t0) - # Get pointer to function address - lw $t2, 0($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_main_at_Main_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - From 2f5c627a596b1177281d07c9d6ba07f9e6904c04 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Mon, 30 Nov 2020 11:38:36 -0500 Subject: [PATCH 127/162] Fix address loading in out_string. Fix method lookup in type hierarchy. Add IO as instantiable Type --- src/.builds | 7 + src/abstract/tree.py | 2 +- src/cil/baseCilVisitor.py | 24 +- src/cil/nodes.py | 14 + src/mips/baseMipsVisitor.py | 10 +- src/mips/instruction.py | 3 +- src/pycoolc.py | 2 +- src/testing.mips | 960 +++++++++++++++++++++++------- src/testing.py | 106 +++- src/travels/ciltomips.py | 41 +- src/travels/ctcill.py | 28 +- tests/codegen/hello_world.cl.mips | 335 +++++++++++ tests/codegen/hello_world.mips | 335 +++++++++++ tests/codegen/io.cl.mips | 877 +++++++++++++++++++++++++++ tests/codegen/io.mips | 877 +++++++++++++++++++++++++++ 15 files changed, 3355 insertions(+), 266 deletions(-) create mode 100644 tests/codegen/hello_world.cl.mips create mode 100644 tests/codegen/hello_world.mips create mode 100644 tests/codegen/io.cl.mips create mode 100644 tests/codegen/io.mips diff --git a/src/.builds b/src/.builds index 557eb158..db72d852 100644 --- a/src/.builds +++ b/src/.builds @@ -196,3 +196,10 @@ 1 1 1 +1 +1 +1 +1 +1 +1 +1 diff --git a/src/abstract/tree.py b/src/abstract/tree.py index 9378fec9..e666560c 100755 --- a/src/abstract/tree.py +++ b/src/abstract/tree.py @@ -184,7 +184,7 @@ def __init__(self, idx, expr, line, column): self.idx: str = idx self.expr: ExpressionNode = expr self.line = line - self.column = column - len(idx) + self.column = column class IntegerConstant(AtomicNode): diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 23e19d0a..9317aca8 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -8,7 +8,7 @@ ReadIntNode, ReadNode, ReturnNode, - SelfNode, + SelfNode, TypeName, TypeNode, ) @@ -113,7 +113,7 @@ def __init__(self, context: Context): self.current_type: Optional[Type] = None self.current_method: Optional[Method] = None self.current_function: Optional[nodes.FunctionNode] = None - self.null = self.register_data("") + self.null = self.register_data('""') self.__labels_count: int = 0 self.__build_CART() self.build_builtins() @@ -279,10 +279,30 @@ def __implement_copy(self): self.register_instruction(ReturnNode(clone_vm_holder)) self.current_function = None + def __implement_type_name(self): + self.current_function = self.register_function("function_type_name_at_Object") + return_vm_holder = self.define_internal_local() + self.register_instruction(TypeName(return_vm_holder)) + self.register_instruction(ReturnNode(return_vm_holder)) + + def build_builtins(self): + + # Registrar el tipo IO como un tipo instanciable + io_typeNode = self.register_type("IO") + + io_typeNode.methods.append(("in_string", "function_in_string_at_IO")) + io_typeNode.methods.append(("in_int", "function_in_int_at_IO")) + io_typeNode.methods.append(("out_string", "function_out_string_at_IO")) + io_typeNode.methods.append(("out_int", "function_out_int_at_IO")) + io_typeNode.methods.append(("abort", "function_abort_at_Object")) + io_typeNode.methods.append(("copy", "function_copy_at_Object")) + io_typeNode.methods.append(("type_name", "function_type_name_at_Object")) + self.__implement_in_string() self.__implement_out_int() self.__implement_out_string() self.__implement_in_int() self.__implement_abort() self.__implement_copy() + self.__implement_type_name() diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 65316481..9bed87df 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -1,4 +1,5 @@ from __future__ import annotations +from time import clock_settime from typing import List, Tuple, Union from abstract.semantics import Attribute, Method, Type """ @@ -190,6 +191,14 @@ def __init__(self, dest: LocalNode, message: DataNode): self.message = message +class InitSelfNode(InstructionNode): + def __init__(self, src: LocalNode) -> None: + self.src = src + + +class SetAtAddress(InstructionNode): + pass + class LengthNode(BuiltInNode): pass @@ -259,4 +268,9 @@ def __init__(self, src: LocalNode) -> None: class CopyNode(InstructionNode): def __init__(self, selfsrc: LocalNode, dest: LocalNode) -> None: self.selfsrc = selfsrc + self.dest = dest + + +class TypeName(InstructionNode): + def __init__(self, dest: LocalNode) -> None: self.dest = dest \ No newline at end of file diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 02618afd..fc9c44be 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -9,7 +9,7 @@ from mips.branch import JAL, JALR import mips.instruction as instrNodes import mips.arithmetic as arithNodes -from mips.instruction import LineComment, a0, fp, ra, sp, v0 +from mips.instruction import FixedData, LineComment, a0, fp, ra, sp, v0 import mips.load_store as lsNodes from typing import List, Optional, Type, Union import time @@ -217,12 +217,11 @@ def create_type_array(self, types: List[TypeNode]): los distintos tipos del programa, de modo que se puedan referenciar en mips como mismo se referenciarian en una lista. """ - self.register_instruction(DotDataDirective()) - # Generar por cada tipo, un label que lo identifique, en el mismo orden que aparecen # en la lista de tipos. for t in types: - self.register_instruction(instrNodes.Label(t.name)) + self.register_instruction(FixedData(t.name, f"\"{t.name}\"", "asciiz")) + self.comment("Function END") def allocate_memory(self, bytes_num: int): """ @@ -336,7 +335,6 @@ def deallocate_args(self, func: FunctionNode): self.register_instruction(arithNodes.ADDU(sp, sp, 4 * args, True)) def define_entry_point(self): - self.register_instruction(DotTextDirective()) self.register_instruction(instrNodes.Label("main")) # Realizar un jump a entry self.register_instruction(JAL("entry")) @@ -344,7 +342,7 @@ def define_entry_point(self): self.comment("syscall code 10 is for exit") self.register_instruction(lsNodes.LI(v0, 10)) self.register_instruction(instrNodes.SYSCALL()) - self.comment("main END\n") + self.comment("Function END\n") def locate_attribute(self, attrname: str, attributes: List[Attribute]): # Para ubicar el atributo que vamos a manejar diff --git a/src/mips/instruction.py b/src/mips/instruction.py index 0e31ddf3..a8af0ccd 100644 --- a/src/mips/instruction.py +++ b/src/mips/instruction.py @@ -88,7 +88,8 @@ a0: "a0", a1: "a1", a2: "a2", - a3: "a3" + a3: "a3", + at: "at" } diff --git a/src/pycoolc.py b/src/pycoolc.py index 7b97802d..df4e8f45 100644 --- a/src/pycoolc.py +++ b/src/pycoolc.py @@ -73,7 +73,7 @@ def pipeline(program: str, deep: int, file_name: str) -> None: # en MIPS file_str = code_gen(cil_program) - with open(f"{file_name}.mips", "w+") as f: + with open(f"{file_name[: len(file_name) - 3]}.mips", "w+") as f: f.write(file_str) diff --git a/src/testing.mips b/src/testing.mips index af0d33e8..af7935cc 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,81 +1,223 @@ -[] -[('out_string', 'function_out_string_at_Main'), ('out_int', 'function_out_int_at_Main'), ('in_string', 'function_in_string_at_Main'), ('in_int', 'function_in_int_at_Main'), ('abort', 'function_abort_at_Main'), ('type_name', 'function_type_name_at_Main'), ('copy', 'function_copy_at_Main'), ('main', 'function_main_at_Main'), ('fib', 'function_fib_at_Main')] # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Nov 7 14:53:21 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Nov 30 10:21:42 2020 # School of Math and Computer Science, University of Havana # .data -Main: - # +IO: .asciiz "IO" +# Function END +A: .asciiz "A" +# Function END +B: .asciiz "B" +# Function END +C: .asciiz "C" +# Function END +D: .asciiz "D" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_in_string_at_IO, function_in_int_at_IO, function_out_string_at_IO, function_out_int_at_IO, function_abort_at_Object, function_copy_at_Object, function_type_name_at_Object +# + + +# **** Type RECORD for type IO **** +IO_start: +IO_vtable_pointer: .word IO_vtable +IO_end: +# + + +# **** VTABLE for type A **** +A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A +# + + +# **** Type RECORD for type A **** +A_start: +A_vtable_pointer: .word A_vtable +A_attrib_io: .word 0 +A_end: +# + + +# **** VTABLE for type B **** +B_vtable: .word function_out_a_at_A, function_out_b_at_B +# + + +# **** Type RECORD for type B **** +B_start: +B_vtable_pointer: .word B_vtable +B_attrib_io: .word 0 +B_end: +# + + +# **** VTABLE for type C **** +C_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_c_at_C +# + + +# **** Type RECORD for type C **** +C_start: +C_vtable_pointer: .word C_vtable +C_end: +# + + +# **** VTABLE for type D **** +D_vtable: .word function_out_c_at_C, function_out_d_at_D +# + + +# **** Type RECORD for type D **** +D_start: +D_vtable_pointer: .word D_vtable +D_end: +# -.data # **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_Main, function_out_int_at_Main, function_in_string_at_Main, function_in_int_at_Main, function_abort_at_Main, function_type_name_at_Main, function_copy_at_Main, function_main_at_Main, function_fib_at_Main +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main # # **** Type RECORD for type Main **** Main_start: - Main_vtable_pointer: .word Main_vtable - Main_end: +Main_vtable_pointer: .word Main_vtable +Main_end: # -.data -data_0: .asciiz +data_0: .asciiz "" # -.data __Object_Object_tdt_entry__: .word 0 __Object_Int_tdt_entry__: .word 1 __Object_String_tdt_entry__: .word 1 __Object_Bool_tdt_entry__: .word 1 __Object_IO_tdt_entry__: .word 1 +__Object_A_tdt_entry__: .word 1 +__Object_B_tdt_entry__: .word 2 +__Object_C_tdt_entry__: .word 2 +__Object_D_tdt_entry__: .word 3 __Object_Main_tdt_entry__: .word 2 __Int_Object_tdt_entry__: .word -1 __Int_Int_tdt_entry__: .word 0 __Int_String_tdt_entry__: .word -1 __Int_Bool_tdt_entry__: .word -1 __Int_IO_tdt_entry__: .word -1 +__Int_A_tdt_entry__: .word -1 +__Int_B_tdt_entry__: .word -1 +__Int_C_tdt_entry__: .word -1 +__Int_D_tdt_entry__: .word -1 __Int_Main_tdt_entry__: .word -1 __String_Object_tdt_entry__: .word -1 __String_Int_tdt_entry__: .word -1 __String_String_tdt_entry__: .word 0 __String_Bool_tdt_entry__: .word -1 __String_IO_tdt_entry__: .word -1 +__String_A_tdt_entry__: .word -1 +__String_B_tdt_entry__: .word -1 +__String_C_tdt_entry__: .word -1 +__String_D_tdt_entry__: .word -1 __String_Main_tdt_entry__: .word -1 __Bool_Object_tdt_entry__: .word -1 __Bool_Int_tdt_entry__: .word -1 __Bool_String_tdt_entry__: .word -1 __Bool_Bool_tdt_entry__: .word 0 __Bool_IO_tdt_entry__: .word -1 +__Bool_A_tdt_entry__: .word -1 +__Bool_B_tdt_entry__: .word -1 +__Bool_C_tdt_entry__: .word -1 +__Bool_D_tdt_entry__: .word -1 __Bool_Main_tdt_entry__: .word -1 __IO_Object_tdt_entry__: .word -1 __IO_Int_tdt_entry__: .word -1 __IO_String_tdt_entry__: .word -1 __IO_Bool_tdt_entry__: .word -1 __IO_IO_tdt_entry__: .word 0 +__IO_A_tdt_entry__: .word -1 +__IO_B_tdt_entry__: .word -1 +__IO_C_tdt_entry__: .word 1 +__IO_D_tdt_entry__: .word 2 __IO_Main_tdt_entry__: .word 1 +__A_Object_tdt_entry__: .word -1 +__A_Int_tdt_entry__: .word -1 +__A_String_tdt_entry__: .word -1 +__A_Bool_tdt_entry__: .word -1 +__A_IO_tdt_entry__: .word -1 +__A_A_tdt_entry__: .word 0 +__A_B_tdt_entry__: .word 1 +__A_C_tdt_entry__: .word -1 +__A_D_tdt_entry__: .word -1 +__A_Main_tdt_entry__: .word -1 +__B_Object_tdt_entry__: .word -1 +__B_Int_tdt_entry__: .word -1 +__B_String_tdt_entry__: .word -1 +__B_Bool_tdt_entry__: .word -1 +__B_IO_tdt_entry__: .word -1 +__B_A_tdt_entry__: .word -1 +__B_B_tdt_entry__: .word 0 +__B_C_tdt_entry__: .word -1 +__B_D_tdt_entry__: .word -1 +__B_Main_tdt_entry__: .word -1 +__C_Object_tdt_entry__: .word -1 +__C_Int_tdt_entry__: .word -1 +__C_String_tdt_entry__: .word -1 +__C_Bool_tdt_entry__: .word -1 +__C_IO_tdt_entry__: .word -1 +__C_A_tdt_entry__: .word -1 +__C_B_tdt_entry__: .word -1 +__C_C_tdt_entry__: .word 0 +__C_D_tdt_entry__: .word 1 +__C_Main_tdt_entry__: .word -1 +__D_Object_tdt_entry__: .word -1 +__D_Int_tdt_entry__: .word -1 +__D_String_tdt_entry__: .word -1 +__D_Bool_tdt_entry__: .word -1 +__D_IO_tdt_entry__: .word -1 +__D_A_tdt_entry__: .word -1 +__D_B_tdt_entry__: .word -1 +__D_C_tdt_entry__: .word -1 +__D_D_tdt_entry__: .word 0 +__D_Main_tdt_entry__: .word -1 __Main_Object_tdt_entry__: .word -1 __Main_Int_tdt_entry__: .word -1 __Main_String_tdt_entry__: .word -1 __Main_Bool_tdt_entry__: .word -1 __Main_IO_tdt_entry__: .word -1 +__Main_A_tdt_entry__: .word -1 +__Main_B_tdt_entry__: .word -1 +__Main_C_tdt_entry__: .word -1 +__Main_D_tdt_entry__: .word -1 __Main_Main_tdt_entry__: .word 0 # -.data -data_2: .asciiz "Enter n to find nth fibonacci number!\n" +data_2: .asciiz "A: Hello world\n" # -.data -data_3: .asciiz "\n" +data_3: .asciiz "B: Hello world\n" +# + + +data_4: .asciiz "C: Hello world\n" +# + + +data_5: .asciiz "D: Hello world\n" +# + + +data_6: .asciiz "Done.\n" # @@ -85,9 +227,170 @@ main: # syscall code 10 is for exit li $v0, 10 syscall - # main END + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + -.text # entry implementation. # @Params: entry: @@ -102,18 +405,14 @@ entry: li $a0, 8 li $v0, 9 syscall - la $t0, Main - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - move $t1, $v0 - sw $t1, -4($fp) - # ARG local__internal_0 + la $t1, Main + sw $t1, 0($v0) + la $t1, Main_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -4($fp) # LOCAL local__internal_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) + lw $s1, -4($fp) # local__internal_1 = CALL function_main_at_Main # LOCAL local__internal_1 --> -8($fp) jal function_main_at_Main @@ -131,265 +430,466 @@ entry: # Function END -.text -# function_main_at_Main implementation. +# __A__attrib__io__init implementation. # @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 76 +__A__attrib__io__init: + # Allocate stack frame for function __A__attrib__io__init. + subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 76 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $a0, -12($fp) - # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 - lw $t0, -12($fp) + addu $fp, $sp, 32 + # LOCAL local_ib__io__init_internal_0 --> -4($fp) + # local_ib__io__init_internal_0 = ALLOCATE IO + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, IO + sw $t1, 0($v0) + la $t1, IO_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -4($fp) + # RETURN local_ib__io__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __A__attrib__io__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_a_at_A implementation. +# @Params: +function_out_a_at_A: + # Allocate stack frame for function function_out_a_at_A. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_out_a_at_A_internal_2 = GETATTRIBUTE io A + # LOCAL local_out_a_at_A_internal_2 --> -12($fp) + lw $t1, 8($s1) + sw $t1, -12($fp) + # local_out_a_at_A_internal_0 = TYPEOF local_out_a_at_A_internal_2 + lw $t1, -12($fp) # Load pointer to type - lw $t1, 4($t0) - sw $t1, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t2, 4($t1) + sw $t2, -4($fp) + # LOCAL local_out_a_at_A_internal_3 --> -16($fp) # - lw $t0, data_2 - sw $t0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) + la $t1, data_2 + sw $t1, -16($fp) + # ARG local_out_a_at_A_internal_3 + # LOCAL local_out_a_at_A_internal_3 --> -16($fp) + lw $t1, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + sw $t1, 0($sp) + # LOCAL local_out_a_at_A_internal_0 --> -4($fp) + # LOCAL local_out_a_at_A_internal_1 --> -8($fp) + # local_out_a_at_A_internal_1 = VCALL local_out_a_at_A_internal_0 out_string # Save current self pointer in $a1 - move $a1, $a0 - # Save new self pointer in $a0 - lw $a0, -4($fp) + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) # Get pointer to type - lw $t0, -4($fp) + lw $t1, -4($fp) # Get pointer to type's VTABLE - lw $t1, 0($t0) - # Get pointer to function address lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 8($t2) # Call function. Result is on $v0 - jalr $t2 + jalr $t3 sw $v0, -8($fp) # Restore self pointer after function call - move $a0, $a1 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # local_main_at_Main_internal_6 = SELF - sw $a0, -28($fp) - # local_main_at_Main_internal_4 = TYPEOF local_main_at_Main_internal_6 - lw $t0, -28($fp) - # Load pointer to type - lw $t1, 4($t0) - sw $t1, -20($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = SELF - sw $a0, -40($fp) - # local_main_at_Main_internal_7 = TYPEOF local_main_at_Main_internal_9 - lw $t0, -40($fp) - # Load pointer to type - lw $t1, 4($t0) - sw $t1, -32($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_12 = SELF - sw $a0, -52($fp) - # local_main_at_Main_internal_10 = TYPEOF local_main_at_Main_internal_12 - lw $t0, -52($fp) + move $s1, $a1 + # RETURN local_out_a_at_A_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_a_at_A. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_b_at_B implementation. +# @Params: +function_out_b_at_B: + # Allocate stack frame for function function_out_b_at_B. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_out_b_at_B_internal_2 = GETATTRIBUTE io B + # LOCAL local_out_b_at_B_internal_2 --> -12($fp) + lw $t1, 8($s1) + sw $t1, -12($fp) + # local_out_b_at_B_internal_0 = TYPEOF local_out_b_at_B_internal_2 + lw $t1, -12($fp) # Load pointer to type - lw $t1, 4($t0) - sw $t1, -44($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 in_int - # Save current self pointer in $a1 - move $a1, $a0 - # Save new self pointer in $a0 - lw $a0, -44($fp) - # Get pointer to type - lw $t0, -44($fp) - # Get pointer to type's VTABLE - lw $t1, 0($t0) - # Get pointer to function address - lw $t2, 12($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -48($fp) - # Restore self pointer after function call - move $a0, $a1 - # ARG local_main_at_Main_internal_11 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - lw $t0, -48($fp) + lw $t2, 4($t1) + sw $t2, -4($fp) + # LOCAL local_out_b_at_B_internal_3 --> -16($fp) + # + la $t1, data_3 + sw $t1, -16($fp) + # ARG local_out_b_at_B_internal_3 + # LOCAL local_out_b_at_B_internal_3 --> -16($fp) + lw $t1, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 fib + sw $t1, 0($sp) + # LOCAL local_out_b_at_B_internal_0 --> -4($fp) + # LOCAL local_out_b_at_B_internal_1 --> -8($fp) + # local_out_b_at_B_internal_1 = VCALL local_out_b_at_B_internal_0 out_string # Save current self pointer in $a1 - move $a1, $a0 - # Save new self pointer in $a0 - lw $a0, -32($fp) + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) # Get pointer to type - lw $t0, -32($fp) + lw $t1, -4($fp) # Get pointer to type's VTABLE - lw $t1, 0($t0) + lw $t2, 0($t1) # Get pointer to function address - lw $t2, 32($t1) + lw $t3, 8($t2) # Call function. Result is on $v0 - jalr $t2 - sw $v0, -36($fp) + jalr $t3 + sw $v0, -8($fp) # Restore self pointer after function call - move $a0, $a1 - # ARG local_main_at_Main_internal_8 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - lw $t0, -36($fp) + move $s1, $a1 + # RETURN local_out_b_at_B_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_b_at_B. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_c_at_C implementation. +# @Params: +function_out_c_at_C: + # Allocate stack frame for function function_out_c_at_C. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_out_c_at_C_internal_2 --> -12($fp) + # local_out_c_at_C_internal_2 = SELF + sw $s1, -12($fp) + # local_out_c_at_C_internal_0 = TYPEOF local_out_c_at_C_internal_2 + lw $t1, -12($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -4($fp) + # LOCAL local_out_c_at_C_internal_3 --> -16($fp) + # + la $t1, data_4 + sw $t1, -16($fp) + # ARG local_out_c_at_C_internal_3 + # LOCAL local_out_c_at_C_internal_3 --> -16($fp) + lw $t1, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 out_int + sw $t1, 0($sp) + # LOCAL local_out_c_at_C_internal_0 --> -4($fp) + # LOCAL local_out_c_at_C_internal_1 --> -8($fp) + # local_out_c_at_C_internal_1 = VCALL local_out_c_at_C_internal_0 out_string # Save current self pointer in $a1 - move $a1, $a0 - # Save new self pointer in $a0 - lw $a0, -20($fp) + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) # Get pointer to type - lw $t0, -20($fp) + lw $t1, -4($fp) # Get pointer to type's VTABLE - lw $t1, 0($t0) + lw $t2, 0($t1) # Get pointer to function address - lw $t2, 4($t1) + lw $t3, 8($t2) # Call function. Result is on $v0 - jalr $t2 - sw $v0, -24($fp) + jalr $t3 + sw $v0, -8($fp) # Restore self pointer after function call - move $a0, $a1 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = SELF - sw $a0, -64($fp) - # local_main_at_Main_internal_13 = TYPEOF local_main_at_Main_internal_15 - lw $t0, -64($fp) + move $s1, $a1 + # RETURN local_out_c_at_C_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_c_at_C. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_d_at_D implementation. +# @Params: +function_out_d_at_D: + # Allocate stack frame for function function_out_d_at_D. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_out_d_at_D_internal_2 --> -12($fp) + # local_out_d_at_D_internal_2 = SELF + sw $s1, -12($fp) + # local_out_d_at_D_internal_0 = TYPEOF local_out_d_at_D_internal_2 + lw $t1, -12($fp) # Load pointer to type - lw $t1, 4($t0) - sw $t1, -56($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) + lw $t2, 4($t1) + sw $t2, -4($fp) + # LOCAL local_out_d_at_D_internal_3 --> -16($fp) # - lw $t0, data_3 - sw $t0, -68($fp) - # ARG local_main_at_Main_internal_16 - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - lw $t0, -68($fp) + la $t1, data_5 + sw $t1, -16($fp) + # ARG local_out_d_at_D_internal_3 + # LOCAL local_out_d_at_D_internal_3 --> -16($fp) + lw $t1, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 out_string + sw $t1, 0($sp) + # LOCAL local_out_d_at_D_internal_0 --> -4($fp) + # LOCAL local_out_d_at_D_internal_1 --> -8($fp) + # local_out_d_at_D_internal_1 = VCALL local_out_d_at_D_internal_0 out_string # Save current self pointer in $a1 - move $a1, $a0 - # Save new self pointer in $a0 - lw $a0, -56($fp) + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) # Get pointer to type - lw $t0, -56($fp) + lw $t1, -4($fp) # Get pointer to type's VTABLE - lw $t1, 0($t0) - # Get pointer to function address lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 8($t2) # Call function. Result is on $v0 - jalr $t2 - sw $v0, -60($fp) + jalr $t3 + sw $v0, -8($fp) # Restore self pointer after function call - move $a0, $a1 - # RETURN local_main_at_Main_internal_14 - lw $v0, -60($fp) - # Deallocate stack frame for function function_main_at_Main. + move $s1, $a1 + # RETURN local_out_d_at_D_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_d_at_D. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 76 + addu $sp, $sp, 32 jr $ra # Function END -.text -# function_fib_at_Main implementation. +# function_main_at_Main implementation. # @Params: -# 0($fp) = param_fib_at_Main_i_0 -function_fib_at_Main: - # Allocate stack frame for function function_fib_at_Main. - subu $sp, $sp, 32 +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 72 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # local_fib_at_Main_a_0 = 1 - li $t0, 1 - sw $t0, -4($fp) - # LOCAL local_fib_at_Main_b_1 --> -8($fp) - # local_fib_at_Main_b_1 = 0 - li $t0, 0 - sw $t0, -8($fp) - # LOCAL local_fib_at_Main_c_2 --> -12($fp) - # local_fib_at_Main_c_2 = 0 - li $t0, 0 - sw $t0, -12($fp) - label_WHILE_1: - # LOCAL local_fib_at_Main_internal_3 --> -16($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # local_fib_at_Main_internal_3 = PARAM param_fib_at_Main_i_0 - 0 - lw $t0, 0($fp) - sub $t0, $t0, 0 - sw $t0, -16($fp) - # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 - # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_3 - # LOCAL local_fib_at_Main_internal_3 --> -16($fp) - # local_fib_at_Main_internal_3 = 0 - li $t0, 0 - sw $t0, -16($fp) - # GOTO label_END_4 - j label_END_4 - label_TRUE_3: - # LOCAL local_fib_at_Main_internal_3 --> -16($fp) - # local_fib_at_Main_internal_3 = 1 - li $t0, 1 - sw $t0, -16($fp) - label_END_4: - # NOT local_fib_at_Main_internal_3 - # LOCAL local_fib_at_Main_internal_3 --> -16($fp) - # Load value in register - lw $t0, -16($fp) - # a nor 0 = not (a or 0) = not a - nor $t0, $t0, $zero - # Store negated value - sw $t0, -16($fp) - # IF_ZERO local_fib_at_Main_internal_3 GOTO label_WHILE_END_2 - # IF_ZERO local_fib_at_Main_internal_3 GOTO label_WHILE_END_2 - lw $t0, -16($fp) - beq $t0, 0, label_WHILE_END_2 - # = - # = - # = - # = - # GOTO label_WHILE_1 - j label_WHILE_1 - label_WHILE_END_2: - # RETURN local_fib_at_Main_a_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_fib_at_Main. + addu $fp, $sp, 72 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = ALLOCATE A + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + la $t1, A + sw $t1, 0($v0) + la $t1, A_start + sw $t1, 4($v0) + move $t2, $v0 + jal __A__attrib__io__init + sw $v0, 8($t2) + sw $t2, -12($fp) + # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 + lw $t1, -12($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -4($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_a + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, -4($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = ALLOCATE B + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + la $t1, B + sw $t1, 0($v0) + la $t1, B_start + sw $t1, 4($v0) + move $t2, $v0 + jal __A__attrib__io__init + sw $v0, 8($t2) + sw $t2, -24($fp) + # local_main_at_Main_internal_3 = TYPEOF local_main_at_Main_internal_5 + lw $t1, -24($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -16($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 out_b + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t1, -16($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 4($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -20($fp) + # Restore self pointer after function call + move $s1, $a1 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = ALLOCATE C + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, C + sw $t1, 0($v0) + la $t1, C_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -36($fp) + # local_main_at_Main_internal_6 = TYPEOF local_main_at_Main_internal_8 + lw $t1, -36($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -28($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_c + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, -28($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 28($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Restore self pointer after function call + move $s1, $a1 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = ALLOCATE D + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, D + sw $t1, 0($v0) + la $t1, D_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -48($fp) + # local_main_at_Main_internal_9 = TYPEOF local_main_at_Main_internal_11 + lw $t1, -48($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -40($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_d + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, -40($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 4($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Restore self pointer after function call + move $s1, $a1 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = SELF + sw $s1, -60($fp) + # local_main_at_Main_internal_12 = TYPEOF local_main_at_Main_internal_14 + lw $t1, -60($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -52($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # + la $t1, data_6 + sw $t1, -64($fp) + # ARG local_main_at_Main_internal_15 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + lw $t1, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t1, -52($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 8($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -56($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_main_at_Main_internal_13 + lw $v0, -56($fp) + # Deallocate stack frame for function function_main_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 + addu $sp, $sp, 72 jr $ra # Function END diff --git a/src/testing.py b/src/testing.py index 394948a6..2f85f5b1 100755 --- a/src/testing.py +++ b/src/testing.py @@ -61,14 +61,108 @@ def pipeline(program: str, deep: int) -> None: text = r"""(* -But it is an error to assign to self or to bind self in a let, a -case, or as a formal parameter. It is also illegal to have attributes named self. -*) + * The IO class is predefined and has 4 methods: + * + * out_string(s : String) : SELF_TYPE + * out_int(i : Int) : SELF_TYPE + * in_string() : String + * in_int() : Int + * + * The out operations print their argument to the terminal. The + * in_string method reads an entire line from the terminal and returns a + * string not containing the new line. The in_int method also reads + * an entire line from the terminal and returns the integer + * corresponding to the first non blank word on the line. If that + * word is not an integer, it returns 0. + * + * + * Because our language is object oriented, we need an object of type + * IO in order to call any of these methods. + * + * There are basically two ways of getting access to IO in a class C. + * + * 1) Define C to Inherit from IO. This way the IO methods become + * methods of C, and they can be called using the abbreviated + * dispatch, i.e. + * + * class C inherits IO is + * ... + * out_string("Hello world\n") + * ... + * end; + * + * 2) If your class C does not directly or indirectly inherit from + * IO, the best way to access IO is through an initialized + * attribute of type IO. + * + * class C inherits Foo is + * io : IO <- new IO; + * ... + * io.out_string("Hello world\n"); + * ... + * end; + * + * Approach 1) is most often used, in particular when you need IO + * functions in the Main class. + * + *) + + +class A { + + -- Let's assume that we don't want A to not inherit from IO. + + io : IO <- new IO; + + out_a() : Object { io.out_string("A: Hello world\n") }; + +}; + + +class B inherits A { + + -- B does not have to an extra attribute, since it inherits io from A. + + out_b() : Object { io.out_string("B: Hello world\n") }; + +}; + + +class C inherits IO { + + -- Now the IO methods are part of C. + + out_c() : Object { out_string("C: Hello world\n") }; + + -- Note that out_string(...) is just a shorthand for self.out_string(...) + +}; + + +class D inherits C { + + -- Inherits IO methods from C. + + out_d() : Object { out_string("D: Hello world\n") }; + +}; + class Main inherits IO { - main(): IO { out_string("Hello World!")}; - test(): IO { let self: Main <- new Main in self }; -}; + -- Same case as class C. + + main() : Object { + { + (new A).out_a(); + (new B).out_b(); + (new C).out_c(); + (new D).out_d(); + out_string("Done.\n"); + } + }; + +}; + """ pipeline(text, 5) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 2a1b178b..9e63a5df 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -22,6 +22,7 @@ a1, zero, s1, + at ) import mips.branch as branchNodes from functools import singledispatchmethod @@ -41,6 +42,9 @@ def _(self, node: cil.CilProgramNode): self.types = node.dottypes + # Los tipos los definiremos en la seccion .data + self.register_instruction(DotDataDirective()) + # Generar los tipos self.create_type_array(node.dottypes) @@ -56,6 +60,9 @@ def _(self, node: cil.CilProgramNode): self.visit(data_node) self.comment("\n\n") + # El codigo referente a cada funcion debe ir en la seccion de texto. + self.register_instruction(DotTextDirective()) + self.define_entry_point() # Visitar cada nodo de la seccion .CODE @@ -67,9 +74,6 @@ def _(self, node: cil.TypeNode): # noqa: F811 # registrar el tipo actual que estamos construyendo self.current_type = node - # Los tipos los definiremos en la seccion .data - self.register_instruction(DotDataDirective()) - # Construir la VTABLE para este tipo. self.comment(f" **** VTABLE for type {node.name} ****") @@ -119,8 +123,6 @@ def _(self, node: cil.TypeNode): # noqa: F811 @visit.register def _(self, node: cil.DataNode): - # Registrar los DataNode en la seccion .data - self.register_instruction(DotDataDirective()) if isinstance(node.value, str): self.register_instruction( FixedData(node.name, f"{node.value}", type_="asciiz") @@ -141,8 +143,6 @@ def _(self, node: cil.DataNode): @visit.register def _(self, node: cil.FunctionNode): self.current_function = node - # El codigo referente a cada funcion debe ir en la seccion de texto. - self.register_instruction(DotTextDirective()) # Documentar la signatura de la funcion (parametros que recibe, valor que devuelve) self.cil_func_signature(node) @@ -160,6 +160,17 @@ def _(self, node: cil.FunctionNode): self.comment("Function END\n\n") + @visit.register + def _(self, node: cil.InitSelfNode): + src = self.visit(node.src) + assert src is not None + + self.register_instruction(LW(s1, src)) + + @visit.register + def _(self, node: cil.SetAtAddress): + self.register_instruction(LI(at, 0)) + @visit.register def _(self, node: cil.LabelNode): self.register_instruction(Label(node.label)) @@ -581,7 +592,7 @@ def _(self, node: cil.LoadNode): reg = self.get_available_register() assert reg is not None, "Out of registers" self.add_source_line_comment(node) - self.register_instruction(LW(reg, node.message.name)) + self.register_instruction(LA(reg, node.message.name)) self.register_instruction(SW(reg, dest)) self.used_registers[reg] = False @@ -608,6 +619,18 @@ def _(self, node: cil.ToStrNode): def _(self, node: cil.ReadNode): pass + @visit.register + def _(self, node: cil.TypeName): + dest = self.visit(node.dest) + assert dest is not None + + # Cargar el puntero al objeto que se esta llamando + reg = self.get_available_register() + assert reg is not None + + self.register_instruction(LW(reg, f"0($s1)")) + self.register_instruction(SW(reg, dest)) + @visit.register def _(self, node: cil.PrintIntNode): # El valor a imprimir se encuentra en la direccion @@ -693,6 +716,6 @@ def to_str(self) -> str: if "#" not in line and (":" in line and "end" not in line): if "word" not in line and "asciiz" not in line and "byte" not in line: indent += 1 - if "#" not in line and ("END" in line or "end" in line): + if "# Function END" in line: indent -= 1 return program diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index b4f148b8..ba2b039a 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -1,10 +1,9 @@ -import re -from cloudpickle.cloudpickle import instance +from abstract.semantics import Type from abstract.tree import EqualToNode, SelfNode import cil.baseCilVisitor as baseCilVisitor import abstract.tree as coolAst import abstract.semantics as semantics -from typing import List, Optional, Tuple, no_type_check +from typing import List, Optional, Tuple from functools import singledispatchmethod import cil.nodes @@ -23,6 +22,7 @@ GetAttributeNode, GetTypeIndex, IfZeroJump, + InitSelfNode, InstructionNode, JumpIfGreaterThanZeroNode, LabelNode, @@ -39,6 +39,7 @@ ReadIntNode, ReadNode, ReturnNode, + SetAtAddress, SetAttributeNode, StarNode, StaticCallNode, @@ -49,6 +50,13 @@ UnconditionalJump, ) + +def find_method_in_parent(type_: Type, method: str): + if type_.parent is None or method not in type_.parent.methods: + return type_ + return find_method_in_parent(type_.parent, method) + + ExpressionReturn = Tuple[List[InstructionNode], List[LocalNode]] Scope = semantics.Scope @@ -73,7 +81,7 @@ def _(self, node: coolAst.ProgramNode, scope: Scope) -> CilProgramNode: # Reservar memoria para el objeto Main main_type = self.context.get_type("Main") self.register_instruction(AllocateNode(main_type, instance)) - self.register_instruction(ArgNode(instance)) + self.register_instruction(InitSelfNode(instance)) # Llamar al metodo main self.register_instruction( @@ -110,7 +118,10 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: ( method, self.to_function_name( - method, self.current_type.parent.name + method, + find_method_in_parent( + self.current_type.parent, method + ).name, ), ) ) @@ -125,17 +136,14 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: # } # ##################################################################### for attribute in attributes: - new_type_node.attributes.append(attribute) + if attribute not in self.current_type.parent.attributes: + new_type_node.attributes.append(attribute) for method in methods: new_type_node.methods.append( (method, self.to_function_name(method, node.idx)) ) - print(self.current_type) - print(new_type_node.attributes) - print(new_type_node.methods) - # Visitar los atributos definidos en la clase para generar sus funciones # de inicializacion for feature in node.features: diff --git a/tests/codegen/hello_world.cl.mips b/tests/codegen/hello_world.cl.mips new file mode 100644 index 00000000..2dfaeac4 --- /dev/null +++ b/tests/codegen/hello_world.cl.mips @@ -0,0 +1,335 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Nov 29 21:40:32 2020 +# School of Math and Computer Science, University of Havana +# + +.data +Main: + # + + + # **** VTABLE for type Main **** + Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main + # + + + # **** Type RECORD for type Main **** + Main_start: + Main_vtable_pointer: .word Main_vtable + Main_end: + # + + + data_0: .asciiz "" + # + + + __Object_Object_tdt_entry__: .word 0 + __Object_Int_tdt_entry__: .word 1 + __Object_String_tdt_entry__: .word 1 + __Object_Bool_tdt_entry__: .word 1 + __Object_IO_tdt_entry__: .word 1 + __Object_Main_tdt_entry__: .word 2 + __Int_Object_tdt_entry__: .word -1 + __Int_Int_tdt_entry__: .word 0 + __Int_String_tdt_entry__: .word -1 + __Int_Bool_tdt_entry__: .word -1 + __Int_IO_tdt_entry__: .word -1 + __Int_Main_tdt_entry__: .word -1 + __String_Object_tdt_entry__: .word -1 + __String_Int_tdt_entry__: .word -1 + __String_String_tdt_entry__: .word 0 + __String_Bool_tdt_entry__: .word -1 + __String_IO_tdt_entry__: .word -1 + __String_Main_tdt_entry__: .word -1 + __Bool_Object_tdt_entry__: .word -1 + __Bool_Int_tdt_entry__: .word -1 + __Bool_String_tdt_entry__: .word -1 + __Bool_Bool_tdt_entry__: .word 0 + __Bool_IO_tdt_entry__: .word -1 + __Bool_Main_tdt_entry__: .word -1 + __IO_Object_tdt_entry__: .word -1 + __IO_Int_tdt_entry__: .word -1 + __IO_String_tdt_entry__: .word -1 + __IO_Bool_tdt_entry__: .word -1 + __IO_IO_tdt_entry__: .word 0 + __IO_Main_tdt_entry__: .word 1 + __Main_Object_tdt_entry__: .word -1 + __Main_Int_tdt_entry__: .word -1 + __Main_String_tdt_entry__: .word -1 + __Main_Bool_tdt_entry__: .word -1 + __Main_IO_tdt_entry__: .word -1 + __Main_Main_tdt_entry__: .word 0 + # + + + data_2: .asciiz "Hello, World.\n" + # + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, Main + sw $t1, 0($v0) + la $t1, Main_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 + lw $t1, -12($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # + la $t1, data_2 + sw $t1, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, -4($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips new file mode 100644 index 00000000..ccefcd74 --- /dev/null +++ b/tests/codegen/hello_world.mips @@ -0,0 +1,335 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Nov 29 21:47:38 2020 +# School of Math and Computer Science, University of Havana +# + +.data +Main: + # + + + # **** VTABLE for type Main **** + Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main + # + + + # **** Type RECORD for type Main **** + Main_start: + Main_vtable_pointer: .word Main_vtable + Main_end: + # + + + data_0: .asciiz "" + # + + + __Object_Object_tdt_entry__: .word 0 + __Object_Int_tdt_entry__: .word 1 + __Object_String_tdt_entry__: .word 1 + __Object_Bool_tdt_entry__: .word 1 + __Object_IO_tdt_entry__: .word 1 + __Object_Main_tdt_entry__: .word 2 + __Int_Object_tdt_entry__: .word -1 + __Int_Int_tdt_entry__: .word 0 + __Int_String_tdt_entry__: .word -1 + __Int_Bool_tdt_entry__: .word -1 + __Int_IO_tdt_entry__: .word -1 + __Int_Main_tdt_entry__: .word -1 + __String_Object_tdt_entry__: .word -1 + __String_Int_tdt_entry__: .word -1 + __String_String_tdt_entry__: .word 0 + __String_Bool_tdt_entry__: .word -1 + __String_IO_tdt_entry__: .word -1 + __String_Main_tdt_entry__: .word -1 + __Bool_Object_tdt_entry__: .word -1 + __Bool_Int_tdt_entry__: .word -1 + __Bool_String_tdt_entry__: .word -1 + __Bool_Bool_tdt_entry__: .word 0 + __Bool_IO_tdt_entry__: .word -1 + __Bool_Main_tdt_entry__: .word -1 + __IO_Object_tdt_entry__: .word -1 + __IO_Int_tdt_entry__: .word -1 + __IO_String_tdt_entry__: .word -1 + __IO_Bool_tdt_entry__: .word -1 + __IO_IO_tdt_entry__: .word 0 + __IO_Main_tdt_entry__: .word 1 + __Main_Object_tdt_entry__: .word -1 + __Main_Int_tdt_entry__: .word -1 + __Main_String_tdt_entry__: .word -1 + __Main_Bool_tdt_entry__: .word -1 + __Main_IO_tdt_entry__: .word -1 + __Main_Main_tdt_entry__: .word 0 + # + + + data_2: .asciiz "Hello, World.\n" + # + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, Main + sw $t1, 0($v0) + la $t1, Main_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 + lw $t1, -12($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # + la $t1, data_2 + sw $t1, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, -4($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/codegen/io.cl.mips b/tests/codegen/io.cl.mips new file mode 100644 index 00000000..a3eff4b8 --- /dev/null +++ b/tests/codegen/io.cl.mips @@ -0,0 +1,877 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Nov 29 21:40:33 2020 +# School of Math and Computer Science, University of Havana +# + +.data +A: + B: + C: + D: + Main: + # + + + # **** VTABLE for type A **** + A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A + # + + + # **** Type RECORD for type A **** + A_start: + A_vtable_pointer: .word A_vtable + A_attrib_io: .word 0 + A_end: + # + + + # **** VTABLE for type B **** + B_vtable: .word function_out_a_at_A, function_out_b_at_B + # + + + # **** Type RECORD for type B **** + B_start: + B_vtable_pointer: .word B_vtable + B_attrib_io: .word 0 + B_attrib_io: .word 0 + B_end: + # + + + # **** VTABLE for type C **** + C_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_c_at_C + # + + + # **** Type RECORD for type C **** + C_start: + C_vtable_pointer: .word C_vtable + C_end: + # + + + # **** VTABLE for type D **** + D_vtable: .word function_out_c_at_C, function_out_d_at_D + # + + + # **** Type RECORD for type D **** + D_start: + D_vtable_pointer: .word D_vtable + D_end: + # + + + # **** VTABLE for type Main **** + Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main + # + + + # **** Type RECORD for type Main **** + Main_start: + Main_vtable_pointer: .word Main_vtable + Main_end: + # + + + data_0: .asciiz "" + # + + + __Object_Object_tdt_entry__: .word 0 + __Object_Int_tdt_entry__: .word 1 + __Object_String_tdt_entry__: .word 1 + __Object_Bool_tdt_entry__: .word 1 + __Object_IO_tdt_entry__: .word 1 + __Object_A_tdt_entry__: .word 1 + __Object_B_tdt_entry__: .word 2 + __Object_C_tdt_entry__: .word 2 + __Object_D_tdt_entry__: .word 3 + __Object_Main_tdt_entry__: .word 2 + __Int_Object_tdt_entry__: .word -1 + __Int_Int_tdt_entry__: .word 0 + __Int_String_tdt_entry__: .word -1 + __Int_Bool_tdt_entry__: .word -1 + __Int_IO_tdt_entry__: .word -1 + __Int_A_tdt_entry__: .word -1 + __Int_B_tdt_entry__: .word -1 + __Int_C_tdt_entry__: .word -1 + __Int_D_tdt_entry__: .word -1 + __Int_Main_tdt_entry__: .word -1 + __String_Object_tdt_entry__: .word -1 + __String_Int_tdt_entry__: .word -1 + __String_String_tdt_entry__: .word 0 + __String_Bool_tdt_entry__: .word -1 + __String_IO_tdt_entry__: .word -1 + __String_A_tdt_entry__: .word -1 + __String_B_tdt_entry__: .word -1 + __String_C_tdt_entry__: .word -1 + __String_D_tdt_entry__: .word -1 + __String_Main_tdt_entry__: .word -1 + __Bool_Object_tdt_entry__: .word -1 + __Bool_Int_tdt_entry__: .word -1 + __Bool_String_tdt_entry__: .word -1 + __Bool_Bool_tdt_entry__: .word 0 + __Bool_IO_tdt_entry__: .word -1 + __Bool_A_tdt_entry__: .word -1 + __Bool_B_tdt_entry__: .word -1 + __Bool_C_tdt_entry__: .word -1 + __Bool_D_tdt_entry__: .word -1 + __Bool_Main_tdt_entry__: .word -1 + __IO_Object_tdt_entry__: .word -1 + __IO_Int_tdt_entry__: .word -1 + __IO_String_tdt_entry__: .word -1 + __IO_Bool_tdt_entry__: .word -1 + __IO_IO_tdt_entry__: .word 0 + __IO_A_tdt_entry__: .word -1 + __IO_B_tdt_entry__: .word -1 + __IO_C_tdt_entry__: .word 1 + __IO_D_tdt_entry__: .word 2 + __IO_Main_tdt_entry__: .word 1 + __A_Object_tdt_entry__: .word -1 + __A_Int_tdt_entry__: .word -1 + __A_String_tdt_entry__: .word -1 + __A_Bool_tdt_entry__: .word -1 + __A_IO_tdt_entry__: .word -1 + __A_A_tdt_entry__: .word 0 + __A_B_tdt_entry__: .word 1 + __A_C_tdt_entry__: .word -1 + __A_D_tdt_entry__: .word -1 + __A_Main_tdt_entry__: .word -1 + __B_Object_tdt_entry__: .word -1 + __B_Int_tdt_entry__: .word -1 + __B_String_tdt_entry__: .word -1 + __B_Bool_tdt_entry__: .word -1 + __B_IO_tdt_entry__: .word -1 + __B_A_tdt_entry__: .word -1 + __B_B_tdt_entry__: .word 0 + __B_C_tdt_entry__: .word -1 + __B_D_tdt_entry__: .word -1 + __B_Main_tdt_entry__: .word -1 + __C_Object_tdt_entry__: .word -1 + __C_Int_tdt_entry__: .word -1 + __C_String_tdt_entry__: .word -1 + __C_Bool_tdt_entry__: .word -1 + __C_IO_tdt_entry__: .word -1 + __C_A_tdt_entry__: .word -1 + __C_B_tdt_entry__: .word -1 + __C_C_tdt_entry__: .word 0 + __C_D_tdt_entry__: .word 1 + __C_Main_tdt_entry__: .word -1 + __D_Object_tdt_entry__: .word -1 + __D_Int_tdt_entry__: .word -1 + __D_String_tdt_entry__: .word -1 + __D_Bool_tdt_entry__: .word -1 + __D_IO_tdt_entry__: .word -1 + __D_A_tdt_entry__: .word -1 + __D_B_tdt_entry__: .word -1 + __D_C_tdt_entry__: .word -1 + __D_D_tdt_entry__: .word 0 + __D_Main_tdt_entry__: .word -1 + __Main_Object_tdt_entry__: .word -1 + __Main_Int_tdt_entry__: .word -1 + __Main_String_tdt_entry__: .word -1 + __Main_Bool_tdt_entry__: .word -1 + __Main_IO_tdt_entry__: .word -1 + __Main_A_tdt_entry__: .word -1 + __Main_B_tdt_entry__: .word -1 + __Main_C_tdt_entry__: .word -1 + __Main_D_tdt_entry__: .word -1 + __Main_Main_tdt_entry__: .word 0 + # + + + data_2: .asciiz "A: Hello world\n" + # + + + data_3: .asciiz "B: Hello world\n" + # + + + data_4: .asciiz "C: Hello world\n" + # + + + data_5: .asciiz "D: Hello world\n" + # + + + data_6: .asciiz "Done.\n" + # + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, Main + sw $t1, 0($v0) + la $t1, Main_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __A__attrib__io__init implementation. +# @Params: +__A__attrib__io__init: + # Allocate stack frame for function __A__attrib__io__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ib__io__init_internal_0 --> -4($fp) + # local_ib__io__init_internal_0 = ALLOCATE IO + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, IO + sw $t1, 0($v0) + la $t1, IO_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -4($fp) + # RETURN local_ib__io__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __A__attrib__io__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_a_at_A implementation. +# @Params: +function_out_a_at_A: + # Allocate stack frame for function function_out_a_at_A. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_out_a_at_A_internal_2 = GETATTRIBUTE io A + # LOCAL local_out_a_at_A_internal_2 --> -12($fp) + lw $t1, 8($s1) + sw $t1, -12($fp) + # local_out_a_at_A_internal_0 = TYPEOF local_out_a_at_A_internal_2 + lw $t1, -12($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -4($fp) + # LOCAL local_out_a_at_A_internal_3 --> -16($fp) + # + la $t1, data_2 + sw $t1, -16($fp) + # ARG local_out_a_at_A_internal_3 + # LOCAL local_out_a_at_A_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_out_a_at_A_internal_0 --> -4($fp) + # LOCAL local_out_a_at_A_internal_1 --> -8($fp) + # local_out_a_at_A_internal_1 = VCALL local_out_a_at_A_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, -4($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_out_a_at_A_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_a_at_A. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_b_at_B implementation. +# @Params: +function_out_b_at_B: + # Allocate stack frame for function function_out_b_at_B. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_out_b_at_B_internal_2 = GETATTRIBUTE io B + # LOCAL local_out_b_at_B_internal_2 --> -12($fp) + lw $t1, 8($s1) + sw $t1, -12($fp) + # local_out_b_at_B_internal_0 = TYPEOF local_out_b_at_B_internal_2 + lw $t1, -12($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -4($fp) + # LOCAL local_out_b_at_B_internal_3 --> -16($fp) + # + la $t1, data_3 + sw $t1, -16($fp) + # ARG local_out_b_at_B_internal_3 + # LOCAL local_out_b_at_B_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_out_b_at_B_internal_0 --> -4($fp) + # LOCAL local_out_b_at_B_internal_1 --> -8($fp) + # local_out_b_at_B_internal_1 = VCALL local_out_b_at_B_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, -4($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_out_b_at_B_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_b_at_B. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_c_at_C implementation. +# @Params: +function_out_c_at_C: + # Allocate stack frame for function function_out_c_at_C. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_out_c_at_C_internal_2 --> -12($fp) + # local_out_c_at_C_internal_2 = SELF + sw $s1, -12($fp) + # local_out_c_at_C_internal_0 = TYPEOF local_out_c_at_C_internal_2 + lw $t1, -12($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -4($fp) + # LOCAL local_out_c_at_C_internal_3 --> -16($fp) + # + la $t1, data_4 + sw $t1, -16($fp) + # ARG local_out_c_at_C_internal_3 + # LOCAL local_out_c_at_C_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_out_c_at_C_internal_0 --> -4($fp) + # LOCAL local_out_c_at_C_internal_1 --> -8($fp) + # local_out_c_at_C_internal_1 = VCALL local_out_c_at_C_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, -4($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_out_c_at_C_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_c_at_C. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_d_at_D implementation. +# @Params: +function_out_d_at_D: + # Allocate stack frame for function function_out_d_at_D. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_out_d_at_D_internal_2 --> -12($fp) + # local_out_d_at_D_internal_2 = SELF + sw $s1, -12($fp) + # local_out_d_at_D_internal_0 = TYPEOF local_out_d_at_D_internal_2 + lw $t1, -12($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -4($fp) + # LOCAL local_out_d_at_D_internal_3 --> -16($fp) + # + la $t1, data_5 + sw $t1, -16($fp) + # ARG local_out_d_at_D_internal_3 + # LOCAL local_out_d_at_D_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_out_d_at_D_internal_0 --> -4($fp) + # LOCAL local_out_d_at_D_internal_1 --> -8($fp) + # local_out_d_at_D_internal_1 = VCALL local_out_d_at_D_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, -4($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_out_d_at_D_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_d_at_D. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 72 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 72 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = ALLOCATE A + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + la $t1, A + sw $t1, 0($v0) + la $t1, A_start + sw $t1, 4($v0) + move $t2, $v0 + jal __A__attrib__io__init + sw $v0, 8($t2) + sw $t2, -12($fp) + # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 + lw $t1, -12($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -4($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_a + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, -4($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = ALLOCATE B + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + la $t1, B + sw $t1, 0($v0) + la $t1, B_start + sw $t1, 4($v0) + move $t2, $v0 + jal __A__attrib__io__init + sw $v0, 8($t2) + sw $t2, -24($fp) + # local_main_at_Main_internal_3 = TYPEOF local_main_at_Main_internal_5 + lw $t1, -24($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -16($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 out_b + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t1, -16($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 4($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -20($fp) + # Restore self pointer after function call + move $s1, $a1 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = ALLOCATE C + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, C + sw $t1, 0($v0) + la $t1, C_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -36($fp) + # local_main_at_Main_internal_6 = TYPEOF local_main_at_Main_internal_8 + lw $t1, -36($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -28($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_c + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, -28($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 28($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Restore self pointer after function call + move $s1, $a1 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = ALLOCATE D + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, D + sw $t1, 0($v0) + la $t1, D_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -48($fp) + # local_main_at_Main_internal_9 = TYPEOF local_main_at_Main_internal_11 + lw $t1, -48($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -40($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_d + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, -40($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 4($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Restore self pointer after function call + move $s1, $a1 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = SELF + sw $s1, -60($fp) + # local_main_at_Main_internal_12 = TYPEOF local_main_at_Main_internal_14 + lw $t1, -60($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -52($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # + la $t1, data_6 + sw $t1, -64($fp) + # ARG local_main_at_Main_internal_15 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + lw $t1, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t1, -52($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -56($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_main_at_Main_internal_13 + lw $v0, -56($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 72 + jr $ra + # Function END + diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips new file mode 100644 index 00000000..090844b6 --- /dev/null +++ b/tests/codegen/io.mips @@ -0,0 +1,877 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Nov 29 21:47:39 2020 +# School of Math and Computer Science, University of Havana +# + +.data +A: + B: + C: + D: + Main: + # + + + # **** VTABLE for type A **** + A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A + # + + + # **** Type RECORD for type A **** + A_start: + A_vtable_pointer: .word A_vtable + A_attrib_io: .word 0 + A_end: + # + + + # **** VTABLE for type B **** + B_vtable: .word function_out_a_at_A, function_out_b_at_B + # + + + # **** Type RECORD for type B **** + B_start: + B_vtable_pointer: .word B_vtable + B_attrib_io: .word 0 + B_attrib_io: .word 0 + B_end: + # + + + # **** VTABLE for type C **** + C_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_c_at_C + # + + + # **** Type RECORD for type C **** + C_start: + C_vtable_pointer: .word C_vtable + C_end: + # + + + # **** VTABLE for type D **** + D_vtable: .word function_out_c_at_C, function_out_d_at_D + # + + + # **** Type RECORD for type D **** + D_start: + D_vtable_pointer: .word D_vtable + D_end: + # + + + # **** VTABLE for type Main **** + Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main + # + + + # **** Type RECORD for type Main **** + Main_start: + Main_vtable_pointer: .word Main_vtable + Main_end: + # + + + data_0: .asciiz "" + # + + + __Object_Object_tdt_entry__: .word 0 + __Object_Int_tdt_entry__: .word 1 + __Object_String_tdt_entry__: .word 1 + __Object_Bool_tdt_entry__: .word 1 + __Object_IO_tdt_entry__: .word 1 + __Object_A_tdt_entry__: .word 1 + __Object_B_tdt_entry__: .word 2 + __Object_C_tdt_entry__: .word 2 + __Object_D_tdt_entry__: .word 3 + __Object_Main_tdt_entry__: .word 2 + __Int_Object_tdt_entry__: .word -1 + __Int_Int_tdt_entry__: .word 0 + __Int_String_tdt_entry__: .word -1 + __Int_Bool_tdt_entry__: .word -1 + __Int_IO_tdt_entry__: .word -1 + __Int_A_tdt_entry__: .word -1 + __Int_B_tdt_entry__: .word -1 + __Int_C_tdt_entry__: .word -1 + __Int_D_tdt_entry__: .word -1 + __Int_Main_tdt_entry__: .word -1 + __String_Object_tdt_entry__: .word -1 + __String_Int_tdt_entry__: .word -1 + __String_String_tdt_entry__: .word 0 + __String_Bool_tdt_entry__: .word -1 + __String_IO_tdt_entry__: .word -1 + __String_A_tdt_entry__: .word -1 + __String_B_tdt_entry__: .word -1 + __String_C_tdt_entry__: .word -1 + __String_D_tdt_entry__: .word -1 + __String_Main_tdt_entry__: .word -1 + __Bool_Object_tdt_entry__: .word -1 + __Bool_Int_tdt_entry__: .word -1 + __Bool_String_tdt_entry__: .word -1 + __Bool_Bool_tdt_entry__: .word 0 + __Bool_IO_tdt_entry__: .word -1 + __Bool_A_tdt_entry__: .word -1 + __Bool_B_tdt_entry__: .word -1 + __Bool_C_tdt_entry__: .word -1 + __Bool_D_tdt_entry__: .word -1 + __Bool_Main_tdt_entry__: .word -1 + __IO_Object_tdt_entry__: .word -1 + __IO_Int_tdt_entry__: .word -1 + __IO_String_tdt_entry__: .word -1 + __IO_Bool_tdt_entry__: .word -1 + __IO_IO_tdt_entry__: .word 0 + __IO_A_tdt_entry__: .word -1 + __IO_B_tdt_entry__: .word -1 + __IO_C_tdt_entry__: .word 1 + __IO_D_tdt_entry__: .word 2 + __IO_Main_tdt_entry__: .word 1 + __A_Object_tdt_entry__: .word -1 + __A_Int_tdt_entry__: .word -1 + __A_String_tdt_entry__: .word -1 + __A_Bool_tdt_entry__: .word -1 + __A_IO_tdt_entry__: .word -1 + __A_A_tdt_entry__: .word 0 + __A_B_tdt_entry__: .word 1 + __A_C_tdt_entry__: .word -1 + __A_D_tdt_entry__: .word -1 + __A_Main_tdt_entry__: .word -1 + __B_Object_tdt_entry__: .word -1 + __B_Int_tdt_entry__: .word -1 + __B_String_tdt_entry__: .word -1 + __B_Bool_tdt_entry__: .word -1 + __B_IO_tdt_entry__: .word -1 + __B_A_tdt_entry__: .word -1 + __B_B_tdt_entry__: .word 0 + __B_C_tdt_entry__: .word -1 + __B_D_tdt_entry__: .word -1 + __B_Main_tdt_entry__: .word -1 + __C_Object_tdt_entry__: .word -1 + __C_Int_tdt_entry__: .word -1 + __C_String_tdt_entry__: .word -1 + __C_Bool_tdt_entry__: .word -1 + __C_IO_tdt_entry__: .word -1 + __C_A_tdt_entry__: .word -1 + __C_B_tdt_entry__: .word -1 + __C_C_tdt_entry__: .word 0 + __C_D_tdt_entry__: .word 1 + __C_Main_tdt_entry__: .word -1 + __D_Object_tdt_entry__: .word -1 + __D_Int_tdt_entry__: .word -1 + __D_String_tdt_entry__: .word -1 + __D_Bool_tdt_entry__: .word -1 + __D_IO_tdt_entry__: .word -1 + __D_A_tdt_entry__: .word -1 + __D_B_tdt_entry__: .word -1 + __D_C_tdt_entry__: .word -1 + __D_D_tdt_entry__: .word 0 + __D_Main_tdt_entry__: .word -1 + __Main_Object_tdt_entry__: .word -1 + __Main_Int_tdt_entry__: .word -1 + __Main_String_tdt_entry__: .word -1 + __Main_Bool_tdt_entry__: .word -1 + __Main_IO_tdt_entry__: .word -1 + __Main_A_tdt_entry__: .word -1 + __Main_B_tdt_entry__: .word -1 + __Main_C_tdt_entry__: .word -1 + __Main_D_tdt_entry__: .word -1 + __Main_Main_tdt_entry__: .word 0 + # + + + data_2: .asciiz "A: Hello world\n" + # + + + data_3: .asciiz "B: Hello world\n" + # + + + data_4: .asciiz "C: Hello world\n" + # + + + data_5: .asciiz "D: Hello world\n" + # + + + data_6: .asciiz "Done.\n" + # + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, Main + sw $t1, 0($v0) + la $t1, Main_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __A__attrib__io__init implementation. +# @Params: +__A__attrib__io__init: + # Allocate stack frame for function __A__attrib__io__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ib__io__init_internal_0 --> -4($fp) + # local_ib__io__init_internal_0 = ALLOCATE IO + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, IO + sw $t1, 0($v0) + la $t1, IO_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -4($fp) + # RETURN local_ib__io__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __A__attrib__io__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_a_at_A implementation. +# @Params: +function_out_a_at_A: + # Allocate stack frame for function function_out_a_at_A. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_out_a_at_A_internal_2 = GETATTRIBUTE io A + # LOCAL local_out_a_at_A_internal_2 --> -12($fp) + lw $t1, 8($s1) + sw $t1, -12($fp) + # local_out_a_at_A_internal_0 = TYPEOF local_out_a_at_A_internal_2 + lw $t1, -12($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -4($fp) + # LOCAL local_out_a_at_A_internal_3 --> -16($fp) + # + la $t1, data_2 + sw $t1, -16($fp) + # ARG local_out_a_at_A_internal_3 + # LOCAL local_out_a_at_A_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_out_a_at_A_internal_0 --> -4($fp) + # LOCAL local_out_a_at_A_internal_1 --> -8($fp) + # local_out_a_at_A_internal_1 = VCALL local_out_a_at_A_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, -4($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_out_a_at_A_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_a_at_A. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_b_at_B implementation. +# @Params: +function_out_b_at_B: + # Allocate stack frame for function function_out_b_at_B. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_out_b_at_B_internal_2 = GETATTRIBUTE io B + # LOCAL local_out_b_at_B_internal_2 --> -12($fp) + lw $t1, 8($s1) + sw $t1, -12($fp) + # local_out_b_at_B_internal_0 = TYPEOF local_out_b_at_B_internal_2 + lw $t1, -12($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -4($fp) + # LOCAL local_out_b_at_B_internal_3 --> -16($fp) + # + la $t1, data_3 + sw $t1, -16($fp) + # ARG local_out_b_at_B_internal_3 + # LOCAL local_out_b_at_B_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_out_b_at_B_internal_0 --> -4($fp) + # LOCAL local_out_b_at_B_internal_1 --> -8($fp) + # local_out_b_at_B_internal_1 = VCALL local_out_b_at_B_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, -4($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_out_b_at_B_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_b_at_B. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_c_at_C implementation. +# @Params: +function_out_c_at_C: + # Allocate stack frame for function function_out_c_at_C. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_out_c_at_C_internal_2 --> -12($fp) + # local_out_c_at_C_internal_2 = SELF + sw $s1, -12($fp) + # local_out_c_at_C_internal_0 = TYPEOF local_out_c_at_C_internal_2 + lw $t1, -12($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -4($fp) + # LOCAL local_out_c_at_C_internal_3 --> -16($fp) + # + la $t1, data_4 + sw $t1, -16($fp) + # ARG local_out_c_at_C_internal_3 + # LOCAL local_out_c_at_C_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_out_c_at_C_internal_0 --> -4($fp) + # LOCAL local_out_c_at_C_internal_1 --> -8($fp) + # local_out_c_at_C_internal_1 = VCALL local_out_c_at_C_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, -4($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_out_c_at_C_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_c_at_C. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_d_at_D implementation. +# @Params: +function_out_d_at_D: + # Allocate stack frame for function function_out_d_at_D. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_out_d_at_D_internal_2 --> -12($fp) + # local_out_d_at_D_internal_2 = SELF + sw $s1, -12($fp) + # local_out_d_at_D_internal_0 = TYPEOF local_out_d_at_D_internal_2 + lw $t1, -12($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -4($fp) + # LOCAL local_out_d_at_D_internal_3 --> -16($fp) + # + la $t1, data_5 + sw $t1, -16($fp) + # ARG local_out_d_at_D_internal_3 + # LOCAL local_out_d_at_D_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_out_d_at_D_internal_0 --> -4($fp) + # LOCAL local_out_d_at_D_internal_1 --> -8($fp) + # local_out_d_at_D_internal_1 = VCALL local_out_d_at_D_internal_0 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, -4($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_out_d_at_D_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_d_at_D. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 72 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 72 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = ALLOCATE A + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + la $t1, A + sw $t1, 0($v0) + la $t1, A_start + sw $t1, 4($v0) + move $t2, $v0 + jal __A__attrib__io__init + sw $v0, 8($t2) + sw $t2, -12($fp) + # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 + lw $t1, -12($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -4($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_a + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, -4($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Restore self pointer after function call + move $s1, $a1 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = ALLOCATE B + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + la $t1, B + sw $t1, 0($v0) + la $t1, B_start + sw $t1, 4($v0) + move $t2, $v0 + jal __A__attrib__io__init + sw $v0, 8($t2) + sw $t2, -24($fp) + # local_main_at_Main_internal_3 = TYPEOF local_main_at_Main_internal_5 + lw $t1, -24($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -16($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 out_b + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t1, -16($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 4($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -20($fp) + # Restore self pointer after function call + move $s1, $a1 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = ALLOCATE C + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, C + sw $t1, 0($v0) + la $t1, C_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -36($fp) + # local_main_at_Main_internal_6 = TYPEOF local_main_at_Main_internal_8 + lw $t1, -36($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -28($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_c + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, -28($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 28($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Restore self pointer after function call + move $s1, $a1 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = ALLOCATE D + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, D + sw $t1, 0($v0) + la $t1, D_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -48($fp) + # local_main_at_Main_internal_9 = TYPEOF local_main_at_Main_internal_11 + lw $t1, -48($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -40($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_d + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, -40($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 4($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Restore self pointer after function call + move $s1, $a1 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = SELF + sw $s1, -60($fp) + # local_main_at_Main_internal_12 = TYPEOF local_main_at_Main_internal_14 + lw $t1, -60($fp) + # Load pointer to type + lw $t2, 4($t1) + sw $t2, -52($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # + la $t1, data_6 + sw $t1, -64($fp) + # ARG local_main_at_Main_internal_15 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + lw $t1, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string + # Save current self pointer in $a1 + move $a1, $s1 + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t1, -52($fp) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -56($fp) + # Restore self pointer after function call + move $s1, $a1 + # RETURN local_main_at_Main_internal_13 + lw $v0, -56($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 72 + jr $ra + # Function END + From ee8ddd560fc42f4384230d0a9f9a004255f7422e Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Mon, 30 Nov 2020 21:56:18 -0500 Subject: [PATCH 128/162] Patch SyntaxError instead of SemanticError --- src/parserr/shiftreduce.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/parserr/shiftreduce.py b/src/parserr/shiftreduce.py index c51a6881..da6cf590 100755 --- a/src/parserr/shiftreduce.py +++ b/src/parserr/shiftreduce.py @@ -49,6 +49,10 @@ def __call__(self, tokens: List[Token]): action, tag = self.action[state, lookahead] except KeyError: col = tokens[cursor].token_column - len(tokens[cursor].lex) + if lookahead.Name == "self" or (lookahead.Name == "assign" and tokens[cursor - 1].token_type.Name == "self"): + raise SyntaxError(f'({tokens[cursor].token_line},{col}) - ' + + f' SemanticError: ERROR "%s"' % + tokens[cursor].lex) raise SyntaxError(f'({tokens[cursor].token_line},{col}) - ' + f' SyntacticError: ERROR "%s"' % tokens[cursor].lex) From b4571d64b6c6ab78e542843f819df93435d178f3 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Mon, 30 Nov 2020 22:03:09 -0500 Subject: [PATCH 129/162] Change makefile --- src/.builds | 1 + src/makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/.builds b/src/.builds index db72d852..a912fd30 100644 --- a/src/.builds +++ b/src/.builds @@ -203,3 +203,4 @@ 1 1 1 +1 diff --git a/src/makefile b/src/makefile index 394c6346..88c4d56d 100644 --- a/src/makefile +++ b/src/makefile @@ -32,7 +32,7 @@ main: @echo "[*] Installing python dependencies" @$(PIP) install $(PIPREQUIREMENTS) @echo "[*] Compiling Cool Lexical structures" - @touch build/$(COMPSTRUCTFILE) + @> build/$(COMPSTRUCTFILE) @$(PYTHON) install.py build/$(COMPSTRUCTFILE) @touch build/__init__.py @echo 1 >> .builds From a93a151e814c9dd8bb4a1bff163da4bec6d6edf0 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Mon, 30 Nov 2020 22:07:20 -0500 Subject: [PATCH 130/162] Change makefile again --- src/.builds | 1 + src/makefile | 5 +- tests/codegen/hello_world.cl.mips | 335 ------------ tests/codegen/hello_world.mips | 335 ------------ tests/codegen/io.cl.mips | 877 ------------------------------ tests/codegen/io.mips | 877 ------------------------------ 6 files changed, 4 insertions(+), 2426 deletions(-) delete mode 100644 tests/codegen/hello_world.cl.mips delete mode 100644 tests/codegen/hello_world.mips delete mode 100644 tests/codegen/io.cl.mips delete mode 100644 tests/codegen/io.mips diff --git a/src/.builds b/src/.builds index a912fd30..f634e147 100644 --- a/src/.builds +++ b/src/.builds @@ -204,3 +204,4 @@ 1 1 1 +1 diff --git a/src/makefile b/src/makefile index 88c4d56d..da16e539 100644 --- a/src/makefile +++ b/src/makefile @@ -32,13 +32,14 @@ main: @echo "[*] Installing python dependencies" @$(PIP) install $(PIPREQUIREMENTS) @echo "[*] Compiling Cool Lexical structures" - @> build/$(COMPSTRUCTFILE) + @mkdir build + @touch build/$(COMPSTRUCTFILE) @$(PYTHON) install.py build/$(COMPSTRUCTFILE) @touch build/__init__.py @echo 1 >> .builds clean: - rm -rf build/* + rm -rf build rm -rf ../tests/*/*.mips test: diff --git a/tests/codegen/hello_world.cl.mips b/tests/codegen/hello_world.cl.mips deleted file mode 100644 index 2dfaeac4..00000000 --- a/tests/codegen/hello_world.cl.mips +++ /dev/null @@ -1,335 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Nov 29 21:40:32 2020 -# School of Math and Computer Science, University of Havana -# - -.data -Main: - # - - - # **** VTABLE for type Main **** - Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main - # - - - # **** Type RECORD for type Main **** - Main_start: - Main_vtable_pointer: .word Main_vtable - Main_end: - # - - - data_0: .asciiz "" - # - - - __Object_Object_tdt_entry__: .word 0 - __Object_Int_tdt_entry__: .word 1 - __Object_String_tdt_entry__: .word 1 - __Object_Bool_tdt_entry__: .word 1 - __Object_IO_tdt_entry__: .word 1 - __Object_Main_tdt_entry__: .word 2 - __Int_Object_tdt_entry__: .word -1 - __Int_Int_tdt_entry__: .word 0 - __Int_String_tdt_entry__: .word -1 - __Int_Bool_tdt_entry__: .word -1 - __Int_IO_tdt_entry__: .word -1 - __Int_Main_tdt_entry__: .word -1 - __String_Object_tdt_entry__: .word -1 - __String_Int_tdt_entry__: .word -1 - __String_String_tdt_entry__: .word 0 - __String_Bool_tdt_entry__: .word -1 - __String_IO_tdt_entry__: .word -1 - __String_Main_tdt_entry__: .word -1 - __Bool_Object_tdt_entry__: .word -1 - __Bool_Int_tdt_entry__: .word -1 - __Bool_String_tdt_entry__: .word -1 - __Bool_Bool_tdt_entry__: .word 0 - __Bool_IO_tdt_entry__: .word -1 - __Bool_Main_tdt_entry__: .word -1 - __IO_Object_tdt_entry__: .word -1 - __IO_Int_tdt_entry__: .word -1 - __IO_String_tdt_entry__: .word -1 - __IO_Bool_tdt_entry__: .word -1 - __IO_IO_tdt_entry__: .word 0 - __IO_Main_tdt_entry__: .word 1 - __Main_Object_tdt_entry__: .word -1 - __Main_Int_tdt_entry__: .word -1 - __Main_String_tdt_entry__: .word -1 - __Main_Bool_tdt_entry__: .word -1 - __Main_IO_tdt_entry__: .word -1 - __Main_Main_tdt_entry__: .word 0 - # - - - data_2: .asciiz "Hello, World.\n" - # - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, Main - sw $t1, 0($v0) - la $t1, Main_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 - lw $t1, -12($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # - la $t1, data_2 - sw $t1, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, -4($fp) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_main_at_Main_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips deleted file mode 100644 index ccefcd74..00000000 --- a/tests/codegen/hello_world.mips +++ /dev/null @@ -1,335 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Nov 29 21:47:38 2020 -# School of Math and Computer Science, University of Havana -# - -.data -Main: - # - - - # **** VTABLE for type Main **** - Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main - # - - - # **** Type RECORD for type Main **** - Main_start: - Main_vtable_pointer: .word Main_vtable - Main_end: - # - - - data_0: .asciiz "" - # - - - __Object_Object_tdt_entry__: .word 0 - __Object_Int_tdt_entry__: .word 1 - __Object_String_tdt_entry__: .word 1 - __Object_Bool_tdt_entry__: .word 1 - __Object_IO_tdt_entry__: .word 1 - __Object_Main_tdt_entry__: .word 2 - __Int_Object_tdt_entry__: .word -1 - __Int_Int_tdt_entry__: .word 0 - __Int_String_tdt_entry__: .word -1 - __Int_Bool_tdt_entry__: .word -1 - __Int_IO_tdt_entry__: .word -1 - __Int_Main_tdt_entry__: .word -1 - __String_Object_tdt_entry__: .word -1 - __String_Int_tdt_entry__: .word -1 - __String_String_tdt_entry__: .word 0 - __String_Bool_tdt_entry__: .word -1 - __String_IO_tdt_entry__: .word -1 - __String_Main_tdt_entry__: .word -1 - __Bool_Object_tdt_entry__: .word -1 - __Bool_Int_tdt_entry__: .word -1 - __Bool_String_tdt_entry__: .word -1 - __Bool_Bool_tdt_entry__: .word 0 - __Bool_IO_tdt_entry__: .word -1 - __Bool_Main_tdt_entry__: .word -1 - __IO_Object_tdt_entry__: .word -1 - __IO_Int_tdt_entry__: .word -1 - __IO_String_tdt_entry__: .word -1 - __IO_Bool_tdt_entry__: .word -1 - __IO_IO_tdt_entry__: .word 0 - __IO_Main_tdt_entry__: .word 1 - __Main_Object_tdt_entry__: .word -1 - __Main_Int_tdt_entry__: .word -1 - __Main_String_tdt_entry__: .word -1 - __Main_Bool_tdt_entry__: .word -1 - __Main_IO_tdt_entry__: .word -1 - __Main_Main_tdt_entry__: .word 0 - # - - - data_2: .asciiz "Hello, World.\n" - # - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, Main - sw $t1, 0($v0) - la $t1, Main_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 - lw $t1, -12($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # - la $t1, data_2 - sw $t1, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, -4($fp) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_main_at_Main_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - diff --git a/tests/codegen/io.cl.mips b/tests/codegen/io.cl.mips deleted file mode 100644 index a3eff4b8..00000000 --- a/tests/codegen/io.cl.mips +++ /dev/null @@ -1,877 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Nov 29 21:40:33 2020 -# School of Math and Computer Science, University of Havana -# - -.data -A: - B: - C: - D: - Main: - # - - - # **** VTABLE for type A **** - A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A - # - - - # **** Type RECORD for type A **** - A_start: - A_vtable_pointer: .word A_vtable - A_attrib_io: .word 0 - A_end: - # - - - # **** VTABLE for type B **** - B_vtable: .word function_out_a_at_A, function_out_b_at_B - # - - - # **** Type RECORD for type B **** - B_start: - B_vtable_pointer: .word B_vtable - B_attrib_io: .word 0 - B_attrib_io: .word 0 - B_end: - # - - - # **** VTABLE for type C **** - C_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_c_at_C - # - - - # **** Type RECORD for type C **** - C_start: - C_vtable_pointer: .word C_vtable - C_end: - # - - - # **** VTABLE for type D **** - D_vtable: .word function_out_c_at_C, function_out_d_at_D - # - - - # **** Type RECORD for type D **** - D_start: - D_vtable_pointer: .word D_vtable - D_end: - # - - - # **** VTABLE for type Main **** - Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main - # - - - # **** Type RECORD for type Main **** - Main_start: - Main_vtable_pointer: .word Main_vtable - Main_end: - # - - - data_0: .asciiz "" - # - - - __Object_Object_tdt_entry__: .word 0 - __Object_Int_tdt_entry__: .word 1 - __Object_String_tdt_entry__: .word 1 - __Object_Bool_tdt_entry__: .word 1 - __Object_IO_tdt_entry__: .word 1 - __Object_A_tdt_entry__: .word 1 - __Object_B_tdt_entry__: .word 2 - __Object_C_tdt_entry__: .word 2 - __Object_D_tdt_entry__: .word 3 - __Object_Main_tdt_entry__: .word 2 - __Int_Object_tdt_entry__: .word -1 - __Int_Int_tdt_entry__: .word 0 - __Int_String_tdt_entry__: .word -1 - __Int_Bool_tdt_entry__: .word -1 - __Int_IO_tdt_entry__: .word -1 - __Int_A_tdt_entry__: .word -1 - __Int_B_tdt_entry__: .word -1 - __Int_C_tdt_entry__: .word -1 - __Int_D_tdt_entry__: .word -1 - __Int_Main_tdt_entry__: .word -1 - __String_Object_tdt_entry__: .word -1 - __String_Int_tdt_entry__: .word -1 - __String_String_tdt_entry__: .word 0 - __String_Bool_tdt_entry__: .word -1 - __String_IO_tdt_entry__: .word -1 - __String_A_tdt_entry__: .word -1 - __String_B_tdt_entry__: .word -1 - __String_C_tdt_entry__: .word -1 - __String_D_tdt_entry__: .word -1 - __String_Main_tdt_entry__: .word -1 - __Bool_Object_tdt_entry__: .word -1 - __Bool_Int_tdt_entry__: .word -1 - __Bool_String_tdt_entry__: .word -1 - __Bool_Bool_tdt_entry__: .word 0 - __Bool_IO_tdt_entry__: .word -1 - __Bool_A_tdt_entry__: .word -1 - __Bool_B_tdt_entry__: .word -1 - __Bool_C_tdt_entry__: .word -1 - __Bool_D_tdt_entry__: .word -1 - __Bool_Main_tdt_entry__: .word -1 - __IO_Object_tdt_entry__: .word -1 - __IO_Int_tdt_entry__: .word -1 - __IO_String_tdt_entry__: .word -1 - __IO_Bool_tdt_entry__: .word -1 - __IO_IO_tdt_entry__: .word 0 - __IO_A_tdt_entry__: .word -1 - __IO_B_tdt_entry__: .word -1 - __IO_C_tdt_entry__: .word 1 - __IO_D_tdt_entry__: .word 2 - __IO_Main_tdt_entry__: .word 1 - __A_Object_tdt_entry__: .word -1 - __A_Int_tdt_entry__: .word -1 - __A_String_tdt_entry__: .word -1 - __A_Bool_tdt_entry__: .word -1 - __A_IO_tdt_entry__: .word -1 - __A_A_tdt_entry__: .word 0 - __A_B_tdt_entry__: .word 1 - __A_C_tdt_entry__: .word -1 - __A_D_tdt_entry__: .word -1 - __A_Main_tdt_entry__: .word -1 - __B_Object_tdt_entry__: .word -1 - __B_Int_tdt_entry__: .word -1 - __B_String_tdt_entry__: .word -1 - __B_Bool_tdt_entry__: .word -1 - __B_IO_tdt_entry__: .word -1 - __B_A_tdt_entry__: .word -1 - __B_B_tdt_entry__: .word 0 - __B_C_tdt_entry__: .word -1 - __B_D_tdt_entry__: .word -1 - __B_Main_tdt_entry__: .word -1 - __C_Object_tdt_entry__: .word -1 - __C_Int_tdt_entry__: .word -1 - __C_String_tdt_entry__: .word -1 - __C_Bool_tdt_entry__: .word -1 - __C_IO_tdt_entry__: .word -1 - __C_A_tdt_entry__: .word -1 - __C_B_tdt_entry__: .word -1 - __C_C_tdt_entry__: .word 0 - __C_D_tdt_entry__: .word 1 - __C_Main_tdt_entry__: .word -1 - __D_Object_tdt_entry__: .word -1 - __D_Int_tdt_entry__: .word -1 - __D_String_tdt_entry__: .word -1 - __D_Bool_tdt_entry__: .word -1 - __D_IO_tdt_entry__: .word -1 - __D_A_tdt_entry__: .word -1 - __D_B_tdt_entry__: .word -1 - __D_C_tdt_entry__: .word -1 - __D_D_tdt_entry__: .word 0 - __D_Main_tdt_entry__: .word -1 - __Main_Object_tdt_entry__: .word -1 - __Main_Int_tdt_entry__: .word -1 - __Main_String_tdt_entry__: .word -1 - __Main_Bool_tdt_entry__: .word -1 - __Main_IO_tdt_entry__: .word -1 - __Main_A_tdt_entry__: .word -1 - __Main_B_tdt_entry__: .word -1 - __Main_C_tdt_entry__: .word -1 - __Main_D_tdt_entry__: .word -1 - __Main_Main_tdt_entry__: .word 0 - # - - - data_2: .asciiz "A: Hello world\n" - # - - - data_3: .asciiz "B: Hello world\n" - # - - - data_4: .asciiz "C: Hello world\n" - # - - - data_5: .asciiz "D: Hello world\n" - # - - - data_6: .asciiz "Done.\n" - # - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, Main - sw $t1, 0($v0) - la $t1, Main_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __A__attrib__io__init implementation. -# @Params: -__A__attrib__io__init: - # Allocate stack frame for function __A__attrib__io__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ib__io__init_internal_0 --> -4($fp) - # local_ib__io__init_internal_0 = ALLOCATE IO - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, IO - sw $t1, 0($v0) - la $t1, IO_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -4($fp) - # RETURN local_ib__io__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __A__attrib__io__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_a_at_A implementation. -# @Params: -function_out_a_at_A: - # Allocate stack frame for function function_out_a_at_A. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_out_a_at_A_internal_2 = GETATTRIBUTE io A - # LOCAL local_out_a_at_A_internal_2 --> -12($fp) - lw $t1, 8($s1) - sw $t1, -12($fp) - # local_out_a_at_A_internal_0 = TYPEOF local_out_a_at_A_internal_2 - lw $t1, -12($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -4($fp) - # LOCAL local_out_a_at_A_internal_3 --> -16($fp) - # - la $t1, data_2 - sw $t1, -16($fp) - # ARG local_out_a_at_A_internal_3 - # LOCAL local_out_a_at_A_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_out_a_at_A_internal_0 --> -4($fp) - # LOCAL local_out_a_at_A_internal_1 --> -8($fp) - # local_out_a_at_A_internal_1 = VCALL local_out_a_at_A_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, -4($fp) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_out_a_at_A_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_a_at_A. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_b_at_B implementation. -# @Params: -function_out_b_at_B: - # Allocate stack frame for function function_out_b_at_B. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_out_b_at_B_internal_2 = GETATTRIBUTE io B - # LOCAL local_out_b_at_B_internal_2 --> -12($fp) - lw $t1, 8($s1) - sw $t1, -12($fp) - # local_out_b_at_B_internal_0 = TYPEOF local_out_b_at_B_internal_2 - lw $t1, -12($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -4($fp) - # LOCAL local_out_b_at_B_internal_3 --> -16($fp) - # - la $t1, data_3 - sw $t1, -16($fp) - # ARG local_out_b_at_B_internal_3 - # LOCAL local_out_b_at_B_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_out_b_at_B_internal_0 --> -4($fp) - # LOCAL local_out_b_at_B_internal_1 --> -8($fp) - # local_out_b_at_B_internal_1 = VCALL local_out_b_at_B_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, -4($fp) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_out_b_at_B_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_b_at_B. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_c_at_C implementation. -# @Params: -function_out_c_at_C: - # Allocate stack frame for function function_out_c_at_C. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_out_c_at_C_internal_2 --> -12($fp) - # local_out_c_at_C_internal_2 = SELF - sw $s1, -12($fp) - # local_out_c_at_C_internal_0 = TYPEOF local_out_c_at_C_internal_2 - lw $t1, -12($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -4($fp) - # LOCAL local_out_c_at_C_internal_3 --> -16($fp) - # - la $t1, data_4 - sw $t1, -16($fp) - # ARG local_out_c_at_C_internal_3 - # LOCAL local_out_c_at_C_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_out_c_at_C_internal_0 --> -4($fp) - # LOCAL local_out_c_at_C_internal_1 --> -8($fp) - # local_out_c_at_C_internal_1 = VCALL local_out_c_at_C_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, -4($fp) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_out_c_at_C_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_c_at_C. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_d_at_D implementation. -# @Params: -function_out_d_at_D: - # Allocate stack frame for function function_out_d_at_D. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_out_d_at_D_internal_2 --> -12($fp) - # local_out_d_at_D_internal_2 = SELF - sw $s1, -12($fp) - # local_out_d_at_D_internal_0 = TYPEOF local_out_d_at_D_internal_2 - lw $t1, -12($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -4($fp) - # LOCAL local_out_d_at_D_internal_3 --> -16($fp) - # - la $t1, data_5 - sw $t1, -16($fp) - # ARG local_out_d_at_D_internal_3 - # LOCAL local_out_d_at_D_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_out_d_at_D_internal_0 --> -4($fp) - # LOCAL local_out_d_at_D_internal_1 --> -8($fp) - # local_out_d_at_D_internal_1 = VCALL local_out_d_at_D_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, -4($fp) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_out_d_at_D_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_d_at_D. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 72 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 72 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = ALLOCATE A - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - la $t1, A - sw $t1, 0($v0) - la $t1, A_start - sw $t1, 4($v0) - move $t2, $v0 - jal __A__attrib__io__init - sw $v0, 8($t2) - sw $t2, -12($fp) - # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 - lw $t1, -12($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -4($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_a - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, -4($fp) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = ALLOCATE B - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - la $t1, B - sw $t1, 0($v0) - la $t1, B_start - sw $t1, 4($v0) - move $t2, $v0 - jal __A__attrib__io__init - sw $v0, 8($t2) - sw $t2, -24($fp) - # local_main_at_Main_internal_3 = TYPEOF local_main_at_Main_internal_5 - lw $t1, -24($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -16($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 out_b - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t1, -16($fp) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 4($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -20($fp) - # Restore self pointer after function call - move $s1, $a1 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = ALLOCATE C - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, C - sw $t1, 0($v0) - la $t1, C_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -36($fp) - # local_main_at_Main_internal_6 = TYPEOF local_main_at_Main_internal_8 - lw $t1, -36($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -28($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_c - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t1, -28($fp) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 28($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) - # Restore self pointer after function call - move $s1, $a1 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = ALLOCATE D - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, D - sw $t1, 0($v0) - la $t1, D_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -48($fp) - # local_main_at_Main_internal_9 = TYPEOF local_main_at_Main_internal_11 - lw $t1, -48($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -40($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_d - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t1, -40($fp) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 4($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) - # Restore self pointer after function call - move $s1, $a1 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = SELF - sw $s1, -60($fp) - # local_main_at_Main_internal_12 = TYPEOF local_main_at_Main_internal_14 - lw $t1, -60($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -52($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # - la $t1, data_6 - sw $t1, -64($fp) - # ARG local_main_at_Main_internal_15 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - lw $t1, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t1, -52($fp) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -56($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_main_at_Main_internal_13 - lw $v0, -56($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 72 - jr $ra - # Function END - diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips deleted file mode 100644 index 090844b6..00000000 --- a/tests/codegen/io.mips +++ /dev/null @@ -1,877 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Nov 29 21:47:39 2020 -# School of Math and Computer Science, University of Havana -# - -.data -A: - B: - C: - D: - Main: - # - - - # **** VTABLE for type A **** - A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A - # - - - # **** Type RECORD for type A **** - A_start: - A_vtable_pointer: .word A_vtable - A_attrib_io: .word 0 - A_end: - # - - - # **** VTABLE for type B **** - B_vtable: .word function_out_a_at_A, function_out_b_at_B - # - - - # **** Type RECORD for type B **** - B_start: - B_vtable_pointer: .word B_vtable - B_attrib_io: .word 0 - B_attrib_io: .word 0 - B_end: - # - - - # **** VTABLE for type C **** - C_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_c_at_C - # - - - # **** Type RECORD for type C **** - C_start: - C_vtable_pointer: .word C_vtable - C_end: - # - - - # **** VTABLE for type D **** - D_vtable: .word function_out_c_at_C, function_out_d_at_D - # - - - # **** Type RECORD for type D **** - D_start: - D_vtable_pointer: .word D_vtable - D_end: - # - - - # **** VTABLE for type Main **** - Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main - # - - - # **** Type RECORD for type Main **** - Main_start: - Main_vtable_pointer: .word Main_vtable - Main_end: - # - - - data_0: .asciiz "" - # - - - __Object_Object_tdt_entry__: .word 0 - __Object_Int_tdt_entry__: .word 1 - __Object_String_tdt_entry__: .word 1 - __Object_Bool_tdt_entry__: .word 1 - __Object_IO_tdt_entry__: .word 1 - __Object_A_tdt_entry__: .word 1 - __Object_B_tdt_entry__: .word 2 - __Object_C_tdt_entry__: .word 2 - __Object_D_tdt_entry__: .word 3 - __Object_Main_tdt_entry__: .word 2 - __Int_Object_tdt_entry__: .word -1 - __Int_Int_tdt_entry__: .word 0 - __Int_String_tdt_entry__: .word -1 - __Int_Bool_tdt_entry__: .word -1 - __Int_IO_tdt_entry__: .word -1 - __Int_A_tdt_entry__: .word -1 - __Int_B_tdt_entry__: .word -1 - __Int_C_tdt_entry__: .word -1 - __Int_D_tdt_entry__: .word -1 - __Int_Main_tdt_entry__: .word -1 - __String_Object_tdt_entry__: .word -1 - __String_Int_tdt_entry__: .word -1 - __String_String_tdt_entry__: .word 0 - __String_Bool_tdt_entry__: .word -1 - __String_IO_tdt_entry__: .word -1 - __String_A_tdt_entry__: .word -1 - __String_B_tdt_entry__: .word -1 - __String_C_tdt_entry__: .word -1 - __String_D_tdt_entry__: .word -1 - __String_Main_tdt_entry__: .word -1 - __Bool_Object_tdt_entry__: .word -1 - __Bool_Int_tdt_entry__: .word -1 - __Bool_String_tdt_entry__: .word -1 - __Bool_Bool_tdt_entry__: .word 0 - __Bool_IO_tdt_entry__: .word -1 - __Bool_A_tdt_entry__: .word -1 - __Bool_B_tdt_entry__: .word -1 - __Bool_C_tdt_entry__: .word -1 - __Bool_D_tdt_entry__: .word -1 - __Bool_Main_tdt_entry__: .word -1 - __IO_Object_tdt_entry__: .word -1 - __IO_Int_tdt_entry__: .word -1 - __IO_String_tdt_entry__: .word -1 - __IO_Bool_tdt_entry__: .word -1 - __IO_IO_tdt_entry__: .word 0 - __IO_A_tdt_entry__: .word -1 - __IO_B_tdt_entry__: .word -1 - __IO_C_tdt_entry__: .word 1 - __IO_D_tdt_entry__: .word 2 - __IO_Main_tdt_entry__: .word 1 - __A_Object_tdt_entry__: .word -1 - __A_Int_tdt_entry__: .word -1 - __A_String_tdt_entry__: .word -1 - __A_Bool_tdt_entry__: .word -1 - __A_IO_tdt_entry__: .word -1 - __A_A_tdt_entry__: .word 0 - __A_B_tdt_entry__: .word 1 - __A_C_tdt_entry__: .word -1 - __A_D_tdt_entry__: .word -1 - __A_Main_tdt_entry__: .word -1 - __B_Object_tdt_entry__: .word -1 - __B_Int_tdt_entry__: .word -1 - __B_String_tdt_entry__: .word -1 - __B_Bool_tdt_entry__: .word -1 - __B_IO_tdt_entry__: .word -1 - __B_A_tdt_entry__: .word -1 - __B_B_tdt_entry__: .word 0 - __B_C_tdt_entry__: .word -1 - __B_D_tdt_entry__: .word -1 - __B_Main_tdt_entry__: .word -1 - __C_Object_tdt_entry__: .word -1 - __C_Int_tdt_entry__: .word -1 - __C_String_tdt_entry__: .word -1 - __C_Bool_tdt_entry__: .word -1 - __C_IO_tdt_entry__: .word -1 - __C_A_tdt_entry__: .word -1 - __C_B_tdt_entry__: .word -1 - __C_C_tdt_entry__: .word 0 - __C_D_tdt_entry__: .word 1 - __C_Main_tdt_entry__: .word -1 - __D_Object_tdt_entry__: .word -1 - __D_Int_tdt_entry__: .word -1 - __D_String_tdt_entry__: .word -1 - __D_Bool_tdt_entry__: .word -1 - __D_IO_tdt_entry__: .word -1 - __D_A_tdt_entry__: .word -1 - __D_B_tdt_entry__: .word -1 - __D_C_tdt_entry__: .word -1 - __D_D_tdt_entry__: .word 0 - __D_Main_tdt_entry__: .word -1 - __Main_Object_tdt_entry__: .word -1 - __Main_Int_tdt_entry__: .word -1 - __Main_String_tdt_entry__: .word -1 - __Main_Bool_tdt_entry__: .word -1 - __Main_IO_tdt_entry__: .word -1 - __Main_A_tdt_entry__: .word -1 - __Main_B_tdt_entry__: .word -1 - __Main_C_tdt_entry__: .word -1 - __Main_D_tdt_entry__: .word -1 - __Main_Main_tdt_entry__: .word 0 - # - - - data_2: .asciiz "A: Hello world\n" - # - - - data_3: .asciiz "B: Hello world\n" - # - - - data_4: .asciiz "C: Hello world\n" - # - - - data_5: .asciiz "D: Hello world\n" - # - - - data_6: .asciiz "Done.\n" - # - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, Main - sw $t1, 0($v0) - la $t1, Main_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __A__attrib__io__init implementation. -# @Params: -__A__attrib__io__init: - # Allocate stack frame for function __A__attrib__io__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ib__io__init_internal_0 --> -4($fp) - # local_ib__io__init_internal_0 = ALLOCATE IO - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, IO - sw $t1, 0($v0) - la $t1, IO_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -4($fp) - # RETURN local_ib__io__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __A__attrib__io__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_a_at_A implementation. -# @Params: -function_out_a_at_A: - # Allocate stack frame for function function_out_a_at_A. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_out_a_at_A_internal_2 = GETATTRIBUTE io A - # LOCAL local_out_a_at_A_internal_2 --> -12($fp) - lw $t1, 8($s1) - sw $t1, -12($fp) - # local_out_a_at_A_internal_0 = TYPEOF local_out_a_at_A_internal_2 - lw $t1, -12($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -4($fp) - # LOCAL local_out_a_at_A_internal_3 --> -16($fp) - # - la $t1, data_2 - sw $t1, -16($fp) - # ARG local_out_a_at_A_internal_3 - # LOCAL local_out_a_at_A_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_out_a_at_A_internal_0 --> -4($fp) - # LOCAL local_out_a_at_A_internal_1 --> -8($fp) - # local_out_a_at_A_internal_1 = VCALL local_out_a_at_A_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, -4($fp) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_out_a_at_A_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_a_at_A. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_b_at_B implementation. -# @Params: -function_out_b_at_B: - # Allocate stack frame for function function_out_b_at_B. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_out_b_at_B_internal_2 = GETATTRIBUTE io B - # LOCAL local_out_b_at_B_internal_2 --> -12($fp) - lw $t1, 8($s1) - sw $t1, -12($fp) - # local_out_b_at_B_internal_0 = TYPEOF local_out_b_at_B_internal_2 - lw $t1, -12($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -4($fp) - # LOCAL local_out_b_at_B_internal_3 --> -16($fp) - # - la $t1, data_3 - sw $t1, -16($fp) - # ARG local_out_b_at_B_internal_3 - # LOCAL local_out_b_at_B_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_out_b_at_B_internal_0 --> -4($fp) - # LOCAL local_out_b_at_B_internal_1 --> -8($fp) - # local_out_b_at_B_internal_1 = VCALL local_out_b_at_B_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, -4($fp) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_out_b_at_B_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_b_at_B. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_c_at_C implementation. -# @Params: -function_out_c_at_C: - # Allocate stack frame for function function_out_c_at_C. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_out_c_at_C_internal_2 --> -12($fp) - # local_out_c_at_C_internal_2 = SELF - sw $s1, -12($fp) - # local_out_c_at_C_internal_0 = TYPEOF local_out_c_at_C_internal_2 - lw $t1, -12($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -4($fp) - # LOCAL local_out_c_at_C_internal_3 --> -16($fp) - # - la $t1, data_4 - sw $t1, -16($fp) - # ARG local_out_c_at_C_internal_3 - # LOCAL local_out_c_at_C_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_out_c_at_C_internal_0 --> -4($fp) - # LOCAL local_out_c_at_C_internal_1 --> -8($fp) - # local_out_c_at_C_internal_1 = VCALL local_out_c_at_C_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, -4($fp) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_out_c_at_C_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_c_at_C. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_d_at_D implementation. -# @Params: -function_out_d_at_D: - # Allocate stack frame for function function_out_d_at_D. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_out_d_at_D_internal_2 --> -12($fp) - # local_out_d_at_D_internal_2 = SELF - sw $s1, -12($fp) - # local_out_d_at_D_internal_0 = TYPEOF local_out_d_at_D_internal_2 - lw $t1, -12($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -4($fp) - # LOCAL local_out_d_at_D_internal_3 --> -16($fp) - # - la $t1, data_5 - sw $t1, -16($fp) - # ARG local_out_d_at_D_internal_3 - # LOCAL local_out_d_at_D_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_out_d_at_D_internal_0 --> -4($fp) - # LOCAL local_out_d_at_D_internal_1 --> -8($fp) - # local_out_d_at_D_internal_1 = VCALL local_out_d_at_D_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, -4($fp) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_out_d_at_D_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_d_at_D. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 72 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 72 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = ALLOCATE A - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - la $t1, A - sw $t1, 0($v0) - la $t1, A_start - sw $t1, 4($v0) - move $t2, $v0 - jal __A__attrib__io__init - sw $v0, 8($t2) - sw $t2, -12($fp) - # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 - lw $t1, -12($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -4($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_a - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, -4($fp) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = ALLOCATE B - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - la $t1, B - sw $t1, 0($v0) - la $t1, B_start - sw $t1, 4($v0) - move $t2, $v0 - jal __A__attrib__io__init - sw $v0, 8($t2) - sw $t2, -24($fp) - # local_main_at_Main_internal_3 = TYPEOF local_main_at_Main_internal_5 - lw $t1, -24($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -16($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 out_b - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t1, -16($fp) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 4($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -20($fp) - # Restore self pointer after function call - move $s1, $a1 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = ALLOCATE C - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, C - sw $t1, 0($v0) - la $t1, C_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -36($fp) - # local_main_at_Main_internal_6 = TYPEOF local_main_at_Main_internal_8 - lw $t1, -36($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -28($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_c - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t1, -28($fp) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 28($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) - # Restore self pointer after function call - move $s1, $a1 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = ALLOCATE D - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, D - sw $t1, 0($v0) - la $t1, D_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -48($fp) - # local_main_at_Main_internal_9 = TYPEOF local_main_at_Main_internal_11 - lw $t1, -48($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -40($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_d - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t1, -40($fp) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 4($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) - # Restore self pointer after function call - move $s1, $a1 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = SELF - sw $s1, -60($fp) - # local_main_at_Main_internal_12 = TYPEOF local_main_at_Main_internal_14 - lw $t1, -60($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -52($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # - la $t1, data_6 - sw $t1, -64($fp) - # ARG local_main_at_Main_internal_15 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - lw $t1, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string - # Save current self pointer in $a1 - move $a1, $s1 - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t1, -52($fp) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -56($fp) - # Restore self pointer after function call - move $s1, $a1 - # RETURN local_main_at_Main_internal_13 - lw $v0, -56($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 72 - jr $ra - # Function END - From 9d07546df1c11904d91b7b376733691b998dc4d9 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Mon, 30 Nov 2020 23:44:56 -0500 Subject: [PATCH 131/162] add report --- doc/informe.pdf | Bin 0 -> 108251 bytes doc/informe.tex | 204 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 204 insertions(+) create mode 100644 doc/informe.pdf create mode 100644 doc/informe.tex diff --git a/doc/informe.pdf b/doc/informe.pdf new file mode 100644 index 0000000000000000000000000000000000000000..eaea269ed65641f4f5ed81f21a9ff9172c21d7b1 GIT binary patch literal 108251 zcma&MV{j%=v$h-CHlNtGHL;zEIkBB5ww+9D+nCt4ZQDBUIp5j8_OAN&`qisy)vD^Q zuDY-4zA2Q%B^g*4Ip8Q}7l&5i*hrX3?2Z4x@$u{C@|INz%&3 z#mtF>Nz%s1#Z27H#NN~lPEZie*~Q7s$QI6HJqBkYaii_-x^|Wnx@n(%+s^uQW=Pi>B2r z-|aIQ4cBfuHVV~ZclWDnt~;(Cp&}i2XZtV#AGs1ozg6M}0A}^o>4C|u$8(pWtkK^w z^hec#`#u+V#%ivALT+xP$0G}8H|{^1u3P-FHu90{IYKhXq8-(|2sTCw}H|x6y;|TOWdtulMYuM{wGVGN)>G>jOJ*#Qp zgj>@~`p9%YAqQjcq4Hq6iOmo*5*L9D6i`%1bud%|1dIS&Ve2=~{eKInN8 zyOdN3u*(L~iX!8W8KXyW8hJI}UrFqw8$rS(niY{*HU`!iX_np$9D~YTh^*8pSo>*4 zxil;iMtzaa1K;#6l>8s83w*_WQlj&A8T-tef9=5xlJP3sI(=Q5&gdSxZdY<+3uHRb8h>+WtI>7@ISdi*+Ighu7T zUnVUH7r>Vg+M!*814ir-hv`75ej}%t2w0uS2-v1nk5&5-Lu3{;5~-A`dxFoL3H}pP z!hG)4yP5PQZBuwiP~V*8a+2p;qk^(mmTPsDs8PX63_k$1+V80Cc#!Epad3l6RCd*Z z%mhQ_CcH&`kQmsK44c=S$MDSRnt&Yva1HZLQC_GY6lTv4Ra`I=eVx1)<%{Le zzPLQO9EyHKc`j8~0v+xd5msV?jaTtTg?Mv*ND(K<4R0(<-nq=pIePX>?(E;t<1DWk zSj_ppkK&_~NjHjmj1I~Y;-?~f8$n8vc2=%Y6!bF?>G@$B{+rAIEH^FtU-mn5ZaI1< z`XDn+(czLq&CW_-cg|KMAlCe08?CGSyQiMM<<0efxyhgcxKa4^|MnpT+z{4drc`P` z%nrZg9N|r-`jxGW^N&J<`SGXIw0(F+Ht+Z&H>gOEIaDba|Mo<&@7QZZ_O$_K3Aee) zwYrf)Jk{ubFL@Zp}bw zksbkqdo^$g7BDI-I4kV}H~u(s`5FxSw~U>@Rc>(a(s{KCPpAwsV}Dhd7Ry5qA1{2J z8st)F27KC-1&48VP4c{gJP#iejw@3u3MJruK-7NEdFdC*;p#ztYxThdSI?%M)!<%< zQHNz72E9J9MWCoK!hySI(46!M@up+4t_f7#*!cr<^1aU;@ugkgla`v}Y@vKG-Q#8@?je@?^dF=QK{w9Lq#A9BfLtT>?ovR(752iaFb=lLZVfpE zdRcjUZ91&nQ;=t*I)bd+2tvB*R93}}3Vk3<@qs|8%MeYBF&JNJW~w< zEUy$|2`hH$oXDTmD4o2yitv|I8#u_b@e;Ug0)CQjSTH$ErTLu8IDUr!`4nt!pO}(8 z79#L@L|Hc`boPU;~9B4622z72$WN(viRSZnQd4573J1;lkCyUE`D}#jFNMzVR$F;7y*gK z`4a8^izEOdW+>E1yTK>&Z3$-<{!lzJXXPL#v@B#H1_K+f)!|4C!vd`a58F;~UDKn@ zpB*pU$y)h3^D9LVw=Vr=7XQte8tc18URPRm{XvLl-$3QB%0W+(+be=XFeDn#gdhW` z#Q;(k;@$0T@F~Irrs(A$I1sxlF8mgoH#tr{gWj~mF`>V%s8H%2;aC^v>5i^G*m*qi z@#D_S_A{+B$R~hpritWh-`!SinTmmQ#_ex}>ZZ7zNYvMJLU`gs5a9s$P567eZiSfbkeUVRsD&SjsE! z2IDdWhBu%peKS*rsN0tGQAXXM+jeFOQ3@(2O#pdT6BCDf4g&s-2A#xl)LDCJ=)M+) zpxX=hat;JHMXrN0vornw75hKY|Eu;aoc~?+S$Q}(|F^PVtu5=k*@pV>rgk6P-7Q5`q1w9o5bZ=bVHO8Tdh$MBYg;JSFJJ&yb$UHzVz&=!*7EV-B1hA`XR~W= zO`RajER#~x9a&SGD0NLeC(Wp0zOwW9JhyKI5bO5S@o_PQU%Xs2J5~5dYh1Bm0Q7C$ zsN_e~_iHn`2MBGnBe-ID-($-aOmIjO4VOP-9Ms7c=KU+b9*O8s7ua%`nN{@gNtBOW4 z^ZoG6FXfeM*dGbe-*_%@U$vinCD>?(GvSV1WAqEY>go3V33&6{7`T{zGW|V+PCVJ< zipou`MkV<33GVXTmdfu`ELP0+PZXgb&dIe|6Yo0ycAl$K1$xO+@^}=+!j=NPXC{=d zuqnp3Ddtgr!uG18(6(|Ik*VbxJzzDFdD=4 zcU)4oIp1xaE479CzBkTl92eBvgAb}+qdw@6W9UuEUW`mzmklV~Y%d?&7dn^J{xa;C zTJ|;4fc|>L+2!HOz?R6sEpLLJxL)@g7#NO3_jvdc-Hga(SbOztI6r)BRVnip4n}nO z9+pF=bvi_fxF6gx6*dLLJRbIth=6B^k_Bz5DXrSvzQL47)t?Jabt>e>w#Q&6bE;NO z0e-E6S4*t6tQd1}3;c|CoS}|1=$L{!IYxa9S4pZowoYzZu*5K0<4f`G@>l%Gq;;$f z2)S}eO2M@eLO6daV)I235A1=1IAy$m4jygZdz(18066INUN(BuB2dz#U{Cg!&n<)? ze2=$?q?Y}-QP=h{*FYWeqKg*;jP`848=pz+@V0q-y`AtV)Qj}6zDI|@+?(sC9OD29 zflsb+i0vaf+Ij`H=bTqt=H~9wDbxOVSR;D|8D3PX8FAPHs{4#h1AJTZNA%Oc_(ZXx zfztDTDHJh6DX!a3m!FLGWEF~$szp&GaChI3?+feBoN59yODOd8wAwK`GnBd>DZ$NA zdZt~h#w2`!cnGH_ed{6vt{C|?1i;I!H9WRFGx(*3sbPspiv>bm=wxY)M3Y}C2&!KL zn_QhrvI7 zRlO&C5n%=Iwnt)@pb+ZW#%8YssSA)E=qVwNpJFiYUkU-I(6`Tj!$q)-{&D|msO5%5 z%G(DIb0grCJdSHZejy&+HOBNIvycxx3bwgh;=YfXx@p9e-;bcO8+FQS&XX!hqJk3g z#bUJFSYvmhl;{xf*7?_Gc9?9)?*TJ#3voapK={O@S2?--kkkgPx6+9u^%8Wc%6F?& zxLIib+0u;uO3rNJIoTaLOZ^KZA$di?Ns*gv0*Pz`QJ|}?&7EoItEJqFcG9F7&WJY_ zLM`==quG?+LNpdPOfDXqmZa?yBt&rB@dSJNwKxqE1A3uJpRi`j0t&VW?F5+J3;}v{ zZkv^b^DRhtyU+;Yfm$}W@_jvM<0E#5jpdP;QJKV`d*fn-(BpsjgF=X!B!csM@*yv(owreS<(FhcJ3eiuvykz z&IbNCbBUQYd`P!DMyM1*2RwE{0b_V0=Wl&3d;#<{f+BHtW)02W_1T)`N=y!Lq#j`T zAv~jj7Av4C|1w9!Zu)vSJc~<)1HnoFdRJED9BP7$MhiexUrb!qwgPv{A>;6 znsj+VN{hdK{93M>T5*zUJ&A$Q0=mU8FGlMO0|^Y5x(@WEU@C+I)l}OP3)$+(--Gx& zyfg@NW-1#G-V8UXPXA(UqNu|zxt#rOx{@PjlL=q&9HF7|Ri`A#0Ci$hZz#0!G78LyeU&|( zJEATF44p5V+W1(pw)X!FK_wbIw*OWL>Ppk@;YE93?oEmMTaCrn4j0G{5aWcT-Ur^@ z-)rO~2(l(%SUP}#Y>$b#o8xUdCkJz9aDqc{CUhRVAfItB#Y|W*HZ*A8HJVop{8Zw0 zUlC&=s9H#9reo$!DKg-qwdf2bvo$40_jT$7A{~0E7Cz&jy z+}(eoD}p0krRJ&H>ZD!mc@Uccr077Ct8O&Mzw!iB>kmXrMcrBVa@QSJi_%cTm!UO(XvCHU#ik#1j$uz% z3JEO|IQ=L95Vj0&fdbq)BuyZXpJ@n5F847?(KZfwPLQ@wwp%y2$k=BKNf*By1>h(v zzfD==yLEGXk4nZ|KYECjS5YK;8z`d%qbcJ9<>1yEmEb?Nbr-xNQ?Pj$l#Le?z6~%5 z)~OY`(SOl=K$?E8#cA`dJ|I~dzEt0X1jb(>`vpJ4atq0j2)=QQ{CTV-1+NTNId`uw zD7oLoSSMjGGaotp^45AUX zDhEyPyE|S2b>q!$hkE2L@wR<$n3G15pjMTwhIhaMG`+<0sIeaMk~P;0=@}z1B@faU zvw~qR<_S#?^o>sw?ZIUb1VhyyQhi@W;(G>7sZe}91&)%?z#9OP`bMj<)4Qn<3?fZR z6(1*8b#pQ_S~i`$#7PtXIl%NWfkVNkUmelsq^ z=pkA8sk}y>hTa%uV7*1it26)QK3hvZleA2bGLEO5vuWp>CU@rqqez#60=@Z)t>8?_ zA|IO2`%@BPi94el+R(nC0f=UVfAUvtN#q%A^F;xi5M!PS;ezk`Q=nl6$AnI+kYTW- z_O?7@Evm&(CENa*unv^Fh>^5fGc`3lv>ElPZGRb@s@TV`{%&c12Fe5<9Z4wKR3xqq z_C!KSJ?S2+NKF=_jRs}QlW4+ic$MQeI%Q1%$To9YBFMGt|45hL3Z>|Qp)g*}zIU0|xc@q1%R;OV0HAK0Gfe`0%1_Ww28<67Hqw%v6Chx)sb zb$XZ2zJ56h6OQn_#_Q>MEQlpQKxr0m$u!T0&Uf5>y-!E!STR7m+xCPX#uH2b!ukixE6SXxugJqT3>4?LmakL+_aFupql+5khteXQ}zL3+${hZx= z?lq(;vEg7*DVLA%l6%=`-FkJuaGpkN5VrSv*(s627d-8Qo$SBaRlkFpL zXEd(+8pVvX$qpYr${vk1^n5r#Wv|?S$OJ!w_+WEquha2cyarm&Bg)Is`~D>!n%FsT7K(4f zM>H7aEaX&3Z8WLwTq_@YO+OdwAd=2&lfuD2~w&4 z&}kgMRTX1}IOFCe+g7;gjB!vFxoidsB25mO6$DYh4c_3(CGAx5Y_jX^`~thR7**Zm zw;aP+QI;M9a8WWbW+JmP(j_n-|FiHfy%R*}ev`hHTKQf%ohNgV8P54cpL7D|fYaTr zLKT4q(y9GX89ivy$~s3mEaKv*{ie(4mYnNJ-(E*w8SZ}Kf-5Q8zSiFE_dmsa2d8XJ z4+XTs1Rv11fid3+6j2!4C714igBJoR53D&8CgT`UlzM1?UxOvgZ3a-~qOSU5 ztL~wT&6SG53Bldytc|}HtriG>aOX)c@WPcW1|zBD!sSP$H?Sh$Ri&bC!)aD2#<@~m z$9-bb`+ax3wvyG$O>N8~<#J%lZ0Rx1-ZWh6LPk`BO;{zC5A}NaBpjmtrSbLL?I!$f zy-|AqY1>ELpmM=m69q#!KxrC&WYv_>rL$w2T=8AHDA>UtiqciJt&m(wN`l%n4XUf) zs@TNtFed@Z?#>Dji#5xE86uShA$Fq^#cJucsB^h-EmS`L**@=?W~rWlB+c3b$8mf_%Wo_v~`)VNxnp6M9`sQ;}Vxpq<`-?yArRK@7wU*~i`#q!pG{&szJ7 zdNx&;-Ev>WGMjs(N6`Wj|9Cw{8Bzmu(fJXe1c97kWfa zEOw81XRIp)@;N4SQV|^Qo-Q0B&|rus2yX&pIZ;c5i*@(i+^U*?%BCbdpr^LQiC#iU zSgVqUD2G-Bq7UTTy(RvHZSwITrmMWM=AiXM3}p&^=xx8$fi+lmW? zJDGklzAKP0XAk8etYF)@#{bmXd)Lcg>5FI7EEF@IJ(CI9X~ITr!q(*}R)*S7&NdMq~(YSfcplc_vZ$ z2QKhxs=x%B3E9E>JTbg6>=5OF?ci*`L&*RG-5YQCF9g$+cyN_y7zfNtW&V-A-VIWZL4y@!?Z#I|t4ZH8?y|C?pX-9K*FeR9q^? z4V-S=Jic{so`~qH;!$IoDPxvr81#d<9AZ*7bt@y$)`Xz*8>g@WOtv5_w$Tdz$&F9U z-=^b^fVyMi*J(-Iq0lMVPY)!wsH8BFdQFbQto7RhhU<(J-02*d*PLWqqr*;RLAB+b zV^M{D$~%-)1!ZNj=|7@7xxDJ5+wfDRDPGsy^u-6SouwjN(qS%(aPmIr%W8J%L{bTn z57WukP&T>f5?sHB!5{(>5l~tE5`IZE)~mw%vm<0H!RSlD^P)lJ=(y^#|8UD@y~M;1 z&Rw_@0HA%co6?;$+|Ig)BJ4@Oruys8`@&H24I&1UV?th- zA}|}(KSisA^2!`Y)p+U$mWk4_6J@4)==?z) zZ*On6k~#%3Gp%nAAm@KFBAKJDT`Ofa!o;SS1C}ya)uG!Xgk1~_NypPE==0e_#4E1J z6EqIx$;_!4krzX@n{xP*CEIVH{5rxvCu15fs%_CqSa1NnPtp&l+eW7{>rC znd7y;rNJY9`^S4fqV5R8=_P$Y>6gVCW9kuBrtEo!6)FnQRkQtfWoGqE&NJ?= zbq<7*N_k^OF4nLtO=?Bg)x??sMimjLh$YI?54W;r@{4n7yW&r@l+`XvCoI8df%24B z2TvT^6N29u!FD(Z(-&dd#D@XHkO#ffRaqOOL>-PE7;6;x_A<0S4!vXU@uKk+9`tv0 zM!C^!YX9~zxKUsf#pYw28D@4(;E+T>Fg3oketl#-$ULwMneKtXr65#6HsN+2=TqZR zN9DAQX26gwZQc^4&PO?>AAcg`9uwS%i_Pn8>P{d1hr`#*oA%we?`W$~qkHj|OhQf6 z~)wuWc)2C_~I#yPJj>4W8wcq`^b|kqht0^PM!8DC)CNxN{Rgk1ns|EMF>%Z0M z+!e_ETf8+>j()FP%je&mSIoJSNcOIfUkNh^=BtRO(=EvNL4OUNpzxw4+AP}@w#?W; ziwJK0oBPW4QWC!FSa#P~4!_}HuefMBgA6GyJFn_8JJw{@K-E%ZwdBslmU45Pj5;bK zac<;~7czQr0|$UpJHj+)GOl4b^Gm zgQxm*ZF%h=u0%&D`LPX86MYG51|_f5rMLj(r2Q#CYFR#K9(S;Ay3}qs>vCh?lKRMW zBI((K9nQ~tU`)h-@1TY4Go^6bMIRwpR1GpDD=P8&=b6xkro`BPXM9%H|AFz@IJo}T zjIV8Aztw^SyeWlg!6s(Evsp{M>Mpj1Gd;D7y4nOCxMHSmNi3^7V*8;<-DCnvC*0T1 zWNo==6Om;UP)8Pw61(bO8TdR%9$GjOq-s-6Ket+#5m0*iq@I|iQ>?B16Z}xTwYyxp zCPUTE3mv!?Jq)NBj-?K2Z#)*mC{4keD$S+_Bbo(oMpV3d%3ld;;Y$~+fIAL1O-ogt z)iy5UP(1ZGwzOpVsm`d+{S|KI+Sd7>EqI%aCB#!*1<%P__FsK(d82%Tmz~_-y><`3 zME{0b(ON}`t&r%_fL&1XTs3GxEifYKY`KHO$QQC2rg#~bNK4;-6h$!qsnjiH_L*GN zd5SULH!bhJde?~Af<4K@lvZo5p@fWD=^7Mi7Xu;E2;eOBZolguVu8QxD1rW*do74GI{=@WE=8TX<%5 z+oSd7C7oCks%*Pe?1M}8+Ty!zhN9vXq#SZ%zJxe#PzBJg!J;zCvbY%f?kv`z@26)n z42wNN>z|#S^QsER^LA#7`4+XFm>5gJV2<;js!w;E!ZZxO!+Iz|GG}|c{qt5|HT#CAlyd9i~TAFpVO&dOK=?RF<1A18H!F0K4 zUu`A;R%kMgXskj5thG}PN+uzDA32NFG1-oRf8>YEJ>LDz627-=cfV*rakH{cF>}Nd zL1F4JaduoZ+LIBAz`;@dp#?K|J7lG9-yZxl2SFt@6{Zu)(uj(9v$uPQ_CU^cFg7Wb?Q`;vHaH+(uhS zEMa`S(nIV`1D6pPSS1r5!%`uo1plE}hAGaY^CF^OgNiL9(G8=XL5jN~cVJs@DIOEo z8;i5R;zdd;BaMVnK2U&YRho4F5isVgZ}bwAB2BQcFB*{WK|c)zZ}A^Uq3FN5i&QTm z)mdsLd{F~JcaVs?HD(yO)+-ap+P4iwF>DT%*s~)vyxnQjFlSMlXqA+gn77Mhm0EwS zt*iZ=ZGBGYHG_Eu?Gx->nqqZ8SVxb(_GPXY51LpZVmcx#@RvX;c~ez~B1ayC`L6iM zlL@Q^MZrg6l69sZXdfB zmg$VE%giw2!u1UONi#~E(``Xf){4wPS29aI?$bTe{5}BTf_MhcP;^$4zo$=D?hqWW zrH%hdsU-H_BE@_Zmc`&y7FS40>64;{^*-d4>>J&JAgav(KEZ+PsF8w;RjyVnw>gmV z2=~SRxu#wPnOa&~Tw+v73asP`M(}wYw+l&A94#hxOf*e#;-}UOIiBCK5j@Mb(7OU*u{_})fn7Tc3rS^ zaVhn^Zcc`f+nhf2ej^f=Vl+jPwKJPn17NJzv-QJmR)Z#Y>|tE9cElGT%LtA-_WJK@ zX;0o)B|IgLA}@9om>V94>V_yP(R=G}OltSl-y+yqG>1_ct8lR3owCFfp@uYJJQNh% z6u#sfiXgm|kCODx^VBk$Wr>VA40aM1P4&gHFkH$evfd8W( zXe}EVzY%8OA|a&R?S9+V8IT zq|+Kl)@P(7@{-X}0s+mmz;~y&WJ`?#6LowJN%xag!ZQxb_*6Oj&;FT54`3K?q>a&= z3Lv;0TGp{jr;5kHvWX5cg68_8^xZri(#>iX4NnM@r^?1!!k`*@h$52@hjkPYW2K?b zh|a01hv0OjB+u2Yo#DuGU4>K)KG(6*>?_z#ee6Ned63|4e&CXd=1VD$dbPC$d$?2bpw;r(6~+g8r$PPk2p zI%j*HE&&WKw5g-y-f2J;yH`T`N&;PLT6 zt2y(O99H|-;uGdraqT74X>Mhi5Z__XM+EM!*M)ECZwKy3{in>oNq@1o0LdYU;li@D zW#0z&4Yhh4X16ayPA2!^0pW4U^yG0o462)_v5usn(^R#;Nqb{{h1OM-v6>|6wqa|GRh6b+%q+P#6VjS6hYNCTUr8^q)WF z$dL;Ki$jhfoCqB}Dnv7ef^r+#=21QU1N8@tZi!aIH@Yg}x(_qo*tC%D{oPqVmYY$W zf{nHg1{2$Z-Es6l|NUj_!>4&_^VrQ*mb_n#Nzw|}^TWZ#(&5C0Y?PN7v3ZLJ`_niY z%Uo_5%=~G1#VR@?fBbz`%ev$IS!{}|E@j%@!4o7kgk5jnC{%C`H|nFH5!qS5eNgl! zTqo+LoH~_9{FCTsDt~x^i49FecuB!xCl0_giKS~tl`g*pl6CL0&yNl8l0EK6@xfLYl0CNoi zd!4h3vbnYOyWi}FeC-5Sd%k^6+tIUUGR?9a7%HkABQd$Sj03QRcQoEJG{c7YMICAF z>;Sg9)~>a-#*<)ax!9+$ocA-DV973m6lMUw6=h@u$UHp+*=Q zWmnx0krPyez~FZlX$c8*ueF_@I-^MHD+uC2X!K!T8XgN#lM z242-doL{@;^`sC0BMiK6pPL$+!PC22K<}ac2I%+1^AiRzlK3YDv5js#t3T7Plui2myf}7>FQ|oBzwturgHO&u{1tVgv2)36v1eB&5s-JGpqi2C0lWM6u!En6wx6r}AN%p2$on7O z)1Ou{D+}w3o~Oqj*4LjoaNFMH>z@{nY(0z86$Ygy-z~_|AC4ukFKgE!+iLlrT7_lU z*A94N6z7W{BJx#byh|unbtt|Jtxs#cZ;F*y>$$2vl=y~f^4D4^c>j=~?603w{nm-W z^QXJLSKcIGrEu-ULk~?c31v$O&=!{pnF-`{7sN%%7)VH=Kt$wEHFCk58MyhKV+?{% zH@JMZ1bMrj#nn5x40=|Je{=*|7x6{$j(rEZ3iw75@|V9yh6PzI`j+*%1mQdr8U!^= zdK1&D9e54%0JVVwo^k~36MMzH-SrIq;HkbLJA$pM{mfd+H46_$j$9ztXMBSje0(2F^}XpF zULb-JGJG4|)3W_Q|I_$Zys|#q1@2m3rT+A;I8}cK)IMqbfEz?LzXcK07Jn7auaqME zy#gkDEImI7JR(0`oUMN;_Z&BS|CZbUK0d!YnKb_AAFS(JWFLmjJK|To-m{s$?qjzG z2avC^7v6t13N^T$L`i+*yn@Q?Hcwq%&=+F`%$!Ji|CopxIx=L&s}DE0MU2 zBfz(CWdEu>uH0ac<_aMH{j(?b_ds2Ts5=MYKy9Q|H~x6|)(dz<9J%xfkN_Ad1A7jh zY;KCr>>(E*wn(LtY;PvxO0uGSPu|6btB)GJr6j|u-G+^Y*8TjvuPg4MmJx3kIyKVr_r}oT#KTdmmxG0-SPzF>2r%RrIJEp`)m(tm6?GtIBuNW{w<#FmR z9tS-I5$`U**SfjN4Xo-C?_WWL1=0XNKq}>V%Yr{H{Jy*vDWITRLt$h*E5BU8plU3z z=1gL5{YCU8(cJR{#@QPP_bNBL)4t=1js!Fh$2W;UN}~~l zUWHPBP{#rfc#}42cM*@tKh~6J9WM$jY(Ahs&rNudryG**@rap7jm?GtGCO=#h3ns4 zVTa48+$WPC;HPQ$=v&}i+^(915zrCc*bHHmD@F3=@AsmbW&er?2Nf{NP!T4!Ge;Yj zBvJ496%=c>5+iXfOsE<;Y`-#|_8?zWs&l?tol}q4?aDx*5dr2k1>3D!oK2W`*>Ww( zD964^!!ieNEru{sgEoY66uO~u_-yIU#__WMl!0`>F_}O_4r-y&dAf~%6!X1$BQuS} zh5*+;jYToH0E+&VSopv*^?O_u6-r_o0x{;WE<0QGmoEKKArW3Qd6cQ1S*IY^Ut&1D zJ8*#(b%-4~KwJ_c#Qjb*CqQ5c%iDtCiP@H|)(#<}p9%_f1ta!(cWlG`g z7?b3y6=OF*EjoMRJM9nK#2AiB%V4c8tWbF)N<-=bAEmPxl57JfRYowr)}+8}tz594 zm|nsineiJ?ufl*{fRqD*x1wc;bT}EH|Ff^Oe^*ziDfCw{GUak4@_;VrCm@3!i(r7H z#6UIQVJyqNx}MW&H~V7_0f{=SVlc6=GM9{ZM2h>oZFM1(tvE`63C8&gT+y#oMxA+X!Qc*3U zA%`cqysUCZ_$a8rL+Tr9eJjVx_hf_TJXp`Rpmvp%o?t(AqMG9G!0KcFiZG#y83NSx zjX9ef@l_L|5Z@b!N1}^~nrm4IeFKGtp6dGO3~_tPP#wA+Lo}a{(57=haaR!7xyu~9 zO)S41y1L^{nKV_dp-XW?yFh&qaMiP{!D{QKu%4vl6&oDU%*g$G-U0Jr8>s1 zv*Y;;Q39q4mksT58i3c{S|nxLRJ;*2X?ze~L!T_S$+1WWNro=}M$@l`nfG!Ztz)lK z+)tamjfYe>+D!3Cik}pF9CG~oJbgGTMJt$cNJDDy6U9-LmvQWO{YJE7FwLZ8qVnzE zA1y;trwk4&d{++7^xs(`i?GckFV}Lh(lbz2$ywsDw+U&6bsLc=d|t!D2L5OYu#koT zp1I-;H>lOdUDqcJF)maz{c?vp1!76f&_rr2iF8AR7blFr@`9{MH)b8QCwaF_akP<| zL7OK(n~(XC_Z)+!2y;|ZRSV#`%DdYWG5$SB>&V5cqo9Y@Am+Afxm&nP*ZFf@_WixA znO!x#P?n#rfBv4MV3Q&s6Ji>Jhn)R(D+X8pXu^+_ko*T~5fWEj*gyP_T#!mJbiyfo z1`V{KK$QOkvTpR8nkZJHd1QMUPEtD3*{}F2*(c-vDruCNs~VIhFL|i_J?-fSQdg;YgW4TuOa{py54_whYqOh!4i8%+nL`GRD5_9 zA1A6xqPa|@^TaGkH#rZ>lF|0$cPC_?*Qc4D#Pu;6@lS8BryeR#GqYkTyxO!Jvb%}r z)m%cKyRgj9+9^)0wP6_DszkT)+kro#fsC1`H?h}Y=k8Q5Wbte=*yOjhSNG8G)}2#j zjA|u23=_-Gg;T&X`xNNK~*1Wh5o;xGPx;kPgg>a zce4@~2CvKKF0^s+YfoZQGt4fy02h@f{P3=bjM1F@33F+CpNrQ0R)Fuyb;YZ)K#R(}GNakAkhb>ce7ae5 zqPw{sdEeshy~swAahPpl86n z*l?{(6V0QI@B!DfvSYMy45}b+JMH`X0@nP$$Ga#ebR@I2qtz!}jSHI;8p{b#E4+y+ z<0BnFY!Vi-$#g&@Ekh5c1SS4kXkN*-Ae;F(1t()}7jeoBk$vK;)7optcu1Iywwt=u zXTSS0i8R1z{|RtI$~Vi@WqkRug_X@+F%P!WxM-ooZ*t~rr8-@v8D!!M8CFBj8*XP% zV}fBo&*#1u)u?nF9%pG>yt8W!)lKh{x_0Vr1>=v-p@Oc*hmj1vR{o5%f}FSWW(QLQ z42qm2(!qLnsf0gMtYPXo*Y!mA4fkhjU;ZbEJ_;26niY|N6~#dx&TJu*pcLTJWq}`; zj*OVZ6Rqi`g)Ng%cB4qGK&S5bmZ)AtYa&Vh(EGg4m{-AXk=Q^z)}9NnycVu#c&0Yd z*^6+B+Yg_M_NU1P(-EVmzh2qJ$1qoBteTeR`d8$vPrDzBO)_NGc6%aU;deP=@t;uz z=n2>-%)zE)%d2`uY$gS5FZ7XaH<|$X!PAu0IX?8BTPW(BR*PtXZh&RJi>{3$Vsy}e z=Rde*o18>>u)BA8b#384@&O?6iNZ->-bty8h)DxJrKfe1f8Y4C}^ZBAkXeb=pO->e?U4xu0jo-sxprUL#ZZ z#-lYEuc%H)hc00J4Ctmh7GoLc?WcuzTCPhCfLg9zk1KiVTDhqnXptyCpzcjLEJxzDM)x^nEMa@iY~`T#Q2>G$J9g;a=}Fo{c}xlh zNzs3-ls7A?N{yldbfqY(=Ja-M!}JGuM;<5joBw=93#gdqsn+x1be#M6tnRs^%U^}C zWA7#LNQ!9m$w1iF6ufL2I|^y07OD4yC@1Tu1~rzCp1*bKIwaxL8+}OQFeX+v?Riv0 zEH$gVs|^zJ3{t=JnPItS2Cy+WvOG;-aV)XW-h8#4+^7bZ+IQk(K6%YEuHZ@O6pa%4 zEmQqsx2x+oZdSz^=}YYrgw#SCRc(_^Hu#65r7f$L+fm5HG#CF#X@OH1uxKqW3;Y^| z3MmXvIM=`C^Jii9e8An_k(QK;Mg zvb5rSaOQmL8q&i`R&b>5>nqO9ji%$)xFHhc_g1ir$iTg%LLry#%4KH<=MDxwopPNt zwSKTr;PA%GWGj|W>1Sm7W)IRY6oF?52(B>eWd`5|cbi@*oq>dEex%QsB=fU#r{x-Z zmn{u}%Bj_7LdfMeLlL{+?Z*-m(WB$ii%pJs7%ke#_KqAhAL_e>z0WZx;h$$3TBA1I zoW^03T3xcK%}fAKjMiH zFOoRE&|t+C`;giht$lK=+QnCoB07)ts56mr1uZ2uaTqV^@-Z6v&Lk~7)9+uWAEG+Y zgd4J=!_4`D$840f;N+nnd6P)^=pa<3(I;X|`{Z>Z8>)5t^UX%Lq7f)C8`HB`6;q9} z^fsV{?5H4W{pppA`4Rj6Tj`Dg2U@J|s9R45$JKieKMv?&?!WFn8WhgX+b3Av56HQ! z9Py`pI`8f$-27BAnp9&SLq3KSrkMIbeiibDu*A*>OKDVsgW%^!+JehFsarOcS--YgnXk>uH6lYvggzZkO}!F@^?$SGvht34;q$j`oN;(Oy5Te zLcUIJjMUgO)N_g%N#d1a1UHkBfc{M%Nrmp^yGMlZ^L8Cl3q&$uo@3(k!paqqsw+Ge zi23xt1@BF-!+7@BW7hJ%e2b&cFzx>T#$s^P#$m>~jZz__0~C70JMF6^&U4)+R^&M! zM0t%eR;z{@M|>R&`2+2>-5L@$QVe_k>=|2UG;t3`8{I&M?MX$xyIHgTeHXbLv$g9~v%h8piOdi#8}JkC^g|EgN$HoK_q zKOK+KGl~ug9YU|S>w4ezT@M$lIjy@+e$JvZ8}5GVP$lsXmLH-2e;9j*AYrs1O0#U+ zwr$(CZQHhO+qP}nHvh7#`gM2AM0E5lW|ML6GB+6~BlA0nWZ^53RBmkl_uGxAhXEKT zGV+FO#-cX_S`Q67)N7?X*M~IUJ$87DJ5N1~mGp1@ux-v_^|qv6PBV#W8z%1OzqMQW z!Ku5Jc?C6uXhSzQUS8M9bO>}?UN}i*m)$kA&!`*LfGx-LWskNasR7AVCW;GImbIzw zBgl+@wQcpHQi6_>!-)fLYyX-|z(M(1|BEN#nxKQI2V@`E>6N^3Y0sCU?0 z7x)t$;UFkpHag>PyVK#Vm9>g zt}n=JDeWt&>cJS5XCSMrzkByyeLQAs7l@7KWE*BmPuND|B32hD~%PqQVQeJ9*@9BKMbqJ%p zbfCiw1>)7aGVj25l&(t=>O}tpcUKkS^;+_606L162ju5PX(ea8%Z>}Z(s6s*6e-73 zm7R0FWkr;BzZIC4yD*S9EX-O(@9uxzTU?tJ8HfrF-((wGErOZ15-WX4 zB#J4m*n654*?;z^rq&6fSuY^=Opx2$3&%z`y^dkjC8|$qAjB#}k4D)kv?~UWWAA7> zSa{1VPXetAKKc=9a@HQNuy@FECgI*%(ni6#iou!7Dxq9!^=wv@^PrlBa6V(o_6Qf! z_`_z_D~ZVjC=sY3S0>&em;uGN12}Eqn+a*3TP5fva2bM=>EVD%(PH~Q-6hx`32c#B zCLZ~Oq=oG$vFGjtNUNMtk$rv{CwN_x>I@A9+&!P{*Ap0Ecj-izcaMcrUsv|2&HgK^ z#;$ci)6*)#7A>FNQM30;nAjf2b@^;CDBa{c_@*-1b*K_i9+Xv<6DR67YeyN&Y=myQ z9wtzHT1hf`alvI;Og*TpcR2sX_8ksdI}J}wp{gqVa{k5MJIOY492gpmI4TP%h>s?n z(499%93rhxI_@`q3XDrk$qU2NZh~E)#Pv=)v$}QL@Qy&2ctBmP88u7Z;N4u1%B5*p zpE_`j4kr${FNz;UDdg}OGadBiez{sFel+J6sm-dp$qM#1BJdvsF7pPA0s&(8xl|>! zp52=J9z&sryW3v#7^ ztdD!bIE%1Iq=WTSo+dbr3K`A#`nbv zvE4dr-ZH8TcI*c#<_V(ZgXxBeWaw7J^v~b+hSH;t4=#M3VAfWlW0B5u*QMjuJ3c-U znLpycatQw8I$bf6`V~dS3xP}OXbfjjf1>BgvVTq|f&y}ysBCSvOhO@^5qjQOg6Kp{ z-bX!=bap$jk-!KtROkIsOGg2&tV2yFpC6C7P7ofkd%^I~u=}vEs^;5rPmtm+?_Ucf zDBu43`f9q%+yCl=)1tEU`$tw3DB#tr;6vh)aLvIJK^a~;(N!qRGyZJd1^rq%k>&yE zLsP!Xl}Sg+w?`Uyy7EcX^c=R8j<|iafM_r_;@lxH2TUqH{H&zbm1vVE0#O>E5VSFl z&B;!FIw@179YcSyCVa;S{8@t;h1+8%;;cy?8oHC`gvxL`c#Q3?S(kD0kBJDDVRzMz z=|1!6Iv6--=OJ;eZi{VM&2MCfQ-5oZ_c-6#r$QbIz4W)lz_ni6hktyio9mkKp>4*F%=&ZeYLUpmjw zmNk7Q7jK2T#LHid+P5bpR*eVy1J1J>D3KOFYO}_?`=IVFs>)!v`6t>*`-r<{p?fni(|NM z0nw7{lD4|F4SSbkzXWgjn|IUNy^`Yjc}JCrx`gK&xTeS>;$?ahUvNFYq_>e+tIbrZ ziu0Aydl=K{e~V03dDK85a!bcTQ5jrcYY$v0nb0lQ)=ds_o;Vv7L&KweqL!B59A{0y zE>f1&W>465MgL%MRM55w63e%qpR+FA9WsqGiH8u5n!RldYSW zNRV01gS=EB+cS&q#oyi!5W^p<5=v+ByhqixACwh%v8lmOE!jcd`!V^m02Qf%z-m2( z2cx0{GTo^ni2^U5K_v3;qlKH&zH1iFD-P`^7Us5;z|0T|D++bsi-eCiw!aWHbS%0rPh5&dCg<~r1-1_WZ^{2!~MD%#`eau^ zE*T?!;o5%6cbz1O+vZ(?KQzaH#O`9bk0>kp=cnxnlM;y4grg)l5Zpbg^#ns< zinUo>i)H|hA}78?_2@`}V+rbauKjL>7(2W@)$x0M653OJ)MHLZ)q=d1fVFGhT zj$OMyX~!3X?=}g8klpj4)TRf)N-}Fe!eY%)UgomEd|l;z zIE0M8d~eB4`uggPqIE}%9hup=;#?_kg%`KGc4=2pAh)w?~8~i?dIZgFE?*4!lQo?U;j`99xhMHoUPOdw7B~IXTe9Y2w z@B;$X@^@O*S7SmiN{eNhnElG*>Y5-0KF6uV*n}p@Z27+cVxEA$-S-WA?l6UA6e@vK z9%-Wlmk~6UNz;v1H0FxTP5wt#LgPtK1k0`lWaNfw$#PjoF$@S(Kif0X(&tx+R>;5w z0Wxv+*sMxEO@ILwNiha>pjX2+cBQwK0wYmxjI*Q|qU+F)q|Zflbmgvn^A$YP^is&=E6#hb};=iX`0PCsV@MnVEkl$U1j$TfVnA`JP;TKv2ROu-K*` zOfy$?_bT^T6a|c>k=TAp;4Qr*lZ8Q9;h9dBD^vi;6g9PLMOj2F+*^E?HDIGm^yxWwL+X{_evei!=K`iB-80g zeQY=V(8Cm>8zN~O+Vc@B5RsMA|b0q8g`}ksjk%_)x-=${WfG~{zMD@ioC}+3h1bFfkG}{qMP|UYu4DGx{A>2s z_?EUs%Ns1a7-OYhLZ^B^9h903IVTpib(-|X_L=f{O0F-9lm$Z7%ALP^@^Ic3{cYNn zF;g@FqPjGhgX&W>26aEqWF3Lb6FYlUTj8traXI|K~ zqR!jfX)QQ*Ph!)5k56mz$FNt8`sl_ZqcQ@?;_pOk9}_SSyLrd6Ld}+ZD~cCTni-5p zD&HQ^G&rK>X08l{v5|_gAzDeo8W%EN;K5#;T;xvA9a65}KGREji-l{Q@(Z!jA%w7~ zSn%54qAC3?jQs~bFEd|ljfLga+Ai!gFe$k(q6^{~5%u6DRdwHbVCEGC#Fq%d1T4c8 zK76p|)L4Qa^;m8A7H>R0)`+G0ZL=Bzt8#yaYCwJ1a^kd2fg)$E%t7MiR%t zK1_HK5*U?>?G9-ZX|K{yZ|Z2z=$Ntd*-p4olbyBmkz`duI~^_CqGx zp2O5^_ckGvjI;?-Kbq+Ca_XG1upYCol^aRrln;Z}{k`8(O={{#hp z))0@zjbT9xP|3dVdIb`$Xh0GiUdE$3;sTH`%2Ax0B%*X^dd{I8u=C>|Tg8!By5ot6qoN@y=hGdiE>oipy z?PcIOyv=qz5)m=&yk~;-1x990-v$`o>h7@1BdjIY(ioIq!uZ2aV<7Ed{C>?&#5a!aW zhOtOag`$3DdE}mr}Jrob9Nn-I84SpY`dh z<%gaojN@Cs88&8us>fsaa!p(U9X&$UJ`DOWs?Ydtjuvi5(*+SiXFG@UUrCvF7r{|? zm2=;Fq!)75=1XM-oJ2}dpRPqSHN4%Yj^|aOIYxuvLqpbnmz0el+BgzD@*qI@Ln~du zCzQ~1o;nNgH$4LA$0wE!_pHR)hAWXnZ0OSMb7;pWHo(vgmOPV)YdAu{ z_kY$jr@oJ*CnU6X{xnGC2%E&X{V<2amg!hM)%U7y{-vA-Q|+8!5qF`riv-NR-F;1p zhU;l$?$>hH57A4IKjOJoNgTD)FQ3q^u)zoJ=wZeCUZ_(Lu`Hd_9RM6mqAO&{?H#1A z)>rWsVElF|tD6A?kQu)k*xzsGS3E;feveULKO;3tk)QB8D@j;{K@aIYl-yC}Lh{)mt;wFvG# zVap*m+#+@tH^Mw6=rZh>(p|RsZcMCHnOQW+q|^S|sHK7+hl?-nAwAHZ?kOHxoO?tL~RfEH)+5)wQ(2 zzt?_{KF2oijY-B_N7T5viETgDDAHg$o0)cL>*%r#k@(uf8 zglxeKh)6A^HQRiUM(>(3$w}4V zT+CZg3P2i^xZ*#sp8XKH`?-Kr6LCT2?+tWSecISy^P~wV$xzbyFI)K?HJ~(O{L1)a zhqolrA}Nmlj>{b|-jQ+E*Qd*&4}p=Q)$jzK5$z#9(>{9e$m!#tUv`6rFhCZRa^ZcS zblF3`W0dB37n1g7&Lzm5i>OKAf(CxMGsB}O5qE}0x%Dc+_h`e_<651+Xq6&omiAl_0ITN|6@A1!1;1#?agp0Qf@hpbcQn>uxL=U z#Bku~DVFg>OzHJ5wq_)^V)USPZKw zn43C9Rn7kZTDjjzMoQ65r5zH=$AYFfKEz*&_f*8yY14pnvy3oKd`0`+0Kaz1%#Ge9O=;iVlliZ@nXGx7ma5ROh&O%!ySq53NP zlU`rPP)r%F^&51JVUfXtgWIkt(EM}%4cc*dZ|KpfXzOjdjCb^cY)dk{E7= zWbf47S!=(gK=KUaCmt2m?(8q5tia!}nK3{yy?~+>oszJG=)S-uht?o-#Hh7~K}Q)@ zr8_bH(jT8`)etGToOB*2`*c?}6Fpq+6X~ZBdzA#1!`jltSmJ_HWMob}onl$&g4|dY zGV6LHo%DUiK)$c|Qv_=0=0l;I-K#OGG4yw) z8m~*m+)8SCneU!uQ*J#`L6cekkx}#};CcMN%@Cq}|5!ftKJ!*iKb`_wW;Hz<|CIpl z%8O6V!jgf*Z-Py@))UCod^RmT`czV%x#ng_?}|?ZA6S2aH>F5#GK2LCO((aQ%~wwc zSgmkgaSXi5VVFnT8|H1k8#QQoqM9P*S^GJvRD)j&Caf7r8w1=38V>Do;dpqb3IJQC z;|cN+dd0MmN}GEk5E6{ED*k%OcGc%A^3&9<*@nMH&{EbE$PrYk7Zf&F8R)7=L1Be+ z-qxvY1?}{(V8)-AfJ!%lR8NwjgOFSJVaA|G6mG}(eB)~wLDp@*Cb28n*lumIc$R;x zO{GF%ZgtY35ynUqIWE|3!5|r*o%Id0G5V0;dwR59tYEu)`xNO_^t&%22Dv38Rnv`$tR%p-O&vMlS)MGQYA;UG^n~m~ z!V;U^#;;&?&MfgBde` zDR)Dkg2)!`dX@=2WwlY|WU|3J{(DVVtm)14Otii6bn&Se@+EWpQhtcfSpTC63w>TM zUF}^m&9wh_#buh-`PRj%z*ZKZsm+TzW51?0ILF2Q;KE@ngLE%RHhFnhDZ<3QLPvvd z58Z8BMv#`Fde-Hgv`&}$tRL(;jj3Bu#Q;nXp|s1mw>sZgpzjfTj+O4Gw@mN5Gz$9yw_!t_(-Nia>3zvBSEVM*V|! zeD=GNR_rR%>&c>gQ{UnW3epE!*wFdYWP)&;4r~xw9spMuX z6ma-Gl>NJ3<3KUxki2vz?b>A^z#}I%^zn5C&*B<7K?+1#&W9W46*ejJeYXUPExB`l z7&{{0IU`-hi+IHLyVOJT^rhKkX2cP#0T9_YnGXSwTTRfGNiEjj zdDZIA5c}@FH*_0b@W3Au=5*AWw z`6o9ezs{}jL{`_3|EnqZ;Oz~;+d^TRK1gFgbbOk}UJg--?lW9DpUjLO+Qz|Lh%+uO z%K=7Nu-B%_LJ@Ba=BB?nf<`izAMcN4cUOa?y!&eT#p4Z@VQdCiAZ?0;{PAG*V96nz zmHMaB20SZ&5d>*btFG;w&1+X|$ReaNa5v)e^yFLCYlrNp@gL_GwQRl_OH>xpf8u}H z?PlaqrpDVaMc!a#TyAe%S@j(rCSL3bs0LgWr}e*XYjoU90qr>B=WgUab-2<-s=S%H zz(Pe{9p~eFl&jo*h4~Xxtk3KrQ#D}wWNMMyQ_qAZmPZx_a?zin*vP7fSDz2l6*|Um z;|fMfrpgo|+ufoRg_Dw2u1F%RB_g$|(qz!){La?;5RYLoh7V!%~;rpR7S-;#rrc?9)c=I?~yP|3S_J6&`A#17%R#G=j8j< zcU0{YvAXgl3$Dk#yn%me*J;4lh0=5t;Yv-1Oco;lY8ImJFhF6fkH%1T`ZNJ@E5e4|f^Kq{wVTfw6xF6pd? zo*5Q|w}yYBxSk&JhZ?CoD;ST%Wi`?f^bQ!#v%!H#+gPMX?eS1Gp+Q;2{ zcn8|oM_~2fYnN&G=nW52KN5XGy?v^|#J%uX-H1CZmpZj(0;s+HT`krumwBAFh#fp= ziwjd!wNjCmg{C~o0Q6!Cd<*PHzN|(N;j51D-Q+Je!;>7@Y;y;Xt<0W_DV#JJP^D1c zuyn|gOD>rE(|nZv$Qy7`*Wi_ zo!y1w;h6X#ze_Qxu1p6*2NEWmm=DmXrp35bsD;`MOUM14-FBSP0grKNL#gBVLIsgN zLt`CH1iniQXj8#Ohg5v>KDjxRf5X$;vQ!bBrwT6O5-wo8miU8Ih&u`;1R|<=oKLmX z3%UreoyABpPO;}=-?99O&Um>lS#?alK1o^63;oqU?_4G_GG@eBS|D_DdArPw6F{jHBQV2xjTQzlv27 zbP1F?^stM>x#GIXUQu)hQIn+PMnWX9AXnXo{y#s%=bh-uB7Tq+c6^tf7MF{(7+l+9 z+|#5N5#Ps6ieeiFv1iPoWKG#emFNHp1Y2m7cz=3zM?rl`QbA_(e40-8{F#;ze5+s$Ze-3boFY>BzA}3aAi(>l$&EMMb5_9wd`=k>xwJ8 zUEA38x5RnXkp0&RVE9fG=wvP-!cGK#np0$1>cjeCZxQpC@q`Q(%$DfC#Wr!XO(&vPj542 zK`Me6i$?c~{kwzN7S9iMZZ6d8yjhnk6`CO;)7r(@N(_578;MLkaTn6&((&xAY;-Mt z%8c99f(uW>dlY}2n)$)*u5%?c)ojsLy%Ii_IKOTx%y;%YYr+&vpRQ{gbryg}`Rlcb z!%}i`IJ<+``PG{+y#AQyzJQ|hm@^{V!&SUpdss36#+t@YGiGp!@+rc#PHHa(s2j?; zulU(0iFK84rN}BZtTKmA^Gg`Z@zxOCqOlo7?D>%fl&h84+~5Y`|AZjyX}_ZmFN%XG z_uZDeyupHMszd6GnC@k#8r6{G`)xZOE66A?+i9=vhJ+m|zowpJ__l-O_d?^;f5Tw> zn|Kog(lrvbQul;)aO8`dD2}6B(my)&>p183C6-=6&+Kqt<+CH$ZuWHFLtIvIQ1xk9 zOOKUwU>vIT9`B$`o|hZU8$AheJACUy#=5(IU_8Rq^OcB8VtczK(xh1-j>0(~1`#bN z?A2pQO@H`{``e)ZA290wZ7s=2z{t+Q@&6#F|G}tCtPKC}_y2%V|D#k{{}-qG{{u#S z169brejR{52GydtLuygjDeXXWUk3mTl5RMH8{OS)^>C!n+u6mHa$KKIbAILfyU*@) zXG-qrKfU%`^D-9_EvpzJuraa*Nor^fWN2VudIAzTJt@)90GyeziJ6(HnNU%wGKl!k z2Gq%f$~7UFcw;T>O&_fYj)34ql?*JT2Wx6`3!o&o27tx}08LI0jZV+Z41k)MdEOt! z7S{vNNWi=SQXmeIz}6brNu&&^wbj`fAUji7@9Fy-QNUOR+Tif;u;_0Ym%s+r2>=_| z7Qjg$f^*`NwU}`Ms=&w^22610mmCB(pA*Dre0t>M=x7L{#m%I}l>xb+6ucvV@C?8- zfp}sN(*)?f*ffA=0qfb_I%YxzK-Ib7SRV>iTR8%H0T9FkRU4tDYQiGYudB!PUi$D?{H)x6ydW(8_7JoO{=t*m zeQ|UU0#EZL*G$d~*!_Nu-~M@T{JOt?u^;$~zxw1qe`+L$CZ;dtd1v&&fB3u$ST?7x z?W5NhT!MP*0&}mfm^Q!lm0%b3yQ#pL0l77Q^=eQ+KDywB*v;#SW(J1lCT4%qaBe98 z-9a)ag9ye?{bOhJom=?O=AdnWlv`Xue;%VfUX09t_`BC>nA&}PVmSKdPxPn@53Z*K z{(2|)FkZS#VGRoxhyB0Aym=+7s2# z2d(Dv0hP7DkND`blYjIjZaKsUFIU@wT_vng8v1g%O5}rLy@IUOepO)RFW@vwr>@q&Scs!Sz$|8ej`?|6lY9}hZS>9to z=i!L-ZU*S*>#%)kbM6Tx%N-i->3QGTwwBN!ogwO6(#Q@}B*tcm&RhgoG$KI~plN_b}+aSP|I+dSx#F0(&VJoM?DI=WlGnnH{IttFomn2Bq_jBD2+ z!^g=y1OiRo%1<3KdER6gTEURW+vH0bu&cQj3YZ|)yNBpN^sj%l#&I0vKEjsCo>EjQ zjNwo|$66bN3{zPur$b&{{SfKn={={0pPRyc;7;oc<)I`5-N0g~RWZzFI9IAjKZtAJ ze?r20Gl5E^IUE0Y!HpLqGJsE7fXYzJ{tRJob0pz`m$9fB`tFHLcX z?9Ug7IZ`Jm=wbKE92mR6Iof0GhZ$LH)!J*VS(ua0`-nZ#^*I52*K{@0^?O(muuEyRl@~)@ID@#Z=dEmAB(7UEczvqB2$JeDPa( zv{!^-8024%0_G^V^iJ8bH3jtcq79?ewKYc%hNu!eBXbtaEusrQjW#8$abjozNdTYb zWeO_CiuJ{0Pp&x+|1=WO-%F!)vKTfvYrqSmqJ^@AZ1U-3fA50(%nR^j5yJCi zRg-K8C|az1dxQKH8gX8{fFDbAC?hsYkmRAsk4NX`r9L~u93NjDn6CE@GrqzhsY3x;hbDV7#2?gYkHETC^p?h6jCIXkRnF z`U((L5HT9*J_btq`ELbM6?3M!6EjtkWo)d zx90Is09ZXE!>{BBP0xZ6;2}}*q?jQR5Z`_6d9(&6jJ#e zGZ*(9It`6mu6QVku4uoS@jfv>i;&|SmahWi^?Q0KYGcG~sv3ezK5D2lNo9>)+!Fsn zKP<>nY&+nP(P`X|5I!i9d=hW8UQrg^XNKdhAlQ?y<`>=`cRk?);XD*#!avDNCF+U9 z>lBf=|Bq|m-nx>{N8R1Eg1{ujzIG&mb!b#64wq)7)6u2m@hM~QqTMOe#y$W=4zl6 zora3&K~aw6iEzv^rLop(E5XY^_pwm}r4G@UnWq^yc{7;^=3BK%Gddvi7RHQO14$jL zT@owDHNM^RxHN2G+wq-)-B9P)%}Y1nrzy7Lq8I7V4GwNcOp>Rd>0Y#@P`hNiw`T{V zyY->t{%#yKJ$rLmGe>Y~**=IFeDv&Ad*PYmnVli~D*dH!Z^_KCA{|h|li|m-h#VX8 ztpdLBZhPAZ%S`F&^#E0D4)$G5e_0Z*2+U*n4K};K zW#5OWe8Vuc@k?zgE#0q3+M06d7hgg$LM5PmLv@CfYpf*3t@4ZLWLi67JBUyG{O4%8 zO7nW*MJm}X*-lyDisAGxS)wSu#@&G$5fBdD-!f1+t9!${=oM+-lxz?yf5=@Di|E~S z%+^Gb0X@al@119RK)BD-`i(B*NX=(i_5-@|Q3rh;%MRyIwNV?ymxp^!4n4^~AM9)L zov2#2QR60e;_R(T?i!9nQT$ZTVxILj_yF5@rzl6kWk|Jk?W8$elQ2gp zCItxuvKqEb`g+7&qlp4XI^qRaWw$ugalMFe#QH9WKD~v9ILz9YiUe=u zLENmh#Vmo&Yvq!6pm=^;+3%++nr4#^M1a-!+(~M~Q2h`2Ygc1zKdeMm331nI623do zVitm>G3%FW>lGAFyQwGir%@IaGZudb8dzocsMN&Ha*w)WtSBVI@v)qfaFO`tbeH}e zN0XY88T!Q*3bS$wK~1xiI}46)ZB@6ZK6F~=Xzf3*CIx}M-ROP#)(W9?#+8~f`2B8Y~Il9rBV~i?QxW0 z*TEFO?82dMD+k>t+7-P6v3)xbzU&*JQ&hK_Mym>`s%k@M;Yq%t}|7`hsU~cYs!^c<7qzL>UR*LNpg& zswWzx+*U?gh5~Eo{bvlajQhi_ zFp=$KGyI>I?pvNW8bahE>tLBtFcjoJ*pt4Ts*j-c&{2jg`;?Fre+^Dd!Rdis>~o=G z``?c-U!*ZeZ){UV$OkJGcw#1z6)TWTpS5P9cxkgU2Gj&Jk>n!g<6IP(&Z;z|5`tL& zP$uahrVE$n6R6FfphF0&(bwCl#j11yH4lF+KuKhDhC^L_z1Y~xulF$(PVPYYtOR7; zqL!wz-Fam{}i+kdNumArEMd z4{~l5en_a(yD~$}Gr@1)V3wPl@a3!IkDiHihJ|8#v) zu(@;Xw?O$=;SNqDCw*UmXF7Ot)vchqH--$JFJk$2mL}y@3rL3xfl~O1^DLGa#PEj= zHrnL4(CZ(5{!N5UHTAr;2&xZou?`Z{p6ePbvS+)4@X-M z*73LLiP&corrLg3**f~LJei1H`Wuz*v(1>2q=`@gH;KgO@3Atnj{wW17zKh|t~dF`}v3 zX$QsA*7DFLCvg#RUdpQ!LCdaUbl&}W*_ipuA7xVf&2Ou18S!)&NPpM5D1@^R5$W%; zN4=38!L+PyuTQue<3dysIyCovz6^a)hTeikB1dTB-V`)xu6Daj9TPsi6INrq2BZD^ z6z2qFH%*K-MObbm4k@0dt`T9B4pJIQ72L>th9s9?EdWv7_ z9`mG}UlJ+e>v_6dW~>_J`__*{Yr#9qvCHbwPEmb4`;^n`Cx#i=#_s}N2xE24{k?$+ zu=8}isV)kHqfQq#u(I7POBpjzj5Q-LQ4k02f6S#`LSlR z0p%uYEPQodiB7vR;)4u+F$w<`!7zRlwMA(Lc#CWuQ|1aPZF%}D-k9hUht6RMgr7&} zwjJ;E^p#&tBS)d@17cFk_vNO|Xi;HK*pBBYcj8xL%j}j(i9kO9epBMv?66hrpNoT11?1|OsP+G*HkR2T+*x1@%3y(AkikvzT7Ls+!*J(_t;HO3S>g9H zI`T890PAMYUT|ou;zNjQBWgS5Z!VL4u%i@P?He0sbtm)4srtISAo&uhrHm*|1R}jV zd?V8^(I#-h=JX)afPB*Dc0F&FK0MXFi>Ocs^czv$wr)?oS|z3P_> z*!1vg#LO4EA!M;UOYL8(=io_vpxg?gu@8iM|| zGnEvvAHdI%S4{yE-QDpQM4{ZWA)KFt0MT|U-mPxUzsu!1*UKC1-o+ChCT5E3n@R66 zC^082kkTvm=BJ&2ESvr56+z5|5`k}RTFIn=*DFtqS%MHIz3YldQx}G3qubA#vn;1`z z+lYH)Et-onwG^GU3;adc-Nbi*t?18{(O-k8tS(m~{3aWn?@6AJ4-6l)hk^a)@KUZ6 z$9e(R;fQjZAF|e=>159w&T(-i+x)R^EF5Q8DcohS%A38{(C~*Kon|Mp51*-I_R(0w z1+;3sGR=k8MktO=W8^1&H!V#j#x*^bI3(AXQgR;(;SeY|(ZBlMYQh=@pST4ag}#kw zir2mPI1@k_;+}Rd7H`R9;53VzJ!v;~xCqG5W9y!Rvj<<{0{yjji3Ypw?GH=29xAI8 z;MDh#LaZ%nM~#sd2G#2*>Z{!rtj^k7MYsU7%?=D^FB=3MQ-M_oSTM!#V<=Rc?!)W2@B^G(>B3d!}?&3BV`xvxOJ zvc^)T-N+~^UVU8s7qzaq?##L0{Ttp)opVlcHx;;x2Ti&apiAC}Z`@_fUoVuXw?Vx!ZSad8%OQ54(|cX&5$V7Q|cGPRMP@ zUp!n$=<~3|KPT*r(3eI?6UbV*{yvXOdUQoZO>~G~IHsFCZCS*!f$lz4*nP0Kjb7}Z zj0L~uqHz9*7N?C1CDa^_`Z{#Ue7=^*iIZ|w1t=;^fHuc8_v%{ecg0EEQxm*atv zdEh#=$Om`P3wy2bs8CseDRLO4ZDr84@@xyFK3##~K(`Jdq76P^E^yHLg* zOqbgJCuVB{0+c7>uGWhw%E%;7G$py?IpNmunjv_YR}hTZ9b~q@-SAo`3u);nR}OPT z`RAsExaNNUlO~kURTioY;PcRM3XfT{ay7|;t2>Y7GihR2bp_b+8(6~6|9rjmxrISn z;?|h<-<1YlWTO&pk47(-bY(BfV{re*7n0Xwco!nx@bd770YQJCCD(_x70%BD1WpManYN$Nk1F8F~ar_x-dji z7+PscBf!yY4EmRtH2*){KK!VO?gR6{#d3DZ9&QZu(+86ev>?y*+mOh_wvMPy9n2Tr zP(wvYrr{!h9A{9TL=#2*RWJ|Et!*=ULepB^eS3^x@L~=-jC(J$QN_06Tg0&Hwrb@fo{1e-u}qpqr^k^u+DXCKHlvISCe~I# zrfnw0&&K3-L}1$&W2)_@Ul+^r@jKNoujQ=r>oO&^(_sfjaIIzwqCR`yx~(M59fv*B zF~!uyad<2DRYh;T&y?3I^K~t3cH%D>VvaV9D@c!S(%#xp^ZEV!QaxlJzs-Ow-M*~3 zy~rU!Z+rOuEYr)^k&FS-1&xVj3iraS=aC9xE(3&3}JOom(H(h>a_-x;mb=FfM9P=<+ZBi`bcGz8jvwckNV@-Y@M}mCn+5OBhLb^D%O zy>A#Q!+8nc-r%SgtZFKy$f zT#VsxR;d;5tX1s69+ttY2RqIjjvbx>!pg@H6cx)rX5olW@un}Z4)SV_m;K2Y#Fr!3 zB|qGAPA|r8fC3_7YcpT2;qFO7cQ6iX2gCxqfev$&)*5cndw1lc(T<<6Vk2vfKH1J* z|MEA&wRP53D@WtztWzNBbmPdI_;<4_4(Ip?m3M-Oca39Cip|@-?XUg~Z%0^YswQkq zgz7J<6qXgWdR8Qwg9>JDFJUR1;DFevxldTCqdQf2%?^OI%B0QwJt6al7n*2xd^x3(awR?zMN zLL*g|O)O@#8)LtIz%u#E2=lJ*Cxy_J%b_9@A)fMLl8tvMWV^=)C?^HjFrexJB`8?q zC+6=2ZWcU0OlyqdW8F~q6gsgA6+t$9j_3jqZXdXvVWe>|G{lg5`X7#SWCL6d?^Ex? zJCNi9o@Kp5-6DSmLvT6n_W=lXHEm2<7WAY}Vi1-=8&}i8d(|X4@kD}Fu-?cD z&(SwrH>{VOqP>f_DFbXXEtnc4b68aM{AE7-tV0FeH5ckGP4t@YPrv0*#kI2}8VX{= zZZR^b=`YJEl)R0TF*r31Q`WB8qCri@4YuM3_&z)O!x=I9@DfjG4iPBfirxtPu!gHQ z8&gofdKmhJcveWa_6o#fm3S7`BsO6uzRwuaE($4XZx`|RW;_68z6h zRRH}pY_9#u=!`8&_N$7Z-dAT;71B;@o+sI5Y51h_+;z_Fd}iEb$;AD#7{(R#i}`ix z_KKfP*lHU*!{4L2$y96Vz(Cm(w!Vuo!!c&!%b4~2?m|S-^uaZv4++*CI<-Tf8AHKo_SzvILu(4WtzAIOjA#BX`q0I$u{>r9Pq@8U zduXuj+k>h6Wi|gbIR4?BG?`{+xF=dOUM_L*I&%B(#ZbB@OqiPAY?#KZ8giRy#GD$> zKH90BNo_dYtby8lMG8t06lA8Jf>;AHvyqKS&>)b;YbQblR_*bAsuc;Y^shrKRn3+T zB7q!~y^Q>*$@Uiu1!a8AsWr1{PQsmuVnrzJ{NUZcmZ6?PYn@&bV;m5G_84^+9QaAm zMyl#kVwxJ6r9b-N|2CT5n|jAeStRyaDqjU`>@3a%LVHxF!^5-k?))C1UH*edOySNP z%)q^Kf#yx26Plp1dTr!u1uwTwc_YYb?F|=>@oQ!#-=PiVu-9ar^JYl@{=`Y(!dU63 z=*`Z7?s7bAA#?pBK7Uj2g_y_2>R>(N58QCX$yO})JiB2B(RP*uVi5Kvb~&?~i{K2wb3+cMvWlaYf3@aYw_GEY)-+X3V^5gc>#vi^~wfVB% zD*+p#xY;XUD7s0i2-`Q7vkkA_1_EjYd-v}laGi-^(v|8jlDx(x>}0kk96P%@|v6 zvg{=GjJBP5vD{SD1!^Lx)g?`@c|VbYByf?VN9MER_->=GcXb+9*9phTmI@6YGO7jivC+(IBtO;U+7puQDhRT9s{lbvQJkQVixV9 z@No(qhiapeL6IKEU8>3wIs}?{nx*~ad8mrUtGb9YjRbRPrdUH+*K5F(zvIk;q}2Z6 zP48+SLnG7ID{jYvF(+al0p49nR`=n2$ZU66wpZ5rGWGDvNc(1H-v!udgW$RDk6*pm zsREI>RE;TTT^Zf|XE|01E#2&?|CYJW_5NbkW0`h=1DB>1*#O1jg9<;!8C|xRQOKBD z^SsfMIuFAf)=-S^NZfd9nCIL%PJ$vprF<@G@>qwcVE{E5UL(B|sHnROoeaWpJe^I3 zKhe+)c3kvVLA4|}xWHjj6amCCfb53+NwLj8f0lMb}i2f^~vK&?qF=WuF)?2qE2zl$e~?k8B1J`gDGDKEGgw;NI`_UF^G8q zduVqOzZ~)D zN+Y$yEFye=eX84+vH)bgr|vH{k`K~-f)vJ%1Qk|P9vS5fJ9)ucx6ReRWT_o!mW;Jh zoEToZ6G^qb#wqYisnR9#CWo#exOG??FQe_exHmVa3ECXTu?kebSt6s^PG*Fvx36be zKvFJEWy%eq$M11cLNG2X|0s{QQH(1Dzqs(i%v#cg!1=ZaiY?_CSd$9HIxC639z(ER zNi{L1ADTPzb$jmov6I1j%`AHe{#ISM@9UqFw zi>7qkk1s^rlaHdXyF4r&oEokdpk8RmxYskzJFdghBukXjr3VqQR*7JMxlAcLP>=D@ zkE1F}ZAtY;(M)Vh{)_kX1MQRrGWz|Go`VT}Gbv^^p#g^<)I%nC;b>6JjtJ&cEfODT) z!!M)hZCVxtF-a_rgt3biQrrF{z4%&icXModp(+6Zq5EW6xT{VxbIKW27ghrOigSsn z6Mhd`c6dd7%1v^j`P_nV^6gsVfb@VAXODjHh;mld`lg+kef#IPjZCRy;!;|hvYpYa zCx@U3pU{<~;un`^n{QN$N1VR$g+o0>xj0>b8mfF1r@h`$;a zXe&AnsyN_As;2?=jF|1c)*Y@5f54FO?O`4c~ zYW$o|3yk9w&cr_HGHfX?|FxyRDAuQpFQ7(g>rK&h678u_OOT!wVRXrYSbzH0J6^$P zPpLa0S*9!_dP<<2w*HJrs8U1$R2&5HMc#0tbrB6M;M|73=G_~NNmA+_=E5!#=3B3) zw4|rwpLY_sxwPr{c;9S&MpJOrqfg)(pykYu*G=&z*e#sT$> z)We@j@HO8zRyfQBBM}!)sfM*Ds1cZ_TIL0rNwyl_&$4-QaP8ZOgHs0<(!F)Qb*5Y& z+c~FU+@jW;Tvfd+vg}8{$ECdQAoAp2BFc+jwH0#N0(;K;6lK$2r$f_6avC(>iMsx8 zhj;XP{6rMmaCwy`A0S}<2PBn+;pbUfG-EZf&Pt#)%iLQM8LTu`uOi%&g&;;0eC63U z*0X*lq0ulT}s$Fp4DUEmnxajn>IQ55 zmUu`}tVoT2oZBHE&ljM{Hca;tu6k9+ZancwmJ<=w_G1#z97ZTsCYX0E6le3la_1eO zuygxj`}@)weIZT;_H8WBA<8+dkD(V6p~y4@s=U$l z7^a>z>HLRc@Xk4gaflTAW$6alssn285_g>CNDZ@lM3*! zHpfNPnwi5uZc%M0$Z~vM>#1-w&c)AqeG#D7%*b6ds~gBSNxuAp-3reIU;E{I%@M>qEd4>sFKw+7r5%izA`XFIHrNS2F6d zat|+XS{GoU4kdEU@y=yHCUt1{2)&19z~1&K$aJA+$2(v@{t*D5@GCKC>MKRa$kYwu z+ktDff^z9zS!J@@*FNmfPjsrm&HtWGI*Sl5A%oQmk4ED{DJA59Vku9`pT|3-8j52^ zST5E+s@N`F>$-_BQ3!Bn@n(mRe*NQH+wcNQ$q~-S)OVdyg>`_KNz5@aBzA^(EG4Y; zr%;b<>KOr1rJfr6u&yd_Dz7KZ9U;{F~Qw7eF8vhusLd%KrL>LIxnS*5`tEYKjq{M|AO z7{ri9t8S<)m?ZmDB$>P2oakeiFiLGtnP+O8cmFzA2*{Ba+>Jq!V<`>3MhbI4tzFK! zZE%vkmU^q)yi?@AqUcr`X@RWQELDLPnaeu-AW;JhGL<=wSsb+jbJ?CT+^4)eJnQhk zoBD#9|K`;X#x8ojA^=qxfUp`L@Ic~$jf>M)jg;p1;MHn{Wr3!*?+pWT%4y&P>lu`< zL?pPm92K?s!%@;8Xr8t?Xv!c$QaWgFq;2gs%8l)*8|dnLcucBH#kZVQxEacOU67O} z6(^{Xf(!2q088#{#zXB|TQt6>9XqO=CiGH$V5JsuCq51xr@1C29pANoRW;=*b7G71 z`dzKu3mm~ZGaxHqrpn_w+tOJ2AHum57Mc}bU)OZsbD-mDt*O>DZnS_Yq)qa770e== z8`h$d1GJFkg3bffB}*_cb!xyFX(-BQigKp)BvESyqK=J zS-qpF6e3G5!JTd9>T5#NbIZl6%Vd`QJ*w#ne(mkWLDa%k?BiQq{>A?}x+=-t#-qAR4qW>gv92Oq zVz|rTcYWSj!v=s6Gl6d>xcyD>#91iT=JY(fvM2(0%3NhA~AxZNuxhoePrXme>P*#__ucR@I*`iGq|I1UFD(ulzT53((`LF~2- zy-%;ZJMp;o$ahGK_aoJnq-Q}i`gT+_$q>FOM8YqYavh^3DjsWa0i7QWb_8V}C!KcGV1t1~-i_nST74 zz%wJuEgGbxqTlL@1?MM+dfLzU^&kgvEYE=(NlQI?{8mbcB2f91k}_Y7^`VQuSOxKO z;MpgpI)&mT>ExT8Qi5?SAD}IuAz^RPc6llDm%#WEP^!#sT7aK?GTybpY~tW~OF4~l zCbP7BiMv0I=3X(96Hu{#I3n>;+*^!(VlC>=a2U$ecb(tD6H-F3Yl`JVlKEVG z*=zV>Mpov#*k zuCvx`8>uOT&tF*8AgS`a0`{a|qjB8>M1_`QwO(7$r%Kp`xw9MM#g08rIn_*7U-Y0{ zF52hHGa~C}=4ZH`QAB~XGQNRyo<-_@p2sse+=j5klYiU@RynL8jK<>>`)zG94!&eC zxa!15^D!%iH$V|mp=gChFxo52l9sE=ICw0&qL$YW5)v9ej&+2i zr!|A{e%#MKJhcb}9iuP#dsn~soWX2}H6awXp9p(d9KR-%FdaM|`r5x~Pa^C$vYkyU21ik<*`qji!4PA1w%xJ*uv#7%aRtdP z*`H=enN9&bUP=ZRFPlawmWvL!bz>wwh3{R8t6s~QQhM8yqYu?O4{6U@EY*H*mYaWY zxrXr-@!)2vFyq*kBbX%S2)z^8N0x+PKwt+Oq;FGag;SSAcKY_y2M;A*lTmcTDAG)P z`T=0(j>P>>bc==Ye~1(Rc?4NlS^htCi~V11>i;$W8@k2G$nbyF;{Q9k72N@V&a}mhi{BSWa zH2_p?VyFD1Pd`P4hYU{6jRyv%&dyFI3=M9kb*^+Mg(X0pnVji=_v6I#gP`Xz?$rkX zJbB%cA^Frjvwe_Vh8vSx&7lbJd+2|6e7hUs5pD{hNOhK5zy=RKO=T zcEG@&eh)6Jb^t&*xLE;Xn*;OLo{Y=BS!Whd-*{%Zop`C~g6E^lxrc7HZx z^Otl$8NctZvm`k4?r0mE>h0h3-z#rSRu&Oe6c&r$+BbeKL_}?Ne{x=GZ2#Pl9L)Zi z5zu{OGa&b0_Nc;u_r50mk0UA*BSYx@A8t*Bv>$SVG`~Fll|Hv1touEk$JYD;P@wXk z={I#US2E&x`qSSt$=|f8-#!1|kw?F*hu@s|;HH$7zGao)#b3W=u+>ww+g~<-nd&BF z^PdxIL2doNeX^|nes|S4^XuCiAAVLP*)RfL1lC5D&v|T_+*0XXfH9~uInmQUc&U9S zmVUGuDIKs13#$uXb=sf;bJN35ea`taOpPErII;N=UujSfTG_vFl(t63R$ptO4fRd{ zFgQ3c+Xv|aLBoTyaQDVwHHD1xH-DI6^o{EqT>c3|1x`GGWvp@cf4CIkTmg#i{}lEi zg8M5T!yke$ME(fs0Ejj4hhz6s{NN8yfaoW`1*HQ6fHwqWp!yZehoJI9!1h;s{uhE*_5vPISoQDSIo7Y>Hi7Xy{xD3W ztv(1=Fh6RLJ8bq(dQc+kSC9ZHHWvnlCXk?A_ym8o#xL=&7vfJ5zytO-ctg;5v~`Vu z@I5~gTWcT5>gw+}1PgBTs2@Q&ijlSgi@5k-zjgmdfFIz%593GhpO7B|n8}&pOL;gy z3!5C=p95GXhHr3?65|(gK?S3k?VD+Tw%>YyiJuG@3ehM(0fiviUqC@t?Qh^fEW>Yb zrl830p=mhB7QmY!{-=B)n_m)O$JTFp*7AR>v?W3Y?s-bndtH-((NEh`pL{56atrRc zVdM9b6`KO_b#*rG?*M$_`Y(83t(usZnKpTTL&1t)5+iev%C9*kbGfje`MRJ5H&D&Y z@8|i3AYE*J*KZs$MG=2;K6moM#5CYroTcUu6GI!*4>6D~dh~xZhx-67^Y8cw%id}K zK9;EVcOTf}mzWQlqVSWSpu7#w&lA}25rFFp_p+~+jMxlZ!71nG+1>y49~t-iK?VTQ z2^h1lmTDd29z=5)$c1Ma{GfC3TK0A}@ye=HalxyO!De zOD*R@-7NKV`Ciom$kt4&Sn<7aB}%X7;o665>jCCu-g%#9|4lF;?(L~s09>c;MepJ# zJ+5|dYw@V#WkyFb;@u3s1}NF~G0@l&5ntj{5@ZR7`Igqm`C;BtUiUKsee4mc8MRKr zAom1~VU9gl8%cdF=Ax))J=WO2~#C*FkSVQJGe%tPmCty12|@vhkwLn>|beNRKV>6k8|IeeYH-5_V!%2oKdo~G{mFN|!lgdp#U+-@Ao`er99f}&Rnjv!RIkX)L z9*HISPRY#KnAoTU{jn|$##QZSZK26OH+q4Ar1O^oCD})A z)E#pc_pwjXevXv)j`r{2oN$5_^>Ey36i2kn(8_nbA!GtxH&0x;goRA~P@l2v@74`+ z?|8FJz}7}(Oo91%e0<)k4bU`o(I;JHB?O-5QAd6rU;8a2U6>eA#W^*?7Ai%0^QzqC^MXJzw2C1Ms%Pu3mf@Om?Yp> z%GaISEpqZu$@D#^&3KrND@4d9cMufAsvlz5#B(~jsb;g@6CN3*6R6H_xNT8d;iDzC zv$)ot?s5&WY_+QwxCVlGy2;6ob$N(SHKtn>r8PHN)O*tfMT{E=d^jLbA6k;(S_t@4y;kPTCV&!LqEPBf%Hh;JsEA3|ft z9hg3F3is^;EgAy6mOAcVJ2iKDPMLht*R^e@on1qX{@OJMDC#cG+pa+H^nik2EuCfV zPKGU&4t;L(tuT+tjj376W8e*&a3vSO1p4WZHL1KGvM2Tk?+DG`Kv1xy zV)EgM_b;u44*-R52mH+FUR;-Z9^hPFS1dm&+yuli+@PLcfLI=Uf7Q+3o-M3jw_&(S zqSH=tTE5b%o1+ZL;M$OyI{+q6JZ)i?xagSgndTJlhU}P=L5;hHugOLv6E^UFR`?&J z{iS-X49cmr`TRyBY5l;XZBt^LGK?&>Zyxo>tLEy@2>)I_=E^yjrd@~9B>6C)X4l+7 z$WeYRGZAyWs9~`SK_trdmPeXlJ(OxD@tu1eyg{vt4i51hWM~<5E1IaR`64b}K&k@W z%Mpp?Y;uM(zlo!v){bH3bO;vF+M=^$zu>RoLg^W=SP9dPucqJhO*TW!FML#X#^}dY z)8CaCd*UtyyFf&dStczO>>7Kk-S_mM0zVdaf?+X^D+wqAK*?k10;)hYC4;yxS=|Awb<$Hknw$ht3Zy< z7D&)B6h$Q7mxP?RiL{x{nu{nZFgNLH)^>fnK>KbSf(s^@j#*(9o~=jeR9VOh-ylb7 zSzHOpxYx5OY&%1<%-R9!wev-(wDJ3d%i6j|J)lBAh&K?R_qywTa?dbR(OLDh{U8N*#x=_yg^jlddhNe7;4 z&^08Br*3*k^@%D0?UFcFbhk3jp6^44;>n)Nh}#$g7{V~Iim;$a3l)Y!5)9AAAf#Sn z(Wripeo*AtT}y^kmZF3_%d|^ECp*~~iMmS$b`^9qksqhr{E?PO?w>WU&OuQl^?*e^ zNW)IEGXl@vorc}sS34P8VX9K~-50?TrNB>2azXOqUnu3bS<@QXJ9p66Q6@Y3$~4ej zYb#b1H7~5BTA8>NKh;;)D_y%SL8|+rrIDS!90!IiMx5o>q)!*{U-hKMMs%}|&x>ia zWyqxLGS=7dLJ@$tfzIliL{YeeD={CD#&fOO{AFFZG)RhE#zixv)KW4stP|{eykU(W z;@d_`C0mJ2J(yh{l%ie>n4gBEca@4y`6qj@IB^`w0g@+*Sx>o}%{|AtXfD+a6tu;g zK<;u5W7kceIGtc9keW9EkX81LRO2!+Z^N>Q4Q2QN%6Sp})Be}(Jn;QX&q+2~H&VM2wVs2ZYr#0LeG_G5F z2*xjCc{VGSHB+<4T(q%%j{#eCyyvHUSh^!PS^eB_>sF|vhr9NXMx8Dz4GmvbvgQVH zj#lK@bv!-Rv9v#+B&EsSGOhlAF_n~C27*E|F?)oILD6;cf(+h=f$T;#6hvL7ihjkJN=3;FF^?Kl5AAC$BfBGDD-YL9=S=dunxT z7RfNjG7kSrh#w>KOA4P6VO@S`p!C8BdBhld{TWA%?+#ymGYbqwof(M>2Myetiz%mC zjYK}$8CV4)&zbzS{e%vp59=FC2G=TUcFJ#oWj7zH@LLfUA#+ z?gdKLpi*%1D44oNgHxLoE?OIXgCxbEDXV;S|-EneV{Kair&i8ovq?4%oy6CL6UduC8U zK1!QSmK_-40q-3Ldcg3=?2+S?}`ymVP;*saEil~7xVjcBN6M#QhD*Bm&<+(I`5j@cN#5-tA>UQ zMiPK?eFgo%VmZYFQ?^#4Aqg1ho~;aAak}(9C^}8{2c>w2J4QueaUPY3{!uJW zqR;|+A!WpOAdA13QnvIapLpL&y2A>4VVO7z{)vw}e~xd0 zhmtn*mvLNRJYrVAVN#R$3I1NsGIa66k?Y1>UyKcvzj}8S zBcO+kKcHJPeFVoeKl#TJbfz+8k4|Wc*YS4?fvM_Jo;8Ac3E2l;sN%~Ua3HXTD2zOW zxc4V7kGgZIa4(>m(2wthQjNQll8v|yq@MR`(7(AQ(n2rN?TLA9h=R#)~BNp6B zit*gKb9tDRa=7|K{p(*X&(evs+b&WZ2odQH&PeO~#6W+>H_^WO&4-3AnE{DUqI16z z1|V|4ggyn6r{AY!dAbKXvTY73a-1)U92`dLft&BB+;8d%M`V-9VNZ0&@=odUw$8Ey zY`ig)qVOt@*+NXf_0Z6Q4E%+XoD(pjK@aqq2)uMJil;BXf);tS;*5qB_9K}-S*1Fg z4f_(_w}nqrU9&Glw5aJ6zD94~j*ArNdmxtO$MaKs$I~yWGbR_RZ3m+ISYDd?QphlR zb=0F4xE=VYPlJHM82D)bV?p$em@wX41C55YEp;=pT5`@x6oyukD-y9C40t>U9 zQHLpFfc~YVzy^;3U&RDn^QFhJWXlsIoNqPFzbddWLwru9;r^v`&J!NLy_?%2 zHYHh$W+#;C9LXd2eKlALs-rLhhw$fw|!J*g)5u~`Tat}sn^ zOxhXsM6Ql%-*y$Hd|Gq)k@1!u3T39ARfD$^*fB~OAP#0d;*l~KrYTN|Cxs!cgVeLh`{e!I@~7c z+EifyY6cC_{7RX->!9Y!Zd(lzcKr;u0d?Nsj)p+%g6p{o>fAP*KpO*=$h_kxYMs^x zplZKnJd{!rx_;#n{`DLuwvd6&BL^)X#m;8sI*a1zW>O)?a$PAocCC^%Z-olv_+Zc{ zkA|yKb9q-{O4%USJ=d)=e>sUyGaACHOUeLV{@X{K9tL%L0xl7i4sv#A{7t0r0|#hz z+wq#w954fuONGIMKIc4N1{_-zfVt&O)xUK z3GnUI6;jXR6Gt(}J{djDz#e?>1he@B((XXh%gk4X54rt#LEVF_t)`R*>Bx@L^zlB2 z8!*m_%uk+Qf9nmMQBpQ3Wl`w2?3^}fS;h)4!o7%*u?t1}siB?Oo*eFI6AfDg8bUzi zShZ;ZIdWMDA_pUg27Z$1w8@&*#Nq?3kVsp1R!!Y}C1^d$g2q*>wtC^ij;yoN3fGEE z@_nNgKPUoz;z?kBrRbNk(ETHLS=Q7&Ze~2WxBraJs1bCDWrCqN{D%Y0|KiVP9i~qY zF8(%o)1rLEYIjG*kUV#W=L?Ry(h!*bZBD@uylp+46;2p53F6LBFPdS5o@CI8(xIV4(Mlgqp3>FW_|I|# zfwPq0xQ1$7YMEtk7EYM4IZs$;=M>+)uaru4dUGgd-1E~#*Yy@4Ti*mzA!F))N%G?? zsWM;@Aji7EjzvQDH|tJIPlhnhsb$jE^*N?GD;U^^gE zgnu&IMaHeLdG2Ai`#Gng$D-Q;&f)t*%sY$D14h7!4gyIds!gWA#D?nHy2M@Rl(1jH zix6h+<2|Ixv&z>r_YGU1$=Bvm;bSM>O@U-DJ_a5*!4^s)SylMZjw4kGX^D$~#_eMg zvDEgAzs*1i7aN6MvFP#o_5^K))0CdX(mD466`hfwg2Li`BB8?d2>c=s*gh)51&Aa? z8zUIrnyw$7TN#bd*q_Yh=|9>!W$nNG z2<7*bPIvw#nHHkPH~)${E`v@7854il0=aPlJMOOVp!IkMVB`th=@lkowvH|bq95u?(rOL=5kM;o6T8|gdYIS`TEkKHvJ+Ds3Oc-Idku6M(E#8Vl1$p|Qr%>D* zOgf||KZ=Noyy%g#OIbO=;o!qcD$o$wOY2etba2|FDw3}l$9%%PtwqT3L^^nCpcnTZ zYK*(ZGPFs5odFnU!)vk=W?3J=i{QG~S=B+#zo!3E`v4jFQxA^j z7yRQyBwd6EkCZf(#IUQSV$+e)ra5r|YsW6#MI~fa1%oLz($)4$f_ClRGYrc2-SI_f1#2mDd+Ic)cqMvENWE^6IpX0}qHf=ZyC!;%#J|wR z8@aC|&Y;EI*Uo`t52mzFF5Vj5*9JLNQYF|O8{qFBGHmW-bC0bfLV z!{r>KtbSOOJQM-1n&xOAb!K+Bb4un4L+{#I(=D&(c(lv#CH@CP;xv3=iu7hTQ2U$! z#`vRpOqGyi_MW7LHET5E>Trh3_hce%WKe30Zo$H92gx1sB8KM?`__ij@j{J)tGH@d zwUY3_M+|T^N!g{zTSv58oI6d$^EUAaT)BCnyn&Hb>~|qjoB; z-}o_v(hvYlBb(aJ^Aw96+0&qK=jTJu4()>nX5|c><9L~Zqi4~d+UXs52QqrJanM=y ztD-EGb&JC9D#-Hv5{wD65sJY12B+kuB{h;@BoO1?r(cM$odYk#{wpy3gGOs)upllB z!9Xej6%Ex!@Neo?pz15jwa0cGiV>z-xI>kxg)5hy`q|{B(<6ThWXXCD7mW+gy z%Bd5K_pcYjr*ho8z&evvU}y1U!Pwdu-o6E`?fv*d+bbm~30p^~;@h5ftLp5AEUnoEFX_ zm1ASQ@IqVTJ-gMA;Vt4Yd*s>J5=W=BQBPr zxUW-FW;beAZ}SIl3SHj=-D-U+oZv0)ml~q<{VVL_?~n&vuvOct0BOpSJeq$D#+0wh zeQ`;jpa_quF>Ot&I3rhsIYZM*BDal#`o2}#Em`!szMMn2Hp7jBEM^`9URM96(Hd}O z=#Vzh{*P5lHpJ#Ti{K2=15PANz{A{RLCPY-N<|*k?5#zFd#7X3(Ul2vhkCBdp}6P( zA@MPXwmUhc&qYz3YGy4;^0Lp@E)O7=TPm8EnP3?8_SjgBR2pfY<~Xpof?n2+319y) z&IEG#YvXU|>k+6gDOJ`;n#Jws`;JCR-{b<_pEKCl1+)g^qrdb`EX+5Fu!=LBFC57$ z5;AdjEb>SQ?s*+sg+Y5-AriTu*IJ1v5;y)FDpV(`>QyX0fPp8UGPg7#bLAI|# z=8fq#^3F)+RkI*86$hKxnV+J3600`FF=|Nq zLhq8DgWSE{RN5>=6yvO1t}Qwz43t-EwvouQm2rI{a}9RbQ47~|)e-pbPCG91b9cSx z1IuL6&upclas`f$Dg>%(FeZ`l1Z$RT1rTIJU{_ra@wz;Zr`5ZhSJU||*DrlC%|*jg z8~yA_dCqTSF?QXe(TVYDId8fGi7L09%J_{i%mu@LszXhKt=aG%>`OZ?t3d7hD=B`dKt9sc^qk8oGSw|CO4E6stWLy05EP&6E=<@4ua0ejBU zcQO|^`azvuO~)ht`P1Fi^6!kRO(Qqtd{$%5AS8h;GWFEY|4&Ohzq6oJM=Ln&1(nLC z^*$Ie<`(2CJjaQ6pF8F--%FJ9s` z2wsrVg4e&2Y+6udF?CG;K`@LC>sROdR^1Nq{$i=emaji%ect*Begkd}7wWDPoa9Y= z8@8q>zeh6Ue3--^Y?#x)j#QoZq}A4Lmh(%Ep6zCT$sL&({5M3wSXgF^mfQ%q7_pZ^ zJMX2UID@R|7G}*+J@~K%`8XE0tx|cVyNu)!y=ChQ zs`#0*SmL;$-TKO1Esrws0Nc<5?`K#%15>y9tj`-!sFUq(;bBdYu@m%{=(Pwj0fd ztpK%eKD<8G%&;Ia{^829{H4*%^(J=?W!rFwrmx2<@^BxwD+pOA)hEP(Ur6<6YmHcl zGx(P!!676HOh%~?=Fo-JE0Ki{c!w%j#IhUsLps0M;5c1+OhD$Gx43ID7Z(;eg!aYb zx4?-_*4L{4+dB1G=ZZ)-A|MWcKbo9$Er+qUBj02!2F}m zjgz_n`Od)4==CZ;ZeJXTgUt)%HWr^vx8LpJWzkj7_c!%YJ{EffjXgX2iqkDMHdCG_ zl?a+;{<=zE)s0DOvWuZTc(LvFW9$++o--(F8bFVoyz5MCyT2_Bzas-l8g@LK`$^1~ zE@$39*JPo=ZV+G8U>bsX5JozW4YSEiEg1uz$Bcp|A1IQ=?qN^g+Z& ze%h_`a)Ch>dHc^{k}p_B^o@bt2VHlotON$sIYyx5qQgNu!k>`p0R0>*E)yYEFWKkg%TC;PM^wSTpw#c2Nk{ zndPs_WEaAYgprRQqzu^BBL&;_@ZY+HoH^s=t!*(>emLR6$y~EmFv%T?kZB&CTXIb_ zZHp`L^hMC^0pq*vu}sH5e54J~sWH{R^CQYMOre1g0R#%=#;|vM#I+BQipz0f) zysWy7gnE{tRXlu8%ReE+(fV&WUD;mCn|?&e_H$~!IxVbkNrfeePXxD2dfOiPNhGmH zIswddr$)c0+*j?j2+L)cdu%*1EV6il(tQMpm^;HbK`)`K8hf}6Ov74nmNA6S`24ut z*WZU#v6y-$=cWPjiq;PO9cJTo9!{SBMc6sS3d2L|dfT>b+qP}nwr$%szir#LZQI`a z{C98$H@V4e(xz+DNz<%0>+SQ_@1+CxHIogySicdw5UU9LFM5G{q}*fm<}T5mob?-m zfGr&-W%2j>!Fk%C;9g9wIi#&cy>kviFl)VfryFWSV~*b%nX(cHqf0U@G$ZG1oXDJF zAN<_frT$ruh5T)-8xL3 zRY~omRC8A@E0HZ9lU^ZvB&^$=h_9FR+?&7l*LDpYz!z;ik_%X0sf=lYwL*Qg2DfPQc*EXg+tWJVHPKw_3-~>C`(Wr7haTCxTAEo}j-DRL9 zi~xH!IPLvs<11FahQJoB-@h3caX+%qb-1ueuD)6&?nO$A)_S+gGsfunER=^X!Oy2M z$fwCO+mPh&3)@dQy7A%1toxAl5$X+1t< z<1XX!N<(%LHk2Bp5}E3hecBiIw<~=6iEQ#pc8!G;>=w||TQ)k*J_NtUzON|R^U~qu za*&l|5zc!x{JVLM!Fi?}4D8QTY)fxyG74O>h8d8Cd+Ii?Ym9Z&<%@0sk@p^O5N!l1 zPktRXM!>UDi0?-SpUMygm78-4k2COzsFR7kn$F*!PJ@u*&M2ENE1X_!?|C1ln`6op z3mTKu7DI-Y8_gk1Qw?BA!uoJfK1f86PjAhbUu~o~;8PS$|8XMXjQxZKQL14fWOj?} zF0g+|SrtVT<>*PltMpxHO~!)d;e3({k}i2BF~>n?I;r2cbxKwcoay}nL8bLM%v*7V z2P<6DV!tC_UbulzPtUqF7-Kmpm&$d7)b^aeue|Pf!sAb48LTs>TPyoyh{XwEafg!yAk_Wz5~OdNuAN#=d{dwzEnPrZ4TB@_kA~w0(bBY?Q_! z#EWpJCjLD_Xw`0=GBi$aWQlWO^-GNSb4@jc)HSEhBZB2Lj=A|Pqd0zaRT9LwaUG*@ zwAGIm{>l{!&u?~dMBC{<6kxYTTg77p;D65D4?}inZ*NPCk{~=y%2Gr<8~HMKv2-^U zR@KhLx$4}I)rAG(L9f5+Eo%&9Ea#a8BNb{PAIBVd&3{pn&r>p5-3G=`1^*Tjt2vsJ zp4Bd@lWznV)$5oRe%#V6x|`=^Z+K*3mz{0Al}me*b-Nmw*)!O~0@q0PjTPOc>mmvm zj2^Xfk~uk?dl7FBG&LqISEjK*x%kR5++iw~W|yd~NU~wh9r$D*MQ$PvNI>6*TY^q_ z|EfpDOBf5_y~BnXF<^rJte)F8UE|8%Ls zJhu*-Fv<_RRtb4)C)9&z?vseEmlO&6amQD5^0t=Y_l={0NlELX3$F;%vP}f<{I-qJvijXlr*v<2maBH zSI?6;8mT^{75TDYr5CX1VfCo{l&9S~d$hi2K;`(ANa($|y2GD?6vFz7iWU^JJ!);;v?{00slKV(lwuqxHJ)cMNl_YeU`N{Yg)#MLDbs%e0zBqOB>b>Ab@)C znZh}r#_Sr2mq+^U=&#N3xW8k26_LS?tdyOaj5Hx?Ar;(&9>poejWqKe(h^@mZw5Ay zKg{tcID7SvR~<0Bm*=@8pnUN)32cJBnFKh9Eh!dsh2XM6LE*ngSX+eM6E|0+uMA?^ z?$VI*<{6##6Y=a%w4!Bb!xaaych;2KNQ z+|ju`D{F>ZRe9)bCjOL!*(_nGX#d0QBTCo_29t%n{V`RgjE7>^Z|=>*bpQcmw~)<{KRl3zv|>@Y@b zBa>^|y~BPXCBE$IlpGeMWO2P- zcu7Tzop)I(8-tcMgBWoRYl=x~ds~IESune^Lw)5dr1} z1!D2JJ~!4{$G3Gf&dvqO))KY^ByT}RYkCJ`$|gJ*wQ^KG9Wywq0sm(Yxy!+Utj z39x6*LHT{#O`72lPBaH(ox>kI$v89+_l5FlKuwCyR zf+aq{!$PoYOako>>Yy&0U4aIXACA+?iZmthx3sXNVFSKLK8!5-VKwMwsgl3qbQA8# zLVSP9XS3kWg00pJsd0_{VyStGL#FCb!CKOEb%G9%X+TlUHk@R-5raFioUrF}=__@+ zAu>8VC1WD#PypVlJaN2;q!z+`^G=S6$bjBU_XWvpyFJ7|^__s?_4Dx|a_WZ&n8B+@ zHk+Z3g3*Y4i@@MzjQP^zU=TWgSV%cH<_IsSS)dD#*t=}7SuQN* z9)$-l2&bQNT4J<5Zx6>;%m} zU`(v09IA+jLT3TlXxEv=#y)PFxLF%uD662`*G}MB;x?W<&mr;A4&sU})NBzuVHc>J(j5J*Ci7AW%=>H59Oet|w2CkjJ-leJ6hM&9fbFd&?;`ao&3`YkBzN0N<>5#?&0&GWRB+?#X_Pf6XFTUx5%aF*ZBy{CorN&CrR8IV2tZpS7=W;W{u0xAs-S(<@JuBiSy_>EAeGN8>+)Ja6YS$ZdPo#T7M zrR*c)SiW>5wo&pl3%&wOEm^ooy?FL`zfd5Lt^>eB9GFHhft^fHiL3c1A|NVG6tD2B zu}0&rrj2#Ijq-bVoufWm)6oLrWzhSKGyUgo%PA zl~JxKT%gXsW}ddsr+;T-o;UgDnBvbNu2!Y+p!M;mPgADqJs}Ulr4B_XjC6{s!kalF z$?)3BS>JMQ=vfKCo4Iy4RmHH{iSRI)3OKY($WgT5j zZu|F`<1yN~M@wxn#xY7<2l?LLFwP~SsT^8$If&L2>#m!} zj{+>tSzWKzDRjB^#ykB(_Z0gKDBUBH+R@_cw*HpPXA`1AHlTlucPowitp0?l?CRl8 zBxq7{v%-uOh(HUHNcig}es#ZH`jW@ra!D`Ic?JMXj&057lMdF}q(1Ez$;5!KEY@GT zfH#bUw%s=`n=11^nCwQv`_6jUS%7!MT|e#SSJCL1?=6K`OLv)uC7>bhNBQ_|rG5Y9 zs+H(xF_Lo{G1tDAek1cY!^d4dcdqCzxVtHOMFnLRV1`Qxdc_c5Ck5?V`u})@%;~;% zVVOSne#A!)1Kd_9d!N3*W)pK$|9x34BFkdn+%M_fMqP14wqA^r!s=3JW6l8K)km}r zJ|$(zhru%z3dN0^o_3r(1PYq;Gg&8Snc<8jiz#FNepNfMJrtim!~n>yIdmx~%S{Q@ zz?8I7o|)PknD&6r&N^f*#dxFGoa5>q5X5N(p0I~u5+{O~OucFe%U+=+De}{d_ zUJawWvstJ4(y*!}Qq$~Qc>lKla=MRm0mgLgt&ZoLq>T#+Nm4RtP-)9A;=&n{wE369 zR^KA4IKcW$KEqnt{m|yA_b&)k!itQMZ!MwO*CJ*gd1OiNY@Yuvt)ycV@k%D;GJ${K?1V`l8tcy;_7*ktr@sjbLBE z-4)52SCe*A?z57jYr4h6OUGLAOA*eAm@7ei zi6)ia88pqN?`ybt3iVJr)mhj2gjOB@hTKpEf@;&`vI*yQZe-mXA|gJ&q#lna{jk_( z_G&ab!8?P_bK8%lW9-btcNR# zCxs7Xvx)-)_INnbV$b0YnlKhSIJnD)vW84>4< zLhDB84_yNtS=Nn4b(aJNO8(R!VdlYl!>njqlr~dU0J6|@oO{`OcBAiD1&fN2ucutd zg@kv}0T@%954$K9)T2m1%L7>=iH4kSm3>fR0+bwD6}w@25`pfi{@;Zlx`|rAWR+$) zPud|=}&hUJYUphhJ2=?BSFP?;DV@Ibs&ME&{gH>M4 zduGD@St!z$x}K8ze+s)GmCvJ!q$|stxa4gvnIdR}DK4vhFu#$duB^F4oqDr>pxX z#5PivY#X}^JzJroJ-gt5Iad1LR-G6hmfyV2v?>SMJ>q?P5*eyGT1KDeL85engIKMw zsL2^Fne`qZiltDxzW)i4aTUF$xP$UP&@6ts4g*mzX}n{gCtj#m-&a|x%P{BS=49nk z?xGETvoZKei|6j$g2$cfBbq`%8eZ+UOp8l{K$za?t|o)mLR{$6)aw2Mz?9hn zk1o-3b{C_-M>*v^*>TI<#h>*UXBx*);{M@w9{vnF~~SrdwA*3 zejzX=xNAw-ASCy+bo{>B^vSEl$}K8uom)S?6$}RA_95uxvo%Wy^`DQ_kzdEV=_^T5 z5`-1iX9DJ>+%2n_Nts+QzI9M!aKds;tNzeUxK z_-F{&rZF1DUNGhS5OG)|K1iG-yBv)?ml@pn3-Lmo>h5O3*Z z1FeKWWJnd7e?e+2ONGRyf_~|?(cxDDsGgEM^8MWj1aPII1B&qRtUVIw6#9=+%zSI5 z$QD$2CS2~xTF$VIy#VeTi(Z=lMy+1IjB0PFR^o&iRO^(uozl}QGlw3SJKHE zoDa(y=7_GOd7Lc|-+44nbY9k3Sr3CuJ*j8Phq=oF?^Bi!`kgJc(&Jj8s5lAeBpD?HY z{2AEU6zR#(*)(I-36JIo`0aQ^!K7x?qIaafl}Q z<@)I_96aCSYyhFpWPuM81{706#!CxH83NeFBcUm%!#JuoDE{#k9%e<*#Ia<+8G=k~ z@b`ubfW!HjRv9|r4w&ghJctQlQRMTgIxUV`?RPAy@(&2x?HL}&DVZ6~AmbFOp+^|o ze_BlKrYEZ`vlWrr!mRiSv(=y7l}7Z7xE)foU?khRE$|Xb{c@_HWYq3B)9qn#3f7jM zBHb@iNGRx!Zn6r6%&T@Kb>GIdcm~SN!!;n$Gh3$CjFHDV+A`u~>JH|7r}7YG@AcdN9{-s?+mrhl_pt9?Czfq)d!o z{oz@x@E=KQ<>Rv2?1{GMiBJ`&mYX$rqOl1)rgdw_rRZ8DalPIR?NTn*b1b5Si3%-F zo$Q8R^J77cC<k-4ODqkgrbOs0L7(O^(O@*1LQ}h+mRVrNN%neC{k;!4`{T%Z_x# z($8Z9#qE}#VHU)X&KJoZrd}=du`BQnTGM4u4Edz&M>FW|#|^n#^ioJOrJAZYX+o2l zF;hnOR3G7)>z2$XU z5THf$(EOF+&mtDnbm*K!#D~>942Np0V(otBl4QB=vKO@LdS^RY_gig@fA1a|4HNQd z@ollDTGy!Y--e~imjCWl(oNvd(90|GIA+HpDEdN(^y>6Pw^KRYqafbs4pp5@C|6{WScDkJNGB^MGLQPYLtKppa@~;l0p>8{ zuHgX5jiS2c@|!+djzB2ch33*u;Fm3k?8KGl@!E{47dC(+8+=Lpvx)vi(BqjAp1W|c z;ipx2DQY%~`)vMTRtpIkjQ6HU4NZQ6$D z>32&;gFw_}`k*cLkk&kO7KU-=X_7323A^mC0E9MN0a%UW8f|u)UKzPS&3==P-C=>G zWp>AOvRjLA50UaEV1I9r+{OLLga-Tz=#v`+g#vPL6I`N<)5<>1-e~v{jJPaitc0#h zNpkL?BEABz{6oHhKzeg@^`|3U3dG4JNMtb#O3@h)DbWRb`%DSS@}V0UtjnFw-@?&EPOFn_&9bWa=vT@?8aUEq!8;is^k~gqCpRpcgfR`$_S||5-T#5MUf5 zuYs2ygpQu`R9xIj@LFL#2}nkAz|1Q5j{ldoQ-7wvNjTU+s%7dGoa9?x1qykKA-L_x zOUc2dXX>yQtpE`66GU*q6t;#%g&6%yCOhK(#@Y{SMr)FQQ_3w0R3viAJLyaW4&C*X z0YUiwJHYv}SJ*q4;TW-17UY1q+y$PtNCc`OB=)=={XWFlG?@FN#zGg$!4XaZ6=CN! z?Q2g1Zq+J42~^}SXviF-r)5JN7_dkKEgMWxwr~B^O>-Qu+m1H=Z@_`2!2UhSF_x5^ zmXc-_(NpKdfI*YkPe`9V&yIA2V*CP}0~s#E6;#2Nk;y0hrY)hf$jL}uwd>j&vPjn_ zMQM%g%$M;sP~p=Y;xW|Oj?B0lb(nUCVOm+usS$}T(5aWM*1y%gS|WSOtw=#ImeN;x zCb^({?o=lzXsm!|UQRW_r3?TtPu%lux*sBqWSibZ+&SpM)OUv8HCTBpH}6bBbmn1& ztP(9&Tc!dNpAHR99{RH513>q=(8x#R5&F-sLUeJSE;Ac<0wD0AXcq0&c#yyAa)H|M zAi6^#RLO_-QjygYm_J*8!!5WL8P*ric#Jr=Ox)w& zZe}*g>KGa&Yfmh`-06J#lam3*?#wCkT=)mPt^&AQJzge- zfoHIm$c4wS!0!mbTA}(sv6s+2TI5D|ViAth#k;WGCQdHoR4E+crx!A=#$ zx;cbW%*Fs@X&{FPlY7SrXAL{0z>Y#Of0#{phaxk zn14%{GDQ+M1#->8ITTo7ON)oKj;2lE<`)GB@gE$GpbX9>@qObM74>Y6>B*Hwmg+~L zuCyTp11B<;jQ4-N=h3$i)Xy=>$OGIl2^Sar3)gfl#&VHV7)7EN54PYQjbOYbr6KW$db8&sZOC9?^8? z#^t#&Y$~cPP75%XPLHPbmn2e1JA`ip0euC&?&$FdRxVb> z%`r&~6+Mpt!jiZp`zb!TN4T97zVqcJ_D`X6TtnbEuX?`=IXnuOkzA-%# zJKuL~GUUFCr}yU|i-vpFtra2c2u;<UM`o;tFw79I?2wUfRIA81p zS`BS%o*fBGtifBN-H3os6#K-!0_FS0w!gUkT1DIuR1^T7wlF2H?xD^n{e3R!qqN-|EIVHo zz$V^TN#fYM6zL-o1^HVjCKr^zGE+s~-e4glm;9VV2dPV*owCFa73amB2P-8M6ZbN= z>2X8|oG>a8?VHu)J~5HGCDpFgE+a}@v*&=QGo=QewU@YLq(2ecOBOVi+D4*IMm0=m z)J;wWuWfCHL`qAn0TpCCGJFC}#h)Q4nn0UQ4~*4^M#(4#(LZC=Z&UJG9TZp-E4+N$ zBo+kpc9|C!j2t$|O`E~1^gqy&Uw(OT3@kZYm9OM=;EmcmEssYnUV@B=;G^tR?I|;Isby()i)sAI}RYkw0?%&hTEJ>B8Z*fbyehL9Gba5V_7w%Kq3zM9Wog zAS~+(Q2(uay!ASzjz6L1>l46gEc(BKq$%yJ7f%C)68kE9i9f__9WmX}jb$Z7e&5>K zFtlbYrp$Y4CD0@&;fOZJscx!)`>v(T6{f}=xQMg@7jf&abaEf`(f)1TK9MZ~ z!;`mP#Ua~-{}7$ zV=*u>vl9HD_Wvhi#kPW~WN%>6$vhmYm1smYxBth)l1>Bw3?h+maJP4)m5c7`QjS7P zKUDe;YV%df>}+APS#eK>b2gv2*4am*U zPrrb74`}BdhqQqU0Z0jCuuk|{iaZtI4j@~`feG^bMhDGJV1+p)=%2hiJskyVb~g*; z(u|yE2Hfsvunqtl$2>lUY6SR}!zci12LH*#gvO#3n8LdLF4sY}f^-Jv3Ivb`;;!d} zIQ%|70BQi>1k8g2x0s{`RKXQU;EzrHWibHyR>cP3hW^@f@%Q{A0}}pq0L#i2zQGMZ zfM*znGJtFa22?Rk(J;7WAOk=!de}m+ID_$h1n&eIa1&@E59TKV2QnF60qida`IDO4 z*oM3Ya5i%U+xn49d|{taPAw%wOH%OmMgTdDdFAG#tVbUIuDr&p@poHA19A=a_yMIE zK!BdwlhkPEsJ9aCkE0{-tn8D?6S4RkuMuDXV8_PBrsrn|IEDb|$kuN9En9nZ0Qf01 z`J?rl>>rx~yacHCkpemfZUy1}De&Y3))fTENQNFCyV{HT6SKI!27s>TgfReX1QMSA zHS|XcruiF|pK%B30*2YhGmFRVfBkxTOI}#=&=eqa!}|}3wVpRNN{Hsk) z24)0r0J}4WLKo7cl4FQ~@~PFFNoVU(GX&1hxOiyk1WALvFCv_bLCj zW;YM~n=K9c$k zD(2}1P@C8*;zz^}P`$Jt9s@H_{lb3W*97_#yZ)B{Z$lOS&htr5{~MePTi(%4!0UgF zr)B{ST0s7!r(g|!*nOaeZuRdYH-7QQe}`c{(0z=;exdmkxxb;E05x)dLG$69e$kHs z>j(dvD!F{9C&*9Z`S<@(b#z20FD;cmjVbZG9Pz)$W5aKBmUs~+_Zl5;nr)^xkDy;s3STgY&akT=K#mv$gXb%{Xd@Lg@?LId@Wo%PhH5*AbNq2f`K=89HZFDQJCuiY@S9F+V z668f)n;KFth9J$iU|#jPCMNB1^rn4wjL4Mp-Sx7z0}>v1<5lD-`CMH~)$58folmVb z?mN@TL*y$X#PLk;20PcZpwKWqV4wemitqu#Ya>dJThe>Y0sUr}oy@Zs8^Zj>~Yd zDz}j3E5@pGkg3EpQfAUQSlZlCn5=F9o}5fXpUFG@uOCHbwG=bg;X;2b!xj`rdzqs| z3W2LN{bjD?jW}DYZp2S>)tCq_JZSGuj}n&5e~QSq<*W74aO-m)NvlQQLuYt#)3@AzB6F(W-5TV)|qzi7%{)0axVt) zuAo!`_}-h#t`#`ZuFYTTiYE`1Wc&U)3Bx%f;z_5F6U?rq_BP=2H+jI9(1;bo+xOjnP)ONoWw0bQSr>P*C&QKCA&fi?UwRkvKMz~)X}6jZDEA-z1fkc zKS~8t9v34WG3Aln+OzZBrG4u+Z>;`(kK9^?DQ}&rOgCbMkE%!JKP78C?Z}G8vvzf( z$R`mGDwyx7;bfKj)y}%4_r-J6pKGG$w9v_fVti=Gcf=%U*7`yCn}i!VkxlPTY(bF= z4CqXbsRpw7=-PySBc8*fpmSOe-S0{P%}1tWQL1FnIfoSjB|ek`@M77cjJ^jVM6I58 z&DK4kb5Kr&WOw}ZT^?R|JwloG7M zp7QaU@JvMv46@sEPsUf8-VW)Xna+!T!!2_B1iA+;hDxsaP}V&9QY%i7_FC5p*Q)CB zkDks|`o1iiljV!4Yk_Vc%$rdRP80Ak3sFb z#Ogt+p#j6TQvV}vmDb%R$f>XvkdD7EYC(0sRsZWkehyTUt{-<`&+iE~GE>&+6@DP@ z<@%Cbp*@r;(5#;29K2`IF#f6V+aF-}_b`Db%=%0Ggr$7k8XP^OsS$MvZ|G^{0JXba zq%xtF2iaW*pw{eoymyrB3~+~5Zi{v$q?zt;60#<#C?;7)^r=;XqJ{=Ddus7(T)Gvh zs?&x?1QPCjzJj-bsyl$&o{79O^eSLU4D7wYm|CY7g*d|pQwH1K)*%!}FWZW%*TLDb zllCn#rY6!mMOs3B&EIGFTls9CR%g~}i?xzoaW*Ao&R(*T3%EPonB9KPcz%Ty;uGG+ z%7J6d5jz7rvz_f2$i}COV7%0B|M4!2j~bqA!Kay@7F*ox`l!xl?I021u)f&SoI0!f zP+Skk(4={TP&IHs+&@V7=cVWL$0z+x*z-v|S*&3vs{!QAW&6*RMsuQOz9Y}`V<81B zUv;=?AjX~W>Nj>Kjt7!S83fh?yK~BwyJ2H#ppk=hP*H%sOgrySOti~|IYiBY;?aeX zFC7+nlt9@^JkOx7Wj|Hpa-|>jwO7UHv%sKa2&ADR9<1o zzO`3TiNjYb?j^Nlv4wB_b@u9`A(Puo-ngNJnb^&=iYb9xp%hL74M4hM{*FEm{uSPk zx=%kVL|lu%4reK3f|!lTG?ZA$V(B!0D<`c;FqswoEVSZmhW!otvi?I1Zc7)t zjqw$)RGB$DC4SfirLB@{BuY8m8BzUYfH)YoLds6N>@ztKE;P~>W!+4n2z4$Yn;9(@ za_vzWCuOOMF`w9QLrVL@K;kW^Zk9b72Tx->MBJI4_=_MKXRDzto5XM5GBm3>Jlv(6 z#aJ9l6=}J5y8px%g=tA5cb_xbI6E?$nb4`%0EpUq{3cS5VrF?M?NQ56I zdgrRa6Qj=QOvWVXQ?-u&md+U%)wML2>ru}9q~@C5S;B~T&LcKn%3h(0E6*Cdloo|P z6Rcn#(r}hUoA(D{>>F`BWO!pe-Ga3!Kh|BHvweoPIJy*^=sur?im;(i`&|4$oefR` zMjIBlCW3ZIRTGz9)t^YV`4uPh8p3Vr-=wb5dW~)0T!X611=frgu6ac|66Pnd?5-*= zA#6P7T)SU*X>>2G;CpTAW_VEJ@F+6;=Z_ao(HSfZ#z9dSu3B!hK60<9qUbje&8Lyb zW~?vuo64X(E^@mo9g97GlGv^s;_aKjQy8;{3aOz^HO7Wf0?0{ewt{(N`+Et|BmIMR z9r{ys`JpNA&H=vyVs)(kW&G13cY(!AP1Y%DyqEK#Ro5=8A^UxVr4>_m-DM(x=tik8 z>@zokzWZsDHGoa{$1wL~0=~V;5MaWH)$Btn-iLU3lw^c%pJjL@K}>Mw>vFTw*Qu8A9CI$Z3EXqcCxr+>2a5q5cc+7Ch*@ zk)n{Xfqa`(8CT_v)`eb$9$QtP?o?=RxW%c~!o5(q(*!PHB=ys2kz*;(`4I^-C6thW zaa4sxE}U45ZeS;v@fo!_I9ikH?jAi~mJ>N%SJgsjMcj5CWwF}GilXur8&CZVq z6^uR~>LQR!mEBUpYLo3!*t{x=nQ9mcKVMVyqGI%=A*VE5zD{x0!e#Zfd$eA4mReoU zG@N9`EqXNAX&w;$h5^rU|5e?=Rg0(ryo}S)$W9ohj*QHk^?eB>%no=iz2T$Endx;d z`k=8FEJzb*PWu@aFJ0-RoC@S?Z8o-zQu_vxBBJ#5^S^CW<`vZtyKbHA056=)}p_R<@Ul~$cDx#w;6~w!7eXVQM~W9 zW&AwZ>rHWjL3{_C})x>fS!%%R2K(7dy+J@-2)+JSfeD}3UklgJAvJ^&m9}_33sb{eU!RGQnWDAEMm13c7lAuf~d8~ z=b4fM%kFV#sW;qXdw+bY%8jaR)g7naA^h%$mgtZY0`UYP1`fh!B{kLTsnMeD+SQ=D zXq1gt?G{%DcVo)4Fo7s7;mHCiI{Qgdo^Vx5N&gNpSofA(?IvyCm|YM z_gb*##8v68F1um#crc=U=s`j*RKv~%b36R*{i2QX*?|0Ke$bAJz$u@Ox1W@L6sezW|gW5{P$CrVr*e#=A4KdnG@j!kj4@V->0l7dNF`p7EhI)(3phz0H^KG z+YWbZuDZ0Tgwjkq#gfnuvjby)0h5D)wsBvX7P7SA!i%X%Q_YDSKB2B}5xo~PGHy20 z+)87){9FMCAq5(iD34y^%dr_9$3=iuOEaz}u2eD{@O2v+e9XORq*an}zn5 za*44N5v21v@Fx#4LV=pc>z<5SU8oX=d)j|R^6z!qAIhT!Z&Q=f5L(e^ z+W9pzZ=O|Q+OB;jVP@u8t{2|zSRo=md&$>yZ&R@!p;XDk*67TcOHH<+%w})WJs1%h zyu=f-Z@vv`nXl3m06d?jTe_3Yvx+-2jpKwJx@E`OORkWtxk54P*dY0Jyo2FLD0MP- za_8`m+%)*WDw>6_`8vdM4Yov=Rs=x$g8YqqavSt`Y3%*k4q)=4AQEOOafY5Y;*m;l z7D~plEPQWk%jglaZ=ioP2~C)5kr(CTrPUv<$>!w9ViW7d#?%h%lhfI|DeJk!75N{S zd8&tlD)nSM#SfFqem&!=87Suot*#Fp3Rpd8Iewo3{Ec_L;a&chzmbD8T|-JH2BA5a+8dXN92#W zPJDh7&7ZwNn6nyQp$%%ID!gKKu_twP1*pDRPlK=Q*Wpsj0L1OxqcB|}4@p?3(UlPk zHPaJ?xQ_yF+uB4Oap^J=C%nUn&!Dg_-Wy?;oq&&`xreW=H7)(xah8=H;7j5O6hn&X z*0bzh%B<^{H z+&Xd!@~Qt*%iXGu!UJV2zLEoLM#10p_wOcAK8!;g#_2~XSzCLRA!enB+}o&o>3UZESQN6kz3vgg|fsz(dth`;&M>OxW`Go>bfYo z5jgpNzb5P_dDHUVIMMM7GV*u52PrW=1Kv8W!{0LgaEFU0vY}rx1a5)*)0w%mDRj2h>BuER^KBnbZj4yMI+p z9_!srNX&>A)sbeaRV&!_H+1`_TuX)OcQQcu(j}SHynox&$}>wd!pcK{hA6dqV5)pu z3Y*4ti+9M2uuJXiqL$Y>NWFz|Q837(F=Yj^+Y}r6v&fqLd``KWX0|yHOI|Ly{A8_T zwunPC6P=Ig<|pUI;}K_j5H4Mu2GbzE>O!cKvng{gB+}|u<9Tyrw=LelguFSGFj0b# zZKDg&q-hx&ci^RmUp~iib*h8QdYC2Gm?w z`CapU4F!dWUes5$axOw|NK7-@f(1-x@9*dT5^cBS-f6r9+Dz;3Q$q=#Gu!WV@^nFd zW4-=N4z1puUq02XZA6hSkps$QX)NgY-mxf-WzT}AhsIW~aERkl1Di;MqwgJ6Lg?#m zC3&~?-IO<@teflBX3Mi0@z7^yyhvdn?s@&o37KK}?{<>Su_7u8Th0~ZB`BU%84K>a zfJ}nTX-H%|(q*c>hjB}>2_kN!;s!QI8N{_($CB()OG;(DK)vU9J&_uFIm1qJ8`Uv~ zGMuq?g-$?sqk$u6mopJL#;Hx;`1X3bX(sOSHs6@DMwKN5QjPaQ*1DD?!|8Ia<@M>~=)t*B6`xXR?xh0`>>ok4smGlv?3D2K za_MwQrX;E87JJbq4az@OUq`6W!S8NGrKDsI6Z8#qRzW7XiS<_u#aVb1!?XbxAR-9m zkEAThTu$0MhKloWn$Anfj^|d!7Jv{1xa56XSU_4?``4NDtRU19I*4JO|J0c(Ip!5a z(e6)uB)g@a@W9C(5_1~12GUBSJHeB}XcT^ORsb%H|4fC^hltDvw2*}n+l^^2-ni1! zh%l!VYH|IAVRAM;CcTh|u%_o=APFIF0K4pVYn>u-7W?^Q3mG{@XrqAlfu ztYw}7?mOUul>{tnsHXEmNnh|(Gp8x_y1ui=`?r434+D1}FWq<16Hk6nG=s)Iwebx( ze=SHaT(&yE!NJ{xY@}nrVq7v}wGQFn#8<$FsAk|e2mUG8V+F3IsY5*NrK$7lx5tC~ zE_27rvQS}1@yE>IsG=C?9`cCD@|ymO~$Gt ztuzW~@e0D_{|{sD6e|o9ZCh^Jwr$(C?fq@rwr$(CZQHhO`~Ka@NxGBsa39xeJya@d z%$h?#P7}?22)|#Gu+i6wGCwL5tA)7IqX}Pn>B1*olIR9#E46G00^ zf=*pTT;{a~AhV3Cp8TF*)ud9paDTbWX!T2s_iJ6WSffYO+J2@FEv0ciV$g&tHzuQNSk|cVwQ;u95Sp$c?vNve|`G7jK|ygtJxc zLQQAm^-TJ_XN1C~Cf{hO^}BoNOFg*W9lZ!T5sRy9duMl70lpA!rjt*GakQJQTRt`4 zV7iWPoHK9Czk`uxemWhg29Jw=8;~% z2T9+%exTPf;Bb9zG%Q!r!wjIinj*Dz4CX2OHbP}O#I%P|au{KNX?U}7(zHX5(Yn70t0|J!W}j<{1-_z7*&u3$8%#lRSZNkjXr&)VAl|mwBp(3R<5yP27hI zGpO|-)3`3?2IwBqcNuq;{O6l=pHaK+J83Bw@!wwG#r#T;h*=J#AY|z&Zi$Q>R{{?) z6F~^){lJHhoARNV6t?Y7B6c-fVUg)%d(7|l(*f^~hMYIoqho`rueXnrrul3@8d$FQY@I>JQMJW$CAityOxvz{SfkWC7sieyBkVmrI^q&eMp$| zGW-H5l8PczMpg5P$Qt$JS!O2RIEv`KUo8?cL=JU}pHL?x{8E%$n}18=cARqR=+q#0 zSN@{A>1Vfp6k7PLzAp=B z)QoI%PE%uPKAI`c2mEB^YwPn)@F)4jf+ai{oN;hJ~?0QE8IFiz{#8Vn2 z#BaHqjeJWL4V;Xiqa~u64a&qgXoFG8{IdI=Hj9~wkfJ7T1Z4ODiCzu?^ZWN{YOi9> zW7pD?S$T`vI8RX zD$@wmw|>uZZu_pKEo96?-(sb?S_q%*b4D2xPoN)R5aT3$`<91M*&Y1#JpE2-VQ}>_ zg8d@D^iP0E=VoDiP(cSZ0zTQJzB&f=y8OCywk}W6_L9Hp{zNkVsINn_)ZT{PitWIb zvR+6Y+i4Au|B73M14`_XTKNi6K|z~ZewAtTXJTgg)25j%GKV4?UZFAUME>+Go;Z*x zvgrA9JTo^{ZCpL_BSFBObx&ATbW)I>^hEqM8CD9YXCe-ZiAYz^FoiYBrbNP*-{GP+ zmcHeF8i})0F6>knJl* z6uYBR7z`@M71J_;7f}@*2aAHSK-DntFpoNSf(Z)=#YpTTlr~nU(0&`$d~AnP$3%6U zC-)K9P=U|vt!uUa3bC{e%gWiQ5E7{V77imX*6V3}+cVV5IUIQwQ;uU2kkh-XVD-SUh$Rb=F!f zRa=mDSzF$BGNXu-rw&|h5VEoG8$yBoFkw6!z^iO)2q zDQE>V>himKHn?%>Hk7RSLAx{z^%BQ~sc=_va*?nXt$5|%%31zNr+4~(ybJA;0K-+i z+D9{m$XBmiYbBfvof3%|kfu6UG6m4kOxeGptGF5Ze`nNw&O;7?L&hjY9u$UH?aKWp zx_2sb21jptzI@o7)6h%8rFO{8^hk(SL5J-33+C=C+Q=J?wLVc{CWDK=3XYYzRW21Lu|2$RBkaRL6{90CpGi)xelm#r>^OdDNdVe`3gd(>>}UedJZ!$<5t}?-g`9Z)8c3Q^lL_P@_@7oY56u%_6qH z)8Y3?3|5f75>UF#BIm^}P5%$rd{Gw9%}NXx^%9aF^oslP?RA*KF+yUsX`i~)ObC)7 zN(uRnz!f6_N_SHw*Y`#=y}cEZjns(o7S|MT{8GbJFtWN%zZ$nFCOs2<-=K zYvUpaQbz&eW(LZnWZQ>kdx9wk!y>WgsQ$k;Ux(&#edA(Ab$h*82-c3m>GV*IQ^z}c z&KBQjDKR_=+=0nH`Pe|)WJVpGvpouCmNjo318fuc;MlrPJoh=L>_&<@`WI8wUPx9Z zf2ST8{B&&h_2!?!o`HAT6^S5uR9?Ih*9@vbSz8|Y?8-t__+3<#aHkXP$VUZf`McP+`wCkFdSGR?iW@+b2)kMV5+6GjRc>Dr*gx?V%8> z6<5h_r*x{->BoO2;4btE$9P*7vU|o3MQJx%)r$(cA+I=4?eOT}$+~HU1;|vn^;xCZ1q#Y-^S)!Vo*zlutHWlEN`k zvlGI1jYtXFOn7Akp)%ckare{SPD}kwIlrgLh7dHMc?uzutFGk#KFt>wpOXgyJ5!Fs z0ci8|U z6K>^Fk}(Vn(gQLIw2QGtuq@)y5G+KrIzfxE0Tny%%J=^K-oEa1uXb6jdYoo`Uw6&! zn)1%-8L!TtCN}%41*8}#65+?`DFEZwmc1YlP`vx;DJVqxM@<35garJmL9E3HIDlY+ zq`uj8@ZcIn3az11C6cqqV4xJ7LIC{X0R$8w^V5U#2?Qh*6u$Li8QMVv1{Pthf#;9G z%LnoaKmfCNrZ%xxe6 z&xfi92#U}6mF)Q%#ffrAK|r>5c0Oox5WX4OcZ}%t{JAkK;OBt}1?<`5VfWR$0BEJj z=kG?}A=d%GUJZuvoA{>DE^Hye0TsX?*0DfD^MP~<*a$cPT-XHkRe|$wU;=*~R^N~M zq2I480R(*a`<8xCf2a{LKDpNyH?dBSts!4Pgl_;^4Im)$Yl;Wro&_F(XbRZ+aA*l3 zFsODHXOLhTnuR#O>9&#bNvfdhMPA<2-5{(u)-faY#r+BUxKQ3xz+5IG6|ga0?jR%HQ%@XfZ5}zN$d6)y)8fDb`0&i!1Nbz$ZoS+h*W` zLBb)RpdurH0SV9n#)mfb_SGGM<;~{p?%Oa``|8@5r!ftpECG+9TS5P8S?ESgwIu*R zx`ldt`MvAscLNb1=m)co0nrG!?pFxxYbu&1*y8tEK0Yvj_m3cmbQkd7uiNWWH>I%M z=+8%(>)Y{zR~OJ0RTf`}KXV)U3q3wIzyq-B1uq2PBSaJgP*9LTAPCiZ|7DJfC4H}> z0{M$o4cQz7IP{AY-C68|a{aRU%=Uu}g1(>A(PBU`5(Jp-gS4fhATp2n1o+!y`NMte zYxq)6{R`Uv(~L``26@Cj`3C)iUtWZSdH9AFe^^0{IP4{ZDFHb5>*NFcNvI+l2fMy} z&MT){L@EK)EXO_GOM?)j2;dc9<1#32`N6OJZovLU!T^B*z34~S*N2Dlho_);$H$OT zU5zal2M#zqvV#aln&FRA3Dz32_N|bX5J5434Ab^R$`^~?i~#5kpupVp=kaC6An1n= zAygy;Q1R*o(8kE#U*l2q0FA$`*B1-)BWZOF8B%Qg#aY$Qw12-KAB zbuRba@Kz(0zMF01BVnCw{Ur&Bn)3qNJ@gce&Kg$Dc=(6tOO& zuWGX({8FY7gc_*M4d`73i&#b0dd|~~T_b5B7%ugniE&X9Zd|6ehW<@7(QEn9SH(p+ z%6<-F`#1lA0#3$E5{k4Y2Qw_@IpDqAT5Uz1U$>2p(^CG{6Bs(c83glD>LP%X(y$3ab)iF0}CMBj;$+V*L57{u*pk7kx7YuHJ-nj++C9O$i_^Qda%A6ah~~N_8^S3 zWXHZ((8$KEwCT}yj8^YEN6D{q4HOmoA}W!&F^wSais8mMz@h3VUutuHl|GG|TkO3g z;8KJd@)Y(ZhY+4zC=1WQBGnHj7E046IP9P~995Twv;KoCmoT7sTYU@6+_aisq{CxQ zl6>4%q201DA&PNCota0stln-)&b$~4s5uHxLy-$_Q;ztzH~zmS2kYS1fj6^cH{Atd zWF{&w#QMzFro^$JB%<_VdE)UHZA>5yH+eLFBFMdw`Lu5=bNjaFrg;X8-B~i&JJiJE zCrmKv<~S}%BOZ*(9iRW)J$7%|Y}KrFh9&8P;m+yecA>laADf(0$_I2oll56)ZB76k zEnuu_x0Lfe9#_g&-x!>_k-Zn2LIi;tz8QIBT502hMsG zwF|;OtAFwTm60F30rR}VEVOcIWn&p>#pZFNXuNT*Hg-xaADyQt%z}vfqq4(dOJyieF&EvqPhv)hYA1PN?op)SjF?rG z1yaBZ=5{z6uZ;lp9P)H~tHEz$59bZ%L>RuC%H2%^hEKfqddSk9u`(>9Z^Oj)l`ubd zv)T8)hiCUz$3gxXI;4=0=yY39a)naJLF^Qpj%Liufp6mj$cs17EvM5>;BgIU9&L;2 zp=KpMa|;hP4&@34)PBsek$wGmA&j|Nn}+Y+W^T>-OB_%@#~D1H(nfhzJ9CJU?a@0R zsYcf|$*oY+AC%sXan3;g)>?m|tyoBjoVsB#mOQS`AGT2>kuiA*9}8P+E3Lnmp7AxW zob%f1Ma+*3V-N{W;=H^$^I1Zqgstf<(A;>P*i@5JMT3>uD`oq8Q@fFv-=l;r6r%zM zYRBD_LzaxgZJD)U)X0Ho28vhez%(z+u-MB0Ye7<&fG^I8P1%ofv4SJVu^J@?8kWe| z@vvZN6Az7j>wMj2fU;^v$IjX!6(~o>-M^)bNBgy>iQ#V$18@u9%_^CcuuuGaMyr#O z1a{}QNV~i?C~U$IuC-lPjkck>Z9!RfeRmV_7K&^^{p278RXF73QecX9b0w%RzbZg? z5ZEg?Qh8gQ2i&=zv6`|h19FI%F_yC=Z6`-_X_ZXJ*! z$CIZEFVdFM-WBI2zRY71kLtW1>0Kr{STAdzy@<@wH3ocje!^oT;`!XIx;!H_DseN- zPQc!2Ouyp{ui+n8_`Ws`PRg8&NU<{Lt@9mByQ08-DZ2C8bO-utERJDcJ8opo&HmBl z!8>TI(NGuu=H6Z@(Z-lULYIpGO^n0XK%n1cd_qL2e&+Sgzpr!e*uD^r-jPgK_Wea<&%X?rPn$Cn-pnSilrC1ird*S4`@eqP^Dn*+mF}N9qw}l z=upVBIcU|#K{rHJV|7y695I+q&5J59E?5h2-Vs5+^?Wkyv@1eJMyqI;RWGH1f4jAxd*PKmij4qG6A<#d+_LN`lz4SzH0`fD?oYnZY#iVU62iFZsncBM zMvZk`u_MaCYs z8=`{d;4fl@uLQX>$gZ#z9%q`zW)S+!B}=JyIVJ^DMAG(T@9ew zO``2NeGP%X`9x+MVOY=;wu1-yD0Pxuxq~Zhyk$m-3LS67O}nMICTAUvuGa}q)!kFF zN)Kq|wWWq{(`PjzuzL$$ZssfTxqHvoEHZT|6*JwAd7}lmHifNqUy~2P1y>`Fs^d7z zt<~~`a0IU2UHzqHg_R5|(g*=z5;-bV%r2DfKm9C>kuCXi&SfC9Mmh0S`a9sb&;Ymz zq#}h}BkL2L-HTeoU6M){C_jk9Q^BWiXwnsJ;FJ;#)X@DiNON)vTg)2Cz1>>rhL|U9 zTld1Mu;I`&FU!ds;SB9(U0mKB4Uyd$O85WtAwDH%2&Grtx;R2!6<5N;e5%{)Uk=~G zMR+kUz~ZkDr~rs8q_5m0%1LtO#0 z1{Ilq366xoT}1Z`w<6DH!jK|Cwy3;TVdIOD;p7R>o(zl5ov#eF%A6 zV6hpVA}DP1A7v59m?{Tgy8yoo4gp_WYS^*xwP{~hMnU;_4sWlVp4IU2(=UQy%ng=4 zj2aSXGwcqtDtL;W(%<_vxV0(rc=DKA112Cf{a#`Z?A?mCFPN1HeIMY&;M zv5^AskQ|1^zAndrJP%d|9Hrm0mxHaRag_-TW^iYdoZK^o zWe-TzaqLtNt84!o78(Z?rkZzXFQm$dv*3he z9(s5LRK>?Bek3+T3x;;Q{B-SHjdo$OJfPISEKMItcw%v45|>LW1Q>0fdf7QBRkCD+ z;p#9$tatlSIfofHJt5)&pW$pZdwo924j98g#|!{pd(;kuf?J7w+-+NdN?SW9BhIoTdm zRI>4_J;WSoiRCcY=X#upcYlVC*hVK-gcsM37C{8Qov5s&St~R@R+Zca`d_Ic=>P|>$06@ zK*pyxZ&WgLNrmb3{)VnJ4~$Hi1xhQW)CxYw7%ir$6cE%$1>;?VlHxTuUAN&O8x@m zA;g0G_FcKY%4ty20Q|kX;|VFUZDb8~(%db~S`*4`b@F8Oaf+kdSrc3 ze=m#E=fw~2x#-8b(=I1MZ#lt-0mZxTLg%g*Y?blAm zx>3<}gLr#klrVLYHBX^9I-=yavB9F+A`z=$$EPX5TGeyxR`zw$`SK=`Zfy;6p@V;) z%pg0V4W5dF9fuqzCif1ob<8zG!Y*-{+7tmZc&o}9``Ics3(j_jhz*J>5Z)FfY5RWU{UJ*B6ZNCk_T#vmTUJeGo)^7FbsTw`q1WMpU@CA zIV}E}dna21^CiRJHo#T0Gm7sb(({k++$^rb8q79;7+w1jG>(VL`w&Ks%VO*f{$*Bl z=G@n`Jh>I1y%M!{@{gt(-G$5jR~dv8DzYb^A*RHv)~brjrkB%lbPcw%q;MrPIV7aU zP3xq}@=Z-CdfLgy0fdtSYBF*`us12v16ro1n|UxkIUIWCz4FPtvIsX(+ZSb`u+QZm z9ZJnD-X)s@9d$(~0~@jGTVoI$aIwxc_YP+mK1-7oXX%4ydX5ekUwIz9WO;{c&On@U zZX&dK*!m~JO-(V~RD)@uLx!PQypc^yO4f36o3&&Fj~?@n&OKc*x-Q*YDxtTcM0?yx z*W%AN=u5O?jJBw4hfP@qO8^=-F;zXt=#=;@OF779N(~ z^H2J*u#bq348t76ZGteQwzS*bc)w2p6)1|o+HB^&kH2go%OV3c{dte|Bf7)|F@H`)M zpg2@6$r{z{G}zI#8K;Zen=+J-2|G_2G0AOa9+*;**gvRZnd# zvmtji^EZ$~VA%ep^y<;ShDwyGa;8+qA|fK6Y_uSHTKMhze#jxigoY)50Wc zG~S)KEzwUpfw=nsq1_pqd>j4rh{q^3W_Z`q0TL#^F?PxrqDb`-oM3f5Mk%=o^a|6H z191Hu7_ROx{q-`SAMP09LuHPxJJm$}E)#+l{>7c7aR;1b*<++s z+a53A1f2+;oVtv@3-DLII?hLx6v?P?!&ct+d_+f;Vv0<5*;fkla5LW(USe+9exiE+ zvx-&2@P+u%S8-s~3$q?<%;wtILYbX=(yl|XDfNQ)WeM~Or$t%Wib?DX=rvhGelJF8 z@RO~!+jHeQ;m5BhGUck;8a&?z#I4)=z0HPv38FiZw4aS9J%|SlQ~2Kz#?TzpPCiBy zDR|mE3ol2^O5#BEqjv=iF zHNGW^@$XwSu`I47dwdy2;!9)|@h7gxLRPU}5_~)OqTrPrV zK{@^PqcX2|iXR%R6}DZh|FxwWf`|$d4W+Kzy$^vY8e>m9?W zL;R|*405dL$h&~O3dUwLNVz$|-OWywioG*O?S?1infs$u63kokF;~Ez^l$A-1mDTd z8LDtK_AYK!rz_M~<$cW)qcBA&aILvt4nSI%uSYsSc^!voU_mCIK@msyq; zIU=i#Adsf6rcC^Bl7WOmnOVP9-#UfL76QFYO!K=wO*rG}6g~$TUbh$=Yr{UEsfFNe zvfJ?*@O>ody$8n37CKJm`>%@%7IG-mgdzR^g)L7}AgPdc9Unu~4uC|s>w4gK;s&ssSSF+G5wBfJ(5%X3qAA!{4# zl#To}H~xb*+_&BOUkDrf|4P`{Isb>L{Xc|_f$4vy|36`4;rPEMZ0?{cDmR;KKtM!0 zGycwS1UoxBM4Z$8{R~0V^8`7Iq%j1zK#LL-l)8&hNK#?`{t%xry}f7IZ{L4fdu^sQ zyk8x6SG8vywY*Ji+))9HeTBq>fYqV?MeiXX{z?EQx<=B31ON~yhyXw#4;ve@`4kxM zcHDejnCrlhqWvYmzy;TUt>OhXRId~)3h02~<{pCpLPP+BjFf~9lmrL_Fd$ODup;gf zfGXEL`LO`Hfc|JeaAJo|)Wq99y!mpo6wWz)c7Qqrw*K+O#T%dTrVZhEe zin9jn&Z6SDjzM%JAPylx3V+~rNT{(tH`iuNm=CKMK0o+!_UrEOQ*r|jB3;`V- z6vVd~99OiXv?gf4S?_sM;(6HAJ!Ti*-aGq*jG`|Jl&#s*F zo&Mr75Vs)L_U~pzWTR*$AHq$DIaB|<7vTO^-<3iM_7d2Y#lKKs*014|zUzX%XCU9c z9uNrf=OtKB95CSTL^ulOIMO$gU}5?D2B?Vjd9Jh49%1kyZ9Q0Y1mG19@3r^+yh*H1 z1n^hLT$L-($2SR+fC4}~f1VKFIXVCUVi5RmZ2$-`&{msE7Tpj4^wqr8b>p>epNmW$c^T&kT3l`sG4g z$~Bgig;*XIjf$x36zJRoj(*GsuXh4gb7G!Cz_9$)jso`y9nOc_=Lp2qQDmM|Hk?0Z zgMe3x&6uRMX|VNBhBdD%7U2$Y!}Fozy%f6RMZgh$AB=*R+;Adae1!Vc?Z%L=!Prn+ z7*?B)M3UgCe)5@RfhDJXz#B-mUEwmk=;yS{FeRS#`(S8mJK(pBh+K5Dr{y1O!f`W- zuNKV*F=bG5@4MWq9F2axC39dhYB?i_4!EYKcIaUXWGBz z9KqxieT_>4I@YlRJ~-rt4<1P;3-r7k8WQUqI_M;f?{^)^X@JpVJ|IT@&QwY8_@#y< zZ1aB?4eiw)vD-(;@1NcHS|$V8Q2blAK3k02$S%(X}einR6>mI zp~2zXFZF>BBT6mn=gb@PY8%cG2Kz@R6Gz%qpU|5|W?-V$&T6gp`enMcC7X7jd!( zHfY5{@2Y{(^S+IgD(-M}{s%A?qkF*Qi#W+LBQ;$Y$bE zG%zZ0F1Eq!)*)NBtIeteEQ>!6A>}@$7L=i`oL$^J7QlLh5cG3((=X|mF^#HAa#HY( zn@DC1bG=T*HvjEoR(zFsVHOETSRBzj2Z~eg?n|0YiQ?Iz#LB%bU@2%dZx05c&F%xI zi3Z&Xky$!Ay}+ko1JD^fz!2u7Sgs6XWaAZI%&w%`#$^-T<{RyAq<#u6K+tBo9O%vT zeD?}JEJZ$t&{&P=a#nahNuB1E1FrN)Bh8wly-#Z|nsomBW9sx_fp0|lDpH2(7rW$0 zz3Zzk9HPn;DX~r?Pk33c7GY_mO{tUkAyT%&Cu zryfG!t&>$|vc}<+{x27aGeF{Lh*AzxD^HR;l22$z$;w?$i+LuzIsdfQ@ zwv?8;S?UL>t;Zkrrpf4CmT?yEolbys!-GG(<^M(ELT#|)v9Zou`@dVosYerD5JA9= z(O7Xq!GpZ@?2^c7ptkzx8(6LwuF%zt2|iiNaX zIEAqzsR56e@yRzKi*7@zlT-9cF+O_9`FcWaJj7)-6RJA+`jIth9_OXB)F$&aa-+My zcp5O`Q^Fjm@V)42)-~aJGd>9oU=5QbXu+2u`we4?eSM_5KEL>=`)FPU;j2P9mHHfA97-J5OF7@(e%qQSo~fW_#dC}>L?&OC~ba*of-%22GpkTmcWOo%Pzd{qi$ z%zq1queEEQ{lRgiFIldR80m049s8};;gk*EZ=R*UL|qEC^Q~gj+RVv^v1+5AVB^zD z%ReRV?_q!FPZeBZ%9RvO`nMeSdf7lb#JGuR6EDLAwr+rlQ;*T9zwMDE;0=(_MA z)>(WYIO_V=U%CdAR7@Q}Zvmv5Bo#^Naz|^O#^I>;=6hLsW@km_P904s zu?KJPmxzGTvM!6?cAuNsZ$nb}I>4%{p8%IIJbcwO;yyoau>=zM53%XL0&(%8W8JRT zucoC_@7w9R_P9rnvoyif-isfjIw>ee+k>R7%h=JK^#^K}eV~bHd)sr)IY;tK@;PdS z(G%g3;n+v~OInJCiH<>8h!k7+Hq@YP&VW1b~c)~!&)p{d)gVfbqMl3~Z&?}>{WD%WK2Hf6=oj@&v)8Rzlmb&1a2mqyk|xcQ3PCZ=uf zpO#oR#Z8LjCWo3Q$|l62>$aNgBtLh2UnWSjJV+(#;a}Q$JNTI&T`>a_&h{&exBbV4 zt51`Jf~9LN0$w>g;-n3``f>TP8>IEX3pzW}^dUT1oeZeB#6#ihMTF=wVc!qJn_`pX zs+*{(9s0NfmVh+$C`0D$je$V*fMAAwpvQu1=;nTJzU0-@bD;$cR1hh&LNe zZ@WhLjMcsI9vf5}SA#haC9K!o*qlET?((LIkB4Scs2I?(aoKg7)#VC|(VRYPY~`(` z*#@I9d^reNxkmZ`t}1mEtE0Bk!)WKj2s&ro*3Eq(r-wQ?Bv7Uo_5z_9Mrgn+8PT`* zd7Dx&QS$Ut@VcQa(os0pRAR-rd?2W(28+Xke=4e1_8I6H`JyZ(wwvi2+O`kfqVowC zy)@bk6sFgfi-VM0Kwn>Z()sf`(UQFBEjOgFes>P?`)eW9RR=!yAFs`r<3 zZzoAdQp)wXZ1QvwqHXe~PnphS`$oabiKAkswcqu_&ynA4F{`7;g`KkXfSjf@d(r?D!ZXAh|p6;u3r@ z(_#Pkm5QtI_vfRVVQ0{Oltfb!+CM2%!SfNr2n2BjS(&`J2-_6%7saF~+HQH(kO5Q!vttNg#zj*ytoYk!wRr+So8^HIiH@bgd*o*Zd}5ee|!q;qklMYH1xV zBtj>(43lHtfqi>QZfs?DdPSY88eiqY@5$!CBQ(|X>0xr|gJe&otmLqGR5%X-3_jh- zxm51uJo*J{Xo`v5f|=uqoT^Ub?|x|fl9*pm`Qy#~tmYm+6Uwz_V)2Tq;u2S6meyM$NBKtk`IG!qw5U6>t~n2!oZ2Cc zIA@$J(2)Vt8LI?fkbBN)W|0YnfT>G&-}{9q`Vz{HAnwN8&WO}53xcAoeUr?Ak-l7; zPq9qug{nhNDRO&xui;ZZ-DAei;#(qgIITV-ywm zK%-|GVjCCkesJ`|Z(KPpO~xELpu7Il**zB z!p$tx^uPM2b1+MW=S7p7+eLyuNP0g#S4Ne6~5bba`e8&k?QK5Dr`3klX<_g2%2fpdc7 z&E{VzqxrrSZtMB+QAet*)NuGe%q*>sE*RL95oBgAk2hqUz5g5|C}7mrmW_2nUSQzK zh4!=PbI>a-=rGyXcvq}iE&r_Gwr<71sgH286h3NXgm0~P5;7(v{>4 zl#OgSG`$AQ(9NI2!8uUeD$Nf)8Z5f-8mdbq{7?=mOY4x(ha0y&3|rZ>ebGpGZEW+a zyP1lL`0_FK3cU?~W+ijhuz*&eJ1K!kp4vpYTx=akO;fu4o1_^>28CH=DLH}Gkclh; z1ai}kSNYO7D_zZ^A5=0fqxt8z-6M%;@u;bG!lJpfGyrX)U}SaapGR zTuvYCz^4D2R;r)3>*?;=pujMkj~v*6u4W!TNf;}HXq4+!`6X$^y`#^S6KR%c`*3W! zV-er$X_uY5aJ0hd=>4Pm;Sl8ArnXK!fWoTAs2sqRzl{cWih1W{Gn8RZKznsBvyyzR zH;#ThJ1LkBFEr(8)0=3r{G}!H7bLKs^lh-bD-lm|;gGQLDIp4M$7&%d?J{#^CHAlm zrfh8f8r2aAxK|@TqJJFPW>^j5#hlm@|88UTGsa@s_`cmS`U> z`!Xg7EJ8OpX{$zxU-dk4BBV1@rz0In#lhoobmUnA@Jo6KGmEH{!41_){FpdKRNx zsbsCU?fzFdU^tl3oET$R=qptq>BjFF!x?v!=TH%3pMHfaY?Vk5t%^PLi0G=8p z>X2&%eWztT=IxFZH)au3w8?@VVnhaxVao^0%gn_ByrcoIh>O4UW{&FX7y}3kef&{n zEKj;B-UjqWcu&#a%~US#27_LPmsF|Wm1RdMMvG(UYYbCrzMF0?HmL2&m*J6{H9brp zvn=IRHfj!8o6?7|=ibM<>Lf?g^Tp9(Z$#j+Jtw8Rwy@MpqnKy4YY^Vu2xNuNmSH2I z8p=auFLQfs-Vv+r)I5#%R20D8-DQ&G)#M6<{R42wP|s7gwi>5zFEVA5^}0d9rOBG+ zLRqX>_?4cl5&KDPqE(wWD&O0mHM4Hl;Mb2-fx56K!f~Dh%~91c zfgYgI!M&t4e{YQf;>#@sZrol2f>+0qlhYfa*c`^G+3IvYwA|d#0e}=*he^U+|ET-r zZtNLb6aAujyIIrwkM=Y2*5&hAZLnnYq!(6%&#vv=0i!tf>rsveHK#0Do!d6XUiajj zVNPA}2?tKzmt@OkEt>H=uXkLYFfT1pm+iJ^uuR{geO_G8wZ$)_d`cq z4&$-Em-hUQ`Msmbg9|BjjC~ThZz&ar=yPJ5T?3rv>wa(&TwGyq&9&9(7;TvOP@1#Z zn9C?bBT(9}lK>KJ4t^~SGza10rP={lBTXD z2q!zJUpSii{IyZTGE2@y;k`=LcD%y#_m+yTw2 z45O%ldFjyBtJooo^uouB^om0+0)QiY<_}uU7&`{rgL?Z$W{9m*;Z0ges*-T1t-Ju` zYig{o#yw6#vzM3C-68;kJ&2~d-DlqbneVQ~k(vT=*4rV!& zX?|QMBqCA2y*K05_F8DUK$}kEoM9Et<{*TK@24+%lwL;NcOQ6R^I%|fHN zX#XykG|X&A=ebUis<0+GuQmD1z4rq$YZkEl56fm;|7qEbgNf~b7Rs0jnHZT^|Fa99 ziJ6V%zZcH_7cTsEaK)^14EpFU87lmZ&6f5qv@#8ULTIFH;oCj>VX7@n`H45OAUX!EYnUE}$vhJX7YQ+8I$*D6IU0BcPokt zn8r6Fq$D?pu3+ksfq!L372WJDS7Av9s349JG)SlCXBw=ylD4`!g&_h0A|j%zlLRHt z(6D%R1o{rJV+*(iaDgDETR!@Z+c*%Llf;gGNkh>bu(OTOtN{8NlC?Ub6DHw~<_=IJ zSYW{nxt#$`KI{$`x1hEXc>Wa_*teA0Yf?YV%eg&}&V|mm!*kjrK!WgwVB{z@6-k1^ zsU8!`2DBc63kdkkk@})Gx3(I{seTbq*a3=mX9KvhLvUnlb0_~u=;RWV|BY(!rL(L5 zC`6|#C||4SN;$Uc7K7Wj$xF~gyCRLfcLD|0B|PVQOabZ$ti_+#g*mD})dDHP+t2Su zVvV%&_s#8>nw>mur$KxZj-t{L!*mnWB|!%KEPDUw_&C)V9T*TdsDEy1D{dd?i8~kY zx1!@GhQRX9`97Efh=xEK@B_FeXr92VcmC0ppnp{q&g}B>fBW!tbbx5$OKAE*EI>hu zKKDO0;hMit1)jIT51<+MyzvF-fsU`2{dzNa71GhcE_NOfKjSc*D9=t#XwK_DRPX$f zfB!~O@JGZ!6!4G9ii7PR9v%lp+Svzt`D!D8cbe7ru>Ufyf@%!~3jUIPe$D=pU;V86 zW$q zOpgyfl@S8}2Ji-`VH2v$tP7MKDRf+2`#1pw1Yjdko;<_f+YFDt3UnTmH8uP7isjD~ zy@tWObc=lBsbkncH@x-OYZw_^@5!R*IAFg^poJb-bzzlDTBfDrD#3H7eb!F>4fkruuP{x)?C3rIrs z8@>`ebm1aY`3cbjLEh-cBlZKoVR|E&eKWjVtnBLFtTycn#GkLSy!@Q99O&P0DVO=( z9r=mRXo`HLz$`oE(0>QcR0w`Exle|ylOgpwdk4y2i+uweP<3WLX0Mjb0p%tbT3%ooFT=!d$O!Tbx$vHS0#_bMo7oJ;B zA#?pM{Y6RV={BB3&_TP(*N5rR7V@0ab)eqV^93vK^=}67k2plXnzflkOZ%d}H)jO3 z>l;DUVSh{c>WrCnA6R>}oAa}n?ZSbKX;gIR%=^oQ=w47S`Ad1xw&aqES>zuw55$Iv zGwGd-kPtpx`wqhRWGr=s)_BLOyqMNW$k2fUamU7h?pi+<$9CGlBD0#ttSk2EE>UUH zo$67+OW3ELFN$fCW&e+Fx$a^jjB}*F>S+f^9QLHW^@M`1M#D8_$W6^Q4Bxja(jh<| zhBuH_Y5VsKsxKCJO@@qL#^j|*<&je-%3)^DALAS8>Z~ail@jjm$$G9JDs{c;1~KUg zo3Af$&wlKFt+DF*H!6*oKH4IZmsF7&)BDBw(myxe)%G(T2Mld7|I9`~#TOQGZbSxZ z#X%;zF*%q=*FIz!ud5Dsrop?S8v_GAJlNB9n}$DCJeW_vwu%461S=z9au+Qlx!`Iz z^%=>C@nDYGUW)Im`NfM*t5+}N`k1~0N5-q=CVFGm19&{@sRJ{Y^NVI3ieo=AIgB>V zrFK%tJ%_2+;yWB% z-5Tf@e@C(Gd$R=nC)5U8*j6F?@*C3IlW)cd_vGn%w@(o~42_?Z!}}RoW&CG3Uwe z6i)2Q<(FX<*$Mz#JDAWb?!hC~NUFUf2YH^ZO4HaZQB8+V*CT&!qv7OD^__VsZ{q52 zMI@eY@9sDrwy+XggUF1K4VoqjW=9I3u2oy{gqURVXwAwc2DRk2mg23yT>{qz9HB#V zal=w|9L9>)yRc$xET=Ka)NfX9!mEkHsW|sb3?4armLZYpl4gggyKn|5ED3`-3Ia28 zuSqUEy6Uu_?vMBH+Sh}3+W(!_?3jEe2vqf`JZWUs_b`;>B6xLAxDS-{$jX70A$NsA zqY4d_qb|Y`b%cu{_Tpznx4EF=Hd=Vyshz}0kaz9Iak1w|HC4m%@6ax8ttD4!bbdDt z%}^o=k9x8tC%j+YnCM4VhAbNZ8Jr5wVJD`#t3xHXAG)4Xq#JYSHPn25Z>C|_$l5xDEzDN zvc8wOT~W|M=m9q#FyA`88M&qxg4kfO618fW5&cDrg6sBvRY*=@T|ugb?tRAWw+MCz zX`XOpQeU}x#6EseGU(l0Rmz1BmXz_h`x8m|TaC!b6=gfnXo3nBh#9SIHgI+`Wc7c}H4JRz(K(eVI`9#4FevLQZ8{cNS2*$z z@*2BGOCGHx-uDs_Ox?wtf4GJOuU{!+iP=VhTcrSslqH8o@gn&}C@$AGZn!}~3vwNm znYpq@H^K3+G_?oaRL+c=4V;8FHzGCEz8&Y=+C_4!Fhmh8g)h5yNhf*VC+k5=z3p2q zO2G#dChYv4>0KrQzr2Ij{9B&yz1l?q+VY7|dX;uR(*c}3^qngey`wU?HpJ zEh?^k92l{fGjyG)I;Wr`zCfoeKPXyiZhK4}d*&xP&3Z<4x{n#}KxTX*Io65GGBX}9 zAKl5PN{Tu-J>8Lo_O%V+56@vcl&dMr6dcGO?%6@g$^Tw$$KQg6o;iI&t_6?+c$AFb z*&}t^*$v?uY^|3MBI!W85$Ugc6GlyM$Jz*Qh0XU9_2Cg`&sl%tII9JXpGzHszA*PnG zhO-ox2N4AfXh#hVYl$l`WFQliy?F+rLyAjfd9C2_(04>*g zH&h}(3I<`9RRb(5-SsUYAdx>R(P4ehw9vHXEd4VkK6$gf4xo?(57c~?~MYx z?zxW>;uDKzXU**lH^XLn>&?tvNshmmgBuqr_LjTS3KVcwv7NE%ipxd;Py+DevDM&B5+cMH7kUH~r;Buz9#42{7`wbCL(AG&4)&>qn5e zFg=QVeVth3RdvpJfY`+=hs>p@)WMsAys7Lg!i*6RIYmpyqku43b0fw2`roU%cW!Z6>) zL-oM;M`NY-#$zC85U&9ivt$5Xr{_0dx?JquD_uTrJbTu^Xu6BG*6bi^JO~^z6$c1w z-mvUwobu@c=%Glg?_l|cX;SZc^ zf&WjZF>A35VdrsA>l(h=WWk5+CB$P_!U1eJOvRY)rEz5LBbsQStGo(RLo<&CwSi@0 zKB&$8mrfUP7bp;qOY=10*#czNxyLFsGRp92&21^}$e=!7#(GeSM&Pb|FP5Q;a*@v? zo^0s?eHdBOXwfrE?Hb@l|DKX$4TenF9Dfc&%sZMz!N`7+`pQ7y5f2)0q_WfT<0W25PEy-<=n1hPm= zCK3Xx^%#VkQGt8uPRren`U;Xtw`dm!Uqd}3s86GST9Jcrs=xtx*SzmudKM2U7Ppe7 zTzcD%@W>OuYNB`CX+EW_OoX?B<3_S#vufHm>ailX3`Atu;xKLPDOe}$Z!)wZ`+=s; z=K@UfLntD-+LX4%{Hriyn76lCvsOogRQZvknNnV~xDO*8BC2XTSbGzOcm78SLT2}GwU=niffw4CK2;*o{GeHd8#xtDvI@8qcFd*aHlS8oRnt8 zJ%;jb8!RUQpVPmsuSnB2x|;{Ca(;r(mK=Hn5>denI!&QhbS%{n~D9&UpG#qrcqIs{E5 zi^jIizJdFz({w2LVY1beB4u~oou1pQ+3vb)!~ts3uDr}}E;q6a1g=Y^F0hdCWY zrNjB#dp2Z4#1^f3mDwu%^IJpkrNH>Z)F|$-}K64lwqM9_AVT$T|ui zEqALnc}L~hzZLPi(wSgb*e_2n-!8<>pTB124W;TcPa9OflF%jH`Xz{yhhL_h3w6VZ zbSQduciSjQ!|8}}$fRD-&_j?aIP&jI#Yir$C&FLf@3{o3J#f`o-L6=6J5jqRq~UK` zqJ*jqKB*Pkx*0+3)unfhCiHA>Q&dQg_v+$I8I_V)@*UfinMy{i)9A zzuh@cpAHHc-ba!%8h{mcR%%ox?_b1Wf?v&6(vXD3YsvHP&B)H9xbBS-lze$%czk zfq|M3-WXEoDAy?GS>K2qDqy-^tCMDvfG0=$1k7=;k>+vSb#Arv+~>FljatJtq>zlD zNhh<qSv?<;2lXx>iPD~fgh(( zw>`et6O&E}uR=HDYvOWQsNi_w!Q!!VQXR}Y)3?fqFIKVOX5u$|A*@-IIvt9?Uw}Rx zG4ZW)wr#OJkfMG_T5fz1C9)vz&n1TT=R6@)E@DNUsIRAnMG!-K*6+@Kt@z~Q#w-zb zS&0@>?elQ|4#5UYIrs7y?aUmT(}I3gM{+Csggz*Jqh0X)A}tjrBKVCg#!JQ&fBo_3 zU4ucYeAUafN8y`7h`gM*t*a3DBt4JbQyo4F=fO1bG$c-J&EGfQ;i}(*$no(y0|lO4 zqRK~mttLj%>V6$Nl~C?H+9e))5yKz9)s82iFO6D!s}=g?5aFIevMC$iu!6r zFf)H#CuLeB&Tiau^#Ed#emzHyGuMaL;?6~xSH4bwJ_9~PmD|S?}Pr(e`ib!8}hW0cUUYKfV7^)hxvvd`|88h2EGY##q zu(cXG48*V>`3Y#T{H@wsnQKhMLhAAQT3Q7jERcr*4oc zYh8dcr(u_xdlgXxUVDSt_-w6Qh0IVW(l@(mZ?A+s=PlhRA)A=)KC($0-$}HOa@#jBz$6)fUrgrfI`)}LBU+giOFF+zS>vn1yxy2X1 z3ca=PG}*Coo~zXBZO4u`#-a7MJi0(;mrqOTY00Ui!nXEhpn)q0hBaH!^b(M;Du7|n z2N>u^yuus;MJw*sR#thT`7%9h%2PT>kqeU%GlxP$q(52M#L&wF;c_A34Rq&^3YC{s_B0Sk94s6lX+B zzR<}X!r+7zCiLc&?T5L^W{(*s#3)~C>LkTq1pDi8sXjEMcxFmH z`t2DgO%zAjAMo>G_>q*3F4=7^oWE>GIHLdgoJ7X2frsh7c|YSyaF;Vbk)a<4#Kod- zOvhHS97E#uVa9dl*b(nK079rNIq`aBW8cS6tDDQ zNC3{BId+kwHf&qLRM@gzb2s9r0jqPToiygMbL;D(&WX2}pV~PcO#6t7%_U|fz$!Pg z%QBfK*||)X*=PR@xIZ4&qky2{wHSS}(K?Ov!S$u@o*&%3&LD?$|&2PlddkL76nC*y;|MIsvZs z#sotue^H%g?@N8;y$!c`z_J)^h15KTHClIu^x{Tg8F?OhI?9i5GbxBjseIe7#@OvWnrV9fdYfbylMG1D zN^W>%99)>wzIBDWB3`I+34tphGMQ^}=4kH^^R9_Pi<^cnV1!g;$pH42$(=rD3APEX zrNSv-?vlqRBy*wrjch4!&?N>!gdMl+FXy`O+U<|1$@-0AByLY_m^mWzN1kX@Cr3#O zVRF(AVSb;(Y?-8@H$X$)CrP@M|ltj!D=$Ap%(iQqKD0GC^6;q{hu7$#%d&&;@C zA!+DyT(EYYVQ7<%ivJX)NP6W~UoR1)a0ZGHD8 z`TTjCh2A{JBRRG{lIC^KX`FsVN$*D6<)tM0P@_A~QT2J?R&k1RkVl>N#4pUIv;$ic zL4%O|S`QBUmRaVqlt&7oC0sE$wtR9!1AdYZvnXsz5A-Wk{b*iRDp9+`lk^d|nz`u> z#^Zdlz-aV%2j#k{j zcm7IiY2NVy=cK-vz|DUtX`Y>y~I*m*uIi4TGZ6IM5Qt8&=M z3Qd|~kwd$ZgA?VhOMK?ws5G_sn%6-QVvTc{Ec*9P|JO9pT}UCN zB_<|qGJ-sL31F>kxU92RE!0byb0FS52nb)}b#G=UuCSZ5bnCcd8lRC`dD}p4quB=a zSRcJQ=R4IddZ|A=reQc=*$X{gyT=`~tm};VK!9$mVA63SslzU0E(jqvlV{11peWRvAwuek7kF0c=~V80K)AOlyEKcK`rNPnYH7v|6zU}`XX;gjU~{s z@`cn!$z=mYnA@n-N63ZaR?+)_cE!m?^c_a*E_NA?W*hVIRnmvZ_YE5&0qBXcvX%a}ZCIK-tJ zW=6WET-&?&AtORwz2U3mv?WEsJ}tCbwNdyCDU3j_a?pD|i(v|If;=jLcpjBoYdmR_ z`mz|(dN215Yw;; za@_e+_{j8cK#2DZ0SgTOZkNuO|E)b0f>_eFTQB9K$k_!1ZRY3;%{9>ur+{!JQhK6z zQ(oI$c_6GCFy@eVi-OOaNh$-I0Q*afsuONfSl{|gGOL~_&Kc}b>d$%^qLwiAD|GeI zVzz8=gez&_WRv%4DS*I8gO1c!d6I9L) ziHv28#{y#J<)-cYm17^16j&~`{&T)R--g3CO*xICHr2BgoK!8v-u%5DbP`8Xu*?C% zuas4WNjMF!_RwPNFTKO{DRL8;H}KC<5vSoDx{;gcG%P0=mp|q;)B?JPjysFtO(rR~ zdPc_wr>Rp9e^{zv4D=ubM|uPf5fg9c!Rul%kFS_(LzLZzdZM>vceMimNd59IM$Bj9 z<6%nT?J<+cD!N{8C!6mn^+otw+cyV_I9}oOl3!<-?4p{&a)y7t3%cD&k{{XqIt$#l zQSwe5=V9~Ix}l0v({E3j4wSFQf%*iRL8t~nW}FG9bL!U(>PVZS3qb0iD_l0`F-B<8 zMV;$z=kmYr-+$wm!N#*w>xY4c&)p0LNf}zdQ{=r}4woYbqxd2RWu>H@YnW{MKsIbCUY%5aKsyH%w^2rW{mhQqPF|>pmtQBBFPsCsicR>V>Gh+;N+uul0V8U2lqlB zz%`7wk=lF3Quqg-V5Wk^z++vzc9|!f<8Q&un^WjW-2{wC+q`Eo9HW-<1zxfp3mnO0 z7SK4JzpXt1gg%ksuwxZ}NiUp!3s=k`Y>x85Du4QGI6V(`8M_wzp41S6JkxPg?xEXt zD4mzwv6oHXZ^HS=B_ zn%Wf5=6cUw8z>%W%P+c@CUCM`h`r8)NPw z6lKA-xpyReL~;xi>`h7tc}Gz0b?$f9IxAKSU3Qy6=m*-|W{D&xzM>aH_CS7Bq;4@5 z2QBT1YZf8Z(}*IM$rM7d=I_AFhIN8j*ot#@O3d#;;OQj)K$aY^CACOSqd6efUe65s zbK;Q6BWi&l5iR9Xb-(%YD#o0zV_kIT#$la)jPS<4g7)*=zUGMX=( zc#BVr_fQFeNQBV~0EN{N7tl@9|DLuoG9)ih_wRq<x$Kf_zsM2G}*0YmY~-KE%`b%LY;O$FYK?Bl!K5%W2jbnuSs&zdpL+~%Fykk z`4YN`R@LBUA9SG}t+M;#Lkt6m>vFTA3@t~m3u%_5Zcl&zER|q!EPHk9;a|}Zt~oQG zS5m-St6^;jp|xxY{xM?svX>~)*J2EiqJrl(Z&PYjd}zFd;H>NNipE>|$ezZB_le1# zFmlisV|7>i=I)@Xv5FkOjEsHml4X*9$akb?{?#n%HbO2?GV(!Io4g3{wKCwNe(kJ0^2SQkiq?@G7H=LpSncKd=AU8k$}ZS z{!oG?13SNq4osJ?%A@)5OpF!RPzqrIRFV1y> zR@%pUvh8JugBkt5aLGc#;oM4&cMW$YJi!9`LtX#r{dASP$wdCO@t+c>rsI}uRIGV! z#fKL&NyT(oqk+R^P!QW}Vh5 zG;mipCeyT)wS5TJ#3##U6>*cE-K^(RKp%}07#!vBNSkUM31} zbCgbZYic{DwsAx4Z2PoPAnd{78>{pVi`zE)?#5M*2}QJ=cM38j^TBv z_6E*knhapx^TS1PiL*WZh+R&sJ5~Nk=^aeOZ4&$xl>1;?b!UOH(l7ap?`5BNSTj{^~I2*x`|u1SYQrueH6As3d$b4#cv%Gg1aKPZCGCBvn;1>8A` z!W_&TM!3f{on7f4x?I6)PJD8!%vCPQjjlY-W$;7zF^M12ErQC#rS$MFqt*(@iVt$J zNnq(vOt7#?{iW{54&m*7SsT|ef9c@)#tp2i^543PY?nF99po>_B_E0_p0^GFROd<_sEo+fzgtvx+H3GsT$Uf6isQnM4a~%ZG0M-IxGb{;Wkk zgl)OMUDjKdmJn^VUEn-#sJnnz8yp(WArVV`n$`~-hD#CfL!7u02-G=<*t7KoFuf#dWtOe&j!9`uuvw9GsKX%8a!kVXD(`tKG%`HtToh!S~$-mOPjSelmex**bE@?A?n|Vn+lEY|37TZ#`GUxV`gSn*8d9|b8<4V z{Lj_@>*)D`keNCDx2$msxC-h84!b;+q?=SULckm`(dH%*h%sDxKf8EZb3P%NWDp_U zCVU{FWSX;#q$CO9Acqg=_D>39`Z*`3>9X^^Gwx72IKU1unlfHs0@`-9{X#7#0ly_4|)7J~VJgp$QD3dU63dE`*|! z6BrZ}Fqr5t_*K;XJt)}gE5U~`ltd&bn&6cpjz2kpAUr})`%dHdA7nkr@|+$T>KOq) z;A{hW|NbDzXAj>lP?H=&NlGj*P>VpFOCtI5XoGkXK>~zOVV#~Y)IjC=twnSq1Tar` z_nUxhotGWSt}q>5AjI-2K0(Ai5TQ;H8=yW)&}KpT_`ZtU-9})zivoH-s)yayT6{uM zFn<(I;Q^#{*uTT@W}reKimSkHmDoVGU|>&a4I}yxy#9SzKm07}3&+OxRv(CvVPB4r z0pkWVaG-~fp(~JfISJVR$zU9xo&E&{8nE&G6^N_5L+KaK19b+~DE{k%9uG`0aS_~K z5$^lw7(`qcxt89WUU5_(H=u7Yf2|s-DItu9OUR&>zP;~E*`JumKxMnf-;bac6z&T6 z{uOdn*pR)o&tj#W$Ul^^ya`8Cbr*n>4D~E-2I&AEesg~x1q}^MI1Lm|v4a0X6A*w2 za;HsoBNM&1a~$MP0@O;0jU-S`2lg0rz7OIU2BecZhS3g+oF{g9ztG0)F}Ah(v&Tb3^~&$gO15=G+<3A1>^CP#C!KQvf>N zJ|6&o0npNMTG9oUNDEgV97V)% zaBZ(GCV|9-Ku9RicY}u#a*6rjQ2i1>Eivp!Gut9?Kz9Q>wUn4ZkvRnY7_md2F2#k! zK=~I8bNZ5KK*?P~KcSalzd0XYAjMM%Xkhrxebi!pEvP#8s98!N_ zNu(9vKus{rJ{4r=1wgV&bdH1RDQ8vvm}se z=L7)~`ZGDK)w6#s{*AywIey1xH1OZ&=c-eXP?GP15UZSbIbF&Fc%d)!Ljf8%SCPW- zj;~%*rT0(7uTKkM!dxWAs|RyV4dMeSQ^|YHjtgDHtrj66!@#RQn4_E{`e>FL9L_-p zWHWKWTjH|gt#Ne{*$fGGuoybaTel)%*$rK`pBM|a$bXa}WRPJ(K=VjtC1lRAb^J)^#`DW$GIVR1|^%ph4>va(PF zB*kLvH6<#w!mc*msws;CY8u8*j5 z$Y*$5yj&)h-_0LKqaerS$A9Up|B?Ex^Nm;}U9YY>X$rDj-R1BmS=~3>D@r9|<}OGF zIrChwL!agaWuwPWZb+@+|4v9vWcd3q2F|}zapC1mJ5EM=+PFk8<@D`O5Q9vKnZO57 zka|Xn&EZSG@p6m4Xv(hhGgIOnQPUTm-Qi2KkJda~`=Ttz$g5NL>X8iy=FQM{`tvGVmGHWwl%KV|X*A7q zp)}SB6m!zQZ{-$|H^KGjo9`9C7$*qoqtkqm0MO}=)=ZIkk{Y%m%dD!elV)Es$>5b* zZ8Am4o!*R~z_bELHQNKX<0J6M-9Edg^f4|=|4z;gv!(!<=|a|}0f0>X5~v+_C40Fh zn;&^>DdkvgWQep5KTvV5xo#aJqgotyvvVR2;0Lx&7a}b5mmR7#oEw?(Y&f*5{Cqavd;6?&>b9sd2V$y2TxkwJ^)59f zt}^pgA6xmzv=TpQ%CClwr9L)Pc&9{qFU3tPuI{lrcNSf#^Y%(Qdc6c{4H@dF5ohTx z&yBo@3#kkYI|iH@?w#U^r&*rZWbg2N!7dT~!H<~0P#7hN91lgljIj1_ySz|pxizsR z4zX3crYB`GX(HIBp!tPv0^kXQK}Wuc!)z9~dU;iY4#tew@G7>5-84GCmwQtF-uBTW zo{sC+jY|pDGWX(Qb>#IR;!`1RUwoK-ISMNL6YtP_{o+k+Uff3Cw zorMzIgzKlJ+tSD*H3zEV{3qi(&`4NoOf3;VK0d9H)U&~kHsAzlSR{6x!@#GW+dU>O zbX~Y?QT>PNyMVtTFXS9Gnbb}5`&E+UKON*bxIECuhLFCQqyqz}-+T2EEs`(AP_NT) zRfsSP>;x;>Sp^ZLeqWMacT)`z(qvn>s(oj%^{0cG^`BN2{Vp|y4t)}2{S1Y>ixc4r zP(SQxZOZpjCVB26T03RUVHHQOhk)nkU-6%fd^5%V4%-2NbI}Zg#spT{sBa-=n(Aks zrY;kLBu6D7R009u+?^#Se`10pTBRQ&h@yg##`oHU^R~3sX`k!S%dd{jEC5Y5rbxgR zhEdW%I;|*3-!kf@HV{vb>uy)1u)clYV$qpYb~v|={i1b2=l;Lw2Az*${a%n2_j%&W z7Z@-6kz6LrChr%FPP%;v+^++9+N+iGnCP% z75F0R$T{rTn@>osBmGq1K>T}GrAqBCP^4_ayeW-58Qx=pN^>fc{yG2P+!?<=oNL2d ziR@ffxs6HbQx6@p$>_c;>@+|DT`KL#I0|3G!*ovB!icX))|QdbS?1kc!zXD4p~Jq3 z>P&c_3PWqlmT=7)_p6IGBNSvY?RqZF?3goe$NU)B&UgCL8K33QE?nhfNbGlG4@%eD zR&bB%27~QlB{MpSX_9h>qu^-80JaG%n+bwJZ@J%^0~-RQzb3JSZ2pb99w#8c)3OW+ zzBx6YL%mt07-F@gfAt#iZOcPhSoS+Xh9cmqh)fuPTINEPXSxwv_pZXFqL<#^1icB5&@;iZm9} zc)IFrxu`797iI&NN1FScnjI!I6-gXAHiEx$fX)pjc}LOmd;uGRde9yIt*26YXqqDl zG)rC_$k7fpVt1U#r%m-pfT}+yhM3ymS(8y5p9C~z6{|K3WpkT-o(YbE(!WU3cSU+& zxAiwls}#l3={h&wS>bsMqq^#e4s+C{a3?a9bsI%Epz&fqeCezb=h;$CbhkBM_hm6h zb%&hhBr^=o%b$~8qix2_^;67+-WftHb)~EMh6`WxPJDElnA_$J4c(bx-mhT!4=Ro3 zH>rLzaoXX3ne1tQOdpI^%Bk!KPLi;Z`?3l(v^xE>^2`)hm#J7M<#btV7d3Gb%u?|)M_d_o+R6@eF&Pf$;L)L9IE3{xI%Av)gF@f82E>N)99_07xvy=wLo&`j1tqhWfp zkLic7Utbm2(pu!ASyqPfpzv`wu{}s}oOSI0-L{&xIlT~-tv_CJB_EA7HX}Xv?iWqN zM9Yjg%Y#XCO1S$7_3^95xV-e@B6Rm^8uR4ndDO|@)U}gd_E0oMBeF}_&pvJvNnbHw zRmw^Bn1QM@a;PUk;4x__g&D`rjJV*P$HrOAChC&2N=c52#)O^*+7Lk*Od?w5`o;Ih zM6)vXG%i!J-3uCO0xHnc%)YIH%(KXlAeqlJEnLf>xyer!C z;=EWtm;cAyHJ4jbVBRmhX9s1sDX&H({Y_}&z1-9gjGT$r#3c9h`{55|O*M#@_gTH; zev7ZQ8!i(^cJNfx`D6EDY}&-#FP{&mLtJSQN8$kjc*W+)x0Yn%CQ~ngW_kAv-zT?S zefzRIk@@*FSH~F3gOBm z6cQfDW^E*K8V~L%+=FB>ORFJ}T(sp!L;YjAzIGNOh!1O&GA`4lDg^)m(7`B%nkAVO z$|FXR-x0s(E?P>386^FXAjiUKd?pymw93YMLE@_YG~G#z>A;x!?amYCUL`-zH^kl` za`ZKjNv;ufGIcgrJvxTiZZro%_(hGYfQ=OWQ#0 z!OrivjDPHhii)wt8S)AXFPATLi}C6}__12xYrQBdf8wAl^yZ z?e6X9!BmD077SwOy06h17o7FQj}qIpAZc-fnIP(O#uA%wjcJ+(dP!=2E3jtTlo+;%NAh;Xh~4 z1BH*stMwi|&uV9nq%ZDfb}51@H;CbqWF4h{3Fr)Bs{eLm579LaEBo2pP335#)Tov> zJArGwMT;YgX@F^%RI;Qo+16LI zq>;;*EP-jq<+qv0mE4n<=Ru3&?-UjA>a70=e7)Xqf3G^6N96U1VHqr_4>`o2z6R&p zI6L-~hRv+AH}I1inIf(PrpHE9AM2vdZ`ic{3<$L&5uFh(r<0=}D0ttFXDoXy35IM? zLZN+mw2NbE(F#dpCGwQs9r$Ha&9%?|zK3GGpUUji+~*mTML8a!+-5>ZIB5~LfU!JJ zM1Uyi((kaE?wvkvcpUQjNLP;0 zBi1Z`@?aEV$|;0~L{3TNHrz?=H|J*0XJ;1Q2trWt61dOuv-Dq&dbZm8%O8J%-B>Ie zfwrXp7FB4gSvV*I1PY2%1%b3(((WM{#vj+)?C6WM@{=Xna<$F%Iz@@kP(4U*6uNJ` zERGw`H}kBJnHMk5qzVGIg2`lSvs-i~50 z5E&|E3R0~b6gdbwBQ>sTUsn$g7f34E`O{-#>&P|78Hpt+D%eG2L7{!cQq=e1Vo%AX zSZ>tNRg>BfXp7b*%QxL%7xvyOE3G>71GE>K^*nTT|EsaD3aW$Yvc(Amcjw>|;BXG^ z?(Pmj4h{!*`+_^cLU0WhT!Xv2yGw9~pt<~aW^PT@Ox1s@`k{OG?(S8)U-rY^YpE;+ zD!wrWIIxn*2QheCB)CM$^XmR<`sLCL_ z+QWsbjxbh@ct)T1Dc8RVOpbLMapL?ra`(}ym$BrzOY)D}p|Kv* zeV)V=YPEEuv%`rW6IaG2!w|e$a|7o6{+$`bPw{p67}+7kX!Old7Frn{aB*52rBiYL zfST2!nBchZ`{at!uz7}hYv}Q*3nw}mca1+}>rYx@z;Cg|f_hCjMHnW+#Dt=vra!;b zN0}!s=S_3zBV~F|J64TB0b53#^p*`a?tT^;$yJ%YaoJGa++v?9i~6nZ^mbV^KBa*Lu!hY1%|8huVOpVI6h8=V1d>~CL0BMNDisi;oJ z;Xw`)cYIOOA~RC87z%%-E^=JAn>>AA1uZvXCfsB@FanJtPmISE>hH+ToJj*Qt~}QW z&>)IiMcwb}a#ITyoR@jC^o`N&v0k1P_lciu7W_xy<5?#{6R4F?$Xs3j{&XlEV@^zW zrwkol!OS5YGaxti?;1}wjwWiQyRikB!w$`v zT6P#!^=a5xVMbfrzE~Fki(IRf9rv{_>Ee~ijho!T6(fW7hTjTka(;#@T|`ls zmVaUhC0E%X=l1=Yk_B*4-N0Jo(R=Z>1fna}s_G5#GmNc$TWlm^&Y4To)LwbMc`w8@ zANX*S^?;||Yd-K%c5E1c04$TC z-n_jvq0>x^eck&0D~(qW-)yjvJ9NhR)1ChP8gCKvShtqgsz*E9l*nhu?PvxoVzf$- z<8TXDpvK(Cw83ylt}qcDwu(?^4bF^Spj!AZ#l&%AYVYw>)IrjhhI zg0$0fEirJsexJCvrEBOdC6-i{VR zm?b3bbs{UJ6==)Y>ka8bu3Y1kS~T6?`!W4$DVgv7xbxXbU4GxWBGhWCKa8#!De1g5 zZr6LJ_;m*=E(h6n$f%)Z;=4HwsGrZ7p!Ab+mE1VM~NeM;#ipW6sauuqsWW z!>rmed~mmrM6a5-ZG73v3x`>daNkF2%kwe^?1V4|megEIRva#WsVoWh2*}I4rx=!1 zQHv!7oVJ;F&lE==w{nf1KI3__ zt>(h1FyyU9A)p0x4vw-u0^5{GHTX2rj= z!&nO5QH-l_TgikD-B8R^p4?WJ0ejUGe<%D|rr1!+Tg9K23}xm+WUCu-)(J;EUeCGZ z1Cr5(2#G8bN;e;PEup1_OYbbnI`XX-anuz>mJNsBS3X+0B5LI8VV7{C zJAz>LQ%c=^y;Jg6y|@BJ>u$PU#q#0bU12Rl7TFG{cFE@bHgE>{S-D5A8j}* zT=$3ly3zVD+ox~#suE}jAXVwbe|8&P;by7P@AmsUsFv<*jgVxs_xZ~+2gP}V z_tCQy)aBzkTDZt*zX~aaysP)5@ZJYJ)i-Bisb|%~S$jo#q}^E;ptj1B%%7-zaqKQe zIxqKI?V2TVwW^VC7m5yo79F_2Slr*w46cg@D}t31JIIgn__H{~*(x}G=-TElOG}IL zR3l|_CG)?S5_o3^>7j=?`Xk3J?a}!pSPrRAPUiUT$Z(+t7sU`= z6H_|;8kSwtiz`Hq*}W~-UoN^_nbL`TCv2g%b%mvs&k7{kKBFpV&jlr9POg~LD@oA} z!jYeDrwK7FXp&EyHCJ!^J&5Pn)=cEV*ZpAWBTYFaiXV!%erG~*;Fj1AZlg9AS!p0b zwoL*}q6e#E6Z4%Omc*)cRVUO@|4CH>LaHgjDX5$0*+jckjVc?K6G4uMJWnjbg@Myy ze{p+E(XW?<8ND@tR*xf>AV*9kJ1Z(a_Cw}V$YGJGVGeZk%#UZh?~5|UU@F6Rbksxs z+lxqCS&f9xvVB&j#oO*?vSv0rdOxe`mN@~<)lp0Lnht3U2WDCI=r{wlO($azUkPLc zUEW5rzSjQ7i=FW1IvNjD$;PPn4nkLy);j_g{>g6~q|BADysu}WWg@*FbarwBz<;8M zBdhD_5Cwk~Of(cXd^TLeOB&DB0rirva1Q_3Z%AJ)02-r*Tg;&Q>TUAawoMh9pF5Bs zA14cEr-Y2>FO$5A);UsFgsYqGuPVFm+v27WhJ4@&T{__OjcX~g@?$bYA$x@T+DB-y zdgTN@pgJ%6$UdPW>^MPDHXDHF%e85F`*UpVK923L?`BT#Gyu#Ug}zo&4mggldXea7 zr=ji^L03jW&9qDEoVN41b}T9H_rZRXubtZ0t1RWU{J4rT<5=>G zozFPi)xa|)@JYLB{juyWi@lBW(#D5Ut0pch?Vn3#TI*_hgu~Yp7|IMgu*jgr@Z_Ui zN4*cU9!4HQq8h4Bchj&UpYP&q8$%5z(8&u53b>i8fYYK4#fro@?Qju>Cs z07pqu_s6K|TKA`=?4k>4dc#+GgcxD>#j9CsQs*8HhZE`%qoTpCTE@ok+iOXlj;$zf zer*$7sZGK@CX~6!mP6dTk(I&P!L&f^pB~275v;@q?)lWc#DRl+BfB13D!=yXE8X*( zAY67@@TsmzRL@SQ1gXe7nvzrjB<*EBQScuTQ|S@J?&debmasW&$X5?y1AMO2Ysw|p z`+M${sbd%v@>H9q6109-a#Y49D|t0S2D1;j8q=5jwbD24gBf?4ufm%5MTJ~kFJu=r z-TCYF5mybtbPHd;Gx_`Ma3Z(lLm4cPjkt9UlhbrsIF->gC|`-sQqJ8WiRLt)SlWcq z`%XNS5z}-G)ET*_`G2_I>dHDG#EtaLTonI_5Dqrf+&-08A{=^j`PezDZ(o+4A=K%= z)iF~tPZlL7j%^|)afCD#z={1?{dtR^sM5}ddXpdflM!J=MZR0pxf-u15%~`Wqa3i` zL&dlZHU|9H&jTm+T{w@A39m!h;s(jh2&n~a?QyG3yj4Wf{K6)U#6sz!cku_qxhH8O z+rBe*z7vW9EC&uDq?VqvavZcqNWoVgaJX;@*;UpNhQ4}jE1*_ZKXw_091yeRQ)Jsl zA;z!2h8ty+CQsg3DNn(MPcVO1S~yqf>_V2CSP=huKjbfA?7WCGyPKu^))|XqBl9)w z!&E?lHl}AkB2AL5ad=xEY%&VvV>(5ra9S~y&Ljlv&b?`NX>X%qiVyW>QAmR09?7j% zd)67#^_yAtZw7bZMK}`sJk)>V)icZU!hX$2?7vZ;yKm3apr8W&(Z5BuL^GSToY4D=A_6?zbV(UlT(*491k z5;%)Ni6qg6_kxxCTJfc0OOg@+==?a@4tz|`xIpM_rd70m==Yt3Qzg)+-f&)hNf|KNu{nM!h7pS| zy>6F&nfH-z?Tf04?2^yZqg!h@Lg)OCu7<)wqBx{gO&E(LwMvV*D z4&*2&o&H6BL=~YGdAG zupLOv?;t&iZF z?aV{ZE)_gkA4(U-WSKOS{ub5)<=L+gQLUifZ)ME)9moEJbd}l}x_rr}&3=`dC0c_9 zYK+u3tlI9H8(TOOqHY=RRg$FAF&uJOQ9se}gRTW#9Qh+Kp}Q#XTch4 zeqTq=x-d9bPvgKs&~AOn-(TQQ7W#)^#M=1(5KO9+WRB^DYMs>G&rceRZ6mBwDozP5 z1Y1>J&k{~+A+X~oo3jn}AbWvlf~`0?Qco^mjrF?5KuhE2_xnNyfABtblI~GRVJ-Fl zwC&hw|4Un6^JRj6DSRt+2vVGE)By?dD>7U98dUck3Aw6w)gLho#npX)?AkbvlJJaO z>Gro8xp_{+i4K|TqK}A;#aS)qa*vUjWb7rWwcPV3bz?RYo_v? z$TtLz!#nwC^Gx(N3-bMyfpcnnA>SD+m9X2Vq0edN#`&X%jD&t^bHGy7-Fq(*f$RD9 z1@k^<=MuhyOCbzDl+rj)rwP+^_;VvJ`TEIgvO&vRs*%tmmEyyt6kmGV%N&>_gzBu3 z@I|3GNTNrpNp&X5IQqZ`8qK5`uAvh6(G7egP0i!D92T%uc@O!Jdq@TY3F~we1-+9e zKHFgwk&}(biR8qUu&b3}53T?gxtBgkNk{Wi3om?GHI~`!!`aaCMnqq&)Xx&><|l95 zrxK>NYMlOZx5}G7MML3+!o@_U=z6i;&EJ!n`*?2KviOEXq?F!YWhu4URyTHpE>nT& z--QqP9rkwfV{tvstc^Y<3m!EV{Zg(h4@u=E%=%m;PmD29aP&!N2LGn*+4>^&q+-fG zLwsgzT?NB^mQ<(W!7_!ooGcQ)FyoVp!7m(I11^c2ITxwX$1nH~FhQP`DWCuq99zoT zfxx~G0kr}Y4@lr(jN02n3t!R%mm5Qu{v%)!YC;$dayVqj-yc=uC+ zTKqc~O&3!qCx`_AC~a!*3PA;`YD(#{NxR$Io0&Q~{tJtywT&y_ef$R|7JxRy#r6GZ z00$e06U4;_=H_ArvvL0y*8htTplIU(0lY)v14=^7Y)l=Q0CrBMZq}|4Q-H^R9_MCz zzkmrn5CBlc%vQtA0TrkW;CLrpm9}wlbpwET|6ffc0L;O~ z`Tr|cc&4|mLCS{{_+XMZ*xJ(b^j0SCpcPb|M}WhIC7!xtT8*3*T@z{Lm$6sX>1ZR& zX`b270@U%`ul*ro>wdDhew=DAMzq~$(8Gn@gIgJa7w06C9HgvJ&o1d?Mk`2EgR_L^ zOtQi0EFH@`MyQUJS%}8K*sGfW_o~fL%_kVkFhotppuU5-EB!J zeJf$iradZW`~_BG&{>$ZcD!00UXPn*@LJ~!4jx&M>h&>x z9`a|aP#W1DYFiv_JCYfgvh>>^szmwTC%YM}36d2W!9p=?Aw4$wVs9xn*wHuGJgdj1 zC_^qgFFaZvJH~m1E=9ucK?(p*1r>G?!cY?lQ$&k`mt1P4FmGJ-cl};?=+xSDZ_;OoUgJ5rUMk}|B&`>3<^gk zgK$b4rz6J4cP_~b`x+DYr}x|>H1~0rl-u2Om5E+*_D;$mr+?RlADkR?+-gf zgoAnwEbQq6F&tsOl)~ix_`f_P`ovC8i4>=EPngk_V=7E($u=ZpFA~eK=#l$tf8L+h z(%}VR3ymBT#zAwUY}|FsASkeJmcn|9(T}XDX;c4XGPd=ZX~^6axtN#ln*BWy!B#l_ zHGo9(F37aDS6wtc@@-}c?PE#N?qh!X0gtt4y4b8GE*YV_@*pg=y&cE+JkiMU-_^hU z1UNMf9;cTmOl!=Mkz&L0)%LOx&(g)?*M7PAUYj8cdPQ>SQ#~O$Pr8hY`w~-nij2ho|4K zC%cBq7+j7+HVby`D(0-z<4Z0PrM?t<3QMBT)l>{d8W$YH&Xxd@*_eisXk#4VaQ4d0 z7O>D^N2|luiPhum^^kB;YjNY@U8wQPs_HJF{n))*V2bCYcZ>!b$*xXt?`ArOV`5N5 zyn>x%@$KQPtbh)mSZBz;p zb^=zsqn3U~F%%*duRFD79>qVXA9a{0^EVM!9ju*sK9w4DSi64&tvT_Ax3tLs2i^dy z+#IR~GVWwYjz1xu=1zNRkujY!+~wWScE{k#IEPcQfVukR`2-7L&ctcguO-823v2SCdfn?_U z#|!Hx_JaK=^H^NP4BFP3<~7+tZuAg-caN|zfChzzsXfT~xdoq@dYUSPd}3)TA6FDk z;$cy!I@PwZ>M%ak+)3%E_DI8)vHIL2W-DGt0*`FL3FFP~A#+Q>yf zjLX(o!(hfkf~y}(atcF$g#jOnhzIvkb1xarJ9)nW;gWP?{&J3Dz^>HPLrH*Th(Ect zByWLOzpBQ*NJ#hCYZB+gZ3UN3=Ay{$_;G17`h)CtV~x_KmJm-0u@^}v)q-qs0k&G9 zgg{%x>EXVGo}gwlq|KwRb!2<`?eS#uZ;fZ0Z#N>^SnXv}XYR(D?q68|ZkkHQyZzKfkqvG1%S9oPnRTc(bafOtki`?B$K@zJqc)+9y$+ z*;wK-;D+ZZ{e0U0DU4#umNJ7|Z5r!=o4jlK zWU-#N4D^Vc^>^p*cbeD-H)TRM(Bu)k|IoL7Gx^RLI#wI0@>WRp>~TDz(RAP}^mcHQ zW+NC*o5{ha^)JUwRvVv4py!7J0pT?Z;o)gNG}Yeq?Zbm45spm^omkjdf6)m3R8PY&55#+(S8Z9Th1_aMc}uw2!@r#7`4AE-uz-Y5KaNFXyb^b-vHD61^u zde2L+Jsigq6uL`1cZ~57#@85C-JT}>*{p-v*Q-&!G~CLHurmubyKbCmo)aHMB_Eii zzAr8KOciShL40m_nK_uv|E6#ch{VstWuNtVxBRX_}y-N`^VrRps_!HVtwmShtZQ9@VOeRndy^2crU4zZfB?4bX+59^fX z=2m|2E1DIi>z3%FexY0n^I@gL+tAxUC!)fOi4$Vk=N)K&J?%F!`nMEHimP}&>~~3W zt+i1=IGdx4n(}qkRv^q6b*tI`lB;t4j|5Fu9b$pIJr1MAPF9J4i0f)z`u8Se?<}EXys-N0CE3kQV96>RQ%-Q0tDTvc%j?v5+B56 z+akRP%uq}5k<4HQa@9+Vv@`yh5amP@i}X*2z8 Date: Wed, 2 Dec 2020 15:26:13 -0500 Subject: [PATCH 132/162] Fix self handling. Fix dispatching and inheritance --- src/.builds | 2 + src/cil/baseCilVisitor.py | 12 +- src/cil/nodes.py | 9 +- src/coolc.sh | 2 +- src/makefile | 6 +- src/mips/baseMipsVisitor.py | 20 +++- src/testing.mips | 228 +++++++++++++++++++++--------------- src/testing.py | 1 + src/travels/ciltomips.py | 26 ++-- src/travels/ctcill.py | 14 ++- 10 files changed, 204 insertions(+), 116 deletions(-) diff --git a/src/.builds b/src/.builds index f634e147..3e8196e4 100644 --- a/src/.builds +++ b/src/.builds @@ -205,3 +205,5 @@ 1 1 1 +1 +1 diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 9317aca8..5811e91d 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -290,14 +290,20 @@ def build_builtins(self): # Registrar el tipo IO como un tipo instanciable io_typeNode = self.register_type("IO") + obj = self.register_type("Object") - io_typeNode.methods.append(("in_string", "function_in_string_at_IO")) - io_typeNode.methods.append(("in_int", "function_in_int_at_IO")) io_typeNode.methods.append(("out_string", "function_out_string_at_IO")) io_typeNode.methods.append(("out_int", "function_out_int_at_IO")) + io_typeNode.methods.append(("in_string", "function_in_string_at_IO")) + io_typeNode.methods.append(("in_int", "function_in_int_at_IO")) io_typeNode.methods.append(("abort", "function_abort_at_Object")) - io_typeNode.methods.append(("copy", "function_copy_at_Object")) io_typeNode.methods.append(("type_name", "function_type_name_at_Object")) + io_typeNode.methods.append(("copy", "function_copy_at_Object")) + + obj.methods.append(("abort", "function_abort_at_Object")) + obj.methods.append(("type_name", "function_type_name_at_Object")) + obj.methods.append(("copy", "function_copy_at_Object")) + self.__implement_in_string() self.__implement_out_int() diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 9bed87df..6527daf3 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -273,4 +273,11 @@ def __init__(self, selfsrc: LocalNode, dest: LocalNode) -> None: class TypeName(InstructionNode): def __init__(self, dest: LocalNode) -> None: - self.dest = dest \ No newline at end of file + self.dest = dest + + +class SaveSelf(InstructionNode): + pass + +class RestoreSelf(InstructionNode): + pass \ No newline at end of file diff --git a/src/coolc.sh b/src/coolc.sh index 639ecc05..63ead30f 100755 --- a/src/coolc.sh +++ b/src/coolc.sh @@ -10,4 +10,4 @@ BUILD=$(wc -l .builds | awk '{ print $1 }') echo "pycoolc: version $VERSION Developed by Eliane Puerta, Liset Alfaro, Adrian Gonzalez" # echo "Build: $BUILD" echo "Copyright (c) 2020 School of Math and Computer Science, University of Havana" -python3 pycoolc.py $INPUT_FILE +python pycoolc.py $INPUT_FILE diff --git a/src/makefile b/src/makefile index da16e539..868f7d90 100644 --- a/src/makefile +++ b/src/makefile @@ -1,9 +1,9 @@ # Find a python3 version on the System ifndef PYTHON - PYTHON:=$(shell if which python3 > "/dev/null" 2>&1; \ - then echo "python3"; \ + PYTHON:=$(shell if which python > "/dev/null" 2>&1; \ + then echo "python"; \ else \ - echo "No python3 on system Path"; \ + echo "No python on system Path"; \ exit 1; \ fi) endif diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index fc9c44be..05aca4eb 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -6,14 +6,16 @@ from cil.nodes import TypeNode from cil.nodes import CilNode, FunctionNode from mips import load_store +from mips.arithmetic import ADDU, SUBU from mips.branch import JAL, JALR import mips.instruction as instrNodes import mips.arithmetic as arithNodes -from mips.instruction import FixedData, LineComment, a0, fp, ra, sp, v0 +from mips.instruction import FixedData, LineComment, REG_TO_STR, a0, fp, ra, sp, v0 import mips.load_store as lsNodes from typing import List, Optional, Type, Union import time import cil.nodes as cil +from mips.load_store import LW, SW from travels.ctcill import CilDisplayFormatter @@ -361,6 +363,22 @@ def locate_attribute(self, attrname: str, attributes: List[Attribute]): break return offset + def push_register(self, reg): + """ + Equivalente a push en x86 + """ + self.comment(f"Push register {REG_TO_STR[reg]} into stack") + self.register_instruction(SUBU(sp, sp, 4, True)) + self.register_instruction(SW(reg, "0($sp)")) + + def pop_register(self, reg): + """ + Equivalente a pop en x86 + """ + self.comment(f"Pop 4 bytes from stack into register {REG_TO_STR[reg]}") + self.register_instruction(LW(reg, "0($sp)")) + self.register_instruction(ADDU(sp, sp, 4, True)) + def locate_attribute_in_type_hierarchy(attribute: Attribute, base_type: SemanticType): # El atributo se define por primera vez en el primer tipo que lo contiene diff --git a/src/testing.mips b/src/testing.mips index af7935cc..6b7ebf48 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,12 +1,14 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Nov 30 10:21:42 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Wed Dec 2 15:23:37 2020 # School of Math and Computer Science, University of Havana # .data IO: .asciiz "IO" # Function END +Object: .asciiz "Object" +# Function END A: .asciiz "A" # Function END B: .asciiz "B" @@ -21,7 +23,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_in_string_at_IO, function_in_int_at_IO, function_out_string_at_IO, function_out_int_at_IO, function_abort_at_Object, function_copy_at_Object, function_type_name_at_Object +IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object # @@ -32,6 +34,18 @@ IO_end: # +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# + + +# **** Type RECORD for type Object **** +Object_start: +Object_vtable_pointer: .word Object_vtable +Object_end: +# + + # **** VTABLE for type A **** A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A # @@ -46,7 +60,7 @@ A_end: # **** VTABLE for type B **** -B_vtable: .word function_out_a_at_A, function_out_b_at_B +B_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A, function_out_b_at_B # @@ -71,7 +85,7 @@ C_end: # **** VTABLE for type D **** -D_vtable: .word function_out_c_at_C, function_out_d_at_D +D_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_c_at_C, function_out_d_at_D # @@ -475,11 +489,14 @@ function_out_a_at_A: # LOCAL local_out_a_at_A_internal_2 --> -12($fp) lw $t1, 8($s1) sw $t1, -12($fp) - # local_out_a_at_A_internal_0 = TYPEOF local_out_a_at_A_internal_2 + # LOCAL local_out_a_at_A_internal_0 --> -4($fp) + # LOCAL local_out_a_at_A_internal_2 --> -12($fp) + # local_out_a_at_A_internal_0 = local_out_a_at_A_internal_2 lw $t1, -12($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -4($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) # LOCAL local_out_a_at_A_internal_3 --> -16($fp) # la $t1, data_2 @@ -493,21 +510,20 @@ function_out_a_at_A: # LOCAL local_out_a_at_A_internal_0 --> -4($fp) # LOCAL local_out_a_at_A_internal_1 --> -8($fp) # local_out_a_at_A_internal_1 = VCALL local_out_a_at_A_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, -4($fp) + lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 8($t2) + lw $t3, 0($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 # RETURN local_out_a_at_A_internal_1 lw $v0, -8($fp) # Deallocate stack frame for function function_out_a_at_A. @@ -533,11 +549,14 @@ function_out_b_at_B: # LOCAL local_out_b_at_B_internal_2 --> -12($fp) lw $t1, 8($s1) sw $t1, -12($fp) - # local_out_b_at_B_internal_0 = TYPEOF local_out_b_at_B_internal_2 + # LOCAL local_out_b_at_B_internal_0 --> -4($fp) + # LOCAL local_out_b_at_B_internal_2 --> -12($fp) + # local_out_b_at_B_internal_0 = local_out_b_at_B_internal_2 lw $t1, -12($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -4($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) # LOCAL local_out_b_at_B_internal_3 --> -16($fp) # la $t1, data_3 @@ -551,21 +570,20 @@ function_out_b_at_B: # LOCAL local_out_b_at_B_internal_0 --> -4($fp) # LOCAL local_out_b_at_B_internal_1 --> -8($fp) # local_out_b_at_B_internal_1 = VCALL local_out_b_at_B_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, -4($fp) + lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 8($t2) + lw $t3, 0($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 # RETURN local_out_b_at_B_internal_1 lw $v0, -8($fp) # Deallocate stack frame for function function_out_b_at_B. @@ -590,11 +608,14 @@ function_out_c_at_C: # LOCAL local_out_c_at_C_internal_2 --> -12($fp) # local_out_c_at_C_internal_2 = SELF sw $s1, -12($fp) - # local_out_c_at_C_internal_0 = TYPEOF local_out_c_at_C_internal_2 + # LOCAL local_out_c_at_C_internal_0 --> -4($fp) + # LOCAL local_out_c_at_C_internal_2 --> -12($fp) + # local_out_c_at_C_internal_0 = local_out_c_at_C_internal_2 lw $t1, -12($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -4($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) # LOCAL local_out_c_at_C_internal_3 --> -16($fp) # la $t1, data_4 @@ -608,21 +629,20 @@ function_out_c_at_C: # LOCAL local_out_c_at_C_internal_0 --> -4($fp) # LOCAL local_out_c_at_C_internal_1 --> -8($fp) # local_out_c_at_C_internal_1 = VCALL local_out_c_at_C_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, -4($fp) + lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 8($t2) + lw $t3, 0($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 # RETURN local_out_c_at_C_internal_1 lw $v0, -8($fp) # Deallocate stack frame for function function_out_c_at_C. @@ -647,11 +667,14 @@ function_out_d_at_D: # LOCAL local_out_d_at_D_internal_2 --> -12($fp) # local_out_d_at_D_internal_2 = SELF sw $s1, -12($fp) - # local_out_d_at_D_internal_0 = TYPEOF local_out_d_at_D_internal_2 + # LOCAL local_out_d_at_D_internal_0 --> -4($fp) + # LOCAL local_out_d_at_D_internal_2 --> -12($fp) + # local_out_d_at_D_internal_0 = local_out_d_at_D_internal_2 lw $t1, -12($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -4($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) # LOCAL local_out_d_at_D_internal_3 --> -16($fp) # la $t1, data_5 @@ -665,21 +688,20 @@ function_out_d_at_D: # LOCAL local_out_d_at_D_internal_0 --> -4($fp) # LOCAL local_out_d_at_D_internal_1 --> -8($fp) # local_out_d_at_D_internal_1 = VCALL local_out_d_at_D_internal_0 out_string - # Save current self pointer in $a1 - move $a1, $s1 # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, -4($fp) + lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 8($t2) + lw $t3, 0($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 # RETURN local_out_d_at_D_internal_1 lw $v0, -8($fp) # Deallocate stack frame for function function_out_d_at_D. @@ -712,23 +734,30 @@ function_main_at_Main: la $t1, A_start sw $t1, 4($v0) move $t2, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) jal __A__attrib__io__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 sw $v0, 8($t2) sw $t2, -12($fp) - # local_main_at_Main_internal_0 = TYPEOF local_main_at_Main_internal_2 + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 lw $t1, -12($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -4($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_a - # Save current self pointer in $a1 - move $a1, $s1 # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, -4($fp) + lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address @@ -736,8 +765,9 @@ function_main_at_Main: # Call function. Result is on $v0 jalr $t3 sw $v0, -8($fp) - # Restore self pointer after function call - move $s1, $a1 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 # LOCAL local_main_at_Main_internal_5 --> -24($fp) # local_main_at_Main_internal_5 = ALLOCATE B # Allocating 12 bytes of memory @@ -749,32 +779,40 @@ function_main_at_Main: la $t1, B_start sw $t1, 4($v0) move $t2, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) jal __A__attrib__io__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 sw $v0, 8($t2) sw $t2, -24($fp) - # local_main_at_Main_internal_3 = TYPEOF local_main_at_Main_internal_5 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 lw $t1, -24($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -16($fp) + sw $t1, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # LOCAL local_main_at_Main_internal_4 --> -20($fp) # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 out_b - # Save current self pointer in $a1 - move $a1, $s1 # Save new self pointer in $s1 lw $s1, -16($fp) # Get pointer to type - lw $t1, -16($fp) + lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 4($t2) + lw $t3, 16($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -20($fp) - # Restore self pointer after function call - move $s1, $a1 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 # LOCAL local_main_at_Main_internal_8 --> -36($fp) # local_main_at_Main_internal_8 = ALLOCATE C # Allocating 8 bytes of memory @@ -787,20 +825,21 @@ function_main_at_Main: sw $t1, 4($v0) move $t2, $v0 sw $t2, -36($fp) - # local_main_at_Main_internal_6 = TYPEOF local_main_at_Main_internal_8 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 lw $t1, -36($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -28($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) # LOCAL local_main_at_Main_internal_6 --> -28($fp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_c - # Save current self pointer in $a1 - move $a1, $s1 # Save new self pointer in $s1 lw $s1, -28($fp) # Get pointer to type - lw $t1, -28($fp) + lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address @@ -808,8 +847,9 @@ function_main_at_Main: # Call function. Result is on $v0 jalr $t3 sw $v0, -32($fp) - # Restore self pointer after function call - move $s1, $a1 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 # LOCAL local_main_at_Main_internal_11 --> -48($fp) # local_main_at_Main_internal_11 = ALLOCATE D # Allocating 8 bytes of memory @@ -822,37 +862,42 @@ function_main_at_Main: sw $t1, 4($v0) move $t2, $v0 sw $t2, -48($fp) - # local_main_at_Main_internal_9 = TYPEOF local_main_at_Main_internal_11 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 lw $t1, -48($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -40($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # LOCAL local_main_at_Main_internal_10 --> -44($fp) # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_d - # Save current self pointer in $a1 - move $a1, $s1 # Save new self pointer in $s1 lw $s1, -40($fp) # Get pointer to type - lw $t1, -40($fp) + lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 4($t2) + lw $t3, 32($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -44($fp) - # Restore self pointer after function call - move $s1, $a1 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 # LOCAL local_main_at_Main_internal_14 --> -60($fp) # local_main_at_Main_internal_14 = SELF sw $s1, -60($fp) - # local_main_at_Main_internal_12 = TYPEOF local_main_at_Main_internal_14 + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 lw $t1, -60($fp) - # Load pointer to type - lw $t2, 4($t1) - sw $t2, -52($fp) + sw $t1, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) # LOCAL local_main_at_Main_internal_15 --> -64($fp) # la $t1, data_6 @@ -866,21 +911,20 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_12 --> -52($fp) # LOCAL local_main_at_Main_internal_13 --> -56($fp) # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string - # Save current self pointer in $a1 - move $a1, $s1 # Save new self pointer in $s1 lw $s1, -52($fp) # Get pointer to type - lw $t1, -52($fp) + lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 8($t2) + lw $t3, 0($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -56($fp) - # Restore self pointer after function call - move $s1, $a1 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 # RETURN local_main_at_Main_internal_13 lw $v0, -56($fp) # Deallocate stack frame for function function_main_at_Main. diff --git a/src/testing.py b/src/testing.py index 2f85f5b1..7b991e01 100755 --- a/src/testing.py +++ b/src/testing.py @@ -164,5 +164,6 @@ class Main inherits IO { }; + """ pipeline(text, 5) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 9e63a5df..aee1a667 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -389,9 +389,13 @@ def _(self, node: cil.AllocateNode): attribute, instance_type ) # llamar la funcion de inicializacion del atributo + # Salvar el registro temp + self.push_register(temp) self.register_instruction( branchNodes.JAL(f"__{attrib_type_name}__attrib__{attribute.name}__init") ) + # Restaurar el valor del registro temp + self.pop_register(temp) # El valor de retorno viene en v0 self.register_instruction( SW(dest=v0, src=f"{8 + i*4}(${REG_TO_STR[temp]})") @@ -405,8 +409,8 @@ def _(self, node: cil.AllocateNode): @visit.register def _(self, node: cil.TypeOfNode): - local_addr = self.get_location_address(node=node.variable) - return_addr = self.get_location_address(node=node.dest) + local_addr = self.visit(node.variable) + return_addr = self.visit(node.dest) reg = self.get_available_register() reg2 = self.get_available_register() @@ -501,17 +505,13 @@ def _(self, node: cil.DynamicCallNode): reg1 is not None and reg2 is not None and reg3 is not None ), "out of registers" - # Salvar el puntero a self en a1 - self.comment("Save current self pointer in $a1") - self.register_instruction(MOVE(a1, s1)) - # Actualizar el puntero a self en s1 self.comment("Save new self pointer in $s1") self.register_instruction(LW(s1, type_src)) # Cargar el puuntero al tipo en el primer registro self.comment("Get pointer to type") - self.register_instruction(LW(reg1, type_src)) + self.register_instruction(LW(reg1, f"4($s1)")) # Cargar el puntero a la VTABLE en el segundo registro self.comment("Get pointer to type's VTABLE") @@ -528,14 +528,18 @@ def _(self, node: cil.DynamicCallNode): # El resultado viene en $v0 self.register_instruction(SW(v0, dest)) - # Restaurar el valor antiguo del puntero a self - self.comment("Restore self pointer after function call") - self.register_instruction(MOVE(s1, a1)) - self.used_registers[reg1] = False self.used_registers[reg2] = False self.used_registers[reg3] = False + @visit.register + def _(self, node: cil.SaveSelf): + self.push_register(s1) + + @visit.register + def _(self, node: cil.RestoreSelf): + self.pop_register(s1) + @visit.register def _(self, node: cil.ArgNode): # Pasar los argumentos en la pila. #TODO: Pasarlos en registros diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index ba2b039a..a8e69dd7 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -37,8 +37,8 @@ PrintIntNode, PrintNode, ReadIntNode, - ReadNode, - ReturnNode, + ReadNode, RestoreSelf, + ReturnNode, SaveSelf, SetAtAddress, SetAttributeNode, StarNode, @@ -111,7 +111,9 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: for attribute in self.current_type.parent.attributes: new_type_node.attributes.append(attribute) - for method in self.current_type.parent.methods.keys(): + parent = next(t for t in self.dot_types if t.name == self.current_type.parent.name) + + for method, _ in parent.methods: # Manejar la redefinicion de metodos if method not in methods: new_type_node.methods.append( @@ -764,7 +766,9 @@ def _(self, node: coolAst.FunCall, scope: Scope) -> LocalNode: expr = self.visit(node.obj, scope) assert isinstance(expr, LocalNode) or isinstance(expr, ParamNode) - self.register_instruction(TypeOfNode(expr, type_vm_holder)) + self.register_instruction(AssignNode(type_vm_holder, expr)) + + self.register_instruction(SaveSelf()) # Evaluar los argumentos for arg in node.args: @@ -775,6 +779,8 @@ def _(self, node: coolAst.FunCall, scope: Scope) -> LocalNode: DynamicCallNode(type_vm_holder, node.id, return_vm_holder) ) + self.register_instruction(RestoreSelf()) + return return_vm_holder @visit.register From c7f79e0f2d7045dbd2781e69a71c44429e172bfc Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 3 Dec 2020 10:39:33 -0500 Subject: [PATCH 133/162] Fix not node --- src/cil/baseCilVisitor.py | 1 + src/testing.mips | 733 ++++++++----------------- src/testing.py | 130 +---- src/travels/ctcill.py | 104 ++-- src/travels/inference.py | 2 + testing.mips | 0 tests/codegen/fib.mips | 620 ++++++++++++++++++++++ tests/codegen/hello_world.mips | 366 +++++++++++++ tests/codegen/io.mips | 939 +++++++++++++++++++++++++++++++++ 9 files changed, 2233 insertions(+), 662 deletions(-) create mode 100644 testing.mips create mode 100644 tests/codegen/fib.mips create mode 100644 tests/codegen/hello_world.mips create mode 100644 tests/codegen/io.mips diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 5811e91d..716518ff 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -186,6 +186,7 @@ def do_label(self, label: str) -> str: self.__labels_count += 1 return f"label_{label}_{self.__labels_count}" + def __build_CART(self) -> None: """ CART: Context Aware Runtime Table.\ diff --git a/src/testing.mips b/src/testing.mips index 6b7ebf48..3bb4cfb4 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Wed Dec 2 15:23:37 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 10:37:40 2020 # School of Math and Computer Science, University of Havana # @@ -9,14 +9,6 @@ IO: .asciiz "IO" # Function END Object: .asciiz "Object" # Function END -A: .asciiz "A" -# Function END -B: .asciiz "B" -# Function END -C: .asciiz "C" -# Function END -D: .asciiz "D" -# Function END Main: .asciiz "Main" # Function END # @@ -46,58 +38,8 @@ Object_end: # -# **** VTABLE for type A **** -A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A -# - - -# **** Type RECORD for type A **** -A_start: -A_vtable_pointer: .word A_vtable -A_attrib_io: .word 0 -A_end: -# - - -# **** VTABLE for type B **** -B_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A, function_out_b_at_B -# - - -# **** Type RECORD for type B **** -B_start: -B_vtable_pointer: .word B_vtable -B_attrib_io: .word 0 -B_end: -# - - -# **** VTABLE for type C **** -C_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_c_at_C -# - - -# **** Type RECORD for type C **** -C_start: -C_vtable_pointer: .word C_vtable -C_end: -# - - -# **** VTABLE for type D **** -D_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_c_at_C, function_out_d_at_D -# - - -# **** Type RECORD for type D **** -D_start: -D_vtable_pointer: .word D_vtable -D_end: -# - - # **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main, function_fib_at_Main # @@ -117,121 +59,45 @@ __Object_Int_tdt_entry__: .word 1 __Object_String_tdt_entry__: .word 1 __Object_Bool_tdt_entry__: .word 1 __Object_IO_tdt_entry__: .word 1 -__Object_A_tdt_entry__: .word 1 -__Object_B_tdt_entry__: .word 2 -__Object_C_tdt_entry__: .word 2 -__Object_D_tdt_entry__: .word 3 __Object_Main_tdt_entry__: .word 2 __Int_Object_tdt_entry__: .word -1 __Int_Int_tdt_entry__: .word 0 __Int_String_tdt_entry__: .word -1 __Int_Bool_tdt_entry__: .word -1 __Int_IO_tdt_entry__: .word -1 -__Int_A_tdt_entry__: .word -1 -__Int_B_tdt_entry__: .word -1 -__Int_C_tdt_entry__: .word -1 -__Int_D_tdt_entry__: .word -1 __Int_Main_tdt_entry__: .word -1 __String_Object_tdt_entry__: .word -1 __String_Int_tdt_entry__: .word -1 __String_String_tdt_entry__: .word 0 __String_Bool_tdt_entry__: .word -1 __String_IO_tdt_entry__: .word -1 -__String_A_tdt_entry__: .word -1 -__String_B_tdt_entry__: .word -1 -__String_C_tdt_entry__: .word -1 -__String_D_tdt_entry__: .word -1 __String_Main_tdt_entry__: .word -1 __Bool_Object_tdt_entry__: .word -1 __Bool_Int_tdt_entry__: .word -1 __Bool_String_tdt_entry__: .word -1 __Bool_Bool_tdt_entry__: .word 0 __Bool_IO_tdt_entry__: .word -1 -__Bool_A_tdt_entry__: .word -1 -__Bool_B_tdt_entry__: .word -1 -__Bool_C_tdt_entry__: .word -1 -__Bool_D_tdt_entry__: .word -1 __Bool_Main_tdt_entry__: .word -1 __IO_Object_tdt_entry__: .word -1 __IO_Int_tdt_entry__: .word -1 __IO_String_tdt_entry__: .word -1 __IO_Bool_tdt_entry__: .word -1 __IO_IO_tdt_entry__: .word 0 -__IO_A_tdt_entry__: .word -1 -__IO_B_tdt_entry__: .word -1 -__IO_C_tdt_entry__: .word 1 -__IO_D_tdt_entry__: .word 2 __IO_Main_tdt_entry__: .word 1 -__A_Object_tdt_entry__: .word -1 -__A_Int_tdt_entry__: .word -1 -__A_String_tdt_entry__: .word -1 -__A_Bool_tdt_entry__: .word -1 -__A_IO_tdt_entry__: .word -1 -__A_A_tdt_entry__: .word 0 -__A_B_tdt_entry__: .word 1 -__A_C_tdt_entry__: .word -1 -__A_D_tdt_entry__: .word -1 -__A_Main_tdt_entry__: .word -1 -__B_Object_tdt_entry__: .word -1 -__B_Int_tdt_entry__: .word -1 -__B_String_tdt_entry__: .word -1 -__B_Bool_tdt_entry__: .word -1 -__B_IO_tdt_entry__: .word -1 -__B_A_tdt_entry__: .word -1 -__B_B_tdt_entry__: .word 0 -__B_C_tdt_entry__: .word -1 -__B_D_tdt_entry__: .word -1 -__B_Main_tdt_entry__: .word -1 -__C_Object_tdt_entry__: .word -1 -__C_Int_tdt_entry__: .word -1 -__C_String_tdt_entry__: .word -1 -__C_Bool_tdt_entry__: .word -1 -__C_IO_tdt_entry__: .word -1 -__C_A_tdt_entry__: .word -1 -__C_B_tdt_entry__: .word -1 -__C_C_tdt_entry__: .word 0 -__C_D_tdt_entry__: .word 1 -__C_Main_tdt_entry__: .word -1 -__D_Object_tdt_entry__: .word -1 -__D_Int_tdt_entry__: .word -1 -__D_String_tdt_entry__: .word -1 -__D_Bool_tdt_entry__: .word -1 -__D_IO_tdt_entry__: .word -1 -__D_A_tdt_entry__: .word -1 -__D_B_tdt_entry__: .word -1 -__D_C_tdt_entry__: .word -1 -__D_D_tdt_entry__: .word 0 -__D_Main_tdt_entry__: .word -1 __Main_Object_tdt_entry__: .word -1 __Main_Int_tdt_entry__: .word -1 __Main_String_tdt_entry__: .word -1 __Main_Bool_tdt_entry__: .word -1 __Main_IO_tdt_entry__: .word -1 -__Main_A_tdt_entry__: .word -1 -__Main_B_tdt_entry__: .word -1 -__Main_C_tdt_entry__: .word -1 -__Main_D_tdt_entry__: .word -1 __Main_Main_tdt_entry__: .word 0 # -data_2: .asciiz "A: Hello world\n" +data_2: .asciiz "Enter n to find nth fibonacci number!\n" # -data_3: .asciiz "B: Hello world\n" -# - - -data_4: .asciiz "C: Hello world\n" -# - - -data_5: .asciiz "D: Hello world\n" -# - - -data_6: .asciiz "Done.\n" +data_3: .asciiz "\n" # @@ -444,132 +310,38 @@ entry: # Function END -# __A__attrib__io__init implementation. -# @Params: -__A__attrib__io__init: - # Allocate stack frame for function __A__attrib__io__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ib__io__init_internal_0 --> -4($fp) - # local_ib__io__init_internal_0 = ALLOCATE IO - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, IO - sw $t1, 0($v0) - la $t1, IO_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -4($fp) - # RETURN local_ib__io__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __A__attrib__io__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_a_at_A implementation. +# function_main_at_Main implementation. # @Params: -function_out_a_at_A: - # Allocate stack frame for function function_out_a_at_A. - subu $sp, $sp, 32 +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 76 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_out_a_at_A_internal_2 = GETATTRIBUTE io A - # LOCAL local_out_a_at_A_internal_2 --> -12($fp) - lw $t1, 8($s1) - sw $t1, -12($fp) - # LOCAL local_out_a_at_A_internal_0 --> -4($fp) - # LOCAL local_out_a_at_A_internal_2 --> -12($fp) - # local_out_a_at_A_internal_0 = local_out_a_at_A_internal_2 + addu $fp, $sp, 76 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 lw $t1, -12($fp) sw $t1, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_out_a_at_A_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) # la $t1, data_2 sw $t1, -16($fp) - # ARG local_out_a_at_A_internal_3 - # LOCAL local_out_a_at_A_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_out_a_at_A_internal_0 --> -4($fp) - # LOCAL local_out_a_at_A_internal_1 --> -8($fp) - # local_out_a_at_A_internal_1 = VCALL local_out_a_at_A_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_out_a_at_A_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_a_at_A. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_b_at_B implementation. -# @Params: -function_out_b_at_B: - # Allocate stack frame for function function_out_b_at_B. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_out_b_at_B_internal_2 = GETATTRIBUTE io B - # LOCAL local_out_b_at_B_internal_2 --> -12($fp) - lw $t1, 8($s1) - sw $t1, -12($fp) - # LOCAL local_out_b_at_B_internal_0 --> -4($fp) - # LOCAL local_out_b_at_B_internal_2 --> -12($fp) - # local_out_b_at_B_internal_0 = local_out_b_at_B_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_out_b_at_B_internal_3 --> -16($fp) - # - la $t1, data_3 - sw $t1, -16($fp) - # ARG local_out_b_at_B_internal_3 - # LOCAL local_out_b_at_B_internal_3 --> -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) lw $t1, -16($fp) # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) - # LOCAL local_out_b_at_B_internal_0 --> -4($fp) - # LOCAL local_out_b_at_B_internal_1 --> -8($fp) - # local_out_b_at_B_internal_1 = VCALL local_out_b_at_B_internal_0 out_string + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type @@ -584,178 +356,44 @@ function_out_b_at_B: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN local_out_b_at_B_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_b_at_B. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_c_at_C implementation. -# @Params: -function_out_c_at_C: - # Allocate stack frame for function function_out_c_at_C. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_out_c_at_C_internal_2 --> -12($fp) - # local_out_c_at_C_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_out_c_at_C_internal_0 --> -4($fp) - # LOCAL local_out_c_at_C_internal_2 --> -12($fp) - # local_out_c_at_C_internal_0 = local_out_c_at_C_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_6 + lw $t1, -28($fp) + sw $t1, -20($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_out_c_at_C_internal_3 --> -16($fp) - # - la $t1, data_4 - sw $t1, -16($fp) - # ARG local_out_c_at_C_internal_3 - # LOCAL local_out_c_at_C_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_out_c_at_C_internal_0 --> -4($fp) - # LOCAL local_out_c_at_C_internal_1 --> -8($fp) - # local_out_c_at_C_internal_1 = VCALL local_out_c_at_C_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_out_c_at_C_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_c_at_C. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_d_at_D implementation. -# @Params: -function_out_d_at_D: - # Allocate stack frame for function function_out_d_at_D. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_out_d_at_D_internal_2 --> -12($fp) - # local_out_d_at_D_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_out_d_at_D_internal_0 --> -4($fp) - # LOCAL local_out_d_at_D_internal_2 --> -12($fp) - # local_out_d_at_D_internal_0 = local_out_d_at_D_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = SELF + sw $s1, -40($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 + lw $t1, -40($fp) + sw $t1, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_out_d_at_D_internal_3 --> -16($fp) - # - la $t1, data_5 - sw $t1, -16($fp) - # ARG local_out_d_at_D_internal_3 - # LOCAL local_out_d_at_D_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_out_d_at_D_internal_0 --> -4($fp) - # LOCAL local_out_d_at_D_internal_1 --> -8($fp) - # local_out_d_at_D_internal_1 = VCALL local_out_d_at_D_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_out_d_at_D_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_d_at_D. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 72 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 72 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = ALLOCATE A - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - la $t1, A - sw $t1, 0($v0) - la $t1, A_start - sw $t1, 4($v0) - move $t2, $v0 - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __A__attrib__io__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 8($t2) - sw $t2, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 + lw $t1, -52($fp) + sw $t1, -44($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_a + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 in_int # Save new self pointer in $s1 - lw $s1, -4($fp) + lw $s1, -44($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -764,155 +402,82 @@ function_main_at_Main: lw $t3, 12($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -8($fp) + sw $v0, -48($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = ALLOCATE B - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - la $t1, B - sw $t1, 0($v0) - la $t1, B_start - sw $t1, 4($v0) - move $t2, $v0 - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __A__attrib__io__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 8($t2) - sw $t2, -24($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 - lw $t1, -24($fp) - sw $t1, -16($fp) - # Push register s1 into stack + # ARG local_main_at_Main_internal_11 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + lw $t1, -48($fp) + # Push arg into stack subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 out_b + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 fib # Save new self pointer in $s1 - lw $s1, -16($fp) + lw $s1, -32($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 16($t2) + lw $t3, 32($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -20($fp) + sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_8 # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = ALLOCATE C - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, C - sw $t1, 0($v0) - la $t1, C_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -36($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 lw $t1, -36($fp) - sw $t1, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_c - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 28($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = ALLOCATE D - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, D - sw $t1, 0($v0) - la $t1, D_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -48($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) - # Push register s1 into stack + # Push arg into stack subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_d + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 out_int # Save new self pointer in $s1 - lw $s1, -40($fp) + lw $s1, -20($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 32($t2) + lw $t3, 4($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -44($fp) + sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 - lw $t1, -60($fp) - sw $t1, -52($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 + lw $t1, -64($fp) + sw $t1, -56($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) # - la $t1, data_6 - sw $t1, -64($fp) - # ARG local_main_at_Main_internal_15 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - lw $t1, -64($fp) + la $t1, data_3 + sw $t1, -68($fp) + # ARG local_main_at_Main_internal_16 + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + lw $t1, -68($fp) # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 out_string # Save new self pointer in $s1 - lw $s1, -52($fp) + lw $s1, -56($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -921,20 +486,136 @@ function_main_at_Main: lw $t3, 0($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -56($fp) + sw $v0, -60($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_13 - lw $v0, -56($fp) + # RETURN local_main_at_Main_internal_14 + lw $v0, -60($fp) # Deallocate stack frame for function function_main_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 72 + addu $sp, $sp, 76 jr $ra # Function END +# function_fib_at_Main implementation. +# @Params: +# 0($fp) = param_fib_at_Main_i_0 +function_fib_at_Main: + # Allocate stack frame for function function_fib_at_Main. + subu $sp, $sp, 36 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 36 + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # local_fib_at_Main_a_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + # LOCAL local_fib_at_Main_b_1 --> -8($fp) + # local_fib_at_Main_b_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # LOCAL local_fib_at_Main_c_2 --> -12($fp) + # local_fib_at_Main_c_2 = 0 + li $t1, 0 + sw $t1, -12($fp) + label_WHILE_1: + # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # local_fib_at_Main_internal_3 = PARAM param_fib_at_Main_i_0 - 0 + lw $t1, 0($fp) + sub $t1, $t1, 0 + sw $t1, -16($fp) + # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 + # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 + lw $t1, -16($fp) + beq $t1, 0, label_TRUE_3 + # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # local_fib_at_Main_internal_3 = 0 + li $t1, 0 + sw $t1, -16($fp) + # GOTO label_END_4 + j label_END_4 + label_TRUE_3: + # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # local_fib_at_Main_internal_3 = 1 + li $t1, 1 + sw $t1, -16($fp) + label_END_4: + # IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 + # IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 + lw $t1, -16($fp) + beq $t1, 0, label_FALSE_5 + # LOCAL local_fib_at_Main_internal_4 --> -20($fp) + # local_fib_at_Main_internal_4 = 0 + li $t1, 0 + sw $t1, -20($fp) + # GOTO label_NOT_END_6 + j label_NOT_END_6 + label_FALSE_5: + # LOCAL local_fib_at_Main_internal_4 --> -20($fp) + # local_fib_at_Main_internal_4 = 1 + li $t1, 1 + sw $t1, -20($fp) + label_NOT_END_6: + # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 + # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 + lw $t1, -20($fp) + beq $t1, 0, label_WHILE_END_2 + # LOCAL local_fib_at_Main_internal_5 --> -24($fp) + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # LOCAL local_fib_at_Main_b_1 --> -8($fp) + # local_fib_at_Main_internal_5 = local_fib_at_Main_a_0 + local_fib_at_Main_b_1 + lw $t1, -4($fp) + lw $t2, -8($fp) + add $t1, $t1, $t2 + sw $t1, -24($fp) + # LOCAL local_fib_at_Main_c_2 --> -12($fp) + # LOCAL local_fib_at_Main_internal_5 --> -24($fp) + # local_fib_at_Main_c_2 = local_fib_at_Main_internal_5 + lw $t1, -24($fp) + sw $t1, -12($fp) + # LOCAL local_fib_at_Main_internal_6 --> -28($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # local_fib_at_Main_internal_6 = PARAM param_fib_at_Main_i_0 - 1 + lw $t1, 0($fp) + sub $t1, $t1, 1 + sw $t1, -28($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # LOCAL local_fib_at_Main_internal_6 --> -28($fp) + # PARAM param_fib_at_Main_i_0 = local_fib_at_Main_internal_6 + lw $t1, -28($fp) + sw $t1, 0($fp) + # LOCAL local_fib_at_Main_b_1 --> -8($fp) + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # local_fib_at_Main_b_1 = local_fib_at_Main_a_0 + lw $t1, -4($fp) + sw $t1, -8($fp) + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # LOCAL local_fib_at_Main_c_2 --> -12($fp) + # local_fib_at_Main_a_0 = local_fib_at_Main_c_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # GOTO label_WHILE_1 + j label_WHILE_1 + label_WHILE_END_2: + # RETURN local_fib_at_Main_c_2 + lw $v0, -12($fp) + # Deallocate stack frame for function function_fib_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 36 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + diff --git a/src/testing.py b/src/testing.py index 7b991e01..15b5aea5 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,110 +60,34 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""(* - * The IO class is predefined and has 4 methods: - * - * out_string(s : String) : SELF_TYPE - * out_int(i : Int) : SELF_TYPE - * in_string() : String - * in_int() : Int - * - * The out operations print their argument to the terminal. The - * in_string method reads an entire line from the terminal and returns a - * string not containing the new line. The in_int method also reads - * an entire line from the terminal and returns the integer - * corresponding to the first non blank word on the line. If that - * word is not an integer, it returns 0. - * - * - * Because our language is object oriented, we need an object of type - * IO in order to call any of these methods. - * - * There are basically two ways of getting access to IO in a class C. - * - * 1) Define C to Inherit from IO. This way the IO methods become - * methods of C, and they can be called using the abbreviated - * dispatch, i.e. - * - * class C inherits IO is - * ... - * out_string("Hello world\n") - * ... - * end; - * - * 2) If your class C does not directly or indirectly inherit from - * IO, the best way to access IO is through an initialized - * attribute of type IO. - * - * class C inherits Foo is - * io : IO <- new IO; - * ... - * io.out_string("Hello world\n"); - * ... - * end; - * - * Approach 1) is most often used, in particular when you need IO - * functions in the Main class. - * - *) - - -class A { - - -- Let's assume that we don't want A to not inherit from IO. - - io : IO <- new IO; - - out_a() : Object { io.out_string("A: Hello world\n") }; - -}; - - -class B inherits A { - - -- B does not have to an extra attribute, since it inherits io from A. - - out_b() : Object { io.out_string("B: Hello world\n") }; - -}; - - -class C inherits IO { - - -- Now the IO methods are part of C. - - out_c() : Object { out_string("C: Hello world\n") }; - - -- Note that out_string(...) is just a shorthand for self.out_string(...) - -}; - - -class D inherits C { - - -- Inherits IO methods from C. - - out_d() : Object { out_string("D: Hello world\n") }; +text = r"""class Main inherits IO { + -- the class has features. Only methods in this case. + main(): Object { + { + out_string("Enter n to find nth fibonacci number!\n"); + out_int(fib(in_int())); + out_string("\n"); + } + }; + + fib(i : Int) : Int { -- list of formals. And the return type of the method. + let a : Int <- 1, + b : Int <- 0, + c : Int <- 0 + in + { + while (not (i = 0)) loop -- expressions are nested. + { + c <- a + b; + i <- i - 1; + b <- a; + a <- c; + } + pool; + c; + } + }; }; - - -class Main inherits IO { - - -- Same case as class C. - - main() : Object { - { - (new A).out_a(); - (new B).out_b(); - (new C).out_c(); - (new D).out_d(); - out_string("Done.\n"); - } - }; - -}; - - """ pipeline(text, 5) diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index a8e69dd7..b1a67355 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -37,8 +37,10 @@ PrintIntNode, PrintNode, ReadIntNode, - ReadNode, RestoreSelf, - ReturnNode, SaveSelf, + ReadNode, + RestoreSelf, + ReturnNode, + SaveSelf, SetAtAddress, SetAttributeNode, StarNode, @@ -111,7 +113,9 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: for attribute in self.current_type.parent.attributes: new_type_node.attributes.append(attribute) - parent = next(t for t in self.dot_types if t.name == self.current_type.parent.name) + parent = next( + t for t in self.dot_types if t.name == self.current_type.parent.name + ) for method, _ in parent.methods: # Manejar la redefinicion de metodos @@ -248,11 +252,12 @@ def _(self, node: coolAst.IfThenElseNode, scope: Scope) -> None: # noqa: F811 @visit.register def _(self, node: coolAst.VariableDeclaration, scope: Scope) -> CilNode: - for var_idx, var_type, var_init_expr in node.var_list: + scope = scope.children[0] + for var_idx, var_type, var_init_expr, _, _ in node.var_list: # Registrar las variables en orden. var_info = scope.find_variable(var_idx) - assert var_info is not None + assert var_info is not None, f"Var not found {var_idx}" local_var = self.register_local(var_info) # Reservar memoria para la variable y realizar su inicializacion si tiene @@ -278,25 +283,7 @@ def _(self, node: coolAst.VariableDeclaration, scope: Scope) -> CilNode: @visit.register def _(self, node: coolAst.VariableCall, scope: Scope): - vinfo = scope.find_variable(node.idx) - # Diferenciar la variable si es un parametro, un atributo o una variable local - # en el scope actual - if vinfo.location == "PARAM": - - for param_node in self.params: - if vinfo.name in param_node.name: - return param_node - if vinfo.location == "ATTRIBUTE": - local = self.define_internal_local() - assert self.current_type is not None - self.register_instruction( - GetAttributeNode(self.current_type, vinfo.name, local) - ) - return local - if vinfo.location == "LOCAL": - for local_node in self.localvars: - if vinfo.name in local_node.name: - return local_node + return self.visit(node.idx, scope) @visit.register def _(self, node: coolAst.InstantiateClassNode, scope: Scope) -> LocalNode: @@ -323,14 +310,28 @@ def _(self, node: coolAst.AssignNode, scope: Scope): # ya ha sido definida # Generar el codigo para el rvalue (expr) - rvalue_vm_holder = self.visit(self, node.expr) + rvalue_vm_holder = self.visit(node.expr, scope) + var_inf = scope.find_variable(node.idx) # Es necesario diferenciar entre variable y atributo. # Las variables se diferencian en si son locales al # metodo que estamos creando o si son atributos. - if isinstance(rvalue_vm_holder, ParamNode) or scope.is_local(node.idx): + if var_inf.location == "PARAM": + # Buscar la variable en los parametros + var = next( + v + for v in self.params + if f"param_{self.current_function.name[9:]}_{var_inf.name}_" in v.name + ) # registrar la instruccion de asignacion - self.register_instruction(AssignNode(node.idx, rvalue_vm_holder)) + self.register_instruction(AssignNode(var, rvalue_vm_holder)) + elif var_inf.location == "LOCAL": + var = next( + v + for v in self.localvars + if f"local_{self.current_function.name[9:]}_{var_inf.name}_" in v.name + ) + self.register_instruction(AssignNode(var, rvalue_vm_holder)) else: assert self.current_type is not None assert isinstance(rvalue_vm_holder, LocalNode) @@ -338,6 +339,37 @@ def _(self, node: coolAst.AssignNode, scope: Scope): SetAttributeNode(self.current_type, node.idx, rvalue_vm_holder) ) + @visit.register + def _(self, node: str, scope: Scope): + var_inf = scope.find_variable(node) + + # Es necesario diferenciar entre variable y atributo. + # Las variables se diferencian en si son locales al + # metodo que estamos creando o si son atributos. + if var_inf.location == "PARAM": + # Buscar la variable en los parametros + var = next( + v + for v in self.params + if f"param_{self.current_function.name[9:]}_{var_inf.name}_" in v.name + ) + # registrar la instruccion de asignacion + return var + elif var_inf.location == "LOCAL": + var = next( + v + for v in self.localvars + if f"local_{self.current_function.name[9:]}_{var_inf.name}_" in v.name + ) + return var + else: + local = self.define_internal_local() + assert self.current_type is not None + self.register_instruction( + GetAttributeNode(self.current_type, var_inf.name, local) + ) + return local + @visit.register def _(self, node: coolAst.WhileBlockNode, scope: Scope): # Evaluar la condicion y definir un LABEL al cual @@ -467,10 +499,6 @@ def _(self, node: coolAst.DifNode, scope: Scope) -> LocalNode: # Obtener el resultado del sustraendo right_vm_holder = self.visit(node.right, scope) - # Registrar la instruccion de resta - assert isinstance(left_vm_holder, LocalNode) and isinstance( - right_vm_holder, LocalNode - ) self.register_instruction( MinusNode(left_vm_holder, right_vm_holder, minus_internal_vm_holder) ) @@ -569,9 +597,19 @@ def _(self, node: coolAst.NegNode, scope: Scope): ) return result_vm_holder else: + false_label = self.do_label("FALSE") + not_end_label = self.do_label("NOT_END") assert isinstance(expr_result, LocalNode) - self.register_instruction(NotNode(expr_result)) - return expr_result + # Si expr = 0 entonces devolver 1 + self.register_instruction(IfZeroJump(expr_result, false_label)) + # Si expr = 1 devolver 0 + self.register_instruction(AssignNode(result_vm_holder, 0)) + self.register_instruction(UnconditionalJump(not_end_label)) + self.register_instruction(LabelNode(false_label)) + # Si expr = 0 entonces devolver 1 + self.register_instruction(AssignNode(result_vm_holder, 1)) + self.register_instruction(LabelNode(not_end_label)) + return result_vm_holder @visit.register def _(self, node: coolAst.EqualToNode, scope: Scope) -> LocalNode: diff --git a/src/travels/inference.py b/src/travels/inference.py index ccad8f35..d89c1167 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -334,6 +334,8 @@ def _( ): if deep == 1: scope = scope.create_child() + else: + scope = scope.children[0] for var_id, var_type, var_init_expr, l , c in node.var_list: try: type_ = self.context.get_type(var_type) diff --git a/testing.mips b/testing.mips new file mode 100644 index 00000000..e69de29b diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips new file mode 100644 index 00000000..0f79cf5b --- /dev/null +++ b/tests/codegen/fib.mips @@ -0,0 +1,620 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 10:38:43 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# + + +# **** Type RECORD for type IO **** +IO_start: +IO_vtable_pointer: .word IO_vtable +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# + + +# **** Type RECORD for type Object **** +Object_start: +Object_vtable_pointer: .word Object_vtable +Object_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main, function_fib_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: +Main_vtable_pointer: .word Main_vtable +Main_end: +# + + +data_0: .asciiz "" +# + + +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_Main_tdt_entry__: .word 1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +data_2: .asciiz "Enter n to find nth fibonacci number!\n" +# + + +data_3: .asciiz "\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, Main + sw $t1, 0($v0) + la $t1, Main_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 76 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 76 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # + la $t1, data_2 + sw $t1, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_6 + lw $t1, -28($fp) + sw $t1, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = SELF + sw $s1, -40($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 + lw $t1, -40($fp) + sw $t1, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 + lw $t1, -52($fp) + sw $t1, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 in_int + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_11 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + lw $t1, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 fib + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 32($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_8 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + lw $t1, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 out_int + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 4($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 + lw $t1, -64($fp) + sw $t1, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # + la $t1, data_3 + sw $t1, -68($fp) + # ARG local_main_at_Main_internal_16 + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + lw $t1, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 out_string + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_14 + lw $v0, -60($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 76 + jr $ra + # Function END + + +# function_fib_at_Main implementation. +# @Params: +# 0($fp) = param_fib_at_Main_i_0 +function_fib_at_Main: + # Allocate stack frame for function function_fib_at_Main. + subu $sp, $sp, 36 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 36 + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # local_fib_at_Main_a_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + # LOCAL local_fib_at_Main_b_1 --> -8($fp) + # local_fib_at_Main_b_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # LOCAL local_fib_at_Main_c_2 --> -12($fp) + # local_fib_at_Main_c_2 = 0 + li $t1, 0 + sw $t1, -12($fp) + label_WHILE_1: + # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # local_fib_at_Main_internal_3 = PARAM param_fib_at_Main_i_0 - 0 + lw $t1, 0($fp) + sub $t1, $t1, 0 + sw $t1, -16($fp) + # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 + # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 + lw $t1, -16($fp) + beq $t1, 0, label_TRUE_3 + # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # local_fib_at_Main_internal_3 = 0 + li $t1, 0 + sw $t1, -16($fp) + # GOTO label_END_4 + j label_END_4 + label_TRUE_3: + # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # local_fib_at_Main_internal_3 = 1 + li $t1, 1 + sw $t1, -16($fp) + label_END_4: + # IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 + # IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 + lw $t1, -16($fp) + beq $t1, 0, label_FALSE_5 + # LOCAL local_fib_at_Main_internal_4 --> -20($fp) + # local_fib_at_Main_internal_4 = 0 + li $t1, 0 + sw $t1, -20($fp) + # GOTO label_NOT_END_6 + j label_NOT_END_6 + label_FALSE_5: + # LOCAL local_fib_at_Main_internal_4 --> -20($fp) + # local_fib_at_Main_internal_4 = 1 + li $t1, 1 + sw $t1, -20($fp) + label_NOT_END_6: + # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 + # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 + lw $t1, -20($fp) + beq $t1, 0, label_WHILE_END_2 + # LOCAL local_fib_at_Main_internal_5 --> -24($fp) + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # LOCAL local_fib_at_Main_b_1 --> -8($fp) + # local_fib_at_Main_internal_5 = local_fib_at_Main_a_0 + local_fib_at_Main_b_1 + lw $t1, -4($fp) + lw $t2, -8($fp) + add $t1, $t1, $t2 + sw $t1, -24($fp) + # LOCAL local_fib_at_Main_c_2 --> -12($fp) + # LOCAL local_fib_at_Main_internal_5 --> -24($fp) + # local_fib_at_Main_c_2 = local_fib_at_Main_internal_5 + lw $t1, -24($fp) + sw $t1, -12($fp) + # LOCAL local_fib_at_Main_internal_6 --> -28($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # local_fib_at_Main_internal_6 = PARAM param_fib_at_Main_i_0 - 1 + lw $t1, 0($fp) + sub $t1, $t1, 1 + sw $t1, -28($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # LOCAL local_fib_at_Main_internal_6 --> -28($fp) + # PARAM param_fib_at_Main_i_0 = local_fib_at_Main_internal_6 + lw $t1, -28($fp) + sw $t1, 0($fp) + # LOCAL local_fib_at_Main_b_1 --> -8($fp) + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # local_fib_at_Main_b_1 = local_fib_at_Main_a_0 + lw $t1, -4($fp) + sw $t1, -8($fp) + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # LOCAL local_fib_at_Main_c_2 --> -12($fp) + # local_fib_at_Main_a_0 = local_fib_at_Main_c_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # GOTO label_WHILE_1 + j label_WHILE_1 + label_WHILE_END_2: + # RETURN local_fib_at_Main_c_2 + lw $v0, -12($fp) + # Deallocate stack frame for function function_fib_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 36 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips new file mode 100644 index 00000000..292cb9fa --- /dev/null +++ b/tests/codegen/hello_world.mips @@ -0,0 +1,366 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 10:38:42 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# + + +# **** Type RECORD for type IO **** +IO_start: +IO_vtable_pointer: .word IO_vtable +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# + + +# **** Type RECORD for type Object **** +Object_start: +Object_vtable_pointer: .word Object_vtable +Object_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: +Main_vtable_pointer: .word Main_vtable +Main_end: +# + + +data_0: .asciiz "" +# + + +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_Main_tdt_entry__: .word 1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +data_2: .asciiz "Hello, World.\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, Main + sw $t1, 0($v0) + la $t1, Main_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # + la $t1, data_2 + sw $t1, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips new file mode 100644 index 00000000..5dd23842 --- /dev/null +++ b/tests/codegen/io.mips @@ -0,0 +1,939 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 10:38:43 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +A: .asciiz "A" +# Function END +B: .asciiz "B" +# Function END +C: .asciiz "C" +# Function END +D: .asciiz "D" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# + + +# **** Type RECORD for type IO **** +IO_start: +IO_vtable_pointer: .word IO_vtable +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# + + +# **** Type RECORD for type Object **** +Object_start: +Object_vtable_pointer: .word Object_vtable +Object_end: +# + + +# **** VTABLE for type A **** +A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A +# + + +# **** Type RECORD for type A **** +A_start: +A_vtable_pointer: .word A_vtable +A_attrib_io: .word 0 +A_end: +# + + +# **** VTABLE for type B **** +B_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A, function_out_b_at_B +# + + +# **** Type RECORD for type B **** +B_start: +B_vtable_pointer: .word B_vtable +B_attrib_io: .word 0 +B_end: +# + + +# **** VTABLE for type C **** +C_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_c_at_C +# + + +# **** Type RECORD for type C **** +C_start: +C_vtable_pointer: .word C_vtable +C_end: +# + + +# **** VTABLE for type D **** +D_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_c_at_C, function_out_d_at_D +# + + +# **** Type RECORD for type D **** +D_start: +D_vtable_pointer: .word D_vtable +D_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: +Main_vtable_pointer: .word Main_vtable +Main_end: +# + + +data_0: .asciiz "" +# + + +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_A_tdt_entry__: .word 1 +__Object_B_tdt_entry__: .word 2 +__Object_C_tdt_entry__: .word 2 +__Object_D_tdt_entry__: .word 3 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_A_tdt_entry__: .word -1 +__Int_B_tdt_entry__: .word -1 +__Int_C_tdt_entry__: .word -1 +__Int_D_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_A_tdt_entry__: .word -1 +__String_B_tdt_entry__: .word -1 +__String_C_tdt_entry__: .word -1 +__String_D_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_A_tdt_entry__: .word -1 +__Bool_B_tdt_entry__: .word -1 +__Bool_C_tdt_entry__: .word -1 +__Bool_D_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_A_tdt_entry__: .word -1 +__IO_B_tdt_entry__: .word -1 +__IO_C_tdt_entry__: .word 1 +__IO_D_tdt_entry__: .word 2 +__IO_Main_tdt_entry__: .word 1 +__A_Object_tdt_entry__: .word -1 +__A_Int_tdt_entry__: .word -1 +__A_String_tdt_entry__: .word -1 +__A_Bool_tdt_entry__: .word -1 +__A_IO_tdt_entry__: .word -1 +__A_A_tdt_entry__: .word 0 +__A_B_tdt_entry__: .word 1 +__A_C_tdt_entry__: .word -1 +__A_D_tdt_entry__: .word -1 +__A_Main_tdt_entry__: .word -1 +__B_Object_tdt_entry__: .word -1 +__B_Int_tdt_entry__: .word -1 +__B_String_tdt_entry__: .word -1 +__B_Bool_tdt_entry__: .word -1 +__B_IO_tdt_entry__: .word -1 +__B_A_tdt_entry__: .word -1 +__B_B_tdt_entry__: .word 0 +__B_C_tdt_entry__: .word -1 +__B_D_tdt_entry__: .word -1 +__B_Main_tdt_entry__: .word -1 +__C_Object_tdt_entry__: .word -1 +__C_Int_tdt_entry__: .word -1 +__C_String_tdt_entry__: .word -1 +__C_Bool_tdt_entry__: .word -1 +__C_IO_tdt_entry__: .word -1 +__C_A_tdt_entry__: .word -1 +__C_B_tdt_entry__: .word -1 +__C_C_tdt_entry__: .word 0 +__C_D_tdt_entry__: .word 1 +__C_Main_tdt_entry__: .word -1 +__D_Object_tdt_entry__: .word -1 +__D_Int_tdt_entry__: .word -1 +__D_String_tdt_entry__: .word -1 +__D_Bool_tdt_entry__: .word -1 +__D_IO_tdt_entry__: .word -1 +__D_A_tdt_entry__: .word -1 +__D_B_tdt_entry__: .word -1 +__D_C_tdt_entry__: .word -1 +__D_D_tdt_entry__: .word 0 +__D_Main_tdt_entry__: .word -1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_A_tdt_entry__: .word -1 +__Main_B_tdt_entry__: .word -1 +__Main_C_tdt_entry__: .word -1 +__Main_D_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +data_2: .asciiz "A: Hello world\n" +# + + +data_3: .asciiz "B: Hello world\n" +# + + +data_4: .asciiz "C: Hello world\n" +# + + +data_5: .asciiz "D: Hello world\n" +# + + +data_6: .asciiz "Done.\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, Main + sw $t1, 0($v0) + la $t1, Main_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __A__attrib__io__init implementation. +# @Params: +__A__attrib__io__init: + # Allocate stack frame for function __A__attrib__io__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ib__io__init_internal_0 --> -4($fp) + # local_ib__io__init_internal_0 = ALLOCATE IO + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, IO + sw $t1, 0($v0) + la $t1, IO_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -4($fp) + # RETURN local_ib__io__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __A__attrib__io__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_a_at_A implementation. +# @Params: +function_out_a_at_A: + # Allocate stack frame for function function_out_a_at_A. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_out_a_at_A_internal_2 = GETATTRIBUTE io A + # LOCAL local_out_a_at_A_internal_2 --> -12($fp) + lw $t1, 8($s1) + sw $t1, -12($fp) + # LOCAL local_out_a_at_A_internal_0 --> -4($fp) + # LOCAL local_out_a_at_A_internal_2 --> -12($fp) + # local_out_a_at_A_internal_0 = local_out_a_at_A_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_out_a_at_A_internal_3 --> -16($fp) + # + la $t1, data_2 + sw $t1, -16($fp) + # ARG local_out_a_at_A_internal_3 + # LOCAL local_out_a_at_A_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_out_a_at_A_internal_0 --> -4($fp) + # LOCAL local_out_a_at_A_internal_1 --> -8($fp) + # local_out_a_at_A_internal_1 = VCALL local_out_a_at_A_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_out_a_at_A_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_a_at_A. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_b_at_B implementation. +# @Params: +function_out_b_at_B: + # Allocate stack frame for function function_out_b_at_B. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_out_b_at_B_internal_2 = GETATTRIBUTE io B + # LOCAL local_out_b_at_B_internal_2 --> -12($fp) + lw $t1, 8($s1) + sw $t1, -12($fp) + # LOCAL local_out_b_at_B_internal_0 --> -4($fp) + # LOCAL local_out_b_at_B_internal_2 --> -12($fp) + # local_out_b_at_B_internal_0 = local_out_b_at_B_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_out_b_at_B_internal_3 --> -16($fp) + # + la $t1, data_3 + sw $t1, -16($fp) + # ARG local_out_b_at_B_internal_3 + # LOCAL local_out_b_at_B_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_out_b_at_B_internal_0 --> -4($fp) + # LOCAL local_out_b_at_B_internal_1 --> -8($fp) + # local_out_b_at_B_internal_1 = VCALL local_out_b_at_B_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_out_b_at_B_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_b_at_B. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_c_at_C implementation. +# @Params: +function_out_c_at_C: + # Allocate stack frame for function function_out_c_at_C. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_out_c_at_C_internal_2 --> -12($fp) + # local_out_c_at_C_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_out_c_at_C_internal_0 --> -4($fp) + # LOCAL local_out_c_at_C_internal_2 --> -12($fp) + # local_out_c_at_C_internal_0 = local_out_c_at_C_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_out_c_at_C_internal_3 --> -16($fp) + # + la $t1, data_4 + sw $t1, -16($fp) + # ARG local_out_c_at_C_internal_3 + # LOCAL local_out_c_at_C_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_out_c_at_C_internal_0 --> -4($fp) + # LOCAL local_out_c_at_C_internal_1 --> -8($fp) + # local_out_c_at_C_internal_1 = VCALL local_out_c_at_C_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_out_c_at_C_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_c_at_C. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_d_at_D implementation. +# @Params: +function_out_d_at_D: + # Allocate stack frame for function function_out_d_at_D. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_out_d_at_D_internal_2 --> -12($fp) + # local_out_d_at_D_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_out_d_at_D_internal_0 --> -4($fp) + # LOCAL local_out_d_at_D_internal_2 --> -12($fp) + # local_out_d_at_D_internal_0 = local_out_d_at_D_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_out_d_at_D_internal_3 --> -16($fp) + # + la $t1, data_5 + sw $t1, -16($fp) + # ARG local_out_d_at_D_internal_3 + # LOCAL local_out_d_at_D_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_out_d_at_D_internal_0 --> -4($fp) + # LOCAL local_out_d_at_D_internal_1 --> -8($fp) + # local_out_d_at_D_internal_1 = VCALL local_out_d_at_D_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_out_d_at_D_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_d_at_D. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 72 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 72 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = ALLOCATE A + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + la $t1, A + sw $t1, 0($v0) + la $t1, A_start + sw $t1, 4($v0) + move $t2, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __A__attrib__io__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 8($t2) + sw $t2, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_a + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = ALLOCATE B + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + la $t1, B + sw $t1, 0($v0) + la $t1, B_start + sw $t1, 4($v0) + move $t2, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __A__attrib__io__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 8($t2) + sw $t2, -24($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 + lw $t1, -24($fp) + sw $t1, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 out_b + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 16($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = ALLOCATE C + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, C + sw $t1, 0($v0) + la $t1, C_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -36($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 + lw $t1, -36($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_c + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 28($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = ALLOCATE D + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, D + sw $t1, 0($v0) + la $t1, D_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -48($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 + lw $t1, -48($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_d + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 32($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 + lw $t1, -60($fp) + sw $t1, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # + la $t1, data_6 + sw $t1, -64($fp) + # ARG local_main_at_Main_internal_15 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + lw $t1, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_13 + lw $v0, -56($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 72 + jr $ra + # Function END + From c39d44dd206e862c12ebbbdcd90ebe500189f2cb Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 3 Dec 2020 11:35:55 -0500 Subject: [PATCH 134/162] Fix let regex containing "space" --- src/.builds | 2 + src/coolgrammar/grammar.py | 2 +- src/parserr/shiftreduce.py | 42 +- src/testing.mips | 622 +--------------------- src/testing.py | 42 +- tests/codegen/fib.mips | 620 ---------------------- tests/codegen/hello_world.mips | 366 ------------- tests/codegen/io.mips | 939 --------------------------------- 8 files changed, 42 insertions(+), 2593 deletions(-) delete mode 100644 tests/codegen/fib.mips delete mode 100644 tests/codegen/hello_world.mips delete mode 100644 tests/codegen/io.mips diff --git a/src/.builds b/src/.builds index 3e8196e4..fcb465a0 100644 --- a/src/.builds +++ b/src/.builds @@ -207,3 +207,5 @@ 1 1 1 +1 +1 diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index f2e40e09..657c8185 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -428,7 +428,7 @@ def build_cool_grammar(): (implies, r"=>"), (div, "/"), (star, r"\*"), - (let, r"(?i) let"), + (let, r"(?i)let"), (fi, r"(?i)fi"), (pool, r"(?i)pool"), (loop, r"(?i)loop"), diff --git a/src/parserr/shiftreduce.py b/src/parserr/shiftreduce.py index da6cf590..7ed536a6 100755 --- a/src/parserr/shiftreduce.py +++ b/src/parserr/shiftreduce.py @@ -1,13 +1,13 @@ -''' +""" Este modulo contiene la declaracion de la clase ShiftReduceParser, la cual sirve de base para los parsers SLR, LALR y LR -''' +""" from typing import Dict, List, Literal, Tuple, Union from grammar.grammar import EOF, Grammar from grammar.symbols import Production, Terminal from lexer.tokens import Token -Action = Union[Literal['SHIFT'], Literal['REDUCE'], Literal['OK']] +Action = Union[Literal["SHIFT"], Literal["REDUCE"], Literal["OK"]] Tag = Union[Production, int] ActionTableEntry = Tuple[int, Terminal] @@ -19,9 +19,10 @@ class ShiftReduceParser: cuyo funcionamiento se base en las acciones shift reduce deben heredar de esta clase e implementar el metodo build_parsing_table. """ - SHIFT = 'SHIFT' - REDUCE = 'REDUCE' - OK = 'OK' + + SHIFT = "SHIFT" + REDUCE = "REDUCE" + OK = "OK" def __init__(self, G: Grammar, verbose: bool = False): self.G = G @@ -39,8 +40,7 @@ def __call__(self, tokens: List[Token]): output = [] if isinstance(tokens[0].token_type, EOF): - raise SyntaxError( - "(0,0) - SyntacticError: Cool program must not be empty.") + raise SyntaxError("(0,0) - SyntacticError: Cool program must not be empty.") while True: state = stack[-1] @@ -49,13 +49,18 @@ def __call__(self, tokens: List[Token]): action, tag = self.action[state, lookahead] except KeyError: col = tokens[cursor].token_column - len(tokens[cursor].lex) - if lookahead.Name == "self" or (lookahead.Name == "assign" and tokens[cursor - 1].token_type.Name == "self"): - raise SyntaxError(f'({tokens[cursor].token_line},{col}) - ' + - f' SemanticError: ERROR "%s"' % - tokens[cursor].lex) - raise SyntaxError(f'({tokens[cursor].token_line},{col}) - ' + - f' SyntacticError: ERROR "%s"' % - tokens[cursor].lex) + if lookahead.Name == "self" or ( + lookahead.Name == "assign" + and tokens[cursor - 1].token_type.Name == "self" + ): + raise SyntaxError( + f"({tokens[cursor].token_line},{col}) - " + + f' SemanticError: ERROR "%s"' % tokens[cursor].lex + ) + raise SyntaxError( + f"({tokens[cursor].token_line},{col}) - " + + f' SyntacticError: ERROR "%s"' % tokens[cursor] + ) if action == self.SHIFT: cursor += 1 @@ -78,14 +83,14 @@ def __call__(self, tokens: List[Token]): return output[::-1] else: - raise Exception('La cadena no pertenece al lenguaje') + raise Exception("La cadena no pertenece al lenguaje") def dumps_parser_state(self, file): - ''' + """ Devuelve un formato objeto de tipo bytes (o string) que sirve para guardar el estado del parser en un fichero para cargarlo posteriormente con load. - ''' + """ try: import cloudpickle # type: ignore except ImportError: @@ -101,6 +106,7 @@ def dumps_parser_state(self, file): def load_parser_state(file): try: import cloudpickle as pickle + return pickle.load(file) except ImportError: return None diff --git a/src/testing.mips b/src/testing.mips index 3bb4cfb4..4a0ff5cb 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,621 +1 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 10:37:40 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# - - -# **** Type RECORD for type IO **** -IO_start: -IO_vtable_pointer: .word IO_vtable -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# - - -# **** Type RECORD for type Object **** -Object_start: -Object_vtable_pointer: .word Object_vtable -Object_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main, function_fib_at_Main -# - - -# **** Type RECORD for type Main **** -Main_start: -Main_vtable_pointer: .word Main_vtable -Main_end: -# - - -data_0: .asciiz "" -# - - -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -data_2: .asciiz "Enter n to find nth fibonacci number!\n" -# - - -data_3: .asciiz "\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, Main - sw $t1, 0($v0) - la $t1, Main_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 76 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 76 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # - la $t1, data_2 - sw $t1, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # local_main_at_Main_internal_6 = SELF - sw $s1, -28($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # local_main_at_Main_internal_4 = local_main_at_Main_internal_6 - lw $t1, -28($fp) - sw $t1, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = SELF - sw $s1, -40($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t1, -40($fp) - sw $t1, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_12 = SELF - sw $s1, -52($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 - lw $t1, -52($fp) - sw $t1, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 in_int - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_11 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - lw $t1, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 fib - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 32($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_8 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - lw $t1, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 out_int - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 4($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 - lw $t1, -64($fp) - sw $t1, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # - la $t1, data_3 - sw $t1, -68($fp) - # ARG local_main_at_Main_internal_16 - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - lw $t1, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 out_string - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_14 - lw $v0, -60($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 76 - jr $ra - # Function END - - -# function_fib_at_Main implementation. -# @Params: -# 0($fp) = param_fib_at_Main_i_0 -function_fib_at_Main: - # Allocate stack frame for function function_fib_at_Main. - subu $sp, $sp, 36 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 36 - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # local_fib_at_Main_a_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - # LOCAL local_fib_at_Main_b_1 --> -8($fp) - # local_fib_at_Main_b_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # LOCAL local_fib_at_Main_c_2 --> -12($fp) - # local_fib_at_Main_c_2 = 0 - li $t1, 0 - sw $t1, -12($fp) - label_WHILE_1: - # LOCAL local_fib_at_Main_internal_3 --> -16($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # local_fib_at_Main_internal_3 = PARAM param_fib_at_Main_i_0 - 0 - lw $t1, 0($fp) - sub $t1, $t1, 0 - sw $t1, -16($fp) - # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 - # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 - lw $t1, -16($fp) - beq $t1, 0, label_TRUE_3 - # LOCAL local_fib_at_Main_internal_3 --> -16($fp) - # local_fib_at_Main_internal_3 = 0 - li $t1, 0 - sw $t1, -16($fp) - # GOTO label_END_4 - j label_END_4 - label_TRUE_3: - # LOCAL local_fib_at_Main_internal_3 --> -16($fp) - # local_fib_at_Main_internal_3 = 1 - li $t1, 1 - sw $t1, -16($fp) - label_END_4: - # IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 - # IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 - lw $t1, -16($fp) - beq $t1, 0, label_FALSE_5 - # LOCAL local_fib_at_Main_internal_4 --> -20($fp) - # local_fib_at_Main_internal_4 = 0 - li $t1, 0 - sw $t1, -20($fp) - # GOTO label_NOT_END_6 - j label_NOT_END_6 - label_FALSE_5: - # LOCAL local_fib_at_Main_internal_4 --> -20($fp) - # local_fib_at_Main_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) - label_NOT_END_6: - # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 - # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 - lw $t1, -20($fp) - beq $t1, 0, label_WHILE_END_2 - # LOCAL local_fib_at_Main_internal_5 --> -24($fp) - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # LOCAL local_fib_at_Main_b_1 --> -8($fp) - # local_fib_at_Main_internal_5 = local_fib_at_Main_a_0 + local_fib_at_Main_b_1 - lw $t1, -4($fp) - lw $t2, -8($fp) - add $t1, $t1, $t2 - sw $t1, -24($fp) - # LOCAL local_fib_at_Main_c_2 --> -12($fp) - # LOCAL local_fib_at_Main_internal_5 --> -24($fp) - # local_fib_at_Main_c_2 = local_fib_at_Main_internal_5 - lw $t1, -24($fp) - sw $t1, -12($fp) - # LOCAL local_fib_at_Main_internal_6 --> -28($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # local_fib_at_Main_internal_6 = PARAM param_fib_at_Main_i_0 - 1 - lw $t1, 0($fp) - sub $t1, $t1, 1 - sw $t1, -28($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # LOCAL local_fib_at_Main_internal_6 --> -28($fp) - # PARAM param_fib_at_Main_i_0 = local_fib_at_Main_internal_6 - lw $t1, -28($fp) - sw $t1, 0($fp) - # LOCAL local_fib_at_Main_b_1 --> -8($fp) - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # local_fib_at_Main_b_1 = local_fib_at_Main_a_0 - lw $t1, -4($fp) - sw $t1, -8($fp) - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # LOCAL local_fib_at_Main_c_2 --> -12($fp) - # local_fib_at_Main_a_0 = local_fib_at_Main_c_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # GOTO label_WHILE_1 - j label_WHILE_1 - label_WHILE_END_2: - # RETURN local_fib_at_Main_c_2 - lw $v0, -12($fp) - # Deallocate stack frame for function function_fib_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 36 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - +(4, 28) - TypeError: 'new' used with undefined class A2I. diff --git a/src/testing.py b/src/testing.py index 15b5aea5..df9598a8 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,34 +60,20 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""class Main inherits IO { - -- the class has features. Only methods in this case. - main(): Object { - { - out_string("Enter n to find nth fibonacci number!\n"); - out_int(fib(in_int())); - out_string("\n"); - } - }; +text = r""" +class Main inherits IO { + main () : Object { + (let a : Int <- (new A2I).a2i("678987"), + b : String <- (new A2I).i2a(678987) in + { + out_int(a) ; + out_string(" == ") ; + out_string(b) ; + out_string("\n"); + } + ) + } ; +} ; - fib(i : Int) : Int { -- list of formals. And the return type of the method. - let a : Int <- 1, - b : Int <- 0, - c : Int <- 0 - in - { - while (not (i = 0)) loop -- expressions are nested. - { - c <- a + b; - i <- i - 1; - b <- a; - a <- c; - } - pool; - c; - } - }; - -}; """ pipeline(text, 5) diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips deleted file mode 100644 index 0f79cf5b..00000000 --- a/tests/codegen/fib.mips +++ /dev/null @@ -1,620 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 10:38:43 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# - - -# **** Type RECORD for type IO **** -IO_start: -IO_vtable_pointer: .word IO_vtable -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# - - -# **** Type RECORD for type Object **** -Object_start: -Object_vtable_pointer: .word Object_vtable -Object_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main, function_fib_at_Main -# - - -# **** Type RECORD for type Main **** -Main_start: -Main_vtable_pointer: .word Main_vtable -Main_end: -# - - -data_0: .asciiz "" -# - - -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -data_2: .asciiz "Enter n to find nth fibonacci number!\n" -# - - -data_3: .asciiz "\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, Main - sw $t1, 0($v0) - la $t1, Main_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 76 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 76 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # - la $t1, data_2 - sw $t1, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # local_main_at_Main_internal_6 = SELF - sw $s1, -28($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # local_main_at_Main_internal_4 = local_main_at_Main_internal_6 - lw $t1, -28($fp) - sw $t1, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = SELF - sw $s1, -40($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t1, -40($fp) - sw $t1, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_12 = SELF - sw $s1, -52($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 - lw $t1, -52($fp) - sw $t1, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 in_int - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_11 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - lw $t1, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 fib - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 32($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_8 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - lw $t1, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 out_int - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 4($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 - lw $t1, -64($fp) - sw $t1, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # - la $t1, data_3 - sw $t1, -68($fp) - # ARG local_main_at_Main_internal_16 - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - lw $t1, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 out_string - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_14 - lw $v0, -60($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 76 - jr $ra - # Function END - - -# function_fib_at_Main implementation. -# @Params: -# 0($fp) = param_fib_at_Main_i_0 -function_fib_at_Main: - # Allocate stack frame for function function_fib_at_Main. - subu $sp, $sp, 36 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 36 - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # local_fib_at_Main_a_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - # LOCAL local_fib_at_Main_b_1 --> -8($fp) - # local_fib_at_Main_b_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # LOCAL local_fib_at_Main_c_2 --> -12($fp) - # local_fib_at_Main_c_2 = 0 - li $t1, 0 - sw $t1, -12($fp) - label_WHILE_1: - # LOCAL local_fib_at_Main_internal_3 --> -16($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # local_fib_at_Main_internal_3 = PARAM param_fib_at_Main_i_0 - 0 - lw $t1, 0($fp) - sub $t1, $t1, 0 - sw $t1, -16($fp) - # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 - # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 - lw $t1, -16($fp) - beq $t1, 0, label_TRUE_3 - # LOCAL local_fib_at_Main_internal_3 --> -16($fp) - # local_fib_at_Main_internal_3 = 0 - li $t1, 0 - sw $t1, -16($fp) - # GOTO label_END_4 - j label_END_4 - label_TRUE_3: - # LOCAL local_fib_at_Main_internal_3 --> -16($fp) - # local_fib_at_Main_internal_3 = 1 - li $t1, 1 - sw $t1, -16($fp) - label_END_4: - # IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 - # IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 - lw $t1, -16($fp) - beq $t1, 0, label_FALSE_5 - # LOCAL local_fib_at_Main_internal_4 --> -20($fp) - # local_fib_at_Main_internal_4 = 0 - li $t1, 0 - sw $t1, -20($fp) - # GOTO label_NOT_END_6 - j label_NOT_END_6 - label_FALSE_5: - # LOCAL local_fib_at_Main_internal_4 --> -20($fp) - # local_fib_at_Main_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) - label_NOT_END_6: - # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 - # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 - lw $t1, -20($fp) - beq $t1, 0, label_WHILE_END_2 - # LOCAL local_fib_at_Main_internal_5 --> -24($fp) - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # LOCAL local_fib_at_Main_b_1 --> -8($fp) - # local_fib_at_Main_internal_5 = local_fib_at_Main_a_0 + local_fib_at_Main_b_1 - lw $t1, -4($fp) - lw $t2, -8($fp) - add $t1, $t1, $t2 - sw $t1, -24($fp) - # LOCAL local_fib_at_Main_c_2 --> -12($fp) - # LOCAL local_fib_at_Main_internal_5 --> -24($fp) - # local_fib_at_Main_c_2 = local_fib_at_Main_internal_5 - lw $t1, -24($fp) - sw $t1, -12($fp) - # LOCAL local_fib_at_Main_internal_6 --> -28($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # local_fib_at_Main_internal_6 = PARAM param_fib_at_Main_i_0 - 1 - lw $t1, 0($fp) - sub $t1, $t1, 1 - sw $t1, -28($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # LOCAL local_fib_at_Main_internal_6 --> -28($fp) - # PARAM param_fib_at_Main_i_0 = local_fib_at_Main_internal_6 - lw $t1, -28($fp) - sw $t1, 0($fp) - # LOCAL local_fib_at_Main_b_1 --> -8($fp) - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # local_fib_at_Main_b_1 = local_fib_at_Main_a_0 - lw $t1, -4($fp) - sw $t1, -8($fp) - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # LOCAL local_fib_at_Main_c_2 --> -12($fp) - # local_fib_at_Main_a_0 = local_fib_at_Main_c_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # GOTO label_WHILE_1 - j label_WHILE_1 - label_WHILE_END_2: - # RETURN local_fib_at_Main_c_2 - lw $v0, -12($fp) - # Deallocate stack frame for function function_fib_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 36 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips deleted file mode 100644 index 292cb9fa..00000000 --- a/tests/codegen/hello_world.mips +++ /dev/null @@ -1,366 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 10:38:42 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# - - -# **** Type RECORD for type IO **** -IO_start: -IO_vtable_pointer: .word IO_vtable -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# - - -# **** Type RECORD for type Object **** -Object_start: -Object_vtable_pointer: .word Object_vtable -Object_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main -# - - -# **** Type RECORD for type Main **** -Main_start: -Main_vtable_pointer: .word Main_vtable -Main_end: -# - - -data_0: .asciiz "" -# - - -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -data_2: .asciiz "Hello, World.\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, Main - sw $t1, 0($v0) - la $t1, Main_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # - la $t1, data_2 - sw $t1, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips deleted file mode 100644 index 5dd23842..00000000 --- a/tests/codegen/io.mips +++ /dev/null @@ -1,939 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 10:38:43 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -A: .asciiz "A" -# Function END -B: .asciiz "B" -# Function END -C: .asciiz "C" -# Function END -D: .asciiz "D" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# - - -# **** Type RECORD for type IO **** -IO_start: -IO_vtable_pointer: .word IO_vtable -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# - - -# **** Type RECORD for type Object **** -Object_start: -Object_vtable_pointer: .word Object_vtable -Object_end: -# - - -# **** VTABLE for type A **** -A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A -# - - -# **** Type RECORD for type A **** -A_start: -A_vtable_pointer: .word A_vtable -A_attrib_io: .word 0 -A_end: -# - - -# **** VTABLE for type B **** -B_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A, function_out_b_at_B -# - - -# **** Type RECORD for type B **** -B_start: -B_vtable_pointer: .word B_vtable -B_attrib_io: .word 0 -B_end: -# - - -# **** VTABLE for type C **** -C_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_c_at_C -# - - -# **** Type RECORD for type C **** -C_start: -C_vtable_pointer: .word C_vtable -C_end: -# - - -# **** VTABLE for type D **** -D_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_c_at_C, function_out_d_at_D -# - - -# **** Type RECORD for type D **** -D_start: -D_vtable_pointer: .word D_vtable -D_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main -# - - -# **** Type RECORD for type Main **** -Main_start: -Main_vtable_pointer: .word Main_vtable -Main_end: -# - - -data_0: .asciiz "" -# - - -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_A_tdt_entry__: .word 1 -__Object_B_tdt_entry__: .word 2 -__Object_C_tdt_entry__: .word 2 -__Object_D_tdt_entry__: .word 3 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_A_tdt_entry__: .word -1 -__Int_B_tdt_entry__: .word -1 -__Int_C_tdt_entry__: .word -1 -__Int_D_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_A_tdt_entry__: .word -1 -__String_B_tdt_entry__: .word -1 -__String_C_tdt_entry__: .word -1 -__String_D_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_A_tdt_entry__: .word -1 -__Bool_B_tdt_entry__: .word -1 -__Bool_C_tdt_entry__: .word -1 -__Bool_D_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_A_tdt_entry__: .word -1 -__IO_B_tdt_entry__: .word -1 -__IO_C_tdt_entry__: .word 1 -__IO_D_tdt_entry__: .word 2 -__IO_Main_tdt_entry__: .word 1 -__A_Object_tdt_entry__: .word -1 -__A_Int_tdt_entry__: .word -1 -__A_String_tdt_entry__: .word -1 -__A_Bool_tdt_entry__: .word -1 -__A_IO_tdt_entry__: .word -1 -__A_A_tdt_entry__: .word 0 -__A_B_tdt_entry__: .word 1 -__A_C_tdt_entry__: .word -1 -__A_D_tdt_entry__: .word -1 -__A_Main_tdt_entry__: .word -1 -__B_Object_tdt_entry__: .word -1 -__B_Int_tdt_entry__: .word -1 -__B_String_tdt_entry__: .word -1 -__B_Bool_tdt_entry__: .word -1 -__B_IO_tdt_entry__: .word -1 -__B_A_tdt_entry__: .word -1 -__B_B_tdt_entry__: .word 0 -__B_C_tdt_entry__: .word -1 -__B_D_tdt_entry__: .word -1 -__B_Main_tdt_entry__: .word -1 -__C_Object_tdt_entry__: .word -1 -__C_Int_tdt_entry__: .word -1 -__C_String_tdt_entry__: .word -1 -__C_Bool_tdt_entry__: .word -1 -__C_IO_tdt_entry__: .word -1 -__C_A_tdt_entry__: .word -1 -__C_B_tdt_entry__: .word -1 -__C_C_tdt_entry__: .word 0 -__C_D_tdt_entry__: .word 1 -__C_Main_tdt_entry__: .word -1 -__D_Object_tdt_entry__: .word -1 -__D_Int_tdt_entry__: .word -1 -__D_String_tdt_entry__: .word -1 -__D_Bool_tdt_entry__: .word -1 -__D_IO_tdt_entry__: .word -1 -__D_A_tdt_entry__: .word -1 -__D_B_tdt_entry__: .word -1 -__D_C_tdt_entry__: .word -1 -__D_D_tdt_entry__: .word 0 -__D_Main_tdt_entry__: .word -1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_A_tdt_entry__: .word -1 -__Main_B_tdt_entry__: .word -1 -__Main_C_tdt_entry__: .word -1 -__Main_D_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -data_2: .asciiz "A: Hello world\n" -# - - -data_3: .asciiz "B: Hello world\n" -# - - -data_4: .asciiz "C: Hello world\n" -# - - -data_5: .asciiz "D: Hello world\n" -# - - -data_6: .asciiz "Done.\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # RETURN - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) - li $v0, 4 - syscall - # RETURN - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, Main - sw $t1, 0($v0) - la $t1, Main_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL function_main_at_Main - # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __A__attrib__io__init implementation. -# @Params: -__A__attrib__io__init: - # Allocate stack frame for function __A__attrib__io__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ib__io__init_internal_0 --> -4($fp) - # local_ib__io__init_internal_0 = ALLOCATE IO - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, IO - sw $t1, 0($v0) - la $t1, IO_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -4($fp) - # RETURN local_ib__io__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __A__attrib__io__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_a_at_A implementation. -# @Params: -function_out_a_at_A: - # Allocate stack frame for function function_out_a_at_A. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_out_a_at_A_internal_2 = GETATTRIBUTE io A - # LOCAL local_out_a_at_A_internal_2 --> -12($fp) - lw $t1, 8($s1) - sw $t1, -12($fp) - # LOCAL local_out_a_at_A_internal_0 --> -4($fp) - # LOCAL local_out_a_at_A_internal_2 --> -12($fp) - # local_out_a_at_A_internal_0 = local_out_a_at_A_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_out_a_at_A_internal_3 --> -16($fp) - # - la $t1, data_2 - sw $t1, -16($fp) - # ARG local_out_a_at_A_internal_3 - # LOCAL local_out_a_at_A_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_out_a_at_A_internal_0 --> -4($fp) - # LOCAL local_out_a_at_A_internal_1 --> -8($fp) - # local_out_a_at_A_internal_1 = VCALL local_out_a_at_A_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_out_a_at_A_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_a_at_A. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_b_at_B implementation. -# @Params: -function_out_b_at_B: - # Allocate stack frame for function function_out_b_at_B. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_out_b_at_B_internal_2 = GETATTRIBUTE io B - # LOCAL local_out_b_at_B_internal_2 --> -12($fp) - lw $t1, 8($s1) - sw $t1, -12($fp) - # LOCAL local_out_b_at_B_internal_0 --> -4($fp) - # LOCAL local_out_b_at_B_internal_2 --> -12($fp) - # local_out_b_at_B_internal_0 = local_out_b_at_B_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_out_b_at_B_internal_3 --> -16($fp) - # - la $t1, data_3 - sw $t1, -16($fp) - # ARG local_out_b_at_B_internal_3 - # LOCAL local_out_b_at_B_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_out_b_at_B_internal_0 --> -4($fp) - # LOCAL local_out_b_at_B_internal_1 --> -8($fp) - # local_out_b_at_B_internal_1 = VCALL local_out_b_at_B_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_out_b_at_B_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_b_at_B. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_c_at_C implementation. -# @Params: -function_out_c_at_C: - # Allocate stack frame for function function_out_c_at_C. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_out_c_at_C_internal_2 --> -12($fp) - # local_out_c_at_C_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_out_c_at_C_internal_0 --> -4($fp) - # LOCAL local_out_c_at_C_internal_2 --> -12($fp) - # local_out_c_at_C_internal_0 = local_out_c_at_C_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_out_c_at_C_internal_3 --> -16($fp) - # - la $t1, data_4 - sw $t1, -16($fp) - # ARG local_out_c_at_C_internal_3 - # LOCAL local_out_c_at_C_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_out_c_at_C_internal_0 --> -4($fp) - # LOCAL local_out_c_at_C_internal_1 --> -8($fp) - # local_out_c_at_C_internal_1 = VCALL local_out_c_at_C_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_out_c_at_C_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_c_at_C. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_d_at_D implementation. -# @Params: -function_out_d_at_D: - # Allocate stack frame for function function_out_d_at_D. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_out_d_at_D_internal_2 --> -12($fp) - # local_out_d_at_D_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_out_d_at_D_internal_0 --> -4($fp) - # LOCAL local_out_d_at_D_internal_2 --> -12($fp) - # local_out_d_at_D_internal_0 = local_out_d_at_D_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_out_d_at_D_internal_3 --> -16($fp) - # - la $t1, data_5 - sw $t1, -16($fp) - # ARG local_out_d_at_D_internal_3 - # LOCAL local_out_d_at_D_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_out_d_at_D_internal_0 --> -4($fp) - # LOCAL local_out_d_at_D_internal_1 --> -8($fp) - # local_out_d_at_D_internal_1 = VCALL local_out_d_at_D_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_out_d_at_D_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_d_at_D. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 72 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 72 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = ALLOCATE A - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - la $t1, A - sw $t1, 0($v0) - la $t1, A_start - sw $t1, 4($v0) - move $t2, $v0 - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __A__attrib__io__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 8($t2) - sw $t2, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_a - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = ALLOCATE B - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - la $t1, B - sw $t1, 0($v0) - la $t1, B_start - sw $t1, 4($v0) - move $t2, $v0 - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __A__attrib__io__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 8($t2) - sw $t2, -24($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 - lw $t1, -24($fp) - sw $t1, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 out_b - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 16($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = ALLOCATE C - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, C - sw $t1, 0($v0) - la $t1, C_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -36($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_c - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 28($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = ALLOCATE D - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, D - sw $t1, 0($v0) - la $t1, D_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -48($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_d - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 32($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 - lw $t1, -60($fp) - sw $t1, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # - la $t1, data_6 - sw $t1, -64($fp) - # ARG local_main_at_Main_internal_15 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - lw $t1, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_13 - lw $v0, -56($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 72 - jr $ra - # Function END - From 9d3e8ae792a73a9a8a0e1fc148e42fc409a314ed Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 3 Dec 2020 12:39:51 -0500 Subject: [PATCH 135/162] FIx infix operator "~" --- src/.builds | 1 + src/coolgrammar/grammar.py | 8 + src/testing.mips | 2453 +++++++++++++++++++++++++++++++++++- src/testing.py | 116 +- src/travels/ciltomips.py | 2 +- src/travels/ctcill.py | 8 - 6 files changed, 2573 insertions(+), 15 deletions(-) diff --git a/src/.builds b/src/.builds index fcb465a0..5df5b120 100644 --- a/src/.builds +++ b/src/.builds @@ -209,3 +209,4 @@ 1 1 1 +1 diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index 657c8185..c83d0968 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -259,6 +259,14 @@ def build_cool_grammar(): s[1], s[3], s[2].token_line, s[2].token_column - 1 ) + term %= term + star + not_ + factor, lambda s: MulNode( + s[1], s[4], s[2].token_line, s[2].token_column - 1 + ) + + term %= term + div + not_ + factor, lambda s: DivNode( + s[1], s[4], s[2].token_line, s[2].token_column - 1 + ) + term %= factor, lambda s: s[1] term %= not_ + factor, lambda s: NotNode(s[2], s[1].token_line, s[1].token_column) diff --git a/src/testing.mips b/src/testing.mips index 4a0ff5cb..18bae393 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1 +1,2452 @@ -(4, 28) - TypeError: 'new' used with undefined class A2I. + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 12:35:09 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +A2I: .asciiz "A2I" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# + + +# **** Type RECORD for type IO **** +IO_start: +IO_vtable_pointer: .word IO_vtable +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# + + +# **** Type RECORD for type Object **** +Object_start: +Object_vtable_pointer: .word Object_vtable +Object_end: +# + + +# **** VTABLE for type A2I **** +A2I_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_c2i_at_A2I, function_i2c_at_A2I, function_a2i_at_A2I, function_a2i_aux_at_A2I, function_i2a_at_A2I, function_i2a_aux_at_A2I +# + + +# **** Type RECORD for type A2I **** +A2I_start: +A2I_vtable_pointer: .word A2I_vtable +A2I_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: +Main_vtable_pointer: .word Main_vtable +Main_end: +# + + +data_0: .asciiz "" +# + + +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_A2I_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_A2I_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_A2I_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_A2I_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_A2I_tdt_entry__: .word -1 +__IO_Main_tdt_entry__: .word 1 +__A2I_Object_tdt_entry__: .word -1 +__A2I_Int_tdt_entry__: .word -1 +__A2I_String_tdt_entry__: .word -1 +__A2I_Bool_tdt_entry__: .word -1 +__A2I_IO_tdt_entry__: .word -1 +__A2I_A2I_tdt_entry__: .word 0 +__A2I_Main_tdt_entry__: .word -1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_A2I_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +data_2: .asciiz "0" +# + + +data_3: .asciiz "1" +# + + +data_4: .asciiz "2" +# + + +data_5: .asciiz "3" +# + + +data_6: .asciiz "4" +# + + +data_7: .asciiz "5" +# + + +data_8: .asciiz "6" +# + + +data_9: .asciiz "7" +# + + +data_10: .asciiz "8" +# + + +data_11: .asciiz "9" +# + + +data_12: .asciiz "0" +# + + +data_13: .asciiz "1" +# + + +data_14: .asciiz "2" +# + + +data_15: .asciiz "3" +# + + +data_16: .asciiz "4" +# + + +data_17: .asciiz "5" +# + + +data_18: .asciiz "6" +# + + +data_19: .asciiz "7" +# + + +data_20: .asciiz "8" +# + + +data_21: .asciiz "9" +# + + +data_22: .asciiz "" +# + + +data_23: .asciiz "-" +# + + +data_24: .asciiz "+" +# + + +data_25: .asciiz "0" +# + + +data_26: .asciiz "-" +# + + +data_27: .asciiz "" +# + + +data_28: .asciiz "678987" +# + + +data_29: .asciiz " == " +# + + +data_30: .asciiz "\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $a0, 0($fp) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, Main + sw $t1, 0($v0) + la $t1, Main_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_c2i_at_A2I implementation. +# @Params: +# 0($fp) = param_c2i_at_A2I_char_0 +function_c2i_at_A2I: + # Allocate stack frame for function function_c2i_at_A2I. + subu $sp, $sp, 100 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 100 + # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) + # + la $t1, data_2 + sw $t1, -8($fp) + # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) + # local_c2i_at_A2I_internal_0 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_1 + lw $t1, 0($fp) + lw $t2, -8($fp) + sub $t1, $t1, $t2 + sw $t1, -4($fp) + # IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_TRUE_3 + # IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_TRUE_3 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_3 + # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) + # local_c2i_at_A2I_internal_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # GOTO label_END_4 +j label_END_4 +label_TRUE_3: +# LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) +# local_c2i_at_A2I_internal_0 = 1 +li $t1, 1 +sw $t1, -4($fp) +label_END_4: +# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSE_1 +# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSE_1 +lw $t1, -4($fp) +beq $t1, 0, label_FALSE_1 +# GOTO label_END_2 +j label_END_2 +label_FALSE_1: +# LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) +# +la $t1, data_3 +sw $t1, -16($fp) +# LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) +# PARAM param_c2i_at_A2I_char_0 --> 0($fp) +# LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) +# local_c2i_at_A2I_internal_2 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_3 +lw $t1, 0($fp) +lw $t2, -16($fp) +sub $t1, $t1, $t2 +sw $t1, -12($fp) +# IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_TRUE_7 +# IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_TRUE_7 +lw $t1, -12($fp) +beq $t1, 0, label_TRUE_7 +# LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) +# local_c2i_at_A2I_internal_2 = 0 +li $t1, 0 +sw $t1, -12($fp) +# GOTO label_END_8 +j label_END_8 +label_TRUE_7: +# LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) +# local_c2i_at_A2I_internal_2 = 1 +li $t1, 1 +sw $t1, -12($fp) +label_END_8: +# IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_FALSE_5 +# IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_FALSE_5 +lw $t1, -12($fp) +beq $t1, 0, label_FALSE_5 +# GOTO label_END_6 +j label_END_6 +label_FALSE_5: +# LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) +# +la $t1, data_4 +sw $t1, -24($fp) +# LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) +# PARAM param_c2i_at_A2I_char_0 --> 0($fp) +# LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) +# local_c2i_at_A2I_internal_4 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_5 +lw $t1, 0($fp) +lw $t2, -24($fp) +sub $t1, $t1, $t2 +sw $t1, -20($fp) +# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_11 +# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_11 +lw $t1, -20($fp) +beq $t1, 0, label_TRUE_11 +# LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) +# local_c2i_at_A2I_internal_4 = 0 +li $t1, 0 +sw $t1, -20($fp) +# GOTO label_END_12 +j label_END_12 +label_TRUE_11: +# LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) +# local_c2i_at_A2I_internal_4 = 1 +li $t1, 1 +sw $t1, -20($fp) +label_END_12: +# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_9 +# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_9 +lw $t1, -20($fp) +beq $t1, 0, label_FALSE_9 +# GOTO label_END_10 +j label_END_10 +label_FALSE_9: +# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) +# +la $t1, data_5 +sw $t1, -32($fp) +# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) +# PARAM param_c2i_at_A2I_char_0 --> 0($fp) +# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) +# local_c2i_at_A2I_internal_6 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_7 +lw $t1, 0($fp) +lw $t2, -32($fp) +sub $t1, $t1, $t2 +sw $t1, -28($fp) +# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_TRUE_15 +# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_TRUE_15 +lw $t1, -28($fp) +beq $t1, 0, label_TRUE_15 +# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) +# local_c2i_at_A2I_internal_6 = 0 +li $t1, 0 +sw $t1, -28($fp) +# GOTO label_END_16 +j label_END_16 +label_TRUE_15: +# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) +# local_c2i_at_A2I_internal_6 = 1 +li $t1, 1 +sw $t1, -28($fp) +label_END_16: +# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSE_13 +# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSE_13 +lw $t1, -28($fp) +beq $t1, 0, label_FALSE_13 +# GOTO label_END_14 +j label_END_14 +label_FALSE_13: +# LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) +# +la $t1, data_6 +sw $t1, -40($fp) +# LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) +# PARAM param_c2i_at_A2I_char_0 --> 0($fp) +# LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) +# local_c2i_at_A2I_internal_8 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_9 +lw $t1, 0($fp) +lw $t2, -40($fp) +sub $t1, $t1, $t2 +sw $t1, -36($fp) +# IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_TRUE_19 +# IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_TRUE_19 +lw $t1, -36($fp) +beq $t1, 0, label_TRUE_19 +# LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) +# local_c2i_at_A2I_internal_8 = 0 +li $t1, 0 +sw $t1, -36($fp) +# GOTO label_END_20 +j label_END_20 +label_TRUE_19: +# LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) +# local_c2i_at_A2I_internal_8 = 1 +li $t1, 1 +sw $t1, -36($fp) +label_END_20: +# IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_FALSE_17 +# IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_FALSE_17 +lw $t1, -36($fp) +beq $t1, 0, label_FALSE_17 +# GOTO label_END_18 +j label_END_18 +label_FALSE_17: +# LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) +# +la $t1, data_7 +sw $t1, -48($fp) +# LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) +# PARAM param_c2i_at_A2I_char_0 --> 0($fp) +# LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) +# local_c2i_at_A2I_internal_10 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_11 +lw $t1, 0($fp) +lw $t2, -48($fp) +sub $t1, $t1, $t2 +sw $t1, -44($fp) +# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_23 +# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_23 +lw $t1, -44($fp) +beq $t1, 0, label_TRUE_23 +# LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) +# local_c2i_at_A2I_internal_10 = 0 +li $t1, 0 +sw $t1, -44($fp) +# GOTO label_END_24 +j label_END_24 +label_TRUE_23: +# LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) +# local_c2i_at_A2I_internal_10 = 1 +li $t1, 1 +sw $t1, -44($fp) +label_END_24: +# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_21 +# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_21 +lw $t1, -44($fp) +beq $t1, 0, label_FALSE_21 +# GOTO label_END_22 +j label_END_22 +label_FALSE_21: +# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) +# +la $t1, data_8 +sw $t1, -56($fp) +# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) +# PARAM param_c2i_at_A2I_char_0 --> 0($fp) +# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) +# local_c2i_at_A2I_internal_12 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_13 +lw $t1, 0($fp) +lw $t2, -56($fp) +sub $t1, $t1, $t2 +sw $t1, -52($fp) +# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_TRUE_27 +# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_TRUE_27 +lw $t1, -52($fp) +beq $t1, 0, label_TRUE_27 +# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) +# local_c2i_at_A2I_internal_12 = 0 +li $t1, 0 +sw $t1, -52($fp) +# GOTO label_END_28 +j label_END_28 +label_TRUE_27: +# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) +# local_c2i_at_A2I_internal_12 = 1 +li $t1, 1 +sw $t1, -52($fp) +label_END_28: +# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSE_25 +# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSE_25 +lw $t1, -52($fp) +beq $t1, 0, label_FALSE_25 +# GOTO label_END_26 +j label_END_26 +label_FALSE_25: +# LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) +# +la $t1, data_9 +sw $t1, -64($fp) +# LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) +# PARAM param_c2i_at_A2I_char_0 --> 0($fp) +# LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) +# local_c2i_at_A2I_internal_14 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_15 +lw $t1, 0($fp) +lw $t2, -64($fp) +sub $t1, $t1, $t2 +sw $t1, -60($fp) +# IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_TRUE_31 +# IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_TRUE_31 +lw $t1, -60($fp) +beq $t1, 0, label_TRUE_31 +# LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) +# local_c2i_at_A2I_internal_14 = 0 +li $t1, 0 +sw $t1, -60($fp) +# GOTO label_END_32 +j label_END_32 +label_TRUE_31: +# LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) +# local_c2i_at_A2I_internal_14 = 1 +li $t1, 1 +sw $t1, -60($fp) +label_END_32: +# IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_FALSE_29 +# IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_FALSE_29 +lw $t1, -60($fp) +beq $t1, 0, label_FALSE_29 +# GOTO label_END_30 +j label_END_30 +label_FALSE_29: +# LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) +# +la $t1, data_10 +sw $t1, -72($fp) +# LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) +# PARAM param_c2i_at_A2I_char_0 --> 0($fp) +# LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) +# local_c2i_at_A2I_internal_16 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_17 +lw $t1, 0($fp) +lw $t2, -72($fp) +sub $t1, $t1, $t2 +sw $t1, -68($fp) +# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_35 +# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_35 +lw $t1, -68($fp) +beq $t1, 0, label_TRUE_35 +# LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) +# local_c2i_at_A2I_internal_16 = 0 +li $t1, 0 +sw $t1, -68($fp) +# GOTO label_END_36 +j label_END_36 +label_TRUE_35: +# LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) +# local_c2i_at_A2I_internal_16 = 1 +li $t1, 1 +sw $t1, -68($fp) +label_END_36: +# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_33 +# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_33 +lw $t1, -68($fp) +beq $t1, 0, label_FALSE_33 +# GOTO label_END_34 +j label_END_34 +label_FALSE_33: +# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) +# +la $t1, data_11 +sw $t1, -80($fp) +# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) +# PARAM param_c2i_at_A2I_char_0 --> 0($fp) +# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) +# local_c2i_at_A2I_internal_18 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_19 +lw $t1, 0($fp) +lw $t2, -80($fp) +sub $t1, $t1, $t2 +sw $t1, -76($fp) +# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_TRUE_39 +# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_TRUE_39 +lw $t1, -76($fp) +beq $t1, 0, label_TRUE_39 +# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) +# local_c2i_at_A2I_internal_18 = 0 +li $t1, 0 +sw $t1, -76($fp) +# GOTO label_END_40 +j label_END_40 +label_TRUE_39: +# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) +# local_c2i_at_A2I_internal_18 = 1 +li $t1, 1 +sw $t1, -76($fp) +label_END_40: +# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSE_37 +# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSE_37 +lw $t1, -76($fp) +beq $t1, 0, label_FALSE_37 +# GOTO label_END_38 +j label_END_38 +label_FALSE_37: +# LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) +# local_c2i_at_A2I_internal_22 = SELF +sw $s1, -92($fp) +# LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) +# LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) +# local_c2i_at_A2I_internal_20 = local_c2i_at_A2I_internal_22 +lw $t1, -92($fp) +sw $t1, -84($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) +# LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) +# local_c2i_at_A2I_internal_21 = VCALL local_c2i_at_A2I_internal_20 abort +# Save new self pointer in $s1 +lw $s1, -84($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 16($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -88($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +label_END_38: +label_END_34: +label_END_30: +label_END_26: +label_END_22: +label_END_18: +label_END_14: +label_END_10: +label_END_6: +label_END_2: +# RETURN +# Deallocate stack frame for function function_c2i_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 100 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_i2c_at_A2I implementation. +# @Params: +# 0($fp) = param_i2c_at_A2I_i_0 +function_i2c_at_A2I: +# Allocate stack frame for function function_i2c_at_A2I. +subu $sp, $sp, 104 +sw $ra, 4($sp) +sw $fp, 0($sp) +addu $fp, $sp, 104 +# LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) +# PARAM param_i2c_at_A2I_i_0 --> 0($fp) +# local_i2c_at_A2I_internal_0 = PARAM param_i2c_at_A2I_i_0 - 0 +lw $t1, 0($fp) +sub $t1, $t1, 0 +sw $t1, -4($fp) +# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_TRUE_43 +# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_TRUE_43 +lw $t1, -4($fp) +beq $t1, 0, label_TRUE_43 +# LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) +# local_i2c_at_A2I_internal_0 = 0 +li $t1, 0 +sw $t1, -4($fp) +# GOTO label_END_44 +j label_END_44 +label_TRUE_43: +# LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) +# local_i2c_at_A2I_internal_0 = 1 +li $t1, 1 +sw $t1, -4($fp) +label_END_44: +# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSE_41 +# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSE_41 +lw $t1, -4($fp) +beq $t1, 0, label_FALSE_41 +# LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) +# +la $t1, data_12 +sw $t1, -8($fp) +# GOTO label_END_42 +j label_END_42 +label_FALSE_41: +# LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) +# PARAM param_i2c_at_A2I_i_0 --> 0($fp) +# local_i2c_at_A2I_internal_2 = PARAM param_i2c_at_A2I_i_0 - 1 +lw $t1, 0($fp) +sub $t1, $t1, 1 +sw $t1, -12($fp) +# IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_TRUE_47 +# IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_TRUE_47 +lw $t1, -12($fp) +beq $t1, 0, label_TRUE_47 +# LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) +# local_i2c_at_A2I_internal_2 = 0 +li $t1, 0 +sw $t1, -12($fp) +# GOTO label_END_48 +j label_END_48 +label_TRUE_47: +# LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) +# local_i2c_at_A2I_internal_2 = 1 +li $t1, 1 +sw $t1, -12($fp) +label_END_48: +# IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_FALSE_45 +# IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_FALSE_45 +lw $t1, -12($fp) +beq $t1, 0, label_FALSE_45 +# LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) +# +la $t1, data_13 +sw $t1, -16($fp) +# GOTO label_END_46 +j label_END_46 +label_FALSE_45: +# LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) +# PARAM param_i2c_at_A2I_i_0 --> 0($fp) +# local_i2c_at_A2I_internal_4 = PARAM param_i2c_at_A2I_i_0 - 2 +lw $t1, 0($fp) +sub $t1, $t1, 2 +sw $t1, -20($fp) +# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_51 +# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_51 +lw $t1, -20($fp) +beq $t1, 0, label_TRUE_51 +# LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) +# local_i2c_at_A2I_internal_4 = 0 +li $t1, 0 +sw $t1, -20($fp) +# GOTO label_END_52 +j label_END_52 +label_TRUE_51: +# LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) +# local_i2c_at_A2I_internal_4 = 1 +li $t1, 1 +sw $t1, -20($fp) +label_END_52: +# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_49 +# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_49 +lw $t1, -20($fp) +beq $t1, 0, label_FALSE_49 +# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) +# +la $t1, data_14 +sw $t1, -24($fp) +# GOTO label_END_50 +j label_END_50 +label_FALSE_49: +# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) +# PARAM param_i2c_at_A2I_i_0 --> 0($fp) +# local_i2c_at_A2I_internal_6 = PARAM param_i2c_at_A2I_i_0 - 3 +lw $t1, 0($fp) +sub $t1, $t1, 3 +sw $t1, -28($fp) +# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_TRUE_55 +# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_TRUE_55 +lw $t1, -28($fp) +beq $t1, 0, label_TRUE_55 +# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) +# local_i2c_at_A2I_internal_6 = 0 +li $t1, 0 +sw $t1, -28($fp) +# GOTO label_END_56 +j label_END_56 +label_TRUE_55: +# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) +# local_i2c_at_A2I_internal_6 = 1 +li $t1, 1 +sw $t1, -28($fp) +label_END_56: +# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSE_53 +# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSE_53 +lw $t1, -28($fp) +beq $t1, 0, label_FALSE_53 +# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) +# +la $t1, data_15 +sw $t1, -32($fp) +# GOTO label_END_54 +j label_END_54 +label_FALSE_53: +# LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) +# PARAM param_i2c_at_A2I_i_0 --> 0($fp) +# local_i2c_at_A2I_internal_8 = PARAM param_i2c_at_A2I_i_0 - 4 +lw $t1, 0($fp) +sub $t1, $t1, 4 +sw $t1, -36($fp) +# IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_TRUE_59 +# IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_TRUE_59 +lw $t1, -36($fp) +beq $t1, 0, label_TRUE_59 +# LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) +# local_i2c_at_A2I_internal_8 = 0 +li $t1, 0 +sw $t1, -36($fp) +# GOTO label_END_60 +j label_END_60 +label_TRUE_59: +# LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) +# local_i2c_at_A2I_internal_8 = 1 +li $t1, 1 +sw $t1, -36($fp) +label_END_60: +# IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_FALSE_57 +# IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_FALSE_57 +lw $t1, -36($fp) +beq $t1, 0, label_FALSE_57 +# LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) +# +la $t1, data_16 +sw $t1, -40($fp) +# GOTO label_END_58 +j label_END_58 +label_FALSE_57: +# LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) +# PARAM param_i2c_at_A2I_i_0 --> 0($fp) +# local_i2c_at_A2I_internal_10 = PARAM param_i2c_at_A2I_i_0 - 5 +lw $t1, 0($fp) +sub $t1, $t1, 5 +sw $t1, -44($fp) +# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_63 +# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_63 +lw $t1, -44($fp) +beq $t1, 0, label_TRUE_63 +# LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) +# local_i2c_at_A2I_internal_10 = 0 +li $t1, 0 +sw $t1, -44($fp) +# GOTO label_END_64 +j label_END_64 +label_TRUE_63: +# LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) +# local_i2c_at_A2I_internal_10 = 1 +li $t1, 1 +sw $t1, -44($fp) +label_END_64: +# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_61 +# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_61 +lw $t1, -44($fp) +beq $t1, 0, label_FALSE_61 +# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) +# +la $t1, data_17 +sw $t1, -48($fp) +# GOTO label_END_62 +j label_END_62 +label_FALSE_61: +# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) +# PARAM param_i2c_at_A2I_i_0 --> 0($fp) +# local_i2c_at_A2I_internal_12 = PARAM param_i2c_at_A2I_i_0 - 6 +lw $t1, 0($fp) +sub $t1, $t1, 6 +sw $t1, -52($fp) +# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_TRUE_67 +# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_TRUE_67 +lw $t1, -52($fp) +beq $t1, 0, label_TRUE_67 +# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) +# local_i2c_at_A2I_internal_12 = 0 +li $t1, 0 +sw $t1, -52($fp) +# GOTO label_END_68 +j label_END_68 +label_TRUE_67: +# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) +# local_i2c_at_A2I_internal_12 = 1 +li $t1, 1 +sw $t1, -52($fp) +label_END_68: +# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSE_65 +# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSE_65 +lw $t1, -52($fp) +beq $t1, 0, label_FALSE_65 +# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) +# +la $t1, data_18 +sw $t1, -56($fp) +# GOTO label_END_66 +j label_END_66 +label_FALSE_65: +# LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) +# PARAM param_i2c_at_A2I_i_0 --> 0($fp) +# local_i2c_at_A2I_internal_14 = PARAM param_i2c_at_A2I_i_0 - 7 +lw $t1, 0($fp) +sub $t1, $t1, 7 +sw $t1, -60($fp) +# IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_TRUE_71 +# IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_TRUE_71 +lw $t1, -60($fp) +beq $t1, 0, label_TRUE_71 +# LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) +# local_i2c_at_A2I_internal_14 = 0 +li $t1, 0 +sw $t1, -60($fp) +# GOTO label_END_72 +j label_END_72 +label_TRUE_71: +# LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) +# local_i2c_at_A2I_internal_14 = 1 +li $t1, 1 +sw $t1, -60($fp) +label_END_72: +# IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_FALSE_69 +# IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_FALSE_69 +lw $t1, -60($fp) +beq $t1, 0, label_FALSE_69 +# LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) +# +la $t1, data_19 +sw $t1, -64($fp) +# GOTO label_END_70 +j label_END_70 +label_FALSE_69: +# LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) +# PARAM param_i2c_at_A2I_i_0 --> 0($fp) +# local_i2c_at_A2I_internal_16 = PARAM param_i2c_at_A2I_i_0 - 8 +lw $t1, 0($fp) +sub $t1, $t1, 8 +sw $t1, -68($fp) +# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_75 +# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_75 +lw $t1, -68($fp) +beq $t1, 0, label_TRUE_75 +# LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) +# local_i2c_at_A2I_internal_16 = 0 +li $t1, 0 +sw $t1, -68($fp) +# GOTO label_END_76 +j label_END_76 +label_TRUE_75: +# LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) +# local_i2c_at_A2I_internal_16 = 1 +li $t1, 1 +sw $t1, -68($fp) +label_END_76: +# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_73 +# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_73 +lw $t1, -68($fp) +beq $t1, 0, label_FALSE_73 +# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) +# +la $t1, data_20 +sw $t1, -72($fp) +# GOTO label_END_74 +j label_END_74 +label_FALSE_73: +# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) +# PARAM param_i2c_at_A2I_i_0 --> 0($fp) +# local_i2c_at_A2I_internal_18 = PARAM param_i2c_at_A2I_i_0 - 9 +lw $t1, 0($fp) +sub $t1, $t1, 9 +sw $t1, -76($fp) +# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_TRUE_79 +# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_TRUE_79 +lw $t1, -76($fp) +beq $t1, 0, label_TRUE_79 +# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) +# local_i2c_at_A2I_internal_18 = 0 +li $t1, 0 +sw $t1, -76($fp) +# GOTO label_END_80 +j label_END_80 +label_TRUE_79: +# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) +# local_i2c_at_A2I_internal_18 = 1 +li $t1, 1 +sw $t1, -76($fp) +label_END_80: +# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSE_77 +# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSE_77 +lw $t1, -76($fp) +beq $t1, 0, label_FALSE_77 +# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) +# +la $t1, data_21 +sw $t1, -80($fp) +# GOTO label_END_78 +j label_END_78 +label_FALSE_77: +# LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) +# local_i2c_at_A2I_internal_22 = SELF +sw $s1, -92($fp) +# LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) +# LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) +# local_i2c_at_A2I_internal_20 = local_i2c_at_A2I_internal_22 +lw $t1, -92($fp) +sw $t1, -84($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) +# LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) +# local_i2c_at_A2I_internal_21 = VCALL local_i2c_at_A2I_internal_20 abort +# Save new self pointer in $s1 +lw $s1, -84($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 16($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -88($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) +# +la $t1, data_22 +sw $t1, -96($fp) +label_END_78: +label_END_74: +label_END_70: +label_END_66: +label_END_62: +label_END_58: +label_END_54: +label_END_50: +label_END_46: +label_END_42: +# RETURN +# Deallocate stack frame for function function_i2c_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 104 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_at_A2I implementation. +# @Params: +# 0($fp) = param_a2i_at_A2I_s_0 +function_a2i_at_A2I: +# Allocate stack frame for function function_a2i_at_A2I. +subu $sp, $sp, 96 +sw $ra, 4($sp) +sw $fp, 0($sp) +addu $fp, $sp, 96 +# LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_1 = PARAM param_a2i_at_A2I_s_0 +lw $t1, 0($fp) +sw $t1, -8($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) +# LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) +# local_a2i_at_A2I_internal_2 = VCALL local_a2i_at_A2I_internal_1 length +# Save new self pointer in $s1 +lw $s1, -8($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 0($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -12($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) +# LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) +# local_a2i_at_A2I_internal_0 = local_a2i_at_A2I_internal_2 - 0 +lw $t1, -12($fp) +sub $t1, $t1, 0 +sw $t1, -4($fp) +# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_TRUE_83 +# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_TRUE_83 +lw $t1, -4($fp) +beq $t1, 0, label_TRUE_83 +# LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) +# local_a2i_at_A2I_internal_0 = 0 +li $t1, 0 +sw $t1, -4($fp) +# GOTO label_END_84 +j label_END_84 +label_TRUE_83: +# LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) +# local_a2i_at_A2I_internal_0 = 1 +li $t1, 1 +sw $t1, -4($fp) +label_END_84: +# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSE_81 +# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSE_81 +lw $t1, -4($fp) +beq $t1, 0, label_FALSE_81 +# GOTO label_END_82 +j label_END_82 +label_FALSE_81: +# LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_4 = PARAM param_a2i_at_A2I_s_0 +lw $t1, 0($fp) +sw $t1, -20($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG 0 +li $t1, 0 +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# ARG 1 +li $t1, 1 +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) +# LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) +# local_a2i_at_A2I_internal_5 = VCALL local_a2i_at_A2I_internal_4 substr +# Save new self pointer in $s1 +lw $s1, -20($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 0($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -24($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) +# +la $t1, data_23 +sw $t1, -28($fp) +# LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) +# LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) +# LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) +# local_a2i_at_A2I_internal_3 = local_a2i_at_A2I_internal_5 - local_a2i_at_A2I_internal_6 +lw $t1, -24($fp) +lw $t2, -28($fp) +sub $t1, $t1, $t2 +sw $t1, -16($fp) +# IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_87 +# IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_87 +lw $t1, -16($fp) +beq $t1, 0, label_TRUE_87 +# LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) +# local_a2i_at_A2I_internal_3 = 0 +li $t1, 0 +sw $t1, -16($fp) +# GOTO label_END_88 +j label_END_88 +label_TRUE_87: +# LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) +# local_a2i_at_A2I_internal_3 = 1 +li $t1, 1 +sw $t1, -16($fp) +label_END_88: +# IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_FALSE_85 +# IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_FALSE_85 +lw $t1, -16($fp) +beq $t1, 0, label_FALSE_85 +# GOTO label_END_86 +j label_END_86 +label_FALSE_85: +# LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_8 = PARAM param_a2i_at_A2I_s_0 +lw $t1, 0($fp) +sw $t1, -36($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG 0 +li $t1, 0 +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# ARG 1 +li $t1, 1 +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) +# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) +# local_a2i_at_A2I_internal_9 = VCALL local_a2i_at_A2I_internal_8 substr +# Save new self pointer in $s1 +lw $s1, -36($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 0($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -40($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) +# +la $t1, data_24 +sw $t1, -44($fp) +# LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) +# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) +# LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) +# local_a2i_at_A2I_internal_7 = local_a2i_at_A2I_internal_9 - local_a2i_at_A2I_internal_10 +lw $t1, -40($fp) +lw $t2, -44($fp) +sub $t1, $t1, $t2 +sw $t1, -32($fp) +# IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_TRUE_91 +# IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_TRUE_91 +lw $t1, -32($fp) +beq $t1, 0, label_TRUE_91 +# LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) +# local_a2i_at_A2I_internal_7 = 0 +li $t1, 0 +sw $t1, -32($fp) +# GOTO label_END_92 +j label_END_92 +label_TRUE_91: +# LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) +# local_a2i_at_A2I_internal_7 = 1 +li $t1, 1 +sw $t1, -32($fp) +label_END_92: +# IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_FALSE_89 +# IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_FALSE_89 +lw $t1, -32($fp) +beq $t1, 0, label_FALSE_89 +# LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) +# local_a2i_at_A2I_internal_13 = SELF +sw $s1, -56($fp) +# LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) +# LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) +# local_a2i_at_A2I_internal_11 = local_a2i_at_A2I_internal_13 +lw $t1, -56($fp) +sw $t1, -48($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_14 = PARAM param_a2i_at_A2I_s_0 +lw $t1, 0($fp) +sw $t1, -60($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG 1 +li $t1, 1 +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_17 = PARAM param_a2i_at_A2I_s_0 +lw $t1, 0($fp) +sw $t1, -72($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) +# local_a2i_at_A2I_internal_18 = VCALL local_a2i_at_A2I_internal_17 length +# Save new self pointer in $s1 +lw $s1, -72($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 0($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -76($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) +# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) +# local_a2i_at_A2I_internal_16 = local_a2i_at_A2I_internal_18 - 1 +lw $t1, -76($fp) +sub $t1, $t1, 1 +sw $t1, -68($fp) +# ARG local_a2i_at_A2I_internal_16 +# LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) +lw $t1, -68($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) +# LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) +# local_a2i_at_A2I_internal_15 = VCALL local_a2i_at_A2I_internal_14 substr +# Save new self pointer in $s1 +lw $s1, -60($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 0($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -64($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_at_A2I_internal_15 +# LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) +lw $t1, -64($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) +# LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) +# local_a2i_at_A2I_internal_12 = VCALL local_a2i_at_A2I_internal_11 a2i_aux +# Save new self pointer in $s1 +lw $s1, -48($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 24($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -52($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# GOTO label_END_90 +j label_END_90 +label_FALSE_89: +# LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) +# local_a2i_at_A2I_internal_21 = SELF +sw $s1, -88($fp) +# LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) +# LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) +# local_a2i_at_A2I_internal_19 = local_a2i_at_A2I_internal_21 +lw $t1, -88($fp) +sw $t1, -80($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_a2i_at_A2I_s_0 +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) +# LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) +# local_a2i_at_A2I_internal_20 = VCALL local_a2i_at_A2I_internal_19 a2i_aux +# Save new self pointer in $s1 +lw $s1, -80($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 24($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -84($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +label_END_90: +label_END_86: +label_END_82: +# RETURN +# Deallocate stack frame for function function_a2i_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 96 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_aux_at_A2I implementation. +# @Params: +# 0($fp) = param_a2i_aux_at_A2I_s_0 +function_a2i_aux_at_A2I: +# Allocate stack frame for function function_a2i_aux_at_A2I. +subu $sp, $sp, 64 +sw $ra, 4($sp) +sw $fp, 0($sp) +addu $fp, $sp, 64 +# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) +# local_a2i_aux_at_A2I_int_0 = 0 +li $t1, 0 +sw $t1, -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_2 --> -12($fp) +# PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) +# local_a2i_aux_at_A2I_internal_2 = PARAM param_a2i_aux_at_A2I_s_0 +lw $t1, 0($fp) +sw $t1, -12($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_2 --> -12($fp) +# LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) +# local_a2i_aux_at_A2I_internal_3 = VCALL local_a2i_aux_at_A2I_internal_2 length +# Save new self pointer in $s1 +lw $s1, -12($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 0($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -16($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_aux_at_A2I_j_1 --> -8($fp) +# LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) +# local_a2i_aux_at_A2I_j_1 = local_a2i_aux_at_A2I_internal_3 +lw $t1, -16($fp) +sw $t1, -8($fp) +# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) +# local_a2i_aux_at_A2I_i_4 = 0 +li $t1, 0 +sw $t1, -20($fp) +label_WHILE_93: +# LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) +# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) +# LOCAL local_a2i_aux_at_A2I_j_1 --> -8($fp) +# local_a2i_aux_at_A2I_internal_5 = local_a2i_aux_at_A2I_i_4 - local_a2i_aux_at_A2I_j_1 +lw $t1, -20($fp) +lw $t2, -8($fp) +sub $t1, $t1, $t2 +sw $t1, -24($fp) +# IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 +# IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 +lw $t1, -24($fp) +bgt $t1, 0, label_FALSE_95 +# IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 +# IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 +lw $t1, -24($fp) +beq $t1, 0, label_FALSE_95 +# LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) +# local_a2i_aux_at_A2I_internal_5 = 1 +li $t1, 1 +sw $t1, -24($fp) +# GOTO label_END_96 +j label_END_96 +label_FALSE_95: +# LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) +# local_a2i_aux_at_A2I_internal_5 = 0 +li $t1, 0 +sw $t1, -24($fp) +label_END_96: +# IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_WHILE_END_94 +# IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_WHILE_END_94 +lw $t1, -24($fp) +beq $t1, 0, label_WHILE_END_94 +# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) +# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) +# local_a2i_aux_at_A2I_internal_7 = local_a2i_aux_at_A2I_int_0 * 10 +lw $t1, -4($fp) +mul $t1, $t1, 10 +sw $t1, -32($fp) +# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) +# local_a2i_aux_at_A2I_internal_10 = SELF +sw $s1, -44($fp) +# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) +# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) +# local_a2i_aux_at_A2I_internal_8 = local_a2i_aux_at_A2I_internal_10 +lw $t1, -44($fp) +sw $t1, -36($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) +# PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) +# local_a2i_aux_at_A2I_internal_11 = PARAM param_a2i_aux_at_A2I_s_0 +lw $t1, 0($fp) +sw $t1, -48($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_a2i_aux_at_A2I_i_4 +# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) +lw $t1, -20($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# ARG 1 +li $t1, 1 +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) +# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) +# local_a2i_aux_at_A2I_internal_12 = VCALL local_a2i_aux_at_A2I_internal_11 substr +# Save new self pointer in $s1 +lw $s1, -48($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 0($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -52($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_aux_at_A2I_internal_12 +# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) +lw $t1, -52($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) +# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) +# local_a2i_aux_at_A2I_internal_9 = VCALL local_a2i_aux_at_A2I_internal_8 c2i +# Save new self pointer in $s1 +lw $s1, -36($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 12($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -40($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) +# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) +# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) +# local_a2i_aux_at_A2I_internal_6 = local_a2i_aux_at_A2I_internal_7 + local_a2i_aux_at_A2I_internal_9 +lw $t1, -32($fp) +lw $t2, -40($fp) +add $t1, $t1, $t2 +sw $t1, -28($fp) +# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) +# local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_6 +lw $t1, -28($fp) +sw $t1, -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) +# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) +# local_a2i_aux_at_A2I_internal_13 = local_a2i_aux_at_A2I_i_4 + 1 +lw $t1, -20($fp) +add $t1, $t1, 1 +sw $t1, -56($fp) +# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) +# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) +# local_a2i_aux_at_A2I_i_4 = local_a2i_aux_at_A2I_internal_13 +lw $t1, -56($fp) +sw $t1, -20($fp) +# GOTO label_WHILE_93 +j label_WHILE_93 +label_WHILE_END_94: +# RETURN local_a2i_aux_at_A2I_int_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_a2i_aux_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 64 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_i2a_at_A2I implementation. +# @Params: +# 0($fp) = param_i2a_at_A2I_i_0 +function_i2a_at_A2I: +# Allocate stack frame for function function_i2a_at_A2I. +subu $sp, $sp, 60 +sw $ra, 4($sp) +sw $fp, 0($sp) +addu $fp, $sp, 60 +# LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) +# PARAM param_i2a_at_A2I_i_0 --> 0($fp) +# local_i2a_at_A2I_internal_0 = PARAM param_i2a_at_A2I_i_0 - 0 +lw $t1, 0($fp) +sub $t1, $t1, 0 +sw $t1, -4($fp) +# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_TRUE_99 +# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_TRUE_99 +lw $t1, -4($fp) +beq $t1, 0, label_TRUE_99 +# LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) +# local_i2a_at_A2I_internal_0 = 0 +li $t1, 0 +sw $t1, -4($fp) +# GOTO label_END_100 +j label_END_100 +label_TRUE_99: +# LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) +# local_i2a_at_A2I_internal_0 = 1 +li $t1, 1 +sw $t1, -4($fp) +label_END_100: +# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSE_97 +# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSE_97 +lw $t1, -4($fp) +beq $t1, 0, label_FALSE_97 +# LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) +# +la $t1, data_25 +sw $t1, -8($fp) +# GOTO label_END_98 +j label_END_98 +label_FALSE_97: +# LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) +# PARAM param_i2a_at_A2I_i_0 --> 0($fp) +# local_i2a_at_A2I_internal_2 = 0 - PARAM param_i2a_at_A2I_i_0 +li $t1, 0 +lw $t2, 0($fp) +sub $t1, $t1, $t2 +sw $t1, -12($fp) +# IF_GREATER_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 +# IF_GREATER_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 +lw $t1, -12($fp) +bgt $t1, 0, label_FALSE_103 +# IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 +# IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 +lw $t1, -12($fp) +beq $t1, 0, label_FALSE_103 +# LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) +# local_i2a_at_A2I_internal_2 = 1 +li $t1, 1 +sw $t1, -12($fp) +# GOTO label_END_104 +j label_END_104 +label_FALSE_103: +# LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) +# local_i2a_at_A2I_internal_2 = 0 +li $t1, 0 +sw $t1, -12($fp) +label_END_104: +# IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_101 +# IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_101 +lw $t1, -12($fp) +beq $t1, 0, label_FALSE_101 +# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) +# local_i2a_at_A2I_internal_5 = SELF +sw $s1, -24($fp) +# LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) +# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) +# local_i2a_at_A2I_internal_3 = local_i2a_at_A2I_internal_5 +lw $t1, -24($fp) +sw $t1, -16($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_i2a_at_A2I_i_0 +# PARAM param_i2a_at_A2I_i_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) +# LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) +# local_i2a_at_A2I_internal_4 = VCALL local_i2a_at_A2I_internal_3 i2a_aux +# Save new self pointer in $s1 +lw $s1, -16($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 32($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -20($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# GOTO label_END_102 +j label_END_102 +label_FALSE_101: +# LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) +# +la $t1, data_26 +sw $t1, -36($fp) +# LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) +# LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) +# local_i2a_at_A2I_internal_6 = local_i2a_at_A2I_internal_8 +lw $t1, -36($fp) +sw $t1, -28($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) +# local_i2a_at_A2I_internal_11 = SELF +sw $s1, -48($fp) +# LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) +# LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) +# local_i2a_at_A2I_internal_9 = local_i2a_at_A2I_internal_11 +lw $t1, -48($fp) +sw $t1, -40($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) +# PARAM param_i2a_at_A2I_i_0 --> 0($fp) +# local_i2a_at_A2I_internal_12 = PARAM param_i2a_at_A2I_i_0 * 1 +lw $t1, 0($fp) +mul $t1, $t1, 1 +sw $t1, -52($fp) +# ARG local_i2a_at_A2I_internal_12 +# LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) +lw $t1, -52($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) +# LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) +# local_i2a_at_A2I_internal_10 = VCALL local_i2a_at_A2I_internal_9 i2a_aux +# Save new self pointer in $s1 +lw $s1, -40($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 32($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -44($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_i2a_at_A2I_internal_10 +# LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) +lw $t1, -44($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) +# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) +# local_i2a_at_A2I_internal_7 = VCALL local_i2a_at_A2I_internal_6 concat +# Save new self pointer in $s1 +lw $s1, -28($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 0($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -32($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +label_END_102: +label_END_98: +# RETURN +# Deallocate stack frame for function function_i2a_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 60 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_i2a_aux_at_A2I implementation. +# @Params: +# 0($fp) = param_i2a_aux_at_A2I_i_0 +function_i2a_aux_at_A2I: +# Allocate stack frame for function function_i2a_aux_at_A2I. +subu $sp, $sp, 64 +sw $ra, 4($sp) +sw $fp, 0($sp) +addu $fp, $sp, 64 +# LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) +# PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) +# local_i2a_aux_at_A2I_internal_0 = PARAM param_i2a_aux_at_A2I_i_0 - 0 +lw $t1, 0($fp) +sub $t1, $t1, 0 +sw $t1, -4($fp) +# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_TRUE_107 +# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_TRUE_107 +lw $t1, -4($fp) +beq $t1, 0, label_TRUE_107 +# LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) +# local_i2a_aux_at_A2I_internal_0 = 0 +li $t1, 0 +sw $t1, -4($fp) +# GOTO label_END_108 +j label_END_108 +label_TRUE_107: +# LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) +# local_i2a_aux_at_A2I_internal_0 = 1 +li $t1, 1 +sw $t1, -4($fp) +label_END_108: +# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSE_105 +# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSE_105 +lw $t1, -4($fp) +beq $t1, 0, label_FALSE_105 +# LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) +# +la $t1, data_27 +sw $t1, -8($fp) +# GOTO label_END_106 +j label_END_106 +label_FALSE_105: +# LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) +# PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) +# local_i2a_aux_at_A2I_internal_3 = PARAM param_i2a_aux_at_A2I_i_0 / 10 +lw $t1, 0($fp) +div $t1, $t1, 10 +sw $t1, -16($fp) +# LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) +# LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) +# local_i2a_aux_at_A2I_next_2 = local_i2a_aux_at_A2I_internal_3 +lw $t1, -16($fp) +sw $t1, -12($fp) +# LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) +# local_i2a_aux_at_A2I_internal_8 = SELF +sw $s1, -36($fp) +# LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) +# LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) +# local_i2a_aux_at_A2I_internal_6 = local_i2a_aux_at_A2I_internal_8 +lw $t1, -36($fp) +sw $t1, -28($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_i2a_aux_at_A2I_next_2 +# LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) +lw $t1, -12($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) +# LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) +# local_i2a_aux_at_A2I_internal_7 = VCALL local_i2a_aux_at_A2I_internal_6 i2a_aux +# Save new self pointer in $s1 +lw $s1, -28($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 32($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -32($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) +# LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) +# local_i2a_aux_at_A2I_internal_4 = local_i2a_aux_at_A2I_internal_7 +lw $t1, -32($fp) +sw $t1, -20($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) +# local_i2a_aux_at_A2I_internal_11 = SELF +sw $s1, -48($fp) +# LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) +# LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) +# local_i2a_aux_at_A2I_internal_9 = local_i2a_aux_at_A2I_internal_11 +lw $t1, -48($fp) +sw $t1, -40($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) +# LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) +# local_i2a_aux_at_A2I_internal_13 = local_i2a_aux_at_A2I_next_2 * 10 +lw $t1, -12($fp) +mul $t1, $t1, 10 +sw $t1, -56($fp) +# LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) +# PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) +# LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) +# local_i2a_aux_at_A2I_internal_12 = PARAM param_i2a_aux_at_A2I_i_0 - local_i2a_aux_at_A2I_internal_13 +lw $t1, 0($fp) +lw $t2, -56($fp) +sub $t1, $t1, $t2 +sw $t1, -52($fp) +# ARG local_i2a_aux_at_A2I_internal_12 +# LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) +lw $t1, -52($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) +# LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) +# local_i2a_aux_at_A2I_internal_10 = VCALL local_i2a_aux_at_A2I_internal_9 i2c +# Save new self pointer in $s1 +lw $s1, -40($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 16($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -44($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_i2a_aux_at_A2I_internal_10 +# LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) +lw $t1, -44($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) +# LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) +# local_i2a_aux_at_A2I_internal_5 = VCALL local_i2a_aux_at_A2I_internal_4 concat +# Save new self pointer in $s1 +lw $s1, -20($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 0($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -24($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +label_END_106: +# RETURN +# Deallocate stack frame for function function_i2a_aux_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 64 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: +# Allocate stack frame for function function_main_at_Main. +subu $sp, $sp, 100 +sw $ra, 4($sp) +sw $fp, 0($sp) +addu $fp, $sp, 100 +# LOCAL local_main_at_Main_internal_3 --> -16($fp) +# local_main_at_Main_internal_3 = ALLOCATE A2I +# Allocating 8 bytes of memory +li $a0, 8 +li $v0, 9 +syscall +la $t1, A2I +sw $t1, 0($v0) +la $t1, A2I_start +sw $t1, 4($v0) +move $t2, $v0 +sw $t2, -16($fp) +# LOCAL local_main_at_Main_internal_1 --> -8($fp) +# LOCAL local_main_at_Main_internal_3 --> -16($fp) +# local_main_at_Main_internal_1 = local_main_at_Main_internal_3 +lw $t1, -16($fp) +sw $t1, -8($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_4 --> -20($fp) +# +la $t1, data_28 +sw $t1, -20($fp) +# ARG local_main_at_Main_internal_4 +# LOCAL local_main_at_Main_internal_4 --> -20($fp) +lw $t1, -20($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_main_at_Main_internal_1 --> -8($fp) +# LOCAL local_main_at_Main_internal_2 --> -12($fp) +# local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 a2i +# Save new self pointer in $s1 +lw $s1, -8($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 20($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -12($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_a_0 --> -4($fp) +# LOCAL local_main_at_Main_internal_2 --> -12($fp) +# local_main_at_Main_a_0 = local_main_at_Main_internal_2 +lw $t1, -12($fp) +sw $t1, -4($fp) +# LOCAL local_main_at_Main_internal_8 --> -36($fp) +# local_main_at_Main_internal_8 = ALLOCATE A2I +# Allocating 8 bytes of memory +li $a0, 8 +li $v0, 9 +syscall +la $t1, A2I +sw $t1, 0($v0) +la $t1, A2I_start +sw $t1, 4($v0) +move $t2, $v0 +sw $t2, -36($fp) +# LOCAL local_main_at_Main_internal_6 --> -28($fp) +# LOCAL local_main_at_Main_internal_8 --> -36($fp) +# local_main_at_Main_internal_6 = local_main_at_Main_internal_8 +lw $t1, -36($fp) +sw $t1, -28($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG 678987 +li $t1, 678987 +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_main_at_Main_internal_6 --> -28($fp) +# LOCAL local_main_at_Main_internal_7 --> -32($fp) +# local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 i2a +# Save new self pointer in $s1 +lw $s1, -28($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 28($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -32($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_b_5 --> -24($fp) +# LOCAL local_main_at_Main_internal_7 --> -32($fp) +# local_main_at_Main_b_5 = local_main_at_Main_internal_7 +lw $t1, -32($fp) +sw $t1, -24($fp) +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +# local_main_at_Main_internal_11 = SELF +sw $s1, -48($fp) +# LOCAL local_main_at_Main_internal_9 --> -40($fp) +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +# local_main_at_Main_internal_9 = local_main_at_Main_internal_11 +lw $t1, -48($fp) +sw $t1, -40($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_main_at_Main_a_0 +# LOCAL local_main_at_Main_a_0 --> -4($fp) +lw $t1, -4($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_main_at_Main_internal_9 --> -40($fp) +# LOCAL local_main_at_Main_internal_10 --> -44($fp) +# local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_int +# Save new self pointer in $s1 +lw $s1, -40($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 4($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -44($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# local_main_at_Main_internal_14 = SELF +sw $s1, -60($fp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 +lw $t1, -60($fp) +sw $t1, -52($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# +la $t1, data_29 +sw $t1, -64($fp) +# ARG local_main_at_Main_internal_15 +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +lw $t1, -64($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string +# Save new self pointer in $s1 +lw $s1, -52($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 0($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -56($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# local_main_at_Main_internal_18 = SELF +sw $s1, -76($fp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# local_main_at_Main_internal_16 = local_main_at_Main_internal_18 +lw $t1, -76($fp) +sw $t1, -68($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_main_at_Main_b_5 +# LOCAL local_main_at_Main_b_5 --> -24($fp) +lw $t1, -24($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +# local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string +# Save new self pointer in $s1 +lw $s1, -68($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 0($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -72($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_21 --> -88($fp) +# local_main_at_Main_internal_21 = SELF +sw $s1, -88($fp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# LOCAL local_main_at_Main_internal_21 --> -88($fp) +# local_main_at_Main_internal_19 = local_main_at_Main_internal_21 +lw $t1, -88($fp) +sw $t1, -80($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_22 --> -92($fp) +# +la $t1, data_30 +sw $t1, -92($fp) +# ARG local_main_at_Main_internal_22 +# LOCAL local_main_at_Main_internal_22 --> -92($fp) +lw $t1, -92($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# LOCAL local_main_at_Main_internal_20 --> -84($fp) +# local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 out_string +# Save new self pointer in $s1 +lw $s1, -80($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 0($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -84($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# RETURN local_main_at_Main_internal_20 +lw $v0, -84($fp) +# Deallocate stack frame for function function_main_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 100 +jr $ra +# Function END + + diff --git a/src/testing.py b/src/testing.py index df9598a8..0433b837 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,20 +60,126 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r""" +text = r"""(* + The class A2I provides integer-to-string and string-to-integer +conversion routines. To use these routines, either inherit them +in the class where needed, have a dummy variable bound to +something of type A2I, or simpl write (new A2I).method(argument). +*) + + +(* + c2i Converts a 1-character string to an integer. Aborts + if the string is not "0" through "9" +*) +class A2I { + + c2i(char : String) : Int { + if char = "0" then 0 else + if char = "1" then 1 else + if char = "2" then 2 else + if char = "3" then 3 else + if char = "4" then 4 else + if char = "5" then 5 else + if char = "6" then 6 else + if char = "7" then 7 else + if char = "8" then 8 else + if char = "9" then 9 else + { abort(); 0; } -- the 0 is needed to satisfy the typchecker + fi fi fi fi fi fi fi fi fi fi + }; + +(* + i2c is the inverse of c2i. +*) + i2c(i : Int) : String { + if i = 0 then "0" else + if i = 1 then "1" else + if i = 2 then "2" else + if i = 3 then "3" else + if i = 4 then "4" else + if i = 5 then "5" else + if i = 6 then "6" else + if i = 7 then "7" else + if i = 8 then "8" else + if i = 9 then "9" else + { abort(); ""; } -- the "" is needed to satisfy the typchecker + fi fi fi fi fi fi fi fi fi fi + }; + +(* + a2i converts an ASCII string into an integer. The empty string +is converted to 0. Signed and unsigned strings are handled. The +method aborts if the string does not represent an integer. Very +long strings of digits produce strange answers because of arithmetic +overflow. + +*) + a2i(s : String) : Int { + if s.length() = 0 then 0 else + if s.substr(0,1) = "-" then ~a2i_aux(s.substr(1,s.length()-1)) else + if s.substr(0,1) = "+" then a2i_aux(s.substr(1,s.length()-1)) else + a2i_aux(s) + fi fi fi + }; + +(* + a2i_aux converts the usigned portion of the string. As a programming +example, this method is written iteratively. +*) + a2i_aux(s : String) : Int { + (let int : Int <- 0 in + { + (let j : Int <- s.length() in + (let i : Int <- 0 in + while i < j loop + { + int <- int * 10 + c2i(s.substr(i,1)); + i <- i + 1; + } + pool + ) + ); + int; + } + ) + }; + +(* + i2a converts an integer to a string. Positive and negative +numbers are handled correctly. +*) + i2a(i : Int) : String { + if i = 0 then "0" else + if 0 < i then i2a_aux(i) else + "-".concat(i2a_aux(i * ~1)) + fi fi + }; + +(* + i2a_aux is an example using recursion. +*) + i2a_aux(i : Int) : String { + if i = 0 then "" else + (let next : Int <- i / 10 in + i2a_aux(next).concat(i2c(i - next * 10)) + ) + fi + }; + +}; + class Main inherits IO { main () : Object { - (let a : Int <- (new A2I).a2i("678987"), + let a : Int <- (new A2I).a2i("678987"), b : String <- (new A2I).i2a(678987) in { out_int(a) ; out_string(" == ") ; out_string(b) ; out_string("\n"); - } - ) + } } ; } ; - """ pipeline(text, 5) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index aee1a667..d2c806f9 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -720,6 +720,6 @@ def to_str(self) -> str: if "#" not in line and (":" in line and "end" not in line): if "word" not in line and "asciiz" not in line and "byte" not in line: indent += 1 - if "# Function END" in line: + if "# Function END" in line or "label_END" in line: indent -= 1 return program diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index b1a67355..9cf68fb3 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -517,10 +517,6 @@ def _(self, node: coolAst.MulNode, scope: Scope) -> LocalNode: # Obtener el resultado del segundo factor right_vm_holder = self.visit(node.right, scope) - assert isinstance(left_vm_holder, LocalNode) and isinstance( - right_vm_holder, LocalNode - ) - # Registrar la instruccion de multimplicacion self.register_instruction( StarNode(left_vm_holder, right_vm_holder, mul_internal_vm_holder) @@ -666,10 +662,6 @@ def _(self, node: coolAst.LowerThanNode, scope: Scope) -> LocalNode: # Obtener el valor de la expresion derecha right_vm_holder = self.visit(node.right, scope) - # Comparar los resultados restando - assert isinstance(left_vm_holder, LocalNode) and isinstance( - right_vm_holder, LocalNode - ) self.register_instruction( MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder) ) From 749607213a2fb6017d6d3bb59b7fd58676273db9 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 3 Dec 2020 16:02:47 -0500 Subject: [PATCH 136/162] Make strings type records --- src/cil/baseCilVisitor.py | 45 +- src/cil/nodes.py | 9 +- src/testing.mips | 2285 +++----------------------------- src/testing.py | 123 +- src/travels/ciltomips.py | 37 +- src/travels/ctcill.py | 4 +- tests/codegen/fib.mips | 733 ++++++++++ tests/codegen/hello_world.mips | 468 +++++++ tests/codegen/io.mips | 1085 +++++++++++++++ 9 files changed, 2526 insertions(+), 2263 deletions(-) create mode 100644 tests/codegen/fib.mips create mode 100644 tests/codegen/hello_world.mips create mode 100644 tests/codegen/io.mips diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 716518ff..19eed645 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -1,14 +1,15 @@ from typing import List, Optional, Any, Dict, Tuple import cil.nodes as nodes -from abstract.semantics import VariableInfo, Context, Type, Method +from abstract.semantics import Attribute, VariableInfo, Context, Type, Method from cil.nodes import ( - CopyNode, + CopyNode, GetAttributeNode, PrintIntNode, PrintNode, ReadIntNode, ReadNode, ReturnNode, - SelfNode, TypeName, + SelfNode, + TypeName, TypeNode, ) @@ -186,7 +187,6 @@ def do_label(self, label: str) -> str: self.__labels_count += 1 return f"label_{label}_{self.__labels_count}" - def __build_CART(self) -> None: """ CART: Context Aware Runtime Table.\ @@ -286,12 +286,38 @@ def __implement_type_name(self): self.register_instruction(TypeName(return_vm_holder)) self.register_instruction(ReturnNode(return_vm_holder)) + def __implement_concat(self): + self.current_function = self.register_function("function_concat_at_String") + return_vm_holder = self.define_internal_local() + param = self.register_params( + VariableInfo("s", self.context.get_type("String"), "PARAM") + ) + self.register_instruction(ReturnNode(return_vm_holder)) + + def __implement_substr(self): + self.current_function = self.register_function("function_substr_at_String") + return_vm_holder = self.define_internal_local() + paraml = self.register_params( + VariableInfo("l", self.context.get_type("Int"), "PARAM") + ) + paramr = self.register_params( + VariableInfo("r", self.context.get_type("Int"), "PARAM") + ) + self.register_instruction(ReturnNode(return_vm_holder)) + + def __implement_length(self): + str_ = self.context.get_type("String") + self.current_function = self.register_function("function_length_at_String") + return_vm_holder = self.define_internal_local() + self.register_instruction(GetAttributeNode(str_, "length", return_vm_holder)) + self.register_instruction(ReturnNode(return_vm_holder)) def build_builtins(self): - + # Registrar el tipo IO como un tipo instanciable io_typeNode = self.register_type("IO") obj = self.register_type("Object") + str_ = self.register_type("String") io_typeNode.methods.append(("out_string", "function_out_string_at_IO")) io_typeNode.methods.append(("out_int", "function_out_int_at_IO")) @@ -305,6 +331,12 @@ def build_builtins(self): obj.methods.append(("type_name", "function_type_name_at_Object")) obj.methods.append(("copy", "function_copy_at_Object")) + str_.methods.append(("concat", "function_concat_at_String")) + str_.methods.append(("substr", "function_substr_at_String")) + str_.methods.append(("length", "function_length_at_String")) + + str_.attributes.append(Attribute("length", self.context.get_type("Int"))) + str_.attributes.append(Attribute("value", self.context.get_type("String"))) self.__implement_in_string() self.__implement_out_int() @@ -313,3 +345,6 @@ def build_builtins(self): self.__implement_abort() self.__implement_copy() self.__implement_type_name() + self.__implement_concat() + self.__implement_substr() + self.__implement_length() diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 6527daf3..98efecfa 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -280,4 +280,11 @@ class SaveSelf(InstructionNode): pass class RestoreSelf(InstructionNode): - pass \ No newline at end of file + pass + + +class AllocateStringNode(InstructionNode): + def __init__(self, dest: LocalNode, value: DataNode, length: int) -> None: + self.dest = dest + self.value = value + self.length = length \ No newline at end of file diff --git a/src/testing.mips b/src/testing.mips index 18bae393..3e1a1a4d 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 12:35:09 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 16:02:04 2020 # School of Math and Computer Science, University of Havana # @@ -9,7 +9,7 @@ IO: .asciiz "IO" # Function END Object: .asciiz "Object" # Function END -A2I: .asciiz "A2I" +String: .asciiz "String" # Function END Main: .asciiz "Main" # Function END @@ -40,15 +40,17 @@ Object_end: # -# **** VTABLE for type A2I **** -A2I_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_c2i_at_A2I, function_i2c_at_A2I, function_a2i_at_A2I, function_a2i_aux_at_A2I, function_i2a_at_A2I, function_i2a_aux_at_A2I +# **** VTABLE for type String **** +String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String # -# **** Type RECORD for type A2I **** -A2I_start: -A2I_vtable_pointer: .word A2I_vtable -A2I_end: +# **** Type RECORD for type String **** +String_start: +String_vtable_pointer: .word String_vtable +String_attrib_length: .word 0 +String_attrib_value: .asciiz "" +String_end: # @@ -73,166 +75,41 @@ __Object_Int_tdt_entry__: .word 1 __Object_String_tdt_entry__: .word 1 __Object_Bool_tdt_entry__: .word 1 __Object_IO_tdt_entry__: .word 1 -__Object_A2I_tdt_entry__: .word 1 __Object_Main_tdt_entry__: .word 2 __Int_Object_tdt_entry__: .word -1 __Int_Int_tdt_entry__: .word 0 __Int_String_tdt_entry__: .word -1 __Int_Bool_tdt_entry__: .word -1 __Int_IO_tdt_entry__: .word -1 -__Int_A2I_tdt_entry__: .word -1 __Int_Main_tdt_entry__: .word -1 __String_Object_tdt_entry__: .word -1 __String_Int_tdt_entry__: .word -1 __String_String_tdt_entry__: .word 0 __String_Bool_tdt_entry__: .word -1 __String_IO_tdt_entry__: .word -1 -__String_A2I_tdt_entry__: .word -1 __String_Main_tdt_entry__: .word -1 __Bool_Object_tdt_entry__: .word -1 __Bool_Int_tdt_entry__: .word -1 __Bool_String_tdt_entry__: .word -1 __Bool_Bool_tdt_entry__: .word 0 __Bool_IO_tdt_entry__: .word -1 -__Bool_A2I_tdt_entry__: .word -1 __Bool_Main_tdt_entry__: .word -1 __IO_Object_tdt_entry__: .word -1 __IO_Int_tdt_entry__: .word -1 __IO_String_tdt_entry__: .word -1 __IO_Bool_tdt_entry__: .word -1 __IO_IO_tdt_entry__: .word 0 -__IO_A2I_tdt_entry__: .word -1 __IO_Main_tdt_entry__: .word 1 -__A2I_Object_tdt_entry__: .word -1 -__A2I_Int_tdt_entry__: .word -1 -__A2I_String_tdt_entry__: .word -1 -__A2I_Bool_tdt_entry__: .word -1 -__A2I_IO_tdt_entry__: .word -1 -__A2I_A2I_tdt_entry__: .word 0 -__A2I_Main_tdt_entry__: .word -1 __Main_Object_tdt_entry__: .word -1 __Main_Int_tdt_entry__: .word -1 __Main_String_tdt_entry__: .word -1 __Main_Bool_tdt_entry__: .word -1 __Main_IO_tdt_entry__: .word -1 -__Main_A2I_tdt_entry__: .word -1 __Main_Main_tdt_entry__: .word 0 # -data_2: .asciiz "0" -# - - -data_3: .asciiz "1" -# - - -data_4: .asciiz "2" -# - - -data_5: .asciiz "3" -# - - -data_6: .asciiz "4" -# - - -data_7: .asciiz "5" -# - - -data_8: .asciiz "6" -# - - -data_9: .asciiz "7" -# - - -data_10: .asciiz "8" -# - - -data_11: .asciiz "9" -# - - -data_12: .asciiz "0" -# - - -data_13: .asciiz "1" -# - - -data_14: .asciiz "2" -# - - -data_15: .asciiz "3" -# - - -data_16: .asciiz "4" -# - - -data_17: .asciiz "5" -# - - -data_18: .asciiz "6" -# - - -data_19: .asciiz "7" -# - - -data_20: .asciiz "8" -# - - -data_21: .asciiz "9" -# - - -data_22: .asciiz "" -# - - -data_23: .asciiz "-" -# - - -data_24: .asciiz "+" -# - - -data_25: .asciiz "0" -# - - -data_26: .asciiz "-" -# - - -data_27: .asciiz "" -# - - -data_28: .asciiz "678987" -# - - -data_29: .asciiz " == " -# - - -data_30: .asciiz "\n" +data_2: .asciiz "Hello, World.\n" # @@ -304,7 +181,8 @@ function_out_string_at_IO: addu $fp, $sp, 32 # PARAM param_out_string_at_IO_x_0 --> 0($fp) # PRINT_STR param_out_string_at_IO_x_0 - lw $a0, 0($fp) + lw $v0, 0($fp) + lw $a0, 8($v0) li $v0, 4 syscall # RETURN @@ -406,6 +284,80 @@ function_type_name_at_Object: # Function END +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t1, 8($s1) + sw $t1, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + # entry implementation. # @Params: entry: @@ -445,2008 +397,73 @@ entry: # Function END -# function_c2i_at_A2I implementation. +# function_main_at_Main implementation. # @Params: -# 0($fp) = param_c2i_at_A2I_char_0 -function_c2i_at_A2I: - # Allocate stack frame for function function_c2i_at_A2I. - subu $sp, $sp, 100 +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 100 - # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) - # - la $t1, data_2 - sw $t1, -8($fp) - # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) - # local_c2i_at_A2I_internal_0 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_1 - lw $t1, 0($fp) - lw $t2, -8($fp) - sub $t1, $t1, $t2 - sw $t1, -4($fp) - # IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_TRUE_3 - # IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_TRUE_3 - lw $t1, -4($fp) - beq $t1, 0, label_TRUE_3 - # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) - # local_c2i_at_A2I_internal_0 = 0 - li $t1, 0 + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t1, -12($fp) sw $t1, -4($fp) - # GOTO label_END_4 -j label_END_4 -label_TRUE_3: -# LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) -# local_c2i_at_A2I_internal_0 = 1 -li $t1, 1 -sw $t1, -4($fp) -label_END_4: -# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSE_1 -# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSE_1 -lw $t1, -4($fp) -beq $t1, 0, label_FALSE_1 -# GOTO label_END_2 -j label_END_2 -label_FALSE_1: -# LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) -# -la $t1, data_3 -sw $t1, -16($fp) -# LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) -# PARAM param_c2i_at_A2I_char_0 --> 0($fp) -# LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) -# local_c2i_at_A2I_internal_2 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_3 -lw $t1, 0($fp) -lw $t2, -16($fp) -sub $t1, $t1, $t2 -sw $t1, -12($fp) -# IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_TRUE_7 -# IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_TRUE_7 -lw $t1, -12($fp) -beq $t1, 0, label_TRUE_7 -# LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) -# local_c2i_at_A2I_internal_2 = 0 -li $t1, 0 -sw $t1, -12($fp) -# GOTO label_END_8 -j label_END_8 -label_TRUE_7: -# LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) -# local_c2i_at_A2I_internal_2 = 1 -li $t1, 1 -sw $t1, -12($fp) -label_END_8: -# IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_FALSE_5 -# IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_FALSE_5 -lw $t1, -12($fp) -beq $t1, 0, label_FALSE_5 -# GOTO label_END_6 -j label_END_6 -label_FALSE_5: -# LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) -# -la $t1, data_4 -sw $t1, -24($fp) -# LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) -# PARAM param_c2i_at_A2I_char_0 --> 0($fp) -# LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) -# local_c2i_at_A2I_internal_4 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_5 -lw $t1, 0($fp) -lw $t2, -24($fp) -sub $t1, $t1, $t2 -sw $t1, -20($fp) -# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_11 -# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_11 -lw $t1, -20($fp) -beq $t1, 0, label_TRUE_11 -# LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) -# local_c2i_at_A2I_internal_4 = 0 -li $t1, 0 -sw $t1, -20($fp) -# GOTO label_END_12 -j label_END_12 -label_TRUE_11: -# LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) -# local_c2i_at_A2I_internal_4 = 1 -li $t1, 1 -sw $t1, -20($fp) -label_END_12: -# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_9 -# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_9 -lw $t1, -20($fp) -beq $t1, 0, label_FALSE_9 -# GOTO label_END_10 -j label_END_10 -label_FALSE_9: -# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) -# -la $t1, data_5 -sw $t1, -32($fp) -# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) -# PARAM param_c2i_at_A2I_char_0 --> 0($fp) -# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) -# local_c2i_at_A2I_internal_6 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_7 -lw $t1, 0($fp) -lw $t2, -32($fp) -sub $t1, $t1, $t2 -sw $t1, -28($fp) -# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_TRUE_15 -# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_TRUE_15 -lw $t1, -28($fp) -beq $t1, 0, label_TRUE_15 -# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) -# local_c2i_at_A2I_internal_6 = 0 -li $t1, 0 -sw $t1, -28($fp) -# GOTO label_END_16 -j label_END_16 -label_TRUE_15: -# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) -# local_c2i_at_A2I_internal_6 = 1 -li $t1, 1 -sw $t1, -28($fp) -label_END_16: -# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSE_13 -# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSE_13 -lw $t1, -28($fp) -beq $t1, 0, label_FALSE_13 -# GOTO label_END_14 -j label_END_14 -label_FALSE_13: -# LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) -# -la $t1, data_6 -sw $t1, -40($fp) -# LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) -# PARAM param_c2i_at_A2I_char_0 --> 0($fp) -# LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) -# local_c2i_at_A2I_internal_8 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_9 -lw $t1, 0($fp) -lw $t2, -40($fp) -sub $t1, $t1, $t2 -sw $t1, -36($fp) -# IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_TRUE_19 -# IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_TRUE_19 -lw $t1, -36($fp) -beq $t1, 0, label_TRUE_19 -# LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) -# local_c2i_at_A2I_internal_8 = 0 -li $t1, 0 -sw $t1, -36($fp) -# GOTO label_END_20 -j label_END_20 -label_TRUE_19: -# LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) -# local_c2i_at_A2I_internal_8 = 1 -li $t1, 1 -sw $t1, -36($fp) -label_END_20: -# IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_FALSE_17 -# IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_FALSE_17 -lw $t1, -36($fp) -beq $t1, 0, label_FALSE_17 -# GOTO label_END_18 -j label_END_18 -label_FALSE_17: -# LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) -# -la $t1, data_7 -sw $t1, -48($fp) -# LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) -# PARAM param_c2i_at_A2I_char_0 --> 0($fp) -# LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) -# local_c2i_at_A2I_internal_10 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_11 -lw $t1, 0($fp) -lw $t2, -48($fp) -sub $t1, $t1, $t2 -sw $t1, -44($fp) -# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_23 -# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_23 -lw $t1, -44($fp) -beq $t1, 0, label_TRUE_23 -# LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) -# local_c2i_at_A2I_internal_10 = 0 -li $t1, 0 -sw $t1, -44($fp) -# GOTO label_END_24 -j label_END_24 -label_TRUE_23: -# LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) -# local_c2i_at_A2I_internal_10 = 1 -li $t1, 1 -sw $t1, -44($fp) -label_END_24: -# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_21 -# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_21 -lw $t1, -44($fp) -beq $t1, 0, label_FALSE_21 -# GOTO label_END_22 -j label_END_22 -label_FALSE_21: -# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) -# -la $t1, data_8 -sw $t1, -56($fp) -# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) -# PARAM param_c2i_at_A2I_char_0 --> 0($fp) -# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) -# local_c2i_at_A2I_internal_12 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_13 -lw $t1, 0($fp) -lw $t2, -56($fp) -sub $t1, $t1, $t2 -sw $t1, -52($fp) -# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_TRUE_27 -# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_TRUE_27 -lw $t1, -52($fp) -beq $t1, 0, label_TRUE_27 -# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) -# local_c2i_at_A2I_internal_12 = 0 -li $t1, 0 -sw $t1, -52($fp) -# GOTO label_END_28 -j label_END_28 -label_TRUE_27: -# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) -# local_c2i_at_A2I_internal_12 = 1 -li $t1, 1 -sw $t1, -52($fp) -label_END_28: -# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSE_25 -# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSE_25 -lw $t1, -52($fp) -beq $t1, 0, label_FALSE_25 -# GOTO label_END_26 -j label_END_26 -label_FALSE_25: -# LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) -# -la $t1, data_9 -sw $t1, -64($fp) -# LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) -# PARAM param_c2i_at_A2I_char_0 --> 0($fp) -# LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) -# local_c2i_at_A2I_internal_14 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_15 -lw $t1, 0($fp) -lw $t2, -64($fp) -sub $t1, $t1, $t2 -sw $t1, -60($fp) -# IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_TRUE_31 -# IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_TRUE_31 -lw $t1, -60($fp) -beq $t1, 0, label_TRUE_31 -# LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) -# local_c2i_at_A2I_internal_14 = 0 -li $t1, 0 -sw $t1, -60($fp) -# GOTO label_END_32 -j label_END_32 -label_TRUE_31: -# LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) -# local_c2i_at_A2I_internal_14 = 1 -li $t1, 1 -sw $t1, -60($fp) -label_END_32: -# IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_FALSE_29 -# IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_FALSE_29 -lw $t1, -60($fp) -beq $t1, 0, label_FALSE_29 -# GOTO label_END_30 -j label_END_30 -label_FALSE_29: -# LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) -# -la $t1, data_10 -sw $t1, -72($fp) -# LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) -# PARAM param_c2i_at_A2I_char_0 --> 0($fp) -# LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) -# local_c2i_at_A2I_internal_16 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_17 -lw $t1, 0($fp) -lw $t2, -72($fp) -sub $t1, $t1, $t2 -sw $t1, -68($fp) -# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_35 -# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_35 -lw $t1, -68($fp) -beq $t1, 0, label_TRUE_35 -# LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) -# local_c2i_at_A2I_internal_16 = 0 -li $t1, 0 -sw $t1, -68($fp) -# GOTO label_END_36 -j label_END_36 -label_TRUE_35: -# LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) -# local_c2i_at_A2I_internal_16 = 1 -li $t1, 1 -sw $t1, -68($fp) -label_END_36: -# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_33 -# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_33 -lw $t1, -68($fp) -beq $t1, 0, label_FALSE_33 -# GOTO label_END_34 -j label_END_34 -label_FALSE_33: -# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) -# -la $t1, data_11 -sw $t1, -80($fp) -# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) -# PARAM param_c2i_at_A2I_char_0 --> 0($fp) -# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) -# local_c2i_at_A2I_internal_18 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_19 -lw $t1, 0($fp) -lw $t2, -80($fp) -sub $t1, $t1, $t2 -sw $t1, -76($fp) -# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_TRUE_39 -# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_TRUE_39 -lw $t1, -76($fp) -beq $t1, 0, label_TRUE_39 -# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) -# local_c2i_at_A2I_internal_18 = 0 -li $t1, 0 -sw $t1, -76($fp) -# GOTO label_END_40 -j label_END_40 -label_TRUE_39: -# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) -# local_c2i_at_A2I_internal_18 = 1 -li $t1, 1 -sw $t1, -76($fp) -label_END_40: -# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSE_37 -# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSE_37 -lw $t1, -76($fp) -beq $t1, 0, label_FALSE_37 -# GOTO label_END_38 -j label_END_38 -label_FALSE_37: -# LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) -# local_c2i_at_A2I_internal_22 = SELF -sw $s1, -92($fp) -# LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) -# LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) -# local_c2i_at_A2I_internal_20 = local_c2i_at_A2I_internal_22 -lw $t1, -92($fp) -sw $t1, -84($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) -# LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) -# local_c2i_at_A2I_internal_21 = VCALL local_c2i_at_A2I_internal_20 abort -# Save new self pointer in $s1 -lw $s1, -84($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 16($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -88($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -label_END_38: -label_END_34: -label_END_30: -label_END_26: -label_END_22: -label_END_18: -label_END_14: -label_END_10: -label_END_6: -label_END_2: -# RETURN -# Deallocate stack frame for function function_c2i_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 100 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_i2c_at_A2I implementation. -# @Params: -# 0($fp) = param_i2c_at_A2I_i_0 -function_i2c_at_A2I: -# Allocate stack frame for function function_i2c_at_A2I. -subu $sp, $sp, 104 -sw $ra, 4($sp) -sw $fp, 0($sp) -addu $fp, $sp, 104 -# LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) -# PARAM param_i2c_at_A2I_i_0 --> 0($fp) -# local_i2c_at_A2I_internal_0 = PARAM param_i2c_at_A2I_i_0 - 0 -lw $t1, 0($fp) -sub $t1, $t1, 0 -sw $t1, -4($fp) -# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_TRUE_43 -# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_TRUE_43 -lw $t1, -4($fp) -beq $t1, 0, label_TRUE_43 -# LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) -# local_i2c_at_A2I_internal_0 = 0 -li $t1, 0 -sw $t1, -4($fp) -# GOTO label_END_44 -j label_END_44 -label_TRUE_43: -# LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) -# local_i2c_at_A2I_internal_0 = 1 -li $t1, 1 -sw $t1, -4($fp) -label_END_44: -# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSE_41 -# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSE_41 -lw $t1, -4($fp) -beq $t1, 0, label_FALSE_41 -# LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) -# -la $t1, data_12 -sw $t1, -8($fp) -# GOTO label_END_42 -j label_END_42 -label_FALSE_41: -# LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) -# PARAM param_i2c_at_A2I_i_0 --> 0($fp) -# local_i2c_at_A2I_internal_2 = PARAM param_i2c_at_A2I_i_0 - 1 -lw $t1, 0($fp) -sub $t1, $t1, 1 -sw $t1, -12($fp) -# IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_TRUE_47 -# IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_TRUE_47 -lw $t1, -12($fp) -beq $t1, 0, label_TRUE_47 -# LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) -# local_i2c_at_A2I_internal_2 = 0 -li $t1, 0 -sw $t1, -12($fp) -# GOTO label_END_48 -j label_END_48 -label_TRUE_47: -# LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) -# local_i2c_at_A2I_internal_2 = 1 -li $t1, 1 -sw $t1, -12($fp) -label_END_48: -# IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_FALSE_45 -# IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_FALSE_45 -lw $t1, -12($fp) -beq $t1, 0, label_FALSE_45 -# LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) -# -la $t1, data_13 -sw $t1, -16($fp) -# GOTO label_END_46 -j label_END_46 -label_FALSE_45: -# LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) -# PARAM param_i2c_at_A2I_i_0 --> 0($fp) -# local_i2c_at_A2I_internal_4 = PARAM param_i2c_at_A2I_i_0 - 2 -lw $t1, 0($fp) -sub $t1, $t1, 2 -sw $t1, -20($fp) -# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_51 -# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_51 -lw $t1, -20($fp) -beq $t1, 0, label_TRUE_51 -# LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) -# local_i2c_at_A2I_internal_4 = 0 -li $t1, 0 -sw $t1, -20($fp) -# GOTO label_END_52 -j label_END_52 -label_TRUE_51: -# LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) -# local_i2c_at_A2I_internal_4 = 1 -li $t1, 1 -sw $t1, -20($fp) -label_END_52: -# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_49 -# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_49 -lw $t1, -20($fp) -beq $t1, 0, label_FALSE_49 -# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) -# -la $t1, data_14 -sw $t1, -24($fp) -# GOTO label_END_50 -j label_END_50 -label_FALSE_49: -# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) -# PARAM param_i2c_at_A2I_i_0 --> 0($fp) -# local_i2c_at_A2I_internal_6 = PARAM param_i2c_at_A2I_i_0 - 3 -lw $t1, 0($fp) -sub $t1, $t1, 3 -sw $t1, -28($fp) -# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_TRUE_55 -# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_TRUE_55 -lw $t1, -28($fp) -beq $t1, 0, label_TRUE_55 -# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) -# local_i2c_at_A2I_internal_6 = 0 -li $t1, 0 -sw $t1, -28($fp) -# GOTO label_END_56 -j label_END_56 -label_TRUE_55: -# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) -# local_i2c_at_A2I_internal_6 = 1 -li $t1, 1 -sw $t1, -28($fp) -label_END_56: -# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSE_53 -# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSE_53 -lw $t1, -28($fp) -beq $t1, 0, label_FALSE_53 -# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) -# -la $t1, data_15 -sw $t1, -32($fp) -# GOTO label_END_54 -j label_END_54 -label_FALSE_53: -# LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) -# PARAM param_i2c_at_A2I_i_0 --> 0($fp) -# local_i2c_at_A2I_internal_8 = PARAM param_i2c_at_A2I_i_0 - 4 -lw $t1, 0($fp) -sub $t1, $t1, 4 -sw $t1, -36($fp) -# IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_TRUE_59 -# IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_TRUE_59 -lw $t1, -36($fp) -beq $t1, 0, label_TRUE_59 -# LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) -# local_i2c_at_A2I_internal_8 = 0 -li $t1, 0 -sw $t1, -36($fp) -# GOTO label_END_60 -j label_END_60 -label_TRUE_59: -# LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) -# local_i2c_at_A2I_internal_8 = 1 -li $t1, 1 -sw $t1, -36($fp) -label_END_60: -# IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_FALSE_57 -# IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_FALSE_57 -lw $t1, -36($fp) -beq $t1, 0, label_FALSE_57 -# LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) -# -la $t1, data_16 -sw $t1, -40($fp) -# GOTO label_END_58 -j label_END_58 -label_FALSE_57: -# LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) -# PARAM param_i2c_at_A2I_i_0 --> 0($fp) -# local_i2c_at_A2I_internal_10 = PARAM param_i2c_at_A2I_i_0 - 5 -lw $t1, 0($fp) -sub $t1, $t1, 5 -sw $t1, -44($fp) -# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_63 -# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_63 -lw $t1, -44($fp) -beq $t1, 0, label_TRUE_63 -# LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) -# local_i2c_at_A2I_internal_10 = 0 -li $t1, 0 -sw $t1, -44($fp) -# GOTO label_END_64 -j label_END_64 -label_TRUE_63: -# LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) -# local_i2c_at_A2I_internal_10 = 1 -li $t1, 1 -sw $t1, -44($fp) -label_END_64: -# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_61 -# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_61 -lw $t1, -44($fp) -beq $t1, 0, label_FALSE_61 -# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) -# -la $t1, data_17 -sw $t1, -48($fp) -# GOTO label_END_62 -j label_END_62 -label_FALSE_61: -# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) -# PARAM param_i2c_at_A2I_i_0 --> 0($fp) -# local_i2c_at_A2I_internal_12 = PARAM param_i2c_at_A2I_i_0 - 6 -lw $t1, 0($fp) -sub $t1, $t1, 6 -sw $t1, -52($fp) -# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_TRUE_67 -# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_TRUE_67 -lw $t1, -52($fp) -beq $t1, 0, label_TRUE_67 -# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) -# local_i2c_at_A2I_internal_12 = 0 -li $t1, 0 -sw $t1, -52($fp) -# GOTO label_END_68 -j label_END_68 -label_TRUE_67: -# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) -# local_i2c_at_A2I_internal_12 = 1 -li $t1, 1 -sw $t1, -52($fp) -label_END_68: -# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSE_65 -# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSE_65 -lw $t1, -52($fp) -beq $t1, 0, label_FALSE_65 -# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) -# -la $t1, data_18 -sw $t1, -56($fp) -# GOTO label_END_66 -j label_END_66 -label_FALSE_65: -# LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) -# PARAM param_i2c_at_A2I_i_0 --> 0($fp) -# local_i2c_at_A2I_internal_14 = PARAM param_i2c_at_A2I_i_0 - 7 -lw $t1, 0($fp) -sub $t1, $t1, 7 -sw $t1, -60($fp) -# IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_TRUE_71 -# IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_TRUE_71 -lw $t1, -60($fp) -beq $t1, 0, label_TRUE_71 -# LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) -# local_i2c_at_A2I_internal_14 = 0 -li $t1, 0 -sw $t1, -60($fp) -# GOTO label_END_72 -j label_END_72 -label_TRUE_71: -# LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) -# local_i2c_at_A2I_internal_14 = 1 -li $t1, 1 -sw $t1, -60($fp) -label_END_72: -# IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_FALSE_69 -# IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_FALSE_69 -lw $t1, -60($fp) -beq $t1, 0, label_FALSE_69 -# LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) -# -la $t1, data_19 -sw $t1, -64($fp) -# GOTO label_END_70 -j label_END_70 -label_FALSE_69: -# LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) -# PARAM param_i2c_at_A2I_i_0 --> 0($fp) -# local_i2c_at_A2I_internal_16 = PARAM param_i2c_at_A2I_i_0 - 8 -lw $t1, 0($fp) -sub $t1, $t1, 8 -sw $t1, -68($fp) -# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_75 -# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_75 -lw $t1, -68($fp) -beq $t1, 0, label_TRUE_75 -# LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) -# local_i2c_at_A2I_internal_16 = 0 -li $t1, 0 -sw $t1, -68($fp) -# GOTO label_END_76 -j label_END_76 -label_TRUE_75: -# LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) -# local_i2c_at_A2I_internal_16 = 1 -li $t1, 1 -sw $t1, -68($fp) -label_END_76: -# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_73 -# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_73 -lw $t1, -68($fp) -beq $t1, 0, label_FALSE_73 -# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) -# -la $t1, data_20 -sw $t1, -72($fp) -# GOTO label_END_74 -j label_END_74 -label_FALSE_73: -# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) -# PARAM param_i2c_at_A2I_i_0 --> 0($fp) -# local_i2c_at_A2I_internal_18 = PARAM param_i2c_at_A2I_i_0 - 9 -lw $t1, 0($fp) -sub $t1, $t1, 9 -sw $t1, -76($fp) -# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_TRUE_79 -# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_TRUE_79 -lw $t1, -76($fp) -beq $t1, 0, label_TRUE_79 -# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) -# local_i2c_at_A2I_internal_18 = 0 -li $t1, 0 -sw $t1, -76($fp) -# GOTO label_END_80 -j label_END_80 -label_TRUE_79: -# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) -# local_i2c_at_A2I_internal_18 = 1 -li $t1, 1 -sw $t1, -76($fp) -label_END_80: -# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSE_77 -# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSE_77 -lw $t1, -76($fp) -beq $t1, 0, label_FALSE_77 -# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) -# -la $t1, data_21 -sw $t1, -80($fp) -# GOTO label_END_78 -j label_END_78 -label_FALSE_77: -# LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) -# local_i2c_at_A2I_internal_22 = SELF -sw $s1, -92($fp) -# LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) -# LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) -# local_i2c_at_A2I_internal_20 = local_i2c_at_A2I_internal_22 -lw $t1, -92($fp) -sw $t1, -84($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) -# LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) -# local_i2c_at_A2I_internal_21 = VCALL local_i2c_at_A2I_internal_20 abort -# Save new self pointer in $s1 -lw $s1, -84($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 16($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -88($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) -# -la $t1, data_22 -sw $t1, -96($fp) -label_END_78: -label_END_74: -label_END_70: -label_END_66: -label_END_62: -label_END_58: -label_END_54: -label_END_50: -label_END_46: -label_END_42: -# RETURN -# Deallocate stack frame for function function_i2c_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 104 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_a2i_at_A2I implementation. -# @Params: -# 0($fp) = param_a2i_at_A2I_s_0 -function_a2i_at_A2I: -# Allocate stack frame for function function_a2i_at_A2I. -subu $sp, $sp, 96 -sw $ra, 4($sp) -sw $fp, 0($sp) -addu $fp, $sp, 96 -# LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_1 = PARAM param_a2i_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -8($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) -# LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) -# local_a2i_at_A2I_internal_2 = VCALL local_a2i_at_A2I_internal_1 length -# Save new self pointer in $s1 -lw $s1, -8($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 0($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -12($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) -# LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) -# local_a2i_at_A2I_internal_0 = local_a2i_at_A2I_internal_2 - 0 -lw $t1, -12($fp) -sub $t1, $t1, 0 -sw $t1, -4($fp) -# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_TRUE_83 -# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_TRUE_83 -lw $t1, -4($fp) -beq $t1, 0, label_TRUE_83 -# LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) -# local_a2i_at_A2I_internal_0 = 0 -li $t1, 0 -sw $t1, -4($fp) -# GOTO label_END_84 -j label_END_84 -label_TRUE_83: -# LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) -# local_a2i_at_A2I_internal_0 = 1 -li $t1, 1 -sw $t1, -4($fp) -label_END_84: -# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSE_81 -# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSE_81 -lw $t1, -4($fp) -beq $t1, 0, label_FALSE_81 -# GOTO label_END_82 -j label_END_82 -label_FALSE_81: -# LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_4 = PARAM param_a2i_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -20($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG 0 -li $t1, 0 -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# ARG 1 -li $t1, 1 -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) -# LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) -# local_a2i_at_A2I_internal_5 = VCALL local_a2i_at_A2I_internal_4 substr -# Save new self pointer in $s1 -lw $s1, -20($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 0($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -24($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) -# -la $t1, data_23 -sw $t1, -28($fp) -# LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) -# LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) -# LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) -# local_a2i_at_A2I_internal_3 = local_a2i_at_A2I_internal_5 - local_a2i_at_A2I_internal_6 -lw $t1, -24($fp) -lw $t2, -28($fp) -sub $t1, $t1, $t2 -sw $t1, -16($fp) -# IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_87 -# IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_87 -lw $t1, -16($fp) -beq $t1, 0, label_TRUE_87 -# LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) -# local_a2i_at_A2I_internal_3 = 0 -li $t1, 0 -sw $t1, -16($fp) -# GOTO label_END_88 -j label_END_88 -label_TRUE_87: -# LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) -# local_a2i_at_A2I_internal_3 = 1 -li $t1, 1 -sw $t1, -16($fp) -label_END_88: -# IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_FALSE_85 -# IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_FALSE_85 -lw $t1, -16($fp) -beq $t1, 0, label_FALSE_85 -# GOTO label_END_86 -j label_END_86 -label_FALSE_85: -# LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_8 = PARAM param_a2i_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -36($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG 0 -li $t1, 0 -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# ARG 1 -li $t1, 1 -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) -# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) -# local_a2i_at_A2I_internal_9 = VCALL local_a2i_at_A2I_internal_8 substr -# Save new self pointer in $s1 -lw $s1, -36($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 0($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -40($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) -# -la $t1, data_24 -sw $t1, -44($fp) -# LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) -# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) -# LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) -# local_a2i_at_A2I_internal_7 = local_a2i_at_A2I_internal_9 - local_a2i_at_A2I_internal_10 -lw $t1, -40($fp) -lw $t2, -44($fp) -sub $t1, $t1, $t2 -sw $t1, -32($fp) -# IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_TRUE_91 -# IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_TRUE_91 -lw $t1, -32($fp) -beq $t1, 0, label_TRUE_91 -# LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) -# local_a2i_at_A2I_internal_7 = 0 -li $t1, 0 -sw $t1, -32($fp) -# GOTO label_END_92 -j label_END_92 -label_TRUE_91: -# LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) -# local_a2i_at_A2I_internal_7 = 1 -li $t1, 1 -sw $t1, -32($fp) -label_END_92: -# IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_FALSE_89 -# IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_FALSE_89 -lw $t1, -32($fp) -beq $t1, 0, label_FALSE_89 -# LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) -# local_a2i_at_A2I_internal_13 = SELF -sw $s1, -56($fp) -# LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) -# LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) -# local_a2i_at_A2I_internal_11 = local_a2i_at_A2I_internal_13 -lw $t1, -56($fp) -sw $t1, -48($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_14 = PARAM param_a2i_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -60($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG 1 -li $t1, 1 -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_17 = PARAM param_a2i_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -72($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) -# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) -# local_a2i_at_A2I_internal_18 = VCALL local_a2i_at_A2I_internal_17 length -# Save new self pointer in $s1 -lw $s1, -72($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 0($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -76($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) -# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) -# local_a2i_at_A2I_internal_16 = local_a2i_at_A2I_internal_18 - 1 -lw $t1, -76($fp) -sub $t1, $t1, 1 -sw $t1, -68($fp) -# ARG local_a2i_at_A2I_internal_16 -# LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) -lw $t1, -68($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) -# LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) -# local_a2i_at_A2I_internal_15 = VCALL local_a2i_at_A2I_internal_14 substr -# Save new self pointer in $s1 -lw $s1, -60($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 0($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -64($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_a2i_at_A2I_internal_15 -# LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) -lw $t1, -64($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) -# LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) -# local_a2i_at_A2I_internal_12 = VCALL local_a2i_at_A2I_internal_11 a2i_aux -# Save new self pointer in $s1 -lw $s1, -48($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 24($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -52($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# GOTO label_END_90 -j label_END_90 -label_FALSE_89: -# LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) -# local_a2i_at_A2I_internal_21 = SELF -sw $s1, -88($fp) -# LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) -# LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) -# local_a2i_at_A2I_internal_19 = local_a2i_at_A2I_internal_21 -lw $t1, -88($fp) -sw $t1, -80($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_a2i_at_A2I_s_0 -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) -# LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) -# local_a2i_at_A2I_internal_20 = VCALL local_a2i_at_A2I_internal_19 a2i_aux -# Save new self pointer in $s1 -lw $s1, -80($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 24($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -84($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -label_END_90: -label_END_86: -label_END_82: -# RETURN -# Deallocate stack frame for function function_a2i_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 96 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_a2i_aux_at_A2I implementation. -# @Params: -# 0($fp) = param_a2i_aux_at_A2I_s_0 -function_a2i_aux_at_A2I: -# Allocate stack frame for function function_a2i_aux_at_A2I. -subu $sp, $sp, 64 -sw $ra, 4($sp) -sw $fp, 0($sp) -addu $fp, $sp, 64 -# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) -# local_a2i_aux_at_A2I_int_0 = 0 -li $t1, 0 -sw $t1, -4($fp) -# LOCAL local_a2i_aux_at_A2I_internal_2 --> -12($fp) -# PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) -# local_a2i_aux_at_A2I_internal_2 = PARAM param_a2i_aux_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -12($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_2 --> -12($fp) -# LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) -# local_a2i_aux_at_A2I_internal_3 = VCALL local_a2i_aux_at_A2I_internal_2 length -# Save new self pointer in $s1 -lw $s1, -12($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 0($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -16($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_aux_at_A2I_j_1 --> -8($fp) -# LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) -# local_a2i_aux_at_A2I_j_1 = local_a2i_aux_at_A2I_internal_3 -lw $t1, -16($fp) -sw $t1, -8($fp) -# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) -# local_a2i_aux_at_A2I_i_4 = 0 -li $t1, 0 -sw $t1, -20($fp) -label_WHILE_93: -# LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) -# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) -# LOCAL local_a2i_aux_at_A2I_j_1 --> -8($fp) -# local_a2i_aux_at_A2I_internal_5 = local_a2i_aux_at_A2I_i_4 - local_a2i_aux_at_A2I_j_1 -lw $t1, -20($fp) -lw $t2, -8($fp) -sub $t1, $t1, $t2 -sw $t1, -24($fp) -# IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 -# IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 -lw $t1, -24($fp) -bgt $t1, 0, label_FALSE_95 -# IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 -# IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 -lw $t1, -24($fp) -beq $t1, 0, label_FALSE_95 -# LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) -# local_a2i_aux_at_A2I_internal_5 = 1 -li $t1, 1 -sw $t1, -24($fp) -# GOTO label_END_96 -j label_END_96 -label_FALSE_95: -# LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) -# local_a2i_aux_at_A2I_internal_5 = 0 -li $t1, 0 -sw $t1, -24($fp) -label_END_96: -# IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_WHILE_END_94 -# IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_WHILE_END_94 -lw $t1, -24($fp) -beq $t1, 0, label_WHILE_END_94 -# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) -# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) -# local_a2i_aux_at_A2I_internal_7 = local_a2i_aux_at_A2I_int_0 * 10 -lw $t1, -4($fp) -mul $t1, $t1, 10 -sw $t1, -32($fp) -# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) -# local_a2i_aux_at_A2I_internal_10 = SELF -sw $s1, -44($fp) -# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) -# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) -# local_a2i_aux_at_A2I_internal_8 = local_a2i_aux_at_A2I_internal_10 -lw $t1, -44($fp) -sw $t1, -36($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) -# PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) -# local_a2i_aux_at_A2I_internal_11 = PARAM param_a2i_aux_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -48($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_a2i_aux_at_A2I_i_4 -# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) -lw $t1, -20($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# ARG 1 -li $t1, 1 -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) -# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) -# local_a2i_aux_at_A2I_internal_12 = VCALL local_a2i_aux_at_A2I_internal_11 substr -# Save new self pointer in $s1 -lw $s1, -48($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 0($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -52($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_a2i_aux_at_A2I_internal_12 -# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) -lw $t1, -52($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) -# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) -# local_a2i_aux_at_A2I_internal_9 = VCALL local_a2i_aux_at_A2I_internal_8 c2i -# Save new self pointer in $s1 -lw $s1, -36($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 12($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -40($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) -# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) -# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) -# local_a2i_aux_at_A2I_internal_6 = local_a2i_aux_at_A2I_internal_7 + local_a2i_aux_at_A2I_internal_9 -lw $t1, -32($fp) -lw $t2, -40($fp) -add $t1, $t1, $t2 -sw $t1, -28($fp) -# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) -# LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) -# local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_6 -lw $t1, -28($fp) -sw $t1, -4($fp) -# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) -# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) -# local_a2i_aux_at_A2I_internal_13 = local_a2i_aux_at_A2I_i_4 + 1 -lw $t1, -20($fp) -add $t1, $t1, 1 -sw $t1, -56($fp) -# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) -# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) -# local_a2i_aux_at_A2I_i_4 = local_a2i_aux_at_A2I_internal_13 -lw $t1, -56($fp) -sw $t1, -20($fp) -# GOTO label_WHILE_93 -j label_WHILE_93 -label_WHILE_END_94: -# RETURN local_a2i_aux_at_A2I_int_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_a2i_aux_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 64 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_i2a_at_A2I implementation. -# @Params: -# 0($fp) = param_i2a_at_A2I_i_0 -function_i2a_at_A2I: -# Allocate stack frame for function function_i2a_at_A2I. -subu $sp, $sp, 60 -sw $ra, 4($sp) -sw $fp, 0($sp) -addu $fp, $sp, 60 -# LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) -# PARAM param_i2a_at_A2I_i_0 --> 0($fp) -# local_i2a_at_A2I_internal_0 = PARAM param_i2a_at_A2I_i_0 - 0 -lw $t1, 0($fp) -sub $t1, $t1, 0 -sw $t1, -4($fp) -# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_TRUE_99 -# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_TRUE_99 -lw $t1, -4($fp) -beq $t1, 0, label_TRUE_99 -# LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) -# local_i2a_at_A2I_internal_0 = 0 -li $t1, 0 -sw $t1, -4($fp) -# GOTO label_END_100 -j label_END_100 -label_TRUE_99: -# LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) -# local_i2a_at_A2I_internal_0 = 1 -li $t1, 1 -sw $t1, -4($fp) -label_END_100: -# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSE_97 -# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSE_97 -lw $t1, -4($fp) -beq $t1, 0, label_FALSE_97 -# LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) -# -la $t1, data_25 -sw $t1, -8($fp) -# GOTO label_END_98 -j label_END_98 -label_FALSE_97: -# LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) -# PARAM param_i2a_at_A2I_i_0 --> 0($fp) -# local_i2a_at_A2I_internal_2 = 0 - PARAM param_i2a_at_A2I_i_0 -li $t1, 0 -lw $t2, 0($fp) -sub $t1, $t1, $t2 -sw $t1, -12($fp) -# IF_GREATER_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 -# IF_GREATER_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 -lw $t1, -12($fp) -bgt $t1, 0, label_FALSE_103 -# IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 -# IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 -lw $t1, -12($fp) -beq $t1, 0, label_FALSE_103 -# LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) -# local_i2a_at_A2I_internal_2 = 1 -li $t1, 1 -sw $t1, -12($fp) -# GOTO label_END_104 -j label_END_104 -label_FALSE_103: -# LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) -# local_i2a_at_A2I_internal_2 = 0 -li $t1, 0 -sw $t1, -12($fp) -label_END_104: -# IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_101 -# IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_101 -lw $t1, -12($fp) -beq $t1, 0, label_FALSE_101 -# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) -# local_i2a_at_A2I_internal_5 = SELF -sw $s1, -24($fp) -# LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) -# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) -# local_i2a_at_A2I_internal_3 = local_i2a_at_A2I_internal_5 -lw $t1, -24($fp) -sw $t1, -16($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_i2a_at_A2I_i_0 -# PARAM param_i2a_at_A2I_i_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) -# LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) -# local_i2a_at_A2I_internal_4 = VCALL local_i2a_at_A2I_internal_3 i2a_aux -# Save new self pointer in $s1 -lw $s1, -16($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 32($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -20($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# GOTO label_END_102 -j label_END_102 -label_FALSE_101: -# LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) -# -la $t1, data_26 -sw $t1, -36($fp) -# LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) -# LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) -# local_i2a_at_A2I_internal_6 = local_i2a_at_A2I_internal_8 -lw $t1, -36($fp) -sw $t1, -28($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) -# local_i2a_at_A2I_internal_11 = SELF -sw $s1, -48($fp) -# LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) -# LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) -# local_i2a_at_A2I_internal_9 = local_i2a_at_A2I_internal_11 -lw $t1, -48($fp) -sw $t1, -40($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) -# PARAM param_i2a_at_A2I_i_0 --> 0($fp) -# local_i2a_at_A2I_internal_12 = PARAM param_i2a_at_A2I_i_0 * 1 -lw $t1, 0($fp) -mul $t1, $t1, 1 -sw $t1, -52($fp) -# ARG local_i2a_at_A2I_internal_12 -# LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) -lw $t1, -52($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) -# LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) -# local_i2a_at_A2I_internal_10 = VCALL local_i2a_at_A2I_internal_9 i2a_aux -# Save new self pointer in $s1 -lw $s1, -40($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 32($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -44($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_i2a_at_A2I_internal_10 -# LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) -lw $t1, -44($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) -# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) -# local_i2a_at_A2I_internal_7 = VCALL local_i2a_at_A2I_internal_6 concat -# Save new self pointer in $s1 -lw $s1, -28($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 0($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -32($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -label_END_102: -label_END_98: -# RETURN -# Deallocate stack frame for function function_i2a_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 60 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_i2a_aux_at_A2I implementation. -# @Params: -# 0($fp) = param_i2a_aux_at_A2I_i_0 -function_i2a_aux_at_A2I: -# Allocate stack frame for function function_i2a_aux_at_A2I. -subu $sp, $sp, 64 -sw $ra, 4($sp) -sw $fp, 0($sp) -addu $fp, $sp, 64 -# LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) -# PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) -# local_i2a_aux_at_A2I_internal_0 = PARAM param_i2a_aux_at_A2I_i_0 - 0 -lw $t1, 0($fp) -sub $t1, $t1, 0 -sw $t1, -4($fp) -# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_TRUE_107 -# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_TRUE_107 -lw $t1, -4($fp) -beq $t1, 0, label_TRUE_107 -# LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) -# local_i2a_aux_at_A2I_internal_0 = 0 -li $t1, 0 -sw $t1, -4($fp) -# GOTO label_END_108 -j label_END_108 -label_TRUE_107: -# LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) -# local_i2a_aux_at_A2I_internal_0 = 1 -li $t1, 1 -sw $t1, -4($fp) -label_END_108: -# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSE_105 -# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSE_105 -lw $t1, -4($fp) -beq $t1, 0, label_FALSE_105 -# LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) -# -la $t1, data_27 -sw $t1, -8($fp) -# GOTO label_END_106 -j label_END_106 -label_FALSE_105: -# LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) -# PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) -# local_i2a_aux_at_A2I_internal_3 = PARAM param_i2a_aux_at_A2I_i_0 / 10 -lw $t1, 0($fp) -div $t1, $t1, 10 -sw $t1, -16($fp) -# LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) -# LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) -# local_i2a_aux_at_A2I_next_2 = local_i2a_aux_at_A2I_internal_3 -lw $t1, -16($fp) -sw $t1, -12($fp) -# LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) -# local_i2a_aux_at_A2I_internal_8 = SELF -sw $s1, -36($fp) -# LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) -# LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) -# local_i2a_aux_at_A2I_internal_6 = local_i2a_aux_at_A2I_internal_8 -lw $t1, -36($fp) -sw $t1, -28($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_i2a_aux_at_A2I_next_2 -# LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) -lw $t1, -12($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) -# LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) -# local_i2a_aux_at_A2I_internal_7 = VCALL local_i2a_aux_at_A2I_internal_6 i2a_aux -# Save new self pointer in $s1 -lw $s1, -28($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 32($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -32($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) -# LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) -# local_i2a_aux_at_A2I_internal_4 = local_i2a_aux_at_A2I_internal_7 -lw $t1, -32($fp) -sw $t1, -20($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) -# local_i2a_aux_at_A2I_internal_11 = SELF -sw $s1, -48($fp) -# LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) -# LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) -# local_i2a_aux_at_A2I_internal_9 = local_i2a_aux_at_A2I_internal_11 -lw $t1, -48($fp) -sw $t1, -40($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) -# LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) -# local_i2a_aux_at_A2I_internal_13 = local_i2a_aux_at_A2I_next_2 * 10 -lw $t1, -12($fp) -mul $t1, $t1, 10 -sw $t1, -56($fp) -# LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) -# PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) -# LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) -# local_i2a_aux_at_A2I_internal_12 = PARAM param_i2a_aux_at_A2I_i_0 - local_i2a_aux_at_A2I_internal_13 -lw $t1, 0($fp) -lw $t2, -56($fp) -sub $t1, $t1, $t2 -sw $t1, -52($fp) -# ARG local_i2a_aux_at_A2I_internal_12 -# LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) -lw $t1, -52($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) -# LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) -# local_i2a_aux_at_A2I_internal_10 = VCALL local_i2a_aux_at_A2I_internal_9 i2c -# Save new self pointer in $s1 -lw $s1, -40($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 16($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -44($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_i2a_aux_at_A2I_internal_10 -# LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) -lw $t1, -44($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) -# LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) -# local_i2a_aux_at_A2I_internal_5 = VCALL local_i2a_aux_at_A2I_internal_4 concat -# Save new self pointer in $s1 -lw $s1, -20($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 0($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -24($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -label_END_106: -# RETURN -# Deallocate stack frame for function function_i2a_aux_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 64 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: -# Allocate stack frame for function function_main_at_Main. -subu $sp, $sp, 100 -sw $ra, 4($sp) -sw $fp, 0($sp) -addu $fp, $sp, 100 -# LOCAL local_main_at_Main_internal_3 --> -16($fp) -# local_main_at_Main_internal_3 = ALLOCATE A2I -# Allocating 8 bytes of memory -li $a0, 8 -li $v0, 9 -syscall -la $t1, A2I -sw $t1, 0($v0) -la $t1, A2I_start -sw $t1, 4($v0) -move $t2, $v0 -sw $t2, -16($fp) -# LOCAL local_main_at_Main_internal_1 --> -8($fp) -# LOCAL local_main_at_Main_internal_3 --> -16($fp) -# local_main_at_Main_internal_1 = local_main_at_Main_internal_3 -lw $t1, -16($fp) -sw $t1, -8($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_4 --> -20($fp) -# -la $t1, data_28 -sw $t1, -20($fp) -# ARG local_main_at_Main_internal_4 -# LOCAL local_main_at_Main_internal_4 --> -20($fp) -lw $t1, -20($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_main_at_Main_internal_1 --> -8($fp) -# LOCAL local_main_at_Main_internal_2 --> -12($fp) -# local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 a2i -# Save new self pointer in $s1 -lw $s1, -8($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 20($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -12($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_a_0 --> -4($fp) -# LOCAL local_main_at_Main_internal_2 --> -12($fp) -# local_main_at_Main_a_0 = local_main_at_Main_internal_2 -lw $t1, -12($fp) -sw $t1, -4($fp) -# LOCAL local_main_at_Main_internal_8 --> -36($fp) -# local_main_at_Main_internal_8 = ALLOCATE A2I -# Allocating 8 bytes of memory -li $a0, 8 -li $v0, 9 -syscall -la $t1, A2I -sw $t1, 0($v0) -la $t1, A2I_start -sw $t1, 4($v0) -move $t2, $v0 -sw $t2, -36($fp) -# LOCAL local_main_at_Main_internal_6 --> -28($fp) -# LOCAL local_main_at_Main_internal_8 --> -36($fp) -# local_main_at_Main_internal_6 = local_main_at_Main_internal_8 -lw $t1, -36($fp) -sw $t1, -28($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG 678987 -li $t1, 678987 -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_main_at_Main_internal_6 --> -28($fp) -# LOCAL local_main_at_Main_internal_7 --> -32($fp) -# local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 i2a -# Save new self pointer in $s1 -lw $s1, -28($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 28($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -32($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_b_5 --> -24($fp) -# LOCAL local_main_at_Main_internal_7 --> -32($fp) -# local_main_at_Main_b_5 = local_main_at_Main_internal_7 -lw $t1, -32($fp) -sw $t1, -24($fp) -# LOCAL local_main_at_Main_internal_11 --> -48($fp) -# local_main_at_Main_internal_11 = SELF -sw $s1, -48($fp) -# LOCAL local_main_at_Main_internal_9 --> -40($fp) -# LOCAL local_main_at_Main_internal_11 --> -48($fp) -# local_main_at_Main_internal_9 = local_main_at_Main_internal_11 -lw $t1, -48($fp) -sw $t1, -40($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_main_at_Main_a_0 -# LOCAL local_main_at_Main_a_0 --> -4($fp) -lw $t1, -4($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_main_at_Main_internal_9 --> -40($fp) -# LOCAL local_main_at_Main_internal_10 --> -44($fp) -# local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_int -# Save new self pointer in $s1 -lw $s1, -40($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 4($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -44($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_14 --> -60($fp) -# local_main_at_Main_internal_14 = SELF -sw $s1, -60($fp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# LOCAL local_main_at_Main_internal_14 --> -60($fp) -# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 -lw $t1, -60($fp) -sw $t1, -52($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_15 --> -64($fp) -# -la $t1, data_29 -sw $t1, -64($fp) -# ARG local_main_at_Main_internal_15 -# LOCAL local_main_at_Main_internal_15 --> -64($fp) -lw $t1, -64($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string -# Save new self pointer in $s1 -lw $s1, -52($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 0($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -56($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# local_main_at_Main_internal_18 = SELF -sw $s1, -76($fp) -# LOCAL local_main_at_Main_internal_16 --> -68($fp) -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# local_main_at_Main_internal_16 = local_main_at_Main_internal_18 -lw $t1, -76($fp) -sw $t1, -68($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_main_at_Main_b_5 -# LOCAL local_main_at_Main_b_5 --> -24($fp) -lw $t1, -24($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_main_at_Main_internal_16 --> -68($fp) -# LOCAL local_main_at_Main_internal_17 --> -72($fp) -# local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string -# Save new self pointer in $s1 -lw $s1, -68($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 0($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -72($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_21 --> -88($fp) -# local_main_at_Main_internal_21 = SELF -sw $s1, -88($fp) -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# LOCAL local_main_at_Main_internal_21 --> -88($fp) -# local_main_at_Main_internal_19 = local_main_at_Main_internal_21 -lw $t1, -88($fp) -sw $t1, -80($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_22 --> -92($fp) -# -la $t1, data_30 -sw $t1, -92($fp) -# ARG local_main_at_Main_internal_22 -# LOCAL local_main_at_Main_internal_22 --> -92($fp) -lw $t1, -92($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# LOCAL local_main_at_Main_internal_20 --> -84($fp) -# local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 out_string -# Save new self pointer in $s1 -lw $s1, -80($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 0($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -84($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# RETURN local_main_at_Main_internal_20 -lw $v0, -84($fp) -# Deallocate stack frame for function function_main_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 100 -jr $ra -# Function END + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_2 + sw $t1, 8($v0) + li $t1, 17 + sw $t1, 12($v0) + sw $v0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t2, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 0($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END diff --git a/src/testing.py b/src/testing.py index 0433b837..0341d40c 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,126 +60,11 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""(* - The class A2I provides integer-to-string and string-to-integer -conversion routines. To use these routines, either inherit them -in the class where needed, have a dummy variable bound to -something of type A2I, or simpl write (new A2I).method(argument). -*) - - -(* - c2i Converts a 1-character string to an integer. Aborts - if the string is not "0" through "9" -*) -class A2I { - - c2i(char : String) : Int { - if char = "0" then 0 else - if char = "1" then 1 else - if char = "2" then 2 else - if char = "3" then 3 else - if char = "4" then 4 else - if char = "5" then 5 else - if char = "6" then 6 else - if char = "7" then 7 else - if char = "8" then 8 else - if char = "9" then 9 else - { abort(); 0; } -- the 0 is needed to satisfy the typchecker - fi fi fi fi fi fi fi fi fi fi - }; - -(* - i2c is the inverse of c2i. -*) - i2c(i : Int) : String { - if i = 0 then "0" else - if i = 1 then "1" else - if i = 2 then "2" else - if i = 3 then "3" else - if i = 4 then "4" else - if i = 5 then "5" else - if i = 6 then "6" else - if i = 7 then "7" else - if i = 8 then "8" else - if i = 9 then "9" else - { abort(); ""; } -- the "" is needed to satisfy the typchecker - fi fi fi fi fi fi fi fi fi fi - }; - -(* - a2i converts an ASCII string into an integer. The empty string -is converted to 0. Signed and unsigned strings are handled. The -method aborts if the string does not represent an integer. Very -long strings of digits produce strange answers because of arithmetic -overflow. - -*) - a2i(s : String) : Int { - if s.length() = 0 then 0 else - if s.substr(0,1) = "-" then ~a2i_aux(s.substr(1,s.length()-1)) else - if s.substr(0,1) = "+" then a2i_aux(s.substr(1,s.length()-1)) else - a2i_aux(s) - fi fi fi - }; - -(* - a2i_aux converts the usigned portion of the string. As a programming -example, this method is written iteratively. -*) - a2i_aux(s : String) : Int { - (let int : Int <- 0 in - { - (let j : Int <- s.length() in - (let i : Int <- 0 in - while i < j loop - { - int <- int * 10 + c2i(s.substr(i,1)); - i <- i + 1; - } - pool - ) - ); - int; - } - ) - }; - -(* - i2a converts an integer to a string. Positive and negative -numbers are handled correctly. -*) - i2a(i : Int) : String { - if i = 0 then "0" else - if 0 < i then i2a_aux(i) else - "-".concat(i2a_aux(i * ~1)) - fi fi - }; - -(* - i2a_aux is an example using recursion. -*) - i2a_aux(i : Int) : String { - if i = 0 then "" else - (let next : Int <- i / 10 in - i2a_aux(next).concat(i2c(i - next * 10)) - ) - fi - }; - +text = r"""class Main inherits IO { + main(): IO { + out_string("Hello, World.\n") + }; }; -class Main inherits IO { - main () : Object { - let a : Int <- (new A2I).a2i("678987"), - b : String <- (new A2I).i2a(678987) in - { - out_int(a) ; - out_string(" == ") ; - out_string(b) ; - out_string("\n"); - } - } ; -} ; """ pipeline(text, 5) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index d2c806f9..71ba9031 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -108,7 +108,7 @@ def _(self, node: cil.TypeNode): # noqa: F811 for attrib in node.attributes: if attrib.type.name == "String": self.register_instruction( - FixedData(f"{node.name}_attrib_{attrib.name}", r"", "asciiz") + FixedData(f"{node.name}_attrib_{attrib.name}", r'""', "asciiz") ) else: self.register_instruction( @@ -332,6 +332,37 @@ def _(self, node: cil.SetAttributeNode): self.used_registers[reg] = False + @visit.register + def _(self, node: cil.AllocateStringNode): + dest = self.visit(node.dest) + assert dest is not None + + size = 16 + + # Reservar memoria para el tipo + self.allocate_memory(size) + reg = self.get_available_register() + + assert reg is not None + + self.comment("Allocating string") + + # Inicializar la instancia + self.register_instruction(LA(reg, "String")) + self.register_instruction(SW(reg, "0($v0)")) + + self.register_instruction(LA(reg, "String_start")) + self.register_instruction(SW(reg, "4($v0)")) + + self.register_instruction(LA(reg, node.value.name)) + self.register_instruction(SW(reg, "8($v0)")) + + self.register_instruction(LI(reg, node.length)) + self.register_instruction(SW(reg, "12($v0)")) + + # devolver la instancia + self.register_instruction(SW(v0, dest)) + @visit.register def _(self, node: cil.AllocateNode): # Cada instancia debe almacenar lo siguiente: @@ -672,8 +703,10 @@ def _(self, node: cil.PrintNode): self.add_source_line_comment(node) + self.register_instruction(LW(v0, src)) + # Cargar la direccion del string en a0 - self.register_instruction(LW(a0, src)) + self.register_instruction(LW(a0, "8($v0)")) # syscall 4 = print_string self.register_instruction(LI(v0, 4)) self.register_instruction(SYSCALL()) diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 9cf68fb3..4ca8e002 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -9,7 +9,7 @@ import cil.nodes from cil.nodes import ( - AllocateNode, + AllocateNode, AllocateStringNode, ArgNode, AssignNode, CilNode, @@ -562,7 +562,7 @@ def _(self, node: coolAst.StringConstant, scope: Scope) -> LocalNode: s1 = self.register_data(node.lex) # Cargar el string en la variable interna - self.register_instruction(LoadNode(str_const_vm_holder, s1)) + self.register_instruction(AllocateStringNode(str_const_vm_holder, s1, len(node.lex))) # Devolver la variable que contiene el string return str_const_vm_holder diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips new file mode 100644 index 00000000..cea747de --- /dev/null +++ b/tests/codegen/fib.mips @@ -0,0 +1,733 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 16:02:15 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# + + +# **** Type RECORD for type IO **** +IO_start: +IO_vtable_pointer: .word IO_vtable +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# + + +# **** Type RECORD for type Object **** +Object_start: +Object_vtable_pointer: .word Object_vtable +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +# + + +# **** Type RECORD for type String **** +String_start: +String_vtable_pointer: .word String_vtable +String_attrib_length: .word 0 +String_attrib_value: .asciiz "" +String_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main, function_fib_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: +Main_vtable_pointer: .word Main_vtable +Main_end: +# + + +data_0: .asciiz "" +# + + +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_Main_tdt_entry__: .word 1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +data_2: .asciiz "Enter n to find nth fibonacci number!\n" +# + + +data_3: .asciiz "\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 8($v0) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t1, 8($s1) + sw $t1, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, Main + sw $t1, 0($v0) + la $t1, Main_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 76 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 76 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_2 + sw $t1, 8($v0) + li $t1, 41 + sw $t1, 12($v0) + sw $v0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t2, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 0($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_6 + lw $t2, -28($fp) + sw $t2, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = SELF + sw $s1, -40($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 + lw $t2, -40($fp) + sw $t2, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 + lw $t2, -52($fp) + sw $t2, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 in_int + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 12($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_11 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + lw $t2, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 fib + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 32($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_8 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + lw $t2, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 out_int + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 4($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 + lw $t2, -64($fp) + sw $t2, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + la $t2, data_3 + sw $t2, 8($v0) + li $t2, 4 + sw $t2, 12($v0) + sw $v0, -68($fp) + # ARG local_main_at_Main_internal_16 + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + lw $t3, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 out_string + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 0($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_14 + lw $v0, -60($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 76 + jr $ra + # Function END + + +# function_fib_at_Main implementation. +# @Params: +# 0($fp) = param_fib_at_Main_i_0 +function_fib_at_Main: + # Allocate stack frame for function function_fib_at_Main. + subu $sp, $sp, 36 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 36 + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # local_fib_at_Main_a_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + # LOCAL local_fib_at_Main_b_1 --> -8($fp) + # local_fib_at_Main_b_1 = 0 + li $t3, 0 + sw $t3, -8($fp) + # LOCAL local_fib_at_Main_c_2 --> -12($fp) + # local_fib_at_Main_c_2 = 0 + li $t3, 0 + sw $t3, -12($fp) + label_WHILE_1: + # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # local_fib_at_Main_internal_3 = PARAM param_fib_at_Main_i_0 - 0 + lw $t3, 0($fp) + sub $t3, $t3, 0 + sw $t3, -16($fp) + # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 + # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 + lw $t3, -16($fp) + beq $t3, 0, label_TRUE_3 + # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # local_fib_at_Main_internal_3 = 0 + li $t3, 0 + sw $t3, -16($fp) + # GOTO label_END_4 + j label_END_4 +label_TRUE_3: + # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # local_fib_at_Main_internal_3 = 1 + li $t3, 1 + sw $t3, -16($fp) + label_END_4: + # IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 + # IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 + lw $t3, -16($fp) + beq $t3, 0, label_FALSE_5 + # LOCAL local_fib_at_Main_internal_4 --> -20($fp) + # local_fib_at_Main_internal_4 = 0 + li $t3, 0 + sw $t3, -20($fp) + # GOTO label_NOT_END_6 + j label_NOT_END_6 + label_FALSE_5: + # LOCAL local_fib_at_Main_internal_4 --> -20($fp) + # local_fib_at_Main_internal_4 = 1 + li $t3, 1 + sw $t3, -20($fp) + label_NOT_END_6: + # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 + # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 + lw $t3, -20($fp) + beq $t3, 0, label_WHILE_END_2 + # LOCAL local_fib_at_Main_internal_5 --> -24($fp) + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # LOCAL local_fib_at_Main_b_1 --> -8($fp) + # local_fib_at_Main_internal_5 = local_fib_at_Main_a_0 + local_fib_at_Main_b_1 + lw $t3, -4($fp) + lw $t4, -8($fp) + add $t3, $t3, $t4 + sw $t3, -24($fp) + # LOCAL local_fib_at_Main_c_2 --> -12($fp) + # LOCAL local_fib_at_Main_internal_5 --> -24($fp) + # local_fib_at_Main_c_2 = local_fib_at_Main_internal_5 + lw $t3, -24($fp) + sw $t3, -12($fp) + # LOCAL local_fib_at_Main_internal_6 --> -28($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # local_fib_at_Main_internal_6 = PARAM param_fib_at_Main_i_0 - 1 + lw $t3, 0($fp) + sub $t3, $t3, 1 + sw $t3, -28($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # LOCAL local_fib_at_Main_internal_6 --> -28($fp) + # PARAM param_fib_at_Main_i_0 = local_fib_at_Main_internal_6 + lw $t3, -28($fp) + sw $t3, 0($fp) + # LOCAL local_fib_at_Main_b_1 --> -8($fp) + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # local_fib_at_Main_b_1 = local_fib_at_Main_a_0 + lw $t3, -4($fp) + sw $t3, -8($fp) + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # LOCAL local_fib_at_Main_c_2 --> -12($fp) + # local_fib_at_Main_a_0 = local_fib_at_Main_c_2 + lw $t3, -12($fp) + sw $t3, -4($fp) + # GOTO label_WHILE_1 + j label_WHILE_1 + label_WHILE_END_2: + # RETURN local_fib_at_Main_c_2 + lw $v0, -12($fp) + # Deallocate stack frame for function function_fib_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 36 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips new file mode 100644 index 00000000..a508da1f --- /dev/null +++ b/tests/codegen/hello_world.mips @@ -0,0 +1,468 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 16:02:14 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# + + +# **** Type RECORD for type IO **** +IO_start: +IO_vtable_pointer: .word IO_vtable +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# + + +# **** Type RECORD for type Object **** +Object_start: +Object_vtable_pointer: .word Object_vtable +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +# + + +# **** Type RECORD for type String **** +String_start: +String_vtable_pointer: .word String_vtable +String_attrib_length: .word 0 +String_attrib_value: .asciiz "" +String_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: +Main_vtable_pointer: .word Main_vtable +Main_end: +# + + +data_0: .asciiz "" +# + + +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_Main_tdt_entry__: .word 1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +data_2: .asciiz "Hello, World.\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 8($v0) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t1, 8($s1) + sw $t1, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, Main + sw $t1, 0($v0) + la $t1, Main_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_2 + sw $t1, 8($v0) + li $t1, 17 + sw $t1, 12($v0) + sw $v0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t2, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 0($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips new file mode 100644 index 00000000..272b7e8a --- /dev/null +++ b/tests/codegen/io.mips @@ -0,0 +1,1085 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 16:02:15 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +A: .asciiz "A" +# Function END +B: .asciiz "B" +# Function END +C: .asciiz "C" +# Function END +D: .asciiz "D" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# + + +# **** Type RECORD for type IO **** +IO_start: +IO_vtable_pointer: .word IO_vtable +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# + + +# **** Type RECORD for type Object **** +Object_start: +Object_vtable_pointer: .word Object_vtable +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +# + + +# **** Type RECORD for type String **** +String_start: +String_vtable_pointer: .word String_vtable +String_attrib_length: .word 0 +String_attrib_value: .asciiz "" +String_end: +# + + +# **** VTABLE for type A **** +A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A +# + + +# **** Type RECORD for type A **** +A_start: +A_vtable_pointer: .word A_vtable +A_attrib_io: .word 0 +A_end: +# + + +# **** VTABLE for type B **** +B_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A, function_out_b_at_B +# + + +# **** Type RECORD for type B **** +B_start: +B_vtable_pointer: .word B_vtable +B_attrib_io: .word 0 +B_end: +# + + +# **** VTABLE for type C **** +C_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_c_at_C +# + + +# **** Type RECORD for type C **** +C_start: +C_vtable_pointer: .word C_vtable +C_end: +# + + +# **** VTABLE for type D **** +D_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_c_at_C, function_out_d_at_D +# + + +# **** Type RECORD for type D **** +D_start: +D_vtable_pointer: .word D_vtable +D_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main +# + + +# **** Type RECORD for type Main **** +Main_start: +Main_vtable_pointer: .word Main_vtable +Main_end: +# + + +data_0: .asciiz "" +# + + +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_A_tdt_entry__: .word 1 +__Object_B_tdt_entry__: .word 2 +__Object_C_tdt_entry__: .word 2 +__Object_D_tdt_entry__: .word 3 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_A_tdt_entry__: .word -1 +__Int_B_tdt_entry__: .word -1 +__Int_C_tdt_entry__: .word -1 +__Int_D_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_A_tdt_entry__: .word -1 +__String_B_tdt_entry__: .word -1 +__String_C_tdt_entry__: .word -1 +__String_D_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_A_tdt_entry__: .word -1 +__Bool_B_tdt_entry__: .word -1 +__Bool_C_tdt_entry__: .word -1 +__Bool_D_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_A_tdt_entry__: .word -1 +__IO_B_tdt_entry__: .word -1 +__IO_C_tdt_entry__: .word 1 +__IO_D_tdt_entry__: .word 2 +__IO_Main_tdt_entry__: .word 1 +__A_Object_tdt_entry__: .word -1 +__A_Int_tdt_entry__: .word -1 +__A_String_tdt_entry__: .word -1 +__A_Bool_tdt_entry__: .word -1 +__A_IO_tdt_entry__: .word -1 +__A_A_tdt_entry__: .word 0 +__A_B_tdt_entry__: .word 1 +__A_C_tdt_entry__: .word -1 +__A_D_tdt_entry__: .word -1 +__A_Main_tdt_entry__: .word -1 +__B_Object_tdt_entry__: .word -1 +__B_Int_tdt_entry__: .word -1 +__B_String_tdt_entry__: .word -1 +__B_Bool_tdt_entry__: .word -1 +__B_IO_tdt_entry__: .word -1 +__B_A_tdt_entry__: .word -1 +__B_B_tdt_entry__: .word 0 +__B_C_tdt_entry__: .word -1 +__B_D_tdt_entry__: .word -1 +__B_Main_tdt_entry__: .word -1 +__C_Object_tdt_entry__: .word -1 +__C_Int_tdt_entry__: .word -1 +__C_String_tdt_entry__: .word -1 +__C_Bool_tdt_entry__: .word -1 +__C_IO_tdt_entry__: .word -1 +__C_A_tdt_entry__: .word -1 +__C_B_tdt_entry__: .word -1 +__C_C_tdt_entry__: .word 0 +__C_D_tdt_entry__: .word 1 +__C_Main_tdt_entry__: .word -1 +__D_Object_tdt_entry__: .word -1 +__D_Int_tdt_entry__: .word -1 +__D_String_tdt_entry__: .word -1 +__D_Bool_tdt_entry__: .word -1 +__D_IO_tdt_entry__: .word -1 +__D_A_tdt_entry__: .word -1 +__D_B_tdt_entry__: .word -1 +__D_C_tdt_entry__: .word -1 +__D_D_tdt_entry__: .word 0 +__D_Main_tdt_entry__: .word -1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_A_tdt_entry__: .word -1 +__Main_B_tdt_entry__: .word -1 +__Main_C_tdt_entry__: .word -1 +__Main_D_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +data_2: .asciiz "A: Hello world\n" +# + + +data_3: .asciiz "B: Hello world\n" +# + + +data_4: .asciiz "C: Hello world\n" +# + + +data_5: .asciiz "D: Hello world\n" +# + + +data_6: .asciiz "Done.\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 8($v0) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t1, 8($s1) + sw $t1, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, Main + sw $t1, 0($v0) + la $t1, Main_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __A__attrib__io__init implementation. +# @Params: +__A__attrib__io__init: + # Allocate stack frame for function __A__attrib__io__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ib__io__init_internal_0 --> -4($fp) + # local_ib__io__init_internal_0 = ALLOCATE IO + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, IO + sw $t1, 0($v0) + la $t1, IO_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -4($fp) + # RETURN local_ib__io__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __A__attrib__io__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_a_at_A implementation. +# @Params: +function_out_a_at_A: + # Allocate stack frame for function function_out_a_at_A. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_out_a_at_A_internal_2 = GETATTRIBUTE io A + # LOCAL local_out_a_at_A_internal_2 --> -12($fp) + lw $t1, 8($s1) + sw $t1, -12($fp) + # LOCAL local_out_a_at_A_internal_0 --> -4($fp) + # LOCAL local_out_a_at_A_internal_2 --> -12($fp) + # local_out_a_at_A_internal_0 = local_out_a_at_A_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_out_a_at_A_internal_3 --> -16($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_2 + sw $t1, 8($v0) + li $t1, 18 + sw $t1, 12($v0) + sw $v0, -16($fp) + # ARG local_out_a_at_A_internal_3 + # LOCAL local_out_a_at_A_internal_3 --> -16($fp) + lw $t2, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_out_a_at_A_internal_0 --> -4($fp) + # LOCAL local_out_a_at_A_internal_1 --> -8($fp) + # local_out_a_at_A_internal_1 = VCALL local_out_a_at_A_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 0($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_out_a_at_A_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_a_at_A. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_b_at_B implementation. +# @Params: +function_out_b_at_B: + # Allocate stack frame for function function_out_b_at_B. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_out_b_at_B_internal_2 = GETATTRIBUTE io B + # LOCAL local_out_b_at_B_internal_2 --> -12($fp) + lw $t2, 8($s1) + sw $t2, -12($fp) + # LOCAL local_out_b_at_B_internal_0 --> -4($fp) + # LOCAL local_out_b_at_B_internal_2 --> -12($fp) + # local_out_b_at_B_internal_0 = local_out_b_at_B_internal_2 + lw $t2, -12($fp) + sw $t2, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_out_b_at_B_internal_3 --> -16($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + la $t2, data_3 + sw $t2, 8($v0) + li $t2, 18 + sw $t2, 12($v0) + sw $v0, -16($fp) + # ARG local_out_b_at_B_internal_3 + # LOCAL local_out_b_at_B_internal_3 --> -16($fp) + lw $t3, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_out_b_at_B_internal_0 --> -4($fp) + # LOCAL local_out_b_at_B_internal_1 --> -8($fp) + # local_out_b_at_B_internal_1 = VCALL local_out_b_at_B_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 0($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_out_b_at_B_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_b_at_B. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_c_at_C implementation. +# @Params: +function_out_c_at_C: + # Allocate stack frame for function function_out_c_at_C. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_out_c_at_C_internal_2 --> -12($fp) + # local_out_c_at_C_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_out_c_at_C_internal_0 --> -4($fp) + # LOCAL local_out_c_at_C_internal_2 --> -12($fp) + # local_out_c_at_C_internal_0 = local_out_c_at_C_internal_2 + lw $t3, -12($fp) + sw $t3, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_out_c_at_C_internal_3 --> -16($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + la $t3, data_4 + sw $t3, 8($v0) + li $t3, 18 + sw $t3, 12($v0) + sw $v0, -16($fp) + # ARG local_out_c_at_C_internal_3 + # LOCAL local_out_c_at_C_internal_3 --> -16($fp) + lw $t4, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + # LOCAL local_out_c_at_C_internal_0 --> -4($fp) + # LOCAL local_out_c_at_C_internal_1 --> -8($fp) + # local_out_c_at_C_internal_1 = VCALL local_out_c_at_C_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t4, 4($s1) + # Get pointer to type's VTABLE + lw $t5, 0($t4) + # Get pointer to function address + lw $t6, 0($t5) + # Call function. Result is on $v0 + jalr $t6 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_out_c_at_C_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_c_at_C. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_d_at_D implementation. +# @Params: +function_out_d_at_D: + # Allocate stack frame for function function_out_d_at_D. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_out_d_at_D_internal_2 --> -12($fp) + # local_out_d_at_D_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_out_d_at_D_internal_0 --> -4($fp) + # LOCAL local_out_d_at_D_internal_2 --> -12($fp) + # local_out_d_at_D_internal_0 = local_out_d_at_D_internal_2 + lw $t4, -12($fp) + sw $t4, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_out_d_at_D_internal_3 --> -16($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + la $t4, data_5 + sw $t4, 8($v0) + li $t4, 18 + sw $t4, 12($v0) + sw $v0, -16($fp) + # ARG local_out_d_at_D_internal_3 + # LOCAL local_out_d_at_D_internal_3 --> -16($fp) + lw $t5, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + # LOCAL local_out_d_at_D_internal_0 --> -4($fp) + # LOCAL local_out_d_at_D_internal_1 --> -8($fp) + # local_out_d_at_D_internal_1 = VCALL local_out_d_at_D_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 0($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_out_d_at_D_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_d_at_D. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 72 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 72 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = ALLOCATE A + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + la $t5, A + sw $t5, 0($v0) + la $t5, A_start + sw $t5, 4($v0) + move $t6, $v0 + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __A__attrib__io__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 8($t6) + sw $t6, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t5, -12($fp) + sw $t5, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_a + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 12($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = ALLOCATE B + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + la $t5, B + sw $t5, 0($v0) + la $t5, B_start + sw $t5, 4($v0) + move $t6, $v0 + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __A__attrib__io__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 8($t6) + sw $t6, -24($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 + lw $t5, -24($fp) + sw $t5, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 out_b + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 16($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = ALLOCATE C + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t5, C + sw $t5, 0($v0) + la $t5, C_start + sw $t5, 4($v0) + move $t6, $v0 + sw $t6, -36($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 + lw $t5, -36($fp) + sw $t5, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_c + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 28($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = ALLOCATE D + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t5, D + sw $t5, 0($v0) + la $t5, D_start + sw $t5, 4($v0) + move $t6, $v0 + sw $t6, -48($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 + lw $t5, -48($fp) + sw $t5, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_d + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 32($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 + lw $t5, -60($fp) + sw $t5, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + la $t5, data_6 + sw $t5, 8($v0) + li $t5, 9 + sw $t5, 12($v0) + sw $v0, -64($fp) + # ARG local_main_at_Main_internal_15 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + lw $t6, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t6, 4($s1) + # Get pointer to type's VTABLE + lw $t7, 0($t6) + # Get pointer to function address + lw $t8, 0($t7) + # Call function. Result is on $v0 + jalr $t8 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_13 + lw $v0, -56($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 72 + jr $ra + # Function END + From 95e75d7f05d9e7de0865bd6ceb7194b1e4743d11 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Thu, 3 Dec 2020 16:18:02 -0500 Subject: [PATCH 137/162] Fix Strings attributes allocation --- src/cil/baseCilVisitor.py | 6 +++- src/testing.mips | 51 ++++++++++++++++++++++++---------- src/testing.py | 2 +- src/travels/ciltomips.py | 20 +++++++------ src/travels/ctcill.py | 4 ++- tests/codegen/fib.mips | 4 +-- tests/codegen/hello_world.mips | 4 +-- tests/codegen/io.mips | 6 +--- 8 files changed, 60 insertions(+), 37 deletions(-) diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 19eed645..0f5fb046 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -318,6 +318,7 @@ def build_builtins(self): io_typeNode = self.register_type("IO") obj = self.register_type("Object") str_ = self.register_type("String") + str__ = self.context.get_type("String") io_typeNode.methods.append(("out_string", "function_out_string_at_IO")) io_typeNode.methods.append(("out_int", "function_out_int_at_IO")) @@ -335,8 +336,11 @@ def build_builtins(self): str_.methods.append(("substr", "function_substr_at_String")) str_.methods.append(("length", "function_length_at_String")) + str_.attributes.append(Attribute("value", str__)) str_.attributes.append(Attribute("length", self.context.get_type("Int"))) - str_.attributes.append(Attribute("value", self.context.get_type("String"))) + + str__.attributes.append(Attribute("value", str__)) + str__.attributes.append(Attribute("length", self.context.get_type("Int"))) self.__implement_in_string() self.__implement_out_int() diff --git a/src/testing.mips b/src/testing.mips index 3e1a1a4d..2f72c79a 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 16:02:04 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 16:14:41 2020 # School of Math and Computer Science, University of Havana # @@ -48,8 +48,6 @@ String_vtable: .word function_concat_at_String, function_substr_at_String, # **** Type RECORD for type String **** String_start: String_vtable_pointer: .word String_vtable -String_attrib_length: .word 0 -String_attrib_value: .asciiz "" String_end: # @@ -343,7 +341,7 @@ function_length_at_String: addu $fp, $sp, 32 # local_length_at_String_internal_0 = GETATTRIBUTE length String # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t1, 8($s1) + lw $t1, 12($s1) sw $t1, -4($fp) # RETURN local_length_at_String_internal_0 lw $v0, -4($fp) @@ -416,7 +414,7 @@ function_main_at_Main: # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 @@ -430,26 +428,51 @@ function_main_at_Main: sw $t1, 8($v0) li $t1, 17 sw $t1, 12($v0) - sw $v0, -16($fp) - # ARG local_main_at_Main_internal_3 + sw $v0, -24($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t2, -16($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 + lw $t1, -24($fp) + sw $t1, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 length + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 8($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t1, -20($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_int # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 0($t3) + lw $t3, 4($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) diff --git a/src/testing.py b/src/testing.py index 0341d40c..37397092 100755 --- a/src/testing.py +++ b/src/testing.py @@ -62,7 +62,7 @@ def pipeline(program: str, deep: int) -> None: text = r"""class Main inherits IO { main(): IO { - out_string("Hello, World.\n") + out_int("Hello, World.\n".length()) }; }; diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 71ba9031..b9bbae28 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -105,15 +105,15 @@ def _(self, node: cil.TypeNode): # noqa: F811 # Declarar los atributos: Si los atributos son de tipo string, guardarlos como asciiz # de lo contrario son o numeros o punteros y se inicializan como .words - for attrib in node.attributes: - if attrib.type.name == "String": - self.register_instruction( - FixedData(f"{node.name}_attrib_{attrib.name}", r'""', "asciiz") - ) - else: - self.register_instruction( - FixedData(f"{node.name}_attrib_{attrib.name}", 0) - ) + # for attrib in node.attributes: + # if attrib.type.name == "String": + # self.register_instruction( + # FixedData(f"{node.name}_attrib_{attrib.name}", r'""', "asciiz") + # ) + # else: + # self.register_instruction( + # FixedData(f"{node.name}_attrib_{attrib.name}", 0) + # ) # Registrar la direccion de memoria donde termina el tipo para calcular facilmente # sizeof @@ -363,6 +363,8 @@ def _(self, node: cil.AllocateStringNode): # devolver la instancia self.register_instruction(SW(v0, dest)) + self.used_registers[reg] = False + @visit.register def _(self, node: cil.AllocateNode): # Cada instancia debe almacenar lo siguiente: diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 4ca8e002..a6abfa03 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -184,7 +184,9 @@ def _(self, node: coolAst.AttributeDef, scope: Scope) -> None: # (0 = false y 0 = void) attribute_type = self.context.get_type(node.typex) if attribute_type.name == "String": - self.register_instruction(ReturnNode(self.null.name)) + local = self.define_internal_local() + self.register_instruction(AllocateStringNode(local, self.null, 0)) + self.register_instruction(ReturnNode(local)) else: self.register_instruction(ReturnNode(0)) diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips index cea747de..07d8aa31 100644 --- a/tests/codegen/fib.mips +++ b/tests/codegen/fib.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 16:02:15 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 16:05:42 2020 # School of Math and Computer Science, University of Havana # @@ -48,8 +48,6 @@ String_vtable: .word function_concat_at_String, function_substr_at_String, # **** Type RECORD for type String **** String_start: String_vtable_pointer: .word String_vtable -String_attrib_length: .word 0 -String_attrib_value: .asciiz "" String_end: # diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips index a508da1f..0f99181d 100644 --- a/tests/codegen/hello_world.mips +++ b/tests/codegen/hello_world.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 16:02:14 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 16:05:41 2020 # School of Math and Computer Science, University of Havana # @@ -48,8 +48,6 @@ String_vtable: .word function_concat_at_String, function_substr_at_String, # **** Type RECORD for type String **** String_start: String_vtable_pointer: .word String_vtable -String_attrib_length: .word 0 -String_attrib_value: .asciiz "" String_end: # diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips index 272b7e8a..cafa6126 100644 --- a/tests/codegen/io.mips +++ b/tests/codegen/io.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 16:02:15 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 16:05:42 2020 # School of Math and Computer Science, University of Havana # @@ -56,8 +56,6 @@ String_vtable: .word function_concat_at_String, function_substr_at_String, # **** Type RECORD for type String **** String_start: String_vtable_pointer: .word String_vtable -String_attrib_length: .word 0 -String_attrib_value: .asciiz "" String_end: # @@ -70,7 +68,6 @@ A_vtable: .word function_abort_at_Object, function_type_name_at_Object, fun # **** Type RECORD for type A **** A_start: A_vtable_pointer: .word A_vtable -A_attrib_io: .word 0 A_end: # @@ -83,7 +80,6 @@ B_vtable: .word function_abort_at_Object, function_type_name_at_Object, fun # **** Type RECORD for type B **** B_start: B_vtable_pointer: .word B_vtable -B_attrib_io: .word 0 B_end: # From 8b60d29de00912cfcd046df65c5c838c7b6583c5 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 4 Dec 2020 10:58:18 -0500 Subject: [PATCH 138/162] Fix substr function --- src/cil/baseCilVisitor.py | 8 +- src/cil/nodes.py | 23 +- src/mips/baseMipsVisitor.py | 19 +- src/testing.mips | 2665 +++++++++++++++++++++++++++-- src/testing.py | 124 +- src/travels/ciltomips.py | 109 +- src/travels/ctcill.py | 3 - tests/codegen/atoi.mips | 2896 ++++++++++++++++++++++++++++++++ tests/codegen/fib.mips | 505 +++--- tests/codegen/hello_world.mips | 251 +-- tests/codegen/io.mips | 735 ++++---- 11 files changed, 6467 insertions(+), 871 deletions(-) create mode 100644 tests/codegen/atoi.mips diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 0f5fb046..f8043dc8 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -2,13 +2,13 @@ import cil.nodes as nodes from abstract.semantics import Attribute, VariableInfo, Context, Type, Method from cil.nodes import ( - CopyNode, GetAttributeNode, + AllocateStringNode, CopyNode, GetAttributeNode, PrintIntNode, PrintNode, ReadIntNode, ReadNode, ReturnNode, - SelfNode, + SelfNode, SubstringNode, TypeName, TypeNode, ) @@ -303,6 +303,10 @@ def __implement_substr(self): paramr = self.register_params( VariableInfo("r", self.context.get_type("Int"), "PARAM") ) + + self.register_instruction(SubstringNode(return_vm_holder, paraml, paramr)) + + # Declarar un string vacio y rellenar la instancia self.register_instruction(ReturnNode(return_vm_holder)) def __implement_length(self): diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 98efecfa..63d8261f 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -1,5 +1,4 @@ from __future__ import annotations -from time import clock_settime from typing import List, Tuple, Union from abstract.semantics import Attribute, Method, Type """ @@ -196,23 +195,11 @@ def __init__(self, src: LocalNode) -> None: self.src = src -class SetAtAddress(InstructionNode): - pass - -class LengthNode(BuiltInNode): - pass - - -class ConcatNode(BuiltInNode): - pass - - -class PrefixNode(BuiltInNode): - pass - - -class SubstringNode(BuiltInNode): - pass +class SubstringNode(InstructionNode): + def __init__(self, dest, l, r) -> None: + self.dest = dest + self.l = l + self.r = r class ToStrNode(InstructionNode): diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 05aca4eb..0efff001 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -125,22 +125,21 @@ def get_location_address(self, node: Union[cil.ParamNode, cil.LocalNode]) -> str """ assert self.current_function is not None index = -1 + params = self.current_function.params if isinstance(node, cil.ParamNode): # Buscar el indice del parametro al que corresponde - for i, param in enumerate(self.current_function.params): - if param.name == node.name: - index = i - break + index = next(i for i, param in enumerate(params, 1) if param.name == node.name) assert index > -1 - return f"{index * 4}($fp)" + return f"{len(params) * 4 - index * 4}($fp)" else: # Buscar el indice de la variable local - for i, local_var in enumerate(self.current_function.localvars): - if local_var.name == node.name: - index = i - break + index = next( + i + for i, local_var in enumerate(self.current_function.localvars) + if local_var.name == node.name + ) assert index > -1 index += 1 @@ -222,7 +221,7 @@ def create_type_array(self, types: List[TypeNode]): # Generar por cada tipo, un label que lo identifique, en el mismo orden que aparecen # en la lista de tipos. for t in types: - self.register_instruction(FixedData(t.name, f"\"{t.name}\"", "asciiz")) + self.register_instruction(FixedData(t.name, f'"{t.name}"', "asciiz")) self.comment("Function END") def allocate_memory(self, bytes_num: int): diff --git a/src/testing.mips b/src/testing.mips index 2f72c79a..a1859270 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 16:14:41 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 01:41:18 2020 # School of Math and Computer Science, University of Havana # @@ -11,6 +11,8 @@ Object: .asciiz "Object" # Function END String: .asciiz "String" # Function END +A2I: .asciiz "A2I" +# Function END Main: .asciiz "Main" # Function END # @@ -23,92 +25,229 @@ IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, functio # **** Type RECORD for type IO **** IO_start: -IO_vtable_pointer: .word IO_vtable -IO_end: -# + IO_vtable_pointer: .word IO_vtable + IO_end: + # -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# + # **** VTABLE for type Object **** + Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object + # -# **** Type RECORD for type Object **** -Object_start: -Object_vtable_pointer: .word Object_vtable -Object_end: -# + # **** Type RECORD for type Object **** + Object_start: + Object_vtable_pointer: .word Object_vtable + Object_end: + # -# **** VTABLE for type String **** -String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String -# + # **** VTABLE for type String **** + String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String + # -# **** Type RECORD for type String **** -String_start: -String_vtable_pointer: .word String_vtable -String_end: -# + # **** Type RECORD for type String **** + String_start: + String_vtable_pointer: .word String_vtable + String_end: + # -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main -# + # **** VTABLE for type A2I **** + A2I_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_c2i_at_A2I, function_i2c_at_A2I, function_a2i_at_A2I, function_a2i_aux_at_A2I, function_i2a_at_A2I, function_i2a_aux_at_A2I + # -# **** Type RECORD for type Main **** -Main_start: -Main_vtable_pointer: .word Main_vtable -Main_end: -# + # **** Type RECORD for type A2I **** + A2I_start: + A2I_vtable_pointer: .word A2I_vtable + A2I_end: + # -data_0: .asciiz "" -# + # **** VTABLE for type Main **** + Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main + # -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# + # **** Type RECORD for type Main **** + Main_start: + Main_vtable_pointer: .word Main_vtable + Main_end: + # -data_2: .asciiz "Hello, World.\n" -# + data_0: .asciiz "" + # + + + __Object_Object_tdt_entry__: .word 0 + __Object_Int_tdt_entry__: .word 1 + __Object_String_tdt_entry__: .word 1 + __Object_Bool_tdt_entry__: .word 1 + __Object_IO_tdt_entry__: .word 1 + __Object_A2I_tdt_entry__: .word 1 + __Object_Main_tdt_entry__: .word 2 + __Int_Object_tdt_entry__: .word -1 + __Int_Int_tdt_entry__: .word 0 + __Int_String_tdt_entry__: .word -1 + __Int_Bool_tdt_entry__: .word -1 + __Int_IO_tdt_entry__: .word -1 + __Int_A2I_tdt_entry__: .word -1 + __Int_Main_tdt_entry__: .word -1 + __String_Object_tdt_entry__: .word -1 + __String_Int_tdt_entry__: .word -1 + __String_String_tdt_entry__: .word 0 + __String_Bool_tdt_entry__: .word -1 + __String_IO_tdt_entry__: .word -1 + __String_A2I_tdt_entry__: .word -1 + __String_Main_tdt_entry__: .word -1 + __Bool_Object_tdt_entry__: .word -1 + __Bool_Int_tdt_entry__: .word -1 + __Bool_String_tdt_entry__: .word -1 + __Bool_Bool_tdt_entry__: .word 0 + __Bool_IO_tdt_entry__: .word -1 + __Bool_A2I_tdt_entry__: .word -1 + __Bool_Main_tdt_entry__: .word -1 + __IO_Object_tdt_entry__: .word -1 + __IO_Int_tdt_entry__: .word -1 + __IO_String_tdt_entry__: .word -1 + __IO_Bool_tdt_entry__: .word -1 + __IO_IO_tdt_entry__: .word 0 + __IO_A2I_tdt_entry__: .word -1 + __IO_Main_tdt_entry__: .word 1 + __A2I_Object_tdt_entry__: .word -1 + __A2I_Int_tdt_entry__: .word -1 + __A2I_String_tdt_entry__: .word -1 + __A2I_Bool_tdt_entry__: .word -1 + __A2I_IO_tdt_entry__: .word -1 + __A2I_A2I_tdt_entry__: .word 0 + __A2I_Main_tdt_entry__: .word -1 + __Main_Object_tdt_entry__: .word -1 + __Main_Int_tdt_entry__: .word -1 + __Main_String_tdt_entry__: .word -1 + __Main_Bool_tdt_entry__: .word -1 + __Main_IO_tdt_entry__: .word -1 + __Main_A2I_tdt_entry__: .word -1 + __Main_Main_tdt_entry__: .word 0 + # + + + data_2: .asciiz "0" + # + + + data_3: .asciiz "1" + # + + + data_4: .asciiz "2" + # + + + data_5: .asciiz "3" + # + + + data_6: .asciiz "4" + # + + + data_7: .asciiz "5" + # + + + data_8: .asciiz "6" + # + + + data_9: .asciiz "7" + # + + + data_10: .asciiz "8" + # + + + data_11: .asciiz "9" + # + + + data_12: .asciiz "0" + # + + + data_13: .asciiz "1" + # + + + data_14: .asciiz "2" + # + + + data_15: .asciiz "3" + # + + + data_16: .asciiz "4" + # + + + data_17: .asciiz "5" + # + + + data_18: .asciiz "6" + # + + + data_19: .asciiz "7" + # + + + data_20: .asciiz "8" + # + + + data_21: .asciiz "9" + # + + + data_22: .asciiz "" + # + + + data_23: .asciiz "-" + # + + + data_24: .asciiz "+" + # + + + data_25: .asciiz "0" + # + + + data_26: .asciiz "-" + # + + + data_27: .asciiz "" + # + + + data_28: .asciiz "678987" + # + + + data_29: .asciiz " == " + # + + + data_30: .asciiz "\n" + # .text @@ -316,19 +455,56 @@ function_substr_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t1, 8($s1) + lw $t2, 8($s1) + lw $t3, 4($fp) + addu $t1, $t1, $t3 + lw $t3, 0($fp) + addu $t2, $t2, $t3 + subu $a0, $t2, $t1 + move $t4, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t3, $v0 + substr_loop: + beq $t1, $t2, substr_end + lb $a0, 0($t1) + sb $a0, 0($t3) + addu $t1, $t1, 1 + addu $t3, $t3, 1 + j substr_loop + substr_end: + sb $zero, 0($t3) + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + sw $t2, 8($v0) + sw $t4, 12($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END # function_length_at_String implementation. @@ -395,26 +571,16 @@ entry: # Function END -# function_main_at_Main implementation. +# function_c2i_at_A2I implementation. # @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 +# 0($fp) = param_c2i_at_A2I_char_0 +function_c2i_at_A2I: + # Allocate stack frame for function function_c2i_at_A2I. + subu $sp, $sp, 100 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) + addu $fp, $sp, 100 + # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 @@ -426,66 +592,2305 @@ function_main_at_Main: sw $t1, 4($v0) la $t1, data_2 sw $t1, 8($v0) - li $t1, 17 + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -8($fp) + # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) + # local_c2i_at_A2I_internal_0 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_1 + lw $t1, 0($fp) + lw $t2, -8($fp) + sub $t1, $t1, $t2 + sw $t1, -4($fp) + # IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_TRUE_3 + # IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_TRUE_3 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_3 + # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) + # local_c2i_at_A2I_internal_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # GOTO label_END_4 +j label_END_4 +label_TRUE_3: + # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) + # local_c2i_at_A2I_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + label_END_4: +# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSE_1 +# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSE_1 +lw $t1, -4($fp) +beq $t1, 0, label_FALSE_1 +# GOTO label_END_2 +j label_END_2 +label_FALSE_1: + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_3 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -16($fp) + # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # local_c2i_at_A2I_internal_2 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_3 + lw $t1, 0($fp) + lw $t2, -16($fp) + sub $t1, $t1, $t2 + sw $t1, -12($fp) + # IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_TRUE_7 + # IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_TRUE_7 + lw $t1, -12($fp) + beq $t1, 0, label_TRUE_7 + # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) + # local_c2i_at_A2I_internal_2 = 0 + li $t1, 0 + sw $t1, -12($fp) + # GOTO label_END_8 +j label_END_8 +label_TRUE_7: + # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) + # local_c2i_at_A2I_internal_2 = 1 + li $t1, 1 + sw $t1, -12($fp) + label_END_8: +# IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_FALSE_5 +# IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_FALSE_5 +lw $t1, -12($fp) +beq $t1, 0, label_FALSE_5 +# GOTO label_END_6 +j label_END_6 +label_FALSE_5: + # LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_4 + sw $t1, 8($v0) + li $t1, 3 sw $t1, 12($v0) sw $v0, -24($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 - lw $t1, -24($fp) - sw $t1, -16($fp) + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) + # local_c2i_at_A2I_internal_4 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_5 + lw $t1, 0($fp) + lw $t2, -24($fp) + sub $t1, $t1, $t2 + sw $t1, -20($fp) + # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_11 + # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_11 + lw $t1, -20($fp) + beq $t1, 0, label_TRUE_11 + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # local_c2i_at_A2I_internal_4 = 0 + li $t1, 0 + sw $t1, -20($fp) + # GOTO label_END_12 +j label_END_12 +label_TRUE_11: + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # local_c2i_at_A2I_internal_4 = 1 + li $t1, 1 + sw $t1, -20($fp) + label_END_12: +# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_9 +# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_9 +lw $t1, -20($fp) +beq $t1, 0, label_FALSE_9 +# GOTO label_END_10 +j label_END_10 +label_FALSE_9: + # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_5 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -32($fp) + # LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) + # local_c2i_at_A2I_internal_6 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_7 + lw $t1, 0($fp) + lw $t2, -32($fp) + sub $t1, $t1, $t2 + sw $t1, -28($fp) + # IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_TRUE_15 + # IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_TRUE_15 + lw $t1, -28($fp) + beq $t1, 0, label_TRUE_15 + # LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) + # local_c2i_at_A2I_internal_6 = 0 + li $t1, 0 + sw $t1, -28($fp) + # GOTO label_END_16 +j label_END_16 +label_TRUE_15: + # LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) + # local_c2i_at_A2I_internal_6 = 1 + li $t1, 1 + sw $t1, -28($fp) + label_END_16: +# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSE_13 +# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSE_13 +lw $t1, -28($fp) +beq $t1, 0, label_FALSE_13 +# GOTO label_END_14 +j label_END_14 +label_FALSE_13: + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_6 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -40($fp) + # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # local_c2i_at_A2I_internal_8 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_9 + lw $t1, 0($fp) + lw $t2, -40($fp) + sub $t1, $t1, $t2 + sw $t1, -36($fp) + # IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_TRUE_19 + # IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_TRUE_19 + lw $t1, -36($fp) + beq $t1, 0, label_TRUE_19 + # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) + # local_c2i_at_A2I_internal_8 = 0 + li $t1, 0 + sw $t1, -36($fp) + # GOTO label_END_20 +j label_END_20 +label_TRUE_19: + # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) + # local_c2i_at_A2I_internal_8 = 1 + li $t1, 1 + sw $t1, -36($fp) + label_END_20: +# IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_FALSE_17 +# IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_FALSE_17 +lw $t1, -36($fp) +beq $t1, 0, label_FALSE_17 +# GOTO label_END_18 +j label_END_18 +label_FALSE_17: + # LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_7 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -48($fp) + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) + # local_c2i_at_A2I_internal_10 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_11 + lw $t1, 0($fp) + lw $t2, -48($fp) + sub $t1, $t1, $t2 + sw $t1, -44($fp) + # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_23 + # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_23 + lw $t1, -44($fp) + beq $t1, 0, label_TRUE_23 + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # local_c2i_at_A2I_internal_10 = 0 + li $t1, 0 + sw $t1, -44($fp) + # GOTO label_END_24 +j label_END_24 +label_TRUE_23: + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # local_c2i_at_A2I_internal_10 = 1 + li $t1, 1 + sw $t1, -44($fp) + label_END_24: +# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_21 +# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_21 +lw $t1, -44($fp) +beq $t1, 0, label_FALSE_21 +# GOTO label_END_22 +j label_END_22 +label_FALSE_21: + # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_8 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -56($fp) + # LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) + # local_c2i_at_A2I_internal_12 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_13 + lw $t1, 0($fp) + lw $t2, -56($fp) + sub $t1, $t1, $t2 + sw $t1, -52($fp) + # IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_TRUE_27 + # IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_TRUE_27 + lw $t1, -52($fp) + beq $t1, 0, label_TRUE_27 + # LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) + # local_c2i_at_A2I_internal_12 = 0 + li $t1, 0 + sw $t1, -52($fp) + # GOTO label_END_28 +j label_END_28 +label_TRUE_27: + # LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) + # local_c2i_at_A2I_internal_12 = 1 + li $t1, 1 + sw $t1, -52($fp) + label_END_28: +# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSE_25 +# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSE_25 +lw $t1, -52($fp) +beq $t1, 0, label_FALSE_25 +# GOTO label_END_26 +j label_END_26 +label_FALSE_25: + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_9 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -64($fp) + # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # local_c2i_at_A2I_internal_14 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_15 + lw $t1, 0($fp) + lw $t2, -64($fp) + sub $t1, $t1, $t2 + sw $t1, -60($fp) + # IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_TRUE_31 + # IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_TRUE_31 + lw $t1, -60($fp) + beq $t1, 0, label_TRUE_31 + # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) + # local_c2i_at_A2I_internal_14 = 0 + li $t1, 0 + sw $t1, -60($fp) + # GOTO label_END_32 +j label_END_32 +label_TRUE_31: + # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) + # local_c2i_at_A2I_internal_14 = 1 + li $t1, 1 + sw $t1, -60($fp) + label_END_32: +# IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_FALSE_29 +# IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_FALSE_29 +lw $t1, -60($fp) +beq $t1, 0, label_FALSE_29 +# GOTO label_END_30 +j label_END_30 +label_FALSE_29: + # LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_10 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -72($fp) + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) + # local_c2i_at_A2I_internal_16 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_17 + lw $t1, 0($fp) + lw $t2, -72($fp) + sub $t1, $t1, $t2 + sw $t1, -68($fp) + # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_35 + # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_35 + lw $t1, -68($fp) + beq $t1, 0, label_TRUE_35 + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # local_c2i_at_A2I_internal_16 = 0 + li $t1, 0 + sw $t1, -68($fp) + # GOTO label_END_36 +j label_END_36 +label_TRUE_35: + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # local_c2i_at_A2I_internal_16 = 1 + li $t1, 1 + sw $t1, -68($fp) + label_END_36: +# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_33 +# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_33 +lw $t1, -68($fp) +beq $t1, 0, label_FALSE_33 +# GOTO label_END_34 +j label_END_34 +label_FALSE_33: + # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_11 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -80($fp) + # LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) + # local_c2i_at_A2I_internal_18 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_19 + lw $t1, 0($fp) + lw $t2, -80($fp) + sub $t1, $t1, $t2 + sw $t1, -76($fp) + # IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_TRUE_39 + # IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_TRUE_39 + lw $t1, -76($fp) + beq $t1, 0, label_TRUE_39 + # LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) + # local_c2i_at_A2I_internal_18 = 0 + li $t1, 0 + sw $t1, -76($fp) + # GOTO label_END_40 +j label_END_40 +label_TRUE_39: + # LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) + # local_c2i_at_A2I_internal_18 = 1 + li $t1, 1 + sw $t1, -76($fp) + label_END_40: +# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSE_37 +# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSE_37 +lw $t1, -76($fp) +beq $t1, 0, label_FALSE_37 +# GOTO label_END_38 +j label_END_38 +label_FALSE_37: + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # local_c2i_at_A2I_internal_22 = SELF + sw $s1, -92($fp) + # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # local_c2i_at_A2I_internal_20 = local_c2i_at_A2I_internal_22 + lw $t1, -92($fp) + sw $t1, -84($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 length + # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # local_c2i_at_A2I_internal_21 = VCALL local_c2i_at_A2I_internal_20 abort # Save new self pointer in $s1 - lw $s1, -16($fp) + lw $s1, -84($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 8($t2) + lw $t3, 16($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -20($fp) + sw $v0, -88($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) + label_END_38: +label_END_34: +label_END_30: +label_END_26: +label_END_22: +label_END_18: +label_END_14: +label_END_10: +label_END_6: +label_END_2: +# RETURN +# Deallocate stack frame for function function_c2i_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 100 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_i2c_at_A2I implementation. +# @Params: +# 0($fp) = param_i2c_at_A2I_i_0 +function_i2c_at_A2I: + # Allocate stack frame for function function_i2c_at_A2I. + subu $sp, $sp, 104 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 104 + # LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_0 = PARAM param_i2c_at_A2I_i_0 - 0 + lw $t1, 0($fp) + sub $t1, $t1, 0 + sw $t1, -4($fp) + # IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_TRUE_43 + # IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_TRUE_43 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_43 + # LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) + # local_i2c_at_A2I_internal_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # GOTO label_END_44 +j label_END_44 +label_TRUE_43: + # LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) + # local_i2c_at_A2I_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + label_END_44: +# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSE_41 +# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSE_41 +lw $t1, -4($fp) +beq $t1, 0, label_FALSE_41 +# LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_12 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -8($fp) +# GOTO label_END_42 +j label_END_42 +label_FALSE_41: + # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_2 = PARAM param_i2c_at_A2I_i_0 - 1 + lw $t1, 0($fp) + sub $t1, $t1, 1 + sw $t1, -12($fp) + # IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_TRUE_47 + # IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_TRUE_47 + lw $t1, -12($fp) + beq $t1, 0, label_TRUE_47 + # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) + # local_i2c_at_A2I_internal_2 = 0 + li $t1, 0 + sw $t1, -12($fp) + # GOTO label_END_48 +j label_END_48 +label_TRUE_47: + # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) + # local_i2c_at_A2I_internal_2 = 1 + li $t1, 1 + sw $t1, -12($fp) + label_END_48: +# IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_FALSE_45 +# IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_FALSE_45 +lw $t1, -12($fp) +beq $t1, 0, label_FALSE_45 +# LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_13 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -16($fp) +# GOTO label_END_46 +j label_END_46 +label_FALSE_45: + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_4 = PARAM param_i2c_at_A2I_i_0 - 2 + lw $t1, 0($fp) + sub $t1, $t1, 2 + sw $t1, -20($fp) + # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_51 + # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_51 lw $t1, -20($fp) - # Push arg into stack + beq $t1, 0, label_TRUE_51 + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # local_i2c_at_A2I_internal_4 = 0 + li $t1, 0 + sw $t1, -20($fp) + # GOTO label_END_52 +j label_END_52 +label_TRUE_51: + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # local_i2c_at_A2I_internal_4 = 1 + li $t1, 1 + sw $t1, -20($fp) + label_END_52: +# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_49 +# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_49 +lw $t1, -20($fp) +beq $t1, 0, label_FALSE_49 +# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_14 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -24($fp) +# GOTO label_END_50 +j label_END_50 +label_FALSE_49: + # LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_6 = PARAM param_i2c_at_A2I_i_0 - 3 + lw $t1, 0($fp) + sub $t1, $t1, 3 + sw $t1, -28($fp) + # IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_TRUE_55 + # IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_TRUE_55 + lw $t1, -28($fp) + beq $t1, 0, label_TRUE_55 + # LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) + # local_i2c_at_A2I_internal_6 = 0 + li $t1, 0 + sw $t1, -28($fp) + # GOTO label_END_56 +j label_END_56 +label_TRUE_55: + # LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) + # local_i2c_at_A2I_internal_6 = 1 + li $t1, 1 + sw $t1, -28($fp) + label_END_56: +# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSE_53 +# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSE_53 +lw $t1, -28($fp) +beq $t1, 0, label_FALSE_53 +# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_15 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -32($fp) +# GOTO label_END_54 +j label_END_54 +label_FALSE_53: + # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_8 = PARAM param_i2c_at_A2I_i_0 - 4 + lw $t1, 0($fp) + sub $t1, $t1, 4 + sw $t1, -36($fp) + # IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_TRUE_59 + # IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_TRUE_59 + lw $t1, -36($fp) + beq $t1, 0, label_TRUE_59 + # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) + # local_i2c_at_A2I_internal_8 = 0 + li $t1, 0 + sw $t1, -36($fp) + # GOTO label_END_60 +j label_END_60 +label_TRUE_59: + # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) + # local_i2c_at_A2I_internal_8 = 1 + li $t1, 1 + sw $t1, -36($fp) + label_END_60: +# IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_FALSE_57 +# IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_FALSE_57 +lw $t1, -36($fp) +beq $t1, 0, label_FALSE_57 +# LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_16 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -40($fp) +# GOTO label_END_58 +j label_END_58 +label_FALSE_57: + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_10 = PARAM param_i2c_at_A2I_i_0 - 5 + lw $t1, 0($fp) + sub $t1, $t1, 5 + sw $t1, -44($fp) + # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_63 + # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_63 + lw $t1, -44($fp) + beq $t1, 0, label_TRUE_63 + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # local_i2c_at_A2I_internal_10 = 0 + li $t1, 0 + sw $t1, -44($fp) + # GOTO label_END_64 +j label_END_64 +label_TRUE_63: + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # local_i2c_at_A2I_internal_10 = 1 + li $t1, 1 + sw $t1, -44($fp) + label_END_64: +# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_61 +# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_61 +lw $t1, -44($fp) +beq $t1, 0, label_FALSE_61 +# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_17 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -48($fp) +# GOTO label_END_62 +j label_END_62 +label_FALSE_61: + # LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_12 = PARAM param_i2c_at_A2I_i_0 - 6 + lw $t1, 0($fp) + sub $t1, $t1, 6 + sw $t1, -52($fp) + # IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_TRUE_67 + # IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_TRUE_67 + lw $t1, -52($fp) + beq $t1, 0, label_TRUE_67 + # LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) + # local_i2c_at_A2I_internal_12 = 0 + li $t1, 0 + sw $t1, -52($fp) + # GOTO label_END_68 +j label_END_68 +label_TRUE_67: + # LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) + # local_i2c_at_A2I_internal_12 = 1 + li $t1, 1 + sw $t1, -52($fp) + label_END_68: +# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSE_65 +# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSE_65 +lw $t1, -52($fp) +beq $t1, 0, label_FALSE_65 +# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_18 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -56($fp) +# GOTO label_END_66 +j label_END_66 +label_FALSE_65: + # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_14 = PARAM param_i2c_at_A2I_i_0 - 7 + lw $t1, 0($fp) + sub $t1, $t1, 7 + sw $t1, -60($fp) + # IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_TRUE_71 + # IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_TRUE_71 + lw $t1, -60($fp) + beq $t1, 0, label_TRUE_71 + # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) + # local_i2c_at_A2I_internal_14 = 0 + li $t1, 0 + sw $t1, -60($fp) + # GOTO label_END_72 +j label_END_72 +label_TRUE_71: + # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) + # local_i2c_at_A2I_internal_14 = 1 + li $t1, 1 + sw $t1, -60($fp) + label_END_72: +# IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_FALSE_69 +# IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_FALSE_69 +lw $t1, -60($fp) +beq $t1, 0, label_FALSE_69 +# LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_19 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -64($fp) +# GOTO label_END_70 +j label_END_70 +label_FALSE_69: + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_16 = PARAM param_i2c_at_A2I_i_0 - 8 + lw $t1, 0($fp) + sub $t1, $t1, 8 + sw $t1, -68($fp) + # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_75 + # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_75 + lw $t1, -68($fp) + beq $t1, 0, label_TRUE_75 + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # local_i2c_at_A2I_internal_16 = 0 + li $t1, 0 + sw $t1, -68($fp) + # GOTO label_END_76 +j label_END_76 +label_TRUE_75: + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # local_i2c_at_A2I_internal_16 = 1 + li $t1, 1 + sw $t1, -68($fp) + label_END_76: +# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_73 +# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_73 +lw $t1, -68($fp) +beq $t1, 0, label_FALSE_73 +# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_20 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -72($fp) +# GOTO label_END_74 +j label_END_74 +label_FALSE_73: + # LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_18 = PARAM param_i2c_at_A2I_i_0 - 9 + lw $t1, 0($fp) + sub $t1, $t1, 9 + sw $t1, -76($fp) + # IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_TRUE_79 + # IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_TRUE_79 + lw $t1, -76($fp) + beq $t1, 0, label_TRUE_79 + # LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) + # local_i2c_at_A2I_internal_18 = 0 + li $t1, 0 + sw $t1, -76($fp) + # GOTO label_END_80 +j label_END_80 +label_TRUE_79: + # LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) + # local_i2c_at_A2I_internal_18 = 1 + li $t1, 1 + sw $t1, -76($fp) + label_END_80: +# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSE_77 +# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSE_77 +lw $t1, -76($fp) +beq $t1, 0, label_FALSE_77 +# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_21 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -80($fp) +# GOTO label_END_78 +j label_END_78 +label_FALSE_77: + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # local_i2c_at_A2I_internal_22 = SELF + sw $s1, -92($fp) + # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # local_i2c_at_A2I_internal_20 = local_i2c_at_A2I_internal_22 + lw $t1, -92($fp) + sw $t1, -84($fp) + # Push register s1 into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_int + sw $s1, 0($sp) + # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # local_i2c_at_A2I_internal_21 = VCALL local_i2c_at_A2I_internal_20 abort # Save new self pointer in $s1 - lw $s1, -4($fp) + lw $s1, -84($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 4($t2) + lw $t3, 16($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -8($fp) + sw $v0, -88($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 + # LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_22 + sw $t1, 8($v0) + li $t1, 2 + sw $t1, 12($v0) + sw $v0, -96($fp) + label_END_78: +label_END_74: +label_END_70: +label_END_66: +label_END_62: +label_END_58: +label_END_54: +label_END_50: +label_END_46: +label_END_42: +# RETURN +# Deallocate stack frame for function function_i2c_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 104 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_at_A2I implementation. +# @Params: +# 0($fp) = param_a2i_at_A2I_s_0 +function_a2i_at_A2I: + # Allocate stack frame for function function_a2i_at_A2I. + subu $sp, $sp, 96 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 96 + # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_1 = PARAM param_a2i_at_A2I_s_0 + lw $t1, 0($fp) + sw $t1, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) + # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) + # local_a2i_at_A2I_internal_2 = VCALL local_a2i_at_A2I_internal_1 length + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 8($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) + # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) + # local_a2i_at_A2I_internal_0 = local_a2i_at_A2I_internal_2 - 0 + lw $t1, -12($fp) + sub $t1, $t1, 0 + sw $t1, -4($fp) + # IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_TRUE_83 + # IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_TRUE_83 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_83 + # LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) + # local_a2i_at_A2I_internal_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # GOTO label_END_84 +j label_END_84 +label_TRUE_83: + # LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) + # local_a2i_at_A2I_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + label_END_84: +# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSE_81 +# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSE_81 +lw $t1, -4($fp) +beq $t1, 0, label_FALSE_81 +# GOTO label_END_82 +j label_END_82 +label_FALSE_81: + # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_4 = PARAM param_a2i_at_A2I_s_0 + lw $t1, 0($fp) + sw $t1, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 0 + li $t1, 0 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # ARG 1 + li $t1, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # local_a2i_at_A2I_internal_5 = VCALL local_a2i_at_A2I_internal_4 substr + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 4($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_23 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -28($fp) + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + # local_a2i_at_A2I_internal_3 = local_a2i_at_A2I_internal_5 - local_a2i_at_A2I_internal_6 + lw $t1, -24($fp) + lw $t2, -28($fp) + sub $t1, $t1, $t2 + sw $t1, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_87 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_87 + lw $t1, -16($fp) + beq $t1, 0, label_TRUE_87 + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # local_a2i_at_A2I_internal_3 = 0 + li $t1, 0 + sw $t1, -16($fp) + # GOTO label_END_88 +j label_END_88 +label_TRUE_87: + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # local_a2i_at_A2I_internal_3 = 1 + li $t1, 1 + sw $t1, -16($fp) + label_END_88: +# IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_FALSE_85 +# IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_FALSE_85 +lw $t1, -16($fp) +beq $t1, 0, label_FALSE_85 +# GOTO label_END_86 +j label_END_86 +label_FALSE_85: + # LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_8 = PARAM param_a2i_at_A2I_s_0 + lw $t1, 0($fp) + sw $t1, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 0 + li $t1, 0 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # ARG 1 + li $t1, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) + # LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) + # local_a2i_at_A2I_internal_9 = VCALL local_a2i_at_A2I_internal_8 substr + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 4($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_24 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -44($fp) + # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) + # LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) + # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) + # local_a2i_at_A2I_internal_7 = local_a2i_at_A2I_internal_9 - local_a2i_at_A2I_internal_10 + lw $t1, -40($fp) + lw $t2, -44($fp) + sub $t1, $t1, $t2 + sw $t1, -32($fp) + # IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_TRUE_91 + # IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_TRUE_91 + lw $t1, -32($fp) + beq $t1, 0, label_TRUE_91 + # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) + # local_a2i_at_A2I_internal_7 = 0 + li $t1, 0 + sw $t1, -32($fp) + # GOTO label_END_92 +j label_END_92 +label_TRUE_91: + # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) + # local_a2i_at_A2I_internal_7 = 1 + li $t1, 1 + sw $t1, -32($fp) + label_END_92: +# IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_FALSE_89 +# IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_FALSE_89 +lw $t1, -32($fp) +beq $t1, 0, label_FALSE_89 +# LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) +# local_a2i_at_A2I_internal_13 = SELF +sw $s1, -56($fp) +# LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) +# LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) +# local_a2i_at_A2I_internal_11 = local_a2i_at_A2I_internal_13 +lw $t1, -56($fp) +sw $t1, -48($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_14 = PARAM param_a2i_at_A2I_s_0 +lw $t1, 0($fp) +sw $t1, -60($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG 1 +li $t1, 1 +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_17 = PARAM param_a2i_at_A2I_s_0 +lw $t1, 0($fp) +sw $t1, -72($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) +# local_a2i_at_A2I_internal_18 = VCALL local_a2i_at_A2I_internal_17 length +# Save new self pointer in $s1 +lw $s1, -72($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 8($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -76($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) +# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) +# local_a2i_at_A2I_internal_16 = local_a2i_at_A2I_internal_18 - 1 +lw $t1, -76($fp) +sub $t1, $t1, 1 +sw $t1, -68($fp) +# ARG local_a2i_at_A2I_internal_16 +# LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) +lw $t1, -68($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) +# LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) +# local_a2i_at_A2I_internal_15 = VCALL local_a2i_at_A2I_internal_14 substr +# Save new self pointer in $s1 +lw $s1, -60($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 4($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -64($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_at_A2I_internal_15 +# LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) +lw $t1, -64($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) +# LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) +# local_a2i_at_A2I_internal_12 = VCALL local_a2i_at_A2I_internal_11 a2i_aux +# Save new self pointer in $s1 +lw $s1, -48($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 24($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -52($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# GOTO label_END_90 +j label_END_90 +label_FALSE_89: + # LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) + # local_a2i_at_A2I_internal_21 = SELF + sw $s1, -88($fp) + # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) + # LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) + # local_a2i_at_A2I_internal_19 = local_a2i_at_A2I_internal_21 + lw $t1, -88($fp) + sw $t1, -80($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_a2i_at_A2I_s_0 + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + lw $t1, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) + # LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) + # local_a2i_at_A2I_internal_20 = VCALL local_a2i_at_A2I_internal_19 a2i_aux + # Save new self pointer in $s1 + lw $s1, -80($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 24($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -84($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_END_90: +label_END_86: +label_END_82: +# RETURN +# Deallocate stack frame for function function_a2i_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 96 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_aux_at_A2I implementation. +# @Params: +# 0($fp) = param_a2i_aux_at_A2I_s_0 +function_a2i_aux_at_A2I: + # Allocate stack frame for function function_a2i_aux_at_A2I. + subu $sp, $sp, 64 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 64 + # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) + # local_a2i_aux_at_A2I_int_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # LOCAL local_a2i_aux_at_A2I_internal_2 --> -12($fp) + # PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) + # local_a2i_aux_at_A2I_internal_2 = PARAM param_a2i_aux_at_A2I_s_0 + lw $t1, 0($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_aux_at_A2I_internal_2 --> -12($fp) + # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) + # local_a2i_aux_at_A2I_internal_3 = VCALL local_a2i_aux_at_A2I_internal_2 length + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 8($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_aux_at_A2I_j_1 --> -8($fp) + # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) + # local_a2i_aux_at_A2I_j_1 = local_a2i_aux_at_A2I_internal_3 + lw $t1, -16($fp) + sw $t1, -8($fp) + # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) + # local_a2i_aux_at_A2I_i_4 = 0 + li $t1, 0 + sw $t1, -20($fp) + label_WHILE_93: + # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) + # LOCAL local_a2i_aux_at_A2I_j_1 --> -8($fp) + # local_a2i_aux_at_A2I_internal_5 = local_a2i_aux_at_A2I_i_4 - local_a2i_aux_at_A2I_j_1 + lw $t1, -20($fp) + lw $t2, -8($fp) + sub $t1, $t1, $t2 + sw $t1, -24($fp) + # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 + # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 + lw $t1, -24($fp) + bgt $t1, 0, label_FALSE_95 + # IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 + # IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 + lw $t1, -24($fp) + beq $t1, 0, label_FALSE_95 + # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) + # local_a2i_aux_at_A2I_internal_5 = 1 + li $t1, 1 + sw $t1, -24($fp) + # GOTO label_END_96 +j label_END_96 +label_FALSE_95: + # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) + # local_a2i_aux_at_A2I_internal_5 = 0 + li $t1, 0 + sw $t1, -24($fp) + label_END_96: +# IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_WHILE_END_94 +# IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_WHILE_END_94 +lw $t1, -24($fp) +beq $t1, 0, label_WHILE_END_94 +# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) +# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) +# local_a2i_aux_at_A2I_internal_7 = local_a2i_aux_at_A2I_int_0 * 10 +lw $t1, -4($fp) +mul $t1, $t1, 10 +sw $t1, -32($fp) +# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) +# local_a2i_aux_at_A2I_internal_10 = SELF +sw $s1, -44($fp) +# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) +# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) +# local_a2i_aux_at_A2I_internal_8 = local_a2i_aux_at_A2I_internal_10 +lw $t1, -44($fp) +sw $t1, -36($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) +# PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) +# local_a2i_aux_at_A2I_internal_11 = PARAM param_a2i_aux_at_A2I_s_0 +lw $t1, 0($fp) +sw $t1, -48($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_a2i_aux_at_A2I_i_4 +# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) +lw $t1, -20($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# ARG 1 +li $t1, 1 +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) +# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) +# local_a2i_aux_at_A2I_internal_12 = VCALL local_a2i_aux_at_A2I_internal_11 substr +# Save new self pointer in $s1 +lw $s1, -48($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 4($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -52($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_aux_at_A2I_internal_12 +# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) +lw $t1, -52($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) +# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) +# local_a2i_aux_at_A2I_internal_9 = VCALL local_a2i_aux_at_A2I_internal_8 c2i +# Save new self pointer in $s1 +lw $s1, -36($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 12($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -40($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) +# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) +# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) +# local_a2i_aux_at_A2I_internal_6 = local_a2i_aux_at_A2I_internal_7 + local_a2i_aux_at_A2I_internal_9 +lw $t1, -32($fp) +lw $t2, -40($fp) +add $t1, $t1, $t2 +sw $t1, -28($fp) +# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) +# local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_6 +lw $t1, -28($fp) +sw $t1, -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) +# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) +# local_a2i_aux_at_A2I_internal_13 = local_a2i_aux_at_A2I_i_4 + 1 +lw $t1, -20($fp) +add $t1, $t1, 1 +sw $t1, -56($fp) +# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) +# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) +# local_a2i_aux_at_A2I_i_4 = local_a2i_aux_at_A2I_internal_13 +lw $t1, -56($fp) +sw $t1, -20($fp) +# GOTO label_WHILE_93 +j label_WHILE_93 +label_WHILE_END_94: + # RETURN local_a2i_aux_at_A2I_int_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_a2i_aux_at_A2I. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 64 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_i2a_at_A2I implementation. +# @Params: +# 0($fp) = param_i2a_at_A2I_i_0 +function_i2a_at_A2I: + # Allocate stack frame for function function_i2a_at_A2I. + subu $sp, $sp, 60 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 60 + # LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # local_i2a_at_A2I_internal_0 = PARAM param_i2a_at_A2I_i_0 - 0 + lw $t1, 0($fp) + sub $t1, $t1, 0 + sw $t1, -4($fp) + # IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_TRUE_99 + # IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_TRUE_99 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_99 + # LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) + # local_i2a_at_A2I_internal_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # GOTO label_END_100 +j label_END_100 +label_TRUE_99: + # LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) + # local_i2a_at_A2I_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + label_END_100: +# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSE_97 +# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSE_97 +lw $t1, -4($fp) +beq $t1, 0, label_FALSE_97 +# LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_25 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -8($fp) +# GOTO label_END_98 +j label_END_98 +label_FALSE_97: + # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # local_i2a_at_A2I_internal_2 = 0 - PARAM param_i2a_at_A2I_i_0 + li $t1, 0 + lw $t2, 0($fp) + sub $t1, $t1, $t2 + sw $t1, -12($fp) + # IF_GREATER_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 + # IF_GREATER_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 + lw $t1, -12($fp) + bgt $t1, 0, label_FALSE_103 + # IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 + # IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 + lw $t1, -12($fp) + beq $t1, 0, label_FALSE_103 + # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) + # local_i2a_at_A2I_internal_2 = 1 + li $t1, 1 + sw $t1, -12($fp) + # GOTO label_END_104 +j label_END_104 +label_FALSE_103: + # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) + # local_i2a_at_A2I_internal_2 = 0 + li $t1, 0 + sw $t1, -12($fp) + label_END_104: +# IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_101 +# IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_101 +lw $t1, -12($fp) +beq $t1, 0, label_FALSE_101 +# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) +# local_i2a_at_A2I_internal_5 = SELF +sw $s1, -24($fp) +# LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) +# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) +# local_i2a_at_A2I_internal_3 = local_i2a_at_A2I_internal_5 +lw $t1, -24($fp) +sw $t1, -16($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_i2a_at_A2I_i_0 +# PARAM param_i2a_at_A2I_i_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) +# LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) +# local_i2a_at_A2I_internal_4 = VCALL local_i2a_at_A2I_internal_3 i2a_aux +# Save new self pointer in $s1 +lw $s1, -16($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 32($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -20($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# GOTO label_END_102 +j label_END_102 +label_FALSE_101: + # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_26 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -36($fp) + # LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) + # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) + # local_i2a_at_A2I_internal_6 = local_i2a_at_A2I_internal_8 + lw $t1, -36($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) + # local_i2a_at_A2I_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) + # LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) + # local_i2a_at_A2I_internal_9 = local_i2a_at_A2I_internal_11 + lw $t1, -48($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # local_i2a_at_A2I_internal_12 = PARAM param_i2a_at_A2I_i_0 * 1 + lw $t1, 0($fp) + mul $t1, $t1, 1 + sw $t1, -52($fp) + # ARG local_i2a_at_A2I_internal_12 + # LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) + lw $t1, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) + # LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) + # local_i2a_at_A2I_internal_10 = VCALL local_i2a_at_A2I_internal_9 i2a_aux + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 32($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_i2a_at_A2I_internal_10 + # LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) + lw $t1, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) + # LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) + # local_i2a_at_A2I_internal_7 = VCALL local_i2a_at_A2I_internal_6 concat + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_END_102: +label_END_98: +# RETURN +# Deallocate stack frame for function function_i2a_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 60 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_i2a_aux_at_A2I implementation. +# @Params: +# 0($fp) = param_i2a_aux_at_A2I_i_0 +function_i2a_aux_at_A2I: + # Allocate stack frame for function function_i2a_aux_at_A2I. + subu $sp, $sp, 64 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 64 + # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # local_i2a_aux_at_A2I_internal_0 = PARAM param_i2a_aux_at_A2I_i_0 - 0 + lw $t1, 0($fp) + sub $t1, $t1, 0 + sw $t1, -4($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_TRUE_107 + # IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_TRUE_107 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_107 + # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) + # local_i2a_aux_at_A2I_internal_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # GOTO label_END_108 +j label_END_108 +label_TRUE_107: + # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) + # local_i2a_aux_at_A2I_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + label_END_108: +# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSE_105 +# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSE_105 +lw $t1, -4($fp) +beq $t1, 0, label_FALSE_105 +# LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_27 +sw $t1, 8($v0) +li $t1, 2 +sw $t1, 12($v0) +sw $v0, -8($fp) +# GOTO label_END_106 +j label_END_106 +label_FALSE_105: + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # local_i2a_aux_at_A2I_internal_3 = PARAM param_i2a_aux_at_A2I_i_0 / 10 + lw $t1, 0($fp) + div $t1, $t1, 10 + sw $t1, -16($fp) + # LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # local_i2a_aux_at_A2I_next_2 = local_i2a_aux_at_A2I_internal_3 + lw $t1, -16($fp) + sw $t1, -12($fp) + # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) + # local_i2a_aux_at_A2I_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) + # local_i2a_aux_at_A2I_internal_6 = local_i2a_aux_at_A2I_internal_8 + lw $t1, -36($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_i2a_aux_at_A2I_next_2 + # LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) + lw $t1, -12($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) + # local_i2a_aux_at_A2I_internal_7 = VCALL local_i2a_aux_at_A2I_internal_6 i2a_aux + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 32($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) + # local_i2a_aux_at_A2I_internal_4 = local_i2a_aux_at_A2I_internal_7 + lw $t1, -32($fp) + sw $t1, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) + # local_i2a_aux_at_A2I_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) + # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) + # local_i2a_aux_at_A2I_internal_9 = local_i2a_aux_at_A2I_internal_11 + lw $t1, -48($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) + # LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) + # local_i2a_aux_at_A2I_internal_13 = local_i2a_aux_at_A2I_next_2 * 10 + lw $t1, -12($fp) + mul $t1, $t1, 10 + sw $t1, -56($fp) + # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) + # local_i2a_aux_at_A2I_internal_12 = PARAM param_i2a_aux_at_A2I_i_0 - local_i2a_aux_at_A2I_internal_13 + lw $t1, 0($fp) + lw $t2, -56($fp) + sub $t1, $t1, $t2 + sw $t1, -52($fp) + # ARG local_i2a_aux_at_A2I_internal_12 + # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) + lw $t1, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) + # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) + # local_i2a_aux_at_A2I_internal_10 = VCALL local_i2a_aux_at_A2I_internal_9 i2c + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 16($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_i2a_aux_at_A2I_internal_10 + # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) + lw $t1, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + # LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) + # local_i2a_aux_at_A2I_internal_5 = VCALL local_i2a_aux_at_A2I_internal_4 concat + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_END_106: +# RETURN +# Deallocate stack frame for function function_i2a_aux_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 64 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 100 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 100 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE A2I + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, A2I + sw $t1, 0($v0) + la $t1, A2I_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t1, -16($fp) + sw $t1, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_28 + sw $t1, 8($v0) + li $t1, 8 + sw $t1, 12($v0) + sw $v0, -20($fp) + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t1, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 a2i + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 20($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_a_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_a_0 = local_main_at_Main_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = ALLOCATE A2I + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, A2I + sw $t1, 0($v0) + la $t1, A2I_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -36($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 + lw $t1, -36($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 678987 + li $t1, 678987 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 i2a + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 28($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_b_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_b_5 = local_main_at_Main_internal_7 + lw $t1, -32($fp) + sw $t1, -24($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 + lw $t1, -48($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_a_0 + # LOCAL local_main_at_Main_a_0 --> -4($fp) + lw $t1, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_int + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 4($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 + lw $t1, -60($fp) + sw $t1, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_29 + sw $t1, 8($v0) + li $t1, 6 + sw $t1, 12($v0) + sw $v0, -64($fp) + # ARG local_main_at_Main_internal_15 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + lw $t1, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 + lw $t1, -76($fp) + sw $t1, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_b_5 + # LOCAL local_main_at_Main_b_5 --> -24($fp) + lw $t1, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_21 = SELF + sw $s1, -88($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 + lw $t1, -88($fp) + sw $t1, -80($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_30 + sw $t1, 8($v0) + li $t1, 4 + sw $t1, 12($v0) + sw $v0, -92($fp) + # ARG local_main_at_Main_internal_22 + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + lw $t1, -92($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 out_string + # Save new self pointer in $s1 + lw $s1, -80($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -84($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_20 + lw $v0, -84($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 100 jr $ra # Function END diff --git a/src/testing.py b/src/testing.py index 37397092..00c10df2 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,11 +60,127 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""class Main inherits IO { - main(): IO { - out_int("Hello, World.\n".length()) - }; +text = r"""(* + The class A2I provides integer-to-string and string-to-integer +conversion routines. To use these routines, either inherit them +in the class where needed, have a dummy variable bound to +something of type A2I, or simpl write (new A2I).method(argument). +*) + + +(* + c2i Converts a 1-character string to an integer. Aborts + if the string is not "0" through "9" +*) +class A2I { + + c2i(char : String) : Int { + if char = "0" then 0 else + if char = "1" then 1 else + if char = "2" then 2 else + if char = "3" then 3 else + if char = "4" then 4 else + if char = "5" then 5 else + if char = "6" then 6 else + if char = "7" then 7 else + if char = "8" then 8 else + if char = "9" then 9 else + { abort(); 0; } -- the 0 is needed to satisfy the typchecker + fi fi fi fi fi fi fi fi fi fi + }; + +(* + i2c is the inverse of c2i. +*) + i2c(i : Int) : String { + if i = 0 then "0" else + if i = 1 then "1" else + if i = 2 then "2" else + if i = 3 then "3" else + if i = 4 then "4" else + if i = 5 then "5" else + if i = 6 then "6" else + if i = 7 then "7" else + if i = 8 then "8" else + if i = 9 then "9" else + { abort(); ""; } -- the "" is needed to satisfy the typchecker + fi fi fi fi fi fi fi fi fi fi + }; + +(* + a2i converts an ASCII string into an integer. The empty string +is converted to 0. Signed and unsigned strings are handled. The +method aborts if the string does not represent an integer. Very +long strings of digits produce strange answers because of arithmetic +overflow. + +*) + a2i(s : String) : Int { + if s.length() = 0 then 0 else + if s.substr(0,1) = "-" then ~a2i_aux(s.substr(1,s.length()-1)) else + if s.substr(0,1) = "+" then a2i_aux(s.substr(1,s.length()-1)) else + a2i_aux(s) + fi fi fi + }; + +(* + a2i_aux converts the usigned portion of the string. As a programming +example, this method is written iteratively. +*) + a2i_aux(s : String) : Int { + (let int : Int <- 0 in + { + (let j : Int <- s.length() in + (let i : Int <- 0 in + while i < j loop + { + int <- int * 10 + c2i(s.substr(i,1)); + i <- i + 1; + } + pool + ) + ); + int; + } + ) + }; + +(* + i2a converts an integer to a string. Positive and negative +numbers are handled correctly. +*) + i2a(i : Int) : String { + if i = 0 then "0" else + if 0 < i then i2a_aux(i) else + "-".concat(i2a_aux(i * ~1)) + fi fi + }; + +(* + i2a_aux is an example using recursion. +*) + i2a_aux(i : Int) : String { + if i = 0 then "" else + (let next : Int <- i / 10 in + i2a_aux(next).concat(i2c(i - next * 10)) + ) + fi + }; + }; +class Main inherits IO { + main () : Object { + let a : Int <- (new A2I).a2i("678987"), + b : String <- (new A2I).i2a(678987) in + { + out_int(a) ; + out_string(" == ") ; + out_string(b) ; + out_string("\n"); + } + } ; +} ; + """ pipeline(text, 5) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index b9bbae28..9bd828c2 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -1,6 +1,6 @@ from abstract.semantics import Type from cil.nodes import LocalNode -from mips.arithmetic import ADD, DIV, MUL, NOR, SUB, SUBU +from mips.arithmetic import ADD, ADDU, DIV, MUL, NOR, SUB, SUBU from mips.baseMipsVisitor import ( BaseCilToMipsVisitor, DotDataDirective, @@ -8,6 +8,7 @@ locate_attribute_in_type_hierarchy, ) import cil.nodes as cil +from mips.branch import BEQ, J from mips.instruction import ( FixedData, Label, @@ -27,7 +28,7 @@ import mips.branch as branchNodes from functools import singledispatchmethod -from mips.load_store import LA, LI, LW, SW +from mips.load_store import LA, LB, LI, LW, SB, SW class CilToMipsVisitor(BaseCilToMipsVisitor): @@ -167,9 +168,6 @@ def _(self, node: cil.InitSelfNode): self.register_instruction(LW(s1, src)) - @visit.register - def _(self, node: cil.SetAtAddress): - self.register_instruction(LI(at, 0)) @visit.register def _(self, node: cil.LabelNode): @@ -637,16 +635,99 @@ def _(self, node: cil.LoadNode): ## NODOS REFERENTES A OPERACIONES BUILT-IN DE COOL ## @visit.register - def _(self, node: cil.LengthNode): - pass + def _(self, node: cil.SubstringNode): + dest = self.visit(node.dest) + assert dest is not None + l = self.visit(node.l) + r = self.visit(node.r) + assert l is not None + assert r is not None - @visit.register - def _(self, node: cil.ConcatNode): - pass + reg = self.get_available_register() + reg2 = self.get_available_register() + temp = self.get_available_register() + size_reg = self.get_available_register() + assert reg is not None + assert reg2 is not None + assert temp is not None + assert size_reg is not None + + # Cargar el string sobre el que se llama substr + self.register_instruction(LW(reg, "8($s1)")) + self.register_instruction(LW(reg2, "8($s1)")) + + # Hacer que reg apunte al inicio del substr + if isinstance(l , int): + self.register_instruction(ADDU(reg, reg, l, True)) + else: + self.register_instruction(LW(temp, l)) + self.register_instruction(ADDU(reg, reg, temp)) + + if isinstance(r , int): + self.register_instruction(ADDU(reg2, reg2, r, True)) + else: + self.register_instruction(LW(temp, r)) + self.register_instruction(ADDU(reg2, reg2, temp)) + + # Reservar memoria para el buffer de resultado + self.register_instruction(SUBU(a0, reg2, reg)) + # Salvar el length del substr + self.register_instruction(MOVE(size_reg, a0)) + # Agregar un byte mas para el fin de cadena + self.register_instruction(ADDU(a0, a0, 1, True)) + + # $v0 = 9 (syscall 9 = sbrk) + self.register_instruction(LI(v0, 9)) + self.register_instruction(SYSCALL()) + + self.register_instruction(MOVE(temp, v0)) + + # Mientras reg != reg2 : Copiar a v0 + self.register_instruction(Label("substr_loop")) + self.register_instruction(BEQ(reg, reg2, "substr_end")) + # Copiar un byte + self.register_instruction(LB(a0, f"0(${REG_TO_STR[reg]})")) + self.register_instruction(SB(a0, f"0(${REG_TO_STR[temp]})")) + # Mover el puntero temp y el puntero reg + self.register_instruction(ADDU(reg, reg, 1, True)) + self.register_instruction(ADDU(temp, temp, 1, True)) + # Saltar al ciclo while + self.register_instruction(J("substr_loop")) + # Salir del ciclo + self.register_instruction(Label("substr_end")) + # Agregar el null al final de la cadena + self.register_instruction(SB(zero, f"0(${REG_TO_STR[temp]})")) + + # v0 contiene el substr + self.register_instruction(MOVE(reg2, v0)) + # Crear la instancia de str + size = 16 + + # Reservar memoria para el tipo + self.allocate_memory(size) + + self.comment("Allocating string") + + # Inicializar la instancia + self.register_instruction(LA(reg, "String")) + self.register_instruction(SW(reg, "0($v0)")) + + self.register_instruction(LA(reg, "String_start")) + self.register_instruction(SW(reg, "4($v0)")) + + # Copiar el str en v0 al atributo value de la instancia + self.register_instruction(SW(reg2, "8($v0)")) + + self.register_instruction(SW(size_reg, "12($v0)")) + + # devolver la instancia + self.register_instruction(SW(v0, dest)) + + self.used_registers[reg] = False + self.used_registers[reg2] = False + self.used_registers[temp] = False + self.used_registers[size] = False - @visit.register - def _(self, node: cil.PrefixNode): - pass @visit.register def _(self, node: cil.ToStrNode): @@ -756,5 +837,5 @@ def to_str(self) -> str: if "word" not in line and "asciiz" not in line and "byte" not in line: indent += 1 if "# Function END" in line or "label_END" in line: - indent -= 1 + indent = 0 return program diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index a6abfa03..42e84ebc 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -14,7 +14,6 @@ AssignNode, CilNode, CilProgramNode, - ConcatNode, DataNode, DivNode, DynamicCallNode, @@ -26,7 +25,6 @@ InstructionNode, JumpIfGreaterThanZeroNode, LabelNode, - LengthNode, LoadNode, LocalNode, MinusNode, @@ -41,7 +39,6 @@ RestoreSelf, ReturnNode, SaveSelf, - SetAtAddress, SetAttributeNode, StarNode, StaticCallNode, diff --git a/tests/codegen/atoi.mips b/tests/codegen/atoi.mips new file mode 100644 index 00000000..44f4ae7a --- /dev/null +++ b/tests/codegen/atoi.mips @@ -0,0 +1,2896 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 01:31:55 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +A2I: .asciiz "A2I" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + IO_end: + # + + + # **** VTABLE for type Object **** + Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object + # + + + # **** Type RECORD for type Object **** + Object_start: + Object_vtable_pointer: .word Object_vtable + Object_end: + # + + + # **** VTABLE for type String **** + String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String + # + + + # **** Type RECORD for type String **** + String_start: + String_vtable_pointer: .word String_vtable + String_end: + # + + + # **** VTABLE for type A2I **** + A2I_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_c2i_at_A2I, function_i2c_at_A2I, function_a2i_at_A2I, function_a2i_aux_at_A2I, function_i2a_at_A2I, function_i2a_aux_at_A2I + # + + + # **** Type RECORD for type A2I **** + A2I_start: + A2I_vtable_pointer: .word A2I_vtable + A2I_end: + # + + + # **** VTABLE for type Main **** + Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main + # + + + # **** Type RECORD for type Main **** + Main_start: + Main_vtable_pointer: .word Main_vtable + Main_end: + # + + + data_0: .asciiz "" + # + + + __Object_Object_tdt_entry__: .word 0 + __Object_Int_tdt_entry__: .word 1 + __Object_String_tdt_entry__: .word 1 + __Object_Bool_tdt_entry__: .word 1 + __Object_IO_tdt_entry__: .word 1 + __Object_A2I_tdt_entry__: .word 1 + __Object_Main_tdt_entry__: .word 2 + __Int_Object_tdt_entry__: .word -1 + __Int_Int_tdt_entry__: .word 0 + __Int_String_tdt_entry__: .word -1 + __Int_Bool_tdt_entry__: .word -1 + __Int_IO_tdt_entry__: .word -1 + __Int_A2I_tdt_entry__: .word -1 + __Int_Main_tdt_entry__: .word -1 + __String_Object_tdt_entry__: .word -1 + __String_Int_tdt_entry__: .word -1 + __String_String_tdt_entry__: .word 0 + __String_Bool_tdt_entry__: .word -1 + __String_IO_tdt_entry__: .word -1 + __String_A2I_tdt_entry__: .word -1 + __String_Main_tdt_entry__: .word -1 + __Bool_Object_tdt_entry__: .word -1 + __Bool_Int_tdt_entry__: .word -1 + __Bool_String_tdt_entry__: .word -1 + __Bool_Bool_tdt_entry__: .word 0 + __Bool_IO_tdt_entry__: .word -1 + __Bool_A2I_tdt_entry__: .word -1 + __Bool_Main_tdt_entry__: .word -1 + __IO_Object_tdt_entry__: .word -1 + __IO_Int_tdt_entry__: .word -1 + __IO_String_tdt_entry__: .word -1 + __IO_Bool_tdt_entry__: .word -1 + __IO_IO_tdt_entry__: .word 0 + __IO_A2I_tdt_entry__: .word -1 + __IO_Main_tdt_entry__: .word 1 + __A2I_Object_tdt_entry__: .word -1 + __A2I_Int_tdt_entry__: .word -1 + __A2I_String_tdt_entry__: .word -1 + __A2I_Bool_tdt_entry__: .word -1 + __A2I_IO_tdt_entry__: .word -1 + __A2I_A2I_tdt_entry__: .word 0 + __A2I_Main_tdt_entry__: .word -1 + __Main_Object_tdt_entry__: .word -1 + __Main_Int_tdt_entry__: .word -1 + __Main_String_tdt_entry__: .word -1 + __Main_Bool_tdt_entry__: .word -1 + __Main_IO_tdt_entry__: .word -1 + __Main_A2I_tdt_entry__: .word -1 + __Main_Main_tdt_entry__: .word 0 + # + + + data_2: .asciiz "0" + # + + + data_3: .asciiz "1" + # + + + data_4: .asciiz "2" + # + + + data_5: .asciiz "3" + # + + + data_6: .asciiz "4" + # + + + data_7: .asciiz "5" + # + + + data_8: .asciiz "6" + # + + + data_9: .asciiz "7" + # + + + data_10: .asciiz "8" + # + + + data_11: .asciiz "9" + # + + + data_12: .asciiz "0" + # + + + data_13: .asciiz "1" + # + + + data_14: .asciiz "2" + # + + + data_15: .asciiz "3" + # + + + data_16: .asciiz "4" + # + + + data_17: .asciiz "5" + # + + + data_18: .asciiz "6" + # + + + data_19: .asciiz "7" + # + + + data_20: .asciiz "8" + # + + + data_21: .asciiz "9" + # + + + data_22: .asciiz "" + # + + + data_23: .asciiz "-" + # + + + data_24: .asciiz "+" + # + + + data_25: .asciiz "0" + # + + + data_26: .asciiz "-" + # + + + data_27: .asciiz "" + # + + + data_28: .asciiz "678987" + # + + + data_29: .asciiz " == " + # + + + data_30: .asciiz "\n" + # + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 8($v0) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t1, 8($s1) + lw $t2, 8($s1) + lw $t3, 4($fp) + addu $t1, $t1, $t3 + lw $t3, 0($fp) + addu $t2, $t2, $t3 + subu $a0, $t2, $t1 + move $t4, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t3, $v0 + substr_loop: + beq $t1, $t2, substr_end + lb $a0, 0($t1) + sb $a0, 0($t3) + addu $t1, $t1, 1 + addu $t3, $t3, 1 + j substr_loop + substr_end: + sb $zero, 0($t3) + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + sw $t2, 8($v0) + sw $s0, 12($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t1, 12($s1) + sw $t1, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, Main + sw $t1, 0($v0) + la $t1, Main_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_c2i_at_A2I implementation. +# @Params: +# 0($fp) = param_c2i_at_A2I_char_0 +function_c2i_at_A2I: + # Allocate stack frame for function function_c2i_at_A2I. + subu $sp, $sp, 100 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 100 + # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_2 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -8($fp) + # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) + # local_c2i_at_A2I_internal_0 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_1 + lw $t1, 0($fp) + lw $t2, -8($fp) + sub $t1, $t1, $t2 + sw $t1, -4($fp) + # IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_TRUE_3 + # IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_TRUE_3 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_3 + # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) + # local_c2i_at_A2I_internal_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # GOTO label_END_4 +j label_END_4 +label_TRUE_3: + # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) + # local_c2i_at_A2I_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + label_END_4: +# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSE_1 +# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSE_1 +lw $t1, -4($fp) +beq $t1, 0, label_FALSE_1 +# GOTO label_END_2 +j label_END_2 +label_FALSE_1: + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_3 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -16($fp) + # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # local_c2i_at_A2I_internal_2 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_3 + lw $t1, 0($fp) + lw $t2, -16($fp) + sub $t1, $t1, $t2 + sw $t1, -12($fp) + # IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_TRUE_7 + # IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_TRUE_7 + lw $t1, -12($fp) + beq $t1, 0, label_TRUE_7 + # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) + # local_c2i_at_A2I_internal_2 = 0 + li $t1, 0 + sw $t1, -12($fp) + # GOTO label_END_8 +j label_END_8 +label_TRUE_7: + # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) + # local_c2i_at_A2I_internal_2 = 1 + li $t1, 1 + sw $t1, -12($fp) + label_END_8: +# IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_FALSE_5 +# IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_FALSE_5 +lw $t1, -12($fp) +beq $t1, 0, label_FALSE_5 +# GOTO label_END_6 +j label_END_6 +label_FALSE_5: + # LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_4 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -24($fp) + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) + # local_c2i_at_A2I_internal_4 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_5 + lw $t1, 0($fp) + lw $t2, -24($fp) + sub $t1, $t1, $t2 + sw $t1, -20($fp) + # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_11 + # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_11 + lw $t1, -20($fp) + beq $t1, 0, label_TRUE_11 + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # local_c2i_at_A2I_internal_4 = 0 + li $t1, 0 + sw $t1, -20($fp) + # GOTO label_END_12 +j label_END_12 +label_TRUE_11: + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # local_c2i_at_A2I_internal_4 = 1 + li $t1, 1 + sw $t1, -20($fp) + label_END_12: +# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_9 +# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_9 +lw $t1, -20($fp) +beq $t1, 0, label_FALSE_9 +# GOTO label_END_10 +j label_END_10 +label_FALSE_9: + # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_5 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -32($fp) + # LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) + # local_c2i_at_A2I_internal_6 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_7 + lw $t1, 0($fp) + lw $t2, -32($fp) + sub $t1, $t1, $t2 + sw $t1, -28($fp) + # IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_TRUE_15 + # IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_TRUE_15 + lw $t1, -28($fp) + beq $t1, 0, label_TRUE_15 + # LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) + # local_c2i_at_A2I_internal_6 = 0 + li $t1, 0 + sw $t1, -28($fp) + # GOTO label_END_16 +j label_END_16 +label_TRUE_15: + # LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) + # local_c2i_at_A2I_internal_6 = 1 + li $t1, 1 + sw $t1, -28($fp) + label_END_16: +# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSE_13 +# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSE_13 +lw $t1, -28($fp) +beq $t1, 0, label_FALSE_13 +# GOTO label_END_14 +j label_END_14 +label_FALSE_13: + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_6 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -40($fp) + # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # local_c2i_at_A2I_internal_8 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_9 + lw $t1, 0($fp) + lw $t2, -40($fp) + sub $t1, $t1, $t2 + sw $t1, -36($fp) + # IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_TRUE_19 + # IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_TRUE_19 + lw $t1, -36($fp) + beq $t1, 0, label_TRUE_19 + # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) + # local_c2i_at_A2I_internal_8 = 0 + li $t1, 0 + sw $t1, -36($fp) + # GOTO label_END_20 +j label_END_20 +label_TRUE_19: + # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) + # local_c2i_at_A2I_internal_8 = 1 + li $t1, 1 + sw $t1, -36($fp) + label_END_20: +# IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_FALSE_17 +# IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_FALSE_17 +lw $t1, -36($fp) +beq $t1, 0, label_FALSE_17 +# GOTO label_END_18 +j label_END_18 +label_FALSE_17: + # LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_7 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -48($fp) + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) + # local_c2i_at_A2I_internal_10 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_11 + lw $t1, 0($fp) + lw $t2, -48($fp) + sub $t1, $t1, $t2 + sw $t1, -44($fp) + # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_23 + # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_23 + lw $t1, -44($fp) + beq $t1, 0, label_TRUE_23 + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # local_c2i_at_A2I_internal_10 = 0 + li $t1, 0 + sw $t1, -44($fp) + # GOTO label_END_24 +j label_END_24 +label_TRUE_23: + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # local_c2i_at_A2I_internal_10 = 1 + li $t1, 1 + sw $t1, -44($fp) + label_END_24: +# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_21 +# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_21 +lw $t1, -44($fp) +beq $t1, 0, label_FALSE_21 +# GOTO label_END_22 +j label_END_22 +label_FALSE_21: + # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_8 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -56($fp) + # LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) + # local_c2i_at_A2I_internal_12 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_13 + lw $t1, 0($fp) + lw $t2, -56($fp) + sub $t1, $t1, $t2 + sw $t1, -52($fp) + # IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_TRUE_27 + # IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_TRUE_27 + lw $t1, -52($fp) + beq $t1, 0, label_TRUE_27 + # LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) + # local_c2i_at_A2I_internal_12 = 0 + li $t1, 0 + sw $t1, -52($fp) + # GOTO label_END_28 +j label_END_28 +label_TRUE_27: + # LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) + # local_c2i_at_A2I_internal_12 = 1 + li $t1, 1 + sw $t1, -52($fp) + label_END_28: +# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSE_25 +# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSE_25 +lw $t1, -52($fp) +beq $t1, 0, label_FALSE_25 +# GOTO label_END_26 +j label_END_26 +label_FALSE_25: + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_9 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -64($fp) + # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # local_c2i_at_A2I_internal_14 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_15 + lw $t1, 0($fp) + lw $t2, -64($fp) + sub $t1, $t1, $t2 + sw $t1, -60($fp) + # IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_TRUE_31 + # IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_TRUE_31 + lw $t1, -60($fp) + beq $t1, 0, label_TRUE_31 + # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) + # local_c2i_at_A2I_internal_14 = 0 + li $t1, 0 + sw $t1, -60($fp) + # GOTO label_END_32 +j label_END_32 +label_TRUE_31: + # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) + # local_c2i_at_A2I_internal_14 = 1 + li $t1, 1 + sw $t1, -60($fp) + label_END_32: +# IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_FALSE_29 +# IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_FALSE_29 +lw $t1, -60($fp) +beq $t1, 0, label_FALSE_29 +# GOTO label_END_30 +j label_END_30 +label_FALSE_29: + # LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_10 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -72($fp) + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) + # local_c2i_at_A2I_internal_16 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_17 + lw $t1, 0($fp) + lw $t2, -72($fp) + sub $t1, $t1, $t2 + sw $t1, -68($fp) + # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_35 + # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_35 + lw $t1, -68($fp) + beq $t1, 0, label_TRUE_35 + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # local_c2i_at_A2I_internal_16 = 0 + li $t1, 0 + sw $t1, -68($fp) + # GOTO label_END_36 +j label_END_36 +label_TRUE_35: + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # local_c2i_at_A2I_internal_16 = 1 + li $t1, 1 + sw $t1, -68($fp) + label_END_36: +# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_33 +# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_33 +lw $t1, -68($fp) +beq $t1, 0, label_FALSE_33 +# GOTO label_END_34 +j label_END_34 +label_FALSE_33: + # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_11 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -80($fp) + # LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) + # local_c2i_at_A2I_internal_18 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_19 + lw $t1, 0($fp) + lw $t2, -80($fp) + sub $t1, $t1, $t2 + sw $t1, -76($fp) + # IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_TRUE_39 + # IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_TRUE_39 + lw $t1, -76($fp) + beq $t1, 0, label_TRUE_39 + # LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) + # local_c2i_at_A2I_internal_18 = 0 + li $t1, 0 + sw $t1, -76($fp) + # GOTO label_END_40 +j label_END_40 +label_TRUE_39: + # LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) + # local_c2i_at_A2I_internal_18 = 1 + li $t1, 1 + sw $t1, -76($fp) + label_END_40: +# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSE_37 +# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSE_37 +lw $t1, -76($fp) +beq $t1, 0, label_FALSE_37 +# GOTO label_END_38 +j label_END_38 +label_FALSE_37: + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # local_c2i_at_A2I_internal_22 = SELF + sw $s1, -92($fp) + # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # local_c2i_at_A2I_internal_20 = local_c2i_at_A2I_internal_22 + lw $t1, -92($fp) + sw $t1, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # local_c2i_at_A2I_internal_21 = VCALL local_c2i_at_A2I_internal_20 abort + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 16($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_END_38: +label_END_34: +label_END_30: +label_END_26: +label_END_22: +label_END_18: +label_END_14: +label_END_10: +label_END_6: +label_END_2: +# RETURN +# Deallocate stack frame for function function_c2i_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 100 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_i2c_at_A2I implementation. +# @Params: +# 0($fp) = param_i2c_at_A2I_i_0 +function_i2c_at_A2I: + # Allocate stack frame for function function_i2c_at_A2I. + subu $sp, $sp, 104 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 104 + # LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_0 = PARAM param_i2c_at_A2I_i_0 - 0 + lw $t1, 0($fp) + sub $t1, $t1, 0 + sw $t1, -4($fp) + # IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_TRUE_43 + # IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_TRUE_43 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_43 + # LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) + # local_i2c_at_A2I_internal_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # GOTO label_END_44 +j label_END_44 +label_TRUE_43: + # LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) + # local_i2c_at_A2I_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + label_END_44: +# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSE_41 +# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSE_41 +lw $t1, -4($fp) +beq $t1, 0, label_FALSE_41 +# LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_12 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -8($fp) +# GOTO label_END_42 +j label_END_42 +label_FALSE_41: + # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_2 = PARAM param_i2c_at_A2I_i_0 - 1 + lw $t1, 0($fp) + sub $t1, $t1, 1 + sw $t1, -12($fp) + # IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_TRUE_47 + # IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_TRUE_47 + lw $t1, -12($fp) + beq $t1, 0, label_TRUE_47 + # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) + # local_i2c_at_A2I_internal_2 = 0 + li $t1, 0 + sw $t1, -12($fp) + # GOTO label_END_48 +j label_END_48 +label_TRUE_47: + # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) + # local_i2c_at_A2I_internal_2 = 1 + li $t1, 1 + sw $t1, -12($fp) + label_END_48: +# IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_FALSE_45 +# IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_FALSE_45 +lw $t1, -12($fp) +beq $t1, 0, label_FALSE_45 +# LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_13 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -16($fp) +# GOTO label_END_46 +j label_END_46 +label_FALSE_45: + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_4 = PARAM param_i2c_at_A2I_i_0 - 2 + lw $t1, 0($fp) + sub $t1, $t1, 2 + sw $t1, -20($fp) + # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_51 + # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_51 + lw $t1, -20($fp) + beq $t1, 0, label_TRUE_51 + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # local_i2c_at_A2I_internal_4 = 0 + li $t1, 0 + sw $t1, -20($fp) + # GOTO label_END_52 +j label_END_52 +label_TRUE_51: + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # local_i2c_at_A2I_internal_4 = 1 + li $t1, 1 + sw $t1, -20($fp) + label_END_52: +# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_49 +# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_49 +lw $t1, -20($fp) +beq $t1, 0, label_FALSE_49 +# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_14 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -24($fp) +# GOTO label_END_50 +j label_END_50 +label_FALSE_49: + # LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_6 = PARAM param_i2c_at_A2I_i_0 - 3 + lw $t1, 0($fp) + sub $t1, $t1, 3 + sw $t1, -28($fp) + # IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_TRUE_55 + # IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_TRUE_55 + lw $t1, -28($fp) + beq $t1, 0, label_TRUE_55 + # LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) + # local_i2c_at_A2I_internal_6 = 0 + li $t1, 0 + sw $t1, -28($fp) + # GOTO label_END_56 +j label_END_56 +label_TRUE_55: + # LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) + # local_i2c_at_A2I_internal_6 = 1 + li $t1, 1 + sw $t1, -28($fp) + label_END_56: +# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSE_53 +# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSE_53 +lw $t1, -28($fp) +beq $t1, 0, label_FALSE_53 +# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_15 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -32($fp) +# GOTO label_END_54 +j label_END_54 +label_FALSE_53: + # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_8 = PARAM param_i2c_at_A2I_i_0 - 4 + lw $t1, 0($fp) + sub $t1, $t1, 4 + sw $t1, -36($fp) + # IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_TRUE_59 + # IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_TRUE_59 + lw $t1, -36($fp) + beq $t1, 0, label_TRUE_59 + # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) + # local_i2c_at_A2I_internal_8 = 0 + li $t1, 0 + sw $t1, -36($fp) + # GOTO label_END_60 +j label_END_60 +label_TRUE_59: + # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) + # local_i2c_at_A2I_internal_8 = 1 + li $t1, 1 + sw $t1, -36($fp) + label_END_60: +# IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_FALSE_57 +# IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_FALSE_57 +lw $t1, -36($fp) +beq $t1, 0, label_FALSE_57 +# LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_16 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -40($fp) +# GOTO label_END_58 +j label_END_58 +label_FALSE_57: + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_10 = PARAM param_i2c_at_A2I_i_0 - 5 + lw $t1, 0($fp) + sub $t1, $t1, 5 + sw $t1, -44($fp) + # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_63 + # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_63 + lw $t1, -44($fp) + beq $t1, 0, label_TRUE_63 + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # local_i2c_at_A2I_internal_10 = 0 + li $t1, 0 + sw $t1, -44($fp) + # GOTO label_END_64 +j label_END_64 +label_TRUE_63: + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # local_i2c_at_A2I_internal_10 = 1 + li $t1, 1 + sw $t1, -44($fp) + label_END_64: +# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_61 +# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_61 +lw $t1, -44($fp) +beq $t1, 0, label_FALSE_61 +# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_17 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -48($fp) +# GOTO label_END_62 +j label_END_62 +label_FALSE_61: + # LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_12 = PARAM param_i2c_at_A2I_i_0 - 6 + lw $t1, 0($fp) + sub $t1, $t1, 6 + sw $t1, -52($fp) + # IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_TRUE_67 + # IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_TRUE_67 + lw $t1, -52($fp) + beq $t1, 0, label_TRUE_67 + # LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) + # local_i2c_at_A2I_internal_12 = 0 + li $t1, 0 + sw $t1, -52($fp) + # GOTO label_END_68 +j label_END_68 +label_TRUE_67: + # LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) + # local_i2c_at_A2I_internal_12 = 1 + li $t1, 1 + sw $t1, -52($fp) + label_END_68: +# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSE_65 +# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSE_65 +lw $t1, -52($fp) +beq $t1, 0, label_FALSE_65 +# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_18 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -56($fp) +# GOTO label_END_66 +j label_END_66 +label_FALSE_65: + # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_14 = PARAM param_i2c_at_A2I_i_0 - 7 + lw $t1, 0($fp) + sub $t1, $t1, 7 + sw $t1, -60($fp) + # IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_TRUE_71 + # IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_TRUE_71 + lw $t1, -60($fp) + beq $t1, 0, label_TRUE_71 + # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) + # local_i2c_at_A2I_internal_14 = 0 + li $t1, 0 + sw $t1, -60($fp) + # GOTO label_END_72 +j label_END_72 +label_TRUE_71: + # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) + # local_i2c_at_A2I_internal_14 = 1 + li $t1, 1 + sw $t1, -60($fp) + label_END_72: +# IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_FALSE_69 +# IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_FALSE_69 +lw $t1, -60($fp) +beq $t1, 0, label_FALSE_69 +# LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_19 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -64($fp) +# GOTO label_END_70 +j label_END_70 +label_FALSE_69: + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_16 = PARAM param_i2c_at_A2I_i_0 - 8 + lw $t1, 0($fp) + sub $t1, $t1, 8 + sw $t1, -68($fp) + # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_75 + # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_75 + lw $t1, -68($fp) + beq $t1, 0, label_TRUE_75 + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # local_i2c_at_A2I_internal_16 = 0 + li $t1, 0 + sw $t1, -68($fp) + # GOTO label_END_76 +j label_END_76 +label_TRUE_75: + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # local_i2c_at_A2I_internal_16 = 1 + li $t1, 1 + sw $t1, -68($fp) + label_END_76: +# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_73 +# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_73 +lw $t1, -68($fp) +beq $t1, 0, label_FALSE_73 +# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_20 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -72($fp) +# GOTO label_END_74 +j label_END_74 +label_FALSE_73: + # LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_18 = PARAM param_i2c_at_A2I_i_0 - 9 + lw $t1, 0($fp) + sub $t1, $t1, 9 + sw $t1, -76($fp) + # IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_TRUE_79 + # IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_TRUE_79 + lw $t1, -76($fp) + beq $t1, 0, label_TRUE_79 + # LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) + # local_i2c_at_A2I_internal_18 = 0 + li $t1, 0 + sw $t1, -76($fp) + # GOTO label_END_80 +j label_END_80 +label_TRUE_79: + # LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) + # local_i2c_at_A2I_internal_18 = 1 + li $t1, 1 + sw $t1, -76($fp) + label_END_80: +# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSE_77 +# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSE_77 +lw $t1, -76($fp) +beq $t1, 0, label_FALSE_77 +# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_21 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -80($fp) +# GOTO label_END_78 +j label_END_78 +label_FALSE_77: + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # local_i2c_at_A2I_internal_22 = SELF + sw $s1, -92($fp) + # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # local_i2c_at_A2I_internal_20 = local_i2c_at_A2I_internal_22 + lw $t1, -92($fp) + sw $t1, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # local_i2c_at_A2I_internal_21 = VCALL local_i2c_at_A2I_internal_20 abort + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 16($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_22 + sw $t1, 8($v0) + li $t1, 2 + sw $t1, 12($v0) + sw $v0, -96($fp) + label_END_78: +label_END_74: +label_END_70: +label_END_66: +label_END_62: +label_END_58: +label_END_54: +label_END_50: +label_END_46: +label_END_42: +# RETURN +# Deallocate stack frame for function function_i2c_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 104 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_at_A2I implementation. +# @Params: +# 0($fp) = param_a2i_at_A2I_s_0 +function_a2i_at_A2I: + # Allocate stack frame for function function_a2i_at_A2I. + subu $sp, $sp, 96 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 96 + # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_1 = PARAM param_a2i_at_A2I_s_0 + lw $t1, 0($fp) + sw $t1, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) + # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) + # local_a2i_at_A2I_internal_2 = VCALL local_a2i_at_A2I_internal_1 length + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 8($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) + # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) + # local_a2i_at_A2I_internal_0 = local_a2i_at_A2I_internal_2 - 0 + lw $t1, -12($fp) + sub $t1, $t1, 0 + sw $t1, -4($fp) + # IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_TRUE_83 + # IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_TRUE_83 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_83 + # LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) + # local_a2i_at_A2I_internal_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # GOTO label_END_84 +j label_END_84 +label_TRUE_83: + # LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) + # local_a2i_at_A2I_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + label_END_84: +# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSE_81 +# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSE_81 +lw $t1, -4($fp) +beq $t1, 0, label_FALSE_81 +# GOTO label_END_82 +j label_END_82 +label_FALSE_81: + # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_4 = PARAM param_a2i_at_A2I_s_0 + lw $t1, 0($fp) + sw $t1, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 0 + li $t1, 0 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # ARG 1 + li $t1, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # local_a2i_at_A2I_internal_5 = VCALL local_a2i_at_A2I_internal_4 substr + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 4($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_23 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -28($fp) + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + # local_a2i_at_A2I_internal_3 = local_a2i_at_A2I_internal_5 - local_a2i_at_A2I_internal_6 + lw $t1, -24($fp) + lw $t2, -28($fp) + sub $t1, $t1, $t2 + sw $t1, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_87 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_87 + lw $t1, -16($fp) + beq $t1, 0, label_TRUE_87 + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # local_a2i_at_A2I_internal_3 = 0 + li $t1, 0 + sw $t1, -16($fp) + # GOTO label_END_88 +j label_END_88 +label_TRUE_87: + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # local_a2i_at_A2I_internal_3 = 1 + li $t1, 1 + sw $t1, -16($fp) + label_END_88: +# IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_FALSE_85 +# IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_FALSE_85 +lw $t1, -16($fp) +beq $t1, 0, label_FALSE_85 +# GOTO label_END_86 +j label_END_86 +label_FALSE_85: + # LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_8 = PARAM param_a2i_at_A2I_s_0 + lw $t1, 0($fp) + sw $t1, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 0 + li $t1, 0 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # ARG 1 + li $t1, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) + # LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) + # local_a2i_at_A2I_internal_9 = VCALL local_a2i_at_A2I_internal_8 substr + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 4($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_24 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -44($fp) + # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) + # LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) + # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) + # local_a2i_at_A2I_internal_7 = local_a2i_at_A2I_internal_9 - local_a2i_at_A2I_internal_10 + lw $t1, -40($fp) + lw $t2, -44($fp) + sub $t1, $t1, $t2 + sw $t1, -32($fp) + # IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_TRUE_91 + # IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_TRUE_91 + lw $t1, -32($fp) + beq $t1, 0, label_TRUE_91 + # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) + # local_a2i_at_A2I_internal_7 = 0 + li $t1, 0 + sw $t1, -32($fp) + # GOTO label_END_92 +j label_END_92 +label_TRUE_91: + # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) + # local_a2i_at_A2I_internal_7 = 1 + li $t1, 1 + sw $t1, -32($fp) + label_END_92: +# IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_FALSE_89 +# IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_FALSE_89 +lw $t1, -32($fp) +beq $t1, 0, label_FALSE_89 +# LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) +# local_a2i_at_A2I_internal_13 = SELF +sw $s1, -56($fp) +# LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) +# LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) +# local_a2i_at_A2I_internal_11 = local_a2i_at_A2I_internal_13 +lw $t1, -56($fp) +sw $t1, -48($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_14 = PARAM param_a2i_at_A2I_s_0 +lw $t1, 0($fp) +sw $t1, -60($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG 1 +li $t1, 1 +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_17 = PARAM param_a2i_at_A2I_s_0 +lw $t1, 0($fp) +sw $t1, -72($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) +# local_a2i_at_A2I_internal_18 = VCALL local_a2i_at_A2I_internal_17 length +# Save new self pointer in $s1 +lw $s1, -72($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 8($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -76($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) +# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) +# local_a2i_at_A2I_internal_16 = local_a2i_at_A2I_internal_18 - 1 +lw $t1, -76($fp) +sub $t1, $t1, 1 +sw $t1, -68($fp) +# ARG local_a2i_at_A2I_internal_16 +# LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) +lw $t1, -68($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) +# LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) +# local_a2i_at_A2I_internal_15 = VCALL local_a2i_at_A2I_internal_14 substr +# Save new self pointer in $s1 +lw $s1, -60($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 4($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -64($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_at_A2I_internal_15 +# LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) +lw $t1, -64($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) +# LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) +# local_a2i_at_A2I_internal_12 = VCALL local_a2i_at_A2I_internal_11 a2i_aux +# Save new self pointer in $s1 +lw $s1, -48($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 24($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -52($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# GOTO label_END_90 +j label_END_90 +label_FALSE_89: + # LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) + # local_a2i_at_A2I_internal_21 = SELF + sw $s1, -88($fp) + # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) + # LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) + # local_a2i_at_A2I_internal_19 = local_a2i_at_A2I_internal_21 + lw $t1, -88($fp) + sw $t1, -80($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_a2i_at_A2I_s_0 + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + lw $t1, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) + # LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) + # local_a2i_at_A2I_internal_20 = VCALL local_a2i_at_A2I_internal_19 a2i_aux + # Save new self pointer in $s1 + lw $s1, -80($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 24($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -84($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_END_90: +label_END_86: +label_END_82: +# RETURN +# Deallocate stack frame for function function_a2i_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 96 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_aux_at_A2I implementation. +# @Params: +# 0($fp) = param_a2i_aux_at_A2I_s_0 +function_a2i_aux_at_A2I: + # Allocate stack frame for function function_a2i_aux_at_A2I. + subu $sp, $sp, 64 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 64 + # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) + # local_a2i_aux_at_A2I_int_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # LOCAL local_a2i_aux_at_A2I_internal_2 --> -12($fp) + # PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) + # local_a2i_aux_at_A2I_internal_2 = PARAM param_a2i_aux_at_A2I_s_0 + lw $t1, 0($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_aux_at_A2I_internal_2 --> -12($fp) + # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) + # local_a2i_aux_at_A2I_internal_3 = VCALL local_a2i_aux_at_A2I_internal_2 length + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 8($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_aux_at_A2I_j_1 --> -8($fp) + # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) + # local_a2i_aux_at_A2I_j_1 = local_a2i_aux_at_A2I_internal_3 + lw $t1, -16($fp) + sw $t1, -8($fp) + # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) + # local_a2i_aux_at_A2I_i_4 = 0 + li $t1, 0 + sw $t1, -20($fp) + label_WHILE_93: + # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) + # LOCAL local_a2i_aux_at_A2I_j_1 --> -8($fp) + # local_a2i_aux_at_A2I_internal_5 = local_a2i_aux_at_A2I_i_4 - local_a2i_aux_at_A2I_j_1 + lw $t1, -20($fp) + lw $t2, -8($fp) + sub $t1, $t1, $t2 + sw $t1, -24($fp) + # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 + # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 + lw $t1, -24($fp) + bgt $t1, 0, label_FALSE_95 + # IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 + # IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 + lw $t1, -24($fp) + beq $t1, 0, label_FALSE_95 + # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) + # local_a2i_aux_at_A2I_internal_5 = 1 + li $t1, 1 + sw $t1, -24($fp) + # GOTO label_END_96 +j label_END_96 +label_FALSE_95: + # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) + # local_a2i_aux_at_A2I_internal_5 = 0 + li $t1, 0 + sw $t1, -24($fp) + label_END_96: +# IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_WHILE_END_94 +# IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_WHILE_END_94 +lw $t1, -24($fp) +beq $t1, 0, label_WHILE_END_94 +# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) +# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) +# local_a2i_aux_at_A2I_internal_7 = local_a2i_aux_at_A2I_int_0 * 10 +lw $t1, -4($fp) +mul $t1, $t1, 10 +sw $t1, -32($fp) +# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) +# local_a2i_aux_at_A2I_internal_10 = SELF +sw $s1, -44($fp) +# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) +# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) +# local_a2i_aux_at_A2I_internal_8 = local_a2i_aux_at_A2I_internal_10 +lw $t1, -44($fp) +sw $t1, -36($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) +# PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) +# local_a2i_aux_at_A2I_internal_11 = PARAM param_a2i_aux_at_A2I_s_0 +lw $t1, 0($fp) +sw $t1, -48($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_a2i_aux_at_A2I_i_4 +# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) +lw $t1, -20($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# ARG 1 +li $t1, 1 +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) +# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) +# local_a2i_aux_at_A2I_internal_12 = VCALL local_a2i_aux_at_A2I_internal_11 substr +# Save new self pointer in $s1 +lw $s1, -48($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 4($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -52($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_aux_at_A2I_internal_12 +# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) +lw $t1, -52($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) +# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) +# local_a2i_aux_at_A2I_internal_9 = VCALL local_a2i_aux_at_A2I_internal_8 c2i +# Save new self pointer in $s1 +lw $s1, -36($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 12($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -40($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) +# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) +# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) +# local_a2i_aux_at_A2I_internal_6 = local_a2i_aux_at_A2I_internal_7 + local_a2i_aux_at_A2I_internal_9 +lw $t1, -32($fp) +lw $t2, -40($fp) +add $t1, $t1, $t2 +sw $t1, -28($fp) +# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) +# local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_6 +lw $t1, -28($fp) +sw $t1, -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) +# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) +# local_a2i_aux_at_A2I_internal_13 = local_a2i_aux_at_A2I_i_4 + 1 +lw $t1, -20($fp) +add $t1, $t1, 1 +sw $t1, -56($fp) +# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) +# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) +# local_a2i_aux_at_A2I_i_4 = local_a2i_aux_at_A2I_internal_13 +lw $t1, -56($fp) +sw $t1, -20($fp) +# GOTO label_WHILE_93 +j label_WHILE_93 +label_WHILE_END_94: + # RETURN local_a2i_aux_at_A2I_int_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_a2i_aux_at_A2I. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 64 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_i2a_at_A2I implementation. +# @Params: +# 0($fp) = param_i2a_at_A2I_i_0 +function_i2a_at_A2I: + # Allocate stack frame for function function_i2a_at_A2I. + subu $sp, $sp, 60 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 60 + # LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # local_i2a_at_A2I_internal_0 = PARAM param_i2a_at_A2I_i_0 - 0 + lw $t1, 0($fp) + sub $t1, $t1, 0 + sw $t1, -4($fp) + # IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_TRUE_99 + # IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_TRUE_99 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_99 + # LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) + # local_i2a_at_A2I_internal_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # GOTO label_END_100 +j label_END_100 +label_TRUE_99: + # LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) + # local_i2a_at_A2I_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + label_END_100: +# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSE_97 +# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSE_97 +lw $t1, -4($fp) +beq $t1, 0, label_FALSE_97 +# LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_25 +sw $t1, 8($v0) +li $t1, 3 +sw $t1, 12($v0) +sw $v0, -8($fp) +# GOTO label_END_98 +j label_END_98 +label_FALSE_97: + # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # local_i2a_at_A2I_internal_2 = 0 - PARAM param_i2a_at_A2I_i_0 + li $t1, 0 + lw $t2, 0($fp) + sub $t1, $t1, $t2 + sw $t1, -12($fp) + # IF_GREATER_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 + # IF_GREATER_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 + lw $t1, -12($fp) + bgt $t1, 0, label_FALSE_103 + # IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 + # IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 + lw $t1, -12($fp) + beq $t1, 0, label_FALSE_103 + # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) + # local_i2a_at_A2I_internal_2 = 1 + li $t1, 1 + sw $t1, -12($fp) + # GOTO label_END_104 +j label_END_104 +label_FALSE_103: + # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) + # local_i2a_at_A2I_internal_2 = 0 + li $t1, 0 + sw $t1, -12($fp) + label_END_104: +# IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_101 +# IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_101 +lw $t1, -12($fp) +beq $t1, 0, label_FALSE_101 +# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) +# local_i2a_at_A2I_internal_5 = SELF +sw $s1, -24($fp) +# LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) +# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) +# local_i2a_at_A2I_internal_3 = local_i2a_at_A2I_internal_5 +lw $t1, -24($fp) +sw $t1, -16($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_i2a_at_A2I_i_0 +# PARAM param_i2a_at_A2I_i_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) +# LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) +# local_i2a_at_A2I_internal_4 = VCALL local_i2a_at_A2I_internal_3 i2a_aux +# Save new self pointer in $s1 +lw $s1, -16($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 32($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -20($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# GOTO label_END_102 +j label_END_102 +label_FALSE_101: + # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_26 + sw $t1, 8($v0) + li $t1, 3 + sw $t1, 12($v0) + sw $v0, -36($fp) + # LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) + # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) + # local_i2a_at_A2I_internal_6 = local_i2a_at_A2I_internal_8 + lw $t1, -36($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) + # local_i2a_at_A2I_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) + # LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) + # local_i2a_at_A2I_internal_9 = local_i2a_at_A2I_internal_11 + lw $t1, -48($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # local_i2a_at_A2I_internal_12 = PARAM param_i2a_at_A2I_i_0 * 1 + lw $t1, 0($fp) + mul $t1, $t1, 1 + sw $t1, -52($fp) + # ARG local_i2a_at_A2I_internal_12 + # LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) + lw $t1, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) + # LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) + # local_i2a_at_A2I_internal_10 = VCALL local_i2a_at_A2I_internal_9 i2a_aux + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 32($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_i2a_at_A2I_internal_10 + # LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) + lw $t1, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) + # LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) + # local_i2a_at_A2I_internal_7 = VCALL local_i2a_at_A2I_internal_6 concat + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_END_102: +label_END_98: +# RETURN +# Deallocate stack frame for function function_i2a_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 60 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_i2a_aux_at_A2I implementation. +# @Params: +# 0($fp) = param_i2a_aux_at_A2I_i_0 +function_i2a_aux_at_A2I: + # Allocate stack frame for function function_i2a_aux_at_A2I. + subu $sp, $sp, 64 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 64 + # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # local_i2a_aux_at_A2I_internal_0 = PARAM param_i2a_aux_at_A2I_i_0 - 0 + lw $t1, 0($fp) + sub $t1, $t1, 0 + sw $t1, -4($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_TRUE_107 + # IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_TRUE_107 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_107 + # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) + # local_i2a_aux_at_A2I_internal_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # GOTO label_END_108 +j label_END_108 +label_TRUE_107: + # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) + # local_i2a_aux_at_A2I_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + label_END_108: +# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSE_105 +# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSE_105 +lw $t1, -4($fp) +beq $t1, 0, label_FALSE_105 +# LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +la $t1, data_27 +sw $t1, 8($v0) +li $t1, 2 +sw $t1, 12($v0) +sw $v0, -8($fp) +# GOTO label_END_106 +j label_END_106 +label_FALSE_105: + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # local_i2a_aux_at_A2I_internal_3 = PARAM param_i2a_aux_at_A2I_i_0 / 10 + lw $t1, 0($fp) + div $t1, $t1, 10 + sw $t1, -16($fp) + # LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # local_i2a_aux_at_A2I_next_2 = local_i2a_aux_at_A2I_internal_3 + lw $t1, -16($fp) + sw $t1, -12($fp) + # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) + # local_i2a_aux_at_A2I_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) + # local_i2a_aux_at_A2I_internal_6 = local_i2a_aux_at_A2I_internal_8 + lw $t1, -36($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_i2a_aux_at_A2I_next_2 + # LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) + lw $t1, -12($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) + # local_i2a_aux_at_A2I_internal_7 = VCALL local_i2a_aux_at_A2I_internal_6 i2a_aux + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 32($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) + # local_i2a_aux_at_A2I_internal_4 = local_i2a_aux_at_A2I_internal_7 + lw $t1, -32($fp) + sw $t1, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) + # local_i2a_aux_at_A2I_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) + # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) + # local_i2a_aux_at_A2I_internal_9 = local_i2a_aux_at_A2I_internal_11 + lw $t1, -48($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) + # LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) + # local_i2a_aux_at_A2I_internal_13 = local_i2a_aux_at_A2I_next_2 * 10 + lw $t1, -12($fp) + mul $t1, $t1, 10 + sw $t1, -56($fp) + # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) + # local_i2a_aux_at_A2I_internal_12 = PARAM param_i2a_aux_at_A2I_i_0 - local_i2a_aux_at_A2I_internal_13 + lw $t1, 0($fp) + lw $t2, -56($fp) + sub $t1, $t1, $t2 + sw $t1, -52($fp) + # ARG local_i2a_aux_at_A2I_internal_12 + # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) + lw $t1, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) + # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) + # local_i2a_aux_at_A2I_internal_10 = VCALL local_i2a_aux_at_A2I_internal_9 i2c + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 16($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_i2a_aux_at_A2I_internal_10 + # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) + lw $t1, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + # LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) + # local_i2a_aux_at_A2I_internal_5 = VCALL local_i2a_aux_at_A2I_internal_4 concat + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_END_106: +# RETURN +# Deallocate stack frame for function function_i2a_aux_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 64 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 100 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 100 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE A2I + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, A2I + sw $t1, 0($v0) + la $t1, A2I_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t1, -16($fp) + sw $t1, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_28 + sw $t1, 8($v0) + li $t1, 8 + sw $t1, 12($v0) + sw $v0, -20($fp) + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t1, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 a2i + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 20($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_a_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_a_0 = local_main_at_Main_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = ALLOCATE A2I + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, A2I + sw $t1, 0($v0) + la $t1, A2I_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -36($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 + lw $t1, -36($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 678987 + li $t1, 678987 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 i2a + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 28($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_b_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_b_5 = local_main_at_Main_internal_7 + lw $t1, -32($fp) + sw $t1, -24($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 + lw $t1, -48($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_a_0 + # LOCAL local_main_at_Main_a_0 --> -4($fp) + lw $t1, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_int + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 4($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 + lw $t1, -60($fp) + sw $t1, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_29 + sw $t1, 8($v0) + li $t1, 6 + sw $t1, 12($v0) + sw $v0, -64($fp) + # ARG local_main_at_Main_internal_15 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + lw $t1, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 + lw $t1, -76($fp) + sw $t1, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_b_5 + # LOCAL local_main_at_Main_b_5 --> -24($fp) + lw $t1, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_21 = SELF + sw $s1, -88($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 + lw $t1, -88($fp) + sw $t1, -80($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_30 + sw $t1, 8($v0) + li $t1, 4 + sw $t1, 12($v0) + sw $v0, -92($fp) + # ARG local_main_at_Main_internal_22 + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + lw $t1, -92($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 out_string + # Save new self pointer in $s1 + lw $s1, -80($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -84($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_20 + lw $v0, -84($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 100 + jr $ra + # Function END + diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips index 07d8aa31..5f4044be 100644 --- a/tests/codegen/fib.mips +++ b/tests/codegen/fib.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 16:05:42 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 01:31:54 2020 # School of Math and Computer Science, University of Havana # @@ -23,96 +23,96 @@ IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, functio # **** Type RECORD for type IO **** IO_start: -IO_vtable_pointer: .word IO_vtable -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# - - -# **** Type RECORD for type Object **** -Object_start: -Object_vtable_pointer: .word Object_vtable -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String -# - - -# **** Type RECORD for type String **** -String_start: -String_vtable_pointer: .word String_vtable -String_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main, function_fib_at_Main -# - - -# **** Type RECORD for type Main **** -Main_start: -Main_vtable_pointer: .word Main_vtable -Main_end: -# - - -data_0: .asciiz "" -# - - -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -data_2: .asciiz "Enter n to find nth fibonacci number!\n" -# - - -data_3: .asciiz "\n" -# + IO_vtable_pointer: .word IO_vtable + IO_end: + # + + + # **** VTABLE for type Object **** + Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object + # + + + # **** Type RECORD for type Object **** + Object_start: + Object_vtable_pointer: .word Object_vtable + Object_end: + # + + + # **** VTABLE for type String **** + String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String + # + + + # **** Type RECORD for type String **** + String_start: + String_vtable_pointer: .word String_vtable + String_end: + # + + + # **** VTABLE for type Main **** + Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main, function_fib_at_Main + # + + + # **** Type RECORD for type Main **** + Main_start: + Main_vtable_pointer: .word Main_vtable + Main_end: + # + + + data_0: .asciiz "" + # + + + __Object_Object_tdt_entry__: .word 0 + __Object_Int_tdt_entry__: .word 1 + __Object_String_tdt_entry__: .word 1 + __Object_Bool_tdt_entry__: .word 1 + __Object_IO_tdt_entry__: .word 1 + __Object_Main_tdt_entry__: .word 2 + __Int_Object_tdt_entry__: .word -1 + __Int_Int_tdt_entry__: .word 0 + __Int_String_tdt_entry__: .word -1 + __Int_Bool_tdt_entry__: .word -1 + __Int_IO_tdt_entry__: .word -1 + __Int_Main_tdt_entry__: .word -1 + __String_Object_tdt_entry__: .word -1 + __String_Int_tdt_entry__: .word -1 + __String_String_tdt_entry__: .word 0 + __String_Bool_tdt_entry__: .word -1 + __String_IO_tdt_entry__: .word -1 + __String_Main_tdt_entry__: .word -1 + __Bool_Object_tdt_entry__: .word -1 + __Bool_Int_tdt_entry__: .word -1 + __Bool_String_tdt_entry__: .word -1 + __Bool_Bool_tdt_entry__: .word 0 + __Bool_IO_tdt_entry__: .word -1 + __Bool_Main_tdt_entry__: .word -1 + __IO_Object_tdt_entry__: .word -1 + __IO_Int_tdt_entry__: .word -1 + __IO_String_tdt_entry__: .word -1 + __IO_Bool_tdt_entry__: .word -1 + __IO_IO_tdt_entry__: .word 0 + __IO_Main_tdt_entry__: .word 1 + __Main_Object_tdt_entry__: .word -1 + __Main_Int_tdt_entry__: .word -1 + __Main_String_tdt_entry__: .word -1 + __Main_Bool_tdt_entry__: .word -1 + __Main_IO_tdt_entry__: .word -1 + __Main_Main_tdt_entry__: .word 0 + # + + + data_2: .asciiz "Enter n to find nth fibonacci number!\n" + # + + + data_3: .asciiz "\n" + # .text @@ -320,19 +320,56 @@ function_substr_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t1, 8($s1) + lw $t2, 8($s1) + lw $t3, 4($fp) + addu $t1, $t1, $t3 + lw $t3, 0($fp) + addu $t2, $t2, $t3 + subu $a0, $t2, $t1 + move $t4, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t3, $v0 + substr_loop: + beq $t1, $t2, substr_end + lb $a0, 0($t1) + sb $a0, 0($t3) + addu $t1, $t1, 1 + addu $t3, $t3, 1 + j substr_loop + substr_end: + sb $zero, 0($t3) + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + sw $t2, 8($v0) + sw $s0, 12($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END # function_length_at_String implementation. @@ -345,7 +382,7 @@ function_length_at_String: addu $fp, $sp, 32 # local_length_at_String_internal_0 = GETATTRIBUTE length String # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t1, 8($s1) + lw $t1, 12($s1) sw $t1, -4($fp) # RETURN local_length_at_String_internal_0 lw $v0, -4($fp) @@ -435,23 +472,23 @@ function_main_at_Main: sw $v0, -16($fp) # ARG local_main_at_Main_internal_3 # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t2, -16($fp) + lw $t1, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 0($t3) + lw $t3, 0($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -462,8 +499,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_4 --> -20($fp) # LOCAL local_main_at_Main_internal_6 --> -28($fp) # local_main_at_Main_internal_4 = local_main_at_Main_internal_6 - lw $t2, -28($fp) - sw $t2, -20($fp) + lw $t1, -28($fp) + sw $t1, -20($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -473,8 +510,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_7 --> -32($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t2, -40($fp) - sw $t2, -32($fp) + lw $t1, -40($fp) + sw $t1, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -484,8 +521,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_10 --> -44($fp) # LOCAL local_main_at_Main_internal_12 --> -52($fp) # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 - lw $t2, -52($fp) - sw $t2, -44($fp) + lw $t1, -52($fp) + sw $t1, -44($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -495,59 +532,59 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -44($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 12($t3) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -48($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_main_at_Main_internal_11 # LOCAL local_main_at_Main_internal_11 --> -48($fp) - lw $t2, -48($fp) + lw $t1, -48($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 fib # Save new self pointer in $s1 lw $s1, -32($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 32($t3) + lw $t3, 32($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_main_at_Main_internal_8 # LOCAL local_main_at_Main_internal_8 --> -36($fp) - lw $t2, -36($fp) + lw $t1, -36($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # LOCAL local_main_at_Main_internal_4 --> -20($fp) # LOCAL local_main_at_Main_internal_5 --> -24($fp) # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 out_int # Save new self pointer in $s1 lw $s1, -20($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 4($t3) + lw $t3, 4($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -558,8 +595,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_13 --> -56($fp) # LOCAL local_main_at_Main_internal_15 --> -64($fp) # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 - lw $t2, -64($fp) - sw $t2, -56($fp) + lw $t1, -64($fp) + sw $t1, -56($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -569,34 +606,34 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - la $t2, data_3 - sw $t2, 8($v0) - li $t2, 4 - sw $t2, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_3 + sw $t1, 8($v0) + li $t1, 4 + sw $t1, 12($v0) sw $v0, -68($fp) # ARG local_main_at_Main_internal_16 # LOCAL local_main_at_Main_internal_16 --> -68($fp) - lw $t3, -68($fp) + lw $t1, -68($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t1, 0($sp) # LOCAL local_main_at_Main_internal_13 --> -56($fp) # LOCAL local_main_at_Main_internal_14 --> -60($fp) # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 out_string # Save new self pointer in $s1 lw $s1, -56($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 0($t4) + lw $t3, 0($t2) # Call function. Result is on $v0 - jalr $t5 + jalr $t3 sw $v0, -60($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -625,107 +662,107 @@ function_fib_at_Main: addu $fp, $sp, 36 # LOCAL local_fib_at_Main_a_0 --> -4($fp) # local_fib_at_Main_a_0 = 1 - li $t3, 1 - sw $t3, -4($fp) + li $t1, 1 + sw $t1, -4($fp) # LOCAL local_fib_at_Main_b_1 --> -8($fp) # local_fib_at_Main_b_1 = 0 - li $t3, 0 - sw $t3, -8($fp) + li $t1, 0 + sw $t1, -8($fp) # LOCAL local_fib_at_Main_c_2 --> -12($fp) # local_fib_at_Main_c_2 = 0 - li $t3, 0 - sw $t3, -12($fp) + li $t1, 0 + sw $t1, -12($fp) label_WHILE_1: # LOCAL local_fib_at_Main_internal_3 --> -16($fp) # PARAM param_fib_at_Main_i_0 --> 0($fp) # local_fib_at_Main_internal_3 = PARAM param_fib_at_Main_i_0 - 0 - lw $t3, 0($fp) - sub $t3, $t3, 0 - sw $t3, -16($fp) + lw $t1, 0($fp) + sub $t1, $t1, 0 + sw $t1, -16($fp) # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 - lw $t3, -16($fp) - beq $t3, 0, label_TRUE_3 + lw $t1, -16($fp) + beq $t1, 0, label_TRUE_3 # LOCAL local_fib_at_Main_internal_3 --> -16($fp) # local_fib_at_Main_internal_3 = 0 - li $t3, 0 - sw $t3, -16($fp) + li $t1, 0 + sw $t1, -16($fp) # GOTO label_END_4 - j label_END_4 +j label_END_4 label_TRUE_3: # LOCAL local_fib_at_Main_internal_3 --> -16($fp) # local_fib_at_Main_internal_3 = 1 - li $t3, 1 - sw $t3, -16($fp) + li $t1, 1 + sw $t1, -16($fp) label_END_4: - # IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 - # IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 - lw $t3, -16($fp) - beq $t3, 0, label_FALSE_5 +# IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 +# IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 +lw $t1, -16($fp) +beq $t1, 0, label_FALSE_5 +# LOCAL local_fib_at_Main_internal_4 --> -20($fp) +# local_fib_at_Main_internal_4 = 0 +li $t1, 0 +sw $t1, -20($fp) +# GOTO label_NOT_END_6 +j label_NOT_END_6 +label_FALSE_5: # LOCAL local_fib_at_Main_internal_4 --> -20($fp) - # local_fib_at_Main_internal_4 = 0 - li $t3, 0 - sw $t3, -20($fp) - # GOTO label_NOT_END_6 - j label_NOT_END_6 - label_FALSE_5: - # LOCAL local_fib_at_Main_internal_4 --> -20($fp) - # local_fib_at_Main_internal_4 = 1 - li $t3, 1 - sw $t3, -20($fp) - label_NOT_END_6: - # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 - # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 - lw $t3, -20($fp) - beq $t3, 0, label_WHILE_END_2 - # LOCAL local_fib_at_Main_internal_5 --> -24($fp) - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # LOCAL local_fib_at_Main_b_1 --> -8($fp) - # local_fib_at_Main_internal_5 = local_fib_at_Main_a_0 + local_fib_at_Main_b_1 - lw $t3, -4($fp) - lw $t4, -8($fp) - add $t3, $t3, $t4 - sw $t3, -24($fp) - # LOCAL local_fib_at_Main_c_2 --> -12($fp) - # LOCAL local_fib_at_Main_internal_5 --> -24($fp) - # local_fib_at_Main_c_2 = local_fib_at_Main_internal_5 - lw $t3, -24($fp) - sw $t3, -12($fp) - # LOCAL local_fib_at_Main_internal_6 --> -28($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # local_fib_at_Main_internal_6 = PARAM param_fib_at_Main_i_0 - 1 - lw $t3, 0($fp) - sub $t3, $t3, 1 - sw $t3, -28($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # LOCAL local_fib_at_Main_internal_6 --> -28($fp) - # PARAM param_fib_at_Main_i_0 = local_fib_at_Main_internal_6 - lw $t3, -28($fp) - sw $t3, 0($fp) - # LOCAL local_fib_at_Main_b_1 --> -8($fp) - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # local_fib_at_Main_b_1 = local_fib_at_Main_a_0 - lw $t3, -4($fp) - sw $t3, -8($fp) - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # LOCAL local_fib_at_Main_c_2 --> -12($fp) - # local_fib_at_Main_a_0 = local_fib_at_Main_c_2 - lw $t3, -12($fp) - sw $t3, -4($fp) - # GOTO label_WHILE_1 - j label_WHILE_1 - label_WHILE_END_2: - # RETURN local_fib_at_Main_c_2 - lw $v0, -12($fp) - # Deallocate stack frame for function function_fib_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 36 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END + # local_fib_at_Main_internal_4 = 1 + li $t1, 1 + sw $t1, -20($fp) + label_NOT_END_6: + # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 + # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 + lw $t1, -20($fp) + beq $t1, 0, label_WHILE_END_2 + # LOCAL local_fib_at_Main_internal_5 --> -24($fp) + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # LOCAL local_fib_at_Main_b_1 --> -8($fp) + # local_fib_at_Main_internal_5 = local_fib_at_Main_a_0 + local_fib_at_Main_b_1 + lw $t1, -4($fp) + lw $t2, -8($fp) + add $t1, $t1, $t2 + sw $t1, -24($fp) + # LOCAL local_fib_at_Main_c_2 --> -12($fp) + # LOCAL local_fib_at_Main_internal_5 --> -24($fp) + # local_fib_at_Main_c_2 = local_fib_at_Main_internal_5 + lw $t1, -24($fp) + sw $t1, -12($fp) + # LOCAL local_fib_at_Main_internal_6 --> -28($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # local_fib_at_Main_internal_6 = PARAM param_fib_at_Main_i_0 - 1 + lw $t1, 0($fp) + sub $t1, $t1, 1 + sw $t1, -28($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # LOCAL local_fib_at_Main_internal_6 --> -28($fp) + # PARAM param_fib_at_Main_i_0 = local_fib_at_Main_internal_6 + lw $t1, -28($fp) + sw $t1, 0($fp) + # LOCAL local_fib_at_Main_b_1 --> -8($fp) + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # local_fib_at_Main_b_1 = local_fib_at_Main_a_0 + lw $t1, -4($fp) + sw $t1, -8($fp) + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # LOCAL local_fib_at_Main_c_2 --> -12($fp) + # local_fib_at_Main_a_0 = local_fib_at_Main_c_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # GOTO label_WHILE_1 + j label_WHILE_1 + label_WHILE_END_2: + # RETURN local_fib_at_Main_c_2 + lw $v0, -12($fp) + # Deallocate stack frame for function function_fib_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 36 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips index 0f99181d..15afc26c 100644 --- a/tests/codegen/hello_world.mips +++ b/tests/codegen/hello_world.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 16:05:41 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 01:31:53 2020 # School of Math and Computer Science, University of Havana # @@ -23,92 +23,92 @@ IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, functio # **** Type RECORD for type IO **** IO_start: -IO_vtable_pointer: .word IO_vtable -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# - - -# **** Type RECORD for type Object **** -Object_start: -Object_vtable_pointer: .word Object_vtable -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String -# - - -# **** Type RECORD for type String **** -String_start: -String_vtable_pointer: .word String_vtable -String_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main -# - - -# **** Type RECORD for type Main **** -Main_start: -Main_vtable_pointer: .word Main_vtable -Main_end: -# - - -data_0: .asciiz "" -# - - -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -data_2: .asciiz "Hello, World.\n" -# + IO_vtable_pointer: .word IO_vtable + IO_end: + # + + + # **** VTABLE for type Object **** + Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object + # + + + # **** Type RECORD for type Object **** + Object_start: + Object_vtable_pointer: .word Object_vtable + Object_end: + # + + + # **** VTABLE for type String **** + String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String + # + + + # **** Type RECORD for type String **** + String_start: + String_vtable_pointer: .word String_vtable + String_end: + # + + + # **** VTABLE for type Main **** + Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main + # + + + # **** Type RECORD for type Main **** + Main_start: + Main_vtable_pointer: .word Main_vtable + Main_end: + # + + + data_0: .asciiz "" + # + + + __Object_Object_tdt_entry__: .word 0 + __Object_Int_tdt_entry__: .word 1 + __Object_String_tdt_entry__: .word 1 + __Object_Bool_tdt_entry__: .word 1 + __Object_IO_tdt_entry__: .word 1 + __Object_Main_tdt_entry__: .word 2 + __Int_Object_tdt_entry__: .word -1 + __Int_Int_tdt_entry__: .word 0 + __Int_String_tdt_entry__: .word -1 + __Int_Bool_tdt_entry__: .word -1 + __Int_IO_tdt_entry__: .word -1 + __Int_Main_tdt_entry__: .word -1 + __String_Object_tdt_entry__: .word -1 + __String_Int_tdt_entry__: .word -1 + __String_String_tdt_entry__: .word 0 + __String_Bool_tdt_entry__: .word -1 + __String_IO_tdt_entry__: .word -1 + __String_Main_tdt_entry__: .word -1 + __Bool_Object_tdt_entry__: .word -1 + __Bool_Int_tdt_entry__: .word -1 + __Bool_String_tdt_entry__: .word -1 + __Bool_Bool_tdt_entry__: .word 0 + __Bool_IO_tdt_entry__: .word -1 + __Bool_Main_tdt_entry__: .word -1 + __IO_Object_tdt_entry__: .word -1 + __IO_Int_tdt_entry__: .word -1 + __IO_String_tdt_entry__: .word -1 + __IO_Bool_tdt_entry__: .word -1 + __IO_IO_tdt_entry__: .word 0 + __IO_Main_tdt_entry__: .word 1 + __Main_Object_tdt_entry__: .word -1 + __Main_Int_tdt_entry__: .word -1 + __Main_String_tdt_entry__: .word -1 + __Main_Bool_tdt_entry__: .word -1 + __Main_IO_tdt_entry__: .word -1 + __Main_Main_tdt_entry__: .word 0 + # + + + data_2: .asciiz "Hello, World.\n" + # .text @@ -316,19 +316,56 @@ function_substr_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t1, 8($s1) + lw $t2, 8($s1) + lw $t3, 4($fp) + addu $t1, $t1, $t3 + lw $t3, 0($fp) + addu $t2, $t2, $t3 + subu $a0, $t2, $t1 + move $t4, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t3, $v0 + substr_loop: + beq $t1, $t2, substr_end + lb $a0, 0($t1) + sb $a0, 0($t3) + addu $t1, $t1, 1 + addu $t3, $t3, 1 + j substr_loop + substr_end: + sb $zero, 0($t3) + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + sw $t2, 8($v0) + sw $s0, 12($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END # function_length_at_String implementation. @@ -341,7 +378,7 @@ function_length_at_String: addu $fp, $sp, 32 # local_length_at_String_internal_0 = GETATTRIBUTE length String # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t1, 8($s1) + lw $t1, 12($s1) sw $t1, -4($fp) # RETURN local_length_at_String_internal_0 lw $v0, -4($fp) @@ -431,23 +468,23 @@ function_main_at_Main: sw $v0, -16($fp) # ARG local_main_at_Main_internal_3 # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t2, -16($fp) + lw $t1, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 0($t3) + lw $t3, 0($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips index cafa6126..a81e7370 100644 --- a/tests/codegen/io.mips +++ b/tests/codegen/io.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Thu Dec 3 16:05:42 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 01:31:54 2020 # School of Math and Computer Science, University of Havana # @@ -31,220 +31,220 @@ IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, functio # **** Type RECORD for type IO **** IO_start: -IO_vtable_pointer: .word IO_vtable -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# - - -# **** Type RECORD for type Object **** -Object_start: -Object_vtable_pointer: .word Object_vtable -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String -# - - -# **** Type RECORD for type String **** -String_start: -String_vtable_pointer: .word String_vtable -String_end: -# - - -# **** VTABLE for type A **** -A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A -# - - -# **** Type RECORD for type A **** -A_start: -A_vtable_pointer: .word A_vtable -A_end: -# - - -# **** VTABLE for type B **** -B_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A, function_out_b_at_B -# - - -# **** Type RECORD for type B **** -B_start: -B_vtable_pointer: .word B_vtable -B_end: -# - - -# **** VTABLE for type C **** -C_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_c_at_C -# - - -# **** Type RECORD for type C **** -C_start: -C_vtable_pointer: .word C_vtable -C_end: -# - - -# **** VTABLE for type D **** -D_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_c_at_C, function_out_d_at_D -# + IO_vtable_pointer: .word IO_vtable + IO_end: + # -# **** Type RECORD for type D **** -D_start: -D_vtable_pointer: .word D_vtable -D_end: -# + # **** VTABLE for type Object **** + Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object + # -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main -# + # **** Type RECORD for type Object **** + Object_start: + Object_vtable_pointer: .word Object_vtable + Object_end: + # -# **** Type RECORD for type Main **** -Main_start: -Main_vtable_pointer: .word Main_vtable -Main_end: -# + # **** VTABLE for type String **** + String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String + # -data_0: .asciiz "" -# + # **** Type RECORD for type String **** + String_start: + String_vtable_pointer: .word String_vtable + String_end: + # -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_A_tdt_entry__: .word 1 -__Object_B_tdt_entry__: .word 2 -__Object_C_tdt_entry__: .word 2 -__Object_D_tdt_entry__: .word 3 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_A_tdt_entry__: .word -1 -__Int_B_tdt_entry__: .word -1 -__Int_C_tdt_entry__: .word -1 -__Int_D_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_A_tdt_entry__: .word -1 -__String_B_tdt_entry__: .word -1 -__String_C_tdt_entry__: .word -1 -__String_D_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_A_tdt_entry__: .word -1 -__Bool_B_tdt_entry__: .word -1 -__Bool_C_tdt_entry__: .word -1 -__Bool_D_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_A_tdt_entry__: .word -1 -__IO_B_tdt_entry__: .word -1 -__IO_C_tdt_entry__: .word 1 -__IO_D_tdt_entry__: .word 2 -__IO_Main_tdt_entry__: .word 1 -__A_Object_tdt_entry__: .word -1 -__A_Int_tdt_entry__: .word -1 -__A_String_tdt_entry__: .word -1 -__A_Bool_tdt_entry__: .word -1 -__A_IO_tdt_entry__: .word -1 -__A_A_tdt_entry__: .word 0 -__A_B_tdt_entry__: .word 1 -__A_C_tdt_entry__: .word -1 -__A_D_tdt_entry__: .word -1 -__A_Main_tdt_entry__: .word -1 -__B_Object_tdt_entry__: .word -1 -__B_Int_tdt_entry__: .word -1 -__B_String_tdt_entry__: .word -1 -__B_Bool_tdt_entry__: .word -1 -__B_IO_tdt_entry__: .word -1 -__B_A_tdt_entry__: .word -1 -__B_B_tdt_entry__: .word 0 -__B_C_tdt_entry__: .word -1 -__B_D_tdt_entry__: .word -1 -__B_Main_tdt_entry__: .word -1 -__C_Object_tdt_entry__: .word -1 -__C_Int_tdt_entry__: .word -1 -__C_String_tdt_entry__: .word -1 -__C_Bool_tdt_entry__: .word -1 -__C_IO_tdt_entry__: .word -1 -__C_A_tdt_entry__: .word -1 -__C_B_tdt_entry__: .word -1 -__C_C_tdt_entry__: .word 0 -__C_D_tdt_entry__: .word 1 -__C_Main_tdt_entry__: .word -1 -__D_Object_tdt_entry__: .word -1 -__D_Int_tdt_entry__: .word -1 -__D_String_tdt_entry__: .word -1 -__D_Bool_tdt_entry__: .word -1 -__D_IO_tdt_entry__: .word -1 -__D_A_tdt_entry__: .word -1 -__D_B_tdt_entry__: .word -1 -__D_C_tdt_entry__: .word -1 -__D_D_tdt_entry__: .word 0 -__D_Main_tdt_entry__: .word -1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_A_tdt_entry__: .word -1 -__Main_B_tdt_entry__: .word -1 -__Main_C_tdt_entry__: .word -1 -__Main_D_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -data_2: .asciiz "A: Hello world\n" -# - - -data_3: .asciiz "B: Hello world\n" -# - - -data_4: .asciiz "C: Hello world\n" -# - - -data_5: .asciiz "D: Hello world\n" -# - - -data_6: .asciiz "Done.\n" -# + # **** VTABLE for type A **** + A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A + # + + + # **** Type RECORD for type A **** + A_start: + A_vtable_pointer: .word A_vtable + A_end: + # + + + # **** VTABLE for type B **** + B_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A, function_out_b_at_B + # + + + # **** Type RECORD for type B **** + B_start: + B_vtable_pointer: .word B_vtable + B_end: + # + + + # **** VTABLE for type C **** + C_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_c_at_C + # + + + # **** Type RECORD for type C **** + C_start: + C_vtable_pointer: .word C_vtable + C_end: + # + + + # **** VTABLE for type D **** + D_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_c_at_C, function_out_d_at_D + # + + + # **** Type RECORD for type D **** + D_start: + D_vtable_pointer: .word D_vtable + D_end: + # + + + # **** VTABLE for type Main **** + Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main + # + + + # **** Type RECORD for type Main **** + Main_start: + Main_vtable_pointer: .word Main_vtable + Main_end: + # + + + data_0: .asciiz "" + # + + + __Object_Object_tdt_entry__: .word 0 + __Object_Int_tdt_entry__: .word 1 + __Object_String_tdt_entry__: .word 1 + __Object_Bool_tdt_entry__: .word 1 + __Object_IO_tdt_entry__: .word 1 + __Object_A_tdt_entry__: .word 1 + __Object_B_tdt_entry__: .word 2 + __Object_C_tdt_entry__: .word 2 + __Object_D_tdt_entry__: .word 3 + __Object_Main_tdt_entry__: .word 2 + __Int_Object_tdt_entry__: .word -1 + __Int_Int_tdt_entry__: .word 0 + __Int_String_tdt_entry__: .word -1 + __Int_Bool_tdt_entry__: .word -1 + __Int_IO_tdt_entry__: .word -1 + __Int_A_tdt_entry__: .word -1 + __Int_B_tdt_entry__: .word -1 + __Int_C_tdt_entry__: .word -1 + __Int_D_tdt_entry__: .word -1 + __Int_Main_tdt_entry__: .word -1 + __String_Object_tdt_entry__: .word -1 + __String_Int_tdt_entry__: .word -1 + __String_String_tdt_entry__: .word 0 + __String_Bool_tdt_entry__: .word -1 + __String_IO_tdt_entry__: .word -1 + __String_A_tdt_entry__: .word -1 + __String_B_tdt_entry__: .word -1 + __String_C_tdt_entry__: .word -1 + __String_D_tdt_entry__: .word -1 + __String_Main_tdt_entry__: .word -1 + __Bool_Object_tdt_entry__: .word -1 + __Bool_Int_tdt_entry__: .word -1 + __Bool_String_tdt_entry__: .word -1 + __Bool_Bool_tdt_entry__: .word 0 + __Bool_IO_tdt_entry__: .word -1 + __Bool_A_tdt_entry__: .word -1 + __Bool_B_tdt_entry__: .word -1 + __Bool_C_tdt_entry__: .word -1 + __Bool_D_tdt_entry__: .word -1 + __Bool_Main_tdt_entry__: .word -1 + __IO_Object_tdt_entry__: .word -1 + __IO_Int_tdt_entry__: .word -1 + __IO_String_tdt_entry__: .word -1 + __IO_Bool_tdt_entry__: .word -1 + __IO_IO_tdt_entry__: .word 0 + __IO_A_tdt_entry__: .word -1 + __IO_B_tdt_entry__: .word -1 + __IO_C_tdt_entry__: .word 1 + __IO_D_tdt_entry__: .word 2 + __IO_Main_tdt_entry__: .word 1 + __A_Object_tdt_entry__: .word -1 + __A_Int_tdt_entry__: .word -1 + __A_String_tdt_entry__: .word -1 + __A_Bool_tdt_entry__: .word -1 + __A_IO_tdt_entry__: .word -1 + __A_A_tdt_entry__: .word 0 + __A_B_tdt_entry__: .word 1 + __A_C_tdt_entry__: .word -1 + __A_D_tdt_entry__: .word -1 + __A_Main_tdt_entry__: .word -1 + __B_Object_tdt_entry__: .word -1 + __B_Int_tdt_entry__: .word -1 + __B_String_tdt_entry__: .word -1 + __B_Bool_tdt_entry__: .word -1 + __B_IO_tdt_entry__: .word -1 + __B_A_tdt_entry__: .word -1 + __B_B_tdt_entry__: .word 0 + __B_C_tdt_entry__: .word -1 + __B_D_tdt_entry__: .word -1 + __B_Main_tdt_entry__: .word -1 + __C_Object_tdt_entry__: .word -1 + __C_Int_tdt_entry__: .word -1 + __C_String_tdt_entry__: .word -1 + __C_Bool_tdt_entry__: .word -1 + __C_IO_tdt_entry__: .word -1 + __C_A_tdt_entry__: .word -1 + __C_B_tdt_entry__: .word -1 + __C_C_tdt_entry__: .word 0 + __C_D_tdt_entry__: .word 1 + __C_Main_tdt_entry__: .word -1 + __D_Object_tdt_entry__: .word -1 + __D_Int_tdt_entry__: .word -1 + __D_String_tdt_entry__: .word -1 + __D_Bool_tdt_entry__: .word -1 + __D_IO_tdt_entry__: .word -1 + __D_A_tdt_entry__: .word -1 + __D_B_tdt_entry__: .word -1 + __D_C_tdt_entry__: .word -1 + __D_D_tdt_entry__: .word 0 + __D_Main_tdt_entry__: .word -1 + __Main_Object_tdt_entry__: .word -1 + __Main_Int_tdt_entry__: .word -1 + __Main_String_tdt_entry__: .word -1 + __Main_Bool_tdt_entry__: .word -1 + __Main_IO_tdt_entry__: .word -1 + __Main_A_tdt_entry__: .word -1 + __Main_B_tdt_entry__: .word -1 + __Main_C_tdt_entry__: .word -1 + __Main_D_tdt_entry__: .word -1 + __Main_Main_tdt_entry__: .word 0 + # + + + data_2: .asciiz "A: Hello world\n" + # + + + data_3: .asciiz "B: Hello world\n" + # + + + data_4: .asciiz "C: Hello world\n" + # + + + data_5: .asciiz "D: Hello world\n" + # + + + data_6: .asciiz "Done.\n" + # .text @@ -452,19 +452,56 @@ function_substr_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t1, 8($s1) + lw $t2, 8($s1) + lw $t3, 4($fp) + addu $t1, $t1, $t3 + lw $t3, 0($fp) + addu $t2, $t2, $t3 + subu $a0, $t2, $t1 + move $t4, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t3, $v0 + substr_loop: + beq $t1, $t2, substr_end + lb $a0, 0($t1) + sb $a0, 0($t3) + addu $t1, $t1, 1 + addu $t3, $t3, 1 + j substr_loop + substr_end: + sb $zero, 0($t3) + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + sw $t2, 8($v0) + sw $s0, 12($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END # function_length_at_String implementation. @@ -477,7 +514,7 @@ function_length_at_String: addu $fp, $sp, 32 # local_length_at_String_internal_0 = GETATTRIBUTE length String # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t1, 8($s1) + lw $t1, 12($s1) sw $t1, -4($fp) # RETURN local_length_at_String_internal_0 lw $v0, -4($fp) @@ -601,23 +638,23 @@ function_out_a_at_A: sw $v0, -16($fp) # ARG local_out_a_at_A_internal_3 # LOCAL local_out_a_at_A_internal_3 --> -16($fp) - lw $t2, -16($fp) + lw $t1, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # LOCAL local_out_a_at_A_internal_0 --> -4($fp) # LOCAL local_out_a_at_A_internal_1 --> -8($fp) # local_out_a_at_A_internal_1 = VCALL local_out_a_at_A_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 0($t3) + lw $t3, 0($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -645,13 +682,13 @@ function_out_b_at_B: addu $fp, $sp, 32 # local_out_b_at_B_internal_2 = GETATTRIBUTE io B # LOCAL local_out_b_at_B_internal_2 --> -12($fp) - lw $t2, 8($s1) - sw $t2, -12($fp) + lw $t1, 8($s1) + sw $t1, -12($fp) # LOCAL local_out_b_at_B_internal_0 --> -4($fp) # LOCAL local_out_b_at_B_internal_2 --> -12($fp) # local_out_b_at_B_internal_0 = local_out_b_at_B_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) + lw $t1, -12($fp) + sw $t1, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -661,34 +698,34 @@ function_out_b_at_B: li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - la $t2, data_3 - sw $t2, 8($v0) - li $t2, 18 - sw $t2, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_3 + sw $t1, 8($v0) + li $t1, 18 + sw $t1, 12($v0) sw $v0, -16($fp) # ARG local_out_b_at_B_internal_3 # LOCAL local_out_b_at_B_internal_3 --> -16($fp) - lw $t3, -16($fp) + lw $t1, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t1, 0($sp) # LOCAL local_out_b_at_B_internal_0 --> -4($fp) # LOCAL local_out_b_at_B_internal_1 --> -8($fp) # local_out_b_at_B_internal_1 = VCALL local_out_b_at_B_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 0($t4) + lw $t3, 0($t2) # Call function. Result is on $v0 - jalr $t5 + jalr $t3 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -720,8 +757,8 @@ function_out_c_at_C: # LOCAL local_out_c_at_C_internal_0 --> -4($fp) # LOCAL local_out_c_at_C_internal_2 --> -12($fp) # local_out_c_at_C_internal_0 = local_out_c_at_C_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) + lw $t1, -12($fp) + sw $t1, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -731,34 +768,34 @@ function_out_c_at_C: li $v0, 9 syscall # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - la $t3, data_4 - sw $t3, 8($v0) - li $t3, 18 - sw $t3, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_4 + sw $t1, 8($v0) + li $t1, 18 + sw $t1, 12($v0) sw $v0, -16($fp) # ARG local_out_c_at_C_internal_3 # LOCAL local_out_c_at_C_internal_3 --> -16($fp) - lw $t4, -16($fp) + lw $t1, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t1, 0($sp) # LOCAL local_out_c_at_C_internal_0 --> -4($fp) # LOCAL local_out_c_at_C_internal_1 --> -8($fp) # local_out_c_at_C_internal_1 = VCALL local_out_c_at_C_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t4, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t5, 0($t4) + lw $t2, 0($t1) # Get pointer to function address - lw $t6, 0($t5) + lw $t3, 0($t2) # Call function. Result is on $v0 - jalr $t6 + jalr $t3 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -790,8 +827,8 @@ function_out_d_at_D: # LOCAL local_out_d_at_D_internal_0 --> -4($fp) # LOCAL local_out_d_at_D_internal_2 --> -12($fp) # local_out_d_at_D_internal_0 = local_out_d_at_D_internal_2 - lw $t4, -12($fp) - sw $t4, -4($fp) + lw $t1, -12($fp) + sw $t1, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -801,34 +838,34 @@ function_out_d_at_D: li $v0, 9 syscall # Allocating string - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - la $t4, data_5 - sw $t4, 8($v0) - li $t4, 18 - sw $t4, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_5 + sw $t1, 8($v0) + li $t1, 18 + sw $t1, 12($v0) sw $v0, -16($fp) # ARG local_out_d_at_D_internal_3 # LOCAL local_out_d_at_D_internal_3 --> -16($fp) - lw $t5, -16($fp) + lw $t1, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t5, 0($sp) + sw $t1, 0($sp) # LOCAL local_out_d_at_D_internal_0 --> -4($fp) # LOCAL local_out_d_at_D_internal_1 --> -8($fp) # local_out_d_at_D_internal_1 = VCALL local_out_d_at_D_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t5, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t6, 0($t5) + lw $t2, 0($t1) # Get pointer to function address - lw $t7, 0($t6) + lw $t3, 0($t2) # Call function. Result is on $v0 - jalr $t7 + jalr $t3 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -860,25 +897,25 @@ function_main_at_Main: li $a0, 12 li $v0, 9 syscall - la $t5, A - sw $t5, 0($v0) - la $t5, A_start - sw $t5, 4($v0) - move $t6, $v0 - # Push register t6 into stack + la $t1, A + sw $t1, 0($v0) + la $t1, A_start + sw $t1, 4($v0) + move $t2, $v0 + # Push register t2 into stack subu $sp, $sp, 4 - sw $t6, 0($sp) + sw $t2, 0($sp) jal __A__attrib__io__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) addu $sp, $sp, 4 - sw $v0, 8($t6) - sw $t6, -12($fp) + sw $v0, 8($t2) + sw $t2, -12($fp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t5, -12($fp) - sw $t5, -4($fp) + lw $t1, -12($fp) + sw $t1, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -888,13 +925,13 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t5, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t6, 0($t5) + lw $t2, 0($t1) # Get pointer to function address - lw $t7, 12($t6) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $t7 + jalr $t3 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -905,25 +942,25 @@ function_main_at_Main: li $a0, 12 li $v0, 9 syscall - la $t5, B - sw $t5, 0($v0) - la $t5, B_start - sw $t5, 4($v0) - move $t6, $v0 - # Push register t6 into stack + la $t1, B + sw $t1, 0($v0) + la $t1, B_start + sw $t1, 4($v0) + move $t2, $v0 + # Push register t2 into stack subu $sp, $sp, 4 - sw $t6, 0($sp) + sw $t2, 0($sp) jal __A__attrib__io__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) addu $sp, $sp, 4 - sw $v0, 8($t6) - sw $t6, -24($fp) + sw $v0, 8($t2) + sw $t2, -24($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # LOCAL local_main_at_Main_internal_5 --> -24($fp) # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 - lw $t5, -24($fp) - sw $t5, -16($fp) + lw $t1, -24($fp) + sw $t1, -16($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -933,13 +970,13 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -16($fp) # Get pointer to type - lw $t5, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t6, 0($t5) + lw $t2, 0($t1) # Get pointer to function address - lw $t7, 16($t6) + lw $t3, 16($t2) # Call function. Result is on $v0 - jalr $t7 + jalr $t3 sw $v0, -20($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -950,17 +987,17 @@ function_main_at_Main: li $a0, 8 li $v0, 9 syscall - la $t5, C - sw $t5, 0($v0) - la $t5, C_start - sw $t5, 4($v0) - move $t6, $v0 - sw $t6, -36($fp) + la $t1, C + sw $t1, 0($v0) + la $t1, C_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -36($fp) # LOCAL local_main_at_Main_internal_6 --> -28($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 - lw $t5, -36($fp) - sw $t5, -28($fp) + lw $t1, -36($fp) + sw $t1, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -970,13 +1007,13 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -28($fp) # Get pointer to type - lw $t5, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t6, 0($t5) + lw $t2, 0($t1) # Get pointer to function address - lw $t7, 28($t6) + lw $t3, 28($t2) # Call function. Result is on $v0 - jalr $t7 + jalr $t3 sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -987,17 +1024,17 @@ function_main_at_Main: li $a0, 8 li $v0, 9 syscall - la $t5, D - sw $t5, 0($v0) - la $t5, D_start - sw $t5, 4($v0) - move $t6, $v0 - sw $t6, -48($fp) + la $t1, D + sw $t1, 0($v0) + la $t1, D_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -48($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # LOCAL local_main_at_Main_internal_11 --> -48($fp) # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 - lw $t5, -48($fp) - sw $t5, -40($fp) + lw $t1, -48($fp) + sw $t1, -40($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1007,13 +1044,13 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -40($fp) # Get pointer to type - lw $t5, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t6, 0($t5) + lw $t2, 0($t1) # Get pointer to function address - lw $t7, 32($t6) + lw $t3, 32($t2) # Call function. Result is on $v0 - jalr $t7 + jalr $t3 sw $v0, -44($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1024,8 +1061,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_12 --> -52($fp) # LOCAL local_main_at_Main_internal_14 --> -60($fp) # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 - lw $t5, -60($fp) - sw $t5, -52($fp) + lw $t1, -60($fp) + sw $t1, -52($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1035,34 +1072,34 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) - la $t5, data_6 - sw $t5, 8($v0) - li $t5, 9 - sw $t5, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_6 + sw $t1, 8($v0) + li $t1, 9 + sw $t1, 12($v0) sw $v0, -64($fp) # ARG local_main_at_Main_internal_15 # LOCAL local_main_at_Main_internal_15 --> -64($fp) - lw $t6, -64($fp) + lw $t1, -64($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t6, 0($sp) + sw $t1, 0($sp) # LOCAL local_main_at_Main_internal_12 --> -52($fp) # LOCAL local_main_at_Main_internal_13 --> -56($fp) # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string # Save new self pointer in $s1 lw $s1, -52($fp) # Get pointer to type - lw $t6, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t7, 0($t6) + lw $t2, 0($t1) # Get pointer to function address - lw $t8, 0($t7) + lw $t3, 0($t2) # Call function. Result is on $v0 - jalr $t8 + jalr $t3 sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) From ab28f7e231623f2d5b7d428da30118a19f7d4eba Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 4 Dec 2020 11:53:01 -0500 Subject: [PATCH 139/162] Reimplement concat --- src/cil/baseCilVisitor.py | 6 +- src/cil/nodes.py | 12 +- src/testing.mips | 2632 +++---------------------------------- src/testing.py | 126 +- src/travels/ciltomips.py | 143 +- src/travels/ctcill.py | 19 +- 6 files changed, 368 insertions(+), 2570 deletions(-) diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index f8043dc8..d82e20e6 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -2,7 +2,7 @@ import cil.nodes as nodes from abstract.semantics import Attribute, VariableInfo, Context, Type, Method from cil.nodes import ( - AllocateStringNode, CopyNode, GetAttributeNode, + AbortNode, AllocateStringNode, ConcatString, CopyNode, GetAttributeNode, PrintIntNode, PrintNode, ReadIntNode, @@ -262,9 +262,8 @@ def __implement_abort(self): # la funcion abort no recibe ningun paramentro # Simplemente llama trap y le pasa la causa "abortion" self.current_function = self.register_function("function_abort_at_Object") - # TODO: Implementarlo + self.register_instruction(AbortNode()) self.current_function = None - pass def __implement_copy(self): # La funcion copy es llamada sore un objeto @@ -292,6 +291,7 @@ def __implement_concat(self): param = self.register_params( VariableInfo("s", self.context.get_type("String"), "PARAM") ) + self.register_instruction(ConcatString(return_vm_holder, param)) self.register_instruction(ReturnNode(return_vm_holder)) def __implement_substr(self): diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 63d8261f..a49ab42a 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -274,4 +274,14 @@ class AllocateStringNode(InstructionNode): def __init__(self, dest: LocalNode, value: DataNode, length: int) -> None: self.dest = dest self.value = value - self.length = length \ No newline at end of file + self.length = length + + +class ConcatString(InstructionNode): + def __init__(self, dest: LocalNode, s: ParamNode) -> None: + self.dest = dest + self.s = s + + +class AbortNode(InstructionNode): + pass \ No newline at end of file diff --git a/src/testing.mips b/src/testing.mips index a1859270..5cede6c1 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 01:41:18 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 11:52:39 2020 # School of Math and Computer Science, University of Havana # @@ -11,8 +11,6 @@ Object: .asciiz "Object" # Function END String: .asciiz "String" # Function END -A2I: .asciiz "A2I" -# Function END Main: .asciiz "Main" # Function END # @@ -54,200 +52,71 @@ IO_start: # - # **** VTABLE for type A2I **** - A2I_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_c2i_at_A2I, function_i2c_at_A2I, function_a2i_at_A2I, function_a2i_aux_at_A2I, function_i2a_at_A2I, function_i2a_aux_at_A2I + # **** VTABLE for type Main **** + Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main # - # **** Type RECORD for type A2I **** - A2I_start: - A2I_vtable_pointer: .word A2I_vtable - A2I_end: + # **** Type RECORD for type Main **** + Main_start: + Main_vtable_pointer: .word Main_vtable + Main_end: # - # **** VTABLE for type Main **** - Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main + data_0: .asciiz "" # - # **** Type RECORD for type Main **** - Main_start: - Main_vtable_pointer: .word Main_vtable - Main_end: - # - - - data_0: .asciiz "" - # - - - __Object_Object_tdt_entry__: .word 0 - __Object_Int_tdt_entry__: .word 1 - __Object_String_tdt_entry__: .word 1 - __Object_Bool_tdt_entry__: .word 1 - __Object_IO_tdt_entry__: .word 1 - __Object_A2I_tdt_entry__: .word 1 - __Object_Main_tdt_entry__: .word 2 - __Int_Object_tdt_entry__: .word -1 - __Int_Int_tdt_entry__: .word 0 - __Int_String_tdt_entry__: .word -1 - __Int_Bool_tdt_entry__: .word -1 - __Int_IO_tdt_entry__: .word -1 - __Int_A2I_tdt_entry__: .word -1 - __Int_Main_tdt_entry__: .word -1 - __String_Object_tdt_entry__: .word -1 - __String_Int_tdt_entry__: .word -1 - __String_String_tdt_entry__: .word 0 - __String_Bool_tdt_entry__: .word -1 - __String_IO_tdt_entry__: .word -1 - __String_A2I_tdt_entry__: .word -1 - __String_Main_tdt_entry__: .word -1 - __Bool_Object_tdt_entry__: .word -1 - __Bool_Int_tdt_entry__: .word -1 - __Bool_String_tdt_entry__: .word -1 - __Bool_Bool_tdt_entry__: .word 0 - __Bool_IO_tdt_entry__: .word -1 - __Bool_A2I_tdt_entry__: .word -1 - __Bool_Main_tdt_entry__: .word -1 - __IO_Object_tdt_entry__: .word -1 - __IO_Int_tdt_entry__: .word -1 - __IO_String_tdt_entry__: .word -1 - __IO_Bool_tdt_entry__: .word -1 - __IO_IO_tdt_entry__: .word 0 - __IO_A2I_tdt_entry__: .word -1 - __IO_Main_tdt_entry__: .word 1 - __A2I_Object_tdt_entry__: .word -1 - __A2I_Int_tdt_entry__: .word -1 - __A2I_String_tdt_entry__: .word -1 - __A2I_Bool_tdt_entry__: .word -1 - __A2I_IO_tdt_entry__: .word -1 - __A2I_A2I_tdt_entry__: .word 0 - __A2I_Main_tdt_entry__: .word -1 - __Main_Object_tdt_entry__: .word -1 - __Main_Int_tdt_entry__: .word -1 - __Main_String_tdt_entry__: .word -1 - __Main_Bool_tdt_entry__: .word -1 - __Main_IO_tdt_entry__: .word -1 - __Main_A2I_tdt_entry__: .word -1 - __Main_Main_tdt_entry__: .word 0 - # - - - data_2: .asciiz "0" - # - - - data_3: .asciiz "1" - # - - - data_4: .asciiz "2" - # - - - data_5: .asciiz "3" - # - - - data_6: .asciiz "4" - # - - - data_7: .asciiz "5" - # - - - data_8: .asciiz "6" - # - - - data_9: .asciiz "7" - # - - - data_10: .asciiz "8" - # - - - data_11: .asciiz "9" - # - - - data_12: .asciiz "0" - # - - - data_13: .asciiz "1" - # - - - data_14: .asciiz "2" - # - - - data_15: .asciiz "3" - # - - - data_16: .asciiz "4" - # - - - data_17: .asciiz "5" - # - - - data_18: .asciiz "6" - # - - - data_19: .asciiz "7" - # - - - data_20: .asciiz "8" - # - - - data_21: .asciiz "9" - # - - - data_22: .asciiz "" - # - - - data_23: .asciiz "-" - # - - - data_24: .asciiz "+" - # - - - data_25: .asciiz "0" - # - - - data_26: .asciiz "-" - # - - - data_27: .asciiz "" - # + __Object_Object_tdt_entry__: .word 0 + __Object_Int_tdt_entry__: .word 1 + __Object_String_tdt_entry__: .word 1 + __Object_Bool_tdt_entry__: .word 1 + __Object_IO_tdt_entry__: .word 1 + __Object_Main_tdt_entry__: .word 2 + __Int_Object_tdt_entry__: .word -1 + __Int_Int_tdt_entry__: .word 0 + __Int_String_tdt_entry__: .word -1 + __Int_Bool_tdt_entry__: .word -1 + __Int_IO_tdt_entry__: .word -1 + __Int_Main_tdt_entry__: .word -1 + __String_Object_tdt_entry__: .word -1 + __String_Int_tdt_entry__: .word -1 + __String_String_tdt_entry__: .word 0 + __String_Bool_tdt_entry__: .word -1 + __String_IO_tdt_entry__: .word -1 + __String_Main_tdt_entry__: .word -1 + __Bool_Object_tdt_entry__: .word -1 + __Bool_Int_tdt_entry__: .word -1 + __Bool_String_tdt_entry__: .word -1 + __Bool_Bool_tdt_entry__: .word 0 + __Bool_IO_tdt_entry__: .word -1 + __Bool_Main_tdt_entry__: .word -1 + __IO_Object_tdt_entry__: .word -1 + __IO_Int_tdt_entry__: .word -1 + __IO_String_tdt_entry__: .word -1 + __IO_Bool_tdt_entry__: .word -1 + __IO_IO_tdt_entry__: .word 0 + __IO_Main_tdt_entry__: .word 1 + __Main_Object_tdt_entry__: .word -1 + __Main_Int_tdt_entry__: .word -1 + __Main_String_tdt_entry__: .word -1 + __Main_Bool_tdt_entry__: .word -1 + __Main_IO_tdt_entry__: .word -1 + __Main_Main_tdt_entry__: .word 0 + # - data_28: .asciiz "678987" - # + data_2: .asciiz "Hello, World." + # - data_29: .asciiz " == " - # + data_3: .asciiz "Hello Again.\n" + # - data_30: .asciiz "\n" - # + data_4: .asciiz "\n" + # .text @@ -370,6 +239,8 @@ function_abort_at_Object: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 + li $a0, 10 + syscall # Function END @@ -430,19 +301,75 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t1, 12($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t2, 12($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t1, $t2 + move $t4, $a0 + # Get first string from self + lw $t1, 8($s1) + # Get second string from param + lw $t2, 8($v0) + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t3, $v0 + move $t5, $zero + concat_loop1: + # Compare t1 with \0 + lb $t5, 0($t1) + beqz $t5, concat_loop1_end + # Copy 1 byte + sb $t5, 0($t3) + addu $t3, $t3, 1 + addu $t1, $t1, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t2 with \0 + lb $t5, 0($t2) + beqz $t5, concat_loop2_end + # Copy 1 byte + sb $t5, 0($t3) + addu $t3, $t3, 1 + addu $t2, $t2, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t3) + # v0 contains resulting string + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + sw $t2, 8($v0) + sw $t4, 12($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END # function_substr_at_String implementation. @@ -571,108 +498,26 @@ entry: # Function END -# function_c2i_at_A2I implementation. +# function_main_at_Main implementation. # @Params: -# 0($fp) = param_c2i_at_A2I_char_0 -function_c2i_at_A2I: - # Allocate stack frame for function function_c2i_at_A2I. - subu $sp, $sp, 100 +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 52 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 100 - # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_2 - sw $t1, 8($v0) - li $t1, 3 - sw $t1, 12($v0) - sw $v0, -8($fp) - # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) - # local_c2i_at_A2I_internal_0 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_1 - lw $t1, 0($fp) - lw $t2, -8($fp) - sub $t1, $t1, $t2 - sw $t1, -4($fp) - # IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_TRUE_3 - # IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_TRUE_3 - lw $t1, -4($fp) - beq $t1, 0, label_TRUE_3 - # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) - # local_c2i_at_A2I_internal_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # GOTO label_END_4 -j label_END_4 -label_TRUE_3: - # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) - # local_c2i_at_A2I_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - label_END_4: -# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSE_1 -# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSE_1 -lw $t1, -4($fp) -beq $t1, 0, label_FALSE_1 -# GOTO label_END_2 -j label_END_2 -label_FALSE_1: - # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_3 - sw $t1, 8($v0) - li $t1, 3 - sw $t1, 12($v0) - sw $v0, -16($fp) - # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) - # local_c2i_at_A2I_internal_2 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_3 - lw $t1, 0($fp) - lw $t2, -16($fp) - sub $t1, $t1, $t2 - sw $t1, -12($fp) - # IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_TRUE_7 - # IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_TRUE_7 + addu $fp, $sp, 52 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 lw $t1, -12($fp) - beq $t1, 0, label_TRUE_7 - # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) - # local_c2i_at_A2I_internal_2 = 0 - li $t1, 0 - sw $t1, -12($fp) - # GOTO label_END_8 -j label_END_8 -label_TRUE_7: - # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) - # local_c2i_at_A2I_internal_2 = 1 - li $t1, 1 - sw $t1, -12($fp) - label_END_8: -# IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_FALSE_5 -# IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_FALSE_5 -lw $t1, -12($fp) -beq $t1, 0, label_FALSE_5 -# GOTO label_END_6 -j label_END_6 -label_FALSE_5: - # LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 @@ -682,43 +527,20 @@ label_FALSE_5: sw $t1, 0($v0) la $t1, String_start sw $t1, 4($v0) - la $t1, data_4 + la $t1, data_2 sw $t1, 8($v0) - li $t1, 3 + li $t1, 15 sw $t1, 12($v0) sw $v0, -24($fp) - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) - # local_c2i_at_A2I_internal_4 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_5 - lw $t1, 0($fp) - lw $t2, -24($fp) - sub $t1, $t1, $t2 - sw $t1, -20($fp) - # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_11 - # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_11 - lw $t1, -20($fp) - beq $t1, 0, label_TRUE_11 - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - # local_c2i_at_A2I_internal_4 = 0 - li $t1, 0 - sw $t1, -20($fp) - # GOTO label_END_12 -j label_END_12 -label_TRUE_11: - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - # local_c2i_at_A2I_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) - label_END_12: -# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_9 -# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_9 -lw $t1, -20($fp) -beq $t1, 0, label_FALSE_9 -# GOTO label_END_10 -j label_END_10 -label_FALSE_9: - # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 + lw $t1, -24($fp) + sw $t1, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 @@ -728,848 +550,69 @@ label_FALSE_9: sw $t1, 0($v0) la $t1, String_start sw $t1, 4($v0) - la $t1, data_5 + la $t1, data_3 sw $t1, 8($v0) - li $t1, 3 + li $t1, 16 sw $t1, 12($v0) - sw $v0, -32($fp) - # LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) - # local_c2i_at_A2I_internal_6 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_7 - lw $t1, 0($fp) - lw $t2, -32($fp) - sub $t1, $t1, $t2 - sw $t1, -28($fp) - # IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_TRUE_15 - # IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_TRUE_15 + sw $v0, -28($fp) + # ARG local_main_at_Main_internal_6 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) lw $t1, -28($fp) - beq $t1, 0, label_TRUE_15 - # LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) - # local_c2i_at_A2I_internal_6 = 0 - li $t1, 0 - sw $t1, -28($fp) - # GOTO label_END_16 -j label_END_16 -label_TRUE_15: - # LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) - # local_c2i_at_A2I_internal_6 = 1 - li $t1, 1 - sw $t1, -28($fp) - label_END_16: -# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSE_13 -# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSE_13 -lw $t1, -28($fp) -beq $t1, 0, label_FALSE_13 -# GOTO label_END_14 -j label_END_14 -label_FALSE_13: - # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_6 - sw $t1, 8($v0) - li $t1, 3 - sw $t1, 12($v0) - sw $v0, -40($fp) - # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) - # local_c2i_at_A2I_internal_8 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_9 - lw $t1, 0($fp) - lw $t2, -40($fp) - sub $t1, $t1, $t2 - sw $t1, -36($fp) - # IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_TRUE_19 - # IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_TRUE_19 - lw $t1, -36($fp) - beq $t1, 0, label_TRUE_19 - # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) - # local_c2i_at_A2I_internal_8 = 0 - li $t1, 0 - sw $t1, -36($fp) - # GOTO label_END_20 -j label_END_20 -label_TRUE_19: - # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) - # local_c2i_at_A2I_internal_8 = 1 - li $t1, 1 - sw $t1, -36($fp) - label_END_20: -# IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_FALSE_17 -# IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_FALSE_17 -lw $t1, -36($fp) -beq $t1, 0, label_FALSE_17 -# GOTO label_END_18 -j label_END_18 -label_FALSE_17: - # LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_7 - sw $t1, 8($v0) - li $t1, 3 - sw $t1, 12($v0) - sw $v0, -48($fp) - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) - # local_c2i_at_A2I_internal_10 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_11 - lw $t1, 0($fp) - lw $t2, -48($fp) - sub $t1, $t1, $t2 - sw $t1, -44($fp) - # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_23 - # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_23 - lw $t1, -44($fp) - beq $t1, 0, label_TRUE_23 - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - # local_c2i_at_A2I_internal_10 = 0 - li $t1, 0 - sw $t1, -44($fp) - # GOTO label_END_24 -j label_END_24 -label_TRUE_23: - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - # local_c2i_at_A2I_internal_10 = 1 - li $t1, 1 - sw $t1, -44($fp) - label_END_24: -# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_21 -# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_21 -lw $t1, -44($fp) -beq $t1, 0, label_FALSE_21 -# GOTO label_END_22 -j label_END_22 -label_FALSE_21: - # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_8 - sw $t1, 8($v0) - li $t1, 3 - sw $t1, 12($v0) - sw $v0, -56($fp) - # LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) - # local_c2i_at_A2I_internal_12 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_13 - lw $t1, 0($fp) - lw $t2, -56($fp) - sub $t1, $t1, $t2 - sw $t1, -52($fp) - # IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_TRUE_27 - # IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_TRUE_27 - lw $t1, -52($fp) - beq $t1, 0, label_TRUE_27 - # LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) - # local_c2i_at_A2I_internal_12 = 0 - li $t1, 0 - sw $t1, -52($fp) - # GOTO label_END_28 -j label_END_28 -label_TRUE_27: - # LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) - # local_c2i_at_A2I_internal_12 = 1 - li $t1, 1 - sw $t1, -52($fp) - label_END_28: -# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSE_25 -# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSE_25 -lw $t1, -52($fp) -beq $t1, 0, label_FALSE_25 -# GOTO label_END_26 -j label_END_26 -label_FALSE_25: - # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_9 - sw $t1, 8($v0) - li $t1, 3 - sw $t1, 12($v0) - sw $v0, -64($fp) - # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) - # local_c2i_at_A2I_internal_14 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_15 - lw $t1, 0($fp) - lw $t2, -64($fp) - sub $t1, $t1, $t2 - sw $t1, -60($fp) - # IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_TRUE_31 - # IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_TRUE_31 - lw $t1, -60($fp) - beq $t1, 0, label_TRUE_31 - # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) - # local_c2i_at_A2I_internal_14 = 0 - li $t1, 0 - sw $t1, -60($fp) - # GOTO label_END_32 -j label_END_32 -label_TRUE_31: - # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) - # local_c2i_at_A2I_internal_14 = 1 - li $t1, 1 - sw $t1, -60($fp) - label_END_32: -# IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_FALSE_29 -# IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_FALSE_29 -lw $t1, -60($fp) -beq $t1, 0, label_FALSE_29 -# GOTO label_END_30 -j label_END_30 -label_FALSE_29: - # LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_10 - sw $t1, 8($v0) - li $t1, 3 - sw $t1, 12($v0) - sw $v0, -72($fp) - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) - # local_c2i_at_A2I_internal_16 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_17 - lw $t1, 0($fp) - lw $t2, -72($fp) - sub $t1, $t1, $t2 - sw $t1, -68($fp) - # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_35 - # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_35 - lw $t1, -68($fp) - beq $t1, 0, label_TRUE_35 - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - # local_c2i_at_A2I_internal_16 = 0 - li $t1, 0 - sw $t1, -68($fp) - # GOTO label_END_36 -j label_END_36 -label_TRUE_35: - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - # local_c2i_at_A2I_internal_16 = 1 - li $t1, 1 - sw $t1, -68($fp) - label_END_36: -# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_33 -# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_33 -lw $t1, -68($fp) -beq $t1, 0, label_FALSE_33 -# GOTO label_END_34 -j label_END_34 -label_FALSE_33: - # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_11 - sw $t1, 8($v0) - li $t1, 3 - sw $t1, 12($v0) - sw $v0, -80($fp) - # LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) - # local_c2i_at_A2I_internal_18 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_19 - lw $t1, 0($fp) - lw $t2, -80($fp) - sub $t1, $t1, $t2 - sw $t1, -76($fp) - # IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_TRUE_39 - # IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_TRUE_39 - lw $t1, -76($fp) - beq $t1, 0, label_TRUE_39 - # LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) - # local_c2i_at_A2I_internal_18 = 0 - li $t1, 0 - sw $t1, -76($fp) - # GOTO label_END_40 -j label_END_40 -label_TRUE_39: - # LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) - # local_c2i_at_A2I_internal_18 = 1 - li $t1, 1 - sw $t1, -76($fp) - label_END_40: -# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSE_37 -# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSE_37 -lw $t1, -76($fp) -beq $t1, 0, label_FALSE_37 -# GOTO label_END_38 -j label_END_38 -label_FALSE_37: - # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) - # local_c2i_at_A2I_internal_22 = SELF - sw $s1, -92($fp) - # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) - # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) - # local_c2i_at_A2I_internal_20 = local_c2i_at_A2I_internal_22 - lw $t1, -92($fp) - sw $t1, -84($fp) - # Push register s1 into stack + # Push arg into stack subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) - # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) - # local_c2i_at_A2I_internal_21 = VCALL local_c2i_at_A2I_internal_20 abort + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 concat # Save new self pointer in $s1 - lw $s1, -84($fp) + lw $s1, -16($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 16($t2) + lw $t3, 0($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -88($fp) + sw $v0, -20($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - label_END_38: -label_END_34: -label_END_30: -label_END_26: -label_END_22: -label_END_18: -label_END_14: -label_END_10: -label_END_6: -label_END_2: -# RETURN -# Deallocate stack frame for function function_c2i_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 100 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_i2c_at_A2I implementation. -# @Params: -# 0($fp) = param_i2c_at_A2I_i_0 -function_i2c_at_A2I: - # Allocate stack frame for function function_i2c_at_A2I. - subu $sp, $sp, 104 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 104 - # LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_0 = PARAM param_i2c_at_A2I_i_0 - 0 - lw $t1, 0($fp) - sub $t1, $t1, 0 - sw $t1, -4($fp) - # IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_TRUE_43 - # IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_TRUE_43 - lw $t1, -4($fp) - beq $t1, 0, label_TRUE_43 - # LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) - # local_i2c_at_A2I_internal_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # GOTO label_END_44 -j label_END_44 -label_TRUE_43: - # LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) - # local_i2c_at_A2I_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - label_END_44: -# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSE_41 -# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSE_41 -lw $t1, -4($fp) -beq $t1, 0, label_FALSE_41 -# LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_12 -sw $t1, 8($v0) -li $t1, 3 -sw $t1, 12($v0) -sw $v0, -8($fp) -# GOTO label_END_42 -j label_END_42 -label_FALSE_41: - # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_2 = PARAM param_i2c_at_A2I_i_0 - 1 - lw $t1, 0($fp) - sub $t1, $t1, 1 - sw $t1, -12($fp) - # IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_TRUE_47 - # IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_TRUE_47 - lw $t1, -12($fp) - beq $t1, 0, label_TRUE_47 - # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) - # local_i2c_at_A2I_internal_2 = 0 - li $t1, 0 - sw $t1, -12($fp) - # GOTO label_END_48 -j label_END_48 -label_TRUE_47: - # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) - # local_i2c_at_A2I_internal_2 = 1 - li $t1, 1 - sw $t1, -12($fp) - label_END_48: -# IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_FALSE_45 -# IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_FALSE_45 -lw $t1, -12($fp) -beq $t1, 0, label_FALSE_45 -# LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_13 -sw $t1, 8($v0) -li $t1, 3 -sw $t1, 12($v0) -sw $v0, -16($fp) -# GOTO label_END_46 -j label_END_46 -label_FALSE_45: - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_4 = PARAM param_i2c_at_A2I_i_0 - 2 - lw $t1, 0($fp) - sub $t1, $t1, 2 - sw $t1, -20($fp) - # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_51 - # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_51 + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) lw $t1, -20($fp) - beq $t1, 0, label_TRUE_51 - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - # local_i2c_at_A2I_internal_4 = 0 - li $t1, 0 - sw $t1, -20($fp) - # GOTO label_END_52 -j label_END_52 -label_TRUE_51: - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - # local_i2c_at_A2I_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) - label_END_52: -# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_49 -# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_49 -lw $t1, -20($fp) -beq $t1, 0, label_FALSE_49 -# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_14 -sw $t1, 8($v0) -li $t1, 3 -sw $t1, 12($v0) -sw $v0, -24($fp) -# GOTO label_END_50 -j label_END_50 -label_FALSE_49: - # LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_6 = PARAM param_i2c_at_A2I_i_0 - 3 - lw $t1, 0($fp) - sub $t1, $t1, 3 - sw $t1, -28($fp) - # IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_TRUE_55 - # IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_TRUE_55 - lw $t1, -28($fp) - beq $t1, 0, label_TRUE_55 - # LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) - # local_i2c_at_A2I_internal_6 = 0 - li $t1, 0 - sw $t1, -28($fp) - # GOTO label_END_56 -j label_END_56 -label_TRUE_55: - # LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) - # local_i2c_at_A2I_internal_6 = 1 - li $t1, 1 - sw $t1, -28($fp) - label_END_56: -# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSE_53 -# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSE_53 -lw $t1, -28($fp) -beq $t1, 0, label_FALSE_53 -# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_15 -sw $t1, 8($v0) -li $t1, 3 -sw $t1, 12($v0) -sw $v0, -32($fp) -# GOTO label_END_54 -j label_END_54 -label_FALSE_53: - # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_8 = PARAM param_i2c_at_A2I_i_0 - 4 - lw $t1, 0($fp) - sub $t1, $t1, 4 - sw $t1, -36($fp) - # IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_TRUE_59 - # IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_TRUE_59 - lw $t1, -36($fp) - beq $t1, 0, label_TRUE_59 - # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) - # local_i2c_at_A2I_internal_8 = 0 - li $t1, 0 - sw $t1, -36($fp) - # GOTO label_END_60 -j label_END_60 -label_TRUE_59: - # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) - # local_i2c_at_A2I_internal_8 = 1 - li $t1, 1 - sw $t1, -36($fp) - label_END_60: -# IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_FALSE_57 -# IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_FALSE_57 -lw $t1, -36($fp) -beq $t1, 0, label_FALSE_57 -# LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_16 -sw $t1, 8($v0) -li $t1, 3 -sw $t1, 12($v0) -sw $v0, -40($fp) -# GOTO label_END_58 -j label_END_58 -label_FALSE_57: - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_10 = PARAM param_i2c_at_A2I_i_0 - 5 - lw $t1, 0($fp) - sub $t1, $t1, 5 - sw $t1, -44($fp) - # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_63 - # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_63 - lw $t1, -44($fp) - beq $t1, 0, label_TRUE_63 - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - # local_i2c_at_A2I_internal_10 = 0 - li $t1, 0 - sw $t1, -44($fp) - # GOTO label_END_64 -j label_END_64 -label_TRUE_63: - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - # local_i2c_at_A2I_internal_10 = 1 - li $t1, 1 - sw $t1, -44($fp) - label_END_64: -# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_61 -# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_61 -lw $t1, -44($fp) -beq $t1, 0, label_FALSE_61 -# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_17 -sw $t1, 8($v0) -li $t1, 3 -sw $t1, 12($v0) -sw $v0, -48($fp) -# GOTO label_END_62 -j label_END_62 -label_FALSE_61: - # LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_12 = PARAM param_i2c_at_A2I_i_0 - 6 - lw $t1, 0($fp) - sub $t1, $t1, 6 - sw $t1, -52($fp) - # IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_TRUE_67 - # IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_TRUE_67 - lw $t1, -52($fp) - beq $t1, 0, label_TRUE_67 - # LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) - # local_i2c_at_A2I_internal_12 = 0 - li $t1, 0 - sw $t1, -52($fp) - # GOTO label_END_68 -j label_END_68 -label_TRUE_67: - # LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) - # local_i2c_at_A2I_internal_12 = 1 - li $t1, 1 - sw $t1, -52($fp) - label_END_68: -# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSE_65 -# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSE_65 -lw $t1, -52($fp) -beq $t1, 0, label_FALSE_65 -# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_18 -sw $t1, 8($v0) -li $t1, 3 -sw $t1, 12($v0) -sw $v0, -56($fp) -# GOTO label_END_66 -j label_END_66 -label_FALSE_65: - # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_14 = PARAM param_i2c_at_A2I_i_0 - 7 - lw $t1, 0($fp) - sub $t1, $t1, 7 - sw $t1, -60($fp) - # IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_TRUE_71 - # IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_TRUE_71 - lw $t1, -60($fp) - beq $t1, 0, label_TRUE_71 - # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) - # local_i2c_at_A2I_internal_14 = 0 - li $t1, 0 - sw $t1, -60($fp) - # GOTO label_END_72 -j label_END_72 -label_TRUE_71: - # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) - # local_i2c_at_A2I_internal_14 = 1 - li $t1, 1 - sw $t1, -60($fp) - label_END_72: -# IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_FALSE_69 -# IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_FALSE_69 -lw $t1, -60($fp) -beq $t1, 0, label_FALSE_69 -# LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_19 -sw $t1, 8($v0) -li $t1, 3 -sw $t1, 12($v0) -sw $v0, -64($fp) -# GOTO label_END_70 -j label_END_70 -label_FALSE_69: - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_16 = PARAM param_i2c_at_A2I_i_0 - 8 - lw $t1, 0($fp) - sub $t1, $t1, 8 - sw $t1, -68($fp) - # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_75 - # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_75 - lw $t1, -68($fp) - beq $t1, 0, label_TRUE_75 - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - # local_i2c_at_A2I_internal_16 = 0 - li $t1, 0 - sw $t1, -68($fp) - # GOTO label_END_76 -j label_END_76 -label_TRUE_75: - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - # local_i2c_at_A2I_internal_16 = 1 - li $t1, 1 - sw $t1, -68($fp) - label_END_76: -# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_73 -# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_73 -lw $t1, -68($fp) -beq $t1, 0, label_FALSE_73 -# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_20 -sw $t1, 8($v0) -li $t1, 3 -sw $t1, 12($v0) -sw $v0, -72($fp) -# GOTO label_END_74 -j label_END_74 -label_FALSE_73: - # LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_18 = PARAM param_i2c_at_A2I_i_0 - 9 - lw $t1, 0($fp) - sub $t1, $t1, 9 - sw $t1, -76($fp) - # IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_TRUE_79 - # IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_TRUE_79 - lw $t1, -76($fp) - beq $t1, 0, label_TRUE_79 - # LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) - # local_i2c_at_A2I_internal_18 = 0 - li $t1, 0 - sw $t1, -76($fp) - # GOTO label_END_80 -j label_END_80 -label_TRUE_79: - # LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) - # local_i2c_at_A2I_internal_18 = 1 - li $t1, 1 - sw $t1, -76($fp) - label_END_80: -# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSE_77 -# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSE_77 -lw $t1, -76($fp) -beq $t1, 0, label_FALSE_77 -# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_21 -sw $t1, 8($v0) -li $t1, 3 -sw $t1, 12($v0) -sw $v0, -80($fp) -# GOTO label_END_78 -j label_END_78 -label_FALSE_77: - # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) - # local_i2c_at_A2I_internal_22 = SELF - sw $s1, -92($fp) - # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) - # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) - # local_i2c_at_A2I_internal_20 = local_i2c_at_A2I_internal_22 - lw $t1, -92($fp) - sw $t1, -84($fp) - # Push register s1 into stack + # Push arg into stack subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) - # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) - # local_i2c_at_A2I_internal_21 = VCALL local_i2c_at_A2I_internal_20 abort + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string # Save new self pointer in $s1 - lw $s1, -84($fp) + lw $s1, -4($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 16($t2) + lw $t3, 0($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -88($fp) + sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = SELF + sw $s1, -40($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 + lw $t1, -40($fp) + sw $t1, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 @@ -1579,805 +622,22 @@ label_FALSE_77: sw $t1, 0($v0) la $t1, String_start sw $t1, 4($v0) - la $t1, data_22 + la $t1, data_4 sw $t1, 8($v0) - li $t1, 2 + li $t1, 4 sw $t1, 12($v0) - sw $v0, -96($fp) - label_END_78: -label_END_74: -label_END_70: -label_END_66: -label_END_62: -label_END_58: -label_END_54: -label_END_50: -label_END_46: -label_END_42: -# RETURN -# Deallocate stack frame for function function_i2c_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 104 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_a2i_at_A2I implementation. -# @Params: -# 0($fp) = param_a2i_at_A2I_s_0 -function_a2i_at_A2I: - # Allocate stack frame for function function_a2i_at_A2I. - subu $sp, $sp, 96 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 96 - # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) - # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - # local_a2i_at_A2I_internal_1 = PARAM param_a2i_at_A2I_s_0 - lw $t1, 0($fp) - sw $t1, -8($fp) - # Push register s1 into stack + sw $v0, -44($fp) + # ARG local_main_at_Main_internal_10 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + lw $t1, -44($fp) + # Push arg into stack subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) - # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) - # local_a2i_at_A2I_internal_2 = VCALL local_a2i_at_A2I_internal_1 length + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 out_string # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 8($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) - # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) - # local_a2i_at_A2I_internal_0 = local_a2i_at_A2I_internal_2 - 0 - lw $t1, -12($fp) - sub $t1, $t1, 0 - sw $t1, -4($fp) - # IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_TRUE_83 - # IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_TRUE_83 - lw $t1, -4($fp) - beq $t1, 0, label_TRUE_83 - # LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) - # local_a2i_at_A2I_internal_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # GOTO label_END_84 -j label_END_84 -label_TRUE_83: - # LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) - # local_a2i_at_A2I_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - label_END_84: -# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSE_81 -# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSE_81 -lw $t1, -4($fp) -beq $t1, 0, label_FALSE_81 -# GOTO label_END_82 -j label_END_82 -label_FALSE_81: - # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) - # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - # local_a2i_at_A2I_internal_4 = PARAM param_a2i_at_A2I_s_0 - lw $t1, 0($fp) - sw $t1, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 0 - li $t1, 0 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # ARG 1 - li $t1, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # local_a2i_at_A2I_internal_5 = VCALL local_a2i_at_A2I_internal_4 substr - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 4($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_23 - sw $t1, 8($v0) - li $t1, 3 - sw $t1, 12($v0) - sw $v0, -28($fp) - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) - # local_a2i_at_A2I_internal_3 = local_a2i_at_A2I_internal_5 - local_a2i_at_A2I_internal_6 - lw $t1, -24($fp) - lw $t2, -28($fp) - sub $t1, $t1, $t2 - sw $t1, -16($fp) - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_87 - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_87 - lw $t1, -16($fp) - beq $t1, 0, label_TRUE_87 - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # local_a2i_at_A2I_internal_3 = 0 - li $t1, 0 - sw $t1, -16($fp) - # GOTO label_END_88 -j label_END_88 -label_TRUE_87: - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # local_a2i_at_A2I_internal_3 = 1 - li $t1, 1 - sw $t1, -16($fp) - label_END_88: -# IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_FALSE_85 -# IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_FALSE_85 -lw $t1, -16($fp) -beq $t1, 0, label_FALSE_85 -# GOTO label_END_86 -j label_END_86 -label_FALSE_85: - # LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) - # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - # local_a2i_at_A2I_internal_8 = PARAM param_a2i_at_A2I_s_0 - lw $t1, 0($fp) - sw $t1, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 0 - li $t1, 0 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # ARG 1 - li $t1, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) - # LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) - # local_a2i_at_A2I_internal_9 = VCALL local_a2i_at_A2I_internal_8 substr - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 4($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_24 - sw $t1, 8($v0) - li $t1, 3 - sw $t1, 12($v0) - sw $v0, -44($fp) - # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) - # LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) - # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) - # local_a2i_at_A2I_internal_7 = local_a2i_at_A2I_internal_9 - local_a2i_at_A2I_internal_10 - lw $t1, -40($fp) - lw $t2, -44($fp) - sub $t1, $t1, $t2 - sw $t1, -32($fp) - # IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_TRUE_91 - # IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_TRUE_91 - lw $t1, -32($fp) - beq $t1, 0, label_TRUE_91 - # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) - # local_a2i_at_A2I_internal_7 = 0 - li $t1, 0 - sw $t1, -32($fp) - # GOTO label_END_92 -j label_END_92 -label_TRUE_91: - # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) - # local_a2i_at_A2I_internal_7 = 1 - li $t1, 1 - sw $t1, -32($fp) - label_END_92: -# IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_FALSE_89 -# IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_FALSE_89 -lw $t1, -32($fp) -beq $t1, 0, label_FALSE_89 -# LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) -# local_a2i_at_A2I_internal_13 = SELF -sw $s1, -56($fp) -# LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) -# LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) -# local_a2i_at_A2I_internal_11 = local_a2i_at_A2I_internal_13 -lw $t1, -56($fp) -sw $t1, -48($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_14 = PARAM param_a2i_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -60($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG 1 -li $t1, 1 -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_17 = PARAM param_a2i_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -72($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) -# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) -# local_a2i_at_A2I_internal_18 = VCALL local_a2i_at_A2I_internal_17 length -# Save new self pointer in $s1 -lw $s1, -72($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 8($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -76($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) -# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) -# local_a2i_at_A2I_internal_16 = local_a2i_at_A2I_internal_18 - 1 -lw $t1, -76($fp) -sub $t1, $t1, 1 -sw $t1, -68($fp) -# ARG local_a2i_at_A2I_internal_16 -# LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) -lw $t1, -68($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) -# LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) -# local_a2i_at_A2I_internal_15 = VCALL local_a2i_at_A2I_internal_14 substr -# Save new self pointer in $s1 -lw $s1, -60($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 4($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -64($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_a2i_at_A2I_internal_15 -# LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) -lw $t1, -64($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) -# LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) -# local_a2i_at_A2I_internal_12 = VCALL local_a2i_at_A2I_internal_11 a2i_aux -# Save new self pointer in $s1 -lw $s1, -48($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 24($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -52($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# GOTO label_END_90 -j label_END_90 -label_FALSE_89: - # LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) - # local_a2i_at_A2I_internal_21 = SELF - sw $s1, -88($fp) - # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) - # LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) - # local_a2i_at_A2I_internal_19 = local_a2i_at_A2I_internal_21 - lw $t1, -88($fp) - sw $t1, -80($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_a2i_at_A2I_s_0 - # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - lw $t1, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) - # LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) - # local_a2i_at_A2I_internal_20 = VCALL local_a2i_at_A2I_internal_19 a2i_aux - # Save new self pointer in $s1 - lw $s1, -80($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 24($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -84($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - label_END_90: -label_END_86: -label_END_82: -# RETURN -# Deallocate stack frame for function function_a2i_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 96 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_a2i_aux_at_A2I implementation. -# @Params: -# 0($fp) = param_a2i_aux_at_A2I_s_0 -function_a2i_aux_at_A2I: - # Allocate stack frame for function function_a2i_aux_at_A2I. - subu $sp, $sp, 64 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 64 - # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) - # local_a2i_aux_at_A2I_int_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # LOCAL local_a2i_aux_at_A2I_internal_2 --> -12($fp) - # PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) - # local_a2i_aux_at_A2I_internal_2 = PARAM param_a2i_aux_at_A2I_s_0 - lw $t1, 0($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_aux_at_A2I_internal_2 --> -12($fp) - # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) - # local_a2i_aux_at_A2I_internal_3 = VCALL local_a2i_aux_at_A2I_internal_2 length - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 8($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_aux_at_A2I_j_1 --> -8($fp) - # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) - # local_a2i_aux_at_A2I_j_1 = local_a2i_aux_at_A2I_internal_3 - lw $t1, -16($fp) - sw $t1, -8($fp) - # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) - # local_a2i_aux_at_A2I_i_4 = 0 - li $t1, 0 - sw $t1, -20($fp) - label_WHILE_93: - # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) - # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) - # LOCAL local_a2i_aux_at_A2I_j_1 --> -8($fp) - # local_a2i_aux_at_A2I_internal_5 = local_a2i_aux_at_A2I_i_4 - local_a2i_aux_at_A2I_j_1 - lw $t1, -20($fp) - lw $t2, -8($fp) - sub $t1, $t1, $t2 - sw $t1, -24($fp) - # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 - # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 - lw $t1, -24($fp) - bgt $t1, 0, label_FALSE_95 - # IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 - # IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 - lw $t1, -24($fp) - beq $t1, 0, label_FALSE_95 - # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) - # local_a2i_aux_at_A2I_internal_5 = 1 - li $t1, 1 - sw $t1, -24($fp) - # GOTO label_END_96 -j label_END_96 -label_FALSE_95: - # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) - # local_a2i_aux_at_A2I_internal_5 = 0 - li $t1, 0 - sw $t1, -24($fp) - label_END_96: -# IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_WHILE_END_94 -# IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_WHILE_END_94 -lw $t1, -24($fp) -beq $t1, 0, label_WHILE_END_94 -# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) -# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) -# local_a2i_aux_at_A2I_internal_7 = local_a2i_aux_at_A2I_int_0 * 10 -lw $t1, -4($fp) -mul $t1, $t1, 10 -sw $t1, -32($fp) -# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) -# local_a2i_aux_at_A2I_internal_10 = SELF -sw $s1, -44($fp) -# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) -# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) -# local_a2i_aux_at_A2I_internal_8 = local_a2i_aux_at_A2I_internal_10 -lw $t1, -44($fp) -sw $t1, -36($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) -# PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) -# local_a2i_aux_at_A2I_internal_11 = PARAM param_a2i_aux_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -48($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_a2i_aux_at_A2I_i_4 -# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) -lw $t1, -20($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# ARG 1 -li $t1, 1 -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) -# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) -# local_a2i_aux_at_A2I_internal_12 = VCALL local_a2i_aux_at_A2I_internal_11 substr -# Save new self pointer in $s1 -lw $s1, -48($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 4($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -52($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_a2i_aux_at_A2I_internal_12 -# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) -lw $t1, -52($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) -# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) -# local_a2i_aux_at_A2I_internal_9 = VCALL local_a2i_aux_at_A2I_internal_8 c2i -# Save new self pointer in $s1 -lw $s1, -36($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 12($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -40($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) -# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) -# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) -# local_a2i_aux_at_A2I_internal_6 = local_a2i_aux_at_A2I_internal_7 + local_a2i_aux_at_A2I_internal_9 -lw $t1, -32($fp) -lw $t2, -40($fp) -add $t1, $t1, $t2 -sw $t1, -28($fp) -# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) -# LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) -# local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_6 -lw $t1, -28($fp) -sw $t1, -4($fp) -# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) -# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) -# local_a2i_aux_at_A2I_internal_13 = local_a2i_aux_at_A2I_i_4 + 1 -lw $t1, -20($fp) -add $t1, $t1, 1 -sw $t1, -56($fp) -# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) -# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) -# local_a2i_aux_at_A2I_i_4 = local_a2i_aux_at_A2I_internal_13 -lw $t1, -56($fp) -sw $t1, -20($fp) -# GOTO label_WHILE_93 -j label_WHILE_93 -label_WHILE_END_94: - # RETURN local_a2i_aux_at_A2I_int_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_a2i_aux_at_A2I. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 64 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_i2a_at_A2I implementation. -# @Params: -# 0($fp) = param_i2a_at_A2I_i_0 -function_i2a_at_A2I: - # Allocate stack frame for function function_i2a_at_A2I. - subu $sp, $sp, 60 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 60 - # LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # local_i2a_at_A2I_internal_0 = PARAM param_i2a_at_A2I_i_0 - 0 - lw $t1, 0($fp) - sub $t1, $t1, 0 - sw $t1, -4($fp) - # IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_TRUE_99 - # IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_TRUE_99 - lw $t1, -4($fp) - beq $t1, 0, label_TRUE_99 - # LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) - # local_i2a_at_A2I_internal_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # GOTO label_END_100 -j label_END_100 -label_TRUE_99: - # LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) - # local_i2a_at_A2I_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - label_END_100: -# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSE_97 -# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSE_97 -lw $t1, -4($fp) -beq $t1, 0, label_FALSE_97 -# LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_25 -sw $t1, 8($v0) -li $t1, 3 -sw $t1, 12($v0) -sw $v0, -8($fp) -# GOTO label_END_98 -j label_END_98 -label_FALSE_97: - # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # local_i2a_at_A2I_internal_2 = 0 - PARAM param_i2a_at_A2I_i_0 - li $t1, 0 - lw $t2, 0($fp) - sub $t1, $t1, $t2 - sw $t1, -12($fp) - # IF_GREATER_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 - # IF_GREATER_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 - lw $t1, -12($fp) - bgt $t1, 0, label_FALSE_103 - # IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 - # IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 - lw $t1, -12($fp) - beq $t1, 0, label_FALSE_103 - # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) - # local_i2a_at_A2I_internal_2 = 1 - li $t1, 1 - sw $t1, -12($fp) - # GOTO label_END_104 -j label_END_104 -label_FALSE_103: - # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) - # local_i2a_at_A2I_internal_2 = 0 - li $t1, 0 - sw $t1, -12($fp) - label_END_104: -# IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_101 -# IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_101 -lw $t1, -12($fp) -beq $t1, 0, label_FALSE_101 -# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) -# local_i2a_at_A2I_internal_5 = SELF -sw $s1, -24($fp) -# LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) -# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) -# local_i2a_at_A2I_internal_3 = local_i2a_at_A2I_internal_5 -lw $t1, -24($fp) -sw $t1, -16($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_i2a_at_A2I_i_0 -# PARAM param_i2a_at_A2I_i_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) -# LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) -# local_i2a_at_A2I_internal_4 = VCALL local_i2a_at_A2I_internal_3 i2a_aux -# Save new self pointer in $s1 -lw $s1, -16($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 32($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -20($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# GOTO label_END_102 -j label_END_102 -label_FALSE_101: - # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_26 - sw $t1, 8($v0) - li $t1, 3 - sw $t1, 12($v0) - sw $v0, -36($fp) - # LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) - # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) - # local_i2a_at_A2I_internal_6 = local_i2a_at_A2I_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) - # local_i2a_at_A2I_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) - # LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) - # local_i2a_at_A2I_internal_9 = local_i2a_at_A2I_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # local_i2a_at_A2I_internal_12 = PARAM param_i2a_at_A2I_i_0 * 1 - lw $t1, 0($fp) - mul $t1, $t1, 1 - sw $t1, -52($fp) - # ARG local_i2a_at_A2I_internal_12 - # LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) - lw $t1, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) - # LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) - # local_i2a_at_A2I_internal_10 = VCALL local_i2a_at_A2I_internal_9 i2a_aux - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 32($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_i2a_at_A2I_internal_10 - # LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) - lw $t1, -44($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) - # LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) - # local_i2a_at_A2I_internal_7 = VCALL local_i2a_at_A2I_internal_6 concat - # Save new self pointer in $s1 - lw $s1, -28($fp) + lw $s1, -32($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -2386,511 +646,19 @@ label_FALSE_101: lw $t3, 0($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - label_END_102: -label_END_98: -# RETURN -# Deallocate stack frame for function function_i2a_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 60 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_i2a_aux_at_A2I implementation. -# @Params: -# 0($fp) = param_i2a_aux_at_A2I_i_0 -function_i2a_aux_at_A2I: - # Allocate stack frame for function function_i2a_aux_at_A2I. - subu $sp, $sp, 64 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 64 - # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # local_i2a_aux_at_A2I_internal_0 = PARAM param_i2a_aux_at_A2I_i_0 - 0 - lw $t1, 0($fp) - sub $t1, $t1, 0 - sw $t1, -4($fp) - # IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_TRUE_107 - # IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_TRUE_107 - lw $t1, -4($fp) - beq $t1, 0, label_TRUE_107 - # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) - # local_i2a_aux_at_A2I_internal_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # GOTO label_END_108 -j label_END_108 -label_TRUE_107: - # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) - # local_i2a_aux_at_A2I_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - label_END_108: -# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSE_105 -# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSE_105 -lw $t1, -4($fp) -beq $t1, 0, label_FALSE_105 -# LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_27 -sw $t1, 8($v0) -li $t1, 2 -sw $t1, 12($v0) -sw $v0, -8($fp) -# GOTO label_END_106 -j label_END_106 -label_FALSE_105: - # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # local_i2a_aux_at_A2I_internal_3 = PARAM param_i2a_aux_at_A2I_i_0 / 10 - lw $t1, 0($fp) - div $t1, $t1, 10 - sw $t1, -16($fp) - # LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) - # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) - # local_i2a_aux_at_A2I_next_2 = local_i2a_aux_at_A2I_internal_3 - lw $t1, -16($fp) - sw $t1, -12($fp) - # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) - # local_i2a_aux_at_A2I_internal_8 = SELF - sw $s1, -36($fp) - # LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) - # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) - # local_i2a_aux_at_A2I_internal_6 = local_i2a_aux_at_A2I_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_i2a_aux_at_A2I_next_2 - # LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) - lw $t1, -12($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) - # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) - # local_i2a_aux_at_A2I_internal_7 = VCALL local_i2a_aux_at_A2I_internal_6 i2a_aux - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 32($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) - # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) - # local_i2a_aux_at_A2I_internal_4 = local_i2a_aux_at_A2I_internal_7 - lw $t1, -32($fp) - sw $t1, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) - # local_i2a_aux_at_A2I_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) - # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) - # local_i2a_aux_at_A2I_internal_9 = local_i2a_aux_at_A2I_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) - # LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) - # local_i2a_aux_at_A2I_internal_13 = local_i2a_aux_at_A2I_next_2 * 10 - lw $t1, -12($fp) - mul $t1, $t1, 10 - sw $t1, -56($fp) - # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) - # local_i2a_aux_at_A2I_internal_12 = PARAM param_i2a_aux_at_A2I_i_0 - local_i2a_aux_at_A2I_internal_13 - lw $t1, 0($fp) - lw $t2, -56($fp) - sub $t1, $t1, $t2 - sw $t1, -52($fp) - # ARG local_i2a_aux_at_A2I_internal_12 - # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) - lw $t1, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) - # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) - # local_i2a_aux_at_A2I_internal_10 = VCALL local_i2a_aux_at_A2I_internal_9 i2c - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 16($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_i2a_aux_at_A2I_internal_10 - # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) - lw $t1, -44($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) - # LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) - # local_i2a_aux_at_A2I_internal_5 = VCALL local_i2a_aux_at_A2I_internal_4 concat - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - label_END_106: -# RETURN -# Deallocate stack frame for function function_i2a_aux_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 64 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 100 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 100 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = ALLOCATE A2I - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, A2I - sw $t1, 0($v0) - la $t1, A2I_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -16($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t1, -16($fp) - sw $t1, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_28 - sw $t1, 8($v0) - li $t1, 8 - sw $t1, 12($v0) - sw $v0, -20($fp) - # ARG local_main_at_Main_internal_4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - lw $t1, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 a2i - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_a_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_a_0 = local_main_at_Main_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = ALLOCATE A2I - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, A2I - sw $t1, 0($v0) - la $t1, A2I_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -36($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 678987 - li $t1, 678987 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 i2a - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 28($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_b_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_b_5 = local_main_at_Main_internal_7 - lw $t1, -32($fp) - sw $t1, -24($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_main_at_Main_a_0 - # LOCAL local_main_at_Main_a_0 --> -4($fp) - lw $t1, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_int - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 4($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 - lw $t1, -60($fp) - sw $t1, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_29 - sw $t1, 8($v0) - li $t1, 6 - sw $t1, 12($v0) - sw $v0, -64($fp) - # ARG local_main_at_Main_internal_15 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - lw $t1, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 - lw $t1, -76($fp) - sw $t1, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_main_at_Main_b_5 - # LOCAL local_main_at_Main_b_5 --> -24($fp) - lw $t1, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # local_main_at_Main_internal_21 = SELF - sw $s1, -88($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 - lw $t1, -88($fp) - sw $t1, -80($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_30 - sw $t1, 8($v0) - li $t1, 4 - sw $t1, 12($v0) - sw $v0, -92($fp) - # ARG local_main_at_Main_internal_22 - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - lw $t1, -92($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 out_string - # Save new self pointer in $s1 - lw $s1, -80($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -84($fp) + sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_20 - lw $v0, -84($fp) + # RETURN local_main_at_Main_internal_8 + lw $v0, -36($fp) # Deallocate stack frame for function function_main_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 100 + addu $sp, $sp, 52 jr $ra # Function END diff --git a/src/testing.py b/src/testing.py index 00c10df2..144c00aa 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,127 +60,13 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""(* - The class A2I provides integer-to-string and string-to-integer -conversion routines. To use these routines, either inherit them -in the class where needed, have a dummy variable bound to -something of type A2I, or simpl write (new A2I).method(argument). -*) - - -(* - c2i Converts a 1-character string to an integer. Aborts - if the string is not "0" through "9" -*) -class A2I { - - c2i(char : String) : Int { - if char = "0" then 0 else - if char = "1" then 1 else - if char = "2" then 2 else - if char = "3" then 3 else - if char = "4" then 4 else - if char = "5" then 5 else - if char = "6" then 6 else - if char = "7" then 7 else - if char = "8" then 8 else - if char = "9" then 9 else - { abort(); 0; } -- the 0 is needed to satisfy the typchecker - fi fi fi fi fi fi fi fi fi fi - }; - -(* - i2c is the inverse of c2i. -*) - i2c(i : Int) : String { - if i = 0 then "0" else - if i = 1 then "1" else - if i = 2 then "2" else - if i = 3 then "3" else - if i = 4 then "4" else - if i = 5 then "5" else - if i = 6 then "6" else - if i = 7 then "7" else - if i = 8 then "8" else - if i = 9 then "9" else - { abort(); ""; } -- the "" is needed to satisfy the typchecker - fi fi fi fi fi fi fi fi fi fi - }; - -(* - a2i converts an ASCII string into an integer. The empty string -is converted to 0. Signed and unsigned strings are handled. The -method aborts if the string does not represent an integer. Very -long strings of digits produce strange answers because of arithmetic -overflow. - -*) - a2i(s : String) : Int { - if s.length() = 0 then 0 else - if s.substr(0,1) = "-" then ~a2i_aux(s.substr(1,s.length()-1)) else - if s.substr(0,1) = "+" then a2i_aux(s.substr(1,s.length()-1)) else - a2i_aux(s) - fi fi fi - }; - -(* - a2i_aux converts the usigned portion of the string. As a programming -example, this method is written iteratively. -*) - a2i_aux(s : String) : Int { - (let int : Int <- 0 in - { - (let j : Int <- s.length() in - (let i : Int <- 0 in - while i < j loop - { - int <- int * 10 + c2i(s.substr(i,1)); - i <- i + 1; - } - pool - ) - ); - int; - } - ) - }; - -(* - i2a converts an integer to a string. Positive and negative -numbers are handled correctly. -*) - i2a(i : Int) : String { - if i = 0 then "0" else - if 0 < i then i2a_aux(i) else - "-".concat(i2a_aux(i * ~1)) - fi fi - }; - -(* - i2a_aux is an example using recursion. -*) - i2a_aux(i : Int) : String { - if i = 0 then "" else - (let next : Int <- i / 10 in - i2a_aux(next).concat(i2c(i - next * 10)) - ) - fi - }; - +text = r"""class Main inherits IO { + main(): IO { { + out_string("Hello, World.".concat("Hello Again.\n")); + out_string("\n"); + } + }; }; -class Main inherits IO { - main () : Object { - let a : Int <- (new A2I).a2i("678987"), - b : String <- (new A2I).i2a(678987) in - { - out_int(a) ; - out_string(" == ") ; - out_string(b) ; - out_string("\n"); - } - } ; -} ; - """ pipeline(text, 5) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 9bd828c2..d8e4fd0b 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -1,5 +1,6 @@ +from pickle import TRUE from abstract.semantics import Type -from cil.nodes import LocalNode +from cil.nodes import AbortNode, ConcatString, LocalNode from mips.arithmetic import ADD, ADDU, DIV, MUL, NOR, SUB, SUBU from mips.baseMipsVisitor import ( BaseCilToMipsVisitor, @@ -8,7 +9,7 @@ locate_attribute_in_type_hierarchy, ) import cil.nodes as cil -from mips.branch import BEQ, J +from mips.branch import BEQ, BEQZ, J from mips.instruction import ( FixedData, Label, @@ -23,7 +24,7 @@ a1, zero, s1, - at + at, ) import mips.branch as branchNodes from functools import singledispatchmethod @@ -163,12 +164,11 @@ def _(self, node: cil.FunctionNode): @visit.register def _(self, node: cil.InitSelfNode): - src = self.visit(node.src) + src = self.visit(node.src) assert src is not None self.register_instruction(LW(s1, src)) - @visit.register def _(self, node: cil.LabelNode): self.register_instruction(Label(node.label)) @@ -657,13 +657,13 @@ def _(self, node: cil.SubstringNode): self.register_instruction(LW(reg2, "8($s1)")) # Hacer que reg apunte al inicio del substr - if isinstance(l , int): + if isinstance(l, int): self.register_instruction(ADDU(reg, reg, l, True)) else: self.register_instruction(LW(temp, l)) self.register_instruction(ADDU(reg, reg, temp)) - if isinstance(r , int): + if isinstance(r, int): self.register_instruction(ADDU(reg2, reg2, r, True)) else: self.register_instruction(LW(temp, r)) @@ -726,12 +726,135 @@ def _(self, node: cil.SubstringNode): self.used_registers[reg] = False self.used_registers[reg2] = False self.used_registers[temp] = False - self.used_registers[size] = False + self.used_registers[size_reg] = False + + @visit.register + def _(self, node: ConcatString): + self.add_source_line_comment(node) + # Obtener los strings a concatenar + dest = self.visit(node.dest) + s = self.visit(node.s) + assert s is not None + assert dest is not None + + reg = self.get_available_register() + reg2 = self.get_available_register() + temp = self.get_available_register() + size_reg = self.get_available_register() + byte = self.get_available_register() + + assert ( + reg is not None + and reg2 is not None + and temp is not None + and size_reg is not None + and byte is not None + ) + + # Get Strings length + self.comment("Get first string length from self") + self.register_instruction(LW(reg, f"12($s1)")) + + # Obtener el segundo string + self.comment("Get second string length from param") + self.register_instruction(LW(v0, s)) + self.register_instruction(LW(reg2, "12($v0)")) + + self.comment("Save new string length in a0 for memory allocation") + self.register_instruction(ADDU(a0, reg, reg2)) + self.register_instruction(MOVE(size_reg, a0)) + + # Obtener el primer string desde self + self.comment("Get first string from self") + self.register_instruction(LW(reg, f"8($s1)")) + + # Obtener el segundo string + self.comment("Get second string from param") + self.register_instruction(LW(reg2, "8($v0)")) + + # Reservar memoria para el nuevo buffer + # $v0 = 9 (syscall 9 = sbrk) + self.register_instruction(ADDU(a0, a0, 1, True)) + self.register_instruction(LI(v0, 9)) + self.register_instruction(SYSCALL()) + + # mover v0 a un puntero temporal que podamos mover + self.register_instruction(MOVE(temp, v0)) + + # Hacer 0 el registro byte + self.register_instruction(MOVE(byte, zero)) + + # while [reg] != 0: copy to temp + self.register_instruction(Label("concat_loop1")) + self.comment(f"Compare {REG_TO_STR[reg]} with \\0") + self.register_instruction(LB(byte, f"0(${REG_TO_STR[reg]})")) + self.register_instruction(BEQZ(byte, "concat_loop1_end")) + # Copiar el byte hacia temp y aumentar en 1 + self.comment("Copy 1 byte") + self.register_instruction(SB(byte, f"0(${REG_TO_STR[temp]})")) + self.register_instruction(ADDU(temp, temp, 1, True)) + self.register_instruction(ADDU(reg, reg, 1, True)) + self.register_instruction(J("concat_loop1")) + + self.register_instruction(Label("concat_loop1_end")) + + # Copiar el segundo string + self.comment("Copy second string") + # while [reg2] != 0: copy to temp + self.register_instruction(Label("concat_loop2")) + self.comment(f"Compare {REG_TO_STR[reg2]} with \\0") + self.register_instruction(LB(byte, f"0(${REG_TO_STR[reg2]})")) + self.register_instruction(BEQZ(byte, "concat_loop2_end")) + # Copiar el byte hacia temp y aumentar en 1 + self.comment("Copy 1 byte") + self.register_instruction(SB(byte, f"0(${REG_TO_STR[temp]})")) + self.register_instruction(ADDU(temp, temp, 1, True)) + self.register_instruction(ADDU(reg2, reg2, 1, True)) + self.register_instruction(J("concat_loop2")) + + self.register_instruction(Label("concat_loop2_end")) + # Agregar el caracter null al final + self.register_instruction(SB(zero, f"0(${REG_TO_STR[temp]})")) + + # v0 contiene el string concatenado + self.comment("v0 contains resulting string") + self.register_instruction(MOVE(reg2, v0)) + + # Crear la instancia de str + size = 16 + + # Reservar memoria para el tipo + self.allocate_memory(size) + + self.comment("Allocating string") + + # Inicializar la instancia + self.register_instruction(LA(reg, "String")) + self.register_instruction(SW(reg, "0($v0)")) + + self.register_instruction(LA(reg, "String_start")) + self.register_instruction(SW(reg, "4($v0)")) + + # Copiar el str en v0 al atributo value de la instancia + self.register_instruction(SW(reg2, "8($v0)")) + + self.register_instruction(SW(size_reg, "12($v0)")) + + # devolver la instancia + self.register_instruction(SW(v0, dest)) + + self.used_registers[reg] = False + self.used_registers[reg2] = False + self.used_registers[temp] = False + self.used_registers[size_reg] = False + self.used_registers[byte] = False + @visit.register - def _(self, node: cil.ToStrNode): - pass + def _(self, node: AbortNode): + self.register_instruction(LI(a0, 10)) + self.register_instruction(SYSCALL()) @visit.register def _(self, node: cil.ReadNode): diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 42e84ebc..5441cb5c 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -9,11 +9,12 @@ import cil.nodes from cil.nodes import ( - AllocateNode, AllocateStringNode, + AllocateNode, + AllocateStringNode, ArgNode, AssignNode, CilNode, - CilProgramNode, + CilProgramNode, ConcatString, DataNode, DivNode, DynamicCallNode, @@ -561,7 +562,9 @@ def _(self, node: coolAst.StringConstant, scope: Scope) -> LocalNode: s1 = self.register_data(node.lex) # Cargar el string en la variable interna - self.register_instruction(AllocateStringNode(str_const_vm_holder, s1, len(node.lex))) + self.register_instruction( + AllocateStringNode(str_const_vm_holder, s1, len(node.lex)) + ) # Devolver la variable que contiene el string return str_const_vm_holder @@ -601,7 +604,7 @@ def _(self, node: coolAst.NegNode, scope: Scope): self.register_instruction(AssignNode(result_vm_holder, 0)) self.register_instruction(UnconditionalJump(not_end_label)) self.register_instruction(LabelNode(false_label)) - # Si expr = 0 entonces devolver 1 + # Si expr = 0 entonces devolver 1 self.register_instruction(AssignNode(result_vm_holder, 1)) self.register_instruction(LabelNode(not_end_label)) return result_vm_holder @@ -996,5 +999,13 @@ def _(self, node: ReadNode): def _(self, node: PrintNode): return f"PRINT_STR {node.src.name}" + @visit.register + def _(self, node: SubstringNode): + return f"{self.visit(node.dest)} = SUBSTRING {self.visit(node.l)} {self.visit(node.r)} self" + + @visit.register + def _(self, node: ConcatString): + return f"{self.visit(node.dest)} = self.CONCAT {node.s}" + def __call__(self, node) -> str: return self.visit(node) From 476b5d50874a7c48d7bfc0cbf82ae655ccf41be4 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 4 Dec 2020 16:49:43 -0500 Subject: [PATCH 140/162] Fix methods indexing invariant in dynamic dispatch --- src/cil/baseCilVisitor.py | 6 +- src/testing.mips | 1225 +++++++++++++++++++++---- src/testing.py | 140 ++- src/travels/ciltomips.py | 2 + src/travels/ctcill.py | 19 +- src/travels/inference.py | 2 +- tests/codegen/atoi.mips | 474 +++++----- tests/codegen/fib.mips | 248 ++++-- tests/codegen/hello_world.mips | 272 +++--- tests/codegen/io.mips | 532 ++++++----- tests/codegen/list.mips | 1537 ++++++++++++++++++++++++++++++++ 11 files changed, 3640 insertions(+), 817 deletions(-) create mode 100644 tests/codegen/list.mips diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index d82e20e6..91b037ba 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -324,13 +324,13 @@ def build_builtins(self): str_ = self.register_type("String") str__ = self.context.get_type("String") + io_typeNode.methods.append(("abort", "function_abort_at_Object")) + io_typeNode.methods.append(("type_name", "function_type_name_at_Object")) + io_typeNode.methods.append(("copy", "function_copy_at_Object")) io_typeNode.methods.append(("out_string", "function_out_string_at_IO")) io_typeNode.methods.append(("out_int", "function_out_int_at_IO")) io_typeNode.methods.append(("in_string", "function_in_string_at_IO")) io_typeNode.methods.append(("in_int", "function_in_int_at_IO")) - io_typeNode.methods.append(("abort", "function_abort_at_Object")) - io_typeNode.methods.append(("type_name", "function_type_name_at_Object")) - io_typeNode.methods.append(("copy", "function_copy_at_Object")) obj.methods.append(("abort", "function_abort_at_Object")) obj.methods.append(("type_name", "function_type_name_at_Object")) diff --git a/src/testing.mips b/src/testing.mips index 5cede6c1..9173160e 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 11:52:39 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:40:51 2020 # School of Math and Computer Science, University of Havana # @@ -11,112 +11,176 @@ Object: .asciiz "Object" # Function END String: .asciiz "String" # Function END +List: .asciiz "List" +# Function END +Cons: .asciiz "Cons" +# Function END Main: .asciiz "Main" # Function END # # **** VTABLE for type IO **** -IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END # # **** Type RECORD for type IO **** IO_start: IO_vtable_pointer: .word IO_vtable - IO_end: - # + # Function END +IO_end: +# - # **** VTABLE for type Object **** - Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object - # +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# - # **** Type RECORD for type Object **** - Object_start: - Object_vtable_pointer: .word Object_vtable - Object_end: - # +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# - # **** VTABLE for type String **** - String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String - # +# **** VTABLE for type String **** +String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# - # **** Type RECORD for type String **** - String_start: - String_vtable_pointer: .word String_vtable - String_end: - # +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# - # **** VTABLE for type Main **** - Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main - # +# **** VTABLE for type List **** +List_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_isNil_at_List, function_head_at_List, function_tail_at_List, function_cons_at_List +# Function END +# - # **** Type RECORD for type Main **** - Main_start: - Main_vtable_pointer: .word Main_vtable - Main_end: - # +# **** Type RECORD for type List **** +List_start: + List_vtable_pointer: .word List_vtable + # Function END +List_end: +# - data_0: .asciiz "" - # +# **** VTABLE for type Cons **** +Cons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_isNil_at_Cons, function_head_at_Cons, function_tail_at_Cons, function_cons_at_List, function_init_at_Cons +# Function END +# - __Object_Object_tdt_entry__: .word 0 - __Object_Int_tdt_entry__: .word 1 - __Object_String_tdt_entry__: .word 1 - __Object_Bool_tdt_entry__: .word 1 - __Object_IO_tdt_entry__: .word 1 - __Object_Main_tdt_entry__: .word 2 - __Int_Object_tdt_entry__: .word -1 - __Int_Int_tdt_entry__: .word 0 - __Int_String_tdt_entry__: .word -1 - __Int_Bool_tdt_entry__: .word -1 - __Int_IO_tdt_entry__: .word -1 - __Int_Main_tdt_entry__: .word -1 - __String_Object_tdt_entry__: .word -1 - __String_Int_tdt_entry__: .word -1 - __String_String_tdt_entry__: .word 0 - __String_Bool_tdt_entry__: .word -1 - __String_IO_tdt_entry__: .word -1 - __String_Main_tdt_entry__: .word -1 - __Bool_Object_tdt_entry__: .word -1 - __Bool_Int_tdt_entry__: .word -1 - __Bool_String_tdt_entry__: .word -1 - __Bool_Bool_tdt_entry__: .word 0 - __Bool_IO_tdt_entry__: .word -1 - __Bool_Main_tdt_entry__: .word -1 - __IO_Object_tdt_entry__: .word -1 - __IO_Int_tdt_entry__: .word -1 - __IO_String_tdt_entry__: .word -1 - __IO_Bool_tdt_entry__: .word -1 - __IO_IO_tdt_entry__: .word 0 - __IO_Main_tdt_entry__: .word 1 - __Main_Object_tdt_entry__: .word -1 - __Main_Int_tdt_entry__: .word -1 - __Main_String_tdt_entry__: .word -1 - __Main_Bool_tdt_entry__: .word -1 - __Main_IO_tdt_entry__: .word -1 - __Main_Main_tdt_entry__: .word 0 - # +# **** Type RECORD for type Cons **** +Cons_start: + Cons_vtable_pointer: .word Cons_vtable + # Function END +Cons_end: +# - data_2: .asciiz "Hello, World." - # +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_print_list_at_Main, function_main_at_Main +# Function END +# - data_3: .asciiz "Hello Again.\n" - # +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# - data_4: .asciiz "\n" - # +data_0: .asciiz "" +# + + +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_List_tdt_entry__: .word 1 +__Object_Cons_tdt_entry__: .word 2 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_List_tdt_entry__: .word -1 +__Int_Cons_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_List_tdt_entry__: .word -1 +__String_Cons_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_List_tdt_entry__: .word -1 +__Bool_Cons_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_List_tdt_entry__: .word -1 +__IO_Cons_tdt_entry__: .word -1 +__IO_Main_tdt_entry__: .word 1 +__List_Object_tdt_entry__: .word -1 +__List_Int_tdt_entry__: .word -1 +__List_String_tdt_entry__: .word -1 +__List_Bool_tdt_entry__: .word -1 +__List_IO_tdt_entry__: .word -1 +__List_List_tdt_entry__: .word 0 +__List_Cons_tdt_entry__: .word 1 +__List_Main_tdt_entry__: .word -1 +__Cons_Object_tdt_entry__: .word -1 +__Cons_Int_tdt_entry__: .word -1 +__Cons_String_tdt_entry__: .word -1 +__Cons_Bool_tdt_entry__: .word -1 +__Cons_IO_tdt_entry__: .word -1 +__Cons_List_tdt_entry__: .word -1 +__Cons_Cons_tdt_entry__: .word 0 +__Cons_Main_tdt_entry__: .word -1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_List_tdt_entry__: .word -1 +__Main_Cons_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +data_2: .asciiz "\n" +# + + +data_3: .asciiz " " +# .text @@ -301,7 +365,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -469,8 +533,8 @@ entry: addu $fp, $sp, 32 # LOCAL local__internal_0 --> -4($fp) # local__internal_0 = ALLOCATE Main - # Allocating 8 bytes of memory - li $a0, 8 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall la $t1, Main @@ -478,6 +542,14 @@ entry: la $t1, Main_start sw $t1, 4($v0) move $t2, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Main__attrib__mylist__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 8($t2) sw $t2, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) @@ -498,74 +570,51 @@ entry: # Function END -# function_main_at_Main implementation. +# function_isNil_at_List implementation. # @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 52 +function_isNil_at_List: + # Allocate stack frame for function function_isNil_at_List. + subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 52 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF + addu $fp, $sp, 32 + # RETURN 1 + li $v0, 1 + # Deallocate stack frame for function function_isNil_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_head_at_List implementation. +# @Params: +function_head_at_List: + # Allocate stack frame for function function_head_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_head_at_List_internal_2 --> -12($fp) + # local_head_at_List_internal_2 = SELF sw $s1, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + # LOCAL local_head_at_List_internal_0 --> -4($fp) + # LOCAL local_head_at_List_internal_2 --> -12($fp) + # local_head_at_List_internal_0 = local_head_at_List_internal_2 lw $t1, -12($fp) sw $t1, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_2 - sw $t1, 8($v0) - li $t1, 15 - sw $t1, 12($v0) - sw $v0, -24($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 - lw $t1, -24($fp) - sw $t1, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_3 - sw $t1, 8($v0) - li $t1, 16 - sw $t1, 12($v0) - sw $v0, -28($fp) - # ARG local_main_at_Main_internal_6 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - lw $t1, -28($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 concat + # LOCAL local_head_at_List_internal_0 --> -4($fp) + # LOCAL local_head_at_List_internal_1 --> -8($fp) + # local_head_at_List_internal_1 = VCALL local_head_at_List_internal_0 abort # Save new self pointer in $s1 - lw $s1, -16($fp) + lw $s1, -4($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -574,19 +623,45 @@ function_main_at_Main: lw $t3, 0($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -20($fp) + sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - lw $t1, -20($fp) - # Push arg into stack + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function function_head_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_tail_at_List implementation. +# @Params: +function_tail_at_List: + # Allocate stack frame for function function_tail_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_tail_at_List_internal_2 --> -12($fp) + # local_tail_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_tail_at_List_internal_0 --> -4($fp) + # LOCAL local_tail_at_List_internal_2 --> -12($fp) + # local_tail_at_List_internal_0 = local_tail_at_List_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + sw $s1, 0($sp) + # LOCAL local_tail_at_List_internal_0 --> -4($fp) + # LOCAL local_tail_at_List_internal_1 --> -8($fp) + # local_tail_at_List_internal_1 = VCALL local_tail_at_List_internal_0 abort # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type @@ -601,65 +676,863 @@ function_main_at_Main: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = SELF - sw $s1, -40($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t1, -40($fp) - sw $t1, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_tail_at_List_internal_3 --> -16($fp) + # local_tail_at_List_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_tail_at_List_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_tail_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cons_at_List implementation. +# @Params: +# 0($fp) = param_cons_at_List_i_0 +function_cons_at_List: + # Allocate stack frame for function function_cons_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cons_at_List_internal_2 --> -12($fp) + # local_cons_at_List_internal_2 = ALLOCATE Cons # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall - # Allocating string - la $t1, String + la $t1, Cons sw $t1, 0($v0) - la $t1, String_start + la $t1, Cons_start sw $t1, 4($v0) - la $t1, data_4 - sw $t1, 8($v0) - li $t1, 4 - sw $t1, 12($v0) - sw $v0, -44($fp) - # ARG local_main_at_Main_internal_10 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - lw $t1, -44($fp) + move $t2, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Cons__attrib__car__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 8($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Cons__attrib__cdr__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + sw $t2, -12($fp) + # LOCAL local_cons_at_List_internal_0 --> -4($fp) + # LOCAL local_cons_at_List_internal_2 --> -12($fp) + # local_cons_at_List_internal_0 = local_cons_at_List_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cons_at_List_i_0 + # PARAM param_cons_at_List_i_0 --> 0($fp) + lw $t1, 0($fp) # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 out_string + # LOCAL local_cons_at_List_internal_3 --> -16($fp) + # local_cons_at_List_internal_3 = SELF + sw $s1, -16($fp) + # ARG local_cons_at_List_internal_3 + # LOCAL local_cons_at_List_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_cons_at_List_internal_0 --> -4($fp) + # LOCAL local_cons_at_List_internal_1 --> -8($fp) + # local_cons_at_List_internal_1 = VCALL local_cons_at_List_internal_0 init # Save new self pointer in $s1 - lw $s1, -32($fp) + lw $s1, -4($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 0($t2) + lw $t3, 28($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -36($fp) + sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_8 - lw $v0, -36($fp) - # Deallocate stack frame for function function_main_at_Main. + # RETURN local_cons_at_List_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_cons_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# __Cons__attrib__car__init implementation. +# @Params: +__Cons__attrib__car__init: + # Allocate stack frame for function __Cons__attrib__car__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Cons__attrib__car__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Cons__attrib__cdr__init implementation. +# @Params: +__Cons__attrib__cdr__init: + # Allocate stack frame for function __Cons__attrib__cdr__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Cons__attrib__cdr__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_Cons implementation. +# @Params: +function_isNil_at_Cons: + # Allocate stack frame for function function_isNil_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function function_isNil_at_Cons. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 52 + addu $sp, $sp, 32 jr $ra # Function END +# function_head_at_Cons implementation. +# @Params: +function_head_at_Cons: + # Allocate stack frame for function function_head_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_head_at_Cons_internal_0 = GETATTRIBUTE car Cons + # LOCAL local_head_at_Cons_internal_0 --> -4($fp) + lw $t1, 8($s1) + sw $t1, -4($fp) + # RETURN local_head_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_head_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_tail_at_Cons implementation. +# @Params: +function_tail_at_Cons: + # Allocate stack frame for function function_tail_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_tail_at_Cons_internal_0 = GETATTRIBUTE cdr Cons + # LOCAL local_tail_at_Cons_internal_0 --> -4($fp) + lw $t1, 12($s1) + sw $t1, -4($fp) + # RETURN local_tail_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_tail_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Cons implementation. +# @Params: +# 0($fp) = param_init_at_Cons_i_0 +# 4($fp) = param_init_at_Cons_rest_1 +function_init_at_Cons: + # Allocate stack frame for function function_init_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_Cons_i_0 --> 4($fp) + lw $t1, 4($fp) + sw $t1, 8($s1) + # + # PARAM param_init_at_Cons_rest_1 --> 0($fp) + lw $t1, 0($fp) + sw $t1, 12($s1) + # LOCAL local_init_at_Cons_internal_0 --> -4($fp) + # local_init_at_Cons_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# __Main__attrib__mylist__init implementation. +# @Params: +__Main__attrib__mylist__init: + # Allocate stack frame for function __Main__attrib__mylist__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__mylist__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_list_at_Main implementation. +# @Params: +# 0($fp) = param_print_list_at_Main_l_0 +function_print_list_at_Main: + # Allocate stack frame for function function_print_list_at_Main. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) + # PARAM param_print_list_at_Main_l_0 --> 0($fp) + # local_print_list_at_Main_internal_0 = PARAM param_print_list_at_Main_l_0 + lw $t1, 0($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Main_internal_1 --> -8($fp) + # local_print_list_at_Main_internal_1 = VCALL local_print_list_at_Main_internal_0 isNil + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # IF_ZERO local_print_list_at_Main_internal_1 GOTO label_FALSE_1 + # IF_ZERO local_print_list_at_Main_internal_1 GOTO label_FALSE_1 + lw $t1, -8($fp) + beq $t1, 0, label_FALSE_1 + # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) + # local_print_list_at_Main_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) + # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) + # local_print_list_at_Main_internal_2 = local_print_list_at_Main_internal_4 + lw $t1, -20($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_2 + sw $t1, 8($v0) + li $t1, 2 + sw $t1, 12($v0) + sw $v0, -24($fp) + # ARG local_print_list_at_Main_internal_5 + # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) + lw $t1, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) + # LOCAL local_print_list_at_Main_internal_3 --> -16($fp) + # local_print_list_at_Main_internal_3 = VCALL local_print_list_at_Main_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # GOTO label_END_2 +j label_END_2 +label_FALSE_1: + # LOCAL local_print_list_at_Main_internal_8 --> -36($fp) + # local_print_list_at_Main_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Main_internal_8 --> -36($fp) + # local_print_list_at_Main_internal_6 = local_print_list_at_Main_internal_8 + lw $t1, -36($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) + # PARAM param_print_list_at_Main_l_0 --> 0($fp) + # local_print_list_at_Main_internal_9 = PARAM param_print_list_at_Main_l_0 + lw $t1, 0($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) + # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) + # local_print_list_at_Main_internal_10 = VCALL local_print_list_at_Main_internal_9 head + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 16($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_print_list_at_Main_internal_10 + # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) + lw $t1, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Main_internal_7 --> -32($fp) + # local_print_list_at_Main_internal_7 = VCALL local_print_list_at_Main_internal_6 out_int + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 16($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Main_internal_13 --> -56($fp) + # local_print_list_at_Main_internal_13 = SELF + sw $s1, -56($fp) + # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) + # LOCAL local_print_list_at_Main_internal_13 --> -56($fp) + # local_print_list_at_Main_internal_11 = local_print_list_at_Main_internal_13 + lw $t1, -56($fp) + sw $t1, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_3 + sw $t1, 8($v0) + li $t1, 1 + sw $t1, 12($v0) + sw $v0, -60($fp) + # ARG local_print_list_at_Main_internal_14 + # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) + lw $t1, -60($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) + # LOCAL local_print_list_at_Main_internal_12 --> -52($fp) + # local_print_list_at_Main_internal_12 = VCALL local_print_list_at_Main_internal_11 out_string + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) + # local_print_list_at_Main_internal_17 = SELF + sw $s1, -72($fp) + # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) + # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) + # local_print_list_at_Main_internal_15 = local_print_list_at_Main_internal_17 + lw $t1, -72($fp) + sw $t1, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) + # PARAM param_print_list_at_Main_l_0 --> 0($fp) + # local_print_list_at_Main_internal_18 = PARAM param_print_list_at_Main_l_0 + lw $t1, 0($fp) + sw $t1, -76($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) + # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) + # local_print_list_at_Main_internal_19 = VCALL local_print_list_at_Main_internal_18 tail + # Save new self pointer in $s1 + lw $s1, -76($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 20($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -80($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_print_list_at_Main_internal_19 + # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) + lw $t1, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) + # LOCAL local_print_list_at_Main_internal_16 --> -68($fp) + # local_print_list_at_Main_internal_16 = VCALL local_print_list_at_Main_internal_15 print_list + # Save new self pointer in $s1 + lw $s1, -64($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 28($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_END_2: +# RETURN +# Deallocate stack frame for function function_print_list_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 96 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 96 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = ALLOCATE List + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, List + sw $t1, 0($v0) + la $t1, List_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -44($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_8 = local_main_at_Main_internal_10 + lw $t1, -44($fp) + sw $t1, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 1 + li $t1, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 cons + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 24($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_9 + lw $t1, -40($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 2 + li $t1, 2 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 cons + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 24($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_7 + lw $t1, -32($fp) + sw $t1, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 3 + li $t1, 3 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 cons + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 24($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_2 = local_main_at_Main_internal_5 + lw $t1, -24($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 4 + li $t1, 4 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 cons + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 24($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 + lw $t1, -16($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 5 + li $t1, 5 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 cons + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 24($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + lw $t1, -8($fp) + sw $t1, 8($s1) + label_WHILE_3: + # local_main_at_Main_internal_13 = GETATTRIBUTE mylist Main + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + lw $t1, 8($s1) + sw $t1, -56($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_11 = local_main_at_Main_internal_13 + lw $t1, -56($fp) + sw $t1, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = VCALL local_main_at_Main_internal_11 isNil + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # IF_ZERO local_main_at_Main_internal_12 GOTO label_FALSE_5 + # IF_ZERO local_main_at_Main_internal_12 GOTO label_FALSE_5 + lw $t1, -52($fp) + beq $t1, 0, label_FALSE_5 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = 0 + li $t1, 0 + sw $t1, -60($fp) + # GOTO label_NOT_END_6 + j label_NOT_END_6 + label_FALSE_5: + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = 1 + li $t1, 1 + sw $t1, -60($fp) + label_NOT_END_6: + # IF_ZERO local_main_at_Main_internal_14 GOTO label_WHILE_END_4 + # IF_ZERO local_main_at_Main_internal_14 GOTO label_WHILE_END_4 + lw $t1, -60($fp) + beq $t1, 0, label_WHILE_END_4 + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = SELF + sw $s1, -72($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 + lw $t1, -72($fp) + sw $t1, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_main_at_Main_internal_18 = GETATTRIBUTE mylist Main + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + lw $t1, 8($s1) + sw $t1, -76($fp) + # ARG local_main_at_Main_internal_18 + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + lw $t1, -76($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 print_list + # Save new self pointer in $s1 + lw $s1, -64($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 28($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_main_at_Main_internal_21 = GETATTRIBUTE mylist Main + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + lw $t1, 8($s1) + sw $t1, -88($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 + lw $t1, -88($fp) + sw $t1, -80($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 tail + # Save new self pointer in $s1 + lw $s1, -80($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 20($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -84($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + lw $t1, -84($fp) + sw $t1, 8($s1) + # GOTO label_WHILE_3 + j label_WHILE_3 + label_WHILE_END_4: + # RETURN + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 96 + jr $ra + # Function END + + diff --git a/src/testing.py b/src/testing.py index 144c00aa..f20f3650 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,13 +60,143 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""class Main inherits IO { - main(): IO { { - out_string("Hello, World.".concat("Hello Again.\n")); - out_string("\n"); - } +text = r"""(* + * This file shows how to implement a list data type for lists of integers. + * It makes use of INHERITANCE and DYNAMIC DISPATCH. + * + * The List class has 4 operations defined on List objects. If 'l' is + * a list, then the methods dispatched on 'l' have the following effects: + * + * isNil() : Bool Returns true if 'l' is empty, false otherwise. + * head() : Int Returns the integer at the head of 'l'. + * If 'l' is empty, execution aborts. + * tail() : List Returns the remainder of the 'l', + * i.e. without the first element. + * cons(i : Int) : List Return a new list containing i as the + * first element, followed by the + * elements in 'l'. + * + * There are 2 kinds of lists, the empty list and a non-empty + * list. We can think of the non-empty list as a specialization of + * the empty list. + * The class List defines the operations on empty list. The class + * Cons inherits from List and redefines things to handle non-empty + * lists. + *) + + +class List { + -- Define operations on empty lists. + + isNil() : Bool { true }; + + -- Since abort() has return type Object and head() has return type + -- Int, we need to have an Int as the result of the method body, + -- even though abort() never returns. + + head() : Int { { abort(); 0; } }; + + -- As for head(), the self is just to make sure the return type of + -- tail() is correct. + + tail() : List { { abort(); self; } }; + + -- When we cons and element onto the empty list we get a non-empty + -- list. The (new Cons) expression creates a new list cell of class + -- Cons, which is initialized by a dispatch to init(). + -- The result of init() is an element of class Cons, but it + -- conforms to the return type List, because Cons is a subclass of + -- List. + + cons(i : Int) : List { + (new Cons).init(i, self) + }; + +}; + + +(* + * Cons inherits all operations from List. We can reuse only the cons + * method though, because adding an element to the front of an emtpy + * list is the same as adding it to the front of a non empty + * list. All other methods have to be redefined, since the behaviour + * for them is different from the empty list. + * + * Cons needs two attributes to hold the integer of this list + * cell and to hold the rest of the list. + * + * The init() method is used by the cons() method to initialize the + * cell. + *) + +class Cons inherits List { + + car : Int; -- The element in this list cell + + cdr : List; -- The rest of the list + + isNil() : Bool { false }; + + head() : Int { car }; + + tail() : List { cdr }; + + init(i : Int, rest : List) : List { + { + car <- i; + cdr <- rest; + self; + } }; + }; + + +(* + * The Main class shows how to use the List class. It creates a small + * list and then repeatedly prints out its elements and takes off the + * first element of the list. + *) + +class Main inherits IO { + + mylist : List; + + -- Print all elements of the list. Calls itself recursively with + -- the tail of the list, until the end of the list is reached. + + print_list(l : List) : Object { + if l.isNil() then out_string("\n") + else { + out_int(l.head()); + out_string(" "); + print_list(l.tail()); + } + fi + }; + + -- Note how the dynamic dispatch mechanism is responsible to end + -- the while loop. As long as mylist is bound to an object of + -- dynamic type Cons, the dispatch to isNil calls the isNil method of + -- the Cons class, which returns false. However when we reach the + -- end of the list, mylist gets bound to the object that was + -- created by the (new List) expression. This object is of dynamic type + -- List, and thus the method isNil in the List class is called and + -- returns true. + + main() : Object { + { + mylist <- new List.cons(1).cons(2).cons(3).cons(4).cons(5); + while (not mylist.isNil()) loop + { + print_list(mylist); + mylist <- mylist.tail(); + } + pool; + } + }; + +}; """ pipeline(text, 5) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index d8e4fd0b..bc95c874 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -84,6 +84,7 @@ def _(self, node: cil.TypeNode): # noqa: F811 self.register_instruction( FixedData(f"{node.name}_vtable", ", ".join(x[1] for x in node.methods)) ) + self.comment("Function END") self.comment("\n\n") @@ -104,6 +105,7 @@ def _(self, node: cil.TypeNode): # noqa: F811 self.register_instruction( FixedData(f"{node.name}_vtable_pointer", f"{node.name}_vtable") ) + self.comment("Function END") # Declarar los atributos: Si los atributos son de tipo string, guardarlos como asciiz # de lo contrario son o numeros o punteros y se inicializan como .words diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 5441cb5c..b139a06e 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -14,7 +14,8 @@ ArgNode, AssignNode, CilNode, - CilProgramNode, ConcatString, + CilProgramNode, + ConcatString, DataNode, DivNode, DynamicCallNode, @@ -129,6 +130,12 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: ), ) ) + else: + new_type_node.methods.append( + (method, self.to_function_name(method, node.idx)) + ) + + defined_methods = [x for x, _ in new_type_node.methods] # Registrar cada atributo y metodo para este tipo # la seccion .Type debe tener la siguiente forma: @@ -144,9 +151,10 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: new_type_node.attributes.append(attribute) for method in methods: - new_type_node.methods.append( - (method, self.to_function_name(method, node.idx)) - ) + if method not in defined_methods: + new_type_node.methods.append( + (method, self.to_function_name(method, node.idx)) + ) # Visitar los atributos definidos en la clase para generar sus funciones # de inicializacion @@ -334,7 +342,6 @@ def _(self, node: coolAst.AssignNode, scope: Scope): self.register_instruction(AssignNode(var, rvalue_vm_holder)) else: assert self.current_type is not None - assert isinstance(rvalue_vm_holder, LocalNode) self.register_instruction( SetAttributeNode(self.current_type, node.idx, rvalue_vm_holder) ) @@ -563,7 +570,7 @@ def _(self, node: coolAst.StringConstant, scope: Scope) -> LocalNode: # Cargar el string en la variable interna self.register_instruction( - AllocateStringNode(str_const_vm_holder, s1, len(node.lex)) + AllocateStringNode(str_const_vm_holder, s1, len(node.lex) - 2) ) # Devolver la variable que contiene el string diff --git a/src/travels/inference.py b/src/travels/inference.py index d89c1167..8950b1ae 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -773,4 +773,4 @@ def _(self, node: coolAst.IsVoidNode, scope, infered_type=None, deep=1): @visit.register def _(self, node: SelfNode, scope, infered_type=None, deep=1): - return self.SELF_TYPE + return self.current_type diff --git a/tests/codegen/atoi.mips b/tests/codegen/atoi.mips index 44f4ae7a..110f9da7 100644 --- a/tests/codegen/atoi.mips +++ b/tests/codegen/atoi.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 01:31:55 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:41:07 2020 # School of Math and Computer Science, University of Havana # @@ -19,235 +19,245 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END # # **** Type RECORD for type IO **** IO_start: IO_vtable_pointer: .word IO_vtable - IO_end: - # - - - # **** VTABLE for type Object **** - Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object - # - - - # **** Type RECORD for type Object **** - Object_start: - Object_vtable_pointer: .word Object_vtable - Object_end: - # - - - # **** VTABLE for type String **** - String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String - # - - - # **** Type RECORD for type String **** - String_start: - String_vtable_pointer: .word String_vtable - String_end: - # + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# - # **** VTABLE for type A2I **** - A2I_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_c2i_at_A2I, function_i2c_at_A2I, function_a2i_at_A2I, function_a2i_aux_at_A2I, function_i2a_at_A2I, function_i2a_aux_at_A2I - # +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# - # **** Type RECORD for type A2I **** - A2I_start: - A2I_vtable_pointer: .word A2I_vtable - A2I_end: - # +# **** VTABLE for type A2I **** +A2I_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_c2i_at_A2I, function_i2c_at_A2I, function_a2i_at_A2I, function_a2i_aux_at_A2I, function_i2a_at_A2I, function_i2a_aux_at_A2I +# Function END +# - # **** VTABLE for type Main **** - Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main - # +# **** Type RECORD for type A2I **** +A2I_start: + A2I_vtable_pointer: .word A2I_vtable + # Function END +A2I_end: +# - # **** Type RECORD for type Main **** - Main_start: - Main_vtable_pointer: .word Main_vtable - Main_end: - # +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +# Function END +# - data_0: .asciiz "" - # +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# - __Object_Object_tdt_entry__: .word 0 - __Object_Int_tdt_entry__: .word 1 - __Object_String_tdt_entry__: .word 1 - __Object_Bool_tdt_entry__: .word 1 - __Object_IO_tdt_entry__: .word 1 - __Object_A2I_tdt_entry__: .word 1 - __Object_Main_tdt_entry__: .word 2 - __Int_Object_tdt_entry__: .word -1 - __Int_Int_tdt_entry__: .word 0 - __Int_String_tdt_entry__: .word -1 - __Int_Bool_tdt_entry__: .word -1 - __Int_IO_tdt_entry__: .word -1 - __Int_A2I_tdt_entry__: .word -1 - __Int_Main_tdt_entry__: .word -1 - __String_Object_tdt_entry__: .word -1 - __String_Int_tdt_entry__: .word -1 - __String_String_tdt_entry__: .word 0 - __String_Bool_tdt_entry__: .word -1 - __String_IO_tdt_entry__: .word -1 - __String_A2I_tdt_entry__: .word -1 - __String_Main_tdt_entry__: .word -1 - __Bool_Object_tdt_entry__: .word -1 - __Bool_Int_tdt_entry__: .word -1 - __Bool_String_tdt_entry__: .word -1 - __Bool_Bool_tdt_entry__: .word 0 - __Bool_IO_tdt_entry__: .word -1 - __Bool_A2I_tdt_entry__: .word -1 - __Bool_Main_tdt_entry__: .word -1 - __IO_Object_tdt_entry__: .word -1 - __IO_Int_tdt_entry__: .word -1 - __IO_String_tdt_entry__: .word -1 - __IO_Bool_tdt_entry__: .word -1 - __IO_IO_tdt_entry__: .word 0 - __IO_A2I_tdt_entry__: .word -1 - __IO_Main_tdt_entry__: .word 1 - __A2I_Object_tdt_entry__: .word -1 - __A2I_Int_tdt_entry__: .word -1 - __A2I_String_tdt_entry__: .word -1 - __A2I_Bool_tdt_entry__: .word -1 - __A2I_IO_tdt_entry__: .word -1 - __A2I_A2I_tdt_entry__: .word 0 - __A2I_Main_tdt_entry__: .word -1 - __Main_Object_tdt_entry__: .word -1 - __Main_Int_tdt_entry__: .word -1 - __Main_String_tdt_entry__: .word -1 - __Main_Bool_tdt_entry__: .word -1 - __Main_IO_tdt_entry__: .word -1 - __Main_A2I_tdt_entry__: .word -1 - __Main_Main_tdt_entry__: .word 0 - # +data_0: .asciiz "" +# - data_2: .asciiz "0" - # +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_A2I_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_A2I_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_A2I_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_A2I_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_A2I_tdt_entry__: .word -1 +__IO_Main_tdt_entry__: .word 1 +__A2I_Object_tdt_entry__: .word -1 +__A2I_Int_tdt_entry__: .word -1 +__A2I_String_tdt_entry__: .word -1 +__A2I_Bool_tdt_entry__: .word -1 +__A2I_IO_tdt_entry__: .word -1 +__A2I_A2I_tdt_entry__: .word 0 +__A2I_Main_tdt_entry__: .word -1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_A2I_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +data_2: .asciiz "0" +# - data_3: .asciiz "1" - # +data_3: .asciiz "1" +# - data_4: .asciiz "2" - # +data_4: .asciiz "2" +# - data_5: .asciiz "3" - # +data_5: .asciiz "3" +# - data_6: .asciiz "4" - # +data_6: .asciiz "4" +# - data_7: .asciiz "5" - # +data_7: .asciiz "5" +# - data_8: .asciiz "6" - # +data_8: .asciiz "6" +# - data_9: .asciiz "7" - # +data_9: .asciiz "7" +# - data_10: .asciiz "8" - # +data_10: .asciiz "8" +# - data_11: .asciiz "9" - # +data_11: .asciiz "9" +# - data_12: .asciiz "0" - # +data_12: .asciiz "0" +# - data_13: .asciiz "1" - # +data_13: .asciiz "1" +# - data_14: .asciiz "2" - # +data_14: .asciiz "2" +# - data_15: .asciiz "3" - # +data_15: .asciiz "3" +# - data_16: .asciiz "4" - # +data_16: .asciiz "4" +# - data_17: .asciiz "5" - # +data_17: .asciiz "5" +# - data_18: .asciiz "6" - # +data_18: .asciiz "6" +# - data_19: .asciiz "7" - # +data_19: .asciiz "7" +# - data_20: .asciiz "8" - # +data_20: .asciiz "8" +# - data_21: .asciiz "9" - # +data_21: .asciiz "9" +# - data_22: .asciiz "" - # +data_22: .asciiz "" +# - data_23: .asciiz "-" - # +data_23: .asciiz "-" +# - data_24: .asciiz "+" - # +data_24: .asciiz "+" +# - data_25: .asciiz "0" - # +data_25: .asciiz "0" +# - data_26: .asciiz "-" - # +data_26: .asciiz "-" +# - data_27: .asciiz "" - # +data_27: .asciiz "" +# - data_28: .asciiz "678987" - # +data_28: .asciiz "678987" +# - data_29: .asciiz " == " - # +data_29: .asciiz " == " +# - data_30: .asciiz "\n" - # +data_30: .asciiz "\n" +# .text @@ -370,6 +380,8 @@ function_abort_at_Object: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 + li $a0, 10 + syscall # Function END @@ -430,19 +442,75 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t1, 12($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t2, 12($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t1, $t2 + move $t4, $a0 + # Get first string from self + lw $t1, 8($s1) + # Get second string from param + lw $t2, 8($v0) + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t3, $v0 + move $t5, $zero + concat_loop1: + # Compare t1 with \0 + lb $t5, 0($t1) + beqz $t5, concat_loop1_end + # Copy 1 byte + sb $t5, 0($t3) + addu $t3, $t3, 1 + addu $t1, $t1, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t2 with \0 + lb $t5, 0($t2) + beqz $t5, concat_loop2_end + # Copy 1 byte + sb $t5, 0($t3) + addu $t3, $t3, 1 + addu $t2, $t2, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t3) + # v0 contains resulting string + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + sw $t2, 8($v0) + sw $t4, 12($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END # function_substr_at_String implementation. @@ -490,7 +558,7 @@ function_substr_at_String: la $t1, String_start sw $t1, 4($v0) sw $t2, 8($v0) - sw $s0, 12($v0) + sw $t4, 12($v0) sw $v0, -4($fp) # RETURN local_substr_at_String_internal_0 lw $v0, -4($fp) @@ -592,7 +660,7 @@ function_c2i_at_A2I: sw $t1, 4($v0) la $t1, data_2 sw $t1, 8($v0) - li $t1, 3 + li $t1, 1 sw $t1, 12($v0) sw $v0, -8($fp) # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) @@ -638,7 +706,7 @@ label_FALSE_1: sw $t1, 4($v0) la $t1, data_3 sw $t1, 8($v0) - li $t1, 3 + li $t1, 1 sw $t1, 12($v0) sw $v0, -16($fp) # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) @@ -684,7 +752,7 @@ label_FALSE_5: sw $t1, 4($v0) la $t1, data_4 sw $t1, 8($v0) - li $t1, 3 + li $t1, 1 sw $t1, 12($v0) sw $v0, -24($fp) # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) @@ -730,7 +798,7 @@ label_FALSE_9: sw $t1, 4($v0) la $t1, data_5 sw $t1, 8($v0) - li $t1, 3 + li $t1, 1 sw $t1, 12($v0) sw $v0, -32($fp) # LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) @@ -776,7 +844,7 @@ label_FALSE_13: sw $t1, 4($v0) la $t1, data_6 sw $t1, 8($v0) - li $t1, 3 + li $t1, 1 sw $t1, 12($v0) sw $v0, -40($fp) # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) @@ -822,7 +890,7 @@ label_FALSE_17: sw $t1, 4($v0) la $t1, data_7 sw $t1, 8($v0) - li $t1, 3 + li $t1, 1 sw $t1, 12($v0) sw $v0, -48($fp) # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) @@ -868,7 +936,7 @@ label_FALSE_21: sw $t1, 4($v0) la $t1, data_8 sw $t1, 8($v0) - li $t1, 3 + li $t1, 1 sw $t1, 12($v0) sw $v0, -56($fp) # LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) @@ -914,7 +982,7 @@ label_FALSE_25: sw $t1, 4($v0) la $t1, data_9 sw $t1, 8($v0) - li $t1, 3 + li $t1, 1 sw $t1, 12($v0) sw $v0, -64($fp) # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) @@ -960,7 +1028,7 @@ label_FALSE_29: sw $t1, 4($v0) la $t1, data_10 sw $t1, 8($v0) - li $t1, 3 + li $t1, 1 sw $t1, 12($v0) sw $v0, -72($fp) # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) @@ -1006,7 +1074,7 @@ label_FALSE_33: sw $t1, 4($v0) la $t1, data_11 sw $t1, 8($v0) - li $t1, 3 + li $t1, 1 sw $t1, 12($v0) sw $v0, -80($fp) # LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) @@ -1061,7 +1129,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 16($t2) + lw $t3, 0($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -88($fp) @@ -1139,7 +1207,7 @@ la $t1, String_start sw $t1, 4($v0) la $t1, data_12 sw $t1, 8($v0) -li $t1, 3 +li $t1, 1 sw $t1, 12($v0) sw $v0, -8($fp) # GOTO label_END_42 @@ -1183,7 +1251,7 @@ la $t1, String_start sw $t1, 4($v0) la $t1, data_13 sw $t1, 8($v0) -li $t1, 3 +li $t1, 1 sw $t1, 12($v0) sw $v0, -16($fp) # GOTO label_END_46 @@ -1227,7 +1295,7 @@ la $t1, String_start sw $t1, 4($v0) la $t1, data_14 sw $t1, 8($v0) -li $t1, 3 +li $t1, 1 sw $t1, 12($v0) sw $v0, -24($fp) # GOTO label_END_50 @@ -1271,7 +1339,7 @@ la $t1, String_start sw $t1, 4($v0) la $t1, data_15 sw $t1, 8($v0) -li $t1, 3 +li $t1, 1 sw $t1, 12($v0) sw $v0, -32($fp) # GOTO label_END_54 @@ -1315,7 +1383,7 @@ la $t1, String_start sw $t1, 4($v0) la $t1, data_16 sw $t1, 8($v0) -li $t1, 3 +li $t1, 1 sw $t1, 12($v0) sw $v0, -40($fp) # GOTO label_END_58 @@ -1359,7 +1427,7 @@ la $t1, String_start sw $t1, 4($v0) la $t1, data_17 sw $t1, 8($v0) -li $t1, 3 +li $t1, 1 sw $t1, 12($v0) sw $v0, -48($fp) # GOTO label_END_62 @@ -1403,7 +1471,7 @@ la $t1, String_start sw $t1, 4($v0) la $t1, data_18 sw $t1, 8($v0) -li $t1, 3 +li $t1, 1 sw $t1, 12($v0) sw $v0, -56($fp) # GOTO label_END_66 @@ -1447,7 +1515,7 @@ la $t1, String_start sw $t1, 4($v0) la $t1, data_19 sw $t1, 8($v0) -li $t1, 3 +li $t1, 1 sw $t1, 12($v0) sw $v0, -64($fp) # GOTO label_END_70 @@ -1491,7 +1559,7 @@ la $t1, String_start sw $t1, 4($v0) la $t1, data_20 sw $t1, 8($v0) -li $t1, 3 +li $t1, 1 sw $t1, 12($v0) sw $v0, -72($fp) # GOTO label_END_74 @@ -1535,7 +1603,7 @@ la $t1, String_start sw $t1, 4($v0) la $t1, data_21 sw $t1, 8($v0) -li $t1, 3 +li $t1, 1 sw $t1, 12($v0) sw $v0, -80($fp) # GOTO label_END_78 @@ -1562,7 +1630,7 @@ label_FALSE_77: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 16($t2) + lw $t3, 0($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -88($fp) @@ -1581,7 +1649,7 @@ label_FALSE_77: sw $t1, 4($v0) la $t1, data_22 sw $t1, 8($v0) - li $t1, 2 + li $t1, 0 sw $t1, 12($v0) sw $v0, -96($fp) label_END_78: @@ -1718,7 +1786,7 @@ label_FALSE_81: sw $t1, 4($v0) la $t1, data_23 sw $t1, 8($v0) - li $t1, 3 + li $t1, 1 sw $t1, 12($v0) sw $v0, -28($fp) # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) @@ -1799,7 +1867,7 @@ label_FALSE_85: sw $t1, 4($v0) la $t1, data_24 sw $t1, 8($v0) - li $t1, 3 + li $t1, 1 sw $t1, 12($v0) sw $v0, -44($fp) # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) @@ -2230,7 +2298,7 @@ la $t1, String_start sw $t1, 4($v0) la $t1, data_25 sw $t1, 8($v0) -li $t1, 3 +li $t1, 1 sw $t1, 12($v0) sw $v0, -8($fp) # GOTO label_END_98 @@ -2316,7 +2384,7 @@ label_FALSE_101: sw $t1, 4($v0) la $t1, data_26 sw $t1, 8($v0) - li $t1, 3 + li $t1, 1 sw $t1, 12($v0) sw $v0, -36($fp) # LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) @@ -2453,7 +2521,7 @@ la $t1, String_start sw $t1, 4($v0) la $t1, data_27 sw $t1, 8($v0) -li $t1, 2 +li $t1, 0 sw $t1, 12($v0) sw $v0, -8($fp) # GOTO label_END_106 @@ -2638,7 +2706,7 @@ function_main_at_Main: sw $t1, 4($v0) la $t1, data_28 sw $t1, 8($v0) - li $t1, 8 + li $t1, 6 sw $t1, 12($v0) sw $v0, -20($fp) # ARG local_main_at_Main_internal_4 @@ -2743,7 +2811,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 4($t2) + lw $t3, 16($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -44($fp) @@ -2773,7 +2841,7 @@ function_main_at_Main: sw $t1, 4($v0) la $t1, data_29 sw $t1, 8($v0) - li $t1, 6 + li $t1, 4 sw $t1, 12($v0) sw $v0, -64($fp) # ARG local_main_at_Main_internal_15 @@ -2792,7 +2860,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 0($t2) + lw $t3, 12($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -56($fp) @@ -2826,7 +2894,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 0($t2) + lw $t3, 12($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -72($fp) @@ -2856,7 +2924,7 @@ function_main_at_Main: sw $t1, 4($v0) la $t1, data_30 sw $t1, 8($v0) - li $t1, 4 + li $t1, 2 sw $t1, 12($v0) sw $v0, -92($fp) # ARG local_main_at_Main_internal_22 @@ -2875,7 +2943,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 0($t2) + lw $t3, 12($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -84($fp) diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips index 5f4044be..d65ef60e 100644 --- a/tests/codegen/fib.mips +++ b/tests/codegen/fib.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 01:31:54 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:41:05 2020 # School of Math and Computer Science, University of Havana # @@ -17,102 +17,110 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END # # **** Type RECORD for type IO **** IO_start: IO_vtable_pointer: .word IO_vtable - IO_end: - # + # Function END +IO_end: +# - # **** VTABLE for type Object **** - Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object - # +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# - # **** Type RECORD for type Object **** - Object_start: - Object_vtable_pointer: .word Object_vtable - Object_end: - # +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# - # **** VTABLE for type String **** - String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String - # +# **** VTABLE for type String **** +String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# - # **** Type RECORD for type String **** - String_start: - String_vtable_pointer: .word String_vtable - String_end: - # +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# - # **** VTABLE for type Main **** - Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main, function_fib_at_Main - # +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main, function_fib_at_Main +# Function END +# - # **** Type RECORD for type Main **** - Main_start: - Main_vtable_pointer: .word Main_vtable - Main_end: - # +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# - data_0: .asciiz "" - # +data_0: .asciiz "" +# - __Object_Object_tdt_entry__: .word 0 - __Object_Int_tdt_entry__: .word 1 - __Object_String_tdt_entry__: .word 1 - __Object_Bool_tdt_entry__: .word 1 - __Object_IO_tdt_entry__: .word 1 - __Object_Main_tdt_entry__: .word 2 - __Int_Object_tdt_entry__: .word -1 - __Int_Int_tdt_entry__: .word 0 - __Int_String_tdt_entry__: .word -1 - __Int_Bool_tdt_entry__: .word -1 - __Int_IO_tdt_entry__: .word -1 - __Int_Main_tdt_entry__: .word -1 - __String_Object_tdt_entry__: .word -1 - __String_Int_tdt_entry__: .word -1 - __String_String_tdt_entry__: .word 0 - __String_Bool_tdt_entry__: .word -1 - __String_IO_tdt_entry__: .word -1 - __String_Main_tdt_entry__: .word -1 - __Bool_Object_tdt_entry__: .word -1 - __Bool_Int_tdt_entry__: .word -1 - __Bool_String_tdt_entry__: .word -1 - __Bool_Bool_tdt_entry__: .word 0 - __Bool_IO_tdt_entry__: .word -1 - __Bool_Main_tdt_entry__: .word -1 - __IO_Object_tdt_entry__: .word -1 - __IO_Int_tdt_entry__: .word -1 - __IO_String_tdt_entry__: .word -1 - __IO_Bool_tdt_entry__: .word -1 - __IO_IO_tdt_entry__: .word 0 - __IO_Main_tdt_entry__: .word 1 - __Main_Object_tdt_entry__: .word -1 - __Main_Int_tdt_entry__: .word -1 - __Main_String_tdt_entry__: .word -1 - __Main_Bool_tdt_entry__: .word -1 - __Main_IO_tdt_entry__: .word -1 - __Main_Main_tdt_entry__: .word 0 - # +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_Main_tdt_entry__: .word 1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# - data_2: .asciiz "Enter n to find nth fibonacci number!\n" - # +data_2: .asciiz "Enter n to find nth fibonacci number!\n" +# - data_3: .asciiz "\n" - # +data_3: .asciiz "\n" +# .text @@ -235,6 +243,8 @@ function_abort_at_Object: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 + li $a0, 10 + syscall # Function END @@ -295,19 +305,75 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t1, 12($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t2, 12($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t1, $t2 + move $t4, $a0 + # Get first string from self + lw $t1, 8($s1) + # Get second string from param + lw $t2, 8($v0) + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t3, $v0 + move $t5, $zero + concat_loop1: + # Compare t1 with \0 + lb $t5, 0($t1) + beqz $t5, concat_loop1_end + # Copy 1 byte + sb $t5, 0($t3) + addu $t3, $t3, 1 + addu $t1, $t1, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t2 with \0 + lb $t5, 0($t2) + beqz $t5, concat_loop2_end + # Copy 1 byte + sb $t5, 0($t3) + addu $t3, $t3, 1 + addu $t2, $t2, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t3) + # v0 contains resulting string + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + sw $t2, 8($v0) + sw $t4, 12($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END # function_substr_at_String implementation. @@ -355,7 +421,7 @@ function_substr_at_String: la $t1, String_start sw $t1, 4($v0) sw $t2, 8($v0) - sw $s0, 12($v0) + sw $t4, 12($v0) sw $v0, -4($fp) # RETURN local_substr_at_String_internal_0 lw $v0, -4($fp) @@ -467,7 +533,7 @@ function_main_at_Main: sw $t1, 4($v0) la $t1, data_2 sw $t1, 8($v0) - li $t1, 41 + li $t1, 39 sw $t1, 12($v0) sw $v0, -16($fp) # ARG local_main_at_Main_internal_3 @@ -486,7 +552,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 0($t2) + lw $t3, 12($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -8($fp) @@ -536,7 +602,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 12($t2) + lw $t3, 24($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -48($fp) @@ -582,7 +648,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 4($t2) + lw $t3, 16($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -24($fp) @@ -612,7 +678,7 @@ function_main_at_Main: sw $t1, 4($v0) la $t1, data_3 sw $t1, 8($v0) - li $t1, 4 + li $t1, 2 sw $t1, 12($v0) sw $v0, -68($fp) # ARG local_main_at_Main_internal_16 @@ -631,7 +697,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 0($t2) + lw $t3, 12($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -60($fp) diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips index 15afc26c..955b8ee5 100644 --- a/tests/codegen/hello_world.mips +++ b/tests/codegen/hello_world.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 01:31:53 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:41:05 2020 # School of Math and Computer Science, University of Havana # @@ -17,98 +17,106 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END # # **** Type RECORD for type IO **** IO_start: IO_vtable_pointer: .word IO_vtable - IO_end: - # - - - # **** VTABLE for type Object **** - Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object - # - - - # **** Type RECORD for type Object **** - Object_start: - Object_vtable_pointer: .word Object_vtable - Object_end: - # - - - # **** VTABLE for type String **** - String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String - # - - - # **** Type RECORD for type String **** - String_start: - String_vtable_pointer: .word String_vtable - String_end: - # - - - # **** VTABLE for type Main **** - Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main - # - - - # **** Type RECORD for type Main **** - Main_start: - Main_vtable_pointer: .word Main_vtable - Main_end: - # - - - data_0: .asciiz "" - # - - - __Object_Object_tdt_entry__: .word 0 - __Object_Int_tdt_entry__: .word 1 - __Object_String_tdt_entry__: .word 1 - __Object_Bool_tdt_entry__: .word 1 - __Object_IO_tdt_entry__: .word 1 - __Object_Main_tdt_entry__: .word 2 - __Int_Object_tdt_entry__: .word -1 - __Int_Int_tdt_entry__: .word 0 - __Int_String_tdt_entry__: .word -1 - __Int_Bool_tdt_entry__: .word -1 - __Int_IO_tdt_entry__: .word -1 - __Int_Main_tdt_entry__: .word -1 - __String_Object_tdt_entry__: .word -1 - __String_Int_tdt_entry__: .word -1 - __String_String_tdt_entry__: .word 0 - __String_Bool_tdt_entry__: .word -1 - __String_IO_tdt_entry__: .word -1 - __String_Main_tdt_entry__: .word -1 - __Bool_Object_tdt_entry__: .word -1 - __Bool_Int_tdt_entry__: .word -1 - __Bool_String_tdt_entry__: .word -1 - __Bool_Bool_tdt_entry__: .word 0 - __Bool_IO_tdt_entry__: .word -1 - __Bool_Main_tdt_entry__: .word -1 - __IO_Object_tdt_entry__: .word -1 - __IO_Int_tdt_entry__: .word -1 - __IO_String_tdt_entry__: .word -1 - __IO_Bool_tdt_entry__: .word -1 - __IO_IO_tdt_entry__: .word 0 - __IO_Main_tdt_entry__: .word 1 - __Main_Object_tdt_entry__: .word -1 - __Main_Int_tdt_entry__: .word -1 - __Main_String_tdt_entry__: .word -1 - __Main_Bool_tdt_entry__: .word -1 - __Main_IO_tdt_entry__: .word -1 - __Main_Main_tdt_entry__: .word 0 - # - - - data_2: .asciiz "Hello, World.\n" - # + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_Main_tdt_entry__: .word 1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +data_2: .asciiz "Hello, World.\n" +# .text @@ -231,6 +239,8 @@ function_abort_at_Object: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 + li $a0, 10 + syscall # Function END @@ -291,19 +301,75 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t1, 12($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t2, 12($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t1, $t2 + move $t4, $a0 + # Get first string from self + lw $t1, 8($s1) + # Get second string from param + lw $t2, 8($v0) + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t3, $v0 + move $t5, $zero + concat_loop1: + # Compare t1 with \0 + lb $t5, 0($t1) + beqz $t5, concat_loop1_end + # Copy 1 byte + sb $t5, 0($t3) + addu $t3, $t3, 1 + addu $t1, $t1, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t2 with \0 + lb $t5, 0($t2) + beqz $t5, concat_loop2_end + # Copy 1 byte + sb $t5, 0($t3) + addu $t3, $t3, 1 + addu $t2, $t2, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t3) + # v0 contains resulting string + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + sw $t2, 8($v0) + sw $t4, 12($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END # function_substr_at_String implementation. @@ -351,7 +417,7 @@ function_substr_at_String: la $t1, String_start sw $t1, 4($v0) sw $t2, 8($v0) - sw $s0, 12($v0) + sw $t4, 12($v0) sw $v0, -4($fp) # RETURN local_substr_at_String_internal_0 lw $v0, -4($fp) @@ -463,7 +529,7 @@ function_main_at_Main: sw $t1, 4($v0) la $t1, data_2 sw $t1, 8($v0) - li $t1, 17 + li $t1, 15 sw $t1, 12($v0) sw $v0, -16($fp) # ARG local_main_at_Main_internal_3 @@ -482,7 +548,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 0($t2) + lw $t3, 12($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -8($fp) diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips index a81e7370..4b64b7f4 100644 --- a/tests/codegen/io.mips +++ b/tests/codegen/io.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 01:31:54 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:41:06 2020 # School of Math and Computer Science, University of Havana # @@ -25,226 +25,242 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END # # **** Type RECORD for type IO **** IO_start: IO_vtable_pointer: .word IO_vtable - IO_end: - # + # Function END +IO_end: +# - # **** VTABLE for type Object **** - Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object - # +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# - # **** Type RECORD for type Object **** - Object_start: - Object_vtable_pointer: .word Object_vtable - Object_end: - # +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# - # **** VTABLE for type String **** - String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String - # +# **** VTABLE for type String **** +String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# - # **** Type RECORD for type String **** - String_start: - String_vtable_pointer: .word String_vtable - String_end: - # +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# - # **** VTABLE for type A **** - A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A - # - - - # **** Type RECORD for type A **** - A_start: - A_vtable_pointer: .word A_vtable - A_end: - # - - - # **** VTABLE for type B **** - B_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A, function_out_b_at_B - # - - - # **** Type RECORD for type B **** - B_start: - B_vtable_pointer: .word B_vtable - B_end: - # - - - # **** VTABLE for type C **** - C_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_c_at_C - # - - - # **** Type RECORD for type C **** - C_start: - C_vtable_pointer: .word C_vtable - C_end: - # - - - # **** VTABLE for type D **** - D_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_c_at_C, function_out_d_at_D - # - - - # **** Type RECORD for type D **** - D_start: - D_vtable_pointer: .word D_vtable - D_end: - # - - - # **** VTABLE for type Main **** - Main_vtable: .word function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main - # - - - # **** Type RECORD for type Main **** - Main_start: - Main_vtable_pointer: .word Main_vtable - Main_end: - # - - - data_0: .asciiz "" - # - - - __Object_Object_tdt_entry__: .word 0 - __Object_Int_tdt_entry__: .word 1 - __Object_String_tdt_entry__: .word 1 - __Object_Bool_tdt_entry__: .word 1 - __Object_IO_tdt_entry__: .word 1 - __Object_A_tdt_entry__: .word 1 - __Object_B_tdt_entry__: .word 2 - __Object_C_tdt_entry__: .word 2 - __Object_D_tdt_entry__: .word 3 - __Object_Main_tdt_entry__: .word 2 - __Int_Object_tdt_entry__: .word -1 - __Int_Int_tdt_entry__: .word 0 - __Int_String_tdt_entry__: .word -1 - __Int_Bool_tdt_entry__: .word -1 - __Int_IO_tdt_entry__: .word -1 - __Int_A_tdt_entry__: .word -1 - __Int_B_tdt_entry__: .word -1 - __Int_C_tdt_entry__: .word -1 - __Int_D_tdt_entry__: .word -1 - __Int_Main_tdt_entry__: .word -1 - __String_Object_tdt_entry__: .word -1 - __String_Int_tdt_entry__: .word -1 - __String_String_tdt_entry__: .word 0 - __String_Bool_tdt_entry__: .word -1 - __String_IO_tdt_entry__: .word -1 - __String_A_tdt_entry__: .word -1 - __String_B_tdt_entry__: .word -1 - __String_C_tdt_entry__: .word -1 - __String_D_tdt_entry__: .word -1 - __String_Main_tdt_entry__: .word -1 - __Bool_Object_tdt_entry__: .word -1 - __Bool_Int_tdt_entry__: .word -1 - __Bool_String_tdt_entry__: .word -1 - __Bool_Bool_tdt_entry__: .word 0 - __Bool_IO_tdt_entry__: .word -1 - __Bool_A_tdt_entry__: .word -1 - __Bool_B_tdt_entry__: .word -1 - __Bool_C_tdt_entry__: .word -1 - __Bool_D_tdt_entry__: .word -1 - __Bool_Main_tdt_entry__: .word -1 - __IO_Object_tdt_entry__: .word -1 - __IO_Int_tdt_entry__: .word -1 - __IO_String_tdt_entry__: .word -1 - __IO_Bool_tdt_entry__: .word -1 - __IO_IO_tdt_entry__: .word 0 - __IO_A_tdt_entry__: .word -1 - __IO_B_tdt_entry__: .word -1 - __IO_C_tdt_entry__: .word 1 - __IO_D_tdt_entry__: .word 2 - __IO_Main_tdt_entry__: .word 1 - __A_Object_tdt_entry__: .word -1 - __A_Int_tdt_entry__: .word -1 - __A_String_tdt_entry__: .word -1 - __A_Bool_tdt_entry__: .word -1 - __A_IO_tdt_entry__: .word -1 - __A_A_tdt_entry__: .word 0 - __A_B_tdt_entry__: .word 1 - __A_C_tdt_entry__: .word -1 - __A_D_tdt_entry__: .word -1 - __A_Main_tdt_entry__: .word -1 - __B_Object_tdt_entry__: .word -1 - __B_Int_tdt_entry__: .word -1 - __B_String_tdt_entry__: .word -1 - __B_Bool_tdt_entry__: .word -1 - __B_IO_tdt_entry__: .word -1 - __B_A_tdt_entry__: .word -1 - __B_B_tdt_entry__: .word 0 - __B_C_tdt_entry__: .word -1 - __B_D_tdt_entry__: .word -1 - __B_Main_tdt_entry__: .word -1 - __C_Object_tdt_entry__: .word -1 - __C_Int_tdt_entry__: .word -1 - __C_String_tdt_entry__: .word -1 - __C_Bool_tdt_entry__: .word -1 - __C_IO_tdt_entry__: .word -1 - __C_A_tdt_entry__: .word -1 - __C_B_tdt_entry__: .word -1 - __C_C_tdt_entry__: .word 0 - __C_D_tdt_entry__: .word 1 - __C_Main_tdt_entry__: .word -1 - __D_Object_tdt_entry__: .word -1 - __D_Int_tdt_entry__: .word -1 - __D_String_tdt_entry__: .word -1 - __D_Bool_tdt_entry__: .word -1 - __D_IO_tdt_entry__: .word -1 - __D_A_tdt_entry__: .word -1 - __D_B_tdt_entry__: .word -1 - __D_C_tdt_entry__: .word -1 - __D_D_tdt_entry__: .word 0 - __D_Main_tdt_entry__: .word -1 - __Main_Object_tdt_entry__: .word -1 - __Main_Int_tdt_entry__: .word -1 - __Main_String_tdt_entry__: .word -1 - __Main_Bool_tdt_entry__: .word -1 - __Main_IO_tdt_entry__: .word -1 - __Main_A_tdt_entry__: .word -1 - __Main_B_tdt_entry__: .word -1 - __Main_C_tdt_entry__: .word -1 - __Main_D_tdt_entry__: .word -1 - __Main_Main_tdt_entry__: .word 0 - # - - - data_2: .asciiz "A: Hello world\n" - # - - - data_3: .asciiz "B: Hello world\n" - # - - - data_4: .asciiz "C: Hello world\n" - # - - - data_5: .asciiz "D: Hello world\n" - # - - - data_6: .asciiz "Done.\n" - # +# **** VTABLE for type A **** +A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A +# Function END +# + + +# **** Type RECORD for type A **** +A_start: + A_vtable_pointer: .word A_vtable + # Function END +A_end: +# + + +# **** VTABLE for type B **** +B_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A, function_out_b_at_B +# Function END +# + + +# **** Type RECORD for type B **** +B_start: + B_vtable_pointer: .word B_vtable + # Function END +B_end: +# + + +# **** VTABLE for type C **** +C_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_out_c_at_C +# Function END +# + + +# **** Type RECORD for type C **** +C_start: + C_vtable_pointer: .word C_vtable + # Function END +C_end: +# + + +# **** VTABLE for type D **** +D_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_out_c_at_C, function_out_d_at_D +# Function END +# + + +# **** Type RECORD for type D **** +D_start: + D_vtable_pointer: .word D_vtable + # Function END +D_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_A_tdt_entry__: .word 1 +__Object_B_tdt_entry__: .word 2 +__Object_C_tdt_entry__: .word 2 +__Object_D_tdt_entry__: .word 3 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_A_tdt_entry__: .word -1 +__Int_B_tdt_entry__: .word -1 +__Int_C_tdt_entry__: .word -1 +__Int_D_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_A_tdt_entry__: .word -1 +__String_B_tdt_entry__: .word -1 +__String_C_tdt_entry__: .word -1 +__String_D_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_A_tdt_entry__: .word -1 +__Bool_B_tdt_entry__: .word -1 +__Bool_C_tdt_entry__: .word -1 +__Bool_D_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_A_tdt_entry__: .word -1 +__IO_B_tdt_entry__: .word -1 +__IO_C_tdt_entry__: .word 1 +__IO_D_tdt_entry__: .word 2 +__IO_Main_tdt_entry__: .word 1 +__A_Object_tdt_entry__: .word -1 +__A_Int_tdt_entry__: .word -1 +__A_String_tdt_entry__: .word -1 +__A_Bool_tdt_entry__: .word -1 +__A_IO_tdt_entry__: .word -1 +__A_A_tdt_entry__: .word 0 +__A_B_tdt_entry__: .word 1 +__A_C_tdt_entry__: .word -1 +__A_D_tdt_entry__: .word -1 +__A_Main_tdt_entry__: .word -1 +__B_Object_tdt_entry__: .word -1 +__B_Int_tdt_entry__: .word -1 +__B_String_tdt_entry__: .word -1 +__B_Bool_tdt_entry__: .word -1 +__B_IO_tdt_entry__: .word -1 +__B_A_tdt_entry__: .word -1 +__B_B_tdt_entry__: .word 0 +__B_C_tdt_entry__: .word -1 +__B_D_tdt_entry__: .word -1 +__B_Main_tdt_entry__: .word -1 +__C_Object_tdt_entry__: .word -1 +__C_Int_tdt_entry__: .word -1 +__C_String_tdt_entry__: .word -1 +__C_Bool_tdt_entry__: .word -1 +__C_IO_tdt_entry__: .word -1 +__C_A_tdt_entry__: .word -1 +__C_B_tdt_entry__: .word -1 +__C_C_tdt_entry__: .word 0 +__C_D_tdt_entry__: .word 1 +__C_Main_tdt_entry__: .word -1 +__D_Object_tdt_entry__: .word -1 +__D_Int_tdt_entry__: .word -1 +__D_String_tdt_entry__: .word -1 +__D_Bool_tdt_entry__: .word -1 +__D_IO_tdt_entry__: .word -1 +__D_A_tdt_entry__: .word -1 +__D_B_tdt_entry__: .word -1 +__D_C_tdt_entry__: .word -1 +__D_D_tdt_entry__: .word 0 +__D_Main_tdt_entry__: .word -1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_A_tdt_entry__: .word -1 +__Main_B_tdt_entry__: .word -1 +__Main_C_tdt_entry__: .word -1 +__Main_D_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +data_2: .asciiz "A: Hello world\n" +# + + +data_3: .asciiz "B: Hello world\n" +# + + +data_4: .asciiz "C: Hello world\n" +# + + +data_5: .asciiz "D: Hello world\n" +# + + +data_6: .asciiz "Done.\n" +# .text @@ -367,6 +383,8 @@ function_abort_at_Object: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 + li $a0, 10 + syscall # Function END @@ -427,19 +445,75 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t1, 12($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t2, 12($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t1, $t2 + move $t4, $a0 + # Get first string from self + lw $t1, 8($s1) + # Get second string from param + lw $t2, 8($v0) + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t3, $v0 + move $t5, $zero + concat_loop1: + # Compare t1 with \0 + lb $t5, 0($t1) + beqz $t5, concat_loop1_end + # Copy 1 byte + sb $t5, 0($t3) + addu $t3, $t3, 1 + addu $t1, $t1, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t2 with \0 + lb $t5, 0($t2) + beqz $t5, concat_loop2_end + # Copy 1 byte + sb $t5, 0($t3) + addu $t3, $t3, 1 + addu $t2, $t2, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t3) + # v0 contains resulting string + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + sw $t2, 8($v0) + sw $t4, 12($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END # function_substr_at_String implementation. @@ -487,7 +561,7 @@ function_substr_at_String: la $t1, String_start sw $t1, 4($v0) sw $t2, 8($v0) - sw $s0, 12($v0) + sw $t4, 12($v0) sw $v0, -4($fp) # RETURN local_substr_at_String_internal_0 lw $v0, -4($fp) @@ -633,7 +707,7 @@ function_out_a_at_A: sw $t1, 4($v0) la $t1, data_2 sw $t1, 8($v0) - li $t1, 18 + li $t1, 16 sw $t1, 12($v0) sw $v0, -16($fp) # ARG local_out_a_at_A_internal_3 @@ -652,7 +726,7 @@ function_out_a_at_A: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 0($t2) + lw $t3, 12($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -8($fp) @@ -704,7 +778,7 @@ function_out_b_at_B: sw $t1, 4($v0) la $t1, data_3 sw $t1, 8($v0) - li $t1, 18 + li $t1, 16 sw $t1, 12($v0) sw $v0, -16($fp) # ARG local_out_b_at_B_internal_3 @@ -723,7 +797,7 @@ function_out_b_at_B: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 0($t2) + lw $t3, 12($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -8($fp) @@ -774,7 +848,7 @@ function_out_c_at_C: sw $t1, 4($v0) la $t1, data_4 sw $t1, 8($v0) - li $t1, 18 + li $t1, 16 sw $t1, 12($v0) sw $v0, -16($fp) # ARG local_out_c_at_C_internal_3 @@ -793,7 +867,7 @@ function_out_c_at_C: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 0($t2) + lw $t3, 12($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -8($fp) @@ -844,7 +918,7 @@ function_out_d_at_D: sw $t1, 4($v0) la $t1, data_5 sw $t1, 8($v0) - li $t1, 18 + li $t1, 16 sw $t1, 12($v0) sw $v0, -16($fp) # ARG local_out_d_at_D_internal_3 @@ -863,7 +937,7 @@ function_out_d_at_D: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 0($t2) + lw $t3, 12($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -8($fp) @@ -1078,7 +1152,7 @@ function_main_at_Main: sw $t1, 4($v0) la $t1, data_6 sw $t1, 8($v0) - li $t1, 9 + li $t1, 7 sw $t1, 12($v0) sw $v0, -64($fp) # ARG local_main_at_Main_internal_15 @@ -1097,7 +1171,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 0($t2) + lw $t3, 12($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -56($fp) diff --git a/tests/codegen/list.mips b/tests/codegen/list.mips new file mode 100644 index 00000000..a2cec863 --- /dev/null +++ b/tests/codegen/list.mips @@ -0,0 +1,1537 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:41:06 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +List: .asciiz "List" +# Function END +Cons: .asciiz "Cons" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type List **** +List_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_isNil_at_List, function_head_at_List, function_tail_at_List, function_cons_at_List +# Function END +# + + +# **** Type RECORD for type List **** +List_start: + List_vtable_pointer: .word List_vtable + # Function END +List_end: +# + + +# **** VTABLE for type Cons **** +Cons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_isNil_at_Cons, function_head_at_Cons, function_tail_at_Cons, function_cons_at_List, function_init_at_Cons +# Function END +# + + +# **** Type RECORD for type Cons **** +Cons_start: + Cons_vtable_pointer: .word Cons_vtable + # Function END +Cons_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_print_list_at_Main, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_List_tdt_entry__: .word 1 +__Object_Cons_tdt_entry__: .word 2 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_List_tdt_entry__: .word -1 +__Int_Cons_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_List_tdt_entry__: .word -1 +__String_Cons_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_List_tdt_entry__: .word -1 +__Bool_Cons_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_List_tdt_entry__: .word -1 +__IO_Cons_tdt_entry__: .word -1 +__IO_Main_tdt_entry__: .word 1 +__List_Object_tdt_entry__: .word -1 +__List_Int_tdt_entry__: .word -1 +__List_String_tdt_entry__: .word -1 +__List_Bool_tdt_entry__: .word -1 +__List_IO_tdt_entry__: .word -1 +__List_List_tdt_entry__: .word 0 +__List_Cons_tdt_entry__: .word 1 +__List_Main_tdt_entry__: .word -1 +__Cons_Object_tdt_entry__: .word -1 +__Cons_Int_tdt_entry__: .word -1 +__Cons_String_tdt_entry__: .word -1 +__Cons_Bool_tdt_entry__: .word -1 +__Cons_IO_tdt_entry__: .word -1 +__Cons_List_tdt_entry__: .word -1 +__Cons_Cons_tdt_entry__: .word 0 +__Cons_Main_tdt_entry__: .word -1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_List_tdt_entry__: .word -1 +__Main_Cons_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +data_2: .asciiz "\n" +# + + +data_3: .asciiz " " +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # RETURN + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 8($v0) + li $v0, 4 + syscall + # RETURN + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + li $a0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t1, 12($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t2, 12($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t1, $t2 + move $t4, $a0 + # Get first string from self + lw $t1, 8($s1) + # Get second string from param + lw $t2, 8($v0) + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t3, $v0 + move $t5, $zero + concat_loop1: + # Compare t1 with \0 + lb $t5, 0($t1) + beqz $t5, concat_loop1_end + # Copy 1 byte + sb $t5, 0($t3) + addu $t3, $t3, 1 + addu $t1, $t1, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t2 with \0 + lb $t5, 0($t2) + beqz $t5, concat_loop2_end + # Copy 1 byte + sb $t5, 0($t3) + addu $t3, $t3, 1 + addu $t2, $t2, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t3) + # v0 contains resulting string + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + sw $t2, 8($v0) + sw $t4, 12($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t1, 8($s1) + lw $t2, 8($s1) + lw $t3, 4($fp) + addu $t1, $t1, $t3 + lw $t3, 0($fp) + addu $t2, $t2, $t3 + subu $a0, $t2, $t1 + move $t4, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t3, $v0 + substr_loop: + beq $t1, $t2, substr_end + lb $a0, 0($t1) + sb $a0, 0($t3) + addu $t1, $t1, 1 + addu $t3, $t3, 1 + j substr_loop + substr_end: + sb $zero, 0($t3) + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + sw $t2, 8($v0) + sw $t4, 12($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t1, 12($s1) + sw $t1, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + la $t1, Main + sw $t1, 0($v0) + la $t1, Main_start + sw $t1, 4($v0) + move $t2, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Main__attrib__mylist__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 8($t2) + sw $t2, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_List implementation. +# @Params: +function_isNil_at_List: + # Allocate stack frame for function function_isNil_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 1 + li $v0, 1 + # Deallocate stack frame for function function_isNil_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_head_at_List implementation. +# @Params: +function_head_at_List: + # Allocate stack frame for function function_head_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_head_at_List_internal_2 --> -12($fp) + # local_head_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_head_at_List_internal_0 --> -4($fp) + # LOCAL local_head_at_List_internal_2 --> -12($fp) + # local_head_at_List_internal_0 = local_head_at_List_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_head_at_List_internal_0 --> -4($fp) + # LOCAL local_head_at_List_internal_1 --> -8($fp) + # local_head_at_List_internal_1 = VCALL local_head_at_List_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function function_head_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_tail_at_List implementation. +# @Params: +function_tail_at_List: + # Allocate stack frame for function function_tail_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_tail_at_List_internal_2 --> -12($fp) + # local_tail_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_tail_at_List_internal_0 --> -4($fp) + # LOCAL local_tail_at_List_internal_2 --> -12($fp) + # local_tail_at_List_internal_0 = local_tail_at_List_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_tail_at_List_internal_0 --> -4($fp) + # LOCAL local_tail_at_List_internal_1 --> -8($fp) + # local_tail_at_List_internal_1 = VCALL local_tail_at_List_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_tail_at_List_internal_3 --> -16($fp) + # local_tail_at_List_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_tail_at_List_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_tail_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cons_at_List implementation. +# @Params: +# 0($fp) = param_cons_at_List_i_0 +function_cons_at_List: + # Allocate stack frame for function function_cons_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cons_at_List_internal_2 --> -12($fp) + # local_cons_at_List_internal_2 = ALLOCATE Cons + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + la $t1, Cons + sw $t1, 0($v0) + la $t1, Cons_start + sw $t1, 4($v0) + move $t2, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Cons__attrib__car__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 8($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Cons__attrib__cdr__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + sw $t2, -12($fp) + # LOCAL local_cons_at_List_internal_0 --> -4($fp) + # LOCAL local_cons_at_List_internal_2 --> -12($fp) + # local_cons_at_List_internal_0 = local_cons_at_List_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cons_at_List_i_0 + # PARAM param_cons_at_List_i_0 --> 0($fp) + lw $t1, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_cons_at_List_internal_3 --> -16($fp) + # local_cons_at_List_internal_3 = SELF + sw $s1, -16($fp) + # ARG local_cons_at_List_internal_3 + # LOCAL local_cons_at_List_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_cons_at_List_internal_0 --> -4($fp) + # LOCAL local_cons_at_List_internal_1 --> -8($fp) + # local_cons_at_List_internal_1 = VCALL local_cons_at_List_internal_0 init + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 28($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_cons_at_List_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_cons_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# __Cons__attrib__car__init implementation. +# @Params: +__Cons__attrib__car__init: + # Allocate stack frame for function __Cons__attrib__car__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Cons__attrib__car__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Cons__attrib__cdr__init implementation. +# @Params: +__Cons__attrib__cdr__init: + # Allocate stack frame for function __Cons__attrib__cdr__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Cons__attrib__cdr__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_Cons implementation. +# @Params: +function_isNil_at_Cons: + # Allocate stack frame for function function_isNil_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function function_isNil_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_head_at_Cons implementation. +# @Params: +function_head_at_Cons: + # Allocate stack frame for function function_head_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_head_at_Cons_internal_0 = GETATTRIBUTE car Cons + # LOCAL local_head_at_Cons_internal_0 --> -4($fp) + lw $t1, 8($s1) + sw $t1, -4($fp) + # RETURN local_head_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_head_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_tail_at_Cons implementation. +# @Params: +function_tail_at_Cons: + # Allocate stack frame for function function_tail_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_tail_at_Cons_internal_0 = GETATTRIBUTE cdr Cons + # LOCAL local_tail_at_Cons_internal_0 --> -4($fp) + lw $t1, 12($s1) + sw $t1, -4($fp) + # RETURN local_tail_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_tail_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Cons implementation. +# @Params: +# 0($fp) = param_init_at_Cons_i_0 +# 4($fp) = param_init_at_Cons_rest_1 +function_init_at_Cons: + # Allocate stack frame for function function_init_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_Cons_i_0 --> 4($fp) + lw $t1, 4($fp) + sw $t1, 8($s1) + # + # PARAM param_init_at_Cons_rest_1 --> 0($fp) + lw $t1, 0($fp) + sw $t1, 12($s1) + # LOCAL local_init_at_Cons_internal_0 --> -4($fp) + # local_init_at_Cons_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# __Main__attrib__mylist__init implementation. +# @Params: +__Main__attrib__mylist__init: + # Allocate stack frame for function __Main__attrib__mylist__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__mylist__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_list_at_Main implementation. +# @Params: +# 0($fp) = param_print_list_at_Main_l_0 +function_print_list_at_Main: + # Allocate stack frame for function function_print_list_at_Main. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) + # PARAM param_print_list_at_Main_l_0 --> 0($fp) + # local_print_list_at_Main_internal_0 = PARAM param_print_list_at_Main_l_0 + lw $t1, 0($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Main_internal_1 --> -8($fp) + # local_print_list_at_Main_internal_1 = VCALL local_print_list_at_Main_internal_0 isNil + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # IF_ZERO local_print_list_at_Main_internal_1 GOTO label_FALSE_1 + # IF_ZERO local_print_list_at_Main_internal_1 GOTO label_FALSE_1 + lw $t1, -8($fp) + beq $t1, 0, label_FALSE_1 + # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) + # local_print_list_at_Main_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) + # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) + # local_print_list_at_Main_internal_2 = local_print_list_at_Main_internal_4 + lw $t1, -20($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_2 + sw $t1, 8($v0) + li $t1, 2 + sw $t1, 12($v0) + sw $v0, -24($fp) + # ARG local_print_list_at_Main_internal_5 + # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) + lw $t1, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) + # LOCAL local_print_list_at_Main_internal_3 --> -16($fp) + # local_print_list_at_Main_internal_3 = VCALL local_print_list_at_Main_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # GOTO label_END_2 +j label_END_2 +label_FALSE_1: + # LOCAL local_print_list_at_Main_internal_8 --> -36($fp) + # local_print_list_at_Main_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Main_internal_8 --> -36($fp) + # local_print_list_at_Main_internal_6 = local_print_list_at_Main_internal_8 + lw $t1, -36($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) + # PARAM param_print_list_at_Main_l_0 --> 0($fp) + # local_print_list_at_Main_internal_9 = PARAM param_print_list_at_Main_l_0 + lw $t1, 0($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) + # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) + # local_print_list_at_Main_internal_10 = VCALL local_print_list_at_Main_internal_9 head + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 16($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_print_list_at_Main_internal_10 + # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) + lw $t1, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Main_internal_7 --> -32($fp) + # local_print_list_at_Main_internal_7 = VCALL local_print_list_at_Main_internal_6 out_int + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 16($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Main_internal_13 --> -56($fp) + # local_print_list_at_Main_internal_13 = SELF + sw $s1, -56($fp) + # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) + # LOCAL local_print_list_at_Main_internal_13 --> -56($fp) + # local_print_list_at_Main_internal_11 = local_print_list_at_Main_internal_13 + lw $t1, -56($fp) + sw $t1, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_3 + sw $t1, 8($v0) + li $t1, 1 + sw $t1, 12($v0) + sw $v0, -60($fp) + # ARG local_print_list_at_Main_internal_14 + # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) + lw $t1, -60($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) + # LOCAL local_print_list_at_Main_internal_12 --> -52($fp) + # local_print_list_at_Main_internal_12 = VCALL local_print_list_at_Main_internal_11 out_string + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) + # local_print_list_at_Main_internal_17 = SELF + sw $s1, -72($fp) + # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) + # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) + # local_print_list_at_Main_internal_15 = local_print_list_at_Main_internal_17 + lw $t1, -72($fp) + sw $t1, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) + # PARAM param_print_list_at_Main_l_0 --> 0($fp) + # local_print_list_at_Main_internal_18 = PARAM param_print_list_at_Main_l_0 + lw $t1, 0($fp) + sw $t1, -76($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) + # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) + # local_print_list_at_Main_internal_19 = VCALL local_print_list_at_Main_internal_18 tail + # Save new self pointer in $s1 + lw $s1, -76($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 20($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -80($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_print_list_at_Main_internal_19 + # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) + lw $t1, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) + # LOCAL local_print_list_at_Main_internal_16 --> -68($fp) + # local_print_list_at_Main_internal_16 = VCALL local_print_list_at_Main_internal_15 print_list + # Save new self pointer in $s1 + lw $s1, -64($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 28($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_END_2: +# RETURN +# Deallocate stack frame for function function_print_list_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 96 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 96 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = ALLOCATE List + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + la $t1, List + sw $t1, 0($v0) + la $t1, List_start + sw $t1, 4($v0) + move $t2, $v0 + sw $t2, -44($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_8 = local_main_at_Main_internal_10 + lw $t1, -44($fp) + sw $t1, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 1 + li $t1, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 cons + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 24($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_9 + lw $t1, -40($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 2 + li $t1, 2 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 cons + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 24($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_7 + lw $t1, -32($fp) + sw $t1, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 3 + li $t1, 3 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 cons + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 24($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_2 = local_main_at_Main_internal_5 + lw $t1, -24($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 4 + li $t1, 4 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 cons + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 24($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 + lw $t1, -16($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 5 + li $t1, 5 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 cons + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 24($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + lw $t1, -8($fp) + sw $t1, 8($s1) + label_WHILE_3: + # local_main_at_Main_internal_13 = GETATTRIBUTE mylist Main + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + lw $t1, 8($s1) + sw $t1, -56($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_11 = local_main_at_Main_internal_13 + lw $t1, -56($fp) + sw $t1, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = VCALL local_main_at_Main_internal_11 isNil + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # IF_ZERO local_main_at_Main_internal_12 GOTO label_FALSE_5 + # IF_ZERO local_main_at_Main_internal_12 GOTO label_FALSE_5 + lw $t1, -52($fp) + beq $t1, 0, label_FALSE_5 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = 0 + li $t1, 0 + sw $t1, -60($fp) + # GOTO label_NOT_END_6 + j label_NOT_END_6 + label_FALSE_5: + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = 1 + li $t1, 1 + sw $t1, -60($fp) + label_NOT_END_6: + # IF_ZERO local_main_at_Main_internal_14 GOTO label_WHILE_END_4 + # IF_ZERO local_main_at_Main_internal_14 GOTO label_WHILE_END_4 + lw $t1, -60($fp) + beq $t1, 0, label_WHILE_END_4 + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = SELF + sw $s1, -72($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 + lw $t1, -72($fp) + sw $t1, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_main_at_Main_internal_18 = GETATTRIBUTE mylist Main + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + lw $t1, 8($s1) + sw $t1, -76($fp) + # ARG local_main_at_Main_internal_18 + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + lw $t1, -76($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 print_list + # Save new self pointer in $s1 + lw $s1, -64($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 28($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_main_at_Main_internal_21 = GETATTRIBUTE mylist Main + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + lw $t1, 8($s1) + sw $t1, -88($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 + lw $t1, -88($fp) + sw $t1, -80($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 tail + # Save new self pointer in $s1 + lw $s1, -80($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 20($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -84($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + lw $t1, -84($fp) + sw $t1, 8($s1) + # GOTO label_WHILE_3 + j label_WHILE_3 + label_WHILE_END_4: + # RETURN + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 96 + jr $ra + # Function END + From c0cbc282ebdea739fde47fc98b9910e7c3578536 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 4 Dec 2020 17:58:20 -0500 Subject: [PATCH 141/162] Fix substr implementation to take starting index and length instead of starting index and ending index. Fix type name record to store a String instance instead of a fixed String --- src/testing.mips | 1125 ++++---------------------------- src/testing.py | 143 +--- src/travels/ciltomips.py | 49 +- src/travels/ctcill.py | 1 - src/travels/inference.py | 1 - tests/codegen/atoi.mips | 13 +- tests/codegen/fib.mips | 13 +- tests/codegen/hello_world.mips | 13 +- tests/codegen/io.mips | 13 +- tests/codegen/list.mips | 13 +- 10 files changed, 219 insertions(+), 1165 deletions(-) diff --git a/src/testing.mips b/src/testing.mips index 9173160e..58751fc7 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:40:51 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 17:56:59 2020 # School of Math and Computer Science, University of Havana # @@ -11,10 +11,6 @@ Object: .asciiz "Object" # Function END String: .asciiz "String" # Function END -List: .asciiz "List" -# Function END -Cons: .asciiz "Cons" -# Function END Main: .asciiz "Main" # Function END # @@ -62,36 +58,8 @@ String_end: # -# **** VTABLE for type List **** -List_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_isNil_at_List, function_head_at_List, function_tail_at_List, function_cons_at_List -# Function END -# - - -# **** Type RECORD for type List **** -List_start: - List_vtable_pointer: .word List_vtable - # Function END -List_end: -# - - -# **** VTABLE for type Cons **** -Cons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_isNil_at_Cons, function_head_at_Cons, function_tail_at_Cons, function_cons_at_List, function_init_at_Cons -# Function END -# - - -# **** Type RECORD for type Cons **** -Cons_start: - Cons_vtable_pointer: .word Cons_vtable - # Function END -Cons_end: -# - - # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_print_list_at_Main, function_main_at_Main +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main # Function END # @@ -113,64 +81,36 @@ __Object_Int_tdt_entry__: .word 1 __Object_String_tdt_entry__: .word 1 __Object_Bool_tdt_entry__: .word 1 __Object_IO_tdt_entry__: .word 1 -__Object_List_tdt_entry__: .word 1 -__Object_Cons_tdt_entry__: .word 2 __Object_Main_tdt_entry__: .word 2 __Int_Object_tdt_entry__: .word -1 __Int_Int_tdt_entry__: .word 0 __Int_String_tdt_entry__: .word -1 __Int_Bool_tdt_entry__: .word -1 __Int_IO_tdt_entry__: .word -1 -__Int_List_tdt_entry__: .word -1 -__Int_Cons_tdt_entry__: .word -1 __Int_Main_tdt_entry__: .word -1 __String_Object_tdt_entry__: .word -1 __String_Int_tdt_entry__: .word -1 __String_String_tdt_entry__: .word 0 __String_Bool_tdt_entry__: .word -1 __String_IO_tdt_entry__: .word -1 -__String_List_tdt_entry__: .word -1 -__String_Cons_tdt_entry__: .word -1 __String_Main_tdt_entry__: .word -1 __Bool_Object_tdt_entry__: .word -1 __Bool_Int_tdt_entry__: .word -1 __Bool_String_tdt_entry__: .word -1 __Bool_Bool_tdt_entry__: .word 0 __Bool_IO_tdt_entry__: .word -1 -__Bool_List_tdt_entry__: .word -1 -__Bool_Cons_tdt_entry__: .word -1 __Bool_Main_tdt_entry__: .word -1 __IO_Object_tdt_entry__: .word -1 __IO_Int_tdt_entry__: .word -1 __IO_String_tdt_entry__: .word -1 __IO_Bool_tdt_entry__: .word -1 __IO_IO_tdt_entry__: .word 0 -__IO_List_tdt_entry__: .word -1 -__IO_Cons_tdt_entry__: .word -1 __IO_Main_tdt_entry__: .word 1 -__List_Object_tdt_entry__: .word -1 -__List_Int_tdt_entry__: .word -1 -__List_String_tdt_entry__: .word -1 -__List_Bool_tdt_entry__: .word -1 -__List_IO_tdt_entry__: .word -1 -__List_List_tdt_entry__: .word 0 -__List_Cons_tdt_entry__: .word 1 -__List_Main_tdt_entry__: .word -1 -__Cons_Object_tdt_entry__: .word -1 -__Cons_Int_tdt_entry__: .word -1 -__Cons_String_tdt_entry__: .word -1 -__Cons_Bool_tdt_entry__: .word -1 -__Cons_IO_tdt_entry__: .word -1 -__Cons_List_tdt_entry__: .word -1 -__Cons_Cons_tdt_entry__: .word 0 -__Cons_Main_tdt_entry__: .word -1 __Main_Object_tdt_entry__: .word -1 __Main_Int_tdt_entry__: .word -1 __Main_String_tdt_entry__: .word -1 __Main_Bool_tdt_entry__: .word -1 __Main_IO_tdt_entry__: .word -1 -__Main_List_tdt_entry__: .word -1 -__Main_Cons_tdt_entry__: .word -1 __Main_Main_tdt_entry__: .word 0 # @@ -179,10 +119,6 @@ data_2: .asciiz "\n" # -data_3: .asciiz " " -# - - .text main: jal entry @@ -365,7 +301,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -450,23 +386,22 @@ function_substr_at_String: # PARAM param_substr_at_String_l_0 --> 4($fp) # PARAM param_substr_at_String_r_1 --> 0($fp) lw $t1, 8($s1) - lw $t2, 8($s1) lw $t3, 4($fp) addu $t1, $t1, $t3 - lw $t3, 0($fp) - addu $t2, $t2, $t3 - subu $a0, $t2, $t1 + lw $a0, 0($fp) move $t4, $a0 + move $t2, $a0 addu $a0, $a0, 1 li $v0, 9 syscall move $t3, $v0 substr_loop: - beq $t1, $t2, substr_end + beqz $t2, substr_end lb $a0, 0($t1) sb $a0, 0($t3) addu $t1, $t1, 1 addu $t3, $t3, 1 + subu $t2, $t2, 1 j substr_loop substr_end: sb $zero, 0($t3) @@ -533,23 +468,28 @@ entry: addu $fp, $sp, 32 # LOCAL local__internal_0 --> -4($fp) # local__internal_0 = ALLOCATE Main - # Allocating 12 bytes of memory - li $a0, 12 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + la $t3, Main + sw $t3, 8($v0) + li $t3, 4 + sw $t3, 12($v0) + move $t3, $v0 + # Allocating 8 bytes of memory + li $a0, 8 li $v0, 9 syscall - la $t1, Main - sw $t1, 0($v0) - la $t1, Main_start - sw $t1, 4($v0) + sw $t3, 0($v0) + la $t3, Main_start + sw $t3, 4($v0) move $t2, $v0 - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Main__attrib__mylist__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 8($t2) sw $t2, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) @@ -570,969 +510,192 @@ entry: # Function END -# function_isNil_at_List implementation. -# @Params: -function_isNil_at_List: - # Allocate stack frame for function function_isNil_at_List. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 1 - li $v0, 1 - # Deallocate stack frame for function function_isNil_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_head_at_List implementation. -# @Params: -function_head_at_List: - # Allocate stack frame for function function_head_at_List. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_head_at_List_internal_2 --> -12($fp) - # local_head_at_List_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_head_at_List_internal_0 --> -4($fp) - # LOCAL local_head_at_List_internal_2 --> -12($fp) - # local_head_at_List_internal_0 = local_head_at_List_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_head_at_List_internal_0 --> -4($fp) - # LOCAL local_head_at_List_internal_1 --> -8($fp) - # local_head_at_List_internal_1 = VCALL local_head_at_List_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function function_head_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_tail_at_List implementation. +# function_main_at_Main implementation. # @Params: -function_tail_at_List: - # Allocate stack frame for function function_tail_at_List. - subu $sp, $sp, 32 +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 56 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_tail_at_List_internal_2 --> -12($fp) - # local_tail_at_List_internal_2 = SELF + addu $fp, $sp, 56 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF sw $s1, -12($fp) - # LOCAL local_tail_at_List_internal_0 --> -4($fp) - # LOCAL local_tail_at_List_internal_2 --> -12($fp) - # local_tail_at_List_internal_0 = local_tail_at_List_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t2, -12($fp) + sw $t2, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_tail_at_List_internal_0 --> -4($fp) - # LOCAL local_tail_at_List_internal_1 --> -8($fp) - # local_tail_at_List_internal_1 = VCALL local_tail_at_List_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_tail_at_List_internal_3 --> -16($fp) - # local_tail_at_List_internal_3 = SELF - sw $s1, -16($fp) - # RETURN local_tail_at_List_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_tail_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cons_at_List implementation. -# @Params: -# 0($fp) = param_cons_at_List_i_0 -function_cons_at_List: - # Allocate stack frame for function function_cons_at_List. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_cons_at_List_internal_2 --> -12($fp) - # local_cons_at_List_internal_2 = ALLOCATE Cons + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = ALLOCATE Object # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall - la $t1, Cons - sw $t1, 0($v0) - la $t1, Cons_start - sw $t1, 4($v0) - move $t2, $v0 - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Cons__attrib__car__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 8($t2) - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Cons__attrib__cdr__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t2) - sw $t2, -12($fp) - # LOCAL local_cons_at_List_internal_0 --> -4($fp) - # LOCAL local_cons_at_List_internal_2 --> -12($fp) - # local_cons_at_List_internal_0 = local_cons_at_List_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cons_at_List_i_0 - # PARAM param_cons_at_List_i_0 --> 0($fp) - lw $t1, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_cons_at_List_internal_3 --> -16($fp) - # local_cons_at_List_internal_3 = SELF - sw $s1, -16($fp) - # ARG local_cons_at_List_internal_3 - # LOCAL local_cons_at_List_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_cons_at_List_internal_0 --> -4($fp) - # LOCAL local_cons_at_List_internal_1 --> -8($fp) - # local_cons_at_List_internal_1 = VCALL local_cons_at_List_internal_0 init - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 28($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_cons_at_List_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_cons_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# __Cons__attrib__car__init implementation. -# @Params: -__Cons__attrib__car__init: - # Allocate stack frame for function __Cons__attrib__car__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Cons__attrib__car__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Cons__attrib__cdr__init implementation. -# @Params: -__Cons__attrib__cdr__init: - # Allocate stack frame for function __Cons__attrib__cdr__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Cons__attrib__cdr__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_Cons implementation. -# @Params: -function_isNil_at_Cons: - # Allocate stack frame for function function_isNil_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function function_isNil_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_head_at_Cons implementation. -# @Params: -function_head_at_Cons: - # Allocate stack frame for function function_head_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_head_at_Cons_internal_0 = GETATTRIBUTE car Cons - # LOCAL local_head_at_Cons_internal_0 --> -4($fp) - lw $t1, 8($s1) - sw $t1, -4($fp) - # RETURN local_head_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_head_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_tail_at_Cons implementation. -# @Params: -function_tail_at_Cons: - # Allocate stack frame for function function_tail_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_tail_at_Cons_internal_0 = GETATTRIBUTE cdr Cons - # LOCAL local_tail_at_Cons_internal_0 --> -4($fp) - lw $t1, 12($s1) - sw $t1, -4($fp) - # RETURN local_tail_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_tail_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_Cons implementation. -# @Params: -# 0($fp) = param_init_at_Cons_i_0 -# 4($fp) = param_init_at_Cons_rest_1 -function_init_at_Cons: - # Allocate stack frame for function function_init_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_Cons_i_0 --> 4($fp) - lw $t1, 4($fp) - sw $t1, 8($s1) - # - # PARAM param_init_at_Cons_rest_1 --> 0($fp) - lw $t1, 0($fp) - sw $t1, 12($s1) - # LOCAL local_init_at_Cons_internal_0 --> -4($fp) - # local_init_at_Cons_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_init_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_init_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# __Main__attrib__mylist__init implementation. -# @Params: -__Main__attrib__mylist__init: - # Allocate stack frame for function __Main__attrib__mylist__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Main__attrib__mylist__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_print_list_at_Main implementation. -# @Params: -# 0($fp) = param_print_list_at_Main_l_0 -function_print_list_at_Main: - # Allocate stack frame for function function_print_list_at_Main. - subu $sp, $sp, 88 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 88 - # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) - # PARAM param_print_list_at_Main_l_0 --> 0($fp) - # local_print_list_at_Main_internal_0 = PARAM param_print_list_at_Main_l_0 - lw $t1, 0($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) - # LOCAL local_print_list_at_Main_internal_1 --> -8($fp) - # local_print_list_at_Main_internal_1 = VCALL local_print_list_at_Main_internal_0 isNil - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # IF_ZERO local_print_list_at_Main_internal_1 GOTO label_FALSE_1 - # IF_ZERO local_print_list_at_Main_internal_1 GOTO label_FALSE_1 - lw $t1, -8($fp) - beq $t1, 0, label_FALSE_1 - # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) - # local_print_list_at_Main_internal_4 = SELF - sw $s1, -20($fp) - # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) - # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) - # local_print_list_at_Main_internal_2 = local_print_list_at_Main_internal_4 - lw $t1, -20($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + la $t4, Object + sw $t4, 8($v0) + li $t4, 6 + sw $t4, 12($v0) + move $t4, $v0 + # Allocating 8 bytes of memory + li $a0, 8 li $v0, 9 syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_2 - sw $t1, 8($v0) - li $t1, 2 - sw $t1, 12($v0) - sw $v0, -24($fp) - # ARG local_print_list_at_Main_internal_5 - # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) - lw $t1, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) - # LOCAL local_print_list_at_Main_internal_3 --> -16($fp) - # local_print_list_at_Main_internal_3 = VCALL local_print_list_at_Main_internal_2 out_string - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # GOTO label_END_2 -j label_END_2 -label_FALSE_1: - # LOCAL local_print_list_at_Main_internal_8 --> -36($fp) - # local_print_list_at_Main_internal_8 = SELF - sw $s1, -36($fp) - # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Main_internal_8 --> -36($fp) - # local_print_list_at_Main_internal_6 = local_print_list_at_Main_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) - # PARAM param_print_list_at_Main_l_0 --> 0($fp) - # local_print_list_at_Main_internal_9 = PARAM param_print_list_at_Main_l_0 - lw $t1, 0($fp) - sw $t1, -40($fp) + sw $t4, 0($v0) + la $t4, Object_start + sw $t4, 4($v0) + move $t3, $v0 + sw $t3, -32($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_5 = local_main_at_Main_internal_7 + lw $t3, -32($fp) + sw $t3, -24($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) - # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) - # local_print_list_at_Main_internal_10 = VCALL local_print_list_at_Main_internal_9 head - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 16($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_print_list_at_Main_internal_10 - # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) - lw $t1, -44($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Main_internal_7 --> -32($fp) - # local_print_list_at_Main_internal_7 = VCALL local_print_list_at_Main_internal_6 out_int + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_6 = VCALL local_main_at_Main_internal_5 type_name # Save new self pointer in $s1 - lw $s1, -28($fp) + lw $s1, -24($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 16($t2) + lw $t5, 4($t4) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) + jalr $t5 + sw $v0, -28($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_list_at_Main_internal_13 --> -56($fp) - # local_print_list_at_Main_internal_13 = SELF - sw $s1, -56($fp) - # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) - # LOCAL local_print_list_at_Main_internal_13 --> -56($fp) - # local_print_list_at_Main_internal_11 = local_print_list_at_Main_internal_13 - lw $t1, -56($fp) - sw $t1, -48($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_3 = local_main_at_Main_internal_6 + lw $t3, -28($fp) + sw $t3, -16($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_3 - sw $t1, 8($v0) - li $t1, 1 - sw $t1, 12($v0) - sw $v0, -60($fp) - # ARG local_print_list_at_Main_internal_14 - # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) - lw $t1, -60($fp) + # ARG 4 + li $t3, 4 # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) - # LOCAL local_print_list_at_Main_internal_12 --> -52($fp) - # local_print_list_at_Main_internal_12 = VCALL local_print_list_at_Main_internal_11 out_string - # Save new self pointer in $s1 - lw $s1, -48($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -52($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) - # local_print_list_at_Main_internal_17 = SELF - sw $s1, -72($fp) - # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) - # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) - # local_print_list_at_Main_internal_15 = local_print_list_at_Main_internal_17 - lw $t1, -72($fp) - sw $t1, -64($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) - # PARAM param_print_list_at_Main_l_0 --> 0($fp) - # local_print_list_at_Main_internal_18 = PARAM param_print_list_at_Main_l_0 - lw $t1, 0($fp) - sw $t1, -76($fp) - # Push register s1 into stack + sw $t3, 0($sp) + # ARG 1 + li $t3, 1 + # Push arg into stack subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) - # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) - # local_print_list_at_Main_internal_19 = VCALL local_print_list_at_Main_internal_18 tail + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 substr # Save new self pointer in $s1 - lw $s1, -76($fp) + lw $s1, -16($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 20($t2) + lw $t5, 4($t4) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -80($fp) + jalr $t5 + sw $v0, -20($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # ARG local_print_list_at_Main_internal_19 - # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) - lw $t1, -80($fp) + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t3, -20($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) - # LOCAL local_print_list_at_Main_internal_16 --> -68($fp) - # local_print_list_at_Main_internal_16 = VCALL local_print_list_at_Main_internal_15 print_list + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string # Save new self pointer in $s1 - lw $s1, -64($fp) + lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 28($t2) + lw $t5, 12($t4) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -68($fp) + jalr $t5 + sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - label_END_2: -# RETURN -# Deallocate stack frame for function function_print_list_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 88 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 96 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 96 # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_10 = ALLOCATE List - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - la $t1, List - sw $t1, 0($v0) - la $t1, List_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -44($fp) + # local_main_at_Main_internal_10 = SELF + sw $s1, -44($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # LOCAL local_main_at_Main_internal_10 --> -44($fp) # local_main_at_Main_internal_8 = local_main_at_Main_internal_10 - lw $t1, -44($fp) - sw $t1, -36($fp) + lw $t3, -44($fp) + sw $t3, -36($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # ARG 1 - li $t1, 1 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + la $t3, data_2 + sw $t3, 8($v0) + li $t3, 2 + sw $t3, 12($v0) + sw $v0, -48($fp) + # ARG local_main_at_Main_internal_11 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + lw $t3, -48($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t3, 0($sp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 cons + # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 out_string # Save new self pointer in $s1 lw $s1, -36($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 24($t2) + lw $t5, 12($t4) # Call function. Result is on $v0 - jalr $t3 + jalr $t5 sw $v0, -40($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_9 - lw $t1, -40($fp) - sw $t1, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 2 - li $t1, 2 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 cons - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 24($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_4 = local_main_at_Main_internal_7 - lw $t1, -32($fp) - sw $t1, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 3 - li $t1, 3 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 cons - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 24($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_2 = local_main_at_Main_internal_5 - lw $t1, -24($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 4 - li $t1, 4 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 cons - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 24($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 - lw $t1, -16($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 5 - li $t1, 5 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 cons - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 24($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - lw $t1, -8($fp) - sw $t1, 8($s1) - label_WHILE_3: - # local_main_at_Main_internal_13 = GETATTRIBUTE mylist Main - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - lw $t1, 8($s1) - sw $t1, -56($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_11 = local_main_at_Main_internal_13 - lw $t1, -56($fp) - sw $t1, -48($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_12 = VCALL local_main_at_Main_internal_11 isNil - # Save new self pointer in $s1 - lw $s1, -48($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -52($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # IF_ZERO local_main_at_Main_internal_12 GOTO label_FALSE_5 - # IF_ZERO local_main_at_Main_internal_12 GOTO label_FALSE_5 - lw $t1, -52($fp) - beq $t1, 0, label_FALSE_5 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = 0 - li $t1, 0 - sw $t1, -60($fp) - # GOTO label_NOT_END_6 - j label_NOT_END_6 - label_FALSE_5: - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = 1 - li $t1, 1 - sw $t1, -60($fp) - label_NOT_END_6: - # IF_ZERO local_main_at_Main_internal_14 GOTO label_WHILE_END_4 - # IF_ZERO local_main_at_Main_internal_14 GOTO label_WHILE_END_4 - lw $t1, -60($fp) - beq $t1, 0, label_WHILE_END_4 - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = SELF - sw $s1, -72($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 - lw $t1, -72($fp) - sw $t1, -64($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_main_at_Main_internal_18 = GETATTRIBUTE mylist Main - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - lw $t1, 8($s1) - sw $t1, -76($fp) - # ARG local_main_at_Main_internal_18 - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - lw $t1, -76($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 print_list - # Save new self pointer in $s1 - lw $s1, -64($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 28($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -68($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_main_at_Main_internal_21 = GETATTRIBUTE mylist Main - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - lw $t1, 8($s1) - sw $t1, -88($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 - lw $t1, -88($fp) - sw $t1, -80($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 tail - # Save new self pointer in $s1 - lw $s1, -80($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -84($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - lw $t1, -84($fp) - sw $t1, 8($s1) - # GOTO label_WHILE_3 - j label_WHILE_3 - label_WHILE_END_4: - # RETURN - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 96 - jr $ra - # Function END + # RETURN local_main_at_Main_internal_9 + lw $v0, -40($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 56 + jr $ra + # Function END diff --git a/src/testing.py b/src/testing.py index f20f3650..bcc530f5 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,143 +60,14 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""(* - * This file shows how to implement a list data type for lists of integers. - * It makes use of INHERITANCE and DYNAMIC DISPATCH. - * - * The List class has 4 operations defined on List objects. If 'l' is - * a list, then the methods dispatched on 'l' have the following effects: - * - * isNil() : Bool Returns true if 'l' is empty, false otherwise. - * head() : Int Returns the integer at the head of 'l'. - * If 'l' is empty, execution aborts. - * tail() : List Returns the remainder of the 'l', - * i.e. without the first element. - * cons(i : Int) : List Return a new list containing i as the - * first element, followed by the - * elements in 'l'. - * - * There are 2 kinds of lists, the empty list and a non-empty - * list. We can think of the non-empty list as a specialization of - * the empty list. - * The class List defines the operations on empty list. The class - * Cons inherits from List and redefines things to handle non-empty - * lists. - *) - - -class List { - -- Define operations on empty lists. - - isNil() : Bool { true }; - - -- Since abort() has return type Object and head() has return type - -- Int, we need to have an Int as the result of the method body, - -- even though abort() never returns. - - head() : Int { { abort(); 0; } }; - - -- As for head(), the self is just to make sure the return type of - -- tail() is correct. - - tail() : List { { abort(); self; } }; - - -- When we cons and element onto the empty list we get a non-empty - -- list. The (new Cons) expression creates a new list cell of class - -- Cons, which is initialized by a dispatch to init(). - -- The result of init() is an element of class Cons, but it - -- conforms to the return type List, because Cons is a subclass of - -- List. - - cons(i : Int) : List { - (new Cons).init(i, self) - }; - +text = r"""class Main inherits IO { + main() : IO { + { + out_string((new Object).type_name().substr(4,1)); + out_string("\n"); + } + }; }; - -(* - * Cons inherits all operations from List. We can reuse only the cons - * method though, because adding an element to the front of an emtpy - * list is the same as adding it to the front of a non empty - * list. All other methods have to be redefined, since the behaviour - * for them is different from the empty list. - * - * Cons needs two attributes to hold the integer of this list - * cell and to hold the rest of the list. - * - * The init() method is used by the cons() method to initialize the - * cell. - *) - -class Cons inherits List { - - car : Int; -- The element in this list cell - - cdr : List; -- The rest of the list - - isNil() : Bool { false }; - - head() : Int { car }; - - tail() : List { cdr }; - - init(i : Int, rest : List) : List { - { - car <- i; - cdr <- rest; - self; - } - }; - -}; - - - -(* - * The Main class shows how to use the List class. It creates a small - * list and then repeatedly prints out its elements and takes off the - * first element of the list. - *) - -class Main inherits IO { - - mylist : List; - - -- Print all elements of the list. Calls itself recursively with - -- the tail of the list, until the end of the list is reached. - - print_list(l : List) : Object { - if l.isNil() then out_string("\n") - else { - out_int(l.head()); - out_string(" "); - print_list(l.tail()); - } - fi - }; - - -- Note how the dynamic dispatch mechanism is responsible to end - -- the while loop. As long as mylist is bound to an object of - -- dynamic type Cons, the dispatch to isNil calls the isNil method of - -- the Cons class, which returns false. However when we reach the - -- end of the list, mylist gets bound to the object that was - -- created by the (new List) expression. This object is of dynamic type - -- List, and thus the method isNil in the List class is called and - -- returns true. - - main() : Object { - { - mylist <- new List.cons(1).cons(2).cons(3).cons(4).cons(5); - while (not mylist.isNil()) loop - { - print_list(mylist); - mylist <- mylist.tail(); - } - pool; - } - }; - -}; """ pipeline(text, 5) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index bc95c874..863bc158 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -397,8 +397,7 @@ def _(self, node: cil.AllocateNode): num_bytes += len(instance_type.attributes) * 4 - # Reservar memoria para la instancia - self.allocate_memory(num_bytes) + reg = self.get_available_register() temp = self.get_available_register() @@ -406,8 +405,38 @@ def _(self, node: cil.AllocateNode): # Inicializar la instancia + # Crear el string referente al nombre del tipo + length = len(instance_type.name) + + size = 16 + + # Reservar memoria para el tipo + self.allocate_memory(size) + reg = self.get_available_register() + + assert reg is not None + + self.comment("Allocating string for type name") + + # Inicializar la instancia + self.register_instruction(LA(reg, "String")) + self.register_instruction(SW(reg, "0($v0)")) + + self.register_instruction(LA(reg, "String_start")) + self.register_instruction(SW(reg, "4($v0)")) + + self.register_instruction(LA(reg, instance_type.name)) + self.register_instruction(SW(reg, "8($v0)")) + + self.register_instruction(LI(reg, length)) + self.register_instruction(SW(reg, "12($v0)")) + + self.register_instruction(MOVE(reg, v0)) + + # Reservar memoria para la instancia + self.allocate_memory(num_bytes) + # Cargar el puntero al tipo de la instancia - self.register_instruction(LA(dest=reg, src=instance_type.name)) self.register_instruction(SW(dest=reg, src="0($v0)")) # Cargar el puntero a la VTABLE @@ -656,7 +685,6 @@ def _(self, node: cil.SubstringNode): # Cargar el string sobre el que se llama substr self.register_instruction(LW(reg, "8($s1)")) - self.register_instruction(LW(reg2, "8($s1)")) # Hacer que reg apunte al inicio del substr if isinstance(l, int): @@ -666,15 +694,12 @@ def _(self, node: cil.SubstringNode): self.register_instruction(ADDU(reg, reg, temp)) if isinstance(r, int): - self.register_instruction(ADDU(reg2, reg2, r, True)) + self.register_instruction(LI(a0, r)) else: - self.register_instruction(LW(temp, r)) - self.register_instruction(ADDU(reg2, reg2, temp)) + self.register_instruction(LW(a0, r)) - # Reservar memoria para el buffer de resultado - self.register_instruction(SUBU(a0, reg2, reg)) - # Salvar el length del substr self.register_instruction(MOVE(size_reg, a0)) + self.register_instruction(MOVE(reg2, a0)) # Agregar un byte mas para el fin de cadena self.register_instruction(ADDU(a0, a0, 1, True)) @@ -686,13 +711,15 @@ def _(self, node: cil.SubstringNode): # Mientras reg != reg2 : Copiar a v0 self.register_instruction(Label("substr_loop")) - self.register_instruction(BEQ(reg, reg2, "substr_end")) + self.register_instruction(BEQZ(reg2, "substr_end")) # Copiar un byte self.register_instruction(LB(a0, f"0(${REG_TO_STR[reg]})")) self.register_instruction(SB(a0, f"0(${REG_TO_STR[temp]})")) # Mover el puntero temp y el puntero reg self.register_instruction(ADDU(reg, reg, 1, True)) self.register_instruction(ADDU(temp, temp, 1, True)) + # Restar del contador + self.register_instruction(SUBU(reg2, reg2, 1, True)) # Saltar al ciclo while self.register_instruction(J("substr_loop")) # Salir del ciclo diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index b139a06e..e2d48c9b 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -804,7 +804,6 @@ def _(self, node: coolAst.FunCall, scope: Scope) -> LocalNode: # Evaluar la expresion a la izquierda del punto expr = self.visit(node.obj, scope) - assert isinstance(expr, LocalNode) or isinstance(expr, ParamNode) self.register_instruction(AssignNode(type_vm_holder, expr)) self.register_instruction(SaveSelf()) diff --git a/src/travels/inference.py b/src/travels/inference.py index 8950b1ae..f9f2d8d7 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -505,7 +505,6 @@ def _( void, self.STRING, self.INTEGER, - self.OBJECT, self.BOOL, ): self.errors.append(f"Cannot instantiate {ret_type.name}") diff --git a/tests/codegen/atoi.mips b/tests/codegen/atoi.mips index 110f9da7..0a99d52a 100644 --- a/tests/codegen/atoi.mips +++ b/tests/codegen/atoi.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:41:07 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:54:34 2020 # School of Math and Computer Science, University of Havana # @@ -442,7 +442,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -527,23 +527,22 @@ function_substr_at_String: # PARAM param_substr_at_String_l_0 --> 4($fp) # PARAM param_substr_at_String_r_1 --> 0($fp) lw $t1, 8($s1) - lw $t2, 8($s1) lw $t3, 4($fp) addu $t1, $t1, $t3 - lw $t3, 0($fp) - addu $t2, $t2, $t3 - subu $a0, $t2, $t1 + lw $a0, 0($fp) move $t4, $a0 + move $t2, $a0 addu $a0, $a0, 1 li $v0, 9 syscall move $t3, $v0 substr_loop: - beq $t1, $t2, substr_end + beqz $t2, substr_end lb $a0, 0($t1) sb $a0, 0($t3) addu $t1, $t1, 1 addu $t3, $t3, 1 + subu $t2, $t2, 1 j substr_loop substr_end: sb $zero, 0($t3) diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips index d65ef60e..8c264b8c 100644 --- a/tests/codegen/fib.mips +++ b/tests/codegen/fib.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:41:05 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:54:32 2020 # School of Math and Computer Science, University of Havana # @@ -305,7 +305,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -390,23 +390,22 @@ function_substr_at_String: # PARAM param_substr_at_String_l_0 --> 4($fp) # PARAM param_substr_at_String_r_1 --> 0($fp) lw $t1, 8($s1) - lw $t2, 8($s1) lw $t3, 4($fp) addu $t1, $t1, $t3 - lw $t3, 0($fp) - addu $t2, $t2, $t3 - subu $a0, $t2, $t1 + lw $a0, 0($fp) move $t4, $a0 + move $t2, $a0 addu $a0, $a0, 1 li $v0, 9 syscall move $t3, $v0 substr_loop: - beq $t1, $t2, substr_end + beqz $t2, substr_end lb $a0, 0($t1) sb $a0, 0($t3) addu $t1, $t1, 1 addu $t3, $t3, 1 + subu $t2, $t2, 1 j substr_loop substr_end: sb $zero, 0($t3) diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips index 955b8ee5..894284b1 100644 --- a/tests/codegen/hello_world.mips +++ b/tests/codegen/hello_world.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:41:05 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:54:31 2020 # School of Math and Computer Science, University of Havana # @@ -301,7 +301,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -386,23 +386,22 @@ function_substr_at_String: # PARAM param_substr_at_String_l_0 --> 4($fp) # PARAM param_substr_at_String_r_1 --> 0($fp) lw $t1, 8($s1) - lw $t2, 8($s1) lw $t3, 4($fp) addu $t1, $t1, $t3 - lw $t3, 0($fp) - addu $t2, $t2, $t3 - subu $a0, $t2, $t1 + lw $a0, 0($fp) move $t4, $a0 + move $t2, $a0 addu $a0, $a0, 1 li $v0, 9 syscall move $t3, $v0 substr_loop: - beq $t1, $t2, substr_end + beqz $t2, substr_end lb $a0, 0($t1) sb $a0, 0($t3) addu $t1, $t1, 1 addu $t3, $t3, 1 + subu $t2, $t2, 1 j substr_loop substr_end: sb $zero, 0($t3) diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips index 4b64b7f4..bd5c1541 100644 --- a/tests/codegen/io.mips +++ b/tests/codegen/io.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:41:06 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:54:32 2020 # School of Math and Computer Science, University of Havana # @@ -445,7 +445,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -530,23 +530,22 @@ function_substr_at_String: # PARAM param_substr_at_String_l_0 --> 4($fp) # PARAM param_substr_at_String_r_1 --> 0($fp) lw $t1, 8($s1) - lw $t2, 8($s1) lw $t3, 4($fp) addu $t1, $t1, $t3 - lw $t3, 0($fp) - addu $t2, $t2, $t3 - subu $a0, $t2, $t1 + lw $a0, 0($fp) move $t4, $a0 + move $t2, $a0 addu $a0, $a0, 1 li $v0, 9 syscall move $t3, $v0 substr_loop: - beq $t1, $t2, substr_end + beqz $t2, substr_end lb $a0, 0($t1) sb $a0, 0($t3) addu $t1, $t1, 1 addu $t3, $t3, 1 + subu $t2, $t2, 1 j substr_loop substr_end: sb $zero, 0($t3) diff --git a/tests/codegen/list.mips b/tests/codegen/list.mips index a2cec863..78e0663b 100644 --- a/tests/codegen/list.mips +++ b/tests/codegen/list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:41:06 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:54:33 2020 # School of Math and Computer Science, University of Havana # @@ -365,7 +365,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -450,23 +450,22 @@ function_substr_at_String: # PARAM param_substr_at_String_l_0 --> 4($fp) # PARAM param_substr_at_String_r_1 --> 0($fp) lw $t1, 8($s1) - lw $t2, 8($s1) lw $t3, 4($fp) addu $t1, $t1, $t3 - lw $t3, 0($fp) - addu $t2, $t2, $t3 - subu $a0, $t2, $t1 + lw $a0, 0($fp) move $t4, $a0 + move $t2, $a0 addu $a0, $a0, 1 li $v0, 9 syscall move $t3, $v0 substr_loop: - beq $t1, $t2, substr_end + beqz $t2, substr_end lb $a0, 0($t1) sb $a0, 0($t3) addu $t1, $t1, 1 addu $t3, $t3, 1 + subu $t2, $t2, 1 j substr_loop substr_end: sb $zero, 0($t3) From 2d336230407d05c6e0efa4eadf6edbca58a5b58e Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Fri, 4 Dec 2020 18:43:00 -0500 Subject: [PATCH 142/162] Fix isvoid not returning Bool instance and return for out_string and out_int --- src/cil/baseCilVisitor.py | 20 +- src/cil/nodes.py | 8 +- src/testing.mips | 356 +++++-- src/testing.py | 4 +- src/travels/ciltomips.py | 53 +- src/travels/ctcill.py | 19 +- src/travels/typecollector.py | 8 +- tests/codegen/atoi.mips | 1661 +++++++++++++++++--------------- tests/codegen/fib.mips | 237 +++-- tests/codegen/hello_world.mips | 85 +- tests/codegen/io.mips | 414 +++++--- tests/codegen/list.mips | 475 +++++---- tests/codegen/print-cool.mips | 876 +++++++++++++++++ 13 files changed, 2829 insertions(+), 1387 deletions(-) create mode 100644 tests/codegen/print-cool.mips diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 91b037ba..91cfa05f 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -217,13 +217,16 @@ def __implement_out_string(self): param = self.register_params( VariableInfo("x", self.context.get_type("String"), "PARAM") ) + self__ = self.define_internal_local() # Esta funcion espera que se llame con un argumento que apunta # a la direccion de memoria de un string, luego solo realiza # los procedimientos necesarios para imprimir en consola # dicho string. Creamos el nodo PrintNode y dejamos la # implementacion y la llamada a sistema a MIPS self.register_instruction(PrintNode(param)) - self.register_instruction(ReturnNode()) + # retornar self + self.register_instruction(SelfNode(self__)) + self.register_instruction(ReturnNode(self__)) self.current_function = None def __implement_out_int(self): @@ -233,10 +236,13 @@ def __implement_out_int(self): param = self.register_params( VariableInfo("x", self.context.get_type("Int"), "PARAM") ) + self__ = self.define_internal_local() # Espera como unico parametro un entero. self.register_instruction(PrintIntNode(param)) - self.register_instruction(ReturnNode()) + # retornar self + self.register_instruction(SelfNode(self__)) + self.register_instruction(ReturnNode(self__)) self.current_function = None def __implement_in_string(self): @@ -324,6 +330,9 @@ def build_builtins(self): str_ = self.register_type("String") str__ = self.context.get_type("String") + bool_ = self.register_type("Bool") + bool__ = self.context.get_type("Bool") + io_typeNode.methods.append(("abort", "function_abort_at_Object")) io_typeNode.methods.append(("type_name", "function_type_name_at_Object")) io_typeNode.methods.append(("copy", "function_copy_at_Object")) @@ -336,6 +345,10 @@ def build_builtins(self): obj.methods.append(("type_name", "function_type_name_at_Object")) obj.methods.append(("copy", "function_copy_at_Object")) + bool_.methods.append(("abort", "function_abort_at_Object")) + bool_.methods.append(("type_name", "function_type_name_at_Object")) + bool_.methods.append(("copy", "function_copy_at_Object")) + str_.methods.append(("concat", "function_concat_at_String")) str_.methods.append(("substr", "function_substr_at_String")) str_.methods.append(("length", "function_length_at_String")) @@ -343,6 +356,9 @@ def build_builtins(self): str_.attributes.append(Attribute("value", str__)) str_.attributes.append(Attribute("length", self.context.get_type("Int"))) + bool__.attributes.append(Attribute("value", self.context.get_type("Int"))) + bool__.attributes.append(Attribute("value", self.context.get_type("Int"))) + str__.attributes.append(Attribute("value", str__)) str__.attributes.append(Attribute("length", self.context.get_type("Int"))) diff --git a/src/cil/nodes.py b/src/cil/nodes.py index a49ab42a..9302b68a 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -284,4 +284,10 @@ def __init__(self, dest: LocalNode, s: ParamNode) -> None: class AbortNode(InstructionNode): - pass \ No newline at end of file + pass + + +class AllocateBoolNode(InstructionNode): + def __init__(self, dest: LocalNode, value: int) -> None: + self.dest = dest + self.value = value \ No newline at end of file diff --git a/src/testing.mips b/src/testing.mips index 58751fc7..da116a6e 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 17:56:59 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 18:41:40 2020 # School of Math and Computer Science, University of Havana # @@ -11,6 +11,8 @@ Object: .asciiz "Object" # Function END String: .asciiz "String" # Function END +Bool: .asciiz "Bool" +# Function END Main: .asciiz "Main" # Function END # @@ -58,6 +60,20 @@ String_end: # +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + # **** VTABLE for type Main **** Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main # Function END @@ -162,7 +178,11 @@ function_out_int_at_IO: lw $a0, 0($fp) li $v0, 1 syscall - # RETURN + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function function_out_int_at_IO. # Restore $ra lw $ra, 4($sp) @@ -191,7 +211,11 @@ function_out_string_at_IO: lw $a0, 8($v0) li $v0, 4 syscall - # RETURN + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function function_out_string_at_IO. # Restore $ra lw $ra, 4($sp) @@ -301,7 +325,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -514,23 +538,23 @@ entry: # @Params: function_main_at_Main: # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 56 + subu $sp, $sp, 88 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 56 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) + addu $fp, $sp, 88 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = SELF + sw $s1, -20($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 + lw $t2, -20($fp) + sw $t2, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = ALLOCATE Object + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = ALLOCATE Object # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 @@ -553,20 +577,20 @@ function_main_at_Main: la $t4, Object_start sw $t4, 4($v0) move $t3, $v0 - sw $t3, -32($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) + sw $t3, -40($fp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_5 = local_main_at_Main_internal_7 - lw $t3, -32($fp) - sw $t3, -24($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 + lw $t3, -40($fp) + sw $t3, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # local_main_at_Main_internal_6 = VCALL local_main_at_Main_internal_5 type_name + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 type_name # Save new self pointer in $s1 - lw $s1, -24($fp) + lw $s1, -32($fp) # Get pointer to type lw $t3, 4($s1) # Get pointer to type's VTABLE @@ -575,15 +599,15 @@ function_main_at_Main: lw $t5, 4($t4) # Call function. Result is on $v0 jalr $t5 - sw $v0, -28($fp) + sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # local_main_at_Main_internal_3 = local_main_at_Main_internal_6 - lw $t3, -28($fp) - sw $t3, -16($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_5 = local_main_at_Main_internal_8 + lw $t3, -36($fp) + sw $t3, -24($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -597,11 +621,11 @@ function_main_at_Main: # Push arg into stack subu $sp, $sp, 4 sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 substr + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_6 = VCALL local_main_at_Main_internal_5 substr # Save new self pointer in $s1 - lw $s1, -16($fp) + lw $s1, -24($fp) # Get pointer to type lw $t3, 4($s1) # Get pointer to type's VTABLE @@ -610,21 +634,21 @@ function_main_at_Main: lw $t5, 4($t4) # Call function. Result is on $v0 jalr $t5 - sw $v0, -20($fp) + sw $v0, -28($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - lw $t3, -20($fp) + # ARG local_main_at_Main_internal_6 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + lw $t3, -28($fp) # Push arg into stack subu $sp, $sp, 4 sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string # Save new self pointer in $s1 - lw $s1, -4($fp) + lw $s1, -12($fp) # Get pointer to type lw $t3, 4($s1) # Get pointer to type's VTABLE @@ -633,69 +657,221 @@ function_main_at_Main: lw $t5, 12($t4) # Call function. Result is on $v0 jalr $t5 - sw $v0, -8($fp) + sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_10 = SELF - sw $s1, -44($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_8 = local_main_at_Main_internal_10 - lw $t3, -44($fp) - sw $t3, -36($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 + lw $t3, -16($fp) + sw $t3, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = SELF + sw $s1, -64($fp) + # IF_ZERO local_main_at_Main_internal_15 GOTO label_TRUE_1 + # IF_ZERO local_main_at_Main_internal_15 GOTO label_TRUE_1 + lw $t3, -64($fp) + beq $t3, 0, label_TRUE_1 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall - # Allocating string + # Allocating string for type Bool la $t3, String sw $t3, 0($v0) la $t3, String_start sw $t3, 4($v0) - la $t3, data_2 + la $t3, Bool sw $t3, 8($v0) - li $t3, 2 + li $t3, 4 sw $t3, 12($v0) - sw $v0, -48($fp) - # ARG local_main_at_Main_internal_11 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - lw $t3, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 out_string - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 12($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_9 - lw $v0, -40($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 56 - jr $ra - # Function END + move $t3, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Bool_start + sw $t3, 4($v0) + li $t3, 0 + sw $t3, 8($v0) + sw $v0, -60($fp) + # GOTO label_END_2 +j label_END_2 +label_TRUE_1: + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + la $t3, Bool + sw $t3, 8($v0) + li $t3, 4 + sw $t3, 12($v0) + move $t3, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Bool_start + sw $t3, 4($v0) + li $t3, 1 + sw $t3, 8($v0) + sw $v0, -60($fp) + label_END_2: +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 +lw $t3, -60($fp) +sw $t3, -52($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 type_name +# Save new self pointer in $s1 +lw $s1, -52($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 4($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -56($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_10 --> -44($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_10 = local_main_at_Main_internal_13 +lw $t3, -56($fp) +sw $t3, -44($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG 1 +li $t3, 1 +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# ARG 3 +li $t3, 3 +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_10 --> -44($fp) +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +# local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 substr +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 4($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_11 +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +lw $t3, -48($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_0 --> -4($fp) +# LOCAL local_main_at_Main_internal_1 --> -8($fp) +# local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string +# Save new self pointer in $s1 +lw $s1, -4($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 12($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -8($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# local_main_at_Main_internal_18 = SELF +sw $s1, -76($fp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# local_main_at_Main_internal_16 = local_main_at_Main_internal_18 +lw $t3, -76($fp) +sw $t3, -68($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t3, String +sw $t3, 0($v0) +la $t3, String_start +sw $t3, 4($v0) +la $t3, data_2 +sw $t3, 8($v0) +li $t3, 2 +sw $t3, 12($v0) +sw $v0, -80($fp) +# ARG local_main_at_Main_internal_19 +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +lw $t3, -80($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +# local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string +# Save new self pointer in $s1 +lw $s1, -68($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 12($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -72($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# RETURN local_main_at_Main_internal_17 +lw $v0, -72($fp) +# Deallocate stack frame for function function_main_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +jr $ra +# Function END diff --git a/src/testing.py b/src/testing.py index bcc530f5..74640500 100755 --- a/src/testing.py +++ b/src/testing.py @@ -63,11 +63,11 @@ def pipeline(program: str, deep: int) -> None: text = r"""class Main inherits IO { main() : IO { { - out_string((new Object).type_name().substr(4,1)); + out_string((new Object).type_name().substr(4,1)). + out_string((isvoid self).type_name().substr(1,3)); -- demonstrates the dispatch rules. out_string("\n"); } }; }; - """ pipeline(text, 5) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 863bc158..37d07c5e 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -1,6 +1,6 @@ from pickle import TRUE from abstract.semantics import Type -from cil.nodes import AbortNode, ConcatString, LocalNode +from cil.nodes import AbortNode, AllocateBoolNode, ConcatString, LocalNode from mips.arithmetic import ADD, ADDU, DIV, MUL, NOR, SUB, SUBU from mips.baseMipsVisitor import ( BaseCilToMipsVisitor, @@ -332,6 +332,57 @@ def _(self, node: cil.SetAttributeNode): self.used_registers[reg] = False + @visit.register + def _(self, node: AllocateBoolNode): + dest = self.visit(node.dest) + assert dest is not None + + size = 16 + + # Reservar memoria para el tipo + self.allocate_memory(size) + reg = self.get_available_register() + + assert reg is not None + + self.comment("Allocating string for type Bool") + + # Inicializar la instancia + self.register_instruction(LA(reg, "String")) + self.register_instruction(SW(reg, "0($v0)")) + + self.register_instruction(LA(reg, "String_start")) + self.register_instruction(SW(reg, "4($v0)")) + + self.register_instruction(LA(reg, "Bool")) + self.register_instruction(SW(reg, "8($v0)")) + + self.register_instruction(LI(reg, 4)) + self.register_instruction(SW(reg, "12($v0)")) + + # devolver la instancia + self.register_instruction(MOVE(reg, v0)) + + size = 12 + + self.allocate_memory(size) + + # Almacenar el string al tipo BOOL + self.register_instruction(SW(reg, f"0($v0)")) + + self.register_instruction(LA(reg, "Bool_start")) + self.register_instruction(SW(reg, "4($v0)")) + + self.register_instruction(LI(reg, node.value)) + self.register_instruction(SW(reg, "8($v0)")) + + # devolver la instancia + self.register_instruction(SW(v0, dest)) + + self.used_registers[reg] = False + + + @visit.register def _(self, node: cil.AllocateStringNode): dest = self.visit(node.dest) diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index e2d48c9b..97f7ccd8 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -1,5 +1,5 @@ from abstract.semantics import Type -from abstract.tree import EqualToNode, SelfNode +from abstract.tree import EqualToNode, IsVoidNode, SelfNode import cil.baseCilVisitor as baseCilVisitor import abstract.tree as coolAst import abstract.semantics as semantics @@ -9,7 +9,7 @@ import cil.nodes from cil.nodes import ( - AllocateNode, + AllocateBoolNode, AllocateNode, AllocateStringNode, ArgNode, AssignNode, @@ -50,6 +50,7 @@ TypeOfNode, UnconditionalJump, ) +from mips.branch import J def find_method_in_parent(type_: Type, method: str): @@ -847,6 +848,20 @@ def _(self, node: SelfNode, scope: Scope) -> LocalNode: self.register_instruction(cil.nodes.SelfNode(return_expr_vm_holder)) return return_expr_vm_holder + @visit.register + def _(self, node: IsVoidNode, scope: Scope): + return_bool_vm_holder = self.define_internal_local() + val = self.visit(node.expr, scope) + true_label = self.do_label("TRUE") + end_label = self.do_label("END") + self.register_instruction(IfZeroJump(val, true_label)) + # Bool con valor false + self.register_instruction(AllocateBoolNode(return_bool_vm_holder, 0)) + self.register_instruction(UnconditionalJump(end_label)) + self.register_instruction(LabelNode(true_label)) + self.register_instruction(AllocateBoolNode(return_bool_vm_holder, 1)) + self.register_instruction(LabelNode(end_label)) + return return_bool_vm_holder class CilDisplayFormatter: @singledispatchmethod diff --git a/src/travels/typecollector.py b/src/travels/typecollector.py index f6339aa2..b348d62c 100755 --- a/src/travels/typecollector.py +++ b/src/travels/typecollector.py @@ -49,12 +49,12 @@ def substr() -> Method: obj.methods["substr"] = substr() -def bootstrap_io(io: IoType, strType: StringType): +def bootstrap_io(io: IoType, strType: StringType, selfType: SelfType): def out_string() -> Method: method_name = "out_string" param_names = ["x"] param_types: List[Type] = [StringType()] - return_type = SelfType() + return_type = selfType return Method(method_name, param_names, param_types, return_type) @@ -62,7 +62,7 @@ def out_int() -> Method: method_name = "out_int" param_names = ["x"] params_types: List[Type] = [IntegerType()] - return_type = SelfType() + return_type = selfType return Method(method_name, param_names, params_types, return_type) @@ -143,7 +143,7 @@ def _(self, node: coolAst.ProgramNode): # noqa: F811 # Agregar los metodos builtin bootstrap_string(STRING) - bootstrap_io(ioType, STRING) + bootstrap_io(ioType, STRING, SELF_TYPE) bootstrap_object(OBJECT, STRING) INTEGER.set_parent(OBJECT) diff --git a/tests/codegen/atoi.mips b/tests/codegen/atoi.mips index 0a99d52a..22f0f97c 100644 --- a/tests/codegen/atoi.mips +++ b/tests/codegen/atoi.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:54:34 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 18:41:52 2020 # School of Math and Computer Science, University of Havana # @@ -11,6 +11,8 @@ Object: .asciiz "Object" # Function END String: .asciiz "String" # Function END +Bool: .asciiz "Bool" +# Function END A2I: .asciiz "A2I" # Function END Main: .asciiz "Main" @@ -60,6 +62,20 @@ String_end: # +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + # **** VTABLE for type A2I **** A2I_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_c2i_at_A2I, function_i2c_at_A2I, function_a2i_at_A2I, function_a2i_aux_at_A2I, function_i2a_at_A2I, function_i2a_aux_at_A2I # Function END @@ -303,7 +319,11 @@ function_out_int_at_IO: lw $a0, 0($fp) li $v0, 1 syscall - # RETURN + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function function_out_int_at_IO. # Restore $ra lw $ra, 4($sp) @@ -332,7 +352,11 @@ function_out_string_at_IO: lw $a0, 8($v0) li $v0, 4 syscall - # RETURN + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function function_out_string_at_IO. # Restore $ra lw $ra, 4($sp) @@ -442,7 +466,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -609,14 +633,27 @@ entry: addu $fp, $sp, 32 # LOCAL local__internal_0 --> -4($fp) # local__internal_0 = ALLOCATE Main + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + la $t3, Main + sw $t3, 8($v0) + li $t3, 4 + sw $t3, 12($v0) + move $t3, $v0 # Allocating 8 bytes of memory li $a0, 8 li $v0, 9 syscall - la $t1, Main - sw $t1, 0($v0) - la $t1, Main_start - sw $t1, 4($v0) + sw $t3, 0($v0) + la $t3, Main_start + sw $t3, 4($v0) move $t2, $v0 sw $t2, -4($fp) # LOCAL local__internal_0 --> -4($fp) @@ -653,43 +690,43 @@ function_c2i_at_A2I: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_2 - sw $t1, 8($v0) - li $t1, 1 - sw $t1, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + la $t2, data_2 + sw $t2, 8($v0) + li $t2, 1 + sw $t2, 12($v0) sw $v0, -8($fp) # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) # local_c2i_at_A2I_internal_0 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_1 - lw $t1, 0($fp) - lw $t2, -8($fp) - sub $t1, $t1, $t2 - sw $t1, -4($fp) + lw $t2, 0($fp) + lw $t3, -8($fp) + sub $t2, $t2, $t3 + sw $t2, -4($fp) # IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_TRUE_3 # IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_TRUE_3 - lw $t1, -4($fp) - beq $t1, 0, label_TRUE_3 + lw $t2, -4($fp) + beq $t2, 0, label_TRUE_3 # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) # local_c2i_at_A2I_internal_0 = 0 - li $t1, 0 - sw $t1, -4($fp) + li $t2, 0 + sw $t2, -4($fp) # GOTO label_END_4 j label_END_4 label_TRUE_3: # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) # local_c2i_at_A2I_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) + li $t2, 1 + sw $t2, -4($fp) label_END_4: # IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSE_1 # IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSE_1 -lw $t1, -4($fp) -beq $t1, 0, label_FALSE_1 +lw $t2, -4($fp) +beq $t2, 0, label_FALSE_1 # GOTO label_END_2 j label_END_2 label_FALSE_1: @@ -699,43 +736,43 @@ label_FALSE_1: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_3 - sw $t1, 8($v0) - li $t1, 1 - sw $t1, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + la $t2, data_3 + sw $t2, 8($v0) + li $t2, 1 + sw $t2, 12($v0) sw $v0, -16($fp) # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) # local_c2i_at_A2I_internal_2 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_3 - lw $t1, 0($fp) - lw $t2, -16($fp) - sub $t1, $t1, $t2 - sw $t1, -12($fp) + lw $t2, 0($fp) + lw $t3, -16($fp) + sub $t2, $t2, $t3 + sw $t2, -12($fp) # IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_TRUE_7 # IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_TRUE_7 - lw $t1, -12($fp) - beq $t1, 0, label_TRUE_7 + lw $t2, -12($fp) + beq $t2, 0, label_TRUE_7 # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) # local_c2i_at_A2I_internal_2 = 0 - li $t1, 0 - sw $t1, -12($fp) + li $t2, 0 + sw $t2, -12($fp) # GOTO label_END_8 j label_END_8 label_TRUE_7: # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) # local_c2i_at_A2I_internal_2 = 1 - li $t1, 1 - sw $t1, -12($fp) + li $t2, 1 + sw $t2, -12($fp) label_END_8: # IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_FALSE_5 # IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_FALSE_5 -lw $t1, -12($fp) -beq $t1, 0, label_FALSE_5 +lw $t2, -12($fp) +beq $t2, 0, label_FALSE_5 # GOTO label_END_6 j label_END_6 label_FALSE_5: @@ -745,43 +782,43 @@ label_FALSE_5: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_4 - sw $t1, 8($v0) - li $t1, 1 - sw $t1, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + la $t2, data_4 + sw $t2, 8($v0) + li $t2, 1 + sw $t2, 12($v0) sw $v0, -24($fp) # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) # LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) # local_c2i_at_A2I_internal_4 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_5 - lw $t1, 0($fp) - lw $t2, -24($fp) - sub $t1, $t1, $t2 - sw $t1, -20($fp) + lw $t2, 0($fp) + lw $t3, -24($fp) + sub $t2, $t2, $t3 + sw $t2, -20($fp) # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_11 # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_11 - lw $t1, -20($fp) - beq $t1, 0, label_TRUE_11 + lw $t2, -20($fp) + beq $t2, 0, label_TRUE_11 # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) # local_c2i_at_A2I_internal_4 = 0 - li $t1, 0 - sw $t1, -20($fp) + li $t2, 0 + sw $t2, -20($fp) # GOTO label_END_12 j label_END_12 label_TRUE_11: # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) # local_c2i_at_A2I_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) + li $t2, 1 + sw $t2, -20($fp) label_END_12: # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_9 # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_9 -lw $t1, -20($fp) -beq $t1, 0, label_FALSE_9 +lw $t2, -20($fp) +beq $t2, 0, label_FALSE_9 # GOTO label_END_10 j label_END_10 label_FALSE_9: @@ -791,43 +828,43 @@ label_FALSE_9: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_5 - sw $t1, 8($v0) - li $t1, 1 - sw $t1, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + la $t2, data_5 + sw $t2, 8($v0) + li $t2, 1 + sw $t2, 12($v0) sw $v0, -32($fp) # LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) # local_c2i_at_A2I_internal_6 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_7 - lw $t1, 0($fp) - lw $t2, -32($fp) - sub $t1, $t1, $t2 - sw $t1, -28($fp) + lw $t2, 0($fp) + lw $t3, -32($fp) + sub $t2, $t2, $t3 + sw $t2, -28($fp) # IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_TRUE_15 # IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_TRUE_15 - lw $t1, -28($fp) - beq $t1, 0, label_TRUE_15 + lw $t2, -28($fp) + beq $t2, 0, label_TRUE_15 # LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) # local_c2i_at_A2I_internal_6 = 0 - li $t1, 0 - sw $t1, -28($fp) + li $t2, 0 + sw $t2, -28($fp) # GOTO label_END_16 j label_END_16 label_TRUE_15: # LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) # local_c2i_at_A2I_internal_6 = 1 - li $t1, 1 - sw $t1, -28($fp) + li $t2, 1 + sw $t2, -28($fp) label_END_16: # IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSE_13 # IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSE_13 -lw $t1, -28($fp) -beq $t1, 0, label_FALSE_13 +lw $t2, -28($fp) +beq $t2, 0, label_FALSE_13 # GOTO label_END_14 j label_END_14 label_FALSE_13: @@ -837,43 +874,43 @@ label_FALSE_13: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_6 - sw $t1, 8($v0) - li $t1, 1 - sw $t1, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + la $t2, data_6 + sw $t2, 8($v0) + li $t2, 1 + sw $t2, 12($v0) sw $v0, -40($fp) # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) # local_c2i_at_A2I_internal_8 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_9 - lw $t1, 0($fp) - lw $t2, -40($fp) - sub $t1, $t1, $t2 - sw $t1, -36($fp) + lw $t2, 0($fp) + lw $t3, -40($fp) + sub $t2, $t2, $t3 + sw $t2, -36($fp) # IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_TRUE_19 # IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_TRUE_19 - lw $t1, -36($fp) - beq $t1, 0, label_TRUE_19 + lw $t2, -36($fp) + beq $t2, 0, label_TRUE_19 # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) # local_c2i_at_A2I_internal_8 = 0 - li $t1, 0 - sw $t1, -36($fp) + li $t2, 0 + sw $t2, -36($fp) # GOTO label_END_20 j label_END_20 label_TRUE_19: # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) # local_c2i_at_A2I_internal_8 = 1 - li $t1, 1 - sw $t1, -36($fp) + li $t2, 1 + sw $t2, -36($fp) label_END_20: # IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_FALSE_17 # IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_FALSE_17 -lw $t1, -36($fp) -beq $t1, 0, label_FALSE_17 +lw $t2, -36($fp) +beq $t2, 0, label_FALSE_17 # GOTO label_END_18 j label_END_18 label_FALSE_17: @@ -883,43 +920,43 @@ label_FALSE_17: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_7 - sw $t1, 8($v0) - li $t1, 1 - sw $t1, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + la $t2, data_7 + sw $t2, 8($v0) + li $t2, 1 + sw $t2, 12($v0) sw $v0, -48($fp) # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) # LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) # local_c2i_at_A2I_internal_10 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_11 - lw $t1, 0($fp) - lw $t2, -48($fp) - sub $t1, $t1, $t2 - sw $t1, -44($fp) + lw $t2, 0($fp) + lw $t3, -48($fp) + sub $t2, $t2, $t3 + sw $t2, -44($fp) # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_23 # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_23 - lw $t1, -44($fp) - beq $t1, 0, label_TRUE_23 + lw $t2, -44($fp) + beq $t2, 0, label_TRUE_23 # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) # local_c2i_at_A2I_internal_10 = 0 - li $t1, 0 - sw $t1, -44($fp) + li $t2, 0 + sw $t2, -44($fp) # GOTO label_END_24 j label_END_24 label_TRUE_23: # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) # local_c2i_at_A2I_internal_10 = 1 - li $t1, 1 - sw $t1, -44($fp) + li $t2, 1 + sw $t2, -44($fp) label_END_24: # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_21 # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_21 -lw $t1, -44($fp) -beq $t1, 0, label_FALSE_21 +lw $t2, -44($fp) +beq $t2, 0, label_FALSE_21 # GOTO label_END_22 j label_END_22 label_FALSE_21: @@ -929,43 +966,43 @@ label_FALSE_21: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_8 - sw $t1, 8($v0) - li $t1, 1 - sw $t1, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + la $t2, data_8 + sw $t2, 8($v0) + li $t2, 1 + sw $t2, 12($v0) sw $v0, -56($fp) # LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) # local_c2i_at_A2I_internal_12 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_13 - lw $t1, 0($fp) - lw $t2, -56($fp) - sub $t1, $t1, $t2 - sw $t1, -52($fp) + lw $t2, 0($fp) + lw $t3, -56($fp) + sub $t2, $t2, $t3 + sw $t2, -52($fp) # IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_TRUE_27 # IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_TRUE_27 - lw $t1, -52($fp) - beq $t1, 0, label_TRUE_27 + lw $t2, -52($fp) + beq $t2, 0, label_TRUE_27 # LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) # local_c2i_at_A2I_internal_12 = 0 - li $t1, 0 - sw $t1, -52($fp) + li $t2, 0 + sw $t2, -52($fp) # GOTO label_END_28 j label_END_28 label_TRUE_27: # LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) # local_c2i_at_A2I_internal_12 = 1 - li $t1, 1 - sw $t1, -52($fp) + li $t2, 1 + sw $t2, -52($fp) label_END_28: # IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSE_25 # IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSE_25 -lw $t1, -52($fp) -beq $t1, 0, label_FALSE_25 +lw $t2, -52($fp) +beq $t2, 0, label_FALSE_25 # GOTO label_END_26 j label_END_26 label_FALSE_25: @@ -975,43 +1012,43 @@ label_FALSE_25: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_9 - sw $t1, 8($v0) - li $t1, 1 - sw $t1, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + la $t2, data_9 + sw $t2, 8($v0) + li $t2, 1 + sw $t2, 12($v0) sw $v0, -64($fp) # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) # local_c2i_at_A2I_internal_14 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_15 - lw $t1, 0($fp) - lw $t2, -64($fp) - sub $t1, $t1, $t2 - sw $t1, -60($fp) + lw $t2, 0($fp) + lw $t3, -64($fp) + sub $t2, $t2, $t3 + sw $t2, -60($fp) # IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_TRUE_31 # IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_TRUE_31 - lw $t1, -60($fp) - beq $t1, 0, label_TRUE_31 + lw $t2, -60($fp) + beq $t2, 0, label_TRUE_31 # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) # local_c2i_at_A2I_internal_14 = 0 - li $t1, 0 - sw $t1, -60($fp) + li $t2, 0 + sw $t2, -60($fp) # GOTO label_END_32 j label_END_32 label_TRUE_31: # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) # local_c2i_at_A2I_internal_14 = 1 - li $t1, 1 - sw $t1, -60($fp) + li $t2, 1 + sw $t2, -60($fp) label_END_32: # IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_FALSE_29 # IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_FALSE_29 -lw $t1, -60($fp) -beq $t1, 0, label_FALSE_29 +lw $t2, -60($fp) +beq $t2, 0, label_FALSE_29 # GOTO label_END_30 j label_END_30 label_FALSE_29: @@ -1021,43 +1058,43 @@ label_FALSE_29: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_10 - sw $t1, 8($v0) - li $t1, 1 - sw $t1, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + la $t2, data_10 + sw $t2, 8($v0) + li $t2, 1 + sw $t2, 12($v0) sw $v0, -72($fp) # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) # LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) # local_c2i_at_A2I_internal_16 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_17 - lw $t1, 0($fp) - lw $t2, -72($fp) - sub $t1, $t1, $t2 - sw $t1, -68($fp) + lw $t2, 0($fp) + lw $t3, -72($fp) + sub $t2, $t2, $t3 + sw $t2, -68($fp) # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_35 # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_35 - lw $t1, -68($fp) - beq $t1, 0, label_TRUE_35 + lw $t2, -68($fp) + beq $t2, 0, label_TRUE_35 # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) # local_c2i_at_A2I_internal_16 = 0 - li $t1, 0 - sw $t1, -68($fp) + li $t2, 0 + sw $t2, -68($fp) # GOTO label_END_36 j label_END_36 label_TRUE_35: # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) # local_c2i_at_A2I_internal_16 = 1 - li $t1, 1 - sw $t1, -68($fp) + li $t2, 1 + sw $t2, -68($fp) label_END_36: # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_33 # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_33 -lw $t1, -68($fp) -beq $t1, 0, label_FALSE_33 +lw $t2, -68($fp) +beq $t2, 0, label_FALSE_33 # GOTO label_END_34 j label_END_34 label_FALSE_33: @@ -1067,43 +1104,43 @@ label_FALSE_33: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_11 - sw $t1, 8($v0) - li $t1, 1 - sw $t1, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + la $t2, data_11 + sw $t2, 8($v0) + li $t2, 1 + sw $t2, 12($v0) sw $v0, -80($fp) # LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) # local_c2i_at_A2I_internal_18 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_19 - lw $t1, 0($fp) - lw $t2, -80($fp) - sub $t1, $t1, $t2 - sw $t1, -76($fp) + lw $t2, 0($fp) + lw $t3, -80($fp) + sub $t2, $t2, $t3 + sw $t2, -76($fp) # IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_TRUE_39 # IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_TRUE_39 - lw $t1, -76($fp) - beq $t1, 0, label_TRUE_39 + lw $t2, -76($fp) + beq $t2, 0, label_TRUE_39 # LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) # local_c2i_at_A2I_internal_18 = 0 - li $t1, 0 - sw $t1, -76($fp) + li $t2, 0 + sw $t2, -76($fp) # GOTO label_END_40 j label_END_40 label_TRUE_39: # LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) # local_c2i_at_A2I_internal_18 = 1 - li $t1, 1 - sw $t1, -76($fp) + li $t2, 1 + sw $t2, -76($fp) label_END_40: # IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSE_37 # IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSE_37 -lw $t1, -76($fp) -beq $t1, 0, label_FALSE_37 +lw $t2, -76($fp) +beq $t2, 0, label_FALSE_37 # GOTO label_END_38 j label_END_38 label_FALSE_37: @@ -1113,8 +1150,8 @@ label_FALSE_37: # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) # local_c2i_at_A2I_internal_20 = local_c2i_at_A2I_internal_22 - lw $t1, -92($fp) - sw $t1, -84($fp) + lw $t2, -92($fp) + sw $t2, -84($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1124,13 +1161,13 @@ label_FALSE_37: # Save new self pointer in $s1 lw $s1, -84($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 0($t3) # Call function. Result is on $v0 - jalr $t3 + jalr $t4 sw $v0, -88($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1171,43 +1208,43 @@ function_i2c_at_A2I: # LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) # local_i2c_at_A2I_internal_0 = PARAM param_i2c_at_A2I_i_0 - 0 - lw $t1, 0($fp) - sub $t1, $t1, 0 - sw $t1, -4($fp) + lw $t2, 0($fp) + sub $t2, $t2, 0 + sw $t2, -4($fp) # IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_TRUE_43 # IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_TRUE_43 - lw $t1, -4($fp) - beq $t1, 0, label_TRUE_43 + lw $t2, -4($fp) + beq $t2, 0, label_TRUE_43 # LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) # local_i2c_at_A2I_internal_0 = 0 - li $t1, 0 - sw $t1, -4($fp) + li $t2, 0 + sw $t2, -4($fp) # GOTO label_END_44 j label_END_44 label_TRUE_43: # LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) # local_i2c_at_A2I_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) + li $t2, 1 + sw $t2, -4($fp) label_END_44: # IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSE_41 # IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSE_41 -lw $t1, -4($fp) -beq $t1, 0, label_FALSE_41 +lw $t2, -4($fp) +beq $t2, 0, label_FALSE_41 # LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall # Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_12 -sw $t1, 8($v0) -li $t1, 1 -sw $t1, 12($v0) +la $t2, String +sw $t2, 0($v0) +la $t2, String_start +sw $t2, 4($v0) +la $t2, data_12 +sw $t2, 8($v0) +li $t2, 1 +sw $t2, 12($v0) sw $v0, -8($fp) # GOTO label_END_42 j label_END_42 @@ -1215,43 +1252,43 @@ label_FALSE_41: # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) # local_i2c_at_A2I_internal_2 = PARAM param_i2c_at_A2I_i_0 - 1 - lw $t1, 0($fp) - sub $t1, $t1, 1 - sw $t1, -12($fp) + lw $t2, 0($fp) + sub $t2, $t2, 1 + sw $t2, -12($fp) # IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_TRUE_47 # IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_TRUE_47 - lw $t1, -12($fp) - beq $t1, 0, label_TRUE_47 + lw $t2, -12($fp) + beq $t2, 0, label_TRUE_47 # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) # local_i2c_at_A2I_internal_2 = 0 - li $t1, 0 - sw $t1, -12($fp) + li $t2, 0 + sw $t2, -12($fp) # GOTO label_END_48 j label_END_48 label_TRUE_47: # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) # local_i2c_at_A2I_internal_2 = 1 - li $t1, 1 - sw $t1, -12($fp) + li $t2, 1 + sw $t2, -12($fp) label_END_48: # IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_FALSE_45 # IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_FALSE_45 -lw $t1, -12($fp) -beq $t1, 0, label_FALSE_45 +lw $t2, -12($fp) +beq $t2, 0, label_FALSE_45 # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall # Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_13 -sw $t1, 8($v0) -li $t1, 1 -sw $t1, 12($v0) +la $t2, String +sw $t2, 0($v0) +la $t2, String_start +sw $t2, 4($v0) +la $t2, data_13 +sw $t2, 8($v0) +li $t2, 1 +sw $t2, 12($v0) sw $v0, -16($fp) # GOTO label_END_46 j label_END_46 @@ -1259,43 +1296,43 @@ label_FALSE_45: # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) # local_i2c_at_A2I_internal_4 = PARAM param_i2c_at_A2I_i_0 - 2 - lw $t1, 0($fp) - sub $t1, $t1, 2 - sw $t1, -20($fp) + lw $t2, 0($fp) + sub $t2, $t2, 2 + sw $t2, -20($fp) # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_51 # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_51 - lw $t1, -20($fp) - beq $t1, 0, label_TRUE_51 + lw $t2, -20($fp) + beq $t2, 0, label_TRUE_51 # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) # local_i2c_at_A2I_internal_4 = 0 - li $t1, 0 - sw $t1, -20($fp) + li $t2, 0 + sw $t2, -20($fp) # GOTO label_END_52 j label_END_52 label_TRUE_51: # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) # local_i2c_at_A2I_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) + li $t2, 1 + sw $t2, -20($fp) label_END_52: # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_49 # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_49 -lw $t1, -20($fp) -beq $t1, 0, label_FALSE_49 +lw $t2, -20($fp) +beq $t2, 0, label_FALSE_49 # LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall # Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_14 -sw $t1, 8($v0) -li $t1, 1 -sw $t1, 12($v0) +la $t2, String +sw $t2, 0($v0) +la $t2, String_start +sw $t2, 4($v0) +la $t2, data_14 +sw $t2, 8($v0) +li $t2, 1 +sw $t2, 12($v0) sw $v0, -24($fp) # GOTO label_END_50 j label_END_50 @@ -1303,43 +1340,43 @@ label_FALSE_49: # LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) # local_i2c_at_A2I_internal_6 = PARAM param_i2c_at_A2I_i_0 - 3 - lw $t1, 0($fp) - sub $t1, $t1, 3 - sw $t1, -28($fp) + lw $t2, 0($fp) + sub $t2, $t2, 3 + sw $t2, -28($fp) # IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_TRUE_55 # IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_TRUE_55 - lw $t1, -28($fp) - beq $t1, 0, label_TRUE_55 + lw $t2, -28($fp) + beq $t2, 0, label_TRUE_55 # LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) # local_i2c_at_A2I_internal_6 = 0 - li $t1, 0 - sw $t1, -28($fp) + li $t2, 0 + sw $t2, -28($fp) # GOTO label_END_56 j label_END_56 label_TRUE_55: # LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) # local_i2c_at_A2I_internal_6 = 1 - li $t1, 1 - sw $t1, -28($fp) + li $t2, 1 + sw $t2, -28($fp) label_END_56: # IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSE_53 # IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSE_53 -lw $t1, -28($fp) -beq $t1, 0, label_FALSE_53 +lw $t2, -28($fp) +beq $t2, 0, label_FALSE_53 # LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall # Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_15 -sw $t1, 8($v0) -li $t1, 1 -sw $t1, 12($v0) +la $t2, String +sw $t2, 0($v0) +la $t2, String_start +sw $t2, 4($v0) +la $t2, data_15 +sw $t2, 8($v0) +li $t2, 1 +sw $t2, 12($v0) sw $v0, -32($fp) # GOTO label_END_54 j label_END_54 @@ -1347,43 +1384,43 @@ label_FALSE_53: # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) # local_i2c_at_A2I_internal_8 = PARAM param_i2c_at_A2I_i_0 - 4 - lw $t1, 0($fp) - sub $t1, $t1, 4 - sw $t1, -36($fp) + lw $t2, 0($fp) + sub $t2, $t2, 4 + sw $t2, -36($fp) # IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_TRUE_59 # IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_TRUE_59 - lw $t1, -36($fp) - beq $t1, 0, label_TRUE_59 + lw $t2, -36($fp) + beq $t2, 0, label_TRUE_59 # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) # local_i2c_at_A2I_internal_8 = 0 - li $t1, 0 - sw $t1, -36($fp) + li $t2, 0 + sw $t2, -36($fp) # GOTO label_END_60 j label_END_60 label_TRUE_59: # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) # local_i2c_at_A2I_internal_8 = 1 - li $t1, 1 - sw $t1, -36($fp) + li $t2, 1 + sw $t2, -36($fp) label_END_60: # IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_FALSE_57 # IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_FALSE_57 -lw $t1, -36($fp) -beq $t1, 0, label_FALSE_57 +lw $t2, -36($fp) +beq $t2, 0, label_FALSE_57 # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall # Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_16 -sw $t1, 8($v0) -li $t1, 1 -sw $t1, 12($v0) +la $t2, String +sw $t2, 0($v0) +la $t2, String_start +sw $t2, 4($v0) +la $t2, data_16 +sw $t2, 8($v0) +li $t2, 1 +sw $t2, 12($v0) sw $v0, -40($fp) # GOTO label_END_58 j label_END_58 @@ -1391,43 +1428,43 @@ label_FALSE_57: # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) # local_i2c_at_A2I_internal_10 = PARAM param_i2c_at_A2I_i_0 - 5 - lw $t1, 0($fp) - sub $t1, $t1, 5 - sw $t1, -44($fp) + lw $t2, 0($fp) + sub $t2, $t2, 5 + sw $t2, -44($fp) # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_63 # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_63 - lw $t1, -44($fp) - beq $t1, 0, label_TRUE_63 + lw $t2, -44($fp) + beq $t2, 0, label_TRUE_63 # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) # local_i2c_at_A2I_internal_10 = 0 - li $t1, 0 - sw $t1, -44($fp) + li $t2, 0 + sw $t2, -44($fp) # GOTO label_END_64 j label_END_64 label_TRUE_63: # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) # local_i2c_at_A2I_internal_10 = 1 - li $t1, 1 - sw $t1, -44($fp) + li $t2, 1 + sw $t2, -44($fp) label_END_64: # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_61 # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_61 -lw $t1, -44($fp) -beq $t1, 0, label_FALSE_61 +lw $t2, -44($fp) +beq $t2, 0, label_FALSE_61 # LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall # Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_17 -sw $t1, 8($v0) -li $t1, 1 -sw $t1, 12($v0) +la $t2, String +sw $t2, 0($v0) +la $t2, String_start +sw $t2, 4($v0) +la $t2, data_17 +sw $t2, 8($v0) +li $t2, 1 +sw $t2, 12($v0) sw $v0, -48($fp) # GOTO label_END_62 j label_END_62 @@ -1435,43 +1472,43 @@ label_FALSE_61: # LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) # local_i2c_at_A2I_internal_12 = PARAM param_i2c_at_A2I_i_0 - 6 - lw $t1, 0($fp) - sub $t1, $t1, 6 - sw $t1, -52($fp) + lw $t2, 0($fp) + sub $t2, $t2, 6 + sw $t2, -52($fp) # IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_TRUE_67 # IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_TRUE_67 - lw $t1, -52($fp) - beq $t1, 0, label_TRUE_67 + lw $t2, -52($fp) + beq $t2, 0, label_TRUE_67 # LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) # local_i2c_at_A2I_internal_12 = 0 - li $t1, 0 - sw $t1, -52($fp) + li $t2, 0 + sw $t2, -52($fp) # GOTO label_END_68 j label_END_68 label_TRUE_67: # LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) # local_i2c_at_A2I_internal_12 = 1 - li $t1, 1 - sw $t1, -52($fp) + li $t2, 1 + sw $t2, -52($fp) label_END_68: # IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSE_65 # IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSE_65 -lw $t1, -52($fp) -beq $t1, 0, label_FALSE_65 +lw $t2, -52($fp) +beq $t2, 0, label_FALSE_65 # LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall # Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_18 -sw $t1, 8($v0) -li $t1, 1 -sw $t1, 12($v0) +la $t2, String +sw $t2, 0($v0) +la $t2, String_start +sw $t2, 4($v0) +la $t2, data_18 +sw $t2, 8($v0) +li $t2, 1 +sw $t2, 12($v0) sw $v0, -56($fp) # GOTO label_END_66 j label_END_66 @@ -1479,43 +1516,43 @@ label_FALSE_65: # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) # local_i2c_at_A2I_internal_14 = PARAM param_i2c_at_A2I_i_0 - 7 - lw $t1, 0($fp) - sub $t1, $t1, 7 - sw $t1, -60($fp) + lw $t2, 0($fp) + sub $t2, $t2, 7 + sw $t2, -60($fp) # IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_TRUE_71 # IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_TRUE_71 - lw $t1, -60($fp) - beq $t1, 0, label_TRUE_71 + lw $t2, -60($fp) + beq $t2, 0, label_TRUE_71 # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) # local_i2c_at_A2I_internal_14 = 0 - li $t1, 0 - sw $t1, -60($fp) + li $t2, 0 + sw $t2, -60($fp) # GOTO label_END_72 j label_END_72 label_TRUE_71: # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) # local_i2c_at_A2I_internal_14 = 1 - li $t1, 1 - sw $t1, -60($fp) + li $t2, 1 + sw $t2, -60($fp) label_END_72: # IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_FALSE_69 # IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_FALSE_69 -lw $t1, -60($fp) -beq $t1, 0, label_FALSE_69 +lw $t2, -60($fp) +beq $t2, 0, label_FALSE_69 # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall # Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_19 -sw $t1, 8($v0) -li $t1, 1 -sw $t1, 12($v0) +la $t2, String +sw $t2, 0($v0) +la $t2, String_start +sw $t2, 4($v0) +la $t2, data_19 +sw $t2, 8($v0) +li $t2, 1 +sw $t2, 12($v0) sw $v0, -64($fp) # GOTO label_END_70 j label_END_70 @@ -1523,43 +1560,43 @@ label_FALSE_69: # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) # local_i2c_at_A2I_internal_16 = PARAM param_i2c_at_A2I_i_0 - 8 - lw $t1, 0($fp) - sub $t1, $t1, 8 - sw $t1, -68($fp) + lw $t2, 0($fp) + sub $t2, $t2, 8 + sw $t2, -68($fp) # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_75 # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_75 - lw $t1, -68($fp) - beq $t1, 0, label_TRUE_75 + lw $t2, -68($fp) + beq $t2, 0, label_TRUE_75 # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) # local_i2c_at_A2I_internal_16 = 0 - li $t1, 0 - sw $t1, -68($fp) + li $t2, 0 + sw $t2, -68($fp) # GOTO label_END_76 j label_END_76 label_TRUE_75: # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) # local_i2c_at_A2I_internal_16 = 1 - li $t1, 1 - sw $t1, -68($fp) + li $t2, 1 + sw $t2, -68($fp) label_END_76: # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_73 # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_73 -lw $t1, -68($fp) -beq $t1, 0, label_FALSE_73 +lw $t2, -68($fp) +beq $t2, 0, label_FALSE_73 # LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall # Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_20 -sw $t1, 8($v0) -li $t1, 1 -sw $t1, 12($v0) +la $t2, String +sw $t2, 0($v0) +la $t2, String_start +sw $t2, 4($v0) +la $t2, data_20 +sw $t2, 8($v0) +li $t2, 1 +sw $t2, 12($v0) sw $v0, -72($fp) # GOTO label_END_74 j label_END_74 @@ -1567,43 +1604,43 @@ label_FALSE_73: # LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) # local_i2c_at_A2I_internal_18 = PARAM param_i2c_at_A2I_i_0 - 9 - lw $t1, 0($fp) - sub $t1, $t1, 9 - sw $t1, -76($fp) + lw $t2, 0($fp) + sub $t2, $t2, 9 + sw $t2, -76($fp) # IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_TRUE_79 # IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_TRUE_79 - lw $t1, -76($fp) - beq $t1, 0, label_TRUE_79 + lw $t2, -76($fp) + beq $t2, 0, label_TRUE_79 # LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) # local_i2c_at_A2I_internal_18 = 0 - li $t1, 0 - sw $t1, -76($fp) + li $t2, 0 + sw $t2, -76($fp) # GOTO label_END_80 j label_END_80 label_TRUE_79: # LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) # local_i2c_at_A2I_internal_18 = 1 - li $t1, 1 - sw $t1, -76($fp) + li $t2, 1 + sw $t2, -76($fp) label_END_80: # IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSE_77 # IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSE_77 -lw $t1, -76($fp) -beq $t1, 0, label_FALSE_77 +lw $t2, -76($fp) +beq $t2, 0, label_FALSE_77 # LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall # Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_21 -sw $t1, 8($v0) -li $t1, 1 -sw $t1, 12($v0) +la $t2, String +sw $t2, 0($v0) +la $t2, String_start +sw $t2, 4($v0) +la $t2, data_21 +sw $t2, 8($v0) +li $t2, 1 +sw $t2, 12($v0) sw $v0, -80($fp) # GOTO label_END_78 j label_END_78 @@ -1614,8 +1651,8 @@ label_FALSE_77: # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) # local_i2c_at_A2I_internal_20 = local_i2c_at_A2I_internal_22 - lw $t1, -92($fp) - sw $t1, -84($fp) + lw $t2, -92($fp) + sw $t2, -84($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1625,13 +1662,13 @@ label_FALSE_77: # Save new self pointer in $s1 lw $s1, -84($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 0($t3) # Call function. Result is on $v0 - jalr $t3 + jalr $t4 sw $v0, -88($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1642,14 +1679,14 @@ label_FALSE_77: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_22 - sw $t1, 8($v0) - li $t1, 0 - sw $t1, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + la $t2, data_22 + sw $t2, 8($v0) + li $t2, 0 + sw $t2, 12($v0) sw $v0, -96($fp) label_END_78: label_END_74: @@ -1687,8 +1724,8 @@ function_a2i_at_A2I: # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) # PARAM param_a2i_at_A2I_s_0 --> 0($fp) # local_a2i_at_A2I_internal_1 = PARAM param_a2i_at_A2I_s_0 - lw $t1, 0($fp) - sw $t1, -8($fp) + lw $t2, 0($fp) + sw $t2, -8($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1698,13 +1735,13 @@ function_a2i_at_A2I: # Save new self pointer in $s1 lw $s1, -8($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t3, 0($t2) # Get pointer to function address - lw $t3, 8($t2) + lw $t4, 8($t3) # Call function. Result is on $v0 - jalr $t3 + jalr $t4 sw $v0, -12($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1712,63 +1749,63 @@ function_a2i_at_A2I: # LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) # local_a2i_at_A2I_internal_0 = local_a2i_at_A2I_internal_2 - 0 - lw $t1, -12($fp) - sub $t1, $t1, 0 - sw $t1, -4($fp) + lw $t2, -12($fp) + sub $t2, $t2, 0 + sw $t2, -4($fp) # IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_TRUE_83 # IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_TRUE_83 - lw $t1, -4($fp) - beq $t1, 0, label_TRUE_83 + lw $t2, -4($fp) + beq $t2, 0, label_TRUE_83 # LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) # local_a2i_at_A2I_internal_0 = 0 - li $t1, 0 - sw $t1, -4($fp) + li $t2, 0 + sw $t2, -4($fp) # GOTO label_END_84 j label_END_84 label_TRUE_83: # LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) # local_a2i_at_A2I_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) + li $t2, 1 + sw $t2, -4($fp) label_END_84: # IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSE_81 # IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSE_81 -lw $t1, -4($fp) -beq $t1, 0, label_FALSE_81 +lw $t2, -4($fp) +beq $t2, 0, label_FALSE_81 # GOTO label_END_82 j label_END_82 label_FALSE_81: # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) # PARAM param_a2i_at_A2I_s_0 --> 0($fp) # local_a2i_at_A2I_internal_4 = PARAM param_a2i_at_A2I_s_0 - lw $t1, 0($fp) - sw $t1, -20($fp) + lw $t2, 0($fp) + sw $t2, -20($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG 0 - li $t1, 0 + li $t2, 0 # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t2, 0($sp) # ARG 1 - li $t1, 1 + li $t2, 1 # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t2, 0($sp) # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) # local_a2i_at_A2I_internal_5 = VCALL local_a2i_at_A2I_internal_4 substr # Save new self pointer in $s1 lw $s1, -20($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t3, 0($t2) # Get pointer to function address - lw $t3, 4($t2) + lw $t4, 4($t3) # Call function. Result is on $v0 - jalr $t3 + jalr $t4 sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1779,77 +1816,77 @@ label_FALSE_81: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_23 - sw $t1, 8($v0) - li $t1, 1 - sw $t1, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + la $t2, data_23 + sw $t2, 8($v0) + li $t2, 1 + sw $t2, 12($v0) sw $v0, -28($fp) # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) # local_a2i_at_A2I_internal_3 = local_a2i_at_A2I_internal_5 - local_a2i_at_A2I_internal_6 - lw $t1, -24($fp) - lw $t2, -28($fp) - sub $t1, $t1, $t2 - sw $t1, -16($fp) + lw $t2, -24($fp) + lw $t3, -28($fp) + sub $t2, $t2, $t3 + sw $t2, -16($fp) # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_87 # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_87 - lw $t1, -16($fp) - beq $t1, 0, label_TRUE_87 + lw $t2, -16($fp) + beq $t2, 0, label_TRUE_87 # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) # local_a2i_at_A2I_internal_3 = 0 - li $t1, 0 - sw $t1, -16($fp) + li $t2, 0 + sw $t2, -16($fp) # GOTO label_END_88 j label_END_88 label_TRUE_87: # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) # local_a2i_at_A2I_internal_3 = 1 - li $t1, 1 - sw $t1, -16($fp) + li $t2, 1 + sw $t2, -16($fp) label_END_88: # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_FALSE_85 # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_FALSE_85 -lw $t1, -16($fp) -beq $t1, 0, label_FALSE_85 +lw $t2, -16($fp) +beq $t2, 0, label_FALSE_85 # GOTO label_END_86 j label_END_86 label_FALSE_85: # LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) # PARAM param_a2i_at_A2I_s_0 --> 0($fp) # local_a2i_at_A2I_internal_8 = PARAM param_a2i_at_A2I_s_0 - lw $t1, 0($fp) - sw $t1, -36($fp) + lw $t2, 0($fp) + sw $t2, -36($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG 0 - li $t1, 0 + li $t2, 0 # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t2, 0($sp) # ARG 1 - li $t1, 1 + li $t2, 1 # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t2, 0($sp) # LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) # LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) # local_a2i_at_A2I_internal_9 = VCALL local_a2i_at_A2I_internal_8 substr # Save new self pointer in $s1 lw $s1, -36($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t3, 0($t2) # Get pointer to function address - lw $t3, 4($t2) + lw $t4, 4($t3) # Call function. Result is on $v0 - jalr $t3 + jalr $t4 sw $v0, -40($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1860,72 +1897,72 @@ label_FALSE_85: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_24 - sw $t1, 8($v0) - li $t1, 1 - sw $t1, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + la $t2, data_24 + sw $t2, 8($v0) + li $t2, 1 + sw $t2, 12($v0) sw $v0, -44($fp) # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) # LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) # local_a2i_at_A2I_internal_7 = local_a2i_at_A2I_internal_9 - local_a2i_at_A2I_internal_10 - lw $t1, -40($fp) - lw $t2, -44($fp) - sub $t1, $t1, $t2 - sw $t1, -32($fp) + lw $t2, -40($fp) + lw $t3, -44($fp) + sub $t2, $t2, $t3 + sw $t2, -32($fp) # IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_TRUE_91 # IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_TRUE_91 - lw $t1, -32($fp) - beq $t1, 0, label_TRUE_91 + lw $t2, -32($fp) + beq $t2, 0, label_TRUE_91 # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) # local_a2i_at_A2I_internal_7 = 0 - li $t1, 0 - sw $t1, -32($fp) + li $t2, 0 + sw $t2, -32($fp) # GOTO label_END_92 j label_END_92 label_TRUE_91: # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) # local_a2i_at_A2I_internal_7 = 1 - li $t1, 1 - sw $t1, -32($fp) + li $t2, 1 + sw $t2, -32($fp) label_END_92: # IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_FALSE_89 # IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_FALSE_89 -lw $t1, -32($fp) -beq $t1, 0, label_FALSE_89 +lw $t2, -32($fp) +beq $t2, 0, label_FALSE_89 # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) # local_a2i_at_A2I_internal_13 = SELF sw $s1, -56($fp) # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) # local_a2i_at_A2I_internal_11 = local_a2i_at_A2I_internal_13 -lw $t1, -56($fp) -sw $t1, -48($fp) +lw $t2, -56($fp) +sw $t2, -48($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) # PARAM param_a2i_at_A2I_s_0 --> 0($fp) # local_a2i_at_A2I_internal_14 = PARAM param_a2i_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -60($fp) +lw $t2, 0($fp) +sw $t2, -60($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG 1 -li $t1, 1 +li $t2, 1 # Push arg into stack subu $sp, $sp, 4 -sw $t1, 0($sp) +sw $t2, 0($sp) # LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) # PARAM param_a2i_at_A2I_s_0 --> 0($fp) # local_a2i_at_A2I_internal_17 = PARAM param_a2i_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -72($fp) +lw $t2, 0($fp) +sw $t2, -72($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1935,13 +1972,13 @@ sw $s1, 0($sp) # Save new self pointer in $s1 lw $s1, -72($fp) # Get pointer to type -lw $t1, 4($s1) +lw $t2, 4($s1) # Get pointer to type's VTABLE -lw $t2, 0($t1) +lw $t3, 0($t2) # Get pointer to function address -lw $t3, 8($t2) +lw $t4, 8($t3) # Call function. Result is on $v0 -jalr $t3 +jalr $t4 sw $v0, -76($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1949,51 +1986,51 @@ addu $sp, $sp, 4 # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) # LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) # local_a2i_at_A2I_internal_16 = local_a2i_at_A2I_internal_18 - 1 -lw $t1, -76($fp) -sub $t1, $t1, 1 -sw $t1, -68($fp) +lw $t2, -76($fp) +sub $t2, $t2, 1 +sw $t2, -68($fp) # ARG local_a2i_at_A2I_internal_16 # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) -lw $t1, -68($fp) +lw $t2, -68($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t1, 0($sp) +sw $t2, 0($sp) # LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) # LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) # local_a2i_at_A2I_internal_15 = VCALL local_a2i_at_A2I_internal_14 substr # Save new self pointer in $s1 lw $s1, -60($fp) # Get pointer to type -lw $t1, 4($s1) +lw $t2, 4($s1) # Get pointer to type's VTABLE -lw $t2, 0($t1) +lw $t3, 0($t2) # Get pointer to function address -lw $t3, 4($t2) +lw $t4, 4($t3) # Call function. Result is on $v0 -jalr $t3 +jalr $t4 sw $v0, -64($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_a2i_at_A2I_internal_15 # LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) -lw $t1, -64($fp) +lw $t2, -64($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t1, 0($sp) +sw $t2, 0($sp) # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) # LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) # local_a2i_at_A2I_internal_12 = VCALL local_a2i_at_A2I_internal_11 a2i_aux # Save new self pointer in $s1 lw $s1, -48($fp) # Get pointer to type -lw $t1, 4($s1) +lw $t2, 4($s1) # Get pointer to type's VTABLE -lw $t2, 0($t1) +lw $t3, 0($t2) # Get pointer to function address -lw $t3, 24($t2) +lw $t4, 24($t3) # Call function. Result is on $v0 -jalr $t3 +jalr $t4 sw $v0, -52($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2007,30 +2044,30 @@ label_FALSE_89: # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) # LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) # local_a2i_at_A2I_internal_19 = local_a2i_at_A2I_internal_21 - lw $t1, -88($fp) - sw $t1, -80($fp) + lw $t2, -88($fp) + sw $t2, -80($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG param_a2i_at_A2I_s_0 # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - lw $t1, 0($fp) + lw $t2, 0($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t2, 0($sp) # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) # LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) # local_a2i_at_A2I_internal_20 = VCALL local_a2i_at_A2I_internal_19 a2i_aux # Save new self pointer in $s1 lw $s1, -80($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t3, 0($t2) # Get pointer to function address - lw $t3, 24($t2) + lw $t4, 24($t3) # Call function. Result is on $v0 - jalr $t3 + jalr $t4 sw $v0, -84($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2063,13 +2100,13 @@ function_a2i_aux_at_A2I: addu $fp, $sp, 64 # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) # local_a2i_aux_at_A2I_int_0 = 0 - li $t1, 0 - sw $t1, -4($fp) + li $t2, 0 + sw $t2, -4($fp) # LOCAL local_a2i_aux_at_A2I_internal_2 --> -12($fp) # PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) # local_a2i_aux_at_A2I_internal_2 = PARAM param_a2i_aux_at_A2I_s_0 - lw $t1, 0($fp) - sw $t1, -12($fp) + lw $t2, 0($fp) + sw $t2, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2079,13 +2116,13 @@ function_a2i_aux_at_A2I: # Save new self pointer in $s1 lw $s1, -12($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t3, 0($t2) # Get pointer to function address - lw $t3, 8($t2) + lw $t4, 8($t3) # Call function. Result is on $v0 - jalr $t3 + jalr $t4 sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2093,117 +2130,117 @@ function_a2i_aux_at_A2I: # LOCAL local_a2i_aux_at_A2I_j_1 --> -8($fp) # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) # local_a2i_aux_at_A2I_j_1 = local_a2i_aux_at_A2I_internal_3 - lw $t1, -16($fp) - sw $t1, -8($fp) + lw $t2, -16($fp) + sw $t2, -8($fp) # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) # local_a2i_aux_at_A2I_i_4 = 0 - li $t1, 0 - sw $t1, -20($fp) + li $t2, 0 + sw $t2, -20($fp) label_WHILE_93: # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) # LOCAL local_a2i_aux_at_A2I_j_1 --> -8($fp) # local_a2i_aux_at_A2I_internal_5 = local_a2i_aux_at_A2I_i_4 - local_a2i_aux_at_A2I_j_1 - lw $t1, -20($fp) - lw $t2, -8($fp) - sub $t1, $t1, $t2 - sw $t1, -24($fp) + lw $t2, -20($fp) + lw $t3, -8($fp) + sub $t2, $t2, $t3 + sw $t2, -24($fp) # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 - lw $t1, -24($fp) - bgt $t1, 0, label_FALSE_95 + lw $t2, -24($fp) + bgt $t2, 0, label_FALSE_95 # IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 # IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 - lw $t1, -24($fp) - beq $t1, 0, label_FALSE_95 + lw $t2, -24($fp) + beq $t2, 0, label_FALSE_95 # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) # local_a2i_aux_at_A2I_internal_5 = 1 - li $t1, 1 - sw $t1, -24($fp) + li $t2, 1 + sw $t2, -24($fp) # GOTO label_END_96 j label_END_96 label_FALSE_95: # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) # local_a2i_aux_at_A2I_internal_5 = 0 - li $t1, 0 - sw $t1, -24($fp) + li $t2, 0 + sw $t2, -24($fp) label_END_96: # IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_WHILE_END_94 # IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_WHILE_END_94 -lw $t1, -24($fp) -beq $t1, 0, label_WHILE_END_94 +lw $t2, -24($fp) +beq $t2, 0, label_WHILE_END_94 # LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) # local_a2i_aux_at_A2I_internal_7 = local_a2i_aux_at_A2I_int_0 * 10 -lw $t1, -4($fp) -mul $t1, $t1, 10 -sw $t1, -32($fp) +lw $t2, -4($fp) +mul $t2, $t2, 10 +sw $t2, -32($fp) # LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) # local_a2i_aux_at_A2I_internal_10 = SELF sw $s1, -44($fp) # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) # LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) # local_a2i_aux_at_A2I_internal_8 = local_a2i_aux_at_A2I_internal_10 -lw $t1, -44($fp) -sw $t1, -36($fp) +lw $t2, -44($fp) +sw $t2, -36($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) # PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) # local_a2i_aux_at_A2I_internal_11 = PARAM param_a2i_aux_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -48($fp) +lw $t2, 0($fp) +sw $t2, -48($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG local_a2i_aux_at_A2I_i_4 # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) -lw $t1, -20($fp) +lw $t2, -20($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t1, 0($sp) +sw $t2, 0($sp) # ARG 1 -li $t1, 1 +li $t2, 1 # Push arg into stack subu $sp, $sp, 4 -sw $t1, 0($sp) +sw $t2, 0($sp) # LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) # LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) # local_a2i_aux_at_A2I_internal_12 = VCALL local_a2i_aux_at_A2I_internal_11 substr # Save new self pointer in $s1 lw $s1, -48($fp) # Get pointer to type -lw $t1, 4($s1) +lw $t2, 4($s1) # Get pointer to type's VTABLE -lw $t2, 0($t1) +lw $t3, 0($t2) # Get pointer to function address -lw $t3, 4($t2) +lw $t4, 4($t3) # Call function. Result is on $v0 -jalr $t3 +jalr $t4 sw $v0, -52($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_a2i_aux_at_A2I_internal_12 # LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) -lw $t1, -52($fp) +lw $t2, -52($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t1, 0($sp) +sw $t2, 0($sp) # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) # LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) # local_a2i_aux_at_A2I_internal_9 = VCALL local_a2i_aux_at_A2I_internal_8 c2i # Save new self pointer in $s1 lw $s1, -36($fp) # Get pointer to type -lw $t1, 4($s1) +lw $t2, 4($s1) # Get pointer to type's VTABLE -lw $t2, 0($t1) +lw $t3, 0($t2) # Get pointer to function address -lw $t3, 12($t2) +lw $t4, 12($t3) # Call function. Result is on $v0 -jalr $t3 +jalr $t4 sw $v0, -40($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2212,26 +2249,26 @@ addu $sp, $sp, 4 # LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) # LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) # local_a2i_aux_at_A2I_internal_6 = local_a2i_aux_at_A2I_internal_7 + local_a2i_aux_at_A2I_internal_9 -lw $t1, -32($fp) -lw $t2, -40($fp) -add $t1, $t1, $t2 -sw $t1, -28($fp) +lw $t2, -32($fp) +lw $t3, -40($fp) +add $t2, $t2, $t3 +sw $t2, -28($fp) # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) # LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) # local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_6 -lw $t1, -28($fp) -sw $t1, -4($fp) +lw $t2, -28($fp) +sw $t2, -4($fp) # LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) # local_a2i_aux_at_A2I_internal_13 = local_a2i_aux_at_A2I_i_4 + 1 -lw $t1, -20($fp) -add $t1, $t1, 1 -sw $t1, -56($fp) +lw $t2, -20($fp) +add $t2, $t2, 1 +sw $t2, -56($fp) # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) # LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) # local_a2i_aux_at_A2I_i_4 = local_a2i_aux_at_A2I_internal_13 -lw $t1, -56($fp) -sw $t1, -20($fp) +lw $t2, -56($fp) +sw $t2, -20($fp) # GOTO label_WHILE_93 j label_WHILE_93 label_WHILE_END_94: @@ -2262,43 +2299,43 @@ function_i2a_at_A2I: # LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) # PARAM param_i2a_at_A2I_i_0 --> 0($fp) # local_i2a_at_A2I_internal_0 = PARAM param_i2a_at_A2I_i_0 - 0 - lw $t1, 0($fp) - sub $t1, $t1, 0 - sw $t1, -4($fp) + lw $t2, 0($fp) + sub $t2, $t2, 0 + sw $t2, -4($fp) # IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_TRUE_99 # IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_TRUE_99 - lw $t1, -4($fp) - beq $t1, 0, label_TRUE_99 + lw $t2, -4($fp) + beq $t2, 0, label_TRUE_99 # LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) # local_i2a_at_A2I_internal_0 = 0 - li $t1, 0 - sw $t1, -4($fp) + li $t2, 0 + sw $t2, -4($fp) # GOTO label_END_100 j label_END_100 label_TRUE_99: # LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) # local_i2a_at_A2I_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) + li $t2, 1 + sw $t2, -4($fp) label_END_100: # IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSE_97 # IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSE_97 -lw $t1, -4($fp) -beq $t1, 0, label_FALSE_97 +lw $t2, -4($fp) +beq $t2, 0, label_FALSE_97 # LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall # Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_25 -sw $t1, 8($v0) -li $t1, 1 -sw $t1, 12($v0) +la $t2, String +sw $t2, 0($v0) +la $t2, String_start +sw $t2, 4($v0) +la $t2, data_25 +sw $t2, 8($v0) +li $t2, 1 +sw $t2, 12($v0) sw $v0, -8($fp) # GOTO label_END_98 j label_END_98 @@ -2306,64 +2343,64 @@ label_FALSE_97: # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) # PARAM param_i2a_at_A2I_i_0 --> 0($fp) # local_i2a_at_A2I_internal_2 = 0 - PARAM param_i2a_at_A2I_i_0 - li $t1, 0 - lw $t2, 0($fp) - sub $t1, $t1, $t2 - sw $t1, -12($fp) + li $t2, 0 + lw $t3, 0($fp) + sub $t2, $t2, $t3 + sw $t2, -12($fp) # IF_GREATER_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 # IF_GREATER_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 - lw $t1, -12($fp) - bgt $t1, 0, label_FALSE_103 + lw $t2, -12($fp) + bgt $t2, 0, label_FALSE_103 # IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 # IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 - lw $t1, -12($fp) - beq $t1, 0, label_FALSE_103 + lw $t2, -12($fp) + beq $t2, 0, label_FALSE_103 # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) # local_i2a_at_A2I_internal_2 = 1 - li $t1, 1 - sw $t1, -12($fp) + li $t2, 1 + sw $t2, -12($fp) # GOTO label_END_104 j label_END_104 label_FALSE_103: # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) # local_i2a_at_A2I_internal_2 = 0 - li $t1, 0 - sw $t1, -12($fp) + li $t2, 0 + sw $t2, -12($fp) label_END_104: # IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_101 # IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_101 -lw $t1, -12($fp) -beq $t1, 0, label_FALSE_101 +lw $t2, -12($fp) +beq $t2, 0, label_FALSE_101 # LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) # local_i2a_at_A2I_internal_5 = SELF sw $s1, -24($fp) # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) # LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) # local_i2a_at_A2I_internal_3 = local_i2a_at_A2I_internal_5 -lw $t1, -24($fp) -sw $t1, -16($fp) +lw $t2, -24($fp) +sw $t2, -16($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG param_i2a_at_A2I_i_0 # PARAM param_i2a_at_A2I_i_0 --> 0($fp) -lw $t1, 0($fp) +lw $t2, 0($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t1, 0($sp) +sw $t2, 0($sp) # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) # local_i2a_at_A2I_internal_4 = VCALL local_i2a_at_A2I_internal_3 i2a_aux # Save new self pointer in $s1 lw $s1, -16($fp) # Get pointer to type -lw $t1, 4($s1) +lw $t2, 4($s1) # Get pointer to type's VTABLE -lw $t2, 0($t1) +lw $t3, 0($t2) # Get pointer to function address -lw $t3, 32($t2) +lw $t4, 32($t3) # Call function. Result is on $v0 -jalr $t3 +jalr $t4 sw $v0, -20($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2377,20 +2414,20 @@ label_FALSE_101: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_26 - sw $t1, 8($v0) - li $t1, 1 - sw $t1, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + la $t2, data_26 + sw $t2, 8($v0) + li $t2, 1 + sw $t2, 12($v0) sw $v0, -36($fp) # LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) # local_i2a_at_A2I_internal_6 = local_i2a_at_A2I_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) + lw $t2, -36($fp) + sw $t2, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2400,59 +2437,59 @@ label_FALSE_101: # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) # LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) # local_i2a_at_A2I_internal_9 = local_i2a_at_A2I_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) + lw $t2, -48($fp) + sw $t2, -40($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) # PARAM param_i2a_at_A2I_i_0 --> 0($fp) # local_i2a_at_A2I_internal_12 = PARAM param_i2a_at_A2I_i_0 * 1 - lw $t1, 0($fp) - mul $t1, $t1, 1 - sw $t1, -52($fp) + lw $t2, 0($fp) + mul $t2, $t2, 1 + sw $t2, -52($fp) # ARG local_i2a_at_A2I_internal_12 # LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) - lw $t1, -52($fp) + lw $t2, -52($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t2, 0($sp) # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) # LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) # local_i2a_at_A2I_internal_10 = VCALL local_i2a_at_A2I_internal_9 i2a_aux # Save new self pointer in $s1 lw $s1, -40($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t3, 0($t2) # Get pointer to function address - lw $t3, 32($t2) + lw $t4, 32($t3) # Call function. Result is on $v0 - jalr $t3 + jalr $t4 sw $v0, -44($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_i2a_at_A2I_internal_10 # LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) - lw $t1, -44($fp) + lw $t2, -44($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t2, 0($sp) # LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) # LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) # local_i2a_at_A2I_internal_7 = VCALL local_i2a_at_A2I_internal_6 concat # Save new self pointer in $s1 lw $s1, -28($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 0($t3) # Call function. Result is on $v0 - jalr $t3 + jalr $t4 sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2485,43 +2522,43 @@ function_i2a_aux_at_A2I: # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) # local_i2a_aux_at_A2I_internal_0 = PARAM param_i2a_aux_at_A2I_i_0 - 0 - lw $t1, 0($fp) - sub $t1, $t1, 0 - sw $t1, -4($fp) + lw $t2, 0($fp) + sub $t2, $t2, 0 + sw $t2, -4($fp) # IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_TRUE_107 # IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_TRUE_107 - lw $t1, -4($fp) - beq $t1, 0, label_TRUE_107 + lw $t2, -4($fp) + beq $t2, 0, label_TRUE_107 # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) # local_i2a_aux_at_A2I_internal_0 = 0 - li $t1, 0 - sw $t1, -4($fp) + li $t2, 0 + sw $t2, -4($fp) # GOTO label_END_108 j label_END_108 label_TRUE_107: # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) # local_i2a_aux_at_A2I_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) + li $t2, 1 + sw $t2, -4($fp) label_END_108: # IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSE_105 # IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSE_105 -lw $t1, -4($fp) -beq $t1, 0, label_FALSE_105 +lw $t2, -4($fp) +beq $t2, 0, label_FALSE_105 # LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall # Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -la $t1, data_27 -sw $t1, 8($v0) -li $t1, 0 -sw $t1, 12($v0) +la $t2, String +sw $t2, 0($v0) +la $t2, String_start +sw $t2, 4($v0) +la $t2, data_27 +sw $t2, 8($v0) +li $t2, 0 +sw $t2, 12($v0) sw $v0, -8($fp) # GOTO label_END_106 j label_END_106 @@ -2529,44 +2566,44 @@ label_FALSE_105: # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) # local_i2a_aux_at_A2I_internal_3 = PARAM param_i2a_aux_at_A2I_i_0 / 10 - lw $t1, 0($fp) - div $t1, $t1, 10 - sw $t1, -16($fp) + lw $t2, 0($fp) + div $t2, $t2, 10 + sw $t2, -16($fp) # LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) # local_i2a_aux_at_A2I_next_2 = local_i2a_aux_at_A2I_internal_3 - lw $t1, -16($fp) - sw $t1, -12($fp) + lw $t2, -16($fp) + sw $t2, -12($fp) # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) # local_i2a_aux_at_A2I_internal_8 = SELF sw $s1, -36($fp) # LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) # local_i2a_aux_at_A2I_internal_6 = local_i2a_aux_at_A2I_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) + lw $t2, -36($fp) + sw $t2, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG local_i2a_aux_at_A2I_next_2 # LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) - lw $t1, -12($fp) + lw $t2, -12($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t2, 0($sp) # LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) # local_i2a_aux_at_A2I_internal_7 = VCALL local_i2a_aux_at_A2I_internal_6 i2a_aux # Save new self pointer in $s1 lw $s1, -28($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t3, 0($t2) # Get pointer to function address - lw $t3, 32($t2) + lw $t4, 32($t3) # Call function. Result is on $v0 - jalr $t3 + jalr $t4 sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2574,8 +2611,8 @@ label_FALSE_105: # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) # local_i2a_aux_at_A2I_internal_4 = local_i2a_aux_at_A2I_internal_7 - lw $t1, -32($fp) - sw $t1, -20($fp) + lw $t2, -32($fp) + sw $t2, -20($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2585,67 +2622,67 @@ label_FALSE_105: # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) # local_i2a_aux_at_A2I_internal_9 = local_i2a_aux_at_A2I_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) + lw $t2, -48($fp) + sw $t2, -40($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) # LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) # local_i2a_aux_at_A2I_internal_13 = local_i2a_aux_at_A2I_next_2 * 10 - lw $t1, -12($fp) - mul $t1, $t1, 10 - sw $t1, -56($fp) + lw $t2, -12($fp) + mul $t2, $t2, 10 + sw $t2, -56($fp) # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) # local_i2a_aux_at_A2I_internal_12 = PARAM param_i2a_aux_at_A2I_i_0 - local_i2a_aux_at_A2I_internal_13 - lw $t1, 0($fp) - lw $t2, -56($fp) - sub $t1, $t1, $t2 - sw $t1, -52($fp) + lw $t2, 0($fp) + lw $t3, -56($fp) + sub $t2, $t2, $t3 + sw $t2, -52($fp) # ARG local_i2a_aux_at_A2I_internal_12 # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) - lw $t1, -52($fp) + lw $t2, -52($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t2, 0($sp) # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) # local_i2a_aux_at_A2I_internal_10 = VCALL local_i2a_aux_at_A2I_internal_9 i2c # Save new self pointer in $s1 lw $s1, -40($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t3, 0($t2) # Get pointer to function address - lw $t3, 16($t2) + lw $t4, 16($t3) # Call function. Result is on $v0 - jalr $t3 + jalr $t4 sw $v0, -44($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_i2a_aux_at_A2I_internal_10 # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) - lw $t1, -44($fp) + lw $t2, -44($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t2, 0($sp) # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) # LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) # local_i2a_aux_at_A2I_internal_5 = VCALL local_i2a_aux_at_A2I_internal_4 concat # Save new self pointer in $s1 lw $s1, -20($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 0($t3) # Call function. Result is on $v0 - jalr $t3 + jalr $t4 sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2675,21 +2712,34 @@ function_main_at_Main: addu $fp, $sp, 100 # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_3 = ALLOCATE A2I + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + la $t4, A2I + sw $t4, 8($v0) + li $t4, 3 + sw $t4, 12($v0) + move $t4, $v0 # Allocating 8 bytes of memory li $a0, 8 li $v0, 9 syscall - la $t1, A2I - sw $t1, 0($v0) - la $t1, A2I_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -16($fp) + sw $t4, 0($v0) + la $t4, A2I_start + sw $t4, 4($v0) + move $t3, $v0 + sw $t3, -16($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t1, -16($fp) - sw $t1, -8($fp) + lw $t3, -16($fp) + sw $t3, -8($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2699,34 +2749,34 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_28 - sw $t1, 8($v0) - li $t1, 6 - sw $t1, 12($v0) + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + la $t3, data_28 + sw $t3, 8($v0) + li $t3, 6 + sw $t3, 12($v0) sw $v0, -20($fp) # ARG local_main_at_Main_internal_4 # LOCAL local_main_at_Main_internal_4 --> -20($fp) - lw $t1, -20($fp) + lw $t3, -20($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t3, 0($sp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 a2i # Save new self pointer in $s1 lw $s1, -8($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 20($t2) + lw $t5, 20($t4) # Call function. Result is on $v0 - jalr $t3 + jalr $t5 sw $v0, -12($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2734,46 +2784,59 @@ function_main_at_Main: # LOCAL local_main_at_Main_a_0 --> -4($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_a_0 = local_main_at_Main_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + lw $t3, -12($fp) + sw $t3, -4($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # local_main_at_Main_internal_8 = ALLOCATE A2I + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + la $t5, A2I + sw $t5, 8($v0) + li $t5, 3 + sw $t5, 12($v0) + move $t5, $v0 # Allocating 8 bytes of memory li $a0, 8 li $v0, 9 syscall - la $t1, A2I - sw $t1, 0($v0) - la $t1, A2I_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -36($fp) + sw $t5, 0($v0) + la $t5, A2I_start + sw $t5, 4($v0) + move $t4, $v0 + sw $t4, -36($fp) # LOCAL local_main_at_Main_internal_6 --> -28($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) + lw $t4, -36($fp) + sw $t4, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG 678987 - li $t1, 678987 + li $t4, 678987 # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t4, 0($sp) # LOCAL local_main_at_Main_internal_6 --> -28($fp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 i2a # Save new self pointer in $s1 lw $s1, -28($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t5, 0($t4) # Get pointer to function address - lw $t3, 28($t2) + lw $t6, 28($t5) # Call function. Result is on $v0 - jalr $t3 + jalr $t6 sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2781,38 +2844,38 @@ function_main_at_Main: # LOCAL local_main_at_Main_b_5 --> -24($fp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # local_main_at_Main_b_5 = local_main_at_Main_internal_7 - lw $t1, -32($fp) - sw $t1, -24($fp) + lw $t4, -32($fp) + sw $t4, -24($fp) # LOCAL local_main_at_Main_internal_11 --> -48($fp) # local_main_at_Main_internal_11 = SELF sw $s1, -48($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # LOCAL local_main_at_Main_internal_11 --> -48($fp) # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) + lw $t4, -48($fp) + sw $t4, -40($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG local_main_at_Main_a_0 # LOCAL local_main_at_Main_a_0 --> -4($fp) - lw $t1, -4($fp) + lw $t4, -4($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t4, 0($sp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # LOCAL local_main_at_Main_internal_10 --> -44($fp) # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_int # Save new self pointer in $s1 lw $s1, -40($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t5, 0($t4) # Get pointer to function address - lw $t3, 16($t2) + lw $t6, 16($t5) # Call function. Result is on $v0 - jalr $t3 + jalr $t6 sw $v0, -44($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2823,8 +2886,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_12 --> -52($fp) # LOCAL local_main_at_Main_internal_14 --> -60($fp) # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 - lw $t1, -60($fp) - sw $t1, -52($fp) + lw $t4, -60($fp) + sw $t4, -52($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2834,34 +2897,34 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_29 - sw $t1, 8($v0) - li $t1, 4 - sw $t1, 12($v0) + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + la $t4, data_29 + sw $t4, 8($v0) + li $t4, 4 + sw $t4, 12($v0) sw $v0, -64($fp) # ARG local_main_at_Main_internal_15 # LOCAL local_main_at_Main_internal_15 --> -64($fp) - lw $t1, -64($fp) + lw $t4, -64($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t4, 0($sp) # LOCAL local_main_at_Main_internal_12 --> -52($fp) # LOCAL local_main_at_Main_internal_13 --> -56($fp) # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string # Save new self pointer in $s1 lw $s1, -52($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t5, 0($t4) # Get pointer to function address - lw $t3, 12($t2) + lw $t6, 12($t5) # Call function. Result is on $v0 - jalr $t3 + jalr $t6 sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2872,30 +2935,30 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_16 --> -68($fp) # LOCAL local_main_at_Main_internal_18 --> -76($fp) # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 - lw $t1, -76($fp) - sw $t1, -68($fp) + lw $t4, -76($fp) + sw $t4, -68($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG local_main_at_Main_b_5 # LOCAL local_main_at_Main_b_5 --> -24($fp) - lw $t1, -24($fp) + lw $t4, -24($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t4, 0($sp) # LOCAL local_main_at_Main_internal_16 --> -68($fp) # LOCAL local_main_at_Main_internal_17 --> -72($fp) # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string # Save new self pointer in $s1 lw $s1, -68($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t5, 0($t4) # Get pointer to function address - lw $t3, 12($t2) + lw $t6, 12($t5) # Call function. Result is on $v0 - jalr $t3 + jalr $t6 sw $v0, -72($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2906,8 +2969,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_19 --> -80($fp) # LOCAL local_main_at_Main_internal_21 --> -88($fp) # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 - lw $t1, -88($fp) - sw $t1, -80($fp) + lw $t4, -88($fp) + sw $t4, -80($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2917,34 +2980,34 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_30 - sw $t1, 8($v0) - li $t1, 2 - sw $t1, 12($v0) + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + la $t4, data_30 + sw $t4, 8($v0) + li $t4, 2 + sw $t4, 12($v0) sw $v0, -92($fp) # ARG local_main_at_Main_internal_22 # LOCAL local_main_at_Main_internal_22 --> -92($fp) - lw $t1, -92($fp) + lw $t4, -92($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t4, 0($sp) # LOCAL local_main_at_Main_internal_19 --> -80($fp) # LOCAL local_main_at_Main_internal_20 --> -84($fp) # local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 out_string # Save new self pointer in $s1 lw $s1, -80($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t5, 0($t4) # Get pointer to function address - lw $t3, 12($t2) + lw $t6, 12($t5) # Call function. Result is on $v0 - jalr $t3 + jalr $t6 sw $v0, -84($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips index 8c264b8c..a9c6fb00 100644 --- a/tests/codegen/fib.mips +++ b/tests/codegen/fib.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:54:32 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 18:41:51 2020 # School of Math and Computer Science, University of Havana # @@ -11,6 +11,8 @@ Object: .asciiz "Object" # Function END String: .asciiz "String" # Function END +Bool: .asciiz "Bool" +# Function END Main: .asciiz "Main" # Function END # @@ -58,6 +60,20 @@ String_end: # +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + # **** VTABLE for type Main **** Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main, function_fib_at_Main # Function END @@ -166,7 +182,11 @@ function_out_int_at_IO: lw $a0, 0($fp) li $v0, 1 syscall - # RETURN + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function function_out_int_at_IO. # Restore $ra lw $ra, 4($sp) @@ -195,7 +215,11 @@ function_out_string_at_IO: lw $a0, 8($v0) li $v0, 4 syscall - # RETURN + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function function_out_string_at_IO. # Restore $ra lw $ra, 4($sp) @@ -305,7 +329,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -472,14 +496,27 @@ entry: addu $fp, $sp, 32 # LOCAL local__internal_0 --> -4($fp) # local__internal_0 = ALLOCATE Main + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + la $t3, Main + sw $t3, 8($v0) + li $t3, 4 + sw $t3, 12($v0) + move $t3, $v0 # Allocating 8 bytes of memory li $a0, 8 li $v0, 9 syscall - la $t1, Main - sw $t1, 0($v0) - la $t1, Main_start - sw $t1, 4($v0) + sw $t3, 0($v0) + la $t3, Main_start + sw $t3, 4($v0) move $t2, $v0 sw $t2, -4($fp) # LOCAL local__internal_0 --> -4($fp) @@ -515,8 +552,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + lw $t2, -12($fp) + sw $t2, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -526,34 +563,34 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_2 - sw $t1, 8($v0) - li $t1, 39 - sw $t1, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + la $t2, data_2 + sw $t2, 8($v0) + li $t2, 39 + sw $t2, 12($v0) sw $v0, -16($fp) # ARG local_main_at_Main_internal_3 # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t1, -16($fp) + lw $t2, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t2, 0($sp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t3, 0($t2) # Get pointer to function address - lw $t3, 12($t2) + lw $t4, 12($t3) # Call function. Result is on $v0 - jalr $t3 + jalr $t4 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -564,8 +601,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_4 --> -20($fp) # LOCAL local_main_at_Main_internal_6 --> -28($fp) # local_main_at_Main_internal_4 = local_main_at_Main_internal_6 - lw $t1, -28($fp) - sw $t1, -20($fp) + lw $t2, -28($fp) + sw $t2, -20($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -575,8 +612,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_7 --> -32($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t1, -40($fp) - sw $t1, -32($fp) + lw $t2, -40($fp) + sw $t2, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -586,8 +623,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_10 --> -44($fp) # LOCAL local_main_at_Main_internal_12 --> -52($fp) # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 - lw $t1, -52($fp) - sw $t1, -44($fp) + lw $t2, -52($fp) + sw $t2, -44($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -597,59 +634,59 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -44($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t3, 0($t2) # Get pointer to function address - lw $t3, 24($t2) + lw $t4, 24($t3) # Call function. Result is on $v0 - jalr $t3 + jalr $t4 sw $v0, -48($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_main_at_Main_internal_11 # LOCAL local_main_at_Main_internal_11 --> -48($fp) - lw $t1, -48($fp) + lw $t2, -48($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t2, 0($sp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 fib # Save new self pointer in $s1 lw $s1, -32($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t3, 0($t2) # Get pointer to function address - lw $t3, 32($t2) + lw $t4, 32($t3) # Call function. Result is on $v0 - jalr $t3 + jalr $t4 sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_main_at_Main_internal_8 # LOCAL local_main_at_Main_internal_8 --> -36($fp) - lw $t1, -36($fp) + lw $t2, -36($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t2, 0($sp) # LOCAL local_main_at_Main_internal_4 --> -20($fp) # LOCAL local_main_at_Main_internal_5 --> -24($fp) # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 out_int # Save new self pointer in $s1 lw $s1, -20($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t3, 0($t2) # Get pointer to function address - lw $t3, 16($t2) + lw $t4, 16($t3) # Call function. Result is on $v0 - jalr $t3 + jalr $t4 sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -660,8 +697,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_13 --> -56($fp) # LOCAL local_main_at_Main_internal_15 --> -64($fp) # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 - lw $t1, -64($fp) - sw $t1, -56($fp) + lw $t2, -64($fp) + sw $t2, -56($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -671,34 +708,34 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_3 - sw $t1, 8($v0) - li $t1, 2 - sw $t1, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + la $t2, data_3 + sw $t2, 8($v0) + li $t2, 2 + sw $t2, 12($v0) sw $v0, -68($fp) # ARG local_main_at_Main_internal_16 # LOCAL local_main_at_Main_internal_16 --> -68($fp) - lw $t1, -68($fp) + lw $t2, -68($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t2, 0($sp) # LOCAL local_main_at_Main_internal_13 --> -56($fp) # LOCAL local_main_at_Main_internal_14 --> -60($fp) # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 out_string # Save new self pointer in $s1 lw $s1, -56($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t3, 0($t2) # Get pointer to function address - lw $t3, 12($t2) + lw $t4, 12($t3) # Call function. Result is on $v0 - jalr $t3 + jalr $t4 sw $v0, -60($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -727,93 +764,93 @@ function_fib_at_Main: addu $fp, $sp, 36 # LOCAL local_fib_at_Main_a_0 --> -4($fp) # local_fib_at_Main_a_0 = 1 - li $t1, 1 - sw $t1, -4($fp) + li $t2, 1 + sw $t2, -4($fp) # LOCAL local_fib_at_Main_b_1 --> -8($fp) # local_fib_at_Main_b_1 = 0 - li $t1, 0 - sw $t1, -8($fp) + li $t2, 0 + sw $t2, -8($fp) # LOCAL local_fib_at_Main_c_2 --> -12($fp) # local_fib_at_Main_c_2 = 0 - li $t1, 0 - sw $t1, -12($fp) + li $t2, 0 + sw $t2, -12($fp) label_WHILE_1: # LOCAL local_fib_at_Main_internal_3 --> -16($fp) # PARAM param_fib_at_Main_i_0 --> 0($fp) # local_fib_at_Main_internal_3 = PARAM param_fib_at_Main_i_0 - 0 - lw $t1, 0($fp) - sub $t1, $t1, 0 - sw $t1, -16($fp) + lw $t2, 0($fp) + sub $t2, $t2, 0 + sw $t2, -16($fp) # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 - lw $t1, -16($fp) - beq $t1, 0, label_TRUE_3 + lw $t2, -16($fp) + beq $t2, 0, label_TRUE_3 # LOCAL local_fib_at_Main_internal_3 --> -16($fp) # local_fib_at_Main_internal_3 = 0 - li $t1, 0 - sw $t1, -16($fp) + li $t2, 0 + sw $t2, -16($fp) # GOTO label_END_4 j label_END_4 label_TRUE_3: # LOCAL local_fib_at_Main_internal_3 --> -16($fp) # local_fib_at_Main_internal_3 = 1 - li $t1, 1 - sw $t1, -16($fp) + li $t2, 1 + sw $t2, -16($fp) label_END_4: # IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 # IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 -lw $t1, -16($fp) -beq $t1, 0, label_FALSE_5 +lw $t2, -16($fp) +beq $t2, 0, label_FALSE_5 # LOCAL local_fib_at_Main_internal_4 --> -20($fp) # local_fib_at_Main_internal_4 = 0 -li $t1, 0 -sw $t1, -20($fp) +li $t2, 0 +sw $t2, -20($fp) # GOTO label_NOT_END_6 j label_NOT_END_6 label_FALSE_5: # LOCAL local_fib_at_Main_internal_4 --> -20($fp) # local_fib_at_Main_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) + li $t2, 1 + sw $t2, -20($fp) label_NOT_END_6: # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 - lw $t1, -20($fp) - beq $t1, 0, label_WHILE_END_2 + lw $t2, -20($fp) + beq $t2, 0, label_WHILE_END_2 # LOCAL local_fib_at_Main_internal_5 --> -24($fp) # LOCAL local_fib_at_Main_a_0 --> -4($fp) # LOCAL local_fib_at_Main_b_1 --> -8($fp) # local_fib_at_Main_internal_5 = local_fib_at_Main_a_0 + local_fib_at_Main_b_1 - lw $t1, -4($fp) - lw $t2, -8($fp) - add $t1, $t1, $t2 - sw $t1, -24($fp) + lw $t2, -4($fp) + lw $t3, -8($fp) + add $t2, $t2, $t3 + sw $t2, -24($fp) # LOCAL local_fib_at_Main_c_2 --> -12($fp) # LOCAL local_fib_at_Main_internal_5 --> -24($fp) # local_fib_at_Main_c_2 = local_fib_at_Main_internal_5 - lw $t1, -24($fp) - sw $t1, -12($fp) + lw $t2, -24($fp) + sw $t2, -12($fp) # LOCAL local_fib_at_Main_internal_6 --> -28($fp) # PARAM param_fib_at_Main_i_0 --> 0($fp) # local_fib_at_Main_internal_6 = PARAM param_fib_at_Main_i_0 - 1 - lw $t1, 0($fp) - sub $t1, $t1, 1 - sw $t1, -28($fp) + lw $t2, 0($fp) + sub $t2, $t2, 1 + sw $t2, -28($fp) # PARAM param_fib_at_Main_i_0 --> 0($fp) # LOCAL local_fib_at_Main_internal_6 --> -28($fp) # PARAM param_fib_at_Main_i_0 = local_fib_at_Main_internal_6 - lw $t1, -28($fp) - sw $t1, 0($fp) + lw $t2, -28($fp) + sw $t2, 0($fp) # LOCAL local_fib_at_Main_b_1 --> -8($fp) # LOCAL local_fib_at_Main_a_0 --> -4($fp) # local_fib_at_Main_b_1 = local_fib_at_Main_a_0 - lw $t1, -4($fp) - sw $t1, -8($fp) + lw $t2, -4($fp) + sw $t2, -8($fp) # LOCAL local_fib_at_Main_a_0 --> -4($fp) # LOCAL local_fib_at_Main_c_2 --> -12($fp) # local_fib_at_Main_a_0 = local_fib_at_Main_c_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + lw $t2, -12($fp) + sw $t2, -4($fp) # GOTO label_WHILE_1 j label_WHILE_1 label_WHILE_END_2: diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips index 894284b1..0ea976cf 100644 --- a/tests/codegen/hello_world.mips +++ b/tests/codegen/hello_world.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:54:31 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 18:41:50 2020 # School of Math and Computer Science, University of Havana # @@ -11,6 +11,8 @@ Object: .asciiz "Object" # Function END String: .asciiz "String" # Function END +Bool: .asciiz "Bool" +# Function END Main: .asciiz "Main" # Function END # @@ -58,6 +60,20 @@ String_end: # +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + # **** VTABLE for type Main **** Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main # Function END @@ -162,7 +178,11 @@ function_out_int_at_IO: lw $a0, 0($fp) li $v0, 1 syscall - # RETURN + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function function_out_int_at_IO. # Restore $ra lw $ra, 4($sp) @@ -191,7 +211,11 @@ function_out_string_at_IO: lw $a0, 8($v0) li $v0, 4 syscall - # RETURN + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function function_out_string_at_IO. # Restore $ra lw $ra, 4($sp) @@ -301,7 +325,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -468,14 +492,27 @@ entry: addu $fp, $sp, 32 # LOCAL local__internal_0 --> -4($fp) # local__internal_0 = ALLOCATE Main + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + la $t3, Main + sw $t3, 8($v0) + li $t3, 4 + sw $t3, 12($v0) + move $t3, $v0 # Allocating 8 bytes of memory li $a0, 8 li $v0, 9 syscall - la $t1, Main - sw $t1, 0($v0) - la $t1, Main_start - sw $t1, 4($v0) + sw $t3, 0($v0) + la $t3, Main_start + sw $t3, 4($v0) move $t2, $v0 sw $t2, -4($fp) # LOCAL local__internal_0 --> -4($fp) @@ -511,8 +548,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + lw $t2, -12($fp) + sw $t2, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -522,34 +559,34 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_2 - sw $t1, 8($v0) - li $t1, 15 - sw $t1, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + la $t2, data_2 + sw $t2, 8($v0) + li $t2, 15 + sw $t2, 12($v0) sw $v0, -16($fp) # ARG local_main_at_Main_internal_3 # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t1, -16($fp) + lw $t2, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t2, 0($sp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t3, 0($t2) # Get pointer to function address - lw $t3, 12($t2) + lw $t4, 12($t3) # Call function. Result is on $v0 - jalr $t3 + jalr $t4 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips index bd5c1541..becfd0db 100644 --- a/tests/codegen/io.mips +++ b/tests/codegen/io.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:54:32 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 18:41:51 2020 # School of Math and Computer Science, University of Havana # @@ -11,6 +11,8 @@ Object: .asciiz "Object" # Function END String: .asciiz "String" # Function END +Bool: .asciiz "Bool" +# Function END A: .asciiz "A" # Function END B: .asciiz "B" @@ -66,6 +68,20 @@ String_end: # +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + # **** VTABLE for type A **** A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A # Function END @@ -306,7 +322,11 @@ function_out_int_at_IO: lw $a0, 0($fp) li $v0, 1 syscall - # RETURN + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function function_out_int_at_IO. # Restore $ra lw $ra, 4($sp) @@ -335,7 +355,11 @@ function_out_string_at_IO: lw $a0, 8($v0) li $v0, 4 syscall - # RETURN + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function function_out_string_at_IO. # Restore $ra lw $ra, 4($sp) @@ -445,7 +469,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -612,14 +636,27 @@ entry: addu $fp, $sp, 32 # LOCAL local__internal_0 --> -4($fp) # local__internal_0 = ALLOCATE Main + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + la $t3, Main + sw $t3, 8($v0) + li $t3, 4 + sw $t3, 12($v0) + move $t3, $v0 # Allocating 8 bytes of memory li $a0, 8 li $v0, 9 syscall - la $t1, Main - sw $t1, 0($v0) - la $t1, Main_start - sw $t1, 4($v0) + sw $t3, 0($v0) + la $t3, Main_start + sw $t3, 4($v0) move $t2, $v0 sw $t2, -4($fp) # LOCAL local__internal_0 --> -4($fp) @@ -651,16 +688,29 @@ __A__attrib__io__init: addu $fp, $sp, 32 # LOCAL local_ib__io__init_internal_0 --> -4($fp) # local_ib__io__init_internal_0 = ALLOCATE IO + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + la $t4, IO + sw $t4, 8($v0) + li $t4, 2 + sw $t4, 12($v0) + move $t4, $v0 # Allocating 8 bytes of memory li $a0, 8 li $v0, 9 syscall - la $t1, IO - sw $t1, 0($v0) - la $t1, IO_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -4($fp) + sw $t4, 0($v0) + la $t4, IO_start + sw $t4, 4($v0) + move $t3, $v0 + sw $t3, -4($fp) # RETURN local_ib__io__init_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function __A__attrib__io__init. @@ -684,13 +734,13 @@ function_out_a_at_A: addu $fp, $sp, 32 # local_out_a_at_A_internal_2 = GETATTRIBUTE io A # LOCAL local_out_a_at_A_internal_2 --> -12($fp) - lw $t1, 8($s1) - sw $t1, -12($fp) + lw $t3, 8($s1) + sw $t3, -12($fp) # LOCAL local_out_a_at_A_internal_0 --> -4($fp) # LOCAL local_out_a_at_A_internal_2 --> -12($fp) # local_out_a_at_A_internal_0 = local_out_a_at_A_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + lw $t3, -12($fp) + sw $t3, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -700,34 +750,34 @@ function_out_a_at_A: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_2 - sw $t1, 8($v0) - li $t1, 16 - sw $t1, 12($v0) + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + la $t3, data_2 + sw $t3, 8($v0) + li $t3, 16 + sw $t3, 12($v0) sw $v0, -16($fp) # ARG local_out_a_at_A_internal_3 # LOCAL local_out_a_at_A_internal_3 --> -16($fp) - lw $t1, -16($fp) + lw $t3, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t3, 0($sp) # LOCAL local_out_a_at_A_internal_0 --> -4($fp) # LOCAL local_out_a_at_A_internal_1 --> -8($fp) # local_out_a_at_A_internal_1 = VCALL local_out_a_at_A_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 12($t2) + lw $t5, 12($t4) # Call function. Result is on $v0 - jalr $t3 + jalr $t5 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -755,13 +805,13 @@ function_out_b_at_B: addu $fp, $sp, 32 # local_out_b_at_B_internal_2 = GETATTRIBUTE io B # LOCAL local_out_b_at_B_internal_2 --> -12($fp) - lw $t1, 8($s1) - sw $t1, -12($fp) + lw $t3, 8($s1) + sw $t3, -12($fp) # LOCAL local_out_b_at_B_internal_0 --> -4($fp) # LOCAL local_out_b_at_B_internal_2 --> -12($fp) # local_out_b_at_B_internal_0 = local_out_b_at_B_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + lw $t3, -12($fp) + sw $t3, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -771,34 +821,34 @@ function_out_b_at_B: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_3 - sw $t1, 8($v0) - li $t1, 16 - sw $t1, 12($v0) + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + la $t3, data_3 + sw $t3, 8($v0) + li $t3, 16 + sw $t3, 12($v0) sw $v0, -16($fp) # ARG local_out_b_at_B_internal_3 # LOCAL local_out_b_at_B_internal_3 --> -16($fp) - lw $t1, -16($fp) + lw $t3, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t3, 0($sp) # LOCAL local_out_b_at_B_internal_0 --> -4($fp) # LOCAL local_out_b_at_B_internal_1 --> -8($fp) # local_out_b_at_B_internal_1 = VCALL local_out_b_at_B_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 12($t2) + lw $t5, 12($t4) # Call function. Result is on $v0 - jalr $t3 + jalr $t5 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -830,8 +880,8 @@ function_out_c_at_C: # LOCAL local_out_c_at_C_internal_0 --> -4($fp) # LOCAL local_out_c_at_C_internal_2 --> -12($fp) # local_out_c_at_C_internal_0 = local_out_c_at_C_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + lw $t3, -12($fp) + sw $t3, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -841,34 +891,34 @@ function_out_c_at_C: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_4 - sw $t1, 8($v0) - li $t1, 16 - sw $t1, 12($v0) + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + la $t3, data_4 + sw $t3, 8($v0) + li $t3, 16 + sw $t3, 12($v0) sw $v0, -16($fp) # ARG local_out_c_at_C_internal_3 # LOCAL local_out_c_at_C_internal_3 --> -16($fp) - lw $t1, -16($fp) + lw $t3, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t3, 0($sp) # LOCAL local_out_c_at_C_internal_0 --> -4($fp) # LOCAL local_out_c_at_C_internal_1 --> -8($fp) # local_out_c_at_C_internal_1 = VCALL local_out_c_at_C_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 12($t2) + lw $t5, 12($t4) # Call function. Result is on $v0 - jalr $t3 + jalr $t5 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -900,8 +950,8 @@ function_out_d_at_D: # LOCAL local_out_d_at_D_internal_0 --> -4($fp) # LOCAL local_out_d_at_D_internal_2 --> -12($fp) # local_out_d_at_D_internal_0 = local_out_d_at_D_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + lw $t3, -12($fp) + sw $t3, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -911,34 +961,34 @@ function_out_d_at_D: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_5 - sw $t1, 8($v0) - li $t1, 16 - sw $t1, 12($v0) + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + la $t3, data_5 + sw $t3, 8($v0) + li $t3, 16 + sw $t3, 12($v0) sw $v0, -16($fp) # ARG local_out_d_at_D_internal_3 # LOCAL local_out_d_at_D_internal_3 --> -16($fp) - lw $t1, -16($fp) + lw $t3, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t3, 0($sp) # LOCAL local_out_d_at_D_internal_0 --> -4($fp) # LOCAL local_out_d_at_D_internal_1 --> -8($fp) # local_out_d_at_D_internal_1 = VCALL local_out_d_at_D_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 12($t2) + lw $t5, 12($t4) # Call function. Result is on $v0 - jalr $t3 + jalr $t5 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -966,29 +1016,42 @@ function_main_at_Main: addu $fp, $sp, 72 # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_internal_2 = ALLOCATE A + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + la $t5, A + sw $t5, 8($v0) + li $t5, 1 + sw $t5, 12($v0) + move $t5, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - la $t1, A - sw $t1, 0($v0) - la $t1, A_start - sw $t1, 4($v0) - move $t2, $v0 - # Push register t2 into stack + sw $t5, 0($v0) + la $t5, A_start + sw $t5, 4($v0) + move $t4, $v0 + # Push register t4 into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t4, 0($sp) jal __A__attrib__io__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) addu $sp, $sp, 4 - sw $v0, 8($t2) - sw $t2, -12($fp) + sw $v0, 8($t4) + sw $t4, -12($fp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + lw $t4, -12($fp) + sw $t4, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -998,42 +1061,55 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t5, 0($t4) # Get pointer to function address - lw $t3, 12($t2) + lw $t6, 12($t5) # Call function. Result is on $v0 - jalr $t3 + jalr $t6 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # LOCAL local_main_at_Main_internal_5 --> -24($fp) # local_main_at_Main_internal_5 = ALLOCATE B + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t6, String + sw $t6, 0($v0) + la $t6, String_start + sw $t6, 4($v0) + la $t6, B + sw $t6, 8($v0) + li $t6, 1 + sw $t6, 12($v0) + move $t6, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - la $t1, B - sw $t1, 0($v0) - la $t1, B_start - sw $t1, 4($v0) - move $t2, $v0 - # Push register t2 into stack + sw $t6, 0($v0) + la $t6, B_start + sw $t6, 4($v0) + move $t5, $v0 + # Push register t5 into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t5, 0($sp) jal __A__attrib__io__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) addu $sp, $sp, 4 - sw $v0, 8($t2) - sw $t2, -24($fp) + sw $v0, 8($t5) + sw $t5, -24($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # LOCAL local_main_at_Main_internal_5 --> -24($fp) # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 - lw $t1, -24($fp) - sw $t1, -16($fp) + lw $t5, -24($fp) + sw $t5, -16($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1043,34 +1119,47 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -16($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t5, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t6, 0($t5) # Get pointer to function address - lw $t3, 16($t2) + lw $t7, 16($t6) # Call function. Result is on $v0 - jalr $t3 + jalr $t7 sw $v0, -20($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # LOCAL local_main_at_Main_internal_8 --> -36($fp) # local_main_at_Main_internal_8 = ALLOCATE C + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) + la $t7, C + sw $t7, 8($v0) + li $t7, 1 + sw $t7, 12($v0) + move $t7, $v0 # Allocating 8 bytes of memory li $a0, 8 li $v0, 9 syscall - la $t1, C - sw $t1, 0($v0) - la $t1, C_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -36($fp) + sw $t7, 0($v0) + la $t7, C_start + sw $t7, 4($v0) + move $t6, $v0 + sw $t6, -36($fp) # LOCAL local_main_at_Main_internal_6 --> -28($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) + lw $t6, -36($fp) + sw $t6, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1080,34 +1169,47 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -28($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t6, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t7, 0($t6) # Get pointer to function address - lw $t3, 28($t2) + lw $t8, 28($t7) # Call function. Result is on $v0 - jalr $t3 + jalr $t8 sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # LOCAL local_main_at_Main_internal_11 --> -48($fp) # local_main_at_Main_internal_11 = ALLOCATE D + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t8, String + sw $t8, 0($v0) + la $t8, String_start + sw $t8, 4($v0) + la $t8, D + sw $t8, 8($v0) + li $t8, 1 + sw $t8, 12($v0) + move $t8, $v0 # Allocating 8 bytes of memory li $a0, 8 li $v0, 9 syscall - la $t1, D - sw $t1, 0($v0) - la $t1, D_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -48($fp) + sw $t8, 0($v0) + la $t8, D_start + sw $t8, 4($v0) + move $t7, $v0 + sw $t7, -48($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # LOCAL local_main_at_Main_internal_11 --> -48($fp) # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) + lw $t7, -48($fp) + sw $t7, -40($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1117,13 +1219,13 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -40($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t7, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t8, 0($t7) # Get pointer to function address - lw $t3, 32($t2) + lw $t9, 32($t8) # Call function. Result is on $v0 - jalr $t3 + jalr $t9 sw $v0, -44($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1134,8 +1236,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_12 --> -52($fp) # LOCAL local_main_at_Main_internal_14 --> -60($fp) # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 - lw $t1, -60($fp) - sw $t1, -52($fp) + lw $t7, -60($fp) + sw $t7, -52($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1145,34 +1247,34 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_6 - sw $t1, 8($v0) - li $t1, 7 - sw $t1, 12($v0) + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) + la $t7, data_6 + sw $t7, 8($v0) + li $t7, 7 + sw $t7, 12($v0) sw $v0, -64($fp) # ARG local_main_at_Main_internal_15 # LOCAL local_main_at_Main_internal_15 --> -64($fp) - lw $t1, -64($fp) + lw $t7, -64($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t7, 0($sp) # LOCAL local_main_at_Main_internal_12 --> -52($fp) # LOCAL local_main_at_Main_internal_13 --> -56($fp) # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string # Save new self pointer in $s1 lw $s1, -52($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t7, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t8, 0($t7) # Get pointer to function address - lw $t3, 12($t2) + lw $t9, 12($t8) # Call function. Result is on $v0 - jalr $t3 + jalr $t9 sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) diff --git a/tests/codegen/list.mips b/tests/codegen/list.mips index 78e0663b..cef19d7b 100644 --- a/tests/codegen/list.mips +++ b/tests/codegen/list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 16:54:33 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 18:41:51 2020 # School of Math and Computer Science, University of Havana # @@ -11,6 +11,8 @@ Object: .asciiz "Object" # Function END String: .asciiz "String" # Function END +Bool: .asciiz "Bool" +# Function END List: .asciiz "List" # Function END Cons: .asciiz "Cons" @@ -62,6 +64,20 @@ String_end: # +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + # **** VTABLE for type List **** List_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_isNil_at_List, function_head_at_List, function_tail_at_List, function_cons_at_List # Function END @@ -226,7 +242,11 @@ function_out_int_at_IO: lw $a0, 0($fp) li $v0, 1 syscall - # RETURN + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function function_out_int_at_IO. # Restore $ra lw $ra, 4($sp) @@ -255,7 +275,11 @@ function_out_string_at_IO: lw $a0, 8($v0) li $v0, 4 syscall - # RETURN + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function function_out_string_at_IO. # Restore $ra lw $ra, 4($sp) @@ -365,7 +389,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -532,14 +556,27 @@ entry: addu $fp, $sp, 32 # LOCAL local__internal_0 --> -4($fp) # local__internal_0 = ALLOCATE Main + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + la $t3, Main + sw $t3, 8($v0) + li $t3, 4 + sw $t3, 12($v0) + move $t3, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - la $t1, Main - sw $t1, 0($v0) - la $t1, Main_start - sw $t1, 4($v0) + sw $t3, 0($v0) + la $t3, Main_start + sw $t3, 4($v0) move $t2, $v0 # Push register t2 into stack subu $sp, $sp, 4 @@ -604,8 +641,8 @@ function_head_at_List: # LOCAL local_head_at_List_internal_0 --> -4($fp) # LOCAL local_head_at_List_internal_2 --> -12($fp) # local_head_at_List_internal_0 = local_head_at_List_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + lw $t2, -12($fp) + sw $t2, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -615,13 +652,13 @@ function_head_at_List: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 0($t3) # Call function. Result is on $v0 - jalr $t3 + jalr $t4 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -653,8 +690,8 @@ function_tail_at_List: # LOCAL local_tail_at_List_internal_0 --> -4($fp) # LOCAL local_tail_at_List_internal_2 --> -12($fp) # local_tail_at_List_internal_0 = local_tail_at_List_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + lw $t2, -12($fp) + sw $t2, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -664,13 +701,13 @@ function_tail_at_List: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 0($t3) # Call function. Result is on $v0 - jalr $t3 + jalr $t4 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -706,64 +743,77 @@ function_cons_at_List: li $a0, 16 li $v0, 9 syscall - la $t1, Cons - sw $t1, 0($v0) - la $t1, Cons_start - sw $t1, 4($v0) - move $t2, $v0 - # Push register t2 into stack + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + la $t4, Cons + sw $t4, 8($v0) + li $t4, 4 + sw $t4, 12($v0) + move $t4, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Cons_start + sw $t4, 4($v0) + move $t3, $v0 + # Push register t3 into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t3, 0($sp) jal __Cons__attrib__car__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) addu $sp, $sp, 4 - sw $v0, 8($t2) - # Push register t2 into stack + sw $v0, 8($t3) + # Push register t3 into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t3, 0($sp) jal __Cons__attrib__cdr__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t2) - sw $t2, -12($fp) + sw $v0, 12($t3) + sw $t3, -12($fp) # LOCAL local_cons_at_List_internal_0 --> -4($fp) # LOCAL local_cons_at_List_internal_2 --> -12($fp) # local_cons_at_List_internal_0 = local_cons_at_List_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + lw $t3, -12($fp) + sw $t3, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG param_cons_at_List_i_0 # PARAM param_cons_at_List_i_0 --> 0($fp) - lw $t1, 0($fp) + lw $t3, 0($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t3, 0($sp) # LOCAL local_cons_at_List_internal_3 --> -16($fp) # local_cons_at_List_internal_3 = SELF sw $s1, -16($fp) # ARG local_cons_at_List_internal_3 # LOCAL local_cons_at_List_internal_3 --> -16($fp) - lw $t1, -16($fp) + lw $t3, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t3, 0($sp) # LOCAL local_cons_at_List_internal_0 --> -4($fp) # LOCAL local_cons_at_List_internal_1 --> -8($fp) # local_cons_at_List_internal_1 = VCALL local_cons_at_List_internal_0 init # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 28($t2) + lw $t5, 28($t4) # Call function. Result is on $v0 - jalr $t3 + jalr $t5 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -856,8 +906,8 @@ function_head_at_Cons: addu $fp, $sp, 32 # local_head_at_Cons_internal_0 = GETATTRIBUTE car Cons # LOCAL local_head_at_Cons_internal_0 --> -4($fp) - lw $t1, 8($s1) - sw $t1, -4($fp) + lw $t3, 8($s1) + sw $t3, -4($fp) # RETURN local_head_at_Cons_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_head_at_Cons. @@ -881,8 +931,8 @@ function_tail_at_Cons: addu $fp, $sp, 32 # local_tail_at_Cons_internal_0 = GETATTRIBUTE cdr Cons # LOCAL local_tail_at_Cons_internal_0 --> -4($fp) - lw $t1, 12($s1) - sw $t1, -4($fp) + lw $t3, 12($s1) + sw $t3, -4($fp) # RETURN local_tail_at_Cons_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_tail_at_Cons. @@ -908,12 +958,12 @@ function_init_at_Cons: addu $fp, $sp, 32 # # PARAM param_init_at_Cons_i_0 --> 4($fp) - lw $t1, 4($fp) - sw $t1, 8($s1) + lw $t3, 4($fp) + sw $t3, 8($s1) # # PARAM param_init_at_Cons_rest_1 --> 0($fp) - lw $t1, 0($fp) - sw $t1, 12($s1) + lw $t3, 0($fp) + sw $t3, 12($s1) # LOCAL local_init_at_Cons_internal_0 --> -4($fp) # local_init_at_Cons_internal_0 = SELF sw $s1, -4($fp) @@ -965,8 +1015,8 @@ function_print_list_at_Main: # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) # PARAM param_print_list_at_Main_l_0 --> 0($fp) # local_print_list_at_Main_internal_0 = PARAM param_print_list_at_Main_l_0 - lw $t1, 0($fp) - sw $t1, -4($fp) + lw $t3, 0($fp) + sw $t3, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -976,29 +1026,29 @@ function_print_list_at_Main: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 12($t2) + lw $t5, 12($t4) # Call function. Result is on $v0 - jalr $t3 + jalr $t5 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # IF_ZERO local_print_list_at_Main_internal_1 GOTO label_FALSE_1 # IF_ZERO local_print_list_at_Main_internal_1 GOTO label_FALSE_1 - lw $t1, -8($fp) - beq $t1, 0, label_FALSE_1 + lw $t3, -8($fp) + beq $t3, 0, label_FALSE_1 # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) # local_print_list_at_Main_internal_4 = SELF sw $s1, -20($fp) # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) # local_print_list_at_Main_internal_2 = local_print_list_at_Main_internal_4 - lw $t1, -20($fp) - sw $t1, -12($fp) + lw $t3, -20($fp) + sw $t3, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1008,34 +1058,34 @@ function_print_list_at_Main: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_2 - sw $t1, 8($v0) - li $t1, 2 - sw $t1, 12($v0) + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + la $t3, data_2 + sw $t3, 8($v0) + li $t3, 2 + sw $t3, 12($v0) sw $v0, -24($fp) # ARG local_print_list_at_Main_internal_5 # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) - lw $t1, -24($fp) + lw $t3, -24($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t3, 0($sp) # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) # LOCAL local_print_list_at_Main_internal_3 --> -16($fp) # local_print_list_at_Main_internal_3 = VCALL local_print_list_at_Main_internal_2 out_string # Save new self pointer in $s1 lw $s1, -12($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 12($t2) + lw $t5, 12($t4) # Call function. Result is on $v0 - jalr $t3 + jalr $t5 sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1049,16 +1099,16 @@ label_FALSE_1: # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) # LOCAL local_print_list_at_Main_internal_8 --> -36($fp) # local_print_list_at_Main_internal_6 = local_print_list_at_Main_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) + lw $t3, -36($fp) + sw $t3, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) # PARAM param_print_list_at_Main_l_0 --> 0($fp) # local_print_list_at_Main_internal_9 = PARAM param_print_list_at_Main_l_0 - lw $t1, 0($fp) - sw $t1, -40($fp) + lw $t3, 0($fp) + sw $t3, -40($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1068,36 +1118,36 @@ label_FALSE_1: # Save new self pointer in $s1 lw $s1, -40($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 16($t2) + lw $t5, 16($t4) # Call function. Result is on $v0 - jalr $t3 + jalr $t5 sw $v0, -44($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_print_list_at_Main_internal_10 # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) - lw $t1, -44($fp) + lw $t3, -44($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t3, 0($sp) # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) # LOCAL local_print_list_at_Main_internal_7 --> -32($fp) # local_print_list_at_Main_internal_7 = VCALL local_print_list_at_Main_internal_6 out_int # Save new self pointer in $s1 lw $s1, -28($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 16($t2) + lw $t5, 16($t4) # Call function. Result is on $v0 - jalr $t3 + jalr $t5 sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1108,8 +1158,8 @@ label_FALSE_1: # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) # LOCAL local_print_list_at_Main_internal_13 --> -56($fp) # local_print_list_at_Main_internal_11 = local_print_list_at_Main_internal_13 - lw $t1, -56($fp) - sw $t1, -48($fp) + lw $t3, -56($fp) + sw $t3, -48($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1119,34 +1169,34 @@ label_FALSE_1: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_3 - sw $t1, 8($v0) - li $t1, 1 - sw $t1, 12($v0) + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + la $t3, data_3 + sw $t3, 8($v0) + li $t3, 1 + sw $t3, 12($v0) sw $v0, -60($fp) # ARG local_print_list_at_Main_internal_14 # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) - lw $t1, -60($fp) + lw $t3, -60($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t3, 0($sp) # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) # LOCAL local_print_list_at_Main_internal_12 --> -52($fp) # local_print_list_at_Main_internal_12 = VCALL local_print_list_at_Main_internal_11 out_string # Save new self pointer in $s1 lw $s1, -48($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 12($t2) + lw $t5, 12($t4) # Call function. Result is on $v0 - jalr $t3 + jalr $t5 sw $v0, -52($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1157,16 +1207,16 @@ label_FALSE_1: # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) # local_print_list_at_Main_internal_15 = local_print_list_at_Main_internal_17 - lw $t1, -72($fp) - sw $t1, -64($fp) + lw $t3, -72($fp) + sw $t3, -64($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) # PARAM param_print_list_at_Main_l_0 --> 0($fp) # local_print_list_at_Main_internal_18 = PARAM param_print_list_at_Main_l_0 - lw $t1, 0($fp) - sw $t1, -76($fp) + lw $t3, 0($fp) + sw $t3, -76($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1176,36 +1226,36 @@ label_FALSE_1: # Save new self pointer in $s1 lw $s1, -76($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 20($t2) + lw $t5, 20($t4) # Call function. Result is on $v0 - jalr $t3 + jalr $t5 sw $v0, -80($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_print_list_at_Main_internal_19 # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) - lw $t1, -80($fp) + lw $t3, -80($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t3, 0($sp) # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) # LOCAL local_print_list_at_Main_internal_16 --> -68($fp) # local_print_list_at_Main_internal_16 = VCALL local_print_list_at_Main_internal_15 print_list # Save new self pointer in $s1 lw $s1, -64($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 28($t2) + lw $t5, 28($t4) # Call function. Result is on $v0 - jalr $t3 + jalr $t5 sw $v0, -68($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1235,42 +1285,55 @@ function_main_at_Main: addu $fp, $sp, 96 # LOCAL local_main_at_Main_internal_10 --> -44($fp) # local_main_at_Main_internal_10 = ALLOCATE List + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + la $t5, List + sw $t5, 8($v0) + li $t5, 4 + sw $t5, 12($v0) + move $t5, $v0 # Allocating 8 bytes of memory li $a0, 8 li $v0, 9 syscall - la $t1, List - sw $t1, 0($v0) - la $t1, List_start - sw $t1, 4($v0) - move $t2, $v0 - sw $t2, -44($fp) + sw $t5, 0($v0) + la $t5, List_start + sw $t5, 4($v0) + move $t4, $v0 + sw $t4, -44($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # LOCAL local_main_at_Main_internal_10 --> -44($fp) # local_main_at_Main_internal_8 = local_main_at_Main_internal_10 - lw $t1, -44($fp) - sw $t1, -36($fp) + lw $t4, -44($fp) + sw $t4, -36($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG 1 - li $t1, 1 + li $t4, 1 # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t4, 0($sp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 cons # Save new self pointer in $s1 lw $s1, -36($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t5, 0($t4) # Get pointer to function address - lw $t3, 24($t2) + lw $t6, 24($t5) # Call function. Result is on $v0 - jalr $t3 + jalr $t6 sw $v0, -40($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1278,29 +1341,29 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_6 --> -28($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # local_main_at_Main_internal_6 = local_main_at_Main_internal_9 - lw $t1, -40($fp) - sw $t1, -28($fp) + lw $t4, -40($fp) + sw $t4, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG 2 - li $t1, 2 + li $t4, 2 # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t4, 0($sp) # LOCAL local_main_at_Main_internal_6 --> -28($fp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 cons # Save new self pointer in $s1 lw $s1, -28($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t5, 0($t4) # Get pointer to function address - lw $t3, 24($t2) + lw $t6, 24($t5) # Call function. Result is on $v0 - jalr $t3 + jalr $t6 sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1308,29 +1371,29 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_4 --> -20($fp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # local_main_at_Main_internal_4 = local_main_at_Main_internal_7 - lw $t1, -32($fp) - sw $t1, -20($fp) + lw $t4, -32($fp) + sw $t4, -20($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG 3 - li $t1, 3 + li $t4, 3 # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t4, 0($sp) # LOCAL local_main_at_Main_internal_4 --> -20($fp) # LOCAL local_main_at_Main_internal_5 --> -24($fp) # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 cons # Save new self pointer in $s1 lw $s1, -20($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t5, 0($t4) # Get pointer to function address - lw $t3, 24($t2) + lw $t6, 24($t5) # Call function. Result is on $v0 - jalr $t3 + jalr $t6 sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1338,29 +1401,29 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_2 --> -12($fp) # LOCAL local_main_at_Main_internal_5 --> -24($fp) # local_main_at_Main_internal_2 = local_main_at_Main_internal_5 - lw $t1, -24($fp) - sw $t1, -12($fp) + lw $t4, -24($fp) + sw $t4, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG 4 - li $t1, 4 + li $t4, 4 # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t4, 0($sp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 cons # Save new self pointer in $s1 lw $s1, -12($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t5, 0($t4) # Get pointer to function address - lw $t3, 24($t2) + lw $t6, 24($t5) # Call function. Result is on $v0 - jalr $t3 + jalr $t6 sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1368,47 +1431,47 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 - lw $t1, -16($fp) - sw $t1, -4($fp) + lw $t4, -16($fp) + sw $t4, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG 5 - li $t1, 5 + li $t4, 5 # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t4, 0($sp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 cons # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t5, 0($t4) # Get pointer to function address - lw $t3, 24($t2) + lw $t6, 24($t5) # Call function. Result is on $v0 - jalr $t3 + jalr $t6 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # # LOCAL local_main_at_Main_internal_1 --> -8($fp) - lw $t1, -8($fp) - sw $t1, 8($s1) + lw $t4, -8($fp) + sw $t4, 8($s1) label_WHILE_3: # local_main_at_Main_internal_13 = GETATTRIBUTE mylist Main # LOCAL local_main_at_Main_internal_13 --> -56($fp) - lw $t1, 8($s1) - sw $t1, -56($fp) + lw $t4, 8($s1) + sw $t4, -56($fp) # LOCAL local_main_at_Main_internal_11 --> -48($fp) # LOCAL local_main_at_Main_internal_13 --> -56($fp) # local_main_at_Main_internal_11 = local_main_at_Main_internal_13 - lw $t1, -56($fp) - sw $t1, -48($fp) + lw $t4, -56($fp) + sw $t4, -48($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1418,84 +1481,84 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -48($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t5, 0($t4) # Get pointer to function address - lw $t3, 12($t2) + lw $t6, 12($t5) # Call function. Result is on $v0 - jalr $t3 + jalr $t6 sw $v0, -52($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # IF_ZERO local_main_at_Main_internal_12 GOTO label_FALSE_5 # IF_ZERO local_main_at_Main_internal_12 GOTO label_FALSE_5 - lw $t1, -52($fp) - beq $t1, 0, label_FALSE_5 + lw $t4, -52($fp) + beq $t4, 0, label_FALSE_5 # LOCAL local_main_at_Main_internal_14 --> -60($fp) # local_main_at_Main_internal_14 = 0 - li $t1, 0 - sw $t1, -60($fp) + li $t4, 0 + sw $t4, -60($fp) # GOTO label_NOT_END_6 j label_NOT_END_6 label_FALSE_5: # LOCAL local_main_at_Main_internal_14 --> -60($fp) # local_main_at_Main_internal_14 = 1 - li $t1, 1 - sw $t1, -60($fp) + li $t4, 1 + sw $t4, -60($fp) label_NOT_END_6: # IF_ZERO local_main_at_Main_internal_14 GOTO label_WHILE_END_4 # IF_ZERO local_main_at_Main_internal_14 GOTO label_WHILE_END_4 - lw $t1, -60($fp) - beq $t1, 0, label_WHILE_END_4 + lw $t4, -60($fp) + beq $t4, 0, label_WHILE_END_4 # LOCAL local_main_at_Main_internal_17 --> -72($fp) # local_main_at_Main_internal_17 = SELF sw $s1, -72($fp) # LOCAL local_main_at_Main_internal_15 --> -64($fp) # LOCAL local_main_at_Main_internal_17 --> -72($fp) # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 - lw $t1, -72($fp) - sw $t1, -64($fp) + lw $t4, -72($fp) + sw $t4, -64($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # local_main_at_Main_internal_18 = GETATTRIBUTE mylist Main # LOCAL local_main_at_Main_internal_18 --> -76($fp) - lw $t1, 8($s1) - sw $t1, -76($fp) + lw $t4, 8($s1) + sw $t4, -76($fp) # ARG local_main_at_Main_internal_18 # LOCAL local_main_at_Main_internal_18 --> -76($fp) - lw $t1, -76($fp) + lw $t4, -76($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t4, 0($sp) # LOCAL local_main_at_Main_internal_15 --> -64($fp) # LOCAL local_main_at_Main_internal_16 --> -68($fp) # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 print_list # Save new self pointer in $s1 lw $s1, -64($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t5, 0($t4) # Get pointer to function address - lw $t3, 28($t2) + lw $t6, 28($t5) # Call function. Result is on $v0 - jalr $t3 + jalr $t6 sw $v0, -68($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # local_main_at_Main_internal_21 = GETATTRIBUTE mylist Main # LOCAL local_main_at_Main_internal_21 --> -88($fp) - lw $t1, 8($s1) - sw $t1, -88($fp) + lw $t4, 8($s1) + sw $t4, -88($fp) # LOCAL local_main_at_Main_internal_19 --> -80($fp) # LOCAL local_main_at_Main_internal_21 --> -88($fp) # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 - lw $t1, -88($fp) - sw $t1, -80($fp) + lw $t4, -88($fp) + sw $t4, -80($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1505,21 +1568,21 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -80($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t5, 0($t4) # Get pointer to function address - lw $t3, 20($t2) + lw $t6, 20($t5) # Call function. Result is on $v0 - jalr $t3 + jalr $t6 sw $v0, -84($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # # LOCAL local_main_at_Main_internal_20 --> -84($fp) - lw $t1, -84($fp) - sw $t1, 8($s1) + lw $t4, -84($fp) + sw $t4, 8($s1) # GOTO label_WHILE_3 j label_WHILE_3 label_WHILE_END_4: diff --git a/tests/codegen/print-cool.mips b/tests/codegen/print-cool.mips new file mode 100644 index 00000000..22071252 --- /dev/null +++ b/tests/codegen/print-cool.mips @@ -0,0 +1,876 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 18:41:50 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +__Object_Object_tdt_entry__: .word 0 +__Object_Int_tdt_entry__: .word 1 +__Object_String_tdt_entry__: .word 1 +__Object_Bool_tdt_entry__: .word 1 +__Object_IO_tdt_entry__: .word 1 +__Object_Main_tdt_entry__: .word 2 +__Int_Object_tdt_entry__: .word -1 +__Int_Int_tdt_entry__: .word 0 +__Int_String_tdt_entry__: .word -1 +__Int_Bool_tdt_entry__: .word -1 +__Int_IO_tdt_entry__: .word -1 +__Int_Main_tdt_entry__: .word -1 +__String_Object_tdt_entry__: .word -1 +__String_Int_tdt_entry__: .word -1 +__String_String_tdt_entry__: .word 0 +__String_Bool_tdt_entry__: .word -1 +__String_IO_tdt_entry__: .word -1 +__String_Main_tdt_entry__: .word -1 +__Bool_Object_tdt_entry__: .word -1 +__Bool_Int_tdt_entry__: .word -1 +__Bool_String_tdt_entry__: .word -1 +__Bool_Bool_tdt_entry__: .word 0 +__Bool_IO_tdt_entry__: .word -1 +__Bool_Main_tdt_entry__: .word -1 +__IO_Object_tdt_entry__: .word -1 +__IO_Int_tdt_entry__: .word -1 +__IO_String_tdt_entry__: .word -1 +__IO_Bool_tdt_entry__: .word -1 +__IO_IO_tdt_entry__: .word 0 +__IO_Main_tdt_entry__: .word 1 +__Main_Object_tdt_entry__: .word -1 +__Main_Int_tdt_entry__: .word -1 +__Main_String_tdt_entry__: .word -1 +__Main_Bool_tdt_entry__: .word -1 +__Main_IO_tdt_entry__: .word -1 +__Main_Main_tdt_entry__: .word 0 +# + + +data_2: .asciiz "\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 8($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + li $a0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t1, 12($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t2, 12($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t1, $t2 + move $t4, $a0 + # Get first string from self + lw $t1, 8($s1) + # Get second string from param + lw $t2, 8($v0) + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t3, $v0 + move $t5, $zero + concat_loop1: + # Compare t1 with \0 + lb $t5, 0($t1) + beqz $t5, concat_loop1_end + # Copy 1 byte + sb $t5, 0($t3) + addu $t3, $t3, 1 + addu $t1, $t1, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t2 with \0 + lb $t5, 0($t2) + beqz $t5, concat_loop2_end + # Copy 1 byte + sb $t5, 0($t3) + addu $t3, $t3, 1 + addu $t2, $t2, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t3) + # v0 contains resulting string + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + sw $t2, 8($v0) + sw $t4, 12($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t1, 8($s1) + lw $t3, 4($fp) + addu $t1, $t1, $t3 + lw $a0, 0($fp) + move $t4, $a0 + move $t2, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t3, $v0 + substr_loop: + beqz $t2, substr_end + lb $a0, 0($t1) + sb $a0, 0($t3) + addu $t1, $t1, 1 + addu $t3, $t3, 1 + subu $t2, $t2, 1 + j substr_loop + substr_end: + sb $zero, 0($t3) + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + sw $t2, 8($v0) + sw $t4, 12($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t1, 12($s1) + sw $t1, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + la $t3, Main + sw $t3, 8($v0) + li $t3, 4 + sw $t3, 12($v0) + move $t3, $v0 + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Main_start + sw $t3, 4($v0) + move $t2, $v0 + sw $t2, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 + lw $t2, -20($fp) + sw $t2, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = ALLOCATE Object + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + la $t4, Object + sw $t4, 8($v0) + li $t4, 6 + sw $t4, 12($v0) + move $t4, $v0 + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Object_start + sw $t4, 4($v0) + move $t3, $v0 + sw $t3, -40($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 + lw $t3, -40($fp) + sw $t3, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 type_name + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 4($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_5 = local_main_at_Main_internal_8 + lw $t3, -36($fp) + sw $t3, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 4 + li $t3, 4 + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # ARG 1 + li $t3, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_6 = VCALL local_main_at_Main_internal_5 substr + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 4($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_6 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + lw $t3, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 + lw $t3, -16($fp) + sw $t3, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = SELF + sw $s1, -64($fp) + # IF_ZERO local_main_at_Main_internal_15 GOTO label_TRUE_1 + # IF_ZERO local_main_at_Main_internal_15 GOTO label_TRUE_1 + lw $t3, -64($fp) + beq $t3, 0, label_TRUE_1 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + la $t3, Bool + sw $t3, 8($v0) + li $t3, 4 + sw $t3, 12($v0) + move $t3, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Bool_start + sw $t3, 4($v0) + li $t3, 0 + sw $t3, 8($v0) + sw $v0, -60($fp) + # GOTO label_END_2 +j label_END_2 +label_TRUE_1: + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + la $t3, Bool + sw $t3, 8($v0) + li $t3, 4 + sw $t3, 12($v0) + move $t3, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Bool_start + sw $t3, 4($v0) + li $t3, 1 + sw $t3, 8($v0) + sw $v0, -60($fp) + label_END_2: +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 +lw $t3, -60($fp) +sw $t3, -52($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 type_name +# Save new self pointer in $s1 +lw $s1, -52($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 4($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -56($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_10 --> -44($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_10 = local_main_at_Main_internal_13 +lw $t3, -56($fp) +sw $t3, -44($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG 1 +li $t3, 1 +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# ARG 3 +li $t3, 3 +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_10 --> -44($fp) +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +# local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 substr +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 4($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_11 +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +lw $t3, -48($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_0 --> -4($fp) +# LOCAL local_main_at_Main_internal_1 --> -8($fp) +# local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string +# Save new self pointer in $s1 +lw $s1, -4($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 12($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -8($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# local_main_at_Main_internal_18 = SELF +sw $s1, -76($fp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# local_main_at_Main_internal_16 = local_main_at_Main_internal_18 +lw $t3, -76($fp) +sw $t3, -68($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +# Allocating string +la $t3, String +sw $t3, 0($v0) +la $t3, String_start +sw $t3, 4($v0) +la $t3, data_2 +sw $t3, 8($v0) +li $t3, 2 +sw $t3, 12($v0) +sw $v0, -80($fp) +# ARG local_main_at_Main_internal_19 +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +lw $t3, -80($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +# local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string +# Save new self pointer in $s1 +lw $s1, -68($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 12($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -72($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# RETURN local_main_at_Main_internal_17 +lw $v0, -72($fp) +# Deallocate stack frame for function function_main_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +jr $ra +# Function END + From 91fabc30b70dfdd12e87db3e4076f2e57c2b6d18 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sat, 5 Dec 2020 10:45:51 -0500 Subject: [PATCH 143/162] Fix scoping --- src/abstract/semantics.py | 2 +- src/mips/baseMipsVisitor.py | 6 +- src/mips/instruction.py | 2 +- src/testing.mips | 2598 ++++++++++++++++++++++++++++++----- src/testing.py | 138 +- src/travels/ciltomips.py | 4 +- src/travels/ctcill.py | 6 +- src/travels/inference.py | 42 +- 8 files changed, 2444 insertions(+), 354 deletions(-) diff --git a/src/abstract/semantics.py b/src/abstract/semantics.py index 25fc586a..572da821 100755 --- a/src/abstract/semantics.py +++ b/src/abstract/semantics.py @@ -261,7 +261,7 @@ def find_variable(self, return next(x for x in locals if x.name == vname) except StopIteration: return self.parent.find_variable( - vname, self.index) if self.parent else None + vname, self.index) if self.parent is not None else None def is_defined(self, vname: str) -> bool: return self.find_variable(vname) is not None diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 0efff001..d93a9e95 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -196,7 +196,8 @@ def operate(self, dest, left, right, operand: Type): # rigth es una constante self.register_instruction(operand(reg, reg, right, True)) self.register_instruction(lsNodes.SW(reg, dest)) - self.used_registers[reg] = self.used_registers[right_reg] = False + self.used_registers[reg] = False + self.used_registers[right_reg] = False else: # left es una constante reg = self.get_available_register() @@ -210,7 +211,8 @@ def operate(self, dest, left, right, operand: Type): else: self.register_instruction(operand(reg, reg, right, True)) self.register_instruction(lsNodes.SW(reg, dest)) - self.used_registers[reg] = self.used_registers[right_reg] = False + self.used_registers[reg] = False + self.used_registers[right_reg] = False def create_type_array(self, types: List[TypeNode]): """ diff --git a/src/mips/instruction.py b/src/mips/instruction.py index a8af0ccd..cce58d40 100644 --- a/src/mips/instruction.py +++ b/src/mips/instruction.py @@ -56,7 +56,7 @@ # Direccion de retorno ra = 31 -TEMP_REGISTERS = (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) +TEMP_REGISTERS = (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, s2, s3, s4, s5, s6, s7) ARGS_REGISTERS = (a0, a1, a2, a3) REG_TO_STR = { diff --git a/src/testing.mips b/src/testing.mips index da116a6e..f7f1cc77 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 18:41:40 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 22:28:54 2020 # School of Math and Computer Science, University of Havana # @@ -13,6 +13,16 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END +Book: .asciiz "Book" +# Function END +Article: .asciiz "Article" +# Function END +BookList: .asciiz "BookList" +# Function END +Cons: .asciiz "Cons" +# Function END +Nil: .asciiz "Nil" +# Function END Main: .asciiz "Main" # Function END # @@ -74,8 +84,78 @@ Bool_end: # +# **** VTABLE for type Book **** +Book_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_initBook_at_Book, function_print_at_Book +# Function END +# + + +# **** Type RECORD for type Book **** +Book_start: + Book_vtable_pointer: .word Book_vtable + # Function END +Book_end: +# + + +# **** VTABLE for type Article **** +Article_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_initBook_at_Book, function_print_at_Article, function_initArticle_at_Article +# Function END +# + + +# **** Type RECORD for type Article **** +Article_start: + Article_vtable_pointer: .word Article_vtable + # Function END +Article_end: +# + + +# **** VTABLE for type BookList **** +BookList_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_BookList, function_cons_at_BookList, function_car_at_BookList, function_cdr_at_BookList, function_print_list_at_BookList +# Function END +# + + +# **** Type RECORD for type BookList **** +BookList_start: + BookList_vtable_pointer: .word BookList_vtable + # Function END +BookList_end: +# + + +# **** VTABLE for type Cons **** +Cons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_Cons, function_cons_at_BookList, function_car_at_Cons, function_cdr_at_Cons, function_print_list_at_Cons, function_init_at_Cons +# Function END +# + + +# **** Type RECORD for type Cons **** +Cons_start: + Cons_vtable_pointer: .word Cons_vtable + # Function END +Cons_end: +# + + +# **** VTABLE for type Nil **** +Nil_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_Nil, function_cons_at_BookList, function_car_at_BookList, function_cdr_at_BookList, function_print_list_at_Nil +# Function END +# + + +# **** Type RECORD for type Nil **** +Nil_start: + Nil_vtable_pointer: .word Nil_vtable + # Function END +Nil_end: +# + + # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main # Function END # @@ -97,41 +177,174 @@ __Object_Int_tdt_entry__: .word 1 __Object_String_tdt_entry__: .word 1 __Object_Bool_tdt_entry__: .word 1 __Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 +__Object_Book_tdt_entry__: .word 2 +__Object_Article_tdt_entry__: .word 3 +__Object_BookList_tdt_entry__: .word 2 +__Object_Cons_tdt_entry__: .word 3 +__Object_Nil_tdt_entry__: .word 3 +__Object_Main_tdt_entry__: .word 1 __Int_Object_tdt_entry__: .word -1 __Int_Int_tdt_entry__: .word 0 __Int_String_tdt_entry__: .word -1 __Int_Bool_tdt_entry__: .word -1 __Int_IO_tdt_entry__: .word -1 +__Int_Book_tdt_entry__: .word -1 +__Int_Article_tdt_entry__: .word -1 +__Int_BookList_tdt_entry__: .word -1 +__Int_Cons_tdt_entry__: .word -1 +__Int_Nil_tdt_entry__: .word -1 __Int_Main_tdt_entry__: .word -1 __String_Object_tdt_entry__: .word -1 __String_Int_tdt_entry__: .word -1 __String_String_tdt_entry__: .word 0 __String_Bool_tdt_entry__: .word -1 __String_IO_tdt_entry__: .word -1 +__String_Book_tdt_entry__: .word -1 +__String_Article_tdt_entry__: .word -1 +__String_BookList_tdt_entry__: .word -1 +__String_Cons_tdt_entry__: .word -1 +__String_Nil_tdt_entry__: .word -1 __String_Main_tdt_entry__: .word -1 __Bool_Object_tdt_entry__: .word -1 __Bool_Int_tdt_entry__: .word -1 __Bool_String_tdt_entry__: .word -1 __Bool_Bool_tdt_entry__: .word 0 __Bool_IO_tdt_entry__: .word -1 +__Bool_Book_tdt_entry__: .word -1 +__Bool_Article_tdt_entry__: .word -1 +__Bool_BookList_tdt_entry__: .word -1 +__Bool_Cons_tdt_entry__: .word -1 +__Bool_Nil_tdt_entry__: .word -1 __Bool_Main_tdt_entry__: .word -1 __IO_Object_tdt_entry__: .word -1 __IO_Int_tdt_entry__: .word -1 __IO_String_tdt_entry__: .word -1 __IO_Bool_tdt_entry__: .word -1 __IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 +__IO_Book_tdt_entry__: .word 1 +__IO_Article_tdt_entry__: .word 2 +__IO_BookList_tdt_entry__: .word 1 +__IO_Cons_tdt_entry__: .word 2 +__IO_Nil_tdt_entry__: .word 2 +__IO_Main_tdt_entry__: .word -1 +__Book_Object_tdt_entry__: .word -1 +__Book_Int_tdt_entry__: .word -1 +__Book_String_tdt_entry__: .word -1 +__Book_Bool_tdt_entry__: .word -1 +__Book_IO_tdt_entry__: .word -1 +__Book_Book_tdt_entry__: .word 0 +__Book_Article_tdt_entry__: .word 1 +__Book_BookList_tdt_entry__: .word -1 +__Book_Cons_tdt_entry__: .word -1 +__Book_Nil_tdt_entry__: .word -1 +__Book_Main_tdt_entry__: .word -1 +__Article_Object_tdt_entry__: .word -1 +__Article_Int_tdt_entry__: .word -1 +__Article_String_tdt_entry__: .word -1 +__Article_Bool_tdt_entry__: .word -1 +__Article_IO_tdt_entry__: .word -1 +__Article_Book_tdt_entry__: .word -1 +__Article_Article_tdt_entry__: .word 0 +__Article_BookList_tdt_entry__: .word -1 +__Article_Cons_tdt_entry__: .word -1 +__Article_Nil_tdt_entry__: .word -1 +__Article_Main_tdt_entry__: .word -1 +__BookList_Object_tdt_entry__: .word -1 +__BookList_Int_tdt_entry__: .word -1 +__BookList_String_tdt_entry__: .word -1 +__BookList_Bool_tdt_entry__: .word -1 +__BookList_IO_tdt_entry__: .word -1 +__BookList_Book_tdt_entry__: .word -1 +__BookList_Article_tdt_entry__: .word -1 +__BookList_BookList_tdt_entry__: .word 0 +__BookList_Cons_tdt_entry__: .word 1 +__BookList_Nil_tdt_entry__: .word 1 +__BookList_Main_tdt_entry__: .word -1 +__Cons_Object_tdt_entry__: .word -1 +__Cons_Int_tdt_entry__: .word -1 +__Cons_String_tdt_entry__: .word -1 +__Cons_Bool_tdt_entry__: .word -1 +__Cons_IO_tdt_entry__: .word -1 +__Cons_Book_tdt_entry__: .word -1 +__Cons_Article_tdt_entry__: .word -1 +__Cons_BookList_tdt_entry__: .word -1 +__Cons_Cons_tdt_entry__: .word 0 +__Cons_Nil_tdt_entry__: .word -1 +__Cons_Main_tdt_entry__: .word -1 +__Nil_Object_tdt_entry__: .word -1 +__Nil_Int_tdt_entry__: .word -1 +__Nil_String_tdt_entry__: .word -1 +__Nil_Bool_tdt_entry__: .word -1 +__Nil_IO_tdt_entry__: .word -1 +__Nil_Book_tdt_entry__: .word -1 +__Nil_Article_tdt_entry__: .word -1 +__Nil_BookList_tdt_entry__: .word -1 +__Nil_Cons_tdt_entry__: .word -1 +__Nil_Nil_tdt_entry__: .word 0 +__Nil_Main_tdt_entry__: .word -1 __Main_Object_tdt_entry__: .word -1 __Main_Int_tdt_entry__: .word -1 __Main_String_tdt_entry__: .word -1 __Main_Bool_tdt_entry__: .word -1 __Main_IO_tdt_entry__: .word -1 +__Main_Book_tdt_entry__: .word -1 +__Main_Article_tdt_entry__: .word -1 +__Main_BookList_tdt_entry__: .word -1 +__Main_Cons_tdt_entry__: .word -1 +__Main_Nil_tdt_entry__: .word -1 __Main_Main_tdt_entry__: .word 0 # -data_2: .asciiz "\n" +data_2: .asciiz "title: " +# + + +data_3: .asciiz "\n" +# + + +data_4: .asciiz "author: " +# + + +data_5: .asciiz "\n" +# + + +data_6: .asciiz "periodical: " +# + + +data_7: .asciiz "\n" +# + + +data_8: .asciiz "- dynamic type was Book -\n" +# + + +data_9: .asciiz "- dynamic type was Article -\n" +# + + +data_10: .asciiz "Compilers, Principles, Techniques, and Tools" +# + + +data_11: .asciiz "Aho, Sethi, and Ullman" +# + + +data_12: .asciiz "The Top 100 CD_ROMs" +# + + +data_13: .asciiz "Ulanoff" +# + + +data_14: .asciiz "PC Magazine" # @@ -325,61 +538,61 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self - lw $t1, 12($s1) + lw $t0, 12($s1) # Get second string length from param lw $v0, 0($fp) - lw $t2, 12($v0) + lw $t1, 12($v0) # Save new string length in a0 for memory allocation - addu $a0, $t1, $t2 - move $t4, $a0 + addu $a0, $t0, $t1 + move $t3, $a0 # Get first string from self - lw $t1, 8($s1) + lw $t0, 8($s1) # Get second string from param - lw $t2, 8($v0) + lw $t1, 8($v0) addu $a0, $a0, 1 li $v0, 9 syscall - move $t3, $v0 - move $t5, $zero + move $t2, $v0 + move $t4, $zero concat_loop1: - # Compare t1 with \0 - lb $t5, 0($t1) - beqz $t5, concat_loop1_end + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end # Copy 1 byte - sb $t5, 0($t3) - addu $t3, $t3, 1 - addu $t1, $t1, 1 + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 j concat_loop1 concat_loop1_end: # Copy second string concat_loop2: - # Compare t2 with \0 - lb $t5, 0($t2) - beqz $t5, concat_loop2_end + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end # Copy 1 byte - sb $t5, 0($t3) - addu $t3, $t3, 1 + sb $t4, 0($t2) addu $t2, $t2, 1 + addu $t1, $t1, 1 j concat_loop2 concat_loop2_end: - sb $zero, 0($t3) + sb $zero, 0($t2) # v0 contains resulting string - move $t2, $v0 + move $t1, $v0 # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - sw $t2, 8($v0) - sw $t4, 12($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + sw $t1, 8($v0) + sw $t3, 12($v0) sw $v0, -4($fp) # RETURN local_concat_at_String_internal_0 lw $v0, -4($fp) @@ -409,38 +622,38 @@ function_substr_at_String: # LOCAL local_substr_at_String_internal_0 --> -4($fp) # PARAM param_substr_at_String_l_0 --> 4($fp) # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t1, 8($s1) - lw $t3, 4($fp) - addu $t1, $t1, $t3 + lw $t0, 8($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 lw $a0, 0($fp) - move $t4, $a0 - move $t2, $a0 + move $t3, $a0 + move $t1, $a0 addu $a0, $a0, 1 li $v0, 9 syscall - move $t3, $v0 + move $t2, $v0 substr_loop: - beqz $t2, substr_end - lb $a0, 0($t1) - sb $a0, 0($t3) - addu $t1, $t1, 1 - addu $t3, $t3, 1 - subu $t2, $t2, 1 + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 j substr_loop substr_end: - sb $zero, 0($t3) - move $t2, $v0 + sb $zero, 0($t2) + move $t1, $v0 # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - sw $t2, 8($v0) - sw $t4, 12($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + sw $t1, 8($v0) + sw $t3, 12($v0) sw $v0, -4($fp) # RETURN local_substr_at_String_internal_0 lw $v0, -4($fp) @@ -467,8 +680,8 @@ function_length_at_String: addu $fp, $sp, 32 # local_length_at_String_internal_0 = GETATTRIBUTE length String # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t1, 12($s1) - sw $t1, -4($fp) + lw $t0, 12($s1) + sw $t0, -4($fp) # RETURN local_length_at_String_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_length_at_String. @@ -497,24 +710,32 @@ entry: li $v0, 9 syscall # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - la $t3, Main - sw $t3, 8($v0) - li $t3, 4 - sw $t3, 12($v0) - move $t3, $v0 - # Allocating 8 bytes of memory - li $a0, 8 + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + la $t2, Main + sw $t2, 8($v0) + li $t2, 4 + sw $t2, 12($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall - sw $t3, 0($v0) - la $t3, Main_start - sw $t3, 4($v0) - move $t2, $v0 - sw $t2, -4($fp) + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + move $t1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__books__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 8($t1) + sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) # local__internal_1 = CALL function_main_at_Main @@ -534,344 +755,2069 @@ entry: # Function END -# function_main_at_Main implementation. +# __Book__attrib__title__init implementation. # @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 88 +__Book__attrib__title__init: + # Allocate stack frame for function __Book__attrib__title__init. + subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 88 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = SELF - sw $s1, -20($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 - lw $t2, -20($fp) - sw $t2, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = ALLOCATE Object + addu $fp, $sp, 32 + # LOCAL local_ttrib__title__init_internal_0 --> -4($fp) # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall - # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - la $t4, Object - sw $t4, 8($v0) - li $t4, 6 - sw $t4, 12($v0) - move $t4, $v0 - # Allocating 8 bytes of memory - li $a0, 8 + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_0 + sw $t1, 8($v0) + li $t1, 0 + sw $t1, 12($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__title__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Book__attrib__title__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Book__attrib__author__init implementation. +# @Params: +__Book__attrib__author__init: + # Allocate stack frame for function __Book__attrib__author__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__author__init_internal_0 --> -4($fp) + # Allocating 16 bytes of memory + li $a0, 16 li $v0, 9 syscall - sw $t4, 0($v0) - la $t4, Object_start - sw $t4, 4($v0) - move $t3, $v0 - sw $t3, -40($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t3, -40($fp) - sw $t3, -32($fp) + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_0 + sw $t1, 8($v0) + li $t1, 0 + sw $t1, 12($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__author__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Book__attrib__author__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_initBook_at_Book implementation. +# @Params: +# 0($fp) = param_initBook_at_Book_title_p_0 +# 4($fp) = param_initBook_at_Book_author_p_1 +function_initBook_at_Book: + # Allocate stack frame for function function_initBook_at_Book. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_initBook_at_Book_title_p_0 --> 4($fp) + lw $t1, 4($fp) + sw $t1, 8($s1) + # + # PARAM param_initBook_at_Book_author_p_1 --> 0($fp) + lw $t1, 0($fp) + sw $t1, 12($s1) + # LOCAL local_initBook_at_Book_internal_0 --> -4($fp) + # local_initBook_at_Book_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_initBook_at_Book_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_initBook_at_Book. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_print_at_Book implementation. +# @Params: +function_print_at_Book: + # Allocate stack frame for function function_print_at_Book. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # LOCAL local_print_at_Book_internal_6 --> -28($fp) + # local_print_at_Book_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_print_at_Book_internal_4 --> -20($fp) + # LOCAL local_print_at_Book_internal_6 --> -28($fp) + # local_print_at_Book_internal_4 = local_print_at_Book_internal_6 + lw $t1, -28($fp) + sw $t1, -20($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 type_name + # LOCAL local_print_at_Book_internal_7 --> -32($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_2 + sw $t1, 8($v0) + li $t1, 12 + sw $t1, 12($v0) + sw $v0, -32($fp) + # ARG local_print_at_Book_internal_7 + # LOCAL local_print_at_Book_internal_7 --> -32($fp) + lw $t1, -32($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_4 --> -20($fp) + # LOCAL local_print_at_Book_internal_5 --> -24($fp) + # local_print_at_Book_internal_5 = VCALL local_print_at_Book_internal_4 out_string # Save new self pointer in $s1 - lw $s1, -32($fp) + lw $s1, -20($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 4($t4) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -36($fp) + jalr $t3 + sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_5 = local_main_at_Main_internal_8 - lw $t3, -36($fp) - sw $t3, -24($fp) + # LOCAL local_print_at_Book_internal_2 --> -12($fp) + # LOCAL local_print_at_Book_internal_5 --> -24($fp) + # local_print_at_Book_internal_2 = local_print_at_Book_internal_5 + lw $t1, -24($fp) + sw $t1, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # ARG 4 - li $t3, 4 - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # ARG 1 - li $t3, 1 + # local_print_at_Book_internal_8 = GETATTRIBUTE title Book + # LOCAL local_print_at_Book_internal_8 --> -36($fp) + lw $t1, 8($s1) + sw $t1, -36($fp) + # ARG local_print_at_Book_internal_8 + # LOCAL local_print_at_Book_internal_8 --> -36($fp) + lw $t1, -36($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # local_main_at_Main_internal_6 = VCALL local_main_at_Main_internal_5 substr + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_2 --> -12($fp) + # LOCAL local_print_at_Book_internal_3 --> -16($fp) + # local_print_at_Book_internal_3 = VCALL local_print_at_Book_internal_2 out_string # Save new self pointer in $s1 - lw $s1, -24($fp) + lw $s1, -12($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 4($t4) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -28($fp) + jalr $t3 + sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_6 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - lw $t3, -28($fp) + # LOCAL local_print_at_Book_internal_0 --> -4($fp) + # LOCAL local_print_at_Book_internal_3 --> -16($fp) + # local_print_at_Book_internal_0 = local_print_at_Book_internal_3 + lw $t1, -16($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Book_internal_9 --> -40($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_3 + sw $t1, 8($v0) + li $t1, 2 + sw $t1, 12($v0) + sw $v0, -40($fp) + # ARG local_print_at_Book_internal_9 + # LOCAL local_print_at_Book_internal_9 --> -40($fp) + lw $t1, -40($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_0 --> -4($fp) + # LOCAL local_print_at_Book_internal_1 --> -8($fp) + # local_print_at_Book_internal_1 = VCALL local_print_at_Book_internal_0 out_string # Save new self pointer in $s1 - lw $s1, -12($fp) + lw $s1, -4($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 12($t4) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -16($fp) + jalr $t3 + sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 - lw $t3, -16($fp) - sw $t3, -4($fp) + # LOCAL local_print_at_Book_internal_16 --> -68($fp) + # local_print_at_Book_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_print_at_Book_internal_14 --> -60($fp) + # LOCAL local_print_at_Book_internal_16 --> -68($fp) + # local_print_at_Book_internal_14 = local_print_at_Book_internal_16 + lw $t1, -68($fp) + sw $t1, -60($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = SELF - sw $s1, -64($fp) - # IF_ZERO local_main_at_Main_internal_15 GOTO label_TRUE_1 - # IF_ZERO local_main_at_Main_internal_15 GOTO label_TRUE_1 - lw $t3, -64($fp) - beq $t3, 0, label_TRUE_1 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_print_at_Book_internal_17 --> -72($fp) # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall - # Allocating string for type Bool - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - la $t3, Bool - sw $t3, 8($v0) - li $t3, 4 - sw $t3, 12($v0) - move $t3, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Bool_start - sw $t3, 4($v0) - li $t3, 0 - sw $t3, 8($v0) - sw $v0, -60($fp) - # GOTO label_END_2 -j label_END_2 -label_TRUE_1: - # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_4 + sw $t1, 8($v0) + li $t1, 12 + sw $t1, 12($v0) + sw $v0, -72($fp) + # ARG local_print_at_Book_internal_17 + # LOCAL local_print_at_Book_internal_17 --> -72($fp) + lw $t1, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_14 --> -60($fp) + # LOCAL local_print_at_Book_internal_15 --> -64($fp) + # local_print_at_Book_internal_15 = VCALL local_print_at_Book_internal_14 out_string + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_12 --> -52($fp) + # LOCAL local_print_at_Book_internal_15 --> -64($fp) + # local_print_at_Book_internal_12 = local_print_at_Book_internal_15 + lw $t1, -64($fp) + sw $t1, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Book_internal_18 = GETATTRIBUTE author Book + # LOCAL local_print_at_Book_internal_18 --> -76($fp) + lw $t1, 12($s1) + sw $t1, -76($fp) + # ARG local_print_at_Book_internal_18 + # LOCAL local_print_at_Book_internal_18 --> -76($fp) + lw $t1, -76($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_12 --> -52($fp) + # LOCAL local_print_at_Book_internal_13 --> -56($fp) + # local_print_at_Book_internal_13 = VCALL local_print_at_Book_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_10 --> -44($fp) + # LOCAL local_print_at_Book_internal_13 --> -56($fp) + # local_print_at_Book_internal_10 = local_print_at_Book_internal_13 + lw $t1, -56($fp) + sw $t1, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Book_internal_19 --> -80($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_5 + sw $t1, 8($v0) + li $t1, 2 + sw $t1, 12($v0) + sw $v0, -80($fp) + # ARG local_print_at_Book_internal_19 + # LOCAL local_print_at_Book_internal_19 --> -80($fp) + lw $t1, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_10 --> -44($fp) + # LOCAL local_print_at_Book_internal_11 --> -48($fp) + # local_print_at_Book_internal_11 = VCALL local_print_at_Book_internal_10 out_string + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_20 --> -84($fp) + # local_print_at_Book_internal_20 = SELF + sw $s1, -84($fp) + # RETURN local_print_at_Book_internal_20 + lw $v0, -84($fp) + # Deallocate stack frame for function function_print_at_Book. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 92 + jr $ra + # Function END + + +# __Article__attrib__per_title__init implementation. +# @Params: +__Article__attrib__per_title__init: + # Allocate stack frame for function __Article__attrib__per_title__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local___attrib__per_title__init_internal_0 --> -4($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_0 + sw $t1, 8($v0) + li $t1, 0 + sw $t1, 12($v0) + sw $v0, -4($fp) + # RETURN local___attrib__per_title__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Article__attrib__per_title__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_initArticle_at_Article implementation. +# @Params: +# 0($fp) = param_initArticle_at_Article_title_p_0 +# 4($fp) = param_initArticle_at_Article_author_p_1 +# 8($fp) = param_initArticle_at_Article_per_title_p_2 +function_initArticle_at_Article: + # Allocate stack frame for function function_initArticle_at_Article. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) + # local_initArticle_at_Article_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) + # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) + # local_initArticle_at_Article_internal_0 = local_initArticle_at_Article_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_initArticle_at_Article_title_p_0 + # PARAM param_initArticle_at_Article_title_p_0 --> 8($fp) + lw $t1, 8($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # ARG param_initArticle_at_Article_author_p_1 + # PARAM param_initArticle_at_Article_author_p_1 --> 4($fp) + lw $t1, 4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) + # LOCAL local_initArticle_at_Article_internal_1 --> -8($fp) + # local_initArticle_at_Article_internal_1 = VCALL local_initArticle_at_Article_internal_0 initBook + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 28($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # PARAM param_initArticle_at_Article_per_title_p_2 --> 0($fp) + lw $t1, 0($fp) + sw $t1, 16($s1) + # LOCAL local_initArticle_at_Article_internal_3 --> -16($fp) + # local_initArticle_at_Article_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_initArticle_at_Article_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_initArticle_at_Article. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 12 + jr $ra + # Function END + + +# function_print_at_Article implementation. +# @Params: +function_print_at_Article: + # Allocate stack frame for function function_print_at_Article. + subu $sp, $sp, 60 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 60 + # LOCAL local_print_at_Article_internal_0 --> -4($fp) + # local_print_at_Article_internal_0 = + lw $t1, Book + sw $t1, -4($fp) + # LOCAL local_print_at_Article_internal_0 --> -4($fp) + # LOCAL local_print_at_Article_internal_1 --> -8($fp) + # local_print_at_Article_internal_1 = VCALL local_print_at_Article_internal_0 print + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 32($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # LOCAL local_print_at_Article_internal_8 --> -36($fp) + # local_print_at_Article_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_print_at_Article_internal_6 --> -28($fp) + # LOCAL local_print_at_Article_internal_8 --> -36($fp) + # local_print_at_Article_internal_6 = local_print_at_Article_internal_8 + lw $t1, -36($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Article_internal_9 --> -40($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_6 + sw $t1, 8($v0) + li $t1, 13 + sw $t1, 12($v0) + sw $v0, -40($fp) + # ARG local_print_at_Article_internal_9 + # LOCAL local_print_at_Article_internal_9 --> -40($fp) + lw $t1, -40($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Article_internal_6 --> -28($fp) + # LOCAL local_print_at_Article_internal_7 --> -32($fp) + # local_print_at_Article_internal_7 = VCALL local_print_at_Article_internal_6 out_string + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Article_internal_4 --> -20($fp) + # LOCAL local_print_at_Article_internal_7 --> -32($fp) + # local_print_at_Article_internal_4 = local_print_at_Article_internal_7 + lw $t1, -32($fp) + sw $t1, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Article_internal_10 = GETATTRIBUTE per_title Article + # LOCAL local_print_at_Article_internal_10 --> -44($fp) + lw $t1, 16($s1) + sw $t1, -44($fp) + # ARG local_print_at_Article_internal_10 + # LOCAL local_print_at_Article_internal_10 --> -44($fp) + lw $t1, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Article_internal_4 --> -20($fp) + # LOCAL local_print_at_Article_internal_5 --> -24($fp) + # local_print_at_Article_internal_5 = VCALL local_print_at_Article_internal_4 out_string + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Article_internal_2 --> -12($fp) + # LOCAL local_print_at_Article_internal_5 --> -24($fp) + # local_print_at_Article_internal_2 = local_print_at_Article_internal_5 + lw $t1, -24($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Article_internal_11 --> -48($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + la $t1, data_7 + sw $t1, 8($v0) + li $t1, 2 + sw $t1, 12($v0) + sw $v0, -48($fp) + # ARG local_print_at_Article_internal_11 + # LOCAL local_print_at_Article_internal_11 --> -48($fp) + lw $t1, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Article_internal_2 --> -12($fp) + # LOCAL local_print_at_Article_internal_3 --> -16($fp) + # local_print_at_Article_internal_3 = VCALL local_print_at_Article_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Article_internal_12 --> -52($fp) + # local_print_at_Article_internal_12 = SELF + sw $s1, -52($fp) + # RETURN local_print_at_Article_internal_12 + lw $v0, -52($fp) + # Deallocate stack frame for function function_print_at_Article. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 60 + jr $ra + # Function END + + +# function_isNil_at_BookList implementation. +# @Params: +function_isNil_at_BookList: + # Allocate stack frame for function function_isNil_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_BookList_internal_2 --> -12($fp) + # local_isNil_at_BookList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_isNil_at_BookList_internal_0 --> -4($fp) + # LOCAL local_isNil_at_BookList_internal_2 --> -12($fp) + # local_isNil_at_BookList_internal_0 = local_isNil_at_BookList_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_isNil_at_BookList_internal_0 --> -4($fp) + # LOCAL local_isNil_at_BookList_internal_1 --> -8($fp) + # local_isNil_at_BookList_internal_1 = VCALL local_isNil_at_BookList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN 1 + li $v0, 1 + # Deallocate stack frame for function function_isNil_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cons_at_BookList implementation. +# @Params: +# 0($fp) = param_cons_at_BookList_hd_0 +function_cons_at_BookList: + # Allocate stack frame for function function_cons_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) + # local_cons_at_BookList_new_cell_0 = ALLOCATE Cons # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall - # Allocating string for type Bool + # Allocating string for type name la $t3, String sw $t3, 0($v0) la $t3, String_start sw $t3, 4($v0) - la $t3, Bool + la $t3, Cons sw $t3, 8($v0) li $t3, 4 sw $t3, 12($v0) move $t3, $v0 - # Allocating 12 bytes of memory - li $a0, 12 + # Allocating 16 bytes of memory + li $a0, 16 li $v0, 9 syscall sw $t3, 0($v0) - la $t3, Bool_start + la $t3, Cons_start sw $t3, 4($v0) - li $t3, 1 - sw $t3, 8($v0) - sw $v0, -60($fp) - label_END_2: -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# LOCAL local_main_at_Main_internal_14 --> -60($fp) -# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 -lw $t3, -60($fp) -sw $t3, -52($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 type_name -# Save new self pointer in $s1 -lw $s1, -52($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 4($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -56($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_10 --> -44($fp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# local_main_at_Main_internal_10 = local_main_at_Main_internal_13 -lw $t3, -56($fp) -sw $t3, -44($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG 1 -li $t3, 1 -# Push arg into stack -subu $sp, $sp, 4 -sw $t3, 0($sp) -# ARG 3 -li $t3, 3 -# Push arg into stack -subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_main_at_Main_internal_10 --> -44($fp) -# LOCAL local_main_at_Main_internal_11 --> -48($fp) -# local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 substr -# Save new self pointer in $s1 -lw $s1, -44($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 4($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -48($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_11 -# LOCAL local_main_at_Main_internal_11 --> -48($fp) -lw $t3, -48($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_main_at_Main_internal_0 --> -4($fp) -# LOCAL local_main_at_Main_internal_1 --> -8($fp) -# local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string -# Save new self pointer in $s1 -lw $s1, -4($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 12($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -8($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# local_main_at_Main_internal_18 = SELF -sw $s1, -76($fp) -# LOCAL local_main_at_Main_internal_16 --> -68($fp) -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# local_main_at_Main_internal_16 = local_main_at_Main_internal_18 -lw $t3, -76($fp) -sw $t3, -68($fp) + move $t2, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Cons__attrib__xcar__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 8($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Cons__attrib__xcdr__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + sw $t2, -4($fp) + # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) + # local_cons_at_BookList_internal_1 = ALLOCATE Cons + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + la $t4, Cons + sw $t4, 8($v0) + li $t4, 4 + sw $t4, 12($v0) + move $t4, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Cons_start + sw $t4, 4($v0) + move $t3, $v0 + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Cons__attrib__xcar__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 8($t3) + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Cons__attrib__xcdr__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t3) + sw $t3, -8($fp) + # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) + # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) + # local_cons_at_BookList_new_cell_0 = local_cons_at_BookList_internal_1 + lw $t3, -8($fp) + sw $t3, -4($fp) + # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) + # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) + # local_cons_at_BookList_internal_2 = local_cons_at_BookList_new_cell_0 + lw $t3, -4($fp) + sw $t3, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cons_at_BookList_hd_0 + # PARAM param_cons_at_BookList_hd_0 --> 0($fp) + lw $t3, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) + # local_cons_at_BookList_internal_4 = SELF + sw $s1, -20($fp) + # ARG local_cons_at_BookList_internal_4 + # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) + lw $t3, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) + # LOCAL local_cons_at_BookList_internal_3 --> -16($fp) + # local_cons_at_BookList_internal_3 = VCALL local_cons_at_BookList_internal_2 init + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 48($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_cons_at_BookList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_cons_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_car_at_BookList implementation. +# @Params: +function_car_at_BookList: + # Allocate stack frame for function function_car_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_car_at_BookList_internal_2 --> -12($fp) + # local_car_at_BookList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_car_at_BookList_internal_0 --> -4($fp) + # LOCAL local_car_at_BookList_internal_2 --> -12($fp) + # local_car_at_BookList_internal_0 = local_car_at_BookList_internal_2 + lw $t3, -12($fp) + sw $t3, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_car_at_BookList_internal_0 --> -4($fp) + # LOCAL local_car_at_BookList_internal_1 --> -8($fp) + # local_car_at_BookList_internal_1 = VCALL local_car_at_BookList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 0($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_car_at_BookList_internal_3 --> -16($fp) + # local_car_at_BookList_internal_3 = ALLOCATE Book + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + la $t5, Book + sw $t5, 8($v0) + li $t5, 4 + sw $t5, 12($v0) + move $t5, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t5, 0($v0) + la $t5, Book_start + sw $t5, 4($v0) + move $t4, $v0 + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 8($t4) + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t4) + sw $t4, -16($fp) + # RETURN local_car_at_BookList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_car_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cdr_at_BookList implementation. +# @Params: +function_cdr_at_BookList: + # Allocate stack frame for function function_cdr_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cdr_at_BookList_internal_2 --> -12($fp) + # local_cdr_at_BookList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_cdr_at_BookList_internal_0 --> -4($fp) + # LOCAL local_cdr_at_BookList_internal_2 --> -12($fp) + # local_cdr_at_BookList_internal_0 = local_cdr_at_BookList_internal_2 + lw $t4, -12($fp) + sw $t4, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_cdr_at_BookList_internal_0 --> -4($fp) + # LOCAL local_cdr_at_BookList_internal_1 --> -8($fp) + # local_cdr_at_BookList_internal_1 = VCALL local_cdr_at_BookList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t4, 4($s1) + # Get pointer to type's VTABLE + lw $t5, 0($t4) + # Get pointer to function address + lw $t6, 0($t5) + # Call function. Result is on $v0 + jalr $t6 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cdr_at_BookList_internal_3 --> -16($fp) + # local_cdr_at_BookList_internal_3 = ALLOCATE BookList + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t6, String + sw $t6, 0($v0) + la $t6, String_start + sw $t6, 4($v0) + la $t6, BookList + sw $t6, 8($v0) + li $t6, 8 + sw $t6, 12($v0) + move $t6, $v0 + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + sw $t6, 0($v0) + la $t6, BookList_start + sw $t6, 4($v0) + move $t5, $v0 + sw $t5, -16($fp) + # RETURN local_cdr_at_BookList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_cdr_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_list_at_BookList implementation. +# @Params: +function_print_list_at_BookList: + # Allocate stack frame for function function_print_list_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_print_list_at_BookList_internal_2 --> -12($fp) + # local_print_list_at_BookList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_list_at_BookList_internal_0 --> -4($fp) + # LOCAL local_print_list_at_BookList_internal_2 --> -12($fp) + # local_print_list_at_BookList_internal_0 = local_print_list_at_BookList_internal_2 + lw $t5, -12($fp) + sw $t5, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_BookList_internal_0 --> -4($fp) + # LOCAL local_print_list_at_BookList_internal_1 --> -8($fp) + # local_print_list_at_BookList_internal_1 = VCALL local_print_list_at_BookList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 0($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_list_at_BookList_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_print_list_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Cons__attrib__xcar__init implementation. +# @Params: +__Cons__attrib__xcar__init: + # Allocate stack frame for function __Cons__attrib__xcar__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Cons__attrib__xcar__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Cons__attrib__xcdr__init implementation. +# @Params: +__Cons__attrib__xcdr__init: + # Allocate stack frame for function __Cons__attrib__xcdr__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Cons__attrib__xcdr__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_Cons implementation. +# @Params: +function_isNil_at_Cons: + # Allocate stack frame for function function_isNil_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function function_isNil_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Cons implementation. +# @Params: +# 0($fp) = param_init_at_Cons_hd_0 +# 4($fp) = param_init_at_Cons_tl_1 +function_init_at_Cons: + # Allocate stack frame for function function_init_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_Cons_hd_0 --> 4($fp) + lw $t5, 4($fp) + sw $t5, 8($s1) + # + # PARAM param_init_at_Cons_tl_1 --> 0($fp) + lw $t5, 0($fp) + sw $t5, 12($s1) + # LOCAL local_init_at_Cons_internal_0 --> -4($fp) + # local_init_at_Cons_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_car_at_Cons implementation. +# @Params: +function_car_at_Cons: + # Allocate stack frame for function function_car_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_car_at_Cons_internal_0 = GETATTRIBUTE xcar Cons + # LOCAL local_car_at_Cons_internal_0 --> -4($fp) + lw $t5, 8($s1) + sw $t5, -4($fp) + # RETURN local_car_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_car_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cdr_at_Cons implementation. +# @Params: +function_cdr_at_Cons: + # Allocate stack frame for function function_cdr_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_cdr_at_Cons_internal_0 = GETATTRIBUTE xcdr Cons + # LOCAL local_cdr_at_Cons_internal_0 --> -4($fp) + lw $t5, 12($s1) + sw $t5, -4($fp) + # RETURN local_cdr_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_cdr_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_list_at_Cons implementation. +# @Params: +function_print_list_at_Cons: + # Allocate stack frame for function function_print_list_at_Cons. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # local_print_list_at_Cons_internal_2 = GETATTRIBUTE xcar Cons + # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) + lw $t5, 8($s1) + sw $t5, -12($fp) + # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) + # local_print_list_at_Cons_internal_0 = local_print_list_at_Cons_internal_2 + lw $t5, -12($fp) + sw $t5, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # local_print_list_at_Cons_internal_1 = VCALL local_print_list_at_Cons_internal_0 print + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 32($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # local_print_list_at_Cons_internal_3 = TYPEOF local_print_list_at_Cons_internal_1 + lw $t5, -8($fp) + # Load pointer to type + lw $t6, 4($t5) + sw $t6, -16($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # local_print_list_at_Cons_internal_5 = 14 + li $t5, 14 + sw $t5, -24($fp) + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_7 = local_print_list_at_Cons_internal_5 - local_print_list_at_Cons_internal_6 + lw $t5, -24($fp) + lw $t6, -28($fp) + sub $t5, $t5, $t6 + sw $t5, -32($fp) + # IF_GREATER_ZERO local_print_list_at_Cons_internal_7 GOTO label_Not_min0_1 + # IF_GREATER_ZERO local_print_list_at_Cons_internal_7 GOTO label_Not_min0_1 + lw $t5, -32($fp) + bgt $t5, 0, label_Not_min0_1 + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_6 + lw $t5, -28($fp) + sw $t5, -24($fp) + label_Not_min0_1: + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_7 = local_print_list_at_Cons_internal_5 - local_print_list_at_Cons_internal_6 + lw $t5, -24($fp) + lw $t6, -28($fp) + sub $t5, $t5, $t6 + sw $t5, -32($fp) + # IF_GREATER_ZERO local_print_list_at_Cons_internal_7 GOTO label_Not_min1_2 + # IF_GREATER_ZERO local_print_list_at_Cons_internal_7 GOTO label_Not_min1_2 + lw $t5, -32($fp) + bgt $t5, 0, label_Not_min1_2 + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_6 + lw $t5, -28($fp) + sw $t5, -24($fp) + label_Not_min1_2: + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_6 = 14 + li $t5, 14 + sw $t5, -28($fp) + # LOCAL local_print_list_at_Cons_internal_4 --> -20($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # local_print_list_at_Cons_internal_4 = local_print_list_at_Cons_internal_6 - local_print_list_at_Cons_internal_5 + lw $t5, -28($fp) + lw $t6, -24($fp) + sub $t5, $t5, $t6 + sw $t5, -20($fp) + # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 + # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 + lw $t5, -20($fp) + beq $t5, 0, label_ERROR_3 + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_7 = local_print_list_at_Cons_internal_5 - local_print_list_at_Cons_internal_6 + lw $t5, -24($fp) + lw $t6, -28($fp) + sub $t5, $t5, $t6 + sw $t5, -32($fp) + # + # + lw $t5, -32($fp) + bne $t5, 0, label_NEXT0_5 + # LOCAL local_print_list_at_Cons_dummy_8 --> -36($fp) + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # local_print_list_at_Cons_dummy_8 = local_print_list_at_Cons_internal_1 + lw $t5, -8($fp) + sw $t5, -36($fp) + # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) + # local_print_list_at_Cons_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) + # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) + # local_print_list_at_Cons_internal_9 = local_print_list_at_Cons_internal_11 + lw $t5, -48($fp) + sw $t5, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Cons_internal_12 --> -52($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + la $t5, data_8 + sw $t5, 8($v0) + li $t5, 27 + sw $t5, 12($v0) + sw $v0, -52($fp) + # ARG local_print_list_at_Cons_internal_12 + # LOCAL local_print_list_at_Cons_internal_12 --> -52($fp) + lw $t5, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) + # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) + # local_print_list_at_Cons_internal_10 = VCALL local_print_list_at_Cons_internal_9 out_string + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 12($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # GOTO label_END_4 +j label_END_4 +label_NEXT0_5: + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_7 = local_print_list_at_Cons_internal_5 - local_print_list_at_Cons_internal_6 + lw $t5, -24($fp) + lw $t6, -28($fp) + sub $t5, $t5, $t6 + sw $t5, -32($fp) + # + # + lw $t5, -32($fp) + bne $t5, 0, label_NEXT1_6 + # LOCAL local_print_list_at_Cons_dummy_13 --> -56($fp) + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # local_print_list_at_Cons_dummy_13 = local_print_list_at_Cons_internal_1 + lw $t5, -8($fp) + sw $t5, -56($fp) + # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) + # local_print_list_at_Cons_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_print_list_at_Cons_internal_14 --> -60($fp) + # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) + # local_print_list_at_Cons_internal_14 = local_print_list_at_Cons_internal_16 + lw $t5, -68($fp) + sw $t5, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + la $t5, data_9 + sw $t5, 8($v0) + li $t5, 30 + sw $t5, 12($v0) + sw $v0, -72($fp) + # ARG local_print_list_at_Cons_internal_17 + # LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) + lw $t5, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + # LOCAL local_print_list_at_Cons_internal_14 --> -60($fp) + # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) + # local_print_list_at_Cons_internal_15 = VCALL local_print_list_at_Cons_internal_14 out_string + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 12($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # GOTO label_END_4 +j label_END_4 +label_NEXT1_6: + label_ERROR_3: + label_END_4: +# local_print_list_at_Cons_internal_20 = GETATTRIBUTE xcdr Cons +# LOCAL local_print_list_at_Cons_internal_20 --> -84($fp) +lw $t5, 12($s1) +sw $t5, -84($fp) +# LOCAL local_print_list_at_Cons_internal_18 --> -76($fp) +# LOCAL local_print_list_at_Cons_internal_20 --> -84($fp) +# local_print_list_at_Cons_internal_18 = local_print_list_at_Cons_internal_20 +lw $t5, -84($fp) +sw $t5, -76($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -# Allocating string -la $t3, String -sw $t3, 0($v0) -la $t3, String_start -sw $t3, 4($v0) -la $t3, data_2 -sw $t3, 8($v0) -li $t3, 2 -sw $t3, 12($v0) -sw $v0, -80($fp) -# ARG local_main_at_Main_internal_19 -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -lw $t3, -80($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_main_at_Main_internal_16 --> -68($fp) -# LOCAL local_main_at_Main_internal_17 --> -72($fp) -# local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string +# LOCAL local_print_list_at_Cons_internal_18 --> -76($fp) +# LOCAL local_print_list_at_Cons_internal_19 --> -80($fp) +# local_print_list_at_Cons_internal_19 = VCALL local_print_list_at_Cons_internal_18 print_list # Save new self pointer in $s1 -lw $s1, -68($fp) +lw $s1, -76($fp) # Get pointer to type -lw $t3, 4($s1) +lw $t5, 4($s1) # Get pointer to type's VTABLE -lw $t4, 0($t3) +lw $t6, 0($t5) # Get pointer to function address -lw $t5, 12($t4) +lw $t7, 44($t6) # Call function. Result is on $v0 -jalr $t5 -sw $v0, -72($fp) +jalr $t7 +sw $v0, -80($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# RETURN local_main_at_Main_internal_17 -lw $v0, -72($fp) -# Deallocate stack frame for function function_main_at_Main. +# RETURN local_print_list_at_Cons_internal_19 +lw $v0, -80($fp) +# Deallocate stack frame for function function_print_list_at_Cons. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 88 +addu $sp, $sp, 92 jr $ra # Function END +# function_isNil_at_Nil implementation. +# @Params: +function_isNil_at_Nil: + # Allocate stack frame for function function_isNil_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 1 + li $v0, 1 + # Deallocate stack frame for function function_isNil_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_list_at_Nil implementation. +# @Params: +function_print_list_at_Nil: + # Allocate stack frame for function function_print_list_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 1 + li $v0, 1 + # Deallocate stack frame for function function_print_list_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__books__init implementation. +# @Params: +__Main__attrib__books__init: + # Allocate stack frame for function __Main__attrib__books__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__books__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # LOCAL local_main_at_Main_a_book_0 --> -4($fp) + # local_main_at_Main_a_book_0 = ALLOCATE Book + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) + la $t7, Book + sw $t7, 8($v0) + li $t7, 4 + sw $t7, 12($v0) + move $t7, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t7, 0($v0) + la $t7, Book_start + sw $t7, 4($v0) + move $t6, $v0 + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 8($t6) + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t6) + sw $t6, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE Book + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t8, String + sw $t8, 0($v0) + la $t8, String_start + sw $t8, 4($v0) + la $t8, Book + sw $t8, 8($v0) + li $t8, 4 + sw $t8, 12($v0) + move $t8, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t8, 0($v0) + la $t8, Book_start + sw $t8, 4($v0) + move $t7, $v0 + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 8($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t7) + sw $t7, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t7, -16($fp) + sw $t7, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) + la $t7, data_10 + sw $t7, 8($v0) + li $t7, 44 + sw $t7, 12($v0) + sw $v0, -20($fp) + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t7, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) + la $t7, data_11 + sw $t7, 8($v0) + li $t7, 22 + sw $t7, 12($v0) + sw $v0, -24($fp) + # ARG local_main_at_Main_internal_5 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t7, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 initBook + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t7, 4($s1) + # Get pointer to type's VTABLE + lw $t8, 0($t7) + # Get pointer to function address + lw $t9, 28($t8) + # Call function. Result is on $v0 + jalr $t9 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_a_book_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_a_book_0 = local_main_at_Main_internal_2 + lw $t7, -12($fp) + sw $t7, -4($fp) + # LOCAL local_main_at_Main_an_article_6 --> -28($fp) + # local_main_at_Main_an_article_6 = ALLOCATE Article + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) + la $t9, Article + sw $t9, 8($v0) + li $t9, 7 + sw $t9, 12($v0) + move $t9, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t9, 0($v0) + la $t9, Article_start + sw $t9, 4($v0) + move $t8, $v0 + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 8($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Article__attrib__per_title__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t8) + sw $t8, -28($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = ALLOCATE Article + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $s2, String + sw $s2, 0($v0) + la $s2, String_start + sw $s2, 4($v0) + la $s2, Article + sw $s2, 8($v0) + li $s2, 7 + sw $s2, 12($v0) + move $s2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $s2, 0($v0) + la $s2, Article_start + sw $s2, 4($v0) + move $t9, $v0 + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 8($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Article__attrib__per_title__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t9) + sw $t9, -40($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 + lw $t9, -40($fp) + sw $t9, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) + la $t9, data_12 + sw $t9, 8($v0) + li $t9, 19 + sw $t9, 12($v0) + sw $v0, -44($fp) + # ARG local_main_at_Main_internal_10 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + lw $t9, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) + la $t9, data_13 + sw $t9, 8($v0) + li $t9, 7 + sw $t9, 12($v0) + sw $v0, -48($fp) + # ARG local_main_at_Main_internal_11 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + lw $t9, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) + la $t9, data_14 + sw $t9, 8($v0) + li $t9, 11 + sw $t9, 12($v0) + sw $v0, -52($fp) + # ARG local_main_at_Main_internal_12 + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + lw $t9, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 initArticle + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t9, 4($s1) + # Get pointer to type's VTABLE + lw $s2, 0($t9) + # Get pointer to function address + lw $s3, 36($s2) + # Call function. Result is on $v0 + jalr $s3 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_an_article_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_an_article_6 = local_main_at_Main_internal_8 + lw $t9, -36($fp) + sw $t9, -28($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = ALLOCATE Nil + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + # Allocating string for type name + la $s3, String + sw $s3, 0($v0) + la $s3, String_start + sw $s3, 4($v0) + la $s3, Nil + sw $s3, 8($v0) + li $s3, 3 + sw $s3, 12($v0) + move $s3, $v0 + # Allocating 8 bytes of memory + li $a0, 8 + li $v0, 9 + syscall + sw $s3, 0($v0) + la $s3, Nil_start + sw $s3, 4($v0) + move $s2, $v0 + sw $s2, -72($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 + lw $s2, -72($fp) + sw $s2, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_a_book_0 + # LOCAL local_main_at_Main_a_book_0 --> -4($fp) + lw $s2, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $s2, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 cons + # Save new self pointer in $s1 + lw $s1, -64($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 32($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_13 = local_main_at_Main_internal_16 + lw $s2, -68($fp) + sw $s2, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_an_article_6 + # LOCAL local_main_at_Main_an_article_6 --> -28($fp) + lw $s2, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $s2, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 cons + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 32($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + lw $s2, -60($fp) + sw $s2, 8($s1) + # local_main_at_Main_internal_20 = GETATTRIBUTE books Main + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + lw $s2, 8($s1) + sw $s2, -84($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 + lw $s2, -84($fp) + sw $s2, -76($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 print_list + # Save new self pointer in $s1 + lw $s1, -76($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 44($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -80($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_19 + lw $v0, -80($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 92 + jr $ra + # Function END + + diff --git a/src/testing.py b/src/testing.py index 74640500..08133765 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,14 +60,138 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""class Main inherits IO { - main() : IO { - { - out_string((new Object).type_name().substr(4,1)). - out_string((isvoid self).type_name().substr(1,3)); -- demonstrates the dispatch rules. - out_string("\n"); - } +text = r"""-- example of static and dynamic type differing for a dispatch + +Class Book inherits IO { + title : String; + author : String; + + initBook(title_p : String, author_p : String) : Book { + { + title <- title_p; + author <- author_p; + self; + } + }; + + print() : Book { + { + out_string("title: ").out_string(title).out_string("\n"); + out_string("author: ").out_string(author).out_string("\n"); + self; + } + }; +}; + +Class Article inherits Book { + per_title : String; + + initArticle(title_p : String, author_p : String, + per_title_p : String) : Article { + { + initBook(title_p, author_p); + per_title <- per_title_p; + self; + } + }; + + print() : Book { + { + self@Book.print(); + out_string("periodical: ").out_string(per_title).out_string("\n"); + self; + } + }; +}; + +Class BookList inherits IO { + (* Since abort "returns" type Object, we have to add + an expression of type Bool here to satisfy the typechecker. + This code is unreachable, since abort() halts the program. + *) + isNil() : Bool { { abort(); true; } }; + + cons(hd : Book) : Cons { + (let new_cell : Cons <- new Cons in + new_cell.init(hd,self) + ) + }; + + (* Since abort "returns" type Object, we have to add + an expression of type Book here to satisfy the typechecker. + This code is unreachable, since abort() halts the program. + *) + car() : Book { { abort(); new Book; } }; + + (* Since abort "returns" type Object, we have to add + an expression of type BookList here to satisfy the typechecker. + This code is unreachable, since abort() halts the program. + *) + cdr() : BookList { { abort(); new BookList; } }; + + print_list() : Object { abort() }; +}; + +Class Cons inherits BookList { + xcar : Book; -- We keep the car and cdr in attributes. + xcdr : BookList; -- Because methods and features must have different names, + -- we use xcar and xcdr for the attributes and reserve + -- car and cdr for the features. + + isNil() : Bool { false }; + + init(hd : Book, tl : BookList) : Cons { + { + xcar <- hd; + xcdr <- tl; + self; + } + }; + + car() : Book { xcar }; + + cdr() : BookList { xcdr }; + + print_list() : Object { + { + case xcar.print() of + dummy : Book => out_string("- dynamic type was Book -\n"); + dummy : Article => out_string("- dynamic type was Article -\n"); + esac; + xcdr.print_list(); + } }; }; + +Class Nil inherits BookList { + isNil() : Bool { true }; + + print_list() : Object { true }; +}; + + +Class Main { + + books : BookList; + + main() : Object { + (let a_book : Book <- + (new Book).initBook("Compilers, Principles, Techniques, and Tools", + "Aho, Sethi, and Ullman") + in + (let an_article : Article <- + (new Article).initArticle("The Top 100 CD_ROMs", + "Ulanoff", + "PC Magazine") + in + { + books <- (new Nil).cons(a_book).cons(an_article); + books.print_list(); + } + ) -- end let an_article + ) -- end let a_book + }; +}; + """ pipeline(text, 5) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 37d07c5e..2f569cc1 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -465,7 +465,7 @@ def _(self, node: cil.AllocateNode): self.allocate_memory(size) reg = self.get_available_register() - assert reg is not None + assert reg is not None, f"{str(self.used_registers)}" self.comment("Allocating string for type name") @@ -952,6 +952,8 @@ def _(self, node: cil.TypeName): self.register_instruction(LW(reg, f"0($s1)")) self.register_instruction(SW(reg, dest)) + self.used_registers[reg] = False + @visit.register def _(self, node: cil.PrintIntNode): # El valor a imprimir se encuentra en la direccion diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 97f7ccd8..26e1e94d 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -428,7 +428,7 @@ def _(self, node: coolAst.CaseNode, scope: Scope): # Comparar el resultado obtenido con el minimo actual. self.register_instruction(MinusNode(min_, tdt_result, min_check_local)) - not_min_label = self.do_label("Not_min{i}") + not_min_label = self.do_label(f"Not_min{i}") self.register_instruction( JumpIfGreaterThanZeroNode(min_check_local, not_min_label) ) @@ -448,7 +448,7 @@ def _(self, node: coolAst.CaseNode, scope: Scope): end_label = self.do_label("END") # Procesar cada accion y ejecutar el tipo cuya distancia sea igual a min_ - for i, action_node in enumerate(node.actions): + for i, (action_node, s) in enumerate(zip(node.actions, scope.children)): next_label = self.do_label(f"NEXT{i}") self.register_instruction( TdtLookupNode(action_node.typex, type_internal_local_holder, tdt_result) @@ -457,7 +457,7 @@ def _(self, node: coolAst.CaseNode, scope: Scope): self.register_instruction(NotZeroJump(min_check_local, next_label)) # Implemententacion del branch. # Registrar la variable - var_info = scope.find_variable(action_node.idx) + var_info = s.find_variable(action_node.idx) assert var_info is not None idk = self.register_local(var_info) # Asignar al identificador idk el valor de expr0 diff --git a/src/travels/inference.py b/src/travels/inference.py index f9f2d8d7..635b1499 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -109,8 +109,9 @@ def _( ): self.current_type = self.context.get_type(node.idx) # Definir los atributos heredados - for attribute in self.current_type.attributes: - scope.define_variable(attribute.name, attribute.type, "ATTRIBUTE") + if deep == 1: + for attribute in self.current_type.attributes: + scope.define_variable(attribute.name, attribute.type, "ATTRIBUTE") for feature in node.features: if isinstance(feature, coolAst.AttributeDef): @@ -292,9 +293,16 @@ def _( @visit.register def _(self, node: CaseNode, scope: Scope, infered_type=None, deep=1): - types: List[Type] = [ - self.visit(action, scope, infered_type, deep) for action in node.actions - ] + if deep == 1: + types: List[Type] = [ + self.visit(action, scope.create_child(), infered_type, deep) + for action in node.actions + ] + else: + types = [ + self.visit(action, s, infered_type, deep) + for action, s in zip(node.actions, scope.children) + ] actions_types = [action.typex for action in node.actions] @@ -322,6 +330,8 @@ def _(self, node: CaseNode, scope: Scope, infered_type=None, deep=1): @visit.register def _(self, node: ActionNode, scope: Scope, infered_type=None, deep=1): + if deep == 1: + scope.define_variable(node.idx, self.context.get_type(node.typex), "LOCAL") return self.visit(node.actions, scope, infered_type, deep) @visit.register @@ -336,15 +346,17 @@ def _( scope = scope.create_child() else: scope = scope.children[0] - for var_id, var_type, var_init_expr, l , c in node.var_list: + for var_id, var_type, var_init_expr, l, c in node.var_list: try: type_ = self.context.get_type(var_type) except SemanticError: - raise SemanticError(TypeError( - f"Class {var_type} of let-bound identifier b is undefined.", - l, - c - )) + raise SemanticError( + TypeError( + f"Class {var_type} of let-bound identifier b is undefined.", + l, + c, + ) + ) # Revisar que la expresion de inicializacion (de existir) se conforme con el tipo # de la variable. # Se pueden dar varios casos: @@ -499,7 +511,9 @@ def _( try: ret_type = self.context.get_type(node.type_) except SemanticError: - raise SemanticError(f"{node.line, node.column + 4} - TypeError: 'new' used with undefined class {node.type_}.") + raise SemanticError( + f"{node.line, node.column + 4} - TypeError: 'new' used with undefined class {node.type_}." + ) if ret_type in ( self.AUTO_TYPE, void, @@ -520,7 +534,9 @@ def _( ): cond_type = self.visit(node.cond, scope, infered_type, deep) if cond_type != self.BOOL: - raise SemanticError(f"{node.cond.line, node.cond.column} - TypeError: Loop condition does not have type Bool.") + raise SemanticError( + f"{node.cond.line, node.cond.column} - TypeError: Loop condition does not have type Bool." + ) ret_type = self.visit(node.statements, scope, infered_type, deep) return self.OBJECT From cc56f317d3bb5e27f083ebc69cc25d0383cb0c42 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sat, 5 Dec 2020 11:25:45 -0500 Subject: [PATCH 144/162] Add offset to type records --- src/cil/nodes.py | 2 +- src/mips/baseMipsVisitor.py | 6 +- src/testing.mips | 2592 ++++------------------------- src/testing.py | 137 +- src/travels/ciltomips.py | 114 +- src/travels/ctcill.py | 6 +- tests/codegen/book_list.mips | 2825 ++++++++++++++++++++++++++++++++ tests/codegen/fib.mips | 399 +++-- tests/codegen/hello_world.mips | 240 ++- tests/codegen/io.mips | 750 ++++----- tests/codegen/list.mips | 711 ++++---- tests/codegen/print-cool.mips | 452 +++-- 12 files changed, 4467 insertions(+), 3767 deletions(-) create mode 100644 tests/codegen/book_list.mips diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 9302b68a..b5d85eeb 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -127,7 +127,7 @@ class ArrayNode(InstructionNode): pass -class TypeOfNode(InstructionNode): +class TypeOffsetNode(InstructionNode): def __init__(self, variable: Union[LocalNode, ParamNode], dest: LocalNode): self.variable = variable self.dest = dest diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index d93a9e95..178008d2 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -94,6 +94,9 @@ def __init__(self): # Necesitamos acceso a los tipos del programa self.types: List[TypeNode] = [] + + # Tipos accesibles en el codigo + self.mips_types: List[str] = [] # Construir el header del programa. self.__program_header() @@ -223,6 +226,7 @@ def create_type_array(self, types: List[TypeNode]): # Generar por cada tipo, un label que lo identifique, en el mismo orden que aparecen # en la lista de tipos. for t in types: + self.mips_types.append(t.name) self.register_instruction(FixedData(t.name, f'"{t.name}"', "asciiz")) self.comment("Function END") @@ -357,7 +361,7 @@ def locate_attribute(self, attrname: str, attributes: List[Attribute]): # Hallar el offset del atributo en el tipo que se # esta ejecutando - offset: int = 8 + offset: int = 12 for i, attribute in enumerate(attributes): if attribute.name == attrname: offset += i * 4 diff --git a/src/testing.mips b/src/testing.mips index f7f1cc77..c08e4862 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 22:28:54 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 11:25:23 2020 # School of Math and Computer Science, University of Havana # @@ -13,16 +13,6 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END -Book: .asciiz "Book" -# Function END -Article: .asciiz "Article" -# Function END -BookList: .asciiz "BookList" -# Function END -Cons: .asciiz "Cons" -# Function END -Nil: .asciiz "Nil" -# Function END Main: .asciiz "Main" # Function END # @@ -84,78 +74,8 @@ Bool_end: # -# **** VTABLE for type Book **** -Book_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_initBook_at_Book, function_print_at_Book -# Function END -# - - -# **** Type RECORD for type Book **** -Book_start: - Book_vtable_pointer: .word Book_vtable - # Function END -Book_end: -# - - -# **** VTABLE for type Article **** -Article_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_initBook_at_Book, function_print_at_Article, function_initArticle_at_Article -# Function END -# - - -# **** Type RECORD for type Article **** -Article_start: - Article_vtable_pointer: .word Article_vtable - # Function END -Article_end: -# - - -# **** VTABLE for type BookList **** -BookList_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_BookList, function_cons_at_BookList, function_car_at_BookList, function_cdr_at_BookList, function_print_list_at_BookList -# Function END -# - - -# **** Type RECORD for type BookList **** -BookList_start: - BookList_vtable_pointer: .word BookList_vtable - # Function END -BookList_end: -# - - -# **** VTABLE for type Cons **** -Cons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_Cons, function_cons_at_BookList, function_car_at_Cons, function_cdr_at_Cons, function_print_list_at_Cons, function_init_at_Cons -# Function END -# - - -# **** Type RECORD for type Cons **** -Cons_start: - Cons_vtable_pointer: .word Cons_vtable - # Function END -Cons_end: -# - - -# **** VTABLE for type Nil **** -Nil_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_Nil, function_cons_at_BookList, function_car_at_BookList, function_cdr_at_BookList, function_print_list_at_Nil -# Function END -# - - -# **** Type RECORD for type Nil **** -Nil_start: - Nil_vtable_pointer: .word Nil_vtable - # Function END -Nil_end: -# - - # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main # Function END # @@ -172,179 +92,15 @@ data_0: .asciiz "" # -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Book_tdt_entry__: .word 2 -__Object_Article_tdt_entry__: .word 3 -__Object_BookList_tdt_entry__: .word 2 -__Object_Cons_tdt_entry__: .word 3 -__Object_Nil_tdt_entry__: .word 3 -__Object_Main_tdt_entry__: .word 1 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Book_tdt_entry__: .word -1 -__Int_Article_tdt_entry__: .word -1 -__Int_BookList_tdt_entry__: .word -1 -__Int_Cons_tdt_entry__: .word -1 -__Int_Nil_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Book_tdt_entry__: .word -1 -__String_Article_tdt_entry__: .word -1 -__String_BookList_tdt_entry__: .word -1 -__String_Cons_tdt_entry__: .word -1 -__String_Nil_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Book_tdt_entry__: .word -1 -__Bool_Article_tdt_entry__: .word -1 -__Bool_BookList_tdt_entry__: .word -1 -__Bool_Cons_tdt_entry__: .word -1 -__Bool_Nil_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Book_tdt_entry__: .word 1 -__IO_Article_tdt_entry__: .word 2 -__IO_BookList_tdt_entry__: .word 1 -__IO_Cons_tdt_entry__: .word 2 -__IO_Nil_tdt_entry__: .word 2 -__IO_Main_tdt_entry__: .word -1 -__Book_Object_tdt_entry__: .word -1 -__Book_Int_tdt_entry__: .word -1 -__Book_String_tdt_entry__: .word -1 -__Book_Bool_tdt_entry__: .word -1 -__Book_IO_tdt_entry__: .word -1 -__Book_Book_tdt_entry__: .word 0 -__Book_Article_tdt_entry__: .word 1 -__Book_BookList_tdt_entry__: .word -1 -__Book_Cons_tdt_entry__: .word -1 -__Book_Nil_tdt_entry__: .word -1 -__Book_Main_tdt_entry__: .word -1 -__Article_Object_tdt_entry__: .word -1 -__Article_Int_tdt_entry__: .word -1 -__Article_String_tdt_entry__: .word -1 -__Article_Bool_tdt_entry__: .word -1 -__Article_IO_tdt_entry__: .word -1 -__Article_Book_tdt_entry__: .word -1 -__Article_Article_tdt_entry__: .word 0 -__Article_BookList_tdt_entry__: .word -1 -__Article_Cons_tdt_entry__: .word -1 -__Article_Nil_tdt_entry__: .word -1 -__Article_Main_tdt_entry__: .word -1 -__BookList_Object_tdt_entry__: .word -1 -__BookList_Int_tdt_entry__: .word -1 -__BookList_String_tdt_entry__: .word -1 -__BookList_Bool_tdt_entry__: .word -1 -__BookList_IO_tdt_entry__: .word -1 -__BookList_Book_tdt_entry__: .word -1 -__BookList_Article_tdt_entry__: .word -1 -__BookList_BookList_tdt_entry__: .word 0 -__BookList_Cons_tdt_entry__: .word 1 -__BookList_Nil_tdt_entry__: .word 1 -__BookList_Main_tdt_entry__: .word -1 -__Cons_Object_tdt_entry__: .word -1 -__Cons_Int_tdt_entry__: .word -1 -__Cons_String_tdt_entry__: .word -1 -__Cons_Bool_tdt_entry__: .word -1 -__Cons_IO_tdt_entry__: .word -1 -__Cons_Book_tdt_entry__: .word -1 -__Cons_Article_tdt_entry__: .word -1 -__Cons_BookList_tdt_entry__: .word -1 -__Cons_Cons_tdt_entry__: .word 0 -__Cons_Nil_tdt_entry__: .word -1 -__Cons_Main_tdt_entry__: .word -1 -__Nil_Object_tdt_entry__: .word -1 -__Nil_Int_tdt_entry__: .word -1 -__Nil_String_tdt_entry__: .word -1 -__Nil_Bool_tdt_entry__: .word -1 -__Nil_IO_tdt_entry__: .word -1 -__Nil_Book_tdt_entry__: .word -1 -__Nil_Article_tdt_entry__: .word -1 -__Nil_BookList_tdt_entry__: .word -1 -__Nil_Cons_tdt_entry__: .word -1 -__Nil_Nil_tdt_entry__: .word 0 -__Nil_Main_tdt_entry__: .word -1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Book_tdt_entry__: .word -1 -__Main_Article_tdt_entry__: .word -1 -__Main_BookList_tdt_entry__: .word -1 -__Main_Cons_tdt_entry__: .word -1 -__Main_Nil_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 -# - - -data_2: .asciiz "title: " -# - - -data_3: .asciiz "\n" -# - - -data_4: .asciiz "author: " -# - - -data_5: .asciiz "\n" -# - - -data_6: .asciiz "periodical: " -# - - -data_7: .asciiz "\n" -# - - -data_8: .asciiz "- dynamic type was Book -\n" -# - - -data_9: .asciiz "- dynamic type was Article -\n" -# - - -data_10: .asciiz "Compilers, Principles, Techniques, and Tools" -# - - -data_11: .asciiz "Aho, Sethi, and Ullman" -# - - -data_12: .asciiz "The Top 100 CD_ROMs" -# - - -data_13: .asciiz "Ulanoff" +IO__TDT: .word 0, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, 0 # -data_14: .asciiz "PC Magazine" +data_2: .asciiz "\n" # @@ -421,7 +177,7 @@ function_out_string_at_IO: # PARAM param_out_string_at_IO_x_0 --> 0($fp) # PRINT_STR param_out_string_at_IO_x_0 lw $v0, 0($fp) - lw $a0, 8($v0) + lw $a0, 12($v0) li $v0, 4 syscall # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) @@ -538,21 +294,21 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self - lw $t0, 12($s1) + lw $t0, 16($s1) # Get second string length from param lw $v0, 0($fp) - lw $t1, 12($v0) + lw $t1, 16($v0) # Save new string length in a0 for memory allocation addu $a0, $t0, $t1 move $t3, $a0 # Get first string from self - lw $t0, 8($s1) + lw $t0, 12($s1) # Get second string from param - lw $t1, 8($v0) + lw $t1, 12($v0) addu $a0, $a0, 1 li $v0, 9 syscall @@ -582,8 +338,8 @@ function_concat_at_String: sb $zero, 0($t2) # v0 contains resulting string move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string @@ -591,8 +347,11 @@ function_concat_at_String: sw $t0, 0($v0) la $t0, String_start sw $t0, 4($v0) - sw $t1, 8($v0) - sw $t3, 12($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) sw $v0, -4($fp) # RETURN local_concat_at_String_internal_0 lw $v0, -4($fp) @@ -622,7 +381,7 @@ function_substr_at_String: # LOCAL local_substr_at_String_internal_0 --> -4($fp) # PARAM param_substr_at_String_l_0 --> 4($fp) # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 8($s1) + lw $t0, 12($s1) lw $t2, 4($fp) addu $t0, $t0, $t2 lw $a0, 0($fp) @@ -643,8 +402,8 @@ function_substr_at_String: substr_end: sb $zero, 0($t2) move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string @@ -652,8 +411,11 @@ function_substr_at_String: sw $t0, 0($v0) la $t0, String_start sw $t0, 4($v0) - sw $t1, 8($v0) - sw $t3, 12($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) sw $v0, -4($fp) # RETURN local_substr_at_String_internal_0 lw $v0, -4($fp) @@ -680,7 +442,7 @@ function_length_at_String: addu $fp, $sp, 32 # local_length_at_String_internal_0 = GETATTRIBUTE length String # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 12($s1) + lw $t0, 16($s1) sw $t0, -4($fp) # RETURN local_length_at_String_internal_0 lw $v0, -4($fp) @@ -705,8 +467,8 @@ entry: addu $fp, $sp, 32 # LOCAL local__internal_0 --> -4($fp) # local__internal_0 = ALLOCATE Main - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string for type name @@ -714,10 +476,13 @@ entry: sw $t2, 0($v0) la $t2, String_start sw $t2, 4($v0) - la $t2, Main + # Load type offset + li $t2, 8 sw $t2, 8($v0) - li $t2, 4 + la $t2, Main sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) move $t2, $v0 # Allocating 12 bytes of memory li $a0, 12 @@ -726,15 +491,10 @@ entry: sw $t2, 0($v0) la $t2, Main_start sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) move $t1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__books__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 8($t1) sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) @@ -755,2069 +515,359 @@ entry: # Function END -# __Book__attrib__title__init implementation. -# @Params: -__Book__attrib__title__init: - # Allocate stack frame for function __Book__attrib__title__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__title__init_internal_0 --> -4($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_0 - sw $t1, 8($v0) - li $t1, 0 - sw $t1, 12($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__title__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Book__attrib__title__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Book__attrib__author__init implementation. -# @Params: -__Book__attrib__author__init: - # Allocate stack frame for function __Book__attrib__author__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__author__init_internal_0 --> -4($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_0 - sw $t1, 8($v0) - li $t1, 0 - sw $t1, 12($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__author__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Book__attrib__author__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_initBook_at_Book implementation. -# @Params: -# 0($fp) = param_initBook_at_Book_title_p_0 -# 4($fp) = param_initBook_at_Book_author_p_1 -function_initBook_at_Book: - # Allocate stack frame for function function_initBook_at_Book. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_initBook_at_Book_title_p_0 --> 4($fp) - lw $t1, 4($fp) - sw $t1, 8($s1) - # - # PARAM param_initBook_at_Book_author_p_1 --> 0($fp) - lw $t1, 0($fp) - sw $t1, 12($s1) - # LOCAL local_initBook_at_Book_internal_0 --> -4($fp) - # local_initBook_at_Book_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_initBook_at_Book_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_initBook_at_Book. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_print_at_Book implementation. +# function_main_at_Main implementation. # @Params: -function_print_at_Book: - # Allocate stack frame for function function_print_at_Book. - subu $sp, $sp, 92 +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 88 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 92 - # LOCAL local_print_at_Book_internal_6 --> -28($fp) - # local_print_at_Book_internal_6 = SELF - sw $s1, -28($fp) - # LOCAL local_print_at_Book_internal_4 --> -20($fp) - # LOCAL local_print_at_Book_internal_6 --> -28($fp) - # local_print_at_Book_internal_4 = local_print_at_Book_internal_6 - lw $t1, -28($fp) - sw $t1, -20($fp) + addu $fp, $sp, 88 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 + lw $t1, -20($fp) + sw $t1, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_at_Book_internal_7 --> -32($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = ALLOCATE Object + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_2 - sw $t1, 8($v0) - li $t1, 12 - sw $t1, 12($v0) - sw $v0, -32($fp) - # ARG local_print_at_Book_internal_7 - # LOCAL local_print_at_Book_internal_7 --> -32($fp) - lw $t1, -32($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_4 --> -20($fp) - # LOCAL local_print_at_Book_internal_5 --> -24($fp) - # local_print_at_Book_internal_5 = VCALL local_print_at_Book_internal_4 out_string - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_2 --> -12($fp) - # LOCAL local_print_at_Book_internal_5 --> -24($fp) - # local_print_at_Book_internal_2 = local_print_at_Book_internal_5 - lw $t1, -24($fp) - sw $t1, -12($fp) + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Object + sw $t3, 12($v0) + li $t3, 6 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Object_start + sw $t3, 4($v0) + # Load type offset + li $t3, 4 + sw $t3, 8($v0) + move $t2, $v0 + sw $t2, -40($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 + lw $t2, -40($fp) + sw $t2, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_print_at_Book_internal_8 = GETATTRIBUTE title Book - # LOCAL local_print_at_Book_internal_8 --> -36($fp) - lw $t1, 8($s1) - sw $t1, -36($fp) - # ARG local_print_at_Book_internal_8 - # LOCAL local_print_at_Book_internal_8 --> -36($fp) - lw $t1, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_2 --> -12($fp) - # LOCAL local_print_at_Book_internal_3 --> -16($fp) - # local_print_at_Book_internal_3 = VCALL local_print_at_Book_internal_2 out_string + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 type_name # Save new self pointer in $s1 - lw $s1, -12($fp) + lw $s1, -32($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t3, 0($t2) # Get pointer to function address - lw $t3, 12($t2) + lw $t4, 4($t3) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) + jalr $t4 + sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_0 --> -4($fp) - # LOCAL local_print_at_Book_internal_3 --> -16($fp) - # local_print_at_Book_internal_0 = local_print_at_Book_internal_3 - lw $t1, -16($fp) - sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_5 = local_main_at_Main_internal_8 + lw $t2, -36($fp) + sw $t2, -24($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_at_Book_internal_9 --> -40($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_3 - sw $t1, 8($v0) - li $t1, 2 - sw $t1, 12($v0) - sw $v0, -40($fp) - # ARG local_print_at_Book_internal_9 - # LOCAL local_print_at_Book_internal_9 --> -40($fp) - lw $t1, -40($fp) + # ARG 4 + li $t2, 4 # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_0 --> -4($fp) - # LOCAL local_print_at_Book_internal_1 --> -8($fp) - # local_print_at_Book_internal_1 = VCALL local_print_at_Book_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_16 --> -68($fp) - # local_print_at_Book_internal_16 = SELF - sw $s1, -68($fp) - # LOCAL local_print_at_Book_internal_14 --> -60($fp) - # LOCAL local_print_at_Book_internal_16 --> -68($fp) - # local_print_at_Book_internal_14 = local_print_at_Book_internal_16 - lw $t1, -68($fp) - sw $t1, -60($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Book_internal_17 --> -72($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_4 - sw $t1, 8($v0) - li $t1, 12 - sw $t1, 12($v0) - sw $v0, -72($fp) - # ARG local_print_at_Book_internal_17 - # LOCAL local_print_at_Book_internal_17 --> -72($fp) - lw $t1, -72($fp) + sw $t2, 0($sp) + # ARG 1 + li $t2, 1 # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_14 --> -60($fp) - # LOCAL local_print_at_Book_internal_15 --> -64($fp) - # local_print_at_Book_internal_15 = VCALL local_print_at_Book_internal_14 out_string + sw $t2, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_6 = VCALL local_main_at_Main_internal_5 substr # Save new self pointer in $s1 - lw $s1, -60($fp) + lw $s1, -24($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t3, 0($t2) # Get pointer to function address - lw $t3, 12($t2) + lw $t4, 4($t3) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -64($fp) + jalr $t4 + sw $v0, -28($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_12 --> -52($fp) - # LOCAL local_print_at_Book_internal_15 --> -64($fp) - # local_print_at_Book_internal_12 = local_print_at_Book_internal_15 - lw $t1, -64($fp) - sw $t1, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Book_internal_18 = GETATTRIBUTE author Book - # LOCAL local_print_at_Book_internal_18 --> -76($fp) - lw $t1, 12($s1) - sw $t1, -76($fp) - # ARG local_print_at_Book_internal_18 - # LOCAL local_print_at_Book_internal_18 --> -76($fp) - lw $t1, -76($fp) + # ARG local_main_at_Main_internal_6 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + lw $t2, -28($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_12 --> -52($fp) - # LOCAL local_print_at_Book_internal_13 --> -56($fp) - # local_print_at_Book_internal_13 = VCALL local_print_at_Book_internal_12 out_string + sw $t2, 0($sp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string # Save new self pointer in $s1 - lw $s1, -52($fp) + lw $s1, -12($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t3, 0($t2) # Get pointer to function address - lw $t3, 12($t2) + lw $t4, 12($t3) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -56($fp) + jalr $t4 + sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_10 --> -44($fp) - # LOCAL local_print_at_Book_internal_13 --> -56($fp) - # local_print_at_Book_internal_10 = local_print_at_Book_internal_13 - lw $t1, -56($fp) - sw $t1, -44($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 + lw $t2, -16($fp) + sw $t2, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_at_Book_internal_19 --> -80($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = SELF + sw $s1, -64($fp) + # IF_ZERO local_main_at_Main_internal_15 GOTO label_TRUE_1 + # IF_ZERO local_main_at_Main_internal_15 GOTO label_TRUE_1 + lw $t2, -64($fp) + beq $t2, 0, label_TRUE_1 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_5 - sw $t1, 8($v0) - li $t1, 2 - sw $t1, 12($v0) - sw $v0, -80($fp) - # ARG local_print_at_Book_internal_19 - # LOCAL local_print_at_Book_internal_19 --> -80($fp) - lw $t1, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_10 --> -44($fp) - # LOCAL local_print_at_Book_internal_11 --> -48($fp) - # local_print_at_Book_internal_11 = VCALL local_print_at_Book_internal_10 out_string - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_20 --> -84($fp) - # local_print_at_Book_internal_20 = SELF - sw $s1, -84($fp) - # RETURN local_print_at_Book_internal_20 - lw $v0, -84($fp) - # Deallocate stack frame for function function_print_at_Book. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 92 - jr $ra - # Function END - - -# __Article__attrib__per_title__init implementation. -# @Params: -__Article__attrib__per_title__init: - # Allocate stack frame for function __Article__attrib__per_title__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local___attrib__per_title__init_internal_0 --> -4($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_0 - sw $t1, 8($v0) - li $t1, 0 - sw $t1, 12($v0) - sw $v0, -4($fp) - # RETURN local___attrib__per_title__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Article__attrib__per_title__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_initArticle_at_Article implementation. -# @Params: -# 0($fp) = param_initArticle_at_Article_title_p_0 -# 4($fp) = param_initArticle_at_Article_author_p_1 -# 8($fp) = param_initArticle_at_Article_per_title_p_2 -function_initArticle_at_Article: - # Allocate stack frame for function function_initArticle_at_Article. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) - # local_initArticle_at_Article_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) - # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) - # local_initArticle_at_Article_internal_0 = local_initArticle_at_Article_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_initArticle_at_Article_title_p_0 - # PARAM param_initArticle_at_Article_title_p_0 --> 8($fp) - lw $t1, 8($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # ARG param_initArticle_at_Article_author_p_1 - # PARAM param_initArticle_at_Article_author_p_1 --> 4($fp) - lw $t1, 4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) - # LOCAL local_initArticle_at_Article_internal_1 --> -8($fp) - # local_initArticle_at_Article_internal_1 = VCALL local_initArticle_at_Article_internal_0 initBook - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 28($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # PARAM param_initArticle_at_Article_per_title_p_2 --> 0($fp) - lw $t1, 0($fp) - sw $t1, 16($s1) - # LOCAL local_initArticle_at_Article_internal_3 --> -16($fp) - # local_initArticle_at_Article_internal_3 = SELF - sw $s1, -16($fp) - # RETURN local_initArticle_at_Article_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_initArticle_at_Article. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 12 - jr $ra - # Function END - - -# function_print_at_Article implementation. -# @Params: -function_print_at_Article: - # Allocate stack frame for function function_print_at_Article. - subu $sp, $sp, 60 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 60 - # LOCAL local_print_at_Article_internal_0 --> -4($fp) - # local_print_at_Article_internal_0 = - lw $t1, Book - sw $t1, -4($fp) - # LOCAL local_print_at_Article_internal_0 --> -4($fp) - # LOCAL local_print_at_Article_internal_1 --> -8($fp) - # local_print_at_Article_internal_1 = VCALL local_print_at_Article_internal_0 print - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 32($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # LOCAL local_print_at_Article_internal_8 --> -36($fp) - # local_print_at_Article_internal_8 = SELF - sw $s1, -36($fp) - # LOCAL local_print_at_Article_internal_6 --> -28($fp) - # LOCAL local_print_at_Article_internal_8 --> -36($fp) - # local_print_at_Article_internal_6 = local_print_at_Article_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Article_internal_9 --> -40($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_6 - sw $t1, 8($v0) - li $t1, 13 - sw $t1, 12($v0) - sw $v0, -40($fp) - # ARG local_print_at_Article_internal_9 - # LOCAL local_print_at_Article_internal_9 --> -40($fp) - lw $t1, -40($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Article_internal_6 --> -28($fp) - # LOCAL local_print_at_Article_internal_7 --> -32($fp) - # local_print_at_Article_internal_7 = VCALL local_print_at_Article_internal_6 out_string - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Article_internal_4 --> -20($fp) - # LOCAL local_print_at_Article_internal_7 --> -32($fp) - # local_print_at_Article_internal_4 = local_print_at_Article_internal_7 - lw $t1, -32($fp) - sw $t1, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Article_internal_10 = GETATTRIBUTE per_title Article - # LOCAL local_print_at_Article_internal_10 --> -44($fp) - lw $t1, 16($s1) - sw $t1, -44($fp) - # ARG local_print_at_Article_internal_10 - # LOCAL local_print_at_Article_internal_10 --> -44($fp) - lw $t1, -44($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Article_internal_4 --> -20($fp) - # LOCAL local_print_at_Article_internal_5 --> -24($fp) - # local_print_at_Article_internal_5 = VCALL local_print_at_Article_internal_4 out_string - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Article_internal_2 --> -12($fp) - # LOCAL local_print_at_Article_internal_5 --> -24($fp) - # local_print_at_Article_internal_2 = local_print_at_Article_internal_5 - lw $t1, -24($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Article_internal_11 --> -48($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - la $t1, data_7 - sw $t1, 8($v0) - li $t1, 2 - sw $t1, 12($v0) - sw $v0, -48($fp) - # ARG local_print_at_Article_internal_11 - # LOCAL local_print_at_Article_internal_11 --> -48($fp) - lw $t1, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Article_internal_2 --> -12($fp) - # LOCAL local_print_at_Article_internal_3 --> -16($fp) - # local_print_at_Article_internal_3 = VCALL local_print_at_Article_internal_2 out_string - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Article_internal_12 --> -52($fp) - # local_print_at_Article_internal_12 = SELF - sw $s1, -52($fp) - # RETURN local_print_at_Article_internal_12 - lw $v0, -52($fp) - # Deallocate stack frame for function function_print_at_Article. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 60 - jr $ra - # Function END - - -# function_isNil_at_BookList implementation. -# @Params: -function_isNil_at_BookList: - # Allocate stack frame for function function_isNil_at_BookList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_BookList_internal_2 --> -12($fp) - # local_isNil_at_BookList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_isNil_at_BookList_internal_0 --> -4($fp) - # LOCAL local_isNil_at_BookList_internal_2 --> -12($fp) - # local_isNil_at_BookList_internal_0 = local_isNil_at_BookList_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_isNil_at_BookList_internal_0 --> -4($fp) - # LOCAL local_isNil_at_BookList_internal_1 --> -8($fp) - # local_isNil_at_BookList_internal_1 = VCALL local_isNil_at_BookList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN 1 - li $v0, 1 - # Deallocate stack frame for function function_isNil_at_BookList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cons_at_BookList implementation. -# @Params: -# 0($fp) = param_cons_at_BookList_hd_0 -function_cons_at_BookList: - # Allocate stack frame for function function_cons_at_BookList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) - # local_cons_at_BookList_new_cell_0 = ALLOCATE Cons - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - la $t3, Cons - sw $t3, 8($v0) - li $t3, 4 - sw $t3, 12($v0) - move $t3, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Cons_start - sw $t3, 4($v0) + # Allocating string for type Bool + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Bool + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) move $t2, $v0 - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Cons__attrib__xcar__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 8($t2) - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Cons__attrib__xcdr__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t2) - sw $t2, -4($fp) - # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) - # local_cons_at_BookList_internal_1 = ALLOCATE Cons - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - la $t4, Cons - sw $t4, 8($v0) - li $t4, 4 - sw $t4, 12($v0) - move $t4, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, Cons_start - sw $t4, 4($v0) - move $t3, $v0 - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Cons__attrib__xcar__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 8($t3) - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Cons__attrib__xcdr__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t3) - sw $t3, -8($fp) - # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) - # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) - # local_cons_at_BookList_new_cell_0 = local_cons_at_BookList_internal_1 - lw $t3, -8($fp) - sw $t3, -4($fp) - # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) - # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) - # local_cons_at_BookList_internal_2 = local_cons_at_BookList_new_cell_0 - lw $t3, -4($fp) - sw $t3, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cons_at_BookList_hd_0 - # PARAM param_cons_at_BookList_hd_0 --> 0($fp) - lw $t3, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) - # local_cons_at_BookList_internal_4 = SELF - sw $s1, -20($fp) - # ARG local_cons_at_BookList_internal_4 - # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) - lw $t3, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) - # LOCAL local_cons_at_BookList_internal_3 --> -16($fp) - # local_cons_at_BookList_internal_3 = VCALL local_cons_at_BookList_internal_2 init - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 48($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_cons_at_BookList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_cons_at_BookList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_car_at_BookList implementation. -# @Params: -function_car_at_BookList: - # Allocate stack frame for function function_car_at_BookList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_car_at_BookList_internal_2 --> -12($fp) - # local_car_at_BookList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_car_at_BookList_internal_0 --> -4($fp) - # LOCAL local_car_at_BookList_internal_2 --> -12($fp) - # local_car_at_BookList_internal_0 = local_car_at_BookList_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_car_at_BookList_internal_0 --> -4($fp) - # LOCAL local_car_at_BookList_internal_1 --> -8($fp) - # local_car_at_BookList_internal_1 = VCALL local_car_at_BookList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 0($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_car_at_BookList_internal_3 --> -16($fp) - # local_car_at_BookList_internal_3 = ALLOCATE Book - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string for type name - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) - la $t5, Book - sw $t5, 8($v0) - li $t5, 4 - sw $t5, 12($v0) - move $t5, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t5, 0($v0) - la $t5, Book_start - sw $t5, 4($v0) - move $t4, $v0 - # Push register t4 into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) - addu $sp, $sp, 4 - sw $v0, 8($t4) - # Push register t4 into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t4) - sw $t4, -16($fp) - # RETURN local_car_at_BookList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_car_at_BookList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cdr_at_BookList implementation. -# @Params: -function_cdr_at_BookList: - # Allocate stack frame for function function_cdr_at_BookList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_cdr_at_BookList_internal_2 --> -12($fp) - # local_cdr_at_BookList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_cdr_at_BookList_internal_0 --> -4($fp) - # LOCAL local_cdr_at_BookList_internal_2 --> -12($fp) - # local_cdr_at_BookList_internal_0 = local_cdr_at_BookList_internal_2 - lw $t4, -12($fp) - sw $t4, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_cdr_at_BookList_internal_0 --> -4($fp) - # LOCAL local_cdr_at_BookList_internal_1 --> -8($fp) - # local_cdr_at_BookList_internal_1 = VCALL local_cdr_at_BookList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t4, 4($s1) - # Get pointer to type's VTABLE - lw $t5, 0($t4) - # Get pointer to function address - lw $t6, 0($t5) - # Call function. Result is on $v0 - jalr $t6 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cdr_at_BookList_internal_3 --> -16($fp) - # local_cdr_at_BookList_internal_3 = ALLOCATE BookList - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string for type name - la $t6, String - sw $t6, 0($v0) - la $t6, String_start - sw $t6, 4($v0) - la $t6, BookList - sw $t6, 8($v0) - li $t6, 8 - sw $t6, 12($v0) - move $t6, $v0 - # Allocating 8 bytes of memory - li $a0, 8 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall - sw $t6, 0($v0) - la $t6, BookList_start - sw $t6, 4($v0) - move $t5, $v0 - sw $t5, -16($fp) - # RETURN local_cdr_at_BookList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_cdr_at_BookList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_print_list_at_BookList implementation. -# @Params: -function_print_list_at_BookList: - # Allocate stack frame for function function_print_list_at_BookList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_print_list_at_BookList_internal_2 --> -12($fp) - # local_print_list_at_BookList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_print_list_at_BookList_internal_0 --> -4($fp) - # LOCAL local_print_list_at_BookList_internal_2 --> -12($fp) - # local_print_list_at_BookList_internal_0 = local_print_list_at_BookList_internal_2 - lw $t5, -12($fp) - sw $t5, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_BookList_internal_0 --> -4($fp) - # LOCAL local_print_list_at_BookList_internal_1 --> -8($fp) - # local_print_list_at_BookList_internal_1 = VCALL local_print_list_at_BookList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t5, 4($s1) - # Get pointer to type's VTABLE - lw $t6, 0($t5) - # Get pointer to function address - lw $t7, 0($t6) - # Call function. Result is on $v0 - jalr $t7 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_list_at_BookList_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_print_list_at_BookList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Cons__attrib__xcar__init implementation. -# @Params: -__Cons__attrib__xcar__init: - # Allocate stack frame for function __Cons__attrib__xcar__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Cons__attrib__xcar__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Cons__attrib__xcdr__init implementation. -# @Params: -__Cons__attrib__xcdr__init: - # Allocate stack frame for function __Cons__attrib__xcdr__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Cons__attrib__xcdr__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_Cons implementation. -# @Params: -function_isNil_at_Cons: - # Allocate stack frame for function function_isNil_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function function_isNil_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_Cons implementation. -# @Params: -# 0($fp) = param_init_at_Cons_hd_0 -# 4($fp) = param_init_at_Cons_tl_1 -function_init_at_Cons: - # Allocate stack frame for function function_init_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_Cons_hd_0 --> 4($fp) - lw $t5, 4($fp) - sw $t5, 8($s1) - # - # PARAM param_init_at_Cons_tl_1 --> 0($fp) - lw $t5, 0($fp) - sw $t5, 12($s1) - # LOCAL local_init_at_Cons_internal_0 --> -4($fp) - # local_init_at_Cons_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_init_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_init_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_car_at_Cons implementation. -# @Params: -function_car_at_Cons: - # Allocate stack frame for function function_car_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_car_at_Cons_internal_0 = GETATTRIBUTE xcar Cons - # LOCAL local_car_at_Cons_internal_0 --> -4($fp) - lw $t5, 8($s1) - sw $t5, -4($fp) - # RETURN local_car_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_car_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cdr_at_Cons implementation. -# @Params: -function_cdr_at_Cons: - # Allocate stack frame for function function_cdr_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_cdr_at_Cons_internal_0 = GETATTRIBUTE xcdr Cons - # LOCAL local_cdr_at_Cons_internal_0 --> -4($fp) - lw $t5, 12($s1) - sw $t5, -4($fp) - # RETURN local_cdr_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_cdr_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_print_list_at_Cons implementation. -# @Params: -function_print_list_at_Cons: - # Allocate stack frame for function function_print_list_at_Cons. - subu $sp, $sp, 92 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 92 - # local_print_list_at_Cons_internal_2 = GETATTRIBUTE xcar Cons - # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) - lw $t5, 8($s1) - sw $t5, -12($fp) - # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) - # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) - # local_print_list_at_Cons_internal_0 = local_print_list_at_Cons_internal_2 - lw $t5, -12($fp) - sw $t5, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) - # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # local_print_list_at_Cons_internal_1 = VCALL local_print_list_at_Cons_internal_0 print - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t5, 4($s1) - # Get pointer to type's VTABLE - lw $t6, 0($t5) - # Get pointer to function address - lw $t7, 32($t6) - # Call function. Result is on $v0 - jalr $t7 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) - # local_print_list_at_Cons_internal_3 = TYPEOF local_print_list_at_Cons_internal_1 - lw $t5, -8($fp) - # Load pointer to type - lw $t6, 4($t5) - sw $t6, -16($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # local_print_list_at_Cons_internal_5 = 14 - li $t5, 14 - sw $t5, -24($fp) - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_7 = local_print_list_at_Cons_internal_5 - local_print_list_at_Cons_internal_6 - lw $t5, -24($fp) - lw $t6, -28($fp) - sub $t5, $t5, $t6 - sw $t5, -32($fp) - # IF_GREATER_ZERO local_print_list_at_Cons_internal_7 GOTO label_Not_min0_1 - # IF_GREATER_ZERO local_print_list_at_Cons_internal_7 GOTO label_Not_min0_1 - lw $t5, -32($fp) - bgt $t5, 0, label_Not_min0_1 - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_6 - lw $t5, -28($fp) - sw $t5, -24($fp) - label_Not_min0_1: - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_7 = local_print_list_at_Cons_internal_5 - local_print_list_at_Cons_internal_6 - lw $t5, -24($fp) - lw $t6, -28($fp) - sub $t5, $t5, $t6 - sw $t5, -32($fp) - # IF_GREATER_ZERO local_print_list_at_Cons_internal_7 GOTO label_Not_min1_2 - # IF_GREATER_ZERO local_print_list_at_Cons_internal_7 GOTO label_Not_min1_2 - lw $t5, -32($fp) - bgt $t5, 0, label_Not_min1_2 - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_6 - lw $t5, -28($fp) - sw $t5, -24($fp) - label_Not_min1_2: - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_6 = 14 - li $t5, 14 - sw $t5, -28($fp) - # LOCAL local_print_list_at_Cons_internal_4 --> -20($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # local_print_list_at_Cons_internal_4 = local_print_list_at_Cons_internal_6 - local_print_list_at_Cons_internal_5 - lw $t5, -28($fp) - lw $t6, -24($fp) - sub $t5, $t5, $t6 - sw $t5, -20($fp) - # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 - # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 - lw $t5, -20($fp) - beq $t5, 0, label_ERROR_3 - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_7 = local_print_list_at_Cons_internal_5 - local_print_list_at_Cons_internal_6 - lw $t5, -24($fp) - lw $t6, -28($fp) - sub $t5, $t5, $t6 - sw $t5, -32($fp) - # - # - lw $t5, -32($fp) - bne $t5, 0, label_NEXT0_5 - # LOCAL local_print_list_at_Cons_dummy_8 --> -36($fp) - # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # local_print_list_at_Cons_dummy_8 = local_print_list_at_Cons_internal_1 - lw $t5, -8($fp) - sw $t5, -36($fp) - # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) - # local_print_list_at_Cons_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) - # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) - # local_print_list_at_Cons_internal_9 = local_print_list_at_Cons_internal_11 - lw $t5, -48($fp) - sw $t5, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Cons_internal_12 --> -52($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) - la $t5, data_8 - sw $t5, 8($v0) - li $t5, 27 - sw $t5, 12($v0) - sw $v0, -52($fp) - # ARG local_print_list_at_Cons_internal_12 - # LOCAL local_print_list_at_Cons_internal_12 --> -52($fp) - lw $t5, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t5, 0($sp) - # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) - # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) - # local_print_list_at_Cons_internal_10 = VCALL local_print_list_at_Cons_internal_9 out_string - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t5, 4($s1) - # Get pointer to type's VTABLE - lw $t6, 0($t5) - # Get pointer to function address - lw $t7, 12($t6) - # Call function. Result is on $v0 - jalr $t7 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # GOTO label_END_4 -j label_END_4 -label_NEXT0_5: - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_7 = local_print_list_at_Cons_internal_5 - local_print_list_at_Cons_internal_6 - lw $t5, -24($fp) - lw $t6, -28($fp) - sub $t5, $t5, $t6 - sw $t5, -32($fp) - # - # - lw $t5, -32($fp) - bne $t5, 0, label_NEXT1_6 - # LOCAL local_print_list_at_Cons_dummy_13 --> -56($fp) - # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # local_print_list_at_Cons_dummy_13 = local_print_list_at_Cons_internal_1 - lw $t5, -8($fp) - sw $t5, -56($fp) - # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) - # local_print_list_at_Cons_internal_16 = SELF - sw $s1, -68($fp) - # LOCAL local_print_list_at_Cons_internal_14 --> -60($fp) - # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) - # local_print_list_at_Cons_internal_14 = local_print_list_at_Cons_internal_16 - lw $t5, -68($fp) - sw $t5, -60($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) - # Allocating 16 bytes of memory - li $a0, 16 + sw $t2, 0($v0) + la $t2, Bool_start + sw $t2, 4($v0) + li $t2, 0 + sw $t2, 8($v0) + sw $v0, -60($fp) + # GOTO label_END_2 +j label_END_2 +label_TRUE_1: + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall - # Allocating string - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) - la $t5, data_9 - sw $t5, 8($v0) - li $t5, 30 - sw $t5, 12($v0) - sw $v0, -72($fp) - # ARG local_print_list_at_Cons_internal_17 - # LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) - lw $t5, -72($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t5, 0($sp) - # LOCAL local_print_list_at_Cons_internal_14 --> -60($fp) - # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) - # local_print_list_at_Cons_internal_15 = VCALL local_print_list_at_Cons_internal_14 out_string - # Save new self pointer in $s1 - lw $s1, -60($fp) - # Get pointer to type - lw $t5, 4($s1) - # Get pointer to type's VTABLE - lw $t6, 0($t5) - # Get pointer to function address - lw $t7, 12($t6) - # Call function. Result is on $v0 - jalr $t7 - sw $v0, -64($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # GOTO label_END_4 -j label_END_4 -label_NEXT1_6: - label_ERROR_3: - label_END_4: -# local_print_list_at_Cons_internal_20 = GETATTRIBUTE xcdr Cons -# LOCAL local_print_list_at_Cons_internal_20 --> -84($fp) -lw $t5, 12($s1) -sw $t5, -84($fp) -# LOCAL local_print_list_at_Cons_internal_18 --> -76($fp) -# LOCAL local_print_list_at_Cons_internal_20 --> -84($fp) -# local_print_list_at_Cons_internal_18 = local_print_list_at_Cons_internal_20 -lw $t5, -84($fp) -sw $t5, -76($fp) + # Allocating string for type Bool + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Bool + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Bool_start + sw $t2, 4($v0) + li $t2, 1 + sw $t2, 8($v0) + sw $v0, -60($fp) + label_END_2: +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 +lw $t2, -60($fp) +sw $t2, -52($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 type_name +# Save new self pointer in $s1 +lw $s1, -52($fp) +# Get pointer to type +lw $t2, 4($s1) +# Get pointer to type's VTABLE +lw $t3, 0($t2) +# Get pointer to function address +lw $t4, 4($t3) +# Call function. Result is on $v0 +jalr $t4 +sw $v0, -56($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_10 --> -44($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_10 = local_main_at_Main_internal_13 +lw $t2, -56($fp) +sw $t2, -44($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_print_list_at_Cons_internal_18 --> -76($fp) -# LOCAL local_print_list_at_Cons_internal_19 --> -80($fp) -# local_print_list_at_Cons_internal_19 = VCALL local_print_list_at_Cons_internal_18 print_list +# ARG 1 +li $t2, 1 +# Push arg into stack +subu $sp, $sp, 4 +sw $t2, 0($sp) +# ARG 3 +li $t2, 3 +# Push arg into stack +subu $sp, $sp, 4 +sw $t2, 0($sp) +# LOCAL local_main_at_Main_internal_10 --> -44($fp) +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +# local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 substr +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t2, 4($s1) +# Get pointer to type's VTABLE +lw $t3, 0($t2) +# Get pointer to function address +lw $t4, 4($t3) +# Call function. Result is on $v0 +jalr $t4 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_11 +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +lw $t2, -48($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t2, 0($sp) +# LOCAL local_main_at_Main_internal_0 --> -4($fp) +# LOCAL local_main_at_Main_internal_1 --> -8($fp) +# local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string # Save new self pointer in $s1 -lw $s1, -76($fp) +lw $s1, -4($fp) # Get pointer to type -lw $t5, 4($s1) +lw $t2, 4($s1) # Get pointer to type's VTABLE -lw $t6, 0($t5) +lw $t3, 0($t2) # Get pointer to function address -lw $t7, 44($t6) +lw $t4, 12($t3) # Call function. Result is on $v0 -jalr $t7 +jalr $t4 +sw $v0, -8($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# local_main_at_Main_internal_18 = SELF +sw $s1, -76($fp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# local_main_at_Main_internal_16 = local_main_at_Main_internal_18 +lw $t2, -76($fp) +sw $t2, -68($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t2, String +sw $t2, 0($v0) +la $t2, String_start +sw $t2, 4($v0) +# Load type offset +li $t2, 8 +sw $t2, 8($v0) +la $t2, data_2 +sw $t2, 12($v0) +li $t2, 2 +sw $t2, 16($v0) sw $v0, -80($fp) +# ARG local_main_at_Main_internal_19 +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +lw $t2, -80($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t2, 0($sp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +# local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string +# Save new self pointer in $s1 +lw $s1, -68($fp) +# Get pointer to type +lw $t2, 4($s1) +# Get pointer to type's VTABLE +lw $t3, 0($t2) +# Get pointer to function address +lw $t4, 12($t3) +# Call function. Result is on $v0 +jalr $t4 +sw $v0, -72($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# RETURN local_print_list_at_Cons_internal_19 -lw $v0, -80($fp) -# Deallocate stack frame for function function_print_list_at_Cons. +# RETURN local_main_at_Main_internal_17 +lw $v0, -72($fp) +# Deallocate stack frame for function function_main_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 92 +addu $sp, $sp, 88 jr $ra # Function END -# function_isNil_at_Nil implementation. -# @Params: -function_isNil_at_Nil: - # Allocate stack frame for function function_isNil_at_Nil. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 1 - li $v0, 1 - # Deallocate stack frame for function function_isNil_at_Nil. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_print_list_at_Nil implementation. -# @Params: -function_print_list_at_Nil: - # Allocate stack frame for function function_print_list_at_Nil. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 1 - li $v0, 1 - # Deallocate stack frame for function function_print_list_at_Nil. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__books__init implementation. -# @Params: -__Main__attrib__books__init: - # Allocate stack frame for function __Main__attrib__books__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Main__attrib__books__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 92 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 92 - # LOCAL local_main_at_Main_a_book_0 --> -4($fp) - # local_main_at_Main_a_book_0 = ALLOCATE Book - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string for type name - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) - la $t7, Book - sw $t7, 8($v0) - li $t7, 4 - sw $t7, 12($v0) - move $t7, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t7, 0($v0) - la $t7, Book_start - sw $t7, 4($v0) - move $t6, $v0 - # Push register t6 into stack - subu $sp, $sp, 4 - sw $t6, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) - addu $sp, $sp, 4 - sw $v0, 8($t6) - # Push register t6 into stack - subu $sp, $sp, 4 - sw $t6, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t6) - sw $t6, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = ALLOCATE Book - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string for type name - la $t8, String - sw $t8, 0($v0) - la $t8, String_start - sw $t8, 4($v0) - la $t8, Book - sw $t8, 8($v0) - li $t8, 4 - sw $t8, 12($v0) - move $t8, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t8, 0($v0) - la $t8, Book_start - sw $t8, 4($v0) - move $t7, $v0 - # Push register t7 into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) - addu $sp, $sp, 4 - sw $v0, 8($t7) - # Push register t7 into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t7) - sw $t7, -16($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t7, -16($fp) - sw $t7, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) - la $t7, data_10 - sw $t7, 8($v0) - li $t7, 44 - sw $t7, 12($v0) - sw $v0, -20($fp) - # ARG local_main_at_Main_internal_4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - lw $t7, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) - la $t7, data_11 - sw $t7, 8($v0) - li $t7, 22 - sw $t7, 12($v0) - sw $v0, -24($fp) - # ARG local_main_at_Main_internal_5 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - lw $t7, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 initBook - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t7, 4($s1) - # Get pointer to type's VTABLE - lw $t8, 0($t7) - # Get pointer to function address - lw $t9, 28($t8) - # Call function. Result is on $v0 - jalr $t9 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_a_book_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_a_book_0 = local_main_at_Main_internal_2 - lw $t7, -12($fp) - sw $t7, -4($fp) - # LOCAL local_main_at_Main_an_article_6 --> -28($fp) - # local_main_at_Main_an_article_6 = ALLOCATE Article - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string for type name - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) - la $t9, Article - sw $t9, 8($v0) - li $t9, 7 - sw $t9, 12($v0) - move $t9, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t9, 0($v0) - la $t9, Article_start - sw $t9, 4($v0) - move $t8, $v0 - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 8($t8) - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t8) - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Article__attrib__per_title__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t8) - sw $t8, -28($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = ALLOCATE Article - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string for type name - la $s2, String - sw $s2, 0($v0) - la $s2, String_start - sw $s2, 4($v0) - la $s2, Article - sw $s2, 8($v0) - li $s2, 7 - sw $s2, 12($v0) - move $s2, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $s2, 0($v0) - la $s2, Article_start - sw $s2, 4($v0) - move $t9, $v0 - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 8($t9) - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t9) - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Article__attrib__per_title__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t9) - sw $t9, -40($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t9, -40($fp) - sw $t9, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) - la $t9, data_12 - sw $t9, 8($v0) - li $t9, 19 - sw $t9, 12($v0) - sw $v0, -44($fp) - # ARG local_main_at_Main_internal_10 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - lw $t9, -44($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) - la $t9, data_13 - sw $t9, 8($v0) - li $t9, 7 - sw $t9, 12($v0) - sw $v0, -48($fp) - # ARG local_main_at_Main_internal_11 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - lw $t9, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) - la $t9, data_14 - sw $t9, 8($v0) - li $t9, 11 - sw $t9, 12($v0) - sw $v0, -52($fp) - # ARG local_main_at_Main_internal_12 - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - lw $t9, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 initArticle - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t9, 4($s1) - # Get pointer to type's VTABLE - lw $s2, 0($t9) - # Get pointer to function address - lw $s3, 36($s2) - # Call function. Result is on $v0 - jalr $s3 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_an_article_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_an_article_6 = local_main_at_Main_internal_8 - lw $t9, -36($fp) - sw $t9, -28($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = ALLOCATE Nil - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - # Allocating string for type name - la $s3, String - sw $s3, 0($v0) - la $s3, String_start - sw $s3, 4($v0) - la $s3, Nil - sw $s3, 8($v0) - li $s3, 3 - sw $s3, 12($v0) - move $s3, $v0 - # Allocating 8 bytes of memory - li $a0, 8 - li $v0, 9 - syscall - sw $s3, 0($v0) - la $s3, Nil_start - sw $s3, 4($v0) - move $s2, $v0 - sw $s2, -72($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 - lw $s2, -72($fp) - sw $s2, -64($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_main_at_Main_a_book_0 - # LOCAL local_main_at_Main_a_book_0 --> -4($fp) - lw $s2, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $s2, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 cons - # Save new self pointer in $s1 - lw $s1, -64($fp) - # Get pointer to type - lw $s2, 4($s1) - # Get pointer to type's VTABLE - lw $s3, 0($s2) - # Get pointer to function address - lw $s4, 32($s3) - # Call function. Result is on $v0 - jalr $s4 - sw $v0, -68($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_13 = local_main_at_Main_internal_16 - lw $s2, -68($fp) - sw $s2, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_main_at_Main_an_article_6 - # LOCAL local_main_at_Main_an_article_6 --> -28($fp) - lw $s2, -28($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $s2, 0($sp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 cons - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $s2, 4($s1) - # Get pointer to type's VTABLE - lw $s3, 0($s2) - # Get pointer to function address - lw $s4, 32($s3) - # Call function. Result is on $v0 - jalr $s4 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - lw $s2, -60($fp) - sw $s2, 8($s1) - # local_main_at_Main_internal_20 = GETATTRIBUTE books Main - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - lw $s2, 8($s1) - sw $s2, -84($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 - lw $s2, -84($fp) - sw $s2, -76($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 print_list - # Save new self pointer in $s1 - lw $s1, -76($fp) - # Get pointer to type - lw $s2, 4($s1) - # Get pointer to type's VTABLE - lw $s3, 0($s2) - # Get pointer to function address - lw $s4, 44($s3) - # Call function. Result is on $v0 - jalr $s4 - sw $v0, -80($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_19 - lw $v0, -80($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 92 - jr $ra - # Function END - - diff --git a/src/testing.py b/src/testing.py index 08133765..5440ff88 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,136 +60,13 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""-- example of static and dynamic type differing for a dispatch - -Class Book inherits IO { - title : String; - author : String; - - initBook(title_p : String, author_p : String) : Book { - { - title <- title_p; - author <- author_p; - self; - } - }; - - print() : Book { - { - out_string("title: ").out_string(title).out_string("\n"); - out_string("author: ").out_string(author).out_string("\n"); - self; - } - }; -}; - -Class Article inherits Book { - per_title : String; - - initArticle(title_p : String, author_p : String, - per_title_p : String) : Article { - { - initBook(title_p, author_p); - per_title <- per_title_p; - self; - } - }; - - print() : Book { - { - self@Book.print(); - out_string("periodical: ").out_string(per_title).out_string("\n"); - self; - } - }; -}; - -Class BookList inherits IO { - (* Since abort "returns" type Object, we have to add - an expression of type Bool here to satisfy the typechecker. - This code is unreachable, since abort() halts the program. - *) - isNil() : Bool { { abort(); true; } }; - - cons(hd : Book) : Cons { - (let new_cell : Cons <- new Cons in - new_cell.init(hd,self) - ) - }; - - (* Since abort "returns" type Object, we have to add - an expression of type Book here to satisfy the typechecker. - This code is unreachable, since abort() halts the program. - *) - car() : Book { { abort(); new Book; } }; - - (* Since abort "returns" type Object, we have to add - an expression of type BookList here to satisfy the typechecker. - This code is unreachable, since abort() halts the program. - *) - cdr() : BookList { { abort(); new BookList; } }; - - print_list() : Object { abort() }; -}; - -Class Cons inherits BookList { - xcar : Book; -- We keep the car and cdr in attributes. - xcdr : BookList; -- Because methods and features must have different names, - -- we use xcar and xcdr for the attributes and reserve - -- car and cdr for the features. - - isNil() : Bool { false }; - - init(hd : Book, tl : BookList) : Cons { - { - xcar <- hd; - xcdr <- tl; - self; - } - }; - - car() : Book { xcar }; - - cdr() : BookList { xcdr }; - - print_list() : Object { - { - case xcar.print() of - dummy : Book => out_string("- dynamic type was Book -\n"); - dummy : Article => out_string("- dynamic type was Article -\n"); - esac; - xcdr.print_list(); - } - }; -}; - -Class Nil inherits BookList { - isNil() : Bool { true }; - - print_list() : Object { true }; -}; - - -Class Main { - - books : BookList; - - main() : Object { - (let a_book : Book <- - (new Book).initBook("Compilers, Principles, Techniques, and Tools", - "Aho, Sethi, and Ullman") - in - (let an_article : Article <- - (new Article).initArticle("The Top 100 CD_ROMs", - "Ulanoff", - "PC Magazine") - in - { - books <- (new Nil).cons(a_book).cons(an_article); - books.print_list(); - } - ) -- end let an_article - ) -- end let a_book +text = r"""class Main inherits IO { + main() : IO { + { + out_string((new Object).type_name().substr(4,1)). + out_string((isvoid self).type_name().substr(1,3)); -- demonstrates the dispatch rules. + out_string("\n"); + } }; }; diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 2f569cc1..3eaeb844 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -137,10 +137,15 @@ def _(self, node: cil.DataNode): # en caso de que tipo1 sea ancestro de tipo2, -1 en otro caso. Para hacerla accesible en O(1) # podemos representarlas como la concatenacion de los nombres de tipo1 y tipo2 (Al final en cada # programa los tipos son unicos). - for (type1, type2), distance in node.value.items(): - self.register_instruction( - FixedData(f"__{type1}_{type2}_tdt_entry__", distance) + # for (type1, type2), distance in node.value.items(): + # self.register_instruction( + # FixedData(f"__{type1}_{type2}_tdt_entry__", distance) + # ) + for t1 in self.mips_types: + array = ", ".join( + str(x) for x in [node.value[t1, t] for t in self.mips_types] ) + self.register_instruction(FixedData(f"{t1}__TDT", array)) elif isinstance(node.value, int): self.register_instruction(FixedData(node.name, node.value)) @@ -337,7 +342,7 @@ def _(self, node: AllocateBoolNode): dest = self.visit(node.dest) assert dest is not None - size = 16 + size = 20 # Reservar memoria para el tipo self.allocate_memory(size) @@ -354,12 +359,18 @@ def _(self, node: AllocateBoolNode): self.register_instruction(LA(reg, "String_start")) self.register_instruction(SW(reg, "4($v0)")) - self.register_instruction(LA(reg, "Bool")) + # Cargar el offset del tipo + self.comment("Load type offset") + offset = next(i for i, t in enumerate(self.mips_types) if t == "String") * 4 + self.register_instruction(LI(reg, offset)) self.register_instruction(SW(reg, "8($v0)")) - self.register_instruction(LI(reg, 4)) + self.register_instruction(LA(reg, "Bool")) self.register_instruction(SW(reg, "12($v0)")) + self.register_instruction(LI(reg, 4)) + self.register_instruction(SW(reg, "16($v0)")) + # devolver la instancia self.register_instruction(MOVE(reg, v0)) @@ -381,14 +392,12 @@ def _(self, node: AllocateBoolNode): self.used_registers[reg] = False - - @visit.register def _(self, node: cil.AllocateStringNode): dest = self.visit(node.dest) assert dest is not None - size = 16 + size = 20 # Reservar memoria para el tipo self.allocate_memory(size) @@ -405,12 +414,18 @@ def _(self, node: cil.AllocateStringNode): self.register_instruction(LA(reg, "String_start")) self.register_instruction(SW(reg, "4($v0)")) - self.register_instruction(LA(reg, node.value.name)) + # Cargar el offset del tipo + self.comment("Load type offset") + offset = next(i for i, t in enumerate(self.mips_types) if t == "String") * 4 + self.register_instruction(LI(reg, offset)) self.register_instruction(SW(reg, "8($v0)")) - self.register_instruction(LI(reg, node.length)) + self.register_instruction(LA(reg, node.value.name)) self.register_instruction(SW(reg, "12($v0)")) + self.register_instruction(LI(reg, node.length)) + self.register_instruction(SW(reg, "16($v0)")) + # devolver la instancia self.register_instruction(SW(v0, dest)) @@ -437,7 +452,7 @@ def _(self, node: cil.AllocateNode): # ... # ################################# - num_bytes = 8 # inicialmente necesita al menos dos punteros + num_bytes = 12 # inicialmente necesita al menos 3 punteros dest = self.visit(node.dest) instance_type = node.itype @@ -448,8 +463,6 @@ def _(self, node: cil.AllocateNode): num_bytes += len(instance_type.attributes) * 4 - - reg = self.get_available_register() temp = self.get_available_register() assert reg is not None and temp is not None, "Out of registers." @@ -459,7 +472,7 @@ def _(self, node: cil.AllocateNode): # Crear el string referente al nombre del tipo length = len(instance_type.name) - size = 16 + size = 20 # Reservar memoria para el tipo self.allocate_memory(size) @@ -476,12 +489,18 @@ def _(self, node: cil.AllocateNode): self.register_instruction(LA(reg, "String_start")) self.register_instruction(SW(reg, "4($v0)")) - self.register_instruction(LA(reg, instance_type.name)) + # Cargar el offset del tipo + self.comment("Load type offset") + offset = next(i for i, t in enumerate(self.mips_types) if t == "String") * 4 + self.register_instruction(LI(reg, offset)) self.register_instruction(SW(reg, "8($v0)")) - self.register_instruction(LI(reg, length)) + self.register_instruction(LA(reg, instance_type.name)) self.register_instruction(SW(reg, "12($v0)")) + self.register_instruction(LI(reg, length)) + self.register_instruction(SW(reg, "16($v0)")) + self.register_instruction(MOVE(reg, v0)) # Reservar memoria para la instancia @@ -494,6 +513,15 @@ def _(self, node: cil.AllocateNode): self.register_instruction(LA(dest=reg, src=f"{instance_type.name}_start")) self.register_instruction(SW(dest=reg, src="4($v0)")) + # Cargar el offset del tipo + self.comment("Load type offset") + offset = ( + next(i for i, t in enumerate(self.mips_types) if t == instance_type.name) + * 4 + ) + self.register_instruction(LI(reg, offset)) + self.register_instruction(SW(reg, "8($v0)")) + self.register_instruction(MOVE(temp, v0)) # Los atributos comienzan en el indice 8($v0) @@ -511,7 +539,7 @@ def _(self, node: cil.AllocateNode): self.pop_register(temp) # El valor de retorno viene en v0 self.register_instruction( - SW(dest=v0, src=f"{8 + i*4}(${REG_TO_STR[temp]})") + SW(dest=v0, src=f"{12 + i*4}(${REG_TO_STR[temp]})") ) # mover la direccion que almacena la instancia hacia dest @@ -521,7 +549,7 @@ def _(self, node: cil.AllocateNode): self.used_registers[temp] = False @visit.register - def _(self, node: cil.TypeOfNode): + def _(self, node: cil.TypeOffsetNode): local_addr = self.visit(node.variable) return_addr = self.visit(node.dest) reg = self.get_available_register() @@ -533,8 +561,8 @@ def _(self, node: cil.TypeOfNode): self.add_source_line_comment(node) self.register_instruction(LW(reg, local_addr)) - self.comment("Load pointer to type") - self.register_instruction(LW(reg2, f"4(${REG_TO_STR[reg]})")) + self.comment("Load pointer to type offset") + self.register_instruction(LW(reg2, f"8(${REG_TO_STR[reg]})")) self.register_instruction(SW(reg2, return_addr)) self.used_registers[reg] = False @@ -735,7 +763,7 @@ def _(self, node: cil.SubstringNode): assert size_reg is not None # Cargar el string sobre el que se llama substr - self.register_instruction(LW(reg, "8($s1)")) + self.register_instruction(LW(reg, "12($s1)")) # Hacer que reg apunte al inicio del substr if isinstance(l, int): @@ -781,7 +809,7 @@ def _(self, node: cil.SubstringNode): # v0 contiene el substr self.register_instruction(MOVE(reg2, v0)) # Crear la instancia de str - size = 16 + size = 20 # Reservar memoria para el tipo self.allocate_memory(size) @@ -795,10 +823,16 @@ def _(self, node: cil.SubstringNode): self.register_instruction(LA(reg, "String_start")) self.register_instruction(SW(reg, "4($v0)")) + # Cargar el offset del tipo + self.comment("Load type offset") + offset = next(i for i, t in enumerate(self.mips_types) if t == "String") * 4 + self.register_instruction(LI(reg, offset)) + self.register_instruction(SW(reg, "8($v0)")) + # Copiar el str en v0 al atributo value de la instancia - self.register_instruction(SW(reg2, "8($v0)")) + self.register_instruction(SW(reg2, "12($v0)")) - self.register_instruction(SW(size_reg, "12($v0)")) + self.register_instruction(SW(size_reg, "16($v0)")) # devolver la instancia self.register_instruction(SW(v0, dest)) @@ -833,12 +867,12 @@ def _(self, node: ConcatString): # Get Strings length self.comment("Get first string length from self") - self.register_instruction(LW(reg, f"12($s1)")) + self.register_instruction(LW(reg, f"16($s1)")) # Obtener el segundo string self.comment("Get second string length from param") self.register_instruction(LW(v0, s)) - self.register_instruction(LW(reg2, "12($v0)")) + self.register_instruction(LW(reg2, "16($v0)")) self.comment("Save new string length in a0 for memory allocation") self.register_instruction(ADDU(a0, reg, reg2)) @@ -846,11 +880,11 @@ def _(self, node: ConcatString): # Obtener el primer string desde self self.comment("Get first string from self") - self.register_instruction(LW(reg, f"8($s1)")) + self.register_instruction(LW(reg, f"12($s1)")) # Obtener el segundo string self.comment("Get second string from param") - self.register_instruction(LW(reg2, "8($v0)")) + self.register_instruction(LW(reg2, "12($v0)")) # Reservar memoria para el nuevo buffer # $v0 = 9 (syscall 9 = sbrk) @@ -863,7 +897,7 @@ def _(self, node: ConcatString): # Hacer 0 el registro byte self.register_instruction(MOVE(byte, zero)) - + # while [reg] != 0: copy to temp self.register_instruction(Label("concat_loop1")) self.comment(f"Compare {REG_TO_STR[reg]} with \\0") @@ -875,7 +909,7 @@ def _(self, node: ConcatString): self.register_instruction(ADDU(temp, temp, 1, True)) self.register_instruction(ADDU(reg, reg, 1, True)) self.register_instruction(J("concat_loop1")) - + self.register_instruction(Label("concat_loop1_end")) # Copiar el segundo string @@ -891,7 +925,7 @@ def _(self, node: ConcatString): self.register_instruction(ADDU(temp, temp, 1, True)) self.register_instruction(ADDU(reg2, reg2, 1, True)) self.register_instruction(J("concat_loop2")) - + self.register_instruction(Label("concat_loop2_end")) # Agregar el caracter null al final self.register_instruction(SB(zero, f"0(${REG_TO_STR[temp]})")) @@ -901,7 +935,7 @@ def _(self, node: ConcatString): self.register_instruction(MOVE(reg2, v0)) # Crear la instancia de str - size = 16 + size = 20 # Reservar memoria para el tipo self.allocate_memory(size) @@ -915,10 +949,16 @@ def _(self, node: ConcatString): self.register_instruction(LA(reg, "String_start")) self.register_instruction(SW(reg, "4($v0)")) + # Cargar el offset del tipo + self.comment("Load type offset") + offset = next(i for i, t in enumerate(self.mips_types) if t == "String") * 4 + self.register_instruction(LI(reg, offset)) + self.register_instruction(SW(reg, "8($v0)")) + # Copiar el str en v0 al atributo value de la instancia - self.register_instruction(SW(reg2, "8($v0)")) + self.register_instruction(SW(reg2, "12($v0)")) - self.register_instruction(SW(size_reg, "12($v0)")) + self.register_instruction(SW(size_reg, "16($v0)")) # devolver la instancia self.register_instruction(SW(v0, dest)) @@ -929,8 +969,6 @@ def _(self, node: ConcatString): self.used_registers[size_reg] = False self.used_registers[byte] = False - - @visit.register def _(self, node: AbortNode): self.register_instruction(LI(a0, 10)) @@ -994,7 +1032,7 @@ def _(self, node: cil.PrintNode): self.register_instruction(LW(v0, src)) # Cargar la direccion del string en a0 - self.register_instruction(LW(a0, "8($v0)")) + self.register_instruction(LW(a0, "12($v0)")) # syscall 4 = print_string self.register_instruction(LI(v0, 4)) self.register_instruction(SYSCALL()) diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 26e1e94d..1cec39cd 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -47,7 +47,7 @@ SubstringNode, TdtLookupNode, TypeNode, - TypeOfNode, + TypeOffsetNode, UnconditionalJump, ) from mips.branch import J @@ -410,7 +410,7 @@ def _(self, node: coolAst.CaseNode, scope: Scope): assert isinstance(expr_vm_holder, LocalNode) self.register_instruction( - TypeOfNode(expr_vm_holder, type_internal_local_holder) + TypeOffsetNode(expr_vm_holder, type_internal_local_holder) ) # Variables internas para almacenar resultados intermedios @@ -929,7 +929,7 @@ def _(self, node: AllocateNode) -> str: return f"{self.visit(node.dest)} = ALLOCATE {node.itype.name}" @visit.register - def _(self, node: TypeOfNode) -> str: + def _(self, node: TypeOffsetNode) -> str: return f"{self.visit(node.dest)} = TYPEOF {node.variable.name}" @visit.register diff --git a/tests/codegen/book_list.mips b/tests/codegen/book_list.mips new file mode 100644 index 00000000..445faa29 --- /dev/null +++ b/tests/codegen/book_list.mips @@ -0,0 +1,2825 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 11:25:30 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Book: .asciiz "Book" +# Function END +Article: .asciiz "Article" +# Function END +BookList: .asciiz "BookList" +# Function END +Cons: .asciiz "Cons" +# Function END +Nil: .asciiz "Nil" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Book **** +Book_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_initBook_at_Book, function_print_at_Book +# Function END +# + + +# **** Type RECORD for type Book **** +Book_start: + Book_vtable_pointer: .word Book_vtable + # Function END +Book_end: +# + + +# **** VTABLE for type Article **** +Article_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_initBook_at_Book, function_print_at_Article, function_initArticle_at_Article +# Function END +# + + +# **** Type RECORD for type Article **** +Article_start: + Article_vtable_pointer: .word Article_vtable + # Function END +Article_end: +# + + +# **** VTABLE for type BookList **** +BookList_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_BookList, function_cons_at_BookList, function_car_at_BookList, function_cdr_at_BookList, function_print_list_at_BookList +# Function END +# + + +# **** Type RECORD for type BookList **** +BookList_start: + BookList_vtable_pointer: .word BookList_vtable + # Function END +BookList_end: +# + + +# **** VTABLE for type Cons **** +Cons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_Cons, function_cons_at_BookList, function_car_at_Cons, function_cdr_at_Cons, function_print_list_at_Cons, function_init_at_Cons +# Function END +# + + +# **** Type RECORD for type Cons **** +Cons_start: + Cons_vtable_pointer: .word Cons_vtable + # Function END +Cons_end: +# + + +# **** VTABLE for type Nil **** +Nil_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_Nil, function_cons_at_BookList, function_car_at_BookList, function_cdr_at_BookList, function_print_list_at_Nil +# Function END +# + + +# **** Type RECORD for type Nil **** +Nil_start: + Nil_vtable_pointer: .word Nil_vtable + # Function END +Nil_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +IO__TDT: .word 0, -1, -1, -1, 1, 2, 1, 2, 2, -1 +Object__TDT: .word 1, 0, 1, 1, 2, 3, 2, 3, 3, 1 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 +Book__TDT: .word -1, -1, -1, -1, 0, 1, -1, -1, -1, -1 +Article__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1, -1 +BookList__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 1, -1 +Cons__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 +Nil__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 +# + + +data_2: .asciiz "title: " +# + + +data_3: .asciiz "\n" +# + + +data_4: .asciiz "author: " +# + + +data_5: .asciiz "\n" +# + + +data_6: .asciiz "periodical: " +# + + +data_7: .asciiz "\n" +# + + +data_8: .asciiz "- dynamic type was Book -\n" +# + + +data_9: .asciiz "- dynamic type was Article -\n" +# + + +data_10: .asciiz "Compilers, Principles, Techniques, and Tools" +# + + +data_11: .asciiz "Aho, Sethi, and Ullman" +# + + +data_12: .asciiz "The Top 100 CD_ROMs" +# + + +data_13: .asciiz "Ulanoff" +# + + +data_14: .asciiz "PC Magazine" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + li $a0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 36 + sw $t2, 8($v0) + move $t1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__books__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL function_main_at_Main + # LOCAL local__internal_1 --> -8($fp) + jal function_main_at_Main + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Book__attrib__title__init implementation. +# @Params: +__Book__attrib__title__init: + # Allocate stack frame for function __Book__attrib__title__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__title__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_0 + sw $t1, 12($v0) + li $t1, 0 + sw $t1, 16($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__title__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Book__attrib__title__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Book__attrib__author__init implementation. +# @Params: +__Book__attrib__author__init: + # Allocate stack frame for function __Book__attrib__author__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__author__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_0 + sw $t1, 12($v0) + li $t1, 0 + sw $t1, 16($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__author__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Book__attrib__author__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_initBook_at_Book implementation. +# @Params: +# 0($fp) = param_initBook_at_Book_title_p_0 +# 4($fp) = param_initBook_at_Book_author_p_1 +function_initBook_at_Book: + # Allocate stack frame for function function_initBook_at_Book. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_initBook_at_Book_title_p_0 --> 4($fp) + lw $t1, 4($fp) + sw $t1, 12($s1) + # + # PARAM param_initBook_at_Book_author_p_1 --> 0($fp) + lw $t1, 0($fp) + sw $t1, 16($s1) + # LOCAL local_initBook_at_Book_internal_0 --> -4($fp) + # local_initBook_at_Book_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_initBook_at_Book_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_initBook_at_Book. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_print_at_Book implementation. +# @Params: +function_print_at_Book: + # Allocate stack frame for function function_print_at_Book. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # LOCAL local_print_at_Book_internal_6 --> -28($fp) + # local_print_at_Book_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_print_at_Book_internal_4 --> -20($fp) + # LOCAL local_print_at_Book_internal_6 --> -28($fp) + # local_print_at_Book_internal_4 = local_print_at_Book_internal_6 + lw $t1, -28($fp) + sw $t1, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Book_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_2 + sw $t1, 12($v0) + li $t1, 12 + sw $t1, 16($v0) + sw $v0, -32($fp) + # ARG local_print_at_Book_internal_7 + # LOCAL local_print_at_Book_internal_7 --> -32($fp) + lw $t1, -32($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_4 --> -20($fp) + # LOCAL local_print_at_Book_internal_5 --> -24($fp) + # local_print_at_Book_internal_5 = VCALL local_print_at_Book_internal_4 out_string + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_2 --> -12($fp) + # LOCAL local_print_at_Book_internal_5 --> -24($fp) + # local_print_at_Book_internal_2 = local_print_at_Book_internal_5 + lw $t1, -24($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Book_internal_8 = GETATTRIBUTE title Book + # LOCAL local_print_at_Book_internal_8 --> -36($fp) + lw $t1, 12($s1) + sw $t1, -36($fp) + # ARG local_print_at_Book_internal_8 + # LOCAL local_print_at_Book_internal_8 --> -36($fp) + lw $t1, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_2 --> -12($fp) + # LOCAL local_print_at_Book_internal_3 --> -16($fp) + # local_print_at_Book_internal_3 = VCALL local_print_at_Book_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_0 --> -4($fp) + # LOCAL local_print_at_Book_internal_3 --> -16($fp) + # local_print_at_Book_internal_0 = local_print_at_Book_internal_3 + lw $t1, -16($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Book_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_3 + sw $t1, 12($v0) + li $t1, 2 + sw $t1, 16($v0) + sw $v0, -40($fp) + # ARG local_print_at_Book_internal_9 + # LOCAL local_print_at_Book_internal_9 --> -40($fp) + lw $t1, -40($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_0 --> -4($fp) + # LOCAL local_print_at_Book_internal_1 --> -8($fp) + # local_print_at_Book_internal_1 = VCALL local_print_at_Book_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_16 --> -68($fp) + # local_print_at_Book_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_print_at_Book_internal_14 --> -60($fp) + # LOCAL local_print_at_Book_internal_16 --> -68($fp) + # local_print_at_Book_internal_14 = local_print_at_Book_internal_16 + lw $t1, -68($fp) + sw $t1, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Book_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_4 + sw $t1, 12($v0) + li $t1, 12 + sw $t1, 16($v0) + sw $v0, -72($fp) + # ARG local_print_at_Book_internal_17 + # LOCAL local_print_at_Book_internal_17 --> -72($fp) + lw $t1, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_14 --> -60($fp) + # LOCAL local_print_at_Book_internal_15 --> -64($fp) + # local_print_at_Book_internal_15 = VCALL local_print_at_Book_internal_14 out_string + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_12 --> -52($fp) + # LOCAL local_print_at_Book_internal_15 --> -64($fp) + # local_print_at_Book_internal_12 = local_print_at_Book_internal_15 + lw $t1, -64($fp) + sw $t1, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Book_internal_18 = GETATTRIBUTE author Book + # LOCAL local_print_at_Book_internal_18 --> -76($fp) + lw $t1, 16($s1) + sw $t1, -76($fp) + # ARG local_print_at_Book_internal_18 + # LOCAL local_print_at_Book_internal_18 --> -76($fp) + lw $t1, -76($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_12 --> -52($fp) + # LOCAL local_print_at_Book_internal_13 --> -56($fp) + # local_print_at_Book_internal_13 = VCALL local_print_at_Book_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_10 --> -44($fp) + # LOCAL local_print_at_Book_internal_13 --> -56($fp) + # local_print_at_Book_internal_10 = local_print_at_Book_internal_13 + lw $t1, -56($fp) + sw $t1, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Book_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_5 + sw $t1, 12($v0) + li $t1, 2 + sw $t1, 16($v0) + sw $v0, -80($fp) + # ARG local_print_at_Book_internal_19 + # LOCAL local_print_at_Book_internal_19 --> -80($fp) + lw $t1, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_10 --> -44($fp) + # LOCAL local_print_at_Book_internal_11 --> -48($fp) + # local_print_at_Book_internal_11 = VCALL local_print_at_Book_internal_10 out_string + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_20 --> -84($fp) + # local_print_at_Book_internal_20 = SELF + sw $s1, -84($fp) + # RETURN local_print_at_Book_internal_20 + lw $v0, -84($fp) + # Deallocate stack frame for function function_print_at_Book. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 92 + jr $ra + # Function END + + +# __Article__attrib__per_title__init implementation. +# @Params: +__Article__attrib__per_title__init: + # Allocate stack frame for function __Article__attrib__per_title__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local___attrib__per_title__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_0 + sw $t1, 12($v0) + li $t1, 0 + sw $t1, 16($v0) + sw $v0, -4($fp) + # RETURN local___attrib__per_title__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Article__attrib__per_title__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_initArticle_at_Article implementation. +# @Params: +# 0($fp) = param_initArticle_at_Article_title_p_0 +# 4($fp) = param_initArticle_at_Article_author_p_1 +# 8($fp) = param_initArticle_at_Article_per_title_p_2 +function_initArticle_at_Article: + # Allocate stack frame for function function_initArticle_at_Article. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) + # local_initArticle_at_Article_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) + # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) + # local_initArticle_at_Article_internal_0 = local_initArticle_at_Article_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_initArticle_at_Article_title_p_0 + # PARAM param_initArticle_at_Article_title_p_0 --> 8($fp) + lw $t1, 8($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # ARG param_initArticle_at_Article_author_p_1 + # PARAM param_initArticle_at_Article_author_p_1 --> 4($fp) + lw $t1, 4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) + # LOCAL local_initArticle_at_Article_internal_1 --> -8($fp) + # local_initArticle_at_Article_internal_1 = VCALL local_initArticle_at_Article_internal_0 initBook + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 28($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # PARAM param_initArticle_at_Article_per_title_p_2 --> 0($fp) + lw $t1, 0($fp) + sw $t1, 20($s1) + # LOCAL local_initArticle_at_Article_internal_3 --> -16($fp) + # local_initArticle_at_Article_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_initArticle_at_Article_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_initArticle_at_Article. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 12 + jr $ra + # Function END + + +# function_print_at_Article implementation. +# @Params: +function_print_at_Article: + # Allocate stack frame for function function_print_at_Article. + subu $sp, $sp, 60 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 60 + # LOCAL local_print_at_Article_internal_0 --> -4($fp) + # local_print_at_Article_internal_0 = + lw $t1, Book + sw $t1, -4($fp) + # LOCAL local_print_at_Article_internal_0 --> -4($fp) + # LOCAL local_print_at_Article_internal_1 --> -8($fp) + # local_print_at_Article_internal_1 = VCALL local_print_at_Article_internal_0 print + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 32($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # LOCAL local_print_at_Article_internal_8 --> -36($fp) + # local_print_at_Article_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_print_at_Article_internal_6 --> -28($fp) + # LOCAL local_print_at_Article_internal_8 --> -36($fp) + # local_print_at_Article_internal_6 = local_print_at_Article_internal_8 + lw $t1, -36($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Article_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_6 + sw $t1, 12($v0) + li $t1, 13 + sw $t1, 16($v0) + sw $v0, -40($fp) + # ARG local_print_at_Article_internal_9 + # LOCAL local_print_at_Article_internal_9 --> -40($fp) + lw $t1, -40($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Article_internal_6 --> -28($fp) + # LOCAL local_print_at_Article_internal_7 --> -32($fp) + # local_print_at_Article_internal_7 = VCALL local_print_at_Article_internal_6 out_string + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Article_internal_4 --> -20($fp) + # LOCAL local_print_at_Article_internal_7 --> -32($fp) + # local_print_at_Article_internal_4 = local_print_at_Article_internal_7 + lw $t1, -32($fp) + sw $t1, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Article_internal_10 = GETATTRIBUTE per_title Article + # LOCAL local_print_at_Article_internal_10 --> -44($fp) + lw $t1, 20($s1) + sw $t1, -44($fp) + # ARG local_print_at_Article_internal_10 + # LOCAL local_print_at_Article_internal_10 --> -44($fp) + lw $t1, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Article_internal_4 --> -20($fp) + # LOCAL local_print_at_Article_internal_5 --> -24($fp) + # local_print_at_Article_internal_5 = VCALL local_print_at_Article_internal_4 out_string + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Article_internal_2 --> -12($fp) + # LOCAL local_print_at_Article_internal_5 --> -24($fp) + # local_print_at_Article_internal_2 = local_print_at_Article_internal_5 + lw $t1, -24($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Article_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_7 + sw $t1, 12($v0) + li $t1, 2 + sw $t1, 16($v0) + sw $v0, -48($fp) + # ARG local_print_at_Article_internal_11 + # LOCAL local_print_at_Article_internal_11 --> -48($fp) + lw $t1, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Article_internal_2 --> -12($fp) + # LOCAL local_print_at_Article_internal_3 --> -16($fp) + # local_print_at_Article_internal_3 = VCALL local_print_at_Article_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Article_internal_12 --> -52($fp) + # local_print_at_Article_internal_12 = SELF + sw $s1, -52($fp) + # RETURN local_print_at_Article_internal_12 + lw $v0, -52($fp) + # Deallocate stack frame for function function_print_at_Article. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 60 + jr $ra + # Function END + + +# function_isNil_at_BookList implementation. +# @Params: +function_isNil_at_BookList: + # Allocate stack frame for function function_isNil_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_BookList_internal_2 --> -12($fp) + # local_isNil_at_BookList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_isNil_at_BookList_internal_0 --> -4($fp) + # LOCAL local_isNil_at_BookList_internal_2 --> -12($fp) + # local_isNil_at_BookList_internal_0 = local_isNil_at_BookList_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_isNil_at_BookList_internal_0 --> -4($fp) + # LOCAL local_isNil_at_BookList_internal_1 --> -8($fp) + # local_isNil_at_BookList_internal_1 = VCALL local_isNil_at_BookList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN 1 + li $v0, 1 + # Deallocate stack frame for function function_isNil_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cons_at_BookList implementation. +# @Params: +# 0($fp) = param_cons_at_BookList_hd_0 +function_cons_at_BookList: + # Allocate stack frame for function function_cons_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) + # local_cons_at_BookList_new_cell_0 = ALLOCATE Cons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Cons + sw $t3, 12($v0) + li $t3, 4 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Cons_start + sw $t3, 4($v0) + # Load type offset + li $t3, 28 + sw $t3, 8($v0) + move $t2, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Cons__attrib__xcar__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Cons__attrib__xcdr__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t2) + sw $t2, -4($fp) + # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) + # local_cons_at_BookList_internal_1 = ALLOCATE Cons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Cons + sw $t4, 12($v0) + li $t4, 4 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Cons_start + sw $t4, 4($v0) + # Load type offset + li $t4, 28 + sw $t4, 8($v0) + move $t3, $v0 + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Cons__attrib__xcar__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t3) + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Cons__attrib__xcdr__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t3) + sw $t3, -8($fp) + # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) + # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) + # local_cons_at_BookList_new_cell_0 = local_cons_at_BookList_internal_1 + lw $t3, -8($fp) + sw $t3, -4($fp) + # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) + # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) + # local_cons_at_BookList_internal_2 = local_cons_at_BookList_new_cell_0 + lw $t3, -4($fp) + sw $t3, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cons_at_BookList_hd_0 + # PARAM param_cons_at_BookList_hd_0 --> 0($fp) + lw $t3, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) + # local_cons_at_BookList_internal_4 = SELF + sw $s1, -20($fp) + # ARG local_cons_at_BookList_internal_4 + # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) + lw $t3, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) + # LOCAL local_cons_at_BookList_internal_3 --> -16($fp) + # local_cons_at_BookList_internal_3 = VCALL local_cons_at_BookList_internal_2 init + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 48($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_cons_at_BookList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_cons_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_car_at_BookList implementation. +# @Params: +function_car_at_BookList: + # Allocate stack frame for function function_car_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_car_at_BookList_internal_2 --> -12($fp) + # local_car_at_BookList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_car_at_BookList_internal_0 --> -4($fp) + # LOCAL local_car_at_BookList_internal_2 --> -12($fp) + # local_car_at_BookList_internal_0 = local_car_at_BookList_internal_2 + lw $t3, -12($fp) + sw $t3, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_car_at_BookList_internal_0 --> -4($fp) + # LOCAL local_car_at_BookList_internal_1 --> -8($fp) + # local_car_at_BookList_internal_1 = VCALL local_car_at_BookList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 0($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_car_at_BookList_internal_3 --> -16($fp) + # local_car_at_BookList_internal_3 = ALLOCATE Book + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, Book + sw $t5, 12($v0) + li $t5, 4 + sw $t5, 16($v0) + move $t5, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t5, 0($v0) + la $t5, Book_start + sw $t5, 4($v0) + # Load type offset + li $t5, 16 + sw $t5, 8($v0) + move $t4, $v0 + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t4) + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t4) + sw $t4, -16($fp) + # RETURN local_car_at_BookList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_car_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cdr_at_BookList implementation. +# @Params: +function_cdr_at_BookList: + # Allocate stack frame for function function_cdr_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cdr_at_BookList_internal_2 --> -12($fp) + # local_cdr_at_BookList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_cdr_at_BookList_internal_0 --> -4($fp) + # LOCAL local_cdr_at_BookList_internal_2 --> -12($fp) + # local_cdr_at_BookList_internal_0 = local_cdr_at_BookList_internal_2 + lw $t4, -12($fp) + sw $t4, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_cdr_at_BookList_internal_0 --> -4($fp) + # LOCAL local_cdr_at_BookList_internal_1 --> -8($fp) + # local_cdr_at_BookList_internal_1 = VCALL local_cdr_at_BookList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t4, 4($s1) + # Get pointer to type's VTABLE + lw $t5, 0($t4) + # Get pointer to function address + lw $t6, 0($t5) + # Call function. Result is on $v0 + jalr $t6 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cdr_at_BookList_internal_3 --> -16($fp) + # local_cdr_at_BookList_internal_3 = ALLOCATE BookList + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t6, String + sw $t6, 0($v0) + la $t6, String_start + sw $t6, 4($v0) + # Load type offset + li $t6, 8 + sw $t6, 8($v0) + la $t6, BookList + sw $t6, 12($v0) + li $t6, 8 + sw $t6, 16($v0) + move $t6, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t6, 0($v0) + la $t6, BookList_start + sw $t6, 4($v0) + # Load type offset + li $t6, 24 + sw $t6, 8($v0) + move $t5, $v0 + sw $t5, -16($fp) + # RETURN local_cdr_at_BookList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_cdr_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_list_at_BookList implementation. +# @Params: +function_print_list_at_BookList: + # Allocate stack frame for function function_print_list_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_print_list_at_BookList_internal_2 --> -12($fp) + # local_print_list_at_BookList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_list_at_BookList_internal_0 --> -4($fp) + # LOCAL local_print_list_at_BookList_internal_2 --> -12($fp) + # local_print_list_at_BookList_internal_0 = local_print_list_at_BookList_internal_2 + lw $t5, -12($fp) + sw $t5, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_BookList_internal_0 --> -4($fp) + # LOCAL local_print_list_at_BookList_internal_1 --> -8($fp) + # local_print_list_at_BookList_internal_1 = VCALL local_print_list_at_BookList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 0($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_list_at_BookList_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_print_list_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Cons__attrib__xcar__init implementation. +# @Params: +__Cons__attrib__xcar__init: + # Allocate stack frame for function __Cons__attrib__xcar__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Cons__attrib__xcar__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Cons__attrib__xcdr__init implementation. +# @Params: +__Cons__attrib__xcdr__init: + # Allocate stack frame for function __Cons__attrib__xcdr__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Cons__attrib__xcdr__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_Cons implementation. +# @Params: +function_isNil_at_Cons: + # Allocate stack frame for function function_isNil_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function function_isNil_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Cons implementation. +# @Params: +# 0($fp) = param_init_at_Cons_hd_0 +# 4($fp) = param_init_at_Cons_tl_1 +function_init_at_Cons: + # Allocate stack frame for function function_init_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_Cons_hd_0 --> 4($fp) + lw $t5, 4($fp) + sw $t5, 12($s1) + # + # PARAM param_init_at_Cons_tl_1 --> 0($fp) + lw $t5, 0($fp) + sw $t5, 16($s1) + # LOCAL local_init_at_Cons_internal_0 --> -4($fp) + # local_init_at_Cons_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_car_at_Cons implementation. +# @Params: +function_car_at_Cons: + # Allocate stack frame for function function_car_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_car_at_Cons_internal_0 = GETATTRIBUTE xcar Cons + # LOCAL local_car_at_Cons_internal_0 --> -4($fp) + lw $t5, 12($s1) + sw $t5, -4($fp) + # RETURN local_car_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_car_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cdr_at_Cons implementation. +# @Params: +function_cdr_at_Cons: + # Allocate stack frame for function function_cdr_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_cdr_at_Cons_internal_0 = GETATTRIBUTE xcdr Cons + # LOCAL local_cdr_at_Cons_internal_0 --> -4($fp) + lw $t5, 16($s1) + sw $t5, -4($fp) + # RETURN local_cdr_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_cdr_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_list_at_Cons implementation. +# @Params: +function_print_list_at_Cons: + # Allocate stack frame for function function_print_list_at_Cons. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # local_print_list_at_Cons_internal_2 = GETATTRIBUTE xcar Cons + # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) + lw $t5, 12($s1) + sw $t5, -12($fp) + # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) + # local_print_list_at_Cons_internal_0 = local_print_list_at_Cons_internal_2 + lw $t5, -12($fp) + sw $t5, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # local_print_list_at_Cons_internal_1 = VCALL local_print_list_at_Cons_internal_0 print + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 32($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # local_print_list_at_Cons_internal_3 = TYPEOF local_print_list_at_Cons_internal_1 + lw $t5, -8($fp) + # Load pointer to type offset + lw $t6, 8($t5) + sw $t6, -16($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # local_print_list_at_Cons_internal_5 = 14 + li $t5, 14 + sw $t5, -24($fp) + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_7 = local_print_list_at_Cons_internal_5 - local_print_list_at_Cons_internal_6 + lw $t5, -24($fp) + lw $t6, -28($fp) + sub $t5, $t5, $t6 + sw $t5, -32($fp) + # IF_GREATER_ZERO local_print_list_at_Cons_internal_7 GOTO label_Not_min0_1 + # IF_GREATER_ZERO local_print_list_at_Cons_internal_7 GOTO label_Not_min0_1 + lw $t5, -32($fp) + bgt $t5, 0, label_Not_min0_1 + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_6 + lw $t5, -28($fp) + sw $t5, -24($fp) + label_Not_min0_1: + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_7 = local_print_list_at_Cons_internal_5 - local_print_list_at_Cons_internal_6 + lw $t5, -24($fp) + lw $t6, -28($fp) + sub $t5, $t5, $t6 + sw $t5, -32($fp) + # IF_GREATER_ZERO local_print_list_at_Cons_internal_7 GOTO label_Not_min1_2 + # IF_GREATER_ZERO local_print_list_at_Cons_internal_7 GOTO label_Not_min1_2 + lw $t5, -32($fp) + bgt $t5, 0, label_Not_min1_2 + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_6 + lw $t5, -28($fp) + sw $t5, -24($fp) + label_Not_min1_2: + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_6 = 14 + li $t5, 14 + sw $t5, -28($fp) + # LOCAL local_print_list_at_Cons_internal_4 --> -20($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # local_print_list_at_Cons_internal_4 = local_print_list_at_Cons_internal_6 - local_print_list_at_Cons_internal_5 + lw $t5, -28($fp) + lw $t6, -24($fp) + sub $t5, $t5, $t6 + sw $t5, -20($fp) + # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 + # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 + lw $t5, -20($fp) + beq $t5, 0, label_ERROR_3 + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_7 = local_print_list_at_Cons_internal_5 - local_print_list_at_Cons_internal_6 + lw $t5, -24($fp) + lw $t6, -28($fp) + sub $t5, $t5, $t6 + sw $t5, -32($fp) + # + # + lw $t5, -32($fp) + bne $t5, 0, label_NEXT0_5 + # LOCAL local_print_list_at_Cons_dummy_8 --> -36($fp) + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # local_print_list_at_Cons_dummy_8 = local_print_list_at_Cons_internal_1 + lw $t5, -8($fp) + sw $t5, -36($fp) + # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) + # local_print_list_at_Cons_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) + # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) + # local_print_list_at_Cons_internal_9 = local_print_list_at_Cons_internal_11 + lw $t5, -48($fp) + sw $t5, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Cons_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, data_8 + sw $t5, 12($v0) + li $t5, 27 + sw $t5, 16($v0) + sw $v0, -52($fp) + # ARG local_print_list_at_Cons_internal_12 + # LOCAL local_print_list_at_Cons_internal_12 --> -52($fp) + lw $t5, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) + # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) + # local_print_list_at_Cons_internal_10 = VCALL local_print_list_at_Cons_internal_9 out_string + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 12($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # GOTO label_END_4 +j label_END_4 +label_NEXT0_5: + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_7 = local_print_list_at_Cons_internal_5 - local_print_list_at_Cons_internal_6 + lw $t5, -24($fp) + lw $t6, -28($fp) + sub $t5, $t5, $t6 + sw $t5, -32($fp) + # + # + lw $t5, -32($fp) + bne $t5, 0, label_NEXT1_6 + # LOCAL local_print_list_at_Cons_dummy_13 --> -56($fp) + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # local_print_list_at_Cons_dummy_13 = local_print_list_at_Cons_internal_1 + lw $t5, -8($fp) + sw $t5, -56($fp) + # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) + # local_print_list_at_Cons_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_print_list_at_Cons_internal_14 --> -60($fp) + # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) + # local_print_list_at_Cons_internal_14 = local_print_list_at_Cons_internal_16 + lw $t5, -68($fp) + sw $t5, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, data_9 + sw $t5, 12($v0) + li $t5, 30 + sw $t5, 16($v0) + sw $v0, -72($fp) + # ARG local_print_list_at_Cons_internal_17 + # LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) + lw $t5, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + # LOCAL local_print_list_at_Cons_internal_14 --> -60($fp) + # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) + # local_print_list_at_Cons_internal_15 = VCALL local_print_list_at_Cons_internal_14 out_string + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 12($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # GOTO label_END_4 +j label_END_4 +label_NEXT1_6: + label_ERROR_3: + label_END_4: +# local_print_list_at_Cons_internal_20 = GETATTRIBUTE xcdr Cons +# LOCAL local_print_list_at_Cons_internal_20 --> -84($fp) +lw $t5, 16($s1) +sw $t5, -84($fp) +# LOCAL local_print_list_at_Cons_internal_18 --> -76($fp) +# LOCAL local_print_list_at_Cons_internal_20 --> -84($fp) +# local_print_list_at_Cons_internal_18 = local_print_list_at_Cons_internal_20 +lw $t5, -84($fp) +sw $t5, -76($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_print_list_at_Cons_internal_18 --> -76($fp) +# LOCAL local_print_list_at_Cons_internal_19 --> -80($fp) +# local_print_list_at_Cons_internal_19 = VCALL local_print_list_at_Cons_internal_18 print_list +# Save new self pointer in $s1 +lw $s1, -76($fp) +# Get pointer to type +lw $t5, 4($s1) +# Get pointer to type's VTABLE +lw $t6, 0($t5) +# Get pointer to function address +lw $t7, 44($t6) +# Call function. Result is on $v0 +jalr $t7 +sw $v0, -80($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# RETURN local_print_list_at_Cons_internal_19 +lw $v0, -80($fp) +# Deallocate stack frame for function function_print_list_at_Cons. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 92 +jr $ra +# Function END + + +# function_isNil_at_Nil implementation. +# @Params: +function_isNil_at_Nil: + # Allocate stack frame for function function_isNil_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 1 + li $v0, 1 + # Deallocate stack frame for function function_isNil_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_list_at_Nil implementation. +# @Params: +function_print_list_at_Nil: + # Allocate stack frame for function function_print_list_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 1 + li $v0, 1 + # Deallocate stack frame for function function_print_list_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__books__init implementation. +# @Params: +__Main__attrib__books__init: + # Allocate stack frame for function __Main__attrib__books__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__books__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # LOCAL local_main_at_Main_a_book_0 --> -4($fp) + # local_main_at_Main_a_book_0 = ALLOCATE Book + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) + # Load type offset + li $t7, 8 + sw $t7, 8($v0) + la $t7, Book + sw $t7, 12($v0) + li $t7, 4 + sw $t7, 16($v0) + move $t7, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t7, 0($v0) + la $t7, Book_start + sw $t7, 4($v0) + # Load type offset + li $t7, 16 + sw $t7, 8($v0) + move $t6, $v0 + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t6) + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t6) + sw $t6, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE Book + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t8, String + sw $t8, 0($v0) + la $t8, String_start + sw $t8, 4($v0) + # Load type offset + li $t8, 8 + sw $t8, 8($v0) + la $t8, Book + sw $t8, 12($v0) + li $t8, 4 + sw $t8, 16($v0) + move $t8, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t8, 0($v0) + la $t8, Book_start + sw $t8, 4($v0) + # Load type offset + li $t8, 16 + sw $t8, 8($v0) + move $t7, $v0 + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t7) + sw $t7, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t7, -16($fp) + sw $t7, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) + # Load type offset + li $t7, 8 + sw $t7, 8($v0) + la $t7, data_10 + sw $t7, 12($v0) + li $t7, 44 + sw $t7, 16($v0) + sw $v0, -20($fp) + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t7, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) + # Load type offset + li $t7, 8 + sw $t7, 8($v0) + la $t7, data_11 + sw $t7, 12($v0) + li $t7, 22 + sw $t7, 16($v0) + sw $v0, -24($fp) + # ARG local_main_at_Main_internal_5 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t7, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 initBook + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t7, 4($s1) + # Get pointer to type's VTABLE + lw $t8, 0($t7) + # Get pointer to function address + lw $t9, 28($t8) + # Call function. Result is on $v0 + jalr $t9 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_a_book_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_a_book_0 = local_main_at_Main_internal_2 + lw $t7, -12($fp) + sw $t7, -4($fp) + # LOCAL local_main_at_Main_an_article_6 --> -28($fp) + # local_main_at_Main_an_article_6 = ALLOCATE Article + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) + # Load type offset + li $t9, 8 + sw $t9, 8($v0) + la $t9, Article + sw $t9, 12($v0) + li $t9, 7 + sw $t9, 16($v0) + move $t9, $v0 + # Allocating 24 bytes of memory + li $a0, 24 + li $v0, 9 + syscall + sw $t9, 0($v0) + la $t9, Article_start + sw $t9, 4($v0) + # Load type offset + li $t9, 20 + sw $t9, 8($v0) + move $t8, $v0 + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Article__attrib__per_title__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t8) + sw $t8, -28($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = ALLOCATE Article + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $s2, String + sw $s2, 0($v0) + la $s2, String_start + sw $s2, 4($v0) + # Load type offset + li $s2, 8 + sw $s2, 8($v0) + la $s2, Article + sw $s2, 12($v0) + li $s2, 7 + sw $s2, 16($v0) + move $s2, $v0 + # Allocating 24 bytes of memory + li $a0, 24 + li $v0, 9 + syscall + sw $s2, 0($v0) + la $s2, Article_start + sw $s2, 4($v0) + # Load type offset + li $s2, 20 + sw $s2, 8($v0) + move $t9, $v0 + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Article__attrib__per_title__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t9) + sw $t9, -40($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 + lw $t9, -40($fp) + sw $t9, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) + # Load type offset + li $t9, 8 + sw $t9, 8($v0) + la $t9, data_12 + sw $t9, 12($v0) + li $t9, 19 + sw $t9, 16($v0) + sw $v0, -44($fp) + # ARG local_main_at_Main_internal_10 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + lw $t9, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) + # Load type offset + li $t9, 8 + sw $t9, 8($v0) + la $t9, data_13 + sw $t9, 12($v0) + li $t9, 7 + sw $t9, 16($v0) + sw $v0, -48($fp) + # ARG local_main_at_Main_internal_11 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + lw $t9, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) + # Load type offset + li $t9, 8 + sw $t9, 8($v0) + la $t9, data_14 + sw $t9, 12($v0) + li $t9, 11 + sw $t9, 16($v0) + sw $v0, -52($fp) + # ARG local_main_at_Main_internal_12 + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + lw $t9, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 initArticle + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t9, 4($s1) + # Get pointer to type's VTABLE + lw $s2, 0($t9) + # Get pointer to function address + lw $s3, 36($s2) + # Call function. Result is on $v0 + jalr $s3 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_an_article_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_an_article_6 = local_main_at_Main_internal_8 + lw $t9, -36($fp) + sw $t9, -28($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = ALLOCATE Nil + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $s3, String + sw $s3, 0($v0) + la $s3, String_start + sw $s3, 4($v0) + # Load type offset + li $s3, 8 + sw $s3, 8($v0) + la $s3, Nil + sw $s3, 12($v0) + li $s3, 3 + sw $s3, 16($v0) + move $s3, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $s3, 0($v0) + la $s3, Nil_start + sw $s3, 4($v0) + # Load type offset + li $s3, 32 + sw $s3, 8($v0) + move $s2, $v0 + sw $s2, -72($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 + lw $s2, -72($fp) + sw $s2, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_a_book_0 + # LOCAL local_main_at_Main_a_book_0 --> -4($fp) + lw $s2, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $s2, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 cons + # Save new self pointer in $s1 + lw $s1, -64($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 32($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_13 = local_main_at_Main_internal_16 + lw $s2, -68($fp) + sw $s2, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_an_article_6 + # LOCAL local_main_at_Main_an_article_6 --> -28($fp) + lw $s2, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $s2, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 cons + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 32($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + lw $s2, -60($fp) + sw $s2, 12($s1) + # local_main_at_Main_internal_20 = GETATTRIBUTE books Main + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + lw $s2, 12($s1) + sw $s2, -84($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 + lw $s2, -84($fp) + sw $s2, -76($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 print_list + # Save new self pointer in $s1 + lw $s1, -76($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 44($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -80($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_19 + lw $v0, -80($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 92 + jr $ra + # Function END + diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips index a9c6fb00..176b4480 100644 --- a/tests/codegen/fib.mips +++ b/tests/codegen/fib.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 18:41:51 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 11:25:29 2020 # School of Math and Computer Science, University of Havana # @@ -92,42 +92,11 @@ data_0: .asciiz "" # -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 +IO__TDT: .word 0, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, 0 # @@ -212,7 +181,7 @@ function_out_string_at_IO: # PARAM param_out_string_at_IO_x_0 --> 0($fp) # PRINT_STR param_out_string_at_IO_x_0 lw $v0, 0($fp) - lw $a0, 8($v0) + lw $a0, 12($v0) li $v0, 4 syscall # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) @@ -329,61 +298,64 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self - lw $t1, 12($s1) + lw $t0, 16($s1) # Get second string length from param lw $v0, 0($fp) - lw $t2, 12($v0) + lw $t1, 16($v0) # Save new string length in a0 for memory allocation - addu $a0, $t1, $t2 - move $t4, $a0 + addu $a0, $t0, $t1 + move $t3, $a0 # Get first string from self - lw $t1, 8($s1) + lw $t0, 12($s1) # Get second string from param - lw $t2, 8($v0) + lw $t1, 12($v0) addu $a0, $a0, 1 li $v0, 9 syscall - move $t3, $v0 - move $t5, $zero + move $t2, $v0 + move $t4, $zero concat_loop1: - # Compare t1 with \0 - lb $t5, 0($t1) - beqz $t5, concat_loop1_end + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end # Copy 1 byte - sb $t5, 0($t3) - addu $t3, $t3, 1 - addu $t1, $t1, 1 + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 j concat_loop1 concat_loop1_end: # Copy second string concat_loop2: - # Compare t2 with \0 - lb $t5, 0($t2) - beqz $t5, concat_loop2_end + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end # Copy 1 byte - sb $t5, 0($t3) - addu $t3, $t3, 1 + sb $t4, 0($t2) addu $t2, $t2, 1 + addu $t1, $t1, 1 j concat_loop2 concat_loop2_end: - sb $zero, 0($t3) + sb $zero, 0($t2) # v0 contains resulting string - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - sw $t2, 8($v0) - sw $t4, 12($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) sw $v0, -4($fp) # RETURN local_concat_at_String_internal_0 lw $v0, -4($fp) @@ -413,38 +385,41 @@ function_substr_at_String: # LOCAL local_substr_at_String_internal_0 --> -4($fp) # PARAM param_substr_at_String_l_0 --> 4($fp) # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t1, 8($s1) - lw $t3, 4($fp) - addu $t1, $t1, $t3 + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 lw $a0, 0($fp) - move $t4, $a0 - move $t2, $a0 + move $t3, $a0 + move $t1, $a0 addu $a0, $a0, 1 li $v0, 9 syscall - move $t3, $v0 + move $t2, $v0 substr_loop: - beqz $t2, substr_end - lb $a0, 0($t1) - sb $a0, 0($t3) - addu $t1, $t1, 1 - addu $t3, $t3, 1 - subu $t2, $t2, 1 + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 j substr_loop substr_end: - sb $zero, 0($t3) - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - sw $t2, 8($v0) - sw $t4, 12($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) sw $v0, -4($fp) # RETURN local_substr_at_String_internal_0 lw $v0, -4($fp) @@ -471,8 +446,8 @@ function_length_at_String: addu $fp, $sp, 32 # local_length_at_String_internal_0 = GETATTRIBUTE length String # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t1, 12($s1) - sw $t1, -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) # RETURN local_length_at_String_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_length_at_String. @@ -496,29 +471,35 @@ entry: addu $fp, $sp, 32 # LOCAL local__internal_0 --> -4($fp) # local__internal_0 = ALLOCATE Main - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - la $t3, Main - sw $t3, 8($v0) - li $t3, 4 - sw $t3, 12($v0) - move $t3, $v0 - # Allocating 8 bytes of memory - li $a0, 8 + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall - sw $t3, 0($v0) - la $t3, Main_start - sw $t3, 4($v0) - move $t2, $v0 - sw $t2, -4($fp) + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) + move $t1, $v0 + sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) # local__internal_1 = CALL function_main_at_Main @@ -552,45 +533,48 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) + lw $t1, -12($fp) + sw $t1, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - la $t2, data_2 - sw $t2, 8($v0) - li $t2, 39 - sw $t2, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_2 + sw $t1, 12($v0) + li $t1, 39 + sw $t1, 16($v0) sw $v0, -16($fp) # ARG local_main_at_Main_internal_3 # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t2, -16($fp) + lw $t1, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 12($t3) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -601,8 +585,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_4 --> -20($fp) # LOCAL local_main_at_Main_internal_6 --> -28($fp) # local_main_at_Main_internal_4 = local_main_at_Main_internal_6 - lw $t2, -28($fp) - sw $t2, -20($fp) + lw $t1, -28($fp) + sw $t1, -20($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -612,8 +596,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_7 --> -32($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t2, -40($fp) - sw $t2, -32($fp) + lw $t1, -40($fp) + sw $t1, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -623,8 +607,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_10 --> -44($fp) # LOCAL local_main_at_Main_internal_12 --> -52($fp) # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 - lw $t2, -52($fp) - sw $t2, -44($fp) + lw $t1, -52($fp) + sw $t1, -44($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -634,59 +618,59 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -44($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 24($t3) + lw $t3, 24($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -48($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_main_at_Main_internal_11 # LOCAL local_main_at_Main_internal_11 --> -48($fp) - lw $t2, -48($fp) + lw $t1, -48($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 fib # Save new self pointer in $s1 lw $s1, -32($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 32($t3) + lw $t3, 32($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_main_at_Main_internal_8 # LOCAL local_main_at_Main_internal_8 --> -36($fp) - lw $t2, -36($fp) + lw $t1, -36($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # LOCAL local_main_at_Main_internal_4 --> -20($fp) # LOCAL local_main_at_Main_internal_5 --> -24($fp) # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 out_int # Save new self pointer in $s1 lw $s1, -20($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 16($t3) + lw $t3, 16($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -697,45 +681,48 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_13 --> -56($fp) # LOCAL local_main_at_Main_internal_15 --> -64($fp) # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 - lw $t2, -64($fp) - sw $t2, -56($fp) + lw $t1, -64($fp) + sw $t1, -56($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - la $t2, data_3 - sw $t2, 8($v0) - li $t2, 2 - sw $t2, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_3 + sw $t1, 12($v0) + li $t1, 2 + sw $t1, 16($v0) sw $v0, -68($fp) # ARG local_main_at_Main_internal_16 # LOCAL local_main_at_Main_internal_16 --> -68($fp) - lw $t2, -68($fp) + lw $t1, -68($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # LOCAL local_main_at_Main_internal_13 --> -56($fp) # LOCAL local_main_at_Main_internal_14 --> -60($fp) # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 out_string # Save new self pointer in $s1 lw $s1, -56($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 12($t3) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -60($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -764,93 +751,93 @@ function_fib_at_Main: addu $fp, $sp, 36 # LOCAL local_fib_at_Main_a_0 --> -4($fp) # local_fib_at_Main_a_0 = 1 - li $t2, 1 - sw $t2, -4($fp) + li $t1, 1 + sw $t1, -4($fp) # LOCAL local_fib_at_Main_b_1 --> -8($fp) # local_fib_at_Main_b_1 = 0 - li $t2, 0 - sw $t2, -8($fp) + li $t1, 0 + sw $t1, -8($fp) # LOCAL local_fib_at_Main_c_2 --> -12($fp) # local_fib_at_Main_c_2 = 0 - li $t2, 0 - sw $t2, -12($fp) + li $t1, 0 + sw $t1, -12($fp) label_WHILE_1: # LOCAL local_fib_at_Main_internal_3 --> -16($fp) # PARAM param_fib_at_Main_i_0 --> 0($fp) # local_fib_at_Main_internal_3 = PARAM param_fib_at_Main_i_0 - 0 - lw $t2, 0($fp) - sub $t2, $t2, 0 - sw $t2, -16($fp) + lw $t1, 0($fp) + sub $t1, $t1, 0 + sw $t1, -16($fp) # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 - lw $t2, -16($fp) - beq $t2, 0, label_TRUE_3 + lw $t1, -16($fp) + beq $t1, 0, label_TRUE_3 # LOCAL local_fib_at_Main_internal_3 --> -16($fp) # local_fib_at_Main_internal_3 = 0 - li $t2, 0 - sw $t2, -16($fp) + li $t1, 0 + sw $t1, -16($fp) # GOTO label_END_4 j label_END_4 label_TRUE_3: # LOCAL local_fib_at_Main_internal_3 --> -16($fp) # local_fib_at_Main_internal_3 = 1 - li $t2, 1 - sw $t2, -16($fp) + li $t1, 1 + sw $t1, -16($fp) label_END_4: # IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 # IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 -lw $t2, -16($fp) -beq $t2, 0, label_FALSE_5 +lw $t1, -16($fp) +beq $t1, 0, label_FALSE_5 # LOCAL local_fib_at_Main_internal_4 --> -20($fp) # local_fib_at_Main_internal_4 = 0 -li $t2, 0 -sw $t2, -20($fp) +li $t1, 0 +sw $t1, -20($fp) # GOTO label_NOT_END_6 j label_NOT_END_6 label_FALSE_5: # LOCAL local_fib_at_Main_internal_4 --> -20($fp) # local_fib_at_Main_internal_4 = 1 - li $t2, 1 - sw $t2, -20($fp) + li $t1, 1 + sw $t1, -20($fp) label_NOT_END_6: # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 - lw $t2, -20($fp) - beq $t2, 0, label_WHILE_END_2 + lw $t1, -20($fp) + beq $t1, 0, label_WHILE_END_2 # LOCAL local_fib_at_Main_internal_5 --> -24($fp) # LOCAL local_fib_at_Main_a_0 --> -4($fp) # LOCAL local_fib_at_Main_b_1 --> -8($fp) # local_fib_at_Main_internal_5 = local_fib_at_Main_a_0 + local_fib_at_Main_b_1 - lw $t2, -4($fp) - lw $t3, -8($fp) - add $t2, $t2, $t3 - sw $t2, -24($fp) + lw $t1, -4($fp) + lw $t2, -8($fp) + add $t1, $t1, $t2 + sw $t1, -24($fp) # LOCAL local_fib_at_Main_c_2 --> -12($fp) # LOCAL local_fib_at_Main_internal_5 --> -24($fp) # local_fib_at_Main_c_2 = local_fib_at_Main_internal_5 - lw $t2, -24($fp) - sw $t2, -12($fp) + lw $t1, -24($fp) + sw $t1, -12($fp) # LOCAL local_fib_at_Main_internal_6 --> -28($fp) # PARAM param_fib_at_Main_i_0 --> 0($fp) # local_fib_at_Main_internal_6 = PARAM param_fib_at_Main_i_0 - 1 - lw $t2, 0($fp) - sub $t2, $t2, 1 - sw $t2, -28($fp) + lw $t1, 0($fp) + sub $t1, $t1, 1 + sw $t1, -28($fp) # PARAM param_fib_at_Main_i_0 --> 0($fp) # LOCAL local_fib_at_Main_internal_6 --> -28($fp) # PARAM param_fib_at_Main_i_0 = local_fib_at_Main_internal_6 - lw $t2, -28($fp) - sw $t2, 0($fp) + lw $t1, -28($fp) + sw $t1, 0($fp) # LOCAL local_fib_at_Main_b_1 --> -8($fp) # LOCAL local_fib_at_Main_a_0 --> -4($fp) # local_fib_at_Main_b_1 = local_fib_at_Main_a_0 - lw $t2, -4($fp) - sw $t2, -8($fp) + lw $t1, -4($fp) + sw $t1, -8($fp) # LOCAL local_fib_at_Main_a_0 --> -4($fp) # LOCAL local_fib_at_Main_c_2 --> -12($fp) # local_fib_at_Main_a_0 = local_fib_at_Main_c_2 - lw $t2, -12($fp) - sw $t2, -4($fp) + lw $t1, -12($fp) + sw $t1, -4($fp) # GOTO label_WHILE_1 j label_WHILE_1 label_WHILE_END_2: diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips index 0ea976cf..3a6d8799 100644 --- a/tests/codegen/hello_world.mips +++ b/tests/codegen/hello_world.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 18:41:50 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 11:25:28 2020 # School of Math and Computer Science, University of Havana # @@ -92,42 +92,11 @@ data_0: .asciiz "" # -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 +IO__TDT: .word 0, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, 0 # @@ -208,7 +177,7 @@ function_out_string_at_IO: # PARAM param_out_string_at_IO_x_0 --> 0($fp) # PRINT_STR param_out_string_at_IO_x_0 lw $v0, 0($fp) - lw $a0, 8($v0) + lw $a0, 12($v0) li $v0, 4 syscall # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) @@ -325,61 +294,64 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self - lw $t1, 12($s1) + lw $t0, 16($s1) # Get second string length from param lw $v0, 0($fp) - lw $t2, 12($v0) + lw $t1, 16($v0) # Save new string length in a0 for memory allocation - addu $a0, $t1, $t2 - move $t4, $a0 + addu $a0, $t0, $t1 + move $t3, $a0 # Get first string from self - lw $t1, 8($s1) + lw $t0, 12($s1) # Get second string from param - lw $t2, 8($v0) + lw $t1, 12($v0) addu $a0, $a0, 1 li $v0, 9 syscall - move $t3, $v0 - move $t5, $zero + move $t2, $v0 + move $t4, $zero concat_loop1: - # Compare t1 with \0 - lb $t5, 0($t1) - beqz $t5, concat_loop1_end + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end # Copy 1 byte - sb $t5, 0($t3) - addu $t3, $t3, 1 - addu $t1, $t1, 1 + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 j concat_loop1 concat_loop1_end: # Copy second string concat_loop2: - # Compare t2 with \0 - lb $t5, 0($t2) - beqz $t5, concat_loop2_end + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end # Copy 1 byte - sb $t5, 0($t3) - addu $t3, $t3, 1 + sb $t4, 0($t2) addu $t2, $t2, 1 + addu $t1, $t1, 1 j concat_loop2 concat_loop2_end: - sb $zero, 0($t3) + sb $zero, 0($t2) # v0 contains resulting string - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - sw $t2, 8($v0) - sw $t4, 12($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) sw $v0, -4($fp) # RETURN local_concat_at_String_internal_0 lw $v0, -4($fp) @@ -409,38 +381,41 @@ function_substr_at_String: # LOCAL local_substr_at_String_internal_0 --> -4($fp) # PARAM param_substr_at_String_l_0 --> 4($fp) # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t1, 8($s1) - lw $t3, 4($fp) - addu $t1, $t1, $t3 + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 lw $a0, 0($fp) - move $t4, $a0 - move $t2, $a0 + move $t3, $a0 + move $t1, $a0 addu $a0, $a0, 1 li $v0, 9 syscall - move $t3, $v0 + move $t2, $v0 substr_loop: - beqz $t2, substr_end - lb $a0, 0($t1) - sb $a0, 0($t3) - addu $t1, $t1, 1 - addu $t3, $t3, 1 - subu $t2, $t2, 1 + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 j substr_loop substr_end: - sb $zero, 0($t3) - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - sw $t2, 8($v0) - sw $t4, 12($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) sw $v0, -4($fp) # RETURN local_substr_at_String_internal_0 lw $v0, -4($fp) @@ -467,8 +442,8 @@ function_length_at_String: addu $fp, $sp, 32 # local_length_at_String_internal_0 = GETATTRIBUTE length String # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t1, 12($s1) - sw $t1, -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) # RETURN local_length_at_String_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_length_at_String. @@ -492,29 +467,35 @@ entry: addu $fp, $sp, 32 # LOCAL local__internal_0 --> -4($fp) # local__internal_0 = ALLOCATE Main - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - la $t3, Main - sw $t3, 8($v0) - li $t3, 4 - sw $t3, 12($v0) - move $t3, $v0 - # Allocating 8 bytes of memory - li $a0, 8 + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall - sw $t3, 0($v0) - la $t3, Main_start - sw $t3, 4($v0) - move $t2, $v0 - sw $t2, -4($fp) + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) + move $t1, $v0 + sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) # local__internal_1 = CALL function_main_at_Main @@ -548,45 +529,48 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) + lw $t1, -12($fp) + sw $t1, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - la $t2, data_2 - sw $t2, 8($v0) - li $t2, 15 - sw $t2, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_2 + sw $t1, 12($v0) + li $t1, 15 + sw $t1, 16($v0) sw $v0, -16($fp) # ARG local_main_at_Main_internal_3 # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t2, -16($fp) + lw $t1, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 12($t3) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips index becfd0db..50711c7d 100644 --- a/tests/codegen/io.mips +++ b/tests/codegen/io.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 18:41:51 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 11:25:29 2020 # School of Math and Computer Science, University of Havana # @@ -156,106 +156,15 @@ data_0: .asciiz "" # -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_A_tdt_entry__: .word 1 -__Object_B_tdt_entry__: .word 2 -__Object_C_tdt_entry__: .word 2 -__Object_D_tdt_entry__: .word 3 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_A_tdt_entry__: .word -1 -__Int_B_tdt_entry__: .word -1 -__Int_C_tdt_entry__: .word -1 -__Int_D_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_A_tdt_entry__: .word -1 -__String_B_tdt_entry__: .word -1 -__String_C_tdt_entry__: .word -1 -__String_D_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_A_tdt_entry__: .word -1 -__Bool_B_tdt_entry__: .word -1 -__Bool_C_tdt_entry__: .word -1 -__Bool_D_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_A_tdt_entry__: .word -1 -__IO_B_tdt_entry__: .word -1 -__IO_C_tdt_entry__: .word 1 -__IO_D_tdt_entry__: .word 2 -__IO_Main_tdt_entry__: .word 1 -__A_Object_tdt_entry__: .word -1 -__A_Int_tdt_entry__: .word -1 -__A_String_tdt_entry__: .word -1 -__A_Bool_tdt_entry__: .word -1 -__A_IO_tdt_entry__: .word -1 -__A_A_tdt_entry__: .word 0 -__A_B_tdt_entry__: .word 1 -__A_C_tdt_entry__: .word -1 -__A_D_tdt_entry__: .word -1 -__A_Main_tdt_entry__: .word -1 -__B_Object_tdt_entry__: .word -1 -__B_Int_tdt_entry__: .word -1 -__B_String_tdt_entry__: .word -1 -__B_Bool_tdt_entry__: .word -1 -__B_IO_tdt_entry__: .word -1 -__B_A_tdt_entry__: .word -1 -__B_B_tdt_entry__: .word 0 -__B_C_tdt_entry__: .word -1 -__B_D_tdt_entry__: .word -1 -__B_Main_tdt_entry__: .word -1 -__C_Object_tdt_entry__: .word -1 -__C_Int_tdt_entry__: .word -1 -__C_String_tdt_entry__: .word -1 -__C_Bool_tdt_entry__: .word -1 -__C_IO_tdt_entry__: .word -1 -__C_A_tdt_entry__: .word -1 -__C_B_tdt_entry__: .word -1 -__C_C_tdt_entry__: .word 0 -__C_D_tdt_entry__: .word 1 -__C_Main_tdt_entry__: .word -1 -__D_Object_tdt_entry__: .word -1 -__D_Int_tdt_entry__: .word -1 -__D_String_tdt_entry__: .word -1 -__D_Bool_tdt_entry__: .word -1 -__D_IO_tdt_entry__: .word -1 -__D_A_tdt_entry__: .word -1 -__D_B_tdt_entry__: .word -1 -__D_C_tdt_entry__: .word -1 -__D_D_tdt_entry__: .word 0 -__D_Main_tdt_entry__: .word -1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_A_tdt_entry__: .word -1 -__Main_B_tdt_entry__: .word -1 -__Main_C_tdt_entry__: .word -1 -__Main_D_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 +IO__TDT: .word 0, -1, -1, -1, -1, -1, 1, 2, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2, 2, 3, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1 +A__TDT: .word -1, -1, -1, -1, 0, 1, -1, -1, -1 +B__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1 +C__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, -1 +D__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0 # @@ -352,7 +261,7 @@ function_out_string_at_IO: # PARAM param_out_string_at_IO_x_0 --> 0($fp) # PRINT_STR param_out_string_at_IO_x_0 lw $v0, 0($fp) - lw $a0, 8($v0) + lw $a0, 12($v0) li $v0, 4 syscall # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) @@ -469,61 +378,64 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self - lw $t1, 12($s1) + lw $t0, 16($s1) # Get second string length from param lw $v0, 0($fp) - lw $t2, 12($v0) + lw $t1, 16($v0) # Save new string length in a0 for memory allocation - addu $a0, $t1, $t2 - move $t4, $a0 + addu $a0, $t0, $t1 + move $t3, $a0 # Get first string from self - lw $t1, 8($s1) + lw $t0, 12($s1) # Get second string from param - lw $t2, 8($v0) + lw $t1, 12($v0) addu $a0, $a0, 1 li $v0, 9 syscall - move $t3, $v0 - move $t5, $zero + move $t2, $v0 + move $t4, $zero concat_loop1: - # Compare t1 with \0 - lb $t5, 0($t1) - beqz $t5, concat_loop1_end + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end # Copy 1 byte - sb $t5, 0($t3) - addu $t3, $t3, 1 - addu $t1, $t1, 1 + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 j concat_loop1 concat_loop1_end: # Copy second string concat_loop2: - # Compare t2 with \0 - lb $t5, 0($t2) - beqz $t5, concat_loop2_end + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end # Copy 1 byte - sb $t5, 0($t3) - addu $t3, $t3, 1 + sb $t4, 0($t2) addu $t2, $t2, 1 + addu $t1, $t1, 1 j concat_loop2 concat_loop2_end: - sb $zero, 0($t3) + sb $zero, 0($t2) # v0 contains resulting string - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - sw $t2, 8($v0) - sw $t4, 12($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) sw $v0, -4($fp) # RETURN local_concat_at_String_internal_0 lw $v0, -4($fp) @@ -553,38 +465,41 @@ function_substr_at_String: # LOCAL local_substr_at_String_internal_0 --> -4($fp) # PARAM param_substr_at_String_l_0 --> 4($fp) # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t1, 8($s1) - lw $t3, 4($fp) - addu $t1, $t1, $t3 + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 lw $a0, 0($fp) - move $t4, $a0 - move $t2, $a0 + move $t3, $a0 + move $t1, $a0 addu $a0, $a0, 1 li $v0, 9 syscall - move $t3, $v0 + move $t2, $v0 substr_loop: - beqz $t2, substr_end - lb $a0, 0($t1) - sb $a0, 0($t3) - addu $t1, $t1, 1 - addu $t3, $t3, 1 - subu $t2, $t2, 1 + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 j substr_loop substr_end: - sb $zero, 0($t3) - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - sw $t2, 8($v0) - sw $t4, 12($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) sw $v0, -4($fp) # RETURN local_substr_at_String_internal_0 lw $v0, -4($fp) @@ -611,8 +526,8 @@ function_length_at_String: addu $fp, $sp, 32 # local_length_at_String_internal_0 = GETATTRIBUTE length String # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t1, 12($s1) - sw $t1, -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) # RETURN local_length_at_String_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_length_at_String. @@ -636,29 +551,35 @@ entry: addu $fp, $sp, 32 # LOCAL local__internal_0 --> -4($fp) # local__internal_0 = ALLOCATE Main - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - la $t3, Main - sw $t3, 8($v0) - li $t3, 4 - sw $t3, 12($v0) - move $t3, $v0 - # Allocating 8 bytes of memory - li $a0, 8 + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall - sw $t3, 0($v0) - la $t3, Main_start - sw $t3, 4($v0) - move $t2, $v0 - sw $t2, -4($fp) + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 32 + sw $t2, 8($v0) + move $t1, $v0 + sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) # local__internal_1 = CALL function_main_at_Main @@ -688,29 +609,35 @@ __A__attrib__io__init: addu $fp, $sp, 32 # LOCAL local_ib__io__init_internal_0 --> -4($fp) # local_ib__io__init_internal_0 = ALLOCATE IO - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - la $t4, IO - sw $t4, 8($v0) - li $t4, 2 - sw $t4, 12($v0) - move $t4, $v0 - # Allocating 8 bytes of memory - li $a0, 8 + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, IO + sw $t3, 12($v0) + li $t3, 2 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall - sw $t4, 0($v0) - la $t4, IO_start - sw $t4, 4($v0) - move $t3, $v0 - sw $t3, -4($fp) + sw $t3, 0($v0) + la $t3, IO_start + sw $t3, 4($v0) + # Load type offset + li $t3, 0 + sw $t3, 8($v0) + move $t2, $v0 + sw $t2, -4($fp) # RETURN local_ib__io__init_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function __A__attrib__io__init. @@ -734,50 +661,53 @@ function_out_a_at_A: addu $fp, $sp, 32 # local_out_a_at_A_internal_2 = GETATTRIBUTE io A # LOCAL local_out_a_at_A_internal_2 --> -12($fp) - lw $t3, 8($s1) - sw $t3, -12($fp) + lw $t2, 12($s1) + sw $t2, -12($fp) # LOCAL local_out_a_at_A_internal_0 --> -4($fp) # LOCAL local_out_a_at_A_internal_2 --> -12($fp) # local_out_a_at_A_internal_0 = local_out_a_at_A_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) + lw $t2, -12($fp) + sw $t2, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_out_a_at_A_internal_3 --> -16($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - la $t3, data_2 - sw $t3, 8($v0) - li $t3, 16 - sw $t3, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_2 + sw $t2, 12($v0) + li $t2, 16 + sw $t2, 16($v0) sw $v0, -16($fp) # ARG local_out_a_at_A_internal_3 # LOCAL local_out_a_at_A_internal_3 --> -16($fp) - lw $t3, -16($fp) + lw $t2, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t2, 0($sp) # LOCAL local_out_a_at_A_internal_0 --> -4($fp) # LOCAL local_out_a_at_A_internal_1 --> -8($fp) # local_out_a_at_A_internal_1 = VCALL local_out_a_at_A_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t3, 0($t2) # Get pointer to function address - lw $t5, 12($t4) + lw $t4, 12($t3) # Call function. Result is on $v0 - jalr $t5 + jalr $t4 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -805,50 +735,53 @@ function_out_b_at_B: addu $fp, $sp, 32 # local_out_b_at_B_internal_2 = GETATTRIBUTE io B # LOCAL local_out_b_at_B_internal_2 --> -12($fp) - lw $t3, 8($s1) - sw $t3, -12($fp) + lw $t2, 12($s1) + sw $t2, -12($fp) # LOCAL local_out_b_at_B_internal_0 --> -4($fp) # LOCAL local_out_b_at_B_internal_2 --> -12($fp) # local_out_b_at_B_internal_0 = local_out_b_at_B_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) + lw $t2, -12($fp) + sw $t2, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_out_b_at_B_internal_3 --> -16($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - la $t3, data_3 - sw $t3, 8($v0) - li $t3, 16 - sw $t3, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_3 + sw $t2, 12($v0) + li $t2, 16 + sw $t2, 16($v0) sw $v0, -16($fp) # ARG local_out_b_at_B_internal_3 # LOCAL local_out_b_at_B_internal_3 --> -16($fp) - lw $t3, -16($fp) + lw $t2, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t2, 0($sp) # LOCAL local_out_b_at_B_internal_0 --> -4($fp) # LOCAL local_out_b_at_B_internal_1 --> -8($fp) # local_out_b_at_B_internal_1 = VCALL local_out_b_at_B_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t3, 0($t2) # Get pointer to function address - lw $t5, 12($t4) + lw $t4, 12($t3) # Call function. Result is on $v0 - jalr $t5 + jalr $t4 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -880,45 +813,48 @@ function_out_c_at_C: # LOCAL local_out_c_at_C_internal_0 --> -4($fp) # LOCAL local_out_c_at_C_internal_2 --> -12($fp) # local_out_c_at_C_internal_0 = local_out_c_at_C_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) + lw $t2, -12($fp) + sw $t2, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_out_c_at_C_internal_3 --> -16($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - la $t3, data_4 - sw $t3, 8($v0) - li $t3, 16 - sw $t3, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_4 + sw $t2, 12($v0) + li $t2, 16 + sw $t2, 16($v0) sw $v0, -16($fp) # ARG local_out_c_at_C_internal_3 # LOCAL local_out_c_at_C_internal_3 --> -16($fp) - lw $t3, -16($fp) + lw $t2, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t2, 0($sp) # LOCAL local_out_c_at_C_internal_0 --> -4($fp) # LOCAL local_out_c_at_C_internal_1 --> -8($fp) # local_out_c_at_C_internal_1 = VCALL local_out_c_at_C_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t3, 0($t2) # Get pointer to function address - lw $t5, 12($t4) + lw $t4, 12($t3) # Call function. Result is on $v0 - jalr $t5 + jalr $t4 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -950,45 +886,48 @@ function_out_d_at_D: # LOCAL local_out_d_at_D_internal_0 --> -4($fp) # LOCAL local_out_d_at_D_internal_2 --> -12($fp) # local_out_d_at_D_internal_0 = local_out_d_at_D_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) + lw $t2, -12($fp) + sw $t2, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_out_d_at_D_internal_3 --> -16($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - la $t3, data_5 - sw $t3, 8($v0) - li $t3, 16 - sw $t3, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_5 + sw $t2, 12($v0) + li $t2, 16 + sw $t2, 16($v0) sw $v0, -16($fp) # ARG local_out_d_at_D_internal_3 # LOCAL local_out_d_at_D_internal_3 --> -16($fp) - lw $t3, -16($fp) + lw $t2, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t2, 0($sp) # LOCAL local_out_d_at_D_internal_0 --> -4($fp) # LOCAL local_out_d_at_D_internal_1 --> -8($fp) # local_out_d_at_D_internal_1 = VCALL local_out_d_at_D_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t3, 0($t2) # Get pointer to function address - lw $t5, 12($t4) + lw $t4, 12($t3) # Call function. Result is on $v0 - jalr $t5 + jalr $t4 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1016,42 +955,48 @@ function_main_at_Main: addu $fp, $sp, 72 # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_internal_2 = ALLOCATE A - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) - la $t5, A - sw $t5, 8($v0) - li $t5, 1 - sw $t5, 12($v0) - move $t5, $v0 - # Allocating 12 bytes of memory - li $a0, 12 + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, A + sw $t4, 12($v0) + li $t4, 1 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 16 bytes of memory + li $a0, 16 li $v0, 9 syscall - sw $t5, 0($v0) - la $t5, A_start - sw $t5, 4($v0) - move $t4, $v0 - # Push register t4 into stack + sw $t4, 0($v0) + la $t4, A_start + sw $t4, 4($v0) + # Load type offset + li $t4, 16 + sw $t4, 8($v0) + move $t3, $v0 + # Push register t3 into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t3, 0($sp) jal __A__attrib__io__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) addu $sp, $sp, 4 - sw $v0, 8($t4) - sw $t4, -12($fp) + sw $v0, 12($t3) + sw $t3, -12($fp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t4, -12($fp) - sw $t4, -4($fp) + lw $t3, -12($fp) + sw $t3, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1061,55 +1006,61 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t4, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t5, 0($t4) + lw $t4, 0($t3) # Get pointer to function address - lw $t6, 12($t5) + lw $t5, 12($t4) # Call function. Result is on $v0 - jalr $t6 + jalr $t5 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # LOCAL local_main_at_Main_internal_5 --> -24($fp) # local_main_at_Main_internal_5 = ALLOCATE B - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t6, String - sw $t6, 0($v0) - la $t6, String_start - sw $t6, 4($v0) - la $t6, B - sw $t6, 8($v0) - li $t6, 1 - sw $t6, 12($v0) - move $t6, $v0 - # Allocating 12 bytes of memory - li $a0, 12 + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, B + sw $t5, 12($v0) + li $t5, 1 + sw $t5, 16($v0) + move $t5, $v0 + # Allocating 16 bytes of memory + li $a0, 16 li $v0, 9 syscall - sw $t6, 0($v0) - la $t6, B_start - sw $t6, 4($v0) - move $t5, $v0 - # Push register t5 into stack + sw $t5, 0($v0) + la $t5, B_start + sw $t5, 4($v0) + # Load type offset + li $t5, 20 + sw $t5, 8($v0) + move $t4, $v0 + # Push register t4 into stack subu $sp, $sp, 4 - sw $t5, 0($sp) + sw $t4, 0($sp) jal __A__attrib__io__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) addu $sp, $sp, 4 - sw $v0, 8($t5) - sw $t5, -24($fp) + sw $v0, 12($t4) + sw $t4, -24($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # LOCAL local_main_at_Main_internal_5 --> -24($fp) # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 - lw $t5, -24($fp) - sw $t5, -16($fp) + lw $t4, -24($fp) + sw $t4, -16($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1119,47 +1070,53 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -16($fp) # Get pointer to type - lw $t5, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t6, 0($t5) + lw $t5, 0($t4) # Get pointer to function address - lw $t7, 16($t6) + lw $t6, 16($t5) # Call function. Result is on $v0 - jalr $t7 + jalr $t6 sw $v0, -20($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # LOCAL local_main_at_Main_internal_8 --> -36($fp) # local_main_at_Main_internal_8 = ALLOCATE C - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) - la $t7, C - sw $t7, 8($v0) - li $t7, 1 - sw $t7, 12($v0) - move $t7, $v0 - # Allocating 8 bytes of memory - li $a0, 8 + la $t6, String + sw $t6, 0($v0) + la $t6, String_start + sw $t6, 4($v0) + # Load type offset + li $t6, 8 + sw $t6, 8($v0) + la $t6, C + sw $t6, 12($v0) + li $t6, 1 + sw $t6, 16($v0) + move $t6, $v0 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall - sw $t7, 0($v0) - la $t7, C_start - sw $t7, 4($v0) - move $t6, $v0 - sw $t6, -36($fp) + sw $t6, 0($v0) + la $t6, C_start + sw $t6, 4($v0) + # Load type offset + li $t6, 24 + sw $t6, 8($v0) + move $t5, $v0 + sw $t5, -36($fp) # LOCAL local_main_at_Main_internal_6 --> -28($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 - lw $t6, -36($fp) - sw $t6, -28($fp) + lw $t5, -36($fp) + sw $t5, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1169,47 +1126,53 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -28($fp) # Get pointer to type - lw $t6, 4($s1) + lw $t5, 4($s1) # Get pointer to type's VTABLE - lw $t7, 0($t6) + lw $t6, 0($t5) # Get pointer to function address - lw $t8, 28($t7) + lw $t7, 28($t6) # Call function. Result is on $v0 - jalr $t8 + jalr $t7 sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # LOCAL local_main_at_Main_internal_11 --> -48($fp) # local_main_at_Main_internal_11 = ALLOCATE D - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t8, String - sw $t8, 0($v0) - la $t8, String_start - sw $t8, 4($v0) - la $t8, D - sw $t8, 8($v0) - li $t8, 1 - sw $t8, 12($v0) - move $t8, $v0 - # Allocating 8 bytes of memory - li $a0, 8 + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) + # Load type offset + li $t7, 8 + sw $t7, 8($v0) + la $t7, D + sw $t7, 12($v0) + li $t7, 1 + sw $t7, 16($v0) + move $t7, $v0 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall - sw $t8, 0($v0) - la $t8, D_start - sw $t8, 4($v0) - move $t7, $v0 - sw $t7, -48($fp) + sw $t7, 0($v0) + la $t7, D_start + sw $t7, 4($v0) + # Load type offset + li $t7, 28 + sw $t7, 8($v0) + move $t6, $v0 + sw $t6, -48($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # LOCAL local_main_at_Main_internal_11 --> -48($fp) # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 - lw $t7, -48($fp) - sw $t7, -40($fp) + lw $t6, -48($fp) + sw $t6, -40($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1219,13 +1182,13 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -40($fp) # Get pointer to type - lw $t7, 4($s1) + lw $t6, 4($s1) # Get pointer to type's VTABLE - lw $t8, 0($t7) + lw $t7, 0($t6) # Get pointer to function address - lw $t9, 32($t8) + lw $t8, 32($t7) # Call function. Result is on $v0 - jalr $t9 + jalr $t8 sw $v0, -44($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1236,45 +1199,48 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_12 --> -52($fp) # LOCAL local_main_at_Main_internal_14 --> -60($fp) # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 - lw $t7, -60($fp) - sw $t7, -52($fp) + lw $t6, -60($fp) + sw $t6, -52($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) - la $t7, data_6 - sw $t7, 8($v0) - li $t7, 7 - sw $t7, 12($v0) + la $t6, String + sw $t6, 0($v0) + la $t6, String_start + sw $t6, 4($v0) + # Load type offset + li $t6, 8 + sw $t6, 8($v0) + la $t6, data_6 + sw $t6, 12($v0) + li $t6, 7 + sw $t6, 16($v0) sw $v0, -64($fp) # ARG local_main_at_Main_internal_15 # LOCAL local_main_at_Main_internal_15 --> -64($fp) - lw $t7, -64($fp) + lw $t6, -64($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t7, 0($sp) + sw $t6, 0($sp) # LOCAL local_main_at_Main_internal_12 --> -52($fp) # LOCAL local_main_at_Main_internal_13 --> -56($fp) # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string # Save new self pointer in $s1 lw $s1, -52($fp) # Get pointer to type - lw $t7, 4($s1) + lw $t6, 4($s1) # Get pointer to type's VTABLE - lw $t8, 0($t7) + lw $t7, 0($t6) # Get pointer to function address - lw $t9, 12($t8) + lw $t8, 12($t7) # Call function. Result is on $v0 - jalr $t9 + jalr $t8 sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) diff --git a/tests/codegen/list.mips b/tests/codegen/list.mips index cef19d7b..f2e4beeb 100644 --- a/tests/codegen/list.mips +++ b/tests/codegen/list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 18:41:51 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 11:25:30 2020 # School of Math and Computer Science, University of Havana # @@ -124,70 +124,13 @@ data_0: .asciiz "" # -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_List_tdt_entry__: .word 1 -__Object_Cons_tdt_entry__: .word 2 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_List_tdt_entry__: .word -1 -__Int_Cons_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_List_tdt_entry__: .word -1 -__String_Cons_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_List_tdt_entry__: .word -1 -__Bool_Cons_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_List_tdt_entry__: .word -1 -__IO_Cons_tdt_entry__: .word -1 -__IO_Main_tdt_entry__: .word 1 -__List_Object_tdt_entry__: .word -1 -__List_Int_tdt_entry__: .word -1 -__List_String_tdt_entry__: .word -1 -__List_Bool_tdt_entry__: .word -1 -__List_IO_tdt_entry__: .word -1 -__List_List_tdt_entry__: .word 0 -__List_Cons_tdt_entry__: .word 1 -__List_Main_tdt_entry__: .word -1 -__Cons_Object_tdt_entry__: .word -1 -__Cons_Int_tdt_entry__: .word -1 -__Cons_String_tdt_entry__: .word -1 -__Cons_Bool_tdt_entry__: .word -1 -__Cons_IO_tdt_entry__: .word -1 -__Cons_List_tdt_entry__: .word -1 -__Cons_Cons_tdt_entry__: .word 0 -__Cons_Main_tdt_entry__: .word -1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_List_tdt_entry__: .word -1 -__Main_Cons_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 +IO__TDT: .word 0, -1, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 +List__TDT: .word -1, -1, -1, -1, 0, 1, -1 +Cons__TDT: .word -1, -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, 0 # @@ -272,7 +215,7 @@ function_out_string_at_IO: # PARAM param_out_string_at_IO_x_0 --> 0($fp) # PRINT_STR param_out_string_at_IO_x_0 lw $v0, 0($fp) - lw $a0, 8($v0) + lw $a0, 12($v0) li $v0, 4 syscall # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) @@ -389,61 +332,64 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self - lw $t1, 12($s1) + lw $t0, 16($s1) # Get second string length from param lw $v0, 0($fp) - lw $t2, 12($v0) + lw $t1, 16($v0) # Save new string length in a0 for memory allocation - addu $a0, $t1, $t2 - move $t4, $a0 + addu $a0, $t0, $t1 + move $t3, $a0 # Get first string from self - lw $t1, 8($s1) + lw $t0, 12($s1) # Get second string from param - lw $t2, 8($v0) + lw $t1, 12($v0) addu $a0, $a0, 1 li $v0, 9 syscall - move $t3, $v0 - move $t5, $zero + move $t2, $v0 + move $t4, $zero concat_loop1: - # Compare t1 with \0 - lb $t5, 0($t1) - beqz $t5, concat_loop1_end + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end # Copy 1 byte - sb $t5, 0($t3) - addu $t3, $t3, 1 - addu $t1, $t1, 1 + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 j concat_loop1 concat_loop1_end: # Copy second string concat_loop2: - # Compare t2 with \0 - lb $t5, 0($t2) - beqz $t5, concat_loop2_end + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end # Copy 1 byte - sb $t5, 0($t3) - addu $t3, $t3, 1 + sb $t4, 0($t2) addu $t2, $t2, 1 + addu $t1, $t1, 1 j concat_loop2 concat_loop2_end: - sb $zero, 0($t3) + sb $zero, 0($t2) # v0 contains resulting string - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - sw $t2, 8($v0) - sw $t4, 12($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) sw $v0, -4($fp) # RETURN local_concat_at_String_internal_0 lw $v0, -4($fp) @@ -473,38 +419,41 @@ function_substr_at_String: # LOCAL local_substr_at_String_internal_0 --> -4($fp) # PARAM param_substr_at_String_l_0 --> 4($fp) # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t1, 8($s1) - lw $t3, 4($fp) - addu $t1, $t1, $t3 + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 lw $a0, 0($fp) - move $t4, $a0 - move $t2, $a0 + move $t3, $a0 + move $t1, $a0 addu $a0, $a0, 1 li $v0, 9 syscall - move $t3, $v0 + move $t2, $v0 substr_loop: - beqz $t2, substr_end - lb $a0, 0($t1) - sb $a0, 0($t3) - addu $t1, $t1, 1 - addu $t3, $t3, 1 - subu $t2, $t2, 1 + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 j substr_loop substr_end: - sb $zero, 0($t3) - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - sw $t2, 8($v0) - sw $t4, 12($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) sw $v0, -4($fp) # RETURN local_substr_at_String_internal_0 lw $v0, -4($fp) @@ -531,8 +480,8 @@ function_length_at_String: addu $fp, $sp, 32 # local_length_at_String_internal_0 = GETATTRIBUTE length String # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t1, 12($s1) - sw $t1, -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) # RETURN local_length_at_String_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_length_at_String. @@ -556,37 +505,43 @@ entry: addu $fp, $sp, 32 # LOCAL local__internal_0 --> -4($fp) # local__internal_0 = ALLOCATE Main - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - la $t3, Main - sw $t3, 8($v0) - li $t3, 4 - sw $t3, 12($v0) - move $t3, $v0 - # Allocating 12 bytes of memory - li $a0, 12 + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 li $v0, 9 syscall - sw $t3, 0($v0) - la $t3, Main_start - sw $t3, 4($v0) - move $t2, $v0 - # Push register t2 into stack + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 24 + sw $t2, 8($v0) + move $t1, $v0 + # Push register t1 into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) jal __Main__attrib__mylist__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 8($t2) - sw $t2, -4($fp) + sw $v0, 12($t1) + sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) # local__internal_1 = CALL function_main_at_Main @@ -641,8 +596,8 @@ function_head_at_List: # LOCAL local_head_at_List_internal_0 --> -4($fp) # LOCAL local_head_at_List_internal_2 --> -12($fp) # local_head_at_List_internal_0 = local_head_at_List_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) + lw $t1, -12($fp) + sw $t1, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -652,13 +607,13 @@ function_head_at_List: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 0($t3) + lw $t3, 0($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -690,8 +645,8 @@ function_tail_at_List: # LOCAL local_tail_at_List_internal_0 --> -4($fp) # LOCAL local_tail_at_List_internal_2 --> -12($fp) # local_tail_at_List_internal_0 = local_tail_at_List_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) + lw $t1, -12($fp) + sw $t1, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -701,13 +656,13 @@ function_tail_at_List: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 0($t3) + lw $t3, 0($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -739,81 +694,87 @@ function_cons_at_List: addu $fp, $sp, 32 # LOCAL local_cons_at_List_internal_2 --> -12($fp) # local_cons_at_List_internal_2 = ALLOCATE Cons - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - la $t4, Cons - sw $t4, 8($v0) - li $t4, 4 - sw $t4, 12($v0) - move $t4, $v0 - # Allocating 16 bytes of memory - li $a0, 16 + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Cons + sw $t3, 12($v0) + li $t3, 4 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall - sw $t4, 0($v0) - la $t4, Cons_start - sw $t4, 4($v0) - move $t3, $v0 - # Push register t3 into stack + sw $t3, 0($v0) + la $t3, Cons_start + sw $t3, 4($v0) + # Load type offset + li $t3, 20 + sw $t3, 8($v0) + move $t2, $v0 + # Push register t2 into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t2, 0($sp) jal __Cons__attrib__car__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) addu $sp, $sp, 4 - sw $v0, 8($t3) - # Push register t3 into stack + sw $v0, 12($t2) + # Push register t2 into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t2, 0($sp) jal __Cons__attrib__cdr__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t3) - sw $t3, -12($fp) + sw $v0, 16($t2) + sw $t2, -12($fp) # LOCAL local_cons_at_List_internal_0 --> -4($fp) # LOCAL local_cons_at_List_internal_2 --> -12($fp) # local_cons_at_List_internal_0 = local_cons_at_List_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) + lw $t2, -12($fp) + sw $t2, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG param_cons_at_List_i_0 # PARAM param_cons_at_List_i_0 --> 0($fp) - lw $t3, 0($fp) + lw $t2, 0($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t2, 0($sp) # LOCAL local_cons_at_List_internal_3 --> -16($fp) # local_cons_at_List_internal_3 = SELF sw $s1, -16($fp) # ARG local_cons_at_List_internal_3 # LOCAL local_cons_at_List_internal_3 --> -16($fp) - lw $t3, -16($fp) + lw $t2, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t2, 0($sp) # LOCAL local_cons_at_List_internal_0 --> -4($fp) # LOCAL local_cons_at_List_internal_1 --> -8($fp) # local_cons_at_List_internal_1 = VCALL local_cons_at_List_internal_0 init # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t3, 0($t2) # Get pointer to function address - lw $t5, 28($t4) + lw $t4, 28($t3) # Call function. Result is on $v0 - jalr $t5 + jalr $t4 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -906,8 +867,8 @@ function_head_at_Cons: addu $fp, $sp, 32 # local_head_at_Cons_internal_0 = GETATTRIBUTE car Cons # LOCAL local_head_at_Cons_internal_0 --> -4($fp) - lw $t3, 8($s1) - sw $t3, -4($fp) + lw $t2, 12($s1) + sw $t2, -4($fp) # RETURN local_head_at_Cons_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_head_at_Cons. @@ -931,8 +892,8 @@ function_tail_at_Cons: addu $fp, $sp, 32 # local_tail_at_Cons_internal_0 = GETATTRIBUTE cdr Cons # LOCAL local_tail_at_Cons_internal_0 --> -4($fp) - lw $t3, 12($s1) - sw $t3, -4($fp) + lw $t2, 16($s1) + sw $t2, -4($fp) # RETURN local_tail_at_Cons_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_tail_at_Cons. @@ -958,12 +919,12 @@ function_init_at_Cons: addu $fp, $sp, 32 # # PARAM param_init_at_Cons_i_0 --> 4($fp) - lw $t3, 4($fp) - sw $t3, 8($s1) + lw $t2, 4($fp) + sw $t2, 12($s1) # # PARAM param_init_at_Cons_rest_1 --> 0($fp) - lw $t3, 0($fp) - sw $t3, 12($s1) + lw $t2, 0($fp) + sw $t2, 16($s1) # LOCAL local_init_at_Cons_internal_0 --> -4($fp) # local_init_at_Cons_internal_0 = SELF sw $s1, -4($fp) @@ -1015,8 +976,8 @@ function_print_list_at_Main: # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) # PARAM param_print_list_at_Main_l_0 --> 0($fp) # local_print_list_at_Main_internal_0 = PARAM param_print_list_at_Main_l_0 - lw $t3, 0($fp) - sw $t3, -4($fp) + lw $t2, 0($fp) + sw $t2, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1026,66 +987,69 @@ function_print_list_at_Main: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t3, 0($t2) # Get pointer to function address - lw $t5, 12($t4) + lw $t4, 12($t3) # Call function. Result is on $v0 - jalr $t5 + jalr $t4 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # IF_ZERO local_print_list_at_Main_internal_1 GOTO label_FALSE_1 # IF_ZERO local_print_list_at_Main_internal_1 GOTO label_FALSE_1 - lw $t3, -8($fp) - beq $t3, 0, label_FALSE_1 + lw $t2, -8($fp) + beq $t2, 0, label_FALSE_1 # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) # local_print_list_at_Main_internal_4 = SELF sw $s1, -20($fp) # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) # local_print_list_at_Main_internal_2 = local_print_list_at_Main_internal_4 - lw $t3, -20($fp) - sw $t3, -12($fp) + lw $t2, -20($fp) + sw $t2, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - la $t3, data_2 - sw $t3, 8($v0) - li $t3, 2 - sw $t3, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_2 + sw $t2, 12($v0) + li $t2, 2 + sw $t2, 16($v0) sw $v0, -24($fp) # ARG local_print_list_at_Main_internal_5 # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) - lw $t3, -24($fp) + lw $t2, -24($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t2, 0($sp) # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) # LOCAL local_print_list_at_Main_internal_3 --> -16($fp) # local_print_list_at_Main_internal_3 = VCALL local_print_list_at_Main_internal_2 out_string # Save new self pointer in $s1 lw $s1, -12($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t3, 0($t2) # Get pointer to function address - lw $t5, 12($t4) + lw $t4, 12($t3) # Call function. Result is on $v0 - jalr $t5 + jalr $t4 sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1099,16 +1063,16 @@ label_FALSE_1: # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) # LOCAL local_print_list_at_Main_internal_8 --> -36($fp) # local_print_list_at_Main_internal_6 = local_print_list_at_Main_internal_8 - lw $t3, -36($fp) - sw $t3, -28($fp) + lw $t2, -36($fp) + sw $t2, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) # PARAM param_print_list_at_Main_l_0 --> 0($fp) # local_print_list_at_Main_internal_9 = PARAM param_print_list_at_Main_l_0 - lw $t3, 0($fp) - sw $t3, -40($fp) + lw $t2, 0($fp) + sw $t2, -40($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1118,36 +1082,36 @@ label_FALSE_1: # Save new self pointer in $s1 lw $s1, -40($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t3, 0($t2) # Get pointer to function address - lw $t5, 16($t4) + lw $t4, 16($t3) # Call function. Result is on $v0 - jalr $t5 + jalr $t4 sw $v0, -44($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_print_list_at_Main_internal_10 # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) - lw $t3, -44($fp) + lw $t2, -44($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t2, 0($sp) # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) # LOCAL local_print_list_at_Main_internal_7 --> -32($fp) # local_print_list_at_Main_internal_7 = VCALL local_print_list_at_Main_internal_6 out_int # Save new self pointer in $s1 lw $s1, -28($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t3, 0($t2) # Get pointer to function address - lw $t5, 16($t4) + lw $t4, 16($t3) # Call function. Result is on $v0 - jalr $t5 + jalr $t4 sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1158,45 +1122,48 @@ label_FALSE_1: # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) # LOCAL local_print_list_at_Main_internal_13 --> -56($fp) # local_print_list_at_Main_internal_11 = local_print_list_at_Main_internal_13 - lw $t3, -56($fp) - sw $t3, -48($fp) + lw $t2, -56($fp) + sw $t2, -48($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - la $t3, data_3 - sw $t3, 8($v0) - li $t3, 1 - sw $t3, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_3 + sw $t2, 12($v0) + li $t2, 1 + sw $t2, 16($v0) sw $v0, -60($fp) # ARG local_print_list_at_Main_internal_14 # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) - lw $t3, -60($fp) + lw $t2, -60($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t2, 0($sp) # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) # LOCAL local_print_list_at_Main_internal_12 --> -52($fp) # local_print_list_at_Main_internal_12 = VCALL local_print_list_at_Main_internal_11 out_string # Save new self pointer in $s1 lw $s1, -48($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t3, 0($t2) # Get pointer to function address - lw $t5, 12($t4) + lw $t4, 12($t3) # Call function. Result is on $v0 - jalr $t5 + jalr $t4 sw $v0, -52($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1207,16 +1174,16 @@ label_FALSE_1: # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) # local_print_list_at_Main_internal_15 = local_print_list_at_Main_internal_17 - lw $t3, -72($fp) - sw $t3, -64($fp) + lw $t2, -72($fp) + sw $t2, -64($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) # PARAM param_print_list_at_Main_l_0 --> 0($fp) # local_print_list_at_Main_internal_18 = PARAM param_print_list_at_Main_l_0 - lw $t3, 0($fp) - sw $t3, -76($fp) + lw $t2, 0($fp) + sw $t2, -76($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1226,36 +1193,36 @@ label_FALSE_1: # Save new self pointer in $s1 lw $s1, -76($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t3, 0($t2) # Get pointer to function address - lw $t5, 20($t4) + lw $t4, 20($t3) # Call function. Result is on $v0 - jalr $t5 + jalr $t4 sw $v0, -80($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_print_list_at_Main_internal_19 # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) - lw $t3, -80($fp) + lw $t2, -80($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t2, 0($sp) # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) # LOCAL local_print_list_at_Main_internal_16 --> -68($fp) # local_print_list_at_Main_internal_16 = VCALL local_print_list_at_Main_internal_15 print_list # Save new self pointer in $s1 lw $s1, -64($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t3, 0($t2) # Get pointer to function address - lw $t5, 28($t4) + lw $t4, 28($t3) # Call function. Result is on $v0 - jalr $t5 + jalr $t4 sw $v0, -68($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1285,55 +1252,61 @@ function_main_at_Main: addu $fp, $sp, 96 # LOCAL local_main_at_Main_internal_10 --> -44($fp) # local_main_at_Main_internal_10 = ALLOCATE List - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) - la $t5, List - sw $t5, 8($v0) - li $t5, 4 - sw $t5, 12($v0) - move $t5, $v0 - # Allocating 8 bytes of memory - li $a0, 8 + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, List + sw $t4, 12($v0) + li $t4, 4 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall - sw $t5, 0($v0) - la $t5, List_start - sw $t5, 4($v0) - move $t4, $v0 - sw $t4, -44($fp) + sw $t4, 0($v0) + la $t4, List_start + sw $t4, 4($v0) + # Load type offset + li $t4, 16 + sw $t4, 8($v0) + move $t3, $v0 + sw $t3, -44($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # LOCAL local_main_at_Main_internal_10 --> -44($fp) # local_main_at_Main_internal_8 = local_main_at_Main_internal_10 - lw $t4, -44($fp) - sw $t4, -36($fp) + lw $t3, -44($fp) + sw $t3, -36($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG 1 - li $t4, 1 + li $t3, 1 # Push arg into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t3, 0($sp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 cons # Save new self pointer in $s1 lw $s1, -36($fp) # Get pointer to type - lw $t4, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t5, 0($t4) + lw $t4, 0($t3) # Get pointer to function address - lw $t6, 24($t5) + lw $t5, 24($t4) # Call function. Result is on $v0 - jalr $t6 + jalr $t5 sw $v0, -40($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1341,29 +1314,29 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_6 --> -28($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # local_main_at_Main_internal_6 = local_main_at_Main_internal_9 - lw $t4, -40($fp) - sw $t4, -28($fp) + lw $t3, -40($fp) + sw $t3, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG 2 - li $t4, 2 + li $t3, 2 # Push arg into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t3, 0($sp) # LOCAL local_main_at_Main_internal_6 --> -28($fp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 cons # Save new self pointer in $s1 lw $s1, -28($fp) # Get pointer to type - lw $t4, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t5, 0($t4) + lw $t4, 0($t3) # Get pointer to function address - lw $t6, 24($t5) + lw $t5, 24($t4) # Call function. Result is on $v0 - jalr $t6 + jalr $t5 sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1371,29 +1344,29 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_4 --> -20($fp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # local_main_at_Main_internal_4 = local_main_at_Main_internal_7 - lw $t4, -32($fp) - sw $t4, -20($fp) + lw $t3, -32($fp) + sw $t3, -20($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG 3 - li $t4, 3 + li $t3, 3 # Push arg into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t3, 0($sp) # LOCAL local_main_at_Main_internal_4 --> -20($fp) # LOCAL local_main_at_Main_internal_5 --> -24($fp) # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 cons # Save new self pointer in $s1 lw $s1, -20($fp) # Get pointer to type - lw $t4, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t5, 0($t4) + lw $t4, 0($t3) # Get pointer to function address - lw $t6, 24($t5) + lw $t5, 24($t4) # Call function. Result is on $v0 - jalr $t6 + jalr $t5 sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1401,29 +1374,29 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_2 --> -12($fp) # LOCAL local_main_at_Main_internal_5 --> -24($fp) # local_main_at_Main_internal_2 = local_main_at_Main_internal_5 - lw $t4, -24($fp) - sw $t4, -12($fp) + lw $t3, -24($fp) + sw $t3, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG 4 - li $t4, 4 + li $t3, 4 # Push arg into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t3, 0($sp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 cons # Save new self pointer in $s1 lw $s1, -12($fp) # Get pointer to type - lw $t4, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t5, 0($t4) + lw $t4, 0($t3) # Get pointer to function address - lw $t6, 24($t5) + lw $t5, 24($t4) # Call function. Result is on $v0 - jalr $t6 + jalr $t5 sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1431,47 +1404,47 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 - lw $t4, -16($fp) - sw $t4, -4($fp) + lw $t3, -16($fp) + sw $t3, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG 5 - li $t4, 5 + li $t3, 5 # Push arg into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t3, 0($sp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 cons # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t4, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t5, 0($t4) + lw $t4, 0($t3) # Get pointer to function address - lw $t6, 24($t5) + lw $t5, 24($t4) # Call function. Result is on $v0 - jalr $t6 + jalr $t5 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # # LOCAL local_main_at_Main_internal_1 --> -8($fp) - lw $t4, -8($fp) - sw $t4, 8($s1) + lw $t3, -8($fp) + sw $t3, 12($s1) label_WHILE_3: # local_main_at_Main_internal_13 = GETATTRIBUTE mylist Main # LOCAL local_main_at_Main_internal_13 --> -56($fp) - lw $t4, 8($s1) - sw $t4, -56($fp) + lw $t3, 12($s1) + sw $t3, -56($fp) # LOCAL local_main_at_Main_internal_11 --> -48($fp) # LOCAL local_main_at_Main_internal_13 --> -56($fp) # local_main_at_Main_internal_11 = local_main_at_Main_internal_13 - lw $t4, -56($fp) - sw $t4, -48($fp) + lw $t3, -56($fp) + sw $t3, -48($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1481,84 +1454,84 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -48($fp) # Get pointer to type - lw $t4, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t5, 0($t4) + lw $t4, 0($t3) # Get pointer to function address - lw $t6, 12($t5) + lw $t5, 12($t4) # Call function. Result is on $v0 - jalr $t6 + jalr $t5 sw $v0, -52($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # IF_ZERO local_main_at_Main_internal_12 GOTO label_FALSE_5 # IF_ZERO local_main_at_Main_internal_12 GOTO label_FALSE_5 - lw $t4, -52($fp) - beq $t4, 0, label_FALSE_5 + lw $t3, -52($fp) + beq $t3, 0, label_FALSE_5 # LOCAL local_main_at_Main_internal_14 --> -60($fp) # local_main_at_Main_internal_14 = 0 - li $t4, 0 - sw $t4, -60($fp) + li $t3, 0 + sw $t3, -60($fp) # GOTO label_NOT_END_6 j label_NOT_END_6 label_FALSE_5: # LOCAL local_main_at_Main_internal_14 --> -60($fp) # local_main_at_Main_internal_14 = 1 - li $t4, 1 - sw $t4, -60($fp) + li $t3, 1 + sw $t3, -60($fp) label_NOT_END_6: # IF_ZERO local_main_at_Main_internal_14 GOTO label_WHILE_END_4 # IF_ZERO local_main_at_Main_internal_14 GOTO label_WHILE_END_4 - lw $t4, -60($fp) - beq $t4, 0, label_WHILE_END_4 + lw $t3, -60($fp) + beq $t3, 0, label_WHILE_END_4 # LOCAL local_main_at_Main_internal_17 --> -72($fp) # local_main_at_Main_internal_17 = SELF sw $s1, -72($fp) # LOCAL local_main_at_Main_internal_15 --> -64($fp) # LOCAL local_main_at_Main_internal_17 --> -72($fp) # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 - lw $t4, -72($fp) - sw $t4, -64($fp) + lw $t3, -72($fp) + sw $t3, -64($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # local_main_at_Main_internal_18 = GETATTRIBUTE mylist Main # LOCAL local_main_at_Main_internal_18 --> -76($fp) - lw $t4, 8($s1) - sw $t4, -76($fp) + lw $t3, 12($s1) + sw $t3, -76($fp) # ARG local_main_at_Main_internal_18 # LOCAL local_main_at_Main_internal_18 --> -76($fp) - lw $t4, -76($fp) + lw $t3, -76($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t3, 0($sp) # LOCAL local_main_at_Main_internal_15 --> -64($fp) # LOCAL local_main_at_Main_internal_16 --> -68($fp) # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 print_list # Save new self pointer in $s1 lw $s1, -64($fp) # Get pointer to type - lw $t4, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t5, 0($t4) + lw $t4, 0($t3) # Get pointer to function address - lw $t6, 28($t5) + lw $t5, 28($t4) # Call function. Result is on $v0 - jalr $t6 + jalr $t5 sw $v0, -68($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # local_main_at_Main_internal_21 = GETATTRIBUTE mylist Main # LOCAL local_main_at_Main_internal_21 --> -88($fp) - lw $t4, 8($s1) - sw $t4, -88($fp) + lw $t3, 12($s1) + sw $t3, -88($fp) # LOCAL local_main_at_Main_internal_19 --> -80($fp) # LOCAL local_main_at_Main_internal_21 --> -88($fp) # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 - lw $t4, -88($fp) - sw $t4, -80($fp) + lw $t3, -88($fp) + sw $t3, -80($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1568,21 +1541,21 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -80($fp) # Get pointer to type - lw $t4, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t5, 0($t4) + lw $t4, 0($t3) # Get pointer to function address - lw $t6, 20($t5) + lw $t5, 20($t4) # Call function. Result is on $v0 - jalr $t6 + jalr $t5 sw $v0, -84($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # # LOCAL local_main_at_Main_internal_20 --> -84($fp) - lw $t4, -84($fp) - sw $t4, 8($s1) + lw $t3, -84($fp) + sw $t3, 12($s1) # GOTO label_WHILE_3 j label_WHILE_3 label_WHILE_END_4: diff --git a/tests/codegen/print-cool.mips b/tests/codegen/print-cool.mips index 22071252..8eead8ef 100644 --- a/tests/codegen/print-cool.mips +++ b/tests/codegen/print-cool.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 18:41:50 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 11:25:28 2020 # School of Math and Computer Science, University of Havana # @@ -92,42 +92,11 @@ data_0: .asciiz "" # -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_Main_tdt_entry__: .word 1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 +IO__TDT: .word 0, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, 0 # @@ -208,7 +177,7 @@ function_out_string_at_IO: # PARAM param_out_string_at_IO_x_0 --> 0($fp) # PRINT_STR param_out_string_at_IO_x_0 lw $v0, 0($fp) - lw $a0, 8($v0) + lw $a0, 12($v0) li $v0, 4 syscall # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) @@ -325,61 +294,64 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self - lw $t1, 12($s1) + lw $t0, 16($s1) # Get second string length from param lw $v0, 0($fp) - lw $t2, 12($v0) + lw $t1, 16($v0) # Save new string length in a0 for memory allocation - addu $a0, $t1, $t2 - move $t4, $a0 + addu $a0, $t0, $t1 + move $t3, $a0 # Get first string from self - lw $t1, 8($s1) + lw $t0, 12($s1) # Get second string from param - lw $t2, 8($v0) + lw $t1, 12($v0) addu $a0, $a0, 1 li $v0, 9 syscall - move $t3, $v0 - move $t5, $zero + move $t2, $v0 + move $t4, $zero concat_loop1: - # Compare t1 with \0 - lb $t5, 0($t1) - beqz $t5, concat_loop1_end + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end # Copy 1 byte - sb $t5, 0($t3) - addu $t3, $t3, 1 - addu $t1, $t1, 1 + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 j concat_loop1 concat_loop1_end: # Copy second string concat_loop2: - # Compare t2 with \0 - lb $t5, 0($t2) - beqz $t5, concat_loop2_end + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end # Copy 1 byte - sb $t5, 0($t3) - addu $t3, $t3, 1 + sb $t4, 0($t2) addu $t2, $t2, 1 + addu $t1, $t1, 1 j concat_loop2 concat_loop2_end: - sb $zero, 0($t3) + sb $zero, 0($t2) # v0 contains resulting string - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - sw $t2, 8($v0) - sw $t4, 12($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) sw $v0, -4($fp) # RETURN local_concat_at_String_internal_0 lw $v0, -4($fp) @@ -409,38 +381,41 @@ function_substr_at_String: # LOCAL local_substr_at_String_internal_0 --> -4($fp) # PARAM param_substr_at_String_l_0 --> 4($fp) # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t1, 8($s1) - lw $t3, 4($fp) - addu $t1, $t1, $t3 + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 lw $a0, 0($fp) - move $t4, $a0 - move $t2, $a0 + move $t3, $a0 + move $t1, $a0 addu $a0, $a0, 1 li $v0, 9 syscall - move $t3, $v0 + move $t2, $v0 substr_loop: - beqz $t2, substr_end - lb $a0, 0($t1) - sb $a0, 0($t3) - addu $t1, $t1, 1 - addu $t3, $t3, 1 - subu $t2, $t2, 1 + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 j substr_loop substr_end: - sb $zero, 0($t3) - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - sw $t2, 8($v0) - sw $t4, 12($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) sw $v0, -4($fp) # RETURN local_substr_at_String_internal_0 lw $v0, -4($fp) @@ -467,8 +442,8 @@ function_length_at_String: addu $fp, $sp, 32 # local_length_at_String_internal_0 = GETATTRIBUTE length String # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t1, 12($s1) - sw $t1, -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) # RETURN local_length_at_String_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_length_at_String. @@ -492,29 +467,35 @@ entry: addu $fp, $sp, 32 # LOCAL local__internal_0 --> -4($fp) # local__internal_0 = ALLOCATE Main - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - la $t3, Main - sw $t3, 8($v0) - li $t3, 4 - sw $t3, 12($v0) - move $t3, $v0 - # Allocating 8 bytes of memory - li $a0, 8 + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall - sw $t3, 0($v0) - la $t3, Main_start - sw $t3, 4($v0) - move $t2, $v0 - sw $t2, -4($fp) + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) + move $t1, $v0 + sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) # local__internal_1 = CALL function_main_at_Main @@ -548,41 +529,47 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_2 --> -12($fp) # LOCAL local_main_at_Main_internal_4 --> -20($fp) # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 - lw $t2, -20($fp) - sw $t2, -12($fp) + lw $t1, -20($fp) + sw $t1, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # local_main_at_Main_internal_9 = ALLOCATE Object - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - la $t4, Object - sw $t4, 8($v0) - li $t4, 6 - sw $t4, 12($v0) - move $t4, $v0 - # Allocating 8 bytes of memory - li $a0, 8 + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Object + sw $t3, 12($v0) + li $t3, 6 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall - sw $t4, 0($v0) - la $t4, Object_start - sw $t4, 4($v0) - move $t3, $v0 - sw $t3, -40($fp) + sw $t3, 0($v0) + la $t3, Object_start + sw $t3, 4($v0) + # Load type offset + li $t3, 4 + sw $t3, 8($v0) + move $t2, $v0 + sw $t2, -40($fp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t3, -40($fp) - sw $t3, -32($fp) + lw $t2, -40($fp) + sw $t2, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -592,13 +579,13 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -32($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t3, 0($t2) # Get pointer to function address - lw $t5, 4($t4) + lw $t4, 4($t3) # Call function. Result is on $v0 - jalr $t5 + jalr $t4 sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -606,57 +593,57 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_5 --> -24($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # local_main_at_Main_internal_5 = local_main_at_Main_internal_8 - lw $t3, -36($fp) - sw $t3, -24($fp) + lw $t2, -36($fp) + sw $t2, -24($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG 4 - li $t3, 4 + li $t2, 4 # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t2, 0($sp) # ARG 1 - li $t3, 1 + li $t2, 1 # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t2, 0($sp) # LOCAL local_main_at_Main_internal_5 --> -24($fp) # LOCAL local_main_at_Main_internal_6 --> -28($fp) # local_main_at_Main_internal_6 = VCALL local_main_at_Main_internal_5 substr # Save new self pointer in $s1 lw $s1, -24($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t3, 0($t2) # Get pointer to function address - lw $t5, 4($t4) + lw $t4, 4($t3) # Call function. Result is on $v0 - jalr $t5 + jalr $t4 sw $v0, -28($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_main_at_Main_internal_6 # LOCAL local_main_at_Main_internal_6 --> -28($fp) - lw $t3, -28($fp) + lw $t2, -28($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t2, 0($sp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string # Save new self pointer in $s1 lw $s1, -12($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t3, 0($t2) # Get pointer to function address - lw $t5, 12($t4) + lw $t4, 12($t3) # Call function. Result is on $v0 - jalr $t5 + jalr $t4 sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -664,8 +651,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 - lw $t3, -16($fp) - sw $t3, -4($fp) + lw $t2, -16($fp) + sw $t2, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -674,67 +661,73 @@ function_main_at_Main: sw $s1, -64($fp) # IF_ZERO local_main_at_Main_internal_15 GOTO label_TRUE_1 # IF_ZERO local_main_at_Main_internal_15 GOTO label_TRUE_1 - lw $t3, -64($fp) - beq $t3, 0, label_TRUE_1 + lw $t2, -64($fp) + beq $t2, 0, label_TRUE_1 # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string for type Bool - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - la $t3, Bool - sw $t3, 8($v0) - li $t3, 4 - sw $t3, 12($v0) - move $t3, $v0 + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Bool + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - sw $t3, 0($v0) - la $t3, Bool_start - sw $t3, 4($v0) - li $t3, 0 - sw $t3, 8($v0) + sw $t2, 0($v0) + la $t2, Bool_start + sw $t2, 4($v0) + li $t2, 0 + sw $t2, 8($v0) sw $v0, -60($fp) # GOTO label_END_2 j label_END_2 label_TRUE_1: # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string for type Bool - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - la $t3, Bool - sw $t3, 8($v0) - li $t3, 4 - sw $t3, 12($v0) - move $t3, $v0 + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Bool + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - sw $t3, 0($v0) - la $t3, Bool_start - sw $t3, 4($v0) - li $t3, 1 - sw $t3, 8($v0) + sw $t2, 0($v0) + la $t2, Bool_start + sw $t2, 4($v0) + li $t2, 1 + sw $t2, 8($v0) sw $v0, -60($fp) label_END_2: # LOCAL local_main_at_Main_internal_12 --> -52($fp) # LOCAL local_main_at_Main_internal_14 --> -60($fp) # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 -lw $t3, -60($fp) -sw $t3, -52($fp) +lw $t2, -60($fp) +sw $t2, -52($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -744,13 +737,13 @@ sw $s1, 0($sp) # Save new self pointer in $s1 lw $s1, -52($fp) # Get pointer to type -lw $t3, 4($s1) +lw $t2, 4($s1) # Get pointer to type's VTABLE -lw $t4, 0($t3) +lw $t3, 0($t2) # Get pointer to function address -lw $t5, 4($t4) +lw $t4, 4($t3) # Call function. Result is on $v0 -jalr $t5 +jalr $t4 sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -758,57 +751,57 @@ addu $sp, $sp, 4 # LOCAL local_main_at_Main_internal_10 --> -44($fp) # LOCAL local_main_at_Main_internal_13 --> -56($fp) # local_main_at_Main_internal_10 = local_main_at_Main_internal_13 -lw $t3, -56($fp) -sw $t3, -44($fp) +lw $t2, -56($fp) +sw $t2, -44($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG 1 -li $t3, 1 +li $t2, 1 # Push arg into stack subu $sp, $sp, 4 -sw $t3, 0($sp) +sw $t2, 0($sp) # ARG 3 -li $t3, 3 +li $t2, 3 # Push arg into stack subu $sp, $sp, 4 -sw $t3, 0($sp) +sw $t2, 0($sp) # LOCAL local_main_at_Main_internal_10 --> -44($fp) # LOCAL local_main_at_Main_internal_11 --> -48($fp) # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 substr # Save new self pointer in $s1 lw $s1, -44($fp) # Get pointer to type -lw $t3, 4($s1) +lw $t2, 4($s1) # Get pointer to type's VTABLE -lw $t4, 0($t3) +lw $t3, 0($t2) # Get pointer to function address -lw $t5, 4($t4) +lw $t4, 4($t3) # Call function. Result is on $v0 -jalr $t5 +jalr $t4 sw $v0, -48($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_main_at_Main_internal_11 # LOCAL local_main_at_Main_internal_11 --> -48($fp) -lw $t3, -48($fp) +lw $t2, -48($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t3, 0($sp) +sw $t2, 0($sp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type -lw $t3, 4($s1) +lw $t2, 4($s1) # Get pointer to type's VTABLE -lw $t4, 0($t3) +lw $t3, 0($t2) # Get pointer to function address -lw $t5, 12($t4) +lw $t4, 12($t3) # Call function. Result is on $v0 -jalr $t5 +jalr $t4 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -819,45 +812,48 @@ sw $s1, -76($fp) # LOCAL local_main_at_Main_internal_16 --> -68($fp) # LOCAL local_main_at_Main_internal_18 --> -76($fp) # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 -lw $t3, -76($fp) -sw $t3, -68($fp) +lw $t2, -76($fp) +sw $t2, -68($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_main_at_Main_internal_19 --> -80($fp) -# Allocating 16 bytes of memory -li $a0, 16 +# Allocating 20 bytes of memory +li $a0, 20 li $v0, 9 syscall # Allocating string -la $t3, String -sw $t3, 0($v0) -la $t3, String_start -sw $t3, 4($v0) -la $t3, data_2 -sw $t3, 8($v0) -li $t3, 2 -sw $t3, 12($v0) +la $t2, String +sw $t2, 0($v0) +la $t2, String_start +sw $t2, 4($v0) +# Load type offset +li $t2, 8 +sw $t2, 8($v0) +la $t2, data_2 +sw $t2, 12($v0) +li $t2, 2 +sw $t2, 16($v0) sw $v0, -80($fp) # ARG local_main_at_Main_internal_19 # LOCAL local_main_at_Main_internal_19 --> -80($fp) -lw $t3, -80($fp) +lw $t2, -80($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t3, 0($sp) +sw $t2, 0($sp) # LOCAL local_main_at_Main_internal_16 --> -68($fp) # LOCAL local_main_at_Main_internal_17 --> -72($fp) # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string # Save new self pointer in $s1 lw $s1, -68($fp) # Get pointer to type -lw $t3, 4($s1) +lw $t2, 4($s1) # Get pointer to type's VTABLE -lw $t4, 0($t3) +lw $t3, 0($t2) # Get pointer to function address -lw $t5, 12($t4) +lw $t4, 12($t3) # Call function. Result is on $v0 -jalr $t5 +jalr $t4 sw $v0, -72($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) From cc008ed8f439a79b9405537c2ef2d0d737dc967f Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sat, 5 Dec 2020 11:38:04 -0500 Subject: [PATCH 145/162] Fix TDT lookups to just move to an offset --- src/travels/ciltomips.py | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 3eaeb844..da68e25f 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -359,7 +359,7 @@ def _(self, node: AllocateBoolNode): self.register_instruction(LA(reg, "String_start")) self.register_instruction(SW(reg, "4($v0)")) - # Cargar el offset del tipo + # Cargar el offset del tipo self.comment("Load type offset") offset = next(i for i, t in enumerate(self.mips_types) if t == "String") * 4 self.register_instruction(LI(reg, offset)) @@ -1039,8 +1039,30 @@ def _(self, node: cil.PrintNode): @visit.register def _(self, node: cil.TdtLookupNode): - # Los nodos TDT siempre tienen - pass + # Cargar el valor que esta en offset en la tabla del tipo + self.add_source_line_comment(node) + dest = self.visit(node.dest) + offset_addr = self.visit(node.j) + tdt_table = self.get_available_register() + offset = self.get_available_register() + + assert offset is not None + assert tdt_table is not None + assert offset_addr is not None + assert dest is not None + + # Cargar la tabla referente al tipo + self.comment(f"Load TDT pointer to type {node.i}") + self.register_instruction(LA(tdt_table, f"{node.i}__TDT")) + + self.register_instruction(LW(offset, offset_addr)) + + # mover el puntero offset bytes + self.register_instruction(ADDU(tdt_table, tdt_table, offset)) + + self.comment("Save distance") + self.register_instruction(LW(offset, f"0(${REG_TO_STR[tdt_table]})")) + self.register_instruction(SW(offset, dest)) @visit.register def _(self, node: int): From 5fe3b7e19c231277da45ab107106afcd736daf38 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sat, 5 Dec 2020 17:37:47 -0500 Subject: [PATCH 146/162] Fix case expr. Change find min algorithm --- src/cil/nodes.py | 13 +- src/testing.mips | 2544 ++++++++++++++++++++++++++++---- src/testing.py | 137 +- src/travels/ciltomips.py | 61 +- src/travels/ctcill.py | 37 +- tests/codegen/atoi.mips | 2072 +++++++++++++------------- tests/codegen/book_list.mips | 259 ++-- tests/codegen/fib.mips | 16 +- tests/codegen/hello_world.mips | 16 +- tests/codegen/io.mips | 16 +- tests/codegen/list.mips | 16 +- tests/codegen/print-cool.mips | 16 +- 12 files changed, 3759 insertions(+), 1444 deletions(-) diff --git a/src/cil/nodes.py b/src/cil/nodes.py index b5d85eeb..543e3336 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -162,9 +162,11 @@ def __init__(self, label: str): class StaticCallNode(InstructionNode): - def __init__(self, function: str, dest: LocalNode): + def __init__(self, obj: LocalNode, type_: Type, function: str, dest: LocalNode): self.function = function self.dest = dest + self.obj = obj + self.type_ = type_ class DynamicCallNode(InstructionNode): @@ -290,4 +292,11 @@ class AbortNode(InstructionNode): class AllocateBoolNode(InstructionNode): def __init__(self, dest: LocalNode, value: int) -> None: self.dest = dest - self.value = value \ No newline at end of file + self.value = value + + +class JumpIfGreater(InstructionNode): + def __init__(self, src1: LocalNode, src2: LocalNode, label: str) -> None: + self.left = src1 + self.rigt = src2 + self.label = label \ No newline at end of file diff --git a/src/testing.mips b/src/testing.mips index c08e4862..01dfefa7 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 11:25:23 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 17:36:28 2020 # School of Math and Computer Science, University of Havana # @@ -13,6 +13,16 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END +Book: .asciiz "Book" +# Function END +Article: .asciiz "Article" +# Function END +BookList: .asciiz "BookList" +# Function END +Cons: .asciiz "Cons" +# Function END +Nil: .asciiz "Nil" +# Function END Main: .asciiz "Main" # Function END # @@ -74,8 +84,78 @@ Bool_end: # +# **** VTABLE for type Book **** +Book_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_initBook_at_Book, function_print_at_Book +# Function END +# + + +# **** Type RECORD for type Book **** +Book_start: + Book_vtable_pointer: .word Book_vtable + # Function END +Book_end: +# + + +# **** VTABLE for type Article **** +Article_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_initBook_at_Book, function_print_at_Article, function_initArticle_at_Article +# Function END +# + + +# **** Type RECORD for type Article **** +Article_start: + Article_vtable_pointer: .word Article_vtable + # Function END +Article_end: +# + + +# **** VTABLE for type BookList **** +BookList_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_BookList, function_cons_at_BookList, function_car_at_BookList, function_cdr_at_BookList, function_print_list_at_BookList +# Function END +# + + +# **** Type RECORD for type BookList **** +BookList_start: + BookList_vtable_pointer: .word BookList_vtable + # Function END +BookList_end: +# + + +# **** VTABLE for type Cons **** +Cons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_Cons, function_cons_at_BookList, function_car_at_Cons, function_cdr_at_Cons, function_print_list_at_Cons, function_init_at_Cons +# Function END +# + + +# **** Type RECORD for type Cons **** +Cons_start: + Cons_vtable_pointer: .word Cons_vtable + # Function END +Cons_end: +# + + +# **** VTABLE for type Nil **** +Nil_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_Nil, function_cons_at_BookList, function_car_at_BookList, function_cdr_at_BookList, function_print_list_at_Nil +# Function END +# + + +# **** Type RECORD for type Nil **** +Nil_start: + Nil_vtable_pointer: .word Nil_vtable + # Function END +Nil_end: +# + + # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main # Function END # @@ -92,15 +172,68 @@ data_0: .asciiz "" # -IO__TDT: .word 0, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, 0 +IO__TDT: .word 0, -1, -1, -1, 1, 2, 1, 2, 2, -1 +Object__TDT: .word 1, 0, 1, 1, 2, 3, 2, 3, 3, 1 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 +Book__TDT: .word -1, -1, -1, -1, 0, 1, -1, -1, -1, -1 +Article__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1, -1 +BookList__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 1, -1 +Cons__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 +Nil__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 +# + + +data_2: .asciiz "title: " +# + + +data_3: .asciiz "\n" +# + + +data_4: .asciiz "author: " +# + + +data_5: .asciiz "\n" +# + + +data_6: .asciiz "periodical: " +# + + +data_7: .asciiz "\n" +# + + +data_8: .asciiz "- dynamic type was Book -\n" +# + + +data_9: .asciiz "- dynamic type was Article -\n" +# + + +data_10: .asciiz "Compilers, Principles, Techniques, and Tools" +# + + +data_11: .asciiz "Aho, Sethi, and Ullman" +# + + +data_12: .asciiz "The Top 100 CD_ROMs" +# + + +data_13: .asciiz "Ulanoff" # -data_2: .asciiz "\n" +data_14: .asciiz "PC Magazine" # @@ -294,7 +427,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -484,23 +617,39 @@ entry: li $t2, 4 sw $t2, 16($v0) move $t2, $v0 - # Allocating 12 bytes of memory - li $a0, 12 + # Allocating 16 bytes of memory + li $a0, 16 li $v0, 9 syscall sw $t2, 0($v0) la $t2, Main_start sw $t2, 4($v0) # Load type offset - li $t2, 16 + li $t2, 36 sw $t2, 8($v0) move $t1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__books__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) - # local__internal_1 = CALL function_main_at_Main + # local__internal_1 = CALL main # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 12($t1) + # Call function. Result is on $v0 + jalr $t2 sw $v0, -8($fp) # RETURN 0 li $v0, 0 @@ -515,352 +664,1591 @@ entry: # Function END -# function_main_at_Main implementation. +# __Book__attrib__title__init implementation. # @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 88 +__Book__attrib__title__init: + # Allocate stack frame for function __Book__attrib__title__init. + subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 88 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = SELF - sw $s1, -20($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 - lw $t1, -20($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = ALLOCATE Object + addu $fp, $sp, 32 + # LOCAL local_ttrib__title__init_internal_0 --> -4($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Object - sw $t3, 12($v0) - li $t3, 6 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 12 bytes of memory - li $a0, 12 + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_0 + sw $t1, 12($v0) + li $t1, 0 + sw $t1, 16($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__title__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Book__attrib__title__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Book__attrib__author__init implementation. +# @Params: +__Book__attrib__author__init: + # Allocate stack frame for function __Book__attrib__author__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__author__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall - sw $t3, 0($v0) - la $t3, Object_start - sw $t3, 4($v0) + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) # Load type offset - li $t3, 4 - sw $t3, 8($v0) - move $t2, $v0 - sw $t2, -40($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t2, -40($fp) - sw $t2, -32($fp) + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_0 + sw $t1, 12($v0) + li $t1, 0 + sw $t1, 16($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__author__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Book__attrib__author__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_initBook_at_Book implementation. +# @Params: +# 0($fp) = param_initBook_at_Book_title_p_0 +# 4($fp) = param_initBook_at_Book_author_p_1 +function_initBook_at_Book: + # Allocate stack frame for function function_initBook_at_Book. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_initBook_at_Book_title_p_0 --> 4($fp) + lw $t1, 4($fp) + sw $t1, 12($s1) + # + # PARAM param_initBook_at_Book_author_p_1 --> 0($fp) + lw $t1, 0($fp) + sw $t1, 16($s1) + # LOCAL local_initBook_at_Book_internal_0 --> -4($fp) + # local_initBook_at_Book_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_initBook_at_Book_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_initBook_at_Book. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_print_at_Book implementation. +# @Params: +function_print_at_Book: + # Allocate stack frame for function function_print_at_Book. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # LOCAL local_print_at_Book_internal_6 --> -28($fp) + # local_print_at_Book_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_print_at_Book_internal_4 --> -20($fp) + # LOCAL local_print_at_Book_internal_6 --> -28($fp) + # local_print_at_Book_internal_4 = local_print_at_Book_internal_6 + lw $t1, -28($fp) + sw $t1, -20($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 type_name + # LOCAL local_print_at_Book_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_2 + sw $t1, 12($v0) + li $t1, 12 + sw $t1, 16($v0) + sw $v0, -32($fp) + # ARG local_print_at_Book_internal_7 + # LOCAL local_print_at_Book_internal_7 --> -32($fp) + lw $t1, -32($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_4 --> -20($fp) + # LOCAL local_print_at_Book_internal_5 --> -24($fp) + # local_print_at_Book_internal_5 = VCALL local_print_at_Book_internal_4 out_string # Save new self pointer in $s1 - lw $s1, -32($fp) + lw $s1, -20($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 4($t3) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $t4 - sw $v0, -36($fp) + jalr $t3 + sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_5 = local_main_at_Main_internal_8 - lw $t2, -36($fp) - sw $t2, -24($fp) + # LOCAL local_print_at_Book_internal_2 --> -12($fp) + # LOCAL local_print_at_Book_internal_5 --> -24($fp) + # local_print_at_Book_internal_2 = local_print_at_Book_internal_5 + lw $t1, -24($fp) + sw $t1, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # ARG 4 - li $t2, 4 + # local_print_at_Book_internal_8 = GETATTRIBUTE title Book + # LOCAL local_print_at_Book_internal_8 --> -36($fp) + lw $t1, 12($s1) + sw $t1, -36($fp) + # ARG local_print_at_Book_internal_8 + # LOCAL local_print_at_Book_internal_8 --> -36($fp) + lw $t1, -36($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) - # ARG 1 - li $t2, 1 + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_2 --> -12($fp) + # LOCAL local_print_at_Book_internal_3 --> -16($fp) + # local_print_at_Book_internal_3 = VCALL local_print_at_Book_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_0 --> -4($fp) + # LOCAL local_print_at_Book_internal_3 --> -16($fp) + # local_print_at_Book_internal_0 = local_print_at_Book_internal_3 + lw $t1, -16($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Book_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_3 + sw $t1, 12($v0) + li $t1, 2 + sw $t1, 16($v0) + sw $v0, -40($fp) + # ARG local_print_at_Book_internal_9 + # LOCAL local_print_at_Book_internal_9 --> -40($fp) + lw $t1, -40($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # local_main_at_Main_internal_6 = VCALL local_main_at_Main_internal_5 substr + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_0 --> -4($fp) + # LOCAL local_print_at_Book_internal_1 --> -8($fp) + # local_print_at_Book_internal_1 = VCALL local_print_at_Book_internal_0 out_string # Save new self pointer in $s1 - lw $s1, -24($fp) + lw $s1, -4($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_16 --> -68($fp) + # local_print_at_Book_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_print_at_Book_internal_14 --> -60($fp) + # LOCAL local_print_at_Book_internal_16 --> -68($fp) + # local_print_at_Book_internal_14 = local_print_at_Book_internal_16 + lw $t1, -68($fp) + sw $t1, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Book_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_4 + sw $t1, 12($v0) + li $t1, 12 + sw $t1, 16($v0) + sw $v0, -72($fp) + # ARG local_print_at_Book_internal_17 + # LOCAL local_print_at_Book_internal_17 --> -72($fp) + lw $t1, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_14 --> -60($fp) + # LOCAL local_print_at_Book_internal_15 --> -64($fp) + # local_print_at_Book_internal_15 = VCALL local_print_at_Book_internal_14 out_string + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 4($t3) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $t4 - sw $v0, -28($fp) + jalr $t3 + sw $v0, -64($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_6 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - lw $t2, -28($fp) + # LOCAL local_print_at_Book_internal_12 --> -52($fp) + # LOCAL local_print_at_Book_internal_15 --> -64($fp) + # local_print_at_Book_internal_12 = local_print_at_Book_internal_15 + lw $t1, -64($fp) + sw $t1, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Book_internal_18 = GETATTRIBUTE author Book + # LOCAL local_print_at_Book_internal_18 --> -76($fp) + lw $t1, 16($s1) + sw $t1, -76($fp) + # ARG local_print_at_Book_internal_18 + # LOCAL local_print_at_Book_internal_18 --> -76($fp) + lw $t1, -76($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_12 --> -52($fp) + # LOCAL local_print_at_Book_internal_13 --> -56($fp) + # local_print_at_Book_internal_13 = VCALL local_print_at_Book_internal_12 out_string # Save new self pointer in $s1 - lw $s1, -12($fp) + lw $s1, -52($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 12($t3) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $t4 - sw $v0, -16($fp) + jalr $t3 + sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 - lw $t2, -16($fp) - sw $t2, -4($fp) + # LOCAL local_print_at_Book_internal_10 --> -44($fp) + # LOCAL local_print_at_Book_internal_13 --> -56($fp) + # local_print_at_Book_internal_10 = local_print_at_Book_internal_13 + lw $t1, -56($fp) + sw $t1, -44($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = SELF - sw $s1, -64($fp) - # IF_ZERO local_main_at_Main_internal_15 GOTO label_TRUE_1 - # IF_ZERO local_main_at_Main_internal_15 GOTO label_TRUE_1 - lw $t2, -64($fp) - beq $t2, 0, label_TRUE_1 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_print_at_Book_internal_19 --> -80($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type Bool - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Bool - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_5 + sw $t1, 12($v0) + li $t1, 2 + sw $t1, 16($v0) + sw $v0, -80($fp) + # ARG local_print_at_Book_internal_19 + # LOCAL local_print_at_Book_internal_19 --> -80($fp) + lw $t1, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_10 --> -44($fp) + # LOCAL local_print_at_Book_internal_11 --> -48($fp) + # local_print_at_Book_internal_11 = VCALL local_print_at_Book_internal_10 out_string + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_20 --> -84($fp) + # local_print_at_Book_internal_20 = SELF + sw $s1, -84($fp) + # RETURN local_print_at_Book_internal_20 + lw $v0, -84($fp) + # Deallocate stack frame for function function_print_at_Book. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 92 + jr $ra + # Function END + + +# __Article__attrib__per_title__init implementation. +# @Params: +__Article__attrib__per_title__init: + # Allocate stack frame for function __Article__attrib__per_title__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local___attrib__per_title__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_0 + sw $t1, 12($v0) + li $t1, 0 + sw $t1, 16($v0) + sw $v0, -4($fp) + # RETURN local___attrib__per_title__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Article__attrib__per_title__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_initArticle_at_Article implementation. +# @Params: +# 0($fp) = param_initArticle_at_Article_title_p_0 +# 4($fp) = param_initArticle_at_Article_author_p_1 +# 8($fp) = param_initArticle_at_Article_per_title_p_2 +function_initArticle_at_Article: + # Allocate stack frame for function function_initArticle_at_Article. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) + # local_initArticle_at_Article_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) + # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) + # local_initArticle_at_Article_internal_0 = local_initArticle_at_Article_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_initArticle_at_Article_title_p_0 + # PARAM param_initArticle_at_Article_title_p_0 --> 8($fp) + lw $t1, 8($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # ARG param_initArticle_at_Article_author_p_1 + # PARAM param_initArticle_at_Article_author_p_1 --> 4($fp) + lw $t1, 4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) + # LOCAL local_initArticle_at_Article_internal_1 --> -8($fp) + # local_initArticle_at_Article_internal_1 = VCALL local_initArticle_at_Article_internal_0 initBook + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 28($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # PARAM param_initArticle_at_Article_per_title_p_2 --> 0($fp) + lw $t1, 0($fp) + sw $t1, 20($s1) + # LOCAL local_initArticle_at_Article_internal_3 --> -16($fp) + # local_initArticle_at_Article_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_initArticle_at_Article_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_initArticle_at_Article. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 12 + jr $ra + # Function END + + +# function_print_at_Article implementation. +# @Params: +function_print_at_Article: + # Allocate stack frame for function function_print_at_Article. + subu $sp, $sp, 60 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 60 + # LOCAL local_print_at_Article_internal_1 --> -8($fp) + # local_print_at_Article_internal_1 = SELF + sw $s1, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Article_internal_0 = CALL print + # LOCAL local_print_at_Article_internal_0 --> -4($fp) + # LOCAL local_print_at_Article_internal_1 --> -8($fp) + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type's VTABLE + la $t1, Book_vtable + # Get pointer to function address + lw $t2, 32($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -4($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Article_internal_8 --> -36($fp) + # local_print_at_Article_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_print_at_Article_internal_6 --> -28($fp) + # LOCAL local_print_at_Article_internal_8 --> -36($fp) + # local_print_at_Article_internal_6 = local_print_at_Article_internal_8 + lw $t1, -36($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Article_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_6 + sw $t1, 12($v0) + li $t1, 13 + sw $t1, 16($v0) + sw $v0, -40($fp) + # ARG local_print_at_Article_internal_9 + # LOCAL local_print_at_Article_internal_9 --> -40($fp) + lw $t1, -40($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Article_internal_6 --> -28($fp) + # LOCAL local_print_at_Article_internal_7 --> -32($fp) + # local_print_at_Article_internal_7 = VCALL local_print_at_Article_internal_6 out_string + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Article_internal_4 --> -20($fp) + # LOCAL local_print_at_Article_internal_7 --> -32($fp) + # local_print_at_Article_internal_4 = local_print_at_Article_internal_7 + lw $t1, -32($fp) + sw $t1, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Article_internal_10 = GETATTRIBUTE per_title Article + # LOCAL local_print_at_Article_internal_10 --> -44($fp) + lw $t1, 20($s1) + sw $t1, -44($fp) + # ARG local_print_at_Article_internal_10 + # LOCAL local_print_at_Article_internal_10 --> -44($fp) + lw $t1, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Article_internal_4 --> -20($fp) + # LOCAL local_print_at_Article_internal_5 --> -24($fp) + # local_print_at_Article_internal_5 = VCALL local_print_at_Article_internal_4 out_string + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Article_internal_2 --> -12($fp) + # LOCAL local_print_at_Article_internal_5 --> -24($fp) + # local_print_at_Article_internal_2 = local_print_at_Article_internal_5 + lw $t1, -24($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Article_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_7 + sw $t1, 12($v0) + li $t1, 2 + sw $t1, 16($v0) + sw $v0, -48($fp) + # ARG local_print_at_Article_internal_11 + # LOCAL local_print_at_Article_internal_11 --> -48($fp) + lw $t1, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Article_internal_2 --> -12($fp) + # LOCAL local_print_at_Article_internal_3 --> -16($fp) + # local_print_at_Article_internal_3 = VCALL local_print_at_Article_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Article_internal_12 --> -52($fp) + # local_print_at_Article_internal_12 = SELF + sw $s1, -52($fp) + # RETURN local_print_at_Article_internal_12 + lw $v0, -52($fp) + # Deallocate stack frame for function function_print_at_Article. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 60 + jr $ra + # Function END + + +# function_isNil_at_BookList implementation. +# @Params: +function_isNil_at_BookList: + # Allocate stack frame for function function_isNil_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_BookList_internal_2 --> -12($fp) + # local_isNil_at_BookList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_isNil_at_BookList_internal_0 --> -4($fp) + # LOCAL local_isNil_at_BookList_internal_2 --> -12($fp) + # local_isNil_at_BookList_internal_0 = local_isNil_at_BookList_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_isNil_at_BookList_internal_0 --> -4($fp) + # LOCAL local_isNil_at_BookList_internal_1 --> -8($fp) + # local_isNil_at_BookList_internal_1 = VCALL local_isNil_at_BookList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN 1 + li $v0, 1 + # Deallocate stack frame for function function_isNil_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cons_at_BookList implementation. +# @Params: +# 0($fp) = param_cons_at_BookList_hd_0 +function_cons_at_BookList: + # Allocate stack frame for function function_cons_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) + # local_cons_at_BookList_new_cell_0 = ALLOCATE Cons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Cons + sw $t3, 12($v0) + li $t3, 4 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Cons_start + sw $t3, 4($v0) + # Load type offset + li $t3, 28 + sw $t3, 8($v0) move $t2, $v0 - # Allocating 12 bytes of memory - li $a0, 12 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Cons__attrib__xcar__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Cons__attrib__xcdr__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t2) + sw $t2, -4($fp) + # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) + # local_cons_at_BookList_internal_1 = ALLOCATE Cons + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall - sw $t2, 0($v0) - la $t2, Bool_start - sw $t2, 4($v0) - li $t2, 0 - sw $t2, 8($v0) - sw $v0, -60($fp) - # GOTO label_END_2 -j label_END_2 -label_TRUE_1: - # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Cons + sw $t4, 12($v0) + li $t4, 4 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Cons_start + sw $t4, 4($v0) + # Load type offset + li $t4, 28 + sw $t4, 8($v0) + move $t3, $v0 + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Cons__attrib__xcar__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t3) + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Cons__attrib__xcdr__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t3) + sw $t3, -8($fp) + # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) + # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) + # local_cons_at_BookList_new_cell_0 = local_cons_at_BookList_internal_1 + lw $t3, -8($fp) + sw $t3, -4($fp) + # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) + # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) + # local_cons_at_BookList_internal_2 = local_cons_at_BookList_new_cell_0 + lw $t3, -4($fp) + sw $t3, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cons_at_BookList_hd_0 + # PARAM param_cons_at_BookList_hd_0 --> 0($fp) + lw $t3, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) + # local_cons_at_BookList_internal_4 = SELF + sw $s1, -20($fp) + # ARG local_cons_at_BookList_internal_4 + # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) + lw $t3, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) + # LOCAL local_cons_at_BookList_internal_3 --> -16($fp) + # local_cons_at_BookList_internal_3 = VCALL local_cons_at_BookList_internal_2 init + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 48($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_cons_at_BookList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_cons_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_car_at_BookList implementation. +# @Params: +function_car_at_BookList: + # Allocate stack frame for function function_car_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_car_at_BookList_internal_2 --> -12($fp) + # local_car_at_BookList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_car_at_BookList_internal_0 --> -4($fp) + # LOCAL local_car_at_BookList_internal_2 --> -12($fp) + # local_car_at_BookList_internal_0 = local_car_at_BookList_internal_2 + lw $t3, -12($fp) + sw $t3, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_car_at_BookList_internal_0 --> -4($fp) + # LOCAL local_car_at_BookList_internal_1 --> -8($fp) + # local_car_at_BookList_internal_1 = VCALL local_car_at_BookList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 0($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_car_at_BookList_internal_3 --> -16($fp) + # local_car_at_BookList_internal_3 = ALLOCATE Book + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, Book + sw $t5, 12($v0) + li $t5, 4 + sw $t5, 16($v0) + move $t5, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t5, 0($v0) + la $t5, Book_start + sw $t5, 4($v0) + # Load type offset + li $t5, 16 + sw $t5, 8($v0) + move $t4, $v0 + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t4) + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t4) + sw $t4, -16($fp) + # RETURN local_car_at_BookList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_car_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cdr_at_BookList implementation. +# @Params: +function_cdr_at_BookList: + # Allocate stack frame for function function_cdr_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cdr_at_BookList_internal_2 --> -12($fp) + # local_cdr_at_BookList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_cdr_at_BookList_internal_0 --> -4($fp) + # LOCAL local_cdr_at_BookList_internal_2 --> -12($fp) + # local_cdr_at_BookList_internal_0 = local_cdr_at_BookList_internal_2 + lw $t4, -12($fp) + sw $t4, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_cdr_at_BookList_internal_0 --> -4($fp) + # LOCAL local_cdr_at_BookList_internal_1 --> -8($fp) + # local_cdr_at_BookList_internal_1 = VCALL local_cdr_at_BookList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t4, 4($s1) + # Get pointer to type's VTABLE + lw $t5, 0($t4) + # Get pointer to function address + lw $t6, 0($t5) + # Call function. Result is on $v0 + jalr $t6 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cdr_at_BookList_internal_3 --> -16($fp) + # local_cdr_at_BookList_internal_3 = ALLOCATE BookList # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type Bool - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + # Allocating string for type name + la $t6, String + sw $t6, 0($v0) + la $t6, String_start + sw $t6, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Bool - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 + li $t6, 8 + sw $t6, 8($v0) + la $t6, BookList + sw $t6, 12($v0) + li $t6, 8 + sw $t6, 16($v0) + move $t6, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - sw $t2, 0($v0) - la $t2, Bool_start - sw $t2, 4($v0) - li $t2, 1 - sw $t2, 8($v0) + sw $t6, 0($v0) + la $t6, BookList_start + sw $t6, 4($v0) + # Load type offset + li $t6, 24 + sw $t6, 8($v0) + move $t5, $v0 + sw $t5, -16($fp) + # RETURN local_cdr_at_BookList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_cdr_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_list_at_BookList implementation. +# @Params: +function_print_list_at_BookList: + # Allocate stack frame for function function_print_list_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_print_list_at_BookList_internal_2 --> -12($fp) + # local_print_list_at_BookList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_list_at_BookList_internal_0 --> -4($fp) + # LOCAL local_print_list_at_BookList_internal_2 --> -12($fp) + # local_print_list_at_BookList_internal_0 = local_print_list_at_BookList_internal_2 + lw $t5, -12($fp) + sw $t5, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_BookList_internal_0 --> -4($fp) + # LOCAL local_print_list_at_BookList_internal_1 --> -8($fp) + # local_print_list_at_BookList_internal_1 = VCALL local_print_list_at_BookList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 0($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_list_at_BookList_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_print_list_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Cons__attrib__xcar__init implementation. +# @Params: +__Cons__attrib__xcar__init: + # Allocate stack frame for function __Cons__attrib__xcar__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Cons__attrib__xcar__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Cons__attrib__xcdr__init implementation. +# @Params: +__Cons__attrib__xcdr__init: + # Allocate stack frame for function __Cons__attrib__xcdr__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Cons__attrib__xcdr__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_Cons implementation. +# @Params: +function_isNil_at_Cons: + # Allocate stack frame for function function_isNil_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function function_isNil_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Cons implementation. +# @Params: +# 0($fp) = param_init_at_Cons_hd_0 +# 4($fp) = param_init_at_Cons_tl_1 +function_init_at_Cons: + # Allocate stack frame for function function_init_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_Cons_hd_0 --> 4($fp) + lw $t5, 4($fp) + sw $t5, 12($s1) + # + # PARAM param_init_at_Cons_tl_1 --> 0($fp) + lw $t5, 0($fp) + sw $t5, 16($s1) + # LOCAL local_init_at_Cons_internal_0 --> -4($fp) + # local_init_at_Cons_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_car_at_Cons implementation. +# @Params: +function_car_at_Cons: + # Allocate stack frame for function function_car_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_car_at_Cons_internal_0 = GETATTRIBUTE xcar Cons + # LOCAL local_car_at_Cons_internal_0 --> -4($fp) + lw $t5, 12($s1) + sw $t5, -4($fp) + # RETURN local_car_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_car_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cdr_at_Cons implementation. +# @Params: +function_cdr_at_Cons: + # Allocate stack frame for function function_cdr_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_cdr_at_Cons_internal_0 = GETATTRIBUTE xcdr Cons + # LOCAL local_cdr_at_Cons_internal_0 --> -4($fp) + lw $t5, 16($s1) + sw $t5, -4($fp) + # RETURN local_cdr_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_cdr_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_list_at_Cons implementation. +# @Params: +function_print_list_at_Cons: + # Allocate stack frame for function function_print_list_at_Cons. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # local_print_list_at_Cons_internal_2 = GETATTRIBUTE xcar Cons + # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) + lw $t5, 12($s1) + sw $t5, -12($fp) + # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) + # local_print_list_at_Cons_internal_0 = local_print_list_at_Cons_internal_2 + lw $t5, -12($fp) + sw $t5, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # local_print_list_at_Cons_internal_1 = VCALL local_print_list_at_Cons_internal_0 print + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 32($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # local_print_list_at_Cons_internal_3 = TYPEOF local_print_list_at_Cons_internal_1 + lw $t5, -8($fp) + # Load pointer to type offset + lw $t6, 8($t5) + sw $t6, -16($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # local_print_list_at_Cons_internal_5 = 14 + li $t5, 14 + sw $t5, -24($fp) + # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Book + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # Load TDT pointer to type Book + la $t5, Book__TDT + lw $t6, -16($fp) + addu $t5, $t5, $t6 + # Save distance + lw $t6, 0($t5) + sw $t6, -28($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # Update min if 13 < 14 + lw $t5, -28($fp) + lw $t6, -24($fp) + bgtu $t5, $t6, label_Not_min0_1 + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_6 + lw $t5, -28($fp) + sw $t5, -24($fp) + label_Not_min0_1: + # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Article + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # Load TDT pointer to type Article + la $t5, Article__TDT + lw $t6, -16($fp) + addu $t5, $t5, $t6 + # Save distance + lw $t6, 0($t5) + sw $t6, -28($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # Update min if 13 < 14 + lw $t5, -28($fp) + lw $t6, -24($fp) + bgtu $t5, $t6, label_Not_min1_2 + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_6 + lw $t5, -28($fp) + sw $t5, -24($fp) + label_Not_min1_2: + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_6 = 14 + li $t5, 14 + sw $t5, -28($fp) + # LOCAL local_print_list_at_Cons_internal_4 --> -20($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # local_print_list_at_Cons_internal_4 = local_print_list_at_Cons_internal_6 - local_print_list_at_Cons_internal_5 + lw $t5, -28($fp) + lw $t6, -24($fp) + sub $t5, $t5, $t6 + sw $t5, -20($fp) + # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 + # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 + lw $t5, -20($fp) + beq $t5, 0, label_ERROR_3 + # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Book + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # Load TDT pointer to type Book + la $t5, Book__TDT + lw $t6, -16($fp) + addu $t5, $t5, $t6 + # Save distance + lw $t6, 0($t5) + sw $t6, -28($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # Update min if 13 < 14 + lw $t5, -28($fp) + lw $t6, -24($fp) + bgtu $t5, $t6, label_NEXT0_5 + # LOCAL local_print_list_at_Cons_dummy_7 --> -32($fp) + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # local_print_list_at_Cons_dummy_7 = local_print_list_at_Cons_internal_1 + lw $t5, -8($fp) + sw $t5, -32($fp) + # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) + # local_print_list_at_Cons_internal_10 = SELF + sw $s1, -44($fp) + # LOCAL local_print_list_at_Cons_internal_8 --> -36($fp) + # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) + # local_print_list_at_Cons_internal_8 = local_print_list_at_Cons_internal_10 + lw $t5, -44($fp) + sw $t5, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, data_8 + sw $t5, 12($v0) + li $t5, 27 + sw $t5, 16($v0) + sw $v0, -48($fp) + # ARG local_print_list_at_Cons_internal_11 + # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) + lw $t5, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + # LOCAL local_print_list_at_Cons_internal_8 --> -36($fp) + # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) + # local_print_list_at_Cons_internal_9 = VCALL local_print_list_at_Cons_internal_8 out_string + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 12($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # GOTO label_END_4 +j label_END_4 +label_NEXT0_5: + # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Article + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # Load TDT pointer to type Article + la $t5, Article__TDT + lw $t6, -16($fp) + addu $t5, $t5, $t6 + # Save distance + lw $t6, 0($t5) + sw $t6, -28($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # Update min if 13 < 14 + lw $t5, -28($fp) + lw $t6, -24($fp) + bgtu $t5, $t6, label_NEXT1_6 + # LOCAL local_print_list_at_Cons_dummy_12 --> -52($fp) + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # local_print_list_at_Cons_dummy_12 = local_print_list_at_Cons_internal_1 + lw $t5, -8($fp) + sw $t5, -52($fp) + # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) + # local_print_list_at_Cons_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_print_list_at_Cons_internal_13 --> -56($fp) + # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) + # local_print_list_at_Cons_internal_13 = local_print_list_at_Cons_internal_15 + lw $t5, -64($fp) + sw $t5, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, data_9 + sw $t5, 12($v0) + li $t5, 30 + sw $t5, 16($v0) + sw $v0, -68($fp) + # ARG local_print_list_at_Cons_internal_16 + # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) + lw $t5, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + # LOCAL local_print_list_at_Cons_internal_13 --> -56($fp) + # LOCAL local_print_list_at_Cons_internal_14 --> -60($fp) + # local_print_list_at_Cons_internal_14 = VCALL local_print_list_at_Cons_internal_13 out_string + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 12($t6) + # Call function. Result is on $v0 + jalr $t7 sw $v0, -60($fp) - label_END_2: -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# LOCAL local_main_at_Main_internal_14 --> -60($fp) -# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 -lw $t2, -60($fp) -sw $t2, -52($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 type_name -# Save new self pointer in $s1 -lw $s1, -52($fp) -# Get pointer to type -lw $t2, 4($s1) -# Get pointer to type's VTABLE -lw $t3, 0($t2) -# Get pointer to function address -lw $t4, 4($t3) -# Call function. Result is on $v0 -jalr $t4 -sw $v0, -56($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_10 --> -44($fp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# local_main_at_Main_internal_10 = local_main_at_Main_internal_13 -lw $t2, -56($fp) -sw $t2, -44($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG 1 -li $t2, 1 -# Push arg into stack -subu $sp, $sp, 4 -sw $t2, 0($sp) -# ARG 3 -li $t2, 3 -# Push arg into stack -subu $sp, $sp, 4 -sw $t2, 0($sp) -# LOCAL local_main_at_Main_internal_10 --> -44($fp) -# LOCAL local_main_at_Main_internal_11 --> -48($fp) -# local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 substr -# Save new self pointer in $s1 -lw $s1, -44($fp) -# Get pointer to type -lw $t2, 4($s1) -# Get pointer to type's VTABLE -lw $t3, 0($t2) -# Get pointer to function address -lw $t4, 4($t3) -# Call function. Result is on $v0 -jalr $t4 -sw $v0, -48($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_11 -# LOCAL local_main_at_Main_internal_11 --> -48($fp) -lw $t2, -48($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t2, 0($sp) -# LOCAL local_main_at_Main_internal_0 --> -4($fp) -# LOCAL local_main_at_Main_internal_1 --> -8($fp) -# local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string -# Save new self pointer in $s1 -lw $s1, -4($fp) -# Get pointer to type -lw $t2, 4($s1) -# Get pointer to type's VTABLE -lw $t3, 0($t2) -# Get pointer to function address -lw $t4, 12($t3) -# Call function. Result is on $v0 -jalr $t4 -sw $v0, -8($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# local_main_at_Main_internal_18 = SELF -sw $s1, -76($fp) -# LOCAL local_main_at_Main_internal_16 --> -68($fp) -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# local_main_at_Main_internal_16 = local_main_at_Main_internal_18 -lw $t2, -76($fp) -sw $t2, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # GOTO label_END_4 +j label_END_4 +label_NEXT1_6: + label_ERROR_3: + li $a0, 10 + syscall + label_END_4: +# local_print_list_at_Cons_internal_19 = GETATTRIBUTE xcdr Cons +# LOCAL local_print_list_at_Cons_internal_19 --> -80($fp) +lw $t5, 16($s1) +sw $t5, -80($fp) +# LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) +# LOCAL local_print_list_at_Cons_internal_19 --> -80($fp) +# local_print_list_at_Cons_internal_17 = local_print_list_at_Cons_internal_19 +lw $t5, -80($fp) +sw $t5, -72($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t2, String -sw $t2, 0($v0) -la $t2, String_start -sw $t2, 4($v0) -# Load type offset -li $t2, 8 -sw $t2, 8($v0) -la $t2, data_2 -sw $t2, 12($v0) -li $t2, 2 -sw $t2, 16($v0) -sw $v0, -80($fp) -# ARG local_main_at_Main_internal_19 -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -lw $t2, -80($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t2, 0($sp) -# LOCAL local_main_at_Main_internal_16 --> -68($fp) -# LOCAL local_main_at_Main_internal_17 --> -72($fp) -# local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string +# LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) +# LOCAL local_print_list_at_Cons_internal_18 --> -76($fp) +# local_print_list_at_Cons_internal_18 = VCALL local_print_list_at_Cons_internal_17 print_list # Save new self pointer in $s1 -lw $s1, -68($fp) +lw $s1, -72($fp) # Get pointer to type -lw $t2, 4($s1) +lw $t5, 4($s1) # Get pointer to type's VTABLE -lw $t3, 0($t2) +lw $t6, 0($t5) # Get pointer to function address -lw $t4, 12($t3) +lw $t7, 44($t6) # Call function. Result is on $v0 -jalr $t4 -sw $v0, -72($fp) +jalr $t7 +sw $v0, -76($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# RETURN local_main_at_Main_internal_17 -lw $v0, -72($fp) -# Deallocate stack frame for function function_main_at_Main. +# RETURN local_print_list_at_Cons_internal_18 +lw $v0, -76($fp) +# Deallocate stack frame for function function_print_list_at_Cons. # Restore $ra lw $ra, 4($sp) # Restore $fp @@ -871,3 +2259,597 @@ jr $ra # Function END +# function_isNil_at_Nil implementation. +# @Params: +function_isNil_at_Nil: + # Allocate stack frame for function function_isNil_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 1 + li $v0, 1 + # Deallocate stack frame for function function_isNil_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_list_at_Nil implementation. +# @Params: +function_print_list_at_Nil: + # Allocate stack frame for function function_print_list_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 1 + li $v0, 1 + # Deallocate stack frame for function function_print_list_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__books__init implementation. +# @Params: +__Main__attrib__books__init: + # Allocate stack frame for function __Main__attrib__books__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__books__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # LOCAL local_main_at_Main_a_book_0 --> -4($fp) + # local_main_at_Main_a_book_0 = ALLOCATE Book + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) + # Load type offset + li $t7, 8 + sw $t7, 8($v0) + la $t7, Book + sw $t7, 12($v0) + li $t7, 4 + sw $t7, 16($v0) + move $t7, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t7, 0($v0) + la $t7, Book_start + sw $t7, 4($v0) + # Load type offset + li $t7, 16 + sw $t7, 8($v0) + move $t6, $v0 + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t6) + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t6) + sw $t6, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE Book + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t8, String + sw $t8, 0($v0) + la $t8, String_start + sw $t8, 4($v0) + # Load type offset + li $t8, 8 + sw $t8, 8($v0) + la $t8, Book + sw $t8, 12($v0) + li $t8, 4 + sw $t8, 16($v0) + move $t8, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t8, 0($v0) + la $t8, Book_start + sw $t8, 4($v0) + # Load type offset + li $t8, 16 + sw $t8, 8($v0) + move $t7, $v0 + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t7) + sw $t7, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t7, -16($fp) + sw $t7, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) + # Load type offset + li $t7, 8 + sw $t7, 8($v0) + la $t7, data_10 + sw $t7, 12($v0) + li $t7, 44 + sw $t7, 16($v0) + sw $v0, -20($fp) + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t7, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) + # Load type offset + li $t7, 8 + sw $t7, 8($v0) + la $t7, data_11 + sw $t7, 12($v0) + li $t7, 22 + sw $t7, 16($v0) + sw $v0, -24($fp) + # ARG local_main_at_Main_internal_5 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t7, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 initBook + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t7, 4($s1) + # Get pointer to type's VTABLE + lw $t8, 0($t7) + # Get pointer to function address + lw $t9, 28($t8) + # Call function. Result is on $v0 + jalr $t9 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_a_book_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_a_book_0 = local_main_at_Main_internal_2 + lw $t7, -12($fp) + sw $t7, -4($fp) + # LOCAL local_main_at_Main_an_article_6 --> -28($fp) + # local_main_at_Main_an_article_6 = ALLOCATE Article + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) + # Load type offset + li $t9, 8 + sw $t9, 8($v0) + la $t9, Article + sw $t9, 12($v0) + li $t9, 7 + sw $t9, 16($v0) + move $t9, $v0 + # Allocating 24 bytes of memory + li $a0, 24 + li $v0, 9 + syscall + sw $t9, 0($v0) + la $t9, Article_start + sw $t9, 4($v0) + # Load type offset + li $t9, 20 + sw $t9, 8($v0) + move $t8, $v0 + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Article__attrib__per_title__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t8) + sw $t8, -28($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = ALLOCATE Article + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $s2, String + sw $s2, 0($v0) + la $s2, String_start + sw $s2, 4($v0) + # Load type offset + li $s2, 8 + sw $s2, 8($v0) + la $s2, Article + sw $s2, 12($v0) + li $s2, 7 + sw $s2, 16($v0) + move $s2, $v0 + # Allocating 24 bytes of memory + li $a0, 24 + li $v0, 9 + syscall + sw $s2, 0($v0) + la $s2, Article_start + sw $s2, 4($v0) + # Load type offset + li $s2, 20 + sw $s2, 8($v0) + move $t9, $v0 + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Article__attrib__per_title__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t9) + sw $t9, -40($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 + lw $t9, -40($fp) + sw $t9, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) + # Load type offset + li $t9, 8 + sw $t9, 8($v0) + la $t9, data_12 + sw $t9, 12($v0) + li $t9, 19 + sw $t9, 16($v0) + sw $v0, -44($fp) + # ARG local_main_at_Main_internal_10 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + lw $t9, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) + # Load type offset + li $t9, 8 + sw $t9, 8($v0) + la $t9, data_13 + sw $t9, 12($v0) + li $t9, 7 + sw $t9, 16($v0) + sw $v0, -48($fp) + # ARG local_main_at_Main_internal_11 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + lw $t9, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) + # Load type offset + li $t9, 8 + sw $t9, 8($v0) + la $t9, data_14 + sw $t9, 12($v0) + li $t9, 11 + sw $t9, 16($v0) + sw $v0, -52($fp) + # ARG local_main_at_Main_internal_12 + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + lw $t9, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 initArticle + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t9, 4($s1) + # Get pointer to type's VTABLE + lw $s2, 0($t9) + # Get pointer to function address + lw $s3, 36($s2) + # Call function. Result is on $v0 + jalr $s3 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_an_article_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_an_article_6 = local_main_at_Main_internal_8 + lw $t9, -36($fp) + sw $t9, -28($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = ALLOCATE Nil + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $s3, String + sw $s3, 0($v0) + la $s3, String_start + sw $s3, 4($v0) + # Load type offset + li $s3, 8 + sw $s3, 8($v0) + la $s3, Nil + sw $s3, 12($v0) + li $s3, 3 + sw $s3, 16($v0) + move $s3, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $s3, 0($v0) + la $s3, Nil_start + sw $s3, 4($v0) + # Load type offset + li $s3, 32 + sw $s3, 8($v0) + move $s2, $v0 + sw $s2, -72($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 + lw $s2, -72($fp) + sw $s2, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_a_book_0 + # LOCAL local_main_at_Main_a_book_0 --> -4($fp) + lw $s2, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $s2, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 cons + # Save new self pointer in $s1 + lw $s1, -64($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 32($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_13 = local_main_at_Main_internal_16 + lw $s2, -68($fp) + sw $s2, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_an_article_6 + # LOCAL local_main_at_Main_an_article_6 --> -28($fp) + lw $s2, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $s2, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 cons + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 32($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + lw $s2, -60($fp) + sw $s2, 12($s1) + # local_main_at_Main_internal_20 = GETATTRIBUTE books Main + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + lw $s2, 12($s1) + sw $s2, -84($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 + lw $s2, -84($fp) + sw $s2, -76($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 print_list + # Save new self pointer in $s1 + lw $s1, -76($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 44($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -80($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_19 + lw $v0, -80($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 92 + jr $ra + # Function END + + diff --git a/src/testing.py b/src/testing.py index 5440ff88..08133765 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,13 +60,136 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""class Main inherits IO { - main() : IO { - { - out_string((new Object).type_name().substr(4,1)). - out_string((isvoid self).type_name().substr(1,3)); -- demonstrates the dispatch rules. - out_string("\n"); - } +text = r"""-- example of static and dynamic type differing for a dispatch + +Class Book inherits IO { + title : String; + author : String; + + initBook(title_p : String, author_p : String) : Book { + { + title <- title_p; + author <- author_p; + self; + } + }; + + print() : Book { + { + out_string("title: ").out_string(title).out_string("\n"); + out_string("author: ").out_string(author).out_string("\n"); + self; + } + }; +}; + +Class Article inherits Book { + per_title : String; + + initArticle(title_p : String, author_p : String, + per_title_p : String) : Article { + { + initBook(title_p, author_p); + per_title <- per_title_p; + self; + } + }; + + print() : Book { + { + self@Book.print(); + out_string("periodical: ").out_string(per_title).out_string("\n"); + self; + } + }; +}; + +Class BookList inherits IO { + (* Since abort "returns" type Object, we have to add + an expression of type Bool here to satisfy the typechecker. + This code is unreachable, since abort() halts the program. + *) + isNil() : Bool { { abort(); true; } }; + + cons(hd : Book) : Cons { + (let new_cell : Cons <- new Cons in + new_cell.init(hd,self) + ) + }; + + (* Since abort "returns" type Object, we have to add + an expression of type Book here to satisfy the typechecker. + This code is unreachable, since abort() halts the program. + *) + car() : Book { { abort(); new Book; } }; + + (* Since abort "returns" type Object, we have to add + an expression of type BookList here to satisfy the typechecker. + This code is unreachable, since abort() halts the program. + *) + cdr() : BookList { { abort(); new BookList; } }; + + print_list() : Object { abort() }; +}; + +Class Cons inherits BookList { + xcar : Book; -- We keep the car and cdr in attributes. + xcdr : BookList; -- Because methods and features must have different names, + -- we use xcar and xcdr for the attributes and reserve + -- car and cdr for the features. + + isNil() : Bool { false }; + + init(hd : Book, tl : BookList) : Cons { + { + xcar <- hd; + xcdr <- tl; + self; + } + }; + + car() : Book { xcar }; + + cdr() : BookList { xcdr }; + + print_list() : Object { + { + case xcar.print() of + dummy : Book => out_string("- dynamic type was Book -\n"); + dummy : Article => out_string("- dynamic type was Article -\n"); + esac; + xcdr.print_list(); + } + }; +}; + +Class Nil inherits BookList { + isNil() : Bool { true }; + + print_list() : Object { true }; +}; + + +Class Main { + + books : BookList; + + main() : Object { + (let a_book : Book <- + (new Book).initBook("Compilers, Principles, Techniques, and Tools", + "Aho, Sethi, and Ullman") + in + (let an_article : Article <- + (new Article).initArticle("The Top 100 CD_ROMs", + "Ulanoff", + "PC Magazine") + in + { + books <- (new Nil).cons(a_book).cons(an_article); + books.print_list(); + } + ) -- end let an_article + ) -- end let a_book }; }; diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index da68e25f..2070583e 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -1,6 +1,6 @@ from pickle import TRUE from abstract.semantics import Type -from cil.nodes import AbortNode, AllocateBoolNode, ConcatString, LocalNode +from cil.nodes import AbortNode, AllocateBoolNode, ConcatString, JumpIfGreater, LocalNode from mips.arithmetic import ADD, ADDU, DIV, MUL, NOR, SUB, SUBU from mips.baseMipsVisitor import ( BaseCilToMipsVisitor, @@ -9,7 +9,7 @@ locate_attribute_in_type_hierarchy, ) import cil.nodes as cil -from mips.branch import BEQ, BEQZ, J +from mips.branch import BEQ, BEQZ, BGT, BGTU, J from mips.instruction import ( FixedData, Label, @@ -568,6 +568,26 @@ def _(self, node: cil.TypeOffsetNode): self.used_registers[reg] = False self.used_registers[reg2] = False + @visit.register + def _(self, node: JumpIfGreater): + left = self.visit(node.left) + right = self.visit(node.rigt) + reg1 = self.get_available_register() + reg2 = self.get_available_register() + + assert left is not None + assert right is not None + assert reg1 is not None + assert reg2 is not None + + self.comment(f"Update min if {reg1} < {reg2}") + self.register_instruction(LW(reg1, left)) + self.register_instruction(LW(reg2, right)) + self.register_instruction(BGTU(reg1, reg2, node.label)) + + self.used_registers[reg1] = False + self.used_registers[reg2] = False + @visit.register def _(self, node: cil.JumpIfGreaterThanZeroNode): self.add_source_line_comment(node) @@ -616,15 +636,43 @@ def _(self, node: cil.StaticCallNode): # Registrar un comentario con la linea fuente self.add_source_line_comment(node) dest = self.visit(node.dest) + self_ptr = self.visit(node.obj) assert dest is not None + assert self_ptr is not None - # Saltar hacia la direccion de memoria correspondiente a la funcion - self.register_instruction(branchNodes.JAL(node.function)) + # obtener el indice que le corresponde a la funcion que estamos llamando, + # Recordar que nuestra invariante garantiza que todo metodo con el mismo + # nombre ocupa el mismo indice en cada VTABLE + i = self.get_method_index(node.function) + + # Reservar registros para operaciones intermedias + reg2 = self.get_available_register() + reg3 = self.get_available_register() + assert reg2 is not None and reg3 is not None, "out of registers" - # EL resultado viene en v0 + # Actualizar el puntero a self en s1 + self.comment("Save new self pointer in $s1") + self.register_instruction(LW(s1, self_ptr)) + + # Cargar el puntero a la VTABLE del tipo referenciado en TYPE + self.comment("Get pointer to type's VTABLE") + self.register_instruction(LA(reg2, f"{node.type_.name}_vtable")) + + # Cargar el puntero a la funcion correspondiente en el tercer registro + self.comment("Get pointer to function address") + self.register_instruction(LW(reg3, f"{i * 4}(${REG_TO_STR[reg2]})")) + + # saltar hacia la direccion de memoria correspondiente a la funcion + self.comment("Call function. Result is on $v0") + self.register_instruction(branchNodes.JALR(reg3)) + + # El resultado viene en $v0 self.register_instruction(SW(v0, dest)) + self.used_registers[reg2] = False + self.used_registers[reg3] = False + @visit.register def _(self, node: cil.DynamicCallNode): type_src = self.visit(node.xtype) @@ -1064,6 +1112,9 @@ def _(self, node: cil.TdtLookupNode): self.register_instruction(LW(offset, f"0(${REG_TO_STR[tdt_table]})")) self.register_instruction(SW(offset, dest)) + self.used_registers[tdt_table] = False + self.used_registers[offset] = False + @visit.register def _(self, node: int): return node diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 1cec39cd..f00c5e71 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -9,7 +9,9 @@ import cil.nodes from cil.nodes import ( - AllocateBoolNode, AllocateNode, + AbortNode, + AllocateBoolNode, + AllocateNode, AllocateStringNode, ArgNode, AssignNode, @@ -24,7 +26,7 @@ GetTypeIndex, IfZeroJump, InitSelfNode, - InstructionNode, + InstructionNode, JumpIfGreater, JumpIfGreaterThanZeroNode, LabelNode, LoadNode, @@ -87,7 +89,9 @@ def _(self, node: coolAst.ProgramNode, scope: Scope) -> CilProgramNode: # Llamar al metodo main self.register_instruction( - StaticCallNode(self.to_function_name("main", "Main"), result) + StaticCallNode( + instance, main_type, "main", result + ) ) self.register_instruction(ReturnNode(0)) self.current_function = None @@ -416,7 +420,6 @@ def _(self, node: coolAst.CaseNode, scope: Scope): # Variables internas para almacenar resultados intermedios min_ = self.define_internal_local() tdt_result = self.define_internal_local() - min_check_local = self.define_internal_local() self.register_instruction(AssignNode(min_, len(self.context.types))) @@ -426,12 +429,10 @@ def _(self, node: coolAst.CaseNode, scope: Scope): TdtLookupNode(action_node.typex, type_internal_local_holder, tdt_result) ) - # Comparar el resultado obtenido con el minimo actual. - self.register_instruction(MinusNode(min_, tdt_result, min_check_local)) not_min_label = self.do_label(f"Not_min{i}") - self.register_instruction( - JumpIfGreaterThanZeroNode(min_check_local, not_min_label) - ) + + # Comparar el resultado obtenido con el minimo actual. + self.register_instruction(JumpIfGreater(tdt_result, min_, not_min_label)) # Si mejora el minimo, entonces actualizarlo. self.register_instruction(AssignNode(min_, tdt_result)) @@ -453,8 +454,7 @@ def _(self, node: coolAst.CaseNode, scope: Scope): self.register_instruction( TdtLookupNode(action_node.typex, type_internal_local_holder, tdt_result) ) - self.register_instruction(MinusNode(min_, tdt_result, min_check_local)) - self.register_instruction(NotZeroJump(min_check_local, next_label)) + self.register_instruction(JumpIfGreater(tdt_result, min_, next_label)) # Implemententacion del branch. # Registrar la variable var_info = s.find_variable(action_node.idx) @@ -469,7 +469,7 @@ def _(self, node: coolAst.CaseNode, scope: Scope): self.register_instruction(LabelNode(next_label)) self.register_instruction(LabelNode(error_label)) - # TODO: Define some form of runtime errors + self.register_instruction(AbortNode()) self.register_instruction(LabelNode(end_label)) @@ -824,9 +824,13 @@ def _(self, node: coolAst.FunCall, scope: Scope) -> LocalNode: @visit.register def _(self, node: coolAst.ParentFuncCall, scope: Scope) -> LocalNode: - local_type_identifier = self.define_internal_local() return_expr_vm_holder = self.define_internal_local() + # Evaluar el objeto sobre el que se llama la funcion + obj_dispatched = self.visit(node.obj, scope) + + self.register_instruction(SaveSelf()) + # Evaluar los argumentos for arg in node.arg_list: arg_expr = self.visit(arg, scope) @@ -834,12 +838,12 @@ def _(self, node: coolAst.ParentFuncCall, scope: Scope) -> LocalNode: # Asignar el tipo a una variable type_ = self.context.get_type(node.parent_type) - self.register_instruction(AssignNode(local_type_identifier, type_)) - self.register_instruction( - DynamicCallNode(local_type_identifier, node.idx, return_expr_vm_holder) + StaticCallNode(obj_dispatched, type_, node.idx, return_expr_vm_holder) ) + self.register_instruction(RestoreSelf()) + return return_expr_vm_holder @visit.register @@ -863,6 +867,7 @@ def _(self, node: IsVoidNode, scope: Scope): self.register_instruction(LabelNode(end_label)) return return_bool_vm_holder + class CilDisplayFormatter: @singledispatchmethod def visit(self, node) -> str: diff --git a/tests/codegen/atoi.mips b/tests/codegen/atoi.mips index 22f0f97c..ba2fe0f3 100644 --- a/tests/codegen/atoi.mips +++ b/tests/codegen/atoi.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Fri Dec 4 18:41:52 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 17:36:48 2020 # School of Math and Computer Science, University of Havana # @@ -108,55 +108,12 @@ data_0: .asciiz "" # -__Object_Object_tdt_entry__: .word 0 -__Object_Int_tdt_entry__: .word 1 -__Object_String_tdt_entry__: .word 1 -__Object_Bool_tdt_entry__: .word 1 -__Object_IO_tdt_entry__: .word 1 -__Object_A2I_tdt_entry__: .word 1 -__Object_Main_tdt_entry__: .word 2 -__Int_Object_tdt_entry__: .word -1 -__Int_Int_tdt_entry__: .word 0 -__Int_String_tdt_entry__: .word -1 -__Int_Bool_tdt_entry__: .word -1 -__Int_IO_tdt_entry__: .word -1 -__Int_A2I_tdt_entry__: .word -1 -__Int_Main_tdt_entry__: .word -1 -__String_Object_tdt_entry__: .word -1 -__String_Int_tdt_entry__: .word -1 -__String_String_tdt_entry__: .word 0 -__String_Bool_tdt_entry__: .word -1 -__String_IO_tdt_entry__: .word -1 -__String_A2I_tdt_entry__: .word -1 -__String_Main_tdt_entry__: .word -1 -__Bool_Object_tdt_entry__: .word -1 -__Bool_Int_tdt_entry__: .word -1 -__Bool_String_tdt_entry__: .word -1 -__Bool_Bool_tdt_entry__: .word 0 -__Bool_IO_tdt_entry__: .word -1 -__Bool_A2I_tdt_entry__: .word -1 -__Bool_Main_tdt_entry__: .word -1 -__IO_Object_tdt_entry__: .word -1 -__IO_Int_tdt_entry__: .word -1 -__IO_String_tdt_entry__: .word -1 -__IO_Bool_tdt_entry__: .word -1 -__IO_IO_tdt_entry__: .word 0 -__IO_A2I_tdt_entry__: .word -1 -__IO_Main_tdt_entry__: .word 1 -__A2I_Object_tdt_entry__: .word -1 -__A2I_Int_tdt_entry__: .word -1 -__A2I_String_tdt_entry__: .word -1 -__A2I_Bool_tdt_entry__: .word -1 -__A2I_IO_tdt_entry__: .word -1 -__A2I_A2I_tdt_entry__: .word 0 -__A2I_Main_tdt_entry__: .word -1 -__Main_Object_tdt_entry__: .word -1 -__Main_Int_tdt_entry__: .word -1 -__Main_String_tdt_entry__: .word -1 -__Main_Bool_tdt_entry__: .word -1 -__Main_IO_tdt_entry__: .word -1 -__Main_A2I_tdt_entry__: .word -1 -__Main_Main_tdt_entry__: .word 0 +IO__TDT: .word 0, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1 +A2I__TDT: .word -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0 # @@ -349,7 +306,7 @@ function_out_string_at_IO: # PARAM param_out_string_at_IO_x_0 --> 0($fp) # PRINT_STR param_out_string_at_IO_x_0 lw $v0, 0($fp) - lw $a0, 8($v0) + lw $a0, 12($v0) li $v0, 4 syscall # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) @@ -466,61 +423,64 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self - lw $t1, 12($s1) + lw $t0, 16($s1) # Get second string length from param lw $v0, 0($fp) - lw $t2, 12($v0) + lw $t1, 16($v0) # Save new string length in a0 for memory allocation - addu $a0, $t1, $t2 - move $t4, $a0 + addu $a0, $t0, $t1 + move $t3, $a0 # Get first string from self - lw $t1, 8($s1) + lw $t0, 12($s1) # Get second string from param - lw $t2, 8($v0) + lw $t1, 12($v0) addu $a0, $a0, 1 li $v0, 9 syscall - move $t3, $v0 - move $t5, $zero + move $t2, $v0 + move $t4, $zero concat_loop1: - # Compare t1 with \0 - lb $t5, 0($t1) - beqz $t5, concat_loop1_end + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end # Copy 1 byte - sb $t5, 0($t3) - addu $t3, $t3, 1 - addu $t1, $t1, 1 + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 j concat_loop1 concat_loop1_end: # Copy second string concat_loop2: - # Compare t2 with \0 - lb $t5, 0($t2) - beqz $t5, concat_loop2_end + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end # Copy 1 byte - sb $t5, 0($t3) - addu $t3, $t3, 1 + sb $t4, 0($t2) addu $t2, $t2, 1 + addu $t1, $t1, 1 j concat_loop2 concat_loop2_end: - sb $zero, 0($t3) + sb $zero, 0($t2) # v0 contains resulting string - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - sw $t2, 8($v0) - sw $t4, 12($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) sw $v0, -4($fp) # RETURN local_concat_at_String_internal_0 lw $v0, -4($fp) @@ -550,38 +510,41 @@ function_substr_at_String: # LOCAL local_substr_at_String_internal_0 --> -4($fp) # PARAM param_substr_at_String_l_0 --> 4($fp) # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t1, 8($s1) - lw $t3, 4($fp) - addu $t1, $t1, $t3 + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 lw $a0, 0($fp) - move $t4, $a0 - move $t2, $a0 + move $t3, $a0 + move $t1, $a0 addu $a0, $a0, 1 li $v0, 9 syscall - move $t3, $v0 + move $t2, $v0 substr_loop: - beqz $t2, substr_end - lb $a0, 0($t1) - sb $a0, 0($t3) - addu $t1, $t1, 1 - addu $t3, $t3, 1 - subu $t2, $t2, 1 + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 j substr_loop substr_end: - sb $zero, 0($t3) - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - sw $t2, 8($v0) - sw $t4, 12($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) sw $v0, -4($fp) # RETURN local_substr_at_String_internal_0 lw $v0, -4($fp) @@ -608,8 +571,8 @@ function_length_at_String: addu $fp, $sp, 32 # local_length_at_String_internal_0 = GETATTRIBUTE length String # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t1, 12($s1) - sw $t1, -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) # RETURN local_length_at_String_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_length_at_String. @@ -633,34 +596,48 @@ entry: addu $fp, $sp, 32 # LOCAL local__internal_0 --> -4($fp) # local__internal_0 = ALLOCATE Main - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - la $t3, Main - sw $t3, 8($v0) - li $t3, 4 - sw $t3, 12($v0) - move $t3, $v0 - # Allocating 8 bytes of memory - li $a0, 8 + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall - sw $t3, 0($v0) - la $t3, Main_start - sw $t3, 4($v0) - move $t2, $v0 - sw $t2, -4($fp) + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 20 + sw $t2, 8($v0) + move $t1, $v0 + sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) - # local__internal_1 = CALL function_main_at_Main + # local__internal_1 = CALL main # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 28($t1) + # Call function. Result is on $v0 + jalr $t2 sw $v0, -8($fp) # RETURN 0 li $v0, 0 @@ -685,462 +662,492 @@ function_c2i_at_A2I: sw $fp, 0($sp) addu $fp, $sp, 100 # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - la $t2, data_2 - sw $t2, 8($v0) - li $t2, 1 - sw $t2, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_2 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) sw $v0, -8($fp) # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) # local_c2i_at_A2I_internal_0 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_1 - lw $t2, 0($fp) - lw $t3, -8($fp) - sub $t2, $t2, $t3 - sw $t2, -4($fp) + lw $t1, 0($fp) + lw $t2, -8($fp) + sub $t1, $t1, $t2 + sw $t1, -4($fp) # IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_TRUE_3 # IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_TRUE_3 - lw $t2, -4($fp) - beq $t2, 0, label_TRUE_3 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_3 # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) # local_c2i_at_A2I_internal_0 = 0 - li $t2, 0 - sw $t2, -4($fp) + li $t1, 0 + sw $t1, -4($fp) # GOTO label_END_4 j label_END_4 label_TRUE_3: # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) # local_c2i_at_A2I_internal_0 = 1 - li $t2, 1 - sw $t2, -4($fp) + li $t1, 1 + sw $t1, -4($fp) label_END_4: # IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSE_1 # IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSE_1 -lw $t2, -4($fp) -beq $t2, 0, label_FALSE_1 +lw $t1, -4($fp) +beq $t1, 0, label_FALSE_1 # GOTO label_END_2 j label_END_2 label_FALSE_1: # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - la $t2, data_3 - sw $t2, 8($v0) - li $t2, 1 - sw $t2, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_3 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) sw $v0, -16($fp) # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) # local_c2i_at_A2I_internal_2 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_3 - lw $t2, 0($fp) - lw $t3, -16($fp) - sub $t2, $t2, $t3 - sw $t2, -12($fp) + lw $t1, 0($fp) + lw $t2, -16($fp) + sub $t1, $t1, $t2 + sw $t1, -12($fp) # IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_TRUE_7 # IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_TRUE_7 - lw $t2, -12($fp) - beq $t2, 0, label_TRUE_7 + lw $t1, -12($fp) + beq $t1, 0, label_TRUE_7 # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) # local_c2i_at_A2I_internal_2 = 0 - li $t2, 0 - sw $t2, -12($fp) + li $t1, 0 + sw $t1, -12($fp) # GOTO label_END_8 j label_END_8 label_TRUE_7: # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) # local_c2i_at_A2I_internal_2 = 1 - li $t2, 1 - sw $t2, -12($fp) + li $t1, 1 + sw $t1, -12($fp) label_END_8: # IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_FALSE_5 # IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_FALSE_5 -lw $t2, -12($fp) -beq $t2, 0, label_FALSE_5 +lw $t1, -12($fp) +beq $t1, 0, label_FALSE_5 # GOTO label_END_6 j label_END_6 label_FALSE_5: # LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - la $t2, data_4 - sw $t2, 8($v0) - li $t2, 1 - sw $t2, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_4 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) sw $v0, -24($fp) # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) # LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) # local_c2i_at_A2I_internal_4 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_5 - lw $t2, 0($fp) - lw $t3, -24($fp) - sub $t2, $t2, $t3 - sw $t2, -20($fp) + lw $t1, 0($fp) + lw $t2, -24($fp) + sub $t1, $t1, $t2 + sw $t1, -20($fp) # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_11 # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_11 - lw $t2, -20($fp) - beq $t2, 0, label_TRUE_11 + lw $t1, -20($fp) + beq $t1, 0, label_TRUE_11 # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) # local_c2i_at_A2I_internal_4 = 0 - li $t2, 0 - sw $t2, -20($fp) + li $t1, 0 + sw $t1, -20($fp) # GOTO label_END_12 j label_END_12 label_TRUE_11: # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) # local_c2i_at_A2I_internal_4 = 1 - li $t2, 1 - sw $t2, -20($fp) + li $t1, 1 + sw $t1, -20($fp) label_END_12: # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_9 # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_9 -lw $t2, -20($fp) -beq $t2, 0, label_FALSE_9 +lw $t1, -20($fp) +beq $t1, 0, label_FALSE_9 # GOTO label_END_10 j label_END_10 label_FALSE_9: # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - la $t2, data_5 - sw $t2, 8($v0) - li $t2, 1 - sw $t2, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_5 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) sw $v0, -32($fp) # LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) # local_c2i_at_A2I_internal_6 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_7 - lw $t2, 0($fp) - lw $t3, -32($fp) - sub $t2, $t2, $t3 - sw $t2, -28($fp) + lw $t1, 0($fp) + lw $t2, -32($fp) + sub $t1, $t1, $t2 + sw $t1, -28($fp) # IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_TRUE_15 # IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_TRUE_15 - lw $t2, -28($fp) - beq $t2, 0, label_TRUE_15 + lw $t1, -28($fp) + beq $t1, 0, label_TRUE_15 # LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) # local_c2i_at_A2I_internal_6 = 0 - li $t2, 0 - sw $t2, -28($fp) + li $t1, 0 + sw $t1, -28($fp) # GOTO label_END_16 j label_END_16 label_TRUE_15: # LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) # local_c2i_at_A2I_internal_6 = 1 - li $t2, 1 - sw $t2, -28($fp) + li $t1, 1 + sw $t1, -28($fp) label_END_16: # IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSE_13 # IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSE_13 -lw $t2, -28($fp) -beq $t2, 0, label_FALSE_13 +lw $t1, -28($fp) +beq $t1, 0, label_FALSE_13 # GOTO label_END_14 j label_END_14 label_FALSE_13: # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - la $t2, data_6 - sw $t2, 8($v0) - li $t2, 1 - sw $t2, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_6 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) sw $v0, -40($fp) # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) # local_c2i_at_A2I_internal_8 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_9 - lw $t2, 0($fp) - lw $t3, -40($fp) - sub $t2, $t2, $t3 - sw $t2, -36($fp) + lw $t1, 0($fp) + lw $t2, -40($fp) + sub $t1, $t1, $t2 + sw $t1, -36($fp) # IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_TRUE_19 # IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_TRUE_19 - lw $t2, -36($fp) - beq $t2, 0, label_TRUE_19 + lw $t1, -36($fp) + beq $t1, 0, label_TRUE_19 # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) # local_c2i_at_A2I_internal_8 = 0 - li $t2, 0 - sw $t2, -36($fp) + li $t1, 0 + sw $t1, -36($fp) # GOTO label_END_20 j label_END_20 label_TRUE_19: # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) # local_c2i_at_A2I_internal_8 = 1 - li $t2, 1 - sw $t2, -36($fp) + li $t1, 1 + sw $t1, -36($fp) label_END_20: # IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_FALSE_17 # IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_FALSE_17 -lw $t2, -36($fp) -beq $t2, 0, label_FALSE_17 +lw $t1, -36($fp) +beq $t1, 0, label_FALSE_17 # GOTO label_END_18 j label_END_18 label_FALSE_17: # LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - la $t2, data_7 - sw $t2, 8($v0) - li $t2, 1 - sw $t2, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_7 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) sw $v0, -48($fp) # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) # LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) # local_c2i_at_A2I_internal_10 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_11 - lw $t2, 0($fp) - lw $t3, -48($fp) - sub $t2, $t2, $t3 - sw $t2, -44($fp) + lw $t1, 0($fp) + lw $t2, -48($fp) + sub $t1, $t1, $t2 + sw $t1, -44($fp) # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_23 # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_23 - lw $t2, -44($fp) - beq $t2, 0, label_TRUE_23 + lw $t1, -44($fp) + beq $t1, 0, label_TRUE_23 # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) # local_c2i_at_A2I_internal_10 = 0 - li $t2, 0 - sw $t2, -44($fp) + li $t1, 0 + sw $t1, -44($fp) # GOTO label_END_24 j label_END_24 label_TRUE_23: # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) # local_c2i_at_A2I_internal_10 = 1 - li $t2, 1 - sw $t2, -44($fp) + li $t1, 1 + sw $t1, -44($fp) label_END_24: # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_21 # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_21 -lw $t2, -44($fp) -beq $t2, 0, label_FALSE_21 +lw $t1, -44($fp) +beq $t1, 0, label_FALSE_21 # GOTO label_END_22 j label_END_22 label_FALSE_21: # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - la $t2, data_8 - sw $t2, 8($v0) - li $t2, 1 - sw $t2, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_8 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) sw $v0, -56($fp) # LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) # local_c2i_at_A2I_internal_12 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_13 - lw $t2, 0($fp) - lw $t3, -56($fp) - sub $t2, $t2, $t3 - sw $t2, -52($fp) + lw $t1, 0($fp) + lw $t2, -56($fp) + sub $t1, $t1, $t2 + sw $t1, -52($fp) # IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_TRUE_27 # IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_TRUE_27 - lw $t2, -52($fp) - beq $t2, 0, label_TRUE_27 + lw $t1, -52($fp) + beq $t1, 0, label_TRUE_27 # LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) # local_c2i_at_A2I_internal_12 = 0 - li $t2, 0 - sw $t2, -52($fp) + li $t1, 0 + sw $t1, -52($fp) # GOTO label_END_28 j label_END_28 label_TRUE_27: # LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) # local_c2i_at_A2I_internal_12 = 1 - li $t2, 1 - sw $t2, -52($fp) + li $t1, 1 + sw $t1, -52($fp) label_END_28: # IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSE_25 # IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSE_25 -lw $t2, -52($fp) -beq $t2, 0, label_FALSE_25 +lw $t1, -52($fp) +beq $t1, 0, label_FALSE_25 # GOTO label_END_26 j label_END_26 label_FALSE_25: # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - la $t2, data_9 - sw $t2, 8($v0) - li $t2, 1 - sw $t2, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_9 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) sw $v0, -64($fp) # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) # local_c2i_at_A2I_internal_14 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_15 - lw $t2, 0($fp) - lw $t3, -64($fp) - sub $t2, $t2, $t3 - sw $t2, -60($fp) + lw $t1, 0($fp) + lw $t2, -64($fp) + sub $t1, $t1, $t2 + sw $t1, -60($fp) # IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_TRUE_31 # IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_TRUE_31 - lw $t2, -60($fp) - beq $t2, 0, label_TRUE_31 + lw $t1, -60($fp) + beq $t1, 0, label_TRUE_31 # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) # local_c2i_at_A2I_internal_14 = 0 - li $t2, 0 - sw $t2, -60($fp) + li $t1, 0 + sw $t1, -60($fp) # GOTO label_END_32 j label_END_32 label_TRUE_31: # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) # local_c2i_at_A2I_internal_14 = 1 - li $t2, 1 - sw $t2, -60($fp) + li $t1, 1 + sw $t1, -60($fp) label_END_32: # IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_FALSE_29 # IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_FALSE_29 -lw $t2, -60($fp) -beq $t2, 0, label_FALSE_29 +lw $t1, -60($fp) +beq $t1, 0, label_FALSE_29 # GOTO label_END_30 j label_END_30 label_FALSE_29: # LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - la $t2, data_10 - sw $t2, 8($v0) - li $t2, 1 - sw $t2, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_10 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) sw $v0, -72($fp) # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) # LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) # local_c2i_at_A2I_internal_16 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_17 - lw $t2, 0($fp) - lw $t3, -72($fp) - sub $t2, $t2, $t3 - sw $t2, -68($fp) + lw $t1, 0($fp) + lw $t2, -72($fp) + sub $t1, $t1, $t2 + sw $t1, -68($fp) # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_35 # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_35 - lw $t2, -68($fp) - beq $t2, 0, label_TRUE_35 + lw $t1, -68($fp) + beq $t1, 0, label_TRUE_35 # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) # local_c2i_at_A2I_internal_16 = 0 - li $t2, 0 - sw $t2, -68($fp) + li $t1, 0 + sw $t1, -68($fp) # GOTO label_END_36 j label_END_36 label_TRUE_35: # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) # local_c2i_at_A2I_internal_16 = 1 - li $t2, 1 - sw $t2, -68($fp) + li $t1, 1 + sw $t1, -68($fp) label_END_36: # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_33 # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_33 -lw $t2, -68($fp) -beq $t2, 0, label_FALSE_33 +lw $t1, -68($fp) +beq $t1, 0, label_FALSE_33 # GOTO label_END_34 j label_END_34 label_FALSE_33: # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - la $t2, data_11 - sw $t2, 8($v0) - li $t2, 1 - sw $t2, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_11 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) sw $v0, -80($fp) # LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) # local_c2i_at_A2I_internal_18 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_19 - lw $t2, 0($fp) - lw $t3, -80($fp) - sub $t2, $t2, $t3 - sw $t2, -76($fp) + lw $t1, 0($fp) + lw $t2, -80($fp) + sub $t1, $t1, $t2 + sw $t1, -76($fp) # IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_TRUE_39 # IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_TRUE_39 - lw $t2, -76($fp) - beq $t2, 0, label_TRUE_39 + lw $t1, -76($fp) + beq $t1, 0, label_TRUE_39 # LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) # local_c2i_at_A2I_internal_18 = 0 - li $t2, 0 - sw $t2, -76($fp) + li $t1, 0 + sw $t1, -76($fp) # GOTO label_END_40 j label_END_40 label_TRUE_39: # LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) # local_c2i_at_A2I_internal_18 = 1 - li $t2, 1 - sw $t2, -76($fp) + li $t1, 1 + sw $t1, -76($fp) label_END_40: # IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSE_37 # IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSE_37 -lw $t2, -76($fp) -beq $t2, 0, label_FALSE_37 +lw $t1, -76($fp) +beq $t1, 0, label_FALSE_37 # GOTO label_END_38 j label_END_38 label_FALSE_37: @@ -1150,8 +1157,8 @@ label_FALSE_37: # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) # local_c2i_at_A2I_internal_20 = local_c2i_at_A2I_internal_22 - lw $t2, -92($fp) - sw $t2, -84($fp) + lw $t1, -92($fp) + sw $t1, -84($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1161,13 +1168,13 @@ label_FALSE_37: # Save new self pointer in $s1 lw $s1, -84($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 0($t3) + lw $t3, 0($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -88($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1208,43 +1215,46 @@ function_i2c_at_A2I: # LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) # local_i2c_at_A2I_internal_0 = PARAM param_i2c_at_A2I_i_0 - 0 - lw $t2, 0($fp) - sub $t2, $t2, 0 - sw $t2, -4($fp) + lw $t1, 0($fp) + sub $t1, $t1, 0 + sw $t1, -4($fp) # IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_TRUE_43 # IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_TRUE_43 - lw $t2, -4($fp) - beq $t2, 0, label_TRUE_43 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_43 # LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) # local_i2c_at_A2I_internal_0 = 0 - li $t2, 0 - sw $t2, -4($fp) + li $t1, 0 + sw $t1, -4($fp) # GOTO label_END_44 j label_END_44 label_TRUE_43: # LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) # local_i2c_at_A2I_internal_0 = 1 - li $t2, 1 - sw $t2, -4($fp) + li $t1, 1 + sw $t1, -4($fp) label_END_44: # IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSE_41 # IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSE_41 -lw $t2, -4($fp) -beq $t2, 0, label_FALSE_41 +lw $t1, -4($fp) +beq $t1, 0, label_FALSE_41 # LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) -# Allocating 16 bytes of memory -li $a0, 16 +# Allocating 20 bytes of memory +li $a0, 20 li $v0, 9 syscall # Allocating string -la $t2, String -sw $t2, 0($v0) -la $t2, String_start -sw $t2, 4($v0) -la $t2, data_12 -sw $t2, 8($v0) -li $t2, 1 -sw $t2, 12($v0) +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_12 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) sw $v0, -8($fp) # GOTO label_END_42 j label_END_42 @@ -1252,43 +1262,46 @@ label_FALSE_41: # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) # local_i2c_at_A2I_internal_2 = PARAM param_i2c_at_A2I_i_0 - 1 - lw $t2, 0($fp) - sub $t2, $t2, 1 - sw $t2, -12($fp) + lw $t1, 0($fp) + sub $t1, $t1, 1 + sw $t1, -12($fp) # IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_TRUE_47 # IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_TRUE_47 - lw $t2, -12($fp) - beq $t2, 0, label_TRUE_47 + lw $t1, -12($fp) + beq $t1, 0, label_TRUE_47 # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) # local_i2c_at_A2I_internal_2 = 0 - li $t2, 0 - sw $t2, -12($fp) + li $t1, 0 + sw $t1, -12($fp) # GOTO label_END_48 j label_END_48 label_TRUE_47: # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) # local_i2c_at_A2I_internal_2 = 1 - li $t2, 1 - sw $t2, -12($fp) + li $t1, 1 + sw $t1, -12($fp) label_END_48: # IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_FALSE_45 # IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_FALSE_45 -lw $t2, -12($fp) -beq $t2, 0, label_FALSE_45 +lw $t1, -12($fp) +beq $t1, 0, label_FALSE_45 # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) -# Allocating 16 bytes of memory -li $a0, 16 +# Allocating 20 bytes of memory +li $a0, 20 li $v0, 9 syscall # Allocating string -la $t2, String -sw $t2, 0($v0) -la $t2, String_start -sw $t2, 4($v0) -la $t2, data_13 -sw $t2, 8($v0) -li $t2, 1 -sw $t2, 12($v0) +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_13 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) sw $v0, -16($fp) # GOTO label_END_46 j label_END_46 @@ -1296,43 +1309,46 @@ label_FALSE_45: # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) # local_i2c_at_A2I_internal_4 = PARAM param_i2c_at_A2I_i_0 - 2 - lw $t2, 0($fp) - sub $t2, $t2, 2 - sw $t2, -20($fp) + lw $t1, 0($fp) + sub $t1, $t1, 2 + sw $t1, -20($fp) # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_51 # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_51 - lw $t2, -20($fp) - beq $t2, 0, label_TRUE_51 + lw $t1, -20($fp) + beq $t1, 0, label_TRUE_51 # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) # local_i2c_at_A2I_internal_4 = 0 - li $t2, 0 - sw $t2, -20($fp) + li $t1, 0 + sw $t1, -20($fp) # GOTO label_END_52 j label_END_52 label_TRUE_51: # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) # local_i2c_at_A2I_internal_4 = 1 - li $t2, 1 - sw $t2, -20($fp) + li $t1, 1 + sw $t1, -20($fp) label_END_52: # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_49 # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_49 -lw $t2, -20($fp) -beq $t2, 0, label_FALSE_49 +lw $t1, -20($fp) +beq $t1, 0, label_FALSE_49 # LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) -# Allocating 16 bytes of memory -li $a0, 16 +# Allocating 20 bytes of memory +li $a0, 20 li $v0, 9 syscall # Allocating string -la $t2, String -sw $t2, 0($v0) -la $t2, String_start -sw $t2, 4($v0) -la $t2, data_14 -sw $t2, 8($v0) -li $t2, 1 -sw $t2, 12($v0) +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_14 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) sw $v0, -24($fp) # GOTO label_END_50 j label_END_50 @@ -1340,43 +1356,46 @@ label_FALSE_49: # LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) # local_i2c_at_A2I_internal_6 = PARAM param_i2c_at_A2I_i_0 - 3 - lw $t2, 0($fp) - sub $t2, $t2, 3 - sw $t2, -28($fp) + lw $t1, 0($fp) + sub $t1, $t1, 3 + sw $t1, -28($fp) # IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_TRUE_55 # IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_TRUE_55 - lw $t2, -28($fp) - beq $t2, 0, label_TRUE_55 + lw $t1, -28($fp) + beq $t1, 0, label_TRUE_55 # LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) # local_i2c_at_A2I_internal_6 = 0 - li $t2, 0 - sw $t2, -28($fp) + li $t1, 0 + sw $t1, -28($fp) # GOTO label_END_56 j label_END_56 label_TRUE_55: # LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) # local_i2c_at_A2I_internal_6 = 1 - li $t2, 1 - sw $t2, -28($fp) + li $t1, 1 + sw $t1, -28($fp) label_END_56: # IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSE_53 # IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSE_53 -lw $t2, -28($fp) -beq $t2, 0, label_FALSE_53 +lw $t1, -28($fp) +beq $t1, 0, label_FALSE_53 # LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) -# Allocating 16 bytes of memory -li $a0, 16 +# Allocating 20 bytes of memory +li $a0, 20 li $v0, 9 syscall # Allocating string -la $t2, String -sw $t2, 0($v0) -la $t2, String_start -sw $t2, 4($v0) -la $t2, data_15 -sw $t2, 8($v0) -li $t2, 1 -sw $t2, 12($v0) +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_15 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) sw $v0, -32($fp) # GOTO label_END_54 j label_END_54 @@ -1384,43 +1403,46 @@ label_FALSE_53: # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) # local_i2c_at_A2I_internal_8 = PARAM param_i2c_at_A2I_i_0 - 4 - lw $t2, 0($fp) - sub $t2, $t2, 4 - sw $t2, -36($fp) + lw $t1, 0($fp) + sub $t1, $t1, 4 + sw $t1, -36($fp) # IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_TRUE_59 # IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_TRUE_59 - lw $t2, -36($fp) - beq $t2, 0, label_TRUE_59 + lw $t1, -36($fp) + beq $t1, 0, label_TRUE_59 # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) # local_i2c_at_A2I_internal_8 = 0 - li $t2, 0 - sw $t2, -36($fp) + li $t1, 0 + sw $t1, -36($fp) # GOTO label_END_60 j label_END_60 label_TRUE_59: # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) # local_i2c_at_A2I_internal_8 = 1 - li $t2, 1 - sw $t2, -36($fp) + li $t1, 1 + sw $t1, -36($fp) label_END_60: # IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_FALSE_57 # IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_FALSE_57 -lw $t2, -36($fp) -beq $t2, 0, label_FALSE_57 +lw $t1, -36($fp) +beq $t1, 0, label_FALSE_57 # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) -# Allocating 16 bytes of memory -li $a0, 16 +# Allocating 20 bytes of memory +li $a0, 20 li $v0, 9 syscall # Allocating string -la $t2, String -sw $t2, 0($v0) -la $t2, String_start -sw $t2, 4($v0) -la $t2, data_16 -sw $t2, 8($v0) -li $t2, 1 -sw $t2, 12($v0) +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_16 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) sw $v0, -40($fp) # GOTO label_END_58 j label_END_58 @@ -1428,43 +1450,46 @@ label_FALSE_57: # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) # local_i2c_at_A2I_internal_10 = PARAM param_i2c_at_A2I_i_0 - 5 - lw $t2, 0($fp) - sub $t2, $t2, 5 - sw $t2, -44($fp) + lw $t1, 0($fp) + sub $t1, $t1, 5 + sw $t1, -44($fp) # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_63 # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_63 - lw $t2, -44($fp) - beq $t2, 0, label_TRUE_63 + lw $t1, -44($fp) + beq $t1, 0, label_TRUE_63 # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) # local_i2c_at_A2I_internal_10 = 0 - li $t2, 0 - sw $t2, -44($fp) + li $t1, 0 + sw $t1, -44($fp) # GOTO label_END_64 j label_END_64 label_TRUE_63: # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) # local_i2c_at_A2I_internal_10 = 1 - li $t2, 1 - sw $t2, -44($fp) + li $t1, 1 + sw $t1, -44($fp) label_END_64: # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_61 # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_61 -lw $t2, -44($fp) -beq $t2, 0, label_FALSE_61 +lw $t1, -44($fp) +beq $t1, 0, label_FALSE_61 # LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) -# Allocating 16 bytes of memory -li $a0, 16 +# Allocating 20 bytes of memory +li $a0, 20 li $v0, 9 syscall # Allocating string -la $t2, String -sw $t2, 0($v0) -la $t2, String_start -sw $t2, 4($v0) -la $t2, data_17 -sw $t2, 8($v0) -li $t2, 1 -sw $t2, 12($v0) +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_17 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) sw $v0, -48($fp) # GOTO label_END_62 j label_END_62 @@ -1472,43 +1497,46 @@ label_FALSE_61: # LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) # local_i2c_at_A2I_internal_12 = PARAM param_i2c_at_A2I_i_0 - 6 - lw $t2, 0($fp) - sub $t2, $t2, 6 - sw $t2, -52($fp) + lw $t1, 0($fp) + sub $t1, $t1, 6 + sw $t1, -52($fp) # IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_TRUE_67 # IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_TRUE_67 - lw $t2, -52($fp) - beq $t2, 0, label_TRUE_67 + lw $t1, -52($fp) + beq $t1, 0, label_TRUE_67 # LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) # local_i2c_at_A2I_internal_12 = 0 - li $t2, 0 - sw $t2, -52($fp) + li $t1, 0 + sw $t1, -52($fp) # GOTO label_END_68 j label_END_68 label_TRUE_67: # LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) # local_i2c_at_A2I_internal_12 = 1 - li $t2, 1 - sw $t2, -52($fp) + li $t1, 1 + sw $t1, -52($fp) label_END_68: # IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSE_65 # IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSE_65 -lw $t2, -52($fp) -beq $t2, 0, label_FALSE_65 +lw $t1, -52($fp) +beq $t1, 0, label_FALSE_65 # LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) -# Allocating 16 bytes of memory -li $a0, 16 +# Allocating 20 bytes of memory +li $a0, 20 li $v0, 9 syscall # Allocating string -la $t2, String -sw $t2, 0($v0) -la $t2, String_start -sw $t2, 4($v0) -la $t2, data_18 -sw $t2, 8($v0) -li $t2, 1 -sw $t2, 12($v0) +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_18 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) sw $v0, -56($fp) # GOTO label_END_66 j label_END_66 @@ -1516,43 +1544,46 @@ label_FALSE_65: # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) # local_i2c_at_A2I_internal_14 = PARAM param_i2c_at_A2I_i_0 - 7 - lw $t2, 0($fp) - sub $t2, $t2, 7 - sw $t2, -60($fp) + lw $t1, 0($fp) + sub $t1, $t1, 7 + sw $t1, -60($fp) # IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_TRUE_71 # IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_TRUE_71 - lw $t2, -60($fp) - beq $t2, 0, label_TRUE_71 + lw $t1, -60($fp) + beq $t1, 0, label_TRUE_71 # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) # local_i2c_at_A2I_internal_14 = 0 - li $t2, 0 - sw $t2, -60($fp) + li $t1, 0 + sw $t1, -60($fp) # GOTO label_END_72 j label_END_72 label_TRUE_71: # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) # local_i2c_at_A2I_internal_14 = 1 - li $t2, 1 - sw $t2, -60($fp) + li $t1, 1 + sw $t1, -60($fp) label_END_72: # IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_FALSE_69 # IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_FALSE_69 -lw $t2, -60($fp) -beq $t2, 0, label_FALSE_69 +lw $t1, -60($fp) +beq $t1, 0, label_FALSE_69 # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) -# Allocating 16 bytes of memory -li $a0, 16 +# Allocating 20 bytes of memory +li $a0, 20 li $v0, 9 syscall # Allocating string -la $t2, String -sw $t2, 0($v0) -la $t2, String_start -sw $t2, 4($v0) -la $t2, data_19 -sw $t2, 8($v0) -li $t2, 1 -sw $t2, 12($v0) +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_19 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) sw $v0, -64($fp) # GOTO label_END_70 j label_END_70 @@ -1560,43 +1591,46 @@ label_FALSE_69: # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) # local_i2c_at_A2I_internal_16 = PARAM param_i2c_at_A2I_i_0 - 8 - lw $t2, 0($fp) - sub $t2, $t2, 8 - sw $t2, -68($fp) + lw $t1, 0($fp) + sub $t1, $t1, 8 + sw $t1, -68($fp) # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_75 # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_75 - lw $t2, -68($fp) - beq $t2, 0, label_TRUE_75 + lw $t1, -68($fp) + beq $t1, 0, label_TRUE_75 # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) # local_i2c_at_A2I_internal_16 = 0 - li $t2, 0 - sw $t2, -68($fp) + li $t1, 0 + sw $t1, -68($fp) # GOTO label_END_76 j label_END_76 label_TRUE_75: # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) # local_i2c_at_A2I_internal_16 = 1 - li $t2, 1 - sw $t2, -68($fp) + li $t1, 1 + sw $t1, -68($fp) label_END_76: # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_73 # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_73 -lw $t2, -68($fp) -beq $t2, 0, label_FALSE_73 +lw $t1, -68($fp) +beq $t1, 0, label_FALSE_73 # LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) -# Allocating 16 bytes of memory -li $a0, 16 +# Allocating 20 bytes of memory +li $a0, 20 li $v0, 9 syscall # Allocating string -la $t2, String -sw $t2, 0($v0) -la $t2, String_start -sw $t2, 4($v0) -la $t2, data_20 -sw $t2, 8($v0) -li $t2, 1 -sw $t2, 12($v0) +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_20 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) sw $v0, -72($fp) # GOTO label_END_74 j label_END_74 @@ -1604,43 +1638,46 @@ label_FALSE_73: # LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) # local_i2c_at_A2I_internal_18 = PARAM param_i2c_at_A2I_i_0 - 9 - lw $t2, 0($fp) - sub $t2, $t2, 9 - sw $t2, -76($fp) + lw $t1, 0($fp) + sub $t1, $t1, 9 + sw $t1, -76($fp) # IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_TRUE_79 # IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_TRUE_79 - lw $t2, -76($fp) - beq $t2, 0, label_TRUE_79 + lw $t1, -76($fp) + beq $t1, 0, label_TRUE_79 # LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) # local_i2c_at_A2I_internal_18 = 0 - li $t2, 0 - sw $t2, -76($fp) + li $t1, 0 + sw $t1, -76($fp) # GOTO label_END_80 j label_END_80 label_TRUE_79: # LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) # local_i2c_at_A2I_internal_18 = 1 - li $t2, 1 - sw $t2, -76($fp) + li $t1, 1 + sw $t1, -76($fp) label_END_80: # IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSE_77 # IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSE_77 -lw $t2, -76($fp) -beq $t2, 0, label_FALSE_77 +lw $t1, -76($fp) +beq $t1, 0, label_FALSE_77 # LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) -# Allocating 16 bytes of memory -li $a0, 16 +# Allocating 20 bytes of memory +li $a0, 20 li $v0, 9 syscall # Allocating string -la $t2, String -sw $t2, 0($v0) -la $t2, String_start -sw $t2, 4($v0) -la $t2, data_21 -sw $t2, 8($v0) -li $t2, 1 -sw $t2, 12($v0) +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_21 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) sw $v0, -80($fp) # GOTO label_END_78 j label_END_78 @@ -1651,8 +1688,8 @@ label_FALSE_77: # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) # local_i2c_at_A2I_internal_20 = local_i2c_at_A2I_internal_22 - lw $t2, -92($fp) - sw $t2, -84($fp) + lw $t1, -92($fp) + sw $t1, -84($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1662,31 +1699,34 @@ label_FALSE_77: # Save new self pointer in $s1 lw $s1, -84($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 0($t3) + lw $t3, 0($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -88($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - la $t2, data_22 - sw $t2, 8($v0) - li $t2, 0 - sw $t2, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_22 + sw $t1, 12($v0) + li $t1, 0 + sw $t1, 16($v0) sw $v0, -96($fp) label_END_78: label_END_74: @@ -1724,8 +1764,8 @@ function_a2i_at_A2I: # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) # PARAM param_a2i_at_A2I_s_0 --> 0($fp) # local_a2i_at_A2I_internal_1 = PARAM param_a2i_at_A2I_s_0 - lw $t2, 0($fp) - sw $t2, -8($fp) + lw $t1, 0($fp) + sw $t1, -8($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1735,13 +1775,13 @@ function_a2i_at_A2I: # Save new self pointer in $s1 lw $s1, -8($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 8($t3) + lw $t3, 8($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -12($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1749,220 +1789,226 @@ function_a2i_at_A2I: # LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) # local_a2i_at_A2I_internal_0 = local_a2i_at_A2I_internal_2 - 0 - lw $t2, -12($fp) - sub $t2, $t2, 0 - sw $t2, -4($fp) + lw $t1, -12($fp) + sub $t1, $t1, 0 + sw $t1, -4($fp) # IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_TRUE_83 # IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_TRUE_83 - lw $t2, -4($fp) - beq $t2, 0, label_TRUE_83 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_83 # LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) # local_a2i_at_A2I_internal_0 = 0 - li $t2, 0 - sw $t2, -4($fp) + li $t1, 0 + sw $t1, -4($fp) # GOTO label_END_84 j label_END_84 label_TRUE_83: # LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) # local_a2i_at_A2I_internal_0 = 1 - li $t2, 1 - sw $t2, -4($fp) + li $t1, 1 + sw $t1, -4($fp) label_END_84: # IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSE_81 # IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSE_81 -lw $t2, -4($fp) -beq $t2, 0, label_FALSE_81 +lw $t1, -4($fp) +beq $t1, 0, label_FALSE_81 # GOTO label_END_82 j label_END_82 label_FALSE_81: # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) # PARAM param_a2i_at_A2I_s_0 --> 0($fp) # local_a2i_at_A2I_internal_4 = PARAM param_a2i_at_A2I_s_0 - lw $t2, 0($fp) - sw $t2, -20($fp) + lw $t1, 0($fp) + sw $t1, -20($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG 0 - li $t2, 0 + li $t1, 0 # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # ARG 1 - li $t2, 1 + li $t1, 1 # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) # local_a2i_at_A2I_internal_5 = VCALL local_a2i_at_A2I_internal_4 substr # Save new self pointer in $s1 lw $s1, -20($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 4($t3) + lw $t3, 4($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - la $t2, data_23 - sw $t2, 8($v0) - li $t2, 1 - sw $t2, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_23 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) sw $v0, -28($fp) # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) # local_a2i_at_A2I_internal_3 = local_a2i_at_A2I_internal_5 - local_a2i_at_A2I_internal_6 - lw $t2, -24($fp) - lw $t3, -28($fp) - sub $t2, $t2, $t3 - sw $t2, -16($fp) + lw $t1, -24($fp) + lw $t2, -28($fp) + sub $t1, $t1, $t2 + sw $t1, -16($fp) # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_87 # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_87 - lw $t2, -16($fp) - beq $t2, 0, label_TRUE_87 + lw $t1, -16($fp) + beq $t1, 0, label_TRUE_87 # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) # local_a2i_at_A2I_internal_3 = 0 - li $t2, 0 - sw $t2, -16($fp) + li $t1, 0 + sw $t1, -16($fp) # GOTO label_END_88 j label_END_88 label_TRUE_87: # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) # local_a2i_at_A2I_internal_3 = 1 - li $t2, 1 - sw $t2, -16($fp) + li $t1, 1 + sw $t1, -16($fp) label_END_88: # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_FALSE_85 # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_FALSE_85 -lw $t2, -16($fp) -beq $t2, 0, label_FALSE_85 +lw $t1, -16($fp) +beq $t1, 0, label_FALSE_85 # GOTO label_END_86 j label_END_86 label_FALSE_85: # LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) # PARAM param_a2i_at_A2I_s_0 --> 0($fp) # local_a2i_at_A2I_internal_8 = PARAM param_a2i_at_A2I_s_0 - lw $t2, 0($fp) - sw $t2, -36($fp) + lw $t1, 0($fp) + sw $t1, -36($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG 0 - li $t2, 0 + li $t1, 0 # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # ARG 1 - li $t2, 1 + li $t1, 1 # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) # LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) # local_a2i_at_A2I_internal_9 = VCALL local_a2i_at_A2I_internal_8 substr # Save new self pointer in $s1 lw $s1, -36($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 4($t3) + lw $t3, 4($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -40($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - la $t2, data_24 - sw $t2, 8($v0) - li $t2, 1 - sw $t2, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_24 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) sw $v0, -44($fp) # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) # LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) # local_a2i_at_A2I_internal_7 = local_a2i_at_A2I_internal_9 - local_a2i_at_A2I_internal_10 - lw $t2, -40($fp) - lw $t3, -44($fp) - sub $t2, $t2, $t3 - sw $t2, -32($fp) + lw $t1, -40($fp) + lw $t2, -44($fp) + sub $t1, $t1, $t2 + sw $t1, -32($fp) # IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_TRUE_91 # IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_TRUE_91 - lw $t2, -32($fp) - beq $t2, 0, label_TRUE_91 + lw $t1, -32($fp) + beq $t1, 0, label_TRUE_91 # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) # local_a2i_at_A2I_internal_7 = 0 - li $t2, 0 - sw $t2, -32($fp) + li $t1, 0 + sw $t1, -32($fp) # GOTO label_END_92 j label_END_92 label_TRUE_91: # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) # local_a2i_at_A2I_internal_7 = 1 - li $t2, 1 - sw $t2, -32($fp) + li $t1, 1 + sw $t1, -32($fp) label_END_92: # IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_FALSE_89 # IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_FALSE_89 -lw $t2, -32($fp) -beq $t2, 0, label_FALSE_89 +lw $t1, -32($fp) +beq $t1, 0, label_FALSE_89 # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) # local_a2i_at_A2I_internal_13 = SELF sw $s1, -56($fp) # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) # local_a2i_at_A2I_internal_11 = local_a2i_at_A2I_internal_13 -lw $t2, -56($fp) -sw $t2, -48($fp) +lw $t1, -56($fp) +sw $t1, -48($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) # PARAM param_a2i_at_A2I_s_0 --> 0($fp) # local_a2i_at_A2I_internal_14 = PARAM param_a2i_at_A2I_s_0 -lw $t2, 0($fp) -sw $t2, -60($fp) +lw $t1, 0($fp) +sw $t1, -60($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG 1 -li $t2, 1 +li $t1, 1 # Push arg into stack subu $sp, $sp, 4 -sw $t2, 0($sp) +sw $t1, 0($sp) # LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) # PARAM param_a2i_at_A2I_s_0 --> 0($fp) # local_a2i_at_A2I_internal_17 = PARAM param_a2i_at_A2I_s_0 -lw $t2, 0($fp) -sw $t2, -72($fp) +lw $t1, 0($fp) +sw $t1, -72($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1972,13 +2018,13 @@ sw $s1, 0($sp) # Save new self pointer in $s1 lw $s1, -72($fp) # Get pointer to type -lw $t2, 4($s1) +lw $t1, 4($s1) # Get pointer to type's VTABLE -lw $t3, 0($t2) +lw $t2, 0($t1) # Get pointer to function address -lw $t4, 8($t3) +lw $t3, 8($t2) # Call function. Result is on $v0 -jalr $t4 +jalr $t3 sw $v0, -76($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1986,51 +2032,51 @@ addu $sp, $sp, 4 # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) # LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) # local_a2i_at_A2I_internal_16 = local_a2i_at_A2I_internal_18 - 1 -lw $t2, -76($fp) -sub $t2, $t2, 1 -sw $t2, -68($fp) +lw $t1, -76($fp) +sub $t1, $t1, 1 +sw $t1, -68($fp) # ARG local_a2i_at_A2I_internal_16 # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) -lw $t2, -68($fp) +lw $t1, -68($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t2, 0($sp) +sw $t1, 0($sp) # LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) # LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) # local_a2i_at_A2I_internal_15 = VCALL local_a2i_at_A2I_internal_14 substr # Save new self pointer in $s1 lw $s1, -60($fp) # Get pointer to type -lw $t2, 4($s1) +lw $t1, 4($s1) # Get pointer to type's VTABLE -lw $t3, 0($t2) +lw $t2, 0($t1) # Get pointer to function address -lw $t4, 4($t3) +lw $t3, 4($t2) # Call function. Result is on $v0 -jalr $t4 +jalr $t3 sw $v0, -64($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_a2i_at_A2I_internal_15 # LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) -lw $t2, -64($fp) +lw $t1, -64($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t2, 0($sp) +sw $t1, 0($sp) # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) # LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) # local_a2i_at_A2I_internal_12 = VCALL local_a2i_at_A2I_internal_11 a2i_aux # Save new self pointer in $s1 lw $s1, -48($fp) # Get pointer to type -lw $t2, 4($s1) +lw $t1, 4($s1) # Get pointer to type's VTABLE -lw $t3, 0($t2) +lw $t2, 0($t1) # Get pointer to function address -lw $t4, 24($t3) +lw $t3, 24($t2) # Call function. Result is on $v0 -jalr $t4 +jalr $t3 sw $v0, -52($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2044,30 +2090,30 @@ label_FALSE_89: # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) # LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) # local_a2i_at_A2I_internal_19 = local_a2i_at_A2I_internal_21 - lw $t2, -88($fp) - sw $t2, -80($fp) + lw $t1, -88($fp) + sw $t1, -80($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG param_a2i_at_A2I_s_0 # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - lw $t2, 0($fp) + lw $t1, 0($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) # LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) # local_a2i_at_A2I_internal_20 = VCALL local_a2i_at_A2I_internal_19 a2i_aux # Save new self pointer in $s1 lw $s1, -80($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 24($t3) + lw $t3, 24($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -84($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2100,13 +2146,13 @@ function_a2i_aux_at_A2I: addu $fp, $sp, 64 # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) # local_a2i_aux_at_A2I_int_0 = 0 - li $t2, 0 - sw $t2, -4($fp) + li $t1, 0 + sw $t1, -4($fp) # LOCAL local_a2i_aux_at_A2I_internal_2 --> -12($fp) # PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) # local_a2i_aux_at_A2I_internal_2 = PARAM param_a2i_aux_at_A2I_s_0 - lw $t2, 0($fp) - sw $t2, -12($fp) + lw $t1, 0($fp) + sw $t1, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2116,13 +2162,13 @@ function_a2i_aux_at_A2I: # Save new self pointer in $s1 lw $s1, -12($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 8($t3) + lw $t3, 8($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2130,117 +2176,117 @@ function_a2i_aux_at_A2I: # LOCAL local_a2i_aux_at_A2I_j_1 --> -8($fp) # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) # local_a2i_aux_at_A2I_j_1 = local_a2i_aux_at_A2I_internal_3 - lw $t2, -16($fp) - sw $t2, -8($fp) + lw $t1, -16($fp) + sw $t1, -8($fp) # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) # local_a2i_aux_at_A2I_i_4 = 0 - li $t2, 0 - sw $t2, -20($fp) + li $t1, 0 + sw $t1, -20($fp) label_WHILE_93: # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) # LOCAL local_a2i_aux_at_A2I_j_1 --> -8($fp) # local_a2i_aux_at_A2I_internal_5 = local_a2i_aux_at_A2I_i_4 - local_a2i_aux_at_A2I_j_1 - lw $t2, -20($fp) - lw $t3, -8($fp) - sub $t2, $t2, $t3 - sw $t2, -24($fp) + lw $t1, -20($fp) + lw $t2, -8($fp) + sub $t1, $t1, $t2 + sw $t1, -24($fp) # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 - lw $t2, -24($fp) - bgt $t2, 0, label_FALSE_95 + lw $t1, -24($fp) + bgt $t1, 0, label_FALSE_95 # IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 # IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 - lw $t2, -24($fp) - beq $t2, 0, label_FALSE_95 + lw $t1, -24($fp) + beq $t1, 0, label_FALSE_95 # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) # local_a2i_aux_at_A2I_internal_5 = 1 - li $t2, 1 - sw $t2, -24($fp) + li $t1, 1 + sw $t1, -24($fp) # GOTO label_END_96 j label_END_96 label_FALSE_95: # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) # local_a2i_aux_at_A2I_internal_5 = 0 - li $t2, 0 - sw $t2, -24($fp) + li $t1, 0 + sw $t1, -24($fp) label_END_96: # IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_WHILE_END_94 # IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_WHILE_END_94 -lw $t2, -24($fp) -beq $t2, 0, label_WHILE_END_94 +lw $t1, -24($fp) +beq $t1, 0, label_WHILE_END_94 # LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) # local_a2i_aux_at_A2I_internal_7 = local_a2i_aux_at_A2I_int_0 * 10 -lw $t2, -4($fp) -mul $t2, $t2, 10 -sw $t2, -32($fp) +lw $t1, -4($fp) +mul $t1, $t1, 10 +sw $t1, -32($fp) # LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) # local_a2i_aux_at_A2I_internal_10 = SELF sw $s1, -44($fp) # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) # LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) # local_a2i_aux_at_A2I_internal_8 = local_a2i_aux_at_A2I_internal_10 -lw $t2, -44($fp) -sw $t2, -36($fp) +lw $t1, -44($fp) +sw $t1, -36($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) # PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) # local_a2i_aux_at_A2I_internal_11 = PARAM param_a2i_aux_at_A2I_s_0 -lw $t2, 0($fp) -sw $t2, -48($fp) +lw $t1, 0($fp) +sw $t1, -48($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG local_a2i_aux_at_A2I_i_4 # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) -lw $t2, -20($fp) +lw $t1, -20($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t2, 0($sp) +sw $t1, 0($sp) # ARG 1 -li $t2, 1 +li $t1, 1 # Push arg into stack subu $sp, $sp, 4 -sw $t2, 0($sp) +sw $t1, 0($sp) # LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) # LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) # local_a2i_aux_at_A2I_internal_12 = VCALL local_a2i_aux_at_A2I_internal_11 substr # Save new self pointer in $s1 lw $s1, -48($fp) # Get pointer to type -lw $t2, 4($s1) +lw $t1, 4($s1) # Get pointer to type's VTABLE -lw $t3, 0($t2) +lw $t2, 0($t1) # Get pointer to function address -lw $t4, 4($t3) +lw $t3, 4($t2) # Call function. Result is on $v0 -jalr $t4 +jalr $t3 sw $v0, -52($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_a2i_aux_at_A2I_internal_12 # LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) -lw $t2, -52($fp) +lw $t1, -52($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t2, 0($sp) +sw $t1, 0($sp) # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) # LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) # local_a2i_aux_at_A2I_internal_9 = VCALL local_a2i_aux_at_A2I_internal_8 c2i # Save new self pointer in $s1 lw $s1, -36($fp) # Get pointer to type -lw $t2, 4($s1) +lw $t1, 4($s1) # Get pointer to type's VTABLE -lw $t3, 0($t2) +lw $t2, 0($t1) # Get pointer to function address -lw $t4, 12($t3) +lw $t3, 12($t2) # Call function. Result is on $v0 -jalr $t4 +jalr $t3 sw $v0, -40($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2249,26 +2295,26 @@ addu $sp, $sp, 4 # LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) # LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) # local_a2i_aux_at_A2I_internal_6 = local_a2i_aux_at_A2I_internal_7 + local_a2i_aux_at_A2I_internal_9 -lw $t2, -32($fp) -lw $t3, -40($fp) -add $t2, $t2, $t3 -sw $t2, -28($fp) +lw $t1, -32($fp) +lw $t2, -40($fp) +add $t1, $t1, $t2 +sw $t1, -28($fp) # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) # LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) # local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_6 -lw $t2, -28($fp) -sw $t2, -4($fp) +lw $t1, -28($fp) +sw $t1, -4($fp) # LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) # local_a2i_aux_at_A2I_internal_13 = local_a2i_aux_at_A2I_i_4 + 1 -lw $t2, -20($fp) -add $t2, $t2, 1 -sw $t2, -56($fp) +lw $t1, -20($fp) +add $t1, $t1, 1 +sw $t1, -56($fp) # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) # LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) # local_a2i_aux_at_A2I_i_4 = local_a2i_aux_at_A2I_internal_13 -lw $t2, -56($fp) -sw $t2, -20($fp) +lw $t1, -56($fp) +sw $t1, -20($fp) # GOTO label_WHILE_93 j label_WHILE_93 label_WHILE_END_94: @@ -2299,43 +2345,46 @@ function_i2a_at_A2I: # LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) # PARAM param_i2a_at_A2I_i_0 --> 0($fp) # local_i2a_at_A2I_internal_0 = PARAM param_i2a_at_A2I_i_0 - 0 - lw $t2, 0($fp) - sub $t2, $t2, 0 - sw $t2, -4($fp) + lw $t1, 0($fp) + sub $t1, $t1, 0 + sw $t1, -4($fp) # IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_TRUE_99 # IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_TRUE_99 - lw $t2, -4($fp) - beq $t2, 0, label_TRUE_99 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_99 # LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) # local_i2a_at_A2I_internal_0 = 0 - li $t2, 0 - sw $t2, -4($fp) + li $t1, 0 + sw $t1, -4($fp) # GOTO label_END_100 j label_END_100 label_TRUE_99: # LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) # local_i2a_at_A2I_internal_0 = 1 - li $t2, 1 - sw $t2, -4($fp) + li $t1, 1 + sw $t1, -4($fp) label_END_100: # IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSE_97 # IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSE_97 -lw $t2, -4($fp) -beq $t2, 0, label_FALSE_97 +lw $t1, -4($fp) +beq $t1, 0, label_FALSE_97 # LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) -# Allocating 16 bytes of memory -li $a0, 16 +# Allocating 20 bytes of memory +li $a0, 20 li $v0, 9 syscall # Allocating string -la $t2, String -sw $t2, 0($v0) -la $t2, String_start -sw $t2, 4($v0) -la $t2, data_25 -sw $t2, 8($v0) -li $t2, 1 -sw $t2, 12($v0) +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_25 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) sw $v0, -8($fp) # GOTO label_END_98 j label_END_98 @@ -2343,64 +2392,64 @@ label_FALSE_97: # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) # PARAM param_i2a_at_A2I_i_0 --> 0($fp) # local_i2a_at_A2I_internal_2 = 0 - PARAM param_i2a_at_A2I_i_0 - li $t2, 0 - lw $t3, 0($fp) - sub $t2, $t2, $t3 - sw $t2, -12($fp) + li $t1, 0 + lw $t2, 0($fp) + sub $t1, $t1, $t2 + sw $t1, -12($fp) # IF_GREATER_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 # IF_GREATER_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 - lw $t2, -12($fp) - bgt $t2, 0, label_FALSE_103 + lw $t1, -12($fp) + bgt $t1, 0, label_FALSE_103 # IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 # IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 - lw $t2, -12($fp) - beq $t2, 0, label_FALSE_103 + lw $t1, -12($fp) + beq $t1, 0, label_FALSE_103 # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) # local_i2a_at_A2I_internal_2 = 1 - li $t2, 1 - sw $t2, -12($fp) + li $t1, 1 + sw $t1, -12($fp) # GOTO label_END_104 j label_END_104 label_FALSE_103: # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) # local_i2a_at_A2I_internal_2 = 0 - li $t2, 0 - sw $t2, -12($fp) + li $t1, 0 + sw $t1, -12($fp) label_END_104: # IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_101 # IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_101 -lw $t2, -12($fp) -beq $t2, 0, label_FALSE_101 +lw $t1, -12($fp) +beq $t1, 0, label_FALSE_101 # LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) # local_i2a_at_A2I_internal_5 = SELF sw $s1, -24($fp) # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) # LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) # local_i2a_at_A2I_internal_3 = local_i2a_at_A2I_internal_5 -lw $t2, -24($fp) -sw $t2, -16($fp) +lw $t1, -24($fp) +sw $t1, -16($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG param_i2a_at_A2I_i_0 # PARAM param_i2a_at_A2I_i_0 --> 0($fp) -lw $t2, 0($fp) +lw $t1, 0($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t2, 0($sp) +sw $t1, 0($sp) # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) # local_i2a_at_A2I_internal_4 = VCALL local_i2a_at_A2I_internal_3 i2a_aux # Save new self pointer in $s1 lw $s1, -16($fp) # Get pointer to type -lw $t2, 4($s1) +lw $t1, 4($s1) # Get pointer to type's VTABLE -lw $t3, 0($t2) +lw $t2, 0($t1) # Get pointer to function address -lw $t4, 32($t3) +lw $t3, 32($t2) # Call function. Result is on $v0 -jalr $t4 +jalr $t3 sw $v0, -20($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2409,25 +2458,28 @@ addu $sp, $sp, 4 j label_END_102 label_FALSE_101: # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - la $t2, data_26 - sw $t2, 8($v0) - li $t2, 1 - sw $t2, 12($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_26 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) sw $v0, -36($fp) # LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) # local_i2a_at_A2I_internal_6 = local_i2a_at_A2I_internal_8 - lw $t2, -36($fp) - sw $t2, -28($fp) + lw $t1, -36($fp) + sw $t1, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2437,59 +2489,59 @@ label_FALSE_101: # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) # LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) # local_i2a_at_A2I_internal_9 = local_i2a_at_A2I_internal_11 - lw $t2, -48($fp) - sw $t2, -40($fp) + lw $t1, -48($fp) + sw $t1, -40($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) # PARAM param_i2a_at_A2I_i_0 --> 0($fp) # local_i2a_at_A2I_internal_12 = PARAM param_i2a_at_A2I_i_0 * 1 - lw $t2, 0($fp) - mul $t2, $t2, 1 - sw $t2, -52($fp) + lw $t1, 0($fp) + mul $t1, $t1, 1 + sw $t1, -52($fp) # ARG local_i2a_at_A2I_internal_12 # LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) - lw $t2, -52($fp) + lw $t1, -52($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) # LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) # local_i2a_at_A2I_internal_10 = VCALL local_i2a_at_A2I_internal_9 i2a_aux # Save new self pointer in $s1 lw $s1, -40($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 32($t3) + lw $t3, 32($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -44($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_i2a_at_A2I_internal_10 # LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) - lw $t2, -44($fp) + lw $t1, -44($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) # LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) # local_i2a_at_A2I_internal_7 = VCALL local_i2a_at_A2I_internal_6 concat # Save new self pointer in $s1 lw $s1, -28($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 0($t3) + lw $t3, 0($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2522,43 +2574,46 @@ function_i2a_aux_at_A2I: # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) # local_i2a_aux_at_A2I_internal_0 = PARAM param_i2a_aux_at_A2I_i_0 - 0 - lw $t2, 0($fp) - sub $t2, $t2, 0 - sw $t2, -4($fp) + lw $t1, 0($fp) + sub $t1, $t1, 0 + sw $t1, -4($fp) # IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_TRUE_107 # IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_TRUE_107 - lw $t2, -4($fp) - beq $t2, 0, label_TRUE_107 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_107 # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) # local_i2a_aux_at_A2I_internal_0 = 0 - li $t2, 0 - sw $t2, -4($fp) + li $t1, 0 + sw $t1, -4($fp) # GOTO label_END_108 j label_END_108 label_TRUE_107: # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) # local_i2a_aux_at_A2I_internal_0 = 1 - li $t2, 1 - sw $t2, -4($fp) + li $t1, 1 + sw $t1, -4($fp) label_END_108: # IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSE_105 # IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSE_105 -lw $t2, -4($fp) -beq $t2, 0, label_FALSE_105 +lw $t1, -4($fp) +beq $t1, 0, label_FALSE_105 # LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) -# Allocating 16 bytes of memory -li $a0, 16 +# Allocating 20 bytes of memory +li $a0, 20 li $v0, 9 syscall # Allocating string -la $t2, String -sw $t2, 0($v0) -la $t2, String_start -sw $t2, 4($v0) -la $t2, data_27 -sw $t2, 8($v0) -li $t2, 0 -sw $t2, 12($v0) +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_27 +sw $t1, 12($v0) +li $t1, 0 +sw $t1, 16($v0) sw $v0, -8($fp) # GOTO label_END_106 j label_END_106 @@ -2566,44 +2621,44 @@ label_FALSE_105: # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) # local_i2a_aux_at_A2I_internal_3 = PARAM param_i2a_aux_at_A2I_i_0 / 10 - lw $t2, 0($fp) - div $t2, $t2, 10 - sw $t2, -16($fp) + lw $t1, 0($fp) + div $t1, $t1, 10 + sw $t1, -16($fp) # LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) # local_i2a_aux_at_A2I_next_2 = local_i2a_aux_at_A2I_internal_3 - lw $t2, -16($fp) - sw $t2, -12($fp) + lw $t1, -16($fp) + sw $t1, -12($fp) # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) # local_i2a_aux_at_A2I_internal_8 = SELF sw $s1, -36($fp) # LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) # local_i2a_aux_at_A2I_internal_6 = local_i2a_aux_at_A2I_internal_8 - lw $t2, -36($fp) - sw $t2, -28($fp) + lw $t1, -36($fp) + sw $t1, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG local_i2a_aux_at_A2I_next_2 # LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) - lw $t2, -12($fp) + lw $t1, -12($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) # local_i2a_aux_at_A2I_internal_7 = VCALL local_i2a_aux_at_A2I_internal_6 i2a_aux # Save new self pointer in $s1 lw $s1, -28($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 32($t3) + lw $t3, 32($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2611,8 +2666,8 @@ label_FALSE_105: # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) # local_i2a_aux_at_A2I_internal_4 = local_i2a_aux_at_A2I_internal_7 - lw $t2, -32($fp) - sw $t2, -20($fp) + lw $t1, -32($fp) + sw $t1, -20($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2622,67 +2677,67 @@ label_FALSE_105: # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) # local_i2a_aux_at_A2I_internal_9 = local_i2a_aux_at_A2I_internal_11 - lw $t2, -48($fp) - sw $t2, -40($fp) + lw $t1, -48($fp) + sw $t1, -40($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) # LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) # local_i2a_aux_at_A2I_internal_13 = local_i2a_aux_at_A2I_next_2 * 10 - lw $t2, -12($fp) - mul $t2, $t2, 10 - sw $t2, -56($fp) + lw $t1, -12($fp) + mul $t1, $t1, 10 + sw $t1, -56($fp) # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) # local_i2a_aux_at_A2I_internal_12 = PARAM param_i2a_aux_at_A2I_i_0 - local_i2a_aux_at_A2I_internal_13 - lw $t2, 0($fp) - lw $t3, -56($fp) - sub $t2, $t2, $t3 - sw $t2, -52($fp) + lw $t1, 0($fp) + lw $t2, -56($fp) + sub $t1, $t1, $t2 + sw $t1, -52($fp) # ARG local_i2a_aux_at_A2I_internal_12 # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) - lw $t2, -52($fp) + lw $t1, -52($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) # local_i2a_aux_at_A2I_internal_10 = VCALL local_i2a_aux_at_A2I_internal_9 i2c # Save new self pointer in $s1 lw $s1, -40($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 16($t3) + lw $t3, 16($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -44($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_i2a_aux_at_A2I_internal_10 # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) - lw $t2, -44($fp) + lw $t1, -44($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) # LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) # local_i2a_aux_at_A2I_internal_5 = VCALL local_i2a_aux_at_A2I_internal_4 concat # Save new self pointer in $s1 lw $s1, -20($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t2, 0($t1) # Get pointer to function address - lw $t4, 0($t3) + lw $t3, 0($t2) # Call function. Result is on $v0 - jalr $t4 + jalr $t3 sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2712,71 +2767,80 @@ function_main_at_Main: addu $fp, $sp, 100 # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_3 = ALLOCATE A2I - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - la $t4, A2I - sw $t4, 8($v0) - li $t4, 3 - sw $t4, 12($v0) - move $t4, $v0 - # Allocating 8 bytes of memory - li $a0, 8 + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, A2I + sw $t3, 12($v0) + li $t3, 3 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall - sw $t4, 0($v0) - la $t4, A2I_start - sw $t4, 4($v0) - move $t3, $v0 - sw $t3, -16($fp) + sw $t3, 0($v0) + la $t3, A2I_start + sw $t3, 4($v0) + # Load type offset + li $t3, 16 + sw $t3, 8($v0) + move $t2, $v0 + sw $t2, -16($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t3, -16($fp) - sw $t3, -8($fp) + lw $t2, -16($fp) + sw $t2, -8($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - la $t3, data_28 - sw $t3, 8($v0) - li $t3, 6 - sw $t3, 12($v0) + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_28 + sw $t2, 12($v0) + li $t2, 6 + sw $t2, 16($v0) sw $v0, -20($fp) # ARG local_main_at_Main_internal_4 # LOCAL local_main_at_Main_internal_4 --> -20($fp) - lw $t3, -20($fp) + lw $t2, -20($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t2, 0($sp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 a2i # Save new self pointer in $s1 lw $s1, -8($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t3, 0($t2) # Get pointer to function address - lw $t5, 20($t4) + lw $t4, 20($t3) # Call function. Result is on $v0 - jalr $t5 + jalr $t4 sw $v0, -12($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2784,59 +2848,65 @@ function_main_at_Main: # LOCAL local_main_at_Main_a_0 --> -4($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_a_0 = local_main_at_Main_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) + lw $t2, -12($fp) + sw $t2, -4($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # local_main_at_Main_internal_8 = ALLOCATE A2I - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) - la $t5, A2I - sw $t5, 8($v0) - li $t5, 3 - sw $t5, 12($v0) - move $t5, $v0 - # Allocating 8 bytes of memory - li $a0, 8 + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, A2I + sw $t4, 12($v0) + li $t4, 3 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall - sw $t5, 0($v0) - la $t5, A2I_start - sw $t5, 4($v0) - move $t4, $v0 - sw $t4, -36($fp) + sw $t4, 0($v0) + la $t4, A2I_start + sw $t4, 4($v0) + # Load type offset + li $t4, 16 + sw $t4, 8($v0) + move $t3, $v0 + sw $t3, -36($fp) # LOCAL local_main_at_Main_internal_6 --> -28($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 - lw $t4, -36($fp) - sw $t4, -28($fp) + lw $t3, -36($fp) + sw $t3, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG 678987 - li $t4, 678987 + li $t3, 678987 # Push arg into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t3, 0($sp) # LOCAL local_main_at_Main_internal_6 --> -28($fp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 i2a # Save new self pointer in $s1 lw $s1, -28($fp) # Get pointer to type - lw $t4, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t5, 0($t4) + lw $t4, 0($t3) # Get pointer to function address - lw $t6, 28($t5) + lw $t5, 28($t4) # Call function. Result is on $v0 - jalr $t6 + jalr $t5 sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2844,38 +2914,38 @@ function_main_at_Main: # LOCAL local_main_at_Main_b_5 --> -24($fp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # local_main_at_Main_b_5 = local_main_at_Main_internal_7 - lw $t4, -32($fp) - sw $t4, -24($fp) + lw $t3, -32($fp) + sw $t3, -24($fp) # LOCAL local_main_at_Main_internal_11 --> -48($fp) # local_main_at_Main_internal_11 = SELF sw $s1, -48($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # LOCAL local_main_at_Main_internal_11 --> -48($fp) # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 - lw $t4, -48($fp) - sw $t4, -40($fp) + lw $t3, -48($fp) + sw $t3, -40($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG local_main_at_Main_a_0 # LOCAL local_main_at_Main_a_0 --> -4($fp) - lw $t4, -4($fp) + lw $t3, -4($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t3, 0($sp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # LOCAL local_main_at_Main_internal_10 --> -44($fp) # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_int # Save new self pointer in $s1 lw $s1, -40($fp) # Get pointer to type - lw $t4, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t5, 0($t4) + lw $t4, 0($t3) # Get pointer to function address - lw $t6, 16($t5) + lw $t5, 16($t4) # Call function. Result is on $v0 - jalr $t6 + jalr $t5 sw $v0, -44($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2886,45 +2956,48 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_12 --> -52($fp) # LOCAL local_main_at_Main_internal_14 --> -60($fp) # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 - lw $t4, -60($fp) - sw $t4, -52($fp) + lw $t3, -60($fp) + sw $t3, -52($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - la $t4, data_29 - sw $t4, 8($v0) - li $t4, 4 - sw $t4, 12($v0) + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_29 + sw $t3, 12($v0) + li $t3, 4 + sw $t3, 16($v0) sw $v0, -64($fp) # ARG local_main_at_Main_internal_15 # LOCAL local_main_at_Main_internal_15 --> -64($fp) - lw $t4, -64($fp) + lw $t3, -64($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t3, 0($sp) # LOCAL local_main_at_Main_internal_12 --> -52($fp) # LOCAL local_main_at_Main_internal_13 --> -56($fp) # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string # Save new self pointer in $s1 lw $s1, -52($fp) # Get pointer to type - lw $t4, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t5, 0($t4) + lw $t4, 0($t3) # Get pointer to function address - lw $t6, 12($t5) + lw $t5, 12($t4) # Call function. Result is on $v0 - jalr $t6 + jalr $t5 sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2935,30 +3008,30 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_16 --> -68($fp) # LOCAL local_main_at_Main_internal_18 --> -76($fp) # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 - lw $t4, -76($fp) - sw $t4, -68($fp) + lw $t3, -76($fp) + sw $t3, -68($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG local_main_at_Main_b_5 # LOCAL local_main_at_Main_b_5 --> -24($fp) - lw $t4, -24($fp) + lw $t3, -24($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t3, 0($sp) # LOCAL local_main_at_Main_internal_16 --> -68($fp) # LOCAL local_main_at_Main_internal_17 --> -72($fp) # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string # Save new self pointer in $s1 lw $s1, -68($fp) # Get pointer to type - lw $t4, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t5, 0($t4) + lw $t4, 0($t3) # Get pointer to function address - lw $t6, 12($t5) + lw $t5, 12($t4) # Call function. Result is on $v0 - jalr $t6 + jalr $t5 sw $v0, -72($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2969,45 +3042,48 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_19 --> -80($fp) # LOCAL local_main_at_Main_internal_21 --> -88($fp) # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 - lw $t4, -88($fp) - sw $t4, -80($fp) + lw $t3, -88($fp) + sw $t3, -80($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # LOCAL local_main_at_Main_internal_22 --> -92($fp) - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall # Allocating string - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - la $t4, data_30 - sw $t4, 8($v0) - li $t4, 2 - sw $t4, 12($v0) + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_30 + sw $t3, 12($v0) + li $t3, 2 + sw $t3, 16($v0) sw $v0, -92($fp) # ARG local_main_at_Main_internal_22 # LOCAL local_main_at_Main_internal_22 --> -92($fp) - lw $t4, -92($fp) + lw $t3, -92($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t3, 0($sp) # LOCAL local_main_at_Main_internal_19 --> -80($fp) # LOCAL local_main_at_Main_internal_20 --> -84($fp) # local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 out_string # Save new self pointer in $s1 lw $s1, -80($fp) # Get pointer to type - lw $t4, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t5, 0($t4) + lw $t4, 0($t3) # Get pointer to function address - lw $t6, 12($t5) + lw $t5, 12($t4) # Call function. Result is on $v0 - jalr $t6 + jalr $t5 sw $v0, -84($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) diff --git a/tests/codegen/book_list.mips b/tests/codegen/book_list.mips index 445faa29..9b219cb9 100644 --- a/tests/codegen/book_list.mips +++ b/tests/codegen/book_list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 11:25:30 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 17:36:47 2020 # School of Math and Computer Science, University of Havana # @@ -427,7 +427,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -639,9 +639,17 @@ entry: sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) - # local__internal_1 = CALL function_main_at_Main + # local__internal_1 = CALL main # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 12($t1) + # Call function. Result is on $v0 + jalr $t2 sw $v0, -8($fp) # RETURN 0 li $v0, 0 @@ -1186,24 +1194,27 @@ function_print_at_Article: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 60 - # LOCAL local_print_at_Article_internal_0 --> -4($fp) - # local_print_at_Article_internal_0 = - lw $t1, Book - sw $t1, -4($fp) + # LOCAL local_print_at_Article_internal_1 --> -8($fp) + # local_print_at_Article_internal_1 = SELF + sw $s1, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Article_internal_0 = CALL print # LOCAL local_print_at_Article_internal_0 --> -4($fp) # LOCAL local_print_at_Article_internal_1 --> -8($fp) - # local_print_at_Article_internal_1 = VCALL local_print_at_Article_internal_0 print # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) + lw $s1, -8($fp) # Get pointer to type's VTABLE - lw $t2, 0($t1) + la $t1, Book_vtable # Get pointer to function address - lw $t3, 32($t2) + lw $t2, 32($t1) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) + jalr $t2 + sw $v0, -4($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 # LOCAL local_print_at_Article_internal_8 --> -36($fp) # local_print_at_Article_internal_8 = SELF sw $s1, -36($fp) @@ -1946,10 +1957,10 @@ function_cdr_at_Cons: # @Params: function_print_list_at_Cons: # Allocate stack frame for function function_print_list_at_Cons. - subu $sp, $sp, 92 + subu $sp, $sp, 88 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 92 + addu $fp, $sp, 88 # local_print_list_at_Cons_internal_2 = GETATTRIBUTE xcar Cons # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) lw $t5, 12($s1) @@ -1990,36 +2001,44 @@ function_print_list_at_Cons: # local_print_list_at_Cons_internal_5 = 14 li $t5, 14 sw $t5, -24($fp) - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Book + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # Load TDT pointer to type Book + la $t5, Book__TDT + lw $t6, -16($fp) + addu $t5, $t5, $t6 + # Save distance + lw $t6, 0($t5) + sw $t6, -28($fp) # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_7 = local_print_list_at_Cons_internal_5 - local_print_list_at_Cons_internal_6 - lw $t5, -24($fp) - lw $t6, -28($fp) - sub $t5, $t5, $t6 - sw $t5, -32($fp) - # IF_GREATER_ZERO local_print_list_at_Cons_internal_7 GOTO label_Not_min0_1 - # IF_GREATER_ZERO local_print_list_at_Cons_internal_7 GOTO label_Not_min0_1 - lw $t5, -32($fp) - bgt $t5, 0, label_Not_min0_1 + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # Update min if 13 < 14 + lw $t5, -28($fp) + lw $t6, -24($fp) + bgtu $t5, $t6, label_Not_min0_1 # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_6 lw $t5, -28($fp) sw $t5, -24($fp) label_Not_min0_1: - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Article # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_7 = local_print_list_at_Cons_internal_5 - local_print_list_at_Cons_internal_6 - lw $t5, -24($fp) - lw $t6, -28($fp) - sub $t5, $t5, $t6 - sw $t5, -32($fp) - # IF_GREATER_ZERO local_print_list_at_Cons_internal_7 GOTO label_Not_min1_2 - # IF_GREATER_ZERO local_print_list_at_Cons_internal_7 GOTO label_Not_min1_2 - lw $t5, -32($fp) - bgt $t5, 0, label_Not_min1_2 + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # Load TDT pointer to type Article + la $t5, Article__TDT + lw $t6, -16($fp) + addu $t5, $t5, $t6 + # Save distance + lw $t6, 0($t5) + sw $t6, -28($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # Update min if 13 < 14 + lw $t5, -28($fp) + lw $t6, -24($fp) + bgtu $t5, $t6, label_Not_min1_2 # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_6 @@ -2042,35 +2061,39 @@ function_print_list_at_Cons: # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 lw $t5, -20($fp) beq $t5, 0, label_ERROR_3 - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Book # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_7 = local_print_list_at_Cons_internal_5 - local_print_list_at_Cons_internal_6 - lw $t5, -24($fp) - lw $t6, -28($fp) - sub $t5, $t5, $t6 - sw $t5, -32($fp) - # - # - lw $t5, -32($fp) - bne $t5, 0, label_NEXT0_5 - # LOCAL local_print_list_at_Cons_dummy_8 --> -36($fp) + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # Load TDT pointer to type Book + la $t5, Book__TDT + lw $t6, -16($fp) + addu $t5, $t5, $t6 + # Save distance + lw $t6, 0($t5) + sw $t6, -28($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # Update min if 13 < 14 + lw $t5, -28($fp) + lw $t6, -24($fp) + bgtu $t5, $t6, label_NEXT0_5 + # LOCAL local_print_list_at_Cons_dummy_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # local_print_list_at_Cons_dummy_8 = local_print_list_at_Cons_internal_1 + # local_print_list_at_Cons_dummy_7 = local_print_list_at_Cons_internal_1 lw $t5, -8($fp) + sw $t5, -32($fp) + # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) + # local_print_list_at_Cons_internal_10 = SELF + sw $s1, -44($fp) + # LOCAL local_print_list_at_Cons_internal_8 --> -36($fp) + # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) + # local_print_list_at_Cons_internal_8 = local_print_list_at_Cons_internal_10 + lw $t5, -44($fp) sw $t5, -36($fp) - # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) - # local_print_list_at_Cons_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) - # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) - # local_print_list_at_Cons_internal_9 = local_print_list_at_Cons_internal_11 - lw $t5, -48($fp) - sw $t5, -40($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_list_at_Cons_internal_12 --> -52($fp) + # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -2087,18 +2110,18 @@ function_print_list_at_Cons: sw $t5, 12($v0) li $t5, 27 sw $t5, 16($v0) - sw $v0, -52($fp) - # ARG local_print_list_at_Cons_internal_12 - # LOCAL local_print_list_at_Cons_internal_12 --> -52($fp) - lw $t5, -52($fp) + sw $v0, -48($fp) + # ARG local_print_list_at_Cons_internal_11 + # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) + lw $t5, -48($fp) # Push arg into stack subu $sp, $sp, 4 sw $t5, 0($sp) + # LOCAL local_print_list_at_Cons_internal_8 --> -36($fp) # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) - # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) - # local_print_list_at_Cons_internal_10 = VCALL local_print_list_at_Cons_internal_9 out_string + # local_print_list_at_Cons_internal_9 = VCALL local_print_list_at_Cons_internal_8 out_string # Save new self pointer in $s1 - lw $s1, -40($fp) + lw $s1, -36($fp) # Get pointer to type lw $t5, 4($s1) # Get pointer to type's VTABLE @@ -2107,42 +2130,46 @@ function_print_list_at_Cons: lw $t7, 12($t6) # Call function. Result is on $v0 jalr $t7 - sw $v0, -44($fp) + sw $v0, -40($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # GOTO label_END_4 j label_END_4 label_NEXT0_5: - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Article # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_7 = local_print_list_at_Cons_internal_5 - local_print_list_at_Cons_internal_6 - lw $t5, -24($fp) - lw $t6, -28($fp) - sub $t5, $t5, $t6 - sw $t5, -32($fp) - # - # - lw $t5, -32($fp) - bne $t5, 0, label_NEXT1_6 - # LOCAL local_print_list_at_Cons_dummy_13 --> -56($fp) + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # Load TDT pointer to type Article + la $t5, Article__TDT + lw $t6, -16($fp) + addu $t5, $t5, $t6 + # Save distance + lw $t6, 0($t5) + sw $t6, -28($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # Update min if 13 < 14 + lw $t5, -28($fp) + lw $t6, -24($fp) + bgtu $t5, $t6, label_NEXT1_6 + # LOCAL local_print_list_at_Cons_dummy_12 --> -52($fp) # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # local_print_list_at_Cons_dummy_13 = local_print_list_at_Cons_internal_1 + # local_print_list_at_Cons_dummy_12 = local_print_list_at_Cons_internal_1 lw $t5, -8($fp) + sw $t5, -52($fp) + # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) + # local_print_list_at_Cons_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_print_list_at_Cons_internal_13 --> -56($fp) + # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) + # local_print_list_at_Cons_internal_13 = local_print_list_at_Cons_internal_15 + lw $t5, -64($fp) sw $t5, -56($fp) - # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) - # local_print_list_at_Cons_internal_16 = SELF - sw $s1, -68($fp) - # LOCAL local_print_list_at_Cons_internal_14 --> -60($fp) - # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) - # local_print_list_at_Cons_internal_14 = local_print_list_at_Cons_internal_16 - lw $t5, -68($fp) - sw $t5, -60($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) + # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -2159,18 +2186,18 @@ label_NEXT0_5: sw $t5, 12($v0) li $t5, 30 sw $t5, 16($v0) - sw $v0, -72($fp) - # ARG local_print_list_at_Cons_internal_17 - # LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) - lw $t5, -72($fp) + sw $v0, -68($fp) + # ARG local_print_list_at_Cons_internal_16 + # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) + lw $t5, -68($fp) # Push arg into stack subu $sp, $sp, 4 sw $t5, 0($sp) + # LOCAL local_print_list_at_Cons_internal_13 --> -56($fp) # LOCAL local_print_list_at_Cons_internal_14 --> -60($fp) - # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) - # local_print_list_at_Cons_internal_15 = VCALL local_print_list_at_Cons_internal_14 out_string + # local_print_list_at_Cons_internal_14 = VCALL local_print_list_at_Cons_internal_13 out_string # Save new self pointer in $s1 - lw $s1, -60($fp) + lw $s1, -56($fp) # Get pointer to type lw $t5, 4($s1) # Get pointer to type's VTABLE @@ -2179,7 +2206,7 @@ label_NEXT0_5: lw $t7, 12($t6) # Call function. Result is on $v0 jalr $t7 - sw $v0, -64($fp) + sw $v0, -60($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 @@ -2187,24 +2214,26 @@ label_NEXT0_5: j label_END_4 label_NEXT1_6: label_ERROR_3: + li $a0, 10 + syscall label_END_4: -# local_print_list_at_Cons_internal_20 = GETATTRIBUTE xcdr Cons -# LOCAL local_print_list_at_Cons_internal_20 --> -84($fp) +# local_print_list_at_Cons_internal_19 = GETATTRIBUTE xcdr Cons +# LOCAL local_print_list_at_Cons_internal_19 --> -80($fp) lw $t5, 16($s1) -sw $t5, -84($fp) -# LOCAL local_print_list_at_Cons_internal_18 --> -76($fp) -# LOCAL local_print_list_at_Cons_internal_20 --> -84($fp) -# local_print_list_at_Cons_internal_18 = local_print_list_at_Cons_internal_20 -lw $t5, -84($fp) -sw $t5, -76($fp) +sw $t5, -80($fp) +# LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) +# LOCAL local_print_list_at_Cons_internal_19 --> -80($fp) +# local_print_list_at_Cons_internal_17 = local_print_list_at_Cons_internal_19 +lw $t5, -80($fp) +sw $t5, -72($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) +# LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) # LOCAL local_print_list_at_Cons_internal_18 --> -76($fp) -# LOCAL local_print_list_at_Cons_internal_19 --> -80($fp) -# local_print_list_at_Cons_internal_19 = VCALL local_print_list_at_Cons_internal_18 print_list +# local_print_list_at_Cons_internal_18 = VCALL local_print_list_at_Cons_internal_17 print_list # Save new self pointer in $s1 -lw $s1, -76($fp) +lw $s1, -72($fp) # Get pointer to type lw $t5, 4($s1) # Get pointer to type's VTABLE @@ -2213,19 +2242,19 @@ lw $t6, 0($t5) lw $t7, 44($t6) # Call function. Result is on $v0 jalr $t7 -sw $v0, -80($fp) +sw $v0, -76($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# RETURN local_print_list_at_Cons_internal_19 -lw $v0, -80($fp) +# RETURN local_print_list_at_Cons_internal_18 +lw $v0, -76($fp) # Deallocate stack frame for function function_print_list_at_Cons. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 92 +addu $sp, $sp, 88 jr $ra # Function END diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips index 176b4480..030af833 100644 --- a/tests/codegen/fib.mips +++ b/tests/codegen/fib.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 11:25:29 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 17:36:46 2020 # School of Math and Computer Science, University of Havana # @@ -298,7 +298,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -502,9 +502,17 @@ entry: sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) - # local__internal_1 = CALL function_main_at_Main + # local__internal_1 = CALL main # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 28($t1) + # Call function. Result is on $v0 + jalr $t2 sw $v0, -8($fp) # RETURN 0 li $v0, 0 diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips index 3a6d8799..42d351fa 100644 --- a/tests/codegen/hello_world.mips +++ b/tests/codegen/hello_world.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 11:25:28 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 17:36:45 2020 # School of Math and Computer Science, University of Havana # @@ -294,7 +294,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -498,9 +498,17 @@ entry: sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) - # local__internal_1 = CALL function_main_at_Main + # local__internal_1 = CALL main # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 28($t1) + # Call function. Result is on $v0 + jalr $t2 sw $v0, -8($fp) # RETURN 0 li $v0, 0 diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips index 50711c7d..e5b42212 100644 --- a/tests/codegen/io.mips +++ b/tests/codegen/io.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 11:25:29 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 17:36:47 2020 # School of Math and Computer Science, University of Havana # @@ -378,7 +378,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -582,9 +582,17 @@ entry: sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) - # local__internal_1 = CALL function_main_at_Main + # local__internal_1 = CALL main # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 28($t1) + # Call function. Result is on $v0 + jalr $t2 sw $v0, -8($fp) # RETURN 0 li $v0, 0 diff --git a/tests/codegen/list.mips b/tests/codegen/list.mips index f2e4beeb..3cb83bed 100644 --- a/tests/codegen/list.mips +++ b/tests/codegen/list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 11:25:30 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 17:36:47 2020 # School of Math and Computer Science, University of Havana # @@ -332,7 +332,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -544,9 +544,17 @@ entry: sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) - # local__internal_1 = CALL function_main_at_Main + # local__internal_1 = CALL main # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 32($t1) + # Call function. Result is on $v0 + jalr $t2 sw $v0, -8($fp) # RETURN 0 li $v0, 0 diff --git a/tests/codegen/print-cool.mips b/tests/codegen/print-cool.mips index 8eead8ef..e2059448 100644 --- a/tests/codegen/print-cool.mips +++ b/tests/codegen/print-cool.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 11:25:28 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 17:36:45 2020 # School of Math and Computer Science, University of Havana # @@ -294,7 +294,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -498,9 +498,17 @@ entry: sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) - # local__internal_1 = CALL function_main_at_Main + # local__internal_1 = CALL main # LOCAL local__internal_1 --> -8($fp) - jal function_main_at_Main + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 28($t1) + # Call function. Result is on $v0 + jalr $t2 sw $v0, -8($fp) # RETURN 0 li $v0, 0 From 18c2552a9280f777fd8b5a1cb6708965ce21ffc4 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sat, 5 Dec 2020 23:02:10 -0500 Subject: [PATCH 147/162] Fix if-then-else expr not returning a value --- src/cil/nodes.py | 8 +- src/mips/instruction.py | 2 +- src/testing.mips | 3324 +++++-------- src/testing.py | 175 +- src/travels/ciltomips.py | 106 +- src/travels/ctcill.py | 27 +- tests/codegen/atoi.mips | 2074 ++++---- tests/codegen/book_list.mips | 69 +- tests/codegen/complex.mips | 1584 ++++++ tests/codegen/fib.mips | 61 +- tests/codegen/hello_world.mips | 61 +- tests/codegen/io.mips | 61 +- tests/codegen/life.mips | 8537 ++++++++++++++++++++++++++++++++ tests/codegen/list.mips | 266 +- tests/codegen/new_complex.mips | 2008 ++++++++ tests/codegen/palindrome.mips | 1257 +++++ tests/codegen/print-cool.mips | 61 +- 17 files changed, 16449 insertions(+), 3232 deletions(-) create mode 100644 tests/codegen/complex.mips create mode 100644 tests/codegen/life.mips create mode 100644 tests/codegen/new_complex.mips create mode 100644 tests/codegen/palindrome.mips diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 543e3336..7e3eeba7 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -299,4 +299,10 @@ class JumpIfGreater(InstructionNode): def __init__(self, src1: LocalNode, src2: LocalNode, label: str) -> None: self.left = src1 self.rigt = src2 - self.label = label \ No newline at end of file + self.label = label + + +class BitwiseNotNode(InstructionNode): + def __init__(self, src, dest) -> None: + self.dest = dest + self.src = src \ No newline at end of file diff --git a/src/mips/instruction.py b/src/mips/instruction.py index cce58d40..11feb257 100644 --- a/src/mips/instruction.py +++ b/src/mips/instruction.py @@ -56,7 +56,7 @@ # Direccion de retorno ra = 31 -TEMP_REGISTERS = (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, s2, s3, s4, s5, s6, s7) +TEMP_REGISTERS = (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, s2, s3, s4, s5, s6, s7, v1) ARGS_REGISTERS = (a0, a1, a2, a3) REG_TO_STR = { diff --git a/src/testing.mips b/src/testing.mips index 01dfefa7..f1760b70 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 17:36:28 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:11 2020 # School of Math and Computer Science, University of Havana # @@ -13,18 +13,10 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END -Book: .asciiz "Book" -# Function END -Article: .asciiz "Article" -# Function END -BookList: .asciiz "BookList" -# Function END -Cons: .asciiz "Cons" -# Function END -Nil: .asciiz "Nil" -# Function END Main: .asciiz "Main" # Function END +Complex: .asciiz "Complex" +# Function END # @@ -84,78 +76,8 @@ Bool_end: # -# **** VTABLE for type Book **** -Book_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_initBook_at_Book, function_print_at_Book -# Function END -# - - -# **** Type RECORD for type Book **** -Book_start: - Book_vtable_pointer: .word Book_vtable - # Function END -Book_end: -# - - -# **** VTABLE for type Article **** -Article_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_initBook_at_Book, function_print_at_Article, function_initArticle_at_Article -# Function END -# - - -# **** Type RECORD for type Article **** -Article_start: - Article_vtable_pointer: .word Article_vtable - # Function END -Article_end: -# - - -# **** VTABLE for type BookList **** -BookList_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_BookList, function_cons_at_BookList, function_car_at_BookList, function_cdr_at_BookList, function_print_list_at_BookList -# Function END -# - - -# **** Type RECORD for type BookList **** -BookList_start: - BookList_vtable_pointer: .word BookList_vtable - # Function END -BookList_end: -# - - -# **** VTABLE for type Cons **** -Cons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_Cons, function_cons_at_BookList, function_car_at_Cons, function_cdr_at_Cons, function_print_list_at_Cons, function_init_at_Cons -# Function END -# - - -# **** Type RECORD for type Cons **** -Cons_start: - Cons_vtable_pointer: .word Cons_vtable - # Function END -Cons_end: -# - - -# **** VTABLE for type Nil **** -Nil_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_Nil, function_cons_at_BookList, function_car_at_BookList, function_cdr_at_BookList, function_print_list_at_Nil -# Function END -# - - -# **** Type RECORD for type Nil **** -Nil_start: - Nil_vtable_pointer: .word Nil_vtable - # Function END -Nil_end: -# - - # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main # Function END # @@ -168,72 +90,54 @@ Main_end: # -data_0: .asciiz "" -# - - -IO__TDT: .word 0, -1, -1, -1, 1, 2, 1, 2, 2, -1 -Object__TDT: .word 1, 0, 1, 1, 2, 3, 2, 3, 3, 1 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 -Book__TDT: .word -1, -1, -1, -1, 0, 1, -1, -1, -1, -1 -Article__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1, -1 -BookList__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 1, -1 -Cons__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 -Nil__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 -# - - -data_2: .asciiz "title: " -# - - -data_3: .asciiz "\n" -# - - -data_4: .asciiz "author: " -# - - -data_5: .asciiz "\n" +# **** VTABLE for type Complex **** +Complex_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Complex, function_print_at_Complex, function_reflect_0_at_Complex, function_reflect_X_at_Complex, function_reflect_Y_at_Complex, function_equal_at_Complex, function_x_value_at_Complex, function_y_value_at_Complex +# Function END # -data_6: .asciiz "periodical: " +# **** Type RECORD for type Complex **** +Complex_start: + Complex_vtable_pointer: .word Complex_vtable + # Function END +Complex_end: # -data_7: .asciiz "\n" +data_0: .asciiz "" # -data_8: .asciiz "- dynamic type was Book -\n" +IO__TDT: .word 0, -1, -1, -1, 1, 1 +Object__TDT: .word 1, 0, 1, 1, 2, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1 +Main__TDT: .word -1, -1, -1, -1, 0, -1 +Complex__TDT: .word -1, -1, -1, -1, -1, 0 # -data_9: .asciiz "- dynamic type was Article -\n" +data_2: .asciiz "=)\n" # -data_10: .asciiz "Compilers, Principles, Techniques, and Tools" +data_3: .asciiz "=(\n" # -data_11: .asciiz "Aho, Sethi, and Ullman" +data_4: .asciiz "=)\n" # -data_12: .asciiz "The Top 100 CD_ROMs" +data_5: .asciiz "=(\n" # -data_13: .asciiz "Ulanoff" +data_6: .asciiz "+" # -data_14: .asciiz "PC Magazine" +data_7: .asciiz "I" # @@ -253,17 +157,52 @@ function_in_string_at_IO: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END # function_out_int_at_IO implementation. @@ -427,7 +366,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -617,25 +556,17 @@ entry: li $t2, 4 sw $t2, 16($v0) move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall sw $t2, 0($v0) la $t2, Main_start sw $t2, 4($v0) # Load type offset - li $t2, 36 + li $t2, 16 sw $t2, 8($v0) move $t1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__books__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) @@ -647,7 +578,7 @@ entry: # Get pointer to type's VTABLE la $t1, Main_vtable # Get pointer to function address - lw $t2, 12($t1) + lw $t2, 28($t1) # Call function. Result is on $v0 jalr $t2 sw $v0, -8($fp) @@ -664,445 +595,596 @@ entry: # Function END -# __Book__attrib__title__init implementation. +# function_main_at_Main implementation. # @Params: -__Book__attrib__title__init: - # Allocate stack frame for function __Book__attrib__title__init. - subu $sp, $sp, 32 +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 148 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__title__init_internal_0 --> -4($fp) + addu $fp, $sp, 148 + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_c_0 = ALLOCATE Complex # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_0 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__title__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Book__attrib__title__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Book__attrib__author__init implementation. -# @Params: -__Book__attrib__author__init: - # Allocate stack frame for function __Book__attrib__author__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__author__init_internal_0 --> -4($fp) + li $t3, 8 + sw $t3, 8($v0) + la $t3, Complex + sw $t3, 12($v0) + li $t3, 7 + sw $t3, 16($v0) + move $t3, $v0 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + sw $t3, 0($v0) + la $t3, Complex_start + sw $t3, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_0 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__author__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Book__attrib__author__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_initBook_at_Book implementation. -# @Params: -# 0($fp) = param_initBook_at_Book_title_p_0 -# 4($fp) = param_initBook_at_Book_author_p_1 -function_initBook_at_Book: - # Allocate stack frame for function function_initBook_at_Book. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_initBook_at_Book_title_p_0 --> 4($fp) - lw $t1, 4($fp) - sw $t1, 12($s1) - # - # PARAM param_initBook_at_Book_author_p_1 --> 0($fp) - lw $t1, 0($fp) - sw $t1, 16($s1) - # LOCAL local_initBook_at_Book_internal_0 --> -4($fp) - # local_initBook_at_Book_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_initBook_at_Book_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_initBook_at_Book. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_print_at_Book implementation. -# @Params: -function_print_at_Book: - # Allocate stack frame for function function_print_at_Book. - subu $sp, $sp, 92 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 92 - # LOCAL local_print_at_Book_internal_6 --> -28($fp) - # local_print_at_Book_internal_6 = SELF - sw $s1, -28($fp) - # LOCAL local_print_at_Book_internal_4 --> -20($fp) - # LOCAL local_print_at_Book_internal_6 --> -28($fp) - # local_print_at_Book_internal_4 = local_print_at_Book_internal_6 - lw $t1, -28($fp) - sw $t1, -20($fp) - # Push register s1 into stack + li $t3, 20 + sw $t3, 8($v0) + move $t2, $v0 + # Push register t2 into stack subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Book_internal_7 --> -32($fp) + sw $t2, 0($sp) + jal __Complex__attrib__x__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Complex__attrib__y__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t2) + sw $t2, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE Complex # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_2 - sw $t1, 12($v0) - li $t1, 12 - sw $t1, 16($v0) - sw $v0, -32($fp) - # ARG local_print_at_Book_internal_7 - # LOCAL local_print_at_Book_internal_7 --> -32($fp) - lw $t1, -32($fp) + li $t4, 8 + sw $t4, 8($v0) + la $t4, Complex + sw $t4, 12($v0) + li $t4, 7 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Complex_start + sw $t4, 4($v0) + # Load type offset + li $t4, 20 + sw $t4, 8($v0) + move $t3, $v0 + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Complex__attrib__x__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t3) + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Complex__attrib__y__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t3) + sw $t3, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t3, -16($fp) + sw $t3, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 1 + li $t3, 1 # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_4 --> -20($fp) - # LOCAL local_print_at_Book_internal_5 --> -24($fp) - # local_print_at_Book_internal_5 = VCALL local_print_at_Book_internal_4 out_string + sw $t3, 0($sp) + # ARG 1 + li $t3, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init # Save new self pointer in $s1 - lw $s1, -20($fp) + lw $s1, -8($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 12($t2) + lw $t5, 28($t4) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -24($fp) + jalr $t5 + sw $v0, -12($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_2 --> -12($fp) - # LOCAL local_print_at_Book_internal_5 --> -24($fp) - # local_print_at_Book_internal_2 = local_print_at_Book_internal_5 - lw $t1, -24($fp) - sw $t1, -12($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_c_0 = local_main_at_Main_internal_2 + lw $t3, -12($fp) + sw $t3, -4($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_c_0 + lw $t3, -4($fp) + sw $t3, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_print_at_Book_internal_8 = GETATTRIBUTE title Book - # LOCAL local_print_at_Book_internal_8 --> -36($fp) - lw $t1, 12($s1) - sw $t1, -36($fp) - # ARG local_print_at_Book_internal_8 - # LOCAL local_print_at_Book_internal_8 --> -36($fp) - lw $t1, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_2 --> -12($fp) - # LOCAL local_print_at_Book_internal_3 --> -16($fp) - # local_print_at_Book_internal_3 = VCALL local_print_at_Book_internal_2 out_string + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 reflect_X # Save new self pointer in $s1 - lw $s1, -12($fp) + lw $s1, -28($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 12($t2) + lw $t5, 40($t4) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) + jalr $t5 + sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_0 --> -4($fp) - # LOCAL local_print_at_Book_internal_3 --> -16($fp) - # local_print_at_Book_internal_0 = local_print_at_Book_internal_3 - lw $t1, -16($fp) - sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_internal_8 = local_main_at_Main_c_0 + lw $t3, -4($fp) + sw $t3, -36($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_at_Book_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_3 - sw $t1, 12($v0) - li $t1, 2 - sw $t1, 16($v0) - sw $v0, -40($fp) - # ARG local_print_at_Book_internal_9 - # LOCAL local_print_at_Book_internal_9 --> -40($fp) - lw $t1, -40($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_0 --> -4($fp) - # LOCAL local_print_at_Book_internal_1 --> -8($fp) - # local_print_at_Book_internal_1 = VCALL local_print_at_Book_internal_0 out_string + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 reflect_0 # Save new self pointer in $s1 - lw $s1, -4($fp) + lw $s1, -36($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 12($t2) + lw $t5, 36($t4) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) + jalr $t5 + sw $v0, -40($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_16 --> -68($fp) - # local_print_at_Book_internal_16 = SELF + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_5 = local_main_at_Main_internal_7 - local_main_at_Main_internal_9 + lw $t3, -32($fp) + lw $t4, -40($fp) + sub $t3, $t3, $t4 + sw $t3, -24($fp) + # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_3 + # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_3 + lw $t3, -24($fp) + beq $t3, 0, label_TRUE_3 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = 0 + li $t3, 0 + sw $t3, -24($fp) + # GOTO label_END_4 +j label_END_4 +label_TRUE_3: + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = 1 + li $t3, 1 + sw $t3, -24($fp) + label_END_4: +# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_1 +# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_1 +lw $t3, -24($fp) +beq $t3, 0, label_FALSEIF_1 +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# local_main_at_Main_internal_12 = SELF +sw $s1, -52($fp) +# LOCAL local_main_at_Main_internal_10 --> -44($fp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# local_main_at_Main_internal_10 = local_main_at_Main_internal_12 +lw $t3, -52($fp) +sw $t3, -44($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t3, String +sw $t3, 0($v0) +la $t3, String_start +sw $t3, 4($v0) +# Load type offset +li $t3, 8 +sw $t3, 8($v0) +la $t3, data_2 +sw $t3, 12($v0) +li $t3, 4 +sw $t3, 16($v0) +sw $v0, -56($fp) +# ARG local_main_at_Main_internal_13 +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +lw $t3, -56($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_10 --> -44($fp) +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +# local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 out_string +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 12($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_4 --> -20($fp) +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +# local_main_at_Main_internal_4 = local_main_at_Main_internal_11 +lw $t3, -48($fp) +sw $t3, -20($fp) +# GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = SELF sw $s1, -68($fp) - # LOCAL local_print_at_Book_internal_14 --> -60($fp) - # LOCAL local_print_at_Book_internal_16 --> -68($fp) - # local_print_at_Book_internal_14 = local_print_at_Book_internal_16 - lw $t1, -68($fp) - sw $t1, -60($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_14 = local_main_at_Main_internal_16 + lw $t3, -68($fp) + sw $t3, -60($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_at_Book_internal_17 --> -72($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_4 - sw $t1, 12($v0) - li $t1, 12 - sw $t1, 16($v0) + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_3 + sw $t3, 12($v0) + li $t3, 4 + sw $t3, 16($v0) sw $v0, -72($fp) - # ARG local_print_at_Book_internal_17 - # LOCAL local_print_at_Book_internal_17 --> -72($fp) - lw $t1, -72($fp) + # ARG local_main_at_Main_internal_17 + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + lw $t3, -72($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_14 --> -60($fp) - # LOCAL local_print_at_Book_internal_15 --> -64($fp) - # local_print_at_Book_internal_15 = VCALL local_print_at_Book_internal_14 out_string + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 out_string # Save new self pointer in $s1 lw $s1, -60($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 12($t2) + lw $t5, 12($t4) # Call function. Result is on $v0 - jalr $t3 + jalr $t5 sw $v0, -64($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_12 --> -52($fp) - # LOCAL local_print_at_Book_internal_15 --> -64($fp) - # local_print_at_Book_internal_12 = local_print_at_Book_internal_15 - lw $t1, -64($fp) - sw $t1, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Book_internal_18 = GETATTRIBUTE author Book - # LOCAL local_print_at_Book_internal_18 --> -76($fp) - lw $t1, 16($s1) - sw $t1, -76($fp) - # ARG local_print_at_Book_internal_18 - # LOCAL local_print_at_Book_internal_18 --> -76($fp) - lw $t1, -76($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_12 --> -52($fp) - # LOCAL local_print_at_Book_internal_13 --> -56($fp) - # local_print_at_Book_internal_13 = VCALL local_print_at_Book_internal_12 out_string - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_10 --> -44($fp) - # LOCAL local_print_at_Book_internal_13 --> -56($fp) - # local_print_at_Book_internal_10 = local_print_at_Book_internal_13 - lw $t1, -56($fp) - sw $t1, -44($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_15 + lw $t3, -64($fp) + sw $t3, -20($fp) + label_ENDIF_2: +# LOCAL local_main_at_Main_internal_23 --> -96($fp) +# LOCAL local_main_at_Main_c_0 --> -4($fp) +# local_main_at_Main_internal_23 = local_main_at_Main_c_0 +lw $t3, -4($fp) +sw $t3, -96($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_23 --> -96($fp) +# LOCAL local_main_at_Main_internal_24 --> -100($fp) +# local_main_at_Main_internal_24 = VCALL local_main_at_Main_internal_23 reflect_X +# Save new self pointer in $s1 +lw $s1, -96($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 40($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -100($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_21 --> -88($fp) +# LOCAL local_main_at_Main_internal_24 --> -100($fp) +# local_main_at_Main_internal_21 = local_main_at_Main_internal_24 +lw $t3, -100($fp) +sw $t3, -88($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_21 --> -88($fp) +# LOCAL local_main_at_Main_internal_22 --> -92($fp) +# local_main_at_Main_internal_22 = VCALL local_main_at_Main_internal_21 reflect_Y +# Save new self pointer in $s1 +lw $s1, -88($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 44($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -92($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# LOCAL local_main_at_Main_internal_22 --> -92($fp) +# local_main_at_Main_internal_19 = local_main_at_Main_internal_22 +lw $t3, -92($fp) +sw $t3, -80($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_25 --> -104($fp) +# LOCAL local_main_at_Main_c_0 --> -4($fp) +# local_main_at_Main_internal_25 = local_main_at_Main_c_0 +lw $t3, -4($fp) +sw $t3, -104($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_25 --> -104($fp) +# LOCAL local_main_at_Main_internal_26 --> -108($fp) +# local_main_at_Main_internal_26 = VCALL local_main_at_Main_internal_25 reflect_0 +# Save new self pointer in $s1 +lw $s1, -104($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 36($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -108($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_26 +# LOCAL local_main_at_Main_internal_26 --> -108($fp) +lw $t3, -108($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# LOCAL local_main_at_Main_internal_20 --> -84($fp) +# local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 equal +# Save new self pointer in $s1 +lw $s1, -80($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 48($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -84($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# IF_ZERO local_main_at_Main_internal_20 GOTO label_FALSEIF_5 +# IF_ZERO local_main_at_Main_internal_20 GOTO label_FALSEIF_5 +lw $t3, -84($fp) +beq $t3, 0, label_FALSEIF_5 +# LOCAL local_main_at_Main_internal_29 --> -120($fp) +# local_main_at_Main_internal_29 = SELF +sw $s1, -120($fp) +# LOCAL local_main_at_Main_internal_27 --> -112($fp) +# LOCAL local_main_at_Main_internal_29 --> -120($fp) +# local_main_at_Main_internal_27 = local_main_at_Main_internal_29 +lw $t3, -120($fp) +sw $t3, -112($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_30 --> -124($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t3, String +sw $t3, 0($v0) +la $t3, String_start +sw $t3, 4($v0) +# Load type offset +li $t3, 8 +sw $t3, 8($v0) +la $t3, data_4 +sw $t3, 12($v0) +li $t3, 4 +sw $t3, 16($v0) +sw $v0, -124($fp) +# ARG local_main_at_Main_internal_30 +# LOCAL local_main_at_Main_internal_30 --> -124($fp) +lw $t3, -124($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_27 --> -112($fp) +# LOCAL local_main_at_Main_internal_28 --> -116($fp) +# local_main_at_Main_internal_28 = VCALL local_main_at_Main_internal_27 out_string +# Save new self pointer in $s1 +lw $s1, -112($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 12($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -116($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# LOCAL local_main_at_Main_internal_28 --> -116($fp) +# local_main_at_Main_internal_18 = local_main_at_Main_internal_28 +lw $t3, -116($fp) +sw $t3, -76($fp) +# GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # local_main_at_Main_internal_33 = SELF + sw $s1, -136($fp) + # LOCAL local_main_at_Main_internal_31 --> -128($fp) + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # local_main_at_Main_internal_31 = local_main_at_Main_internal_33 + lw $t3, -136($fp) + sw $t3, -128($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_at_Book_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_34 --> -140($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_5 - sw $t1, 12($v0) - li $t1, 2 - sw $t1, 16($v0) - sw $v0, -80($fp) - # ARG local_print_at_Book_internal_19 - # LOCAL local_print_at_Book_internal_19 --> -80($fp) - lw $t1, -80($fp) + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_5 + sw $t3, 12($v0) + li $t3, 4 + sw $t3, 16($v0) + sw $v0, -140($fp) + # ARG local_main_at_Main_internal_34 + # LOCAL local_main_at_Main_internal_34 --> -140($fp) + lw $t3, -140($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_10 --> -44($fp) - # LOCAL local_print_at_Book_internal_11 --> -48($fp) - # local_print_at_Book_internal_11 = VCALL local_print_at_Book_internal_10 out_string + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_31 --> -128($fp) + # LOCAL local_main_at_Main_internal_32 --> -132($fp) + # local_main_at_Main_internal_32 = VCALL local_main_at_Main_internal_31 out_string # Save new self pointer in $s1 - lw $s1, -44($fp) + lw $s1, -128($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 12($t2) + lw $t5, 12($t4) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -48($fp) + jalr $t5 + sw $v0, -132($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_20 --> -84($fp) - # local_print_at_Book_internal_20 = SELF - sw $s1, -84($fp) - # RETURN local_print_at_Book_internal_20 - lw $v0, -84($fp) - # Deallocate stack frame for function function_print_at_Book. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 92 - jr $ra - # Function END + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_32 --> -132($fp) + # local_main_at_Main_internal_18 = local_main_at_Main_internal_32 + lw $t3, -132($fp) + sw $t3, -76($fp) + label_ENDIF_6: +# RETURN local_main_at_Main_internal_18 +lw $v0, -76($fp) +# Deallocate stack frame for function function_main_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 148 +jr $ra +# Function END -# __Article__attrib__per_title__init implementation. +# __Complex__attrib__x__init implementation. # @Params: -__Article__attrib__per_title__init: - # Allocate stack frame for function __Article__attrib__per_title__init. +__Complex__attrib__x__init: + # Allocate stack frame for function __Complex__attrib__x__init. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local___attrib__per_title__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_0 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -4($fp) - # RETURN local___attrib__per_title__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Article__attrib__per_title__init. + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Complex__attrib__x__init. # Restore $ra lw $ra, 4($sp) # Restore $fp @@ -1113,836 +1195,808 @@ __Article__attrib__per_title__init: # Function END -# function_initArticle_at_Article implementation. +# __Complex__attrib__y__init implementation. # @Params: -# 0($fp) = param_initArticle_at_Article_title_p_0 -# 4($fp) = param_initArticle_at_Article_author_p_1 -# 8($fp) = param_initArticle_at_Article_per_title_p_2 -function_initArticle_at_Article: - # Allocate stack frame for function function_initArticle_at_Article. +__Complex__attrib__y__init: + # Allocate stack frame for function __Complex__attrib__y__init. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) - # local_initArticle_at_Article_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) - # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) - # local_initArticle_at_Article_internal_0 = local_initArticle_at_Article_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_initArticle_at_Article_title_p_0 - # PARAM param_initArticle_at_Article_title_p_0 --> 8($fp) - lw $t1, 8($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # ARG param_initArticle_at_Article_author_p_1 - # PARAM param_initArticle_at_Article_author_p_1 --> 4($fp) - lw $t1, 4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) - # LOCAL local_initArticle_at_Article_internal_1 --> -8($fp) - # local_initArticle_at_Article_internal_1 = VCALL local_initArticle_at_Article_internal_0 initBook - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 28($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # PARAM param_initArticle_at_Article_per_title_p_2 --> 0($fp) - lw $t1, 0($fp) - sw $t1, 20($s1) - # LOCAL local_initArticle_at_Article_internal_3 --> -16($fp) - # local_initArticle_at_Article_internal_3 = SELF - sw $s1, -16($fp) - # RETURN local_initArticle_at_Article_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_initArticle_at_Article. + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Complex__attrib__y__init. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 12 jr $ra # Function END -# function_print_at_Article implementation. +# function_init_at_Complex implementation. +# @Params: +# 0($fp) = param_init_at_Complex_a_0 +# 4($fp) = param_init_at_Complex_b_1 +function_init_at_Complex: + # Allocate stack frame for function function_init_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_init_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + lw $t3, 12($s1) + sw $t3, -8($fp) + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + # local_init_at_Complex_internal_0 = local_init_at_Complex_internal_1 - PARAM param_init_at_Complex_a_0 + lw $t3, -8($fp) + lw $t4, 4($fp) + sub $t3, $t3, $t4 + sw $t3, -4($fp) + # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_7 + # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_7 + lw $t3, -4($fp) + beq $t3, 0, label_TRUE_7 + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # local_init_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + # GOTO label_END_8 +j label_END_8 +label_TRUE_7: + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # local_init_at_Complex_internal_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + label_END_8: +# local_init_at_Complex_internal_3 = GETATTRIBUTE y Complex +# LOCAL local_init_at_Complex_internal_3 --> -16($fp) +lw $t3, 16($s1) +sw $t3, -16($fp) +# LOCAL local_init_at_Complex_internal_2 --> -12($fp) +# LOCAL local_init_at_Complex_internal_3 --> -16($fp) +# PARAM param_init_at_Complex_b_1 --> 0($fp) +# local_init_at_Complex_internal_2 = local_init_at_Complex_internal_3 - PARAM param_init_at_Complex_b_1 +lw $t3, -16($fp) +lw $t4, 0($fp) +sub $t3, $t3, $t4 +sw $t3, -12($fp) +# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_9 +# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_9 +lw $t3, -12($fp) +beq $t3, 0, label_TRUE_9 +# LOCAL local_init_at_Complex_internal_2 --> -12($fp) +# local_init_at_Complex_internal_2 = 0 +li $t3, 0 +sw $t3, -12($fp) +# GOTO label_END_10 +j label_END_10 +label_TRUE_9: + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # local_init_at_Complex_internal_2 = 1 + li $t3, 1 + sw $t3, -12($fp) + label_END_10: +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# local_init_at_Complex_internal_4 = SELF +sw $s1, -20($fp) +# RETURN local_init_at_Complex_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_init_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +# Deallocate function args +addu $sp, $sp, 8 +jr $ra +# Function END + + +# function_print_at_Complex implementation. # @Params: -function_print_at_Article: - # Allocate stack frame for function function_print_at_Article. - subu $sp, $sp, 60 +function_print_at_Complex: + # Allocate stack frame for function function_print_at_Complex. + subu $sp, $sp, 88 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 60 - # LOCAL local_print_at_Article_internal_1 --> -8($fp) - # local_print_at_Article_internal_1 = SELF - sw $s1, -8($fp) + addu $fp, $sp, 88 + # local_print_at_Complex_internal_2 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_2 --> -12($fp) + lw $t3, 16($s1) + sw $t3, -12($fp) + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # LOCAL local_print_at_Complex_internal_2 --> -12($fp) + # local_print_at_Complex_internal_1 = local_print_at_Complex_internal_2 - 0 + lw $t3, -12($fp) + sub $t3, $t3, 0 + sw $t3, -8($fp) + # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_13 + # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_13 + lw $t3, -8($fp) + beq $t3, 0, label_TRUE_13 + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # local_print_at_Complex_internal_1 = 0 + li $t3, 0 + sw $t3, -8($fp) + # GOTO label_END_14 +j label_END_14 +label_TRUE_13: + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # local_print_at_Complex_internal_1 = 1 + li $t3, 1 + sw $t3, -8($fp) + label_END_14: +# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_11 +# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_11 +lw $t3, -8($fp) +beq $t3, 0, label_FALSEIF_11 +# LOCAL local_print_at_Complex_internal_5 --> -24($fp) +# local_print_at_Complex_internal_5 = SELF +sw $s1, -24($fp) +# LOCAL local_print_at_Complex_internal_3 --> -16($fp) +# LOCAL local_print_at_Complex_internal_5 --> -24($fp) +# local_print_at_Complex_internal_3 = local_print_at_Complex_internal_5 +lw $t3, -24($fp) +sw $t3, -16($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_print_at_Complex_internal_6 = GETATTRIBUTE x Complex +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +lw $t3, 12($s1) +sw $t3, -28($fp) +# ARG local_print_at_Complex_internal_6 +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +lw $t3, -28($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_print_at_Complex_internal_3 --> -16($fp) +# LOCAL local_print_at_Complex_internal_4 --> -20($fp) +# local_print_at_Complex_internal_4 = VCALL local_print_at_Complex_internal_3 out_int +# Save new self pointer in $s1 +lw $s1, -16($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 16($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -20($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_print_at_Complex_internal_0 --> -4($fp) +# LOCAL local_print_at_Complex_internal_4 --> -20($fp) +# local_print_at_Complex_internal_0 = local_print_at_Complex_internal_4 +lw $t3, -20($fp) +sw $t3, -4($fp) +# GOTO label_ENDIF_12 +j label_ENDIF_12 +label_FALSEIF_11: + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_13 = local_print_at_Complex_internal_15 + lw $t3, -64($fp) + sw $t3, -56($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_print_at_Article_internal_0 = CALL print - # LOCAL local_print_at_Article_internal_0 --> -4($fp) - # LOCAL local_print_at_Article_internal_1 --> -8($fp) + # local_print_at_Complex_internal_16 = GETATTRIBUTE x Complex + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + lw $t3, 12($s1) + sw $t3, -68($fp) + # ARG local_print_at_Complex_internal_16 + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + lw $t3, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # LOCAL local_print_at_Complex_internal_14 --> -60($fp) + # local_print_at_Complex_internal_14 = VCALL local_print_at_Complex_internal_13 out_int # Save new self pointer in $s1 - lw $s1, -8($fp) + lw $s1, -56($fp) + # Get pointer to type + lw $t3, 4($s1) # Get pointer to type's VTABLE - la $t1, Book_vtable + lw $t4, 0($t3) # Get pointer to function address - lw $t2, 32($t1) + lw $t5, 16($t4) # Call function. Result is on $v0 - jalr $t2 - sw $v0, -4($fp) + jalr $t5 + sw $v0, -60($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Article_internal_8 --> -36($fp) - # local_print_at_Article_internal_8 = SELF - sw $s1, -36($fp) - # LOCAL local_print_at_Article_internal_6 --> -28($fp) - # LOCAL local_print_at_Article_internal_8 --> -36($fp) - # local_print_at_Article_internal_6 = local_print_at_Article_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # LOCAL local_print_at_Complex_internal_14 --> -60($fp) + # local_print_at_Complex_internal_11 = local_print_at_Complex_internal_14 + lw $t3, -60($fp) + sw $t3, -48($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_at_Article_internal_9 --> -40($fp) + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_6 - sw $t1, 12($v0) - li $t1, 13 - sw $t1, 16($v0) - sw $v0, -40($fp) - # ARG local_print_at_Article_internal_9 - # LOCAL local_print_at_Article_internal_9 --> -40($fp) - lw $t1, -40($fp) + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_6 + sw $t3, 12($v0) + li $t3, 1 + sw $t3, 16($v0) + sw $v0, -72($fp) + # ARG local_print_at_Complex_internal_17 + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + lw $t3, -72($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Article_internal_6 --> -28($fp) - # LOCAL local_print_at_Article_internal_7 --> -32($fp) - # local_print_at_Article_internal_7 = VCALL local_print_at_Article_internal_6 out_string + sw $t3, 0($sp) + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # LOCAL local_print_at_Complex_internal_12 --> -52($fp) + # local_print_at_Complex_internal_12 = VCALL local_print_at_Complex_internal_11 out_string # Save new self pointer in $s1 - lw $s1, -28($fp) + lw $s1, -48($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 12($t2) + lw $t5, 12($t4) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) + jalr $t5 + sw $v0, -52($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Article_internal_4 --> -20($fp) - # LOCAL local_print_at_Article_internal_7 --> -32($fp) - # local_print_at_Article_internal_4 = local_print_at_Article_internal_7 - lw $t1, -32($fp) - sw $t1, -20($fp) + # LOCAL local_print_at_Complex_internal_9 --> -40($fp) + # LOCAL local_print_at_Complex_internal_12 --> -52($fp) + # local_print_at_Complex_internal_9 = local_print_at_Complex_internal_12 + lw $t3, -52($fp) + sw $t3, -40($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_print_at_Article_internal_10 = GETATTRIBUTE per_title Article - # LOCAL local_print_at_Article_internal_10 --> -44($fp) - lw $t1, 20($s1) - sw $t1, -44($fp) - # ARG local_print_at_Article_internal_10 - # LOCAL local_print_at_Article_internal_10 --> -44($fp) - lw $t1, -44($fp) + # local_print_at_Complex_internal_18 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + lw $t3, 16($s1) + sw $t3, -76($fp) + # ARG local_print_at_Complex_internal_18 + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + lw $t3, -76($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Article_internal_4 --> -20($fp) - # LOCAL local_print_at_Article_internal_5 --> -24($fp) - # local_print_at_Article_internal_5 = VCALL local_print_at_Article_internal_4 out_string + sw $t3, 0($sp) + # LOCAL local_print_at_Complex_internal_9 --> -40($fp) + # LOCAL local_print_at_Complex_internal_10 --> -44($fp) + # local_print_at_Complex_internal_10 = VCALL local_print_at_Complex_internal_9 out_int # Save new self pointer in $s1 - lw $s1, -20($fp) + lw $s1, -40($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 12($t2) + lw $t5, 16($t4) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -24($fp) + jalr $t5 + sw $v0, -44($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Article_internal_2 --> -12($fp) - # LOCAL local_print_at_Article_internal_5 --> -24($fp) - # local_print_at_Article_internal_2 = local_print_at_Article_internal_5 - lw $t1, -24($fp) - sw $t1, -12($fp) + # LOCAL local_print_at_Complex_internal_7 --> -32($fp) + # LOCAL local_print_at_Complex_internal_10 --> -44($fp) + # local_print_at_Complex_internal_7 = local_print_at_Complex_internal_10 + lw $t3, -44($fp) + sw $t3, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_at_Article_internal_11 --> -48($fp) + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_7 - sw $t1, 12($v0) - li $t1, 2 - sw $t1, 16($v0) - sw $v0, -48($fp) - # ARG local_print_at_Article_internal_11 - # LOCAL local_print_at_Article_internal_11 --> -48($fp) - lw $t1, -48($fp) + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_7 + sw $t3, 12($v0) + li $t3, 1 + sw $t3, 16($v0) + sw $v0, -80($fp) + # ARG local_print_at_Complex_internal_19 + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + lw $t3, -80($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Article_internal_2 --> -12($fp) - # LOCAL local_print_at_Article_internal_3 --> -16($fp) - # local_print_at_Article_internal_3 = VCALL local_print_at_Article_internal_2 out_string + sw $t3, 0($sp) + # LOCAL local_print_at_Complex_internal_7 --> -32($fp) + # LOCAL local_print_at_Complex_internal_8 --> -36($fp) + # local_print_at_Complex_internal_8 = VCALL local_print_at_Complex_internal_7 out_string # Save new self pointer in $s1 - lw $s1, -12($fp) + lw $s1, -32($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 12($t2) + lw $t5, 12($t4) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) + jalr $t5 + sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Article_internal_12 --> -52($fp) - # local_print_at_Article_internal_12 = SELF - sw $s1, -52($fp) - # RETURN local_print_at_Article_internal_12 - lw $v0, -52($fp) - # Deallocate stack frame for function function_print_at_Article. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 60 - jr $ra - # Function END + # LOCAL local_print_at_Complex_internal_0 --> -4($fp) + # LOCAL local_print_at_Complex_internal_8 --> -36($fp) + # local_print_at_Complex_internal_0 = local_print_at_Complex_internal_8 + lw $t3, -36($fp) + sw $t3, -4($fp) + label_ENDIF_12: +# RETURN local_print_at_Complex_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_print_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +jr $ra +# Function END + + +# function_reflect_0_at_Complex implementation. +# @Params: +function_reflect_0_at_Complex: + # Allocate stack frame for function function_reflect_0_at_Complex. + subu $sp, $sp, 44 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 44 + # local_reflect_0_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + lw $t3, 12($s1) + sw $t3, -8($fp) + # local_reflect_0_at_Complex_internal_3 = GETATTRIBUTE x Complex + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + lw $t3, 12($s1) + sw $t3, -16($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + lw $t3, -16($fp) + not $t3, $t3 + sw $t3, -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # local_reflect_0_at_Complex_internal_0 = local_reflect_0_at_Complex_internal_1 - local_reflect_0_at_Complex_internal_2 + lw $t3, -8($fp) + lw $t4, -12($fp) + sub $t3, $t3, $t4 + sw $t3, -4($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_15 + # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_15 + lw $t3, -4($fp) + beq $t3, 0, label_TRUE_15 + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # local_reflect_0_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + # GOTO label_END_16 +j label_END_16 +label_TRUE_15: + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # local_reflect_0_at_Complex_internal_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + label_END_16: +# local_reflect_0_at_Complex_internal_5 = GETATTRIBUTE y Complex +# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) +lw $t3, 16($s1) +sw $t3, -24($fp) +# local_reflect_0_at_Complex_internal_7 = GETATTRIBUTE y Complex +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +lw $t3, 16($s1) +sw $t3, -32($fp) +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +lw $t3, -32($fp) +not $t3, $t3 +sw $t3, -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) +# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# local_reflect_0_at_Complex_internal_4 = local_reflect_0_at_Complex_internal_5 - local_reflect_0_at_Complex_internal_6 +lw $t3, -24($fp) +lw $t4, -28($fp) +sub $t3, $t3, $t4 +sw $t3, -20($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_17 +# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_17 +lw $t3, -20($fp) +beq $t3, 0, label_TRUE_17 +# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) +# local_reflect_0_at_Complex_internal_4 = 0 +li $t3, 0 +sw $t3, -20($fp) +# GOTO label_END_18 +j label_END_18 +label_TRUE_17: + # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) + # local_reflect_0_at_Complex_internal_4 = 1 + li $t3, 1 + sw $t3, -20($fp) + label_END_18: +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# local_reflect_0_at_Complex_internal_8 = SELF +sw $s1, -36($fp) +# RETURN local_reflect_0_at_Complex_internal_8 +lw $v0, -36($fp) +# Deallocate stack frame for function function_reflect_0_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 44 +jr $ra +# Function END -# function_isNil_at_BookList implementation. +# function_reflect_X_at_Complex implementation. # @Params: -function_isNil_at_BookList: - # Allocate stack frame for function function_isNil_at_BookList. +function_reflect_X_at_Complex: + # Allocate stack frame for function function_reflect_X_at_Complex. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_isNil_at_BookList_internal_2 --> -12($fp) - # local_isNil_at_BookList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_isNil_at_BookList_internal_0 --> -4($fp) - # LOCAL local_isNil_at_BookList_internal_2 --> -12($fp) - # local_isNil_at_BookList_internal_0 = local_isNil_at_BookList_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_isNil_at_BookList_internal_0 --> -4($fp) - # LOCAL local_isNil_at_BookList_internal_1 --> -8($fp) - # local_isNil_at_BookList_internal_1 = VCALL local_isNil_at_BookList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN 1 - li $v0, 1 - # Deallocate stack frame for function function_isNil_at_BookList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END + # local_reflect_X_at_Complex_internal_1 = GETATTRIBUTE y Complex + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + lw $t3, 16($s1) + sw $t3, -8($fp) + # local_reflect_X_at_Complex_internal_3 = GETATTRIBUTE y Complex + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + lw $t3, 16($s1) + sw $t3, -16($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + lw $t3, -16($fp) + not $t3, $t3 + sw $t3, -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # local_reflect_X_at_Complex_internal_0 = local_reflect_X_at_Complex_internal_1 - local_reflect_X_at_Complex_internal_2 + lw $t3, -8($fp) + lw $t4, -12($fp) + sub $t3, $t3, $t4 + sw $t3, -4($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_19 + # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_19 + lw $t3, -4($fp) + beq $t3, 0, label_TRUE_19 + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # local_reflect_X_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + # GOTO label_END_20 +j label_END_20 +label_TRUE_19: + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # local_reflect_X_at_Complex_internal_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + label_END_20: +# LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) +# local_reflect_X_at_Complex_internal_4 = SELF +sw $s1, -20($fp) +# RETURN local_reflect_X_at_Complex_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_reflect_X_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +jr $ra +# Function END -# function_cons_at_BookList implementation. +# function_reflect_Y_at_Complex implementation. # @Params: -# 0($fp) = param_cons_at_BookList_hd_0 -function_cons_at_BookList: - # Allocate stack frame for function function_cons_at_BookList. +function_reflect_Y_at_Complex: + # Allocate stack frame for function function_reflect_Y_at_Complex. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) - # local_cons_at_BookList_new_cell_0 = ALLOCATE Cons - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Cons - sw $t3, 12($v0) - li $t3, 4 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Cons_start - sw $t3, 4($v0) - # Load type offset - li $t3, 28 - sw $t3, 8($v0) - move $t2, $v0 - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Cons__attrib__xcar__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t2) - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Cons__attrib__xcdr__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t2) - sw $t2, -4($fp) - # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) - # local_cons_at_BookList_internal_1 = ALLOCATE Cons - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Cons - sw $t4, 12($v0) - li $t4, 4 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, Cons_start - sw $t4, 4($v0) - # Load type offset - li $t4, 28 - sw $t4, 8($v0) - move $t3, $v0 - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Cons__attrib__xcar__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t3) - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Cons__attrib__xcdr__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t3) + # local_reflect_Y_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + lw $t3, 12($s1) sw $t3, -8($fp) - # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) - # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) - # local_cons_at_BookList_new_cell_0 = local_cons_at_BookList_internal_1 + # local_reflect_Y_at_Complex_internal_3 = GETATTRIBUTE x Complex + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + lw $t3, 12($s1) + sw $t3, -16($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + lw $t3, -16($fp) + not $t3, $t3 + sw $t3, -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # local_reflect_Y_at_Complex_internal_0 = local_reflect_Y_at_Complex_internal_1 - local_reflect_Y_at_Complex_internal_2 lw $t3, -8($fp) + lw $t4, -12($fp) + sub $t3, $t3, $t4 sw $t3, -4($fp) - # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) - # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) - # local_cons_at_BookList_internal_2 = local_cons_at_BookList_new_cell_0 + # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_21 + # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_21 lw $t3, -4($fp) + beq $t3, 0, label_TRUE_21 + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # local_reflect_Y_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + # GOTO label_END_22 +j label_END_22 +label_TRUE_21: + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # local_reflect_Y_at_Complex_internal_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + label_END_22: +# LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) +# local_reflect_Y_at_Complex_internal_4 = SELF +sw $s1, -20($fp) +# RETURN local_reflect_Y_at_Complex_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_reflect_Y_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +jr $ra +# Function END + + +# function_equal_at_Complex implementation. +# @Params: +# 0($fp) = param_equal_at_Complex_d_0 +function_equal_at_Complex: + # Allocate stack frame for function function_equal_at_Complex. + subu $sp, $sp, 48 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 48 + # local_equal_at_Complex_internal_2 = GETATTRIBUTE x Complex + # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) + lw $t3, 12($s1) sw $t3, -12($fp) + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # PARAM param_equal_at_Complex_d_0 --> 0($fp) + # local_equal_at_Complex_internal_3 = PARAM param_equal_at_Complex_d_0 + lw $t3, 0($fp) + sw $t3, -16($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # ARG param_cons_at_BookList_hd_0 - # PARAM param_cons_at_BookList_hd_0 --> 0($fp) - lw $t3, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) - # local_cons_at_BookList_internal_4 = SELF - sw $s1, -20($fp) - # ARG local_cons_at_BookList_internal_4 - # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) - lw $t3, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) - # LOCAL local_cons_at_BookList_internal_3 --> -16($fp) - # local_cons_at_BookList_internal_3 = VCALL local_cons_at_BookList_internal_2 init + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # local_equal_at_Complex_internal_4 = VCALL local_equal_at_Complex_internal_3 x_value # Save new self pointer in $s1 - lw $s1, -12($fp) + lw $s1, -16($fp) # Get pointer to type lw $t3, 4($s1) # Get pointer to type's VTABLE lw $t4, 0($t3) # Get pointer to function address - lw $t5, 48($t4) + lw $t5, 52($t4) # Call function. Result is on $v0 jalr $t5 - sw $v0, -16($fp) + sw $v0, -20($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN local_cons_at_BookList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_cons_at_BookList. + # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) + # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # local_equal_at_Complex_internal_1 = local_equal_at_Complex_internal_2 - local_equal_at_Complex_internal_4 + lw $t3, -12($fp) + lw $t4, -20($fp) + sub $t3, $t3, $t4 + sw $t3, -8($fp) + # IF_ZERO local_equal_at_Complex_internal_1 GOTO label_TRUE_25 + # IF_ZERO local_equal_at_Complex_internal_1 GOTO label_TRUE_25 + lw $t3, -8($fp) + beq $t3, 0, label_TRUE_25 + # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) + # local_equal_at_Complex_internal_1 = 0 + li $t3, 0 + sw $t3, -8($fp) + # GOTO label_END_26 +j label_END_26 +label_TRUE_25: + # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) + # local_equal_at_Complex_internal_1 = 1 + li $t3, 1 + sw $t3, -8($fp) + label_END_26: +# IF_ZERO local_equal_at_Complex_internal_1 GOTO label_FALSEIF_23 +# IF_ZERO local_equal_at_Complex_internal_1 GOTO label_FALSEIF_23 +lw $t3, -8($fp) +beq $t3, 0, label_FALSEIF_23 +# local_equal_at_Complex_internal_7 = GETATTRIBUTE y Complex +# LOCAL local_equal_at_Complex_internal_7 --> -32($fp) +lw $t3, 16($s1) +sw $t3, -32($fp) +# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) +# PARAM param_equal_at_Complex_d_0 --> 0($fp) +# local_equal_at_Complex_internal_8 = PARAM param_equal_at_Complex_d_0 +lw $t3, 0($fp) +sw $t3, -36($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) +# LOCAL local_equal_at_Complex_internal_9 --> -40($fp) +# local_equal_at_Complex_internal_9 = VCALL local_equal_at_Complex_internal_8 y_value +# Save new self pointer in $s1 +lw $s1, -36($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 56($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -40($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_equal_at_Complex_internal_6 --> -28($fp) +# LOCAL local_equal_at_Complex_internal_7 --> -32($fp) +# LOCAL local_equal_at_Complex_internal_9 --> -40($fp) +# local_equal_at_Complex_internal_6 = local_equal_at_Complex_internal_7 - local_equal_at_Complex_internal_9 +lw $t3, -32($fp) +lw $t4, -40($fp) +sub $t3, $t3, $t4 +sw $t3, -28($fp) +# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_TRUE_29 +# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_TRUE_29 +lw $t3, -28($fp) +beq $t3, 0, label_TRUE_29 +# LOCAL local_equal_at_Complex_internal_6 --> -28($fp) +# local_equal_at_Complex_internal_6 = 0 +li $t3, 0 +sw $t3, -28($fp) +# GOTO label_END_30 +j label_END_30 +label_TRUE_29: + # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) + # local_equal_at_Complex_internal_6 = 1 + li $t3, 1 + sw $t3, -28($fp) + label_END_30: +# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSEIF_27 +# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSEIF_27 +lw $t3, -28($fp) +beq $t3, 0, label_FALSEIF_27 +# LOCAL local_equal_at_Complex_internal_5 --> -24($fp) +# local_equal_at_Complex_internal_5 = 1 +li $t3, 1 +sw $t3, -24($fp) +# GOTO label_ENDIF_28 +j label_ENDIF_28 +label_FALSEIF_27: + # LOCAL local_equal_at_Complex_internal_5 --> -24($fp) + # local_equal_at_Complex_internal_5 = 0 + li $t3, 0 + sw $t3, -24($fp) + label_ENDIF_28: +# LOCAL local_equal_at_Complex_internal_0 --> -4($fp) +# LOCAL local_equal_at_Complex_internal_5 --> -24($fp) +# local_equal_at_Complex_internal_0 = local_equal_at_Complex_internal_5 +lw $t3, -24($fp) +sw $t3, -4($fp) +# GOTO label_ENDIF_24 +j label_ENDIF_24 +label_FALSEIF_23: + # LOCAL local_equal_at_Complex_internal_0 --> -4($fp) + # local_equal_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + label_ENDIF_24: +# RETURN local_equal_at_Complex_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_equal_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 48 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_x_value_at_Complex implementation. +# @Params: +function_x_value_at_Complex: + # Allocate stack frame for function function_x_value_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_x_value_at_Complex_internal_0 = GETATTRIBUTE x Complex + # LOCAL local_x_value_at_Complex_internal_0 --> -4($fp) + lw $t3, 12($s1) + sw $t3, -4($fp) + # RETURN local_x_value_at_Complex_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_x_value_at_Complex. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 jr $ra # Function END -# function_car_at_BookList implementation. +# function_y_value_at_Complex implementation. # @Params: -function_car_at_BookList: - # Allocate stack frame for function function_car_at_BookList. +function_y_value_at_Complex: + # Allocate stack frame for function function_y_value_at_Complex. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_car_at_BookList_internal_2 --> -12($fp) - # local_car_at_BookList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_car_at_BookList_internal_0 --> -4($fp) - # LOCAL local_car_at_BookList_internal_2 --> -12($fp) - # local_car_at_BookList_internal_0 = local_car_at_BookList_internal_2 - lw $t3, -12($fp) + # local_y_value_at_Complex_internal_0 = GETATTRIBUTE y Complex + # LOCAL local_y_value_at_Complex_internal_0 --> -4($fp) + lw $t3, 16($s1) sw $t3, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_car_at_BookList_internal_0 --> -4($fp) - # LOCAL local_car_at_BookList_internal_1 --> -8($fp) - # local_car_at_BookList_internal_1 = VCALL local_car_at_BookList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 0($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_car_at_BookList_internal_3 --> -16($fp) - # local_car_at_BookList_internal_3 = ALLOCATE Book - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) - # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, Book - sw $t5, 12($v0) - li $t5, 4 - sw $t5, 16($v0) - move $t5, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t5, 0($v0) - la $t5, Book_start - sw $t5, 4($v0) - # Load type offset - li $t5, 16 - sw $t5, 8($v0) - move $t4, $v0 - # Push register t4 into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t4) - # Push register t4 into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t4) - sw $t4, -16($fp) - # RETURN local_car_at_BookList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_car_at_BookList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cdr_at_BookList implementation. -# @Params: -function_cdr_at_BookList: - # Allocate stack frame for function function_cdr_at_BookList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_cdr_at_BookList_internal_2 --> -12($fp) - # local_cdr_at_BookList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_cdr_at_BookList_internal_0 --> -4($fp) - # LOCAL local_cdr_at_BookList_internal_2 --> -12($fp) - # local_cdr_at_BookList_internal_0 = local_cdr_at_BookList_internal_2 - lw $t4, -12($fp) - sw $t4, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_cdr_at_BookList_internal_0 --> -4($fp) - # LOCAL local_cdr_at_BookList_internal_1 --> -8($fp) - # local_cdr_at_BookList_internal_1 = VCALL local_cdr_at_BookList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t4, 4($s1) - # Get pointer to type's VTABLE - lw $t5, 0($t4) - # Get pointer to function address - lw $t6, 0($t5) - # Call function. Result is on $v0 - jalr $t6 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cdr_at_BookList_internal_3 --> -16($fp) - # local_cdr_at_BookList_internal_3 = ALLOCATE BookList - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t6, String - sw $t6, 0($v0) - la $t6, String_start - sw $t6, 4($v0) - # Load type offset - li $t6, 8 - sw $t6, 8($v0) - la $t6, BookList - sw $t6, 12($v0) - li $t6, 8 - sw $t6, 16($v0) - move $t6, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t6, 0($v0) - la $t6, BookList_start - sw $t6, 4($v0) - # Load type offset - li $t6, 24 - sw $t6, 8($v0) - move $t5, $v0 - sw $t5, -16($fp) - # RETURN local_cdr_at_BookList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_cdr_at_BookList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_print_list_at_BookList implementation. -# @Params: -function_print_list_at_BookList: - # Allocate stack frame for function function_print_list_at_BookList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_print_list_at_BookList_internal_2 --> -12($fp) - # local_print_list_at_BookList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_print_list_at_BookList_internal_0 --> -4($fp) - # LOCAL local_print_list_at_BookList_internal_2 --> -12($fp) - # local_print_list_at_BookList_internal_0 = local_print_list_at_BookList_internal_2 - lw $t5, -12($fp) - sw $t5, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_BookList_internal_0 --> -4($fp) - # LOCAL local_print_list_at_BookList_internal_1 --> -8($fp) - # local_print_list_at_BookList_internal_1 = VCALL local_print_list_at_BookList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t5, 4($s1) - # Get pointer to type's VTABLE - lw $t6, 0($t5) - # Get pointer to function address - lw $t7, 0($t6) - # Call function. Result is on $v0 - jalr $t7 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_list_at_BookList_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_print_list_at_BookList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Cons__attrib__xcar__init implementation. -# @Params: -__Cons__attrib__xcar__init: - # Allocate stack frame for function __Cons__attrib__xcar__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Cons__attrib__xcar__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Cons__attrib__xcdr__init implementation. -# @Params: -__Cons__attrib__xcdr__init: - # Allocate stack frame for function __Cons__attrib__xcdr__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Cons__attrib__xcdr__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_Cons implementation. -# @Params: -function_isNil_at_Cons: - # Allocate stack frame for function function_isNil_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function function_isNil_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_Cons implementation. -# @Params: -# 0($fp) = param_init_at_Cons_hd_0 -# 4($fp) = param_init_at_Cons_tl_1 -function_init_at_Cons: - # Allocate stack frame for function function_init_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_Cons_hd_0 --> 4($fp) - lw $t5, 4($fp) - sw $t5, 12($s1) - # - # PARAM param_init_at_Cons_tl_1 --> 0($fp) - lw $t5, 0($fp) - sw $t5, 16($s1) - # LOCAL local_init_at_Cons_internal_0 --> -4($fp) - # local_init_at_Cons_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_init_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_init_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_car_at_Cons implementation. -# @Params: -function_car_at_Cons: - # Allocate stack frame for function function_car_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_car_at_Cons_internal_0 = GETATTRIBUTE xcar Cons - # LOCAL local_car_at_Cons_internal_0 --> -4($fp) - lw $t5, 12($s1) - sw $t5, -4($fp) - # RETURN local_car_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_car_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cdr_at_Cons implementation. -# @Params: -function_cdr_at_Cons: - # Allocate stack frame for function function_cdr_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_cdr_at_Cons_internal_0 = GETATTRIBUTE xcdr Cons - # LOCAL local_cdr_at_Cons_internal_0 --> -4($fp) - lw $t5, 16($s1) - sw $t5, -4($fp) - # RETURN local_cdr_at_Cons_internal_0 + # RETURN local_y_value_at_Complex_internal_0 lw $v0, -4($fp) - # Deallocate stack frame for function function_cdr_at_Cons. + # Deallocate stack frame for function function_y_value_at_Complex. # Restore $ra lw $ra, 4($sp) # Restore $fp @@ -1953,903 +2007,3 @@ function_cdr_at_Cons: # Function END -# function_print_list_at_Cons implementation. -# @Params: -function_print_list_at_Cons: - # Allocate stack frame for function function_print_list_at_Cons. - subu $sp, $sp, 88 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 88 - # local_print_list_at_Cons_internal_2 = GETATTRIBUTE xcar Cons - # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) - lw $t5, 12($s1) - sw $t5, -12($fp) - # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) - # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) - # local_print_list_at_Cons_internal_0 = local_print_list_at_Cons_internal_2 - lw $t5, -12($fp) - sw $t5, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) - # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # local_print_list_at_Cons_internal_1 = VCALL local_print_list_at_Cons_internal_0 print - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t5, 4($s1) - # Get pointer to type's VTABLE - lw $t6, 0($t5) - # Get pointer to function address - lw $t7, 32($t6) - # Call function. Result is on $v0 - jalr $t7 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) - # local_print_list_at_Cons_internal_3 = TYPEOF local_print_list_at_Cons_internal_1 - lw $t5, -8($fp) - # Load pointer to type offset - lw $t6, 8($t5) - sw $t6, -16($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # local_print_list_at_Cons_internal_5 = 14 - li $t5, 14 - sw $t5, -24($fp) - # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Book - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) - # Load TDT pointer to type Book - la $t5, Book__TDT - lw $t6, -16($fp) - addu $t5, $t5, $t6 - # Save distance - lw $t6, 0($t5) - sw $t6, -28($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # Update min if 13 < 14 - lw $t5, -28($fp) - lw $t6, -24($fp) - bgtu $t5, $t6, label_Not_min0_1 - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_6 - lw $t5, -28($fp) - sw $t5, -24($fp) - label_Not_min0_1: - # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Article - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) - # Load TDT pointer to type Article - la $t5, Article__TDT - lw $t6, -16($fp) - addu $t5, $t5, $t6 - # Save distance - lw $t6, 0($t5) - sw $t6, -28($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # Update min if 13 < 14 - lw $t5, -28($fp) - lw $t6, -24($fp) - bgtu $t5, $t6, label_Not_min1_2 - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_6 - lw $t5, -28($fp) - sw $t5, -24($fp) - label_Not_min1_2: - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_6 = 14 - li $t5, 14 - sw $t5, -28($fp) - # LOCAL local_print_list_at_Cons_internal_4 --> -20($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # local_print_list_at_Cons_internal_4 = local_print_list_at_Cons_internal_6 - local_print_list_at_Cons_internal_5 - lw $t5, -28($fp) - lw $t6, -24($fp) - sub $t5, $t5, $t6 - sw $t5, -20($fp) - # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 - # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 - lw $t5, -20($fp) - beq $t5, 0, label_ERROR_3 - # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Book - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) - # Load TDT pointer to type Book - la $t5, Book__TDT - lw $t6, -16($fp) - addu $t5, $t5, $t6 - # Save distance - lw $t6, 0($t5) - sw $t6, -28($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # Update min if 13 < 14 - lw $t5, -28($fp) - lw $t6, -24($fp) - bgtu $t5, $t6, label_NEXT0_5 - # LOCAL local_print_list_at_Cons_dummy_7 --> -32($fp) - # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # local_print_list_at_Cons_dummy_7 = local_print_list_at_Cons_internal_1 - lw $t5, -8($fp) - sw $t5, -32($fp) - # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) - # local_print_list_at_Cons_internal_10 = SELF - sw $s1, -44($fp) - # LOCAL local_print_list_at_Cons_internal_8 --> -36($fp) - # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) - # local_print_list_at_Cons_internal_8 = local_print_list_at_Cons_internal_10 - lw $t5, -44($fp) - sw $t5, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) - # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, data_8 - sw $t5, 12($v0) - li $t5, 27 - sw $t5, 16($v0) - sw $v0, -48($fp) - # ARG local_print_list_at_Cons_internal_11 - # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) - lw $t5, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t5, 0($sp) - # LOCAL local_print_list_at_Cons_internal_8 --> -36($fp) - # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) - # local_print_list_at_Cons_internal_9 = VCALL local_print_list_at_Cons_internal_8 out_string - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t5, 4($s1) - # Get pointer to type's VTABLE - lw $t6, 0($t5) - # Get pointer to function address - lw $t7, 12($t6) - # Call function. Result is on $v0 - jalr $t7 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # GOTO label_END_4 -j label_END_4 -label_NEXT0_5: - # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Article - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) - # Load TDT pointer to type Article - la $t5, Article__TDT - lw $t6, -16($fp) - addu $t5, $t5, $t6 - # Save distance - lw $t6, 0($t5) - sw $t6, -28($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # Update min if 13 < 14 - lw $t5, -28($fp) - lw $t6, -24($fp) - bgtu $t5, $t6, label_NEXT1_6 - # LOCAL local_print_list_at_Cons_dummy_12 --> -52($fp) - # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # local_print_list_at_Cons_dummy_12 = local_print_list_at_Cons_internal_1 - lw $t5, -8($fp) - sw $t5, -52($fp) - # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) - # local_print_list_at_Cons_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_print_list_at_Cons_internal_13 --> -56($fp) - # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) - # local_print_list_at_Cons_internal_13 = local_print_list_at_Cons_internal_15 - lw $t5, -64($fp) - sw $t5, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) - # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, data_9 - sw $t5, 12($v0) - li $t5, 30 - sw $t5, 16($v0) - sw $v0, -68($fp) - # ARG local_print_list_at_Cons_internal_16 - # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) - lw $t5, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t5, 0($sp) - # LOCAL local_print_list_at_Cons_internal_13 --> -56($fp) - # LOCAL local_print_list_at_Cons_internal_14 --> -60($fp) - # local_print_list_at_Cons_internal_14 = VCALL local_print_list_at_Cons_internal_13 out_string - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t5, 4($s1) - # Get pointer to type's VTABLE - lw $t6, 0($t5) - # Get pointer to function address - lw $t7, 12($t6) - # Call function. Result is on $v0 - jalr $t7 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # GOTO label_END_4 -j label_END_4 -label_NEXT1_6: - label_ERROR_3: - li $a0, 10 - syscall - label_END_4: -# local_print_list_at_Cons_internal_19 = GETATTRIBUTE xcdr Cons -# LOCAL local_print_list_at_Cons_internal_19 --> -80($fp) -lw $t5, 16($s1) -sw $t5, -80($fp) -# LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) -# LOCAL local_print_list_at_Cons_internal_19 --> -80($fp) -# local_print_list_at_Cons_internal_17 = local_print_list_at_Cons_internal_19 -lw $t5, -80($fp) -sw $t5, -72($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) -# LOCAL local_print_list_at_Cons_internal_18 --> -76($fp) -# local_print_list_at_Cons_internal_18 = VCALL local_print_list_at_Cons_internal_17 print_list -# Save new self pointer in $s1 -lw $s1, -72($fp) -# Get pointer to type -lw $t5, 4($s1) -# Get pointer to type's VTABLE -lw $t6, 0($t5) -# Get pointer to function address -lw $t7, 44($t6) -# Call function. Result is on $v0 -jalr $t7 -sw $v0, -76($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# RETURN local_print_list_at_Cons_internal_18 -lw $v0, -76($fp) -# Deallocate stack frame for function function_print_list_at_Cons. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 88 -jr $ra -# Function END - - -# function_isNil_at_Nil implementation. -# @Params: -function_isNil_at_Nil: - # Allocate stack frame for function function_isNil_at_Nil. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 1 - li $v0, 1 - # Deallocate stack frame for function function_isNil_at_Nil. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_print_list_at_Nil implementation. -# @Params: -function_print_list_at_Nil: - # Allocate stack frame for function function_print_list_at_Nil. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 1 - li $v0, 1 - # Deallocate stack frame for function function_print_list_at_Nil. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__books__init implementation. -# @Params: -__Main__attrib__books__init: - # Allocate stack frame for function __Main__attrib__books__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Main__attrib__books__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 92 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 92 - # LOCAL local_main_at_Main_a_book_0 --> -4($fp) - # local_main_at_Main_a_book_0 = ALLOCATE Book - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) - # Load type offset - li $t7, 8 - sw $t7, 8($v0) - la $t7, Book - sw $t7, 12($v0) - li $t7, 4 - sw $t7, 16($v0) - move $t7, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t7, 0($v0) - la $t7, Book_start - sw $t7, 4($v0) - # Load type offset - li $t7, 16 - sw $t7, 8($v0) - move $t6, $v0 - # Push register t6 into stack - subu $sp, $sp, 4 - sw $t6, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t6) - # Push register t6 into stack - subu $sp, $sp, 4 - sw $t6, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t6) - sw $t6, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = ALLOCATE Book - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t8, String - sw $t8, 0($v0) - la $t8, String_start - sw $t8, 4($v0) - # Load type offset - li $t8, 8 - sw $t8, 8($v0) - la $t8, Book - sw $t8, 12($v0) - li $t8, 4 - sw $t8, 16($v0) - move $t8, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t8, 0($v0) - la $t8, Book_start - sw $t8, 4($v0) - # Load type offset - li $t8, 16 - sw $t8, 8($v0) - move $t7, $v0 - # Push register t7 into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t7) - # Push register t7 into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t7) - sw $t7, -16($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t7, -16($fp) - sw $t7, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) - # Load type offset - li $t7, 8 - sw $t7, 8($v0) - la $t7, data_10 - sw $t7, 12($v0) - li $t7, 44 - sw $t7, 16($v0) - sw $v0, -20($fp) - # ARG local_main_at_Main_internal_4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - lw $t7, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) - # Load type offset - li $t7, 8 - sw $t7, 8($v0) - la $t7, data_11 - sw $t7, 12($v0) - li $t7, 22 - sw $t7, 16($v0) - sw $v0, -24($fp) - # ARG local_main_at_Main_internal_5 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - lw $t7, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 initBook - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t7, 4($s1) - # Get pointer to type's VTABLE - lw $t8, 0($t7) - # Get pointer to function address - lw $t9, 28($t8) - # Call function. Result is on $v0 - jalr $t9 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_a_book_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_a_book_0 = local_main_at_Main_internal_2 - lw $t7, -12($fp) - sw $t7, -4($fp) - # LOCAL local_main_at_Main_an_article_6 --> -28($fp) - # local_main_at_Main_an_article_6 = ALLOCATE Article - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) - # Load type offset - li $t9, 8 - sw $t9, 8($v0) - la $t9, Article - sw $t9, 12($v0) - li $t9, 7 - sw $t9, 16($v0) - move $t9, $v0 - # Allocating 24 bytes of memory - li $a0, 24 - li $v0, 9 - syscall - sw $t9, 0($v0) - la $t9, Article_start - sw $t9, 4($v0) - # Load type offset - li $t9, 20 - sw $t9, 8($v0) - move $t8, $v0 - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t8) - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t8) - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Article__attrib__per_title__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t8) - sw $t8, -28($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = ALLOCATE Article - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $s2, String - sw $s2, 0($v0) - la $s2, String_start - sw $s2, 4($v0) - # Load type offset - li $s2, 8 - sw $s2, 8($v0) - la $s2, Article - sw $s2, 12($v0) - li $s2, 7 - sw $s2, 16($v0) - move $s2, $v0 - # Allocating 24 bytes of memory - li $a0, 24 - li $v0, 9 - syscall - sw $s2, 0($v0) - la $s2, Article_start - sw $s2, 4($v0) - # Load type offset - li $s2, 20 - sw $s2, 8($v0) - move $t9, $v0 - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t9) - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t9) - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Article__attrib__per_title__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t9) - sw $t9, -40($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t9, -40($fp) - sw $t9, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) - # Load type offset - li $t9, 8 - sw $t9, 8($v0) - la $t9, data_12 - sw $t9, 12($v0) - li $t9, 19 - sw $t9, 16($v0) - sw $v0, -44($fp) - # ARG local_main_at_Main_internal_10 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - lw $t9, -44($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) - # Load type offset - li $t9, 8 - sw $t9, 8($v0) - la $t9, data_13 - sw $t9, 12($v0) - li $t9, 7 - sw $t9, 16($v0) - sw $v0, -48($fp) - # ARG local_main_at_Main_internal_11 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - lw $t9, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) - # Load type offset - li $t9, 8 - sw $t9, 8($v0) - la $t9, data_14 - sw $t9, 12($v0) - li $t9, 11 - sw $t9, 16($v0) - sw $v0, -52($fp) - # ARG local_main_at_Main_internal_12 - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - lw $t9, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 initArticle - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t9, 4($s1) - # Get pointer to type's VTABLE - lw $s2, 0($t9) - # Get pointer to function address - lw $s3, 36($s2) - # Call function. Result is on $v0 - jalr $s3 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_an_article_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_an_article_6 = local_main_at_Main_internal_8 - lw $t9, -36($fp) - sw $t9, -28($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = ALLOCATE Nil - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $s3, String - sw $s3, 0($v0) - la $s3, String_start - sw $s3, 4($v0) - # Load type offset - li $s3, 8 - sw $s3, 8($v0) - la $s3, Nil - sw $s3, 12($v0) - li $s3, 3 - sw $s3, 16($v0) - move $s3, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $s3, 0($v0) - la $s3, Nil_start - sw $s3, 4($v0) - # Load type offset - li $s3, 32 - sw $s3, 8($v0) - move $s2, $v0 - sw $s2, -72($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 - lw $s2, -72($fp) - sw $s2, -64($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_main_at_Main_a_book_0 - # LOCAL local_main_at_Main_a_book_0 --> -4($fp) - lw $s2, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $s2, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 cons - # Save new self pointer in $s1 - lw $s1, -64($fp) - # Get pointer to type - lw $s2, 4($s1) - # Get pointer to type's VTABLE - lw $s3, 0($s2) - # Get pointer to function address - lw $s4, 32($s3) - # Call function. Result is on $v0 - jalr $s4 - sw $v0, -68($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_13 = local_main_at_Main_internal_16 - lw $s2, -68($fp) - sw $s2, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_main_at_Main_an_article_6 - # LOCAL local_main_at_Main_an_article_6 --> -28($fp) - lw $s2, -28($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $s2, 0($sp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 cons - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $s2, 4($s1) - # Get pointer to type's VTABLE - lw $s3, 0($s2) - # Get pointer to function address - lw $s4, 32($s3) - # Call function. Result is on $v0 - jalr $s4 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - lw $s2, -60($fp) - sw $s2, 12($s1) - # local_main_at_Main_internal_20 = GETATTRIBUTE books Main - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - lw $s2, 12($s1) - sw $s2, -84($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 - lw $s2, -84($fp) - sw $s2, -76($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 print_list - # Save new self pointer in $s1 - lw $s1, -76($fp) - # Get pointer to type - lw $s2, 4($s1) - # Get pointer to type's VTABLE - lw $s3, 0($s2) - # Get pointer to function address - lw $s4, 44($s3) - # Call function. Result is on $v0 - jalr $s4 - sw $v0, -80($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_19 - lw $v0, -80($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 92 - jr $ra - # Function END - - diff --git a/src/testing.py b/src/testing.py index 08133765..2cf486c4 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,136 +60,83 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""-- example of static and dynamic type differing for a dispatch - -Class Book inherits IO { - title : String; - author : String; - - initBook(title_p : String, author_p : String) : Book { - { - title <- title_p; - author <- author_p; - self; - } - }; - - print() : Book { - { - out_string("title: ").out_string(title).out_string("\n"); - out_string("author: ").out_string(author).out_string("\n"); - self; - } +text = r"""class Main inherits IO { + main() : IO { + (let c : Complex <- (new Complex).init(1, 1) in + { + -- trivially equal (see CoolAid) + if c.reflect_X() = c.reflect_0() + then out_string("=)\n") + else out_string("=(\n") + fi; + -- equal + if c.reflect_X().reflect_Y().equal(c.reflect_0()) + then out_string("=)\n") + else out_string("=(\n") + fi; + } + ) }; }; -Class Article inherits Book { - per_title : String; +class Complex inherits IO { + x : Int; + y : Int; - initArticle(title_p : String, author_p : String, - per_title_p : String) : Article { - { - initBook(title_p, author_p); - per_title <- per_title_p; - self; - } + init(a : Int, b : Int) : Complex { + { + x = a; + y = b; + self; + } }; - print() : Book { - { - self@Book.print(); - out_string("periodical: ").out_string(per_title).out_string("\n"); - self; - } + print() : Object { + if y = 0 + then out_int(x) + else out_int(x).out_string("+").out_int(y).out_string("I") + fi }; -}; -Class BookList inherits IO { - (* Since abort "returns" type Object, we have to add - an expression of type Bool here to satisfy the typechecker. - This code is unreachable, since abort() halts the program. - *) - isNil() : Bool { { abort(); true; } }; - - cons(hd : Book) : Cons { - (let new_cell : Cons <- new Cons in - new_cell.init(hd,self) - ) + reflect_0() : Complex { + { + x = ~x; + y = ~y; + self; + } }; - (* Since abort "returns" type Object, we have to add - an expression of type Book here to satisfy the typechecker. - This code is unreachable, since abort() halts the program. - *) - car() : Book { { abort(); new Book; } }; - - (* Since abort "returns" type Object, we have to add - an expression of type BookList here to satisfy the typechecker. - This code is unreachable, since abort() halts the program. - *) - cdr() : BookList { { abort(); new BookList; } }; - - print_list() : Object { abort() }; -}; - -Class Cons inherits BookList { - xcar : Book; -- We keep the car and cdr in attributes. - xcdr : BookList; -- Because methods and features must have different names, - -- we use xcar and xcdr for the attributes and reserve - -- car and cdr for the features. - - isNil() : Bool { false }; - - init(hd : Book, tl : BookList) : Cons { - { - xcar <- hd; - xcdr <- tl; - self; - } + reflect_X() : Complex { + { + y = ~y; + self; + } }; - car() : Book { xcar }; - - cdr() : BookList { xcdr }; - - print_list() : Object { - { - case xcar.print() of - dummy : Book => out_string("- dynamic type was Book -\n"); - dummy : Article => out_string("- dynamic type was Article -\n"); - esac; - xcdr.print_list(); - } + reflect_Y() : Complex { + { + x = ~x; + self; + } }; -}; - -Class Nil inherits BookList { - isNil() : Bool { true }; - print_list() : Object { true }; -}; + equal(d : Complex) : Bool { + if x = d.x_value() + then + if y = d.y_value() + then true + else false + fi + else false + fi + }; + x_value() : Int { + x + }; -Class Main { - - books : BookList; - - main() : Object { - (let a_book : Book <- - (new Book).initBook("Compilers, Principles, Techniques, and Tools", - "Aho, Sethi, and Ullman") - in - (let an_article : Article <- - (new Article).initArticle("The Top 100 CD_ROMs", - "Ulanoff", - "PC Magazine") - in - { - books <- (new Nil).cons(a_book).cons(an_article); - books.print_list(); - } - ) -- end let an_article - ) -- end let a_book + y_value() : Int { + y }; }; diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 2070583e..7c1107c2 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -1,7 +1,14 @@ from pickle import TRUE from abstract.semantics import Type -from cil.nodes import AbortNode, AllocateBoolNode, ConcatString, JumpIfGreater, LocalNode -from mips.arithmetic import ADD, ADDU, DIV, MUL, NOR, SUB, SUBU +from cil.nodes import ( + AbortNode, + AllocateBoolNode, + BitwiseNotNode, + ConcatString, + JumpIfGreater, + LocalNode, +) +from mips.arithmetic import ADD, ADDU, DIV, MUL, NOR, NOT, SUB, SUBU from mips.baseMipsVisitor import ( BaseCilToMipsVisitor, DotDataDirective, @@ -327,7 +334,8 @@ def _(self, node: cil.SetAttributeNode): source = self.visit(node.source) reg = self.get_available_register() - assert reg is not None and source is not None + assert reg is not None + assert source is not None # Cargar el valor de source en un registro temporal # y luego moverlo a la direccion de memoria del @@ -608,6 +616,23 @@ def _(self, node: cil.UnconditionalJump): self.add_source_line_comment(node) self.register_instruction(branchNodes.J(node.label)) + @visit.register + def _(self, node: BitwiseNotNode): + dest = self.visit(node.dest) + src = self.visit(node.src) + + reg = self.get_available_register() + + assert reg is not None + assert src is not None + assert dest is not None + + self.register_instruction(LW(reg, src)) + self.register_instruction(NOT(reg, reg)) + self.register_instruction(SW(reg, dest)) + + self.used_registers[reg] = False + @visit.register def _(self, node: cil.NotNode): self.add_source_line_comment(node) @@ -1024,7 +1049,80 @@ def _(self, node: AbortNode): @visit.register def _(self, node: cil.ReadNode): - pass + dest = self.visit(node.dest) + + assert dest is not None + size = 1024 # Max string length in COOL + reg = self.get_available_register() + reg2 = self.get_available_register() + length = self.get_available_register() + temp = self.get_available_register() + assert reg is not None + assert length is not None + assert temp is not None + assert reg2 is not None + + # Declarar un buffer para el string + self.allocate_memory(size) + self.register_instruction(MOVE(reg, v0)) + + # Mover la direccion del buffer a0 + self.register_instruction(MOVE(a0, v0)) + # declarar el espacio disponible en el buffer + self.register_instruction(LI(a1, size)) + # syscall 8 = read_int + self.register_instruction(LI(v0, 8)) + self.register_instruction(SYSCALL()) + + # reg contiene el string. + # Crear la instancia del tipo string. + # Primero calcular el length del string + self.register_instruction(MOVE(length, zero)) + self.register_instruction(MOVE(temp, zero)) + self.register_instruction(MOVE(reg2, reg)) + self.register_instruction(Label("read_length_loop")) + # while [reg2] != 0: length ++ + self.register_instruction(LB(temp, f"0(${REG_TO_STR[reg2]})")) + self.register_instruction(BEQZ(temp, "end_read_length_loop")) + self.register_instruction(ADDU(reg2, reg2, 1, True)) + self.register_instruction(ADDU(length, length, 1, True)) + self.register_instruction(J("read_length_loop")) + self.register_instruction(Label("end_read_length_loop")) + + # length contiene el length del string + # Crear la instancia + + size = 20 + + # Reservar memoria para el tipo + self.allocate_memory(size) + + self.comment("Allocating string") + + # Inicializar la instancia + self.register_instruction(LA(reg2, "String")) + self.register_instruction(SW(reg2, "0($v0)")) + + self.register_instruction(LA(reg2, "String_start")) + self.register_instruction(SW(reg2, "4($v0)")) + + # Cargar el offset del tipo + self.comment("Load type offset") + offset = next(i for i, t in enumerate(self.mips_types) if t == "String") * 4 + self.register_instruction(LI(reg2, offset)) + self.register_instruction(SW(reg2, "8($v0)")) + + self.register_instruction(SW(reg, "12($v0)")) + + self.register_instruction(SW(length, "16($v0)")) + + # devolver la instancia + self.register_instruction(SW(v0, dest)) + + self.used_registers[reg] = False + self.used_registers[reg2] = False + self.used_registers[temp] = False + self.used_registers[length] = False @visit.register def _(self, node: cil.TypeName): diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index f00c5e71..a018ad99 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -1,5 +1,5 @@ from abstract.semantics import Type -from abstract.tree import EqualToNode, IsVoidNode, SelfNode +from abstract.tree import EqualToNode, IsVoidNode, NotNode, SelfNode import cil.baseCilVisitor as baseCilVisitor import abstract.tree as coolAst import abstract.semantics as semantics @@ -14,7 +14,7 @@ AllocateNode, AllocateStringNode, ArgNode, - AssignNode, + AssignNode, BitwiseNotNode, CilNode, CilProgramNode, ConcatString, @@ -32,7 +32,6 @@ LoadNode, LocalNode, MinusNode, - NotNode, NotZeroJump, ParamNode, PlusNode, @@ -239,10 +238,11 @@ def _(self, node: coolAst.MethodDef, scope: Scope) -> None: # ************** @visit.register - def _(self, node: coolAst.IfThenElseNode, scope: Scope) -> None: # noqa: F811 + def _(self, node: coolAst.IfThenElseNode, scope: Scope): # noqa: F811 # Crear un LABEL al cual realizar un salto. - false_label = self.do_label("FALSE") - end_label = self.do_label("END") + false_label = self.do_label("FALSEIF") + end_label = self.do_label("ENDIF") + return_expr = self.define_internal_local() # Salvar las instrucciones relacionadas con la condicion, # cada expresion retorna el nombre de la variable interna que contiene el valor ?? @@ -253,16 +253,20 @@ def _(self, node: coolAst.IfThenElseNode, scope: Scope) -> None: # noqa: F811 self.register_instruction(IfZeroJump(internal_cond_vm_holder, false_label)) # Salvar las instrucciones relacionadas con la rama TRUE. - self.visit(node.expr1, scope) + expr = self.visit(node.expr1, scope) + self.register_instruction(AssignNode(return_expr, expr)) self.register_instruction(UnconditionalJump(end_label)) # Registrar las instrucciones relacionadas con la rama ELSE self.register_instruction(LabelNode(false_label)) - self.visit(node.expr2, scope) + expr2 = self.visit(node.expr2, scope) + self.register_instruction(AssignNode(return_expr, expr2)) self.register_instruction(LabelNode(end_label)) + return return_expr + @visit.register def _(self, node: coolAst.VariableDeclaration, scope: Scope) -> CilNode: scope = scope.children[0] @@ -867,6 +871,13 @@ def _(self, node: IsVoidNode, scope: Scope): self.register_instruction(LabelNode(end_label)) return return_bool_vm_holder + @visit.register + def _(self, node: NotNode, scope: Scope): + expr = self.define_internal_local() + result = self.visit(node.lex, scope) + self.register_instruction(BitwiseNotNode(result, expr)) + return expr + class CilDisplayFormatter: @singledispatchmethod diff --git a/tests/codegen/atoi.mips b/tests/codegen/atoi.mips index ba2fe0f3..e851a289 100644 --- a/tests/codegen/atoi.mips +++ b/tests/codegen/atoi.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 17:36:48 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:22 2020 # School of Math and Computer Science, University of Havana # @@ -249,17 +249,52 @@ function_in_string_at_IO: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END # function_out_int_at_IO implementation. @@ -423,7 +458,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -657,11 +692,11 @@ entry: # 0($fp) = param_c2i_at_A2I_char_0 function_c2i_at_A2I: # Allocate stack frame for function function_c2i_at_A2I. - subu $sp, $sp, 100 + subu $sp, $sp, 140 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 100 - # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) + addu $fp, $sp, 140 + # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -678,39 +713,43 @@ function_c2i_at_A2I: sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) - sw $v0, -8($fp) - # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + sw $v0, -12($fp) # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) - # local_c2i_at_A2I_internal_0 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_1 + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) + # local_c2i_at_A2I_internal_1 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_2 lw $t1, 0($fp) - lw $t2, -8($fp) + lw $t2, -12($fp) sub $t1, $t1, $t2 - sw $t1, -4($fp) - # IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_TRUE_3 - # IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_TRUE_3 - lw $t1, -4($fp) + sw $t1, -8($fp) + # IF_ZERO local_c2i_at_A2I_internal_1 GOTO label_TRUE_3 + # IF_ZERO local_c2i_at_A2I_internal_1 GOTO label_TRUE_3 + lw $t1, -8($fp) beq $t1, 0, label_TRUE_3 - # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) - # local_c2i_at_A2I_internal_0 = 0 + # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) + # local_c2i_at_A2I_internal_1 = 0 li $t1, 0 - sw $t1, -4($fp) + sw $t1, -8($fp) # GOTO label_END_4 j label_END_4 label_TRUE_3: - # LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) - # local_c2i_at_A2I_internal_0 = 1 + # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) + # local_c2i_at_A2I_internal_1 = 1 li $t1, 1 - sw $t1, -4($fp) + sw $t1, -8($fp) label_END_4: -# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSE_1 -# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSE_1 -lw $t1, -4($fp) -beq $t1, 0, label_FALSE_1 -# GOTO label_END_2 -j label_END_2 -label_FALSE_1: - # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) +# IF_ZERO local_c2i_at_A2I_internal_1 GOTO label_FALSEIF_1 +# IF_ZERO local_c2i_at_A2I_internal_1 GOTO label_FALSEIF_1 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_1 +# LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) +# local_c2i_at_A2I_internal_0 = 0 +li $t1, 0 +sw $t1, -4($fp) +# GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -727,39 +766,43 @@ label_FALSE_1: sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) - sw $v0, -16($fp) - # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) + sw $v0, -24($fp) + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) - # local_c2i_at_A2I_internal_2 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_3 + # LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) + # local_c2i_at_A2I_internal_4 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_5 lw $t1, 0($fp) - lw $t2, -16($fp) + lw $t2, -24($fp) sub $t1, $t1, $t2 - sw $t1, -12($fp) - # IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_TRUE_7 - # IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_TRUE_7 - lw $t1, -12($fp) + sw $t1, -20($fp) + # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_7 + # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_7 + lw $t1, -20($fp) beq $t1, 0, label_TRUE_7 - # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) - # local_c2i_at_A2I_internal_2 = 0 + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # local_c2i_at_A2I_internal_4 = 0 li $t1, 0 - sw $t1, -12($fp) + sw $t1, -20($fp) # GOTO label_END_8 j label_END_8 label_TRUE_7: - # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) - # local_c2i_at_A2I_internal_2 = 1 + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # local_c2i_at_A2I_internal_4 = 1 li $t1, 1 - sw $t1, -12($fp) + sw $t1, -20($fp) label_END_8: -# IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_FALSE_5 -# IF_ZERO local_c2i_at_A2I_internal_2 GOTO label_FALSE_5 -lw $t1, -12($fp) -beq $t1, 0, label_FALSE_5 -# GOTO label_END_6 -j label_END_6 -label_FALSE_5: - # LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) +# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSEIF_5 +# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSEIF_5 +lw $t1, -20($fp) +beq $t1, 0, label_FALSEIF_5 +# LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) +# local_c2i_at_A2I_internal_3 = 1 +li $t1, 1 +sw $t1, -16($fp) +# GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -776,39 +819,43 @@ label_FALSE_5: sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) - sw $v0, -24($fp) - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + sw $v0, -36($fp) + # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) - # local_c2i_at_A2I_internal_4 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_5 + # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) + # local_c2i_at_A2I_internal_7 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_8 lw $t1, 0($fp) - lw $t2, -24($fp) + lw $t2, -36($fp) sub $t1, $t1, $t2 - sw $t1, -20($fp) - # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_11 - # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_11 - lw $t1, -20($fp) + sw $t1, -32($fp) + # IF_ZERO local_c2i_at_A2I_internal_7 GOTO label_TRUE_11 + # IF_ZERO local_c2i_at_A2I_internal_7 GOTO label_TRUE_11 + lw $t1, -32($fp) beq $t1, 0, label_TRUE_11 - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - # local_c2i_at_A2I_internal_4 = 0 + # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) + # local_c2i_at_A2I_internal_7 = 0 li $t1, 0 - sw $t1, -20($fp) + sw $t1, -32($fp) # GOTO label_END_12 j label_END_12 label_TRUE_11: - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - # local_c2i_at_A2I_internal_4 = 1 + # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) + # local_c2i_at_A2I_internal_7 = 1 li $t1, 1 - sw $t1, -20($fp) + sw $t1, -32($fp) label_END_12: -# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_9 -# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_9 -lw $t1, -20($fp) -beq $t1, 0, label_FALSE_9 -# GOTO label_END_10 -j label_END_10 -label_FALSE_9: - # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) +# IF_ZERO local_c2i_at_A2I_internal_7 GOTO label_FALSEIF_9 +# IF_ZERO local_c2i_at_A2I_internal_7 GOTO label_FALSEIF_9 +lw $t1, -32($fp) +beq $t1, 0, label_FALSEIF_9 +# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) +# local_c2i_at_A2I_internal_6 = 2 +li $t1, 2 +sw $t1, -28($fp) +# GOTO label_ENDIF_10 +j label_ENDIF_10 +label_FALSEIF_9: + # LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -825,39 +872,43 @@ label_FALSE_9: sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) - sw $v0, -32($fp) - # LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) + sw $v0, -48($fp) + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) - # local_c2i_at_A2I_internal_6 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_7 + # LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) + # local_c2i_at_A2I_internal_10 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_11 lw $t1, 0($fp) - lw $t2, -32($fp) + lw $t2, -48($fp) sub $t1, $t1, $t2 - sw $t1, -28($fp) - # IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_TRUE_15 - # IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_TRUE_15 - lw $t1, -28($fp) + sw $t1, -44($fp) + # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_15 + # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_15 + lw $t1, -44($fp) beq $t1, 0, label_TRUE_15 - # LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) - # local_c2i_at_A2I_internal_6 = 0 + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # local_c2i_at_A2I_internal_10 = 0 li $t1, 0 - sw $t1, -28($fp) + sw $t1, -44($fp) # GOTO label_END_16 j label_END_16 label_TRUE_15: - # LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) - # local_c2i_at_A2I_internal_6 = 1 + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # local_c2i_at_A2I_internal_10 = 1 li $t1, 1 - sw $t1, -28($fp) + sw $t1, -44($fp) label_END_16: -# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSE_13 -# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSE_13 -lw $t1, -28($fp) -beq $t1, 0, label_FALSE_13 -# GOTO label_END_14 -j label_END_14 -label_FALSE_13: - # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) +# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSEIF_13 +# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSEIF_13 +lw $t1, -44($fp) +beq $t1, 0, label_FALSEIF_13 +# LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) +# local_c2i_at_A2I_internal_9 = 3 +li $t1, 3 +sw $t1, -40($fp) +# GOTO label_ENDIF_14 +j label_ENDIF_14 +label_FALSEIF_13: + # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -874,39 +925,43 @@ label_FALSE_13: sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) - sw $v0, -40($fp) - # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) + sw $v0, -60($fp) + # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) - # local_c2i_at_A2I_internal_8 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_9 + # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) + # local_c2i_at_A2I_internal_13 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_14 lw $t1, 0($fp) - lw $t2, -40($fp) + lw $t2, -60($fp) sub $t1, $t1, $t2 - sw $t1, -36($fp) - # IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_TRUE_19 - # IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_TRUE_19 - lw $t1, -36($fp) + sw $t1, -56($fp) + # IF_ZERO local_c2i_at_A2I_internal_13 GOTO label_TRUE_19 + # IF_ZERO local_c2i_at_A2I_internal_13 GOTO label_TRUE_19 + lw $t1, -56($fp) beq $t1, 0, label_TRUE_19 - # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) - # local_c2i_at_A2I_internal_8 = 0 + # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) + # local_c2i_at_A2I_internal_13 = 0 li $t1, 0 - sw $t1, -36($fp) + sw $t1, -56($fp) # GOTO label_END_20 j label_END_20 label_TRUE_19: - # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) - # local_c2i_at_A2I_internal_8 = 1 + # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) + # local_c2i_at_A2I_internal_13 = 1 li $t1, 1 - sw $t1, -36($fp) + sw $t1, -56($fp) label_END_20: -# IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_FALSE_17 -# IF_ZERO local_c2i_at_A2I_internal_8 GOTO label_FALSE_17 -lw $t1, -36($fp) -beq $t1, 0, label_FALSE_17 -# GOTO label_END_18 -j label_END_18 -label_FALSE_17: - # LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) +# IF_ZERO local_c2i_at_A2I_internal_13 GOTO label_FALSEIF_17 +# IF_ZERO local_c2i_at_A2I_internal_13 GOTO label_FALSEIF_17 +lw $t1, -56($fp) +beq $t1, 0, label_FALSEIF_17 +# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) +# local_c2i_at_A2I_internal_12 = 4 +li $t1, 4 +sw $t1, -52($fp) +# GOTO label_ENDIF_18 +j label_ENDIF_18 +label_FALSEIF_17: + # LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -923,39 +978,43 @@ label_FALSE_17: sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) - sw $v0, -48($fp) - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + sw $v0, -72($fp) + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) - # local_c2i_at_A2I_internal_10 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_11 + # LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) + # local_c2i_at_A2I_internal_16 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_17 lw $t1, 0($fp) - lw $t2, -48($fp) + lw $t2, -72($fp) sub $t1, $t1, $t2 - sw $t1, -44($fp) - # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_23 - # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_23 - lw $t1, -44($fp) + sw $t1, -68($fp) + # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_23 + # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_23 + lw $t1, -68($fp) beq $t1, 0, label_TRUE_23 - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - # local_c2i_at_A2I_internal_10 = 0 + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # local_c2i_at_A2I_internal_16 = 0 li $t1, 0 - sw $t1, -44($fp) + sw $t1, -68($fp) # GOTO label_END_24 j label_END_24 label_TRUE_23: - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - # local_c2i_at_A2I_internal_10 = 1 + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # local_c2i_at_A2I_internal_16 = 1 li $t1, 1 - sw $t1, -44($fp) + sw $t1, -68($fp) label_END_24: -# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_21 -# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_21 -lw $t1, -44($fp) -beq $t1, 0, label_FALSE_21 -# GOTO label_END_22 -j label_END_22 -label_FALSE_21: - # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) +# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSEIF_21 +# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSEIF_21 +lw $t1, -68($fp) +beq $t1, 0, label_FALSEIF_21 +# LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) +# local_c2i_at_A2I_internal_15 = 5 +li $t1, 5 +sw $t1, -64($fp) +# GOTO label_ENDIF_22 +j label_ENDIF_22 +label_FALSEIF_21: + # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -972,39 +1031,43 @@ label_FALSE_21: sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) - sw $v0, -56($fp) - # LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) + sw $v0, -84($fp) + # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) - # local_c2i_at_A2I_internal_12 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_13 + # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) + # local_c2i_at_A2I_internal_19 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_20 lw $t1, 0($fp) - lw $t2, -56($fp) + lw $t2, -84($fp) sub $t1, $t1, $t2 - sw $t1, -52($fp) - # IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_TRUE_27 - # IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_TRUE_27 - lw $t1, -52($fp) + sw $t1, -80($fp) + # IF_ZERO local_c2i_at_A2I_internal_19 GOTO label_TRUE_27 + # IF_ZERO local_c2i_at_A2I_internal_19 GOTO label_TRUE_27 + lw $t1, -80($fp) beq $t1, 0, label_TRUE_27 - # LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) - # local_c2i_at_A2I_internal_12 = 0 + # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) + # local_c2i_at_A2I_internal_19 = 0 li $t1, 0 - sw $t1, -52($fp) + sw $t1, -80($fp) # GOTO label_END_28 j label_END_28 label_TRUE_27: - # LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) - # local_c2i_at_A2I_internal_12 = 1 + # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) + # local_c2i_at_A2I_internal_19 = 1 li $t1, 1 - sw $t1, -52($fp) + sw $t1, -80($fp) label_END_28: -# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSE_25 -# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSE_25 -lw $t1, -52($fp) -beq $t1, 0, label_FALSE_25 -# GOTO label_END_26 -j label_END_26 -label_FALSE_25: - # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) +# IF_ZERO local_c2i_at_A2I_internal_19 GOTO label_FALSEIF_25 +# IF_ZERO local_c2i_at_A2I_internal_19 GOTO label_FALSEIF_25 +lw $t1, -80($fp) +beq $t1, 0, label_FALSEIF_25 +# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) +# local_c2i_at_A2I_internal_18 = 6 +li $t1, 6 +sw $t1, -76($fp) +# GOTO label_ENDIF_26 +j label_ENDIF_26 +label_FALSEIF_25: + # LOCAL local_c2i_at_A2I_internal_23 --> -96($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1021,39 +1084,43 @@ label_FALSE_25: sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) - sw $v0, -64($fp) - # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) + sw $v0, -96($fp) + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) - # local_c2i_at_A2I_internal_14 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_15 + # LOCAL local_c2i_at_A2I_internal_23 --> -96($fp) + # local_c2i_at_A2I_internal_22 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_23 lw $t1, 0($fp) - lw $t2, -64($fp) + lw $t2, -96($fp) sub $t1, $t1, $t2 - sw $t1, -60($fp) - # IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_TRUE_31 - # IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_TRUE_31 - lw $t1, -60($fp) + sw $t1, -92($fp) + # IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_TRUE_31 + # IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_TRUE_31 + lw $t1, -92($fp) beq $t1, 0, label_TRUE_31 - # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) - # local_c2i_at_A2I_internal_14 = 0 + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # local_c2i_at_A2I_internal_22 = 0 li $t1, 0 - sw $t1, -60($fp) + sw $t1, -92($fp) # GOTO label_END_32 j label_END_32 label_TRUE_31: - # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) - # local_c2i_at_A2I_internal_14 = 1 + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # local_c2i_at_A2I_internal_22 = 1 li $t1, 1 - sw $t1, -60($fp) + sw $t1, -92($fp) label_END_32: -# IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_FALSE_29 -# IF_ZERO local_c2i_at_A2I_internal_14 GOTO label_FALSE_29 -lw $t1, -60($fp) -beq $t1, 0, label_FALSE_29 -# GOTO label_END_30 -j label_END_30 -label_FALSE_29: - # LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) +# IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_FALSEIF_29 +# IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_FALSEIF_29 +lw $t1, -92($fp) +beq $t1, 0, label_FALSEIF_29 +# LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) +# local_c2i_at_A2I_internal_21 = 7 +li $t1, 7 +sw $t1, -88($fp) +# GOTO label_ENDIF_30 +j label_ENDIF_30 +label_FALSEIF_29: + # LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1070,39 +1137,43 @@ label_FALSE_29: sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) - sw $v0, -72($fp) - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + sw $v0, -108($fp) + # LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) - # local_c2i_at_A2I_internal_16 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_17 + # LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) + # local_c2i_at_A2I_internal_25 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_26 lw $t1, 0($fp) - lw $t2, -72($fp) + lw $t2, -108($fp) sub $t1, $t1, $t2 - sw $t1, -68($fp) - # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_35 - # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_35 - lw $t1, -68($fp) + sw $t1, -104($fp) + # IF_ZERO local_c2i_at_A2I_internal_25 GOTO label_TRUE_35 + # IF_ZERO local_c2i_at_A2I_internal_25 GOTO label_TRUE_35 + lw $t1, -104($fp) beq $t1, 0, label_TRUE_35 - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - # local_c2i_at_A2I_internal_16 = 0 + # LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) + # local_c2i_at_A2I_internal_25 = 0 li $t1, 0 - sw $t1, -68($fp) + sw $t1, -104($fp) # GOTO label_END_36 j label_END_36 label_TRUE_35: - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - # local_c2i_at_A2I_internal_16 = 1 + # LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) + # local_c2i_at_A2I_internal_25 = 1 li $t1, 1 - sw $t1, -68($fp) + sw $t1, -104($fp) label_END_36: -# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_33 -# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_33 -lw $t1, -68($fp) -beq $t1, 0, label_FALSE_33 -# GOTO label_END_34 -j label_END_34 -label_FALSE_33: - # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) +# IF_ZERO local_c2i_at_A2I_internal_25 GOTO label_FALSEIF_33 +# IF_ZERO local_c2i_at_A2I_internal_25 GOTO label_FALSEIF_33 +lw $t1, -104($fp) +beq $t1, 0, label_FALSEIF_33 +# LOCAL local_c2i_at_A2I_internal_24 --> -100($fp) +# local_c2i_at_A2I_internal_24 = 8 +li $t1, 8 +sw $t1, -100($fp) +# GOTO label_ENDIF_34 +j label_ENDIF_34 +label_FALSEIF_33: + # LOCAL local_c2i_at_A2I_internal_29 --> -120($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1119,54 +1190,58 @@ label_FALSE_33: sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) - sw $v0, -80($fp) - # LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) + sw $v0, -120($fp) + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) - # local_c2i_at_A2I_internal_18 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_19 + # LOCAL local_c2i_at_A2I_internal_29 --> -120($fp) + # local_c2i_at_A2I_internal_28 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_29 lw $t1, 0($fp) - lw $t2, -80($fp) + lw $t2, -120($fp) sub $t1, $t1, $t2 - sw $t1, -76($fp) - # IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_TRUE_39 - # IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_TRUE_39 - lw $t1, -76($fp) + sw $t1, -116($fp) + # IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_TRUE_39 + # IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_TRUE_39 + lw $t1, -116($fp) beq $t1, 0, label_TRUE_39 - # LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) - # local_c2i_at_A2I_internal_18 = 0 + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + # local_c2i_at_A2I_internal_28 = 0 li $t1, 0 - sw $t1, -76($fp) + sw $t1, -116($fp) # GOTO label_END_40 j label_END_40 label_TRUE_39: - # LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) - # local_c2i_at_A2I_internal_18 = 1 + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + # local_c2i_at_A2I_internal_28 = 1 li $t1, 1 - sw $t1, -76($fp) + sw $t1, -116($fp) label_END_40: -# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSE_37 -# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSE_37 -lw $t1, -76($fp) -beq $t1, 0, label_FALSE_37 -# GOTO label_END_38 -j label_END_38 -label_FALSE_37: - # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) - # local_c2i_at_A2I_internal_22 = SELF - sw $s1, -92($fp) - # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) - # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) - # local_c2i_at_A2I_internal_20 = local_c2i_at_A2I_internal_22 - lw $t1, -92($fp) - sw $t1, -84($fp) +# IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_FALSEIF_37 +# IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_FALSEIF_37 +lw $t1, -116($fp) +beq $t1, 0, label_FALSEIF_37 +# LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) +# local_c2i_at_A2I_internal_27 = 9 +li $t1, 9 +sw $t1, -112($fp) +# GOTO label_ENDIF_38 +j label_ENDIF_38 +label_FALSEIF_37: + # LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) + # local_c2i_at_A2I_internal_32 = SELF + sw $s1, -132($fp) + # LOCAL local_c2i_at_A2I_internal_30 --> -124($fp) + # LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) + # local_c2i_at_A2I_internal_30 = local_c2i_at_A2I_internal_32 + lw $t1, -132($fp) + sw $t1, -124($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) - # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) - # local_c2i_at_A2I_internal_21 = VCALL local_c2i_at_A2I_internal_20 abort + # LOCAL local_c2i_at_A2I_internal_30 --> -124($fp) + # LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) + # local_c2i_at_A2I_internal_31 = VCALL local_c2i_at_A2I_internal_30 abort # Save new self pointer in $s1 - lw $s1, -84($fp) + lw $s1, -124($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -1175,28 +1250,78 @@ label_FALSE_37: lw $t3, 0($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -88($fp) + sw $v0, -128($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - label_END_38: -label_END_34: -label_END_30: -label_END_26: -label_END_22: -label_END_18: -label_END_14: -label_END_10: -label_END_6: -label_END_2: -# RETURN + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # local_c2i_at_A2I_internal_27 = 0 + li $t1, 0 + sw $t1, -112($fp) + label_ENDIF_38: +# LOCAL local_c2i_at_A2I_internal_24 --> -100($fp) +# LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) +# local_c2i_at_A2I_internal_24 = local_c2i_at_A2I_internal_27 +lw $t1, -112($fp) +sw $t1, -100($fp) +label_ENDIF_34: +# LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) +# LOCAL local_c2i_at_A2I_internal_24 --> -100($fp) +# local_c2i_at_A2I_internal_21 = local_c2i_at_A2I_internal_24 +lw $t1, -100($fp) +sw $t1, -88($fp) +label_ENDIF_30: +# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) +# LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) +# local_c2i_at_A2I_internal_18 = local_c2i_at_A2I_internal_21 +lw $t1, -88($fp) +sw $t1, -76($fp) +label_ENDIF_26: +# LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) +# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) +# local_c2i_at_A2I_internal_15 = local_c2i_at_A2I_internal_18 +lw $t1, -76($fp) +sw $t1, -64($fp) +label_ENDIF_22: +# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) +# LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) +# local_c2i_at_A2I_internal_12 = local_c2i_at_A2I_internal_15 +lw $t1, -64($fp) +sw $t1, -52($fp) +label_ENDIF_18: +# LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) +# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) +# local_c2i_at_A2I_internal_9 = local_c2i_at_A2I_internal_12 +lw $t1, -52($fp) +sw $t1, -40($fp) +label_ENDIF_14: +# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) +# LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) +# local_c2i_at_A2I_internal_6 = local_c2i_at_A2I_internal_9 +lw $t1, -40($fp) +sw $t1, -28($fp) +label_ENDIF_10: +# LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) +# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) +# local_c2i_at_A2I_internal_3 = local_c2i_at_A2I_internal_6 +lw $t1, -28($fp) +sw $t1, -16($fp) +label_ENDIF_6: +# LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) +# LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) +# local_c2i_at_A2I_internal_0 = local_c2i_at_A2I_internal_3 +lw $t1, -16($fp) +sw $t1, -4($fp) +label_ENDIF_2: +# RETURN local_c2i_at_A2I_internal_0 +lw $v0, -4($fp) # Deallocate stack frame for function function_c2i_at_A2I. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 100 +addu $sp, $sp, 140 # Deallocate function args addu $sp, $sp, 4 jr $ra @@ -1208,37 +1333,37 @@ jr $ra # 0($fp) = param_i2c_at_A2I_i_0 function_i2c_at_A2I: # Allocate stack frame for function function_i2c_at_A2I. - subu $sp, $sp, 104 + subu $sp, $sp, 144 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 104 - # LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) + addu $fp, $sp, 144 + # LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_0 = PARAM param_i2c_at_A2I_i_0 - 0 + # local_i2c_at_A2I_internal_1 = PARAM param_i2c_at_A2I_i_0 - 0 lw $t1, 0($fp) sub $t1, $t1, 0 - sw $t1, -4($fp) - # IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_TRUE_43 - # IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_TRUE_43 - lw $t1, -4($fp) + sw $t1, -8($fp) + # IF_ZERO local_i2c_at_A2I_internal_1 GOTO label_TRUE_43 + # IF_ZERO local_i2c_at_A2I_internal_1 GOTO label_TRUE_43 + lw $t1, -8($fp) beq $t1, 0, label_TRUE_43 - # LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) - # local_i2c_at_A2I_internal_0 = 0 + # LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) + # local_i2c_at_A2I_internal_1 = 0 li $t1, 0 - sw $t1, -4($fp) + sw $t1, -8($fp) # GOTO label_END_44 j label_END_44 label_TRUE_43: - # LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) - # local_i2c_at_A2I_internal_0 = 1 + # LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) + # local_i2c_at_A2I_internal_1 = 1 li $t1, 1 - sw $t1, -4($fp) + sw $t1, -8($fp) label_END_44: -# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSE_41 -# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSE_41 -lw $t1, -4($fp) -beq $t1, 0, label_FALSE_41 -# LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) +# IF_ZERO local_i2c_at_A2I_internal_1 GOTO label_FALSEIF_41 +# IF_ZERO local_i2c_at_A2I_internal_1 GOTO label_FALSEIF_41 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_41 +# LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1255,37 +1380,42 @@ la $t1, data_12 sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) -sw $v0, -8($fp) -# GOTO label_END_42 -j label_END_42 -label_FALSE_41: - # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) +sw $v0, -12($fp) +# LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) +# local_i2c_at_A2I_internal_0 = local_i2c_at_A2I_internal_2 +lw $t1, -12($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_42 +j label_ENDIF_42 +label_FALSEIF_41: + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_2 = PARAM param_i2c_at_A2I_i_0 - 1 + # local_i2c_at_A2I_internal_4 = PARAM param_i2c_at_A2I_i_0 - 1 lw $t1, 0($fp) sub $t1, $t1, 1 - sw $t1, -12($fp) - # IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_TRUE_47 - # IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_TRUE_47 - lw $t1, -12($fp) + sw $t1, -20($fp) + # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_47 + # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_47 + lw $t1, -20($fp) beq $t1, 0, label_TRUE_47 - # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) - # local_i2c_at_A2I_internal_2 = 0 + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # local_i2c_at_A2I_internal_4 = 0 li $t1, 0 - sw $t1, -12($fp) + sw $t1, -20($fp) # GOTO label_END_48 j label_END_48 label_TRUE_47: - # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) - # local_i2c_at_A2I_internal_2 = 1 + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # local_i2c_at_A2I_internal_4 = 1 li $t1, 1 - sw $t1, -12($fp) + sw $t1, -20($fp) label_END_48: -# IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_FALSE_45 -# IF_ZERO local_i2c_at_A2I_internal_2 GOTO label_FALSE_45 -lw $t1, -12($fp) -beq $t1, 0, label_FALSE_45 -# LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) +# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSEIF_45 +# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSEIF_45 +lw $t1, -20($fp) +beq $t1, 0, label_FALSEIF_45 +# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1302,37 +1432,42 @@ la $t1, data_13 sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) -sw $v0, -16($fp) -# GOTO label_END_46 -j label_END_46 -label_FALSE_45: - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) +sw $v0, -24($fp) +# LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) +# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) +# local_i2c_at_A2I_internal_3 = local_i2c_at_A2I_internal_5 +lw $t1, -24($fp) +sw $t1, -16($fp) +# GOTO label_ENDIF_46 +j label_ENDIF_46 +label_FALSEIF_45: + # LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_4 = PARAM param_i2c_at_A2I_i_0 - 2 + # local_i2c_at_A2I_internal_7 = PARAM param_i2c_at_A2I_i_0 - 2 lw $t1, 0($fp) sub $t1, $t1, 2 - sw $t1, -20($fp) - # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_51 - # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_51 - lw $t1, -20($fp) + sw $t1, -32($fp) + # IF_ZERO local_i2c_at_A2I_internal_7 GOTO label_TRUE_51 + # IF_ZERO local_i2c_at_A2I_internal_7 GOTO label_TRUE_51 + lw $t1, -32($fp) beq $t1, 0, label_TRUE_51 - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - # local_i2c_at_A2I_internal_4 = 0 + # LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) + # local_i2c_at_A2I_internal_7 = 0 li $t1, 0 - sw $t1, -20($fp) + sw $t1, -32($fp) # GOTO label_END_52 j label_END_52 label_TRUE_51: - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - # local_i2c_at_A2I_internal_4 = 1 + # LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) + # local_i2c_at_A2I_internal_7 = 1 li $t1, 1 - sw $t1, -20($fp) + sw $t1, -32($fp) label_END_52: -# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_49 -# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_49 -lw $t1, -20($fp) -beq $t1, 0, label_FALSE_49 -# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) +# IF_ZERO local_i2c_at_A2I_internal_7 GOTO label_FALSEIF_49 +# IF_ZERO local_i2c_at_A2I_internal_7 GOTO label_FALSEIF_49 +lw $t1, -32($fp) +beq $t1, 0, label_FALSEIF_49 +# LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1349,37 +1484,42 @@ la $t1, data_14 sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) -sw $v0, -24($fp) -# GOTO label_END_50 -j label_END_50 -label_FALSE_49: - # LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) +sw $v0, -36($fp) +# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) +# LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) +# local_i2c_at_A2I_internal_6 = local_i2c_at_A2I_internal_8 +lw $t1, -36($fp) +sw $t1, -28($fp) +# GOTO label_ENDIF_50 +j label_ENDIF_50 +label_FALSEIF_49: + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_6 = PARAM param_i2c_at_A2I_i_0 - 3 + # local_i2c_at_A2I_internal_10 = PARAM param_i2c_at_A2I_i_0 - 3 lw $t1, 0($fp) sub $t1, $t1, 3 - sw $t1, -28($fp) - # IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_TRUE_55 - # IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_TRUE_55 - lw $t1, -28($fp) + sw $t1, -44($fp) + # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_55 + # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_55 + lw $t1, -44($fp) beq $t1, 0, label_TRUE_55 - # LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) - # local_i2c_at_A2I_internal_6 = 0 + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # local_i2c_at_A2I_internal_10 = 0 li $t1, 0 - sw $t1, -28($fp) + sw $t1, -44($fp) # GOTO label_END_56 j label_END_56 label_TRUE_55: - # LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) - # local_i2c_at_A2I_internal_6 = 1 + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # local_i2c_at_A2I_internal_10 = 1 li $t1, 1 - sw $t1, -28($fp) + sw $t1, -44($fp) label_END_56: -# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSE_53 -# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSE_53 -lw $t1, -28($fp) -beq $t1, 0, label_FALSE_53 -# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) +# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSEIF_53 +# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSEIF_53 +lw $t1, -44($fp) +beq $t1, 0, label_FALSEIF_53 +# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1396,37 +1536,42 @@ la $t1, data_15 sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) -sw $v0, -32($fp) -# GOTO label_END_54 -j label_END_54 -label_FALSE_53: - # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) +sw $v0, -48($fp) +# LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) +# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) +# local_i2c_at_A2I_internal_9 = local_i2c_at_A2I_internal_11 +lw $t1, -48($fp) +sw $t1, -40($fp) +# GOTO label_ENDIF_54 +j label_ENDIF_54 +label_FALSEIF_53: + # LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_8 = PARAM param_i2c_at_A2I_i_0 - 4 + # local_i2c_at_A2I_internal_13 = PARAM param_i2c_at_A2I_i_0 - 4 lw $t1, 0($fp) sub $t1, $t1, 4 - sw $t1, -36($fp) - # IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_TRUE_59 - # IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_TRUE_59 - lw $t1, -36($fp) + sw $t1, -56($fp) + # IF_ZERO local_i2c_at_A2I_internal_13 GOTO label_TRUE_59 + # IF_ZERO local_i2c_at_A2I_internal_13 GOTO label_TRUE_59 + lw $t1, -56($fp) beq $t1, 0, label_TRUE_59 - # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) - # local_i2c_at_A2I_internal_8 = 0 + # LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) + # local_i2c_at_A2I_internal_13 = 0 li $t1, 0 - sw $t1, -36($fp) + sw $t1, -56($fp) # GOTO label_END_60 j label_END_60 label_TRUE_59: - # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) - # local_i2c_at_A2I_internal_8 = 1 + # LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) + # local_i2c_at_A2I_internal_13 = 1 li $t1, 1 - sw $t1, -36($fp) + sw $t1, -56($fp) label_END_60: -# IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_FALSE_57 -# IF_ZERO local_i2c_at_A2I_internal_8 GOTO label_FALSE_57 -lw $t1, -36($fp) -beq $t1, 0, label_FALSE_57 -# LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) +# IF_ZERO local_i2c_at_A2I_internal_13 GOTO label_FALSEIF_57 +# IF_ZERO local_i2c_at_A2I_internal_13 GOTO label_FALSEIF_57 +lw $t1, -56($fp) +beq $t1, 0, label_FALSEIF_57 +# LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1443,37 +1588,42 @@ la $t1, data_16 sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) -sw $v0, -40($fp) -# GOTO label_END_58 -j label_END_58 -label_FALSE_57: - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) +sw $v0, -60($fp) +# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) +# LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) +# local_i2c_at_A2I_internal_12 = local_i2c_at_A2I_internal_14 +lw $t1, -60($fp) +sw $t1, -52($fp) +# GOTO label_ENDIF_58 +j label_ENDIF_58 +label_FALSEIF_57: + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_10 = PARAM param_i2c_at_A2I_i_0 - 5 + # local_i2c_at_A2I_internal_16 = PARAM param_i2c_at_A2I_i_0 - 5 lw $t1, 0($fp) sub $t1, $t1, 5 - sw $t1, -44($fp) - # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_63 - # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_63 - lw $t1, -44($fp) + sw $t1, -68($fp) + # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_63 + # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_63 + lw $t1, -68($fp) beq $t1, 0, label_TRUE_63 - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - # local_i2c_at_A2I_internal_10 = 0 + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # local_i2c_at_A2I_internal_16 = 0 li $t1, 0 - sw $t1, -44($fp) + sw $t1, -68($fp) # GOTO label_END_64 j label_END_64 label_TRUE_63: - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - # local_i2c_at_A2I_internal_10 = 1 + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # local_i2c_at_A2I_internal_16 = 1 li $t1, 1 - sw $t1, -44($fp) + sw $t1, -68($fp) label_END_64: -# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_61 -# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_61 -lw $t1, -44($fp) -beq $t1, 0, label_FALSE_61 -# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) +# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSEIF_61 +# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSEIF_61 +lw $t1, -68($fp) +beq $t1, 0, label_FALSEIF_61 +# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1490,37 +1640,42 @@ la $t1, data_17 sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) -sw $v0, -48($fp) -# GOTO label_END_62 -j label_END_62 -label_FALSE_61: - # LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) +sw $v0, -72($fp) +# LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) +# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) +# local_i2c_at_A2I_internal_15 = local_i2c_at_A2I_internal_17 +lw $t1, -72($fp) +sw $t1, -64($fp) +# GOTO label_ENDIF_62 +j label_ENDIF_62 +label_FALSEIF_61: + # LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_12 = PARAM param_i2c_at_A2I_i_0 - 6 + # local_i2c_at_A2I_internal_19 = PARAM param_i2c_at_A2I_i_0 - 6 lw $t1, 0($fp) sub $t1, $t1, 6 - sw $t1, -52($fp) - # IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_TRUE_67 - # IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_TRUE_67 - lw $t1, -52($fp) + sw $t1, -80($fp) + # IF_ZERO local_i2c_at_A2I_internal_19 GOTO label_TRUE_67 + # IF_ZERO local_i2c_at_A2I_internal_19 GOTO label_TRUE_67 + lw $t1, -80($fp) beq $t1, 0, label_TRUE_67 - # LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) - # local_i2c_at_A2I_internal_12 = 0 + # LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) + # local_i2c_at_A2I_internal_19 = 0 li $t1, 0 - sw $t1, -52($fp) + sw $t1, -80($fp) # GOTO label_END_68 j label_END_68 label_TRUE_67: - # LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) - # local_i2c_at_A2I_internal_12 = 1 + # LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) + # local_i2c_at_A2I_internal_19 = 1 li $t1, 1 - sw $t1, -52($fp) + sw $t1, -80($fp) label_END_68: -# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSE_65 -# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSE_65 -lw $t1, -52($fp) -beq $t1, 0, label_FALSE_65 -# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) +# IF_ZERO local_i2c_at_A2I_internal_19 GOTO label_FALSEIF_65 +# IF_ZERO local_i2c_at_A2I_internal_19 GOTO label_FALSEIF_65 +lw $t1, -80($fp) +beq $t1, 0, label_FALSEIF_65 +# LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1537,37 +1692,42 @@ la $t1, data_18 sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) -sw $v0, -56($fp) -# GOTO label_END_66 -j label_END_66 -label_FALSE_65: - # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) +sw $v0, -84($fp) +# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) +# LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) +# local_i2c_at_A2I_internal_18 = local_i2c_at_A2I_internal_20 +lw $t1, -84($fp) +sw $t1, -76($fp) +# GOTO label_ENDIF_66 +j label_ENDIF_66 +label_FALSEIF_65: + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_14 = PARAM param_i2c_at_A2I_i_0 - 7 + # local_i2c_at_A2I_internal_22 = PARAM param_i2c_at_A2I_i_0 - 7 lw $t1, 0($fp) sub $t1, $t1, 7 - sw $t1, -60($fp) - # IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_TRUE_71 - # IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_TRUE_71 - lw $t1, -60($fp) + sw $t1, -92($fp) + # IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_TRUE_71 + # IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_TRUE_71 + lw $t1, -92($fp) beq $t1, 0, label_TRUE_71 - # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) - # local_i2c_at_A2I_internal_14 = 0 + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # local_i2c_at_A2I_internal_22 = 0 li $t1, 0 - sw $t1, -60($fp) + sw $t1, -92($fp) # GOTO label_END_72 j label_END_72 label_TRUE_71: - # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) - # local_i2c_at_A2I_internal_14 = 1 + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # local_i2c_at_A2I_internal_22 = 1 li $t1, 1 - sw $t1, -60($fp) + sw $t1, -92($fp) label_END_72: -# IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_FALSE_69 -# IF_ZERO local_i2c_at_A2I_internal_14 GOTO label_FALSE_69 -lw $t1, -60($fp) -beq $t1, 0, label_FALSE_69 -# LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) +# IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_FALSEIF_69 +# IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_FALSEIF_69 +lw $t1, -92($fp) +beq $t1, 0, label_FALSEIF_69 +# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1584,37 +1744,42 @@ la $t1, data_19 sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) -sw $v0, -64($fp) -# GOTO label_END_70 -j label_END_70 -label_FALSE_69: - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) +sw $v0, -96($fp) +# LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) +# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) +# local_i2c_at_A2I_internal_21 = local_i2c_at_A2I_internal_23 +lw $t1, -96($fp) +sw $t1, -88($fp) +# GOTO label_ENDIF_70 +j label_ENDIF_70 +label_FALSEIF_69: + # LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_16 = PARAM param_i2c_at_A2I_i_0 - 8 + # local_i2c_at_A2I_internal_25 = PARAM param_i2c_at_A2I_i_0 - 8 lw $t1, 0($fp) sub $t1, $t1, 8 - sw $t1, -68($fp) - # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_75 - # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_75 - lw $t1, -68($fp) + sw $t1, -104($fp) + # IF_ZERO local_i2c_at_A2I_internal_25 GOTO label_TRUE_75 + # IF_ZERO local_i2c_at_A2I_internal_25 GOTO label_TRUE_75 + lw $t1, -104($fp) beq $t1, 0, label_TRUE_75 - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - # local_i2c_at_A2I_internal_16 = 0 + # LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) + # local_i2c_at_A2I_internal_25 = 0 li $t1, 0 - sw $t1, -68($fp) + sw $t1, -104($fp) # GOTO label_END_76 j label_END_76 label_TRUE_75: - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - # local_i2c_at_A2I_internal_16 = 1 + # LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) + # local_i2c_at_A2I_internal_25 = 1 li $t1, 1 - sw $t1, -68($fp) + sw $t1, -104($fp) label_END_76: -# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_73 -# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_73 -lw $t1, -68($fp) -beq $t1, 0, label_FALSE_73 -# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) +# IF_ZERO local_i2c_at_A2I_internal_25 GOTO label_FALSEIF_73 +# IF_ZERO local_i2c_at_A2I_internal_25 GOTO label_FALSEIF_73 +lw $t1, -104($fp) +beq $t1, 0, label_FALSEIF_73 +# LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1631,37 +1796,42 @@ la $t1, data_20 sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) -sw $v0, -72($fp) -# GOTO label_END_74 -j label_END_74 -label_FALSE_73: - # LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) +sw $v0, -108($fp) +# LOCAL local_i2c_at_A2I_internal_24 --> -100($fp) +# LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) +# local_i2c_at_A2I_internal_24 = local_i2c_at_A2I_internal_26 +lw $t1, -108($fp) +sw $t1, -100($fp) +# GOTO label_ENDIF_74 +j label_ENDIF_74 +label_FALSEIF_73: + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_18 = PARAM param_i2c_at_A2I_i_0 - 9 + # local_i2c_at_A2I_internal_28 = PARAM param_i2c_at_A2I_i_0 - 9 lw $t1, 0($fp) sub $t1, $t1, 9 - sw $t1, -76($fp) - # IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_TRUE_79 - # IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_TRUE_79 - lw $t1, -76($fp) + sw $t1, -116($fp) + # IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_TRUE_79 + # IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_TRUE_79 + lw $t1, -116($fp) beq $t1, 0, label_TRUE_79 - # LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) - # local_i2c_at_A2I_internal_18 = 0 + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + # local_i2c_at_A2I_internal_28 = 0 li $t1, 0 - sw $t1, -76($fp) + sw $t1, -116($fp) # GOTO label_END_80 j label_END_80 label_TRUE_79: - # LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) - # local_i2c_at_A2I_internal_18 = 1 + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + # local_i2c_at_A2I_internal_28 = 1 li $t1, 1 - sw $t1, -76($fp) + sw $t1, -116($fp) label_END_80: -# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSE_77 -# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSE_77 -lw $t1, -76($fp) -beq $t1, 0, label_FALSE_77 -# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) +# IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_FALSEIF_77 +# IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_FALSEIF_77 +lw $t1, -116($fp) +beq $t1, 0, label_FALSEIF_77 +# LOCAL local_i2c_at_A2I_internal_29 --> -120($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1678,26 +1848,31 @@ la $t1, data_21 sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) -sw $v0, -80($fp) -# GOTO label_END_78 -j label_END_78 -label_FALSE_77: - # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) - # local_i2c_at_A2I_internal_22 = SELF - sw $s1, -92($fp) - # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) - # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) - # local_i2c_at_A2I_internal_20 = local_i2c_at_A2I_internal_22 - lw $t1, -92($fp) - sw $t1, -84($fp) +sw $v0, -120($fp) +# LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) +# LOCAL local_i2c_at_A2I_internal_29 --> -120($fp) +# local_i2c_at_A2I_internal_27 = local_i2c_at_A2I_internal_29 +lw $t1, -120($fp) +sw $t1, -112($fp) +# GOTO label_ENDIF_78 +j label_ENDIF_78 +label_FALSEIF_77: + # LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) + # local_i2c_at_A2I_internal_32 = SELF + sw $s1, -132($fp) + # LOCAL local_i2c_at_A2I_internal_30 --> -124($fp) + # LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) + # local_i2c_at_A2I_internal_30 = local_i2c_at_A2I_internal_32 + lw $t1, -132($fp) + sw $t1, -124($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) - # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) - # local_i2c_at_A2I_internal_21 = VCALL local_i2c_at_A2I_internal_20 abort + # LOCAL local_i2c_at_A2I_internal_30 --> -124($fp) + # LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) + # local_i2c_at_A2I_internal_31 = VCALL local_i2c_at_A2I_internal_30 abort # Save new self pointer in $s1 - lw $s1, -84($fp) + lw $s1, -124($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -1706,11 +1881,11 @@ label_FALSE_77: lw $t3, 0($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -88($fp) + sw $v0, -128($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1727,25 +1902,76 @@ label_FALSE_77: sw $t1, 12($v0) li $t1, 0 sw $t1, 16($v0) - sw $v0, -96($fp) - label_END_78: -label_END_74: -label_END_70: -label_END_66: -label_END_62: -label_END_58: -label_END_54: -label_END_50: -label_END_46: -label_END_42: -# RETURN + sw $v0, -136($fp) + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # local_i2c_at_A2I_internal_27 = local_i2c_at_A2I_internal_33 + lw $t1, -136($fp) + sw $t1, -112($fp) + label_ENDIF_78: +# LOCAL local_i2c_at_A2I_internal_24 --> -100($fp) +# LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) +# local_i2c_at_A2I_internal_24 = local_i2c_at_A2I_internal_27 +lw $t1, -112($fp) +sw $t1, -100($fp) +label_ENDIF_74: +# LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) +# LOCAL local_i2c_at_A2I_internal_24 --> -100($fp) +# local_i2c_at_A2I_internal_21 = local_i2c_at_A2I_internal_24 +lw $t1, -100($fp) +sw $t1, -88($fp) +label_ENDIF_70: +# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) +# LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) +# local_i2c_at_A2I_internal_18 = local_i2c_at_A2I_internal_21 +lw $t1, -88($fp) +sw $t1, -76($fp) +label_ENDIF_66: +# LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) +# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) +# local_i2c_at_A2I_internal_15 = local_i2c_at_A2I_internal_18 +lw $t1, -76($fp) +sw $t1, -64($fp) +label_ENDIF_62: +# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) +# LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) +# local_i2c_at_A2I_internal_12 = local_i2c_at_A2I_internal_15 +lw $t1, -64($fp) +sw $t1, -52($fp) +label_ENDIF_58: +# LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) +# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) +# local_i2c_at_A2I_internal_9 = local_i2c_at_A2I_internal_12 +lw $t1, -52($fp) +sw $t1, -40($fp) +label_ENDIF_54: +# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) +# LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) +# local_i2c_at_A2I_internal_6 = local_i2c_at_A2I_internal_9 +lw $t1, -40($fp) +sw $t1, -28($fp) +label_ENDIF_50: +# LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) +# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) +# local_i2c_at_A2I_internal_3 = local_i2c_at_A2I_internal_6 +lw $t1, -28($fp) +sw $t1, -16($fp) +label_ENDIF_46: +# LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) +# local_i2c_at_A2I_internal_0 = local_i2c_at_A2I_internal_3 +lw $t1, -16($fp) +sw $t1, -4($fp) +label_ENDIF_42: +# RETURN local_i2c_at_A2I_internal_0 +lw $v0, -4($fp) # Deallocate stack frame for function function_i2c_at_A2I. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 104 +addu $sp, $sp, 144 # Deallocate function args addu $sp, $sp, 4 jr $ra @@ -1757,23 +1983,23 @@ jr $ra # 0($fp) = param_a2i_at_A2I_s_0 function_a2i_at_A2I: # Allocate stack frame for function function_a2i_at_A2I. - subu $sp, $sp, 96 + subu $sp, $sp, 144 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 96 - # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) + addu $fp, $sp, 144 + # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - # local_a2i_at_A2I_internal_1 = PARAM param_a2i_at_A2I_s_0 + # local_a2i_at_A2I_internal_2 = PARAM param_a2i_at_A2I_s_0 lw $t1, 0($fp) - sw $t1, -8($fp) + sw $t1, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) - # local_a2i_at_A2I_internal_2 = VCALL local_a2i_at_A2I_internal_1 length + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # local_a2i_at_A2I_internal_3 = VCALL local_a2i_at_A2I_internal_2 length # Save new self pointer in $s1 - lw $s1, -8($fp) + lw $s1, -12($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -1782,44 +2008,48 @@ function_a2i_at_A2I: lw $t3, 8($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -12($fp) + sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) - # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) - # local_a2i_at_A2I_internal_0 = local_a2i_at_A2I_internal_2 - 0 - lw $t1, -12($fp) + # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # local_a2i_at_A2I_internal_1 = local_a2i_at_A2I_internal_3 - 0 + lw $t1, -16($fp) sub $t1, $t1, 0 - sw $t1, -4($fp) - # IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_TRUE_83 - # IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_TRUE_83 - lw $t1, -4($fp) + sw $t1, -8($fp) + # IF_ZERO local_a2i_at_A2I_internal_1 GOTO label_TRUE_83 + # IF_ZERO local_a2i_at_A2I_internal_1 GOTO label_TRUE_83 + lw $t1, -8($fp) beq $t1, 0, label_TRUE_83 - # LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) - # local_a2i_at_A2I_internal_0 = 0 + # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) + # local_a2i_at_A2I_internal_1 = 0 li $t1, 0 - sw $t1, -4($fp) + sw $t1, -8($fp) # GOTO label_END_84 j label_END_84 label_TRUE_83: - # LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) - # local_a2i_at_A2I_internal_0 = 1 + # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) + # local_a2i_at_A2I_internal_1 = 1 li $t1, 1 - sw $t1, -4($fp) + sw $t1, -8($fp) label_END_84: -# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSE_81 -# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSE_81 -lw $t1, -4($fp) -beq $t1, 0, label_FALSE_81 -# GOTO label_END_82 -j label_END_82 -label_FALSE_81: - # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) +# IF_ZERO local_a2i_at_A2I_internal_1 GOTO label_FALSEIF_81 +# IF_ZERO local_a2i_at_A2I_internal_1 GOTO label_FALSEIF_81 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_81 +# LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) +# local_a2i_at_A2I_internal_0 = 0 +li $t1, 0 +sw $t1, -4($fp) +# GOTO label_ENDIF_82 +j label_ENDIF_82 +label_FALSEIF_81: + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - # local_a2i_at_A2I_internal_4 = PARAM param_a2i_at_A2I_s_0 + # local_a2i_at_A2I_internal_6 = PARAM param_a2i_at_A2I_s_0 lw $t1, 0($fp) - sw $t1, -20($fp) + sw $t1, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1833,11 +2063,11 @@ label_FALSE_81: # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # local_a2i_at_A2I_internal_5 = VCALL local_a2i_at_A2I_internal_4 substr + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) + # local_a2i_at_A2I_internal_7 = VCALL local_a2i_at_A2I_internal_6 substr # Save new self pointer in $s1 - lw $s1, -20($fp) + lw $s1, -28($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -1846,11 +2076,11 @@ label_FALSE_81: lw $t3, 4($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -24($fp) + sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + # LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1867,43 +2097,154 @@ label_FALSE_81: sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) - sw $v0, -28($fp) - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + sw $v0, -36($fp) # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) - # local_a2i_at_A2I_internal_3 = local_a2i_at_A2I_internal_5 - local_a2i_at_A2I_internal_6 - lw $t1, -24($fp) - lw $t2, -28($fp) + # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) + # LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) + # local_a2i_at_A2I_internal_5 = local_a2i_at_A2I_internal_7 - local_a2i_at_A2I_internal_8 + lw $t1, -32($fp) + lw $t2, -36($fp) sub $t1, $t1, $t2 - sw $t1, -16($fp) - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_87 - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_87 - lw $t1, -16($fp) + sw $t1, -24($fp) + # IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_TRUE_87 + # IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_TRUE_87 + lw $t1, -24($fp) beq $t1, 0, label_TRUE_87 - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # local_a2i_at_A2I_internal_3 = 0 + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # local_a2i_at_A2I_internal_5 = 0 li $t1, 0 - sw $t1, -16($fp) + sw $t1, -24($fp) # GOTO label_END_88 j label_END_88 label_TRUE_87: - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # local_a2i_at_A2I_internal_3 = 1 + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # local_a2i_at_A2I_internal_5 = 1 li $t1, 1 - sw $t1, -16($fp) + sw $t1, -24($fp) label_END_88: -# IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_FALSE_85 -# IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_FALSE_85 -lw $t1, -16($fp) -beq $t1, 0, label_FALSE_85 -# GOTO label_END_86 -j label_END_86 -label_FALSE_85: - # LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) +# IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_FALSEIF_85 +# IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_FALSEIF_85 +lw $t1, -24($fp) +beq $t1, 0, label_FALSEIF_85 +# LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) +# local_a2i_at_A2I_internal_12 = SELF +sw $s1, -52($fp) +# LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) +# LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) +# local_a2i_at_A2I_internal_10 = local_a2i_at_A2I_internal_12 +lw $t1, -52($fp) +sw $t1, -44($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_13 = PARAM param_a2i_at_A2I_s_0 +lw $t1, 0($fp) +sw $t1, -56($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG 1 +li $t1, 1 +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_16 = PARAM param_a2i_at_A2I_s_0 +lw $t1, 0($fp) +sw $t1, -68($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# local_a2i_at_A2I_internal_17 = VCALL local_a2i_at_A2I_internal_16 length +# Save new self pointer in $s1 +lw $s1, -68($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 8($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -72($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# local_a2i_at_A2I_internal_15 = local_a2i_at_A2I_internal_17 - 1 +lw $t1, -72($fp) +sub $t1, $t1, 1 +sw $t1, -64($fp) +# ARG local_a2i_at_A2I_internal_15 +# LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) +lw $t1, -64($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) +# LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) +# local_a2i_at_A2I_internal_14 = VCALL local_a2i_at_A2I_internal_13 substr +# Save new self pointer in $s1 +lw $s1, -56($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 4($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -60($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_at_A2I_internal_14 +# LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) +lw $t1, -60($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) +# LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) +# local_a2i_at_A2I_internal_11 = VCALL local_a2i_at_A2I_internal_10 a2i_aux +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 24($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) +# LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) +lw $t1, -48($fp) +not $t1, $t1 +sw $t1, -40($fp) +# LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) +# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) +# local_a2i_at_A2I_internal_4 = local_a2i_at_A2I_internal_9 +lw $t1, -40($fp) +sw $t1, -20($fp) +# GOTO label_ENDIF_86 +j label_ENDIF_86 +label_FALSEIF_85: + # LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - # local_a2i_at_A2I_internal_8 = PARAM param_a2i_at_A2I_s_0 + # local_a2i_at_A2I_internal_20 = PARAM param_a2i_at_A2I_s_0 lw $t1, 0($fp) - sw $t1, -36($fp) + sw $t1, -84($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1917,11 +2258,11 @@ label_FALSE_85: # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) - # LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) - # local_a2i_at_A2I_internal_9 = VCALL local_a2i_at_A2I_internal_8 substr + # LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) + # LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) + # local_a2i_at_A2I_internal_21 = VCALL local_a2i_at_A2I_internal_20 substr # Save new self pointer in $s1 - lw $s1, -36($fp) + lw $s1, -84($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -1930,11 +2271,11 @@ label_FALSE_85: lw $t3, 4($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -40($fp) + sw $v0, -88($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) + # LOCAL local_a2i_at_A2I_internal_22 --> -92($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1951,51 +2292,51 @@ label_FALSE_85: sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) - sw $v0, -44($fp) - # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) - # LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) - # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) - # local_a2i_at_A2I_internal_7 = local_a2i_at_A2I_internal_9 - local_a2i_at_A2I_internal_10 - lw $t1, -40($fp) - lw $t2, -44($fp) + sw $v0, -92($fp) + # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) + # LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) + # LOCAL local_a2i_at_A2I_internal_22 --> -92($fp) + # local_a2i_at_A2I_internal_19 = local_a2i_at_A2I_internal_21 - local_a2i_at_A2I_internal_22 + lw $t1, -88($fp) + lw $t2, -92($fp) sub $t1, $t1, $t2 - sw $t1, -32($fp) - # IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_TRUE_91 - # IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_TRUE_91 - lw $t1, -32($fp) + sw $t1, -80($fp) + # IF_ZERO local_a2i_at_A2I_internal_19 GOTO label_TRUE_91 + # IF_ZERO local_a2i_at_A2I_internal_19 GOTO label_TRUE_91 + lw $t1, -80($fp) beq $t1, 0, label_TRUE_91 - # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) - # local_a2i_at_A2I_internal_7 = 0 + # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) + # local_a2i_at_A2I_internal_19 = 0 li $t1, 0 - sw $t1, -32($fp) + sw $t1, -80($fp) # GOTO label_END_92 j label_END_92 label_TRUE_91: - # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) - # local_a2i_at_A2I_internal_7 = 1 + # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) + # local_a2i_at_A2I_internal_19 = 1 li $t1, 1 - sw $t1, -32($fp) + sw $t1, -80($fp) label_END_92: -# IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_FALSE_89 -# IF_ZERO local_a2i_at_A2I_internal_7 GOTO label_FALSE_89 -lw $t1, -32($fp) -beq $t1, 0, label_FALSE_89 -# LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) -# local_a2i_at_A2I_internal_13 = SELF -sw $s1, -56($fp) -# LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) -# LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) -# local_a2i_at_A2I_internal_11 = local_a2i_at_A2I_internal_13 -lw $t1, -56($fp) -sw $t1, -48($fp) +# IF_ZERO local_a2i_at_A2I_internal_19 GOTO label_FALSEIF_89 +# IF_ZERO local_a2i_at_A2I_internal_19 GOTO label_FALSEIF_89 +lw $t1, -80($fp) +beq $t1, 0, label_FALSEIF_89 +# LOCAL local_a2i_at_A2I_internal_25 --> -104($fp) +# local_a2i_at_A2I_internal_25 = SELF +sw $s1, -104($fp) +# LOCAL local_a2i_at_A2I_internal_23 --> -96($fp) +# LOCAL local_a2i_at_A2I_internal_25 --> -104($fp) +# local_a2i_at_A2I_internal_23 = local_a2i_at_A2I_internal_25 +lw $t1, -104($fp) +sw $t1, -96($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) +# LOCAL local_a2i_at_A2I_internal_26 --> -108($fp) # PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_14 = PARAM param_a2i_at_A2I_s_0 +# local_a2i_at_A2I_internal_26 = PARAM param_a2i_at_A2I_s_0 lw $t1, 0($fp) -sw $t1, -60($fp) +sw $t1, -108($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2004,19 +2345,19 @@ li $t1, 1 # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) # PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_17 = PARAM param_a2i_at_A2I_s_0 +# local_a2i_at_A2I_internal_29 = PARAM param_a2i_at_A2I_s_0 lw $t1, 0($fp) -sw $t1, -72($fp) +sw $t1, -120($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) -# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) -# local_a2i_at_A2I_internal_18 = VCALL local_a2i_at_A2I_internal_17 length +# LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) +# LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) +# local_a2i_at_A2I_internal_30 = VCALL local_a2i_at_A2I_internal_29 length # Save new self pointer in $s1 -lw $s1, -72($fp) +lw $s1, -120($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -2025,27 +2366,27 @@ lw $t2, 0($t1) lw $t3, 8($t2) # Call function. Result is on $v0 jalr $t3 -sw $v0, -76($fp) +sw $v0, -124($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) -# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) -# local_a2i_at_A2I_internal_16 = local_a2i_at_A2I_internal_18 - 1 -lw $t1, -76($fp) +# LOCAL local_a2i_at_A2I_internal_28 --> -116($fp) +# LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) +# local_a2i_at_A2I_internal_28 = local_a2i_at_A2I_internal_30 - 1 +lw $t1, -124($fp) sub $t1, $t1, 1 -sw $t1, -68($fp) -# ARG local_a2i_at_A2I_internal_16 -# LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) -lw $t1, -68($fp) +sw $t1, -116($fp) +# ARG local_a2i_at_A2I_internal_28 +# LOCAL local_a2i_at_A2I_internal_28 --> -116($fp) +lw $t1, -116($fp) # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) -# LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) -# local_a2i_at_A2I_internal_15 = VCALL local_a2i_at_A2I_internal_14 substr +# LOCAL local_a2i_at_A2I_internal_26 --> -108($fp) +# LOCAL local_a2i_at_A2I_internal_27 --> -112($fp) +# local_a2i_at_A2I_internal_27 = VCALL local_a2i_at_A2I_internal_26 substr # Save new self pointer in $s1 -lw $s1, -60($fp) +lw $s1, -108($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -2054,21 +2395,21 @@ lw $t2, 0($t1) lw $t3, 4($t2) # Call function. Result is on $v0 jalr $t3 -sw $v0, -64($fp) +sw $v0, -112($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# ARG local_a2i_at_A2I_internal_15 -# LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) -lw $t1, -64($fp) +# ARG local_a2i_at_A2I_internal_27 +# LOCAL local_a2i_at_A2I_internal_27 --> -112($fp) +lw $t1, -112($fp) # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) -# LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) -# local_a2i_at_A2I_internal_12 = VCALL local_a2i_at_A2I_internal_11 a2i_aux +# LOCAL local_a2i_at_A2I_internal_23 --> -96($fp) +# LOCAL local_a2i_at_A2I_internal_24 --> -100($fp) +# local_a2i_at_A2I_internal_24 = VCALL local_a2i_at_A2I_internal_23 a2i_aux # Save new self pointer in $s1 -lw $s1, -48($fp) +lw $s1, -96($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -2077,21 +2418,26 @@ lw $t2, 0($t1) lw $t3, 24($t2) # Call function. Result is on $v0 jalr $t3 -sw $v0, -52($fp) +sw $v0, -100($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# GOTO label_END_90 -j label_END_90 -label_FALSE_89: - # LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) - # local_a2i_at_A2I_internal_21 = SELF - sw $s1, -88($fp) - # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) - # LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) - # local_a2i_at_A2I_internal_19 = local_a2i_at_A2I_internal_21 - lw $t1, -88($fp) - sw $t1, -80($fp) +# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) +# LOCAL local_a2i_at_A2I_internal_24 --> -100($fp) +# local_a2i_at_A2I_internal_18 = local_a2i_at_A2I_internal_24 +lw $t1, -100($fp) +sw $t1, -76($fp) +# GOTO label_ENDIF_90 +j label_ENDIF_90 +label_FALSEIF_89: + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # local_a2i_at_A2I_internal_33 = SELF + sw $s1, -136($fp) + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # local_a2i_at_A2I_internal_31 = local_a2i_at_A2I_internal_33 + lw $t1, -136($fp) + sw $t1, -128($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2101,11 +2447,11 @@ label_FALSE_89: # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) - # LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) - # local_a2i_at_A2I_internal_20 = VCALL local_a2i_at_A2I_internal_19 a2i_aux + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_32 --> -132($fp) + # local_a2i_at_A2I_internal_32 = VCALL local_a2i_at_A2I_internal_31 a2i_aux # Save new self pointer in $s1 - lw $s1, -80($fp) + lw $s1, -128($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -2114,21 +2460,37 @@ label_FALSE_89: lw $t3, 24($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -84($fp) + sw $v0, -132($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - label_END_90: -label_END_86: -label_END_82: -# RETURN + # LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) + # LOCAL local_a2i_at_A2I_internal_32 --> -132($fp) + # local_a2i_at_A2I_internal_18 = local_a2i_at_A2I_internal_32 + lw $t1, -132($fp) + sw $t1, -76($fp) + label_ENDIF_90: +# LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) +# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) +# local_a2i_at_A2I_internal_4 = local_a2i_at_A2I_internal_18 +lw $t1, -76($fp) +sw $t1, -20($fp) +label_ENDIF_86: +# LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) +# LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) +# local_a2i_at_A2I_internal_0 = local_a2i_at_A2I_internal_4 +lw $t1, -20($fp) +sw $t1, -4($fp) +label_ENDIF_82: +# RETURN local_a2i_at_A2I_internal_0 +lw $v0, -4($fp) # Deallocate stack frame for function function_a2i_at_A2I. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 96 +addu $sp, $sp, 144 # Deallocate function args addu $sp, $sp, 4 jr $ra @@ -2338,37 +2700,37 @@ label_WHILE_END_94: # 0($fp) = param_i2a_at_A2I_i_0 function_i2a_at_A2I: # Allocate stack frame for function function_i2a_at_A2I. - subu $sp, $sp, 60 + subu $sp, $sp, 68 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 60 - # LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) + addu $fp, $sp, 68 + # LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # local_i2a_at_A2I_internal_0 = PARAM param_i2a_at_A2I_i_0 - 0 + # local_i2a_at_A2I_internal_1 = PARAM param_i2a_at_A2I_i_0 - 0 lw $t1, 0($fp) sub $t1, $t1, 0 - sw $t1, -4($fp) - # IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_TRUE_99 - # IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_TRUE_99 - lw $t1, -4($fp) + sw $t1, -8($fp) + # IF_ZERO local_i2a_at_A2I_internal_1 GOTO label_TRUE_99 + # IF_ZERO local_i2a_at_A2I_internal_1 GOTO label_TRUE_99 + lw $t1, -8($fp) beq $t1, 0, label_TRUE_99 - # LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) - # local_i2a_at_A2I_internal_0 = 0 + # LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) + # local_i2a_at_A2I_internal_1 = 0 li $t1, 0 - sw $t1, -4($fp) + sw $t1, -8($fp) # GOTO label_END_100 j label_END_100 label_TRUE_99: - # LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) - # local_i2a_at_A2I_internal_0 = 1 + # LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) + # local_i2a_at_A2I_internal_1 = 1 li $t1, 1 - sw $t1, -4($fp) + sw $t1, -8($fp) label_END_100: -# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSE_97 -# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSE_97 -lw $t1, -4($fp) -beq $t1, 0, label_FALSE_97 -# LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) +# IF_ZERO local_i2a_at_A2I_internal_1 GOTO label_FALSEIF_97 +# IF_ZERO local_i2a_at_A2I_internal_1 GOTO label_FALSEIF_97 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_97 +# LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -2385,49 +2747,54 @@ la $t1, data_25 sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) -sw $v0, -8($fp) -# GOTO label_END_98 -j label_END_98 -label_FALSE_97: - # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) +sw $v0, -12($fp) +# LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) +# local_i2a_at_A2I_internal_0 = local_i2a_at_A2I_internal_2 +lw $t1, -12($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_98 +j label_ENDIF_98 +label_FALSEIF_97: + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # local_i2a_at_A2I_internal_2 = 0 - PARAM param_i2a_at_A2I_i_0 + # local_i2a_at_A2I_internal_4 = 0 - PARAM param_i2a_at_A2I_i_0 li $t1, 0 lw $t2, 0($fp) sub $t1, $t1, $t2 - sw $t1, -12($fp) - # IF_GREATER_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 - # IF_GREATER_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 - lw $t1, -12($fp) + sw $t1, -20($fp) + # IF_GREATER_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_103 + # IF_GREATER_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_103 + lw $t1, -20($fp) bgt $t1, 0, label_FALSE_103 - # IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 - # IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_103 - lw $t1, -12($fp) + # IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_103 + # IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_103 + lw $t1, -20($fp) beq $t1, 0, label_FALSE_103 - # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) - # local_i2a_at_A2I_internal_2 = 1 + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + # local_i2a_at_A2I_internal_4 = 1 li $t1, 1 - sw $t1, -12($fp) + sw $t1, -20($fp) # GOTO label_END_104 j label_END_104 label_FALSE_103: - # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) - # local_i2a_at_A2I_internal_2 = 0 + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + # local_i2a_at_A2I_internal_4 = 0 li $t1, 0 - sw $t1, -12($fp) + sw $t1, -20($fp) label_END_104: -# IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_101 -# IF_ZERO local_i2a_at_A2I_internal_2 GOTO label_FALSE_101 -lw $t1, -12($fp) -beq $t1, 0, label_FALSE_101 -# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) -# local_i2a_at_A2I_internal_5 = SELF -sw $s1, -24($fp) -# LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) +# IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSEIF_101 +# IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSEIF_101 +lw $t1, -20($fp) +beq $t1, 0, label_FALSEIF_101 +# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) +# local_i2a_at_A2I_internal_7 = SELF +sw $s1, -32($fp) # LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) -# local_i2a_at_A2I_internal_3 = local_i2a_at_A2I_internal_5 -lw $t1, -24($fp) -sw $t1, -16($fp) +# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) +# local_i2a_at_A2I_internal_5 = local_i2a_at_A2I_internal_7 +lw $t1, -32($fp) +sw $t1, -24($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2437,11 +2804,11 @@ lw $t1, 0($fp) # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) -# LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) -# LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) -# local_i2a_at_A2I_internal_4 = VCALL local_i2a_at_A2I_internal_3 i2a_aux +# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) +# LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) +# local_i2a_at_A2I_internal_6 = VCALL local_i2a_at_A2I_internal_5 i2a_aux # Save new self pointer in $s1 -lw $s1, -16($fp) +lw $s1, -24($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -2450,14 +2817,19 @@ lw $t2, 0($t1) lw $t3, 32($t2) # Call function. Result is on $v0 jalr $t3 -sw $v0, -20($fp) +sw $v0, -28($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# GOTO label_END_102 -j label_END_102 -label_FALSE_101: - # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) +# LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) +# LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) +# local_i2a_at_A2I_internal_3 = local_i2a_at_A2I_internal_6 +lw $t1, -28($fp) +sw $t1, -16($fp) +# GOTO label_ENDIF_102 +j label_ENDIF_102 +label_FALSEIF_101: + # LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -2474,43 +2846,43 @@ label_FALSE_101: sw $t1, 12($v0) li $t1, 1 sw $t1, 16($v0) - sw $v0, -36($fp) - # LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) + sw $v0, -44($fp) # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) - # local_i2a_at_A2I_internal_6 = local_i2a_at_A2I_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) + # LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) + # local_i2a_at_A2I_internal_8 = local_i2a_at_A2I_internal_10 + lw $t1, -44($fp) + sw $t1, -36($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_13 --> -56($fp) + # local_i2a_at_A2I_internal_13 = SELF + sw $s1, -56($fp) # LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) - # local_i2a_at_A2I_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) - # LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) - # local_i2a_at_A2I_internal_9 = local_i2a_at_A2I_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) + # LOCAL local_i2a_at_A2I_internal_13 --> -56($fp) + # local_i2a_at_A2I_internal_11 = local_i2a_at_A2I_internal_13 + lw $t1, -56($fp) + sw $t1, -48($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) + # LOCAL local_i2a_at_A2I_internal_14 --> -60($fp) # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # local_i2a_at_A2I_internal_12 = PARAM param_i2a_at_A2I_i_0 * 1 + # local_i2a_at_A2I_internal_14 = PARAM param_i2a_at_A2I_i_0 * 1 lw $t1, 0($fp) mul $t1, $t1, 1 - sw $t1, -52($fp) - # ARG local_i2a_at_A2I_internal_12 - # LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) - lw $t1, -52($fp) + sw $t1, -60($fp) + # ARG local_i2a_at_A2I_internal_14 + # LOCAL local_i2a_at_A2I_internal_14 --> -60($fp) + lw $t1, -60($fp) # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) - # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) - # LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) - # local_i2a_at_A2I_internal_10 = VCALL local_i2a_at_A2I_internal_9 i2a_aux + # LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) + # LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) + # local_i2a_at_A2I_internal_12 = VCALL local_i2a_at_A2I_internal_11 i2a_aux # Save new self pointer in $s1 - lw $s1, -40($fp) + lw $s1, -48($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -2519,21 +2891,21 @@ label_FALSE_101: lw $t3, 32($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -44($fp) + sw $v0, -52($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # ARG local_i2a_at_A2I_internal_10 - # LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) - lw $t1, -44($fp) + # ARG local_i2a_at_A2I_internal_12 + # LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) + lw $t1, -52($fp) # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) - # LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) - # LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) - # local_i2a_at_A2I_internal_7 = VCALL local_i2a_at_A2I_internal_6 concat + # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) + # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) + # local_i2a_at_A2I_internal_9 = VCALL local_i2a_at_A2I_internal_8 concat # Save new self pointer in $s1 - lw $s1, -28($fp) + lw $s1, -36($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -2542,20 +2914,31 @@ label_FALSE_101: lw $t3, 0($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -32($fp) + sw $v0, -40($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - label_END_102: -label_END_98: -# RETURN + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) + # local_i2a_at_A2I_internal_3 = local_i2a_at_A2I_internal_9 + lw $t1, -40($fp) + sw $t1, -16($fp) + label_ENDIF_102: +# LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) +# local_i2a_at_A2I_internal_0 = local_i2a_at_A2I_internal_3 +lw $t1, -16($fp) +sw $t1, -4($fp) +label_ENDIF_98: +# RETURN local_i2a_at_A2I_internal_0 +lw $v0, -4($fp) # Deallocate stack frame for function function_i2a_at_A2I. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 60 +addu $sp, $sp, 68 # Deallocate function args addu $sp, $sp, 4 jr $ra @@ -2567,37 +2950,37 @@ jr $ra # 0($fp) = param_i2a_aux_at_A2I_i_0 function_i2a_aux_at_A2I: # Allocate stack frame for function function_i2a_aux_at_A2I. - subu $sp, $sp, 64 + subu $sp, $sp, 68 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 64 - # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) + addu $fp, $sp, 68 + # LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # local_i2a_aux_at_A2I_internal_0 = PARAM param_i2a_aux_at_A2I_i_0 - 0 + # local_i2a_aux_at_A2I_internal_1 = PARAM param_i2a_aux_at_A2I_i_0 - 0 lw $t1, 0($fp) sub $t1, $t1, 0 - sw $t1, -4($fp) - # IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_TRUE_107 - # IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_TRUE_107 - lw $t1, -4($fp) + sw $t1, -8($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_1 GOTO label_TRUE_107 + # IF_ZERO local_i2a_aux_at_A2I_internal_1 GOTO label_TRUE_107 + lw $t1, -8($fp) beq $t1, 0, label_TRUE_107 - # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) - # local_i2a_aux_at_A2I_internal_0 = 0 + # LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) + # local_i2a_aux_at_A2I_internal_1 = 0 li $t1, 0 - sw $t1, -4($fp) + sw $t1, -8($fp) # GOTO label_END_108 j label_END_108 label_TRUE_107: - # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) - # local_i2a_aux_at_A2I_internal_0 = 1 + # LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) + # local_i2a_aux_at_A2I_internal_1 = 1 li $t1, 1 - sw $t1, -4($fp) + sw $t1, -8($fp) label_END_108: -# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSE_105 -# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSE_105 -lw $t1, -4($fp) -beq $t1, 0, label_FALSE_105 -# LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) +# IF_ZERO local_i2a_aux_at_A2I_internal_1 GOTO label_FALSEIF_105 +# IF_ZERO local_i2a_aux_at_A2I_internal_1 GOTO label_FALSEIF_105 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_105 +# LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -2614,43 +2997,48 @@ la $t1, data_27 sw $t1, 12($v0) li $t1, 0 sw $t1, 16($v0) -sw $v0, -8($fp) -# GOTO label_END_106 -j label_END_106 -label_FALSE_105: - # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) +sw $v0, -12($fp) +# LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) +# local_i2a_aux_at_A2I_internal_0 = local_i2a_aux_at_A2I_internal_2 +lw $t1, -12($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_106 +j label_ENDIF_106 +label_FALSEIF_105: + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # local_i2a_aux_at_A2I_internal_3 = PARAM param_i2a_aux_at_A2I_i_0 / 10 + # local_i2a_aux_at_A2I_internal_4 = PARAM param_i2a_aux_at_A2I_i_0 / 10 lw $t1, 0($fp) div $t1, $t1, 10 + sw $t1, -20($fp) + # LOCAL local_i2a_aux_at_A2I_next_3 --> -16($fp) + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + # local_i2a_aux_at_A2I_next_3 = local_i2a_aux_at_A2I_internal_4 + lw $t1, -20($fp) sw $t1, -16($fp) - # LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) - # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) - # local_i2a_aux_at_A2I_next_2 = local_i2a_aux_at_A2I_internal_3 - lw $t1, -16($fp) - sw $t1, -12($fp) - # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) - # local_i2a_aux_at_A2I_internal_8 = SELF - sw $s1, -36($fp) - # LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) - # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) - # local_i2a_aux_at_A2I_internal_6 = local_i2a_aux_at_A2I_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) + # local_i2a_aux_at_A2I_internal_9 = SELF + sw $s1, -40($fp) + # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) + # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) + # local_i2a_aux_at_A2I_internal_7 = local_i2a_aux_at_A2I_internal_9 + lw $t1, -40($fp) + sw $t1, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # ARG local_i2a_aux_at_A2I_next_2 - # LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) - lw $t1, -12($fp) + # ARG local_i2a_aux_at_A2I_next_3 + # LOCAL local_i2a_aux_at_A2I_next_3 --> -16($fp) + lw $t1, -16($fp) # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) - # local_i2a_aux_at_A2I_internal_7 = VCALL local_i2a_aux_at_A2I_internal_6 i2a_aux + # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) + # local_i2a_aux_at_A2I_internal_8 = VCALL local_i2a_aux_at_A2I_internal_7 i2a_aux # Save new self pointer in $s1 - lw $s1, -28($fp) + lw $s1, -32($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -2659,54 +3047,54 @@ label_FALSE_105: lw $t3, 32($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -32($fp) + sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) - # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) - # local_i2a_aux_at_A2I_internal_4 = local_i2a_aux_at_A2I_internal_7 - lw $t1, -32($fp) - sw $t1, -20($fp) + # LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) + # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) + # local_i2a_aux_at_A2I_internal_5 = local_i2a_aux_at_A2I_internal_8 + lw $t1, -36($fp) + sw $t1, -24($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) - # local_i2a_aux_at_A2I_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) - # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) - # local_i2a_aux_at_A2I_internal_9 = local_i2a_aux_at_A2I_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) + # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) + # local_i2a_aux_at_A2I_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) + # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) + # local_i2a_aux_at_A2I_internal_10 = local_i2a_aux_at_A2I_internal_12 + lw $t1, -52($fp) + sw $t1, -44($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) - # LOCAL local_i2a_aux_at_A2I_next_2 --> -12($fp) - # local_i2a_aux_at_A2I_internal_13 = local_i2a_aux_at_A2I_next_2 * 10 - lw $t1, -12($fp) + # LOCAL local_i2a_aux_at_A2I_internal_14 --> -60($fp) + # LOCAL local_i2a_aux_at_A2I_next_3 --> -16($fp) + # local_i2a_aux_at_A2I_internal_14 = local_i2a_aux_at_A2I_next_3 * 10 + lw $t1, -16($fp) mul $t1, $t1, 10 - sw $t1, -56($fp) - # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + sw $t1, -60($fp) # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) - # local_i2a_aux_at_A2I_internal_12 = PARAM param_i2a_aux_at_A2I_i_0 - local_i2a_aux_at_A2I_internal_13 + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_14 --> -60($fp) + # local_i2a_aux_at_A2I_internal_13 = PARAM param_i2a_aux_at_A2I_i_0 - local_i2a_aux_at_A2I_internal_14 lw $t1, 0($fp) - lw $t2, -56($fp) + lw $t2, -60($fp) sub $t1, $t1, $t2 - sw $t1, -52($fp) - # ARG local_i2a_aux_at_A2I_internal_12 - # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) - lw $t1, -52($fp) + sw $t1, -56($fp) + # ARG local_i2a_aux_at_A2I_internal_13 + # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) + lw $t1, -56($fp) # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) - # local_i2a_aux_at_A2I_internal_10 = VCALL local_i2a_aux_at_A2I_internal_9 i2c + # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) + # local_i2a_aux_at_A2I_internal_11 = VCALL local_i2a_aux_at_A2I_internal_10 i2c # Save new self pointer in $s1 - lw $s1, -40($fp) + lw $s1, -44($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -2715,21 +3103,21 @@ label_FALSE_105: lw $t3, 16($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -44($fp) + sw $v0, -48($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # ARG local_i2a_aux_at_A2I_internal_10 - # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) - lw $t1, -44($fp) + # ARG local_i2a_aux_at_A2I_internal_11 + # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) + lw $t1, -48($fp) # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) # LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) - # local_i2a_aux_at_A2I_internal_5 = VCALL local_i2a_aux_at_A2I_internal_4 concat + # LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) + # local_i2a_aux_at_A2I_internal_6 = VCALL local_i2a_aux_at_A2I_internal_5 concat # Save new self pointer in $s1 - lw $s1, -20($fp) + lw $s1, -24($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -2738,19 +3126,25 @@ label_FALSE_105: lw $t3, 0($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -24($fp) + sw $v0, -28($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - label_END_106: -# RETURN + # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) + # LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) + # local_i2a_aux_at_A2I_internal_0 = local_i2a_aux_at_A2I_internal_6 + lw $t1, -28($fp) + sw $t1, -4($fp) + label_ENDIF_106: +# RETURN local_i2a_aux_at_A2I_internal_0 +lw $v0, -4($fp) # Deallocate stack frame for function function_i2a_aux_at_A2I. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 64 +addu $sp, $sp, 68 # Deallocate function args addu $sp, $sp, 4 jr $ra diff --git a/tests/codegen/book_list.mips b/tests/codegen/book_list.mips index 9b219cb9..4f52c453 100644 --- a/tests/codegen/book_list.mips +++ b/tests/codegen/book_list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 17:36:47 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:21 2020 # School of Math and Computer Science, University of Havana # @@ -253,17 +253,52 @@ function_in_string_at_IO: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END # function_out_int_at_IO implementation. @@ -427,7 +462,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -2001,7 +2036,7 @@ function_print_list_at_Cons: # local_print_list_at_Cons_internal_5 = 14 li $t5, 14 sw $t5, -24($fp) - # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Book + # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Book # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Book @@ -2023,7 +2058,7 @@ function_print_list_at_Cons: lw $t5, -28($fp) sw $t5, -24($fp) label_Not_min0_1: - # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Article + # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Article # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Article @@ -2061,7 +2096,7 @@ function_print_list_at_Cons: # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 lw $t5, -20($fp) beq $t5, 0, label_ERROR_3 - # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Book + # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Book # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Book @@ -2137,7 +2172,7 @@ function_print_list_at_Cons: # GOTO label_END_4 j label_END_4 label_NEXT0_5: - # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Article + # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Article # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Article diff --git a/tests/codegen/complex.mips b/tests/codegen/complex.mips new file mode 100644 index 00000000..2a766786 --- /dev/null +++ b/tests/codegen/complex.mips @@ -0,0 +1,1584 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:20 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Main: .asciiz "Main" +# Function END +Complex: .asciiz "Complex" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +# **** VTABLE for type Complex **** +Complex_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Complex, function_print_at_Complex, function_reflect_0_at_Complex, function_reflect_X_at_Complex, function_reflect_Y_at_Complex +# Function END +# + + +# **** Type RECORD for type Complex **** +Complex_start: + Complex_vtable_pointer: .word Complex_vtable + # Function END +Complex_end: +# + + +data_0: .asciiz "" +# + + +IO__TDT: .word 0, -1, -1, -1, 1, 1 +Object__TDT: .word 1, 0, 1, 1, 2, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1 +Main__TDT: .word -1, -1, -1, -1, 0, -1 +Complex__TDT: .word -1, -1, -1, -1, -1, 0 +# + + +data_2: .asciiz "=)\n" +# + + +data_3: .asciiz "=(\n" +# + + +data_4: .asciiz "+" +# + + +data_5: .asciiz "I" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + li $a0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) + move $t1, $v0 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 28($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_c_0 = ALLOCATE Complex + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Complex + sw $t3, 12($v0) + li $t3, 7 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Complex_start + sw $t3, 4($v0) + # Load type offset + li $t3, 20 + sw $t3, 8($v0) + move $t2, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Complex__attrib__x__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Complex__attrib__y__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t2) + sw $t2, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE Complex + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Complex + sw $t4, 12($v0) + li $t4, 7 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Complex_start + sw $t4, 4($v0) + # Load type offset + li $t4, 20 + sw $t4, 8($v0) + move $t3, $v0 + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Complex__attrib__x__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t3) + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Complex__attrib__y__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t3) + sw $t3, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t3, -16($fp) + sw $t3, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 1 + li $t3, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # ARG 1 + li $t3, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 28($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_c_0 = local_main_at_Main_internal_2 + lw $t3, -12($fp) + sw $t3, -4($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_internal_8 = local_main_at_Main_c_0 + lw $t3, -4($fp) + sw $t3, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 reflect_X + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 40($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_9 + lw $t3, -40($fp) + sw $t3, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 reflect_Y + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 44($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_c_0 + lw $t3, -4($fp) + sw $t3, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 reflect_0 + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 36($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_5 = local_main_at_Main_internal_7 - local_main_at_Main_internal_11 + lw $t3, -32($fp) + lw $t4, -48($fp) + sub $t3, $t3, $t4 + sw $t3, -24($fp) + # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_3 + # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_3 + lw $t3, -24($fp) + beq $t3, 0, label_TRUE_3 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = 0 + li $t3, 0 + sw $t3, -24($fp) + # GOTO label_END_4 +j label_END_4 +label_TRUE_3: + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = 1 + li $t3, 1 + sw $t3, -24($fp) + label_END_4: +# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_1 +# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_1 +lw $t3, -24($fp) +beq $t3, 0, label_FALSEIF_1 +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# local_main_at_Main_internal_14 = SELF +sw $s1, -60($fp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 +lw $t3, -60($fp) +sw $t3, -52($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t3, String +sw $t3, 0($v0) +la $t3, String_start +sw $t3, 4($v0) +# Load type offset +li $t3, 8 +sw $t3, 8($v0) +la $t3, data_2 +sw $t3, 12($v0) +li $t3, 4 +sw $t3, 16($v0) +sw $v0, -64($fp) +# ARG local_main_at_Main_internal_15 +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +lw $t3, -64($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string +# Save new self pointer in $s1 +lw $s1, -52($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 12($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -56($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_4 --> -20($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_4 = local_main_at_Main_internal_13 +lw $t3, -56($fp) +sw $t3, -20($fp) +# GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 + lw $t3, -76($fp) + sw $t3, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_3 + sw $t3, 12($v0) + li $t3, 4 + sw $t3, 16($v0) + sw $v0, -80($fp) + # ARG local_main_at_Main_internal_19 + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + lw $t3, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_17 + lw $t3, -72($fp) + sw $t3, -20($fp) + label_ENDIF_2: +# RETURN local_main_at_Main_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_main_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +jr $ra +# Function END + + +# __Complex__attrib__x__init implementation. +# @Params: +__Complex__attrib__x__init: + # Allocate stack frame for function __Complex__attrib__x__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Complex__attrib__x__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Complex__attrib__y__init implementation. +# @Params: +__Complex__attrib__y__init: + # Allocate stack frame for function __Complex__attrib__y__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Complex__attrib__y__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Complex implementation. +# @Params: +# 0($fp) = param_init_at_Complex_a_0 +# 4($fp) = param_init_at_Complex_b_1 +function_init_at_Complex: + # Allocate stack frame for function function_init_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_init_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + lw $t3, 12($s1) + sw $t3, -8($fp) + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + # local_init_at_Complex_internal_0 = local_init_at_Complex_internal_1 - PARAM param_init_at_Complex_a_0 + lw $t3, -8($fp) + lw $t4, 4($fp) + sub $t3, $t3, $t4 + sw $t3, -4($fp) + # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_5 + # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_5 + lw $t3, -4($fp) + beq $t3, 0, label_TRUE_5 + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # local_init_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + # GOTO label_END_6 +j label_END_6 +label_TRUE_5: + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # local_init_at_Complex_internal_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + label_END_6: +# local_init_at_Complex_internal_3 = GETATTRIBUTE y Complex +# LOCAL local_init_at_Complex_internal_3 --> -16($fp) +lw $t3, 16($s1) +sw $t3, -16($fp) +# LOCAL local_init_at_Complex_internal_2 --> -12($fp) +# LOCAL local_init_at_Complex_internal_3 --> -16($fp) +# PARAM param_init_at_Complex_b_1 --> 0($fp) +# local_init_at_Complex_internal_2 = local_init_at_Complex_internal_3 - PARAM param_init_at_Complex_b_1 +lw $t3, -16($fp) +lw $t4, 0($fp) +sub $t3, $t3, $t4 +sw $t3, -12($fp) +# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_7 +# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_7 +lw $t3, -12($fp) +beq $t3, 0, label_TRUE_7 +# LOCAL local_init_at_Complex_internal_2 --> -12($fp) +# local_init_at_Complex_internal_2 = 0 +li $t3, 0 +sw $t3, -12($fp) +# GOTO label_END_8 +j label_END_8 +label_TRUE_7: + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # local_init_at_Complex_internal_2 = 1 + li $t3, 1 + sw $t3, -12($fp) + label_END_8: +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# local_init_at_Complex_internal_4 = SELF +sw $s1, -20($fp) +# RETURN local_init_at_Complex_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_init_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +# Deallocate function args +addu $sp, $sp, 8 +jr $ra +# Function END + + +# function_print_at_Complex implementation. +# @Params: +function_print_at_Complex: + # Allocate stack frame for function function_print_at_Complex. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # local_print_at_Complex_internal_2 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_2 --> -12($fp) + lw $t3, 16($s1) + sw $t3, -12($fp) + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # LOCAL local_print_at_Complex_internal_2 --> -12($fp) + # local_print_at_Complex_internal_1 = local_print_at_Complex_internal_2 - 0 + lw $t3, -12($fp) + sub $t3, $t3, 0 + sw $t3, -8($fp) + # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_11 + # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_11 + lw $t3, -8($fp) + beq $t3, 0, label_TRUE_11 + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # local_print_at_Complex_internal_1 = 0 + li $t3, 0 + sw $t3, -8($fp) + # GOTO label_END_12 +j label_END_12 +label_TRUE_11: + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # local_print_at_Complex_internal_1 = 1 + li $t3, 1 + sw $t3, -8($fp) + label_END_12: +# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_9 +# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_9 +lw $t3, -8($fp) +beq $t3, 0, label_FALSEIF_9 +# LOCAL local_print_at_Complex_internal_5 --> -24($fp) +# local_print_at_Complex_internal_5 = SELF +sw $s1, -24($fp) +# LOCAL local_print_at_Complex_internal_3 --> -16($fp) +# LOCAL local_print_at_Complex_internal_5 --> -24($fp) +# local_print_at_Complex_internal_3 = local_print_at_Complex_internal_5 +lw $t3, -24($fp) +sw $t3, -16($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_print_at_Complex_internal_6 = GETATTRIBUTE x Complex +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +lw $t3, 12($s1) +sw $t3, -28($fp) +# ARG local_print_at_Complex_internal_6 +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +lw $t3, -28($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_print_at_Complex_internal_3 --> -16($fp) +# LOCAL local_print_at_Complex_internal_4 --> -20($fp) +# local_print_at_Complex_internal_4 = VCALL local_print_at_Complex_internal_3 out_int +# Save new self pointer in $s1 +lw $s1, -16($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 16($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -20($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_print_at_Complex_internal_0 --> -4($fp) +# LOCAL local_print_at_Complex_internal_4 --> -20($fp) +# local_print_at_Complex_internal_0 = local_print_at_Complex_internal_4 +lw $t3, -20($fp) +sw $t3, -4($fp) +# GOTO label_ENDIF_10 +j label_ENDIF_10 +label_FALSEIF_9: + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_13 = local_print_at_Complex_internal_15 + lw $t3, -64($fp) + sw $t3, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Complex_internal_16 = GETATTRIBUTE x Complex + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + lw $t3, 12($s1) + sw $t3, -68($fp) + # ARG local_print_at_Complex_internal_16 + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + lw $t3, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # LOCAL local_print_at_Complex_internal_14 --> -60($fp) + # local_print_at_Complex_internal_14 = VCALL local_print_at_Complex_internal_13 out_int + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 16($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # LOCAL local_print_at_Complex_internal_14 --> -60($fp) + # local_print_at_Complex_internal_11 = local_print_at_Complex_internal_14 + lw $t3, -60($fp) + sw $t3, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_4 + sw $t3, 12($v0) + li $t3, 1 + sw $t3, 16($v0) + sw $v0, -72($fp) + # ARG local_print_at_Complex_internal_17 + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + lw $t3, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # LOCAL local_print_at_Complex_internal_12 --> -52($fp) + # local_print_at_Complex_internal_12 = VCALL local_print_at_Complex_internal_11 out_string + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_9 --> -40($fp) + # LOCAL local_print_at_Complex_internal_12 --> -52($fp) + # local_print_at_Complex_internal_9 = local_print_at_Complex_internal_12 + lw $t3, -52($fp) + sw $t3, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Complex_internal_18 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + lw $t3, 16($s1) + sw $t3, -76($fp) + # ARG local_print_at_Complex_internal_18 + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + lw $t3, -76($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_print_at_Complex_internal_9 --> -40($fp) + # LOCAL local_print_at_Complex_internal_10 --> -44($fp) + # local_print_at_Complex_internal_10 = VCALL local_print_at_Complex_internal_9 out_int + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 16($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_7 --> -32($fp) + # LOCAL local_print_at_Complex_internal_10 --> -44($fp) + # local_print_at_Complex_internal_7 = local_print_at_Complex_internal_10 + lw $t3, -44($fp) + sw $t3, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_5 + sw $t3, 12($v0) + li $t3, 1 + sw $t3, 16($v0) + sw $v0, -80($fp) + # ARG local_print_at_Complex_internal_19 + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + lw $t3, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_print_at_Complex_internal_7 --> -32($fp) + # LOCAL local_print_at_Complex_internal_8 --> -36($fp) + # local_print_at_Complex_internal_8 = VCALL local_print_at_Complex_internal_7 out_string + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_0 --> -4($fp) + # LOCAL local_print_at_Complex_internal_8 --> -36($fp) + # local_print_at_Complex_internal_0 = local_print_at_Complex_internal_8 + lw $t3, -36($fp) + sw $t3, -4($fp) + label_ENDIF_10: +# RETURN local_print_at_Complex_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_print_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +jr $ra +# Function END + + +# function_reflect_0_at_Complex implementation. +# @Params: +function_reflect_0_at_Complex: + # Allocate stack frame for function function_reflect_0_at_Complex. + subu $sp, $sp, 44 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 44 + # local_reflect_0_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + lw $t3, 12($s1) + sw $t3, -8($fp) + # local_reflect_0_at_Complex_internal_3 = GETATTRIBUTE x Complex + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + lw $t3, 12($s1) + sw $t3, -16($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + lw $t3, -16($fp) + not $t3, $t3 + sw $t3, -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # local_reflect_0_at_Complex_internal_0 = local_reflect_0_at_Complex_internal_1 - local_reflect_0_at_Complex_internal_2 + lw $t3, -8($fp) + lw $t4, -12($fp) + sub $t3, $t3, $t4 + sw $t3, -4($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_13 + # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_13 + lw $t3, -4($fp) + beq $t3, 0, label_TRUE_13 + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # local_reflect_0_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + # GOTO label_END_14 +j label_END_14 +label_TRUE_13: + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # local_reflect_0_at_Complex_internal_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + label_END_14: +# local_reflect_0_at_Complex_internal_5 = GETATTRIBUTE y Complex +# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) +lw $t3, 16($s1) +sw $t3, -24($fp) +# local_reflect_0_at_Complex_internal_7 = GETATTRIBUTE y Complex +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +lw $t3, 16($s1) +sw $t3, -32($fp) +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +lw $t3, -32($fp) +not $t3, $t3 +sw $t3, -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) +# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# local_reflect_0_at_Complex_internal_4 = local_reflect_0_at_Complex_internal_5 - local_reflect_0_at_Complex_internal_6 +lw $t3, -24($fp) +lw $t4, -28($fp) +sub $t3, $t3, $t4 +sw $t3, -20($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_15 +# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_15 +lw $t3, -20($fp) +beq $t3, 0, label_TRUE_15 +# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) +# local_reflect_0_at_Complex_internal_4 = 0 +li $t3, 0 +sw $t3, -20($fp) +# GOTO label_END_16 +j label_END_16 +label_TRUE_15: + # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) + # local_reflect_0_at_Complex_internal_4 = 1 + li $t3, 1 + sw $t3, -20($fp) + label_END_16: +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# local_reflect_0_at_Complex_internal_8 = SELF +sw $s1, -36($fp) +# RETURN local_reflect_0_at_Complex_internal_8 +lw $v0, -36($fp) +# Deallocate stack frame for function function_reflect_0_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 44 +jr $ra +# Function END + + +# function_reflect_X_at_Complex implementation. +# @Params: +function_reflect_X_at_Complex: + # Allocate stack frame for function function_reflect_X_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_reflect_X_at_Complex_internal_1 = GETATTRIBUTE y Complex + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + lw $t3, 16($s1) + sw $t3, -8($fp) + # local_reflect_X_at_Complex_internal_3 = GETATTRIBUTE y Complex + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + lw $t3, 16($s1) + sw $t3, -16($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + lw $t3, -16($fp) + not $t3, $t3 + sw $t3, -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # local_reflect_X_at_Complex_internal_0 = local_reflect_X_at_Complex_internal_1 - local_reflect_X_at_Complex_internal_2 + lw $t3, -8($fp) + lw $t4, -12($fp) + sub $t3, $t3, $t4 + sw $t3, -4($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_17 + # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_17 + lw $t3, -4($fp) + beq $t3, 0, label_TRUE_17 + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # local_reflect_X_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + # GOTO label_END_18 +j label_END_18 +label_TRUE_17: + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # local_reflect_X_at_Complex_internal_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + label_END_18: +# LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) +# local_reflect_X_at_Complex_internal_4 = SELF +sw $s1, -20($fp) +# RETURN local_reflect_X_at_Complex_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_reflect_X_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +jr $ra +# Function END + + +# function_reflect_Y_at_Complex implementation. +# @Params: +function_reflect_Y_at_Complex: + # Allocate stack frame for function function_reflect_Y_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_reflect_Y_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + lw $t3, 12($s1) + sw $t3, -8($fp) + # local_reflect_Y_at_Complex_internal_3 = GETATTRIBUTE x Complex + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + lw $t3, 12($s1) + sw $t3, -16($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + lw $t3, -16($fp) + not $t3, $t3 + sw $t3, -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # local_reflect_Y_at_Complex_internal_0 = local_reflect_Y_at_Complex_internal_1 - local_reflect_Y_at_Complex_internal_2 + lw $t3, -8($fp) + lw $t4, -12($fp) + sub $t3, $t3, $t4 + sw $t3, -4($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_19 + # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_19 + lw $t3, -4($fp) + beq $t3, 0, label_TRUE_19 + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # local_reflect_Y_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + # GOTO label_END_20 +j label_END_20 +label_TRUE_19: + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # local_reflect_Y_at_Complex_internal_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + label_END_20: +# LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) +# local_reflect_Y_at_Complex_internal_4 = SELF +sw $s1, -20($fp) +# RETURN local_reflect_Y_at_Complex_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_reflect_Y_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +jr $ra +# Function END + diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips index 030af833..35573c48 100644 --- a/tests/codegen/fib.mips +++ b/tests/codegen/fib.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 17:36:46 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:20 2020 # School of Math and Computer Science, University of Havana # @@ -124,17 +124,52 @@ function_in_string_at_IO: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END # function_out_int_at_IO implementation. @@ -298,7 +333,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips index 42d351fa..57c617cd 100644 --- a/tests/codegen/hello_world.mips +++ b/tests/codegen/hello_world.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 17:36:45 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:19 2020 # School of Math and Computer Science, University of Havana # @@ -120,17 +120,52 @@ function_in_string_at_IO: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END # function_out_int_at_IO implementation. @@ -294,7 +329,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips index e5b42212..ad2a1715 100644 --- a/tests/codegen/io.mips +++ b/tests/codegen/io.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 17:36:47 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:21 2020 # School of Math and Computer Science, University of Havana # @@ -204,17 +204,52 @@ function_in_string_at_IO: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END # function_out_int_at_IO implementation. @@ -378,7 +413,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/life.mips b/tests/codegen/life.mips new file mode 100644 index 00000000..4c8164d6 --- /dev/null +++ b/tests/codegen/life.mips @@ -0,0 +1,8537 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:22 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Board: .asciiz "Board" +# Function END +CellularAutomaton: .asciiz "CellularAutomaton" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Board **** +Board_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_size_of_board_at_Board, function_board_init_at_Board +# Function END +# + + +# **** Type RECORD for type Board **** +Board_start: + Board_vtable_pointer: .word Board_vtable + # Function END +Board_end: +# + + +# **** VTABLE for type CellularAutomaton **** +CellularAutomaton_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_size_of_board_at_Board, function_board_init_at_Board, function_init_at_CellularAutomaton, function_print_at_CellularAutomaton, function_num_cells_at_CellularAutomaton, function_cell_at_CellularAutomaton, function_north_at_CellularAutomaton, function_south_at_CellularAutomaton, function_east_at_CellularAutomaton, function_west_at_CellularAutomaton, function_northwest_at_CellularAutomaton, function_northeast_at_CellularAutomaton, function_southeast_at_CellularAutomaton, function_southwest_at_CellularAutomaton, function_neighbors_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_evolve_at_CellularAutomaton, function_option_at_CellularAutomaton, function_prompt_at_CellularAutomaton, function_prompt2_at_CellularAutomaton +# Function END +# + + +# **** Type RECORD for type CellularAutomaton **** +CellularAutomaton_start: + CellularAutomaton_vtable_pointer: .word CellularAutomaton_vtable + # Function END +CellularAutomaton_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_CellularAutomaton, function_type_name_at_CellularAutomaton, function_copy_at_CellularAutomaton, function_out_string_at_CellularAutomaton, function_out_int_at_CellularAutomaton, function_in_string_at_CellularAutomaton, function_in_int_at_CellularAutomaton, function_size_of_board_at_Board, function_board_init_at_Board, function_init_at_CellularAutomaton, function_print_at_CellularAutomaton, function_num_cells_at_CellularAutomaton, function_cell_at_CellularAutomaton, function_north_at_CellularAutomaton, function_south_at_CellularAutomaton, function_east_at_CellularAutomaton, function_west_at_CellularAutomaton, function_northwest_at_CellularAutomaton, function_northeast_at_CellularAutomaton, function_southeast_at_CellularAutomaton, function_southwest_at_CellularAutomaton, function_neighbors_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_evolve_at_CellularAutomaton, function_option_at_CellularAutomaton, function_prompt_at_CellularAutomaton, function_prompt2_at_CellularAutomaton, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +IO__TDT: .word 0, -1, -1, -1, 1, 2, 3 +Object__TDT: .word 1, 0, 1, 1, 2, 3, 4 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 +Board__TDT: .word -1, -1, -1, -1, 0, 1, 2 +CellularAutomaton__TDT: .word -1, -1, -1, -1, -1, 0, 1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, 0 +# + + +data_2: .asciiz "\n" +# + + +data_3: .asciiz "\n" +# + + +data_4: .asciiz "\n" +# + + +data_5: .asciiz " " +# + + +data_6: .asciiz " " +# + + +data_7: .asciiz " " +# + + +data_8: .asciiz " " +# + + +data_9: .asciiz " " +# + + +data_10: .asciiz " " +# + + +data_11: .asciiz " " +# + + +data_12: .asciiz " " +# + + +data_13: .asciiz " " +# + + +data_14: .asciiz " " +# + + +data_15: .asciiz " " +# + + +data_16: .asciiz " " +# + + +data_17: .asciiz " " +# + + +data_18: .asciiz " " +# + + +data_19: .asciiz "X" +# + + +data_20: .asciiz "X" +# + + +data_21: .asciiz "X" +# + + +data_22: .asciiz "X" +# + + +data_23: .asciiz "X" +# + + +data_24: .asciiz "X" +# + + +data_25: .asciiz "X" +# + + +data_26: .asciiz "X" +# + + +data_27: .asciiz "X" +# + + +data_28: .asciiz "X" +# + + +data_29: .asciiz "X" +# + + +data_30: .asciiz "-" +# + + +data_31: .asciiz "-" +# + + +data_32: .asciiz "\nPlease chose a number:\n" +# + + +data_33: .asciiz "\t1: A cross\n" +# + + +data_34: .asciiz "\t2: A slash from the upper left to lower right\n" +# + + +data_35: .asciiz "\t3: A slash from the upper right to lower left\n" +# + + +data_36: .asciiz "\t4: An X\n" +# + + +data_37: .asciiz "\t5: A greater than sign \n" +# + + +data_38: .asciiz "\t6: A less than sign\n" +# + + +data_39: .asciiz "\t7: Two greater than signs\n" +# + + +data_40: .asciiz "\t8: Two less than signs\n" +# + + +data_41: .asciiz "\t9: A 'V'\n" +# + + +data_42: .asciiz "\t10: An inverse 'V'\n" +# + + +data_43: .asciiz "\t11: Numbers 9 and 10 combined\n" +# + + +data_44: .asciiz "\t12: A full grid\n" +# + + +data_45: .asciiz "\t13: A 'T'\n" +# + + +data_46: .asciiz "\t14: A plus '+'\n" +# + + +data_47: .asciiz "\t15: A 'W'\n" +# + + +data_48: .asciiz "\t16: An 'M'\n" +# + + +data_49: .asciiz "\t17: An 'E'\n" +# + + +data_50: .asciiz "\t18: A '3'\n" +# + + +data_51: .asciiz "\t19: An 'O'\n" +# + + +data_52: .asciiz "\t20: An '8'\n" +# + + +data_53: .asciiz "\t21: An 'S'\n" +# + + +data_54: .asciiz "Your choice => " +# + + +data_55: .asciiz "\n" +# + + +data_56: .asciiz " XX XXXX XXXX XX " +# + + +data_57: .asciiz " X X X X X " +# + + +data_58: .asciiz "X X X X X" +# + + +data_59: .asciiz "X X X X X X X X X" +# + + +data_60: .asciiz "X X X X X " +# + + +data_61: .asciiz " X X X X X" +# + + +data_62: .asciiz "X X X XX X " +# + + +data_63: .asciiz " X XX X X X " +# + + +data_64: .asciiz "X X X X X " +# + + +data_65: .asciiz " X X X X X" +# + + +data_66: .asciiz "X X X X X X X X" +# + + +data_67: .asciiz "XXXXXXXXXXXXXXXXXXXXXXXXX" +# + + +data_68: .asciiz "XXXXX X X X X " +# + + +data_69: .asciiz " X X XXXXX X X " +# + + +data_70: .asciiz "X X X X X X X " +# + + +data_71: .asciiz " X X X X X X X" +# + + +data_72: .asciiz "XXXXX X XXXXX X XXXX" +# + + +data_73: .asciiz "XXX X X X X XXXX " +# + + +data_74: .asciiz " XX X XX X XX " +# + + +data_75: .asciiz " XX X XX X XX X XX X XX " +# + + +data_76: .asciiz " XXXX X XX X XXXX " +# + + +data_77: .asciiz " " +# + + +data_78: .asciiz "Would you like to continue with the next generation? \n" +# + + +data_79: .asciiz "Please use lowercase y or n for your answer [y]: " +# + + +data_80: .asciiz "\n" +# + + +data_81: .asciiz "n" +# + + +data_82: .asciiz "\n\n" +# + + +data_83: .asciiz "Would you like to choose a background pattern? \n" +# + + +data_84: .asciiz "Please use lowercase y or n for your answer [n]: " +# + + +data_85: .asciiz "y" +# + + +data_86: .asciiz "Welcome to the Game of Life.\n" +# + + +data_87: .asciiz "There are many initial states to choose from. \n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + li $a0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 32 bytes of memory + li $a0, 32 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 24 + sw $t2, 8($v0) + move $t1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Board__attrib__rows__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Board__attrib__columns__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Board__attrib__board_size__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __CellularAutomaton__attrib__population_map__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__cells__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t1) + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 108($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Board__attrib__rows__init implementation. +# @Params: +__Board__attrib__rows__init: + # Allocate stack frame for function __Board__attrib__rows__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Board__attrib__rows__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Board__attrib__columns__init implementation. +# @Params: +__Board__attrib__columns__init: + # Allocate stack frame for function __Board__attrib__columns__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Board__attrib__columns__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Board__attrib__board_size__init implementation. +# @Params: +__Board__attrib__board_size__init: + # Allocate stack frame for function __Board__attrib__board_size__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Board__attrib__board_size__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_size_of_board_at_Board implementation. +# @Params: +# 0($fp) = param_size_of_board_at_Board_initial_0 +function_size_of_board_at_Board: + # Allocate stack frame for function function_size_of_board_at_Board. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_size_of_board_at_Board_internal_0 --> -4($fp) + # PARAM param_size_of_board_at_Board_initial_0 --> 0($fp) + # local_size_of_board_at_Board_internal_0 = PARAM param_size_of_board_at_Board_initial_0 + lw $t1, 0($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_size_of_board_at_Board_internal_0 --> -4($fp) + # LOCAL local_size_of_board_at_Board_internal_1 --> -8($fp) + # local_size_of_board_at_Board_internal_1 = VCALL local_size_of_board_at_Board_internal_0 length + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 8($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_size_of_board_at_Board_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_size_of_board_at_Board. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_board_init_at_Board implementation. +# @Params: +# 0($fp) = param_board_init_at_Board_start_0 +function_board_init_at_Board: + # Allocate stack frame for function function_board_init_at_Board. + subu $sp, $sp, 76 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 76 + # LOCAL local_board_init_at_Board_internal_3 --> -16($fp) + # local_board_init_at_Board_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_board_init_at_Board_internal_1 --> -8($fp) + # LOCAL local_board_init_at_Board_internal_3 --> -16($fp) + # local_board_init_at_Board_internal_1 = local_board_init_at_Board_internal_3 + lw $t1, -16($fp) + sw $t1, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_board_init_at_Board_start_0 + # PARAM param_board_init_at_Board_start_0 --> 0($fp) + lw $t1, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_board_init_at_Board_internal_1 --> -8($fp) + # LOCAL local_board_init_at_Board_internal_2 --> -12($fp) + # local_board_init_at_Board_internal_2 = VCALL local_board_init_at_Board_internal_1 size_of_board + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 28($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_2 --> -12($fp) + # local_board_init_at_Board_size_0 = local_board_init_at_Board_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # LOCAL local_board_init_at_Board_internal_5 --> -24($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # local_board_init_at_Board_internal_5 = local_board_init_at_Board_size_0 - 15 + lw $t1, -4($fp) + sub $t1, $t1, 15 + sw $t1, -24($fp) + # IF_ZERO local_board_init_at_Board_internal_5 GOTO label_TRUE_3 + # IF_ZERO local_board_init_at_Board_internal_5 GOTO label_TRUE_3 + lw $t1, -24($fp) + beq $t1, 0, label_TRUE_3 + # LOCAL local_board_init_at_Board_internal_5 --> -24($fp) + # local_board_init_at_Board_internal_5 = 0 + li $t1, 0 + sw $t1, -24($fp) + # GOTO label_END_4 +j label_END_4 +label_TRUE_3: + # LOCAL local_board_init_at_Board_internal_5 --> -24($fp) + # local_board_init_at_Board_internal_5 = 1 + li $t1, 1 + sw $t1, -24($fp) + label_END_4: +# IF_ZERO local_board_init_at_Board_internal_5 GOTO label_FALSEIF_1 +# IF_ZERO local_board_init_at_Board_internal_5 GOTO label_FALSEIF_1 +lw $t1, -24($fp) +beq $t1, 0, label_FALSEIF_1 +# +lw $t1, 3 +sw $t1, 12($s1) +# +lw $t1, 5 +sw $t1, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t1, -4($fp) +sw $t1, 20($s1) +# LOCAL local_board_init_at_Board_internal_4 --> -20($fp) +# local_board_init_at_Board_internal_4 = +# GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # local_board_init_at_Board_internal_7 = local_board_init_at_Board_size_0 - 16 + lw $t1, -4($fp) + sub $t1, $t1, 16 + sw $t1, -32($fp) + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_7 + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_7 + lw $t1, -32($fp) + beq $t1, 0, label_TRUE_7 + # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) + # local_board_init_at_Board_internal_7 = 0 + li $t1, 0 + sw $t1, -32($fp) + # GOTO label_END_8 +j label_END_8 +label_TRUE_7: + # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) + # local_board_init_at_Board_internal_7 = 1 + li $t1, 1 + sw $t1, -32($fp) + label_END_8: +# IF_ZERO local_board_init_at_Board_internal_7 GOTO label_FALSEIF_5 +# IF_ZERO local_board_init_at_Board_internal_7 GOTO label_FALSEIF_5 +lw $t1, -32($fp) +beq $t1, 0, label_FALSEIF_5 +# +lw $t1, 4 +sw $t1, 12($s1) +# +lw $t1, 4 +sw $t1, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t1, -4($fp) +sw $t1, 20($s1) +# LOCAL local_board_init_at_Board_internal_6 --> -28($fp) +# local_board_init_at_Board_internal_6 = +# GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # LOCAL local_board_init_at_Board_internal_9 --> -40($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # local_board_init_at_Board_internal_9 = local_board_init_at_Board_size_0 - 20 + lw $t1, -4($fp) + sub $t1, $t1, 20 + sw $t1, -40($fp) + # IF_ZERO local_board_init_at_Board_internal_9 GOTO label_TRUE_11 + # IF_ZERO local_board_init_at_Board_internal_9 GOTO label_TRUE_11 + lw $t1, -40($fp) + beq $t1, 0, label_TRUE_11 + # LOCAL local_board_init_at_Board_internal_9 --> -40($fp) + # local_board_init_at_Board_internal_9 = 0 + li $t1, 0 + sw $t1, -40($fp) + # GOTO label_END_12 +j label_END_12 +label_TRUE_11: + # LOCAL local_board_init_at_Board_internal_9 --> -40($fp) + # local_board_init_at_Board_internal_9 = 1 + li $t1, 1 + sw $t1, -40($fp) + label_END_12: +# IF_ZERO local_board_init_at_Board_internal_9 GOTO label_FALSEIF_9 +# IF_ZERO local_board_init_at_Board_internal_9 GOTO label_FALSEIF_9 +lw $t1, -40($fp) +beq $t1, 0, label_FALSEIF_9 +# +lw $t1, 4 +sw $t1, 12($s1) +# +lw $t1, 5 +sw $t1, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t1, -4($fp) +sw $t1, 20($s1) +# LOCAL local_board_init_at_Board_internal_8 --> -36($fp) +# local_board_init_at_Board_internal_8 = +# GOTO label_ENDIF_10 +j label_ENDIF_10 +label_FALSEIF_9: + # LOCAL local_board_init_at_Board_internal_11 --> -48($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # local_board_init_at_Board_internal_11 = local_board_init_at_Board_size_0 - 21 + lw $t1, -4($fp) + sub $t1, $t1, 21 + sw $t1, -48($fp) + # IF_ZERO local_board_init_at_Board_internal_11 GOTO label_TRUE_15 + # IF_ZERO local_board_init_at_Board_internal_11 GOTO label_TRUE_15 + lw $t1, -48($fp) + beq $t1, 0, label_TRUE_15 + # LOCAL local_board_init_at_Board_internal_11 --> -48($fp) + # local_board_init_at_Board_internal_11 = 0 + li $t1, 0 + sw $t1, -48($fp) + # GOTO label_END_16 +j label_END_16 +label_TRUE_15: + # LOCAL local_board_init_at_Board_internal_11 --> -48($fp) + # local_board_init_at_Board_internal_11 = 1 + li $t1, 1 + sw $t1, -48($fp) + label_END_16: +# IF_ZERO local_board_init_at_Board_internal_11 GOTO label_FALSEIF_13 +# IF_ZERO local_board_init_at_Board_internal_11 GOTO label_FALSEIF_13 +lw $t1, -48($fp) +beq $t1, 0, label_FALSEIF_13 +# +lw $t1, 3 +sw $t1, 12($s1) +# +lw $t1, 7 +sw $t1, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t1, -4($fp) +sw $t1, 20($s1) +# LOCAL local_board_init_at_Board_internal_10 --> -44($fp) +# local_board_init_at_Board_internal_10 = +# GOTO label_ENDIF_14 +j label_ENDIF_14 +label_FALSEIF_13: + # LOCAL local_board_init_at_Board_internal_13 --> -56($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # local_board_init_at_Board_internal_13 = local_board_init_at_Board_size_0 - 25 + lw $t1, -4($fp) + sub $t1, $t1, 25 + sw $t1, -56($fp) + # IF_ZERO local_board_init_at_Board_internal_13 GOTO label_TRUE_19 + # IF_ZERO local_board_init_at_Board_internal_13 GOTO label_TRUE_19 + lw $t1, -56($fp) + beq $t1, 0, label_TRUE_19 + # LOCAL local_board_init_at_Board_internal_13 --> -56($fp) + # local_board_init_at_Board_internal_13 = 0 + li $t1, 0 + sw $t1, -56($fp) + # GOTO label_END_20 +j label_END_20 +label_TRUE_19: + # LOCAL local_board_init_at_Board_internal_13 --> -56($fp) + # local_board_init_at_Board_internal_13 = 1 + li $t1, 1 + sw $t1, -56($fp) + label_END_20: +# IF_ZERO local_board_init_at_Board_internal_13 GOTO label_FALSEIF_17 +# IF_ZERO local_board_init_at_Board_internal_13 GOTO label_FALSEIF_17 +lw $t1, -56($fp) +beq $t1, 0, label_FALSEIF_17 +# +lw $t1, 5 +sw $t1, 12($s1) +# +lw $t1, 5 +sw $t1, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t1, -4($fp) +sw $t1, 20($s1) +# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) +# local_board_init_at_Board_internal_12 = +# GOTO label_ENDIF_18 +j label_ENDIF_18 +label_FALSEIF_17: + # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # local_board_init_at_Board_internal_15 = local_board_init_at_Board_size_0 - 28 + lw $t1, -4($fp) + sub $t1, $t1, 28 + sw $t1, -64($fp) + # IF_ZERO local_board_init_at_Board_internal_15 GOTO label_TRUE_23 + # IF_ZERO local_board_init_at_Board_internal_15 GOTO label_TRUE_23 + lw $t1, -64($fp) + beq $t1, 0, label_TRUE_23 + # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) + # local_board_init_at_Board_internal_15 = 0 + li $t1, 0 + sw $t1, -64($fp) + # GOTO label_END_24 +j label_END_24 +label_TRUE_23: + # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) + # local_board_init_at_Board_internal_15 = 1 + li $t1, 1 + sw $t1, -64($fp) + label_END_24: +# IF_ZERO local_board_init_at_Board_internal_15 GOTO label_FALSEIF_21 +# IF_ZERO local_board_init_at_Board_internal_15 GOTO label_FALSEIF_21 +lw $t1, -64($fp) +beq $t1, 0, label_FALSEIF_21 +# +lw $t1, 7 +sw $t1, 12($s1) +# +lw $t1, 4 +sw $t1, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t1, -4($fp) +sw $t1, 20($s1) +# LOCAL local_board_init_at_Board_internal_14 --> -60($fp) +# local_board_init_at_Board_internal_14 = +# GOTO label_ENDIF_22 +j label_ENDIF_22 +label_FALSEIF_21: + # + lw $t1, 5 + sw $t1, 12($s1) + # + lw $t1, 5 + sw $t1, 16($s1) + # + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + lw $t1, -4($fp) + sw $t1, 20($s1) + # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) + # local_board_init_at_Board_internal_14 = + label_ENDIF_22: +# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) +# LOCAL local_board_init_at_Board_internal_14 --> -60($fp) +# local_board_init_at_Board_internal_12 = local_board_init_at_Board_internal_14 +lw $t1, -60($fp) +sw $t1, -52($fp) +label_ENDIF_18: +# LOCAL local_board_init_at_Board_internal_10 --> -44($fp) +# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) +# local_board_init_at_Board_internal_10 = local_board_init_at_Board_internal_12 +lw $t1, -52($fp) +sw $t1, -44($fp) +label_ENDIF_14: +# LOCAL local_board_init_at_Board_internal_8 --> -36($fp) +# LOCAL local_board_init_at_Board_internal_10 --> -44($fp) +# local_board_init_at_Board_internal_8 = local_board_init_at_Board_internal_10 +lw $t1, -44($fp) +sw $t1, -36($fp) +label_ENDIF_10: +# LOCAL local_board_init_at_Board_internal_6 --> -28($fp) +# LOCAL local_board_init_at_Board_internal_8 --> -36($fp) +# local_board_init_at_Board_internal_6 = local_board_init_at_Board_internal_8 +lw $t1, -36($fp) +sw $t1, -28($fp) +label_ENDIF_6: +# LOCAL local_board_init_at_Board_internal_4 --> -20($fp) +# LOCAL local_board_init_at_Board_internal_6 --> -28($fp) +# local_board_init_at_Board_internal_4 = local_board_init_at_Board_internal_6 +lw $t1, -28($fp) +sw $t1, -20($fp) +label_ENDIF_2: +# LOCAL local_board_init_at_Board_internal_16 --> -68($fp) +# local_board_init_at_Board_internal_16 = SELF +sw $s1, -68($fp) +# RETURN local_board_init_at_Board_internal_16 +lw $v0, -68($fp) +# Deallocate stack frame for function function_board_init_at_Board. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 76 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# __CellularAutomaton__attrib__population_map__init implementation. +# @Params: +__CellularAutomaton__attrib__population_map__init: + # Allocate stack frame for function __CellularAutomaton__attrib__population_map__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_rAutomaton__attrib__population_map__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_0 + sw $t1, 12($v0) + li $t1, 0 + sw $t1, 16($v0) + sw $v0, -4($fp) + # RETURN local_rAutomaton__attrib__population_map__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __CellularAutomaton__attrib__population_map__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_init_at_CellularAutomaton_map_0 +function_init_at_CellularAutomaton: + # Allocate stack frame for function function_init_at_CellularAutomaton. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_CellularAutomaton_map_0 --> 0($fp) + lw $t1, 0($fp) + sw $t1, 24($s1) + # LOCAL local_init_at_CellularAutomaton_internal_2 --> -12($fp) + # local_init_at_CellularAutomaton_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_init_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_init_at_CellularAutomaton_internal_2 --> -12($fp) + # local_init_at_CellularAutomaton_internal_0 = local_init_at_CellularAutomaton_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_init_at_CellularAutomaton_map_0 + # PARAM param_init_at_CellularAutomaton_map_0 --> 0($fp) + lw $t1, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_init_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_init_at_CellularAutomaton_internal_1 --> -8($fp) + # local_init_at_CellularAutomaton_internal_1 = VCALL local_init_at_CellularAutomaton_internal_0 board_init + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 32($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_init_at_CellularAutomaton_internal_3 --> -16($fp) + # local_init_at_CellularAutomaton_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_init_at_CellularAutomaton_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_init_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_at_CellularAutomaton implementation. +# @Params: +function_print_at_CellularAutomaton: + # Allocate stack frame for function function_print_at_CellularAutomaton. + subu $sp, $sp, 112 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 112 + # LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) + # local_print_at_CellularAutomaton_i_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # local_print_at_CellularAutomaton_internal_2 = GETATTRIBUTE board_size CellularAutomaton + # LOCAL local_print_at_CellularAutomaton_internal_2 --> -12($fp) + lw $t1, 20($s1) + sw $t1, -12($fp) + # LOCAL local_print_at_CellularAutomaton_num_1 --> -8($fp) + # LOCAL local_print_at_CellularAutomaton_internal_2 --> -12($fp) + # local_print_at_CellularAutomaton_num_1 = local_print_at_CellularAutomaton_internal_2 + lw $t1, -12($fp) + sw $t1, -8($fp) + # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) + # local_print_at_CellularAutomaton_internal_5 = SELF + sw $s1, -24($fp) + # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) + # local_print_at_CellularAutomaton_internal_3 = local_print_at_CellularAutomaton_internal_5 + lw $t1, -24($fp) + sw $t1, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_2 + sw $t1, 12($v0) + li $t1, 2 + sw $t1, 16($v0) + sw $v0, -28($fp) + # ARG local_print_at_CellularAutomaton_internal_6 + # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) + lw $t1, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_print_at_CellularAutomaton_internal_4 --> -20($fp) + # local_print_at_CellularAutomaton_internal_4 = VCALL local_print_at_CellularAutomaton_internal_3 out_string + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_WHILE_25: + # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) + # LOCAL local_print_at_CellularAutomaton_num_1 --> -8($fp) + # local_print_at_CellularAutomaton_internal_7 = local_print_at_CellularAutomaton_i_0 - local_print_at_CellularAutomaton_num_1 + lw $t1, -4($fp) + lw $t2, -8($fp) + sub $t1, $t1, $t2 + sw $t1, -32($fp) + # IF_GREATER_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_FALSE_27 + # IF_GREATER_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_FALSE_27 + lw $t1, -32($fp) + bgt $t1, 0, label_FALSE_27 + # IF_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_FALSE_27 + # IF_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_FALSE_27 + lw $t1, -32($fp) + beq $t1, 0, label_FALSE_27 + # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) + # local_print_at_CellularAutomaton_internal_7 = 1 + li $t1, 1 + sw $t1, -32($fp) + # GOTO label_END_28 +j label_END_28 +label_FALSE_27: + # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) + # local_print_at_CellularAutomaton_internal_7 = 0 + li $t1, 0 + sw $t1, -32($fp) + label_END_28: +# IF_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_WHILE_END_26 +# IF_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_WHILE_END_26 +lw $t1, -32($fp) +beq $t1, 0, label_WHILE_END_26 +# LOCAL local_print_at_CellularAutomaton_internal_10 --> -44($fp) +# local_print_at_CellularAutomaton_internal_10 = SELF +sw $s1, -44($fp) +# LOCAL local_print_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_print_at_CellularAutomaton_internal_10 --> -44($fp) +# local_print_at_CellularAutomaton_internal_8 = local_print_at_CellularAutomaton_internal_10 +lw $t1, -44($fp) +sw $t1, -36($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_print_at_CellularAutomaton_internal_13 = GETATTRIBUTE population_map CellularAutomaton +# LOCAL local_print_at_CellularAutomaton_internal_13 --> -56($fp) +lw $t1, 24($s1) +sw $t1, -56($fp) +# LOCAL local_print_at_CellularAutomaton_internal_11 --> -48($fp) +# LOCAL local_print_at_CellularAutomaton_internal_13 --> -56($fp) +# local_print_at_CellularAutomaton_internal_11 = local_print_at_CellularAutomaton_internal_13 +lw $t1, -56($fp) +sw $t1, -48($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_print_at_CellularAutomaton_i_0 +# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) +lw $t1, -4($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# local_print_at_CellularAutomaton_internal_14 = GETATTRIBUTE columns CellularAutomaton +# LOCAL local_print_at_CellularAutomaton_internal_14 --> -60($fp) +lw $t1, 16($s1) +sw $t1, -60($fp) +# ARG local_print_at_CellularAutomaton_internal_14 +# LOCAL local_print_at_CellularAutomaton_internal_14 --> -60($fp) +lw $t1, -60($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_print_at_CellularAutomaton_internal_11 --> -48($fp) +# LOCAL local_print_at_CellularAutomaton_internal_12 --> -52($fp) +# local_print_at_CellularAutomaton_internal_12 = VCALL local_print_at_CellularAutomaton_internal_11 substr +# Save new self pointer in $s1 +lw $s1, -48($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 4($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -52($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_print_at_CellularAutomaton_internal_12 +# LOCAL local_print_at_CellularAutomaton_internal_12 --> -52($fp) +lw $t1, -52($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_print_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_print_at_CellularAutomaton_internal_9 --> -40($fp) +# local_print_at_CellularAutomaton_internal_9 = VCALL local_print_at_CellularAutomaton_internal_8 out_string +# Save new self pointer in $s1 +lw $s1, -36($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 12($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -40($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_print_at_CellularAutomaton_internal_17 --> -72($fp) +# local_print_at_CellularAutomaton_internal_17 = SELF +sw $s1, -72($fp) +# LOCAL local_print_at_CellularAutomaton_internal_15 --> -64($fp) +# LOCAL local_print_at_CellularAutomaton_internal_17 --> -72($fp) +# local_print_at_CellularAutomaton_internal_15 = local_print_at_CellularAutomaton_internal_17 +lw $t1, -72($fp) +sw $t1, -64($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_print_at_CellularAutomaton_internal_18 --> -76($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_3 +sw $t1, 12($v0) +li $t1, 2 +sw $t1, 16($v0) +sw $v0, -76($fp) +# ARG local_print_at_CellularAutomaton_internal_18 +# LOCAL local_print_at_CellularAutomaton_internal_18 --> -76($fp) +lw $t1, -76($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_print_at_CellularAutomaton_internal_15 --> -64($fp) +# LOCAL local_print_at_CellularAutomaton_internal_16 --> -68($fp) +# local_print_at_CellularAutomaton_internal_16 = VCALL local_print_at_CellularAutomaton_internal_15 out_string +# Save new self pointer in $s1 +lw $s1, -64($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 12($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -68($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# local_print_at_CellularAutomaton_internal_20 = GETATTRIBUTE columns CellularAutomaton +# LOCAL local_print_at_CellularAutomaton_internal_20 --> -84($fp) +lw $t1, 16($s1) +sw $t1, -84($fp) +# LOCAL local_print_at_CellularAutomaton_internal_19 --> -80($fp) +# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) +# LOCAL local_print_at_CellularAutomaton_internal_20 --> -84($fp) +# local_print_at_CellularAutomaton_internal_19 = local_print_at_CellularAutomaton_i_0 + local_print_at_CellularAutomaton_internal_20 +lw $t1, -4($fp) +lw $t2, -84($fp) +add $t1, $t1, $t2 +sw $t1, -80($fp) +# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) +# LOCAL local_print_at_CellularAutomaton_internal_19 --> -80($fp) +# local_print_at_CellularAutomaton_i_0 = local_print_at_CellularAutomaton_internal_19 +lw $t1, -80($fp) +sw $t1, -4($fp) +# GOTO label_WHILE_25 +j label_WHILE_25 +label_WHILE_END_26: + # LOCAL local_print_at_CellularAutomaton_internal_23 --> -96($fp) + # local_print_at_CellularAutomaton_internal_23 = SELF + sw $s1, -96($fp) + # LOCAL local_print_at_CellularAutomaton_internal_21 --> -88($fp) + # LOCAL local_print_at_CellularAutomaton_internal_23 --> -96($fp) + # local_print_at_CellularAutomaton_internal_21 = local_print_at_CellularAutomaton_internal_23 + lw $t1, -96($fp) + sw $t1, -88($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_24 --> -100($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_4 + sw $t1, 12($v0) + li $t1, 2 + sw $t1, 16($v0) + sw $v0, -100($fp) + # ARG local_print_at_CellularAutomaton_internal_24 + # LOCAL local_print_at_CellularAutomaton_internal_24 --> -100($fp) + lw $t1, -100($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_21 --> -88($fp) + # LOCAL local_print_at_CellularAutomaton_internal_22 --> -92($fp) + # local_print_at_CellularAutomaton_internal_22 = VCALL local_print_at_CellularAutomaton_internal_21 out_string + # Save new self pointer in $s1 + lw $s1, -88($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -92($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_CellularAutomaton_internal_25 --> -104($fp) + # local_print_at_CellularAutomaton_internal_25 = SELF + sw $s1, -104($fp) + # RETURN local_print_at_CellularAutomaton_internal_25 + lw $v0, -104($fp) + # Deallocate stack frame for function function_print_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 112 + jr $ra + # Function END + + +# function_num_cells_at_CellularAutomaton implementation. +# @Params: +function_num_cells_at_CellularAutomaton: + # Allocate stack frame for function function_num_cells_at_CellularAutomaton. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_num_cells_at_CellularAutomaton_internal_2 = GETATTRIBUTE population_map CellularAutomaton + # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) + lw $t1, 24($s1) + sw $t1, -12($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) + # local_num_cells_at_CellularAutomaton_internal_0 = local_num_cells_at_CellularAutomaton_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_1 --> -8($fp) + # local_num_cells_at_CellularAutomaton_internal_1 = VCALL local_num_cells_at_CellularAutomaton_internal_0 length + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 8($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_num_cells_at_CellularAutomaton_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_num_cells_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cell_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_cell_at_CellularAutomaton_position_0 +function_cell_at_CellularAutomaton: + # Allocate stack frame for function function_cell_at_CellularAutomaton. + subu $sp, $sp, 40 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 40 + # local_cell_at_CellularAutomaton_internal_3 = GETATTRIBUTE board_size CellularAutomaton + # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) + lw $t1, 20($s1) + sw $t1, -16($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) + # local_cell_at_CellularAutomaton_internal_2 = local_cell_at_CellularAutomaton_internal_3 - 1 + lw $t1, -16($fp) + sub $t1, $t1, 1 + sw $t1, -12($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) + # PARAM param_cell_at_CellularAutomaton_position_0 --> 0($fp) + # local_cell_at_CellularAutomaton_internal_1 = local_cell_at_CellularAutomaton_internal_2 - PARAM param_cell_at_CellularAutomaton_position_0 + lw $t1, -12($fp) + lw $t2, 0($fp) + sub $t1, $t1, $t2 + sw $t1, -8($fp) + # IF_GREATER_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSE_31 + # IF_GREATER_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSE_31 + lw $t1, -8($fp) + bgt $t1, 0, label_FALSE_31 + # IF_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSE_31 + # IF_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSE_31 + lw $t1, -8($fp) + beq $t1, 0, label_FALSE_31 + # LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) + # local_cell_at_CellularAutomaton_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + # GOTO label_END_32 +j label_END_32 +label_FALSE_31: + # LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) + # local_cell_at_CellularAutomaton_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + label_END_32: +# IF_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_29 +# IF_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_29 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_29 +# LOCAL local_cell_at_CellularAutomaton_internal_4 --> -20($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_5 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -20($fp) +# LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_cell_at_CellularAutomaton_internal_4 --> -20($fp) +# local_cell_at_CellularAutomaton_internal_0 = local_cell_at_CellularAutomaton_internal_4 +lw $t1, -20($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_30 +j label_ENDIF_30 +label_FALSEIF_29: + # local_cell_at_CellularAutomaton_internal_7 = GETATTRIBUTE population_map CellularAutomaton + # LOCAL local_cell_at_CellularAutomaton_internal_7 --> -32($fp) + lw $t1, 24($s1) + sw $t1, -32($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_7 --> -32($fp) + # local_cell_at_CellularAutomaton_internal_5 = local_cell_at_CellularAutomaton_internal_7 + lw $t1, -32($fp) + sw $t1, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cell_at_CellularAutomaton_position_0 + # PARAM param_cell_at_CellularAutomaton_position_0 --> 0($fp) + lw $t1, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # ARG 1 + li $t1, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_cell_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_6 --> -28($fp) + # local_cell_at_CellularAutomaton_internal_6 = VCALL local_cell_at_CellularAutomaton_internal_5 substr + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 4($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_6 --> -28($fp) + # local_cell_at_CellularAutomaton_internal_0 = local_cell_at_CellularAutomaton_internal_6 + lw $t1, -28($fp) + sw $t1, -4($fp) + label_ENDIF_30: +# RETURN local_cell_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_cell_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 40 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_north_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_north_at_CellularAutomaton_position_0 +function_north_at_CellularAutomaton: + # Allocate stack frame for function function_north_at_CellularAutomaton. + subu $sp, $sp, 48 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 48 + # local_north_at_CellularAutomaton_internal_3 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_north_at_CellularAutomaton_internal_3 --> -16($fp) + lw $t1, 16($s1) + sw $t1, -16($fp) + # LOCAL local_north_at_CellularAutomaton_internal_2 --> -12($fp) + # PARAM param_north_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_north_at_CellularAutomaton_internal_3 --> -16($fp) + # local_north_at_CellularAutomaton_internal_2 = PARAM param_north_at_CellularAutomaton_position_0 - local_north_at_CellularAutomaton_internal_3 + lw $t1, 0($fp) + lw $t2, -16($fp) + sub $t1, $t1, $t2 + sw $t1, -12($fp) + # LOCAL local_north_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_north_at_CellularAutomaton_internal_2 --> -12($fp) + # local_north_at_CellularAutomaton_internal_1 = local_north_at_CellularAutomaton_internal_2 - 0 + lw $t1, -12($fp) + sub $t1, $t1, 0 + sw $t1, -8($fp) + # IF_GREATER_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSE_35 + # IF_GREATER_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSE_35 + lw $t1, -8($fp) + bgt $t1, 0, label_FALSE_35 + # IF_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSE_35 + # IF_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSE_35 + lw $t1, -8($fp) + beq $t1, 0, label_FALSE_35 + # LOCAL local_north_at_CellularAutomaton_internal_1 --> -8($fp) + # local_north_at_CellularAutomaton_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + # GOTO label_END_36 +j label_END_36 +label_FALSE_35: + # LOCAL local_north_at_CellularAutomaton_internal_1 --> -8($fp) + # local_north_at_CellularAutomaton_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + label_END_36: +# IF_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_33 +# IF_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_33 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_33 +# LOCAL local_north_at_CellularAutomaton_internal_4 --> -20($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_6 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -20($fp) +# LOCAL local_north_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_north_at_CellularAutomaton_internal_4 --> -20($fp) +# local_north_at_CellularAutomaton_internal_0 = local_north_at_CellularAutomaton_internal_4 +lw $t1, -20($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_34 +j label_ENDIF_34 +label_FALSEIF_33: + # LOCAL local_north_at_CellularAutomaton_internal_7 --> -32($fp) + # local_north_at_CellularAutomaton_internal_7 = SELF + sw $s1, -32($fp) + # LOCAL local_north_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_north_at_CellularAutomaton_internal_7 --> -32($fp) + # local_north_at_CellularAutomaton_internal_5 = local_north_at_CellularAutomaton_internal_7 + lw $t1, -32($fp) + sw $t1, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_north_at_CellularAutomaton_internal_9 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_north_at_CellularAutomaton_internal_9 --> -40($fp) + lw $t1, 16($s1) + sw $t1, -40($fp) + # LOCAL local_north_at_CellularAutomaton_internal_8 --> -36($fp) + # PARAM param_north_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_north_at_CellularAutomaton_internal_9 --> -40($fp) + # local_north_at_CellularAutomaton_internal_8 = PARAM param_north_at_CellularAutomaton_position_0 - local_north_at_CellularAutomaton_internal_9 + lw $t1, 0($fp) + lw $t2, -40($fp) + sub $t1, $t1, $t2 + sw $t1, -36($fp) + # ARG local_north_at_CellularAutomaton_internal_8 + # LOCAL local_north_at_CellularAutomaton_internal_8 --> -36($fp) + lw $t1, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_north_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_north_at_CellularAutomaton_internal_6 --> -28($fp) + # local_north_at_CellularAutomaton_internal_6 = VCALL local_north_at_CellularAutomaton_internal_5 cell + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 48($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_north_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_north_at_CellularAutomaton_internal_6 --> -28($fp) + # local_north_at_CellularAutomaton_internal_0 = local_north_at_CellularAutomaton_internal_6 + lw $t1, -28($fp) + sw $t1, -4($fp) + label_ENDIF_34: +# RETURN local_north_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_north_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 48 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_south_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_south_at_CellularAutomaton_position_0 +function_south_at_CellularAutomaton: + # Allocate stack frame for function function_south_at_CellularAutomaton. + subu $sp, $sp, 52 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 52 + # local_south_at_CellularAutomaton_internal_2 = GETATTRIBUTE board_size CellularAutomaton + # LOCAL local_south_at_CellularAutomaton_internal_2 --> -12($fp) + lw $t1, 20($s1) + sw $t1, -12($fp) + # local_south_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_south_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t1, 16($s1) + sw $t1, -20($fp) + # LOCAL local_south_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_south_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_south_at_CellularAutomaton_internal_4 --> -20($fp) + # local_south_at_CellularAutomaton_internal_3 = PARAM param_south_at_CellularAutomaton_position_0 + local_south_at_CellularAutomaton_internal_4 + lw $t1, 0($fp) + lw $t2, -20($fp) + add $t1, $t1, $t2 + sw $t1, -16($fp) + # LOCAL local_south_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_south_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_south_at_CellularAutomaton_internal_3 --> -16($fp) + # local_south_at_CellularAutomaton_internal_1 = local_south_at_CellularAutomaton_internal_2 - local_south_at_CellularAutomaton_internal_3 + lw $t1, -12($fp) + lw $t2, -16($fp) + sub $t1, $t1, $t2 + sw $t1, -8($fp) + # IF_GREATER_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSE_39 + # IF_GREATER_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSE_39 + lw $t1, -8($fp) + bgt $t1, 0, label_FALSE_39 + # IF_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSE_39 + # IF_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSE_39 + lw $t1, -8($fp) + beq $t1, 0, label_FALSE_39 + # LOCAL local_south_at_CellularAutomaton_internal_1 --> -8($fp) + # local_south_at_CellularAutomaton_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + # GOTO label_END_40 +j label_END_40 +label_FALSE_39: + # LOCAL local_south_at_CellularAutomaton_internal_1 --> -8($fp) + # local_south_at_CellularAutomaton_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + label_END_40: +# IF_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_37 +# IF_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_37 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_37 +# LOCAL local_south_at_CellularAutomaton_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_7 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -24($fp) +# LOCAL local_south_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_south_at_CellularAutomaton_internal_5 --> -24($fp) +# local_south_at_CellularAutomaton_internal_0 = local_south_at_CellularAutomaton_internal_5 +lw $t1, -24($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_38 +j label_ENDIF_38 +label_FALSEIF_37: + # LOCAL local_south_at_CellularAutomaton_internal_8 --> -36($fp) + # local_south_at_CellularAutomaton_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_south_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_south_at_CellularAutomaton_internal_8 --> -36($fp) + # local_south_at_CellularAutomaton_internal_6 = local_south_at_CellularAutomaton_internal_8 + lw $t1, -36($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_south_at_CellularAutomaton_internal_10 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_south_at_CellularAutomaton_internal_10 --> -44($fp) + lw $t1, 16($s1) + sw $t1, -44($fp) + # LOCAL local_south_at_CellularAutomaton_internal_9 --> -40($fp) + # PARAM param_south_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_south_at_CellularAutomaton_internal_10 --> -44($fp) + # local_south_at_CellularAutomaton_internal_9 = PARAM param_south_at_CellularAutomaton_position_0 + local_south_at_CellularAutomaton_internal_10 + lw $t1, 0($fp) + lw $t2, -44($fp) + add $t1, $t1, $t2 + sw $t1, -40($fp) + # ARG local_south_at_CellularAutomaton_internal_9 + # LOCAL local_south_at_CellularAutomaton_internal_9 --> -40($fp) + lw $t1, -40($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_south_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_south_at_CellularAutomaton_internal_7 --> -32($fp) + # local_south_at_CellularAutomaton_internal_7 = VCALL local_south_at_CellularAutomaton_internal_6 cell + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 48($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_south_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_south_at_CellularAutomaton_internal_7 --> -32($fp) + # local_south_at_CellularAutomaton_internal_0 = local_south_at_CellularAutomaton_internal_7 + lw $t1, -32($fp) + sw $t1, -4($fp) + label_ENDIF_38: +# RETURN local_south_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_south_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 52 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_east_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_east_at_CellularAutomaton_position_0 +function_east_at_CellularAutomaton: + # Allocate stack frame for function function_east_at_CellularAutomaton. + subu $sp, $sp, 60 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 60 + # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) + # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) + # local_east_at_CellularAutomaton_internal_4 = PARAM param_east_at_CellularAutomaton_position_0 + 1 + lw $t1, 0($fp) + add $t1, $t1, 1 + sw $t1, -20($fp) + # local_east_at_CellularAutomaton_internal_5 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_east_at_CellularAutomaton_internal_5 --> -24($fp) + lw $t1, 16($s1) + sw $t1, -24($fp) + # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_east_at_CellularAutomaton_internal_5 --> -24($fp) + # local_east_at_CellularAutomaton_internal_3 = local_east_at_CellularAutomaton_internal_4 / local_east_at_CellularAutomaton_internal_5 + lw $t1, -20($fp) + lw $t2, -24($fp) + div $t1, $t1, $t2 + sw $t1, -16($fp) + # local_east_at_CellularAutomaton_internal_6 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_east_at_CellularAutomaton_internal_6 --> -28($fp) + lw $t1, 16($s1) + sw $t1, -28($fp) + # LOCAL local_east_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_east_at_CellularAutomaton_internal_6 --> -28($fp) + # local_east_at_CellularAutomaton_internal_2 = local_east_at_CellularAutomaton_internal_3 * local_east_at_CellularAutomaton_internal_6 + lw $t1, -16($fp) + lw $t2, -28($fp) + mul $t1, $t1, $t2 + sw $t1, -12($fp) + # LOCAL local_east_at_CellularAutomaton_internal_7 --> -32($fp) + # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) + # local_east_at_CellularAutomaton_internal_7 = PARAM param_east_at_CellularAutomaton_position_0 + 1 + lw $t1, 0($fp) + add $t1, $t1, 1 + sw $t1, -32($fp) + # LOCAL local_east_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_east_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_east_at_CellularAutomaton_internal_7 --> -32($fp) + # local_east_at_CellularAutomaton_internal_1 = local_east_at_CellularAutomaton_internal_2 - local_east_at_CellularAutomaton_internal_7 + lw $t1, -12($fp) + lw $t2, -32($fp) + sub $t1, $t1, $t2 + sw $t1, -8($fp) + # IF_ZERO local_east_at_CellularAutomaton_internal_1 GOTO label_TRUE_43 + # IF_ZERO local_east_at_CellularAutomaton_internal_1 GOTO label_TRUE_43 + lw $t1, -8($fp) + beq $t1, 0, label_TRUE_43 + # LOCAL local_east_at_CellularAutomaton_internal_1 --> -8($fp) + # local_east_at_CellularAutomaton_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # GOTO label_END_44 +j label_END_44 +label_TRUE_43: + # LOCAL local_east_at_CellularAutomaton_internal_1 --> -8($fp) + # local_east_at_CellularAutomaton_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + label_END_44: +# IF_ZERO local_east_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_41 +# IF_ZERO local_east_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_41 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_41 +# LOCAL local_east_at_CellularAutomaton_internal_8 --> -36($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_8 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -36($fp) +# LOCAL local_east_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_east_at_CellularAutomaton_internal_8 --> -36($fp) +# local_east_at_CellularAutomaton_internal_0 = local_east_at_CellularAutomaton_internal_8 +lw $t1, -36($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_42 +j label_ENDIF_42 +label_FALSEIF_41: + # LOCAL local_east_at_CellularAutomaton_internal_11 --> -48($fp) + # local_east_at_CellularAutomaton_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_east_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_east_at_CellularAutomaton_internal_11 --> -48($fp) + # local_east_at_CellularAutomaton_internal_9 = local_east_at_CellularAutomaton_internal_11 + lw $t1, -48($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_east_at_CellularAutomaton_internal_12 --> -52($fp) + # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) + # local_east_at_CellularAutomaton_internal_12 = PARAM param_east_at_CellularAutomaton_position_0 + 1 + lw $t1, 0($fp) + add $t1, $t1, 1 + sw $t1, -52($fp) + # ARG local_east_at_CellularAutomaton_internal_12 + # LOCAL local_east_at_CellularAutomaton_internal_12 --> -52($fp) + lw $t1, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_east_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) + # local_east_at_CellularAutomaton_internal_10 = VCALL local_east_at_CellularAutomaton_internal_9 cell + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 48($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_east_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) + # local_east_at_CellularAutomaton_internal_0 = local_east_at_CellularAutomaton_internal_10 + lw $t1, -44($fp) + sw $t1, -4($fp) + label_ENDIF_42: +# RETURN local_east_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_east_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 60 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_west_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_west_at_CellularAutomaton_position_0 +function_west_at_CellularAutomaton: + # Allocate stack frame for function function_west_at_CellularAutomaton. + subu $sp, $sp, 64 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 64 + # LOCAL local_west_at_CellularAutomaton_internal_1 --> -8($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # local_west_at_CellularAutomaton_internal_1 = PARAM param_west_at_CellularAutomaton_position_0 - 0 + lw $t1, 0($fp) + sub $t1, $t1, 0 + sw $t1, -8($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_1 GOTO label_TRUE_47 + # IF_ZERO local_west_at_CellularAutomaton_internal_1 GOTO label_TRUE_47 + lw $t1, -8($fp) + beq $t1, 0, label_TRUE_47 + # LOCAL local_west_at_CellularAutomaton_internal_1 --> -8($fp) + # local_west_at_CellularAutomaton_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # GOTO label_END_48 +j label_END_48 +label_TRUE_47: + # LOCAL local_west_at_CellularAutomaton_internal_1 --> -8($fp) + # local_west_at_CellularAutomaton_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + label_END_48: +# IF_ZERO local_west_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_45 +# IF_ZERO local_west_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_45 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_45 +# LOCAL local_west_at_CellularAutomaton_internal_2 --> -12($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_9 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -12($fp) +# LOCAL local_west_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_west_at_CellularAutomaton_internal_2 --> -12($fp) +# local_west_at_CellularAutomaton_internal_0 = local_west_at_CellularAutomaton_internal_2 +lw $t1, -12($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_46 +j label_ENDIF_46 +label_FALSEIF_45: + # local_west_at_CellularAutomaton_internal_7 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_west_at_CellularAutomaton_internal_7 --> -32($fp) + lw $t1, 16($s1) + sw $t1, -32($fp) + # LOCAL local_west_at_CellularAutomaton_internal_6 --> -28($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_west_at_CellularAutomaton_internal_7 --> -32($fp) + # local_west_at_CellularAutomaton_internal_6 = PARAM param_west_at_CellularAutomaton_position_0 / local_west_at_CellularAutomaton_internal_7 + lw $t1, 0($fp) + lw $t2, -32($fp) + div $t1, $t1, $t2 + sw $t1, -28($fp) + # local_west_at_CellularAutomaton_internal_8 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_west_at_CellularAutomaton_internal_8 --> -36($fp) + lw $t1, 16($s1) + sw $t1, -36($fp) + # LOCAL local_west_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_west_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_west_at_CellularAutomaton_internal_8 --> -36($fp) + # local_west_at_CellularAutomaton_internal_5 = local_west_at_CellularAutomaton_internal_6 * local_west_at_CellularAutomaton_internal_8 + lw $t1, -28($fp) + lw $t2, -36($fp) + mul $t1, $t1, $t2 + sw $t1, -24($fp) + # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_west_at_CellularAutomaton_internal_5 --> -24($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # local_west_at_CellularAutomaton_internal_4 = local_west_at_CellularAutomaton_internal_5 - PARAM param_west_at_CellularAutomaton_position_0 + lw $t1, -24($fp) + lw $t2, 0($fp) + sub $t1, $t1, $t2 + sw $t1, -20($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_TRUE_51 + # IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_TRUE_51 + lw $t1, -20($fp) + beq $t1, 0, label_TRUE_51 + # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) + # local_west_at_CellularAutomaton_internal_4 = 0 + li $t1, 0 + sw $t1, -20($fp) + # GOTO label_END_52 +j label_END_52 +label_TRUE_51: + # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) + # local_west_at_CellularAutomaton_internal_4 = 1 + li $t1, 1 + sw $t1, -20($fp) + label_END_52: +# IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_FALSEIF_49 +# IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_FALSEIF_49 +lw $t1, -20($fp) +beq $t1, 0, label_FALSEIF_49 +# LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_10 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -40($fp) +# LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) +# LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) +# local_west_at_CellularAutomaton_internal_3 = local_west_at_CellularAutomaton_internal_9 +lw $t1, -40($fp) +sw $t1, -16($fp) +# GOTO label_ENDIF_50 +j label_ENDIF_50 +label_FALSEIF_49: + # LOCAL local_west_at_CellularAutomaton_internal_12 --> -52($fp) + # local_west_at_CellularAutomaton_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_west_at_CellularAutomaton_internal_12 --> -52($fp) + # local_west_at_CellularAutomaton_internal_10 = local_west_at_CellularAutomaton_internal_12 + lw $t1, -52($fp) + sw $t1, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_west_at_CellularAutomaton_internal_13 --> -56($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # local_west_at_CellularAutomaton_internal_13 = PARAM param_west_at_CellularAutomaton_position_0 - 1 + lw $t1, 0($fp) + sub $t1, $t1, 1 + sw $t1, -56($fp) + # ARG local_west_at_CellularAutomaton_internal_13 + # LOCAL local_west_at_CellularAutomaton_internal_13 --> -56($fp) + lw $t1, -56($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_west_at_CellularAutomaton_internal_11 --> -48($fp) + # local_west_at_CellularAutomaton_internal_11 = VCALL local_west_at_CellularAutomaton_internal_10 cell + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 48($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_west_at_CellularAutomaton_internal_11 --> -48($fp) + # local_west_at_CellularAutomaton_internal_3 = local_west_at_CellularAutomaton_internal_11 + lw $t1, -48($fp) + sw $t1, -16($fp) + label_ENDIF_50: +# LOCAL local_west_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) +# local_west_at_CellularAutomaton_internal_0 = local_west_at_CellularAutomaton_internal_3 +lw $t1, -16($fp) +sw $t1, -4($fp) +label_ENDIF_46: +# RETURN local_west_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_west_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 64 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_northwest_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_northwest_at_CellularAutomaton_position_0 +function_northwest_at_CellularAutomaton: + # Allocate stack frame for function function_northwest_at_CellularAutomaton. + subu $sp, $sp, 72 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 72 + # local_northwest_at_CellularAutomaton_internal_3 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northwest_at_CellularAutomaton_internal_3 --> -16($fp) + lw $t1, 16($s1) + sw $t1, -16($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_2 --> -12($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_3 --> -16($fp) + # local_northwest_at_CellularAutomaton_internal_2 = PARAM param_northwest_at_CellularAutomaton_position_0 - local_northwest_at_CellularAutomaton_internal_3 + lw $t1, 0($fp) + lw $t2, -16($fp) + sub $t1, $t1, $t2 + sw $t1, -12($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_2 --> -12($fp) + # local_northwest_at_CellularAutomaton_internal_1 = local_northwest_at_CellularAutomaton_internal_2 - 0 + lw $t1, -12($fp) + sub $t1, $t1, 0 + sw $t1, -8($fp) + # IF_GREATER_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_55 + # IF_GREATER_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_55 + lw $t1, -8($fp) + bgt $t1, 0, label_FALSE_55 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_55 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_55 + lw $t1, -8($fp) + beq $t1, 0, label_FALSE_55 + # LOCAL local_northwest_at_CellularAutomaton_internal_1 --> -8($fp) + # local_northwest_at_CellularAutomaton_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + # GOTO label_END_56 +j label_END_56 +label_FALSE_55: + # LOCAL local_northwest_at_CellularAutomaton_internal_1 --> -8($fp) + # local_northwest_at_CellularAutomaton_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + label_END_56: +# IF_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_53 +# IF_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_53 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_53 +# LOCAL local_northwest_at_CellularAutomaton_internal_4 --> -20($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_11 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -20($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_4 --> -20($fp) +# local_northwest_at_CellularAutomaton_internal_0 = local_northwest_at_CellularAutomaton_internal_4 +lw $t1, -20($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_54 +j label_ENDIF_54 +label_FALSEIF_53: + # local_northwest_at_CellularAutomaton_internal_9 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northwest_at_CellularAutomaton_internal_9 --> -40($fp) + lw $t1, 16($s1) + sw $t1, -40($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_8 --> -36($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_9 --> -40($fp) + # local_northwest_at_CellularAutomaton_internal_8 = PARAM param_northwest_at_CellularAutomaton_position_0 / local_northwest_at_CellularAutomaton_internal_9 + lw $t1, 0($fp) + lw $t2, -40($fp) + div $t1, $t1, $t2 + sw $t1, -36($fp) + # local_northwest_at_CellularAutomaton_internal_10 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) + lw $t1, 16($s1) + sw $t1, -44($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) + # local_northwest_at_CellularAutomaton_internal_7 = local_northwest_at_CellularAutomaton_internal_8 * local_northwest_at_CellularAutomaton_internal_10 + lw $t1, -36($fp) + lw $t2, -44($fp) + mul $t1, $t1, $t2 + sw $t1, -32($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_7 --> -32($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + # local_northwest_at_CellularAutomaton_internal_6 = local_northwest_at_CellularAutomaton_internal_7 - PARAM param_northwest_at_CellularAutomaton_position_0 + lw $t1, -32($fp) + lw $t2, 0($fp) + sub $t1, $t1, $t2 + sw $t1, -28($fp) + # IF_ZERO local_northwest_at_CellularAutomaton_internal_6 GOTO label_TRUE_59 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_6 GOTO label_TRUE_59 + lw $t1, -28($fp) + beq $t1, 0, label_TRUE_59 + # LOCAL local_northwest_at_CellularAutomaton_internal_6 --> -28($fp) + # local_northwest_at_CellularAutomaton_internal_6 = 0 + li $t1, 0 + sw $t1, -28($fp) + # GOTO label_END_60 +j label_END_60 +label_TRUE_59: + # LOCAL local_northwest_at_CellularAutomaton_internal_6 --> -28($fp) + # local_northwest_at_CellularAutomaton_internal_6 = 1 + li $t1, 1 + sw $t1, -28($fp) + label_END_60: +# IF_ZERO local_northwest_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_57 +# IF_ZERO local_northwest_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_57 +lw $t1, -28($fp) +beq $t1, 0, label_FALSEIF_57 +# LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_12 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -48($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) +# local_northwest_at_CellularAutomaton_internal_5 = local_northwest_at_CellularAutomaton_internal_11 +lw $t1, -48($fp) +sw $t1, -24($fp) +# GOTO label_ENDIF_58 +j label_ENDIF_58 +label_FALSEIF_57: + # LOCAL local_northwest_at_CellularAutomaton_internal_14 --> -60($fp) + # local_northwest_at_CellularAutomaton_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_14 --> -60($fp) + # local_northwest_at_CellularAutomaton_internal_12 = local_northwest_at_CellularAutomaton_internal_14 + lw $t1, -60($fp) + sw $t1, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_northwest_at_CellularAutomaton_internal_15 --> -64($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + # local_northwest_at_CellularAutomaton_internal_15 = PARAM param_northwest_at_CellularAutomaton_position_0 - 1 + lw $t1, 0($fp) + sub $t1, $t1, 1 + sw $t1, -64($fp) + # ARG local_northwest_at_CellularAutomaton_internal_15 + # LOCAL local_northwest_at_CellularAutomaton_internal_15 --> -64($fp) + lw $t1, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_northwest_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_13 --> -56($fp) + # local_northwest_at_CellularAutomaton_internal_13 = VCALL local_northwest_at_CellularAutomaton_internal_12 north + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 52($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_northwest_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_13 --> -56($fp) + # local_northwest_at_CellularAutomaton_internal_5 = local_northwest_at_CellularAutomaton_internal_13 + lw $t1, -56($fp) + sw $t1, -24($fp) + label_ENDIF_58: +# LOCAL local_northwest_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_5 --> -24($fp) +# local_northwest_at_CellularAutomaton_internal_0 = local_northwest_at_CellularAutomaton_internal_5 +lw $t1, -24($fp) +sw $t1, -4($fp) +label_ENDIF_54: +# RETURN local_northwest_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_northwest_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 72 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_northeast_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_northeast_at_CellularAutomaton_position_0 +function_northeast_at_CellularAutomaton: + # Allocate stack frame for function function_northeast_at_CellularAutomaton. + subu $sp, $sp, 80 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 80 + # local_northeast_at_CellularAutomaton_internal_3 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northeast_at_CellularAutomaton_internal_3 --> -16($fp) + lw $t1, 16($s1) + sw $t1, -16($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_2 --> -12($fp) + # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_3 --> -16($fp) + # local_northeast_at_CellularAutomaton_internal_2 = PARAM param_northeast_at_CellularAutomaton_position_0 - local_northeast_at_CellularAutomaton_internal_3 + lw $t1, 0($fp) + lw $t2, -16($fp) + sub $t1, $t1, $t2 + sw $t1, -12($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_2 --> -12($fp) + # local_northeast_at_CellularAutomaton_internal_1 = local_northeast_at_CellularAutomaton_internal_2 - 0 + lw $t1, -12($fp) + sub $t1, $t1, 0 + sw $t1, -8($fp) + # IF_GREATER_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_63 + # IF_GREATER_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_63 + lw $t1, -8($fp) + bgt $t1, 0, label_FALSE_63 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_63 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_63 + lw $t1, -8($fp) + beq $t1, 0, label_FALSE_63 + # LOCAL local_northeast_at_CellularAutomaton_internal_1 --> -8($fp) + # local_northeast_at_CellularAutomaton_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + # GOTO label_END_64 +j label_END_64 +label_FALSE_63: + # LOCAL local_northeast_at_CellularAutomaton_internal_1 --> -8($fp) + # local_northeast_at_CellularAutomaton_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + label_END_64: +# IF_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_61 +# IF_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_61 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_61 +# LOCAL local_northeast_at_CellularAutomaton_internal_4 --> -20($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_13 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -20($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_4 --> -20($fp) +# local_northeast_at_CellularAutomaton_internal_0 = local_northeast_at_CellularAutomaton_internal_4 +lw $t1, -20($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_62 +j label_ENDIF_62 +label_FALSEIF_61: + # LOCAL local_northeast_at_CellularAutomaton_internal_9 --> -40($fp) + # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) + # local_northeast_at_CellularAutomaton_internal_9 = PARAM param_northeast_at_CellularAutomaton_position_0 + 1 + lw $t1, 0($fp) + add $t1, $t1, 1 + sw $t1, -40($fp) + # local_northeast_at_CellularAutomaton_internal_10 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) + lw $t1, 16($s1) + sw $t1, -44($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) + # local_northeast_at_CellularAutomaton_internal_8 = local_northeast_at_CellularAutomaton_internal_9 / local_northeast_at_CellularAutomaton_internal_10 + lw $t1, -40($fp) + lw $t2, -44($fp) + div $t1, $t1, $t2 + sw $t1, -36($fp) + # local_northeast_at_CellularAutomaton_internal_11 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) + lw $t1, 16($s1) + sw $t1, -48($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) + # local_northeast_at_CellularAutomaton_internal_7 = local_northeast_at_CellularAutomaton_internal_8 * local_northeast_at_CellularAutomaton_internal_11 + lw $t1, -36($fp) + lw $t2, -48($fp) + mul $t1, $t1, $t2 + sw $t1, -32($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_12 --> -52($fp) + # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) + # local_northeast_at_CellularAutomaton_internal_12 = PARAM param_northeast_at_CellularAutomaton_position_0 + 1 + lw $t1, 0($fp) + add $t1, $t1, 1 + sw $t1, -52($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_12 --> -52($fp) + # local_northeast_at_CellularAutomaton_internal_6 = local_northeast_at_CellularAutomaton_internal_7 - local_northeast_at_CellularAutomaton_internal_12 + lw $t1, -32($fp) + lw $t2, -52($fp) + sub $t1, $t1, $t2 + sw $t1, -28($fp) + # IF_ZERO local_northeast_at_CellularAutomaton_internal_6 GOTO label_TRUE_67 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_6 GOTO label_TRUE_67 + lw $t1, -28($fp) + beq $t1, 0, label_TRUE_67 + # LOCAL local_northeast_at_CellularAutomaton_internal_6 --> -28($fp) + # local_northeast_at_CellularAutomaton_internal_6 = 0 + li $t1, 0 + sw $t1, -28($fp) + # GOTO label_END_68 +j label_END_68 +label_TRUE_67: + # LOCAL local_northeast_at_CellularAutomaton_internal_6 --> -28($fp) + # local_northeast_at_CellularAutomaton_internal_6 = 1 + li $t1, 1 + sw $t1, -28($fp) + label_END_68: +# IF_ZERO local_northeast_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_65 +# IF_ZERO local_northeast_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_65 +lw $t1, -28($fp) +beq $t1, 0, label_FALSEIF_65 +# LOCAL local_northeast_at_CellularAutomaton_internal_13 --> -56($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_14 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -56($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_13 --> -56($fp) +# local_northeast_at_CellularAutomaton_internal_5 = local_northeast_at_CellularAutomaton_internal_13 +lw $t1, -56($fp) +sw $t1, -24($fp) +# GOTO label_ENDIF_66 +j label_ENDIF_66 +label_FALSEIF_65: + # LOCAL local_northeast_at_CellularAutomaton_internal_16 --> -68($fp) + # local_northeast_at_CellularAutomaton_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_14 --> -60($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_16 --> -68($fp) + # local_northeast_at_CellularAutomaton_internal_14 = local_northeast_at_CellularAutomaton_internal_16 + lw $t1, -68($fp) + sw $t1, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) + # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) + # local_northeast_at_CellularAutomaton_internal_17 = PARAM param_northeast_at_CellularAutomaton_position_0 + 1 + lw $t1, 0($fp) + add $t1, $t1, 1 + sw $t1, -72($fp) + # ARG local_northeast_at_CellularAutomaton_internal_17 + # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) + lw $t1, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_northeast_at_CellularAutomaton_internal_14 --> -60($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_15 --> -64($fp) + # local_northeast_at_CellularAutomaton_internal_15 = VCALL local_northeast_at_CellularAutomaton_internal_14 north + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 52($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_northeast_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_15 --> -64($fp) + # local_northeast_at_CellularAutomaton_internal_5 = local_northeast_at_CellularAutomaton_internal_15 + lw $t1, -64($fp) + sw $t1, -24($fp) + label_ENDIF_66: +# LOCAL local_northeast_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_5 --> -24($fp) +# local_northeast_at_CellularAutomaton_internal_0 = local_northeast_at_CellularAutomaton_internal_5 +lw $t1, -24($fp) +sw $t1, -4($fp) +label_ENDIF_62: +# RETURN local_northeast_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_northeast_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 80 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_southeast_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_southeast_at_CellularAutomaton_position_0 +function_southeast_at_CellularAutomaton: + # Allocate stack frame for function function_southeast_at_CellularAutomaton. + subu $sp, $sp, 84 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 84 + # local_southeast_at_CellularAutomaton_internal_2 = GETATTRIBUTE board_size CellularAutomaton + # LOCAL local_southeast_at_CellularAutomaton_internal_2 --> -12($fp) + lw $t1, 20($s1) + sw $t1, -12($fp) + # local_southeast_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southeast_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t1, 16($s1) + sw $t1, -20($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_4 --> -20($fp) + # local_southeast_at_CellularAutomaton_internal_3 = PARAM param_southeast_at_CellularAutomaton_position_0 + local_southeast_at_CellularAutomaton_internal_4 + lw $t1, 0($fp) + lw $t2, -20($fp) + add $t1, $t1, $t2 + sw $t1, -16($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_3 --> -16($fp) + # local_southeast_at_CellularAutomaton_internal_1 = local_southeast_at_CellularAutomaton_internal_2 - local_southeast_at_CellularAutomaton_internal_3 + lw $t1, -12($fp) + lw $t2, -16($fp) + sub $t1, $t1, $t2 + sw $t1, -8($fp) + # IF_GREATER_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_71 + # IF_GREATER_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_71 + lw $t1, -8($fp) + bgt $t1, 0, label_FALSE_71 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_71 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_71 + lw $t1, -8($fp) + beq $t1, 0, label_FALSE_71 + # LOCAL local_southeast_at_CellularAutomaton_internal_1 --> -8($fp) + # local_southeast_at_CellularAutomaton_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + # GOTO label_END_72 +j label_END_72 +label_FALSE_71: + # LOCAL local_southeast_at_CellularAutomaton_internal_1 --> -8($fp) + # local_southeast_at_CellularAutomaton_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + label_END_72: +# IF_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_69 +# IF_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_69 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_69 +# LOCAL local_southeast_at_CellularAutomaton_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_15 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -24($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_5 --> -24($fp) +# local_southeast_at_CellularAutomaton_internal_0 = local_southeast_at_CellularAutomaton_internal_5 +lw $t1, -24($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_70 +j label_ENDIF_70 +label_FALSEIF_69: + # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) + # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) + # local_southeast_at_CellularAutomaton_internal_10 = PARAM param_southeast_at_CellularAutomaton_position_0 + 1 + lw $t1, 0($fp) + add $t1, $t1, 1 + sw $t1, -44($fp) + # local_southeast_at_CellularAutomaton_internal_11 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) + lw $t1, 16($s1) + sw $t1, -48($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) + # local_southeast_at_CellularAutomaton_internal_9 = local_southeast_at_CellularAutomaton_internal_10 / local_southeast_at_CellularAutomaton_internal_11 + lw $t1, -44($fp) + lw $t2, -48($fp) + div $t1, $t1, $t2 + sw $t1, -40($fp) + # local_southeast_at_CellularAutomaton_internal_12 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southeast_at_CellularAutomaton_internal_12 --> -52($fp) + lw $t1, 16($s1) + sw $t1, -52($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_12 --> -52($fp) + # local_southeast_at_CellularAutomaton_internal_8 = local_southeast_at_CellularAutomaton_internal_9 * local_southeast_at_CellularAutomaton_internal_12 + lw $t1, -40($fp) + lw $t2, -52($fp) + mul $t1, $t1, $t2 + sw $t1, -36($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_13 --> -56($fp) + # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) + # local_southeast_at_CellularAutomaton_internal_13 = PARAM param_southeast_at_CellularAutomaton_position_0 + 1 + lw $t1, 0($fp) + add $t1, $t1, 1 + sw $t1, -56($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_13 --> -56($fp) + # local_southeast_at_CellularAutomaton_internal_7 = local_southeast_at_CellularAutomaton_internal_8 - local_southeast_at_CellularAutomaton_internal_13 + lw $t1, -36($fp) + lw $t2, -56($fp) + sub $t1, $t1, $t2 + sw $t1, -32($fp) + # IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_TRUE_75 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_TRUE_75 + lw $t1, -32($fp) + beq $t1, 0, label_TRUE_75 + # LOCAL local_southeast_at_CellularAutomaton_internal_7 --> -32($fp) + # local_southeast_at_CellularAutomaton_internal_7 = 0 + li $t1, 0 + sw $t1, -32($fp) + # GOTO label_END_76 +j label_END_76 +label_TRUE_75: + # LOCAL local_southeast_at_CellularAutomaton_internal_7 --> -32($fp) + # local_southeast_at_CellularAutomaton_internal_7 = 1 + li $t1, 1 + sw $t1, -32($fp) + label_END_76: +# IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_73 +# IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_73 +lw $t1, -32($fp) +beq $t1, 0, label_FALSEIF_73 +# LOCAL local_southeast_at_CellularAutomaton_internal_14 --> -60($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_16 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -60($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_14 --> -60($fp) +# local_southeast_at_CellularAutomaton_internal_6 = local_southeast_at_CellularAutomaton_internal_14 +lw $t1, -60($fp) +sw $t1, -28($fp) +# GOTO label_ENDIF_74 +j label_ENDIF_74 +label_FALSEIF_73: + # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) + # local_southeast_at_CellularAutomaton_internal_17 = SELF + sw $s1, -72($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_15 --> -64($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) + # local_southeast_at_CellularAutomaton_internal_15 = local_southeast_at_CellularAutomaton_internal_17 + lw $t1, -72($fp) + sw $t1, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_southeast_at_CellularAutomaton_internal_18 --> -76($fp) + # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) + # local_southeast_at_CellularAutomaton_internal_18 = PARAM param_southeast_at_CellularAutomaton_position_0 + 1 + lw $t1, 0($fp) + add $t1, $t1, 1 + sw $t1, -76($fp) + # ARG local_southeast_at_CellularAutomaton_internal_18 + # LOCAL local_southeast_at_CellularAutomaton_internal_18 --> -76($fp) + lw $t1, -76($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_southeast_at_CellularAutomaton_internal_15 --> -64($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_16 --> -68($fp) + # local_southeast_at_CellularAutomaton_internal_16 = VCALL local_southeast_at_CellularAutomaton_internal_15 south + # Save new self pointer in $s1 + lw $s1, -64($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 56($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_southeast_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_16 --> -68($fp) + # local_southeast_at_CellularAutomaton_internal_6 = local_southeast_at_CellularAutomaton_internal_16 + lw $t1, -68($fp) + sw $t1, -28($fp) + label_ENDIF_74: +# LOCAL local_southeast_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_6 --> -28($fp) +# local_southeast_at_CellularAutomaton_internal_0 = local_southeast_at_CellularAutomaton_internal_6 +lw $t1, -28($fp) +sw $t1, -4($fp) +label_ENDIF_70: +# RETURN local_southeast_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_southeast_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 84 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_southwest_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_southwest_at_CellularAutomaton_position_0 +function_southwest_at_CellularAutomaton: + # Allocate stack frame for function function_southwest_at_CellularAutomaton. + subu $sp, $sp, 76 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 76 + # local_southwest_at_CellularAutomaton_internal_2 = GETATTRIBUTE board_size CellularAutomaton + # LOCAL local_southwest_at_CellularAutomaton_internal_2 --> -12($fp) + lw $t1, 20($s1) + sw $t1, -12($fp) + # local_southwest_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southwest_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t1, 16($s1) + sw $t1, -20($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_4 --> -20($fp) + # local_southwest_at_CellularAutomaton_internal_3 = PARAM param_southwest_at_CellularAutomaton_position_0 + local_southwest_at_CellularAutomaton_internal_4 + lw $t1, 0($fp) + lw $t2, -20($fp) + add $t1, $t1, $t2 + sw $t1, -16($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_3 --> -16($fp) + # local_southwest_at_CellularAutomaton_internal_1 = local_southwest_at_CellularAutomaton_internal_2 - local_southwest_at_CellularAutomaton_internal_3 + lw $t1, -12($fp) + lw $t2, -16($fp) + sub $t1, $t1, $t2 + sw $t1, -8($fp) + # IF_GREATER_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_79 + # IF_GREATER_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_79 + lw $t1, -8($fp) + bgt $t1, 0, label_FALSE_79 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_79 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_79 + lw $t1, -8($fp) + beq $t1, 0, label_FALSE_79 + # LOCAL local_southwest_at_CellularAutomaton_internal_1 --> -8($fp) + # local_southwest_at_CellularAutomaton_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + # GOTO label_END_80 +j label_END_80 +label_FALSE_79: + # LOCAL local_southwest_at_CellularAutomaton_internal_1 --> -8($fp) + # local_southwest_at_CellularAutomaton_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + label_END_80: +# IF_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_77 +# IF_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_77 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_77 +# LOCAL local_southwest_at_CellularAutomaton_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_17 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -24($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_5 --> -24($fp) +# local_southwest_at_CellularAutomaton_internal_0 = local_southwest_at_CellularAutomaton_internal_5 +lw $t1, -24($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_78 +j label_ENDIF_78 +label_FALSEIF_77: + # local_southwest_at_CellularAutomaton_internal_10 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) + lw $t1, 16($s1) + sw $t1, -44($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_9 --> -40($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) + # local_southwest_at_CellularAutomaton_internal_9 = PARAM param_southwest_at_CellularAutomaton_position_0 / local_southwest_at_CellularAutomaton_internal_10 + lw $t1, 0($fp) + lw $t2, -44($fp) + div $t1, $t1, $t2 + sw $t1, -40($fp) + # local_southwest_at_CellularAutomaton_internal_11 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) + lw $t1, 16($s1) + sw $t1, -48($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) + # local_southwest_at_CellularAutomaton_internal_8 = local_southwest_at_CellularAutomaton_internal_9 * local_southwest_at_CellularAutomaton_internal_11 + lw $t1, -40($fp) + lw $t2, -48($fp) + mul $t1, $t1, $t2 + sw $t1, -36($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_8 --> -36($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + # local_southwest_at_CellularAutomaton_internal_7 = local_southwest_at_CellularAutomaton_internal_8 - PARAM param_southwest_at_CellularAutomaton_position_0 + lw $t1, -36($fp) + lw $t2, 0($fp) + sub $t1, $t1, $t2 + sw $t1, -32($fp) + # IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_TRUE_83 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_TRUE_83 + lw $t1, -32($fp) + beq $t1, 0, label_TRUE_83 + # LOCAL local_southwest_at_CellularAutomaton_internal_7 --> -32($fp) + # local_southwest_at_CellularAutomaton_internal_7 = 0 + li $t1, 0 + sw $t1, -32($fp) + # GOTO label_END_84 +j label_END_84 +label_TRUE_83: + # LOCAL local_southwest_at_CellularAutomaton_internal_7 --> -32($fp) + # local_southwest_at_CellularAutomaton_internal_7 = 1 + li $t1, 1 + sw $t1, -32($fp) + label_END_84: +# IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_81 +# IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_81 +lw $t1, -32($fp) +beq $t1, 0, label_FALSEIF_81 +# LOCAL local_southwest_at_CellularAutomaton_internal_12 --> -52($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_18 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -52($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_12 --> -52($fp) +# local_southwest_at_CellularAutomaton_internal_6 = local_southwest_at_CellularAutomaton_internal_12 +lw $t1, -52($fp) +sw $t1, -28($fp) +# GOTO label_ENDIF_82 +j label_ENDIF_82 +label_FALSEIF_81: + # LOCAL local_southwest_at_CellularAutomaton_internal_15 --> -64($fp) + # local_southwest_at_CellularAutomaton_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_15 --> -64($fp) + # local_southwest_at_CellularAutomaton_internal_13 = local_southwest_at_CellularAutomaton_internal_15 + lw $t1, -64($fp) + sw $t1, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_southwest_at_CellularAutomaton_internal_16 --> -68($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + # local_southwest_at_CellularAutomaton_internal_16 = PARAM param_southwest_at_CellularAutomaton_position_0 - 1 + lw $t1, 0($fp) + sub $t1, $t1, 1 + sw $t1, -68($fp) + # ARG local_southwest_at_CellularAutomaton_internal_16 + # LOCAL local_southwest_at_CellularAutomaton_internal_16 --> -68($fp) + lw $t1, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_southwest_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_14 --> -60($fp) + # local_southwest_at_CellularAutomaton_internal_14 = VCALL local_southwest_at_CellularAutomaton_internal_13 south + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 56($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_southwest_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_14 --> -60($fp) + # local_southwest_at_CellularAutomaton_internal_6 = local_southwest_at_CellularAutomaton_internal_14 + lw $t1, -60($fp) + sw $t1, -28($fp) + label_ENDIF_82: +# LOCAL local_southwest_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_6 --> -28($fp) +# local_southwest_at_CellularAutomaton_internal_0 = local_southwest_at_CellularAutomaton_internal_6 +lw $t1, -28($fp) +sw $t1, -4($fp) +label_ENDIF_78: +# RETURN local_southwest_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_southwest_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 76 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_neighbors_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_neighbors_at_CellularAutomaton_position_0 +function_neighbors_at_CellularAutomaton: + # Allocate stack frame for function function_neighbors_at_CellularAutomaton. + subu $sp, $sp, 228 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 228 + # LOCAL local_neighbors_at_CellularAutomaton_internal_11 --> -48($fp) + # local_neighbors_at_CellularAutomaton_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_11 --> -48($fp) + # local_neighbors_at_CellularAutomaton_internal_9 = local_neighbors_at_CellularAutomaton_internal_11 + lw $t1, -48($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_neighbors_at_CellularAutomaton_position_0 + # PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) + lw $t1, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) + # local_neighbors_at_CellularAutomaton_internal_10 = VCALL local_neighbors_at_CellularAutomaton_internal_9 north + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 52($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_19 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -52($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) + # local_neighbors_at_CellularAutomaton_internal_8 = local_neighbors_at_CellularAutomaton_internal_10 - local_neighbors_at_CellularAutomaton_internal_12 + lw $t1, -44($fp) + lw $t2, -52($fp) + sub $t1, $t1, $t2 + sw $t1, -36($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_8 GOTO label_TRUE_87 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_8 GOTO label_TRUE_87 + lw $t1, -36($fp) + beq $t1, 0, label_TRUE_87 + # LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) + # local_neighbors_at_CellularAutomaton_internal_8 = 0 + li $t1, 0 + sw $t1, -36($fp) + # GOTO label_END_88 +j label_END_88 +label_TRUE_87: + # LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) + # local_neighbors_at_CellularAutomaton_internal_8 = 1 + li $t1, 1 + sw $t1, -36($fp) + label_END_88: +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_8 GOTO label_FALSEIF_85 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_8 GOTO label_FALSEIF_85 +lw $t1, -36($fp) +beq $t1, 0, label_FALSEIF_85 +# LOCAL local_neighbors_at_CellularAutomaton_internal_7 --> -32($fp) +# local_neighbors_at_CellularAutomaton_internal_7 = 1 +li $t1, 1 +sw $t1, -32($fp) +# GOTO label_ENDIF_86 +j label_ENDIF_86 +label_FALSEIF_85: + # LOCAL local_neighbors_at_CellularAutomaton_internal_7 --> -32($fp) + # local_neighbors_at_CellularAutomaton_internal_7 = 0 + li $t1, 0 + sw $t1, -32($fp) + label_ENDIF_86: +# LOCAL local_neighbors_at_CellularAutomaton_internal_17 --> -72($fp) +# local_neighbors_at_CellularAutomaton_internal_17 = SELF +sw $s1, -72($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_15 --> -64($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_17 --> -72($fp) +# local_neighbors_at_CellularAutomaton_internal_15 = local_neighbors_at_CellularAutomaton_internal_17 +lw $t1, -72($fp) +sw $t1, -64($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_15 --> -64($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_16 --> -68($fp) +# local_neighbors_at_CellularAutomaton_internal_16 = VCALL local_neighbors_at_CellularAutomaton_internal_15 south +# Save new self pointer in $s1 +lw $s1, -64($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 56($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -68($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_18 --> -76($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_20 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -76($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_16 --> -68($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_18 --> -76($fp) +# local_neighbors_at_CellularAutomaton_internal_14 = local_neighbors_at_CellularAutomaton_internal_16 - local_neighbors_at_CellularAutomaton_internal_18 +lw $t1, -68($fp) +lw $t2, -76($fp) +sub $t1, $t1, $t2 +sw $t1, -60($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_TRUE_91 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_TRUE_91 +lw $t1, -60($fp) +beq $t1, 0, label_TRUE_91 +# LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) +# local_neighbors_at_CellularAutomaton_internal_14 = 0 +li $t1, 0 +sw $t1, -60($fp) +# GOTO label_END_92 +j label_END_92 +label_TRUE_91: + # LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) + # local_neighbors_at_CellularAutomaton_internal_14 = 1 + li $t1, 1 + sw $t1, -60($fp) + label_END_92: +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_FALSEIF_89 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_FALSEIF_89 +lw $t1, -60($fp) +beq $t1, 0, label_FALSEIF_89 +# LOCAL local_neighbors_at_CellularAutomaton_internal_13 --> -56($fp) +# local_neighbors_at_CellularAutomaton_internal_13 = 1 +li $t1, 1 +sw $t1, -56($fp) +# GOTO label_ENDIF_90 +j label_ENDIF_90 +label_FALSEIF_89: + # LOCAL local_neighbors_at_CellularAutomaton_internal_13 --> -56($fp) + # local_neighbors_at_CellularAutomaton_internal_13 = 0 + li $t1, 0 + sw $t1, -56($fp) + label_ENDIF_90: +# LOCAL local_neighbors_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_13 --> -56($fp) +# local_neighbors_at_CellularAutomaton_internal_6 = local_neighbors_at_CellularAutomaton_internal_7 + local_neighbors_at_CellularAutomaton_internal_13 +lw $t1, -32($fp) +lw $t2, -56($fp) +add $t1, $t1, $t2 +sw $t1, -28($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_23 --> -96($fp) +# local_neighbors_at_CellularAutomaton_internal_23 = SELF +sw $s1, -96($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_21 --> -88($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_23 --> -96($fp) +# local_neighbors_at_CellularAutomaton_internal_21 = local_neighbors_at_CellularAutomaton_internal_23 +lw $t1, -96($fp) +sw $t1, -88($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_21 --> -88($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) +# local_neighbors_at_CellularAutomaton_internal_22 = VCALL local_neighbors_at_CellularAutomaton_internal_21 east +# Save new self pointer in $s1 +lw $s1, -88($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 60($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -92($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_21 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -100($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) +# local_neighbors_at_CellularAutomaton_internal_20 = local_neighbors_at_CellularAutomaton_internal_22 - local_neighbors_at_CellularAutomaton_internal_24 +lw $t1, -92($fp) +lw $t2, -100($fp) +sub $t1, $t1, $t2 +sw $t1, -84($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_95 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_95 +lw $t1, -84($fp) +beq $t1, 0, label_TRUE_95 +# LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) +# local_neighbors_at_CellularAutomaton_internal_20 = 0 +li $t1, 0 +sw $t1, -84($fp) +# GOTO label_END_96 +j label_END_96 +label_TRUE_95: + # LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) + # local_neighbors_at_CellularAutomaton_internal_20 = 1 + li $t1, 1 + sw $t1, -84($fp) + label_END_96: +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_FALSEIF_93 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_FALSEIF_93 +lw $t1, -84($fp) +beq $t1, 0, label_FALSEIF_93 +# LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) +# local_neighbors_at_CellularAutomaton_internal_19 = 1 +li $t1, 1 +sw $t1, -80($fp) +# GOTO label_ENDIF_94 +j label_ENDIF_94 +label_FALSEIF_93: + # LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) + # local_neighbors_at_CellularAutomaton_internal_19 = 0 + li $t1, 0 + sw $t1, -80($fp) + label_ENDIF_94: +# LOCAL local_neighbors_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) +# local_neighbors_at_CellularAutomaton_internal_5 = local_neighbors_at_CellularAutomaton_internal_6 + local_neighbors_at_CellularAutomaton_internal_19 +lw $t1, -28($fp) +lw $t2, -80($fp) +add $t1, $t1, $t2 +sw $t1, -24($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_29 --> -120($fp) +# local_neighbors_at_CellularAutomaton_internal_29 = SELF +sw $s1, -120($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_27 --> -112($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_29 --> -120($fp) +# local_neighbors_at_CellularAutomaton_internal_27 = local_neighbors_at_CellularAutomaton_internal_29 +lw $t1, -120($fp) +sw $t1, -112($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_27 --> -112($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_28 --> -116($fp) +# local_neighbors_at_CellularAutomaton_internal_28 = VCALL local_neighbors_at_CellularAutomaton_internal_27 west +# Save new self pointer in $s1 +lw $s1, -112($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 64($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -116($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_22 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -124($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_26 --> -108($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_28 --> -116($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) +# local_neighbors_at_CellularAutomaton_internal_26 = local_neighbors_at_CellularAutomaton_internal_28 - local_neighbors_at_CellularAutomaton_internal_30 +lw $t1, -116($fp) +lw $t2, -124($fp) +sub $t1, $t1, $t2 +sw $t1, -108($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_26 GOTO label_TRUE_99 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_26 GOTO label_TRUE_99 +lw $t1, -108($fp) +beq $t1, 0, label_TRUE_99 +# LOCAL local_neighbors_at_CellularAutomaton_internal_26 --> -108($fp) +# local_neighbors_at_CellularAutomaton_internal_26 = 0 +li $t1, 0 +sw $t1, -108($fp) +# GOTO label_END_100 +j label_END_100 +label_TRUE_99: + # LOCAL local_neighbors_at_CellularAutomaton_internal_26 --> -108($fp) + # local_neighbors_at_CellularAutomaton_internal_26 = 1 + li $t1, 1 + sw $t1, -108($fp) + label_END_100: +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_26 GOTO label_FALSEIF_97 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_26 GOTO label_FALSEIF_97 +lw $t1, -108($fp) +beq $t1, 0, label_FALSEIF_97 +# LOCAL local_neighbors_at_CellularAutomaton_internal_25 --> -104($fp) +# local_neighbors_at_CellularAutomaton_internal_25 = 1 +li $t1, 1 +sw $t1, -104($fp) +# GOTO label_ENDIF_98 +j label_ENDIF_98 +label_FALSEIF_97: + # LOCAL local_neighbors_at_CellularAutomaton_internal_25 --> -104($fp) + # local_neighbors_at_CellularAutomaton_internal_25 = 0 + li $t1, 0 + sw $t1, -104($fp) + label_ENDIF_98: +# LOCAL local_neighbors_at_CellularAutomaton_internal_4 --> -20($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_25 --> -104($fp) +# local_neighbors_at_CellularAutomaton_internal_4 = local_neighbors_at_CellularAutomaton_internal_5 + local_neighbors_at_CellularAutomaton_internal_25 +lw $t1, -24($fp) +lw $t2, -104($fp) +add $t1, $t1, $t2 +sw $t1, -20($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_35 --> -144($fp) +# local_neighbors_at_CellularAutomaton_internal_35 = SELF +sw $s1, -144($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_33 --> -136($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_35 --> -144($fp) +# local_neighbors_at_CellularAutomaton_internal_33 = local_neighbors_at_CellularAutomaton_internal_35 +lw $t1, -144($fp) +sw $t1, -136($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_33 --> -136($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) +# local_neighbors_at_CellularAutomaton_internal_34 = VCALL local_neighbors_at_CellularAutomaton_internal_33 northeast +# Save new self pointer in $s1 +lw $s1, -136($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 72($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -140($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_36 --> -148($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_23 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -148($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_36 --> -148($fp) +# local_neighbors_at_CellularAutomaton_internal_32 = local_neighbors_at_CellularAutomaton_internal_34 - local_neighbors_at_CellularAutomaton_internal_36 +lw $t1, -140($fp) +lw $t2, -148($fp) +sub $t1, $t1, $t2 +sw $t1, -132($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_TRUE_103 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_TRUE_103 +lw $t1, -132($fp) +beq $t1, 0, label_TRUE_103 +# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) +# local_neighbors_at_CellularAutomaton_internal_32 = 0 +li $t1, 0 +sw $t1, -132($fp) +# GOTO label_END_104 +j label_END_104 +label_TRUE_103: + # LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) + # local_neighbors_at_CellularAutomaton_internal_32 = 1 + li $t1, 1 + sw $t1, -132($fp) + label_END_104: +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_FALSEIF_101 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_FALSEIF_101 +lw $t1, -132($fp) +beq $t1, 0, label_FALSEIF_101 +# LOCAL local_neighbors_at_CellularAutomaton_internal_31 --> -128($fp) +# local_neighbors_at_CellularAutomaton_internal_31 = 1 +li $t1, 1 +sw $t1, -128($fp) +# GOTO label_ENDIF_102 +j label_ENDIF_102 +label_FALSEIF_101: + # LOCAL local_neighbors_at_CellularAutomaton_internal_31 --> -128($fp) + # local_neighbors_at_CellularAutomaton_internal_31 = 0 + li $t1, 0 + sw $t1, -128($fp) + label_ENDIF_102: +# LOCAL local_neighbors_at_CellularAutomaton_internal_3 --> -16($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_4 --> -20($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_31 --> -128($fp) +# local_neighbors_at_CellularAutomaton_internal_3 = local_neighbors_at_CellularAutomaton_internal_4 + local_neighbors_at_CellularAutomaton_internal_31 +lw $t1, -20($fp) +lw $t2, -128($fp) +add $t1, $t1, $t2 +sw $t1, -16($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_41 --> -168($fp) +# local_neighbors_at_CellularAutomaton_internal_41 = SELF +sw $s1, -168($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_39 --> -160($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_41 --> -168($fp) +# local_neighbors_at_CellularAutomaton_internal_39 = local_neighbors_at_CellularAutomaton_internal_41 +lw $t1, -168($fp) +sw $t1, -160($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_39 --> -160($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) +# local_neighbors_at_CellularAutomaton_internal_40 = VCALL local_neighbors_at_CellularAutomaton_internal_39 northwest +# Save new self pointer in $s1 +lw $s1, -160($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 68($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -164($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_24 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -172($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) +# local_neighbors_at_CellularAutomaton_internal_38 = local_neighbors_at_CellularAutomaton_internal_40 - local_neighbors_at_CellularAutomaton_internal_42 +lw $t1, -164($fp) +lw $t2, -172($fp) +sub $t1, $t1, $t2 +sw $t1, -156($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_38 GOTO label_TRUE_107 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_38 GOTO label_TRUE_107 +lw $t1, -156($fp) +beq $t1, 0, label_TRUE_107 +# LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) +# local_neighbors_at_CellularAutomaton_internal_38 = 0 +li $t1, 0 +sw $t1, -156($fp) +# GOTO label_END_108 +j label_END_108 +label_TRUE_107: + # LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) + # local_neighbors_at_CellularAutomaton_internal_38 = 1 + li $t1, 1 + sw $t1, -156($fp) + label_END_108: +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_38 GOTO label_FALSEIF_105 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_38 GOTO label_FALSEIF_105 +lw $t1, -156($fp) +beq $t1, 0, label_FALSEIF_105 +# LOCAL local_neighbors_at_CellularAutomaton_internal_37 --> -152($fp) +# local_neighbors_at_CellularAutomaton_internal_37 = 1 +li $t1, 1 +sw $t1, -152($fp) +# GOTO label_ENDIF_106 +j label_ENDIF_106 +label_FALSEIF_105: + # LOCAL local_neighbors_at_CellularAutomaton_internal_37 --> -152($fp) + # local_neighbors_at_CellularAutomaton_internal_37 = 0 + li $t1, 0 + sw $t1, -152($fp) + label_ENDIF_106: +# LOCAL local_neighbors_at_CellularAutomaton_internal_2 --> -12($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_3 --> -16($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_37 --> -152($fp) +# local_neighbors_at_CellularAutomaton_internal_2 = local_neighbors_at_CellularAutomaton_internal_3 + local_neighbors_at_CellularAutomaton_internal_37 +lw $t1, -16($fp) +lw $t2, -152($fp) +add $t1, $t1, $t2 +sw $t1, -12($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_47 --> -192($fp) +# local_neighbors_at_CellularAutomaton_internal_47 = SELF +sw $s1, -192($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_45 --> -184($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_47 --> -192($fp) +# local_neighbors_at_CellularAutomaton_internal_45 = local_neighbors_at_CellularAutomaton_internal_47 +lw $t1, -192($fp) +sw $t1, -184($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_45 --> -184($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_46 --> -188($fp) +# local_neighbors_at_CellularAutomaton_internal_46 = VCALL local_neighbors_at_CellularAutomaton_internal_45 southeast +# Save new self pointer in $s1 +lw $s1, -184($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 76($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -188($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_48 --> -196($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_25 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -196($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_46 --> -188($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_48 --> -196($fp) +# local_neighbors_at_CellularAutomaton_internal_44 = local_neighbors_at_CellularAutomaton_internal_46 - local_neighbors_at_CellularAutomaton_internal_48 +lw $t1, -188($fp) +lw $t2, -196($fp) +sub $t1, $t1, $t2 +sw $t1, -180($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_TRUE_111 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_TRUE_111 +lw $t1, -180($fp) +beq $t1, 0, label_TRUE_111 +# LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) +# local_neighbors_at_CellularAutomaton_internal_44 = 0 +li $t1, 0 +sw $t1, -180($fp) +# GOTO label_END_112 +j label_END_112 +label_TRUE_111: + # LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) + # local_neighbors_at_CellularAutomaton_internal_44 = 1 + li $t1, 1 + sw $t1, -180($fp) + label_END_112: +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_FALSEIF_109 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_FALSEIF_109 +lw $t1, -180($fp) +beq $t1, 0, label_FALSEIF_109 +# LOCAL local_neighbors_at_CellularAutomaton_internal_43 --> -176($fp) +# local_neighbors_at_CellularAutomaton_internal_43 = 1 +li $t1, 1 +sw $t1, -176($fp) +# GOTO label_ENDIF_110 +j label_ENDIF_110 +label_FALSEIF_109: + # LOCAL local_neighbors_at_CellularAutomaton_internal_43 --> -176($fp) + # local_neighbors_at_CellularAutomaton_internal_43 = 0 + li $t1, 0 + sw $t1, -176($fp) + label_ENDIF_110: +# LOCAL local_neighbors_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_2 --> -12($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_43 --> -176($fp) +# local_neighbors_at_CellularAutomaton_internal_1 = local_neighbors_at_CellularAutomaton_internal_2 + local_neighbors_at_CellularAutomaton_internal_43 +lw $t1, -12($fp) +lw $t2, -176($fp) +add $t1, $t1, $t2 +sw $t1, -8($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_53 --> -216($fp) +# local_neighbors_at_CellularAutomaton_internal_53 = SELF +sw $s1, -216($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_51 --> -208($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_53 --> -216($fp) +# local_neighbors_at_CellularAutomaton_internal_51 = local_neighbors_at_CellularAutomaton_internal_53 +lw $t1, -216($fp) +sw $t1, -208($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_51 --> -208($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) +# local_neighbors_at_CellularAutomaton_internal_52 = VCALL local_neighbors_at_CellularAutomaton_internal_51 southwest +# Save new self pointer in $s1 +lw $s1, -208($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 80($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -212($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_26 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -220($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) +# local_neighbors_at_CellularAutomaton_internal_50 = local_neighbors_at_CellularAutomaton_internal_52 - local_neighbors_at_CellularAutomaton_internal_54 +lw $t1, -212($fp) +lw $t2, -220($fp) +sub $t1, $t1, $t2 +sw $t1, -204($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_115 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_115 +lw $t1, -204($fp) +beq $t1, 0, label_TRUE_115 +# LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) +# local_neighbors_at_CellularAutomaton_internal_50 = 0 +li $t1, 0 +sw $t1, -204($fp) +# GOTO label_END_116 +j label_END_116 +label_TRUE_115: + # LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) + # local_neighbors_at_CellularAutomaton_internal_50 = 1 + li $t1, 1 + sw $t1, -204($fp) + label_END_116: +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_FALSEIF_113 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_FALSEIF_113 +lw $t1, -204($fp) +beq $t1, 0, label_FALSEIF_113 +# LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) +# local_neighbors_at_CellularAutomaton_internal_49 = 1 +li $t1, 1 +sw $t1, -200($fp) +# GOTO label_ENDIF_114 +j label_ENDIF_114 +label_FALSEIF_113: + # LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) + # local_neighbors_at_CellularAutomaton_internal_49 = 0 + li $t1, 0 + sw $t1, -200($fp) + label_ENDIF_114: +# LOCAL local_neighbors_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) +# local_neighbors_at_CellularAutomaton_internal_0 = local_neighbors_at_CellularAutomaton_internal_1 + local_neighbors_at_CellularAutomaton_internal_49 +lw $t1, -8($fp) +lw $t2, -200($fp) +add $t1, $t1, $t2 +sw $t1, -4($fp) +# RETURN local_neighbors_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_neighbors_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 228 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_cell_at_next_evolution_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_cell_at_next_evolution_at_CellularAutomaton_position_0 +function_cell_at_next_evolution_at_CellularAutomaton: + # Allocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_2 = local_cell_at_next_evolution_at_CellularAutomaton_internal_4 + lw $t1, -20($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 + # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) + lw $t1, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_3 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 neighbors + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 84($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = local_cell_at_next_evolution_at_CellularAutomaton_internal_3 - 3 + lw $t1, -16($fp) + sub $t1, $t1, 3 + sw $t1, -8($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_TRUE_119 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_TRUE_119 + lw $t1, -8($fp) + beq $t1, 0, label_TRUE_119 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # GOTO label_END_120 +j label_END_120 +label_TRUE_119: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + label_END_120: +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_117 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_117 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_117 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_27 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -24($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_0 = local_cell_at_next_evolution_at_CellularAutomaton_internal_5 +lw $t1, -24($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_118 +j label_ENDIF_118 +label_FALSEIF_117: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_10 = SELF + sw $s1, -44($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_8 = local_cell_at_next_evolution_at_CellularAutomaton_internal_10 + lw $t1, -44($fp) + sw $t1, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 + # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) + lw $t1, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_9 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 neighbors + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 84($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = local_cell_at_next_evolution_at_CellularAutomaton_internal_9 - 2 + lw $t1, -40($fp) + sub $t1, $t1, 2 + sw $t1, -32($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_TRUE_123 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_TRUE_123 + lw $t1, -32($fp) + beq $t1, 0, label_TRUE_123 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = 0 + li $t1, 0 + sw $t1, -32($fp) + # GOTO label_END_124 +j label_END_124 +label_TRUE_123: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = 1 + li $t1, 1 + sw $t1, -32($fp) + label_END_124: +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_121 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_121 +lw $t1, -32($fp) +beq $t1, 0, label_FALSEIF_121 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_15 = SELF +sw $s1, -64($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_13 = local_cell_at_next_evolution_at_CellularAutomaton_internal_15 +lw $t1, -64($fp) +sw $t1, -56($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 +# PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_14 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 cell +# Save new self pointer in $s1 +lw $s1, -56($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 48($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -60($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_28 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -68($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = local_cell_at_next_evolution_at_CellularAutomaton_internal_14 - local_cell_at_next_evolution_at_CellularAutomaton_internal_16 +lw $t1, -60($fp) +lw $t2, -68($fp) +sub $t1, $t1, $t2 +sw $t1, -52($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_127 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_127 +lw $t1, -52($fp) +beq $t1, 0, label_TRUE_127 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = 0 +li $t1, 0 +sw $t1, -52($fp) +# GOTO label_END_128 +j label_END_128 +label_TRUE_127: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = 1 + li $t1, 1 + sw $t1, -52($fp) + label_END_128: +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_FALSEIF_125 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_FALSEIF_125 +lw $t1, -52($fp) +beq $t1, 0, label_FALSEIF_125 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_29 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -72($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_11 = local_cell_at_next_evolution_at_CellularAutomaton_internal_17 +lw $t1, -72($fp) +sw $t1, -48($fp) +# GOTO label_ENDIF_126 +j label_ENDIF_126 +label_FALSEIF_125: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_30 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -76($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_11 = local_cell_at_next_evolution_at_CellularAutomaton_internal_18 + lw $t1, -76($fp) + sw $t1, -48($fp) + label_ENDIF_126: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_6 = local_cell_at_next_evolution_at_CellularAutomaton_internal_11 +lw $t1, -48($fp) +sw $t1, -28($fp) +# GOTO label_ENDIF_122 +j label_ENDIF_122 +label_FALSEIF_121: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_31 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -80($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_6 = local_cell_at_next_evolution_at_CellularAutomaton_internal_19 + lw $t1, -80($fp) + sw $t1, -28($fp) + label_ENDIF_122: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_0 = local_cell_at_next_evolution_at_CellularAutomaton_internal_6 +lw $t1, -28($fp) +sw $t1, -4($fp) +label_ENDIF_118: +# RETURN local_cell_at_next_evolution_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_evolve_at_CellularAutomaton implementation. +# @Params: +function_evolve_at_CellularAutomaton: + # Allocate stack frame for function function_evolve_at_CellularAutomaton. + subu $sp, $sp, 64 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 64 + # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) + # local_evolve_at_CellularAutomaton_position_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) + # local_evolve_at_CellularAutomaton_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) + # local_evolve_at_CellularAutomaton_internal_2 = local_evolve_at_CellularAutomaton_internal_4 + lw $t1, -20($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_evolve_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) + # local_evolve_at_CellularAutomaton_internal_3 = VCALL local_evolve_at_CellularAutomaton_internal_2 num_cells + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 44($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) + # local_evolve_at_CellularAutomaton_num_1 = local_evolve_at_CellularAutomaton_internal_3 + lw $t1, -16($fp) + sw $t1, -8($fp) + # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) + # local_evolve_at_CellularAutomaton_temp_5 = 0 + li $t1, 0 + sw $t1, -24($fp) + label_WHILE_129: + # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) + # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) + # local_evolve_at_CellularAutomaton_internal_6 = local_evolve_at_CellularAutomaton_position_0 - local_evolve_at_CellularAutomaton_num_1 + lw $t1, -4($fp) + lw $t2, -8($fp) + sub $t1, $t1, $t2 + sw $t1, -28($fp) + # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_131 + # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_131 + lw $t1, -28($fp) + bgt $t1, 0, label_FALSE_131 + # IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_131 + # IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_131 + lw $t1, -28($fp) + beq $t1, 0, label_FALSE_131 + # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) + # local_evolve_at_CellularAutomaton_internal_6 = 1 + li $t1, 1 + sw $t1, -28($fp) + # GOTO label_END_132 +j label_END_132 +label_FALSE_131: + # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) + # local_evolve_at_CellularAutomaton_internal_6 = 0 + li $t1, 0 + sw $t1, -28($fp) + label_END_132: +# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_130 +# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_130 +lw $t1, -28($fp) +beq $t1, 0, label_WHILE_END_130 +# LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) +# local_evolve_at_CellularAutomaton_internal_7 = local_evolve_at_CellularAutomaton_temp_5 +lw $t1, -24($fp) +sw $t1, -32($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) +# local_evolve_at_CellularAutomaton_internal_11 = SELF +sw $s1, -48($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) +# local_evolve_at_CellularAutomaton_internal_9 = local_evolve_at_CellularAutomaton_internal_11 +lw $t1, -48($fp) +sw $t1, -40($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_evolve_at_CellularAutomaton_position_0 +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +lw $t1, -4($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) +# local_evolve_at_CellularAutomaton_internal_10 = VCALL local_evolve_at_CellularAutomaton_internal_9 cell_at_next_evolution +# Save new self pointer in $s1 +lw $s1, -40($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 88($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -44($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_evolve_at_CellularAutomaton_internal_10 +# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) +lw $t1, -44($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) +# local_evolve_at_CellularAutomaton_internal_8 = VCALL local_evolve_at_CellularAutomaton_internal_7 concat +# Save new self pointer in $s1 +lw $s1, -32($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 0($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -36($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) +# local_evolve_at_CellularAutomaton_temp_5 = local_evolve_at_CellularAutomaton_internal_8 +lw $t1, -36($fp) +sw $t1, -24($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +# local_evolve_at_CellularAutomaton_internal_12 = local_evolve_at_CellularAutomaton_position_0 + 1 +lw $t1, -4($fp) +add $t1, $t1, 1 +sw $t1, -52($fp) +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) +# local_evolve_at_CellularAutomaton_position_0 = local_evolve_at_CellularAutomaton_internal_12 +lw $t1, -52($fp) +sw $t1, -4($fp) +# GOTO label_WHILE_129 +j label_WHILE_129 +label_WHILE_END_130: + # + # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) + lw $t1, -24($fp) + sw $t1, 24($s1) + # LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) + # local_evolve_at_CellularAutomaton_internal_13 = SELF + sw $s1, -56($fp) + # RETURN local_evolve_at_CellularAutomaton_internal_13 + lw $v0, -56($fp) + # Deallocate stack frame for function function_evolve_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 64 + jr $ra + # Function END + + +# function_option_at_CellularAutomaton implementation. +# @Params: +function_option_at_CellularAutomaton: + # Allocate stack frame for function function_option_at_CellularAutomaton. + subu $sp, $sp, 664 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 664 + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_num_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_3 --> -16($fp) + # local_option_at_CellularAutomaton_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_option_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_option_at_CellularAutomaton_internal_3 --> -16($fp) + # local_option_at_CellularAutomaton_internal_1 = local_option_at_CellularAutomaton_internal_3 + lw $t1, -16($fp) + sw $t1, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_32 + sw $t1, 12($v0) + li $t1, 26 + sw $t1, 16($v0) + sw $v0, -20($fp) + # ARG local_option_at_CellularAutomaton_internal_4 + # LOCAL local_option_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t1, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_option_at_CellularAutomaton_internal_2 --> -12($fp) + # local_option_at_CellularAutomaton_internal_2 = VCALL local_option_at_CellularAutomaton_internal_1 out_string + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_7 --> -32($fp) + # local_option_at_CellularAutomaton_internal_7 = SELF + sw $s1, -32($fp) + # LOCAL local_option_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_option_at_CellularAutomaton_internal_7 --> -32($fp) + # local_option_at_CellularAutomaton_internal_5 = local_option_at_CellularAutomaton_internal_7 + lw $t1, -32($fp) + sw $t1, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_33 + sw $t1, 12($v0) + li $t1, 14 + sw $t1, 16($v0) + sw $v0, -36($fp) + # ARG local_option_at_CellularAutomaton_internal_8 + # LOCAL local_option_at_CellularAutomaton_internal_8 --> -36($fp) + lw $t1, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_option_at_CellularAutomaton_internal_6 --> -28($fp) + # local_option_at_CellularAutomaton_internal_6 = VCALL local_option_at_CellularAutomaton_internal_5 out_string + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_11 --> -48($fp) + # local_option_at_CellularAutomaton_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_option_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_option_at_CellularAutomaton_internal_11 --> -48($fp) + # local_option_at_CellularAutomaton_internal_9 = local_option_at_CellularAutomaton_internal_11 + lw $t1, -48($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_34 + sw $t1, 12($v0) + li $t1, 49 + sw $t1, 16($v0) + sw $v0, -52($fp) + # ARG local_option_at_CellularAutomaton_internal_12 + # LOCAL local_option_at_CellularAutomaton_internal_12 --> -52($fp) + lw $t1, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_option_at_CellularAutomaton_internal_10 --> -44($fp) + # local_option_at_CellularAutomaton_internal_10 = VCALL local_option_at_CellularAutomaton_internal_9 out_string + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_15 --> -64($fp) + # local_option_at_CellularAutomaton_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_option_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_option_at_CellularAutomaton_internal_15 --> -64($fp) + # local_option_at_CellularAutomaton_internal_13 = local_option_at_CellularAutomaton_internal_15 + lw $t1, -64($fp) + sw $t1, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_35 + sw $t1, 12($v0) + li $t1, 49 + sw $t1, 16($v0) + sw $v0, -68($fp) + # ARG local_option_at_CellularAutomaton_internal_16 + # LOCAL local_option_at_CellularAutomaton_internal_16 --> -68($fp) + lw $t1, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_option_at_CellularAutomaton_internal_14 --> -60($fp) + # local_option_at_CellularAutomaton_internal_14 = VCALL local_option_at_CellularAutomaton_internal_13 out_string + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_19 --> -80($fp) + # local_option_at_CellularAutomaton_internal_19 = SELF + sw $s1, -80($fp) + # LOCAL local_option_at_CellularAutomaton_internal_17 --> -72($fp) + # LOCAL local_option_at_CellularAutomaton_internal_19 --> -80($fp) + # local_option_at_CellularAutomaton_internal_17 = local_option_at_CellularAutomaton_internal_19 + lw $t1, -80($fp) + sw $t1, -72($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_36 + sw $t1, 12($v0) + li $t1, 11 + sw $t1, 16($v0) + sw $v0, -84($fp) + # ARG local_option_at_CellularAutomaton_internal_20 + # LOCAL local_option_at_CellularAutomaton_internal_20 --> -84($fp) + lw $t1, -84($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_17 --> -72($fp) + # LOCAL local_option_at_CellularAutomaton_internal_18 --> -76($fp) + # local_option_at_CellularAutomaton_internal_18 = VCALL local_option_at_CellularAutomaton_internal_17 out_string + # Save new self pointer in $s1 + lw $s1, -72($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -76($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_23 --> -96($fp) + # local_option_at_CellularAutomaton_internal_23 = SELF + sw $s1, -96($fp) + # LOCAL local_option_at_CellularAutomaton_internal_21 --> -88($fp) + # LOCAL local_option_at_CellularAutomaton_internal_23 --> -96($fp) + # local_option_at_CellularAutomaton_internal_21 = local_option_at_CellularAutomaton_internal_23 + lw $t1, -96($fp) + sw $t1, -88($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_24 --> -100($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_37 + sw $t1, 12($v0) + li $t1, 27 + sw $t1, 16($v0) + sw $v0, -100($fp) + # ARG local_option_at_CellularAutomaton_internal_24 + # LOCAL local_option_at_CellularAutomaton_internal_24 --> -100($fp) + lw $t1, -100($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_21 --> -88($fp) + # LOCAL local_option_at_CellularAutomaton_internal_22 --> -92($fp) + # local_option_at_CellularAutomaton_internal_22 = VCALL local_option_at_CellularAutomaton_internal_21 out_string + # Save new self pointer in $s1 + lw $s1, -88($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -92($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_27 --> -112($fp) + # local_option_at_CellularAutomaton_internal_27 = SELF + sw $s1, -112($fp) + # LOCAL local_option_at_CellularAutomaton_internal_25 --> -104($fp) + # LOCAL local_option_at_CellularAutomaton_internal_27 --> -112($fp) + # local_option_at_CellularAutomaton_internal_25 = local_option_at_CellularAutomaton_internal_27 + lw $t1, -112($fp) + sw $t1, -104($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_28 --> -116($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_38 + sw $t1, 12($v0) + li $t1, 23 + sw $t1, 16($v0) + sw $v0, -116($fp) + # ARG local_option_at_CellularAutomaton_internal_28 + # LOCAL local_option_at_CellularAutomaton_internal_28 --> -116($fp) + lw $t1, -116($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_25 --> -104($fp) + # LOCAL local_option_at_CellularAutomaton_internal_26 --> -108($fp) + # local_option_at_CellularAutomaton_internal_26 = VCALL local_option_at_CellularAutomaton_internal_25 out_string + # Save new self pointer in $s1 + lw $s1, -104($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -108($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_31 --> -128($fp) + # local_option_at_CellularAutomaton_internal_31 = SELF + sw $s1, -128($fp) + # LOCAL local_option_at_CellularAutomaton_internal_29 --> -120($fp) + # LOCAL local_option_at_CellularAutomaton_internal_31 --> -128($fp) + # local_option_at_CellularAutomaton_internal_29 = local_option_at_CellularAutomaton_internal_31 + lw $t1, -128($fp) + sw $t1, -120($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_39 + sw $t1, 12($v0) + li $t1, 29 + sw $t1, 16($v0) + sw $v0, -132($fp) + # ARG local_option_at_CellularAutomaton_internal_32 + # LOCAL local_option_at_CellularAutomaton_internal_32 --> -132($fp) + lw $t1, -132($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_29 --> -120($fp) + # LOCAL local_option_at_CellularAutomaton_internal_30 --> -124($fp) + # local_option_at_CellularAutomaton_internal_30 = VCALL local_option_at_CellularAutomaton_internal_29 out_string + # Save new self pointer in $s1 + lw $s1, -120($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -124($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_35 --> -144($fp) + # local_option_at_CellularAutomaton_internal_35 = SELF + sw $s1, -144($fp) + # LOCAL local_option_at_CellularAutomaton_internal_33 --> -136($fp) + # LOCAL local_option_at_CellularAutomaton_internal_35 --> -144($fp) + # local_option_at_CellularAutomaton_internal_33 = local_option_at_CellularAutomaton_internal_35 + lw $t1, -144($fp) + sw $t1, -136($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_36 --> -148($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_40 + sw $t1, 12($v0) + li $t1, 26 + sw $t1, 16($v0) + sw $v0, -148($fp) + # ARG local_option_at_CellularAutomaton_internal_36 + # LOCAL local_option_at_CellularAutomaton_internal_36 --> -148($fp) + lw $t1, -148($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_33 --> -136($fp) + # LOCAL local_option_at_CellularAutomaton_internal_34 --> -140($fp) + # local_option_at_CellularAutomaton_internal_34 = VCALL local_option_at_CellularAutomaton_internal_33 out_string + # Save new self pointer in $s1 + lw $s1, -136($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -140($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_39 --> -160($fp) + # local_option_at_CellularAutomaton_internal_39 = SELF + sw $s1, -160($fp) + # LOCAL local_option_at_CellularAutomaton_internal_37 --> -152($fp) + # LOCAL local_option_at_CellularAutomaton_internal_39 --> -160($fp) + # local_option_at_CellularAutomaton_internal_37 = local_option_at_CellularAutomaton_internal_39 + lw $t1, -160($fp) + sw $t1, -152($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_40 --> -164($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_41 + sw $t1, 12($v0) + li $t1, 12 + sw $t1, 16($v0) + sw $v0, -164($fp) + # ARG local_option_at_CellularAutomaton_internal_40 + # LOCAL local_option_at_CellularAutomaton_internal_40 --> -164($fp) + lw $t1, -164($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_37 --> -152($fp) + # LOCAL local_option_at_CellularAutomaton_internal_38 --> -156($fp) + # local_option_at_CellularAutomaton_internal_38 = VCALL local_option_at_CellularAutomaton_internal_37 out_string + # Save new self pointer in $s1 + lw $s1, -152($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -156($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_43 --> -176($fp) + # local_option_at_CellularAutomaton_internal_43 = SELF + sw $s1, -176($fp) + # LOCAL local_option_at_CellularAutomaton_internal_41 --> -168($fp) + # LOCAL local_option_at_CellularAutomaton_internal_43 --> -176($fp) + # local_option_at_CellularAutomaton_internal_41 = local_option_at_CellularAutomaton_internal_43 + lw $t1, -176($fp) + sw $t1, -168($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_42 + sw $t1, 12($v0) + li $t1, 22 + sw $t1, 16($v0) + sw $v0, -180($fp) + # ARG local_option_at_CellularAutomaton_internal_44 + # LOCAL local_option_at_CellularAutomaton_internal_44 --> -180($fp) + lw $t1, -180($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_41 --> -168($fp) + # LOCAL local_option_at_CellularAutomaton_internal_42 --> -172($fp) + # local_option_at_CellularAutomaton_internal_42 = VCALL local_option_at_CellularAutomaton_internal_41 out_string + # Save new self pointer in $s1 + lw $s1, -168($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -172($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_47 --> -192($fp) + # local_option_at_CellularAutomaton_internal_47 = SELF + sw $s1, -192($fp) + # LOCAL local_option_at_CellularAutomaton_internal_45 --> -184($fp) + # LOCAL local_option_at_CellularAutomaton_internal_47 --> -192($fp) + # local_option_at_CellularAutomaton_internal_45 = local_option_at_CellularAutomaton_internal_47 + lw $t1, -192($fp) + sw $t1, -184($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_48 --> -196($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_43 + sw $t1, 12($v0) + li $t1, 33 + sw $t1, 16($v0) + sw $v0, -196($fp) + # ARG local_option_at_CellularAutomaton_internal_48 + # LOCAL local_option_at_CellularAutomaton_internal_48 --> -196($fp) + lw $t1, -196($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_45 --> -184($fp) + # LOCAL local_option_at_CellularAutomaton_internal_46 --> -188($fp) + # local_option_at_CellularAutomaton_internal_46 = VCALL local_option_at_CellularAutomaton_internal_45 out_string + # Save new self pointer in $s1 + lw $s1, -184($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -188($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_51 --> -208($fp) + # local_option_at_CellularAutomaton_internal_51 = SELF + sw $s1, -208($fp) + # LOCAL local_option_at_CellularAutomaton_internal_49 --> -200($fp) + # LOCAL local_option_at_CellularAutomaton_internal_51 --> -208($fp) + # local_option_at_CellularAutomaton_internal_49 = local_option_at_CellularAutomaton_internal_51 + lw $t1, -208($fp) + sw $t1, -200($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_52 --> -212($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_44 + sw $t1, 12($v0) + li $t1, 19 + sw $t1, 16($v0) + sw $v0, -212($fp) + # ARG local_option_at_CellularAutomaton_internal_52 + # LOCAL local_option_at_CellularAutomaton_internal_52 --> -212($fp) + lw $t1, -212($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_49 --> -200($fp) + # LOCAL local_option_at_CellularAutomaton_internal_50 --> -204($fp) + # local_option_at_CellularAutomaton_internal_50 = VCALL local_option_at_CellularAutomaton_internal_49 out_string + # Save new self pointer in $s1 + lw $s1, -200($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -204($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_55 --> -224($fp) + # local_option_at_CellularAutomaton_internal_55 = SELF + sw $s1, -224($fp) + # LOCAL local_option_at_CellularAutomaton_internal_53 --> -216($fp) + # LOCAL local_option_at_CellularAutomaton_internal_55 --> -224($fp) + # local_option_at_CellularAutomaton_internal_53 = local_option_at_CellularAutomaton_internal_55 + lw $t1, -224($fp) + sw $t1, -216($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_45 + sw $t1, 12($v0) + li $t1, 13 + sw $t1, 16($v0) + sw $v0, -228($fp) + # ARG local_option_at_CellularAutomaton_internal_56 + # LOCAL local_option_at_CellularAutomaton_internal_56 --> -228($fp) + lw $t1, -228($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_53 --> -216($fp) + # LOCAL local_option_at_CellularAutomaton_internal_54 --> -220($fp) + # local_option_at_CellularAutomaton_internal_54 = VCALL local_option_at_CellularAutomaton_internal_53 out_string + # Save new self pointer in $s1 + lw $s1, -216($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -220($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_59 --> -240($fp) + # local_option_at_CellularAutomaton_internal_59 = SELF + sw $s1, -240($fp) + # LOCAL local_option_at_CellularAutomaton_internal_57 --> -232($fp) + # LOCAL local_option_at_CellularAutomaton_internal_59 --> -240($fp) + # local_option_at_CellularAutomaton_internal_57 = local_option_at_CellularAutomaton_internal_59 + lw $t1, -240($fp) + sw $t1, -232($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_60 --> -244($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_46 + sw $t1, 12($v0) + li $t1, 18 + sw $t1, 16($v0) + sw $v0, -244($fp) + # ARG local_option_at_CellularAutomaton_internal_60 + # LOCAL local_option_at_CellularAutomaton_internal_60 --> -244($fp) + lw $t1, -244($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_57 --> -232($fp) + # LOCAL local_option_at_CellularAutomaton_internal_58 --> -236($fp) + # local_option_at_CellularAutomaton_internal_58 = VCALL local_option_at_CellularAutomaton_internal_57 out_string + # Save new self pointer in $s1 + lw $s1, -232($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -236($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_63 --> -256($fp) + # local_option_at_CellularAutomaton_internal_63 = SELF + sw $s1, -256($fp) + # LOCAL local_option_at_CellularAutomaton_internal_61 --> -248($fp) + # LOCAL local_option_at_CellularAutomaton_internal_63 --> -256($fp) + # local_option_at_CellularAutomaton_internal_61 = local_option_at_CellularAutomaton_internal_63 + lw $t1, -256($fp) + sw $t1, -248($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_64 --> -260($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_47 + sw $t1, 12($v0) + li $t1, 13 + sw $t1, 16($v0) + sw $v0, -260($fp) + # ARG local_option_at_CellularAutomaton_internal_64 + # LOCAL local_option_at_CellularAutomaton_internal_64 --> -260($fp) + lw $t1, -260($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_61 --> -248($fp) + # LOCAL local_option_at_CellularAutomaton_internal_62 --> -252($fp) + # local_option_at_CellularAutomaton_internal_62 = VCALL local_option_at_CellularAutomaton_internal_61 out_string + # Save new self pointer in $s1 + lw $s1, -248($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -252($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_67 --> -272($fp) + # local_option_at_CellularAutomaton_internal_67 = SELF + sw $s1, -272($fp) + # LOCAL local_option_at_CellularAutomaton_internal_65 --> -264($fp) + # LOCAL local_option_at_CellularAutomaton_internal_67 --> -272($fp) + # local_option_at_CellularAutomaton_internal_65 = local_option_at_CellularAutomaton_internal_67 + lw $t1, -272($fp) + sw $t1, -264($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_68 --> -276($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_48 + sw $t1, 12($v0) + li $t1, 14 + sw $t1, 16($v0) + sw $v0, -276($fp) + # ARG local_option_at_CellularAutomaton_internal_68 + # LOCAL local_option_at_CellularAutomaton_internal_68 --> -276($fp) + lw $t1, -276($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_65 --> -264($fp) + # LOCAL local_option_at_CellularAutomaton_internal_66 --> -268($fp) + # local_option_at_CellularAutomaton_internal_66 = VCALL local_option_at_CellularAutomaton_internal_65 out_string + # Save new self pointer in $s1 + lw $s1, -264($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -268($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_71 --> -288($fp) + # local_option_at_CellularAutomaton_internal_71 = SELF + sw $s1, -288($fp) + # LOCAL local_option_at_CellularAutomaton_internal_69 --> -280($fp) + # LOCAL local_option_at_CellularAutomaton_internal_71 --> -288($fp) + # local_option_at_CellularAutomaton_internal_69 = local_option_at_CellularAutomaton_internal_71 + lw $t1, -288($fp) + sw $t1, -280($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_72 --> -292($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_49 + sw $t1, 12($v0) + li $t1, 14 + sw $t1, 16($v0) + sw $v0, -292($fp) + # ARG local_option_at_CellularAutomaton_internal_72 + # LOCAL local_option_at_CellularAutomaton_internal_72 --> -292($fp) + lw $t1, -292($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_69 --> -280($fp) + # LOCAL local_option_at_CellularAutomaton_internal_70 --> -284($fp) + # local_option_at_CellularAutomaton_internal_70 = VCALL local_option_at_CellularAutomaton_internal_69 out_string + # Save new self pointer in $s1 + lw $s1, -280($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -284($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_75 --> -304($fp) + # local_option_at_CellularAutomaton_internal_75 = SELF + sw $s1, -304($fp) + # LOCAL local_option_at_CellularAutomaton_internal_73 --> -296($fp) + # LOCAL local_option_at_CellularAutomaton_internal_75 --> -304($fp) + # local_option_at_CellularAutomaton_internal_73 = local_option_at_CellularAutomaton_internal_75 + lw $t1, -304($fp) + sw $t1, -296($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_76 --> -308($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_50 + sw $t1, 12($v0) + li $t1, 13 + sw $t1, 16($v0) + sw $v0, -308($fp) + # ARG local_option_at_CellularAutomaton_internal_76 + # LOCAL local_option_at_CellularAutomaton_internal_76 --> -308($fp) + lw $t1, -308($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_73 --> -296($fp) + # LOCAL local_option_at_CellularAutomaton_internal_74 --> -300($fp) + # local_option_at_CellularAutomaton_internal_74 = VCALL local_option_at_CellularAutomaton_internal_73 out_string + # Save new self pointer in $s1 + lw $s1, -296($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -300($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_79 --> -320($fp) + # local_option_at_CellularAutomaton_internal_79 = SELF + sw $s1, -320($fp) + # LOCAL local_option_at_CellularAutomaton_internal_77 --> -312($fp) + # LOCAL local_option_at_CellularAutomaton_internal_79 --> -320($fp) + # local_option_at_CellularAutomaton_internal_77 = local_option_at_CellularAutomaton_internal_79 + lw $t1, -320($fp) + sw $t1, -312($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_80 --> -324($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_51 + sw $t1, 12($v0) + li $t1, 14 + sw $t1, 16($v0) + sw $v0, -324($fp) + # ARG local_option_at_CellularAutomaton_internal_80 + # LOCAL local_option_at_CellularAutomaton_internal_80 --> -324($fp) + lw $t1, -324($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_77 --> -312($fp) + # LOCAL local_option_at_CellularAutomaton_internal_78 --> -316($fp) + # local_option_at_CellularAutomaton_internal_78 = VCALL local_option_at_CellularAutomaton_internal_77 out_string + # Save new self pointer in $s1 + lw $s1, -312($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -316($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_83 --> -336($fp) + # local_option_at_CellularAutomaton_internal_83 = SELF + sw $s1, -336($fp) + # LOCAL local_option_at_CellularAutomaton_internal_81 --> -328($fp) + # LOCAL local_option_at_CellularAutomaton_internal_83 --> -336($fp) + # local_option_at_CellularAutomaton_internal_81 = local_option_at_CellularAutomaton_internal_83 + lw $t1, -336($fp) + sw $t1, -328($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_84 --> -340($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_52 + sw $t1, 12($v0) + li $t1, 14 + sw $t1, 16($v0) + sw $v0, -340($fp) + # ARG local_option_at_CellularAutomaton_internal_84 + # LOCAL local_option_at_CellularAutomaton_internal_84 --> -340($fp) + lw $t1, -340($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_81 --> -328($fp) + # LOCAL local_option_at_CellularAutomaton_internal_82 --> -332($fp) + # local_option_at_CellularAutomaton_internal_82 = VCALL local_option_at_CellularAutomaton_internal_81 out_string + # Save new self pointer in $s1 + lw $s1, -328($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -332($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_87 --> -352($fp) + # local_option_at_CellularAutomaton_internal_87 = SELF + sw $s1, -352($fp) + # LOCAL local_option_at_CellularAutomaton_internal_85 --> -344($fp) + # LOCAL local_option_at_CellularAutomaton_internal_87 --> -352($fp) + # local_option_at_CellularAutomaton_internal_85 = local_option_at_CellularAutomaton_internal_87 + lw $t1, -352($fp) + sw $t1, -344($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_88 --> -356($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_53 + sw $t1, 12($v0) + li $t1, 14 + sw $t1, 16($v0) + sw $v0, -356($fp) + # ARG local_option_at_CellularAutomaton_internal_88 + # LOCAL local_option_at_CellularAutomaton_internal_88 --> -356($fp) + lw $t1, -356($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_85 --> -344($fp) + # LOCAL local_option_at_CellularAutomaton_internal_86 --> -348($fp) + # local_option_at_CellularAutomaton_internal_86 = VCALL local_option_at_CellularAutomaton_internal_85 out_string + # Save new self pointer in $s1 + lw $s1, -344($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -348($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_91 --> -368($fp) + # local_option_at_CellularAutomaton_internal_91 = SELF + sw $s1, -368($fp) + # LOCAL local_option_at_CellularAutomaton_internal_89 --> -360($fp) + # LOCAL local_option_at_CellularAutomaton_internal_91 --> -368($fp) + # local_option_at_CellularAutomaton_internal_89 = local_option_at_CellularAutomaton_internal_91 + lw $t1, -368($fp) + sw $t1, -360($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_92 --> -372($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_54 + sw $t1, 12($v0) + li $t1, 15 + sw $t1, 16($v0) + sw $v0, -372($fp) + # ARG local_option_at_CellularAutomaton_internal_92 + # LOCAL local_option_at_CellularAutomaton_internal_92 --> -372($fp) + lw $t1, -372($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_89 --> -360($fp) + # LOCAL local_option_at_CellularAutomaton_internal_90 --> -364($fp) + # local_option_at_CellularAutomaton_internal_90 = VCALL local_option_at_CellularAutomaton_internal_89 out_string + # Save new self pointer in $s1 + lw $s1, -360($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -364($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_95 --> -384($fp) + # local_option_at_CellularAutomaton_internal_95 = SELF + sw $s1, -384($fp) + # LOCAL local_option_at_CellularAutomaton_internal_93 --> -376($fp) + # LOCAL local_option_at_CellularAutomaton_internal_95 --> -384($fp) + # local_option_at_CellularAutomaton_internal_93 = local_option_at_CellularAutomaton_internal_95 + lw $t1, -384($fp) + sw $t1, -376($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_93 --> -376($fp) + # LOCAL local_option_at_CellularAutomaton_internal_94 --> -380($fp) + # local_option_at_CellularAutomaton_internal_94 = VCALL local_option_at_CellularAutomaton_internal_93 in_int + # Save new self pointer in $s1 + lw $s1, -376($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 24($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -380($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_94 --> -380($fp) + # local_option_at_CellularAutomaton_num_0 = local_option_at_CellularAutomaton_internal_94 + lw $t1, -380($fp) + sw $t1, -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_98 --> -396($fp) + # local_option_at_CellularAutomaton_internal_98 = SELF + sw $s1, -396($fp) + # LOCAL local_option_at_CellularAutomaton_internal_96 --> -388($fp) + # LOCAL local_option_at_CellularAutomaton_internal_98 --> -396($fp) + # local_option_at_CellularAutomaton_internal_96 = local_option_at_CellularAutomaton_internal_98 + lw $t1, -396($fp) + sw $t1, -388($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_99 --> -400($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_55 + sw $t1, 12($v0) + li $t1, 2 + sw $t1, 16($v0) + sw $v0, -400($fp) + # ARG local_option_at_CellularAutomaton_internal_99 + # LOCAL local_option_at_CellularAutomaton_internal_99 --> -400($fp) + lw $t1, -400($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_96 --> -388($fp) + # LOCAL local_option_at_CellularAutomaton_internal_97 --> -392($fp) + # local_option_at_CellularAutomaton_internal_97 = VCALL local_option_at_CellularAutomaton_internal_96 out_string + # Save new self pointer in $s1 + lw $s1, -388($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -392($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_101 --> -408($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_101 = local_option_at_CellularAutomaton_num_0 - 1 + lw $t1, -4($fp) + sub $t1, $t1, 1 + sw $t1, -408($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_101 GOTO label_TRUE_135 + # IF_ZERO local_option_at_CellularAutomaton_internal_101 GOTO label_TRUE_135 + lw $t1, -408($fp) + beq $t1, 0, label_TRUE_135 + # LOCAL local_option_at_CellularAutomaton_internal_101 --> -408($fp) + # local_option_at_CellularAutomaton_internal_101 = 0 + li $t1, 0 + sw $t1, -408($fp) + # GOTO label_END_136 +j label_END_136 +label_TRUE_135: + # LOCAL local_option_at_CellularAutomaton_internal_101 --> -408($fp) + # local_option_at_CellularAutomaton_internal_101 = 1 + li $t1, 1 + sw $t1, -408($fp) + label_END_136: +# IF_ZERO local_option_at_CellularAutomaton_internal_101 GOTO label_FALSEIF_133 +# IF_ZERO local_option_at_CellularAutomaton_internal_101 GOTO label_FALSEIF_133 +lw $t1, -408($fp) +beq $t1, 0, label_FALSEIF_133 +# LOCAL local_option_at_CellularAutomaton_internal_102 --> -412($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_56 +sw $t1, 12($v0) +li $t1, 20 +sw $t1, 16($v0) +sw $v0, -412($fp) +# LOCAL local_option_at_CellularAutomaton_internal_100 --> -404($fp) +# LOCAL local_option_at_CellularAutomaton_internal_102 --> -412($fp) +# local_option_at_CellularAutomaton_internal_100 = local_option_at_CellularAutomaton_internal_102 +lw $t1, -412($fp) +sw $t1, -404($fp) +# GOTO label_ENDIF_134 +j label_ENDIF_134 +label_FALSEIF_133: + # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_104 = local_option_at_CellularAutomaton_num_0 - 2 + lw $t1, -4($fp) + sub $t1, $t1, 2 + sw $t1, -420($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_TRUE_139 + # IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_TRUE_139 + lw $t1, -420($fp) + beq $t1, 0, label_TRUE_139 + # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) + # local_option_at_CellularAutomaton_internal_104 = 0 + li $t1, 0 + sw $t1, -420($fp) + # GOTO label_END_140 +j label_END_140 +label_TRUE_139: + # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) + # local_option_at_CellularAutomaton_internal_104 = 1 + li $t1, 1 + sw $t1, -420($fp) + label_END_140: +# IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_FALSEIF_137 +# IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_FALSEIF_137 +lw $t1, -420($fp) +beq $t1, 0, label_FALSEIF_137 +# LOCAL local_option_at_CellularAutomaton_internal_105 --> -424($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_57 +sw $t1, 12($v0) +li $t1, 25 +sw $t1, 16($v0) +sw $v0, -424($fp) +# LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) +# LOCAL local_option_at_CellularAutomaton_internal_105 --> -424($fp) +# local_option_at_CellularAutomaton_internal_103 = local_option_at_CellularAutomaton_internal_105 +lw $t1, -424($fp) +sw $t1, -416($fp) +# GOTO label_ENDIF_138 +j label_ENDIF_138 +label_FALSEIF_137: + # LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_107 = local_option_at_CellularAutomaton_num_0 - 3 + lw $t1, -4($fp) + sub $t1, $t1, 3 + sw $t1, -432($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_107 GOTO label_TRUE_143 + # IF_ZERO local_option_at_CellularAutomaton_internal_107 GOTO label_TRUE_143 + lw $t1, -432($fp) + beq $t1, 0, label_TRUE_143 + # LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) + # local_option_at_CellularAutomaton_internal_107 = 0 + li $t1, 0 + sw $t1, -432($fp) + # GOTO label_END_144 +j label_END_144 +label_TRUE_143: + # LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) + # local_option_at_CellularAutomaton_internal_107 = 1 + li $t1, 1 + sw $t1, -432($fp) + label_END_144: +# IF_ZERO local_option_at_CellularAutomaton_internal_107 GOTO label_FALSEIF_141 +# IF_ZERO local_option_at_CellularAutomaton_internal_107 GOTO label_FALSEIF_141 +lw $t1, -432($fp) +beq $t1, 0, label_FALSEIF_141 +# LOCAL local_option_at_CellularAutomaton_internal_108 --> -436($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_58 +sw $t1, 12($v0) +li $t1, 25 +sw $t1, 16($v0) +sw $v0, -436($fp) +# LOCAL local_option_at_CellularAutomaton_internal_106 --> -428($fp) +# LOCAL local_option_at_CellularAutomaton_internal_108 --> -436($fp) +# local_option_at_CellularAutomaton_internal_106 = local_option_at_CellularAutomaton_internal_108 +lw $t1, -436($fp) +sw $t1, -428($fp) +# GOTO label_ENDIF_142 +j label_ENDIF_142 +label_FALSEIF_141: + # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_110 = local_option_at_CellularAutomaton_num_0 - 4 + lw $t1, -4($fp) + sub $t1, $t1, 4 + sw $t1, -444($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_TRUE_147 + # IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_TRUE_147 + lw $t1, -444($fp) + beq $t1, 0, label_TRUE_147 + # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) + # local_option_at_CellularAutomaton_internal_110 = 0 + li $t1, 0 + sw $t1, -444($fp) + # GOTO label_END_148 +j label_END_148 +label_TRUE_147: + # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) + # local_option_at_CellularAutomaton_internal_110 = 1 + li $t1, 1 + sw $t1, -444($fp) + label_END_148: +# IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_FALSEIF_145 +# IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_FALSEIF_145 +lw $t1, -444($fp) +beq $t1, 0, label_FALSEIF_145 +# LOCAL local_option_at_CellularAutomaton_internal_111 --> -448($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_59 +sw $t1, 12($v0) +li $t1, 25 +sw $t1, 16($v0) +sw $v0, -448($fp) +# LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) +# LOCAL local_option_at_CellularAutomaton_internal_111 --> -448($fp) +# local_option_at_CellularAutomaton_internal_109 = local_option_at_CellularAutomaton_internal_111 +lw $t1, -448($fp) +sw $t1, -440($fp) +# GOTO label_ENDIF_146 +j label_ENDIF_146 +label_FALSEIF_145: + # LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_113 = local_option_at_CellularAutomaton_num_0 - 5 + lw $t1, -4($fp) + sub $t1, $t1, 5 + sw $t1, -456($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_113 GOTO label_TRUE_151 + # IF_ZERO local_option_at_CellularAutomaton_internal_113 GOTO label_TRUE_151 + lw $t1, -456($fp) + beq $t1, 0, label_TRUE_151 + # LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) + # local_option_at_CellularAutomaton_internal_113 = 0 + li $t1, 0 + sw $t1, -456($fp) + # GOTO label_END_152 +j label_END_152 +label_TRUE_151: + # LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) + # local_option_at_CellularAutomaton_internal_113 = 1 + li $t1, 1 + sw $t1, -456($fp) + label_END_152: +# IF_ZERO local_option_at_CellularAutomaton_internal_113 GOTO label_FALSEIF_149 +# IF_ZERO local_option_at_CellularAutomaton_internal_113 GOTO label_FALSEIF_149 +lw $t1, -456($fp) +beq $t1, 0, label_FALSEIF_149 +# LOCAL local_option_at_CellularAutomaton_internal_114 --> -460($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_60 +sw $t1, 12($v0) +li $t1, 25 +sw $t1, 16($v0) +sw $v0, -460($fp) +# LOCAL local_option_at_CellularAutomaton_internal_112 --> -452($fp) +# LOCAL local_option_at_CellularAutomaton_internal_114 --> -460($fp) +# local_option_at_CellularAutomaton_internal_112 = local_option_at_CellularAutomaton_internal_114 +lw $t1, -460($fp) +sw $t1, -452($fp) +# GOTO label_ENDIF_150 +j label_ENDIF_150 +label_FALSEIF_149: + # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_116 = local_option_at_CellularAutomaton_num_0 - 6 + lw $t1, -4($fp) + sub $t1, $t1, 6 + sw $t1, -468($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_TRUE_155 + # IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_TRUE_155 + lw $t1, -468($fp) + beq $t1, 0, label_TRUE_155 + # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) + # local_option_at_CellularAutomaton_internal_116 = 0 + li $t1, 0 + sw $t1, -468($fp) + # GOTO label_END_156 +j label_END_156 +label_TRUE_155: + # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) + # local_option_at_CellularAutomaton_internal_116 = 1 + li $t1, 1 + sw $t1, -468($fp) + label_END_156: +# IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_FALSEIF_153 +# IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_FALSEIF_153 +lw $t1, -468($fp) +beq $t1, 0, label_FALSEIF_153 +# LOCAL local_option_at_CellularAutomaton_internal_117 --> -472($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_61 +sw $t1, 12($v0) +li $t1, 25 +sw $t1, 16($v0) +sw $v0, -472($fp) +# LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) +# LOCAL local_option_at_CellularAutomaton_internal_117 --> -472($fp) +# local_option_at_CellularAutomaton_internal_115 = local_option_at_CellularAutomaton_internal_117 +lw $t1, -472($fp) +sw $t1, -464($fp) +# GOTO label_ENDIF_154 +j label_ENDIF_154 +label_FALSEIF_153: + # LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_119 = local_option_at_CellularAutomaton_num_0 - 7 + lw $t1, -4($fp) + sub $t1, $t1, 7 + sw $t1, -480($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_119 GOTO label_TRUE_159 + # IF_ZERO local_option_at_CellularAutomaton_internal_119 GOTO label_TRUE_159 + lw $t1, -480($fp) + beq $t1, 0, label_TRUE_159 + # LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) + # local_option_at_CellularAutomaton_internal_119 = 0 + li $t1, 0 + sw $t1, -480($fp) + # GOTO label_END_160 +j label_END_160 +label_TRUE_159: + # LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) + # local_option_at_CellularAutomaton_internal_119 = 1 + li $t1, 1 + sw $t1, -480($fp) + label_END_160: +# IF_ZERO local_option_at_CellularAutomaton_internal_119 GOTO label_FALSEIF_157 +# IF_ZERO local_option_at_CellularAutomaton_internal_119 GOTO label_FALSEIF_157 +lw $t1, -480($fp) +beq $t1, 0, label_FALSEIF_157 +# LOCAL local_option_at_CellularAutomaton_internal_120 --> -484($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_62 +sw $t1, 12($v0) +li $t1, 20 +sw $t1, 16($v0) +sw $v0, -484($fp) +# LOCAL local_option_at_CellularAutomaton_internal_118 --> -476($fp) +# LOCAL local_option_at_CellularAutomaton_internal_120 --> -484($fp) +# local_option_at_CellularAutomaton_internal_118 = local_option_at_CellularAutomaton_internal_120 +lw $t1, -484($fp) +sw $t1, -476($fp) +# GOTO label_ENDIF_158 +j label_ENDIF_158 +label_FALSEIF_157: + # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_122 = local_option_at_CellularAutomaton_num_0 - 8 + lw $t1, -4($fp) + sub $t1, $t1, 8 + sw $t1, -492($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_TRUE_163 + # IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_TRUE_163 + lw $t1, -492($fp) + beq $t1, 0, label_TRUE_163 + # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) + # local_option_at_CellularAutomaton_internal_122 = 0 + li $t1, 0 + sw $t1, -492($fp) + # GOTO label_END_164 +j label_END_164 +label_TRUE_163: + # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) + # local_option_at_CellularAutomaton_internal_122 = 1 + li $t1, 1 + sw $t1, -492($fp) + label_END_164: +# IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_FALSEIF_161 +# IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_FALSEIF_161 +lw $t1, -492($fp) +beq $t1, 0, label_FALSEIF_161 +# LOCAL local_option_at_CellularAutomaton_internal_123 --> -496($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_63 +sw $t1, 12($v0) +li $t1, 20 +sw $t1, 16($v0) +sw $v0, -496($fp) +# LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) +# LOCAL local_option_at_CellularAutomaton_internal_123 --> -496($fp) +# local_option_at_CellularAutomaton_internal_121 = local_option_at_CellularAutomaton_internal_123 +lw $t1, -496($fp) +sw $t1, -488($fp) +# GOTO label_ENDIF_162 +j label_ENDIF_162 +label_FALSEIF_161: + # LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_125 = local_option_at_CellularAutomaton_num_0 - 9 + lw $t1, -4($fp) + sub $t1, $t1, 9 + sw $t1, -504($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_125 GOTO label_TRUE_167 + # IF_ZERO local_option_at_CellularAutomaton_internal_125 GOTO label_TRUE_167 + lw $t1, -504($fp) + beq $t1, 0, label_TRUE_167 + # LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) + # local_option_at_CellularAutomaton_internal_125 = 0 + li $t1, 0 + sw $t1, -504($fp) + # GOTO label_END_168 +j label_END_168 +label_TRUE_167: + # LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) + # local_option_at_CellularAutomaton_internal_125 = 1 + li $t1, 1 + sw $t1, -504($fp) + label_END_168: +# IF_ZERO local_option_at_CellularAutomaton_internal_125 GOTO label_FALSEIF_165 +# IF_ZERO local_option_at_CellularAutomaton_internal_125 GOTO label_FALSEIF_165 +lw $t1, -504($fp) +beq $t1, 0, label_FALSEIF_165 +# LOCAL local_option_at_CellularAutomaton_internal_126 --> -508($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_64 +sw $t1, 12($v0) +li $t1, 15 +sw $t1, 16($v0) +sw $v0, -508($fp) +# LOCAL local_option_at_CellularAutomaton_internal_124 --> -500($fp) +# LOCAL local_option_at_CellularAutomaton_internal_126 --> -508($fp) +# local_option_at_CellularAutomaton_internal_124 = local_option_at_CellularAutomaton_internal_126 +lw $t1, -508($fp) +sw $t1, -500($fp) +# GOTO label_ENDIF_166 +j label_ENDIF_166 +label_FALSEIF_165: + # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_128 = local_option_at_CellularAutomaton_num_0 - 10 + lw $t1, -4($fp) + sub $t1, $t1, 10 + sw $t1, -516($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_TRUE_171 + # IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_TRUE_171 + lw $t1, -516($fp) + beq $t1, 0, label_TRUE_171 + # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) + # local_option_at_CellularAutomaton_internal_128 = 0 + li $t1, 0 + sw $t1, -516($fp) + # GOTO label_END_172 +j label_END_172 +label_TRUE_171: + # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) + # local_option_at_CellularAutomaton_internal_128 = 1 + li $t1, 1 + sw $t1, -516($fp) + label_END_172: +# IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_FALSEIF_169 +# IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_FALSEIF_169 +lw $t1, -516($fp) +beq $t1, 0, label_FALSEIF_169 +# LOCAL local_option_at_CellularAutomaton_internal_129 --> -520($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_65 +sw $t1, 12($v0) +li $t1, 15 +sw $t1, 16($v0) +sw $v0, -520($fp) +# LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) +# LOCAL local_option_at_CellularAutomaton_internal_129 --> -520($fp) +# local_option_at_CellularAutomaton_internal_127 = local_option_at_CellularAutomaton_internal_129 +lw $t1, -520($fp) +sw $t1, -512($fp) +# GOTO label_ENDIF_170 +j label_ENDIF_170 +label_FALSEIF_169: + # LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_131 = local_option_at_CellularAutomaton_num_0 - 11 + lw $t1, -4($fp) + sub $t1, $t1, 11 + sw $t1, -528($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_131 GOTO label_TRUE_175 + # IF_ZERO local_option_at_CellularAutomaton_internal_131 GOTO label_TRUE_175 + lw $t1, -528($fp) + beq $t1, 0, label_TRUE_175 + # LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) + # local_option_at_CellularAutomaton_internal_131 = 0 + li $t1, 0 + sw $t1, -528($fp) + # GOTO label_END_176 +j label_END_176 +label_TRUE_175: + # LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) + # local_option_at_CellularAutomaton_internal_131 = 1 + li $t1, 1 + sw $t1, -528($fp) + label_END_176: +# IF_ZERO local_option_at_CellularAutomaton_internal_131 GOTO label_FALSEIF_173 +# IF_ZERO local_option_at_CellularAutomaton_internal_131 GOTO label_FALSEIF_173 +lw $t1, -528($fp) +beq $t1, 0, label_FALSEIF_173 +# LOCAL local_option_at_CellularAutomaton_internal_132 --> -532($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_66 +sw $t1, 12($v0) +li $t1, 15 +sw $t1, 16($v0) +sw $v0, -532($fp) +# LOCAL local_option_at_CellularAutomaton_internal_130 --> -524($fp) +# LOCAL local_option_at_CellularAutomaton_internal_132 --> -532($fp) +# local_option_at_CellularAutomaton_internal_130 = local_option_at_CellularAutomaton_internal_132 +lw $t1, -532($fp) +sw $t1, -524($fp) +# GOTO label_ENDIF_174 +j label_ENDIF_174 +label_FALSEIF_173: + # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_134 = local_option_at_CellularAutomaton_num_0 - 12 + lw $t1, -4($fp) + sub $t1, $t1, 12 + sw $t1, -540($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_TRUE_179 + # IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_TRUE_179 + lw $t1, -540($fp) + beq $t1, 0, label_TRUE_179 + # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) + # local_option_at_CellularAutomaton_internal_134 = 0 + li $t1, 0 + sw $t1, -540($fp) + # GOTO label_END_180 +j label_END_180 +label_TRUE_179: + # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) + # local_option_at_CellularAutomaton_internal_134 = 1 + li $t1, 1 + sw $t1, -540($fp) + label_END_180: +# IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_FALSEIF_177 +# IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_FALSEIF_177 +lw $t1, -540($fp) +beq $t1, 0, label_FALSEIF_177 +# LOCAL local_option_at_CellularAutomaton_internal_135 --> -544($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_67 +sw $t1, 12($v0) +li $t1, 25 +sw $t1, 16($v0) +sw $v0, -544($fp) +# LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) +# LOCAL local_option_at_CellularAutomaton_internal_135 --> -544($fp) +# local_option_at_CellularAutomaton_internal_133 = local_option_at_CellularAutomaton_internal_135 +lw $t1, -544($fp) +sw $t1, -536($fp) +# GOTO label_ENDIF_178 +j label_ENDIF_178 +label_FALSEIF_177: + # LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_137 = local_option_at_CellularAutomaton_num_0 - 13 + lw $t1, -4($fp) + sub $t1, $t1, 13 + sw $t1, -552($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_137 GOTO label_TRUE_183 + # IF_ZERO local_option_at_CellularAutomaton_internal_137 GOTO label_TRUE_183 + lw $t1, -552($fp) + beq $t1, 0, label_TRUE_183 + # LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) + # local_option_at_CellularAutomaton_internal_137 = 0 + li $t1, 0 + sw $t1, -552($fp) + # GOTO label_END_184 +j label_END_184 +label_TRUE_183: + # LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) + # local_option_at_CellularAutomaton_internal_137 = 1 + li $t1, 1 + sw $t1, -552($fp) + label_END_184: +# IF_ZERO local_option_at_CellularAutomaton_internal_137 GOTO label_FALSEIF_181 +# IF_ZERO local_option_at_CellularAutomaton_internal_137 GOTO label_FALSEIF_181 +lw $t1, -552($fp) +beq $t1, 0, label_FALSEIF_181 +# LOCAL local_option_at_CellularAutomaton_internal_138 --> -556($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_68 +sw $t1, 12($v0) +li $t1, 25 +sw $t1, 16($v0) +sw $v0, -556($fp) +# LOCAL local_option_at_CellularAutomaton_internal_136 --> -548($fp) +# LOCAL local_option_at_CellularAutomaton_internal_138 --> -556($fp) +# local_option_at_CellularAutomaton_internal_136 = local_option_at_CellularAutomaton_internal_138 +lw $t1, -556($fp) +sw $t1, -548($fp) +# GOTO label_ENDIF_182 +j label_ENDIF_182 +label_FALSEIF_181: + # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_140 = local_option_at_CellularAutomaton_num_0 - 14 + lw $t1, -4($fp) + sub $t1, $t1, 14 + sw $t1, -564($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_TRUE_187 + # IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_TRUE_187 + lw $t1, -564($fp) + beq $t1, 0, label_TRUE_187 + # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) + # local_option_at_CellularAutomaton_internal_140 = 0 + li $t1, 0 + sw $t1, -564($fp) + # GOTO label_END_188 +j label_END_188 +label_TRUE_187: + # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) + # local_option_at_CellularAutomaton_internal_140 = 1 + li $t1, 1 + sw $t1, -564($fp) + label_END_188: +# IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_FALSEIF_185 +# IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_FALSEIF_185 +lw $t1, -564($fp) +beq $t1, 0, label_FALSEIF_185 +# LOCAL local_option_at_CellularAutomaton_internal_141 --> -568($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_69 +sw $t1, 12($v0) +li $t1, 25 +sw $t1, 16($v0) +sw $v0, -568($fp) +# LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) +# LOCAL local_option_at_CellularAutomaton_internal_141 --> -568($fp) +# local_option_at_CellularAutomaton_internal_139 = local_option_at_CellularAutomaton_internal_141 +lw $t1, -568($fp) +sw $t1, -560($fp) +# GOTO label_ENDIF_186 +j label_ENDIF_186 +label_FALSEIF_185: + # LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_143 = local_option_at_CellularAutomaton_num_0 - 15 + lw $t1, -4($fp) + sub $t1, $t1, 15 + sw $t1, -576($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_143 GOTO label_TRUE_191 + # IF_ZERO local_option_at_CellularAutomaton_internal_143 GOTO label_TRUE_191 + lw $t1, -576($fp) + beq $t1, 0, label_TRUE_191 + # LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) + # local_option_at_CellularAutomaton_internal_143 = 0 + li $t1, 0 + sw $t1, -576($fp) + # GOTO label_END_192 +j label_END_192 +label_TRUE_191: + # LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) + # local_option_at_CellularAutomaton_internal_143 = 1 + li $t1, 1 + sw $t1, -576($fp) + label_END_192: +# IF_ZERO local_option_at_CellularAutomaton_internal_143 GOTO label_FALSEIF_189 +# IF_ZERO local_option_at_CellularAutomaton_internal_143 GOTO label_FALSEIF_189 +lw $t1, -576($fp) +beq $t1, 0, label_FALSEIF_189 +# LOCAL local_option_at_CellularAutomaton_internal_144 --> -580($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_70 +sw $t1, 12($v0) +li $t1, 21 +sw $t1, 16($v0) +sw $v0, -580($fp) +# LOCAL local_option_at_CellularAutomaton_internal_142 --> -572($fp) +# LOCAL local_option_at_CellularAutomaton_internal_144 --> -580($fp) +# local_option_at_CellularAutomaton_internal_142 = local_option_at_CellularAutomaton_internal_144 +lw $t1, -580($fp) +sw $t1, -572($fp) +# GOTO label_ENDIF_190 +j label_ENDIF_190 +label_FALSEIF_189: + # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_146 = local_option_at_CellularAutomaton_num_0 - 16 + lw $t1, -4($fp) + sub $t1, $t1, 16 + sw $t1, -588($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_TRUE_195 + # IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_TRUE_195 + lw $t1, -588($fp) + beq $t1, 0, label_TRUE_195 + # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) + # local_option_at_CellularAutomaton_internal_146 = 0 + li $t1, 0 + sw $t1, -588($fp) + # GOTO label_END_196 +j label_END_196 +label_TRUE_195: + # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) + # local_option_at_CellularAutomaton_internal_146 = 1 + li $t1, 1 + sw $t1, -588($fp) + label_END_196: +# IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_FALSEIF_193 +# IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_FALSEIF_193 +lw $t1, -588($fp) +beq $t1, 0, label_FALSEIF_193 +# LOCAL local_option_at_CellularAutomaton_internal_147 --> -592($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_71 +sw $t1, 12($v0) +li $t1, 21 +sw $t1, 16($v0) +sw $v0, -592($fp) +# LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) +# LOCAL local_option_at_CellularAutomaton_internal_147 --> -592($fp) +# local_option_at_CellularAutomaton_internal_145 = local_option_at_CellularAutomaton_internal_147 +lw $t1, -592($fp) +sw $t1, -584($fp) +# GOTO label_ENDIF_194 +j label_ENDIF_194 +label_FALSEIF_193: + # LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_149 = local_option_at_CellularAutomaton_num_0 - 17 + lw $t1, -4($fp) + sub $t1, $t1, 17 + sw $t1, -600($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_149 GOTO label_TRUE_199 + # IF_ZERO local_option_at_CellularAutomaton_internal_149 GOTO label_TRUE_199 + lw $t1, -600($fp) + beq $t1, 0, label_TRUE_199 + # LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) + # local_option_at_CellularAutomaton_internal_149 = 0 + li $t1, 0 + sw $t1, -600($fp) + # GOTO label_END_200 +j label_END_200 +label_TRUE_199: + # LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) + # local_option_at_CellularAutomaton_internal_149 = 1 + li $t1, 1 + sw $t1, -600($fp) + label_END_200: +# IF_ZERO local_option_at_CellularAutomaton_internal_149 GOTO label_FALSEIF_197 +# IF_ZERO local_option_at_CellularAutomaton_internal_149 GOTO label_FALSEIF_197 +lw $t1, -600($fp) +beq $t1, 0, label_FALSEIF_197 +# LOCAL local_option_at_CellularAutomaton_internal_150 --> -604($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_72 +sw $t1, 12($v0) +li $t1, 28 +sw $t1, 16($v0) +sw $v0, -604($fp) +# LOCAL local_option_at_CellularAutomaton_internal_148 --> -596($fp) +# LOCAL local_option_at_CellularAutomaton_internal_150 --> -604($fp) +# local_option_at_CellularAutomaton_internal_148 = local_option_at_CellularAutomaton_internal_150 +lw $t1, -604($fp) +sw $t1, -596($fp) +# GOTO label_ENDIF_198 +j label_ENDIF_198 +label_FALSEIF_197: + # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_152 = local_option_at_CellularAutomaton_num_0 - 18 + lw $t1, -4($fp) + sub $t1, $t1, 18 + sw $t1, -612($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_TRUE_203 + # IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_TRUE_203 + lw $t1, -612($fp) + beq $t1, 0, label_TRUE_203 + # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) + # local_option_at_CellularAutomaton_internal_152 = 0 + li $t1, 0 + sw $t1, -612($fp) + # GOTO label_END_204 +j label_END_204 +label_TRUE_203: + # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) + # local_option_at_CellularAutomaton_internal_152 = 1 + li $t1, 1 + sw $t1, -612($fp) + label_END_204: +# IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_FALSEIF_201 +# IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_FALSEIF_201 +lw $t1, -612($fp) +beq $t1, 0, label_FALSEIF_201 +# LOCAL local_option_at_CellularAutomaton_internal_153 --> -616($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_73 +sw $t1, 12($v0) +li $t1, 28 +sw $t1, 16($v0) +sw $v0, -616($fp) +# LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) +# LOCAL local_option_at_CellularAutomaton_internal_153 --> -616($fp) +# local_option_at_CellularAutomaton_internal_151 = local_option_at_CellularAutomaton_internal_153 +lw $t1, -616($fp) +sw $t1, -608($fp) +# GOTO label_ENDIF_202 +j label_ENDIF_202 +label_FALSEIF_201: + # LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_155 = local_option_at_CellularAutomaton_num_0 - 19 + lw $t1, -4($fp) + sub $t1, $t1, 19 + sw $t1, -624($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_155 GOTO label_TRUE_207 + # IF_ZERO local_option_at_CellularAutomaton_internal_155 GOTO label_TRUE_207 + lw $t1, -624($fp) + beq $t1, 0, label_TRUE_207 + # LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) + # local_option_at_CellularAutomaton_internal_155 = 0 + li $t1, 0 + sw $t1, -624($fp) + # GOTO label_END_208 +j label_END_208 +label_TRUE_207: + # LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) + # local_option_at_CellularAutomaton_internal_155 = 1 + li $t1, 1 + sw $t1, -624($fp) + label_END_208: +# IF_ZERO local_option_at_CellularAutomaton_internal_155 GOTO label_FALSEIF_205 +# IF_ZERO local_option_at_CellularAutomaton_internal_155 GOTO label_FALSEIF_205 +lw $t1, -624($fp) +beq $t1, 0, label_FALSEIF_205 +# LOCAL local_option_at_CellularAutomaton_internal_156 --> -628($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_74 +sw $t1, 12($v0) +li $t1, 16 +sw $t1, 16($v0) +sw $v0, -628($fp) +# LOCAL local_option_at_CellularAutomaton_internal_154 --> -620($fp) +# LOCAL local_option_at_CellularAutomaton_internal_156 --> -628($fp) +# local_option_at_CellularAutomaton_internal_154 = local_option_at_CellularAutomaton_internal_156 +lw $t1, -628($fp) +sw $t1, -620($fp) +# GOTO label_ENDIF_206 +j label_ENDIF_206 +label_FALSEIF_205: + # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_158 = local_option_at_CellularAutomaton_num_0 - 20 + lw $t1, -4($fp) + sub $t1, $t1, 20 + sw $t1, -636($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_TRUE_211 + # IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_TRUE_211 + lw $t1, -636($fp) + beq $t1, 0, label_TRUE_211 + # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) + # local_option_at_CellularAutomaton_internal_158 = 0 + li $t1, 0 + sw $t1, -636($fp) + # GOTO label_END_212 +j label_END_212 +label_TRUE_211: + # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) + # local_option_at_CellularAutomaton_internal_158 = 1 + li $t1, 1 + sw $t1, -636($fp) + label_END_212: +# IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_FALSEIF_209 +# IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_FALSEIF_209 +lw $t1, -636($fp) +beq $t1, 0, label_FALSEIF_209 +# LOCAL local_option_at_CellularAutomaton_internal_159 --> -640($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_75 +sw $t1, 12($v0) +li $t1, 28 +sw $t1, 16($v0) +sw $v0, -640($fp) +# LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) +# LOCAL local_option_at_CellularAutomaton_internal_159 --> -640($fp) +# local_option_at_CellularAutomaton_internal_157 = local_option_at_CellularAutomaton_internal_159 +lw $t1, -640($fp) +sw $t1, -632($fp) +# GOTO label_ENDIF_210 +j label_ENDIF_210 +label_FALSEIF_209: + # LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_161 = local_option_at_CellularAutomaton_num_0 - 21 + lw $t1, -4($fp) + sub $t1, $t1, 21 + sw $t1, -648($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_161 GOTO label_TRUE_215 + # IF_ZERO local_option_at_CellularAutomaton_internal_161 GOTO label_TRUE_215 + lw $t1, -648($fp) + beq $t1, 0, label_TRUE_215 + # LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) + # local_option_at_CellularAutomaton_internal_161 = 0 + li $t1, 0 + sw $t1, -648($fp) + # GOTO label_END_216 +j label_END_216 +label_TRUE_215: + # LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) + # local_option_at_CellularAutomaton_internal_161 = 1 + li $t1, 1 + sw $t1, -648($fp) + label_END_216: +# IF_ZERO local_option_at_CellularAutomaton_internal_161 GOTO label_FALSEIF_213 +# IF_ZERO local_option_at_CellularAutomaton_internal_161 GOTO label_FALSEIF_213 +lw $t1, -648($fp) +beq $t1, 0, label_FALSEIF_213 +# LOCAL local_option_at_CellularAutomaton_internal_162 --> -652($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_76 +sw $t1, 12($v0) +li $t1, 28 +sw $t1, 16($v0) +sw $v0, -652($fp) +# LOCAL local_option_at_CellularAutomaton_internal_160 --> -644($fp) +# LOCAL local_option_at_CellularAutomaton_internal_162 --> -652($fp) +# local_option_at_CellularAutomaton_internal_160 = local_option_at_CellularAutomaton_internal_162 +lw $t1, -652($fp) +sw $t1, -644($fp) +# GOTO label_ENDIF_214 +j label_ENDIF_214 +label_FALSEIF_213: + # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_77 + sw $t1, 12($v0) + li $t1, 25 + sw $t1, 16($v0) + sw $v0, -656($fp) + # LOCAL local_option_at_CellularAutomaton_internal_160 --> -644($fp) + # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) + # local_option_at_CellularAutomaton_internal_160 = local_option_at_CellularAutomaton_internal_163 + lw $t1, -656($fp) + sw $t1, -644($fp) + label_ENDIF_214: +# LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) +# LOCAL local_option_at_CellularAutomaton_internal_160 --> -644($fp) +# local_option_at_CellularAutomaton_internal_157 = local_option_at_CellularAutomaton_internal_160 +lw $t1, -644($fp) +sw $t1, -632($fp) +label_ENDIF_210: +# LOCAL local_option_at_CellularAutomaton_internal_154 --> -620($fp) +# LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) +# local_option_at_CellularAutomaton_internal_154 = local_option_at_CellularAutomaton_internal_157 +lw $t1, -632($fp) +sw $t1, -620($fp) +label_ENDIF_206: +# LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) +# LOCAL local_option_at_CellularAutomaton_internal_154 --> -620($fp) +# local_option_at_CellularAutomaton_internal_151 = local_option_at_CellularAutomaton_internal_154 +lw $t1, -620($fp) +sw $t1, -608($fp) +label_ENDIF_202: +# LOCAL local_option_at_CellularAutomaton_internal_148 --> -596($fp) +# LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) +# local_option_at_CellularAutomaton_internal_148 = local_option_at_CellularAutomaton_internal_151 +lw $t1, -608($fp) +sw $t1, -596($fp) +label_ENDIF_198: +# LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) +# LOCAL local_option_at_CellularAutomaton_internal_148 --> -596($fp) +# local_option_at_CellularAutomaton_internal_145 = local_option_at_CellularAutomaton_internal_148 +lw $t1, -596($fp) +sw $t1, -584($fp) +label_ENDIF_194: +# LOCAL local_option_at_CellularAutomaton_internal_142 --> -572($fp) +# LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) +# local_option_at_CellularAutomaton_internal_142 = local_option_at_CellularAutomaton_internal_145 +lw $t1, -584($fp) +sw $t1, -572($fp) +label_ENDIF_190: +# LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) +# LOCAL local_option_at_CellularAutomaton_internal_142 --> -572($fp) +# local_option_at_CellularAutomaton_internal_139 = local_option_at_CellularAutomaton_internal_142 +lw $t1, -572($fp) +sw $t1, -560($fp) +label_ENDIF_186: +# LOCAL local_option_at_CellularAutomaton_internal_136 --> -548($fp) +# LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) +# local_option_at_CellularAutomaton_internal_136 = local_option_at_CellularAutomaton_internal_139 +lw $t1, -560($fp) +sw $t1, -548($fp) +label_ENDIF_182: +# LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) +# LOCAL local_option_at_CellularAutomaton_internal_136 --> -548($fp) +# local_option_at_CellularAutomaton_internal_133 = local_option_at_CellularAutomaton_internal_136 +lw $t1, -548($fp) +sw $t1, -536($fp) +label_ENDIF_178: +# LOCAL local_option_at_CellularAutomaton_internal_130 --> -524($fp) +# LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) +# local_option_at_CellularAutomaton_internal_130 = local_option_at_CellularAutomaton_internal_133 +lw $t1, -536($fp) +sw $t1, -524($fp) +label_ENDIF_174: +# LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) +# LOCAL local_option_at_CellularAutomaton_internal_130 --> -524($fp) +# local_option_at_CellularAutomaton_internal_127 = local_option_at_CellularAutomaton_internal_130 +lw $t1, -524($fp) +sw $t1, -512($fp) +label_ENDIF_170: +# LOCAL local_option_at_CellularAutomaton_internal_124 --> -500($fp) +# LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) +# local_option_at_CellularAutomaton_internal_124 = local_option_at_CellularAutomaton_internal_127 +lw $t1, -512($fp) +sw $t1, -500($fp) +label_ENDIF_166: +# LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) +# LOCAL local_option_at_CellularAutomaton_internal_124 --> -500($fp) +# local_option_at_CellularAutomaton_internal_121 = local_option_at_CellularAutomaton_internal_124 +lw $t1, -500($fp) +sw $t1, -488($fp) +label_ENDIF_162: +# LOCAL local_option_at_CellularAutomaton_internal_118 --> -476($fp) +# LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) +# local_option_at_CellularAutomaton_internal_118 = local_option_at_CellularAutomaton_internal_121 +lw $t1, -488($fp) +sw $t1, -476($fp) +label_ENDIF_158: +# LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) +# LOCAL local_option_at_CellularAutomaton_internal_118 --> -476($fp) +# local_option_at_CellularAutomaton_internal_115 = local_option_at_CellularAutomaton_internal_118 +lw $t1, -476($fp) +sw $t1, -464($fp) +label_ENDIF_154: +# LOCAL local_option_at_CellularAutomaton_internal_112 --> -452($fp) +# LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) +# local_option_at_CellularAutomaton_internal_112 = local_option_at_CellularAutomaton_internal_115 +lw $t1, -464($fp) +sw $t1, -452($fp) +label_ENDIF_150: +# LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) +# LOCAL local_option_at_CellularAutomaton_internal_112 --> -452($fp) +# local_option_at_CellularAutomaton_internal_109 = local_option_at_CellularAutomaton_internal_112 +lw $t1, -452($fp) +sw $t1, -440($fp) +label_ENDIF_146: +# LOCAL local_option_at_CellularAutomaton_internal_106 --> -428($fp) +# LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) +# local_option_at_CellularAutomaton_internal_106 = local_option_at_CellularAutomaton_internal_109 +lw $t1, -440($fp) +sw $t1, -428($fp) +label_ENDIF_142: +# LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) +# LOCAL local_option_at_CellularAutomaton_internal_106 --> -428($fp) +# local_option_at_CellularAutomaton_internal_103 = local_option_at_CellularAutomaton_internal_106 +lw $t1, -428($fp) +sw $t1, -416($fp) +label_ENDIF_138: +# LOCAL local_option_at_CellularAutomaton_internal_100 --> -404($fp) +# LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) +# local_option_at_CellularAutomaton_internal_100 = local_option_at_CellularAutomaton_internal_103 +lw $t1, -416($fp) +sw $t1, -404($fp) +label_ENDIF_134: +# RETURN local_option_at_CellularAutomaton_internal_100 +lw $v0, -404($fp) +# Deallocate stack frame for function function_option_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 664 +jr $ra +# Function END + + +# function_prompt_at_CellularAutomaton implementation. +# @Params: +function_prompt_at_CellularAutomaton: + # Allocate stack frame for function function_prompt_at_CellularAutomaton. + subu $sp, $sp, 84 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 84 + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # local_prompt_at_CellularAutomaton_ans_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_3 --> -16($fp) + # local_prompt_at_CellularAutomaton_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_3 --> -16($fp) + # local_prompt_at_CellularAutomaton_internal_1 = local_prompt_at_CellularAutomaton_internal_3 + lw $t1, -16($fp) + sw $t1, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_78 + sw $t1, 12($v0) + li $t1, 55 + sw $t1, 16($v0) + sw $v0, -20($fp) + # ARG local_prompt_at_CellularAutomaton_internal_4 + # LOCAL local_prompt_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t1, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_2 --> -12($fp) + # local_prompt_at_CellularAutomaton_internal_2 = VCALL local_prompt_at_CellularAutomaton_internal_1 out_string + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt_at_CellularAutomaton_internal_7 --> -32($fp) + # local_prompt_at_CellularAutomaton_internal_7 = SELF + sw $s1, -32($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_7 --> -32($fp) + # local_prompt_at_CellularAutomaton_internal_5 = local_prompt_at_CellularAutomaton_internal_7 + lw $t1, -32($fp) + sw $t1, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_79 + sw $t1, 12($v0) + li $t1, 49 + sw $t1, 16($v0) + sw $v0, -36($fp) + # ARG local_prompt_at_CellularAutomaton_internal_8 + # LOCAL local_prompt_at_CellularAutomaton_internal_8 --> -36($fp) + lw $t1, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_6 --> -28($fp) + # local_prompt_at_CellularAutomaton_internal_6 = VCALL local_prompt_at_CellularAutomaton_internal_5 out_string + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt_at_CellularAutomaton_internal_11 --> -48($fp) + # local_prompt_at_CellularAutomaton_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_11 --> -48($fp) + # local_prompt_at_CellularAutomaton_internal_9 = local_prompt_at_CellularAutomaton_internal_11 + lw $t1, -48($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_10 --> -44($fp) + # local_prompt_at_CellularAutomaton_internal_10 = VCALL local_prompt_at_CellularAutomaton_internal_9 in_string + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 20($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_10 --> -44($fp) + # local_prompt_at_CellularAutomaton_ans_0 = local_prompt_at_CellularAutomaton_internal_10 + lw $t1, -44($fp) + sw $t1, -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_14 --> -60($fp) + # local_prompt_at_CellularAutomaton_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_14 --> -60($fp) + # local_prompt_at_CellularAutomaton_internal_12 = local_prompt_at_CellularAutomaton_internal_14 + lw $t1, -60($fp) + sw $t1, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_80 + sw $t1, 12($v0) + li $t1, 2 + sw $t1, 16($v0) + sw $v0, -64($fp) + # ARG local_prompt_at_CellularAutomaton_internal_15 + # LOCAL local_prompt_at_CellularAutomaton_internal_15 --> -64($fp) + lw $t1, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_13 --> -56($fp) + # local_prompt_at_CellularAutomaton_internal_13 = VCALL local_prompt_at_CellularAutomaton_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_81 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -76($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_17 --> -72($fp) + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_18 --> -76($fp) + # local_prompt_at_CellularAutomaton_internal_17 = local_prompt_at_CellularAutomaton_ans_0 - local_prompt_at_CellularAutomaton_internal_18 + lw $t1, -4($fp) + lw $t2, -76($fp) + sub $t1, $t1, $t2 + sw $t1, -72($fp) + # IF_ZERO local_prompt_at_CellularAutomaton_internal_17 GOTO label_TRUE_219 + # IF_ZERO local_prompt_at_CellularAutomaton_internal_17 GOTO label_TRUE_219 + lw $t1, -72($fp) + beq $t1, 0, label_TRUE_219 + # LOCAL local_prompt_at_CellularAutomaton_internal_17 --> -72($fp) + # local_prompt_at_CellularAutomaton_internal_17 = 0 + li $t1, 0 + sw $t1, -72($fp) + # GOTO label_END_220 +j label_END_220 +label_TRUE_219: + # LOCAL local_prompt_at_CellularAutomaton_internal_17 --> -72($fp) + # local_prompt_at_CellularAutomaton_internal_17 = 1 + li $t1, 1 + sw $t1, -72($fp) + label_END_220: +# IF_ZERO local_prompt_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_217 +# IF_ZERO local_prompt_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_217 +lw $t1, -72($fp) +beq $t1, 0, label_FALSEIF_217 +# LOCAL local_prompt_at_CellularAutomaton_internal_16 --> -68($fp) +# local_prompt_at_CellularAutomaton_internal_16 = 0 +li $t1, 0 +sw $t1, -68($fp) +# GOTO label_ENDIF_218 +j label_ENDIF_218 +label_FALSEIF_217: + # LOCAL local_prompt_at_CellularAutomaton_internal_16 --> -68($fp) + # local_prompt_at_CellularAutomaton_internal_16 = 1 + li $t1, 1 + sw $t1, -68($fp) + label_ENDIF_218: +# RETURN local_prompt_at_CellularAutomaton_internal_16 +lw $v0, -68($fp) +# Deallocate stack frame for function function_prompt_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 84 +jr $ra +# Function END + + +# function_prompt2_at_CellularAutomaton implementation. +# @Params: +function_prompt2_at_CellularAutomaton: + # Allocate stack frame for function function_prompt2_at_CellularAutomaton. + subu $sp, $sp, 84 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 84 + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # local_prompt2_at_CellularAutomaton_ans_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_3 --> -16($fp) + # local_prompt2_at_CellularAutomaton_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_3 --> -16($fp) + # local_prompt2_at_CellularAutomaton_internal_1 = local_prompt2_at_CellularAutomaton_internal_3 + lw $t1, -16($fp) + sw $t1, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_82 + sw $t1, 12($v0) + li $t1, 4 + sw $t1, 16($v0) + sw $v0, -20($fp) + # ARG local_prompt2_at_CellularAutomaton_internal_4 + # LOCAL local_prompt2_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t1, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_2 --> -12($fp) + # local_prompt2_at_CellularAutomaton_internal_2 = VCALL local_prompt2_at_CellularAutomaton_internal_1 out_string + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt2_at_CellularAutomaton_internal_7 --> -32($fp) + # local_prompt2_at_CellularAutomaton_internal_7 = SELF + sw $s1, -32($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_7 --> -32($fp) + # local_prompt2_at_CellularAutomaton_internal_5 = local_prompt2_at_CellularAutomaton_internal_7 + lw $t1, -32($fp) + sw $t1, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_83 + sw $t1, 12($v0) + li $t1, 49 + sw $t1, 16($v0) + sw $v0, -36($fp) + # ARG local_prompt2_at_CellularAutomaton_internal_8 + # LOCAL local_prompt2_at_CellularAutomaton_internal_8 --> -36($fp) + lw $t1, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_6 --> -28($fp) + # local_prompt2_at_CellularAutomaton_internal_6 = VCALL local_prompt2_at_CellularAutomaton_internal_5 out_string + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt2_at_CellularAutomaton_internal_11 --> -48($fp) + # local_prompt2_at_CellularAutomaton_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_11 --> -48($fp) + # local_prompt2_at_CellularAutomaton_internal_9 = local_prompt2_at_CellularAutomaton_internal_11 + lw $t1, -48($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_84 + sw $t1, 12($v0) + li $t1, 49 + sw $t1, 16($v0) + sw $v0, -52($fp) + # ARG local_prompt2_at_CellularAutomaton_internal_12 + # LOCAL local_prompt2_at_CellularAutomaton_internal_12 --> -52($fp) + lw $t1, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_10 --> -44($fp) + # local_prompt2_at_CellularAutomaton_internal_10 = VCALL local_prompt2_at_CellularAutomaton_internal_9 out_string + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt2_at_CellularAutomaton_internal_15 --> -64($fp) + # local_prompt2_at_CellularAutomaton_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_15 --> -64($fp) + # local_prompt2_at_CellularAutomaton_internal_13 = local_prompt2_at_CellularAutomaton_internal_15 + lw $t1, -64($fp) + sw $t1, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_14 --> -60($fp) + # local_prompt2_at_CellularAutomaton_internal_14 = VCALL local_prompt2_at_CellularAutomaton_internal_13 in_string + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 20($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_14 --> -60($fp) + # local_prompt2_at_CellularAutomaton_ans_0 = local_prompt2_at_CellularAutomaton_internal_14 + lw $t1, -60($fp) + sw $t1, -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_85 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -76($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_17 --> -72($fp) + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_18 --> -76($fp) + # local_prompt2_at_CellularAutomaton_internal_17 = local_prompt2_at_CellularAutomaton_ans_0 - local_prompt2_at_CellularAutomaton_internal_18 + lw $t1, -4($fp) + lw $t2, -76($fp) + sub $t1, $t1, $t2 + sw $t1, -72($fp) + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_17 GOTO label_TRUE_223 + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_17 GOTO label_TRUE_223 + lw $t1, -72($fp) + beq $t1, 0, label_TRUE_223 + # LOCAL local_prompt2_at_CellularAutomaton_internal_17 --> -72($fp) + # local_prompt2_at_CellularAutomaton_internal_17 = 0 + li $t1, 0 + sw $t1, -72($fp) + # GOTO label_END_224 +j label_END_224 +label_TRUE_223: + # LOCAL local_prompt2_at_CellularAutomaton_internal_17 --> -72($fp) + # local_prompt2_at_CellularAutomaton_internal_17 = 1 + li $t1, 1 + sw $t1, -72($fp) + label_END_224: +# IF_ZERO local_prompt2_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_221 +# IF_ZERO local_prompt2_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_221 +lw $t1, -72($fp) +beq $t1, 0, label_FALSEIF_221 +# LOCAL local_prompt2_at_CellularAutomaton_internal_16 --> -68($fp) +# local_prompt2_at_CellularAutomaton_internal_16 = 1 +li $t1, 1 +sw $t1, -68($fp) +# GOTO label_ENDIF_222 +j label_ENDIF_222 +label_FALSEIF_221: + # LOCAL local_prompt2_at_CellularAutomaton_internal_16 --> -68($fp) + # local_prompt2_at_CellularAutomaton_internal_16 = 0 + li $t1, 0 + sw $t1, -68($fp) + label_ENDIF_222: +# RETURN local_prompt2_at_CellularAutomaton_internal_16 +lw $v0, -68($fp) +# Deallocate stack frame for function function_prompt2_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 84 +jr $ra +# Function END + + +# __Main__attrib__cells__init implementation. +# @Params: +__Main__attrib__cells__init: + # Allocate stack frame for function __Main__attrib__cells__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__cells__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 140 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 140 + # LOCAL local_main_at_Main_continue_0 --> -4($fp) + # local_main_at_Main_continue_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # LOCAL local_main_at_Main_choice_1 --> -8($fp) + # local_main_at_Main_choice_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 + lw $t1, -20($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_86 + sw $t1, 12($v0) + li $t1, 30 + sw $t1, 16($v0) + sw $v0, -24($fp) + # ARG local_main_at_Main_internal_5 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t1, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 + lw $t1, -36($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_87 + sw $t1, 12($v0) + li $t1, 48 + sw $t1, 16($v0) + sw $v0, -40($fp) + # ARG local_main_at_Main_internal_9 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + lw $t1, -40($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_string + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_WHILE_225: + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 + lw $t1, -52($fp) + sw $t1, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 prompt2 + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 104($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # IF_ZERO local_main_at_Main_internal_11 GOTO label_WHILE_END_226 + # IF_ZERO local_main_at_Main_internal_11 GOTO label_WHILE_END_226 + lw $t1, -48($fp) + beq $t1, 0, label_WHILE_END_226 + # LOCAL local_main_at_Main_continue_0 --> -4($fp) + # local_main_at_Main_continue_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 + lw $t1, -64($fp) + sw $t1, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 option + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 96($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_choice_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_choice_1 = local_main_at_Main_internal_14 + lw $t1, -60($fp) + sw $t1, -8($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_18 = ALLOCATE CellularAutomaton + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, CellularAutomaton + sw $t3, 12($v0) + li $t3, 17 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 28 bytes of memory + li $a0, 28 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, CellularAutomaton_start + sw $t3, 4($v0) + # Load type offset + li $t3, 20 + sw $t3, 8($v0) + move $t2, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Board__attrib__rows__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Board__attrib__columns__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Board__attrib__board_size__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __CellularAutomaton__attrib__population_map__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t2) + sw $t2, -76($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 + lw $t2, -76($fp) + sw $t2, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_choice_1 + # LOCAL local_main_at_Main_choice_1 --> -8($fp) + lw $t2, -8($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 init + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 36($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + lw $t2, -72($fp) + sw $t2, 28($s1) + # local_main_at_Main_internal_21 = GETATTRIBUTE cells Main + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + lw $t2, 28($s1) + sw $t2, -88($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 + lw $t2, -88($fp) + sw $t2, -80($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 print + # Save new self pointer in $s1 + lw $s1, -80($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 40($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -84($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_WHILE_227: + # IF_ZERO local_main_at_Main_continue_0 GOTO label_WHILE_END_228 + # IF_ZERO local_main_at_Main_continue_0 GOTO label_WHILE_END_228 + lw $t2, -4($fp) + beq $t2, 0, label_WHILE_END_228 + # LOCAL local_main_at_Main_internal_25 --> -104($fp) + # local_main_at_Main_internal_25 = SELF + sw $s1, -104($fp) + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # LOCAL local_main_at_Main_internal_25 --> -104($fp) + # local_main_at_Main_internal_23 = local_main_at_Main_internal_25 + lw $t2, -104($fp) + sw $t2, -96($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # LOCAL local_main_at_Main_internal_24 --> -100($fp) + # local_main_at_Main_internal_24 = VCALL local_main_at_Main_internal_23 prompt + # Save new self pointer in $s1 + lw $s1, -96($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 100($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -100($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # IF_ZERO local_main_at_Main_internal_24 GOTO label_FALSEIF_229 + # IF_ZERO local_main_at_Main_internal_24 GOTO label_FALSEIF_229 + lw $t2, -100($fp) + beq $t2, 0, label_FALSEIF_229 + # local_main_at_Main_internal_28 = GETATTRIBUTE cells Main + # LOCAL local_main_at_Main_internal_28 --> -116($fp) + lw $t2, 28($s1) + sw $t2, -116($fp) + # LOCAL local_main_at_Main_internal_26 --> -108($fp) + # LOCAL local_main_at_Main_internal_28 --> -116($fp) + # local_main_at_Main_internal_26 = local_main_at_Main_internal_28 + lw $t2, -116($fp) + sw $t2, -108($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_26 --> -108($fp) + # LOCAL local_main_at_Main_internal_27 --> -112($fp) + # local_main_at_Main_internal_27 = VCALL local_main_at_Main_internal_26 evolve + # Save new self pointer in $s1 + lw $s1, -108($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 92($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -112($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_main_at_Main_internal_31 = GETATTRIBUTE cells Main + # LOCAL local_main_at_Main_internal_31 --> -128($fp) + lw $t2, 28($s1) + sw $t2, -128($fp) + # LOCAL local_main_at_Main_internal_29 --> -120($fp) + # LOCAL local_main_at_Main_internal_31 --> -128($fp) + # local_main_at_Main_internal_29 = local_main_at_Main_internal_31 + lw $t2, -128($fp) + sw $t2, -120($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_29 --> -120($fp) + # LOCAL local_main_at_Main_internal_30 --> -124($fp) + # local_main_at_Main_internal_30 = VCALL local_main_at_Main_internal_29 print + # Save new self pointer in $s1 + lw $s1, -120($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 40($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -124($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # LOCAL local_main_at_Main_internal_30 --> -124($fp) + # local_main_at_Main_internal_22 = local_main_at_Main_internal_30 + lw $t2, -124($fp) + sw $t2, -92($fp) + # GOTO label_ENDIF_230 +j label_ENDIF_230 +label_FALSEIF_229: + # LOCAL local_main_at_Main_continue_0 --> -4($fp) + # local_main_at_Main_continue_0 = 0 + li $t2, 0 + sw $t2, -4($fp) + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # local_main_at_Main_internal_22 = + label_ENDIF_230: +# GOTO label_WHILE_227 +j label_WHILE_227 +label_WHILE_END_228: + # GOTO label_WHILE_225 + j label_WHILE_225 + label_WHILE_END_226: + # LOCAL local_main_at_Main_internal_32 --> -132($fp) + # local_main_at_Main_internal_32 = SELF + sw $s1, -132($fp) + # RETURN local_main_at_Main_internal_32 + lw $v0, -132($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 140 + jr $ra + # Function END + diff --git a/tests/codegen/list.mips b/tests/codegen/list.mips index 3cb83bed..2dc05a30 100644 --- a/tests/codegen/list.mips +++ b/tests/codegen/list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 17:36:47 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:21 2020 # School of Math and Computer Science, University of Havana # @@ -158,17 +158,52 @@ function_in_string_at_IO: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END # function_out_int_at_IO implementation. @@ -332,7 +367,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -977,23 +1012,23 @@ __Main__attrib__mylist__init: # 0($fp) = param_print_list_at_Main_l_0 function_print_list_at_Main: # Allocate stack frame for function function_print_list_at_Main. - subu $sp, $sp, 88 + subu $sp, $sp, 92 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 88 - # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) + addu $fp, $sp, 92 + # LOCAL local_print_list_at_Main_internal_1 --> -8($fp) # PARAM param_print_list_at_Main_l_0 --> 0($fp) - # local_print_list_at_Main_internal_0 = PARAM param_print_list_at_Main_l_0 + # local_print_list_at_Main_internal_1 = PARAM param_print_list_at_Main_l_0 lw $t2, 0($fp) - sw $t2, -4($fp) + sw $t2, -8($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) # LOCAL local_print_list_at_Main_internal_1 --> -8($fp) - # local_print_list_at_Main_internal_1 = VCALL local_print_list_at_Main_internal_0 isNil + # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) + # local_print_list_at_Main_internal_2 = VCALL local_print_list_at_Main_internal_1 isNil # Save new self pointer in $s1 - lw $s1, -4($fp) + lw $s1, -8($fp) # Get pointer to type lw $t2, 4($s1) # Get pointer to type's VTABLE @@ -1002,26 +1037,26 @@ function_print_list_at_Main: lw $t4, 12($t3) # Call function. Result is on $v0 jalr $t4 - sw $v0, -8($fp) + sw $v0, -12($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # IF_ZERO local_print_list_at_Main_internal_1 GOTO label_FALSE_1 - # IF_ZERO local_print_list_at_Main_internal_1 GOTO label_FALSE_1 - lw $t2, -8($fp) - beq $t2, 0, label_FALSE_1 - # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) - # local_print_list_at_Main_internal_4 = SELF - sw $s1, -20($fp) - # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) - # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) - # local_print_list_at_Main_internal_2 = local_print_list_at_Main_internal_4 - lw $t2, -20($fp) - sw $t2, -12($fp) + # IF_ZERO local_print_list_at_Main_internal_2 GOTO label_FALSEIF_1 + # IF_ZERO local_print_list_at_Main_internal_2 GOTO label_FALSEIF_1 + lw $t2, -12($fp) + beq $t2, 0, label_FALSEIF_1 + # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) + # local_print_list_at_Main_internal_5 = SELF + sw $s1, -24($fp) + # LOCAL local_print_list_at_Main_internal_3 --> -16($fp) + # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) + # local_print_list_at_Main_internal_3 = local_print_list_at_Main_internal_5 + lw $t2, -24($fp) + sw $t2, -16($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1038,18 +1073,18 @@ function_print_list_at_Main: sw $t2, 12($v0) li $t2, 2 sw $t2, 16($v0) - sw $v0, -24($fp) - # ARG local_print_list_at_Main_internal_5 - # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) - lw $t2, -24($fp) + sw $v0, -28($fp) + # ARG local_print_list_at_Main_internal_6 + # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) + lw $t2, -28($fp) # Push arg into stack subu $sp, $sp, 4 sw $t2, 0($sp) - # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) # LOCAL local_print_list_at_Main_internal_3 --> -16($fp) - # local_print_list_at_Main_internal_3 = VCALL local_print_list_at_Main_internal_2 out_string + # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) + # local_print_list_at_Main_internal_4 = VCALL local_print_list_at_Main_internal_3 out_string # Save new self pointer in $s1 - lw $s1, -12($fp) + lw $s1, -16($fp) # Get pointer to type lw $t2, 4($s1) # Get pointer to type's VTABLE @@ -1058,37 +1093,42 @@ function_print_list_at_Main: lw $t4, 12($t3) # Call function. Result is on $v0 jalr $t4 - sw $v0, -16($fp) + sw $v0, -20($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # GOTO label_END_2 -j label_END_2 -label_FALSE_1: - # LOCAL local_print_list_at_Main_internal_8 --> -36($fp) - # local_print_list_at_Main_internal_8 = SELF - sw $s1, -36($fp) - # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Main_internal_8 --> -36($fp) - # local_print_list_at_Main_internal_6 = local_print_list_at_Main_internal_8 - lw $t2, -36($fp) - sw $t2, -28($fp) + # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) + # local_print_list_at_Main_internal_0 = local_print_list_at_Main_internal_4 + lw $t2, -20($fp) + sw $t2, -4($fp) + # GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) + # local_print_list_at_Main_internal_9 = SELF + sw $s1, -40($fp) + # LOCAL local_print_list_at_Main_internal_7 --> -32($fp) + # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) + # local_print_list_at_Main_internal_7 = local_print_list_at_Main_internal_9 + lw $t2, -40($fp) + sw $t2, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) + # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) # PARAM param_print_list_at_Main_l_0 --> 0($fp) - # local_print_list_at_Main_internal_9 = PARAM param_print_list_at_Main_l_0 + # local_print_list_at_Main_internal_10 = PARAM param_print_list_at_Main_l_0 lw $t2, 0($fp) - sw $t2, -40($fp) + sw $t2, -44($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) - # local_print_list_at_Main_internal_10 = VCALL local_print_list_at_Main_internal_9 head + # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) + # local_print_list_at_Main_internal_11 = VCALL local_print_list_at_Main_internal_10 head # Save new self pointer in $s1 - lw $s1, -40($fp) + lw $s1, -44($fp) # Get pointer to type lw $t2, 4($s1) # Get pointer to type's VTABLE @@ -1097,21 +1137,21 @@ label_FALSE_1: lw $t4, 16($t3) # Call function. Result is on $v0 jalr $t4 - sw $v0, -44($fp) + sw $v0, -48($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # ARG local_print_list_at_Main_internal_10 - # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) - lw $t2, -44($fp) + # ARG local_print_list_at_Main_internal_11 + # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) + lw $t2, -48($fp) # Push arg into stack subu $sp, $sp, 4 sw $t2, 0($sp) - # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) # LOCAL local_print_list_at_Main_internal_7 --> -32($fp) - # local_print_list_at_Main_internal_7 = VCALL local_print_list_at_Main_internal_6 out_int + # LOCAL local_print_list_at_Main_internal_8 --> -36($fp) + # local_print_list_at_Main_internal_8 = VCALL local_print_list_at_Main_internal_7 out_int # Save new self pointer in $s1 - lw $s1, -28($fp) + lw $s1, -32($fp) # Get pointer to type lw $t2, 4($s1) # Get pointer to type's VTABLE @@ -1120,22 +1160,22 @@ label_FALSE_1: lw $t4, 16($t3) # Call function. Result is on $v0 jalr $t4 - sw $v0, -32($fp) + sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_list_at_Main_internal_13 --> -56($fp) - # local_print_list_at_Main_internal_13 = SELF - sw $s1, -56($fp) - # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) - # LOCAL local_print_list_at_Main_internal_13 --> -56($fp) - # local_print_list_at_Main_internal_11 = local_print_list_at_Main_internal_13 - lw $t2, -56($fp) - sw $t2, -48($fp) + # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) + # local_print_list_at_Main_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_print_list_at_Main_internal_12 --> -52($fp) + # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) + # local_print_list_at_Main_internal_12 = local_print_list_at_Main_internal_14 + lw $t2, -60($fp) + sw $t2, -52($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) + # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1152,18 +1192,18 @@ label_FALSE_1: sw $t2, 12($v0) li $t2, 1 sw $t2, 16($v0) - sw $v0, -60($fp) - # ARG local_print_list_at_Main_internal_14 - # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) - lw $t2, -60($fp) + sw $v0, -64($fp) + # ARG local_print_list_at_Main_internal_15 + # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) + lw $t2, -64($fp) # Push arg into stack subu $sp, $sp, 4 sw $t2, 0($sp) - # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) # LOCAL local_print_list_at_Main_internal_12 --> -52($fp) - # local_print_list_at_Main_internal_12 = VCALL local_print_list_at_Main_internal_11 out_string + # LOCAL local_print_list_at_Main_internal_13 --> -56($fp) + # local_print_list_at_Main_internal_13 = VCALL local_print_list_at_Main_internal_12 out_string # Save new self pointer in $s1 - lw $s1, -48($fp) + lw $s1, -52($fp) # Get pointer to type lw $t2, 4($s1) # Get pointer to type's VTABLE @@ -1172,34 +1212,34 @@ label_FALSE_1: lw $t4, 12($t3) # Call function. Result is on $v0 jalr $t4 - sw $v0, -52($fp) + sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) - # local_print_list_at_Main_internal_17 = SELF - sw $s1, -72($fp) - # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) - # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) - # local_print_list_at_Main_internal_15 = local_print_list_at_Main_internal_17 - lw $t2, -72($fp) - sw $t2, -64($fp) + # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) + # local_print_list_at_Main_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_print_list_at_Main_internal_16 --> -68($fp) + # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) + # local_print_list_at_Main_internal_16 = local_print_list_at_Main_internal_18 + lw $t2, -76($fp) + sw $t2, -68($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) + # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) # PARAM param_print_list_at_Main_l_0 --> 0($fp) - # local_print_list_at_Main_internal_18 = PARAM param_print_list_at_Main_l_0 + # local_print_list_at_Main_internal_19 = PARAM param_print_list_at_Main_l_0 lw $t2, 0($fp) - sw $t2, -76($fp) + sw $t2, -80($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) - # local_print_list_at_Main_internal_19 = VCALL local_print_list_at_Main_internal_18 tail + # LOCAL local_print_list_at_Main_internal_20 --> -84($fp) + # local_print_list_at_Main_internal_20 = VCALL local_print_list_at_Main_internal_19 tail # Save new self pointer in $s1 - lw $s1, -76($fp) + lw $s1, -80($fp) # Get pointer to type lw $t2, 4($s1) # Get pointer to type's VTABLE @@ -1208,21 +1248,21 @@ label_FALSE_1: lw $t4, 20($t3) # Call function. Result is on $v0 jalr $t4 - sw $v0, -80($fp) + sw $v0, -84($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # ARG local_print_list_at_Main_internal_19 - # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) - lw $t2, -80($fp) + # ARG local_print_list_at_Main_internal_20 + # LOCAL local_print_list_at_Main_internal_20 --> -84($fp) + lw $t2, -84($fp) # Push arg into stack subu $sp, $sp, 4 sw $t2, 0($sp) - # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) # LOCAL local_print_list_at_Main_internal_16 --> -68($fp) - # local_print_list_at_Main_internal_16 = VCALL local_print_list_at_Main_internal_15 print_list + # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) + # local_print_list_at_Main_internal_17 = VCALL local_print_list_at_Main_internal_16 print_list # Save new self pointer in $s1 - lw $s1, -64($fp) + lw $s1, -68($fp) # Get pointer to type lw $t2, 4($s1) # Get pointer to type's VTABLE @@ -1231,19 +1271,25 @@ label_FALSE_1: lw $t4, 28($t3) # Call function. Result is on $v0 jalr $t4 - sw $v0, -68($fp) + sw $v0, -72($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - label_END_2: -# RETURN + # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) + # local_print_list_at_Main_internal_0 = local_print_list_at_Main_internal_17 + lw $t2, -72($fp) + sw $t2, -4($fp) + label_ENDIF_2: +# RETURN local_print_list_at_Main_internal_0 +lw $v0, -4($fp) # Deallocate stack frame for function function_print_list_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 88 +addu $sp, $sp, 92 # Deallocate function args addu $sp, $sp, 4 jr $ra diff --git a/tests/codegen/new_complex.mips b/tests/codegen/new_complex.mips new file mode 100644 index 00000000..d29732f4 --- /dev/null +++ b/tests/codegen/new_complex.mips @@ -0,0 +1,2008 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:19 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Main: .asciiz "Main" +# Function END +Complex: .asciiz "Complex" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +# **** VTABLE for type Complex **** +Complex_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Complex, function_print_at_Complex, function_reflect_0_at_Complex, function_reflect_X_at_Complex, function_reflect_Y_at_Complex, function_equal_at_Complex, function_x_value_at_Complex, function_y_value_at_Complex +# Function END +# + + +# **** Type RECORD for type Complex **** +Complex_start: + Complex_vtable_pointer: .word Complex_vtable + # Function END +Complex_end: +# + + +data_0: .asciiz "" +# + + +IO__TDT: .word 0, -1, -1, -1, 1, 1 +Object__TDT: .word 1, 0, 1, 1, 2, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1 +Main__TDT: .word -1, -1, -1, -1, 0, -1 +Complex__TDT: .word -1, -1, -1, -1, -1, 0 +# + + +data_2: .asciiz "=)\n" +# + + +data_3: .asciiz "=(\n" +# + + +data_4: .asciiz "=)\n" +# + + +data_5: .asciiz "=(\n" +# + + +data_6: .asciiz "+" +# + + +data_7: .asciiz "I" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + li $a0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) + move $t1, $v0 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 28($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 148 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 148 + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_c_0 = ALLOCATE Complex + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Complex + sw $t3, 12($v0) + li $t3, 7 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Complex_start + sw $t3, 4($v0) + # Load type offset + li $t3, 20 + sw $t3, 8($v0) + move $t2, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Complex__attrib__x__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Complex__attrib__y__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t2) + sw $t2, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE Complex + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Complex + sw $t4, 12($v0) + li $t4, 7 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Complex_start + sw $t4, 4($v0) + # Load type offset + li $t4, 20 + sw $t4, 8($v0) + move $t3, $v0 + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Complex__attrib__x__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t3) + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Complex__attrib__y__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t3) + sw $t3, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t3, -16($fp) + sw $t3, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 1 + li $t3, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # ARG 1 + li $t3, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 28($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_c_0 = local_main_at_Main_internal_2 + lw $t3, -12($fp) + sw $t3, -4($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_c_0 + lw $t3, -4($fp) + sw $t3, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 reflect_X + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 40($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_internal_8 = local_main_at_Main_c_0 + lw $t3, -4($fp) + sw $t3, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 reflect_0 + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 36($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_5 = local_main_at_Main_internal_7 - local_main_at_Main_internal_9 + lw $t3, -32($fp) + lw $t4, -40($fp) + sub $t3, $t3, $t4 + sw $t3, -24($fp) + # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_3 + # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_3 + lw $t3, -24($fp) + beq $t3, 0, label_TRUE_3 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = 0 + li $t3, 0 + sw $t3, -24($fp) + # GOTO label_END_4 +j label_END_4 +label_TRUE_3: + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = 1 + li $t3, 1 + sw $t3, -24($fp) + label_END_4: +# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_1 +# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_1 +lw $t3, -24($fp) +beq $t3, 0, label_FALSEIF_1 +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# local_main_at_Main_internal_12 = SELF +sw $s1, -52($fp) +# LOCAL local_main_at_Main_internal_10 --> -44($fp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# local_main_at_Main_internal_10 = local_main_at_Main_internal_12 +lw $t3, -52($fp) +sw $t3, -44($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t3, String +sw $t3, 0($v0) +la $t3, String_start +sw $t3, 4($v0) +# Load type offset +li $t3, 8 +sw $t3, 8($v0) +la $t3, data_2 +sw $t3, 12($v0) +li $t3, 4 +sw $t3, 16($v0) +sw $v0, -56($fp) +# ARG local_main_at_Main_internal_13 +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +lw $t3, -56($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_10 --> -44($fp) +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +# local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 out_string +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 12($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_4 --> -20($fp) +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +# local_main_at_Main_internal_4 = local_main_at_Main_internal_11 +lw $t3, -48($fp) +sw $t3, -20($fp) +# GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_14 = local_main_at_Main_internal_16 + lw $t3, -68($fp) + sw $t3, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_3 + sw $t3, 12($v0) + li $t3, 4 + sw $t3, 16($v0) + sw $v0, -72($fp) + # ARG local_main_at_Main_internal_17 + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + lw $t3, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 out_string + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_15 + lw $t3, -64($fp) + sw $t3, -20($fp) + label_ENDIF_2: +# LOCAL local_main_at_Main_internal_23 --> -96($fp) +# LOCAL local_main_at_Main_c_0 --> -4($fp) +# local_main_at_Main_internal_23 = local_main_at_Main_c_0 +lw $t3, -4($fp) +sw $t3, -96($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_23 --> -96($fp) +# LOCAL local_main_at_Main_internal_24 --> -100($fp) +# local_main_at_Main_internal_24 = VCALL local_main_at_Main_internal_23 reflect_X +# Save new self pointer in $s1 +lw $s1, -96($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 40($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -100($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_21 --> -88($fp) +# LOCAL local_main_at_Main_internal_24 --> -100($fp) +# local_main_at_Main_internal_21 = local_main_at_Main_internal_24 +lw $t3, -100($fp) +sw $t3, -88($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_21 --> -88($fp) +# LOCAL local_main_at_Main_internal_22 --> -92($fp) +# local_main_at_Main_internal_22 = VCALL local_main_at_Main_internal_21 reflect_Y +# Save new self pointer in $s1 +lw $s1, -88($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 44($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -92($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# LOCAL local_main_at_Main_internal_22 --> -92($fp) +# local_main_at_Main_internal_19 = local_main_at_Main_internal_22 +lw $t3, -92($fp) +sw $t3, -80($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_25 --> -104($fp) +# LOCAL local_main_at_Main_c_0 --> -4($fp) +# local_main_at_Main_internal_25 = local_main_at_Main_c_0 +lw $t3, -4($fp) +sw $t3, -104($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_25 --> -104($fp) +# LOCAL local_main_at_Main_internal_26 --> -108($fp) +# local_main_at_Main_internal_26 = VCALL local_main_at_Main_internal_25 reflect_0 +# Save new self pointer in $s1 +lw $s1, -104($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 36($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -108($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_26 +# LOCAL local_main_at_Main_internal_26 --> -108($fp) +lw $t3, -108($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# LOCAL local_main_at_Main_internal_20 --> -84($fp) +# local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 equal +# Save new self pointer in $s1 +lw $s1, -80($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 48($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -84($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# IF_ZERO local_main_at_Main_internal_20 GOTO label_FALSEIF_5 +# IF_ZERO local_main_at_Main_internal_20 GOTO label_FALSEIF_5 +lw $t3, -84($fp) +beq $t3, 0, label_FALSEIF_5 +# LOCAL local_main_at_Main_internal_29 --> -120($fp) +# local_main_at_Main_internal_29 = SELF +sw $s1, -120($fp) +# LOCAL local_main_at_Main_internal_27 --> -112($fp) +# LOCAL local_main_at_Main_internal_29 --> -120($fp) +# local_main_at_Main_internal_27 = local_main_at_Main_internal_29 +lw $t3, -120($fp) +sw $t3, -112($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_30 --> -124($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t3, String +sw $t3, 0($v0) +la $t3, String_start +sw $t3, 4($v0) +# Load type offset +li $t3, 8 +sw $t3, 8($v0) +la $t3, data_4 +sw $t3, 12($v0) +li $t3, 4 +sw $t3, 16($v0) +sw $v0, -124($fp) +# ARG local_main_at_Main_internal_30 +# LOCAL local_main_at_Main_internal_30 --> -124($fp) +lw $t3, -124($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_27 --> -112($fp) +# LOCAL local_main_at_Main_internal_28 --> -116($fp) +# local_main_at_Main_internal_28 = VCALL local_main_at_Main_internal_27 out_string +# Save new self pointer in $s1 +lw $s1, -112($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 12($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -116($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# LOCAL local_main_at_Main_internal_28 --> -116($fp) +# local_main_at_Main_internal_18 = local_main_at_Main_internal_28 +lw $t3, -116($fp) +sw $t3, -76($fp) +# GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # local_main_at_Main_internal_33 = SELF + sw $s1, -136($fp) + # LOCAL local_main_at_Main_internal_31 --> -128($fp) + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # local_main_at_Main_internal_31 = local_main_at_Main_internal_33 + lw $t3, -136($fp) + sw $t3, -128($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_5 + sw $t3, 12($v0) + li $t3, 4 + sw $t3, 16($v0) + sw $v0, -140($fp) + # ARG local_main_at_Main_internal_34 + # LOCAL local_main_at_Main_internal_34 --> -140($fp) + lw $t3, -140($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_31 --> -128($fp) + # LOCAL local_main_at_Main_internal_32 --> -132($fp) + # local_main_at_Main_internal_32 = VCALL local_main_at_Main_internal_31 out_string + # Save new self pointer in $s1 + lw $s1, -128($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -132($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_32 --> -132($fp) + # local_main_at_Main_internal_18 = local_main_at_Main_internal_32 + lw $t3, -132($fp) + sw $t3, -76($fp) + label_ENDIF_6: +# RETURN local_main_at_Main_internal_18 +lw $v0, -76($fp) +# Deallocate stack frame for function function_main_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 148 +jr $ra +# Function END + + +# __Complex__attrib__x__init implementation. +# @Params: +__Complex__attrib__x__init: + # Allocate stack frame for function __Complex__attrib__x__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Complex__attrib__x__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Complex__attrib__y__init implementation. +# @Params: +__Complex__attrib__y__init: + # Allocate stack frame for function __Complex__attrib__y__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Complex__attrib__y__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Complex implementation. +# @Params: +# 0($fp) = param_init_at_Complex_a_0 +# 4($fp) = param_init_at_Complex_b_1 +function_init_at_Complex: + # Allocate stack frame for function function_init_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_init_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + lw $t3, 12($s1) + sw $t3, -8($fp) + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + # local_init_at_Complex_internal_0 = local_init_at_Complex_internal_1 - PARAM param_init_at_Complex_a_0 + lw $t3, -8($fp) + lw $t4, 4($fp) + sub $t3, $t3, $t4 + sw $t3, -4($fp) + # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_7 + # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_7 + lw $t3, -4($fp) + beq $t3, 0, label_TRUE_7 + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # local_init_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + # GOTO label_END_8 +j label_END_8 +label_TRUE_7: + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # local_init_at_Complex_internal_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + label_END_8: +# local_init_at_Complex_internal_3 = GETATTRIBUTE y Complex +# LOCAL local_init_at_Complex_internal_3 --> -16($fp) +lw $t3, 16($s1) +sw $t3, -16($fp) +# LOCAL local_init_at_Complex_internal_2 --> -12($fp) +# LOCAL local_init_at_Complex_internal_3 --> -16($fp) +# PARAM param_init_at_Complex_b_1 --> 0($fp) +# local_init_at_Complex_internal_2 = local_init_at_Complex_internal_3 - PARAM param_init_at_Complex_b_1 +lw $t3, -16($fp) +lw $t4, 0($fp) +sub $t3, $t3, $t4 +sw $t3, -12($fp) +# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_9 +# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_9 +lw $t3, -12($fp) +beq $t3, 0, label_TRUE_9 +# LOCAL local_init_at_Complex_internal_2 --> -12($fp) +# local_init_at_Complex_internal_2 = 0 +li $t3, 0 +sw $t3, -12($fp) +# GOTO label_END_10 +j label_END_10 +label_TRUE_9: + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # local_init_at_Complex_internal_2 = 1 + li $t3, 1 + sw $t3, -12($fp) + label_END_10: +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# local_init_at_Complex_internal_4 = SELF +sw $s1, -20($fp) +# RETURN local_init_at_Complex_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_init_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +# Deallocate function args +addu $sp, $sp, 8 +jr $ra +# Function END + + +# function_print_at_Complex implementation. +# @Params: +function_print_at_Complex: + # Allocate stack frame for function function_print_at_Complex. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # local_print_at_Complex_internal_2 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_2 --> -12($fp) + lw $t3, 16($s1) + sw $t3, -12($fp) + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # LOCAL local_print_at_Complex_internal_2 --> -12($fp) + # local_print_at_Complex_internal_1 = local_print_at_Complex_internal_2 - 0 + lw $t3, -12($fp) + sub $t3, $t3, 0 + sw $t3, -8($fp) + # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_13 + # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_13 + lw $t3, -8($fp) + beq $t3, 0, label_TRUE_13 + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # local_print_at_Complex_internal_1 = 0 + li $t3, 0 + sw $t3, -8($fp) + # GOTO label_END_14 +j label_END_14 +label_TRUE_13: + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # local_print_at_Complex_internal_1 = 1 + li $t3, 1 + sw $t3, -8($fp) + label_END_14: +# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_11 +# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_11 +lw $t3, -8($fp) +beq $t3, 0, label_FALSEIF_11 +# LOCAL local_print_at_Complex_internal_5 --> -24($fp) +# local_print_at_Complex_internal_5 = SELF +sw $s1, -24($fp) +# LOCAL local_print_at_Complex_internal_3 --> -16($fp) +# LOCAL local_print_at_Complex_internal_5 --> -24($fp) +# local_print_at_Complex_internal_3 = local_print_at_Complex_internal_5 +lw $t3, -24($fp) +sw $t3, -16($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_print_at_Complex_internal_6 = GETATTRIBUTE x Complex +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +lw $t3, 12($s1) +sw $t3, -28($fp) +# ARG local_print_at_Complex_internal_6 +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +lw $t3, -28($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_print_at_Complex_internal_3 --> -16($fp) +# LOCAL local_print_at_Complex_internal_4 --> -20($fp) +# local_print_at_Complex_internal_4 = VCALL local_print_at_Complex_internal_3 out_int +# Save new self pointer in $s1 +lw $s1, -16($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 16($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -20($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_print_at_Complex_internal_0 --> -4($fp) +# LOCAL local_print_at_Complex_internal_4 --> -20($fp) +# local_print_at_Complex_internal_0 = local_print_at_Complex_internal_4 +lw $t3, -20($fp) +sw $t3, -4($fp) +# GOTO label_ENDIF_12 +j label_ENDIF_12 +label_FALSEIF_11: + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_13 = local_print_at_Complex_internal_15 + lw $t3, -64($fp) + sw $t3, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Complex_internal_16 = GETATTRIBUTE x Complex + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + lw $t3, 12($s1) + sw $t3, -68($fp) + # ARG local_print_at_Complex_internal_16 + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + lw $t3, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # LOCAL local_print_at_Complex_internal_14 --> -60($fp) + # local_print_at_Complex_internal_14 = VCALL local_print_at_Complex_internal_13 out_int + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 16($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # LOCAL local_print_at_Complex_internal_14 --> -60($fp) + # local_print_at_Complex_internal_11 = local_print_at_Complex_internal_14 + lw $t3, -60($fp) + sw $t3, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_6 + sw $t3, 12($v0) + li $t3, 1 + sw $t3, 16($v0) + sw $v0, -72($fp) + # ARG local_print_at_Complex_internal_17 + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + lw $t3, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # LOCAL local_print_at_Complex_internal_12 --> -52($fp) + # local_print_at_Complex_internal_12 = VCALL local_print_at_Complex_internal_11 out_string + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_9 --> -40($fp) + # LOCAL local_print_at_Complex_internal_12 --> -52($fp) + # local_print_at_Complex_internal_9 = local_print_at_Complex_internal_12 + lw $t3, -52($fp) + sw $t3, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Complex_internal_18 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + lw $t3, 16($s1) + sw $t3, -76($fp) + # ARG local_print_at_Complex_internal_18 + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + lw $t3, -76($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_print_at_Complex_internal_9 --> -40($fp) + # LOCAL local_print_at_Complex_internal_10 --> -44($fp) + # local_print_at_Complex_internal_10 = VCALL local_print_at_Complex_internal_9 out_int + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 16($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_7 --> -32($fp) + # LOCAL local_print_at_Complex_internal_10 --> -44($fp) + # local_print_at_Complex_internal_7 = local_print_at_Complex_internal_10 + lw $t3, -44($fp) + sw $t3, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_7 + sw $t3, 12($v0) + li $t3, 1 + sw $t3, 16($v0) + sw $v0, -80($fp) + # ARG local_print_at_Complex_internal_19 + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + lw $t3, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_print_at_Complex_internal_7 --> -32($fp) + # LOCAL local_print_at_Complex_internal_8 --> -36($fp) + # local_print_at_Complex_internal_8 = VCALL local_print_at_Complex_internal_7 out_string + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_0 --> -4($fp) + # LOCAL local_print_at_Complex_internal_8 --> -36($fp) + # local_print_at_Complex_internal_0 = local_print_at_Complex_internal_8 + lw $t3, -36($fp) + sw $t3, -4($fp) + label_ENDIF_12: +# RETURN local_print_at_Complex_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_print_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +jr $ra +# Function END + + +# function_reflect_0_at_Complex implementation. +# @Params: +function_reflect_0_at_Complex: + # Allocate stack frame for function function_reflect_0_at_Complex. + subu $sp, $sp, 44 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 44 + # local_reflect_0_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + lw $t3, 12($s1) + sw $t3, -8($fp) + # local_reflect_0_at_Complex_internal_3 = GETATTRIBUTE x Complex + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + lw $t3, 12($s1) + sw $t3, -16($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + lw $t3, -16($fp) + not $t3, $t3 + sw $t3, -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # local_reflect_0_at_Complex_internal_0 = local_reflect_0_at_Complex_internal_1 - local_reflect_0_at_Complex_internal_2 + lw $t3, -8($fp) + lw $t4, -12($fp) + sub $t3, $t3, $t4 + sw $t3, -4($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_15 + # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_15 + lw $t3, -4($fp) + beq $t3, 0, label_TRUE_15 + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # local_reflect_0_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + # GOTO label_END_16 +j label_END_16 +label_TRUE_15: + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # local_reflect_0_at_Complex_internal_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + label_END_16: +# local_reflect_0_at_Complex_internal_5 = GETATTRIBUTE y Complex +# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) +lw $t3, 16($s1) +sw $t3, -24($fp) +# local_reflect_0_at_Complex_internal_7 = GETATTRIBUTE y Complex +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +lw $t3, 16($s1) +sw $t3, -32($fp) +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +lw $t3, -32($fp) +not $t3, $t3 +sw $t3, -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) +# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# local_reflect_0_at_Complex_internal_4 = local_reflect_0_at_Complex_internal_5 - local_reflect_0_at_Complex_internal_6 +lw $t3, -24($fp) +lw $t4, -28($fp) +sub $t3, $t3, $t4 +sw $t3, -20($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_17 +# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_17 +lw $t3, -20($fp) +beq $t3, 0, label_TRUE_17 +# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) +# local_reflect_0_at_Complex_internal_4 = 0 +li $t3, 0 +sw $t3, -20($fp) +# GOTO label_END_18 +j label_END_18 +label_TRUE_17: + # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) + # local_reflect_0_at_Complex_internal_4 = 1 + li $t3, 1 + sw $t3, -20($fp) + label_END_18: +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# local_reflect_0_at_Complex_internal_8 = SELF +sw $s1, -36($fp) +# RETURN local_reflect_0_at_Complex_internal_8 +lw $v0, -36($fp) +# Deallocate stack frame for function function_reflect_0_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 44 +jr $ra +# Function END + + +# function_reflect_X_at_Complex implementation. +# @Params: +function_reflect_X_at_Complex: + # Allocate stack frame for function function_reflect_X_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_reflect_X_at_Complex_internal_1 = GETATTRIBUTE y Complex + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + lw $t3, 16($s1) + sw $t3, -8($fp) + # local_reflect_X_at_Complex_internal_3 = GETATTRIBUTE y Complex + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + lw $t3, 16($s1) + sw $t3, -16($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + lw $t3, -16($fp) + not $t3, $t3 + sw $t3, -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # local_reflect_X_at_Complex_internal_0 = local_reflect_X_at_Complex_internal_1 - local_reflect_X_at_Complex_internal_2 + lw $t3, -8($fp) + lw $t4, -12($fp) + sub $t3, $t3, $t4 + sw $t3, -4($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_19 + # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_19 + lw $t3, -4($fp) + beq $t3, 0, label_TRUE_19 + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # local_reflect_X_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + # GOTO label_END_20 +j label_END_20 +label_TRUE_19: + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # local_reflect_X_at_Complex_internal_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + label_END_20: +# LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) +# local_reflect_X_at_Complex_internal_4 = SELF +sw $s1, -20($fp) +# RETURN local_reflect_X_at_Complex_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_reflect_X_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +jr $ra +# Function END + + +# function_reflect_Y_at_Complex implementation. +# @Params: +function_reflect_Y_at_Complex: + # Allocate stack frame for function function_reflect_Y_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_reflect_Y_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + lw $t3, 12($s1) + sw $t3, -8($fp) + # local_reflect_Y_at_Complex_internal_3 = GETATTRIBUTE x Complex + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + lw $t3, 12($s1) + sw $t3, -16($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + lw $t3, -16($fp) + not $t3, $t3 + sw $t3, -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # local_reflect_Y_at_Complex_internal_0 = local_reflect_Y_at_Complex_internal_1 - local_reflect_Y_at_Complex_internal_2 + lw $t3, -8($fp) + lw $t4, -12($fp) + sub $t3, $t3, $t4 + sw $t3, -4($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_21 + # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_21 + lw $t3, -4($fp) + beq $t3, 0, label_TRUE_21 + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # local_reflect_Y_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + # GOTO label_END_22 +j label_END_22 +label_TRUE_21: + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # local_reflect_Y_at_Complex_internal_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + label_END_22: +# LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) +# local_reflect_Y_at_Complex_internal_4 = SELF +sw $s1, -20($fp) +# RETURN local_reflect_Y_at_Complex_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_reflect_Y_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +jr $ra +# Function END + + +# function_equal_at_Complex implementation. +# @Params: +# 0($fp) = param_equal_at_Complex_d_0 +function_equal_at_Complex: + # Allocate stack frame for function function_equal_at_Complex. + subu $sp, $sp, 48 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 48 + # local_equal_at_Complex_internal_2 = GETATTRIBUTE x Complex + # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) + lw $t3, 12($s1) + sw $t3, -12($fp) + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # PARAM param_equal_at_Complex_d_0 --> 0($fp) + # local_equal_at_Complex_internal_3 = PARAM param_equal_at_Complex_d_0 + lw $t3, 0($fp) + sw $t3, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # local_equal_at_Complex_internal_4 = VCALL local_equal_at_Complex_internal_3 x_value + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 52($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) + # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # local_equal_at_Complex_internal_1 = local_equal_at_Complex_internal_2 - local_equal_at_Complex_internal_4 + lw $t3, -12($fp) + lw $t4, -20($fp) + sub $t3, $t3, $t4 + sw $t3, -8($fp) + # IF_ZERO local_equal_at_Complex_internal_1 GOTO label_TRUE_25 + # IF_ZERO local_equal_at_Complex_internal_1 GOTO label_TRUE_25 + lw $t3, -8($fp) + beq $t3, 0, label_TRUE_25 + # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) + # local_equal_at_Complex_internal_1 = 0 + li $t3, 0 + sw $t3, -8($fp) + # GOTO label_END_26 +j label_END_26 +label_TRUE_25: + # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) + # local_equal_at_Complex_internal_1 = 1 + li $t3, 1 + sw $t3, -8($fp) + label_END_26: +# IF_ZERO local_equal_at_Complex_internal_1 GOTO label_FALSEIF_23 +# IF_ZERO local_equal_at_Complex_internal_1 GOTO label_FALSEIF_23 +lw $t3, -8($fp) +beq $t3, 0, label_FALSEIF_23 +# local_equal_at_Complex_internal_7 = GETATTRIBUTE y Complex +# LOCAL local_equal_at_Complex_internal_7 --> -32($fp) +lw $t3, 16($s1) +sw $t3, -32($fp) +# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) +# PARAM param_equal_at_Complex_d_0 --> 0($fp) +# local_equal_at_Complex_internal_8 = PARAM param_equal_at_Complex_d_0 +lw $t3, 0($fp) +sw $t3, -36($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) +# LOCAL local_equal_at_Complex_internal_9 --> -40($fp) +# local_equal_at_Complex_internal_9 = VCALL local_equal_at_Complex_internal_8 y_value +# Save new self pointer in $s1 +lw $s1, -36($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 56($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -40($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_equal_at_Complex_internal_6 --> -28($fp) +# LOCAL local_equal_at_Complex_internal_7 --> -32($fp) +# LOCAL local_equal_at_Complex_internal_9 --> -40($fp) +# local_equal_at_Complex_internal_6 = local_equal_at_Complex_internal_7 - local_equal_at_Complex_internal_9 +lw $t3, -32($fp) +lw $t4, -40($fp) +sub $t3, $t3, $t4 +sw $t3, -28($fp) +# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_TRUE_29 +# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_TRUE_29 +lw $t3, -28($fp) +beq $t3, 0, label_TRUE_29 +# LOCAL local_equal_at_Complex_internal_6 --> -28($fp) +# local_equal_at_Complex_internal_6 = 0 +li $t3, 0 +sw $t3, -28($fp) +# GOTO label_END_30 +j label_END_30 +label_TRUE_29: + # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) + # local_equal_at_Complex_internal_6 = 1 + li $t3, 1 + sw $t3, -28($fp) + label_END_30: +# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSEIF_27 +# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSEIF_27 +lw $t3, -28($fp) +beq $t3, 0, label_FALSEIF_27 +# LOCAL local_equal_at_Complex_internal_5 --> -24($fp) +# local_equal_at_Complex_internal_5 = 1 +li $t3, 1 +sw $t3, -24($fp) +# GOTO label_ENDIF_28 +j label_ENDIF_28 +label_FALSEIF_27: + # LOCAL local_equal_at_Complex_internal_5 --> -24($fp) + # local_equal_at_Complex_internal_5 = 0 + li $t3, 0 + sw $t3, -24($fp) + label_ENDIF_28: +# LOCAL local_equal_at_Complex_internal_0 --> -4($fp) +# LOCAL local_equal_at_Complex_internal_5 --> -24($fp) +# local_equal_at_Complex_internal_0 = local_equal_at_Complex_internal_5 +lw $t3, -24($fp) +sw $t3, -4($fp) +# GOTO label_ENDIF_24 +j label_ENDIF_24 +label_FALSEIF_23: + # LOCAL local_equal_at_Complex_internal_0 --> -4($fp) + # local_equal_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + label_ENDIF_24: +# RETURN local_equal_at_Complex_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_equal_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 48 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_x_value_at_Complex implementation. +# @Params: +function_x_value_at_Complex: + # Allocate stack frame for function function_x_value_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_x_value_at_Complex_internal_0 = GETATTRIBUTE x Complex + # LOCAL local_x_value_at_Complex_internal_0 --> -4($fp) + lw $t3, 12($s1) + sw $t3, -4($fp) + # RETURN local_x_value_at_Complex_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_x_value_at_Complex. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_y_value_at_Complex implementation. +# @Params: +function_y_value_at_Complex: + # Allocate stack frame for function function_y_value_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_y_value_at_Complex_internal_0 = GETATTRIBUTE y Complex + # LOCAL local_y_value_at_Complex_internal_0 --> -4($fp) + lw $t3, 16($s1) + sw $t3, -4($fp) + # RETURN local_y_value_at_Complex_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_y_value_at_Complex. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/codegen/palindrome.mips b/tests/codegen/palindrome.mips new file mode 100644 index 00000000..26386674 --- /dev/null +++ b/tests/codegen/palindrome.mips @@ -0,0 +1,1257 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:22 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_pal_at_Main, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +IO__TDT: .word 0, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, 0 +# + + +data_2: .asciiz "enter a string\n" +# + + +data_3: .asciiz "that was a palindrome\n" +# + + +data_4: .asciiz "that was not a palindrome\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + li $a0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) + move $t1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__i__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 32($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__i__init implementation. +# @Params: +__Main__attrib__i__init: + # Allocate stack frame for function __Main__attrib__i__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__i__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_pal_at_Main implementation. +# @Params: +# 0($fp) = param_pal_at_Main_s_0 +function_pal_at_Main: + # Allocate stack frame for function function_pal_at_Main. + subu $sp, $sp, 108 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 108 + # LOCAL local_pal_at_Main_internal_2 --> -12($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_2 = PARAM param_pal_at_Main_s_0 + lw $t1, 0($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_2 --> -12($fp) + # LOCAL local_pal_at_Main_internal_3 --> -16($fp) + # local_pal_at_Main_internal_3 = VCALL local_pal_at_Main_internal_2 length + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 8($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_1 --> -8($fp) + # LOCAL local_pal_at_Main_internal_3 --> -16($fp) + # local_pal_at_Main_internal_1 = local_pal_at_Main_internal_3 - 0 + lw $t1, -16($fp) + sub $t1, $t1, 0 + sw $t1, -8($fp) + # IF_ZERO local_pal_at_Main_internal_1 GOTO label_TRUE_3 + # IF_ZERO local_pal_at_Main_internal_1 GOTO label_TRUE_3 + lw $t1, -8($fp) + beq $t1, 0, label_TRUE_3 + # LOCAL local_pal_at_Main_internal_1 --> -8($fp) + # local_pal_at_Main_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # GOTO label_END_4 +j label_END_4 +label_TRUE_3: + # LOCAL local_pal_at_Main_internal_1 --> -8($fp) + # local_pal_at_Main_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + label_END_4: +# IF_ZERO local_pal_at_Main_internal_1 GOTO label_FALSEIF_1 +# IF_ZERO local_pal_at_Main_internal_1 GOTO label_FALSEIF_1 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_1 +# LOCAL local_pal_at_Main_internal_0 --> -4($fp) +# local_pal_at_Main_internal_0 = 1 +li $t1, 1 +sw $t1, -4($fp) +# GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_6 = PARAM param_pal_at_Main_s_0 + lw $t1, 0($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + # LOCAL local_pal_at_Main_internal_7 --> -32($fp) + # local_pal_at_Main_internal_7 = VCALL local_pal_at_Main_internal_6 length + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 8($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # LOCAL local_pal_at_Main_internal_7 --> -32($fp) + # local_pal_at_Main_internal_5 = local_pal_at_Main_internal_7 - 1 + lw $t1, -32($fp) + sub $t1, $t1, 1 + sw $t1, -24($fp) + # IF_ZERO local_pal_at_Main_internal_5 GOTO label_TRUE_7 + # IF_ZERO local_pal_at_Main_internal_5 GOTO label_TRUE_7 + lw $t1, -24($fp) + beq $t1, 0, label_TRUE_7 + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # local_pal_at_Main_internal_5 = 0 + li $t1, 0 + sw $t1, -24($fp) + # GOTO label_END_8 +j label_END_8 +label_TRUE_7: + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # local_pal_at_Main_internal_5 = 1 + li $t1, 1 + sw $t1, -24($fp) + label_END_8: +# IF_ZERO local_pal_at_Main_internal_5 GOTO label_FALSEIF_5 +# IF_ZERO local_pal_at_Main_internal_5 GOTO label_FALSEIF_5 +lw $t1, -24($fp) +beq $t1, 0, label_FALSEIF_5 +# LOCAL local_pal_at_Main_internal_4 --> -20($fp) +# local_pal_at_Main_internal_4 = 1 +li $t1, 1 +sw $t1, -20($fp) +# GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # LOCAL local_pal_at_Main_internal_10 --> -44($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_10 = PARAM param_pal_at_Main_s_0 + lw $t1, 0($fp) + sw $t1, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 0 + li $t1, 0 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # ARG 1 + li $t1, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_pal_at_Main_internal_10 --> -44($fp) + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # local_pal_at_Main_internal_11 = VCALL local_pal_at_Main_internal_10 substr + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 4($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_12 --> -52($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_12 = PARAM param_pal_at_Main_s_0 + lw $t1, 0($fp) + sw $t1, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_15 --> -64($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_15 = PARAM param_pal_at_Main_s_0 + lw $t1, 0($fp) + sw $t1, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_15 --> -64($fp) + # LOCAL local_pal_at_Main_internal_16 --> -68($fp) + # local_pal_at_Main_internal_16 = VCALL local_pal_at_Main_internal_15 length + # Save new self pointer in $s1 + lw $s1, -64($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 8($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_14 --> -60($fp) + # LOCAL local_pal_at_Main_internal_16 --> -68($fp) + # local_pal_at_Main_internal_14 = local_pal_at_Main_internal_16 - 1 + lw $t1, -68($fp) + sub $t1, $t1, 1 + sw $t1, -60($fp) + # ARG local_pal_at_Main_internal_14 + # LOCAL local_pal_at_Main_internal_14 --> -60($fp) + lw $t1, -60($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # ARG 1 + li $t1, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_pal_at_Main_internal_12 --> -52($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # local_pal_at_Main_internal_13 = VCALL local_pal_at_Main_internal_12 substr + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 4($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_9 --> -40($fp) + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # local_pal_at_Main_internal_9 = local_pal_at_Main_internal_11 - local_pal_at_Main_internal_13 + lw $t1, -48($fp) + lw $t2, -56($fp) + sub $t1, $t1, $t2 + sw $t1, -40($fp) + # IF_ZERO local_pal_at_Main_internal_9 GOTO label_TRUE_11 + # IF_ZERO local_pal_at_Main_internal_9 GOTO label_TRUE_11 + lw $t1, -40($fp) + beq $t1, 0, label_TRUE_11 + # LOCAL local_pal_at_Main_internal_9 --> -40($fp) + # local_pal_at_Main_internal_9 = 0 + li $t1, 0 + sw $t1, -40($fp) + # GOTO label_END_12 +j label_END_12 +label_TRUE_11: + # LOCAL local_pal_at_Main_internal_9 --> -40($fp) + # local_pal_at_Main_internal_9 = 1 + li $t1, 1 + sw $t1, -40($fp) + label_END_12: +# IF_ZERO local_pal_at_Main_internal_9 GOTO label_FALSEIF_9 +# IF_ZERO local_pal_at_Main_internal_9 GOTO label_FALSEIF_9 +lw $t1, -40($fp) +beq $t1, 0, label_FALSEIF_9 +# LOCAL local_pal_at_Main_internal_19 --> -80($fp) +# local_pal_at_Main_internal_19 = SELF +sw $s1, -80($fp) +# LOCAL local_pal_at_Main_internal_17 --> -72($fp) +# LOCAL local_pal_at_Main_internal_19 --> -80($fp) +# local_pal_at_Main_internal_17 = local_pal_at_Main_internal_19 +lw $t1, -80($fp) +sw $t1, -72($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_pal_at_Main_internal_20 --> -84($fp) +# PARAM param_pal_at_Main_s_0 --> 0($fp) +# local_pal_at_Main_internal_20 = PARAM param_pal_at_Main_s_0 +lw $t1, 0($fp) +sw $t1, -84($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG 1 +li $t1, 1 +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_pal_at_Main_internal_23 --> -96($fp) +# PARAM param_pal_at_Main_s_0 --> 0($fp) +# local_pal_at_Main_internal_23 = PARAM param_pal_at_Main_s_0 +lw $t1, 0($fp) +sw $t1, -96($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_pal_at_Main_internal_23 --> -96($fp) +# LOCAL local_pal_at_Main_internal_24 --> -100($fp) +# local_pal_at_Main_internal_24 = VCALL local_pal_at_Main_internal_23 length +# Save new self pointer in $s1 +lw $s1, -96($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 8($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -100($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_pal_at_Main_internal_22 --> -92($fp) +# LOCAL local_pal_at_Main_internal_24 --> -100($fp) +# local_pal_at_Main_internal_22 = local_pal_at_Main_internal_24 - 2 +lw $t1, -100($fp) +sub $t1, $t1, 2 +sw $t1, -92($fp) +# ARG local_pal_at_Main_internal_22 +# LOCAL local_pal_at_Main_internal_22 --> -92($fp) +lw $t1, -92($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_pal_at_Main_internal_20 --> -84($fp) +# LOCAL local_pal_at_Main_internal_21 --> -88($fp) +# local_pal_at_Main_internal_21 = VCALL local_pal_at_Main_internal_20 substr +# Save new self pointer in $s1 +lw $s1, -84($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 4($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -88($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_pal_at_Main_internal_21 +# LOCAL local_pal_at_Main_internal_21 --> -88($fp) +lw $t1, -88($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_pal_at_Main_internal_17 --> -72($fp) +# LOCAL local_pal_at_Main_internal_18 --> -76($fp) +# local_pal_at_Main_internal_18 = VCALL local_pal_at_Main_internal_17 pal +# Save new self pointer in $s1 +lw $s1, -72($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 28($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -76($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_pal_at_Main_internal_8 --> -36($fp) +# LOCAL local_pal_at_Main_internal_18 --> -76($fp) +# local_pal_at_Main_internal_8 = local_pal_at_Main_internal_18 +lw $t1, -76($fp) +sw $t1, -36($fp) +# GOTO label_ENDIF_10 +j label_ENDIF_10 +label_FALSEIF_9: + # LOCAL local_pal_at_Main_internal_8 --> -36($fp) + # local_pal_at_Main_internal_8 = 0 + li $t1, 0 + sw $t1, -36($fp) + label_ENDIF_10: +# LOCAL local_pal_at_Main_internal_4 --> -20($fp) +# LOCAL local_pal_at_Main_internal_8 --> -36($fp) +# local_pal_at_Main_internal_4 = local_pal_at_Main_internal_8 +lw $t1, -36($fp) +sw $t1, -20($fp) +label_ENDIF_6: +# LOCAL local_pal_at_Main_internal_0 --> -4($fp) +# LOCAL local_pal_at_Main_internal_4 --> -20($fp) +# local_pal_at_Main_internal_0 = local_pal_at_Main_internal_4 +lw $t1, -20($fp) +sw $t1, -4($fp) +label_ENDIF_2: +# RETURN local_pal_at_Main_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_pal_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 108 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + lw $t1, 1 + not $t1, $t1 + sw $t1, -4($fp) + # + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + lw $t1, -4($fp) + sw $t1, 12($s1) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t1, -16($fp) + sw $t1, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_2 + sw $t1, 12($v0) + li $t1, 16 + sw $t1, 16($v0) + sw $v0, -20($fp) + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t1, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 out_string + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 + lw $t1, -36($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 + lw $t1, -48($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 in_string + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 20($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_10 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + lw $t1, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 pal + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 28($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # IF_ZERO local_main_at_Main_internal_7 GOTO label_FALSEIF_13 + # IF_ZERO local_main_at_Main_internal_7 GOTO label_FALSEIF_13 + lw $t1, -32($fp) + beq $t1, 0, label_FALSEIF_13 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 + lw $t1, -60($fp) + sw $t1, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_3 + sw $t1, 12($v0) + li $t1, 23 + sw $t1, 16($v0) + sw $v0, -64($fp) + # ARG local_main_at_Main_internal_15 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + lw $t1, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_5 = local_main_at_Main_internal_13 + lw $t1, -56($fp) + sw $t1, -24($fp) + # GOTO label_ENDIF_14 +j label_ENDIF_14 +label_FALSEIF_13: + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 + lw $t1, -76($fp) + sw $t1, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_4 + sw $t1, 12($v0) + li $t1, 27 + sw $t1, 16($v0) + sw $v0, -80($fp) + # ARG local_main_at_Main_internal_19 + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + lw $t1, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_5 = local_main_at_Main_internal_17 + lw $t1, -72($fp) + sw $t1, -24($fp) + label_ENDIF_14: +# RETURN local_main_at_Main_internal_5 +lw $v0, -24($fp) +# Deallocate stack frame for function function_main_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +jr $ra +# Function END + diff --git a/tests/codegen/print-cool.mips b/tests/codegen/print-cool.mips index e2059448..6590c059 100644 --- a/tests/codegen/print-cool.mips +++ b/tests/codegen/print-cool.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 17:36:45 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:19 2020 # School of Math and Computer Science, University of Havana # @@ -120,17 +120,52 @@ function_in_string_at_IO: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END # function_out_int_at_IO implementation. @@ -294,7 +329,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self From 810044c6f454488b6a649c7b6806eb5a48c3d04a Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sun, 6 Dec 2020 01:20:33 -0500 Subject: [PATCH 148/162] Fix attributes having access to previous defined attributes --- src/cil/baseCilVisitor.py | 4 + src/testing.mips | 1828 ++++++++++---------------------- src/testing.py | 88 +- src/travels/ciltomips.py | 27 +- src/travels/ctcill.py | 20 +- tests/codegen/atoi.mips | 71 +- tests/codegen/book_list.mips | 128 ++- tests/codegen/complex.mips | 33 +- tests/codegen/fib.mips | 19 +- tests/codegen/hello_world.mips | 17 +- tests/codegen/io.mips | 60 +- tests/codegen/life.mips | 452 +++++--- tests/codegen/list.mips | 47 +- tests/codegen/new_complex.mips | 70 +- tests/codegen/palindrome.mips | 318 +++--- tests/codegen/primes.mips | 1282 ++++++++++++++++++++++ tests/codegen/print-cool.mips | 28 +- 17 files changed, 2716 insertions(+), 1776 deletions(-) create mode 100644 tests/codegen/primes.mips diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 91cfa05f..082a38c5 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -349,6 +349,10 @@ def build_builtins(self): bool_.methods.append(("type_name", "function_type_name_at_Object")) bool_.methods.append(("copy", "function_copy_at_Object")) + + str_.methods.append(("abort", "function_abort_at_Object")) + str_.methods.append(("type_name", "function_type_name_at_Object")) + str_.methods.append(("copy", "function_copy_at_Object")) str_.methods.append(("concat", "function_concat_at_String")) str_.methods.append(("substr", "function_substr_at_String")) str_.methods.append(("length", "function_length_at_String")) diff --git a/src/testing.mips b/src/testing.mips index f1760b70..fd481efe 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:11 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 01:07:40 2020 # School of Math and Computer Science, University of Havana # @@ -15,8 +15,6 @@ Bool: .asciiz "Bool" # Function END Main: .asciiz "Main" # Function END -Complex: .asciiz "Complex" -# Function END # @@ -49,7 +47,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String # Function END # @@ -77,7 +75,7 @@ Bool_end: # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_pal_at_Main, function_main_at_Main # Function END # @@ -90,54 +88,27 @@ Main_end: # -# **** VTABLE for type Complex **** -Complex_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Complex, function_print_at_Complex, function_reflect_0_at_Complex, function_reflect_X_at_Complex, function_reflect_Y_at_Complex, function_equal_at_Complex, function_x_value_at_Complex, function_y_value_at_Complex -# Function END -# - - -# **** Type RECORD for type Complex **** -Complex_start: - Complex_vtable_pointer: .word Complex_vtable - # Function END -Complex_end: -# - - data_0: .asciiz "" # -IO__TDT: .word 0, -1, -1, -1, 1, 1 -Object__TDT: .word 1, 0, 1, 1, 2, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1 -Main__TDT: .word -1, -1, -1, -1, 0, -1 -Complex__TDT: .word -1, -1, -1, -1, -1, 0 -# - - -data_2: .asciiz "=)\n" -# - - -data_3: .asciiz "=(\n" +IO__TDT: .word 0, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, 0 # -data_4: .asciiz "=)\n" +data_2: .asciiz "enter a string\n" # -data_5: .asciiz "=(\n" +data_3: .asciiz "that was a palindrome\n" # -data_6: .asciiz "+" -# - - -data_7: .asciiz "I" +data_4: .asciiz "that was not a palindrome\n" # @@ -177,6 +148,9 @@ function_in_string_at_IO: addu $t2, $t2, 1 j read_length_loop end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -366,7 +340,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -381,7 +355,7 @@ function_concat_at_String: lw $t0, 12($s1) # Get second string from param lw $t1, 12($v0) - addu $a0, $a0, 1 + addu $a0, $a0, 4 li $v0, 9 syscall move $t2, $v0 @@ -556,8 +530,8 @@ entry: li $t2, 4 sw $t2, 16($v0) move $t2, $v0 - # Allocating 12 bytes of memory - li $a0, 12 + # Allocating 16 bytes of memory + li $a0, 16 li $v0, 9 syscall sw $t2, 0($v0) @@ -567,6 +541,21 @@ entry: li $t2, 16 sw $t2, 8($v0) move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__i__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) @@ -578,7 +567,7 @@ entry: # Get pointer to type's VTABLE la $t1, Main_vtable # Get pointer to function address - lw $t2, 28($t1) + lw $t2, 32($t1) # Call function. Result is on $v0 jalr $t2 sw $v0, -8($fp) @@ -595,1415 +584,700 @@ entry: # Function END -# function_main_at_Main implementation. +# __Main__attrib__i__init implementation. # @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 148 +__Main__attrib__i__init: + # Allocate stack frame for function __Main__attrib__i__init. + subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 148 - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_c_0 = ALLOCATE Complex - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Complex - sw $t3, 12($v0) - li $t3, 7 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Complex_start - sw $t3, 4($v0) - # Load type offset - li $t3, 20 - sw $t3, 8($v0) - move $t2, $v0 - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Complex__attrib__x__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t2) - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Complex__attrib__y__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t2) - sw $t2, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = ALLOCATE Complex - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Complex - sw $t4, 12($v0) - li $t4, 7 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, Complex_start - sw $t4, 4($v0) - # Load type offset - li $t4, 20 - sw $t4, 8($v0) - move $t3, $v0 - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Complex__attrib__x__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t3) - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Complex__attrib__y__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t3) - sw $t3, -16($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t3, -16($fp) - sw $t3, -8($fp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__i__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_pal_at_Main implementation. +# @Params: +# 0($fp) = param_pal_at_Main_s_0 +function_pal_at_Main: + # Allocate stack frame for function function_pal_at_Main. + subu $sp, $sp, 120 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 120 + # LOCAL local_pal_at_Main_internal_2 --> -12($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_2 = PARAM param_pal_at_Main_s_0 + lw $t1, 0($fp) + sw $t1, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # ARG 1 - li $t3, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # ARG 1 - li $t3, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init + # LOCAL local_pal_at_Main_internal_2 --> -12($fp) + # LOCAL local_pal_at_Main_internal_3 --> -16($fp) + # local_pal_at_Main_internal_3 = VCALL local_pal_at_Main_internal_2 length # Save new self pointer in $s1 - lw $s1, -8($fp) + lw $s1, -12($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 28($t4) + lw $t3, 20($t2) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -12($fp) + jalr $t3 + sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_c_0 = local_main_at_Main_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_c_0 - lw $t3, -4($fp) - sw $t3, -28($fp) + # LOCAL local_pal_at_Main_internal_1 --> -8($fp) + # LOCAL local_pal_at_Main_internal_3 --> -16($fp) + # local_pal_at_Main_internal_1 = local_pal_at_Main_internal_3 - 0 + lw $t1, -16($fp) + sub $t1, $t1, 0 + sw $t1, -8($fp) + # IF_ZERO local_pal_at_Main_internal_1 GOTO label_TRUE_3 + # IF_ZERO local_pal_at_Main_internal_1 GOTO label_TRUE_3 + lw $t1, -8($fp) + beq $t1, 0, label_TRUE_3 + # LOCAL local_pal_at_Main_internal_1 --> -8($fp) + # local_pal_at_Main_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # GOTO label_END_4 +j label_END_4 +label_TRUE_3: + # LOCAL local_pal_at_Main_internal_1 --> -8($fp) + # local_pal_at_Main_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + label_END_4: +# IF_ZERO local_pal_at_Main_internal_1 GOTO label_FALSEIF_1 +# IF_ZERO local_pal_at_Main_internal_1 GOTO label_FALSEIF_1 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_1 +# LOCAL local_pal_at_Main_internal_4 --> -20($fp) +# local_pal_at_Main_internal_4 = 1 +li $t1, 1 +sw $t1, -20($fp) +# LOCAL local_pal_at_Main_internal_0 --> -4($fp) +# LOCAL local_pal_at_Main_internal_4 --> -20($fp) +# local_pal_at_Main_internal_0 = local_pal_at_Main_internal_4 +lw $t1, -20($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_pal_at_Main_internal_7 --> -32($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_7 = PARAM param_pal_at_Main_s_0 + lw $t1, 0($fp) + sw $t1, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 reflect_X + # LOCAL local_pal_at_Main_internal_7 --> -32($fp) + # LOCAL local_pal_at_Main_internal_8 --> -36($fp) + # local_pal_at_Main_internal_8 = VCALL local_pal_at_Main_internal_7 length # Save new self pointer in $s1 - lw $s1, -28($fp) + lw $s1, -32($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 40($t4) + lw $t3, 20($t2) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -32($fp) + jalr $t3 + sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_internal_8 = local_main_at_Main_c_0 - lw $t3, -4($fp) - sw $t3, -36($fp) + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + # LOCAL local_pal_at_Main_internal_8 --> -36($fp) + # local_pal_at_Main_internal_6 = local_pal_at_Main_internal_8 - 1 + lw $t1, -36($fp) + sub $t1, $t1, 1 + sw $t1, -28($fp) + # IF_ZERO local_pal_at_Main_internal_6 GOTO label_TRUE_7 + # IF_ZERO local_pal_at_Main_internal_6 GOTO label_TRUE_7 + lw $t1, -28($fp) + beq $t1, 0, label_TRUE_7 + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + # local_pal_at_Main_internal_6 = 0 + li $t1, 0 + sw $t1, -28($fp) + # GOTO label_END_8 +j label_END_8 +label_TRUE_7: + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + # local_pal_at_Main_internal_6 = 1 + li $t1, 1 + sw $t1, -28($fp) + label_END_8: +# IF_ZERO local_pal_at_Main_internal_6 GOTO label_FALSEIF_5 +# IF_ZERO local_pal_at_Main_internal_6 GOTO label_FALSEIF_5 +lw $t1, -28($fp) +beq $t1, 0, label_FALSEIF_5 +# LOCAL local_pal_at_Main_internal_9 --> -40($fp) +# local_pal_at_Main_internal_9 = 1 +li $t1, 1 +sw $t1, -40($fp) +# LOCAL local_pal_at_Main_internal_5 --> -24($fp) +# LOCAL local_pal_at_Main_internal_9 --> -40($fp) +# local_pal_at_Main_internal_5 = local_pal_at_Main_internal_9 +lw $t1, -40($fp) +sw $t1, -24($fp) +# GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # LOCAL local_pal_at_Main_internal_12 --> -52($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_12 = PARAM param_pal_at_Main_s_0 + lw $t1, 0($fp) + sw $t1, -52($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 reflect_0 + # ARG 0 + li $t1, 0 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # ARG 1 + li $t1, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_pal_at_Main_internal_12 --> -52($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # local_pal_at_Main_internal_13 = VCALL local_pal_at_Main_internal_12 substr # Save new self pointer in $s1 - lw $s1, -36($fp) + lw $s1, -52($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 36($t4) + lw $t3, 16($t2) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -40($fp) + jalr $t3 + sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_5 = local_main_at_Main_internal_7 - local_main_at_Main_internal_9 - lw $t3, -32($fp) - lw $t4, -40($fp) - sub $t3, $t3, $t4 - sw $t3, -24($fp) - # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_3 - # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_3 - lw $t3, -24($fp) - beq $t3, 0, label_TRUE_3 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = 0 - li $t3, 0 - sw $t3, -24($fp) - # GOTO label_END_4 -j label_END_4 -label_TRUE_3: - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = 1 - li $t3, 1 - sw $t3, -24($fp) - label_END_4: -# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_1 -# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_1 -lw $t3, -24($fp) -beq $t3, 0, label_FALSEIF_1 -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# local_main_at_Main_internal_12 = SELF -sw $s1, -52($fp) -# LOCAL local_main_at_Main_internal_10 --> -44($fp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# local_main_at_Main_internal_10 = local_main_at_Main_internal_12 -lw $t3, -52($fp) -sw $t3, -44($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t3, String -sw $t3, 0($v0) -la $t3, String_start -sw $t3, 4($v0) -# Load type offset -li $t3, 8 -sw $t3, 8($v0) -la $t3, data_2 -sw $t3, 12($v0) -li $t3, 4 -sw $t3, 16($v0) -sw $v0, -56($fp) -# ARG local_main_at_Main_internal_13 -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -lw $t3, -56($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_main_at_Main_internal_10 --> -44($fp) -# LOCAL local_main_at_Main_internal_11 --> -48($fp) -# local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 out_string -# Save new self pointer in $s1 -lw $s1, -44($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 12($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -48($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_4 --> -20($fp) -# LOCAL local_main_at_Main_internal_11 --> -48($fp) -# local_main_at_Main_internal_4 = local_main_at_Main_internal_11 -lw $t3, -48($fp) -sw $t3, -20($fp) -# GOTO label_ENDIF_2 -j label_ENDIF_2 -label_FALSEIF_1: - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_16 = SELF - sw $s1, -68($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_14 = local_main_at_Main_internal_16 - lw $t3, -68($fp) - sw $t3, -60($fp) + # LOCAL local_pal_at_Main_internal_14 --> -60($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_14 = PARAM param_pal_at_Main_s_0 + lw $t1, 0($fp) + sw $t1, -60($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_3 - sw $t3, 12($v0) - li $t3, 4 - sw $t3, 16($v0) - sw $v0, -72($fp) - # ARG local_main_at_Main_internal_17 - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - lw $t3, -72($fp) + # LOCAL local_pal_at_Main_internal_17 --> -72($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_17 = PARAM param_pal_at_Main_s_0 + lw $t1, 0($fp) + sw $t1, -72($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_17 --> -72($fp) + # LOCAL local_pal_at_Main_internal_18 --> -76($fp) + # local_pal_at_Main_internal_18 = VCALL local_pal_at_Main_internal_17 length + # Save new self pointer in $s1 + lw $s1, -72($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 20($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -76($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_16 --> -68($fp) + # LOCAL local_pal_at_Main_internal_18 --> -76($fp) + # local_pal_at_Main_internal_16 = local_pal_at_Main_internal_18 - 1 + lw $t1, -76($fp) + sub $t1, $t1, 1 + sw $t1, -68($fp) + # ARG local_pal_at_Main_internal_16 + # LOCAL local_pal_at_Main_internal_16 --> -68($fp) + lw $t1, -68($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 out_string + sw $t1, 0($sp) + # ARG 1 + li $t1, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_pal_at_Main_internal_14 --> -60($fp) + # LOCAL local_pal_at_Main_internal_15 --> -64($fp) + # local_pal_at_Main_internal_15 = VCALL local_pal_at_Main_internal_14 substr # Save new self pointer in $s1 lw $s1, -60($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 12($t4) + lw $t3, 16($t2) # Call function. Result is on $v0 - jalr $t5 + jalr $t3 sw $v0, -64($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_4 = local_main_at_Main_internal_15 - lw $t3, -64($fp) - sw $t3, -20($fp) - label_ENDIF_2: -# LOCAL local_main_at_Main_internal_23 --> -96($fp) -# LOCAL local_main_at_Main_c_0 --> -4($fp) -# local_main_at_Main_internal_23 = local_main_at_Main_c_0 -lw $t3, -4($fp) -sw $t3, -96($fp) + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # LOCAL local_pal_at_Main_internal_15 --> -64($fp) + # local_pal_at_Main_internal_11 = local_pal_at_Main_internal_13 - local_pal_at_Main_internal_15 + lw $t1, -56($fp) + lw $t2, -64($fp) + sub $t1, $t1, $t2 + sw $t1, -48($fp) + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_11 + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_11 + lw $t1, -48($fp) + beq $t1, 0, label_TRUE_11 + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # local_pal_at_Main_internal_11 = 0 + li $t1, 0 + sw $t1, -48($fp) + # GOTO label_END_12 +j label_END_12 +label_TRUE_11: + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # local_pal_at_Main_internal_11 = 1 + li $t1, 1 + sw $t1, -48($fp) + label_END_12: +# IF_ZERO local_pal_at_Main_internal_11 GOTO label_FALSEIF_9 +# IF_ZERO local_pal_at_Main_internal_11 GOTO label_FALSEIF_9 +lw $t1, -48($fp) +beq $t1, 0, label_FALSEIF_9 +# LOCAL local_pal_at_Main_internal_21 --> -88($fp) +# local_pal_at_Main_internal_21 = SELF +sw $s1, -88($fp) +# LOCAL local_pal_at_Main_internal_19 --> -80($fp) +# LOCAL local_pal_at_Main_internal_21 --> -88($fp) +# local_pal_at_Main_internal_19 = local_pal_at_Main_internal_21 +lw $t1, -88($fp) +sw $t1, -80($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_23 --> -96($fp) -# LOCAL local_main_at_Main_internal_24 --> -100($fp) -# local_main_at_Main_internal_24 = VCALL local_main_at_Main_internal_23 reflect_X -# Save new self pointer in $s1 -lw $s1, -96($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 40($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -100($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_21 --> -88($fp) -# LOCAL local_main_at_Main_internal_24 --> -100($fp) -# local_main_at_Main_internal_21 = local_main_at_Main_internal_24 -lw $t3, -100($fp) -sw $t3, -88($fp) +# LOCAL local_pal_at_Main_internal_22 --> -92($fp) +# PARAM param_pal_at_Main_s_0 --> 0($fp) +# local_pal_at_Main_internal_22 = PARAM param_pal_at_Main_s_0 +lw $t1, 0($fp) +sw $t1, -92($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_21 --> -88($fp) -# LOCAL local_main_at_Main_internal_22 --> -92($fp) -# local_main_at_Main_internal_22 = VCALL local_main_at_Main_internal_21 reflect_Y -# Save new self pointer in $s1 -lw $s1, -88($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 44($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -92($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# LOCAL local_main_at_Main_internal_22 --> -92($fp) -# local_main_at_Main_internal_19 = local_main_at_Main_internal_22 -lw $t3, -92($fp) -sw $t3, -80($fp) -# Push register s1 into stack +# ARG 1 +li $t1, 1 +# Push arg into stack subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_25 --> -104($fp) -# LOCAL local_main_at_Main_c_0 --> -4($fp) -# local_main_at_Main_internal_25 = local_main_at_Main_c_0 -lw $t3, -4($fp) -sw $t3, -104($fp) +sw $t1, 0($sp) +# LOCAL local_pal_at_Main_internal_25 --> -104($fp) +# PARAM param_pal_at_Main_s_0 --> 0($fp) +# local_pal_at_Main_internal_25 = PARAM param_pal_at_Main_s_0 +lw $t1, 0($fp) +sw $t1, -104($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_25 --> -104($fp) -# LOCAL local_main_at_Main_internal_26 --> -108($fp) -# local_main_at_Main_internal_26 = VCALL local_main_at_Main_internal_25 reflect_0 +# LOCAL local_pal_at_Main_internal_25 --> -104($fp) +# LOCAL local_pal_at_Main_internal_26 --> -108($fp) +# local_pal_at_Main_internal_26 = VCALL local_pal_at_Main_internal_25 length # Save new self pointer in $s1 lw $s1, -104($fp) # Get pointer to type -lw $t3, 4($s1) +lw $t1, 4($s1) # Get pointer to type's VTABLE -lw $t4, 0($t3) +lw $t2, 0($t1) # Get pointer to function address -lw $t5, 36($t4) +lw $t3, 20($t2) # Call function. Result is on $v0 -jalr $t5 +jalr $t3 sw $v0, -108($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_26 -# LOCAL local_main_at_Main_internal_26 --> -108($fp) -lw $t3, -108($fp) +# LOCAL local_pal_at_Main_internal_24 --> -100($fp) +# LOCAL local_pal_at_Main_internal_26 --> -108($fp) +# local_pal_at_Main_internal_24 = local_pal_at_Main_internal_26 - 2 +lw $t1, -108($fp) +sub $t1, $t1, 2 +sw $t1, -100($fp) +# ARG local_pal_at_Main_internal_24 +# LOCAL local_pal_at_Main_internal_24 --> -100($fp) +lw $t1, -100($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# LOCAL local_main_at_Main_internal_20 --> -84($fp) -# local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 equal +sw $t1, 0($sp) +# LOCAL local_pal_at_Main_internal_22 --> -92($fp) +# LOCAL local_pal_at_Main_internal_23 --> -96($fp) +# local_pal_at_Main_internal_23 = VCALL local_pal_at_Main_internal_22 substr # Save new self pointer in $s1 -lw $s1, -80($fp) +lw $s1, -92($fp) # Get pointer to type -lw $t3, 4($s1) +lw $t1, 4($s1) # Get pointer to type's VTABLE -lw $t4, 0($t3) +lw $t2, 0($t1) # Get pointer to function address -lw $t5, 48($t4) +lw $t3, 16($t2) # Call function. Result is on $v0 -jalr $t5 -sw $v0, -84($fp) +jalr $t3 +sw $v0, -96($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# IF_ZERO local_main_at_Main_internal_20 GOTO label_FALSEIF_5 -# IF_ZERO local_main_at_Main_internal_20 GOTO label_FALSEIF_5 -lw $t3, -84($fp) -beq $t3, 0, label_FALSEIF_5 -# LOCAL local_main_at_Main_internal_29 --> -120($fp) -# local_main_at_Main_internal_29 = SELF -sw $s1, -120($fp) -# LOCAL local_main_at_Main_internal_27 --> -112($fp) -# LOCAL local_main_at_Main_internal_29 --> -120($fp) -# local_main_at_Main_internal_27 = local_main_at_Main_internal_29 -lw $t3, -120($fp) -sw $t3, -112($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_30 --> -124($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t3, String -sw $t3, 0($v0) -la $t3, String_start -sw $t3, 4($v0) -# Load type offset -li $t3, 8 -sw $t3, 8($v0) -la $t3, data_4 -sw $t3, 12($v0) -li $t3, 4 -sw $t3, 16($v0) -sw $v0, -124($fp) -# ARG local_main_at_Main_internal_30 -# LOCAL local_main_at_Main_internal_30 --> -124($fp) -lw $t3, -124($fp) +# ARG local_pal_at_Main_internal_23 +# LOCAL local_pal_at_Main_internal_23 --> -96($fp) +lw $t1, -96($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_main_at_Main_internal_27 --> -112($fp) -# LOCAL local_main_at_Main_internal_28 --> -116($fp) -# local_main_at_Main_internal_28 = VCALL local_main_at_Main_internal_27 out_string +sw $t1, 0($sp) +# LOCAL local_pal_at_Main_internal_19 --> -80($fp) +# LOCAL local_pal_at_Main_internal_20 --> -84($fp) +# local_pal_at_Main_internal_20 = VCALL local_pal_at_Main_internal_19 pal # Save new self pointer in $s1 -lw $s1, -112($fp) +lw $s1, -80($fp) # Get pointer to type -lw $t3, 4($s1) +lw $t1, 4($s1) # Get pointer to type's VTABLE -lw $t4, 0($t3) +lw $t2, 0($t1) # Get pointer to function address -lw $t5, 12($t4) +lw $t3, 28($t2) # Call function. Result is on $v0 -jalr $t5 -sw $v0, -116($fp) +jalr $t3 +sw $v0, -84($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# LOCAL local_main_at_Main_internal_28 --> -116($fp) -# local_main_at_Main_internal_18 = local_main_at_Main_internal_28 -lw $t3, -116($fp) -sw $t3, -76($fp) -# GOTO label_ENDIF_6 -j label_ENDIF_6 -label_FALSEIF_5: - # LOCAL local_main_at_Main_internal_33 --> -136($fp) - # local_main_at_Main_internal_33 = SELF - sw $s1, -136($fp) - # LOCAL local_main_at_Main_internal_31 --> -128($fp) - # LOCAL local_main_at_Main_internal_33 --> -136($fp) - # local_main_at_Main_internal_31 = local_main_at_Main_internal_33 - lw $t3, -136($fp) - sw $t3, -128($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_34 --> -140($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_5 - sw $t3, 12($v0) - li $t3, 4 - sw $t3, 16($v0) - sw $v0, -140($fp) - # ARG local_main_at_Main_internal_34 - # LOCAL local_main_at_Main_internal_34 --> -140($fp) - lw $t3, -140($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_31 --> -128($fp) - # LOCAL local_main_at_Main_internal_32 --> -132($fp) - # local_main_at_Main_internal_32 = VCALL local_main_at_Main_internal_31 out_string - # Save new self pointer in $s1 - lw $s1, -128($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 12($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -132($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_32 --> -132($fp) - # local_main_at_Main_internal_18 = local_main_at_Main_internal_32 - lw $t3, -132($fp) - sw $t3, -76($fp) - label_ENDIF_6: -# RETURN local_main_at_Main_internal_18 -lw $v0, -76($fp) -# Deallocate stack frame for function function_main_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 148 -jr $ra -# Function END - - -# __Complex__attrib__x__init implementation. -# @Params: -__Complex__attrib__x__init: - # Allocate stack frame for function __Complex__attrib__x__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Complex__attrib__x__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Complex__attrib__y__init implementation. -# @Params: -__Complex__attrib__y__init: - # Allocate stack frame for function __Complex__attrib__y__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Complex__attrib__y__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_Complex implementation. -# @Params: -# 0($fp) = param_init_at_Complex_a_0 -# 4($fp) = param_init_at_Complex_b_1 -function_init_at_Complex: - # Allocate stack frame for function function_init_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_init_at_Complex_internal_1 = GETATTRIBUTE x Complex - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - lw $t3, 12($s1) - sw $t3, -8($fp) - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - # PARAM param_init_at_Complex_a_0 --> 4($fp) - # local_init_at_Complex_internal_0 = local_init_at_Complex_internal_1 - PARAM param_init_at_Complex_a_0 - lw $t3, -8($fp) - lw $t4, 4($fp) - sub $t3, $t3, $t4 - sw $t3, -4($fp) - # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_7 - # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_7 - lw $t3, -4($fp) - beq $t3, 0, label_TRUE_7 - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # local_init_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - # GOTO label_END_8 -j label_END_8 -label_TRUE_7: - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # local_init_at_Complex_internal_0 = 1 - li $t3, 1 - sw $t3, -4($fp) - label_END_8: -# local_init_at_Complex_internal_3 = GETATTRIBUTE y Complex -# LOCAL local_init_at_Complex_internal_3 --> -16($fp) -lw $t3, 16($s1) -sw $t3, -16($fp) -# LOCAL local_init_at_Complex_internal_2 --> -12($fp) -# LOCAL local_init_at_Complex_internal_3 --> -16($fp) -# PARAM param_init_at_Complex_b_1 --> 0($fp) -# local_init_at_Complex_internal_2 = local_init_at_Complex_internal_3 - PARAM param_init_at_Complex_b_1 -lw $t3, -16($fp) -lw $t4, 0($fp) -sub $t3, $t3, $t4 -sw $t3, -12($fp) -# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_9 -# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_9 -lw $t3, -12($fp) -beq $t3, 0, label_TRUE_9 -# LOCAL local_init_at_Complex_internal_2 --> -12($fp) -# local_init_at_Complex_internal_2 = 0 -li $t3, 0 -sw $t3, -12($fp) -# GOTO label_END_10 -j label_END_10 -label_TRUE_9: - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # local_init_at_Complex_internal_2 = 1 - li $t3, 1 - sw $t3, -12($fp) - label_END_10: -# LOCAL local_init_at_Complex_internal_4 --> -20($fp) -# local_init_at_Complex_internal_4 = SELF -sw $s1, -20($fp) -# RETURN local_init_at_Complex_internal_4 -lw $v0, -20($fp) -# Deallocate stack frame for function function_init_at_Complex. +# LOCAL local_pal_at_Main_internal_10 --> -44($fp) +# LOCAL local_pal_at_Main_internal_20 --> -84($fp) +# local_pal_at_Main_internal_10 = local_pal_at_Main_internal_20 +lw $t1, -84($fp) +sw $t1, -44($fp) +# GOTO label_ENDIF_10 +j label_ENDIF_10 +label_FALSEIF_9: + # LOCAL local_pal_at_Main_internal_27 --> -112($fp) + # local_pal_at_Main_internal_27 = 0 + li $t1, 0 + sw $t1, -112($fp) + # LOCAL local_pal_at_Main_internal_10 --> -44($fp) + # LOCAL local_pal_at_Main_internal_27 --> -112($fp) + # local_pal_at_Main_internal_10 = local_pal_at_Main_internal_27 + lw $t1, -112($fp) + sw $t1, -44($fp) + label_ENDIF_10: +# LOCAL local_pal_at_Main_internal_5 --> -24($fp) +# LOCAL local_pal_at_Main_internal_10 --> -44($fp) +# local_pal_at_Main_internal_5 = local_pal_at_Main_internal_10 +lw $t1, -44($fp) +sw $t1, -24($fp) +label_ENDIF_6: +# LOCAL local_pal_at_Main_internal_0 --> -4($fp) +# LOCAL local_pal_at_Main_internal_5 --> -24($fp) +# local_pal_at_Main_internal_0 = local_pal_at_Main_internal_5 +lw $t1, -24($fp) +sw $t1, -4($fp) +label_ENDIF_2: +# RETURN local_pal_at_Main_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_pal_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 32 +addu $sp, $sp, 120 # Deallocate function args -addu $sp, $sp, 8 +addu $sp, $sp, 4 jr $ra # Function END -# function_print_at_Complex implementation. +# function_main_at_Main implementation. # @Params: -function_print_at_Complex: - # Allocate stack frame for function function_print_at_Complex. +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. subu $sp, $sp, 88 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 88 - # local_print_at_Complex_internal_2 = GETATTRIBUTE y Complex - # LOCAL local_print_at_Complex_internal_2 --> -12($fp) - lw $t3, 16($s1) - sw $t3, -12($fp) - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # LOCAL local_print_at_Complex_internal_2 --> -12($fp) - # local_print_at_Complex_internal_1 = local_print_at_Complex_internal_2 - 0 - lw $t3, -12($fp) - sub $t3, $t3, 0 - sw $t3, -8($fp) - # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_13 - # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_13 - lw $t3, -8($fp) - beq $t3, 0, label_TRUE_13 - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # local_print_at_Complex_internal_1 = 0 - li $t3, 0 - sw $t3, -8($fp) - # GOTO label_END_14 -j label_END_14 -label_TRUE_13: - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # local_print_at_Complex_internal_1 = 1 - li $t3, 1 - sw $t3, -8($fp) - label_END_14: -# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_11 -# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_11 -lw $t3, -8($fp) -beq $t3, 0, label_FALSEIF_11 -# LOCAL local_print_at_Complex_internal_5 --> -24($fp) -# local_print_at_Complex_internal_5 = SELF -sw $s1, -24($fp) -# LOCAL local_print_at_Complex_internal_3 --> -16($fp) -# LOCAL local_print_at_Complex_internal_5 --> -24($fp) -# local_print_at_Complex_internal_3 = local_print_at_Complex_internal_5 -lw $t3, -24($fp) -sw $t3, -16($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_print_at_Complex_internal_6 = GETATTRIBUTE x Complex -# LOCAL local_print_at_Complex_internal_6 --> -28($fp) -lw $t3, 12($s1) -sw $t3, -28($fp) -# ARG local_print_at_Complex_internal_6 -# LOCAL local_print_at_Complex_internal_6 --> -28($fp) -lw $t3, -28($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_print_at_Complex_internal_3 --> -16($fp) -# LOCAL local_print_at_Complex_internal_4 --> -20($fp) -# local_print_at_Complex_internal_4 = VCALL local_print_at_Complex_internal_3 out_int -# Save new self pointer in $s1 -lw $s1, -16($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 16($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -20($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_print_at_Complex_internal_0 --> -4($fp) -# LOCAL local_print_at_Complex_internal_4 --> -20($fp) -# local_print_at_Complex_internal_0 = local_print_at_Complex_internal_4 -lw $t3, -20($fp) -sw $t3, -4($fp) -# GOTO label_ENDIF_12 -j label_ENDIF_12 -label_FALSEIF_11: - # LOCAL local_print_at_Complex_internal_15 --> -64($fp) - # local_print_at_Complex_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_print_at_Complex_internal_13 --> -56($fp) - # LOCAL local_print_at_Complex_internal_15 --> -64($fp) - # local_print_at_Complex_internal_13 = local_print_at_Complex_internal_15 - lw $t3, -64($fp) - sw $t3, -56($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + li $t1, 1 + not $t1, $t1 + sw $t1, -4($fp) + # + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + lw $t1, -4($fp) + sw $t1, 12($s1) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t1, -16($fp) + sw $t1, -8($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_print_at_Complex_internal_16 = GETATTRIBUTE x Complex - # LOCAL local_print_at_Complex_internal_16 --> -68($fp) - lw $t3, 12($s1) - sw $t3, -68($fp) - # ARG local_print_at_Complex_internal_16 - # LOCAL local_print_at_Complex_internal_16 --> -68($fp) - lw $t3, -68($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_2 + sw $t1, 12($v0) + li $t1, 15 + sw $t1, 16($v0) + sw $v0, -20($fp) + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t1, -20($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_print_at_Complex_internal_13 --> -56($fp) - # LOCAL local_print_at_Complex_internal_14 --> -60($fp) - # local_print_at_Complex_internal_14 = VCALL local_print_at_Complex_internal_13 out_int + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 out_string # Save new self pointer in $s1 - lw $s1, -56($fp) + lw $s1, -8($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 16($t4) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -60($fp) + jalr $t3 + sw $v0, -12($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_11 --> -48($fp) - # LOCAL local_print_at_Complex_internal_14 --> -60($fp) - # local_print_at_Complex_internal_11 = local_print_at_Complex_internal_14 - lw $t3, -60($fp) - sw $t3, -48($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 + lw $t1, -36($fp) + sw $t1, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_at_Complex_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_6 - sw $t3, 12($v0) - li $t3, 1 - sw $t3, 16($v0) - sw $v0, -72($fp) - # ARG local_print_at_Complex_internal_17 - # LOCAL local_print_at_Complex_internal_17 --> -72($fp) - lw $t3, -72($fp) - # Push arg into stack + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 + lw $t1, -48($fp) + sw $t1, -40($fp) + # Push register s1 into stack subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_print_at_Complex_internal_11 --> -48($fp) - # LOCAL local_print_at_Complex_internal_12 --> -52($fp) - # local_print_at_Complex_internal_12 = VCALL local_print_at_Complex_internal_11 out_string + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 in_string # Save new self pointer in $s1 - lw $s1, -48($fp) + lw $s1, -40($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 12($t4) + lw $t3, 20($t2) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -52($fp) + jalr $t3 + sw $v0, -44($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_9 --> -40($fp) - # LOCAL local_print_at_Complex_internal_12 --> -52($fp) - # local_print_at_Complex_internal_9 = local_print_at_Complex_internal_12 - lw $t3, -52($fp) - sw $t3, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Complex_internal_18 = GETATTRIBUTE y Complex - # LOCAL local_print_at_Complex_internal_18 --> -76($fp) - lw $t3, 16($s1) - sw $t3, -76($fp) - # ARG local_print_at_Complex_internal_18 - # LOCAL local_print_at_Complex_internal_18 --> -76($fp) - lw $t3, -76($fp) + # ARG local_main_at_Main_internal_10 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + lw $t1, -44($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_print_at_Complex_internal_9 --> -40($fp) - # LOCAL local_print_at_Complex_internal_10 --> -44($fp) - # local_print_at_Complex_internal_10 = VCALL local_print_at_Complex_internal_9 out_int + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 pal # Save new self pointer in $s1 - lw $s1, -40($fp) + lw $s1, -28($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 16($t4) + lw $t3, 28($t2) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -44($fp) + jalr $t3 + sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_7 --> -32($fp) - # LOCAL local_print_at_Complex_internal_10 --> -44($fp) - # local_print_at_Complex_internal_7 = local_print_at_Complex_internal_10 - lw $t3, -44($fp) - sw $t3, -32($fp) + # IF_ZERO local_main_at_Main_internal_7 GOTO label_FALSEIF_13 + # IF_ZERO local_main_at_Main_internal_7 GOTO label_FALSEIF_13 + lw $t1, -32($fp) + beq $t1, 0, label_FALSEIF_13 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 + lw $t1, -60($fp) + sw $t1, -52($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_7 - sw $t3, 12($v0) - li $t3, 1 - sw $t3, 16($v0) - sw $v0, -80($fp) - # ARG local_print_at_Complex_internal_19 - # LOCAL local_print_at_Complex_internal_19 --> -80($fp) - lw $t3, -80($fp) + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_3 + sw $t1, 12($v0) + li $t1, 22 + sw $t1, 16($v0) + sw $v0, -64($fp) + # ARG local_main_at_Main_internal_15 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + lw $t1, -64($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_print_at_Complex_internal_7 --> -32($fp) - # LOCAL local_print_at_Complex_internal_8 --> -36($fp) - # local_print_at_Complex_internal_8 = VCALL local_print_at_Complex_internal_7 out_string + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string # Save new self pointer in $s1 - lw $s1, -32($fp) + lw $s1, -52($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 12($t4) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -36($fp) + jalr $t3 + sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_0 --> -4($fp) - # LOCAL local_print_at_Complex_internal_8 --> -36($fp) - # local_print_at_Complex_internal_0 = local_print_at_Complex_internal_8 - lw $t3, -36($fp) - sw $t3, -4($fp) - label_ENDIF_12: -# RETURN local_print_at_Complex_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_print_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 88 -jr $ra -# Function END - - -# function_reflect_0_at_Complex implementation. -# @Params: -function_reflect_0_at_Complex: - # Allocate stack frame for function function_reflect_0_at_Complex. - subu $sp, $sp, 44 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 44 - # local_reflect_0_at_Complex_internal_1 = GETATTRIBUTE x Complex - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - lw $t3, 12($s1) - sw $t3, -8($fp) - # local_reflect_0_at_Complex_internal_3 = GETATTRIBUTE x Complex - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - lw $t3, 12($s1) - sw $t3, -16($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - lw $t3, -16($fp) - not $t3, $t3 - sw $t3, -12($fp) - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # local_reflect_0_at_Complex_internal_0 = local_reflect_0_at_Complex_internal_1 - local_reflect_0_at_Complex_internal_2 - lw $t3, -8($fp) - lw $t4, -12($fp) - sub $t3, $t3, $t4 - sw $t3, -4($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_15 - # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_15 - lw $t3, -4($fp) - beq $t3, 0, label_TRUE_15 - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # local_reflect_0_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - # GOTO label_END_16 -j label_END_16 -label_TRUE_15: - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # local_reflect_0_at_Complex_internal_0 = 1 - li $t3, 1 - sw $t3, -4($fp) - label_END_16: -# local_reflect_0_at_Complex_internal_5 = GETATTRIBUTE y Complex -# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) -lw $t3, 16($s1) -sw $t3, -24($fp) -# local_reflect_0_at_Complex_internal_7 = GETATTRIBUTE y Complex -# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -lw $t3, 16($s1) -sw $t3, -32($fp) -# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) -# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -lw $t3, -32($fp) -not $t3, $t3 -sw $t3, -28($fp) -# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) -# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) -# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) -# local_reflect_0_at_Complex_internal_4 = local_reflect_0_at_Complex_internal_5 - local_reflect_0_at_Complex_internal_6 -lw $t3, -24($fp) -lw $t4, -28($fp) -sub $t3, $t3, $t4 -sw $t3, -20($fp) -# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_17 -# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_17 -lw $t3, -20($fp) -beq $t3, 0, label_TRUE_17 -# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) -# local_reflect_0_at_Complex_internal_4 = 0 -li $t3, 0 -sw $t3, -20($fp) -# GOTO label_END_18 -j label_END_18 -label_TRUE_17: - # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) - # local_reflect_0_at_Complex_internal_4 = 1 - li $t3, 1 - sw $t3, -20($fp) - label_END_18: -# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) -# local_reflect_0_at_Complex_internal_8 = SELF -sw $s1, -36($fp) -# RETURN local_reflect_0_at_Complex_internal_8 -lw $v0, -36($fp) -# Deallocate stack frame for function function_reflect_0_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 44 -jr $ra -# Function END - - -# function_reflect_X_at_Complex implementation. -# @Params: -function_reflect_X_at_Complex: - # Allocate stack frame for function function_reflect_X_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_reflect_X_at_Complex_internal_1 = GETATTRIBUTE y Complex - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - lw $t3, 16($s1) - sw $t3, -8($fp) - # local_reflect_X_at_Complex_internal_3 = GETATTRIBUTE y Complex - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - lw $t3, 16($s1) - sw $t3, -16($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - lw $t3, -16($fp) - not $t3, $t3 - sw $t3, -12($fp) - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # local_reflect_X_at_Complex_internal_0 = local_reflect_X_at_Complex_internal_1 - local_reflect_X_at_Complex_internal_2 - lw $t3, -8($fp) - lw $t4, -12($fp) - sub $t3, $t3, $t4 - sw $t3, -4($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_19 - # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_19 - lw $t3, -4($fp) - beq $t3, 0, label_TRUE_19 - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # local_reflect_X_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - # GOTO label_END_20 -j label_END_20 -label_TRUE_19: - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # local_reflect_X_at_Complex_internal_0 = 1 - li $t3, 1 - sw $t3, -4($fp) - label_END_20: -# LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) -# local_reflect_X_at_Complex_internal_4 = SELF -sw $s1, -20($fp) -# RETURN local_reflect_X_at_Complex_internal_4 -lw $v0, -20($fp) -# Deallocate stack frame for function function_reflect_X_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 32 -jr $ra -# Function END - - -# function_reflect_Y_at_Complex implementation. -# @Params: -function_reflect_Y_at_Complex: - # Allocate stack frame for function function_reflect_Y_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_reflect_Y_at_Complex_internal_1 = GETATTRIBUTE x Complex - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - lw $t3, 12($s1) - sw $t3, -8($fp) - # local_reflect_Y_at_Complex_internal_3 = GETATTRIBUTE x Complex - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - lw $t3, 12($s1) - sw $t3, -16($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - lw $t3, -16($fp) - not $t3, $t3 - sw $t3, -12($fp) - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # local_reflect_Y_at_Complex_internal_0 = local_reflect_Y_at_Complex_internal_1 - local_reflect_Y_at_Complex_internal_2 - lw $t3, -8($fp) - lw $t4, -12($fp) - sub $t3, $t3, $t4 - sw $t3, -4($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_21 - # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_21 - lw $t3, -4($fp) - beq $t3, 0, label_TRUE_21 - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # local_reflect_Y_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - # GOTO label_END_22 -j label_END_22 -label_TRUE_21: - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # local_reflect_Y_at_Complex_internal_0 = 1 - li $t3, 1 - sw $t3, -4($fp) - label_END_22: -# LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) -# local_reflect_Y_at_Complex_internal_4 = SELF -sw $s1, -20($fp) -# RETURN local_reflect_Y_at_Complex_internal_4 -lw $v0, -20($fp) -# Deallocate stack frame for function function_reflect_Y_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 32 -jr $ra -# Function END - - -# function_equal_at_Complex implementation. -# @Params: -# 0($fp) = param_equal_at_Complex_d_0 -function_equal_at_Complex: - # Allocate stack frame for function function_equal_at_Complex. - subu $sp, $sp, 48 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 48 - # local_equal_at_Complex_internal_2 = GETATTRIBUTE x Complex - # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) - lw $t3, 12($s1) - sw $t3, -12($fp) - # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) - # PARAM param_equal_at_Complex_d_0 --> 0($fp) - # local_equal_at_Complex_internal_3 = PARAM param_equal_at_Complex_d_0 - lw $t3, 0($fp) - sw $t3, -16($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_5 = local_main_at_Main_internal_13 + lw $t1, -56($fp) + sw $t1, -24($fp) + # GOTO label_ENDIF_14 +j label_ENDIF_14 +label_FALSEIF_13: + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 + lw $t1, -76($fp) + sw $t1, -68($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) - # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) - # local_equal_at_Complex_internal_4 = VCALL local_equal_at_Complex_internal_3 x_value + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_4 + sw $t1, 12($v0) + li $t1, 26 + sw $t1, 16($v0) + sw $v0, -80($fp) + # ARG local_main_at_Main_internal_19 + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + lw $t1, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string # Save new self pointer in $s1 - lw $s1, -16($fp) + lw $s1, -68($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 52($t4) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -20($fp) + jalr $t3 + sw $v0, -72($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) - # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) - # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) - # local_equal_at_Complex_internal_1 = local_equal_at_Complex_internal_2 - local_equal_at_Complex_internal_4 - lw $t3, -12($fp) - lw $t4, -20($fp) - sub $t3, $t3, $t4 - sw $t3, -8($fp) - # IF_ZERO local_equal_at_Complex_internal_1 GOTO label_TRUE_25 - # IF_ZERO local_equal_at_Complex_internal_1 GOTO label_TRUE_25 - lw $t3, -8($fp) - beq $t3, 0, label_TRUE_25 - # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) - # local_equal_at_Complex_internal_1 = 0 - li $t3, 0 - sw $t3, -8($fp) - # GOTO label_END_26 -j label_END_26 -label_TRUE_25: - # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) - # local_equal_at_Complex_internal_1 = 1 - li $t3, 1 - sw $t3, -8($fp) - label_END_26: -# IF_ZERO local_equal_at_Complex_internal_1 GOTO label_FALSEIF_23 -# IF_ZERO local_equal_at_Complex_internal_1 GOTO label_FALSEIF_23 -lw $t3, -8($fp) -beq $t3, 0, label_FALSEIF_23 -# local_equal_at_Complex_internal_7 = GETATTRIBUTE y Complex -# LOCAL local_equal_at_Complex_internal_7 --> -32($fp) -lw $t3, 16($s1) -sw $t3, -32($fp) -# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) -# PARAM param_equal_at_Complex_d_0 --> 0($fp) -# local_equal_at_Complex_internal_8 = PARAM param_equal_at_Complex_d_0 -lw $t3, 0($fp) -sw $t3, -36($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) -# LOCAL local_equal_at_Complex_internal_9 --> -40($fp) -# local_equal_at_Complex_internal_9 = VCALL local_equal_at_Complex_internal_8 y_value -# Save new self pointer in $s1 -lw $s1, -36($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 56($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -40($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_equal_at_Complex_internal_6 --> -28($fp) -# LOCAL local_equal_at_Complex_internal_7 --> -32($fp) -# LOCAL local_equal_at_Complex_internal_9 --> -40($fp) -# local_equal_at_Complex_internal_6 = local_equal_at_Complex_internal_7 - local_equal_at_Complex_internal_9 -lw $t3, -32($fp) -lw $t4, -40($fp) -sub $t3, $t3, $t4 -sw $t3, -28($fp) -# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_TRUE_29 -# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_TRUE_29 -lw $t3, -28($fp) -beq $t3, 0, label_TRUE_29 -# LOCAL local_equal_at_Complex_internal_6 --> -28($fp) -# local_equal_at_Complex_internal_6 = 0 -li $t3, 0 -sw $t3, -28($fp) -# GOTO label_END_30 -j label_END_30 -label_TRUE_29: - # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) - # local_equal_at_Complex_internal_6 = 1 - li $t3, 1 - sw $t3, -28($fp) - label_END_30: -# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSEIF_27 -# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSEIF_27 -lw $t3, -28($fp) -beq $t3, 0, label_FALSEIF_27 -# LOCAL local_equal_at_Complex_internal_5 --> -24($fp) -# local_equal_at_Complex_internal_5 = 1 -li $t3, 1 -sw $t3, -24($fp) -# GOTO label_ENDIF_28 -j label_ENDIF_28 -label_FALSEIF_27: - # LOCAL local_equal_at_Complex_internal_5 --> -24($fp) - # local_equal_at_Complex_internal_5 = 0 - li $t3, 0 - sw $t3, -24($fp) - label_ENDIF_28: -# LOCAL local_equal_at_Complex_internal_0 --> -4($fp) -# LOCAL local_equal_at_Complex_internal_5 --> -24($fp) -# local_equal_at_Complex_internal_0 = local_equal_at_Complex_internal_5 -lw $t3, -24($fp) -sw $t3, -4($fp) -# GOTO label_ENDIF_24 -j label_ENDIF_24 -label_FALSEIF_23: - # LOCAL local_equal_at_Complex_internal_0 --> -4($fp) - # local_equal_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - label_ENDIF_24: -# RETURN local_equal_at_Complex_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_equal_at_Complex. + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_5 = local_main_at_Main_internal_17 + lw $t1, -72($fp) + sw $t1, -24($fp) + label_ENDIF_14: +# RETURN local_main_at_Main_internal_5 +lw $v0, -24($fp) +# Deallocate stack frame for function function_main_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 48 -# Deallocate function args -addu $sp, $sp, 4 +addu $sp, $sp, 88 jr $ra # Function END -# function_x_value_at_Complex implementation. -# @Params: -function_x_value_at_Complex: - # Allocate stack frame for function function_x_value_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_x_value_at_Complex_internal_0 = GETATTRIBUTE x Complex - # LOCAL local_x_value_at_Complex_internal_0 --> -4($fp) - lw $t3, 12($s1) - sw $t3, -4($fp) - # RETURN local_x_value_at_Complex_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_x_value_at_Complex. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_y_value_at_Complex implementation. -# @Params: -function_y_value_at_Complex: - # Allocate stack frame for function function_y_value_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_y_value_at_Complex_internal_0 = GETATTRIBUTE y Complex - # LOCAL local_y_value_at_Complex_internal_0 --> -4($fp) - lw $t3, 16($s1) - sw $t3, -4($fp) - # RETURN local_y_value_at_Complex_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_y_value_at_Complex. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - diff --git a/src/testing.py b/src/testing.py index 2cf486c4..93c6b069 100755 --- a/src/testing.py +++ b/src/testing.py @@ -61,83 +61,29 @@ def pipeline(program: str, deep: int) -> None: text = r"""class Main inherits IO { - main() : IO { - (let c : Complex <- (new Complex).init(1, 1) in - { - -- trivially equal (see CoolAid) - if c.reflect_X() = c.reflect_0() - then out_string("=)\n") - else out_string("=(\n") - fi; - -- equal - if c.reflect_X().reflect_Y().equal(c.reflect_0()) - then out_string("=)\n") - else out_string("=(\n") - fi; - } - ) - }; -}; - -class Complex inherits IO { - x : Int; - y : Int; - - init(a : Int, b : Int) : Complex { - { - x = a; - y = b; - self; - } - }; - - print() : Object { - if y = 0 - then out_int(x) - else out_int(x).out_string("+").out_int(y).out_string("I") - fi - }; - - reflect_0() : Complex { - { - x = ~x; - y = ~y; - self; - } + pal(s : String) : Bool { + if s.length() = 0 + then true + else if s.length() = 1 + then true + else if s.substr(0, 1) = s.substr(s.length() - 1, 1) + then pal(s.substr(1, s.length() -2)) + else false + fi fi fi }; - reflect_X() : Complex { - { - y = ~y; - self; - } - }; + i : Int; - reflect_Y() : Complex { + main() : IO { { - x = ~x; - self; + i <- ~1; + out_string("enter a string\n"); + if pal(in_string()) + then out_string("that was a palindrome\n") + else out_string("that was not a palindrome\n") + fi; } }; - - equal(d : Complex) : Bool { - if x = d.x_value() - then - if y = d.y_value() - then true - else false - fi - else false - fi - }; - - x_value() : Int { - x - }; - - y_value() : Int { - y - }; }; """ diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 7c1107c2..ed89414c 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -1,4 +1,6 @@ from pickle import TRUE + +from cloudpickle.cloudpickle import instance from abstract.semantics import Type from cil.nodes import ( AbortNode, @@ -340,7 +342,10 @@ def _(self, node: cil.SetAttributeNode): # Cargar el valor de source en un registro temporal # y luego moverlo a la direccion de memoria del # atributo - self.register_instruction(LW(reg, source)) + if isinstance(source, int): + self.register_instruction(LI(reg, source)) + else: + self.register_instruction(LW(reg, source)) self.register_instruction(SW(reg, f"{offset}($s1)")) self.used_registers[reg] = False @@ -532,6 +537,11 @@ def _(self, node: cil.AllocateNode): self.register_instruction(MOVE(temp, v0)) + # Cada atributo puede hacer referencia a atributos anteriormente + # definidos, o sea que tenemos que salvar self + self.push_register(s1) + self.register_instruction(MOVE(s1, v0)) + # Los atributos comienzan en el indice 8($v0) for i, attribute in enumerate(instance_type.attributes): attrib_type_name = locate_attribute_in_type_hierarchy( @@ -550,6 +560,9 @@ def _(self, node: cil.AllocateNode): SW(dest=v0, src=f"{12 + i*4}(${REG_TO_STR[temp]})") ) + # Restaurar self + self.pop_register(s1) + # mover la direccion que almacena la instancia hacia dest self.register_instruction(SW(temp, dest)) @@ -627,7 +640,10 @@ def _(self, node: BitwiseNotNode): assert src is not None assert dest is not None - self.register_instruction(LW(reg, src)) + if isinstance(src, int): + self.register_instruction(LI(reg, src)) + else: + self.register_instruction(LW(reg, src)) self.register_instruction(NOT(reg, reg)) self.register_instruction(SW(reg, dest)) @@ -961,7 +977,7 @@ def _(self, node: ConcatString): # Reservar memoria para el nuevo buffer # $v0 = 9 (syscall 9 = sbrk) - self.register_instruction(ADDU(a0, a0, 1, True)) + self.register_instruction(ADDU(a0, a0, 4, True)) self.register_instruction(LI(v0, 9)) self.register_instruction(SYSCALL()) @@ -1089,6 +1105,11 @@ def _(self, node: cil.ReadNode): self.register_instruction(J("read_length_loop")) self.register_instruction(Label("end_read_length_loop")) + # Remove new line + self.register_instruction(SUBU(reg2, reg2, 1, True)) + self.register_instruction(SB(zero, f"0(${REG_TO_STR[reg2]})")) + self.register_instruction(SUBU(length, length, 1, True)) + # length contiene el length del string # Crear la instancia diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index a018ad99..ecbfe3b4 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -5,6 +5,7 @@ import abstract.semantics as semantics from typing import List, Optional, Tuple from functools import singledispatchmethod +import re import cil.nodes @@ -283,6 +284,8 @@ def _(self, node: coolAst.VariableDeclaration, scope: Scope) -> CilNode: # Si la variable es int, string o boolean, su valor por defecto es 0 if var_info.type.name not in ("String", "Int", "Bool"): self.register_instruction(AllocateNode(var_info.type, local_var)) + elif var_info.type.name == "String": + self.register_instruction(AllocateStringNode(local_var, self.null, 0)) else: # Si la variable tiene una expresion de inicializacion # entonces no es necesario ponerle valor por defecto @@ -573,22 +576,29 @@ def _(self, node: coolAst.StringConstant, scope: Scope) -> LocalNode: # Registrar el string en la seccion de datos s1 = self.register_data(node.lex) + pluses = len(re.findall(r"\\n", node.lex)) + 2 + # Cargar el string en la variable interna self.register_instruction( - AllocateStringNode(str_const_vm_holder, s1, len(node.lex) - 2) + AllocateStringNode(str_const_vm_holder, s1, len(node.lex) - pluses) ) # Devolver la variable que contiene el string return str_const_vm_holder @visit.register - def _(self, node: coolAst.TrueConstant, scope: Scope) -> int: + def _(self, node: coolAst.TrueConstant, scope: Scope): # variable interna que devuelve el valor de la constante - return 1 + expr = self.define_internal_local() + self.register_instruction(AssignNode(expr, 1)) + return expr @visit.register - def _(self, node: coolAst.FalseConstant, scope: Scope) -> int: - return 0 + def _(self, node: coolAst.FalseConstant, scope: Scope): + # variable interna que devuelve el valor de la constante + expr = self.define_internal_local() + self.register_instruction(AssignNode(expr, 0)) + return expr # ******************* Implementacion de las comparaciones ******************** # Todas las operaciones de comparacion devuelven 1 si el resultado es verdadero, diff --git a/tests/codegen/atoi.mips b/tests/codegen/atoi.mips index e851a289..2d98be02 100644 --- a/tests/codegen/atoi.mips +++ b/tests/codegen/atoi.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:22 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:20 2020 # School of Math and Computer Science, University of Havana # @@ -49,7 +49,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String # Function END # @@ -458,7 +458,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -473,7 +473,7 @@ function_concat_at_String: lw $t0, 12($s1) # Get second string from param lw $t1, 12($v0) - addu $a0, $a0, 1 + addu $a0, $a0, 4 li $v0, 9 syscall move $t2, $v0 @@ -659,6 +659,13 @@ entry: li $t2, 20 sw $t2, 8($v0) move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) @@ -2005,7 +2012,7 @@ function_a2i_at_A2I: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 8($t2) + lw $t3, 20($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -16($fp) @@ -2073,7 +2080,7 @@ label_FALSEIF_81: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 4($t2) + lw $t3, 16($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -32($fp) @@ -2168,7 +2175,7 @@ lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address -lw $t3, 8($t2) +lw $t3, 20($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -72($fp) @@ -2197,7 +2204,7 @@ lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address -lw $t3, 4($t2) +lw $t3, 16($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -60($fp) @@ -2268,7 +2275,7 @@ label_FALSEIF_85: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 4($t2) + lw $t3, 16($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -88($fp) @@ -2363,7 +2370,7 @@ lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address -lw $t3, 8($t2) +lw $t3, 20($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -124($fp) @@ -2392,7 +2399,7 @@ lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address -lw $t3, 4($t2) +lw $t3, 16($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -112($fp) @@ -2528,7 +2535,7 @@ function_a2i_aux_at_A2I: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 8($t2) + lw $t3, 20($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -16($fp) @@ -2623,7 +2630,7 @@ lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address -lw $t3, 4($t2) +lw $t3, 16($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -52($fp) @@ -2911,7 +2918,7 @@ label_FALSEIF_101: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 0($t2) + lw $t3, 12($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -40($fp) @@ -3123,7 +3130,7 @@ label_FALSEIF_105: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 0($t2) + lw $t3, 12($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -28($fp) @@ -3189,6 +3196,13 @@ function_main_at_Main: li $t3, 16 sw $t3, 8($v0) move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t2, -16($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) @@ -3244,6 +3258,24 @@ function_main_at_Main: # local_main_at_Main_a_0 = local_main_at_Main_internal_2 lw $t2, -12($fp) sw $t2, -4($fp) + # LOCAL local_main_at_Main_b_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_0 + sw $t2, 12($v0) + li $t2, 0 + sw $t2, 16($v0) + sw $v0, -24($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # local_main_at_Main_internal_8 = ALLOCATE A2I # Allocating 20 bytes of memory @@ -3274,6 +3306,13 @@ function_main_at_Main: li $t4, 16 sw $t4, 8($v0) move $t3, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t3, -36($fp) # LOCAL local_main_at_Main_internal_6 --> -28($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) @@ -3456,7 +3495,7 @@ function_main_at_Main: sw $t3, 8($v0) la $t3, data_30 sw $t3, 12($v0) - li $t3, 2 + li $t3, 1 sw $t3, 16($v0) sw $v0, -92($fp) # ARG local_main_at_Main_internal_22 diff --git a/tests/codegen/book_list.mips b/tests/codegen/book_list.mips index 4f52c453..6cb353da 100644 --- a/tests/codegen/book_list.mips +++ b/tests/codegen/book_list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:21 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:19 2020 # School of Math and Computer Science, University of Havana # @@ -57,7 +57,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String # Function END # @@ -462,7 +462,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -477,7 +477,7 @@ function_concat_at_String: lw $t0, 12($s1) # Get second string from param lw $t1, 12($v0) - addu $a0, $a0, 1 + addu $a0, $a0, 4 li $v0, 9 syscall move $t2, $v0 @@ -663,6 +663,10 @@ entry: li $t2, 36 sw $t2, 8($v0) move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 # Push register t1 into stack subu $sp, $sp, 4 sw $t1, 0($sp) @@ -671,6 +675,9 @@ entry: lw $t1, 0($sp) addu $sp, $sp, 4 sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) @@ -931,7 +938,7 @@ function_print_at_Book: sw $t1, 8($v0) la $t1, data_3 sw $t1, 12($v0) - li $t1, 2 + li $t1, 1 sw $t1, 16($v0) sw $v0, -40($fp) # ARG local_print_at_Book_internal_9 @@ -1067,7 +1074,7 @@ function_print_at_Book: sw $t1, 8($v0) la $t1, data_5 sw $t1, 12($v0) - li $t1, 2 + li $t1, 1 sw $t1, 16($v0) sw $v0, -80($fp) # ARG local_print_at_Book_internal_19 @@ -1360,7 +1367,7 @@ function_print_at_Article: sw $t1, 8($v0) la $t1, data_7 sw $t1, 12($v0) - li $t1, 2 + li $t1, 1 sw $t1, 16($v0) sw $v0, -48($fp) # ARG local_print_at_Article_internal_11 @@ -1438,8 +1445,12 @@ function_isNil_at_BookList: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN 1 - li $v0, 1 + # LOCAL local_isNil_at_BookList_internal_3 --> -16($fp) + # local_isNil_at_BookList_internal_3 = 1 + li $t1, 1 + sw $t1, -16($fp) + # RETURN local_isNil_at_BookList_internal_3 + lw $v0, -16($fp) # Deallocate stack frame for function function_isNil_at_BookList. # Restore $ra lw $ra, 4($sp) @@ -1490,6 +1501,10 @@ function_cons_at_BookList: li $t3, 28 sw $t3, 8($v0) move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 # Push register t2 into stack subu $sp, $sp, 4 sw $t2, 0($sp) @@ -1506,6 +1521,9 @@ function_cons_at_BookList: lw $t2, 0($sp) addu $sp, $sp, 4 sw $v0, 16($t2) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t2, -4($fp) # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) # local_cons_at_BookList_internal_1 = ALLOCATE Cons @@ -1537,6 +1555,10 @@ function_cons_at_BookList: li $t4, 28 sw $t4, 8($v0) move $t3, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 # Push register t3 into stack subu $sp, $sp, 4 sw $t3, 0($sp) @@ -1553,6 +1575,9 @@ function_cons_at_BookList: lw $t3, 0($sp) addu $sp, $sp, 4 sw $v0, 16($t3) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t3, -8($fp) # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) @@ -1680,6 +1705,10 @@ function_car_at_BookList: li $t5, 16 sw $t5, 8($v0) move $t4, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 # Push register t4 into stack subu $sp, $sp, 4 sw $t4, 0($sp) @@ -1696,6 +1725,9 @@ function_car_at_BookList: lw $t4, 0($sp) addu $sp, $sp, 4 sw $v0, 16($t4) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t4, -16($fp) # RETURN local_car_at_BookList_internal_3 lw $v0, -16($fp) @@ -1776,6 +1808,13 @@ function_cdr_at_BookList: li $t6, 24 sw $t6, 8($v0) move $t5, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t5, -16($fp) # RETURN local_cdr_at_BookList_internal_3 lw $v0, -16($fp) @@ -1889,8 +1928,12 @@ function_isNil_at_Cons: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 + # LOCAL local_isNil_at_Cons_internal_0 --> -4($fp) + # local_isNil_at_Cons_internal_0 = 0 + li $t5, 0 + sw $t5, -4($fp) + # RETURN local_isNil_at_Cons_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function function_isNil_at_Cons. # Restore $ra lw $ra, 4($sp) @@ -2036,7 +2079,7 @@ function_print_list_at_Cons: # local_print_list_at_Cons_internal_5 = 14 li $t5, 14 sw $t5, -24($fp) - # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Book + # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Book # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Book @@ -2058,7 +2101,7 @@ function_print_list_at_Cons: lw $t5, -28($fp) sw $t5, -24($fp) label_Not_min0_1: - # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Article + # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Article # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Article @@ -2096,7 +2139,7 @@ function_print_list_at_Cons: # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 lw $t5, -20($fp) beq $t5, 0, label_ERROR_3 - # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Book + # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Book # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Book @@ -2143,7 +2186,7 @@ function_print_list_at_Cons: sw $t5, 8($v0) la $t5, data_8 sw $t5, 12($v0) - li $t5, 27 + li $t5, 26 sw $t5, 16($v0) sw $v0, -48($fp) # ARG local_print_list_at_Cons_internal_11 @@ -2172,7 +2215,7 @@ function_print_list_at_Cons: # GOTO label_END_4 j label_END_4 label_NEXT0_5: - # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Article + # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Article # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Article @@ -2219,7 +2262,7 @@ label_NEXT0_5: sw $t5, 8($v0) la $t5, data_9 sw $t5, 12($v0) - li $t5, 30 + li $t5, 29 sw $t5, 16($v0) sw $v0, -68($fp) # ARG local_print_list_at_Cons_internal_16 @@ -2302,8 +2345,12 @@ function_isNil_at_Nil: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN 1 - li $v0, 1 + # LOCAL local_isNil_at_Nil_internal_0 --> -4($fp) + # local_isNil_at_Nil_internal_0 = 1 + li $t5, 1 + sw $t5, -4($fp) + # RETURN local_isNil_at_Nil_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function function_isNil_at_Nil. # Restore $ra lw $ra, 4($sp) @@ -2323,8 +2370,12 @@ function_print_list_at_Nil: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN 1 - li $v0, 1 + # LOCAL local_print_list_at_Nil_internal_0 --> -4($fp) + # local_print_list_at_Nil_internal_0 = 1 + li $t5, 1 + sw $t5, -4($fp) + # RETURN local_print_list_at_Nil_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function function_print_list_at_Nil. # Restore $ra lw $ra, 4($sp) @@ -2395,6 +2446,10 @@ function_main_at_Main: li $t7, 16 sw $t7, 8($v0) move $t6, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 # Push register t6 into stack subu $sp, $sp, 4 sw $t6, 0($sp) @@ -2411,6 +2466,9 @@ function_main_at_Main: lw $t6, 0($sp) addu $sp, $sp, 4 sw $v0, 16($t6) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t6, -4($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_3 = ALLOCATE Book @@ -2442,6 +2500,10 @@ function_main_at_Main: li $t8, 16 sw $t8, 8($v0) move $t7, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 # Push register t7 into stack subu $sp, $sp, 4 sw $t7, 0($sp) @@ -2458,6 +2520,9 @@ function_main_at_Main: lw $t7, 0($sp) addu $sp, $sp, 4 sw $v0, 16($t7) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t7, -16($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) @@ -2567,6 +2632,10 @@ function_main_at_Main: li $t9, 20 sw $t9, 8($v0) move $t8, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 # Push register t8 into stack subu $sp, $sp, 4 sw $t8, 0($sp) @@ -2591,6 +2660,9 @@ function_main_at_Main: lw $t8, 0($sp) addu $sp, $sp, 4 sw $v0, 20($t8) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t8, -28($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # local_main_at_Main_internal_9 = ALLOCATE Article @@ -2622,6 +2694,10 @@ function_main_at_Main: li $s2, 20 sw $s2, 8($v0) move $t9, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 # Push register t9 into stack subu $sp, $sp, 4 sw $t9, 0($sp) @@ -2646,6 +2722,9 @@ function_main_at_Main: lw $t9, 0($sp) addu $sp, $sp, 4 sw $v0, 20($t9) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t9, -40($fp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) @@ -2779,6 +2858,13 @@ function_main_at_Main: li $s3, 32 sw $s3, 8($v0) move $s2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $s2, -72($fp) # LOCAL local_main_at_Main_internal_15 --> -64($fp) # LOCAL local_main_at_Main_internal_17 --> -72($fp) diff --git a/tests/codegen/complex.mips b/tests/codegen/complex.mips index 2a766786..89e75292 100644 --- a/tests/codegen/complex.mips +++ b/tests/codegen/complex.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:20 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:19 2020 # School of Math and Computer Science, University of Havana # @@ -49,7 +49,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String # Function END # @@ -358,7 +358,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -373,7 +373,7 @@ function_concat_at_String: lw $t0, 12($s1) # Get second string from param lw $t1, 12($v0) - addu $a0, $a0, 1 + addu $a0, $a0, 4 li $v0, 9 syscall move $t2, $v0 @@ -559,6 +559,13 @@ entry: li $t2, 16 sw $t2, 8($v0) move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) @@ -625,6 +632,10 @@ function_main_at_Main: li $t3, 20 sw $t3, 8($v0) move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 # Push register t2 into stack subu $sp, $sp, 4 sw $t2, 0($sp) @@ -641,6 +652,9 @@ function_main_at_Main: lw $t2, 0($sp) addu $sp, $sp, 4 sw $v0, 16($t2) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t2, -4($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_3 = ALLOCATE Complex @@ -672,6 +686,10 @@ function_main_at_Main: li $t4, 20 sw $t4, 8($v0) move $t3, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 # Push register t3 into stack subu $sp, $sp, 4 sw $t3, 0($sp) @@ -688,6 +706,9 @@ function_main_at_Main: lw $t3, 0($sp) addu $sp, $sp, 4 sw $v0, 16($t3) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t3, -16($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) @@ -858,7 +879,7 @@ li $t3, 8 sw $t3, 8($v0) la $t3, data_2 sw $t3, 12($v0) -li $t3, 4 +li $t3, 3 sw $t3, 16($v0) sw $v0, -64($fp) # ARG local_main_at_Main_internal_15 @@ -918,7 +939,7 @@ label_FALSEIF_1: sw $t3, 8($v0) la $t3, data_3 sw $t3, 12($v0) - li $t3, 4 + li $t3, 3 sw $t3, 16($v0) sw $v0, -80($fp) # ARG local_main_at_Main_internal_19 diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips index 35573c48..314a4bc4 100644 --- a/tests/codegen/fib.mips +++ b/tests/codegen/fib.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:20 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:19 2020 # School of Math and Computer Science, University of Havana # @@ -47,7 +47,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String # Function END # @@ -333,7 +333,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -348,7 +348,7 @@ function_concat_at_String: lw $t0, 12($s1) # Get second string from param lw $t1, 12($v0) - addu $a0, $a0, 1 + addu $a0, $a0, 4 li $v0, 9 syscall move $t2, $v0 @@ -534,6 +534,13 @@ entry: li $t2, 16 sw $t2, 8($v0) move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) @@ -596,7 +603,7 @@ function_main_at_Main: sw $t1, 8($v0) la $t1, data_2 sw $t1, 12($v0) - li $t1, 39 + li $t1, 38 sw $t1, 16($v0) sw $v0, -16($fp) # ARG local_main_at_Main_internal_3 @@ -744,7 +751,7 @@ function_main_at_Main: sw $t1, 8($v0) la $t1, data_3 sw $t1, 12($v0) - li $t1, 2 + li $t1, 1 sw $t1, 16($v0) sw $v0, -68($fp) # ARG local_main_at_Main_internal_16 diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips index 57c617cd..45c90eb0 100644 --- a/tests/codegen/hello_world.mips +++ b/tests/codegen/hello_world.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:19 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:18 2020 # School of Math and Computer Science, University of Havana # @@ -47,7 +47,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String # Function END # @@ -329,7 +329,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -344,7 +344,7 @@ function_concat_at_String: lw $t0, 12($s1) # Get second string from param lw $t1, 12($v0) - addu $a0, $a0, 1 + addu $a0, $a0, 4 li $v0, 9 syscall move $t2, $v0 @@ -530,6 +530,13 @@ entry: li $t2, 16 sw $t2, 8($v0) move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) @@ -592,7 +599,7 @@ function_main_at_Main: sw $t1, 8($v0) la $t1, data_2 sw $t1, 12($v0) - li $t1, 15 + li $t1, 14 sw $t1, 16($v0) sw $v0, -16($fp) # ARG local_main_at_Main_internal_3 diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips index ad2a1715..6d7edef2 100644 --- a/tests/codegen/io.mips +++ b/tests/codegen/io.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:21 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:19 2020 # School of Math and Computer Science, University of Havana # @@ -55,7 +55,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String # Function END # @@ -413,7 +413,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -428,7 +428,7 @@ function_concat_at_String: lw $t0, 12($s1) # Get second string from param lw $t1, 12($v0) - addu $a0, $a0, 1 + addu $a0, $a0, 4 li $v0, 9 syscall move $t2, $v0 @@ -614,6 +614,13 @@ entry: li $t2, 32 sw $t2, 8($v0) move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) @@ -680,6 +687,13 @@ __A__attrib__io__init: li $t3, 0 sw $t3, 8($v0) move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t2, -4($fp) # RETURN local_ib__io__init_internal_0 lw $v0, -4($fp) @@ -729,7 +743,7 @@ function_out_a_at_A: sw $t2, 8($v0) la $t2, data_2 sw $t2, 12($v0) - li $t2, 16 + li $t2, 15 sw $t2, 16($v0) sw $v0, -16($fp) # ARG local_out_a_at_A_internal_3 @@ -803,7 +817,7 @@ function_out_b_at_B: sw $t2, 8($v0) la $t2, data_3 sw $t2, 12($v0) - li $t2, 16 + li $t2, 15 sw $t2, 16($v0) sw $v0, -16($fp) # ARG local_out_b_at_B_internal_3 @@ -876,7 +890,7 @@ function_out_c_at_C: sw $t2, 8($v0) la $t2, data_4 sw $t2, 12($v0) - li $t2, 16 + li $t2, 15 sw $t2, 16($v0) sw $v0, -16($fp) # ARG local_out_c_at_C_internal_3 @@ -949,7 +963,7 @@ function_out_d_at_D: sw $t2, 8($v0) la $t2, data_5 sw $t2, 12($v0) - li $t2, 16 + li $t2, 15 sw $t2, 16($v0) sw $v0, -16($fp) # ARG local_out_d_at_D_internal_3 @@ -1026,6 +1040,10 @@ function_main_at_Main: li $t4, 16 sw $t4, 8($v0) move $t3, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 # Push register t3 into stack subu $sp, $sp, 4 sw $t3, 0($sp) @@ -1034,6 +1052,9 @@ function_main_at_Main: lw $t3, 0($sp) addu $sp, $sp, 4 sw $v0, 12($t3) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t3, -12($fp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) @@ -1090,6 +1111,10 @@ function_main_at_Main: li $t5, 20 sw $t5, 8($v0) move $t4, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 # Push register t4 into stack subu $sp, $sp, 4 sw $t4, 0($sp) @@ -1098,6 +1123,9 @@ function_main_at_Main: lw $t4, 0($sp) addu $sp, $sp, 4 sw $v0, 12($t4) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t4, -24($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # LOCAL local_main_at_Main_internal_5 --> -24($fp) @@ -1154,6 +1182,13 @@ function_main_at_Main: li $t6, 24 sw $t6, 8($v0) move $t5, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t5, -36($fp) # LOCAL local_main_at_Main_internal_6 --> -28($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) @@ -1210,6 +1245,13 @@ function_main_at_Main: li $t7, 28 sw $t7, 8($v0) move $t6, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t6, -48($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # LOCAL local_main_at_Main_internal_11 --> -48($fp) @@ -1262,7 +1304,7 @@ function_main_at_Main: sw $t6, 8($v0) la $t6, data_6 sw $t6, 12($v0) - li $t6, 7 + li $t6, 6 sw $t6, 16($v0) sw $v0, -64($fp) # ARG local_main_at_Main_internal_15 diff --git a/tests/codegen/life.mips b/tests/codegen/life.mips index 4c8164d6..b8d06b32 100644 --- a/tests/codegen/life.mips +++ b/tests/codegen/life.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:22 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:21 2020 # School of Math and Computer Science, University of Havana # @@ -51,7 +51,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String # Function END # @@ -703,7 +703,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -718,7 +718,7 @@ function_concat_at_String: lw $t0, 12($s1) # Get second string from param lw $t1, 12($v0) - addu $a0, $a0, 1 + addu $a0, $a0, 4 li $v0, 9 syscall move $t2, $v0 @@ -904,6 +904,10 @@ entry: li $t2, 24 sw $t2, 8($v0) move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 # Push register t1 into stack subu $sp, $sp, 4 sw $t1, 0($sp) @@ -944,6 +948,9 @@ entry: lw $t1, 0($sp) addu $sp, $sp, 4 sw $v0, 28($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) @@ -1062,7 +1069,7 @@ function_size_of_board_at_Board: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 8($t2) + lw $t3, 20($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -8($fp) @@ -1159,10 +1166,10 @@ label_TRUE_3: lw $t1, -24($fp) beq $t1, 0, label_FALSEIF_1 # -lw $t1, 3 +li $t1, 3 sw $t1, 12($s1) # -lw $t1, 5 +li $t1, 5 sw $t1, 16($s1) # # LOCAL local_board_init_at_Board_size_0 --> -4($fp) @@ -1200,10 +1207,10 @@ label_TRUE_7: lw $t1, -32($fp) beq $t1, 0, label_FALSEIF_5 # -lw $t1, 4 +li $t1, 4 sw $t1, 12($s1) # -lw $t1, 4 +li $t1, 4 sw $t1, 16($s1) # # LOCAL local_board_init_at_Board_size_0 --> -4($fp) @@ -1241,10 +1248,10 @@ label_TRUE_11: lw $t1, -40($fp) beq $t1, 0, label_FALSEIF_9 # -lw $t1, 4 +li $t1, 4 sw $t1, 12($s1) # -lw $t1, 5 +li $t1, 5 sw $t1, 16($s1) # # LOCAL local_board_init_at_Board_size_0 --> -4($fp) @@ -1282,10 +1289,10 @@ label_TRUE_15: lw $t1, -48($fp) beq $t1, 0, label_FALSEIF_13 # -lw $t1, 3 +li $t1, 3 sw $t1, 12($s1) # -lw $t1, 7 +li $t1, 7 sw $t1, 16($s1) # # LOCAL local_board_init_at_Board_size_0 --> -4($fp) @@ -1323,10 +1330,10 @@ label_TRUE_19: lw $t1, -56($fp) beq $t1, 0, label_FALSEIF_17 # -lw $t1, 5 +li $t1, 5 sw $t1, 12($s1) # -lw $t1, 5 +li $t1, 5 sw $t1, 16($s1) # # LOCAL local_board_init_at_Board_size_0 --> -4($fp) @@ -1364,10 +1371,10 @@ label_TRUE_23: lw $t1, -64($fp) beq $t1, 0, label_FALSEIF_21 # -lw $t1, 7 +li $t1, 7 sw $t1, 12($s1) # -lw $t1, 4 +li $t1, 4 sw $t1, 16($s1) # # LOCAL local_board_init_at_Board_size_0 --> -4($fp) @@ -1379,10 +1386,10 @@ sw $t1, 20($s1) j label_ENDIF_22 label_FALSEIF_21: # - lw $t1, 5 + li $t1, 5 sw $t1, 12($s1) # - lw $t1, 5 + li $t1, 5 sw $t1, 16($s1) # # LOCAL local_board_init_at_Board_size_0 --> -4($fp) @@ -1590,7 +1597,7 @@ function_print_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_2 sw $t1, 12($v0) - li $t1, 2 + li $t1, 1 sw $t1, 16($v0) sw $v0, -28($fp) # ARG local_print_at_CellularAutomaton_internal_6 @@ -1698,7 +1705,7 @@ lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address -lw $t3, 4($t2) +lw $t3, 16($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -52($fp) @@ -1754,7 +1761,7 @@ li $t1, 8 sw $t1, 8($v0) la $t1, data_3 sw $t1, 12($v0) -li $t1, 2 +li $t1, 1 sw $t1, 16($v0) sw $v0, -76($fp) # ARG local_print_at_CellularAutomaton_internal_18 @@ -1826,7 +1833,7 @@ label_WHILE_END_26: sw $t1, 8($v0) la $t1, data_4 sw $t1, 12($v0) - li $t1, 2 + li $t1, 1 sw $t1, 16($v0) sw $v0, -100($fp) # ARG local_print_at_CellularAutomaton_internal_24 @@ -1898,7 +1905,7 @@ function_num_cells_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 8($t2) + lw $t3, 20($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -8($fp) @@ -2028,7 +2035,7 @@ label_FALSEIF_29: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 4($t2) + lw $t3, 16($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -28($fp) @@ -4840,9 +4847,23 @@ function_evolve_at_CellularAutomaton: lw $t1, -16($fp) sw $t1, -8($fp) # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) - # local_evolve_at_CellularAutomaton_temp_5 = 0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_0 + sw $t1, 12($v0) li $t1, 0 - sw $t1, -24($fp) + sw $t1, 16($v0) + sw $v0, -24($fp) label_WHILE_129: # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) @@ -4934,7 +4955,7 @@ lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address -lw $t3, 0($t2) +lw $t3, 12($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -36($fp) @@ -5018,7 +5039,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_32 sw $t1, 12($v0) - li $t1, 26 + li $t1, 24 sw $t1, 16($v0) sw $v0, -20($fp) # ARG local_option_at_CellularAutomaton_internal_4 @@ -5070,7 +5091,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_33 sw $t1, 12($v0) - li $t1, 14 + li $t1, 13 sw $t1, 16($v0) sw $v0, -36($fp) # ARG local_option_at_CellularAutomaton_internal_8 @@ -5122,7 +5143,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_34 sw $t1, 12($v0) - li $t1, 49 + li $t1, 48 sw $t1, 16($v0) sw $v0, -52($fp) # ARG local_option_at_CellularAutomaton_internal_12 @@ -5174,7 +5195,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_35 sw $t1, 12($v0) - li $t1, 49 + li $t1, 48 sw $t1, 16($v0) sw $v0, -68($fp) # ARG local_option_at_CellularAutomaton_internal_16 @@ -5226,7 +5247,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_36 sw $t1, 12($v0) - li $t1, 11 + li $t1, 10 sw $t1, 16($v0) sw $v0, -84($fp) # ARG local_option_at_CellularAutomaton_internal_20 @@ -5278,7 +5299,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_37 sw $t1, 12($v0) - li $t1, 27 + li $t1, 26 sw $t1, 16($v0) sw $v0, -100($fp) # ARG local_option_at_CellularAutomaton_internal_24 @@ -5330,7 +5351,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_38 sw $t1, 12($v0) - li $t1, 23 + li $t1, 22 sw $t1, 16($v0) sw $v0, -116($fp) # ARG local_option_at_CellularAutomaton_internal_28 @@ -5382,7 +5403,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_39 sw $t1, 12($v0) - li $t1, 29 + li $t1, 28 sw $t1, 16($v0) sw $v0, -132($fp) # ARG local_option_at_CellularAutomaton_internal_32 @@ -5434,7 +5455,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_40 sw $t1, 12($v0) - li $t1, 26 + li $t1, 25 sw $t1, 16($v0) sw $v0, -148($fp) # ARG local_option_at_CellularAutomaton_internal_36 @@ -5486,7 +5507,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_41 sw $t1, 12($v0) - li $t1, 12 + li $t1, 11 sw $t1, 16($v0) sw $v0, -164($fp) # ARG local_option_at_CellularAutomaton_internal_40 @@ -5538,7 +5559,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_42 sw $t1, 12($v0) - li $t1, 22 + li $t1, 21 sw $t1, 16($v0) sw $v0, -180($fp) # ARG local_option_at_CellularAutomaton_internal_44 @@ -5590,7 +5611,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_43 sw $t1, 12($v0) - li $t1, 33 + li $t1, 32 sw $t1, 16($v0) sw $v0, -196($fp) # ARG local_option_at_CellularAutomaton_internal_48 @@ -5642,7 +5663,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_44 sw $t1, 12($v0) - li $t1, 19 + li $t1, 18 sw $t1, 16($v0) sw $v0, -212($fp) # ARG local_option_at_CellularAutomaton_internal_52 @@ -5694,7 +5715,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_45 sw $t1, 12($v0) - li $t1, 13 + li $t1, 12 sw $t1, 16($v0) sw $v0, -228($fp) # ARG local_option_at_CellularAutomaton_internal_56 @@ -5746,7 +5767,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_46 sw $t1, 12($v0) - li $t1, 18 + li $t1, 17 sw $t1, 16($v0) sw $v0, -244($fp) # ARG local_option_at_CellularAutomaton_internal_60 @@ -5798,7 +5819,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_47 sw $t1, 12($v0) - li $t1, 13 + li $t1, 12 sw $t1, 16($v0) sw $v0, -260($fp) # ARG local_option_at_CellularAutomaton_internal_64 @@ -5850,7 +5871,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_48 sw $t1, 12($v0) - li $t1, 14 + li $t1, 13 sw $t1, 16($v0) sw $v0, -276($fp) # ARG local_option_at_CellularAutomaton_internal_68 @@ -5902,7 +5923,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_49 sw $t1, 12($v0) - li $t1, 14 + li $t1, 13 sw $t1, 16($v0) sw $v0, -292($fp) # ARG local_option_at_CellularAutomaton_internal_72 @@ -5954,7 +5975,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_50 sw $t1, 12($v0) - li $t1, 13 + li $t1, 12 sw $t1, 16($v0) sw $v0, -308($fp) # ARG local_option_at_CellularAutomaton_internal_76 @@ -6006,7 +6027,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_51 sw $t1, 12($v0) - li $t1, 14 + li $t1, 13 sw $t1, 16($v0) sw $v0, -324($fp) # ARG local_option_at_CellularAutomaton_internal_80 @@ -6058,7 +6079,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_52 sw $t1, 12($v0) - li $t1, 14 + li $t1, 13 sw $t1, 16($v0) sw $v0, -340($fp) # ARG local_option_at_CellularAutomaton_internal_84 @@ -6110,7 +6131,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_53 sw $t1, 12($v0) - li $t1, 14 + li $t1, 13 sw $t1, 16($v0) sw $v0, -356($fp) # ARG local_option_at_CellularAutomaton_internal_88 @@ -6247,7 +6268,7 @@ function_option_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_55 sw $t1, 12($v0) - li $t1, 2 + li $t1, 1 sw $t1, 16($v0) sw $v0, -400($fp) # ARG local_option_at_CellularAutomaton_internal_99 @@ -7526,14 +7547,28 @@ jr $ra # @Params: function_prompt_at_CellularAutomaton: # Allocate stack frame for function function_prompt_at_CellularAutomaton. - subu $sp, $sp, 84 + subu $sp, $sp, 92 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 84 + addu $fp, $sp, 92 # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) - # local_prompt_at_CellularAutomaton_ans_0 = 0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_0 + sw $t1, 12($v0) li $t1, 0 - sw $t1, -4($fp) + sw $t1, 16($v0) + sw $v0, -4($fp) # LOCAL local_prompt_at_CellularAutomaton_internal_3 --> -16($fp) # local_prompt_at_CellularAutomaton_internal_3 = SELF sw $s1, -16($fp) @@ -7560,7 +7595,7 @@ function_prompt_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_78 sw $t1, 12($v0) - li $t1, 55 + li $t1, 54 sw $t1, 16($v0) sw $v0, -20($fp) # ARG local_prompt_at_CellularAutomaton_internal_4 @@ -7697,7 +7732,7 @@ function_prompt_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_80 sw $t1, 12($v0) - li $t1, 2 + li $t1, 1 sw $t1, 16($v0) sw $v0, -64($fp) # ARG local_prompt_at_CellularAutomaton_internal_15 @@ -7769,16 +7804,26 @@ label_TRUE_219: # IF_ZERO local_prompt_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_217 lw $t1, -72($fp) beq $t1, 0, label_FALSEIF_217 -# LOCAL local_prompt_at_CellularAutomaton_internal_16 --> -68($fp) -# local_prompt_at_CellularAutomaton_internal_16 = 0 +# LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) +# local_prompt_at_CellularAutomaton_internal_19 = 0 li $t1, 0 +sw $t1, -80($fp) +# LOCAL local_prompt_at_CellularAutomaton_internal_16 --> -68($fp) +# LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) +# local_prompt_at_CellularAutomaton_internal_16 = local_prompt_at_CellularAutomaton_internal_19 +lw $t1, -80($fp) sw $t1, -68($fp) # GOTO label_ENDIF_218 j label_ENDIF_218 label_FALSEIF_217: - # LOCAL local_prompt_at_CellularAutomaton_internal_16 --> -68($fp) - # local_prompt_at_CellularAutomaton_internal_16 = 1 + # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) + # local_prompt_at_CellularAutomaton_internal_20 = 1 li $t1, 1 + sw $t1, -84($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_16 --> -68($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) + # local_prompt_at_CellularAutomaton_internal_16 = local_prompt_at_CellularAutomaton_internal_20 + lw $t1, -84($fp) sw $t1, -68($fp) label_ENDIF_218: # RETURN local_prompt_at_CellularAutomaton_internal_16 @@ -7789,7 +7834,7 @@ lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 84 +addu $sp, $sp, 92 jr $ra # Function END @@ -7798,14 +7843,28 @@ jr $ra # @Params: function_prompt2_at_CellularAutomaton: # Allocate stack frame for function function_prompt2_at_CellularAutomaton. - subu $sp, $sp, 84 + subu $sp, $sp, 92 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 84 + addu $fp, $sp, 92 # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) - # local_prompt2_at_CellularAutomaton_ans_0 = 0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_0 + sw $t1, 12($v0) li $t1, 0 - sw $t1, -4($fp) + sw $t1, 16($v0) + sw $v0, -4($fp) # LOCAL local_prompt2_at_CellularAutomaton_internal_3 --> -16($fp) # local_prompt2_at_CellularAutomaton_internal_3 = SELF sw $s1, -16($fp) @@ -7832,7 +7891,7 @@ function_prompt2_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_82 sw $t1, 12($v0) - li $t1, 4 + li $t1, 2 sw $t1, 16($v0) sw $v0, -20($fp) # ARG local_prompt2_at_CellularAutomaton_internal_4 @@ -7884,7 +7943,7 @@ function_prompt2_at_CellularAutomaton: sw $t1, 8($v0) la $t1, data_83 sw $t1, 12($v0) - li $t1, 49 + li $t1, 48 sw $t1, 16($v0) sw $v0, -36($fp) # ARG local_prompt2_at_CellularAutomaton_internal_8 @@ -8041,16 +8100,26 @@ label_TRUE_223: # IF_ZERO local_prompt2_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_221 lw $t1, -72($fp) beq $t1, 0, label_FALSEIF_221 -# LOCAL local_prompt2_at_CellularAutomaton_internal_16 --> -68($fp) -# local_prompt2_at_CellularAutomaton_internal_16 = 1 +# LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) +# local_prompt2_at_CellularAutomaton_internal_19 = 1 li $t1, 1 +sw $t1, -80($fp) +# LOCAL local_prompt2_at_CellularAutomaton_internal_16 --> -68($fp) +# LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) +# local_prompt2_at_CellularAutomaton_internal_16 = local_prompt2_at_CellularAutomaton_internal_19 +lw $t1, -80($fp) sw $t1, -68($fp) # GOTO label_ENDIF_222 j label_ENDIF_222 label_FALSEIF_221: - # LOCAL local_prompt2_at_CellularAutomaton_internal_16 --> -68($fp) - # local_prompt2_at_CellularAutomaton_internal_16 = 0 + # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) + # local_prompt2_at_CellularAutomaton_internal_20 = 0 li $t1, 0 + sw $t1, -84($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_16 --> -68($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) + # local_prompt2_at_CellularAutomaton_internal_16 = local_prompt2_at_CellularAutomaton_internal_20 + lw $t1, -84($fp) sw $t1, -68($fp) label_ENDIF_222: # RETURN local_prompt2_at_CellularAutomaton_internal_16 @@ -8061,7 +8130,7 @@ lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 84 +addu $sp, $sp, 92 jr $ra # Function END @@ -8091,18 +8160,32 @@ __Main__attrib__cells__init: # @Params: function_main_at_Main: # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 140 + subu $sp, $sp, 148 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 140 + addu $fp, $sp, 148 # LOCAL local_main_at_Main_continue_0 --> -4($fp) # local_main_at_Main_continue_0 = 0 li $t1, 0 sw $t1, -4($fp) # LOCAL local_main_at_Main_choice_1 --> -8($fp) - # local_main_at_Main_choice_1 = 0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_0 + sw $t1, 12($v0) li $t1, 0 - sw $t1, -8($fp) + sw $t1, 16($v0) + sw $v0, -8($fp) # LOCAL local_main_at_Main_internal_4 --> -20($fp) # local_main_at_Main_internal_4 = SELF sw $s1, -20($fp) @@ -8129,7 +8212,7 @@ function_main_at_Main: sw $t1, 8($v0) la $t1, data_86 sw $t1, 12($v0) - li $t1, 30 + li $t1, 29 sw $t1, 16($v0) sw $v0, -24($fp) # ARG local_main_at_Main_internal_5 @@ -8181,7 +8264,7 @@ function_main_at_Main: sw $t1, 8($v0) la $t1, data_87 sw $t1, 12($v0) - li $t1, 48 + li $t1, 47 sw $t1, 16($v0) sw $v0, -40($fp) # ARG local_main_at_Main_internal_9 @@ -8240,26 +8323,31 @@ function_main_at_Main: # IF_ZERO local_main_at_Main_internal_11 GOTO label_WHILE_END_226 lw $t1, -48($fp) beq $t1, 0, label_WHILE_END_226 - # LOCAL local_main_at_Main_continue_0 --> -4($fp) - # local_main_at_Main_continue_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = SELF - sw $s1, -64($fp) # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 - lw $t1, -64($fp) + # local_main_at_Main_internal_13 = 1 + li $t1, 1 sw $t1, -56($fp) + # LOCAL local_main_at_Main_continue_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_continue_0 = local_main_at_Main_internal_13 + lw $t1, -56($fp) + sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_14 = local_main_at_Main_internal_16 + lw $t1, -68($fp) + sw $t1, -60($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 option + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 option # Save new self pointer in $s1 - lw $s1, -56($fp) + lw $s1, -60($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -8268,17 +8356,17 @@ function_main_at_Main: lw $t3, 96($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -60($fp) + sw $v0, -64($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # LOCAL local_main_at_Main_choice_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_choice_1 = local_main_at_Main_internal_14 - lw $t1, -60($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_choice_1 = local_main_at_Main_internal_15 + lw $t1, -64($fp) sw $t1, -8($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_18 = ALLOCATE CellularAutomaton + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_19 = ALLOCATE CellularAutomaton # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -8307,6 +8395,10 @@ function_main_at_Main: li $t3, 20 sw $t3, 8($v0) move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 # Push register t2 into stack subu $sp, $sp, 4 sw $t2, 0($sp) @@ -8339,12 +8431,15 @@ function_main_at_Main: lw $t2, 0($sp) addu $sp, $sp, 4 sw $v0, 24($t2) - sw $t2, -76($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 - lw $t2, -76($fp) - sw $t2, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t2, -80($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_17 = local_main_at_Main_internal_19 + lw $t2, -80($fp) + sw $t2, -72($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -8354,11 +8449,11 @@ function_main_at_Main: # Push arg into stack subu $sp, $sp, 4 sw $t2, 0($sp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 init + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_18 = VCALL local_main_at_Main_internal_17 init # Save new self pointer in $s1 - lw $s1, -68($fp) + lw $s1, -72($fp) # Get pointer to type lw $t2, 4($s1) # Get pointer to type's VTABLE @@ -8367,31 +8462,31 @@ function_main_at_Main: lw $t4, 36($t3) # Call function. Result is on $v0 jalr $t4 - sw $v0, -72($fp) + sw $v0, -76($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - lw $t2, -72($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + lw $t2, -76($fp) sw $t2, 28($s1) - # local_main_at_Main_internal_21 = GETATTRIBUTE cells Main - # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_22 = GETATTRIBUTE cells Main + # LOCAL local_main_at_Main_internal_22 --> -92($fp) lw $t2, 28($s1) - sw $t2, -88($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 - lw $t2, -88($fp) - sw $t2, -80($fp) + sw $t2, -92($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # local_main_at_Main_internal_20 = local_main_at_Main_internal_22 + lw $t2, -92($fp) + sw $t2, -84($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 print + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_21 = VCALL local_main_at_Main_internal_20 print # Save new self pointer in $s1 - lw $s1, -80($fp) + lw $s1, -84($fp) # Get pointer to type lw $t2, 4($s1) # Get pointer to type's VTABLE @@ -8400,7 +8495,7 @@ function_main_at_Main: lw $t4, 40($t3) # Call function. Result is on $v0 jalr $t4 - sw $v0, -84($fp) + sw $v0, -88($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 @@ -8409,22 +8504,22 @@ function_main_at_Main: # IF_ZERO local_main_at_Main_continue_0 GOTO label_WHILE_END_228 lw $t2, -4($fp) beq $t2, 0, label_WHILE_END_228 - # LOCAL local_main_at_Main_internal_25 --> -104($fp) - # local_main_at_Main_internal_25 = SELF - sw $s1, -104($fp) - # LOCAL local_main_at_Main_internal_23 --> -96($fp) - # LOCAL local_main_at_Main_internal_25 --> -104($fp) - # local_main_at_Main_internal_23 = local_main_at_Main_internal_25 - lw $t2, -104($fp) - sw $t2, -96($fp) + # LOCAL local_main_at_Main_internal_26 --> -108($fp) + # local_main_at_Main_internal_26 = SELF + sw $s1, -108($fp) + # LOCAL local_main_at_Main_internal_24 --> -100($fp) + # LOCAL local_main_at_Main_internal_26 --> -108($fp) + # local_main_at_Main_internal_24 = local_main_at_Main_internal_26 + lw $t2, -108($fp) + sw $t2, -100($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_23 --> -96($fp) # LOCAL local_main_at_Main_internal_24 --> -100($fp) - # local_main_at_Main_internal_24 = VCALL local_main_at_Main_internal_23 prompt + # LOCAL local_main_at_Main_internal_25 --> -104($fp) + # local_main_at_Main_internal_25 = VCALL local_main_at_Main_internal_24 prompt # Save new self pointer in $s1 - lw $s1, -96($fp) + lw $s1, -100($fp) # Get pointer to type lw $t2, 4($s1) # Get pointer to type's VTABLE @@ -8433,31 +8528,31 @@ function_main_at_Main: lw $t4, 100($t3) # Call function. Result is on $v0 jalr $t4 - sw $v0, -100($fp) + sw $v0, -104($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # IF_ZERO local_main_at_Main_internal_24 GOTO label_FALSEIF_229 - # IF_ZERO local_main_at_Main_internal_24 GOTO label_FALSEIF_229 - lw $t2, -100($fp) + # IF_ZERO local_main_at_Main_internal_25 GOTO label_FALSEIF_229 + # IF_ZERO local_main_at_Main_internal_25 GOTO label_FALSEIF_229 + lw $t2, -104($fp) beq $t2, 0, label_FALSEIF_229 - # local_main_at_Main_internal_28 = GETATTRIBUTE cells Main - # LOCAL local_main_at_Main_internal_28 --> -116($fp) + # local_main_at_Main_internal_29 = GETATTRIBUTE cells Main + # LOCAL local_main_at_Main_internal_29 --> -120($fp) lw $t2, 28($s1) - sw $t2, -116($fp) - # LOCAL local_main_at_Main_internal_26 --> -108($fp) - # LOCAL local_main_at_Main_internal_28 --> -116($fp) - # local_main_at_Main_internal_26 = local_main_at_Main_internal_28 - lw $t2, -116($fp) - sw $t2, -108($fp) + sw $t2, -120($fp) + # LOCAL local_main_at_Main_internal_27 --> -112($fp) + # LOCAL local_main_at_Main_internal_29 --> -120($fp) + # local_main_at_Main_internal_27 = local_main_at_Main_internal_29 + lw $t2, -120($fp) + sw $t2, -112($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_26 --> -108($fp) # LOCAL local_main_at_Main_internal_27 --> -112($fp) - # local_main_at_Main_internal_27 = VCALL local_main_at_Main_internal_26 evolve + # LOCAL local_main_at_Main_internal_28 --> -116($fp) + # local_main_at_Main_internal_28 = VCALL local_main_at_Main_internal_27 evolve # Save new self pointer in $s1 - lw $s1, -108($fp) + lw $s1, -112($fp) # Get pointer to type lw $t2, 4($s1) # Get pointer to type's VTABLE @@ -8466,27 +8561,27 @@ function_main_at_Main: lw $t4, 92($t3) # Call function. Result is on $v0 jalr $t4 - sw $v0, -112($fp) + sw $v0, -116($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # local_main_at_Main_internal_31 = GETATTRIBUTE cells Main - # LOCAL local_main_at_Main_internal_31 --> -128($fp) + # local_main_at_Main_internal_32 = GETATTRIBUTE cells Main + # LOCAL local_main_at_Main_internal_32 --> -132($fp) lw $t2, 28($s1) - sw $t2, -128($fp) - # LOCAL local_main_at_Main_internal_29 --> -120($fp) - # LOCAL local_main_at_Main_internal_31 --> -128($fp) - # local_main_at_Main_internal_29 = local_main_at_Main_internal_31 - lw $t2, -128($fp) - sw $t2, -120($fp) + sw $t2, -132($fp) + # LOCAL local_main_at_Main_internal_30 --> -124($fp) + # LOCAL local_main_at_Main_internal_32 --> -132($fp) + # local_main_at_Main_internal_30 = local_main_at_Main_internal_32 + lw $t2, -132($fp) + sw $t2, -124($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_29 --> -120($fp) # LOCAL local_main_at_Main_internal_30 --> -124($fp) - # local_main_at_Main_internal_30 = VCALL local_main_at_Main_internal_29 print + # LOCAL local_main_at_Main_internal_31 --> -128($fp) + # local_main_at_Main_internal_31 = VCALL local_main_at_Main_internal_30 print # Save new self pointer in $s1 - lw $s1, -120($fp) + lw $s1, -124($fp) # Get pointer to type lw $t2, 4($s1) # Get pointer to type's VTABLE @@ -8495,24 +8590,29 @@ function_main_at_Main: lw $t4, 40($t3) # Call function. Result is on $v0 jalr $t4 - sw $v0, -124($fp) + sw $v0, -128($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - # LOCAL local_main_at_Main_internal_30 --> -124($fp) - # local_main_at_Main_internal_22 = local_main_at_Main_internal_30 - lw $t2, -124($fp) - sw $t2, -92($fp) + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # LOCAL local_main_at_Main_internal_31 --> -128($fp) + # local_main_at_Main_internal_23 = local_main_at_Main_internal_31 + lw $t2, -128($fp) + sw $t2, -96($fp) # GOTO label_ENDIF_230 j label_ENDIF_230 label_FALSEIF_229: - # LOCAL local_main_at_Main_continue_0 --> -4($fp) - # local_main_at_Main_continue_0 = 0 + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # local_main_at_Main_internal_33 = 0 li $t2, 0 + sw $t2, -136($fp) + # LOCAL local_main_at_Main_continue_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # local_main_at_Main_continue_0 = local_main_at_Main_internal_33 + lw $t2, -136($fp) sw $t2, -4($fp) - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - # local_main_at_Main_internal_22 = + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # local_main_at_Main_internal_23 = label_ENDIF_230: # GOTO label_WHILE_227 j label_WHILE_227 @@ -8520,18 +8620,18 @@ label_WHILE_END_228: # GOTO label_WHILE_225 j label_WHILE_225 label_WHILE_END_226: - # LOCAL local_main_at_Main_internal_32 --> -132($fp) - # local_main_at_Main_internal_32 = SELF - sw $s1, -132($fp) - # RETURN local_main_at_Main_internal_32 - lw $v0, -132($fp) + # LOCAL local_main_at_Main_internal_34 --> -140($fp) + # local_main_at_Main_internal_34 = SELF + sw $s1, -140($fp) + # RETURN local_main_at_Main_internal_34 + lw $v0, -140($fp) # Deallocate stack frame for function function_main_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 140 + addu $sp, $sp, 148 jr $ra # Function END diff --git a/tests/codegen/list.mips b/tests/codegen/list.mips index 2dc05a30..80d3fb8c 100644 --- a/tests/codegen/list.mips +++ b/tests/codegen/list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:21 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:19 2020 # School of Math and Computer Science, University of Havana # @@ -51,7 +51,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String # Function END # @@ -367,7 +367,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -382,7 +382,7 @@ function_concat_at_String: lw $t0, 12($s1) # Get second string from param lw $t1, 12($v0) - addu $a0, $a0, 1 + addu $a0, $a0, 4 li $v0, 9 syscall move $t2, $v0 @@ -568,6 +568,10 @@ entry: li $t2, 24 sw $t2, 8($v0) move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 # Push register t1 into stack subu $sp, $sp, 4 sw $t1, 0($sp) @@ -576,6 +580,9 @@ entry: lw $t1, 0($sp) addu $sp, $sp, 4 sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) @@ -612,8 +619,12 @@ function_isNil_at_List: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN 1 - li $v0, 1 + # LOCAL local_isNil_at_List_internal_0 --> -4($fp) + # local_isNil_at_List_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + # RETURN local_isNil_at_List_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function function_isNil_at_List. # Restore $ra lw $ra, 4($sp) @@ -765,6 +776,10 @@ function_cons_at_List: li $t3, 20 sw $t3, 8($v0) move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 # Push register t2 into stack subu $sp, $sp, 4 sw $t2, 0($sp) @@ -781,6 +796,9 @@ function_cons_at_List: lw $t2, 0($sp) addu $sp, $sp, 4 sw $v0, 16($t2) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t2, -12($fp) # LOCAL local_cons_at_List_internal_0 --> -4($fp) # LOCAL local_cons_at_List_internal_2 --> -12($fp) @@ -887,8 +905,12 @@ function_isNil_at_Cons: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 + # LOCAL local_isNil_at_Cons_internal_0 --> -4($fp) + # local_isNil_at_Cons_internal_0 = 0 + li $t2, 0 + sw $t2, -4($fp) + # RETURN local_isNil_at_Cons_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function function_isNil_at_Cons. # Restore $ra lw $ra, 4($sp) @@ -1071,7 +1093,7 @@ function_print_list_at_Main: sw $t2, 8($v0) la $t2, data_2 sw $t2, 12($v0) - li $t2, 2 + li $t2, 1 sw $t2, 16($v0) sw $v0, -28($fp) # ARG local_print_list_at_Main_internal_6 @@ -1334,6 +1356,13 @@ function_main_at_Main: li $t4, 16 sw $t4, 8($v0) move $t3, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t3, -44($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # LOCAL local_main_at_Main_internal_10 --> -44($fp) diff --git a/tests/codegen/new_complex.mips b/tests/codegen/new_complex.mips index d29732f4..d8d5716b 100644 --- a/tests/codegen/new_complex.mips +++ b/tests/codegen/new_complex.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:19 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:17 2020 # School of Math and Computer Science, University of Havana # @@ -49,7 +49,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String # Function END # @@ -366,7 +366,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -381,7 +381,7 @@ function_concat_at_String: lw $t0, 12($s1) # Get second string from param lw $t1, 12($v0) - addu $a0, $a0, 1 + addu $a0, $a0, 4 li $v0, 9 syscall move $t2, $v0 @@ -567,6 +567,13 @@ entry: li $t2, 16 sw $t2, 8($v0) move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) @@ -633,6 +640,10 @@ function_main_at_Main: li $t3, 20 sw $t3, 8($v0) move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 # Push register t2 into stack subu $sp, $sp, 4 sw $t2, 0($sp) @@ -649,6 +660,9 @@ function_main_at_Main: lw $t2, 0($sp) addu $sp, $sp, 4 sw $v0, 16($t2) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t2, -4($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_3 = ALLOCATE Complex @@ -680,6 +694,10 @@ function_main_at_Main: li $t4, 20 sw $t4, 8($v0) move $t3, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 # Push register t3 into stack subu $sp, $sp, 4 sw $t3, 0($sp) @@ -696,6 +714,9 @@ function_main_at_Main: lw $t3, 0($sp) addu $sp, $sp, 4 sw $v0, 16($t3) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t3, -16($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) @@ -841,7 +862,7 @@ li $t3, 8 sw $t3, 8($v0) la $t3, data_2 sw $t3, 12($v0) -li $t3, 4 +li $t3, 3 sw $t3, 16($v0) sw $v0, -56($fp) # ARG local_main_at_Main_internal_13 @@ -901,7 +922,7 @@ label_FALSEIF_1: sw $t3, 8($v0) la $t3, data_3 sw $t3, 12($v0) - li $t3, 4 + li $t3, 3 sw $t3, 16($v0) sw $v0, -72($fp) # ARG local_main_at_Main_internal_17 @@ -1069,7 +1090,7 @@ li $t3, 8 sw $t3, 8($v0) la $t3, data_4 sw $t3, 12($v0) -li $t3, 4 +li $t3, 3 sw $t3, 16($v0) sw $v0, -124($fp) # ARG local_main_at_Main_internal_30 @@ -1129,7 +1150,7 @@ label_FALSEIF_5: sw $t3, 8($v0) la $t3, data_5 sw $t3, 12($v0) - li $t3, 4 + li $t3, 3 sw $t3, 16($v0) sw $v0, -140($fp) # ARG local_main_at_Main_internal_34 @@ -1799,10 +1820,10 @@ jr $ra # 0($fp) = param_equal_at_Complex_d_0 function_equal_at_Complex: # Allocate stack frame for function function_equal_at_Complex. - subu $sp, $sp, 48 + subu $sp, $sp, 60 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 48 + addu $fp, $sp, 60 # local_equal_at_Complex_internal_2 = GETATTRIBUTE x Complex # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) lw $t3, 12($s1) @@ -1917,16 +1938,26 @@ label_TRUE_29: # IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSEIF_27 lw $t3, -28($fp) beq $t3, 0, label_FALSEIF_27 -# LOCAL local_equal_at_Complex_internal_5 --> -24($fp) -# local_equal_at_Complex_internal_5 = 1 +# LOCAL local_equal_at_Complex_internal_10 --> -44($fp) +# local_equal_at_Complex_internal_10 = 1 li $t3, 1 +sw $t3, -44($fp) +# LOCAL local_equal_at_Complex_internal_5 --> -24($fp) +# LOCAL local_equal_at_Complex_internal_10 --> -44($fp) +# local_equal_at_Complex_internal_5 = local_equal_at_Complex_internal_10 +lw $t3, -44($fp) sw $t3, -24($fp) # GOTO label_ENDIF_28 j label_ENDIF_28 label_FALSEIF_27: - # LOCAL local_equal_at_Complex_internal_5 --> -24($fp) - # local_equal_at_Complex_internal_5 = 0 + # LOCAL local_equal_at_Complex_internal_11 --> -48($fp) + # local_equal_at_Complex_internal_11 = 0 li $t3, 0 + sw $t3, -48($fp) + # LOCAL local_equal_at_Complex_internal_5 --> -24($fp) + # LOCAL local_equal_at_Complex_internal_11 --> -48($fp) + # local_equal_at_Complex_internal_5 = local_equal_at_Complex_internal_11 + lw $t3, -48($fp) sw $t3, -24($fp) label_ENDIF_28: # LOCAL local_equal_at_Complex_internal_0 --> -4($fp) @@ -1937,9 +1968,14 @@ sw $t3, -4($fp) # GOTO label_ENDIF_24 j label_ENDIF_24 label_FALSEIF_23: - # LOCAL local_equal_at_Complex_internal_0 --> -4($fp) - # local_equal_at_Complex_internal_0 = 0 + # LOCAL local_equal_at_Complex_internal_12 --> -52($fp) + # local_equal_at_Complex_internal_12 = 0 li $t3, 0 + sw $t3, -52($fp) + # LOCAL local_equal_at_Complex_internal_0 --> -4($fp) + # LOCAL local_equal_at_Complex_internal_12 --> -52($fp) + # local_equal_at_Complex_internal_0 = local_equal_at_Complex_internal_12 + lw $t3, -52($fp) sw $t3, -4($fp) label_ENDIF_24: # RETURN local_equal_at_Complex_internal_0 @@ -1950,7 +1986,7 @@ lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 48 +addu $sp, $sp, 60 # Deallocate function args addu $sp, $sp, 4 jr $ra diff --git a/tests/codegen/palindrome.mips b/tests/codegen/palindrome.mips index 26386674..c69236d5 100644 --- a/tests/codegen/palindrome.mips +++ b/tests/codegen/palindrome.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:22 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:20 2020 # School of Math and Computer Science, University of Havana # @@ -47,7 +47,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String # Function END # @@ -337,7 +337,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -352,7 +352,7 @@ function_concat_at_String: lw $t0, 12($s1) # Get second string from param lw $t1, 12($v0) - addu $a0, $a0, 1 + addu $a0, $a0, 4 li $v0, 9 syscall move $t2, $v0 @@ -538,6 +538,10 @@ entry: li $t2, 16 sw $t2, 8($v0) move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 # Push register t1 into stack subu $sp, $sp, 4 sw $t1, 0($sp) @@ -546,6 +550,9 @@ entry: lw $t1, 0($sp) addu $sp, $sp, 4 sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) @@ -600,10 +607,10 @@ __Main__attrib__i__init: # 0($fp) = param_pal_at_Main_s_0 function_pal_at_Main: # Allocate stack frame for function function_pal_at_Main. - subu $sp, $sp, 108 + subu $sp, $sp, 120 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 108 + addu $fp, $sp, 120 # LOCAL local_pal_at_Main_internal_2 --> -12($fp) # PARAM param_pal_at_Main_s_0 --> 0($fp) # local_pal_at_Main_internal_2 = PARAM param_pal_at_Main_s_0 @@ -622,7 +629,7 @@ function_pal_at_Main: # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 8($t2) + lw $t3, 20($t2) # Call function. Result is on $v0 jalr $t3 sw $v0, -16($fp) @@ -655,76 +662,86 @@ label_TRUE_3: # IF_ZERO local_pal_at_Main_internal_1 GOTO label_FALSEIF_1 lw $t1, -8($fp) beq $t1, 0, label_FALSEIF_1 -# LOCAL local_pal_at_Main_internal_0 --> -4($fp) -# local_pal_at_Main_internal_0 = 1 +# LOCAL local_pal_at_Main_internal_4 --> -20($fp) +# local_pal_at_Main_internal_4 = 1 li $t1, 1 +sw $t1, -20($fp) +# LOCAL local_pal_at_Main_internal_0 --> -4($fp) +# LOCAL local_pal_at_Main_internal_4 --> -20($fp) +# local_pal_at_Main_internal_0 = local_pal_at_Main_internal_4 +lw $t1, -20($fp) sw $t1, -4($fp) # GOTO label_ENDIF_2 j label_ENDIF_2 label_FALSEIF_1: - # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + # LOCAL local_pal_at_Main_internal_7 --> -32($fp) # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_6 = PARAM param_pal_at_Main_s_0 + # local_pal_at_Main_internal_7 = PARAM param_pal_at_Main_s_0 lw $t1, 0($fp) - sw $t1, -28($fp) + sw $t1, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_6 --> -28($fp) # LOCAL local_pal_at_Main_internal_7 --> -32($fp) - # local_pal_at_Main_internal_7 = VCALL local_pal_at_Main_internal_6 length + # LOCAL local_pal_at_Main_internal_8 --> -36($fp) + # local_pal_at_Main_internal_8 = VCALL local_pal_at_Main_internal_7 length # Save new self pointer in $s1 - lw $s1, -28($fp) + lw $s1, -32($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 8($t2) + lw $t3, 20($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -32($fp) + sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_5 --> -24($fp) - # LOCAL local_pal_at_Main_internal_7 --> -32($fp) - # local_pal_at_Main_internal_5 = local_pal_at_Main_internal_7 - 1 - lw $t1, -32($fp) + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + # LOCAL local_pal_at_Main_internal_8 --> -36($fp) + # local_pal_at_Main_internal_6 = local_pal_at_Main_internal_8 - 1 + lw $t1, -36($fp) sub $t1, $t1, 1 - sw $t1, -24($fp) - # IF_ZERO local_pal_at_Main_internal_5 GOTO label_TRUE_7 - # IF_ZERO local_pal_at_Main_internal_5 GOTO label_TRUE_7 - lw $t1, -24($fp) + sw $t1, -28($fp) + # IF_ZERO local_pal_at_Main_internal_6 GOTO label_TRUE_7 + # IF_ZERO local_pal_at_Main_internal_6 GOTO label_TRUE_7 + lw $t1, -28($fp) beq $t1, 0, label_TRUE_7 - # LOCAL local_pal_at_Main_internal_5 --> -24($fp) - # local_pal_at_Main_internal_5 = 0 + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + # local_pal_at_Main_internal_6 = 0 li $t1, 0 - sw $t1, -24($fp) + sw $t1, -28($fp) # GOTO label_END_8 j label_END_8 label_TRUE_7: - # LOCAL local_pal_at_Main_internal_5 --> -24($fp) - # local_pal_at_Main_internal_5 = 1 + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + # local_pal_at_Main_internal_6 = 1 li $t1, 1 - sw $t1, -24($fp) + sw $t1, -28($fp) label_END_8: -# IF_ZERO local_pal_at_Main_internal_5 GOTO label_FALSEIF_5 -# IF_ZERO local_pal_at_Main_internal_5 GOTO label_FALSEIF_5 -lw $t1, -24($fp) +# IF_ZERO local_pal_at_Main_internal_6 GOTO label_FALSEIF_5 +# IF_ZERO local_pal_at_Main_internal_6 GOTO label_FALSEIF_5 +lw $t1, -28($fp) beq $t1, 0, label_FALSEIF_5 -# LOCAL local_pal_at_Main_internal_4 --> -20($fp) -# local_pal_at_Main_internal_4 = 1 +# LOCAL local_pal_at_Main_internal_9 --> -40($fp) +# local_pal_at_Main_internal_9 = 1 li $t1, 1 -sw $t1, -20($fp) +sw $t1, -40($fp) +# LOCAL local_pal_at_Main_internal_5 --> -24($fp) +# LOCAL local_pal_at_Main_internal_9 --> -40($fp) +# local_pal_at_Main_internal_5 = local_pal_at_Main_internal_9 +lw $t1, -40($fp) +sw $t1, -24($fp) # GOTO label_ENDIF_6 j label_ENDIF_6 label_FALSEIF_5: - # LOCAL local_pal_at_Main_internal_10 --> -44($fp) + # LOCAL local_pal_at_Main_internal_12 --> -52($fp) # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_10 = PARAM param_pal_at_Main_s_0 + # local_pal_at_Main_internal_12 = PARAM param_pal_at_Main_s_0 lw $t1, 0($fp) - sw $t1, -44($fp) + sw $t1, -52($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -738,65 +755,65 @@ label_FALSEIF_5: # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) - # LOCAL local_pal_at_Main_internal_10 --> -44($fp) - # LOCAL local_pal_at_Main_internal_11 --> -48($fp) - # local_pal_at_Main_internal_11 = VCALL local_pal_at_Main_internal_10 substr + # LOCAL local_pal_at_Main_internal_12 --> -52($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # local_pal_at_Main_internal_13 = VCALL local_pal_at_Main_internal_12 substr # Save new self pointer in $s1 - lw $s1, -44($fp) + lw $s1, -52($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 4($t2) + lw $t3, 16($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -48($fp) + sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_12 --> -52($fp) + # LOCAL local_pal_at_Main_internal_14 --> -60($fp) # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_12 = PARAM param_pal_at_Main_s_0 + # local_pal_at_Main_internal_14 = PARAM param_pal_at_Main_s_0 lw $t1, 0($fp) - sw $t1, -52($fp) + sw $t1, -60($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_15 --> -64($fp) + # LOCAL local_pal_at_Main_internal_17 --> -72($fp) # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_15 = PARAM param_pal_at_Main_s_0 + # local_pal_at_Main_internal_17 = PARAM param_pal_at_Main_s_0 lw $t1, 0($fp) - sw $t1, -64($fp) + sw $t1, -72($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_15 --> -64($fp) - # LOCAL local_pal_at_Main_internal_16 --> -68($fp) - # local_pal_at_Main_internal_16 = VCALL local_pal_at_Main_internal_15 length + # LOCAL local_pal_at_Main_internal_17 --> -72($fp) + # LOCAL local_pal_at_Main_internal_18 --> -76($fp) + # local_pal_at_Main_internal_18 = VCALL local_pal_at_Main_internal_17 length # Save new self pointer in $s1 - lw $s1, -64($fp) + lw $s1, -72($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 8($t2) + lw $t3, 20($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -68($fp) + sw $v0, -76($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_14 --> -60($fp) # LOCAL local_pal_at_Main_internal_16 --> -68($fp) - # local_pal_at_Main_internal_14 = local_pal_at_Main_internal_16 - 1 - lw $t1, -68($fp) + # LOCAL local_pal_at_Main_internal_18 --> -76($fp) + # local_pal_at_Main_internal_16 = local_pal_at_Main_internal_18 - 1 + lw $t1, -76($fp) sub $t1, $t1, 1 - sw $t1, -60($fp) - # ARG local_pal_at_Main_internal_14 - # LOCAL local_pal_at_Main_internal_14 --> -60($fp) - lw $t1, -60($fp) + sw $t1, -68($fp) + # ARG local_pal_at_Main_internal_16 + # LOCAL local_pal_at_Main_internal_16 --> -68($fp) + lw $t1, -68($fp) # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) @@ -805,67 +822,67 @@ label_FALSEIF_5: # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) - # LOCAL local_pal_at_Main_internal_12 --> -52($fp) - # LOCAL local_pal_at_Main_internal_13 --> -56($fp) - # local_pal_at_Main_internal_13 = VCALL local_pal_at_Main_internal_12 substr + # LOCAL local_pal_at_Main_internal_14 --> -60($fp) + # LOCAL local_pal_at_Main_internal_15 --> -64($fp) + # local_pal_at_Main_internal_15 = VCALL local_pal_at_Main_internal_14 substr # Save new self pointer in $s1 - lw $s1, -52($fp) + lw $s1, -60($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address - lw $t3, 4($t2) + lw $t3, 16($t2) # Call function. Result is on $v0 jalr $t3 - sw $v0, -56($fp) + sw $v0, -64($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_9 --> -40($fp) # LOCAL local_pal_at_Main_internal_11 --> -48($fp) # LOCAL local_pal_at_Main_internal_13 --> -56($fp) - # local_pal_at_Main_internal_9 = local_pal_at_Main_internal_11 - local_pal_at_Main_internal_13 - lw $t1, -48($fp) - lw $t2, -56($fp) + # LOCAL local_pal_at_Main_internal_15 --> -64($fp) + # local_pal_at_Main_internal_11 = local_pal_at_Main_internal_13 - local_pal_at_Main_internal_15 + lw $t1, -56($fp) + lw $t2, -64($fp) sub $t1, $t1, $t2 - sw $t1, -40($fp) - # IF_ZERO local_pal_at_Main_internal_9 GOTO label_TRUE_11 - # IF_ZERO local_pal_at_Main_internal_9 GOTO label_TRUE_11 - lw $t1, -40($fp) + sw $t1, -48($fp) + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_11 + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_11 + lw $t1, -48($fp) beq $t1, 0, label_TRUE_11 - # LOCAL local_pal_at_Main_internal_9 --> -40($fp) - # local_pal_at_Main_internal_9 = 0 + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # local_pal_at_Main_internal_11 = 0 li $t1, 0 - sw $t1, -40($fp) + sw $t1, -48($fp) # GOTO label_END_12 j label_END_12 label_TRUE_11: - # LOCAL local_pal_at_Main_internal_9 --> -40($fp) - # local_pal_at_Main_internal_9 = 1 + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # local_pal_at_Main_internal_11 = 1 li $t1, 1 - sw $t1, -40($fp) + sw $t1, -48($fp) label_END_12: -# IF_ZERO local_pal_at_Main_internal_9 GOTO label_FALSEIF_9 -# IF_ZERO local_pal_at_Main_internal_9 GOTO label_FALSEIF_9 -lw $t1, -40($fp) +# IF_ZERO local_pal_at_Main_internal_11 GOTO label_FALSEIF_9 +# IF_ZERO local_pal_at_Main_internal_11 GOTO label_FALSEIF_9 +lw $t1, -48($fp) beq $t1, 0, label_FALSEIF_9 +# LOCAL local_pal_at_Main_internal_21 --> -88($fp) +# local_pal_at_Main_internal_21 = SELF +sw $s1, -88($fp) # LOCAL local_pal_at_Main_internal_19 --> -80($fp) -# local_pal_at_Main_internal_19 = SELF -sw $s1, -80($fp) -# LOCAL local_pal_at_Main_internal_17 --> -72($fp) -# LOCAL local_pal_at_Main_internal_19 --> -80($fp) -# local_pal_at_Main_internal_17 = local_pal_at_Main_internal_19 -lw $t1, -80($fp) -sw $t1, -72($fp) +# LOCAL local_pal_at_Main_internal_21 --> -88($fp) +# local_pal_at_Main_internal_19 = local_pal_at_Main_internal_21 +lw $t1, -88($fp) +sw $t1, -80($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_pal_at_Main_internal_20 --> -84($fp) +# LOCAL local_pal_at_Main_internal_22 --> -92($fp) # PARAM param_pal_at_Main_s_0 --> 0($fp) -# local_pal_at_Main_internal_20 = PARAM param_pal_at_Main_s_0 +# local_pal_at_Main_internal_22 = PARAM param_pal_at_Main_s_0 lw $t1, 0($fp) -sw $t1, -84($fp) +sw $t1, -92($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -874,71 +891,71 @@ li $t1, 1 # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) -# LOCAL local_pal_at_Main_internal_23 --> -96($fp) +# LOCAL local_pal_at_Main_internal_25 --> -104($fp) # PARAM param_pal_at_Main_s_0 --> 0($fp) -# local_pal_at_Main_internal_23 = PARAM param_pal_at_Main_s_0 +# local_pal_at_Main_internal_25 = PARAM param_pal_at_Main_s_0 lw $t1, 0($fp) -sw $t1, -96($fp) +sw $t1, -104($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_pal_at_Main_internal_23 --> -96($fp) -# LOCAL local_pal_at_Main_internal_24 --> -100($fp) -# local_pal_at_Main_internal_24 = VCALL local_pal_at_Main_internal_23 length +# LOCAL local_pal_at_Main_internal_25 --> -104($fp) +# LOCAL local_pal_at_Main_internal_26 --> -108($fp) +# local_pal_at_Main_internal_26 = VCALL local_pal_at_Main_internal_25 length # Save new self pointer in $s1 -lw $s1, -96($fp) +lw $s1, -104($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address -lw $t3, 8($t2) +lw $t3, 20($t2) # Call function. Result is on $v0 jalr $t3 -sw $v0, -100($fp) +sw $v0, -108($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_pal_at_Main_internal_22 --> -92($fp) # LOCAL local_pal_at_Main_internal_24 --> -100($fp) -# local_pal_at_Main_internal_22 = local_pal_at_Main_internal_24 - 2 -lw $t1, -100($fp) +# LOCAL local_pal_at_Main_internal_26 --> -108($fp) +# local_pal_at_Main_internal_24 = local_pal_at_Main_internal_26 - 2 +lw $t1, -108($fp) sub $t1, $t1, 2 -sw $t1, -92($fp) -# ARG local_pal_at_Main_internal_22 -# LOCAL local_pal_at_Main_internal_22 --> -92($fp) -lw $t1, -92($fp) +sw $t1, -100($fp) +# ARG local_pal_at_Main_internal_24 +# LOCAL local_pal_at_Main_internal_24 --> -100($fp) +lw $t1, -100($fp) # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) -# LOCAL local_pal_at_Main_internal_20 --> -84($fp) -# LOCAL local_pal_at_Main_internal_21 --> -88($fp) -# local_pal_at_Main_internal_21 = VCALL local_pal_at_Main_internal_20 substr +# LOCAL local_pal_at_Main_internal_22 --> -92($fp) +# LOCAL local_pal_at_Main_internal_23 --> -96($fp) +# local_pal_at_Main_internal_23 = VCALL local_pal_at_Main_internal_22 substr # Save new self pointer in $s1 -lw $s1, -84($fp) +lw $s1, -92($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE lw $t2, 0($t1) # Get pointer to function address -lw $t3, 4($t2) +lw $t3, 16($t2) # Call function. Result is on $v0 jalr $t3 -sw $v0, -88($fp) +sw $v0, -96($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# ARG local_pal_at_Main_internal_21 -# LOCAL local_pal_at_Main_internal_21 --> -88($fp) -lw $t1, -88($fp) +# ARG local_pal_at_Main_internal_23 +# LOCAL local_pal_at_Main_internal_23 --> -96($fp) +lw $t1, -96($fp) # Push arg into stack subu $sp, $sp, 4 sw $t1, 0($sp) -# LOCAL local_pal_at_Main_internal_17 --> -72($fp) -# LOCAL local_pal_at_Main_internal_18 --> -76($fp) -# local_pal_at_Main_internal_18 = VCALL local_pal_at_Main_internal_17 pal +# LOCAL local_pal_at_Main_internal_19 --> -80($fp) +# LOCAL local_pal_at_Main_internal_20 --> -84($fp) +# local_pal_at_Main_internal_20 = VCALL local_pal_at_Main_internal_19 pal # Save new self pointer in $s1 -lw $s1, -72($fp) +lw $s1, -80($fp) # Get pointer to type lw $t1, 4($s1) # Get pointer to type's VTABLE @@ -947,33 +964,38 @@ lw $t2, 0($t1) lw $t3, 28($t2) # Call function. Result is on $v0 jalr $t3 -sw $v0, -76($fp) +sw $v0, -84($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_pal_at_Main_internal_8 --> -36($fp) -# LOCAL local_pal_at_Main_internal_18 --> -76($fp) -# local_pal_at_Main_internal_8 = local_pal_at_Main_internal_18 -lw $t1, -76($fp) -sw $t1, -36($fp) +# LOCAL local_pal_at_Main_internal_10 --> -44($fp) +# LOCAL local_pal_at_Main_internal_20 --> -84($fp) +# local_pal_at_Main_internal_10 = local_pal_at_Main_internal_20 +lw $t1, -84($fp) +sw $t1, -44($fp) # GOTO label_ENDIF_10 j label_ENDIF_10 label_FALSEIF_9: - # LOCAL local_pal_at_Main_internal_8 --> -36($fp) - # local_pal_at_Main_internal_8 = 0 + # LOCAL local_pal_at_Main_internal_27 --> -112($fp) + # local_pal_at_Main_internal_27 = 0 li $t1, 0 - sw $t1, -36($fp) + sw $t1, -112($fp) + # LOCAL local_pal_at_Main_internal_10 --> -44($fp) + # LOCAL local_pal_at_Main_internal_27 --> -112($fp) + # local_pal_at_Main_internal_10 = local_pal_at_Main_internal_27 + lw $t1, -112($fp) + sw $t1, -44($fp) label_ENDIF_10: -# LOCAL local_pal_at_Main_internal_4 --> -20($fp) -# LOCAL local_pal_at_Main_internal_8 --> -36($fp) -# local_pal_at_Main_internal_4 = local_pal_at_Main_internal_8 -lw $t1, -36($fp) -sw $t1, -20($fp) +# LOCAL local_pal_at_Main_internal_5 --> -24($fp) +# LOCAL local_pal_at_Main_internal_10 --> -44($fp) +# local_pal_at_Main_internal_5 = local_pal_at_Main_internal_10 +lw $t1, -44($fp) +sw $t1, -24($fp) label_ENDIF_6: # LOCAL local_pal_at_Main_internal_0 --> -4($fp) -# LOCAL local_pal_at_Main_internal_4 --> -20($fp) -# local_pal_at_Main_internal_0 = local_pal_at_Main_internal_4 -lw $t1, -20($fp) +# LOCAL local_pal_at_Main_internal_5 --> -24($fp) +# local_pal_at_Main_internal_0 = local_pal_at_Main_internal_5 +lw $t1, -24($fp) sw $t1, -4($fp) label_ENDIF_2: # RETURN local_pal_at_Main_internal_0 @@ -984,7 +1006,7 @@ lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 108 +addu $sp, $sp, 120 # Deallocate function args addu $sp, $sp, 4 jr $ra @@ -1033,7 +1055,7 @@ function_main_at_Main: sw $t1, 8($v0) la $t1, data_2 sw $t1, 12($v0) - li $t1, 16 + li $t1, 15 sw $t1, 16($v0) sw $v0, -20($fp) # ARG local_main_at_Main_internal_4 @@ -1151,7 +1173,7 @@ function_main_at_Main: sw $t1, 8($v0) la $t1, data_3 sw $t1, 12($v0) - li $t1, 23 + li $t1, 22 sw $t1, 16($v0) sw $v0, -64($fp) # ARG local_main_at_Main_internal_15 @@ -1211,7 +1233,7 @@ label_FALSEIF_13: sw $t1, 8($v0) la $t1, data_4 sw $t1, 12($v0) - li $t1, 27 + li $t1, 26 sw $t1, 16($v0) sw $v0, -80($fp) # ARG local_main_at_Main_internal_19 diff --git a/tests/codegen/primes.mips b/tests/codegen/primes.mips new file mode 100644 index 00000000..e203556e --- /dev/null +++ b/tests/codegen/primes.mips @@ -0,0 +1,1282 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:17 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +IO__TDT: .word 0, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, 0 +# + + +data_2: .asciiz "2 is trivially prime.\n" +# + + +data_3: .asciiz " is prime.\n" +# + + +data_4: .asciiz "halt" +# + + +data_5: .asciiz "continue" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + li $a0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 32 bytes of memory + li $a0, 32 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__out__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__testee__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__divisor__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__stop__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__m__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 28($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__out__init implementation. +# @Params: +__Main__attrib__out__init: + # Allocate stack frame for function __Main__attrib__out__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__out__init_internal_2 --> -12($fp) + # local_ttrib__out__init_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_ttrib__out__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__out__init_internal_2 --> -12($fp) + # local_ttrib__out__init_internal_0 = local_ttrib__out__init_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__out__init_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_2 + sw $t1, 12($v0) + li $t1, 22 + sw $t1, 16($v0) + sw $v0, -16($fp) + # ARG local_ttrib__out__init_internal_3 + # LOCAL local_ttrib__out__init_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_ttrib__out__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__out__init_internal_1 --> -8($fp) + # local_ttrib__out__init_internal_1 = VCALL local_ttrib__out__init_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN 2 + li $v0, 2 + # Deallocate stack frame for function __Main__attrib__out__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__testee__init implementation. +# @Params: +__Main__attrib__testee__init: + # Allocate stack frame for function __Main__attrib__testee__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_ttrib__testee__init_internal_0 = GETATTRIBUTE out Main + # LOCAL local_ttrib__testee__init_internal_0 --> -4($fp) + lw $t1, 12($s1) + sw $t1, -4($fp) + # RETURN local_ttrib__testee__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__testee__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__divisor__init implementation. +# @Params: +__Main__attrib__divisor__init: + # Allocate stack frame for function __Main__attrib__divisor__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__divisor__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__stop__init implementation. +# @Params: +__Main__attrib__stop__init: + # Allocate stack frame for function __Main__attrib__stop__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 500 + li $v0, 500 + # Deallocate stack frame for function __Main__attrib__stop__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__m__init implementation. +# @Params: +__Main__attrib__m__init: + # Allocate stack frame for function __Main__attrib__m__init. + subu $sp, $sp, 192 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 192 + label_WHILE_1: + # LOCAL local_ttrib__m__init_internal_0 --> -4($fp) + # local_ttrib__m__init_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + # IF_ZERO local_ttrib__m__init_internal_0 GOTO label_WHILE_END_2 + # IF_ZERO local_ttrib__m__init_internal_0 GOTO label_WHILE_END_2 + lw $t1, -4($fp) + beq $t1, 0, label_WHILE_END_2 + # local_ttrib__m__init_internal_2 = GETATTRIBUTE testee Main + # LOCAL local_ttrib__m__init_internal_2 --> -12($fp) + lw $t1, 16($s1) + sw $t1, -12($fp) + # LOCAL local_ttrib__m__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__m__init_internal_2 --> -12($fp) + # local_ttrib__m__init_internal_1 = local_ttrib__m__init_internal_2 + 1 + lw $t1, -12($fp) + add $t1, $t1, 1 + sw $t1, -8($fp) + # + # LOCAL local_ttrib__m__init_internal_1 --> -8($fp) + lw $t1, -8($fp) + sw $t1, 16($s1) + # + li $t1, 2 + sw $t1, 20($s1) + label_WHILE_3: + # local_ttrib__m__init_internal_5 = GETATTRIBUTE testee Main + # LOCAL local_ttrib__m__init_internal_5 --> -24($fp) + lw $t1, 16($s1) + sw $t1, -24($fp) + # local_ttrib__m__init_internal_7 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_7 --> -32($fp) + lw $t1, 20($s1) + sw $t1, -32($fp) + # local_ttrib__m__init_internal_8 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_8 --> -36($fp) + lw $t1, 20($s1) + sw $t1, -36($fp) + # LOCAL local_ttrib__m__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__m__init_internal_7 --> -32($fp) + # LOCAL local_ttrib__m__init_internal_8 --> -36($fp) + # local_ttrib__m__init_internal_6 = local_ttrib__m__init_internal_7 * local_ttrib__m__init_internal_8 + lw $t1, -32($fp) + lw $t2, -36($fp) + mul $t1, $t1, $t2 + sw $t1, -28($fp) + # LOCAL local_ttrib__m__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__m__init_internal_5 --> -24($fp) + # LOCAL local_ttrib__m__init_internal_6 --> -28($fp) + # local_ttrib__m__init_internal_4 = local_ttrib__m__init_internal_5 - local_ttrib__m__init_internal_6 + lw $t1, -24($fp) + lw $t2, -28($fp) + sub $t1, $t1, $t2 + sw $t1, -20($fp) + # IF_GREATER_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSE_7 + # IF_GREATER_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSE_7 + lw $t1, -20($fp) + bgt $t1, 0, label_FALSE_7 + # IF_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSE_7 + # IF_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSE_7 + lw $t1, -20($fp) + beq $t1, 0, label_FALSE_7 + # LOCAL local_ttrib__m__init_internal_4 --> -20($fp) + # local_ttrib__m__init_internal_4 = 1 + li $t1, 1 + sw $t1, -20($fp) + # GOTO label_END_8 +j label_END_8 +label_FALSE_7: + # LOCAL local_ttrib__m__init_internal_4 --> -20($fp) + # local_ttrib__m__init_internal_4 = 0 + li $t1, 0 + sw $t1, -20($fp) + label_END_8: +# IF_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSEIF_5 +# IF_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSEIF_5 +lw $t1, -20($fp) +beq $t1, 0, label_FALSEIF_5 +# LOCAL local_ttrib__m__init_internal_9 --> -40($fp) +# local_ttrib__m__init_internal_9 = 0 +li $t1, 0 +sw $t1, -40($fp) +# LOCAL local_ttrib__m__init_internal_3 --> -16($fp) +# LOCAL local_ttrib__m__init_internal_9 --> -40($fp) +# local_ttrib__m__init_internal_3 = local_ttrib__m__init_internal_9 +lw $t1, -40($fp) +sw $t1, -16($fp) +# GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # local_ttrib__m__init_internal_13 = GETATTRIBUTE testee Main + # LOCAL local_ttrib__m__init_internal_13 --> -56($fp) + lw $t1, 16($s1) + sw $t1, -56($fp) + # local_ttrib__m__init_internal_15 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_15 --> -64($fp) + lw $t1, 20($s1) + sw $t1, -64($fp) + # local_ttrib__m__init_internal_17 = GETATTRIBUTE testee Main + # LOCAL local_ttrib__m__init_internal_17 --> -72($fp) + lw $t1, 16($s1) + sw $t1, -72($fp) + # local_ttrib__m__init_internal_18 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_18 --> -76($fp) + lw $t1, 20($s1) + sw $t1, -76($fp) + # LOCAL local_ttrib__m__init_internal_16 --> -68($fp) + # LOCAL local_ttrib__m__init_internal_17 --> -72($fp) + # LOCAL local_ttrib__m__init_internal_18 --> -76($fp) + # local_ttrib__m__init_internal_16 = local_ttrib__m__init_internal_17 / local_ttrib__m__init_internal_18 + lw $t1, -72($fp) + lw $t2, -76($fp) + div $t1, $t1, $t2 + sw $t1, -68($fp) + # LOCAL local_ttrib__m__init_internal_14 --> -60($fp) + # LOCAL local_ttrib__m__init_internal_15 --> -64($fp) + # LOCAL local_ttrib__m__init_internal_16 --> -68($fp) + # local_ttrib__m__init_internal_14 = local_ttrib__m__init_internal_15 * local_ttrib__m__init_internal_16 + lw $t1, -64($fp) + lw $t2, -68($fp) + mul $t1, $t1, $t2 + sw $t1, -60($fp) + # LOCAL local_ttrib__m__init_internal_12 --> -52($fp) + # LOCAL local_ttrib__m__init_internal_13 --> -56($fp) + # LOCAL local_ttrib__m__init_internal_14 --> -60($fp) + # local_ttrib__m__init_internal_12 = local_ttrib__m__init_internal_13 - local_ttrib__m__init_internal_14 + lw $t1, -56($fp) + lw $t2, -60($fp) + sub $t1, $t1, $t2 + sw $t1, -52($fp) + # LOCAL local_ttrib__m__init_internal_11 --> -48($fp) + # LOCAL local_ttrib__m__init_internal_12 --> -52($fp) + # local_ttrib__m__init_internal_11 = local_ttrib__m__init_internal_12 - 0 + lw $t1, -52($fp) + sub $t1, $t1, 0 + sw $t1, -48($fp) + # IF_ZERO local_ttrib__m__init_internal_11 GOTO label_TRUE_11 + # IF_ZERO local_ttrib__m__init_internal_11 GOTO label_TRUE_11 + lw $t1, -48($fp) + beq $t1, 0, label_TRUE_11 + # LOCAL local_ttrib__m__init_internal_11 --> -48($fp) + # local_ttrib__m__init_internal_11 = 0 + li $t1, 0 + sw $t1, -48($fp) + # GOTO label_END_12 +j label_END_12 +label_TRUE_11: + # LOCAL local_ttrib__m__init_internal_11 --> -48($fp) + # local_ttrib__m__init_internal_11 = 1 + li $t1, 1 + sw $t1, -48($fp) + label_END_12: +# IF_ZERO local_ttrib__m__init_internal_11 GOTO label_FALSEIF_9 +# IF_ZERO local_ttrib__m__init_internal_11 GOTO label_FALSEIF_9 +lw $t1, -48($fp) +beq $t1, 0, label_FALSEIF_9 +# LOCAL local_ttrib__m__init_internal_19 --> -80($fp) +# local_ttrib__m__init_internal_19 = 0 +li $t1, 0 +sw $t1, -80($fp) +# LOCAL local_ttrib__m__init_internal_10 --> -44($fp) +# LOCAL local_ttrib__m__init_internal_19 --> -80($fp) +# local_ttrib__m__init_internal_10 = local_ttrib__m__init_internal_19 +lw $t1, -80($fp) +sw $t1, -44($fp) +# GOTO label_ENDIF_10 +j label_ENDIF_10 +label_FALSEIF_9: + # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) + # local_ttrib__m__init_internal_20 = 1 + li $t1, 1 + sw $t1, -84($fp) + # LOCAL local_ttrib__m__init_internal_10 --> -44($fp) + # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) + # local_ttrib__m__init_internal_10 = local_ttrib__m__init_internal_20 + lw $t1, -84($fp) + sw $t1, -44($fp) + label_ENDIF_10: +# LOCAL local_ttrib__m__init_internal_3 --> -16($fp) +# LOCAL local_ttrib__m__init_internal_10 --> -44($fp) +# local_ttrib__m__init_internal_3 = local_ttrib__m__init_internal_10 +lw $t1, -44($fp) +sw $t1, -16($fp) +label_ENDIF_6: +# IF_ZERO local_ttrib__m__init_internal_3 GOTO label_WHILE_END_4 +# IF_ZERO local_ttrib__m__init_internal_3 GOTO label_WHILE_END_4 +lw $t1, -16($fp) +beq $t1, 0, label_WHILE_END_4 +# local_ttrib__m__init_internal_22 = GETATTRIBUTE divisor Main +# LOCAL local_ttrib__m__init_internal_22 --> -92($fp) +lw $t1, 20($s1) +sw $t1, -92($fp) +# LOCAL local_ttrib__m__init_internal_21 --> -88($fp) +# LOCAL local_ttrib__m__init_internal_22 --> -92($fp) +# local_ttrib__m__init_internal_21 = local_ttrib__m__init_internal_22 + 1 +lw $t1, -92($fp) +add $t1, $t1, 1 +sw $t1, -88($fp) +# +# LOCAL local_ttrib__m__init_internal_21 --> -88($fp) +lw $t1, -88($fp) +sw $t1, 20($s1) +# GOTO label_WHILE_3 +j label_WHILE_3 +label_WHILE_END_4: + # local_ttrib__m__init_internal_25 = GETATTRIBUTE testee Main + # LOCAL local_ttrib__m__init_internal_25 --> -104($fp) + lw $t1, 16($s1) + sw $t1, -104($fp) + # local_ttrib__m__init_internal_27 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) + lw $t1, 20($s1) + sw $t1, -112($fp) + # local_ttrib__m__init_internal_28 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_28 --> -116($fp) + lw $t1, 20($s1) + sw $t1, -116($fp) + # LOCAL local_ttrib__m__init_internal_26 --> -108($fp) + # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) + # LOCAL local_ttrib__m__init_internal_28 --> -116($fp) + # local_ttrib__m__init_internal_26 = local_ttrib__m__init_internal_27 * local_ttrib__m__init_internal_28 + lw $t1, -112($fp) + lw $t2, -116($fp) + mul $t1, $t1, $t2 + sw $t1, -108($fp) + # LOCAL local_ttrib__m__init_internal_24 --> -100($fp) + # LOCAL local_ttrib__m__init_internal_25 --> -104($fp) + # LOCAL local_ttrib__m__init_internal_26 --> -108($fp) + # local_ttrib__m__init_internal_24 = local_ttrib__m__init_internal_25 - local_ttrib__m__init_internal_26 + lw $t1, -104($fp) + lw $t2, -108($fp) + sub $t1, $t1, $t2 + sw $t1, -100($fp) + # IF_GREATER_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSE_15 + # IF_GREATER_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSE_15 + lw $t1, -100($fp) + bgt $t1, 0, label_FALSE_15 + # IF_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSE_15 + # IF_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSE_15 + lw $t1, -100($fp) + beq $t1, 0, label_FALSE_15 + # LOCAL local_ttrib__m__init_internal_24 --> -100($fp) + # local_ttrib__m__init_internal_24 = 1 + li $t1, 1 + sw $t1, -100($fp) + # GOTO label_END_16 +j label_END_16 +label_FALSE_15: + # LOCAL local_ttrib__m__init_internal_24 --> -100($fp) + # local_ttrib__m__init_internal_24 = 0 + li $t1, 0 + sw $t1, -100($fp) + label_END_16: +# IF_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSEIF_13 +# IF_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSEIF_13 +lw $t1, -100($fp) +beq $t1, 0, label_FALSEIF_13 +# local_ttrib__m__init_internal_29 = GETATTRIBUTE testee Main +# LOCAL local_ttrib__m__init_internal_29 --> -120($fp) +lw $t1, 16($s1) +sw $t1, -120($fp) +# +# LOCAL local_ttrib__m__init_internal_29 --> -120($fp) +lw $t1, -120($fp) +sw $t1, 12($s1) +# LOCAL local_ttrib__m__init_internal_32 --> -132($fp) +# local_ttrib__m__init_internal_32 = SELF +sw $s1, -132($fp) +# LOCAL local_ttrib__m__init_internal_30 --> -124($fp) +# LOCAL local_ttrib__m__init_internal_32 --> -132($fp) +# local_ttrib__m__init_internal_30 = local_ttrib__m__init_internal_32 +lw $t1, -132($fp) +sw $t1, -124($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_ttrib__m__init_internal_33 = GETATTRIBUTE out Main +# LOCAL local_ttrib__m__init_internal_33 --> -136($fp) +lw $t1, 12($s1) +sw $t1, -136($fp) +# ARG local_ttrib__m__init_internal_33 +# LOCAL local_ttrib__m__init_internal_33 --> -136($fp) +lw $t1, -136($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_ttrib__m__init_internal_30 --> -124($fp) +# LOCAL local_ttrib__m__init_internal_31 --> -128($fp) +# local_ttrib__m__init_internal_31 = VCALL local_ttrib__m__init_internal_30 out_int +# Save new self pointer in $s1 +lw $s1, -124($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 16($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -128($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_ttrib__m__init_internal_36 --> -148($fp) +# local_ttrib__m__init_internal_36 = SELF +sw $s1, -148($fp) +# LOCAL local_ttrib__m__init_internal_34 --> -140($fp) +# LOCAL local_ttrib__m__init_internal_36 --> -148($fp) +# local_ttrib__m__init_internal_34 = local_ttrib__m__init_internal_36 +lw $t1, -148($fp) +sw $t1, -140($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_ttrib__m__init_internal_37 --> -152($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_3 +sw $t1, 12($v0) +li $t1, 11 +sw $t1, 16($v0) +sw $v0, -152($fp) +# ARG local_ttrib__m__init_internal_37 +# LOCAL local_ttrib__m__init_internal_37 --> -152($fp) +lw $t1, -152($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_ttrib__m__init_internal_34 --> -140($fp) +# LOCAL local_ttrib__m__init_internal_35 --> -144($fp) +# local_ttrib__m__init_internal_35 = VCALL local_ttrib__m__init_internal_34 out_string +# Save new self pointer in $s1 +lw $s1, -140($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 12($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -144($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_ttrib__m__init_internal_23 --> -96($fp) +# LOCAL local_ttrib__m__init_internal_35 --> -144($fp) +# local_ttrib__m__init_internal_23 = local_ttrib__m__init_internal_35 +lw $t1, -144($fp) +sw $t1, -96($fp) +# GOTO label_ENDIF_14 +j label_ENDIF_14 +label_FALSEIF_13: + # LOCAL local_ttrib__m__init_internal_23 --> -96($fp) + # local_ttrib__m__init_internal_23 = 0 + li $t1, 0 + sw $t1, -96($fp) + label_ENDIF_14: +# local_ttrib__m__init_internal_40 = GETATTRIBUTE stop Main +# LOCAL local_ttrib__m__init_internal_40 --> -164($fp) +lw $t1, 24($s1) +sw $t1, -164($fp) +# local_ttrib__m__init_internal_41 = GETATTRIBUTE testee Main +# LOCAL local_ttrib__m__init_internal_41 --> -168($fp) +lw $t1, 16($s1) +sw $t1, -168($fp) +# LOCAL local_ttrib__m__init_internal_39 --> -160($fp) +# LOCAL local_ttrib__m__init_internal_40 --> -164($fp) +# LOCAL local_ttrib__m__init_internal_41 --> -168($fp) +# local_ttrib__m__init_internal_39 = local_ttrib__m__init_internal_40 - local_ttrib__m__init_internal_41 +lw $t1, -164($fp) +lw $t2, -168($fp) +sub $t1, $t1, $t2 +sw $t1, -160($fp) +# IF_GREATER_ZERO local_ttrib__m__init_internal_39 GOTO label_FALSE_19 +# IF_GREATER_ZERO local_ttrib__m__init_internal_39 GOTO label_FALSE_19 +lw $t1, -160($fp) +bgt $t1, 0, label_FALSE_19 +# LOCAL local_ttrib__m__init_internal_39 --> -160($fp) +# local_ttrib__m__init_internal_39 = 1 +li $t1, 1 +sw $t1, -160($fp) +# GOTO label_END_20 +j label_END_20 +label_FALSE_19: + # LOCAL local_ttrib__m__init_internal_39 --> -160($fp) + # local_ttrib__m__init_internal_39 = 0 + li $t1, 0 + sw $t1, -160($fp) + label_END_20: +# IF_ZERO local_ttrib__m__init_internal_39 GOTO label_FALSEIF_17 +# IF_ZERO local_ttrib__m__init_internal_39 GOTO label_FALSEIF_17 +lw $t1, -160($fp) +beq $t1, 0, label_FALSEIF_17 +# LOCAL local_ttrib__m__init_internal_44 --> -180($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_4 +sw $t1, 12($v0) +li $t1, 4 +sw $t1, 16($v0) +sw $v0, -180($fp) +# LOCAL local_ttrib__m__init_internal_42 --> -172($fp) +# LOCAL local_ttrib__m__init_internal_44 --> -180($fp) +# local_ttrib__m__init_internal_42 = local_ttrib__m__init_internal_44 +lw $t1, -180($fp) +sw $t1, -172($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_ttrib__m__init_internal_42 --> -172($fp) +# LOCAL local_ttrib__m__init_internal_43 --> -176($fp) +# local_ttrib__m__init_internal_43 = VCALL local_ttrib__m__init_internal_42 abort +# Save new self pointer in $s1 +lw $s1, -172($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 0($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -176($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_ttrib__m__init_internal_38 --> -156($fp) +# LOCAL local_ttrib__m__init_internal_43 --> -176($fp) +# local_ttrib__m__init_internal_38 = local_ttrib__m__init_internal_43 +lw $t1, -176($fp) +sw $t1, -156($fp) +# GOTO label_ENDIF_18 +j label_ENDIF_18 +label_FALSEIF_17: + # LOCAL local_ttrib__m__init_internal_45 --> -184($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_5 + sw $t1, 12($v0) + li $t1, 8 + sw $t1, 16($v0) + sw $v0, -184($fp) + # LOCAL local_ttrib__m__init_internal_38 --> -156($fp) + # LOCAL local_ttrib__m__init_internal_45 --> -184($fp) + # local_ttrib__m__init_internal_38 = local_ttrib__m__init_internal_45 + lw $t1, -184($fp) + sw $t1, -156($fp) + label_ENDIF_18: +# GOTO label_WHILE_1 +j label_WHILE_1 +label_WHILE_END_2: + # RETURN + # Deallocate stack frame for function __Main__attrib__m__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 192 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/codegen/print-cool.mips b/tests/codegen/print-cool.mips index 6590c059..e569413a 100644 --- a/tests/codegen/print-cool.mips +++ b/tests/codegen/print-cool.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sat Dec 5 23:01:19 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:18 2020 # School of Math and Computer Science, University of Havana # @@ -47,7 +47,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String # Function END # @@ -329,7 +329,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -344,7 +344,7 @@ function_concat_at_String: lw $t0, 12($s1) # Get second string from param lw $t1, 12($v0) - addu $a0, $a0, 1 + addu $a0, $a0, 4 li $v0, 9 syscall move $t2, $v0 @@ -530,6 +530,13 @@ entry: li $t2, 16 sw $t2, 8($v0) move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t1, -4($fp) # LOCAL local__internal_0 --> -4($fp) lw $s1, -4($fp) @@ -607,6 +614,13 @@ function_main_at_Main: li $t3, 4 sw $t3, 8($v0) move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 sw $t2, -40($fp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) @@ -661,7 +675,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t3, 0($t2) # Get pointer to function address - lw $t4, 4($t3) + lw $t4, 16($t3) # Call function. Result is on $v0 jalr $t4 sw $v0, -28($fp) @@ -819,7 +833,7 @@ lw $t2, 4($s1) # Get pointer to type's VTABLE lw $t3, 0($t2) # Get pointer to function address -lw $t4, 4($t3) +lw $t4, 16($t3) # Call function. Result is on $v0 jalr $t4 sw $v0, -48($fp) @@ -875,7 +889,7 @@ li $t2, 8 sw $t2, 8($v0) la $t2, data_2 sw $t2, 12($v0) -li $t2, 2 +li $t2, 1 sw $t2, 16($v0) sw $v0, -80($fp) # ARG local_main_at_Main_internal_19 From 2ae2f72fcc138fbacb1f6f9c6a7901e0bf4bdf6f Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sun, 6 Dec 2020 10:58:43 -0500 Subject: [PATCH 149/162] Add abortion message --- src/.builds | 1 + src/cil/baseCilVisitor.py | 6 +- src/cil/nodes.py | 5 +- src/testing.mips | 1284 +---- src/testing.py | 84 +- src/travels/ciltomips.py | 17 +- src/travels/ctcill.py | 5 +- src/travels/inference.py | 20 +- tests/codegen/atoi.mips | 3535 ------------- tests/codegen/book_list.mips | 2975 ----------- tests/codegen/complex.mips | 1605 ------ tests/codegen/fib.mips | 907 ---- tests/codegen/hello_world.mips | 639 --- tests/codegen/io.mips | 1344 ----- tests/codegen/life.mips | 8637 -------------------------------- tests/codegen/list.mips | 1655 ------ tests/codegen/new_complex.mips | 2044 -------- tests/codegen/palindrome.mips | 1279 ----- tests/codegen/primes.mips | 1282 ----- tests/codegen/print-cool.mips | 929 ---- 20 files changed, 111 insertions(+), 28142 deletions(-) delete mode 100644 tests/codegen/atoi.mips delete mode 100644 tests/codegen/book_list.mips delete mode 100644 tests/codegen/complex.mips delete mode 100644 tests/codegen/fib.mips delete mode 100644 tests/codegen/hello_world.mips delete mode 100644 tests/codegen/io.mips delete mode 100644 tests/codegen/life.mips delete mode 100644 tests/codegen/list.mips delete mode 100644 tests/codegen/new_complex.mips delete mode 100644 tests/codegen/palindrome.mips delete mode 100644 tests/codegen/primes.mips delete mode 100644 tests/codegen/print-cool.mips diff --git a/src/.builds b/src/.builds index 5df5b120..0765be88 100644 --- a/src/.builds +++ b/src/.builds @@ -210,3 +210,4 @@ 1 1 1 +1 diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 082a38c5..e7272a5e 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -115,6 +115,8 @@ def __init__(self, context: Context): self.current_method: Optional[Method] = None self.current_function: Optional[nodes.FunctionNode] = None self.null = self.register_data('""') + self.abortion = self.register_data('"Abort called from class "') + self.newLine = self.register_data(r'"\n"') self.__labels_count: int = 0 self.__build_CART() self.build_builtins() @@ -268,7 +270,9 @@ def __implement_abort(self): # la funcion abort no recibe ningun paramentro # Simplemente llama trap y le pasa la causa "abortion" self.current_function = self.register_function("function_abort_at_Object") - self.register_instruction(AbortNode()) + return_expr_vm_holder = self.define_internal_local() + self.register_instruction(TypeName(return_expr_vm_holder)) + self.register_instruction(AbortNode(return_expr_vm_holder, self.abortion, self.newLine)) self.current_function = None def __implement_copy(self): diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 7e3eeba7..9c57885e 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -286,7 +286,10 @@ def __init__(self, dest: LocalNode, s: ParamNode) -> None: class AbortNode(InstructionNode): - pass + def __init__(self, calling, abortion, newLine) -> None: + self.src = calling + self.abortion = abortion + self.nl = newLine class AllocateBoolNode(InstructionNode): diff --git a/src/testing.mips b/src/testing.mips index fd481efe..2d401ca3 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,1283 +1,7 @@ + Scope -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 01:07:40 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_pal_at_Main, function_main_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -IO__TDT: .word 0, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, 0 -# - - -data_2: .asciiz "enter a string\n" -# - - -data_3: .asciiz "that was a palindrome\n" -# - - -data_4: .asciiz "that was not a palindrome\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - li $a0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) - # Load type offset - li $t2, 16 - sw $t2, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__i__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t1, Main_vtable - # Get pointer to function address - lw $t2, 32($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__i__init implementation. -# @Params: -__Main__attrib__i__init: - # Allocate stack frame for function __Main__attrib__i__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Main__attrib__i__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_pal_at_Main implementation. -# @Params: -# 0($fp) = param_pal_at_Main_s_0 -function_pal_at_Main: - # Allocate stack frame for function function_pal_at_Main. - subu $sp, $sp, 120 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 120 - # LOCAL local_pal_at_Main_internal_2 --> -12($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_2 = PARAM param_pal_at_Main_s_0 - lw $t1, 0($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_2 --> -12($fp) - # LOCAL local_pal_at_Main_internal_3 --> -16($fp) - # local_pal_at_Main_internal_3 = VCALL local_pal_at_Main_internal_2 length - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_1 --> -8($fp) - # LOCAL local_pal_at_Main_internal_3 --> -16($fp) - # local_pal_at_Main_internal_1 = local_pal_at_Main_internal_3 - 0 - lw $t1, -16($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_ZERO local_pal_at_Main_internal_1 GOTO label_TRUE_3 - # IF_ZERO local_pal_at_Main_internal_1 GOTO label_TRUE_3 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_3 - # LOCAL local_pal_at_Main_internal_1 --> -8($fp) - # local_pal_at_Main_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_4 -j label_END_4 -label_TRUE_3: - # LOCAL local_pal_at_Main_internal_1 --> -8($fp) - # local_pal_at_Main_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_4: -# IF_ZERO local_pal_at_Main_internal_1 GOTO label_FALSEIF_1 -# IF_ZERO local_pal_at_Main_internal_1 GOTO label_FALSEIF_1 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_1 -# LOCAL local_pal_at_Main_internal_4 --> -20($fp) -# local_pal_at_Main_internal_4 = 1 -li $t1, 1 -sw $t1, -20($fp) -# LOCAL local_pal_at_Main_internal_0 --> -4($fp) -# LOCAL local_pal_at_Main_internal_4 --> -20($fp) -# local_pal_at_Main_internal_0 = local_pal_at_Main_internal_4 -lw $t1, -20($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_2 -j label_ENDIF_2 -label_FALSEIF_1: - # LOCAL local_pal_at_Main_internal_7 --> -32($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_7 = PARAM param_pal_at_Main_s_0 - lw $t1, 0($fp) - sw $t1, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_7 --> -32($fp) - # LOCAL local_pal_at_Main_internal_8 --> -36($fp) - # local_pal_at_Main_internal_8 = VCALL local_pal_at_Main_internal_7 length - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_6 --> -28($fp) - # LOCAL local_pal_at_Main_internal_8 --> -36($fp) - # local_pal_at_Main_internal_6 = local_pal_at_Main_internal_8 - 1 - lw $t1, -36($fp) - sub $t1, $t1, 1 - sw $t1, -28($fp) - # IF_ZERO local_pal_at_Main_internal_6 GOTO label_TRUE_7 - # IF_ZERO local_pal_at_Main_internal_6 GOTO label_TRUE_7 - lw $t1, -28($fp) - beq $t1, 0, label_TRUE_7 - # LOCAL local_pal_at_Main_internal_6 --> -28($fp) - # local_pal_at_Main_internal_6 = 0 - li $t1, 0 - sw $t1, -28($fp) - # GOTO label_END_8 -j label_END_8 -label_TRUE_7: - # LOCAL local_pal_at_Main_internal_6 --> -28($fp) - # local_pal_at_Main_internal_6 = 1 - li $t1, 1 - sw $t1, -28($fp) - label_END_8: -# IF_ZERO local_pal_at_Main_internal_6 GOTO label_FALSEIF_5 -# IF_ZERO local_pal_at_Main_internal_6 GOTO label_FALSEIF_5 -lw $t1, -28($fp) -beq $t1, 0, label_FALSEIF_5 -# LOCAL local_pal_at_Main_internal_9 --> -40($fp) -# local_pal_at_Main_internal_9 = 1 -li $t1, 1 -sw $t1, -40($fp) -# LOCAL local_pal_at_Main_internal_5 --> -24($fp) -# LOCAL local_pal_at_Main_internal_9 --> -40($fp) -# local_pal_at_Main_internal_5 = local_pal_at_Main_internal_9 -lw $t1, -40($fp) -sw $t1, -24($fp) -# GOTO label_ENDIF_6 -j label_ENDIF_6 -label_FALSEIF_5: - # LOCAL local_pal_at_Main_internal_12 --> -52($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_12 = PARAM param_pal_at_Main_s_0 - lw $t1, 0($fp) - sw $t1, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 0 - li $t1, 0 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # ARG 1 - li $t1, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_pal_at_Main_internal_12 --> -52($fp) - # LOCAL local_pal_at_Main_internal_13 --> -56($fp) - # local_pal_at_Main_internal_13 = VCALL local_pal_at_Main_internal_12 substr - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 16($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_14 --> -60($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_14 = PARAM param_pal_at_Main_s_0 - lw $t1, 0($fp) - sw $t1, -60($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_17 --> -72($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_17 = PARAM param_pal_at_Main_s_0 - lw $t1, 0($fp) - sw $t1, -72($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_17 --> -72($fp) - # LOCAL local_pal_at_Main_internal_18 --> -76($fp) - # local_pal_at_Main_internal_18 = VCALL local_pal_at_Main_internal_17 length - # Save new self pointer in $s1 - lw $s1, -72($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -76($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_16 --> -68($fp) - # LOCAL local_pal_at_Main_internal_18 --> -76($fp) - # local_pal_at_Main_internal_16 = local_pal_at_Main_internal_18 - 1 - lw $t1, -76($fp) - sub $t1, $t1, 1 - sw $t1, -68($fp) - # ARG local_pal_at_Main_internal_16 - # LOCAL local_pal_at_Main_internal_16 --> -68($fp) - lw $t1, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # ARG 1 - li $t1, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_pal_at_Main_internal_14 --> -60($fp) - # LOCAL local_pal_at_Main_internal_15 --> -64($fp) - # local_pal_at_Main_internal_15 = VCALL local_pal_at_Main_internal_14 substr - # Save new self pointer in $s1 - lw $s1, -60($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 16($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -64($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_11 --> -48($fp) - # LOCAL local_pal_at_Main_internal_13 --> -56($fp) - # LOCAL local_pal_at_Main_internal_15 --> -64($fp) - # local_pal_at_Main_internal_11 = local_pal_at_Main_internal_13 - local_pal_at_Main_internal_15 - lw $t1, -56($fp) - lw $t2, -64($fp) - sub $t1, $t1, $t2 - sw $t1, -48($fp) - # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_11 - # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_11 - lw $t1, -48($fp) - beq $t1, 0, label_TRUE_11 - # LOCAL local_pal_at_Main_internal_11 --> -48($fp) - # local_pal_at_Main_internal_11 = 0 - li $t1, 0 - sw $t1, -48($fp) - # GOTO label_END_12 -j label_END_12 -label_TRUE_11: - # LOCAL local_pal_at_Main_internal_11 --> -48($fp) - # local_pal_at_Main_internal_11 = 1 - li $t1, 1 - sw $t1, -48($fp) - label_END_12: -# IF_ZERO local_pal_at_Main_internal_11 GOTO label_FALSEIF_9 -# IF_ZERO local_pal_at_Main_internal_11 GOTO label_FALSEIF_9 -lw $t1, -48($fp) -beq $t1, 0, label_FALSEIF_9 -# LOCAL local_pal_at_Main_internal_21 --> -88($fp) -# local_pal_at_Main_internal_21 = SELF -sw $s1, -88($fp) -# LOCAL local_pal_at_Main_internal_19 --> -80($fp) -# LOCAL local_pal_at_Main_internal_21 --> -88($fp) -# local_pal_at_Main_internal_19 = local_pal_at_Main_internal_21 -lw $t1, -88($fp) -sw $t1, -80($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_pal_at_Main_internal_22 --> -92($fp) -# PARAM param_pal_at_Main_s_0 --> 0($fp) -# local_pal_at_Main_internal_22 = PARAM param_pal_at_Main_s_0 -lw $t1, 0($fp) -sw $t1, -92($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG 1 -li $t1, 1 -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_pal_at_Main_internal_25 --> -104($fp) -# PARAM param_pal_at_Main_s_0 --> 0($fp) -# local_pal_at_Main_internal_25 = PARAM param_pal_at_Main_s_0 -lw $t1, 0($fp) -sw $t1, -104($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_pal_at_Main_internal_25 --> -104($fp) -# LOCAL local_pal_at_Main_internal_26 --> -108($fp) -# local_pal_at_Main_internal_26 = VCALL local_pal_at_Main_internal_25 length -# Save new self pointer in $s1 -lw $s1, -104($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 20($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -108($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_pal_at_Main_internal_24 --> -100($fp) -# LOCAL local_pal_at_Main_internal_26 --> -108($fp) -# local_pal_at_Main_internal_24 = local_pal_at_Main_internal_26 - 2 -lw $t1, -108($fp) -sub $t1, $t1, 2 -sw $t1, -100($fp) -# ARG local_pal_at_Main_internal_24 -# LOCAL local_pal_at_Main_internal_24 --> -100($fp) -lw $t1, -100($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_pal_at_Main_internal_22 --> -92($fp) -# LOCAL local_pal_at_Main_internal_23 --> -96($fp) -# local_pal_at_Main_internal_23 = VCALL local_pal_at_Main_internal_22 substr -# Save new self pointer in $s1 -lw $s1, -92($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 16($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -96($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_pal_at_Main_internal_23 -# LOCAL local_pal_at_Main_internal_23 --> -96($fp) -lw $t1, -96($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_pal_at_Main_internal_19 --> -80($fp) -# LOCAL local_pal_at_Main_internal_20 --> -84($fp) -# local_pal_at_Main_internal_20 = VCALL local_pal_at_Main_internal_19 pal -# Save new self pointer in $s1 -lw $s1, -80($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 28($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -84($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_pal_at_Main_internal_10 --> -44($fp) -# LOCAL local_pal_at_Main_internal_20 --> -84($fp) -# local_pal_at_Main_internal_10 = local_pal_at_Main_internal_20 -lw $t1, -84($fp) -sw $t1, -44($fp) -# GOTO label_ENDIF_10 -j label_ENDIF_10 -label_FALSEIF_9: - # LOCAL local_pal_at_Main_internal_27 --> -112($fp) - # local_pal_at_Main_internal_27 = 0 - li $t1, 0 - sw $t1, -112($fp) - # LOCAL local_pal_at_Main_internal_10 --> -44($fp) - # LOCAL local_pal_at_Main_internal_27 --> -112($fp) - # local_pal_at_Main_internal_10 = local_pal_at_Main_internal_27 - lw $t1, -112($fp) - sw $t1, -44($fp) - label_ENDIF_10: -# LOCAL local_pal_at_Main_internal_5 --> -24($fp) -# LOCAL local_pal_at_Main_internal_10 --> -44($fp) -# local_pal_at_Main_internal_5 = local_pal_at_Main_internal_10 -lw $t1, -44($fp) -sw $t1, -24($fp) -label_ENDIF_6: -# LOCAL local_pal_at_Main_internal_0 --> -4($fp) -# LOCAL local_pal_at_Main_internal_5 --> -24($fp) -# local_pal_at_Main_internal_0 = local_pal_at_Main_internal_5 -lw $t1, -24($fp) -sw $t1, -4($fp) -label_ENDIF_2: -# RETURN local_pal_at_Main_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_pal_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 120 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 88 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 88 - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - li $t1, 1 - not $t1, $t1 - sw $t1, -4($fp) - # - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - lw $t1, -4($fp) - sw $t1, 12($s1) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t1, -16($fp) - sw $t1, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_2 - sw $t1, 12($v0) - li $t1, 15 - sw $t1, 16($v0) - sw $v0, -20($fp) - # ARG local_main_at_Main_internal_4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - lw $t1, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 out_string - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = SELF - sw $s1, -36($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 in_string - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_10 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - lw $t1, -44($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 pal - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 28($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # IF_ZERO local_main_at_Main_internal_7 GOTO label_FALSEIF_13 - # IF_ZERO local_main_at_Main_internal_7 GOTO label_FALSEIF_13 - lw $t1, -32($fp) - beq $t1, 0, label_FALSEIF_13 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 - lw $t1, -60($fp) - sw $t1, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_3 - sw $t1, 12($v0) - li $t1, 22 - sw $t1, 16($v0) - sw $v0, -64($fp) - # ARG local_main_at_Main_internal_15 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - lw $t1, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_5 = local_main_at_Main_internal_13 - lw $t1, -56($fp) - sw $t1, -24($fp) - # GOTO label_ENDIF_14 -j label_ENDIF_14 -label_FALSEIF_13: - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 - lw $t1, -76($fp) - sw $t1, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_4 - sw $t1, 12($v0) - li $t1, 26 - sw $t1, 16($v0) - sw $v0, -80($fp) - # ARG local_main_at_Main_internal_19 - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - lw $t1, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_5 = local_main_at_Main_internal_17 - lw $t1, -72($fp) - sw $t1, -24($fp) - label_ENDIF_14: -# RETURN local_main_at_Main_internal_5 -lw $v0, -24($fp) -# Deallocate stack frame for function function_main_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 88 -jr $ra -# Function END + Scope + Scope +n -> Razz diff --git a/src/testing.py b/src/testing.py index 93c6b069..e30f88ca 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,31 +60,67 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""class Main inherits IO { - pal(s : String) : Bool { - if s.length() = 0 - then true - else if s.length() = 1 - then true - else if s.substr(0, 1) = s.substr(s.length() - 1, 1) - then pal(s.substr(1, s.length() -2)) - else false - fi fi fi - }; - - i : Int; - - main() : IO { - { - i <- ~1; - out_string("enter a string\n"); - if pal(in_string()) - then out_string("that was a palindrome\n") - else out_string("that was not a palindrome\n") - fi; - } - }; +text = r"""(* hairy . . .*) + +class Foo inherits Bazz { + a : Razz <- case self of + n : Razz => (new Bar); + n : Foo => (new Razz); + n : Bar => n; + esac; + + b : Int <- a.doh() + g.doh() + doh() + printh(); + + doh() : Int { (let i : Int <- h in { h <- h + 2; i; } ) }; + +}; + +class Bar inherits Razz { + + c : Int <- doh(); + + d : Object <- printh(); +}; + + +class Razz inherits Foo { + + e : Bar <- case self of + n : Razz => (new Bar); + n : Bar => n; + esac; + + f : Int <- a@Bazz.doh() + g.doh() + e.doh() + doh() + printh(); + +}; + +class Bazz inherits IO { + + h : Int <- 1; + + g : Foo <- case self of + n : Bazz => (new Foo); + n : Razz => (new Bar); + n : Foo => (new Razz); + n : Bar => n; + esac; + + i : Object <- printh(); + + printh() : Int { { out_int(h); 0; } }; + + doh() : Int { (let i: Int <- h in { h <- h + 1; i; } ) }; }; +(* scary . . . *) +class Main { + a : Bazz <- new Bazz; + b : Foo <- new Foo; + c : Razz <- new Razz; + d : Bar <- new Bar; + + main(): String { "do nothing" }; + +}; """ pipeline(text, 5) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index ed89414c..e9fbd308 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -1060,7 +1060,22 @@ def _(self, node: ConcatString): @visit.register def _(self, node: AbortNode): - self.register_instruction(LI(a0, 10)) + # Cargar el puntero al tipo de self + src = self.visit(node.src) + self.register_instruction(LA(a0, node.abortion.name)) + # Print abortion + self.register_instruction(LI(v0, 4)) + self.register_instruction(SYSCALL()) + + self.register_instruction(LW(a0, src)) + self.register_instruction(LI(v0, 4)) + self.register_instruction(SYSCALL()) + + self.register_instruction(LA(a0, node.nl.name)) + self.register_instruction(LI(v0, 4)) + self.register_instruction(SYSCALL()) + + self.register_instruction(LI(v0, 10)) self.register_instruction(SYSCALL()) @visit.register diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index ecbfe3b4..3797b49e 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -47,7 +47,7 @@ StarNode, StaticCallNode, SubstringNode, - TdtLookupNode, + TdtLookupNode, TypeName, TypeNode, TypeOffsetNode, UnconditionalJump, @@ -476,7 +476,8 @@ def _(self, node: coolAst.CaseNode, scope: Scope): self.register_instruction(LabelNode(next_label)) self.register_instruction(LabelNode(error_label)) - self.register_instruction(AbortNode()) + self.register_instruction(TypeName(expr_vm_holder)) + self.register_instruction(AbortNode(expr_vm_holder, self.abortion, self.newLine)) self.register_instruction(LabelNode(end_label)) diff --git a/src/travels/inference.py b/src/travels/inference.py index 635b1499..bd142b39 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -13,6 +13,13 @@ void = semantic.VoidType() +def get_type_attribute_chain(type_: Type): + if type_.name == "Object": + return [] + else: + assert type_.parent is not None + return type_.attributes + get_type_attribute_chain(type_.parent) + def find_common_parent(e1, e2): if e1.conforms_to(e2): @@ -110,7 +117,9 @@ def _( self.current_type = self.context.get_type(node.idx) # Definir los atributos heredados if deep == 1: - for attribute in self.current_type.attributes: + for attribute in ( + get_type_attribute_chain(self.current_type) + ): scope.define_variable(attribute.name, attribute.type, "ATTRIBUTE") for feature in node.features: @@ -331,7 +340,14 @@ def _(self, node: CaseNode, scope: Scope, infered_type=None, deep=1): @visit.register def _(self, node: ActionNode, scope: Scope, infered_type=None, deep=1): if deep == 1: - scope.define_variable(node.idx, self.context.get_type(node.typex), "LOCAL") + try: + scope.define_variable( + node.idx, self.context.get_type(node.typex), "LOCAL" + ) + except SemanticError: + raise SemanticError( + f"{node.line, node.column} - TypeError: Undefined type {node.typex}" + ) return self.visit(node.actions, scope, infered_type, deep) @visit.register diff --git a/tests/codegen/atoi.mips b/tests/codegen/atoi.mips deleted file mode 100644 index 2d98be02..00000000 --- a/tests/codegen/atoi.mips +++ /dev/null @@ -1,3535 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:20 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -A2I: .asciiz "A2I" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type A2I **** -A2I_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_c2i_at_A2I, function_i2c_at_A2I, function_a2i_at_A2I, function_a2i_aux_at_A2I, function_i2a_at_A2I, function_i2a_aux_at_A2I -# Function END -# - - -# **** Type RECORD for type A2I **** -A2I_start: - A2I_vtable_pointer: .word A2I_vtable - # Function END -A2I_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1 -A2I__TDT: .word -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, 0 -# - - -data_2: .asciiz "0" -# - - -data_3: .asciiz "1" -# - - -data_4: .asciiz "2" -# - - -data_5: .asciiz "3" -# - - -data_6: .asciiz "4" -# - - -data_7: .asciiz "5" -# - - -data_8: .asciiz "6" -# - - -data_9: .asciiz "7" -# - - -data_10: .asciiz "8" -# - - -data_11: .asciiz "9" -# - - -data_12: .asciiz "0" -# - - -data_13: .asciiz "1" -# - - -data_14: .asciiz "2" -# - - -data_15: .asciiz "3" -# - - -data_16: .asciiz "4" -# - - -data_17: .asciiz "5" -# - - -data_18: .asciiz "6" -# - - -data_19: .asciiz "7" -# - - -data_20: .asciiz "8" -# - - -data_21: .asciiz "9" -# - - -data_22: .asciiz "" -# - - -data_23: .asciiz "-" -# - - -data_24: .asciiz "+" -# - - -data_25: .asciiz "0" -# - - -data_26: .asciiz "-" -# - - -data_27: .asciiz "" -# - - -data_28: .asciiz "678987" -# - - -data_29: .asciiz " == " -# - - -data_30: .asciiz "\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - li $a0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) - # Load type offset - li $t2, 20 - sw $t2, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t1, Main_vtable - # Get pointer to function address - lw $t2, 28($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_c2i_at_A2I implementation. -# @Params: -# 0($fp) = param_c2i_at_A2I_char_0 -function_c2i_at_A2I: - # Allocate stack frame for function function_c2i_at_A2I. - subu $sp, $sp, 140 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 140 - # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_2 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -12($fp) - # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) - # local_c2i_at_A2I_internal_1 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_2 - lw $t1, 0($fp) - lw $t2, -12($fp) - sub $t1, $t1, $t2 - sw $t1, -8($fp) - # IF_ZERO local_c2i_at_A2I_internal_1 GOTO label_TRUE_3 - # IF_ZERO local_c2i_at_A2I_internal_1 GOTO label_TRUE_3 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_3 - # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) - # local_c2i_at_A2I_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_4 -j label_END_4 -label_TRUE_3: - # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) - # local_c2i_at_A2I_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_4: -# IF_ZERO local_c2i_at_A2I_internal_1 GOTO label_FALSEIF_1 -# IF_ZERO local_c2i_at_A2I_internal_1 GOTO label_FALSEIF_1 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_1 -# LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) -# local_c2i_at_A2I_internal_0 = 0 -li $t1, 0 -sw $t1, -4($fp) -# GOTO label_ENDIF_2 -j label_ENDIF_2 -label_FALSEIF_1: - # LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_3 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -24($fp) - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) - # local_c2i_at_A2I_internal_4 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_5 - lw $t1, 0($fp) - lw $t2, -24($fp) - sub $t1, $t1, $t2 - sw $t1, -20($fp) - # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_7 - # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_7 - lw $t1, -20($fp) - beq $t1, 0, label_TRUE_7 - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - # local_c2i_at_A2I_internal_4 = 0 - li $t1, 0 - sw $t1, -20($fp) - # GOTO label_END_8 -j label_END_8 -label_TRUE_7: - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - # local_c2i_at_A2I_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) - label_END_8: -# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSEIF_5 -# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSEIF_5 -lw $t1, -20($fp) -beq $t1, 0, label_FALSEIF_5 -# LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) -# local_c2i_at_A2I_internal_3 = 1 -li $t1, 1 -sw $t1, -16($fp) -# GOTO label_ENDIF_6 -j label_ENDIF_6 -label_FALSEIF_5: - # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_4 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -36($fp) - # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) - # local_c2i_at_A2I_internal_7 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_8 - lw $t1, 0($fp) - lw $t2, -36($fp) - sub $t1, $t1, $t2 - sw $t1, -32($fp) - # IF_ZERO local_c2i_at_A2I_internal_7 GOTO label_TRUE_11 - # IF_ZERO local_c2i_at_A2I_internal_7 GOTO label_TRUE_11 - lw $t1, -32($fp) - beq $t1, 0, label_TRUE_11 - # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) - # local_c2i_at_A2I_internal_7 = 0 - li $t1, 0 - sw $t1, -32($fp) - # GOTO label_END_12 -j label_END_12 -label_TRUE_11: - # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) - # local_c2i_at_A2I_internal_7 = 1 - li $t1, 1 - sw $t1, -32($fp) - label_END_12: -# IF_ZERO local_c2i_at_A2I_internal_7 GOTO label_FALSEIF_9 -# IF_ZERO local_c2i_at_A2I_internal_7 GOTO label_FALSEIF_9 -lw $t1, -32($fp) -beq $t1, 0, label_FALSEIF_9 -# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) -# local_c2i_at_A2I_internal_6 = 2 -li $t1, 2 -sw $t1, -28($fp) -# GOTO label_ENDIF_10 -j label_ENDIF_10 -label_FALSEIF_9: - # LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_5 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -48($fp) - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) - # local_c2i_at_A2I_internal_10 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_11 - lw $t1, 0($fp) - lw $t2, -48($fp) - sub $t1, $t1, $t2 - sw $t1, -44($fp) - # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_15 - # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_15 - lw $t1, -44($fp) - beq $t1, 0, label_TRUE_15 - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - # local_c2i_at_A2I_internal_10 = 0 - li $t1, 0 - sw $t1, -44($fp) - # GOTO label_END_16 -j label_END_16 -label_TRUE_15: - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - # local_c2i_at_A2I_internal_10 = 1 - li $t1, 1 - sw $t1, -44($fp) - label_END_16: -# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSEIF_13 -# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSEIF_13 -lw $t1, -44($fp) -beq $t1, 0, label_FALSEIF_13 -# LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) -# local_c2i_at_A2I_internal_9 = 3 -li $t1, 3 -sw $t1, -40($fp) -# GOTO label_ENDIF_14 -j label_ENDIF_14 -label_FALSEIF_13: - # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_6 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -60($fp) - # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) - # local_c2i_at_A2I_internal_13 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_14 - lw $t1, 0($fp) - lw $t2, -60($fp) - sub $t1, $t1, $t2 - sw $t1, -56($fp) - # IF_ZERO local_c2i_at_A2I_internal_13 GOTO label_TRUE_19 - # IF_ZERO local_c2i_at_A2I_internal_13 GOTO label_TRUE_19 - lw $t1, -56($fp) - beq $t1, 0, label_TRUE_19 - # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) - # local_c2i_at_A2I_internal_13 = 0 - li $t1, 0 - sw $t1, -56($fp) - # GOTO label_END_20 -j label_END_20 -label_TRUE_19: - # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) - # local_c2i_at_A2I_internal_13 = 1 - li $t1, 1 - sw $t1, -56($fp) - label_END_20: -# IF_ZERO local_c2i_at_A2I_internal_13 GOTO label_FALSEIF_17 -# IF_ZERO local_c2i_at_A2I_internal_13 GOTO label_FALSEIF_17 -lw $t1, -56($fp) -beq $t1, 0, label_FALSEIF_17 -# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) -# local_c2i_at_A2I_internal_12 = 4 -li $t1, 4 -sw $t1, -52($fp) -# GOTO label_ENDIF_18 -j label_ENDIF_18 -label_FALSEIF_17: - # LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_7 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -72($fp) - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) - # local_c2i_at_A2I_internal_16 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_17 - lw $t1, 0($fp) - lw $t2, -72($fp) - sub $t1, $t1, $t2 - sw $t1, -68($fp) - # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_23 - # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_23 - lw $t1, -68($fp) - beq $t1, 0, label_TRUE_23 - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - # local_c2i_at_A2I_internal_16 = 0 - li $t1, 0 - sw $t1, -68($fp) - # GOTO label_END_24 -j label_END_24 -label_TRUE_23: - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - # local_c2i_at_A2I_internal_16 = 1 - li $t1, 1 - sw $t1, -68($fp) - label_END_24: -# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSEIF_21 -# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSEIF_21 -lw $t1, -68($fp) -beq $t1, 0, label_FALSEIF_21 -# LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) -# local_c2i_at_A2I_internal_15 = 5 -li $t1, 5 -sw $t1, -64($fp) -# GOTO label_ENDIF_22 -j label_ENDIF_22 -label_FALSEIF_21: - # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_8 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -84($fp) - # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) - # local_c2i_at_A2I_internal_19 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_20 - lw $t1, 0($fp) - lw $t2, -84($fp) - sub $t1, $t1, $t2 - sw $t1, -80($fp) - # IF_ZERO local_c2i_at_A2I_internal_19 GOTO label_TRUE_27 - # IF_ZERO local_c2i_at_A2I_internal_19 GOTO label_TRUE_27 - lw $t1, -80($fp) - beq $t1, 0, label_TRUE_27 - # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) - # local_c2i_at_A2I_internal_19 = 0 - li $t1, 0 - sw $t1, -80($fp) - # GOTO label_END_28 -j label_END_28 -label_TRUE_27: - # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) - # local_c2i_at_A2I_internal_19 = 1 - li $t1, 1 - sw $t1, -80($fp) - label_END_28: -# IF_ZERO local_c2i_at_A2I_internal_19 GOTO label_FALSEIF_25 -# IF_ZERO local_c2i_at_A2I_internal_19 GOTO label_FALSEIF_25 -lw $t1, -80($fp) -beq $t1, 0, label_FALSEIF_25 -# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) -# local_c2i_at_A2I_internal_18 = 6 -li $t1, 6 -sw $t1, -76($fp) -# GOTO label_ENDIF_26 -j label_ENDIF_26 -label_FALSEIF_25: - # LOCAL local_c2i_at_A2I_internal_23 --> -96($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_9 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -96($fp) - # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_23 --> -96($fp) - # local_c2i_at_A2I_internal_22 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_23 - lw $t1, 0($fp) - lw $t2, -96($fp) - sub $t1, $t1, $t2 - sw $t1, -92($fp) - # IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_TRUE_31 - # IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_TRUE_31 - lw $t1, -92($fp) - beq $t1, 0, label_TRUE_31 - # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) - # local_c2i_at_A2I_internal_22 = 0 - li $t1, 0 - sw $t1, -92($fp) - # GOTO label_END_32 -j label_END_32 -label_TRUE_31: - # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) - # local_c2i_at_A2I_internal_22 = 1 - li $t1, 1 - sw $t1, -92($fp) - label_END_32: -# IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_FALSEIF_29 -# IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_FALSEIF_29 -lw $t1, -92($fp) -beq $t1, 0, label_FALSEIF_29 -# LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) -# local_c2i_at_A2I_internal_21 = 7 -li $t1, 7 -sw $t1, -88($fp) -# GOTO label_ENDIF_30 -j label_ENDIF_30 -label_FALSEIF_29: - # LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_10 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -108($fp) - # LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) - # local_c2i_at_A2I_internal_25 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_26 - lw $t1, 0($fp) - lw $t2, -108($fp) - sub $t1, $t1, $t2 - sw $t1, -104($fp) - # IF_ZERO local_c2i_at_A2I_internal_25 GOTO label_TRUE_35 - # IF_ZERO local_c2i_at_A2I_internal_25 GOTO label_TRUE_35 - lw $t1, -104($fp) - beq $t1, 0, label_TRUE_35 - # LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) - # local_c2i_at_A2I_internal_25 = 0 - li $t1, 0 - sw $t1, -104($fp) - # GOTO label_END_36 -j label_END_36 -label_TRUE_35: - # LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) - # local_c2i_at_A2I_internal_25 = 1 - li $t1, 1 - sw $t1, -104($fp) - label_END_36: -# IF_ZERO local_c2i_at_A2I_internal_25 GOTO label_FALSEIF_33 -# IF_ZERO local_c2i_at_A2I_internal_25 GOTO label_FALSEIF_33 -lw $t1, -104($fp) -beq $t1, 0, label_FALSEIF_33 -# LOCAL local_c2i_at_A2I_internal_24 --> -100($fp) -# local_c2i_at_A2I_internal_24 = 8 -li $t1, 8 -sw $t1, -100($fp) -# GOTO label_ENDIF_34 -j label_ENDIF_34 -label_FALSEIF_33: - # LOCAL local_c2i_at_A2I_internal_29 --> -120($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_11 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -120($fp) - # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_29 --> -120($fp) - # local_c2i_at_A2I_internal_28 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_29 - lw $t1, 0($fp) - lw $t2, -120($fp) - sub $t1, $t1, $t2 - sw $t1, -116($fp) - # IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_TRUE_39 - # IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_TRUE_39 - lw $t1, -116($fp) - beq $t1, 0, label_TRUE_39 - # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) - # local_c2i_at_A2I_internal_28 = 0 - li $t1, 0 - sw $t1, -116($fp) - # GOTO label_END_40 -j label_END_40 -label_TRUE_39: - # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) - # local_c2i_at_A2I_internal_28 = 1 - li $t1, 1 - sw $t1, -116($fp) - label_END_40: -# IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_FALSEIF_37 -# IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_FALSEIF_37 -lw $t1, -116($fp) -beq $t1, 0, label_FALSEIF_37 -# LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) -# local_c2i_at_A2I_internal_27 = 9 -li $t1, 9 -sw $t1, -112($fp) -# GOTO label_ENDIF_38 -j label_ENDIF_38 -label_FALSEIF_37: - # LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) - # local_c2i_at_A2I_internal_32 = SELF - sw $s1, -132($fp) - # LOCAL local_c2i_at_A2I_internal_30 --> -124($fp) - # LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) - # local_c2i_at_A2I_internal_30 = local_c2i_at_A2I_internal_32 - lw $t1, -132($fp) - sw $t1, -124($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_c2i_at_A2I_internal_30 --> -124($fp) - # LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) - # local_c2i_at_A2I_internal_31 = VCALL local_c2i_at_A2I_internal_30 abort - # Save new self pointer in $s1 - lw $s1, -124($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -128($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) - # local_c2i_at_A2I_internal_27 = 0 - li $t1, 0 - sw $t1, -112($fp) - label_ENDIF_38: -# LOCAL local_c2i_at_A2I_internal_24 --> -100($fp) -# LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) -# local_c2i_at_A2I_internal_24 = local_c2i_at_A2I_internal_27 -lw $t1, -112($fp) -sw $t1, -100($fp) -label_ENDIF_34: -# LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) -# LOCAL local_c2i_at_A2I_internal_24 --> -100($fp) -# local_c2i_at_A2I_internal_21 = local_c2i_at_A2I_internal_24 -lw $t1, -100($fp) -sw $t1, -88($fp) -label_ENDIF_30: -# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) -# LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) -# local_c2i_at_A2I_internal_18 = local_c2i_at_A2I_internal_21 -lw $t1, -88($fp) -sw $t1, -76($fp) -label_ENDIF_26: -# LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) -# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) -# local_c2i_at_A2I_internal_15 = local_c2i_at_A2I_internal_18 -lw $t1, -76($fp) -sw $t1, -64($fp) -label_ENDIF_22: -# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) -# LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) -# local_c2i_at_A2I_internal_12 = local_c2i_at_A2I_internal_15 -lw $t1, -64($fp) -sw $t1, -52($fp) -label_ENDIF_18: -# LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) -# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) -# local_c2i_at_A2I_internal_9 = local_c2i_at_A2I_internal_12 -lw $t1, -52($fp) -sw $t1, -40($fp) -label_ENDIF_14: -# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) -# LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) -# local_c2i_at_A2I_internal_6 = local_c2i_at_A2I_internal_9 -lw $t1, -40($fp) -sw $t1, -28($fp) -label_ENDIF_10: -# LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) -# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) -# local_c2i_at_A2I_internal_3 = local_c2i_at_A2I_internal_6 -lw $t1, -28($fp) -sw $t1, -16($fp) -label_ENDIF_6: -# LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) -# LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) -# local_c2i_at_A2I_internal_0 = local_c2i_at_A2I_internal_3 -lw $t1, -16($fp) -sw $t1, -4($fp) -label_ENDIF_2: -# RETURN local_c2i_at_A2I_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_c2i_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 140 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_i2c_at_A2I implementation. -# @Params: -# 0($fp) = param_i2c_at_A2I_i_0 -function_i2c_at_A2I: - # Allocate stack frame for function function_i2c_at_A2I. - subu $sp, $sp, 144 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 144 - # LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_1 = PARAM param_i2c_at_A2I_i_0 - 0 - lw $t1, 0($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_ZERO local_i2c_at_A2I_internal_1 GOTO label_TRUE_43 - # IF_ZERO local_i2c_at_A2I_internal_1 GOTO label_TRUE_43 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_43 - # LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) - # local_i2c_at_A2I_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_44 -j label_END_44 -label_TRUE_43: - # LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) - # local_i2c_at_A2I_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_44: -# IF_ZERO local_i2c_at_A2I_internal_1 GOTO label_FALSEIF_41 -# IF_ZERO local_i2c_at_A2I_internal_1 GOTO label_FALSEIF_41 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_41 -# LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_12 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -12($fp) -# LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) -# LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) -# local_i2c_at_A2I_internal_0 = local_i2c_at_A2I_internal_2 -lw $t1, -12($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_42 -j label_ENDIF_42 -label_FALSEIF_41: - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_4 = PARAM param_i2c_at_A2I_i_0 - 1 - lw $t1, 0($fp) - sub $t1, $t1, 1 - sw $t1, -20($fp) - # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_47 - # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_47 - lw $t1, -20($fp) - beq $t1, 0, label_TRUE_47 - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - # local_i2c_at_A2I_internal_4 = 0 - li $t1, 0 - sw $t1, -20($fp) - # GOTO label_END_48 -j label_END_48 -label_TRUE_47: - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - # local_i2c_at_A2I_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) - label_END_48: -# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSEIF_45 -# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSEIF_45 -lw $t1, -20($fp) -beq $t1, 0, label_FALSEIF_45 -# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_13 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -24($fp) -# LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) -# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) -# local_i2c_at_A2I_internal_3 = local_i2c_at_A2I_internal_5 -lw $t1, -24($fp) -sw $t1, -16($fp) -# GOTO label_ENDIF_46 -j label_ENDIF_46 -label_FALSEIF_45: - # LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_7 = PARAM param_i2c_at_A2I_i_0 - 2 - lw $t1, 0($fp) - sub $t1, $t1, 2 - sw $t1, -32($fp) - # IF_ZERO local_i2c_at_A2I_internal_7 GOTO label_TRUE_51 - # IF_ZERO local_i2c_at_A2I_internal_7 GOTO label_TRUE_51 - lw $t1, -32($fp) - beq $t1, 0, label_TRUE_51 - # LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) - # local_i2c_at_A2I_internal_7 = 0 - li $t1, 0 - sw $t1, -32($fp) - # GOTO label_END_52 -j label_END_52 -label_TRUE_51: - # LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) - # local_i2c_at_A2I_internal_7 = 1 - li $t1, 1 - sw $t1, -32($fp) - label_END_52: -# IF_ZERO local_i2c_at_A2I_internal_7 GOTO label_FALSEIF_49 -# IF_ZERO local_i2c_at_A2I_internal_7 GOTO label_FALSEIF_49 -lw $t1, -32($fp) -beq $t1, 0, label_FALSEIF_49 -# LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_14 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -36($fp) -# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) -# LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) -# local_i2c_at_A2I_internal_6 = local_i2c_at_A2I_internal_8 -lw $t1, -36($fp) -sw $t1, -28($fp) -# GOTO label_ENDIF_50 -j label_ENDIF_50 -label_FALSEIF_49: - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_10 = PARAM param_i2c_at_A2I_i_0 - 3 - lw $t1, 0($fp) - sub $t1, $t1, 3 - sw $t1, -44($fp) - # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_55 - # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_55 - lw $t1, -44($fp) - beq $t1, 0, label_TRUE_55 - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - # local_i2c_at_A2I_internal_10 = 0 - li $t1, 0 - sw $t1, -44($fp) - # GOTO label_END_56 -j label_END_56 -label_TRUE_55: - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - # local_i2c_at_A2I_internal_10 = 1 - li $t1, 1 - sw $t1, -44($fp) - label_END_56: -# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSEIF_53 -# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSEIF_53 -lw $t1, -44($fp) -beq $t1, 0, label_FALSEIF_53 -# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_15 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -48($fp) -# LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) -# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) -# local_i2c_at_A2I_internal_9 = local_i2c_at_A2I_internal_11 -lw $t1, -48($fp) -sw $t1, -40($fp) -# GOTO label_ENDIF_54 -j label_ENDIF_54 -label_FALSEIF_53: - # LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_13 = PARAM param_i2c_at_A2I_i_0 - 4 - lw $t1, 0($fp) - sub $t1, $t1, 4 - sw $t1, -56($fp) - # IF_ZERO local_i2c_at_A2I_internal_13 GOTO label_TRUE_59 - # IF_ZERO local_i2c_at_A2I_internal_13 GOTO label_TRUE_59 - lw $t1, -56($fp) - beq $t1, 0, label_TRUE_59 - # LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) - # local_i2c_at_A2I_internal_13 = 0 - li $t1, 0 - sw $t1, -56($fp) - # GOTO label_END_60 -j label_END_60 -label_TRUE_59: - # LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) - # local_i2c_at_A2I_internal_13 = 1 - li $t1, 1 - sw $t1, -56($fp) - label_END_60: -# IF_ZERO local_i2c_at_A2I_internal_13 GOTO label_FALSEIF_57 -# IF_ZERO local_i2c_at_A2I_internal_13 GOTO label_FALSEIF_57 -lw $t1, -56($fp) -beq $t1, 0, label_FALSEIF_57 -# LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_16 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -60($fp) -# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) -# LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) -# local_i2c_at_A2I_internal_12 = local_i2c_at_A2I_internal_14 -lw $t1, -60($fp) -sw $t1, -52($fp) -# GOTO label_ENDIF_58 -j label_ENDIF_58 -label_FALSEIF_57: - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_16 = PARAM param_i2c_at_A2I_i_0 - 5 - lw $t1, 0($fp) - sub $t1, $t1, 5 - sw $t1, -68($fp) - # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_63 - # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_63 - lw $t1, -68($fp) - beq $t1, 0, label_TRUE_63 - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - # local_i2c_at_A2I_internal_16 = 0 - li $t1, 0 - sw $t1, -68($fp) - # GOTO label_END_64 -j label_END_64 -label_TRUE_63: - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - # local_i2c_at_A2I_internal_16 = 1 - li $t1, 1 - sw $t1, -68($fp) - label_END_64: -# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSEIF_61 -# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSEIF_61 -lw $t1, -68($fp) -beq $t1, 0, label_FALSEIF_61 -# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_17 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -72($fp) -# LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) -# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) -# local_i2c_at_A2I_internal_15 = local_i2c_at_A2I_internal_17 -lw $t1, -72($fp) -sw $t1, -64($fp) -# GOTO label_ENDIF_62 -j label_ENDIF_62 -label_FALSEIF_61: - # LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_19 = PARAM param_i2c_at_A2I_i_0 - 6 - lw $t1, 0($fp) - sub $t1, $t1, 6 - sw $t1, -80($fp) - # IF_ZERO local_i2c_at_A2I_internal_19 GOTO label_TRUE_67 - # IF_ZERO local_i2c_at_A2I_internal_19 GOTO label_TRUE_67 - lw $t1, -80($fp) - beq $t1, 0, label_TRUE_67 - # LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) - # local_i2c_at_A2I_internal_19 = 0 - li $t1, 0 - sw $t1, -80($fp) - # GOTO label_END_68 -j label_END_68 -label_TRUE_67: - # LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) - # local_i2c_at_A2I_internal_19 = 1 - li $t1, 1 - sw $t1, -80($fp) - label_END_68: -# IF_ZERO local_i2c_at_A2I_internal_19 GOTO label_FALSEIF_65 -# IF_ZERO local_i2c_at_A2I_internal_19 GOTO label_FALSEIF_65 -lw $t1, -80($fp) -beq $t1, 0, label_FALSEIF_65 -# LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_18 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -84($fp) -# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) -# LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) -# local_i2c_at_A2I_internal_18 = local_i2c_at_A2I_internal_20 -lw $t1, -84($fp) -sw $t1, -76($fp) -# GOTO label_ENDIF_66 -j label_ENDIF_66 -label_FALSEIF_65: - # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_22 = PARAM param_i2c_at_A2I_i_0 - 7 - lw $t1, 0($fp) - sub $t1, $t1, 7 - sw $t1, -92($fp) - # IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_TRUE_71 - # IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_TRUE_71 - lw $t1, -92($fp) - beq $t1, 0, label_TRUE_71 - # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) - # local_i2c_at_A2I_internal_22 = 0 - li $t1, 0 - sw $t1, -92($fp) - # GOTO label_END_72 -j label_END_72 -label_TRUE_71: - # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) - # local_i2c_at_A2I_internal_22 = 1 - li $t1, 1 - sw $t1, -92($fp) - label_END_72: -# IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_FALSEIF_69 -# IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_FALSEIF_69 -lw $t1, -92($fp) -beq $t1, 0, label_FALSEIF_69 -# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_19 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -96($fp) -# LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) -# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) -# local_i2c_at_A2I_internal_21 = local_i2c_at_A2I_internal_23 -lw $t1, -96($fp) -sw $t1, -88($fp) -# GOTO label_ENDIF_70 -j label_ENDIF_70 -label_FALSEIF_69: - # LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_25 = PARAM param_i2c_at_A2I_i_0 - 8 - lw $t1, 0($fp) - sub $t1, $t1, 8 - sw $t1, -104($fp) - # IF_ZERO local_i2c_at_A2I_internal_25 GOTO label_TRUE_75 - # IF_ZERO local_i2c_at_A2I_internal_25 GOTO label_TRUE_75 - lw $t1, -104($fp) - beq $t1, 0, label_TRUE_75 - # LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) - # local_i2c_at_A2I_internal_25 = 0 - li $t1, 0 - sw $t1, -104($fp) - # GOTO label_END_76 -j label_END_76 -label_TRUE_75: - # LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) - # local_i2c_at_A2I_internal_25 = 1 - li $t1, 1 - sw $t1, -104($fp) - label_END_76: -# IF_ZERO local_i2c_at_A2I_internal_25 GOTO label_FALSEIF_73 -# IF_ZERO local_i2c_at_A2I_internal_25 GOTO label_FALSEIF_73 -lw $t1, -104($fp) -beq $t1, 0, label_FALSEIF_73 -# LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_20 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -108($fp) -# LOCAL local_i2c_at_A2I_internal_24 --> -100($fp) -# LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) -# local_i2c_at_A2I_internal_24 = local_i2c_at_A2I_internal_26 -lw $t1, -108($fp) -sw $t1, -100($fp) -# GOTO label_ENDIF_74 -j label_ENDIF_74 -label_FALSEIF_73: - # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_28 = PARAM param_i2c_at_A2I_i_0 - 9 - lw $t1, 0($fp) - sub $t1, $t1, 9 - sw $t1, -116($fp) - # IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_TRUE_79 - # IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_TRUE_79 - lw $t1, -116($fp) - beq $t1, 0, label_TRUE_79 - # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) - # local_i2c_at_A2I_internal_28 = 0 - li $t1, 0 - sw $t1, -116($fp) - # GOTO label_END_80 -j label_END_80 -label_TRUE_79: - # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) - # local_i2c_at_A2I_internal_28 = 1 - li $t1, 1 - sw $t1, -116($fp) - label_END_80: -# IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_FALSEIF_77 -# IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_FALSEIF_77 -lw $t1, -116($fp) -beq $t1, 0, label_FALSEIF_77 -# LOCAL local_i2c_at_A2I_internal_29 --> -120($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_21 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -120($fp) -# LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) -# LOCAL local_i2c_at_A2I_internal_29 --> -120($fp) -# local_i2c_at_A2I_internal_27 = local_i2c_at_A2I_internal_29 -lw $t1, -120($fp) -sw $t1, -112($fp) -# GOTO label_ENDIF_78 -j label_ENDIF_78 -label_FALSEIF_77: - # LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) - # local_i2c_at_A2I_internal_32 = SELF - sw $s1, -132($fp) - # LOCAL local_i2c_at_A2I_internal_30 --> -124($fp) - # LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) - # local_i2c_at_A2I_internal_30 = local_i2c_at_A2I_internal_32 - lw $t1, -132($fp) - sw $t1, -124($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2c_at_A2I_internal_30 --> -124($fp) - # LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) - # local_i2c_at_A2I_internal_31 = VCALL local_i2c_at_A2I_internal_30 abort - # Save new self pointer in $s1 - lw $s1, -124($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -128($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_22 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -136($fp) - # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) - # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) - # local_i2c_at_A2I_internal_27 = local_i2c_at_A2I_internal_33 - lw $t1, -136($fp) - sw $t1, -112($fp) - label_ENDIF_78: -# LOCAL local_i2c_at_A2I_internal_24 --> -100($fp) -# LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) -# local_i2c_at_A2I_internal_24 = local_i2c_at_A2I_internal_27 -lw $t1, -112($fp) -sw $t1, -100($fp) -label_ENDIF_74: -# LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) -# LOCAL local_i2c_at_A2I_internal_24 --> -100($fp) -# local_i2c_at_A2I_internal_21 = local_i2c_at_A2I_internal_24 -lw $t1, -100($fp) -sw $t1, -88($fp) -label_ENDIF_70: -# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) -# LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) -# local_i2c_at_A2I_internal_18 = local_i2c_at_A2I_internal_21 -lw $t1, -88($fp) -sw $t1, -76($fp) -label_ENDIF_66: -# LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) -# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) -# local_i2c_at_A2I_internal_15 = local_i2c_at_A2I_internal_18 -lw $t1, -76($fp) -sw $t1, -64($fp) -label_ENDIF_62: -# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) -# LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) -# local_i2c_at_A2I_internal_12 = local_i2c_at_A2I_internal_15 -lw $t1, -64($fp) -sw $t1, -52($fp) -label_ENDIF_58: -# LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) -# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) -# local_i2c_at_A2I_internal_9 = local_i2c_at_A2I_internal_12 -lw $t1, -52($fp) -sw $t1, -40($fp) -label_ENDIF_54: -# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) -# LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) -# local_i2c_at_A2I_internal_6 = local_i2c_at_A2I_internal_9 -lw $t1, -40($fp) -sw $t1, -28($fp) -label_ENDIF_50: -# LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) -# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) -# local_i2c_at_A2I_internal_3 = local_i2c_at_A2I_internal_6 -lw $t1, -28($fp) -sw $t1, -16($fp) -label_ENDIF_46: -# LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) -# LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) -# local_i2c_at_A2I_internal_0 = local_i2c_at_A2I_internal_3 -lw $t1, -16($fp) -sw $t1, -4($fp) -label_ENDIF_42: -# RETURN local_i2c_at_A2I_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_i2c_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 144 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_a2i_at_A2I implementation. -# @Params: -# 0($fp) = param_a2i_at_A2I_s_0 -function_a2i_at_A2I: - # Allocate stack frame for function function_a2i_at_A2I. - subu $sp, $sp, 144 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 144 - # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) - # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - # local_a2i_at_A2I_internal_2 = PARAM param_a2i_at_A2I_s_0 - lw $t1, 0($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # local_a2i_at_A2I_internal_3 = VCALL local_a2i_at_A2I_internal_2 length - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # local_a2i_at_A2I_internal_1 = local_a2i_at_A2I_internal_3 - 0 - lw $t1, -16($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_ZERO local_a2i_at_A2I_internal_1 GOTO label_TRUE_83 - # IF_ZERO local_a2i_at_A2I_internal_1 GOTO label_TRUE_83 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_83 - # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) - # local_a2i_at_A2I_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_84 -j label_END_84 -label_TRUE_83: - # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) - # local_a2i_at_A2I_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_84: -# IF_ZERO local_a2i_at_A2I_internal_1 GOTO label_FALSEIF_81 -# IF_ZERO local_a2i_at_A2I_internal_1 GOTO label_FALSEIF_81 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_81 -# LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) -# local_a2i_at_A2I_internal_0 = 0 -li $t1, 0 -sw $t1, -4($fp) -# GOTO label_ENDIF_82 -j label_ENDIF_82 -label_FALSEIF_81: - # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) - # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - # local_a2i_at_A2I_internal_6 = PARAM param_a2i_at_A2I_s_0 - lw $t1, 0($fp) - sw $t1, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 0 - li $t1, 0 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # ARG 1 - li $t1, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) - # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) - # local_a2i_at_A2I_internal_7 = VCALL local_a2i_at_A2I_internal_6 substr - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 16($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_23 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -36($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) - # LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) - # local_a2i_at_A2I_internal_5 = local_a2i_at_A2I_internal_7 - local_a2i_at_A2I_internal_8 - lw $t1, -32($fp) - lw $t2, -36($fp) - sub $t1, $t1, $t2 - sw $t1, -24($fp) - # IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_TRUE_87 - # IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_TRUE_87 - lw $t1, -24($fp) - beq $t1, 0, label_TRUE_87 - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # local_a2i_at_A2I_internal_5 = 0 - li $t1, 0 - sw $t1, -24($fp) - # GOTO label_END_88 -j label_END_88 -label_TRUE_87: - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # local_a2i_at_A2I_internal_5 = 1 - li $t1, 1 - sw $t1, -24($fp) - label_END_88: -# IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_FALSEIF_85 -# IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_FALSEIF_85 -lw $t1, -24($fp) -beq $t1, 0, label_FALSEIF_85 -# LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) -# local_a2i_at_A2I_internal_12 = SELF -sw $s1, -52($fp) -# LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) -# LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) -# local_a2i_at_A2I_internal_10 = local_a2i_at_A2I_internal_12 -lw $t1, -52($fp) -sw $t1, -44($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_13 = PARAM param_a2i_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -56($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG 1 -li $t1, 1 -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_16 = PARAM param_a2i_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -68($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) -# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) -# local_a2i_at_A2I_internal_17 = VCALL local_a2i_at_A2I_internal_16 length -# Save new self pointer in $s1 -lw $s1, -68($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 20($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -72($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) -# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) -# local_a2i_at_A2I_internal_15 = local_a2i_at_A2I_internal_17 - 1 -lw $t1, -72($fp) -sub $t1, $t1, 1 -sw $t1, -64($fp) -# ARG local_a2i_at_A2I_internal_15 -# LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) -lw $t1, -64($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) -# LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) -# local_a2i_at_A2I_internal_14 = VCALL local_a2i_at_A2I_internal_13 substr -# Save new self pointer in $s1 -lw $s1, -56($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 16($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -60($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_a2i_at_A2I_internal_14 -# LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) -lw $t1, -60($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) -# LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) -# local_a2i_at_A2I_internal_11 = VCALL local_a2i_at_A2I_internal_10 a2i_aux -# Save new self pointer in $s1 -lw $s1, -44($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 24($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -48($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) -# LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) -lw $t1, -48($fp) -not $t1, $t1 -sw $t1, -40($fp) -# LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) -# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) -# local_a2i_at_A2I_internal_4 = local_a2i_at_A2I_internal_9 -lw $t1, -40($fp) -sw $t1, -20($fp) -# GOTO label_ENDIF_86 -j label_ENDIF_86 -label_FALSEIF_85: - # LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) - # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - # local_a2i_at_A2I_internal_20 = PARAM param_a2i_at_A2I_s_0 - lw $t1, 0($fp) - sw $t1, -84($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 0 - li $t1, 0 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # ARG 1 - li $t1, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) - # LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) - # local_a2i_at_A2I_internal_21 = VCALL local_a2i_at_A2I_internal_20 substr - # Save new self pointer in $s1 - lw $s1, -84($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 16($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -88($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_22 --> -92($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_24 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -92($fp) - # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) - # LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) - # LOCAL local_a2i_at_A2I_internal_22 --> -92($fp) - # local_a2i_at_A2I_internal_19 = local_a2i_at_A2I_internal_21 - local_a2i_at_A2I_internal_22 - lw $t1, -88($fp) - lw $t2, -92($fp) - sub $t1, $t1, $t2 - sw $t1, -80($fp) - # IF_ZERO local_a2i_at_A2I_internal_19 GOTO label_TRUE_91 - # IF_ZERO local_a2i_at_A2I_internal_19 GOTO label_TRUE_91 - lw $t1, -80($fp) - beq $t1, 0, label_TRUE_91 - # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) - # local_a2i_at_A2I_internal_19 = 0 - li $t1, 0 - sw $t1, -80($fp) - # GOTO label_END_92 -j label_END_92 -label_TRUE_91: - # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) - # local_a2i_at_A2I_internal_19 = 1 - li $t1, 1 - sw $t1, -80($fp) - label_END_92: -# IF_ZERO local_a2i_at_A2I_internal_19 GOTO label_FALSEIF_89 -# IF_ZERO local_a2i_at_A2I_internal_19 GOTO label_FALSEIF_89 -lw $t1, -80($fp) -beq $t1, 0, label_FALSEIF_89 -# LOCAL local_a2i_at_A2I_internal_25 --> -104($fp) -# local_a2i_at_A2I_internal_25 = SELF -sw $s1, -104($fp) -# LOCAL local_a2i_at_A2I_internal_23 --> -96($fp) -# LOCAL local_a2i_at_A2I_internal_25 --> -104($fp) -# local_a2i_at_A2I_internal_23 = local_a2i_at_A2I_internal_25 -lw $t1, -104($fp) -sw $t1, -96($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_26 --> -108($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_26 = PARAM param_a2i_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -108($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG 1 -li $t1, 1 -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_29 = PARAM param_a2i_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -120($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) -# LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) -# local_a2i_at_A2I_internal_30 = VCALL local_a2i_at_A2I_internal_29 length -# Save new self pointer in $s1 -lw $s1, -120($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 20($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -124($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_28 --> -116($fp) -# LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) -# local_a2i_at_A2I_internal_28 = local_a2i_at_A2I_internal_30 - 1 -lw $t1, -124($fp) -sub $t1, $t1, 1 -sw $t1, -116($fp) -# ARG local_a2i_at_A2I_internal_28 -# LOCAL local_a2i_at_A2I_internal_28 --> -116($fp) -lw $t1, -116($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_26 --> -108($fp) -# LOCAL local_a2i_at_A2I_internal_27 --> -112($fp) -# local_a2i_at_A2I_internal_27 = VCALL local_a2i_at_A2I_internal_26 substr -# Save new self pointer in $s1 -lw $s1, -108($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 16($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -112($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_a2i_at_A2I_internal_27 -# LOCAL local_a2i_at_A2I_internal_27 --> -112($fp) -lw $t1, -112($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_23 --> -96($fp) -# LOCAL local_a2i_at_A2I_internal_24 --> -100($fp) -# local_a2i_at_A2I_internal_24 = VCALL local_a2i_at_A2I_internal_23 a2i_aux -# Save new self pointer in $s1 -lw $s1, -96($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 24($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -100($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) -# LOCAL local_a2i_at_A2I_internal_24 --> -100($fp) -# local_a2i_at_A2I_internal_18 = local_a2i_at_A2I_internal_24 -lw $t1, -100($fp) -sw $t1, -76($fp) -# GOTO label_ENDIF_90 -j label_ENDIF_90 -label_FALSEIF_89: - # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) - # local_a2i_at_A2I_internal_33 = SELF - sw $s1, -136($fp) - # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) - # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) - # local_a2i_at_A2I_internal_31 = local_a2i_at_A2I_internal_33 - lw $t1, -136($fp) - sw $t1, -128($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_a2i_at_A2I_s_0 - # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - lw $t1, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) - # LOCAL local_a2i_at_A2I_internal_32 --> -132($fp) - # local_a2i_at_A2I_internal_32 = VCALL local_a2i_at_A2I_internal_31 a2i_aux - # Save new self pointer in $s1 - lw $s1, -128($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 24($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -132($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) - # LOCAL local_a2i_at_A2I_internal_32 --> -132($fp) - # local_a2i_at_A2I_internal_18 = local_a2i_at_A2I_internal_32 - lw $t1, -132($fp) - sw $t1, -76($fp) - label_ENDIF_90: -# LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) -# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) -# local_a2i_at_A2I_internal_4 = local_a2i_at_A2I_internal_18 -lw $t1, -76($fp) -sw $t1, -20($fp) -label_ENDIF_86: -# LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) -# LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) -# local_a2i_at_A2I_internal_0 = local_a2i_at_A2I_internal_4 -lw $t1, -20($fp) -sw $t1, -4($fp) -label_ENDIF_82: -# RETURN local_a2i_at_A2I_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_a2i_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 144 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_a2i_aux_at_A2I implementation. -# @Params: -# 0($fp) = param_a2i_aux_at_A2I_s_0 -function_a2i_aux_at_A2I: - # Allocate stack frame for function function_a2i_aux_at_A2I. - subu $sp, $sp, 64 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 64 - # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) - # local_a2i_aux_at_A2I_int_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # LOCAL local_a2i_aux_at_A2I_internal_2 --> -12($fp) - # PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) - # local_a2i_aux_at_A2I_internal_2 = PARAM param_a2i_aux_at_A2I_s_0 - lw $t1, 0($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_aux_at_A2I_internal_2 --> -12($fp) - # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) - # local_a2i_aux_at_A2I_internal_3 = VCALL local_a2i_aux_at_A2I_internal_2 length - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_aux_at_A2I_j_1 --> -8($fp) - # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) - # local_a2i_aux_at_A2I_j_1 = local_a2i_aux_at_A2I_internal_3 - lw $t1, -16($fp) - sw $t1, -8($fp) - # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) - # local_a2i_aux_at_A2I_i_4 = 0 - li $t1, 0 - sw $t1, -20($fp) - label_WHILE_93: - # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) - # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) - # LOCAL local_a2i_aux_at_A2I_j_1 --> -8($fp) - # local_a2i_aux_at_A2I_internal_5 = local_a2i_aux_at_A2I_i_4 - local_a2i_aux_at_A2I_j_1 - lw $t1, -20($fp) - lw $t2, -8($fp) - sub $t1, $t1, $t2 - sw $t1, -24($fp) - # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 - # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 - lw $t1, -24($fp) - bgt $t1, 0, label_FALSE_95 - # IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 - # IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 - lw $t1, -24($fp) - beq $t1, 0, label_FALSE_95 - # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) - # local_a2i_aux_at_A2I_internal_5 = 1 - li $t1, 1 - sw $t1, -24($fp) - # GOTO label_END_96 -j label_END_96 -label_FALSE_95: - # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) - # local_a2i_aux_at_A2I_internal_5 = 0 - li $t1, 0 - sw $t1, -24($fp) - label_END_96: -# IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_WHILE_END_94 -# IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_WHILE_END_94 -lw $t1, -24($fp) -beq $t1, 0, label_WHILE_END_94 -# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) -# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) -# local_a2i_aux_at_A2I_internal_7 = local_a2i_aux_at_A2I_int_0 * 10 -lw $t1, -4($fp) -mul $t1, $t1, 10 -sw $t1, -32($fp) -# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) -# local_a2i_aux_at_A2I_internal_10 = SELF -sw $s1, -44($fp) -# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) -# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) -# local_a2i_aux_at_A2I_internal_8 = local_a2i_aux_at_A2I_internal_10 -lw $t1, -44($fp) -sw $t1, -36($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) -# PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) -# local_a2i_aux_at_A2I_internal_11 = PARAM param_a2i_aux_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -48($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_a2i_aux_at_A2I_i_4 -# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) -lw $t1, -20($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# ARG 1 -li $t1, 1 -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) -# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) -# local_a2i_aux_at_A2I_internal_12 = VCALL local_a2i_aux_at_A2I_internal_11 substr -# Save new self pointer in $s1 -lw $s1, -48($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 16($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -52($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_a2i_aux_at_A2I_internal_12 -# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) -lw $t1, -52($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) -# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) -# local_a2i_aux_at_A2I_internal_9 = VCALL local_a2i_aux_at_A2I_internal_8 c2i -# Save new self pointer in $s1 -lw $s1, -36($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 12($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -40($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) -# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) -# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) -# local_a2i_aux_at_A2I_internal_6 = local_a2i_aux_at_A2I_internal_7 + local_a2i_aux_at_A2I_internal_9 -lw $t1, -32($fp) -lw $t2, -40($fp) -add $t1, $t1, $t2 -sw $t1, -28($fp) -# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) -# LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) -# local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_6 -lw $t1, -28($fp) -sw $t1, -4($fp) -# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) -# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) -# local_a2i_aux_at_A2I_internal_13 = local_a2i_aux_at_A2I_i_4 + 1 -lw $t1, -20($fp) -add $t1, $t1, 1 -sw $t1, -56($fp) -# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) -# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) -# local_a2i_aux_at_A2I_i_4 = local_a2i_aux_at_A2I_internal_13 -lw $t1, -56($fp) -sw $t1, -20($fp) -# GOTO label_WHILE_93 -j label_WHILE_93 -label_WHILE_END_94: - # RETURN local_a2i_aux_at_A2I_int_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_a2i_aux_at_A2I. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 64 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_i2a_at_A2I implementation. -# @Params: -# 0($fp) = param_i2a_at_A2I_i_0 -function_i2a_at_A2I: - # Allocate stack frame for function function_i2a_at_A2I. - subu $sp, $sp, 68 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 68 - # LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # local_i2a_at_A2I_internal_1 = PARAM param_i2a_at_A2I_i_0 - 0 - lw $t1, 0($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_ZERO local_i2a_at_A2I_internal_1 GOTO label_TRUE_99 - # IF_ZERO local_i2a_at_A2I_internal_1 GOTO label_TRUE_99 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_99 - # LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) - # local_i2a_at_A2I_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_100 -j label_END_100 -label_TRUE_99: - # LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) - # local_i2a_at_A2I_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_100: -# IF_ZERO local_i2a_at_A2I_internal_1 GOTO label_FALSEIF_97 -# IF_ZERO local_i2a_at_A2I_internal_1 GOTO label_FALSEIF_97 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_97 -# LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_25 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -12($fp) -# LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) -# LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) -# local_i2a_at_A2I_internal_0 = local_i2a_at_A2I_internal_2 -lw $t1, -12($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_98 -j label_ENDIF_98 -label_FALSEIF_97: - # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # local_i2a_at_A2I_internal_4 = 0 - PARAM param_i2a_at_A2I_i_0 - li $t1, 0 - lw $t2, 0($fp) - sub $t1, $t1, $t2 - sw $t1, -20($fp) - # IF_GREATER_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_103 - # IF_GREATER_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_103 - lw $t1, -20($fp) - bgt $t1, 0, label_FALSE_103 - # IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_103 - # IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_103 - lw $t1, -20($fp) - beq $t1, 0, label_FALSE_103 - # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) - # local_i2a_at_A2I_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) - # GOTO label_END_104 -j label_END_104 -label_FALSE_103: - # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) - # local_i2a_at_A2I_internal_4 = 0 - li $t1, 0 - sw $t1, -20($fp) - label_END_104: -# IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSEIF_101 -# IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSEIF_101 -lw $t1, -20($fp) -beq $t1, 0, label_FALSEIF_101 -# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) -# local_i2a_at_A2I_internal_7 = SELF -sw $s1, -32($fp) -# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) -# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) -# local_i2a_at_A2I_internal_5 = local_i2a_at_A2I_internal_7 -lw $t1, -32($fp) -sw $t1, -24($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_i2a_at_A2I_i_0 -# PARAM param_i2a_at_A2I_i_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) -# LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) -# local_i2a_at_A2I_internal_6 = VCALL local_i2a_at_A2I_internal_5 i2a_aux -# Save new self pointer in $s1 -lw $s1, -24($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 32($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -28($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) -# LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) -# local_i2a_at_A2I_internal_3 = local_i2a_at_A2I_internal_6 -lw $t1, -28($fp) -sw $t1, -16($fp) -# GOTO label_ENDIF_102 -j label_ENDIF_102 -label_FALSEIF_101: - # LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_26 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -44($fp) - # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) - # LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) - # local_i2a_at_A2I_internal_8 = local_i2a_at_A2I_internal_10 - lw $t1, -44($fp) - sw $t1, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2a_at_A2I_internal_13 --> -56($fp) - # local_i2a_at_A2I_internal_13 = SELF - sw $s1, -56($fp) - # LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) - # LOCAL local_i2a_at_A2I_internal_13 --> -56($fp) - # local_i2a_at_A2I_internal_11 = local_i2a_at_A2I_internal_13 - lw $t1, -56($fp) - sw $t1, -48($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2a_at_A2I_internal_14 --> -60($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # local_i2a_at_A2I_internal_14 = PARAM param_i2a_at_A2I_i_0 * 1 - lw $t1, 0($fp) - mul $t1, $t1, 1 - sw $t1, -60($fp) - # ARG local_i2a_at_A2I_internal_14 - # LOCAL local_i2a_at_A2I_internal_14 --> -60($fp) - lw $t1, -60($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) - # LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) - # local_i2a_at_A2I_internal_12 = VCALL local_i2a_at_A2I_internal_11 i2a_aux - # Save new self pointer in $s1 - lw $s1, -48($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 32($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -52($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_i2a_at_A2I_internal_12 - # LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) - lw $t1, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) - # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) - # local_i2a_at_A2I_internal_9 = VCALL local_i2a_at_A2I_internal_8 concat - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) - # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) - # local_i2a_at_A2I_internal_3 = local_i2a_at_A2I_internal_9 - lw $t1, -40($fp) - sw $t1, -16($fp) - label_ENDIF_102: -# LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) -# LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) -# local_i2a_at_A2I_internal_0 = local_i2a_at_A2I_internal_3 -lw $t1, -16($fp) -sw $t1, -4($fp) -label_ENDIF_98: -# RETURN local_i2a_at_A2I_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_i2a_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 68 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_i2a_aux_at_A2I implementation. -# @Params: -# 0($fp) = param_i2a_aux_at_A2I_i_0 -function_i2a_aux_at_A2I: - # Allocate stack frame for function function_i2a_aux_at_A2I. - subu $sp, $sp, 68 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 68 - # LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # local_i2a_aux_at_A2I_internal_1 = PARAM param_i2a_aux_at_A2I_i_0 - 0 - lw $t1, 0($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_ZERO local_i2a_aux_at_A2I_internal_1 GOTO label_TRUE_107 - # IF_ZERO local_i2a_aux_at_A2I_internal_1 GOTO label_TRUE_107 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_107 - # LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) - # local_i2a_aux_at_A2I_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_108 -j label_END_108 -label_TRUE_107: - # LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) - # local_i2a_aux_at_A2I_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_108: -# IF_ZERO local_i2a_aux_at_A2I_internal_1 GOTO label_FALSEIF_105 -# IF_ZERO local_i2a_aux_at_A2I_internal_1 GOTO label_FALSEIF_105 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_105 -# LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_27 -sw $t1, 12($v0) -li $t1, 0 -sw $t1, 16($v0) -sw $v0, -12($fp) -# LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) -# LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) -# local_i2a_aux_at_A2I_internal_0 = local_i2a_aux_at_A2I_internal_2 -lw $t1, -12($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_106 -j label_ENDIF_106 -label_FALSEIF_105: - # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # local_i2a_aux_at_A2I_internal_4 = PARAM param_i2a_aux_at_A2I_i_0 / 10 - lw $t1, 0($fp) - div $t1, $t1, 10 - sw $t1, -20($fp) - # LOCAL local_i2a_aux_at_A2I_next_3 --> -16($fp) - # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) - # local_i2a_aux_at_A2I_next_3 = local_i2a_aux_at_A2I_internal_4 - lw $t1, -20($fp) - sw $t1, -16($fp) - # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) - # local_i2a_aux_at_A2I_internal_9 = SELF - sw $s1, -40($fp) - # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) - # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) - # local_i2a_aux_at_A2I_internal_7 = local_i2a_aux_at_A2I_internal_9 - lw $t1, -40($fp) - sw $t1, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_i2a_aux_at_A2I_next_3 - # LOCAL local_i2a_aux_at_A2I_next_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) - # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) - # local_i2a_aux_at_A2I_internal_8 = VCALL local_i2a_aux_at_A2I_internal_7 i2a_aux - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 32($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) - # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) - # local_i2a_aux_at_A2I_internal_5 = local_i2a_aux_at_A2I_internal_8 - lw $t1, -36($fp) - sw $t1, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) - # local_i2a_aux_at_A2I_internal_12 = SELF - sw $s1, -52($fp) - # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) - # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) - # local_i2a_aux_at_A2I_internal_10 = local_i2a_aux_at_A2I_internal_12 - lw $t1, -52($fp) - sw $t1, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_14 --> -60($fp) - # LOCAL local_i2a_aux_at_A2I_next_3 --> -16($fp) - # local_i2a_aux_at_A2I_internal_14 = local_i2a_aux_at_A2I_next_3 * 10 - lw $t1, -16($fp) - mul $t1, $t1, 10 - sw $t1, -60($fp) - # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_aux_at_A2I_internal_14 --> -60($fp) - # local_i2a_aux_at_A2I_internal_13 = PARAM param_i2a_aux_at_A2I_i_0 - local_i2a_aux_at_A2I_internal_14 - lw $t1, 0($fp) - lw $t2, -60($fp) - sub $t1, $t1, $t2 - sw $t1, -56($fp) - # ARG local_i2a_aux_at_A2I_internal_13 - # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) - lw $t1, -56($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) - # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) - # local_i2a_aux_at_A2I_internal_11 = VCALL local_i2a_aux_at_A2I_internal_10 i2c - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 16($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_i2a_aux_at_A2I_internal_11 - # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) - lw $t1, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) - # LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) - # local_i2a_aux_at_A2I_internal_6 = VCALL local_i2a_aux_at_A2I_internal_5 concat - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) - # LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) - # local_i2a_aux_at_A2I_internal_0 = local_i2a_aux_at_A2I_internal_6 - lw $t1, -28($fp) - sw $t1, -4($fp) - label_ENDIF_106: -# RETURN local_i2a_aux_at_A2I_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_i2a_aux_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 68 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 100 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 100 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = ALLOCATE A2I - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, A2I - sw $t3, 12($v0) - li $t3, 3 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, A2I_start - sw $t3, 4($v0) - # Load type offset - li $t3, 16 - sw $t3, 8($v0) - move $t2, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t2, -16($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t2, -16($fp) - sw $t2, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_28 - sw $t2, 12($v0) - li $t2, 6 - sw $t2, 16($v0) - sw $v0, -20($fp) - # ARG local_main_at_Main_internal_4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - lw $t2, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 a2i - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 20($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_a_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_a_0 = local_main_at_Main_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) - # LOCAL local_main_at_Main_b_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_0 - sw $t2, 12($v0) - li $t2, 0 - sw $t2, 16($v0) - sw $v0, -24($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = ALLOCATE A2I - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, A2I - sw $t4, 12($v0) - li $t4, 3 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, A2I_start - sw $t4, 4($v0) - # Load type offset - li $t4, 16 - sw $t4, 8($v0) - move $t3, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t3, -36($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 - lw $t3, -36($fp) - sw $t3, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 678987 - li $t3, 678987 - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 i2a - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 28($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_b_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_b_5 = local_main_at_Main_internal_7 - lw $t3, -32($fp) - sw $t3, -24($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 - lw $t3, -48($fp) - sw $t3, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_main_at_Main_a_0 - # LOCAL local_main_at_Main_a_0 --> -4($fp) - lw $t3, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_int - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 16($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 - lw $t3, -60($fp) - sw $t3, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_29 - sw $t3, 12($v0) - li $t3, 4 - sw $t3, 16($v0) - sw $v0, -64($fp) - # ARG local_main_at_Main_internal_15 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - lw $t3, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 12($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 - lw $t3, -76($fp) - sw $t3, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_main_at_Main_b_5 - # LOCAL local_main_at_Main_b_5 --> -24($fp) - lw $t3, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 12($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # local_main_at_Main_internal_21 = SELF - sw $s1, -88($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 - lw $t3, -88($fp) - sw $t3, -80($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_30 - sw $t3, 12($v0) - li $t3, 1 - sw $t3, 16($v0) - sw $v0, -92($fp) - # ARG local_main_at_Main_internal_22 - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - lw $t3, -92($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 out_string - # Save new self pointer in $s1 - lw $s1, -80($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 12($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -84($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_20 - lw $v0, -84($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 100 - jr $ra - # Function END - diff --git a/tests/codegen/book_list.mips b/tests/codegen/book_list.mips deleted file mode 100644 index 6cb353da..00000000 --- a/tests/codegen/book_list.mips +++ /dev/null @@ -1,2975 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:19 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Book: .asciiz "Book" -# Function END -Article: .asciiz "Article" -# Function END -BookList: .asciiz "BookList" -# Function END -Cons: .asciiz "Cons" -# Function END -Nil: .asciiz "Nil" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Book **** -Book_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_initBook_at_Book, function_print_at_Book -# Function END -# - - -# **** Type RECORD for type Book **** -Book_start: - Book_vtable_pointer: .word Book_vtable - # Function END -Book_end: -# - - -# **** VTABLE for type Article **** -Article_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_initBook_at_Book, function_print_at_Article, function_initArticle_at_Article -# Function END -# - - -# **** Type RECORD for type Article **** -Article_start: - Article_vtable_pointer: .word Article_vtable - # Function END -Article_end: -# - - -# **** VTABLE for type BookList **** -BookList_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_BookList, function_cons_at_BookList, function_car_at_BookList, function_cdr_at_BookList, function_print_list_at_BookList -# Function END -# - - -# **** Type RECORD for type BookList **** -BookList_start: - BookList_vtable_pointer: .word BookList_vtable - # Function END -BookList_end: -# - - -# **** VTABLE for type Cons **** -Cons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_Cons, function_cons_at_BookList, function_car_at_Cons, function_cdr_at_Cons, function_print_list_at_Cons, function_init_at_Cons -# Function END -# - - -# **** Type RECORD for type Cons **** -Cons_start: - Cons_vtable_pointer: .word Cons_vtable - # Function END -Cons_end: -# - - -# **** VTABLE for type Nil **** -Nil_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_Nil, function_cons_at_BookList, function_car_at_BookList, function_cdr_at_BookList, function_print_list_at_Nil -# Function END -# - - -# **** Type RECORD for type Nil **** -Nil_start: - Nil_vtable_pointer: .word Nil_vtable - # Function END -Nil_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -IO__TDT: .word 0, -1, -1, -1, 1, 2, 1, 2, 2, -1 -Object__TDT: .word 1, 0, 1, 1, 2, 3, 2, 3, 3, 1 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 -Book__TDT: .word -1, -1, -1, -1, 0, 1, -1, -1, -1, -1 -Article__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1, -1 -BookList__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 1, -1 -Cons__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 -Nil__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 -# - - -data_2: .asciiz "title: " -# - - -data_3: .asciiz "\n" -# - - -data_4: .asciiz "author: " -# - - -data_5: .asciiz "\n" -# - - -data_6: .asciiz "periodical: " -# - - -data_7: .asciiz "\n" -# - - -data_8: .asciiz "- dynamic type was Book -\n" -# - - -data_9: .asciiz "- dynamic type was Article -\n" -# - - -data_10: .asciiz "Compilers, Principles, Techniques, and Tools" -# - - -data_11: .asciiz "Aho, Sethi, and Ullman" -# - - -data_12: .asciiz "The Top 100 CD_ROMs" -# - - -data_13: .asciiz "Ulanoff" -# - - -data_14: .asciiz "PC Magazine" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - li $a0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) - # Load type offset - li $t2, 36 - sw $t2, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__books__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t1, Main_vtable - # Get pointer to function address - lw $t2, 12($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Book__attrib__title__init implementation. -# @Params: -__Book__attrib__title__init: - # Allocate stack frame for function __Book__attrib__title__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__title__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_0 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__title__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Book__attrib__title__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Book__attrib__author__init implementation. -# @Params: -__Book__attrib__author__init: - # Allocate stack frame for function __Book__attrib__author__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__author__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_0 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__author__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Book__attrib__author__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_initBook_at_Book implementation. -# @Params: -# 0($fp) = param_initBook_at_Book_title_p_0 -# 4($fp) = param_initBook_at_Book_author_p_1 -function_initBook_at_Book: - # Allocate stack frame for function function_initBook_at_Book. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_initBook_at_Book_title_p_0 --> 4($fp) - lw $t1, 4($fp) - sw $t1, 12($s1) - # - # PARAM param_initBook_at_Book_author_p_1 --> 0($fp) - lw $t1, 0($fp) - sw $t1, 16($s1) - # LOCAL local_initBook_at_Book_internal_0 --> -4($fp) - # local_initBook_at_Book_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_initBook_at_Book_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_initBook_at_Book. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_print_at_Book implementation. -# @Params: -function_print_at_Book: - # Allocate stack frame for function function_print_at_Book. - subu $sp, $sp, 92 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 92 - # LOCAL local_print_at_Book_internal_6 --> -28($fp) - # local_print_at_Book_internal_6 = SELF - sw $s1, -28($fp) - # LOCAL local_print_at_Book_internal_4 --> -20($fp) - # LOCAL local_print_at_Book_internal_6 --> -28($fp) - # local_print_at_Book_internal_4 = local_print_at_Book_internal_6 - lw $t1, -28($fp) - sw $t1, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Book_internal_7 --> -32($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_2 - sw $t1, 12($v0) - li $t1, 12 - sw $t1, 16($v0) - sw $v0, -32($fp) - # ARG local_print_at_Book_internal_7 - # LOCAL local_print_at_Book_internal_7 --> -32($fp) - lw $t1, -32($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_4 --> -20($fp) - # LOCAL local_print_at_Book_internal_5 --> -24($fp) - # local_print_at_Book_internal_5 = VCALL local_print_at_Book_internal_4 out_string - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_2 --> -12($fp) - # LOCAL local_print_at_Book_internal_5 --> -24($fp) - # local_print_at_Book_internal_2 = local_print_at_Book_internal_5 - lw $t1, -24($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Book_internal_8 = GETATTRIBUTE title Book - # LOCAL local_print_at_Book_internal_8 --> -36($fp) - lw $t1, 12($s1) - sw $t1, -36($fp) - # ARG local_print_at_Book_internal_8 - # LOCAL local_print_at_Book_internal_8 --> -36($fp) - lw $t1, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_2 --> -12($fp) - # LOCAL local_print_at_Book_internal_3 --> -16($fp) - # local_print_at_Book_internal_3 = VCALL local_print_at_Book_internal_2 out_string - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_0 --> -4($fp) - # LOCAL local_print_at_Book_internal_3 --> -16($fp) - # local_print_at_Book_internal_0 = local_print_at_Book_internal_3 - lw $t1, -16($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Book_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_3 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -40($fp) - # ARG local_print_at_Book_internal_9 - # LOCAL local_print_at_Book_internal_9 --> -40($fp) - lw $t1, -40($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_0 --> -4($fp) - # LOCAL local_print_at_Book_internal_1 --> -8($fp) - # local_print_at_Book_internal_1 = VCALL local_print_at_Book_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_16 --> -68($fp) - # local_print_at_Book_internal_16 = SELF - sw $s1, -68($fp) - # LOCAL local_print_at_Book_internal_14 --> -60($fp) - # LOCAL local_print_at_Book_internal_16 --> -68($fp) - # local_print_at_Book_internal_14 = local_print_at_Book_internal_16 - lw $t1, -68($fp) - sw $t1, -60($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Book_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_4 - sw $t1, 12($v0) - li $t1, 12 - sw $t1, 16($v0) - sw $v0, -72($fp) - # ARG local_print_at_Book_internal_17 - # LOCAL local_print_at_Book_internal_17 --> -72($fp) - lw $t1, -72($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_14 --> -60($fp) - # LOCAL local_print_at_Book_internal_15 --> -64($fp) - # local_print_at_Book_internal_15 = VCALL local_print_at_Book_internal_14 out_string - # Save new self pointer in $s1 - lw $s1, -60($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -64($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_12 --> -52($fp) - # LOCAL local_print_at_Book_internal_15 --> -64($fp) - # local_print_at_Book_internal_12 = local_print_at_Book_internal_15 - lw $t1, -64($fp) - sw $t1, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Book_internal_18 = GETATTRIBUTE author Book - # LOCAL local_print_at_Book_internal_18 --> -76($fp) - lw $t1, 16($s1) - sw $t1, -76($fp) - # ARG local_print_at_Book_internal_18 - # LOCAL local_print_at_Book_internal_18 --> -76($fp) - lw $t1, -76($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_12 --> -52($fp) - # LOCAL local_print_at_Book_internal_13 --> -56($fp) - # local_print_at_Book_internal_13 = VCALL local_print_at_Book_internal_12 out_string - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_10 --> -44($fp) - # LOCAL local_print_at_Book_internal_13 --> -56($fp) - # local_print_at_Book_internal_10 = local_print_at_Book_internal_13 - lw $t1, -56($fp) - sw $t1, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Book_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_5 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -80($fp) - # ARG local_print_at_Book_internal_19 - # LOCAL local_print_at_Book_internal_19 --> -80($fp) - lw $t1, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_10 --> -44($fp) - # LOCAL local_print_at_Book_internal_11 --> -48($fp) - # local_print_at_Book_internal_11 = VCALL local_print_at_Book_internal_10 out_string - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_20 --> -84($fp) - # local_print_at_Book_internal_20 = SELF - sw $s1, -84($fp) - # RETURN local_print_at_Book_internal_20 - lw $v0, -84($fp) - # Deallocate stack frame for function function_print_at_Book. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 92 - jr $ra - # Function END - - -# __Article__attrib__per_title__init implementation. -# @Params: -__Article__attrib__per_title__init: - # Allocate stack frame for function __Article__attrib__per_title__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local___attrib__per_title__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_0 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -4($fp) - # RETURN local___attrib__per_title__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Article__attrib__per_title__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_initArticle_at_Article implementation. -# @Params: -# 0($fp) = param_initArticle_at_Article_title_p_0 -# 4($fp) = param_initArticle_at_Article_author_p_1 -# 8($fp) = param_initArticle_at_Article_per_title_p_2 -function_initArticle_at_Article: - # Allocate stack frame for function function_initArticle_at_Article. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) - # local_initArticle_at_Article_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) - # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) - # local_initArticle_at_Article_internal_0 = local_initArticle_at_Article_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_initArticle_at_Article_title_p_0 - # PARAM param_initArticle_at_Article_title_p_0 --> 8($fp) - lw $t1, 8($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # ARG param_initArticle_at_Article_author_p_1 - # PARAM param_initArticle_at_Article_author_p_1 --> 4($fp) - lw $t1, 4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) - # LOCAL local_initArticle_at_Article_internal_1 --> -8($fp) - # local_initArticle_at_Article_internal_1 = VCALL local_initArticle_at_Article_internal_0 initBook - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 28($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # PARAM param_initArticle_at_Article_per_title_p_2 --> 0($fp) - lw $t1, 0($fp) - sw $t1, 20($s1) - # LOCAL local_initArticle_at_Article_internal_3 --> -16($fp) - # local_initArticle_at_Article_internal_3 = SELF - sw $s1, -16($fp) - # RETURN local_initArticle_at_Article_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_initArticle_at_Article. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 12 - jr $ra - # Function END - - -# function_print_at_Article implementation. -# @Params: -function_print_at_Article: - # Allocate stack frame for function function_print_at_Article. - subu $sp, $sp, 60 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 60 - # LOCAL local_print_at_Article_internal_1 --> -8($fp) - # local_print_at_Article_internal_1 = SELF - sw $s1, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Article_internal_0 = CALL print - # LOCAL local_print_at_Article_internal_0 --> -4($fp) - # LOCAL local_print_at_Article_internal_1 --> -8($fp) - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type's VTABLE - la $t1, Book_vtable - # Get pointer to function address - lw $t2, 32($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -4($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Article_internal_8 --> -36($fp) - # local_print_at_Article_internal_8 = SELF - sw $s1, -36($fp) - # LOCAL local_print_at_Article_internal_6 --> -28($fp) - # LOCAL local_print_at_Article_internal_8 --> -36($fp) - # local_print_at_Article_internal_6 = local_print_at_Article_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Article_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_6 - sw $t1, 12($v0) - li $t1, 13 - sw $t1, 16($v0) - sw $v0, -40($fp) - # ARG local_print_at_Article_internal_9 - # LOCAL local_print_at_Article_internal_9 --> -40($fp) - lw $t1, -40($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Article_internal_6 --> -28($fp) - # LOCAL local_print_at_Article_internal_7 --> -32($fp) - # local_print_at_Article_internal_7 = VCALL local_print_at_Article_internal_6 out_string - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Article_internal_4 --> -20($fp) - # LOCAL local_print_at_Article_internal_7 --> -32($fp) - # local_print_at_Article_internal_4 = local_print_at_Article_internal_7 - lw $t1, -32($fp) - sw $t1, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Article_internal_10 = GETATTRIBUTE per_title Article - # LOCAL local_print_at_Article_internal_10 --> -44($fp) - lw $t1, 20($s1) - sw $t1, -44($fp) - # ARG local_print_at_Article_internal_10 - # LOCAL local_print_at_Article_internal_10 --> -44($fp) - lw $t1, -44($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Article_internal_4 --> -20($fp) - # LOCAL local_print_at_Article_internal_5 --> -24($fp) - # local_print_at_Article_internal_5 = VCALL local_print_at_Article_internal_4 out_string - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Article_internal_2 --> -12($fp) - # LOCAL local_print_at_Article_internal_5 --> -24($fp) - # local_print_at_Article_internal_2 = local_print_at_Article_internal_5 - lw $t1, -24($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Article_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_7 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -48($fp) - # ARG local_print_at_Article_internal_11 - # LOCAL local_print_at_Article_internal_11 --> -48($fp) - lw $t1, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Article_internal_2 --> -12($fp) - # LOCAL local_print_at_Article_internal_3 --> -16($fp) - # local_print_at_Article_internal_3 = VCALL local_print_at_Article_internal_2 out_string - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Article_internal_12 --> -52($fp) - # local_print_at_Article_internal_12 = SELF - sw $s1, -52($fp) - # RETURN local_print_at_Article_internal_12 - lw $v0, -52($fp) - # Deallocate stack frame for function function_print_at_Article. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 60 - jr $ra - # Function END - - -# function_isNil_at_BookList implementation. -# @Params: -function_isNil_at_BookList: - # Allocate stack frame for function function_isNil_at_BookList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_BookList_internal_2 --> -12($fp) - # local_isNil_at_BookList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_isNil_at_BookList_internal_0 --> -4($fp) - # LOCAL local_isNil_at_BookList_internal_2 --> -12($fp) - # local_isNil_at_BookList_internal_0 = local_isNil_at_BookList_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_isNil_at_BookList_internal_0 --> -4($fp) - # LOCAL local_isNil_at_BookList_internal_1 --> -8($fp) - # local_isNil_at_BookList_internal_1 = VCALL local_isNil_at_BookList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_isNil_at_BookList_internal_3 --> -16($fp) - # local_isNil_at_BookList_internal_3 = 1 - li $t1, 1 - sw $t1, -16($fp) - # RETURN local_isNil_at_BookList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_isNil_at_BookList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cons_at_BookList implementation. -# @Params: -# 0($fp) = param_cons_at_BookList_hd_0 -function_cons_at_BookList: - # Allocate stack frame for function function_cons_at_BookList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) - # local_cons_at_BookList_new_cell_0 = ALLOCATE Cons - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Cons - sw $t3, 12($v0) - li $t3, 4 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Cons_start - sw $t3, 4($v0) - # Load type offset - li $t3, 28 - sw $t3, 8($v0) - move $t2, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Cons__attrib__xcar__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t2) - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Cons__attrib__xcdr__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t2) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t2, -4($fp) - # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) - # local_cons_at_BookList_internal_1 = ALLOCATE Cons - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Cons - sw $t4, 12($v0) - li $t4, 4 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, Cons_start - sw $t4, 4($v0) - # Load type offset - li $t4, 28 - sw $t4, 8($v0) - move $t3, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Cons__attrib__xcar__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t3) - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Cons__attrib__xcdr__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t3) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t3, -8($fp) - # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) - # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) - # local_cons_at_BookList_new_cell_0 = local_cons_at_BookList_internal_1 - lw $t3, -8($fp) - sw $t3, -4($fp) - # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) - # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) - # local_cons_at_BookList_internal_2 = local_cons_at_BookList_new_cell_0 - lw $t3, -4($fp) - sw $t3, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cons_at_BookList_hd_0 - # PARAM param_cons_at_BookList_hd_0 --> 0($fp) - lw $t3, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) - # local_cons_at_BookList_internal_4 = SELF - sw $s1, -20($fp) - # ARG local_cons_at_BookList_internal_4 - # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) - lw $t3, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) - # LOCAL local_cons_at_BookList_internal_3 --> -16($fp) - # local_cons_at_BookList_internal_3 = VCALL local_cons_at_BookList_internal_2 init - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 48($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_cons_at_BookList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_cons_at_BookList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_car_at_BookList implementation. -# @Params: -function_car_at_BookList: - # Allocate stack frame for function function_car_at_BookList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_car_at_BookList_internal_2 --> -12($fp) - # local_car_at_BookList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_car_at_BookList_internal_0 --> -4($fp) - # LOCAL local_car_at_BookList_internal_2 --> -12($fp) - # local_car_at_BookList_internal_0 = local_car_at_BookList_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_car_at_BookList_internal_0 --> -4($fp) - # LOCAL local_car_at_BookList_internal_1 --> -8($fp) - # local_car_at_BookList_internal_1 = VCALL local_car_at_BookList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 0($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_car_at_BookList_internal_3 --> -16($fp) - # local_car_at_BookList_internal_3 = ALLOCATE Book - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) - # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, Book - sw $t5, 12($v0) - li $t5, 4 - sw $t5, 16($v0) - move $t5, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t5, 0($v0) - la $t5, Book_start - sw $t5, 4($v0) - # Load type offset - li $t5, 16 - sw $t5, 8($v0) - move $t4, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t4 into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t4) - # Push register t4 into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t4) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t4, -16($fp) - # RETURN local_car_at_BookList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_car_at_BookList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cdr_at_BookList implementation. -# @Params: -function_cdr_at_BookList: - # Allocate stack frame for function function_cdr_at_BookList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_cdr_at_BookList_internal_2 --> -12($fp) - # local_cdr_at_BookList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_cdr_at_BookList_internal_0 --> -4($fp) - # LOCAL local_cdr_at_BookList_internal_2 --> -12($fp) - # local_cdr_at_BookList_internal_0 = local_cdr_at_BookList_internal_2 - lw $t4, -12($fp) - sw $t4, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_cdr_at_BookList_internal_0 --> -4($fp) - # LOCAL local_cdr_at_BookList_internal_1 --> -8($fp) - # local_cdr_at_BookList_internal_1 = VCALL local_cdr_at_BookList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t4, 4($s1) - # Get pointer to type's VTABLE - lw $t5, 0($t4) - # Get pointer to function address - lw $t6, 0($t5) - # Call function. Result is on $v0 - jalr $t6 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cdr_at_BookList_internal_3 --> -16($fp) - # local_cdr_at_BookList_internal_3 = ALLOCATE BookList - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t6, String - sw $t6, 0($v0) - la $t6, String_start - sw $t6, 4($v0) - # Load type offset - li $t6, 8 - sw $t6, 8($v0) - la $t6, BookList - sw $t6, 12($v0) - li $t6, 8 - sw $t6, 16($v0) - move $t6, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t6, 0($v0) - la $t6, BookList_start - sw $t6, 4($v0) - # Load type offset - li $t6, 24 - sw $t6, 8($v0) - move $t5, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t5, -16($fp) - # RETURN local_cdr_at_BookList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_cdr_at_BookList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_print_list_at_BookList implementation. -# @Params: -function_print_list_at_BookList: - # Allocate stack frame for function function_print_list_at_BookList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_print_list_at_BookList_internal_2 --> -12($fp) - # local_print_list_at_BookList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_print_list_at_BookList_internal_0 --> -4($fp) - # LOCAL local_print_list_at_BookList_internal_2 --> -12($fp) - # local_print_list_at_BookList_internal_0 = local_print_list_at_BookList_internal_2 - lw $t5, -12($fp) - sw $t5, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_BookList_internal_0 --> -4($fp) - # LOCAL local_print_list_at_BookList_internal_1 --> -8($fp) - # local_print_list_at_BookList_internal_1 = VCALL local_print_list_at_BookList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t5, 4($s1) - # Get pointer to type's VTABLE - lw $t6, 0($t5) - # Get pointer to function address - lw $t7, 0($t6) - # Call function. Result is on $v0 - jalr $t7 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_list_at_BookList_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_print_list_at_BookList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Cons__attrib__xcar__init implementation. -# @Params: -__Cons__attrib__xcar__init: - # Allocate stack frame for function __Cons__attrib__xcar__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Cons__attrib__xcar__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Cons__attrib__xcdr__init implementation. -# @Params: -__Cons__attrib__xcdr__init: - # Allocate stack frame for function __Cons__attrib__xcdr__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Cons__attrib__xcdr__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_Cons implementation. -# @Params: -function_isNil_at_Cons: - # Allocate stack frame for function function_isNil_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_Cons_internal_0 --> -4($fp) - # local_isNil_at_Cons_internal_0 = 0 - li $t5, 0 - sw $t5, -4($fp) - # RETURN local_isNil_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_isNil_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_Cons implementation. -# @Params: -# 0($fp) = param_init_at_Cons_hd_0 -# 4($fp) = param_init_at_Cons_tl_1 -function_init_at_Cons: - # Allocate stack frame for function function_init_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_Cons_hd_0 --> 4($fp) - lw $t5, 4($fp) - sw $t5, 12($s1) - # - # PARAM param_init_at_Cons_tl_1 --> 0($fp) - lw $t5, 0($fp) - sw $t5, 16($s1) - # LOCAL local_init_at_Cons_internal_0 --> -4($fp) - # local_init_at_Cons_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_init_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_init_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_car_at_Cons implementation. -# @Params: -function_car_at_Cons: - # Allocate stack frame for function function_car_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_car_at_Cons_internal_0 = GETATTRIBUTE xcar Cons - # LOCAL local_car_at_Cons_internal_0 --> -4($fp) - lw $t5, 12($s1) - sw $t5, -4($fp) - # RETURN local_car_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_car_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cdr_at_Cons implementation. -# @Params: -function_cdr_at_Cons: - # Allocate stack frame for function function_cdr_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_cdr_at_Cons_internal_0 = GETATTRIBUTE xcdr Cons - # LOCAL local_cdr_at_Cons_internal_0 --> -4($fp) - lw $t5, 16($s1) - sw $t5, -4($fp) - # RETURN local_cdr_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_cdr_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_print_list_at_Cons implementation. -# @Params: -function_print_list_at_Cons: - # Allocate stack frame for function function_print_list_at_Cons. - subu $sp, $sp, 88 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 88 - # local_print_list_at_Cons_internal_2 = GETATTRIBUTE xcar Cons - # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) - lw $t5, 12($s1) - sw $t5, -12($fp) - # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) - # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) - # local_print_list_at_Cons_internal_0 = local_print_list_at_Cons_internal_2 - lw $t5, -12($fp) - sw $t5, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) - # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # local_print_list_at_Cons_internal_1 = VCALL local_print_list_at_Cons_internal_0 print - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t5, 4($s1) - # Get pointer to type's VTABLE - lw $t6, 0($t5) - # Get pointer to function address - lw $t7, 32($t6) - # Call function. Result is on $v0 - jalr $t7 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) - # local_print_list_at_Cons_internal_3 = TYPEOF local_print_list_at_Cons_internal_1 - lw $t5, -8($fp) - # Load pointer to type offset - lw $t6, 8($t5) - sw $t6, -16($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # local_print_list_at_Cons_internal_5 = 14 - li $t5, 14 - sw $t5, -24($fp) - # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Book - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) - # Load TDT pointer to type Book - la $t5, Book__TDT - lw $t6, -16($fp) - addu $t5, $t5, $t6 - # Save distance - lw $t6, 0($t5) - sw $t6, -28($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # Update min if 13 < 14 - lw $t5, -28($fp) - lw $t6, -24($fp) - bgtu $t5, $t6, label_Not_min0_1 - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_6 - lw $t5, -28($fp) - sw $t5, -24($fp) - label_Not_min0_1: - # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Article - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) - # Load TDT pointer to type Article - la $t5, Article__TDT - lw $t6, -16($fp) - addu $t5, $t5, $t6 - # Save distance - lw $t6, 0($t5) - sw $t6, -28($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # Update min if 13 < 14 - lw $t5, -28($fp) - lw $t6, -24($fp) - bgtu $t5, $t6, label_Not_min1_2 - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_6 - lw $t5, -28($fp) - sw $t5, -24($fp) - label_Not_min1_2: - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_6 = 14 - li $t5, 14 - sw $t5, -28($fp) - # LOCAL local_print_list_at_Cons_internal_4 --> -20($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # local_print_list_at_Cons_internal_4 = local_print_list_at_Cons_internal_6 - local_print_list_at_Cons_internal_5 - lw $t5, -28($fp) - lw $t6, -24($fp) - sub $t5, $t5, $t6 - sw $t5, -20($fp) - # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 - # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 - lw $t5, -20($fp) - beq $t5, 0, label_ERROR_3 - # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Book - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) - # Load TDT pointer to type Book - la $t5, Book__TDT - lw $t6, -16($fp) - addu $t5, $t5, $t6 - # Save distance - lw $t6, 0($t5) - sw $t6, -28($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # Update min if 13 < 14 - lw $t5, -28($fp) - lw $t6, -24($fp) - bgtu $t5, $t6, label_NEXT0_5 - # LOCAL local_print_list_at_Cons_dummy_7 --> -32($fp) - # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # local_print_list_at_Cons_dummy_7 = local_print_list_at_Cons_internal_1 - lw $t5, -8($fp) - sw $t5, -32($fp) - # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) - # local_print_list_at_Cons_internal_10 = SELF - sw $s1, -44($fp) - # LOCAL local_print_list_at_Cons_internal_8 --> -36($fp) - # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) - # local_print_list_at_Cons_internal_8 = local_print_list_at_Cons_internal_10 - lw $t5, -44($fp) - sw $t5, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) - # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, data_8 - sw $t5, 12($v0) - li $t5, 26 - sw $t5, 16($v0) - sw $v0, -48($fp) - # ARG local_print_list_at_Cons_internal_11 - # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) - lw $t5, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t5, 0($sp) - # LOCAL local_print_list_at_Cons_internal_8 --> -36($fp) - # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) - # local_print_list_at_Cons_internal_9 = VCALL local_print_list_at_Cons_internal_8 out_string - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t5, 4($s1) - # Get pointer to type's VTABLE - lw $t6, 0($t5) - # Get pointer to function address - lw $t7, 12($t6) - # Call function. Result is on $v0 - jalr $t7 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # GOTO label_END_4 -j label_END_4 -label_NEXT0_5: - # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Article - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) - # Load TDT pointer to type Article - la $t5, Article__TDT - lw $t6, -16($fp) - addu $t5, $t5, $t6 - # Save distance - lw $t6, 0($t5) - sw $t6, -28($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # Update min if 13 < 14 - lw $t5, -28($fp) - lw $t6, -24($fp) - bgtu $t5, $t6, label_NEXT1_6 - # LOCAL local_print_list_at_Cons_dummy_12 --> -52($fp) - # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # local_print_list_at_Cons_dummy_12 = local_print_list_at_Cons_internal_1 - lw $t5, -8($fp) - sw $t5, -52($fp) - # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) - # local_print_list_at_Cons_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_print_list_at_Cons_internal_13 --> -56($fp) - # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) - # local_print_list_at_Cons_internal_13 = local_print_list_at_Cons_internal_15 - lw $t5, -64($fp) - sw $t5, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) - # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, data_9 - sw $t5, 12($v0) - li $t5, 29 - sw $t5, 16($v0) - sw $v0, -68($fp) - # ARG local_print_list_at_Cons_internal_16 - # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) - lw $t5, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t5, 0($sp) - # LOCAL local_print_list_at_Cons_internal_13 --> -56($fp) - # LOCAL local_print_list_at_Cons_internal_14 --> -60($fp) - # local_print_list_at_Cons_internal_14 = VCALL local_print_list_at_Cons_internal_13 out_string - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t5, 4($s1) - # Get pointer to type's VTABLE - lw $t6, 0($t5) - # Get pointer to function address - lw $t7, 12($t6) - # Call function. Result is on $v0 - jalr $t7 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # GOTO label_END_4 -j label_END_4 -label_NEXT1_6: - label_ERROR_3: - li $a0, 10 - syscall - label_END_4: -# local_print_list_at_Cons_internal_19 = GETATTRIBUTE xcdr Cons -# LOCAL local_print_list_at_Cons_internal_19 --> -80($fp) -lw $t5, 16($s1) -sw $t5, -80($fp) -# LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) -# LOCAL local_print_list_at_Cons_internal_19 --> -80($fp) -# local_print_list_at_Cons_internal_17 = local_print_list_at_Cons_internal_19 -lw $t5, -80($fp) -sw $t5, -72($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) -# LOCAL local_print_list_at_Cons_internal_18 --> -76($fp) -# local_print_list_at_Cons_internal_18 = VCALL local_print_list_at_Cons_internal_17 print_list -# Save new self pointer in $s1 -lw $s1, -72($fp) -# Get pointer to type -lw $t5, 4($s1) -# Get pointer to type's VTABLE -lw $t6, 0($t5) -# Get pointer to function address -lw $t7, 44($t6) -# Call function. Result is on $v0 -jalr $t7 -sw $v0, -76($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# RETURN local_print_list_at_Cons_internal_18 -lw $v0, -76($fp) -# Deallocate stack frame for function function_print_list_at_Cons. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 88 -jr $ra -# Function END - - -# function_isNil_at_Nil implementation. -# @Params: -function_isNil_at_Nil: - # Allocate stack frame for function function_isNil_at_Nil. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_Nil_internal_0 --> -4($fp) - # local_isNil_at_Nil_internal_0 = 1 - li $t5, 1 - sw $t5, -4($fp) - # RETURN local_isNil_at_Nil_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_isNil_at_Nil. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_print_list_at_Nil implementation. -# @Params: -function_print_list_at_Nil: - # Allocate stack frame for function function_print_list_at_Nil. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_print_list_at_Nil_internal_0 --> -4($fp) - # local_print_list_at_Nil_internal_0 = 1 - li $t5, 1 - sw $t5, -4($fp) - # RETURN local_print_list_at_Nil_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_print_list_at_Nil. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__books__init implementation. -# @Params: -__Main__attrib__books__init: - # Allocate stack frame for function __Main__attrib__books__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Main__attrib__books__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 92 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 92 - # LOCAL local_main_at_Main_a_book_0 --> -4($fp) - # local_main_at_Main_a_book_0 = ALLOCATE Book - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) - # Load type offset - li $t7, 8 - sw $t7, 8($v0) - la $t7, Book - sw $t7, 12($v0) - li $t7, 4 - sw $t7, 16($v0) - move $t7, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t7, 0($v0) - la $t7, Book_start - sw $t7, 4($v0) - # Load type offset - li $t7, 16 - sw $t7, 8($v0) - move $t6, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t6 into stack - subu $sp, $sp, 4 - sw $t6, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t6) - # Push register t6 into stack - subu $sp, $sp, 4 - sw $t6, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t6) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t6, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = ALLOCATE Book - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t8, String - sw $t8, 0($v0) - la $t8, String_start - sw $t8, 4($v0) - # Load type offset - li $t8, 8 - sw $t8, 8($v0) - la $t8, Book - sw $t8, 12($v0) - li $t8, 4 - sw $t8, 16($v0) - move $t8, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t8, 0($v0) - la $t8, Book_start - sw $t8, 4($v0) - # Load type offset - li $t8, 16 - sw $t8, 8($v0) - move $t7, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t7 into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t7) - # Push register t7 into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t7) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t7, -16($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t7, -16($fp) - sw $t7, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) - # Load type offset - li $t7, 8 - sw $t7, 8($v0) - la $t7, data_10 - sw $t7, 12($v0) - li $t7, 44 - sw $t7, 16($v0) - sw $v0, -20($fp) - # ARG local_main_at_Main_internal_4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - lw $t7, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) - # Load type offset - li $t7, 8 - sw $t7, 8($v0) - la $t7, data_11 - sw $t7, 12($v0) - li $t7, 22 - sw $t7, 16($v0) - sw $v0, -24($fp) - # ARG local_main_at_Main_internal_5 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - lw $t7, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 initBook - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t7, 4($s1) - # Get pointer to type's VTABLE - lw $t8, 0($t7) - # Get pointer to function address - lw $t9, 28($t8) - # Call function. Result is on $v0 - jalr $t9 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_a_book_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_a_book_0 = local_main_at_Main_internal_2 - lw $t7, -12($fp) - sw $t7, -4($fp) - # LOCAL local_main_at_Main_an_article_6 --> -28($fp) - # local_main_at_Main_an_article_6 = ALLOCATE Article - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) - # Load type offset - li $t9, 8 - sw $t9, 8($v0) - la $t9, Article - sw $t9, 12($v0) - li $t9, 7 - sw $t9, 16($v0) - move $t9, $v0 - # Allocating 24 bytes of memory - li $a0, 24 - li $v0, 9 - syscall - sw $t9, 0($v0) - la $t9, Article_start - sw $t9, 4($v0) - # Load type offset - li $t9, 20 - sw $t9, 8($v0) - move $t8, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t8) - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t8) - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Article__attrib__per_title__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t8) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t8, -28($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = ALLOCATE Article - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $s2, String - sw $s2, 0($v0) - la $s2, String_start - sw $s2, 4($v0) - # Load type offset - li $s2, 8 - sw $s2, 8($v0) - la $s2, Article - sw $s2, 12($v0) - li $s2, 7 - sw $s2, 16($v0) - move $s2, $v0 - # Allocating 24 bytes of memory - li $a0, 24 - li $v0, 9 - syscall - sw $s2, 0($v0) - la $s2, Article_start - sw $s2, 4($v0) - # Load type offset - li $s2, 20 - sw $s2, 8($v0) - move $t9, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t9) - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t9) - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Article__attrib__per_title__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t9) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t9, -40($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t9, -40($fp) - sw $t9, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) - # Load type offset - li $t9, 8 - sw $t9, 8($v0) - la $t9, data_12 - sw $t9, 12($v0) - li $t9, 19 - sw $t9, 16($v0) - sw $v0, -44($fp) - # ARG local_main_at_Main_internal_10 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - lw $t9, -44($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) - # Load type offset - li $t9, 8 - sw $t9, 8($v0) - la $t9, data_13 - sw $t9, 12($v0) - li $t9, 7 - sw $t9, 16($v0) - sw $v0, -48($fp) - # ARG local_main_at_Main_internal_11 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - lw $t9, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) - # Load type offset - li $t9, 8 - sw $t9, 8($v0) - la $t9, data_14 - sw $t9, 12($v0) - li $t9, 11 - sw $t9, 16($v0) - sw $v0, -52($fp) - # ARG local_main_at_Main_internal_12 - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - lw $t9, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 initArticle - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t9, 4($s1) - # Get pointer to type's VTABLE - lw $s2, 0($t9) - # Get pointer to function address - lw $s3, 36($s2) - # Call function. Result is on $v0 - jalr $s3 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_an_article_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_an_article_6 = local_main_at_Main_internal_8 - lw $t9, -36($fp) - sw $t9, -28($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = ALLOCATE Nil - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $s3, String - sw $s3, 0($v0) - la $s3, String_start - sw $s3, 4($v0) - # Load type offset - li $s3, 8 - sw $s3, 8($v0) - la $s3, Nil - sw $s3, 12($v0) - li $s3, 3 - sw $s3, 16($v0) - move $s3, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $s3, 0($v0) - la $s3, Nil_start - sw $s3, 4($v0) - # Load type offset - li $s3, 32 - sw $s3, 8($v0) - move $s2, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $s2, -72($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 - lw $s2, -72($fp) - sw $s2, -64($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_main_at_Main_a_book_0 - # LOCAL local_main_at_Main_a_book_0 --> -4($fp) - lw $s2, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $s2, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 cons - # Save new self pointer in $s1 - lw $s1, -64($fp) - # Get pointer to type - lw $s2, 4($s1) - # Get pointer to type's VTABLE - lw $s3, 0($s2) - # Get pointer to function address - lw $s4, 32($s3) - # Call function. Result is on $v0 - jalr $s4 - sw $v0, -68($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_13 = local_main_at_Main_internal_16 - lw $s2, -68($fp) - sw $s2, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_main_at_Main_an_article_6 - # LOCAL local_main_at_Main_an_article_6 --> -28($fp) - lw $s2, -28($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $s2, 0($sp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 cons - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $s2, 4($s1) - # Get pointer to type's VTABLE - lw $s3, 0($s2) - # Get pointer to function address - lw $s4, 32($s3) - # Call function. Result is on $v0 - jalr $s4 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - lw $s2, -60($fp) - sw $s2, 12($s1) - # local_main_at_Main_internal_20 = GETATTRIBUTE books Main - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - lw $s2, 12($s1) - sw $s2, -84($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 - lw $s2, -84($fp) - sw $s2, -76($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 print_list - # Save new self pointer in $s1 - lw $s1, -76($fp) - # Get pointer to type - lw $s2, 4($s1) - # Get pointer to type's VTABLE - lw $s3, 0($s2) - # Get pointer to function address - lw $s4, 44($s3) - # Call function. Result is on $v0 - jalr $s4 - sw $v0, -80($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_19 - lw $v0, -80($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 92 - jr $ra - # Function END - diff --git a/tests/codegen/complex.mips b/tests/codegen/complex.mips deleted file mode 100644 index 89e75292..00000000 --- a/tests/codegen/complex.mips +++ /dev/null @@ -1,1605 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:19 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Main: .asciiz "Main" -# Function END -Complex: .asciiz "Complex" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -# **** VTABLE for type Complex **** -Complex_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Complex, function_print_at_Complex, function_reflect_0_at_Complex, function_reflect_X_at_Complex, function_reflect_Y_at_Complex -# Function END -# - - -# **** Type RECORD for type Complex **** -Complex_start: - Complex_vtable_pointer: .word Complex_vtable - # Function END -Complex_end: -# - - -data_0: .asciiz "" -# - - -IO__TDT: .word 0, -1, -1, -1, 1, 1 -Object__TDT: .word 1, 0, 1, 1, 2, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1 -Main__TDT: .word -1, -1, -1, -1, 0, -1 -Complex__TDT: .word -1, -1, -1, -1, -1, 0 -# - - -data_2: .asciiz "=)\n" -# - - -data_3: .asciiz "=(\n" -# - - -data_4: .asciiz "+" -# - - -data_5: .asciiz "I" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - li $a0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) - # Load type offset - li $t2, 16 - sw $t2, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t1, Main_vtable - # Get pointer to function address - lw $t2, 28($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 88 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 88 - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_c_0 = ALLOCATE Complex - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Complex - sw $t3, 12($v0) - li $t3, 7 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Complex_start - sw $t3, 4($v0) - # Load type offset - li $t3, 20 - sw $t3, 8($v0) - move $t2, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Complex__attrib__x__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t2) - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Complex__attrib__y__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t2) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t2, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = ALLOCATE Complex - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Complex - sw $t4, 12($v0) - li $t4, 7 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, Complex_start - sw $t4, 4($v0) - # Load type offset - li $t4, 20 - sw $t4, 8($v0) - move $t3, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Complex__attrib__x__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t3) - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Complex__attrib__y__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t3) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t3, -16($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t3, -16($fp) - sw $t3, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 1 - li $t3, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # ARG 1 - li $t3, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 28($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_c_0 = local_main_at_Main_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_internal_8 = local_main_at_Main_c_0 - lw $t3, -4($fp) - sw $t3, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 reflect_X - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 40($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_9 - lw $t3, -40($fp) - sw $t3, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 reflect_Y - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 44($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_internal_10 = local_main_at_Main_c_0 - lw $t3, -4($fp) - sw $t3, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 reflect_0 - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 36($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_5 = local_main_at_Main_internal_7 - local_main_at_Main_internal_11 - lw $t3, -32($fp) - lw $t4, -48($fp) - sub $t3, $t3, $t4 - sw $t3, -24($fp) - # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_3 - # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_3 - lw $t3, -24($fp) - beq $t3, 0, label_TRUE_3 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = 0 - li $t3, 0 - sw $t3, -24($fp) - # GOTO label_END_4 -j label_END_4 -label_TRUE_3: - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = 1 - li $t3, 1 - sw $t3, -24($fp) - label_END_4: -# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_1 -# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_1 -lw $t3, -24($fp) -beq $t3, 0, label_FALSEIF_1 -# LOCAL local_main_at_Main_internal_14 --> -60($fp) -# local_main_at_Main_internal_14 = SELF -sw $s1, -60($fp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# LOCAL local_main_at_Main_internal_14 --> -60($fp) -# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 -lw $t3, -60($fp) -sw $t3, -52($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_15 --> -64($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t3, String -sw $t3, 0($v0) -la $t3, String_start -sw $t3, 4($v0) -# Load type offset -li $t3, 8 -sw $t3, 8($v0) -la $t3, data_2 -sw $t3, 12($v0) -li $t3, 3 -sw $t3, 16($v0) -sw $v0, -64($fp) -# ARG local_main_at_Main_internal_15 -# LOCAL local_main_at_Main_internal_15 --> -64($fp) -lw $t3, -64($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string -# Save new self pointer in $s1 -lw $s1, -52($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 12($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -56($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_4 --> -20($fp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# local_main_at_Main_internal_4 = local_main_at_Main_internal_13 -lw $t3, -56($fp) -sw $t3, -20($fp) -# GOTO label_ENDIF_2 -j label_ENDIF_2 -label_FALSEIF_1: - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 - lw $t3, -76($fp) - sw $t3, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_3 - sw $t3, 12($v0) - li $t3, 3 - sw $t3, 16($v0) - sw $v0, -80($fp) - # ARG local_main_at_Main_internal_19 - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - lw $t3, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 12($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_4 = local_main_at_Main_internal_17 - lw $t3, -72($fp) - sw $t3, -20($fp) - label_ENDIF_2: -# RETURN local_main_at_Main_internal_4 -lw $v0, -20($fp) -# Deallocate stack frame for function function_main_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 88 -jr $ra -# Function END - - -# __Complex__attrib__x__init implementation. -# @Params: -__Complex__attrib__x__init: - # Allocate stack frame for function __Complex__attrib__x__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Complex__attrib__x__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Complex__attrib__y__init implementation. -# @Params: -__Complex__attrib__y__init: - # Allocate stack frame for function __Complex__attrib__y__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Complex__attrib__y__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_Complex implementation. -# @Params: -# 0($fp) = param_init_at_Complex_a_0 -# 4($fp) = param_init_at_Complex_b_1 -function_init_at_Complex: - # Allocate stack frame for function function_init_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_init_at_Complex_internal_1 = GETATTRIBUTE x Complex - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - lw $t3, 12($s1) - sw $t3, -8($fp) - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - # PARAM param_init_at_Complex_a_0 --> 4($fp) - # local_init_at_Complex_internal_0 = local_init_at_Complex_internal_1 - PARAM param_init_at_Complex_a_0 - lw $t3, -8($fp) - lw $t4, 4($fp) - sub $t3, $t3, $t4 - sw $t3, -4($fp) - # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_5 - # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_5 - lw $t3, -4($fp) - beq $t3, 0, label_TRUE_5 - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # local_init_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - # GOTO label_END_6 -j label_END_6 -label_TRUE_5: - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # local_init_at_Complex_internal_0 = 1 - li $t3, 1 - sw $t3, -4($fp) - label_END_6: -# local_init_at_Complex_internal_3 = GETATTRIBUTE y Complex -# LOCAL local_init_at_Complex_internal_3 --> -16($fp) -lw $t3, 16($s1) -sw $t3, -16($fp) -# LOCAL local_init_at_Complex_internal_2 --> -12($fp) -# LOCAL local_init_at_Complex_internal_3 --> -16($fp) -# PARAM param_init_at_Complex_b_1 --> 0($fp) -# local_init_at_Complex_internal_2 = local_init_at_Complex_internal_3 - PARAM param_init_at_Complex_b_1 -lw $t3, -16($fp) -lw $t4, 0($fp) -sub $t3, $t3, $t4 -sw $t3, -12($fp) -# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_7 -# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_7 -lw $t3, -12($fp) -beq $t3, 0, label_TRUE_7 -# LOCAL local_init_at_Complex_internal_2 --> -12($fp) -# local_init_at_Complex_internal_2 = 0 -li $t3, 0 -sw $t3, -12($fp) -# GOTO label_END_8 -j label_END_8 -label_TRUE_7: - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # local_init_at_Complex_internal_2 = 1 - li $t3, 1 - sw $t3, -12($fp) - label_END_8: -# LOCAL local_init_at_Complex_internal_4 --> -20($fp) -# local_init_at_Complex_internal_4 = SELF -sw $s1, -20($fp) -# RETURN local_init_at_Complex_internal_4 -lw $v0, -20($fp) -# Deallocate stack frame for function function_init_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 32 -# Deallocate function args -addu $sp, $sp, 8 -jr $ra -# Function END - - -# function_print_at_Complex implementation. -# @Params: -function_print_at_Complex: - # Allocate stack frame for function function_print_at_Complex. - subu $sp, $sp, 88 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 88 - # local_print_at_Complex_internal_2 = GETATTRIBUTE y Complex - # LOCAL local_print_at_Complex_internal_2 --> -12($fp) - lw $t3, 16($s1) - sw $t3, -12($fp) - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # LOCAL local_print_at_Complex_internal_2 --> -12($fp) - # local_print_at_Complex_internal_1 = local_print_at_Complex_internal_2 - 0 - lw $t3, -12($fp) - sub $t3, $t3, 0 - sw $t3, -8($fp) - # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_11 - # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_11 - lw $t3, -8($fp) - beq $t3, 0, label_TRUE_11 - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # local_print_at_Complex_internal_1 = 0 - li $t3, 0 - sw $t3, -8($fp) - # GOTO label_END_12 -j label_END_12 -label_TRUE_11: - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # local_print_at_Complex_internal_1 = 1 - li $t3, 1 - sw $t3, -8($fp) - label_END_12: -# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_9 -# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_9 -lw $t3, -8($fp) -beq $t3, 0, label_FALSEIF_9 -# LOCAL local_print_at_Complex_internal_5 --> -24($fp) -# local_print_at_Complex_internal_5 = SELF -sw $s1, -24($fp) -# LOCAL local_print_at_Complex_internal_3 --> -16($fp) -# LOCAL local_print_at_Complex_internal_5 --> -24($fp) -# local_print_at_Complex_internal_3 = local_print_at_Complex_internal_5 -lw $t3, -24($fp) -sw $t3, -16($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_print_at_Complex_internal_6 = GETATTRIBUTE x Complex -# LOCAL local_print_at_Complex_internal_6 --> -28($fp) -lw $t3, 12($s1) -sw $t3, -28($fp) -# ARG local_print_at_Complex_internal_6 -# LOCAL local_print_at_Complex_internal_6 --> -28($fp) -lw $t3, -28($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_print_at_Complex_internal_3 --> -16($fp) -# LOCAL local_print_at_Complex_internal_4 --> -20($fp) -# local_print_at_Complex_internal_4 = VCALL local_print_at_Complex_internal_3 out_int -# Save new self pointer in $s1 -lw $s1, -16($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 16($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -20($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_print_at_Complex_internal_0 --> -4($fp) -# LOCAL local_print_at_Complex_internal_4 --> -20($fp) -# local_print_at_Complex_internal_0 = local_print_at_Complex_internal_4 -lw $t3, -20($fp) -sw $t3, -4($fp) -# GOTO label_ENDIF_10 -j label_ENDIF_10 -label_FALSEIF_9: - # LOCAL local_print_at_Complex_internal_15 --> -64($fp) - # local_print_at_Complex_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_print_at_Complex_internal_13 --> -56($fp) - # LOCAL local_print_at_Complex_internal_15 --> -64($fp) - # local_print_at_Complex_internal_13 = local_print_at_Complex_internal_15 - lw $t3, -64($fp) - sw $t3, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Complex_internal_16 = GETATTRIBUTE x Complex - # LOCAL local_print_at_Complex_internal_16 --> -68($fp) - lw $t3, 12($s1) - sw $t3, -68($fp) - # ARG local_print_at_Complex_internal_16 - # LOCAL local_print_at_Complex_internal_16 --> -68($fp) - lw $t3, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_print_at_Complex_internal_13 --> -56($fp) - # LOCAL local_print_at_Complex_internal_14 --> -60($fp) - # local_print_at_Complex_internal_14 = VCALL local_print_at_Complex_internal_13 out_int - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 16($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_11 --> -48($fp) - # LOCAL local_print_at_Complex_internal_14 --> -60($fp) - # local_print_at_Complex_internal_11 = local_print_at_Complex_internal_14 - lw $t3, -60($fp) - sw $t3, -48($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Complex_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_4 - sw $t3, 12($v0) - li $t3, 1 - sw $t3, 16($v0) - sw $v0, -72($fp) - # ARG local_print_at_Complex_internal_17 - # LOCAL local_print_at_Complex_internal_17 --> -72($fp) - lw $t3, -72($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_print_at_Complex_internal_11 --> -48($fp) - # LOCAL local_print_at_Complex_internal_12 --> -52($fp) - # local_print_at_Complex_internal_12 = VCALL local_print_at_Complex_internal_11 out_string - # Save new self pointer in $s1 - lw $s1, -48($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 12($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -52($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_9 --> -40($fp) - # LOCAL local_print_at_Complex_internal_12 --> -52($fp) - # local_print_at_Complex_internal_9 = local_print_at_Complex_internal_12 - lw $t3, -52($fp) - sw $t3, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Complex_internal_18 = GETATTRIBUTE y Complex - # LOCAL local_print_at_Complex_internal_18 --> -76($fp) - lw $t3, 16($s1) - sw $t3, -76($fp) - # ARG local_print_at_Complex_internal_18 - # LOCAL local_print_at_Complex_internal_18 --> -76($fp) - lw $t3, -76($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_print_at_Complex_internal_9 --> -40($fp) - # LOCAL local_print_at_Complex_internal_10 --> -44($fp) - # local_print_at_Complex_internal_10 = VCALL local_print_at_Complex_internal_9 out_int - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 16($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_7 --> -32($fp) - # LOCAL local_print_at_Complex_internal_10 --> -44($fp) - # local_print_at_Complex_internal_7 = local_print_at_Complex_internal_10 - lw $t3, -44($fp) - sw $t3, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Complex_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_5 - sw $t3, 12($v0) - li $t3, 1 - sw $t3, 16($v0) - sw $v0, -80($fp) - # ARG local_print_at_Complex_internal_19 - # LOCAL local_print_at_Complex_internal_19 --> -80($fp) - lw $t3, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_print_at_Complex_internal_7 --> -32($fp) - # LOCAL local_print_at_Complex_internal_8 --> -36($fp) - # local_print_at_Complex_internal_8 = VCALL local_print_at_Complex_internal_7 out_string - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 12($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_0 --> -4($fp) - # LOCAL local_print_at_Complex_internal_8 --> -36($fp) - # local_print_at_Complex_internal_0 = local_print_at_Complex_internal_8 - lw $t3, -36($fp) - sw $t3, -4($fp) - label_ENDIF_10: -# RETURN local_print_at_Complex_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_print_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 88 -jr $ra -# Function END - - -# function_reflect_0_at_Complex implementation. -# @Params: -function_reflect_0_at_Complex: - # Allocate stack frame for function function_reflect_0_at_Complex. - subu $sp, $sp, 44 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 44 - # local_reflect_0_at_Complex_internal_1 = GETATTRIBUTE x Complex - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - lw $t3, 12($s1) - sw $t3, -8($fp) - # local_reflect_0_at_Complex_internal_3 = GETATTRIBUTE x Complex - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - lw $t3, 12($s1) - sw $t3, -16($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - lw $t3, -16($fp) - not $t3, $t3 - sw $t3, -12($fp) - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # local_reflect_0_at_Complex_internal_0 = local_reflect_0_at_Complex_internal_1 - local_reflect_0_at_Complex_internal_2 - lw $t3, -8($fp) - lw $t4, -12($fp) - sub $t3, $t3, $t4 - sw $t3, -4($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_13 - # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_13 - lw $t3, -4($fp) - beq $t3, 0, label_TRUE_13 - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # local_reflect_0_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - # GOTO label_END_14 -j label_END_14 -label_TRUE_13: - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # local_reflect_0_at_Complex_internal_0 = 1 - li $t3, 1 - sw $t3, -4($fp) - label_END_14: -# local_reflect_0_at_Complex_internal_5 = GETATTRIBUTE y Complex -# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) -lw $t3, 16($s1) -sw $t3, -24($fp) -# local_reflect_0_at_Complex_internal_7 = GETATTRIBUTE y Complex -# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -lw $t3, 16($s1) -sw $t3, -32($fp) -# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) -# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -lw $t3, -32($fp) -not $t3, $t3 -sw $t3, -28($fp) -# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) -# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) -# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) -# local_reflect_0_at_Complex_internal_4 = local_reflect_0_at_Complex_internal_5 - local_reflect_0_at_Complex_internal_6 -lw $t3, -24($fp) -lw $t4, -28($fp) -sub $t3, $t3, $t4 -sw $t3, -20($fp) -# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_15 -# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_15 -lw $t3, -20($fp) -beq $t3, 0, label_TRUE_15 -# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) -# local_reflect_0_at_Complex_internal_4 = 0 -li $t3, 0 -sw $t3, -20($fp) -# GOTO label_END_16 -j label_END_16 -label_TRUE_15: - # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) - # local_reflect_0_at_Complex_internal_4 = 1 - li $t3, 1 - sw $t3, -20($fp) - label_END_16: -# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) -# local_reflect_0_at_Complex_internal_8 = SELF -sw $s1, -36($fp) -# RETURN local_reflect_0_at_Complex_internal_8 -lw $v0, -36($fp) -# Deallocate stack frame for function function_reflect_0_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 44 -jr $ra -# Function END - - -# function_reflect_X_at_Complex implementation. -# @Params: -function_reflect_X_at_Complex: - # Allocate stack frame for function function_reflect_X_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_reflect_X_at_Complex_internal_1 = GETATTRIBUTE y Complex - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - lw $t3, 16($s1) - sw $t3, -8($fp) - # local_reflect_X_at_Complex_internal_3 = GETATTRIBUTE y Complex - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - lw $t3, 16($s1) - sw $t3, -16($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - lw $t3, -16($fp) - not $t3, $t3 - sw $t3, -12($fp) - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # local_reflect_X_at_Complex_internal_0 = local_reflect_X_at_Complex_internal_1 - local_reflect_X_at_Complex_internal_2 - lw $t3, -8($fp) - lw $t4, -12($fp) - sub $t3, $t3, $t4 - sw $t3, -4($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_17 - # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_17 - lw $t3, -4($fp) - beq $t3, 0, label_TRUE_17 - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # local_reflect_X_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - # GOTO label_END_18 -j label_END_18 -label_TRUE_17: - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # local_reflect_X_at_Complex_internal_0 = 1 - li $t3, 1 - sw $t3, -4($fp) - label_END_18: -# LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) -# local_reflect_X_at_Complex_internal_4 = SELF -sw $s1, -20($fp) -# RETURN local_reflect_X_at_Complex_internal_4 -lw $v0, -20($fp) -# Deallocate stack frame for function function_reflect_X_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 32 -jr $ra -# Function END - - -# function_reflect_Y_at_Complex implementation. -# @Params: -function_reflect_Y_at_Complex: - # Allocate stack frame for function function_reflect_Y_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_reflect_Y_at_Complex_internal_1 = GETATTRIBUTE x Complex - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - lw $t3, 12($s1) - sw $t3, -8($fp) - # local_reflect_Y_at_Complex_internal_3 = GETATTRIBUTE x Complex - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - lw $t3, 12($s1) - sw $t3, -16($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - lw $t3, -16($fp) - not $t3, $t3 - sw $t3, -12($fp) - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # local_reflect_Y_at_Complex_internal_0 = local_reflect_Y_at_Complex_internal_1 - local_reflect_Y_at_Complex_internal_2 - lw $t3, -8($fp) - lw $t4, -12($fp) - sub $t3, $t3, $t4 - sw $t3, -4($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_19 - # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_19 - lw $t3, -4($fp) - beq $t3, 0, label_TRUE_19 - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # local_reflect_Y_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - # GOTO label_END_20 -j label_END_20 -label_TRUE_19: - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # local_reflect_Y_at_Complex_internal_0 = 1 - li $t3, 1 - sw $t3, -4($fp) - label_END_20: -# LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) -# local_reflect_Y_at_Complex_internal_4 = SELF -sw $s1, -20($fp) -# RETURN local_reflect_Y_at_Complex_internal_4 -lw $v0, -20($fp) -# Deallocate stack frame for function function_reflect_Y_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 32 -jr $ra -# Function END - diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips deleted file mode 100644 index 314a4bc4..00000000 --- a/tests/codegen/fib.mips +++ /dev/null @@ -1,907 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:19 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main, function_fib_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -IO__TDT: .word 0, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, 0 -# - - -data_2: .asciiz "Enter n to find nth fibonacci number!\n" -# - - -data_3: .asciiz "\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - li $a0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) - # Load type offset - li $t2, 16 - sw $t2, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t1, Main_vtable - # Get pointer to function address - lw $t2, 28($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 76 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 76 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_2 - sw $t1, 12($v0) - li $t1, 38 - sw $t1, 16($v0) - sw $v0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # local_main_at_Main_internal_6 = SELF - sw $s1, -28($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # local_main_at_Main_internal_4 = local_main_at_Main_internal_6 - lw $t1, -28($fp) - sw $t1, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = SELF - sw $s1, -40($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t1, -40($fp) - sw $t1, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_12 = SELF - sw $s1, -52($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 - lw $t1, -52($fp) - sw $t1, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 in_int - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 24($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_11 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - lw $t1, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 fib - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 32($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_8 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - lw $t1, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 out_int - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 16($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 - lw $t1, -64($fp) - sw $t1, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_3 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -68($fp) - # ARG local_main_at_Main_internal_16 - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - lw $t1, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 out_string - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_14 - lw $v0, -60($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 76 - jr $ra - # Function END - - -# function_fib_at_Main implementation. -# @Params: -# 0($fp) = param_fib_at_Main_i_0 -function_fib_at_Main: - # Allocate stack frame for function function_fib_at_Main. - subu $sp, $sp, 36 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 36 - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # local_fib_at_Main_a_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - # LOCAL local_fib_at_Main_b_1 --> -8($fp) - # local_fib_at_Main_b_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # LOCAL local_fib_at_Main_c_2 --> -12($fp) - # local_fib_at_Main_c_2 = 0 - li $t1, 0 - sw $t1, -12($fp) - label_WHILE_1: - # LOCAL local_fib_at_Main_internal_3 --> -16($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # local_fib_at_Main_internal_3 = PARAM param_fib_at_Main_i_0 - 0 - lw $t1, 0($fp) - sub $t1, $t1, 0 - sw $t1, -16($fp) - # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 - # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 - lw $t1, -16($fp) - beq $t1, 0, label_TRUE_3 - # LOCAL local_fib_at_Main_internal_3 --> -16($fp) - # local_fib_at_Main_internal_3 = 0 - li $t1, 0 - sw $t1, -16($fp) - # GOTO label_END_4 -j label_END_4 -label_TRUE_3: - # LOCAL local_fib_at_Main_internal_3 --> -16($fp) - # local_fib_at_Main_internal_3 = 1 - li $t1, 1 - sw $t1, -16($fp) - label_END_4: -# IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 -# IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 -lw $t1, -16($fp) -beq $t1, 0, label_FALSE_5 -# LOCAL local_fib_at_Main_internal_4 --> -20($fp) -# local_fib_at_Main_internal_4 = 0 -li $t1, 0 -sw $t1, -20($fp) -# GOTO label_NOT_END_6 -j label_NOT_END_6 -label_FALSE_5: - # LOCAL local_fib_at_Main_internal_4 --> -20($fp) - # local_fib_at_Main_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) - label_NOT_END_6: - # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 - # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 - lw $t1, -20($fp) - beq $t1, 0, label_WHILE_END_2 - # LOCAL local_fib_at_Main_internal_5 --> -24($fp) - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # LOCAL local_fib_at_Main_b_1 --> -8($fp) - # local_fib_at_Main_internal_5 = local_fib_at_Main_a_0 + local_fib_at_Main_b_1 - lw $t1, -4($fp) - lw $t2, -8($fp) - add $t1, $t1, $t2 - sw $t1, -24($fp) - # LOCAL local_fib_at_Main_c_2 --> -12($fp) - # LOCAL local_fib_at_Main_internal_5 --> -24($fp) - # local_fib_at_Main_c_2 = local_fib_at_Main_internal_5 - lw $t1, -24($fp) - sw $t1, -12($fp) - # LOCAL local_fib_at_Main_internal_6 --> -28($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # local_fib_at_Main_internal_6 = PARAM param_fib_at_Main_i_0 - 1 - lw $t1, 0($fp) - sub $t1, $t1, 1 - sw $t1, -28($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # LOCAL local_fib_at_Main_internal_6 --> -28($fp) - # PARAM param_fib_at_Main_i_0 = local_fib_at_Main_internal_6 - lw $t1, -28($fp) - sw $t1, 0($fp) - # LOCAL local_fib_at_Main_b_1 --> -8($fp) - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # local_fib_at_Main_b_1 = local_fib_at_Main_a_0 - lw $t1, -4($fp) - sw $t1, -8($fp) - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # LOCAL local_fib_at_Main_c_2 --> -12($fp) - # local_fib_at_Main_a_0 = local_fib_at_Main_c_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # GOTO label_WHILE_1 - j label_WHILE_1 - label_WHILE_END_2: - # RETURN local_fib_at_Main_c_2 - lw $v0, -12($fp) - # Deallocate stack frame for function function_fib_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 36 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips deleted file mode 100644 index 45c90eb0..00000000 --- a/tests/codegen/hello_world.mips +++ /dev/null @@ -1,639 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:18 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -IO__TDT: .word 0, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, 0 -# - - -data_2: .asciiz "Hello, World.\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - li $a0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) - # Load type offset - li $t2, 16 - sw $t2, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t1, Main_vtable - # Get pointer to function address - lw $t2, 28($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_2 - sw $t1, 12($v0) - li $t1, 14 - sw $t1, 16($v0) - sw $v0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips deleted file mode 100644 index 6d7edef2..00000000 --- a/tests/codegen/io.mips +++ /dev/null @@ -1,1344 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:19 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -A: .asciiz "A" -# Function END -B: .asciiz "B" -# Function END -C: .asciiz "C" -# Function END -D: .asciiz "D" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type A **** -A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A -# Function END -# - - -# **** Type RECORD for type A **** -A_start: - A_vtable_pointer: .word A_vtable - # Function END -A_end: -# - - -# **** VTABLE for type B **** -B_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A, function_out_b_at_B -# Function END -# - - -# **** Type RECORD for type B **** -B_start: - B_vtable_pointer: .word B_vtable - # Function END -B_end: -# - - -# **** VTABLE for type C **** -C_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_out_c_at_C -# Function END -# - - -# **** Type RECORD for type C **** -C_start: - C_vtable_pointer: .word C_vtable - # Function END -C_end: -# - - -# **** VTABLE for type D **** -D_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_out_c_at_C, function_out_d_at_D -# Function END -# - - -# **** Type RECORD for type D **** -D_start: - D_vtable_pointer: .word D_vtable - # Function END -D_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, -1, 1, 2, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 2, 2, 3, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1 -A__TDT: .word -1, -1, -1, -1, 0, 1, -1, -1, -1 -B__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1 -C__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, -1 -D__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0 -# - - -data_2: .asciiz "A: Hello world\n" -# - - -data_3: .asciiz "B: Hello world\n" -# - - -data_4: .asciiz "C: Hello world\n" -# - - -data_5: .asciiz "D: Hello world\n" -# - - -data_6: .asciiz "Done.\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - li $a0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) - # Load type offset - li $t2, 32 - sw $t2, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t1, Main_vtable - # Get pointer to function address - lw $t2, 28($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __A__attrib__io__init implementation. -# @Params: -__A__attrib__io__init: - # Allocate stack frame for function __A__attrib__io__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ib__io__init_internal_0 --> -4($fp) - # local_ib__io__init_internal_0 = ALLOCATE IO - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, IO - sw $t3, 12($v0) - li $t3, 2 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, IO_start - sw $t3, 4($v0) - # Load type offset - li $t3, 0 - sw $t3, 8($v0) - move $t2, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t2, -4($fp) - # RETURN local_ib__io__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __A__attrib__io__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_a_at_A implementation. -# @Params: -function_out_a_at_A: - # Allocate stack frame for function function_out_a_at_A. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_out_a_at_A_internal_2 = GETATTRIBUTE io A - # LOCAL local_out_a_at_A_internal_2 --> -12($fp) - lw $t2, 12($s1) - sw $t2, -12($fp) - # LOCAL local_out_a_at_A_internal_0 --> -4($fp) - # LOCAL local_out_a_at_A_internal_2 --> -12($fp) - # local_out_a_at_A_internal_0 = local_out_a_at_A_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_out_a_at_A_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_2 - sw $t2, 12($v0) - li $t2, 15 - sw $t2, 16($v0) - sw $v0, -16($fp) - # ARG local_out_a_at_A_internal_3 - # LOCAL local_out_a_at_A_internal_3 --> -16($fp) - lw $t2, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_out_a_at_A_internal_0 --> -4($fp) - # LOCAL local_out_a_at_A_internal_1 --> -8($fp) - # local_out_a_at_A_internal_1 = VCALL local_out_a_at_A_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 12($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_out_a_at_A_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_a_at_A. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_b_at_B implementation. -# @Params: -function_out_b_at_B: - # Allocate stack frame for function function_out_b_at_B. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_out_b_at_B_internal_2 = GETATTRIBUTE io B - # LOCAL local_out_b_at_B_internal_2 --> -12($fp) - lw $t2, 12($s1) - sw $t2, -12($fp) - # LOCAL local_out_b_at_B_internal_0 --> -4($fp) - # LOCAL local_out_b_at_B_internal_2 --> -12($fp) - # local_out_b_at_B_internal_0 = local_out_b_at_B_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_out_b_at_B_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_3 - sw $t2, 12($v0) - li $t2, 15 - sw $t2, 16($v0) - sw $v0, -16($fp) - # ARG local_out_b_at_B_internal_3 - # LOCAL local_out_b_at_B_internal_3 --> -16($fp) - lw $t2, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_out_b_at_B_internal_0 --> -4($fp) - # LOCAL local_out_b_at_B_internal_1 --> -8($fp) - # local_out_b_at_B_internal_1 = VCALL local_out_b_at_B_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 12($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_out_b_at_B_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_b_at_B. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_c_at_C implementation. -# @Params: -function_out_c_at_C: - # Allocate stack frame for function function_out_c_at_C. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_out_c_at_C_internal_2 --> -12($fp) - # local_out_c_at_C_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_out_c_at_C_internal_0 --> -4($fp) - # LOCAL local_out_c_at_C_internal_2 --> -12($fp) - # local_out_c_at_C_internal_0 = local_out_c_at_C_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_out_c_at_C_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_4 - sw $t2, 12($v0) - li $t2, 15 - sw $t2, 16($v0) - sw $v0, -16($fp) - # ARG local_out_c_at_C_internal_3 - # LOCAL local_out_c_at_C_internal_3 --> -16($fp) - lw $t2, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_out_c_at_C_internal_0 --> -4($fp) - # LOCAL local_out_c_at_C_internal_1 --> -8($fp) - # local_out_c_at_C_internal_1 = VCALL local_out_c_at_C_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 12($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_out_c_at_C_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_c_at_C. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_d_at_D implementation. -# @Params: -function_out_d_at_D: - # Allocate stack frame for function function_out_d_at_D. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_out_d_at_D_internal_2 --> -12($fp) - # local_out_d_at_D_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_out_d_at_D_internal_0 --> -4($fp) - # LOCAL local_out_d_at_D_internal_2 --> -12($fp) - # local_out_d_at_D_internal_0 = local_out_d_at_D_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_out_d_at_D_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_5 - sw $t2, 12($v0) - li $t2, 15 - sw $t2, 16($v0) - sw $v0, -16($fp) - # ARG local_out_d_at_D_internal_3 - # LOCAL local_out_d_at_D_internal_3 --> -16($fp) - lw $t2, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_out_d_at_D_internal_0 --> -4($fp) - # LOCAL local_out_d_at_D_internal_1 --> -8($fp) - # local_out_d_at_D_internal_1 = VCALL local_out_d_at_D_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 12($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_out_d_at_D_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_d_at_D. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 72 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 72 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = ALLOCATE A - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, A - sw $t4, 12($v0) - li $t4, 1 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, A_start - sw $t4, 4($v0) - # Load type offset - li $t4, 16 - sw $t4, 8($v0) - move $t3, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __A__attrib__io__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t3) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t3, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_a - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 12($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = ALLOCATE B - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) - # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, B - sw $t5, 12($v0) - li $t5, 1 - sw $t5, 16($v0) - move $t5, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t5, 0($v0) - la $t5, B_start - sw $t5, 4($v0) - # Load type offset - li $t5, 20 - sw $t5, 8($v0) - move $t4, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t4 into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - jal __A__attrib__io__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t4) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t4, -24($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 - lw $t4, -24($fp) - sw $t4, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 out_b - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t4, 4($s1) - # Get pointer to type's VTABLE - lw $t5, 0($t4) - # Get pointer to function address - lw $t6, 16($t5) - # Call function. Result is on $v0 - jalr $t6 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = ALLOCATE C - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t6, String - sw $t6, 0($v0) - la $t6, String_start - sw $t6, 4($v0) - # Load type offset - li $t6, 8 - sw $t6, 8($v0) - la $t6, C - sw $t6, 12($v0) - li $t6, 1 - sw $t6, 16($v0) - move $t6, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t6, 0($v0) - la $t6, C_start - sw $t6, 4($v0) - # Load type offset - li $t6, 24 - sw $t6, 8($v0) - move $t5, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t5, -36($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 - lw $t5, -36($fp) - sw $t5, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_c - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t5, 4($s1) - # Get pointer to type's VTABLE - lw $t6, 0($t5) - # Get pointer to function address - lw $t7, 28($t6) - # Call function. Result is on $v0 - jalr $t7 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = ALLOCATE D - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) - # Load type offset - li $t7, 8 - sw $t7, 8($v0) - la $t7, D - sw $t7, 12($v0) - li $t7, 1 - sw $t7, 16($v0) - move $t7, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t7, 0($v0) - la $t7, D_start - sw $t7, 4($v0) - # Load type offset - li $t7, 28 - sw $t7, 8($v0) - move $t6, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t6, -48($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 - lw $t6, -48($fp) - sw $t6, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_d - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t6, 4($s1) - # Get pointer to type's VTABLE - lw $t7, 0($t6) - # Get pointer to function address - lw $t8, 32($t7) - # Call function. Result is on $v0 - jalr $t8 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 - lw $t6, -60($fp) - sw $t6, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t6, String - sw $t6, 0($v0) - la $t6, String_start - sw $t6, 4($v0) - # Load type offset - li $t6, 8 - sw $t6, 8($v0) - la $t6, data_6 - sw $t6, 12($v0) - li $t6, 6 - sw $t6, 16($v0) - sw $v0, -64($fp) - # ARG local_main_at_Main_internal_15 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - lw $t6, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t6, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t6, 4($s1) - # Get pointer to type's VTABLE - lw $t7, 0($t6) - # Get pointer to function address - lw $t8, 12($t7) - # Call function. Result is on $v0 - jalr $t8 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_13 - lw $v0, -56($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 72 - jr $ra - # Function END - diff --git a/tests/codegen/life.mips b/tests/codegen/life.mips deleted file mode 100644 index b8d06b32..00000000 --- a/tests/codegen/life.mips +++ /dev/null @@ -1,8637 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:21 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Board: .asciiz "Board" -# Function END -CellularAutomaton: .asciiz "CellularAutomaton" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Board **** -Board_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_size_of_board_at_Board, function_board_init_at_Board -# Function END -# - - -# **** Type RECORD for type Board **** -Board_start: - Board_vtable_pointer: .word Board_vtable - # Function END -Board_end: -# - - -# **** VTABLE for type CellularAutomaton **** -CellularAutomaton_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_size_of_board_at_Board, function_board_init_at_Board, function_init_at_CellularAutomaton, function_print_at_CellularAutomaton, function_num_cells_at_CellularAutomaton, function_cell_at_CellularAutomaton, function_north_at_CellularAutomaton, function_south_at_CellularAutomaton, function_east_at_CellularAutomaton, function_west_at_CellularAutomaton, function_northwest_at_CellularAutomaton, function_northeast_at_CellularAutomaton, function_southeast_at_CellularAutomaton, function_southwest_at_CellularAutomaton, function_neighbors_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_evolve_at_CellularAutomaton, function_option_at_CellularAutomaton, function_prompt_at_CellularAutomaton, function_prompt2_at_CellularAutomaton -# Function END -# - - -# **** Type RECORD for type CellularAutomaton **** -CellularAutomaton_start: - CellularAutomaton_vtable_pointer: .word CellularAutomaton_vtable - # Function END -CellularAutomaton_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_CellularAutomaton, function_type_name_at_CellularAutomaton, function_copy_at_CellularAutomaton, function_out_string_at_CellularAutomaton, function_out_int_at_CellularAutomaton, function_in_string_at_CellularAutomaton, function_in_int_at_CellularAutomaton, function_size_of_board_at_Board, function_board_init_at_Board, function_init_at_CellularAutomaton, function_print_at_CellularAutomaton, function_num_cells_at_CellularAutomaton, function_cell_at_CellularAutomaton, function_north_at_CellularAutomaton, function_south_at_CellularAutomaton, function_east_at_CellularAutomaton, function_west_at_CellularAutomaton, function_northwest_at_CellularAutomaton, function_northeast_at_CellularAutomaton, function_southeast_at_CellularAutomaton, function_southwest_at_CellularAutomaton, function_neighbors_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_evolve_at_CellularAutomaton, function_option_at_CellularAutomaton, function_prompt_at_CellularAutomaton, function_prompt2_at_CellularAutomaton, function_main_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -IO__TDT: .word 0, -1, -1, -1, 1, 2, 3 -Object__TDT: .word 1, 0, 1, 1, 2, 3, 4 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 -Board__TDT: .word -1, -1, -1, -1, 0, 1, 2 -CellularAutomaton__TDT: .word -1, -1, -1, -1, -1, 0, 1 -Main__TDT: .word -1, -1, -1, -1, -1, -1, 0 -# - - -data_2: .asciiz "\n" -# - - -data_3: .asciiz "\n" -# - - -data_4: .asciiz "\n" -# - - -data_5: .asciiz " " -# - - -data_6: .asciiz " " -# - - -data_7: .asciiz " " -# - - -data_8: .asciiz " " -# - - -data_9: .asciiz " " -# - - -data_10: .asciiz " " -# - - -data_11: .asciiz " " -# - - -data_12: .asciiz " " -# - - -data_13: .asciiz " " -# - - -data_14: .asciiz " " -# - - -data_15: .asciiz " " -# - - -data_16: .asciiz " " -# - - -data_17: .asciiz " " -# - - -data_18: .asciiz " " -# - - -data_19: .asciiz "X" -# - - -data_20: .asciiz "X" -# - - -data_21: .asciiz "X" -# - - -data_22: .asciiz "X" -# - - -data_23: .asciiz "X" -# - - -data_24: .asciiz "X" -# - - -data_25: .asciiz "X" -# - - -data_26: .asciiz "X" -# - - -data_27: .asciiz "X" -# - - -data_28: .asciiz "X" -# - - -data_29: .asciiz "X" -# - - -data_30: .asciiz "-" -# - - -data_31: .asciiz "-" -# - - -data_32: .asciiz "\nPlease chose a number:\n" -# - - -data_33: .asciiz "\t1: A cross\n" -# - - -data_34: .asciiz "\t2: A slash from the upper left to lower right\n" -# - - -data_35: .asciiz "\t3: A slash from the upper right to lower left\n" -# - - -data_36: .asciiz "\t4: An X\n" -# - - -data_37: .asciiz "\t5: A greater than sign \n" -# - - -data_38: .asciiz "\t6: A less than sign\n" -# - - -data_39: .asciiz "\t7: Two greater than signs\n" -# - - -data_40: .asciiz "\t8: Two less than signs\n" -# - - -data_41: .asciiz "\t9: A 'V'\n" -# - - -data_42: .asciiz "\t10: An inverse 'V'\n" -# - - -data_43: .asciiz "\t11: Numbers 9 and 10 combined\n" -# - - -data_44: .asciiz "\t12: A full grid\n" -# - - -data_45: .asciiz "\t13: A 'T'\n" -# - - -data_46: .asciiz "\t14: A plus '+'\n" -# - - -data_47: .asciiz "\t15: A 'W'\n" -# - - -data_48: .asciiz "\t16: An 'M'\n" -# - - -data_49: .asciiz "\t17: An 'E'\n" -# - - -data_50: .asciiz "\t18: A '3'\n" -# - - -data_51: .asciiz "\t19: An 'O'\n" -# - - -data_52: .asciiz "\t20: An '8'\n" -# - - -data_53: .asciiz "\t21: An 'S'\n" -# - - -data_54: .asciiz "Your choice => " -# - - -data_55: .asciiz "\n" -# - - -data_56: .asciiz " XX XXXX XXXX XX " -# - - -data_57: .asciiz " X X X X X " -# - - -data_58: .asciiz "X X X X X" -# - - -data_59: .asciiz "X X X X X X X X X" -# - - -data_60: .asciiz "X X X X X " -# - - -data_61: .asciiz " X X X X X" -# - - -data_62: .asciiz "X X X XX X " -# - - -data_63: .asciiz " X XX X X X " -# - - -data_64: .asciiz "X X X X X " -# - - -data_65: .asciiz " X X X X X" -# - - -data_66: .asciiz "X X X X X X X X" -# - - -data_67: .asciiz "XXXXXXXXXXXXXXXXXXXXXXXXX" -# - - -data_68: .asciiz "XXXXX X X X X " -# - - -data_69: .asciiz " X X XXXXX X X " -# - - -data_70: .asciiz "X X X X X X X " -# - - -data_71: .asciiz " X X X X X X X" -# - - -data_72: .asciiz "XXXXX X XXXXX X XXXX" -# - - -data_73: .asciiz "XXX X X X X XXXX " -# - - -data_74: .asciiz " XX X XX X XX " -# - - -data_75: .asciiz " XX X XX X XX X XX X XX " -# - - -data_76: .asciiz " XXXX X XX X XXXX " -# - - -data_77: .asciiz " " -# - - -data_78: .asciiz "Would you like to continue with the next generation? \n" -# - - -data_79: .asciiz "Please use lowercase y or n for your answer [y]: " -# - - -data_80: .asciiz "\n" -# - - -data_81: .asciiz "n" -# - - -data_82: .asciiz "\n\n" -# - - -data_83: .asciiz "Would you like to choose a background pattern? \n" -# - - -data_84: .asciiz "Please use lowercase y or n for your answer [n]: " -# - - -data_85: .asciiz "y" -# - - -data_86: .asciiz "Welcome to the Game of Life.\n" -# - - -data_87: .asciiz "There are many initial states to choose from. \n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - li $a0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 32 bytes of memory - li $a0, 32 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) - # Load type offset - li $t2, 24 - sw $t2, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Board__attrib__rows__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Board__attrib__columns__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Board__attrib__board_size__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __CellularAutomaton__attrib__population_map__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__cells__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t1, Main_vtable - # Get pointer to function address - lw $t2, 108($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Board__attrib__rows__init implementation. -# @Params: -__Board__attrib__rows__init: - # Allocate stack frame for function __Board__attrib__rows__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Board__attrib__rows__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Board__attrib__columns__init implementation. -# @Params: -__Board__attrib__columns__init: - # Allocate stack frame for function __Board__attrib__columns__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Board__attrib__columns__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Board__attrib__board_size__init implementation. -# @Params: -__Board__attrib__board_size__init: - # Allocate stack frame for function __Board__attrib__board_size__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Board__attrib__board_size__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_size_of_board_at_Board implementation. -# @Params: -# 0($fp) = param_size_of_board_at_Board_initial_0 -function_size_of_board_at_Board: - # Allocate stack frame for function function_size_of_board_at_Board. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_size_of_board_at_Board_internal_0 --> -4($fp) - # PARAM param_size_of_board_at_Board_initial_0 --> 0($fp) - # local_size_of_board_at_Board_internal_0 = PARAM param_size_of_board_at_Board_initial_0 - lw $t1, 0($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_size_of_board_at_Board_internal_0 --> -4($fp) - # LOCAL local_size_of_board_at_Board_internal_1 --> -8($fp) - # local_size_of_board_at_Board_internal_1 = VCALL local_size_of_board_at_Board_internal_0 length - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_size_of_board_at_Board_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_size_of_board_at_Board. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_board_init_at_Board implementation. -# @Params: -# 0($fp) = param_board_init_at_Board_start_0 -function_board_init_at_Board: - # Allocate stack frame for function function_board_init_at_Board. - subu $sp, $sp, 76 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 76 - # LOCAL local_board_init_at_Board_internal_3 --> -16($fp) - # local_board_init_at_Board_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_board_init_at_Board_internal_1 --> -8($fp) - # LOCAL local_board_init_at_Board_internal_3 --> -16($fp) - # local_board_init_at_Board_internal_1 = local_board_init_at_Board_internal_3 - lw $t1, -16($fp) - sw $t1, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_board_init_at_Board_start_0 - # PARAM param_board_init_at_Board_start_0 --> 0($fp) - lw $t1, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_board_init_at_Board_internal_1 --> -8($fp) - # LOCAL local_board_init_at_Board_internal_2 --> -12($fp) - # local_board_init_at_Board_internal_2 = VCALL local_board_init_at_Board_internal_1 size_of_board - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 28($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_2 --> -12($fp) - # local_board_init_at_Board_size_0 = local_board_init_at_Board_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # LOCAL local_board_init_at_Board_internal_5 --> -24($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # local_board_init_at_Board_internal_5 = local_board_init_at_Board_size_0 - 15 - lw $t1, -4($fp) - sub $t1, $t1, 15 - sw $t1, -24($fp) - # IF_ZERO local_board_init_at_Board_internal_5 GOTO label_TRUE_3 - # IF_ZERO local_board_init_at_Board_internal_5 GOTO label_TRUE_3 - lw $t1, -24($fp) - beq $t1, 0, label_TRUE_3 - # LOCAL local_board_init_at_Board_internal_5 --> -24($fp) - # local_board_init_at_Board_internal_5 = 0 - li $t1, 0 - sw $t1, -24($fp) - # GOTO label_END_4 -j label_END_4 -label_TRUE_3: - # LOCAL local_board_init_at_Board_internal_5 --> -24($fp) - # local_board_init_at_Board_internal_5 = 1 - li $t1, 1 - sw $t1, -24($fp) - label_END_4: -# IF_ZERO local_board_init_at_Board_internal_5 GOTO label_FALSEIF_1 -# IF_ZERO local_board_init_at_Board_internal_5 GOTO label_FALSEIF_1 -lw $t1, -24($fp) -beq $t1, 0, label_FALSEIF_1 -# -li $t1, 3 -sw $t1, 12($s1) -# -li $t1, 5 -sw $t1, 16($s1) -# -# LOCAL local_board_init_at_Board_size_0 --> -4($fp) -lw $t1, -4($fp) -sw $t1, 20($s1) -# LOCAL local_board_init_at_Board_internal_4 --> -20($fp) -# local_board_init_at_Board_internal_4 = -# GOTO label_ENDIF_2 -j label_ENDIF_2 -label_FALSEIF_1: - # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # local_board_init_at_Board_internal_7 = local_board_init_at_Board_size_0 - 16 - lw $t1, -4($fp) - sub $t1, $t1, 16 - sw $t1, -32($fp) - # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_7 - # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_7 - lw $t1, -32($fp) - beq $t1, 0, label_TRUE_7 - # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) - # local_board_init_at_Board_internal_7 = 0 - li $t1, 0 - sw $t1, -32($fp) - # GOTO label_END_8 -j label_END_8 -label_TRUE_7: - # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) - # local_board_init_at_Board_internal_7 = 1 - li $t1, 1 - sw $t1, -32($fp) - label_END_8: -# IF_ZERO local_board_init_at_Board_internal_7 GOTO label_FALSEIF_5 -# IF_ZERO local_board_init_at_Board_internal_7 GOTO label_FALSEIF_5 -lw $t1, -32($fp) -beq $t1, 0, label_FALSEIF_5 -# -li $t1, 4 -sw $t1, 12($s1) -# -li $t1, 4 -sw $t1, 16($s1) -# -# LOCAL local_board_init_at_Board_size_0 --> -4($fp) -lw $t1, -4($fp) -sw $t1, 20($s1) -# LOCAL local_board_init_at_Board_internal_6 --> -28($fp) -# local_board_init_at_Board_internal_6 = -# GOTO label_ENDIF_6 -j label_ENDIF_6 -label_FALSEIF_5: - # LOCAL local_board_init_at_Board_internal_9 --> -40($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # local_board_init_at_Board_internal_9 = local_board_init_at_Board_size_0 - 20 - lw $t1, -4($fp) - sub $t1, $t1, 20 - sw $t1, -40($fp) - # IF_ZERO local_board_init_at_Board_internal_9 GOTO label_TRUE_11 - # IF_ZERO local_board_init_at_Board_internal_9 GOTO label_TRUE_11 - lw $t1, -40($fp) - beq $t1, 0, label_TRUE_11 - # LOCAL local_board_init_at_Board_internal_9 --> -40($fp) - # local_board_init_at_Board_internal_9 = 0 - li $t1, 0 - sw $t1, -40($fp) - # GOTO label_END_12 -j label_END_12 -label_TRUE_11: - # LOCAL local_board_init_at_Board_internal_9 --> -40($fp) - # local_board_init_at_Board_internal_9 = 1 - li $t1, 1 - sw $t1, -40($fp) - label_END_12: -# IF_ZERO local_board_init_at_Board_internal_9 GOTO label_FALSEIF_9 -# IF_ZERO local_board_init_at_Board_internal_9 GOTO label_FALSEIF_9 -lw $t1, -40($fp) -beq $t1, 0, label_FALSEIF_9 -# -li $t1, 4 -sw $t1, 12($s1) -# -li $t1, 5 -sw $t1, 16($s1) -# -# LOCAL local_board_init_at_Board_size_0 --> -4($fp) -lw $t1, -4($fp) -sw $t1, 20($s1) -# LOCAL local_board_init_at_Board_internal_8 --> -36($fp) -# local_board_init_at_Board_internal_8 = -# GOTO label_ENDIF_10 -j label_ENDIF_10 -label_FALSEIF_9: - # LOCAL local_board_init_at_Board_internal_11 --> -48($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # local_board_init_at_Board_internal_11 = local_board_init_at_Board_size_0 - 21 - lw $t1, -4($fp) - sub $t1, $t1, 21 - sw $t1, -48($fp) - # IF_ZERO local_board_init_at_Board_internal_11 GOTO label_TRUE_15 - # IF_ZERO local_board_init_at_Board_internal_11 GOTO label_TRUE_15 - lw $t1, -48($fp) - beq $t1, 0, label_TRUE_15 - # LOCAL local_board_init_at_Board_internal_11 --> -48($fp) - # local_board_init_at_Board_internal_11 = 0 - li $t1, 0 - sw $t1, -48($fp) - # GOTO label_END_16 -j label_END_16 -label_TRUE_15: - # LOCAL local_board_init_at_Board_internal_11 --> -48($fp) - # local_board_init_at_Board_internal_11 = 1 - li $t1, 1 - sw $t1, -48($fp) - label_END_16: -# IF_ZERO local_board_init_at_Board_internal_11 GOTO label_FALSEIF_13 -# IF_ZERO local_board_init_at_Board_internal_11 GOTO label_FALSEIF_13 -lw $t1, -48($fp) -beq $t1, 0, label_FALSEIF_13 -# -li $t1, 3 -sw $t1, 12($s1) -# -li $t1, 7 -sw $t1, 16($s1) -# -# LOCAL local_board_init_at_Board_size_0 --> -4($fp) -lw $t1, -4($fp) -sw $t1, 20($s1) -# LOCAL local_board_init_at_Board_internal_10 --> -44($fp) -# local_board_init_at_Board_internal_10 = -# GOTO label_ENDIF_14 -j label_ENDIF_14 -label_FALSEIF_13: - # LOCAL local_board_init_at_Board_internal_13 --> -56($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # local_board_init_at_Board_internal_13 = local_board_init_at_Board_size_0 - 25 - lw $t1, -4($fp) - sub $t1, $t1, 25 - sw $t1, -56($fp) - # IF_ZERO local_board_init_at_Board_internal_13 GOTO label_TRUE_19 - # IF_ZERO local_board_init_at_Board_internal_13 GOTO label_TRUE_19 - lw $t1, -56($fp) - beq $t1, 0, label_TRUE_19 - # LOCAL local_board_init_at_Board_internal_13 --> -56($fp) - # local_board_init_at_Board_internal_13 = 0 - li $t1, 0 - sw $t1, -56($fp) - # GOTO label_END_20 -j label_END_20 -label_TRUE_19: - # LOCAL local_board_init_at_Board_internal_13 --> -56($fp) - # local_board_init_at_Board_internal_13 = 1 - li $t1, 1 - sw $t1, -56($fp) - label_END_20: -# IF_ZERO local_board_init_at_Board_internal_13 GOTO label_FALSEIF_17 -# IF_ZERO local_board_init_at_Board_internal_13 GOTO label_FALSEIF_17 -lw $t1, -56($fp) -beq $t1, 0, label_FALSEIF_17 -# -li $t1, 5 -sw $t1, 12($s1) -# -li $t1, 5 -sw $t1, 16($s1) -# -# LOCAL local_board_init_at_Board_size_0 --> -4($fp) -lw $t1, -4($fp) -sw $t1, 20($s1) -# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) -# local_board_init_at_Board_internal_12 = -# GOTO label_ENDIF_18 -j label_ENDIF_18 -label_FALSEIF_17: - # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # local_board_init_at_Board_internal_15 = local_board_init_at_Board_size_0 - 28 - lw $t1, -4($fp) - sub $t1, $t1, 28 - sw $t1, -64($fp) - # IF_ZERO local_board_init_at_Board_internal_15 GOTO label_TRUE_23 - # IF_ZERO local_board_init_at_Board_internal_15 GOTO label_TRUE_23 - lw $t1, -64($fp) - beq $t1, 0, label_TRUE_23 - # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) - # local_board_init_at_Board_internal_15 = 0 - li $t1, 0 - sw $t1, -64($fp) - # GOTO label_END_24 -j label_END_24 -label_TRUE_23: - # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) - # local_board_init_at_Board_internal_15 = 1 - li $t1, 1 - sw $t1, -64($fp) - label_END_24: -# IF_ZERO local_board_init_at_Board_internal_15 GOTO label_FALSEIF_21 -# IF_ZERO local_board_init_at_Board_internal_15 GOTO label_FALSEIF_21 -lw $t1, -64($fp) -beq $t1, 0, label_FALSEIF_21 -# -li $t1, 7 -sw $t1, 12($s1) -# -li $t1, 4 -sw $t1, 16($s1) -# -# LOCAL local_board_init_at_Board_size_0 --> -4($fp) -lw $t1, -4($fp) -sw $t1, 20($s1) -# LOCAL local_board_init_at_Board_internal_14 --> -60($fp) -# local_board_init_at_Board_internal_14 = -# GOTO label_ENDIF_22 -j label_ENDIF_22 -label_FALSEIF_21: - # - li $t1, 5 - sw $t1, 12($s1) - # - li $t1, 5 - sw $t1, 16($s1) - # - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - lw $t1, -4($fp) - sw $t1, 20($s1) - # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) - # local_board_init_at_Board_internal_14 = - label_ENDIF_22: -# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) -# LOCAL local_board_init_at_Board_internal_14 --> -60($fp) -# local_board_init_at_Board_internal_12 = local_board_init_at_Board_internal_14 -lw $t1, -60($fp) -sw $t1, -52($fp) -label_ENDIF_18: -# LOCAL local_board_init_at_Board_internal_10 --> -44($fp) -# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) -# local_board_init_at_Board_internal_10 = local_board_init_at_Board_internal_12 -lw $t1, -52($fp) -sw $t1, -44($fp) -label_ENDIF_14: -# LOCAL local_board_init_at_Board_internal_8 --> -36($fp) -# LOCAL local_board_init_at_Board_internal_10 --> -44($fp) -# local_board_init_at_Board_internal_8 = local_board_init_at_Board_internal_10 -lw $t1, -44($fp) -sw $t1, -36($fp) -label_ENDIF_10: -# LOCAL local_board_init_at_Board_internal_6 --> -28($fp) -# LOCAL local_board_init_at_Board_internal_8 --> -36($fp) -# local_board_init_at_Board_internal_6 = local_board_init_at_Board_internal_8 -lw $t1, -36($fp) -sw $t1, -28($fp) -label_ENDIF_6: -# LOCAL local_board_init_at_Board_internal_4 --> -20($fp) -# LOCAL local_board_init_at_Board_internal_6 --> -28($fp) -# local_board_init_at_Board_internal_4 = local_board_init_at_Board_internal_6 -lw $t1, -28($fp) -sw $t1, -20($fp) -label_ENDIF_2: -# LOCAL local_board_init_at_Board_internal_16 --> -68($fp) -# local_board_init_at_Board_internal_16 = SELF -sw $s1, -68($fp) -# RETURN local_board_init_at_Board_internal_16 -lw $v0, -68($fp) -# Deallocate stack frame for function function_board_init_at_Board. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 76 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# __CellularAutomaton__attrib__population_map__init implementation. -# @Params: -__CellularAutomaton__attrib__population_map__init: - # Allocate stack frame for function __CellularAutomaton__attrib__population_map__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_rAutomaton__attrib__population_map__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_0 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -4($fp) - # RETURN local_rAutomaton__attrib__population_map__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __CellularAutomaton__attrib__population_map__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_init_at_CellularAutomaton_map_0 -function_init_at_CellularAutomaton: - # Allocate stack frame for function function_init_at_CellularAutomaton. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_CellularAutomaton_map_0 --> 0($fp) - lw $t1, 0($fp) - sw $t1, 24($s1) - # LOCAL local_init_at_CellularAutomaton_internal_2 --> -12($fp) - # local_init_at_CellularAutomaton_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_init_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_init_at_CellularAutomaton_internal_2 --> -12($fp) - # local_init_at_CellularAutomaton_internal_0 = local_init_at_CellularAutomaton_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_init_at_CellularAutomaton_map_0 - # PARAM param_init_at_CellularAutomaton_map_0 --> 0($fp) - lw $t1, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_init_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_init_at_CellularAutomaton_internal_1 --> -8($fp) - # local_init_at_CellularAutomaton_internal_1 = VCALL local_init_at_CellularAutomaton_internal_0 board_init - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 32($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_init_at_CellularAutomaton_internal_3 --> -16($fp) - # local_init_at_CellularAutomaton_internal_3 = SELF - sw $s1, -16($fp) - # RETURN local_init_at_CellularAutomaton_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_init_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_print_at_CellularAutomaton implementation. -# @Params: -function_print_at_CellularAutomaton: - # Allocate stack frame for function function_print_at_CellularAutomaton. - subu $sp, $sp, 112 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 112 - # LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) - # local_print_at_CellularAutomaton_i_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # local_print_at_CellularAutomaton_internal_2 = GETATTRIBUTE board_size CellularAutomaton - # LOCAL local_print_at_CellularAutomaton_internal_2 --> -12($fp) - lw $t1, 20($s1) - sw $t1, -12($fp) - # LOCAL local_print_at_CellularAutomaton_num_1 --> -8($fp) - # LOCAL local_print_at_CellularAutomaton_internal_2 --> -12($fp) - # local_print_at_CellularAutomaton_num_1 = local_print_at_CellularAutomaton_internal_2 - lw $t1, -12($fp) - sw $t1, -8($fp) - # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) - # local_print_at_CellularAutomaton_internal_5 = SELF - sw $s1, -24($fp) - # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) - # local_print_at_CellularAutomaton_internal_3 = local_print_at_CellularAutomaton_internal_5 - lw $t1, -24($fp) - sw $t1, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_2 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -28($fp) - # ARG local_print_at_CellularAutomaton_internal_6 - # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) - lw $t1, -28($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_print_at_CellularAutomaton_internal_4 --> -20($fp) - # local_print_at_CellularAutomaton_internal_4 = VCALL local_print_at_CellularAutomaton_internal_3 out_string - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - label_WHILE_25: - # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) - # LOCAL local_print_at_CellularAutomaton_num_1 --> -8($fp) - # local_print_at_CellularAutomaton_internal_7 = local_print_at_CellularAutomaton_i_0 - local_print_at_CellularAutomaton_num_1 - lw $t1, -4($fp) - lw $t2, -8($fp) - sub $t1, $t1, $t2 - sw $t1, -32($fp) - # IF_GREATER_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_FALSE_27 - # IF_GREATER_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_FALSE_27 - lw $t1, -32($fp) - bgt $t1, 0, label_FALSE_27 - # IF_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_FALSE_27 - # IF_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_FALSE_27 - lw $t1, -32($fp) - beq $t1, 0, label_FALSE_27 - # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) - # local_print_at_CellularAutomaton_internal_7 = 1 - li $t1, 1 - sw $t1, -32($fp) - # GOTO label_END_28 -j label_END_28 -label_FALSE_27: - # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) - # local_print_at_CellularAutomaton_internal_7 = 0 - li $t1, 0 - sw $t1, -32($fp) - label_END_28: -# IF_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_WHILE_END_26 -# IF_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_WHILE_END_26 -lw $t1, -32($fp) -beq $t1, 0, label_WHILE_END_26 -# LOCAL local_print_at_CellularAutomaton_internal_10 --> -44($fp) -# local_print_at_CellularAutomaton_internal_10 = SELF -sw $s1, -44($fp) -# LOCAL local_print_at_CellularAutomaton_internal_8 --> -36($fp) -# LOCAL local_print_at_CellularAutomaton_internal_10 --> -44($fp) -# local_print_at_CellularAutomaton_internal_8 = local_print_at_CellularAutomaton_internal_10 -lw $t1, -44($fp) -sw $t1, -36($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_print_at_CellularAutomaton_internal_13 = GETATTRIBUTE population_map CellularAutomaton -# LOCAL local_print_at_CellularAutomaton_internal_13 --> -56($fp) -lw $t1, 24($s1) -sw $t1, -56($fp) -# LOCAL local_print_at_CellularAutomaton_internal_11 --> -48($fp) -# LOCAL local_print_at_CellularAutomaton_internal_13 --> -56($fp) -# local_print_at_CellularAutomaton_internal_11 = local_print_at_CellularAutomaton_internal_13 -lw $t1, -56($fp) -sw $t1, -48($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_print_at_CellularAutomaton_i_0 -# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) -lw $t1, -4($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# local_print_at_CellularAutomaton_internal_14 = GETATTRIBUTE columns CellularAutomaton -# LOCAL local_print_at_CellularAutomaton_internal_14 --> -60($fp) -lw $t1, 16($s1) -sw $t1, -60($fp) -# ARG local_print_at_CellularAutomaton_internal_14 -# LOCAL local_print_at_CellularAutomaton_internal_14 --> -60($fp) -lw $t1, -60($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_print_at_CellularAutomaton_internal_11 --> -48($fp) -# LOCAL local_print_at_CellularAutomaton_internal_12 --> -52($fp) -# local_print_at_CellularAutomaton_internal_12 = VCALL local_print_at_CellularAutomaton_internal_11 substr -# Save new self pointer in $s1 -lw $s1, -48($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 16($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -52($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_print_at_CellularAutomaton_internal_12 -# LOCAL local_print_at_CellularAutomaton_internal_12 --> -52($fp) -lw $t1, -52($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_print_at_CellularAutomaton_internal_8 --> -36($fp) -# LOCAL local_print_at_CellularAutomaton_internal_9 --> -40($fp) -# local_print_at_CellularAutomaton_internal_9 = VCALL local_print_at_CellularAutomaton_internal_8 out_string -# Save new self pointer in $s1 -lw $s1, -36($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 12($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -40($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_print_at_CellularAutomaton_internal_17 --> -72($fp) -# local_print_at_CellularAutomaton_internal_17 = SELF -sw $s1, -72($fp) -# LOCAL local_print_at_CellularAutomaton_internal_15 --> -64($fp) -# LOCAL local_print_at_CellularAutomaton_internal_17 --> -72($fp) -# local_print_at_CellularAutomaton_internal_15 = local_print_at_CellularAutomaton_internal_17 -lw $t1, -72($fp) -sw $t1, -64($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_print_at_CellularAutomaton_internal_18 --> -76($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_3 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -76($fp) -# ARG local_print_at_CellularAutomaton_internal_18 -# LOCAL local_print_at_CellularAutomaton_internal_18 --> -76($fp) -lw $t1, -76($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_print_at_CellularAutomaton_internal_15 --> -64($fp) -# LOCAL local_print_at_CellularAutomaton_internal_16 --> -68($fp) -# local_print_at_CellularAutomaton_internal_16 = VCALL local_print_at_CellularAutomaton_internal_15 out_string -# Save new self pointer in $s1 -lw $s1, -64($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 12($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -68($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# local_print_at_CellularAutomaton_internal_20 = GETATTRIBUTE columns CellularAutomaton -# LOCAL local_print_at_CellularAutomaton_internal_20 --> -84($fp) -lw $t1, 16($s1) -sw $t1, -84($fp) -# LOCAL local_print_at_CellularAutomaton_internal_19 --> -80($fp) -# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) -# LOCAL local_print_at_CellularAutomaton_internal_20 --> -84($fp) -# local_print_at_CellularAutomaton_internal_19 = local_print_at_CellularAutomaton_i_0 + local_print_at_CellularAutomaton_internal_20 -lw $t1, -4($fp) -lw $t2, -84($fp) -add $t1, $t1, $t2 -sw $t1, -80($fp) -# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) -# LOCAL local_print_at_CellularAutomaton_internal_19 --> -80($fp) -# local_print_at_CellularAutomaton_i_0 = local_print_at_CellularAutomaton_internal_19 -lw $t1, -80($fp) -sw $t1, -4($fp) -# GOTO label_WHILE_25 -j label_WHILE_25 -label_WHILE_END_26: - # LOCAL local_print_at_CellularAutomaton_internal_23 --> -96($fp) - # local_print_at_CellularAutomaton_internal_23 = SELF - sw $s1, -96($fp) - # LOCAL local_print_at_CellularAutomaton_internal_21 --> -88($fp) - # LOCAL local_print_at_CellularAutomaton_internal_23 --> -96($fp) - # local_print_at_CellularAutomaton_internal_21 = local_print_at_CellularAutomaton_internal_23 - lw $t1, -96($fp) - sw $t1, -88($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_CellularAutomaton_internal_24 --> -100($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_4 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -100($fp) - # ARG local_print_at_CellularAutomaton_internal_24 - # LOCAL local_print_at_CellularAutomaton_internal_24 --> -100($fp) - lw $t1, -100($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_CellularAutomaton_internal_21 --> -88($fp) - # LOCAL local_print_at_CellularAutomaton_internal_22 --> -92($fp) - # local_print_at_CellularAutomaton_internal_22 = VCALL local_print_at_CellularAutomaton_internal_21 out_string - # Save new self pointer in $s1 - lw $s1, -88($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -92($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_CellularAutomaton_internal_25 --> -104($fp) - # local_print_at_CellularAutomaton_internal_25 = SELF - sw $s1, -104($fp) - # RETURN local_print_at_CellularAutomaton_internal_25 - lw $v0, -104($fp) - # Deallocate stack frame for function function_print_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 112 - jr $ra - # Function END - - -# function_num_cells_at_CellularAutomaton implementation. -# @Params: -function_num_cells_at_CellularAutomaton: - # Allocate stack frame for function function_num_cells_at_CellularAutomaton. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_num_cells_at_CellularAutomaton_internal_2 = GETATTRIBUTE population_map CellularAutomaton - # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) - lw $t1, 24($s1) - sw $t1, -12($fp) - # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) - # local_num_cells_at_CellularAutomaton_internal_0 = local_num_cells_at_CellularAutomaton_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_num_cells_at_CellularAutomaton_internal_1 --> -8($fp) - # local_num_cells_at_CellularAutomaton_internal_1 = VCALL local_num_cells_at_CellularAutomaton_internal_0 length - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_num_cells_at_CellularAutomaton_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_num_cells_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cell_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_cell_at_CellularAutomaton_position_0 -function_cell_at_CellularAutomaton: - # Allocate stack frame for function function_cell_at_CellularAutomaton. - subu $sp, $sp, 40 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 40 - # local_cell_at_CellularAutomaton_internal_3 = GETATTRIBUTE board_size CellularAutomaton - # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) - lw $t1, 20($s1) - sw $t1, -16($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) - # local_cell_at_CellularAutomaton_internal_2 = local_cell_at_CellularAutomaton_internal_3 - 1 - lw $t1, -16($fp) - sub $t1, $t1, 1 - sw $t1, -12($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) - # PARAM param_cell_at_CellularAutomaton_position_0 --> 0($fp) - # local_cell_at_CellularAutomaton_internal_1 = local_cell_at_CellularAutomaton_internal_2 - PARAM param_cell_at_CellularAutomaton_position_0 - lw $t1, -12($fp) - lw $t2, 0($fp) - sub $t1, $t1, $t2 - sw $t1, -8($fp) - # IF_GREATER_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSE_31 - # IF_GREATER_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSE_31 - lw $t1, -8($fp) - bgt $t1, 0, label_FALSE_31 - # IF_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSE_31 - # IF_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSE_31 - lw $t1, -8($fp) - beq $t1, 0, label_FALSE_31 - # LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) - # local_cell_at_CellularAutomaton_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - # GOTO label_END_32 -j label_END_32 -label_FALSE_31: - # LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) - # local_cell_at_CellularAutomaton_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - label_END_32: -# IF_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_29 -# IF_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_29 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_29 -# LOCAL local_cell_at_CellularAutomaton_internal_4 --> -20($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_5 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -20($fp) -# LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_cell_at_CellularAutomaton_internal_4 --> -20($fp) -# local_cell_at_CellularAutomaton_internal_0 = local_cell_at_CellularAutomaton_internal_4 -lw $t1, -20($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_30 -j label_ENDIF_30 -label_FALSEIF_29: - # local_cell_at_CellularAutomaton_internal_7 = GETATTRIBUTE population_map CellularAutomaton - # LOCAL local_cell_at_CellularAutomaton_internal_7 --> -32($fp) - lw $t1, 24($s1) - sw $t1, -32($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_7 --> -32($fp) - # local_cell_at_CellularAutomaton_internal_5 = local_cell_at_CellularAutomaton_internal_7 - lw $t1, -32($fp) - sw $t1, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cell_at_CellularAutomaton_position_0 - # PARAM param_cell_at_CellularAutomaton_position_0 --> 0($fp) - lw $t1, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # ARG 1 - li $t1, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_cell_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_6 --> -28($fp) - # local_cell_at_CellularAutomaton_internal_6 = VCALL local_cell_at_CellularAutomaton_internal_5 substr - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 16($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_6 --> -28($fp) - # local_cell_at_CellularAutomaton_internal_0 = local_cell_at_CellularAutomaton_internal_6 - lw $t1, -28($fp) - sw $t1, -4($fp) - label_ENDIF_30: -# RETURN local_cell_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_cell_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 40 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_north_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_north_at_CellularAutomaton_position_0 -function_north_at_CellularAutomaton: - # Allocate stack frame for function function_north_at_CellularAutomaton. - subu $sp, $sp, 48 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 48 - # local_north_at_CellularAutomaton_internal_3 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_north_at_CellularAutomaton_internal_3 --> -16($fp) - lw $t1, 16($s1) - sw $t1, -16($fp) - # LOCAL local_north_at_CellularAutomaton_internal_2 --> -12($fp) - # PARAM param_north_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_north_at_CellularAutomaton_internal_3 --> -16($fp) - # local_north_at_CellularAutomaton_internal_2 = PARAM param_north_at_CellularAutomaton_position_0 - local_north_at_CellularAutomaton_internal_3 - lw $t1, 0($fp) - lw $t2, -16($fp) - sub $t1, $t1, $t2 - sw $t1, -12($fp) - # LOCAL local_north_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_north_at_CellularAutomaton_internal_2 --> -12($fp) - # local_north_at_CellularAutomaton_internal_1 = local_north_at_CellularAutomaton_internal_2 - 0 - lw $t1, -12($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_GREATER_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSE_35 - # IF_GREATER_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSE_35 - lw $t1, -8($fp) - bgt $t1, 0, label_FALSE_35 - # IF_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSE_35 - # IF_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSE_35 - lw $t1, -8($fp) - beq $t1, 0, label_FALSE_35 - # LOCAL local_north_at_CellularAutomaton_internal_1 --> -8($fp) - # local_north_at_CellularAutomaton_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - # GOTO label_END_36 -j label_END_36 -label_FALSE_35: - # LOCAL local_north_at_CellularAutomaton_internal_1 --> -8($fp) - # local_north_at_CellularAutomaton_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - label_END_36: -# IF_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_33 -# IF_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_33 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_33 -# LOCAL local_north_at_CellularAutomaton_internal_4 --> -20($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_6 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -20($fp) -# LOCAL local_north_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_north_at_CellularAutomaton_internal_4 --> -20($fp) -# local_north_at_CellularAutomaton_internal_0 = local_north_at_CellularAutomaton_internal_4 -lw $t1, -20($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_34 -j label_ENDIF_34 -label_FALSEIF_33: - # LOCAL local_north_at_CellularAutomaton_internal_7 --> -32($fp) - # local_north_at_CellularAutomaton_internal_7 = SELF - sw $s1, -32($fp) - # LOCAL local_north_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_north_at_CellularAutomaton_internal_7 --> -32($fp) - # local_north_at_CellularAutomaton_internal_5 = local_north_at_CellularAutomaton_internal_7 - lw $t1, -32($fp) - sw $t1, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_north_at_CellularAutomaton_internal_9 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_north_at_CellularAutomaton_internal_9 --> -40($fp) - lw $t1, 16($s1) - sw $t1, -40($fp) - # LOCAL local_north_at_CellularAutomaton_internal_8 --> -36($fp) - # PARAM param_north_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_north_at_CellularAutomaton_internal_9 --> -40($fp) - # local_north_at_CellularAutomaton_internal_8 = PARAM param_north_at_CellularAutomaton_position_0 - local_north_at_CellularAutomaton_internal_9 - lw $t1, 0($fp) - lw $t2, -40($fp) - sub $t1, $t1, $t2 - sw $t1, -36($fp) - # ARG local_north_at_CellularAutomaton_internal_8 - # LOCAL local_north_at_CellularAutomaton_internal_8 --> -36($fp) - lw $t1, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_north_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_north_at_CellularAutomaton_internal_6 --> -28($fp) - # local_north_at_CellularAutomaton_internal_6 = VCALL local_north_at_CellularAutomaton_internal_5 cell - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 48($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_north_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_north_at_CellularAutomaton_internal_6 --> -28($fp) - # local_north_at_CellularAutomaton_internal_0 = local_north_at_CellularAutomaton_internal_6 - lw $t1, -28($fp) - sw $t1, -4($fp) - label_ENDIF_34: -# RETURN local_north_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_north_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 48 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_south_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_south_at_CellularAutomaton_position_0 -function_south_at_CellularAutomaton: - # Allocate stack frame for function function_south_at_CellularAutomaton. - subu $sp, $sp, 52 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 52 - # local_south_at_CellularAutomaton_internal_2 = GETATTRIBUTE board_size CellularAutomaton - # LOCAL local_south_at_CellularAutomaton_internal_2 --> -12($fp) - lw $t1, 20($s1) - sw $t1, -12($fp) - # local_south_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_south_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t1, 16($s1) - sw $t1, -20($fp) - # LOCAL local_south_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_south_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_south_at_CellularAutomaton_internal_4 --> -20($fp) - # local_south_at_CellularAutomaton_internal_3 = PARAM param_south_at_CellularAutomaton_position_0 + local_south_at_CellularAutomaton_internal_4 - lw $t1, 0($fp) - lw $t2, -20($fp) - add $t1, $t1, $t2 - sw $t1, -16($fp) - # LOCAL local_south_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_south_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_south_at_CellularAutomaton_internal_3 --> -16($fp) - # local_south_at_CellularAutomaton_internal_1 = local_south_at_CellularAutomaton_internal_2 - local_south_at_CellularAutomaton_internal_3 - lw $t1, -12($fp) - lw $t2, -16($fp) - sub $t1, $t1, $t2 - sw $t1, -8($fp) - # IF_GREATER_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSE_39 - # IF_GREATER_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSE_39 - lw $t1, -8($fp) - bgt $t1, 0, label_FALSE_39 - # IF_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSE_39 - # IF_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSE_39 - lw $t1, -8($fp) - beq $t1, 0, label_FALSE_39 - # LOCAL local_south_at_CellularAutomaton_internal_1 --> -8($fp) - # local_south_at_CellularAutomaton_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - # GOTO label_END_40 -j label_END_40 -label_FALSE_39: - # LOCAL local_south_at_CellularAutomaton_internal_1 --> -8($fp) - # local_south_at_CellularAutomaton_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - label_END_40: -# IF_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_37 -# IF_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_37 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_37 -# LOCAL local_south_at_CellularAutomaton_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_7 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -24($fp) -# LOCAL local_south_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_south_at_CellularAutomaton_internal_5 --> -24($fp) -# local_south_at_CellularAutomaton_internal_0 = local_south_at_CellularAutomaton_internal_5 -lw $t1, -24($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_38 -j label_ENDIF_38 -label_FALSEIF_37: - # LOCAL local_south_at_CellularAutomaton_internal_8 --> -36($fp) - # local_south_at_CellularAutomaton_internal_8 = SELF - sw $s1, -36($fp) - # LOCAL local_south_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_south_at_CellularAutomaton_internal_8 --> -36($fp) - # local_south_at_CellularAutomaton_internal_6 = local_south_at_CellularAutomaton_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_south_at_CellularAutomaton_internal_10 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_south_at_CellularAutomaton_internal_10 --> -44($fp) - lw $t1, 16($s1) - sw $t1, -44($fp) - # LOCAL local_south_at_CellularAutomaton_internal_9 --> -40($fp) - # PARAM param_south_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_south_at_CellularAutomaton_internal_10 --> -44($fp) - # local_south_at_CellularAutomaton_internal_9 = PARAM param_south_at_CellularAutomaton_position_0 + local_south_at_CellularAutomaton_internal_10 - lw $t1, 0($fp) - lw $t2, -44($fp) - add $t1, $t1, $t2 - sw $t1, -40($fp) - # ARG local_south_at_CellularAutomaton_internal_9 - # LOCAL local_south_at_CellularAutomaton_internal_9 --> -40($fp) - lw $t1, -40($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_south_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_south_at_CellularAutomaton_internal_7 --> -32($fp) - # local_south_at_CellularAutomaton_internal_7 = VCALL local_south_at_CellularAutomaton_internal_6 cell - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 48($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_south_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_south_at_CellularAutomaton_internal_7 --> -32($fp) - # local_south_at_CellularAutomaton_internal_0 = local_south_at_CellularAutomaton_internal_7 - lw $t1, -32($fp) - sw $t1, -4($fp) - label_ENDIF_38: -# RETURN local_south_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_south_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 52 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_east_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_east_at_CellularAutomaton_position_0 -function_east_at_CellularAutomaton: - # Allocate stack frame for function function_east_at_CellularAutomaton. - subu $sp, $sp, 60 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 60 - # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) - # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) - # local_east_at_CellularAutomaton_internal_4 = PARAM param_east_at_CellularAutomaton_position_0 + 1 - lw $t1, 0($fp) - add $t1, $t1, 1 - sw $t1, -20($fp) - # local_east_at_CellularAutomaton_internal_5 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_east_at_CellularAutomaton_internal_5 --> -24($fp) - lw $t1, 16($s1) - sw $t1, -24($fp) - # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_east_at_CellularAutomaton_internal_5 --> -24($fp) - # local_east_at_CellularAutomaton_internal_3 = local_east_at_CellularAutomaton_internal_4 / local_east_at_CellularAutomaton_internal_5 - lw $t1, -20($fp) - lw $t2, -24($fp) - div $t1, $t1, $t2 - sw $t1, -16($fp) - # local_east_at_CellularAutomaton_internal_6 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_east_at_CellularAutomaton_internal_6 --> -28($fp) - lw $t1, 16($s1) - sw $t1, -28($fp) - # LOCAL local_east_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_east_at_CellularAutomaton_internal_6 --> -28($fp) - # local_east_at_CellularAutomaton_internal_2 = local_east_at_CellularAutomaton_internal_3 * local_east_at_CellularAutomaton_internal_6 - lw $t1, -16($fp) - lw $t2, -28($fp) - mul $t1, $t1, $t2 - sw $t1, -12($fp) - # LOCAL local_east_at_CellularAutomaton_internal_7 --> -32($fp) - # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) - # local_east_at_CellularAutomaton_internal_7 = PARAM param_east_at_CellularAutomaton_position_0 + 1 - lw $t1, 0($fp) - add $t1, $t1, 1 - sw $t1, -32($fp) - # LOCAL local_east_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_east_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_east_at_CellularAutomaton_internal_7 --> -32($fp) - # local_east_at_CellularAutomaton_internal_1 = local_east_at_CellularAutomaton_internal_2 - local_east_at_CellularAutomaton_internal_7 - lw $t1, -12($fp) - lw $t2, -32($fp) - sub $t1, $t1, $t2 - sw $t1, -8($fp) - # IF_ZERO local_east_at_CellularAutomaton_internal_1 GOTO label_TRUE_43 - # IF_ZERO local_east_at_CellularAutomaton_internal_1 GOTO label_TRUE_43 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_43 - # LOCAL local_east_at_CellularAutomaton_internal_1 --> -8($fp) - # local_east_at_CellularAutomaton_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_44 -j label_END_44 -label_TRUE_43: - # LOCAL local_east_at_CellularAutomaton_internal_1 --> -8($fp) - # local_east_at_CellularAutomaton_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_44: -# IF_ZERO local_east_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_41 -# IF_ZERO local_east_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_41 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_41 -# LOCAL local_east_at_CellularAutomaton_internal_8 --> -36($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_8 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -36($fp) -# LOCAL local_east_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_east_at_CellularAutomaton_internal_8 --> -36($fp) -# local_east_at_CellularAutomaton_internal_0 = local_east_at_CellularAutomaton_internal_8 -lw $t1, -36($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_42 -j label_ENDIF_42 -label_FALSEIF_41: - # LOCAL local_east_at_CellularAutomaton_internal_11 --> -48($fp) - # local_east_at_CellularAutomaton_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_east_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_east_at_CellularAutomaton_internal_11 --> -48($fp) - # local_east_at_CellularAutomaton_internal_9 = local_east_at_CellularAutomaton_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_east_at_CellularAutomaton_internal_12 --> -52($fp) - # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) - # local_east_at_CellularAutomaton_internal_12 = PARAM param_east_at_CellularAutomaton_position_0 + 1 - lw $t1, 0($fp) - add $t1, $t1, 1 - sw $t1, -52($fp) - # ARG local_east_at_CellularAutomaton_internal_12 - # LOCAL local_east_at_CellularAutomaton_internal_12 --> -52($fp) - lw $t1, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_east_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) - # local_east_at_CellularAutomaton_internal_10 = VCALL local_east_at_CellularAutomaton_internal_9 cell - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 48($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_east_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) - # local_east_at_CellularAutomaton_internal_0 = local_east_at_CellularAutomaton_internal_10 - lw $t1, -44($fp) - sw $t1, -4($fp) - label_ENDIF_42: -# RETURN local_east_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_east_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 60 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_west_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_west_at_CellularAutomaton_position_0 -function_west_at_CellularAutomaton: - # Allocate stack frame for function function_west_at_CellularAutomaton. - subu $sp, $sp, 64 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 64 - # LOCAL local_west_at_CellularAutomaton_internal_1 --> -8($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - # local_west_at_CellularAutomaton_internal_1 = PARAM param_west_at_CellularAutomaton_position_0 - 0 - lw $t1, 0($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_ZERO local_west_at_CellularAutomaton_internal_1 GOTO label_TRUE_47 - # IF_ZERO local_west_at_CellularAutomaton_internal_1 GOTO label_TRUE_47 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_47 - # LOCAL local_west_at_CellularAutomaton_internal_1 --> -8($fp) - # local_west_at_CellularAutomaton_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_48 -j label_END_48 -label_TRUE_47: - # LOCAL local_west_at_CellularAutomaton_internal_1 --> -8($fp) - # local_west_at_CellularAutomaton_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_48: -# IF_ZERO local_west_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_45 -# IF_ZERO local_west_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_45 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_45 -# LOCAL local_west_at_CellularAutomaton_internal_2 --> -12($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_9 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -12($fp) -# LOCAL local_west_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_west_at_CellularAutomaton_internal_2 --> -12($fp) -# local_west_at_CellularAutomaton_internal_0 = local_west_at_CellularAutomaton_internal_2 -lw $t1, -12($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_46 -j label_ENDIF_46 -label_FALSEIF_45: - # local_west_at_CellularAutomaton_internal_7 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_west_at_CellularAutomaton_internal_7 --> -32($fp) - lw $t1, 16($s1) - sw $t1, -32($fp) - # LOCAL local_west_at_CellularAutomaton_internal_6 --> -28($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_west_at_CellularAutomaton_internal_7 --> -32($fp) - # local_west_at_CellularAutomaton_internal_6 = PARAM param_west_at_CellularAutomaton_position_0 / local_west_at_CellularAutomaton_internal_7 - lw $t1, 0($fp) - lw $t2, -32($fp) - div $t1, $t1, $t2 - sw $t1, -28($fp) - # local_west_at_CellularAutomaton_internal_8 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_west_at_CellularAutomaton_internal_8 --> -36($fp) - lw $t1, 16($s1) - sw $t1, -36($fp) - # LOCAL local_west_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_west_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_west_at_CellularAutomaton_internal_8 --> -36($fp) - # local_west_at_CellularAutomaton_internal_5 = local_west_at_CellularAutomaton_internal_6 * local_west_at_CellularAutomaton_internal_8 - lw $t1, -28($fp) - lw $t2, -36($fp) - mul $t1, $t1, $t2 - sw $t1, -24($fp) - # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_west_at_CellularAutomaton_internal_5 --> -24($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - # local_west_at_CellularAutomaton_internal_4 = local_west_at_CellularAutomaton_internal_5 - PARAM param_west_at_CellularAutomaton_position_0 - lw $t1, -24($fp) - lw $t2, 0($fp) - sub $t1, $t1, $t2 - sw $t1, -20($fp) - # IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_TRUE_51 - # IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_TRUE_51 - lw $t1, -20($fp) - beq $t1, 0, label_TRUE_51 - # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) - # local_west_at_CellularAutomaton_internal_4 = 0 - li $t1, 0 - sw $t1, -20($fp) - # GOTO label_END_52 -j label_END_52 -label_TRUE_51: - # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) - # local_west_at_CellularAutomaton_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) - label_END_52: -# IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_FALSEIF_49 -# IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_FALSEIF_49 -lw $t1, -20($fp) -beq $t1, 0, label_FALSEIF_49 -# LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_10 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -40($fp) -# LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) -# LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) -# local_west_at_CellularAutomaton_internal_3 = local_west_at_CellularAutomaton_internal_9 -lw $t1, -40($fp) -sw $t1, -16($fp) -# GOTO label_ENDIF_50 -j label_ENDIF_50 -label_FALSEIF_49: - # LOCAL local_west_at_CellularAutomaton_internal_12 --> -52($fp) - # local_west_at_CellularAutomaton_internal_12 = SELF - sw $s1, -52($fp) - # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_west_at_CellularAutomaton_internal_12 --> -52($fp) - # local_west_at_CellularAutomaton_internal_10 = local_west_at_CellularAutomaton_internal_12 - lw $t1, -52($fp) - sw $t1, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_west_at_CellularAutomaton_internal_13 --> -56($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - # local_west_at_CellularAutomaton_internal_13 = PARAM param_west_at_CellularAutomaton_position_0 - 1 - lw $t1, 0($fp) - sub $t1, $t1, 1 - sw $t1, -56($fp) - # ARG local_west_at_CellularAutomaton_internal_13 - # LOCAL local_west_at_CellularAutomaton_internal_13 --> -56($fp) - lw $t1, -56($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_west_at_CellularAutomaton_internal_11 --> -48($fp) - # local_west_at_CellularAutomaton_internal_11 = VCALL local_west_at_CellularAutomaton_internal_10 cell - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 48($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_west_at_CellularAutomaton_internal_11 --> -48($fp) - # local_west_at_CellularAutomaton_internal_3 = local_west_at_CellularAutomaton_internal_11 - lw $t1, -48($fp) - sw $t1, -16($fp) - label_ENDIF_50: -# LOCAL local_west_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) -# local_west_at_CellularAutomaton_internal_0 = local_west_at_CellularAutomaton_internal_3 -lw $t1, -16($fp) -sw $t1, -4($fp) -label_ENDIF_46: -# RETURN local_west_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_west_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 64 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_northwest_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_northwest_at_CellularAutomaton_position_0 -function_northwest_at_CellularAutomaton: - # Allocate stack frame for function function_northwest_at_CellularAutomaton. - subu $sp, $sp, 72 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 72 - # local_northwest_at_CellularAutomaton_internal_3 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_northwest_at_CellularAutomaton_internal_3 --> -16($fp) - lw $t1, 16($s1) - sw $t1, -16($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_2 --> -12($fp) - # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_3 --> -16($fp) - # local_northwest_at_CellularAutomaton_internal_2 = PARAM param_northwest_at_CellularAutomaton_position_0 - local_northwest_at_CellularAutomaton_internal_3 - lw $t1, 0($fp) - lw $t2, -16($fp) - sub $t1, $t1, $t2 - sw $t1, -12($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_2 --> -12($fp) - # local_northwest_at_CellularAutomaton_internal_1 = local_northwest_at_CellularAutomaton_internal_2 - 0 - lw $t1, -12($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_GREATER_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_55 - # IF_GREATER_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_55 - lw $t1, -8($fp) - bgt $t1, 0, label_FALSE_55 - # IF_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_55 - # IF_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_55 - lw $t1, -8($fp) - beq $t1, 0, label_FALSE_55 - # LOCAL local_northwest_at_CellularAutomaton_internal_1 --> -8($fp) - # local_northwest_at_CellularAutomaton_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - # GOTO label_END_56 -j label_END_56 -label_FALSE_55: - # LOCAL local_northwest_at_CellularAutomaton_internal_1 --> -8($fp) - # local_northwest_at_CellularAutomaton_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - label_END_56: -# IF_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_53 -# IF_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_53 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_53 -# LOCAL local_northwest_at_CellularAutomaton_internal_4 --> -20($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_11 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -20($fp) -# LOCAL local_northwest_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_northwest_at_CellularAutomaton_internal_4 --> -20($fp) -# local_northwest_at_CellularAutomaton_internal_0 = local_northwest_at_CellularAutomaton_internal_4 -lw $t1, -20($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_54 -j label_ENDIF_54 -label_FALSEIF_53: - # local_northwest_at_CellularAutomaton_internal_9 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_northwest_at_CellularAutomaton_internal_9 --> -40($fp) - lw $t1, 16($s1) - sw $t1, -40($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_8 --> -36($fp) - # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_9 --> -40($fp) - # local_northwest_at_CellularAutomaton_internal_8 = PARAM param_northwest_at_CellularAutomaton_position_0 / local_northwest_at_CellularAutomaton_internal_9 - lw $t1, 0($fp) - lw $t2, -40($fp) - div $t1, $t1, $t2 - sw $t1, -36($fp) - # local_northwest_at_CellularAutomaton_internal_10 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) - lw $t1, 16($s1) - sw $t1, -44($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) - # local_northwest_at_CellularAutomaton_internal_7 = local_northwest_at_CellularAutomaton_internal_8 * local_northwest_at_CellularAutomaton_internal_10 - lw $t1, -36($fp) - lw $t2, -44($fp) - mul $t1, $t1, $t2 - sw $t1, -32($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_7 --> -32($fp) - # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) - # local_northwest_at_CellularAutomaton_internal_6 = local_northwest_at_CellularAutomaton_internal_7 - PARAM param_northwest_at_CellularAutomaton_position_0 - lw $t1, -32($fp) - lw $t2, 0($fp) - sub $t1, $t1, $t2 - sw $t1, -28($fp) - # IF_ZERO local_northwest_at_CellularAutomaton_internal_6 GOTO label_TRUE_59 - # IF_ZERO local_northwest_at_CellularAutomaton_internal_6 GOTO label_TRUE_59 - lw $t1, -28($fp) - beq $t1, 0, label_TRUE_59 - # LOCAL local_northwest_at_CellularAutomaton_internal_6 --> -28($fp) - # local_northwest_at_CellularAutomaton_internal_6 = 0 - li $t1, 0 - sw $t1, -28($fp) - # GOTO label_END_60 -j label_END_60 -label_TRUE_59: - # LOCAL local_northwest_at_CellularAutomaton_internal_6 --> -28($fp) - # local_northwest_at_CellularAutomaton_internal_6 = 1 - li $t1, 1 - sw $t1, -28($fp) - label_END_60: -# IF_ZERO local_northwest_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_57 -# IF_ZERO local_northwest_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_57 -lw $t1, -28($fp) -beq $t1, 0, label_FALSEIF_57 -# LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_12 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -48($fp) -# LOCAL local_northwest_at_CellularAutomaton_internal_5 --> -24($fp) -# LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) -# local_northwest_at_CellularAutomaton_internal_5 = local_northwest_at_CellularAutomaton_internal_11 -lw $t1, -48($fp) -sw $t1, -24($fp) -# GOTO label_ENDIF_58 -j label_ENDIF_58 -label_FALSEIF_57: - # LOCAL local_northwest_at_CellularAutomaton_internal_14 --> -60($fp) - # local_northwest_at_CellularAutomaton_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_14 --> -60($fp) - # local_northwest_at_CellularAutomaton_internal_12 = local_northwest_at_CellularAutomaton_internal_14 - lw $t1, -60($fp) - sw $t1, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_northwest_at_CellularAutomaton_internal_15 --> -64($fp) - # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) - # local_northwest_at_CellularAutomaton_internal_15 = PARAM param_northwest_at_CellularAutomaton_position_0 - 1 - lw $t1, 0($fp) - sub $t1, $t1, 1 - sw $t1, -64($fp) - # ARG local_northwest_at_CellularAutomaton_internal_15 - # LOCAL local_northwest_at_CellularAutomaton_internal_15 --> -64($fp) - lw $t1, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_northwest_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_13 --> -56($fp) - # local_northwest_at_CellularAutomaton_internal_13 = VCALL local_northwest_at_CellularAutomaton_internal_12 north - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 52($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_northwest_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_13 --> -56($fp) - # local_northwest_at_CellularAutomaton_internal_5 = local_northwest_at_CellularAutomaton_internal_13 - lw $t1, -56($fp) - sw $t1, -24($fp) - label_ENDIF_58: -# LOCAL local_northwest_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_northwest_at_CellularAutomaton_internal_5 --> -24($fp) -# local_northwest_at_CellularAutomaton_internal_0 = local_northwest_at_CellularAutomaton_internal_5 -lw $t1, -24($fp) -sw $t1, -4($fp) -label_ENDIF_54: -# RETURN local_northwest_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_northwest_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 72 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_northeast_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_northeast_at_CellularAutomaton_position_0 -function_northeast_at_CellularAutomaton: - # Allocate stack frame for function function_northeast_at_CellularAutomaton. - subu $sp, $sp, 80 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 80 - # local_northeast_at_CellularAutomaton_internal_3 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_northeast_at_CellularAutomaton_internal_3 --> -16($fp) - lw $t1, 16($s1) - sw $t1, -16($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_2 --> -12($fp) - # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_3 --> -16($fp) - # local_northeast_at_CellularAutomaton_internal_2 = PARAM param_northeast_at_CellularAutomaton_position_0 - local_northeast_at_CellularAutomaton_internal_3 - lw $t1, 0($fp) - lw $t2, -16($fp) - sub $t1, $t1, $t2 - sw $t1, -12($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_2 --> -12($fp) - # local_northeast_at_CellularAutomaton_internal_1 = local_northeast_at_CellularAutomaton_internal_2 - 0 - lw $t1, -12($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_GREATER_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_63 - # IF_GREATER_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_63 - lw $t1, -8($fp) - bgt $t1, 0, label_FALSE_63 - # IF_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_63 - # IF_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_63 - lw $t1, -8($fp) - beq $t1, 0, label_FALSE_63 - # LOCAL local_northeast_at_CellularAutomaton_internal_1 --> -8($fp) - # local_northeast_at_CellularAutomaton_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - # GOTO label_END_64 -j label_END_64 -label_FALSE_63: - # LOCAL local_northeast_at_CellularAutomaton_internal_1 --> -8($fp) - # local_northeast_at_CellularAutomaton_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - label_END_64: -# IF_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_61 -# IF_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_61 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_61 -# LOCAL local_northeast_at_CellularAutomaton_internal_4 --> -20($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_13 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -20($fp) -# LOCAL local_northeast_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_northeast_at_CellularAutomaton_internal_4 --> -20($fp) -# local_northeast_at_CellularAutomaton_internal_0 = local_northeast_at_CellularAutomaton_internal_4 -lw $t1, -20($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_62 -j label_ENDIF_62 -label_FALSEIF_61: - # LOCAL local_northeast_at_CellularAutomaton_internal_9 --> -40($fp) - # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) - # local_northeast_at_CellularAutomaton_internal_9 = PARAM param_northeast_at_CellularAutomaton_position_0 + 1 - lw $t1, 0($fp) - add $t1, $t1, 1 - sw $t1, -40($fp) - # local_northeast_at_CellularAutomaton_internal_10 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) - lw $t1, 16($s1) - sw $t1, -44($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) - # local_northeast_at_CellularAutomaton_internal_8 = local_northeast_at_CellularAutomaton_internal_9 / local_northeast_at_CellularAutomaton_internal_10 - lw $t1, -40($fp) - lw $t2, -44($fp) - div $t1, $t1, $t2 - sw $t1, -36($fp) - # local_northeast_at_CellularAutomaton_internal_11 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) - lw $t1, 16($s1) - sw $t1, -48($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) - # local_northeast_at_CellularAutomaton_internal_7 = local_northeast_at_CellularAutomaton_internal_8 * local_northeast_at_CellularAutomaton_internal_11 - lw $t1, -36($fp) - lw $t2, -48($fp) - mul $t1, $t1, $t2 - sw $t1, -32($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_12 --> -52($fp) - # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) - # local_northeast_at_CellularAutomaton_internal_12 = PARAM param_northeast_at_CellularAutomaton_position_0 + 1 - lw $t1, 0($fp) - add $t1, $t1, 1 - sw $t1, -52($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_12 --> -52($fp) - # local_northeast_at_CellularAutomaton_internal_6 = local_northeast_at_CellularAutomaton_internal_7 - local_northeast_at_CellularAutomaton_internal_12 - lw $t1, -32($fp) - lw $t2, -52($fp) - sub $t1, $t1, $t2 - sw $t1, -28($fp) - # IF_ZERO local_northeast_at_CellularAutomaton_internal_6 GOTO label_TRUE_67 - # IF_ZERO local_northeast_at_CellularAutomaton_internal_6 GOTO label_TRUE_67 - lw $t1, -28($fp) - beq $t1, 0, label_TRUE_67 - # LOCAL local_northeast_at_CellularAutomaton_internal_6 --> -28($fp) - # local_northeast_at_CellularAutomaton_internal_6 = 0 - li $t1, 0 - sw $t1, -28($fp) - # GOTO label_END_68 -j label_END_68 -label_TRUE_67: - # LOCAL local_northeast_at_CellularAutomaton_internal_6 --> -28($fp) - # local_northeast_at_CellularAutomaton_internal_6 = 1 - li $t1, 1 - sw $t1, -28($fp) - label_END_68: -# IF_ZERO local_northeast_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_65 -# IF_ZERO local_northeast_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_65 -lw $t1, -28($fp) -beq $t1, 0, label_FALSEIF_65 -# LOCAL local_northeast_at_CellularAutomaton_internal_13 --> -56($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_14 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -56($fp) -# LOCAL local_northeast_at_CellularAutomaton_internal_5 --> -24($fp) -# LOCAL local_northeast_at_CellularAutomaton_internal_13 --> -56($fp) -# local_northeast_at_CellularAutomaton_internal_5 = local_northeast_at_CellularAutomaton_internal_13 -lw $t1, -56($fp) -sw $t1, -24($fp) -# GOTO label_ENDIF_66 -j label_ENDIF_66 -label_FALSEIF_65: - # LOCAL local_northeast_at_CellularAutomaton_internal_16 --> -68($fp) - # local_northeast_at_CellularAutomaton_internal_16 = SELF - sw $s1, -68($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_14 --> -60($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_16 --> -68($fp) - # local_northeast_at_CellularAutomaton_internal_14 = local_northeast_at_CellularAutomaton_internal_16 - lw $t1, -68($fp) - sw $t1, -60($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) - # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) - # local_northeast_at_CellularAutomaton_internal_17 = PARAM param_northeast_at_CellularAutomaton_position_0 + 1 - lw $t1, 0($fp) - add $t1, $t1, 1 - sw $t1, -72($fp) - # ARG local_northeast_at_CellularAutomaton_internal_17 - # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) - lw $t1, -72($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_northeast_at_CellularAutomaton_internal_14 --> -60($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_15 --> -64($fp) - # local_northeast_at_CellularAutomaton_internal_15 = VCALL local_northeast_at_CellularAutomaton_internal_14 north - # Save new self pointer in $s1 - lw $s1, -60($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 52($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -64($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_northeast_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_15 --> -64($fp) - # local_northeast_at_CellularAutomaton_internal_5 = local_northeast_at_CellularAutomaton_internal_15 - lw $t1, -64($fp) - sw $t1, -24($fp) - label_ENDIF_66: -# LOCAL local_northeast_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_northeast_at_CellularAutomaton_internal_5 --> -24($fp) -# local_northeast_at_CellularAutomaton_internal_0 = local_northeast_at_CellularAutomaton_internal_5 -lw $t1, -24($fp) -sw $t1, -4($fp) -label_ENDIF_62: -# RETURN local_northeast_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_northeast_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 80 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_southeast_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_southeast_at_CellularAutomaton_position_0 -function_southeast_at_CellularAutomaton: - # Allocate stack frame for function function_southeast_at_CellularAutomaton. - subu $sp, $sp, 84 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 84 - # local_southeast_at_CellularAutomaton_internal_2 = GETATTRIBUTE board_size CellularAutomaton - # LOCAL local_southeast_at_CellularAutomaton_internal_2 --> -12($fp) - lw $t1, 20($s1) - sw $t1, -12($fp) - # local_southeast_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_southeast_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t1, 16($s1) - sw $t1, -20($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_4 --> -20($fp) - # local_southeast_at_CellularAutomaton_internal_3 = PARAM param_southeast_at_CellularAutomaton_position_0 + local_southeast_at_CellularAutomaton_internal_4 - lw $t1, 0($fp) - lw $t2, -20($fp) - add $t1, $t1, $t2 - sw $t1, -16($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_3 --> -16($fp) - # local_southeast_at_CellularAutomaton_internal_1 = local_southeast_at_CellularAutomaton_internal_2 - local_southeast_at_CellularAutomaton_internal_3 - lw $t1, -12($fp) - lw $t2, -16($fp) - sub $t1, $t1, $t2 - sw $t1, -8($fp) - # IF_GREATER_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_71 - # IF_GREATER_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_71 - lw $t1, -8($fp) - bgt $t1, 0, label_FALSE_71 - # IF_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_71 - # IF_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_71 - lw $t1, -8($fp) - beq $t1, 0, label_FALSE_71 - # LOCAL local_southeast_at_CellularAutomaton_internal_1 --> -8($fp) - # local_southeast_at_CellularAutomaton_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - # GOTO label_END_72 -j label_END_72 -label_FALSE_71: - # LOCAL local_southeast_at_CellularAutomaton_internal_1 --> -8($fp) - # local_southeast_at_CellularAutomaton_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - label_END_72: -# IF_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_69 -# IF_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_69 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_69 -# LOCAL local_southeast_at_CellularAutomaton_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_15 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -24($fp) -# LOCAL local_southeast_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_southeast_at_CellularAutomaton_internal_5 --> -24($fp) -# local_southeast_at_CellularAutomaton_internal_0 = local_southeast_at_CellularAutomaton_internal_5 -lw $t1, -24($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_70 -j label_ENDIF_70 -label_FALSEIF_69: - # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) - # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) - # local_southeast_at_CellularAutomaton_internal_10 = PARAM param_southeast_at_CellularAutomaton_position_0 + 1 - lw $t1, 0($fp) - add $t1, $t1, 1 - sw $t1, -44($fp) - # local_southeast_at_CellularAutomaton_internal_11 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) - lw $t1, 16($s1) - sw $t1, -48($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) - # local_southeast_at_CellularAutomaton_internal_9 = local_southeast_at_CellularAutomaton_internal_10 / local_southeast_at_CellularAutomaton_internal_11 - lw $t1, -44($fp) - lw $t2, -48($fp) - div $t1, $t1, $t2 - sw $t1, -40($fp) - # local_southeast_at_CellularAutomaton_internal_12 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_southeast_at_CellularAutomaton_internal_12 --> -52($fp) - lw $t1, 16($s1) - sw $t1, -52($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_12 --> -52($fp) - # local_southeast_at_CellularAutomaton_internal_8 = local_southeast_at_CellularAutomaton_internal_9 * local_southeast_at_CellularAutomaton_internal_12 - lw $t1, -40($fp) - lw $t2, -52($fp) - mul $t1, $t1, $t2 - sw $t1, -36($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_13 --> -56($fp) - # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) - # local_southeast_at_CellularAutomaton_internal_13 = PARAM param_southeast_at_CellularAutomaton_position_0 + 1 - lw $t1, 0($fp) - add $t1, $t1, 1 - sw $t1, -56($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_13 --> -56($fp) - # local_southeast_at_CellularAutomaton_internal_7 = local_southeast_at_CellularAutomaton_internal_8 - local_southeast_at_CellularAutomaton_internal_13 - lw $t1, -36($fp) - lw $t2, -56($fp) - sub $t1, $t1, $t2 - sw $t1, -32($fp) - # IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_TRUE_75 - # IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_TRUE_75 - lw $t1, -32($fp) - beq $t1, 0, label_TRUE_75 - # LOCAL local_southeast_at_CellularAutomaton_internal_7 --> -32($fp) - # local_southeast_at_CellularAutomaton_internal_7 = 0 - li $t1, 0 - sw $t1, -32($fp) - # GOTO label_END_76 -j label_END_76 -label_TRUE_75: - # LOCAL local_southeast_at_CellularAutomaton_internal_7 --> -32($fp) - # local_southeast_at_CellularAutomaton_internal_7 = 1 - li $t1, 1 - sw $t1, -32($fp) - label_END_76: -# IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_73 -# IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_73 -lw $t1, -32($fp) -beq $t1, 0, label_FALSEIF_73 -# LOCAL local_southeast_at_CellularAutomaton_internal_14 --> -60($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_16 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -60($fp) -# LOCAL local_southeast_at_CellularAutomaton_internal_6 --> -28($fp) -# LOCAL local_southeast_at_CellularAutomaton_internal_14 --> -60($fp) -# local_southeast_at_CellularAutomaton_internal_6 = local_southeast_at_CellularAutomaton_internal_14 -lw $t1, -60($fp) -sw $t1, -28($fp) -# GOTO label_ENDIF_74 -j label_ENDIF_74 -label_FALSEIF_73: - # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) - # local_southeast_at_CellularAutomaton_internal_17 = SELF - sw $s1, -72($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_15 --> -64($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) - # local_southeast_at_CellularAutomaton_internal_15 = local_southeast_at_CellularAutomaton_internal_17 - lw $t1, -72($fp) - sw $t1, -64($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_southeast_at_CellularAutomaton_internal_18 --> -76($fp) - # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) - # local_southeast_at_CellularAutomaton_internal_18 = PARAM param_southeast_at_CellularAutomaton_position_0 + 1 - lw $t1, 0($fp) - add $t1, $t1, 1 - sw $t1, -76($fp) - # ARG local_southeast_at_CellularAutomaton_internal_18 - # LOCAL local_southeast_at_CellularAutomaton_internal_18 --> -76($fp) - lw $t1, -76($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_southeast_at_CellularAutomaton_internal_15 --> -64($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_16 --> -68($fp) - # local_southeast_at_CellularAutomaton_internal_16 = VCALL local_southeast_at_CellularAutomaton_internal_15 south - # Save new self pointer in $s1 - lw $s1, -64($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 56($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -68($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_southeast_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_16 --> -68($fp) - # local_southeast_at_CellularAutomaton_internal_6 = local_southeast_at_CellularAutomaton_internal_16 - lw $t1, -68($fp) - sw $t1, -28($fp) - label_ENDIF_74: -# LOCAL local_southeast_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_southeast_at_CellularAutomaton_internal_6 --> -28($fp) -# local_southeast_at_CellularAutomaton_internal_0 = local_southeast_at_CellularAutomaton_internal_6 -lw $t1, -28($fp) -sw $t1, -4($fp) -label_ENDIF_70: -# RETURN local_southeast_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_southeast_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 84 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_southwest_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_southwest_at_CellularAutomaton_position_0 -function_southwest_at_CellularAutomaton: - # Allocate stack frame for function function_southwest_at_CellularAutomaton. - subu $sp, $sp, 76 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 76 - # local_southwest_at_CellularAutomaton_internal_2 = GETATTRIBUTE board_size CellularAutomaton - # LOCAL local_southwest_at_CellularAutomaton_internal_2 --> -12($fp) - lw $t1, 20($s1) - sw $t1, -12($fp) - # local_southwest_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_southwest_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t1, 16($s1) - sw $t1, -20($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_4 --> -20($fp) - # local_southwest_at_CellularAutomaton_internal_3 = PARAM param_southwest_at_CellularAutomaton_position_0 + local_southwest_at_CellularAutomaton_internal_4 - lw $t1, 0($fp) - lw $t2, -20($fp) - add $t1, $t1, $t2 - sw $t1, -16($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_3 --> -16($fp) - # local_southwest_at_CellularAutomaton_internal_1 = local_southwest_at_CellularAutomaton_internal_2 - local_southwest_at_CellularAutomaton_internal_3 - lw $t1, -12($fp) - lw $t2, -16($fp) - sub $t1, $t1, $t2 - sw $t1, -8($fp) - # IF_GREATER_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_79 - # IF_GREATER_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_79 - lw $t1, -8($fp) - bgt $t1, 0, label_FALSE_79 - # IF_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_79 - # IF_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_79 - lw $t1, -8($fp) - beq $t1, 0, label_FALSE_79 - # LOCAL local_southwest_at_CellularAutomaton_internal_1 --> -8($fp) - # local_southwest_at_CellularAutomaton_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - # GOTO label_END_80 -j label_END_80 -label_FALSE_79: - # LOCAL local_southwest_at_CellularAutomaton_internal_1 --> -8($fp) - # local_southwest_at_CellularAutomaton_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - label_END_80: -# IF_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_77 -# IF_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_77 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_77 -# LOCAL local_southwest_at_CellularAutomaton_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_17 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -24($fp) -# LOCAL local_southwest_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_southwest_at_CellularAutomaton_internal_5 --> -24($fp) -# local_southwest_at_CellularAutomaton_internal_0 = local_southwest_at_CellularAutomaton_internal_5 -lw $t1, -24($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_78 -j label_ENDIF_78 -label_FALSEIF_77: - # local_southwest_at_CellularAutomaton_internal_10 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) - lw $t1, 16($s1) - sw $t1, -44($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_9 --> -40($fp) - # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) - # local_southwest_at_CellularAutomaton_internal_9 = PARAM param_southwest_at_CellularAutomaton_position_0 / local_southwest_at_CellularAutomaton_internal_10 - lw $t1, 0($fp) - lw $t2, -44($fp) - div $t1, $t1, $t2 - sw $t1, -40($fp) - # local_southwest_at_CellularAutomaton_internal_11 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) - lw $t1, 16($s1) - sw $t1, -48($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) - # local_southwest_at_CellularAutomaton_internal_8 = local_southwest_at_CellularAutomaton_internal_9 * local_southwest_at_CellularAutomaton_internal_11 - lw $t1, -40($fp) - lw $t2, -48($fp) - mul $t1, $t1, $t2 - sw $t1, -36($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_8 --> -36($fp) - # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) - # local_southwest_at_CellularAutomaton_internal_7 = local_southwest_at_CellularAutomaton_internal_8 - PARAM param_southwest_at_CellularAutomaton_position_0 - lw $t1, -36($fp) - lw $t2, 0($fp) - sub $t1, $t1, $t2 - sw $t1, -32($fp) - # IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_TRUE_83 - # IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_TRUE_83 - lw $t1, -32($fp) - beq $t1, 0, label_TRUE_83 - # LOCAL local_southwest_at_CellularAutomaton_internal_7 --> -32($fp) - # local_southwest_at_CellularAutomaton_internal_7 = 0 - li $t1, 0 - sw $t1, -32($fp) - # GOTO label_END_84 -j label_END_84 -label_TRUE_83: - # LOCAL local_southwest_at_CellularAutomaton_internal_7 --> -32($fp) - # local_southwest_at_CellularAutomaton_internal_7 = 1 - li $t1, 1 - sw $t1, -32($fp) - label_END_84: -# IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_81 -# IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_81 -lw $t1, -32($fp) -beq $t1, 0, label_FALSEIF_81 -# LOCAL local_southwest_at_CellularAutomaton_internal_12 --> -52($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_18 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -52($fp) -# LOCAL local_southwest_at_CellularAutomaton_internal_6 --> -28($fp) -# LOCAL local_southwest_at_CellularAutomaton_internal_12 --> -52($fp) -# local_southwest_at_CellularAutomaton_internal_6 = local_southwest_at_CellularAutomaton_internal_12 -lw $t1, -52($fp) -sw $t1, -28($fp) -# GOTO label_ENDIF_82 -j label_ENDIF_82 -label_FALSEIF_81: - # LOCAL local_southwest_at_CellularAutomaton_internal_15 --> -64($fp) - # local_southwest_at_CellularAutomaton_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_15 --> -64($fp) - # local_southwest_at_CellularAutomaton_internal_13 = local_southwest_at_CellularAutomaton_internal_15 - lw $t1, -64($fp) - sw $t1, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_southwest_at_CellularAutomaton_internal_16 --> -68($fp) - # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) - # local_southwest_at_CellularAutomaton_internal_16 = PARAM param_southwest_at_CellularAutomaton_position_0 - 1 - lw $t1, 0($fp) - sub $t1, $t1, 1 - sw $t1, -68($fp) - # ARG local_southwest_at_CellularAutomaton_internal_16 - # LOCAL local_southwest_at_CellularAutomaton_internal_16 --> -68($fp) - lw $t1, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_southwest_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_14 --> -60($fp) - # local_southwest_at_CellularAutomaton_internal_14 = VCALL local_southwest_at_CellularAutomaton_internal_13 south - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 56($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_southwest_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_14 --> -60($fp) - # local_southwest_at_CellularAutomaton_internal_6 = local_southwest_at_CellularAutomaton_internal_14 - lw $t1, -60($fp) - sw $t1, -28($fp) - label_ENDIF_82: -# LOCAL local_southwest_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_southwest_at_CellularAutomaton_internal_6 --> -28($fp) -# local_southwest_at_CellularAutomaton_internal_0 = local_southwest_at_CellularAutomaton_internal_6 -lw $t1, -28($fp) -sw $t1, -4($fp) -label_ENDIF_78: -# RETURN local_southwest_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_southwest_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 76 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_neighbors_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_neighbors_at_CellularAutomaton_position_0 -function_neighbors_at_CellularAutomaton: - # Allocate stack frame for function function_neighbors_at_CellularAutomaton. - subu $sp, $sp, 228 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 228 - # LOCAL local_neighbors_at_CellularAutomaton_internal_11 --> -48($fp) - # local_neighbors_at_CellularAutomaton_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_11 --> -48($fp) - # local_neighbors_at_CellularAutomaton_internal_9 = local_neighbors_at_CellularAutomaton_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_neighbors_at_CellularAutomaton_position_0 - # PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) - lw $t1, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) - # local_neighbors_at_CellularAutomaton_internal_10 = VCALL local_neighbors_at_CellularAutomaton_internal_9 north - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 52($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_19 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -52($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) - # local_neighbors_at_CellularAutomaton_internal_8 = local_neighbors_at_CellularAutomaton_internal_10 - local_neighbors_at_CellularAutomaton_internal_12 - lw $t1, -44($fp) - lw $t2, -52($fp) - sub $t1, $t1, $t2 - sw $t1, -36($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_8 GOTO label_TRUE_87 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_8 GOTO label_TRUE_87 - lw $t1, -36($fp) - beq $t1, 0, label_TRUE_87 - # LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) - # local_neighbors_at_CellularAutomaton_internal_8 = 0 - li $t1, 0 - sw $t1, -36($fp) - # GOTO label_END_88 -j label_END_88 -label_TRUE_87: - # LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) - # local_neighbors_at_CellularAutomaton_internal_8 = 1 - li $t1, 1 - sw $t1, -36($fp) - label_END_88: -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_8 GOTO label_FALSEIF_85 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_8 GOTO label_FALSEIF_85 -lw $t1, -36($fp) -beq $t1, 0, label_FALSEIF_85 -# LOCAL local_neighbors_at_CellularAutomaton_internal_7 --> -32($fp) -# local_neighbors_at_CellularAutomaton_internal_7 = 1 -li $t1, 1 -sw $t1, -32($fp) -# GOTO label_ENDIF_86 -j label_ENDIF_86 -label_FALSEIF_85: - # LOCAL local_neighbors_at_CellularAutomaton_internal_7 --> -32($fp) - # local_neighbors_at_CellularAutomaton_internal_7 = 0 - li $t1, 0 - sw $t1, -32($fp) - label_ENDIF_86: -# LOCAL local_neighbors_at_CellularAutomaton_internal_17 --> -72($fp) -# local_neighbors_at_CellularAutomaton_internal_17 = SELF -sw $s1, -72($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_15 --> -64($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_17 --> -72($fp) -# local_neighbors_at_CellularAutomaton_internal_15 = local_neighbors_at_CellularAutomaton_internal_17 -lw $t1, -72($fp) -sw $t1, -64($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_15 --> -64($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_16 --> -68($fp) -# local_neighbors_at_CellularAutomaton_internal_16 = VCALL local_neighbors_at_CellularAutomaton_internal_15 south -# Save new self pointer in $s1 -lw $s1, -64($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 56($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -68($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_18 --> -76($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_20 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -76($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_16 --> -68($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_18 --> -76($fp) -# local_neighbors_at_CellularAutomaton_internal_14 = local_neighbors_at_CellularAutomaton_internal_16 - local_neighbors_at_CellularAutomaton_internal_18 -lw $t1, -68($fp) -lw $t2, -76($fp) -sub $t1, $t1, $t2 -sw $t1, -60($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_TRUE_91 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_TRUE_91 -lw $t1, -60($fp) -beq $t1, 0, label_TRUE_91 -# LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) -# local_neighbors_at_CellularAutomaton_internal_14 = 0 -li $t1, 0 -sw $t1, -60($fp) -# GOTO label_END_92 -j label_END_92 -label_TRUE_91: - # LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) - # local_neighbors_at_CellularAutomaton_internal_14 = 1 - li $t1, 1 - sw $t1, -60($fp) - label_END_92: -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_FALSEIF_89 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_FALSEIF_89 -lw $t1, -60($fp) -beq $t1, 0, label_FALSEIF_89 -# LOCAL local_neighbors_at_CellularAutomaton_internal_13 --> -56($fp) -# local_neighbors_at_CellularAutomaton_internal_13 = 1 -li $t1, 1 -sw $t1, -56($fp) -# GOTO label_ENDIF_90 -j label_ENDIF_90 -label_FALSEIF_89: - # LOCAL local_neighbors_at_CellularAutomaton_internal_13 --> -56($fp) - # local_neighbors_at_CellularAutomaton_internal_13 = 0 - li $t1, 0 - sw $t1, -56($fp) - label_ENDIF_90: -# LOCAL local_neighbors_at_CellularAutomaton_internal_6 --> -28($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_7 --> -32($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_13 --> -56($fp) -# local_neighbors_at_CellularAutomaton_internal_6 = local_neighbors_at_CellularAutomaton_internal_7 + local_neighbors_at_CellularAutomaton_internal_13 -lw $t1, -32($fp) -lw $t2, -56($fp) -add $t1, $t1, $t2 -sw $t1, -28($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_23 --> -96($fp) -# local_neighbors_at_CellularAutomaton_internal_23 = SELF -sw $s1, -96($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_21 --> -88($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_23 --> -96($fp) -# local_neighbors_at_CellularAutomaton_internal_21 = local_neighbors_at_CellularAutomaton_internal_23 -lw $t1, -96($fp) -sw $t1, -88($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_21 --> -88($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) -# local_neighbors_at_CellularAutomaton_internal_22 = VCALL local_neighbors_at_CellularAutomaton_internal_21 east -# Save new self pointer in $s1 -lw $s1, -88($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 60($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -92($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_21 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -100($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) -# local_neighbors_at_CellularAutomaton_internal_20 = local_neighbors_at_CellularAutomaton_internal_22 - local_neighbors_at_CellularAutomaton_internal_24 -lw $t1, -92($fp) -lw $t2, -100($fp) -sub $t1, $t1, $t2 -sw $t1, -84($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_95 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_95 -lw $t1, -84($fp) -beq $t1, 0, label_TRUE_95 -# LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) -# local_neighbors_at_CellularAutomaton_internal_20 = 0 -li $t1, 0 -sw $t1, -84($fp) -# GOTO label_END_96 -j label_END_96 -label_TRUE_95: - # LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) - # local_neighbors_at_CellularAutomaton_internal_20 = 1 - li $t1, 1 - sw $t1, -84($fp) - label_END_96: -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_FALSEIF_93 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_FALSEIF_93 -lw $t1, -84($fp) -beq $t1, 0, label_FALSEIF_93 -# LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) -# local_neighbors_at_CellularAutomaton_internal_19 = 1 -li $t1, 1 -sw $t1, -80($fp) -# GOTO label_ENDIF_94 -j label_ENDIF_94 -label_FALSEIF_93: - # LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) - # local_neighbors_at_CellularAutomaton_internal_19 = 0 - li $t1, 0 - sw $t1, -80($fp) - label_ENDIF_94: -# LOCAL local_neighbors_at_CellularAutomaton_internal_5 --> -24($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_6 --> -28($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) -# local_neighbors_at_CellularAutomaton_internal_5 = local_neighbors_at_CellularAutomaton_internal_6 + local_neighbors_at_CellularAutomaton_internal_19 -lw $t1, -28($fp) -lw $t2, -80($fp) -add $t1, $t1, $t2 -sw $t1, -24($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_29 --> -120($fp) -# local_neighbors_at_CellularAutomaton_internal_29 = SELF -sw $s1, -120($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_27 --> -112($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_29 --> -120($fp) -# local_neighbors_at_CellularAutomaton_internal_27 = local_neighbors_at_CellularAutomaton_internal_29 -lw $t1, -120($fp) -sw $t1, -112($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_27 --> -112($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_28 --> -116($fp) -# local_neighbors_at_CellularAutomaton_internal_28 = VCALL local_neighbors_at_CellularAutomaton_internal_27 west -# Save new self pointer in $s1 -lw $s1, -112($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 64($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -116($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_22 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -124($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_26 --> -108($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_28 --> -116($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) -# local_neighbors_at_CellularAutomaton_internal_26 = local_neighbors_at_CellularAutomaton_internal_28 - local_neighbors_at_CellularAutomaton_internal_30 -lw $t1, -116($fp) -lw $t2, -124($fp) -sub $t1, $t1, $t2 -sw $t1, -108($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_26 GOTO label_TRUE_99 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_26 GOTO label_TRUE_99 -lw $t1, -108($fp) -beq $t1, 0, label_TRUE_99 -# LOCAL local_neighbors_at_CellularAutomaton_internal_26 --> -108($fp) -# local_neighbors_at_CellularAutomaton_internal_26 = 0 -li $t1, 0 -sw $t1, -108($fp) -# GOTO label_END_100 -j label_END_100 -label_TRUE_99: - # LOCAL local_neighbors_at_CellularAutomaton_internal_26 --> -108($fp) - # local_neighbors_at_CellularAutomaton_internal_26 = 1 - li $t1, 1 - sw $t1, -108($fp) - label_END_100: -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_26 GOTO label_FALSEIF_97 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_26 GOTO label_FALSEIF_97 -lw $t1, -108($fp) -beq $t1, 0, label_FALSEIF_97 -# LOCAL local_neighbors_at_CellularAutomaton_internal_25 --> -104($fp) -# local_neighbors_at_CellularAutomaton_internal_25 = 1 -li $t1, 1 -sw $t1, -104($fp) -# GOTO label_ENDIF_98 -j label_ENDIF_98 -label_FALSEIF_97: - # LOCAL local_neighbors_at_CellularAutomaton_internal_25 --> -104($fp) - # local_neighbors_at_CellularAutomaton_internal_25 = 0 - li $t1, 0 - sw $t1, -104($fp) - label_ENDIF_98: -# LOCAL local_neighbors_at_CellularAutomaton_internal_4 --> -20($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_5 --> -24($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_25 --> -104($fp) -# local_neighbors_at_CellularAutomaton_internal_4 = local_neighbors_at_CellularAutomaton_internal_5 + local_neighbors_at_CellularAutomaton_internal_25 -lw $t1, -24($fp) -lw $t2, -104($fp) -add $t1, $t1, $t2 -sw $t1, -20($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_35 --> -144($fp) -# local_neighbors_at_CellularAutomaton_internal_35 = SELF -sw $s1, -144($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_33 --> -136($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_35 --> -144($fp) -# local_neighbors_at_CellularAutomaton_internal_33 = local_neighbors_at_CellularAutomaton_internal_35 -lw $t1, -144($fp) -sw $t1, -136($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_33 --> -136($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) -# local_neighbors_at_CellularAutomaton_internal_34 = VCALL local_neighbors_at_CellularAutomaton_internal_33 northeast -# Save new self pointer in $s1 -lw $s1, -136($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 72($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -140($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_36 --> -148($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_23 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -148($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_36 --> -148($fp) -# local_neighbors_at_CellularAutomaton_internal_32 = local_neighbors_at_CellularAutomaton_internal_34 - local_neighbors_at_CellularAutomaton_internal_36 -lw $t1, -140($fp) -lw $t2, -148($fp) -sub $t1, $t1, $t2 -sw $t1, -132($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_TRUE_103 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_TRUE_103 -lw $t1, -132($fp) -beq $t1, 0, label_TRUE_103 -# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) -# local_neighbors_at_CellularAutomaton_internal_32 = 0 -li $t1, 0 -sw $t1, -132($fp) -# GOTO label_END_104 -j label_END_104 -label_TRUE_103: - # LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) - # local_neighbors_at_CellularAutomaton_internal_32 = 1 - li $t1, 1 - sw $t1, -132($fp) - label_END_104: -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_FALSEIF_101 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_FALSEIF_101 -lw $t1, -132($fp) -beq $t1, 0, label_FALSEIF_101 -# LOCAL local_neighbors_at_CellularAutomaton_internal_31 --> -128($fp) -# local_neighbors_at_CellularAutomaton_internal_31 = 1 -li $t1, 1 -sw $t1, -128($fp) -# GOTO label_ENDIF_102 -j label_ENDIF_102 -label_FALSEIF_101: - # LOCAL local_neighbors_at_CellularAutomaton_internal_31 --> -128($fp) - # local_neighbors_at_CellularAutomaton_internal_31 = 0 - li $t1, 0 - sw $t1, -128($fp) - label_ENDIF_102: -# LOCAL local_neighbors_at_CellularAutomaton_internal_3 --> -16($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_4 --> -20($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_31 --> -128($fp) -# local_neighbors_at_CellularAutomaton_internal_3 = local_neighbors_at_CellularAutomaton_internal_4 + local_neighbors_at_CellularAutomaton_internal_31 -lw $t1, -20($fp) -lw $t2, -128($fp) -add $t1, $t1, $t2 -sw $t1, -16($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_41 --> -168($fp) -# local_neighbors_at_CellularAutomaton_internal_41 = SELF -sw $s1, -168($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_39 --> -160($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_41 --> -168($fp) -# local_neighbors_at_CellularAutomaton_internal_39 = local_neighbors_at_CellularAutomaton_internal_41 -lw $t1, -168($fp) -sw $t1, -160($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_39 --> -160($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) -# local_neighbors_at_CellularAutomaton_internal_40 = VCALL local_neighbors_at_CellularAutomaton_internal_39 northwest -# Save new self pointer in $s1 -lw $s1, -160($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 68($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -164($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_24 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -172($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) -# local_neighbors_at_CellularAutomaton_internal_38 = local_neighbors_at_CellularAutomaton_internal_40 - local_neighbors_at_CellularAutomaton_internal_42 -lw $t1, -164($fp) -lw $t2, -172($fp) -sub $t1, $t1, $t2 -sw $t1, -156($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_38 GOTO label_TRUE_107 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_38 GOTO label_TRUE_107 -lw $t1, -156($fp) -beq $t1, 0, label_TRUE_107 -# LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) -# local_neighbors_at_CellularAutomaton_internal_38 = 0 -li $t1, 0 -sw $t1, -156($fp) -# GOTO label_END_108 -j label_END_108 -label_TRUE_107: - # LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) - # local_neighbors_at_CellularAutomaton_internal_38 = 1 - li $t1, 1 - sw $t1, -156($fp) - label_END_108: -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_38 GOTO label_FALSEIF_105 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_38 GOTO label_FALSEIF_105 -lw $t1, -156($fp) -beq $t1, 0, label_FALSEIF_105 -# LOCAL local_neighbors_at_CellularAutomaton_internal_37 --> -152($fp) -# local_neighbors_at_CellularAutomaton_internal_37 = 1 -li $t1, 1 -sw $t1, -152($fp) -# GOTO label_ENDIF_106 -j label_ENDIF_106 -label_FALSEIF_105: - # LOCAL local_neighbors_at_CellularAutomaton_internal_37 --> -152($fp) - # local_neighbors_at_CellularAutomaton_internal_37 = 0 - li $t1, 0 - sw $t1, -152($fp) - label_ENDIF_106: -# LOCAL local_neighbors_at_CellularAutomaton_internal_2 --> -12($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_3 --> -16($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_37 --> -152($fp) -# local_neighbors_at_CellularAutomaton_internal_2 = local_neighbors_at_CellularAutomaton_internal_3 + local_neighbors_at_CellularAutomaton_internal_37 -lw $t1, -16($fp) -lw $t2, -152($fp) -add $t1, $t1, $t2 -sw $t1, -12($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_47 --> -192($fp) -# local_neighbors_at_CellularAutomaton_internal_47 = SELF -sw $s1, -192($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_45 --> -184($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_47 --> -192($fp) -# local_neighbors_at_CellularAutomaton_internal_45 = local_neighbors_at_CellularAutomaton_internal_47 -lw $t1, -192($fp) -sw $t1, -184($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_45 --> -184($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_46 --> -188($fp) -# local_neighbors_at_CellularAutomaton_internal_46 = VCALL local_neighbors_at_CellularAutomaton_internal_45 southeast -# Save new self pointer in $s1 -lw $s1, -184($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 76($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -188($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_48 --> -196($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_25 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -196($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_46 --> -188($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_48 --> -196($fp) -# local_neighbors_at_CellularAutomaton_internal_44 = local_neighbors_at_CellularAutomaton_internal_46 - local_neighbors_at_CellularAutomaton_internal_48 -lw $t1, -188($fp) -lw $t2, -196($fp) -sub $t1, $t1, $t2 -sw $t1, -180($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_TRUE_111 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_TRUE_111 -lw $t1, -180($fp) -beq $t1, 0, label_TRUE_111 -# LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) -# local_neighbors_at_CellularAutomaton_internal_44 = 0 -li $t1, 0 -sw $t1, -180($fp) -# GOTO label_END_112 -j label_END_112 -label_TRUE_111: - # LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) - # local_neighbors_at_CellularAutomaton_internal_44 = 1 - li $t1, 1 - sw $t1, -180($fp) - label_END_112: -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_FALSEIF_109 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_FALSEIF_109 -lw $t1, -180($fp) -beq $t1, 0, label_FALSEIF_109 -# LOCAL local_neighbors_at_CellularAutomaton_internal_43 --> -176($fp) -# local_neighbors_at_CellularAutomaton_internal_43 = 1 -li $t1, 1 -sw $t1, -176($fp) -# GOTO label_ENDIF_110 -j label_ENDIF_110 -label_FALSEIF_109: - # LOCAL local_neighbors_at_CellularAutomaton_internal_43 --> -176($fp) - # local_neighbors_at_CellularAutomaton_internal_43 = 0 - li $t1, 0 - sw $t1, -176($fp) - label_ENDIF_110: -# LOCAL local_neighbors_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_2 --> -12($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_43 --> -176($fp) -# local_neighbors_at_CellularAutomaton_internal_1 = local_neighbors_at_CellularAutomaton_internal_2 + local_neighbors_at_CellularAutomaton_internal_43 -lw $t1, -12($fp) -lw $t2, -176($fp) -add $t1, $t1, $t2 -sw $t1, -8($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_53 --> -216($fp) -# local_neighbors_at_CellularAutomaton_internal_53 = SELF -sw $s1, -216($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_51 --> -208($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_53 --> -216($fp) -# local_neighbors_at_CellularAutomaton_internal_51 = local_neighbors_at_CellularAutomaton_internal_53 -lw $t1, -216($fp) -sw $t1, -208($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_51 --> -208($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) -# local_neighbors_at_CellularAutomaton_internal_52 = VCALL local_neighbors_at_CellularAutomaton_internal_51 southwest -# Save new self pointer in $s1 -lw $s1, -208($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 80($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -212($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_26 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -220($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) -# local_neighbors_at_CellularAutomaton_internal_50 = local_neighbors_at_CellularAutomaton_internal_52 - local_neighbors_at_CellularAutomaton_internal_54 -lw $t1, -212($fp) -lw $t2, -220($fp) -sub $t1, $t1, $t2 -sw $t1, -204($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_115 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_115 -lw $t1, -204($fp) -beq $t1, 0, label_TRUE_115 -# LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) -# local_neighbors_at_CellularAutomaton_internal_50 = 0 -li $t1, 0 -sw $t1, -204($fp) -# GOTO label_END_116 -j label_END_116 -label_TRUE_115: - # LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) - # local_neighbors_at_CellularAutomaton_internal_50 = 1 - li $t1, 1 - sw $t1, -204($fp) - label_END_116: -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_FALSEIF_113 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_FALSEIF_113 -lw $t1, -204($fp) -beq $t1, 0, label_FALSEIF_113 -# LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) -# local_neighbors_at_CellularAutomaton_internal_49 = 1 -li $t1, 1 -sw $t1, -200($fp) -# GOTO label_ENDIF_114 -j label_ENDIF_114 -label_FALSEIF_113: - # LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) - # local_neighbors_at_CellularAutomaton_internal_49 = 0 - li $t1, 0 - sw $t1, -200($fp) - label_ENDIF_114: -# LOCAL local_neighbors_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) -# local_neighbors_at_CellularAutomaton_internal_0 = local_neighbors_at_CellularAutomaton_internal_1 + local_neighbors_at_CellularAutomaton_internal_49 -lw $t1, -8($fp) -lw $t2, -200($fp) -add $t1, $t1, $t2 -sw $t1, -4($fp) -# RETURN local_neighbors_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_neighbors_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 228 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_cell_at_next_evolution_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_cell_at_next_evolution_at_CellularAutomaton_position_0 -function_cell_at_next_evolution_at_CellularAutomaton: - # Allocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. - subu $sp, $sp, 88 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 88 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_4 = SELF - sw $s1, -20($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_2 = local_cell_at_next_evolution_at_CellularAutomaton_internal_4 - lw $t1, -20($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 - # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) - lw $t1, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_3 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 neighbors - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 84($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = local_cell_at_next_evolution_at_CellularAutomaton_internal_3 - 3 - lw $t1, -16($fp) - sub $t1, $t1, 3 - sw $t1, -8($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_TRUE_119 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_TRUE_119 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_119 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_120 -j label_END_120 -label_TRUE_119: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_120: -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_117 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_117 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_117 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_27 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -24($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_0 = local_cell_at_next_evolution_at_CellularAutomaton_internal_5 -lw $t1, -24($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_118 -j label_ENDIF_118 -label_FALSEIF_117: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_10 = SELF - sw $s1, -44($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_8 = local_cell_at_next_evolution_at_CellularAutomaton_internal_10 - lw $t1, -44($fp) - sw $t1, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 - # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) - lw $t1, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_9 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 neighbors - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 84($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = local_cell_at_next_evolution_at_CellularAutomaton_internal_9 - 2 - lw $t1, -40($fp) - sub $t1, $t1, 2 - sw $t1, -32($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_TRUE_123 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_TRUE_123 - lw $t1, -32($fp) - beq $t1, 0, label_TRUE_123 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = 0 - li $t1, 0 - sw $t1, -32($fp) - # GOTO label_END_124 -j label_END_124 -label_TRUE_123: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = 1 - li $t1, 1 - sw $t1, -32($fp) - label_END_124: -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_121 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_121 -lw $t1, -32($fp) -beq $t1, 0, label_FALSEIF_121 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_15 = SELF -sw $s1, -64($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_13 = local_cell_at_next_evolution_at_CellularAutomaton_internal_15 -lw $t1, -64($fp) -sw $t1, -56($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 -# PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_14 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 cell -# Save new self pointer in $s1 -lw $s1, -56($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 48($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -60($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_28 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -68($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = local_cell_at_next_evolution_at_CellularAutomaton_internal_14 - local_cell_at_next_evolution_at_CellularAutomaton_internal_16 -lw $t1, -60($fp) -lw $t2, -68($fp) -sub $t1, $t1, $t2 -sw $t1, -52($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_127 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_127 -lw $t1, -52($fp) -beq $t1, 0, label_TRUE_127 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = 0 -li $t1, 0 -sw $t1, -52($fp) -# GOTO label_END_128 -j label_END_128 -label_TRUE_127: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = 1 - li $t1, 1 - sw $t1, -52($fp) - label_END_128: -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_FALSEIF_125 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_FALSEIF_125 -lw $t1, -52($fp) -beq $t1, 0, label_FALSEIF_125 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_29 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -72($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_11 = local_cell_at_next_evolution_at_CellularAutomaton_internal_17 -lw $t1, -72($fp) -sw $t1, -48($fp) -# GOTO label_ENDIF_126 -j label_ENDIF_126 -label_FALSEIF_125: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_30 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -76($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_11 = local_cell_at_next_evolution_at_CellularAutomaton_internal_18 - lw $t1, -76($fp) - sw $t1, -48($fp) - label_ENDIF_126: -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_6 = local_cell_at_next_evolution_at_CellularAutomaton_internal_11 -lw $t1, -48($fp) -sw $t1, -28($fp) -# GOTO label_ENDIF_122 -j label_ENDIF_122 -label_FALSEIF_121: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_31 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -80($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_6 = local_cell_at_next_evolution_at_CellularAutomaton_internal_19 - lw $t1, -80($fp) - sw $t1, -28($fp) - label_ENDIF_122: -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_0 = local_cell_at_next_evolution_at_CellularAutomaton_internal_6 -lw $t1, -28($fp) -sw $t1, -4($fp) -label_ENDIF_118: -# RETURN local_cell_at_next_evolution_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 88 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_evolve_at_CellularAutomaton implementation. -# @Params: -function_evolve_at_CellularAutomaton: - # Allocate stack frame for function function_evolve_at_CellularAutomaton. - subu $sp, $sp, 64 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 64 - # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) - # local_evolve_at_CellularAutomaton_position_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) - # local_evolve_at_CellularAutomaton_internal_4 = SELF - sw $s1, -20($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) - # local_evolve_at_CellularAutomaton_internal_2 = local_evolve_at_CellularAutomaton_internal_4 - lw $t1, -20($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_evolve_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) - # local_evolve_at_CellularAutomaton_internal_3 = VCALL local_evolve_at_CellularAutomaton_internal_2 num_cells - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 44($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) - # local_evolve_at_CellularAutomaton_num_1 = local_evolve_at_CellularAutomaton_internal_3 - lw $t1, -16($fp) - sw $t1, -8($fp) - # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_0 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -24($fp) - label_WHILE_129: - # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) - # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) - # local_evolve_at_CellularAutomaton_internal_6 = local_evolve_at_CellularAutomaton_position_0 - local_evolve_at_CellularAutomaton_num_1 - lw $t1, -4($fp) - lw $t2, -8($fp) - sub $t1, $t1, $t2 - sw $t1, -28($fp) - # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_131 - # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_131 - lw $t1, -28($fp) - bgt $t1, 0, label_FALSE_131 - # IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_131 - # IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_131 - lw $t1, -28($fp) - beq $t1, 0, label_FALSE_131 - # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) - # local_evolve_at_CellularAutomaton_internal_6 = 1 - li $t1, 1 - sw $t1, -28($fp) - # GOTO label_END_132 -j label_END_132 -label_FALSE_131: - # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) - # local_evolve_at_CellularAutomaton_internal_6 = 0 - li $t1, 0 - sw $t1, -28($fp) - label_END_132: -# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_130 -# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_130 -lw $t1, -28($fp) -beq $t1, 0, label_WHILE_END_130 -# LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) -# LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) -# local_evolve_at_CellularAutomaton_internal_7 = local_evolve_at_CellularAutomaton_temp_5 -lw $t1, -24($fp) -sw $t1, -32($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) -# local_evolve_at_CellularAutomaton_internal_11 = SELF -sw $s1, -48($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) -# local_evolve_at_CellularAutomaton_internal_9 = local_evolve_at_CellularAutomaton_internal_11 -lw $t1, -48($fp) -sw $t1, -40($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_evolve_at_CellularAutomaton_position_0 -# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) -lw $t1, -4($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) -# local_evolve_at_CellularAutomaton_internal_10 = VCALL local_evolve_at_CellularAutomaton_internal_9 cell_at_next_evolution -# Save new self pointer in $s1 -lw $s1, -40($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 88($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -44($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_evolve_at_CellularAutomaton_internal_10 -# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) -lw $t1, -44($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) -# local_evolve_at_CellularAutomaton_internal_8 = VCALL local_evolve_at_CellularAutomaton_internal_7 concat -# Save new self pointer in $s1 -lw $s1, -32($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 12($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -36($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) -# local_evolve_at_CellularAutomaton_temp_5 = local_evolve_at_CellularAutomaton_internal_8 -lw $t1, -36($fp) -sw $t1, -24($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) -# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) -# local_evolve_at_CellularAutomaton_internal_12 = local_evolve_at_CellularAutomaton_position_0 + 1 -lw $t1, -4($fp) -add $t1, $t1, 1 -sw $t1, -52($fp) -# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) -# local_evolve_at_CellularAutomaton_position_0 = local_evolve_at_CellularAutomaton_internal_12 -lw $t1, -52($fp) -sw $t1, -4($fp) -# GOTO label_WHILE_129 -j label_WHILE_129 -label_WHILE_END_130: - # - # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) - lw $t1, -24($fp) - sw $t1, 24($s1) - # LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) - # local_evolve_at_CellularAutomaton_internal_13 = SELF - sw $s1, -56($fp) - # RETURN local_evolve_at_CellularAutomaton_internal_13 - lw $v0, -56($fp) - # Deallocate stack frame for function function_evolve_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 64 - jr $ra - # Function END - - -# function_option_at_CellularAutomaton implementation. -# @Params: -function_option_at_CellularAutomaton: - # Allocate stack frame for function function_option_at_CellularAutomaton. - subu $sp, $sp, 664 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 664 - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_num_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_3 --> -16($fp) - # local_option_at_CellularAutomaton_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_option_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_option_at_CellularAutomaton_internal_3 --> -16($fp) - # local_option_at_CellularAutomaton_internal_1 = local_option_at_CellularAutomaton_internal_3 - lw $t1, -16($fp) - sw $t1, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_32 - sw $t1, 12($v0) - li $t1, 24 - sw $t1, 16($v0) - sw $v0, -20($fp) - # ARG local_option_at_CellularAutomaton_internal_4 - # LOCAL local_option_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t1, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_option_at_CellularAutomaton_internal_2 --> -12($fp) - # local_option_at_CellularAutomaton_internal_2 = VCALL local_option_at_CellularAutomaton_internal_1 out_string - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_7 --> -32($fp) - # local_option_at_CellularAutomaton_internal_7 = SELF - sw $s1, -32($fp) - # LOCAL local_option_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_option_at_CellularAutomaton_internal_7 --> -32($fp) - # local_option_at_CellularAutomaton_internal_5 = local_option_at_CellularAutomaton_internal_7 - lw $t1, -32($fp) - sw $t1, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_33 - sw $t1, 12($v0) - li $t1, 13 - sw $t1, 16($v0) - sw $v0, -36($fp) - # ARG local_option_at_CellularAutomaton_internal_8 - # LOCAL local_option_at_CellularAutomaton_internal_8 --> -36($fp) - lw $t1, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_option_at_CellularAutomaton_internal_6 --> -28($fp) - # local_option_at_CellularAutomaton_internal_6 = VCALL local_option_at_CellularAutomaton_internal_5 out_string - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_11 --> -48($fp) - # local_option_at_CellularAutomaton_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_option_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_option_at_CellularAutomaton_internal_11 --> -48($fp) - # local_option_at_CellularAutomaton_internal_9 = local_option_at_CellularAutomaton_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_12 --> -52($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_34 - sw $t1, 12($v0) - li $t1, 48 - sw $t1, 16($v0) - sw $v0, -52($fp) - # ARG local_option_at_CellularAutomaton_internal_12 - # LOCAL local_option_at_CellularAutomaton_internal_12 --> -52($fp) - lw $t1, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_option_at_CellularAutomaton_internal_10 --> -44($fp) - # local_option_at_CellularAutomaton_internal_10 = VCALL local_option_at_CellularAutomaton_internal_9 out_string - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_15 --> -64($fp) - # local_option_at_CellularAutomaton_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_option_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_option_at_CellularAutomaton_internal_15 --> -64($fp) - # local_option_at_CellularAutomaton_internal_13 = local_option_at_CellularAutomaton_internal_15 - lw $t1, -64($fp) - sw $t1, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_35 - sw $t1, 12($v0) - li $t1, 48 - sw $t1, 16($v0) - sw $v0, -68($fp) - # ARG local_option_at_CellularAutomaton_internal_16 - # LOCAL local_option_at_CellularAutomaton_internal_16 --> -68($fp) - lw $t1, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_option_at_CellularAutomaton_internal_14 --> -60($fp) - # local_option_at_CellularAutomaton_internal_14 = VCALL local_option_at_CellularAutomaton_internal_13 out_string - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_19 --> -80($fp) - # local_option_at_CellularAutomaton_internal_19 = SELF - sw $s1, -80($fp) - # LOCAL local_option_at_CellularAutomaton_internal_17 --> -72($fp) - # LOCAL local_option_at_CellularAutomaton_internal_19 --> -80($fp) - # local_option_at_CellularAutomaton_internal_17 = local_option_at_CellularAutomaton_internal_19 - lw $t1, -80($fp) - sw $t1, -72($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_36 - sw $t1, 12($v0) - li $t1, 10 - sw $t1, 16($v0) - sw $v0, -84($fp) - # ARG local_option_at_CellularAutomaton_internal_20 - # LOCAL local_option_at_CellularAutomaton_internal_20 --> -84($fp) - lw $t1, -84($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_17 --> -72($fp) - # LOCAL local_option_at_CellularAutomaton_internal_18 --> -76($fp) - # local_option_at_CellularAutomaton_internal_18 = VCALL local_option_at_CellularAutomaton_internal_17 out_string - # Save new self pointer in $s1 - lw $s1, -72($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -76($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_23 --> -96($fp) - # local_option_at_CellularAutomaton_internal_23 = SELF - sw $s1, -96($fp) - # LOCAL local_option_at_CellularAutomaton_internal_21 --> -88($fp) - # LOCAL local_option_at_CellularAutomaton_internal_23 --> -96($fp) - # local_option_at_CellularAutomaton_internal_21 = local_option_at_CellularAutomaton_internal_23 - lw $t1, -96($fp) - sw $t1, -88($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_24 --> -100($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_37 - sw $t1, 12($v0) - li $t1, 26 - sw $t1, 16($v0) - sw $v0, -100($fp) - # ARG local_option_at_CellularAutomaton_internal_24 - # LOCAL local_option_at_CellularAutomaton_internal_24 --> -100($fp) - lw $t1, -100($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_21 --> -88($fp) - # LOCAL local_option_at_CellularAutomaton_internal_22 --> -92($fp) - # local_option_at_CellularAutomaton_internal_22 = VCALL local_option_at_CellularAutomaton_internal_21 out_string - # Save new self pointer in $s1 - lw $s1, -88($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -92($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_27 --> -112($fp) - # local_option_at_CellularAutomaton_internal_27 = SELF - sw $s1, -112($fp) - # LOCAL local_option_at_CellularAutomaton_internal_25 --> -104($fp) - # LOCAL local_option_at_CellularAutomaton_internal_27 --> -112($fp) - # local_option_at_CellularAutomaton_internal_25 = local_option_at_CellularAutomaton_internal_27 - lw $t1, -112($fp) - sw $t1, -104($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_28 --> -116($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_38 - sw $t1, 12($v0) - li $t1, 22 - sw $t1, 16($v0) - sw $v0, -116($fp) - # ARG local_option_at_CellularAutomaton_internal_28 - # LOCAL local_option_at_CellularAutomaton_internal_28 --> -116($fp) - lw $t1, -116($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_25 --> -104($fp) - # LOCAL local_option_at_CellularAutomaton_internal_26 --> -108($fp) - # local_option_at_CellularAutomaton_internal_26 = VCALL local_option_at_CellularAutomaton_internal_25 out_string - # Save new self pointer in $s1 - lw $s1, -104($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -108($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_31 --> -128($fp) - # local_option_at_CellularAutomaton_internal_31 = SELF - sw $s1, -128($fp) - # LOCAL local_option_at_CellularAutomaton_internal_29 --> -120($fp) - # LOCAL local_option_at_CellularAutomaton_internal_31 --> -128($fp) - # local_option_at_CellularAutomaton_internal_29 = local_option_at_CellularAutomaton_internal_31 - lw $t1, -128($fp) - sw $t1, -120($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_32 --> -132($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_39 - sw $t1, 12($v0) - li $t1, 28 - sw $t1, 16($v0) - sw $v0, -132($fp) - # ARG local_option_at_CellularAutomaton_internal_32 - # LOCAL local_option_at_CellularAutomaton_internal_32 --> -132($fp) - lw $t1, -132($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_29 --> -120($fp) - # LOCAL local_option_at_CellularAutomaton_internal_30 --> -124($fp) - # local_option_at_CellularAutomaton_internal_30 = VCALL local_option_at_CellularAutomaton_internal_29 out_string - # Save new self pointer in $s1 - lw $s1, -120($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -124($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_35 --> -144($fp) - # local_option_at_CellularAutomaton_internal_35 = SELF - sw $s1, -144($fp) - # LOCAL local_option_at_CellularAutomaton_internal_33 --> -136($fp) - # LOCAL local_option_at_CellularAutomaton_internal_35 --> -144($fp) - # local_option_at_CellularAutomaton_internal_33 = local_option_at_CellularAutomaton_internal_35 - lw $t1, -144($fp) - sw $t1, -136($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_36 --> -148($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_40 - sw $t1, 12($v0) - li $t1, 25 - sw $t1, 16($v0) - sw $v0, -148($fp) - # ARG local_option_at_CellularAutomaton_internal_36 - # LOCAL local_option_at_CellularAutomaton_internal_36 --> -148($fp) - lw $t1, -148($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_33 --> -136($fp) - # LOCAL local_option_at_CellularAutomaton_internal_34 --> -140($fp) - # local_option_at_CellularAutomaton_internal_34 = VCALL local_option_at_CellularAutomaton_internal_33 out_string - # Save new self pointer in $s1 - lw $s1, -136($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -140($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_39 --> -160($fp) - # local_option_at_CellularAutomaton_internal_39 = SELF - sw $s1, -160($fp) - # LOCAL local_option_at_CellularAutomaton_internal_37 --> -152($fp) - # LOCAL local_option_at_CellularAutomaton_internal_39 --> -160($fp) - # local_option_at_CellularAutomaton_internal_37 = local_option_at_CellularAutomaton_internal_39 - lw $t1, -160($fp) - sw $t1, -152($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_40 --> -164($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_41 - sw $t1, 12($v0) - li $t1, 11 - sw $t1, 16($v0) - sw $v0, -164($fp) - # ARG local_option_at_CellularAutomaton_internal_40 - # LOCAL local_option_at_CellularAutomaton_internal_40 --> -164($fp) - lw $t1, -164($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_37 --> -152($fp) - # LOCAL local_option_at_CellularAutomaton_internal_38 --> -156($fp) - # local_option_at_CellularAutomaton_internal_38 = VCALL local_option_at_CellularAutomaton_internal_37 out_string - # Save new self pointer in $s1 - lw $s1, -152($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -156($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_43 --> -176($fp) - # local_option_at_CellularAutomaton_internal_43 = SELF - sw $s1, -176($fp) - # LOCAL local_option_at_CellularAutomaton_internal_41 --> -168($fp) - # LOCAL local_option_at_CellularAutomaton_internal_43 --> -176($fp) - # local_option_at_CellularAutomaton_internal_41 = local_option_at_CellularAutomaton_internal_43 - lw $t1, -176($fp) - sw $t1, -168($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_44 --> -180($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_42 - sw $t1, 12($v0) - li $t1, 21 - sw $t1, 16($v0) - sw $v0, -180($fp) - # ARG local_option_at_CellularAutomaton_internal_44 - # LOCAL local_option_at_CellularAutomaton_internal_44 --> -180($fp) - lw $t1, -180($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_41 --> -168($fp) - # LOCAL local_option_at_CellularAutomaton_internal_42 --> -172($fp) - # local_option_at_CellularAutomaton_internal_42 = VCALL local_option_at_CellularAutomaton_internal_41 out_string - # Save new self pointer in $s1 - lw $s1, -168($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -172($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_47 --> -192($fp) - # local_option_at_CellularAutomaton_internal_47 = SELF - sw $s1, -192($fp) - # LOCAL local_option_at_CellularAutomaton_internal_45 --> -184($fp) - # LOCAL local_option_at_CellularAutomaton_internal_47 --> -192($fp) - # local_option_at_CellularAutomaton_internal_45 = local_option_at_CellularAutomaton_internal_47 - lw $t1, -192($fp) - sw $t1, -184($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_48 --> -196($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_43 - sw $t1, 12($v0) - li $t1, 32 - sw $t1, 16($v0) - sw $v0, -196($fp) - # ARG local_option_at_CellularAutomaton_internal_48 - # LOCAL local_option_at_CellularAutomaton_internal_48 --> -196($fp) - lw $t1, -196($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_45 --> -184($fp) - # LOCAL local_option_at_CellularAutomaton_internal_46 --> -188($fp) - # local_option_at_CellularAutomaton_internal_46 = VCALL local_option_at_CellularAutomaton_internal_45 out_string - # Save new self pointer in $s1 - lw $s1, -184($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -188($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_51 --> -208($fp) - # local_option_at_CellularAutomaton_internal_51 = SELF - sw $s1, -208($fp) - # LOCAL local_option_at_CellularAutomaton_internal_49 --> -200($fp) - # LOCAL local_option_at_CellularAutomaton_internal_51 --> -208($fp) - # local_option_at_CellularAutomaton_internal_49 = local_option_at_CellularAutomaton_internal_51 - lw $t1, -208($fp) - sw $t1, -200($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_52 --> -212($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_44 - sw $t1, 12($v0) - li $t1, 18 - sw $t1, 16($v0) - sw $v0, -212($fp) - # ARG local_option_at_CellularAutomaton_internal_52 - # LOCAL local_option_at_CellularAutomaton_internal_52 --> -212($fp) - lw $t1, -212($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_49 --> -200($fp) - # LOCAL local_option_at_CellularAutomaton_internal_50 --> -204($fp) - # local_option_at_CellularAutomaton_internal_50 = VCALL local_option_at_CellularAutomaton_internal_49 out_string - # Save new self pointer in $s1 - lw $s1, -200($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -204($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_55 --> -224($fp) - # local_option_at_CellularAutomaton_internal_55 = SELF - sw $s1, -224($fp) - # LOCAL local_option_at_CellularAutomaton_internal_53 --> -216($fp) - # LOCAL local_option_at_CellularAutomaton_internal_55 --> -224($fp) - # local_option_at_CellularAutomaton_internal_53 = local_option_at_CellularAutomaton_internal_55 - lw $t1, -224($fp) - sw $t1, -216($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_56 --> -228($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_45 - sw $t1, 12($v0) - li $t1, 12 - sw $t1, 16($v0) - sw $v0, -228($fp) - # ARG local_option_at_CellularAutomaton_internal_56 - # LOCAL local_option_at_CellularAutomaton_internal_56 --> -228($fp) - lw $t1, -228($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_53 --> -216($fp) - # LOCAL local_option_at_CellularAutomaton_internal_54 --> -220($fp) - # local_option_at_CellularAutomaton_internal_54 = VCALL local_option_at_CellularAutomaton_internal_53 out_string - # Save new self pointer in $s1 - lw $s1, -216($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -220($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_59 --> -240($fp) - # local_option_at_CellularAutomaton_internal_59 = SELF - sw $s1, -240($fp) - # LOCAL local_option_at_CellularAutomaton_internal_57 --> -232($fp) - # LOCAL local_option_at_CellularAutomaton_internal_59 --> -240($fp) - # local_option_at_CellularAutomaton_internal_57 = local_option_at_CellularAutomaton_internal_59 - lw $t1, -240($fp) - sw $t1, -232($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_60 --> -244($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_46 - sw $t1, 12($v0) - li $t1, 17 - sw $t1, 16($v0) - sw $v0, -244($fp) - # ARG local_option_at_CellularAutomaton_internal_60 - # LOCAL local_option_at_CellularAutomaton_internal_60 --> -244($fp) - lw $t1, -244($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_57 --> -232($fp) - # LOCAL local_option_at_CellularAutomaton_internal_58 --> -236($fp) - # local_option_at_CellularAutomaton_internal_58 = VCALL local_option_at_CellularAutomaton_internal_57 out_string - # Save new self pointer in $s1 - lw $s1, -232($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -236($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_63 --> -256($fp) - # local_option_at_CellularAutomaton_internal_63 = SELF - sw $s1, -256($fp) - # LOCAL local_option_at_CellularAutomaton_internal_61 --> -248($fp) - # LOCAL local_option_at_CellularAutomaton_internal_63 --> -256($fp) - # local_option_at_CellularAutomaton_internal_61 = local_option_at_CellularAutomaton_internal_63 - lw $t1, -256($fp) - sw $t1, -248($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_64 --> -260($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_47 - sw $t1, 12($v0) - li $t1, 12 - sw $t1, 16($v0) - sw $v0, -260($fp) - # ARG local_option_at_CellularAutomaton_internal_64 - # LOCAL local_option_at_CellularAutomaton_internal_64 --> -260($fp) - lw $t1, -260($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_61 --> -248($fp) - # LOCAL local_option_at_CellularAutomaton_internal_62 --> -252($fp) - # local_option_at_CellularAutomaton_internal_62 = VCALL local_option_at_CellularAutomaton_internal_61 out_string - # Save new self pointer in $s1 - lw $s1, -248($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -252($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_67 --> -272($fp) - # local_option_at_CellularAutomaton_internal_67 = SELF - sw $s1, -272($fp) - # LOCAL local_option_at_CellularAutomaton_internal_65 --> -264($fp) - # LOCAL local_option_at_CellularAutomaton_internal_67 --> -272($fp) - # local_option_at_CellularAutomaton_internal_65 = local_option_at_CellularAutomaton_internal_67 - lw $t1, -272($fp) - sw $t1, -264($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_68 --> -276($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_48 - sw $t1, 12($v0) - li $t1, 13 - sw $t1, 16($v0) - sw $v0, -276($fp) - # ARG local_option_at_CellularAutomaton_internal_68 - # LOCAL local_option_at_CellularAutomaton_internal_68 --> -276($fp) - lw $t1, -276($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_65 --> -264($fp) - # LOCAL local_option_at_CellularAutomaton_internal_66 --> -268($fp) - # local_option_at_CellularAutomaton_internal_66 = VCALL local_option_at_CellularAutomaton_internal_65 out_string - # Save new self pointer in $s1 - lw $s1, -264($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -268($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_71 --> -288($fp) - # local_option_at_CellularAutomaton_internal_71 = SELF - sw $s1, -288($fp) - # LOCAL local_option_at_CellularAutomaton_internal_69 --> -280($fp) - # LOCAL local_option_at_CellularAutomaton_internal_71 --> -288($fp) - # local_option_at_CellularAutomaton_internal_69 = local_option_at_CellularAutomaton_internal_71 - lw $t1, -288($fp) - sw $t1, -280($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_72 --> -292($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_49 - sw $t1, 12($v0) - li $t1, 13 - sw $t1, 16($v0) - sw $v0, -292($fp) - # ARG local_option_at_CellularAutomaton_internal_72 - # LOCAL local_option_at_CellularAutomaton_internal_72 --> -292($fp) - lw $t1, -292($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_69 --> -280($fp) - # LOCAL local_option_at_CellularAutomaton_internal_70 --> -284($fp) - # local_option_at_CellularAutomaton_internal_70 = VCALL local_option_at_CellularAutomaton_internal_69 out_string - # Save new self pointer in $s1 - lw $s1, -280($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -284($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_75 --> -304($fp) - # local_option_at_CellularAutomaton_internal_75 = SELF - sw $s1, -304($fp) - # LOCAL local_option_at_CellularAutomaton_internal_73 --> -296($fp) - # LOCAL local_option_at_CellularAutomaton_internal_75 --> -304($fp) - # local_option_at_CellularAutomaton_internal_73 = local_option_at_CellularAutomaton_internal_75 - lw $t1, -304($fp) - sw $t1, -296($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_76 --> -308($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_50 - sw $t1, 12($v0) - li $t1, 12 - sw $t1, 16($v0) - sw $v0, -308($fp) - # ARG local_option_at_CellularAutomaton_internal_76 - # LOCAL local_option_at_CellularAutomaton_internal_76 --> -308($fp) - lw $t1, -308($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_73 --> -296($fp) - # LOCAL local_option_at_CellularAutomaton_internal_74 --> -300($fp) - # local_option_at_CellularAutomaton_internal_74 = VCALL local_option_at_CellularAutomaton_internal_73 out_string - # Save new self pointer in $s1 - lw $s1, -296($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -300($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_79 --> -320($fp) - # local_option_at_CellularAutomaton_internal_79 = SELF - sw $s1, -320($fp) - # LOCAL local_option_at_CellularAutomaton_internal_77 --> -312($fp) - # LOCAL local_option_at_CellularAutomaton_internal_79 --> -320($fp) - # local_option_at_CellularAutomaton_internal_77 = local_option_at_CellularAutomaton_internal_79 - lw $t1, -320($fp) - sw $t1, -312($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_80 --> -324($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_51 - sw $t1, 12($v0) - li $t1, 13 - sw $t1, 16($v0) - sw $v0, -324($fp) - # ARG local_option_at_CellularAutomaton_internal_80 - # LOCAL local_option_at_CellularAutomaton_internal_80 --> -324($fp) - lw $t1, -324($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_77 --> -312($fp) - # LOCAL local_option_at_CellularAutomaton_internal_78 --> -316($fp) - # local_option_at_CellularAutomaton_internal_78 = VCALL local_option_at_CellularAutomaton_internal_77 out_string - # Save new self pointer in $s1 - lw $s1, -312($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -316($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_83 --> -336($fp) - # local_option_at_CellularAutomaton_internal_83 = SELF - sw $s1, -336($fp) - # LOCAL local_option_at_CellularAutomaton_internal_81 --> -328($fp) - # LOCAL local_option_at_CellularAutomaton_internal_83 --> -336($fp) - # local_option_at_CellularAutomaton_internal_81 = local_option_at_CellularAutomaton_internal_83 - lw $t1, -336($fp) - sw $t1, -328($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_84 --> -340($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_52 - sw $t1, 12($v0) - li $t1, 13 - sw $t1, 16($v0) - sw $v0, -340($fp) - # ARG local_option_at_CellularAutomaton_internal_84 - # LOCAL local_option_at_CellularAutomaton_internal_84 --> -340($fp) - lw $t1, -340($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_81 --> -328($fp) - # LOCAL local_option_at_CellularAutomaton_internal_82 --> -332($fp) - # local_option_at_CellularAutomaton_internal_82 = VCALL local_option_at_CellularAutomaton_internal_81 out_string - # Save new self pointer in $s1 - lw $s1, -328($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -332($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_87 --> -352($fp) - # local_option_at_CellularAutomaton_internal_87 = SELF - sw $s1, -352($fp) - # LOCAL local_option_at_CellularAutomaton_internal_85 --> -344($fp) - # LOCAL local_option_at_CellularAutomaton_internal_87 --> -352($fp) - # local_option_at_CellularAutomaton_internal_85 = local_option_at_CellularAutomaton_internal_87 - lw $t1, -352($fp) - sw $t1, -344($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_88 --> -356($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_53 - sw $t1, 12($v0) - li $t1, 13 - sw $t1, 16($v0) - sw $v0, -356($fp) - # ARG local_option_at_CellularAutomaton_internal_88 - # LOCAL local_option_at_CellularAutomaton_internal_88 --> -356($fp) - lw $t1, -356($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_85 --> -344($fp) - # LOCAL local_option_at_CellularAutomaton_internal_86 --> -348($fp) - # local_option_at_CellularAutomaton_internal_86 = VCALL local_option_at_CellularAutomaton_internal_85 out_string - # Save new self pointer in $s1 - lw $s1, -344($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -348($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_91 --> -368($fp) - # local_option_at_CellularAutomaton_internal_91 = SELF - sw $s1, -368($fp) - # LOCAL local_option_at_CellularAutomaton_internal_89 --> -360($fp) - # LOCAL local_option_at_CellularAutomaton_internal_91 --> -368($fp) - # local_option_at_CellularAutomaton_internal_89 = local_option_at_CellularAutomaton_internal_91 - lw $t1, -368($fp) - sw $t1, -360($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_92 --> -372($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_54 - sw $t1, 12($v0) - li $t1, 15 - sw $t1, 16($v0) - sw $v0, -372($fp) - # ARG local_option_at_CellularAutomaton_internal_92 - # LOCAL local_option_at_CellularAutomaton_internal_92 --> -372($fp) - lw $t1, -372($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_89 --> -360($fp) - # LOCAL local_option_at_CellularAutomaton_internal_90 --> -364($fp) - # local_option_at_CellularAutomaton_internal_90 = VCALL local_option_at_CellularAutomaton_internal_89 out_string - # Save new self pointer in $s1 - lw $s1, -360($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -364($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_95 --> -384($fp) - # local_option_at_CellularAutomaton_internal_95 = SELF - sw $s1, -384($fp) - # LOCAL local_option_at_CellularAutomaton_internal_93 --> -376($fp) - # LOCAL local_option_at_CellularAutomaton_internal_95 --> -384($fp) - # local_option_at_CellularAutomaton_internal_93 = local_option_at_CellularAutomaton_internal_95 - lw $t1, -384($fp) - sw $t1, -376($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_93 --> -376($fp) - # LOCAL local_option_at_CellularAutomaton_internal_94 --> -380($fp) - # local_option_at_CellularAutomaton_internal_94 = VCALL local_option_at_CellularAutomaton_internal_93 in_int - # Save new self pointer in $s1 - lw $s1, -376($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 24($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -380($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_94 --> -380($fp) - # local_option_at_CellularAutomaton_num_0 = local_option_at_CellularAutomaton_internal_94 - lw $t1, -380($fp) - sw $t1, -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_98 --> -396($fp) - # local_option_at_CellularAutomaton_internal_98 = SELF - sw $s1, -396($fp) - # LOCAL local_option_at_CellularAutomaton_internal_96 --> -388($fp) - # LOCAL local_option_at_CellularAutomaton_internal_98 --> -396($fp) - # local_option_at_CellularAutomaton_internal_96 = local_option_at_CellularAutomaton_internal_98 - lw $t1, -396($fp) - sw $t1, -388($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_99 --> -400($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_55 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -400($fp) - # ARG local_option_at_CellularAutomaton_internal_99 - # LOCAL local_option_at_CellularAutomaton_internal_99 --> -400($fp) - lw $t1, -400($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_96 --> -388($fp) - # LOCAL local_option_at_CellularAutomaton_internal_97 --> -392($fp) - # local_option_at_CellularAutomaton_internal_97 = VCALL local_option_at_CellularAutomaton_internal_96 out_string - # Save new self pointer in $s1 - lw $s1, -388($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -392($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_101 --> -408($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_101 = local_option_at_CellularAutomaton_num_0 - 1 - lw $t1, -4($fp) - sub $t1, $t1, 1 - sw $t1, -408($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_101 GOTO label_TRUE_135 - # IF_ZERO local_option_at_CellularAutomaton_internal_101 GOTO label_TRUE_135 - lw $t1, -408($fp) - beq $t1, 0, label_TRUE_135 - # LOCAL local_option_at_CellularAutomaton_internal_101 --> -408($fp) - # local_option_at_CellularAutomaton_internal_101 = 0 - li $t1, 0 - sw $t1, -408($fp) - # GOTO label_END_136 -j label_END_136 -label_TRUE_135: - # LOCAL local_option_at_CellularAutomaton_internal_101 --> -408($fp) - # local_option_at_CellularAutomaton_internal_101 = 1 - li $t1, 1 - sw $t1, -408($fp) - label_END_136: -# IF_ZERO local_option_at_CellularAutomaton_internal_101 GOTO label_FALSEIF_133 -# IF_ZERO local_option_at_CellularAutomaton_internal_101 GOTO label_FALSEIF_133 -lw $t1, -408($fp) -beq $t1, 0, label_FALSEIF_133 -# LOCAL local_option_at_CellularAutomaton_internal_102 --> -412($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_56 -sw $t1, 12($v0) -li $t1, 20 -sw $t1, 16($v0) -sw $v0, -412($fp) -# LOCAL local_option_at_CellularAutomaton_internal_100 --> -404($fp) -# LOCAL local_option_at_CellularAutomaton_internal_102 --> -412($fp) -# local_option_at_CellularAutomaton_internal_100 = local_option_at_CellularAutomaton_internal_102 -lw $t1, -412($fp) -sw $t1, -404($fp) -# GOTO label_ENDIF_134 -j label_ENDIF_134 -label_FALSEIF_133: - # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_104 = local_option_at_CellularAutomaton_num_0 - 2 - lw $t1, -4($fp) - sub $t1, $t1, 2 - sw $t1, -420($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_TRUE_139 - # IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_TRUE_139 - lw $t1, -420($fp) - beq $t1, 0, label_TRUE_139 - # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) - # local_option_at_CellularAutomaton_internal_104 = 0 - li $t1, 0 - sw $t1, -420($fp) - # GOTO label_END_140 -j label_END_140 -label_TRUE_139: - # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) - # local_option_at_CellularAutomaton_internal_104 = 1 - li $t1, 1 - sw $t1, -420($fp) - label_END_140: -# IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_FALSEIF_137 -# IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_FALSEIF_137 -lw $t1, -420($fp) -beq $t1, 0, label_FALSEIF_137 -# LOCAL local_option_at_CellularAutomaton_internal_105 --> -424($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_57 -sw $t1, 12($v0) -li $t1, 25 -sw $t1, 16($v0) -sw $v0, -424($fp) -# LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) -# LOCAL local_option_at_CellularAutomaton_internal_105 --> -424($fp) -# local_option_at_CellularAutomaton_internal_103 = local_option_at_CellularAutomaton_internal_105 -lw $t1, -424($fp) -sw $t1, -416($fp) -# GOTO label_ENDIF_138 -j label_ENDIF_138 -label_FALSEIF_137: - # LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_107 = local_option_at_CellularAutomaton_num_0 - 3 - lw $t1, -4($fp) - sub $t1, $t1, 3 - sw $t1, -432($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_107 GOTO label_TRUE_143 - # IF_ZERO local_option_at_CellularAutomaton_internal_107 GOTO label_TRUE_143 - lw $t1, -432($fp) - beq $t1, 0, label_TRUE_143 - # LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) - # local_option_at_CellularAutomaton_internal_107 = 0 - li $t1, 0 - sw $t1, -432($fp) - # GOTO label_END_144 -j label_END_144 -label_TRUE_143: - # LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) - # local_option_at_CellularAutomaton_internal_107 = 1 - li $t1, 1 - sw $t1, -432($fp) - label_END_144: -# IF_ZERO local_option_at_CellularAutomaton_internal_107 GOTO label_FALSEIF_141 -# IF_ZERO local_option_at_CellularAutomaton_internal_107 GOTO label_FALSEIF_141 -lw $t1, -432($fp) -beq $t1, 0, label_FALSEIF_141 -# LOCAL local_option_at_CellularAutomaton_internal_108 --> -436($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_58 -sw $t1, 12($v0) -li $t1, 25 -sw $t1, 16($v0) -sw $v0, -436($fp) -# LOCAL local_option_at_CellularAutomaton_internal_106 --> -428($fp) -# LOCAL local_option_at_CellularAutomaton_internal_108 --> -436($fp) -# local_option_at_CellularAutomaton_internal_106 = local_option_at_CellularAutomaton_internal_108 -lw $t1, -436($fp) -sw $t1, -428($fp) -# GOTO label_ENDIF_142 -j label_ENDIF_142 -label_FALSEIF_141: - # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_110 = local_option_at_CellularAutomaton_num_0 - 4 - lw $t1, -4($fp) - sub $t1, $t1, 4 - sw $t1, -444($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_TRUE_147 - # IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_TRUE_147 - lw $t1, -444($fp) - beq $t1, 0, label_TRUE_147 - # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) - # local_option_at_CellularAutomaton_internal_110 = 0 - li $t1, 0 - sw $t1, -444($fp) - # GOTO label_END_148 -j label_END_148 -label_TRUE_147: - # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) - # local_option_at_CellularAutomaton_internal_110 = 1 - li $t1, 1 - sw $t1, -444($fp) - label_END_148: -# IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_FALSEIF_145 -# IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_FALSEIF_145 -lw $t1, -444($fp) -beq $t1, 0, label_FALSEIF_145 -# LOCAL local_option_at_CellularAutomaton_internal_111 --> -448($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_59 -sw $t1, 12($v0) -li $t1, 25 -sw $t1, 16($v0) -sw $v0, -448($fp) -# LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) -# LOCAL local_option_at_CellularAutomaton_internal_111 --> -448($fp) -# local_option_at_CellularAutomaton_internal_109 = local_option_at_CellularAutomaton_internal_111 -lw $t1, -448($fp) -sw $t1, -440($fp) -# GOTO label_ENDIF_146 -j label_ENDIF_146 -label_FALSEIF_145: - # LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_113 = local_option_at_CellularAutomaton_num_0 - 5 - lw $t1, -4($fp) - sub $t1, $t1, 5 - sw $t1, -456($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_113 GOTO label_TRUE_151 - # IF_ZERO local_option_at_CellularAutomaton_internal_113 GOTO label_TRUE_151 - lw $t1, -456($fp) - beq $t1, 0, label_TRUE_151 - # LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) - # local_option_at_CellularAutomaton_internal_113 = 0 - li $t1, 0 - sw $t1, -456($fp) - # GOTO label_END_152 -j label_END_152 -label_TRUE_151: - # LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) - # local_option_at_CellularAutomaton_internal_113 = 1 - li $t1, 1 - sw $t1, -456($fp) - label_END_152: -# IF_ZERO local_option_at_CellularAutomaton_internal_113 GOTO label_FALSEIF_149 -# IF_ZERO local_option_at_CellularAutomaton_internal_113 GOTO label_FALSEIF_149 -lw $t1, -456($fp) -beq $t1, 0, label_FALSEIF_149 -# LOCAL local_option_at_CellularAutomaton_internal_114 --> -460($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_60 -sw $t1, 12($v0) -li $t1, 25 -sw $t1, 16($v0) -sw $v0, -460($fp) -# LOCAL local_option_at_CellularAutomaton_internal_112 --> -452($fp) -# LOCAL local_option_at_CellularAutomaton_internal_114 --> -460($fp) -# local_option_at_CellularAutomaton_internal_112 = local_option_at_CellularAutomaton_internal_114 -lw $t1, -460($fp) -sw $t1, -452($fp) -# GOTO label_ENDIF_150 -j label_ENDIF_150 -label_FALSEIF_149: - # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_116 = local_option_at_CellularAutomaton_num_0 - 6 - lw $t1, -4($fp) - sub $t1, $t1, 6 - sw $t1, -468($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_TRUE_155 - # IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_TRUE_155 - lw $t1, -468($fp) - beq $t1, 0, label_TRUE_155 - # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) - # local_option_at_CellularAutomaton_internal_116 = 0 - li $t1, 0 - sw $t1, -468($fp) - # GOTO label_END_156 -j label_END_156 -label_TRUE_155: - # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) - # local_option_at_CellularAutomaton_internal_116 = 1 - li $t1, 1 - sw $t1, -468($fp) - label_END_156: -# IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_FALSEIF_153 -# IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_FALSEIF_153 -lw $t1, -468($fp) -beq $t1, 0, label_FALSEIF_153 -# LOCAL local_option_at_CellularAutomaton_internal_117 --> -472($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_61 -sw $t1, 12($v0) -li $t1, 25 -sw $t1, 16($v0) -sw $v0, -472($fp) -# LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) -# LOCAL local_option_at_CellularAutomaton_internal_117 --> -472($fp) -# local_option_at_CellularAutomaton_internal_115 = local_option_at_CellularAutomaton_internal_117 -lw $t1, -472($fp) -sw $t1, -464($fp) -# GOTO label_ENDIF_154 -j label_ENDIF_154 -label_FALSEIF_153: - # LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_119 = local_option_at_CellularAutomaton_num_0 - 7 - lw $t1, -4($fp) - sub $t1, $t1, 7 - sw $t1, -480($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_119 GOTO label_TRUE_159 - # IF_ZERO local_option_at_CellularAutomaton_internal_119 GOTO label_TRUE_159 - lw $t1, -480($fp) - beq $t1, 0, label_TRUE_159 - # LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) - # local_option_at_CellularAutomaton_internal_119 = 0 - li $t1, 0 - sw $t1, -480($fp) - # GOTO label_END_160 -j label_END_160 -label_TRUE_159: - # LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) - # local_option_at_CellularAutomaton_internal_119 = 1 - li $t1, 1 - sw $t1, -480($fp) - label_END_160: -# IF_ZERO local_option_at_CellularAutomaton_internal_119 GOTO label_FALSEIF_157 -# IF_ZERO local_option_at_CellularAutomaton_internal_119 GOTO label_FALSEIF_157 -lw $t1, -480($fp) -beq $t1, 0, label_FALSEIF_157 -# LOCAL local_option_at_CellularAutomaton_internal_120 --> -484($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_62 -sw $t1, 12($v0) -li $t1, 20 -sw $t1, 16($v0) -sw $v0, -484($fp) -# LOCAL local_option_at_CellularAutomaton_internal_118 --> -476($fp) -# LOCAL local_option_at_CellularAutomaton_internal_120 --> -484($fp) -# local_option_at_CellularAutomaton_internal_118 = local_option_at_CellularAutomaton_internal_120 -lw $t1, -484($fp) -sw $t1, -476($fp) -# GOTO label_ENDIF_158 -j label_ENDIF_158 -label_FALSEIF_157: - # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_122 = local_option_at_CellularAutomaton_num_0 - 8 - lw $t1, -4($fp) - sub $t1, $t1, 8 - sw $t1, -492($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_TRUE_163 - # IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_TRUE_163 - lw $t1, -492($fp) - beq $t1, 0, label_TRUE_163 - # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) - # local_option_at_CellularAutomaton_internal_122 = 0 - li $t1, 0 - sw $t1, -492($fp) - # GOTO label_END_164 -j label_END_164 -label_TRUE_163: - # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) - # local_option_at_CellularAutomaton_internal_122 = 1 - li $t1, 1 - sw $t1, -492($fp) - label_END_164: -# IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_FALSEIF_161 -# IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_FALSEIF_161 -lw $t1, -492($fp) -beq $t1, 0, label_FALSEIF_161 -# LOCAL local_option_at_CellularAutomaton_internal_123 --> -496($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_63 -sw $t1, 12($v0) -li $t1, 20 -sw $t1, 16($v0) -sw $v0, -496($fp) -# LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) -# LOCAL local_option_at_CellularAutomaton_internal_123 --> -496($fp) -# local_option_at_CellularAutomaton_internal_121 = local_option_at_CellularAutomaton_internal_123 -lw $t1, -496($fp) -sw $t1, -488($fp) -# GOTO label_ENDIF_162 -j label_ENDIF_162 -label_FALSEIF_161: - # LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_125 = local_option_at_CellularAutomaton_num_0 - 9 - lw $t1, -4($fp) - sub $t1, $t1, 9 - sw $t1, -504($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_125 GOTO label_TRUE_167 - # IF_ZERO local_option_at_CellularAutomaton_internal_125 GOTO label_TRUE_167 - lw $t1, -504($fp) - beq $t1, 0, label_TRUE_167 - # LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) - # local_option_at_CellularAutomaton_internal_125 = 0 - li $t1, 0 - sw $t1, -504($fp) - # GOTO label_END_168 -j label_END_168 -label_TRUE_167: - # LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) - # local_option_at_CellularAutomaton_internal_125 = 1 - li $t1, 1 - sw $t1, -504($fp) - label_END_168: -# IF_ZERO local_option_at_CellularAutomaton_internal_125 GOTO label_FALSEIF_165 -# IF_ZERO local_option_at_CellularAutomaton_internal_125 GOTO label_FALSEIF_165 -lw $t1, -504($fp) -beq $t1, 0, label_FALSEIF_165 -# LOCAL local_option_at_CellularAutomaton_internal_126 --> -508($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_64 -sw $t1, 12($v0) -li $t1, 15 -sw $t1, 16($v0) -sw $v0, -508($fp) -# LOCAL local_option_at_CellularAutomaton_internal_124 --> -500($fp) -# LOCAL local_option_at_CellularAutomaton_internal_126 --> -508($fp) -# local_option_at_CellularAutomaton_internal_124 = local_option_at_CellularAutomaton_internal_126 -lw $t1, -508($fp) -sw $t1, -500($fp) -# GOTO label_ENDIF_166 -j label_ENDIF_166 -label_FALSEIF_165: - # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_128 = local_option_at_CellularAutomaton_num_0 - 10 - lw $t1, -4($fp) - sub $t1, $t1, 10 - sw $t1, -516($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_TRUE_171 - # IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_TRUE_171 - lw $t1, -516($fp) - beq $t1, 0, label_TRUE_171 - # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) - # local_option_at_CellularAutomaton_internal_128 = 0 - li $t1, 0 - sw $t1, -516($fp) - # GOTO label_END_172 -j label_END_172 -label_TRUE_171: - # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) - # local_option_at_CellularAutomaton_internal_128 = 1 - li $t1, 1 - sw $t1, -516($fp) - label_END_172: -# IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_FALSEIF_169 -# IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_FALSEIF_169 -lw $t1, -516($fp) -beq $t1, 0, label_FALSEIF_169 -# LOCAL local_option_at_CellularAutomaton_internal_129 --> -520($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_65 -sw $t1, 12($v0) -li $t1, 15 -sw $t1, 16($v0) -sw $v0, -520($fp) -# LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) -# LOCAL local_option_at_CellularAutomaton_internal_129 --> -520($fp) -# local_option_at_CellularAutomaton_internal_127 = local_option_at_CellularAutomaton_internal_129 -lw $t1, -520($fp) -sw $t1, -512($fp) -# GOTO label_ENDIF_170 -j label_ENDIF_170 -label_FALSEIF_169: - # LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_131 = local_option_at_CellularAutomaton_num_0 - 11 - lw $t1, -4($fp) - sub $t1, $t1, 11 - sw $t1, -528($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_131 GOTO label_TRUE_175 - # IF_ZERO local_option_at_CellularAutomaton_internal_131 GOTO label_TRUE_175 - lw $t1, -528($fp) - beq $t1, 0, label_TRUE_175 - # LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) - # local_option_at_CellularAutomaton_internal_131 = 0 - li $t1, 0 - sw $t1, -528($fp) - # GOTO label_END_176 -j label_END_176 -label_TRUE_175: - # LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) - # local_option_at_CellularAutomaton_internal_131 = 1 - li $t1, 1 - sw $t1, -528($fp) - label_END_176: -# IF_ZERO local_option_at_CellularAutomaton_internal_131 GOTO label_FALSEIF_173 -# IF_ZERO local_option_at_CellularAutomaton_internal_131 GOTO label_FALSEIF_173 -lw $t1, -528($fp) -beq $t1, 0, label_FALSEIF_173 -# LOCAL local_option_at_CellularAutomaton_internal_132 --> -532($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_66 -sw $t1, 12($v0) -li $t1, 15 -sw $t1, 16($v0) -sw $v0, -532($fp) -# LOCAL local_option_at_CellularAutomaton_internal_130 --> -524($fp) -# LOCAL local_option_at_CellularAutomaton_internal_132 --> -532($fp) -# local_option_at_CellularAutomaton_internal_130 = local_option_at_CellularAutomaton_internal_132 -lw $t1, -532($fp) -sw $t1, -524($fp) -# GOTO label_ENDIF_174 -j label_ENDIF_174 -label_FALSEIF_173: - # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_134 = local_option_at_CellularAutomaton_num_0 - 12 - lw $t1, -4($fp) - sub $t1, $t1, 12 - sw $t1, -540($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_TRUE_179 - # IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_TRUE_179 - lw $t1, -540($fp) - beq $t1, 0, label_TRUE_179 - # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) - # local_option_at_CellularAutomaton_internal_134 = 0 - li $t1, 0 - sw $t1, -540($fp) - # GOTO label_END_180 -j label_END_180 -label_TRUE_179: - # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) - # local_option_at_CellularAutomaton_internal_134 = 1 - li $t1, 1 - sw $t1, -540($fp) - label_END_180: -# IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_FALSEIF_177 -# IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_FALSEIF_177 -lw $t1, -540($fp) -beq $t1, 0, label_FALSEIF_177 -# LOCAL local_option_at_CellularAutomaton_internal_135 --> -544($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_67 -sw $t1, 12($v0) -li $t1, 25 -sw $t1, 16($v0) -sw $v0, -544($fp) -# LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) -# LOCAL local_option_at_CellularAutomaton_internal_135 --> -544($fp) -# local_option_at_CellularAutomaton_internal_133 = local_option_at_CellularAutomaton_internal_135 -lw $t1, -544($fp) -sw $t1, -536($fp) -# GOTO label_ENDIF_178 -j label_ENDIF_178 -label_FALSEIF_177: - # LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_137 = local_option_at_CellularAutomaton_num_0 - 13 - lw $t1, -4($fp) - sub $t1, $t1, 13 - sw $t1, -552($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_137 GOTO label_TRUE_183 - # IF_ZERO local_option_at_CellularAutomaton_internal_137 GOTO label_TRUE_183 - lw $t1, -552($fp) - beq $t1, 0, label_TRUE_183 - # LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) - # local_option_at_CellularAutomaton_internal_137 = 0 - li $t1, 0 - sw $t1, -552($fp) - # GOTO label_END_184 -j label_END_184 -label_TRUE_183: - # LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) - # local_option_at_CellularAutomaton_internal_137 = 1 - li $t1, 1 - sw $t1, -552($fp) - label_END_184: -# IF_ZERO local_option_at_CellularAutomaton_internal_137 GOTO label_FALSEIF_181 -# IF_ZERO local_option_at_CellularAutomaton_internal_137 GOTO label_FALSEIF_181 -lw $t1, -552($fp) -beq $t1, 0, label_FALSEIF_181 -# LOCAL local_option_at_CellularAutomaton_internal_138 --> -556($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_68 -sw $t1, 12($v0) -li $t1, 25 -sw $t1, 16($v0) -sw $v0, -556($fp) -# LOCAL local_option_at_CellularAutomaton_internal_136 --> -548($fp) -# LOCAL local_option_at_CellularAutomaton_internal_138 --> -556($fp) -# local_option_at_CellularAutomaton_internal_136 = local_option_at_CellularAutomaton_internal_138 -lw $t1, -556($fp) -sw $t1, -548($fp) -# GOTO label_ENDIF_182 -j label_ENDIF_182 -label_FALSEIF_181: - # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_140 = local_option_at_CellularAutomaton_num_0 - 14 - lw $t1, -4($fp) - sub $t1, $t1, 14 - sw $t1, -564($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_TRUE_187 - # IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_TRUE_187 - lw $t1, -564($fp) - beq $t1, 0, label_TRUE_187 - # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) - # local_option_at_CellularAutomaton_internal_140 = 0 - li $t1, 0 - sw $t1, -564($fp) - # GOTO label_END_188 -j label_END_188 -label_TRUE_187: - # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) - # local_option_at_CellularAutomaton_internal_140 = 1 - li $t1, 1 - sw $t1, -564($fp) - label_END_188: -# IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_FALSEIF_185 -# IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_FALSEIF_185 -lw $t1, -564($fp) -beq $t1, 0, label_FALSEIF_185 -# LOCAL local_option_at_CellularAutomaton_internal_141 --> -568($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_69 -sw $t1, 12($v0) -li $t1, 25 -sw $t1, 16($v0) -sw $v0, -568($fp) -# LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) -# LOCAL local_option_at_CellularAutomaton_internal_141 --> -568($fp) -# local_option_at_CellularAutomaton_internal_139 = local_option_at_CellularAutomaton_internal_141 -lw $t1, -568($fp) -sw $t1, -560($fp) -# GOTO label_ENDIF_186 -j label_ENDIF_186 -label_FALSEIF_185: - # LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_143 = local_option_at_CellularAutomaton_num_0 - 15 - lw $t1, -4($fp) - sub $t1, $t1, 15 - sw $t1, -576($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_143 GOTO label_TRUE_191 - # IF_ZERO local_option_at_CellularAutomaton_internal_143 GOTO label_TRUE_191 - lw $t1, -576($fp) - beq $t1, 0, label_TRUE_191 - # LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) - # local_option_at_CellularAutomaton_internal_143 = 0 - li $t1, 0 - sw $t1, -576($fp) - # GOTO label_END_192 -j label_END_192 -label_TRUE_191: - # LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) - # local_option_at_CellularAutomaton_internal_143 = 1 - li $t1, 1 - sw $t1, -576($fp) - label_END_192: -# IF_ZERO local_option_at_CellularAutomaton_internal_143 GOTO label_FALSEIF_189 -# IF_ZERO local_option_at_CellularAutomaton_internal_143 GOTO label_FALSEIF_189 -lw $t1, -576($fp) -beq $t1, 0, label_FALSEIF_189 -# LOCAL local_option_at_CellularAutomaton_internal_144 --> -580($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_70 -sw $t1, 12($v0) -li $t1, 21 -sw $t1, 16($v0) -sw $v0, -580($fp) -# LOCAL local_option_at_CellularAutomaton_internal_142 --> -572($fp) -# LOCAL local_option_at_CellularAutomaton_internal_144 --> -580($fp) -# local_option_at_CellularAutomaton_internal_142 = local_option_at_CellularAutomaton_internal_144 -lw $t1, -580($fp) -sw $t1, -572($fp) -# GOTO label_ENDIF_190 -j label_ENDIF_190 -label_FALSEIF_189: - # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_146 = local_option_at_CellularAutomaton_num_0 - 16 - lw $t1, -4($fp) - sub $t1, $t1, 16 - sw $t1, -588($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_TRUE_195 - # IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_TRUE_195 - lw $t1, -588($fp) - beq $t1, 0, label_TRUE_195 - # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) - # local_option_at_CellularAutomaton_internal_146 = 0 - li $t1, 0 - sw $t1, -588($fp) - # GOTO label_END_196 -j label_END_196 -label_TRUE_195: - # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) - # local_option_at_CellularAutomaton_internal_146 = 1 - li $t1, 1 - sw $t1, -588($fp) - label_END_196: -# IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_FALSEIF_193 -# IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_FALSEIF_193 -lw $t1, -588($fp) -beq $t1, 0, label_FALSEIF_193 -# LOCAL local_option_at_CellularAutomaton_internal_147 --> -592($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_71 -sw $t1, 12($v0) -li $t1, 21 -sw $t1, 16($v0) -sw $v0, -592($fp) -# LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) -# LOCAL local_option_at_CellularAutomaton_internal_147 --> -592($fp) -# local_option_at_CellularAutomaton_internal_145 = local_option_at_CellularAutomaton_internal_147 -lw $t1, -592($fp) -sw $t1, -584($fp) -# GOTO label_ENDIF_194 -j label_ENDIF_194 -label_FALSEIF_193: - # LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_149 = local_option_at_CellularAutomaton_num_0 - 17 - lw $t1, -4($fp) - sub $t1, $t1, 17 - sw $t1, -600($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_149 GOTO label_TRUE_199 - # IF_ZERO local_option_at_CellularAutomaton_internal_149 GOTO label_TRUE_199 - lw $t1, -600($fp) - beq $t1, 0, label_TRUE_199 - # LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) - # local_option_at_CellularAutomaton_internal_149 = 0 - li $t1, 0 - sw $t1, -600($fp) - # GOTO label_END_200 -j label_END_200 -label_TRUE_199: - # LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) - # local_option_at_CellularAutomaton_internal_149 = 1 - li $t1, 1 - sw $t1, -600($fp) - label_END_200: -# IF_ZERO local_option_at_CellularAutomaton_internal_149 GOTO label_FALSEIF_197 -# IF_ZERO local_option_at_CellularAutomaton_internal_149 GOTO label_FALSEIF_197 -lw $t1, -600($fp) -beq $t1, 0, label_FALSEIF_197 -# LOCAL local_option_at_CellularAutomaton_internal_150 --> -604($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_72 -sw $t1, 12($v0) -li $t1, 28 -sw $t1, 16($v0) -sw $v0, -604($fp) -# LOCAL local_option_at_CellularAutomaton_internal_148 --> -596($fp) -# LOCAL local_option_at_CellularAutomaton_internal_150 --> -604($fp) -# local_option_at_CellularAutomaton_internal_148 = local_option_at_CellularAutomaton_internal_150 -lw $t1, -604($fp) -sw $t1, -596($fp) -# GOTO label_ENDIF_198 -j label_ENDIF_198 -label_FALSEIF_197: - # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_152 = local_option_at_CellularAutomaton_num_0 - 18 - lw $t1, -4($fp) - sub $t1, $t1, 18 - sw $t1, -612($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_TRUE_203 - # IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_TRUE_203 - lw $t1, -612($fp) - beq $t1, 0, label_TRUE_203 - # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) - # local_option_at_CellularAutomaton_internal_152 = 0 - li $t1, 0 - sw $t1, -612($fp) - # GOTO label_END_204 -j label_END_204 -label_TRUE_203: - # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) - # local_option_at_CellularAutomaton_internal_152 = 1 - li $t1, 1 - sw $t1, -612($fp) - label_END_204: -# IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_FALSEIF_201 -# IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_FALSEIF_201 -lw $t1, -612($fp) -beq $t1, 0, label_FALSEIF_201 -# LOCAL local_option_at_CellularAutomaton_internal_153 --> -616($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_73 -sw $t1, 12($v0) -li $t1, 28 -sw $t1, 16($v0) -sw $v0, -616($fp) -# LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) -# LOCAL local_option_at_CellularAutomaton_internal_153 --> -616($fp) -# local_option_at_CellularAutomaton_internal_151 = local_option_at_CellularAutomaton_internal_153 -lw $t1, -616($fp) -sw $t1, -608($fp) -# GOTO label_ENDIF_202 -j label_ENDIF_202 -label_FALSEIF_201: - # LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_155 = local_option_at_CellularAutomaton_num_0 - 19 - lw $t1, -4($fp) - sub $t1, $t1, 19 - sw $t1, -624($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_155 GOTO label_TRUE_207 - # IF_ZERO local_option_at_CellularAutomaton_internal_155 GOTO label_TRUE_207 - lw $t1, -624($fp) - beq $t1, 0, label_TRUE_207 - # LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) - # local_option_at_CellularAutomaton_internal_155 = 0 - li $t1, 0 - sw $t1, -624($fp) - # GOTO label_END_208 -j label_END_208 -label_TRUE_207: - # LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) - # local_option_at_CellularAutomaton_internal_155 = 1 - li $t1, 1 - sw $t1, -624($fp) - label_END_208: -# IF_ZERO local_option_at_CellularAutomaton_internal_155 GOTO label_FALSEIF_205 -# IF_ZERO local_option_at_CellularAutomaton_internal_155 GOTO label_FALSEIF_205 -lw $t1, -624($fp) -beq $t1, 0, label_FALSEIF_205 -# LOCAL local_option_at_CellularAutomaton_internal_156 --> -628($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_74 -sw $t1, 12($v0) -li $t1, 16 -sw $t1, 16($v0) -sw $v0, -628($fp) -# LOCAL local_option_at_CellularAutomaton_internal_154 --> -620($fp) -# LOCAL local_option_at_CellularAutomaton_internal_156 --> -628($fp) -# local_option_at_CellularAutomaton_internal_154 = local_option_at_CellularAutomaton_internal_156 -lw $t1, -628($fp) -sw $t1, -620($fp) -# GOTO label_ENDIF_206 -j label_ENDIF_206 -label_FALSEIF_205: - # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_158 = local_option_at_CellularAutomaton_num_0 - 20 - lw $t1, -4($fp) - sub $t1, $t1, 20 - sw $t1, -636($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_TRUE_211 - # IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_TRUE_211 - lw $t1, -636($fp) - beq $t1, 0, label_TRUE_211 - # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) - # local_option_at_CellularAutomaton_internal_158 = 0 - li $t1, 0 - sw $t1, -636($fp) - # GOTO label_END_212 -j label_END_212 -label_TRUE_211: - # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) - # local_option_at_CellularAutomaton_internal_158 = 1 - li $t1, 1 - sw $t1, -636($fp) - label_END_212: -# IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_FALSEIF_209 -# IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_FALSEIF_209 -lw $t1, -636($fp) -beq $t1, 0, label_FALSEIF_209 -# LOCAL local_option_at_CellularAutomaton_internal_159 --> -640($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_75 -sw $t1, 12($v0) -li $t1, 28 -sw $t1, 16($v0) -sw $v0, -640($fp) -# LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) -# LOCAL local_option_at_CellularAutomaton_internal_159 --> -640($fp) -# local_option_at_CellularAutomaton_internal_157 = local_option_at_CellularAutomaton_internal_159 -lw $t1, -640($fp) -sw $t1, -632($fp) -# GOTO label_ENDIF_210 -j label_ENDIF_210 -label_FALSEIF_209: - # LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_161 = local_option_at_CellularAutomaton_num_0 - 21 - lw $t1, -4($fp) - sub $t1, $t1, 21 - sw $t1, -648($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_161 GOTO label_TRUE_215 - # IF_ZERO local_option_at_CellularAutomaton_internal_161 GOTO label_TRUE_215 - lw $t1, -648($fp) - beq $t1, 0, label_TRUE_215 - # LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) - # local_option_at_CellularAutomaton_internal_161 = 0 - li $t1, 0 - sw $t1, -648($fp) - # GOTO label_END_216 -j label_END_216 -label_TRUE_215: - # LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) - # local_option_at_CellularAutomaton_internal_161 = 1 - li $t1, 1 - sw $t1, -648($fp) - label_END_216: -# IF_ZERO local_option_at_CellularAutomaton_internal_161 GOTO label_FALSEIF_213 -# IF_ZERO local_option_at_CellularAutomaton_internal_161 GOTO label_FALSEIF_213 -lw $t1, -648($fp) -beq $t1, 0, label_FALSEIF_213 -# LOCAL local_option_at_CellularAutomaton_internal_162 --> -652($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_76 -sw $t1, 12($v0) -li $t1, 28 -sw $t1, 16($v0) -sw $v0, -652($fp) -# LOCAL local_option_at_CellularAutomaton_internal_160 --> -644($fp) -# LOCAL local_option_at_CellularAutomaton_internal_162 --> -652($fp) -# local_option_at_CellularAutomaton_internal_160 = local_option_at_CellularAutomaton_internal_162 -lw $t1, -652($fp) -sw $t1, -644($fp) -# GOTO label_ENDIF_214 -j label_ENDIF_214 -label_FALSEIF_213: - # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_77 - sw $t1, 12($v0) - li $t1, 25 - sw $t1, 16($v0) - sw $v0, -656($fp) - # LOCAL local_option_at_CellularAutomaton_internal_160 --> -644($fp) - # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) - # local_option_at_CellularAutomaton_internal_160 = local_option_at_CellularAutomaton_internal_163 - lw $t1, -656($fp) - sw $t1, -644($fp) - label_ENDIF_214: -# LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) -# LOCAL local_option_at_CellularAutomaton_internal_160 --> -644($fp) -# local_option_at_CellularAutomaton_internal_157 = local_option_at_CellularAutomaton_internal_160 -lw $t1, -644($fp) -sw $t1, -632($fp) -label_ENDIF_210: -# LOCAL local_option_at_CellularAutomaton_internal_154 --> -620($fp) -# LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) -# local_option_at_CellularAutomaton_internal_154 = local_option_at_CellularAutomaton_internal_157 -lw $t1, -632($fp) -sw $t1, -620($fp) -label_ENDIF_206: -# LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) -# LOCAL local_option_at_CellularAutomaton_internal_154 --> -620($fp) -# local_option_at_CellularAutomaton_internal_151 = local_option_at_CellularAutomaton_internal_154 -lw $t1, -620($fp) -sw $t1, -608($fp) -label_ENDIF_202: -# LOCAL local_option_at_CellularAutomaton_internal_148 --> -596($fp) -# LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) -# local_option_at_CellularAutomaton_internal_148 = local_option_at_CellularAutomaton_internal_151 -lw $t1, -608($fp) -sw $t1, -596($fp) -label_ENDIF_198: -# LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) -# LOCAL local_option_at_CellularAutomaton_internal_148 --> -596($fp) -# local_option_at_CellularAutomaton_internal_145 = local_option_at_CellularAutomaton_internal_148 -lw $t1, -596($fp) -sw $t1, -584($fp) -label_ENDIF_194: -# LOCAL local_option_at_CellularAutomaton_internal_142 --> -572($fp) -# LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) -# local_option_at_CellularAutomaton_internal_142 = local_option_at_CellularAutomaton_internal_145 -lw $t1, -584($fp) -sw $t1, -572($fp) -label_ENDIF_190: -# LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) -# LOCAL local_option_at_CellularAutomaton_internal_142 --> -572($fp) -# local_option_at_CellularAutomaton_internal_139 = local_option_at_CellularAutomaton_internal_142 -lw $t1, -572($fp) -sw $t1, -560($fp) -label_ENDIF_186: -# LOCAL local_option_at_CellularAutomaton_internal_136 --> -548($fp) -# LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) -# local_option_at_CellularAutomaton_internal_136 = local_option_at_CellularAutomaton_internal_139 -lw $t1, -560($fp) -sw $t1, -548($fp) -label_ENDIF_182: -# LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) -# LOCAL local_option_at_CellularAutomaton_internal_136 --> -548($fp) -# local_option_at_CellularAutomaton_internal_133 = local_option_at_CellularAutomaton_internal_136 -lw $t1, -548($fp) -sw $t1, -536($fp) -label_ENDIF_178: -# LOCAL local_option_at_CellularAutomaton_internal_130 --> -524($fp) -# LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) -# local_option_at_CellularAutomaton_internal_130 = local_option_at_CellularAutomaton_internal_133 -lw $t1, -536($fp) -sw $t1, -524($fp) -label_ENDIF_174: -# LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) -# LOCAL local_option_at_CellularAutomaton_internal_130 --> -524($fp) -# local_option_at_CellularAutomaton_internal_127 = local_option_at_CellularAutomaton_internal_130 -lw $t1, -524($fp) -sw $t1, -512($fp) -label_ENDIF_170: -# LOCAL local_option_at_CellularAutomaton_internal_124 --> -500($fp) -# LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) -# local_option_at_CellularAutomaton_internal_124 = local_option_at_CellularAutomaton_internal_127 -lw $t1, -512($fp) -sw $t1, -500($fp) -label_ENDIF_166: -# LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) -# LOCAL local_option_at_CellularAutomaton_internal_124 --> -500($fp) -# local_option_at_CellularAutomaton_internal_121 = local_option_at_CellularAutomaton_internal_124 -lw $t1, -500($fp) -sw $t1, -488($fp) -label_ENDIF_162: -# LOCAL local_option_at_CellularAutomaton_internal_118 --> -476($fp) -# LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) -# local_option_at_CellularAutomaton_internal_118 = local_option_at_CellularAutomaton_internal_121 -lw $t1, -488($fp) -sw $t1, -476($fp) -label_ENDIF_158: -# LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) -# LOCAL local_option_at_CellularAutomaton_internal_118 --> -476($fp) -# local_option_at_CellularAutomaton_internal_115 = local_option_at_CellularAutomaton_internal_118 -lw $t1, -476($fp) -sw $t1, -464($fp) -label_ENDIF_154: -# LOCAL local_option_at_CellularAutomaton_internal_112 --> -452($fp) -# LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) -# local_option_at_CellularAutomaton_internal_112 = local_option_at_CellularAutomaton_internal_115 -lw $t1, -464($fp) -sw $t1, -452($fp) -label_ENDIF_150: -# LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) -# LOCAL local_option_at_CellularAutomaton_internal_112 --> -452($fp) -# local_option_at_CellularAutomaton_internal_109 = local_option_at_CellularAutomaton_internal_112 -lw $t1, -452($fp) -sw $t1, -440($fp) -label_ENDIF_146: -# LOCAL local_option_at_CellularAutomaton_internal_106 --> -428($fp) -# LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) -# local_option_at_CellularAutomaton_internal_106 = local_option_at_CellularAutomaton_internal_109 -lw $t1, -440($fp) -sw $t1, -428($fp) -label_ENDIF_142: -# LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) -# LOCAL local_option_at_CellularAutomaton_internal_106 --> -428($fp) -# local_option_at_CellularAutomaton_internal_103 = local_option_at_CellularAutomaton_internal_106 -lw $t1, -428($fp) -sw $t1, -416($fp) -label_ENDIF_138: -# LOCAL local_option_at_CellularAutomaton_internal_100 --> -404($fp) -# LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) -# local_option_at_CellularAutomaton_internal_100 = local_option_at_CellularAutomaton_internal_103 -lw $t1, -416($fp) -sw $t1, -404($fp) -label_ENDIF_134: -# RETURN local_option_at_CellularAutomaton_internal_100 -lw $v0, -404($fp) -# Deallocate stack frame for function function_option_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 664 -jr $ra -# Function END - - -# function_prompt_at_CellularAutomaton implementation. -# @Params: -function_prompt_at_CellularAutomaton: - # Allocate stack frame for function function_prompt_at_CellularAutomaton. - subu $sp, $sp, 92 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 92 - # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_0 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -4($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_3 --> -16($fp) - # local_prompt_at_CellularAutomaton_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_3 --> -16($fp) - # local_prompt_at_CellularAutomaton_internal_1 = local_prompt_at_CellularAutomaton_internal_3 - lw $t1, -16($fp) - sw $t1, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_78 - sw $t1, 12($v0) - li $t1, 54 - sw $t1, 16($v0) - sw $v0, -20($fp) - # ARG local_prompt_at_CellularAutomaton_internal_4 - # LOCAL local_prompt_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t1, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_2 --> -12($fp) - # local_prompt_at_CellularAutomaton_internal_2 = VCALL local_prompt_at_CellularAutomaton_internal_1 out_string - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt_at_CellularAutomaton_internal_7 --> -32($fp) - # local_prompt_at_CellularAutomaton_internal_7 = SELF - sw $s1, -32($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_7 --> -32($fp) - # local_prompt_at_CellularAutomaton_internal_5 = local_prompt_at_CellularAutomaton_internal_7 - lw $t1, -32($fp) - sw $t1, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_79 - sw $t1, 12($v0) - li $t1, 49 - sw $t1, 16($v0) - sw $v0, -36($fp) - # ARG local_prompt_at_CellularAutomaton_internal_8 - # LOCAL local_prompt_at_CellularAutomaton_internal_8 --> -36($fp) - lw $t1, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_6 --> -28($fp) - # local_prompt_at_CellularAutomaton_internal_6 = VCALL local_prompt_at_CellularAutomaton_internal_5 out_string - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt_at_CellularAutomaton_internal_11 --> -48($fp) - # local_prompt_at_CellularAutomaton_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_11 --> -48($fp) - # local_prompt_at_CellularAutomaton_internal_9 = local_prompt_at_CellularAutomaton_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_10 --> -44($fp) - # local_prompt_at_CellularAutomaton_internal_10 = VCALL local_prompt_at_CellularAutomaton_internal_9 in_string - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_10 --> -44($fp) - # local_prompt_at_CellularAutomaton_ans_0 = local_prompt_at_CellularAutomaton_internal_10 - lw $t1, -44($fp) - sw $t1, -4($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_14 --> -60($fp) - # local_prompt_at_CellularAutomaton_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_14 --> -60($fp) - # local_prompt_at_CellularAutomaton_internal_12 = local_prompt_at_CellularAutomaton_internal_14 - lw $t1, -60($fp) - sw $t1, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_80 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -64($fp) - # ARG local_prompt_at_CellularAutomaton_internal_15 - # LOCAL local_prompt_at_CellularAutomaton_internal_15 --> -64($fp) - lw $t1, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_13 --> -56($fp) - # local_prompt_at_CellularAutomaton_internal_13 = VCALL local_prompt_at_CellularAutomaton_internal_12 out_string - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt_at_CellularAutomaton_internal_18 --> -76($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_81 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -76($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_17 --> -72($fp) - # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_18 --> -76($fp) - # local_prompt_at_CellularAutomaton_internal_17 = local_prompt_at_CellularAutomaton_ans_0 - local_prompt_at_CellularAutomaton_internal_18 - lw $t1, -4($fp) - lw $t2, -76($fp) - sub $t1, $t1, $t2 - sw $t1, -72($fp) - # IF_ZERO local_prompt_at_CellularAutomaton_internal_17 GOTO label_TRUE_219 - # IF_ZERO local_prompt_at_CellularAutomaton_internal_17 GOTO label_TRUE_219 - lw $t1, -72($fp) - beq $t1, 0, label_TRUE_219 - # LOCAL local_prompt_at_CellularAutomaton_internal_17 --> -72($fp) - # local_prompt_at_CellularAutomaton_internal_17 = 0 - li $t1, 0 - sw $t1, -72($fp) - # GOTO label_END_220 -j label_END_220 -label_TRUE_219: - # LOCAL local_prompt_at_CellularAutomaton_internal_17 --> -72($fp) - # local_prompt_at_CellularAutomaton_internal_17 = 1 - li $t1, 1 - sw $t1, -72($fp) - label_END_220: -# IF_ZERO local_prompt_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_217 -# IF_ZERO local_prompt_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_217 -lw $t1, -72($fp) -beq $t1, 0, label_FALSEIF_217 -# LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) -# local_prompt_at_CellularAutomaton_internal_19 = 0 -li $t1, 0 -sw $t1, -80($fp) -# LOCAL local_prompt_at_CellularAutomaton_internal_16 --> -68($fp) -# LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) -# local_prompt_at_CellularAutomaton_internal_16 = local_prompt_at_CellularAutomaton_internal_19 -lw $t1, -80($fp) -sw $t1, -68($fp) -# GOTO label_ENDIF_218 -j label_ENDIF_218 -label_FALSEIF_217: - # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) - # local_prompt_at_CellularAutomaton_internal_20 = 1 - li $t1, 1 - sw $t1, -84($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_16 --> -68($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) - # local_prompt_at_CellularAutomaton_internal_16 = local_prompt_at_CellularAutomaton_internal_20 - lw $t1, -84($fp) - sw $t1, -68($fp) - label_ENDIF_218: -# RETURN local_prompt_at_CellularAutomaton_internal_16 -lw $v0, -68($fp) -# Deallocate stack frame for function function_prompt_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 92 -jr $ra -# Function END - - -# function_prompt2_at_CellularAutomaton implementation. -# @Params: -function_prompt2_at_CellularAutomaton: - # Allocate stack frame for function function_prompt2_at_CellularAutomaton. - subu $sp, $sp, 92 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 92 - # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_0 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -4($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_3 --> -16($fp) - # local_prompt2_at_CellularAutomaton_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_3 --> -16($fp) - # local_prompt2_at_CellularAutomaton_internal_1 = local_prompt2_at_CellularAutomaton_internal_3 - lw $t1, -16($fp) - sw $t1, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_82 - sw $t1, 12($v0) - li $t1, 2 - sw $t1, 16($v0) - sw $v0, -20($fp) - # ARG local_prompt2_at_CellularAutomaton_internal_4 - # LOCAL local_prompt2_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t1, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_2 --> -12($fp) - # local_prompt2_at_CellularAutomaton_internal_2 = VCALL local_prompt2_at_CellularAutomaton_internal_1 out_string - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt2_at_CellularAutomaton_internal_7 --> -32($fp) - # local_prompt2_at_CellularAutomaton_internal_7 = SELF - sw $s1, -32($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_7 --> -32($fp) - # local_prompt2_at_CellularAutomaton_internal_5 = local_prompt2_at_CellularAutomaton_internal_7 - lw $t1, -32($fp) - sw $t1, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_83 - sw $t1, 12($v0) - li $t1, 48 - sw $t1, 16($v0) - sw $v0, -36($fp) - # ARG local_prompt2_at_CellularAutomaton_internal_8 - # LOCAL local_prompt2_at_CellularAutomaton_internal_8 --> -36($fp) - lw $t1, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_6 --> -28($fp) - # local_prompt2_at_CellularAutomaton_internal_6 = VCALL local_prompt2_at_CellularAutomaton_internal_5 out_string - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt2_at_CellularAutomaton_internal_11 --> -48($fp) - # local_prompt2_at_CellularAutomaton_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_11 --> -48($fp) - # local_prompt2_at_CellularAutomaton_internal_9 = local_prompt2_at_CellularAutomaton_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_12 --> -52($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_84 - sw $t1, 12($v0) - li $t1, 49 - sw $t1, 16($v0) - sw $v0, -52($fp) - # ARG local_prompt2_at_CellularAutomaton_internal_12 - # LOCAL local_prompt2_at_CellularAutomaton_internal_12 --> -52($fp) - lw $t1, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_10 --> -44($fp) - # local_prompt2_at_CellularAutomaton_internal_10 = VCALL local_prompt2_at_CellularAutomaton_internal_9 out_string - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt2_at_CellularAutomaton_internal_15 --> -64($fp) - # local_prompt2_at_CellularAutomaton_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_15 --> -64($fp) - # local_prompt2_at_CellularAutomaton_internal_13 = local_prompt2_at_CellularAutomaton_internal_15 - lw $t1, -64($fp) - sw $t1, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_14 --> -60($fp) - # local_prompt2_at_CellularAutomaton_internal_14 = VCALL local_prompt2_at_CellularAutomaton_internal_13 in_string - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_14 --> -60($fp) - # local_prompt2_at_CellularAutomaton_ans_0 = local_prompt2_at_CellularAutomaton_internal_14 - lw $t1, -60($fp) - sw $t1, -4($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_18 --> -76($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_85 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -76($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_17 --> -72($fp) - # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_18 --> -76($fp) - # local_prompt2_at_CellularAutomaton_internal_17 = local_prompt2_at_CellularAutomaton_ans_0 - local_prompt2_at_CellularAutomaton_internal_18 - lw $t1, -4($fp) - lw $t2, -76($fp) - sub $t1, $t1, $t2 - sw $t1, -72($fp) - # IF_ZERO local_prompt2_at_CellularAutomaton_internal_17 GOTO label_TRUE_223 - # IF_ZERO local_prompt2_at_CellularAutomaton_internal_17 GOTO label_TRUE_223 - lw $t1, -72($fp) - beq $t1, 0, label_TRUE_223 - # LOCAL local_prompt2_at_CellularAutomaton_internal_17 --> -72($fp) - # local_prompt2_at_CellularAutomaton_internal_17 = 0 - li $t1, 0 - sw $t1, -72($fp) - # GOTO label_END_224 -j label_END_224 -label_TRUE_223: - # LOCAL local_prompt2_at_CellularAutomaton_internal_17 --> -72($fp) - # local_prompt2_at_CellularAutomaton_internal_17 = 1 - li $t1, 1 - sw $t1, -72($fp) - label_END_224: -# IF_ZERO local_prompt2_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_221 -# IF_ZERO local_prompt2_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_221 -lw $t1, -72($fp) -beq $t1, 0, label_FALSEIF_221 -# LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) -# local_prompt2_at_CellularAutomaton_internal_19 = 1 -li $t1, 1 -sw $t1, -80($fp) -# LOCAL local_prompt2_at_CellularAutomaton_internal_16 --> -68($fp) -# LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) -# local_prompt2_at_CellularAutomaton_internal_16 = local_prompt2_at_CellularAutomaton_internal_19 -lw $t1, -80($fp) -sw $t1, -68($fp) -# GOTO label_ENDIF_222 -j label_ENDIF_222 -label_FALSEIF_221: - # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) - # local_prompt2_at_CellularAutomaton_internal_20 = 0 - li $t1, 0 - sw $t1, -84($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_16 --> -68($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) - # local_prompt2_at_CellularAutomaton_internal_16 = local_prompt2_at_CellularAutomaton_internal_20 - lw $t1, -84($fp) - sw $t1, -68($fp) - label_ENDIF_222: -# RETURN local_prompt2_at_CellularAutomaton_internal_16 -lw $v0, -68($fp) -# Deallocate stack frame for function function_prompt2_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 92 -jr $ra -# Function END - - -# __Main__attrib__cells__init implementation. -# @Params: -__Main__attrib__cells__init: - # Allocate stack frame for function __Main__attrib__cells__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Main__attrib__cells__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 148 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 148 - # LOCAL local_main_at_Main_continue_0 --> -4($fp) - # local_main_at_Main_continue_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # LOCAL local_main_at_Main_choice_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_0 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -8($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = SELF - sw $s1, -20($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 - lw $t1, -20($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_86 - sw $t1, 12($v0) - li $t1, 29 - sw $t1, 16($v0) - sw $v0, -24($fp) - # ARG local_main_at_Main_internal_5 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - lw $t1, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = SELF - sw $s1, -36($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_87 - sw $t1, 12($v0) - li $t1, 47 - sw $t1, 16($v0) - sw $v0, -40($fp) - # ARG local_main_at_Main_internal_9 - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - lw $t1, -40($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_string - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - label_WHILE_225: - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_12 = SELF - sw $s1, -52($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 - lw $t1, -52($fp) - sw $t1, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 prompt2 - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 104($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # IF_ZERO local_main_at_Main_internal_11 GOTO label_WHILE_END_226 - # IF_ZERO local_main_at_Main_internal_11 GOTO label_WHILE_END_226 - lw $t1, -48($fp) - beq $t1, 0, label_WHILE_END_226 - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_13 = 1 - li $t1, 1 - sw $t1, -56($fp) - # LOCAL local_main_at_Main_continue_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_continue_0 = local_main_at_Main_internal_13 - lw $t1, -56($fp) - sw $t1, -4($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_16 = SELF - sw $s1, -68($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_14 = local_main_at_Main_internal_16 - lw $t1, -68($fp) - sw $t1, -60($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 option - # Save new self pointer in $s1 - lw $s1, -60($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 96($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -64($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_choice_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_choice_1 = local_main_at_Main_internal_15 - lw $t1, -64($fp) - sw $t1, -8($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_19 = ALLOCATE CellularAutomaton - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, CellularAutomaton - sw $t3, 12($v0) - li $t3, 17 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 28 bytes of memory - li $a0, 28 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, CellularAutomaton_start - sw $t3, 4($v0) - # Load type offset - li $t3, 20 - sw $t3, 8($v0) - move $t2, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Board__attrib__rows__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t2) - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Board__attrib__columns__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t2) - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Board__attrib__board_size__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t2) - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __CellularAutomaton__attrib__population_map__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t2) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t2, -80($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_17 = local_main_at_Main_internal_19 - lw $t2, -80($fp) - sw $t2, -72($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_main_at_Main_choice_1 - # LOCAL local_main_at_Main_choice_1 --> -8($fp) - lw $t2, -8($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_18 = VCALL local_main_at_Main_internal_17 init - # Save new self pointer in $s1 - lw $s1, -72($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 36($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -76($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - lw $t2, -76($fp) - sw $t2, 28($s1) - # local_main_at_Main_internal_22 = GETATTRIBUTE cells Main - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - lw $t2, 28($s1) - sw $t2, -92($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - # local_main_at_Main_internal_20 = local_main_at_Main_internal_22 - lw $t2, -92($fp) - sw $t2, -84($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # local_main_at_Main_internal_21 = VCALL local_main_at_Main_internal_20 print - # Save new self pointer in $s1 - lw $s1, -84($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 40($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -88($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - label_WHILE_227: - # IF_ZERO local_main_at_Main_continue_0 GOTO label_WHILE_END_228 - # IF_ZERO local_main_at_Main_continue_0 GOTO label_WHILE_END_228 - lw $t2, -4($fp) - beq $t2, 0, label_WHILE_END_228 - # LOCAL local_main_at_Main_internal_26 --> -108($fp) - # local_main_at_Main_internal_26 = SELF - sw $s1, -108($fp) - # LOCAL local_main_at_Main_internal_24 --> -100($fp) - # LOCAL local_main_at_Main_internal_26 --> -108($fp) - # local_main_at_Main_internal_24 = local_main_at_Main_internal_26 - lw $t2, -108($fp) - sw $t2, -100($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_24 --> -100($fp) - # LOCAL local_main_at_Main_internal_25 --> -104($fp) - # local_main_at_Main_internal_25 = VCALL local_main_at_Main_internal_24 prompt - # Save new self pointer in $s1 - lw $s1, -100($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 100($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -104($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # IF_ZERO local_main_at_Main_internal_25 GOTO label_FALSEIF_229 - # IF_ZERO local_main_at_Main_internal_25 GOTO label_FALSEIF_229 - lw $t2, -104($fp) - beq $t2, 0, label_FALSEIF_229 - # local_main_at_Main_internal_29 = GETATTRIBUTE cells Main - # LOCAL local_main_at_Main_internal_29 --> -120($fp) - lw $t2, 28($s1) - sw $t2, -120($fp) - # LOCAL local_main_at_Main_internal_27 --> -112($fp) - # LOCAL local_main_at_Main_internal_29 --> -120($fp) - # local_main_at_Main_internal_27 = local_main_at_Main_internal_29 - lw $t2, -120($fp) - sw $t2, -112($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_27 --> -112($fp) - # LOCAL local_main_at_Main_internal_28 --> -116($fp) - # local_main_at_Main_internal_28 = VCALL local_main_at_Main_internal_27 evolve - # Save new self pointer in $s1 - lw $s1, -112($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 92($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -116($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_main_at_Main_internal_32 = GETATTRIBUTE cells Main - # LOCAL local_main_at_Main_internal_32 --> -132($fp) - lw $t2, 28($s1) - sw $t2, -132($fp) - # LOCAL local_main_at_Main_internal_30 --> -124($fp) - # LOCAL local_main_at_Main_internal_32 --> -132($fp) - # local_main_at_Main_internal_30 = local_main_at_Main_internal_32 - lw $t2, -132($fp) - sw $t2, -124($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_30 --> -124($fp) - # LOCAL local_main_at_Main_internal_31 --> -128($fp) - # local_main_at_Main_internal_31 = VCALL local_main_at_Main_internal_30 print - # Save new self pointer in $s1 - lw $s1, -124($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 40($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -128($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_23 --> -96($fp) - # LOCAL local_main_at_Main_internal_31 --> -128($fp) - # local_main_at_Main_internal_23 = local_main_at_Main_internal_31 - lw $t2, -128($fp) - sw $t2, -96($fp) - # GOTO label_ENDIF_230 -j label_ENDIF_230 -label_FALSEIF_229: - # LOCAL local_main_at_Main_internal_33 --> -136($fp) - # local_main_at_Main_internal_33 = 0 - li $t2, 0 - sw $t2, -136($fp) - # LOCAL local_main_at_Main_continue_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_33 --> -136($fp) - # local_main_at_Main_continue_0 = local_main_at_Main_internal_33 - lw $t2, -136($fp) - sw $t2, -4($fp) - # LOCAL local_main_at_Main_internal_23 --> -96($fp) - # local_main_at_Main_internal_23 = - label_ENDIF_230: -# GOTO label_WHILE_227 -j label_WHILE_227 -label_WHILE_END_228: - # GOTO label_WHILE_225 - j label_WHILE_225 - label_WHILE_END_226: - # LOCAL local_main_at_Main_internal_34 --> -140($fp) - # local_main_at_Main_internal_34 = SELF - sw $s1, -140($fp) - # RETURN local_main_at_Main_internal_34 - lw $v0, -140($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 148 - jr $ra - # Function END - diff --git a/tests/codegen/list.mips b/tests/codegen/list.mips deleted file mode 100644 index 80d3fb8c..00000000 --- a/tests/codegen/list.mips +++ /dev/null @@ -1,1655 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:19 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -List: .asciiz "List" -# Function END -Cons: .asciiz "Cons" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type List **** -List_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_isNil_at_List, function_head_at_List, function_tail_at_List, function_cons_at_List -# Function END -# - - -# **** Type RECORD for type List **** -List_start: - List_vtable_pointer: .word List_vtable - # Function END -List_end: -# - - -# **** VTABLE for type Cons **** -Cons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_isNil_at_Cons, function_head_at_Cons, function_tail_at_Cons, function_cons_at_List, function_init_at_Cons -# Function END -# - - -# **** Type RECORD for type Cons **** -Cons_start: - Cons_vtable_pointer: .word Cons_vtable - # Function END -Cons_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_print_list_at_Main, function_main_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 2, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 -List__TDT: .word -1, -1, -1, -1, 0, 1, -1 -Cons__TDT: .word -1, -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, -1, 0 -# - - -data_2: .asciiz "\n" -# - - -data_3: .asciiz " " -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - li $a0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) - # Load type offset - li $t2, 24 - sw $t2, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__mylist__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t1, Main_vtable - # Get pointer to function address - lw $t2, 32($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_List implementation. -# @Params: -function_isNil_at_List: - # Allocate stack frame for function function_isNil_at_List. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_List_internal_0 --> -4($fp) - # local_isNil_at_List_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - # RETURN local_isNil_at_List_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_isNil_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_head_at_List implementation. -# @Params: -function_head_at_List: - # Allocate stack frame for function function_head_at_List. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_head_at_List_internal_2 --> -12($fp) - # local_head_at_List_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_head_at_List_internal_0 --> -4($fp) - # LOCAL local_head_at_List_internal_2 --> -12($fp) - # local_head_at_List_internal_0 = local_head_at_List_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_head_at_List_internal_0 --> -4($fp) - # LOCAL local_head_at_List_internal_1 --> -8($fp) - # local_head_at_List_internal_1 = VCALL local_head_at_List_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function function_head_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_tail_at_List implementation. -# @Params: -function_tail_at_List: - # Allocate stack frame for function function_tail_at_List. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_tail_at_List_internal_2 --> -12($fp) - # local_tail_at_List_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_tail_at_List_internal_0 --> -4($fp) - # LOCAL local_tail_at_List_internal_2 --> -12($fp) - # local_tail_at_List_internal_0 = local_tail_at_List_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_tail_at_List_internal_0 --> -4($fp) - # LOCAL local_tail_at_List_internal_1 --> -8($fp) - # local_tail_at_List_internal_1 = VCALL local_tail_at_List_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_tail_at_List_internal_3 --> -16($fp) - # local_tail_at_List_internal_3 = SELF - sw $s1, -16($fp) - # RETURN local_tail_at_List_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_tail_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cons_at_List implementation. -# @Params: -# 0($fp) = param_cons_at_List_i_0 -function_cons_at_List: - # Allocate stack frame for function function_cons_at_List. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_cons_at_List_internal_2 --> -12($fp) - # local_cons_at_List_internal_2 = ALLOCATE Cons - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Cons - sw $t3, 12($v0) - li $t3, 4 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Cons_start - sw $t3, 4($v0) - # Load type offset - li $t3, 20 - sw $t3, 8($v0) - move $t2, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Cons__attrib__car__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t2) - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Cons__attrib__cdr__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t2) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t2, -12($fp) - # LOCAL local_cons_at_List_internal_0 --> -4($fp) - # LOCAL local_cons_at_List_internal_2 --> -12($fp) - # local_cons_at_List_internal_0 = local_cons_at_List_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cons_at_List_i_0 - # PARAM param_cons_at_List_i_0 --> 0($fp) - lw $t2, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_cons_at_List_internal_3 --> -16($fp) - # local_cons_at_List_internal_3 = SELF - sw $s1, -16($fp) - # ARG local_cons_at_List_internal_3 - # LOCAL local_cons_at_List_internal_3 --> -16($fp) - lw $t2, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_cons_at_List_internal_0 --> -4($fp) - # LOCAL local_cons_at_List_internal_1 --> -8($fp) - # local_cons_at_List_internal_1 = VCALL local_cons_at_List_internal_0 init - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 28($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_cons_at_List_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_cons_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# __Cons__attrib__car__init implementation. -# @Params: -__Cons__attrib__car__init: - # Allocate stack frame for function __Cons__attrib__car__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Cons__attrib__car__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Cons__attrib__cdr__init implementation. -# @Params: -__Cons__attrib__cdr__init: - # Allocate stack frame for function __Cons__attrib__cdr__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Cons__attrib__cdr__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_Cons implementation. -# @Params: -function_isNil_at_Cons: - # Allocate stack frame for function function_isNil_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_Cons_internal_0 --> -4($fp) - # local_isNil_at_Cons_internal_0 = 0 - li $t2, 0 - sw $t2, -4($fp) - # RETURN local_isNil_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_isNil_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_head_at_Cons implementation. -# @Params: -function_head_at_Cons: - # Allocate stack frame for function function_head_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_head_at_Cons_internal_0 = GETATTRIBUTE car Cons - # LOCAL local_head_at_Cons_internal_0 --> -4($fp) - lw $t2, 12($s1) - sw $t2, -4($fp) - # RETURN local_head_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_head_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_tail_at_Cons implementation. -# @Params: -function_tail_at_Cons: - # Allocate stack frame for function function_tail_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_tail_at_Cons_internal_0 = GETATTRIBUTE cdr Cons - # LOCAL local_tail_at_Cons_internal_0 --> -4($fp) - lw $t2, 16($s1) - sw $t2, -4($fp) - # RETURN local_tail_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_tail_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_Cons implementation. -# @Params: -# 0($fp) = param_init_at_Cons_i_0 -# 4($fp) = param_init_at_Cons_rest_1 -function_init_at_Cons: - # Allocate stack frame for function function_init_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_Cons_i_0 --> 4($fp) - lw $t2, 4($fp) - sw $t2, 12($s1) - # - # PARAM param_init_at_Cons_rest_1 --> 0($fp) - lw $t2, 0($fp) - sw $t2, 16($s1) - # LOCAL local_init_at_Cons_internal_0 --> -4($fp) - # local_init_at_Cons_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_init_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_init_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# __Main__attrib__mylist__init implementation. -# @Params: -__Main__attrib__mylist__init: - # Allocate stack frame for function __Main__attrib__mylist__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Main__attrib__mylist__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_print_list_at_Main implementation. -# @Params: -# 0($fp) = param_print_list_at_Main_l_0 -function_print_list_at_Main: - # Allocate stack frame for function function_print_list_at_Main. - subu $sp, $sp, 92 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 92 - # LOCAL local_print_list_at_Main_internal_1 --> -8($fp) - # PARAM param_print_list_at_Main_l_0 --> 0($fp) - # local_print_list_at_Main_internal_1 = PARAM param_print_list_at_Main_l_0 - lw $t2, 0($fp) - sw $t2, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_1 --> -8($fp) - # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) - # local_print_list_at_Main_internal_2 = VCALL local_print_list_at_Main_internal_1 isNil - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 12($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # IF_ZERO local_print_list_at_Main_internal_2 GOTO label_FALSEIF_1 - # IF_ZERO local_print_list_at_Main_internal_2 GOTO label_FALSEIF_1 - lw $t2, -12($fp) - beq $t2, 0, label_FALSEIF_1 - # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) - # local_print_list_at_Main_internal_5 = SELF - sw $s1, -24($fp) - # LOCAL local_print_list_at_Main_internal_3 --> -16($fp) - # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) - # local_print_list_at_Main_internal_3 = local_print_list_at_Main_internal_5 - lw $t2, -24($fp) - sw $t2, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_2 - sw $t2, 12($v0) - li $t2, 1 - sw $t2, 16($v0) - sw $v0, -28($fp) - # ARG local_print_list_at_Main_internal_6 - # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) - lw $t2, -28($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_print_list_at_Main_internal_3 --> -16($fp) - # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) - # local_print_list_at_Main_internal_4 = VCALL local_print_list_at_Main_internal_3 out_string - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 12($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) - # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) - # local_print_list_at_Main_internal_0 = local_print_list_at_Main_internal_4 - lw $t2, -20($fp) - sw $t2, -4($fp) - # GOTO label_ENDIF_2 -j label_ENDIF_2 -label_FALSEIF_1: - # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) - # local_print_list_at_Main_internal_9 = SELF - sw $s1, -40($fp) - # LOCAL local_print_list_at_Main_internal_7 --> -32($fp) - # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) - # local_print_list_at_Main_internal_7 = local_print_list_at_Main_internal_9 - lw $t2, -40($fp) - sw $t2, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) - # PARAM param_print_list_at_Main_l_0 --> 0($fp) - # local_print_list_at_Main_internal_10 = PARAM param_print_list_at_Main_l_0 - lw $t2, 0($fp) - sw $t2, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) - # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) - # local_print_list_at_Main_internal_11 = VCALL local_print_list_at_Main_internal_10 head - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 16($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_print_list_at_Main_internal_11 - # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) - lw $t2, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_print_list_at_Main_internal_7 --> -32($fp) - # LOCAL local_print_list_at_Main_internal_8 --> -36($fp) - # local_print_list_at_Main_internal_8 = VCALL local_print_list_at_Main_internal_7 out_int - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 16($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) - # local_print_list_at_Main_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_print_list_at_Main_internal_12 --> -52($fp) - # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) - # local_print_list_at_Main_internal_12 = local_print_list_at_Main_internal_14 - lw $t2, -60($fp) - sw $t2, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_3 - sw $t2, 12($v0) - li $t2, 1 - sw $t2, 16($v0) - sw $v0, -64($fp) - # ARG local_print_list_at_Main_internal_15 - # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) - lw $t2, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_print_list_at_Main_internal_12 --> -52($fp) - # LOCAL local_print_list_at_Main_internal_13 --> -56($fp) - # local_print_list_at_Main_internal_13 = VCALL local_print_list_at_Main_internal_12 out_string - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 12($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) - # local_print_list_at_Main_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_print_list_at_Main_internal_16 --> -68($fp) - # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) - # local_print_list_at_Main_internal_16 = local_print_list_at_Main_internal_18 - lw $t2, -76($fp) - sw $t2, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) - # PARAM param_print_list_at_Main_l_0 --> 0($fp) - # local_print_list_at_Main_internal_19 = PARAM param_print_list_at_Main_l_0 - lw $t2, 0($fp) - sw $t2, -80($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) - # LOCAL local_print_list_at_Main_internal_20 --> -84($fp) - # local_print_list_at_Main_internal_20 = VCALL local_print_list_at_Main_internal_19 tail - # Save new self pointer in $s1 - lw $s1, -80($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 20($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -84($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_print_list_at_Main_internal_20 - # LOCAL local_print_list_at_Main_internal_20 --> -84($fp) - lw $t2, -84($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_print_list_at_Main_internal_16 --> -68($fp) - # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) - # local_print_list_at_Main_internal_17 = VCALL local_print_list_at_Main_internal_16 print_list - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 28($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) - # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) - # local_print_list_at_Main_internal_0 = local_print_list_at_Main_internal_17 - lw $t2, -72($fp) - sw $t2, -4($fp) - label_ENDIF_2: -# RETURN local_print_list_at_Main_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_print_list_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 92 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 96 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 96 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_10 = ALLOCATE List - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, List - sw $t4, 12($v0) - li $t4, 4 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, List_start - sw $t4, 4($v0) - # Load type offset - li $t4, 16 - sw $t4, 8($v0) - move $t3, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t3, -44($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_8 = local_main_at_Main_internal_10 - lw $t3, -44($fp) - sw $t3, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 1 - li $t3, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 cons - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 24($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_9 - lw $t3, -40($fp) - sw $t3, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 2 - li $t3, 2 - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 cons - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 24($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_4 = local_main_at_Main_internal_7 - lw $t3, -32($fp) - sw $t3, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 3 - li $t3, 3 - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 cons - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 24($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_2 = local_main_at_Main_internal_5 - lw $t3, -24($fp) - sw $t3, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 4 - li $t3, 4 - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 cons - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 24($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 - lw $t3, -16($fp) - sw $t3, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 5 - li $t3, 5 - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 cons - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 24($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - lw $t3, -8($fp) - sw $t3, 12($s1) - label_WHILE_3: - # local_main_at_Main_internal_13 = GETATTRIBUTE mylist Main - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - lw $t3, 12($s1) - sw $t3, -56($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_11 = local_main_at_Main_internal_13 - lw $t3, -56($fp) - sw $t3, -48($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_12 = VCALL local_main_at_Main_internal_11 isNil - # Save new self pointer in $s1 - lw $s1, -48($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 12($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -52($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # IF_ZERO local_main_at_Main_internal_12 GOTO label_FALSE_5 - # IF_ZERO local_main_at_Main_internal_12 GOTO label_FALSE_5 - lw $t3, -52($fp) - beq $t3, 0, label_FALSE_5 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = 0 - li $t3, 0 - sw $t3, -60($fp) - # GOTO label_NOT_END_6 - j label_NOT_END_6 - label_FALSE_5: - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = 1 - li $t3, 1 - sw $t3, -60($fp) - label_NOT_END_6: - # IF_ZERO local_main_at_Main_internal_14 GOTO label_WHILE_END_4 - # IF_ZERO local_main_at_Main_internal_14 GOTO label_WHILE_END_4 - lw $t3, -60($fp) - beq $t3, 0, label_WHILE_END_4 - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = SELF - sw $s1, -72($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 - lw $t3, -72($fp) - sw $t3, -64($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_main_at_Main_internal_18 = GETATTRIBUTE mylist Main - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - lw $t3, 12($s1) - sw $t3, -76($fp) - # ARG local_main_at_Main_internal_18 - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - lw $t3, -76($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 print_list - # Save new self pointer in $s1 - lw $s1, -64($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 28($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -68($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_main_at_Main_internal_21 = GETATTRIBUTE mylist Main - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - lw $t3, 12($s1) - sw $t3, -88($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 - lw $t3, -88($fp) - sw $t3, -80($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 tail - # Save new self pointer in $s1 - lw $s1, -80($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 20($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -84($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - lw $t3, -84($fp) - sw $t3, 12($s1) - # GOTO label_WHILE_3 - j label_WHILE_3 - label_WHILE_END_4: - # RETURN - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 96 - jr $ra - # Function END - diff --git a/tests/codegen/new_complex.mips b/tests/codegen/new_complex.mips deleted file mode 100644 index d8d5716b..00000000 --- a/tests/codegen/new_complex.mips +++ /dev/null @@ -1,2044 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:17 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Main: .asciiz "Main" -# Function END -Complex: .asciiz "Complex" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -# **** VTABLE for type Complex **** -Complex_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Complex, function_print_at_Complex, function_reflect_0_at_Complex, function_reflect_X_at_Complex, function_reflect_Y_at_Complex, function_equal_at_Complex, function_x_value_at_Complex, function_y_value_at_Complex -# Function END -# - - -# **** Type RECORD for type Complex **** -Complex_start: - Complex_vtable_pointer: .word Complex_vtable - # Function END -Complex_end: -# - - -data_0: .asciiz "" -# - - -IO__TDT: .word 0, -1, -1, -1, 1, 1 -Object__TDT: .word 1, 0, 1, 1, 2, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1 -Main__TDT: .word -1, -1, -1, -1, 0, -1 -Complex__TDT: .word -1, -1, -1, -1, -1, 0 -# - - -data_2: .asciiz "=)\n" -# - - -data_3: .asciiz "=(\n" -# - - -data_4: .asciiz "=)\n" -# - - -data_5: .asciiz "=(\n" -# - - -data_6: .asciiz "+" -# - - -data_7: .asciiz "I" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - li $a0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) - # Load type offset - li $t2, 16 - sw $t2, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t1, Main_vtable - # Get pointer to function address - lw $t2, 28($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 148 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 148 - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_c_0 = ALLOCATE Complex - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Complex - sw $t3, 12($v0) - li $t3, 7 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Complex_start - sw $t3, 4($v0) - # Load type offset - li $t3, 20 - sw $t3, 8($v0) - move $t2, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Complex__attrib__x__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t2) - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Complex__attrib__y__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t2) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t2, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = ALLOCATE Complex - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Complex - sw $t4, 12($v0) - li $t4, 7 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, Complex_start - sw $t4, 4($v0) - # Load type offset - li $t4, 20 - sw $t4, 8($v0) - move $t3, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Complex__attrib__x__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t3) - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Complex__attrib__y__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t3) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t3, -16($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t3, -16($fp) - sw $t3, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 1 - li $t3, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # ARG 1 - li $t3, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 28($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_c_0 = local_main_at_Main_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_c_0 - lw $t3, -4($fp) - sw $t3, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 reflect_X - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 40($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_internal_8 = local_main_at_Main_c_0 - lw $t3, -4($fp) - sw $t3, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 reflect_0 - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 36($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_5 = local_main_at_Main_internal_7 - local_main_at_Main_internal_9 - lw $t3, -32($fp) - lw $t4, -40($fp) - sub $t3, $t3, $t4 - sw $t3, -24($fp) - # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_3 - # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_3 - lw $t3, -24($fp) - beq $t3, 0, label_TRUE_3 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = 0 - li $t3, 0 - sw $t3, -24($fp) - # GOTO label_END_4 -j label_END_4 -label_TRUE_3: - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = 1 - li $t3, 1 - sw $t3, -24($fp) - label_END_4: -# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_1 -# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_1 -lw $t3, -24($fp) -beq $t3, 0, label_FALSEIF_1 -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# local_main_at_Main_internal_12 = SELF -sw $s1, -52($fp) -# LOCAL local_main_at_Main_internal_10 --> -44($fp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# local_main_at_Main_internal_10 = local_main_at_Main_internal_12 -lw $t3, -52($fp) -sw $t3, -44($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t3, String -sw $t3, 0($v0) -la $t3, String_start -sw $t3, 4($v0) -# Load type offset -li $t3, 8 -sw $t3, 8($v0) -la $t3, data_2 -sw $t3, 12($v0) -li $t3, 3 -sw $t3, 16($v0) -sw $v0, -56($fp) -# ARG local_main_at_Main_internal_13 -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -lw $t3, -56($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_main_at_Main_internal_10 --> -44($fp) -# LOCAL local_main_at_Main_internal_11 --> -48($fp) -# local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 out_string -# Save new self pointer in $s1 -lw $s1, -44($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 12($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -48($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_4 --> -20($fp) -# LOCAL local_main_at_Main_internal_11 --> -48($fp) -# local_main_at_Main_internal_4 = local_main_at_Main_internal_11 -lw $t3, -48($fp) -sw $t3, -20($fp) -# GOTO label_ENDIF_2 -j label_ENDIF_2 -label_FALSEIF_1: - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_16 = SELF - sw $s1, -68($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_14 = local_main_at_Main_internal_16 - lw $t3, -68($fp) - sw $t3, -60($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_3 - sw $t3, 12($v0) - li $t3, 3 - sw $t3, 16($v0) - sw $v0, -72($fp) - # ARG local_main_at_Main_internal_17 - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - lw $t3, -72($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 out_string - # Save new self pointer in $s1 - lw $s1, -60($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 12($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -64($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_4 = local_main_at_Main_internal_15 - lw $t3, -64($fp) - sw $t3, -20($fp) - label_ENDIF_2: -# LOCAL local_main_at_Main_internal_23 --> -96($fp) -# LOCAL local_main_at_Main_c_0 --> -4($fp) -# local_main_at_Main_internal_23 = local_main_at_Main_c_0 -lw $t3, -4($fp) -sw $t3, -96($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_23 --> -96($fp) -# LOCAL local_main_at_Main_internal_24 --> -100($fp) -# local_main_at_Main_internal_24 = VCALL local_main_at_Main_internal_23 reflect_X -# Save new self pointer in $s1 -lw $s1, -96($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 40($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -100($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_21 --> -88($fp) -# LOCAL local_main_at_Main_internal_24 --> -100($fp) -# local_main_at_Main_internal_21 = local_main_at_Main_internal_24 -lw $t3, -100($fp) -sw $t3, -88($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_21 --> -88($fp) -# LOCAL local_main_at_Main_internal_22 --> -92($fp) -# local_main_at_Main_internal_22 = VCALL local_main_at_Main_internal_21 reflect_Y -# Save new self pointer in $s1 -lw $s1, -88($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 44($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -92($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# LOCAL local_main_at_Main_internal_22 --> -92($fp) -# local_main_at_Main_internal_19 = local_main_at_Main_internal_22 -lw $t3, -92($fp) -sw $t3, -80($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_25 --> -104($fp) -# LOCAL local_main_at_Main_c_0 --> -4($fp) -# local_main_at_Main_internal_25 = local_main_at_Main_c_0 -lw $t3, -4($fp) -sw $t3, -104($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_25 --> -104($fp) -# LOCAL local_main_at_Main_internal_26 --> -108($fp) -# local_main_at_Main_internal_26 = VCALL local_main_at_Main_internal_25 reflect_0 -# Save new self pointer in $s1 -lw $s1, -104($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 36($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -108($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_26 -# LOCAL local_main_at_Main_internal_26 --> -108($fp) -lw $t3, -108($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# LOCAL local_main_at_Main_internal_20 --> -84($fp) -# local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 equal -# Save new self pointer in $s1 -lw $s1, -80($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 48($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -84($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# IF_ZERO local_main_at_Main_internal_20 GOTO label_FALSEIF_5 -# IF_ZERO local_main_at_Main_internal_20 GOTO label_FALSEIF_5 -lw $t3, -84($fp) -beq $t3, 0, label_FALSEIF_5 -# LOCAL local_main_at_Main_internal_29 --> -120($fp) -# local_main_at_Main_internal_29 = SELF -sw $s1, -120($fp) -# LOCAL local_main_at_Main_internal_27 --> -112($fp) -# LOCAL local_main_at_Main_internal_29 --> -120($fp) -# local_main_at_Main_internal_27 = local_main_at_Main_internal_29 -lw $t3, -120($fp) -sw $t3, -112($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_30 --> -124($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t3, String -sw $t3, 0($v0) -la $t3, String_start -sw $t3, 4($v0) -# Load type offset -li $t3, 8 -sw $t3, 8($v0) -la $t3, data_4 -sw $t3, 12($v0) -li $t3, 3 -sw $t3, 16($v0) -sw $v0, -124($fp) -# ARG local_main_at_Main_internal_30 -# LOCAL local_main_at_Main_internal_30 --> -124($fp) -lw $t3, -124($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_main_at_Main_internal_27 --> -112($fp) -# LOCAL local_main_at_Main_internal_28 --> -116($fp) -# local_main_at_Main_internal_28 = VCALL local_main_at_Main_internal_27 out_string -# Save new self pointer in $s1 -lw $s1, -112($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 12($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -116($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# LOCAL local_main_at_Main_internal_28 --> -116($fp) -# local_main_at_Main_internal_18 = local_main_at_Main_internal_28 -lw $t3, -116($fp) -sw $t3, -76($fp) -# GOTO label_ENDIF_6 -j label_ENDIF_6 -label_FALSEIF_5: - # LOCAL local_main_at_Main_internal_33 --> -136($fp) - # local_main_at_Main_internal_33 = SELF - sw $s1, -136($fp) - # LOCAL local_main_at_Main_internal_31 --> -128($fp) - # LOCAL local_main_at_Main_internal_33 --> -136($fp) - # local_main_at_Main_internal_31 = local_main_at_Main_internal_33 - lw $t3, -136($fp) - sw $t3, -128($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_34 --> -140($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_5 - sw $t3, 12($v0) - li $t3, 3 - sw $t3, 16($v0) - sw $v0, -140($fp) - # ARG local_main_at_Main_internal_34 - # LOCAL local_main_at_Main_internal_34 --> -140($fp) - lw $t3, -140($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_31 --> -128($fp) - # LOCAL local_main_at_Main_internal_32 --> -132($fp) - # local_main_at_Main_internal_32 = VCALL local_main_at_Main_internal_31 out_string - # Save new self pointer in $s1 - lw $s1, -128($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 12($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -132($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_32 --> -132($fp) - # local_main_at_Main_internal_18 = local_main_at_Main_internal_32 - lw $t3, -132($fp) - sw $t3, -76($fp) - label_ENDIF_6: -# RETURN local_main_at_Main_internal_18 -lw $v0, -76($fp) -# Deallocate stack frame for function function_main_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 148 -jr $ra -# Function END - - -# __Complex__attrib__x__init implementation. -# @Params: -__Complex__attrib__x__init: - # Allocate stack frame for function __Complex__attrib__x__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Complex__attrib__x__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Complex__attrib__y__init implementation. -# @Params: -__Complex__attrib__y__init: - # Allocate stack frame for function __Complex__attrib__y__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Complex__attrib__y__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_Complex implementation. -# @Params: -# 0($fp) = param_init_at_Complex_a_0 -# 4($fp) = param_init_at_Complex_b_1 -function_init_at_Complex: - # Allocate stack frame for function function_init_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_init_at_Complex_internal_1 = GETATTRIBUTE x Complex - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - lw $t3, 12($s1) - sw $t3, -8($fp) - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - # PARAM param_init_at_Complex_a_0 --> 4($fp) - # local_init_at_Complex_internal_0 = local_init_at_Complex_internal_1 - PARAM param_init_at_Complex_a_0 - lw $t3, -8($fp) - lw $t4, 4($fp) - sub $t3, $t3, $t4 - sw $t3, -4($fp) - # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_7 - # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_7 - lw $t3, -4($fp) - beq $t3, 0, label_TRUE_7 - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # local_init_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - # GOTO label_END_8 -j label_END_8 -label_TRUE_7: - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # local_init_at_Complex_internal_0 = 1 - li $t3, 1 - sw $t3, -4($fp) - label_END_8: -# local_init_at_Complex_internal_3 = GETATTRIBUTE y Complex -# LOCAL local_init_at_Complex_internal_3 --> -16($fp) -lw $t3, 16($s1) -sw $t3, -16($fp) -# LOCAL local_init_at_Complex_internal_2 --> -12($fp) -# LOCAL local_init_at_Complex_internal_3 --> -16($fp) -# PARAM param_init_at_Complex_b_1 --> 0($fp) -# local_init_at_Complex_internal_2 = local_init_at_Complex_internal_3 - PARAM param_init_at_Complex_b_1 -lw $t3, -16($fp) -lw $t4, 0($fp) -sub $t3, $t3, $t4 -sw $t3, -12($fp) -# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_9 -# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_9 -lw $t3, -12($fp) -beq $t3, 0, label_TRUE_9 -# LOCAL local_init_at_Complex_internal_2 --> -12($fp) -# local_init_at_Complex_internal_2 = 0 -li $t3, 0 -sw $t3, -12($fp) -# GOTO label_END_10 -j label_END_10 -label_TRUE_9: - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # local_init_at_Complex_internal_2 = 1 - li $t3, 1 - sw $t3, -12($fp) - label_END_10: -# LOCAL local_init_at_Complex_internal_4 --> -20($fp) -# local_init_at_Complex_internal_4 = SELF -sw $s1, -20($fp) -# RETURN local_init_at_Complex_internal_4 -lw $v0, -20($fp) -# Deallocate stack frame for function function_init_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 32 -# Deallocate function args -addu $sp, $sp, 8 -jr $ra -# Function END - - -# function_print_at_Complex implementation. -# @Params: -function_print_at_Complex: - # Allocate stack frame for function function_print_at_Complex. - subu $sp, $sp, 88 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 88 - # local_print_at_Complex_internal_2 = GETATTRIBUTE y Complex - # LOCAL local_print_at_Complex_internal_2 --> -12($fp) - lw $t3, 16($s1) - sw $t3, -12($fp) - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # LOCAL local_print_at_Complex_internal_2 --> -12($fp) - # local_print_at_Complex_internal_1 = local_print_at_Complex_internal_2 - 0 - lw $t3, -12($fp) - sub $t3, $t3, 0 - sw $t3, -8($fp) - # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_13 - # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_13 - lw $t3, -8($fp) - beq $t3, 0, label_TRUE_13 - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # local_print_at_Complex_internal_1 = 0 - li $t3, 0 - sw $t3, -8($fp) - # GOTO label_END_14 -j label_END_14 -label_TRUE_13: - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # local_print_at_Complex_internal_1 = 1 - li $t3, 1 - sw $t3, -8($fp) - label_END_14: -# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_11 -# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_11 -lw $t3, -8($fp) -beq $t3, 0, label_FALSEIF_11 -# LOCAL local_print_at_Complex_internal_5 --> -24($fp) -# local_print_at_Complex_internal_5 = SELF -sw $s1, -24($fp) -# LOCAL local_print_at_Complex_internal_3 --> -16($fp) -# LOCAL local_print_at_Complex_internal_5 --> -24($fp) -# local_print_at_Complex_internal_3 = local_print_at_Complex_internal_5 -lw $t3, -24($fp) -sw $t3, -16($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_print_at_Complex_internal_6 = GETATTRIBUTE x Complex -# LOCAL local_print_at_Complex_internal_6 --> -28($fp) -lw $t3, 12($s1) -sw $t3, -28($fp) -# ARG local_print_at_Complex_internal_6 -# LOCAL local_print_at_Complex_internal_6 --> -28($fp) -lw $t3, -28($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_print_at_Complex_internal_3 --> -16($fp) -# LOCAL local_print_at_Complex_internal_4 --> -20($fp) -# local_print_at_Complex_internal_4 = VCALL local_print_at_Complex_internal_3 out_int -# Save new self pointer in $s1 -lw $s1, -16($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 16($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -20($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_print_at_Complex_internal_0 --> -4($fp) -# LOCAL local_print_at_Complex_internal_4 --> -20($fp) -# local_print_at_Complex_internal_0 = local_print_at_Complex_internal_4 -lw $t3, -20($fp) -sw $t3, -4($fp) -# GOTO label_ENDIF_12 -j label_ENDIF_12 -label_FALSEIF_11: - # LOCAL local_print_at_Complex_internal_15 --> -64($fp) - # local_print_at_Complex_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_print_at_Complex_internal_13 --> -56($fp) - # LOCAL local_print_at_Complex_internal_15 --> -64($fp) - # local_print_at_Complex_internal_13 = local_print_at_Complex_internal_15 - lw $t3, -64($fp) - sw $t3, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Complex_internal_16 = GETATTRIBUTE x Complex - # LOCAL local_print_at_Complex_internal_16 --> -68($fp) - lw $t3, 12($s1) - sw $t3, -68($fp) - # ARG local_print_at_Complex_internal_16 - # LOCAL local_print_at_Complex_internal_16 --> -68($fp) - lw $t3, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_print_at_Complex_internal_13 --> -56($fp) - # LOCAL local_print_at_Complex_internal_14 --> -60($fp) - # local_print_at_Complex_internal_14 = VCALL local_print_at_Complex_internal_13 out_int - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 16($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_11 --> -48($fp) - # LOCAL local_print_at_Complex_internal_14 --> -60($fp) - # local_print_at_Complex_internal_11 = local_print_at_Complex_internal_14 - lw $t3, -60($fp) - sw $t3, -48($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Complex_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_6 - sw $t3, 12($v0) - li $t3, 1 - sw $t3, 16($v0) - sw $v0, -72($fp) - # ARG local_print_at_Complex_internal_17 - # LOCAL local_print_at_Complex_internal_17 --> -72($fp) - lw $t3, -72($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_print_at_Complex_internal_11 --> -48($fp) - # LOCAL local_print_at_Complex_internal_12 --> -52($fp) - # local_print_at_Complex_internal_12 = VCALL local_print_at_Complex_internal_11 out_string - # Save new self pointer in $s1 - lw $s1, -48($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 12($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -52($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_9 --> -40($fp) - # LOCAL local_print_at_Complex_internal_12 --> -52($fp) - # local_print_at_Complex_internal_9 = local_print_at_Complex_internal_12 - lw $t3, -52($fp) - sw $t3, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Complex_internal_18 = GETATTRIBUTE y Complex - # LOCAL local_print_at_Complex_internal_18 --> -76($fp) - lw $t3, 16($s1) - sw $t3, -76($fp) - # ARG local_print_at_Complex_internal_18 - # LOCAL local_print_at_Complex_internal_18 --> -76($fp) - lw $t3, -76($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_print_at_Complex_internal_9 --> -40($fp) - # LOCAL local_print_at_Complex_internal_10 --> -44($fp) - # local_print_at_Complex_internal_10 = VCALL local_print_at_Complex_internal_9 out_int - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 16($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_7 --> -32($fp) - # LOCAL local_print_at_Complex_internal_10 --> -44($fp) - # local_print_at_Complex_internal_7 = local_print_at_Complex_internal_10 - lw $t3, -44($fp) - sw $t3, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Complex_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_7 - sw $t3, 12($v0) - li $t3, 1 - sw $t3, 16($v0) - sw $v0, -80($fp) - # ARG local_print_at_Complex_internal_19 - # LOCAL local_print_at_Complex_internal_19 --> -80($fp) - lw $t3, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_print_at_Complex_internal_7 --> -32($fp) - # LOCAL local_print_at_Complex_internal_8 --> -36($fp) - # local_print_at_Complex_internal_8 = VCALL local_print_at_Complex_internal_7 out_string - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 12($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_0 --> -4($fp) - # LOCAL local_print_at_Complex_internal_8 --> -36($fp) - # local_print_at_Complex_internal_0 = local_print_at_Complex_internal_8 - lw $t3, -36($fp) - sw $t3, -4($fp) - label_ENDIF_12: -# RETURN local_print_at_Complex_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_print_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 88 -jr $ra -# Function END - - -# function_reflect_0_at_Complex implementation. -# @Params: -function_reflect_0_at_Complex: - # Allocate stack frame for function function_reflect_0_at_Complex. - subu $sp, $sp, 44 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 44 - # local_reflect_0_at_Complex_internal_1 = GETATTRIBUTE x Complex - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - lw $t3, 12($s1) - sw $t3, -8($fp) - # local_reflect_0_at_Complex_internal_3 = GETATTRIBUTE x Complex - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - lw $t3, 12($s1) - sw $t3, -16($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - lw $t3, -16($fp) - not $t3, $t3 - sw $t3, -12($fp) - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # local_reflect_0_at_Complex_internal_0 = local_reflect_0_at_Complex_internal_1 - local_reflect_0_at_Complex_internal_2 - lw $t3, -8($fp) - lw $t4, -12($fp) - sub $t3, $t3, $t4 - sw $t3, -4($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_15 - # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_15 - lw $t3, -4($fp) - beq $t3, 0, label_TRUE_15 - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # local_reflect_0_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - # GOTO label_END_16 -j label_END_16 -label_TRUE_15: - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # local_reflect_0_at_Complex_internal_0 = 1 - li $t3, 1 - sw $t3, -4($fp) - label_END_16: -# local_reflect_0_at_Complex_internal_5 = GETATTRIBUTE y Complex -# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) -lw $t3, 16($s1) -sw $t3, -24($fp) -# local_reflect_0_at_Complex_internal_7 = GETATTRIBUTE y Complex -# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -lw $t3, 16($s1) -sw $t3, -32($fp) -# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) -# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -lw $t3, -32($fp) -not $t3, $t3 -sw $t3, -28($fp) -# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) -# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) -# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) -# local_reflect_0_at_Complex_internal_4 = local_reflect_0_at_Complex_internal_5 - local_reflect_0_at_Complex_internal_6 -lw $t3, -24($fp) -lw $t4, -28($fp) -sub $t3, $t3, $t4 -sw $t3, -20($fp) -# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_17 -# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_17 -lw $t3, -20($fp) -beq $t3, 0, label_TRUE_17 -# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) -# local_reflect_0_at_Complex_internal_4 = 0 -li $t3, 0 -sw $t3, -20($fp) -# GOTO label_END_18 -j label_END_18 -label_TRUE_17: - # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) - # local_reflect_0_at_Complex_internal_4 = 1 - li $t3, 1 - sw $t3, -20($fp) - label_END_18: -# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) -# local_reflect_0_at_Complex_internal_8 = SELF -sw $s1, -36($fp) -# RETURN local_reflect_0_at_Complex_internal_8 -lw $v0, -36($fp) -# Deallocate stack frame for function function_reflect_0_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 44 -jr $ra -# Function END - - -# function_reflect_X_at_Complex implementation. -# @Params: -function_reflect_X_at_Complex: - # Allocate stack frame for function function_reflect_X_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_reflect_X_at_Complex_internal_1 = GETATTRIBUTE y Complex - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - lw $t3, 16($s1) - sw $t3, -8($fp) - # local_reflect_X_at_Complex_internal_3 = GETATTRIBUTE y Complex - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - lw $t3, 16($s1) - sw $t3, -16($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - lw $t3, -16($fp) - not $t3, $t3 - sw $t3, -12($fp) - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # local_reflect_X_at_Complex_internal_0 = local_reflect_X_at_Complex_internal_1 - local_reflect_X_at_Complex_internal_2 - lw $t3, -8($fp) - lw $t4, -12($fp) - sub $t3, $t3, $t4 - sw $t3, -4($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_19 - # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_19 - lw $t3, -4($fp) - beq $t3, 0, label_TRUE_19 - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # local_reflect_X_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - # GOTO label_END_20 -j label_END_20 -label_TRUE_19: - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # local_reflect_X_at_Complex_internal_0 = 1 - li $t3, 1 - sw $t3, -4($fp) - label_END_20: -# LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) -# local_reflect_X_at_Complex_internal_4 = SELF -sw $s1, -20($fp) -# RETURN local_reflect_X_at_Complex_internal_4 -lw $v0, -20($fp) -# Deallocate stack frame for function function_reflect_X_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 32 -jr $ra -# Function END - - -# function_reflect_Y_at_Complex implementation. -# @Params: -function_reflect_Y_at_Complex: - # Allocate stack frame for function function_reflect_Y_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_reflect_Y_at_Complex_internal_1 = GETATTRIBUTE x Complex - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - lw $t3, 12($s1) - sw $t3, -8($fp) - # local_reflect_Y_at_Complex_internal_3 = GETATTRIBUTE x Complex - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - lw $t3, 12($s1) - sw $t3, -16($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - lw $t3, -16($fp) - not $t3, $t3 - sw $t3, -12($fp) - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # local_reflect_Y_at_Complex_internal_0 = local_reflect_Y_at_Complex_internal_1 - local_reflect_Y_at_Complex_internal_2 - lw $t3, -8($fp) - lw $t4, -12($fp) - sub $t3, $t3, $t4 - sw $t3, -4($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_21 - # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_21 - lw $t3, -4($fp) - beq $t3, 0, label_TRUE_21 - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # local_reflect_Y_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - # GOTO label_END_22 -j label_END_22 -label_TRUE_21: - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # local_reflect_Y_at_Complex_internal_0 = 1 - li $t3, 1 - sw $t3, -4($fp) - label_END_22: -# LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) -# local_reflect_Y_at_Complex_internal_4 = SELF -sw $s1, -20($fp) -# RETURN local_reflect_Y_at_Complex_internal_4 -lw $v0, -20($fp) -# Deallocate stack frame for function function_reflect_Y_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 32 -jr $ra -# Function END - - -# function_equal_at_Complex implementation. -# @Params: -# 0($fp) = param_equal_at_Complex_d_0 -function_equal_at_Complex: - # Allocate stack frame for function function_equal_at_Complex. - subu $sp, $sp, 60 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 60 - # local_equal_at_Complex_internal_2 = GETATTRIBUTE x Complex - # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) - lw $t3, 12($s1) - sw $t3, -12($fp) - # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) - # PARAM param_equal_at_Complex_d_0 --> 0($fp) - # local_equal_at_Complex_internal_3 = PARAM param_equal_at_Complex_d_0 - lw $t3, 0($fp) - sw $t3, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) - # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) - # local_equal_at_Complex_internal_4 = VCALL local_equal_at_Complex_internal_3 x_value - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 52($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) - # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) - # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) - # local_equal_at_Complex_internal_1 = local_equal_at_Complex_internal_2 - local_equal_at_Complex_internal_4 - lw $t3, -12($fp) - lw $t4, -20($fp) - sub $t3, $t3, $t4 - sw $t3, -8($fp) - # IF_ZERO local_equal_at_Complex_internal_1 GOTO label_TRUE_25 - # IF_ZERO local_equal_at_Complex_internal_1 GOTO label_TRUE_25 - lw $t3, -8($fp) - beq $t3, 0, label_TRUE_25 - # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) - # local_equal_at_Complex_internal_1 = 0 - li $t3, 0 - sw $t3, -8($fp) - # GOTO label_END_26 -j label_END_26 -label_TRUE_25: - # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) - # local_equal_at_Complex_internal_1 = 1 - li $t3, 1 - sw $t3, -8($fp) - label_END_26: -# IF_ZERO local_equal_at_Complex_internal_1 GOTO label_FALSEIF_23 -# IF_ZERO local_equal_at_Complex_internal_1 GOTO label_FALSEIF_23 -lw $t3, -8($fp) -beq $t3, 0, label_FALSEIF_23 -# local_equal_at_Complex_internal_7 = GETATTRIBUTE y Complex -# LOCAL local_equal_at_Complex_internal_7 --> -32($fp) -lw $t3, 16($s1) -sw $t3, -32($fp) -# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) -# PARAM param_equal_at_Complex_d_0 --> 0($fp) -# local_equal_at_Complex_internal_8 = PARAM param_equal_at_Complex_d_0 -lw $t3, 0($fp) -sw $t3, -36($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) -# LOCAL local_equal_at_Complex_internal_9 --> -40($fp) -# local_equal_at_Complex_internal_9 = VCALL local_equal_at_Complex_internal_8 y_value -# Save new self pointer in $s1 -lw $s1, -36($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 56($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -40($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_equal_at_Complex_internal_6 --> -28($fp) -# LOCAL local_equal_at_Complex_internal_7 --> -32($fp) -# LOCAL local_equal_at_Complex_internal_9 --> -40($fp) -# local_equal_at_Complex_internal_6 = local_equal_at_Complex_internal_7 - local_equal_at_Complex_internal_9 -lw $t3, -32($fp) -lw $t4, -40($fp) -sub $t3, $t3, $t4 -sw $t3, -28($fp) -# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_TRUE_29 -# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_TRUE_29 -lw $t3, -28($fp) -beq $t3, 0, label_TRUE_29 -# LOCAL local_equal_at_Complex_internal_6 --> -28($fp) -# local_equal_at_Complex_internal_6 = 0 -li $t3, 0 -sw $t3, -28($fp) -# GOTO label_END_30 -j label_END_30 -label_TRUE_29: - # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) - # local_equal_at_Complex_internal_6 = 1 - li $t3, 1 - sw $t3, -28($fp) - label_END_30: -# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSEIF_27 -# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSEIF_27 -lw $t3, -28($fp) -beq $t3, 0, label_FALSEIF_27 -# LOCAL local_equal_at_Complex_internal_10 --> -44($fp) -# local_equal_at_Complex_internal_10 = 1 -li $t3, 1 -sw $t3, -44($fp) -# LOCAL local_equal_at_Complex_internal_5 --> -24($fp) -# LOCAL local_equal_at_Complex_internal_10 --> -44($fp) -# local_equal_at_Complex_internal_5 = local_equal_at_Complex_internal_10 -lw $t3, -44($fp) -sw $t3, -24($fp) -# GOTO label_ENDIF_28 -j label_ENDIF_28 -label_FALSEIF_27: - # LOCAL local_equal_at_Complex_internal_11 --> -48($fp) - # local_equal_at_Complex_internal_11 = 0 - li $t3, 0 - sw $t3, -48($fp) - # LOCAL local_equal_at_Complex_internal_5 --> -24($fp) - # LOCAL local_equal_at_Complex_internal_11 --> -48($fp) - # local_equal_at_Complex_internal_5 = local_equal_at_Complex_internal_11 - lw $t3, -48($fp) - sw $t3, -24($fp) - label_ENDIF_28: -# LOCAL local_equal_at_Complex_internal_0 --> -4($fp) -# LOCAL local_equal_at_Complex_internal_5 --> -24($fp) -# local_equal_at_Complex_internal_0 = local_equal_at_Complex_internal_5 -lw $t3, -24($fp) -sw $t3, -4($fp) -# GOTO label_ENDIF_24 -j label_ENDIF_24 -label_FALSEIF_23: - # LOCAL local_equal_at_Complex_internal_12 --> -52($fp) - # local_equal_at_Complex_internal_12 = 0 - li $t3, 0 - sw $t3, -52($fp) - # LOCAL local_equal_at_Complex_internal_0 --> -4($fp) - # LOCAL local_equal_at_Complex_internal_12 --> -52($fp) - # local_equal_at_Complex_internal_0 = local_equal_at_Complex_internal_12 - lw $t3, -52($fp) - sw $t3, -4($fp) - label_ENDIF_24: -# RETURN local_equal_at_Complex_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_equal_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 60 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_x_value_at_Complex implementation. -# @Params: -function_x_value_at_Complex: - # Allocate stack frame for function function_x_value_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_x_value_at_Complex_internal_0 = GETATTRIBUTE x Complex - # LOCAL local_x_value_at_Complex_internal_0 --> -4($fp) - lw $t3, 12($s1) - sw $t3, -4($fp) - # RETURN local_x_value_at_Complex_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_x_value_at_Complex. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_y_value_at_Complex implementation. -# @Params: -function_y_value_at_Complex: - # Allocate stack frame for function function_y_value_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_y_value_at_Complex_internal_0 = GETATTRIBUTE y Complex - # LOCAL local_y_value_at_Complex_internal_0 --> -4($fp) - lw $t3, 16($s1) - sw $t3, -4($fp) - # RETURN local_y_value_at_Complex_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_y_value_at_Complex. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - diff --git a/tests/codegen/palindrome.mips b/tests/codegen/palindrome.mips deleted file mode 100644 index c69236d5..00000000 --- a/tests/codegen/palindrome.mips +++ /dev/null @@ -1,1279 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:20 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_pal_at_Main, function_main_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -IO__TDT: .word 0, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, 0 -# - - -data_2: .asciiz "enter a string\n" -# - - -data_3: .asciiz "that was a palindrome\n" -# - - -data_4: .asciiz "that was not a palindrome\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - li $a0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) - # Load type offset - li $t2, 16 - sw $t2, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__i__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t1, Main_vtable - # Get pointer to function address - lw $t2, 32($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__i__init implementation. -# @Params: -__Main__attrib__i__init: - # Allocate stack frame for function __Main__attrib__i__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Main__attrib__i__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_pal_at_Main implementation. -# @Params: -# 0($fp) = param_pal_at_Main_s_0 -function_pal_at_Main: - # Allocate stack frame for function function_pal_at_Main. - subu $sp, $sp, 120 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 120 - # LOCAL local_pal_at_Main_internal_2 --> -12($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_2 = PARAM param_pal_at_Main_s_0 - lw $t1, 0($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_2 --> -12($fp) - # LOCAL local_pal_at_Main_internal_3 --> -16($fp) - # local_pal_at_Main_internal_3 = VCALL local_pal_at_Main_internal_2 length - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_1 --> -8($fp) - # LOCAL local_pal_at_Main_internal_3 --> -16($fp) - # local_pal_at_Main_internal_1 = local_pal_at_Main_internal_3 - 0 - lw $t1, -16($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_ZERO local_pal_at_Main_internal_1 GOTO label_TRUE_3 - # IF_ZERO local_pal_at_Main_internal_1 GOTO label_TRUE_3 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_3 - # LOCAL local_pal_at_Main_internal_1 --> -8($fp) - # local_pal_at_Main_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_4 -j label_END_4 -label_TRUE_3: - # LOCAL local_pal_at_Main_internal_1 --> -8($fp) - # local_pal_at_Main_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_4: -# IF_ZERO local_pal_at_Main_internal_1 GOTO label_FALSEIF_1 -# IF_ZERO local_pal_at_Main_internal_1 GOTO label_FALSEIF_1 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_1 -# LOCAL local_pal_at_Main_internal_4 --> -20($fp) -# local_pal_at_Main_internal_4 = 1 -li $t1, 1 -sw $t1, -20($fp) -# LOCAL local_pal_at_Main_internal_0 --> -4($fp) -# LOCAL local_pal_at_Main_internal_4 --> -20($fp) -# local_pal_at_Main_internal_0 = local_pal_at_Main_internal_4 -lw $t1, -20($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_2 -j label_ENDIF_2 -label_FALSEIF_1: - # LOCAL local_pal_at_Main_internal_7 --> -32($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_7 = PARAM param_pal_at_Main_s_0 - lw $t1, 0($fp) - sw $t1, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_7 --> -32($fp) - # LOCAL local_pal_at_Main_internal_8 --> -36($fp) - # local_pal_at_Main_internal_8 = VCALL local_pal_at_Main_internal_7 length - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_6 --> -28($fp) - # LOCAL local_pal_at_Main_internal_8 --> -36($fp) - # local_pal_at_Main_internal_6 = local_pal_at_Main_internal_8 - 1 - lw $t1, -36($fp) - sub $t1, $t1, 1 - sw $t1, -28($fp) - # IF_ZERO local_pal_at_Main_internal_6 GOTO label_TRUE_7 - # IF_ZERO local_pal_at_Main_internal_6 GOTO label_TRUE_7 - lw $t1, -28($fp) - beq $t1, 0, label_TRUE_7 - # LOCAL local_pal_at_Main_internal_6 --> -28($fp) - # local_pal_at_Main_internal_6 = 0 - li $t1, 0 - sw $t1, -28($fp) - # GOTO label_END_8 -j label_END_8 -label_TRUE_7: - # LOCAL local_pal_at_Main_internal_6 --> -28($fp) - # local_pal_at_Main_internal_6 = 1 - li $t1, 1 - sw $t1, -28($fp) - label_END_8: -# IF_ZERO local_pal_at_Main_internal_6 GOTO label_FALSEIF_5 -# IF_ZERO local_pal_at_Main_internal_6 GOTO label_FALSEIF_5 -lw $t1, -28($fp) -beq $t1, 0, label_FALSEIF_5 -# LOCAL local_pal_at_Main_internal_9 --> -40($fp) -# local_pal_at_Main_internal_9 = 1 -li $t1, 1 -sw $t1, -40($fp) -# LOCAL local_pal_at_Main_internal_5 --> -24($fp) -# LOCAL local_pal_at_Main_internal_9 --> -40($fp) -# local_pal_at_Main_internal_5 = local_pal_at_Main_internal_9 -lw $t1, -40($fp) -sw $t1, -24($fp) -# GOTO label_ENDIF_6 -j label_ENDIF_6 -label_FALSEIF_5: - # LOCAL local_pal_at_Main_internal_12 --> -52($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_12 = PARAM param_pal_at_Main_s_0 - lw $t1, 0($fp) - sw $t1, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 0 - li $t1, 0 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # ARG 1 - li $t1, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_pal_at_Main_internal_12 --> -52($fp) - # LOCAL local_pal_at_Main_internal_13 --> -56($fp) - # local_pal_at_Main_internal_13 = VCALL local_pal_at_Main_internal_12 substr - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 16($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_14 --> -60($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_14 = PARAM param_pal_at_Main_s_0 - lw $t1, 0($fp) - sw $t1, -60($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_17 --> -72($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_17 = PARAM param_pal_at_Main_s_0 - lw $t1, 0($fp) - sw $t1, -72($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_17 --> -72($fp) - # LOCAL local_pal_at_Main_internal_18 --> -76($fp) - # local_pal_at_Main_internal_18 = VCALL local_pal_at_Main_internal_17 length - # Save new self pointer in $s1 - lw $s1, -72($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -76($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_16 --> -68($fp) - # LOCAL local_pal_at_Main_internal_18 --> -76($fp) - # local_pal_at_Main_internal_16 = local_pal_at_Main_internal_18 - 1 - lw $t1, -76($fp) - sub $t1, $t1, 1 - sw $t1, -68($fp) - # ARG local_pal_at_Main_internal_16 - # LOCAL local_pal_at_Main_internal_16 --> -68($fp) - lw $t1, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # ARG 1 - li $t1, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_pal_at_Main_internal_14 --> -60($fp) - # LOCAL local_pal_at_Main_internal_15 --> -64($fp) - # local_pal_at_Main_internal_15 = VCALL local_pal_at_Main_internal_14 substr - # Save new self pointer in $s1 - lw $s1, -60($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 16($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -64($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_11 --> -48($fp) - # LOCAL local_pal_at_Main_internal_13 --> -56($fp) - # LOCAL local_pal_at_Main_internal_15 --> -64($fp) - # local_pal_at_Main_internal_11 = local_pal_at_Main_internal_13 - local_pal_at_Main_internal_15 - lw $t1, -56($fp) - lw $t2, -64($fp) - sub $t1, $t1, $t2 - sw $t1, -48($fp) - # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_11 - # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_11 - lw $t1, -48($fp) - beq $t1, 0, label_TRUE_11 - # LOCAL local_pal_at_Main_internal_11 --> -48($fp) - # local_pal_at_Main_internal_11 = 0 - li $t1, 0 - sw $t1, -48($fp) - # GOTO label_END_12 -j label_END_12 -label_TRUE_11: - # LOCAL local_pal_at_Main_internal_11 --> -48($fp) - # local_pal_at_Main_internal_11 = 1 - li $t1, 1 - sw $t1, -48($fp) - label_END_12: -# IF_ZERO local_pal_at_Main_internal_11 GOTO label_FALSEIF_9 -# IF_ZERO local_pal_at_Main_internal_11 GOTO label_FALSEIF_9 -lw $t1, -48($fp) -beq $t1, 0, label_FALSEIF_9 -# LOCAL local_pal_at_Main_internal_21 --> -88($fp) -# local_pal_at_Main_internal_21 = SELF -sw $s1, -88($fp) -# LOCAL local_pal_at_Main_internal_19 --> -80($fp) -# LOCAL local_pal_at_Main_internal_21 --> -88($fp) -# local_pal_at_Main_internal_19 = local_pal_at_Main_internal_21 -lw $t1, -88($fp) -sw $t1, -80($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_pal_at_Main_internal_22 --> -92($fp) -# PARAM param_pal_at_Main_s_0 --> 0($fp) -# local_pal_at_Main_internal_22 = PARAM param_pal_at_Main_s_0 -lw $t1, 0($fp) -sw $t1, -92($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG 1 -li $t1, 1 -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_pal_at_Main_internal_25 --> -104($fp) -# PARAM param_pal_at_Main_s_0 --> 0($fp) -# local_pal_at_Main_internal_25 = PARAM param_pal_at_Main_s_0 -lw $t1, 0($fp) -sw $t1, -104($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_pal_at_Main_internal_25 --> -104($fp) -# LOCAL local_pal_at_Main_internal_26 --> -108($fp) -# local_pal_at_Main_internal_26 = VCALL local_pal_at_Main_internal_25 length -# Save new self pointer in $s1 -lw $s1, -104($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 20($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -108($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_pal_at_Main_internal_24 --> -100($fp) -# LOCAL local_pal_at_Main_internal_26 --> -108($fp) -# local_pal_at_Main_internal_24 = local_pal_at_Main_internal_26 - 2 -lw $t1, -108($fp) -sub $t1, $t1, 2 -sw $t1, -100($fp) -# ARG local_pal_at_Main_internal_24 -# LOCAL local_pal_at_Main_internal_24 --> -100($fp) -lw $t1, -100($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_pal_at_Main_internal_22 --> -92($fp) -# LOCAL local_pal_at_Main_internal_23 --> -96($fp) -# local_pal_at_Main_internal_23 = VCALL local_pal_at_Main_internal_22 substr -# Save new self pointer in $s1 -lw $s1, -92($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 16($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -96($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_pal_at_Main_internal_23 -# LOCAL local_pal_at_Main_internal_23 --> -96($fp) -lw $t1, -96($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_pal_at_Main_internal_19 --> -80($fp) -# LOCAL local_pal_at_Main_internal_20 --> -84($fp) -# local_pal_at_Main_internal_20 = VCALL local_pal_at_Main_internal_19 pal -# Save new self pointer in $s1 -lw $s1, -80($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 28($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -84($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_pal_at_Main_internal_10 --> -44($fp) -# LOCAL local_pal_at_Main_internal_20 --> -84($fp) -# local_pal_at_Main_internal_10 = local_pal_at_Main_internal_20 -lw $t1, -84($fp) -sw $t1, -44($fp) -# GOTO label_ENDIF_10 -j label_ENDIF_10 -label_FALSEIF_9: - # LOCAL local_pal_at_Main_internal_27 --> -112($fp) - # local_pal_at_Main_internal_27 = 0 - li $t1, 0 - sw $t1, -112($fp) - # LOCAL local_pal_at_Main_internal_10 --> -44($fp) - # LOCAL local_pal_at_Main_internal_27 --> -112($fp) - # local_pal_at_Main_internal_10 = local_pal_at_Main_internal_27 - lw $t1, -112($fp) - sw $t1, -44($fp) - label_ENDIF_10: -# LOCAL local_pal_at_Main_internal_5 --> -24($fp) -# LOCAL local_pal_at_Main_internal_10 --> -44($fp) -# local_pal_at_Main_internal_5 = local_pal_at_Main_internal_10 -lw $t1, -44($fp) -sw $t1, -24($fp) -label_ENDIF_6: -# LOCAL local_pal_at_Main_internal_0 --> -4($fp) -# LOCAL local_pal_at_Main_internal_5 --> -24($fp) -# local_pal_at_Main_internal_0 = local_pal_at_Main_internal_5 -lw $t1, -24($fp) -sw $t1, -4($fp) -label_ENDIF_2: -# RETURN local_pal_at_Main_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_pal_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 120 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 88 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 88 - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - lw $t1, 1 - not $t1, $t1 - sw $t1, -4($fp) - # - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - lw $t1, -4($fp) - sw $t1, 12($s1) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t1, -16($fp) - sw $t1, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_2 - sw $t1, 12($v0) - li $t1, 15 - sw $t1, 16($v0) - sw $v0, -20($fp) - # ARG local_main_at_Main_internal_4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - lw $t1, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 out_string - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = SELF - sw $s1, -36($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 in_string - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_10 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - lw $t1, -44($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 pal - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 28($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # IF_ZERO local_main_at_Main_internal_7 GOTO label_FALSEIF_13 - # IF_ZERO local_main_at_Main_internal_7 GOTO label_FALSEIF_13 - lw $t1, -32($fp) - beq $t1, 0, label_FALSEIF_13 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 - lw $t1, -60($fp) - sw $t1, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_3 - sw $t1, 12($v0) - li $t1, 22 - sw $t1, 16($v0) - sw $v0, -64($fp) - # ARG local_main_at_Main_internal_15 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - lw $t1, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_5 = local_main_at_Main_internal_13 - lw $t1, -56($fp) - sw $t1, -24($fp) - # GOTO label_ENDIF_14 -j label_ENDIF_14 -label_FALSEIF_13: - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 - lw $t1, -76($fp) - sw $t1, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_4 - sw $t1, 12($v0) - li $t1, 26 - sw $t1, 16($v0) - sw $v0, -80($fp) - # ARG local_main_at_Main_internal_19 - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - lw $t1, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_5 = local_main_at_Main_internal_17 - lw $t1, -72($fp) - sw $t1, -24($fp) - label_ENDIF_14: -# RETURN local_main_at_Main_internal_5 -lw $v0, -24($fp) -# Deallocate stack frame for function function_main_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 88 -jr $ra -# Function END - diff --git a/tests/codegen/primes.mips b/tests/codegen/primes.mips deleted file mode 100644 index e203556e..00000000 --- a/tests/codegen/primes.mips +++ /dev/null @@ -1,1282 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:17 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -IO__TDT: .word 0, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, 0 -# - - -data_2: .asciiz "2 is trivially prime.\n" -# - - -data_3: .asciiz " is prime.\n" -# - - -data_4: .asciiz "halt" -# - - -data_5: .asciiz "continue" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - li $a0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 32 bytes of memory - li $a0, 32 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) - # Load type offset - li $t2, 16 - sw $t2, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__out__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__testee__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__divisor__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__stop__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__m__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t1, Main_vtable - # Get pointer to function address - lw $t2, 28($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__out__init implementation. -# @Params: -__Main__attrib__out__init: - # Allocate stack frame for function __Main__attrib__out__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__out__init_internal_2 --> -12($fp) - # local_ttrib__out__init_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_ttrib__out__init_internal_0 --> -4($fp) - # LOCAL local_ttrib__out__init_internal_2 --> -12($fp) - # local_ttrib__out__init_internal_0 = local_ttrib__out__init_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_ttrib__out__init_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_2 - sw $t1, 12($v0) - li $t1, 22 - sw $t1, 16($v0) - sw $v0, -16($fp) - # ARG local_ttrib__out__init_internal_3 - # LOCAL local_ttrib__out__init_internal_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_ttrib__out__init_internal_0 --> -4($fp) - # LOCAL local_ttrib__out__init_internal_1 --> -8($fp) - # local_ttrib__out__init_internal_1 = VCALL local_ttrib__out__init_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN 2 - li $v0, 2 - # Deallocate stack frame for function __Main__attrib__out__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__testee__init implementation. -# @Params: -__Main__attrib__testee__init: - # Allocate stack frame for function __Main__attrib__testee__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_ttrib__testee__init_internal_0 = GETATTRIBUTE out Main - # LOCAL local_ttrib__testee__init_internal_0 --> -4($fp) - lw $t1, 12($s1) - sw $t1, -4($fp) - # RETURN local_ttrib__testee__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Main__attrib__testee__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__divisor__init implementation. -# @Params: -__Main__attrib__divisor__init: - # Allocate stack frame for function __Main__attrib__divisor__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Main__attrib__divisor__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__stop__init implementation. -# @Params: -__Main__attrib__stop__init: - # Allocate stack frame for function __Main__attrib__stop__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 500 - li $v0, 500 - # Deallocate stack frame for function __Main__attrib__stop__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__m__init implementation. -# @Params: -__Main__attrib__m__init: - # Allocate stack frame for function __Main__attrib__m__init. - subu $sp, $sp, 192 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 192 - label_WHILE_1: - # LOCAL local_ttrib__m__init_internal_0 --> -4($fp) - # local_ttrib__m__init_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - # IF_ZERO local_ttrib__m__init_internal_0 GOTO label_WHILE_END_2 - # IF_ZERO local_ttrib__m__init_internal_0 GOTO label_WHILE_END_2 - lw $t1, -4($fp) - beq $t1, 0, label_WHILE_END_2 - # local_ttrib__m__init_internal_2 = GETATTRIBUTE testee Main - # LOCAL local_ttrib__m__init_internal_2 --> -12($fp) - lw $t1, 16($s1) - sw $t1, -12($fp) - # LOCAL local_ttrib__m__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__m__init_internal_2 --> -12($fp) - # local_ttrib__m__init_internal_1 = local_ttrib__m__init_internal_2 + 1 - lw $t1, -12($fp) - add $t1, $t1, 1 - sw $t1, -8($fp) - # - # LOCAL local_ttrib__m__init_internal_1 --> -8($fp) - lw $t1, -8($fp) - sw $t1, 16($s1) - # - li $t1, 2 - sw $t1, 20($s1) - label_WHILE_3: - # local_ttrib__m__init_internal_5 = GETATTRIBUTE testee Main - # LOCAL local_ttrib__m__init_internal_5 --> -24($fp) - lw $t1, 16($s1) - sw $t1, -24($fp) - # local_ttrib__m__init_internal_7 = GETATTRIBUTE divisor Main - # LOCAL local_ttrib__m__init_internal_7 --> -32($fp) - lw $t1, 20($s1) - sw $t1, -32($fp) - # local_ttrib__m__init_internal_8 = GETATTRIBUTE divisor Main - # LOCAL local_ttrib__m__init_internal_8 --> -36($fp) - lw $t1, 20($s1) - sw $t1, -36($fp) - # LOCAL local_ttrib__m__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__m__init_internal_7 --> -32($fp) - # LOCAL local_ttrib__m__init_internal_8 --> -36($fp) - # local_ttrib__m__init_internal_6 = local_ttrib__m__init_internal_7 * local_ttrib__m__init_internal_8 - lw $t1, -32($fp) - lw $t2, -36($fp) - mul $t1, $t1, $t2 - sw $t1, -28($fp) - # LOCAL local_ttrib__m__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__m__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__m__init_internal_6 --> -28($fp) - # local_ttrib__m__init_internal_4 = local_ttrib__m__init_internal_5 - local_ttrib__m__init_internal_6 - lw $t1, -24($fp) - lw $t2, -28($fp) - sub $t1, $t1, $t2 - sw $t1, -20($fp) - # IF_GREATER_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSE_7 - # IF_GREATER_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSE_7 - lw $t1, -20($fp) - bgt $t1, 0, label_FALSE_7 - # IF_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSE_7 - # IF_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSE_7 - lw $t1, -20($fp) - beq $t1, 0, label_FALSE_7 - # LOCAL local_ttrib__m__init_internal_4 --> -20($fp) - # local_ttrib__m__init_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) - # GOTO label_END_8 -j label_END_8 -label_FALSE_7: - # LOCAL local_ttrib__m__init_internal_4 --> -20($fp) - # local_ttrib__m__init_internal_4 = 0 - li $t1, 0 - sw $t1, -20($fp) - label_END_8: -# IF_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSEIF_5 -# IF_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSEIF_5 -lw $t1, -20($fp) -beq $t1, 0, label_FALSEIF_5 -# LOCAL local_ttrib__m__init_internal_9 --> -40($fp) -# local_ttrib__m__init_internal_9 = 0 -li $t1, 0 -sw $t1, -40($fp) -# LOCAL local_ttrib__m__init_internal_3 --> -16($fp) -# LOCAL local_ttrib__m__init_internal_9 --> -40($fp) -# local_ttrib__m__init_internal_3 = local_ttrib__m__init_internal_9 -lw $t1, -40($fp) -sw $t1, -16($fp) -# GOTO label_ENDIF_6 -j label_ENDIF_6 -label_FALSEIF_5: - # local_ttrib__m__init_internal_13 = GETATTRIBUTE testee Main - # LOCAL local_ttrib__m__init_internal_13 --> -56($fp) - lw $t1, 16($s1) - sw $t1, -56($fp) - # local_ttrib__m__init_internal_15 = GETATTRIBUTE divisor Main - # LOCAL local_ttrib__m__init_internal_15 --> -64($fp) - lw $t1, 20($s1) - sw $t1, -64($fp) - # local_ttrib__m__init_internal_17 = GETATTRIBUTE testee Main - # LOCAL local_ttrib__m__init_internal_17 --> -72($fp) - lw $t1, 16($s1) - sw $t1, -72($fp) - # local_ttrib__m__init_internal_18 = GETATTRIBUTE divisor Main - # LOCAL local_ttrib__m__init_internal_18 --> -76($fp) - lw $t1, 20($s1) - sw $t1, -76($fp) - # LOCAL local_ttrib__m__init_internal_16 --> -68($fp) - # LOCAL local_ttrib__m__init_internal_17 --> -72($fp) - # LOCAL local_ttrib__m__init_internal_18 --> -76($fp) - # local_ttrib__m__init_internal_16 = local_ttrib__m__init_internal_17 / local_ttrib__m__init_internal_18 - lw $t1, -72($fp) - lw $t2, -76($fp) - div $t1, $t1, $t2 - sw $t1, -68($fp) - # LOCAL local_ttrib__m__init_internal_14 --> -60($fp) - # LOCAL local_ttrib__m__init_internal_15 --> -64($fp) - # LOCAL local_ttrib__m__init_internal_16 --> -68($fp) - # local_ttrib__m__init_internal_14 = local_ttrib__m__init_internal_15 * local_ttrib__m__init_internal_16 - lw $t1, -64($fp) - lw $t2, -68($fp) - mul $t1, $t1, $t2 - sw $t1, -60($fp) - # LOCAL local_ttrib__m__init_internal_12 --> -52($fp) - # LOCAL local_ttrib__m__init_internal_13 --> -56($fp) - # LOCAL local_ttrib__m__init_internal_14 --> -60($fp) - # local_ttrib__m__init_internal_12 = local_ttrib__m__init_internal_13 - local_ttrib__m__init_internal_14 - lw $t1, -56($fp) - lw $t2, -60($fp) - sub $t1, $t1, $t2 - sw $t1, -52($fp) - # LOCAL local_ttrib__m__init_internal_11 --> -48($fp) - # LOCAL local_ttrib__m__init_internal_12 --> -52($fp) - # local_ttrib__m__init_internal_11 = local_ttrib__m__init_internal_12 - 0 - lw $t1, -52($fp) - sub $t1, $t1, 0 - sw $t1, -48($fp) - # IF_ZERO local_ttrib__m__init_internal_11 GOTO label_TRUE_11 - # IF_ZERO local_ttrib__m__init_internal_11 GOTO label_TRUE_11 - lw $t1, -48($fp) - beq $t1, 0, label_TRUE_11 - # LOCAL local_ttrib__m__init_internal_11 --> -48($fp) - # local_ttrib__m__init_internal_11 = 0 - li $t1, 0 - sw $t1, -48($fp) - # GOTO label_END_12 -j label_END_12 -label_TRUE_11: - # LOCAL local_ttrib__m__init_internal_11 --> -48($fp) - # local_ttrib__m__init_internal_11 = 1 - li $t1, 1 - sw $t1, -48($fp) - label_END_12: -# IF_ZERO local_ttrib__m__init_internal_11 GOTO label_FALSEIF_9 -# IF_ZERO local_ttrib__m__init_internal_11 GOTO label_FALSEIF_9 -lw $t1, -48($fp) -beq $t1, 0, label_FALSEIF_9 -# LOCAL local_ttrib__m__init_internal_19 --> -80($fp) -# local_ttrib__m__init_internal_19 = 0 -li $t1, 0 -sw $t1, -80($fp) -# LOCAL local_ttrib__m__init_internal_10 --> -44($fp) -# LOCAL local_ttrib__m__init_internal_19 --> -80($fp) -# local_ttrib__m__init_internal_10 = local_ttrib__m__init_internal_19 -lw $t1, -80($fp) -sw $t1, -44($fp) -# GOTO label_ENDIF_10 -j label_ENDIF_10 -label_FALSEIF_9: - # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) - # local_ttrib__m__init_internal_20 = 1 - li $t1, 1 - sw $t1, -84($fp) - # LOCAL local_ttrib__m__init_internal_10 --> -44($fp) - # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) - # local_ttrib__m__init_internal_10 = local_ttrib__m__init_internal_20 - lw $t1, -84($fp) - sw $t1, -44($fp) - label_ENDIF_10: -# LOCAL local_ttrib__m__init_internal_3 --> -16($fp) -# LOCAL local_ttrib__m__init_internal_10 --> -44($fp) -# local_ttrib__m__init_internal_3 = local_ttrib__m__init_internal_10 -lw $t1, -44($fp) -sw $t1, -16($fp) -label_ENDIF_6: -# IF_ZERO local_ttrib__m__init_internal_3 GOTO label_WHILE_END_4 -# IF_ZERO local_ttrib__m__init_internal_3 GOTO label_WHILE_END_4 -lw $t1, -16($fp) -beq $t1, 0, label_WHILE_END_4 -# local_ttrib__m__init_internal_22 = GETATTRIBUTE divisor Main -# LOCAL local_ttrib__m__init_internal_22 --> -92($fp) -lw $t1, 20($s1) -sw $t1, -92($fp) -# LOCAL local_ttrib__m__init_internal_21 --> -88($fp) -# LOCAL local_ttrib__m__init_internal_22 --> -92($fp) -# local_ttrib__m__init_internal_21 = local_ttrib__m__init_internal_22 + 1 -lw $t1, -92($fp) -add $t1, $t1, 1 -sw $t1, -88($fp) -# -# LOCAL local_ttrib__m__init_internal_21 --> -88($fp) -lw $t1, -88($fp) -sw $t1, 20($s1) -# GOTO label_WHILE_3 -j label_WHILE_3 -label_WHILE_END_4: - # local_ttrib__m__init_internal_25 = GETATTRIBUTE testee Main - # LOCAL local_ttrib__m__init_internal_25 --> -104($fp) - lw $t1, 16($s1) - sw $t1, -104($fp) - # local_ttrib__m__init_internal_27 = GETATTRIBUTE divisor Main - # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) - lw $t1, 20($s1) - sw $t1, -112($fp) - # local_ttrib__m__init_internal_28 = GETATTRIBUTE divisor Main - # LOCAL local_ttrib__m__init_internal_28 --> -116($fp) - lw $t1, 20($s1) - sw $t1, -116($fp) - # LOCAL local_ttrib__m__init_internal_26 --> -108($fp) - # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) - # LOCAL local_ttrib__m__init_internal_28 --> -116($fp) - # local_ttrib__m__init_internal_26 = local_ttrib__m__init_internal_27 * local_ttrib__m__init_internal_28 - lw $t1, -112($fp) - lw $t2, -116($fp) - mul $t1, $t1, $t2 - sw $t1, -108($fp) - # LOCAL local_ttrib__m__init_internal_24 --> -100($fp) - # LOCAL local_ttrib__m__init_internal_25 --> -104($fp) - # LOCAL local_ttrib__m__init_internal_26 --> -108($fp) - # local_ttrib__m__init_internal_24 = local_ttrib__m__init_internal_25 - local_ttrib__m__init_internal_26 - lw $t1, -104($fp) - lw $t2, -108($fp) - sub $t1, $t1, $t2 - sw $t1, -100($fp) - # IF_GREATER_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSE_15 - # IF_GREATER_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSE_15 - lw $t1, -100($fp) - bgt $t1, 0, label_FALSE_15 - # IF_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSE_15 - # IF_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSE_15 - lw $t1, -100($fp) - beq $t1, 0, label_FALSE_15 - # LOCAL local_ttrib__m__init_internal_24 --> -100($fp) - # local_ttrib__m__init_internal_24 = 1 - li $t1, 1 - sw $t1, -100($fp) - # GOTO label_END_16 -j label_END_16 -label_FALSE_15: - # LOCAL local_ttrib__m__init_internal_24 --> -100($fp) - # local_ttrib__m__init_internal_24 = 0 - li $t1, 0 - sw $t1, -100($fp) - label_END_16: -# IF_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSEIF_13 -# IF_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSEIF_13 -lw $t1, -100($fp) -beq $t1, 0, label_FALSEIF_13 -# local_ttrib__m__init_internal_29 = GETATTRIBUTE testee Main -# LOCAL local_ttrib__m__init_internal_29 --> -120($fp) -lw $t1, 16($s1) -sw $t1, -120($fp) -# -# LOCAL local_ttrib__m__init_internal_29 --> -120($fp) -lw $t1, -120($fp) -sw $t1, 12($s1) -# LOCAL local_ttrib__m__init_internal_32 --> -132($fp) -# local_ttrib__m__init_internal_32 = SELF -sw $s1, -132($fp) -# LOCAL local_ttrib__m__init_internal_30 --> -124($fp) -# LOCAL local_ttrib__m__init_internal_32 --> -132($fp) -# local_ttrib__m__init_internal_30 = local_ttrib__m__init_internal_32 -lw $t1, -132($fp) -sw $t1, -124($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_ttrib__m__init_internal_33 = GETATTRIBUTE out Main -# LOCAL local_ttrib__m__init_internal_33 --> -136($fp) -lw $t1, 12($s1) -sw $t1, -136($fp) -# ARG local_ttrib__m__init_internal_33 -# LOCAL local_ttrib__m__init_internal_33 --> -136($fp) -lw $t1, -136($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_ttrib__m__init_internal_30 --> -124($fp) -# LOCAL local_ttrib__m__init_internal_31 --> -128($fp) -# local_ttrib__m__init_internal_31 = VCALL local_ttrib__m__init_internal_30 out_int -# Save new self pointer in $s1 -lw $s1, -124($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 16($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -128($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_ttrib__m__init_internal_36 --> -148($fp) -# local_ttrib__m__init_internal_36 = SELF -sw $s1, -148($fp) -# LOCAL local_ttrib__m__init_internal_34 --> -140($fp) -# LOCAL local_ttrib__m__init_internal_36 --> -148($fp) -# local_ttrib__m__init_internal_34 = local_ttrib__m__init_internal_36 -lw $t1, -148($fp) -sw $t1, -140($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_ttrib__m__init_internal_37 --> -152($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_3 -sw $t1, 12($v0) -li $t1, 11 -sw $t1, 16($v0) -sw $v0, -152($fp) -# ARG local_ttrib__m__init_internal_37 -# LOCAL local_ttrib__m__init_internal_37 --> -152($fp) -lw $t1, -152($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_ttrib__m__init_internal_34 --> -140($fp) -# LOCAL local_ttrib__m__init_internal_35 --> -144($fp) -# local_ttrib__m__init_internal_35 = VCALL local_ttrib__m__init_internal_34 out_string -# Save new self pointer in $s1 -lw $s1, -140($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 12($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -144($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_ttrib__m__init_internal_23 --> -96($fp) -# LOCAL local_ttrib__m__init_internal_35 --> -144($fp) -# local_ttrib__m__init_internal_23 = local_ttrib__m__init_internal_35 -lw $t1, -144($fp) -sw $t1, -96($fp) -# GOTO label_ENDIF_14 -j label_ENDIF_14 -label_FALSEIF_13: - # LOCAL local_ttrib__m__init_internal_23 --> -96($fp) - # local_ttrib__m__init_internal_23 = 0 - li $t1, 0 - sw $t1, -96($fp) - label_ENDIF_14: -# local_ttrib__m__init_internal_40 = GETATTRIBUTE stop Main -# LOCAL local_ttrib__m__init_internal_40 --> -164($fp) -lw $t1, 24($s1) -sw $t1, -164($fp) -# local_ttrib__m__init_internal_41 = GETATTRIBUTE testee Main -# LOCAL local_ttrib__m__init_internal_41 --> -168($fp) -lw $t1, 16($s1) -sw $t1, -168($fp) -# LOCAL local_ttrib__m__init_internal_39 --> -160($fp) -# LOCAL local_ttrib__m__init_internal_40 --> -164($fp) -# LOCAL local_ttrib__m__init_internal_41 --> -168($fp) -# local_ttrib__m__init_internal_39 = local_ttrib__m__init_internal_40 - local_ttrib__m__init_internal_41 -lw $t1, -164($fp) -lw $t2, -168($fp) -sub $t1, $t1, $t2 -sw $t1, -160($fp) -# IF_GREATER_ZERO local_ttrib__m__init_internal_39 GOTO label_FALSE_19 -# IF_GREATER_ZERO local_ttrib__m__init_internal_39 GOTO label_FALSE_19 -lw $t1, -160($fp) -bgt $t1, 0, label_FALSE_19 -# LOCAL local_ttrib__m__init_internal_39 --> -160($fp) -# local_ttrib__m__init_internal_39 = 1 -li $t1, 1 -sw $t1, -160($fp) -# GOTO label_END_20 -j label_END_20 -label_FALSE_19: - # LOCAL local_ttrib__m__init_internal_39 --> -160($fp) - # local_ttrib__m__init_internal_39 = 0 - li $t1, 0 - sw $t1, -160($fp) - label_END_20: -# IF_ZERO local_ttrib__m__init_internal_39 GOTO label_FALSEIF_17 -# IF_ZERO local_ttrib__m__init_internal_39 GOTO label_FALSEIF_17 -lw $t1, -160($fp) -beq $t1, 0, label_FALSEIF_17 -# LOCAL local_ttrib__m__init_internal_44 --> -180($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_4 -sw $t1, 12($v0) -li $t1, 4 -sw $t1, 16($v0) -sw $v0, -180($fp) -# LOCAL local_ttrib__m__init_internal_42 --> -172($fp) -# LOCAL local_ttrib__m__init_internal_44 --> -180($fp) -# local_ttrib__m__init_internal_42 = local_ttrib__m__init_internal_44 -lw $t1, -180($fp) -sw $t1, -172($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_ttrib__m__init_internal_42 --> -172($fp) -# LOCAL local_ttrib__m__init_internal_43 --> -176($fp) -# local_ttrib__m__init_internal_43 = VCALL local_ttrib__m__init_internal_42 abort -# Save new self pointer in $s1 -lw $s1, -172($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 0($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -176($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_ttrib__m__init_internal_38 --> -156($fp) -# LOCAL local_ttrib__m__init_internal_43 --> -176($fp) -# local_ttrib__m__init_internal_38 = local_ttrib__m__init_internal_43 -lw $t1, -176($fp) -sw $t1, -156($fp) -# GOTO label_ENDIF_18 -j label_ENDIF_18 -label_FALSEIF_17: - # LOCAL local_ttrib__m__init_internal_45 --> -184($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_5 - sw $t1, 12($v0) - li $t1, 8 - sw $t1, 16($v0) - sw $v0, -184($fp) - # LOCAL local_ttrib__m__init_internal_38 --> -156($fp) - # LOCAL local_ttrib__m__init_internal_45 --> -184($fp) - # local_ttrib__m__init_internal_38 = local_ttrib__m__init_internal_45 - lw $t1, -184($fp) - sw $t1, -156($fp) - label_ENDIF_18: -# GOTO label_WHILE_1 -j label_WHILE_1 -label_WHILE_END_2: - # RETURN - # Deallocate stack frame for function __Main__attrib__m__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 192 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - diff --git a/tests/codegen/print-cool.mips b/tests/codegen/print-cool.mips deleted file mode 100644 index e569413a..00000000 --- a/tests/codegen/print-cool.mips +++ /dev/null @@ -1,929 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 00:50:18 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -IO__TDT: .word 0, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, 0 -# - - -data_2: .asciiz "\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - li $a0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) - # Load type offset - li $t2, 16 - sw $t2, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t1, Main_vtable - # Get pointer to function address - lw $t2, 28($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 88 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 88 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = SELF - sw $s1, -20($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 - lw $t1, -20($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = ALLOCATE Object - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Object - sw $t3, 12($v0) - li $t3, 6 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Object_start - sw $t3, 4($v0) - # Load type offset - li $t3, 4 - sw $t3, 8($v0) - move $t2, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t2, -40($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t2, -40($fp) - sw $t2, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 type_name - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 4($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_5 = local_main_at_Main_internal_8 - lw $t2, -36($fp) - sw $t2, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 4 - li $t2, 4 - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # ARG 1 - li $t2, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # local_main_at_Main_internal_6 = VCALL local_main_at_Main_internal_5 substr - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 16($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_6 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - lw $t2, -28($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 12($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 - lw $t2, -16($fp) - sw $t2, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = SELF - sw $s1, -64($fp) - # IF_ZERO local_main_at_Main_internal_15 GOTO label_TRUE_1 - # IF_ZERO local_main_at_Main_internal_15 GOTO label_TRUE_1 - lw $t2, -64($fp) - beq $t2, 0, label_TRUE_1 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Bool - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Bool_start - sw $t2, 4($v0) - li $t2, 0 - sw $t2, 8($v0) - sw $v0, -60($fp) - # GOTO label_END_2 -j label_END_2 -label_TRUE_1: - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Bool - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Bool_start - sw $t2, 4($v0) - li $t2, 1 - sw $t2, 8($v0) - sw $v0, -60($fp) - label_END_2: -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# LOCAL local_main_at_Main_internal_14 --> -60($fp) -# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 -lw $t2, -60($fp) -sw $t2, -52($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 type_name -# Save new self pointer in $s1 -lw $s1, -52($fp) -# Get pointer to type -lw $t2, 4($s1) -# Get pointer to type's VTABLE -lw $t3, 0($t2) -# Get pointer to function address -lw $t4, 4($t3) -# Call function. Result is on $v0 -jalr $t4 -sw $v0, -56($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_10 --> -44($fp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# local_main_at_Main_internal_10 = local_main_at_Main_internal_13 -lw $t2, -56($fp) -sw $t2, -44($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG 1 -li $t2, 1 -# Push arg into stack -subu $sp, $sp, 4 -sw $t2, 0($sp) -# ARG 3 -li $t2, 3 -# Push arg into stack -subu $sp, $sp, 4 -sw $t2, 0($sp) -# LOCAL local_main_at_Main_internal_10 --> -44($fp) -# LOCAL local_main_at_Main_internal_11 --> -48($fp) -# local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 substr -# Save new self pointer in $s1 -lw $s1, -44($fp) -# Get pointer to type -lw $t2, 4($s1) -# Get pointer to type's VTABLE -lw $t3, 0($t2) -# Get pointer to function address -lw $t4, 16($t3) -# Call function. Result is on $v0 -jalr $t4 -sw $v0, -48($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_11 -# LOCAL local_main_at_Main_internal_11 --> -48($fp) -lw $t2, -48($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t2, 0($sp) -# LOCAL local_main_at_Main_internal_0 --> -4($fp) -# LOCAL local_main_at_Main_internal_1 --> -8($fp) -# local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string -# Save new self pointer in $s1 -lw $s1, -4($fp) -# Get pointer to type -lw $t2, 4($s1) -# Get pointer to type's VTABLE -lw $t3, 0($t2) -# Get pointer to function address -lw $t4, 12($t3) -# Call function. Result is on $v0 -jalr $t4 -sw $v0, -8($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# local_main_at_Main_internal_18 = SELF -sw $s1, -76($fp) -# LOCAL local_main_at_Main_internal_16 --> -68($fp) -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# local_main_at_Main_internal_16 = local_main_at_Main_internal_18 -lw $t2, -76($fp) -sw $t2, -68($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t2, String -sw $t2, 0($v0) -la $t2, String_start -sw $t2, 4($v0) -# Load type offset -li $t2, 8 -sw $t2, 8($v0) -la $t2, data_2 -sw $t2, 12($v0) -li $t2, 1 -sw $t2, 16($v0) -sw $v0, -80($fp) -# ARG local_main_at_Main_internal_19 -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -lw $t2, -80($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t2, 0($sp) -# LOCAL local_main_at_Main_internal_16 --> -68($fp) -# LOCAL local_main_at_Main_internal_17 --> -72($fp) -# local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string -# Save new self pointer in $s1 -lw $s1, -68($fp) -# Get pointer to type -lw $t2, 4($s1) -# Get pointer to type's VTABLE -lw $t3, 0($t2) -# Get pointer to function address -lw $t4, 12($t3) -# Call function. Result is on $v0 -jalr $t4 -sw $v0, -72($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# RETURN local_main_at_Main_internal_17 -lw $v0, -72($fp) -# Deallocate stack frame for function function_main_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 88 -jr $ra -# Function END - From 03b8ba6a73cfd663a7f0d36248715573185f8350 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sun, 6 Dec 2020 12:44:33 -0500 Subject: [PATCH 150/162] Fixing scoping --- src/cil/baseCilVisitor.py | 33 +- src/pycoolc.py | 2 +- src/testing.mips | 8 +- src/testing.py | 2 +- src/travels/ctcill.py | 46 +- src/travels/inference.py | 33 +- tests/codegen/atoi.mips | 3559 +++++++++++++ tests/codegen/book_list.mips | 3012 +++++++++++ tests/codegen/complex.mips | 1629 ++++++ tests/codegen/fib.mips | 931 ++++ tests/codegen/hairyscary.mips | 2687 ++++++++++ tests/codegen/hello_world.mips | 663 +++ tests/codegen/io.mips | 1368 +++++ tests/codegen/life.mips | 8661 ++++++++++++++++++++++++++++++++ tests/codegen/list.mips | 1679 +++++++ tests/codegen/new_complex.mips | 2068 ++++++++ tests/codegen/palindrome.mips | 1303 +++++ tests/codegen/primes.mips | 1306 +++++ tests/codegen/print-cool.mips | 953 ++++ 19 files changed, 29903 insertions(+), 40 deletions(-) create mode 100644 tests/codegen/atoi.mips create mode 100644 tests/codegen/book_list.mips create mode 100644 tests/codegen/complex.mips create mode 100644 tests/codegen/fib.mips create mode 100644 tests/codegen/hairyscary.mips create mode 100644 tests/codegen/hello_world.mips create mode 100644 tests/codegen/io.mips create mode 100644 tests/codegen/life.mips create mode 100644 tests/codegen/list.mips create mode 100644 tests/codegen/new_complex.mips create mode 100644 tests/codegen/palindrome.mips create mode 100644 tests/codegen/primes.mips create mode 100644 tests/codegen/print-cool.mips diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index e7272a5e..5e29bd31 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -1,14 +1,21 @@ +import re from typing import List, Optional, Any, Dict, Tuple +from abstract.tree import ClassDef import cil.nodes as nodes from abstract.semantics import Attribute, VariableInfo, Context, Type, Method from cil.nodes import ( - AbortNode, AllocateStringNode, ConcatString, CopyNode, GetAttributeNode, + AbortNode, + AllocateStringNode, + ConcatString, + CopyNode, + GetAttributeNode, PrintIntNode, PrintNode, ReadIntNode, ReadNode, ReturnNode, - SelfNode, SubstringNode, + SelfNode, + SubstringNode, TypeName, TypeNode, ) @@ -81,6 +88,13 @@ def __dfs(self, root: str, visited: Dict[str, bool], deep=0): self.__time += 1 self._finalization[root] = self.__time + def tp_sort(self, root: str, visited: Dict[str, bool], result): + visited[root] = True + for v in self._adytable[root]: + if not visited[v]: + self.tp_sort(v, visited, result) + result.append(root) + def build_tdt(self): # Construir una tabla de distancia para cada Nodo del arbol. # En dicha tabla, tdt[x, y] = d donde d es la distancia entre @@ -117,10 +131,19 @@ def __init__(self, context: Context): self.null = self.register_data('""') self.abortion = self.register_data('"Abort called from class "') self.newLine = self.register_data(r'"\n"') + self.__inheritance_graph = None self.__labels_count: int = 0 self.__build_CART() self.build_builtins() + def topological_sort_classDefs(self, classdef: List[ClassDef]): + visited = {x: False for x in self.__inheritance_graph._adytable} + result = [] + self.__inheritance_graph.tp_sort("Object", visited, result) + l = [x for x in result if x in [y.idx for y in classdef]] + l = [next(c for c in classdef if c.idx == x) for x in l] + return list(reversed(l)) + @property def params(self) -> List[nodes.ParamNode]: # Obtener los parametros de la funcion que esta actualmente en construccion @@ -207,6 +230,7 @@ def __build_CART(self) -> None: ) # type: ignore # Crear la TDT + self.__inheritance_graph = graph graph.build_tdt() self.tdt_table = graph.tdt @@ -272,7 +296,9 @@ def __implement_abort(self): self.current_function = self.register_function("function_abort_at_Object") return_expr_vm_holder = self.define_internal_local() self.register_instruction(TypeName(return_expr_vm_holder)) - self.register_instruction(AbortNode(return_expr_vm_holder, self.abortion, self.newLine)) + self.register_instruction( + AbortNode(return_expr_vm_holder, self.abortion, self.newLine) + ) self.current_function = None def __implement_copy(self): @@ -353,7 +379,6 @@ def build_builtins(self): bool_.methods.append(("type_name", "function_type_name_at_Object")) bool_.methods.append(("copy", "function_copy_at_Object")) - str_.methods.append(("abort", "function_abort_at_Object")) str_.methods.append(("type_name", "function_type_name_at_Object")) str_.methods.append(("copy", "function_copy_at_Object")) diff --git a/src/pycoolc.py b/src/pycoolc.py index df4e8f45..521b08d3 100644 --- a/src/pycoolc.py +++ b/src/pycoolc.py @@ -82,7 +82,7 @@ def pipeline(program: str, deep: int, file_name: str) -> None: parser.add_argument("file", type=str, help="Cool source file.") parser.add_argument("--deep", type=int) args = parser.parse_args() - deep = 3 if args.deep is None else args.deep + deep = 1 if args.deep is None else args.deep with open(args.file, "r") as f: program = f.read() pipeline(program, deep, args.file) diff --git a/src/testing.mips b/src/testing.mips index 2d401ca3..63a65fc0 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,7 +1 @@ - Scope - - Scope - - Scope -n -> Razz - +['Main', 'Bazz', 'Foo', 'Razz', 'Bar'] diff --git a/src/testing.py b/src/testing.py index e30f88ca..afa81a75 100755 --- a/src/testing.py +++ b/src/testing.py @@ -123,4 +123,4 @@ class Main { }; """ -pipeline(text, 5) +pipeline(text, 1) diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 3797b49e..a1a1854f 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -1,5 +1,6 @@ -from abstract.semantics import Type -from abstract.tree import EqualToNode, IsVoidNode, NotNode, SelfNode +from re import L +from abstract.semantics import Context, Type +from abstract.tree import AttributeDef, ClassDef, EqualToNode, IsVoidNode, MethodDef, NotNode, SelfNode import cil.baseCilVisitor as baseCilVisitor import abstract.tree as coolAst import abstract.semantics as semantics @@ -96,6 +97,11 @@ def _(self, node: coolAst.ProgramNode, scope: Scope) -> CilProgramNode: self.register_instruction(ReturnNode(0)) self.current_function = None + class_list = self.topological_sort_classDefs(node.class_list) + + for c in node.class_list: + self.register_type(c.idx) + for klass, child_scope in zip(node.class_list, scope.children): self.visit(klass, child_scope) @@ -107,7 +113,7 @@ def _(self, node: coolAst.ProgramNode, scope: Scope) -> CilProgramNode: def _(self, node: coolAst.ClassDef, scope: Scope) -> None: # Registrar el tipo que creamos en .Types section self.current_type = self.context.get_type(node.idx) - new_type_node = self.register_type(node.idx) + new_type_node = next(x for x in self.dot_types if x.name == node.idx) methods = self.current_type.methods attributes = self.current_type.attributes @@ -161,18 +167,26 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: (method, self.to_function_name(method, node.idx)) ) - # Visitar los atributos definidos en la clase para generar sus funciones - # de inicializacion - for feature in node.features: - if isinstance(feature, coolAst.AttributeDef): - self.visit(feature, scope) - - # Visitar cada metodo para generar su codigo en la seccion .CODE - for feature, child_scope in zip( - (x for x in node.features if isinstance(x, coolAst.MethodDef)), - scope.children, - ): - self.visit(feature, child_scope) + attrib = [x for x in node.features if isinstance(x, AttributeDef)] + meth = [x for x in node.features if isinstance(x, MethodDef)] + features = attrib + meth + + + for f, s in zip(features, scope.children): + self.visit(f, s) + + # # Visitar los atributos definidos en la clase para generar sus funciones + # # de inicializacion + # for feature in node.features: + # if isinstance(feature, coolAst.AttributeDef): + # self.visit(feature, scope) + + # # Visitar cada metodo para generar su codigo en la seccion .CODE + # for feature, child_scope in zip( + # (x for x in node.features if isinstance(x, coolAst.MethodDef)), + # scope.children, + # ): + # self.visit(feature, child_scope) self.current_type = None @@ -470,7 +484,7 @@ def _(self, node: coolAst.CaseNode, scope: Scope): # Asignar al identificador idk el valor de expr0 self.register_instruction(AssignNode(idk, expr_vm_holder)) # Generar el codigo de la expresion asociada a esta rama - self.visit(action_node.actions, scope) + self.visit(action_node.actions, s) # Generar un salto de modo que no se chequee otra rama self.register_instruction(UnconditionalJump(end_label)) self.register_instruction(LabelNode(next_label)) diff --git a/src/travels/inference.py b/src/travels/inference.py index bd142b39..a44b2fe3 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -4,7 +4,7 @@ import abstract.semantics as semantic import abstract.tree as coolAst from abstract.semantics import Scope, SemanticError, Type -from abstract.tree import ActionNode, CaseNode, IsVoidNode, ParentFuncCall, SelfNode +from abstract.tree import ActionNode, AttributeDef, CaseNode, IsVoidNode, MethodDef, ParentFuncCall, SelfNode from travels.context_actions import ( update_attr_type, update_method_param, @@ -122,17 +122,28 @@ def _( ): scope.define_variable(attribute.name, attribute.type, "ATTRIBUTE") - for feature in node.features: - if isinstance(feature, coolAst.AttributeDef): - self.visit(feature, scope, deep=deep) + attrib = [x for x in node.features if isinstance(x, AttributeDef)] + meth = [x for x in node.features if isinstance(x, MethodDef)] + features = attrib + meth + if deep == 1: - for feature in node.features: - if isinstance(feature, coolAst.MethodDef): - self.visit(feature, scope.create_child(), deep=deep) + for f in features: + self.visit(f, scope.create_child(), deep) else: - methods = (f for f in node.features if isinstance(f, coolAst.MethodDef)) - for feature, child_scope in zip(methods, scope.children): - self.visit(feature, child_scope, deep=deep) + for f, s in zip(features, scope.children): + self.visit(f, s, deep) + + # for feature in node.features: + # if isinstance(feature, coolAst.AttributeDef): + # self.visit(feature, scope, deep=deep) + # if deep == 1: + # for feature in node.features: + # if isinstance(feature, coolAst.MethodDef): + # self.visit(feature, scope.create_child(), deep=deep) + # else: + # methods = (f for f in node.features if isinstance(f, coolAst.MethodDef)) + # for feature, child_scope in zip(methods, scope.children): + # self.visit(feature, child_scope, deep=deep) # --------------------------------------------------------- # Definir un atributo en el scope. | @@ -361,7 +372,7 @@ def _( if deep == 1: scope = scope.create_child() else: - scope = scope.children[0] + scope = scope.children[0] if scope.children else scope for var_id, var_type, var_init_expr, l, c in node.var_list: try: type_ = self.context.get_type(var_type) diff --git a/tests/codegen/atoi.mips b/tests/codegen/atoi.mips new file mode 100644 index 00000000..962b26ca --- /dev/null +++ b/tests/codegen/atoi.mips @@ -0,0 +1,3559 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:25 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +A2I: .asciiz "A2I" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type A2I **** +A2I_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_c2i_at_A2I, function_i2c_at_A2I, function_a2i_at_A2I, function_a2i_aux_at_A2I, function_i2a_at_A2I, function_i2a_aux_at_A2I +# Function END +# + + +# **** Type RECORD for type A2I **** +A2I_start: + A2I_vtable_pointer: .word A2I_vtable + # Function END +A2I_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1 +A2I__TDT: .word -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "0" +# + + +data_5: .asciiz "1" +# + + +data_6: .asciiz "2" +# + + +data_7: .asciiz "3" +# + + +data_8: .asciiz "4" +# + + +data_9: .asciiz "5" +# + + +data_10: .asciiz "6" +# + + +data_11: .asciiz "7" +# + + +data_12: .asciiz "8" +# + + +data_13: .asciiz "9" +# + + +data_14: .asciiz "0" +# + + +data_15: .asciiz "1" +# + + +data_16: .asciiz "2" +# + + +data_17: .asciiz "3" +# + + +data_18: .asciiz "4" +# + + +data_19: .asciiz "5" +# + + +data_20: .asciiz "6" +# + + +data_21: .asciiz "7" +# + + +data_22: .asciiz "8" +# + + +data_23: .asciiz "9" +# + + +data_24: .asciiz "" +# + + +data_25: .asciiz "-" +# + + +data_26: .asciiz "+" +# + + +data_27: .asciiz "0" +# + + +data_28: .asciiz "-" +# + + +data_29: .asciiz "" +# + + +data_30: .asciiz "678987" +# + + +data_31: .asciiz " == " +# + + +data_32: .asciiz "\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 20 + sw $t2, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 28($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_c2i_at_A2I implementation. +# @Params: +# 0($fp) = param_c2i_at_A2I_char_0 +function_c2i_at_A2I: + # Allocate stack frame for function function_c2i_at_A2I. + subu $sp, $sp, 140 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 140 + # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_4 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -12($fp) + # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) + # local_c2i_at_A2I_internal_1 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_2 + lw $t1, 0($fp) + lw $t2, -12($fp) + sub $t1, $t1, $t2 + sw $t1, -8($fp) + # IF_ZERO local_c2i_at_A2I_internal_1 GOTO label_TRUE_3 + # IF_ZERO local_c2i_at_A2I_internal_1 GOTO label_TRUE_3 + lw $t1, -8($fp) + beq $t1, 0, label_TRUE_3 + # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) + # local_c2i_at_A2I_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # GOTO label_END_4 +j label_END_4 +label_TRUE_3: + # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) + # local_c2i_at_A2I_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + label_END_4: +# IF_ZERO local_c2i_at_A2I_internal_1 GOTO label_FALSEIF_1 +# IF_ZERO local_c2i_at_A2I_internal_1 GOTO label_FALSEIF_1 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_1 +# LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) +# local_c2i_at_A2I_internal_0 = 0 +li $t1, 0 +sw $t1, -4($fp) +# GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_5 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -24($fp) + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) + # local_c2i_at_A2I_internal_4 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_5 + lw $t1, 0($fp) + lw $t2, -24($fp) + sub $t1, $t1, $t2 + sw $t1, -20($fp) + # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_7 + # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_7 + lw $t1, -20($fp) + beq $t1, 0, label_TRUE_7 + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # local_c2i_at_A2I_internal_4 = 0 + li $t1, 0 + sw $t1, -20($fp) + # GOTO label_END_8 +j label_END_8 +label_TRUE_7: + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # local_c2i_at_A2I_internal_4 = 1 + li $t1, 1 + sw $t1, -20($fp) + label_END_8: +# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSEIF_5 +# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSEIF_5 +lw $t1, -20($fp) +beq $t1, 0, label_FALSEIF_5 +# LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) +# local_c2i_at_A2I_internal_3 = 1 +li $t1, 1 +sw $t1, -16($fp) +# GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_6 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -36($fp) + # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) + # local_c2i_at_A2I_internal_7 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_8 + lw $t1, 0($fp) + lw $t2, -36($fp) + sub $t1, $t1, $t2 + sw $t1, -32($fp) + # IF_ZERO local_c2i_at_A2I_internal_7 GOTO label_TRUE_11 + # IF_ZERO local_c2i_at_A2I_internal_7 GOTO label_TRUE_11 + lw $t1, -32($fp) + beq $t1, 0, label_TRUE_11 + # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) + # local_c2i_at_A2I_internal_7 = 0 + li $t1, 0 + sw $t1, -32($fp) + # GOTO label_END_12 +j label_END_12 +label_TRUE_11: + # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) + # local_c2i_at_A2I_internal_7 = 1 + li $t1, 1 + sw $t1, -32($fp) + label_END_12: +# IF_ZERO local_c2i_at_A2I_internal_7 GOTO label_FALSEIF_9 +# IF_ZERO local_c2i_at_A2I_internal_7 GOTO label_FALSEIF_9 +lw $t1, -32($fp) +beq $t1, 0, label_FALSEIF_9 +# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) +# local_c2i_at_A2I_internal_6 = 2 +li $t1, 2 +sw $t1, -28($fp) +# GOTO label_ENDIF_10 +j label_ENDIF_10 +label_FALSEIF_9: + # LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_7 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -48($fp) + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) + # local_c2i_at_A2I_internal_10 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_11 + lw $t1, 0($fp) + lw $t2, -48($fp) + sub $t1, $t1, $t2 + sw $t1, -44($fp) + # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_15 + # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_15 + lw $t1, -44($fp) + beq $t1, 0, label_TRUE_15 + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # local_c2i_at_A2I_internal_10 = 0 + li $t1, 0 + sw $t1, -44($fp) + # GOTO label_END_16 +j label_END_16 +label_TRUE_15: + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # local_c2i_at_A2I_internal_10 = 1 + li $t1, 1 + sw $t1, -44($fp) + label_END_16: +# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSEIF_13 +# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSEIF_13 +lw $t1, -44($fp) +beq $t1, 0, label_FALSEIF_13 +# LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) +# local_c2i_at_A2I_internal_9 = 3 +li $t1, 3 +sw $t1, -40($fp) +# GOTO label_ENDIF_14 +j label_ENDIF_14 +label_FALSEIF_13: + # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_8 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -60($fp) + # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) + # local_c2i_at_A2I_internal_13 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_14 + lw $t1, 0($fp) + lw $t2, -60($fp) + sub $t1, $t1, $t2 + sw $t1, -56($fp) + # IF_ZERO local_c2i_at_A2I_internal_13 GOTO label_TRUE_19 + # IF_ZERO local_c2i_at_A2I_internal_13 GOTO label_TRUE_19 + lw $t1, -56($fp) + beq $t1, 0, label_TRUE_19 + # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) + # local_c2i_at_A2I_internal_13 = 0 + li $t1, 0 + sw $t1, -56($fp) + # GOTO label_END_20 +j label_END_20 +label_TRUE_19: + # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) + # local_c2i_at_A2I_internal_13 = 1 + li $t1, 1 + sw $t1, -56($fp) + label_END_20: +# IF_ZERO local_c2i_at_A2I_internal_13 GOTO label_FALSEIF_17 +# IF_ZERO local_c2i_at_A2I_internal_13 GOTO label_FALSEIF_17 +lw $t1, -56($fp) +beq $t1, 0, label_FALSEIF_17 +# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) +# local_c2i_at_A2I_internal_12 = 4 +li $t1, 4 +sw $t1, -52($fp) +# GOTO label_ENDIF_18 +j label_ENDIF_18 +label_FALSEIF_17: + # LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_9 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -72($fp) + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) + # local_c2i_at_A2I_internal_16 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_17 + lw $t1, 0($fp) + lw $t2, -72($fp) + sub $t1, $t1, $t2 + sw $t1, -68($fp) + # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_23 + # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_23 + lw $t1, -68($fp) + beq $t1, 0, label_TRUE_23 + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # local_c2i_at_A2I_internal_16 = 0 + li $t1, 0 + sw $t1, -68($fp) + # GOTO label_END_24 +j label_END_24 +label_TRUE_23: + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # local_c2i_at_A2I_internal_16 = 1 + li $t1, 1 + sw $t1, -68($fp) + label_END_24: +# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSEIF_21 +# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSEIF_21 +lw $t1, -68($fp) +beq $t1, 0, label_FALSEIF_21 +# LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) +# local_c2i_at_A2I_internal_15 = 5 +li $t1, 5 +sw $t1, -64($fp) +# GOTO label_ENDIF_22 +j label_ENDIF_22 +label_FALSEIF_21: + # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_10 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -84($fp) + # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) + # local_c2i_at_A2I_internal_19 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_20 + lw $t1, 0($fp) + lw $t2, -84($fp) + sub $t1, $t1, $t2 + sw $t1, -80($fp) + # IF_ZERO local_c2i_at_A2I_internal_19 GOTO label_TRUE_27 + # IF_ZERO local_c2i_at_A2I_internal_19 GOTO label_TRUE_27 + lw $t1, -80($fp) + beq $t1, 0, label_TRUE_27 + # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) + # local_c2i_at_A2I_internal_19 = 0 + li $t1, 0 + sw $t1, -80($fp) + # GOTO label_END_28 +j label_END_28 +label_TRUE_27: + # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) + # local_c2i_at_A2I_internal_19 = 1 + li $t1, 1 + sw $t1, -80($fp) + label_END_28: +# IF_ZERO local_c2i_at_A2I_internal_19 GOTO label_FALSEIF_25 +# IF_ZERO local_c2i_at_A2I_internal_19 GOTO label_FALSEIF_25 +lw $t1, -80($fp) +beq $t1, 0, label_FALSEIF_25 +# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) +# local_c2i_at_A2I_internal_18 = 6 +li $t1, 6 +sw $t1, -76($fp) +# GOTO label_ENDIF_26 +j label_ENDIF_26 +label_FALSEIF_25: + # LOCAL local_c2i_at_A2I_internal_23 --> -96($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_11 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -96($fp) + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_23 --> -96($fp) + # local_c2i_at_A2I_internal_22 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_23 + lw $t1, 0($fp) + lw $t2, -96($fp) + sub $t1, $t1, $t2 + sw $t1, -92($fp) + # IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_TRUE_31 + # IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_TRUE_31 + lw $t1, -92($fp) + beq $t1, 0, label_TRUE_31 + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # local_c2i_at_A2I_internal_22 = 0 + li $t1, 0 + sw $t1, -92($fp) + # GOTO label_END_32 +j label_END_32 +label_TRUE_31: + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # local_c2i_at_A2I_internal_22 = 1 + li $t1, 1 + sw $t1, -92($fp) + label_END_32: +# IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_FALSEIF_29 +# IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_FALSEIF_29 +lw $t1, -92($fp) +beq $t1, 0, label_FALSEIF_29 +# LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) +# local_c2i_at_A2I_internal_21 = 7 +li $t1, 7 +sw $t1, -88($fp) +# GOTO label_ENDIF_30 +j label_ENDIF_30 +label_FALSEIF_29: + # LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_12 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -108($fp) + # LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) + # local_c2i_at_A2I_internal_25 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_26 + lw $t1, 0($fp) + lw $t2, -108($fp) + sub $t1, $t1, $t2 + sw $t1, -104($fp) + # IF_ZERO local_c2i_at_A2I_internal_25 GOTO label_TRUE_35 + # IF_ZERO local_c2i_at_A2I_internal_25 GOTO label_TRUE_35 + lw $t1, -104($fp) + beq $t1, 0, label_TRUE_35 + # LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) + # local_c2i_at_A2I_internal_25 = 0 + li $t1, 0 + sw $t1, -104($fp) + # GOTO label_END_36 +j label_END_36 +label_TRUE_35: + # LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) + # local_c2i_at_A2I_internal_25 = 1 + li $t1, 1 + sw $t1, -104($fp) + label_END_36: +# IF_ZERO local_c2i_at_A2I_internal_25 GOTO label_FALSEIF_33 +# IF_ZERO local_c2i_at_A2I_internal_25 GOTO label_FALSEIF_33 +lw $t1, -104($fp) +beq $t1, 0, label_FALSEIF_33 +# LOCAL local_c2i_at_A2I_internal_24 --> -100($fp) +# local_c2i_at_A2I_internal_24 = 8 +li $t1, 8 +sw $t1, -100($fp) +# GOTO label_ENDIF_34 +j label_ENDIF_34 +label_FALSEIF_33: + # LOCAL local_c2i_at_A2I_internal_29 --> -120($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_13 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -120($fp) + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_29 --> -120($fp) + # local_c2i_at_A2I_internal_28 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_29 + lw $t1, 0($fp) + lw $t2, -120($fp) + sub $t1, $t1, $t2 + sw $t1, -116($fp) + # IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_TRUE_39 + # IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_TRUE_39 + lw $t1, -116($fp) + beq $t1, 0, label_TRUE_39 + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + # local_c2i_at_A2I_internal_28 = 0 + li $t1, 0 + sw $t1, -116($fp) + # GOTO label_END_40 +j label_END_40 +label_TRUE_39: + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + # local_c2i_at_A2I_internal_28 = 1 + li $t1, 1 + sw $t1, -116($fp) + label_END_40: +# IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_FALSEIF_37 +# IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_FALSEIF_37 +lw $t1, -116($fp) +beq $t1, 0, label_FALSEIF_37 +# LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) +# local_c2i_at_A2I_internal_27 = 9 +li $t1, 9 +sw $t1, -112($fp) +# GOTO label_ENDIF_38 +j label_ENDIF_38 +label_FALSEIF_37: + # LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) + # local_c2i_at_A2I_internal_32 = SELF + sw $s1, -132($fp) + # LOCAL local_c2i_at_A2I_internal_30 --> -124($fp) + # LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) + # local_c2i_at_A2I_internal_30 = local_c2i_at_A2I_internal_32 + lw $t1, -132($fp) + sw $t1, -124($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_c2i_at_A2I_internal_30 --> -124($fp) + # LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) + # local_c2i_at_A2I_internal_31 = VCALL local_c2i_at_A2I_internal_30 abort + # Save new self pointer in $s1 + lw $s1, -124($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -128($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # local_c2i_at_A2I_internal_27 = 0 + li $t1, 0 + sw $t1, -112($fp) + label_ENDIF_38: +# LOCAL local_c2i_at_A2I_internal_24 --> -100($fp) +# LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) +# local_c2i_at_A2I_internal_24 = local_c2i_at_A2I_internal_27 +lw $t1, -112($fp) +sw $t1, -100($fp) +label_ENDIF_34: +# LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) +# LOCAL local_c2i_at_A2I_internal_24 --> -100($fp) +# local_c2i_at_A2I_internal_21 = local_c2i_at_A2I_internal_24 +lw $t1, -100($fp) +sw $t1, -88($fp) +label_ENDIF_30: +# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) +# LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) +# local_c2i_at_A2I_internal_18 = local_c2i_at_A2I_internal_21 +lw $t1, -88($fp) +sw $t1, -76($fp) +label_ENDIF_26: +# LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) +# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) +# local_c2i_at_A2I_internal_15 = local_c2i_at_A2I_internal_18 +lw $t1, -76($fp) +sw $t1, -64($fp) +label_ENDIF_22: +# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) +# LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) +# local_c2i_at_A2I_internal_12 = local_c2i_at_A2I_internal_15 +lw $t1, -64($fp) +sw $t1, -52($fp) +label_ENDIF_18: +# LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) +# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) +# local_c2i_at_A2I_internal_9 = local_c2i_at_A2I_internal_12 +lw $t1, -52($fp) +sw $t1, -40($fp) +label_ENDIF_14: +# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) +# LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) +# local_c2i_at_A2I_internal_6 = local_c2i_at_A2I_internal_9 +lw $t1, -40($fp) +sw $t1, -28($fp) +label_ENDIF_10: +# LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) +# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) +# local_c2i_at_A2I_internal_3 = local_c2i_at_A2I_internal_6 +lw $t1, -28($fp) +sw $t1, -16($fp) +label_ENDIF_6: +# LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) +# LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) +# local_c2i_at_A2I_internal_0 = local_c2i_at_A2I_internal_3 +lw $t1, -16($fp) +sw $t1, -4($fp) +label_ENDIF_2: +# RETURN local_c2i_at_A2I_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_c2i_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 140 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_i2c_at_A2I implementation. +# @Params: +# 0($fp) = param_i2c_at_A2I_i_0 +function_i2c_at_A2I: + # Allocate stack frame for function function_i2c_at_A2I. + subu $sp, $sp, 144 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 144 + # LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_1 = PARAM param_i2c_at_A2I_i_0 - 0 + lw $t1, 0($fp) + sub $t1, $t1, 0 + sw $t1, -8($fp) + # IF_ZERO local_i2c_at_A2I_internal_1 GOTO label_TRUE_43 + # IF_ZERO local_i2c_at_A2I_internal_1 GOTO label_TRUE_43 + lw $t1, -8($fp) + beq $t1, 0, label_TRUE_43 + # LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) + # local_i2c_at_A2I_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # GOTO label_END_44 +j label_END_44 +label_TRUE_43: + # LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) + # local_i2c_at_A2I_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + label_END_44: +# IF_ZERO local_i2c_at_A2I_internal_1 GOTO label_FALSEIF_41 +# IF_ZERO local_i2c_at_A2I_internal_1 GOTO label_FALSEIF_41 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_41 +# LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_14 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -12($fp) +# LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) +# local_i2c_at_A2I_internal_0 = local_i2c_at_A2I_internal_2 +lw $t1, -12($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_42 +j label_ENDIF_42 +label_FALSEIF_41: + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_4 = PARAM param_i2c_at_A2I_i_0 - 1 + lw $t1, 0($fp) + sub $t1, $t1, 1 + sw $t1, -20($fp) + # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_47 + # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_47 + lw $t1, -20($fp) + beq $t1, 0, label_TRUE_47 + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # local_i2c_at_A2I_internal_4 = 0 + li $t1, 0 + sw $t1, -20($fp) + # GOTO label_END_48 +j label_END_48 +label_TRUE_47: + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # local_i2c_at_A2I_internal_4 = 1 + li $t1, 1 + sw $t1, -20($fp) + label_END_48: +# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSEIF_45 +# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSEIF_45 +lw $t1, -20($fp) +beq $t1, 0, label_FALSEIF_45 +# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_15 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -24($fp) +# LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) +# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) +# local_i2c_at_A2I_internal_3 = local_i2c_at_A2I_internal_5 +lw $t1, -24($fp) +sw $t1, -16($fp) +# GOTO label_ENDIF_46 +j label_ENDIF_46 +label_FALSEIF_45: + # LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_7 = PARAM param_i2c_at_A2I_i_0 - 2 + lw $t1, 0($fp) + sub $t1, $t1, 2 + sw $t1, -32($fp) + # IF_ZERO local_i2c_at_A2I_internal_7 GOTO label_TRUE_51 + # IF_ZERO local_i2c_at_A2I_internal_7 GOTO label_TRUE_51 + lw $t1, -32($fp) + beq $t1, 0, label_TRUE_51 + # LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) + # local_i2c_at_A2I_internal_7 = 0 + li $t1, 0 + sw $t1, -32($fp) + # GOTO label_END_52 +j label_END_52 +label_TRUE_51: + # LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) + # local_i2c_at_A2I_internal_7 = 1 + li $t1, 1 + sw $t1, -32($fp) + label_END_52: +# IF_ZERO local_i2c_at_A2I_internal_7 GOTO label_FALSEIF_49 +# IF_ZERO local_i2c_at_A2I_internal_7 GOTO label_FALSEIF_49 +lw $t1, -32($fp) +beq $t1, 0, label_FALSEIF_49 +# LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_16 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -36($fp) +# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) +# LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) +# local_i2c_at_A2I_internal_6 = local_i2c_at_A2I_internal_8 +lw $t1, -36($fp) +sw $t1, -28($fp) +# GOTO label_ENDIF_50 +j label_ENDIF_50 +label_FALSEIF_49: + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_10 = PARAM param_i2c_at_A2I_i_0 - 3 + lw $t1, 0($fp) + sub $t1, $t1, 3 + sw $t1, -44($fp) + # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_55 + # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_55 + lw $t1, -44($fp) + beq $t1, 0, label_TRUE_55 + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # local_i2c_at_A2I_internal_10 = 0 + li $t1, 0 + sw $t1, -44($fp) + # GOTO label_END_56 +j label_END_56 +label_TRUE_55: + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # local_i2c_at_A2I_internal_10 = 1 + li $t1, 1 + sw $t1, -44($fp) + label_END_56: +# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSEIF_53 +# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSEIF_53 +lw $t1, -44($fp) +beq $t1, 0, label_FALSEIF_53 +# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_17 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -48($fp) +# LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) +# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) +# local_i2c_at_A2I_internal_9 = local_i2c_at_A2I_internal_11 +lw $t1, -48($fp) +sw $t1, -40($fp) +# GOTO label_ENDIF_54 +j label_ENDIF_54 +label_FALSEIF_53: + # LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_13 = PARAM param_i2c_at_A2I_i_0 - 4 + lw $t1, 0($fp) + sub $t1, $t1, 4 + sw $t1, -56($fp) + # IF_ZERO local_i2c_at_A2I_internal_13 GOTO label_TRUE_59 + # IF_ZERO local_i2c_at_A2I_internal_13 GOTO label_TRUE_59 + lw $t1, -56($fp) + beq $t1, 0, label_TRUE_59 + # LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) + # local_i2c_at_A2I_internal_13 = 0 + li $t1, 0 + sw $t1, -56($fp) + # GOTO label_END_60 +j label_END_60 +label_TRUE_59: + # LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) + # local_i2c_at_A2I_internal_13 = 1 + li $t1, 1 + sw $t1, -56($fp) + label_END_60: +# IF_ZERO local_i2c_at_A2I_internal_13 GOTO label_FALSEIF_57 +# IF_ZERO local_i2c_at_A2I_internal_13 GOTO label_FALSEIF_57 +lw $t1, -56($fp) +beq $t1, 0, label_FALSEIF_57 +# LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_18 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -60($fp) +# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) +# LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) +# local_i2c_at_A2I_internal_12 = local_i2c_at_A2I_internal_14 +lw $t1, -60($fp) +sw $t1, -52($fp) +# GOTO label_ENDIF_58 +j label_ENDIF_58 +label_FALSEIF_57: + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_16 = PARAM param_i2c_at_A2I_i_0 - 5 + lw $t1, 0($fp) + sub $t1, $t1, 5 + sw $t1, -68($fp) + # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_63 + # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_63 + lw $t1, -68($fp) + beq $t1, 0, label_TRUE_63 + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # local_i2c_at_A2I_internal_16 = 0 + li $t1, 0 + sw $t1, -68($fp) + # GOTO label_END_64 +j label_END_64 +label_TRUE_63: + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # local_i2c_at_A2I_internal_16 = 1 + li $t1, 1 + sw $t1, -68($fp) + label_END_64: +# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSEIF_61 +# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSEIF_61 +lw $t1, -68($fp) +beq $t1, 0, label_FALSEIF_61 +# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_19 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -72($fp) +# LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) +# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) +# local_i2c_at_A2I_internal_15 = local_i2c_at_A2I_internal_17 +lw $t1, -72($fp) +sw $t1, -64($fp) +# GOTO label_ENDIF_62 +j label_ENDIF_62 +label_FALSEIF_61: + # LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_19 = PARAM param_i2c_at_A2I_i_0 - 6 + lw $t1, 0($fp) + sub $t1, $t1, 6 + sw $t1, -80($fp) + # IF_ZERO local_i2c_at_A2I_internal_19 GOTO label_TRUE_67 + # IF_ZERO local_i2c_at_A2I_internal_19 GOTO label_TRUE_67 + lw $t1, -80($fp) + beq $t1, 0, label_TRUE_67 + # LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) + # local_i2c_at_A2I_internal_19 = 0 + li $t1, 0 + sw $t1, -80($fp) + # GOTO label_END_68 +j label_END_68 +label_TRUE_67: + # LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) + # local_i2c_at_A2I_internal_19 = 1 + li $t1, 1 + sw $t1, -80($fp) + label_END_68: +# IF_ZERO local_i2c_at_A2I_internal_19 GOTO label_FALSEIF_65 +# IF_ZERO local_i2c_at_A2I_internal_19 GOTO label_FALSEIF_65 +lw $t1, -80($fp) +beq $t1, 0, label_FALSEIF_65 +# LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_20 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -84($fp) +# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) +# LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) +# local_i2c_at_A2I_internal_18 = local_i2c_at_A2I_internal_20 +lw $t1, -84($fp) +sw $t1, -76($fp) +# GOTO label_ENDIF_66 +j label_ENDIF_66 +label_FALSEIF_65: + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_22 = PARAM param_i2c_at_A2I_i_0 - 7 + lw $t1, 0($fp) + sub $t1, $t1, 7 + sw $t1, -92($fp) + # IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_TRUE_71 + # IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_TRUE_71 + lw $t1, -92($fp) + beq $t1, 0, label_TRUE_71 + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # local_i2c_at_A2I_internal_22 = 0 + li $t1, 0 + sw $t1, -92($fp) + # GOTO label_END_72 +j label_END_72 +label_TRUE_71: + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # local_i2c_at_A2I_internal_22 = 1 + li $t1, 1 + sw $t1, -92($fp) + label_END_72: +# IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_FALSEIF_69 +# IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_FALSEIF_69 +lw $t1, -92($fp) +beq $t1, 0, label_FALSEIF_69 +# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_21 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -96($fp) +# LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) +# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) +# local_i2c_at_A2I_internal_21 = local_i2c_at_A2I_internal_23 +lw $t1, -96($fp) +sw $t1, -88($fp) +# GOTO label_ENDIF_70 +j label_ENDIF_70 +label_FALSEIF_69: + # LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_25 = PARAM param_i2c_at_A2I_i_0 - 8 + lw $t1, 0($fp) + sub $t1, $t1, 8 + sw $t1, -104($fp) + # IF_ZERO local_i2c_at_A2I_internal_25 GOTO label_TRUE_75 + # IF_ZERO local_i2c_at_A2I_internal_25 GOTO label_TRUE_75 + lw $t1, -104($fp) + beq $t1, 0, label_TRUE_75 + # LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) + # local_i2c_at_A2I_internal_25 = 0 + li $t1, 0 + sw $t1, -104($fp) + # GOTO label_END_76 +j label_END_76 +label_TRUE_75: + # LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) + # local_i2c_at_A2I_internal_25 = 1 + li $t1, 1 + sw $t1, -104($fp) + label_END_76: +# IF_ZERO local_i2c_at_A2I_internal_25 GOTO label_FALSEIF_73 +# IF_ZERO local_i2c_at_A2I_internal_25 GOTO label_FALSEIF_73 +lw $t1, -104($fp) +beq $t1, 0, label_FALSEIF_73 +# LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_22 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -108($fp) +# LOCAL local_i2c_at_A2I_internal_24 --> -100($fp) +# LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) +# local_i2c_at_A2I_internal_24 = local_i2c_at_A2I_internal_26 +lw $t1, -108($fp) +sw $t1, -100($fp) +# GOTO label_ENDIF_74 +j label_ENDIF_74 +label_FALSEIF_73: + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # local_i2c_at_A2I_internal_28 = PARAM param_i2c_at_A2I_i_0 - 9 + lw $t1, 0($fp) + sub $t1, $t1, 9 + sw $t1, -116($fp) + # IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_TRUE_79 + # IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_TRUE_79 + lw $t1, -116($fp) + beq $t1, 0, label_TRUE_79 + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + # local_i2c_at_A2I_internal_28 = 0 + li $t1, 0 + sw $t1, -116($fp) + # GOTO label_END_80 +j label_END_80 +label_TRUE_79: + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + # local_i2c_at_A2I_internal_28 = 1 + li $t1, 1 + sw $t1, -116($fp) + label_END_80: +# IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_FALSEIF_77 +# IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_FALSEIF_77 +lw $t1, -116($fp) +beq $t1, 0, label_FALSEIF_77 +# LOCAL local_i2c_at_A2I_internal_29 --> -120($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_23 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -120($fp) +# LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) +# LOCAL local_i2c_at_A2I_internal_29 --> -120($fp) +# local_i2c_at_A2I_internal_27 = local_i2c_at_A2I_internal_29 +lw $t1, -120($fp) +sw $t1, -112($fp) +# GOTO label_ENDIF_78 +j label_ENDIF_78 +label_FALSEIF_77: + # LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) + # local_i2c_at_A2I_internal_32 = SELF + sw $s1, -132($fp) + # LOCAL local_i2c_at_A2I_internal_30 --> -124($fp) + # LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) + # local_i2c_at_A2I_internal_30 = local_i2c_at_A2I_internal_32 + lw $t1, -132($fp) + sw $t1, -124($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2c_at_A2I_internal_30 --> -124($fp) + # LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) + # local_i2c_at_A2I_internal_31 = VCALL local_i2c_at_A2I_internal_30 abort + # Save new self pointer in $s1 + lw $s1, -124($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -128($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_24 + sw $t1, 12($v0) + li $t1, 0 + sw $t1, 16($v0) + sw $v0, -136($fp) + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # local_i2c_at_A2I_internal_27 = local_i2c_at_A2I_internal_33 + lw $t1, -136($fp) + sw $t1, -112($fp) + label_ENDIF_78: +# LOCAL local_i2c_at_A2I_internal_24 --> -100($fp) +# LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) +# local_i2c_at_A2I_internal_24 = local_i2c_at_A2I_internal_27 +lw $t1, -112($fp) +sw $t1, -100($fp) +label_ENDIF_74: +# LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) +# LOCAL local_i2c_at_A2I_internal_24 --> -100($fp) +# local_i2c_at_A2I_internal_21 = local_i2c_at_A2I_internal_24 +lw $t1, -100($fp) +sw $t1, -88($fp) +label_ENDIF_70: +# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) +# LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) +# local_i2c_at_A2I_internal_18 = local_i2c_at_A2I_internal_21 +lw $t1, -88($fp) +sw $t1, -76($fp) +label_ENDIF_66: +# LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) +# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) +# local_i2c_at_A2I_internal_15 = local_i2c_at_A2I_internal_18 +lw $t1, -76($fp) +sw $t1, -64($fp) +label_ENDIF_62: +# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) +# LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) +# local_i2c_at_A2I_internal_12 = local_i2c_at_A2I_internal_15 +lw $t1, -64($fp) +sw $t1, -52($fp) +label_ENDIF_58: +# LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) +# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) +# local_i2c_at_A2I_internal_9 = local_i2c_at_A2I_internal_12 +lw $t1, -52($fp) +sw $t1, -40($fp) +label_ENDIF_54: +# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) +# LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) +# local_i2c_at_A2I_internal_6 = local_i2c_at_A2I_internal_9 +lw $t1, -40($fp) +sw $t1, -28($fp) +label_ENDIF_50: +# LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) +# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) +# local_i2c_at_A2I_internal_3 = local_i2c_at_A2I_internal_6 +lw $t1, -28($fp) +sw $t1, -16($fp) +label_ENDIF_46: +# LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) +# local_i2c_at_A2I_internal_0 = local_i2c_at_A2I_internal_3 +lw $t1, -16($fp) +sw $t1, -4($fp) +label_ENDIF_42: +# RETURN local_i2c_at_A2I_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_i2c_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 144 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_at_A2I implementation. +# @Params: +# 0($fp) = param_a2i_at_A2I_s_0 +function_a2i_at_A2I: + # Allocate stack frame for function function_a2i_at_A2I. + subu $sp, $sp, 144 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 144 + # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_2 = PARAM param_a2i_at_A2I_s_0 + lw $t1, 0($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # local_a2i_at_A2I_internal_3 = VCALL local_a2i_at_A2I_internal_2 length + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 20($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # local_a2i_at_A2I_internal_1 = local_a2i_at_A2I_internal_3 - 0 + lw $t1, -16($fp) + sub $t1, $t1, 0 + sw $t1, -8($fp) + # IF_ZERO local_a2i_at_A2I_internal_1 GOTO label_TRUE_83 + # IF_ZERO local_a2i_at_A2I_internal_1 GOTO label_TRUE_83 + lw $t1, -8($fp) + beq $t1, 0, label_TRUE_83 + # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) + # local_a2i_at_A2I_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # GOTO label_END_84 +j label_END_84 +label_TRUE_83: + # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) + # local_a2i_at_A2I_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + label_END_84: +# IF_ZERO local_a2i_at_A2I_internal_1 GOTO label_FALSEIF_81 +# IF_ZERO local_a2i_at_A2I_internal_1 GOTO label_FALSEIF_81 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_81 +# LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) +# local_a2i_at_A2I_internal_0 = 0 +li $t1, 0 +sw $t1, -4($fp) +# GOTO label_ENDIF_82 +j label_ENDIF_82 +label_FALSEIF_81: + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_6 = PARAM param_a2i_at_A2I_s_0 + lw $t1, 0($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 0 + li $t1, 0 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # ARG 1 + li $t1, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) + # local_a2i_at_A2I_internal_7 = VCALL local_a2i_at_A2I_internal_6 substr + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 16($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_25 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -36($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) + # LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) + # local_a2i_at_A2I_internal_5 = local_a2i_at_A2I_internal_7 - local_a2i_at_A2I_internal_8 + lw $t1, -32($fp) + lw $t2, -36($fp) + sub $t1, $t1, $t2 + sw $t1, -24($fp) + # IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_TRUE_87 + # IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_TRUE_87 + lw $t1, -24($fp) + beq $t1, 0, label_TRUE_87 + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # local_a2i_at_A2I_internal_5 = 0 + li $t1, 0 + sw $t1, -24($fp) + # GOTO label_END_88 +j label_END_88 +label_TRUE_87: + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # local_a2i_at_A2I_internal_5 = 1 + li $t1, 1 + sw $t1, -24($fp) + label_END_88: +# IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_FALSEIF_85 +# IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_FALSEIF_85 +lw $t1, -24($fp) +beq $t1, 0, label_FALSEIF_85 +# LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) +# local_a2i_at_A2I_internal_12 = SELF +sw $s1, -52($fp) +# LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) +# LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) +# local_a2i_at_A2I_internal_10 = local_a2i_at_A2I_internal_12 +lw $t1, -52($fp) +sw $t1, -44($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_13 = PARAM param_a2i_at_A2I_s_0 +lw $t1, 0($fp) +sw $t1, -56($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG 1 +li $t1, 1 +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_16 = PARAM param_a2i_at_A2I_s_0 +lw $t1, 0($fp) +sw $t1, -68($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# local_a2i_at_A2I_internal_17 = VCALL local_a2i_at_A2I_internal_16 length +# Save new self pointer in $s1 +lw $s1, -68($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 20($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -72($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# local_a2i_at_A2I_internal_15 = local_a2i_at_A2I_internal_17 - 1 +lw $t1, -72($fp) +sub $t1, $t1, 1 +sw $t1, -64($fp) +# ARG local_a2i_at_A2I_internal_15 +# LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) +lw $t1, -64($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) +# LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) +# local_a2i_at_A2I_internal_14 = VCALL local_a2i_at_A2I_internal_13 substr +# Save new self pointer in $s1 +lw $s1, -56($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 16($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -60($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_at_A2I_internal_14 +# LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) +lw $t1, -60($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) +# LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) +# local_a2i_at_A2I_internal_11 = VCALL local_a2i_at_A2I_internal_10 a2i_aux +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 24($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) +# LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) +lw $t1, -48($fp) +not $t1, $t1 +sw $t1, -40($fp) +# LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) +# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) +# local_a2i_at_A2I_internal_4 = local_a2i_at_A2I_internal_9 +lw $t1, -40($fp) +sw $t1, -20($fp) +# GOTO label_ENDIF_86 +j label_ENDIF_86 +label_FALSEIF_85: + # LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_20 = PARAM param_a2i_at_A2I_s_0 + lw $t1, 0($fp) + sw $t1, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 0 + li $t1, 0 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # ARG 1 + li $t1, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) + # LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) + # local_a2i_at_A2I_internal_21 = VCALL local_a2i_at_A2I_internal_20 substr + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 16($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_26 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -92($fp) + # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) + # LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) + # LOCAL local_a2i_at_A2I_internal_22 --> -92($fp) + # local_a2i_at_A2I_internal_19 = local_a2i_at_A2I_internal_21 - local_a2i_at_A2I_internal_22 + lw $t1, -88($fp) + lw $t2, -92($fp) + sub $t1, $t1, $t2 + sw $t1, -80($fp) + # IF_ZERO local_a2i_at_A2I_internal_19 GOTO label_TRUE_91 + # IF_ZERO local_a2i_at_A2I_internal_19 GOTO label_TRUE_91 + lw $t1, -80($fp) + beq $t1, 0, label_TRUE_91 + # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) + # local_a2i_at_A2I_internal_19 = 0 + li $t1, 0 + sw $t1, -80($fp) + # GOTO label_END_92 +j label_END_92 +label_TRUE_91: + # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) + # local_a2i_at_A2I_internal_19 = 1 + li $t1, 1 + sw $t1, -80($fp) + label_END_92: +# IF_ZERO local_a2i_at_A2I_internal_19 GOTO label_FALSEIF_89 +# IF_ZERO local_a2i_at_A2I_internal_19 GOTO label_FALSEIF_89 +lw $t1, -80($fp) +beq $t1, 0, label_FALSEIF_89 +# LOCAL local_a2i_at_A2I_internal_25 --> -104($fp) +# local_a2i_at_A2I_internal_25 = SELF +sw $s1, -104($fp) +# LOCAL local_a2i_at_A2I_internal_23 --> -96($fp) +# LOCAL local_a2i_at_A2I_internal_25 --> -104($fp) +# local_a2i_at_A2I_internal_23 = local_a2i_at_A2I_internal_25 +lw $t1, -104($fp) +sw $t1, -96($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_26 --> -108($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_26 = PARAM param_a2i_at_A2I_s_0 +lw $t1, 0($fp) +sw $t1, -108($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG 1 +li $t1, 1 +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_29 = PARAM param_a2i_at_A2I_s_0 +lw $t1, 0($fp) +sw $t1, -120($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) +# LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) +# local_a2i_at_A2I_internal_30 = VCALL local_a2i_at_A2I_internal_29 length +# Save new self pointer in $s1 +lw $s1, -120($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 20($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -124($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_28 --> -116($fp) +# LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) +# local_a2i_at_A2I_internal_28 = local_a2i_at_A2I_internal_30 - 1 +lw $t1, -124($fp) +sub $t1, $t1, 1 +sw $t1, -116($fp) +# ARG local_a2i_at_A2I_internal_28 +# LOCAL local_a2i_at_A2I_internal_28 --> -116($fp) +lw $t1, -116($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_26 --> -108($fp) +# LOCAL local_a2i_at_A2I_internal_27 --> -112($fp) +# local_a2i_at_A2I_internal_27 = VCALL local_a2i_at_A2I_internal_26 substr +# Save new self pointer in $s1 +lw $s1, -108($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 16($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -112($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_at_A2I_internal_27 +# LOCAL local_a2i_at_A2I_internal_27 --> -112($fp) +lw $t1, -112($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_23 --> -96($fp) +# LOCAL local_a2i_at_A2I_internal_24 --> -100($fp) +# local_a2i_at_A2I_internal_24 = VCALL local_a2i_at_A2I_internal_23 a2i_aux +# Save new self pointer in $s1 +lw $s1, -96($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 24($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -100($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) +# LOCAL local_a2i_at_A2I_internal_24 --> -100($fp) +# local_a2i_at_A2I_internal_18 = local_a2i_at_A2I_internal_24 +lw $t1, -100($fp) +sw $t1, -76($fp) +# GOTO label_ENDIF_90 +j label_ENDIF_90 +label_FALSEIF_89: + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # local_a2i_at_A2I_internal_33 = SELF + sw $s1, -136($fp) + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # local_a2i_at_A2I_internal_31 = local_a2i_at_A2I_internal_33 + lw $t1, -136($fp) + sw $t1, -128($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_a2i_at_A2I_s_0 + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + lw $t1, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_32 --> -132($fp) + # local_a2i_at_A2I_internal_32 = VCALL local_a2i_at_A2I_internal_31 a2i_aux + # Save new self pointer in $s1 + lw $s1, -128($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 24($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -132($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) + # LOCAL local_a2i_at_A2I_internal_32 --> -132($fp) + # local_a2i_at_A2I_internal_18 = local_a2i_at_A2I_internal_32 + lw $t1, -132($fp) + sw $t1, -76($fp) + label_ENDIF_90: +# LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) +# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) +# local_a2i_at_A2I_internal_4 = local_a2i_at_A2I_internal_18 +lw $t1, -76($fp) +sw $t1, -20($fp) +label_ENDIF_86: +# LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) +# LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) +# local_a2i_at_A2I_internal_0 = local_a2i_at_A2I_internal_4 +lw $t1, -20($fp) +sw $t1, -4($fp) +label_ENDIF_82: +# RETURN local_a2i_at_A2I_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_a2i_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 144 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_aux_at_A2I implementation. +# @Params: +# 0($fp) = param_a2i_aux_at_A2I_s_0 +function_a2i_aux_at_A2I: + # Allocate stack frame for function function_a2i_aux_at_A2I. + subu $sp, $sp, 64 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 64 + # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) + # local_a2i_aux_at_A2I_int_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # LOCAL local_a2i_aux_at_A2I_internal_2 --> -12($fp) + # PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) + # local_a2i_aux_at_A2I_internal_2 = PARAM param_a2i_aux_at_A2I_s_0 + lw $t1, 0($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_aux_at_A2I_internal_2 --> -12($fp) + # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) + # local_a2i_aux_at_A2I_internal_3 = VCALL local_a2i_aux_at_A2I_internal_2 length + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 20($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_aux_at_A2I_j_1 --> -8($fp) + # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) + # local_a2i_aux_at_A2I_j_1 = local_a2i_aux_at_A2I_internal_3 + lw $t1, -16($fp) + sw $t1, -8($fp) + # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) + # local_a2i_aux_at_A2I_i_4 = 0 + li $t1, 0 + sw $t1, -20($fp) + label_WHILE_93: + # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) + # LOCAL local_a2i_aux_at_A2I_j_1 --> -8($fp) + # local_a2i_aux_at_A2I_internal_5 = local_a2i_aux_at_A2I_i_4 - local_a2i_aux_at_A2I_j_1 + lw $t1, -20($fp) + lw $t2, -8($fp) + sub $t1, $t1, $t2 + sw $t1, -24($fp) + # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 + # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 + lw $t1, -24($fp) + bgt $t1, 0, label_FALSE_95 + # IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 + # IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 + lw $t1, -24($fp) + beq $t1, 0, label_FALSE_95 + # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) + # local_a2i_aux_at_A2I_internal_5 = 1 + li $t1, 1 + sw $t1, -24($fp) + # GOTO label_END_96 +j label_END_96 +label_FALSE_95: + # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) + # local_a2i_aux_at_A2I_internal_5 = 0 + li $t1, 0 + sw $t1, -24($fp) + label_END_96: +# IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_WHILE_END_94 +# IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_WHILE_END_94 +lw $t1, -24($fp) +beq $t1, 0, label_WHILE_END_94 +# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) +# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) +# local_a2i_aux_at_A2I_internal_7 = local_a2i_aux_at_A2I_int_0 * 10 +lw $t1, -4($fp) +mul $t1, $t1, 10 +sw $t1, -32($fp) +# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) +# local_a2i_aux_at_A2I_internal_10 = SELF +sw $s1, -44($fp) +# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) +# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) +# local_a2i_aux_at_A2I_internal_8 = local_a2i_aux_at_A2I_internal_10 +lw $t1, -44($fp) +sw $t1, -36($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) +# PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) +# local_a2i_aux_at_A2I_internal_11 = PARAM param_a2i_aux_at_A2I_s_0 +lw $t1, 0($fp) +sw $t1, -48($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_a2i_aux_at_A2I_i_4 +# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) +lw $t1, -20($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# ARG 1 +li $t1, 1 +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) +# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) +# local_a2i_aux_at_A2I_internal_12 = VCALL local_a2i_aux_at_A2I_internal_11 substr +# Save new self pointer in $s1 +lw $s1, -48($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 16($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -52($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_aux_at_A2I_internal_12 +# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) +lw $t1, -52($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) +# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) +# local_a2i_aux_at_A2I_internal_9 = VCALL local_a2i_aux_at_A2I_internal_8 c2i +# Save new self pointer in $s1 +lw $s1, -36($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 12($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -40($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) +# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) +# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) +# local_a2i_aux_at_A2I_internal_6 = local_a2i_aux_at_A2I_internal_7 + local_a2i_aux_at_A2I_internal_9 +lw $t1, -32($fp) +lw $t2, -40($fp) +add $t1, $t1, $t2 +sw $t1, -28($fp) +# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) +# local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_6 +lw $t1, -28($fp) +sw $t1, -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) +# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) +# local_a2i_aux_at_A2I_internal_13 = local_a2i_aux_at_A2I_i_4 + 1 +lw $t1, -20($fp) +add $t1, $t1, 1 +sw $t1, -56($fp) +# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) +# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) +# local_a2i_aux_at_A2I_i_4 = local_a2i_aux_at_A2I_internal_13 +lw $t1, -56($fp) +sw $t1, -20($fp) +# GOTO label_WHILE_93 +j label_WHILE_93 +label_WHILE_END_94: + # RETURN local_a2i_aux_at_A2I_int_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_a2i_aux_at_A2I. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 64 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_i2a_at_A2I implementation. +# @Params: +# 0($fp) = param_i2a_at_A2I_i_0 +function_i2a_at_A2I: + # Allocate stack frame for function function_i2a_at_A2I. + subu $sp, $sp, 68 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 68 + # LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # local_i2a_at_A2I_internal_1 = PARAM param_i2a_at_A2I_i_0 - 0 + lw $t1, 0($fp) + sub $t1, $t1, 0 + sw $t1, -8($fp) + # IF_ZERO local_i2a_at_A2I_internal_1 GOTO label_TRUE_99 + # IF_ZERO local_i2a_at_A2I_internal_1 GOTO label_TRUE_99 + lw $t1, -8($fp) + beq $t1, 0, label_TRUE_99 + # LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) + # local_i2a_at_A2I_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # GOTO label_END_100 +j label_END_100 +label_TRUE_99: + # LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) + # local_i2a_at_A2I_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + label_END_100: +# IF_ZERO local_i2a_at_A2I_internal_1 GOTO label_FALSEIF_97 +# IF_ZERO local_i2a_at_A2I_internal_1 GOTO label_FALSEIF_97 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_97 +# LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_27 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -12($fp) +# LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) +# local_i2a_at_A2I_internal_0 = local_i2a_at_A2I_internal_2 +lw $t1, -12($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_98 +j label_ENDIF_98 +label_FALSEIF_97: + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # local_i2a_at_A2I_internal_4 = 0 - PARAM param_i2a_at_A2I_i_0 + li $t1, 0 + lw $t2, 0($fp) + sub $t1, $t1, $t2 + sw $t1, -20($fp) + # IF_GREATER_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_103 + # IF_GREATER_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_103 + lw $t1, -20($fp) + bgt $t1, 0, label_FALSE_103 + # IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_103 + # IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_103 + lw $t1, -20($fp) + beq $t1, 0, label_FALSE_103 + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + # local_i2a_at_A2I_internal_4 = 1 + li $t1, 1 + sw $t1, -20($fp) + # GOTO label_END_104 +j label_END_104 +label_FALSE_103: + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + # local_i2a_at_A2I_internal_4 = 0 + li $t1, 0 + sw $t1, -20($fp) + label_END_104: +# IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSEIF_101 +# IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSEIF_101 +lw $t1, -20($fp) +beq $t1, 0, label_FALSEIF_101 +# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) +# local_i2a_at_A2I_internal_7 = SELF +sw $s1, -32($fp) +# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) +# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) +# local_i2a_at_A2I_internal_5 = local_i2a_at_A2I_internal_7 +lw $t1, -32($fp) +sw $t1, -24($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_i2a_at_A2I_i_0 +# PARAM param_i2a_at_A2I_i_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) +# LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) +# local_i2a_at_A2I_internal_6 = VCALL local_i2a_at_A2I_internal_5 i2a_aux +# Save new self pointer in $s1 +lw $s1, -24($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 32($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -28($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) +# LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) +# local_i2a_at_A2I_internal_3 = local_i2a_at_A2I_internal_6 +lw $t1, -28($fp) +sw $t1, -16($fp) +# GOTO label_ENDIF_102 +j label_ENDIF_102 +label_FALSEIF_101: + # LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_28 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -44($fp) + # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) + # LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) + # local_i2a_at_A2I_internal_8 = local_i2a_at_A2I_internal_10 + lw $t1, -44($fp) + sw $t1, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_13 --> -56($fp) + # local_i2a_at_A2I_internal_13 = SELF + sw $s1, -56($fp) + # LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) + # LOCAL local_i2a_at_A2I_internal_13 --> -56($fp) + # local_i2a_at_A2I_internal_11 = local_i2a_at_A2I_internal_13 + lw $t1, -56($fp) + sw $t1, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_14 --> -60($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # local_i2a_at_A2I_internal_14 = PARAM param_i2a_at_A2I_i_0 * 1 + lw $t1, 0($fp) + mul $t1, $t1, 1 + sw $t1, -60($fp) + # ARG local_i2a_at_A2I_internal_14 + # LOCAL local_i2a_at_A2I_internal_14 --> -60($fp) + lw $t1, -60($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) + # LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) + # local_i2a_at_A2I_internal_12 = VCALL local_i2a_at_A2I_internal_11 i2a_aux + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 32($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_i2a_at_A2I_internal_12 + # LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) + lw $t1, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) + # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) + # local_i2a_at_A2I_internal_9 = VCALL local_i2a_at_A2I_internal_8 concat + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) + # local_i2a_at_A2I_internal_3 = local_i2a_at_A2I_internal_9 + lw $t1, -40($fp) + sw $t1, -16($fp) + label_ENDIF_102: +# LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) +# local_i2a_at_A2I_internal_0 = local_i2a_at_A2I_internal_3 +lw $t1, -16($fp) +sw $t1, -4($fp) +label_ENDIF_98: +# RETURN local_i2a_at_A2I_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_i2a_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 68 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_i2a_aux_at_A2I implementation. +# @Params: +# 0($fp) = param_i2a_aux_at_A2I_i_0 +function_i2a_aux_at_A2I: + # Allocate stack frame for function function_i2a_aux_at_A2I. + subu $sp, $sp, 68 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 68 + # LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # local_i2a_aux_at_A2I_internal_1 = PARAM param_i2a_aux_at_A2I_i_0 - 0 + lw $t1, 0($fp) + sub $t1, $t1, 0 + sw $t1, -8($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_1 GOTO label_TRUE_107 + # IF_ZERO local_i2a_aux_at_A2I_internal_1 GOTO label_TRUE_107 + lw $t1, -8($fp) + beq $t1, 0, label_TRUE_107 + # LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) + # local_i2a_aux_at_A2I_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # GOTO label_END_108 +j label_END_108 +label_TRUE_107: + # LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) + # local_i2a_aux_at_A2I_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + label_END_108: +# IF_ZERO local_i2a_aux_at_A2I_internal_1 GOTO label_FALSEIF_105 +# IF_ZERO local_i2a_aux_at_A2I_internal_1 GOTO label_FALSEIF_105 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_105 +# LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_29 +sw $t1, 12($v0) +li $t1, 0 +sw $t1, 16($v0) +sw $v0, -12($fp) +# LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) +# local_i2a_aux_at_A2I_internal_0 = local_i2a_aux_at_A2I_internal_2 +lw $t1, -12($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_106 +j label_ENDIF_106 +label_FALSEIF_105: + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # local_i2a_aux_at_A2I_internal_4 = PARAM param_i2a_aux_at_A2I_i_0 / 10 + lw $t1, 0($fp) + div $t1, $t1, 10 + sw $t1, -20($fp) + # LOCAL local_i2a_aux_at_A2I_next_3 --> -16($fp) + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + # local_i2a_aux_at_A2I_next_3 = local_i2a_aux_at_A2I_internal_4 + lw $t1, -20($fp) + sw $t1, -16($fp) + # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) + # local_i2a_aux_at_A2I_internal_9 = SELF + sw $s1, -40($fp) + # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) + # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) + # local_i2a_aux_at_A2I_internal_7 = local_i2a_aux_at_A2I_internal_9 + lw $t1, -40($fp) + sw $t1, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_i2a_aux_at_A2I_next_3 + # LOCAL local_i2a_aux_at_A2I_next_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) + # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) + # local_i2a_aux_at_A2I_internal_8 = VCALL local_i2a_aux_at_A2I_internal_7 i2a_aux + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 32($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) + # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) + # local_i2a_aux_at_A2I_internal_5 = local_i2a_aux_at_A2I_internal_8 + lw $t1, -36($fp) + sw $t1, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) + # local_i2a_aux_at_A2I_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) + # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) + # local_i2a_aux_at_A2I_internal_10 = local_i2a_aux_at_A2I_internal_12 + lw $t1, -52($fp) + sw $t1, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_14 --> -60($fp) + # LOCAL local_i2a_aux_at_A2I_next_3 --> -16($fp) + # local_i2a_aux_at_A2I_internal_14 = local_i2a_aux_at_A2I_next_3 * 10 + lw $t1, -16($fp) + mul $t1, $t1, 10 + sw $t1, -60($fp) + # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_14 --> -60($fp) + # local_i2a_aux_at_A2I_internal_13 = PARAM param_i2a_aux_at_A2I_i_0 - local_i2a_aux_at_A2I_internal_14 + lw $t1, 0($fp) + lw $t2, -60($fp) + sub $t1, $t1, $t2 + sw $t1, -56($fp) + # ARG local_i2a_aux_at_A2I_internal_13 + # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) + lw $t1, -56($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) + # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) + # local_i2a_aux_at_A2I_internal_11 = VCALL local_i2a_aux_at_A2I_internal_10 i2c + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 16($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_i2a_aux_at_A2I_internal_11 + # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) + lw $t1, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) + # LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) + # local_i2a_aux_at_A2I_internal_6 = VCALL local_i2a_aux_at_A2I_internal_5 concat + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) + # LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) + # local_i2a_aux_at_A2I_internal_0 = local_i2a_aux_at_A2I_internal_6 + lw $t1, -28($fp) + sw $t1, -4($fp) + label_ENDIF_106: +# RETURN local_i2a_aux_at_A2I_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_i2a_aux_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 68 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 100 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 100 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE A2I + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, A2I + sw $t3, 12($v0) + li $t3, 3 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, A2I_start + sw $t3, 4($v0) + # Load type offset + li $t3, 16 + sw $t3, 8($v0) + move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t2, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t2, -16($fp) + sw $t2, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_30 + sw $t2, 12($v0) + li $t2, 6 + sw $t2, 16($v0) + sw $v0, -20($fp) + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t2, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 a2i + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 20($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_a_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_a_0 = local_main_at_Main_internal_2 + lw $t2, -12($fp) + sw $t2, -4($fp) + # LOCAL local_main_at_Main_b_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_0 + sw $t2, 12($v0) + li $t2, 0 + sw $t2, 16($v0) + sw $v0, -24($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = ALLOCATE A2I + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, A2I + sw $t4, 12($v0) + li $t4, 3 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, A2I_start + sw $t4, 4($v0) + # Load type offset + li $t4, 16 + sw $t4, 8($v0) + move $t3, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t3, -36($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 + lw $t3, -36($fp) + sw $t3, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 678987 + li $t3, 678987 + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 i2a + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 28($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_b_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_b_5 = local_main_at_Main_internal_7 + lw $t3, -32($fp) + sw $t3, -24($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 + lw $t3, -48($fp) + sw $t3, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_a_0 + # LOCAL local_main_at_Main_a_0 --> -4($fp) + lw $t3, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_int + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 16($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 + lw $t3, -60($fp) + sw $t3, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_31 + sw $t3, 12($v0) + li $t3, 4 + sw $t3, 16($v0) + sw $v0, -64($fp) + # ARG local_main_at_Main_internal_15 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + lw $t3, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 + lw $t3, -76($fp) + sw $t3, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_b_5 + # LOCAL local_main_at_Main_b_5 --> -24($fp) + lw $t3, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_21 = SELF + sw $s1, -88($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 + lw $t3, -88($fp) + sw $t3, -80($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_32 + sw $t3, 12($v0) + li $t3, 1 + sw $t3, 16($v0) + sw $v0, -92($fp) + # ARG local_main_at_Main_internal_22 + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + lw $t3, -92($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 out_string + # Save new self pointer in $s1 + lw $s1, -80($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -84($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_20 + lw $v0, -84($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 100 + jr $ra + # Function END + diff --git a/tests/codegen/book_list.mips b/tests/codegen/book_list.mips new file mode 100644 index 00000000..33a700ce --- /dev/null +++ b/tests/codegen/book_list.mips @@ -0,0 +1,3012 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:24 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Book: .asciiz "Book" +# Function END +Article: .asciiz "Article" +# Function END +BookList: .asciiz "BookList" +# Function END +Cons: .asciiz "Cons" +# Function END +Nil: .asciiz "Nil" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Book **** +Book_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_initBook_at_Book, function_print_at_Book +# Function END +# + + +# **** Type RECORD for type Book **** +Book_start: + Book_vtable_pointer: .word Book_vtable + # Function END +Book_end: +# + + +# **** VTABLE for type Article **** +Article_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_initBook_at_Book, function_print_at_Article, function_initArticle_at_Article +# Function END +# + + +# **** Type RECORD for type Article **** +Article_start: + Article_vtable_pointer: .word Article_vtable + # Function END +Article_end: +# + + +# **** VTABLE for type BookList **** +BookList_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_BookList, function_cons_at_BookList, function_car_at_BookList, function_cdr_at_BookList, function_print_list_at_BookList +# Function END +# + + +# **** Type RECORD for type BookList **** +BookList_start: + BookList_vtable_pointer: .word BookList_vtable + # Function END +BookList_end: +# + + +# **** VTABLE for type Cons **** +Cons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_Cons, function_cons_at_BookList, function_car_at_Cons, function_cdr_at_Cons, function_print_list_at_Cons, function_init_at_Cons +# Function END +# + + +# **** Type RECORD for type Cons **** +Cons_start: + Cons_vtable_pointer: .word Cons_vtable + # Function END +Cons_end: +# + + +# **** VTABLE for type Nil **** +Nil_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_Nil, function_cons_at_BookList, function_car_at_BookList, function_cdr_at_BookList, function_print_list_at_Nil +# Function END +# + + +# **** Type RECORD for type Nil **** +Nil_start: + Nil_vtable_pointer: .word Nil_vtable + # Function END +Nil_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, 1, 2, 1, 2, 2, -1 +Object__TDT: .word 1, 0, 1, 1, 2, 3, 2, 3, 3, 1 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 +Book__TDT: .word -1, -1, -1, -1, 0, 1, -1, -1, -1, -1 +Article__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1, -1 +BookList__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 1, -1 +Cons__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 +Nil__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "title: " +# + + +data_5: .asciiz "\n" +# + + +data_6: .asciiz "author: " +# + + +data_7: .asciiz "\n" +# + + +data_8: .asciiz "periodical: " +# + + +data_9: .asciiz "\n" +# + + +data_10: .asciiz "- dynamic type was Book -\n" +# + + +data_11: .asciiz "- dynamic type was Article -\n" +# + + +data_12: .asciiz "Compilers, Principles, Techniques, and Tools" +# + + +data_13: .asciiz "Aho, Sethi, and Ullman" +# + + +data_14: .asciiz "The Top 100 CD_ROMs" +# + + +data_15: .asciiz "Ulanoff" +# + + +data_16: .asciiz "PC Magazine" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 36 + sw $t2, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__books__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 12($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Book__attrib__title__init implementation. +# @Params: +__Book__attrib__title__init: + # Allocate stack frame for function __Book__attrib__title__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__title__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_0 + sw $t1, 12($v0) + li $t1, 0 + sw $t1, 16($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__title__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Book__attrib__title__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Book__attrib__author__init implementation. +# @Params: +__Book__attrib__author__init: + # Allocate stack frame for function __Book__attrib__author__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__author__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_0 + sw $t1, 12($v0) + li $t1, 0 + sw $t1, 16($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__author__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Book__attrib__author__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_initBook_at_Book implementation. +# @Params: +# 0($fp) = param_initBook_at_Book_title_p_0 +# 4($fp) = param_initBook_at_Book_author_p_1 +function_initBook_at_Book: + # Allocate stack frame for function function_initBook_at_Book. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_initBook_at_Book_title_p_0 --> 4($fp) + lw $t1, 4($fp) + sw $t1, 12($s1) + # + # PARAM param_initBook_at_Book_author_p_1 --> 0($fp) + lw $t1, 0($fp) + sw $t1, 16($s1) + # LOCAL local_initBook_at_Book_internal_0 --> -4($fp) + # local_initBook_at_Book_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_initBook_at_Book_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_initBook_at_Book. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_print_at_Book implementation. +# @Params: +function_print_at_Book: + # Allocate stack frame for function function_print_at_Book. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # LOCAL local_print_at_Book_internal_6 --> -28($fp) + # local_print_at_Book_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_print_at_Book_internal_4 --> -20($fp) + # LOCAL local_print_at_Book_internal_6 --> -28($fp) + # local_print_at_Book_internal_4 = local_print_at_Book_internal_6 + lw $t1, -28($fp) + sw $t1, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Book_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_4 + sw $t1, 12($v0) + li $t1, 12 + sw $t1, 16($v0) + sw $v0, -32($fp) + # ARG local_print_at_Book_internal_7 + # LOCAL local_print_at_Book_internal_7 --> -32($fp) + lw $t1, -32($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_4 --> -20($fp) + # LOCAL local_print_at_Book_internal_5 --> -24($fp) + # local_print_at_Book_internal_5 = VCALL local_print_at_Book_internal_4 out_string + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_2 --> -12($fp) + # LOCAL local_print_at_Book_internal_5 --> -24($fp) + # local_print_at_Book_internal_2 = local_print_at_Book_internal_5 + lw $t1, -24($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Book_internal_8 = GETATTRIBUTE title Book + # LOCAL local_print_at_Book_internal_8 --> -36($fp) + lw $t1, 12($s1) + sw $t1, -36($fp) + # ARG local_print_at_Book_internal_8 + # LOCAL local_print_at_Book_internal_8 --> -36($fp) + lw $t1, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_2 --> -12($fp) + # LOCAL local_print_at_Book_internal_3 --> -16($fp) + # local_print_at_Book_internal_3 = VCALL local_print_at_Book_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_0 --> -4($fp) + # LOCAL local_print_at_Book_internal_3 --> -16($fp) + # local_print_at_Book_internal_0 = local_print_at_Book_internal_3 + lw $t1, -16($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Book_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_5 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -40($fp) + # ARG local_print_at_Book_internal_9 + # LOCAL local_print_at_Book_internal_9 --> -40($fp) + lw $t1, -40($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_0 --> -4($fp) + # LOCAL local_print_at_Book_internal_1 --> -8($fp) + # local_print_at_Book_internal_1 = VCALL local_print_at_Book_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_16 --> -68($fp) + # local_print_at_Book_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_print_at_Book_internal_14 --> -60($fp) + # LOCAL local_print_at_Book_internal_16 --> -68($fp) + # local_print_at_Book_internal_14 = local_print_at_Book_internal_16 + lw $t1, -68($fp) + sw $t1, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Book_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_6 + sw $t1, 12($v0) + li $t1, 12 + sw $t1, 16($v0) + sw $v0, -72($fp) + # ARG local_print_at_Book_internal_17 + # LOCAL local_print_at_Book_internal_17 --> -72($fp) + lw $t1, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_14 --> -60($fp) + # LOCAL local_print_at_Book_internal_15 --> -64($fp) + # local_print_at_Book_internal_15 = VCALL local_print_at_Book_internal_14 out_string + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_12 --> -52($fp) + # LOCAL local_print_at_Book_internal_15 --> -64($fp) + # local_print_at_Book_internal_12 = local_print_at_Book_internal_15 + lw $t1, -64($fp) + sw $t1, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Book_internal_18 = GETATTRIBUTE author Book + # LOCAL local_print_at_Book_internal_18 --> -76($fp) + lw $t1, 16($s1) + sw $t1, -76($fp) + # ARG local_print_at_Book_internal_18 + # LOCAL local_print_at_Book_internal_18 --> -76($fp) + lw $t1, -76($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_12 --> -52($fp) + # LOCAL local_print_at_Book_internal_13 --> -56($fp) + # local_print_at_Book_internal_13 = VCALL local_print_at_Book_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_10 --> -44($fp) + # LOCAL local_print_at_Book_internal_13 --> -56($fp) + # local_print_at_Book_internal_10 = local_print_at_Book_internal_13 + lw $t1, -56($fp) + sw $t1, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Book_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_7 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -80($fp) + # ARG local_print_at_Book_internal_19 + # LOCAL local_print_at_Book_internal_19 --> -80($fp) + lw $t1, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Book_internal_10 --> -44($fp) + # LOCAL local_print_at_Book_internal_11 --> -48($fp) + # local_print_at_Book_internal_11 = VCALL local_print_at_Book_internal_10 out_string + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_20 --> -84($fp) + # local_print_at_Book_internal_20 = SELF + sw $s1, -84($fp) + # RETURN local_print_at_Book_internal_20 + lw $v0, -84($fp) + # Deallocate stack frame for function function_print_at_Book. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 92 + jr $ra + # Function END + + +# __Article__attrib__per_title__init implementation. +# @Params: +__Article__attrib__per_title__init: + # Allocate stack frame for function __Article__attrib__per_title__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local___attrib__per_title__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_0 + sw $t1, 12($v0) + li $t1, 0 + sw $t1, 16($v0) + sw $v0, -4($fp) + # RETURN local___attrib__per_title__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Article__attrib__per_title__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_initArticle_at_Article implementation. +# @Params: +# 0($fp) = param_initArticle_at_Article_title_p_0 +# 4($fp) = param_initArticle_at_Article_author_p_1 +# 8($fp) = param_initArticle_at_Article_per_title_p_2 +function_initArticle_at_Article: + # Allocate stack frame for function function_initArticle_at_Article. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) + # local_initArticle_at_Article_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) + # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) + # local_initArticle_at_Article_internal_0 = local_initArticle_at_Article_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_initArticle_at_Article_title_p_0 + # PARAM param_initArticle_at_Article_title_p_0 --> 8($fp) + lw $t1, 8($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # ARG param_initArticle_at_Article_author_p_1 + # PARAM param_initArticle_at_Article_author_p_1 --> 4($fp) + lw $t1, 4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) + # LOCAL local_initArticle_at_Article_internal_1 --> -8($fp) + # local_initArticle_at_Article_internal_1 = VCALL local_initArticle_at_Article_internal_0 initBook + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 28($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # PARAM param_initArticle_at_Article_per_title_p_2 --> 0($fp) + lw $t1, 0($fp) + sw $t1, 20($s1) + # LOCAL local_initArticle_at_Article_internal_3 --> -16($fp) + # local_initArticle_at_Article_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_initArticle_at_Article_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_initArticle_at_Article. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 12 + jr $ra + # Function END + + +# function_print_at_Article implementation. +# @Params: +function_print_at_Article: + # Allocate stack frame for function function_print_at_Article. + subu $sp, $sp, 60 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 60 + # LOCAL local_print_at_Article_internal_1 --> -8($fp) + # local_print_at_Article_internal_1 = SELF + sw $s1, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Article_internal_0 = CALL print + # LOCAL local_print_at_Article_internal_0 --> -4($fp) + # LOCAL local_print_at_Article_internal_1 --> -8($fp) + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type's VTABLE + la $t1, Book_vtable + # Get pointer to function address + lw $t2, 32($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -4($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Article_internal_8 --> -36($fp) + # local_print_at_Article_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_print_at_Article_internal_6 --> -28($fp) + # LOCAL local_print_at_Article_internal_8 --> -36($fp) + # local_print_at_Article_internal_6 = local_print_at_Article_internal_8 + lw $t1, -36($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Article_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_8 + sw $t1, 12($v0) + li $t1, 13 + sw $t1, 16($v0) + sw $v0, -40($fp) + # ARG local_print_at_Article_internal_9 + # LOCAL local_print_at_Article_internal_9 --> -40($fp) + lw $t1, -40($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Article_internal_6 --> -28($fp) + # LOCAL local_print_at_Article_internal_7 --> -32($fp) + # local_print_at_Article_internal_7 = VCALL local_print_at_Article_internal_6 out_string + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Article_internal_4 --> -20($fp) + # LOCAL local_print_at_Article_internal_7 --> -32($fp) + # local_print_at_Article_internal_4 = local_print_at_Article_internal_7 + lw $t1, -32($fp) + sw $t1, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Article_internal_10 = GETATTRIBUTE per_title Article + # LOCAL local_print_at_Article_internal_10 --> -44($fp) + lw $t1, 20($s1) + sw $t1, -44($fp) + # ARG local_print_at_Article_internal_10 + # LOCAL local_print_at_Article_internal_10 --> -44($fp) + lw $t1, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Article_internal_4 --> -20($fp) + # LOCAL local_print_at_Article_internal_5 --> -24($fp) + # local_print_at_Article_internal_5 = VCALL local_print_at_Article_internal_4 out_string + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Article_internal_2 --> -12($fp) + # LOCAL local_print_at_Article_internal_5 --> -24($fp) + # local_print_at_Article_internal_2 = local_print_at_Article_internal_5 + lw $t1, -24($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Article_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_9 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -48($fp) + # ARG local_print_at_Article_internal_11 + # LOCAL local_print_at_Article_internal_11 --> -48($fp) + lw $t1, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_Article_internal_2 --> -12($fp) + # LOCAL local_print_at_Article_internal_3 --> -16($fp) + # local_print_at_Article_internal_3 = VCALL local_print_at_Article_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Article_internal_12 --> -52($fp) + # local_print_at_Article_internal_12 = SELF + sw $s1, -52($fp) + # RETURN local_print_at_Article_internal_12 + lw $v0, -52($fp) + # Deallocate stack frame for function function_print_at_Article. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 60 + jr $ra + # Function END + + +# function_isNil_at_BookList implementation. +# @Params: +function_isNil_at_BookList: + # Allocate stack frame for function function_isNil_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_BookList_internal_2 --> -12($fp) + # local_isNil_at_BookList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_isNil_at_BookList_internal_0 --> -4($fp) + # LOCAL local_isNil_at_BookList_internal_2 --> -12($fp) + # local_isNil_at_BookList_internal_0 = local_isNil_at_BookList_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_isNil_at_BookList_internal_0 --> -4($fp) + # LOCAL local_isNil_at_BookList_internal_1 --> -8($fp) + # local_isNil_at_BookList_internal_1 = VCALL local_isNil_at_BookList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_isNil_at_BookList_internal_3 --> -16($fp) + # local_isNil_at_BookList_internal_3 = 1 + li $t1, 1 + sw $t1, -16($fp) + # RETURN local_isNil_at_BookList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_isNil_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cons_at_BookList implementation. +# @Params: +# 0($fp) = param_cons_at_BookList_hd_0 +function_cons_at_BookList: + # Allocate stack frame for function function_cons_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) + # local_cons_at_BookList_new_cell_0 = ALLOCATE Cons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Cons + sw $t3, 12($v0) + li $t3, 4 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Cons_start + sw $t3, 4($v0) + # Load type offset + li $t3, 28 + sw $t3, 8($v0) + move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Cons__attrib__xcar__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Cons__attrib__xcdr__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t2) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t2, -4($fp) + # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) + # local_cons_at_BookList_internal_1 = ALLOCATE Cons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Cons + sw $t4, 12($v0) + li $t4, 4 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Cons_start + sw $t4, 4($v0) + # Load type offset + li $t4, 28 + sw $t4, 8($v0) + move $t3, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Cons__attrib__xcar__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t3) + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Cons__attrib__xcdr__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t3) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t3, -8($fp) + # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) + # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) + # local_cons_at_BookList_new_cell_0 = local_cons_at_BookList_internal_1 + lw $t3, -8($fp) + sw $t3, -4($fp) + # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) + # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) + # local_cons_at_BookList_internal_2 = local_cons_at_BookList_new_cell_0 + lw $t3, -4($fp) + sw $t3, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cons_at_BookList_hd_0 + # PARAM param_cons_at_BookList_hd_0 --> 0($fp) + lw $t3, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) + # local_cons_at_BookList_internal_4 = SELF + sw $s1, -20($fp) + # ARG local_cons_at_BookList_internal_4 + # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) + lw $t3, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) + # LOCAL local_cons_at_BookList_internal_3 --> -16($fp) + # local_cons_at_BookList_internal_3 = VCALL local_cons_at_BookList_internal_2 init + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 48($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_cons_at_BookList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_cons_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_car_at_BookList implementation. +# @Params: +function_car_at_BookList: + # Allocate stack frame for function function_car_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_car_at_BookList_internal_2 --> -12($fp) + # local_car_at_BookList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_car_at_BookList_internal_0 --> -4($fp) + # LOCAL local_car_at_BookList_internal_2 --> -12($fp) + # local_car_at_BookList_internal_0 = local_car_at_BookList_internal_2 + lw $t3, -12($fp) + sw $t3, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_car_at_BookList_internal_0 --> -4($fp) + # LOCAL local_car_at_BookList_internal_1 --> -8($fp) + # local_car_at_BookList_internal_1 = VCALL local_car_at_BookList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 0($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_car_at_BookList_internal_3 --> -16($fp) + # local_car_at_BookList_internal_3 = ALLOCATE Book + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, Book + sw $t5, 12($v0) + li $t5, 4 + sw $t5, 16($v0) + move $t5, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t5, 0($v0) + la $t5, Book_start + sw $t5, 4($v0) + # Load type offset + li $t5, 16 + sw $t5, 8($v0) + move $t4, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t4) + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t4) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t4, -16($fp) + # RETURN local_car_at_BookList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_car_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cdr_at_BookList implementation. +# @Params: +function_cdr_at_BookList: + # Allocate stack frame for function function_cdr_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cdr_at_BookList_internal_2 --> -12($fp) + # local_cdr_at_BookList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_cdr_at_BookList_internal_0 --> -4($fp) + # LOCAL local_cdr_at_BookList_internal_2 --> -12($fp) + # local_cdr_at_BookList_internal_0 = local_cdr_at_BookList_internal_2 + lw $t4, -12($fp) + sw $t4, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_cdr_at_BookList_internal_0 --> -4($fp) + # LOCAL local_cdr_at_BookList_internal_1 --> -8($fp) + # local_cdr_at_BookList_internal_1 = VCALL local_cdr_at_BookList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t4, 4($s1) + # Get pointer to type's VTABLE + lw $t5, 0($t4) + # Get pointer to function address + lw $t6, 0($t5) + # Call function. Result is on $v0 + jalr $t6 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cdr_at_BookList_internal_3 --> -16($fp) + # local_cdr_at_BookList_internal_3 = ALLOCATE BookList + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t6, String + sw $t6, 0($v0) + la $t6, String_start + sw $t6, 4($v0) + # Load type offset + li $t6, 8 + sw $t6, 8($v0) + la $t6, BookList + sw $t6, 12($v0) + li $t6, 8 + sw $t6, 16($v0) + move $t6, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t6, 0($v0) + la $t6, BookList_start + sw $t6, 4($v0) + # Load type offset + li $t6, 24 + sw $t6, 8($v0) + move $t5, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t5, -16($fp) + # RETURN local_cdr_at_BookList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_cdr_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_list_at_BookList implementation. +# @Params: +function_print_list_at_BookList: + # Allocate stack frame for function function_print_list_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_print_list_at_BookList_internal_2 --> -12($fp) + # local_print_list_at_BookList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_list_at_BookList_internal_0 --> -4($fp) + # LOCAL local_print_list_at_BookList_internal_2 --> -12($fp) + # local_print_list_at_BookList_internal_0 = local_print_list_at_BookList_internal_2 + lw $t5, -12($fp) + sw $t5, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_BookList_internal_0 --> -4($fp) + # LOCAL local_print_list_at_BookList_internal_1 --> -8($fp) + # local_print_list_at_BookList_internal_1 = VCALL local_print_list_at_BookList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 0($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_list_at_BookList_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_print_list_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Cons__attrib__xcar__init implementation. +# @Params: +__Cons__attrib__xcar__init: + # Allocate stack frame for function __Cons__attrib__xcar__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Cons__attrib__xcar__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Cons__attrib__xcdr__init implementation. +# @Params: +__Cons__attrib__xcdr__init: + # Allocate stack frame for function __Cons__attrib__xcdr__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Cons__attrib__xcdr__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_Cons implementation. +# @Params: +function_isNil_at_Cons: + # Allocate stack frame for function function_isNil_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_Cons_internal_0 --> -4($fp) + # local_isNil_at_Cons_internal_0 = 0 + li $t5, 0 + sw $t5, -4($fp) + # RETURN local_isNil_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Cons implementation. +# @Params: +# 0($fp) = param_init_at_Cons_hd_0 +# 4($fp) = param_init_at_Cons_tl_1 +function_init_at_Cons: + # Allocate stack frame for function function_init_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_Cons_hd_0 --> 4($fp) + lw $t5, 4($fp) + sw $t5, 12($s1) + # + # PARAM param_init_at_Cons_tl_1 --> 0($fp) + lw $t5, 0($fp) + sw $t5, 16($s1) + # LOCAL local_init_at_Cons_internal_0 --> -4($fp) + # local_init_at_Cons_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_car_at_Cons implementation. +# @Params: +function_car_at_Cons: + # Allocate stack frame for function function_car_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_car_at_Cons_internal_0 = GETATTRIBUTE xcar Cons + # LOCAL local_car_at_Cons_internal_0 --> -4($fp) + lw $t5, 12($s1) + sw $t5, -4($fp) + # RETURN local_car_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_car_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cdr_at_Cons implementation. +# @Params: +function_cdr_at_Cons: + # Allocate stack frame for function function_cdr_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_cdr_at_Cons_internal_0 = GETATTRIBUTE xcdr Cons + # LOCAL local_cdr_at_Cons_internal_0 --> -4($fp) + lw $t5, 16($s1) + sw $t5, -4($fp) + # RETURN local_cdr_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_cdr_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_list_at_Cons implementation. +# @Params: +function_print_list_at_Cons: + # Allocate stack frame for function function_print_list_at_Cons. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # local_print_list_at_Cons_internal_2 = GETATTRIBUTE xcar Cons + # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) + lw $t5, 12($s1) + sw $t5, -12($fp) + # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) + # local_print_list_at_Cons_internal_0 = local_print_list_at_Cons_internal_2 + lw $t5, -12($fp) + sw $t5, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # local_print_list_at_Cons_internal_1 = VCALL local_print_list_at_Cons_internal_0 print + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 32($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # local_print_list_at_Cons_internal_3 = TYPEOF local_print_list_at_Cons_internal_1 + lw $t5, -8($fp) + # Load pointer to type offset + lw $t6, 8($t5) + sw $t6, -16($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # local_print_list_at_Cons_internal_5 = 14 + li $t5, 14 + sw $t5, -24($fp) + # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Book + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # Load TDT pointer to type Book + la $t5, Book__TDT + lw $t6, -16($fp) + addu $t5, $t5, $t6 + # Save distance + lw $t6, 0($t5) + sw $t6, -28($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # Update min if 13 < 14 + lw $t5, -28($fp) + lw $t6, -24($fp) + bgtu $t5, $t6, label_Not_min0_1 + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_6 + lw $t5, -28($fp) + sw $t5, -24($fp) + label_Not_min0_1: + # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Article + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # Load TDT pointer to type Article + la $t5, Article__TDT + lw $t6, -16($fp) + addu $t5, $t5, $t6 + # Save distance + lw $t6, 0($t5) + sw $t6, -28($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # Update min if 13 < 14 + lw $t5, -28($fp) + lw $t6, -24($fp) + bgtu $t5, $t6, label_Not_min1_2 + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_6 + lw $t5, -28($fp) + sw $t5, -24($fp) + label_Not_min1_2: + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_6 = 14 + li $t5, 14 + sw $t5, -28($fp) + # LOCAL local_print_list_at_Cons_internal_4 --> -20($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # local_print_list_at_Cons_internal_4 = local_print_list_at_Cons_internal_6 - local_print_list_at_Cons_internal_5 + lw $t5, -28($fp) + lw $t6, -24($fp) + sub $t5, $t5, $t6 + sw $t5, -20($fp) + # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 + # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 + lw $t5, -20($fp) + beq $t5, 0, label_ERROR_3 + # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Book + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # Load TDT pointer to type Book + la $t5, Book__TDT + lw $t6, -16($fp) + addu $t5, $t5, $t6 + # Save distance + lw $t6, 0($t5) + sw $t6, -28($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # Update min if 13 < 14 + lw $t5, -28($fp) + lw $t6, -24($fp) + bgtu $t5, $t6, label_NEXT0_5 + # LOCAL local_print_list_at_Cons_dummy_7 --> -32($fp) + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # local_print_list_at_Cons_dummy_7 = local_print_list_at_Cons_internal_1 + lw $t5, -8($fp) + sw $t5, -32($fp) + # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) + # local_print_list_at_Cons_internal_10 = SELF + sw $s1, -44($fp) + # LOCAL local_print_list_at_Cons_internal_8 --> -36($fp) + # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) + # local_print_list_at_Cons_internal_8 = local_print_list_at_Cons_internal_10 + lw $t5, -44($fp) + sw $t5, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, data_10 + sw $t5, 12($v0) + li $t5, 26 + sw $t5, 16($v0) + sw $v0, -48($fp) + # ARG local_print_list_at_Cons_internal_11 + # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) + lw $t5, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + # LOCAL local_print_list_at_Cons_internal_8 --> -36($fp) + # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) + # local_print_list_at_Cons_internal_9 = VCALL local_print_list_at_Cons_internal_8 out_string + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 12($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # GOTO label_END_4 +j label_END_4 +label_NEXT0_5: + # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Article + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # Load TDT pointer to type Article + la $t5, Article__TDT + lw $t6, -16($fp) + addu $t5, $t5, $t6 + # Save distance + lw $t6, 0($t5) + sw $t6, -28($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # Update min if 13 < 14 + lw $t5, -28($fp) + lw $t6, -24($fp) + bgtu $t5, $t6, label_NEXT1_6 + # LOCAL local_print_list_at_Cons_dummy_12 --> -52($fp) + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # local_print_list_at_Cons_dummy_12 = local_print_list_at_Cons_internal_1 + lw $t5, -8($fp) + sw $t5, -52($fp) + # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) + # local_print_list_at_Cons_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_print_list_at_Cons_internal_13 --> -56($fp) + # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) + # local_print_list_at_Cons_internal_13 = local_print_list_at_Cons_internal_15 + lw $t5, -64($fp) + sw $t5, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, data_11 + sw $t5, 12($v0) + li $t5, 29 + sw $t5, 16($v0) + sw $v0, -68($fp) + # ARG local_print_list_at_Cons_internal_16 + # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) + lw $t5, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + # LOCAL local_print_list_at_Cons_internal_13 --> -56($fp) + # LOCAL local_print_list_at_Cons_internal_14 --> -60($fp) + # local_print_list_at_Cons_internal_14 = VCALL local_print_list_at_Cons_internal_13 out_string + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 12($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # GOTO label_END_4 +j label_END_4 +label_NEXT1_6: + label_ERROR_3: + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + lw $t5, 0($s1) + sw $t5, -8($fp) + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -8($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + label_END_4: +# local_print_list_at_Cons_internal_19 = GETATTRIBUTE xcdr Cons +# LOCAL local_print_list_at_Cons_internal_19 --> -80($fp) +lw $t5, 16($s1) +sw $t5, -80($fp) +# LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) +# LOCAL local_print_list_at_Cons_internal_19 --> -80($fp) +# local_print_list_at_Cons_internal_17 = local_print_list_at_Cons_internal_19 +lw $t5, -80($fp) +sw $t5, -72($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) +# LOCAL local_print_list_at_Cons_internal_18 --> -76($fp) +# local_print_list_at_Cons_internal_18 = VCALL local_print_list_at_Cons_internal_17 print_list +# Save new self pointer in $s1 +lw $s1, -72($fp) +# Get pointer to type +lw $t5, 4($s1) +# Get pointer to type's VTABLE +lw $t6, 0($t5) +# Get pointer to function address +lw $t7, 44($t6) +# Call function. Result is on $v0 +jalr $t7 +sw $v0, -76($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# RETURN local_print_list_at_Cons_internal_18 +lw $v0, -76($fp) +# Deallocate stack frame for function function_print_list_at_Cons. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +jr $ra +# Function END + + +# function_isNil_at_Nil implementation. +# @Params: +function_isNil_at_Nil: + # Allocate stack frame for function function_isNil_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_Nil_internal_0 --> -4($fp) + # local_isNil_at_Nil_internal_0 = 1 + li $t5, 1 + sw $t5, -4($fp) + # RETURN local_isNil_at_Nil_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_list_at_Nil implementation. +# @Params: +function_print_list_at_Nil: + # Allocate stack frame for function function_print_list_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_print_list_at_Nil_internal_0 --> -4($fp) + # local_print_list_at_Nil_internal_0 = 1 + li $t5, 1 + sw $t5, -4($fp) + # RETURN local_print_list_at_Nil_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_print_list_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__books__init implementation. +# @Params: +__Main__attrib__books__init: + # Allocate stack frame for function __Main__attrib__books__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__books__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # LOCAL local_main_at_Main_a_book_0 --> -4($fp) + # local_main_at_Main_a_book_0 = ALLOCATE Book + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) + # Load type offset + li $t7, 8 + sw $t7, 8($v0) + la $t7, Book + sw $t7, 12($v0) + li $t7, 4 + sw $t7, 16($v0) + move $t7, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t7, 0($v0) + la $t7, Book_start + sw $t7, 4($v0) + # Load type offset + li $t7, 16 + sw $t7, 8($v0) + move $t6, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t6) + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t6) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t6, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE Book + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t8, String + sw $t8, 0($v0) + la $t8, String_start + sw $t8, 4($v0) + # Load type offset + li $t8, 8 + sw $t8, 8($v0) + la $t8, Book + sw $t8, 12($v0) + li $t8, 4 + sw $t8, 16($v0) + move $t8, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t8, 0($v0) + la $t8, Book_start + sw $t8, 4($v0) + # Load type offset + li $t8, 16 + sw $t8, 8($v0) + move $t7, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t7) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t7, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t7, -16($fp) + sw $t7, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) + # Load type offset + li $t7, 8 + sw $t7, 8($v0) + la $t7, data_12 + sw $t7, 12($v0) + li $t7, 44 + sw $t7, 16($v0) + sw $v0, -20($fp) + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t7, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) + # Load type offset + li $t7, 8 + sw $t7, 8($v0) + la $t7, data_13 + sw $t7, 12($v0) + li $t7, 22 + sw $t7, 16($v0) + sw $v0, -24($fp) + # ARG local_main_at_Main_internal_5 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t7, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 initBook + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t7, 4($s1) + # Get pointer to type's VTABLE + lw $t8, 0($t7) + # Get pointer to function address + lw $t9, 28($t8) + # Call function. Result is on $v0 + jalr $t9 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_a_book_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_a_book_0 = local_main_at_Main_internal_2 + lw $t7, -12($fp) + sw $t7, -4($fp) + # LOCAL local_main_at_Main_an_article_6 --> -28($fp) + # local_main_at_Main_an_article_6 = ALLOCATE Article + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) + # Load type offset + li $t9, 8 + sw $t9, 8($v0) + la $t9, Article + sw $t9, 12($v0) + li $t9, 7 + sw $t9, 16($v0) + move $t9, $v0 + # Allocating 24 bytes of memory + li $a0, 24 + li $v0, 9 + syscall + sw $t9, 0($v0) + la $t9, Article_start + sw $t9, 4($v0) + # Load type offset + li $t9, 20 + sw $t9, 8($v0) + move $t8, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Article__attrib__per_title__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t8) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t8, -28($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = ALLOCATE Article + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $s2, String + sw $s2, 0($v0) + la $s2, String_start + sw $s2, 4($v0) + # Load type offset + li $s2, 8 + sw $s2, 8($v0) + la $s2, Article + sw $s2, 12($v0) + li $s2, 7 + sw $s2, 16($v0) + move $s2, $v0 + # Allocating 24 bytes of memory + li $a0, 24 + li $v0, 9 + syscall + sw $s2, 0($v0) + la $s2, Article_start + sw $s2, 4($v0) + # Load type offset + li $s2, 20 + sw $s2, 8($v0) + move $t9, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Article__attrib__per_title__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t9) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t9, -40($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 + lw $t9, -40($fp) + sw $t9, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) + # Load type offset + li $t9, 8 + sw $t9, 8($v0) + la $t9, data_14 + sw $t9, 12($v0) + li $t9, 19 + sw $t9, 16($v0) + sw $v0, -44($fp) + # ARG local_main_at_Main_internal_10 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + lw $t9, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) + # Load type offset + li $t9, 8 + sw $t9, 8($v0) + la $t9, data_15 + sw $t9, 12($v0) + li $t9, 7 + sw $t9, 16($v0) + sw $v0, -48($fp) + # ARG local_main_at_Main_internal_11 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + lw $t9, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) + # Load type offset + li $t9, 8 + sw $t9, 8($v0) + la $t9, data_16 + sw $t9, 12($v0) + li $t9, 11 + sw $t9, 16($v0) + sw $v0, -52($fp) + # ARG local_main_at_Main_internal_12 + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + lw $t9, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 initArticle + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t9, 4($s1) + # Get pointer to type's VTABLE + lw $s2, 0($t9) + # Get pointer to function address + lw $s3, 36($s2) + # Call function. Result is on $v0 + jalr $s3 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_an_article_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_an_article_6 = local_main_at_Main_internal_8 + lw $t9, -36($fp) + sw $t9, -28($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = ALLOCATE Nil + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $s3, String + sw $s3, 0($v0) + la $s3, String_start + sw $s3, 4($v0) + # Load type offset + li $s3, 8 + sw $s3, 8($v0) + la $s3, Nil + sw $s3, 12($v0) + li $s3, 3 + sw $s3, 16($v0) + move $s3, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $s3, 0($v0) + la $s3, Nil_start + sw $s3, 4($v0) + # Load type offset + li $s3, 32 + sw $s3, 8($v0) + move $s2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $s2, -72($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 + lw $s2, -72($fp) + sw $s2, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_a_book_0 + # LOCAL local_main_at_Main_a_book_0 --> -4($fp) + lw $s2, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $s2, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 cons + # Save new self pointer in $s1 + lw $s1, -64($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 32($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_13 = local_main_at_Main_internal_16 + lw $s2, -68($fp) + sw $s2, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_an_article_6 + # LOCAL local_main_at_Main_an_article_6 --> -28($fp) + lw $s2, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $s2, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 cons + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 32($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + lw $s2, -60($fp) + sw $s2, 12($s1) + # local_main_at_Main_internal_20 = GETATTRIBUTE books Main + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + lw $s2, 12($s1) + sw $s2, -84($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 + lw $s2, -84($fp) + sw $s2, -76($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 print_list + # Save new self pointer in $s1 + lw $s1, -76($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 44($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -80($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_19 + lw $v0, -80($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 92 + jr $ra + # Function END + diff --git a/tests/codegen/complex.mips b/tests/codegen/complex.mips new file mode 100644 index 00000000..3da63417 --- /dev/null +++ b/tests/codegen/complex.mips @@ -0,0 +1,1629 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:24 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Main: .asciiz "Main" +# Function END +Complex: .asciiz "Complex" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +# **** VTABLE for type Complex **** +Complex_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Complex, function_print_at_Complex, function_reflect_0_at_Complex, function_reflect_X_at_Complex, function_reflect_Y_at_Complex +# Function END +# + + +# **** Type RECORD for type Complex **** +Complex_start: + Complex_vtable_pointer: .word Complex_vtable + # Function END +Complex_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, 1, 1 +Object__TDT: .word 1, 0, 1, 1, 2, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1 +Main__TDT: .word -1, -1, -1, -1, 0, -1 +Complex__TDT: .word -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "=)\n" +# + + +data_5: .asciiz "=(\n" +# + + +data_6: .asciiz "+" +# + + +data_7: .asciiz "I" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 28($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_c_0 = ALLOCATE Complex + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Complex + sw $t3, 12($v0) + li $t3, 7 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Complex_start + sw $t3, 4($v0) + # Load type offset + li $t3, 20 + sw $t3, 8($v0) + move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Complex__attrib__x__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Complex__attrib__y__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t2) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t2, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE Complex + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Complex + sw $t4, 12($v0) + li $t4, 7 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Complex_start + sw $t4, 4($v0) + # Load type offset + li $t4, 20 + sw $t4, 8($v0) + move $t3, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Complex__attrib__x__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t3) + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Complex__attrib__y__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t3) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t3, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t3, -16($fp) + sw $t3, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 1 + li $t3, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # ARG 1 + li $t3, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 28($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_c_0 = local_main_at_Main_internal_2 + lw $t3, -12($fp) + sw $t3, -4($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_internal_8 = local_main_at_Main_c_0 + lw $t3, -4($fp) + sw $t3, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 reflect_X + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 40($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_9 + lw $t3, -40($fp) + sw $t3, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 reflect_Y + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 44($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_c_0 + lw $t3, -4($fp) + sw $t3, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 reflect_0 + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 36($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_5 = local_main_at_Main_internal_7 - local_main_at_Main_internal_11 + lw $t3, -32($fp) + lw $t4, -48($fp) + sub $t3, $t3, $t4 + sw $t3, -24($fp) + # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_3 + # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_3 + lw $t3, -24($fp) + beq $t3, 0, label_TRUE_3 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = 0 + li $t3, 0 + sw $t3, -24($fp) + # GOTO label_END_4 +j label_END_4 +label_TRUE_3: + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = 1 + li $t3, 1 + sw $t3, -24($fp) + label_END_4: +# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_1 +# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_1 +lw $t3, -24($fp) +beq $t3, 0, label_FALSEIF_1 +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# local_main_at_Main_internal_14 = SELF +sw $s1, -60($fp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 +lw $t3, -60($fp) +sw $t3, -52($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t3, String +sw $t3, 0($v0) +la $t3, String_start +sw $t3, 4($v0) +# Load type offset +li $t3, 8 +sw $t3, 8($v0) +la $t3, data_4 +sw $t3, 12($v0) +li $t3, 3 +sw $t3, 16($v0) +sw $v0, -64($fp) +# ARG local_main_at_Main_internal_15 +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +lw $t3, -64($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string +# Save new self pointer in $s1 +lw $s1, -52($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 12($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -56($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_4 --> -20($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_4 = local_main_at_Main_internal_13 +lw $t3, -56($fp) +sw $t3, -20($fp) +# GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 + lw $t3, -76($fp) + sw $t3, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_5 + sw $t3, 12($v0) + li $t3, 3 + sw $t3, 16($v0) + sw $v0, -80($fp) + # ARG local_main_at_Main_internal_19 + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + lw $t3, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_17 + lw $t3, -72($fp) + sw $t3, -20($fp) + label_ENDIF_2: +# RETURN local_main_at_Main_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_main_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +jr $ra +# Function END + + +# __Complex__attrib__x__init implementation. +# @Params: +__Complex__attrib__x__init: + # Allocate stack frame for function __Complex__attrib__x__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Complex__attrib__x__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Complex__attrib__y__init implementation. +# @Params: +__Complex__attrib__y__init: + # Allocate stack frame for function __Complex__attrib__y__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Complex__attrib__y__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Complex implementation. +# @Params: +# 0($fp) = param_init_at_Complex_a_0 +# 4($fp) = param_init_at_Complex_b_1 +function_init_at_Complex: + # Allocate stack frame for function function_init_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_init_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + lw $t3, 12($s1) + sw $t3, -8($fp) + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + # local_init_at_Complex_internal_0 = local_init_at_Complex_internal_1 - PARAM param_init_at_Complex_a_0 + lw $t3, -8($fp) + lw $t4, 4($fp) + sub $t3, $t3, $t4 + sw $t3, -4($fp) + # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_5 + # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_5 + lw $t3, -4($fp) + beq $t3, 0, label_TRUE_5 + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # local_init_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + # GOTO label_END_6 +j label_END_6 +label_TRUE_5: + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # local_init_at_Complex_internal_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + label_END_6: +# local_init_at_Complex_internal_3 = GETATTRIBUTE y Complex +# LOCAL local_init_at_Complex_internal_3 --> -16($fp) +lw $t3, 16($s1) +sw $t3, -16($fp) +# LOCAL local_init_at_Complex_internal_2 --> -12($fp) +# LOCAL local_init_at_Complex_internal_3 --> -16($fp) +# PARAM param_init_at_Complex_b_1 --> 0($fp) +# local_init_at_Complex_internal_2 = local_init_at_Complex_internal_3 - PARAM param_init_at_Complex_b_1 +lw $t3, -16($fp) +lw $t4, 0($fp) +sub $t3, $t3, $t4 +sw $t3, -12($fp) +# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_7 +# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_7 +lw $t3, -12($fp) +beq $t3, 0, label_TRUE_7 +# LOCAL local_init_at_Complex_internal_2 --> -12($fp) +# local_init_at_Complex_internal_2 = 0 +li $t3, 0 +sw $t3, -12($fp) +# GOTO label_END_8 +j label_END_8 +label_TRUE_7: + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # local_init_at_Complex_internal_2 = 1 + li $t3, 1 + sw $t3, -12($fp) + label_END_8: +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# local_init_at_Complex_internal_4 = SELF +sw $s1, -20($fp) +# RETURN local_init_at_Complex_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_init_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +# Deallocate function args +addu $sp, $sp, 8 +jr $ra +# Function END + + +# function_print_at_Complex implementation. +# @Params: +function_print_at_Complex: + # Allocate stack frame for function function_print_at_Complex. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # local_print_at_Complex_internal_2 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_2 --> -12($fp) + lw $t3, 16($s1) + sw $t3, -12($fp) + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # LOCAL local_print_at_Complex_internal_2 --> -12($fp) + # local_print_at_Complex_internal_1 = local_print_at_Complex_internal_2 - 0 + lw $t3, -12($fp) + sub $t3, $t3, 0 + sw $t3, -8($fp) + # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_11 + # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_11 + lw $t3, -8($fp) + beq $t3, 0, label_TRUE_11 + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # local_print_at_Complex_internal_1 = 0 + li $t3, 0 + sw $t3, -8($fp) + # GOTO label_END_12 +j label_END_12 +label_TRUE_11: + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # local_print_at_Complex_internal_1 = 1 + li $t3, 1 + sw $t3, -8($fp) + label_END_12: +# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_9 +# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_9 +lw $t3, -8($fp) +beq $t3, 0, label_FALSEIF_9 +# LOCAL local_print_at_Complex_internal_5 --> -24($fp) +# local_print_at_Complex_internal_5 = SELF +sw $s1, -24($fp) +# LOCAL local_print_at_Complex_internal_3 --> -16($fp) +# LOCAL local_print_at_Complex_internal_5 --> -24($fp) +# local_print_at_Complex_internal_3 = local_print_at_Complex_internal_5 +lw $t3, -24($fp) +sw $t3, -16($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_print_at_Complex_internal_6 = GETATTRIBUTE x Complex +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +lw $t3, 12($s1) +sw $t3, -28($fp) +# ARG local_print_at_Complex_internal_6 +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +lw $t3, -28($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_print_at_Complex_internal_3 --> -16($fp) +# LOCAL local_print_at_Complex_internal_4 --> -20($fp) +# local_print_at_Complex_internal_4 = VCALL local_print_at_Complex_internal_3 out_int +# Save new self pointer in $s1 +lw $s1, -16($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 16($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -20($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_print_at_Complex_internal_0 --> -4($fp) +# LOCAL local_print_at_Complex_internal_4 --> -20($fp) +# local_print_at_Complex_internal_0 = local_print_at_Complex_internal_4 +lw $t3, -20($fp) +sw $t3, -4($fp) +# GOTO label_ENDIF_10 +j label_ENDIF_10 +label_FALSEIF_9: + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_13 = local_print_at_Complex_internal_15 + lw $t3, -64($fp) + sw $t3, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Complex_internal_16 = GETATTRIBUTE x Complex + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + lw $t3, 12($s1) + sw $t3, -68($fp) + # ARG local_print_at_Complex_internal_16 + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + lw $t3, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # LOCAL local_print_at_Complex_internal_14 --> -60($fp) + # local_print_at_Complex_internal_14 = VCALL local_print_at_Complex_internal_13 out_int + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 16($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # LOCAL local_print_at_Complex_internal_14 --> -60($fp) + # local_print_at_Complex_internal_11 = local_print_at_Complex_internal_14 + lw $t3, -60($fp) + sw $t3, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_6 + sw $t3, 12($v0) + li $t3, 1 + sw $t3, 16($v0) + sw $v0, -72($fp) + # ARG local_print_at_Complex_internal_17 + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + lw $t3, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # LOCAL local_print_at_Complex_internal_12 --> -52($fp) + # local_print_at_Complex_internal_12 = VCALL local_print_at_Complex_internal_11 out_string + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_9 --> -40($fp) + # LOCAL local_print_at_Complex_internal_12 --> -52($fp) + # local_print_at_Complex_internal_9 = local_print_at_Complex_internal_12 + lw $t3, -52($fp) + sw $t3, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Complex_internal_18 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + lw $t3, 16($s1) + sw $t3, -76($fp) + # ARG local_print_at_Complex_internal_18 + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + lw $t3, -76($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_print_at_Complex_internal_9 --> -40($fp) + # LOCAL local_print_at_Complex_internal_10 --> -44($fp) + # local_print_at_Complex_internal_10 = VCALL local_print_at_Complex_internal_9 out_int + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 16($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_7 --> -32($fp) + # LOCAL local_print_at_Complex_internal_10 --> -44($fp) + # local_print_at_Complex_internal_7 = local_print_at_Complex_internal_10 + lw $t3, -44($fp) + sw $t3, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_7 + sw $t3, 12($v0) + li $t3, 1 + sw $t3, 16($v0) + sw $v0, -80($fp) + # ARG local_print_at_Complex_internal_19 + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + lw $t3, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_print_at_Complex_internal_7 --> -32($fp) + # LOCAL local_print_at_Complex_internal_8 --> -36($fp) + # local_print_at_Complex_internal_8 = VCALL local_print_at_Complex_internal_7 out_string + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_0 --> -4($fp) + # LOCAL local_print_at_Complex_internal_8 --> -36($fp) + # local_print_at_Complex_internal_0 = local_print_at_Complex_internal_8 + lw $t3, -36($fp) + sw $t3, -4($fp) + label_ENDIF_10: +# RETURN local_print_at_Complex_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_print_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +jr $ra +# Function END + + +# function_reflect_0_at_Complex implementation. +# @Params: +function_reflect_0_at_Complex: + # Allocate stack frame for function function_reflect_0_at_Complex. + subu $sp, $sp, 44 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 44 + # local_reflect_0_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + lw $t3, 12($s1) + sw $t3, -8($fp) + # local_reflect_0_at_Complex_internal_3 = GETATTRIBUTE x Complex + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + lw $t3, 12($s1) + sw $t3, -16($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + lw $t3, -16($fp) + not $t3, $t3 + sw $t3, -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # local_reflect_0_at_Complex_internal_0 = local_reflect_0_at_Complex_internal_1 - local_reflect_0_at_Complex_internal_2 + lw $t3, -8($fp) + lw $t4, -12($fp) + sub $t3, $t3, $t4 + sw $t3, -4($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_13 + # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_13 + lw $t3, -4($fp) + beq $t3, 0, label_TRUE_13 + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # local_reflect_0_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + # GOTO label_END_14 +j label_END_14 +label_TRUE_13: + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # local_reflect_0_at_Complex_internal_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + label_END_14: +# local_reflect_0_at_Complex_internal_5 = GETATTRIBUTE y Complex +# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) +lw $t3, 16($s1) +sw $t3, -24($fp) +# local_reflect_0_at_Complex_internal_7 = GETATTRIBUTE y Complex +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +lw $t3, 16($s1) +sw $t3, -32($fp) +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +lw $t3, -32($fp) +not $t3, $t3 +sw $t3, -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) +# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# local_reflect_0_at_Complex_internal_4 = local_reflect_0_at_Complex_internal_5 - local_reflect_0_at_Complex_internal_6 +lw $t3, -24($fp) +lw $t4, -28($fp) +sub $t3, $t3, $t4 +sw $t3, -20($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_15 +# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_15 +lw $t3, -20($fp) +beq $t3, 0, label_TRUE_15 +# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) +# local_reflect_0_at_Complex_internal_4 = 0 +li $t3, 0 +sw $t3, -20($fp) +# GOTO label_END_16 +j label_END_16 +label_TRUE_15: + # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) + # local_reflect_0_at_Complex_internal_4 = 1 + li $t3, 1 + sw $t3, -20($fp) + label_END_16: +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# local_reflect_0_at_Complex_internal_8 = SELF +sw $s1, -36($fp) +# RETURN local_reflect_0_at_Complex_internal_8 +lw $v0, -36($fp) +# Deallocate stack frame for function function_reflect_0_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 44 +jr $ra +# Function END + + +# function_reflect_X_at_Complex implementation. +# @Params: +function_reflect_X_at_Complex: + # Allocate stack frame for function function_reflect_X_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_reflect_X_at_Complex_internal_1 = GETATTRIBUTE y Complex + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + lw $t3, 16($s1) + sw $t3, -8($fp) + # local_reflect_X_at_Complex_internal_3 = GETATTRIBUTE y Complex + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + lw $t3, 16($s1) + sw $t3, -16($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + lw $t3, -16($fp) + not $t3, $t3 + sw $t3, -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # local_reflect_X_at_Complex_internal_0 = local_reflect_X_at_Complex_internal_1 - local_reflect_X_at_Complex_internal_2 + lw $t3, -8($fp) + lw $t4, -12($fp) + sub $t3, $t3, $t4 + sw $t3, -4($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_17 + # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_17 + lw $t3, -4($fp) + beq $t3, 0, label_TRUE_17 + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # local_reflect_X_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + # GOTO label_END_18 +j label_END_18 +label_TRUE_17: + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # local_reflect_X_at_Complex_internal_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + label_END_18: +# LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) +# local_reflect_X_at_Complex_internal_4 = SELF +sw $s1, -20($fp) +# RETURN local_reflect_X_at_Complex_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_reflect_X_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +jr $ra +# Function END + + +# function_reflect_Y_at_Complex implementation. +# @Params: +function_reflect_Y_at_Complex: + # Allocate stack frame for function function_reflect_Y_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_reflect_Y_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + lw $t3, 12($s1) + sw $t3, -8($fp) + # local_reflect_Y_at_Complex_internal_3 = GETATTRIBUTE x Complex + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + lw $t3, 12($s1) + sw $t3, -16($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + lw $t3, -16($fp) + not $t3, $t3 + sw $t3, -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # local_reflect_Y_at_Complex_internal_0 = local_reflect_Y_at_Complex_internal_1 - local_reflect_Y_at_Complex_internal_2 + lw $t3, -8($fp) + lw $t4, -12($fp) + sub $t3, $t3, $t4 + sw $t3, -4($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_19 + # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_19 + lw $t3, -4($fp) + beq $t3, 0, label_TRUE_19 + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # local_reflect_Y_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + # GOTO label_END_20 +j label_END_20 +label_TRUE_19: + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # local_reflect_Y_at_Complex_internal_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + label_END_20: +# LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) +# local_reflect_Y_at_Complex_internal_4 = SELF +sw $s1, -20($fp) +# RETURN local_reflect_Y_at_Complex_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_reflect_Y_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +jr $ra +# Function END + diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips new file mode 100644 index 00000000..c00e99c3 --- /dev/null +++ b/tests/codegen/fib.mips @@ -0,0 +1,931 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:24 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main, function_fib_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "Enter n to find nth fibonacci number!\n" +# + + +data_5: .asciiz "\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 28($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 76 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 76 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_4 + sw $t1, 12($v0) + li $t1, 38 + sw $t1, 16($v0) + sw $v0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_6 + lw $t1, -28($fp) + sw $t1, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = SELF + sw $s1, -40($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 + lw $t1, -40($fp) + sw $t1, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 + lw $t1, -52($fp) + sw $t1, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 in_int + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 24($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_11 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + lw $t1, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 fib + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 32($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_8 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + lw $t1, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 out_int + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 16($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 + lw $t1, -64($fp) + sw $t1, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_5 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -68($fp) + # ARG local_main_at_Main_internal_16 + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + lw $t1, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 out_string + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_14 + lw $v0, -60($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 76 + jr $ra + # Function END + + +# function_fib_at_Main implementation. +# @Params: +# 0($fp) = param_fib_at_Main_i_0 +function_fib_at_Main: + # Allocate stack frame for function function_fib_at_Main. + subu $sp, $sp, 36 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 36 + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # local_fib_at_Main_a_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + # LOCAL local_fib_at_Main_b_1 --> -8($fp) + # local_fib_at_Main_b_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # LOCAL local_fib_at_Main_c_2 --> -12($fp) + # local_fib_at_Main_c_2 = 0 + li $t1, 0 + sw $t1, -12($fp) + label_WHILE_1: + # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # local_fib_at_Main_internal_3 = PARAM param_fib_at_Main_i_0 - 0 + lw $t1, 0($fp) + sub $t1, $t1, 0 + sw $t1, -16($fp) + # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 + # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 + lw $t1, -16($fp) + beq $t1, 0, label_TRUE_3 + # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # local_fib_at_Main_internal_3 = 0 + li $t1, 0 + sw $t1, -16($fp) + # GOTO label_END_4 +j label_END_4 +label_TRUE_3: + # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # local_fib_at_Main_internal_3 = 1 + li $t1, 1 + sw $t1, -16($fp) + label_END_4: +# IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 +# IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 +lw $t1, -16($fp) +beq $t1, 0, label_FALSE_5 +# LOCAL local_fib_at_Main_internal_4 --> -20($fp) +# local_fib_at_Main_internal_4 = 0 +li $t1, 0 +sw $t1, -20($fp) +# GOTO label_NOT_END_6 +j label_NOT_END_6 +label_FALSE_5: + # LOCAL local_fib_at_Main_internal_4 --> -20($fp) + # local_fib_at_Main_internal_4 = 1 + li $t1, 1 + sw $t1, -20($fp) + label_NOT_END_6: + # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 + # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 + lw $t1, -20($fp) + beq $t1, 0, label_WHILE_END_2 + # LOCAL local_fib_at_Main_internal_5 --> -24($fp) + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # LOCAL local_fib_at_Main_b_1 --> -8($fp) + # local_fib_at_Main_internal_5 = local_fib_at_Main_a_0 + local_fib_at_Main_b_1 + lw $t1, -4($fp) + lw $t2, -8($fp) + add $t1, $t1, $t2 + sw $t1, -24($fp) + # LOCAL local_fib_at_Main_c_2 --> -12($fp) + # LOCAL local_fib_at_Main_internal_5 --> -24($fp) + # local_fib_at_Main_c_2 = local_fib_at_Main_internal_5 + lw $t1, -24($fp) + sw $t1, -12($fp) + # LOCAL local_fib_at_Main_internal_6 --> -28($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # local_fib_at_Main_internal_6 = PARAM param_fib_at_Main_i_0 - 1 + lw $t1, 0($fp) + sub $t1, $t1, 1 + sw $t1, -28($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # LOCAL local_fib_at_Main_internal_6 --> -28($fp) + # PARAM param_fib_at_Main_i_0 = local_fib_at_Main_internal_6 + lw $t1, -28($fp) + sw $t1, 0($fp) + # LOCAL local_fib_at_Main_b_1 --> -8($fp) + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # local_fib_at_Main_b_1 = local_fib_at_Main_a_0 + lw $t1, -4($fp) + sw $t1, -8($fp) + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # LOCAL local_fib_at_Main_c_2 --> -12($fp) + # local_fib_at_Main_a_0 = local_fib_at_Main_c_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # GOTO label_WHILE_1 + j label_WHILE_1 + label_WHILE_END_2: + # RETURN local_fib_at_Main_c_2 + lw $v0, -12($fp) + # Deallocate stack frame for function function_fib_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 36 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + diff --git a/tests/codegen/hairyscary.mips b/tests/codegen/hairyscary.mips new file mode 100644 index 00000000..71aa99a6 --- /dev/null +++ b/tests/codegen/hairyscary.mips @@ -0,0 +1,2687 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:23 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Foo: .asciiz "Foo" +# Function END +Bar: .asciiz "Bar" +# Function END +Razz: .asciiz "Razz" +# Function END +Bazz: .asciiz "Bazz" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Foo **** +Foo_vtable: .word function_doh_at_Foo +# Function END +# + + +# **** Type RECORD for type Foo **** +Foo_start: + Foo_vtable_pointer: .word Foo_vtable + # Function END +Foo_end: +# + + +# **** VTABLE for type Bar **** +Bar_vtable: .word +# Function END +# + + +# **** Type RECORD for type Bar **** +Bar_start: + Bar_vtable_pointer: .word Bar_vtable + # Function END +Bar_end: +# + + +# **** VTABLE for type Razz **** +Razz_vtable: .word function_doh_at_Bazz +# Function END +# + + +# **** Type RECORD for type Razz **** +Razz_start: + Razz_vtable_pointer: .word Razz_vtable + # Function END +Razz_end: +# + + +# **** VTABLE for type Bazz **** +Bazz_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_printh_at_Bazz, function_doh_at_Bazz +# Function END +# + + +# **** Type RECORD for type Bazz **** +Bazz_start: + Bazz_vtable_pointer: .word Bazz_vtable + # Function END +Bazz_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, 2, 4, 3, 1, -1 +Object__TDT: .word 1, 0, 1, 1, 3, 5, 4, 2, 1 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1 +Foo__TDT: .word -1, -1, -1, -1, 0, 2, 1, -1, -1 +Bar__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1 +Razz__TDT: .word -1, -1, -1, -1, -1, 1, 0, -1, -1 +Bazz__TDT: .word -1, -1, -1, -1, 1, 3, 2, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "do nothing" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 28 bytes of memory + li $a0, 28 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 32 + sw $t2, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__a__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__b__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__c__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__d__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 12($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Foo__attrib__a__init implementation. +# @Params: +__Foo__attrib__a__init: + # Allocate stack frame for function __Foo__attrib__a__init. + subu $sp, $sp, 48 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 48 + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + # local_trib__a__init_internal_0 = SELF + sw $s1, -4($fp) + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # local_trib__a__init_internal_1 = TYPEOF local_trib__a__init_internal_0 + lw $t1, -4($fp) + # Load pointer to type offset + lw $t2, 8($t1) + sw $t2, -8($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # local_trib__a__init_internal_3 = 13 + li $t1, 13 + sw $t1, -16($fp) + # local_trib__a__init_internal_4 = TYPE_DISTANCE Razz + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # Load TDT pointer to type Razz + la $t1, Razz__TDT + lw $t2, -8($fp) + addu $t1, $t1, $t2 + # Save distance + lw $t2, 0($t1) + sw $t2, -20($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # Update min if 9 < 10 + lw $t1, -20($fp) + lw $t2, -16($fp) + bgtu $t1, $t2, label_Not_min0_1 + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_3 = local_trib__a__init_internal_4 + lw $t1, -20($fp) + sw $t1, -16($fp) + label_Not_min0_1: + # local_trib__a__init_internal_4 = TYPE_DISTANCE Foo + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # Load TDT pointer to type Foo + la $t1, Foo__TDT + lw $t2, -8($fp) + addu $t1, $t1, $t2 + # Save distance + lw $t2, 0($t1) + sw $t2, -20($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # Update min if 9 < 10 + lw $t1, -20($fp) + lw $t2, -16($fp) + bgtu $t1, $t2, label_Not_min1_2 + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_3 = local_trib__a__init_internal_4 + lw $t1, -20($fp) + sw $t1, -16($fp) + label_Not_min1_2: + # local_trib__a__init_internal_4 = TYPE_DISTANCE Bar + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bar + la $t1, Bar__TDT + lw $t2, -8($fp) + addu $t1, $t1, $t2 + # Save distance + lw $t2, 0($t1) + sw $t2, -20($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # Update min if 9 < 10 + lw $t1, -20($fp) + lw $t2, -16($fp) + bgtu $t1, $t2, label_Not_min2_3 + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_3 = local_trib__a__init_internal_4 + lw $t1, -20($fp) + sw $t1, -16($fp) + label_Not_min2_3: + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_4 = 13 + li $t1, 13 + sw $t1, -20($fp) + # LOCAL local_trib__a__init_internal_2 --> -12($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # local_trib__a__init_internal_2 = local_trib__a__init_internal_4 - local_trib__a__init_internal_3 + lw $t1, -20($fp) + lw $t2, -16($fp) + sub $t1, $t1, $t2 + sw $t1, -12($fp) + # IF_ZERO local_trib__a__init_internal_2 GOTO label_ERROR_4 + # IF_ZERO local_trib__a__init_internal_2 GOTO label_ERROR_4 + lw $t1, -12($fp) + beq $t1, 0, label_ERROR_4 + # local_trib__a__init_internal_4 = TYPE_DISTANCE Razz + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # Load TDT pointer to type Razz + la $t1, Razz__TDT + lw $t2, -8($fp) + addu $t1, $t1, $t2 + # Save distance + lw $t2, 0($t1) + sw $t2, -20($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # Update min if 9 < 10 + lw $t1, -20($fp) + lw $t2, -16($fp) + bgtu $t1, $t2, label_NEXT0_6 + # LOCAL local_trib__a__init_n_5 --> -24($fp) + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + # local_trib__a__init_n_5 = local_trib__a__init_internal_0 + lw $t1, -4($fp) + sw $t1, -24($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # local_trib__a__init_internal_6 = ALLOCATE Bar + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Bar + sw $t3, 12($v0) + li $t3, 3 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Bar_start + sw $t3, 4($v0) + # Load type offset + li $t3, 20 + sw $t3, 8($v0) + move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Bar__attrib__c__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Bar__attrib__d__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t2) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t2, -28($fp) + # GOTO label_END_5 +j label_END_5 +label_NEXT0_6: + # local_trib__a__init_internal_4 = TYPE_DISTANCE Foo + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # Load TDT pointer to type Foo + la $t2, Foo__TDT + lw $t3, -8($fp) + addu $t2, $t2, $t3 + # Save distance + lw $t3, 0($t2) + sw $t3, -20($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # Update min if 10 < 11 + lw $t2, -20($fp) + lw $t3, -16($fp) + bgtu $t2, $t3, label_NEXT1_7 + # LOCAL local_trib__a__init_n_7 --> -32($fp) + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + # local_trib__a__init_n_7 = local_trib__a__init_internal_0 + lw $t2, -4($fp) + sw $t2, -32($fp) + # LOCAL local_trib__a__init_internal_8 --> -36($fp) + # local_trib__a__init_internal_8 = ALLOCATE Razz + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Razz + sw $t4, 12($v0) + li $t4, 4 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 28 bytes of memory + li $a0, 28 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Razz_start + sw $t4, 4($v0) + # Load type offset + li $t4, 24 + sw $t4, 8($v0) + move $t3, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t3) + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t3) + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t3) + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t3) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t3, -36($fp) + # GOTO label_END_5 +j label_END_5 +label_NEXT1_7: + # local_trib__a__init_internal_4 = TYPE_DISTANCE Bar + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bar + la $t3, Bar__TDT + lw $t4, -8($fp) + addu $t3, $t3, $t4 + # Save distance + lw $t4, 0($t3) + sw $t4, -20($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # Update min if 11 < 12 + lw $t3, -20($fp) + lw $t4, -16($fp) + bgtu $t3, $t4, label_NEXT2_8 + # LOCAL local_trib__a__init_n_9 --> -40($fp) + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + # local_trib__a__init_n_9 = local_trib__a__init_internal_0 + lw $t3, -4($fp) + sw $t3, -40($fp) + # GOTO label_END_5 +j label_END_5 +label_NEXT2_8: + label_ERROR_4: + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + lw $t3, 0($s1) + sw $t3, -4($fp) + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + label_END_5: +# RETURN +# Deallocate stack frame for function __Foo__attrib__a__init. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 48 +jr $ra +# Function END + + +# __Foo__attrib__b__init implementation. +# @Params: +__Foo__attrib__b__init: + # Allocate stack frame for function __Foo__attrib__b__init. + subu $sp, $sp, 68 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 68 + # local_trib__b__init_internal_5 = GETATTRIBUTE a Foo + # LOCAL local_trib__b__init_internal_5 --> -24($fp) + lw $t3, 12($s1) + sw $t3, -24($fp) + # LOCAL local_trib__b__init_internal_3 --> -16($fp) + # LOCAL local_trib__b__init_internal_5 --> -24($fp) + # local_trib__b__init_internal_3 = local_trib__b__init_internal_5 + lw $t3, -24($fp) + sw $t3, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__b__init_internal_3 --> -16($fp) + # LOCAL local_trib__b__init_internal_4 --> -20($fp) + # local_trib__b__init_internal_4 = VCALL local_trib__b__init_internal_3 doh + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 0($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_trib__b__init_internal_8 = GETATTRIBUTE g Foo + # LOCAL local_trib__b__init_internal_8 --> -36($fp) + lw $t3, 12($s1) + sw $t3, -36($fp) + # LOCAL local_trib__b__init_internal_6 --> -28($fp) + # LOCAL local_trib__b__init_internal_8 --> -36($fp) + # local_trib__b__init_internal_6 = local_trib__b__init_internal_8 + lw $t3, -36($fp) + sw $t3, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__b__init_internal_6 --> -28($fp) + # LOCAL local_trib__b__init_internal_7 --> -32($fp) + # local_trib__b__init_internal_7 = VCALL local_trib__b__init_internal_6 doh + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 0($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_trib__b__init_internal_2 --> -12($fp) + # LOCAL local_trib__b__init_internal_4 --> -20($fp) + # LOCAL local_trib__b__init_internal_7 --> -32($fp) + # local_trib__b__init_internal_2 = local_trib__b__init_internal_4 + local_trib__b__init_internal_7 + lw $t3, -20($fp) + lw $t4, -32($fp) + add $t3, $t3, $t4 + sw $t3, -12($fp) + # LOCAL local_trib__b__init_internal_11 --> -48($fp) + # local_trib__b__init_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_trib__b__init_internal_9 --> -40($fp) + # LOCAL local_trib__b__init_internal_11 --> -48($fp) + # local_trib__b__init_internal_9 = local_trib__b__init_internal_11 + lw $t3, -48($fp) + sw $t3, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__b__init_internal_9 --> -40($fp) + # LOCAL local_trib__b__init_internal_10 --> -44($fp) + # local_trib__b__init_internal_10 = VCALL local_trib__b__init_internal_9 doh + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 0($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_trib__b__init_internal_1 --> -8($fp) + # LOCAL local_trib__b__init_internal_2 --> -12($fp) + # LOCAL local_trib__b__init_internal_10 --> -44($fp) + # local_trib__b__init_internal_1 = local_trib__b__init_internal_2 + local_trib__b__init_internal_10 + lw $t3, -12($fp) + lw $t4, -44($fp) + add $t3, $t3, $t4 + sw $t3, -8($fp) + # LOCAL local_trib__b__init_internal_14 --> -60($fp) + # local_trib__b__init_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_trib__b__init_internal_12 --> -52($fp) + # LOCAL local_trib__b__init_internal_14 --> -60($fp) + # local_trib__b__init_internal_12 = local_trib__b__init_internal_14 + lw $t3, -60($fp) + sw $t3, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__b__init_internal_12 --> -52($fp) + # LOCAL local_trib__b__init_internal_13 --> -56($fp) + # local_trib__b__init_internal_13 = VCALL local_trib__b__init_internal_12 printh + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 28($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_trib__b__init_internal_0 --> -4($fp) + # LOCAL local_trib__b__init_internal_1 --> -8($fp) + # LOCAL local_trib__b__init_internal_13 --> -56($fp) + # local_trib__b__init_internal_0 = local_trib__b__init_internal_1 + local_trib__b__init_internal_13 + lw $t3, -8($fp) + lw $t4, -56($fp) + add $t3, $t3, $t4 + sw $t3, -4($fp) + # RETURN local_trib__b__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Foo__attrib__b__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 68 + jr $ra + # Function END + + +# function_doh_at_Foo implementation. +# @Params: +function_doh_at_Foo: + # Allocate stack frame for function function_doh_at_Foo. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_doh_at_Foo_internal_1 = GETATTRIBUTE h Foo + # LOCAL local_doh_at_Foo_internal_1 --> -8($fp) + lw $t3, 12($s1) + sw $t3, -8($fp) + # LOCAL local_doh_at_Foo_i_0 --> -4($fp) + # LOCAL local_doh_at_Foo_internal_1 --> -8($fp) + # local_doh_at_Foo_i_0 = local_doh_at_Foo_internal_1 + lw $t3, -8($fp) + sw $t3, -4($fp) + # local_doh_at_Foo_internal_3 = GETATTRIBUTE h Foo + # LOCAL local_doh_at_Foo_internal_3 --> -16($fp) + lw $t3, 12($s1) + sw $t3, -16($fp) + # LOCAL local_doh_at_Foo_internal_2 --> -12($fp) + # LOCAL local_doh_at_Foo_internal_3 --> -16($fp) + # local_doh_at_Foo_internal_2 = local_doh_at_Foo_internal_3 + 2 + lw $t3, -16($fp) + add $t3, $t3, 2 + sw $t3, -12($fp) + # + # LOCAL local_doh_at_Foo_internal_2 --> -12($fp) + lw $t3, -12($fp) + sw $t3, 12($s1) + # RETURN local_doh_at_Foo_i_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_doh_at_Foo. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Bar__attrib__c__init implementation. +# @Params: +__Bar__attrib__c__init: + # Allocate stack frame for function __Bar__attrib__c__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_trib__c__init_internal_2 --> -12($fp) + # local_trib__c__init_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_trib__c__init_internal_0 --> -4($fp) + # LOCAL local_trib__c__init_internal_2 --> -12($fp) + # local_trib__c__init_internal_0 = local_trib__c__init_internal_2 + lw $t3, -12($fp) + sw $t3, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__c__init_internal_0 --> -4($fp) + # LOCAL local_trib__c__init_internal_1 --> -8($fp) + # local_trib__c__init_internal_1 = VCALL local_trib__c__init_internal_0 doh + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 0($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_trib__c__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Bar__attrib__c__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Bar__attrib__d__init implementation. +# @Params: +__Bar__attrib__d__init: + # Allocate stack frame for function __Bar__attrib__d__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_trib__d__init_internal_2 --> -12($fp) + # local_trib__d__init_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_trib__d__init_internal_0 --> -4($fp) + # LOCAL local_trib__d__init_internal_2 --> -12($fp) + # local_trib__d__init_internal_0 = local_trib__d__init_internal_2 + lw $t3, -12($fp) + sw $t3, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__d__init_internal_0 --> -4($fp) + # LOCAL local_trib__d__init_internal_1 --> -8($fp) + # local_trib__d__init_internal_1 = VCALL local_trib__d__init_internal_0 printh + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 28($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_trib__d__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Bar__attrib__d__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Razz__attrib__e__init implementation. +# @Params: +__Razz__attrib__e__init: + # Allocate stack frame for function __Razz__attrib__e__init. + subu $sp, $sp, 40 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 40 + # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) + # local_ttrib__e__init_internal_0 = SELF + sw $s1, -4($fp) + # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # local_ttrib__e__init_internal_1 = TYPEOF local_ttrib__e__init_internal_0 + lw $t3, -4($fp) + # Load pointer to type offset + lw $t4, 8($t3) + sw $t4, -8($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # local_ttrib__e__init_internal_3 = 13 + li $t3, 13 + sw $t3, -16($fp) + # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # Load TDT pointer to type Razz + la $t3, Razz__TDT + lw $t4, -8($fp) + addu $t3, $t3, $t4 + # Save distance + lw $t4, 0($t3) + sw $t4, -20($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # Update min if 11 < 12 + lw $t3, -20($fp) + lw $t4, -16($fp) + bgtu $t3, $t4, label_Not_min0_9 + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # local_ttrib__e__init_internal_3 = local_ttrib__e__init_internal_4 + lw $t3, -20($fp) + sw $t3, -16($fp) + label_Not_min0_9: + # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bar + la $t3, Bar__TDT + lw $t4, -8($fp) + addu $t3, $t3, $t4 + # Save distance + lw $t4, 0($t3) + sw $t4, -20($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # Update min if 11 < 12 + lw $t3, -20($fp) + lw $t4, -16($fp) + bgtu $t3, $t4, label_Not_min1_10 + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # local_ttrib__e__init_internal_3 = local_ttrib__e__init_internal_4 + lw $t3, -20($fp) + sw $t3, -16($fp) + label_Not_min1_10: + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # local_ttrib__e__init_internal_4 = 13 + li $t3, 13 + sw $t3, -20($fp) + # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # local_ttrib__e__init_internal_2 = local_ttrib__e__init_internal_4 - local_ttrib__e__init_internal_3 + lw $t3, -20($fp) + lw $t4, -16($fp) + sub $t3, $t3, $t4 + sw $t3, -12($fp) + # IF_ZERO local_ttrib__e__init_internal_2 GOTO label_ERROR_11 + # IF_ZERO local_ttrib__e__init_internal_2 GOTO label_ERROR_11 + lw $t3, -12($fp) + beq $t3, 0, label_ERROR_11 + # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # Load TDT pointer to type Razz + la $t3, Razz__TDT + lw $t4, -8($fp) + addu $t3, $t3, $t4 + # Save distance + lw $t4, 0($t3) + sw $t4, -20($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # Update min if 11 < 12 + lw $t3, -20($fp) + lw $t4, -16($fp) + bgtu $t3, $t4, label_NEXT0_13 + # LOCAL local_ttrib__e__init_n_5 --> -24($fp) + # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) + # local_ttrib__e__init_n_5 = local_ttrib__e__init_internal_0 + lw $t3, -4($fp) + sw $t3, -24($fp) + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # local_ttrib__e__init_internal_6 = ALLOCATE Bar + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, Bar + sw $t5, 12($v0) + li $t5, 3 + sw $t5, 16($v0) + move $t5, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t5, 0($v0) + la $t5, Bar_start + sw $t5, 4($v0) + # Load type offset + li $t5, 20 + sw $t5, 8($v0) + move $t4, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Bar__attrib__c__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t4) + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Bar__attrib__d__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t4) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t4, -28($fp) + # GOTO label_END_12 +j label_END_12 +label_NEXT0_13: + # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bar + la $t4, Bar__TDT + lw $t5, -8($fp) + addu $t4, $t4, $t5 + # Save distance + lw $t5, 0($t4) + sw $t5, -20($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # Update min if 12 < 13 + lw $t4, -20($fp) + lw $t5, -16($fp) + bgtu $t4, $t5, label_NEXT1_14 + # LOCAL local_ttrib__e__init_n_7 --> -32($fp) + # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) + # local_ttrib__e__init_n_7 = local_ttrib__e__init_internal_0 + lw $t4, -4($fp) + sw $t4, -32($fp) + # GOTO label_END_12 +j label_END_12 +label_NEXT1_14: + label_ERROR_11: + # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) + lw $t4, 0($s1) + sw $t4, -4($fp) + # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + label_END_12: +# RETURN +# Deallocate stack frame for function __Razz__attrib__e__init. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 40 +jr $ra +# Function END + + +# __Razz__attrib__f__init implementation. +# @Params: +__Razz__attrib__f__init: + # Allocate stack frame for function __Razz__attrib__f__init. + subu $sp, $sp, 80 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 80 + # local_ttrib__f__init_internal_5 = GETATTRIBUTE a Razz + # LOCAL local_ttrib__f__init_internal_5 --> -24($fp) + lw $t4, 12($s1) + sw $t4, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_ttrib__f__init_internal_4 = CALL doh + # LOCAL local_ttrib__f__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__f__init_internal_5 --> -24($fp) + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type's VTABLE + la $t4, Bazz_vtable + # Get pointer to function address + lw $t5, 0($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_ttrib__f__init_internal_8 = GETATTRIBUTE g Razz + # LOCAL local_ttrib__f__init_internal_8 --> -36($fp) + lw $t4, 12($s1) + sw $t4, -36($fp) + # LOCAL local_ttrib__f__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__f__init_internal_8 --> -36($fp) + # local_ttrib__f__init_internal_6 = local_ttrib__f__init_internal_8 + lw $t4, -36($fp) + sw $t4, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__f__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__f__init_internal_7 --> -32($fp) + # local_ttrib__f__init_internal_7 = VCALL local_ttrib__f__init_internal_6 doh + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t4, 4($s1) + # Get pointer to type's VTABLE + lw $t5, 0($t4) + # Get pointer to function address + lw $t6, 0($t5) + # Call function. Result is on $v0 + jalr $t6 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_ttrib__f__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__f__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__f__init_internal_7 --> -32($fp) + # local_ttrib__f__init_internal_3 = local_ttrib__f__init_internal_4 + local_ttrib__f__init_internal_7 + lw $t4, -20($fp) + lw $t5, -32($fp) + add $t4, $t4, $t5 + sw $t4, -16($fp) + # local_ttrib__f__init_internal_11 = GETATTRIBUTE e Razz + # LOCAL local_ttrib__f__init_internal_11 --> -48($fp) + lw $t4, 20($s1) + sw $t4, -48($fp) + # LOCAL local_ttrib__f__init_internal_9 --> -40($fp) + # LOCAL local_ttrib__f__init_internal_11 --> -48($fp) + # local_ttrib__f__init_internal_9 = local_ttrib__f__init_internal_11 + lw $t4, -48($fp) + sw $t4, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__f__init_internal_9 --> -40($fp) + # LOCAL local_ttrib__f__init_internal_10 --> -44($fp) + # local_ttrib__f__init_internal_10 = VCALL local_ttrib__f__init_internal_9 doh + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t4, 4($s1) + # Get pointer to type's VTABLE + lw $t5, 0($t4) + # Get pointer to function address + lw $t6, 0($t5) + # Call function. Result is on $v0 + jalr $t6 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_ttrib__f__init_internal_2 --> -12($fp) + # LOCAL local_ttrib__f__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__f__init_internal_10 --> -44($fp) + # local_ttrib__f__init_internal_2 = local_ttrib__f__init_internal_3 + local_ttrib__f__init_internal_10 + lw $t4, -16($fp) + lw $t5, -44($fp) + add $t4, $t4, $t5 + sw $t4, -12($fp) + # LOCAL local_ttrib__f__init_internal_14 --> -60($fp) + # local_ttrib__f__init_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_ttrib__f__init_internal_12 --> -52($fp) + # LOCAL local_ttrib__f__init_internal_14 --> -60($fp) + # local_ttrib__f__init_internal_12 = local_ttrib__f__init_internal_14 + lw $t4, -60($fp) + sw $t4, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__f__init_internal_12 --> -52($fp) + # LOCAL local_ttrib__f__init_internal_13 --> -56($fp) + # local_ttrib__f__init_internal_13 = VCALL local_ttrib__f__init_internal_12 doh + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t4, 4($s1) + # Get pointer to type's VTABLE + lw $t5, 0($t4) + # Get pointer to function address + lw $t6, 0($t5) + # Call function. Result is on $v0 + jalr $t6 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_ttrib__f__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__f__init_internal_2 --> -12($fp) + # LOCAL local_ttrib__f__init_internal_13 --> -56($fp) + # local_ttrib__f__init_internal_1 = local_ttrib__f__init_internal_2 + local_ttrib__f__init_internal_13 + lw $t4, -12($fp) + lw $t5, -56($fp) + add $t4, $t4, $t5 + sw $t4, -8($fp) + # LOCAL local_ttrib__f__init_internal_17 --> -72($fp) + # local_ttrib__f__init_internal_17 = SELF + sw $s1, -72($fp) + # LOCAL local_ttrib__f__init_internal_15 --> -64($fp) + # LOCAL local_ttrib__f__init_internal_17 --> -72($fp) + # local_ttrib__f__init_internal_15 = local_ttrib__f__init_internal_17 + lw $t4, -72($fp) + sw $t4, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__f__init_internal_15 --> -64($fp) + # LOCAL local_ttrib__f__init_internal_16 --> -68($fp) + # local_ttrib__f__init_internal_16 = VCALL local_ttrib__f__init_internal_15 printh + # Save new self pointer in $s1 + lw $s1, -64($fp) + # Get pointer to type + lw $t4, 4($s1) + # Get pointer to type's VTABLE + lw $t5, 0($t4) + # Get pointer to function address + lw $t6, 28($t5) + # Call function. Result is on $v0 + jalr $t6 + sw $v0, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_ttrib__f__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__f__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__f__init_internal_16 --> -68($fp) + # local_ttrib__f__init_internal_0 = local_ttrib__f__init_internal_1 + local_ttrib__f__init_internal_16 + lw $t4, -8($fp) + lw $t5, -68($fp) + add $t4, $t4, $t5 + sw $t4, -4($fp) + # RETURN local_ttrib__f__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Razz__attrib__f__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 80 + jr $ra + # Function END + + +# __Bazz__attrib__h__init implementation. +# @Params: +__Bazz__attrib__h__init: + # Allocate stack frame for function __Bazz__attrib__h__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 1 + li $v0, 1 + # Deallocate stack frame for function __Bazz__attrib__h__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Bazz__attrib__g__init implementation. +# @Params: +__Bazz__attrib__g__init: + # Allocate stack frame for function __Bazz__attrib__g__init. + subu $sp, $sp, 56 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 56 + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + # local_ttrib__g__init_internal_0 = SELF + sw $s1, -4($fp) + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # local_ttrib__g__init_internal_1 = TYPEOF local_ttrib__g__init_internal_0 + lw $t4, -4($fp) + # Load pointer to type offset + lw $t5, 8($t4) + sw $t5, -8($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # local_ttrib__g__init_internal_3 = 13 + li $t4, 13 + sw $t4, -16($fp) + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bazz + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bazz + la $t4, Bazz__TDT + lw $t5, -8($fp) + addu $t4, $t4, $t5 + # Save distance + lw $t5, 0($t4) + sw $t5, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 12 < 13 + lw $t4, -20($fp) + lw $t5, -16($fp) + bgtu $t4, $t5, label_Not_min0_15 + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 + lw $t4, -20($fp) + sw $t4, -16($fp) + label_Not_min0_15: + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Razz + la $t4, Razz__TDT + lw $t5, -8($fp) + addu $t4, $t4, $t5 + # Save distance + lw $t5, 0($t4) + sw $t5, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 12 < 13 + lw $t4, -20($fp) + lw $t5, -16($fp) + bgtu $t4, $t5, label_Not_min1_16 + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 + lw $t4, -20($fp) + sw $t4, -16($fp) + label_Not_min1_16: + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Foo + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Foo + la $t4, Foo__TDT + lw $t5, -8($fp) + addu $t4, $t4, $t5 + # Save distance + lw $t5, 0($t4) + sw $t5, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 12 < 13 + lw $t4, -20($fp) + lw $t5, -16($fp) + bgtu $t4, $t5, label_Not_min2_17 + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 + lw $t4, -20($fp) + sw $t4, -16($fp) + label_Not_min2_17: + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bar + la $t4, Bar__TDT + lw $t5, -8($fp) + addu $t4, $t4, $t5 + # Save distance + lw $t5, 0($t4) + sw $t5, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 12 < 13 + lw $t4, -20($fp) + lw $t5, -16($fp) + bgtu $t4, $t5, label_Not_min3_18 + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 + lw $t4, -20($fp) + sw $t4, -16($fp) + label_Not_min3_18: + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_4 = 13 + li $t4, 13 + sw $t4, -20($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # local_ttrib__g__init_internal_2 = local_ttrib__g__init_internal_4 - local_ttrib__g__init_internal_3 + lw $t4, -20($fp) + lw $t5, -16($fp) + sub $t4, $t4, $t5 + sw $t4, -12($fp) + # IF_ZERO local_ttrib__g__init_internal_2 GOTO label_ERROR_19 + # IF_ZERO local_ttrib__g__init_internal_2 GOTO label_ERROR_19 + lw $t4, -12($fp) + beq $t4, 0, label_ERROR_19 + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bazz + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bazz + la $t4, Bazz__TDT + lw $t5, -8($fp) + addu $t4, $t4, $t5 + # Save distance + lw $t5, 0($t4) + sw $t5, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 12 < 13 + lw $t4, -20($fp) + lw $t5, -16($fp) + bgtu $t4, $t5, label_NEXT0_21 + # LOCAL local_ttrib__g__init_n_5 --> -24($fp) + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + # local_ttrib__g__init_n_5 = local_ttrib__g__init_internal_0 + lw $t4, -4($fp) + sw $t4, -24($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # local_ttrib__g__init_internal_6 = ALLOCATE Foo + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t6, String + sw $t6, 0($v0) + la $t6, String_start + sw $t6, 4($v0) + # Load type offset + li $t6, 8 + sw $t6, 8($v0) + la $t6, Foo + sw $t6, 12($v0) + li $t6, 3 + sw $t6, 16($v0) + move $t6, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t6, 0($v0) + la $t6, Foo_start + sw $t6, 4($v0) + # Load type offset + li $t6, 16 + sw $t6, 8($v0) + move $t5, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t5) + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t5) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t5, -28($fp) + # GOTO label_END_20 +j label_END_20 +label_NEXT0_21: + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Razz + la $t5, Razz__TDT + lw $t6, -8($fp) + addu $t5, $t5, $t6 + # Save distance + lw $t6, 0($t5) + sw $t6, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 13 < 14 + lw $t5, -20($fp) + lw $t6, -16($fp) + bgtu $t5, $t6, label_NEXT1_22 + # LOCAL local_ttrib__g__init_n_7 --> -32($fp) + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + # local_ttrib__g__init_n_7 = local_ttrib__g__init_internal_0 + lw $t5, -4($fp) + sw $t5, -32($fp) + # LOCAL local_ttrib__g__init_internal_8 --> -36($fp) + # local_ttrib__g__init_internal_8 = ALLOCATE Bar + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) + # Load type offset + li $t7, 8 + sw $t7, 8($v0) + la $t7, Bar + sw $t7, 12($v0) + li $t7, 3 + sw $t7, 16($v0) + move $t7, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t7, 0($v0) + la $t7, Bar_start + sw $t7, 4($v0) + # Load type offset + li $t7, 20 + sw $t7, 8($v0) + move $t6, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __Bar__attrib__c__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t6) + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __Bar__attrib__d__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t6) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t6, -36($fp) + # GOTO label_END_20 +j label_END_20 +label_NEXT1_22: + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Foo + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Foo + la $t6, Foo__TDT + lw $t7, -8($fp) + addu $t6, $t6, $t7 + # Save distance + lw $t7, 0($t6) + sw $t7, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 14 < 15 + lw $t6, -20($fp) + lw $t7, -16($fp) + bgtu $t6, $t7, label_NEXT2_23 + # LOCAL local_ttrib__g__init_n_9 --> -40($fp) + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + # local_ttrib__g__init_n_9 = local_ttrib__g__init_internal_0 + lw $t6, -4($fp) + sw $t6, -40($fp) + # LOCAL local_ttrib__g__init_internal_10 --> -44($fp) + # local_ttrib__g__init_internal_10 = ALLOCATE Razz + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t8, String + sw $t8, 0($v0) + la $t8, String_start + sw $t8, 4($v0) + # Load type offset + li $t8, 8 + sw $t8, 8($v0) + la $t8, Razz + sw $t8, 12($v0) + li $t8, 4 + sw $t8, 16($v0) + move $t8, $v0 + # Allocating 28 bytes of memory + li $a0, 28 + li $v0, 9 + syscall + sw $t8, 0($v0) + la $t8, Razz_start + sw $t8, 4($v0) + # Load type offset + li $t8, 24 + sw $t8, 8($v0) + move $t7, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t7) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t7, -44($fp) + # GOTO label_END_20 +j label_END_20 +label_NEXT2_23: + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bar + la $t7, Bar__TDT + lw $t8, -8($fp) + addu $t7, $t7, $t8 + # Save distance + lw $t8, 0($t7) + sw $t8, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 15 < 24 + lw $t7, -20($fp) + lw $t8, -16($fp) + bgtu $t7, $t8, label_NEXT3_24 + # LOCAL local_ttrib__g__init_n_11 --> -48($fp) + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + # local_ttrib__g__init_n_11 = local_ttrib__g__init_internal_0 + lw $t7, -4($fp) + sw $t7, -48($fp) + # GOTO label_END_20 +j label_END_20 +label_NEXT3_24: + label_ERROR_19: + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + lw $t7, 0($s1) + sw $t7, -4($fp) + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + label_END_20: +# RETURN +# Deallocate stack frame for function __Bazz__attrib__g__init. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 56 +jr $ra +# Function END + + +# __Bazz__attrib__i__init implementation. +# @Params: +__Bazz__attrib__i__init: + # Allocate stack frame for function __Bazz__attrib__i__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__i__init_internal_2 --> -12($fp) + # local_ttrib__i__init_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_ttrib__i__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__i__init_internal_2 --> -12($fp) + # local_ttrib__i__init_internal_0 = local_ttrib__i__init_internal_2 + lw $t7, -12($fp) + sw $t7, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__i__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__i__init_internal_1 --> -8($fp) + # local_ttrib__i__init_internal_1 = VCALL local_ttrib__i__init_internal_0 printh + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t7, 4($s1) + # Get pointer to type's VTABLE + lw $t8, 0($t7) + # Get pointer to function address + lw $t9, 28($t8) + # Call function. Result is on $v0 + jalr $t9 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_ttrib__i__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Bazz__attrib__i__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_printh_at_Bazz implementation. +# @Params: +function_printh_at_Bazz: + # Allocate stack frame for function function_printh_at_Bazz. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_printh_at_Bazz_internal_2 --> -12($fp) + # local_printh_at_Bazz_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_printh_at_Bazz_internal_0 --> -4($fp) + # LOCAL local_printh_at_Bazz_internal_2 --> -12($fp) + # local_printh_at_Bazz_internal_0 = local_printh_at_Bazz_internal_2 + lw $t7, -12($fp) + sw $t7, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_printh_at_Bazz_internal_3 = GETATTRIBUTE h Bazz + # LOCAL local_printh_at_Bazz_internal_3 --> -16($fp) + lw $t7, 12($s1) + sw $t7, -16($fp) + # ARG local_printh_at_Bazz_internal_3 + # LOCAL local_printh_at_Bazz_internal_3 --> -16($fp) + lw $t7, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + # LOCAL local_printh_at_Bazz_internal_0 --> -4($fp) + # LOCAL local_printh_at_Bazz_internal_1 --> -8($fp) + # local_printh_at_Bazz_internal_1 = VCALL local_printh_at_Bazz_internal_0 out_int + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t7, 4($s1) + # Get pointer to type's VTABLE + lw $t8, 0($t7) + # Get pointer to function address + lw $t9, 16($t8) + # Call function. Result is on $v0 + jalr $t9 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function function_printh_at_Bazz. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_doh_at_Bazz implementation. +# @Params: +function_doh_at_Bazz: + # Allocate stack frame for function function_doh_at_Bazz. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_doh_at_Bazz_internal_1 = GETATTRIBUTE h Bazz + # LOCAL local_doh_at_Bazz_internal_1 --> -8($fp) + lw $t7, 12($s1) + sw $t7, -8($fp) + # LOCAL local_doh_at_Bazz_i_0 --> -4($fp) + # LOCAL local_doh_at_Bazz_internal_1 --> -8($fp) + # local_doh_at_Bazz_i_0 = local_doh_at_Bazz_internal_1 + lw $t7, -8($fp) + sw $t7, -4($fp) + # local_doh_at_Bazz_internal_3 = GETATTRIBUTE h Bazz + # LOCAL local_doh_at_Bazz_internal_3 --> -16($fp) + lw $t7, 12($s1) + sw $t7, -16($fp) + # LOCAL local_doh_at_Bazz_internal_2 --> -12($fp) + # LOCAL local_doh_at_Bazz_internal_3 --> -16($fp) + # local_doh_at_Bazz_internal_2 = local_doh_at_Bazz_internal_3 + 1 + lw $t7, -16($fp) + add $t7, $t7, 1 + sw $t7, -12($fp) + # + # LOCAL local_doh_at_Bazz_internal_2 --> -12($fp) + lw $t7, -12($fp) + sw $t7, 12($s1) + # RETURN local_doh_at_Bazz_i_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_doh_at_Bazz. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__a__init implementation. +# @Params: +__Main__attrib__a__init: + # Allocate stack frame for function __Main__attrib__a__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__a__init_internal_0 --> -4($fp) + # local_ttrib__a__init_internal_0 = ALLOCATE Bazz + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) + # Load type offset + li $t9, 8 + sw $t9, 8($v0) + la $t9, Bazz + sw $t9, 12($v0) + li $t9, 4 + sw $t9, 16($v0) + move $t9, $v0 + # Allocating 24 bytes of memory + li $a0, 24 + li $v0, 9 + syscall + sw $t9, 0($v0) + la $t9, Bazz_start + sw $t9, 4($v0) + # Load type offset + li $t9, 28 + sw $t9, 8($v0) + move $t8, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t8) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t8, -4($fp) + # RETURN local_ttrib__a__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__a__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__b__init implementation. +# @Params: +__Main__attrib__b__init: + # Allocate stack frame for function __Main__attrib__b__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__b__init_internal_0 --> -4($fp) + # local_ttrib__b__init_internal_0 = ALLOCATE Foo + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $s2, String + sw $s2, 0($v0) + la $s2, String_start + sw $s2, 4($v0) + # Load type offset + li $s2, 8 + sw $s2, 8($v0) + la $s2, Foo + sw $s2, 12($v0) + li $s2, 3 + sw $s2, 16($v0) + move $s2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $s2, 0($v0) + la $s2, Foo_start + sw $s2, 4($v0) + # Load type offset + li $s2, 16 + sw $s2, 8($v0) + move $t9, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t9) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t9, -4($fp) + # RETURN local_ttrib__b__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__b__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__c__init implementation. +# @Params: +__Main__attrib__c__init: + # Allocate stack frame for function __Main__attrib__c__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__c__init_internal_0 --> -4($fp) + # local_ttrib__c__init_internal_0 = ALLOCATE Razz + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $s3, String + sw $s3, 0($v0) + la $s3, String_start + sw $s3, 4($v0) + # Load type offset + li $s3, 8 + sw $s3, 8($v0) + la $s3, Razz + sw $s3, 12($v0) + li $s3, 4 + sw $s3, 16($v0) + move $s3, $v0 + # Allocating 28 bytes of memory + li $a0, 28 + li $v0, 9 + syscall + sw $s3, 0($v0) + la $s3, Razz_start + sw $s3, 4($v0) + # Load type offset + li $s3, 24 + sw $s3, 8($v0) + move $s2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register s2 into stack + subu $sp, $sp, 4 + sw $s2, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register s2 + lw $s2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($s2) + # Push register s2 into stack + subu $sp, $sp, 4 + sw $s2, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register s2 + lw $s2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($s2) + # Push register s2 into stack + subu $sp, $sp, 4 + sw $s2, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register s2 + lw $s2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($s2) + # Push register s2 into stack + subu $sp, $sp, 4 + sw $s2, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register s2 + lw $s2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($s2) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $s2, -4($fp) + # RETURN local_ttrib__c__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__c__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__d__init implementation. +# @Params: +__Main__attrib__d__init: + # Allocate stack frame for function __Main__attrib__d__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__d__init_internal_0 --> -4($fp) + # local_ttrib__d__init_internal_0 = ALLOCATE Bar + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $s4, String + sw $s4, 0($v0) + la $s4, String_start + sw $s4, 4($v0) + # Load type offset + li $s4, 8 + sw $s4, 8($v0) + la $s4, Bar + sw $s4, 12($v0) + li $s4, 3 + sw $s4, 16($v0) + move $s4, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $s4, 0($v0) + la $s4, Bar_start + sw $s4, 4($v0) + # Load type offset + li $s4, 20 + sw $s4, 8($v0) + move $s3, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register s3 into stack + subu $sp, $sp, 4 + sw $s3, 0($sp) + jal __Bar__attrib__c__init + # Pop 4 bytes from stack into register s3 + lw $s3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($s3) + # Push register s3 into stack + subu $sp, $sp, 4 + sw $s3, 0($sp) + jal __Bar__attrib__d__init + # Pop 4 bytes from stack into register s3 + lw $s3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($s3) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $s3, -4($fp) + # RETURN local_ttrib__d__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__d__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $s3, String + sw $s3, 0($v0) + la $s3, String_start + sw $s3, 4($v0) + # Load type offset + li $s3, 8 + sw $s3, 8($v0) + la $s3, data_4 + sw $s3, 12($v0) + li $s3, 10 + sw $s3, 16($v0) + sw $v0, -4($fp) + # RETURN local_main_at_Main_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips new file mode 100644 index 00000000..4e277f8c --- /dev/null +++ b/tests/codegen/hello_world.mips @@ -0,0 +1,663 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:23 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "Hello, World.\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 28($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_4 + sw $t1, 12($v0) + li $t1, 14 + sw $t1, 16($v0) + sw $v0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips new file mode 100644 index 00000000..56ee5bf6 --- /dev/null +++ b/tests/codegen/io.mips @@ -0,0 +1,1368 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:24 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +A: .asciiz "A" +# Function END +B: .asciiz "B" +# Function END +C: .asciiz "C" +# Function END +D: .asciiz "D" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type A **** +A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A +# Function END +# + + +# **** Type RECORD for type A **** +A_start: + A_vtable_pointer: .word A_vtable + # Function END +A_end: +# + + +# **** VTABLE for type B **** +B_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A, function_out_b_at_B +# Function END +# + + +# **** Type RECORD for type B **** +B_start: + B_vtable_pointer: .word B_vtable + # Function END +B_end: +# + + +# **** VTABLE for type C **** +C_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_out_c_at_C +# Function END +# + + +# **** Type RECORD for type C **** +C_start: + C_vtable_pointer: .word C_vtable + # Function END +C_end: +# + + +# **** VTABLE for type D **** +D_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_out_c_at_C, function_out_d_at_D +# Function END +# + + +# **** Type RECORD for type D **** +D_start: + D_vtable_pointer: .word D_vtable + # Function END +D_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, -1, 1, 2, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2, 2, 3, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1 +A__TDT: .word -1, -1, -1, -1, 0, 1, -1, -1, -1 +B__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1 +C__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, -1 +D__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "A: Hello world\n" +# + + +data_5: .asciiz "B: Hello world\n" +# + + +data_6: .asciiz "C: Hello world\n" +# + + +data_7: .asciiz "D: Hello world\n" +# + + +data_8: .asciiz "Done.\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 32 + sw $t2, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 28($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __A__attrib__io__init implementation. +# @Params: +__A__attrib__io__init: + # Allocate stack frame for function __A__attrib__io__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ib__io__init_internal_0 --> -4($fp) + # local_ib__io__init_internal_0 = ALLOCATE IO + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, IO + sw $t3, 12($v0) + li $t3, 2 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, IO_start + sw $t3, 4($v0) + # Load type offset + li $t3, 0 + sw $t3, 8($v0) + move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t2, -4($fp) + # RETURN local_ib__io__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __A__attrib__io__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_a_at_A implementation. +# @Params: +function_out_a_at_A: + # Allocate stack frame for function function_out_a_at_A. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_out_a_at_A_internal_2 = GETATTRIBUTE io A + # LOCAL local_out_a_at_A_internal_2 --> -12($fp) + lw $t2, 12($s1) + sw $t2, -12($fp) + # LOCAL local_out_a_at_A_internal_0 --> -4($fp) + # LOCAL local_out_a_at_A_internal_2 --> -12($fp) + # local_out_a_at_A_internal_0 = local_out_a_at_A_internal_2 + lw $t2, -12($fp) + sw $t2, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_out_a_at_A_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_4 + sw $t2, 12($v0) + li $t2, 15 + sw $t2, 16($v0) + sw $v0, -16($fp) + # ARG local_out_a_at_A_internal_3 + # LOCAL local_out_a_at_A_internal_3 --> -16($fp) + lw $t2, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_out_a_at_A_internal_0 --> -4($fp) + # LOCAL local_out_a_at_A_internal_1 --> -8($fp) + # local_out_a_at_A_internal_1 = VCALL local_out_a_at_A_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 12($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_out_a_at_A_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_a_at_A. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_b_at_B implementation. +# @Params: +function_out_b_at_B: + # Allocate stack frame for function function_out_b_at_B. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_out_b_at_B_internal_2 = GETATTRIBUTE io B + # LOCAL local_out_b_at_B_internal_2 --> -12($fp) + lw $t2, 12($s1) + sw $t2, -12($fp) + # LOCAL local_out_b_at_B_internal_0 --> -4($fp) + # LOCAL local_out_b_at_B_internal_2 --> -12($fp) + # local_out_b_at_B_internal_0 = local_out_b_at_B_internal_2 + lw $t2, -12($fp) + sw $t2, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_out_b_at_B_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_5 + sw $t2, 12($v0) + li $t2, 15 + sw $t2, 16($v0) + sw $v0, -16($fp) + # ARG local_out_b_at_B_internal_3 + # LOCAL local_out_b_at_B_internal_3 --> -16($fp) + lw $t2, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_out_b_at_B_internal_0 --> -4($fp) + # LOCAL local_out_b_at_B_internal_1 --> -8($fp) + # local_out_b_at_B_internal_1 = VCALL local_out_b_at_B_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 12($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_out_b_at_B_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_b_at_B. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_c_at_C implementation. +# @Params: +function_out_c_at_C: + # Allocate stack frame for function function_out_c_at_C. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_out_c_at_C_internal_2 --> -12($fp) + # local_out_c_at_C_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_out_c_at_C_internal_0 --> -4($fp) + # LOCAL local_out_c_at_C_internal_2 --> -12($fp) + # local_out_c_at_C_internal_0 = local_out_c_at_C_internal_2 + lw $t2, -12($fp) + sw $t2, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_out_c_at_C_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_6 + sw $t2, 12($v0) + li $t2, 15 + sw $t2, 16($v0) + sw $v0, -16($fp) + # ARG local_out_c_at_C_internal_3 + # LOCAL local_out_c_at_C_internal_3 --> -16($fp) + lw $t2, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_out_c_at_C_internal_0 --> -4($fp) + # LOCAL local_out_c_at_C_internal_1 --> -8($fp) + # local_out_c_at_C_internal_1 = VCALL local_out_c_at_C_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 12($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_out_c_at_C_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_c_at_C. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_d_at_D implementation. +# @Params: +function_out_d_at_D: + # Allocate stack frame for function function_out_d_at_D. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_out_d_at_D_internal_2 --> -12($fp) + # local_out_d_at_D_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_out_d_at_D_internal_0 --> -4($fp) + # LOCAL local_out_d_at_D_internal_2 --> -12($fp) + # local_out_d_at_D_internal_0 = local_out_d_at_D_internal_2 + lw $t2, -12($fp) + sw $t2, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_out_d_at_D_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_7 + sw $t2, 12($v0) + li $t2, 15 + sw $t2, 16($v0) + sw $v0, -16($fp) + # ARG local_out_d_at_D_internal_3 + # LOCAL local_out_d_at_D_internal_3 --> -16($fp) + lw $t2, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_out_d_at_D_internal_0 --> -4($fp) + # LOCAL local_out_d_at_D_internal_1 --> -8($fp) + # local_out_d_at_D_internal_1 = VCALL local_out_d_at_D_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 12($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_out_d_at_D_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_d_at_D. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 72 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 72 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = ALLOCATE A + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, A + sw $t4, 12($v0) + li $t4, 1 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, A_start + sw $t4, 4($v0) + # Load type offset + li $t4, 16 + sw $t4, 8($v0) + move $t3, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __A__attrib__io__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t3) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t3, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t3, -12($fp) + sw $t3, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_a + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = ALLOCATE B + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, B + sw $t5, 12($v0) + li $t5, 1 + sw $t5, 16($v0) + move $t5, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t5, 0($v0) + la $t5, B_start + sw $t5, 4($v0) + # Load type offset + li $t5, 20 + sw $t5, 8($v0) + move $t4, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __A__attrib__io__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t4) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t4, -24($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 + lw $t4, -24($fp) + sw $t4, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 out_b + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t4, 4($s1) + # Get pointer to type's VTABLE + lw $t5, 0($t4) + # Get pointer to function address + lw $t6, 16($t5) + # Call function. Result is on $v0 + jalr $t6 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = ALLOCATE C + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t6, String + sw $t6, 0($v0) + la $t6, String_start + sw $t6, 4($v0) + # Load type offset + li $t6, 8 + sw $t6, 8($v0) + la $t6, C + sw $t6, 12($v0) + li $t6, 1 + sw $t6, 16($v0) + move $t6, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t6, 0($v0) + la $t6, C_start + sw $t6, 4($v0) + # Load type offset + li $t6, 24 + sw $t6, 8($v0) + move $t5, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t5, -36($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 + lw $t5, -36($fp) + sw $t5, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_c + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t5, 4($s1) + # Get pointer to type's VTABLE + lw $t6, 0($t5) + # Get pointer to function address + lw $t7, 28($t6) + # Call function. Result is on $v0 + jalr $t7 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = ALLOCATE D + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) + # Load type offset + li $t7, 8 + sw $t7, 8($v0) + la $t7, D + sw $t7, 12($v0) + li $t7, 1 + sw $t7, 16($v0) + move $t7, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t7, 0($v0) + la $t7, D_start + sw $t7, 4($v0) + # Load type offset + li $t7, 28 + sw $t7, 8($v0) + move $t6, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t6, -48($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 + lw $t6, -48($fp) + sw $t6, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_d + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t6, 4($s1) + # Get pointer to type's VTABLE + lw $t7, 0($t6) + # Get pointer to function address + lw $t8, 32($t7) + # Call function. Result is on $v0 + jalr $t8 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 + lw $t6, -60($fp) + sw $t6, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t6, String + sw $t6, 0($v0) + la $t6, String_start + sw $t6, 4($v0) + # Load type offset + li $t6, 8 + sw $t6, 8($v0) + la $t6, data_8 + sw $t6, 12($v0) + li $t6, 6 + sw $t6, 16($v0) + sw $v0, -64($fp) + # ARG local_main_at_Main_internal_15 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + lw $t6, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t6, 4($s1) + # Get pointer to type's VTABLE + lw $t7, 0($t6) + # Get pointer to function address + lw $t8, 12($t7) + # Call function. Result is on $v0 + jalr $t8 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_13 + lw $v0, -56($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 72 + jr $ra + # Function END + diff --git a/tests/codegen/life.mips b/tests/codegen/life.mips new file mode 100644 index 00000000..1adb1426 --- /dev/null +++ b/tests/codegen/life.mips @@ -0,0 +1,8661 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:26 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Board: .asciiz "Board" +# Function END +CellularAutomaton: .asciiz "CellularAutomaton" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Board **** +Board_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_size_of_board_at_Board, function_board_init_at_Board +# Function END +# + + +# **** Type RECORD for type Board **** +Board_start: + Board_vtable_pointer: .word Board_vtable + # Function END +Board_end: +# + + +# **** VTABLE for type CellularAutomaton **** +CellularAutomaton_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_size_of_board_at_Board, function_board_init_at_Board, function_init_at_CellularAutomaton, function_print_at_CellularAutomaton, function_num_cells_at_CellularAutomaton, function_cell_at_CellularAutomaton, function_north_at_CellularAutomaton, function_south_at_CellularAutomaton, function_east_at_CellularAutomaton, function_west_at_CellularAutomaton, function_northwest_at_CellularAutomaton, function_northeast_at_CellularAutomaton, function_southeast_at_CellularAutomaton, function_southwest_at_CellularAutomaton, function_neighbors_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_evolve_at_CellularAutomaton, function_option_at_CellularAutomaton, function_prompt_at_CellularAutomaton, function_prompt2_at_CellularAutomaton +# Function END +# + + +# **** Type RECORD for type CellularAutomaton **** +CellularAutomaton_start: + CellularAutomaton_vtable_pointer: .word CellularAutomaton_vtable + # Function END +CellularAutomaton_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_CellularAutomaton, function_type_name_at_CellularAutomaton, function_copy_at_CellularAutomaton, function_out_string_at_CellularAutomaton, function_out_int_at_CellularAutomaton, function_in_string_at_CellularAutomaton, function_in_int_at_CellularAutomaton, function_size_of_board_at_Board, function_board_init_at_Board, function_init_at_CellularAutomaton, function_print_at_CellularAutomaton, function_num_cells_at_CellularAutomaton, function_cell_at_CellularAutomaton, function_north_at_CellularAutomaton, function_south_at_CellularAutomaton, function_east_at_CellularAutomaton, function_west_at_CellularAutomaton, function_northwest_at_CellularAutomaton, function_northeast_at_CellularAutomaton, function_southeast_at_CellularAutomaton, function_southwest_at_CellularAutomaton, function_neighbors_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_evolve_at_CellularAutomaton, function_option_at_CellularAutomaton, function_prompt_at_CellularAutomaton, function_prompt2_at_CellularAutomaton, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, 1, 2, 3 +Object__TDT: .word 1, 0, 1, 1, 2, 3, 4 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 +Board__TDT: .word -1, -1, -1, -1, 0, 1, 2 +CellularAutomaton__TDT: .word -1, -1, -1, -1, -1, 0, 1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "\n" +# + + +data_5: .asciiz "\n" +# + + +data_6: .asciiz "\n" +# + + +data_7: .asciiz " " +# + + +data_8: .asciiz " " +# + + +data_9: .asciiz " " +# + + +data_10: .asciiz " " +# + + +data_11: .asciiz " " +# + + +data_12: .asciiz " " +# + + +data_13: .asciiz " " +# + + +data_14: .asciiz " " +# + + +data_15: .asciiz " " +# + + +data_16: .asciiz " " +# + + +data_17: .asciiz " " +# + + +data_18: .asciiz " " +# + + +data_19: .asciiz " " +# + + +data_20: .asciiz " " +# + + +data_21: .asciiz "X" +# + + +data_22: .asciiz "X" +# + + +data_23: .asciiz "X" +# + + +data_24: .asciiz "X" +# + + +data_25: .asciiz "X" +# + + +data_26: .asciiz "X" +# + + +data_27: .asciiz "X" +# + + +data_28: .asciiz "X" +# + + +data_29: .asciiz "X" +# + + +data_30: .asciiz "X" +# + + +data_31: .asciiz "X" +# + + +data_32: .asciiz "-" +# + + +data_33: .asciiz "-" +# + + +data_34: .asciiz "\nPlease chose a number:\n" +# + + +data_35: .asciiz "\t1: A cross\n" +# + + +data_36: .asciiz "\t2: A slash from the upper left to lower right\n" +# + + +data_37: .asciiz "\t3: A slash from the upper right to lower left\n" +# + + +data_38: .asciiz "\t4: An X\n" +# + + +data_39: .asciiz "\t5: A greater than sign \n" +# + + +data_40: .asciiz "\t6: A less than sign\n" +# + + +data_41: .asciiz "\t7: Two greater than signs\n" +# + + +data_42: .asciiz "\t8: Two less than signs\n" +# + + +data_43: .asciiz "\t9: A 'V'\n" +# + + +data_44: .asciiz "\t10: An inverse 'V'\n" +# + + +data_45: .asciiz "\t11: Numbers 9 and 10 combined\n" +# + + +data_46: .asciiz "\t12: A full grid\n" +# + + +data_47: .asciiz "\t13: A 'T'\n" +# + + +data_48: .asciiz "\t14: A plus '+'\n" +# + + +data_49: .asciiz "\t15: A 'W'\n" +# + + +data_50: .asciiz "\t16: An 'M'\n" +# + + +data_51: .asciiz "\t17: An 'E'\n" +# + + +data_52: .asciiz "\t18: A '3'\n" +# + + +data_53: .asciiz "\t19: An 'O'\n" +# + + +data_54: .asciiz "\t20: An '8'\n" +# + + +data_55: .asciiz "\t21: An 'S'\n" +# + + +data_56: .asciiz "Your choice => " +# + + +data_57: .asciiz "\n" +# + + +data_58: .asciiz " XX XXXX XXXX XX " +# + + +data_59: .asciiz " X X X X X " +# + + +data_60: .asciiz "X X X X X" +# + + +data_61: .asciiz "X X X X X X X X X" +# + + +data_62: .asciiz "X X X X X " +# + + +data_63: .asciiz " X X X X X" +# + + +data_64: .asciiz "X X X XX X " +# + + +data_65: .asciiz " X XX X X X " +# + + +data_66: .asciiz "X X X X X " +# + + +data_67: .asciiz " X X X X X" +# + + +data_68: .asciiz "X X X X X X X X" +# + + +data_69: .asciiz "XXXXXXXXXXXXXXXXXXXXXXXXX" +# + + +data_70: .asciiz "XXXXX X X X X " +# + + +data_71: .asciiz " X X XXXXX X X " +# + + +data_72: .asciiz "X X X X X X X " +# + + +data_73: .asciiz " X X X X X X X" +# + + +data_74: .asciiz "XXXXX X XXXXX X XXXX" +# + + +data_75: .asciiz "XXX X X X X XXXX " +# + + +data_76: .asciiz " XX X XX X XX " +# + + +data_77: .asciiz " XX X XX X XX X XX X XX " +# + + +data_78: .asciiz " XXXX X XX X XXXX " +# + + +data_79: .asciiz " " +# + + +data_80: .asciiz "Would you like to continue with the next generation? \n" +# + + +data_81: .asciiz "Please use lowercase y or n for your answer [y]: " +# + + +data_82: .asciiz "\n" +# + + +data_83: .asciiz "n" +# + + +data_84: .asciiz "\n\n" +# + + +data_85: .asciiz "Would you like to choose a background pattern? \n" +# + + +data_86: .asciiz "Please use lowercase y or n for your answer [n]: " +# + + +data_87: .asciiz "y" +# + + +data_88: .asciiz "Welcome to the Game of Life.\n" +# + + +data_89: .asciiz "There are many initial states to choose from. \n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 32 bytes of memory + li $a0, 32 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 24 + sw $t2, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Board__attrib__rows__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Board__attrib__columns__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Board__attrib__board_size__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __CellularAutomaton__attrib__population_map__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__cells__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 108($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Board__attrib__rows__init implementation. +# @Params: +__Board__attrib__rows__init: + # Allocate stack frame for function __Board__attrib__rows__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Board__attrib__rows__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Board__attrib__columns__init implementation. +# @Params: +__Board__attrib__columns__init: + # Allocate stack frame for function __Board__attrib__columns__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Board__attrib__columns__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Board__attrib__board_size__init implementation. +# @Params: +__Board__attrib__board_size__init: + # Allocate stack frame for function __Board__attrib__board_size__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Board__attrib__board_size__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_size_of_board_at_Board implementation. +# @Params: +# 0($fp) = param_size_of_board_at_Board_initial_0 +function_size_of_board_at_Board: + # Allocate stack frame for function function_size_of_board_at_Board. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_size_of_board_at_Board_internal_0 --> -4($fp) + # PARAM param_size_of_board_at_Board_initial_0 --> 0($fp) + # local_size_of_board_at_Board_internal_0 = PARAM param_size_of_board_at_Board_initial_0 + lw $t1, 0($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_size_of_board_at_Board_internal_0 --> -4($fp) + # LOCAL local_size_of_board_at_Board_internal_1 --> -8($fp) + # local_size_of_board_at_Board_internal_1 = VCALL local_size_of_board_at_Board_internal_0 length + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 20($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_size_of_board_at_Board_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_size_of_board_at_Board. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_board_init_at_Board implementation. +# @Params: +# 0($fp) = param_board_init_at_Board_start_0 +function_board_init_at_Board: + # Allocate stack frame for function function_board_init_at_Board. + subu $sp, $sp, 76 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 76 + # LOCAL local_board_init_at_Board_internal_3 --> -16($fp) + # local_board_init_at_Board_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_board_init_at_Board_internal_1 --> -8($fp) + # LOCAL local_board_init_at_Board_internal_3 --> -16($fp) + # local_board_init_at_Board_internal_1 = local_board_init_at_Board_internal_3 + lw $t1, -16($fp) + sw $t1, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_board_init_at_Board_start_0 + # PARAM param_board_init_at_Board_start_0 --> 0($fp) + lw $t1, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_board_init_at_Board_internal_1 --> -8($fp) + # LOCAL local_board_init_at_Board_internal_2 --> -12($fp) + # local_board_init_at_Board_internal_2 = VCALL local_board_init_at_Board_internal_1 size_of_board + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 28($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_2 --> -12($fp) + # local_board_init_at_Board_size_0 = local_board_init_at_Board_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # LOCAL local_board_init_at_Board_internal_5 --> -24($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # local_board_init_at_Board_internal_5 = local_board_init_at_Board_size_0 - 15 + lw $t1, -4($fp) + sub $t1, $t1, 15 + sw $t1, -24($fp) + # IF_ZERO local_board_init_at_Board_internal_5 GOTO label_TRUE_3 + # IF_ZERO local_board_init_at_Board_internal_5 GOTO label_TRUE_3 + lw $t1, -24($fp) + beq $t1, 0, label_TRUE_3 + # LOCAL local_board_init_at_Board_internal_5 --> -24($fp) + # local_board_init_at_Board_internal_5 = 0 + li $t1, 0 + sw $t1, -24($fp) + # GOTO label_END_4 +j label_END_4 +label_TRUE_3: + # LOCAL local_board_init_at_Board_internal_5 --> -24($fp) + # local_board_init_at_Board_internal_5 = 1 + li $t1, 1 + sw $t1, -24($fp) + label_END_4: +# IF_ZERO local_board_init_at_Board_internal_5 GOTO label_FALSEIF_1 +# IF_ZERO local_board_init_at_Board_internal_5 GOTO label_FALSEIF_1 +lw $t1, -24($fp) +beq $t1, 0, label_FALSEIF_1 +# +li $t1, 3 +sw $t1, 12($s1) +# +li $t1, 5 +sw $t1, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t1, -4($fp) +sw $t1, 20($s1) +# LOCAL local_board_init_at_Board_internal_4 --> -20($fp) +# local_board_init_at_Board_internal_4 = +# GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # local_board_init_at_Board_internal_7 = local_board_init_at_Board_size_0 - 16 + lw $t1, -4($fp) + sub $t1, $t1, 16 + sw $t1, -32($fp) + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_7 + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_7 + lw $t1, -32($fp) + beq $t1, 0, label_TRUE_7 + # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) + # local_board_init_at_Board_internal_7 = 0 + li $t1, 0 + sw $t1, -32($fp) + # GOTO label_END_8 +j label_END_8 +label_TRUE_7: + # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) + # local_board_init_at_Board_internal_7 = 1 + li $t1, 1 + sw $t1, -32($fp) + label_END_8: +# IF_ZERO local_board_init_at_Board_internal_7 GOTO label_FALSEIF_5 +# IF_ZERO local_board_init_at_Board_internal_7 GOTO label_FALSEIF_5 +lw $t1, -32($fp) +beq $t1, 0, label_FALSEIF_5 +# +li $t1, 4 +sw $t1, 12($s1) +# +li $t1, 4 +sw $t1, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t1, -4($fp) +sw $t1, 20($s1) +# LOCAL local_board_init_at_Board_internal_6 --> -28($fp) +# local_board_init_at_Board_internal_6 = +# GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # LOCAL local_board_init_at_Board_internal_9 --> -40($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # local_board_init_at_Board_internal_9 = local_board_init_at_Board_size_0 - 20 + lw $t1, -4($fp) + sub $t1, $t1, 20 + sw $t1, -40($fp) + # IF_ZERO local_board_init_at_Board_internal_9 GOTO label_TRUE_11 + # IF_ZERO local_board_init_at_Board_internal_9 GOTO label_TRUE_11 + lw $t1, -40($fp) + beq $t1, 0, label_TRUE_11 + # LOCAL local_board_init_at_Board_internal_9 --> -40($fp) + # local_board_init_at_Board_internal_9 = 0 + li $t1, 0 + sw $t1, -40($fp) + # GOTO label_END_12 +j label_END_12 +label_TRUE_11: + # LOCAL local_board_init_at_Board_internal_9 --> -40($fp) + # local_board_init_at_Board_internal_9 = 1 + li $t1, 1 + sw $t1, -40($fp) + label_END_12: +# IF_ZERO local_board_init_at_Board_internal_9 GOTO label_FALSEIF_9 +# IF_ZERO local_board_init_at_Board_internal_9 GOTO label_FALSEIF_9 +lw $t1, -40($fp) +beq $t1, 0, label_FALSEIF_9 +# +li $t1, 4 +sw $t1, 12($s1) +# +li $t1, 5 +sw $t1, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t1, -4($fp) +sw $t1, 20($s1) +# LOCAL local_board_init_at_Board_internal_8 --> -36($fp) +# local_board_init_at_Board_internal_8 = +# GOTO label_ENDIF_10 +j label_ENDIF_10 +label_FALSEIF_9: + # LOCAL local_board_init_at_Board_internal_11 --> -48($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # local_board_init_at_Board_internal_11 = local_board_init_at_Board_size_0 - 21 + lw $t1, -4($fp) + sub $t1, $t1, 21 + sw $t1, -48($fp) + # IF_ZERO local_board_init_at_Board_internal_11 GOTO label_TRUE_15 + # IF_ZERO local_board_init_at_Board_internal_11 GOTO label_TRUE_15 + lw $t1, -48($fp) + beq $t1, 0, label_TRUE_15 + # LOCAL local_board_init_at_Board_internal_11 --> -48($fp) + # local_board_init_at_Board_internal_11 = 0 + li $t1, 0 + sw $t1, -48($fp) + # GOTO label_END_16 +j label_END_16 +label_TRUE_15: + # LOCAL local_board_init_at_Board_internal_11 --> -48($fp) + # local_board_init_at_Board_internal_11 = 1 + li $t1, 1 + sw $t1, -48($fp) + label_END_16: +# IF_ZERO local_board_init_at_Board_internal_11 GOTO label_FALSEIF_13 +# IF_ZERO local_board_init_at_Board_internal_11 GOTO label_FALSEIF_13 +lw $t1, -48($fp) +beq $t1, 0, label_FALSEIF_13 +# +li $t1, 3 +sw $t1, 12($s1) +# +li $t1, 7 +sw $t1, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t1, -4($fp) +sw $t1, 20($s1) +# LOCAL local_board_init_at_Board_internal_10 --> -44($fp) +# local_board_init_at_Board_internal_10 = +# GOTO label_ENDIF_14 +j label_ENDIF_14 +label_FALSEIF_13: + # LOCAL local_board_init_at_Board_internal_13 --> -56($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # local_board_init_at_Board_internal_13 = local_board_init_at_Board_size_0 - 25 + lw $t1, -4($fp) + sub $t1, $t1, 25 + sw $t1, -56($fp) + # IF_ZERO local_board_init_at_Board_internal_13 GOTO label_TRUE_19 + # IF_ZERO local_board_init_at_Board_internal_13 GOTO label_TRUE_19 + lw $t1, -56($fp) + beq $t1, 0, label_TRUE_19 + # LOCAL local_board_init_at_Board_internal_13 --> -56($fp) + # local_board_init_at_Board_internal_13 = 0 + li $t1, 0 + sw $t1, -56($fp) + # GOTO label_END_20 +j label_END_20 +label_TRUE_19: + # LOCAL local_board_init_at_Board_internal_13 --> -56($fp) + # local_board_init_at_Board_internal_13 = 1 + li $t1, 1 + sw $t1, -56($fp) + label_END_20: +# IF_ZERO local_board_init_at_Board_internal_13 GOTO label_FALSEIF_17 +# IF_ZERO local_board_init_at_Board_internal_13 GOTO label_FALSEIF_17 +lw $t1, -56($fp) +beq $t1, 0, label_FALSEIF_17 +# +li $t1, 5 +sw $t1, 12($s1) +# +li $t1, 5 +sw $t1, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t1, -4($fp) +sw $t1, 20($s1) +# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) +# local_board_init_at_Board_internal_12 = +# GOTO label_ENDIF_18 +j label_ENDIF_18 +label_FALSEIF_17: + # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # local_board_init_at_Board_internal_15 = local_board_init_at_Board_size_0 - 28 + lw $t1, -4($fp) + sub $t1, $t1, 28 + sw $t1, -64($fp) + # IF_ZERO local_board_init_at_Board_internal_15 GOTO label_TRUE_23 + # IF_ZERO local_board_init_at_Board_internal_15 GOTO label_TRUE_23 + lw $t1, -64($fp) + beq $t1, 0, label_TRUE_23 + # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) + # local_board_init_at_Board_internal_15 = 0 + li $t1, 0 + sw $t1, -64($fp) + # GOTO label_END_24 +j label_END_24 +label_TRUE_23: + # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) + # local_board_init_at_Board_internal_15 = 1 + li $t1, 1 + sw $t1, -64($fp) + label_END_24: +# IF_ZERO local_board_init_at_Board_internal_15 GOTO label_FALSEIF_21 +# IF_ZERO local_board_init_at_Board_internal_15 GOTO label_FALSEIF_21 +lw $t1, -64($fp) +beq $t1, 0, label_FALSEIF_21 +# +li $t1, 7 +sw $t1, 12($s1) +# +li $t1, 4 +sw $t1, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t1, -4($fp) +sw $t1, 20($s1) +# LOCAL local_board_init_at_Board_internal_14 --> -60($fp) +# local_board_init_at_Board_internal_14 = +# GOTO label_ENDIF_22 +j label_ENDIF_22 +label_FALSEIF_21: + # + li $t1, 5 + sw $t1, 12($s1) + # + li $t1, 5 + sw $t1, 16($s1) + # + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + lw $t1, -4($fp) + sw $t1, 20($s1) + # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) + # local_board_init_at_Board_internal_14 = + label_ENDIF_22: +# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) +# LOCAL local_board_init_at_Board_internal_14 --> -60($fp) +# local_board_init_at_Board_internal_12 = local_board_init_at_Board_internal_14 +lw $t1, -60($fp) +sw $t1, -52($fp) +label_ENDIF_18: +# LOCAL local_board_init_at_Board_internal_10 --> -44($fp) +# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) +# local_board_init_at_Board_internal_10 = local_board_init_at_Board_internal_12 +lw $t1, -52($fp) +sw $t1, -44($fp) +label_ENDIF_14: +# LOCAL local_board_init_at_Board_internal_8 --> -36($fp) +# LOCAL local_board_init_at_Board_internal_10 --> -44($fp) +# local_board_init_at_Board_internal_8 = local_board_init_at_Board_internal_10 +lw $t1, -44($fp) +sw $t1, -36($fp) +label_ENDIF_10: +# LOCAL local_board_init_at_Board_internal_6 --> -28($fp) +# LOCAL local_board_init_at_Board_internal_8 --> -36($fp) +# local_board_init_at_Board_internal_6 = local_board_init_at_Board_internal_8 +lw $t1, -36($fp) +sw $t1, -28($fp) +label_ENDIF_6: +# LOCAL local_board_init_at_Board_internal_4 --> -20($fp) +# LOCAL local_board_init_at_Board_internal_6 --> -28($fp) +# local_board_init_at_Board_internal_4 = local_board_init_at_Board_internal_6 +lw $t1, -28($fp) +sw $t1, -20($fp) +label_ENDIF_2: +# LOCAL local_board_init_at_Board_internal_16 --> -68($fp) +# local_board_init_at_Board_internal_16 = SELF +sw $s1, -68($fp) +# RETURN local_board_init_at_Board_internal_16 +lw $v0, -68($fp) +# Deallocate stack frame for function function_board_init_at_Board. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 76 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# __CellularAutomaton__attrib__population_map__init implementation. +# @Params: +__CellularAutomaton__attrib__population_map__init: + # Allocate stack frame for function __CellularAutomaton__attrib__population_map__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_rAutomaton__attrib__population_map__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_0 + sw $t1, 12($v0) + li $t1, 0 + sw $t1, 16($v0) + sw $v0, -4($fp) + # RETURN local_rAutomaton__attrib__population_map__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __CellularAutomaton__attrib__population_map__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_init_at_CellularAutomaton_map_0 +function_init_at_CellularAutomaton: + # Allocate stack frame for function function_init_at_CellularAutomaton. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_CellularAutomaton_map_0 --> 0($fp) + lw $t1, 0($fp) + sw $t1, 24($s1) + # LOCAL local_init_at_CellularAutomaton_internal_2 --> -12($fp) + # local_init_at_CellularAutomaton_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_init_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_init_at_CellularAutomaton_internal_2 --> -12($fp) + # local_init_at_CellularAutomaton_internal_0 = local_init_at_CellularAutomaton_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_init_at_CellularAutomaton_map_0 + # PARAM param_init_at_CellularAutomaton_map_0 --> 0($fp) + lw $t1, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_init_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_init_at_CellularAutomaton_internal_1 --> -8($fp) + # local_init_at_CellularAutomaton_internal_1 = VCALL local_init_at_CellularAutomaton_internal_0 board_init + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 32($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_init_at_CellularAutomaton_internal_3 --> -16($fp) + # local_init_at_CellularAutomaton_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_init_at_CellularAutomaton_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_init_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_at_CellularAutomaton implementation. +# @Params: +function_print_at_CellularAutomaton: + # Allocate stack frame for function function_print_at_CellularAutomaton. + subu $sp, $sp, 112 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 112 + # LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) + # local_print_at_CellularAutomaton_i_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # local_print_at_CellularAutomaton_internal_2 = GETATTRIBUTE board_size CellularAutomaton + # LOCAL local_print_at_CellularAutomaton_internal_2 --> -12($fp) + lw $t1, 20($s1) + sw $t1, -12($fp) + # LOCAL local_print_at_CellularAutomaton_num_1 --> -8($fp) + # LOCAL local_print_at_CellularAutomaton_internal_2 --> -12($fp) + # local_print_at_CellularAutomaton_num_1 = local_print_at_CellularAutomaton_internal_2 + lw $t1, -12($fp) + sw $t1, -8($fp) + # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) + # local_print_at_CellularAutomaton_internal_5 = SELF + sw $s1, -24($fp) + # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) + # local_print_at_CellularAutomaton_internal_3 = local_print_at_CellularAutomaton_internal_5 + lw $t1, -24($fp) + sw $t1, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_4 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -28($fp) + # ARG local_print_at_CellularAutomaton_internal_6 + # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) + lw $t1, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_print_at_CellularAutomaton_internal_4 --> -20($fp) + # local_print_at_CellularAutomaton_internal_4 = VCALL local_print_at_CellularAutomaton_internal_3 out_string + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_WHILE_25: + # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) + # LOCAL local_print_at_CellularAutomaton_num_1 --> -8($fp) + # local_print_at_CellularAutomaton_internal_7 = local_print_at_CellularAutomaton_i_0 - local_print_at_CellularAutomaton_num_1 + lw $t1, -4($fp) + lw $t2, -8($fp) + sub $t1, $t1, $t2 + sw $t1, -32($fp) + # IF_GREATER_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_FALSE_27 + # IF_GREATER_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_FALSE_27 + lw $t1, -32($fp) + bgt $t1, 0, label_FALSE_27 + # IF_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_FALSE_27 + # IF_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_FALSE_27 + lw $t1, -32($fp) + beq $t1, 0, label_FALSE_27 + # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) + # local_print_at_CellularAutomaton_internal_7 = 1 + li $t1, 1 + sw $t1, -32($fp) + # GOTO label_END_28 +j label_END_28 +label_FALSE_27: + # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) + # local_print_at_CellularAutomaton_internal_7 = 0 + li $t1, 0 + sw $t1, -32($fp) + label_END_28: +# IF_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_WHILE_END_26 +# IF_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_WHILE_END_26 +lw $t1, -32($fp) +beq $t1, 0, label_WHILE_END_26 +# LOCAL local_print_at_CellularAutomaton_internal_10 --> -44($fp) +# local_print_at_CellularAutomaton_internal_10 = SELF +sw $s1, -44($fp) +# LOCAL local_print_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_print_at_CellularAutomaton_internal_10 --> -44($fp) +# local_print_at_CellularAutomaton_internal_8 = local_print_at_CellularAutomaton_internal_10 +lw $t1, -44($fp) +sw $t1, -36($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_print_at_CellularAutomaton_internal_13 = GETATTRIBUTE population_map CellularAutomaton +# LOCAL local_print_at_CellularAutomaton_internal_13 --> -56($fp) +lw $t1, 24($s1) +sw $t1, -56($fp) +# LOCAL local_print_at_CellularAutomaton_internal_11 --> -48($fp) +# LOCAL local_print_at_CellularAutomaton_internal_13 --> -56($fp) +# local_print_at_CellularAutomaton_internal_11 = local_print_at_CellularAutomaton_internal_13 +lw $t1, -56($fp) +sw $t1, -48($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_print_at_CellularAutomaton_i_0 +# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) +lw $t1, -4($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# local_print_at_CellularAutomaton_internal_14 = GETATTRIBUTE columns CellularAutomaton +# LOCAL local_print_at_CellularAutomaton_internal_14 --> -60($fp) +lw $t1, 16($s1) +sw $t1, -60($fp) +# ARG local_print_at_CellularAutomaton_internal_14 +# LOCAL local_print_at_CellularAutomaton_internal_14 --> -60($fp) +lw $t1, -60($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_print_at_CellularAutomaton_internal_11 --> -48($fp) +# LOCAL local_print_at_CellularAutomaton_internal_12 --> -52($fp) +# local_print_at_CellularAutomaton_internal_12 = VCALL local_print_at_CellularAutomaton_internal_11 substr +# Save new self pointer in $s1 +lw $s1, -48($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 16($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -52($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_print_at_CellularAutomaton_internal_12 +# LOCAL local_print_at_CellularAutomaton_internal_12 --> -52($fp) +lw $t1, -52($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_print_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_print_at_CellularAutomaton_internal_9 --> -40($fp) +# local_print_at_CellularAutomaton_internal_9 = VCALL local_print_at_CellularAutomaton_internal_8 out_string +# Save new self pointer in $s1 +lw $s1, -36($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 12($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -40($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_print_at_CellularAutomaton_internal_17 --> -72($fp) +# local_print_at_CellularAutomaton_internal_17 = SELF +sw $s1, -72($fp) +# LOCAL local_print_at_CellularAutomaton_internal_15 --> -64($fp) +# LOCAL local_print_at_CellularAutomaton_internal_17 --> -72($fp) +# local_print_at_CellularAutomaton_internal_15 = local_print_at_CellularAutomaton_internal_17 +lw $t1, -72($fp) +sw $t1, -64($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_print_at_CellularAutomaton_internal_18 --> -76($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_5 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -76($fp) +# ARG local_print_at_CellularAutomaton_internal_18 +# LOCAL local_print_at_CellularAutomaton_internal_18 --> -76($fp) +lw $t1, -76($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_print_at_CellularAutomaton_internal_15 --> -64($fp) +# LOCAL local_print_at_CellularAutomaton_internal_16 --> -68($fp) +# local_print_at_CellularAutomaton_internal_16 = VCALL local_print_at_CellularAutomaton_internal_15 out_string +# Save new self pointer in $s1 +lw $s1, -64($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 12($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -68($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# local_print_at_CellularAutomaton_internal_20 = GETATTRIBUTE columns CellularAutomaton +# LOCAL local_print_at_CellularAutomaton_internal_20 --> -84($fp) +lw $t1, 16($s1) +sw $t1, -84($fp) +# LOCAL local_print_at_CellularAutomaton_internal_19 --> -80($fp) +# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) +# LOCAL local_print_at_CellularAutomaton_internal_20 --> -84($fp) +# local_print_at_CellularAutomaton_internal_19 = local_print_at_CellularAutomaton_i_0 + local_print_at_CellularAutomaton_internal_20 +lw $t1, -4($fp) +lw $t2, -84($fp) +add $t1, $t1, $t2 +sw $t1, -80($fp) +# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) +# LOCAL local_print_at_CellularAutomaton_internal_19 --> -80($fp) +# local_print_at_CellularAutomaton_i_0 = local_print_at_CellularAutomaton_internal_19 +lw $t1, -80($fp) +sw $t1, -4($fp) +# GOTO label_WHILE_25 +j label_WHILE_25 +label_WHILE_END_26: + # LOCAL local_print_at_CellularAutomaton_internal_23 --> -96($fp) + # local_print_at_CellularAutomaton_internal_23 = SELF + sw $s1, -96($fp) + # LOCAL local_print_at_CellularAutomaton_internal_21 --> -88($fp) + # LOCAL local_print_at_CellularAutomaton_internal_23 --> -96($fp) + # local_print_at_CellularAutomaton_internal_21 = local_print_at_CellularAutomaton_internal_23 + lw $t1, -96($fp) + sw $t1, -88($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_24 --> -100($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_6 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -100($fp) + # ARG local_print_at_CellularAutomaton_internal_24 + # LOCAL local_print_at_CellularAutomaton_internal_24 --> -100($fp) + lw $t1, -100($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_21 --> -88($fp) + # LOCAL local_print_at_CellularAutomaton_internal_22 --> -92($fp) + # local_print_at_CellularAutomaton_internal_22 = VCALL local_print_at_CellularAutomaton_internal_21 out_string + # Save new self pointer in $s1 + lw $s1, -88($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -92($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_CellularAutomaton_internal_25 --> -104($fp) + # local_print_at_CellularAutomaton_internal_25 = SELF + sw $s1, -104($fp) + # RETURN local_print_at_CellularAutomaton_internal_25 + lw $v0, -104($fp) + # Deallocate stack frame for function function_print_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 112 + jr $ra + # Function END + + +# function_num_cells_at_CellularAutomaton implementation. +# @Params: +function_num_cells_at_CellularAutomaton: + # Allocate stack frame for function function_num_cells_at_CellularAutomaton. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_num_cells_at_CellularAutomaton_internal_2 = GETATTRIBUTE population_map CellularAutomaton + # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) + lw $t1, 24($s1) + sw $t1, -12($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) + # local_num_cells_at_CellularAutomaton_internal_0 = local_num_cells_at_CellularAutomaton_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_1 --> -8($fp) + # local_num_cells_at_CellularAutomaton_internal_1 = VCALL local_num_cells_at_CellularAutomaton_internal_0 length + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 20($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_num_cells_at_CellularAutomaton_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_num_cells_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cell_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_cell_at_CellularAutomaton_position_0 +function_cell_at_CellularAutomaton: + # Allocate stack frame for function function_cell_at_CellularAutomaton. + subu $sp, $sp, 40 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 40 + # local_cell_at_CellularAutomaton_internal_3 = GETATTRIBUTE board_size CellularAutomaton + # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) + lw $t1, 20($s1) + sw $t1, -16($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) + # local_cell_at_CellularAutomaton_internal_2 = local_cell_at_CellularAutomaton_internal_3 - 1 + lw $t1, -16($fp) + sub $t1, $t1, 1 + sw $t1, -12($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) + # PARAM param_cell_at_CellularAutomaton_position_0 --> 0($fp) + # local_cell_at_CellularAutomaton_internal_1 = local_cell_at_CellularAutomaton_internal_2 - PARAM param_cell_at_CellularAutomaton_position_0 + lw $t1, -12($fp) + lw $t2, 0($fp) + sub $t1, $t1, $t2 + sw $t1, -8($fp) + # IF_GREATER_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSE_31 + # IF_GREATER_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSE_31 + lw $t1, -8($fp) + bgt $t1, 0, label_FALSE_31 + # IF_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSE_31 + # IF_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSE_31 + lw $t1, -8($fp) + beq $t1, 0, label_FALSE_31 + # LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) + # local_cell_at_CellularAutomaton_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + # GOTO label_END_32 +j label_END_32 +label_FALSE_31: + # LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) + # local_cell_at_CellularAutomaton_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + label_END_32: +# IF_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_29 +# IF_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_29 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_29 +# LOCAL local_cell_at_CellularAutomaton_internal_4 --> -20($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_7 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -20($fp) +# LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_cell_at_CellularAutomaton_internal_4 --> -20($fp) +# local_cell_at_CellularAutomaton_internal_0 = local_cell_at_CellularAutomaton_internal_4 +lw $t1, -20($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_30 +j label_ENDIF_30 +label_FALSEIF_29: + # local_cell_at_CellularAutomaton_internal_7 = GETATTRIBUTE population_map CellularAutomaton + # LOCAL local_cell_at_CellularAutomaton_internal_7 --> -32($fp) + lw $t1, 24($s1) + sw $t1, -32($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_7 --> -32($fp) + # local_cell_at_CellularAutomaton_internal_5 = local_cell_at_CellularAutomaton_internal_7 + lw $t1, -32($fp) + sw $t1, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cell_at_CellularAutomaton_position_0 + # PARAM param_cell_at_CellularAutomaton_position_0 --> 0($fp) + lw $t1, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # ARG 1 + li $t1, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_cell_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_6 --> -28($fp) + # local_cell_at_CellularAutomaton_internal_6 = VCALL local_cell_at_CellularAutomaton_internal_5 substr + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 16($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_6 --> -28($fp) + # local_cell_at_CellularAutomaton_internal_0 = local_cell_at_CellularAutomaton_internal_6 + lw $t1, -28($fp) + sw $t1, -4($fp) + label_ENDIF_30: +# RETURN local_cell_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_cell_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 40 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_north_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_north_at_CellularAutomaton_position_0 +function_north_at_CellularAutomaton: + # Allocate stack frame for function function_north_at_CellularAutomaton. + subu $sp, $sp, 48 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 48 + # local_north_at_CellularAutomaton_internal_3 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_north_at_CellularAutomaton_internal_3 --> -16($fp) + lw $t1, 16($s1) + sw $t1, -16($fp) + # LOCAL local_north_at_CellularAutomaton_internal_2 --> -12($fp) + # PARAM param_north_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_north_at_CellularAutomaton_internal_3 --> -16($fp) + # local_north_at_CellularAutomaton_internal_2 = PARAM param_north_at_CellularAutomaton_position_0 - local_north_at_CellularAutomaton_internal_3 + lw $t1, 0($fp) + lw $t2, -16($fp) + sub $t1, $t1, $t2 + sw $t1, -12($fp) + # LOCAL local_north_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_north_at_CellularAutomaton_internal_2 --> -12($fp) + # local_north_at_CellularAutomaton_internal_1 = local_north_at_CellularAutomaton_internal_2 - 0 + lw $t1, -12($fp) + sub $t1, $t1, 0 + sw $t1, -8($fp) + # IF_GREATER_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSE_35 + # IF_GREATER_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSE_35 + lw $t1, -8($fp) + bgt $t1, 0, label_FALSE_35 + # IF_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSE_35 + # IF_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSE_35 + lw $t1, -8($fp) + beq $t1, 0, label_FALSE_35 + # LOCAL local_north_at_CellularAutomaton_internal_1 --> -8($fp) + # local_north_at_CellularAutomaton_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + # GOTO label_END_36 +j label_END_36 +label_FALSE_35: + # LOCAL local_north_at_CellularAutomaton_internal_1 --> -8($fp) + # local_north_at_CellularAutomaton_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + label_END_36: +# IF_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_33 +# IF_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_33 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_33 +# LOCAL local_north_at_CellularAutomaton_internal_4 --> -20($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_8 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -20($fp) +# LOCAL local_north_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_north_at_CellularAutomaton_internal_4 --> -20($fp) +# local_north_at_CellularAutomaton_internal_0 = local_north_at_CellularAutomaton_internal_4 +lw $t1, -20($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_34 +j label_ENDIF_34 +label_FALSEIF_33: + # LOCAL local_north_at_CellularAutomaton_internal_7 --> -32($fp) + # local_north_at_CellularAutomaton_internal_7 = SELF + sw $s1, -32($fp) + # LOCAL local_north_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_north_at_CellularAutomaton_internal_7 --> -32($fp) + # local_north_at_CellularAutomaton_internal_5 = local_north_at_CellularAutomaton_internal_7 + lw $t1, -32($fp) + sw $t1, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_north_at_CellularAutomaton_internal_9 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_north_at_CellularAutomaton_internal_9 --> -40($fp) + lw $t1, 16($s1) + sw $t1, -40($fp) + # LOCAL local_north_at_CellularAutomaton_internal_8 --> -36($fp) + # PARAM param_north_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_north_at_CellularAutomaton_internal_9 --> -40($fp) + # local_north_at_CellularAutomaton_internal_8 = PARAM param_north_at_CellularAutomaton_position_0 - local_north_at_CellularAutomaton_internal_9 + lw $t1, 0($fp) + lw $t2, -40($fp) + sub $t1, $t1, $t2 + sw $t1, -36($fp) + # ARG local_north_at_CellularAutomaton_internal_8 + # LOCAL local_north_at_CellularAutomaton_internal_8 --> -36($fp) + lw $t1, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_north_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_north_at_CellularAutomaton_internal_6 --> -28($fp) + # local_north_at_CellularAutomaton_internal_6 = VCALL local_north_at_CellularAutomaton_internal_5 cell + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 48($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_north_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_north_at_CellularAutomaton_internal_6 --> -28($fp) + # local_north_at_CellularAutomaton_internal_0 = local_north_at_CellularAutomaton_internal_6 + lw $t1, -28($fp) + sw $t1, -4($fp) + label_ENDIF_34: +# RETURN local_north_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_north_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 48 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_south_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_south_at_CellularAutomaton_position_0 +function_south_at_CellularAutomaton: + # Allocate stack frame for function function_south_at_CellularAutomaton. + subu $sp, $sp, 52 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 52 + # local_south_at_CellularAutomaton_internal_2 = GETATTRIBUTE board_size CellularAutomaton + # LOCAL local_south_at_CellularAutomaton_internal_2 --> -12($fp) + lw $t1, 20($s1) + sw $t1, -12($fp) + # local_south_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_south_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t1, 16($s1) + sw $t1, -20($fp) + # LOCAL local_south_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_south_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_south_at_CellularAutomaton_internal_4 --> -20($fp) + # local_south_at_CellularAutomaton_internal_3 = PARAM param_south_at_CellularAutomaton_position_0 + local_south_at_CellularAutomaton_internal_4 + lw $t1, 0($fp) + lw $t2, -20($fp) + add $t1, $t1, $t2 + sw $t1, -16($fp) + # LOCAL local_south_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_south_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_south_at_CellularAutomaton_internal_3 --> -16($fp) + # local_south_at_CellularAutomaton_internal_1 = local_south_at_CellularAutomaton_internal_2 - local_south_at_CellularAutomaton_internal_3 + lw $t1, -12($fp) + lw $t2, -16($fp) + sub $t1, $t1, $t2 + sw $t1, -8($fp) + # IF_GREATER_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSE_39 + # IF_GREATER_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSE_39 + lw $t1, -8($fp) + bgt $t1, 0, label_FALSE_39 + # IF_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSE_39 + # IF_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSE_39 + lw $t1, -8($fp) + beq $t1, 0, label_FALSE_39 + # LOCAL local_south_at_CellularAutomaton_internal_1 --> -8($fp) + # local_south_at_CellularAutomaton_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + # GOTO label_END_40 +j label_END_40 +label_FALSE_39: + # LOCAL local_south_at_CellularAutomaton_internal_1 --> -8($fp) + # local_south_at_CellularAutomaton_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + label_END_40: +# IF_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_37 +# IF_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_37 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_37 +# LOCAL local_south_at_CellularAutomaton_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_9 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -24($fp) +# LOCAL local_south_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_south_at_CellularAutomaton_internal_5 --> -24($fp) +# local_south_at_CellularAutomaton_internal_0 = local_south_at_CellularAutomaton_internal_5 +lw $t1, -24($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_38 +j label_ENDIF_38 +label_FALSEIF_37: + # LOCAL local_south_at_CellularAutomaton_internal_8 --> -36($fp) + # local_south_at_CellularAutomaton_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_south_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_south_at_CellularAutomaton_internal_8 --> -36($fp) + # local_south_at_CellularAutomaton_internal_6 = local_south_at_CellularAutomaton_internal_8 + lw $t1, -36($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_south_at_CellularAutomaton_internal_10 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_south_at_CellularAutomaton_internal_10 --> -44($fp) + lw $t1, 16($s1) + sw $t1, -44($fp) + # LOCAL local_south_at_CellularAutomaton_internal_9 --> -40($fp) + # PARAM param_south_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_south_at_CellularAutomaton_internal_10 --> -44($fp) + # local_south_at_CellularAutomaton_internal_9 = PARAM param_south_at_CellularAutomaton_position_0 + local_south_at_CellularAutomaton_internal_10 + lw $t1, 0($fp) + lw $t2, -44($fp) + add $t1, $t1, $t2 + sw $t1, -40($fp) + # ARG local_south_at_CellularAutomaton_internal_9 + # LOCAL local_south_at_CellularAutomaton_internal_9 --> -40($fp) + lw $t1, -40($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_south_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_south_at_CellularAutomaton_internal_7 --> -32($fp) + # local_south_at_CellularAutomaton_internal_7 = VCALL local_south_at_CellularAutomaton_internal_6 cell + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 48($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_south_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_south_at_CellularAutomaton_internal_7 --> -32($fp) + # local_south_at_CellularAutomaton_internal_0 = local_south_at_CellularAutomaton_internal_7 + lw $t1, -32($fp) + sw $t1, -4($fp) + label_ENDIF_38: +# RETURN local_south_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_south_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 52 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_east_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_east_at_CellularAutomaton_position_0 +function_east_at_CellularAutomaton: + # Allocate stack frame for function function_east_at_CellularAutomaton. + subu $sp, $sp, 60 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 60 + # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) + # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) + # local_east_at_CellularAutomaton_internal_4 = PARAM param_east_at_CellularAutomaton_position_0 + 1 + lw $t1, 0($fp) + add $t1, $t1, 1 + sw $t1, -20($fp) + # local_east_at_CellularAutomaton_internal_5 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_east_at_CellularAutomaton_internal_5 --> -24($fp) + lw $t1, 16($s1) + sw $t1, -24($fp) + # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_east_at_CellularAutomaton_internal_5 --> -24($fp) + # local_east_at_CellularAutomaton_internal_3 = local_east_at_CellularAutomaton_internal_4 / local_east_at_CellularAutomaton_internal_5 + lw $t1, -20($fp) + lw $t2, -24($fp) + div $t1, $t1, $t2 + sw $t1, -16($fp) + # local_east_at_CellularAutomaton_internal_6 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_east_at_CellularAutomaton_internal_6 --> -28($fp) + lw $t1, 16($s1) + sw $t1, -28($fp) + # LOCAL local_east_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_east_at_CellularAutomaton_internal_6 --> -28($fp) + # local_east_at_CellularAutomaton_internal_2 = local_east_at_CellularAutomaton_internal_3 * local_east_at_CellularAutomaton_internal_6 + lw $t1, -16($fp) + lw $t2, -28($fp) + mul $t1, $t1, $t2 + sw $t1, -12($fp) + # LOCAL local_east_at_CellularAutomaton_internal_7 --> -32($fp) + # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) + # local_east_at_CellularAutomaton_internal_7 = PARAM param_east_at_CellularAutomaton_position_0 + 1 + lw $t1, 0($fp) + add $t1, $t1, 1 + sw $t1, -32($fp) + # LOCAL local_east_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_east_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_east_at_CellularAutomaton_internal_7 --> -32($fp) + # local_east_at_CellularAutomaton_internal_1 = local_east_at_CellularAutomaton_internal_2 - local_east_at_CellularAutomaton_internal_7 + lw $t1, -12($fp) + lw $t2, -32($fp) + sub $t1, $t1, $t2 + sw $t1, -8($fp) + # IF_ZERO local_east_at_CellularAutomaton_internal_1 GOTO label_TRUE_43 + # IF_ZERO local_east_at_CellularAutomaton_internal_1 GOTO label_TRUE_43 + lw $t1, -8($fp) + beq $t1, 0, label_TRUE_43 + # LOCAL local_east_at_CellularAutomaton_internal_1 --> -8($fp) + # local_east_at_CellularAutomaton_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # GOTO label_END_44 +j label_END_44 +label_TRUE_43: + # LOCAL local_east_at_CellularAutomaton_internal_1 --> -8($fp) + # local_east_at_CellularAutomaton_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + label_END_44: +# IF_ZERO local_east_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_41 +# IF_ZERO local_east_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_41 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_41 +# LOCAL local_east_at_CellularAutomaton_internal_8 --> -36($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_10 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -36($fp) +# LOCAL local_east_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_east_at_CellularAutomaton_internal_8 --> -36($fp) +# local_east_at_CellularAutomaton_internal_0 = local_east_at_CellularAutomaton_internal_8 +lw $t1, -36($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_42 +j label_ENDIF_42 +label_FALSEIF_41: + # LOCAL local_east_at_CellularAutomaton_internal_11 --> -48($fp) + # local_east_at_CellularAutomaton_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_east_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_east_at_CellularAutomaton_internal_11 --> -48($fp) + # local_east_at_CellularAutomaton_internal_9 = local_east_at_CellularAutomaton_internal_11 + lw $t1, -48($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_east_at_CellularAutomaton_internal_12 --> -52($fp) + # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) + # local_east_at_CellularAutomaton_internal_12 = PARAM param_east_at_CellularAutomaton_position_0 + 1 + lw $t1, 0($fp) + add $t1, $t1, 1 + sw $t1, -52($fp) + # ARG local_east_at_CellularAutomaton_internal_12 + # LOCAL local_east_at_CellularAutomaton_internal_12 --> -52($fp) + lw $t1, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_east_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) + # local_east_at_CellularAutomaton_internal_10 = VCALL local_east_at_CellularAutomaton_internal_9 cell + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 48($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_east_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) + # local_east_at_CellularAutomaton_internal_0 = local_east_at_CellularAutomaton_internal_10 + lw $t1, -44($fp) + sw $t1, -4($fp) + label_ENDIF_42: +# RETURN local_east_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_east_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 60 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_west_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_west_at_CellularAutomaton_position_0 +function_west_at_CellularAutomaton: + # Allocate stack frame for function function_west_at_CellularAutomaton. + subu $sp, $sp, 64 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 64 + # LOCAL local_west_at_CellularAutomaton_internal_1 --> -8($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # local_west_at_CellularAutomaton_internal_1 = PARAM param_west_at_CellularAutomaton_position_0 - 0 + lw $t1, 0($fp) + sub $t1, $t1, 0 + sw $t1, -8($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_1 GOTO label_TRUE_47 + # IF_ZERO local_west_at_CellularAutomaton_internal_1 GOTO label_TRUE_47 + lw $t1, -8($fp) + beq $t1, 0, label_TRUE_47 + # LOCAL local_west_at_CellularAutomaton_internal_1 --> -8($fp) + # local_west_at_CellularAutomaton_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # GOTO label_END_48 +j label_END_48 +label_TRUE_47: + # LOCAL local_west_at_CellularAutomaton_internal_1 --> -8($fp) + # local_west_at_CellularAutomaton_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + label_END_48: +# IF_ZERO local_west_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_45 +# IF_ZERO local_west_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_45 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_45 +# LOCAL local_west_at_CellularAutomaton_internal_2 --> -12($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_11 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -12($fp) +# LOCAL local_west_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_west_at_CellularAutomaton_internal_2 --> -12($fp) +# local_west_at_CellularAutomaton_internal_0 = local_west_at_CellularAutomaton_internal_2 +lw $t1, -12($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_46 +j label_ENDIF_46 +label_FALSEIF_45: + # local_west_at_CellularAutomaton_internal_7 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_west_at_CellularAutomaton_internal_7 --> -32($fp) + lw $t1, 16($s1) + sw $t1, -32($fp) + # LOCAL local_west_at_CellularAutomaton_internal_6 --> -28($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_west_at_CellularAutomaton_internal_7 --> -32($fp) + # local_west_at_CellularAutomaton_internal_6 = PARAM param_west_at_CellularAutomaton_position_0 / local_west_at_CellularAutomaton_internal_7 + lw $t1, 0($fp) + lw $t2, -32($fp) + div $t1, $t1, $t2 + sw $t1, -28($fp) + # local_west_at_CellularAutomaton_internal_8 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_west_at_CellularAutomaton_internal_8 --> -36($fp) + lw $t1, 16($s1) + sw $t1, -36($fp) + # LOCAL local_west_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_west_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_west_at_CellularAutomaton_internal_8 --> -36($fp) + # local_west_at_CellularAutomaton_internal_5 = local_west_at_CellularAutomaton_internal_6 * local_west_at_CellularAutomaton_internal_8 + lw $t1, -28($fp) + lw $t2, -36($fp) + mul $t1, $t1, $t2 + sw $t1, -24($fp) + # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_west_at_CellularAutomaton_internal_5 --> -24($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # local_west_at_CellularAutomaton_internal_4 = local_west_at_CellularAutomaton_internal_5 - PARAM param_west_at_CellularAutomaton_position_0 + lw $t1, -24($fp) + lw $t2, 0($fp) + sub $t1, $t1, $t2 + sw $t1, -20($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_TRUE_51 + # IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_TRUE_51 + lw $t1, -20($fp) + beq $t1, 0, label_TRUE_51 + # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) + # local_west_at_CellularAutomaton_internal_4 = 0 + li $t1, 0 + sw $t1, -20($fp) + # GOTO label_END_52 +j label_END_52 +label_TRUE_51: + # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) + # local_west_at_CellularAutomaton_internal_4 = 1 + li $t1, 1 + sw $t1, -20($fp) + label_END_52: +# IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_FALSEIF_49 +# IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_FALSEIF_49 +lw $t1, -20($fp) +beq $t1, 0, label_FALSEIF_49 +# LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_12 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -40($fp) +# LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) +# LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) +# local_west_at_CellularAutomaton_internal_3 = local_west_at_CellularAutomaton_internal_9 +lw $t1, -40($fp) +sw $t1, -16($fp) +# GOTO label_ENDIF_50 +j label_ENDIF_50 +label_FALSEIF_49: + # LOCAL local_west_at_CellularAutomaton_internal_12 --> -52($fp) + # local_west_at_CellularAutomaton_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_west_at_CellularAutomaton_internal_12 --> -52($fp) + # local_west_at_CellularAutomaton_internal_10 = local_west_at_CellularAutomaton_internal_12 + lw $t1, -52($fp) + sw $t1, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_west_at_CellularAutomaton_internal_13 --> -56($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # local_west_at_CellularAutomaton_internal_13 = PARAM param_west_at_CellularAutomaton_position_0 - 1 + lw $t1, 0($fp) + sub $t1, $t1, 1 + sw $t1, -56($fp) + # ARG local_west_at_CellularAutomaton_internal_13 + # LOCAL local_west_at_CellularAutomaton_internal_13 --> -56($fp) + lw $t1, -56($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_west_at_CellularAutomaton_internal_11 --> -48($fp) + # local_west_at_CellularAutomaton_internal_11 = VCALL local_west_at_CellularAutomaton_internal_10 cell + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 48($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_west_at_CellularAutomaton_internal_11 --> -48($fp) + # local_west_at_CellularAutomaton_internal_3 = local_west_at_CellularAutomaton_internal_11 + lw $t1, -48($fp) + sw $t1, -16($fp) + label_ENDIF_50: +# LOCAL local_west_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) +# local_west_at_CellularAutomaton_internal_0 = local_west_at_CellularAutomaton_internal_3 +lw $t1, -16($fp) +sw $t1, -4($fp) +label_ENDIF_46: +# RETURN local_west_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_west_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 64 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_northwest_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_northwest_at_CellularAutomaton_position_0 +function_northwest_at_CellularAutomaton: + # Allocate stack frame for function function_northwest_at_CellularAutomaton. + subu $sp, $sp, 72 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 72 + # local_northwest_at_CellularAutomaton_internal_3 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northwest_at_CellularAutomaton_internal_3 --> -16($fp) + lw $t1, 16($s1) + sw $t1, -16($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_2 --> -12($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_3 --> -16($fp) + # local_northwest_at_CellularAutomaton_internal_2 = PARAM param_northwest_at_CellularAutomaton_position_0 - local_northwest_at_CellularAutomaton_internal_3 + lw $t1, 0($fp) + lw $t2, -16($fp) + sub $t1, $t1, $t2 + sw $t1, -12($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_2 --> -12($fp) + # local_northwest_at_CellularAutomaton_internal_1 = local_northwest_at_CellularAutomaton_internal_2 - 0 + lw $t1, -12($fp) + sub $t1, $t1, 0 + sw $t1, -8($fp) + # IF_GREATER_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_55 + # IF_GREATER_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_55 + lw $t1, -8($fp) + bgt $t1, 0, label_FALSE_55 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_55 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_55 + lw $t1, -8($fp) + beq $t1, 0, label_FALSE_55 + # LOCAL local_northwest_at_CellularAutomaton_internal_1 --> -8($fp) + # local_northwest_at_CellularAutomaton_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + # GOTO label_END_56 +j label_END_56 +label_FALSE_55: + # LOCAL local_northwest_at_CellularAutomaton_internal_1 --> -8($fp) + # local_northwest_at_CellularAutomaton_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + label_END_56: +# IF_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_53 +# IF_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_53 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_53 +# LOCAL local_northwest_at_CellularAutomaton_internal_4 --> -20($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_13 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -20($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_4 --> -20($fp) +# local_northwest_at_CellularAutomaton_internal_0 = local_northwest_at_CellularAutomaton_internal_4 +lw $t1, -20($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_54 +j label_ENDIF_54 +label_FALSEIF_53: + # local_northwest_at_CellularAutomaton_internal_9 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northwest_at_CellularAutomaton_internal_9 --> -40($fp) + lw $t1, 16($s1) + sw $t1, -40($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_8 --> -36($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_9 --> -40($fp) + # local_northwest_at_CellularAutomaton_internal_8 = PARAM param_northwest_at_CellularAutomaton_position_0 / local_northwest_at_CellularAutomaton_internal_9 + lw $t1, 0($fp) + lw $t2, -40($fp) + div $t1, $t1, $t2 + sw $t1, -36($fp) + # local_northwest_at_CellularAutomaton_internal_10 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) + lw $t1, 16($s1) + sw $t1, -44($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) + # local_northwest_at_CellularAutomaton_internal_7 = local_northwest_at_CellularAutomaton_internal_8 * local_northwest_at_CellularAutomaton_internal_10 + lw $t1, -36($fp) + lw $t2, -44($fp) + mul $t1, $t1, $t2 + sw $t1, -32($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_7 --> -32($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + # local_northwest_at_CellularAutomaton_internal_6 = local_northwest_at_CellularAutomaton_internal_7 - PARAM param_northwest_at_CellularAutomaton_position_0 + lw $t1, -32($fp) + lw $t2, 0($fp) + sub $t1, $t1, $t2 + sw $t1, -28($fp) + # IF_ZERO local_northwest_at_CellularAutomaton_internal_6 GOTO label_TRUE_59 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_6 GOTO label_TRUE_59 + lw $t1, -28($fp) + beq $t1, 0, label_TRUE_59 + # LOCAL local_northwest_at_CellularAutomaton_internal_6 --> -28($fp) + # local_northwest_at_CellularAutomaton_internal_6 = 0 + li $t1, 0 + sw $t1, -28($fp) + # GOTO label_END_60 +j label_END_60 +label_TRUE_59: + # LOCAL local_northwest_at_CellularAutomaton_internal_6 --> -28($fp) + # local_northwest_at_CellularAutomaton_internal_6 = 1 + li $t1, 1 + sw $t1, -28($fp) + label_END_60: +# IF_ZERO local_northwest_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_57 +# IF_ZERO local_northwest_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_57 +lw $t1, -28($fp) +beq $t1, 0, label_FALSEIF_57 +# LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_14 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -48($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) +# local_northwest_at_CellularAutomaton_internal_5 = local_northwest_at_CellularAutomaton_internal_11 +lw $t1, -48($fp) +sw $t1, -24($fp) +# GOTO label_ENDIF_58 +j label_ENDIF_58 +label_FALSEIF_57: + # LOCAL local_northwest_at_CellularAutomaton_internal_14 --> -60($fp) + # local_northwest_at_CellularAutomaton_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_14 --> -60($fp) + # local_northwest_at_CellularAutomaton_internal_12 = local_northwest_at_CellularAutomaton_internal_14 + lw $t1, -60($fp) + sw $t1, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_northwest_at_CellularAutomaton_internal_15 --> -64($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + # local_northwest_at_CellularAutomaton_internal_15 = PARAM param_northwest_at_CellularAutomaton_position_0 - 1 + lw $t1, 0($fp) + sub $t1, $t1, 1 + sw $t1, -64($fp) + # ARG local_northwest_at_CellularAutomaton_internal_15 + # LOCAL local_northwest_at_CellularAutomaton_internal_15 --> -64($fp) + lw $t1, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_northwest_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_13 --> -56($fp) + # local_northwest_at_CellularAutomaton_internal_13 = VCALL local_northwest_at_CellularAutomaton_internal_12 north + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 52($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_northwest_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_13 --> -56($fp) + # local_northwest_at_CellularAutomaton_internal_5 = local_northwest_at_CellularAutomaton_internal_13 + lw $t1, -56($fp) + sw $t1, -24($fp) + label_ENDIF_58: +# LOCAL local_northwest_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_5 --> -24($fp) +# local_northwest_at_CellularAutomaton_internal_0 = local_northwest_at_CellularAutomaton_internal_5 +lw $t1, -24($fp) +sw $t1, -4($fp) +label_ENDIF_54: +# RETURN local_northwest_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_northwest_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 72 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_northeast_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_northeast_at_CellularAutomaton_position_0 +function_northeast_at_CellularAutomaton: + # Allocate stack frame for function function_northeast_at_CellularAutomaton. + subu $sp, $sp, 80 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 80 + # local_northeast_at_CellularAutomaton_internal_3 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northeast_at_CellularAutomaton_internal_3 --> -16($fp) + lw $t1, 16($s1) + sw $t1, -16($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_2 --> -12($fp) + # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_3 --> -16($fp) + # local_northeast_at_CellularAutomaton_internal_2 = PARAM param_northeast_at_CellularAutomaton_position_0 - local_northeast_at_CellularAutomaton_internal_3 + lw $t1, 0($fp) + lw $t2, -16($fp) + sub $t1, $t1, $t2 + sw $t1, -12($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_2 --> -12($fp) + # local_northeast_at_CellularAutomaton_internal_1 = local_northeast_at_CellularAutomaton_internal_2 - 0 + lw $t1, -12($fp) + sub $t1, $t1, 0 + sw $t1, -8($fp) + # IF_GREATER_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_63 + # IF_GREATER_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_63 + lw $t1, -8($fp) + bgt $t1, 0, label_FALSE_63 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_63 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_63 + lw $t1, -8($fp) + beq $t1, 0, label_FALSE_63 + # LOCAL local_northeast_at_CellularAutomaton_internal_1 --> -8($fp) + # local_northeast_at_CellularAutomaton_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + # GOTO label_END_64 +j label_END_64 +label_FALSE_63: + # LOCAL local_northeast_at_CellularAutomaton_internal_1 --> -8($fp) + # local_northeast_at_CellularAutomaton_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + label_END_64: +# IF_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_61 +# IF_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_61 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_61 +# LOCAL local_northeast_at_CellularAutomaton_internal_4 --> -20($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_15 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -20($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_4 --> -20($fp) +# local_northeast_at_CellularAutomaton_internal_0 = local_northeast_at_CellularAutomaton_internal_4 +lw $t1, -20($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_62 +j label_ENDIF_62 +label_FALSEIF_61: + # LOCAL local_northeast_at_CellularAutomaton_internal_9 --> -40($fp) + # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) + # local_northeast_at_CellularAutomaton_internal_9 = PARAM param_northeast_at_CellularAutomaton_position_0 + 1 + lw $t1, 0($fp) + add $t1, $t1, 1 + sw $t1, -40($fp) + # local_northeast_at_CellularAutomaton_internal_10 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) + lw $t1, 16($s1) + sw $t1, -44($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) + # local_northeast_at_CellularAutomaton_internal_8 = local_northeast_at_CellularAutomaton_internal_9 / local_northeast_at_CellularAutomaton_internal_10 + lw $t1, -40($fp) + lw $t2, -44($fp) + div $t1, $t1, $t2 + sw $t1, -36($fp) + # local_northeast_at_CellularAutomaton_internal_11 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) + lw $t1, 16($s1) + sw $t1, -48($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) + # local_northeast_at_CellularAutomaton_internal_7 = local_northeast_at_CellularAutomaton_internal_8 * local_northeast_at_CellularAutomaton_internal_11 + lw $t1, -36($fp) + lw $t2, -48($fp) + mul $t1, $t1, $t2 + sw $t1, -32($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_12 --> -52($fp) + # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) + # local_northeast_at_CellularAutomaton_internal_12 = PARAM param_northeast_at_CellularAutomaton_position_0 + 1 + lw $t1, 0($fp) + add $t1, $t1, 1 + sw $t1, -52($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_12 --> -52($fp) + # local_northeast_at_CellularAutomaton_internal_6 = local_northeast_at_CellularAutomaton_internal_7 - local_northeast_at_CellularAutomaton_internal_12 + lw $t1, -32($fp) + lw $t2, -52($fp) + sub $t1, $t1, $t2 + sw $t1, -28($fp) + # IF_ZERO local_northeast_at_CellularAutomaton_internal_6 GOTO label_TRUE_67 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_6 GOTO label_TRUE_67 + lw $t1, -28($fp) + beq $t1, 0, label_TRUE_67 + # LOCAL local_northeast_at_CellularAutomaton_internal_6 --> -28($fp) + # local_northeast_at_CellularAutomaton_internal_6 = 0 + li $t1, 0 + sw $t1, -28($fp) + # GOTO label_END_68 +j label_END_68 +label_TRUE_67: + # LOCAL local_northeast_at_CellularAutomaton_internal_6 --> -28($fp) + # local_northeast_at_CellularAutomaton_internal_6 = 1 + li $t1, 1 + sw $t1, -28($fp) + label_END_68: +# IF_ZERO local_northeast_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_65 +# IF_ZERO local_northeast_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_65 +lw $t1, -28($fp) +beq $t1, 0, label_FALSEIF_65 +# LOCAL local_northeast_at_CellularAutomaton_internal_13 --> -56($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_16 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -56($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_13 --> -56($fp) +# local_northeast_at_CellularAutomaton_internal_5 = local_northeast_at_CellularAutomaton_internal_13 +lw $t1, -56($fp) +sw $t1, -24($fp) +# GOTO label_ENDIF_66 +j label_ENDIF_66 +label_FALSEIF_65: + # LOCAL local_northeast_at_CellularAutomaton_internal_16 --> -68($fp) + # local_northeast_at_CellularAutomaton_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_14 --> -60($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_16 --> -68($fp) + # local_northeast_at_CellularAutomaton_internal_14 = local_northeast_at_CellularAutomaton_internal_16 + lw $t1, -68($fp) + sw $t1, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) + # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) + # local_northeast_at_CellularAutomaton_internal_17 = PARAM param_northeast_at_CellularAutomaton_position_0 + 1 + lw $t1, 0($fp) + add $t1, $t1, 1 + sw $t1, -72($fp) + # ARG local_northeast_at_CellularAutomaton_internal_17 + # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) + lw $t1, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_northeast_at_CellularAutomaton_internal_14 --> -60($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_15 --> -64($fp) + # local_northeast_at_CellularAutomaton_internal_15 = VCALL local_northeast_at_CellularAutomaton_internal_14 north + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 52($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_northeast_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_15 --> -64($fp) + # local_northeast_at_CellularAutomaton_internal_5 = local_northeast_at_CellularAutomaton_internal_15 + lw $t1, -64($fp) + sw $t1, -24($fp) + label_ENDIF_66: +# LOCAL local_northeast_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_5 --> -24($fp) +# local_northeast_at_CellularAutomaton_internal_0 = local_northeast_at_CellularAutomaton_internal_5 +lw $t1, -24($fp) +sw $t1, -4($fp) +label_ENDIF_62: +# RETURN local_northeast_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_northeast_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 80 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_southeast_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_southeast_at_CellularAutomaton_position_0 +function_southeast_at_CellularAutomaton: + # Allocate stack frame for function function_southeast_at_CellularAutomaton. + subu $sp, $sp, 84 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 84 + # local_southeast_at_CellularAutomaton_internal_2 = GETATTRIBUTE board_size CellularAutomaton + # LOCAL local_southeast_at_CellularAutomaton_internal_2 --> -12($fp) + lw $t1, 20($s1) + sw $t1, -12($fp) + # local_southeast_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southeast_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t1, 16($s1) + sw $t1, -20($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_4 --> -20($fp) + # local_southeast_at_CellularAutomaton_internal_3 = PARAM param_southeast_at_CellularAutomaton_position_0 + local_southeast_at_CellularAutomaton_internal_4 + lw $t1, 0($fp) + lw $t2, -20($fp) + add $t1, $t1, $t2 + sw $t1, -16($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_3 --> -16($fp) + # local_southeast_at_CellularAutomaton_internal_1 = local_southeast_at_CellularAutomaton_internal_2 - local_southeast_at_CellularAutomaton_internal_3 + lw $t1, -12($fp) + lw $t2, -16($fp) + sub $t1, $t1, $t2 + sw $t1, -8($fp) + # IF_GREATER_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_71 + # IF_GREATER_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_71 + lw $t1, -8($fp) + bgt $t1, 0, label_FALSE_71 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_71 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_71 + lw $t1, -8($fp) + beq $t1, 0, label_FALSE_71 + # LOCAL local_southeast_at_CellularAutomaton_internal_1 --> -8($fp) + # local_southeast_at_CellularAutomaton_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + # GOTO label_END_72 +j label_END_72 +label_FALSE_71: + # LOCAL local_southeast_at_CellularAutomaton_internal_1 --> -8($fp) + # local_southeast_at_CellularAutomaton_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + label_END_72: +# IF_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_69 +# IF_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_69 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_69 +# LOCAL local_southeast_at_CellularAutomaton_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_17 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -24($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_5 --> -24($fp) +# local_southeast_at_CellularAutomaton_internal_0 = local_southeast_at_CellularAutomaton_internal_5 +lw $t1, -24($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_70 +j label_ENDIF_70 +label_FALSEIF_69: + # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) + # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) + # local_southeast_at_CellularAutomaton_internal_10 = PARAM param_southeast_at_CellularAutomaton_position_0 + 1 + lw $t1, 0($fp) + add $t1, $t1, 1 + sw $t1, -44($fp) + # local_southeast_at_CellularAutomaton_internal_11 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) + lw $t1, 16($s1) + sw $t1, -48($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) + # local_southeast_at_CellularAutomaton_internal_9 = local_southeast_at_CellularAutomaton_internal_10 / local_southeast_at_CellularAutomaton_internal_11 + lw $t1, -44($fp) + lw $t2, -48($fp) + div $t1, $t1, $t2 + sw $t1, -40($fp) + # local_southeast_at_CellularAutomaton_internal_12 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southeast_at_CellularAutomaton_internal_12 --> -52($fp) + lw $t1, 16($s1) + sw $t1, -52($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_12 --> -52($fp) + # local_southeast_at_CellularAutomaton_internal_8 = local_southeast_at_CellularAutomaton_internal_9 * local_southeast_at_CellularAutomaton_internal_12 + lw $t1, -40($fp) + lw $t2, -52($fp) + mul $t1, $t1, $t2 + sw $t1, -36($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_13 --> -56($fp) + # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) + # local_southeast_at_CellularAutomaton_internal_13 = PARAM param_southeast_at_CellularAutomaton_position_0 + 1 + lw $t1, 0($fp) + add $t1, $t1, 1 + sw $t1, -56($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_13 --> -56($fp) + # local_southeast_at_CellularAutomaton_internal_7 = local_southeast_at_CellularAutomaton_internal_8 - local_southeast_at_CellularAutomaton_internal_13 + lw $t1, -36($fp) + lw $t2, -56($fp) + sub $t1, $t1, $t2 + sw $t1, -32($fp) + # IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_TRUE_75 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_TRUE_75 + lw $t1, -32($fp) + beq $t1, 0, label_TRUE_75 + # LOCAL local_southeast_at_CellularAutomaton_internal_7 --> -32($fp) + # local_southeast_at_CellularAutomaton_internal_7 = 0 + li $t1, 0 + sw $t1, -32($fp) + # GOTO label_END_76 +j label_END_76 +label_TRUE_75: + # LOCAL local_southeast_at_CellularAutomaton_internal_7 --> -32($fp) + # local_southeast_at_CellularAutomaton_internal_7 = 1 + li $t1, 1 + sw $t1, -32($fp) + label_END_76: +# IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_73 +# IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_73 +lw $t1, -32($fp) +beq $t1, 0, label_FALSEIF_73 +# LOCAL local_southeast_at_CellularAutomaton_internal_14 --> -60($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_18 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -60($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_14 --> -60($fp) +# local_southeast_at_CellularAutomaton_internal_6 = local_southeast_at_CellularAutomaton_internal_14 +lw $t1, -60($fp) +sw $t1, -28($fp) +# GOTO label_ENDIF_74 +j label_ENDIF_74 +label_FALSEIF_73: + # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) + # local_southeast_at_CellularAutomaton_internal_17 = SELF + sw $s1, -72($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_15 --> -64($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) + # local_southeast_at_CellularAutomaton_internal_15 = local_southeast_at_CellularAutomaton_internal_17 + lw $t1, -72($fp) + sw $t1, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_southeast_at_CellularAutomaton_internal_18 --> -76($fp) + # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) + # local_southeast_at_CellularAutomaton_internal_18 = PARAM param_southeast_at_CellularAutomaton_position_0 + 1 + lw $t1, 0($fp) + add $t1, $t1, 1 + sw $t1, -76($fp) + # ARG local_southeast_at_CellularAutomaton_internal_18 + # LOCAL local_southeast_at_CellularAutomaton_internal_18 --> -76($fp) + lw $t1, -76($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_southeast_at_CellularAutomaton_internal_15 --> -64($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_16 --> -68($fp) + # local_southeast_at_CellularAutomaton_internal_16 = VCALL local_southeast_at_CellularAutomaton_internal_15 south + # Save new self pointer in $s1 + lw $s1, -64($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 56($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_southeast_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_16 --> -68($fp) + # local_southeast_at_CellularAutomaton_internal_6 = local_southeast_at_CellularAutomaton_internal_16 + lw $t1, -68($fp) + sw $t1, -28($fp) + label_ENDIF_74: +# LOCAL local_southeast_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_6 --> -28($fp) +# local_southeast_at_CellularAutomaton_internal_0 = local_southeast_at_CellularAutomaton_internal_6 +lw $t1, -28($fp) +sw $t1, -4($fp) +label_ENDIF_70: +# RETURN local_southeast_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_southeast_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 84 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_southwest_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_southwest_at_CellularAutomaton_position_0 +function_southwest_at_CellularAutomaton: + # Allocate stack frame for function function_southwest_at_CellularAutomaton. + subu $sp, $sp, 76 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 76 + # local_southwest_at_CellularAutomaton_internal_2 = GETATTRIBUTE board_size CellularAutomaton + # LOCAL local_southwest_at_CellularAutomaton_internal_2 --> -12($fp) + lw $t1, 20($s1) + sw $t1, -12($fp) + # local_southwest_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southwest_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t1, 16($s1) + sw $t1, -20($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_4 --> -20($fp) + # local_southwest_at_CellularAutomaton_internal_3 = PARAM param_southwest_at_CellularAutomaton_position_0 + local_southwest_at_CellularAutomaton_internal_4 + lw $t1, 0($fp) + lw $t2, -20($fp) + add $t1, $t1, $t2 + sw $t1, -16($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_3 --> -16($fp) + # local_southwest_at_CellularAutomaton_internal_1 = local_southwest_at_CellularAutomaton_internal_2 - local_southwest_at_CellularAutomaton_internal_3 + lw $t1, -12($fp) + lw $t2, -16($fp) + sub $t1, $t1, $t2 + sw $t1, -8($fp) + # IF_GREATER_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_79 + # IF_GREATER_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_79 + lw $t1, -8($fp) + bgt $t1, 0, label_FALSE_79 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_79 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_79 + lw $t1, -8($fp) + beq $t1, 0, label_FALSE_79 + # LOCAL local_southwest_at_CellularAutomaton_internal_1 --> -8($fp) + # local_southwest_at_CellularAutomaton_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + # GOTO label_END_80 +j label_END_80 +label_FALSE_79: + # LOCAL local_southwest_at_CellularAutomaton_internal_1 --> -8($fp) + # local_southwest_at_CellularAutomaton_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + label_END_80: +# IF_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_77 +# IF_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_77 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_77 +# LOCAL local_southwest_at_CellularAutomaton_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_19 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -24($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_5 --> -24($fp) +# local_southwest_at_CellularAutomaton_internal_0 = local_southwest_at_CellularAutomaton_internal_5 +lw $t1, -24($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_78 +j label_ENDIF_78 +label_FALSEIF_77: + # local_southwest_at_CellularAutomaton_internal_10 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) + lw $t1, 16($s1) + sw $t1, -44($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_9 --> -40($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) + # local_southwest_at_CellularAutomaton_internal_9 = PARAM param_southwest_at_CellularAutomaton_position_0 / local_southwest_at_CellularAutomaton_internal_10 + lw $t1, 0($fp) + lw $t2, -44($fp) + div $t1, $t1, $t2 + sw $t1, -40($fp) + # local_southwest_at_CellularAutomaton_internal_11 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) + lw $t1, 16($s1) + sw $t1, -48($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) + # local_southwest_at_CellularAutomaton_internal_8 = local_southwest_at_CellularAutomaton_internal_9 * local_southwest_at_CellularAutomaton_internal_11 + lw $t1, -40($fp) + lw $t2, -48($fp) + mul $t1, $t1, $t2 + sw $t1, -36($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_8 --> -36($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + # local_southwest_at_CellularAutomaton_internal_7 = local_southwest_at_CellularAutomaton_internal_8 - PARAM param_southwest_at_CellularAutomaton_position_0 + lw $t1, -36($fp) + lw $t2, 0($fp) + sub $t1, $t1, $t2 + sw $t1, -32($fp) + # IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_TRUE_83 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_TRUE_83 + lw $t1, -32($fp) + beq $t1, 0, label_TRUE_83 + # LOCAL local_southwest_at_CellularAutomaton_internal_7 --> -32($fp) + # local_southwest_at_CellularAutomaton_internal_7 = 0 + li $t1, 0 + sw $t1, -32($fp) + # GOTO label_END_84 +j label_END_84 +label_TRUE_83: + # LOCAL local_southwest_at_CellularAutomaton_internal_7 --> -32($fp) + # local_southwest_at_CellularAutomaton_internal_7 = 1 + li $t1, 1 + sw $t1, -32($fp) + label_END_84: +# IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_81 +# IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_81 +lw $t1, -32($fp) +beq $t1, 0, label_FALSEIF_81 +# LOCAL local_southwest_at_CellularAutomaton_internal_12 --> -52($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_20 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -52($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_12 --> -52($fp) +# local_southwest_at_CellularAutomaton_internal_6 = local_southwest_at_CellularAutomaton_internal_12 +lw $t1, -52($fp) +sw $t1, -28($fp) +# GOTO label_ENDIF_82 +j label_ENDIF_82 +label_FALSEIF_81: + # LOCAL local_southwest_at_CellularAutomaton_internal_15 --> -64($fp) + # local_southwest_at_CellularAutomaton_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_15 --> -64($fp) + # local_southwest_at_CellularAutomaton_internal_13 = local_southwest_at_CellularAutomaton_internal_15 + lw $t1, -64($fp) + sw $t1, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_southwest_at_CellularAutomaton_internal_16 --> -68($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + # local_southwest_at_CellularAutomaton_internal_16 = PARAM param_southwest_at_CellularAutomaton_position_0 - 1 + lw $t1, 0($fp) + sub $t1, $t1, 1 + sw $t1, -68($fp) + # ARG local_southwest_at_CellularAutomaton_internal_16 + # LOCAL local_southwest_at_CellularAutomaton_internal_16 --> -68($fp) + lw $t1, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_southwest_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_14 --> -60($fp) + # local_southwest_at_CellularAutomaton_internal_14 = VCALL local_southwest_at_CellularAutomaton_internal_13 south + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 56($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_southwest_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_14 --> -60($fp) + # local_southwest_at_CellularAutomaton_internal_6 = local_southwest_at_CellularAutomaton_internal_14 + lw $t1, -60($fp) + sw $t1, -28($fp) + label_ENDIF_82: +# LOCAL local_southwest_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_6 --> -28($fp) +# local_southwest_at_CellularAutomaton_internal_0 = local_southwest_at_CellularAutomaton_internal_6 +lw $t1, -28($fp) +sw $t1, -4($fp) +label_ENDIF_78: +# RETURN local_southwest_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_southwest_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 76 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_neighbors_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_neighbors_at_CellularAutomaton_position_0 +function_neighbors_at_CellularAutomaton: + # Allocate stack frame for function function_neighbors_at_CellularAutomaton. + subu $sp, $sp, 228 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 228 + # LOCAL local_neighbors_at_CellularAutomaton_internal_11 --> -48($fp) + # local_neighbors_at_CellularAutomaton_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_11 --> -48($fp) + # local_neighbors_at_CellularAutomaton_internal_9 = local_neighbors_at_CellularAutomaton_internal_11 + lw $t1, -48($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_neighbors_at_CellularAutomaton_position_0 + # PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) + lw $t1, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) + # local_neighbors_at_CellularAutomaton_internal_10 = VCALL local_neighbors_at_CellularAutomaton_internal_9 north + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 52($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_21 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -52($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) + # local_neighbors_at_CellularAutomaton_internal_8 = local_neighbors_at_CellularAutomaton_internal_10 - local_neighbors_at_CellularAutomaton_internal_12 + lw $t1, -44($fp) + lw $t2, -52($fp) + sub $t1, $t1, $t2 + sw $t1, -36($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_8 GOTO label_TRUE_87 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_8 GOTO label_TRUE_87 + lw $t1, -36($fp) + beq $t1, 0, label_TRUE_87 + # LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) + # local_neighbors_at_CellularAutomaton_internal_8 = 0 + li $t1, 0 + sw $t1, -36($fp) + # GOTO label_END_88 +j label_END_88 +label_TRUE_87: + # LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) + # local_neighbors_at_CellularAutomaton_internal_8 = 1 + li $t1, 1 + sw $t1, -36($fp) + label_END_88: +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_8 GOTO label_FALSEIF_85 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_8 GOTO label_FALSEIF_85 +lw $t1, -36($fp) +beq $t1, 0, label_FALSEIF_85 +# LOCAL local_neighbors_at_CellularAutomaton_internal_7 --> -32($fp) +# local_neighbors_at_CellularAutomaton_internal_7 = 1 +li $t1, 1 +sw $t1, -32($fp) +# GOTO label_ENDIF_86 +j label_ENDIF_86 +label_FALSEIF_85: + # LOCAL local_neighbors_at_CellularAutomaton_internal_7 --> -32($fp) + # local_neighbors_at_CellularAutomaton_internal_7 = 0 + li $t1, 0 + sw $t1, -32($fp) + label_ENDIF_86: +# LOCAL local_neighbors_at_CellularAutomaton_internal_17 --> -72($fp) +# local_neighbors_at_CellularAutomaton_internal_17 = SELF +sw $s1, -72($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_15 --> -64($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_17 --> -72($fp) +# local_neighbors_at_CellularAutomaton_internal_15 = local_neighbors_at_CellularAutomaton_internal_17 +lw $t1, -72($fp) +sw $t1, -64($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_15 --> -64($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_16 --> -68($fp) +# local_neighbors_at_CellularAutomaton_internal_16 = VCALL local_neighbors_at_CellularAutomaton_internal_15 south +# Save new self pointer in $s1 +lw $s1, -64($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 56($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -68($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_18 --> -76($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_22 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -76($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_16 --> -68($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_18 --> -76($fp) +# local_neighbors_at_CellularAutomaton_internal_14 = local_neighbors_at_CellularAutomaton_internal_16 - local_neighbors_at_CellularAutomaton_internal_18 +lw $t1, -68($fp) +lw $t2, -76($fp) +sub $t1, $t1, $t2 +sw $t1, -60($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_TRUE_91 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_TRUE_91 +lw $t1, -60($fp) +beq $t1, 0, label_TRUE_91 +# LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) +# local_neighbors_at_CellularAutomaton_internal_14 = 0 +li $t1, 0 +sw $t1, -60($fp) +# GOTO label_END_92 +j label_END_92 +label_TRUE_91: + # LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) + # local_neighbors_at_CellularAutomaton_internal_14 = 1 + li $t1, 1 + sw $t1, -60($fp) + label_END_92: +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_FALSEIF_89 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_FALSEIF_89 +lw $t1, -60($fp) +beq $t1, 0, label_FALSEIF_89 +# LOCAL local_neighbors_at_CellularAutomaton_internal_13 --> -56($fp) +# local_neighbors_at_CellularAutomaton_internal_13 = 1 +li $t1, 1 +sw $t1, -56($fp) +# GOTO label_ENDIF_90 +j label_ENDIF_90 +label_FALSEIF_89: + # LOCAL local_neighbors_at_CellularAutomaton_internal_13 --> -56($fp) + # local_neighbors_at_CellularAutomaton_internal_13 = 0 + li $t1, 0 + sw $t1, -56($fp) + label_ENDIF_90: +# LOCAL local_neighbors_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_13 --> -56($fp) +# local_neighbors_at_CellularAutomaton_internal_6 = local_neighbors_at_CellularAutomaton_internal_7 + local_neighbors_at_CellularAutomaton_internal_13 +lw $t1, -32($fp) +lw $t2, -56($fp) +add $t1, $t1, $t2 +sw $t1, -28($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_23 --> -96($fp) +# local_neighbors_at_CellularAutomaton_internal_23 = SELF +sw $s1, -96($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_21 --> -88($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_23 --> -96($fp) +# local_neighbors_at_CellularAutomaton_internal_21 = local_neighbors_at_CellularAutomaton_internal_23 +lw $t1, -96($fp) +sw $t1, -88($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_21 --> -88($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) +# local_neighbors_at_CellularAutomaton_internal_22 = VCALL local_neighbors_at_CellularAutomaton_internal_21 east +# Save new self pointer in $s1 +lw $s1, -88($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 60($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -92($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_23 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -100($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) +# local_neighbors_at_CellularAutomaton_internal_20 = local_neighbors_at_CellularAutomaton_internal_22 - local_neighbors_at_CellularAutomaton_internal_24 +lw $t1, -92($fp) +lw $t2, -100($fp) +sub $t1, $t1, $t2 +sw $t1, -84($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_95 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_95 +lw $t1, -84($fp) +beq $t1, 0, label_TRUE_95 +# LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) +# local_neighbors_at_CellularAutomaton_internal_20 = 0 +li $t1, 0 +sw $t1, -84($fp) +# GOTO label_END_96 +j label_END_96 +label_TRUE_95: + # LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) + # local_neighbors_at_CellularAutomaton_internal_20 = 1 + li $t1, 1 + sw $t1, -84($fp) + label_END_96: +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_FALSEIF_93 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_FALSEIF_93 +lw $t1, -84($fp) +beq $t1, 0, label_FALSEIF_93 +# LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) +# local_neighbors_at_CellularAutomaton_internal_19 = 1 +li $t1, 1 +sw $t1, -80($fp) +# GOTO label_ENDIF_94 +j label_ENDIF_94 +label_FALSEIF_93: + # LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) + # local_neighbors_at_CellularAutomaton_internal_19 = 0 + li $t1, 0 + sw $t1, -80($fp) + label_ENDIF_94: +# LOCAL local_neighbors_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) +# local_neighbors_at_CellularAutomaton_internal_5 = local_neighbors_at_CellularAutomaton_internal_6 + local_neighbors_at_CellularAutomaton_internal_19 +lw $t1, -28($fp) +lw $t2, -80($fp) +add $t1, $t1, $t2 +sw $t1, -24($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_29 --> -120($fp) +# local_neighbors_at_CellularAutomaton_internal_29 = SELF +sw $s1, -120($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_27 --> -112($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_29 --> -120($fp) +# local_neighbors_at_CellularAutomaton_internal_27 = local_neighbors_at_CellularAutomaton_internal_29 +lw $t1, -120($fp) +sw $t1, -112($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_27 --> -112($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_28 --> -116($fp) +# local_neighbors_at_CellularAutomaton_internal_28 = VCALL local_neighbors_at_CellularAutomaton_internal_27 west +# Save new self pointer in $s1 +lw $s1, -112($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 64($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -116($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_24 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -124($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_26 --> -108($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_28 --> -116($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) +# local_neighbors_at_CellularAutomaton_internal_26 = local_neighbors_at_CellularAutomaton_internal_28 - local_neighbors_at_CellularAutomaton_internal_30 +lw $t1, -116($fp) +lw $t2, -124($fp) +sub $t1, $t1, $t2 +sw $t1, -108($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_26 GOTO label_TRUE_99 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_26 GOTO label_TRUE_99 +lw $t1, -108($fp) +beq $t1, 0, label_TRUE_99 +# LOCAL local_neighbors_at_CellularAutomaton_internal_26 --> -108($fp) +# local_neighbors_at_CellularAutomaton_internal_26 = 0 +li $t1, 0 +sw $t1, -108($fp) +# GOTO label_END_100 +j label_END_100 +label_TRUE_99: + # LOCAL local_neighbors_at_CellularAutomaton_internal_26 --> -108($fp) + # local_neighbors_at_CellularAutomaton_internal_26 = 1 + li $t1, 1 + sw $t1, -108($fp) + label_END_100: +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_26 GOTO label_FALSEIF_97 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_26 GOTO label_FALSEIF_97 +lw $t1, -108($fp) +beq $t1, 0, label_FALSEIF_97 +# LOCAL local_neighbors_at_CellularAutomaton_internal_25 --> -104($fp) +# local_neighbors_at_CellularAutomaton_internal_25 = 1 +li $t1, 1 +sw $t1, -104($fp) +# GOTO label_ENDIF_98 +j label_ENDIF_98 +label_FALSEIF_97: + # LOCAL local_neighbors_at_CellularAutomaton_internal_25 --> -104($fp) + # local_neighbors_at_CellularAutomaton_internal_25 = 0 + li $t1, 0 + sw $t1, -104($fp) + label_ENDIF_98: +# LOCAL local_neighbors_at_CellularAutomaton_internal_4 --> -20($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_25 --> -104($fp) +# local_neighbors_at_CellularAutomaton_internal_4 = local_neighbors_at_CellularAutomaton_internal_5 + local_neighbors_at_CellularAutomaton_internal_25 +lw $t1, -24($fp) +lw $t2, -104($fp) +add $t1, $t1, $t2 +sw $t1, -20($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_35 --> -144($fp) +# local_neighbors_at_CellularAutomaton_internal_35 = SELF +sw $s1, -144($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_33 --> -136($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_35 --> -144($fp) +# local_neighbors_at_CellularAutomaton_internal_33 = local_neighbors_at_CellularAutomaton_internal_35 +lw $t1, -144($fp) +sw $t1, -136($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_33 --> -136($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) +# local_neighbors_at_CellularAutomaton_internal_34 = VCALL local_neighbors_at_CellularAutomaton_internal_33 northeast +# Save new self pointer in $s1 +lw $s1, -136($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 72($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -140($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_36 --> -148($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_25 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -148($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_36 --> -148($fp) +# local_neighbors_at_CellularAutomaton_internal_32 = local_neighbors_at_CellularAutomaton_internal_34 - local_neighbors_at_CellularAutomaton_internal_36 +lw $t1, -140($fp) +lw $t2, -148($fp) +sub $t1, $t1, $t2 +sw $t1, -132($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_TRUE_103 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_TRUE_103 +lw $t1, -132($fp) +beq $t1, 0, label_TRUE_103 +# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) +# local_neighbors_at_CellularAutomaton_internal_32 = 0 +li $t1, 0 +sw $t1, -132($fp) +# GOTO label_END_104 +j label_END_104 +label_TRUE_103: + # LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) + # local_neighbors_at_CellularAutomaton_internal_32 = 1 + li $t1, 1 + sw $t1, -132($fp) + label_END_104: +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_FALSEIF_101 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_FALSEIF_101 +lw $t1, -132($fp) +beq $t1, 0, label_FALSEIF_101 +# LOCAL local_neighbors_at_CellularAutomaton_internal_31 --> -128($fp) +# local_neighbors_at_CellularAutomaton_internal_31 = 1 +li $t1, 1 +sw $t1, -128($fp) +# GOTO label_ENDIF_102 +j label_ENDIF_102 +label_FALSEIF_101: + # LOCAL local_neighbors_at_CellularAutomaton_internal_31 --> -128($fp) + # local_neighbors_at_CellularAutomaton_internal_31 = 0 + li $t1, 0 + sw $t1, -128($fp) + label_ENDIF_102: +# LOCAL local_neighbors_at_CellularAutomaton_internal_3 --> -16($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_4 --> -20($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_31 --> -128($fp) +# local_neighbors_at_CellularAutomaton_internal_3 = local_neighbors_at_CellularAutomaton_internal_4 + local_neighbors_at_CellularAutomaton_internal_31 +lw $t1, -20($fp) +lw $t2, -128($fp) +add $t1, $t1, $t2 +sw $t1, -16($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_41 --> -168($fp) +# local_neighbors_at_CellularAutomaton_internal_41 = SELF +sw $s1, -168($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_39 --> -160($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_41 --> -168($fp) +# local_neighbors_at_CellularAutomaton_internal_39 = local_neighbors_at_CellularAutomaton_internal_41 +lw $t1, -168($fp) +sw $t1, -160($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_39 --> -160($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) +# local_neighbors_at_CellularAutomaton_internal_40 = VCALL local_neighbors_at_CellularAutomaton_internal_39 northwest +# Save new self pointer in $s1 +lw $s1, -160($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 68($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -164($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_26 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -172($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) +# local_neighbors_at_CellularAutomaton_internal_38 = local_neighbors_at_CellularAutomaton_internal_40 - local_neighbors_at_CellularAutomaton_internal_42 +lw $t1, -164($fp) +lw $t2, -172($fp) +sub $t1, $t1, $t2 +sw $t1, -156($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_38 GOTO label_TRUE_107 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_38 GOTO label_TRUE_107 +lw $t1, -156($fp) +beq $t1, 0, label_TRUE_107 +# LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) +# local_neighbors_at_CellularAutomaton_internal_38 = 0 +li $t1, 0 +sw $t1, -156($fp) +# GOTO label_END_108 +j label_END_108 +label_TRUE_107: + # LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) + # local_neighbors_at_CellularAutomaton_internal_38 = 1 + li $t1, 1 + sw $t1, -156($fp) + label_END_108: +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_38 GOTO label_FALSEIF_105 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_38 GOTO label_FALSEIF_105 +lw $t1, -156($fp) +beq $t1, 0, label_FALSEIF_105 +# LOCAL local_neighbors_at_CellularAutomaton_internal_37 --> -152($fp) +# local_neighbors_at_CellularAutomaton_internal_37 = 1 +li $t1, 1 +sw $t1, -152($fp) +# GOTO label_ENDIF_106 +j label_ENDIF_106 +label_FALSEIF_105: + # LOCAL local_neighbors_at_CellularAutomaton_internal_37 --> -152($fp) + # local_neighbors_at_CellularAutomaton_internal_37 = 0 + li $t1, 0 + sw $t1, -152($fp) + label_ENDIF_106: +# LOCAL local_neighbors_at_CellularAutomaton_internal_2 --> -12($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_3 --> -16($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_37 --> -152($fp) +# local_neighbors_at_CellularAutomaton_internal_2 = local_neighbors_at_CellularAutomaton_internal_3 + local_neighbors_at_CellularAutomaton_internal_37 +lw $t1, -16($fp) +lw $t2, -152($fp) +add $t1, $t1, $t2 +sw $t1, -12($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_47 --> -192($fp) +# local_neighbors_at_CellularAutomaton_internal_47 = SELF +sw $s1, -192($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_45 --> -184($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_47 --> -192($fp) +# local_neighbors_at_CellularAutomaton_internal_45 = local_neighbors_at_CellularAutomaton_internal_47 +lw $t1, -192($fp) +sw $t1, -184($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_45 --> -184($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_46 --> -188($fp) +# local_neighbors_at_CellularAutomaton_internal_46 = VCALL local_neighbors_at_CellularAutomaton_internal_45 southeast +# Save new self pointer in $s1 +lw $s1, -184($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 76($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -188($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_48 --> -196($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_27 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -196($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_46 --> -188($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_48 --> -196($fp) +# local_neighbors_at_CellularAutomaton_internal_44 = local_neighbors_at_CellularAutomaton_internal_46 - local_neighbors_at_CellularAutomaton_internal_48 +lw $t1, -188($fp) +lw $t2, -196($fp) +sub $t1, $t1, $t2 +sw $t1, -180($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_TRUE_111 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_TRUE_111 +lw $t1, -180($fp) +beq $t1, 0, label_TRUE_111 +# LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) +# local_neighbors_at_CellularAutomaton_internal_44 = 0 +li $t1, 0 +sw $t1, -180($fp) +# GOTO label_END_112 +j label_END_112 +label_TRUE_111: + # LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) + # local_neighbors_at_CellularAutomaton_internal_44 = 1 + li $t1, 1 + sw $t1, -180($fp) + label_END_112: +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_FALSEIF_109 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_FALSEIF_109 +lw $t1, -180($fp) +beq $t1, 0, label_FALSEIF_109 +# LOCAL local_neighbors_at_CellularAutomaton_internal_43 --> -176($fp) +# local_neighbors_at_CellularAutomaton_internal_43 = 1 +li $t1, 1 +sw $t1, -176($fp) +# GOTO label_ENDIF_110 +j label_ENDIF_110 +label_FALSEIF_109: + # LOCAL local_neighbors_at_CellularAutomaton_internal_43 --> -176($fp) + # local_neighbors_at_CellularAutomaton_internal_43 = 0 + li $t1, 0 + sw $t1, -176($fp) + label_ENDIF_110: +# LOCAL local_neighbors_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_2 --> -12($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_43 --> -176($fp) +# local_neighbors_at_CellularAutomaton_internal_1 = local_neighbors_at_CellularAutomaton_internal_2 + local_neighbors_at_CellularAutomaton_internal_43 +lw $t1, -12($fp) +lw $t2, -176($fp) +add $t1, $t1, $t2 +sw $t1, -8($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_53 --> -216($fp) +# local_neighbors_at_CellularAutomaton_internal_53 = SELF +sw $s1, -216($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_51 --> -208($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_53 --> -216($fp) +# local_neighbors_at_CellularAutomaton_internal_51 = local_neighbors_at_CellularAutomaton_internal_53 +lw $t1, -216($fp) +sw $t1, -208($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_51 --> -208($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) +# local_neighbors_at_CellularAutomaton_internal_52 = VCALL local_neighbors_at_CellularAutomaton_internal_51 southwest +# Save new self pointer in $s1 +lw $s1, -208($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 80($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -212($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_28 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -220($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) +# local_neighbors_at_CellularAutomaton_internal_50 = local_neighbors_at_CellularAutomaton_internal_52 - local_neighbors_at_CellularAutomaton_internal_54 +lw $t1, -212($fp) +lw $t2, -220($fp) +sub $t1, $t1, $t2 +sw $t1, -204($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_115 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_115 +lw $t1, -204($fp) +beq $t1, 0, label_TRUE_115 +# LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) +# local_neighbors_at_CellularAutomaton_internal_50 = 0 +li $t1, 0 +sw $t1, -204($fp) +# GOTO label_END_116 +j label_END_116 +label_TRUE_115: + # LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) + # local_neighbors_at_CellularAutomaton_internal_50 = 1 + li $t1, 1 + sw $t1, -204($fp) + label_END_116: +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_FALSEIF_113 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_FALSEIF_113 +lw $t1, -204($fp) +beq $t1, 0, label_FALSEIF_113 +# LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) +# local_neighbors_at_CellularAutomaton_internal_49 = 1 +li $t1, 1 +sw $t1, -200($fp) +# GOTO label_ENDIF_114 +j label_ENDIF_114 +label_FALSEIF_113: + # LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) + # local_neighbors_at_CellularAutomaton_internal_49 = 0 + li $t1, 0 + sw $t1, -200($fp) + label_ENDIF_114: +# LOCAL local_neighbors_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) +# local_neighbors_at_CellularAutomaton_internal_0 = local_neighbors_at_CellularAutomaton_internal_1 + local_neighbors_at_CellularAutomaton_internal_49 +lw $t1, -8($fp) +lw $t2, -200($fp) +add $t1, $t1, $t2 +sw $t1, -4($fp) +# RETURN local_neighbors_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_neighbors_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 228 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_cell_at_next_evolution_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_cell_at_next_evolution_at_CellularAutomaton_position_0 +function_cell_at_next_evolution_at_CellularAutomaton: + # Allocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_2 = local_cell_at_next_evolution_at_CellularAutomaton_internal_4 + lw $t1, -20($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 + # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) + lw $t1, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_3 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 neighbors + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 84($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = local_cell_at_next_evolution_at_CellularAutomaton_internal_3 - 3 + lw $t1, -16($fp) + sub $t1, $t1, 3 + sw $t1, -8($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_TRUE_119 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_TRUE_119 + lw $t1, -8($fp) + beq $t1, 0, label_TRUE_119 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # GOTO label_END_120 +j label_END_120 +label_TRUE_119: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + label_END_120: +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_117 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_117 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_117 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_29 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -24($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_0 = local_cell_at_next_evolution_at_CellularAutomaton_internal_5 +lw $t1, -24($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_118 +j label_ENDIF_118 +label_FALSEIF_117: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_10 = SELF + sw $s1, -44($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_8 = local_cell_at_next_evolution_at_CellularAutomaton_internal_10 + lw $t1, -44($fp) + sw $t1, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 + # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) + lw $t1, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_9 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 neighbors + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 84($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = local_cell_at_next_evolution_at_CellularAutomaton_internal_9 - 2 + lw $t1, -40($fp) + sub $t1, $t1, 2 + sw $t1, -32($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_TRUE_123 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_TRUE_123 + lw $t1, -32($fp) + beq $t1, 0, label_TRUE_123 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = 0 + li $t1, 0 + sw $t1, -32($fp) + # GOTO label_END_124 +j label_END_124 +label_TRUE_123: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = 1 + li $t1, 1 + sw $t1, -32($fp) + label_END_124: +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_121 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_121 +lw $t1, -32($fp) +beq $t1, 0, label_FALSEIF_121 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_15 = SELF +sw $s1, -64($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_13 = local_cell_at_next_evolution_at_CellularAutomaton_internal_15 +lw $t1, -64($fp) +sw $t1, -56($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 +# PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) +lw $t1, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_14 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 cell +# Save new self pointer in $s1 +lw $s1, -56($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 48($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -60($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_30 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -68($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = local_cell_at_next_evolution_at_CellularAutomaton_internal_14 - local_cell_at_next_evolution_at_CellularAutomaton_internal_16 +lw $t1, -60($fp) +lw $t2, -68($fp) +sub $t1, $t1, $t2 +sw $t1, -52($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_127 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_127 +lw $t1, -52($fp) +beq $t1, 0, label_TRUE_127 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = 0 +li $t1, 0 +sw $t1, -52($fp) +# GOTO label_END_128 +j label_END_128 +label_TRUE_127: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = 1 + li $t1, 1 + sw $t1, -52($fp) + label_END_128: +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_FALSEIF_125 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_FALSEIF_125 +lw $t1, -52($fp) +beq $t1, 0, label_FALSEIF_125 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_31 +sw $t1, 12($v0) +li $t1, 1 +sw $t1, 16($v0) +sw $v0, -72($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_11 = local_cell_at_next_evolution_at_CellularAutomaton_internal_17 +lw $t1, -72($fp) +sw $t1, -48($fp) +# GOTO label_ENDIF_126 +j label_ENDIF_126 +label_FALSEIF_125: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_32 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -76($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_11 = local_cell_at_next_evolution_at_CellularAutomaton_internal_18 + lw $t1, -76($fp) + sw $t1, -48($fp) + label_ENDIF_126: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_6 = local_cell_at_next_evolution_at_CellularAutomaton_internal_11 +lw $t1, -48($fp) +sw $t1, -28($fp) +# GOTO label_ENDIF_122 +j label_ENDIF_122 +label_FALSEIF_121: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_33 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -80($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_6 = local_cell_at_next_evolution_at_CellularAutomaton_internal_19 + lw $t1, -80($fp) + sw $t1, -28($fp) + label_ENDIF_122: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_0 = local_cell_at_next_evolution_at_CellularAutomaton_internal_6 +lw $t1, -28($fp) +sw $t1, -4($fp) +label_ENDIF_118: +# RETURN local_cell_at_next_evolution_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_evolve_at_CellularAutomaton implementation. +# @Params: +function_evolve_at_CellularAutomaton: + # Allocate stack frame for function function_evolve_at_CellularAutomaton. + subu $sp, $sp, 64 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 64 + # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) + # local_evolve_at_CellularAutomaton_position_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) + # local_evolve_at_CellularAutomaton_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) + # local_evolve_at_CellularAutomaton_internal_2 = local_evolve_at_CellularAutomaton_internal_4 + lw $t1, -20($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_evolve_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) + # local_evolve_at_CellularAutomaton_internal_3 = VCALL local_evolve_at_CellularAutomaton_internal_2 num_cells + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 44($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) + # local_evolve_at_CellularAutomaton_num_1 = local_evolve_at_CellularAutomaton_internal_3 + lw $t1, -16($fp) + sw $t1, -8($fp) + # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_0 + sw $t1, 12($v0) + li $t1, 0 + sw $t1, 16($v0) + sw $v0, -24($fp) + label_WHILE_129: + # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) + # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) + # local_evolve_at_CellularAutomaton_internal_6 = local_evolve_at_CellularAutomaton_position_0 - local_evolve_at_CellularAutomaton_num_1 + lw $t1, -4($fp) + lw $t2, -8($fp) + sub $t1, $t1, $t2 + sw $t1, -28($fp) + # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_131 + # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_131 + lw $t1, -28($fp) + bgt $t1, 0, label_FALSE_131 + # IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_131 + # IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_131 + lw $t1, -28($fp) + beq $t1, 0, label_FALSE_131 + # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) + # local_evolve_at_CellularAutomaton_internal_6 = 1 + li $t1, 1 + sw $t1, -28($fp) + # GOTO label_END_132 +j label_END_132 +label_FALSE_131: + # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) + # local_evolve_at_CellularAutomaton_internal_6 = 0 + li $t1, 0 + sw $t1, -28($fp) + label_END_132: +# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_130 +# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_130 +lw $t1, -28($fp) +beq $t1, 0, label_WHILE_END_130 +# LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) +# local_evolve_at_CellularAutomaton_internal_7 = local_evolve_at_CellularAutomaton_temp_5 +lw $t1, -24($fp) +sw $t1, -32($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) +# local_evolve_at_CellularAutomaton_internal_11 = SELF +sw $s1, -48($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) +# local_evolve_at_CellularAutomaton_internal_9 = local_evolve_at_CellularAutomaton_internal_11 +lw $t1, -48($fp) +sw $t1, -40($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_evolve_at_CellularAutomaton_position_0 +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +lw $t1, -4($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) +# local_evolve_at_CellularAutomaton_internal_10 = VCALL local_evolve_at_CellularAutomaton_internal_9 cell_at_next_evolution +# Save new self pointer in $s1 +lw $s1, -40($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 88($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -44($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_evolve_at_CellularAutomaton_internal_10 +# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) +lw $t1, -44($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) +# local_evolve_at_CellularAutomaton_internal_8 = VCALL local_evolve_at_CellularAutomaton_internal_7 concat +# Save new self pointer in $s1 +lw $s1, -32($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 12($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -36($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) +# local_evolve_at_CellularAutomaton_temp_5 = local_evolve_at_CellularAutomaton_internal_8 +lw $t1, -36($fp) +sw $t1, -24($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +# local_evolve_at_CellularAutomaton_internal_12 = local_evolve_at_CellularAutomaton_position_0 + 1 +lw $t1, -4($fp) +add $t1, $t1, 1 +sw $t1, -52($fp) +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) +# local_evolve_at_CellularAutomaton_position_0 = local_evolve_at_CellularAutomaton_internal_12 +lw $t1, -52($fp) +sw $t1, -4($fp) +# GOTO label_WHILE_129 +j label_WHILE_129 +label_WHILE_END_130: + # + # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) + lw $t1, -24($fp) + sw $t1, 24($s1) + # LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) + # local_evolve_at_CellularAutomaton_internal_13 = SELF + sw $s1, -56($fp) + # RETURN local_evolve_at_CellularAutomaton_internal_13 + lw $v0, -56($fp) + # Deallocate stack frame for function function_evolve_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 64 + jr $ra + # Function END + + +# function_option_at_CellularAutomaton implementation. +# @Params: +function_option_at_CellularAutomaton: + # Allocate stack frame for function function_option_at_CellularAutomaton. + subu $sp, $sp, 664 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 664 + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_num_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_3 --> -16($fp) + # local_option_at_CellularAutomaton_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_option_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_option_at_CellularAutomaton_internal_3 --> -16($fp) + # local_option_at_CellularAutomaton_internal_1 = local_option_at_CellularAutomaton_internal_3 + lw $t1, -16($fp) + sw $t1, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_34 + sw $t1, 12($v0) + li $t1, 24 + sw $t1, 16($v0) + sw $v0, -20($fp) + # ARG local_option_at_CellularAutomaton_internal_4 + # LOCAL local_option_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t1, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_option_at_CellularAutomaton_internal_2 --> -12($fp) + # local_option_at_CellularAutomaton_internal_2 = VCALL local_option_at_CellularAutomaton_internal_1 out_string + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_7 --> -32($fp) + # local_option_at_CellularAutomaton_internal_7 = SELF + sw $s1, -32($fp) + # LOCAL local_option_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_option_at_CellularAutomaton_internal_7 --> -32($fp) + # local_option_at_CellularAutomaton_internal_5 = local_option_at_CellularAutomaton_internal_7 + lw $t1, -32($fp) + sw $t1, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_35 + sw $t1, 12($v0) + li $t1, 13 + sw $t1, 16($v0) + sw $v0, -36($fp) + # ARG local_option_at_CellularAutomaton_internal_8 + # LOCAL local_option_at_CellularAutomaton_internal_8 --> -36($fp) + lw $t1, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_option_at_CellularAutomaton_internal_6 --> -28($fp) + # local_option_at_CellularAutomaton_internal_6 = VCALL local_option_at_CellularAutomaton_internal_5 out_string + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_11 --> -48($fp) + # local_option_at_CellularAutomaton_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_option_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_option_at_CellularAutomaton_internal_11 --> -48($fp) + # local_option_at_CellularAutomaton_internal_9 = local_option_at_CellularAutomaton_internal_11 + lw $t1, -48($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_36 + sw $t1, 12($v0) + li $t1, 48 + sw $t1, 16($v0) + sw $v0, -52($fp) + # ARG local_option_at_CellularAutomaton_internal_12 + # LOCAL local_option_at_CellularAutomaton_internal_12 --> -52($fp) + lw $t1, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_option_at_CellularAutomaton_internal_10 --> -44($fp) + # local_option_at_CellularAutomaton_internal_10 = VCALL local_option_at_CellularAutomaton_internal_9 out_string + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_15 --> -64($fp) + # local_option_at_CellularAutomaton_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_option_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_option_at_CellularAutomaton_internal_15 --> -64($fp) + # local_option_at_CellularAutomaton_internal_13 = local_option_at_CellularAutomaton_internal_15 + lw $t1, -64($fp) + sw $t1, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_37 + sw $t1, 12($v0) + li $t1, 48 + sw $t1, 16($v0) + sw $v0, -68($fp) + # ARG local_option_at_CellularAutomaton_internal_16 + # LOCAL local_option_at_CellularAutomaton_internal_16 --> -68($fp) + lw $t1, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_option_at_CellularAutomaton_internal_14 --> -60($fp) + # local_option_at_CellularAutomaton_internal_14 = VCALL local_option_at_CellularAutomaton_internal_13 out_string + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_19 --> -80($fp) + # local_option_at_CellularAutomaton_internal_19 = SELF + sw $s1, -80($fp) + # LOCAL local_option_at_CellularAutomaton_internal_17 --> -72($fp) + # LOCAL local_option_at_CellularAutomaton_internal_19 --> -80($fp) + # local_option_at_CellularAutomaton_internal_17 = local_option_at_CellularAutomaton_internal_19 + lw $t1, -80($fp) + sw $t1, -72($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_38 + sw $t1, 12($v0) + li $t1, 10 + sw $t1, 16($v0) + sw $v0, -84($fp) + # ARG local_option_at_CellularAutomaton_internal_20 + # LOCAL local_option_at_CellularAutomaton_internal_20 --> -84($fp) + lw $t1, -84($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_17 --> -72($fp) + # LOCAL local_option_at_CellularAutomaton_internal_18 --> -76($fp) + # local_option_at_CellularAutomaton_internal_18 = VCALL local_option_at_CellularAutomaton_internal_17 out_string + # Save new self pointer in $s1 + lw $s1, -72($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -76($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_23 --> -96($fp) + # local_option_at_CellularAutomaton_internal_23 = SELF + sw $s1, -96($fp) + # LOCAL local_option_at_CellularAutomaton_internal_21 --> -88($fp) + # LOCAL local_option_at_CellularAutomaton_internal_23 --> -96($fp) + # local_option_at_CellularAutomaton_internal_21 = local_option_at_CellularAutomaton_internal_23 + lw $t1, -96($fp) + sw $t1, -88($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_24 --> -100($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_39 + sw $t1, 12($v0) + li $t1, 26 + sw $t1, 16($v0) + sw $v0, -100($fp) + # ARG local_option_at_CellularAutomaton_internal_24 + # LOCAL local_option_at_CellularAutomaton_internal_24 --> -100($fp) + lw $t1, -100($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_21 --> -88($fp) + # LOCAL local_option_at_CellularAutomaton_internal_22 --> -92($fp) + # local_option_at_CellularAutomaton_internal_22 = VCALL local_option_at_CellularAutomaton_internal_21 out_string + # Save new self pointer in $s1 + lw $s1, -88($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -92($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_27 --> -112($fp) + # local_option_at_CellularAutomaton_internal_27 = SELF + sw $s1, -112($fp) + # LOCAL local_option_at_CellularAutomaton_internal_25 --> -104($fp) + # LOCAL local_option_at_CellularAutomaton_internal_27 --> -112($fp) + # local_option_at_CellularAutomaton_internal_25 = local_option_at_CellularAutomaton_internal_27 + lw $t1, -112($fp) + sw $t1, -104($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_28 --> -116($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_40 + sw $t1, 12($v0) + li $t1, 22 + sw $t1, 16($v0) + sw $v0, -116($fp) + # ARG local_option_at_CellularAutomaton_internal_28 + # LOCAL local_option_at_CellularAutomaton_internal_28 --> -116($fp) + lw $t1, -116($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_25 --> -104($fp) + # LOCAL local_option_at_CellularAutomaton_internal_26 --> -108($fp) + # local_option_at_CellularAutomaton_internal_26 = VCALL local_option_at_CellularAutomaton_internal_25 out_string + # Save new self pointer in $s1 + lw $s1, -104($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -108($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_31 --> -128($fp) + # local_option_at_CellularAutomaton_internal_31 = SELF + sw $s1, -128($fp) + # LOCAL local_option_at_CellularAutomaton_internal_29 --> -120($fp) + # LOCAL local_option_at_CellularAutomaton_internal_31 --> -128($fp) + # local_option_at_CellularAutomaton_internal_29 = local_option_at_CellularAutomaton_internal_31 + lw $t1, -128($fp) + sw $t1, -120($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_41 + sw $t1, 12($v0) + li $t1, 28 + sw $t1, 16($v0) + sw $v0, -132($fp) + # ARG local_option_at_CellularAutomaton_internal_32 + # LOCAL local_option_at_CellularAutomaton_internal_32 --> -132($fp) + lw $t1, -132($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_29 --> -120($fp) + # LOCAL local_option_at_CellularAutomaton_internal_30 --> -124($fp) + # local_option_at_CellularAutomaton_internal_30 = VCALL local_option_at_CellularAutomaton_internal_29 out_string + # Save new self pointer in $s1 + lw $s1, -120($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -124($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_35 --> -144($fp) + # local_option_at_CellularAutomaton_internal_35 = SELF + sw $s1, -144($fp) + # LOCAL local_option_at_CellularAutomaton_internal_33 --> -136($fp) + # LOCAL local_option_at_CellularAutomaton_internal_35 --> -144($fp) + # local_option_at_CellularAutomaton_internal_33 = local_option_at_CellularAutomaton_internal_35 + lw $t1, -144($fp) + sw $t1, -136($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_36 --> -148($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_42 + sw $t1, 12($v0) + li $t1, 25 + sw $t1, 16($v0) + sw $v0, -148($fp) + # ARG local_option_at_CellularAutomaton_internal_36 + # LOCAL local_option_at_CellularAutomaton_internal_36 --> -148($fp) + lw $t1, -148($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_33 --> -136($fp) + # LOCAL local_option_at_CellularAutomaton_internal_34 --> -140($fp) + # local_option_at_CellularAutomaton_internal_34 = VCALL local_option_at_CellularAutomaton_internal_33 out_string + # Save new self pointer in $s1 + lw $s1, -136($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -140($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_39 --> -160($fp) + # local_option_at_CellularAutomaton_internal_39 = SELF + sw $s1, -160($fp) + # LOCAL local_option_at_CellularAutomaton_internal_37 --> -152($fp) + # LOCAL local_option_at_CellularAutomaton_internal_39 --> -160($fp) + # local_option_at_CellularAutomaton_internal_37 = local_option_at_CellularAutomaton_internal_39 + lw $t1, -160($fp) + sw $t1, -152($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_40 --> -164($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_43 + sw $t1, 12($v0) + li $t1, 11 + sw $t1, 16($v0) + sw $v0, -164($fp) + # ARG local_option_at_CellularAutomaton_internal_40 + # LOCAL local_option_at_CellularAutomaton_internal_40 --> -164($fp) + lw $t1, -164($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_37 --> -152($fp) + # LOCAL local_option_at_CellularAutomaton_internal_38 --> -156($fp) + # local_option_at_CellularAutomaton_internal_38 = VCALL local_option_at_CellularAutomaton_internal_37 out_string + # Save new self pointer in $s1 + lw $s1, -152($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -156($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_43 --> -176($fp) + # local_option_at_CellularAutomaton_internal_43 = SELF + sw $s1, -176($fp) + # LOCAL local_option_at_CellularAutomaton_internal_41 --> -168($fp) + # LOCAL local_option_at_CellularAutomaton_internal_43 --> -176($fp) + # local_option_at_CellularAutomaton_internal_41 = local_option_at_CellularAutomaton_internal_43 + lw $t1, -176($fp) + sw $t1, -168($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_44 + sw $t1, 12($v0) + li $t1, 21 + sw $t1, 16($v0) + sw $v0, -180($fp) + # ARG local_option_at_CellularAutomaton_internal_44 + # LOCAL local_option_at_CellularAutomaton_internal_44 --> -180($fp) + lw $t1, -180($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_41 --> -168($fp) + # LOCAL local_option_at_CellularAutomaton_internal_42 --> -172($fp) + # local_option_at_CellularAutomaton_internal_42 = VCALL local_option_at_CellularAutomaton_internal_41 out_string + # Save new self pointer in $s1 + lw $s1, -168($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -172($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_47 --> -192($fp) + # local_option_at_CellularAutomaton_internal_47 = SELF + sw $s1, -192($fp) + # LOCAL local_option_at_CellularAutomaton_internal_45 --> -184($fp) + # LOCAL local_option_at_CellularAutomaton_internal_47 --> -192($fp) + # local_option_at_CellularAutomaton_internal_45 = local_option_at_CellularAutomaton_internal_47 + lw $t1, -192($fp) + sw $t1, -184($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_48 --> -196($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_45 + sw $t1, 12($v0) + li $t1, 32 + sw $t1, 16($v0) + sw $v0, -196($fp) + # ARG local_option_at_CellularAutomaton_internal_48 + # LOCAL local_option_at_CellularAutomaton_internal_48 --> -196($fp) + lw $t1, -196($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_45 --> -184($fp) + # LOCAL local_option_at_CellularAutomaton_internal_46 --> -188($fp) + # local_option_at_CellularAutomaton_internal_46 = VCALL local_option_at_CellularAutomaton_internal_45 out_string + # Save new self pointer in $s1 + lw $s1, -184($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -188($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_51 --> -208($fp) + # local_option_at_CellularAutomaton_internal_51 = SELF + sw $s1, -208($fp) + # LOCAL local_option_at_CellularAutomaton_internal_49 --> -200($fp) + # LOCAL local_option_at_CellularAutomaton_internal_51 --> -208($fp) + # local_option_at_CellularAutomaton_internal_49 = local_option_at_CellularAutomaton_internal_51 + lw $t1, -208($fp) + sw $t1, -200($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_52 --> -212($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_46 + sw $t1, 12($v0) + li $t1, 18 + sw $t1, 16($v0) + sw $v0, -212($fp) + # ARG local_option_at_CellularAutomaton_internal_52 + # LOCAL local_option_at_CellularAutomaton_internal_52 --> -212($fp) + lw $t1, -212($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_49 --> -200($fp) + # LOCAL local_option_at_CellularAutomaton_internal_50 --> -204($fp) + # local_option_at_CellularAutomaton_internal_50 = VCALL local_option_at_CellularAutomaton_internal_49 out_string + # Save new self pointer in $s1 + lw $s1, -200($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -204($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_55 --> -224($fp) + # local_option_at_CellularAutomaton_internal_55 = SELF + sw $s1, -224($fp) + # LOCAL local_option_at_CellularAutomaton_internal_53 --> -216($fp) + # LOCAL local_option_at_CellularAutomaton_internal_55 --> -224($fp) + # local_option_at_CellularAutomaton_internal_53 = local_option_at_CellularAutomaton_internal_55 + lw $t1, -224($fp) + sw $t1, -216($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_47 + sw $t1, 12($v0) + li $t1, 12 + sw $t1, 16($v0) + sw $v0, -228($fp) + # ARG local_option_at_CellularAutomaton_internal_56 + # LOCAL local_option_at_CellularAutomaton_internal_56 --> -228($fp) + lw $t1, -228($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_53 --> -216($fp) + # LOCAL local_option_at_CellularAutomaton_internal_54 --> -220($fp) + # local_option_at_CellularAutomaton_internal_54 = VCALL local_option_at_CellularAutomaton_internal_53 out_string + # Save new self pointer in $s1 + lw $s1, -216($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -220($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_59 --> -240($fp) + # local_option_at_CellularAutomaton_internal_59 = SELF + sw $s1, -240($fp) + # LOCAL local_option_at_CellularAutomaton_internal_57 --> -232($fp) + # LOCAL local_option_at_CellularAutomaton_internal_59 --> -240($fp) + # local_option_at_CellularAutomaton_internal_57 = local_option_at_CellularAutomaton_internal_59 + lw $t1, -240($fp) + sw $t1, -232($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_60 --> -244($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_48 + sw $t1, 12($v0) + li $t1, 17 + sw $t1, 16($v0) + sw $v0, -244($fp) + # ARG local_option_at_CellularAutomaton_internal_60 + # LOCAL local_option_at_CellularAutomaton_internal_60 --> -244($fp) + lw $t1, -244($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_57 --> -232($fp) + # LOCAL local_option_at_CellularAutomaton_internal_58 --> -236($fp) + # local_option_at_CellularAutomaton_internal_58 = VCALL local_option_at_CellularAutomaton_internal_57 out_string + # Save new self pointer in $s1 + lw $s1, -232($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -236($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_63 --> -256($fp) + # local_option_at_CellularAutomaton_internal_63 = SELF + sw $s1, -256($fp) + # LOCAL local_option_at_CellularAutomaton_internal_61 --> -248($fp) + # LOCAL local_option_at_CellularAutomaton_internal_63 --> -256($fp) + # local_option_at_CellularAutomaton_internal_61 = local_option_at_CellularAutomaton_internal_63 + lw $t1, -256($fp) + sw $t1, -248($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_64 --> -260($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_49 + sw $t1, 12($v0) + li $t1, 12 + sw $t1, 16($v0) + sw $v0, -260($fp) + # ARG local_option_at_CellularAutomaton_internal_64 + # LOCAL local_option_at_CellularAutomaton_internal_64 --> -260($fp) + lw $t1, -260($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_61 --> -248($fp) + # LOCAL local_option_at_CellularAutomaton_internal_62 --> -252($fp) + # local_option_at_CellularAutomaton_internal_62 = VCALL local_option_at_CellularAutomaton_internal_61 out_string + # Save new self pointer in $s1 + lw $s1, -248($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -252($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_67 --> -272($fp) + # local_option_at_CellularAutomaton_internal_67 = SELF + sw $s1, -272($fp) + # LOCAL local_option_at_CellularAutomaton_internal_65 --> -264($fp) + # LOCAL local_option_at_CellularAutomaton_internal_67 --> -272($fp) + # local_option_at_CellularAutomaton_internal_65 = local_option_at_CellularAutomaton_internal_67 + lw $t1, -272($fp) + sw $t1, -264($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_68 --> -276($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_50 + sw $t1, 12($v0) + li $t1, 13 + sw $t1, 16($v0) + sw $v0, -276($fp) + # ARG local_option_at_CellularAutomaton_internal_68 + # LOCAL local_option_at_CellularAutomaton_internal_68 --> -276($fp) + lw $t1, -276($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_65 --> -264($fp) + # LOCAL local_option_at_CellularAutomaton_internal_66 --> -268($fp) + # local_option_at_CellularAutomaton_internal_66 = VCALL local_option_at_CellularAutomaton_internal_65 out_string + # Save new self pointer in $s1 + lw $s1, -264($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -268($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_71 --> -288($fp) + # local_option_at_CellularAutomaton_internal_71 = SELF + sw $s1, -288($fp) + # LOCAL local_option_at_CellularAutomaton_internal_69 --> -280($fp) + # LOCAL local_option_at_CellularAutomaton_internal_71 --> -288($fp) + # local_option_at_CellularAutomaton_internal_69 = local_option_at_CellularAutomaton_internal_71 + lw $t1, -288($fp) + sw $t1, -280($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_72 --> -292($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_51 + sw $t1, 12($v0) + li $t1, 13 + sw $t1, 16($v0) + sw $v0, -292($fp) + # ARG local_option_at_CellularAutomaton_internal_72 + # LOCAL local_option_at_CellularAutomaton_internal_72 --> -292($fp) + lw $t1, -292($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_69 --> -280($fp) + # LOCAL local_option_at_CellularAutomaton_internal_70 --> -284($fp) + # local_option_at_CellularAutomaton_internal_70 = VCALL local_option_at_CellularAutomaton_internal_69 out_string + # Save new self pointer in $s1 + lw $s1, -280($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -284($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_75 --> -304($fp) + # local_option_at_CellularAutomaton_internal_75 = SELF + sw $s1, -304($fp) + # LOCAL local_option_at_CellularAutomaton_internal_73 --> -296($fp) + # LOCAL local_option_at_CellularAutomaton_internal_75 --> -304($fp) + # local_option_at_CellularAutomaton_internal_73 = local_option_at_CellularAutomaton_internal_75 + lw $t1, -304($fp) + sw $t1, -296($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_76 --> -308($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_52 + sw $t1, 12($v0) + li $t1, 12 + sw $t1, 16($v0) + sw $v0, -308($fp) + # ARG local_option_at_CellularAutomaton_internal_76 + # LOCAL local_option_at_CellularAutomaton_internal_76 --> -308($fp) + lw $t1, -308($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_73 --> -296($fp) + # LOCAL local_option_at_CellularAutomaton_internal_74 --> -300($fp) + # local_option_at_CellularAutomaton_internal_74 = VCALL local_option_at_CellularAutomaton_internal_73 out_string + # Save new self pointer in $s1 + lw $s1, -296($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -300($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_79 --> -320($fp) + # local_option_at_CellularAutomaton_internal_79 = SELF + sw $s1, -320($fp) + # LOCAL local_option_at_CellularAutomaton_internal_77 --> -312($fp) + # LOCAL local_option_at_CellularAutomaton_internal_79 --> -320($fp) + # local_option_at_CellularAutomaton_internal_77 = local_option_at_CellularAutomaton_internal_79 + lw $t1, -320($fp) + sw $t1, -312($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_80 --> -324($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_53 + sw $t1, 12($v0) + li $t1, 13 + sw $t1, 16($v0) + sw $v0, -324($fp) + # ARG local_option_at_CellularAutomaton_internal_80 + # LOCAL local_option_at_CellularAutomaton_internal_80 --> -324($fp) + lw $t1, -324($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_77 --> -312($fp) + # LOCAL local_option_at_CellularAutomaton_internal_78 --> -316($fp) + # local_option_at_CellularAutomaton_internal_78 = VCALL local_option_at_CellularAutomaton_internal_77 out_string + # Save new self pointer in $s1 + lw $s1, -312($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -316($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_83 --> -336($fp) + # local_option_at_CellularAutomaton_internal_83 = SELF + sw $s1, -336($fp) + # LOCAL local_option_at_CellularAutomaton_internal_81 --> -328($fp) + # LOCAL local_option_at_CellularAutomaton_internal_83 --> -336($fp) + # local_option_at_CellularAutomaton_internal_81 = local_option_at_CellularAutomaton_internal_83 + lw $t1, -336($fp) + sw $t1, -328($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_84 --> -340($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_54 + sw $t1, 12($v0) + li $t1, 13 + sw $t1, 16($v0) + sw $v0, -340($fp) + # ARG local_option_at_CellularAutomaton_internal_84 + # LOCAL local_option_at_CellularAutomaton_internal_84 --> -340($fp) + lw $t1, -340($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_81 --> -328($fp) + # LOCAL local_option_at_CellularAutomaton_internal_82 --> -332($fp) + # local_option_at_CellularAutomaton_internal_82 = VCALL local_option_at_CellularAutomaton_internal_81 out_string + # Save new self pointer in $s1 + lw $s1, -328($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -332($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_87 --> -352($fp) + # local_option_at_CellularAutomaton_internal_87 = SELF + sw $s1, -352($fp) + # LOCAL local_option_at_CellularAutomaton_internal_85 --> -344($fp) + # LOCAL local_option_at_CellularAutomaton_internal_87 --> -352($fp) + # local_option_at_CellularAutomaton_internal_85 = local_option_at_CellularAutomaton_internal_87 + lw $t1, -352($fp) + sw $t1, -344($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_88 --> -356($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_55 + sw $t1, 12($v0) + li $t1, 13 + sw $t1, 16($v0) + sw $v0, -356($fp) + # ARG local_option_at_CellularAutomaton_internal_88 + # LOCAL local_option_at_CellularAutomaton_internal_88 --> -356($fp) + lw $t1, -356($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_85 --> -344($fp) + # LOCAL local_option_at_CellularAutomaton_internal_86 --> -348($fp) + # local_option_at_CellularAutomaton_internal_86 = VCALL local_option_at_CellularAutomaton_internal_85 out_string + # Save new self pointer in $s1 + lw $s1, -344($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -348($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_91 --> -368($fp) + # local_option_at_CellularAutomaton_internal_91 = SELF + sw $s1, -368($fp) + # LOCAL local_option_at_CellularAutomaton_internal_89 --> -360($fp) + # LOCAL local_option_at_CellularAutomaton_internal_91 --> -368($fp) + # local_option_at_CellularAutomaton_internal_89 = local_option_at_CellularAutomaton_internal_91 + lw $t1, -368($fp) + sw $t1, -360($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_92 --> -372($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_56 + sw $t1, 12($v0) + li $t1, 15 + sw $t1, 16($v0) + sw $v0, -372($fp) + # ARG local_option_at_CellularAutomaton_internal_92 + # LOCAL local_option_at_CellularAutomaton_internal_92 --> -372($fp) + lw $t1, -372($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_89 --> -360($fp) + # LOCAL local_option_at_CellularAutomaton_internal_90 --> -364($fp) + # local_option_at_CellularAutomaton_internal_90 = VCALL local_option_at_CellularAutomaton_internal_89 out_string + # Save new self pointer in $s1 + lw $s1, -360($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -364($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_95 --> -384($fp) + # local_option_at_CellularAutomaton_internal_95 = SELF + sw $s1, -384($fp) + # LOCAL local_option_at_CellularAutomaton_internal_93 --> -376($fp) + # LOCAL local_option_at_CellularAutomaton_internal_95 --> -384($fp) + # local_option_at_CellularAutomaton_internal_93 = local_option_at_CellularAutomaton_internal_95 + lw $t1, -384($fp) + sw $t1, -376($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_93 --> -376($fp) + # LOCAL local_option_at_CellularAutomaton_internal_94 --> -380($fp) + # local_option_at_CellularAutomaton_internal_94 = VCALL local_option_at_CellularAutomaton_internal_93 in_int + # Save new self pointer in $s1 + lw $s1, -376($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 24($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -380($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_94 --> -380($fp) + # local_option_at_CellularAutomaton_num_0 = local_option_at_CellularAutomaton_internal_94 + lw $t1, -380($fp) + sw $t1, -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_98 --> -396($fp) + # local_option_at_CellularAutomaton_internal_98 = SELF + sw $s1, -396($fp) + # LOCAL local_option_at_CellularAutomaton_internal_96 --> -388($fp) + # LOCAL local_option_at_CellularAutomaton_internal_98 --> -396($fp) + # local_option_at_CellularAutomaton_internal_96 = local_option_at_CellularAutomaton_internal_98 + lw $t1, -396($fp) + sw $t1, -388($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_99 --> -400($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_57 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -400($fp) + # ARG local_option_at_CellularAutomaton_internal_99 + # LOCAL local_option_at_CellularAutomaton_internal_99 --> -400($fp) + lw $t1, -400($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_96 --> -388($fp) + # LOCAL local_option_at_CellularAutomaton_internal_97 --> -392($fp) + # local_option_at_CellularAutomaton_internal_97 = VCALL local_option_at_CellularAutomaton_internal_96 out_string + # Save new self pointer in $s1 + lw $s1, -388($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -392($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_101 --> -408($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_101 = local_option_at_CellularAutomaton_num_0 - 1 + lw $t1, -4($fp) + sub $t1, $t1, 1 + sw $t1, -408($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_101 GOTO label_TRUE_135 + # IF_ZERO local_option_at_CellularAutomaton_internal_101 GOTO label_TRUE_135 + lw $t1, -408($fp) + beq $t1, 0, label_TRUE_135 + # LOCAL local_option_at_CellularAutomaton_internal_101 --> -408($fp) + # local_option_at_CellularAutomaton_internal_101 = 0 + li $t1, 0 + sw $t1, -408($fp) + # GOTO label_END_136 +j label_END_136 +label_TRUE_135: + # LOCAL local_option_at_CellularAutomaton_internal_101 --> -408($fp) + # local_option_at_CellularAutomaton_internal_101 = 1 + li $t1, 1 + sw $t1, -408($fp) + label_END_136: +# IF_ZERO local_option_at_CellularAutomaton_internal_101 GOTO label_FALSEIF_133 +# IF_ZERO local_option_at_CellularAutomaton_internal_101 GOTO label_FALSEIF_133 +lw $t1, -408($fp) +beq $t1, 0, label_FALSEIF_133 +# LOCAL local_option_at_CellularAutomaton_internal_102 --> -412($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_58 +sw $t1, 12($v0) +li $t1, 20 +sw $t1, 16($v0) +sw $v0, -412($fp) +# LOCAL local_option_at_CellularAutomaton_internal_100 --> -404($fp) +# LOCAL local_option_at_CellularAutomaton_internal_102 --> -412($fp) +# local_option_at_CellularAutomaton_internal_100 = local_option_at_CellularAutomaton_internal_102 +lw $t1, -412($fp) +sw $t1, -404($fp) +# GOTO label_ENDIF_134 +j label_ENDIF_134 +label_FALSEIF_133: + # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_104 = local_option_at_CellularAutomaton_num_0 - 2 + lw $t1, -4($fp) + sub $t1, $t1, 2 + sw $t1, -420($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_TRUE_139 + # IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_TRUE_139 + lw $t1, -420($fp) + beq $t1, 0, label_TRUE_139 + # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) + # local_option_at_CellularAutomaton_internal_104 = 0 + li $t1, 0 + sw $t1, -420($fp) + # GOTO label_END_140 +j label_END_140 +label_TRUE_139: + # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) + # local_option_at_CellularAutomaton_internal_104 = 1 + li $t1, 1 + sw $t1, -420($fp) + label_END_140: +# IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_FALSEIF_137 +# IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_FALSEIF_137 +lw $t1, -420($fp) +beq $t1, 0, label_FALSEIF_137 +# LOCAL local_option_at_CellularAutomaton_internal_105 --> -424($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_59 +sw $t1, 12($v0) +li $t1, 25 +sw $t1, 16($v0) +sw $v0, -424($fp) +# LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) +# LOCAL local_option_at_CellularAutomaton_internal_105 --> -424($fp) +# local_option_at_CellularAutomaton_internal_103 = local_option_at_CellularAutomaton_internal_105 +lw $t1, -424($fp) +sw $t1, -416($fp) +# GOTO label_ENDIF_138 +j label_ENDIF_138 +label_FALSEIF_137: + # LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_107 = local_option_at_CellularAutomaton_num_0 - 3 + lw $t1, -4($fp) + sub $t1, $t1, 3 + sw $t1, -432($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_107 GOTO label_TRUE_143 + # IF_ZERO local_option_at_CellularAutomaton_internal_107 GOTO label_TRUE_143 + lw $t1, -432($fp) + beq $t1, 0, label_TRUE_143 + # LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) + # local_option_at_CellularAutomaton_internal_107 = 0 + li $t1, 0 + sw $t1, -432($fp) + # GOTO label_END_144 +j label_END_144 +label_TRUE_143: + # LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) + # local_option_at_CellularAutomaton_internal_107 = 1 + li $t1, 1 + sw $t1, -432($fp) + label_END_144: +# IF_ZERO local_option_at_CellularAutomaton_internal_107 GOTO label_FALSEIF_141 +# IF_ZERO local_option_at_CellularAutomaton_internal_107 GOTO label_FALSEIF_141 +lw $t1, -432($fp) +beq $t1, 0, label_FALSEIF_141 +# LOCAL local_option_at_CellularAutomaton_internal_108 --> -436($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_60 +sw $t1, 12($v0) +li $t1, 25 +sw $t1, 16($v0) +sw $v0, -436($fp) +# LOCAL local_option_at_CellularAutomaton_internal_106 --> -428($fp) +# LOCAL local_option_at_CellularAutomaton_internal_108 --> -436($fp) +# local_option_at_CellularAutomaton_internal_106 = local_option_at_CellularAutomaton_internal_108 +lw $t1, -436($fp) +sw $t1, -428($fp) +# GOTO label_ENDIF_142 +j label_ENDIF_142 +label_FALSEIF_141: + # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_110 = local_option_at_CellularAutomaton_num_0 - 4 + lw $t1, -4($fp) + sub $t1, $t1, 4 + sw $t1, -444($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_TRUE_147 + # IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_TRUE_147 + lw $t1, -444($fp) + beq $t1, 0, label_TRUE_147 + # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) + # local_option_at_CellularAutomaton_internal_110 = 0 + li $t1, 0 + sw $t1, -444($fp) + # GOTO label_END_148 +j label_END_148 +label_TRUE_147: + # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) + # local_option_at_CellularAutomaton_internal_110 = 1 + li $t1, 1 + sw $t1, -444($fp) + label_END_148: +# IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_FALSEIF_145 +# IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_FALSEIF_145 +lw $t1, -444($fp) +beq $t1, 0, label_FALSEIF_145 +# LOCAL local_option_at_CellularAutomaton_internal_111 --> -448($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_61 +sw $t1, 12($v0) +li $t1, 25 +sw $t1, 16($v0) +sw $v0, -448($fp) +# LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) +# LOCAL local_option_at_CellularAutomaton_internal_111 --> -448($fp) +# local_option_at_CellularAutomaton_internal_109 = local_option_at_CellularAutomaton_internal_111 +lw $t1, -448($fp) +sw $t1, -440($fp) +# GOTO label_ENDIF_146 +j label_ENDIF_146 +label_FALSEIF_145: + # LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_113 = local_option_at_CellularAutomaton_num_0 - 5 + lw $t1, -4($fp) + sub $t1, $t1, 5 + sw $t1, -456($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_113 GOTO label_TRUE_151 + # IF_ZERO local_option_at_CellularAutomaton_internal_113 GOTO label_TRUE_151 + lw $t1, -456($fp) + beq $t1, 0, label_TRUE_151 + # LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) + # local_option_at_CellularAutomaton_internal_113 = 0 + li $t1, 0 + sw $t1, -456($fp) + # GOTO label_END_152 +j label_END_152 +label_TRUE_151: + # LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) + # local_option_at_CellularAutomaton_internal_113 = 1 + li $t1, 1 + sw $t1, -456($fp) + label_END_152: +# IF_ZERO local_option_at_CellularAutomaton_internal_113 GOTO label_FALSEIF_149 +# IF_ZERO local_option_at_CellularAutomaton_internal_113 GOTO label_FALSEIF_149 +lw $t1, -456($fp) +beq $t1, 0, label_FALSEIF_149 +# LOCAL local_option_at_CellularAutomaton_internal_114 --> -460($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_62 +sw $t1, 12($v0) +li $t1, 25 +sw $t1, 16($v0) +sw $v0, -460($fp) +# LOCAL local_option_at_CellularAutomaton_internal_112 --> -452($fp) +# LOCAL local_option_at_CellularAutomaton_internal_114 --> -460($fp) +# local_option_at_CellularAutomaton_internal_112 = local_option_at_CellularAutomaton_internal_114 +lw $t1, -460($fp) +sw $t1, -452($fp) +# GOTO label_ENDIF_150 +j label_ENDIF_150 +label_FALSEIF_149: + # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_116 = local_option_at_CellularAutomaton_num_0 - 6 + lw $t1, -4($fp) + sub $t1, $t1, 6 + sw $t1, -468($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_TRUE_155 + # IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_TRUE_155 + lw $t1, -468($fp) + beq $t1, 0, label_TRUE_155 + # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) + # local_option_at_CellularAutomaton_internal_116 = 0 + li $t1, 0 + sw $t1, -468($fp) + # GOTO label_END_156 +j label_END_156 +label_TRUE_155: + # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) + # local_option_at_CellularAutomaton_internal_116 = 1 + li $t1, 1 + sw $t1, -468($fp) + label_END_156: +# IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_FALSEIF_153 +# IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_FALSEIF_153 +lw $t1, -468($fp) +beq $t1, 0, label_FALSEIF_153 +# LOCAL local_option_at_CellularAutomaton_internal_117 --> -472($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_63 +sw $t1, 12($v0) +li $t1, 25 +sw $t1, 16($v0) +sw $v0, -472($fp) +# LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) +# LOCAL local_option_at_CellularAutomaton_internal_117 --> -472($fp) +# local_option_at_CellularAutomaton_internal_115 = local_option_at_CellularAutomaton_internal_117 +lw $t1, -472($fp) +sw $t1, -464($fp) +# GOTO label_ENDIF_154 +j label_ENDIF_154 +label_FALSEIF_153: + # LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_119 = local_option_at_CellularAutomaton_num_0 - 7 + lw $t1, -4($fp) + sub $t1, $t1, 7 + sw $t1, -480($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_119 GOTO label_TRUE_159 + # IF_ZERO local_option_at_CellularAutomaton_internal_119 GOTO label_TRUE_159 + lw $t1, -480($fp) + beq $t1, 0, label_TRUE_159 + # LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) + # local_option_at_CellularAutomaton_internal_119 = 0 + li $t1, 0 + sw $t1, -480($fp) + # GOTO label_END_160 +j label_END_160 +label_TRUE_159: + # LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) + # local_option_at_CellularAutomaton_internal_119 = 1 + li $t1, 1 + sw $t1, -480($fp) + label_END_160: +# IF_ZERO local_option_at_CellularAutomaton_internal_119 GOTO label_FALSEIF_157 +# IF_ZERO local_option_at_CellularAutomaton_internal_119 GOTO label_FALSEIF_157 +lw $t1, -480($fp) +beq $t1, 0, label_FALSEIF_157 +# LOCAL local_option_at_CellularAutomaton_internal_120 --> -484($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_64 +sw $t1, 12($v0) +li $t1, 20 +sw $t1, 16($v0) +sw $v0, -484($fp) +# LOCAL local_option_at_CellularAutomaton_internal_118 --> -476($fp) +# LOCAL local_option_at_CellularAutomaton_internal_120 --> -484($fp) +# local_option_at_CellularAutomaton_internal_118 = local_option_at_CellularAutomaton_internal_120 +lw $t1, -484($fp) +sw $t1, -476($fp) +# GOTO label_ENDIF_158 +j label_ENDIF_158 +label_FALSEIF_157: + # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_122 = local_option_at_CellularAutomaton_num_0 - 8 + lw $t1, -4($fp) + sub $t1, $t1, 8 + sw $t1, -492($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_TRUE_163 + # IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_TRUE_163 + lw $t1, -492($fp) + beq $t1, 0, label_TRUE_163 + # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) + # local_option_at_CellularAutomaton_internal_122 = 0 + li $t1, 0 + sw $t1, -492($fp) + # GOTO label_END_164 +j label_END_164 +label_TRUE_163: + # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) + # local_option_at_CellularAutomaton_internal_122 = 1 + li $t1, 1 + sw $t1, -492($fp) + label_END_164: +# IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_FALSEIF_161 +# IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_FALSEIF_161 +lw $t1, -492($fp) +beq $t1, 0, label_FALSEIF_161 +# LOCAL local_option_at_CellularAutomaton_internal_123 --> -496($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_65 +sw $t1, 12($v0) +li $t1, 20 +sw $t1, 16($v0) +sw $v0, -496($fp) +# LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) +# LOCAL local_option_at_CellularAutomaton_internal_123 --> -496($fp) +# local_option_at_CellularAutomaton_internal_121 = local_option_at_CellularAutomaton_internal_123 +lw $t1, -496($fp) +sw $t1, -488($fp) +# GOTO label_ENDIF_162 +j label_ENDIF_162 +label_FALSEIF_161: + # LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_125 = local_option_at_CellularAutomaton_num_0 - 9 + lw $t1, -4($fp) + sub $t1, $t1, 9 + sw $t1, -504($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_125 GOTO label_TRUE_167 + # IF_ZERO local_option_at_CellularAutomaton_internal_125 GOTO label_TRUE_167 + lw $t1, -504($fp) + beq $t1, 0, label_TRUE_167 + # LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) + # local_option_at_CellularAutomaton_internal_125 = 0 + li $t1, 0 + sw $t1, -504($fp) + # GOTO label_END_168 +j label_END_168 +label_TRUE_167: + # LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) + # local_option_at_CellularAutomaton_internal_125 = 1 + li $t1, 1 + sw $t1, -504($fp) + label_END_168: +# IF_ZERO local_option_at_CellularAutomaton_internal_125 GOTO label_FALSEIF_165 +# IF_ZERO local_option_at_CellularAutomaton_internal_125 GOTO label_FALSEIF_165 +lw $t1, -504($fp) +beq $t1, 0, label_FALSEIF_165 +# LOCAL local_option_at_CellularAutomaton_internal_126 --> -508($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_66 +sw $t1, 12($v0) +li $t1, 15 +sw $t1, 16($v0) +sw $v0, -508($fp) +# LOCAL local_option_at_CellularAutomaton_internal_124 --> -500($fp) +# LOCAL local_option_at_CellularAutomaton_internal_126 --> -508($fp) +# local_option_at_CellularAutomaton_internal_124 = local_option_at_CellularAutomaton_internal_126 +lw $t1, -508($fp) +sw $t1, -500($fp) +# GOTO label_ENDIF_166 +j label_ENDIF_166 +label_FALSEIF_165: + # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_128 = local_option_at_CellularAutomaton_num_0 - 10 + lw $t1, -4($fp) + sub $t1, $t1, 10 + sw $t1, -516($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_TRUE_171 + # IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_TRUE_171 + lw $t1, -516($fp) + beq $t1, 0, label_TRUE_171 + # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) + # local_option_at_CellularAutomaton_internal_128 = 0 + li $t1, 0 + sw $t1, -516($fp) + # GOTO label_END_172 +j label_END_172 +label_TRUE_171: + # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) + # local_option_at_CellularAutomaton_internal_128 = 1 + li $t1, 1 + sw $t1, -516($fp) + label_END_172: +# IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_FALSEIF_169 +# IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_FALSEIF_169 +lw $t1, -516($fp) +beq $t1, 0, label_FALSEIF_169 +# LOCAL local_option_at_CellularAutomaton_internal_129 --> -520($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_67 +sw $t1, 12($v0) +li $t1, 15 +sw $t1, 16($v0) +sw $v0, -520($fp) +# LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) +# LOCAL local_option_at_CellularAutomaton_internal_129 --> -520($fp) +# local_option_at_CellularAutomaton_internal_127 = local_option_at_CellularAutomaton_internal_129 +lw $t1, -520($fp) +sw $t1, -512($fp) +# GOTO label_ENDIF_170 +j label_ENDIF_170 +label_FALSEIF_169: + # LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_131 = local_option_at_CellularAutomaton_num_0 - 11 + lw $t1, -4($fp) + sub $t1, $t1, 11 + sw $t1, -528($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_131 GOTO label_TRUE_175 + # IF_ZERO local_option_at_CellularAutomaton_internal_131 GOTO label_TRUE_175 + lw $t1, -528($fp) + beq $t1, 0, label_TRUE_175 + # LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) + # local_option_at_CellularAutomaton_internal_131 = 0 + li $t1, 0 + sw $t1, -528($fp) + # GOTO label_END_176 +j label_END_176 +label_TRUE_175: + # LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) + # local_option_at_CellularAutomaton_internal_131 = 1 + li $t1, 1 + sw $t1, -528($fp) + label_END_176: +# IF_ZERO local_option_at_CellularAutomaton_internal_131 GOTO label_FALSEIF_173 +# IF_ZERO local_option_at_CellularAutomaton_internal_131 GOTO label_FALSEIF_173 +lw $t1, -528($fp) +beq $t1, 0, label_FALSEIF_173 +# LOCAL local_option_at_CellularAutomaton_internal_132 --> -532($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_68 +sw $t1, 12($v0) +li $t1, 15 +sw $t1, 16($v0) +sw $v0, -532($fp) +# LOCAL local_option_at_CellularAutomaton_internal_130 --> -524($fp) +# LOCAL local_option_at_CellularAutomaton_internal_132 --> -532($fp) +# local_option_at_CellularAutomaton_internal_130 = local_option_at_CellularAutomaton_internal_132 +lw $t1, -532($fp) +sw $t1, -524($fp) +# GOTO label_ENDIF_174 +j label_ENDIF_174 +label_FALSEIF_173: + # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_134 = local_option_at_CellularAutomaton_num_0 - 12 + lw $t1, -4($fp) + sub $t1, $t1, 12 + sw $t1, -540($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_TRUE_179 + # IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_TRUE_179 + lw $t1, -540($fp) + beq $t1, 0, label_TRUE_179 + # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) + # local_option_at_CellularAutomaton_internal_134 = 0 + li $t1, 0 + sw $t1, -540($fp) + # GOTO label_END_180 +j label_END_180 +label_TRUE_179: + # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) + # local_option_at_CellularAutomaton_internal_134 = 1 + li $t1, 1 + sw $t1, -540($fp) + label_END_180: +# IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_FALSEIF_177 +# IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_FALSEIF_177 +lw $t1, -540($fp) +beq $t1, 0, label_FALSEIF_177 +# LOCAL local_option_at_CellularAutomaton_internal_135 --> -544($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_69 +sw $t1, 12($v0) +li $t1, 25 +sw $t1, 16($v0) +sw $v0, -544($fp) +# LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) +# LOCAL local_option_at_CellularAutomaton_internal_135 --> -544($fp) +# local_option_at_CellularAutomaton_internal_133 = local_option_at_CellularAutomaton_internal_135 +lw $t1, -544($fp) +sw $t1, -536($fp) +# GOTO label_ENDIF_178 +j label_ENDIF_178 +label_FALSEIF_177: + # LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_137 = local_option_at_CellularAutomaton_num_0 - 13 + lw $t1, -4($fp) + sub $t1, $t1, 13 + sw $t1, -552($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_137 GOTO label_TRUE_183 + # IF_ZERO local_option_at_CellularAutomaton_internal_137 GOTO label_TRUE_183 + lw $t1, -552($fp) + beq $t1, 0, label_TRUE_183 + # LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) + # local_option_at_CellularAutomaton_internal_137 = 0 + li $t1, 0 + sw $t1, -552($fp) + # GOTO label_END_184 +j label_END_184 +label_TRUE_183: + # LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) + # local_option_at_CellularAutomaton_internal_137 = 1 + li $t1, 1 + sw $t1, -552($fp) + label_END_184: +# IF_ZERO local_option_at_CellularAutomaton_internal_137 GOTO label_FALSEIF_181 +# IF_ZERO local_option_at_CellularAutomaton_internal_137 GOTO label_FALSEIF_181 +lw $t1, -552($fp) +beq $t1, 0, label_FALSEIF_181 +# LOCAL local_option_at_CellularAutomaton_internal_138 --> -556($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_70 +sw $t1, 12($v0) +li $t1, 25 +sw $t1, 16($v0) +sw $v0, -556($fp) +# LOCAL local_option_at_CellularAutomaton_internal_136 --> -548($fp) +# LOCAL local_option_at_CellularAutomaton_internal_138 --> -556($fp) +# local_option_at_CellularAutomaton_internal_136 = local_option_at_CellularAutomaton_internal_138 +lw $t1, -556($fp) +sw $t1, -548($fp) +# GOTO label_ENDIF_182 +j label_ENDIF_182 +label_FALSEIF_181: + # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_140 = local_option_at_CellularAutomaton_num_0 - 14 + lw $t1, -4($fp) + sub $t1, $t1, 14 + sw $t1, -564($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_TRUE_187 + # IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_TRUE_187 + lw $t1, -564($fp) + beq $t1, 0, label_TRUE_187 + # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) + # local_option_at_CellularAutomaton_internal_140 = 0 + li $t1, 0 + sw $t1, -564($fp) + # GOTO label_END_188 +j label_END_188 +label_TRUE_187: + # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) + # local_option_at_CellularAutomaton_internal_140 = 1 + li $t1, 1 + sw $t1, -564($fp) + label_END_188: +# IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_FALSEIF_185 +# IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_FALSEIF_185 +lw $t1, -564($fp) +beq $t1, 0, label_FALSEIF_185 +# LOCAL local_option_at_CellularAutomaton_internal_141 --> -568($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_71 +sw $t1, 12($v0) +li $t1, 25 +sw $t1, 16($v0) +sw $v0, -568($fp) +# LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) +# LOCAL local_option_at_CellularAutomaton_internal_141 --> -568($fp) +# local_option_at_CellularAutomaton_internal_139 = local_option_at_CellularAutomaton_internal_141 +lw $t1, -568($fp) +sw $t1, -560($fp) +# GOTO label_ENDIF_186 +j label_ENDIF_186 +label_FALSEIF_185: + # LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_143 = local_option_at_CellularAutomaton_num_0 - 15 + lw $t1, -4($fp) + sub $t1, $t1, 15 + sw $t1, -576($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_143 GOTO label_TRUE_191 + # IF_ZERO local_option_at_CellularAutomaton_internal_143 GOTO label_TRUE_191 + lw $t1, -576($fp) + beq $t1, 0, label_TRUE_191 + # LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) + # local_option_at_CellularAutomaton_internal_143 = 0 + li $t1, 0 + sw $t1, -576($fp) + # GOTO label_END_192 +j label_END_192 +label_TRUE_191: + # LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) + # local_option_at_CellularAutomaton_internal_143 = 1 + li $t1, 1 + sw $t1, -576($fp) + label_END_192: +# IF_ZERO local_option_at_CellularAutomaton_internal_143 GOTO label_FALSEIF_189 +# IF_ZERO local_option_at_CellularAutomaton_internal_143 GOTO label_FALSEIF_189 +lw $t1, -576($fp) +beq $t1, 0, label_FALSEIF_189 +# LOCAL local_option_at_CellularAutomaton_internal_144 --> -580($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_72 +sw $t1, 12($v0) +li $t1, 21 +sw $t1, 16($v0) +sw $v0, -580($fp) +# LOCAL local_option_at_CellularAutomaton_internal_142 --> -572($fp) +# LOCAL local_option_at_CellularAutomaton_internal_144 --> -580($fp) +# local_option_at_CellularAutomaton_internal_142 = local_option_at_CellularAutomaton_internal_144 +lw $t1, -580($fp) +sw $t1, -572($fp) +# GOTO label_ENDIF_190 +j label_ENDIF_190 +label_FALSEIF_189: + # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_146 = local_option_at_CellularAutomaton_num_0 - 16 + lw $t1, -4($fp) + sub $t1, $t1, 16 + sw $t1, -588($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_TRUE_195 + # IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_TRUE_195 + lw $t1, -588($fp) + beq $t1, 0, label_TRUE_195 + # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) + # local_option_at_CellularAutomaton_internal_146 = 0 + li $t1, 0 + sw $t1, -588($fp) + # GOTO label_END_196 +j label_END_196 +label_TRUE_195: + # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) + # local_option_at_CellularAutomaton_internal_146 = 1 + li $t1, 1 + sw $t1, -588($fp) + label_END_196: +# IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_FALSEIF_193 +# IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_FALSEIF_193 +lw $t1, -588($fp) +beq $t1, 0, label_FALSEIF_193 +# LOCAL local_option_at_CellularAutomaton_internal_147 --> -592($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_73 +sw $t1, 12($v0) +li $t1, 21 +sw $t1, 16($v0) +sw $v0, -592($fp) +# LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) +# LOCAL local_option_at_CellularAutomaton_internal_147 --> -592($fp) +# local_option_at_CellularAutomaton_internal_145 = local_option_at_CellularAutomaton_internal_147 +lw $t1, -592($fp) +sw $t1, -584($fp) +# GOTO label_ENDIF_194 +j label_ENDIF_194 +label_FALSEIF_193: + # LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_149 = local_option_at_CellularAutomaton_num_0 - 17 + lw $t1, -4($fp) + sub $t1, $t1, 17 + sw $t1, -600($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_149 GOTO label_TRUE_199 + # IF_ZERO local_option_at_CellularAutomaton_internal_149 GOTO label_TRUE_199 + lw $t1, -600($fp) + beq $t1, 0, label_TRUE_199 + # LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) + # local_option_at_CellularAutomaton_internal_149 = 0 + li $t1, 0 + sw $t1, -600($fp) + # GOTO label_END_200 +j label_END_200 +label_TRUE_199: + # LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) + # local_option_at_CellularAutomaton_internal_149 = 1 + li $t1, 1 + sw $t1, -600($fp) + label_END_200: +# IF_ZERO local_option_at_CellularAutomaton_internal_149 GOTO label_FALSEIF_197 +# IF_ZERO local_option_at_CellularAutomaton_internal_149 GOTO label_FALSEIF_197 +lw $t1, -600($fp) +beq $t1, 0, label_FALSEIF_197 +# LOCAL local_option_at_CellularAutomaton_internal_150 --> -604($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_74 +sw $t1, 12($v0) +li $t1, 28 +sw $t1, 16($v0) +sw $v0, -604($fp) +# LOCAL local_option_at_CellularAutomaton_internal_148 --> -596($fp) +# LOCAL local_option_at_CellularAutomaton_internal_150 --> -604($fp) +# local_option_at_CellularAutomaton_internal_148 = local_option_at_CellularAutomaton_internal_150 +lw $t1, -604($fp) +sw $t1, -596($fp) +# GOTO label_ENDIF_198 +j label_ENDIF_198 +label_FALSEIF_197: + # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_152 = local_option_at_CellularAutomaton_num_0 - 18 + lw $t1, -4($fp) + sub $t1, $t1, 18 + sw $t1, -612($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_TRUE_203 + # IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_TRUE_203 + lw $t1, -612($fp) + beq $t1, 0, label_TRUE_203 + # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) + # local_option_at_CellularAutomaton_internal_152 = 0 + li $t1, 0 + sw $t1, -612($fp) + # GOTO label_END_204 +j label_END_204 +label_TRUE_203: + # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) + # local_option_at_CellularAutomaton_internal_152 = 1 + li $t1, 1 + sw $t1, -612($fp) + label_END_204: +# IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_FALSEIF_201 +# IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_FALSEIF_201 +lw $t1, -612($fp) +beq $t1, 0, label_FALSEIF_201 +# LOCAL local_option_at_CellularAutomaton_internal_153 --> -616($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_75 +sw $t1, 12($v0) +li $t1, 28 +sw $t1, 16($v0) +sw $v0, -616($fp) +# LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) +# LOCAL local_option_at_CellularAutomaton_internal_153 --> -616($fp) +# local_option_at_CellularAutomaton_internal_151 = local_option_at_CellularAutomaton_internal_153 +lw $t1, -616($fp) +sw $t1, -608($fp) +# GOTO label_ENDIF_202 +j label_ENDIF_202 +label_FALSEIF_201: + # LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_155 = local_option_at_CellularAutomaton_num_0 - 19 + lw $t1, -4($fp) + sub $t1, $t1, 19 + sw $t1, -624($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_155 GOTO label_TRUE_207 + # IF_ZERO local_option_at_CellularAutomaton_internal_155 GOTO label_TRUE_207 + lw $t1, -624($fp) + beq $t1, 0, label_TRUE_207 + # LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) + # local_option_at_CellularAutomaton_internal_155 = 0 + li $t1, 0 + sw $t1, -624($fp) + # GOTO label_END_208 +j label_END_208 +label_TRUE_207: + # LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) + # local_option_at_CellularAutomaton_internal_155 = 1 + li $t1, 1 + sw $t1, -624($fp) + label_END_208: +# IF_ZERO local_option_at_CellularAutomaton_internal_155 GOTO label_FALSEIF_205 +# IF_ZERO local_option_at_CellularAutomaton_internal_155 GOTO label_FALSEIF_205 +lw $t1, -624($fp) +beq $t1, 0, label_FALSEIF_205 +# LOCAL local_option_at_CellularAutomaton_internal_156 --> -628($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_76 +sw $t1, 12($v0) +li $t1, 16 +sw $t1, 16($v0) +sw $v0, -628($fp) +# LOCAL local_option_at_CellularAutomaton_internal_154 --> -620($fp) +# LOCAL local_option_at_CellularAutomaton_internal_156 --> -628($fp) +# local_option_at_CellularAutomaton_internal_154 = local_option_at_CellularAutomaton_internal_156 +lw $t1, -628($fp) +sw $t1, -620($fp) +# GOTO label_ENDIF_206 +j label_ENDIF_206 +label_FALSEIF_205: + # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_158 = local_option_at_CellularAutomaton_num_0 - 20 + lw $t1, -4($fp) + sub $t1, $t1, 20 + sw $t1, -636($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_TRUE_211 + # IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_TRUE_211 + lw $t1, -636($fp) + beq $t1, 0, label_TRUE_211 + # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) + # local_option_at_CellularAutomaton_internal_158 = 0 + li $t1, 0 + sw $t1, -636($fp) + # GOTO label_END_212 +j label_END_212 +label_TRUE_211: + # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) + # local_option_at_CellularAutomaton_internal_158 = 1 + li $t1, 1 + sw $t1, -636($fp) + label_END_212: +# IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_FALSEIF_209 +# IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_FALSEIF_209 +lw $t1, -636($fp) +beq $t1, 0, label_FALSEIF_209 +# LOCAL local_option_at_CellularAutomaton_internal_159 --> -640($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_77 +sw $t1, 12($v0) +li $t1, 28 +sw $t1, 16($v0) +sw $v0, -640($fp) +# LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) +# LOCAL local_option_at_CellularAutomaton_internal_159 --> -640($fp) +# local_option_at_CellularAutomaton_internal_157 = local_option_at_CellularAutomaton_internal_159 +lw $t1, -640($fp) +sw $t1, -632($fp) +# GOTO label_ENDIF_210 +j label_ENDIF_210 +label_FALSEIF_209: + # LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # local_option_at_CellularAutomaton_internal_161 = local_option_at_CellularAutomaton_num_0 - 21 + lw $t1, -4($fp) + sub $t1, $t1, 21 + sw $t1, -648($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_161 GOTO label_TRUE_215 + # IF_ZERO local_option_at_CellularAutomaton_internal_161 GOTO label_TRUE_215 + lw $t1, -648($fp) + beq $t1, 0, label_TRUE_215 + # LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) + # local_option_at_CellularAutomaton_internal_161 = 0 + li $t1, 0 + sw $t1, -648($fp) + # GOTO label_END_216 +j label_END_216 +label_TRUE_215: + # LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) + # local_option_at_CellularAutomaton_internal_161 = 1 + li $t1, 1 + sw $t1, -648($fp) + label_END_216: +# IF_ZERO local_option_at_CellularAutomaton_internal_161 GOTO label_FALSEIF_213 +# IF_ZERO local_option_at_CellularAutomaton_internal_161 GOTO label_FALSEIF_213 +lw $t1, -648($fp) +beq $t1, 0, label_FALSEIF_213 +# LOCAL local_option_at_CellularAutomaton_internal_162 --> -652($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_78 +sw $t1, 12($v0) +li $t1, 28 +sw $t1, 16($v0) +sw $v0, -652($fp) +# LOCAL local_option_at_CellularAutomaton_internal_160 --> -644($fp) +# LOCAL local_option_at_CellularAutomaton_internal_162 --> -652($fp) +# local_option_at_CellularAutomaton_internal_160 = local_option_at_CellularAutomaton_internal_162 +lw $t1, -652($fp) +sw $t1, -644($fp) +# GOTO label_ENDIF_214 +j label_ENDIF_214 +label_FALSEIF_213: + # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_79 + sw $t1, 12($v0) + li $t1, 25 + sw $t1, 16($v0) + sw $v0, -656($fp) + # LOCAL local_option_at_CellularAutomaton_internal_160 --> -644($fp) + # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) + # local_option_at_CellularAutomaton_internal_160 = local_option_at_CellularAutomaton_internal_163 + lw $t1, -656($fp) + sw $t1, -644($fp) + label_ENDIF_214: +# LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) +# LOCAL local_option_at_CellularAutomaton_internal_160 --> -644($fp) +# local_option_at_CellularAutomaton_internal_157 = local_option_at_CellularAutomaton_internal_160 +lw $t1, -644($fp) +sw $t1, -632($fp) +label_ENDIF_210: +# LOCAL local_option_at_CellularAutomaton_internal_154 --> -620($fp) +# LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) +# local_option_at_CellularAutomaton_internal_154 = local_option_at_CellularAutomaton_internal_157 +lw $t1, -632($fp) +sw $t1, -620($fp) +label_ENDIF_206: +# LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) +# LOCAL local_option_at_CellularAutomaton_internal_154 --> -620($fp) +# local_option_at_CellularAutomaton_internal_151 = local_option_at_CellularAutomaton_internal_154 +lw $t1, -620($fp) +sw $t1, -608($fp) +label_ENDIF_202: +# LOCAL local_option_at_CellularAutomaton_internal_148 --> -596($fp) +# LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) +# local_option_at_CellularAutomaton_internal_148 = local_option_at_CellularAutomaton_internal_151 +lw $t1, -608($fp) +sw $t1, -596($fp) +label_ENDIF_198: +# LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) +# LOCAL local_option_at_CellularAutomaton_internal_148 --> -596($fp) +# local_option_at_CellularAutomaton_internal_145 = local_option_at_CellularAutomaton_internal_148 +lw $t1, -596($fp) +sw $t1, -584($fp) +label_ENDIF_194: +# LOCAL local_option_at_CellularAutomaton_internal_142 --> -572($fp) +# LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) +# local_option_at_CellularAutomaton_internal_142 = local_option_at_CellularAutomaton_internal_145 +lw $t1, -584($fp) +sw $t1, -572($fp) +label_ENDIF_190: +# LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) +# LOCAL local_option_at_CellularAutomaton_internal_142 --> -572($fp) +# local_option_at_CellularAutomaton_internal_139 = local_option_at_CellularAutomaton_internal_142 +lw $t1, -572($fp) +sw $t1, -560($fp) +label_ENDIF_186: +# LOCAL local_option_at_CellularAutomaton_internal_136 --> -548($fp) +# LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) +# local_option_at_CellularAutomaton_internal_136 = local_option_at_CellularAutomaton_internal_139 +lw $t1, -560($fp) +sw $t1, -548($fp) +label_ENDIF_182: +# LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) +# LOCAL local_option_at_CellularAutomaton_internal_136 --> -548($fp) +# local_option_at_CellularAutomaton_internal_133 = local_option_at_CellularAutomaton_internal_136 +lw $t1, -548($fp) +sw $t1, -536($fp) +label_ENDIF_178: +# LOCAL local_option_at_CellularAutomaton_internal_130 --> -524($fp) +# LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) +# local_option_at_CellularAutomaton_internal_130 = local_option_at_CellularAutomaton_internal_133 +lw $t1, -536($fp) +sw $t1, -524($fp) +label_ENDIF_174: +# LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) +# LOCAL local_option_at_CellularAutomaton_internal_130 --> -524($fp) +# local_option_at_CellularAutomaton_internal_127 = local_option_at_CellularAutomaton_internal_130 +lw $t1, -524($fp) +sw $t1, -512($fp) +label_ENDIF_170: +# LOCAL local_option_at_CellularAutomaton_internal_124 --> -500($fp) +# LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) +# local_option_at_CellularAutomaton_internal_124 = local_option_at_CellularAutomaton_internal_127 +lw $t1, -512($fp) +sw $t1, -500($fp) +label_ENDIF_166: +# LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) +# LOCAL local_option_at_CellularAutomaton_internal_124 --> -500($fp) +# local_option_at_CellularAutomaton_internal_121 = local_option_at_CellularAutomaton_internal_124 +lw $t1, -500($fp) +sw $t1, -488($fp) +label_ENDIF_162: +# LOCAL local_option_at_CellularAutomaton_internal_118 --> -476($fp) +# LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) +# local_option_at_CellularAutomaton_internal_118 = local_option_at_CellularAutomaton_internal_121 +lw $t1, -488($fp) +sw $t1, -476($fp) +label_ENDIF_158: +# LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) +# LOCAL local_option_at_CellularAutomaton_internal_118 --> -476($fp) +# local_option_at_CellularAutomaton_internal_115 = local_option_at_CellularAutomaton_internal_118 +lw $t1, -476($fp) +sw $t1, -464($fp) +label_ENDIF_154: +# LOCAL local_option_at_CellularAutomaton_internal_112 --> -452($fp) +# LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) +# local_option_at_CellularAutomaton_internal_112 = local_option_at_CellularAutomaton_internal_115 +lw $t1, -464($fp) +sw $t1, -452($fp) +label_ENDIF_150: +# LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) +# LOCAL local_option_at_CellularAutomaton_internal_112 --> -452($fp) +# local_option_at_CellularAutomaton_internal_109 = local_option_at_CellularAutomaton_internal_112 +lw $t1, -452($fp) +sw $t1, -440($fp) +label_ENDIF_146: +# LOCAL local_option_at_CellularAutomaton_internal_106 --> -428($fp) +# LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) +# local_option_at_CellularAutomaton_internal_106 = local_option_at_CellularAutomaton_internal_109 +lw $t1, -440($fp) +sw $t1, -428($fp) +label_ENDIF_142: +# LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) +# LOCAL local_option_at_CellularAutomaton_internal_106 --> -428($fp) +# local_option_at_CellularAutomaton_internal_103 = local_option_at_CellularAutomaton_internal_106 +lw $t1, -428($fp) +sw $t1, -416($fp) +label_ENDIF_138: +# LOCAL local_option_at_CellularAutomaton_internal_100 --> -404($fp) +# LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) +# local_option_at_CellularAutomaton_internal_100 = local_option_at_CellularAutomaton_internal_103 +lw $t1, -416($fp) +sw $t1, -404($fp) +label_ENDIF_134: +# RETURN local_option_at_CellularAutomaton_internal_100 +lw $v0, -404($fp) +# Deallocate stack frame for function function_option_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 664 +jr $ra +# Function END + + +# function_prompt_at_CellularAutomaton implementation. +# @Params: +function_prompt_at_CellularAutomaton: + # Allocate stack frame for function function_prompt_at_CellularAutomaton. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_0 + sw $t1, 12($v0) + li $t1, 0 + sw $t1, 16($v0) + sw $v0, -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_3 --> -16($fp) + # local_prompt_at_CellularAutomaton_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_3 --> -16($fp) + # local_prompt_at_CellularAutomaton_internal_1 = local_prompt_at_CellularAutomaton_internal_3 + lw $t1, -16($fp) + sw $t1, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_80 + sw $t1, 12($v0) + li $t1, 54 + sw $t1, 16($v0) + sw $v0, -20($fp) + # ARG local_prompt_at_CellularAutomaton_internal_4 + # LOCAL local_prompt_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t1, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_2 --> -12($fp) + # local_prompt_at_CellularAutomaton_internal_2 = VCALL local_prompt_at_CellularAutomaton_internal_1 out_string + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt_at_CellularAutomaton_internal_7 --> -32($fp) + # local_prompt_at_CellularAutomaton_internal_7 = SELF + sw $s1, -32($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_7 --> -32($fp) + # local_prompt_at_CellularAutomaton_internal_5 = local_prompt_at_CellularAutomaton_internal_7 + lw $t1, -32($fp) + sw $t1, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_81 + sw $t1, 12($v0) + li $t1, 49 + sw $t1, 16($v0) + sw $v0, -36($fp) + # ARG local_prompt_at_CellularAutomaton_internal_8 + # LOCAL local_prompt_at_CellularAutomaton_internal_8 --> -36($fp) + lw $t1, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_6 --> -28($fp) + # local_prompt_at_CellularAutomaton_internal_6 = VCALL local_prompt_at_CellularAutomaton_internal_5 out_string + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt_at_CellularAutomaton_internal_11 --> -48($fp) + # local_prompt_at_CellularAutomaton_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_11 --> -48($fp) + # local_prompt_at_CellularAutomaton_internal_9 = local_prompt_at_CellularAutomaton_internal_11 + lw $t1, -48($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_10 --> -44($fp) + # local_prompt_at_CellularAutomaton_internal_10 = VCALL local_prompt_at_CellularAutomaton_internal_9 in_string + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 20($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_10 --> -44($fp) + # local_prompt_at_CellularAutomaton_ans_0 = local_prompt_at_CellularAutomaton_internal_10 + lw $t1, -44($fp) + sw $t1, -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_14 --> -60($fp) + # local_prompt_at_CellularAutomaton_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_14 --> -60($fp) + # local_prompt_at_CellularAutomaton_internal_12 = local_prompt_at_CellularAutomaton_internal_14 + lw $t1, -60($fp) + sw $t1, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_82 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -64($fp) + # ARG local_prompt_at_CellularAutomaton_internal_15 + # LOCAL local_prompt_at_CellularAutomaton_internal_15 --> -64($fp) + lw $t1, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_13 --> -56($fp) + # local_prompt_at_CellularAutomaton_internal_13 = VCALL local_prompt_at_CellularAutomaton_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_83 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -76($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_17 --> -72($fp) + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_18 --> -76($fp) + # local_prompt_at_CellularAutomaton_internal_17 = local_prompt_at_CellularAutomaton_ans_0 - local_prompt_at_CellularAutomaton_internal_18 + lw $t1, -4($fp) + lw $t2, -76($fp) + sub $t1, $t1, $t2 + sw $t1, -72($fp) + # IF_ZERO local_prompt_at_CellularAutomaton_internal_17 GOTO label_TRUE_219 + # IF_ZERO local_prompt_at_CellularAutomaton_internal_17 GOTO label_TRUE_219 + lw $t1, -72($fp) + beq $t1, 0, label_TRUE_219 + # LOCAL local_prompt_at_CellularAutomaton_internal_17 --> -72($fp) + # local_prompt_at_CellularAutomaton_internal_17 = 0 + li $t1, 0 + sw $t1, -72($fp) + # GOTO label_END_220 +j label_END_220 +label_TRUE_219: + # LOCAL local_prompt_at_CellularAutomaton_internal_17 --> -72($fp) + # local_prompt_at_CellularAutomaton_internal_17 = 1 + li $t1, 1 + sw $t1, -72($fp) + label_END_220: +# IF_ZERO local_prompt_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_217 +# IF_ZERO local_prompt_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_217 +lw $t1, -72($fp) +beq $t1, 0, label_FALSEIF_217 +# LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) +# local_prompt_at_CellularAutomaton_internal_19 = 0 +li $t1, 0 +sw $t1, -80($fp) +# LOCAL local_prompt_at_CellularAutomaton_internal_16 --> -68($fp) +# LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) +# local_prompt_at_CellularAutomaton_internal_16 = local_prompt_at_CellularAutomaton_internal_19 +lw $t1, -80($fp) +sw $t1, -68($fp) +# GOTO label_ENDIF_218 +j label_ENDIF_218 +label_FALSEIF_217: + # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) + # local_prompt_at_CellularAutomaton_internal_20 = 1 + li $t1, 1 + sw $t1, -84($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_16 --> -68($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) + # local_prompt_at_CellularAutomaton_internal_16 = local_prompt_at_CellularAutomaton_internal_20 + lw $t1, -84($fp) + sw $t1, -68($fp) + label_ENDIF_218: +# RETURN local_prompt_at_CellularAutomaton_internal_16 +lw $v0, -68($fp) +# Deallocate stack frame for function function_prompt_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 92 +jr $ra +# Function END + + +# function_prompt2_at_CellularAutomaton implementation. +# @Params: +function_prompt2_at_CellularAutomaton: + # Allocate stack frame for function function_prompt2_at_CellularAutomaton. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_0 + sw $t1, 12($v0) + li $t1, 0 + sw $t1, 16($v0) + sw $v0, -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_3 --> -16($fp) + # local_prompt2_at_CellularAutomaton_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_3 --> -16($fp) + # local_prompt2_at_CellularAutomaton_internal_1 = local_prompt2_at_CellularAutomaton_internal_3 + lw $t1, -16($fp) + sw $t1, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_84 + sw $t1, 12($v0) + li $t1, 2 + sw $t1, 16($v0) + sw $v0, -20($fp) + # ARG local_prompt2_at_CellularAutomaton_internal_4 + # LOCAL local_prompt2_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t1, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_2 --> -12($fp) + # local_prompt2_at_CellularAutomaton_internal_2 = VCALL local_prompt2_at_CellularAutomaton_internal_1 out_string + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt2_at_CellularAutomaton_internal_7 --> -32($fp) + # local_prompt2_at_CellularAutomaton_internal_7 = SELF + sw $s1, -32($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_7 --> -32($fp) + # local_prompt2_at_CellularAutomaton_internal_5 = local_prompt2_at_CellularAutomaton_internal_7 + lw $t1, -32($fp) + sw $t1, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_85 + sw $t1, 12($v0) + li $t1, 48 + sw $t1, 16($v0) + sw $v0, -36($fp) + # ARG local_prompt2_at_CellularAutomaton_internal_8 + # LOCAL local_prompt2_at_CellularAutomaton_internal_8 --> -36($fp) + lw $t1, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_6 --> -28($fp) + # local_prompt2_at_CellularAutomaton_internal_6 = VCALL local_prompt2_at_CellularAutomaton_internal_5 out_string + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt2_at_CellularAutomaton_internal_11 --> -48($fp) + # local_prompt2_at_CellularAutomaton_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_11 --> -48($fp) + # local_prompt2_at_CellularAutomaton_internal_9 = local_prompt2_at_CellularAutomaton_internal_11 + lw $t1, -48($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_86 + sw $t1, 12($v0) + li $t1, 49 + sw $t1, 16($v0) + sw $v0, -52($fp) + # ARG local_prompt2_at_CellularAutomaton_internal_12 + # LOCAL local_prompt2_at_CellularAutomaton_internal_12 --> -52($fp) + lw $t1, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_10 --> -44($fp) + # local_prompt2_at_CellularAutomaton_internal_10 = VCALL local_prompt2_at_CellularAutomaton_internal_9 out_string + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt2_at_CellularAutomaton_internal_15 --> -64($fp) + # local_prompt2_at_CellularAutomaton_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_15 --> -64($fp) + # local_prompt2_at_CellularAutomaton_internal_13 = local_prompt2_at_CellularAutomaton_internal_15 + lw $t1, -64($fp) + sw $t1, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_14 --> -60($fp) + # local_prompt2_at_CellularAutomaton_internal_14 = VCALL local_prompt2_at_CellularAutomaton_internal_13 in_string + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 20($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_14 --> -60($fp) + # local_prompt2_at_CellularAutomaton_ans_0 = local_prompt2_at_CellularAutomaton_internal_14 + lw $t1, -60($fp) + sw $t1, -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_87 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -76($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_17 --> -72($fp) + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_18 --> -76($fp) + # local_prompt2_at_CellularAutomaton_internal_17 = local_prompt2_at_CellularAutomaton_ans_0 - local_prompt2_at_CellularAutomaton_internal_18 + lw $t1, -4($fp) + lw $t2, -76($fp) + sub $t1, $t1, $t2 + sw $t1, -72($fp) + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_17 GOTO label_TRUE_223 + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_17 GOTO label_TRUE_223 + lw $t1, -72($fp) + beq $t1, 0, label_TRUE_223 + # LOCAL local_prompt2_at_CellularAutomaton_internal_17 --> -72($fp) + # local_prompt2_at_CellularAutomaton_internal_17 = 0 + li $t1, 0 + sw $t1, -72($fp) + # GOTO label_END_224 +j label_END_224 +label_TRUE_223: + # LOCAL local_prompt2_at_CellularAutomaton_internal_17 --> -72($fp) + # local_prompt2_at_CellularAutomaton_internal_17 = 1 + li $t1, 1 + sw $t1, -72($fp) + label_END_224: +# IF_ZERO local_prompt2_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_221 +# IF_ZERO local_prompt2_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_221 +lw $t1, -72($fp) +beq $t1, 0, label_FALSEIF_221 +# LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) +# local_prompt2_at_CellularAutomaton_internal_19 = 1 +li $t1, 1 +sw $t1, -80($fp) +# LOCAL local_prompt2_at_CellularAutomaton_internal_16 --> -68($fp) +# LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) +# local_prompt2_at_CellularAutomaton_internal_16 = local_prompt2_at_CellularAutomaton_internal_19 +lw $t1, -80($fp) +sw $t1, -68($fp) +# GOTO label_ENDIF_222 +j label_ENDIF_222 +label_FALSEIF_221: + # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) + # local_prompt2_at_CellularAutomaton_internal_20 = 0 + li $t1, 0 + sw $t1, -84($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_16 --> -68($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) + # local_prompt2_at_CellularAutomaton_internal_16 = local_prompt2_at_CellularAutomaton_internal_20 + lw $t1, -84($fp) + sw $t1, -68($fp) + label_ENDIF_222: +# RETURN local_prompt2_at_CellularAutomaton_internal_16 +lw $v0, -68($fp) +# Deallocate stack frame for function function_prompt2_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 92 +jr $ra +# Function END + + +# __Main__attrib__cells__init implementation. +# @Params: +__Main__attrib__cells__init: + # Allocate stack frame for function __Main__attrib__cells__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__cells__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 148 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 148 + # LOCAL local_main_at_Main_continue_0 --> -4($fp) + # local_main_at_Main_continue_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # LOCAL local_main_at_Main_choice_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_0 + sw $t1, 12($v0) + li $t1, 0 + sw $t1, 16($v0) + sw $v0, -8($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 + lw $t1, -20($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_88 + sw $t1, 12($v0) + li $t1, 29 + sw $t1, 16($v0) + sw $v0, -24($fp) + # ARG local_main_at_Main_internal_5 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t1, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 + lw $t1, -36($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_89 + sw $t1, 12($v0) + li $t1, 47 + sw $t1, 16($v0) + sw $v0, -40($fp) + # ARG local_main_at_Main_internal_9 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + lw $t1, -40($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_string + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_WHILE_225: + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 + lw $t1, -52($fp) + sw $t1, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 prompt2 + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 104($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # IF_ZERO local_main_at_Main_internal_11 GOTO label_WHILE_END_226 + # IF_ZERO local_main_at_Main_internal_11 GOTO label_WHILE_END_226 + lw $t1, -48($fp) + beq $t1, 0, label_WHILE_END_226 + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = 1 + li $t1, 1 + sw $t1, -56($fp) + # LOCAL local_main_at_Main_continue_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_continue_0 = local_main_at_Main_internal_13 + lw $t1, -56($fp) + sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_14 = local_main_at_Main_internal_16 + lw $t1, -68($fp) + sw $t1, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 option + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 96($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_choice_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_choice_1 = local_main_at_Main_internal_15 + lw $t1, -64($fp) + sw $t1, -8($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_19 = ALLOCATE CellularAutomaton + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, CellularAutomaton + sw $t3, 12($v0) + li $t3, 17 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 28 bytes of memory + li $a0, 28 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, CellularAutomaton_start + sw $t3, 4($v0) + # Load type offset + li $t3, 20 + sw $t3, 8($v0) + move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Board__attrib__rows__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Board__attrib__columns__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Board__attrib__board_size__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __CellularAutomaton__attrib__population_map__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t2) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t2, -80($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_17 = local_main_at_Main_internal_19 + lw $t2, -80($fp) + sw $t2, -72($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_choice_1 + # LOCAL local_main_at_Main_choice_1 --> -8($fp) + lw $t2, -8($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_18 = VCALL local_main_at_Main_internal_17 init + # Save new self pointer in $s1 + lw $s1, -72($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 36($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -76($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + lw $t2, -76($fp) + sw $t2, 28($s1) + # local_main_at_Main_internal_22 = GETATTRIBUTE cells Main + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + lw $t2, 28($s1) + sw $t2, -92($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # local_main_at_Main_internal_20 = local_main_at_Main_internal_22 + lw $t2, -92($fp) + sw $t2, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_21 = VCALL local_main_at_Main_internal_20 print + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 40($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_WHILE_227: + # IF_ZERO local_main_at_Main_continue_0 GOTO label_WHILE_END_228 + # IF_ZERO local_main_at_Main_continue_0 GOTO label_WHILE_END_228 + lw $t2, -4($fp) + beq $t2, 0, label_WHILE_END_228 + # LOCAL local_main_at_Main_internal_26 --> -108($fp) + # local_main_at_Main_internal_26 = SELF + sw $s1, -108($fp) + # LOCAL local_main_at_Main_internal_24 --> -100($fp) + # LOCAL local_main_at_Main_internal_26 --> -108($fp) + # local_main_at_Main_internal_24 = local_main_at_Main_internal_26 + lw $t2, -108($fp) + sw $t2, -100($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_24 --> -100($fp) + # LOCAL local_main_at_Main_internal_25 --> -104($fp) + # local_main_at_Main_internal_25 = VCALL local_main_at_Main_internal_24 prompt + # Save new self pointer in $s1 + lw $s1, -100($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 100($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -104($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # IF_ZERO local_main_at_Main_internal_25 GOTO label_FALSEIF_229 + # IF_ZERO local_main_at_Main_internal_25 GOTO label_FALSEIF_229 + lw $t2, -104($fp) + beq $t2, 0, label_FALSEIF_229 + # local_main_at_Main_internal_29 = GETATTRIBUTE cells Main + # LOCAL local_main_at_Main_internal_29 --> -120($fp) + lw $t2, 28($s1) + sw $t2, -120($fp) + # LOCAL local_main_at_Main_internal_27 --> -112($fp) + # LOCAL local_main_at_Main_internal_29 --> -120($fp) + # local_main_at_Main_internal_27 = local_main_at_Main_internal_29 + lw $t2, -120($fp) + sw $t2, -112($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_27 --> -112($fp) + # LOCAL local_main_at_Main_internal_28 --> -116($fp) + # local_main_at_Main_internal_28 = VCALL local_main_at_Main_internal_27 evolve + # Save new self pointer in $s1 + lw $s1, -112($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 92($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -116($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_main_at_Main_internal_32 = GETATTRIBUTE cells Main + # LOCAL local_main_at_Main_internal_32 --> -132($fp) + lw $t2, 28($s1) + sw $t2, -132($fp) + # LOCAL local_main_at_Main_internal_30 --> -124($fp) + # LOCAL local_main_at_Main_internal_32 --> -132($fp) + # local_main_at_Main_internal_30 = local_main_at_Main_internal_32 + lw $t2, -132($fp) + sw $t2, -124($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_30 --> -124($fp) + # LOCAL local_main_at_Main_internal_31 --> -128($fp) + # local_main_at_Main_internal_31 = VCALL local_main_at_Main_internal_30 print + # Save new self pointer in $s1 + lw $s1, -124($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 40($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -128($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # LOCAL local_main_at_Main_internal_31 --> -128($fp) + # local_main_at_Main_internal_23 = local_main_at_Main_internal_31 + lw $t2, -128($fp) + sw $t2, -96($fp) + # GOTO label_ENDIF_230 +j label_ENDIF_230 +label_FALSEIF_229: + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # local_main_at_Main_internal_33 = 0 + li $t2, 0 + sw $t2, -136($fp) + # LOCAL local_main_at_Main_continue_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # local_main_at_Main_continue_0 = local_main_at_Main_internal_33 + lw $t2, -136($fp) + sw $t2, -4($fp) + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # local_main_at_Main_internal_23 = + label_ENDIF_230: +# GOTO label_WHILE_227 +j label_WHILE_227 +label_WHILE_END_228: + # GOTO label_WHILE_225 + j label_WHILE_225 + label_WHILE_END_226: + # LOCAL local_main_at_Main_internal_34 --> -140($fp) + # local_main_at_Main_internal_34 = SELF + sw $s1, -140($fp) + # RETURN local_main_at_Main_internal_34 + lw $v0, -140($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 148 + jr $ra + # Function END + diff --git a/tests/codegen/list.mips b/tests/codegen/list.mips new file mode 100644 index 00000000..822ddca6 --- /dev/null +++ b/tests/codegen/list.mips @@ -0,0 +1,1679 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:24 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +List: .asciiz "List" +# Function END +Cons: .asciiz "Cons" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type List **** +List_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_isNil_at_List, function_head_at_List, function_tail_at_List, function_cons_at_List +# Function END +# + + +# **** Type RECORD for type List **** +List_start: + List_vtable_pointer: .word List_vtable + # Function END +List_end: +# + + +# **** VTABLE for type Cons **** +Cons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_isNil_at_Cons, function_head_at_Cons, function_tail_at_Cons, function_cons_at_List, function_init_at_Cons +# Function END +# + + +# **** Type RECORD for type Cons **** +Cons_start: + Cons_vtable_pointer: .word Cons_vtable + # Function END +Cons_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_print_list_at_Main, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 +List__TDT: .word -1, -1, -1, -1, 0, 1, -1 +Cons__TDT: .word -1, -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "\n" +# + + +data_5: .asciiz " " +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 24 + sw $t2, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__mylist__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 32($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_List implementation. +# @Params: +function_isNil_at_List: + # Allocate stack frame for function function_isNil_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_List_internal_0 --> -4($fp) + # local_isNil_at_List_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + # RETURN local_isNil_at_List_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_head_at_List implementation. +# @Params: +function_head_at_List: + # Allocate stack frame for function function_head_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_head_at_List_internal_2 --> -12($fp) + # local_head_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_head_at_List_internal_0 --> -4($fp) + # LOCAL local_head_at_List_internal_2 --> -12($fp) + # local_head_at_List_internal_0 = local_head_at_List_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_head_at_List_internal_0 --> -4($fp) + # LOCAL local_head_at_List_internal_1 --> -8($fp) + # local_head_at_List_internal_1 = VCALL local_head_at_List_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function function_head_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_tail_at_List implementation. +# @Params: +function_tail_at_List: + # Allocate stack frame for function function_tail_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_tail_at_List_internal_2 --> -12($fp) + # local_tail_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_tail_at_List_internal_0 --> -4($fp) + # LOCAL local_tail_at_List_internal_2 --> -12($fp) + # local_tail_at_List_internal_0 = local_tail_at_List_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_tail_at_List_internal_0 --> -4($fp) + # LOCAL local_tail_at_List_internal_1 --> -8($fp) + # local_tail_at_List_internal_1 = VCALL local_tail_at_List_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 0($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_tail_at_List_internal_3 --> -16($fp) + # local_tail_at_List_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_tail_at_List_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_tail_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cons_at_List implementation. +# @Params: +# 0($fp) = param_cons_at_List_i_0 +function_cons_at_List: + # Allocate stack frame for function function_cons_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cons_at_List_internal_2 --> -12($fp) + # local_cons_at_List_internal_2 = ALLOCATE Cons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Cons + sw $t3, 12($v0) + li $t3, 4 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Cons_start + sw $t3, 4($v0) + # Load type offset + li $t3, 20 + sw $t3, 8($v0) + move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Cons__attrib__car__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Cons__attrib__cdr__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t2) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t2, -12($fp) + # LOCAL local_cons_at_List_internal_0 --> -4($fp) + # LOCAL local_cons_at_List_internal_2 --> -12($fp) + # local_cons_at_List_internal_0 = local_cons_at_List_internal_2 + lw $t2, -12($fp) + sw $t2, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cons_at_List_i_0 + # PARAM param_cons_at_List_i_0 --> 0($fp) + lw $t2, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_cons_at_List_internal_3 --> -16($fp) + # local_cons_at_List_internal_3 = SELF + sw $s1, -16($fp) + # ARG local_cons_at_List_internal_3 + # LOCAL local_cons_at_List_internal_3 --> -16($fp) + lw $t2, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_cons_at_List_internal_0 --> -4($fp) + # LOCAL local_cons_at_List_internal_1 --> -8($fp) + # local_cons_at_List_internal_1 = VCALL local_cons_at_List_internal_0 init + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 28($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_cons_at_List_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_cons_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# __Cons__attrib__car__init implementation. +# @Params: +__Cons__attrib__car__init: + # Allocate stack frame for function __Cons__attrib__car__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Cons__attrib__car__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Cons__attrib__cdr__init implementation. +# @Params: +__Cons__attrib__cdr__init: + # Allocate stack frame for function __Cons__attrib__cdr__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Cons__attrib__cdr__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_Cons implementation. +# @Params: +function_isNil_at_Cons: + # Allocate stack frame for function function_isNil_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_Cons_internal_0 --> -4($fp) + # local_isNil_at_Cons_internal_0 = 0 + li $t2, 0 + sw $t2, -4($fp) + # RETURN local_isNil_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_head_at_Cons implementation. +# @Params: +function_head_at_Cons: + # Allocate stack frame for function function_head_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_head_at_Cons_internal_0 = GETATTRIBUTE car Cons + # LOCAL local_head_at_Cons_internal_0 --> -4($fp) + lw $t2, 12($s1) + sw $t2, -4($fp) + # RETURN local_head_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_head_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_tail_at_Cons implementation. +# @Params: +function_tail_at_Cons: + # Allocate stack frame for function function_tail_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_tail_at_Cons_internal_0 = GETATTRIBUTE cdr Cons + # LOCAL local_tail_at_Cons_internal_0 --> -4($fp) + lw $t2, 16($s1) + sw $t2, -4($fp) + # RETURN local_tail_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_tail_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Cons implementation. +# @Params: +# 0($fp) = param_init_at_Cons_i_0 +# 4($fp) = param_init_at_Cons_rest_1 +function_init_at_Cons: + # Allocate stack frame for function function_init_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_Cons_i_0 --> 4($fp) + lw $t2, 4($fp) + sw $t2, 12($s1) + # + # PARAM param_init_at_Cons_rest_1 --> 0($fp) + lw $t2, 0($fp) + sw $t2, 16($s1) + # LOCAL local_init_at_Cons_internal_0 --> -4($fp) + # local_init_at_Cons_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# __Main__attrib__mylist__init implementation. +# @Params: +__Main__attrib__mylist__init: + # Allocate stack frame for function __Main__attrib__mylist__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__mylist__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_list_at_Main implementation. +# @Params: +# 0($fp) = param_print_list_at_Main_l_0 +function_print_list_at_Main: + # Allocate stack frame for function function_print_list_at_Main. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # LOCAL local_print_list_at_Main_internal_1 --> -8($fp) + # PARAM param_print_list_at_Main_l_0 --> 0($fp) + # local_print_list_at_Main_internal_1 = PARAM param_print_list_at_Main_l_0 + lw $t2, 0($fp) + sw $t2, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_1 --> -8($fp) + # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) + # local_print_list_at_Main_internal_2 = VCALL local_print_list_at_Main_internal_1 isNil + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 12($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # IF_ZERO local_print_list_at_Main_internal_2 GOTO label_FALSEIF_1 + # IF_ZERO local_print_list_at_Main_internal_2 GOTO label_FALSEIF_1 + lw $t2, -12($fp) + beq $t2, 0, label_FALSEIF_1 + # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) + # local_print_list_at_Main_internal_5 = SELF + sw $s1, -24($fp) + # LOCAL local_print_list_at_Main_internal_3 --> -16($fp) + # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) + # local_print_list_at_Main_internal_3 = local_print_list_at_Main_internal_5 + lw $t2, -24($fp) + sw $t2, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_4 + sw $t2, 12($v0) + li $t2, 1 + sw $t2, 16($v0) + sw $v0, -28($fp) + # ARG local_print_list_at_Main_internal_6 + # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) + lw $t2, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_print_list_at_Main_internal_3 --> -16($fp) + # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) + # local_print_list_at_Main_internal_4 = VCALL local_print_list_at_Main_internal_3 out_string + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 12($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) + # local_print_list_at_Main_internal_0 = local_print_list_at_Main_internal_4 + lw $t2, -20($fp) + sw $t2, -4($fp) + # GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) + # local_print_list_at_Main_internal_9 = SELF + sw $s1, -40($fp) + # LOCAL local_print_list_at_Main_internal_7 --> -32($fp) + # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) + # local_print_list_at_Main_internal_7 = local_print_list_at_Main_internal_9 + lw $t2, -40($fp) + sw $t2, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) + # PARAM param_print_list_at_Main_l_0 --> 0($fp) + # local_print_list_at_Main_internal_10 = PARAM param_print_list_at_Main_l_0 + lw $t2, 0($fp) + sw $t2, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) + # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) + # local_print_list_at_Main_internal_11 = VCALL local_print_list_at_Main_internal_10 head + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 16($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_print_list_at_Main_internal_11 + # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) + lw $t2, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_print_list_at_Main_internal_7 --> -32($fp) + # LOCAL local_print_list_at_Main_internal_8 --> -36($fp) + # local_print_list_at_Main_internal_8 = VCALL local_print_list_at_Main_internal_7 out_int + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 16($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) + # local_print_list_at_Main_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_print_list_at_Main_internal_12 --> -52($fp) + # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) + # local_print_list_at_Main_internal_12 = local_print_list_at_Main_internal_14 + lw $t2, -60($fp) + sw $t2, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_5 + sw $t2, 12($v0) + li $t2, 1 + sw $t2, 16($v0) + sw $v0, -64($fp) + # ARG local_print_list_at_Main_internal_15 + # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) + lw $t2, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_print_list_at_Main_internal_12 --> -52($fp) + # LOCAL local_print_list_at_Main_internal_13 --> -56($fp) + # local_print_list_at_Main_internal_13 = VCALL local_print_list_at_Main_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 12($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) + # local_print_list_at_Main_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_print_list_at_Main_internal_16 --> -68($fp) + # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) + # local_print_list_at_Main_internal_16 = local_print_list_at_Main_internal_18 + lw $t2, -76($fp) + sw $t2, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) + # PARAM param_print_list_at_Main_l_0 --> 0($fp) + # local_print_list_at_Main_internal_19 = PARAM param_print_list_at_Main_l_0 + lw $t2, 0($fp) + sw $t2, -80($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) + # LOCAL local_print_list_at_Main_internal_20 --> -84($fp) + # local_print_list_at_Main_internal_20 = VCALL local_print_list_at_Main_internal_19 tail + # Save new self pointer in $s1 + lw $s1, -80($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 20($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -84($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_print_list_at_Main_internal_20 + # LOCAL local_print_list_at_Main_internal_20 --> -84($fp) + lw $t2, -84($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_print_list_at_Main_internal_16 --> -68($fp) + # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) + # local_print_list_at_Main_internal_17 = VCALL local_print_list_at_Main_internal_16 print_list + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 28($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) + # local_print_list_at_Main_internal_0 = local_print_list_at_Main_internal_17 + lw $t2, -72($fp) + sw $t2, -4($fp) + label_ENDIF_2: +# RETURN local_print_list_at_Main_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_print_list_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 92 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 96 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 96 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = ALLOCATE List + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, List + sw $t4, 12($v0) + li $t4, 4 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, List_start + sw $t4, 4($v0) + # Load type offset + li $t4, 16 + sw $t4, 8($v0) + move $t3, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t3, -44($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_8 = local_main_at_Main_internal_10 + lw $t3, -44($fp) + sw $t3, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 1 + li $t3, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 cons + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 24($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_9 + lw $t3, -40($fp) + sw $t3, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 2 + li $t3, 2 + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 cons + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 24($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_7 + lw $t3, -32($fp) + sw $t3, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 3 + li $t3, 3 + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 cons + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 24($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_2 = local_main_at_Main_internal_5 + lw $t3, -24($fp) + sw $t3, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 4 + li $t3, 4 + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 cons + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 24($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 + lw $t3, -16($fp) + sw $t3, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 5 + li $t3, 5 + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 cons + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 24($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + lw $t3, -8($fp) + sw $t3, 12($s1) + label_WHILE_3: + # local_main_at_Main_internal_13 = GETATTRIBUTE mylist Main + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + lw $t3, 12($s1) + sw $t3, -56($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_11 = local_main_at_Main_internal_13 + lw $t3, -56($fp) + sw $t3, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = VCALL local_main_at_Main_internal_11 isNil + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # IF_ZERO local_main_at_Main_internal_12 GOTO label_FALSE_5 + # IF_ZERO local_main_at_Main_internal_12 GOTO label_FALSE_5 + lw $t3, -52($fp) + beq $t3, 0, label_FALSE_5 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = 0 + li $t3, 0 + sw $t3, -60($fp) + # GOTO label_NOT_END_6 + j label_NOT_END_6 + label_FALSE_5: + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = 1 + li $t3, 1 + sw $t3, -60($fp) + label_NOT_END_6: + # IF_ZERO local_main_at_Main_internal_14 GOTO label_WHILE_END_4 + # IF_ZERO local_main_at_Main_internal_14 GOTO label_WHILE_END_4 + lw $t3, -60($fp) + beq $t3, 0, label_WHILE_END_4 + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = SELF + sw $s1, -72($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 + lw $t3, -72($fp) + sw $t3, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_main_at_Main_internal_18 = GETATTRIBUTE mylist Main + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + lw $t3, 12($s1) + sw $t3, -76($fp) + # ARG local_main_at_Main_internal_18 + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + lw $t3, -76($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 print_list + # Save new self pointer in $s1 + lw $s1, -64($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 28($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_main_at_Main_internal_21 = GETATTRIBUTE mylist Main + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + lw $t3, 12($s1) + sw $t3, -88($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 + lw $t3, -88($fp) + sw $t3, -80($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 tail + # Save new self pointer in $s1 + lw $s1, -80($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 20($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -84($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + lw $t3, -84($fp) + sw $t3, 12($s1) + # GOTO label_WHILE_3 + j label_WHILE_3 + label_WHILE_END_4: + # RETURN + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 96 + jr $ra + # Function END + diff --git a/tests/codegen/new_complex.mips b/tests/codegen/new_complex.mips new file mode 100644 index 00000000..339f93ba --- /dev/null +++ b/tests/codegen/new_complex.mips @@ -0,0 +1,2068 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:23 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Main: .asciiz "Main" +# Function END +Complex: .asciiz "Complex" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +# **** VTABLE for type Complex **** +Complex_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Complex, function_print_at_Complex, function_reflect_0_at_Complex, function_reflect_X_at_Complex, function_reflect_Y_at_Complex, function_equal_at_Complex, function_x_value_at_Complex, function_y_value_at_Complex +# Function END +# + + +# **** Type RECORD for type Complex **** +Complex_start: + Complex_vtable_pointer: .word Complex_vtable + # Function END +Complex_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, 1, 1 +Object__TDT: .word 1, 0, 1, 1, 2, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1 +Main__TDT: .word -1, -1, -1, -1, 0, -1 +Complex__TDT: .word -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "=)\n" +# + + +data_5: .asciiz "=(\n" +# + + +data_6: .asciiz "=)\n" +# + + +data_7: .asciiz "=(\n" +# + + +data_8: .asciiz "+" +# + + +data_9: .asciiz "I" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 28($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 148 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 148 + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_c_0 = ALLOCATE Complex + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Complex + sw $t3, 12($v0) + li $t3, 7 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Complex_start + sw $t3, 4($v0) + # Load type offset + li $t3, 20 + sw $t3, 8($v0) + move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Complex__attrib__x__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Complex__attrib__y__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t2) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t2, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE Complex + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Complex + sw $t4, 12($v0) + li $t4, 7 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Complex_start + sw $t4, 4($v0) + # Load type offset + li $t4, 20 + sw $t4, 8($v0) + move $t3, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Complex__attrib__x__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t3) + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Complex__attrib__y__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t3) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t3, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t3, -16($fp) + sw $t3, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 1 + li $t3, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # ARG 1 + li $t3, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 28($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_c_0 = local_main_at_Main_internal_2 + lw $t3, -12($fp) + sw $t3, -4($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_c_0 + lw $t3, -4($fp) + sw $t3, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 reflect_X + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 40($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_internal_8 = local_main_at_Main_c_0 + lw $t3, -4($fp) + sw $t3, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 reflect_0 + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 36($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_5 = local_main_at_Main_internal_7 - local_main_at_Main_internal_9 + lw $t3, -32($fp) + lw $t4, -40($fp) + sub $t3, $t3, $t4 + sw $t3, -24($fp) + # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_3 + # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_3 + lw $t3, -24($fp) + beq $t3, 0, label_TRUE_3 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = 0 + li $t3, 0 + sw $t3, -24($fp) + # GOTO label_END_4 +j label_END_4 +label_TRUE_3: + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = 1 + li $t3, 1 + sw $t3, -24($fp) + label_END_4: +# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_1 +# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_1 +lw $t3, -24($fp) +beq $t3, 0, label_FALSEIF_1 +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# local_main_at_Main_internal_12 = SELF +sw $s1, -52($fp) +# LOCAL local_main_at_Main_internal_10 --> -44($fp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# local_main_at_Main_internal_10 = local_main_at_Main_internal_12 +lw $t3, -52($fp) +sw $t3, -44($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t3, String +sw $t3, 0($v0) +la $t3, String_start +sw $t3, 4($v0) +# Load type offset +li $t3, 8 +sw $t3, 8($v0) +la $t3, data_4 +sw $t3, 12($v0) +li $t3, 3 +sw $t3, 16($v0) +sw $v0, -56($fp) +# ARG local_main_at_Main_internal_13 +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +lw $t3, -56($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_10 --> -44($fp) +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +# local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 out_string +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 12($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_4 --> -20($fp) +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +# local_main_at_Main_internal_4 = local_main_at_Main_internal_11 +lw $t3, -48($fp) +sw $t3, -20($fp) +# GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_14 = local_main_at_Main_internal_16 + lw $t3, -68($fp) + sw $t3, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_5 + sw $t3, 12($v0) + li $t3, 3 + sw $t3, 16($v0) + sw $v0, -72($fp) + # ARG local_main_at_Main_internal_17 + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + lw $t3, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 out_string + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_15 + lw $t3, -64($fp) + sw $t3, -20($fp) + label_ENDIF_2: +# LOCAL local_main_at_Main_internal_23 --> -96($fp) +# LOCAL local_main_at_Main_c_0 --> -4($fp) +# local_main_at_Main_internal_23 = local_main_at_Main_c_0 +lw $t3, -4($fp) +sw $t3, -96($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_23 --> -96($fp) +# LOCAL local_main_at_Main_internal_24 --> -100($fp) +# local_main_at_Main_internal_24 = VCALL local_main_at_Main_internal_23 reflect_X +# Save new self pointer in $s1 +lw $s1, -96($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 40($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -100($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_21 --> -88($fp) +# LOCAL local_main_at_Main_internal_24 --> -100($fp) +# local_main_at_Main_internal_21 = local_main_at_Main_internal_24 +lw $t3, -100($fp) +sw $t3, -88($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_21 --> -88($fp) +# LOCAL local_main_at_Main_internal_22 --> -92($fp) +# local_main_at_Main_internal_22 = VCALL local_main_at_Main_internal_21 reflect_Y +# Save new self pointer in $s1 +lw $s1, -88($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 44($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -92($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# LOCAL local_main_at_Main_internal_22 --> -92($fp) +# local_main_at_Main_internal_19 = local_main_at_Main_internal_22 +lw $t3, -92($fp) +sw $t3, -80($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_25 --> -104($fp) +# LOCAL local_main_at_Main_c_0 --> -4($fp) +# local_main_at_Main_internal_25 = local_main_at_Main_c_0 +lw $t3, -4($fp) +sw $t3, -104($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_25 --> -104($fp) +# LOCAL local_main_at_Main_internal_26 --> -108($fp) +# local_main_at_Main_internal_26 = VCALL local_main_at_Main_internal_25 reflect_0 +# Save new self pointer in $s1 +lw $s1, -104($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 36($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -108($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_26 +# LOCAL local_main_at_Main_internal_26 --> -108($fp) +lw $t3, -108($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# LOCAL local_main_at_Main_internal_20 --> -84($fp) +# local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 equal +# Save new self pointer in $s1 +lw $s1, -80($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 48($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -84($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# IF_ZERO local_main_at_Main_internal_20 GOTO label_FALSEIF_5 +# IF_ZERO local_main_at_Main_internal_20 GOTO label_FALSEIF_5 +lw $t3, -84($fp) +beq $t3, 0, label_FALSEIF_5 +# LOCAL local_main_at_Main_internal_29 --> -120($fp) +# local_main_at_Main_internal_29 = SELF +sw $s1, -120($fp) +# LOCAL local_main_at_Main_internal_27 --> -112($fp) +# LOCAL local_main_at_Main_internal_29 --> -120($fp) +# local_main_at_Main_internal_27 = local_main_at_Main_internal_29 +lw $t3, -120($fp) +sw $t3, -112($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_30 --> -124($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t3, String +sw $t3, 0($v0) +la $t3, String_start +sw $t3, 4($v0) +# Load type offset +li $t3, 8 +sw $t3, 8($v0) +la $t3, data_6 +sw $t3, 12($v0) +li $t3, 3 +sw $t3, 16($v0) +sw $v0, -124($fp) +# ARG local_main_at_Main_internal_30 +# LOCAL local_main_at_Main_internal_30 --> -124($fp) +lw $t3, -124($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_27 --> -112($fp) +# LOCAL local_main_at_Main_internal_28 --> -116($fp) +# local_main_at_Main_internal_28 = VCALL local_main_at_Main_internal_27 out_string +# Save new self pointer in $s1 +lw $s1, -112($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 12($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -116($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# LOCAL local_main_at_Main_internal_28 --> -116($fp) +# local_main_at_Main_internal_18 = local_main_at_Main_internal_28 +lw $t3, -116($fp) +sw $t3, -76($fp) +# GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # local_main_at_Main_internal_33 = SELF + sw $s1, -136($fp) + # LOCAL local_main_at_Main_internal_31 --> -128($fp) + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # local_main_at_Main_internal_31 = local_main_at_Main_internal_33 + lw $t3, -136($fp) + sw $t3, -128($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_7 + sw $t3, 12($v0) + li $t3, 3 + sw $t3, 16($v0) + sw $v0, -140($fp) + # ARG local_main_at_Main_internal_34 + # LOCAL local_main_at_Main_internal_34 --> -140($fp) + lw $t3, -140($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_31 --> -128($fp) + # LOCAL local_main_at_Main_internal_32 --> -132($fp) + # local_main_at_Main_internal_32 = VCALL local_main_at_Main_internal_31 out_string + # Save new self pointer in $s1 + lw $s1, -128($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -132($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_32 --> -132($fp) + # local_main_at_Main_internal_18 = local_main_at_Main_internal_32 + lw $t3, -132($fp) + sw $t3, -76($fp) + label_ENDIF_6: +# RETURN local_main_at_Main_internal_18 +lw $v0, -76($fp) +# Deallocate stack frame for function function_main_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 148 +jr $ra +# Function END + + +# __Complex__attrib__x__init implementation. +# @Params: +__Complex__attrib__x__init: + # Allocate stack frame for function __Complex__attrib__x__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Complex__attrib__x__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Complex__attrib__y__init implementation. +# @Params: +__Complex__attrib__y__init: + # Allocate stack frame for function __Complex__attrib__y__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Complex__attrib__y__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Complex implementation. +# @Params: +# 0($fp) = param_init_at_Complex_a_0 +# 4($fp) = param_init_at_Complex_b_1 +function_init_at_Complex: + # Allocate stack frame for function function_init_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_init_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + lw $t3, 12($s1) + sw $t3, -8($fp) + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + # local_init_at_Complex_internal_0 = local_init_at_Complex_internal_1 - PARAM param_init_at_Complex_a_0 + lw $t3, -8($fp) + lw $t4, 4($fp) + sub $t3, $t3, $t4 + sw $t3, -4($fp) + # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_7 + # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_7 + lw $t3, -4($fp) + beq $t3, 0, label_TRUE_7 + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # local_init_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + # GOTO label_END_8 +j label_END_8 +label_TRUE_7: + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # local_init_at_Complex_internal_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + label_END_8: +# local_init_at_Complex_internal_3 = GETATTRIBUTE y Complex +# LOCAL local_init_at_Complex_internal_3 --> -16($fp) +lw $t3, 16($s1) +sw $t3, -16($fp) +# LOCAL local_init_at_Complex_internal_2 --> -12($fp) +# LOCAL local_init_at_Complex_internal_3 --> -16($fp) +# PARAM param_init_at_Complex_b_1 --> 0($fp) +# local_init_at_Complex_internal_2 = local_init_at_Complex_internal_3 - PARAM param_init_at_Complex_b_1 +lw $t3, -16($fp) +lw $t4, 0($fp) +sub $t3, $t3, $t4 +sw $t3, -12($fp) +# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_9 +# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_9 +lw $t3, -12($fp) +beq $t3, 0, label_TRUE_9 +# LOCAL local_init_at_Complex_internal_2 --> -12($fp) +# local_init_at_Complex_internal_2 = 0 +li $t3, 0 +sw $t3, -12($fp) +# GOTO label_END_10 +j label_END_10 +label_TRUE_9: + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # local_init_at_Complex_internal_2 = 1 + li $t3, 1 + sw $t3, -12($fp) + label_END_10: +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# local_init_at_Complex_internal_4 = SELF +sw $s1, -20($fp) +# RETURN local_init_at_Complex_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_init_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +# Deallocate function args +addu $sp, $sp, 8 +jr $ra +# Function END + + +# function_print_at_Complex implementation. +# @Params: +function_print_at_Complex: + # Allocate stack frame for function function_print_at_Complex. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # local_print_at_Complex_internal_2 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_2 --> -12($fp) + lw $t3, 16($s1) + sw $t3, -12($fp) + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # LOCAL local_print_at_Complex_internal_2 --> -12($fp) + # local_print_at_Complex_internal_1 = local_print_at_Complex_internal_2 - 0 + lw $t3, -12($fp) + sub $t3, $t3, 0 + sw $t3, -8($fp) + # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_13 + # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_13 + lw $t3, -8($fp) + beq $t3, 0, label_TRUE_13 + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # local_print_at_Complex_internal_1 = 0 + li $t3, 0 + sw $t3, -8($fp) + # GOTO label_END_14 +j label_END_14 +label_TRUE_13: + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # local_print_at_Complex_internal_1 = 1 + li $t3, 1 + sw $t3, -8($fp) + label_END_14: +# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_11 +# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_11 +lw $t3, -8($fp) +beq $t3, 0, label_FALSEIF_11 +# LOCAL local_print_at_Complex_internal_5 --> -24($fp) +# local_print_at_Complex_internal_5 = SELF +sw $s1, -24($fp) +# LOCAL local_print_at_Complex_internal_3 --> -16($fp) +# LOCAL local_print_at_Complex_internal_5 --> -24($fp) +# local_print_at_Complex_internal_3 = local_print_at_Complex_internal_5 +lw $t3, -24($fp) +sw $t3, -16($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_print_at_Complex_internal_6 = GETATTRIBUTE x Complex +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +lw $t3, 12($s1) +sw $t3, -28($fp) +# ARG local_print_at_Complex_internal_6 +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +lw $t3, -28($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_print_at_Complex_internal_3 --> -16($fp) +# LOCAL local_print_at_Complex_internal_4 --> -20($fp) +# local_print_at_Complex_internal_4 = VCALL local_print_at_Complex_internal_3 out_int +# Save new self pointer in $s1 +lw $s1, -16($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 16($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -20($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_print_at_Complex_internal_0 --> -4($fp) +# LOCAL local_print_at_Complex_internal_4 --> -20($fp) +# local_print_at_Complex_internal_0 = local_print_at_Complex_internal_4 +lw $t3, -20($fp) +sw $t3, -4($fp) +# GOTO label_ENDIF_12 +j label_ENDIF_12 +label_FALSEIF_11: + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_13 = local_print_at_Complex_internal_15 + lw $t3, -64($fp) + sw $t3, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Complex_internal_16 = GETATTRIBUTE x Complex + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + lw $t3, 12($s1) + sw $t3, -68($fp) + # ARG local_print_at_Complex_internal_16 + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + lw $t3, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # LOCAL local_print_at_Complex_internal_14 --> -60($fp) + # local_print_at_Complex_internal_14 = VCALL local_print_at_Complex_internal_13 out_int + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 16($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # LOCAL local_print_at_Complex_internal_14 --> -60($fp) + # local_print_at_Complex_internal_11 = local_print_at_Complex_internal_14 + lw $t3, -60($fp) + sw $t3, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_8 + sw $t3, 12($v0) + li $t3, 1 + sw $t3, 16($v0) + sw $v0, -72($fp) + # ARG local_print_at_Complex_internal_17 + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + lw $t3, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # LOCAL local_print_at_Complex_internal_12 --> -52($fp) + # local_print_at_Complex_internal_12 = VCALL local_print_at_Complex_internal_11 out_string + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_9 --> -40($fp) + # LOCAL local_print_at_Complex_internal_12 --> -52($fp) + # local_print_at_Complex_internal_9 = local_print_at_Complex_internal_12 + lw $t3, -52($fp) + sw $t3, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Complex_internal_18 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + lw $t3, 16($s1) + sw $t3, -76($fp) + # ARG local_print_at_Complex_internal_18 + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + lw $t3, -76($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_print_at_Complex_internal_9 --> -40($fp) + # LOCAL local_print_at_Complex_internal_10 --> -44($fp) + # local_print_at_Complex_internal_10 = VCALL local_print_at_Complex_internal_9 out_int + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 16($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_7 --> -32($fp) + # LOCAL local_print_at_Complex_internal_10 --> -44($fp) + # local_print_at_Complex_internal_7 = local_print_at_Complex_internal_10 + lw $t3, -44($fp) + sw $t3, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_9 + sw $t3, 12($v0) + li $t3, 1 + sw $t3, 16($v0) + sw $v0, -80($fp) + # ARG local_print_at_Complex_internal_19 + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + lw $t3, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_print_at_Complex_internal_7 --> -32($fp) + # LOCAL local_print_at_Complex_internal_8 --> -36($fp) + # local_print_at_Complex_internal_8 = VCALL local_print_at_Complex_internal_7 out_string + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_0 --> -4($fp) + # LOCAL local_print_at_Complex_internal_8 --> -36($fp) + # local_print_at_Complex_internal_0 = local_print_at_Complex_internal_8 + lw $t3, -36($fp) + sw $t3, -4($fp) + label_ENDIF_12: +# RETURN local_print_at_Complex_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_print_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +jr $ra +# Function END + + +# function_reflect_0_at_Complex implementation. +# @Params: +function_reflect_0_at_Complex: + # Allocate stack frame for function function_reflect_0_at_Complex. + subu $sp, $sp, 44 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 44 + # local_reflect_0_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + lw $t3, 12($s1) + sw $t3, -8($fp) + # local_reflect_0_at_Complex_internal_3 = GETATTRIBUTE x Complex + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + lw $t3, 12($s1) + sw $t3, -16($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + lw $t3, -16($fp) + not $t3, $t3 + sw $t3, -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # local_reflect_0_at_Complex_internal_0 = local_reflect_0_at_Complex_internal_1 - local_reflect_0_at_Complex_internal_2 + lw $t3, -8($fp) + lw $t4, -12($fp) + sub $t3, $t3, $t4 + sw $t3, -4($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_15 + # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_15 + lw $t3, -4($fp) + beq $t3, 0, label_TRUE_15 + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # local_reflect_0_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + # GOTO label_END_16 +j label_END_16 +label_TRUE_15: + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # local_reflect_0_at_Complex_internal_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + label_END_16: +# local_reflect_0_at_Complex_internal_5 = GETATTRIBUTE y Complex +# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) +lw $t3, 16($s1) +sw $t3, -24($fp) +# local_reflect_0_at_Complex_internal_7 = GETATTRIBUTE y Complex +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +lw $t3, 16($s1) +sw $t3, -32($fp) +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +lw $t3, -32($fp) +not $t3, $t3 +sw $t3, -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) +# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# local_reflect_0_at_Complex_internal_4 = local_reflect_0_at_Complex_internal_5 - local_reflect_0_at_Complex_internal_6 +lw $t3, -24($fp) +lw $t4, -28($fp) +sub $t3, $t3, $t4 +sw $t3, -20($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_17 +# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_17 +lw $t3, -20($fp) +beq $t3, 0, label_TRUE_17 +# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) +# local_reflect_0_at_Complex_internal_4 = 0 +li $t3, 0 +sw $t3, -20($fp) +# GOTO label_END_18 +j label_END_18 +label_TRUE_17: + # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) + # local_reflect_0_at_Complex_internal_4 = 1 + li $t3, 1 + sw $t3, -20($fp) + label_END_18: +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# local_reflect_0_at_Complex_internal_8 = SELF +sw $s1, -36($fp) +# RETURN local_reflect_0_at_Complex_internal_8 +lw $v0, -36($fp) +# Deallocate stack frame for function function_reflect_0_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 44 +jr $ra +# Function END + + +# function_reflect_X_at_Complex implementation. +# @Params: +function_reflect_X_at_Complex: + # Allocate stack frame for function function_reflect_X_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_reflect_X_at_Complex_internal_1 = GETATTRIBUTE y Complex + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + lw $t3, 16($s1) + sw $t3, -8($fp) + # local_reflect_X_at_Complex_internal_3 = GETATTRIBUTE y Complex + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + lw $t3, 16($s1) + sw $t3, -16($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + lw $t3, -16($fp) + not $t3, $t3 + sw $t3, -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # local_reflect_X_at_Complex_internal_0 = local_reflect_X_at_Complex_internal_1 - local_reflect_X_at_Complex_internal_2 + lw $t3, -8($fp) + lw $t4, -12($fp) + sub $t3, $t3, $t4 + sw $t3, -4($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_19 + # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_19 + lw $t3, -4($fp) + beq $t3, 0, label_TRUE_19 + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # local_reflect_X_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + # GOTO label_END_20 +j label_END_20 +label_TRUE_19: + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # local_reflect_X_at_Complex_internal_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + label_END_20: +# LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) +# local_reflect_X_at_Complex_internal_4 = SELF +sw $s1, -20($fp) +# RETURN local_reflect_X_at_Complex_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_reflect_X_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +jr $ra +# Function END + + +# function_reflect_Y_at_Complex implementation. +# @Params: +function_reflect_Y_at_Complex: + # Allocate stack frame for function function_reflect_Y_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_reflect_Y_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + lw $t3, 12($s1) + sw $t3, -8($fp) + # local_reflect_Y_at_Complex_internal_3 = GETATTRIBUTE x Complex + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + lw $t3, 12($s1) + sw $t3, -16($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + lw $t3, -16($fp) + not $t3, $t3 + sw $t3, -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # local_reflect_Y_at_Complex_internal_0 = local_reflect_Y_at_Complex_internal_1 - local_reflect_Y_at_Complex_internal_2 + lw $t3, -8($fp) + lw $t4, -12($fp) + sub $t3, $t3, $t4 + sw $t3, -4($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_21 + # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_21 + lw $t3, -4($fp) + beq $t3, 0, label_TRUE_21 + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # local_reflect_Y_at_Complex_internal_0 = 0 + li $t3, 0 + sw $t3, -4($fp) + # GOTO label_END_22 +j label_END_22 +label_TRUE_21: + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # local_reflect_Y_at_Complex_internal_0 = 1 + li $t3, 1 + sw $t3, -4($fp) + label_END_22: +# LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) +# local_reflect_Y_at_Complex_internal_4 = SELF +sw $s1, -20($fp) +# RETURN local_reflect_Y_at_Complex_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_reflect_Y_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +jr $ra +# Function END + + +# function_equal_at_Complex implementation. +# @Params: +# 0($fp) = param_equal_at_Complex_d_0 +function_equal_at_Complex: + # Allocate stack frame for function function_equal_at_Complex. + subu $sp, $sp, 60 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 60 + # local_equal_at_Complex_internal_2 = GETATTRIBUTE x Complex + # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) + lw $t3, 12($s1) + sw $t3, -12($fp) + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # PARAM param_equal_at_Complex_d_0 --> 0($fp) + # local_equal_at_Complex_internal_3 = PARAM param_equal_at_Complex_d_0 + lw $t3, 0($fp) + sw $t3, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # local_equal_at_Complex_internal_4 = VCALL local_equal_at_Complex_internal_3 x_value + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 52($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) + # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # local_equal_at_Complex_internal_1 = local_equal_at_Complex_internal_2 - local_equal_at_Complex_internal_4 + lw $t3, -12($fp) + lw $t4, -20($fp) + sub $t3, $t3, $t4 + sw $t3, -8($fp) + # IF_ZERO local_equal_at_Complex_internal_1 GOTO label_TRUE_25 + # IF_ZERO local_equal_at_Complex_internal_1 GOTO label_TRUE_25 + lw $t3, -8($fp) + beq $t3, 0, label_TRUE_25 + # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) + # local_equal_at_Complex_internal_1 = 0 + li $t3, 0 + sw $t3, -8($fp) + # GOTO label_END_26 +j label_END_26 +label_TRUE_25: + # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) + # local_equal_at_Complex_internal_1 = 1 + li $t3, 1 + sw $t3, -8($fp) + label_END_26: +# IF_ZERO local_equal_at_Complex_internal_1 GOTO label_FALSEIF_23 +# IF_ZERO local_equal_at_Complex_internal_1 GOTO label_FALSEIF_23 +lw $t3, -8($fp) +beq $t3, 0, label_FALSEIF_23 +# local_equal_at_Complex_internal_7 = GETATTRIBUTE y Complex +# LOCAL local_equal_at_Complex_internal_7 --> -32($fp) +lw $t3, 16($s1) +sw $t3, -32($fp) +# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) +# PARAM param_equal_at_Complex_d_0 --> 0($fp) +# local_equal_at_Complex_internal_8 = PARAM param_equal_at_Complex_d_0 +lw $t3, 0($fp) +sw $t3, -36($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) +# LOCAL local_equal_at_Complex_internal_9 --> -40($fp) +# local_equal_at_Complex_internal_9 = VCALL local_equal_at_Complex_internal_8 y_value +# Save new self pointer in $s1 +lw $s1, -36($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 56($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -40($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_equal_at_Complex_internal_6 --> -28($fp) +# LOCAL local_equal_at_Complex_internal_7 --> -32($fp) +# LOCAL local_equal_at_Complex_internal_9 --> -40($fp) +# local_equal_at_Complex_internal_6 = local_equal_at_Complex_internal_7 - local_equal_at_Complex_internal_9 +lw $t3, -32($fp) +lw $t4, -40($fp) +sub $t3, $t3, $t4 +sw $t3, -28($fp) +# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_TRUE_29 +# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_TRUE_29 +lw $t3, -28($fp) +beq $t3, 0, label_TRUE_29 +# LOCAL local_equal_at_Complex_internal_6 --> -28($fp) +# local_equal_at_Complex_internal_6 = 0 +li $t3, 0 +sw $t3, -28($fp) +# GOTO label_END_30 +j label_END_30 +label_TRUE_29: + # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) + # local_equal_at_Complex_internal_6 = 1 + li $t3, 1 + sw $t3, -28($fp) + label_END_30: +# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSEIF_27 +# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSEIF_27 +lw $t3, -28($fp) +beq $t3, 0, label_FALSEIF_27 +# LOCAL local_equal_at_Complex_internal_10 --> -44($fp) +# local_equal_at_Complex_internal_10 = 1 +li $t3, 1 +sw $t3, -44($fp) +# LOCAL local_equal_at_Complex_internal_5 --> -24($fp) +# LOCAL local_equal_at_Complex_internal_10 --> -44($fp) +# local_equal_at_Complex_internal_5 = local_equal_at_Complex_internal_10 +lw $t3, -44($fp) +sw $t3, -24($fp) +# GOTO label_ENDIF_28 +j label_ENDIF_28 +label_FALSEIF_27: + # LOCAL local_equal_at_Complex_internal_11 --> -48($fp) + # local_equal_at_Complex_internal_11 = 0 + li $t3, 0 + sw $t3, -48($fp) + # LOCAL local_equal_at_Complex_internal_5 --> -24($fp) + # LOCAL local_equal_at_Complex_internal_11 --> -48($fp) + # local_equal_at_Complex_internal_5 = local_equal_at_Complex_internal_11 + lw $t3, -48($fp) + sw $t3, -24($fp) + label_ENDIF_28: +# LOCAL local_equal_at_Complex_internal_0 --> -4($fp) +# LOCAL local_equal_at_Complex_internal_5 --> -24($fp) +# local_equal_at_Complex_internal_0 = local_equal_at_Complex_internal_5 +lw $t3, -24($fp) +sw $t3, -4($fp) +# GOTO label_ENDIF_24 +j label_ENDIF_24 +label_FALSEIF_23: + # LOCAL local_equal_at_Complex_internal_12 --> -52($fp) + # local_equal_at_Complex_internal_12 = 0 + li $t3, 0 + sw $t3, -52($fp) + # LOCAL local_equal_at_Complex_internal_0 --> -4($fp) + # LOCAL local_equal_at_Complex_internal_12 --> -52($fp) + # local_equal_at_Complex_internal_0 = local_equal_at_Complex_internal_12 + lw $t3, -52($fp) + sw $t3, -4($fp) + label_ENDIF_24: +# RETURN local_equal_at_Complex_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_equal_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 60 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_x_value_at_Complex implementation. +# @Params: +function_x_value_at_Complex: + # Allocate stack frame for function function_x_value_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_x_value_at_Complex_internal_0 = GETATTRIBUTE x Complex + # LOCAL local_x_value_at_Complex_internal_0 --> -4($fp) + lw $t3, 12($s1) + sw $t3, -4($fp) + # RETURN local_x_value_at_Complex_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_x_value_at_Complex. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_y_value_at_Complex implementation. +# @Params: +function_y_value_at_Complex: + # Allocate stack frame for function function_y_value_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_y_value_at_Complex_internal_0 = GETATTRIBUTE y Complex + # LOCAL local_y_value_at_Complex_internal_0 --> -4($fp) + lw $t3, 16($s1) + sw $t3, -4($fp) + # RETURN local_y_value_at_Complex_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_y_value_at_Complex. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/codegen/palindrome.mips b/tests/codegen/palindrome.mips new file mode 100644 index 00000000..0cfba4e2 --- /dev/null +++ b/tests/codegen/palindrome.mips @@ -0,0 +1,1303 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:25 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_pal_at_Main, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "enter a string\n" +# + + +data_5: .asciiz "that was a palindrome\n" +# + + +data_6: .asciiz "that was not a palindrome\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__i__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 32($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__i__init implementation. +# @Params: +__Main__attrib__i__init: + # Allocate stack frame for function __Main__attrib__i__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__i__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_pal_at_Main implementation. +# @Params: +# 0($fp) = param_pal_at_Main_s_0 +function_pal_at_Main: + # Allocate stack frame for function function_pal_at_Main. + subu $sp, $sp, 120 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 120 + # LOCAL local_pal_at_Main_internal_2 --> -12($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_2 = PARAM param_pal_at_Main_s_0 + lw $t1, 0($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_2 --> -12($fp) + # LOCAL local_pal_at_Main_internal_3 --> -16($fp) + # local_pal_at_Main_internal_3 = VCALL local_pal_at_Main_internal_2 length + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 20($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_1 --> -8($fp) + # LOCAL local_pal_at_Main_internal_3 --> -16($fp) + # local_pal_at_Main_internal_1 = local_pal_at_Main_internal_3 - 0 + lw $t1, -16($fp) + sub $t1, $t1, 0 + sw $t1, -8($fp) + # IF_ZERO local_pal_at_Main_internal_1 GOTO label_TRUE_3 + # IF_ZERO local_pal_at_Main_internal_1 GOTO label_TRUE_3 + lw $t1, -8($fp) + beq $t1, 0, label_TRUE_3 + # LOCAL local_pal_at_Main_internal_1 --> -8($fp) + # local_pal_at_Main_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # GOTO label_END_4 +j label_END_4 +label_TRUE_3: + # LOCAL local_pal_at_Main_internal_1 --> -8($fp) + # local_pal_at_Main_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + label_END_4: +# IF_ZERO local_pal_at_Main_internal_1 GOTO label_FALSEIF_1 +# IF_ZERO local_pal_at_Main_internal_1 GOTO label_FALSEIF_1 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_1 +# LOCAL local_pal_at_Main_internal_4 --> -20($fp) +# local_pal_at_Main_internal_4 = 1 +li $t1, 1 +sw $t1, -20($fp) +# LOCAL local_pal_at_Main_internal_0 --> -4($fp) +# LOCAL local_pal_at_Main_internal_4 --> -20($fp) +# local_pal_at_Main_internal_0 = local_pal_at_Main_internal_4 +lw $t1, -20($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_pal_at_Main_internal_7 --> -32($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_7 = PARAM param_pal_at_Main_s_0 + lw $t1, 0($fp) + sw $t1, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_7 --> -32($fp) + # LOCAL local_pal_at_Main_internal_8 --> -36($fp) + # local_pal_at_Main_internal_8 = VCALL local_pal_at_Main_internal_7 length + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 20($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + # LOCAL local_pal_at_Main_internal_8 --> -36($fp) + # local_pal_at_Main_internal_6 = local_pal_at_Main_internal_8 - 1 + lw $t1, -36($fp) + sub $t1, $t1, 1 + sw $t1, -28($fp) + # IF_ZERO local_pal_at_Main_internal_6 GOTO label_TRUE_7 + # IF_ZERO local_pal_at_Main_internal_6 GOTO label_TRUE_7 + lw $t1, -28($fp) + beq $t1, 0, label_TRUE_7 + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + # local_pal_at_Main_internal_6 = 0 + li $t1, 0 + sw $t1, -28($fp) + # GOTO label_END_8 +j label_END_8 +label_TRUE_7: + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + # local_pal_at_Main_internal_6 = 1 + li $t1, 1 + sw $t1, -28($fp) + label_END_8: +# IF_ZERO local_pal_at_Main_internal_6 GOTO label_FALSEIF_5 +# IF_ZERO local_pal_at_Main_internal_6 GOTO label_FALSEIF_5 +lw $t1, -28($fp) +beq $t1, 0, label_FALSEIF_5 +# LOCAL local_pal_at_Main_internal_9 --> -40($fp) +# local_pal_at_Main_internal_9 = 1 +li $t1, 1 +sw $t1, -40($fp) +# LOCAL local_pal_at_Main_internal_5 --> -24($fp) +# LOCAL local_pal_at_Main_internal_9 --> -40($fp) +# local_pal_at_Main_internal_5 = local_pal_at_Main_internal_9 +lw $t1, -40($fp) +sw $t1, -24($fp) +# GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # LOCAL local_pal_at_Main_internal_12 --> -52($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_12 = PARAM param_pal_at_Main_s_0 + lw $t1, 0($fp) + sw $t1, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 0 + li $t1, 0 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # ARG 1 + li $t1, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_pal_at_Main_internal_12 --> -52($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # local_pal_at_Main_internal_13 = VCALL local_pal_at_Main_internal_12 substr + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 16($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_14 --> -60($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_14 = PARAM param_pal_at_Main_s_0 + lw $t1, 0($fp) + sw $t1, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_17 --> -72($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_17 = PARAM param_pal_at_Main_s_0 + lw $t1, 0($fp) + sw $t1, -72($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_17 --> -72($fp) + # LOCAL local_pal_at_Main_internal_18 --> -76($fp) + # local_pal_at_Main_internal_18 = VCALL local_pal_at_Main_internal_17 length + # Save new self pointer in $s1 + lw $s1, -72($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 20($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -76($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_16 --> -68($fp) + # LOCAL local_pal_at_Main_internal_18 --> -76($fp) + # local_pal_at_Main_internal_16 = local_pal_at_Main_internal_18 - 1 + lw $t1, -76($fp) + sub $t1, $t1, 1 + sw $t1, -68($fp) + # ARG local_pal_at_Main_internal_16 + # LOCAL local_pal_at_Main_internal_16 --> -68($fp) + lw $t1, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # ARG 1 + li $t1, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_pal_at_Main_internal_14 --> -60($fp) + # LOCAL local_pal_at_Main_internal_15 --> -64($fp) + # local_pal_at_Main_internal_15 = VCALL local_pal_at_Main_internal_14 substr + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 16($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # LOCAL local_pal_at_Main_internal_15 --> -64($fp) + # local_pal_at_Main_internal_11 = local_pal_at_Main_internal_13 - local_pal_at_Main_internal_15 + lw $t1, -56($fp) + lw $t2, -64($fp) + sub $t1, $t1, $t2 + sw $t1, -48($fp) + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_11 + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_11 + lw $t1, -48($fp) + beq $t1, 0, label_TRUE_11 + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # local_pal_at_Main_internal_11 = 0 + li $t1, 0 + sw $t1, -48($fp) + # GOTO label_END_12 +j label_END_12 +label_TRUE_11: + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # local_pal_at_Main_internal_11 = 1 + li $t1, 1 + sw $t1, -48($fp) + label_END_12: +# IF_ZERO local_pal_at_Main_internal_11 GOTO label_FALSEIF_9 +# IF_ZERO local_pal_at_Main_internal_11 GOTO label_FALSEIF_9 +lw $t1, -48($fp) +beq $t1, 0, label_FALSEIF_9 +# LOCAL local_pal_at_Main_internal_21 --> -88($fp) +# local_pal_at_Main_internal_21 = SELF +sw $s1, -88($fp) +# LOCAL local_pal_at_Main_internal_19 --> -80($fp) +# LOCAL local_pal_at_Main_internal_21 --> -88($fp) +# local_pal_at_Main_internal_19 = local_pal_at_Main_internal_21 +lw $t1, -88($fp) +sw $t1, -80($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_pal_at_Main_internal_22 --> -92($fp) +# PARAM param_pal_at_Main_s_0 --> 0($fp) +# local_pal_at_Main_internal_22 = PARAM param_pal_at_Main_s_0 +lw $t1, 0($fp) +sw $t1, -92($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG 1 +li $t1, 1 +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_pal_at_Main_internal_25 --> -104($fp) +# PARAM param_pal_at_Main_s_0 --> 0($fp) +# local_pal_at_Main_internal_25 = PARAM param_pal_at_Main_s_0 +lw $t1, 0($fp) +sw $t1, -104($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_pal_at_Main_internal_25 --> -104($fp) +# LOCAL local_pal_at_Main_internal_26 --> -108($fp) +# local_pal_at_Main_internal_26 = VCALL local_pal_at_Main_internal_25 length +# Save new self pointer in $s1 +lw $s1, -104($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 20($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -108($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_pal_at_Main_internal_24 --> -100($fp) +# LOCAL local_pal_at_Main_internal_26 --> -108($fp) +# local_pal_at_Main_internal_24 = local_pal_at_Main_internal_26 - 2 +lw $t1, -108($fp) +sub $t1, $t1, 2 +sw $t1, -100($fp) +# ARG local_pal_at_Main_internal_24 +# LOCAL local_pal_at_Main_internal_24 --> -100($fp) +lw $t1, -100($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_pal_at_Main_internal_22 --> -92($fp) +# LOCAL local_pal_at_Main_internal_23 --> -96($fp) +# local_pal_at_Main_internal_23 = VCALL local_pal_at_Main_internal_22 substr +# Save new self pointer in $s1 +lw $s1, -92($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 16($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -96($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_pal_at_Main_internal_23 +# LOCAL local_pal_at_Main_internal_23 --> -96($fp) +lw $t1, -96($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_pal_at_Main_internal_19 --> -80($fp) +# LOCAL local_pal_at_Main_internal_20 --> -84($fp) +# local_pal_at_Main_internal_20 = VCALL local_pal_at_Main_internal_19 pal +# Save new self pointer in $s1 +lw $s1, -80($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 28($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -84($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_pal_at_Main_internal_10 --> -44($fp) +# LOCAL local_pal_at_Main_internal_20 --> -84($fp) +# local_pal_at_Main_internal_10 = local_pal_at_Main_internal_20 +lw $t1, -84($fp) +sw $t1, -44($fp) +# GOTO label_ENDIF_10 +j label_ENDIF_10 +label_FALSEIF_9: + # LOCAL local_pal_at_Main_internal_27 --> -112($fp) + # local_pal_at_Main_internal_27 = 0 + li $t1, 0 + sw $t1, -112($fp) + # LOCAL local_pal_at_Main_internal_10 --> -44($fp) + # LOCAL local_pal_at_Main_internal_27 --> -112($fp) + # local_pal_at_Main_internal_10 = local_pal_at_Main_internal_27 + lw $t1, -112($fp) + sw $t1, -44($fp) + label_ENDIF_10: +# LOCAL local_pal_at_Main_internal_5 --> -24($fp) +# LOCAL local_pal_at_Main_internal_10 --> -44($fp) +# local_pal_at_Main_internal_5 = local_pal_at_Main_internal_10 +lw $t1, -44($fp) +sw $t1, -24($fp) +label_ENDIF_6: +# LOCAL local_pal_at_Main_internal_0 --> -4($fp) +# LOCAL local_pal_at_Main_internal_5 --> -24($fp) +# local_pal_at_Main_internal_0 = local_pal_at_Main_internal_5 +lw $t1, -24($fp) +sw $t1, -4($fp) +label_ENDIF_2: +# RETURN local_pal_at_Main_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_pal_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 120 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + li $t1, 1 + not $t1, $t1 + sw $t1, -4($fp) + # + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + lw $t1, -4($fp) + sw $t1, 12($s1) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t1, -16($fp) + sw $t1, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_4 + sw $t1, 12($v0) + li $t1, 15 + sw $t1, 16($v0) + sw $v0, -20($fp) + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t1, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 out_string + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 + lw $t1, -36($fp) + sw $t1, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 + lw $t1, -48($fp) + sw $t1, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 in_string + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 20($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_10 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + lw $t1, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 pal + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 28($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # IF_ZERO local_main_at_Main_internal_7 GOTO label_FALSEIF_13 + # IF_ZERO local_main_at_Main_internal_7 GOTO label_FALSEIF_13 + lw $t1, -32($fp) + beq $t1, 0, label_FALSEIF_13 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 + lw $t1, -60($fp) + sw $t1, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_5 + sw $t1, 12($v0) + li $t1, 22 + sw $t1, 16($v0) + sw $v0, -64($fp) + # ARG local_main_at_Main_internal_15 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + lw $t1, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_5 = local_main_at_Main_internal_13 + lw $t1, -56($fp) + sw $t1, -24($fp) + # GOTO label_ENDIF_14 +j label_ENDIF_14 +label_FALSEIF_13: + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 + lw $t1, -76($fp) + sw $t1, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_6 + sw $t1, 12($v0) + li $t1, 26 + sw $t1, 16($v0) + sw $v0, -80($fp) + # ARG local_main_at_Main_internal_19 + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + lw $t1, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_5 = local_main_at_Main_internal_17 + lw $t1, -72($fp) + sw $t1, -24($fp) + label_ENDIF_14: +# RETURN local_main_at_Main_internal_5 +lw $v0, -24($fp) +# Deallocate stack frame for function function_main_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +jr $ra +# Function END + diff --git a/tests/codegen/primes.mips b/tests/codegen/primes.mips new file mode 100644 index 00000000..e9e6ef27 --- /dev/null +++ b/tests/codegen/primes.mips @@ -0,0 +1,1306 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:22 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "2 is trivially prime.\n" +# + + +data_5: .asciiz " is prime.\n" +# + + +data_6: .asciiz "halt" +# + + +data_7: .asciiz "continue" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 32 bytes of memory + li $a0, 32 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__out__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__testee__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__divisor__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__stop__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__m__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 28($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__out__init implementation. +# @Params: +__Main__attrib__out__init: + # Allocate stack frame for function __Main__attrib__out__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__out__init_internal_2 --> -12($fp) + # local_ttrib__out__init_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_ttrib__out__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__out__init_internal_2 --> -12($fp) + # local_ttrib__out__init_internal_0 = local_ttrib__out__init_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__out__init_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_4 + sw $t1, 12($v0) + li $t1, 22 + sw $t1, 16($v0) + sw $v0, -16($fp) + # ARG local_ttrib__out__init_internal_3 + # LOCAL local_ttrib__out__init_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + # LOCAL local_ttrib__out__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__out__init_internal_1 --> -8($fp) + # local_ttrib__out__init_internal_1 = VCALL local_ttrib__out__init_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 12($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN 2 + li $v0, 2 + # Deallocate stack frame for function __Main__attrib__out__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__testee__init implementation. +# @Params: +__Main__attrib__testee__init: + # Allocate stack frame for function __Main__attrib__testee__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_ttrib__testee__init_internal_0 = GETATTRIBUTE out Main + # LOCAL local_ttrib__testee__init_internal_0 --> -4($fp) + lw $t1, 12($s1) + sw $t1, -4($fp) + # RETURN local_ttrib__testee__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__testee__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__divisor__init implementation. +# @Params: +__Main__attrib__divisor__init: + # Allocate stack frame for function __Main__attrib__divisor__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__divisor__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__stop__init implementation. +# @Params: +__Main__attrib__stop__init: + # Allocate stack frame for function __Main__attrib__stop__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 500 + li $v0, 500 + # Deallocate stack frame for function __Main__attrib__stop__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__m__init implementation. +# @Params: +__Main__attrib__m__init: + # Allocate stack frame for function __Main__attrib__m__init. + subu $sp, $sp, 192 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 192 + label_WHILE_1: + # LOCAL local_ttrib__m__init_internal_0 --> -4($fp) + # local_ttrib__m__init_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + # IF_ZERO local_ttrib__m__init_internal_0 GOTO label_WHILE_END_2 + # IF_ZERO local_ttrib__m__init_internal_0 GOTO label_WHILE_END_2 + lw $t1, -4($fp) + beq $t1, 0, label_WHILE_END_2 + # local_ttrib__m__init_internal_2 = GETATTRIBUTE testee Main + # LOCAL local_ttrib__m__init_internal_2 --> -12($fp) + lw $t1, 16($s1) + sw $t1, -12($fp) + # LOCAL local_ttrib__m__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__m__init_internal_2 --> -12($fp) + # local_ttrib__m__init_internal_1 = local_ttrib__m__init_internal_2 + 1 + lw $t1, -12($fp) + add $t1, $t1, 1 + sw $t1, -8($fp) + # + # LOCAL local_ttrib__m__init_internal_1 --> -8($fp) + lw $t1, -8($fp) + sw $t1, 16($s1) + # + li $t1, 2 + sw $t1, 20($s1) + label_WHILE_3: + # local_ttrib__m__init_internal_5 = GETATTRIBUTE testee Main + # LOCAL local_ttrib__m__init_internal_5 --> -24($fp) + lw $t1, 16($s1) + sw $t1, -24($fp) + # local_ttrib__m__init_internal_7 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_7 --> -32($fp) + lw $t1, 20($s1) + sw $t1, -32($fp) + # local_ttrib__m__init_internal_8 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_8 --> -36($fp) + lw $t1, 20($s1) + sw $t1, -36($fp) + # LOCAL local_ttrib__m__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__m__init_internal_7 --> -32($fp) + # LOCAL local_ttrib__m__init_internal_8 --> -36($fp) + # local_ttrib__m__init_internal_6 = local_ttrib__m__init_internal_7 * local_ttrib__m__init_internal_8 + lw $t1, -32($fp) + lw $t2, -36($fp) + mul $t1, $t1, $t2 + sw $t1, -28($fp) + # LOCAL local_ttrib__m__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__m__init_internal_5 --> -24($fp) + # LOCAL local_ttrib__m__init_internal_6 --> -28($fp) + # local_ttrib__m__init_internal_4 = local_ttrib__m__init_internal_5 - local_ttrib__m__init_internal_6 + lw $t1, -24($fp) + lw $t2, -28($fp) + sub $t1, $t1, $t2 + sw $t1, -20($fp) + # IF_GREATER_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSE_7 + # IF_GREATER_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSE_7 + lw $t1, -20($fp) + bgt $t1, 0, label_FALSE_7 + # IF_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSE_7 + # IF_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSE_7 + lw $t1, -20($fp) + beq $t1, 0, label_FALSE_7 + # LOCAL local_ttrib__m__init_internal_4 --> -20($fp) + # local_ttrib__m__init_internal_4 = 1 + li $t1, 1 + sw $t1, -20($fp) + # GOTO label_END_8 +j label_END_8 +label_FALSE_7: + # LOCAL local_ttrib__m__init_internal_4 --> -20($fp) + # local_ttrib__m__init_internal_4 = 0 + li $t1, 0 + sw $t1, -20($fp) + label_END_8: +# IF_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSEIF_5 +# IF_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSEIF_5 +lw $t1, -20($fp) +beq $t1, 0, label_FALSEIF_5 +# LOCAL local_ttrib__m__init_internal_9 --> -40($fp) +# local_ttrib__m__init_internal_9 = 0 +li $t1, 0 +sw $t1, -40($fp) +# LOCAL local_ttrib__m__init_internal_3 --> -16($fp) +# LOCAL local_ttrib__m__init_internal_9 --> -40($fp) +# local_ttrib__m__init_internal_3 = local_ttrib__m__init_internal_9 +lw $t1, -40($fp) +sw $t1, -16($fp) +# GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # local_ttrib__m__init_internal_13 = GETATTRIBUTE testee Main + # LOCAL local_ttrib__m__init_internal_13 --> -56($fp) + lw $t1, 16($s1) + sw $t1, -56($fp) + # local_ttrib__m__init_internal_15 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_15 --> -64($fp) + lw $t1, 20($s1) + sw $t1, -64($fp) + # local_ttrib__m__init_internal_17 = GETATTRIBUTE testee Main + # LOCAL local_ttrib__m__init_internal_17 --> -72($fp) + lw $t1, 16($s1) + sw $t1, -72($fp) + # local_ttrib__m__init_internal_18 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_18 --> -76($fp) + lw $t1, 20($s1) + sw $t1, -76($fp) + # LOCAL local_ttrib__m__init_internal_16 --> -68($fp) + # LOCAL local_ttrib__m__init_internal_17 --> -72($fp) + # LOCAL local_ttrib__m__init_internal_18 --> -76($fp) + # local_ttrib__m__init_internal_16 = local_ttrib__m__init_internal_17 / local_ttrib__m__init_internal_18 + lw $t1, -72($fp) + lw $t2, -76($fp) + div $t1, $t1, $t2 + sw $t1, -68($fp) + # LOCAL local_ttrib__m__init_internal_14 --> -60($fp) + # LOCAL local_ttrib__m__init_internal_15 --> -64($fp) + # LOCAL local_ttrib__m__init_internal_16 --> -68($fp) + # local_ttrib__m__init_internal_14 = local_ttrib__m__init_internal_15 * local_ttrib__m__init_internal_16 + lw $t1, -64($fp) + lw $t2, -68($fp) + mul $t1, $t1, $t2 + sw $t1, -60($fp) + # LOCAL local_ttrib__m__init_internal_12 --> -52($fp) + # LOCAL local_ttrib__m__init_internal_13 --> -56($fp) + # LOCAL local_ttrib__m__init_internal_14 --> -60($fp) + # local_ttrib__m__init_internal_12 = local_ttrib__m__init_internal_13 - local_ttrib__m__init_internal_14 + lw $t1, -56($fp) + lw $t2, -60($fp) + sub $t1, $t1, $t2 + sw $t1, -52($fp) + # LOCAL local_ttrib__m__init_internal_11 --> -48($fp) + # LOCAL local_ttrib__m__init_internal_12 --> -52($fp) + # local_ttrib__m__init_internal_11 = local_ttrib__m__init_internal_12 - 0 + lw $t1, -52($fp) + sub $t1, $t1, 0 + sw $t1, -48($fp) + # IF_ZERO local_ttrib__m__init_internal_11 GOTO label_TRUE_11 + # IF_ZERO local_ttrib__m__init_internal_11 GOTO label_TRUE_11 + lw $t1, -48($fp) + beq $t1, 0, label_TRUE_11 + # LOCAL local_ttrib__m__init_internal_11 --> -48($fp) + # local_ttrib__m__init_internal_11 = 0 + li $t1, 0 + sw $t1, -48($fp) + # GOTO label_END_12 +j label_END_12 +label_TRUE_11: + # LOCAL local_ttrib__m__init_internal_11 --> -48($fp) + # local_ttrib__m__init_internal_11 = 1 + li $t1, 1 + sw $t1, -48($fp) + label_END_12: +# IF_ZERO local_ttrib__m__init_internal_11 GOTO label_FALSEIF_9 +# IF_ZERO local_ttrib__m__init_internal_11 GOTO label_FALSEIF_9 +lw $t1, -48($fp) +beq $t1, 0, label_FALSEIF_9 +# LOCAL local_ttrib__m__init_internal_19 --> -80($fp) +# local_ttrib__m__init_internal_19 = 0 +li $t1, 0 +sw $t1, -80($fp) +# LOCAL local_ttrib__m__init_internal_10 --> -44($fp) +# LOCAL local_ttrib__m__init_internal_19 --> -80($fp) +# local_ttrib__m__init_internal_10 = local_ttrib__m__init_internal_19 +lw $t1, -80($fp) +sw $t1, -44($fp) +# GOTO label_ENDIF_10 +j label_ENDIF_10 +label_FALSEIF_9: + # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) + # local_ttrib__m__init_internal_20 = 1 + li $t1, 1 + sw $t1, -84($fp) + # LOCAL local_ttrib__m__init_internal_10 --> -44($fp) + # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) + # local_ttrib__m__init_internal_10 = local_ttrib__m__init_internal_20 + lw $t1, -84($fp) + sw $t1, -44($fp) + label_ENDIF_10: +# LOCAL local_ttrib__m__init_internal_3 --> -16($fp) +# LOCAL local_ttrib__m__init_internal_10 --> -44($fp) +# local_ttrib__m__init_internal_3 = local_ttrib__m__init_internal_10 +lw $t1, -44($fp) +sw $t1, -16($fp) +label_ENDIF_6: +# IF_ZERO local_ttrib__m__init_internal_3 GOTO label_WHILE_END_4 +# IF_ZERO local_ttrib__m__init_internal_3 GOTO label_WHILE_END_4 +lw $t1, -16($fp) +beq $t1, 0, label_WHILE_END_4 +# local_ttrib__m__init_internal_22 = GETATTRIBUTE divisor Main +# LOCAL local_ttrib__m__init_internal_22 --> -92($fp) +lw $t1, 20($s1) +sw $t1, -92($fp) +# LOCAL local_ttrib__m__init_internal_21 --> -88($fp) +# LOCAL local_ttrib__m__init_internal_22 --> -92($fp) +# local_ttrib__m__init_internal_21 = local_ttrib__m__init_internal_22 + 1 +lw $t1, -92($fp) +add $t1, $t1, 1 +sw $t1, -88($fp) +# +# LOCAL local_ttrib__m__init_internal_21 --> -88($fp) +lw $t1, -88($fp) +sw $t1, 20($s1) +# GOTO label_WHILE_3 +j label_WHILE_3 +label_WHILE_END_4: + # local_ttrib__m__init_internal_25 = GETATTRIBUTE testee Main + # LOCAL local_ttrib__m__init_internal_25 --> -104($fp) + lw $t1, 16($s1) + sw $t1, -104($fp) + # local_ttrib__m__init_internal_27 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) + lw $t1, 20($s1) + sw $t1, -112($fp) + # local_ttrib__m__init_internal_28 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_28 --> -116($fp) + lw $t1, 20($s1) + sw $t1, -116($fp) + # LOCAL local_ttrib__m__init_internal_26 --> -108($fp) + # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) + # LOCAL local_ttrib__m__init_internal_28 --> -116($fp) + # local_ttrib__m__init_internal_26 = local_ttrib__m__init_internal_27 * local_ttrib__m__init_internal_28 + lw $t1, -112($fp) + lw $t2, -116($fp) + mul $t1, $t1, $t2 + sw $t1, -108($fp) + # LOCAL local_ttrib__m__init_internal_24 --> -100($fp) + # LOCAL local_ttrib__m__init_internal_25 --> -104($fp) + # LOCAL local_ttrib__m__init_internal_26 --> -108($fp) + # local_ttrib__m__init_internal_24 = local_ttrib__m__init_internal_25 - local_ttrib__m__init_internal_26 + lw $t1, -104($fp) + lw $t2, -108($fp) + sub $t1, $t1, $t2 + sw $t1, -100($fp) + # IF_GREATER_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSE_15 + # IF_GREATER_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSE_15 + lw $t1, -100($fp) + bgt $t1, 0, label_FALSE_15 + # IF_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSE_15 + # IF_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSE_15 + lw $t1, -100($fp) + beq $t1, 0, label_FALSE_15 + # LOCAL local_ttrib__m__init_internal_24 --> -100($fp) + # local_ttrib__m__init_internal_24 = 1 + li $t1, 1 + sw $t1, -100($fp) + # GOTO label_END_16 +j label_END_16 +label_FALSE_15: + # LOCAL local_ttrib__m__init_internal_24 --> -100($fp) + # local_ttrib__m__init_internal_24 = 0 + li $t1, 0 + sw $t1, -100($fp) + label_END_16: +# IF_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSEIF_13 +# IF_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSEIF_13 +lw $t1, -100($fp) +beq $t1, 0, label_FALSEIF_13 +# local_ttrib__m__init_internal_29 = GETATTRIBUTE testee Main +# LOCAL local_ttrib__m__init_internal_29 --> -120($fp) +lw $t1, 16($s1) +sw $t1, -120($fp) +# +# LOCAL local_ttrib__m__init_internal_29 --> -120($fp) +lw $t1, -120($fp) +sw $t1, 12($s1) +# LOCAL local_ttrib__m__init_internal_32 --> -132($fp) +# local_ttrib__m__init_internal_32 = SELF +sw $s1, -132($fp) +# LOCAL local_ttrib__m__init_internal_30 --> -124($fp) +# LOCAL local_ttrib__m__init_internal_32 --> -132($fp) +# local_ttrib__m__init_internal_30 = local_ttrib__m__init_internal_32 +lw $t1, -132($fp) +sw $t1, -124($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_ttrib__m__init_internal_33 = GETATTRIBUTE out Main +# LOCAL local_ttrib__m__init_internal_33 --> -136($fp) +lw $t1, 12($s1) +sw $t1, -136($fp) +# ARG local_ttrib__m__init_internal_33 +# LOCAL local_ttrib__m__init_internal_33 --> -136($fp) +lw $t1, -136($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_ttrib__m__init_internal_30 --> -124($fp) +# LOCAL local_ttrib__m__init_internal_31 --> -128($fp) +# local_ttrib__m__init_internal_31 = VCALL local_ttrib__m__init_internal_30 out_int +# Save new self pointer in $s1 +lw $s1, -124($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 16($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -128($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_ttrib__m__init_internal_36 --> -148($fp) +# local_ttrib__m__init_internal_36 = SELF +sw $s1, -148($fp) +# LOCAL local_ttrib__m__init_internal_34 --> -140($fp) +# LOCAL local_ttrib__m__init_internal_36 --> -148($fp) +# local_ttrib__m__init_internal_34 = local_ttrib__m__init_internal_36 +lw $t1, -148($fp) +sw $t1, -140($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_ttrib__m__init_internal_37 --> -152($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_5 +sw $t1, 12($v0) +li $t1, 11 +sw $t1, 16($v0) +sw $v0, -152($fp) +# ARG local_ttrib__m__init_internal_37 +# LOCAL local_ttrib__m__init_internal_37 --> -152($fp) +lw $t1, -152($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_ttrib__m__init_internal_34 --> -140($fp) +# LOCAL local_ttrib__m__init_internal_35 --> -144($fp) +# local_ttrib__m__init_internal_35 = VCALL local_ttrib__m__init_internal_34 out_string +# Save new self pointer in $s1 +lw $s1, -140($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 12($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -144($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_ttrib__m__init_internal_23 --> -96($fp) +# LOCAL local_ttrib__m__init_internal_35 --> -144($fp) +# local_ttrib__m__init_internal_23 = local_ttrib__m__init_internal_35 +lw $t1, -144($fp) +sw $t1, -96($fp) +# GOTO label_ENDIF_14 +j label_ENDIF_14 +label_FALSEIF_13: + # LOCAL local_ttrib__m__init_internal_23 --> -96($fp) + # local_ttrib__m__init_internal_23 = 0 + li $t1, 0 + sw $t1, -96($fp) + label_ENDIF_14: +# local_ttrib__m__init_internal_40 = GETATTRIBUTE stop Main +# LOCAL local_ttrib__m__init_internal_40 --> -164($fp) +lw $t1, 24($s1) +sw $t1, -164($fp) +# local_ttrib__m__init_internal_41 = GETATTRIBUTE testee Main +# LOCAL local_ttrib__m__init_internal_41 --> -168($fp) +lw $t1, 16($s1) +sw $t1, -168($fp) +# LOCAL local_ttrib__m__init_internal_39 --> -160($fp) +# LOCAL local_ttrib__m__init_internal_40 --> -164($fp) +# LOCAL local_ttrib__m__init_internal_41 --> -168($fp) +# local_ttrib__m__init_internal_39 = local_ttrib__m__init_internal_40 - local_ttrib__m__init_internal_41 +lw $t1, -164($fp) +lw $t2, -168($fp) +sub $t1, $t1, $t2 +sw $t1, -160($fp) +# IF_GREATER_ZERO local_ttrib__m__init_internal_39 GOTO label_FALSE_19 +# IF_GREATER_ZERO local_ttrib__m__init_internal_39 GOTO label_FALSE_19 +lw $t1, -160($fp) +bgt $t1, 0, label_FALSE_19 +# LOCAL local_ttrib__m__init_internal_39 --> -160($fp) +# local_ttrib__m__init_internal_39 = 1 +li $t1, 1 +sw $t1, -160($fp) +# GOTO label_END_20 +j label_END_20 +label_FALSE_19: + # LOCAL local_ttrib__m__init_internal_39 --> -160($fp) + # local_ttrib__m__init_internal_39 = 0 + li $t1, 0 + sw $t1, -160($fp) + label_END_20: +# IF_ZERO local_ttrib__m__init_internal_39 GOTO label_FALSEIF_17 +# IF_ZERO local_ttrib__m__init_internal_39 GOTO label_FALSEIF_17 +lw $t1, -160($fp) +beq $t1, 0, label_FALSEIF_17 +# LOCAL local_ttrib__m__init_internal_44 --> -180($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, data_6 +sw $t1, 12($v0) +li $t1, 4 +sw $t1, 16($v0) +sw $v0, -180($fp) +# LOCAL local_ttrib__m__init_internal_42 --> -172($fp) +# LOCAL local_ttrib__m__init_internal_44 --> -180($fp) +# local_ttrib__m__init_internal_42 = local_ttrib__m__init_internal_44 +lw $t1, -180($fp) +sw $t1, -172($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_ttrib__m__init_internal_42 --> -172($fp) +# LOCAL local_ttrib__m__init_internal_43 --> -176($fp) +# local_ttrib__m__init_internal_43 = VCALL local_ttrib__m__init_internal_42 abort +# Save new self pointer in $s1 +lw $s1, -172($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 0($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -176($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_ttrib__m__init_internal_38 --> -156($fp) +# LOCAL local_ttrib__m__init_internal_43 --> -176($fp) +# local_ttrib__m__init_internal_38 = local_ttrib__m__init_internal_43 +lw $t1, -176($fp) +sw $t1, -156($fp) +# GOTO label_ENDIF_18 +j label_ENDIF_18 +label_FALSEIF_17: + # LOCAL local_ttrib__m__init_internal_45 --> -184($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_7 + sw $t1, 12($v0) + li $t1, 8 + sw $t1, 16($v0) + sw $v0, -184($fp) + # LOCAL local_ttrib__m__init_internal_38 --> -156($fp) + # LOCAL local_ttrib__m__init_internal_45 --> -184($fp) + # local_ttrib__m__init_internal_38 = local_ttrib__m__init_internal_45 + lw $t1, -184($fp) + sw $t1, -156($fp) + label_ENDIF_18: +# GOTO label_WHILE_1 +j label_WHILE_1 +label_WHILE_END_2: + # RETURN + # Deallocate stack frame for function __Main__attrib__m__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 192 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/codegen/print-cool.mips b/tests/codegen/print-cool.mips new file mode 100644 index 00000000..640c7c1d --- /dev/null +++ b/tests/codegen/print-cool.mips @@ -0,0 +1,953 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:23 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 28($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 + lw $t1, -20($fp) + sw $t1, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = ALLOCATE Object + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Object + sw $t3, 12($v0) + li $t3, 6 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Object_start + sw $t3, 4($v0) + # Load type offset + li $t3, 4 + sw $t3, 8($v0) + move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t2, -40($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 + lw $t2, -40($fp) + sw $t2, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 type_name + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 4($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_5 = local_main_at_Main_internal_8 + lw $t2, -36($fp) + sw $t2, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG 4 + li $t2, 4 + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # ARG 1 + li $t2, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_6 = VCALL local_main_at_Main_internal_5 substr + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 16($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_6 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + lw $t2, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 12($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 + lw $t2, -16($fp) + sw $t2, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = SELF + sw $s1, -64($fp) + # IF_ZERO local_main_at_Main_internal_15 GOTO label_TRUE_1 + # IF_ZERO local_main_at_Main_internal_15 GOTO label_TRUE_1 + lw $t2, -64($fp) + beq $t2, 0, label_TRUE_1 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Bool + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Bool_start + sw $t2, 4($v0) + li $t2, 0 + sw $t2, 8($v0) + sw $v0, -60($fp) + # GOTO label_END_2 +j label_END_2 +label_TRUE_1: + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Bool + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Bool_start + sw $t2, 4($v0) + li $t2, 1 + sw $t2, 8($v0) + sw $v0, -60($fp) + label_END_2: +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 +lw $t2, -60($fp) +sw $t2, -52($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 type_name +# Save new self pointer in $s1 +lw $s1, -52($fp) +# Get pointer to type +lw $t2, 4($s1) +# Get pointer to type's VTABLE +lw $t3, 0($t2) +# Get pointer to function address +lw $t4, 4($t3) +# Call function. Result is on $v0 +jalr $t4 +sw $v0, -56($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_10 --> -44($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_10 = local_main_at_Main_internal_13 +lw $t2, -56($fp) +sw $t2, -44($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG 1 +li $t2, 1 +# Push arg into stack +subu $sp, $sp, 4 +sw $t2, 0($sp) +# ARG 3 +li $t2, 3 +# Push arg into stack +subu $sp, $sp, 4 +sw $t2, 0($sp) +# LOCAL local_main_at_Main_internal_10 --> -44($fp) +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +# local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 substr +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t2, 4($s1) +# Get pointer to type's VTABLE +lw $t3, 0($t2) +# Get pointer to function address +lw $t4, 16($t3) +# Call function. Result is on $v0 +jalr $t4 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_11 +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +lw $t2, -48($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t2, 0($sp) +# LOCAL local_main_at_Main_internal_0 --> -4($fp) +# LOCAL local_main_at_Main_internal_1 --> -8($fp) +# local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string +# Save new self pointer in $s1 +lw $s1, -4($fp) +# Get pointer to type +lw $t2, 4($s1) +# Get pointer to type's VTABLE +lw $t3, 0($t2) +# Get pointer to function address +lw $t4, 12($t3) +# Call function. Result is on $v0 +jalr $t4 +sw $v0, -8($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# local_main_at_Main_internal_18 = SELF +sw $s1, -76($fp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# local_main_at_Main_internal_16 = local_main_at_Main_internal_18 +lw $t2, -76($fp) +sw $t2, -68($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t2, String +sw $t2, 0($v0) +la $t2, String_start +sw $t2, 4($v0) +# Load type offset +li $t2, 8 +sw $t2, 8($v0) +la $t2, data_4 +sw $t2, 12($v0) +li $t2, 1 +sw $t2, 16($v0) +sw $v0, -80($fp) +# ARG local_main_at_Main_internal_19 +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +lw $t2, -80($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t2, 0($sp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +# local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string +# Save new self pointer in $s1 +lw $s1, -68($fp) +# Get pointer to type +lw $t2, 4($s1) +# Get pointer to type's VTABLE +lw $t3, 0($t2) +# Get pointer to function address +lw $t4, 12($t3) +# Call function. Result is on $v0 +jalr $t4 +sw $v0, -72($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# RETURN local_main_at_Main_internal_17 +lw $v0, -72($fp) +# Deallocate stack frame for function function_main_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +jr $ra +# Function END + From 68185c349f566d8d59ba7529b3f1bc216912de33 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sun, 6 Dec 2020 17:43:00 -0500 Subject: [PATCH 151/162] Fix Allocate not initializing inherited attributes --- src/testing.mips | 3033 +++++++++++++++++++++++++- src/travels/ctcill.py | 72 +- src/travels/inference.py | 8 +- tests/codegen/hairyscary.mips | 3722 +++++++++++++++++--------------- tests/codegen/hello_world.mips | 4 +- tests/codegen/new_complex.mips | 2558 +++++++++++----------- tests/codegen/primes.mips | 4 +- tests/codegen/print-cool.mips | 4 +- 8 files changed, 6394 insertions(+), 3011 deletions(-) diff --git a/src/testing.mips b/src/testing.mips index 63a65fc0..dff2e900 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1 +1,3032 @@ -['Main', 'Bazz', 'Foo', 'Razz', 'Bar'] + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 17:41:46 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Main: .asciiz "Main" +# Function END +Bazz: .asciiz "Bazz" +# Function END +Foo: .asciiz "Foo" +# Function END +Razz: .asciiz "Razz" +# Function END +Bar: .asciiz "Bar" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +# **** VTABLE for type Bazz **** +Bazz_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_printh_at_Bazz, function_doh_at_Bazz +# Function END +# + + +# **** Type RECORD for type Bazz **** +Bazz_start: + Bazz_vtable_pointer: .word Bazz_vtable + # Function END +Bazz_end: +# + + +# **** VTABLE for type Foo **** +Foo_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_printh_at_Bazz, function_doh_at_Foo +# Function END +# + + +# **** Type RECORD for type Foo **** +Foo_start: + Foo_vtable_pointer: .word Foo_vtable + # Function END +Foo_end: +# + + +# **** VTABLE for type Razz **** +Razz_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_printh_at_Bazz, function_doh_at_Foo +# Function END +# + + +# **** Type RECORD for type Razz **** +Razz_start: + Razz_vtable_pointer: .word Razz_vtable + # Function END +Razz_end: +# + + +# **** VTABLE for type Bar **** +Bar_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_printh_at_Bazz, function_doh_at_Foo +# Function END +# + + +# **** Type RECORD for type Bar **** +Bar_start: + Bar_vtable_pointer: .word Bar_vtable + # Function END +Bar_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, 1, 2, 3, 4 +Object__TDT: .word 1, 0, 1, 1, 1, 2, 3, 4, 5 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1 +Main__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1 +Bazz__TDT: .word -1, -1, -1, -1, -1, 0, 1, 2, 3 +Foo__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 2 +Razz__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, 1 +Bar__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "do nothing" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 28 bytes of memory + li $a0, 28 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__a__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__b__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__c__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__d__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 12($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__a__init implementation. +# @Params: +__Main__attrib__a__init: + # Allocate stack frame for function __Main__attrib__a__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__a__init_internal_0 --> -4($fp) + # local_ttrib__a__init_internal_0 = ALLOCATE Bazz + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Bazz + sw $t3, 12($v0) + li $t3, 4 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 24 bytes of memory + li $a0, 24 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Bazz_start + sw $t3, 4($v0) + # Load type offset + li $t3, 20 + sw $t3, 8($v0) + move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t2) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t2, -4($fp) + # RETURN local_ttrib__a__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__a__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__b__init implementation. +# @Params: +__Main__attrib__b__init: + # Allocate stack frame for function __Main__attrib__b__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__b__init_internal_0 --> -4($fp) + # local_ttrib__b__init_internal_0 = ALLOCATE Foo + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Foo + sw $t4, 12($v0) + li $t4, 3 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 32 bytes of memory + li $a0, 32 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Foo_start + sw $t4, 4($v0) + # Load type offset + li $t4, 24 + sw $t4, 8($v0) + move $t3, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t3) + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t3) + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t3) + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t3) + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t3) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t3, -4($fp) + # RETURN local_ttrib__b__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__b__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__c__init implementation. +# @Params: +__Main__attrib__c__init: + # Allocate stack frame for function __Main__attrib__c__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__c__init_internal_0 --> -4($fp) + # local_ttrib__c__init_internal_0 = ALLOCATE Razz + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, Razz + sw $t5, 12($v0) + li $t5, 4 + sw $t5, 16($v0) + move $t5, $v0 + # Allocating 40 bytes of memory + li $a0, 40 + li $v0, 9 + syscall + sw $t5, 0($v0) + la $t5, Razz_start + sw $t5, 4($v0) + # Load type offset + li $t5, 28 + sw $t5, 8($v0) + move $t4, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t4) + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t4) + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t4) + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t4) + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t4) + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 32($t4) + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 36($t4) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t4, -4($fp) + # RETURN local_ttrib__c__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__c__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__d__init implementation. +# @Params: +__Main__attrib__d__init: + # Allocate stack frame for function __Main__attrib__d__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__d__init_internal_0 --> -4($fp) + # local_ttrib__d__init_internal_0 = ALLOCATE Bar + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t6, String + sw $t6, 0($v0) + la $t6, String_start + sw $t6, 4($v0) + # Load type offset + li $t6, 8 + sw $t6, 8($v0) + la $t6, Bar + sw $t6, 12($v0) + li $t6, 3 + sw $t6, 16($v0) + move $t6, $v0 + # Allocating 48 bytes of memory + li $a0, 48 + li $v0, 9 + syscall + sw $t6, 0($v0) + la $t6, Bar_start + sw $t6, 4($v0) + # Load type offset + li $t6, 32 + sw $t6, 8($v0) + move $t5, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t5) + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t5) + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t5) + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t5) + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t5) + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 32($t5) + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 36($t5) + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Bar__attrib__c__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 40($t5) + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Bar__attrib__d__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 44($t5) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t5, -4($fp) + # RETURN local_ttrib__d__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__d__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, data_4 + sw $t5, 12($v0) + li $t5, 10 + sw $t5, 16($v0) + sw $v0, -4($fp) + # RETURN local_main_at_Main_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Bazz__attrib__h__init implementation. +# @Params: +__Bazz__attrib__h__init: + # Allocate stack frame for function __Bazz__attrib__h__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 1 + li $v0, 1 + # Deallocate stack frame for function __Bazz__attrib__h__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Bazz__attrib__g__init implementation. +# @Params: +__Bazz__attrib__g__init: + # Allocate stack frame for function __Bazz__attrib__g__init. + subu $sp, $sp, 56 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 56 + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + # local_ttrib__g__init_internal_0 = SELF + sw $s1, -4($fp) + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # local_ttrib__g__init_internal_1 = TYPEOF local_ttrib__g__init_internal_0 + lw $t5, -4($fp) + # Load pointer to type offset + lw $t6, 8($t5) + sw $t6, -8($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # local_ttrib__g__init_internal_3 = 13 + li $t5, 13 + sw $t5, -16($fp) + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bazz + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bazz + la $t5, Bazz__TDT + lw $t6, -8($fp) + addu $t5, $t5, $t6 + # Save distance + lw $t6, 0($t5) + sw $t6, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 13 < 14 + lw $t5, -20($fp) + lw $t6, -16($fp) + bgtu $t5, $t6, label_Not_min0_1 + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 + lw $t5, -20($fp) + sw $t5, -16($fp) + label_Not_min0_1: + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Razz + la $t5, Razz__TDT + lw $t6, -8($fp) + addu $t5, $t5, $t6 + # Save distance + lw $t6, 0($t5) + sw $t6, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 13 < 14 + lw $t5, -20($fp) + lw $t6, -16($fp) + bgtu $t5, $t6, label_Not_min1_2 + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 + lw $t5, -20($fp) + sw $t5, -16($fp) + label_Not_min1_2: + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Foo + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Foo + la $t5, Foo__TDT + lw $t6, -8($fp) + addu $t5, $t5, $t6 + # Save distance + lw $t6, 0($t5) + sw $t6, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 13 < 14 + lw $t5, -20($fp) + lw $t6, -16($fp) + bgtu $t5, $t6, label_Not_min2_3 + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 + lw $t5, -20($fp) + sw $t5, -16($fp) + label_Not_min2_3: + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bar + la $t5, Bar__TDT + lw $t6, -8($fp) + addu $t5, $t5, $t6 + # Save distance + lw $t6, 0($t5) + sw $t6, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 13 < 14 + lw $t5, -20($fp) + lw $t6, -16($fp) + bgtu $t5, $t6, label_Not_min3_4 + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 + lw $t5, -20($fp) + sw $t5, -16($fp) + label_Not_min3_4: + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_4 = 13 + li $t5, 13 + sw $t5, -20($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # local_ttrib__g__init_internal_2 = local_ttrib__g__init_internal_4 - local_ttrib__g__init_internal_3 + lw $t5, -20($fp) + lw $t6, -16($fp) + sub $t5, $t5, $t6 + sw $t5, -12($fp) + # IF_ZERO local_ttrib__g__init_internal_2 GOTO label_ERROR_5 + # IF_ZERO local_ttrib__g__init_internal_2 GOTO label_ERROR_5 + lw $t5, -12($fp) + beq $t5, 0, label_ERROR_5 + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bazz + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bazz + la $t5, Bazz__TDT + lw $t6, -8($fp) + addu $t5, $t5, $t6 + # Save distance + lw $t6, 0($t5) + sw $t6, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 13 < 14 + lw $t5, -20($fp) + lw $t6, -16($fp) + bgtu $t5, $t6, label_NEXT0_7 + # LOCAL local_ttrib__g__init_n_5 --> -24($fp) + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + # local_ttrib__g__init_n_5 = local_ttrib__g__init_internal_0 + lw $t5, -4($fp) + sw $t5, -24($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # local_ttrib__g__init_internal_6 = ALLOCATE Foo + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) + # Load type offset + li $t7, 8 + sw $t7, 8($v0) + la $t7, Foo + sw $t7, 12($v0) + li $t7, 3 + sw $t7, 16($v0) + move $t7, $v0 + # Allocating 32 bytes of memory + li $a0, 32 + li $v0, 9 + syscall + sw $t7, 0($v0) + la $t7, Foo_start + sw $t7, 4($v0) + # Load type offset + li $t7, 24 + sw $t7, 8($v0) + move $t6, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t6) + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t6) + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t6) + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t6) + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t6) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t6, -28($fp) + # GOTO label_END_6 +j label_END_6 +label_NEXT0_7: + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Razz + la $t6, Razz__TDT + lw $t7, -8($fp) + addu $t6, $t6, $t7 + # Save distance + lw $t7, 0($t6) + sw $t7, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 14 < 15 + lw $t6, -20($fp) + lw $t7, -16($fp) + bgtu $t6, $t7, label_NEXT1_8 + # LOCAL local_ttrib__g__init_n_7 --> -32($fp) + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + # local_ttrib__g__init_n_7 = local_ttrib__g__init_internal_0 + lw $t6, -4($fp) + sw $t6, -32($fp) + # LOCAL local_ttrib__g__init_internal_8 --> -36($fp) + # local_ttrib__g__init_internal_8 = ALLOCATE Bar + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t8, String + sw $t8, 0($v0) + la $t8, String_start + sw $t8, 4($v0) + # Load type offset + li $t8, 8 + sw $t8, 8($v0) + la $t8, Bar + sw $t8, 12($v0) + li $t8, 3 + sw $t8, 16($v0) + move $t8, $v0 + # Allocating 48 bytes of memory + li $a0, 48 + li $v0, 9 + syscall + sw $t8, 0($v0) + la $t8, Bar_start + sw $t8, 4($v0) + # Load type offset + li $t8, 32 + sw $t8, 8($v0) + move $t7, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 32($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 36($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Bar__attrib__c__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 40($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Bar__attrib__d__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 44($t7) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t7, -36($fp) + # GOTO label_END_6 +j label_END_6 +label_NEXT1_8: + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Foo + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Foo + la $t7, Foo__TDT + lw $t8, -8($fp) + addu $t7, $t7, $t8 + # Save distance + lw $t8, 0($t7) + sw $t8, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 15 < 24 + lw $t7, -20($fp) + lw $t8, -16($fp) + bgtu $t7, $t8, label_NEXT2_9 + # LOCAL local_ttrib__g__init_n_9 --> -40($fp) + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + # local_ttrib__g__init_n_9 = local_ttrib__g__init_internal_0 + lw $t7, -4($fp) + sw $t7, -40($fp) + # LOCAL local_ttrib__g__init_internal_10 --> -44($fp) + # local_ttrib__g__init_internal_10 = ALLOCATE Razz + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) + # Load type offset + li $t9, 8 + sw $t9, 8($v0) + la $t9, Razz + sw $t9, 12($v0) + li $t9, 4 + sw $t9, 16($v0) + move $t9, $v0 + # Allocating 40 bytes of memory + li $a0, 40 + li $v0, 9 + syscall + sw $t9, 0($v0) + la $t9, Razz_start + sw $t9, 4($v0) + # Load type offset + li $t9, 28 + sw $t9, 8($v0) + move $t8, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 32($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 36($t8) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t8, -44($fp) + # GOTO label_END_6 +j label_END_6 +label_NEXT2_9: + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bar + la $t8, Bar__TDT + lw $t9, -8($fp) + addu $t8, $t8, $t9 + # Save distance + lw $t9, 0($t8) + sw $t9, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 24 < 25 + lw $t8, -20($fp) + lw $t9, -16($fp) + bgtu $t8, $t9, label_NEXT3_10 + # LOCAL local_ttrib__g__init_n_11 --> -48($fp) + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + # local_ttrib__g__init_n_11 = local_ttrib__g__init_internal_0 + lw $t8, -4($fp) + sw $t8, -48($fp) + # GOTO label_END_6 +j label_END_6 +label_NEXT3_10: + label_ERROR_5: + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + lw $t8, 0($s1) + sw $t8, -4($fp) + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + label_END_6: +# RETURN +# Deallocate stack frame for function __Bazz__attrib__g__init. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 56 +jr $ra +# Function END + + +# __Bazz__attrib__i__init implementation. +# @Params: +__Bazz__attrib__i__init: + # Allocate stack frame for function __Bazz__attrib__i__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__i__init_internal_2 --> -12($fp) + # local_ttrib__i__init_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_ttrib__i__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__i__init_internal_2 --> -12($fp) + # local_ttrib__i__init_internal_0 = local_ttrib__i__init_internal_2 + lw $t8, -12($fp) + sw $t8, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__i__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__i__init_internal_1 --> -8($fp) + # local_ttrib__i__init_internal_1 = VCALL local_ttrib__i__init_internal_0 printh + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t8, 4($s1) + # Get pointer to type's VTABLE + lw $t9, 0($t8) + # Get pointer to function address + lw $s2, 28($t9) + # Call function. Result is on $v0 + jalr $s2 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_ttrib__i__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Bazz__attrib__i__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_printh_at_Bazz implementation. +# @Params: +function_printh_at_Bazz: + # Allocate stack frame for function function_printh_at_Bazz. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_printh_at_Bazz_internal_2 --> -12($fp) + # local_printh_at_Bazz_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_printh_at_Bazz_internal_0 --> -4($fp) + # LOCAL local_printh_at_Bazz_internal_2 --> -12($fp) + # local_printh_at_Bazz_internal_0 = local_printh_at_Bazz_internal_2 + lw $t8, -12($fp) + sw $t8, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_printh_at_Bazz_internal_3 = GETATTRIBUTE h Bazz + # LOCAL local_printh_at_Bazz_internal_3 --> -16($fp) + lw $t8, 12($s1) + sw $t8, -16($fp) + # ARG local_printh_at_Bazz_internal_3 + # LOCAL local_printh_at_Bazz_internal_3 --> -16($fp) + lw $t8, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + # LOCAL local_printh_at_Bazz_internal_0 --> -4($fp) + # LOCAL local_printh_at_Bazz_internal_1 --> -8($fp) + # local_printh_at_Bazz_internal_1 = VCALL local_printh_at_Bazz_internal_0 out_int + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t8, 4($s1) + # Get pointer to type's VTABLE + lw $t9, 0($t8) + # Get pointer to function address + lw $s2, 16($t9) + # Call function. Result is on $v0 + jalr $s2 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function function_printh_at_Bazz. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_doh_at_Bazz implementation. +# @Params: +function_doh_at_Bazz: + # Allocate stack frame for function function_doh_at_Bazz. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_doh_at_Bazz_internal_1 = GETATTRIBUTE h Bazz + # LOCAL local_doh_at_Bazz_internal_1 --> -8($fp) + lw $t8, 12($s1) + sw $t8, -8($fp) + # LOCAL local_doh_at_Bazz_i_0 --> -4($fp) + # LOCAL local_doh_at_Bazz_internal_1 --> -8($fp) + # local_doh_at_Bazz_i_0 = local_doh_at_Bazz_internal_1 + lw $t8, -8($fp) + sw $t8, -4($fp) + # local_doh_at_Bazz_internal_3 = GETATTRIBUTE h Bazz + # LOCAL local_doh_at_Bazz_internal_3 --> -16($fp) + lw $t8, 12($s1) + sw $t8, -16($fp) + # LOCAL local_doh_at_Bazz_internal_2 --> -12($fp) + # LOCAL local_doh_at_Bazz_internal_3 --> -16($fp) + # local_doh_at_Bazz_internal_2 = local_doh_at_Bazz_internal_3 + 1 + lw $t8, -16($fp) + add $t8, $t8, 1 + sw $t8, -12($fp) + # + # LOCAL local_doh_at_Bazz_internal_2 --> -12($fp) + lw $t8, -12($fp) + sw $t8, 12($s1) + # RETURN local_doh_at_Bazz_i_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_doh_at_Bazz. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Foo__attrib__a__init implementation. +# @Params: +__Foo__attrib__a__init: + # Allocate stack frame for function __Foo__attrib__a__init. + subu $sp, $sp, 48 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 48 + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + # local_trib__a__init_internal_0 = SELF + sw $s1, -4($fp) + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # local_trib__a__init_internal_1 = TYPEOF local_trib__a__init_internal_0 + lw $t8, -4($fp) + # Load pointer to type offset + lw $t9, 8($t8) + sw $t9, -8($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # local_trib__a__init_internal_3 = 13 + li $t8, 13 + sw $t8, -16($fp) + # local_trib__a__init_internal_4 = TYPE_DISTANCE Razz + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # Load TDT pointer to type Razz + la $t8, Razz__TDT + lw $t9, -8($fp) + addu $t8, $t8, $t9 + # Save distance + lw $t9, 0($t8) + sw $t9, -20($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # Update min if 24 < 25 + lw $t8, -20($fp) + lw $t9, -16($fp) + bgtu $t8, $t9, label_Not_min0_11 + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_3 = local_trib__a__init_internal_4 + lw $t8, -20($fp) + sw $t8, -16($fp) + label_Not_min0_11: + # local_trib__a__init_internal_4 = TYPE_DISTANCE Foo + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # Load TDT pointer to type Foo + la $t8, Foo__TDT + lw $t9, -8($fp) + addu $t8, $t8, $t9 + # Save distance + lw $t9, 0($t8) + sw $t9, -20($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # Update min if 24 < 25 + lw $t8, -20($fp) + lw $t9, -16($fp) + bgtu $t8, $t9, label_Not_min1_12 + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_3 = local_trib__a__init_internal_4 + lw $t8, -20($fp) + sw $t8, -16($fp) + label_Not_min1_12: + # local_trib__a__init_internal_4 = TYPE_DISTANCE Bar + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bar + la $t8, Bar__TDT + lw $t9, -8($fp) + addu $t8, $t8, $t9 + # Save distance + lw $t9, 0($t8) + sw $t9, -20($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # Update min if 24 < 25 + lw $t8, -20($fp) + lw $t9, -16($fp) + bgtu $t8, $t9, label_Not_min2_13 + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_3 = local_trib__a__init_internal_4 + lw $t8, -20($fp) + sw $t8, -16($fp) + label_Not_min2_13: + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_4 = 13 + li $t8, 13 + sw $t8, -20($fp) + # LOCAL local_trib__a__init_internal_2 --> -12($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # local_trib__a__init_internal_2 = local_trib__a__init_internal_4 - local_trib__a__init_internal_3 + lw $t8, -20($fp) + lw $t9, -16($fp) + sub $t8, $t8, $t9 + sw $t8, -12($fp) + # IF_ZERO local_trib__a__init_internal_2 GOTO label_ERROR_14 + # IF_ZERO local_trib__a__init_internal_2 GOTO label_ERROR_14 + lw $t8, -12($fp) + beq $t8, 0, label_ERROR_14 + # local_trib__a__init_internal_4 = TYPE_DISTANCE Razz + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # Load TDT pointer to type Razz + la $t8, Razz__TDT + lw $t9, -8($fp) + addu $t8, $t8, $t9 + # Save distance + lw $t9, 0($t8) + sw $t9, -20($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # Update min if 24 < 25 + lw $t8, -20($fp) + lw $t9, -16($fp) + bgtu $t8, $t9, label_NEXT0_16 + # LOCAL local_trib__a__init_n_5 --> -24($fp) + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + # local_trib__a__init_n_5 = local_trib__a__init_internal_0 + lw $t8, -4($fp) + sw $t8, -24($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # local_trib__a__init_internal_6 = ALLOCATE Bar + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $s2, String + sw $s2, 0($v0) + la $s2, String_start + sw $s2, 4($v0) + # Load type offset + li $s2, 8 + sw $s2, 8($v0) + la $s2, Bar + sw $s2, 12($v0) + li $s2, 3 + sw $s2, 16($v0) + move $s2, $v0 + # Allocating 48 bytes of memory + li $a0, 48 + li $v0, 9 + syscall + sw $s2, 0($v0) + la $s2, Bar_start + sw $s2, 4($v0) + # Load type offset + li $s2, 32 + sw $s2, 8($v0) + move $t9, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 32($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 36($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Bar__attrib__c__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 40($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Bar__attrib__d__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 44($t9) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t9, -28($fp) + # GOTO label_END_15 +j label_END_15 +label_NEXT0_16: + # local_trib__a__init_internal_4 = TYPE_DISTANCE Foo + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # Load TDT pointer to type Foo + la $t9, Foo__TDT + lw $s2, -8($fp) + addu $t9, $t9, $s2 + # Save distance + lw $s2, 0($t9) + sw $s2, -20($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # Update min if 25 < 18 + lw $t9, -20($fp) + lw $s2, -16($fp) + bgtu $t9, $s2, label_NEXT1_17 + # LOCAL local_trib__a__init_n_7 --> -32($fp) + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + # local_trib__a__init_n_7 = local_trib__a__init_internal_0 + lw $t9, -4($fp) + sw $t9, -32($fp) + # LOCAL local_trib__a__init_internal_8 --> -36($fp) + # local_trib__a__init_internal_8 = ALLOCATE Razz + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $s3, String + sw $s3, 0($v0) + la $s3, String_start + sw $s3, 4($v0) + # Load type offset + li $s3, 8 + sw $s3, 8($v0) + la $s3, Razz + sw $s3, 12($v0) + li $s3, 4 + sw $s3, 16($v0) + move $s3, $v0 + # Allocating 40 bytes of memory + li $a0, 40 + li $v0, 9 + syscall + sw $s3, 0($v0) + la $s3, Razz_start + sw $s3, 4($v0) + # Load type offset + li $s3, 28 + sw $s3, 8($v0) + move $s2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register s2 into stack + subu $sp, $sp, 4 + sw $s2, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register s2 + lw $s2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($s2) + # Push register s2 into stack + subu $sp, $sp, 4 + sw $s2, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register s2 + lw $s2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($s2) + # Push register s2 into stack + subu $sp, $sp, 4 + sw $s2, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register s2 + lw $s2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($s2) + # Push register s2 into stack + subu $sp, $sp, 4 + sw $s2, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register s2 + lw $s2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($s2) + # Push register s2 into stack + subu $sp, $sp, 4 + sw $s2, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register s2 + lw $s2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($s2) + # Push register s2 into stack + subu $sp, $sp, 4 + sw $s2, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register s2 + lw $s2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 32($s2) + # Push register s2 into stack + subu $sp, $sp, 4 + sw $s2, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register s2 + lw $s2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 36($s2) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $s2, -36($fp) + # GOTO label_END_15 +j label_END_15 +label_NEXT1_17: + # local_trib__a__init_internal_4 = TYPE_DISTANCE Bar + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bar + la $s2, Bar__TDT + lw $s3, -8($fp) + addu $s2, $s2, $s3 + # Save distance + lw $s3, 0($s2) + sw $s3, -20($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # Update min if 18 < 19 + lw $s2, -20($fp) + lw $s3, -16($fp) + bgtu $s2, $s3, label_NEXT2_18 + # LOCAL local_trib__a__init_n_9 --> -40($fp) + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + # local_trib__a__init_n_9 = local_trib__a__init_internal_0 + lw $s2, -4($fp) + sw $s2, -40($fp) + # GOTO label_END_15 +j label_END_15 +label_NEXT2_18: + label_ERROR_14: + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + lw $s2, 0($s1) + sw $s2, -4($fp) + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + label_END_15: +# RETURN +# Deallocate stack frame for function __Foo__attrib__a__init. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 48 +jr $ra +# Function END + + +# __Foo__attrib__b__init implementation. +# @Params: +__Foo__attrib__b__init: + # Allocate stack frame for function __Foo__attrib__b__init. + subu $sp, $sp, 68 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 68 + # local_trib__b__init_internal_5 = GETATTRIBUTE a Foo + # LOCAL local_trib__b__init_internal_5 --> -24($fp) + lw $s2, 24($s1) + sw $s2, -24($fp) + # LOCAL local_trib__b__init_internal_3 --> -16($fp) + # LOCAL local_trib__b__init_internal_5 --> -24($fp) + # local_trib__b__init_internal_3 = local_trib__b__init_internal_5 + lw $s2, -24($fp) + sw $s2, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__b__init_internal_3 --> -16($fp) + # LOCAL local_trib__b__init_internal_4 --> -20($fp) + # local_trib__b__init_internal_4 = VCALL local_trib__b__init_internal_3 doh + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 32($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_trib__b__init_internal_8 = GETATTRIBUTE g Foo + # LOCAL local_trib__b__init_internal_8 --> -36($fp) + lw $s2, 16($s1) + sw $s2, -36($fp) + # LOCAL local_trib__b__init_internal_6 --> -28($fp) + # LOCAL local_trib__b__init_internal_8 --> -36($fp) + # local_trib__b__init_internal_6 = local_trib__b__init_internal_8 + lw $s2, -36($fp) + sw $s2, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__b__init_internal_6 --> -28($fp) + # LOCAL local_trib__b__init_internal_7 --> -32($fp) + # local_trib__b__init_internal_7 = VCALL local_trib__b__init_internal_6 doh + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 32($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_trib__b__init_internal_2 --> -12($fp) + # LOCAL local_trib__b__init_internal_4 --> -20($fp) + # LOCAL local_trib__b__init_internal_7 --> -32($fp) + # local_trib__b__init_internal_2 = local_trib__b__init_internal_4 + local_trib__b__init_internal_7 + lw $s2, -20($fp) + lw $s3, -32($fp) + add $s2, $s2, $s3 + sw $s2, -12($fp) + # LOCAL local_trib__b__init_internal_11 --> -48($fp) + # local_trib__b__init_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_trib__b__init_internal_9 --> -40($fp) + # LOCAL local_trib__b__init_internal_11 --> -48($fp) + # local_trib__b__init_internal_9 = local_trib__b__init_internal_11 + lw $s2, -48($fp) + sw $s2, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__b__init_internal_9 --> -40($fp) + # LOCAL local_trib__b__init_internal_10 --> -44($fp) + # local_trib__b__init_internal_10 = VCALL local_trib__b__init_internal_9 doh + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 32($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_trib__b__init_internal_1 --> -8($fp) + # LOCAL local_trib__b__init_internal_2 --> -12($fp) + # LOCAL local_trib__b__init_internal_10 --> -44($fp) + # local_trib__b__init_internal_1 = local_trib__b__init_internal_2 + local_trib__b__init_internal_10 + lw $s2, -12($fp) + lw $s3, -44($fp) + add $s2, $s2, $s3 + sw $s2, -8($fp) + # LOCAL local_trib__b__init_internal_14 --> -60($fp) + # local_trib__b__init_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_trib__b__init_internal_12 --> -52($fp) + # LOCAL local_trib__b__init_internal_14 --> -60($fp) + # local_trib__b__init_internal_12 = local_trib__b__init_internal_14 + lw $s2, -60($fp) + sw $s2, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__b__init_internal_12 --> -52($fp) + # LOCAL local_trib__b__init_internal_13 --> -56($fp) + # local_trib__b__init_internal_13 = VCALL local_trib__b__init_internal_12 printh + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 28($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_trib__b__init_internal_0 --> -4($fp) + # LOCAL local_trib__b__init_internal_1 --> -8($fp) + # LOCAL local_trib__b__init_internal_13 --> -56($fp) + # local_trib__b__init_internal_0 = local_trib__b__init_internal_1 + local_trib__b__init_internal_13 + lw $s2, -8($fp) + lw $s3, -56($fp) + add $s2, $s2, $s3 + sw $s2, -4($fp) + # RETURN local_trib__b__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Foo__attrib__b__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 68 + jr $ra + # Function END + + +# function_doh_at_Foo implementation. +# @Params: +function_doh_at_Foo: + # Allocate stack frame for function function_doh_at_Foo. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_doh_at_Foo_internal_1 = GETATTRIBUTE h Foo + # LOCAL local_doh_at_Foo_internal_1 --> -8($fp) + lw $s2, 12($s1) + sw $s2, -8($fp) + # LOCAL local_doh_at_Foo_i_0 --> -4($fp) + # LOCAL local_doh_at_Foo_internal_1 --> -8($fp) + # local_doh_at_Foo_i_0 = local_doh_at_Foo_internal_1 + lw $s2, -8($fp) + sw $s2, -4($fp) + # local_doh_at_Foo_internal_3 = GETATTRIBUTE h Foo + # LOCAL local_doh_at_Foo_internal_3 --> -16($fp) + lw $s2, 12($s1) + sw $s2, -16($fp) + # LOCAL local_doh_at_Foo_internal_2 --> -12($fp) + # LOCAL local_doh_at_Foo_internal_3 --> -16($fp) + # local_doh_at_Foo_internal_2 = local_doh_at_Foo_internal_3 + 2 + lw $s2, -16($fp) + add $s2, $s2, 2 + sw $s2, -12($fp) + # + # LOCAL local_doh_at_Foo_internal_2 --> -12($fp) + lw $s2, -12($fp) + sw $s2, 12($s1) + # RETURN local_doh_at_Foo_i_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_doh_at_Foo. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Razz__attrib__e__init implementation. +# @Params: +__Razz__attrib__e__init: + # Allocate stack frame for function __Razz__attrib__e__init. + subu $sp, $sp, 40 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 40 + # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) + # local_ttrib__e__init_internal_0 = SELF + sw $s1, -4($fp) + # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # local_ttrib__e__init_internal_1 = TYPEOF local_ttrib__e__init_internal_0 + lw $s2, -4($fp) + # Load pointer to type offset + lw $s3, 8($s2) + sw $s3, -8($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # local_ttrib__e__init_internal_3 = 13 + li $s2, 13 + sw $s2, -16($fp) + # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # Load TDT pointer to type Razz + la $s2, Razz__TDT + lw $s3, -8($fp) + addu $s2, $s2, $s3 + # Save distance + lw $s3, 0($s2) + sw $s3, -20($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # Update min if 18 < 19 + lw $s2, -20($fp) + lw $s3, -16($fp) + bgtu $s2, $s3, label_Not_min0_19 + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # local_ttrib__e__init_internal_3 = local_ttrib__e__init_internal_4 + lw $s2, -20($fp) + sw $s2, -16($fp) + label_Not_min0_19: + # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bar + la $s2, Bar__TDT + lw $s3, -8($fp) + addu $s2, $s2, $s3 + # Save distance + lw $s3, 0($s2) + sw $s3, -20($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # Update min if 18 < 19 + lw $s2, -20($fp) + lw $s3, -16($fp) + bgtu $s2, $s3, label_Not_min1_20 + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # local_ttrib__e__init_internal_3 = local_ttrib__e__init_internal_4 + lw $s2, -20($fp) + sw $s2, -16($fp) + label_Not_min1_20: + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # local_ttrib__e__init_internal_4 = 13 + li $s2, 13 + sw $s2, -20($fp) + # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # local_ttrib__e__init_internal_2 = local_ttrib__e__init_internal_4 - local_ttrib__e__init_internal_3 + lw $s2, -20($fp) + lw $s3, -16($fp) + sub $s2, $s2, $s3 + sw $s2, -12($fp) + # IF_ZERO local_ttrib__e__init_internal_2 GOTO label_ERROR_21 + # IF_ZERO local_ttrib__e__init_internal_2 GOTO label_ERROR_21 + lw $s2, -12($fp) + beq $s2, 0, label_ERROR_21 + # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # Load TDT pointer to type Razz + la $s2, Razz__TDT + lw $s3, -8($fp) + addu $s2, $s2, $s3 + # Save distance + lw $s3, 0($s2) + sw $s3, -20($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # Update min if 18 < 19 + lw $s2, -20($fp) + lw $s3, -16($fp) + bgtu $s2, $s3, label_NEXT0_23 + # LOCAL local_ttrib__e__init_n_5 --> -24($fp) + # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) + # local_ttrib__e__init_n_5 = local_ttrib__e__init_internal_0 + lw $s2, -4($fp) + sw $s2, -24($fp) + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # local_ttrib__e__init_internal_6 = ALLOCATE Bar + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $s4, String + sw $s4, 0($v0) + la $s4, String_start + sw $s4, 4($v0) + # Load type offset + li $s4, 8 + sw $s4, 8($v0) + la $s4, Bar + sw $s4, 12($v0) + li $s4, 3 + sw $s4, 16($v0) + move $s4, $v0 + # Allocating 48 bytes of memory + li $a0, 48 + li $v0, 9 + syscall + sw $s4, 0($v0) + la $s4, Bar_start + sw $s4, 4($v0) + # Load type offset + li $s4, 32 + sw $s4, 8($v0) + move $s3, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register s3 into stack + subu $sp, $sp, 4 + sw $s3, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register s3 + lw $s3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($s3) + # Push register s3 into stack + subu $sp, $sp, 4 + sw $s3, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register s3 + lw $s3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($s3) + # Push register s3 into stack + subu $sp, $sp, 4 + sw $s3, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register s3 + lw $s3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($s3) + # Push register s3 into stack + subu $sp, $sp, 4 + sw $s3, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register s3 + lw $s3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($s3) + # Push register s3 into stack + subu $sp, $sp, 4 + sw $s3, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register s3 + lw $s3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($s3) + # Push register s3 into stack + subu $sp, $sp, 4 + sw $s3, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register s3 + lw $s3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 32($s3) + # Push register s3 into stack + subu $sp, $sp, 4 + sw $s3, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register s3 + lw $s3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 36($s3) + # Push register s3 into stack + subu $sp, $sp, 4 + sw $s3, 0($sp) + jal __Bar__attrib__c__init + # Pop 4 bytes from stack into register s3 + lw $s3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 40($s3) + # Push register s3 into stack + subu $sp, $sp, 4 + sw $s3, 0($sp) + jal __Bar__attrib__d__init + # Pop 4 bytes from stack into register s3 + lw $s3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 44($s3) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $s3, -28($fp) + # GOTO label_END_22 +j label_END_22 +label_NEXT0_23: + # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bar + la $s3, Bar__TDT + lw $s4, -8($fp) + addu $s3, $s3, $s4 + # Save distance + lw $s4, 0($s3) + sw $s4, -20($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # Update min if 19 < 20 + lw $s3, -20($fp) + lw $s4, -16($fp) + bgtu $s3, $s4, label_NEXT1_24 + # LOCAL local_ttrib__e__init_n_7 --> -32($fp) + # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) + # local_ttrib__e__init_n_7 = local_ttrib__e__init_internal_0 + lw $s3, -4($fp) + sw $s3, -32($fp) + # GOTO label_END_22 +j label_END_22 +label_NEXT1_24: + label_ERROR_21: + # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) + lw $s3, 0($s1) + sw $s3, -4($fp) + # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + label_END_22: +# RETURN +# Deallocate stack frame for function __Razz__attrib__e__init. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 40 +jr $ra +# Function END + + +# __Razz__attrib__f__init implementation. +# @Params: +__Razz__attrib__f__init: + # Allocate stack frame for function __Razz__attrib__f__init. + subu $sp, $sp, 80 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 80 + # local_ttrib__f__init_internal_5 = GETATTRIBUTE a Razz + # LOCAL local_ttrib__f__init_internal_5 --> -24($fp) + lw $s3, 24($s1) + sw $s3, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_ttrib__f__init_internal_4 = CALL doh + # LOCAL local_ttrib__f__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__f__init_internal_5 --> -24($fp) + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type's VTABLE + la $s3, Bazz_vtable + # Get pointer to function address + lw $s4, 32($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_ttrib__f__init_internal_8 = GETATTRIBUTE g Razz + # LOCAL local_ttrib__f__init_internal_8 --> -36($fp) + lw $s3, 16($s1) + sw $s3, -36($fp) + # LOCAL local_ttrib__f__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__f__init_internal_8 --> -36($fp) + # local_ttrib__f__init_internal_6 = local_ttrib__f__init_internal_8 + lw $s3, -36($fp) + sw $s3, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__f__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__f__init_internal_7 --> -32($fp) + # local_ttrib__f__init_internal_7 = VCALL local_ttrib__f__init_internal_6 doh + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $s3, 4($s1) + # Get pointer to type's VTABLE + lw $s4, 0($s3) + # Get pointer to function address + lw $s5, 32($s4) + # Call function. Result is on $v0 + jalr $s5 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_ttrib__f__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__f__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__f__init_internal_7 --> -32($fp) + # local_ttrib__f__init_internal_3 = local_ttrib__f__init_internal_4 + local_ttrib__f__init_internal_7 + lw $s3, -20($fp) + lw $s4, -32($fp) + add $s3, $s3, $s4 + sw $s3, -16($fp) + # local_ttrib__f__init_internal_11 = GETATTRIBUTE e Razz + # LOCAL local_ttrib__f__init_internal_11 --> -48($fp) + lw $s3, 32($s1) + sw $s3, -48($fp) + # LOCAL local_ttrib__f__init_internal_9 --> -40($fp) + # LOCAL local_ttrib__f__init_internal_11 --> -48($fp) + # local_ttrib__f__init_internal_9 = local_ttrib__f__init_internal_11 + lw $s3, -48($fp) + sw $s3, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__f__init_internal_9 --> -40($fp) + # LOCAL local_ttrib__f__init_internal_10 --> -44($fp) + # local_ttrib__f__init_internal_10 = VCALL local_ttrib__f__init_internal_9 doh + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $s3, 4($s1) + # Get pointer to type's VTABLE + lw $s4, 0($s3) + # Get pointer to function address + lw $s5, 32($s4) + # Call function. Result is on $v0 + jalr $s5 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_ttrib__f__init_internal_2 --> -12($fp) + # LOCAL local_ttrib__f__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__f__init_internal_10 --> -44($fp) + # local_ttrib__f__init_internal_2 = local_ttrib__f__init_internal_3 + local_ttrib__f__init_internal_10 + lw $s3, -16($fp) + lw $s4, -44($fp) + add $s3, $s3, $s4 + sw $s3, -12($fp) + # LOCAL local_ttrib__f__init_internal_14 --> -60($fp) + # local_ttrib__f__init_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_ttrib__f__init_internal_12 --> -52($fp) + # LOCAL local_ttrib__f__init_internal_14 --> -60($fp) + # local_ttrib__f__init_internal_12 = local_ttrib__f__init_internal_14 + lw $s3, -60($fp) + sw $s3, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__f__init_internal_12 --> -52($fp) + # LOCAL local_ttrib__f__init_internal_13 --> -56($fp) + # local_ttrib__f__init_internal_13 = VCALL local_ttrib__f__init_internal_12 doh + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $s3, 4($s1) + # Get pointer to type's VTABLE + lw $s4, 0($s3) + # Get pointer to function address + lw $s5, 32($s4) + # Call function. Result is on $v0 + jalr $s5 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_ttrib__f__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__f__init_internal_2 --> -12($fp) + # LOCAL local_ttrib__f__init_internal_13 --> -56($fp) + # local_ttrib__f__init_internal_1 = local_ttrib__f__init_internal_2 + local_ttrib__f__init_internal_13 + lw $s3, -12($fp) + lw $s4, -56($fp) + add $s3, $s3, $s4 + sw $s3, -8($fp) + # LOCAL local_ttrib__f__init_internal_17 --> -72($fp) + # local_ttrib__f__init_internal_17 = SELF + sw $s1, -72($fp) + # LOCAL local_ttrib__f__init_internal_15 --> -64($fp) + # LOCAL local_ttrib__f__init_internal_17 --> -72($fp) + # local_ttrib__f__init_internal_15 = local_ttrib__f__init_internal_17 + lw $s3, -72($fp) + sw $s3, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__f__init_internal_15 --> -64($fp) + # LOCAL local_ttrib__f__init_internal_16 --> -68($fp) + # local_ttrib__f__init_internal_16 = VCALL local_ttrib__f__init_internal_15 printh + # Save new self pointer in $s1 + lw $s1, -64($fp) + # Get pointer to type + lw $s3, 4($s1) + # Get pointer to type's VTABLE + lw $s4, 0($s3) + # Get pointer to function address + lw $s5, 28($s4) + # Call function. Result is on $v0 + jalr $s5 + sw $v0, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_ttrib__f__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__f__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__f__init_internal_16 --> -68($fp) + # local_ttrib__f__init_internal_0 = local_ttrib__f__init_internal_1 + local_ttrib__f__init_internal_16 + lw $s3, -8($fp) + lw $s4, -68($fp) + add $s3, $s3, $s4 + sw $s3, -4($fp) + # RETURN local_ttrib__f__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Razz__attrib__f__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 80 + jr $ra + # Function END + + +# __Bar__attrib__c__init implementation. +# @Params: +__Bar__attrib__c__init: + # Allocate stack frame for function __Bar__attrib__c__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_trib__c__init_internal_2 --> -12($fp) + # local_trib__c__init_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_trib__c__init_internal_0 --> -4($fp) + # LOCAL local_trib__c__init_internal_2 --> -12($fp) + # local_trib__c__init_internal_0 = local_trib__c__init_internal_2 + lw $s3, -12($fp) + sw $s3, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__c__init_internal_0 --> -4($fp) + # LOCAL local_trib__c__init_internal_1 --> -8($fp) + # local_trib__c__init_internal_1 = VCALL local_trib__c__init_internal_0 doh + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $s3, 4($s1) + # Get pointer to type's VTABLE + lw $s4, 0($s3) + # Get pointer to function address + lw $s5, 32($s4) + # Call function. Result is on $v0 + jalr $s5 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_trib__c__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Bar__attrib__c__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Bar__attrib__d__init implementation. +# @Params: +__Bar__attrib__d__init: + # Allocate stack frame for function __Bar__attrib__d__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_trib__d__init_internal_2 --> -12($fp) + # local_trib__d__init_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_trib__d__init_internal_0 --> -4($fp) + # LOCAL local_trib__d__init_internal_2 --> -12($fp) + # local_trib__d__init_internal_0 = local_trib__d__init_internal_2 + lw $s3, -12($fp) + sw $s3, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__d__init_internal_0 --> -4($fp) + # LOCAL local_trib__d__init_internal_1 --> -8($fp) + # local_trib__d__init_internal_1 = VCALL local_trib__d__init_internal_0 printh + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $s3, 4($s1) + # Get pointer to type's VTABLE + lw $s4, 0($s3) + # Get pointer to function address + lw $s5, 28($s4) + # Call function. Result is on $v0 + jalr $s5 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_trib__d__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Bar__attrib__d__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index a1a1854f..ad09bd58 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -1,6 +1,14 @@ from re import L from abstract.semantics import Context, Type -from abstract.tree import AttributeDef, ClassDef, EqualToNode, IsVoidNode, MethodDef, NotNode, SelfNode +from abstract.tree import ( + AttributeDef, + ClassDef, + EqualToNode, + IsVoidNode, + MethodDef, + NotNode, + SelfNode, +) import cil.baseCilVisitor as baseCilVisitor import abstract.tree as coolAst import abstract.semantics as semantics @@ -16,7 +24,8 @@ AllocateNode, AllocateStringNode, ArgNode, - AssignNode, BitwiseNotNode, + AssignNode, + BitwiseNotNode, CilNode, CilProgramNode, ConcatString, @@ -28,7 +37,8 @@ GetTypeIndex, IfZeroJump, InitSelfNode, - InstructionNode, JumpIfGreater, + InstructionNode, + JumpIfGreater, JumpIfGreaterThanZeroNode, LabelNode, LoadNode, @@ -48,7 +58,8 @@ StarNode, StaticCallNode, SubstringNode, - TdtLookupNode, TypeName, + TdtLookupNode, + TypeName, TypeNode, TypeOffsetNode, UnconditionalJump, @@ -56,10 +67,17 @@ from mips.branch import J -def find_method_in_parent(type_: Type, method: str): - if type_.parent is None or method not in type_.parent.methods: +def find_method_in_parent(type_: Type, method: str, typeNodes: List[TypeNode]): + methods = [] + if type_.parent is not None: + parent = next(n for n in typeNodes if n.name == type_.name) + methods = [m for _, m in parent.methods] + if ( + type_.parent is None + or f"function_{method}_at_{type_.name}" in methods + ): return type_ - return find_method_in_parent(type_.parent, method) + return find_method_in_parent(type_.parent, method, typeNodes) ExpressionReturn = Tuple[List[InstructionNode], List[LocalNode]] @@ -89,20 +107,21 @@ def _(self, node: coolAst.ProgramNode, scope: Scope) -> CilProgramNode: self.register_instruction(InitSelfNode(instance)) # Llamar al metodo main - self.register_instruction( - StaticCallNode( - instance, main_type, "main", result - ) - ) + self.register_instruction(StaticCallNode(instance, main_type, "main", result)) self.register_instruction(ReturnNode(0)) self.current_function = None class_list = self.topological_sort_classDefs(node.class_list) + # Ordenar los scopes + children = [] + for x in class_list: + i = next(i for i, c in enumerate(node.class_list) if c.idx == x.idx) + children.append(scope.children[i]) - for c in node.class_list: + for c in class_list: self.register_type(c.idx) - for klass, child_scope in zip(node.class_list, scope.children): + for klass, child_scope in zip(class_list, children): self.visit(klass, child_scope) return CilProgramNode(self.dot_types, self.dot_data, self.dot_code) @@ -136,7 +155,7 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: self.to_function_name( method, find_method_in_parent( - self.current_type.parent, method + self.current_type.parent, method, self.dot_types ).name, ), ) @@ -170,23 +189,11 @@ def _(self, node: coolAst.ClassDef, scope: Scope) -> None: attrib = [x for x in node.features if isinstance(x, AttributeDef)] meth = [x for x in node.features if isinstance(x, MethodDef)] features = attrib + meth - - - for f, s in zip(features, scope.children): - self.visit(f, s) - # # Visitar los atributos definidos en la clase para generar sus funciones - # # de inicializacion - # for feature in node.features: - # if isinstance(feature, coolAst.AttributeDef): - # self.visit(feature, scope) + self.current_type.attributes = new_type_node.attributes - # # Visitar cada metodo para generar su codigo en la seccion .CODE - # for feature, child_scope in zip( - # (x for x in node.features if isinstance(x, coolAst.MethodDef)), - # scope.children, - # ): - # self.visit(feature, child_scope) + for f, s in zip(features, scope.children): + self.visit(f, s) self.current_type = None @@ -284,7 +291,6 @@ def _(self, node: coolAst.IfThenElseNode, scope: Scope): # noqa: F811 @visit.register def _(self, node: coolAst.VariableDeclaration, scope: Scope) -> CilNode: - scope = scope.children[0] for var_idx, var_type, var_init_expr, _, _ in node.var_list: # Registrar las variables en orden. @@ -491,7 +497,9 @@ def _(self, node: coolAst.CaseNode, scope: Scope): self.register_instruction(LabelNode(error_label)) self.register_instruction(TypeName(expr_vm_holder)) - self.register_instruction(AbortNode(expr_vm_holder, self.abortion, self.newLine)) + self.register_instruction( + AbortNode(expr_vm_holder, self.abortion, self.newLine) + ) self.register_instruction(LabelNode(end_label)) diff --git a/src/travels/inference.py b/src/travels/inference.py index a44b2fe3..39852396 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -369,10 +369,10 @@ def _( infered_type=None, deep=1, ): - if deep == 1: - scope = scope.create_child() - else: - scope = scope.children[0] if scope.children else scope + # if deep == 1: + # scope = scope.create_child() + # else: + # scope = scope.children[0] if scope.children else scope for var_id, var_type, var_init_expr, l, c in node.var_list: try: type_ = self.context.get_type(var_type) diff --git a/tests/codegen/hairyscary.mips b/tests/codegen/hairyscary.mips index 71aa99a6..d6fa5178 100644 --- a/tests/codegen/hairyscary.mips +++ b/tests/codegen/hairyscary.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:23 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 17:41:29 2020 # School of Math and Computer Science, University of Havana # @@ -13,15 +13,15 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END -Foo: .asciiz "Foo" +Main: .asciiz "Main" # Function END -Bar: .asciiz "Bar" +Bazz: .asciiz "Bazz" # Function END -Razz: .asciiz "Razz" +Foo: .asciiz "Foo" # Function END -Bazz: .asciiz "Bazz" +Razz: .asciiz "Razz" # Function END -Main: .asciiz "Main" +Bar: .asciiz "Bar" # Function END # @@ -82,73 +82,73 @@ Bool_end: # -# **** VTABLE for type Foo **** -Foo_vtable: .word function_doh_at_Foo +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main # Function END # -# **** Type RECORD for type Foo **** -Foo_start: - Foo_vtable_pointer: .word Foo_vtable +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable # Function END -Foo_end: +Main_end: # -# **** VTABLE for type Bar **** -Bar_vtable: .word +# **** VTABLE for type Bazz **** +Bazz_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_printh_at_Bazz, function_doh_at_Bazz # Function END # -# **** Type RECORD for type Bar **** -Bar_start: - Bar_vtable_pointer: .word Bar_vtable +# **** Type RECORD for type Bazz **** +Bazz_start: + Bazz_vtable_pointer: .word Bazz_vtable # Function END -Bar_end: +Bazz_end: # -# **** VTABLE for type Razz **** -Razz_vtable: .word function_doh_at_Bazz +# **** VTABLE for type Foo **** +Foo_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_printh_at_Bazz, function_doh_at_Foo # Function END # -# **** Type RECORD for type Razz **** -Razz_start: - Razz_vtable_pointer: .word Razz_vtable +# **** Type RECORD for type Foo **** +Foo_start: + Foo_vtable_pointer: .word Foo_vtable # Function END -Razz_end: +Foo_end: # -# **** VTABLE for type Bazz **** -Bazz_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_printh_at_Bazz, function_doh_at_Bazz +# **** VTABLE for type Razz **** +Razz_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_printh_at_Bazz, function_doh_at_Foo # Function END # -# **** Type RECORD for type Bazz **** -Bazz_start: - Bazz_vtable_pointer: .word Bazz_vtable +# **** Type RECORD for type Razz **** +Razz_start: + Razz_vtable_pointer: .word Razz_vtable # Function END -Bazz_end: +Razz_end: # -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main +# **** VTABLE for type Bar **** +Bar_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_printh_at_Bazz, function_doh_at_Foo # Function END # -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable +# **** Type RECORD for type Bar **** +Bar_start: + Bar_vtable_pointer: .word Bar_vtable # Function END -Main_end: +Bar_end: # @@ -164,15 +164,15 @@ data_2: .asciiz "\n" # -IO__TDT: .word 0, -1, -1, -1, 2, 4, 3, 1, -1 -Object__TDT: .word 1, 0, 1, 1, 3, 5, 4, 2, 1 +IO__TDT: .word 0, -1, -1, -1, -1, 1, 2, 3, 4 +Object__TDT: .word 1, 0, 1, 1, 1, 2, 3, 4, 5 String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1 Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1 -Foo__TDT: .word -1, -1, -1, -1, 0, 2, 1, -1, -1 -Bar__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1 -Razz__TDT: .word -1, -1, -1, -1, -1, 1, 0, -1, -1 -Bazz__TDT: .word -1, -1, -1, -1, 1, 3, 2, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0 +Main__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1 +Bazz__TDT: .word -1, -1, -1, -1, -1, 0, 1, 2, 3 +Foo__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 2 +Razz__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, 1 +Bar__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0 # @@ -421,7 +421,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -619,7 +619,7 @@ entry: la $t2, Main_start sw $t2, 4($v0) # Load type offset - li $t2, 32 + li $t2, 16 sw $t2, 8($v0) move $t1, $v0 # Push register s1 into stack @@ -689,211 +689,99 @@ entry: # Function END -# __Foo__attrib__a__init implementation. +# __Main__attrib__a__init implementation. # @Params: -__Foo__attrib__a__init: - # Allocate stack frame for function __Foo__attrib__a__init. - subu $sp, $sp, 48 +__Main__attrib__a__init: + # Allocate stack frame for function __Main__attrib__a__init. + subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 48 - # LOCAL local_trib__a__init_internal_0 --> -4($fp) - # local_trib__a__init_internal_0 = SELF - sw $s1, -4($fp) - # LOCAL local_trib__a__init_internal_0 --> -4($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - # local_trib__a__init_internal_1 = TYPEOF local_trib__a__init_internal_0 - lw $t1, -4($fp) - # Load pointer to type offset - lw $t2, 8($t1) - sw $t2, -8($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # local_trib__a__init_internal_3 = 13 - li $t1, 13 - sw $t1, -16($fp) - # local_trib__a__init_internal_4 = TYPE_DISTANCE Razz - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - # Load TDT pointer to type Razz - la $t1, Razz__TDT - lw $t2, -8($fp) - addu $t1, $t1, $t2 - # Save distance - lw $t2, 0($t1) - sw $t2, -20($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # Update min if 9 < 10 - lw $t1, -20($fp) - lw $t2, -16($fp) - bgtu $t1, $t2, label_Not_min0_1 - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # local_trib__a__init_internal_3 = local_trib__a__init_internal_4 - lw $t1, -20($fp) - sw $t1, -16($fp) - label_Not_min0_1: - # local_trib__a__init_internal_4 = TYPE_DISTANCE Foo - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - # Load TDT pointer to type Foo - la $t1, Foo__TDT - lw $t2, -8($fp) - addu $t1, $t1, $t2 - # Save distance - lw $t2, 0($t1) - sw $t2, -20($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # Update min if 9 < 10 - lw $t1, -20($fp) - lw $t2, -16($fp) - bgtu $t1, $t2, label_Not_min1_2 - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # local_trib__a__init_internal_3 = local_trib__a__init_internal_4 - lw $t1, -20($fp) - sw $t1, -16($fp) - label_Not_min1_2: - # local_trib__a__init_internal_4 = TYPE_DISTANCE Bar - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - # Load TDT pointer to type Bar - la $t1, Bar__TDT - lw $t2, -8($fp) - addu $t1, $t1, $t2 - # Save distance - lw $t2, 0($t1) - sw $t2, -20($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # Update min if 9 < 10 - lw $t1, -20($fp) - lw $t2, -16($fp) - bgtu $t1, $t2, label_Not_min2_3 - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # local_trib__a__init_internal_3 = local_trib__a__init_internal_4 - lw $t1, -20($fp) - sw $t1, -16($fp) - label_Not_min2_3: - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # local_trib__a__init_internal_4 = 13 - li $t1, 13 - sw $t1, -20($fp) - # LOCAL local_trib__a__init_internal_2 --> -12($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # local_trib__a__init_internal_2 = local_trib__a__init_internal_4 - local_trib__a__init_internal_3 - lw $t1, -20($fp) - lw $t2, -16($fp) - sub $t1, $t1, $t2 - sw $t1, -12($fp) - # IF_ZERO local_trib__a__init_internal_2 GOTO label_ERROR_4 - # IF_ZERO local_trib__a__init_internal_2 GOTO label_ERROR_4 - lw $t1, -12($fp) - beq $t1, 0, label_ERROR_4 - # local_trib__a__init_internal_4 = TYPE_DISTANCE Razz - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - # Load TDT pointer to type Razz - la $t1, Razz__TDT - lw $t2, -8($fp) - addu $t1, $t1, $t2 - # Save distance - lw $t2, 0($t1) - sw $t2, -20($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # Update min if 9 < 10 - lw $t1, -20($fp) - lw $t2, -16($fp) - bgtu $t1, $t2, label_NEXT0_6 - # LOCAL local_trib__a__init_n_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_0 --> -4($fp) - # local_trib__a__init_n_5 = local_trib__a__init_internal_0 - lw $t1, -4($fp) - sw $t1, -24($fp) - # LOCAL local_trib__a__init_internal_6 --> -28($fp) - # local_trib__a__init_internal_6 = ALLOCATE Bar - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Bar - sw $t3, 12($v0) - li $t3, 3 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Bar_start - sw $t3, 4($v0) - # Load type offset - li $t3, 20 - sw $t3, 8($v0) - move $t2, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Bar__attrib__c__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t2) - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Bar__attrib__d__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t2) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t2, -28($fp) - # GOTO label_END_5 -j label_END_5 -label_NEXT0_6: - # local_trib__a__init_internal_4 = TYPE_DISTANCE Foo - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - # Load TDT pointer to type Foo - la $t2, Foo__TDT - lw $t3, -8($fp) - addu $t2, $t2, $t3 - # Save distance - lw $t3, 0($t2) - sw $t3, -20($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # Update min if 10 < 11 - lw $t2, -20($fp) - lw $t3, -16($fp) - bgtu $t2, $t3, label_NEXT1_7 - # LOCAL local_trib__a__init_n_7 --> -32($fp) - # LOCAL local_trib__a__init_internal_0 --> -4($fp) - # local_trib__a__init_n_7 = local_trib__a__init_internal_0 - lw $t2, -4($fp) - sw $t2, -32($fp) - # LOCAL local_trib__a__init_internal_8 --> -36($fp) - # local_trib__a__init_internal_8 = ALLOCATE Razz + addu $fp, $sp, 32 + # LOCAL local_ttrib__a__init_internal_0 --> -4($fp) + # local_ttrib__a__init_internal_0 = ALLOCATE Bazz + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Bazz + sw $t3, 12($v0) + li $t3, 4 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 24 bytes of memory + li $a0, 24 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Bazz_start + sw $t3, 4($v0) + # Load type offset + li $t3, 20 + sw $t3, 8($v0) + move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t2) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t2, -4($fp) + # RETURN local_ttrib__a__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__a__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__b__init implementation. +# @Params: +__Main__attrib__b__init: + # Allocate stack frame for function __Main__attrib__b__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__b__init_internal_0 --> -4($fp) + # local_ttrib__b__init_internal_0 = ALLOCATE Foo # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -906,17 +794,17 @@ label_NEXT0_6: # Load type offset li $t4, 8 sw $t4, 8($v0) - la $t4, Razz + la $t4, Foo sw $t4, 12($v0) - li $t4, 4 + li $t4, 3 sw $t4, 16($v0) move $t4, $v0 - # Allocating 28 bytes of memory - li $a0, 28 + # Allocating 32 bytes of memory + li $a0, 32 li $v0, 9 syscall sw $t4, 0($v0) - la $t4, Razz_start + la $t4, Foo_start sw $t4, 4($v0) # Load type offset li $t4, 24 @@ -929,7 +817,7 @@ label_NEXT0_6: # Push register t3 into stack subu $sp, $sp, 4 sw $t3, 0($sp) - jal __Foo__attrib__a__init + jal __Bazz__attrib__h__init # Pop 4 bytes from stack into register t3 lw $t3, 0($sp) addu $sp, $sp, 4 @@ -937,7 +825,7 @@ label_NEXT0_6: # Push register t3 into stack subu $sp, $sp, 4 sw $t3, 0($sp) - jal __Foo__attrib__b__init + jal __Bazz__attrib__g__init # Pop 4 bytes from stack into register t3 lw $t3, 0($sp) addu $sp, $sp, 4 @@ -945,7 +833,7 @@ label_NEXT0_6: # Push register t3 into stack subu $sp, $sp, 4 sw $t3, 0($sp) - jal __Razz__attrib__e__init + jal __Bazz__attrib__i__init # Pop 4 bytes from stack into register t3 lw $t3, 0($sp) addu $sp, $sp, 4 @@ -953,264 +841,311 @@ label_NEXT0_6: # Push register t3 into stack subu $sp, $sp, 4 sw $t3, 0($sp) - jal __Razz__attrib__f__init + jal __Foo__attrib__a__init # Pop 4 bytes from stack into register t3 lw $t3, 0($sp) addu $sp, $sp, 4 sw $v0, 24($t3) + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t3) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t3, -36($fp) - # GOTO label_END_5 -j label_END_5 -label_NEXT1_7: - # local_trib__a__init_internal_4 = TYPE_DISTANCE Bar - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - # Load TDT pointer to type Bar - la $t3, Bar__TDT - lw $t4, -8($fp) - addu $t3, $t3, $t4 - # Save distance - lw $t4, 0($t3) - sw $t4, -20($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # Update min if 11 < 12 - lw $t3, -20($fp) - lw $t4, -16($fp) - bgtu $t3, $t4, label_NEXT2_8 - # LOCAL local_trib__a__init_n_9 --> -40($fp) - # LOCAL local_trib__a__init_internal_0 --> -4($fp) - # local_trib__a__init_n_9 = local_trib__a__init_internal_0 - lw $t3, -4($fp) - sw $t3, -40($fp) - # GOTO label_END_5 -j label_END_5 -label_NEXT2_8: - label_ERROR_4: - # LOCAL local_trib__a__init_internal_0 --> -4($fp) - lw $t3, 0($s1) - sw $t3, -4($fp) - # LOCAL local_trib__a__init_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - label_END_5: -# RETURN -# Deallocate stack frame for function __Foo__attrib__a__init. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 48 -jr $ra -# Function END + sw $t3, -4($fp) + # RETURN local_ttrib__b__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__b__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END -# __Foo__attrib__b__init implementation. +# __Main__attrib__c__init implementation. # @Params: -__Foo__attrib__b__init: - # Allocate stack frame for function __Foo__attrib__b__init. - subu $sp, $sp, 68 +__Main__attrib__c__init: + # Allocate stack frame for function __Main__attrib__c__init. + subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 68 - # local_trib__b__init_internal_5 = GETATTRIBUTE a Foo - # LOCAL local_trib__b__init_internal_5 --> -24($fp) - lw $t3, 12($s1) - sw $t3, -24($fp) - # LOCAL local_trib__b__init_internal_3 --> -16($fp) - # LOCAL local_trib__b__init_internal_5 --> -24($fp) - # local_trib__b__init_internal_3 = local_trib__b__init_internal_5 - lw $t3, -24($fp) - sw $t3, -16($fp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__c__init_internal_0 --> -4($fp) + # local_ttrib__c__init_internal_0 = ALLOCATE Razz + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, Razz + sw $t5, 12($v0) + li $t5, 4 + sw $t5, 16($v0) + move $t5, $v0 + # Allocating 40 bytes of memory + li $a0, 40 + li $v0, 9 + syscall + sw $t5, 0($v0) + la $t5, Razz_start + sw $t5, 4($v0) + # Load type offset + li $t5, 28 + sw $t5, 8($v0) + move $t4, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_trib__b__init_internal_3 --> -16($fp) - # LOCAL local_trib__b__init_internal_4 --> -20($fp) - # local_trib__b__init_internal_4 = VCALL local_trib__b__init_internal_3 doh - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 0($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) + move $s1, $v0 + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) addu $sp, $sp, 4 - # local_trib__b__init_internal_8 = GETATTRIBUTE g Foo - # LOCAL local_trib__b__init_internal_8 --> -36($fp) - lw $t3, 12($s1) - sw $t3, -36($fp) - # LOCAL local_trib__b__init_internal_6 --> -28($fp) - # LOCAL local_trib__b__init_internal_8 --> -36($fp) - # local_trib__b__init_internal_6 = local_trib__b__init_internal_8 - lw $t3, -36($fp) - sw $t3, -28($fp) - # Push register s1 into stack + sw $v0, 12($t4) + # Push register t4 into stack subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_trib__b__init_internal_6 --> -28($fp) - # LOCAL local_trib__b__init_internal_7 --> -32($fp) - # local_trib__b__init_internal_7 = VCALL local_trib__b__init_internal_6 doh - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 0($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) + sw $t4, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) addu $sp, $sp, 4 - # LOCAL local_trib__b__init_internal_2 --> -12($fp) - # LOCAL local_trib__b__init_internal_4 --> -20($fp) - # LOCAL local_trib__b__init_internal_7 --> -32($fp) - # local_trib__b__init_internal_2 = local_trib__b__init_internal_4 + local_trib__b__init_internal_7 - lw $t3, -20($fp) - lw $t4, -32($fp) - add $t3, $t3, $t4 - sw $t3, -12($fp) - # LOCAL local_trib__b__init_internal_11 --> -48($fp) - # local_trib__b__init_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_trib__b__init_internal_9 --> -40($fp) - # LOCAL local_trib__b__init_internal_11 --> -48($fp) - # local_trib__b__init_internal_9 = local_trib__b__init_internal_11 - lw $t3, -48($fp) - sw $t3, -40($fp) - # Push register s1 into stack + sw $v0, 16($t4) + # Push register t4 into stack subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_trib__b__init_internal_9 --> -40($fp) - # LOCAL local_trib__b__init_internal_10 --> -44($fp) - # local_trib__b__init_internal_10 = VCALL local_trib__b__init_internal_9 doh - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 0($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -44($fp) + sw $t4, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t4) + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t4) + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t4) + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 32($t4) + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 36($t4) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_trib__b__init_internal_1 --> -8($fp) - # LOCAL local_trib__b__init_internal_2 --> -12($fp) - # LOCAL local_trib__b__init_internal_10 --> -44($fp) - # local_trib__b__init_internal_1 = local_trib__b__init_internal_2 + local_trib__b__init_internal_10 - lw $t3, -12($fp) - lw $t4, -44($fp) - add $t3, $t3, $t4 - sw $t3, -8($fp) - # LOCAL local_trib__b__init_internal_14 --> -60($fp) - # local_trib__b__init_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_trib__b__init_internal_12 --> -52($fp) - # LOCAL local_trib__b__init_internal_14 --> -60($fp) - # local_trib__b__init_internal_12 = local_trib__b__init_internal_14 - lw $t3, -60($fp) - sw $t3, -52($fp) + sw $t4, -4($fp) + # RETURN local_ttrib__c__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__c__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__d__init implementation. +# @Params: +__Main__attrib__d__init: + # Allocate stack frame for function __Main__attrib__d__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__d__init_internal_0 --> -4($fp) + # local_ttrib__d__init_internal_0 = ALLOCATE Bar + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t6, String + sw $t6, 0($v0) + la $t6, String_start + sw $t6, 4($v0) + # Load type offset + li $t6, 8 + sw $t6, 8($v0) + la $t6, Bar + sw $t6, 12($v0) + li $t6, 3 + sw $t6, 16($v0) + move $t6, $v0 + # Allocating 48 bytes of memory + li $a0, 48 + li $v0, 9 + syscall + sw $t6, 0($v0) + la $t6, Bar_start + sw $t6, 4($v0) + # Load type offset + li $t6, 32 + sw $t6, 8($v0) + move $t5, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_trib__b__init_internal_12 --> -52($fp) - # LOCAL local_trib__b__init_internal_13 --> -56($fp) - # local_trib__b__init_internal_13 = VCALL local_trib__b__init_internal_12 printh - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 28($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -56($fp) + move $s1, $v0 + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t5) + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t5) + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t5) + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t5) + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t5) + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 32($t5) + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 36($t5) + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Bar__attrib__c__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 40($t5) + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Bar__attrib__d__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 44($t5) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_trib__b__init_internal_0 --> -4($fp) - # LOCAL local_trib__b__init_internal_1 --> -8($fp) - # LOCAL local_trib__b__init_internal_13 --> -56($fp) - # local_trib__b__init_internal_0 = local_trib__b__init_internal_1 + local_trib__b__init_internal_13 - lw $t3, -8($fp) - lw $t4, -56($fp) - add $t3, $t3, $t4 - sw $t3, -4($fp) - # RETURN local_trib__b__init_internal_0 + sw $t5, -4($fp) + # RETURN local_ttrib__d__init_internal_0 lw $v0, -4($fp) - # Deallocate stack frame for function __Foo__attrib__b__init. + # Deallocate stack frame for function __Main__attrib__d__init. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 68 + addu $sp, $sp, 32 jr $ra # Function END -# function_doh_at_Foo implementation. +# function_main_at_Main implementation. # @Params: -function_doh_at_Foo: - # Allocate stack frame for function function_doh_at_Foo. +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_doh_at_Foo_internal_1 = GETATTRIBUTE h Foo - # LOCAL local_doh_at_Foo_internal_1 --> -8($fp) - lw $t3, 12($s1) - sw $t3, -8($fp) - # LOCAL local_doh_at_Foo_i_0 --> -4($fp) - # LOCAL local_doh_at_Foo_internal_1 --> -8($fp) - # local_doh_at_Foo_i_0 = local_doh_at_Foo_internal_1 - lw $t3, -8($fp) - sw $t3, -4($fp) - # local_doh_at_Foo_internal_3 = GETATTRIBUTE h Foo - # LOCAL local_doh_at_Foo_internal_3 --> -16($fp) - lw $t3, 12($s1) - sw $t3, -16($fp) - # LOCAL local_doh_at_Foo_internal_2 --> -12($fp) - # LOCAL local_doh_at_Foo_internal_3 --> -16($fp) - # local_doh_at_Foo_internal_2 = local_doh_at_Foo_internal_3 + 2 - lw $t3, -16($fp) - add $t3, $t3, 2 - sw $t3, -12($fp) - # - # LOCAL local_doh_at_Foo_internal_2 --> -12($fp) - lw $t3, -12($fp) - sw $t3, 12($s1) - # RETURN local_doh_at_Foo_i_0 + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, data_4 + sw $t5, 12($v0) + li $t5, 10 + sw $t5, 16($v0) + sw $v0, -4($fp) + # RETURN local_main_at_Main_internal_0 lw $v0, -4($fp) - # Deallocate stack frame for function function_doh_at_Foo. + # Deallocate stack frame for function function_main_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp @@ -1221,94 +1156,17 @@ function_doh_at_Foo: # Function END -# __Bar__attrib__c__init implementation. +# __Bazz__attrib__h__init implementation. # @Params: -__Bar__attrib__c__init: - # Allocate stack frame for function __Bar__attrib__c__init. +__Bazz__attrib__h__init: + # Allocate stack frame for function __Bazz__attrib__h__init. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_trib__c__init_internal_2 --> -12($fp) - # local_trib__c__init_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_trib__c__init_internal_0 --> -4($fp) - # LOCAL local_trib__c__init_internal_2 --> -12($fp) - # local_trib__c__init_internal_0 = local_trib__c__init_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_trib__c__init_internal_0 --> -4($fp) - # LOCAL local_trib__c__init_internal_1 --> -8($fp) - # local_trib__c__init_internal_1 = VCALL local_trib__c__init_internal_0 doh - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 0($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_trib__c__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Bar__attrib__c__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Bar__attrib__d__init implementation. -# @Params: -__Bar__attrib__d__init: - # Allocate stack frame for function __Bar__attrib__d__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_trib__d__init_internal_2 --> -12($fp) - # local_trib__d__init_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_trib__d__init_internal_0 --> -4($fp) - # LOCAL local_trib__d__init_internal_2 --> -12($fp) - # local_trib__d__init_internal_0 = local_trib__d__init_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_trib__d__init_internal_0 --> -4($fp) - # LOCAL local_trib__d__init_internal_1 --> -8($fp) - # local_trib__d__init_internal_1 = VCALL local_trib__d__init_internal_0 printh - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 28($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_trib__d__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Bar__attrib__d__init. + # RETURN 1 + li $v0, 1 + # Deallocate stack frame for function __Bazz__attrib__h__init. # Restore $ra lw $ra, 4($sp) # Restore $fp @@ -1319,195 +1177,515 @@ __Bar__attrib__d__init: # Function END -# __Razz__attrib__e__init implementation. +# __Bazz__attrib__g__init implementation. # @Params: -__Razz__attrib__e__init: - # Allocate stack frame for function __Razz__attrib__e__init. - subu $sp, $sp, 40 +__Bazz__attrib__g__init: + # Allocate stack frame for function __Bazz__attrib__g__init. + subu $sp, $sp, 56 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 40 - # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) - # local_ttrib__e__init_internal_0 = SELF + addu $fp, $sp, 56 + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + # local_ttrib__g__init_internal_0 = SELF sw $s1, -4($fp) - # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) - # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) - # local_ttrib__e__init_internal_1 = TYPEOF local_ttrib__e__init_internal_0 - lw $t3, -4($fp) + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # local_ttrib__g__init_internal_1 = TYPEOF local_ttrib__g__init_internal_0 + lw $t5, -4($fp) # Load pointer to type offset - lw $t4, 8($t3) - sw $t4, -8($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) - # local_ttrib__e__init_internal_3 = 13 - li $t3, 13 - sw $t3, -16($fp) - # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) - # Load TDT pointer to type Razz - la $t3, Razz__TDT - lw $t4, -8($fp) - addu $t3, $t3, $t4 + lw $t6, 8($t5) + sw $t6, -8($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # local_ttrib__g__init_internal_3 = 13 + li $t5, 13 + sw $t5, -16($fp) + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bazz + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bazz + la $t5, Bazz__TDT + lw $t6, -8($fp) + addu $t5, $t5, $t6 # Save distance - lw $t4, 0($t3) - sw $t4, -20($fp) - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) - # Update min if 11 < 12 - lw $t3, -20($fp) - lw $t4, -16($fp) - bgtu $t3, $t4, label_Not_min0_9 - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # local_ttrib__e__init_internal_3 = local_ttrib__e__init_internal_4 - lw $t3, -20($fp) - sw $t3, -16($fp) - label_Not_min0_9: - # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) - # Load TDT pointer to type Bar - la $t3, Bar__TDT - lw $t4, -8($fp) - addu $t3, $t3, $t4 + lw $t6, 0($t5) + sw $t6, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 13 < 14 + lw $t5, -20($fp) + lw $t6, -16($fp) + bgtu $t5, $t6, label_Not_min0_1 + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 + lw $t5, -20($fp) + sw $t5, -16($fp) + label_Not_min0_1: + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Razz + la $t5, Razz__TDT + lw $t6, -8($fp) + addu $t5, $t5, $t6 # Save distance - lw $t4, 0($t3) - sw $t4, -20($fp) - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) - # Update min if 11 < 12 - lw $t3, -20($fp) - lw $t4, -16($fp) - bgtu $t3, $t4, label_Not_min1_10 - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # local_ttrib__e__init_internal_3 = local_ttrib__e__init_internal_4 - lw $t3, -20($fp) - sw $t3, -16($fp) - label_Not_min1_10: - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # local_ttrib__e__init_internal_4 = 13 - li $t3, 13 - sw $t3, -20($fp) - # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) - # local_ttrib__e__init_internal_2 = local_ttrib__e__init_internal_4 - local_ttrib__e__init_internal_3 - lw $t3, -20($fp) - lw $t4, -16($fp) - sub $t3, $t3, $t4 - sw $t3, -12($fp) - # IF_ZERO local_ttrib__e__init_internal_2 GOTO label_ERROR_11 - # IF_ZERO local_ttrib__e__init_internal_2 GOTO label_ERROR_11 - lw $t3, -12($fp) - beq $t3, 0, label_ERROR_11 - # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) - # Load TDT pointer to type Razz - la $t3, Razz__TDT - lw $t4, -8($fp) - addu $t3, $t3, $t4 + lw $t6, 0($t5) + sw $t6, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 13 < 14 + lw $t5, -20($fp) + lw $t6, -16($fp) + bgtu $t5, $t6, label_Not_min1_2 + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 + lw $t5, -20($fp) + sw $t5, -16($fp) + label_Not_min1_2: + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Foo + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Foo + la $t5, Foo__TDT + lw $t6, -8($fp) + addu $t5, $t5, $t6 # Save distance - lw $t4, 0($t3) - sw $t4, -20($fp) - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) - # Update min if 11 < 12 - lw $t3, -20($fp) - lw $t4, -16($fp) - bgtu $t3, $t4, label_NEXT0_13 - # LOCAL local_ttrib__e__init_n_5 --> -24($fp) - # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) - # local_ttrib__e__init_n_5 = local_ttrib__e__init_internal_0 - lw $t3, -4($fp) - sw $t3, -24($fp) - # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) - # local_ttrib__e__init_internal_6 = ALLOCATE Bar - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) - # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, Bar - sw $t5, 12($v0) - li $t5, 3 - sw $t5, 16($v0) - move $t5, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t5, 0($v0) - la $t5, Bar_start - sw $t5, 4($v0) - # Load type offset - li $t5, 20 - sw $t5, 8($v0) - move $t4, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t4 into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - jal __Bar__attrib__c__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t4) - # Push register t4 into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - jal __Bar__attrib__d__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t4) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t4, -28($fp) - # GOTO label_END_12 -j label_END_12 -label_NEXT0_13: - # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) - # Load TDT pointer to type Bar - la $t4, Bar__TDT - lw $t5, -8($fp) - addu $t4, $t4, $t5 + lw $t6, 0($t5) + sw $t6, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 13 < 14 + lw $t5, -20($fp) + lw $t6, -16($fp) + bgtu $t5, $t6, label_Not_min2_3 + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 + lw $t5, -20($fp) + sw $t5, -16($fp) + label_Not_min2_3: + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bar + la $t5, Bar__TDT + lw $t6, -8($fp) + addu $t5, $t5, $t6 + # Save distance + lw $t6, 0($t5) + sw $t6, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 13 < 14 + lw $t5, -20($fp) + lw $t6, -16($fp) + bgtu $t5, $t6, label_Not_min3_4 + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 + lw $t5, -20($fp) + sw $t5, -16($fp) + label_Not_min3_4: + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_4 = 13 + li $t5, 13 + sw $t5, -20($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # local_ttrib__g__init_internal_2 = local_ttrib__g__init_internal_4 - local_ttrib__g__init_internal_3 + lw $t5, -20($fp) + lw $t6, -16($fp) + sub $t5, $t5, $t6 + sw $t5, -12($fp) + # IF_ZERO local_ttrib__g__init_internal_2 GOTO label_ERROR_5 + # IF_ZERO local_ttrib__g__init_internal_2 GOTO label_ERROR_5 + lw $t5, -12($fp) + beq $t5, 0, label_ERROR_5 + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bazz + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bazz + la $t5, Bazz__TDT + lw $t6, -8($fp) + addu $t5, $t5, $t6 + # Save distance + lw $t6, 0($t5) + sw $t6, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 13 < 14 + lw $t5, -20($fp) + lw $t6, -16($fp) + bgtu $t5, $t6, label_NEXT0_7 + # LOCAL local_ttrib__g__init_n_5 --> -24($fp) + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + # local_ttrib__g__init_n_5 = local_ttrib__g__init_internal_0 + lw $t5, -4($fp) + sw $t5, -24($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # local_ttrib__g__init_internal_6 = ALLOCATE Foo + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) + # Load type offset + li $t7, 8 + sw $t7, 8($v0) + la $t7, Foo + sw $t7, 12($v0) + li $t7, 3 + sw $t7, 16($v0) + move $t7, $v0 + # Allocating 32 bytes of memory + li $a0, 32 + li $v0, 9 + syscall + sw $t7, 0($v0) + la $t7, Foo_start + sw $t7, 4($v0) + # Load type offset + li $t7, 24 + sw $t7, 8($v0) + move $t6, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t6) + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t6) + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t6) + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t6) + # Push register t6 into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t6 + lw $t6, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t6) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t6, -28($fp) + # GOTO label_END_6 +j label_END_6 +label_NEXT0_7: + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Razz + la $t6, Razz__TDT + lw $t7, -8($fp) + addu $t6, $t6, $t7 # Save distance - lw $t5, 0($t4) - sw $t5, -20($fp) - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) - # Update min if 12 < 13 - lw $t4, -20($fp) - lw $t5, -16($fp) - bgtu $t4, $t5, label_NEXT1_14 - # LOCAL local_ttrib__e__init_n_7 --> -32($fp) - # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) - # local_ttrib__e__init_n_7 = local_ttrib__e__init_internal_0 - lw $t4, -4($fp) - sw $t4, -32($fp) - # GOTO label_END_12 -j label_END_12 -label_NEXT1_14: - label_ERROR_11: - # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) - lw $t4, 0($s1) - sw $t4, -4($fp) - # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) + lw $t7, 0($t6) + sw $t7, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 14 < 15 + lw $t6, -20($fp) + lw $t7, -16($fp) + bgtu $t6, $t7, label_NEXT1_8 + # LOCAL local_ttrib__g__init_n_7 --> -32($fp) + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + # local_ttrib__g__init_n_7 = local_ttrib__g__init_internal_0 + lw $t6, -4($fp) + sw $t6, -32($fp) + # LOCAL local_ttrib__g__init_internal_8 --> -36($fp) + # local_ttrib__g__init_internal_8 = ALLOCATE Bar + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t8, String + sw $t8, 0($v0) + la $t8, String_start + sw $t8, 4($v0) + # Load type offset + li $t8, 8 + sw $t8, 8($v0) + la $t8, Bar + sw $t8, 12($v0) + li $t8, 3 + sw $t8, 16($v0) + move $t8, $v0 + # Allocating 48 bytes of memory + li $a0, 48 + li $v0, 9 + syscall + sw $t8, 0($v0) + la $t8, Bar_start + sw $t8, 4($v0) + # Load type offset + li $t8, 32 + sw $t8, 8($v0) + move $t7, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 32($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 36($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Bar__attrib__c__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 40($t7) + # Push register t7 into stack + subu $sp, $sp, 4 + sw $t7, 0($sp) + jal __Bar__attrib__d__init + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) + addu $sp, $sp, 4 + sw $v0, 44($t7) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t7, -36($fp) + # GOTO label_END_6 +j label_END_6 +label_NEXT1_8: + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Foo + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Foo + la $t7, Foo__TDT + lw $t8, -8($fp) + addu $t7, $t7, $t8 + # Save distance + lw $t8, 0($t7) + sw $t8, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 15 < 24 + lw $t7, -20($fp) + lw $t8, -16($fp) + bgtu $t7, $t8, label_NEXT2_9 + # LOCAL local_ttrib__g__init_n_9 --> -40($fp) + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + # local_ttrib__g__init_n_9 = local_ttrib__g__init_internal_0 + lw $t7, -4($fp) + sw $t7, -40($fp) + # LOCAL local_ttrib__g__init_internal_10 --> -44($fp) + # local_ttrib__g__init_internal_10 = ALLOCATE Razz + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) + # Load type offset + li $t9, 8 + sw $t9, 8($v0) + la $t9, Razz + sw $t9, 12($v0) + li $t9, 4 + sw $t9, 16($v0) + move $t9, $v0 + # Allocating 40 bytes of memory + li $a0, 40 + li $v0, 9 + syscall + sw $t9, 0($v0) + la $t9, Razz_start + sw $t9, 4($v0) + # Load type offset + li $t9, 28 + sw $t9, 8($v0) + move $t8, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 32($t8) + # Push register t8 into stack + subu $sp, $sp, 4 + sw $t8, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) + addu $sp, $sp, 4 + sw $v0, 36($t8) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t8, -44($fp) + # GOTO label_END_6 +j label_END_6 +label_NEXT2_9: + # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bar + la $t8, Bar__TDT + lw $t9, -8($fp) + addu $t8, $t8, $t9 + # Save distance + lw $t9, 0($t8) + sw $t9, -20($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # Update min if 24 < 25 + lw $t8, -20($fp) + lw $t9, -16($fp) + bgtu $t8, $t9, label_NEXT3_10 + # LOCAL local_ttrib__g__init_n_11 --> -48($fp) + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + # local_ttrib__g__init_n_11 = local_ttrib__g__init_internal_0 + lw $t8, -4($fp) + sw $t8, -48($fp) + # GOTO label_END_6 +j label_END_6 +label_NEXT3_10: + label_ERROR_5: + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + lw $t8, 0($s1) + sw $t8, -4($fp) + # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) la $a0, data_1 li $v0, 4 syscall @@ -1519,219 +1697,161 @@ label_NEXT1_14: syscall li $v0, 10 syscall - label_END_12: + label_END_6: # RETURN -# Deallocate stack frame for function __Razz__attrib__e__init. +# Deallocate stack frame for function __Bazz__attrib__g__init. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 40 +addu $sp, $sp, 56 jr $ra # Function END -# __Razz__attrib__f__init implementation. +# __Bazz__attrib__i__init implementation. # @Params: -__Razz__attrib__f__init: - # Allocate stack frame for function __Razz__attrib__f__init. - subu $sp, $sp, 80 +__Bazz__attrib__i__init: + # Allocate stack frame for function __Bazz__attrib__i__init. + subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 80 - # local_ttrib__f__init_internal_5 = GETATTRIBUTE a Razz - # LOCAL local_ttrib__f__init_internal_5 --> -24($fp) - lw $t4, 12($s1) - sw $t4, -24($fp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__i__init_internal_2 --> -12($fp) + # local_ttrib__i__init_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_ttrib__i__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__i__init_internal_2 --> -12($fp) + # local_ttrib__i__init_internal_0 = local_ttrib__i__init_internal_2 + lw $t8, -12($fp) + sw $t8, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_ttrib__f__init_internal_4 = CALL doh - # LOCAL local_ttrib__f__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__f__init_internal_5 --> -24($fp) + # LOCAL local_ttrib__i__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__i__init_internal_1 --> -8($fp) + # local_ttrib__i__init_internal_1 = VCALL local_ttrib__i__init_internal_0 printh # Save new self pointer in $s1 - lw $s1, -24($fp) + lw $s1, -4($fp) + # Get pointer to type + lw $t8, 4($s1) # Get pointer to type's VTABLE - la $t4, Bazz_vtable + lw $t9, 0($t8) # Get pointer to function address - lw $t5, 0($t4) + lw $s2, 28($t9) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -20($fp) + jalr $s2 + sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # local_ttrib__f__init_internal_8 = GETATTRIBUTE g Razz - # LOCAL local_ttrib__f__init_internal_8 --> -36($fp) - lw $t4, 12($s1) - sw $t4, -36($fp) - # LOCAL local_ttrib__f__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__f__init_internal_8 --> -36($fp) - # local_ttrib__f__init_internal_6 = local_ttrib__f__init_internal_8 - lw $t4, -36($fp) - sw $t4, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_ttrib__f__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__f__init_internal_7 --> -32($fp) - # local_ttrib__f__init_internal_7 = VCALL local_ttrib__f__init_internal_6 doh - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t4, 4($s1) - # Get pointer to type's VTABLE - lw $t5, 0($t4) - # Get pointer to function address - lw $t6, 0($t5) - # Call function. Result is on $v0 - jalr $t6 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_ttrib__f__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__f__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__f__init_internal_7 --> -32($fp) - # local_ttrib__f__init_internal_3 = local_ttrib__f__init_internal_4 + local_ttrib__f__init_internal_7 - lw $t4, -20($fp) - lw $t5, -32($fp) - add $t4, $t4, $t5 - sw $t4, -16($fp) - # local_ttrib__f__init_internal_11 = GETATTRIBUTE e Razz - # LOCAL local_ttrib__f__init_internal_11 --> -48($fp) - lw $t4, 20($s1) - sw $t4, -48($fp) - # LOCAL local_ttrib__f__init_internal_9 --> -40($fp) - # LOCAL local_ttrib__f__init_internal_11 --> -48($fp) - # local_ttrib__f__init_internal_9 = local_ttrib__f__init_internal_11 - lw $t4, -48($fp) - sw $t4, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_ttrib__f__init_internal_9 --> -40($fp) - # LOCAL local_ttrib__f__init_internal_10 --> -44($fp) - # local_ttrib__f__init_internal_10 = VCALL local_ttrib__f__init_internal_9 doh - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t4, 4($s1) - # Get pointer to type's VTABLE - lw $t5, 0($t4) - # Get pointer to function address - lw $t6, 0($t5) - # Call function. Result is on $v0 - jalr $t6 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_ttrib__f__init_internal_2 --> -12($fp) - # LOCAL local_ttrib__f__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__f__init_internal_10 --> -44($fp) - # local_ttrib__f__init_internal_2 = local_ttrib__f__init_internal_3 + local_ttrib__f__init_internal_10 - lw $t4, -16($fp) - lw $t5, -44($fp) - add $t4, $t4, $t5 - sw $t4, -12($fp) - # LOCAL local_ttrib__f__init_internal_14 --> -60($fp) - # local_ttrib__f__init_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_ttrib__f__init_internal_12 --> -52($fp) - # LOCAL local_ttrib__f__init_internal_14 --> -60($fp) - # local_ttrib__f__init_internal_12 = local_ttrib__f__init_internal_14 - lw $t4, -60($fp) - sw $t4, -52($fp) + # RETURN local_ttrib__i__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Bazz__attrib__i__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_printh_at_Bazz implementation. +# @Params: +function_printh_at_Bazz: + # Allocate stack frame for function function_printh_at_Bazz. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_printh_at_Bazz_internal_2 --> -12($fp) + # local_printh_at_Bazz_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_printh_at_Bazz_internal_0 --> -4($fp) + # LOCAL local_printh_at_Bazz_internal_2 --> -12($fp) + # local_printh_at_Bazz_internal_0 = local_printh_at_Bazz_internal_2 + lw $t8, -12($fp) + sw $t8, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_ttrib__f__init_internal_12 --> -52($fp) - # LOCAL local_ttrib__f__init_internal_13 --> -56($fp) - # local_ttrib__f__init_internal_13 = VCALL local_ttrib__f__init_internal_12 doh - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t4, 4($s1) - # Get pointer to type's VTABLE - lw $t5, 0($t4) - # Get pointer to function address - lw $t6, 0($t5) - # Call function. Result is on $v0 - jalr $t6 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_ttrib__f__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__f__init_internal_2 --> -12($fp) - # LOCAL local_ttrib__f__init_internal_13 --> -56($fp) - # local_ttrib__f__init_internal_1 = local_ttrib__f__init_internal_2 + local_ttrib__f__init_internal_13 - lw $t4, -12($fp) - lw $t5, -56($fp) - add $t4, $t4, $t5 - sw $t4, -8($fp) - # LOCAL local_ttrib__f__init_internal_17 --> -72($fp) - # local_ttrib__f__init_internal_17 = SELF - sw $s1, -72($fp) - # LOCAL local_ttrib__f__init_internal_15 --> -64($fp) - # LOCAL local_ttrib__f__init_internal_17 --> -72($fp) - # local_ttrib__f__init_internal_15 = local_ttrib__f__init_internal_17 - lw $t4, -72($fp) - sw $t4, -64($fp) - # Push register s1 into stack + # local_printh_at_Bazz_internal_3 = GETATTRIBUTE h Bazz + # LOCAL local_printh_at_Bazz_internal_3 --> -16($fp) + lw $t8, 12($s1) + sw $t8, -16($fp) + # ARG local_printh_at_Bazz_internal_3 + # LOCAL local_printh_at_Bazz_internal_3 --> -16($fp) + lw $t8, -16($fp) + # Push arg into stack subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_ttrib__f__init_internal_15 --> -64($fp) - # LOCAL local_ttrib__f__init_internal_16 --> -68($fp) - # local_ttrib__f__init_internal_16 = VCALL local_ttrib__f__init_internal_15 printh + sw $t8, 0($sp) + # LOCAL local_printh_at_Bazz_internal_0 --> -4($fp) + # LOCAL local_printh_at_Bazz_internal_1 --> -8($fp) + # local_printh_at_Bazz_internal_1 = VCALL local_printh_at_Bazz_internal_0 out_int # Save new self pointer in $s1 - lw $s1, -64($fp) + lw $s1, -4($fp) # Get pointer to type - lw $t4, 4($s1) + lw $t8, 4($s1) # Get pointer to type's VTABLE - lw $t5, 0($t4) + lw $t9, 0($t8) # Get pointer to function address - lw $t6, 28($t5) + lw $s2, 16($t9) # Call function. Result is on $v0 - jalr $t6 - sw $v0, -68($fp) + jalr $s2 + sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_ttrib__f__init_internal_0 --> -4($fp) - # LOCAL local_ttrib__f__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__f__init_internal_16 --> -68($fp) - # local_ttrib__f__init_internal_0 = local_ttrib__f__init_internal_1 + local_ttrib__f__init_internal_16 - lw $t4, -8($fp) - lw $t5, -68($fp) - add $t4, $t4, $t5 - sw $t4, -4($fp) - # RETURN local_ttrib__f__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Razz__attrib__f__init. + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function function_printh_at_Bazz. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 80 + addu $sp, $sp, 32 jr $ra # Function END -# __Bazz__attrib__h__init implementation. +# function_doh_at_Bazz implementation. # @Params: -__Bazz__attrib__h__init: - # Allocate stack frame for function __Bazz__attrib__h__init. +function_doh_at_Bazz: + # Allocate stack frame for function function_doh_at_Bazz. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN 1 - li $v0, 1 - # Deallocate stack frame for function __Bazz__attrib__h__init. + # local_doh_at_Bazz_internal_1 = GETATTRIBUTE h Bazz + # LOCAL local_doh_at_Bazz_internal_1 --> -8($fp) + lw $t8, 12($s1) + sw $t8, -8($fp) + # LOCAL local_doh_at_Bazz_i_0 --> -4($fp) + # LOCAL local_doh_at_Bazz_internal_1 --> -8($fp) + # local_doh_at_Bazz_i_0 = local_doh_at_Bazz_internal_1 + lw $t8, -8($fp) + sw $t8, -4($fp) + # local_doh_at_Bazz_internal_3 = GETATTRIBUTE h Bazz + # LOCAL local_doh_at_Bazz_internal_3 --> -16($fp) + lw $t8, 12($s1) + sw $t8, -16($fp) + # LOCAL local_doh_at_Bazz_internal_2 --> -12($fp) + # LOCAL local_doh_at_Bazz_internal_3 --> -16($fp) + # local_doh_at_Bazz_internal_2 = local_doh_at_Bazz_internal_3 + 1 + lw $t8, -16($fp) + add $t8, $t8, 1 + sw $t8, -12($fp) + # + # LOCAL local_doh_at_Bazz_internal_2 --> -12($fp) + lw $t8, -12($fp) + sw $t8, 12($s1) + # RETURN local_doh_at_Bazz_i_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_doh_at_Bazz. # Restore $ra lw $ra, 4($sp) # Restore $fp @@ -1742,411 +1862,863 @@ __Bazz__attrib__h__init: # Function END -# __Bazz__attrib__g__init implementation. +# __Foo__attrib__a__init implementation. # @Params: -__Bazz__attrib__g__init: - # Allocate stack frame for function __Bazz__attrib__g__init. - subu $sp, $sp, 56 +__Foo__attrib__a__init: + # Allocate stack frame for function __Foo__attrib__a__init. + subu $sp, $sp, 48 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 56 - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_internal_0 = SELF + addu $fp, $sp, 48 + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + # local_trib__a__init_internal_0 = SELF sw $s1, -4($fp) - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # local_ttrib__g__init_internal_1 = TYPEOF local_ttrib__g__init_internal_0 - lw $t4, -4($fp) + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # local_trib__a__init_internal_1 = TYPEOF local_trib__a__init_internal_0 + lw $t8, -4($fp) # Load pointer to type offset - lw $t5, 8($t4) - sw $t5, -8($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # local_ttrib__g__init_internal_3 = 13 - li $t4, 13 - sw $t4, -16($fp) - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bazz - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # Load TDT pointer to type Bazz - la $t4, Bazz__TDT - lw $t5, -8($fp) - addu $t4, $t4, $t5 + lw $t9, 8($t8) + sw $t9, -8($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # local_trib__a__init_internal_3 = 13 + li $t8, 13 + sw $t8, -16($fp) + # local_trib__a__init_internal_4 = TYPE_DISTANCE Razz + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # Load TDT pointer to type Razz + la $t8, Razz__TDT + lw $t9, -8($fp) + addu $t8, $t8, $t9 # Save distance - lw $t5, 0($t4) - sw $t5, -20($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # Update min if 12 < 13 - lw $t4, -20($fp) - lw $t5, -16($fp) - bgtu $t4, $t5, label_Not_min0_15 - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 - lw $t4, -20($fp) - sw $t4, -16($fp) - label_Not_min0_15: - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # Load TDT pointer to type Razz - la $t4, Razz__TDT - lw $t5, -8($fp) - addu $t4, $t4, $t5 + lw $t9, 0($t8) + sw $t9, -20($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # Update min if 24 < 25 + lw $t8, -20($fp) + lw $t9, -16($fp) + bgtu $t8, $t9, label_Not_min0_11 + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_3 = local_trib__a__init_internal_4 + lw $t8, -20($fp) + sw $t8, -16($fp) + label_Not_min0_11: + # local_trib__a__init_internal_4 = TYPE_DISTANCE Foo + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # Load TDT pointer to type Foo + la $t8, Foo__TDT + lw $t9, -8($fp) + addu $t8, $t8, $t9 # Save distance - lw $t5, 0($t4) - sw $t5, -20($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # Update min if 12 < 13 - lw $t4, -20($fp) - lw $t5, -16($fp) - bgtu $t4, $t5, label_Not_min1_16 - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 - lw $t4, -20($fp) - sw $t4, -16($fp) - label_Not_min1_16: - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Foo - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # Load TDT pointer to type Foo - la $t4, Foo__TDT - lw $t5, -8($fp) - addu $t4, $t4, $t5 + lw $t9, 0($t8) + sw $t9, -20($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # Update min if 24 < 25 + lw $t8, -20($fp) + lw $t9, -16($fp) + bgtu $t8, $t9, label_Not_min1_12 + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_3 = local_trib__a__init_internal_4 + lw $t8, -20($fp) + sw $t8, -16($fp) + label_Not_min1_12: + # local_trib__a__init_internal_4 = TYPE_DISTANCE Bar + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bar + la $t8, Bar__TDT + lw $t9, -8($fp) + addu $t8, $t8, $t9 # Save distance - lw $t5, 0($t4) - sw $t5, -20($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # Update min if 12 < 13 - lw $t4, -20($fp) - lw $t5, -16($fp) - bgtu $t4, $t5, label_Not_min2_17 - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 - lw $t4, -20($fp) - sw $t4, -16($fp) - label_Not_min2_17: - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # Load TDT pointer to type Bar - la $t4, Bar__TDT - lw $t5, -8($fp) - addu $t4, $t4, $t5 + lw $t9, 0($t8) + sw $t9, -20($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # Update min if 24 < 25 + lw $t8, -20($fp) + lw $t9, -16($fp) + bgtu $t8, $t9, label_Not_min2_13 + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_3 = local_trib__a__init_internal_4 + lw $t8, -20($fp) + sw $t8, -16($fp) + label_Not_min2_13: + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_4 = 13 + li $t8, 13 + sw $t8, -20($fp) + # LOCAL local_trib__a__init_internal_2 --> -12($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # local_trib__a__init_internal_2 = local_trib__a__init_internal_4 - local_trib__a__init_internal_3 + lw $t8, -20($fp) + lw $t9, -16($fp) + sub $t8, $t8, $t9 + sw $t8, -12($fp) + # IF_ZERO local_trib__a__init_internal_2 GOTO label_ERROR_14 + # IF_ZERO local_trib__a__init_internal_2 GOTO label_ERROR_14 + lw $t8, -12($fp) + beq $t8, 0, label_ERROR_14 + # local_trib__a__init_internal_4 = TYPE_DISTANCE Razz + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # Load TDT pointer to type Razz + la $t8, Razz__TDT + lw $t9, -8($fp) + addu $t8, $t8, $t9 # Save distance - lw $t5, 0($t4) - sw $t5, -20($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # Update min if 12 < 13 - lw $t4, -20($fp) - lw $t5, -16($fp) - bgtu $t4, $t5, label_Not_min3_18 - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 - lw $t4, -20($fp) - sw $t4, -16($fp) - label_Not_min3_18: - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # local_ttrib__g__init_internal_4 = 13 - li $t4, 13 - sw $t4, -20($fp) - # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # local_ttrib__g__init_internal_2 = local_ttrib__g__init_internal_4 - local_ttrib__g__init_internal_3 - lw $t4, -20($fp) - lw $t5, -16($fp) - sub $t4, $t4, $t5 - sw $t4, -12($fp) - # IF_ZERO local_ttrib__g__init_internal_2 GOTO label_ERROR_19 - # IF_ZERO local_ttrib__g__init_internal_2 GOTO label_ERROR_19 - lw $t4, -12($fp) - beq $t4, 0, label_ERROR_19 - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bazz - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # Load TDT pointer to type Bazz - la $t4, Bazz__TDT - lw $t5, -8($fp) - addu $t4, $t4, $t5 - # Save distance - lw $t5, 0($t4) - sw $t5, -20($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # Update min if 12 < 13 - lw $t4, -20($fp) - lw $t5, -16($fp) - bgtu $t4, $t5, label_NEXT0_21 - # LOCAL local_ttrib__g__init_n_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_n_5 = local_ttrib__g__init_internal_0 - lw $t4, -4($fp) - sw $t4, -24($fp) - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # local_ttrib__g__init_internal_6 = ALLOCATE Foo - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t6, String - sw $t6, 0($v0) - la $t6, String_start - sw $t6, 4($v0) - # Load type offset - li $t6, 8 - sw $t6, 8($v0) - la $t6, Foo - sw $t6, 12($v0) - li $t6, 3 - sw $t6, 16($v0) - move $t6, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t6, 0($v0) - la $t6, Foo_start - sw $t6, 4($v0) - # Load type offset - li $t6, 16 - sw $t6, 8($v0) - move $t5, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t5 into stack - subu $sp, $sp, 4 - sw $t5, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t5) - # Push register t5 into stack - subu $sp, $sp, 4 - sw $t5, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t5) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t5, -28($fp) - # GOTO label_END_20 -j label_END_20 -label_NEXT0_21: - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # Load TDT pointer to type Razz - la $t5, Razz__TDT - lw $t6, -8($fp) - addu $t5, $t5, $t6 + lw $t9, 0($t8) + sw $t9, -20($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # Update min if 24 < 25 + lw $t8, -20($fp) + lw $t9, -16($fp) + bgtu $t8, $t9, label_NEXT0_16 + # LOCAL local_trib__a__init_n_5 --> -24($fp) + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + # local_trib__a__init_n_5 = local_trib__a__init_internal_0 + lw $t8, -4($fp) + sw $t8, -24($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # local_trib__a__init_internal_6 = ALLOCATE Bar + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $s2, String + sw $s2, 0($v0) + la $s2, String_start + sw $s2, 4($v0) + # Load type offset + li $s2, 8 + sw $s2, 8($v0) + la $s2, Bar + sw $s2, 12($v0) + li $s2, 3 + sw $s2, 16($v0) + move $s2, $v0 + # Allocating 48 bytes of memory + li $a0, 48 + li $v0, 9 + syscall + sw $s2, 0($v0) + la $s2, Bar_start + sw $s2, 4($v0) + # Load type offset + li $s2, 32 + sw $s2, 8($v0) + move $t9, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 32($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 36($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Bar__attrib__c__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 40($t9) + # Push register t9 into stack + subu $sp, $sp, 4 + sw $t9, 0($sp) + jal __Bar__attrib__d__init + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) + addu $sp, $sp, 4 + sw $v0, 44($t9) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t9, -28($fp) + # GOTO label_END_15 +j label_END_15 +label_NEXT0_16: + # local_trib__a__init_internal_4 = TYPE_DISTANCE Foo + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # Load TDT pointer to type Foo + la $t9, Foo__TDT + lw $s2, -8($fp) + addu $t9, $t9, $s2 # Save distance - lw $t6, 0($t5) - sw $t6, -20($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # Update min if 13 < 14 - lw $t5, -20($fp) - lw $t6, -16($fp) - bgtu $t5, $t6, label_NEXT1_22 - # LOCAL local_ttrib__g__init_n_7 --> -32($fp) - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_n_7 = local_ttrib__g__init_internal_0 - lw $t5, -4($fp) - sw $t5, -32($fp) - # LOCAL local_ttrib__g__init_internal_8 --> -36($fp) - # local_ttrib__g__init_internal_8 = ALLOCATE Bar + lw $s2, 0($t9) + sw $s2, -20($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # Update min if 25 < 18 + lw $t9, -20($fp) + lw $s2, -16($fp) + bgtu $t9, $s2, label_NEXT1_17 + # LOCAL local_trib__a__init_n_7 --> -32($fp) + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + # local_trib__a__init_n_7 = local_trib__a__init_internal_0 + lw $t9, -4($fp) + sw $t9, -32($fp) + # LOCAL local_trib__a__init_internal_8 --> -36($fp) + # local_trib__a__init_internal_8 = ALLOCATE Razz # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) + la $s3, String + sw $s3, 0($v0) + la $s3, String_start + sw $s3, 4($v0) # Load type offset - li $t7, 8 - sw $t7, 8($v0) - la $t7, Bar - sw $t7, 12($v0) - li $t7, 3 - sw $t7, 16($v0) - move $t7, $v0 - # Allocating 20 bytes of memory - li $a0, 20 + li $s3, 8 + sw $s3, 8($v0) + la $s3, Razz + sw $s3, 12($v0) + li $s3, 4 + sw $s3, 16($v0) + move $s3, $v0 + # Allocating 40 bytes of memory + li $a0, 40 li $v0, 9 syscall - sw $t7, 0($v0) - la $t7, Bar_start - sw $t7, 4($v0) + sw $s3, 0($v0) + la $s3, Razz_start + sw $s3, 4($v0) # Load type offset - li $t7, 20 - sw $t7, 8($v0) - move $t6, $v0 + li $s3, 28 + sw $s3, 8($v0) + move $s2, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t6 into stack + # Push register s2 into stack subu $sp, $sp, 4 - sw $t6, 0($sp) - jal __Bar__attrib__c__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) + sw $s2, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register s2 + lw $s2, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t6) - # Push register t6 into stack + sw $v0, 12($s2) + # Push register s2 into stack subu $sp, $sp, 4 - sw $t6, 0($sp) - jal __Bar__attrib__d__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t6) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) + sw $s2, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register s2 + lw $s2, 0($sp) addu $sp, $sp, 4 - sw $t6, -36($fp) - # GOTO label_END_20 -j label_END_20 -label_NEXT1_22: - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Foo - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # Load TDT pointer to type Foo - la $t6, Foo__TDT - lw $t7, -8($fp) - addu $t6, $t6, $t7 - # Save distance - lw $t7, 0($t6) - sw $t7, -20($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # Update min if 14 < 15 - lw $t6, -20($fp) - lw $t7, -16($fp) - bgtu $t6, $t7, label_NEXT2_23 - # LOCAL local_ttrib__g__init_n_9 --> -40($fp) - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_n_9 = local_ttrib__g__init_internal_0 - lw $t6, -4($fp) - sw $t6, -40($fp) - # LOCAL local_ttrib__g__init_internal_10 --> -44($fp) - # local_ttrib__g__init_internal_10 = ALLOCATE Razz - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t8, String - sw $t8, 0($v0) - la $t8, String_start - sw $t8, 4($v0) - # Load type offset - li $t8, 8 - sw $t8, 8($v0) - la $t8, Razz - sw $t8, 12($v0) - li $t8, 4 - sw $t8, 16($v0) - move $t8, $v0 - # Allocating 28 bytes of memory - li $a0, 28 - li $v0, 9 - syscall - sw $t8, 0($v0) - la $t8, Razz_start - sw $t8, 4($v0) - # Load type offset - li $t8, 24 - sw $t8, 8($v0) - move $t7, $v0 - # Push register s1 into stack + sw $v0, 16($s2) + # Push register s2 into stack subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t7 into stack + sw $s2, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register s2 + lw $s2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($s2) + # Push register s2 into stack subu $sp, $sp, 4 - sw $t7, 0($sp) + sw $s2, 0($sp) jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) + # Pop 4 bytes from stack into register s2 + lw $s2, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t7) - # Push register t7 into stack + sw $v0, 24($s2) + # Push register s2 into stack subu $sp, $sp, 4 - sw $t7, 0($sp) + sw $s2, 0($sp) jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) + # Pop 4 bytes from stack into register s2 + lw $s2, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t7) - # Push register t7 into stack + sw $v0, 28($s2) + # Push register s2 into stack subu $sp, $sp, 4 - sw $t7, 0($sp) + sw $s2, 0($sp) jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) + # Pop 4 bytes from stack into register s2 + lw $s2, 0($sp) addu $sp, $sp, 4 - sw $v0, 20($t7) - # Push register t7 into stack + sw $v0, 32($s2) + # Push register s2 into stack subu $sp, $sp, 4 - sw $t7, 0($sp) + sw $s2, 0($sp) jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) + # Pop 4 bytes from stack into register s2 + lw $s2, 0($sp) addu $sp, $sp, 4 - sw $v0, 24($t7) + sw $v0, 36($s2) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t7, -44($fp) - # GOTO label_END_20 -j label_END_20 -label_NEXT2_23: - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + sw $s2, -36($fp) + # GOTO label_END_15 +j label_END_15 +label_NEXT1_17: + # local_trib__a__init_internal_4 = TYPE_DISTANCE Bar + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) # Load TDT pointer to type Bar - la $t7, Bar__TDT - lw $t8, -8($fp) - addu $t7, $t7, $t8 + la $s2, Bar__TDT + lw $s3, -8($fp) + addu $s2, $s2, $s3 # Save distance - lw $t8, 0($t7) - sw $t8, -20($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # Update min if 15 < 24 - lw $t7, -20($fp) - lw $t8, -16($fp) - bgtu $t7, $t8, label_NEXT3_24 - # LOCAL local_ttrib__g__init_n_11 --> -48($fp) - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_n_11 = local_ttrib__g__init_internal_0 - lw $t7, -4($fp) - sw $t7, -48($fp) - # GOTO label_END_20 -j label_END_20 -label_NEXT3_24: - label_ERROR_19: - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - lw $t7, 0($s1) - sw $t7, -4($fp) - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + lw $s3, 0($s2) + sw $s3, -20($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # Update min if 18 < 19 + lw $s2, -20($fp) + lw $s3, -16($fp) + bgtu $s2, $s3, label_NEXT2_18 + # LOCAL local_trib__a__init_n_9 --> -40($fp) + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + # local_trib__a__init_n_9 = local_trib__a__init_internal_0 + lw $s2, -4($fp) + sw $s2, -40($fp) + # GOTO label_END_15 +j label_END_15 +label_NEXT2_18: + label_ERROR_14: + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + lw $s2, 0($s1) + sw $s2, -4($fp) + # LOCAL local_trib__a__init_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + label_END_15: +# RETURN +# Deallocate stack frame for function __Foo__attrib__a__init. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 48 +jr $ra +# Function END + + +# __Foo__attrib__b__init implementation. +# @Params: +__Foo__attrib__b__init: + # Allocate stack frame for function __Foo__attrib__b__init. + subu $sp, $sp, 68 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 68 + # local_trib__b__init_internal_5 = GETATTRIBUTE a Foo + # LOCAL local_trib__b__init_internal_5 --> -24($fp) + lw $s2, 24($s1) + sw $s2, -24($fp) + # LOCAL local_trib__b__init_internal_3 --> -16($fp) + # LOCAL local_trib__b__init_internal_5 --> -24($fp) + # local_trib__b__init_internal_3 = local_trib__b__init_internal_5 + lw $s2, -24($fp) + sw $s2, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__b__init_internal_3 --> -16($fp) + # LOCAL local_trib__b__init_internal_4 --> -20($fp) + # local_trib__b__init_internal_4 = VCALL local_trib__b__init_internal_3 doh + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 32($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_trib__b__init_internal_8 = GETATTRIBUTE g Foo + # LOCAL local_trib__b__init_internal_8 --> -36($fp) + lw $s2, 16($s1) + sw $s2, -36($fp) + # LOCAL local_trib__b__init_internal_6 --> -28($fp) + # LOCAL local_trib__b__init_internal_8 --> -36($fp) + # local_trib__b__init_internal_6 = local_trib__b__init_internal_8 + lw $s2, -36($fp) + sw $s2, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__b__init_internal_6 --> -28($fp) + # LOCAL local_trib__b__init_internal_7 --> -32($fp) + # local_trib__b__init_internal_7 = VCALL local_trib__b__init_internal_6 doh + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 32($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_trib__b__init_internal_2 --> -12($fp) + # LOCAL local_trib__b__init_internal_4 --> -20($fp) + # LOCAL local_trib__b__init_internal_7 --> -32($fp) + # local_trib__b__init_internal_2 = local_trib__b__init_internal_4 + local_trib__b__init_internal_7 + lw $s2, -20($fp) + lw $s3, -32($fp) + add $s2, $s2, $s3 + sw $s2, -12($fp) + # LOCAL local_trib__b__init_internal_11 --> -48($fp) + # local_trib__b__init_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_trib__b__init_internal_9 --> -40($fp) + # LOCAL local_trib__b__init_internal_11 --> -48($fp) + # local_trib__b__init_internal_9 = local_trib__b__init_internal_11 + lw $s2, -48($fp) + sw $s2, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__b__init_internal_9 --> -40($fp) + # LOCAL local_trib__b__init_internal_10 --> -44($fp) + # local_trib__b__init_internal_10 = VCALL local_trib__b__init_internal_9 doh + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 32($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_trib__b__init_internal_1 --> -8($fp) + # LOCAL local_trib__b__init_internal_2 --> -12($fp) + # LOCAL local_trib__b__init_internal_10 --> -44($fp) + # local_trib__b__init_internal_1 = local_trib__b__init_internal_2 + local_trib__b__init_internal_10 + lw $s2, -12($fp) + lw $s3, -44($fp) + add $s2, $s2, $s3 + sw $s2, -8($fp) + # LOCAL local_trib__b__init_internal_14 --> -60($fp) + # local_trib__b__init_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_trib__b__init_internal_12 --> -52($fp) + # LOCAL local_trib__b__init_internal_14 --> -60($fp) + # local_trib__b__init_internal_12 = local_trib__b__init_internal_14 + lw $s2, -60($fp) + sw $s2, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__b__init_internal_12 --> -52($fp) + # LOCAL local_trib__b__init_internal_13 --> -56($fp) + # local_trib__b__init_internal_13 = VCALL local_trib__b__init_internal_12 printh + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 28($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_trib__b__init_internal_0 --> -4($fp) + # LOCAL local_trib__b__init_internal_1 --> -8($fp) + # LOCAL local_trib__b__init_internal_13 --> -56($fp) + # local_trib__b__init_internal_0 = local_trib__b__init_internal_1 + local_trib__b__init_internal_13 + lw $s2, -8($fp) + lw $s3, -56($fp) + add $s2, $s2, $s3 + sw $s2, -4($fp) + # RETURN local_trib__b__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Foo__attrib__b__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 68 + jr $ra + # Function END + + +# function_doh_at_Foo implementation. +# @Params: +function_doh_at_Foo: + # Allocate stack frame for function function_doh_at_Foo. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_doh_at_Foo_internal_1 = GETATTRIBUTE h Foo + # LOCAL local_doh_at_Foo_internal_1 --> -8($fp) + lw $s2, 12($s1) + sw $s2, -8($fp) + # LOCAL local_doh_at_Foo_i_0 --> -4($fp) + # LOCAL local_doh_at_Foo_internal_1 --> -8($fp) + # local_doh_at_Foo_i_0 = local_doh_at_Foo_internal_1 + lw $s2, -8($fp) + sw $s2, -4($fp) + # local_doh_at_Foo_internal_3 = GETATTRIBUTE h Foo + # LOCAL local_doh_at_Foo_internal_3 --> -16($fp) + lw $s2, 12($s1) + sw $s2, -16($fp) + # LOCAL local_doh_at_Foo_internal_2 --> -12($fp) + # LOCAL local_doh_at_Foo_internal_3 --> -16($fp) + # local_doh_at_Foo_internal_2 = local_doh_at_Foo_internal_3 + 2 + lw $s2, -16($fp) + add $s2, $s2, 2 + sw $s2, -12($fp) + # + # LOCAL local_doh_at_Foo_internal_2 --> -12($fp) + lw $s2, -12($fp) + sw $s2, 12($s1) + # RETURN local_doh_at_Foo_i_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_doh_at_Foo. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Razz__attrib__e__init implementation. +# @Params: +__Razz__attrib__e__init: + # Allocate stack frame for function __Razz__attrib__e__init. + subu $sp, $sp, 40 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 40 + # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) + # local_ttrib__e__init_internal_0 = SELF + sw $s1, -4($fp) + # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # local_ttrib__e__init_internal_1 = TYPEOF local_ttrib__e__init_internal_0 + lw $s2, -4($fp) + # Load pointer to type offset + lw $s3, 8($s2) + sw $s3, -8($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # local_ttrib__e__init_internal_3 = 13 + li $s2, 13 + sw $s2, -16($fp) + # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # Load TDT pointer to type Razz + la $s2, Razz__TDT + lw $s3, -8($fp) + addu $s2, $s2, $s3 + # Save distance + lw $s3, 0($s2) + sw $s3, -20($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # Update min if 18 < 19 + lw $s2, -20($fp) + lw $s3, -16($fp) + bgtu $s2, $s3, label_Not_min0_19 + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # local_ttrib__e__init_internal_3 = local_ttrib__e__init_internal_4 + lw $s2, -20($fp) + sw $s2, -16($fp) + label_Not_min0_19: + # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bar + la $s2, Bar__TDT + lw $s3, -8($fp) + addu $s2, $s2, $s3 + # Save distance + lw $s3, 0($s2) + sw $s3, -20($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # Update min if 18 < 19 + lw $s2, -20($fp) + lw $s3, -16($fp) + bgtu $s2, $s3, label_Not_min1_20 + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # local_ttrib__e__init_internal_3 = local_ttrib__e__init_internal_4 + lw $s2, -20($fp) + sw $s2, -16($fp) + label_Not_min1_20: + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # local_ttrib__e__init_internal_4 = 13 + li $s2, 13 + sw $s2, -20($fp) + # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # local_ttrib__e__init_internal_2 = local_ttrib__e__init_internal_4 - local_ttrib__e__init_internal_3 + lw $s2, -20($fp) + lw $s3, -16($fp) + sub $s2, $s2, $s3 + sw $s2, -12($fp) + # IF_ZERO local_ttrib__e__init_internal_2 GOTO label_ERROR_21 + # IF_ZERO local_ttrib__e__init_internal_2 GOTO label_ERROR_21 + lw $s2, -12($fp) + beq $s2, 0, label_ERROR_21 + # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # Load TDT pointer to type Razz + la $s2, Razz__TDT + lw $s3, -8($fp) + addu $s2, $s2, $s3 + # Save distance + lw $s3, 0($s2) + sw $s3, -20($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # Update min if 18 < 19 + lw $s2, -20($fp) + lw $s3, -16($fp) + bgtu $s2, $s3, label_NEXT0_23 + # LOCAL local_ttrib__e__init_n_5 --> -24($fp) + # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) + # local_ttrib__e__init_n_5 = local_ttrib__e__init_internal_0 + lw $s2, -4($fp) + sw $s2, -24($fp) + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # local_ttrib__e__init_internal_6 = ALLOCATE Bar + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $s4, String + sw $s4, 0($v0) + la $s4, String_start + sw $s4, 4($v0) + # Load type offset + li $s4, 8 + sw $s4, 8($v0) + la $s4, Bar + sw $s4, 12($v0) + li $s4, 3 + sw $s4, 16($v0) + move $s4, $v0 + # Allocating 48 bytes of memory + li $a0, 48 + li $v0, 9 + syscall + sw $s4, 0($v0) + la $s4, Bar_start + sw $s4, 4($v0) + # Load type offset + li $s4, 32 + sw $s4, 8($v0) + move $s3, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register s3 into stack + subu $sp, $sp, 4 + sw $s3, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register s3 + lw $s3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($s3) + # Push register s3 into stack + subu $sp, $sp, 4 + sw $s3, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register s3 + lw $s3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($s3) + # Push register s3 into stack + subu $sp, $sp, 4 + sw $s3, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register s3 + lw $s3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($s3) + # Push register s3 into stack + subu $sp, $sp, 4 + sw $s3, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register s3 + lw $s3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($s3) + # Push register s3 into stack + subu $sp, $sp, 4 + sw $s3, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register s3 + lw $s3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($s3) + # Push register s3 into stack + subu $sp, $sp, 4 + sw $s3, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register s3 + lw $s3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 32($s3) + # Push register s3 into stack + subu $sp, $sp, 4 + sw $s3, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register s3 + lw $s3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 36($s3) + # Push register s3 into stack + subu $sp, $sp, 4 + sw $s3, 0($sp) + jal __Bar__attrib__c__init + # Pop 4 bytes from stack into register s3 + lw $s3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 40($s3) + # Push register s3 into stack + subu $sp, $sp, 4 + sw $s3, 0($sp) + jal __Bar__attrib__d__init + # Pop 4 bytes from stack into register s3 + lw $s3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 44($s3) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $s3, -28($fp) + # GOTO label_END_22 +j label_END_22 +label_NEXT0_23: + # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # Load TDT pointer to type Bar + la $s3, Bar__TDT + lw $s4, -8($fp) + addu $s3, $s3, $s4 + # Save distance + lw $s4, 0($s3) + sw $s4, -20($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # Update min if 19 < 20 + lw $s3, -20($fp) + lw $s4, -16($fp) + bgtu $s3, $s4, label_NEXT1_24 + # LOCAL local_ttrib__e__init_n_7 --> -32($fp) + # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) + # local_ttrib__e__init_n_7 = local_ttrib__e__init_internal_0 + lw $s3, -4($fp) + sw $s3, -32($fp) + # GOTO label_END_22 +j label_END_22 +label_NEXT1_24: + label_ERROR_21: + # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) + lw $s3, 0($s1) + sw $s3, -4($fp) + # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) la $a0, data_1 li $v0, 4 syscall @@ -2158,410 +2730,247 @@ label_NEXT3_24: syscall li $v0, 10 syscall - label_END_20: + label_END_22: # RETURN -# Deallocate stack frame for function __Bazz__attrib__g__init. +# Deallocate stack frame for function __Razz__attrib__e__init. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 56 +addu $sp, $sp, 40 jr $ra # Function END -# __Bazz__attrib__i__init implementation. +# __Razz__attrib__f__init implementation. # @Params: -__Bazz__attrib__i__init: - # Allocate stack frame for function __Bazz__attrib__i__init. - subu $sp, $sp, 32 +__Razz__attrib__f__init: + # Allocate stack frame for function __Razz__attrib__f__init. + subu $sp, $sp, 80 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__i__init_internal_2 --> -12($fp) - # local_ttrib__i__init_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_ttrib__i__init_internal_0 --> -4($fp) - # LOCAL local_ttrib__i__init_internal_2 --> -12($fp) - # local_ttrib__i__init_internal_0 = local_ttrib__i__init_internal_2 - lw $t7, -12($fp) - sw $t7, -4($fp) + addu $fp, $sp, 80 + # local_ttrib__f__init_internal_5 = GETATTRIBUTE a Razz + # LOCAL local_ttrib__f__init_internal_5 --> -24($fp) + lw $s3, 24($s1) + sw $s3, -24($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_ttrib__i__init_internal_0 --> -4($fp) - # LOCAL local_ttrib__i__init_internal_1 --> -8($fp) - # local_ttrib__i__init_internal_1 = VCALL local_ttrib__i__init_internal_0 printh + # local_ttrib__f__init_internal_4 = CALL doh + # LOCAL local_ttrib__f__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__f__init_internal_5 --> -24($fp) # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t7, 4($s1) + lw $s1, -24($fp) # Get pointer to type's VTABLE - lw $t8, 0($t7) + la $s3, Bazz_vtable # Get pointer to function address - lw $t9, 28($t8) + lw $s4, 32($s3) # Call function. Result is on $v0 - jalr $t9 - sw $v0, -8($fp) + jalr $s4 + sw $v0, -20($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN local_ttrib__i__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Bazz__attrib__i__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_printh_at_Bazz implementation. -# @Params: -function_printh_at_Bazz: - # Allocate stack frame for function function_printh_at_Bazz. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_printh_at_Bazz_internal_2 --> -12($fp) - # local_printh_at_Bazz_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_printh_at_Bazz_internal_0 --> -4($fp) - # LOCAL local_printh_at_Bazz_internal_2 --> -12($fp) - # local_printh_at_Bazz_internal_0 = local_printh_at_Bazz_internal_2 - lw $t7, -12($fp) - sw $t7, -4($fp) + # local_ttrib__f__init_internal_8 = GETATTRIBUTE g Razz + # LOCAL local_ttrib__f__init_internal_8 --> -36($fp) + lw $s3, 16($s1) + sw $s3, -36($fp) + # LOCAL local_ttrib__f__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__f__init_internal_8 --> -36($fp) + # local_ttrib__f__init_internal_6 = local_ttrib__f__init_internal_8 + lw $s3, -36($fp) + sw $s3, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_printh_at_Bazz_internal_3 = GETATTRIBUTE h Bazz - # LOCAL local_printh_at_Bazz_internal_3 --> -16($fp) - lw $t7, 12($s1) - sw $t7, -16($fp) - # ARG local_printh_at_Bazz_internal_3 - # LOCAL local_printh_at_Bazz_internal_3 --> -16($fp) - lw $t7, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - # LOCAL local_printh_at_Bazz_internal_0 --> -4($fp) - # LOCAL local_printh_at_Bazz_internal_1 --> -8($fp) - # local_printh_at_Bazz_internal_1 = VCALL local_printh_at_Bazz_internal_0 out_int + # LOCAL local_ttrib__f__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__f__init_internal_7 --> -32($fp) + # local_ttrib__f__init_internal_7 = VCALL local_ttrib__f__init_internal_6 doh # Save new self pointer in $s1 - lw $s1, -4($fp) + lw $s1, -28($fp) # Get pointer to type - lw $t7, 4($s1) + lw $s3, 4($s1) # Get pointer to type's VTABLE - lw $t8, 0($t7) + lw $s4, 0($s3) # Get pointer to function address - lw $t9, 16($t8) + lw $s5, 32($s4) # Call function. Result is on $v0 - jalr $t9 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function function_printh_at_Bazz. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_doh_at_Bazz implementation. -# @Params: -function_doh_at_Bazz: - # Allocate stack frame for function function_doh_at_Bazz. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_doh_at_Bazz_internal_1 = GETATTRIBUTE h Bazz - # LOCAL local_doh_at_Bazz_internal_1 --> -8($fp) - lw $t7, 12($s1) - sw $t7, -8($fp) - # LOCAL local_doh_at_Bazz_i_0 --> -4($fp) - # LOCAL local_doh_at_Bazz_internal_1 --> -8($fp) - # local_doh_at_Bazz_i_0 = local_doh_at_Bazz_internal_1 - lw $t7, -8($fp) - sw $t7, -4($fp) - # local_doh_at_Bazz_internal_3 = GETATTRIBUTE h Bazz - # LOCAL local_doh_at_Bazz_internal_3 --> -16($fp) - lw $t7, 12($s1) - sw $t7, -16($fp) - # LOCAL local_doh_at_Bazz_internal_2 --> -12($fp) - # LOCAL local_doh_at_Bazz_internal_3 --> -16($fp) - # local_doh_at_Bazz_internal_2 = local_doh_at_Bazz_internal_3 + 1 - lw $t7, -16($fp) - add $t7, $t7, 1 - sw $t7, -12($fp) - # - # LOCAL local_doh_at_Bazz_internal_2 --> -12($fp) - lw $t7, -12($fp) - sw $t7, 12($s1) - # RETURN local_doh_at_Bazz_i_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_doh_at_Bazz. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__a__init implementation. -# @Params: -__Main__attrib__a__init: - # Allocate stack frame for function __Main__attrib__a__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__a__init_internal_0 --> -4($fp) - # local_ttrib__a__init_internal_0 = ALLOCATE Bazz - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) - # Load type offset - li $t9, 8 - sw $t9, 8($v0) - la $t9, Bazz - sw $t9, 12($v0) - li $t9, 4 - sw $t9, 16($v0) - move $t9, $v0 - # Allocating 24 bytes of memory - li $a0, 24 - li $v0, 9 - syscall - sw $t9, 0($v0) - la $t9, Bazz_start - sw $t9, 4($v0) - # Load type offset - li $t9, 28 - sw $t9, 8($v0) - move $t8, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t8) - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t8) - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t8) + jalr $s5 + sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t8, -4($fp) - # RETURN local_ttrib__a__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Main__attrib__a__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__b__init implementation. -# @Params: -__Main__attrib__b__init: - # Allocate stack frame for function __Main__attrib__b__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__b__init_internal_0 --> -4($fp) - # local_ttrib__b__init_internal_0 = ALLOCATE Foo - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $s2, String - sw $s2, 0($v0) - la $s2, String_start - sw $s2, 4($v0) - # Load type offset - li $s2, 8 - sw $s2, 8($v0) - la $s2, Foo - sw $s2, 12($v0) - li $s2, 3 - sw $s2, 16($v0) - move $s2, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $s2, 0($v0) - la $s2, Foo_start - sw $s2, 4($v0) - # Load type offset - li $s2, 16 - sw $s2, 8($v0) - move $t9, $v0 + # LOCAL local_ttrib__f__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__f__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__f__init_internal_7 --> -32($fp) + # local_ttrib__f__init_internal_3 = local_ttrib__f__init_internal_4 + local_ttrib__f__init_internal_7 + lw $s3, -20($fp) + lw $s4, -32($fp) + add $s3, $s3, $s4 + sw $s3, -16($fp) + # local_ttrib__f__init_internal_11 = GETATTRIBUTE e Razz + # LOCAL local_ttrib__f__init_internal_11 --> -48($fp) + lw $s3, 32($s1) + sw $s3, -48($fp) + # LOCAL local_ttrib__f__init_internal_9 --> -40($fp) + # LOCAL local_ttrib__f__init_internal_11 --> -48($fp) + # local_ttrib__f__init_internal_9 = local_ttrib__f__init_internal_11 + lw $s3, -48($fp) + sw $s3, -40($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - move $s1, $v0 - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) + # LOCAL local_ttrib__f__init_internal_9 --> -40($fp) + # LOCAL local_ttrib__f__init_internal_10 --> -44($fp) + # local_ttrib__f__init_internal_10 = VCALL local_ttrib__f__init_internal_9 doh + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $s3, 4($s1) + # Get pointer to type's VTABLE + lw $s4, 0($s3) + # Get pointer to function address + lw $s5, 32($s4) + # Call function. Result is on $v0 + jalr $s5 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t9) - # Push register t9 into stack + # LOCAL local_ttrib__f__init_internal_2 --> -12($fp) + # LOCAL local_ttrib__f__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__f__init_internal_10 --> -44($fp) + # local_ttrib__f__init_internal_2 = local_ttrib__f__init_internal_3 + local_ttrib__f__init_internal_10 + lw $s3, -16($fp) + lw $s4, -44($fp) + add $s3, $s3, $s4 + sw $s3, -12($fp) + # LOCAL local_ttrib__f__init_internal_14 --> -60($fp) + # local_ttrib__f__init_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_ttrib__f__init_internal_12 --> -52($fp) + # LOCAL local_ttrib__f__init_internal_14 --> -60($fp) + # local_ttrib__f__init_internal_12 = local_ttrib__f__init_internal_14 + lw $s3, -60($fp) + sw $s3, -52($fp) + # Push register s1 into stack subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) + sw $s1, 0($sp) + # LOCAL local_ttrib__f__init_internal_12 --> -52($fp) + # LOCAL local_ttrib__f__init_internal_13 --> -56($fp) + # local_ttrib__f__init_internal_13 = VCALL local_ttrib__f__init_internal_12 doh + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $s3, 4($s1) + # Get pointer to type's VTABLE + lw $s4, 0($s3) + # Get pointer to function address + lw $s5, 32($s4) + # Call function. Result is on $v0 + jalr $s5 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t9) + # LOCAL local_ttrib__f__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__f__init_internal_2 --> -12($fp) + # LOCAL local_ttrib__f__init_internal_13 --> -56($fp) + # local_ttrib__f__init_internal_1 = local_ttrib__f__init_internal_2 + local_ttrib__f__init_internal_13 + lw $s3, -12($fp) + lw $s4, -56($fp) + add $s3, $s3, $s4 + sw $s3, -8($fp) + # LOCAL local_ttrib__f__init_internal_17 --> -72($fp) + # local_ttrib__f__init_internal_17 = SELF + sw $s1, -72($fp) + # LOCAL local_ttrib__f__init_internal_15 --> -64($fp) + # LOCAL local_ttrib__f__init_internal_17 --> -72($fp) + # local_ttrib__f__init_internal_15 = local_ttrib__f__init_internal_17 + lw $s3, -72($fp) + sw $s3, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__f__init_internal_15 --> -64($fp) + # LOCAL local_ttrib__f__init_internal_16 --> -68($fp) + # local_ttrib__f__init_internal_16 = VCALL local_ttrib__f__init_internal_15 printh + # Save new self pointer in $s1 + lw $s1, -64($fp) + # Get pointer to type + lw $s3, 4($s1) + # Get pointer to type's VTABLE + lw $s4, 0($s3) + # Get pointer to function address + lw $s5, 28($s4) + # Call function. Result is on $v0 + jalr $s5 + sw $v0, -68($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t9, -4($fp) - # RETURN local_ttrib__b__init_internal_0 + # LOCAL local_ttrib__f__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__f__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__f__init_internal_16 --> -68($fp) + # local_ttrib__f__init_internal_0 = local_ttrib__f__init_internal_1 + local_ttrib__f__init_internal_16 + lw $s3, -8($fp) + lw $s4, -68($fp) + add $s3, $s3, $s4 + sw $s3, -4($fp) + # RETURN local_ttrib__f__init_internal_0 lw $v0, -4($fp) - # Deallocate stack frame for function __Main__attrib__b__init. + # Deallocate stack frame for function __Razz__attrib__f__init. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 32 + addu $sp, $sp, 80 jr $ra # Function END -# __Main__attrib__c__init implementation. +# __Bar__attrib__c__init implementation. # @Params: -__Main__attrib__c__init: - # Allocate stack frame for function __Main__attrib__c__init. +__Bar__attrib__c__init: + # Allocate stack frame for function __Bar__attrib__c__init. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_ttrib__c__init_internal_0 --> -4($fp) - # local_ttrib__c__init_internal_0 = ALLOCATE Razz - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $s3, String - sw $s3, 0($v0) - la $s3, String_start - sw $s3, 4($v0) - # Load type offset - li $s3, 8 - sw $s3, 8($v0) - la $s3, Razz - sw $s3, 12($v0) - li $s3, 4 - sw $s3, 16($v0) - move $s3, $v0 - # Allocating 28 bytes of memory - li $a0, 28 - li $v0, 9 - syscall - sw $s3, 0($v0) - la $s3, Razz_start - sw $s3, 4($v0) - # Load type offset - li $s3, 24 - sw $s3, 8($v0) - move $s2, $v0 + # LOCAL local_trib__c__init_internal_2 --> -12($fp) + # local_trib__c__init_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_trib__c__init_internal_0 --> -4($fp) + # LOCAL local_trib__c__init_internal_2 --> -12($fp) + # local_trib__c__init_internal_0 = local_trib__c__init_internal_2 + lw $s3, -12($fp) + sw $s3, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - move $s1, $v0 - # Push register s2 into stack - subu $sp, $sp, 4 - sw $s2, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register s2 - lw $s2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($s2) - # Push register s2 into stack - subu $sp, $sp, 4 - sw $s2, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register s2 - lw $s2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($s2) - # Push register s2 into stack - subu $sp, $sp, 4 - sw $s2, 0($sp) - jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register s2 - lw $s2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($s2) - # Push register s2 into stack - subu $sp, $sp, 4 - sw $s2, 0($sp) - jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register s2 - lw $s2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($s2) + # LOCAL local_trib__c__init_internal_0 --> -4($fp) + # LOCAL local_trib__c__init_internal_1 --> -8($fp) + # local_trib__c__init_internal_1 = VCALL local_trib__c__init_internal_0 doh + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $s3, 4($s1) + # Get pointer to type's VTABLE + lw $s4, 0($s3) + # Get pointer to function address + lw $s5, 32($s4) + # Call function. Result is on $v0 + jalr $s5 + sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $s2, -4($fp) - # RETURN local_ttrib__c__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Main__attrib__c__init. + # RETURN local_trib__c__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Bar__attrib__c__init. # Restore $ra lw $ra, 4($sp) # Restore $fp @@ -2572,110 +2981,45 @@ __Main__attrib__c__init: # Function END -# __Main__attrib__d__init implementation. +# __Bar__attrib__d__init implementation. # @Params: -__Main__attrib__d__init: - # Allocate stack frame for function __Main__attrib__d__init. +__Bar__attrib__d__init: + # Allocate stack frame for function __Bar__attrib__d__init. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_ttrib__d__init_internal_0 --> -4($fp) - # local_ttrib__d__init_internal_0 = ALLOCATE Bar - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $s4, String - sw $s4, 0($v0) - la $s4, String_start - sw $s4, 4($v0) - # Load type offset - li $s4, 8 - sw $s4, 8($v0) - la $s4, Bar - sw $s4, 12($v0) - li $s4, 3 - sw $s4, 16($v0) - move $s4, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $s4, 0($v0) - la $s4, Bar_start - sw $s4, 4($v0) - # Load type offset - li $s4, 20 - sw $s4, 8($v0) - move $s3, $v0 + # LOCAL local_trib__d__init_internal_2 --> -12($fp) + # local_trib__d__init_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_trib__d__init_internal_0 --> -4($fp) + # LOCAL local_trib__d__init_internal_2 --> -12($fp) + # local_trib__d__init_internal_0 = local_trib__d__init_internal_2 + lw $s3, -12($fp) + sw $s3, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - move $s1, $v0 - # Push register s3 into stack - subu $sp, $sp, 4 - sw $s3, 0($sp) - jal __Bar__attrib__c__init - # Pop 4 bytes from stack into register s3 - lw $s3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($s3) - # Push register s3 into stack - subu $sp, $sp, 4 - sw $s3, 0($sp) - jal __Bar__attrib__d__init - # Pop 4 bytes from stack into register s3 - lw $s3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($s3) + # LOCAL local_trib__d__init_internal_0 --> -4($fp) + # LOCAL local_trib__d__init_internal_1 --> -8($fp) + # local_trib__d__init_internal_1 = VCALL local_trib__d__init_internal_0 printh + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $s3, 4($s1) + # Get pointer to type's VTABLE + lw $s4, 0($s3) + # Get pointer to function address + lw $s5, 28($s4) + # Call function. Result is on $v0 + jalr $s5 + sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $s3, -4($fp) - # RETURN local_ttrib__d__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Main__attrib__d__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $s3, String - sw $s3, 0($v0) - la $s3, String_start - sw $s3, 4($v0) - # Load type offset - li $s3, 8 - sw $s3, 8($v0) - la $s3, data_4 - sw $s3, 12($v0) - li $s3, 10 - sw $s3, 16($v0) - sw $v0, -4($fp) - # RETURN local_main_at_Main_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_main_at_Main. + # RETURN local_trib__d__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Bar__attrib__d__init. # Restore $ra lw $ra, 4($sp) # Restore $fp diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips index 4e277f8c..add5e238 100644 --- a/tests/codegen/hello_world.mips +++ b/tests/codegen/hello_world.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:23 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 17:41:29 2020 # School of Math and Computer Science, University of Havana # @@ -353,7 +353,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/new_complex.mips b/tests/codegen/new_complex.mips index 339f93ba..70114ec1 100644 --- a/tests/codegen/new_complex.mips +++ b/tests/codegen/new_complex.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:23 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 17:41:29 2020 # School of Math and Computer Science, University of Havana # @@ -13,10 +13,10 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END -Main: .asciiz "Main" -# Function END Complex: .asciiz "Complex" # Function END +Main: .asciiz "Main" +# Function END # @@ -76,31 +76,31 @@ Bool_end: # -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +# **** VTABLE for type Complex **** +Complex_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Complex, function_print_at_Complex, function_reflect_0_at_Complex, function_reflect_X_at_Complex, function_reflect_Y_at_Complex, function_equal_at_Complex, function_x_value_at_Complex, function_y_value_at_Complex # Function END # -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable +# **** Type RECORD for type Complex **** +Complex_start: + Complex_vtable_pointer: .word Complex_vtable # Function END -Main_end: +Complex_end: # -# **** VTABLE for type Complex **** -Complex_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Complex, function_print_at_Complex, function_reflect_0_at_Complex, function_reflect_X_at_Complex, function_reflect_Y_at_Complex, function_equal_at_Complex, function_x_value_at_Complex, function_y_value_at_Complex +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main # Function END # -# **** Type RECORD for type Complex **** -Complex_start: - Complex_vtable_pointer: .word Complex_vtable +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable # Function END -Complex_end: +Main_end: # @@ -120,16 +120,16 @@ IO__TDT: .word 0, -1, -1, -1, 1, 1 Object__TDT: .word 1, 0, 1, 1, 2, 2 String__TDT: .word -1, -1, 0, -1, -1, -1 Bool__TDT: .word -1, -1, -1, 0, -1, -1 -Main__TDT: .word -1, -1, -1, -1, 0, -1 -Complex__TDT: .word -1, -1, -1, -1, -1, 0 +Complex__TDT: .word -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0 # -data_4: .asciiz "=)\n" +data_4: .asciiz "+" # -data_5: .asciiz "=(\n" +data_5: .asciiz "I" # @@ -141,11 +141,11 @@ data_7: .asciiz "=(\n" # -data_8: .asciiz "+" +data_8: .asciiz "=)\n" # -data_9: .asciiz "I" +data_9: .asciiz "=(\n" # @@ -390,7 +390,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -588,7 +588,7 @@ entry: la $t2, Main_start sw $t2, 4($v0) # Load type offset - li $t2, 16 + li $t2, 20 sw $t2, 8($v0) move $t1, $v0 # Push register s1 into stack @@ -626,861 +626,869 @@ entry: # Function END -# function_main_at_Main implementation. +# __Complex__attrib__x__init implementation. # @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 148 +__Complex__attrib__x__init: + # Allocate stack frame for function __Complex__attrib__x__init. + subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 148 - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_c_0 = ALLOCATE Complex - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Complex - sw $t3, 12($v0) - li $t3, 7 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Complex_start - sw $t3, 4($v0) - # Load type offset - li $t3, 20 - sw $t3, 8($v0) - move $t2, $v0 + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Complex__attrib__x__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Complex__attrib__y__init implementation. +# @Params: +__Complex__attrib__y__init: + # Allocate stack frame for function __Complex__attrib__y__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Complex__attrib__y__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Complex implementation. +# @Params: +# 0($fp) = param_init_at_Complex_a_0 +# 4($fp) = param_init_at_Complex_b_1 +function_init_at_Complex: + # Allocate stack frame for function function_init_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_init_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + lw $t1, 12($s1) + sw $t1, -8($fp) + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + # local_init_at_Complex_internal_0 = local_init_at_Complex_internal_1 - PARAM param_init_at_Complex_a_0 + lw $t1, -8($fp) + lw $t2, 4($fp) + sub $t1, $t1, $t2 + sw $t1, -4($fp) + # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_1 + # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_1 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_1 + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # local_init_at_Complex_internal_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # GOTO label_END_2 +j label_END_2 +label_TRUE_1: + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # local_init_at_Complex_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + label_END_2: +# local_init_at_Complex_internal_3 = GETATTRIBUTE y Complex +# LOCAL local_init_at_Complex_internal_3 --> -16($fp) +lw $t1, 16($s1) +sw $t1, -16($fp) +# LOCAL local_init_at_Complex_internal_2 --> -12($fp) +# LOCAL local_init_at_Complex_internal_3 --> -16($fp) +# PARAM param_init_at_Complex_b_1 --> 0($fp) +# local_init_at_Complex_internal_2 = local_init_at_Complex_internal_3 - PARAM param_init_at_Complex_b_1 +lw $t1, -16($fp) +lw $t2, 0($fp) +sub $t1, $t1, $t2 +sw $t1, -12($fp) +# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_3 +# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_3 +lw $t1, -12($fp) +beq $t1, 0, label_TRUE_3 +# LOCAL local_init_at_Complex_internal_2 --> -12($fp) +# local_init_at_Complex_internal_2 = 0 +li $t1, 0 +sw $t1, -12($fp) +# GOTO label_END_4 +j label_END_4 +label_TRUE_3: + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # local_init_at_Complex_internal_2 = 1 + li $t1, 1 + sw $t1, -12($fp) + label_END_4: +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# local_init_at_Complex_internal_4 = SELF +sw $s1, -20($fp) +# RETURN local_init_at_Complex_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_init_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +# Deallocate function args +addu $sp, $sp, 8 +jr $ra +# Function END + + +# function_print_at_Complex implementation. +# @Params: +function_print_at_Complex: + # Allocate stack frame for function function_print_at_Complex. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # local_print_at_Complex_internal_2 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_2 --> -12($fp) + lw $t1, 16($s1) + sw $t1, -12($fp) + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # LOCAL local_print_at_Complex_internal_2 --> -12($fp) + # local_print_at_Complex_internal_1 = local_print_at_Complex_internal_2 - 0 + lw $t1, -12($fp) + sub $t1, $t1, 0 + sw $t1, -8($fp) + # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_7 + # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_7 + lw $t1, -8($fp) + beq $t1, 0, label_TRUE_7 + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # local_print_at_Complex_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # GOTO label_END_8 +j label_END_8 +label_TRUE_7: + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # local_print_at_Complex_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + label_END_8: +# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_5 +# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_5 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_5 +# LOCAL local_print_at_Complex_internal_5 --> -24($fp) +# local_print_at_Complex_internal_5 = SELF +sw $s1, -24($fp) +# LOCAL local_print_at_Complex_internal_3 --> -16($fp) +# LOCAL local_print_at_Complex_internal_5 --> -24($fp) +# local_print_at_Complex_internal_3 = local_print_at_Complex_internal_5 +lw $t1, -24($fp) +sw $t1, -16($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_print_at_Complex_internal_6 = GETATTRIBUTE x Complex +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +lw $t1, 12($s1) +sw $t1, -28($fp) +# ARG local_print_at_Complex_internal_6 +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +lw $t1, -28($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_print_at_Complex_internal_3 --> -16($fp) +# LOCAL local_print_at_Complex_internal_4 --> -20($fp) +# local_print_at_Complex_internal_4 = VCALL local_print_at_Complex_internal_3 out_int +# Save new self pointer in $s1 +lw $s1, -16($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 16($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -20($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_print_at_Complex_internal_0 --> -4($fp) +# LOCAL local_print_at_Complex_internal_4 --> -20($fp) +# local_print_at_Complex_internal_0 = local_print_at_Complex_internal_4 +lw $t1, -20($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_13 = local_print_at_Complex_internal_15 + lw $t1, -64($fp) + sw $t1, -56($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - move $s1, $v0 - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Complex__attrib__x__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t2) - # Push register t2 into stack + # local_print_at_Complex_internal_16 = GETATTRIBUTE x Complex + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + lw $t1, 12($s1) + sw $t1, -68($fp) + # ARG local_print_at_Complex_internal_16 + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + lw $t1, -68($fp) + # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Complex__attrib__y__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t2) + sw $t1, 0($sp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # LOCAL local_print_at_Complex_internal_14 --> -60($fp) + # local_print_at_Complex_internal_14 = VCALL local_print_at_Complex_internal_13 out_int + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 16($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -60($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t2, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = ALLOCATE Complex - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Complex - sw $t4, 12($v0) - li $t4, 7 - sw $t4, 16($v0) - move $t4, $v0 + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # LOCAL local_print_at_Complex_internal_14 --> -60($fp) + # local_print_at_Complex_internal_11 = local_print_at_Complex_internal_14 + lw $t1, -60($fp) + sw $t1, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - sw $t4, 0($v0) - la $t4, Complex_start - sw $t4, 4($v0) + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) # Load type offset - li $t4, 20 - sw $t4, 8($v0) - move $t3, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Complex__attrib__x__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t3) - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Complex__attrib__y__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t3) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t3, -16($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t3, -16($fp) - sw $t3, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 1 - li $t3, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # ARG 1 - li $t3, 1 + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_4 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -72($fp) + # ARG local_print_at_Complex_internal_17 + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + lw $t1, -72($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init + sw $t1, 0($sp) + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # LOCAL local_print_at_Complex_internal_12 --> -52($fp) + # local_print_at_Complex_internal_12 = VCALL local_print_at_Complex_internal_11 out_string # Save new self pointer in $s1 - lw $s1, -8($fp) + lw $s1, -48($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 28($t4) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -12($fp) + jalr $t3 + sw $v0, -52($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_c_0 = local_main_at_Main_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_c_0 - lw $t3, -4($fp) - sw $t3, -28($fp) + # LOCAL local_print_at_Complex_internal_9 --> -40($fp) + # LOCAL local_print_at_Complex_internal_12 --> -52($fp) + # local_print_at_Complex_internal_9 = local_print_at_Complex_internal_12 + lw $t1, -52($fp) + sw $t1, -40($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 reflect_X - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 40($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_internal_8 = local_main_at_Main_c_0 - lw $t3, -4($fp) - sw $t3, -36($fp) - # Push register s1 into stack + # local_print_at_Complex_internal_18 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + lw $t1, 16($s1) + sw $t1, -76($fp) + # ARG local_print_at_Complex_internal_18 + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + lw $t1, -76($fp) + # Push arg into stack subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 reflect_0 + sw $t1, 0($sp) + # LOCAL local_print_at_Complex_internal_9 --> -40($fp) + # LOCAL local_print_at_Complex_internal_10 --> -44($fp) + # local_print_at_Complex_internal_10 = VCALL local_print_at_Complex_internal_9 out_int # Save new self pointer in $s1 - lw $s1, -36($fp) + lw $s1, -40($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 36($t4) + lw $t3, 16($t2) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -40($fp) + jalr $t3 + sw $v0, -44($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_5 = local_main_at_Main_internal_7 - local_main_at_Main_internal_9 - lw $t3, -32($fp) - lw $t4, -40($fp) - sub $t3, $t3, $t4 - sw $t3, -24($fp) - # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_3 - # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_3 - lw $t3, -24($fp) - beq $t3, 0, label_TRUE_3 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = 0 - li $t3, 0 - sw $t3, -24($fp) - # GOTO label_END_4 -j label_END_4 -label_TRUE_3: - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = 1 - li $t3, 1 - sw $t3, -24($fp) - label_END_4: -# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_1 -# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_1 -lw $t3, -24($fp) -beq $t3, 0, label_FALSEIF_1 -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# local_main_at_Main_internal_12 = SELF -sw $s1, -52($fp) -# LOCAL local_main_at_Main_internal_10 --> -44($fp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# local_main_at_Main_internal_10 = local_main_at_Main_internal_12 -lw $t3, -52($fp) -sw $t3, -44($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t3, String -sw $t3, 0($v0) -la $t3, String_start -sw $t3, 4($v0) -# Load type offset -li $t3, 8 -sw $t3, 8($v0) -la $t3, data_4 -sw $t3, 12($v0) -li $t3, 3 -sw $t3, 16($v0) -sw $v0, -56($fp) -# ARG local_main_at_Main_internal_13 -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -lw $t3, -56($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_main_at_Main_internal_10 --> -44($fp) -# LOCAL local_main_at_Main_internal_11 --> -48($fp) -# local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 out_string -# Save new self pointer in $s1 -lw $s1, -44($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 12($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -48($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_4 --> -20($fp) -# LOCAL local_main_at_Main_internal_11 --> -48($fp) -# local_main_at_Main_internal_4 = local_main_at_Main_internal_11 -lw $t3, -48($fp) -sw $t3, -20($fp) -# GOTO label_ENDIF_2 -j label_ENDIF_2 -label_FALSEIF_1: - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_16 = SELF - sw $s1, -68($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_14 = local_main_at_Main_internal_16 - lw $t3, -68($fp) - sw $t3, -60($fp) + # LOCAL local_print_at_Complex_internal_7 --> -32($fp) + # LOCAL local_print_at_Complex_internal_10 --> -44($fp) + # local_print_at_Complex_internal_7 = local_print_at_Complex_internal_10 + lw $t1, -44($fp) + sw $t1, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_5 - sw $t3, 12($v0) - li $t3, 3 - sw $t3, 16($v0) - sw $v0, -72($fp) - # ARG local_main_at_Main_internal_17 - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - lw $t3, -72($fp) + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_5 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -80($fp) + # ARG local_print_at_Complex_internal_19 + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + lw $t1, -80($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 out_string + sw $t1, 0($sp) + # LOCAL local_print_at_Complex_internal_7 --> -32($fp) + # LOCAL local_print_at_Complex_internal_8 --> -36($fp) + # local_print_at_Complex_internal_8 = VCALL local_print_at_Complex_internal_7 out_string # Save new self pointer in $s1 - lw $s1, -60($fp) + lw $s1, -32($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 12($t4) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -64($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_4 = local_main_at_Main_internal_15 - lw $t3, -64($fp) - sw $t3, -20($fp) - label_ENDIF_2: -# LOCAL local_main_at_Main_internal_23 --> -96($fp) -# LOCAL local_main_at_Main_c_0 --> -4($fp) -# local_main_at_Main_internal_23 = local_main_at_Main_c_0 -lw $t3, -4($fp) -sw $t3, -96($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_23 --> -96($fp) -# LOCAL local_main_at_Main_internal_24 --> -100($fp) -# local_main_at_Main_internal_24 = VCALL local_main_at_Main_internal_23 reflect_X -# Save new self pointer in $s1 -lw $s1, -96($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 40($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -100($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_21 --> -88($fp) -# LOCAL local_main_at_Main_internal_24 --> -100($fp) -# local_main_at_Main_internal_21 = local_main_at_Main_internal_24 -lw $t3, -100($fp) -sw $t3, -88($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_21 --> -88($fp) -# LOCAL local_main_at_Main_internal_22 --> -92($fp) -# local_main_at_Main_internal_22 = VCALL local_main_at_Main_internal_21 reflect_Y -# Save new self pointer in $s1 -lw $s1, -88($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 44($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -92($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# LOCAL local_main_at_Main_internal_22 --> -92($fp) -# local_main_at_Main_internal_19 = local_main_at_Main_internal_22 -lw $t3, -92($fp) -sw $t3, -80($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_25 --> -104($fp) -# LOCAL local_main_at_Main_c_0 --> -4($fp) -# local_main_at_Main_internal_25 = local_main_at_Main_c_0 -lw $t3, -4($fp) -sw $t3, -104($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_25 --> -104($fp) -# LOCAL local_main_at_Main_internal_26 --> -108($fp) -# local_main_at_Main_internal_26 = VCALL local_main_at_Main_internal_25 reflect_0 -# Save new self pointer in $s1 -lw $s1, -104($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 36($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -108($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_26 -# LOCAL local_main_at_Main_internal_26 --> -108($fp) -lw $t3, -108($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# LOCAL local_main_at_Main_internal_20 --> -84($fp) -# local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 equal -# Save new self pointer in $s1 -lw $s1, -80($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 48($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -84($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# IF_ZERO local_main_at_Main_internal_20 GOTO label_FALSEIF_5 -# IF_ZERO local_main_at_Main_internal_20 GOTO label_FALSEIF_5 -lw $t3, -84($fp) -beq $t3, 0, label_FALSEIF_5 -# LOCAL local_main_at_Main_internal_29 --> -120($fp) -# local_main_at_Main_internal_29 = SELF -sw $s1, -120($fp) -# LOCAL local_main_at_Main_internal_27 --> -112($fp) -# LOCAL local_main_at_Main_internal_29 --> -120($fp) -# local_main_at_Main_internal_27 = local_main_at_Main_internal_29 -lw $t3, -120($fp) -sw $t3, -112($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_30 --> -124($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t3, String -sw $t3, 0($v0) -la $t3, String_start -sw $t3, 4($v0) -# Load type offset -li $t3, 8 -sw $t3, 8($v0) -la $t3, data_6 -sw $t3, 12($v0) -li $t3, 3 -sw $t3, 16($v0) -sw $v0, -124($fp) -# ARG local_main_at_Main_internal_30 -# LOCAL local_main_at_Main_internal_30 --> -124($fp) -lw $t3, -124($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_main_at_Main_internal_27 --> -112($fp) -# LOCAL local_main_at_Main_internal_28 --> -116($fp) -# local_main_at_Main_internal_28 = VCALL local_main_at_Main_internal_27 out_string -# Save new self pointer in $s1 -lw $s1, -112($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 12($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -116($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# LOCAL local_main_at_Main_internal_28 --> -116($fp) -# local_main_at_Main_internal_18 = local_main_at_Main_internal_28 -lw $t3, -116($fp) -sw $t3, -76($fp) -# GOTO label_ENDIF_6 -j label_ENDIF_6 -label_FALSEIF_5: - # LOCAL local_main_at_Main_internal_33 --> -136($fp) - # local_main_at_Main_internal_33 = SELF - sw $s1, -136($fp) - # LOCAL local_main_at_Main_internal_31 --> -128($fp) - # LOCAL local_main_at_Main_internal_33 --> -136($fp) - # local_main_at_Main_internal_31 = local_main_at_Main_internal_33 - lw $t3, -136($fp) - sw $t3, -128($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_34 --> -140($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_7 - sw $t3, 12($v0) - li $t3, 3 - sw $t3, 16($v0) - sw $v0, -140($fp) - # ARG local_main_at_Main_internal_34 - # LOCAL local_main_at_Main_internal_34 --> -140($fp) - lw $t3, -140($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_31 --> -128($fp) - # LOCAL local_main_at_Main_internal_32 --> -132($fp) - # local_main_at_Main_internal_32 = VCALL local_main_at_Main_internal_31 out_string - # Save new self pointer in $s1 - lw $s1, -128($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 12($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -132($fp) + jalr $t3 + sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_32 --> -132($fp) - # local_main_at_Main_internal_18 = local_main_at_Main_internal_32 - lw $t3, -132($fp) - sw $t3, -76($fp) + # LOCAL local_print_at_Complex_internal_0 --> -4($fp) + # LOCAL local_print_at_Complex_internal_8 --> -36($fp) + # local_print_at_Complex_internal_0 = local_print_at_Complex_internal_8 + lw $t1, -36($fp) + sw $t1, -4($fp) label_ENDIF_6: -# RETURN local_main_at_Main_internal_18 -lw $v0, -76($fp) -# Deallocate stack frame for function function_main_at_Main. +# RETURN local_print_at_Complex_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_print_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +jr $ra +# Function END + + +# function_reflect_0_at_Complex implementation. +# @Params: +function_reflect_0_at_Complex: + # Allocate stack frame for function function_reflect_0_at_Complex. + subu $sp, $sp, 44 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 44 + # local_reflect_0_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + lw $t1, 12($s1) + sw $t1, -8($fp) + # local_reflect_0_at_Complex_internal_3 = GETATTRIBUTE x Complex + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + lw $t1, 12($s1) + sw $t1, -16($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + lw $t1, -16($fp) + not $t1, $t1 + sw $t1, -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # local_reflect_0_at_Complex_internal_0 = local_reflect_0_at_Complex_internal_1 - local_reflect_0_at_Complex_internal_2 + lw $t1, -8($fp) + lw $t2, -12($fp) + sub $t1, $t1, $t2 + sw $t1, -4($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_9 + # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_9 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_9 + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # local_reflect_0_at_Complex_internal_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # GOTO label_END_10 +j label_END_10 +label_TRUE_9: + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # local_reflect_0_at_Complex_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + label_END_10: +# local_reflect_0_at_Complex_internal_5 = GETATTRIBUTE y Complex +# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) +lw $t1, 16($s1) +sw $t1, -24($fp) +# local_reflect_0_at_Complex_internal_7 = GETATTRIBUTE y Complex +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +lw $t1, 16($s1) +sw $t1, -32($fp) +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +lw $t1, -32($fp) +not $t1, $t1 +sw $t1, -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) +# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# local_reflect_0_at_Complex_internal_4 = local_reflect_0_at_Complex_internal_5 - local_reflect_0_at_Complex_internal_6 +lw $t1, -24($fp) +lw $t2, -28($fp) +sub $t1, $t1, $t2 +sw $t1, -20($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_11 +# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_11 +lw $t1, -20($fp) +beq $t1, 0, label_TRUE_11 +# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) +# local_reflect_0_at_Complex_internal_4 = 0 +li $t1, 0 +sw $t1, -20($fp) +# GOTO label_END_12 +j label_END_12 +label_TRUE_11: + # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) + # local_reflect_0_at_Complex_internal_4 = 1 + li $t1, 1 + sw $t1, -20($fp) + label_END_12: +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# local_reflect_0_at_Complex_internal_8 = SELF +sw $s1, -36($fp) +# RETURN local_reflect_0_at_Complex_internal_8 +lw $v0, -36($fp) +# Deallocate stack frame for function function_reflect_0_at_Complex. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 148 +addu $sp, $sp, 44 jr $ra # Function END -# __Complex__attrib__x__init implementation. -# @Params: -__Complex__attrib__x__init: - # Allocate stack frame for function __Complex__attrib__x__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Complex__attrib__x__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Complex__attrib__y__init implementation. +# function_reflect_X_at_Complex implementation. # @Params: -__Complex__attrib__y__init: - # Allocate stack frame for function __Complex__attrib__y__init. +function_reflect_X_at_Complex: + # Allocate stack frame for function function_reflect_X_at_Complex. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Complex__attrib__y__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END + # local_reflect_X_at_Complex_internal_1 = GETATTRIBUTE y Complex + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + lw $t1, 16($s1) + sw $t1, -8($fp) + # local_reflect_X_at_Complex_internal_3 = GETATTRIBUTE y Complex + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + lw $t1, 16($s1) + sw $t1, -16($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + lw $t1, -16($fp) + not $t1, $t1 + sw $t1, -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # local_reflect_X_at_Complex_internal_0 = local_reflect_X_at_Complex_internal_1 - local_reflect_X_at_Complex_internal_2 + lw $t1, -8($fp) + lw $t2, -12($fp) + sub $t1, $t1, $t2 + sw $t1, -4($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_13 + # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_13 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_13 + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # local_reflect_X_at_Complex_internal_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # GOTO label_END_14 +j label_END_14 +label_TRUE_13: + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # local_reflect_X_at_Complex_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + label_END_14: +# LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) +# local_reflect_X_at_Complex_internal_4 = SELF +sw $s1, -20($fp) +# RETURN local_reflect_X_at_Complex_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_reflect_X_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +jr $ra +# Function END -# function_init_at_Complex implementation. +# function_reflect_Y_at_Complex implementation. # @Params: -# 0($fp) = param_init_at_Complex_a_0 -# 4($fp) = param_init_at_Complex_b_1 -function_init_at_Complex: - # Allocate stack frame for function function_init_at_Complex. +function_reflect_Y_at_Complex: + # Allocate stack frame for function function_reflect_Y_at_Complex. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_init_at_Complex_internal_1 = GETATTRIBUTE x Complex - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - lw $t3, 12($s1) - sw $t3, -8($fp) - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - # PARAM param_init_at_Complex_a_0 --> 4($fp) - # local_init_at_Complex_internal_0 = local_init_at_Complex_internal_1 - PARAM param_init_at_Complex_a_0 - lw $t3, -8($fp) - lw $t4, 4($fp) - sub $t3, $t3, $t4 - sw $t3, -4($fp) - # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_7 - # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_7 - lw $t3, -4($fp) - beq $t3, 0, label_TRUE_7 - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # local_init_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - # GOTO label_END_8 -j label_END_8 -label_TRUE_7: - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # local_init_at_Complex_internal_0 = 1 - li $t3, 1 - sw $t3, -4($fp) - label_END_8: -# local_init_at_Complex_internal_3 = GETATTRIBUTE y Complex -# LOCAL local_init_at_Complex_internal_3 --> -16($fp) -lw $t3, 16($s1) -sw $t3, -16($fp) -# LOCAL local_init_at_Complex_internal_2 --> -12($fp) -# LOCAL local_init_at_Complex_internal_3 --> -16($fp) -# PARAM param_init_at_Complex_b_1 --> 0($fp) -# local_init_at_Complex_internal_2 = local_init_at_Complex_internal_3 - PARAM param_init_at_Complex_b_1 -lw $t3, -16($fp) -lw $t4, 0($fp) -sub $t3, $t3, $t4 -sw $t3, -12($fp) -# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_9 -# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_9 -lw $t3, -12($fp) -beq $t3, 0, label_TRUE_9 -# LOCAL local_init_at_Complex_internal_2 --> -12($fp) -# local_init_at_Complex_internal_2 = 0 -li $t3, 0 -sw $t3, -12($fp) -# GOTO label_END_10 -j label_END_10 -label_TRUE_9: - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # local_init_at_Complex_internal_2 = 1 - li $t3, 1 - sw $t3, -12($fp) - label_END_10: -# LOCAL local_init_at_Complex_internal_4 --> -20($fp) -# local_init_at_Complex_internal_4 = SELF + # local_reflect_Y_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + lw $t1, 12($s1) + sw $t1, -8($fp) + # local_reflect_Y_at_Complex_internal_3 = GETATTRIBUTE x Complex + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + lw $t1, 12($s1) + sw $t1, -16($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + lw $t1, -16($fp) + not $t1, $t1 + sw $t1, -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # local_reflect_Y_at_Complex_internal_0 = local_reflect_Y_at_Complex_internal_1 - local_reflect_Y_at_Complex_internal_2 + lw $t1, -8($fp) + lw $t2, -12($fp) + sub $t1, $t1, $t2 + sw $t1, -4($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_15 + # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_15 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_15 + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # local_reflect_Y_at_Complex_internal_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # GOTO label_END_16 +j label_END_16 +label_TRUE_15: + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # local_reflect_Y_at_Complex_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + label_END_16: +# LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) +# local_reflect_Y_at_Complex_internal_4 = SELF sw $s1, -20($fp) -# RETURN local_init_at_Complex_internal_4 +# RETURN local_reflect_Y_at_Complex_internal_4 lw $v0, -20($fp) -# Deallocate stack frame for function function_init_at_Complex. +# Deallocate stack frame for function function_reflect_Y_at_Complex. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp addu $sp, $sp, 32 -# Deallocate function args -addu $sp, $sp, 8 jr $ra # Function END -# function_print_at_Complex implementation. +# function_equal_at_Complex implementation. # @Params: -function_print_at_Complex: - # Allocate stack frame for function function_print_at_Complex. - subu $sp, $sp, 88 +# 0($fp) = param_equal_at_Complex_d_0 +function_equal_at_Complex: + # Allocate stack frame for function function_equal_at_Complex. + subu $sp, $sp, 60 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 88 - # local_print_at_Complex_internal_2 = GETATTRIBUTE y Complex - # LOCAL local_print_at_Complex_internal_2 --> -12($fp) - lw $t3, 16($s1) - sw $t3, -12($fp) - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # LOCAL local_print_at_Complex_internal_2 --> -12($fp) - # local_print_at_Complex_internal_1 = local_print_at_Complex_internal_2 - 0 - lw $t3, -12($fp) - sub $t3, $t3, 0 - sw $t3, -8($fp) - # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_13 - # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_13 - lw $t3, -8($fp) - beq $t3, 0, label_TRUE_13 - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # local_print_at_Complex_internal_1 = 0 - li $t3, 0 - sw $t3, -8($fp) - # GOTO label_END_14 -j label_END_14 -label_TRUE_13: - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # local_print_at_Complex_internal_1 = 1 - li $t3, 1 - sw $t3, -8($fp) - label_END_14: -# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_11 -# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_11 -lw $t3, -8($fp) -beq $t3, 0, label_FALSEIF_11 -# LOCAL local_print_at_Complex_internal_5 --> -24($fp) -# local_print_at_Complex_internal_5 = SELF -sw $s1, -24($fp) -# LOCAL local_print_at_Complex_internal_3 --> -16($fp) -# LOCAL local_print_at_Complex_internal_5 --> -24($fp) -# local_print_at_Complex_internal_3 = local_print_at_Complex_internal_5 -lw $t3, -24($fp) -sw $t3, -16($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_print_at_Complex_internal_6 = GETATTRIBUTE x Complex -# LOCAL local_print_at_Complex_internal_6 --> -28($fp) -lw $t3, 12($s1) -sw $t3, -28($fp) -# ARG local_print_at_Complex_internal_6 -# LOCAL local_print_at_Complex_internal_6 --> -28($fp) -lw $t3, -28($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_print_at_Complex_internal_3 --> -16($fp) -# LOCAL local_print_at_Complex_internal_4 --> -20($fp) -# local_print_at_Complex_internal_4 = VCALL local_print_at_Complex_internal_3 out_int -# Save new self pointer in $s1 -lw $s1, -16($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 16($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -20($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_print_at_Complex_internal_0 --> -4($fp) -# LOCAL local_print_at_Complex_internal_4 --> -20($fp) -# local_print_at_Complex_internal_0 = local_print_at_Complex_internal_4 -lw $t3, -20($fp) -sw $t3, -4($fp) -# GOTO label_ENDIF_12 -j label_ENDIF_12 -label_FALSEIF_11: - # LOCAL local_print_at_Complex_internal_15 --> -64($fp) - # local_print_at_Complex_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_print_at_Complex_internal_13 --> -56($fp) - # LOCAL local_print_at_Complex_internal_15 --> -64($fp) - # local_print_at_Complex_internal_13 = local_print_at_Complex_internal_15 - lw $t3, -64($fp) - sw $t3, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Complex_internal_16 = GETATTRIBUTE x Complex - # LOCAL local_print_at_Complex_internal_16 --> -68($fp) - lw $t3, 12($s1) - sw $t3, -68($fp) - # ARG local_print_at_Complex_internal_16 - # LOCAL local_print_at_Complex_internal_16 --> -68($fp) - lw $t3, -68($fp) - # Push arg into stack + addu $fp, $sp, 60 + # local_equal_at_Complex_internal_2 = GETATTRIBUTE x Complex + # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) + lw $t1, 12($s1) + sw $t1, -12($fp) + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # PARAM param_equal_at_Complex_d_0 --> 0($fp) + # local_equal_at_Complex_internal_3 = PARAM param_equal_at_Complex_d_0 + lw $t1, 0($fp) + sw $t1, -16($fp) + # Push register s1 into stack subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_print_at_Complex_internal_13 --> -56($fp) - # LOCAL local_print_at_Complex_internal_14 --> -60($fp) - # local_print_at_Complex_internal_14 = VCALL local_print_at_Complex_internal_13 out_int + sw $s1, 0($sp) + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # local_equal_at_Complex_internal_4 = VCALL local_equal_at_Complex_internal_3 x_value # Save new self pointer in $s1 - lw $s1, -56($fp) + lw $s1, -16($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 16($t4) + lw $t3, 52($t2) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -60($fp) + jalr $t3 + sw $v0, -20($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_11 --> -48($fp) - # LOCAL local_print_at_Complex_internal_14 --> -60($fp) - # local_print_at_Complex_internal_11 = local_print_at_Complex_internal_14 - lw $t3, -60($fp) - sw $t3, -48($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) + # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # local_equal_at_Complex_internal_1 = local_equal_at_Complex_internal_2 - local_equal_at_Complex_internal_4 + lw $t1, -12($fp) + lw $t2, -20($fp) + sub $t1, $t1, $t2 + sw $t1, -8($fp) + # IF_ZERO local_equal_at_Complex_internal_1 GOTO label_TRUE_19 + # IF_ZERO local_equal_at_Complex_internal_1 GOTO label_TRUE_19 + lw $t1, -8($fp) + beq $t1, 0, label_TRUE_19 + # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) + # local_equal_at_Complex_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # GOTO label_END_20 +j label_END_20 +label_TRUE_19: + # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) + # local_equal_at_Complex_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + label_END_20: +# IF_ZERO local_equal_at_Complex_internal_1 GOTO label_FALSEIF_17 +# IF_ZERO local_equal_at_Complex_internal_1 GOTO label_FALSEIF_17 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_17 +# local_equal_at_Complex_internal_7 = GETATTRIBUTE y Complex +# LOCAL local_equal_at_Complex_internal_7 --> -32($fp) +lw $t1, 16($s1) +sw $t1, -32($fp) +# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) +# PARAM param_equal_at_Complex_d_0 --> 0($fp) +# local_equal_at_Complex_internal_8 = PARAM param_equal_at_Complex_d_0 +lw $t1, 0($fp) +sw $t1, -36($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) +# LOCAL local_equal_at_Complex_internal_9 --> -40($fp) +# local_equal_at_Complex_internal_9 = VCALL local_equal_at_Complex_internal_8 y_value +# Save new self pointer in $s1 +lw $s1, -36($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 56($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -40($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_equal_at_Complex_internal_6 --> -28($fp) +# LOCAL local_equal_at_Complex_internal_7 --> -32($fp) +# LOCAL local_equal_at_Complex_internal_9 --> -40($fp) +# local_equal_at_Complex_internal_6 = local_equal_at_Complex_internal_7 - local_equal_at_Complex_internal_9 +lw $t1, -32($fp) +lw $t2, -40($fp) +sub $t1, $t1, $t2 +sw $t1, -28($fp) +# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_TRUE_23 +# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_TRUE_23 +lw $t1, -28($fp) +beq $t1, 0, label_TRUE_23 +# LOCAL local_equal_at_Complex_internal_6 --> -28($fp) +# local_equal_at_Complex_internal_6 = 0 +li $t1, 0 +sw $t1, -28($fp) +# GOTO label_END_24 +j label_END_24 +label_TRUE_23: + # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) + # local_equal_at_Complex_internal_6 = 1 + li $t1, 1 + sw $t1, -28($fp) + label_END_24: +# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSEIF_21 +# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSEIF_21 +lw $t1, -28($fp) +beq $t1, 0, label_FALSEIF_21 +# LOCAL local_equal_at_Complex_internal_10 --> -44($fp) +# local_equal_at_Complex_internal_10 = 1 +li $t1, 1 +sw $t1, -44($fp) +# LOCAL local_equal_at_Complex_internal_5 --> -24($fp) +# LOCAL local_equal_at_Complex_internal_10 --> -44($fp) +# local_equal_at_Complex_internal_5 = local_equal_at_Complex_internal_10 +lw $t1, -44($fp) +sw $t1, -24($fp) +# GOTO label_ENDIF_22 +j label_ENDIF_22 +label_FALSEIF_21: + # LOCAL local_equal_at_Complex_internal_11 --> -48($fp) + # local_equal_at_Complex_internal_11 = 0 + li $t1, 0 + sw $t1, -48($fp) + # LOCAL local_equal_at_Complex_internal_5 --> -24($fp) + # LOCAL local_equal_at_Complex_internal_11 --> -48($fp) + # local_equal_at_Complex_internal_5 = local_equal_at_Complex_internal_11 + lw $t1, -48($fp) + sw $t1, -24($fp) + label_ENDIF_22: +# LOCAL local_equal_at_Complex_internal_0 --> -4($fp) +# LOCAL local_equal_at_Complex_internal_5 --> -24($fp) +# local_equal_at_Complex_internal_0 = local_equal_at_Complex_internal_5 +lw $t1, -24($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_18 +j label_ENDIF_18 +label_FALSEIF_17: + # LOCAL local_equal_at_Complex_internal_12 --> -52($fp) + # local_equal_at_Complex_internal_12 = 0 + li $t1, 0 + sw $t1, -52($fp) + # LOCAL local_equal_at_Complex_internal_0 --> -4($fp) + # LOCAL local_equal_at_Complex_internal_12 --> -52($fp) + # local_equal_at_Complex_internal_0 = local_equal_at_Complex_internal_12 + lw $t1, -52($fp) + sw $t1, -4($fp) + label_ENDIF_18: +# RETURN local_equal_at_Complex_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_equal_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 60 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_x_value_at_Complex implementation. +# @Params: +function_x_value_at_Complex: + # Allocate stack frame for function function_x_value_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_x_value_at_Complex_internal_0 = GETATTRIBUTE x Complex + # LOCAL local_x_value_at_Complex_internal_0 --> -4($fp) + lw $t1, 12($s1) + sw $t1, -4($fp) + # RETURN local_x_value_at_Complex_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_x_value_at_Complex. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_y_value_at_Complex implementation. +# @Params: +function_y_value_at_Complex: + # Allocate stack frame for function function_y_value_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_y_value_at_Complex_internal_0 = GETATTRIBUTE y Complex + # LOCAL local_y_value_at_Complex_internal_0 --> -4($fp) + lw $t1, 16($s1) + sw $t1, -4($fp) + # RETURN local_y_value_at_Complex_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_y_value_at_Complex. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 148 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 148 + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_c_0 = ALLOCATE Complex # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string + # Allocating string for type name la $t3, String sw $t3, 0($v0) la $t3, String_start @@ -1488,581 +1496,573 @@ label_FALSEIF_11: # Load type offset li $t3, 8 sw $t3, 8($v0) - la $t3, data_8 + la $t3, Complex sw $t3, 12($v0) - li $t3, 1 + li $t3, 7 sw $t3, 16($v0) - sw $v0, -72($fp) - # ARG local_print_at_Complex_internal_17 - # LOCAL local_print_at_Complex_internal_17 --> -72($fp) - lw $t3, -72($fp) - # Push arg into stack + move $t3, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Complex_start + sw $t3, 4($v0) + # Load type offset + li $t3, 16 + sw $t3, 8($v0) + move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Complex__attrib__x__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Complex__attrib__y__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t2) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t2, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE Complex + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Complex + sw $t4, 12($v0) + li $t4, 7 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Complex_start + sw $t4, 4($v0) + # Load type offset + li $t4, 16 + sw $t4, 8($v0) + move $t3, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t3 into stack subu $sp, $sp, 4 sw $t3, 0($sp) - # LOCAL local_print_at_Complex_internal_11 --> -48($fp) - # LOCAL local_print_at_Complex_internal_12 --> -52($fp) - # local_print_at_Complex_internal_12 = VCALL local_print_at_Complex_internal_11 out_string - # Save new self pointer in $s1 - lw $s1, -48($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 12($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -52($fp) + jal __Complex__attrib__x__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t3) + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Complex__attrib__y__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t3) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_9 --> -40($fp) - # LOCAL local_print_at_Complex_internal_12 --> -52($fp) - # local_print_at_Complex_internal_9 = local_print_at_Complex_internal_12 - lw $t3, -52($fp) - sw $t3, -40($fp) + sw $t3, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t3, -16($fp) + sw $t3, -8($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_print_at_Complex_internal_18 = GETATTRIBUTE y Complex - # LOCAL local_print_at_Complex_internal_18 --> -76($fp) - lw $t3, 16($s1) - sw $t3, -76($fp) - # ARG local_print_at_Complex_internal_18 - # LOCAL local_print_at_Complex_internal_18 --> -76($fp) - lw $t3, -76($fp) + # ARG 1 + li $t3, 1 # Push arg into stack subu $sp, $sp, 4 sw $t3, 0($sp) - # LOCAL local_print_at_Complex_internal_9 --> -40($fp) - # LOCAL local_print_at_Complex_internal_10 --> -44($fp) - # local_print_at_Complex_internal_10 = VCALL local_print_at_Complex_internal_9 out_int + # ARG 1 + li $t3, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init # Save new self pointer in $s1 - lw $s1, -40($fp) + lw $s1, -8($fp) # Get pointer to type lw $t3, 4($s1) # Get pointer to type's VTABLE lw $t4, 0($t3) # Get pointer to function address - lw $t5, 16($t4) + lw $t5, 28($t4) # Call function. Result is on $v0 jalr $t5 - sw $v0, -44($fp) + sw $v0, -12($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_7 --> -32($fp) - # LOCAL local_print_at_Complex_internal_10 --> -44($fp) - # local_print_at_Complex_internal_7 = local_print_at_Complex_internal_10 - lw $t3, -44($fp) - sw $t3, -32($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_c_0 = local_main_at_Main_internal_2 + lw $t3, -12($fp) + sw $t3, -4($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_c_0 + lw $t3, -4($fp) + sw $t3, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_at_Complex_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_9 - sw $t3, 12($v0) - li $t3, 1 - sw $t3, 16($v0) - sw $v0, -80($fp) - # ARG local_print_at_Complex_internal_19 - # LOCAL local_print_at_Complex_internal_19 --> -80($fp) - lw $t3, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_print_at_Complex_internal_7 --> -32($fp) - # LOCAL local_print_at_Complex_internal_8 --> -36($fp) - # local_print_at_Complex_internal_8 = VCALL local_print_at_Complex_internal_7 out_string + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 reflect_X # Save new self pointer in $s1 - lw $s1, -32($fp) + lw $s1, -28($fp) # Get pointer to type lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 12($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_0 --> -4($fp) - # LOCAL local_print_at_Complex_internal_8 --> -36($fp) - # local_print_at_Complex_internal_0 = local_print_at_Complex_internal_8 - lw $t3, -36($fp) - sw $t3, -4($fp) - label_ENDIF_12: -# RETURN local_print_at_Complex_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_print_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 88 -jr $ra -# Function END - - -# function_reflect_0_at_Complex implementation. -# @Params: -function_reflect_0_at_Complex: - # Allocate stack frame for function function_reflect_0_at_Complex. - subu $sp, $sp, 44 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 44 - # local_reflect_0_at_Complex_internal_1 = GETATTRIBUTE x Complex - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - lw $t3, 12($s1) - sw $t3, -8($fp) - # local_reflect_0_at_Complex_internal_3 = GETATTRIBUTE x Complex - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - lw $t3, 12($s1) - sw $t3, -16($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - lw $t3, -16($fp) - not $t3, $t3 - sw $t3, -12($fp) - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # local_reflect_0_at_Complex_internal_0 = local_reflect_0_at_Complex_internal_1 - local_reflect_0_at_Complex_internal_2 - lw $t3, -8($fp) - lw $t4, -12($fp) - sub $t3, $t3, $t4 - sw $t3, -4($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_15 - # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_15 - lw $t3, -4($fp) - beq $t3, 0, label_TRUE_15 - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # local_reflect_0_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - # GOTO label_END_16 -j label_END_16 -label_TRUE_15: - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # local_reflect_0_at_Complex_internal_0 = 1 - li $t3, 1 - sw $t3, -4($fp) - label_END_16: -# local_reflect_0_at_Complex_internal_5 = GETATTRIBUTE y Complex -# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) -lw $t3, 16($s1) -sw $t3, -24($fp) -# local_reflect_0_at_Complex_internal_7 = GETATTRIBUTE y Complex -# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -lw $t3, 16($s1) -sw $t3, -32($fp) -# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) -# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -lw $t3, -32($fp) -not $t3, $t3 -sw $t3, -28($fp) -# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) -# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) -# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) -# local_reflect_0_at_Complex_internal_4 = local_reflect_0_at_Complex_internal_5 - local_reflect_0_at_Complex_internal_6 -lw $t3, -24($fp) -lw $t4, -28($fp) -sub $t3, $t3, $t4 -sw $t3, -20($fp) -# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_17 -# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_17 -lw $t3, -20($fp) -beq $t3, 0, label_TRUE_17 -# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) -# local_reflect_0_at_Complex_internal_4 = 0 -li $t3, 0 -sw $t3, -20($fp) -# GOTO label_END_18 -j label_END_18 -label_TRUE_17: - # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) - # local_reflect_0_at_Complex_internal_4 = 1 - li $t3, 1 - sw $t3, -20($fp) - label_END_18: -# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) -# local_reflect_0_at_Complex_internal_8 = SELF -sw $s1, -36($fp) -# RETURN local_reflect_0_at_Complex_internal_8 -lw $v0, -36($fp) -# Deallocate stack frame for function function_reflect_0_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 44 -jr $ra -# Function END - - -# function_reflect_X_at_Complex implementation. -# @Params: -function_reflect_X_at_Complex: - # Allocate stack frame for function function_reflect_X_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_reflect_X_at_Complex_internal_1 = GETATTRIBUTE y Complex - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - lw $t3, 16($s1) - sw $t3, -8($fp) - # local_reflect_X_at_Complex_internal_3 = GETATTRIBUTE y Complex - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - lw $t3, 16($s1) - sw $t3, -16($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - lw $t3, -16($fp) - not $t3, $t3 - sw $t3, -12($fp) - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # local_reflect_X_at_Complex_internal_0 = local_reflect_X_at_Complex_internal_1 - local_reflect_X_at_Complex_internal_2 - lw $t3, -8($fp) - lw $t4, -12($fp) - sub $t3, $t3, $t4 - sw $t3, -4($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_19 - # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_19 - lw $t3, -4($fp) - beq $t3, 0, label_TRUE_19 - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # local_reflect_X_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - # GOTO label_END_20 -j label_END_20 -label_TRUE_19: - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # local_reflect_X_at_Complex_internal_0 = 1 - li $t3, 1 - sw $t3, -4($fp) - label_END_20: -# LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) -# local_reflect_X_at_Complex_internal_4 = SELF -sw $s1, -20($fp) -# RETURN local_reflect_X_at_Complex_internal_4 -lw $v0, -20($fp) -# Deallocate stack frame for function function_reflect_X_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 32 -jr $ra -# Function END - - -# function_reflect_Y_at_Complex implementation. -# @Params: -function_reflect_Y_at_Complex: - # Allocate stack frame for function function_reflect_Y_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_reflect_Y_at_Complex_internal_1 = GETATTRIBUTE x Complex - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - lw $t3, 12($s1) - sw $t3, -8($fp) - # local_reflect_Y_at_Complex_internal_3 = GETATTRIBUTE x Complex - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - lw $t3, 12($s1) - sw $t3, -16($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - lw $t3, -16($fp) - not $t3, $t3 - sw $t3, -12($fp) - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # local_reflect_Y_at_Complex_internal_0 = local_reflect_Y_at_Complex_internal_1 - local_reflect_Y_at_Complex_internal_2 - lw $t3, -8($fp) - lw $t4, -12($fp) - sub $t3, $t3, $t4 - sw $t3, -4($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_21 - # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_21 + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 40($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_internal_8 = local_main_at_Main_c_0 lw $t3, -4($fp) - beq $t3, 0, label_TRUE_21 - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # local_reflect_Y_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - # GOTO label_END_22 -j label_END_22 -label_TRUE_21: - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # local_reflect_Y_at_Complex_internal_0 = 1 - li $t3, 1 - sw $t3, -4($fp) - label_END_22: -# LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) -# local_reflect_Y_at_Complex_internal_4 = SELF -sw $s1, -20($fp) -# RETURN local_reflect_Y_at_Complex_internal_4 -lw $v0, -20($fp) -# Deallocate stack frame for function function_reflect_Y_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 32 -jr $ra -# Function END - - -# function_equal_at_Complex implementation. -# @Params: -# 0($fp) = param_equal_at_Complex_d_0 -function_equal_at_Complex: - # Allocate stack frame for function function_equal_at_Complex. - subu $sp, $sp, 60 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 60 - # local_equal_at_Complex_internal_2 = GETATTRIBUTE x Complex - # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) - lw $t3, 12($s1) - sw $t3, -12($fp) - # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) - # PARAM param_equal_at_Complex_d_0 --> 0($fp) - # local_equal_at_Complex_internal_3 = PARAM param_equal_at_Complex_d_0 - lw $t3, 0($fp) - sw $t3, -16($fp) + sw $t3, -36($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) - # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) - # local_equal_at_Complex_internal_4 = VCALL local_equal_at_Complex_internal_3 x_value + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 reflect_0 # Save new self pointer in $s1 - lw $s1, -16($fp) + lw $s1, -36($fp) # Get pointer to type lw $t3, 4($s1) # Get pointer to type's VTABLE lw $t4, 0($t3) # Get pointer to function address - lw $t5, 52($t4) + lw $t5, 36($t4) # Call function. Result is on $v0 jalr $t5 - sw $v0, -20($fp) + sw $v0, -40($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) - # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) - # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) - # local_equal_at_Complex_internal_1 = local_equal_at_Complex_internal_2 - local_equal_at_Complex_internal_4 - lw $t3, -12($fp) - lw $t4, -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_5 = local_main_at_Main_internal_7 - local_main_at_Main_internal_9 + lw $t3, -32($fp) + lw $t4, -40($fp) sub $t3, $t3, $t4 - sw $t3, -8($fp) - # IF_ZERO local_equal_at_Complex_internal_1 GOTO label_TRUE_25 - # IF_ZERO local_equal_at_Complex_internal_1 GOTO label_TRUE_25 - lw $t3, -8($fp) - beq $t3, 0, label_TRUE_25 - # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) - # local_equal_at_Complex_internal_1 = 0 + sw $t3, -24($fp) + # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_27 + # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_27 + lw $t3, -24($fp) + beq $t3, 0, label_TRUE_27 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = 0 li $t3, 0 - sw $t3, -8($fp) - # GOTO label_END_26 -j label_END_26 -label_TRUE_25: - # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) - # local_equal_at_Complex_internal_1 = 1 + sw $t3, -24($fp) + # GOTO label_END_28 +j label_END_28 +label_TRUE_27: + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = 1 li $t3, 1 - sw $t3, -8($fp) - label_END_26: -# IF_ZERO local_equal_at_Complex_internal_1 GOTO label_FALSEIF_23 -# IF_ZERO local_equal_at_Complex_internal_1 GOTO label_FALSEIF_23 -lw $t3, -8($fp) -beq $t3, 0, label_FALSEIF_23 -# local_equal_at_Complex_internal_7 = GETATTRIBUTE y Complex -# LOCAL local_equal_at_Complex_internal_7 --> -32($fp) -lw $t3, 16($s1) -sw $t3, -32($fp) -# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) -# PARAM param_equal_at_Complex_d_0 --> 0($fp) -# local_equal_at_Complex_internal_8 = PARAM param_equal_at_Complex_d_0 -lw $t3, 0($fp) -sw $t3, -36($fp) + sw $t3, -24($fp) + label_END_28: +# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_25 +# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_25 +lw $t3, -24($fp) +beq $t3, 0, label_FALSEIF_25 +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# local_main_at_Main_internal_12 = SELF +sw $s1, -52($fp) +# LOCAL local_main_at_Main_internal_10 --> -44($fp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# local_main_at_Main_internal_10 = local_main_at_Main_internal_12 +lw $t3, -52($fp) +sw $t3, -44($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t3, String +sw $t3, 0($v0) +la $t3, String_start +sw $t3, 4($v0) +# Load type offset +li $t3, 8 +sw $t3, 8($v0) +la $t3, data_6 +sw $t3, 12($v0) +li $t3, 3 +sw $t3, 16($v0) +sw $v0, -56($fp) +# ARG local_main_at_Main_internal_13 +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +lw $t3, -56($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_10 --> -44($fp) +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +# local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 out_string +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 12($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_4 --> -20($fp) +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +# local_main_at_Main_internal_4 = local_main_at_Main_internal_11 +lw $t3, -48($fp) +sw $t3, -20($fp) +# GOTO label_ENDIF_26 +j label_ENDIF_26 +label_FALSEIF_25: + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_14 = local_main_at_Main_internal_16 + lw $t3, -68($fp) + sw $t3, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_7 + sw $t3, 12($v0) + li $t3, 3 + sw $t3, 16($v0) + sw $v0, -72($fp) + # ARG local_main_at_Main_internal_17 + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + lw $t3, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 out_string + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_15 + lw $t3, -64($fp) + sw $t3, -20($fp) + label_ENDIF_26: +# LOCAL local_main_at_Main_internal_23 --> -96($fp) +# LOCAL local_main_at_Main_c_0 --> -4($fp) +# local_main_at_Main_internal_23 = local_main_at_Main_c_0 +lw $t3, -4($fp) +sw $t3, -96($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_23 --> -96($fp) +# LOCAL local_main_at_Main_internal_24 --> -100($fp) +# local_main_at_Main_internal_24 = VCALL local_main_at_Main_internal_23 reflect_X +# Save new self pointer in $s1 +lw $s1, -96($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 40($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -100($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_21 --> -88($fp) +# LOCAL local_main_at_Main_internal_24 --> -100($fp) +# local_main_at_Main_internal_21 = local_main_at_Main_internal_24 +lw $t3, -100($fp) +sw $t3, -88($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_21 --> -88($fp) +# LOCAL local_main_at_Main_internal_22 --> -92($fp) +# local_main_at_Main_internal_22 = VCALL local_main_at_Main_internal_21 reflect_Y +# Save new self pointer in $s1 +lw $s1, -88($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 44($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -92($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# LOCAL local_main_at_Main_internal_22 --> -92($fp) +# local_main_at_Main_internal_19 = local_main_at_Main_internal_22 +lw $t3, -92($fp) +sw $t3, -80($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) -# LOCAL local_equal_at_Complex_internal_9 --> -40($fp) -# local_equal_at_Complex_internal_9 = VCALL local_equal_at_Complex_internal_8 y_value +# LOCAL local_main_at_Main_internal_25 --> -104($fp) +# LOCAL local_main_at_Main_c_0 --> -4($fp) +# local_main_at_Main_internal_25 = local_main_at_Main_c_0 +lw $t3, -4($fp) +sw $t3, -104($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_25 --> -104($fp) +# LOCAL local_main_at_Main_internal_26 --> -108($fp) +# local_main_at_Main_internal_26 = VCALL local_main_at_Main_internal_25 reflect_0 # Save new self pointer in $s1 -lw $s1, -36($fp) +lw $s1, -104($fp) # Get pointer to type lw $t3, 4($s1) # Get pointer to type's VTABLE lw $t4, 0($t3) # Get pointer to function address -lw $t5, 56($t4) +lw $t5, 36($t4) # Call function. Result is on $v0 jalr $t5 -sw $v0, -40($fp) +sw $v0, -108($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_equal_at_Complex_internal_6 --> -28($fp) -# LOCAL local_equal_at_Complex_internal_7 --> -32($fp) -# LOCAL local_equal_at_Complex_internal_9 --> -40($fp) -# local_equal_at_Complex_internal_6 = local_equal_at_Complex_internal_7 - local_equal_at_Complex_internal_9 -lw $t3, -32($fp) -lw $t4, -40($fp) -sub $t3, $t3, $t4 -sw $t3, -28($fp) -# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_TRUE_29 -# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_TRUE_29 -lw $t3, -28($fp) -beq $t3, 0, label_TRUE_29 -# LOCAL local_equal_at_Complex_internal_6 --> -28($fp) -# local_equal_at_Complex_internal_6 = 0 -li $t3, 0 -sw $t3, -28($fp) -# GOTO label_END_30 -j label_END_30 -label_TRUE_29: - # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) - # local_equal_at_Complex_internal_6 = 1 - li $t3, 1 - sw $t3, -28($fp) - label_END_30: -# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSEIF_27 -# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSEIF_27 -lw $t3, -28($fp) -beq $t3, 0, label_FALSEIF_27 -# LOCAL local_equal_at_Complex_internal_10 --> -44($fp) -# local_equal_at_Complex_internal_10 = 1 -li $t3, 1 -sw $t3, -44($fp) -# LOCAL local_equal_at_Complex_internal_5 --> -24($fp) -# LOCAL local_equal_at_Complex_internal_10 --> -44($fp) -# local_equal_at_Complex_internal_5 = local_equal_at_Complex_internal_10 -lw $t3, -44($fp) -sw $t3, -24($fp) -# GOTO label_ENDIF_28 -j label_ENDIF_28 -label_FALSEIF_27: - # LOCAL local_equal_at_Complex_internal_11 --> -48($fp) - # local_equal_at_Complex_internal_11 = 0 - li $t3, 0 - sw $t3, -48($fp) - # LOCAL local_equal_at_Complex_internal_5 --> -24($fp) - # LOCAL local_equal_at_Complex_internal_11 --> -48($fp) - # local_equal_at_Complex_internal_5 = local_equal_at_Complex_internal_11 - lw $t3, -48($fp) - sw $t3, -24($fp) - label_ENDIF_28: -# LOCAL local_equal_at_Complex_internal_0 --> -4($fp) -# LOCAL local_equal_at_Complex_internal_5 --> -24($fp) -# local_equal_at_Complex_internal_0 = local_equal_at_Complex_internal_5 -lw $t3, -24($fp) -sw $t3, -4($fp) -# GOTO label_ENDIF_24 -j label_ENDIF_24 -label_FALSEIF_23: - # LOCAL local_equal_at_Complex_internal_12 --> -52($fp) - # local_equal_at_Complex_internal_12 = 0 - li $t3, 0 - sw $t3, -52($fp) - # LOCAL local_equal_at_Complex_internal_0 --> -4($fp) - # LOCAL local_equal_at_Complex_internal_12 --> -52($fp) - # local_equal_at_Complex_internal_0 = local_equal_at_Complex_internal_12 - lw $t3, -52($fp) - sw $t3, -4($fp) - label_ENDIF_24: -# RETURN local_equal_at_Complex_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_equal_at_Complex. +# ARG local_main_at_Main_internal_26 +# LOCAL local_main_at_Main_internal_26 --> -108($fp) +lw $t3, -108($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# LOCAL local_main_at_Main_internal_20 --> -84($fp) +# local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 equal +# Save new self pointer in $s1 +lw $s1, -80($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 48($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -84($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# IF_ZERO local_main_at_Main_internal_20 GOTO label_FALSEIF_29 +# IF_ZERO local_main_at_Main_internal_20 GOTO label_FALSEIF_29 +lw $t3, -84($fp) +beq $t3, 0, label_FALSEIF_29 +# LOCAL local_main_at_Main_internal_29 --> -120($fp) +# local_main_at_Main_internal_29 = SELF +sw $s1, -120($fp) +# LOCAL local_main_at_Main_internal_27 --> -112($fp) +# LOCAL local_main_at_Main_internal_29 --> -120($fp) +# local_main_at_Main_internal_27 = local_main_at_Main_internal_29 +lw $t3, -120($fp) +sw $t3, -112($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_30 --> -124($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t3, String +sw $t3, 0($v0) +la $t3, String_start +sw $t3, 4($v0) +# Load type offset +li $t3, 8 +sw $t3, 8($v0) +la $t3, data_8 +sw $t3, 12($v0) +li $t3, 3 +sw $t3, 16($v0) +sw $v0, -124($fp) +# ARG local_main_at_Main_internal_30 +# LOCAL local_main_at_Main_internal_30 --> -124($fp) +lw $t3, -124($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_27 --> -112($fp) +# LOCAL local_main_at_Main_internal_28 --> -116($fp) +# local_main_at_Main_internal_28 = VCALL local_main_at_Main_internal_27 out_string +# Save new self pointer in $s1 +lw $s1, -112($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 12($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -116($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# LOCAL local_main_at_Main_internal_28 --> -116($fp) +# local_main_at_Main_internal_18 = local_main_at_Main_internal_28 +lw $t3, -116($fp) +sw $t3, -76($fp) +# GOTO label_ENDIF_30 +j label_ENDIF_30 +label_FALSEIF_29: + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # local_main_at_Main_internal_33 = SELF + sw $s1, -136($fp) + # LOCAL local_main_at_Main_internal_31 --> -128($fp) + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # local_main_at_Main_internal_31 = local_main_at_Main_internal_33 + lw $t3, -136($fp) + sw $t3, -128($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_9 + sw $t3, 12($v0) + li $t3, 3 + sw $t3, 16($v0) + sw $v0, -140($fp) + # ARG local_main_at_Main_internal_34 + # LOCAL local_main_at_Main_internal_34 --> -140($fp) + lw $t3, -140($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_31 --> -128($fp) + # LOCAL local_main_at_Main_internal_32 --> -132($fp) + # local_main_at_Main_internal_32 = VCALL local_main_at_Main_internal_31 out_string + # Save new self pointer in $s1 + lw $s1, -128($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 12($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -132($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_32 --> -132($fp) + # local_main_at_Main_internal_18 = local_main_at_Main_internal_32 + lw $t3, -132($fp) + sw $t3, -76($fp) + label_ENDIF_30: +# RETURN local_main_at_Main_internal_18 +lw $v0, -76($fp) +# Deallocate stack frame for function function_main_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 60 -# Deallocate function args -addu $sp, $sp, 4 +addu $sp, $sp, 148 jr $ra # Function END - -# function_x_value_at_Complex implementation. -# @Params: -function_x_value_at_Complex: - # Allocate stack frame for function function_x_value_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_x_value_at_Complex_internal_0 = GETATTRIBUTE x Complex - # LOCAL local_x_value_at_Complex_internal_0 --> -4($fp) - lw $t3, 12($s1) - sw $t3, -4($fp) - # RETURN local_x_value_at_Complex_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_x_value_at_Complex. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_y_value_at_Complex implementation. -# @Params: -function_y_value_at_Complex: - # Allocate stack frame for function function_y_value_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_y_value_at_Complex_internal_0 = GETATTRIBUTE y Complex - # LOCAL local_y_value_at_Complex_internal_0 --> -4($fp) - lw $t3, 16($s1) - sw $t3, -4($fp) - # RETURN local_y_value_at_Complex_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_y_value_at_Complex. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - diff --git a/tests/codegen/primes.mips b/tests/codegen/primes.mips index e9e6ef27..4fd6530c 100644 --- a/tests/codegen/primes.mips +++ b/tests/codegen/primes.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:22 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 17:41:29 2020 # School of Math and Computer Science, University of Havana # @@ -365,7 +365,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/print-cool.mips b/tests/codegen/print-cool.mips index 640c7c1d..27f1391a 100644 --- a/tests/codegen/print-cool.mips +++ b/tests/codegen/print-cool.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:23 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 17:41:29 2020 # School of Math and Computer Science, University of Havana # @@ -353,7 +353,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self From 8c0934c9666390f7758a1507e71e9129351515b0 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sun, 6 Dec 2020 22:31:33 -0500 Subject: [PATCH 152/162] Fix var name lookup in function localvars in MIPS --- src/testing.mips | 514 +++--- src/travels/ctcill.py | 8 +- tests/codegen/atoi.mips | 4 +- tests/codegen/book_list.mips | 2768 ++++++++++++++++---------------- tests/codegen/cells.mips | 2152 +++++++++++++++++++++++++ tests/codegen/complex.mips | 1706 ++++++++++---------- tests/codegen/fib.mips | 4 +- tests/codegen/hairyscary.mips | 514 +++--- tests/codegen/hello_world.mips | 4 +- tests/codegen/io.mips | 352 ++-- tests/codegen/life.mips | 6 +- tests/codegen/list.mips | 4 +- tests/codegen/new_complex.mips | 4 +- tests/codegen/palindrome.mips | 4 +- tests/codegen/primes.mips | 4 +- tests/codegen/print-cool.mips | 4 +- 16 files changed, 5157 insertions(+), 2895 deletions(-) create mode 100644 tests/codegen/cells.mips diff --git a/src/testing.mips b/src/testing.mips index dff2e900..73328255 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 17:41:46 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:29:13 2020 # School of Math and Computer Science, University of Havana # @@ -421,7 +421,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -1181,10 +1181,10 @@ __Bazz__attrib__h__init: # @Params: __Bazz__attrib__g__init: # Allocate stack frame for function __Bazz__attrib__g__init. - subu $sp, $sp, 56 + subu $sp, $sp, 60 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 56 + addu $fp, $sp, 60 # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) # local_ttrib__g__init_internal_0 = SELF sw $s1, -4($fp) @@ -1195,12 +1195,12 @@ __Bazz__attrib__g__init: # Load pointer to type offset lw $t6, 8($t5) sw $t6, -8($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # local_ttrib__g__init_internal_3 = 13 - li $t5, 13 - sw $t5, -16($fp) - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bazz # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_4 = 13 + li $t5, 13 + sw $t5, -20($fp) + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bazz + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Bazz la $t5, Bazz__TDT @@ -1208,21 +1208,21 @@ __Bazz__attrib__g__init: addu $t5, $t5, $t6 # Save distance lw $t6, 0($t5) - sw $t6, -20($fp) + sw $t6, -24($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # Update min if 13 < 14 - lw $t5, -20($fp) - lw $t6, -16($fp) + lw $t5, -24($fp) + lw $t6, -20($fp) bgtu $t5, $t6, label_Not_min0_1 - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 - lw $t5, -20($fp) - sw $t5, -16($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_5 + lw $t5, -24($fp) + sw $t5, -20($fp) label_Not_min0_1: - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Razz la $t5, Razz__TDT @@ -1230,21 +1230,21 @@ __Bazz__attrib__g__init: addu $t5, $t5, $t6 # Save distance lw $t6, 0($t5) - sw $t6, -20($fp) + sw $t6, -24($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # Update min if 13 < 14 - lw $t5, -20($fp) - lw $t6, -16($fp) + lw $t5, -24($fp) + lw $t6, -20($fp) bgtu $t5, $t6, label_Not_min1_2 - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 - lw $t5, -20($fp) - sw $t5, -16($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_5 + lw $t5, -24($fp) + sw $t5, -20($fp) label_Not_min1_2: - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Foo - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Foo + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Foo la $t5, Foo__TDT @@ -1252,21 +1252,21 @@ __Bazz__attrib__g__init: addu $t5, $t5, $t6 # Save distance lw $t6, 0($t5) - sw $t6, -20($fp) + sw $t6, -24($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # Update min if 13 < 14 - lw $t5, -20($fp) - lw $t6, -16($fp) + lw $t5, -24($fp) + lw $t6, -20($fp) bgtu $t5, $t6, label_Not_min2_3 - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 - lw $t5, -20($fp) - sw $t5, -16($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_5 + lw $t5, -24($fp) + sw $t5, -20($fp) label_Not_min2_3: - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Bar la $t5, Bar__TDT @@ -1274,37 +1274,37 @@ __Bazz__attrib__g__init: addu $t5, $t5, $t6 # Save distance lw $t6, 0($t5) - sw $t6, -20($fp) + sw $t6, -24($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # Update min if 13 < 14 - lw $t5, -20($fp) - lw $t6, -16($fp) + lw $t5, -24($fp) + lw $t6, -20($fp) bgtu $t5, $t6, label_Not_min3_4 - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 - lw $t5, -20($fp) - sw $t5, -16($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_5 + lw $t5, -24($fp) + sw $t5, -20($fp) label_Not_min3_4: - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # local_ttrib__g__init_internal_4 = 13 + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # local_ttrib__g__init_internal_5 = 13 li $t5, 13 - sw $t5, -20($fp) + sw $t5, -24($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # local_ttrib__g__init_internal_2 = local_ttrib__g__init_internal_4 - local_ttrib__g__init_internal_3 - lw $t5, -20($fp) - lw $t6, -16($fp) + # local_ttrib__g__init_internal_2 = local_ttrib__g__init_internal_5 - local_ttrib__g__init_internal_4 + lw $t5, -24($fp) + lw $t6, -20($fp) sub $t5, $t5, $t6 sw $t5, -12($fp) # IF_ZERO local_ttrib__g__init_internal_2 GOTO label_ERROR_5 # IF_ZERO local_ttrib__g__init_internal_2 GOTO label_ERROR_5 lw $t5, -12($fp) beq $t5, 0, label_ERROR_5 - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bazz - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bazz + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Bazz la $t5, Bazz__TDT @@ -1312,20 +1312,20 @@ __Bazz__attrib__g__init: addu $t5, $t5, $t6 # Save distance lw $t6, 0($t5) - sw $t6, -20($fp) + sw $t6, -24($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # Update min if 13 < 14 - lw $t5, -20($fp) - lw $t6, -16($fp) + lw $t5, -24($fp) + lw $t6, -20($fp) bgtu $t5, $t6, label_NEXT0_7 - # LOCAL local_ttrib__g__init_n_5 --> -24($fp) + # LOCAL local_ttrib__g__init_n_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_n_5 = local_ttrib__g__init_internal_0 + # local_ttrib__g__init_n_6 = local_ttrib__g__init_internal_0 lw $t5, -4($fp) - sw $t5, -24($fp) - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # local_ttrib__g__init_internal_6 = ALLOCATE Foo + sw $t5, -28($fp) + # LOCAL local_ttrib__g__init_internal_7 --> -32($fp) + # local_ttrib__g__init_internal_7 = ALLOCATE Foo # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1401,12 +1401,17 @@ __Bazz__attrib__g__init: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t6, -28($fp) + sw $t6, -32($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_internal_7 --> -32($fp) + # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_7 + lw $t6, -32($fp) + sw $t6, -16($fp) # GOTO label_END_6 j label_END_6 label_NEXT0_7: - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Razz la $t6, Razz__TDT @@ -1414,20 +1419,20 @@ label_NEXT0_7: addu $t6, $t6, $t7 # Save distance lw $t7, 0($t6) - sw $t7, -20($fp) + sw $t7, -24($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # Update min if 14 < 15 - lw $t6, -20($fp) - lw $t7, -16($fp) + lw $t6, -24($fp) + lw $t7, -20($fp) bgtu $t6, $t7, label_NEXT1_8 - # LOCAL local_ttrib__g__init_n_7 --> -32($fp) + # LOCAL local_ttrib__g__init_n_8 --> -36($fp) # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_n_7 = local_ttrib__g__init_internal_0 + # local_ttrib__g__init_n_8 = local_ttrib__g__init_internal_0 lw $t6, -4($fp) - sw $t6, -32($fp) - # LOCAL local_ttrib__g__init_internal_8 --> -36($fp) - # local_ttrib__g__init_internal_8 = ALLOCATE Bar + sw $t6, -36($fp) + # LOCAL local_ttrib__g__init_internal_9 --> -40($fp) + # local_ttrib__g__init_internal_9 = ALLOCATE Bar # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1535,12 +1540,17 @@ label_NEXT0_7: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t7, -36($fp) + sw $t7, -40($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_internal_9 --> -40($fp) + # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_9 + lw $t7, -40($fp) + sw $t7, -16($fp) # GOTO label_END_6 j label_END_6 label_NEXT1_8: - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Foo - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Foo + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Foo la $t7, Foo__TDT @@ -1548,20 +1558,20 @@ label_NEXT1_8: addu $t7, $t7, $t8 # Save distance lw $t8, 0($t7) - sw $t8, -20($fp) + sw $t8, -24($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # Update min if 15 < 24 - lw $t7, -20($fp) - lw $t8, -16($fp) + lw $t7, -24($fp) + lw $t8, -20($fp) bgtu $t7, $t8, label_NEXT2_9 - # LOCAL local_ttrib__g__init_n_9 --> -40($fp) + # LOCAL local_ttrib__g__init_n_10 --> -44($fp) # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_n_9 = local_ttrib__g__init_internal_0 + # local_ttrib__g__init_n_10 = local_ttrib__g__init_internal_0 lw $t7, -4($fp) - sw $t7, -40($fp) - # LOCAL local_ttrib__g__init_internal_10 --> -44($fp) - # local_ttrib__g__init_internal_10 = ALLOCATE Razz + sw $t7, -44($fp) + # LOCAL local_ttrib__g__init_internal_11 --> -48($fp) + # local_ttrib__g__init_internal_11 = ALLOCATE Razz # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1653,12 +1663,17 @@ label_NEXT1_8: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t8, -44($fp) + sw $t8, -48($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_internal_11 --> -48($fp) + # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_11 + lw $t8, -48($fp) + sw $t8, -16($fp) # GOTO label_END_6 j label_END_6 label_NEXT2_9: - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Bar la $t8, Bar__TDT @@ -1666,18 +1681,23 @@ label_NEXT2_9: addu $t8, $t8, $t9 # Save distance lw $t9, 0($t8) - sw $t9, -20($fp) + sw $t9, -24($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # Update min if 24 < 25 - lw $t8, -20($fp) - lw $t9, -16($fp) + lw $t8, -24($fp) + lw $t9, -20($fp) bgtu $t8, $t9, label_NEXT3_10 - # LOCAL local_ttrib__g__init_n_11 --> -48($fp) + # LOCAL local_ttrib__g__init_n_12 --> -52($fp) # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_n_11 = local_ttrib__g__init_internal_0 + # local_ttrib__g__init_n_12 = local_ttrib__g__init_internal_0 lw $t8, -4($fp) - sw $t8, -48($fp) + sw $t8, -52($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_n_12 --> -52($fp) + # local_ttrib__g__init_internal_3 = local_ttrib__g__init_n_12 + lw $t8, -52($fp) + sw $t8, -16($fp) # GOTO label_END_6 j label_END_6 label_NEXT3_10: @@ -1698,14 +1718,15 @@ label_NEXT3_10: li $v0, 10 syscall label_END_6: -# RETURN +# RETURN local_ttrib__g__init_internal_3 +lw $v0, -16($fp) # Deallocate stack frame for function __Bazz__attrib__g__init. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 56 +addu $sp, $sp, 60 jr $ra # Function END @@ -1866,10 +1887,10 @@ function_doh_at_Bazz: # @Params: __Foo__attrib__a__init: # Allocate stack frame for function __Foo__attrib__a__init. - subu $sp, $sp, 48 + subu $sp, $sp, 52 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 48 + addu $fp, $sp, 52 # LOCAL local_trib__a__init_internal_0 --> -4($fp) # local_trib__a__init_internal_0 = SELF sw $s1, -4($fp) @@ -1880,12 +1901,12 @@ __Foo__attrib__a__init: # Load pointer to type offset lw $t9, 8($t8) sw $t9, -8($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # local_trib__a__init_internal_3 = 13 - li $t8, 13 - sw $t8, -16($fp) - # local_trib__a__init_internal_4 = TYPE_DISTANCE Razz # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_4 = 13 + li $t8, 13 + sw $t8, -20($fp) + # local_trib__a__init_internal_5 = TYPE_DISTANCE Razz + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_1 --> -8($fp) # Load TDT pointer to type Razz la $t8, Razz__TDT @@ -1893,21 +1914,21 @@ __Foo__attrib__a__init: addu $t8, $t8, $t9 # Save distance lw $t9, 0($t8) - sw $t9, -20($fp) + sw $t9, -24($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) # Update min if 24 < 25 - lw $t8, -20($fp) - lw $t9, -16($fp) + lw $t8, -24($fp) + lw $t9, -20($fp) bgtu $t8, $t9, label_Not_min0_11 - # LOCAL local_trib__a__init_internal_3 --> -16($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # local_trib__a__init_internal_3 = local_trib__a__init_internal_4 - lw $t8, -20($fp) - sw $t8, -16($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) + # local_trib__a__init_internal_4 = local_trib__a__init_internal_5 + lw $t8, -24($fp) + sw $t8, -20($fp) label_Not_min0_11: - # local_trib__a__init_internal_4 = TYPE_DISTANCE Foo - # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_5 = TYPE_DISTANCE Foo + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_1 --> -8($fp) # Load TDT pointer to type Foo la $t8, Foo__TDT @@ -1915,21 +1936,21 @@ __Foo__attrib__a__init: addu $t8, $t8, $t9 # Save distance lw $t9, 0($t8) - sw $t9, -20($fp) + sw $t9, -24($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) # Update min if 24 < 25 - lw $t8, -20($fp) - lw $t9, -16($fp) + lw $t8, -24($fp) + lw $t9, -20($fp) bgtu $t8, $t9, label_Not_min1_12 - # LOCAL local_trib__a__init_internal_3 --> -16($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # local_trib__a__init_internal_3 = local_trib__a__init_internal_4 - lw $t8, -20($fp) - sw $t8, -16($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) + # local_trib__a__init_internal_4 = local_trib__a__init_internal_5 + lw $t8, -24($fp) + sw $t8, -20($fp) label_Not_min1_12: - # local_trib__a__init_internal_4 = TYPE_DISTANCE Bar - # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_5 = TYPE_DISTANCE Bar + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_1 --> -8($fp) # Load TDT pointer to type Bar la $t8, Bar__TDT @@ -1937,37 +1958,37 @@ __Foo__attrib__a__init: addu $t8, $t8, $t9 # Save distance lw $t9, 0($t8) - sw $t9, -20($fp) + sw $t9, -24($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) # Update min if 24 < 25 - lw $t8, -20($fp) - lw $t9, -16($fp) + lw $t8, -24($fp) + lw $t9, -20($fp) bgtu $t8, $t9, label_Not_min2_13 - # LOCAL local_trib__a__init_internal_3 --> -16($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # local_trib__a__init_internal_3 = local_trib__a__init_internal_4 - lw $t8, -20($fp) - sw $t8, -16($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) + # local_trib__a__init_internal_4 = local_trib__a__init_internal_5 + lw $t8, -24($fp) + sw $t8, -20($fp) label_Not_min2_13: - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # local_trib__a__init_internal_4 = 13 + # LOCAL local_trib__a__init_internal_5 --> -24($fp) + # local_trib__a__init_internal_5 = 13 li $t8, 13 - sw $t8, -20($fp) + sw $t8, -24($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # local_trib__a__init_internal_2 = local_trib__a__init_internal_4 - local_trib__a__init_internal_3 - lw $t8, -20($fp) - lw $t9, -16($fp) + # local_trib__a__init_internal_2 = local_trib__a__init_internal_5 - local_trib__a__init_internal_4 + lw $t8, -24($fp) + lw $t9, -20($fp) sub $t8, $t8, $t9 sw $t8, -12($fp) # IF_ZERO local_trib__a__init_internal_2 GOTO label_ERROR_14 # IF_ZERO local_trib__a__init_internal_2 GOTO label_ERROR_14 lw $t8, -12($fp) beq $t8, 0, label_ERROR_14 - # local_trib__a__init_internal_4 = TYPE_DISTANCE Razz - # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_5 = TYPE_DISTANCE Razz + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_1 --> -8($fp) # Load TDT pointer to type Razz la $t8, Razz__TDT @@ -1975,20 +1996,20 @@ __Foo__attrib__a__init: addu $t8, $t8, $t9 # Save distance lw $t9, 0($t8) - sw $t9, -20($fp) + sw $t9, -24($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) # Update min if 24 < 25 - lw $t8, -20($fp) - lw $t9, -16($fp) + lw $t8, -24($fp) + lw $t9, -20($fp) bgtu $t8, $t9, label_NEXT0_16 - # LOCAL local_trib__a__init_n_5 --> -24($fp) + # LOCAL local_trib__a__init_n_6 --> -28($fp) # LOCAL local_trib__a__init_internal_0 --> -4($fp) - # local_trib__a__init_n_5 = local_trib__a__init_internal_0 + # local_trib__a__init_n_6 = local_trib__a__init_internal_0 lw $t8, -4($fp) - sw $t8, -24($fp) - # LOCAL local_trib__a__init_internal_6 --> -28($fp) - # local_trib__a__init_internal_6 = ALLOCATE Bar + sw $t8, -28($fp) + # LOCAL local_trib__a__init_internal_7 --> -32($fp) + # local_trib__a__init_internal_7 = ALLOCATE Bar # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -2096,12 +2117,17 @@ __Foo__attrib__a__init: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t9, -28($fp) + sw $t9, -32($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # LOCAL local_trib__a__init_internal_7 --> -32($fp) + # local_trib__a__init_internal_3 = local_trib__a__init_internal_7 + lw $t9, -32($fp) + sw $t9, -16($fp) # GOTO label_END_15 j label_END_15 label_NEXT0_16: - # local_trib__a__init_internal_4 = TYPE_DISTANCE Foo - # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_5 = TYPE_DISTANCE Foo + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_1 --> -8($fp) # Load TDT pointer to type Foo la $t9, Foo__TDT @@ -2109,20 +2135,20 @@ label_NEXT0_16: addu $t9, $t9, $s2 # Save distance lw $s2, 0($t9) - sw $s2, -20($fp) + sw $s2, -24($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) # Update min if 25 < 18 - lw $t9, -20($fp) - lw $s2, -16($fp) + lw $t9, -24($fp) + lw $s2, -20($fp) bgtu $t9, $s2, label_NEXT1_17 - # LOCAL local_trib__a__init_n_7 --> -32($fp) + # LOCAL local_trib__a__init_n_8 --> -36($fp) # LOCAL local_trib__a__init_internal_0 --> -4($fp) - # local_trib__a__init_n_7 = local_trib__a__init_internal_0 + # local_trib__a__init_n_8 = local_trib__a__init_internal_0 lw $t9, -4($fp) - sw $t9, -32($fp) - # LOCAL local_trib__a__init_internal_8 --> -36($fp) - # local_trib__a__init_internal_8 = ALLOCATE Razz + sw $t9, -36($fp) + # LOCAL local_trib__a__init_internal_9 --> -40($fp) + # local_trib__a__init_internal_9 = ALLOCATE Razz # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -2214,12 +2240,17 @@ label_NEXT0_16: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $s2, -36($fp) + sw $s2, -40($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # LOCAL local_trib__a__init_internal_9 --> -40($fp) + # local_trib__a__init_internal_3 = local_trib__a__init_internal_9 + lw $s2, -40($fp) + sw $s2, -16($fp) # GOTO label_END_15 j label_END_15 label_NEXT1_17: - # local_trib__a__init_internal_4 = TYPE_DISTANCE Bar - # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_5 = TYPE_DISTANCE Bar + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_1 --> -8($fp) # Load TDT pointer to type Bar la $s2, Bar__TDT @@ -2227,18 +2258,23 @@ label_NEXT1_17: addu $s2, $s2, $s3 # Save distance lw $s3, 0($s2) - sw $s3, -20($fp) + sw $s3, -24($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) # Update min if 18 < 19 - lw $s2, -20($fp) - lw $s3, -16($fp) + lw $s2, -24($fp) + lw $s3, -20($fp) bgtu $s2, $s3, label_NEXT2_18 - # LOCAL local_trib__a__init_n_9 --> -40($fp) + # LOCAL local_trib__a__init_n_10 --> -44($fp) # LOCAL local_trib__a__init_internal_0 --> -4($fp) - # local_trib__a__init_n_9 = local_trib__a__init_internal_0 + # local_trib__a__init_n_10 = local_trib__a__init_internal_0 lw $s2, -4($fp) - sw $s2, -40($fp) + sw $s2, -44($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # LOCAL local_trib__a__init_n_10 --> -44($fp) + # local_trib__a__init_internal_3 = local_trib__a__init_n_10 + lw $s2, -44($fp) + sw $s2, -16($fp) # GOTO label_END_15 j label_END_15 label_NEXT2_18: @@ -2259,14 +2295,15 @@ label_NEXT2_18: li $v0, 10 syscall label_END_15: -# RETURN +# RETURN local_trib__a__init_internal_3 +lw $v0, -16($fp) # Deallocate stack frame for function __Foo__attrib__a__init. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 48 +addu $sp, $sp, 52 jr $ra # Function END @@ -2478,10 +2515,10 @@ function_doh_at_Foo: # @Params: __Razz__attrib__e__init: # Allocate stack frame for function __Razz__attrib__e__init. - subu $sp, $sp, 40 + subu $sp, $sp, 44 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 40 + addu $fp, $sp, 44 # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) # local_ttrib__e__init_internal_0 = SELF sw $s1, -4($fp) @@ -2492,12 +2529,12 @@ __Razz__attrib__e__init: # Load pointer to type offset lw $s3, 8($s2) sw $s3, -8($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) - # local_ttrib__e__init_internal_3 = 13 - li $s2, 13 - sw $s2, -16($fp) - # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Razz # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # local_ttrib__e__init_internal_4 = 13 + li $s2, 13 + sw $s2, -20($fp) + # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) # Load TDT pointer to type Razz la $s2, Razz__TDT @@ -2505,21 +2542,21 @@ __Razz__attrib__e__init: addu $s2, $s2, $s3 # Save distance lw $s3, 0($s2) - sw $s3, -20($fp) + sw $s3, -24($fp) + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) # Update min if 18 < 19 - lw $s2, -20($fp) - lw $s3, -16($fp) + lw $s2, -24($fp) + lw $s3, -20($fp) bgtu $s2, $s3, label_Not_min0_19 - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # local_ttrib__e__init_internal_3 = local_ttrib__e__init_internal_4 - lw $s2, -20($fp) - sw $s2, -16($fp) + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) + # local_ttrib__e__init_internal_4 = local_ttrib__e__init_internal_5 + lw $s2, -24($fp) + sw $s2, -20($fp) label_Not_min0_19: - # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) # Load TDT pointer to type Bar la $s2, Bar__TDT @@ -2527,37 +2564,37 @@ __Razz__attrib__e__init: addu $s2, $s2, $s3 # Save distance lw $s3, 0($s2) - sw $s3, -20($fp) + sw $s3, -24($fp) + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) # Update min if 18 < 19 - lw $s2, -20($fp) - lw $s3, -16($fp) + lw $s2, -24($fp) + lw $s3, -20($fp) bgtu $s2, $s3, label_Not_min1_20 - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # local_ttrib__e__init_internal_3 = local_ttrib__e__init_internal_4 - lw $s2, -20($fp) - sw $s2, -16($fp) + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) + # local_ttrib__e__init_internal_4 = local_ttrib__e__init_internal_5 + lw $s2, -24($fp) + sw $s2, -20($fp) label_Not_min1_20: - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # local_ttrib__e__init_internal_4 = 13 + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) + # local_ttrib__e__init_internal_5 = 13 li $s2, 13 - sw $s2, -20($fp) + sw $s2, -24($fp) # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) - # local_ttrib__e__init_internal_2 = local_ttrib__e__init_internal_4 - local_ttrib__e__init_internal_3 - lw $s2, -20($fp) - lw $s3, -16($fp) + # local_ttrib__e__init_internal_2 = local_ttrib__e__init_internal_5 - local_ttrib__e__init_internal_4 + lw $s2, -24($fp) + lw $s3, -20($fp) sub $s2, $s2, $s3 sw $s2, -12($fp) # IF_ZERO local_ttrib__e__init_internal_2 GOTO label_ERROR_21 # IF_ZERO local_ttrib__e__init_internal_2 GOTO label_ERROR_21 lw $s2, -12($fp) beq $s2, 0, label_ERROR_21 - # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) # Load TDT pointer to type Razz la $s2, Razz__TDT @@ -2565,20 +2602,20 @@ __Razz__attrib__e__init: addu $s2, $s2, $s3 # Save distance lw $s3, 0($s2) - sw $s3, -20($fp) + sw $s3, -24($fp) + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) # Update min if 18 < 19 - lw $s2, -20($fp) - lw $s3, -16($fp) + lw $s2, -24($fp) + lw $s3, -20($fp) bgtu $s2, $s3, label_NEXT0_23 - # LOCAL local_ttrib__e__init_n_5 --> -24($fp) + # LOCAL local_ttrib__e__init_n_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) - # local_ttrib__e__init_n_5 = local_ttrib__e__init_internal_0 + # local_ttrib__e__init_n_6 = local_ttrib__e__init_internal_0 lw $s2, -4($fp) - sw $s2, -24($fp) - # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) - # local_ttrib__e__init_internal_6 = ALLOCATE Bar + sw $s2, -28($fp) + # LOCAL local_ttrib__e__init_internal_7 --> -32($fp) + # local_ttrib__e__init_internal_7 = ALLOCATE Bar # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -2686,12 +2723,17 @@ __Razz__attrib__e__init: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $s3, -28($fp) + sw $s3, -32($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__e__init_internal_7 --> -32($fp) + # local_ttrib__e__init_internal_3 = local_ttrib__e__init_internal_7 + lw $s3, -32($fp) + sw $s3, -16($fp) # GOTO label_END_22 j label_END_22 label_NEXT0_23: - # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) # Load TDT pointer to type Bar la $s3, Bar__TDT @@ -2699,18 +2741,23 @@ label_NEXT0_23: addu $s3, $s3, $s4 # Save distance lw $s4, 0($s3) - sw $s4, -20($fp) + sw $s4, -24($fp) + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) # Update min if 19 < 20 - lw $s3, -20($fp) - lw $s4, -16($fp) + lw $s3, -24($fp) + lw $s4, -20($fp) bgtu $s3, $s4, label_NEXT1_24 - # LOCAL local_ttrib__e__init_n_7 --> -32($fp) + # LOCAL local_ttrib__e__init_n_8 --> -36($fp) # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) - # local_ttrib__e__init_n_7 = local_ttrib__e__init_internal_0 + # local_ttrib__e__init_n_8 = local_ttrib__e__init_internal_0 lw $s3, -4($fp) - sw $s3, -32($fp) + sw $s3, -36($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__e__init_n_8 --> -36($fp) + # local_ttrib__e__init_internal_3 = local_ttrib__e__init_n_8 + lw $s3, -36($fp) + sw $s3, -16($fp) # GOTO label_END_22 j label_END_22 label_NEXT1_24: @@ -2731,14 +2778,15 @@ label_NEXT1_24: li $v0, 10 syscall label_END_22: -# RETURN +# RETURN local_ttrib__e__init_internal_3 +lw $v0, -16($fp) # Deallocate stack frame for function __Razz__attrib__e__init. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 40 +addu $sp, $sp, 44 jr $ra # Function END diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index ad09bd58..9b411c06 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -397,7 +397,7 @@ def _(self, node: str, scope: Scope): elif var_inf.location == "LOCAL": var = next( v - for v in self.localvars + for v in list(reversed(self.localvars)) if f"local_{self.current_function.name[9:]}_{var_inf.name}_" in v.name ) return var @@ -438,6 +438,7 @@ def _(self, node: coolAst.CaseNode, scope: Scope): # Almacenar el tipo del valor retornado type_internal_local_holder = self.define_internal_local() sub_vm_local_holder = self.define_internal_local() + result_vm_holder = self.define_internal_local() assert isinstance(expr_vm_holder, LocalNode) self.register_instruction( @@ -490,7 +491,9 @@ def _(self, node: coolAst.CaseNode, scope: Scope): # Asignar al identificador idk el valor de expr0 self.register_instruction(AssignNode(idk, expr_vm_holder)) # Generar el codigo de la expresion asociada a esta rama - self.visit(action_node.actions, s) + expr_val_vm_holder = self.visit(action_node.actions, s) + # Salvar el resultado + self.register_instruction(AssignNode(result_vm_holder, expr_val_vm_holder)) # Generar un salto de modo que no se chequee otra rama self.register_instruction(UnconditionalJump(end_label)) self.register_instruction(LabelNode(next_label)) @@ -502,6 +505,7 @@ def _(self, node: coolAst.CaseNode, scope: Scope): ) self.register_instruction(LabelNode(end_label)) + return result_vm_holder # *************** IMPLEMENTACION DE LAS EXPRESIONES ARITMETICAS # diff --git a/tests/codegen/atoi.mips b/tests/codegen/atoi.mips index 962b26ca..f5d2d852 100644 --- a/tests/codegen/atoi.mips +++ b/tests/codegen/atoi.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:25 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:13 2020 # School of Math and Computer Science, University of Havana # @@ -482,7 +482,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/book_list.mips b/tests/codegen/book_list.mips index 33a700ce..9a624563 100644 --- a/tests/codegen/book_list.mips +++ b/tests/codegen/book_list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:24 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:13 2020 # School of Math and Computer Science, University of Havana # @@ -13,17 +13,17 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END -Book: .asciiz "Book" -# Function END -Article: .asciiz "Article" +Main: .asciiz "Main" # Function END BookList: .asciiz "BookList" # Function END +Nil: .asciiz "Nil" +# Function END Cons: .asciiz "Cons" # Function END -Nil: .asciiz "Nil" +Book: .asciiz "Book" # Function END -Main: .asciiz "Main" +Article: .asciiz "Article" # Function END # @@ -84,45 +84,45 @@ Bool_end: # -# **** VTABLE for type Book **** -Book_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_initBook_at_Book, function_print_at_Book +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main # Function END # -# **** Type RECORD for type Book **** -Book_start: - Book_vtable_pointer: .word Book_vtable +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable # Function END -Book_end: +Main_end: # -# **** VTABLE for type Article **** -Article_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_initBook_at_Book, function_print_at_Article, function_initArticle_at_Article +# **** VTABLE for type BookList **** +BookList_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_BookList, function_cons_at_BookList, function_car_at_BookList, function_cdr_at_BookList, function_print_list_at_BookList # Function END # -# **** Type RECORD for type Article **** -Article_start: - Article_vtable_pointer: .word Article_vtable +# **** Type RECORD for type BookList **** +BookList_start: + BookList_vtable_pointer: .word BookList_vtable # Function END -Article_end: +BookList_end: # -# **** VTABLE for type BookList **** -BookList_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_BookList, function_cons_at_BookList, function_car_at_BookList, function_cdr_at_BookList, function_print_list_at_BookList +# **** VTABLE for type Nil **** +Nil_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_Nil, function_cons_at_BookList, function_car_at_BookList, function_cdr_at_BookList, function_print_list_at_Nil # Function END # -# **** Type RECORD for type BookList **** -BookList_start: - BookList_vtable_pointer: .word BookList_vtable +# **** Type RECORD for type Nil **** +Nil_start: + Nil_vtable_pointer: .word Nil_vtable # Function END -BookList_end: +Nil_end: # @@ -140,31 +140,31 @@ Cons_end: # -# **** VTABLE for type Nil **** -Nil_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_Nil, function_cons_at_BookList, function_car_at_BookList, function_cdr_at_BookList, function_print_list_at_Nil +# **** VTABLE for type Book **** +Book_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_initBook_at_Book, function_print_at_Book # Function END # -# **** Type RECORD for type Nil **** -Nil_start: - Nil_vtable_pointer: .word Nil_vtable +# **** Type RECORD for type Book **** +Book_start: + Book_vtable_pointer: .word Book_vtable # Function END -Nil_end: +Book_end: # -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main +# **** VTABLE for type Article **** +Article_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_initBook_at_Book, function_print_at_Article, function_initArticle_at_Article # Function END # -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable +# **** Type RECORD for type Article **** +Article_start: + Article_vtable_pointer: .word Article_vtable # Function END -Main_end: +Article_end: # @@ -180,68 +180,68 @@ data_2: .asciiz "\n" # -IO__TDT: .word 0, -1, -1, -1, 1, 2, 1, 2, 2, -1 -Object__TDT: .word 1, 0, 1, 1, 2, 3, 2, 3, 3, 1 +IO__TDT: .word 0, -1, -1, -1, -1, 1, 2, 2, 1, 2 +Object__TDT: .word 1, 0, 1, 1, 1, 2, 3, 3, 2, 3 String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1 Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 -Book__TDT: .word -1, -1, -1, -1, 0, 1, -1, -1, -1, -1 -Article__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1, -1 -BookList__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 1, -1 +Main__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1, -1 +BookList__TDT: .word -1, -1, -1, -1, -1, 0, 1, 1, -1, -1 +Nil__TDT: .word -1, -1, -1, -1, -1, -1, 0, -1, -1, -1 Cons__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 -Nil__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 +Book__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, 1 +Article__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 # -data_4: .asciiz "title: " +data_4: .asciiz "Compilers, Principles, Techniques, and Tools" # -data_5: .asciiz "\n" +data_5: .asciiz "Aho, Sethi, and Ullman" # -data_6: .asciiz "author: " +data_6: .asciiz "The Top 100 CD_ROMs" # -data_7: .asciiz "\n" +data_7: .asciiz "Ulanoff" # -data_8: .asciiz "periodical: " +data_8: .asciiz "PC Magazine" # -data_9: .asciiz "\n" +data_9: .asciiz "- dynamic type was Book -\n" # -data_10: .asciiz "- dynamic type was Book -\n" +data_10: .asciiz "- dynamic type was Article -\n" # -data_11: .asciiz "- dynamic type was Article -\n" +data_11: .asciiz "title: " # -data_12: .asciiz "Compilers, Principles, Techniques, and Tools" +data_12: .asciiz "\n" # -data_13: .asciiz "Aho, Sethi, and Ullman" +data_13: .asciiz "author: " # -data_14: .asciiz "The Top 100 CD_ROMs" +data_14: .asciiz "\n" # -data_15: .asciiz "Ulanoff" +data_15: .asciiz "periodical: " # -data_16: .asciiz "PC Magazine" +data_16: .asciiz "\n" # @@ -486,7 +486,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -684,7 +684,7 @@ entry: la $t2, Main_start sw $t2, 4($v0) # Load type offset - li $t2, 36 + li $t2, 16 sw $t2, 8($v0) move $t1, $v0 # Push register s1 into stack @@ -730,35 +730,17 @@ entry: # Function END -# __Book__attrib__title__init implementation. +# __Main__attrib__books__init implementation. # @Params: -__Book__attrib__title__init: - # Allocate stack frame for function __Book__attrib__title__init. +__Main__attrib__books__init: + # Allocate stack frame for function __Main__attrib__books__init. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_ttrib__title__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_0 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__title__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Book__attrib__title__init. + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__books__init. # Restore $ra lw $ra, 4($sp) # Restore $fp @@ -769,666 +751,568 @@ __Book__attrib__title__init: # Function END -# __Book__attrib__author__init implementation. +# function_main_at_Main implementation. # @Params: -__Book__attrib__author__init: - # Allocate stack frame for function __Book__attrib__author__init. - subu $sp, $sp, 32 +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 92 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__author__init_internal_0 --> -4($fp) + addu $fp, $sp, 92 + # LOCAL local_main_at_Main_a_book_0 --> -4($fp) + # local_main_at_Main_a_book_0 = ALLOCATE Book # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_0 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__author__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Book__attrib__author__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_initBook_at_Book implementation. -# @Params: -# 0($fp) = param_initBook_at_Book_title_p_0 -# 4($fp) = param_initBook_at_Book_author_p_1 -function_initBook_at_Book: - # Allocate stack frame for function function_initBook_at_Book. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_initBook_at_Book_title_p_0 --> 4($fp) - lw $t1, 4($fp) - sw $t1, 12($s1) - # - # PARAM param_initBook_at_Book_author_p_1 --> 0($fp) - lw $t1, 0($fp) - sw $t1, 16($s1) - # LOCAL local_initBook_at_Book_internal_0 --> -4($fp) - # local_initBook_at_Book_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_initBook_at_Book_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_initBook_at_Book. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_print_at_Book implementation. -# @Params: -function_print_at_Book: - # Allocate stack frame for function function_print_at_Book. - subu $sp, $sp, 92 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 92 - # LOCAL local_print_at_Book_internal_6 --> -28($fp) - # local_print_at_Book_internal_6 = SELF - sw $s1, -28($fp) - # LOCAL local_print_at_Book_internal_4 --> -20($fp) - # LOCAL local_print_at_Book_internal_6 --> -28($fp) - # local_print_at_Book_internal_4 = local_print_at_Book_internal_6 - lw $t1, -28($fp) - sw $t1, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Book_internal_7 --> -32($fp) + li $t3, 8 + sw $t3, 8($v0) + la $t3, Book + sw $t3, 12($v0) + li $t3, 4 + sw $t3, 16($v0) + move $t3, $v0 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + sw $t3, 0($v0) + la $t3, Book_start + sw $t3, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_4 - sw $t1, 12($v0) - li $t1, 12 - sw $t1, 16($v0) - sw $v0, -32($fp) - # ARG local_print_at_Book_internal_7 - # LOCAL local_print_at_Book_internal_7 --> -32($fp) - lw $t1, -32($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_4 --> -20($fp) - # LOCAL local_print_at_Book_internal_5 --> -24($fp) - # local_print_at_Book_internal_5 = VCALL local_print_at_Book_internal_4 out_string - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_2 --> -12($fp) - # LOCAL local_print_at_Book_internal_5 --> -24($fp) - # local_print_at_Book_internal_2 = local_print_at_Book_internal_5 - lw $t1, -24($fp) - sw $t1, -12($fp) + li $t3, 32 + sw $t3, 8($v0) + move $t2, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_print_at_Book_internal_8 = GETATTRIBUTE title Book - # LOCAL local_print_at_Book_internal_8 --> -36($fp) - lw $t1, 12($s1) - sw $t1, -36($fp) - # ARG local_print_at_Book_internal_8 - # LOCAL local_print_at_Book_internal_8 --> -36($fp) - lw $t1, -36($fp) - # Push arg into stack + move $s1, $v0 + # Push register t2 into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_2 --> -12($fp) - # LOCAL local_print_at_Book_internal_3 --> -16($fp) - # local_print_at_Book_internal_3 = VCALL local_print_at_Book_internal_2 out_string - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) + sw $t2, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t2) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_0 --> -4($fp) - # LOCAL local_print_at_Book_internal_3 --> -16($fp) - # local_print_at_Book_internal_0 = local_print_at_Book_internal_3 - lw $t1, -16($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Book_internal_9 --> -40($fp) + sw $t2, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE Book # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_5 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -40($fp) - # ARG local_print_at_Book_internal_9 - # LOCAL local_print_at_Book_internal_9 --> -40($fp) - lw $t1, -40($fp) - # Push arg into stack + li $t4, 8 + sw $t4, 8($v0) + la $t4, Book + sw $t4, 12($v0) + li $t4, 4 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Book_start + sw $t4, 4($v0) + # Load type offset + li $t4, 32 + sw $t4, 8($v0) + move $t3, $v0 + # Push register s1 into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_0 --> -4($fp) - # LOCAL local_print_at_Book_internal_1 --> -8($fp) - # local_print_at_Book_internal_1 = VCALL local_print_at_Book_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) + sw $s1, 0($sp) + move $s1, $v0 + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t3) + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t3) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_16 --> -68($fp) - # local_print_at_Book_internal_16 = SELF - sw $s1, -68($fp) - # LOCAL local_print_at_Book_internal_14 --> -60($fp) - # LOCAL local_print_at_Book_internal_16 --> -68($fp) - # local_print_at_Book_internal_14 = local_print_at_Book_internal_16 - lw $t1, -68($fp) - sw $t1, -60($fp) + sw $t3, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t3, -16($fp) + sw $t3, -8($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_at_Book_internal_17 --> -72($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_6 - sw $t1, 12($v0) - li $t1, 12 - sw $t1, 16($v0) - sw $v0, -72($fp) - # ARG local_print_at_Book_internal_17 - # LOCAL local_print_at_Book_internal_17 --> -72($fp) - lw $t1, -72($fp) + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_4 + sw $t3, 12($v0) + li $t3, 44 + sw $t3, 16($v0) + sw $v0, -20($fp) + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t3, -20($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_14 --> -60($fp) - # LOCAL local_print_at_Book_internal_15 --> -64($fp) - # local_print_at_Book_internal_15 = VCALL local_print_at_Book_internal_14 out_string + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, data_5 + sw $t3, 12($v0) + li $t3, 22 + sw $t3, 16($v0) + sw $v0, -24($fp) + # ARG local_main_at_Main_internal_5 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t3, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 initBook # Save new self pointer in $s1 - lw $s1, -60($fp) + lw $s1, -8($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 12($t2) + lw $t5, 28($t4) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -64($fp) + jalr $t5 + sw $v0, -12($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_12 --> -52($fp) - # LOCAL local_print_at_Book_internal_15 --> -64($fp) - # local_print_at_Book_internal_12 = local_print_at_Book_internal_15 - lw $t1, -64($fp) - sw $t1, -52($fp) + # LOCAL local_main_at_Main_a_book_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_a_book_0 = local_main_at_Main_internal_2 + lw $t3, -12($fp) + sw $t3, -4($fp) + # LOCAL local_main_at_Main_an_article_6 --> -28($fp) + # local_main_at_Main_an_article_6 = ALLOCATE Article + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, Article + sw $t5, 12($v0) + li $t5, 7 + sw $t5, 16($v0) + move $t5, $v0 + # Allocating 24 bytes of memory + li $a0, 24 + li $v0, 9 + syscall + sw $t5, 0($v0) + la $t5, Article_start + sw $t5, 4($v0) + # Load type offset + li $t5, 36 + sw $t5, 8($v0) + move $t4, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_print_at_Book_internal_18 = GETATTRIBUTE author Book - # LOCAL local_print_at_Book_internal_18 --> -76($fp) - lw $t1, 16($s1) - sw $t1, -76($fp) - # ARG local_print_at_Book_internal_18 - # LOCAL local_print_at_Book_internal_18 --> -76($fp) - lw $t1, -76($fp) - # Push arg into stack + move $s1, $v0 + # Push register t4 into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_12 --> -52($fp) - # LOCAL local_print_at_Book_internal_13 --> -56($fp) - # local_print_at_Book_internal_13 = VCALL local_print_at_Book_internal_12 out_string - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -56($fp) + sw $t4, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t4) + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t4) + # Push register t4 into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + jal __Article__attrib__per_title__init + # Pop 4 bytes from stack into register t4 + lw $t4, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t4) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_10 --> -44($fp) - # LOCAL local_print_at_Book_internal_13 --> -56($fp) - # local_print_at_Book_internal_10 = local_print_at_Book_internal_13 - lw $t1, -56($fp) - sw $t1, -44($fp) + sw $t4, -28($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = ALLOCATE Article + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t6, String + sw $t6, 0($v0) + la $t6, String_start + sw $t6, 4($v0) + # Load type offset + li $t6, 8 + sw $t6, 8($v0) + la $t6, Article + sw $t6, 12($v0) + li $t6, 7 + sw $t6, 16($v0) + move $t6, $v0 + # Allocating 24 bytes of memory + li $a0, 24 + li $v0, 9 + syscall + sw $t6, 0($v0) + la $t6, Article_start + sw $t6, 4($v0) + # Load type offset + li $t6, 36 + sw $t6, 8($v0) + move $t5, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_at_Book_internal_19 --> -80($fp) + move $s1, $v0 + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t5) + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t5) + # Push register t5 into stack + subu $sp, $sp, 4 + sw $t5, 0($sp) + jal __Article__attrib__per_title__init + # Pop 4 bytes from stack into register t5 + lw $t5, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t5) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t5, -40($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 + lw $t5, -40($fp) + sw $t5, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_7 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -80($fp) - # ARG local_print_at_Book_internal_19 - # LOCAL local_print_at_Book_internal_19 --> -80($fp) - lw $t1, -80($fp) + li $t5, 8 + sw $t5, 8($v0) + la $t5, data_6 + sw $t5, 12($v0) + li $t5, 19 + sw $t5, 16($v0) + sw $v0, -44($fp) + # ARG local_main_at_Main_internal_10 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + lw $t5, -44($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Book_internal_10 --> -44($fp) - # LOCAL local_print_at_Book_internal_11 --> -48($fp) - # local_print_at_Book_internal_11 = VCALL local_print_at_Book_internal_10 out_string - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_20 --> -84($fp) - # local_print_at_Book_internal_20 = SELF - sw $s1, -84($fp) - # RETURN local_print_at_Book_internal_20 - lw $v0, -84($fp) - # Deallocate stack frame for function function_print_at_Book. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 92 - jr $ra - # Function END - - -# __Article__attrib__per_title__init implementation. -# @Params: -__Article__attrib__per_title__init: - # Allocate stack frame for function __Article__attrib__per_title__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local___attrib__per_title__init_internal_0 --> -4($fp) + sw $t5, 0($sp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_0 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -4($fp) - # RETURN local___attrib__per_title__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Article__attrib__per_title__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_initArticle_at_Article implementation. -# @Params: -# 0($fp) = param_initArticle_at_Article_title_p_0 -# 4($fp) = param_initArticle_at_Article_author_p_1 -# 8($fp) = param_initArticle_at_Article_per_title_p_2 -function_initArticle_at_Article: - # Allocate stack frame for function function_initArticle_at_Article. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) - # local_initArticle_at_Article_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) - # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) - # local_initArticle_at_Article_internal_0 = local_initArticle_at_Article_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_initArticle_at_Article_title_p_0 - # PARAM param_initArticle_at_Article_title_p_0 --> 8($fp) - lw $t1, 8($fp) + li $t5, 8 + sw $t5, 8($v0) + la $t5, data_7 + sw $t5, 12($v0) + li $t5, 7 + sw $t5, 16($v0) + sw $v0, -48($fp) + # ARG local_main_at_Main_internal_11 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + lw $t5, -48($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # ARG param_initArticle_at_Article_author_p_1 - # PARAM param_initArticle_at_Article_author_p_1 --> 4($fp) - lw $t1, 4($fp) + sw $t5, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, data_8 + sw $t5, 12($v0) + li $t5, 11 + sw $t5, 16($v0) + sw $v0, -52($fp) + # ARG local_main_at_Main_internal_12 + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + lw $t5, -52($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) - # LOCAL local_initArticle_at_Article_internal_1 --> -8($fp) - # local_initArticle_at_Article_internal_1 = VCALL local_initArticle_at_Article_internal_0 initBook + sw $t5, 0($sp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 initArticle # Save new self pointer in $s1 - lw $s1, -4($fp) + lw $s1, -32($fp) # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 28($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # PARAM param_initArticle_at_Article_per_title_p_2 --> 0($fp) - lw $t1, 0($fp) - sw $t1, 20($s1) - # LOCAL local_initArticle_at_Article_internal_3 --> -16($fp) - # local_initArticle_at_Article_internal_3 = SELF - sw $s1, -16($fp) - # RETURN local_initArticle_at_Article_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_initArticle_at_Article. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 12 - jr $ra - # Function END - - -# function_print_at_Article implementation. -# @Params: -function_print_at_Article: - # Allocate stack frame for function function_print_at_Article. - subu $sp, $sp, 60 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 60 - # LOCAL local_print_at_Article_internal_1 --> -8($fp) - # local_print_at_Article_internal_1 = SELF - sw $s1, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Article_internal_0 = CALL print - # LOCAL local_print_at_Article_internal_0 --> -4($fp) - # LOCAL local_print_at_Article_internal_1 --> -8($fp) - # Save new self pointer in $s1 - lw $s1, -8($fp) + lw $t5, 4($s1) # Get pointer to type's VTABLE - la $t1, Book_vtable + lw $t6, 0($t5) # Get pointer to function address - lw $t2, 32($t1) + lw $t7, 36($t6) # Call function. Result is on $v0 - jalr $t2 - sw $v0, -4($fp) + jalr $t7 + sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Article_internal_8 --> -36($fp) - # local_print_at_Article_internal_8 = SELF - sw $s1, -36($fp) - # LOCAL local_print_at_Article_internal_6 --> -28($fp) - # LOCAL local_print_at_Article_internal_8 --> -36($fp) - # local_print_at_Article_internal_6 = local_print_at_Article_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Article_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_an_article_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_an_article_6 = local_main_at_Main_internal_8 + lw $t5, -36($fp) + sw $t5, -28($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = ALLOCATE Nil # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + # Allocating string for type name + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_8 - sw $t1, 12($v0) - li $t1, 13 - sw $t1, 16($v0) - sw $v0, -40($fp) - # ARG local_print_at_Article_internal_9 - # LOCAL local_print_at_Article_internal_9 --> -40($fp) - lw $t1, -40($fp) + li $t7, 8 + sw $t7, 8($v0) + la $t7, Nil + sw $t7, 12($v0) + li $t7, 3 + sw $t7, 16($v0) + move $t7, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t7, 0($v0) + la $t7, Nil_start + sw $t7, 4($v0) + # Load type offset + li $t7, 24 + sw $t7, 8($v0) + move $t6, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t6, -72($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 + lw $t6, -72($fp) + sw $t6, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_a_book_0 + # LOCAL local_main_at_Main_a_book_0 --> -4($fp) + lw $t6, -4($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Article_internal_6 --> -28($fp) - # LOCAL local_print_at_Article_internal_7 --> -32($fp) - # local_print_at_Article_internal_7 = VCALL local_print_at_Article_internal_6 out_string + sw $t6, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 cons # Save new self pointer in $s1 - lw $s1, -28($fp) + lw $s1, -64($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t6, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t7, 0($t6) # Get pointer to function address - lw $t3, 12($t2) + lw $t8, 32($t7) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) + jalr $t8 + sw $v0, -68($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Article_internal_4 --> -20($fp) - # LOCAL local_print_at_Article_internal_7 --> -32($fp) - # local_print_at_Article_internal_4 = local_print_at_Article_internal_7 - lw $t1, -32($fp) - sw $t1, -20($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_13 = local_main_at_Main_internal_16 + lw $t6, -68($fp) + sw $t6, -56($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_print_at_Article_internal_10 = GETATTRIBUTE per_title Article - # LOCAL local_print_at_Article_internal_10 --> -44($fp) - lw $t1, 20($s1) - sw $t1, -44($fp) - # ARG local_print_at_Article_internal_10 - # LOCAL local_print_at_Article_internal_10 --> -44($fp) - lw $t1, -44($fp) + # ARG local_main_at_Main_an_article_6 + # LOCAL local_main_at_Main_an_article_6 --> -28($fp) + lw $t6, -28($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Article_internal_4 --> -20($fp) - # LOCAL local_print_at_Article_internal_5 --> -24($fp) - # local_print_at_Article_internal_5 = VCALL local_print_at_Article_internal_4 out_string + sw $t6, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 cons # Save new self pointer in $s1 - lw $s1, -20($fp) + lw $s1, -56($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t6, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t7, 0($t6) # Get pointer to function address - lw $t3, 12($t2) + lw $t8, 32($t7) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -24($fp) + jalr $t8 + sw $v0, -60($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Article_internal_2 --> -12($fp) - # LOCAL local_print_at_Article_internal_5 --> -24($fp) - # local_print_at_Article_internal_2 = local_print_at_Article_internal_5 - lw $t1, -24($fp) - sw $t1, -12($fp) + # + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + lw $t6, -60($fp) + sw $t6, 12($s1) + # local_main_at_Main_internal_20 = GETATTRIBUTE books Main + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + lw $t6, 12($s1) + sw $t6, -84($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 + lw $t6, -84($fp) + sw $t6, -76($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_at_Article_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_9 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -48($fp) - # ARG local_print_at_Article_internal_11 - # LOCAL local_print_at_Article_internal_11 --> -48($fp) - lw $t1, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Article_internal_2 --> -12($fp) - # LOCAL local_print_at_Article_internal_3 --> -16($fp) - # local_print_at_Article_internal_3 = VCALL local_print_at_Article_internal_2 out_string + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 print_list # Save new self pointer in $s1 - lw $s1, -12($fp) + lw $s1, -76($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t6, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t7, 0($t6) # Get pointer to function address - lw $t3, 12($t2) + lw $t8, 44($t7) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) + jalr $t8 + sw $v0, -80($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Article_internal_12 --> -52($fp) - # local_print_at_Article_internal_12 = SELF - sw $s1, -52($fp) - # RETURN local_print_at_Article_internal_12 - lw $v0, -52($fp) - # Deallocate stack frame for function function_print_at_Article. + # RETURN local_main_at_Main_internal_19 + lw $v0, -80($fp) + # Deallocate stack frame for function function_main_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 60 + addu $sp, $sp, 92 jr $ra # Function END @@ -1447,8 +1331,8 @@ function_isNil_at_BookList: # LOCAL local_isNil_at_BookList_internal_0 --> -4($fp) # LOCAL local_isNil_at_BookList_internal_2 --> -12($fp) # local_isNil_at_BookList_internal_0 = local_isNil_at_BookList_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + lw $t6, -12($fp) + sw $t6, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1458,21 +1342,21 @@ function_isNil_at_BookList: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t6, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t7, 0($t6) # Get pointer to function address - lw $t3, 0($t2) + lw $t8, 0($t7) # Call function. Result is on $v0 - jalr $t3 + jalr $t8 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # LOCAL local_isNil_at_BookList_internal_3 --> -16($fp) # local_isNil_at_BookList_internal_3 = 1 - li $t1, 1 - sw $t1, -16($fp) + li $t6, 1 + sw $t6, -16($fp) # RETURN local_isNil_at_BookList_internal_3 lw $v0, -16($fp) # Deallocate stack frame for function function_isNil_at_BookList. @@ -1502,53 +1386,53 @@ function_cons_at_BookList: li $v0, 9 syscall # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) + la $t8, String + sw $t8, 0($v0) + la $t8, String_start + sw $t8, 4($v0) # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Cons - sw $t3, 12($v0) - li $t3, 4 - sw $t3, 16($v0) - move $t3, $v0 + li $t8, 8 + sw $t8, 8($v0) + la $t8, Cons + sw $t8, 12($v0) + li $t8, 4 + sw $t8, 16($v0) + move $t8, $v0 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - sw $t3, 0($v0) - la $t3, Cons_start - sw $t3, 4($v0) + sw $t8, 0($v0) + la $t8, Cons_start + sw $t8, 4($v0) # Load type offset - li $t3, 28 - sw $t3, 8($v0) - move $t2, $v0 + li $t8, 28 + sw $t8, 8($v0) + move $t7, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t2 into stack + # Push register t7 into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t7, 0($sp) jal __Cons__attrib__xcar__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t2) - # Push register t2 into stack + sw $v0, 12($t7) + # Push register t7 into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t7, 0($sp) jal __Cons__attrib__xcdr__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) + # Pop 4 bytes from stack into register t7 + lw $t7, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t2) + sw $v0, 16($t7) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t2, -4($fp) + sw $t7, -4($fp) # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) # local_cons_at_BookList_internal_1 = ALLOCATE Cons # Allocating 20 bytes of memory @@ -1556,94 +1440,94 @@ function_cons_at_BookList: li $v0, 9 syscall # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Cons - sw $t4, 12($v0) - li $t4, 4 - sw $t4, 16($v0) - move $t4, $v0 + li $t9, 8 + sw $t9, 8($v0) + la $t9, Cons + sw $t9, 12($v0) + li $t9, 4 + sw $t9, 16($v0) + move $t9, $v0 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - sw $t4, 0($v0) - la $t4, Cons_start - sw $t4, 4($v0) + sw $t9, 0($v0) + la $t9, Cons_start + sw $t9, 4($v0) # Load type offset - li $t4, 28 - sw $t4, 8($v0) - move $t3, $v0 + li $t9, 28 + sw $t9, 8($v0) + move $t8, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t3 into stack + # Push register t8 into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t8, 0($sp) jal __Cons__attrib__xcar__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t3) - # Push register t3 into stack + sw $v0, 12($t8) + # Push register t8 into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t8, 0($sp) jal __Cons__attrib__xcdr__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) + # Pop 4 bytes from stack into register t8 + lw $t8, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t3) + sw $v0, 16($t8) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t3, -8($fp) + sw $t8, -8($fp) # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) # local_cons_at_BookList_new_cell_0 = local_cons_at_BookList_internal_1 - lw $t3, -8($fp) - sw $t3, -4($fp) + lw $t8, -8($fp) + sw $t8, -4($fp) # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) # local_cons_at_BookList_internal_2 = local_cons_at_BookList_new_cell_0 - lw $t3, -4($fp) - sw $t3, -12($fp) + lw $t8, -4($fp) + sw $t8, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG param_cons_at_BookList_hd_0 # PARAM param_cons_at_BookList_hd_0 --> 0($fp) - lw $t3, 0($fp) + lw $t8, 0($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t8, 0($sp) # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) # local_cons_at_BookList_internal_4 = SELF sw $s1, -20($fp) # ARG local_cons_at_BookList_internal_4 # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) - lw $t3, -20($fp) + lw $t8, -20($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t8, 0($sp) # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) # LOCAL local_cons_at_BookList_internal_3 --> -16($fp) # local_cons_at_BookList_internal_3 = VCALL local_cons_at_BookList_internal_2 init # Save new self pointer in $s1 lw $s1, -12($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t8, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t9, 0($t8) # Get pointer to function address - lw $t5, 48($t4) + lw $s2, 48($t9) # Call function. Result is on $v0 - jalr $t5 + jalr $s2 sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1676,9 +1560,9 @@ function_car_at_BookList: sw $s1, -12($fp) # LOCAL local_car_at_BookList_internal_0 --> -4($fp) # LOCAL local_car_at_BookList_internal_2 --> -12($fp) - # local_car_at_BookList_internal_0 = local_car_at_BookList_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) + # local_car_at_BookList_internal_0 = local_car_at_BookList_internal_2 + lw $t8, -12($fp) + sw $t8, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1688,13 +1572,13 @@ function_car_at_BookList: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t8, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t9, 0($t8) # Get pointer to function address - lw $t5, 0($t4) + lw $s2, 0($t9) # Call function. Result is on $v0 - jalr $t5 + jalr $s2 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1706,53 +1590,53 @@ function_car_at_BookList: li $v0, 9 syscall # Allocating string for type name - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) + la $s2, String + sw $s2, 0($v0) + la $s2, String_start + sw $s2, 4($v0) # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, Book - sw $t5, 12($v0) - li $t5, 4 - sw $t5, 16($v0) - move $t5, $v0 + li $s2, 8 + sw $s2, 8($v0) + la $s2, Book + sw $s2, 12($v0) + li $s2, 4 + sw $s2, 16($v0) + move $s2, $v0 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - sw $t5, 0($v0) - la $t5, Book_start - sw $t5, 4($v0) + sw $s2, 0($v0) + la $s2, Book_start + sw $s2, 4($v0) # Load type offset - li $t5, 16 - sw $t5, 8($v0) - move $t4, $v0 + li $s2, 32 + sw $s2, 8($v0) + move $t9, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t4 into stack + # Push register t9 into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t9, 0($sp) jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t4) - # Push register t4 into stack + sw $v0, 12($t9) + # Push register t9 into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t9, 0($sp) jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) + # Pop 4 bytes from stack into register t9 + lw $t9, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t4) + sw $v0, 16($t9) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t4, -16($fp) + sw $t9, -16($fp) # RETURN local_car_at_BookList_internal_3 lw $v0, -16($fp) # Deallocate stack frame for function function_car_at_BookList. @@ -1780,8 +1664,8 @@ function_cdr_at_BookList: # LOCAL local_cdr_at_BookList_internal_0 --> -4($fp) # LOCAL local_cdr_at_BookList_internal_2 --> -12($fp) # local_cdr_at_BookList_internal_0 = local_cdr_at_BookList_internal_2 - lw $t4, -12($fp) - sw $t4, -4($fp) + lw $t9, -12($fp) + sw $t9, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1791,13 +1675,13 @@ function_cdr_at_BookList: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t4, 4($s1) + lw $t9, 4($s1) # Get pointer to type's VTABLE - lw $t5, 0($t4) + lw $s2, 0($t9) # Get pointer to function address - lw $t6, 0($t5) + lw $s3, 0($s2) # Call function. Result is on $v0 - jalr $t6 + jalr $s3 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1809,29 +1693,29 @@ function_cdr_at_BookList: li $v0, 9 syscall # Allocating string for type name - la $t6, String - sw $t6, 0($v0) - la $t6, String_start - sw $t6, 4($v0) + la $s3, String + sw $s3, 0($v0) + la $s3, String_start + sw $s3, 4($v0) # Load type offset - li $t6, 8 - sw $t6, 8($v0) - la $t6, BookList - sw $t6, 12($v0) - li $t6, 8 - sw $t6, 16($v0) - move $t6, $v0 + li $s3, 8 + sw $s3, 8($v0) + la $s3, BookList + sw $s3, 12($v0) + li $s3, 8 + sw $s3, 16($v0) + move $s3, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - sw $t6, 0($v0) - la $t6, BookList_start - sw $t6, 4($v0) + sw $s3, 0($v0) + la $s3, BookList_start + sw $s3, 4($v0) # Load type offset - li $t6, 24 - sw $t6, 8($v0) - move $t5, $v0 + li $s3, 20 + sw $s3, 8($v0) + move $s2, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1839,7 +1723,7 @@ function_cdr_at_BookList: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t5, -16($fp) + sw $s2, -16($fp) # RETURN local_cdr_at_BookList_internal_3 lw $v0, -16($fp) # Deallocate stack frame for function function_cdr_at_BookList. @@ -1867,8 +1751,8 @@ function_print_list_at_BookList: # LOCAL local_print_list_at_BookList_internal_0 --> -4($fp) # LOCAL local_print_list_at_BookList_internal_2 --> -12($fp) # local_print_list_at_BookList_internal_0 = local_print_list_at_BookList_internal_2 - lw $t5, -12($fp) - sw $t5, -4($fp) + lw $s2, -12($fp) + sw $s2, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1878,13 +1762,13 @@ function_print_list_at_BookList: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t5, 4($s1) + lw $s2, 4($s1) # Get pointer to type's VTABLE - lw $t6, 0($t5) + lw $s3, 0($s2) # Get pointer to function address - lw $t7, 0($t6) + lw $s4, 0($s3) # Call function. Result is on $v0 - jalr $t7 + jalr $s4 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1902,6 +1786,56 @@ function_print_list_at_BookList: # Function END +# function_isNil_at_Nil implementation. +# @Params: +function_isNil_at_Nil: + # Allocate stack frame for function function_isNil_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_Nil_internal_0 --> -4($fp) + # local_isNil_at_Nil_internal_0 = 1 + li $s2, 1 + sw $s2, -4($fp) + # RETURN local_isNil_at_Nil_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_list_at_Nil implementation. +# @Params: +function_print_list_at_Nil: + # Allocate stack frame for function function_print_list_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_print_list_at_Nil_internal_0 --> -4($fp) + # local_print_list_at_Nil_internal_0 = 1 + li $s2, 1 + sw $s2, -4($fp) + # RETURN local_print_list_at_Nil_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_print_list_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + # __Cons__attrib__xcar__init implementation. # @Params: __Cons__attrib__xcar__init: @@ -1954,8 +1888,8 @@ function_isNil_at_Cons: addu $fp, $sp, 32 # LOCAL local_isNil_at_Cons_internal_0 --> -4($fp) # local_isNil_at_Cons_internal_0 = 0 - li $t5, 0 - sw $t5, -4($fp) + li $s2, 0 + sw $s2, -4($fp) # RETURN local_isNil_at_Cons_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_isNil_at_Cons. @@ -1981,12 +1915,12 @@ function_init_at_Cons: addu $fp, $sp, 32 # # PARAM param_init_at_Cons_hd_0 --> 4($fp) - lw $t5, 4($fp) - sw $t5, 12($s1) + lw $s2, 4($fp) + sw $s2, 12($s1) # # PARAM param_init_at_Cons_tl_1 --> 0($fp) - lw $t5, 0($fp) - sw $t5, 16($s1) + lw $s2, 0($fp) + sw $s2, 16($s1) # LOCAL local_init_at_Cons_internal_0 --> -4($fp) # local_init_at_Cons_internal_0 = SELF sw $s1, -4($fp) @@ -2015,8 +1949,8 @@ function_car_at_Cons: addu $fp, $sp, 32 # local_car_at_Cons_internal_0 = GETATTRIBUTE xcar Cons # LOCAL local_car_at_Cons_internal_0 --> -4($fp) - lw $t5, 12($s1) - sw $t5, -4($fp) + lw $s2, 12($s1) + sw $s2, -4($fp) # RETURN local_car_at_Cons_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_car_at_Cons. @@ -2040,8 +1974,8 @@ function_cdr_at_Cons: addu $fp, $sp, 32 # local_cdr_at_Cons_internal_0 = GETATTRIBUTE xcdr Cons # LOCAL local_cdr_at_Cons_internal_0 --> -4($fp) - lw $t5, 16($s1) - sw $t5, -4($fp) + lw $s2, 16($s1) + sw $s2, -4($fp) # RETURN local_cdr_at_Cons_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_cdr_at_Cons. @@ -2059,19 +1993,19 @@ function_cdr_at_Cons: # @Params: function_print_list_at_Cons: # Allocate stack frame for function function_print_list_at_Cons. - subu $sp, $sp, 88 + subu $sp, $sp, 92 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 88 + addu $fp, $sp, 92 # local_print_list_at_Cons_internal_2 = GETATTRIBUTE xcar Cons # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) - lw $t5, 12($s1) - sw $t5, -12($fp) + lw $s2, 12($s1) + sw $s2, -12($fp) # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) # local_print_list_at_Cons_internal_0 = local_print_list_at_Cons_internal_2 - lw $t5, -12($fp) - sw $t5, -4($fp) + lw $s2, -12($fp) + sw $s2, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2081,13 +2015,13 @@ function_print_list_at_Cons: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t5, 4($s1) + lw $s2, 4($s1) # Get pointer to type's VTABLE - lw $t6, 0($t5) + lw $s3, 0($s2) # Get pointer to function address - lw $t7, 32($t6) + lw $s4, 32($s3) # Call function. Result is on $v0 - jalr $t7 + jalr $s4 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2095,230 +2029,240 @@ function_print_list_at_Cons: # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # local_print_list_at_Cons_internal_3 = TYPEOF local_print_list_at_Cons_internal_1 - lw $t5, -8($fp) + lw $s2, -8($fp) # Load pointer to type offset - lw $t6, 8($t5) - sw $t6, -16($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # local_print_list_at_Cons_internal_5 = 14 - li $t5, 14 - sw $t5, -24($fp) - # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Book + lw $s3, 8($s2) + sw $s3, -16($fp) # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_6 = 14 + li $s2, 14 + sw $s2, -28($fp) + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Book - la $t5, Book__TDT - lw $t6, -16($fp) - addu $t5, $t5, $t6 + la $s2, Book__TDT + lw $s3, -16($fp) + addu $s2, $s2, $s3 # Save distance - lw $t6, 0($t5) - sw $t6, -28($fp) + lw $s3, 0($s2) + sw $s3, -32($fp) + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # Update min if 13 < 14 - lw $t5, -28($fp) - lw $t6, -24($fp) - bgtu $t5, $t6, label_Not_min0_1 - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # Update min if 18 < 19 + lw $s2, -32($fp) + lw $s3, -28($fp) + bgtu $s2, $s3, label_Not_min0_1 # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_6 - lw $t5, -28($fp) - sw $t5, -24($fp) + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # local_print_list_at_Cons_internal_6 = local_print_list_at_Cons_internal_7 + lw $s2, -32($fp) + sw $s2, -28($fp) label_Not_min0_1: - # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Article - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Article - la $t5, Article__TDT - lw $t6, -16($fp) - addu $t5, $t5, $t6 + la $s2, Article__TDT + lw $s3, -16($fp) + addu $s2, $s2, $s3 # Save distance - lw $t6, 0($t5) - sw $t6, -28($fp) + lw $s3, 0($s2) + sw $s3, -32($fp) + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # Update min if 13 < 14 - lw $t5, -28($fp) - lw $t6, -24($fp) - bgtu $t5, $t6, label_Not_min1_2 - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # Update min if 18 < 19 + lw $s2, -32($fp) + lw $s3, -28($fp) + bgtu $s2, $s3, label_Not_min1_2 # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_6 - lw $t5, -28($fp) - sw $t5, -24($fp) + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # local_print_list_at_Cons_internal_6 = local_print_list_at_Cons_internal_7 + lw $s2, -32($fp) + sw $s2, -28($fp) label_Not_min1_2: - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_6 = 14 - li $t5, 14 - sw $t5, -28($fp) + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # local_print_list_at_Cons_internal_7 = 14 + li $s2, 14 + sw $s2, -32($fp) # LOCAL local_print_list_at_Cons_internal_4 --> -20($fp) + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # local_print_list_at_Cons_internal_4 = local_print_list_at_Cons_internal_6 - local_print_list_at_Cons_internal_5 - lw $t5, -28($fp) - lw $t6, -24($fp) - sub $t5, $t5, $t6 - sw $t5, -20($fp) + # local_print_list_at_Cons_internal_4 = local_print_list_at_Cons_internal_7 - local_print_list_at_Cons_internal_6 + lw $s2, -32($fp) + lw $s3, -28($fp) + sub $s2, $s2, $s3 + sw $s2, -20($fp) # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 - lw $t5, -20($fp) - beq $t5, 0, label_ERROR_3 - # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Book - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + lw $s2, -20($fp) + beq $s2, 0, label_ERROR_3 + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Book - la $t5, Book__TDT - lw $t6, -16($fp) - addu $t5, $t5, $t6 + la $s2, Book__TDT + lw $s3, -16($fp) + addu $s2, $s2, $s3 # Save distance - lw $t6, 0($t5) - sw $t6, -28($fp) + lw $s3, 0($s2) + sw $s3, -32($fp) + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # Update min if 13 < 14 - lw $t5, -28($fp) - lw $t6, -24($fp) - bgtu $t5, $t6, label_NEXT0_5 - # LOCAL local_print_list_at_Cons_dummy_7 --> -32($fp) + # Update min if 18 < 19 + lw $s2, -32($fp) + lw $s3, -28($fp) + bgtu $s2, $s3, label_NEXT0_5 + # LOCAL local_print_list_at_Cons_dummy_8 --> -36($fp) # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # local_print_list_at_Cons_dummy_7 = local_print_list_at_Cons_internal_1 - lw $t5, -8($fp) - sw $t5, -32($fp) - # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) - # local_print_list_at_Cons_internal_10 = SELF - sw $s1, -44($fp) - # LOCAL local_print_list_at_Cons_internal_8 --> -36($fp) - # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) - # local_print_list_at_Cons_internal_8 = local_print_list_at_Cons_internal_10 - lw $t5, -44($fp) - sw $t5, -36($fp) + # local_print_list_at_Cons_dummy_8 = local_print_list_at_Cons_internal_1 + lw $s2, -8($fp) + sw $s2, -36($fp) + # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) + # local_print_list_at_Cons_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) + # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) + # local_print_list_at_Cons_internal_9 = local_print_list_at_Cons_internal_11 + lw $s2, -48($fp) + sw $s2, -40($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) + # LOCAL local_print_list_at_Cons_internal_12 --> -52($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) + la $s2, String + sw $s2, 0($v0) + la $s2, String_start + sw $s2, 4($v0) # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, data_10 - sw $t5, 12($v0) - li $t5, 26 - sw $t5, 16($v0) - sw $v0, -48($fp) - # ARG local_print_list_at_Cons_internal_11 - # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) - lw $t5, -48($fp) + li $s2, 8 + sw $s2, 8($v0) + la $s2, data_9 + sw $s2, 12($v0) + li $s2, 26 + sw $s2, 16($v0) + sw $v0, -52($fp) + # ARG local_print_list_at_Cons_internal_12 + # LOCAL local_print_list_at_Cons_internal_12 --> -52($fp) + lw $s2, -52($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t5, 0($sp) - # LOCAL local_print_list_at_Cons_internal_8 --> -36($fp) + sw $s2, 0($sp) # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) - # local_print_list_at_Cons_internal_9 = VCALL local_print_list_at_Cons_internal_8 out_string + # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) + # local_print_list_at_Cons_internal_10 = VCALL local_print_list_at_Cons_internal_9 out_string # Save new self pointer in $s1 - lw $s1, -36($fp) + lw $s1, -40($fp) # Get pointer to type - lw $t5, 4($s1) + lw $s2, 4($s1) # Get pointer to type's VTABLE - lw $t6, 0($t5) + lw $s3, 0($s2) # Get pointer to function address - lw $t7, 12($t6) + lw $s4, 12($s3) # Call function. Result is on $v0 - jalr $t7 - sw $v0, -40($fp) + jalr $s4 + sw $v0, -44($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) + # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_10 + lw $s2, -44($fp) + sw $s2, -24($fp) # GOTO label_END_4 j label_END_4 label_NEXT0_5: - # local_print_list_at_Cons_internal_6 = TYPE_DISTANCE Article - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Article - la $t5, Article__TDT - lw $t6, -16($fp) - addu $t5, $t5, $t6 + la $s2, Article__TDT + lw $s3, -16($fp) + addu $s2, $s2, $s3 # Save distance - lw $t6, 0($t5) - sw $t6, -28($fp) + lw $s3, 0($s2) + sw $s3, -32($fp) + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # Update min if 13 < 14 - lw $t5, -28($fp) - lw $t6, -24($fp) - bgtu $t5, $t6, label_NEXT1_6 - # LOCAL local_print_list_at_Cons_dummy_12 --> -52($fp) + # Update min if 18 < 19 + lw $s2, -32($fp) + lw $s3, -28($fp) + bgtu $s2, $s3, label_NEXT1_6 + # LOCAL local_print_list_at_Cons_dummy_13 --> -56($fp) # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # local_print_list_at_Cons_dummy_12 = local_print_list_at_Cons_internal_1 - lw $t5, -8($fp) - sw $t5, -52($fp) - # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) - # local_print_list_at_Cons_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_print_list_at_Cons_internal_13 --> -56($fp) - # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) - # local_print_list_at_Cons_internal_13 = local_print_list_at_Cons_internal_15 - lw $t5, -64($fp) - sw $t5, -56($fp) + # local_print_list_at_Cons_dummy_13 = local_print_list_at_Cons_internal_1 + lw $s2, -8($fp) + sw $s2, -56($fp) + # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) + # local_print_list_at_Cons_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_print_list_at_Cons_internal_14 --> -60($fp) + # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) + # local_print_list_at_Cons_internal_14 = local_print_list_at_Cons_internal_16 + lw $s2, -68($fp) + sw $s2, -60($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) + # LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) + la $s2, String + sw $s2, 0($v0) + la $s2, String_start + sw $s2, 4($v0) # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, data_11 - sw $t5, 12($v0) - li $t5, 29 - sw $t5, 16($v0) - sw $v0, -68($fp) - # ARG local_print_list_at_Cons_internal_16 - # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) - lw $t5, -68($fp) + li $s2, 8 + sw $s2, 8($v0) + la $s2, data_10 + sw $s2, 12($v0) + li $s2, 29 + sw $s2, 16($v0) + sw $v0, -72($fp) + # ARG local_print_list_at_Cons_internal_17 + # LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) + lw $s2, -72($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t5, 0($sp) - # LOCAL local_print_list_at_Cons_internal_13 --> -56($fp) + sw $s2, 0($sp) # LOCAL local_print_list_at_Cons_internal_14 --> -60($fp) - # local_print_list_at_Cons_internal_14 = VCALL local_print_list_at_Cons_internal_13 out_string + # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) + # local_print_list_at_Cons_internal_15 = VCALL local_print_list_at_Cons_internal_14 out_string # Save new self pointer in $s1 - lw $s1, -56($fp) + lw $s1, -60($fp) # Get pointer to type - lw $t5, 4($s1) + lw $s2, 4($s1) # Get pointer to type's VTABLE - lw $t6, 0($t5) + lw $s3, 0($s2) # Get pointer to function address - lw $t7, 12($t6) + lw $s4, 12($s3) # Call function. Result is on $v0 - jalr $t7 - sw $v0, -60($fp) + jalr $s4 + sw $v0, -64($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) + # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_15 + lw $s2, -64($fp) + sw $s2, -24($fp) # GOTO label_END_4 j label_END_4 label_NEXT1_6: label_ERROR_3: # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - lw $t5, 0($s1) - sw $t5, -8($fp) + lw $s2, 0($s1) + sw $s2, -8($fp) # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) la $a0, data_1 li $v0, 4 @@ -2332,63 +2276,77 @@ label_NEXT1_6: li $v0, 10 syscall label_END_4: -# local_print_list_at_Cons_internal_19 = GETATTRIBUTE xcdr Cons -# LOCAL local_print_list_at_Cons_internal_19 --> -80($fp) -lw $t5, 16($s1) -sw $t5, -80($fp) -# LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) -# LOCAL local_print_list_at_Cons_internal_19 --> -80($fp) -# local_print_list_at_Cons_internal_17 = local_print_list_at_Cons_internal_19 -lw $t5, -80($fp) -sw $t5, -72($fp) +# local_print_list_at_Cons_internal_20 = GETATTRIBUTE xcdr Cons +# LOCAL local_print_list_at_Cons_internal_20 --> -84($fp) +lw $s2, 16($s1) +sw $s2, -84($fp) +# LOCAL local_print_list_at_Cons_internal_18 --> -76($fp) +# LOCAL local_print_list_at_Cons_internal_20 --> -84($fp) +# local_print_list_at_Cons_internal_18 = local_print_list_at_Cons_internal_20 +lw $s2, -84($fp) +sw $s2, -76($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) # LOCAL local_print_list_at_Cons_internal_18 --> -76($fp) -# local_print_list_at_Cons_internal_18 = VCALL local_print_list_at_Cons_internal_17 print_list +# LOCAL local_print_list_at_Cons_internal_19 --> -80($fp) +# local_print_list_at_Cons_internal_19 = VCALL local_print_list_at_Cons_internal_18 print_list # Save new self pointer in $s1 -lw $s1, -72($fp) +lw $s1, -76($fp) # Get pointer to type -lw $t5, 4($s1) +lw $s2, 4($s1) # Get pointer to type's VTABLE -lw $t6, 0($t5) +lw $s3, 0($s2) # Get pointer to function address -lw $t7, 44($t6) +lw $s4, 44($s3) # Call function. Result is on $v0 -jalr $t7 -sw $v0, -76($fp) +jalr $s4 +sw $v0, -80($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# RETURN local_print_list_at_Cons_internal_18 -lw $v0, -76($fp) +# RETURN local_print_list_at_Cons_internal_19 +lw $v0, -80($fp) # Deallocate stack frame for function function_print_list_at_Cons. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 88 +addu $sp, $sp, 92 jr $ra # Function END -# function_isNil_at_Nil implementation. +# __Book__attrib__title__init implementation. # @Params: -function_isNil_at_Nil: - # Allocate stack frame for function function_isNil_at_Nil. +__Book__attrib__title__init: + # Allocate stack frame for function __Book__attrib__title__init. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_isNil_at_Nil_internal_0 --> -4($fp) - # local_isNil_at_Nil_internal_0 = 1 - li $t5, 1 - sw $t5, -4($fp) - # RETURN local_isNil_at_Nil_internal_0 + # LOCAL local_ttrib__title__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $s2, String + sw $s2, 0($v0) + la $s2, String_start + sw $s2, 4($v0) + # Load type offset + li $s2, 8 + sw $s2, 8($v0) + la $s2, data_0 + sw $s2, 12($v0) + li $s2, 0 + sw $s2, 16($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__title__init_internal_0 lw $v0, -4($fp) - # Deallocate stack frame for function function_isNil_at_Nil. + # Deallocate stack frame for function __Book__attrib__title__init. # Restore $ra lw $ra, 4($sp) # Restore $fp @@ -2399,21 +2357,35 @@ function_isNil_at_Nil: # Function END -# function_print_list_at_Nil implementation. +# __Book__attrib__author__init implementation. # @Params: -function_print_list_at_Nil: - # Allocate stack frame for function function_print_list_at_Nil. +__Book__attrib__author__init: + # Allocate stack frame for function __Book__attrib__author__init. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_print_list_at_Nil_internal_0 --> -4($fp) - # local_print_list_at_Nil_internal_0 = 1 - li $t5, 1 - sw $t5, -4($fp) - # RETURN local_print_list_at_Nil_internal_0 + # LOCAL local_ttrib__author__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $s2, String + sw $s2, 0($v0) + la $s2, String_start + sw $s2, 4($v0) + # Load type offset + li $s2, 8 + sw $s2, 8($v0) + la $s2, data_0 + sw $s2, 12($v0) + li $s2, 0 + sw $s2, 16($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__author__init_internal_0 lw $v0, -4($fp) - # Deallocate stack frame for function function_print_list_at_Nil. + # Deallocate stack frame for function __Book__attrib__author__init. # Restore $ra lw $ra, 4($sp) # Restore $fp @@ -2424,290 +2396,287 @@ function_print_list_at_Nil: # Function END -# __Main__attrib__books__init implementation. +# function_initBook_at_Book implementation. # @Params: -__Main__attrib__books__init: - # Allocate stack frame for function __Main__attrib__books__init. +# 0($fp) = param_initBook_at_Book_title_p_0 +# 4($fp) = param_initBook_at_Book_author_p_1 +function_initBook_at_Book: + # Allocate stack frame for function function_initBook_at_Book. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Main__attrib__books__init. + # + # PARAM param_initBook_at_Book_title_p_0 --> 4($fp) + lw $s2, 4($fp) + sw $s2, 12($s1) + # + # PARAM param_initBook_at_Book_author_p_1 --> 0($fp) + lw $s2, 0($fp) + sw $s2, 16($s1) + # LOCAL local_initBook_at_Book_internal_0 --> -4($fp) + # local_initBook_at_Book_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_initBook_at_Book_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_initBook_at_Book. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 jr $ra # Function END -# function_main_at_Main implementation. +# function_print_at_Book implementation. # @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. +function_print_at_Book: + # Allocate stack frame for function function_print_at_Book. subu $sp, $sp, 92 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 92 - # LOCAL local_main_at_Main_a_book_0 --> -4($fp) - # local_main_at_Main_a_book_0 = ALLOCATE Book - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) - # Load type offset - li $t7, 8 - sw $t7, 8($v0) - la $t7, Book - sw $t7, 12($v0) - li $t7, 4 - sw $t7, 16($v0) - move $t7, $v0 + # LOCAL local_print_at_Book_internal_6 --> -28($fp) + # local_print_at_Book_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_print_at_Book_internal_4 --> -20($fp) + # LOCAL local_print_at_Book_internal_6 --> -28($fp) + # local_print_at_Book_internal_4 = local_print_at_Book_internal_6 + lw $s2, -28($fp) + sw $s2, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Book_internal_7 --> -32($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - sw $t7, 0($v0) - la $t7, Book_start - sw $t7, 4($v0) + # Allocating string + la $s2, String + sw $s2, 0($v0) + la $s2, String_start + sw $s2, 4($v0) # Load type offset - li $t7, 16 - sw $t7, 8($v0) - move $t6, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t6 into stack - subu $sp, $sp, 4 - sw $t6, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t6) - # Push register t6 into stack + li $s2, 8 + sw $s2, 8($v0) + la $s2, data_11 + sw $s2, 12($v0) + li $s2, 12 + sw $s2, 16($v0) + sw $v0, -32($fp) + # ARG local_print_at_Book_internal_7 + # LOCAL local_print_at_Book_internal_7 --> -32($fp) + lw $s2, -32($fp) + # Push arg into stack subu $sp, $sp, 4 - sw $t6, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t6) + sw $s2, 0($sp) + # LOCAL local_print_at_Book_internal_4 --> -20($fp) + # LOCAL local_print_at_Book_internal_5 --> -24($fp) + # local_print_at_Book_internal_5 = VCALL local_print_at_Book_internal_4 out_string + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 12($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t6, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = ALLOCATE Book - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t8, String - sw $t8, 0($v0) - la $t8, String_start - sw $t8, 4($v0) - # Load type offset - li $t8, 8 - sw $t8, 8($v0) - la $t8, Book - sw $t8, 12($v0) - li $t8, 4 - sw $t8, 16($v0) - move $t8, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t8, 0($v0) - la $t8, Book_start - sw $t8, 4($v0) - # Load type offset - li $t8, 16 - sw $t8, 8($v0) - move $t7, $v0 + # LOCAL local_print_at_Book_internal_2 --> -12($fp) + # LOCAL local_print_at_Book_internal_5 --> -24($fp) + # local_print_at_Book_internal_2 = local_print_at_Book_internal_5 + lw $s2, -24($fp) + sw $s2, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - move $s1, $v0 - # Push register t7 into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t7) - # Push register t7 into stack + # local_print_at_Book_internal_8 = GETATTRIBUTE title Book + # LOCAL local_print_at_Book_internal_8 --> -36($fp) + lw $s2, 12($s1) + sw $s2, -36($fp) + # ARG local_print_at_Book_internal_8 + # LOCAL local_print_at_Book_internal_8 --> -36($fp) + lw $s2, -36($fp) + # Push arg into stack subu $sp, $sp, 4 - sw $t7, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t7) + sw $s2, 0($sp) + # LOCAL local_print_at_Book_internal_2 --> -12($fp) + # LOCAL local_print_at_Book_internal_3 --> -16($fp) + # local_print_at_Book_internal_3 = VCALL local_print_at_Book_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 12($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t7, -16($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t7, -16($fp) - sw $t7, -8($fp) + # LOCAL local_print_at_Book_internal_0 --> -4($fp) + # LOCAL local_print_at_Book_internal_3 --> -16($fp) + # local_print_at_Book_internal_0 = local_print_at_Book_internal_3 + lw $s2, -16($fp) + sw $s2, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_print_at_Book_internal_9 --> -40($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) + la $s2, String + sw $s2, 0($v0) + la $s2, String_start + sw $s2, 4($v0) # Load type offset - li $t7, 8 - sw $t7, 8($v0) - la $t7, data_12 - sw $t7, 12($v0) - li $t7, 44 - sw $t7, 16($v0) - sw $v0, -20($fp) - # ARG local_main_at_Main_internal_4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - lw $t7, -20($fp) + li $s2, 8 + sw $s2, 8($v0) + la $s2, data_12 + sw $s2, 12($v0) + li $s2, 1 + sw $s2, 16($v0) + sw $v0, -40($fp) + # ARG local_print_at_Book_internal_9 + # LOCAL local_print_at_Book_internal_9 --> -40($fp) + lw $s2, -40($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t7, 0($sp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) + sw $s2, 0($sp) + # LOCAL local_print_at_Book_internal_0 --> -4($fp) + # LOCAL local_print_at_Book_internal_1 --> -8($fp) + # local_print_at_Book_internal_1 = VCALL local_print_at_Book_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 12($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_16 --> -68($fp) + # local_print_at_Book_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_print_at_Book_internal_14 --> -60($fp) + # LOCAL local_print_at_Book_internal_16 --> -68($fp) + # local_print_at_Book_internal_14 = local_print_at_Book_internal_16 + lw $s2, -68($fp) + sw $s2, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Book_internal_17 --> -72($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) + la $s2, String + sw $s2, 0($v0) + la $s2, String_start + sw $s2, 4($v0) # Load type offset - li $t7, 8 - sw $t7, 8($v0) - la $t7, data_13 - sw $t7, 12($v0) - li $t7, 22 - sw $t7, 16($v0) - sw $v0, -24($fp) - # ARG local_main_at_Main_internal_5 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - lw $t7, -24($fp) + li $s2, 8 + sw $s2, 8($v0) + la $s2, data_13 + sw $s2, 12($v0) + li $s2, 12 + sw $s2, 16($v0) + sw $v0, -72($fp) + # ARG local_print_at_Book_internal_17 + # LOCAL local_print_at_Book_internal_17 --> -72($fp) + lw $s2, -72($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t7, 0($sp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 initBook + sw $s2, 0($sp) + # LOCAL local_print_at_Book_internal_14 --> -60($fp) + # LOCAL local_print_at_Book_internal_15 --> -64($fp) + # local_print_at_Book_internal_15 = VCALL local_print_at_Book_internal_14 out_string # Save new self pointer in $s1 - lw $s1, -8($fp) + lw $s1, -60($fp) # Get pointer to type - lw $t7, 4($s1) + lw $s2, 4($s1) # Get pointer to type's VTABLE - lw $t8, 0($t7) + lw $s3, 0($s2) # Get pointer to function address - lw $t9, 28($t8) + lw $s4, 12($s3) # Call function. Result is on $v0 - jalr $t9 - sw $v0, -12($fp) + jalr $s4 + sw $v0, -64($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_a_book_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_a_book_0 = local_main_at_Main_internal_2 - lw $t7, -12($fp) - sw $t7, -4($fp) - # LOCAL local_main_at_Main_an_article_6 --> -28($fp) - # local_main_at_Main_an_article_6 = ALLOCATE Article - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) - # Load type offset - li $t9, 8 - sw $t9, 8($v0) - la $t9, Article - sw $t9, 12($v0) - li $t9, 7 - sw $t9, 16($v0) - move $t9, $v0 - # Allocating 24 bytes of memory - li $a0, 24 - li $v0, 9 - syscall - sw $t9, 0($v0) - la $t9, Article_start - sw $t9, 4($v0) - # Load type offset - li $t9, 20 - sw $t9, 8($v0) - move $t8, $v0 + # LOCAL local_print_at_Book_internal_12 --> -52($fp) + # LOCAL local_print_at_Book_internal_15 --> -64($fp) + # local_print_at_Book_internal_12 = local_print_at_Book_internal_15 + lw $s2, -64($fp) + sw $s2, -52($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - move $s1, $v0 - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t8) - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t8) - # Push register t8 into stack + # local_print_at_Book_internal_18 = GETATTRIBUTE author Book + # LOCAL local_print_at_Book_internal_18 --> -76($fp) + lw $s2, 16($s1) + sw $s2, -76($fp) + # ARG local_print_at_Book_internal_18 + # LOCAL local_print_at_Book_internal_18 --> -76($fp) + lw $s2, -76($fp) + # Push arg into stack subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Article__attrib__per_title__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t8) + sw $s2, 0($sp) + # LOCAL local_print_at_Book_internal_12 --> -52($fp) + # LOCAL local_print_at_Book_internal_13 --> -56($fp) + # local_print_at_Book_internal_13 = VCALL local_print_at_Book_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 12($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t8, -28($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = ALLOCATE Article + # LOCAL local_print_at_Book_internal_10 --> -44($fp) + # LOCAL local_print_at_Book_internal_13 --> -56($fp) + # local_print_at_Book_internal_10 = local_print_at_Book_internal_13 + lw $s2, -56($fp) + sw $s2, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Book_internal_19 --> -80($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type name + # Allocating string la $s2, String sw $s2, 0($v0) la $s2, String_start @@ -2715,298 +2684,339 @@ function_main_at_Main: # Load type offset li $s2, 8 sw $s2, 8($v0) - la $s2, Article + la $s2, data_14 sw $s2, 12($v0) - li $s2, 7 + li $s2, 1 sw $s2, 16($v0) - move $s2, $v0 - # Allocating 24 bytes of memory - li $a0, 24 - li $v0, 9 - syscall - sw $s2, 0($v0) - la $s2, Article_start - sw $s2, 4($v0) - # Load type offset - li $s2, 20 - sw $s2, 8($v0) - move $t9, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t9) - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t9) - # Push register t9 into stack + sw $v0, -80($fp) + # ARG local_print_at_Book_internal_19 + # LOCAL local_print_at_Book_internal_19 --> -80($fp) + lw $s2, -80($fp) + # Push arg into stack subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Article__attrib__per_title__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t9) + sw $s2, 0($sp) + # LOCAL local_print_at_Book_internal_10 --> -44($fp) + # LOCAL local_print_at_Book_internal_11 --> -48($fp) + # local_print_at_Book_internal_11 = VCALL local_print_at_Book_internal_10 out_string + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $s2, 4($s1) + # Get pointer to type's VTABLE + lw $s3, 0($s2) + # Get pointer to function address + lw $s4, 12($s3) + # Call function. Result is on $v0 + jalr $s4 + sw $v0, -48($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t9, -40($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t9, -40($fp) - sw $t9, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_print_at_Book_internal_20 --> -84($fp) + # local_print_at_Book_internal_20 = SELF + sw $s1, -84($fp) + # RETURN local_print_at_Book_internal_20 + lw $v0, -84($fp) + # Deallocate stack frame for function function_print_at_Book. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 92 + jr $ra + # Function END + + +# __Article__attrib__per_title__init implementation. +# @Params: +__Article__attrib__per_title__init: + # Allocate stack frame for function __Article__attrib__per_title__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local___attrib__per_title__init_internal_0 --> -4($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) + la $s2, String + sw $s2, 0($v0) + la $s2, String_start + sw $s2, 4($v0) # Load type offset - li $t9, 8 - sw $t9, 8($v0) - la $t9, data_14 - sw $t9, 12($v0) - li $t9, 19 - sw $t9, 16($v0) - sw $v0, -44($fp) - # ARG local_main_at_Main_internal_10 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - lw $t9, -44($fp) - # Push arg into stack + li $s2, 8 + sw $s2, 8($v0) + la $s2, data_0 + sw $s2, 12($v0) + li $s2, 0 + sw $s2, 16($v0) + sw $v0, -4($fp) + # RETURN local___attrib__per_title__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Article__attrib__per_title__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_initArticle_at_Article implementation. +# @Params: +# 0($fp) = param_initArticle_at_Article_title_p_0 +# 4($fp) = param_initArticle_at_Article_author_p_1 +# 8($fp) = param_initArticle_at_Article_per_title_p_2 +function_initArticle_at_Article: + # Allocate stack frame for function function_initArticle_at_Article. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) + # local_initArticle_at_Article_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) + # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) + # local_initArticle_at_Article_internal_0 = local_initArticle_at_Article_internal_2 + lw $s2, -12($fp) + sw $s2, -4($fp) + # Push register s1 into stack subu $sp, $sp, 4 - sw $t9, 0($sp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) - # Load type offset - li $t9, 8 - sw $t9, 8($v0) - la $t9, data_15 - sw $t9, 12($v0) - li $t9, 7 - sw $t9, 16($v0) - sw $v0, -48($fp) - # ARG local_main_at_Main_internal_11 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - lw $t9, -48($fp) + sw $s1, 0($sp) + # ARG param_initArticle_at_Article_title_p_0 + # PARAM param_initArticle_at_Article_title_p_0 --> 8($fp) + lw $s2, 8($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t9, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) - # Load type offset - li $t9, 8 - sw $t9, 8($v0) - la $t9, data_16 - sw $t9, 12($v0) - li $t9, 11 - sw $t9, 16($v0) - sw $v0, -52($fp) - # ARG local_main_at_Main_internal_12 - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - lw $t9, -52($fp) + sw $s2, 0($sp) + # ARG param_initArticle_at_Article_author_p_1 + # PARAM param_initArticle_at_Article_author_p_1 --> 4($fp) + lw $s2, 4($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t9, 0($sp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 initArticle + sw $s2, 0($sp) + # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) + # LOCAL local_initArticle_at_Article_internal_1 --> -8($fp) + # local_initArticle_at_Article_internal_1 = VCALL local_initArticle_at_Article_internal_0 initBook # Save new self pointer in $s1 - lw $s1, -32($fp) + lw $s1, -4($fp) # Get pointer to type - lw $t9, 4($s1) + lw $s2, 4($s1) # Get pointer to type's VTABLE - lw $s2, 0($t9) + lw $s3, 0($s2) # Get pointer to function address - lw $s3, 36($s2) + lw $s4, 28($s3) # Call function. Result is on $v0 - jalr $s3 - sw $v0, -36($fp) + jalr $s4 + sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_an_article_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_an_article_6 = local_main_at_Main_internal_8 - lw $t9, -36($fp) - sw $t9, -28($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = ALLOCATE Nil - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $s3, String - sw $s3, 0($v0) - la $s3, String_start - sw $s3, 4($v0) - # Load type offset - li $s3, 8 - sw $s3, 8($v0) - la $s3, Nil - sw $s3, 12($v0) - li $s3, 3 - sw $s3, 16($v0) - move $s3, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $s3, 0($v0) - la $s3, Nil_start - sw $s3, 4($v0) - # Load type offset - li $s3, 32 - sw $s3, 8($v0) - move $s2, $v0 + # + # PARAM param_initArticle_at_Article_per_title_p_2 --> 0($fp) + lw $s2, 0($fp) + sw $s2, 20($s1) + # LOCAL local_initArticle_at_Article_internal_3 --> -16($fp) + # local_initArticle_at_Article_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_initArticle_at_Article_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_initArticle_at_Article. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 12 + jr $ra + # Function END + + +# function_print_at_Article implementation. +# @Params: +function_print_at_Article: + # Allocate stack frame for function function_print_at_Article. + subu $sp, $sp, 60 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 60 + # LOCAL local_print_at_Article_internal_1 --> -8($fp) + # local_print_at_Article_internal_1 = SELF + sw $s1, -8($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - move $s1, $v0 + # local_print_at_Article_internal_0 = CALL print + # LOCAL local_print_at_Article_internal_0 --> -4($fp) + # LOCAL local_print_at_Article_internal_1 --> -8($fp) + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type's VTABLE + la $s2, Book_vtable + # Get pointer to function address + lw $s3, 32($s2) + # Call function. Result is on $v0 + jalr $s3 + sw $v0, -4($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $s2, -72($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 - lw $s2, -72($fp) - sw $s2, -64($fp) + # LOCAL local_print_at_Article_internal_8 --> -36($fp) + # local_print_at_Article_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_print_at_Article_internal_6 --> -28($fp) + # LOCAL local_print_at_Article_internal_8 --> -36($fp) + # local_print_at_Article_internal_6 = local_print_at_Article_internal_8 + lw $s2, -36($fp) + sw $s2, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # ARG local_main_at_Main_a_book_0 - # LOCAL local_main_at_Main_a_book_0 --> -4($fp) - lw $s2, -4($fp) + # LOCAL local_print_at_Article_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $s2, String + sw $s2, 0($v0) + la $s2, String_start + sw $s2, 4($v0) + # Load type offset + li $s2, 8 + sw $s2, 8($v0) + la $s2, data_15 + sw $s2, 12($v0) + li $s2, 13 + sw $s2, 16($v0) + sw $v0, -40($fp) + # ARG local_print_at_Article_internal_9 + # LOCAL local_print_at_Article_internal_9 --> -40($fp) + lw $s2, -40($fp) # Push arg into stack subu $sp, $sp, 4 sw $s2, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 cons + # LOCAL local_print_at_Article_internal_6 --> -28($fp) + # LOCAL local_print_at_Article_internal_7 --> -32($fp) + # local_print_at_Article_internal_7 = VCALL local_print_at_Article_internal_6 out_string # Save new self pointer in $s1 - lw $s1, -64($fp) + lw $s1, -28($fp) # Get pointer to type lw $s2, 4($s1) # Get pointer to type's VTABLE lw $s3, 0($s2) # Get pointer to function address - lw $s4, 32($s3) + lw $s4, 12($s3) # Call function. Result is on $v0 jalr $s4 - sw $v0, -68($fp) + sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_13 = local_main_at_Main_internal_16 - lw $s2, -68($fp) - sw $s2, -56($fp) + # LOCAL local_print_at_Article_internal_4 --> -20($fp) + # LOCAL local_print_at_Article_internal_7 --> -32($fp) + # local_print_at_Article_internal_4 = local_print_at_Article_internal_7 + lw $s2, -32($fp) + sw $s2, -20($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # ARG local_main_at_Main_an_article_6 - # LOCAL local_main_at_Main_an_article_6 --> -28($fp) - lw $s2, -28($fp) + # local_print_at_Article_internal_10 = GETATTRIBUTE per_title Article + # LOCAL local_print_at_Article_internal_10 --> -44($fp) + lw $s2, 20($s1) + sw $s2, -44($fp) + # ARG local_print_at_Article_internal_10 + # LOCAL local_print_at_Article_internal_10 --> -44($fp) + lw $s2, -44($fp) # Push arg into stack subu $sp, $sp, 4 sw $s2, 0($sp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 cons + # LOCAL local_print_at_Article_internal_4 --> -20($fp) + # LOCAL local_print_at_Article_internal_5 --> -24($fp) + # local_print_at_Article_internal_5 = VCALL local_print_at_Article_internal_4 out_string # Save new self pointer in $s1 - lw $s1, -56($fp) + lw $s1, -20($fp) # Get pointer to type lw $s2, 4($s1) # Get pointer to type's VTABLE lw $s3, 0($s2) # Get pointer to function address - lw $s4, 32($s3) + lw $s4, 12($s3) # Call function. Result is on $v0 jalr $s4 - sw $v0, -60($fp) + sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - lw $s2, -60($fp) - sw $s2, 12($s1) - # local_main_at_Main_internal_20 = GETATTRIBUTE books Main - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - lw $s2, 12($s1) - sw $s2, -84($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 - lw $s2, -84($fp) - sw $s2, -76($fp) + # LOCAL local_print_at_Article_internal_2 --> -12($fp) + # LOCAL local_print_at_Article_internal_5 --> -24($fp) + # local_print_at_Article_internal_2 = local_print_at_Article_internal_5 + lw $s2, -24($fp) + sw $s2, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 print_list + # LOCAL local_print_at_Article_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $s2, String + sw $s2, 0($v0) + la $s2, String_start + sw $s2, 4($v0) + # Load type offset + li $s2, 8 + sw $s2, 8($v0) + la $s2, data_16 + sw $s2, 12($v0) + li $s2, 1 + sw $s2, 16($v0) + sw $v0, -48($fp) + # ARG local_print_at_Article_internal_11 + # LOCAL local_print_at_Article_internal_11 --> -48($fp) + lw $s2, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $s2, 0($sp) + # LOCAL local_print_at_Article_internal_2 --> -12($fp) + # LOCAL local_print_at_Article_internal_3 --> -16($fp) + # local_print_at_Article_internal_3 = VCALL local_print_at_Article_internal_2 out_string # Save new self pointer in $s1 - lw $s1, -76($fp) + lw $s1, -12($fp) # Get pointer to type lw $s2, 4($s1) # Get pointer to type's VTABLE lw $s3, 0($s2) # Get pointer to function address - lw $s4, 44($s3) + lw $s4, 12($s3) # Call function. Result is on $v0 jalr $s4 - sw $v0, -80($fp) + sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_19 - lw $v0, -80($fp) - # Deallocate stack frame for function function_main_at_Main. + # LOCAL local_print_at_Article_internal_12 --> -52($fp) + # local_print_at_Article_internal_12 = SELF + sw $s1, -52($fp) + # RETURN local_print_at_Article_internal_12 + lw $v0, -52($fp) + # Deallocate stack frame for function function_print_at_Article. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 92 + addu $sp, $sp, 60 jr $ra # Function END diff --git a/tests/codegen/cells.mips b/tests/codegen/cells.mips new file mode 100644 index 00000000..098d937e --- /dev/null +++ b/tests/codegen/cells.mips @@ -0,0 +1,2152 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:14 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Main: .asciiz "Main" +# Function END +CellularAutomaton: .asciiz "CellularAutomaton" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +# **** VTABLE for type CellularAutomaton **** +CellularAutomaton_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_CellularAutomaton, function_print_at_CellularAutomaton, function_num_cells_at_CellularAutomaton, function_cell_at_CellularAutomaton, function_cell_left_neighbor_at_CellularAutomaton, function_cell_right_neighbor_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_evolve_at_CellularAutomaton +# Function END +# + + +# **** Type RECORD for type CellularAutomaton **** +CellularAutomaton_start: + CellularAutomaton_vtable_pointer: .word CellularAutomaton_vtable + # Function END +CellularAutomaton_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1 +Main__TDT: .word -1, -1, -1, -1, 0, -1 +CellularAutomaton__TDT: .word -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz " X " +# + + +data_5: .asciiz "\n" +# + + +data_6: .asciiz "X" +# + + +data_7: .asciiz "X" +# + + +data_8: .asciiz "X" +# + + +data_9: .asciiz "X" +# + + +data_10: .asciiz "." +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $a0, 0($fp) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_length_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Main + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Main_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__cells__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t1, Main_vtable + # Get pointer to function address + lw $t2, 12($t1) + # Call function. Result is on $v0 + jalr $t2 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__cells__init implementation. +# @Params: +__Main__attrib__cells__init: + # Allocate stack frame for function __Main__attrib__cells__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__cells__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 76 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 76 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = ALLOCATE CellularAutomaton + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, CellularAutomaton + sw $t3, 12($v0) + li $t3, 17 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, CellularAutomaton_start + sw $t3, 4($v0) + # Load type offset + li $t3, 20 + sw $t3, 8($v0) + move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __CellularAutomaton__attrib__population_map__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t2, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t2, -12($fp) + sw $t2, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_4 + sw $t2, 12($v0) + li $t2, 19 + sw $t2, 16($v0) + sw $v0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t2, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 init + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 28($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + lw $t2, -8($fp) + sw $t2, 12($s1) + # local_main_at_Main_internal_6 = GETATTRIBUTE cells Main + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + lw $t2, 12($s1) + sw $t2, -28($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_6 + lw $t2, -28($fp) + sw $t2, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 print + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 32($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_countdown_7 --> -32($fp) + # local_main_at_Main_countdown_7 = 20 + li $t2, 20 + sw $t2, -32($fp) + label_WHILE_1: + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_countdown_7 --> -32($fp) + # local_main_at_Main_internal_8 = 0 - local_main_at_Main_countdown_7 + li $t2, 0 + lw $t3, -32($fp) + sub $t2, $t2, $t3 + sw $t2, -36($fp) + # IF_GREATER_ZERO local_main_at_Main_internal_8 GOTO label_FALSE_3 + # IF_GREATER_ZERO local_main_at_Main_internal_8 GOTO label_FALSE_3 + lw $t2, -36($fp) + bgt $t2, 0, label_FALSE_3 + # IF_ZERO local_main_at_Main_internal_8 GOTO label_FALSE_3 + # IF_ZERO local_main_at_Main_internal_8 GOTO label_FALSE_3 + lw $t2, -36($fp) + beq $t2, 0, label_FALSE_3 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = 1 + li $t2, 1 + sw $t2, -36($fp) + # GOTO label_END_4 +j label_END_4 +label_FALSE_3: + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = 0 + li $t2, 0 + sw $t2, -36($fp) + label_END_4: +# IF_ZERO local_main_at_Main_internal_8 GOTO label_WHILE_END_2 +# IF_ZERO local_main_at_Main_internal_8 GOTO label_WHILE_END_2 +lw $t2, -36($fp) +beq $t2, 0, label_WHILE_END_2 +# local_main_at_Main_internal_11 = GETATTRIBUTE cells Main +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +lw $t2, 12($s1) +sw $t2, -48($fp) +# LOCAL local_main_at_Main_internal_9 --> -40($fp) +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +# local_main_at_Main_internal_9 = local_main_at_Main_internal_11 +lw $t2, -48($fp) +sw $t2, -40($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_9 --> -40($fp) +# LOCAL local_main_at_Main_internal_10 --> -44($fp) +# local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 evolve +# Save new self pointer in $s1 +lw $s1, -40($fp) +# Get pointer to type +lw $t2, 4($s1) +# Get pointer to type's VTABLE +lw $t3, 0($t2) +# Get pointer to function address +lw $t4, 56($t3) +# Call function. Result is on $v0 +jalr $t4 +sw $v0, -44($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# local_main_at_Main_internal_14 = GETATTRIBUTE cells Main +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +lw $t2, 12($s1) +sw $t2, -60($fp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 +lw $t2, -60($fp) +sw $t2, -52($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 print +# Save new self pointer in $s1 +lw $s1, -52($fp) +# Get pointer to type +lw $t2, 4($s1) +# Get pointer to type's VTABLE +lw $t3, 0($t2) +# Get pointer to function address +lw $t4, 32($t3) +# Call function. Result is on $v0 +jalr $t4 +sw $v0, -56($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# LOCAL local_main_at_Main_countdown_7 --> -32($fp) +# local_main_at_Main_internal_15 = local_main_at_Main_countdown_7 - 1 +lw $t2, -32($fp) +sub $t2, $t2, 1 +sw $t2, -64($fp) +# LOCAL local_main_at_Main_countdown_7 --> -32($fp) +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# local_main_at_Main_countdown_7 = local_main_at_Main_internal_15 +lw $t2, -64($fp) +sw $t2, -32($fp) +# GOTO label_WHILE_1 +j label_WHILE_1 +label_WHILE_END_2: + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = SELF + sw $s1, -68($fp) + # RETURN local_main_at_Main_internal_16 + lw $v0, -68($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 76 + jr $ra + # Function END + + +# __CellularAutomaton__attrib__population_map__init implementation. +# @Params: +__CellularAutomaton__attrib__population_map__init: + # Allocate stack frame for function __CellularAutomaton__attrib__population_map__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_rAutomaton__attrib__population_map__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_0 + sw $t2, 12($v0) + li $t2, 0 + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_rAutomaton__attrib__population_map__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __CellularAutomaton__attrib__population_map__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_init_at_CellularAutomaton_map_0 +function_init_at_CellularAutomaton: + # Allocate stack frame for function function_init_at_CellularAutomaton. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_CellularAutomaton_map_0 --> 0($fp) + lw $t2, 0($fp) + sw $t2, 12($s1) + # LOCAL local_init_at_CellularAutomaton_internal_0 --> -4($fp) + # local_init_at_CellularAutomaton_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_CellularAutomaton_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_at_CellularAutomaton implementation. +# @Params: +function_print_at_CellularAutomaton: + # Allocate stack frame for function function_print_at_CellularAutomaton. + subu $sp, $sp, 40 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 40 + # LOCAL local_print_at_CellularAutomaton_internal_2 --> -12($fp) + # local_print_at_CellularAutomaton_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_print_at_CellularAutomaton_internal_2 --> -12($fp) + # local_print_at_CellularAutomaton_internal_0 = local_print_at_CellularAutomaton_internal_2 + lw $t2, -12($fp) + sw $t2, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_CellularAutomaton_internal_5 = GETATTRIBUTE population_map CellularAutomaton + # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) + lw $t2, 12($s1) + sw $t2, -24($fp) + # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) + # local_print_at_CellularAutomaton_internal_3 = local_print_at_CellularAutomaton_internal_5 + lw $t2, -24($fp) + sw $t2, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_5 + sw $t2, 12($v0) + li $t2, 1 + sw $t2, 16($v0) + sw $v0, -28($fp) + # ARG local_print_at_CellularAutomaton_internal_6 + # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) + lw $t2, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_print_at_CellularAutomaton_internal_4 --> -20($fp) + # local_print_at_CellularAutomaton_internal_4 = VCALL local_print_at_CellularAutomaton_internal_3 concat + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 12($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_print_at_CellularAutomaton_internal_4 + # LOCAL local_print_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t2, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_print_at_CellularAutomaton_internal_1 --> -8($fp) + # local_print_at_CellularAutomaton_internal_1 = VCALL local_print_at_CellularAutomaton_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 12($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) + # local_print_at_CellularAutomaton_internal_7 = SELF + sw $s1, -32($fp) + # RETURN local_print_at_CellularAutomaton_internal_7 + lw $v0, -32($fp) + # Deallocate stack frame for function function_print_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 40 + jr $ra + # Function END + + +# function_num_cells_at_CellularAutomaton implementation. +# @Params: +function_num_cells_at_CellularAutomaton: + # Allocate stack frame for function function_num_cells_at_CellularAutomaton. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_num_cells_at_CellularAutomaton_internal_2 = GETATTRIBUTE population_map CellularAutomaton + # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) + lw $t2, 12($s1) + sw $t2, -12($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) + # local_num_cells_at_CellularAutomaton_internal_0 = local_num_cells_at_CellularAutomaton_internal_2 + lw $t2, -12($fp) + sw $t2, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_1 --> -8($fp) + # local_num_cells_at_CellularAutomaton_internal_1 = VCALL local_num_cells_at_CellularAutomaton_internal_0 length + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 20($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_num_cells_at_CellularAutomaton_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_num_cells_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cell_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_cell_at_CellularAutomaton_position_0 +function_cell_at_CellularAutomaton: + # Allocate stack frame for function function_cell_at_CellularAutomaton. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_cell_at_CellularAutomaton_internal_2 = GETATTRIBUTE population_map CellularAutomaton + # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) + lw $t2, 12($s1) + sw $t2, -12($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) + # local_cell_at_CellularAutomaton_internal_0 = local_cell_at_CellularAutomaton_internal_2 + lw $t2, -12($fp) + sw $t2, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cell_at_CellularAutomaton_position_0 + # PARAM param_cell_at_CellularAutomaton_position_0 --> 0($fp) + lw $t2, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # ARG 1 + li $t2, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) + # local_cell_at_CellularAutomaton_internal_1 = VCALL local_cell_at_CellularAutomaton_internal_0 substr + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 16($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_cell_at_CellularAutomaton_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_cell_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_cell_left_neighbor_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_cell_left_neighbor_at_CellularAutomaton_position_0 +function_cell_left_neighbor_at_CellularAutomaton: + # Allocate stack frame for function function_cell_left_neighbor_at_CellularAutomaton. + subu $sp, $sp, 60 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 60 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) + # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_1 = PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 - 0 + lw $t2, 0($fp) + sub $t2, $t2, 0 + sw $t2, -8($fp) + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_1 GOTO label_TRUE_7 + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_1 GOTO label_TRUE_7 + lw $t2, -8($fp) + beq $t2, 0, label_TRUE_7 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_1 = 0 + li $t2, 0 + sw $t2, -8($fp) + # GOTO label_END_8 +j label_END_8 +label_TRUE_7: + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_1 = 1 + li $t2, 1 + sw $t2, -8($fp) + label_END_8: +# IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_5 +# IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_5 +lw $t2, -8($fp) +beq $t2, 0, label_FALSEIF_5 +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_4 = SELF +sw $s1, -20($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_2 = local_cell_left_neighbor_at_CellularAutomaton_internal_4 +lw $t2, -20($fp) +sw $t2, -12($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_8 = SELF +sw $s1, -36($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_6 = local_cell_left_neighbor_at_CellularAutomaton_internal_8 +lw $t2, -36($fp) +sw $t2, -28($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_7 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_6 num_cells +# Save new self pointer in $s1 +lw $s1, -28($fp) +# Get pointer to type +lw $t2, 4($s1) +# Get pointer to type's VTABLE +lw $t3, 0($t2) +# Get pointer to function address +lw $t4, 36($t3) +# Call function. Result is on $v0 +jalr $t4 +sw $v0, -32($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_5 = local_cell_left_neighbor_at_CellularAutomaton_internal_7 - 1 +lw $t2, -32($fp) +sub $t2, $t2, 1 +sw $t2, -24($fp) +# ARG local_cell_left_neighbor_at_CellularAutomaton_internal_5 +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) +lw $t2, -24($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t2, 0($sp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_3 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_2 cell +# Save new self pointer in $s1 +lw $s1, -12($fp) +# Get pointer to type +lw $t2, 4($s1) +# Get pointer to type's VTABLE +lw $t3, 0($t2) +# Get pointer to function address +lw $t4, 40($t3) +# Call function. Result is on $v0 +jalr $t4 +sw $v0, -16($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_0 = local_cell_left_neighbor_at_CellularAutomaton_internal_3 +lw $t2, -16($fp) +sw $t2, -4($fp) +# GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_9 = local_cell_left_neighbor_at_CellularAutomaton_internal_11 + lw $t2, -48($fp) + sw $t2, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) + # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_12 = PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 - 1 + lw $t2, 0($fp) + sub $t2, $t2, 1 + sw $t2, -52($fp) + # ARG local_cell_left_neighbor_at_CellularAutomaton_internal_12 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) + lw $t2, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_10 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_9 cell + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 40($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_0 = local_cell_left_neighbor_at_CellularAutomaton_internal_10 + lw $t2, -44($fp) + sw $t2, -4($fp) + label_ENDIF_6: +# RETURN local_cell_left_neighbor_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_cell_left_neighbor_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 60 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_cell_right_neighbor_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_cell_right_neighbor_at_CellularAutomaton_position_0 +function_cell_right_neighbor_at_CellularAutomaton: + # Allocate stack frame for function function_cell_right_neighbor_at_CellularAutomaton. + subu $sp, $sp, 60 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 60 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_5 = SELF + sw $s1, -24($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_3 = local_cell_right_neighbor_at_CellularAutomaton_internal_5 + lw $t2, -24($fp) + sw $t2, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_4 = VCALL local_cell_right_neighbor_at_CellularAutomaton_internal_3 num_cells + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 36($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_2 = local_cell_right_neighbor_at_CellularAutomaton_internal_4 - 1 + lw $t2, -20($fp) + sub $t2, $t2, 1 + sw $t2, -12($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) + # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_1 = PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 - local_cell_right_neighbor_at_CellularAutomaton_internal_2 + lw $t2, 0($fp) + lw $t3, -12($fp) + sub $t2, $t2, $t3 + sw $t2, -8($fp) + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_1 GOTO label_TRUE_11 + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_1 GOTO label_TRUE_11 + lw $t2, -8($fp) + beq $t2, 0, label_TRUE_11 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_1 = 0 + li $t2, 0 + sw $t2, -8($fp) + # GOTO label_END_12 +j label_END_12 +label_TRUE_11: + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_1 = 1 + li $t2, 1 + sw $t2, -8($fp) + label_END_12: +# IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_9 +# IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_9 +lw $t2, -8($fp) +beq $t2, 0, label_FALSEIF_9 +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) +# local_cell_right_neighbor_at_CellularAutomaton_internal_8 = SELF +sw $s1, -36($fp) +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) +# local_cell_right_neighbor_at_CellularAutomaton_internal_6 = local_cell_right_neighbor_at_CellularAutomaton_internal_8 +lw $t2, -36($fp) +sw $t2, -28($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG 0 +li $t2, 0 +# Push arg into stack +subu $sp, $sp, 4 +sw $t2, 0($sp) +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) +# local_cell_right_neighbor_at_CellularAutomaton_internal_7 = VCALL local_cell_right_neighbor_at_CellularAutomaton_internal_6 cell +# Save new self pointer in $s1 +lw $s1, -28($fp) +# Get pointer to type +lw $t2, 4($s1) +# Get pointer to type's VTABLE +lw $t3, 0($t2) +# Get pointer to function address +lw $t4, 40($t3) +# Call function. Result is on $v0 +jalr $t4 +sw $v0, -32($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) +# local_cell_right_neighbor_at_CellularAutomaton_internal_0 = local_cell_right_neighbor_at_CellularAutomaton_internal_7 +lw $t2, -32($fp) +sw $t2, -4($fp) +# GOTO label_ENDIF_10 +j label_ENDIF_10 +label_FALSEIF_9: + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_9 = local_cell_right_neighbor_at_CellularAutomaton_internal_11 + lw $t2, -48($fp) + sw $t2, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) + # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_12 = PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 + 1 + lw $t2, 0($fp) + add $t2, $t2, 1 + sw $t2, -52($fp) + # ARG local_cell_right_neighbor_at_CellularAutomaton_internal_12 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) + lw $t2, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_10 = VCALL local_cell_right_neighbor_at_CellularAutomaton_internal_9 cell + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 40($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_0 = local_cell_right_neighbor_at_CellularAutomaton_internal_10 + lw $t2, -44($fp) + sw $t2, -4($fp) + label_ENDIF_10: +# RETURN local_cell_right_neighbor_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_cell_right_neighbor_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 60 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_cell_at_next_evolution_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_cell_at_next_evolution_at_CellularAutomaton_position_0 +function_cell_at_next_evolution_at_CellularAutomaton: + # Allocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. + subu $sp, $sp, 104 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 104 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_6 = local_cell_at_next_evolution_at_CellularAutomaton_internal_8 + lw $t2, -36($fp) + sw $t2, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 + # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) + lw $t2, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 cell + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 40($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_6 + sw $t2, 12($v0) + li $t2, 1 + sw $t2, 16($v0) + sw $v0, -40($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_5 = local_cell_at_next_evolution_at_CellularAutomaton_internal_7 - local_cell_at_next_evolution_at_CellularAutomaton_internal_9 + lw $t2, -32($fp) + lw $t3, -40($fp) + sub $t2, $t2, $t3 + sw $t2, -24($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_5 GOTO label_TRUE_19 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_5 GOTO label_TRUE_19 + lw $t2, -24($fp) + beq $t2, 0, label_TRUE_19 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_5 = 0 + li $t2, 0 + sw $t2, -24($fp) + # GOTO label_END_20 +j label_END_20 +label_TRUE_19: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_5 = 1 + li $t2, 1 + sw $t2, -24($fp) + label_END_20: +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_5 GOTO label_FALSEIF_17 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_5 GOTO label_FALSEIF_17 +lw $t2, -24($fp) +beq $t2, 0, label_FALSEIF_17 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_4 = 1 +li $t2, 1 +sw $t2, -20($fp) +# GOTO label_ENDIF_18 +j label_ENDIF_18 +label_FALSEIF_17: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_4 = 0 + li $t2, 0 + sw $t2, -20($fp) + label_ENDIF_18: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_14 = SELF +sw $s1, -60($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = local_cell_at_next_evolution_at_CellularAutomaton_internal_14 +lw $t2, -60($fp) +sw $t2, -52($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 +# PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) +lw $t2, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t2, 0($sp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_13 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 cell_left_neighbor +# Save new self pointer in $s1 +lw $s1, -52($fp) +# Get pointer to type +lw $t2, 4($s1) +# Get pointer to type's VTABLE +lw $t3, 0($t2) +# Get pointer to function address +lw $t4, 44($t3) +# Call function. Result is on $v0 +jalr $t4 +sw $v0, -56($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t2, String +sw $t2, 0($v0) +la $t2, String_start +sw $t2, 4($v0) +# Load type offset +li $t2, 8 +sw $t2, 8($v0) +la $t2, data_7 +sw $t2, 12($v0) +li $t2, 1 +sw $t2, 16($v0) +sw $v0, -64($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_11 = local_cell_at_next_evolution_at_CellularAutomaton_internal_13 - local_cell_at_next_evolution_at_CellularAutomaton_internal_15 +lw $t2, -56($fp) +lw $t3, -64($fp) +sub $t2, $t2, $t3 +sw $t2, -48($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_11 GOTO label_TRUE_23 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_11 GOTO label_TRUE_23 +lw $t2, -48($fp) +beq $t2, 0, label_TRUE_23 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_11 = 0 +li $t2, 0 +sw $t2, -48($fp) +# GOTO label_END_24 +j label_END_24 +label_TRUE_23: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_11 = 1 + li $t2, 1 + sw $t2, -48($fp) + label_END_24: +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_11 GOTO label_FALSEIF_21 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_11 GOTO label_FALSEIF_21 +lw $t2, -48($fp) +beq $t2, 0, label_FALSEIF_21 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_10 = 1 +li $t2, 1 +sw $t2, -44($fp) +# GOTO label_ENDIF_22 +j label_ENDIF_22 +label_FALSEIF_21: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_10 = 0 + li $t2, 0 + sw $t2, -44($fp) + label_ENDIF_22: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_3 = local_cell_at_next_evolution_at_CellularAutomaton_internal_4 + local_cell_at_next_evolution_at_CellularAutomaton_internal_10 +lw $t2, -20($fp) +lw $t3, -44($fp) +add $t2, $t2, $t3 +sw $t2, -16($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_20 = SELF +sw $s1, -84($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_18 = local_cell_at_next_evolution_at_CellularAutomaton_internal_20 +lw $t2, -84($fp) +sw $t2, -76($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 +# PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) +lw $t2, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t2, 0($sp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_19 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 cell_right_neighbor +# Save new self pointer in $s1 +lw $s1, -76($fp) +# Get pointer to type +lw $t2, 4($s1) +# Get pointer to type's VTABLE +lw $t3, 0($t2) +# Get pointer to function address +lw $t4, 48($t3) +# Call function. Result is on $v0 +jalr $t4 +sw $v0, -80($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t2, String +sw $t2, 0($v0) +la $t2, String_start +sw $t2, 4($v0) +# Load type offset +li $t2, 8 +sw $t2, 8($v0) +la $t2, data_8 +sw $t2, 12($v0) +li $t2, 1 +sw $t2, 16($v0) +sw $v0, -88($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_17 = local_cell_at_next_evolution_at_CellularAutomaton_internal_19 - local_cell_at_next_evolution_at_CellularAutomaton_internal_21 +lw $t2, -80($fp) +lw $t3, -88($fp) +sub $t2, $t2, $t3 +sw $t2, -72($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_17 GOTO label_TRUE_27 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_17 GOTO label_TRUE_27 +lw $t2, -72($fp) +beq $t2, 0, label_TRUE_27 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_17 = 0 +li $t2, 0 +sw $t2, -72($fp) +# GOTO label_END_28 +j label_END_28 +label_TRUE_27: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_17 = 1 + li $t2, 1 + sw $t2, -72($fp) + label_END_28: +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_25 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_25 +lw $t2, -72($fp) +beq $t2, 0, label_FALSEIF_25 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_16 = 1 +li $t2, 1 +sw $t2, -68($fp) +# GOTO label_ENDIF_26 +j label_ENDIF_26 +label_FALSEIF_25: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_16 = 0 + li $t2, 0 + sw $t2, -68($fp) + label_ENDIF_26: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_2 = local_cell_at_next_evolution_at_CellularAutomaton_internal_3 + local_cell_at_next_evolution_at_CellularAutomaton_internal_16 +lw $t2, -16($fp) +lw $t3, -68($fp) +add $t2, $t2, $t3 +sw $t2, -12($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = local_cell_at_next_evolution_at_CellularAutomaton_internal_2 - 1 +lw $t2, -12($fp) +sub $t2, $t2, 1 +sw $t2, -8($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_TRUE_15 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_TRUE_15 +lw $t2, -8($fp) +beq $t2, 0, label_TRUE_15 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = 0 +li $t2, 0 +sw $t2, -8($fp) +# GOTO label_END_16 +j label_END_16 +label_TRUE_15: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = 1 + li $t2, 1 + sw $t2, -8($fp) + label_END_16: +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_13 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_13 +lw $t2, -8($fp) +beq $t2, 0, label_FALSEIF_13 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t2, String +sw $t2, 0($v0) +la $t2, String_start +sw $t2, 4($v0) +# Load type offset +li $t2, 8 +sw $t2, 8($v0) +la $t2, data_9 +sw $t2, 12($v0) +li $t2, 1 +sw $t2, 16($v0) +sw $v0, -92($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_0 = local_cell_at_next_evolution_at_CellularAutomaton_internal_22 +lw $t2, -92($fp) +sw $t2, -4($fp) +# GOTO label_ENDIF_14 +j label_ENDIF_14 +label_FALSEIF_13: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_10 + sw $t2, 12($v0) + li $t2, 1 + sw $t2, 16($v0) + sw $v0, -96($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_0 = local_cell_at_next_evolution_at_CellularAutomaton_internal_23 + lw $t2, -96($fp) + sw $t2, -4($fp) + label_ENDIF_14: +# RETURN local_cell_at_next_evolution_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 104 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_evolve_at_CellularAutomaton implementation. +# @Params: +function_evolve_at_CellularAutomaton: + # Allocate stack frame for function function_evolve_at_CellularAutomaton. + subu $sp, $sp, 64 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 64 + # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) + # local_evolve_at_CellularAutomaton_position_0 = 0 + li $t2, 0 + sw $t2, -4($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) + # local_evolve_at_CellularAutomaton_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) + # local_evolve_at_CellularAutomaton_internal_2 = local_evolve_at_CellularAutomaton_internal_4 + lw $t2, -20($fp) + sw $t2, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_evolve_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) + # local_evolve_at_CellularAutomaton_internal_3 = VCALL local_evolve_at_CellularAutomaton_internal_2 num_cells + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t2, 4($s1) + # Get pointer to type's VTABLE + lw $t3, 0($t2) + # Get pointer to function address + lw $t4, 36($t3) + # Call function. Result is on $v0 + jalr $t4 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) + # local_evolve_at_CellularAutomaton_num_1 = local_evolve_at_CellularAutomaton_internal_3 + lw $t2, -16($fp) + sw $t2, -8($fp) + # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, data_0 + sw $t2, 12($v0) + li $t2, 0 + sw $t2, 16($v0) + sw $v0, -24($fp) + label_WHILE_29: + # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) + # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) + # local_evolve_at_CellularAutomaton_internal_6 = local_evolve_at_CellularAutomaton_position_0 - local_evolve_at_CellularAutomaton_num_1 + lw $t2, -4($fp) + lw $t3, -8($fp) + sub $t2, $t2, $t3 + sw $t2, -28($fp) + # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_31 + # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_31 + lw $t2, -28($fp) + bgt $t2, 0, label_FALSE_31 + # IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_31 + # IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_31 + lw $t2, -28($fp) + beq $t2, 0, label_FALSE_31 + # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) + # local_evolve_at_CellularAutomaton_internal_6 = 1 + li $t2, 1 + sw $t2, -28($fp) + # GOTO label_END_32 +j label_END_32 +label_FALSE_31: + # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) + # local_evolve_at_CellularAutomaton_internal_6 = 0 + li $t2, 0 + sw $t2, -28($fp) + label_END_32: +# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_30 +# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_30 +lw $t2, -28($fp) +beq $t2, 0, label_WHILE_END_30 +# LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) +# local_evolve_at_CellularAutomaton_internal_7 = local_evolve_at_CellularAutomaton_temp_5 +lw $t2, -24($fp) +sw $t2, -32($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) +# local_evolve_at_CellularAutomaton_internal_11 = SELF +sw $s1, -48($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) +# local_evolve_at_CellularAutomaton_internal_9 = local_evolve_at_CellularAutomaton_internal_11 +lw $t2, -48($fp) +sw $t2, -40($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_evolve_at_CellularAutomaton_position_0 +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +lw $t2, -4($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t2, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) +# local_evolve_at_CellularAutomaton_internal_10 = VCALL local_evolve_at_CellularAutomaton_internal_9 cell_at_next_evolution +# Save new self pointer in $s1 +lw $s1, -40($fp) +# Get pointer to type +lw $t2, 4($s1) +# Get pointer to type's VTABLE +lw $t3, 0($t2) +# Get pointer to function address +lw $t4, 52($t3) +# Call function. Result is on $v0 +jalr $t4 +sw $v0, -44($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_evolve_at_CellularAutomaton_internal_10 +# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) +lw $t2, -44($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t2, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) +# local_evolve_at_CellularAutomaton_internal_8 = VCALL local_evolve_at_CellularAutomaton_internal_7 concat +# Save new self pointer in $s1 +lw $s1, -32($fp) +# Get pointer to type +lw $t2, 4($s1) +# Get pointer to type's VTABLE +lw $t3, 0($t2) +# Get pointer to function address +lw $t4, 12($t3) +# Call function. Result is on $v0 +jalr $t4 +sw $v0, -36($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) +# local_evolve_at_CellularAutomaton_temp_5 = local_evolve_at_CellularAutomaton_internal_8 +lw $t2, -36($fp) +sw $t2, -24($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +# local_evolve_at_CellularAutomaton_internal_12 = local_evolve_at_CellularAutomaton_position_0 + 1 +lw $t2, -4($fp) +add $t2, $t2, 1 +sw $t2, -52($fp) +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) +# local_evolve_at_CellularAutomaton_position_0 = local_evolve_at_CellularAutomaton_internal_12 +lw $t2, -52($fp) +sw $t2, -4($fp) +# GOTO label_WHILE_29 +j label_WHILE_29 +label_WHILE_END_30: + # + # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) + lw $t2, -24($fp) + sw $t2, 12($s1) + # LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) + # local_evolve_at_CellularAutomaton_internal_13 = SELF + sw $s1, -56($fp) + # RETURN local_evolve_at_CellularAutomaton_internal_13 + lw $v0, -56($fp) + # Deallocate stack frame for function function_evolve_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 64 + jr $ra + # Function END + diff --git a/tests/codegen/complex.mips b/tests/codegen/complex.mips index 3da63417..f27d7374 100644 --- a/tests/codegen/complex.mips +++ b/tests/codegen/complex.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:24 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:11 2020 # School of Math and Computer Science, University of Havana # @@ -13,10 +13,10 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END -Main: .asciiz "Main" -# Function END Complex: .asciiz "Complex" # Function END +Main: .asciiz "Main" +# Function END # @@ -76,31 +76,31 @@ Bool_end: # -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +# **** VTABLE for type Complex **** +Complex_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Complex, function_print_at_Complex, function_reflect_0_at_Complex, function_reflect_X_at_Complex, function_reflect_Y_at_Complex # Function END # -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable +# **** Type RECORD for type Complex **** +Complex_start: + Complex_vtable_pointer: .word Complex_vtable # Function END -Main_end: +Complex_end: # -# **** VTABLE for type Complex **** -Complex_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Complex, function_print_at_Complex, function_reflect_0_at_Complex, function_reflect_X_at_Complex, function_reflect_Y_at_Complex +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main # Function END # -# **** Type RECORD for type Complex **** -Complex_start: - Complex_vtable_pointer: .word Complex_vtable +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable # Function END -Complex_end: +Main_end: # @@ -120,24 +120,24 @@ IO__TDT: .word 0, -1, -1, -1, 1, 1 Object__TDT: .word 1, 0, 1, 1, 2, 2 String__TDT: .word -1, -1, 0, -1, -1, -1 Bool__TDT: .word -1, -1, -1, 0, -1, -1 -Main__TDT: .word -1, -1, -1, -1, 0, -1 -Complex__TDT: .word -1, -1, -1, -1, -1, 0 +Complex__TDT: .word -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0 # -data_4: .asciiz "=)\n" +data_4: .asciiz "+" # -data_5: .asciiz "=(\n" +data_5: .asciiz "I" # -data_6: .asciiz "+" +data_6: .asciiz "=)\n" # -data_7: .asciiz "I" +data_7: .asciiz "=(\n" # @@ -382,7 +382,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -580,7 +580,7 @@ entry: la $t2, Main_start sw $t2, 4($v0) # Load type offset - li $t2, 16 + li $t2, 20 sw $t2, 8($v0) move $t1, $v0 # Push register s1 into stack @@ -618,737 +618,957 @@ entry: # Function END -# function_main_at_Main implementation. +# __Complex__attrib__x__init implementation. # @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. +__Complex__attrib__x__init: + # Allocate stack frame for function __Complex__attrib__x__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Complex__attrib__x__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Complex__attrib__y__init implementation. +# @Params: +__Complex__attrib__y__init: + # Allocate stack frame for function __Complex__attrib__y__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Complex__attrib__y__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Complex implementation. +# @Params: +# 0($fp) = param_init_at_Complex_a_0 +# 4($fp) = param_init_at_Complex_b_1 +function_init_at_Complex: + # Allocate stack frame for function function_init_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_init_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + lw $t1, 12($s1) + sw $t1, -8($fp) + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + # local_init_at_Complex_internal_0 = local_init_at_Complex_internal_1 - PARAM param_init_at_Complex_a_0 + lw $t1, -8($fp) + lw $t2, 4($fp) + sub $t1, $t1, $t2 + sw $t1, -4($fp) + # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_1 + # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_1 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_1 + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # local_init_at_Complex_internal_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # GOTO label_END_2 +j label_END_2 +label_TRUE_1: + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # local_init_at_Complex_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + label_END_2: +# local_init_at_Complex_internal_3 = GETATTRIBUTE y Complex +# LOCAL local_init_at_Complex_internal_3 --> -16($fp) +lw $t1, 16($s1) +sw $t1, -16($fp) +# LOCAL local_init_at_Complex_internal_2 --> -12($fp) +# LOCAL local_init_at_Complex_internal_3 --> -16($fp) +# PARAM param_init_at_Complex_b_1 --> 0($fp) +# local_init_at_Complex_internal_2 = local_init_at_Complex_internal_3 - PARAM param_init_at_Complex_b_1 +lw $t1, -16($fp) +lw $t2, 0($fp) +sub $t1, $t1, $t2 +sw $t1, -12($fp) +# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_3 +# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_3 +lw $t1, -12($fp) +beq $t1, 0, label_TRUE_3 +# LOCAL local_init_at_Complex_internal_2 --> -12($fp) +# local_init_at_Complex_internal_2 = 0 +li $t1, 0 +sw $t1, -12($fp) +# GOTO label_END_4 +j label_END_4 +label_TRUE_3: + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # local_init_at_Complex_internal_2 = 1 + li $t1, 1 + sw $t1, -12($fp) + label_END_4: +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# local_init_at_Complex_internal_4 = SELF +sw $s1, -20($fp) +# RETURN local_init_at_Complex_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_init_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +# Deallocate function args +addu $sp, $sp, 8 +jr $ra +# Function END + + +# function_print_at_Complex implementation. +# @Params: +function_print_at_Complex: + # Allocate stack frame for function function_print_at_Complex. subu $sp, $sp, 88 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 88 - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_c_0 = ALLOCATE Complex - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Complex - sw $t3, 12($v0) - li $t3, 7 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Complex_start - sw $t3, 4($v0) - # Load type offset - li $t3, 20 - sw $t3, 8($v0) - move $t2, $v0 + # local_print_at_Complex_internal_2 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_2 --> -12($fp) + lw $t1, 16($s1) + sw $t1, -12($fp) + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # LOCAL local_print_at_Complex_internal_2 --> -12($fp) + # local_print_at_Complex_internal_1 = local_print_at_Complex_internal_2 - 0 + lw $t1, -12($fp) + sub $t1, $t1, 0 + sw $t1, -8($fp) + # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_7 + # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_7 + lw $t1, -8($fp) + beq $t1, 0, label_TRUE_7 + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # local_print_at_Complex_internal_1 = 0 + li $t1, 0 + sw $t1, -8($fp) + # GOTO label_END_8 +j label_END_8 +label_TRUE_7: + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # local_print_at_Complex_internal_1 = 1 + li $t1, 1 + sw $t1, -8($fp) + label_END_8: +# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_5 +# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_5 +lw $t1, -8($fp) +beq $t1, 0, label_FALSEIF_5 +# LOCAL local_print_at_Complex_internal_5 --> -24($fp) +# local_print_at_Complex_internal_5 = SELF +sw $s1, -24($fp) +# LOCAL local_print_at_Complex_internal_3 --> -16($fp) +# LOCAL local_print_at_Complex_internal_5 --> -24($fp) +# local_print_at_Complex_internal_3 = local_print_at_Complex_internal_5 +lw $t1, -24($fp) +sw $t1, -16($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_print_at_Complex_internal_6 = GETATTRIBUTE x Complex +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +lw $t1, 12($s1) +sw $t1, -28($fp) +# ARG local_print_at_Complex_internal_6 +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +lw $t1, -28($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +# LOCAL local_print_at_Complex_internal_3 --> -16($fp) +# LOCAL local_print_at_Complex_internal_4 --> -20($fp) +# local_print_at_Complex_internal_4 = VCALL local_print_at_Complex_internal_3 out_int +# Save new self pointer in $s1 +lw $s1, -16($fp) +# Get pointer to type +lw $t1, 4($s1) +# Get pointer to type's VTABLE +lw $t2, 0($t1) +# Get pointer to function address +lw $t3, 16($t2) +# Call function. Result is on $v0 +jalr $t3 +sw $v0, -20($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_print_at_Complex_internal_0 --> -4($fp) +# LOCAL local_print_at_Complex_internal_4 --> -20($fp) +# local_print_at_Complex_internal_0 = local_print_at_Complex_internal_4 +lw $t1, -20($fp) +sw $t1, -4($fp) +# GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_13 = local_print_at_Complex_internal_15 + lw $t1, -64($fp) + sw $t1, -56($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - move $s1, $v0 - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Complex__attrib__x__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t2) - # Push register t2 into stack + # local_print_at_Complex_internal_16 = GETATTRIBUTE x Complex + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + lw $t1, 12($s1) + sw $t1, -68($fp) + # ARG local_print_at_Complex_internal_16 + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + lw $t1, -68($fp) + # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Complex__attrib__y__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t2) + sw $t1, 0($sp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # LOCAL local_print_at_Complex_internal_14 --> -60($fp) + # local_print_at_Complex_internal_14 = VCALL local_print_at_Complex_internal_13 out_int + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t1, 4($s1) + # Get pointer to type's VTABLE + lw $t2, 0($t1) + # Get pointer to function address + lw $t3, 16($t2) + # Call function. Result is on $v0 + jalr $t3 + sw $v0, -60($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t2, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = ALLOCATE Complex + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # LOCAL local_print_at_Complex_internal_14 --> -60($fp) + # local_print_at_Complex_internal_11 = local_print_at_Complex_internal_14 + lw $t1, -60($fp) + sw $t1, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Complex - sw $t4, 12($v0) - li $t4, 7 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, Complex_start - sw $t4, 4($v0) - # Load type offset - li $t4, 20 - sw $t4, 8($v0) - move $t3, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Complex__attrib__x__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t3) - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Complex__attrib__y__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t3) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t3, -16($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t3, -16($fp) - sw $t3, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 1 - li $t3, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # ARG 1 - li $t3, 1 + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_4 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -72($fp) + # ARG local_print_at_Complex_internal_17 + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + lw $t1, -72($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 28($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_c_0 = local_main_at_Main_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_internal_8 = local_main_at_Main_c_0 - lw $t3, -4($fp) - sw $t3, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 reflect_X + sw $t1, 0($sp) + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # LOCAL local_print_at_Complex_internal_12 --> -52($fp) + # local_print_at_Complex_internal_12 = VCALL local_print_at_Complex_internal_11 out_string # Save new self pointer in $s1 - lw $s1, -36($fp) + lw $s1, -48($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 40($t4) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -40($fp) + jalr $t3 + sw $v0, -52($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_9 - lw $t3, -40($fp) - sw $t3, -28($fp) + # LOCAL local_print_at_Complex_internal_9 --> -40($fp) + # LOCAL local_print_at_Complex_internal_12 --> -52($fp) + # local_print_at_Complex_internal_9 = local_print_at_Complex_internal_12 + lw $t1, -52($fp) + sw $t1, -40($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 reflect_Y - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 44($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_internal_10 = local_main_at_Main_c_0 - lw $t3, -4($fp) - sw $t3, -44($fp) - # Push register s1 into stack + # local_print_at_Complex_internal_18 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + lw $t1, 16($s1) + sw $t1, -76($fp) + # ARG local_print_at_Complex_internal_18 + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + lw $t1, -76($fp) + # Push arg into stack subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 reflect_0 + sw $t1, 0($sp) + # LOCAL local_print_at_Complex_internal_9 --> -40($fp) + # LOCAL local_print_at_Complex_internal_10 --> -44($fp) + # local_print_at_Complex_internal_10 = VCALL local_print_at_Complex_internal_9 out_int # Save new self pointer in $s1 - lw $s1, -44($fp) + lw $s1, -40($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 36($t4) + lw $t3, 16($t2) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -48($fp) + jalr $t3 + sw $v0, -44($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_5 = local_main_at_Main_internal_7 - local_main_at_Main_internal_11 - lw $t3, -32($fp) - lw $t4, -48($fp) - sub $t3, $t3, $t4 - sw $t3, -24($fp) - # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_3 - # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_3 - lw $t3, -24($fp) - beq $t3, 0, label_TRUE_3 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = 0 - li $t3, 0 - sw $t3, -24($fp) - # GOTO label_END_4 -j label_END_4 -label_TRUE_3: - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = 1 - li $t3, 1 - sw $t3, -24($fp) - label_END_4: -# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_1 -# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_1 -lw $t3, -24($fp) -beq $t3, 0, label_FALSEIF_1 -# LOCAL local_main_at_Main_internal_14 --> -60($fp) -# local_main_at_Main_internal_14 = SELF -sw $s1, -60($fp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# LOCAL local_main_at_Main_internal_14 --> -60($fp) -# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 -lw $t3, -60($fp) -sw $t3, -52($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_15 --> -64($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t3, String -sw $t3, 0($v0) -la $t3, String_start -sw $t3, 4($v0) -# Load type offset -li $t3, 8 -sw $t3, 8($v0) -la $t3, data_4 -sw $t3, 12($v0) -li $t3, 3 -sw $t3, 16($v0) -sw $v0, -64($fp) -# ARG local_main_at_Main_internal_15 -# LOCAL local_main_at_Main_internal_15 --> -64($fp) -lw $t3, -64($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string -# Save new self pointer in $s1 -lw $s1, -52($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 12($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -56($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_4 --> -20($fp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# local_main_at_Main_internal_4 = local_main_at_Main_internal_13 -lw $t3, -56($fp) -sw $t3, -20($fp) -# GOTO label_ENDIF_2 -j label_ENDIF_2 -label_FALSEIF_1: - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 - lw $t3, -76($fp) - sw $t3, -68($fp) + # LOCAL local_print_at_Complex_internal_7 --> -32($fp) + # LOCAL local_print_at_Complex_internal_10 --> -44($fp) + # local_print_at_Complex_internal_7 = local_print_at_Complex_internal_10 + lw $t1, -44($fp) + sw $t1, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_5 - sw $t3, 12($v0) - li $t3, 3 - sw $t3, 16($v0) + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_5 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) sw $v0, -80($fp) - # ARG local_main_at_Main_internal_19 - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - lw $t3, -80($fp) + # ARG local_print_at_Complex_internal_19 + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + lw $t1, -80($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string + sw $t1, 0($sp) + # LOCAL local_print_at_Complex_internal_7 --> -32($fp) + # LOCAL local_print_at_Complex_internal_8 --> -36($fp) + # local_print_at_Complex_internal_8 = VCALL local_print_at_Complex_internal_7 out_string # Save new self pointer in $s1 - lw $s1, -68($fp) + lw $s1, -32($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t2, 0($t1) # Get pointer to function address - lw $t5, 12($t4) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -72($fp) + jalr $t3 + sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_4 = local_main_at_Main_internal_17 - lw $t3, -72($fp) - sw $t3, -20($fp) - label_ENDIF_2: -# RETURN local_main_at_Main_internal_4 -lw $v0, -20($fp) -# Deallocate stack frame for function function_main_at_Main. + # LOCAL local_print_at_Complex_internal_0 --> -4($fp) + # LOCAL local_print_at_Complex_internal_8 --> -36($fp) + # local_print_at_Complex_internal_0 = local_print_at_Complex_internal_8 + lw $t1, -36($fp) + sw $t1, -4($fp) + label_ENDIF_6: +# RETURN local_print_at_Complex_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_print_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +jr $ra +# Function END + + +# function_reflect_0_at_Complex implementation. +# @Params: +function_reflect_0_at_Complex: + # Allocate stack frame for function function_reflect_0_at_Complex. + subu $sp, $sp, 44 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 44 + # local_reflect_0_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + lw $t1, 12($s1) + sw $t1, -8($fp) + # local_reflect_0_at_Complex_internal_3 = GETATTRIBUTE x Complex + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + lw $t1, 12($s1) + sw $t1, -16($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + lw $t1, -16($fp) + not $t1, $t1 + sw $t1, -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # local_reflect_0_at_Complex_internal_0 = local_reflect_0_at_Complex_internal_1 - local_reflect_0_at_Complex_internal_2 + lw $t1, -8($fp) + lw $t2, -12($fp) + sub $t1, $t1, $t2 + sw $t1, -4($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_9 + # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_9 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_9 + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # local_reflect_0_at_Complex_internal_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # GOTO label_END_10 +j label_END_10 +label_TRUE_9: + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # local_reflect_0_at_Complex_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + label_END_10: +# local_reflect_0_at_Complex_internal_5 = GETATTRIBUTE y Complex +# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) +lw $t1, 16($s1) +sw $t1, -24($fp) +# local_reflect_0_at_Complex_internal_7 = GETATTRIBUTE y Complex +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +lw $t1, 16($s1) +sw $t1, -32($fp) +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +lw $t1, -32($fp) +not $t1, $t1 +sw $t1, -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) +# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# local_reflect_0_at_Complex_internal_4 = local_reflect_0_at_Complex_internal_5 - local_reflect_0_at_Complex_internal_6 +lw $t1, -24($fp) +lw $t2, -28($fp) +sub $t1, $t1, $t2 +sw $t1, -20($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_11 +# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_11 +lw $t1, -20($fp) +beq $t1, 0, label_TRUE_11 +# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) +# local_reflect_0_at_Complex_internal_4 = 0 +li $t1, 0 +sw $t1, -20($fp) +# GOTO label_END_12 +j label_END_12 +label_TRUE_11: + # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) + # local_reflect_0_at_Complex_internal_4 = 1 + li $t1, 1 + sw $t1, -20($fp) + label_END_12: +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# local_reflect_0_at_Complex_internal_8 = SELF +sw $s1, -36($fp) +# RETURN local_reflect_0_at_Complex_internal_8 +lw $v0, -36($fp) +# Deallocate stack frame for function function_reflect_0_at_Complex. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 88 +addu $sp, $sp, 44 jr $ra # Function END -# __Complex__attrib__x__init implementation. -# @Params: -__Complex__attrib__x__init: - # Allocate stack frame for function __Complex__attrib__x__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Complex__attrib__x__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Complex__attrib__y__init implementation. +# function_reflect_X_at_Complex implementation. # @Params: -__Complex__attrib__y__init: - # Allocate stack frame for function __Complex__attrib__y__init. +function_reflect_X_at_Complex: + # Allocate stack frame for function function_reflect_X_at_Complex. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Complex__attrib__y__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END + # local_reflect_X_at_Complex_internal_1 = GETATTRIBUTE y Complex + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + lw $t1, 16($s1) + sw $t1, -8($fp) + # local_reflect_X_at_Complex_internal_3 = GETATTRIBUTE y Complex + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + lw $t1, 16($s1) + sw $t1, -16($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + lw $t1, -16($fp) + not $t1, $t1 + sw $t1, -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # local_reflect_X_at_Complex_internal_0 = local_reflect_X_at_Complex_internal_1 - local_reflect_X_at_Complex_internal_2 + lw $t1, -8($fp) + lw $t2, -12($fp) + sub $t1, $t1, $t2 + sw $t1, -4($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_13 + # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_13 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_13 + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # local_reflect_X_at_Complex_internal_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # GOTO label_END_14 +j label_END_14 +label_TRUE_13: + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # local_reflect_X_at_Complex_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + label_END_14: +# LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) +# local_reflect_X_at_Complex_internal_4 = SELF +sw $s1, -20($fp) +# RETURN local_reflect_X_at_Complex_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function function_reflect_X_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +jr $ra +# Function END -# function_init_at_Complex implementation. +# function_reflect_Y_at_Complex implementation. # @Params: -# 0($fp) = param_init_at_Complex_a_0 -# 4($fp) = param_init_at_Complex_b_1 -function_init_at_Complex: - # Allocate stack frame for function function_init_at_Complex. +function_reflect_Y_at_Complex: + # Allocate stack frame for function function_reflect_Y_at_Complex. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_init_at_Complex_internal_1 = GETATTRIBUTE x Complex - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - lw $t3, 12($s1) - sw $t3, -8($fp) - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - # PARAM param_init_at_Complex_a_0 --> 4($fp) - # local_init_at_Complex_internal_0 = local_init_at_Complex_internal_1 - PARAM param_init_at_Complex_a_0 - lw $t3, -8($fp) - lw $t4, 4($fp) - sub $t3, $t3, $t4 - sw $t3, -4($fp) - # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_5 - # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_5 - lw $t3, -4($fp) - beq $t3, 0, label_TRUE_5 - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # local_init_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - # GOTO label_END_6 -j label_END_6 -label_TRUE_5: - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # local_init_at_Complex_internal_0 = 1 - li $t3, 1 - sw $t3, -4($fp) - label_END_6: -# local_init_at_Complex_internal_3 = GETATTRIBUTE y Complex -# LOCAL local_init_at_Complex_internal_3 --> -16($fp) -lw $t3, 16($s1) -sw $t3, -16($fp) -# LOCAL local_init_at_Complex_internal_2 --> -12($fp) -# LOCAL local_init_at_Complex_internal_3 --> -16($fp) -# PARAM param_init_at_Complex_b_1 --> 0($fp) -# local_init_at_Complex_internal_2 = local_init_at_Complex_internal_3 - PARAM param_init_at_Complex_b_1 -lw $t3, -16($fp) -lw $t4, 0($fp) -sub $t3, $t3, $t4 -sw $t3, -12($fp) -# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_7 -# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_7 -lw $t3, -12($fp) -beq $t3, 0, label_TRUE_7 -# LOCAL local_init_at_Complex_internal_2 --> -12($fp) -# local_init_at_Complex_internal_2 = 0 -li $t3, 0 -sw $t3, -12($fp) -# GOTO label_END_8 -j label_END_8 -label_TRUE_7: - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # local_init_at_Complex_internal_2 = 1 - li $t3, 1 - sw $t3, -12($fp) - label_END_8: -# LOCAL local_init_at_Complex_internal_4 --> -20($fp) -# local_init_at_Complex_internal_4 = SELF + # local_reflect_Y_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + lw $t1, 12($s1) + sw $t1, -8($fp) + # local_reflect_Y_at_Complex_internal_3 = GETATTRIBUTE x Complex + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + lw $t1, 12($s1) + sw $t1, -16($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + lw $t1, -16($fp) + not $t1, $t1 + sw $t1, -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # local_reflect_Y_at_Complex_internal_0 = local_reflect_Y_at_Complex_internal_1 - local_reflect_Y_at_Complex_internal_2 + lw $t1, -8($fp) + lw $t2, -12($fp) + sub $t1, $t1, $t2 + sw $t1, -4($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_15 + # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_15 + lw $t1, -4($fp) + beq $t1, 0, label_TRUE_15 + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # local_reflect_Y_at_Complex_internal_0 = 0 + li $t1, 0 + sw $t1, -4($fp) + # GOTO label_END_16 +j label_END_16 +label_TRUE_15: + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # local_reflect_Y_at_Complex_internal_0 = 1 + li $t1, 1 + sw $t1, -4($fp) + label_END_16: +# LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) +# local_reflect_Y_at_Complex_internal_4 = SELF sw $s1, -20($fp) -# RETURN local_init_at_Complex_internal_4 +# RETURN local_reflect_Y_at_Complex_internal_4 lw $v0, -20($fp) -# Deallocate stack frame for function function_init_at_Complex. +# Deallocate stack frame for function function_reflect_Y_at_Complex. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp addu $sp, $sp, 32 -# Deallocate function args -addu $sp, $sp, 8 jr $ra # Function END -# function_print_at_Complex implementation. +# function_main_at_Main implementation. # @Params: -function_print_at_Complex: - # Allocate stack frame for function function_print_at_Complex. +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. subu $sp, $sp, 88 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 88 - # local_print_at_Complex_internal_2 = GETATTRIBUTE y Complex - # LOCAL local_print_at_Complex_internal_2 --> -12($fp) - lw $t3, 16($s1) - sw $t3, -12($fp) - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # LOCAL local_print_at_Complex_internal_2 --> -12($fp) - # local_print_at_Complex_internal_1 = local_print_at_Complex_internal_2 - 0 - lw $t3, -12($fp) - sub $t3, $t3, 0 - sw $t3, -8($fp) - # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_11 - # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_11 - lw $t3, -8($fp) - beq $t3, 0, label_TRUE_11 - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # local_print_at_Complex_internal_1 = 0 - li $t3, 0 - sw $t3, -8($fp) - # GOTO label_END_12 -j label_END_12 -label_TRUE_11: - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # local_print_at_Complex_internal_1 = 1 - li $t3, 1 + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_c_0 = ALLOCATE Complex + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Complex + sw $t3, 12($v0) + li $t3, 7 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Complex_start + sw $t3, 4($v0) + # Load type offset + li $t3, 16 + sw $t3, 8($v0) + move $t2, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Complex__attrib__x__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t2) + # Push register t2 into stack + subu $sp, $sp, 4 + sw $t2, 0($sp) + jal __Complex__attrib__y__init + # Pop 4 bytes from stack into register t2 + lw $t2, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t2) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t2, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE Complex + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Complex + sw $t4, 12($v0) + li $t4, 7 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Complex_start + sw $t4, 4($v0) + # Load type offset + li $t4, 16 + sw $t4, 8($v0) + move $t3, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Complex__attrib__x__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t3) + # Push register t3 into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + jal __Complex__attrib__y__init + # Pop 4 bytes from stack into register t3 + lw $t3, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t3) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t3, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t3, -16($fp) sw $t3, -8($fp) - label_END_12: -# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_9 -# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_9 -lw $t3, -8($fp) -beq $t3, 0, label_FALSEIF_9 -# LOCAL local_print_at_Complex_internal_5 --> -24($fp) -# local_print_at_Complex_internal_5 = SELF -sw $s1, -24($fp) -# LOCAL local_print_at_Complex_internal_3 --> -16($fp) -# LOCAL local_print_at_Complex_internal_5 --> -24($fp) -# local_print_at_Complex_internal_3 = local_print_at_Complex_internal_5 -lw $t3, -24($fp) -sw $t3, -16($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_print_at_Complex_internal_6 = GETATTRIBUTE x Complex -# LOCAL local_print_at_Complex_internal_6 --> -28($fp) -lw $t3, 12($s1) -sw $t3, -28($fp) -# ARG local_print_at_Complex_internal_6 -# LOCAL local_print_at_Complex_internal_6 --> -28($fp) -lw $t3, -28($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_print_at_Complex_internal_3 --> -16($fp) -# LOCAL local_print_at_Complex_internal_4 --> -20($fp) -# local_print_at_Complex_internal_4 = VCALL local_print_at_Complex_internal_3 out_int -# Save new self pointer in $s1 -lw $s1, -16($fp) -# Get pointer to type -lw $t3, 4($s1) -# Get pointer to type's VTABLE -lw $t4, 0($t3) -# Get pointer to function address -lw $t5, 16($t4) -# Call function. Result is on $v0 -jalr $t5 -sw $v0, -20($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_print_at_Complex_internal_0 --> -4($fp) -# LOCAL local_print_at_Complex_internal_4 --> -20($fp) -# local_print_at_Complex_internal_0 = local_print_at_Complex_internal_4 -lw $t3, -20($fp) -sw $t3, -4($fp) -# GOTO label_ENDIF_10 -j label_ENDIF_10 -label_FALSEIF_9: - # LOCAL local_print_at_Complex_internal_15 --> -64($fp) - # local_print_at_Complex_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_print_at_Complex_internal_13 --> -56($fp) - # LOCAL local_print_at_Complex_internal_15 --> -64($fp) - # local_print_at_Complex_internal_13 = local_print_at_Complex_internal_15 - lw $t3, -64($fp) - sw $t3, -56($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_print_at_Complex_internal_16 = GETATTRIBUTE x Complex - # LOCAL local_print_at_Complex_internal_16 --> -68($fp) - lw $t3, 12($s1) - sw $t3, -68($fp) - # ARG local_print_at_Complex_internal_16 - # LOCAL local_print_at_Complex_internal_16 --> -68($fp) - lw $t3, -68($fp) + # ARG 1 + li $t3, 1 # Push arg into stack subu $sp, $sp, 4 sw $t3, 0($sp) - # LOCAL local_print_at_Complex_internal_13 --> -56($fp) - # LOCAL local_print_at_Complex_internal_14 --> -60($fp) - # local_print_at_Complex_internal_14 = VCALL local_print_at_Complex_internal_13 out_int + # ARG 1 + li $t3, 1 + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init # Save new self pointer in $s1 - lw $s1, -56($fp) + lw $s1, -8($fp) # Get pointer to type lw $t3, 4($s1) # Get pointer to type's VTABLE lw $t4, 0($t3) # Get pointer to function address - lw $t5, 16($t4) + lw $t5, 28($t4) # Call function. Result is on $v0 jalr $t5 - sw $v0, -60($fp) + sw $v0, -12($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_11 --> -48($fp) - # LOCAL local_print_at_Complex_internal_14 --> -60($fp) - # local_print_at_Complex_internal_11 = local_print_at_Complex_internal_14 - lw $t3, -60($fp) - sw $t3, -48($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_c_0 = local_main_at_Main_internal_2 + lw $t3, -12($fp) + sw $t3, -4($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_internal_8 = local_main_at_Main_c_0 + lw $t3, -4($fp) + sw $t3, -36($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_at_Complex_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_6 - sw $t3, 12($v0) - li $t3, 1 - sw $t3, 16($v0) - sw $v0, -72($fp) - # ARG local_print_at_Complex_internal_17 - # LOCAL local_print_at_Complex_internal_17 --> -72($fp) - lw $t3, -72($fp) - # Push arg into stack + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 reflect_X + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 40($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_9 + lw $t3, -40($fp) + sw $t3, -28($fp) + # Push register s1 into stack subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_print_at_Complex_internal_11 --> -48($fp) - # LOCAL local_print_at_Complex_internal_12 --> -52($fp) - # local_print_at_Complex_internal_12 = VCALL local_print_at_Complex_internal_11 out_string + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 reflect_Y # Save new self pointer in $s1 - lw $s1, -48($fp) + lw $s1, -28($fp) # Get pointer to type lw $t3, 4($s1) # Get pointer to type's VTABLE lw $t4, 0($t3) # Get pointer to function address - lw $t5, 12($t4) + lw $t5, 44($t4) # Call function. Result is on $v0 jalr $t5 - sw $v0, -52($fp) + sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_9 --> -40($fp) - # LOCAL local_print_at_Complex_internal_12 --> -52($fp) - # local_print_at_Complex_internal_9 = local_print_at_Complex_internal_12 - lw $t3, -52($fp) - sw $t3, -40($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_c_0 + lw $t3, -4($fp) + sw $t3, -44($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_print_at_Complex_internal_18 = GETATTRIBUTE y Complex - # LOCAL local_print_at_Complex_internal_18 --> -76($fp) - lw $t3, 16($s1) - sw $t3, -76($fp) - # ARG local_print_at_Complex_internal_18 - # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 reflect_0 + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 36($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_5 = local_main_at_Main_internal_7 - local_main_at_Main_internal_11 + lw $t3, -32($fp) + lw $t4, -48($fp) + sub $t3, $t3, $t4 + sw $t3, -24($fp) + # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_19 + # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_19 + lw $t3, -24($fp) + beq $t3, 0, label_TRUE_19 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = 0 + li $t3, 0 + sw $t3, -24($fp) + # GOTO label_END_20 +j label_END_20 +label_TRUE_19: + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = 1 + li $t3, 1 + sw $t3, -24($fp) + label_END_20: +# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_17 +# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_17 +lw $t3, -24($fp) +beq $t3, 0, label_FALSEIF_17 +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# local_main_at_Main_internal_14 = SELF +sw $s1, -60($fp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 +lw $t3, -60($fp) +sw $t3, -52($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t3, String +sw $t3, 0($v0) +la $t3, String_start +sw $t3, 4($v0) +# Load type offset +li $t3, 8 +sw $t3, 8($v0) +la $t3, data_6 +sw $t3, 12($v0) +li $t3, 3 +sw $t3, 16($v0) +sw $v0, -64($fp) +# ARG local_main_at_Main_internal_15 +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +lw $t3, -64($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t3, 0($sp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string +# Save new self pointer in $s1 +lw $s1, -52($fp) +# Get pointer to type +lw $t3, 4($s1) +# Get pointer to type's VTABLE +lw $t4, 0($t3) +# Get pointer to function address +lw $t5, 12($t4) +# Call function. Result is on $v0 +jalr $t5 +sw $v0, -56($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_4 --> -20($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_4 = local_main_at_Main_internal_13 +lw $t3, -56($fp) +sw $t3, -20($fp) +# GOTO label_ENDIF_18 +j label_ENDIF_18 +label_FALSEIF_17: + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 lw $t3, -76($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_print_at_Complex_internal_9 --> -40($fp) - # LOCAL local_print_at_Complex_internal_10 --> -44($fp) - # local_print_at_Complex_internal_10 = VCALL local_print_at_Complex_internal_9 out_int - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 16($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_7 --> -32($fp) - # LOCAL local_print_at_Complex_internal_10 --> -44($fp) - # local_print_at_Complex_internal_7 = local_print_at_Complex_internal_10 - lw $t3, -44($fp) - sw $t3, -32($fp) + sw $t3, -68($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1363,20 +1583,20 @@ label_FALSEIF_9: sw $t3, 8($v0) la $t3, data_7 sw $t3, 12($v0) - li $t3, 1 + li $t3, 3 sw $t3, 16($v0) sw $v0, -80($fp) - # ARG local_print_at_Complex_internal_19 - # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + # ARG local_main_at_Main_internal_19 + # LOCAL local_main_at_Main_internal_19 --> -80($fp) lw $t3, -80($fp) # Push arg into stack subu $sp, $sp, 4 sw $t3, 0($sp) - # LOCAL local_print_at_Complex_internal_7 --> -32($fp) - # LOCAL local_print_at_Complex_internal_8 --> -36($fp) - # local_print_at_Complex_internal_8 = VCALL local_print_at_Complex_internal_7 out_string + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string # Save new self pointer in $s1 - lw $s1, -32($fp) + lw $s1, -68($fp) # Get pointer to type lw $t3, 4($s1) # Get pointer to type's VTABLE @@ -1385,245 +1605,25 @@ label_FALSEIF_9: lw $t5, 12($t4) # Call function. Result is on $v0 jalr $t5 - sw $v0, -36($fp) + sw $v0, -72($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_0 --> -4($fp) - # LOCAL local_print_at_Complex_internal_8 --> -36($fp) - # local_print_at_Complex_internal_0 = local_print_at_Complex_internal_8 - lw $t3, -36($fp) - sw $t3, -4($fp) - label_ENDIF_10: -# RETURN local_print_at_Complex_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_print_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 88 -jr $ra -# Function END - - -# function_reflect_0_at_Complex implementation. -# @Params: -function_reflect_0_at_Complex: - # Allocate stack frame for function function_reflect_0_at_Complex. - subu $sp, $sp, 44 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 44 - # local_reflect_0_at_Complex_internal_1 = GETATTRIBUTE x Complex - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - lw $t3, 12($s1) - sw $t3, -8($fp) - # local_reflect_0_at_Complex_internal_3 = GETATTRIBUTE x Complex - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - lw $t3, 12($s1) - sw $t3, -16($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - lw $t3, -16($fp) - not $t3, $t3 - sw $t3, -12($fp) - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # local_reflect_0_at_Complex_internal_0 = local_reflect_0_at_Complex_internal_1 - local_reflect_0_at_Complex_internal_2 - lw $t3, -8($fp) - lw $t4, -12($fp) - sub $t3, $t3, $t4 - sw $t3, -4($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_13 - # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_13 - lw $t3, -4($fp) - beq $t3, 0, label_TRUE_13 - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # local_reflect_0_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - # GOTO label_END_14 -j label_END_14 -label_TRUE_13: - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # local_reflect_0_at_Complex_internal_0 = 1 - li $t3, 1 - sw $t3, -4($fp) - label_END_14: -# local_reflect_0_at_Complex_internal_5 = GETATTRIBUTE y Complex -# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) -lw $t3, 16($s1) -sw $t3, -24($fp) -# local_reflect_0_at_Complex_internal_7 = GETATTRIBUTE y Complex -# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -lw $t3, 16($s1) -sw $t3, -32($fp) -# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) -# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -lw $t3, -32($fp) -not $t3, $t3 -sw $t3, -28($fp) -# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) -# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) -# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) -# local_reflect_0_at_Complex_internal_4 = local_reflect_0_at_Complex_internal_5 - local_reflect_0_at_Complex_internal_6 -lw $t3, -24($fp) -lw $t4, -28($fp) -sub $t3, $t3, $t4 -sw $t3, -20($fp) -# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_15 -# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_15 -lw $t3, -20($fp) -beq $t3, 0, label_TRUE_15 -# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) -# local_reflect_0_at_Complex_internal_4 = 0 -li $t3, 0 -sw $t3, -20($fp) -# GOTO label_END_16 -j label_END_16 -label_TRUE_15: - # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) - # local_reflect_0_at_Complex_internal_4 = 1 - li $t3, 1 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_17 + lw $t3, -72($fp) sw $t3, -20($fp) - label_END_16: -# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) -# local_reflect_0_at_Complex_internal_8 = SELF -sw $s1, -36($fp) -# RETURN local_reflect_0_at_Complex_internal_8 -lw $v0, -36($fp) -# Deallocate stack frame for function function_reflect_0_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 44 -jr $ra -# Function END - - -# function_reflect_X_at_Complex implementation. -# @Params: -function_reflect_X_at_Complex: - # Allocate stack frame for function function_reflect_X_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_reflect_X_at_Complex_internal_1 = GETATTRIBUTE y Complex - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - lw $t3, 16($s1) - sw $t3, -8($fp) - # local_reflect_X_at_Complex_internal_3 = GETATTRIBUTE y Complex - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - lw $t3, 16($s1) - sw $t3, -16($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - lw $t3, -16($fp) - not $t3, $t3 - sw $t3, -12($fp) - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # local_reflect_X_at_Complex_internal_0 = local_reflect_X_at_Complex_internal_1 - local_reflect_X_at_Complex_internal_2 - lw $t3, -8($fp) - lw $t4, -12($fp) - sub $t3, $t3, $t4 - sw $t3, -4($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_17 - # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_17 - lw $t3, -4($fp) - beq $t3, 0, label_TRUE_17 - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # local_reflect_X_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - # GOTO label_END_18 -j label_END_18 -label_TRUE_17: - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # local_reflect_X_at_Complex_internal_0 = 1 - li $t3, 1 - sw $t3, -4($fp) - label_END_18: -# LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) -# local_reflect_X_at_Complex_internal_4 = SELF -sw $s1, -20($fp) -# RETURN local_reflect_X_at_Complex_internal_4 -lw $v0, -20($fp) -# Deallocate stack frame for function function_reflect_X_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 32 -jr $ra -# Function END - - -# function_reflect_Y_at_Complex implementation. -# @Params: -function_reflect_Y_at_Complex: - # Allocate stack frame for function function_reflect_Y_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_reflect_Y_at_Complex_internal_1 = GETATTRIBUTE x Complex - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - lw $t3, 12($s1) - sw $t3, -8($fp) - # local_reflect_Y_at_Complex_internal_3 = GETATTRIBUTE x Complex - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - lw $t3, 12($s1) - sw $t3, -16($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - lw $t3, -16($fp) - not $t3, $t3 - sw $t3, -12($fp) - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # local_reflect_Y_at_Complex_internal_0 = local_reflect_Y_at_Complex_internal_1 - local_reflect_Y_at_Complex_internal_2 - lw $t3, -8($fp) - lw $t4, -12($fp) - sub $t3, $t3, $t4 - sw $t3, -4($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_19 - # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_19 - lw $t3, -4($fp) - beq $t3, 0, label_TRUE_19 - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # local_reflect_Y_at_Complex_internal_0 = 0 - li $t3, 0 - sw $t3, -4($fp) - # GOTO label_END_20 -j label_END_20 -label_TRUE_19: - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # local_reflect_Y_at_Complex_internal_0 = 1 - li $t3, 1 - sw $t3, -4($fp) - label_END_20: -# LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) -# local_reflect_Y_at_Complex_internal_4 = SELF -sw $s1, -20($fp) -# RETURN local_reflect_Y_at_Complex_internal_4 + label_ENDIF_18: +# RETURN local_main_at_Main_internal_4 lw $v0, -20($fp) -# Deallocate stack frame for function function_reflect_Y_at_Complex. +# Deallocate stack frame for function function_main_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 32 +addu $sp, $sp, 88 jr $ra # Function END diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips index c00e99c3..85db133c 100644 --- a/tests/codegen/fib.mips +++ b/tests/codegen/fib.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:24 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:12 2020 # School of Math and Computer Science, University of Havana # @@ -357,7 +357,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/hairyscary.mips b/tests/codegen/hairyscary.mips index d6fa5178..d3b7ffc2 100644 --- a/tests/codegen/hairyscary.mips +++ b/tests/codegen/hairyscary.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 17:41:29 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:11 2020 # School of Math and Computer Science, University of Havana # @@ -421,7 +421,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -1181,10 +1181,10 @@ __Bazz__attrib__h__init: # @Params: __Bazz__attrib__g__init: # Allocate stack frame for function __Bazz__attrib__g__init. - subu $sp, $sp, 56 + subu $sp, $sp, 60 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 56 + addu $fp, $sp, 60 # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) # local_ttrib__g__init_internal_0 = SELF sw $s1, -4($fp) @@ -1195,12 +1195,12 @@ __Bazz__attrib__g__init: # Load pointer to type offset lw $t6, 8($t5) sw $t6, -8($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # local_ttrib__g__init_internal_3 = 13 - li $t5, 13 - sw $t5, -16($fp) - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bazz # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_4 = 13 + li $t5, 13 + sw $t5, -20($fp) + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bazz + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Bazz la $t5, Bazz__TDT @@ -1208,21 +1208,21 @@ __Bazz__attrib__g__init: addu $t5, $t5, $t6 # Save distance lw $t6, 0($t5) - sw $t6, -20($fp) + sw $t6, -24($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # Update min if 13 < 14 - lw $t5, -20($fp) - lw $t6, -16($fp) + lw $t5, -24($fp) + lw $t6, -20($fp) bgtu $t5, $t6, label_Not_min0_1 - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 - lw $t5, -20($fp) - sw $t5, -16($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_5 + lw $t5, -24($fp) + sw $t5, -20($fp) label_Not_min0_1: - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Razz la $t5, Razz__TDT @@ -1230,21 +1230,21 @@ __Bazz__attrib__g__init: addu $t5, $t5, $t6 # Save distance lw $t6, 0($t5) - sw $t6, -20($fp) + sw $t6, -24($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # Update min if 13 < 14 - lw $t5, -20($fp) - lw $t6, -16($fp) + lw $t5, -24($fp) + lw $t6, -20($fp) bgtu $t5, $t6, label_Not_min1_2 - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 - lw $t5, -20($fp) - sw $t5, -16($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_5 + lw $t5, -24($fp) + sw $t5, -20($fp) label_Not_min1_2: - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Foo - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Foo + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Foo la $t5, Foo__TDT @@ -1252,21 +1252,21 @@ __Bazz__attrib__g__init: addu $t5, $t5, $t6 # Save distance lw $t6, 0($t5) - sw $t6, -20($fp) + sw $t6, -24($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # Update min if 13 < 14 - lw $t5, -20($fp) - lw $t6, -16($fp) + lw $t5, -24($fp) + lw $t6, -20($fp) bgtu $t5, $t6, label_Not_min2_3 - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 - lw $t5, -20($fp) - sw $t5, -16($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_5 + lw $t5, -24($fp) + sw $t5, -20($fp) label_Not_min2_3: - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Bar la $t5, Bar__TDT @@ -1274,37 +1274,37 @@ __Bazz__attrib__g__init: addu $t5, $t5, $t6 # Save distance lw $t6, 0($t5) - sw $t6, -20($fp) + sw $t6, -24($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # Update min if 13 < 14 - lw $t5, -20($fp) - lw $t6, -16($fp) + lw $t5, -24($fp) + lw $t6, -20($fp) bgtu $t5, $t6, label_Not_min3_4 - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_4 - lw $t5, -20($fp) - sw $t5, -16($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_5 + lw $t5, -24($fp) + sw $t5, -20($fp) label_Not_min3_4: - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # local_ttrib__g__init_internal_4 = 13 + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # local_ttrib__g__init_internal_5 = 13 li $t5, 13 - sw $t5, -20($fp) + sw $t5, -24($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # local_ttrib__g__init_internal_2 = local_ttrib__g__init_internal_4 - local_ttrib__g__init_internal_3 - lw $t5, -20($fp) - lw $t6, -16($fp) + # local_ttrib__g__init_internal_2 = local_ttrib__g__init_internal_5 - local_ttrib__g__init_internal_4 + lw $t5, -24($fp) + lw $t6, -20($fp) sub $t5, $t5, $t6 sw $t5, -12($fp) # IF_ZERO local_ttrib__g__init_internal_2 GOTO label_ERROR_5 # IF_ZERO local_ttrib__g__init_internal_2 GOTO label_ERROR_5 lw $t5, -12($fp) beq $t5, 0, label_ERROR_5 - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bazz - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bazz + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Bazz la $t5, Bazz__TDT @@ -1312,20 +1312,20 @@ __Bazz__attrib__g__init: addu $t5, $t5, $t6 # Save distance lw $t6, 0($t5) - sw $t6, -20($fp) + sw $t6, -24($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # Update min if 13 < 14 - lw $t5, -20($fp) - lw $t6, -16($fp) + lw $t5, -24($fp) + lw $t6, -20($fp) bgtu $t5, $t6, label_NEXT0_7 - # LOCAL local_ttrib__g__init_n_5 --> -24($fp) + # LOCAL local_ttrib__g__init_n_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_n_5 = local_ttrib__g__init_internal_0 + # local_ttrib__g__init_n_6 = local_ttrib__g__init_internal_0 lw $t5, -4($fp) - sw $t5, -24($fp) - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # local_ttrib__g__init_internal_6 = ALLOCATE Foo + sw $t5, -28($fp) + # LOCAL local_ttrib__g__init_internal_7 --> -32($fp) + # local_ttrib__g__init_internal_7 = ALLOCATE Foo # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1401,12 +1401,17 @@ __Bazz__attrib__g__init: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t6, -28($fp) + sw $t6, -32($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_internal_7 --> -32($fp) + # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_7 + lw $t6, -32($fp) + sw $t6, -16($fp) # GOTO label_END_6 j label_END_6 label_NEXT0_7: - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Razz la $t6, Razz__TDT @@ -1414,20 +1419,20 @@ label_NEXT0_7: addu $t6, $t6, $t7 # Save distance lw $t7, 0($t6) - sw $t7, -20($fp) + sw $t7, -24($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # Update min if 14 < 15 - lw $t6, -20($fp) - lw $t7, -16($fp) + lw $t6, -24($fp) + lw $t7, -20($fp) bgtu $t6, $t7, label_NEXT1_8 - # LOCAL local_ttrib__g__init_n_7 --> -32($fp) + # LOCAL local_ttrib__g__init_n_8 --> -36($fp) # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_n_7 = local_ttrib__g__init_internal_0 + # local_ttrib__g__init_n_8 = local_ttrib__g__init_internal_0 lw $t6, -4($fp) - sw $t6, -32($fp) - # LOCAL local_ttrib__g__init_internal_8 --> -36($fp) - # local_ttrib__g__init_internal_8 = ALLOCATE Bar + sw $t6, -36($fp) + # LOCAL local_ttrib__g__init_internal_9 --> -40($fp) + # local_ttrib__g__init_internal_9 = ALLOCATE Bar # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1535,12 +1540,17 @@ label_NEXT0_7: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t7, -36($fp) + sw $t7, -40($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_internal_9 --> -40($fp) + # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_9 + lw $t7, -40($fp) + sw $t7, -16($fp) # GOTO label_END_6 j label_END_6 label_NEXT1_8: - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Foo - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Foo + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Foo la $t7, Foo__TDT @@ -1548,20 +1558,20 @@ label_NEXT1_8: addu $t7, $t7, $t8 # Save distance lw $t8, 0($t7) - sw $t8, -20($fp) + sw $t8, -24($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # Update min if 15 < 24 - lw $t7, -20($fp) - lw $t8, -16($fp) + lw $t7, -24($fp) + lw $t8, -20($fp) bgtu $t7, $t8, label_NEXT2_9 - # LOCAL local_ttrib__g__init_n_9 --> -40($fp) + # LOCAL local_ttrib__g__init_n_10 --> -44($fp) # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_n_9 = local_ttrib__g__init_internal_0 + # local_ttrib__g__init_n_10 = local_ttrib__g__init_internal_0 lw $t7, -4($fp) - sw $t7, -40($fp) - # LOCAL local_ttrib__g__init_internal_10 --> -44($fp) - # local_ttrib__g__init_internal_10 = ALLOCATE Razz + sw $t7, -44($fp) + # LOCAL local_ttrib__g__init_internal_11 --> -48($fp) + # local_ttrib__g__init_internal_11 = ALLOCATE Razz # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1653,12 +1663,17 @@ label_NEXT1_8: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t8, -44($fp) + sw $t8, -48($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_internal_11 --> -48($fp) + # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_11 + lw $t8, -48($fp) + sw $t8, -16($fp) # GOTO label_END_6 j label_END_6 label_NEXT2_9: - # local_ttrib__g__init_internal_4 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Bar la $t8, Bar__TDT @@ -1666,18 +1681,23 @@ label_NEXT2_9: addu $t8, $t8, $t9 # Save distance lw $t9, 0($t8) - sw $t9, -20($fp) + sw $t9, -24($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) # Update min if 24 < 25 - lw $t8, -20($fp) - lw $t9, -16($fp) + lw $t8, -24($fp) + lw $t9, -20($fp) bgtu $t8, $t9, label_NEXT3_10 - # LOCAL local_ttrib__g__init_n_11 --> -48($fp) + # LOCAL local_ttrib__g__init_n_12 --> -52($fp) # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_n_11 = local_ttrib__g__init_internal_0 + # local_ttrib__g__init_n_12 = local_ttrib__g__init_internal_0 lw $t8, -4($fp) - sw $t8, -48($fp) + sw $t8, -52($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_n_12 --> -52($fp) + # local_ttrib__g__init_internal_3 = local_ttrib__g__init_n_12 + lw $t8, -52($fp) + sw $t8, -16($fp) # GOTO label_END_6 j label_END_6 label_NEXT3_10: @@ -1698,14 +1718,15 @@ label_NEXT3_10: li $v0, 10 syscall label_END_6: -# RETURN +# RETURN local_ttrib__g__init_internal_3 +lw $v0, -16($fp) # Deallocate stack frame for function __Bazz__attrib__g__init. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 56 +addu $sp, $sp, 60 jr $ra # Function END @@ -1866,10 +1887,10 @@ function_doh_at_Bazz: # @Params: __Foo__attrib__a__init: # Allocate stack frame for function __Foo__attrib__a__init. - subu $sp, $sp, 48 + subu $sp, $sp, 52 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 48 + addu $fp, $sp, 52 # LOCAL local_trib__a__init_internal_0 --> -4($fp) # local_trib__a__init_internal_0 = SELF sw $s1, -4($fp) @@ -1880,12 +1901,12 @@ __Foo__attrib__a__init: # Load pointer to type offset lw $t9, 8($t8) sw $t9, -8($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # local_trib__a__init_internal_3 = 13 - li $t8, 13 - sw $t8, -16($fp) - # local_trib__a__init_internal_4 = TYPE_DISTANCE Razz # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_4 = 13 + li $t8, 13 + sw $t8, -20($fp) + # local_trib__a__init_internal_5 = TYPE_DISTANCE Razz + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_1 --> -8($fp) # Load TDT pointer to type Razz la $t8, Razz__TDT @@ -1893,21 +1914,21 @@ __Foo__attrib__a__init: addu $t8, $t8, $t9 # Save distance lw $t9, 0($t8) - sw $t9, -20($fp) + sw $t9, -24($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) # Update min if 24 < 25 - lw $t8, -20($fp) - lw $t9, -16($fp) + lw $t8, -24($fp) + lw $t9, -20($fp) bgtu $t8, $t9, label_Not_min0_11 - # LOCAL local_trib__a__init_internal_3 --> -16($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # local_trib__a__init_internal_3 = local_trib__a__init_internal_4 - lw $t8, -20($fp) - sw $t8, -16($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) + # local_trib__a__init_internal_4 = local_trib__a__init_internal_5 + lw $t8, -24($fp) + sw $t8, -20($fp) label_Not_min0_11: - # local_trib__a__init_internal_4 = TYPE_DISTANCE Foo - # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_5 = TYPE_DISTANCE Foo + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_1 --> -8($fp) # Load TDT pointer to type Foo la $t8, Foo__TDT @@ -1915,21 +1936,21 @@ __Foo__attrib__a__init: addu $t8, $t8, $t9 # Save distance lw $t9, 0($t8) - sw $t9, -20($fp) + sw $t9, -24($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) # Update min if 24 < 25 - lw $t8, -20($fp) - lw $t9, -16($fp) + lw $t8, -24($fp) + lw $t9, -20($fp) bgtu $t8, $t9, label_Not_min1_12 - # LOCAL local_trib__a__init_internal_3 --> -16($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # local_trib__a__init_internal_3 = local_trib__a__init_internal_4 - lw $t8, -20($fp) - sw $t8, -16($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) + # local_trib__a__init_internal_4 = local_trib__a__init_internal_5 + lw $t8, -24($fp) + sw $t8, -20($fp) label_Not_min1_12: - # local_trib__a__init_internal_4 = TYPE_DISTANCE Bar - # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_5 = TYPE_DISTANCE Bar + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_1 --> -8($fp) # Load TDT pointer to type Bar la $t8, Bar__TDT @@ -1937,37 +1958,37 @@ __Foo__attrib__a__init: addu $t8, $t8, $t9 # Save distance lw $t9, 0($t8) - sw $t9, -20($fp) + sw $t9, -24($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) # Update min if 24 < 25 - lw $t8, -20($fp) - lw $t9, -16($fp) + lw $t8, -24($fp) + lw $t9, -20($fp) bgtu $t8, $t9, label_Not_min2_13 - # LOCAL local_trib__a__init_internal_3 --> -16($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # local_trib__a__init_internal_3 = local_trib__a__init_internal_4 - lw $t8, -20($fp) - sw $t8, -16($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) + # local_trib__a__init_internal_4 = local_trib__a__init_internal_5 + lw $t8, -24($fp) + sw $t8, -20($fp) label_Not_min2_13: - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # local_trib__a__init_internal_4 = 13 + # LOCAL local_trib__a__init_internal_5 --> -24($fp) + # local_trib__a__init_internal_5 = 13 li $t8, 13 - sw $t8, -20($fp) + sw $t8, -24($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # local_trib__a__init_internal_2 = local_trib__a__init_internal_4 - local_trib__a__init_internal_3 - lw $t8, -20($fp) - lw $t9, -16($fp) + # local_trib__a__init_internal_2 = local_trib__a__init_internal_5 - local_trib__a__init_internal_4 + lw $t8, -24($fp) + lw $t9, -20($fp) sub $t8, $t8, $t9 sw $t8, -12($fp) # IF_ZERO local_trib__a__init_internal_2 GOTO label_ERROR_14 # IF_ZERO local_trib__a__init_internal_2 GOTO label_ERROR_14 lw $t8, -12($fp) beq $t8, 0, label_ERROR_14 - # local_trib__a__init_internal_4 = TYPE_DISTANCE Razz - # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_5 = TYPE_DISTANCE Razz + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_1 --> -8($fp) # Load TDT pointer to type Razz la $t8, Razz__TDT @@ -1975,20 +1996,20 @@ __Foo__attrib__a__init: addu $t8, $t8, $t9 # Save distance lw $t9, 0($t8) - sw $t9, -20($fp) + sw $t9, -24($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) # Update min if 24 < 25 - lw $t8, -20($fp) - lw $t9, -16($fp) + lw $t8, -24($fp) + lw $t9, -20($fp) bgtu $t8, $t9, label_NEXT0_16 - # LOCAL local_trib__a__init_n_5 --> -24($fp) + # LOCAL local_trib__a__init_n_6 --> -28($fp) # LOCAL local_trib__a__init_internal_0 --> -4($fp) - # local_trib__a__init_n_5 = local_trib__a__init_internal_0 + # local_trib__a__init_n_6 = local_trib__a__init_internal_0 lw $t8, -4($fp) - sw $t8, -24($fp) - # LOCAL local_trib__a__init_internal_6 --> -28($fp) - # local_trib__a__init_internal_6 = ALLOCATE Bar + sw $t8, -28($fp) + # LOCAL local_trib__a__init_internal_7 --> -32($fp) + # local_trib__a__init_internal_7 = ALLOCATE Bar # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -2096,12 +2117,17 @@ __Foo__attrib__a__init: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t9, -28($fp) + sw $t9, -32($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # LOCAL local_trib__a__init_internal_7 --> -32($fp) + # local_trib__a__init_internal_3 = local_trib__a__init_internal_7 + lw $t9, -32($fp) + sw $t9, -16($fp) # GOTO label_END_15 j label_END_15 label_NEXT0_16: - # local_trib__a__init_internal_4 = TYPE_DISTANCE Foo - # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_5 = TYPE_DISTANCE Foo + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_1 --> -8($fp) # Load TDT pointer to type Foo la $t9, Foo__TDT @@ -2109,20 +2135,20 @@ label_NEXT0_16: addu $t9, $t9, $s2 # Save distance lw $s2, 0($t9) - sw $s2, -20($fp) + sw $s2, -24($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) # Update min if 25 < 18 - lw $t9, -20($fp) - lw $s2, -16($fp) + lw $t9, -24($fp) + lw $s2, -20($fp) bgtu $t9, $s2, label_NEXT1_17 - # LOCAL local_trib__a__init_n_7 --> -32($fp) + # LOCAL local_trib__a__init_n_8 --> -36($fp) # LOCAL local_trib__a__init_internal_0 --> -4($fp) - # local_trib__a__init_n_7 = local_trib__a__init_internal_0 + # local_trib__a__init_n_8 = local_trib__a__init_internal_0 lw $t9, -4($fp) - sw $t9, -32($fp) - # LOCAL local_trib__a__init_internal_8 --> -36($fp) - # local_trib__a__init_internal_8 = ALLOCATE Razz + sw $t9, -36($fp) + # LOCAL local_trib__a__init_internal_9 --> -40($fp) + # local_trib__a__init_internal_9 = ALLOCATE Razz # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -2214,12 +2240,17 @@ label_NEXT0_16: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $s2, -36($fp) + sw $s2, -40($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # LOCAL local_trib__a__init_internal_9 --> -40($fp) + # local_trib__a__init_internal_3 = local_trib__a__init_internal_9 + lw $s2, -40($fp) + sw $s2, -16($fp) # GOTO label_END_15 j label_END_15 label_NEXT1_17: - # local_trib__a__init_internal_4 = TYPE_DISTANCE Bar - # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # local_trib__a__init_internal_5 = TYPE_DISTANCE Bar + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_1 --> -8($fp) # Load TDT pointer to type Bar la $s2, Bar__TDT @@ -2227,18 +2258,23 @@ label_NEXT1_17: addu $s2, $s2, $s3 # Save distance lw $s3, 0($s2) - sw $s3, -20($fp) + sw $s3, -24($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) # Update min if 18 < 19 - lw $s2, -20($fp) - lw $s3, -16($fp) + lw $s2, -24($fp) + lw $s3, -20($fp) bgtu $s2, $s3, label_NEXT2_18 - # LOCAL local_trib__a__init_n_9 --> -40($fp) + # LOCAL local_trib__a__init_n_10 --> -44($fp) # LOCAL local_trib__a__init_internal_0 --> -4($fp) - # local_trib__a__init_n_9 = local_trib__a__init_internal_0 + # local_trib__a__init_n_10 = local_trib__a__init_internal_0 lw $s2, -4($fp) - sw $s2, -40($fp) + sw $s2, -44($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # LOCAL local_trib__a__init_n_10 --> -44($fp) + # local_trib__a__init_internal_3 = local_trib__a__init_n_10 + lw $s2, -44($fp) + sw $s2, -16($fp) # GOTO label_END_15 j label_END_15 label_NEXT2_18: @@ -2259,14 +2295,15 @@ label_NEXT2_18: li $v0, 10 syscall label_END_15: -# RETURN +# RETURN local_trib__a__init_internal_3 +lw $v0, -16($fp) # Deallocate stack frame for function __Foo__attrib__a__init. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 48 +addu $sp, $sp, 52 jr $ra # Function END @@ -2478,10 +2515,10 @@ function_doh_at_Foo: # @Params: __Razz__attrib__e__init: # Allocate stack frame for function __Razz__attrib__e__init. - subu $sp, $sp, 40 + subu $sp, $sp, 44 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 40 + addu $fp, $sp, 44 # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) # local_ttrib__e__init_internal_0 = SELF sw $s1, -4($fp) @@ -2492,12 +2529,12 @@ __Razz__attrib__e__init: # Load pointer to type offset lw $s3, 8($s2) sw $s3, -8($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) - # local_ttrib__e__init_internal_3 = 13 - li $s2, 13 - sw $s2, -16($fp) - # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Razz # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # local_ttrib__e__init_internal_4 = 13 + li $s2, 13 + sw $s2, -20($fp) + # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) # Load TDT pointer to type Razz la $s2, Razz__TDT @@ -2505,21 +2542,21 @@ __Razz__attrib__e__init: addu $s2, $s2, $s3 # Save distance lw $s3, 0($s2) - sw $s3, -20($fp) + sw $s3, -24($fp) + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) # Update min if 18 < 19 - lw $s2, -20($fp) - lw $s3, -16($fp) + lw $s2, -24($fp) + lw $s3, -20($fp) bgtu $s2, $s3, label_Not_min0_19 - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # local_ttrib__e__init_internal_3 = local_ttrib__e__init_internal_4 - lw $s2, -20($fp) - sw $s2, -16($fp) + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) + # local_ttrib__e__init_internal_4 = local_ttrib__e__init_internal_5 + lw $s2, -24($fp) + sw $s2, -20($fp) label_Not_min0_19: - # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) # Load TDT pointer to type Bar la $s2, Bar__TDT @@ -2527,37 +2564,37 @@ __Razz__attrib__e__init: addu $s2, $s2, $s3 # Save distance lw $s3, 0($s2) - sw $s3, -20($fp) + sw $s3, -24($fp) + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) # Update min if 18 < 19 - lw $s2, -20($fp) - lw $s3, -16($fp) + lw $s2, -24($fp) + lw $s3, -20($fp) bgtu $s2, $s3, label_Not_min1_20 - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # local_ttrib__e__init_internal_3 = local_ttrib__e__init_internal_4 - lw $s2, -20($fp) - sw $s2, -16($fp) + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) + # local_ttrib__e__init_internal_4 = local_ttrib__e__init_internal_5 + lw $s2, -24($fp) + sw $s2, -20($fp) label_Not_min1_20: - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # local_ttrib__e__init_internal_4 = 13 + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) + # local_ttrib__e__init_internal_5 = 13 li $s2, 13 - sw $s2, -20($fp) + sw $s2, -24($fp) # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) - # local_ttrib__e__init_internal_2 = local_ttrib__e__init_internal_4 - local_ttrib__e__init_internal_3 - lw $s2, -20($fp) - lw $s3, -16($fp) + # local_ttrib__e__init_internal_2 = local_ttrib__e__init_internal_5 - local_ttrib__e__init_internal_4 + lw $s2, -24($fp) + lw $s3, -20($fp) sub $s2, $s2, $s3 sw $s2, -12($fp) # IF_ZERO local_ttrib__e__init_internal_2 GOTO label_ERROR_21 # IF_ZERO local_ttrib__e__init_internal_2 GOTO label_ERROR_21 lw $s2, -12($fp) beq $s2, 0, label_ERROR_21 - # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) # Load TDT pointer to type Razz la $s2, Razz__TDT @@ -2565,20 +2602,20 @@ __Razz__attrib__e__init: addu $s2, $s2, $s3 # Save distance lw $s3, 0($s2) - sw $s3, -20($fp) + sw $s3, -24($fp) + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) # Update min if 18 < 19 - lw $s2, -20($fp) - lw $s3, -16($fp) + lw $s2, -24($fp) + lw $s3, -20($fp) bgtu $s2, $s3, label_NEXT0_23 - # LOCAL local_ttrib__e__init_n_5 --> -24($fp) + # LOCAL local_ttrib__e__init_n_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) - # local_ttrib__e__init_n_5 = local_ttrib__e__init_internal_0 + # local_ttrib__e__init_n_6 = local_ttrib__e__init_internal_0 lw $s2, -4($fp) - sw $s2, -24($fp) - # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) - # local_ttrib__e__init_internal_6 = ALLOCATE Bar + sw $s2, -28($fp) + # LOCAL local_ttrib__e__init_internal_7 --> -32($fp) + # local_ttrib__e__init_internal_7 = ALLOCATE Bar # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -2686,12 +2723,17 @@ __Razz__attrib__e__init: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $s3, -28($fp) + sw $s3, -32($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__e__init_internal_7 --> -32($fp) + # local_ttrib__e__init_internal_3 = local_ttrib__e__init_internal_7 + lw $s3, -32($fp) + sw $s3, -16($fp) # GOTO label_END_22 j label_END_22 label_NEXT0_23: - # local_ttrib__e__init_internal_4 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) # Load TDT pointer to type Bar la $s3, Bar__TDT @@ -2699,18 +2741,23 @@ label_NEXT0_23: addu $s3, $s3, $s4 # Save distance lw $s4, 0($s3) - sw $s4, -20($fp) + sw $s4, -24($fp) + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) # Update min if 19 < 20 - lw $s3, -20($fp) - lw $s4, -16($fp) + lw $s3, -24($fp) + lw $s4, -20($fp) bgtu $s3, $s4, label_NEXT1_24 - # LOCAL local_ttrib__e__init_n_7 --> -32($fp) + # LOCAL local_ttrib__e__init_n_8 --> -36($fp) # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) - # local_ttrib__e__init_n_7 = local_ttrib__e__init_internal_0 + # local_ttrib__e__init_n_8 = local_ttrib__e__init_internal_0 lw $s3, -4($fp) - sw $s3, -32($fp) + sw $s3, -36($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__e__init_n_8 --> -36($fp) + # local_ttrib__e__init_internal_3 = local_ttrib__e__init_n_8 + lw $s3, -36($fp) + sw $s3, -16($fp) # GOTO label_END_22 j label_END_22 label_NEXT1_24: @@ -2731,14 +2778,15 @@ label_NEXT1_24: li $v0, 10 syscall label_END_22: -# RETURN +# RETURN local_ttrib__e__init_internal_3 +lw $v0, -16($fp) # Deallocate stack frame for function __Razz__attrib__e__init. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 40 +addu $sp, $sp, 44 jr $ra # Function END diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips index add5e238..af15262e 100644 --- a/tests/codegen/hello_world.mips +++ b/tests/codegen/hello_world.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 17:41:29 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:11 2020 # School of Math and Computer Science, University of Havana # @@ -353,7 +353,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips index 56ee5bf6..b9a663fc 100644 --- a/tests/codegen/io.mips +++ b/tests/codegen/io.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:24 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:12 2020 # School of Math and Computer Science, University of Havana # @@ -17,12 +17,12 @@ A: .asciiz "A" # Function END B: .asciiz "B" # Function END +Main: .asciiz "Main" +# Function END C: .asciiz "C" # Function END D: .asciiz "D" # Function END -Main: .asciiz "Main" -# Function END # @@ -110,6 +110,20 @@ B_end: # +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + # **** VTABLE for type C **** C_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_out_c_at_C # Function END @@ -138,20 +152,6 @@ D_end: # -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - data_0: .asciiz "" # @@ -164,15 +164,15 @@ data_2: .asciiz "\n" # -IO__TDT: .word 0, -1, -1, -1, -1, -1, 1, 2, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 2, 2, 3, 2 +IO__TDT: .word 0, -1, -1, -1, -1, -1, 1, 1, 2 +Object__TDT: .word 1, 0, 1, 1, 1, 2, 2, 2, 3 String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1 Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1 A__TDT: .word -1, -1, -1, -1, 0, 1, -1, -1, -1 B__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1 -C__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, -1 -D__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0 +Main__TDT: .word -1, -1, -1, -1, -1, -1, 0, -1, -1 +C__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, 1 +D__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0 # @@ -184,15 +184,15 @@ data_5: .asciiz "B: Hello world\n" # -data_6: .asciiz "C: Hello world\n" +data_6: .asciiz "Done.\n" # -data_7: .asciiz "D: Hello world\n" +data_7: .asciiz "C: Hello world\n" # -data_8: .asciiz "Done.\n" +data_8: .asciiz "D: Hello world\n" # @@ -437,7 +437,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -635,7 +635,7 @@ entry: la $t2, Main_start sw $t2, 4($v0) # Load type offset - li $t2, 32 + li $t2, 24 sw $t2, 8($v0) move $t1, $v0 # Push register s1 into stack @@ -880,152 +880,6 @@ function_out_b_at_B: # Function END -# function_out_c_at_C implementation. -# @Params: -function_out_c_at_C: - # Allocate stack frame for function function_out_c_at_C. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_out_c_at_C_internal_2 --> -12($fp) - # local_out_c_at_C_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_out_c_at_C_internal_0 --> -4($fp) - # LOCAL local_out_c_at_C_internal_2 --> -12($fp) - # local_out_c_at_C_internal_0 = local_out_c_at_C_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_out_c_at_C_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_6 - sw $t2, 12($v0) - li $t2, 15 - sw $t2, 16($v0) - sw $v0, -16($fp) - # ARG local_out_c_at_C_internal_3 - # LOCAL local_out_c_at_C_internal_3 --> -16($fp) - lw $t2, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_out_c_at_C_internal_0 --> -4($fp) - # LOCAL local_out_c_at_C_internal_1 --> -8($fp) - # local_out_c_at_C_internal_1 = VCALL local_out_c_at_C_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 12($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_out_c_at_C_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_c_at_C. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_d_at_D implementation. -# @Params: -function_out_d_at_D: - # Allocate stack frame for function function_out_d_at_D. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_out_d_at_D_internal_2 --> -12($fp) - # local_out_d_at_D_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_out_d_at_D_internal_0 --> -4($fp) - # LOCAL local_out_d_at_D_internal_2 --> -12($fp) - # local_out_d_at_D_internal_0 = local_out_d_at_D_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_out_d_at_D_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_7 - sw $t2, 12($v0) - li $t2, 15 - sw $t2, 16($v0) - sw $v0, -16($fp) - # ARG local_out_d_at_D_internal_3 - # LOCAL local_out_d_at_D_internal_3 --> -16($fp) - lw $t2, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_out_d_at_D_internal_0 --> -4($fp) - # LOCAL local_out_d_at_D_internal_1 --> -8($fp) - # local_out_d_at_D_internal_1 = VCALL local_out_d_at_D_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 12($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_out_d_at_D_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_d_at_D. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - # function_main_at_Main implementation. # @Params: function_main_at_Main: @@ -1203,7 +1057,7 @@ function_main_at_Main: la $t6, C_start sw $t6, 4($v0) # Load type offset - li $t6, 24 + li $t6, 28 sw $t6, 8($v0) move $t5, $v0 # Push register s1 into stack @@ -1266,7 +1120,7 @@ function_main_at_Main: la $t7, D_start sw $t7, 4($v0) # Load type offset - li $t7, 28 + li $t7, 32 sw $t7, 8($v0) move $t6, $v0 # Push register s1 into stack @@ -1326,7 +1180,7 @@ function_main_at_Main: # Load type offset li $t6, 8 sw $t6, 8($v0) - la $t6, data_8 + la $t6, data_6 sw $t6, 12($v0) li $t6, 6 sw $t6, 16($v0) @@ -1366,3 +1220,149 @@ function_main_at_Main: jr $ra # Function END + +# function_out_c_at_C implementation. +# @Params: +function_out_c_at_C: + # Allocate stack frame for function function_out_c_at_C. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_out_c_at_C_internal_2 --> -12($fp) + # local_out_c_at_C_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_out_c_at_C_internal_0 --> -4($fp) + # LOCAL local_out_c_at_C_internal_2 --> -12($fp) + # local_out_c_at_C_internal_0 = local_out_c_at_C_internal_2 + lw $t6, -12($fp) + sw $t6, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_out_c_at_C_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t6, String + sw $t6, 0($v0) + la $t6, String_start + sw $t6, 4($v0) + # Load type offset + li $t6, 8 + sw $t6, 8($v0) + la $t6, data_7 + sw $t6, 12($v0) + li $t6, 15 + sw $t6, 16($v0) + sw $v0, -16($fp) + # ARG local_out_c_at_C_internal_3 + # LOCAL local_out_c_at_C_internal_3 --> -16($fp) + lw $t6, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + # LOCAL local_out_c_at_C_internal_0 --> -4($fp) + # LOCAL local_out_c_at_C_internal_1 --> -8($fp) + # local_out_c_at_C_internal_1 = VCALL local_out_c_at_C_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t6, 4($s1) + # Get pointer to type's VTABLE + lw $t7, 0($t6) + # Get pointer to function address + lw $t8, 12($t7) + # Call function. Result is on $v0 + jalr $t8 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_out_c_at_C_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_c_at_C. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_d_at_D implementation. +# @Params: +function_out_d_at_D: + # Allocate stack frame for function function_out_d_at_D. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_out_d_at_D_internal_2 --> -12($fp) + # local_out_d_at_D_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_out_d_at_D_internal_0 --> -4($fp) + # LOCAL local_out_d_at_D_internal_2 --> -12($fp) + # local_out_d_at_D_internal_0 = local_out_d_at_D_internal_2 + lw $t6, -12($fp) + sw $t6, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_out_d_at_D_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t6, String + sw $t6, 0($v0) + la $t6, String_start + sw $t6, 4($v0) + # Load type offset + li $t6, 8 + sw $t6, 8($v0) + la $t6, data_8 + sw $t6, 12($v0) + li $t6, 15 + sw $t6, 16($v0) + sw $v0, -16($fp) + # ARG local_out_d_at_D_internal_3 + # LOCAL local_out_d_at_D_internal_3 --> -16($fp) + lw $t6, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t6, 0($sp) + # LOCAL local_out_d_at_D_internal_0 --> -4($fp) + # LOCAL local_out_d_at_D_internal_1 --> -8($fp) + # local_out_d_at_D_internal_1 = VCALL local_out_d_at_D_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t6, 4($s1) + # Get pointer to type's VTABLE + lw $t7, 0($t6) + # Get pointer to function address + lw $t8, 12($t7) + # Call function. Result is on $v0 + jalr $t8 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_out_d_at_D_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_d_at_D. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/codegen/life.mips b/tests/codegen/life.mips index 1adb1426..fb53829f 100644 --- a/tests/codegen/life.mips +++ b/tests/codegen/life.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:26 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:14 2020 # School of Math and Computer Science, University of Havana # @@ -107,7 +107,7 @@ CellularAutomaton_end: # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_CellularAutomaton, function_type_name_at_CellularAutomaton, function_copy_at_CellularAutomaton, function_out_string_at_CellularAutomaton, function_out_int_at_CellularAutomaton, function_in_string_at_CellularAutomaton, function_in_int_at_CellularAutomaton, function_size_of_board_at_Board, function_board_init_at_Board, function_init_at_CellularAutomaton, function_print_at_CellularAutomaton, function_num_cells_at_CellularAutomaton, function_cell_at_CellularAutomaton, function_north_at_CellularAutomaton, function_south_at_CellularAutomaton, function_east_at_CellularAutomaton, function_west_at_CellularAutomaton, function_northwest_at_CellularAutomaton, function_northeast_at_CellularAutomaton, function_southeast_at_CellularAutomaton, function_southwest_at_CellularAutomaton, function_neighbors_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_evolve_at_CellularAutomaton, function_option_at_CellularAutomaton, function_prompt_at_CellularAutomaton, function_prompt2_at_CellularAutomaton, function_main_at_Main +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_size_of_board_at_Board, function_board_init_at_Board, function_init_at_CellularAutomaton, function_print_at_CellularAutomaton, function_num_cells_at_CellularAutomaton, function_cell_at_CellularAutomaton, function_north_at_CellularAutomaton, function_south_at_CellularAutomaton, function_east_at_CellularAutomaton, function_west_at_CellularAutomaton, function_northwest_at_CellularAutomaton, function_northeast_at_CellularAutomaton, function_southeast_at_CellularAutomaton, function_southwest_at_CellularAutomaton, function_neighbors_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_evolve_at_CellularAutomaton, function_option_at_CellularAutomaton, function_prompt_at_CellularAutomaton, function_prompt2_at_CellularAutomaton, function_main_at_Main # Function END # @@ -727,7 +727,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/list.mips b/tests/codegen/list.mips index 822ddca6..49362c0c 100644 --- a/tests/codegen/list.mips +++ b/tests/codegen/list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:24 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:12 2020 # School of Math and Computer Science, University of Havana # @@ -391,7 +391,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/new_complex.mips b/tests/codegen/new_complex.mips index 70114ec1..19409af8 100644 --- a/tests/codegen/new_complex.mips +++ b/tests/codegen/new_complex.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 17:41:29 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:11 2020 # School of Math and Computer Science, University of Havana # @@ -390,7 +390,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/palindrome.mips b/tests/codegen/palindrome.mips index 0cfba4e2..412eaf06 100644 --- a/tests/codegen/palindrome.mips +++ b/tests/codegen/palindrome.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 12:43:25 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:13 2020 # School of Math and Computer Science, University of Havana # @@ -361,7 +361,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/primes.mips b/tests/codegen/primes.mips index 4fd6530c..0d4ed662 100644 --- a/tests/codegen/primes.mips +++ b/tests/codegen/primes.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 17:41:29 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:10 2020 # School of Math and Computer Science, University of Havana # @@ -365,7 +365,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/print-cool.mips b/tests/codegen/print-cool.mips index 27f1391a..a5e2bb8d 100644 --- a/tests/codegen/print-cool.mips +++ b/tests/codegen/print-cool.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 17:41:29 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:11 2020 # School of Math and Computer Science, University of Havana # @@ -353,7 +353,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self From 4d9ef0ae6fc428b4068d96dc36e238504398cd92 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Sun, 6 Dec 2020 23:43:55 -0500 Subject: [PATCH 153/162] make string instantiable --- src/cil/baseCilVisitor.py | 12 +- src/cil/nodes.py | 15 +- src/mips/baseMipsVisitor.py | 121 +- src/testing.mips | 2865 ++++++-------------------------- src/testing.py | 65 +- src/travels/ciltomips.py | 131 +- src/travels/ctcill.py | 42 +- tests/codegen/atoi.mips | 4 +- tests/codegen/book_list.mips | 12 +- tests/codegen/cells.mips | 4 +- tests/codegen/complex.mips | 4 +- tests/codegen/fib.mips | 4 +- tests/codegen/hairyscary.mips | 40 +- tests/codegen/hello_world.mips | 4 +- tests/codegen/io.mips | 4 +- tests/codegen/life.mips | 4 +- tests/codegen/list.mips | 4 +- tests/codegen/new_complex.mips | 4 +- tests/codegen/palindrome.mips | 4 +- tests/codegen/primes.mips | 4 +- tests/codegen/print-cool.mips | 4 +- 21 files changed, 790 insertions(+), 2561 deletions(-) diff --git a/src/cil/baseCilVisitor.py b/src/cil/baseCilVisitor.py index 5e29bd31..7bfe9c98 100644 --- a/src/cil/baseCilVisitor.py +++ b/src/cil/baseCilVisitor.py @@ -4,7 +4,7 @@ import cil.nodes as nodes from abstract.semantics import Attribute, VariableInfo, Context, Type, Method from cil.nodes import ( - AbortNode, + AbortNode, AllocateIntNode, AllocateStringNode, ConcatString, CopyNode, @@ -349,8 +349,10 @@ def __implement_length(self): str_ = self.context.get_type("String") self.current_function = self.register_function("function_length_at_String") return_vm_holder = self.define_internal_local() + int_const_vm_holder = self.define_internal_local() self.register_instruction(GetAttributeNode(str_, "length", return_vm_holder)) - self.register_instruction(ReturnNode(return_vm_holder)) + self.register_instruction(AllocateIntNode(int_const_vm_holder, return_vm_holder)) + self.register_instruction(ReturnNode(int_const_vm_holder)) def build_builtins(self): @@ -363,6 +365,8 @@ def build_builtins(self): bool_ = self.register_type("Bool") bool__ = self.context.get_type("Bool") + int_ = self.register_type("Int") + io_typeNode.methods.append(("abort", "function_abort_at_Object")) io_typeNode.methods.append(("type_name", "function_type_name_at_Object")) io_typeNode.methods.append(("copy", "function_copy_at_Object")) @@ -386,6 +390,10 @@ def build_builtins(self): str_.methods.append(("substr", "function_substr_at_String")) str_.methods.append(("length", "function_length_at_String")) + int_.methods.append(("abort", "function_abort_at_Object")) + int_.methods.append(("type_name", "function_type_name_at_Object")) + int_.methods.append(("copy", "function_copy_at_Object")) + str_.attributes.append(Attribute("value", str__)) str_.attributes.append(Attribute("length", self.context.get_type("Int"))) diff --git a/src/cil/nodes.py b/src/cil/nodes.py index 9c57885e..e8f92609 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -298,6 +298,12 @@ def __init__(self, dest: LocalNode, value: int) -> None: self.value = value +class AllocateIntNode(InstructionNode): + def __init__(self, dest: LocalNode, value): + self.dest = dest + self.value = value + + class JumpIfGreater(InstructionNode): def __init__(self, src1: LocalNode, src2: LocalNode, label: str) -> None: self.left = src1 @@ -308,4 +314,11 @@ def __init__(self, src1: LocalNode, src2: LocalNode, label: str) -> None: class BitwiseNotNode(InstructionNode): def __init__(self, src, dest) -> None: self.dest = dest - self.src = src \ No newline at end of file + self.src = src + + +class EqualToCilNode(InstructionNode): + def __init__(self, left, right, dest) -> None: + self.left = left + self.right = right + self.dest = dest \ No newline at end of file diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 178008d2..f6b6ccd6 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -10,12 +10,22 @@ from mips.branch import JAL, JALR import mips.instruction as instrNodes import mips.arithmetic as arithNodes -from mips.instruction import FixedData, LineComment, REG_TO_STR, a0, fp, ra, sp, v0 +from mips.instruction import ( + FixedData, + LineComment, + MOVE, + REG_TO_STR, + a0, + fp, + ra, + sp, + v0, +) import mips.load_store as lsNodes from typing import List, Optional, Type, Union import time import cil.nodes as cil -from mips.load_store import LW, SW +from mips.load_store import LA, LI, LW, SW from travels.ctcill import CilDisplayFormatter @@ -94,9 +104,9 @@ def __init__(self): # Necesitamos acceso a los tipos del programa self.types: List[TypeNode] = [] - + # Tipos accesibles en el codigo - self.mips_types: List[str] = [] + self.mips_types: List[str] = [] # Construir el header del programa. self.__program_header() @@ -131,7 +141,9 @@ def get_location_address(self, node: Union[cil.ParamNode, cil.LocalNode]) -> str params = self.current_function.params if isinstance(node, cil.ParamNode): # Buscar el indice del parametro al que corresponde - index = next(i for i, param in enumerate(params, 1) if param.name == node.name) + index = next( + i for i, param in enumerate(params, 1) if param.name == node.name + ) assert index > -1 @@ -184,38 +196,73 @@ def operate(self, dest, left, right, operand: Type): Realiza la operacion indicada por operand entre left y right y la guarda en dest. """ - if isinstance(left, str): - # left es una direccion de memoria - reg = self.get_available_register() - assert reg is not None - right_reg = self.get_available_register() - assert right_reg is not None - self.register_instruction(lsNodes.LW(reg, left)) - if not isinstance(right, int): - # right no es una constante - self.register_instruction(lsNodes.LW(right_reg, right)) - self.register_instruction(operand(reg, reg, right_reg)) - else: - # rigth es una constante - self.register_instruction(operand(reg, reg, right, True)) - self.register_instruction(lsNodes.SW(reg, dest)) - self.used_registers[reg] = False - self.used_registers[right_reg] = False - else: - # left es una constante - reg = self.get_available_register() - right_reg = self.get_available_register() - assert right_reg is not None - assert reg is not None - self.register_instruction(lsNodes.LI(reg, left)) - if not isinstance(right, int): - self.register_instruction(lsNodes.LW(right_reg, right)) - self.register_instruction(operand(reg, reg, right_reg)) - else: - self.register_instruction(operand(reg, reg, right, True)) - self.register_instruction(lsNodes.SW(reg, dest)) - self.used_registers[reg] = False - self.used_registers[right_reg] = False + # left es una direccion de memoria + reg = self.get_available_register() + reg2 = self.get_available_register() + right_reg = self.get_available_register() + + assert reg is not None + assert reg2 is not None + assert right_reg is not None + + self.register_instruction(lsNodes.LW(reg2, left)) + # Load integer value + self.register_instruction(lsNodes.LW(reg, f"8(${REG_TO_STR[reg2]})")) + # right no es una constante + self.register_instruction(lsNodes.LW(reg2, right)) + # Cargar el valor + self.register_instruction(lsNodes.LW(right_reg, f"8(${REG_TO_STR[reg2]})")) + self.register_instruction(operand(reg, reg, right_reg)) + + # Crear la nueva instancia de Int + + size = 20 + + # Reservar memoria para el tipo + self.allocate_memory(size) + + self.comment("Allocating string for type Int") + + # Inicializar la instancia + self.register_instruction(LA(reg2, "String")) + self.register_instruction(SW(reg2, "0($v0)")) + + self.register_instruction(LA(reg2, "String_start")) + self.register_instruction(SW(reg2, "4($v0)")) + + # Cargar el offset del tipo + self.comment("Load type offset") + offset = next(i for i, t in enumerate(self.mips_types) if t == "Int") * 4 + self.register_instruction(LI(reg2, offset)) + self.register_instruction(SW(reg2, "8($v0)")) + + self.register_instruction(LA(reg2, "Int")) + self.register_instruction(SW(reg2, "12($v0)")) + + self.register_instruction(LI(reg2, 3)) + self.register_instruction(SW(reg2, "16($v0)")) + + # devolver la instancia + self.register_instruction(MOVE(reg2, v0)) + + size = 12 + + self.allocate_memory(size) + + # Almacenar el string al tipo Int + self.register_instruction(SW(reg2, f"0($v0)")) + + self.register_instruction(LA(reg2, "Int_start")) + self.register_instruction(SW(reg2, "4($v0)")) + + self.register_instruction(SW(reg, "8($v0)")) + + # devolver la instancia + self.register_instruction(SW(v0, dest)) + + self.used_registers[reg] = False + self.used_registers[right_reg] = False + self.used_registers[reg2] = False def create_type_array(self, types: List[TypeNode]): """ diff --git a/src/testing.mips b/src/testing.mips index 73328255..26ef9af4 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:29:13 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 23:42:38 2020 # School of Math and Computer Science, University of Havana # @@ -13,15 +13,9 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END -Main: .asciiz "Main" -# Function END -Bazz: .asciiz "Bazz" -# Function END -Foo: .asciiz "Foo" -# Function END -Razz: .asciiz "Razz" +Int: .asciiz "Int" # Function END -Bar: .asciiz "Bar" +Main: .asciiz "Main" # Function END # @@ -82,101 +76,64 @@ Bool_end: # -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -# **** VTABLE for type Bazz **** -Bazz_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_printh_at_Bazz, function_doh_at_Bazz -# Function END -# - - -# **** Type RECORD for type Bazz **** -Bazz_start: - Bazz_vtable_pointer: .word Bazz_vtable - # Function END -Bazz_end: -# - - -# **** VTABLE for type Foo **** -Foo_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_printh_at_Bazz, function_doh_at_Foo +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object # Function END # -# **** Type RECORD for type Foo **** -Foo_start: - Foo_vtable_pointer: .word Foo_vtable +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable # Function END -Foo_end: +Int_end: # -# **** VTABLE for type Razz **** -Razz_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_printh_at_Bazz, function_doh_at_Foo +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main # Function END # -# **** Type RECORD for type Razz **** -Razz_start: - Razz_vtable_pointer: .word Razz_vtable +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable # Function END -Razz_end: +Main_end: # -# **** VTABLE for type Bar **** -Bar_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_printh_at_Bazz, function_doh_at_Foo -# Function END +data_0: .asciiz "" # -# **** Type RECORD for type Bar **** -Bar_start: - Bar_vtable_pointer: .word Bar_vtable - # Function END -Bar_end: +data_1: .asciiz "Abort called from class " # -data_0: .asciiz "" +data_2: .asciiz "\n" # -data_1: .asciiz "Abort called from class " +IO__TDT: .word 0, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0 # -data_2: .asciiz "\n" +data_4: .asciiz "\n" # -IO__TDT: .word 0, -1, -1, -1, -1, 1, 2, 3, 4 -Object__TDT: .word 1, 0, 1, 1, 1, 2, 3, 4, 5 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1 -Main__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1 -Bazz__TDT: .word -1, -1, -1, -1, -1, 0, 1, 2, 3 -Foo__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 2 -Razz__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, 1 -Bar__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0 +data_5: .asciiz "Hello" # -data_4: .asciiz "do nothing" +data_6: .asciiz "\n" # @@ -258,7 +215,8 @@ function_out_int_at_IO: addu $fp, $sp, 32 # PRINT_INT param_out_int_at_IO_x_0 # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) + lw $v0, 0($fp) + lw $a0, 8($v0) li $v0, 1 syscall # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) @@ -324,6 +282,32 @@ function_in_int_at_IO: # local_in_int_at_IO_internal_0 = READ_INT li $v0, 5 syscall + move $a0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + sw $a0, 8($v0) sw $v0, -4($fp) # RETURN local_in_int_at_IO_internal_0 lw $v0, -4($fp) @@ -421,7 +405,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -571,8 +555,37 @@ function_length_at_String: # LOCAL local_length_at_String_internal_0 --> -4($fp) lw $t0, 16($s1) sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + lw $t0, -4($fp) + sw $t0, 8($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function function_length_at_String. # Restore $ra lw $ra, 4($sp) @@ -611,53 +624,21 @@ entry: li $t2, 4 sw $t2, 16($v0) move $t2, $v0 - # Allocating 28 bytes of memory - li $a0, 28 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall sw $t2, 0($v0) la $t2, Main_start sw $t2, 4($v0) # Load type offset - li $t2, 16 + li $t2, 20 sw $t2, 8($v0) move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__a__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__b__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__c__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__d__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 @@ -672,7 +653,7 @@ entry: # Get pointer to type's VTABLE la $t1, Main_vtable # Get pointer to function address - lw $t2, 12($t1) + lw $t2, 28($t1) # Call function. Result is on $v0 jalr $t2 sw $v0, -8($fp) @@ -689,2391 +670,523 @@ entry: # Function END -# __Main__attrib__a__init implementation. +# function_main_at_Main implementation. # @Params: -__Main__attrib__a__init: - # Allocate stack frame for function __Main__attrib__a__init. - subu $sp, $sp, 32 +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 112 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__a__init_internal_0 --> -4($fp) - # local_ttrib__a__init_internal_0 = ALLOCATE Bazz + addu $fp, $sp, 112 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t1, -12($fp) + sw $t1, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Bazz - sw $t3, 12($v0) - li $t3, 4 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 24 bytes of memory - li $a0, 24 + li $t1, 16 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall - sw $t3, 0($v0) - la $t3, Bazz_start - sw $t3, 4($v0) - # Load type offset - li $t3, 20 - sw $t3, 8($v0) - move $t2, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t2) - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t2) - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t2) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t2, -4($fp) - # RETURN local_ttrib__a__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Main__attrib__a__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__b__init implementation. -# @Params: -__Main__attrib__b__init: - # Allocate stack frame for function __Main__attrib__b__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__b__init_internal_0 --> -4($fp) - # local_ttrib__b__init_internal_0 = ALLOCATE Foo + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + li $t1, 10 + sw $t1, 8($v0) + sw $v0, -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Foo - sw $t4, 12($v0) - li $t4, 3 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 32 bytes of memory - li $a0, 32 + li $t1, 16 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall - sw $t4, 0($v0) - la $t4, Foo_start - sw $t4, 4($v0) - # Load type offset - li $t4, 24 - sw $t4, 8($v0) - move $t3, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t3) - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t3) - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t3) - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t3) - # Push register t3 into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t3) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t3, -4($fp) - # RETURN local_ttrib__b__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Main__attrib__b__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__c__init implementation. -# @Params: -__Main__attrib__c__init: - # Allocate stack frame for function __Main__attrib__c__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__c__init_internal_0 --> -4($fp) - # local_ttrib__c__init_internal_0 = ALLOCATE Razz + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + li $t1, 12 + sw $t1, 8($v0) + sw $v0, -32($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_5 = local_main_at_Main_internal_6 - local_main_at_Main_internal_7 + lw $t2, -28($fp) + lw $t1, 8($t2) + lw $t2, -32($fp) + lw $t3, 8($t2) + sub $t1, $t1, $t3 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type name - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) + # Allocating string for type Int + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, Razz - sw $t5, 12($v0) - li $t5, 4 - sw $t5, 16($v0) - move $t5, $v0 - # Allocating 40 bytes of memory - li $a0, 40 + li $t2, 16 + sw $t2, 8($v0) + la $t2, Int + sw $t2, 12($v0) + li $t2, 3 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall - sw $t5, 0($v0) - la $t5, Razz_start - sw $t5, 4($v0) - # Load type offset - li $t5, 28 - sw $t5, 8($v0) - move $t4, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t4 into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t4) - # Push register t4 into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t4) - # Push register t4 into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t4) - # Push register t4 into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t4) - # Push register t4 into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t4) - # Push register t4 into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) - addu $sp, $sp, 4 - sw $v0, 32($t4) - # Push register t4 into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) - addu $sp, $sp, 4 - sw $v0, 36($t4) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t4, -4($fp) - # RETURN local_ttrib__c__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Main__attrib__c__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__d__init implementation. -# @Params: -__Main__attrib__d__init: - # Allocate stack frame for function __Main__attrib__d__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__d__init_internal_0 --> -4($fp) - # local_ttrib__d__init_internal_0 = ALLOCATE Bar + sw $t2, 0($v0) + la $t2, Int_start + sw $t2, 4($v0) + sw $t1, 8($v0) + sw $v0, -24($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type name - la $t6, String - sw $t6, 0($v0) - la $t6, String_start - sw $t6, 4($v0) + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) # Load type offset - li $t6, 8 - sw $t6, 8($v0) - la $t6, Bar - sw $t6, 12($v0) - li $t6, 3 - sw $t6, 16($v0) - move $t6, $v0 - # Allocating 48 bytes of memory - li $a0, 48 + li $t1, 16 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall - sw $t6, 0($v0) - la $t6, Bar_start - sw $t6, 4($v0) - # Load type offset - li $t6, 32 - sw $t6, 8($v0) - move $t5, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t5 into stack - subu $sp, $sp, 4 - sw $t5, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t5) - # Push register t5 into stack - subu $sp, $sp, 4 - sw $t5, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t5) - # Push register t5 into stack - subu $sp, $sp, 4 - sw $t5, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t5) - # Push register t5 into stack - subu $sp, $sp, 4 - sw $t5, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t5) - # Push register t5 into stack - subu $sp, $sp, 4 - sw $t5, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t5) - # Push register t5 into stack - subu $sp, $sp, 4 - sw $t5, 0($sp) - jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) - addu $sp, $sp, 4 - sw $v0, 32($t5) - # Push register t5 into stack - subu $sp, $sp, 4 - sw $t5, 0($sp) - jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) - addu $sp, $sp, 4 - sw $v0, 36($t5) - # Push register t5 into stack - subu $sp, $sp, 4 - sw $t5, 0($sp) - jal __Bar__attrib__c__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) - addu $sp, $sp, 4 - sw $v0, 40($t5) - # Push register t5 into stack - subu $sp, $sp, 4 - sw $t5, 0($sp) - jal __Bar__attrib__d__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) - addu $sp, $sp, 4 - sw $v0, 44($t5) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t5, -4($fp) - # RETURN local_ttrib__d__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Main__attrib__d__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_0 --> -4($fp) + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + li $t1, 6 + sw $t1, 8($v0) + sw $v0, -36($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_5 * local_main_at_Main_internal_8 + lw $t2, -24($fp) + lw $t1, 8($t2) + lw $t2, -36($fp) + lw $t3, 8($t2) + mul $t1, $t1, $t3 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) - # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, data_4 - sw $t5, 12($v0) - li $t5, 10 - sw $t5, 16($v0) - sw $v0, -4($fp) - # RETURN local_main_at_Main_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Bazz__attrib__h__init implementation. -# @Params: -__Bazz__attrib__h__init: - # Allocate stack frame for function __Bazz__attrib__h__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 1 - li $v0, 1 - # Deallocate stack frame for function __Bazz__attrib__h__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Bazz__attrib__g__init implementation. -# @Params: -__Bazz__attrib__g__init: - # Allocate stack frame for function __Bazz__attrib__g__init. - subu $sp, $sp, 60 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 60 - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_internal_0 = SELF - sw $s1, -4($fp) - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # local_ttrib__g__init_internal_1 = TYPEOF local_ttrib__g__init_internal_0 - lw $t5, -4($fp) - # Load pointer to type offset - lw $t6, 8($t5) - sw $t6, -8($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # local_ttrib__g__init_internal_4 = 13 - li $t5, 13 - sw $t5, -20($fp) - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bazz - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # Load TDT pointer to type Bazz - la $t5, Bazz__TDT - lw $t6, -8($fp) - addu $t5, $t5, $t6 - # Save distance - lw $t6, 0($t5) - sw $t6, -24($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # Update min if 13 < 14 - lw $t5, -24($fp) - lw $t6, -20($fp) - bgtu $t5, $t6, label_Not_min0_1 - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_5 - lw $t5, -24($fp) - sw $t5, -20($fp) - label_Not_min0_1: - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # Load TDT pointer to type Razz - la $t5, Razz__TDT - lw $t6, -8($fp) - addu $t5, $t5, $t6 - # Save distance - lw $t6, 0($t5) - sw $t6, -24($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # Update min if 13 < 14 - lw $t5, -24($fp) - lw $t6, -20($fp) - bgtu $t5, $t6, label_Not_min1_2 - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_5 - lw $t5, -24($fp) - sw $t5, -20($fp) - label_Not_min1_2: - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Foo - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # Load TDT pointer to type Foo - la $t5, Foo__TDT - lw $t6, -8($fp) - addu $t5, $t5, $t6 - # Save distance - lw $t6, 0($t5) - sw $t6, -24($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # Update min if 13 < 14 - lw $t5, -24($fp) - lw $t6, -20($fp) - bgtu $t5, $t6, label_Not_min2_3 - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_5 - lw $t5, -24($fp) - sw $t5, -20($fp) - label_Not_min2_3: - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # Load TDT pointer to type Bar - la $t5, Bar__TDT - lw $t6, -8($fp) - addu $t5, $t5, $t6 - # Save distance - lw $t6, 0($t5) - sw $t6, -24($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # Update min if 13 < 14 - lw $t5, -24($fp) - lw $t6, -20($fp) - bgtu $t5, $t6, label_Not_min3_4 - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_5 - lw $t5, -24($fp) - sw $t5, -20($fp) - label_Not_min3_4: - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # local_ttrib__g__init_internal_5 = 13 - li $t5, 13 - sw $t5, -24($fp) - # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # local_ttrib__g__init_internal_2 = local_ttrib__g__init_internal_5 - local_ttrib__g__init_internal_4 - lw $t5, -24($fp) - lw $t6, -20($fp) - sub $t5, $t5, $t6 - sw $t5, -12($fp) - # IF_ZERO local_ttrib__g__init_internal_2 GOTO label_ERROR_5 - # IF_ZERO local_ttrib__g__init_internal_2 GOTO label_ERROR_5 - lw $t5, -12($fp) - beq $t5, 0, label_ERROR_5 - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bazz - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # Load TDT pointer to type Bazz - la $t5, Bazz__TDT - lw $t6, -8($fp) - addu $t5, $t5, $t6 - # Save distance - lw $t6, 0($t5) - sw $t6, -24($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # Update min if 13 < 14 - lw $t5, -24($fp) - lw $t6, -20($fp) - bgtu $t5, $t6, label_NEXT0_7 - # LOCAL local_ttrib__g__init_n_6 --> -28($fp) - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_n_6 = local_ttrib__g__init_internal_0 - lw $t5, -4($fp) - sw $t5, -28($fp) - # LOCAL local_ttrib__g__init_internal_7 --> -32($fp) - # local_ttrib__g__init_internal_7 = ALLOCATE Foo - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) - # Load type offset - li $t7, 8 - sw $t7, 8($v0) - la $t7, Foo - sw $t7, 12($v0) - li $t7, 3 - sw $t7, 16($v0) - move $t7, $v0 - # Allocating 32 bytes of memory - li $a0, 32 - li $v0, 9 - syscall - sw $t7, 0($v0) - la $t7, Foo_start - sw $t7, 4($v0) - # Load type offset - li $t7, 24 - sw $t7, 8($v0) - move $t6, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t6 into stack - subu $sp, $sp, 4 - sw $t6, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t6) - # Push register t6 into stack - subu $sp, $sp, 4 - sw $t6, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t6) - # Push register t6 into stack - subu $sp, $sp, 4 - sw $t6, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t6) - # Push register t6 into stack - subu $sp, $sp, 4 - sw $t6, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t6) - # Push register t6 into stack - subu $sp, $sp, 4 - sw $t6, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t6) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t6, -32($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__g__init_internal_7 --> -32($fp) - # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_7 - lw $t6, -32($fp) - sw $t6, -16($fp) - # GOTO label_END_6 -j label_END_6 -label_NEXT0_7: - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # Load TDT pointer to type Razz - la $t6, Razz__TDT - lw $t7, -8($fp) - addu $t6, $t6, $t7 - # Save distance - lw $t7, 0($t6) - sw $t7, -24($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # Update min if 14 < 15 - lw $t6, -24($fp) - lw $t7, -20($fp) - bgtu $t6, $t7, label_NEXT1_8 - # LOCAL local_ttrib__g__init_n_8 --> -36($fp) - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_n_8 = local_ttrib__g__init_internal_0 - lw $t6, -4($fp) - sw $t6, -36($fp) - # LOCAL local_ttrib__g__init_internal_9 --> -40($fp) - # local_ttrib__g__init_internal_9 = ALLOCATE Bar + # Allocating string for type Int + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) + la $t2, Int + sw $t2, 12($v0) + li $t2, 3 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Int_start + sw $t2, 4($v0) + sw $t1, 8($v0) + sw $v0, -20($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type name - la $t8, String - sw $t8, 0($v0) - la $t8, String_start - sw $t8, 4($v0) + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) # Load type offset - li $t8, 8 - sw $t8, 8($v0) - la $t8, Bar - sw $t8, 12($v0) - li $t8, 3 - sw $t8, 16($v0) - move $t8, $v0 - # Allocating 48 bytes of memory - li $a0, 48 + li $t1, 16 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall - sw $t8, 0($v0) - la $t8, Bar_start - sw $t8, 4($v0) - # Load type offset - li $t8, 32 - sw $t8, 8($v0) - move $t7, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t7 into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t7) - # Push register t7 into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t7) - # Push register t7 into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t7) - # Push register t7 into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t7) - # Push register t7 into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t7) - # Push register t7 into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) - addu $sp, $sp, 4 - sw $v0, 32($t7) - # Push register t7 into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) - addu $sp, $sp, 4 - sw $v0, 36($t7) - # Push register t7 into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - jal __Bar__attrib__c__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) - addu $sp, $sp, 4 - sw $v0, 40($t7) - # Push register t7 into stack - subu $sp, $sp, 4 - sw $t7, 0($sp) - jal __Bar__attrib__d__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) - addu $sp, $sp, 4 - sw $v0, 44($t7) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t7, -40($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__g__init_internal_9 --> -40($fp) - # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_9 - lw $t7, -40($fp) - sw $t7, -16($fp) - # GOTO label_END_6 -j label_END_6 -label_NEXT1_8: - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Foo - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # Load TDT pointer to type Foo - la $t7, Foo__TDT - lw $t8, -8($fp) - addu $t7, $t7, $t8 - # Save distance - lw $t8, 0($t7) - sw $t8, -24($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # Update min if 15 < 24 - lw $t7, -24($fp) - lw $t8, -20($fp) - bgtu $t7, $t8, label_NEXT2_9 - # LOCAL local_ttrib__g__init_n_10 --> -44($fp) - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_n_10 = local_ttrib__g__init_internal_0 - lw $t7, -4($fp) - sw $t7, -44($fp) - # LOCAL local_ttrib__g__init_internal_11 --> -48($fp) - # local_ttrib__g__init_internal_11 = ALLOCATE Razz + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + li $t1, 3 + sw $t1, 8($v0) + sw $v0, -40($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_3 = local_main_at_Main_internal_4 / local_main_at_Main_internal_9 + lw $t2, -20($fp) + lw $t1, 8($t2) + lw $t2, -40($fp) + lw $t3, 8($t2) + div $t1, $t1, $t3 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type name - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) + # Allocating string for type Int + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) # Load type offset - li $t9, 8 - sw $t9, 8($v0) - la $t9, Razz - sw $t9, 12($v0) - li $t9, 4 - sw $t9, 16($v0) - move $t9, $v0 - # Allocating 40 bytes of memory - li $a0, 40 + li $t2, 16 + sw $t2, 8($v0) + la $t2, Int + sw $t2, 12($v0) + li $t2, 3 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall - sw $t9, 0($v0) - la $t9, Razz_start - sw $t9, 4($v0) - # Load type offset - li $t9, 28 - sw $t9, 8($v0) - move $t8, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t8) - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t8) - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t8) - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t8) - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t8) - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 32($t8) - # Push register t8 into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) - addu $sp, $sp, 4 - sw $v0, 36($t8) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t8, -48($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__g__init_internal_11 --> -48($fp) - # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_11 - lw $t8, -48($fp) - sw $t8, -16($fp) - # GOTO label_END_6 -j label_END_6 -label_NEXT2_9: - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # Load TDT pointer to type Bar - la $t8, Bar__TDT - lw $t9, -8($fp) - addu $t8, $t8, $t9 - # Save distance - lw $t9, 0($t8) - sw $t9, -24($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # Update min if 24 < 25 - lw $t8, -24($fp) - lw $t9, -20($fp) - bgtu $t8, $t9, label_NEXT3_10 - # LOCAL local_ttrib__g__init_n_12 --> -52($fp) - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_n_12 = local_ttrib__g__init_internal_0 - lw $t8, -4($fp) - sw $t8, -52($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__g__init_n_12 --> -52($fp) - # local_ttrib__g__init_internal_3 = local_ttrib__g__init_n_12 - lw $t8, -52($fp) - sw $t8, -16($fp) - # GOTO label_END_6 -j label_END_6 -label_NEXT3_10: - label_ERROR_5: - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - lw $t8, 0($s1) - sw $t8, -4($fp) - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - label_END_6: -# RETURN local_ttrib__g__init_internal_3 -lw $v0, -16($fp) -# Deallocate stack frame for function __Bazz__attrib__g__init. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 60 -jr $ra -# Function END - - -# __Bazz__attrib__i__init implementation. -# @Params: -__Bazz__attrib__i__init: - # Allocate stack frame for function __Bazz__attrib__i__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__i__init_internal_2 --> -12($fp) - # local_ttrib__i__init_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_ttrib__i__init_internal_0 --> -4($fp) - # LOCAL local_ttrib__i__init_internal_2 --> -12($fp) - # local_ttrib__i__init_internal_0 = local_ttrib__i__init_internal_2 - lw $t8, -12($fp) - sw $t8, -4($fp) - # Push register s1 into stack + sw $t2, 0($v0) + la $t2, Int_start + sw $t2, 4($v0) + sw $t1, 8($v0) + sw $v0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t1, -16($fp) + # Push arg into stack subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_ttrib__i__init_internal_0 --> -4($fp) - # LOCAL local_ttrib__i__init_internal_1 --> -8($fp) - # local_ttrib__i__init_internal_1 = VCALL local_ttrib__i__init_internal_0 printh + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_int # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t8, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $t9, 0($t8) + lw $t2, 0($t1) # Get pointer to function address - lw $s2, 28($t9) + lw $t3, 16($t2) # Call function. Result is on $v0 - jalr $s2 + jalr $t3 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN local_ttrib__i__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Bazz__attrib__i__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_printh_at_Bazz implementation. -# @Params: -function_printh_at_Bazz: - # Allocate stack frame for function function_printh_at_Bazz. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_printh_at_Bazz_internal_2 --> -12($fp) - # local_printh_at_Bazz_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_printh_at_Bazz_internal_0 --> -4($fp) - # LOCAL local_printh_at_Bazz_internal_2 --> -12($fp) - # local_printh_at_Bazz_internal_0 = local_printh_at_Bazz_internal_2 - lw $t8, -12($fp) - sw $t8, -4($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 + lw $t1, -52($fp) + sw $t1, -44($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_printh_at_Bazz_internal_3 = GETATTRIBUTE h Bazz - # LOCAL local_printh_at_Bazz_internal_3 --> -16($fp) - lw $t8, 12($s1) - sw $t8, -16($fp) - # ARG local_printh_at_Bazz_internal_3 - # LOCAL local_printh_at_Bazz_internal_3 --> -16($fp) - lw $t8, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t8, 0($sp) - # LOCAL local_printh_at_Bazz_internal_0 --> -4($fp) - # LOCAL local_printh_at_Bazz_internal_1 --> -8($fp) - # local_printh_at_Bazz_internal_1 = VCALL local_printh_at_Bazz_internal_0 out_int - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t8, 4($s1) - # Get pointer to type's VTABLE - lw $t9, 0($t8) - # Get pointer to function address - lw $s2, 16($t9) - # Call function. Result is on $v0 - jalr $s2 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function function_printh_at_Bazz. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_doh_at_Bazz implementation. -# @Params: -function_doh_at_Bazz: - # Allocate stack frame for function function_doh_at_Bazz. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_doh_at_Bazz_internal_1 = GETATTRIBUTE h Bazz - # LOCAL local_doh_at_Bazz_internal_1 --> -8($fp) - lw $t8, 12($s1) - sw $t8, -8($fp) - # LOCAL local_doh_at_Bazz_i_0 --> -4($fp) - # LOCAL local_doh_at_Bazz_internal_1 --> -8($fp) - # local_doh_at_Bazz_i_0 = local_doh_at_Bazz_internal_1 - lw $t8, -8($fp) - sw $t8, -4($fp) - # local_doh_at_Bazz_internal_3 = GETATTRIBUTE h Bazz - # LOCAL local_doh_at_Bazz_internal_3 --> -16($fp) - lw $t8, 12($s1) - sw $t8, -16($fp) - # LOCAL local_doh_at_Bazz_internal_2 --> -12($fp) - # LOCAL local_doh_at_Bazz_internal_3 --> -16($fp) - # local_doh_at_Bazz_internal_2 = local_doh_at_Bazz_internal_3 + 1 - lw $t8, -16($fp) - add $t8, $t8, 1 - sw $t8, -12($fp) - # - # LOCAL local_doh_at_Bazz_internal_2 --> -12($fp) - lw $t8, -12($fp) - sw $t8, 12($s1) - # RETURN local_doh_at_Bazz_i_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_doh_at_Bazz. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Foo__attrib__a__init implementation. -# @Params: -__Foo__attrib__a__init: - # Allocate stack frame for function __Foo__attrib__a__init. - subu $sp, $sp, 52 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 52 - # LOCAL local_trib__a__init_internal_0 --> -4($fp) - # local_trib__a__init_internal_0 = SELF - sw $s1, -4($fp) - # LOCAL local_trib__a__init_internal_0 --> -4($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - # local_trib__a__init_internal_1 = TYPEOF local_trib__a__init_internal_0 - lw $t8, -4($fp) - # Load pointer to type offset - lw $t9, 8($t8) - sw $t9, -8($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # local_trib__a__init_internal_4 = 13 - li $t8, 13 - sw $t8, -20($fp) - # local_trib__a__init_internal_5 = TYPE_DISTANCE Razz - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - # Load TDT pointer to type Razz - la $t8, Razz__TDT - lw $t9, -8($fp) - addu $t8, $t8, $t9 - # Save distance - lw $t9, 0($t8) - sw $t9, -24($fp) - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # Update min if 24 < 25 - lw $t8, -24($fp) - lw $t9, -20($fp) - bgtu $t8, $t9, label_Not_min0_11 - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # local_trib__a__init_internal_4 = local_trib__a__init_internal_5 - lw $t8, -24($fp) - sw $t8, -20($fp) - label_Not_min0_11: - # local_trib__a__init_internal_5 = TYPE_DISTANCE Foo - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - # Load TDT pointer to type Foo - la $t8, Foo__TDT - lw $t9, -8($fp) - addu $t8, $t8, $t9 - # Save distance - lw $t9, 0($t8) - sw $t9, -24($fp) - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # Update min if 24 < 25 - lw $t8, -24($fp) - lw $t9, -20($fp) - bgtu $t8, $t9, label_Not_min1_12 - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # local_trib__a__init_internal_4 = local_trib__a__init_internal_5 - lw $t8, -24($fp) - sw $t8, -20($fp) - label_Not_min1_12: - # local_trib__a__init_internal_5 = TYPE_DISTANCE Bar - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - # Load TDT pointer to type Bar - la $t8, Bar__TDT - lw $t9, -8($fp) - addu $t8, $t8, $t9 - # Save distance - lw $t9, 0($t8) - sw $t9, -24($fp) - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # Update min if 24 < 25 - lw $t8, -24($fp) - lw $t9, -20($fp) - bgtu $t8, $t9, label_Not_min2_13 - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # local_trib__a__init_internal_4 = local_trib__a__init_internal_5 - lw $t8, -24($fp) - sw $t8, -20($fp) - label_Not_min2_13: - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # local_trib__a__init_internal_5 = 13 - li $t8, 13 - sw $t8, -24($fp) - # LOCAL local_trib__a__init_internal_2 --> -12($fp) - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # local_trib__a__init_internal_2 = local_trib__a__init_internal_5 - local_trib__a__init_internal_4 - lw $t8, -24($fp) - lw $t9, -20($fp) - sub $t8, $t8, $t9 - sw $t8, -12($fp) - # IF_ZERO local_trib__a__init_internal_2 GOTO label_ERROR_14 - # IF_ZERO local_trib__a__init_internal_2 GOTO label_ERROR_14 - lw $t8, -12($fp) - beq $t8, 0, label_ERROR_14 - # local_trib__a__init_internal_5 = TYPE_DISTANCE Razz - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - # Load TDT pointer to type Razz - la $t8, Razz__TDT - lw $t9, -8($fp) - addu $t8, $t8, $t9 - # Save distance - lw $t9, 0($t8) - sw $t9, -24($fp) - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # Update min if 24 < 25 - lw $t8, -24($fp) - lw $t9, -20($fp) - bgtu $t8, $t9, label_NEXT0_16 - # LOCAL local_trib__a__init_n_6 --> -28($fp) - # LOCAL local_trib__a__init_internal_0 --> -4($fp) - # local_trib__a__init_n_6 = local_trib__a__init_internal_0 - lw $t8, -4($fp) - sw $t8, -28($fp) - # LOCAL local_trib__a__init_internal_7 --> -32($fp) - # local_trib__a__init_internal_7 = ALLOCATE Bar - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $s2, String - sw $s2, 0($v0) - la $s2, String_start - sw $s2, 4($v0) - # Load type offset - li $s2, 8 - sw $s2, 8($v0) - la $s2, Bar - sw $s2, 12($v0) - li $s2, 3 - sw $s2, 16($v0) - move $s2, $v0 - # Allocating 48 bytes of memory - li $a0, 48 - li $v0, 9 - syscall - sw $s2, 0($v0) - la $s2, Bar_start - sw $s2, 4($v0) - # Load type offset - li $s2, 32 - sw $s2, 8($v0) - move $t9, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t9) - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t9) - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t9) - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t9) - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t9) - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 32($t9) - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 36($t9) - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Bar__attrib__c__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 40($t9) - # Push register t9 into stack - subu $sp, $sp, 4 - sw $t9, 0($sp) - jal __Bar__attrib__d__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) - addu $sp, $sp, 4 - sw $v0, 44($t9) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t9, -32($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # LOCAL local_trib__a__init_internal_7 --> -32($fp) - # local_trib__a__init_internal_3 = local_trib__a__init_internal_7 - lw $t9, -32($fp) - sw $t9, -16($fp) - # GOTO label_END_15 -j label_END_15 -label_NEXT0_16: - # local_trib__a__init_internal_5 = TYPE_DISTANCE Foo - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - # Load TDT pointer to type Foo - la $t9, Foo__TDT - lw $s2, -8($fp) - addu $t9, $t9, $s2 - # Save distance - lw $s2, 0($t9) - sw $s2, -24($fp) - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # Update min if 25 < 18 - lw $t9, -24($fp) - lw $s2, -20($fp) - bgtu $t9, $s2, label_NEXT1_17 - # LOCAL local_trib__a__init_n_8 --> -36($fp) - # LOCAL local_trib__a__init_internal_0 --> -4($fp) - # local_trib__a__init_n_8 = local_trib__a__init_internal_0 - lw $t9, -4($fp) - sw $t9, -36($fp) - # LOCAL local_trib__a__init_internal_9 --> -40($fp) - # local_trib__a__init_internal_9 = ALLOCATE Razz + # LOCAL local_main_at_Main_internal_13 --> -56($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type name - la $s3, String - sw $s3, 0($v0) - la $s3, String_start - sw $s3, 4($v0) - # Load type offset - li $s3, 8 - sw $s3, 8($v0) - la $s3, Razz - sw $s3, 12($v0) - li $s3, 4 - sw $s3, 16($v0) - move $s3, $v0 - # Allocating 40 bytes of memory - li $a0, 40 - li $v0, 9 - syscall - sw $s3, 0($v0) - la $s3, Razz_start - sw $s3, 4($v0) + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) # Load type offset - li $s3, 28 - sw $s3, 8($v0) - move $s2, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register s2 into stack - subu $sp, $sp, 4 - sw $s2, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register s2 - lw $s2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($s2) - # Push register s2 into stack - subu $sp, $sp, 4 - sw $s2, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register s2 - lw $s2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($s2) - # Push register s2 into stack - subu $sp, $sp, 4 - sw $s2, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register s2 - lw $s2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($s2) - # Push register s2 into stack - subu $sp, $sp, 4 - sw $s2, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register s2 - lw $s2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($s2) - # Push register s2 into stack - subu $sp, $sp, 4 - sw $s2, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register s2 - lw $s2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($s2) - # Push register s2 into stack - subu $sp, $sp, 4 - sw $s2, 0($sp) - jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register s2 - lw $s2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 32($s2) - # Push register s2 into stack - subu $sp, $sp, 4 - sw $s2, 0($sp) - jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register s2 - lw $s2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 36($s2) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $s2, -40($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # LOCAL local_trib__a__init_internal_9 --> -40($fp) - # local_trib__a__init_internal_3 = local_trib__a__init_internal_9 - lw $s2, -40($fp) - sw $s2, -16($fp) - # GOTO label_END_15 -j label_END_15 -label_NEXT1_17: - # local_trib__a__init_internal_5 = TYPE_DISTANCE Bar - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - # Load TDT pointer to type Bar - la $s2, Bar__TDT - lw $s3, -8($fp) - addu $s2, $s2, $s3 - # Save distance - lw $s3, 0($s2) - sw $s3, -24($fp) - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # Update min if 18 < 19 - lw $s2, -24($fp) - lw $s3, -20($fp) - bgtu $s2, $s3, label_NEXT2_18 - # LOCAL local_trib__a__init_n_10 --> -44($fp) - # LOCAL local_trib__a__init_internal_0 --> -4($fp) - # local_trib__a__init_n_10 = local_trib__a__init_internal_0 - lw $s2, -4($fp) - sw $s2, -44($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # LOCAL local_trib__a__init_n_10 --> -44($fp) - # local_trib__a__init_internal_3 = local_trib__a__init_n_10 - lw $s2, -44($fp) - sw $s2, -16($fp) - # GOTO label_END_15 -j label_END_15 -label_NEXT2_18: - label_ERROR_14: - # LOCAL local_trib__a__init_internal_0 --> -4($fp) - lw $s2, 0($s1) - sw $s2, -4($fp) - # LOCAL local_trib__a__init_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - label_END_15: -# RETURN local_trib__a__init_internal_3 -lw $v0, -16($fp) -# Deallocate stack frame for function __Foo__attrib__a__init. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 52 -jr $ra -# Function END - - -# __Foo__attrib__b__init implementation. -# @Params: -__Foo__attrib__b__init: - # Allocate stack frame for function __Foo__attrib__b__init. - subu $sp, $sp, 68 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 68 - # local_trib__b__init_internal_5 = GETATTRIBUTE a Foo - # LOCAL local_trib__b__init_internal_5 --> -24($fp) - lw $s2, 24($s1) - sw $s2, -24($fp) - # LOCAL local_trib__b__init_internal_3 --> -16($fp) - # LOCAL local_trib__b__init_internal_5 --> -24($fp) - # local_trib__b__init_internal_3 = local_trib__b__init_internal_5 - lw $s2, -24($fp) - sw $s2, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_trib__b__init_internal_3 --> -16($fp) - # LOCAL local_trib__b__init_internal_4 --> -20($fp) - # local_trib__b__init_internal_4 = VCALL local_trib__b__init_internal_3 doh - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $s2, 4($s1) - # Get pointer to type's VTABLE - lw $s3, 0($s2) - # Get pointer to function address - lw $s4, 32($s3) - # Call function. Result is on $v0 - jalr $s4 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_trib__b__init_internal_8 = GETATTRIBUTE g Foo - # LOCAL local_trib__b__init_internal_8 --> -36($fp) - lw $s2, 16($s1) - sw $s2, -36($fp) - # LOCAL local_trib__b__init_internal_6 --> -28($fp) - # LOCAL local_trib__b__init_internal_8 --> -36($fp) - # local_trib__b__init_internal_6 = local_trib__b__init_internal_8 - lw $s2, -36($fp) - sw $s2, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_trib__b__init_internal_6 --> -28($fp) - # LOCAL local_trib__b__init_internal_7 --> -32($fp) - # local_trib__b__init_internal_7 = VCALL local_trib__b__init_internal_6 doh - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $s2, 4($s1) - # Get pointer to type's VTABLE - lw $s3, 0($s2) - # Get pointer to function address - lw $s4, 32($s3) - # Call function. Result is on $v0 - jalr $s4 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_trib__b__init_internal_2 --> -12($fp) - # LOCAL local_trib__b__init_internal_4 --> -20($fp) - # LOCAL local_trib__b__init_internal_7 --> -32($fp) - # local_trib__b__init_internal_2 = local_trib__b__init_internal_4 + local_trib__b__init_internal_7 - lw $s2, -20($fp) - lw $s3, -32($fp) - add $s2, $s2, $s3 - sw $s2, -12($fp) - # LOCAL local_trib__b__init_internal_11 --> -48($fp) - # local_trib__b__init_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_trib__b__init_internal_9 --> -40($fp) - # LOCAL local_trib__b__init_internal_11 --> -48($fp) - # local_trib__b__init_internal_9 = local_trib__b__init_internal_11 - lw $s2, -48($fp) - sw $s2, -40($fp) - # Push register s1 into stack + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_4 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -56($fp) + # ARG local_main_at_Main_internal_13 + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + lw $t1, -56($fp) + # Push arg into stack subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_trib__b__init_internal_9 --> -40($fp) - # LOCAL local_trib__b__init_internal_10 --> -44($fp) - # local_trib__b__init_internal_10 = VCALL local_trib__b__init_internal_9 doh + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 out_string # Save new self pointer in $s1 - lw $s1, -40($fp) + lw $s1, -44($fp) # Get pointer to type - lw $s2, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $s3, 0($s2) + lw $t2, 0($t1) # Get pointer to function address - lw $s4, 32($s3) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $s4 - sw $v0, -44($fp) + jalr $t3 + sw $v0, -48($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_trib__b__init_internal_1 --> -8($fp) - # LOCAL local_trib__b__init_internal_2 --> -12($fp) - # LOCAL local_trib__b__init_internal_10 --> -44($fp) - # local_trib__b__init_internal_1 = local_trib__b__init_internal_2 + local_trib__b__init_internal_10 - lw $s2, -12($fp) - lw $s3, -44($fp) - add $s2, $s2, $s3 - sw $s2, -8($fp) - # LOCAL local_trib__b__init_internal_14 --> -60($fp) - # local_trib__b__init_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_trib__b__init_internal_12 --> -52($fp) - # LOCAL local_trib__b__init_internal_14 --> -60($fp) - # local_trib__b__init_internal_12 = local_trib__b__init_internal_14 - lw $s2, -60($fp) - sw $s2, -52($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_14 = local_main_at_Main_internal_16 + lw $t1, -68($fp) + sw $t1, -60($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_trib__b__init_internal_12 --> -52($fp) - # LOCAL local_trib__b__init_internal_13 --> -56($fp) - # local_trib__b__init_internal_13 = VCALL local_trib__b__init_internal_12 printh - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $s2, 4($s1) - # Get pointer to type's VTABLE - lw $s3, 0($s2) - # Get pointer to function address - lw $s4, 28($s3) - # Call function. Result is on $v0 - jalr $s4 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_trib__b__init_internal_0 --> -4($fp) - # LOCAL local_trib__b__init_internal_1 --> -8($fp) - # LOCAL local_trib__b__init_internal_13 --> -56($fp) - # local_trib__b__init_internal_0 = local_trib__b__init_internal_1 + local_trib__b__init_internal_13 - lw $s2, -8($fp) - lw $s3, -56($fp) - add $s2, $s2, $s3 - sw $s2, -4($fp) - # RETURN local_trib__b__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Foo__attrib__b__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 68 - jr $ra - # Function END - - -# function_doh_at_Foo implementation. -# @Params: -function_doh_at_Foo: - # Allocate stack frame for function function_doh_at_Foo. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_doh_at_Foo_internal_1 = GETATTRIBUTE h Foo - # LOCAL local_doh_at_Foo_internal_1 --> -8($fp) - lw $s2, 12($s1) - sw $s2, -8($fp) - # LOCAL local_doh_at_Foo_i_0 --> -4($fp) - # LOCAL local_doh_at_Foo_internal_1 --> -8($fp) - # local_doh_at_Foo_i_0 = local_doh_at_Foo_internal_1 - lw $s2, -8($fp) - sw $s2, -4($fp) - # local_doh_at_Foo_internal_3 = GETATTRIBUTE h Foo - # LOCAL local_doh_at_Foo_internal_3 --> -16($fp) - lw $s2, 12($s1) - sw $s2, -16($fp) - # LOCAL local_doh_at_Foo_internal_2 --> -12($fp) - # LOCAL local_doh_at_Foo_internal_3 --> -16($fp) - # local_doh_at_Foo_internal_2 = local_doh_at_Foo_internal_3 + 2 - lw $s2, -16($fp) - add $s2, $s2, 2 - sw $s2, -12($fp) - # - # LOCAL local_doh_at_Foo_internal_2 --> -12($fp) - lw $s2, -12($fp) - sw $s2, 12($s1) - # RETURN local_doh_at_Foo_i_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_doh_at_Foo. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Razz__attrib__e__init implementation. -# @Params: -__Razz__attrib__e__init: - # Allocate stack frame for function __Razz__attrib__e__init. - subu $sp, $sp, 44 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 44 - # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) - # local_ttrib__e__init_internal_0 = SELF - sw $s1, -4($fp) - # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) - # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) - # local_ttrib__e__init_internal_1 = TYPEOF local_ttrib__e__init_internal_0 - lw $s2, -4($fp) - # Load pointer to type offset - lw $s3, 8($s2) - sw $s3, -8($fp) - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # local_ttrib__e__init_internal_4 = 13 - li $s2, 13 - sw $s2, -20($fp) - # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) - # Load TDT pointer to type Razz - la $s2, Razz__TDT - lw $s3, -8($fp) - addu $s2, $s2, $s3 - # Save distance - lw $s3, 0($s2) - sw $s3, -24($fp) - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # Update min if 18 < 19 - lw $s2, -24($fp) - lw $s3, -20($fp) - bgtu $s2, $s3, label_Not_min0_19 - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # local_ttrib__e__init_internal_4 = local_ttrib__e__init_internal_5 - lw $s2, -24($fp) - sw $s2, -20($fp) - label_Not_min0_19: - # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) - # Load TDT pointer to type Bar - la $s2, Bar__TDT - lw $s3, -8($fp) - addu $s2, $s2, $s3 - # Save distance - lw $s3, 0($s2) - sw $s3, -24($fp) - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # Update min if 18 < 19 - lw $s2, -24($fp) - lw $s3, -20($fp) - bgtu $s2, $s3, label_Not_min1_20 - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # local_ttrib__e__init_internal_4 = local_ttrib__e__init_internal_5 - lw $s2, -24($fp) - sw $s2, -20($fp) - label_Not_min1_20: - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # local_ttrib__e__init_internal_5 = 13 - li $s2, 13 - sw $s2, -24($fp) - # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # local_ttrib__e__init_internal_2 = local_ttrib__e__init_internal_5 - local_ttrib__e__init_internal_4 - lw $s2, -24($fp) - lw $s3, -20($fp) - sub $s2, $s2, $s3 - sw $s2, -12($fp) - # IF_ZERO local_ttrib__e__init_internal_2 GOTO label_ERROR_21 - # IF_ZERO local_ttrib__e__init_internal_2 GOTO label_ERROR_21 - lw $s2, -12($fp) - beq $s2, 0, label_ERROR_21 - # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) - # Load TDT pointer to type Razz - la $s2, Razz__TDT - lw $s3, -8($fp) - addu $s2, $s2, $s3 - # Save distance - lw $s3, 0($s2) - sw $s3, -24($fp) - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # Update min if 18 < 19 - lw $s2, -24($fp) - lw $s3, -20($fp) - bgtu $s2, $s3, label_NEXT0_23 - # LOCAL local_ttrib__e__init_n_6 --> -28($fp) - # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) - # local_ttrib__e__init_n_6 = local_ttrib__e__init_internal_0 - lw $s2, -4($fp) - sw $s2, -28($fp) - # LOCAL local_ttrib__e__init_internal_7 --> -32($fp) - # local_ttrib__e__init_internal_7 = ALLOCATE Bar - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $s4, String - sw $s4, 0($v0) - la $s4, String_start - sw $s4, 4($v0) - # Load type offset - li $s4, 8 - sw $s4, 8($v0) - la $s4, Bar - sw $s4, 12($v0) - li $s4, 3 - sw $s4, 16($v0) - move $s4, $v0 - # Allocating 48 bytes of memory - li $a0, 48 - li $v0, 9 - syscall - sw $s4, 0($v0) - la $s4, Bar_start - sw $s4, 4($v0) - # Load type offset - li $s4, 32 - sw $s4, 8($v0) - move $s3, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register s3 into stack - subu $sp, $sp, 4 - sw $s3, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register s3 - lw $s3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($s3) - # Push register s3 into stack - subu $sp, $sp, 4 - sw $s3, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register s3 - lw $s3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($s3) - # Push register s3 into stack - subu $sp, $sp, 4 - sw $s3, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register s3 - lw $s3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($s3) - # Push register s3 into stack - subu $sp, $sp, 4 - sw $s3, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register s3 - lw $s3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($s3) - # Push register s3 into stack - subu $sp, $sp, 4 - sw $s3, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register s3 - lw $s3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($s3) - # Push register s3 into stack - subu $sp, $sp, 4 - sw $s3, 0($sp) - jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register s3 - lw $s3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 32($s3) - # Push register s3 into stack - subu $sp, $sp, 4 - sw $s3, 0($sp) - jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register s3 - lw $s3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 36($s3) - # Push register s3 into stack - subu $sp, $sp, 4 - sw $s3, 0($sp) - jal __Bar__attrib__c__init - # Pop 4 bytes from stack into register s3 - lw $s3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 40($s3) - # Push register s3 into stack - subu $sp, $sp, 4 - sw $s3, 0($sp) - jal __Bar__attrib__d__init - # Pop 4 bytes from stack into register s3 - lw $s3, 0($sp) - addu $sp, $sp, 4 - sw $v0, 44($s3) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $s3, -32($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__e__init_internal_7 --> -32($fp) - # local_ttrib__e__init_internal_3 = local_ttrib__e__init_internal_7 - lw $s3, -32($fp) - sw $s3, -16($fp) - # GOTO label_END_22 -j label_END_22 -label_NEXT0_23: - # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) - # Load TDT pointer to type Bar - la $s3, Bar__TDT - lw $s4, -8($fp) - addu $s3, $s3, $s4 - # Save distance - lw $s4, 0($s3) - sw $s4, -24($fp) - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # Update min if 19 < 20 - lw $s3, -24($fp) - lw $s4, -20($fp) - bgtu $s3, $s4, label_NEXT1_24 - # LOCAL local_ttrib__e__init_n_8 --> -36($fp) - # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) - # local_ttrib__e__init_n_8 = local_ttrib__e__init_internal_0 - lw $s3, -4($fp) - sw $s3, -36($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__e__init_n_8 --> -36($fp) - # local_ttrib__e__init_internal_3 = local_ttrib__e__init_n_8 - lw $s3, -36($fp) - sw $s3, -16($fp) - # GOTO label_END_22 -j label_END_22 -label_NEXT1_24: - label_ERROR_21: - # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) - lw $s3, 0($s1) - sw $s3, -4($fp) - # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - label_END_22: -# RETURN local_ttrib__e__init_internal_3 -lw $v0, -16($fp) -# Deallocate stack frame for function __Razz__attrib__e__init. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 44 -jr $ra -# Function END - - -# __Razz__attrib__f__init implementation. -# @Params: -__Razz__attrib__f__init: - # Allocate stack frame for function __Razz__attrib__f__init. - subu $sp, $sp, 80 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 80 - # local_ttrib__f__init_internal_5 = GETATTRIBUTE a Razz - # LOCAL local_ttrib__f__init_internal_5 --> -24($fp) - lw $s3, 24($s1) - sw $s3, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_ttrib__f__init_internal_4 = CALL doh - # LOCAL local_ttrib__f__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__f__init_internal_5 --> -24($fp) - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type's VTABLE - la $s3, Bazz_vtable - # Get pointer to function address - lw $s4, 32($s3) - # Call function. Result is on $v0 - jalr $s4 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_ttrib__f__init_internal_8 = GETATTRIBUTE g Razz - # LOCAL local_ttrib__f__init_internal_8 --> -36($fp) - lw $s3, 16($s1) - sw $s3, -36($fp) - # LOCAL local_ttrib__f__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__f__init_internal_8 --> -36($fp) - # local_ttrib__f__init_internal_6 = local_ttrib__f__init_internal_8 - lw $s3, -36($fp) - sw $s3, -28($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_5 + sw $t1, 12($v0) + li $t1, 5 + sw $t1, 16($v0) + sw $v0, -80($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_17 = local_main_at_Main_internal_19 + lw $t1, -80($fp) + sw $t1, -72($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_ttrib__f__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__f__init_internal_7 --> -32($fp) - # local_ttrib__f__init_internal_7 = VCALL local_ttrib__f__init_internal_6 doh - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $s3, 4($s1) - # Get pointer to type's VTABLE - lw $s4, 0($s3) - # Get pointer to function address - lw $s5, 32($s4) - # Call function. Result is on $v0 - jalr $s5 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_ttrib__f__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__f__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__f__init_internal_7 --> -32($fp) - # local_ttrib__f__init_internal_3 = local_ttrib__f__init_internal_4 + local_ttrib__f__init_internal_7 - lw $s3, -20($fp) - lw $s4, -32($fp) - add $s3, $s3, $s4 - sw $s3, -16($fp) - # local_ttrib__f__init_internal_11 = GETATTRIBUTE e Razz - # LOCAL local_ttrib__f__init_internal_11 --> -48($fp) - lw $s3, 32($s1) - sw $s3, -48($fp) - # LOCAL local_ttrib__f__init_internal_9 --> -40($fp) - # LOCAL local_ttrib__f__init_internal_11 --> -48($fp) - # local_ttrib__f__init_internal_9 = local_ttrib__f__init_internal_11 - lw $s3, -48($fp) - sw $s3, -40($fp) - # Push register s1 into stack + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + li $t1, 1 + sw $t1, 8($v0) + sw $v0, -84($fp) + # ARG local_main_at_Main_internal_20 + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + lw $t1, -84($fp) + # Push arg into stack subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_ttrib__f__init_internal_9 --> -40($fp) - # LOCAL local_ttrib__f__init_internal_10 --> -44($fp) - # local_ttrib__f__init_internal_10 = VCALL local_ttrib__f__init_internal_9 doh - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $s3, 4($s1) - # Get pointer to type's VTABLE - lw $s4, 0($s3) - # Get pointer to function address - lw $s5, 32($s4) - # Call function. Result is on $v0 - jalr $s5 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_ttrib__f__init_internal_2 --> -12($fp) - # LOCAL local_ttrib__f__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__f__init_internal_10 --> -44($fp) - # local_ttrib__f__init_internal_2 = local_ttrib__f__init_internal_3 + local_ttrib__f__init_internal_10 - lw $s3, -16($fp) - lw $s4, -44($fp) - add $s3, $s3, $s4 - sw $s3, -12($fp) - # LOCAL local_ttrib__f__init_internal_14 --> -60($fp) - # local_ttrib__f__init_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_ttrib__f__init_internal_12 --> -52($fp) - # LOCAL local_ttrib__f__init_internal_14 --> -60($fp) - # local_ttrib__f__init_internal_12 = local_ttrib__f__init_internal_14 - lw $s3, -60($fp) - sw $s3, -52($fp) - # Push register s1 into stack + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + li $t1, 2 + sw $t1, 8($v0) + sw $v0, -88($fp) + # ARG local_main_at_Main_internal_21 + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + lw $t1, -88($fp) + # Push arg into stack subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_ttrib__f__init_internal_12 --> -52($fp) - # LOCAL local_ttrib__f__init_internal_13 --> -56($fp) - # local_ttrib__f__init_internal_13 = VCALL local_ttrib__f__init_internal_12 doh + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_18 = VCALL local_main_at_Main_internal_17 substr # Save new self pointer in $s1 - lw $s1, -52($fp) + lw $s1, -72($fp) # Get pointer to type - lw $s3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $s4, 0($s3) + lw $t2, 0($t1) # Get pointer to function address - lw $s5, 32($s4) + lw $t3, 16($t2) # Call function. Result is on $v0 - jalr $s5 - sw $v0, -56($fp) + jalr $t3 + sw $v0, -76($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_ttrib__f__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__f__init_internal_2 --> -12($fp) - # LOCAL local_ttrib__f__init_internal_13 --> -56($fp) - # local_ttrib__f__init_internal_1 = local_ttrib__f__init_internal_2 + local_ttrib__f__init_internal_13 - lw $s3, -12($fp) - lw $s4, -56($fp) - add $s3, $s3, $s4 - sw $s3, -8($fp) - # LOCAL local_ttrib__f__init_internal_17 --> -72($fp) - # local_ttrib__f__init_internal_17 = SELF - sw $s1, -72($fp) - # LOCAL local_ttrib__f__init_internal_15 --> -64($fp) - # LOCAL local_ttrib__f__init_internal_17 --> -72($fp) - # local_ttrib__f__init_internal_15 = local_ttrib__f__init_internal_17 - lw $s3, -72($fp) - sw $s3, -64($fp) - # Push register s1 into stack + # ARG local_main_at_Main_internal_18 + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + lw $t1, -76($fp) + # Push arg into stack subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_ttrib__f__init_internal_15 --> -64($fp) - # LOCAL local_ttrib__f__init_internal_16 --> -68($fp) - # local_ttrib__f__init_internal_16 = VCALL local_ttrib__f__init_internal_15 printh + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 out_string # Save new self pointer in $s1 - lw $s1, -64($fp) + lw $s1, -60($fp) # Get pointer to type - lw $s3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $s4, 0($s3) + lw $t2, 0($t1) # Get pointer to function address - lw $s5, 28($s4) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $s5 - sw $v0, -68($fp) + jalr $t3 + sw $v0, -64($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_ttrib__f__init_internal_0 --> -4($fp) - # LOCAL local_ttrib__f__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__f__init_internal_16 --> -68($fp) - # local_ttrib__f__init_internal_0 = local_ttrib__f__init_internal_1 + local_ttrib__f__init_internal_16 - lw $s3, -8($fp) - lw $s4, -68($fp) - add $s3, $s3, $s4 - sw $s3, -4($fp) - # RETURN local_ttrib__f__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Razz__attrib__f__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 80 - jr $ra - # Function END - - -# __Bar__attrib__c__init implementation. -# @Params: -__Bar__attrib__c__init: - # Allocate stack frame for function __Bar__attrib__c__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_trib__c__init_internal_2 --> -12($fp) - # local_trib__c__init_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_trib__c__init_internal_0 --> -4($fp) - # LOCAL local_trib__c__init_internal_2 --> -12($fp) - # local_trib__c__init_internal_0 = local_trib__c__init_internal_2 - lw $s3, -12($fp) - sw $s3, -4($fp) + # LOCAL local_main_at_Main_internal_24 --> -100($fp) + # local_main_at_Main_internal_24 = SELF + sw $s1, -100($fp) + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # LOCAL local_main_at_Main_internal_24 --> -100($fp) + # local_main_at_Main_internal_22 = local_main_at_Main_internal_24 + lw $t1, -100($fp) + sw $t1, -92($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_trib__c__init_internal_0 --> -4($fp) - # LOCAL local_trib__c__init_internal_1 --> -8($fp) - # local_trib__c__init_internal_1 = VCALL local_trib__c__init_internal_0 doh - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $s3, 4($s1) - # Get pointer to type's VTABLE - lw $s4, 0($s3) - # Get pointer to function address - lw $s5, 32($s4) - # Call function. Result is on $v0 - jalr $s5 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_trib__c__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Bar__attrib__c__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Bar__attrib__d__init implementation. -# @Params: -__Bar__attrib__d__init: - # Allocate stack frame for function __Bar__attrib__d__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_trib__d__init_internal_2 --> -12($fp) - # local_trib__d__init_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_trib__d__init_internal_0 --> -4($fp) - # LOCAL local_trib__d__init_internal_2 --> -12($fp) - # local_trib__d__init_internal_0 = local_trib__d__init_internal_2 - lw $s3, -12($fp) - sw $s3, -4($fp) - # Push register s1 into stack + # LOCAL local_main_at_Main_internal_25 --> -104($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, data_6 + sw $t1, 12($v0) + li $t1, 1 + sw $t1, 16($v0) + sw $v0, -104($fp) + # ARG local_main_at_Main_internal_25 + # LOCAL local_main_at_Main_internal_25 --> -104($fp) + lw $t1, -104($fp) + # Push arg into stack subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_trib__d__init_internal_0 --> -4($fp) - # LOCAL local_trib__d__init_internal_1 --> -8($fp) - # local_trib__d__init_internal_1 = VCALL local_trib__d__init_internal_0 printh + sw $t1, 0($sp) + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # local_main_at_Main_internal_23 = VCALL local_main_at_Main_internal_22 out_string # Save new self pointer in $s1 - lw $s1, -4($fp) + lw $s1, -92($fp) # Get pointer to type - lw $s3, 4($s1) + lw $t1, 4($s1) # Get pointer to type's VTABLE - lw $s4, 0($s3) + lw $t2, 0($t1) # Get pointer to function address - lw $s5, 28($s4) + lw $t3, 12($t2) # Call function. Result is on $v0 - jalr $s5 - sw $v0, -8($fp) + jalr $t3 + sw $v0, -96($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN local_trib__d__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Bar__attrib__d__init. + # RETURN local_main_at_Main_internal_23 + lw $v0, -96($fp) + # Deallocate stack frame for function function_main_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 32 + addu $sp, $sp, 112 jr $ra # Function END diff --git a/src/testing.py b/src/testing.py index afa81a75..955864cd 100755 --- a/src/testing.py +++ b/src/testing.py @@ -61,65 +61,14 @@ def pipeline(program: str, deep: int) -> None: text = r"""(* hairy . . .*) - -class Foo inherits Bazz { - a : Razz <- case self of - n : Razz => (new Bar); - n : Foo => (new Razz); - n : Bar => n; - esac; - - b : Int <- a.doh() + g.doh() + doh() + printh(); - - doh() : Int { (let i : Int <- h in { h <- h + 2; i; } ) }; - -}; - -class Bar inherits Razz { - - c : Int <- doh(); - - d : Object <- printh(); -}; - - -class Razz inherits Foo { - - e : Bar <- case self of - n : Razz => (new Bar); - n : Bar => n; - esac; - - f : Int <- a@Bazz.doh() + g.doh() + e.doh() + doh() + printh(); - -}; - -class Bazz inherits IO { - - h : Int <- 1; - - g : Foo <- case self of - n : Bazz => (new Foo); - n : Razz => (new Bar); - n : Foo => (new Razz); - n : Bar => n; - esac; - - i : Object <- printh(); - - printh() : Int { { out_int(h); 0; } }; - - doh() : Int { (let i: Int <- h in { h <- h + 1; i; } ) }; -}; - (* scary . . . *) -class Main { - a : Bazz <- new Bazz; - b : Foo <- new Foo; - c : Razz <- new Razz; - d : Bar <- new Bar; - - main(): String { "do nothing" }; +class Main inherits IO { + main(): IO { { + out_int((10 - 12) * 6 / 3); + out_string("\n"); + out_string("Hello".substr(1,2)); + out_string("\n"); + } }; }; """ diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index e9fbd308..725a0bd2 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -4,9 +4,9 @@ from abstract.semantics import Type from cil.nodes import ( AbortNode, - AllocateBoolNode, + AllocateBoolNode, AllocateIntNode, BitwiseNotNode, - ConcatString, + ConcatString, EqualToCilNode, JumpIfGreater, LocalNode, ) @@ -405,6 +405,65 @@ def _(self, node: AllocateBoolNode): self.used_registers[reg] = False + @visit.register + def _(self, node: AllocateIntNode): + dest = self.visit(node.dest) + value = self.visit(node.value) + assert dest is not None + + size = 20 + + # Reservar memoria para el tipo + self.allocate_memory(size) + reg = self.get_available_register() + + assert reg is not None + + self.comment("Allocating string for type Int") + + # Inicializar la instancia + self.register_instruction(LA(reg, "String")) + self.register_instruction(SW(reg, "0($v0)")) + + self.register_instruction(LA(reg, "String_start")) + self.register_instruction(SW(reg, "4($v0)")) + + # Cargar el offset del tipo + self.comment("Load type offset") + offset = next(i for i, t in enumerate(self.mips_types) if t == "Int") * 4 + self.register_instruction(LI(reg, offset)) + self.register_instruction(SW(reg, "8($v0)")) + + self.register_instruction(LA(reg, "Int")) + self.register_instruction(SW(reg, "12($v0)")) + + self.register_instruction(LI(reg, 3)) + self.register_instruction(SW(reg, "16($v0)")) + + # devolver la instancia + self.register_instruction(MOVE(reg, v0)) + + size = 12 + + self.allocate_memory(size) + + # Almacenar el string al tipo BOOL + self.register_instruction(SW(reg, f"0($v0)")) + + self.register_instruction(LA(reg, "Int_start")) + self.register_instruction(SW(reg, "4($v0)")) + + if isinstance(node.value, int): + self.register_instruction(LI(reg, value)) + else: + self.register_instruction(LW(reg, value)) + self.register_instruction(SW(reg, "8($v0)")) + + # devolver la instancia + self.register_instruction(SW(v0, dest)) + + self.used_registers[reg] = False + @visit.register def _(self, node: cil.AllocateStringNode): dest = self.visit(node.dest) @@ -1185,7 +1244,9 @@ def _(self, node: cil.PrintIntNode): # En mips, syscall 1 se usa para imprimir el entero # almacenado en $a0 # Cargar el entero en $a0 - self.register_instruction(LW(a0, src)) + self.register_instruction(LW(v0, src)) + # Cargar el valor + self.register_instruction(LW(a0, f"8($v0)")) # syscall 1 = print_int self.register_instruction(LI(v0, 1)) self.register_instruction(SYSCALL()) @@ -1201,8 +1262,56 @@ def _(self, node: cil.ReadIntNode): self.register_instruction(LI(v0, 5)) self.register_instruction(SYSCALL()) + # Crear la instancia a Int + self.register_instruction(MOVE(a0, v0)) + + size = 20 + + # Reservar memoria para el tipo + self.allocate_memory(size) + reg2 = self.get_available_register() + + assert reg2 is not None + + self.comment("Allocating string for type Int") + + # Inicializar la instancia + self.register_instruction(LA(reg2, "String")) + self.register_instruction(SW(reg2, "0($v0)")) + + self.register_instruction(LA(reg2, "String_start")) + self.register_instruction(SW(reg2, "4($v0)")) + + # Cargar el offset del tipo + self.comment("Load type offset") + offset = next(i for i, t in enumerate(self.mips_types) if t == "Int") * 4 + self.register_instruction(LI(reg2, offset)) + self.register_instruction(SW(reg2, "8($v0)")) + + self.register_instruction(LA(reg2, "Int")) + self.register_instruction(SW(reg2, "12($v0)")) + + self.register_instruction(LI(reg2, 3)) + self.register_instruction(SW(reg2, "16($v0)")) + + # devolver la instancia + self.register_instruction(MOVE(reg2, v0)) + + size = 12 + + self.allocate_memory(size) + + # Almacenar el string al tipo Int + self.register_instruction(SW(reg2, f"0($v0)")) + + self.register_instruction(LA(reg2, "Int_start")) + self.register_instruction(SW(reg2, "4($v0)")) + + self.register_instruction(SW(a0, "8($v0)")) + # Almacenar el numero leido en dest self.register_instruction(SW(v0, dest)) + self.used_registers[reg2] = False @visit.register def _(self, node: cil.PrintNode): @@ -1261,6 +1370,22 @@ def _(self, node: cil.SelfNode): self.add_source_line_comment(node) self.register_instruction(SW(s1, dest)) + @visit.register + def _(self, node: EqualToCilNode): + dest = self.visit(node.dest) + left = self.visit(node.left) + right = self.visit(node.right) + + # Si left es un string realizar la comparacion entre strings + # si no realizar una resta y devolver el resultado + # Cargar left en un registro + reg = self.get_available_register() + assert reg is not None + + if not isinstance(left, int): + self.register_instruction(LW(reg, left)) + + class MipsCodeGenerator(CilToMipsVisitor): """ diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 9b411c06..bb7f130d 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -20,7 +20,7 @@ from cil.nodes import ( AbortNode, - AllocateBoolNode, + AllocateBoolNode, AllocateIntNode, AllocateNode, AllocateStringNode, ArgNode, @@ -32,6 +32,7 @@ DataNode, DivNode, DynamicCallNode, + EqualToCilNode, FunctionNode, GetAttributeNode, GetTypeIndex, @@ -72,10 +73,7 @@ def find_method_in_parent(type_: Type, method: str, typeNodes: List[TypeNode]): if type_.parent is not None: parent = next(n for n in typeNodes if n.name == type_.name) methods = [m for _, m in parent.methods] - if ( - type_.parent is None - or f"function_{method}_at_{type_.name}" in methods - ): + if type_.parent is None or f"function_{method}_at_{type_.name}" in methods: return type_ return find_method_in_parent(type_.parent, method, typeNodes) @@ -591,9 +589,11 @@ def _(self, node: coolAst.DivNode, scope: Scope) -> LocalNode: # ********************* @visit.register - def _(self, node: coolAst.IntegerConstant, scope: Scope) -> int: + def _(self, node: coolAst.IntegerConstant, scope: Scope): # devolver el valor - return int(node.lex) + return_vm_holder = self.define_internal_local() + self.register_instruction(AllocateIntNode(return_vm_holder, int(node.lex))) + return return_vm_holder @visit.register def _(self, node: coolAst.StringConstant, scope: Scope) -> LocalNode: @@ -661,8 +661,6 @@ def _(self, node: coolAst.NegNode, scope: Scope): @visit.register def _(self, node: coolAst.EqualToNode, scope: Scope) -> LocalNode: expr_result_vm_holder = self.define_internal_local() - true_label = self.do_label("TRUE") - end_label = self.do_label("END") # Obtener el valor de la expresion izquierda left_vm_holder = self.visit(node.left, scope) @@ -670,34 +668,10 @@ def _(self, node: coolAst.EqualToNode, scope: Scope) -> LocalNode: # obtener el valor de la expresion derecha right_vm_holder = self.visit(node.right, scope) - # Realizar una resta y devolver el resultado - assert ( - isinstance(left_vm_holder, LocalNode) - or isinstance(left_vm_holder, int) - or isinstance(left_vm_holder, ParamNode) - ) and ( - isinstance(right_vm_holder, LocalNode) - or isinstance(right_vm_holder, int) - or isinstance(right_vm_holder, ParamNode) - ) - self.register_instruction( - MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder) + EqualToCilNode(left_vm_holder, right_vm_holder, expr_result_vm_holder) ) - # Si la resta da 0, entonces son iguales y se devuelve 1, si no, se devuelve 0 - self.register_instruction(IfZeroJump(expr_result_vm_holder, true_label)) - - # si la resta no da 0, almacenar 0 y retornar - self.register_instruction(AssignNode(expr_result_vm_holder, 0)) - self.register_instruction(UnconditionalJump(end_label)) - - # Si la resta da 0, devolver 1 - self.register_instruction(LabelNode(true_label)) - self.register_instruction(AssignNode(expr_result_vm_holder, 1)) - - self.register_instruction(LabelNode(end_label)) - # Devolver la variable con el resultado return expr_result_vm_holder diff --git a/tests/codegen/atoi.mips b/tests/codegen/atoi.mips index f5d2d852..91d74820 100644 --- a/tests/codegen/atoi.mips +++ b/tests/codegen/atoi.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:13 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:42 2020 # School of Math and Computer Science, University of Havana # @@ -482,7 +482,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/book_list.mips b/tests/codegen/book_list.mips index 9a624563..73a17c12 100644 --- a/tests/codegen/book_list.mips +++ b/tests/codegen/book_list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:13 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:41 2020 # School of Math and Computer Science, University of Havana # @@ -486,7 +486,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -2037,7 +2037,7 @@ function_print_list_at_Cons: # local_print_list_at_Cons_internal_6 = 14 li $s2, 14 sw $s2, -28($fp) - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Book @@ -2059,7 +2059,7 @@ function_print_list_at_Cons: lw $s2, -32($fp) sw $s2, -28($fp) label_Not_min0_1: - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Article @@ -2097,7 +2097,7 @@ function_print_list_at_Cons: # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 lw $s2, -20($fp) beq $s2, 0, label_ERROR_3 - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Book @@ -2178,7 +2178,7 @@ function_print_list_at_Cons: # GOTO label_END_4 j label_END_4 label_NEXT0_5: - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Article diff --git a/tests/codegen/cells.mips b/tests/codegen/cells.mips index 098d937e..a820dcad 100644 --- a/tests/codegen/cells.mips +++ b/tests/codegen/cells.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:14 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:43 2020 # School of Math and Computer Science, University of Havana # @@ -394,7 +394,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/complex.mips b/tests/codegen/complex.mips index f27d7374..5b990e63 100644 --- a/tests/codegen/complex.mips +++ b/tests/codegen/complex.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:11 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:41 2020 # School of Math and Computer Science, University of Havana # @@ -382,7 +382,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips index 85db133c..8662b01b 100644 --- a/tests/codegen/fib.mips +++ b/tests/codegen/fib.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:12 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:41 2020 # School of Math and Computer Science, University of Havana # @@ -357,7 +357,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/hairyscary.mips b/tests/codegen/hairyscary.mips index d3b7ffc2..4bc2ec87 100644 --- a/tests/codegen/hairyscary.mips +++ b/tests/codegen/hairyscary.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:11 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:40 2020 # School of Math and Computer Science, University of Havana # @@ -421,7 +421,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -1199,7 +1199,7 @@ __Bazz__attrib__g__init: # local_ttrib__g__init_internal_4 = 13 li $t5, 13 sw $t5, -20($fp) - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bazz + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bazz # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Bazz @@ -1221,7 +1221,7 @@ __Bazz__attrib__g__init: lw $t5, -24($fp) sw $t5, -20($fp) label_Not_min0_1: - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Razz + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Razz # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Razz @@ -1243,7 +1243,7 @@ __Bazz__attrib__g__init: lw $t5, -24($fp) sw $t5, -20($fp) label_Not_min1_2: - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Foo + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Foo # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Foo @@ -1265,7 +1265,7 @@ __Bazz__attrib__g__init: lw $t5, -24($fp) sw $t5, -20($fp) label_Not_min2_3: - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bar + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bar # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Bar @@ -1303,7 +1303,7 @@ __Bazz__attrib__g__init: # IF_ZERO local_ttrib__g__init_internal_2 GOTO label_ERROR_5 lw $t5, -12($fp) beq $t5, 0, label_ERROR_5 - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bazz + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bazz # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Bazz @@ -1410,7 +1410,7 @@ __Bazz__attrib__g__init: # GOTO label_END_6 j label_END_6 label_NEXT0_7: - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Razz + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Razz # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Razz @@ -1549,7 +1549,7 @@ label_NEXT0_7: # GOTO label_END_6 j label_END_6 label_NEXT1_8: - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Foo + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Foo # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Foo @@ -1672,7 +1672,7 @@ label_NEXT1_8: # GOTO label_END_6 j label_END_6 label_NEXT2_9: - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bar + # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bar # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Bar @@ -1905,7 +1905,7 @@ __Foo__attrib__a__init: # local_trib__a__init_internal_4 = 13 li $t8, 13 sw $t8, -20($fp) - # local_trib__a__init_internal_5 = TYPE_DISTANCE Razz + # local_trib__a__init_internal_5 = TYPE_DISTANCE Razz # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_1 --> -8($fp) # Load TDT pointer to type Razz @@ -1927,7 +1927,7 @@ __Foo__attrib__a__init: lw $t8, -24($fp) sw $t8, -20($fp) label_Not_min0_11: - # local_trib__a__init_internal_5 = TYPE_DISTANCE Foo + # local_trib__a__init_internal_5 = TYPE_DISTANCE Foo # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_1 --> -8($fp) # Load TDT pointer to type Foo @@ -1949,7 +1949,7 @@ __Foo__attrib__a__init: lw $t8, -24($fp) sw $t8, -20($fp) label_Not_min1_12: - # local_trib__a__init_internal_5 = TYPE_DISTANCE Bar + # local_trib__a__init_internal_5 = TYPE_DISTANCE Bar # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_1 --> -8($fp) # Load TDT pointer to type Bar @@ -1987,7 +1987,7 @@ __Foo__attrib__a__init: # IF_ZERO local_trib__a__init_internal_2 GOTO label_ERROR_14 lw $t8, -12($fp) beq $t8, 0, label_ERROR_14 - # local_trib__a__init_internal_5 = TYPE_DISTANCE Razz + # local_trib__a__init_internal_5 = TYPE_DISTANCE Razz # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_1 --> -8($fp) # Load TDT pointer to type Razz @@ -2126,7 +2126,7 @@ __Foo__attrib__a__init: # GOTO label_END_15 j label_END_15 label_NEXT0_16: - # local_trib__a__init_internal_5 = TYPE_DISTANCE Foo + # local_trib__a__init_internal_5 = TYPE_DISTANCE Foo # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_1 --> -8($fp) # Load TDT pointer to type Foo @@ -2249,7 +2249,7 @@ label_NEXT0_16: # GOTO label_END_15 j label_END_15 label_NEXT1_17: - # local_trib__a__init_internal_5 = TYPE_DISTANCE Bar + # local_trib__a__init_internal_5 = TYPE_DISTANCE Bar # LOCAL local_trib__a__init_internal_5 --> -24($fp) # LOCAL local_trib__a__init_internal_1 --> -8($fp) # Load TDT pointer to type Bar @@ -2533,7 +2533,7 @@ __Razz__attrib__e__init: # local_ttrib__e__init_internal_4 = 13 li $s2, 13 sw $s2, -20($fp) - # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Razz + # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Razz # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) # Load TDT pointer to type Razz @@ -2555,7 +2555,7 @@ __Razz__attrib__e__init: lw $s2, -24($fp) sw $s2, -20($fp) label_Not_min0_19: - # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Bar + # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Bar # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) # Load TDT pointer to type Bar @@ -2593,7 +2593,7 @@ __Razz__attrib__e__init: # IF_ZERO local_ttrib__e__init_internal_2 GOTO label_ERROR_21 lw $s2, -12($fp) beq $s2, 0, label_ERROR_21 - # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Razz + # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Razz # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) # Load TDT pointer to type Razz @@ -2732,7 +2732,7 @@ __Razz__attrib__e__init: # GOTO label_END_22 j label_END_22 label_NEXT0_23: - # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Bar + # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Bar # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) # Load TDT pointer to type Bar diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips index af15262e..013ed82f 100644 --- a/tests/codegen/hello_world.mips +++ b/tests/codegen/hello_world.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:11 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:40 2020 # School of Math and Computer Science, University of Havana # @@ -353,7 +353,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips index b9a663fc..f346ea75 100644 --- a/tests/codegen/io.mips +++ b/tests/codegen/io.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:12 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:41 2020 # School of Math and Computer Science, University of Havana # @@ -437,7 +437,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/life.mips b/tests/codegen/life.mips index fb53829f..ef8bbf4b 100644 --- a/tests/codegen/life.mips +++ b/tests/codegen/life.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:14 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:43 2020 # School of Math and Computer Science, University of Havana # @@ -727,7 +727,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/list.mips b/tests/codegen/list.mips index 49362c0c..2f971753 100644 --- a/tests/codegen/list.mips +++ b/tests/codegen/list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:12 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:41 2020 # School of Math and Computer Science, University of Havana # @@ -391,7 +391,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/new_complex.mips b/tests/codegen/new_complex.mips index 19409af8..36a026e9 100644 --- a/tests/codegen/new_complex.mips +++ b/tests/codegen/new_complex.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:11 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:40 2020 # School of Math and Computer Science, University of Havana # @@ -390,7 +390,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/palindrome.mips b/tests/codegen/palindrome.mips index 412eaf06..596bd9ee 100644 --- a/tests/codegen/palindrome.mips +++ b/tests/codegen/palindrome.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:13 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:42 2020 # School of Math and Computer Science, University of Havana # @@ -361,7 +361,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/primes.mips b/tests/codegen/primes.mips index 0d4ed662..c9fe6191 100644 --- a/tests/codegen/primes.mips +++ b/tests/codegen/primes.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:10 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:39 2020 # School of Math and Computer Science, University of Havana # @@ -365,7 +365,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/print-cool.mips b/tests/codegen/print-cool.mips index a5e2bb8d..dbf7c97e 100644 --- a/tests/codegen/print-cool.mips +++ b/tests/codegen/print-cool.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:30:11 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:40 2020 # School of Math and Computer Science, University of Havana # @@ -353,7 +353,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self From 3ac521af2b4512ba3c2e2330a26b8c93f7aec7c2 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Mon, 7 Dec 2020 13:23:20 -0500 Subject: [PATCH 154/162] Reimplement equality and comparison ops. Change "int" and "bool" types to Instatiable --- src/cil/nodes.py | 55 +- src/mips/baseMipsVisitor.py | 16 +- src/testing.mips | 11479 +++++++++++++++- src/testing.py | 389 +- src/travels/ciltomips.py | 241 +- src/travels/ctcill.py | 166 +- src/travels/inference.py | 3 - src/travels/typecollector.py | 18 +- tests/codegen/arith.mips | 22317 +++++++++++++++++++++++++++++++ tests/codegen/book_list.mips | 1671 ++- tests/codegen/cells.mips | 2187 ++- tests/codegen/complex.mips | 3030 ++++- tests/codegen/fib.mips | 975 +- tests/codegen/graph.mips | 11849 ++++++++++++++++ tests/codegen/hairyscary.mips | 3257 +++-- tests/codegen/hello_world.mips | 175 +- tests/codegen/io.mips | 591 +- tests/codegen/list.mips | 1239 +- tests/codegen/new_complex.mips | 4011 ++++-- tests/codegen/palindrome.mips | 1388 +- tests/codegen/primes.mips | 2032 ++- tests/codegen/print-cool.mips | 617 +- 22 files changed, 60856 insertions(+), 6850 deletions(-) create mode 100644 tests/codegen/arith.mips create mode 100644 tests/codegen/graph.mips diff --git a/src/cil/nodes.py b/src/cil/nodes.py index e8f92609..cca5c166 100644 --- a/src/cil/nodes.py +++ b/src/cil/nodes.py @@ -321,4 +321,57 @@ class EqualToCilNode(InstructionNode): def __init__(self, left, right, dest) -> None: self.left = left self.right = right - self.dest = dest \ No newline at end of file + self.dest = dest + + +class GetValue(InstructionNode): + def __init__(self, dest, src) -> None: + self.dest = dest + self.src = src + + +class CompareType(InstructionNode): + def __init__(self, dest, src, type_) -> None: + self.dest = dest + self.src = src + self.type = type_ + +class CompareSTRType(InstructionNode): + def __init__(self, dest, src) -> None: + self.dest = dest + self.src = src + + +class CompareStringLengthNode(InstructionNode): + def __init__(self, dest, left, rigth) -> None: + self.dest = dest + self.left = left + self.right = rigth + + +class ReferenceEqualNode(InstructionNode): + def __init__(self, left, right, dest): + self.dest = dest + self.right = right + self.left = left + +class CharToCharStringCompare(InstructionNode): + def __init__(self, dest, left, rigth, while_label, end_label) -> None: + self.dest = dest + self.left = left + self.right = rigth + self.while_label = while_label + self.end_label = end_label + + +class MinusNodeComp(InstructionNode): + def __init__(self, left, right, dest): + self.dest = dest + self.right = right + self.left = left + +class PureMinus(InstructionNode): + def __init__(self, left, right, dest): + self.dest = dest + self.right = right + self.left = left \ No newline at end of file diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index f6b6ccd6..9d6c187f 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -207,11 +207,11 @@ def operate(self, dest, left, right, operand: Type): self.register_instruction(lsNodes.LW(reg2, left)) # Load integer value - self.register_instruction(lsNodes.LW(reg, f"8(${REG_TO_STR[reg2]})")) + self.register_instruction(lsNodes.LW(reg, f"12(${REG_TO_STR[reg2]})")) # right no es una constante self.register_instruction(lsNodes.LW(reg2, right)) # Cargar el valor - self.register_instruction(lsNodes.LW(right_reg, f"8(${REG_TO_STR[reg2]})")) + self.register_instruction(lsNodes.LW(right_reg, f"12(${REG_TO_STR[reg2]})")) self.register_instruction(operand(reg, reg, right_reg)) # Crear la nueva instancia de Int @@ -232,7 +232,7 @@ def operate(self, dest, left, right, operand: Type): # Cargar el offset del tipo self.comment("Load type offset") - offset = next(i for i, t in enumerate(self.mips_types) if t == "Int") * 4 + offset = next(i for i, t in enumerate(self.mips_types) if t == "String") * 4 self.register_instruction(LI(reg2, offset)) self.register_instruction(SW(reg2, "8($v0)")) @@ -245,7 +245,7 @@ def operate(self, dest, left, right, operand: Type): # devolver la instancia self.register_instruction(MOVE(reg2, v0)) - size = 12 + size = 16 self.allocate_memory(size) @@ -255,7 +255,13 @@ def operate(self, dest, left, right, operand: Type): self.register_instruction(LA(reg2, "Int_start")) self.register_instruction(SW(reg2, "4($v0)")) - self.register_instruction(SW(reg, "8($v0)")) + # Cargar el offset del tipo + self.comment("Load type offset") + offset = next(i for i, t in enumerate(self.mips_types) if t == "Int") * 4 + self.register_instruction(LI(reg2, offset)) + self.register_instruction(SW(reg2, "8($v0)")) + + self.register_instruction(SW(reg, "12($v0)")) # devolver la instancia self.register_instruction(SW(v0, dest)) diff --git a/src/testing.mips b/src/testing.mips index 26ef9af4..659fdf33 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 23:42:38 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:20:35 2020 # School of Math and Computer Science, University of Havana # @@ -15,8 +15,26 @@ Bool: .asciiz "Bool" # Function END Int: .asciiz "Int" # Function END +BoolOp: .asciiz "BoolOp" +# Function END +Graph: .asciiz "Graph" +# Function END +Parse: .asciiz "Parse" +# Function END Main: .asciiz "Main" # Function END +VList: .asciiz "VList" +# Function END +VCons: .asciiz "VCons" +# Function END +EList: .asciiz "EList" +# Function END +ECons: .asciiz "ECons" +# Function END +Edge: .asciiz "Edge" +# Function END +Vertice: .asciiz "Vertice" +# Function END # @@ -90,8 +108,50 @@ Int_end: # +# **** VTABLE for type BoolOp **** +BoolOp_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_and_at_BoolOp, function_or_at_BoolOp +# Function END +# + + +# **** Type RECORD for type BoolOp **** +BoolOp_start: + BoolOp_vtable_pointer: .word BoolOp_vtable + # Function END +BoolOp_end: +# + + +# **** VTABLE for type Graph **** +Graph_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_add_vertice_at_Graph, function_print_E_at_Graph, function_print_V_at_Graph +# Function END +# + + +# **** Type RECORD for type Graph **** +Graph_start: + Graph_vtable_pointer: .word Graph_vtable + # Function END +Graph_end: +# + + +# **** VTABLE for type Parse **** +Parse_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_read_input_at_Parse, function_parse_line_at_Parse, function_c2i_at_Parse, function_a2i_at_Parse, function_a2i_aux_at_Parse +# Function END +# + + +# **** Type RECORD for type Parse **** +Parse_start: + Parse_vtable_pointer: .word Parse_vtable + # Function END +Parse_end: +# + + # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_read_input_at_Parse, function_parse_line_at_Parse, function_c2i_at_Parse, function_a2i_at_Parse, function_a2i_aux_at_Parse, function_main_at_Main # Function END # @@ -104,6 +164,90 @@ Main_end: # +# **** VTABLE for type VList **** +VList_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_VList, function_head_at_VList, function_tail_at_VList, function_cons_at_VList, function_print_at_VList +# Function END +# + + +# **** Type RECORD for type VList **** +VList_start: + VList_vtable_pointer: .word VList_vtable + # Function END +VList_end: +# + + +# **** VTABLE for type VCons **** +VCons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_VCons, function_head_at_VCons, function_tail_at_VCons, function_cons_at_VList, function_print_at_VCons, function_init_at_VCons +# Function END +# + + +# **** Type RECORD for type VCons **** +VCons_start: + VCons_vtable_pointer: .word VCons_vtable + # Function END +VCons_end: +# + + +# **** VTABLE for type EList **** +EList_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_EList, function_head_at_EList, function_tail_at_EList, function_cons_at_EList, function_append_at_EList, function_print_at_EList +# Function END +# + + +# **** Type RECORD for type EList **** +EList_start: + EList_vtable_pointer: .word EList_vtable + # Function END +EList_end: +# + + +# **** VTABLE for type ECons **** +ECons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_ECons, function_head_at_ECons, function_tail_at_ECons, function_cons_at_EList, function_append_at_EList, function_print_at_ECons, function_init_at_ECons +# Function END +# + + +# **** Type RECORD for type ECons **** +ECons_start: + ECons_vtable_pointer: .word ECons_vtable + # Function END +ECons_end: +# + + +# **** VTABLE for type Edge **** +Edge_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Edge, function_print_at_Edge +# Function END +# + + +# **** Type RECORD for type Edge **** +Edge_start: + Edge_vtable_pointer: .word Edge_vtable + # Function END +Edge_end: +# + + +# **** VTABLE for type Vertice **** +Vertice_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_outgoing_at_Vertice, function_number_at_Vertice, function_init_at_Vertice, function_add_out_at_Vertice, function_print_at_Vertice +# Function END +# + + +# **** Type RECORD for type Vertice **** +Vertice_start: + Vertice_vtable_pointer: .word Vertice_vtable + # Function END +Vertice_end: +# + + data_0: .asciiz "" # @@ -116,12 +260,21 @@ data_2: .asciiz "\n" # -IO__TDT: .word 0, -1, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, 0 +IO__TDT: .word 0, -1, -1, -1, -1, -1, -1, 1, 2, 1, 2, 1, 2, 1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 1, 1, 2, 3, 2, 3, 2, 3, 2, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 +BoolOp__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1 +Graph__TDT: .word -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1 +Parse__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, -1, -1, -1, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 +VList__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, -1, -1 +VCons__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1 +EList__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1 +ECons__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 +Edge__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1 +Vertice__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 # @@ -129,11 +282,91 @@ data_4: .asciiz "\n" # -data_5: .asciiz "Hello" +data_5: .asciiz "" +# + + +data_6: .asciiz "0" +# + + +data_7: .asciiz "1" +# + + +data_8: .asciiz "2" +# + + +data_9: .asciiz "3" +# + + +data_10: .asciiz "4" +# + + +data_11: .asciiz "5" +# + + +data_12: .asciiz "6" +# + + +data_13: .asciiz "7" +# + + +data_14: .asciiz "8" +# + + +data_15: .asciiz "9" +# + + +data_16: .asciiz "-" +# + + +data_17: .asciiz " " +# + + +data_18: .asciiz " " +# + + +data_19: .asciiz "," +# + + +data_20: .asciiz "" +# + + +data_21: .asciiz "" +# + + +data_22: .asciiz "\n" +# + + +data_23: .asciiz "\n" +# + + +data_24: .asciiz " (" +# + + +data_25: .asciiz "," # -data_6: .asciiz "\n" +data_26: .asciiz ")" # @@ -216,7 +449,7 @@ function_out_int_at_IO: # PRINT_INT param_out_int_at_IO_x_0 # PARAM param_out_int_at_IO_x_0 --> 0($fp) lw $v0, 0($fp) - lw $a0, 8($v0) + lw $a0, 12($v0) li $v0, 1 syscall # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) @@ -282,7 +515,7 @@ function_in_int_at_IO: # local_in_int_at_IO_internal_0 = READ_INT li $v0, 5 syscall - move $a0, $v0 + move $a2, $v0 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -293,21 +526,24 @@ function_in_int_at_IO: la $t0, String_start sw $t0, 4($v0) # Load type offset - li $t0, 16 + li $t0, 8 sw $t0, 8($v0) la $t0, Int sw $t0, 12($v0) li $t0, 3 sw $t0, 16($v0) move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 + # Allocating 16 bytes of memory + li $a0, 16 li $v0, 9 syscall sw $t0, 0($v0) la $t0, Int_start sw $t0, 4($v0) - sw $a0, 8($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) sw $v0, -4($fp) # RETURN local_in_int_at_IO_internal_0 lw $v0, -4($fp) @@ -405,7 +641,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -494,8 +730,10 @@ function_substr_at_String: # PARAM param_substr_at_String_r_1 --> 0($fp) lw $t0, 12($s1) lw $t2, 4($fp) + lw $t2, 12($t2) addu $t0, $t0, $t2 lw $a0, 0($fp) + lw $a0, 12($a0) move $t3, $a0 move $t1, $a0 addu $a0, $a0, 1 @@ -567,22 +805,25 @@ function_length_at_String: la $t0, String_start sw $t0, 4($v0) # Load type offset - li $t0, 16 + li $t0, 8 sw $t0, 8($v0) la $t0, Int sw $t0, 12($v0) li $t0, 3 sw $t0, 16($v0) move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 + # Allocating 16 bytes of memory + li $a0, 16 li $v0, 9 syscall sw $t0, 0($v0) la $t0, Int_start sw $t0, 4($v0) - lw $t0, -4($fp) + # Load type offset + li $t0, 16 sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) sw $v0, -8($fp) # RETURN local_length_at_String_internal_1 lw $v0, -8($fp) @@ -612,33 +853,57 @@ entry: li $v0, 9 syscall # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 12 bytes of memory - li $a0, 12 + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 24 bytes of memory + li $a0, 24 li $v0, 9 syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) # Load type offset - li $t2, 20 - sw $t2, 8($v0) + li $t0, 32 + sw $t0, 8($v0) move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Parse__attrib__boolop__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Parse__attrib__rest__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__g__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 @@ -651,11 +916,11 @@ entry: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type's VTABLE - la $t1, Main_vtable + la $t0, Main_vtable # Get pointer to function address - lw $t2, 28($t1) + lw $t1, 48($t0) # Call function. Result is on $v0 - jalr $t2 + jalr $t1 sw $v0, -8($fp) # RETURN 0 li $v0, 0 @@ -670,523 +935,10915 @@ entry: # Function END -# function_main_at_Main implementation. +# function_and_at_BoolOp implementation. # @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 112 +# 0($fp) = param_and_at_BoolOp_b1_0 +# 4($fp) = param_and_at_BoolOp_b2_1 +function_and_at_BoolOp: + # Allocate stack frame for function function_and_at_BoolOp. + subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 112 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) + addu $fp, $sp, 32 + # LOCAL local_and_at_BoolOp_internal_0 --> -4($fp) + # PARAM param_and_at_BoolOp_b1_0 --> 4($fp) + # Obtain value from 4($fp) + lw $v0, 4($fp) + lw $v0, 12($v0) + sw $v0, -4($fp) + # IF_ZERO local_and_at_BoolOp_internal_0 GOTO label_FALSEIF_1 + # IF_ZERO local_and_at_BoolOp_internal_0 GOTO label_FALSEIF_1 + lw $t0, -4($fp) + beq $t0, 0, label_FALSEIF_1 + # LOCAL local_and_at_BoolOp_internal_1 --> -8($fp) + # PARAM param_and_at_BoolOp_b2_1 --> 0($fp) + # local_and_at_BoolOp_internal_1 = PARAM param_and_at_BoolOp_b2_1 + lw $t0, 0($fp) + sw $t0, -8($fp) + # GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_and_at_BoolOp_internal_2 --> -12($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t1, 16 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 12 bytes of memory - li $a0, 12 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 li $v0, 9 syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - li $t1, 10 - sw $t1, 8($v0) - sw $v0, -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_and_at_BoolOp_internal_1 --> -8($fp) + # LOCAL local_and_at_BoolOp_internal_2 --> -12($fp) + # local_and_at_BoolOp_internal_1 = local_and_at_BoolOp_internal_2 + lw $t0, -12($fp) + sw $t0, -8($fp) + label_ENDIF_2: +# RETURN local_and_at_BoolOp_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_and_at_BoolOp. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +# Deallocate function args +addu $sp, $sp, 8 +jr $ra +# Function END + + +# function_or_at_BoolOp implementation. +# @Params: +# 0($fp) = param_or_at_BoolOp_b1_0 +# 4($fp) = param_or_at_BoolOp_b2_1 +function_or_at_BoolOp: + # Allocate stack frame for function function_or_at_BoolOp. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_or_at_BoolOp_internal_0 --> -4($fp) + # PARAM param_or_at_BoolOp_b1_0 --> 4($fp) + # Obtain value from 4($fp) + lw $v0, 4($fp) + lw $v0, 12($v0) + sw $v0, -4($fp) + # IF_ZERO local_or_at_BoolOp_internal_0 GOTO label_FALSEIF_3 + # IF_ZERO local_or_at_BoolOp_internal_0 GOTO label_FALSEIF_3 + lw $t0, -4($fp) + beq $t0, 0, label_FALSEIF_3 + # LOCAL local_or_at_BoolOp_internal_2 --> -12($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t1, 16 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_or_at_BoolOp_internal_1 --> -8($fp) + # LOCAL local_or_at_BoolOp_internal_2 --> -12($fp) + # local_or_at_BoolOp_internal_1 = local_or_at_BoolOp_internal_2 + lw $t0, -12($fp) + sw $t0, -8($fp) + # GOTO label_ENDIF_4 +j label_ENDIF_4 +label_FALSEIF_3: + # LOCAL local_or_at_BoolOp_internal_1 --> -8($fp) + # PARAM param_or_at_BoolOp_b2_1 --> 0($fp) + # local_or_at_BoolOp_internal_1 = PARAM param_or_at_BoolOp_b2_1 + lw $t0, 0($fp) + sw $t0, -8($fp) + label_ENDIF_4: +# RETURN local_or_at_BoolOp_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_or_at_BoolOp. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +# Deallocate function args +addu $sp, $sp, 8 +jr $ra +# Function END + + +# __Graph__attrib__vertices__init implementation. +# @Params: +__Graph__attrib__vertices__init: + # Allocate stack frame for function __Graph__attrib__vertices__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_attrib__vertices__init_internal_1 --> -8($fp) + # local_attrib__vertices__init_internal_1 = ALLOCATE VList + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, VList + sw $t0, 12($v0) + li $t0, 5 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, VList_start + sw $t0, 4($v0) + # Load type offset + li $t0, 36 + sw $t0, 8($v0) move $t1, $v0 - # Allocating 12 bytes of memory - li $a0, 12 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __VList__attrib__car__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # RETURN local_attrib__vertices__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Graph__attrib__vertices__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Graph__attrib__edges__init implementation. +# @Params: +__Graph__attrib__edges__init: + # Allocate stack frame for function __Graph__attrib__edges__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_attrib__edges__init_internal_1 --> -8($fp) + # local_attrib__edges__init_internal_1 = ALLOCATE EList + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - li $t1, 12 - sw $t1, 8($v0) - sw $v0, -32($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_5 = local_main_at_Main_internal_6 - local_main_at_Main_internal_7 - lw $t2, -28($fp) - lw $t1, 8($t2) - lw $t2, -32($fp) - lw $t3, 8($t2) - sub $t1, $t1, $t3 + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, EList + sw $t0, 12($v0) + li $t0, 5 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, EList_start + sw $t0, 4($v0) + # Load type offset + li $t0, 44 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __EList__attrib__car__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # RETURN local_attrib__edges__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Graph__attrib__edges__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_add_vertice_at_Graph implementation. +# @Params: +# 0($fp) = param_add_vertice_at_Graph_v_0 +function_add_vertice_at_Graph: + # Allocate stack frame for function function_add_vertice_at_Graph. + subu $sp, $sp, 40 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 40 + # LOCAL local_add_vertice_at_Graph_internal_2 --> -12($fp) + # PARAM param_add_vertice_at_Graph_v_0 --> 0($fp) + # local_add_vertice_at_Graph_internal_2 = PARAM param_add_vertice_at_Graph_v_0 + lw $t0, 0($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_add_vertice_at_Graph_internal_2 --> -12($fp) + # LOCAL local_add_vertice_at_Graph_internal_3 --> -16($fp) + # local_add_vertice_at_Graph_internal_3 = VCALL local_add_vertice_at_Graph_internal_2 outgoing + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_add_vertice_at_Graph_internal_0 --> -4($fp) + # LOCAL local_add_vertice_at_Graph_internal_3 --> -16($fp) + # local_add_vertice_at_Graph_internal_0 = local_add_vertice_at_Graph_internal_3 + lw $t0, -16($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_add_vertice_at_Graph_internal_4 = GETATTRIBUTE edges Graph + # LOCAL local_add_vertice_at_Graph_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # ARG local_add_vertice_at_Graph_internal_4 + # LOCAL local_add_vertice_at_Graph_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_add_vertice_at_Graph_internal_0 --> -4($fp) + # LOCAL local_add_vertice_at_Graph_internal_1 --> -8($fp) + # local_add_vertice_at_Graph_internal_1 = VCALL local_add_vertice_at_Graph_internal_0 append + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_add_vertice_at_Graph_internal_1 --> -8($fp) + lw $t0, -8($fp) + sw $t0, 16($s1) + # local_add_vertice_at_Graph_internal_7 = GETATTRIBUTE vertices Graph + # LOCAL local_add_vertice_at_Graph_internal_7 --> -32($fp) + lw $t0, 12($s1) + sw $t0, -32($fp) + # LOCAL local_add_vertice_at_Graph_internal_5 --> -24($fp) + # LOCAL local_add_vertice_at_Graph_internal_7 --> -32($fp) + # local_add_vertice_at_Graph_internal_5 = local_add_vertice_at_Graph_internal_7 + lw $t0, -32($fp) + sw $t0, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_add_vertice_at_Graph_v_0 + # PARAM param_add_vertice_at_Graph_v_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_add_vertice_at_Graph_internal_5 --> -24($fp) + # LOCAL local_add_vertice_at_Graph_internal_6 --> -28($fp) + # local_add_vertice_at_Graph_internal_6 = VCALL local_add_vertice_at_Graph_internal_5 cons + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_add_vertice_at_Graph_internal_6 --> -28($fp) + lw $t0, -28($fp) + sw $t0, 12($s1) + # RETURN + # Deallocate stack frame for function function_add_vertice_at_Graph. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 40 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_E_at_Graph implementation. +# @Params: +function_print_E_at_Graph: + # Allocate stack frame for function function_print_E_at_Graph. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_print_E_at_Graph_internal_2 = GETATTRIBUTE edges Graph + # LOCAL local_print_E_at_Graph_internal_2 --> -12($fp) + lw $t0, 16($s1) + sw $t0, -12($fp) + # LOCAL local_print_E_at_Graph_internal_0 --> -4($fp) + # LOCAL local_print_E_at_Graph_internal_2 --> -12($fp) + # local_print_E_at_Graph_internal_0 = local_print_E_at_Graph_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_E_at_Graph_internal_0 --> -4($fp) + # LOCAL local_print_E_at_Graph_internal_1 --> -8($fp) + # local_print_E_at_Graph_internal_1 = VCALL local_print_E_at_Graph_internal_0 print + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_E_at_Graph_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_print_E_at_Graph. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_V_at_Graph implementation. +# @Params: +function_print_V_at_Graph: + # Allocate stack frame for function function_print_V_at_Graph. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_print_V_at_Graph_internal_2 = GETATTRIBUTE vertices Graph + # LOCAL local_print_V_at_Graph_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # LOCAL local_print_V_at_Graph_internal_0 --> -4($fp) + # LOCAL local_print_V_at_Graph_internal_2 --> -12($fp) + # local_print_V_at_Graph_internal_0 = local_print_V_at_Graph_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_V_at_Graph_internal_0 --> -4($fp) + # LOCAL local_print_V_at_Graph_internal_1 --> -8($fp) + # local_print_V_at_Graph_internal_1 = VCALL local_print_V_at_Graph_internal_0 print + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_V_at_Graph_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_print_V_at_Graph. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Parse__attrib__boolop__init implementation. +# @Params: +__Parse__attrib__boolop__init: + # Allocate stack frame for function __Parse__attrib__boolop__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_attrib__boolop__init_internal_1 --> -8($fp) + # local_attrib__boolop__init_internal_1 = ALLOCATE BoolOp # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type Int - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 16 - sw $t2, 8($v0) - la $t2, Int - sw $t2, 12($v0) - li $t2, 3 - sw $t2, 16($v0) - move $t2, $v0 + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, BoolOp + sw $t0, 12($v0) + li $t0, 6 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - sw $t2, 0($v0) - la $t2, Int_start - sw $t2, 4($v0) - sw $t1, 8($v0) - sw $v0, -24($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) + sw $t0, 0($v0) + la $t0, BoolOp_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # RETURN local_attrib__boolop__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Parse__attrib__boolop__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Parse__attrib__rest__init implementation. +# @Params: +__Parse__attrib__rest__init: + # Allocate stack frame for function __Parse__attrib__rest__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_attrib__rest__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -4($fp) + # RETURN local_attrib__rest__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Parse__attrib__rest__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_read_input_at_Parse implementation. +# @Params: +function_read_input_at_Parse: + # Allocate stack frame for function function_read_input_at_Parse. + subu $sp, $sp, 112 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 112 + # LOCAL local_read_input_at_Parse_g_0 --> -4($fp) + # local_read_input_at_Parse_g_0 = ALLOCATE Graph + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Graph + sw $t0, 12($v0) + li $t0, 5 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Graph_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Graph__attrib__vertices__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Graph__attrib__edges__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local_read_input_at_Parse_internal_1 --> -8($fp) + # local_read_input_at_Parse_internal_1 = ALLOCATE Graph + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Graph + sw $t0, 12($v0) + li $t0, 5 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Graph_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Graph__attrib__vertices__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Graph__attrib__edges__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # LOCAL local_read_input_at_Parse_g_0 --> -4($fp) + # LOCAL local_read_input_at_Parse_internal_1 --> -8($fp) + # local_read_input_at_Parse_g_0 = local_read_input_at_Parse_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -12($fp) + # LOCAL local_read_input_at_Parse_internal_5 --> -24($fp) + # local_read_input_at_Parse_internal_5 = SELF + sw $s1, -24($fp) + # LOCAL local_read_input_at_Parse_internal_3 --> -16($fp) + # LOCAL local_read_input_at_Parse_internal_5 --> -24($fp) + # local_read_input_at_Parse_internal_3 = local_read_input_at_Parse_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_read_input_at_Parse_internal_3 --> -16($fp) + # LOCAL local_read_input_at_Parse_internal_4 --> -20($fp) + # local_read_input_at_Parse_internal_4 = VCALL local_read_input_at_Parse_internal_3 in_string + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_4 --> -20($fp) + # local_read_input_at_Parse_line_2 = local_read_input_at_Parse_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + label_WHILE_5: + # local_read_input_at_Parse_internal_9 = GETATTRIBUTE boolop Parse + # LOCAL local_read_input_at_Parse_internal_9 --> -40($fp) + lw $t0, 12($s1) + sw $t0, -40($fp) + # LOCAL local_read_input_at_Parse_internal_7 --> -32($fp) + # LOCAL local_read_input_at_Parse_internal_9 --> -40($fp) + # local_read_input_at_Parse_internal_7 = local_read_input_at_Parse_internal_9 + lw $t0, -40($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -52($fp) + # IF_ZERO local_read_input_at_Parse_line_2 GOTO label_FALSE_7 + # IF_ZERO local_read_input_at_Parse_line_2 GOTO label_FALSE_7 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_7 + # IF_ZERO local_read_input_at_Parse_internal_12 GOTO label_FALSE_7 + # IF_ZERO local_read_input_at_Parse_internal_12 GOTO label_FALSE_7 + lw $t0, -52($fp) + beq $t0, 0, label_FALSE_7 + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_STRING_10 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_STRING_10 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_STRING_10 + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_11 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_11 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_11 + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_11 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_11 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_11 + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, -52($fp) + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_8 + # GOTO label_FALSE_7 + j label_FALSE_7 + label_COMPARE_BY_VALUE_11: + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) + lw $a0, -12($fp) + lw $a1, -52($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_8 + # GOTO label_FALSE_7 + j label_FALSE_7 + label_COMPARE_STRING_10: + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -52($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_CONTINUE_12 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_CONTINUE_12 + lw $t0, -48($fp) + beq $t0, 0, label_CONTINUE_12 + # GOTO label_FALSE_7 + j label_FALSE_7 + label_CONTINUE_12: + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -52($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_13: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_14 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_13 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_14: + # Store result + sw $a2, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_8 + label_FALSE_7: + # LOCAL local_read_input_at_Parse_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -44($fp) + # GOTO label_END_9 +j label_END_9 +label_TRUE_8: + # LOCAL local_read_input_at_Parse_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + label_END_9: +# LOCAL local_read_input_at_Parse_internal_10 --> -44($fp) +# LOCAL local_read_input_at_Parse_internal_10 --> -44($fp) +# Obtain value from -44($fp) +lw $v0, -44($fp) +lw $v0, 12($v0) +sw $v0, -44($fp) +# IF_ZERO local_read_input_at_Parse_internal_10 GOTO label_FALSE_15 +# IF_ZERO local_read_input_at_Parse_internal_10 GOTO label_FALSE_15 +lw $t0, -44($fp) +beq $t0, 0, label_FALSE_15 +# LOCAL local_read_input_at_Parse_internal_13 --> -56($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -56($fp) +# GOTO label_NOT_END_16 +j label_NOT_END_16 +label_FALSE_15: + # LOCAL local_read_input_at_Parse_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -56($fp) + label_NOT_END_16: + # ARG local_read_input_at_Parse_internal_13 + # LOCAL local_read_input_at_Parse_internal_13 --> -56($fp) + lw $t0, -56($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -68($fp) + # IF_ZERO local_read_input_at_Parse_line_2 GOTO label_FALSE_17 + # IF_ZERO local_read_input_at_Parse_line_2 GOTO label_FALSE_17 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_17 + # IF_ZERO local_read_input_at_Parse_internal_16 GOTO label_FALSE_17 + # IF_ZERO local_read_input_at_Parse_internal_16 GOTO label_FALSE_17 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_17 + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_STRING_20 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_STRING_20 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_STRING_20 + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_21 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_21 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_21 + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_21 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_21 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_21 + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_18 + # GOTO label_FALSE_17 + j label_FALSE_17 + label_COMPARE_BY_VALUE_21: + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) + lw $a0, -12($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_18 + # GOTO label_FALSE_17 + j label_FALSE_17 + label_COMPARE_STRING_20: + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_CONTINUE_22 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_CONTINUE_22 + lw $t0, -64($fp) + beq $t0, 0, label_CONTINUE_22 + # GOTO label_FALSE_17 + j label_FALSE_17 + label_CONTINUE_22: + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_23: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_24 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_23 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_24: + # Store result + sw $a2, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_18 + label_FALSE_17: + # LOCAL local_read_input_at_Parse_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # GOTO label_END_19 +j label_END_19 +label_TRUE_18: + # LOCAL local_read_input_at_Parse_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + label_END_19: +# LOCAL local_read_input_at_Parse_internal_14 --> -60($fp) +# LOCAL local_read_input_at_Parse_internal_14 --> -60($fp) +# Obtain value from -60($fp) +lw $v0, -60($fp) +lw $v0, 12($v0) +sw $v0, -60($fp) +# IF_ZERO local_read_input_at_Parse_internal_14 GOTO label_FALSE_25 +# IF_ZERO local_read_input_at_Parse_internal_14 GOTO label_FALSE_25 +lw $t0, -60($fp) +beq $t0, 0, label_FALSE_25 +# LOCAL local_read_input_at_Parse_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -72($fp) +# GOTO label_NOT_END_26 +j label_NOT_END_26 +label_FALSE_25: + # LOCAL local_read_input_at_Parse_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -72($fp) + label_NOT_END_26: + # ARG local_read_input_at_Parse_internal_17 + # LOCAL local_read_input_at_Parse_internal_17 --> -72($fp) + lw $t0, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_read_input_at_Parse_internal_7 --> -32($fp) + # LOCAL local_read_input_at_Parse_internal_8 --> -36($fp) + # local_read_input_at_Parse_internal_8 = VCALL local_read_input_at_Parse_internal_7 and + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_read_input_at_Parse_internal_6 --> -28($fp) + # LOCAL local_read_input_at_Parse_internal_8 --> -36($fp) + # Obtain value from -36($fp) + lw $v0, -36($fp) + lw $v0, 12($v0) + sw $v0, -28($fp) + # IF_ZERO local_read_input_at_Parse_internal_6 GOTO label_WHILE_END_6 + # IF_ZERO local_read_input_at_Parse_internal_6 GOTO label_WHILE_END_6 + lw $t0, -28($fp) + beq $t0, 0, label_WHILE_END_6 + # LOCAL local_read_input_at_Parse_internal_18 --> -76($fp) + # LOCAL local_read_input_at_Parse_g_0 --> -4($fp) + # local_read_input_at_Parse_internal_18 = local_read_input_at_Parse_g_0 + lw $t0, -4($fp) + sw $t0, -76($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_read_input_at_Parse_internal_22 --> -92($fp) + # local_read_input_at_Parse_internal_22 = SELF + sw $s1, -92($fp) + # LOCAL local_read_input_at_Parse_internal_20 --> -84($fp) + # LOCAL local_read_input_at_Parse_internal_22 --> -92($fp) + # local_read_input_at_Parse_internal_20 = local_read_input_at_Parse_internal_22 + lw $t0, -92($fp) + sw $t0, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_read_input_at_Parse_line_2 + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + lw $t0, -12($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_read_input_at_Parse_internal_20 --> -84($fp) + # LOCAL local_read_input_at_Parse_internal_21 --> -88($fp) + # local_read_input_at_Parse_internal_21 = VCALL local_read_input_at_Parse_internal_20 parse_line + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_read_input_at_Parse_internal_21 + # LOCAL local_read_input_at_Parse_internal_21 --> -88($fp) + lw $t0, -88($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_read_input_at_Parse_internal_18 --> -76($fp) + # LOCAL local_read_input_at_Parse_internal_19 --> -80($fp) + # local_read_input_at_Parse_internal_19 = VCALL local_read_input_at_Parse_internal_18 add_vertice + # Save new self pointer in $s1 + lw $s1, -76($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -80($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_read_input_at_Parse_internal_25 --> -104($fp) + # local_read_input_at_Parse_internal_25 = SELF + sw $s1, -104($fp) + # LOCAL local_read_input_at_Parse_internal_23 --> -96($fp) + # LOCAL local_read_input_at_Parse_internal_25 --> -104($fp) + # local_read_input_at_Parse_internal_23 = local_read_input_at_Parse_internal_25 + lw $t0, -104($fp) + sw $t0, -96($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_read_input_at_Parse_internal_23 --> -96($fp) + # LOCAL local_read_input_at_Parse_internal_24 --> -100($fp) + # local_read_input_at_Parse_internal_24 = VCALL local_read_input_at_Parse_internal_23 in_string + # Save new self pointer in $s1 + lw $s1, -96($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -100($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_24 --> -100($fp) + # local_read_input_at_Parse_line_2 = local_read_input_at_Parse_internal_24 + lw $t0, -100($fp) + sw $t0, -12($fp) + # GOTO label_WHILE_5 + j label_WHILE_5 + label_WHILE_END_6: + # RETURN local_read_input_at_Parse_g_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_read_input_at_Parse. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 112 + jr $ra + # Function END + + +# function_parse_line_at_Parse implementation. +# @Params: +# 0($fp) = param_parse_line_at_Parse_s_0 +function_parse_line_at_Parse: + # Allocate stack frame for function function_parse_line_at_Parse. + subu $sp, $sp, 136 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 136 + # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) + # local_parse_line_at_Parse_v_0 = ALLOCATE Vertice + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Vertice + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Vertice_start + sw $t0, 4($v0) + # Load type offset + li $t0, 56 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Vertice__attrib__num__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Vertice__attrib__out__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local_parse_line_at_Parse_internal_3 --> -16($fp) + # local_parse_line_at_Parse_internal_3 = ALLOCATE Vertice + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Vertice + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Vertice_start + sw $t0, 4($v0) + # Load type offset + li $t0, 56 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Vertice__attrib__num__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Vertice__attrib__out__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -16($fp) + # LOCAL local_parse_line_at_Parse_internal_1 --> -8($fp) + # LOCAL local_parse_line_at_Parse_internal_3 --> -16($fp) + # local_parse_line_at_Parse_internal_1 = local_parse_line_at_Parse_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_6 --> -28($fp) + # local_parse_line_at_Parse_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_parse_line_at_Parse_internal_4 --> -20($fp) + # LOCAL local_parse_line_at_Parse_internal_6 --> -28($fp) + # local_parse_line_at_Parse_internal_4 = local_parse_line_at_Parse_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_parse_line_at_Parse_s_0 + # PARAM param_parse_line_at_Parse_s_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_4 --> -20($fp) + # LOCAL local_parse_line_at_Parse_internal_5 --> -24($fp) + # local_parse_line_at_Parse_internal_5 = VCALL local_parse_line_at_Parse_internal_4 a2i + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_parse_line_at_Parse_internal_5 + # LOCAL local_parse_line_at_Parse_internal_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_1 --> -8($fp) + # LOCAL local_parse_line_at_Parse_internal_2 --> -12($fp) + # local_parse_line_at_Parse_internal_2 = VCALL local_parse_line_at_Parse_internal_1 init + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) + # LOCAL local_parse_line_at_Parse_internal_2 --> -12($fp) + # local_parse_line_at_Parse_v_0 = local_parse_line_at_Parse_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + label_WHILE_27: + # local_parse_line_at_Parse_internal_12 = GETATTRIBUTE rest Parse + # LOCAL local_parse_line_at_Parse_internal_12 --> -52($fp) + lw $t0, 16($s1) + sw $t0, -52($fp) + # LOCAL local_parse_line_at_Parse_internal_10 --> -44($fp) + # LOCAL local_parse_line_at_Parse_internal_12 --> -52($fp) + # local_parse_line_at_Parse_internal_10 = local_parse_line_at_Parse_internal_12 + lw $t0, -52($fp) + sw $t0, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_10 --> -44($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # local_parse_line_at_Parse_internal_11 = VCALL local_parse_line_at_Parse_internal_10 length + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -56($fp) + # IF_ZERO local_parse_line_at_Parse_internal_11 GOTO label_FALSE_29 + # IF_ZERO local_parse_line_at_Parse_internal_11 GOTO label_FALSE_29 + lw $t0, -48($fp) + beq $t0, 0, label_FALSE_29 + # IF_ZERO local_parse_line_at_Parse_internal_13 GOTO label_FALSE_29 + # IF_ZERO local_parse_line_at_Parse_internal_13 GOTO label_FALSE_29 + lw $t0, -56($fp) + beq $t0, 0, label_FALSE_29 + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # Comparing -48($fp) type with String + la $v0, String + lw $a0, -48($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_STRING_32 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_STRING_32 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_32 + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # Comparing -48($fp) type with Bool + la $v0, Bool + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_33 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_33 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_33 + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # Comparing -48($fp) type with Int + la $v0, Int + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_33 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_33 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_33 + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) + # Load pointers and SUB + lw $a0, -48($fp) + lw $a1, -56($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_30 + # GOTO label_FALSE_29 + j label_FALSE_29 + label_COMPARE_BY_VALUE_33: + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) + lw $a0, -48($fp) + lw $a1, -56($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_30 + # GOTO label_FALSE_29 + j label_FALSE_29 + label_COMPARE_STRING_32: + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -56($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_CONTINUE_34 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_CONTINUE_34 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_34 + # GOTO label_FALSE_29 + j label_FALSE_29 + label_CONTINUE_34: + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -56($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_35: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_36 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_35 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_36: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_30 + label_FALSE_29: + # LOCAL local_parse_line_at_Parse_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_31 +j label_END_31 +label_TRUE_30: + # LOCAL local_parse_line_at_Parse_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_31: +# LOCAL local_parse_line_at_Parse_internal_8 --> -36($fp) +# LOCAL local_parse_line_at_Parse_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -36($fp) +# IF_ZERO local_parse_line_at_Parse_internal_8 GOTO label_FALSE_37 +# IF_ZERO local_parse_line_at_Parse_internal_8 GOTO label_FALSE_37 +lw $t0, -36($fp) +beq $t0, 0, label_FALSE_37 +# LOCAL local_parse_line_at_Parse_internal_14 --> -60($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -60($fp) +# GOTO label_NOT_END_38 +j label_NOT_END_38 +label_FALSE_37: + # LOCAL local_parse_line_at_Parse_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + label_NOT_END_38: + # LOCAL local_parse_line_at_Parse_internal_7 --> -32($fp) + # LOCAL local_parse_line_at_Parse_internal_14 --> -60($fp) + # Obtain value from -60($fp) + lw $v0, -60($fp) + lw $v0, 12($v0) + sw $v0, -32($fp) + # IF_ZERO local_parse_line_at_Parse_internal_7 GOTO label_WHILE_END_28 + # IF_ZERO local_parse_line_at_Parse_internal_7 GOTO label_WHILE_END_28 + lw $t0, -32($fp) + beq $t0, 0, label_WHILE_END_28 + # LOCAL local_parse_line_at_Parse_succ_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -64($fp) + # LOCAL local_parse_line_at_Parse_internal_18 --> -76($fp) + # local_parse_line_at_Parse_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_parse_line_at_Parse_internal_16 --> -68($fp) + # LOCAL local_parse_line_at_Parse_internal_18 --> -76($fp) + # local_parse_line_at_Parse_internal_16 = local_parse_line_at_Parse_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_parse_line_at_Parse_internal_19 = GETATTRIBUTE rest Parse + # LOCAL local_parse_line_at_Parse_internal_19 --> -80($fp) + lw $t0, 16($s1) + sw $t0, -80($fp) + # ARG local_parse_line_at_Parse_internal_19 + # LOCAL local_parse_line_at_Parse_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_16 --> -68($fp) + # LOCAL local_parse_line_at_Parse_internal_17 --> -72($fp) + # local_parse_line_at_Parse_internal_17 = VCALL local_parse_line_at_Parse_internal_16 a2i + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_parse_line_at_Parse_succ_15 --> -64($fp) + # LOCAL local_parse_line_at_Parse_internal_17 --> -72($fp) + # local_parse_line_at_Parse_succ_15 = local_parse_line_at_Parse_internal_17 + lw $t0, -72($fp) + sw $t0, -64($fp) + # LOCAL local_parse_line_at_Parse_weight_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -84($fp) + # LOCAL local_parse_line_at_Parse_internal_23 --> -96($fp) + # local_parse_line_at_Parse_internal_23 = SELF + sw $s1, -96($fp) + # LOCAL local_parse_line_at_Parse_internal_21 --> -88($fp) + # LOCAL local_parse_line_at_Parse_internal_23 --> -96($fp) + # local_parse_line_at_Parse_internal_21 = local_parse_line_at_Parse_internal_23 + lw $t0, -96($fp) + sw $t0, -88($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_parse_line_at_Parse_internal_24 = GETATTRIBUTE rest Parse + # LOCAL local_parse_line_at_Parse_internal_24 --> -100($fp) + lw $t0, 16($s1) + sw $t0, -100($fp) + # ARG local_parse_line_at_Parse_internal_24 + # LOCAL local_parse_line_at_Parse_internal_24 --> -100($fp) + lw $t0, -100($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_21 --> -88($fp) + # LOCAL local_parse_line_at_Parse_internal_22 --> -92($fp) + # local_parse_line_at_Parse_internal_22 = VCALL local_parse_line_at_Parse_internal_21 a2i + # Save new self pointer in $s1 + lw $s1, -88($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -92($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_parse_line_at_Parse_weight_20 --> -84($fp) + # LOCAL local_parse_line_at_Parse_internal_22 --> -92($fp) + # local_parse_line_at_Parse_weight_20 = local_parse_line_at_Parse_internal_22 + lw $t0, -92($fp) + sw $t0, -84($fp) + # LOCAL local_parse_line_at_Parse_internal_25 --> -104($fp) + # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) + # local_parse_line_at_Parse_internal_25 = local_parse_line_at_Parse_v_0 + lw $t0, -4($fp) + sw $t0, -104($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_29 --> -120($fp) + # local_parse_line_at_Parse_internal_29 = ALLOCATE Edge + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Edge + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 24 bytes of memory + li $a0, 24 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Edge_start + sw $t0, 4($v0) + # Load type offset + li $t0, 52 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Edge__attrib__from__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Edge__attrib__to__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Edge__attrib__weight__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -120($fp) + # LOCAL local_parse_line_at_Parse_internal_27 --> -112($fp) + # LOCAL local_parse_line_at_Parse_internal_29 --> -120($fp) + # local_parse_line_at_Parse_internal_27 = local_parse_line_at_Parse_internal_29 + lw $t0, -120($fp) + sw $t0, -112($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_30 --> -124($fp) + # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) + # local_parse_line_at_Parse_internal_30 = local_parse_line_at_Parse_v_0 + lw $t0, -4($fp) + sw $t0, -124($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_30 --> -124($fp) + # LOCAL local_parse_line_at_Parse_internal_31 --> -128($fp) + # local_parse_line_at_Parse_internal_31 = VCALL local_parse_line_at_Parse_internal_30 number + # Save new self pointer in $s1 + lw $s1, -124($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -128($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_parse_line_at_Parse_internal_31 + # LOCAL local_parse_line_at_Parse_internal_31 --> -128($fp) + lw $t0, -128($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # ARG local_parse_line_at_Parse_succ_15 + # LOCAL local_parse_line_at_Parse_succ_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # ARG local_parse_line_at_Parse_weight_20 + # LOCAL local_parse_line_at_Parse_weight_20 --> -84($fp) + lw $t0, -84($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_27 --> -112($fp) + # LOCAL local_parse_line_at_Parse_internal_28 --> -116($fp) + # local_parse_line_at_Parse_internal_28 = VCALL local_parse_line_at_Parse_internal_27 init + # Save new self pointer in $s1 + lw $s1, -112($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -116($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_parse_line_at_Parse_internal_28 + # LOCAL local_parse_line_at_Parse_internal_28 --> -116($fp) + lw $t0, -116($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_25 --> -104($fp) + # LOCAL local_parse_line_at_Parse_internal_26 --> -108($fp) + # local_parse_line_at_Parse_internal_26 = VCALL local_parse_line_at_Parse_internal_25 add_out + # Save new self pointer in $s1 + lw $s1, -104($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -108($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # GOTO label_WHILE_27 + j label_WHILE_27 + label_WHILE_END_28: + # RETURN local_parse_line_at_Parse_v_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_parse_line_at_Parse. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 136 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_c2i_at_Parse implementation. +# @Params: +# 0($fp) = param_c2i_at_Parse_char_0 +function_c2i_at_Parse: + # Allocate stack frame for function function_c2i_at_Parse. + subu $sp, $sp, 264 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 264 + # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_6 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -20($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_41 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_41 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_41 + # IF_ZERO local_c2i_at_Parse_internal_4 GOTO label_FALSE_41 + # IF_ZERO local_c2i_at_Parse_internal_4 GOTO label_FALSE_41 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_41 + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_STRING_44 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_STRING_44 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_44 + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_45 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_45 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_45 + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_45 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_45 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_45 + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_42 + # GOTO label_FALSE_41 + j label_FALSE_41 + label_COMPARE_BY_VALUE_45: + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_42 + # GOTO label_FALSE_41 + j label_FALSE_41 + label_COMPARE_STRING_44: + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_CONTINUE_46 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_CONTINUE_46 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_46 + # GOTO label_FALSE_41 + j label_FALSE_41 + label_CONTINUE_46: + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_47: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_48 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_47 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_48: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_42 + label_FALSE_41: + # LOCAL local_c2i_at_Parse_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_43 +j label_END_43 +label_TRUE_42: + # LOCAL local_c2i_at_Parse_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_43: +# LOCAL local_c2i_at_Parse_internal_0 --> -4($fp) +# LOCAL local_c2i_at_Parse_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_c2i_at_Parse_internal_0 GOTO label_FALSEIF_39 +# IF_ZERO local_c2i_at_Parse_internal_0 GOTO label_FALSEIF_39 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_39 +# LOCAL local_c2i_at_Parse_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -24($fp) +# LOCAL local_c2i_at_Parse_internal_1 --> -8($fp) +# LOCAL local_c2i_at_Parse_internal_5 --> -24($fp) +# local_c2i_at_Parse_internal_1 = local_c2i_at_Parse_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_40 +j label_ENDIF_40 +label_FALSEIF_39: + # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_7 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -44($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_51 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_51 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_51 + # IF_ZERO local_c2i_at_Parse_internal_10 GOTO label_FALSE_51 + # IF_ZERO local_c2i_at_Parse_internal_10 GOTO label_FALSE_51 + lw $t0, -44($fp) + beq $t0, 0, label_FALSE_51 + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_STRING_54 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_STRING_54 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_54 + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_55 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_55 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_55 + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_55 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_55 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_55 + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -44($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_52 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_COMPARE_BY_VALUE_55: + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) + lw $a0, 0($fp) + lw $a1, -44($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_52 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_COMPARE_STRING_54: + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_CONTINUE_56 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_CONTINUE_56 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_56 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_CONTINUE_56: + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_57: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_58 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_57 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_58: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_52 + label_FALSE_51: + # LOCAL local_c2i_at_Parse_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_53 +j label_END_53 +label_TRUE_52: + # LOCAL local_c2i_at_Parse_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_53: +# LOCAL local_c2i_at_Parse_internal_6 --> -28($fp) +# LOCAL local_c2i_at_Parse_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_c2i_at_Parse_internal_6 GOTO label_FALSEIF_49 +# IF_ZERO local_c2i_at_Parse_internal_6 GOTO label_FALSEIF_49 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_49 +# LOCAL local_c2i_at_Parse_internal_11 --> -48($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -48($fp) +# LOCAL local_c2i_at_Parse_internal_7 --> -32($fp) +# LOCAL local_c2i_at_Parse_internal_11 --> -48($fp) +# local_c2i_at_Parse_internal_7 = local_c2i_at_Parse_internal_11 +lw $t0, -48($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_50 +j label_ENDIF_50 +label_FALSEIF_49: + # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_8 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -68($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_61 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_61 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_61 + # IF_ZERO local_c2i_at_Parse_internal_16 GOTO label_FALSE_61 + # IF_ZERO local_c2i_at_Parse_internal_16 GOTO label_FALSE_61 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_61 + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_STRING_64 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_STRING_64 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_STRING_64 + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_65 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_65 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_65 + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_65 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_65 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_65 + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_62 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_COMPARE_BY_VALUE_65: + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) + lw $a0, 0($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_62 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_COMPARE_STRING_64: + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_CONTINUE_66 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_CONTINUE_66 + lw $t0, -64($fp) + beq $t0, 0, label_CONTINUE_66 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_CONTINUE_66: + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_67: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_68 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_67 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_68: + # Store result + sw $a2, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_62 + label_FALSE_61: + # LOCAL local_c2i_at_Parse_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # GOTO label_END_63 +j label_END_63 +label_TRUE_62: + # LOCAL local_c2i_at_Parse_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + label_END_63: +# LOCAL local_c2i_at_Parse_internal_12 --> -52($fp) +# LOCAL local_c2i_at_Parse_internal_14 --> -60($fp) +# Obtain value from -60($fp) +lw $v0, -60($fp) +lw $v0, 12($v0) +sw $v0, -52($fp) +# IF_ZERO local_c2i_at_Parse_internal_12 GOTO label_FALSEIF_59 +# IF_ZERO local_c2i_at_Parse_internal_12 GOTO label_FALSEIF_59 +lw $t0, -52($fp) +beq $t0, 0, label_FALSEIF_59 +# LOCAL local_c2i_at_Parse_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 2 +sw $t0, 12($v0) +sw $v0, -72($fp) +# LOCAL local_c2i_at_Parse_internal_13 --> -56($fp) +# LOCAL local_c2i_at_Parse_internal_17 --> -72($fp) +# local_c2i_at_Parse_internal_13 = local_c2i_at_Parse_internal_17 +lw $t0, -72($fp) +sw $t0, -56($fp) +# GOTO label_ENDIF_60 +j label_ENDIF_60 +label_FALSEIF_59: + # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_9 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -92($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_71 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_71 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_71 + # IF_ZERO local_c2i_at_Parse_internal_22 GOTO label_FALSE_71 + # IF_ZERO local_c2i_at_Parse_internal_22 GOTO label_FALSE_71 + lw $t0, -92($fp) + beq $t0, 0, label_FALSE_71 + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_STRING_74 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_STRING_74 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_STRING_74 + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_BY_VALUE_75 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_BY_VALUE_75 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_75 + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_BY_VALUE_75 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_BY_VALUE_75 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_75 + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -92($fp) + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_72 + # GOTO label_FALSE_71 + j label_FALSE_71 + label_COMPARE_BY_VALUE_75: + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) + lw $a0, 0($fp) + lw $a1, -92($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_72 + # GOTO label_FALSE_71 + j label_FALSE_71 + label_COMPARE_STRING_74: + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_CONTINUE_76 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_CONTINUE_76 + lw $t0, -88($fp) + beq $t0, 0, label_CONTINUE_76 + # GOTO label_FALSE_71 + j label_FALSE_71 + label_CONTINUE_76: + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_77: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_78 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_77 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_78: + # Store result + sw $a2, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_72 + label_FALSE_71: + # LOCAL local_c2i_at_Parse_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -84($fp) + # GOTO label_END_73 +j label_END_73 +label_TRUE_72: + # LOCAL local_c2i_at_Parse_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -84($fp) + label_END_73: +# LOCAL local_c2i_at_Parse_internal_18 --> -76($fp) +# LOCAL local_c2i_at_Parse_internal_20 --> -84($fp) +# Obtain value from -84($fp) +lw $v0, -84($fp) +lw $v0, 12($v0) +sw $v0, -76($fp) +# IF_ZERO local_c2i_at_Parse_internal_18 GOTO label_FALSEIF_69 +# IF_ZERO local_c2i_at_Parse_internal_18 GOTO label_FALSEIF_69 +lw $t0, -76($fp) +beq $t0, 0, label_FALSEIF_69 +# LOCAL local_c2i_at_Parse_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 3 +sw $t0, 12($v0) +sw $v0, -96($fp) +# LOCAL local_c2i_at_Parse_internal_19 --> -80($fp) +# LOCAL local_c2i_at_Parse_internal_23 --> -96($fp) +# local_c2i_at_Parse_internal_19 = local_c2i_at_Parse_internal_23 +lw $t0, -96($fp) +sw $t0, -80($fp) +# GOTO label_ENDIF_70 +j label_ENDIF_70 +label_FALSEIF_69: + # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_10 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -116($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_81 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_81 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_81 + # IF_ZERO local_c2i_at_Parse_internal_28 GOTO label_FALSE_81 + # IF_ZERO local_c2i_at_Parse_internal_28 GOTO label_FALSE_81 + lw $t0, -116($fp) + beq $t0, 0, label_FALSE_81 + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_STRING_84 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_STRING_84 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_STRING_84 + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_BY_VALUE_85 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_BY_VALUE_85 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_85 + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_BY_VALUE_85 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_BY_VALUE_85 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_85 + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -116($fp) + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_82 + # GOTO label_FALSE_81 + j label_FALSE_81 + label_COMPARE_BY_VALUE_85: + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) + lw $a0, 0($fp) + lw $a1, -116($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_82 + # GOTO label_FALSE_81 + j label_FALSE_81 + label_COMPARE_STRING_84: + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_CONTINUE_86 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_CONTINUE_86 + lw $t0, -112($fp) + beq $t0, 0, label_CONTINUE_86 + # GOTO label_FALSE_81 + j label_FALSE_81 + label_CONTINUE_86: + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_87: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_88 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_87 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_88: + # Store result + sw $a2, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_82 + label_FALSE_81: + # LOCAL local_c2i_at_Parse_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -108($fp) + # GOTO label_END_83 +j label_END_83 +label_TRUE_82: + # LOCAL local_c2i_at_Parse_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -108($fp) + label_END_83: +# LOCAL local_c2i_at_Parse_internal_24 --> -100($fp) +# LOCAL local_c2i_at_Parse_internal_26 --> -108($fp) +# Obtain value from -108($fp) +lw $v0, -108($fp) +lw $v0, 12($v0) +sw $v0, -100($fp) +# IF_ZERO local_c2i_at_Parse_internal_24 GOTO label_FALSEIF_79 +# IF_ZERO local_c2i_at_Parse_internal_24 GOTO label_FALSEIF_79 +lw $t0, -100($fp) +beq $t0, 0, label_FALSEIF_79 +# LOCAL local_c2i_at_Parse_internal_29 --> -120($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 4 +sw $t0, 12($v0) +sw $v0, -120($fp) +# LOCAL local_c2i_at_Parse_internal_25 --> -104($fp) +# LOCAL local_c2i_at_Parse_internal_29 --> -120($fp) +# local_c2i_at_Parse_internal_25 = local_c2i_at_Parse_internal_29 +lw $t0, -120($fp) +sw $t0, -104($fp) +# GOTO label_ENDIF_80 +j label_ENDIF_80 +label_FALSEIF_79: + # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_11 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -140($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_91 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_91 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_91 + # IF_ZERO local_c2i_at_Parse_internal_34 GOTO label_FALSE_91 + # IF_ZERO local_c2i_at_Parse_internal_34 GOTO label_FALSE_91 + lw $t0, -140($fp) + beq $t0, 0, label_FALSE_91 + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_STRING_94 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_STRING_94 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_STRING_94 + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_BY_VALUE_95 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_BY_VALUE_95 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_95 + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_BY_VALUE_95 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_BY_VALUE_95 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_95 + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -140($fp) + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_92 + # GOTO label_FALSE_91 + j label_FALSE_91 + label_COMPARE_BY_VALUE_95: + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) + lw $a0, 0($fp) + lw $a1, -140($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_92 + # GOTO label_FALSE_91 + j label_FALSE_91 + label_COMPARE_STRING_94: + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_CONTINUE_96 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_CONTINUE_96 + lw $t0, -136($fp) + beq $t0, 0, label_CONTINUE_96 + # GOTO label_FALSE_91 + j label_FALSE_91 + label_CONTINUE_96: + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_97: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_98 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_97 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_98: + # Store result + sw $a2, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_92 + label_FALSE_91: + # LOCAL local_c2i_at_Parse_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -132($fp) + # GOTO label_END_93 +j label_END_93 +label_TRUE_92: + # LOCAL local_c2i_at_Parse_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -132($fp) + label_END_93: +# LOCAL local_c2i_at_Parse_internal_30 --> -124($fp) +# LOCAL local_c2i_at_Parse_internal_32 --> -132($fp) +# Obtain value from -132($fp) +lw $v0, -132($fp) +lw $v0, 12($v0) +sw $v0, -124($fp) +# IF_ZERO local_c2i_at_Parse_internal_30 GOTO label_FALSEIF_89 +# IF_ZERO local_c2i_at_Parse_internal_30 GOTO label_FALSEIF_89 +lw $t0, -124($fp) +beq $t0, 0, label_FALSEIF_89 +# LOCAL local_c2i_at_Parse_internal_35 --> -144($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 5 +sw $t0, 12($v0) +sw $v0, -144($fp) +# LOCAL local_c2i_at_Parse_internal_31 --> -128($fp) +# LOCAL local_c2i_at_Parse_internal_35 --> -144($fp) +# local_c2i_at_Parse_internal_31 = local_c2i_at_Parse_internal_35 +lw $t0, -144($fp) +sw $t0, -128($fp) +# GOTO label_ENDIF_90 +j label_ENDIF_90 +label_FALSEIF_89: + # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_12 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -164($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_101 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_101 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_101 + # IF_ZERO local_c2i_at_Parse_internal_40 GOTO label_FALSE_101 + # IF_ZERO local_c2i_at_Parse_internal_40 GOTO label_FALSE_101 + lw $t0, -164($fp) + beq $t0, 0, label_FALSE_101 + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_STRING_104 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_STRING_104 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_STRING_104 + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_BY_VALUE_105 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_BY_VALUE_105 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_105 + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_BY_VALUE_105 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_BY_VALUE_105 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_105 + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -164($fp) + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_102 + # GOTO label_FALSE_101 + j label_FALSE_101 + label_COMPARE_BY_VALUE_105: + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) + lw $a0, 0($fp) + lw $a1, -164($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_102 + # GOTO label_FALSE_101 + j label_FALSE_101 + label_COMPARE_STRING_104: + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_CONTINUE_106 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_CONTINUE_106 + lw $t0, -160($fp) + beq $t0, 0, label_CONTINUE_106 + # GOTO label_FALSE_101 + j label_FALSE_101 + label_CONTINUE_106: + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_107: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_108 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_107 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_108: + # Store result + sw $a2, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_102 + label_FALSE_101: + # LOCAL local_c2i_at_Parse_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -156($fp) + # GOTO label_END_103 +j label_END_103 +label_TRUE_102: + # LOCAL local_c2i_at_Parse_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -156($fp) + label_END_103: +# LOCAL local_c2i_at_Parse_internal_36 --> -148($fp) +# LOCAL local_c2i_at_Parse_internal_38 --> -156($fp) +# Obtain value from -156($fp) +lw $v0, -156($fp) +lw $v0, 12($v0) +sw $v0, -148($fp) +# IF_ZERO local_c2i_at_Parse_internal_36 GOTO label_FALSEIF_99 +# IF_ZERO local_c2i_at_Parse_internal_36 GOTO label_FALSEIF_99 +lw $t0, -148($fp) +beq $t0, 0, label_FALSEIF_99 +# LOCAL local_c2i_at_Parse_internal_41 --> -168($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 6 +sw $t0, 12($v0) +sw $v0, -168($fp) +# LOCAL local_c2i_at_Parse_internal_37 --> -152($fp) +# LOCAL local_c2i_at_Parse_internal_41 --> -168($fp) +# local_c2i_at_Parse_internal_37 = local_c2i_at_Parse_internal_41 +lw $t0, -168($fp) +sw $t0, -152($fp) +# GOTO label_ENDIF_100 +j label_ENDIF_100 +label_FALSEIF_99: + # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_13 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -188($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_111 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_111 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_111 + # IF_ZERO local_c2i_at_Parse_internal_46 GOTO label_FALSE_111 + # IF_ZERO local_c2i_at_Parse_internal_46 GOTO label_FALSE_111 + lw $t0, -188($fp) + beq $t0, 0, label_FALSE_111 + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_STRING_114 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_STRING_114 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_STRING_114 + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_BY_VALUE_115 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_BY_VALUE_115 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_115 + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_BY_VALUE_115 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_BY_VALUE_115 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_115 + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -188($fp) + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_112 + # GOTO label_FALSE_111 + j label_FALSE_111 + label_COMPARE_BY_VALUE_115: + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) + lw $a0, 0($fp) + lw $a1, -188($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_112 + # GOTO label_FALSE_111 + j label_FALSE_111 + label_COMPARE_STRING_114: + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_CONTINUE_116 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_CONTINUE_116 + lw $t0, -184($fp) + beq $t0, 0, label_CONTINUE_116 + # GOTO label_FALSE_111 + j label_FALSE_111 + label_CONTINUE_116: + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_117: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_118 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_117 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_118: + # Store result + sw $a2, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_112 + label_FALSE_111: + # LOCAL local_c2i_at_Parse_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -180($fp) + # GOTO label_END_113 +j label_END_113 +label_TRUE_112: + # LOCAL local_c2i_at_Parse_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -180($fp) + label_END_113: +# LOCAL local_c2i_at_Parse_internal_42 --> -172($fp) +# LOCAL local_c2i_at_Parse_internal_44 --> -180($fp) +# Obtain value from -180($fp) +lw $v0, -180($fp) +lw $v0, 12($v0) +sw $v0, -172($fp) +# IF_ZERO local_c2i_at_Parse_internal_42 GOTO label_FALSEIF_109 +# IF_ZERO local_c2i_at_Parse_internal_42 GOTO label_FALSEIF_109 +lw $t0, -172($fp) +beq $t0, 0, label_FALSEIF_109 +# LOCAL local_c2i_at_Parse_internal_47 --> -192($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 7 +sw $t0, 12($v0) +sw $v0, -192($fp) +# LOCAL local_c2i_at_Parse_internal_43 --> -176($fp) +# LOCAL local_c2i_at_Parse_internal_47 --> -192($fp) +# local_c2i_at_Parse_internal_43 = local_c2i_at_Parse_internal_47 +lw $t0, -192($fp) +sw $t0, -176($fp) +# GOTO label_ENDIF_110 +j label_ENDIF_110 +label_FALSEIF_109: + # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_14 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -212($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_121 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_121 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_121 + # IF_ZERO local_c2i_at_Parse_internal_52 GOTO label_FALSE_121 + # IF_ZERO local_c2i_at_Parse_internal_52 GOTO label_FALSE_121 + lw $t0, -212($fp) + beq $t0, 0, label_FALSE_121 + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_STRING_124 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_STRING_124 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_STRING_124 + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_BY_VALUE_125 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_BY_VALUE_125 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_125 + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_BY_VALUE_125 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_BY_VALUE_125 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_125 + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -212($fp) + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_122 + # GOTO label_FALSE_121 + j label_FALSE_121 + label_COMPARE_BY_VALUE_125: + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) + lw $a0, 0($fp) + lw $a1, -212($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_122 + # GOTO label_FALSE_121 + j label_FALSE_121 + label_COMPARE_STRING_124: + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_CONTINUE_126 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_CONTINUE_126 + lw $t0, -208($fp) + beq $t0, 0, label_CONTINUE_126 + # GOTO label_FALSE_121 + j label_FALSE_121 + label_CONTINUE_126: + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_127: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_128 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_127 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_128: + # Store result + sw $a2, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_122 + label_FALSE_121: + # LOCAL local_c2i_at_Parse_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -204($fp) + # GOTO label_END_123 +j label_END_123 +label_TRUE_122: + # LOCAL local_c2i_at_Parse_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -204($fp) + label_END_123: +# LOCAL local_c2i_at_Parse_internal_48 --> -196($fp) +# LOCAL local_c2i_at_Parse_internal_50 --> -204($fp) +# Obtain value from -204($fp) +lw $v0, -204($fp) +lw $v0, 12($v0) +sw $v0, -196($fp) +# IF_ZERO local_c2i_at_Parse_internal_48 GOTO label_FALSEIF_119 +# IF_ZERO local_c2i_at_Parse_internal_48 GOTO label_FALSEIF_119 +lw $t0, -196($fp) +beq $t0, 0, label_FALSEIF_119 +# LOCAL local_c2i_at_Parse_internal_53 --> -216($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 8 +sw $t0, 12($v0) +sw $v0, -216($fp) +# LOCAL local_c2i_at_Parse_internal_49 --> -200($fp) +# LOCAL local_c2i_at_Parse_internal_53 --> -216($fp) +# local_c2i_at_Parse_internal_49 = local_c2i_at_Parse_internal_53 +lw $t0, -216($fp) +sw $t0, -200($fp) +# GOTO label_ENDIF_120 +j label_ENDIF_120 +label_FALSEIF_119: + # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_15 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -236($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_131 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_131 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_131 + # IF_ZERO local_c2i_at_Parse_internal_58 GOTO label_FALSE_131 + # IF_ZERO local_c2i_at_Parse_internal_58 GOTO label_FALSE_131 + lw $t0, -236($fp) + beq $t0, 0, label_FALSE_131 + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_STRING_134 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_STRING_134 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_STRING_134 + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_BY_VALUE_135 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_BY_VALUE_135 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_135 + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_BY_VALUE_135 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_BY_VALUE_135 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_135 + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -236($fp) + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_132 + # GOTO label_FALSE_131 + j label_FALSE_131 + label_COMPARE_BY_VALUE_135: + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) + lw $a0, 0($fp) + lw $a1, -236($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_132 + # GOTO label_FALSE_131 + j label_FALSE_131 + label_COMPARE_STRING_134: + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_CONTINUE_136 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_CONTINUE_136 + lw $t0, -232($fp) + beq $t0, 0, label_CONTINUE_136 + # GOTO label_FALSE_131 + j label_FALSE_131 + label_CONTINUE_136: + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_137: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_138 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_137 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_138: + # Store result + sw $a2, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_132 + label_FALSE_131: + # LOCAL local_c2i_at_Parse_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -228($fp) + # GOTO label_END_133 +j label_END_133 +label_TRUE_132: + # LOCAL local_c2i_at_Parse_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -228($fp) + label_END_133: +# LOCAL local_c2i_at_Parse_internal_54 --> -220($fp) +# LOCAL local_c2i_at_Parse_internal_56 --> -228($fp) +# Obtain value from -228($fp) +lw $v0, -228($fp) +lw $v0, 12($v0) +sw $v0, -220($fp) +# IF_ZERO local_c2i_at_Parse_internal_54 GOTO label_FALSEIF_129 +# IF_ZERO local_c2i_at_Parse_internal_54 GOTO label_FALSEIF_129 +lw $t0, -220($fp) +beq $t0, 0, label_FALSEIF_129 +# LOCAL local_c2i_at_Parse_internal_59 --> -240($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 9 +sw $t0, 12($v0) +sw $v0, -240($fp) +# LOCAL local_c2i_at_Parse_internal_55 --> -224($fp) +# LOCAL local_c2i_at_Parse_internal_59 --> -240($fp) +# local_c2i_at_Parse_internal_55 = local_c2i_at_Parse_internal_59 +lw $t0, -240($fp) +sw $t0, -224($fp) +# GOTO label_ENDIF_130 +j label_ENDIF_130 +label_FALSEIF_129: + # LOCAL local_c2i_at_Parse_internal_62 --> -252($fp) + # local_c2i_at_Parse_internal_62 = SELF + sw $s1, -252($fp) + # LOCAL local_c2i_at_Parse_internal_60 --> -244($fp) + # LOCAL local_c2i_at_Parse_internal_62 --> -252($fp) + # local_c2i_at_Parse_internal_60 = local_c2i_at_Parse_internal_62 + lw $t0, -252($fp) + sw $t0, -244($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_c2i_at_Parse_internal_60 --> -244($fp) + # LOCAL local_c2i_at_Parse_internal_61 --> -248($fp) + # local_c2i_at_Parse_internal_61 = VCALL local_c2i_at_Parse_internal_60 abort + # Save new self pointer in $s1 + lw $s1, -244($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -248($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_c2i_at_Parse_internal_63 --> -256($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -256($fp) + # LOCAL local_c2i_at_Parse_internal_55 --> -224($fp) + # LOCAL local_c2i_at_Parse_internal_63 --> -256($fp) + # local_c2i_at_Parse_internal_55 = local_c2i_at_Parse_internal_63 + lw $t0, -256($fp) + sw $t0, -224($fp) + label_ENDIF_130: +# LOCAL local_c2i_at_Parse_internal_49 --> -200($fp) +# LOCAL local_c2i_at_Parse_internal_55 --> -224($fp) +# local_c2i_at_Parse_internal_49 = local_c2i_at_Parse_internal_55 +lw $t0, -224($fp) +sw $t0, -200($fp) +label_ENDIF_120: +# LOCAL local_c2i_at_Parse_internal_43 --> -176($fp) +# LOCAL local_c2i_at_Parse_internal_49 --> -200($fp) +# local_c2i_at_Parse_internal_43 = local_c2i_at_Parse_internal_49 +lw $t0, -200($fp) +sw $t0, -176($fp) +label_ENDIF_110: +# LOCAL local_c2i_at_Parse_internal_37 --> -152($fp) +# LOCAL local_c2i_at_Parse_internal_43 --> -176($fp) +# local_c2i_at_Parse_internal_37 = local_c2i_at_Parse_internal_43 +lw $t0, -176($fp) +sw $t0, -152($fp) +label_ENDIF_100: +# LOCAL local_c2i_at_Parse_internal_31 --> -128($fp) +# LOCAL local_c2i_at_Parse_internal_37 --> -152($fp) +# local_c2i_at_Parse_internal_31 = local_c2i_at_Parse_internal_37 +lw $t0, -152($fp) +sw $t0, -128($fp) +label_ENDIF_90: +# LOCAL local_c2i_at_Parse_internal_25 --> -104($fp) +# LOCAL local_c2i_at_Parse_internal_31 --> -128($fp) +# local_c2i_at_Parse_internal_25 = local_c2i_at_Parse_internal_31 +lw $t0, -128($fp) +sw $t0, -104($fp) +label_ENDIF_80: +# LOCAL local_c2i_at_Parse_internal_19 --> -80($fp) +# LOCAL local_c2i_at_Parse_internal_25 --> -104($fp) +# local_c2i_at_Parse_internal_19 = local_c2i_at_Parse_internal_25 +lw $t0, -104($fp) +sw $t0, -80($fp) +label_ENDIF_70: +# LOCAL local_c2i_at_Parse_internal_13 --> -56($fp) +# LOCAL local_c2i_at_Parse_internal_19 --> -80($fp) +# local_c2i_at_Parse_internal_13 = local_c2i_at_Parse_internal_19 +lw $t0, -80($fp) +sw $t0, -56($fp) +label_ENDIF_60: +# LOCAL local_c2i_at_Parse_internal_7 --> -32($fp) +# LOCAL local_c2i_at_Parse_internal_13 --> -56($fp) +# local_c2i_at_Parse_internal_7 = local_c2i_at_Parse_internal_13 +lw $t0, -56($fp) +sw $t0, -32($fp) +label_ENDIF_50: +# LOCAL local_c2i_at_Parse_internal_1 --> -8($fp) +# LOCAL local_c2i_at_Parse_internal_7 --> -32($fp) +# local_c2i_at_Parse_internal_1 = local_c2i_at_Parse_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +label_ENDIF_40: +# RETURN local_c2i_at_Parse_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_c2i_at_Parse. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 264 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_at_Parse implementation. +# @Params: +# 0($fp) = param_a2i_at_Parse_s_0 +function_a2i_at_Parse: + # Allocate stack frame for function function_a2i_at_Parse. + subu $sp, $sp, 208 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 208 + # LOCAL local_a2i_at_Parse_internal_4 --> -20($fp) + # PARAM param_a2i_at_Parse_s_0 --> 0($fp) + # local_a2i_at_Parse_internal_4 = PARAM param_a2i_at_Parse_s_0 + lw $t0, 0($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_Parse_internal_4 --> -20($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # local_a2i_at_Parse_internal_5 = VCALL local_a2i_at_Parse_internal_4 length + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # IF_ZERO local_a2i_at_Parse_internal_5 GOTO label_FALSE_141 + # IF_ZERO local_a2i_at_Parse_internal_5 GOTO label_FALSE_141 + lw $t0, -24($fp) + beq $t0, 0, label_FALSE_141 + # IF_ZERO local_a2i_at_Parse_internal_6 GOTO label_FALSE_141 + # IF_ZERO local_a2i_at_Parse_internal_6 GOTO label_FALSE_141 + lw $t0, -28($fp) + beq $t0, 0, label_FALSE_141 + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # Comparing -24($fp) type with String + la $v0, String + lw $a0, -24($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_STRING_144 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_STRING_144 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_144 + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # Comparing -24($fp) type with Bool + la $v0, Bool + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_145 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_145 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_145 + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # Comparing -24($fp) type with Int + la $v0, Int + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_145 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_145 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_145 + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) + # Load pointers and SUB + lw $a0, -24($fp) + lw $a1, -28($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_142 + # GOTO label_FALSE_141 + j label_FALSE_141 + label_COMPARE_BY_VALUE_145: + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) + lw $a0, -24($fp) + lw $a1, -28($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_142 + # GOTO label_FALSE_141 + j label_FALSE_141 + label_COMPARE_STRING_144: + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -28($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_CONTINUE_146 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_CONTINUE_146 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_146 + # GOTO label_FALSE_141 + j label_FALSE_141 + label_CONTINUE_146: + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -28($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_147: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_148 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_147 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_148: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_142 + label_FALSE_141: + # LOCAL local_a2i_at_Parse_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_143 +j label_END_143 +label_TRUE_142: + # LOCAL local_a2i_at_Parse_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_143: +# LOCAL local_a2i_at_Parse_internal_0 --> -4($fp) +# LOCAL local_a2i_at_Parse_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_a2i_at_Parse_internal_0 GOTO label_FALSEIF_139 +# IF_ZERO local_a2i_at_Parse_internal_0 GOTO label_FALSEIF_139 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_139 +# LOCAL local_a2i_at_Parse_internal_7 --> -32($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -32($fp) +# LOCAL local_a2i_at_Parse_internal_1 --> -8($fp) +# LOCAL local_a2i_at_Parse_internal_7 --> -32($fp) +# local_a2i_at_Parse_internal_1 = local_a2i_at_Parse_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_140 +j label_ENDIF_140 +label_FALSEIF_139: + # LOCAL local_a2i_at_Parse_internal_12 --> -52($fp) + # PARAM param_a2i_at_Parse_s_0 --> 0($fp) + # local_a2i_at_Parse_internal_12 = PARAM param_a2i_at_Parse_s_0 + lw $t0, 0($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_Parse_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # ARG local_a2i_at_Parse_internal_14 + # LOCAL local_a2i_at_Parse_internal_14 --> -60($fp) + lw $t0, -60($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_Parse_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -64($fp) + # ARG local_a2i_at_Parse_internal_15 + # LOCAL local_a2i_at_Parse_internal_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_Parse_internal_12 --> -52($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # local_a2i_at_Parse_internal_13 = VCALL local_a2i_at_Parse_internal_12 substr + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_16 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -68($fp) + # IF_ZERO local_a2i_at_Parse_internal_13 GOTO label_FALSE_151 + # IF_ZERO local_a2i_at_Parse_internal_13 GOTO label_FALSE_151 + lw $t0, -56($fp) + beq $t0, 0, label_FALSE_151 + # IF_ZERO local_a2i_at_Parse_internal_16 GOTO label_FALSE_151 + # IF_ZERO local_a2i_at_Parse_internal_16 GOTO label_FALSE_151 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_151 + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # Comparing -56($fp) type with String + la $v0, String + lw $a0, -56($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_STRING_154 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_STRING_154 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_STRING_154 + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # Comparing -56($fp) type with Bool + la $v0, Bool + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_155 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_155 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_155 + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # Comparing -56($fp) type with Int + la $v0, Int + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_155 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_155 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_155 + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, -56($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_152 + # GOTO label_FALSE_151 + j label_FALSE_151 + label_COMPARE_BY_VALUE_155: + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) + lw $a0, -56($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_152 + # GOTO label_FALSE_151 + j label_FALSE_151 + label_COMPARE_STRING_154: + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_CONTINUE_156 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_CONTINUE_156 + lw $t0, -48($fp) + beq $t0, 0, label_CONTINUE_156 + # GOTO label_FALSE_151 + j label_FALSE_151 + label_CONTINUE_156: + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_157: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_158 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_157 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_158: + # Store result + sw $a2, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_152 + label_FALSE_151: + # LOCAL local_a2i_at_Parse_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -44($fp) + # GOTO label_END_153 +j label_END_153 +label_TRUE_152: + # LOCAL local_a2i_at_Parse_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + label_END_153: +# LOCAL local_a2i_at_Parse_internal_8 --> -36($fp) +# LOCAL local_a2i_at_Parse_internal_10 --> -44($fp) +# Obtain value from -44($fp) +lw $v0, -44($fp) +lw $v0, 12($v0) +sw $v0, -36($fp) +# IF_ZERO local_a2i_at_Parse_internal_8 GOTO label_FALSEIF_149 +# IF_ZERO local_a2i_at_Parse_internal_8 GOTO label_FALSEIF_149 +lw $t0, -36($fp) +beq $t0, 0, label_FALSEIF_149 +# LOCAL local_a2i_at_Parse_internal_20 --> -84($fp) +# local_a2i_at_Parse_internal_20 = SELF +sw $s1, -84($fp) +# LOCAL local_a2i_at_Parse_internal_18 --> -76($fp) +# LOCAL local_a2i_at_Parse_internal_20 --> -84($fp) +# local_a2i_at_Parse_internal_18 = local_a2i_at_Parse_internal_20 +lw $t0, -84($fp) +sw $t0, -76($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_Parse_internal_21 --> -88($fp) +# PARAM param_a2i_at_Parse_s_0 --> 0($fp) +# local_a2i_at_Parse_internal_21 = PARAM param_a2i_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -88($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_Parse_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -96($fp) +# ARG local_a2i_at_Parse_internal_23 +# LOCAL local_a2i_at_Parse_internal_23 --> -96($fp) +lw $t0, -96($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_Parse_internal_25 --> -104($fp) +# PARAM param_a2i_at_Parse_s_0 --> 0($fp) +# local_a2i_at_Parse_internal_25 = PARAM param_a2i_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -104($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_Parse_internal_25 --> -104($fp) +# LOCAL local_a2i_at_Parse_internal_26 --> -108($fp) +# local_a2i_at_Parse_internal_26 = VCALL local_a2i_at_Parse_internal_25 length +# Save new self pointer in $s1 +lw $s1, -104($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 20($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -108($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_Parse_internal_27 --> -112($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -112($fp) +# LOCAL local_a2i_at_Parse_internal_24 --> -100($fp) +# LOCAL local_a2i_at_Parse_internal_26 --> -108($fp) +# LOCAL local_a2i_at_Parse_internal_27 --> -112($fp) +# local_a2i_at_Parse_internal_24 = local_a2i_at_Parse_internal_26 - local_a2i_at_Parse_internal_27 +lw $t1, -108($fp) +lw $t0, 12($t1) +lw $t1, -112($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -100($fp) +# ARG local_a2i_at_Parse_internal_24 +# LOCAL local_a2i_at_Parse_internal_24 --> -100($fp) +lw $t0, -100($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_Parse_internal_21 --> -88($fp) +# LOCAL local_a2i_at_Parse_internal_22 --> -92($fp) +# local_a2i_at_Parse_internal_22 = VCALL local_a2i_at_Parse_internal_21 substr +# Save new self pointer in $s1 +lw $s1, -88($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -92($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_at_Parse_internal_22 +# LOCAL local_a2i_at_Parse_internal_22 --> -92($fp) +lw $t0, -92($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_Parse_internal_18 --> -76($fp) +# LOCAL local_a2i_at_Parse_internal_19 --> -80($fp) +# local_a2i_at_Parse_internal_19 = VCALL local_a2i_at_Parse_internal_18 a2i_aux +# Save new self pointer in $s1 +lw $s1, -76($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 44($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -80($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_Parse_internal_17 --> -72($fp) +# LOCAL local_a2i_at_Parse_internal_19 --> -80($fp) +lw $t0, -80($fp) +lw $t0, 12($t0) +not $t0, $t0 +add $t0, $t0, 1 +sw $t0, -72($fp) +# LOCAL local_a2i_at_Parse_internal_17 --> -72($fp) +# LOCAL local_a2i_at_Parse_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +lw $t0, -72($fp) +sw $t0, 12($v0) +sw $v0, -72($fp) +# LOCAL local_a2i_at_Parse_internal_9 --> -40($fp) +# LOCAL local_a2i_at_Parse_internal_17 --> -72($fp) +# local_a2i_at_Parse_internal_9 = local_a2i_at_Parse_internal_17 +lw $t0, -72($fp) +sw $t0, -40($fp) +# GOTO label_ENDIF_150 +j label_ENDIF_150 +label_FALSEIF_149: + # LOCAL local_a2i_at_Parse_internal_32 --> -132($fp) + # PARAM param_a2i_at_Parse_s_0 --> 0($fp) + # local_a2i_at_Parse_internal_32 = PARAM param_a2i_at_Parse_s_0 + lw $t0, 0($fp) + sw $t0, -132($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_Parse_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -140($fp) + # ARG local_a2i_at_Parse_internal_34 + # LOCAL local_a2i_at_Parse_internal_34 --> -140($fp) + lw $t0, -140($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_Parse_internal_35 --> -144($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -144($fp) + # ARG local_a2i_at_Parse_internal_35 + # LOCAL local_a2i_at_Parse_internal_35 --> -144($fp) + lw $t0, -144($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_Parse_internal_32 --> -132($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # local_a2i_at_Parse_internal_33 = VCALL local_a2i_at_Parse_internal_32 substr + # Save new self pointer in $s1 + lw $s1, -132($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -136($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_17 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -148($fp) + # IF_ZERO local_a2i_at_Parse_internal_33 GOTO label_FALSE_161 + # IF_ZERO local_a2i_at_Parse_internal_33 GOTO label_FALSE_161 + lw $t0, -136($fp) + beq $t0, 0, label_FALSE_161 + # IF_ZERO local_a2i_at_Parse_internal_36 GOTO label_FALSE_161 + # IF_ZERO local_a2i_at_Parse_internal_36 GOTO label_FALSE_161 + lw $t0, -148($fp) + beq $t0, 0, label_FALSE_161 + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # Comparing -136($fp) type with String + la $v0, String + lw $a0, -136($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_STRING_164 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_STRING_164 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_STRING_164 + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # Comparing -136($fp) type with Bool + la $v0, Bool + lw $a0, -136($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_BY_VALUE_165 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_BY_VALUE_165 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_165 + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # Comparing -136($fp) type with Int + la $v0, Int + lw $a0, -136($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_BY_VALUE_165 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_BY_VALUE_165 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_165 + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) + # Load pointers and SUB + lw $a0, -136($fp) + lw $a1, -148($fp) + sub $a0, $a0, $a1 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_162 + # GOTO label_FALSE_161 + j label_FALSE_161 + label_COMPARE_BY_VALUE_165: + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) + lw $a0, -136($fp) + lw $a1, -148($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_162 + # GOTO label_FALSE_161 + j label_FALSE_161 + label_COMPARE_STRING_164: + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) + # Load strings for comparison + lw $v0, -136($fp) + lw $v1, -148($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_CONTINUE_166 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_CONTINUE_166 + lw $t0, -128($fp) + beq $t0, 0, label_CONTINUE_166 + # GOTO label_FALSE_161 + j label_FALSE_161 + label_CONTINUE_166: + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -136($fp) + lw $v1, -148($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_167: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_168 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_167 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_168: + # Store result + sw $a2, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_162 + label_FALSE_161: + # LOCAL local_a2i_at_Parse_internal_30 --> -124($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -124($fp) + # GOTO label_END_163 +j label_END_163 +label_TRUE_162: + # LOCAL local_a2i_at_Parse_internal_30 --> -124($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -124($fp) + label_END_163: +# LOCAL local_a2i_at_Parse_internal_28 --> -116($fp) +# LOCAL local_a2i_at_Parse_internal_30 --> -124($fp) +# Obtain value from -124($fp) +lw $v0, -124($fp) +lw $v0, 12($v0) +sw $v0, -116($fp) +# IF_ZERO local_a2i_at_Parse_internal_28 GOTO label_FALSEIF_159 +# IF_ZERO local_a2i_at_Parse_internal_28 GOTO label_FALSEIF_159 +lw $t0, -116($fp) +beq $t0, 0, label_FALSEIF_159 +# LOCAL local_a2i_at_Parse_internal_39 --> -160($fp) +# local_a2i_at_Parse_internal_39 = SELF +sw $s1, -160($fp) +# LOCAL local_a2i_at_Parse_internal_37 --> -152($fp) +# LOCAL local_a2i_at_Parse_internal_39 --> -160($fp) +# local_a2i_at_Parse_internal_37 = local_a2i_at_Parse_internal_39 +lw $t0, -160($fp) +sw $t0, -152($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_Parse_internal_40 --> -164($fp) +# PARAM param_a2i_at_Parse_s_0 --> 0($fp) +# local_a2i_at_Parse_internal_40 = PARAM param_a2i_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -164($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_Parse_internal_42 --> -172($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -172($fp) +# ARG local_a2i_at_Parse_internal_42 +# LOCAL local_a2i_at_Parse_internal_42 --> -172($fp) +lw $t0, -172($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_Parse_internal_44 --> -180($fp) +# PARAM param_a2i_at_Parse_s_0 --> 0($fp) +# local_a2i_at_Parse_internal_44 = PARAM param_a2i_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -180($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_Parse_internal_44 --> -180($fp) +# LOCAL local_a2i_at_Parse_internal_45 --> -184($fp) +# local_a2i_at_Parse_internal_45 = VCALL local_a2i_at_Parse_internal_44 length +# Save new self pointer in $s1 +lw $s1, -180($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 20($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -184($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_Parse_internal_46 --> -188($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -188($fp) +# LOCAL local_a2i_at_Parse_internal_43 --> -176($fp) +# LOCAL local_a2i_at_Parse_internal_45 --> -184($fp) +# LOCAL local_a2i_at_Parse_internal_46 --> -188($fp) +# local_a2i_at_Parse_internal_43 = local_a2i_at_Parse_internal_45 - local_a2i_at_Parse_internal_46 +lw $t1, -184($fp) +lw $t0, 12($t1) +lw $t1, -188($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -176($fp) +# ARG local_a2i_at_Parse_internal_43 +# LOCAL local_a2i_at_Parse_internal_43 --> -176($fp) +lw $t0, -176($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_Parse_internal_40 --> -164($fp) +# LOCAL local_a2i_at_Parse_internal_41 --> -168($fp) +# local_a2i_at_Parse_internal_41 = VCALL local_a2i_at_Parse_internal_40 substr +# Save new self pointer in $s1 +lw $s1, -164($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -168($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_at_Parse_internal_41 +# LOCAL local_a2i_at_Parse_internal_41 --> -168($fp) +lw $t0, -168($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_Parse_internal_37 --> -152($fp) +# LOCAL local_a2i_at_Parse_internal_38 --> -156($fp) +# local_a2i_at_Parse_internal_38 = VCALL local_a2i_at_Parse_internal_37 a2i +# Save new self pointer in $s1 +lw $s1, -152($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 40($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -156($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_Parse_internal_29 --> -120($fp) +# LOCAL local_a2i_at_Parse_internal_38 --> -156($fp) +# local_a2i_at_Parse_internal_29 = local_a2i_at_Parse_internal_38 +lw $t0, -156($fp) +sw $t0, -120($fp) +# GOTO label_ENDIF_160 +j label_ENDIF_160 +label_FALSEIF_159: + # LOCAL local_a2i_at_Parse_internal_49 --> -200($fp) + # local_a2i_at_Parse_internal_49 = SELF + sw $s1, -200($fp) + # LOCAL local_a2i_at_Parse_internal_47 --> -192($fp) + # LOCAL local_a2i_at_Parse_internal_49 --> -200($fp) + # local_a2i_at_Parse_internal_47 = local_a2i_at_Parse_internal_49 + lw $t0, -200($fp) + sw $t0, -192($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_a2i_at_Parse_s_0 + # PARAM param_a2i_at_Parse_s_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_Parse_internal_47 --> -192($fp) + # LOCAL local_a2i_at_Parse_internal_48 --> -196($fp) + # local_a2i_at_Parse_internal_48 = VCALL local_a2i_at_Parse_internal_47 a2i_aux + # Save new self pointer in $s1 + lw $s1, -192($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -196($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_Parse_internal_29 --> -120($fp) + # LOCAL local_a2i_at_Parse_internal_48 --> -196($fp) + # local_a2i_at_Parse_internal_29 = local_a2i_at_Parse_internal_48 + lw $t0, -196($fp) + sw $t0, -120($fp) + label_ENDIF_160: +# LOCAL local_a2i_at_Parse_internal_9 --> -40($fp) +# LOCAL local_a2i_at_Parse_internal_29 --> -120($fp) +# local_a2i_at_Parse_internal_9 = local_a2i_at_Parse_internal_29 +lw $t0, -120($fp) +sw $t0, -40($fp) +label_ENDIF_150: +# LOCAL local_a2i_at_Parse_internal_1 --> -8($fp) +# LOCAL local_a2i_at_Parse_internal_9 --> -40($fp) +# local_a2i_at_Parse_internal_1 = local_a2i_at_Parse_internal_9 +lw $t0, -40($fp) +sw $t0, -8($fp) +label_ENDIF_140: +# RETURN local_a2i_at_Parse_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_a2i_at_Parse. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 208 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_aux_at_Parse implementation. +# @Params: +# 0($fp) = param_a2i_aux_at_Parse_s_0 +function_a2i_aux_at_Parse: + # Allocate stack frame for function function_a2i_aux_at_Parse. + subu $sp, $sp, 240 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 240 + # LOCAL local_a2i_aux_at_Parse_int_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_a2i_aux_at_Parse_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_a2i_aux_at_Parse_int_0 --> -4($fp) + # LOCAL local_a2i_aux_at_Parse_internal_1 --> -8($fp) + # local_a2i_aux_at_Parse_int_0 = local_a2i_aux_at_Parse_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_a2i_aux_at_Parse_internal_3 --> -16($fp) + # PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) + # local_a2i_aux_at_Parse_internal_3 = PARAM param_a2i_aux_at_Parse_s_0 + lw $t0, 0($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_aux_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_aux_at_Parse_internal_4 --> -20($fp) + # local_a2i_aux_at_Parse_internal_4 = VCALL local_a2i_aux_at_Parse_internal_3 length + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + # LOCAL local_a2i_aux_at_Parse_internal_4 --> -20($fp) + # local_a2i_aux_at_Parse_j_2 = local_a2i_aux_at_Parse_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # LOCAL local_a2i_aux_at_Parse_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_internal_6 --> -28($fp) + # local_a2i_aux_at_Parse_i_5 = local_a2i_aux_at_Parse_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + label_WHILE_169: + # LOCAL local_a2i_aux_at_Parse_internal_8 --> -36($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + lw $a0, -24($fp) + lw $a1, -12($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -36($fp) + # IF_GREATER_ZERO local_a2i_aux_at_Parse_internal_8 GOTO label_FALSE_171 + # IF_GREATER_ZERO local_a2i_aux_at_Parse_internal_8 GOTO label_FALSE_171 + lw $t0, -36($fp) + bgt $t0, 0, label_FALSE_171 + # IF_ZERO local_a2i_aux_at_Parse_internal_8 GOTO label_FALSE_171 + # IF_ZERO local_a2i_aux_at_Parse_internal_8 GOTO label_FALSE_171 + lw $t0, -36($fp) + beq $t0, 0, label_FALSE_171 + # LOCAL local_a2i_aux_at_Parse_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_172 +j label_END_172 +label_FALSE_171: + # LOCAL local_a2i_aux_at_Parse_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_172: +# LOCAL local_a2i_aux_at_Parse_internal_7 --> -32($fp) +# LOCAL local_a2i_aux_at_Parse_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_7 GOTO label_WHILE_END_170 +# IF_ZERO local_a2i_aux_at_Parse_internal_7 GOTO label_WHILE_END_170 +lw $t0, -32($fp) +beq $t0, 0, label_WHILE_END_170 +# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_0 +sw $t0, 12($v0) +li $t0, 0 +sw $t0, 16($v0) +sw $v0, -40($fp) +# LOCAL local_a2i_aux_at_Parse_internal_10 --> -44($fp) +# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) +# local_a2i_aux_at_Parse_internal_10 = PARAM param_a2i_aux_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -44($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_a2i_aux_at_Parse_i_5 +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +lw $t0, -24($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_12 --> -52($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -52($fp) +# ARG local_a2i_aux_at_Parse_internal_12 +# LOCAL local_a2i_aux_at_Parse_internal_12 --> -52($fp) +lw $t0, -52($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_10 --> -44($fp) +# LOCAL local_a2i_aux_at_Parse_internal_11 --> -48($fp) +# local_a2i_aux_at_Parse_internal_11 = VCALL local_a2i_aux_at_Parse_internal_10 substr +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) +# LOCAL local_a2i_aux_at_Parse_internal_11 --> -48($fp) +# local_a2i_aux_at_Parse_c_9 = local_a2i_aux_at_Parse_internal_11 +lw $t0, -48($fp) +sw $t0, -40($fp) +# LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_18 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -72($fp) +# IF_ZERO local_a2i_aux_at_Parse_c_9 GOTO label_FALSE_175 +# IF_ZERO local_a2i_aux_at_Parse_c_9 GOTO label_FALSE_175 +lw $t0, -40($fp) +beq $t0, 0, label_FALSE_175 +# IF_ZERO local_a2i_aux_at_Parse_internal_17 GOTO label_FALSE_175 +# IF_ZERO local_a2i_aux_at_Parse_internal_17 GOTO label_FALSE_175 +lw $t0, -72($fp) +beq $t0, 0, label_FALSE_175 +# LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) +# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) +# Comparing -40($fp) type with String +la $v0, String +lw $a0, -40($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -68($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_STRING_178 +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_STRING_178 +lw $t0, -68($fp) +beq $t0, 0, label_COMPARE_STRING_178 +# LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) +# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) +# Comparing -40($fp) type with Bool +la $v0, Bool +lw $a0, -40($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -68($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_BY_VALUE_179 +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_BY_VALUE_179 +lw $t0, -68($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_179 +# LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) +# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) +# Comparing -40($fp) type with Int +la $v0, Int +lw $a0, -40($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -68($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_BY_VALUE_179 +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_BY_VALUE_179 +lw $t0, -68($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_179 +# LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) +# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) +# LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) +# Load pointers and SUB +lw $a0, -40($fp) +lw $a1, -72($fp) +sub $a0, $a0, $a1 +sw $a0, -68($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 +lw $t0, -68($fp) +beq $t0, 0, label_TRUE_176 +# GOTO label_FALSE_175 +j label_FALSE_175 +label_COMPARE_BY_VALUE_179: + # LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) + lw $a0, -40($fp) + lw $a1, -72($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -68($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 + # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 + lw $t0, -68($fp) + beq $t0, 0, label_TRUE_176 + # GOTO label_FALSE_175 + j label_FALSE_175 + label_COMPARE_STRING_178: + # LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) + # Load strings for comparison + lw $v0, -40($fp) + lw $v1, -72($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -68($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_CONTINUE_180 + # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_CONTINUE_180 + lw $t0, -68($fp) + beq $t0, 0, label_CONTINUE_180 + # GOTO label_FALSE_175 + j label_FALSE_175 + label_CONTINUE_180: + # LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -40($fp) + lw $v1, -72($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_181: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_182 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_181 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_182: + # Store result + sw $a2, -68($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 + # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 + lw $t0, -68($fp) + beq $t0, 0, label_TRUE_176 + label_FALSE_175: + # LOCAL local_a2i_aux_at_Parse_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -64($fp) + # GOTO label_END_177 +j label_END_177 +label_TRUE_176: + # LOCAL local_a2i_aux_at_Parse_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -64($fp) + label_END_177: +# LOCAL local_a2i_aux_at_Parse_internal_13 --> -56($fp) +# LOCAL local_a2i_aux_at_Parse_internal_15 --> -64($fp) +# Obtain value from -64($fp) +lw $v0, -64($fp) +lw $v0, 12($v0) +sw $v0, -56($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_13 GOTO label_FALSEIF_173 +# IF_ZERO local_a2i_aux_at_Parse_internal_13 GOTO label_FALSEIF_173 +lw $t0, -56($fp) +beq $t0, 0, label_FALSEIF_173 +# LOCAL local_a2i_aux_at_Parse_internal_18 --> -76($fp) +# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) +# local_a2i_aux_at_Parse_internal_18 = PARAM param_a2i_aux_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -76($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_21 --> -88($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -88($fp) +# LOCAL local_a2i_aux_at_Parse_internal_20 --> -84($fp) +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +# LOCAL local_a2i_aux_at_Parse_internal_21 --> -88($fp) +# local_a2i_aux_at_Parse_internal_20 = local_a2i_aux_at_Parse_i_5 + local_a2i_aux_at_Parse_internal_21 +lw $t1, -24($fp) +lw $t0, 12($t1) +lw $t1, -88($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -84($fp) +# ARG local_a2i_aux_at_Parse_internal_20 +# LOCAL local_a2i_aux_at_Parse_internal_20 --> -84($fp) +lw $t0, -84($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_24 --> -100($fp) +# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) +# local_a2i_aux_at_Parse_internal_24 = PARAM param_a2i_aux_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -100($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_24 --> -100($fp) +# LOCAL local_a2i_aux_at_Parse_internal_25 --> -104($fp) +# local_a2i_aux_at_Parse_internal_25 = VCALL local_a2i_aux_at_Parse_internal_24 length +# Save new self pointer in $s1 +lw $s1, -100($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 20($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -104($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_aux_at_Parse_internal_23 --> -96($fp) +# LOCAL local_a2i_aux_at_Parse_internal_25 --> -104($fp) +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +# local_a2i_aux_at_Parse_internal_23 = local_a2i_aux_at_Parse_internal_25 - local_a2i_aux_at_Parse_i_5 +lw $t1, -104($fp) +lw $t0, 12($t1) +lw $t1, -24($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -96($fp) +# LOCAL local_a2i_aux_at_Parse_internal_26 --> -108($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -108($fp) +# LOCAL local_a2i_aux_at_Parse_internal_22 --> -92($fp) +# LOCAL local_a2i_aux_at_Parse_internal_23 --> -96($fp) +# LOCAL local_a2i_aux_at_Parse_internal_26 --> -108($fp) +# local_a2i_aux_at_Parse_internal_22 = local_a2i_aux_at_Parse_internal_23 - local_a2i_aux_at_Parse_internal_26 +lw $t1, -96($fp) +lw $t0, 12($t1) +lw $t1, -108($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -92($fp) +# ARG local_a2i_aux_at_Parse_internal_22 +# LOCAL local_a2i_aux_at_Parse_internal_22 --> -92($fp) +lw $t0, -92($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_18 --> -76($fp) +# LOCAL local_a2i_aux_at_Parse_internal_19 --> -80($fp) +# local_a2i_aux_at_Parse_internal_19 = VCALL local_a2i_aux_at_Parse_internal_18 substr +# Save new self pointer in $s1 +lw $s1, -76($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -80($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_a2i_aux_at_Parse_internal_19 --> -80($fp) +lw $t0, -80($fp) +sw $t0, 16($s1) +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +# LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) +# local_a2i_aux_at_Parse_i_5 = local_a2i_aux_at_Parse_j_2 +lw $t0, -12($fp) +sw $t0, -24($fp) +# LOCAL local_a2i_aux_at_Parse_internal_14 --> -60($fp) +# local_a2i_aux_at_Parse_internal_14 = +# GOTO label_ENDIF_174 +j label_ENDIF_174 +label_FALSEIF_173: + # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_19 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -128($fp) + # IF_ZERO local_a2i_aux_at_Parse_c_9 GOTO label_FALSE_185 + # IF_ZERO local_a2i_aux_at_Parse_c_9 GOTO label_FALSE_185 + lw $t0, -40($fp) + beq $t0, 0, label_FALSE_185 + # IF_ZERO local_a2i_aux_at_Parse_internal_31 GOTO label_FALSE_185 + # IF_ZERO local_a2i_aux_at_Parse_internal_31 GOTO label_FALSE_185 + lw $t0, -128($fp) + beq $t0, 0, label_FALSE_185 + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # Comparing -40($fp) type with String + la $v0, String + lw $a0, -40($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_STRING_188 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_STRING_188 + lw $t0, -124($fp) + beq $t0, 0, label_COMPARE_STRING_188 + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # Comparing -40($fp) type with Bool + la $v0, Bool + lw $a0, -40($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_BY_VALUE_189 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_BY_VALUE_189 + lw $t0, -124($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_189 + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # Comparing -40($fp) type with Int + la $v0, Int + lw $a0, -40($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_BY_VALUE_189 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_BY_VALUE_189 + lw $t0, -124($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_189 + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) + # Load pointers and SUB + lw $a0, -40($fp) + lw $a1, -128($fp) + sub $a0, $a0, $a1 + sw $a0, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 + lw $t0, -124($fp) + beq $t0, 0, label_TRUE_186 + # GOTO label_FALSE_185 + j label_FALSE_185 + label_COMPARE_BY_VALUE_189: + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) + lw $a0, -40($fp) + lw $a1, -128($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 + lw $t0, -124($fp) + beq $t0, 0, label_TRUE_186 + # GOTO label_FALSE_185 + j label_FALSE_185 + label_COMPARE_STRING_188: + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) + # Load strings for comparison + lw $v0, -40($fp) + lw $v1, -128($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_CONTINUE_190 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_CONTINUE_190 + lw $t0, -124($fp) + beq $t0, 0, label_CONTINUE_190 + # GOTO label_FALSE_185 + j label_FALSE_185 + label_CONTINUE_190: + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -40($fp) + lw $v1, -128($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_191: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_192 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_191 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_192: + # Store result + sw $a2, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 + lw $t0, -124($fp) + beq $t0, 0, label_TRUE_186 + label_FALSE_185: + # LOCAL local_a2i_aux_at_Parse_internal_29 --> -120($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -120($fp) + # GOTO label_END_187 +j label_END_187 +label_TRUE_186: + # LOCAL local_a2i_aux_at_Parse_internal_29 --> -120($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -120($fp) + label_END_187: +# LOCAL local_a2i_aux_at_Parse_internal_27 --> -112($fp) +# LOCAL local_a2i_aux_at_Parse_internal_29 --> -120($fp) +# Obtain value from -120($fp) +lw $v0, -120($fp) +lw $v0, 12($v0) +sw $v0, -112($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_27 GOTO label_FALSEIF_183 +# IF_ZERO local_a2i_aux_at_Parse_internal_27 GOTO label_FALSEIF_183 +lw $t0, -112($fp) +beq $t0, 0, label_FALSEIF_183 +# LOCAL local_a2i_aux_at_Parse_internal_32 --> -132($fp) +# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) +# local_a2i_aux_at_Parse_internal_32 = PARAM param_a2i_aux_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -132($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_35 --> -144($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -144($fp) +# LOCAL local_a2i_aux_at_Parse_internal_34 --> -140($fp) +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +# LOCAL local_a2i_aux_at_Parse_internal_35 --> -144($fp) +# local_a2i_aux_at_Parse_internal_34 = local_a2i_aux_at_Parse_i_5 + local_a2i_aux_at_Parse_internal_35 +lw $t1, -24($fp) +lw $t0, 12($t1) +lw $t1, -144($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -140($fp) +# ARG local_a2i_aux_at_Parse_internal_34 +# LOCAL local_a2i_aux_at_Parse_internal_34 --> -140($fp) +lw $t0, -140($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_38 --> -156($fp) +# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) +# local_a2i_aux_at_Parse_internal_38 = PARAM param_a2i_aux_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -156($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_38 --> -156($fp) +# LOCAL local_a2i_aux_at_Parse_internal_39 --> -160($fp) +# local_a2i_aux_at_Parse_internal_39 = VCALL local_a2i_aux_at_Parse_internal_38 length +# Save new self pointer in $s1 +lw $s1, -156($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 20($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -160($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_aux_at_Parse_internal_37 --> -152($fp) +# LOCAL local_a2i_aux_at_Parse_internal_39 --> -160($fp) +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +# local_a2i_aux_at_Parse_internal_37 = local_a2i_aux_at_Parse_internal_39 - local_a2i_aux_at_Parse_i_5 +lw $t1, -160($fp) +lw $t0, 12($t1) +lw $t1, -24($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -152($fp) +# LOCAL local_a2i_aux_at_Parse_internal_40 --> -164($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -164($fp) +# LOCAL local_a2i_aux_at_Parse_internal_36 --> -148($fp) +# LOCAL local_a2i_aux_at_Parse_internal_37 --> -152($fp) +# LOCAL local_a2i_aux_at_Parse_internal_40 --> -164($fp) +# local_a2i_aux_at_Parse_internal_36 = local_a2i_aux_at_Parse_internal_37 - local_a2i_aux_at_Parse_internal_40 +lw $t1, -152($fp) +lw $t0, 12($t1) +lw $t1, -164($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -148($fp) +# ARG local_a2i_aux_at_Parse_internal_36 +# LOCAL local_a2i_aux_at_Parse_internal_36 --> -148($fp) +lw $t0, -148($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_32 --> -132($fp) +# LOCAL local_a2i_aux_at_Parse_internal_33 --> -136($fp) +# local_a2i_aux_at_Parse_internal_33 = VCALL local_a2i_aux_at_Parse_internal_32 substr +# Save new self pointer in $s1 +lw $s1, -132($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -136($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_a2i_aux_at_Parse_internal_33 --> -136($fp) +lw $t0, -136($fp) +sw $t0, 16($s1) +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +# LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) +# local_a2i_aux_at_Parse_i_5 = local_a2i_aux_at_Parse_j_2 +lw $t0, -12($fp) +sw $t0, -24($fp) +# LOCAL local_a2i_aux_at_Parse_internal_28 --> -116($fp) +# local_a2i_aux_at_Parse_internal_28 = +# GOTO label_ENDIF_184 +j label_ENDIF_184 +label_FALSEIF_183: + # LOCAL local_a2i_aux_at_Parse_internal_43 --> -176($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 10 + sw $t0, 12($v0) + sw $v0, -176($fp) + # LOCAL local_a2i_aux_at_Parse_internal_42 --> -172($fp) + # LOCAL local_a2i_aux_at_Parse_int_0 --> -4($fp) + # LOCAL local_a2i_aux_at_Parse_internal_43 --> -176($fp) + # local_a2i_aux_at_Parse_internal_42 = local_a2i_aux_at_Parse_int_0 * local_a2i_aux_at_Parse_internal_43 + lw $t1, -4($fp) + lw $t0, 12($t1) + lw $t1, -176($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -172($fp) + # LOCAL local_a2i_aux_at_Parse_internal_46 --> -188($fp) + # local_a2i_aux_at_Parse_internal_46 = SELF + sw $s1, -188($fp) + # LOCAL local_a2i_aux_at_Parse_internal_44 --> -180($fp) + # LOCAL local_a2i_aux_at_Parse_internal_46 --> -188($fp) + # local_a2i_aux_at_Parse_internal_44 = local_a2i_aux_at_Parse_internal_46 + lw $t0, -188($fp) + sw $t0, -180($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_aux_at_Parse_internal_47 --> -192($fp) + # PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) + # local_a2i_aux_at_Parse_internal_47 = PARAM param_a2i_aux_at_Parse_s_0 + lw $t0, 0($fp) + sw $t0, -192($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_a2i_aux_at_Parse_i_5 + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_aux_at_Parse_internal_49 --> -200($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -200($fp) + # ARG local_a2i_aux_at_Parse_internal_49 + # LOCAL local_a2i_aux_at_Parse_internal_49 --> -200($fp) + lw $t0, -200($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_aux_at_Parse_internal_47 --> -192($fp) + # LOCAL local_a2i_aux_at_Parse_internal_48 --> -196($fp) + # local_a2i_aux_at_Parse_internal_48 = VCALL local_a2i_aux_at_Parse_internal_47 substr + # Save new self pointer in $s1 + lw $s1, -192($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -196($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_a2i_aux_at_Parse_internal_48 + # LOCAL local_a2i_aux_at_Parse_internal_48 --> -196($fp) + lw $t0, -196($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_aux_at_Parse_internal_44 --> -180($fp) + # LOCAL local_a2i_aux_at_Parse_internal_45 --> -184($fp) + # local_a2i_aux_at_Parse_internal_45 = VCALL local_a2i_aux_at_Parse_internal_44 c2i + # Save new self pointer in $s1 + lw $s1, -180($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 36($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -184($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_aux_at_Parse_internal_41 --> -168($fp) + # LOCAL local_a2i_aux_at_Parse_internal_42 --> -172($fp) + # LOCAL local_a2i_aux_at_Parse_internal_45 --> -184($fp) + # local_a2i_aux_at_Parse_internal_41 = local_a2i_aux_at_Parse_internal_42 + local_a2i_aux_at_Parse_internal_45 + lw $t1, -172($fp) + lw $t0, 12($t1) + lw $t1, -184($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -168($fp) + # LOCAL local_a2i_aux_at_Parse_int_0 --> -4($fp) + # LOCAL local_a2i_aux_at_Parse_internal_41 --> -168($fp) + # local_a2i_aux_at_Parse_int_0 = local_a2i_aux_at_Parse_internal_41 + lw $t0, -168($fp) + sw $t0, -4($fp) + # LOCAL local_a2i_aux_at_Parse_internal_51 --> -208($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -208($fp) + # LOCAL local_a2i_aux_at_Parse_internal_50 --> -204($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_internal_51 --> -208($fp) + # local_a2i_aux_at_Parse_internal_50 = local_a2i_aux_at_Parse_i_5 + local_a2i_aux_at_Parse_internal_51 + lw $t1, -24($fp) + lw $t0, 12($t1) + lw $t1, -208($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -204($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_internal_50 --> -204($fp) + # local_a2i_aux_at_Parse_i_5 = local_a2i_aux_at_Parse_internal_50 + lw $t0, -204($fp) + sw $t0, -24($fp) + # IF_ZERO local_a2i_aux_at_Parse_i_5 GOTO label_FALSE_195 + # IF_ZERO local_a2i_aux_at_Parse_i_5 GOTO label_FALSE_195 + lw $t0, -24($fp) + beq $t0, 0, label_FALSE_195 + # IF_ZERO local_a2i_aux_at_Parse_j_2 GOTO label_FALSE_195 + # IF_ZERO local_a2i_aux_at_Parse_j_2 GOTO label_FALSE_195 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_195 + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # Comparing -24($fp) type with String + la $v0, String + lw $a0, -24($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_STRING_198 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_STRING_198 + lw $t0, -224($fp) + beq $t0, 0, label_COMPARE_STRING_198 + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # Comparing -24($fp) type with Bool + la $v0, Bool + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_BY_VALUE_199 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_BY_VALUE_199 + lw $t0, -224($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_199 + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # Comparing -24($fp) type with Int + la $v0, Int + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_BY_VALUE_199 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_BY_VALUE_199 + lw $t0, -224($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_199 + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + # Load pointers and SUB + lw $a0, -24($fp) + lw $a1, -12($fp) + sub $a0, $a0, $a1 + sw $a0, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 + lw $t0, -224($fp) + beq $t0, 0, label_TRUE_196 + # GOTO label_FALSE_195 + j label_FALSE_195 + label_COMPARE_BY_VALUE_199: + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + lw $a0, -24($fp) + lw $a1, -12($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 + lw $t0, -224($fp) + beq $t0, 0, label_TRUE_196 + # GOTO label_FALSE_195 + j label_FALSE_195 + label_COMPARE_STRING_198: + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -12($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_CONTINUE_200 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_CONTINUE_200 + lw $t0, -224($fp) + beq $t0, 0, label_CONTINUE_200 + # GOTO label_FALSE_195 + j label_FALSE_195 + label_CONTINUE_200: + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -12($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_201: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_202 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_201 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_202: + # Store result + sw $a2, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 + lw $t0, -224($fp) + beq $t0, 0, label_TRUE_196 + label_FALSE_195: + # LOCAL local_a2i_aux_at_Parse_internal_54 --> -220($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -220($fp) + # GOTO label_END_197 +j label_END_197 +label_TRUE_196: + # LOCAL local_a2i_aux_at_Parse_internal_54 --> -220($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -220($fp) + label_END_197: +# LOCAL local_a2i_aux_at_Parse_internal_52 --> -212($fp) +# LOCAL local_a2i_aux_at_Parse_internal_54 --> -220($fp) +# Obtain value from -220($fp) +lw $v0, -220($fp) +lw $v0, 12($v0) +sw $v0, -212($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_52 GOTO label_FALSEIF_193 +# IF_ZERO local_a2i_aux_at_Parse_internal_52 GOTO label_FALSEIF_193 +lw $t0, -212($fp) +beq $t0, 0, label_FALSEIF_193 +# LOCAL local_a2i_aux_at_Parse_internal_56 --> -228($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_20 +sw $t0, 12($v0) +li $t0, 0 +sw $t0, 16($v0) +sw $v0, -228($fp) +# +# LOCAL local_a2i_aux_at_Parse_internal_56 --> -228($fp) +lw $t0, -228($fp) +sw $t0, 16($s1) +# LOCAL local_a2i_aux_at_Parse_internal_53 --> -216($fp) +# local_a2i_aux_at_Parse_internal_53 = +# GOTO label_ENDIF_194 +j label_ENDIF_194 +label_FALSEIF_193: + # LOCAL local_a2i_aux_at_Parse_internal_57 --> -232($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_21 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -232($fp) + # LOCAL local_a2i_aux_at_Parse_internal_53 --> -216($fp) + # LOCAL local_a2i_aux_at_Parse_internal_57 --> -232($fp) + # local_a2i_aux_at_Parse_internal_53 = local_a2i_aux_at_Parse_internal_57 + lw $t0, -232($fp) + sw $t0, -216($fp) + label_ENDIF_194: +# LOCAL local_a2i_aux_at_Parse_internal_28 --> -116($fp) +# LOCAL local_a2i_aux_at_Parse_internal_53 --> -216($fp) +# local_a2i_aux_at_Parse_internal_28 = local_a2i_aux_at_Parse_internal_53 +lw $t0, -216($fp) +sw $t0, -116($fp) +label_ENDIF_184: +# LOCAL local_a2i_aux_at_Parse_internal_14 --> -60($fp) +# LOCAL local_a2i_aux_at_Parse_internal_28 --> -116($fp) +# local_a2i_aux_at_Parse_internal_14 = local_a2i_aux_at_Parse_internal_28 +lw $t0, -116($fp) +sw $t0, -60($fp) +label_ENDIF_174: +# GOTO label_WHILE_169 +j label_WHILE_169 +label_WHILE_END_170: + # RETURN local_a2i_aux_at_Parse_int_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_a2i_aux_at_Parse. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 240 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# __Main__attrib__g__init implementation. +# @Params: +__Main__attrib__g__init: + # Allocate stack frame for function __Main__attrib__g__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # local_ttrib__g__init_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # local_ttrib__g__init_internal_1 = local_ttrib__g__init_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) + # local_ttrib__g__init_internal_2 = VCALL local_ttrib__g__init_internal_1 read_input + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_ttrib__g__init_internal_2 + lw $v0, -12($fp) + # Deallocate stack frame for function __Main__attrib__g__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_main_at_Main_internal_2 = GETATTRIBUTE g Main + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + lw $t0, 20($s1) + sw $t0, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 print_V + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_main_at_Main_internal_5 = GETATTRIBUTE g Main + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t0, 20($s1) + sw $t0, -24($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 print_E + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_4 + lw $v0, -20($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __VList__attrib__car__init implementation. +# @Params: +__VList__attrib__car__init: + # Allocate stack frame for function __VList__attrib__car__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __VList__attrib__car__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_VList implementation. +# @Params: +function_isNil_at_VList: + # Allocate stack frame for function function_isNil_at_VList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_VList_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_isNil_at_VList_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_VList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_head_at_VList implementation. +# @Params: +function_head_at_VList: + # Allocate stack frame for function function_head_at_VList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_head_at_VList_internal_2 --> -12($fp) + # local_head_at_VList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_head_at_VList_internal_0 --> -4($fp) + # LOCAL local_head_at_VList_internal_2 --> -12($fp) + # local_head_at_VList_internal_0 = local_head_at_VList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_head_at_VList_internal_0 --> -4($fp) + # LOCAL local_head_at_VList_internal_1 --> -8($fp) + # local_head_at_VList_internal_1 = VCALL local_head_at_VList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_head_at_VList_internal_3 = GETATTRIBUTE car VList + # LOCAL local_head_at_VList_internal_3 --> -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) + # RETURN local_head_at_VList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_head_at_VList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_tail_at_VList implementation. +# @Params: +function_tail_at_VList: + # Allocate stack frame for function function_tail_at_VList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_tail_at_VList_internal_2 --> -12($fp) + # local_tail_at_VList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_tail_at_VList_internal_0 --> -4($fp) + # LOCAL local_tail_at_VList_internal_2 --> -12($fp) + # local_tail_at_VList_internal_0 = local_tail_at_VList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_tail_at_VList_internal_0 --> -4($fp) + # LOCAL local_tail_at_VList_internal_1 --> -8($fp) + # local_tail_at_VList_internal_1 = VCALL local_tail_at_VList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_tail_at_VList_internal_3 --> -16($fp) + # local_tail_at_VList_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_tail_at_VList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_tail_at_VList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cons_at_VList implementation. +# @Params: +# 0($fp) = param_cons_at_VList_v_0 +function_cons_at_VList: + # Allocate stack frame for function function_cons_at_VList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cons_at_VList_internal_2 --> -12($fp) + # local_cons_at_VList_internal_2 = ALLOCATE VCons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, VCons + sw $t0, 12($v0) + li $t0, 5 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, VCons_start + sw $t0, 4($v0) + # Load type offset + li $t0, 40 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __VList__attrib__car__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __VCons__attrib__cdr__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -12($fp) + # LOCAL local_cons_at_VList_internal_0 --> -4($fp) + # LOCAL local_cons_at_VList_internal_2 --> -12($fp) + # local_cons_at_VList_internal_0 = local_cons_at_VList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cons_at_VList_v_0 + # PARAM param_cons_at_VList_v_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cons_at_VList_internal_3 --> -16($fp) + # local_cons_at_VList_internal_3 = SELF + sw $s1, -16($fp) + # ARG local_cons_at_VList_internal_3 + # LOCAL local_cons_at_VList_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cons_at_VList_internal_0 --> -4($fp) + # LOCAL local_cons_at_VList_internal_1 --> -8($fp) + # local_cons_at_VList_internal_1 = VCALL local_cons_at_VList_internal_0 init + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_cons_at_VList_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_cons_at_VList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_at_VList implementation. +# @Params: +function_print_at_VList: + # Allocate stack frame for function function_print_at_VList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_print_at_VList_internal_2 --> -12($fp) + # local_print_at_VList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_at_VList_internal_0 --> -4($fp) + # LOCAL local_print_at_VList_internal_2 --> -12($fp) + # local_print_at_VList_internal_0 = local_print_at_VList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_VList_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_22 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_print_at_VList_internal_3 + # LOCAL local_print_at_VList_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_VList_internal_0 --> -4($fp) + # LOCAL local_print_at_VList_internal_1 --> -8($fp) + # local_print_at_VList_internal_1 = VCALL local_print_at_VList_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_at_VList_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_print_at_VList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __VCons__attrib__cdr__init implementation. +# @Params: +__VCons__attrib__cdr__init: + # Allocate stack frame for function __VCons__attrib__cdr__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __VCons__attrib__cdr__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_VCons implementation. +# @Params: +function_isNil_at_VCons: + # Allocate stack frame for function function_isNil_at_VCons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_VCons_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_isNil_at_VCons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_VCons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_head_at_VCons implementation. +# @Params: +function_head_at_VCons: + # Allocate stack frame for function function_head_at_VCons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_head_at_VCons_internal_0 = GETATTRIBUTE car VCons + # LOCAL local_head_at_VCons_internal_0 --> -4($fp) + lw $t0, 12($s1) + sw $t0, -4($fp) + # RETURN local_head_at_VCons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_head_at_VCons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_tail_at_VCons implementation. +# @Params: +function_tail_at_VCons: + # Allocate stack frame for function function_tail_at_VCons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_tail_at_VCons_internal_0 = GETATTRIBUTE cdr VCons + # LOCAL local_tail_at_VCons_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_tail_at_VCons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_tail_at_VCons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_VCons implementation. +# @Params: +# 0($fp) = param_init_at_VCons_v_0 +# 4($fp) = param_init_at_VCons_rest_1 +function_init_at_VCons: + # Allocate stack frame for function function_init_at_VCons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_VCons_v_0 --> 4($fp) + lw $t0, 4($fp) + sw $t0, 12($s1) + # + # PARAM param_init_at_VCons_rest_1 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 16($s1) + # LOCAL local_init_at_VCons_internal_0 --> -4($fp) + # local_init_at_VCons_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_VCons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_VCons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_print_at_VCons implementation. +# @Params: +function_print_at_VCons: + # Allocate stack frame for function function_print_at_VCons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_print_at_VCons_internal_2 = GETATTRIBUTE car VCons + # LOCAL local_print_at_VCons_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # LOCAL local_print_at_VCons_internal_0 --> -4($fp) + # LOCAL local_print_at_VCons_internal_2 --> -12($fp) + # local_print_at_VCons_internal_0 = local_print_at_VCons_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_VCons_internal_0 --> -4($fp) + # LOCAL local_print_at_VCons_internal_1 --> -8($fp) + # local_print_at_VCons_internal_1 = VCALL local_print_at_VCons_internal_0 print + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_print_at_VCons_internal_5 = GETATTRIBUTE cdr VCons + # LOCAL local_print_at_VCons_internal_5 --> -24($fp) + lw $t0, 16($s1) + sw $t0, -24($fp) + # LOCAL local_print_at_VCons_internal_3 --> -16($fp) + # LOCAL local_print_at_VCons_internal_5 --> -24($fp) + # local_print_at_VCons_internal_3 = local_print_at_VCons_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_VCons_internal_3 --> -16($fp) + # LOCAL local_print_at_VCons_internal_4 --> -20($fp) + # local_print_at_VCons_internal_4 = VCALL local_print_at_VCons_internal_3 print + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_at_VCons_internal_4 + lw $v0, -20($fp) + # Deallocate stack frame for function function_print_at_VCons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __EList__attrib__car__init implementation. +# @Params: +__EList__attrib__car__init: + # Allocate stack frame for function __EList__attrib__car__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __EList__attrib__car__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_EList implementation. +# @Params: +function_isNil_at_EList: + # Allocate stack frame for function function_isNil_at_EList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_EList_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_isNil_at_EList_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_EList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_head_at_EList implementation. +# @Params: +function_head_at_EList: + # Allocate stack frame for function function_head_at_EList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_head_at_EList_internal_2 --> -12($fp) + # local_head_at_EList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_head_at_EList_internal_0 --> -4($fp) + # LOCAL local_head_at_EList_internal_2 --> -12($fp) + # local_head_at_EList_internal_0 = local_head_at_EList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_head_at_EList_internal_0 --> -4($fp) + # LOCAL local_head_at_EList_internal_1 --> -8($fp) + # local_head_at_EList_internal_1 = VCALL local_head_at_EList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_head_at_EList_internal_3 = GETATTRIBUTE car EList + # LOCAL local_head_at_EList_internal_3 --> -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) + # RETURN local_head_at_EList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_head_at_EList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_tail_at_EList implementation. +# @Params: +function_tail_at_EList: + # Allocate stack frame for function function_tail_at_EList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_tail_at_EList_internal_2 --> -12($fp) + # local_tail_at_EList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_tail_at_EList_internal_0 --> -4($fp) + # LOCAL local_tail_at_EList_internal_2 --> -12($fp) + # local_tail_at_EList_internal_0 = local_tail_at_EList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_tail_at_EList_internal_0 --> -4($fp) + # LOCAL local_tail_at_EList_internal_1 --> -8($fp) + # local_tail_at_EList_internal_1 = VCALL local_tail_at_EList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_tail_at_EList_internal_3 --> -16($fp) + # local_tail_at_EList_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_tail_at_EList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_tail_at_EList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cons_at_EList implementation. +# @Params: +# 0($fp) = param_cons_at_EList_e_0 +function_cons_at_EList: + # Allocate stack frame for function function_cons_at_EList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cons_at_EList_internal_2 --> -12($fp) + # local_cons_at_EList_internal_2 = ALLOCATE ECons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, ECons + sw $t0, 12($v0) + li $t0, 5 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, ECons_start + sw $t0, 4($v0) + # Load type offset + li $t0, 48 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __EList__attrib__car__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __ECons__attrib__cdr__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -12($fp) + # LOCAL local_cons_at_EList_internal_0 --> -4($fp) + # LOCAL local_cons_at_EList_internal_2 --> -12($fp) + # local_cons_at_EList_internal_0 = local_cons_at_EList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cons_at_EList_e_0 + # PARAM param_cons_at_EList_e_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cons_at_EList_internal_3 --> -16($fp) + # local_cons_at_EList_internal_3 = SELF + sw $s1, -16($fp) + # ARG local_cons_at_EList_internal_3 + # LOCAL local_cons_at_EList_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cons_at_EList_internal_0 --> -4($fp) + # LOCAL local_cons_at_EList_internal_1 --> -8($fp) + # local_cons_at_EList_internal_1 = VCALL local_cons_at_EList_internal_0 init + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_cons_at_EList_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_cons_at_EList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_append_at_EList implementation. +# @Params: +# 0($fp) = param_append_at_EList_l_0 +function_append_at_EList: +# Allocate stack frame for function function_append_at_EList. +subu $sp, $sp, 68 +sw $ra, 4($sp) +sw $fp, 0($sp) +addu $fp, $sp, 68 +# LOCAL local_append_at_EList_internal_4 --> -20($fp) +# local_append_at_EList_internal_4 = SELF +sw $s1, -20($fp) +# LOCAL local_append_at_EList_internal_2 --> -12($fp) +# LOCAL local_append_at_EList_internal_4 --> -20($fp) +# local_append_at_EList_internal_2 = local_append_at_EList_internal_4 +lw $t0, -20($fp) +sw $t0, -12($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_append_at_EList_internal_2 --> -12($fp) +# LOCAL local_append_at_EList_internal_3 --> -16($fp) +# local_append_at_EList_internal_3 = VCALL local_append_at_EList_internal_2 isNil +# Save new self pointer in $s1 +lw $s1, -12($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 28($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -16($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_append_at_EList_internal_0 --> -4($fp) +# LOCAL local_append_at_EList_internal_3 --> -16($fp) +# Obtain value from -16($fp) +lw $v0, -16($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_append_at_EList_internal_0 GOTO label_FALSEIF_203 +# IF_ZERO local_append_at_EList_internal_0 GOTO label_FALSEIF_203 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_203 +# LOCAL local_append_at_EList_internal_1 --> -8($fp) +# PARAM param_append_at_EList_l_0 --> 0($fp) +# local_append_at_EList_internal_1 = PARAM param_append_at_EList_l_0 +lw $t0, 0($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_204 +j label_ENDIF_204 +label_FALSEIF_203: + # LOCAL local_append_at_EList_internal_11 --> -48($fp) + # local_append_at_EList_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_append_at_EList_internal_9 --> -40($fp) + # LOCAL local_append_at_EList_internal_11 --> -48($fp) + # local_append_at_EList_internal_9 = local_append_at_EList_internal_11 + lw $t0, -48($fp) + sw $t0, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_append_at_EList_internal_9 --> -40($fp) + # LOCAL local_append_at_EList_internal_10 --> -44($fp) + # local_append_at_EList_internal_10 = VCALL local_append_at_EList_internal_9 tail + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 36($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_append_at_EList_internal_7 --> -32($fp) + # LOCAL local_append_at_EList_internal_10 --> -44($fp) + # local_append_at_EList_internal_7 = local_append_at_EList_internal_10 + lw $t0, -44($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_append_at_EList_l_0 + # PARAM param_append_at_EList_l_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_append_at_EList_internal_7 --> -32($fp) + # LOCAL local_append_at_EList_internal_8 --> -36($fp) + # local_append_at_EList_internal_8 = VCALL local_append_at_EList_internal_7 append + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_append_at_EList_internal_5 --> -24($fp) + # LOCAL local_append_at_EList_internal_8 --> -36($fp) + # local_append_at_EList_internal_5 = local_append_at_EList_internal_8 + lw $t0, -36($fp) + sw $t0, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_append_at_EList_internal_14 --> -60($fp) + # local_append_at_EList_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_append_at_EList_internal_12 --> -52($fp) + # LOCAL local_append_at_EList_internal_14 --> -60($fp) + # local_append_at_EList_internal_12 = local_append_at_EList_internal_14 + lw $t0, -60($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_append_at_EList_internal_12 --> -52($fp) + # LOCAL local_append_at_EList_internal_13 --> -56($fp) + # local_append_at_EList_internal_13 = VCALL local_append_at_EList_internal_12 head + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_append_at_EList_internal_13 + # LOCAL local_append_at_EList_internal_13 --> -56($fp) + lw $t0, -56($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_append_at_EList_internal_5 --> -24($fp) + # LOCAL local_append_at_EList_internal_6 --> -28($fp) + # local_append_at_EList_internal_6 = VCALL local_append_at_EList_internal_5 cons + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_append_at_EList_internal_1 --> -8($fp) + # LOCAL local_append_at_EList_internal_6 --> -28($fp) + # local_append_at_EList_internal_1 = local_append_at_EList_internal_6 + lw $t0, -28($fp) + sw $t0, -8($fp) + label_ENDIF_204: +# RETURN local_append_at_EList_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_append_at_EList. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 68 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_print_at_EList implementation. +# @Params: +function_print_at_EList: + # Allocate stack frame for function function_print_at_EList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_print_at_EList_internal_2 --> -12($fp) + # local_print_at_EList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_at_EList_internal_0 --> -4($fp) + # LOCAL local_print_at_EList_internal_2 --> -12($fp) + # local_print_at_EList_internal_0 = local_print_at_EList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_EList_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_23 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_print_at_EList_internal_3 + # LOCAL local_print_at_EList_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_EList_internal_0 --> -4($fp) + # LOCAL local_print_at_EList_internal_1 --> -8($fp) + # local_print_at_EList_internal_1 = VCALL local_print_at_EList_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_at_EList_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_print_at_EList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __ECons__attrib__cdr__init implementation. +# @Params: +__ECons__attrib__cdr__init: + # Allocate stack frame for function __ECons__attrib__cdr__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __ECons__attrib__cdr__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_ECons implementation. +# @Params: +function_isNil_at_ECons: + # Allocate stack frame for function function_isNil_at_ECons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_ECons_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_isNil_at_ECons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_ECons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_head_at_ECons implementation. +# @Params: +function_head_at_ECons: + # Allocate stack frame for function function_head_at_ECons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_head_at_ECons_internal_0 = GETATTRIBUTE car ECons + # LOCAL local_head_at_ECons_internal_0 --> -4($fp) + lw $t0, 12($s1) + sw $t0, -4($fp) + # RETURN local_head_at_ECons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_head_at_ECons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_tail_at_ECons implementation. +# @Params: +function_tail_at_ECons: + # Allocate stack frame for function function_tail_at_ECons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_tail_at_ECons_internal_0 = GETATTRIBUTE cdr ECons + # LOCAL local_tail_at_ECons_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_tail_at_ECons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_tail_at_ECons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_ECons implementation. +# @Params: +# 0($fp) = param_init_at_ECons_e_0 +# 4($fp) = param_init_at_ECons_rest_1 +function_init_at_ECons: + # Allocate stack frame for function function_init_at_ECons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_ECons_e_0 --> 4($fp) + lw $t0, 4($fp) + sw $t0, 12($s1) + # + # PARAM param_init_at_ECons_rest_1 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 16($s1) + # LOCAL local_init_at_ECons_internal_0 --> -4($fp) + # local_init_at_ECons_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_ECons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_ECons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_print_at_ECons implementation. +# @Params: +function_print_at_ECons: + # Allocate stack frame for function function_print_at_ECons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_print_at_ECons_internal_2 = GETATTRIBUTE car ECons + # LOCAL local_print_at_ECons_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # LOCAL local_print_at_ECons_internal_0 --> -4($fp) + # LOCAL local_print_at_ECons_internal_2 --> -12($fp) + # local_print_at_ECons_internal_0 = local_print_at_ECons_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_ECons_internal_0 --> -4($fp) + # LOCAL local_print_at_ECons_internal_1 --> -8($fp) + # local_print_at_ECons_internal_1 = VCALL local_print_at_ECons_internal_0 print + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_print_at_ECons_internal_5 = GETATTRIBUTE cdr ECons + # LOCAL local_print_at_ECons_internal_5 --> -24($fp) + lw $t0, 16($s1) + sw $t0, -24($fp) + # LOCAL local_print_at_ECons_internal_3 --> -16($fp) + # LOCAL local_print_at_ECons_internal_5 --> -24($fp) + # local_print_at_ECons_internal_3 = local_print_at_ECons_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_ECons_internal_3 --> -16($fp) + # LOCAL local_print_at_ECons_internal_4 --> -20($fp) + # local_print_at_ECons_internal_4 = VCALL local_print_at_ECons_internal_3 print + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_at_ECons_internal_4 + lw $v0, -20($fp) + # Deallocate stack frame for function function_print_at_ECons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Edge__attrib__from__init implementation. +# @Params: +__Edge__attrib__from__init: + # Allocate stack frame for function __Edge__attrib__from__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__from__init_internal_0 --> -4($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t1, 16 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 12 bytes of memory - li $a0, 12 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 li $v0, 9 syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - li $t1, 6 - sw $t1, 8($v0) - sw $v0, -36($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_4 = local_main_at_Main_internal_5 * local_main_at_Main_internal_8 - lw $t2, -24($fp) - lw $t1, 8($t2) - lw $t2, -36($fp) - lw $t3, 8($t2) - mul $t1, $t1, $t3 + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__from__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Edge__attrib__from__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Edge__attrib__to__init implementation. +# @Params: +__Edge__attrib__to__init: + # Allocate stack frame for function __Edge__attrib__to__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__to__init_internal_0 --> -4($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string for type Int - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 16 - sw $t2, 8($v0) - la $t2, Int - sw $t2, 12($v0) - li $t2, 3 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 12 bytes of memory - li $a0, 12 + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 li $v0, 9 syscall - sw $t2, 0($v0) - la $t2, Int_start - sw $t2, 4($v0) - sw $t1, 8($v0) - sw $v0, -20($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__to__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Edge__attrib__to__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Edge__attrib__weight__init implementation. +# @Params: +__Edge__attrib__weight__init: + # Allocate stack frame for function __Edge__attrib__weight__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__weight__init_internal_0 --> -4($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t1, 16 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 12 bytes of memory - li $a0, 12 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 li $v0, 9 syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - li $t1, 3 - sw $t1, 8($v0) - sw $v0, -40($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_3 = local_main_at_Main_internal_4 / local_main_at_Main_internal_9 - lw $t2, -20($fp) - lw $t1, 8($t2) - lw $t2, -40($fp) - lw $t3, 8($t2) - div $t1, $t1, $t3 + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__weight__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Edge__attrib__weight__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Edge implementation. +# @Params: +# 0($fp) = param_init_at_Edge_f_0 +# 4($fp) = param_init_at_Edge_t_1 +# 8($fp) = param_init_at_Edge_w_2 +function_init_at_Edge: + # Allocate stack frame for function function_init_at_Edge. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_Edge_f_0 --> 8($fp) + lw $t0, 8($fp) + sw $t0, 12($s1) + # + # PARAM param_init_at_Edge_t_1 --> 4($fp) + lw $t0, 4($fp) + sw $t0, 16($s1) + # + # PARAM param_init_at_Edge_w_2 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 20($s1) + # LOCAL local_init_at_Edge_internal_0 --> -4($fp) + # local_init_at_Edge_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_Edge_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_Edge. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 12 + jr $ra + # Function END + + +# function_print_at_Edge implementation. +# @Params: +function_print_at_Edge: + # Allocate stack frame for function function_print_at_Edge. + subu $sp, $sp, 104 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 104 + # LOCAL local_print_at_Edge_internal_2 --> -12($fp) + # local_print_at_Edge_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_at_Edge_internal_0 --> -4($fp) + # LOCAL local_print_at_Edge_internal_2 --> -12($fp) + # local_print_at_Edge_internal_0 = local_print_at_Edge_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Edge_internal_3 --> -16($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type Int - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 16 - sw $t2, 8($v0) - la $t2, Int - sw $t2, 12($v0) - li $t2, 3 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Int_start - sw $t2, 4($v0) - sw $t1, 8($v0) + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_24 + sw $t0, 12($v0) + li $t0, 2 + sw $t0, 16($v0) sw $v0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t1, -16($fp) + # ARG local_print_at_Edge_internal_3 + # LOCAL local_print_at_Edge_internal_3 --> -16($fp) + lw $t0, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_int + sw $t0, 0($sp) + # LOCAL local_print_at_Edge_internal_0 --> -4($fp) + # LOCAL local_print_at_Edge_internal_1 --> -8($fp) + # local_print_at_Edge_internal_1 = VCALL local_print_at_Edge_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 16($t2) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t3 + jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_12 = SELF - sw $s1, -52($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 - lw $t1, -52($fp) - sw $t1, -44($fp) + # LOCAL local_print_at_Edge_internal_6 --> -28($fp) + # local_print_at_Edge_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_print_at_Edge_internal_4 --> -20($fp) + # LOCAL local_print_at_Edge_internal_6 --> -28($fp) + # local_print_at_Edge_internal_4 = local_print_at_Edge_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Edge_internal_7 = GETATTRIBUTE from Edge + # LOCAL local_print_at_Edge_internal_7 --> -32($fp) + lw $t0, 12($s1) + sw $t0, -32($fp) + # ARG local_print_at_Edge_internal_7 + # LOCAL local_print_at_Edge_internal_7 --> -32($fp) + lw $t0, -32($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Edge_internal_4 --> -20($fp) + # LOCAL local_print_at_Edge_internal_5 --> -24($fp) + # local_print_at_Edge_internal_5 = VCALL local_print_at_Edge_internal_4 out_int + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Edge_internal_10 --> -44($fp) + # local_print_at_Edge_internal_10 = SELF + sw $s1, -44($fp) + # LOCAL local_print_at_Edge_internal_8 --> -36($fp) + # LOCAL local_print_at_Edge_internal_10 --> -44($fp) + # local_print_at_Edge_internal_8 = local_print_at_Edge_internal_10 + lw $t0, -44($fp) + sw $t0, -36($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_print_at_Edge_internal_11 --> -48($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_4 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -56($fp) - # ARG local_main_at_Main_internal_13 - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - lw $t1, -56($fp) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_25 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -48($fp) + # ARG local_print_at_Edge_internal_11 + # LOCAL local_print_at_Edge_internal_11 --> -48($fp) + lw $t0, -48($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 out_string + sw $t0, 0($sp) + # LOCAL local_print_at_Edge_internal_8 --> -36($fp) + # LOCAL local_print_at_Edge_internal_9 --> -40($fp) + # local_print_at_Edge_internal_9 = VCALL local_print_at_Edge_internal_8 out_string # Save new self pointer in $s1 - lw $s1, -44($fp) + lw $s1, -36($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 12($t2) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -48($fp) + jalr $t0 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Edge_internal_14 --> -60($fp) + # local_print_at_Edge_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_print_at_Edge_internal_12 --> -52($fp) + # LOCAL local_print_at_Edge_internal_14 --> -60($fp) + # local_print_at_Edge_internal_12 = local_print_at_Edge_internal_14 + lw $t0, -60($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Edge_internal_15 = GETATTRIBUTE to Edge + # LOCAL local_print_at_Edge_internal_15 --> -64($fp) + lw $t0, 16($s1) + sw $t0, -64($fp) + # ARG local_print_at_Edge_internal_15 + # LOCAL local_print_at_Edge_internal_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Edge_internal_12 --> -52($fp) + # LOCAL local_print_at_Edge_internal_13 --> -56($fp) + # local_print_at_Edge_internal_13 = VCALL local_print_at_Edge_internal_12 out_int + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_16 = SELF - sw $s1, -68($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_14 = local_main_at_Main_internal_16 - lw $t1, -68($fp) - sw $t1, -60($fp) + # LOCAL local_print_at_Edge_internal_18 --> -76($fp) + # local_print_at_Edge_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_print_at_Edge_internal_16 --> -68($fp) + # LOCAL local_print_at_Edge_internal_18 --> -76($fp) + # local_print_at_Edge_internal_16 = local_print_at_Edge_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_print_at_Edge_internal_19 --> -80($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_5 - sw $t1, 12($v0) - li $t1, 5 - sw $t1, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_26 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) sw $v0, -80($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_17 = local_main_at_Main_internal_19 - lw $t1, -80($fp) - sw $t1, -72($fp) + # ARG local_print_at_Edge_internal_19 + # LOCAL local_print_at_Edge_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Edge_internal_16 --> -68($fp) + # LOCAL local_print_at_Edge_internal_17 --> -72($fp) + # local_print_at_Edge_internal_17 = VCALL local_print_at_Edge_internal_16 out_string + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Edge_internal_22 --> -92($fp) + # local_print_at_Edge_internal_22 = SELF + sw $s1, -92($fp) + # LOCAL local_print_at_Edge_internal_20 --> -84($fp) + # LOCAL local_print_at_Edge_internal_22 --> -92($fp) + # local_print_at_Edge_internal_20 = local_print_at_Edge_internal_22 + lw $t0, -92($fp) + sw $t0, -84($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_print_at_Edge_internal_23 = GETATTRIBUTE weight Edge + # LOCAL local_print_at_Edge_internal_23 --> -96($fp) + lw $t0, 20($s1) + sw $t0, -96($fp) + # ARG local_print_at_Edge_internal_23 + # LOCAL local_print_at_Edge_internal_23 --> -96($fp) + lw $t0, -96($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Edge_internal_20 --> -84($fp) + # LOCAL local_print_at_Edge_internal_21 --> -88($fp) + # local_print_at_Edge_internal_21 = VCALL local_print_at_Edge_internal_20 out_int + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_at_Edge_internal_21 + lw $v0, -88($fp) + # Deallocate stack frame for function function_print_at_Edge. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 104 + jr $ra + # Function END + + +# __Vertice__attrib__num__init implementation. +# @Params: +__Vertice__attrib__num__init: + # Allocate stack frame for function __Vertice__attrib__num__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local___attrib__num__init_internal_0 --> -4($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t1, 16 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 12 bytes of memory - li $a0, 12 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 li $v0, 9 syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - li $t1, 1 - sw $t1, 8($v0) - sw $v0, -84($fp) - # ARG local_main_at_Main_internal_20 - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - lw $t1, -84($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local___attrib__num__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Vertice__attrib__num__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Vertice__attrib__out__init implementation. +# @Params: +__Vertice__attrib__out__init: + # Allocate stack frame for function __Vertice__attrib__out__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local___attrib__out__init_internal_1 --> -8($fp) + # local___attrib__out__init_internal_1 = ALLOCATE EList # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t1, 16 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 12 bytes of memory - li $a0, 12 + li $t0, 8 + sw $t0, 8($v0) + la $t0, EList + sw $t0, 12($v0) + li $t0, 5 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 li $v0, 9 syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - li $t1, 2 - sw $t1, 8($v0) - sw $v0, -88($fp) - # ARG local_main_at_Main_internal_21 - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - lw $t1, -88($fp) - # Push arg into stack + sw $t0, 0($v0) + la $t0, EList_start + sw $t0, 4($v0) + # Load type offset + li $t0, 44 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack subu $sp, $sp, 4 sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_18 = VCALL local_main_at_Main_internal_17 substr + jal __EList__attrib__car__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # RETURN local___attrib__out__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Vertice__attrib__out__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_outgoing_at_Vertice implementation. +# @Params: +function_outgoing_at_Vertice: + # Allocate stack frame for function function_outgoing_at_Vertice. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_outgoing_at_Vertice_internal_0 = GETATTRIBUTE out Vertice + # LOCAL local_outgoing_at_Vertice_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_outgoing_at_Vertice_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_outgoing_at_Vertice. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_number_at_Vertice implementation. +# @Params: +function_number_at_Vertice: + # Allocate stack frame for function function_number_at_Vertice. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_number_at_Vertice_internal_0 = GETATTRIBUTE num Vertice + # LOCAL local_number_at_Vertice_internal_0 --> -4($fp) + lw $t0, 12($s1) + sw $t0, -4($fp) + # RETURN local_number_at_Vertice_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_number_at_Vertice. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Vertice implementation. +# @Params: +# 0($fp) = param_init_at_Vertice_n_0 +function_init_at_Vertice: + # Allocate stack frame for function function_init_at_Vertice. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_Vertice_n_0 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 12($s1) + # LOCAL local_init_at_Vertice_internal_0 --> -4($fp) + # local_init_at_Vertice_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_Vertice_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_Vertice. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_add_out_at_Vertice implementation. +# @Params: +# 0($fp) = param_add_out_at_Vertice_s_0 +function_add_out_at_Vertice: + # Allocate stack frame for function function_add_out_at_Vertice. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_add_out_at_Vertice_internal_2 = GETATTRIBUTE out Vertice + # LOCAL local_add_out_at_Vertice_internal_2 --> -12($fp) + lw $t0, 16($s1) + sw $t0, -12($fp) + # LOCAL local_add_out_at_Vertice_internal_0 --> -4($fp) + # LOCAL local_add_out_at_Vertice_internal_2 --> -12($fp) + # local_add_out_at_Vertice_internal_0 = local_add_out_at_Vertice_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_add_out_at_Vertice_s_0 + # PARAM param_add_out_at_Vertice_s_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_add_out_at_Vertice_internal_0 --> -4($fp) + # LOCAL local_add_out_at_Vertice_internal_1 --> -8($fp) + # local_add_out_at_Vertice_internal_1 = VCALL local_add_out_at_Vertice_internal_0 cons # Save new self pointer in $s1 - lw $s1, -72($fp) + lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 16($t2) + lw $t0, 40($t0) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -76($fp) + jalr $t0 + sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_18 - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - lw $t1, -76($fp) + # + # LOCAL local_add_out_at_Vertice_internal_1 --> -8($fp) + lw $t0, -8($fp) + sw $t0, 16($s1) + # LOCAL local_add_out_at_Vertice_internal_3 --> -16($fp) + # local_add_out_at_Vertice_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_add_out_at_Vertice_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_add_out_at_Vertice. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_at_Vertice implementation. +# @Params: +function_print_at_Vertice: + # Allocate stack frame for function function_print_at_Vertice. + subu $sp, $sp, 36 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 36 + # LOCAL local_print_at_Vertice_internal_2 --> -12($fp) + # local_print_at_Vertice_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_at_Vertice_internal_0 --> -4($fp) + # LOCAL local_print_at_Vertice_internal_2 --> -12($fp) + # local_print_at_Vertice_internal_0 = local_print_at_Vertice_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Vertice_internal_3 = GETATTRIBUTE num Vertice + # LOCAL local_print_at_Vertice_internal_3 --> -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) + # ARG local_print_at_Vertice_internal_3 + # LOCAL local_print_at_Vertice_internal_3 --> -16($fp) + lw $t0, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 out_string + sw $t0, 0($sp) + # LOCAL local_print_at_Vertice_internal_0 --> -4($fp) + # LOCAL local_print_at_Vertice_internal_1 --> -8($fp) + # local_print_at_Vertice_internal_1 = VCALL local_print_at_Vertice_internal_0 out_int # Save new self pointer in $s1 - lw $s1, -60($fp) + lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 12($t2) + lw $t0, 16($t0) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -64($fp) + jalr $t0 + sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_24 --> -100($fp) - # local_main_at_Main_internal_24 = SELF - sw $s1, -100($fp) - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - # LOCAL local_main_at_Main_internal_24 --> -100($fp) - # local_main_at_Main_internal_22 = local_main_at_Main_internal_24 - lw $t1, -100($fp) - sw $t1, -92($fp) + # local_print_at_Vertice_internal_6 = GETATTRIBUTE out Vertice + # LOCAL local_print_at_Vertice_internal_6 --> -28($fp) + lw $t0, 16($s1) + sw $t0, -28($fp) + # LOCAL local_print_at_Vertice_internal_4 --> -20($fp) + # LOCAL local_print_at_Vertice_internal_6 --> -28($fp) + # local_print_at_Vertice_internal_4 = local_print_at_Vertice_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_25 --> -104($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_6 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -104($fp) - # ARG local_main_at_Main_internal_25 - # LOCAL local_main_at_Main_internal_25 --> -104($fp) - lw $t1, -104($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - # LOCAL local_main_at_Main_internal_23 --> -96($fp) - # local_main_at_Main_internal_23 = VCALL local_main_at_Main_internal_22 out_string + # LOCAL local_print_at_Vertice_internal_4 --> -20($fp) + # LOCAL local_print_at_Vertice_internal_5 --> -24($fp) + # local_print_at_Vertice_internal_5 = VCALL local_print_at_Vertice_internal_4 print # Save new self pointer in $s1 - lw $s1, -92($fp) + lw $s1, -20($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 12($t2) + lw $t0, 44($t0) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -96($fp) + jalr $t0 + sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_23 - lw $v0, -96($fp) - # Deallocate stack frame for function function_main_at_Main. + # RETURN local_print_at_Vertice_internal_5 + lw $v0, -24($fp) + # Deallocate stack frame for function function_print_at_Vertice. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 112 + addu $sp, $sp, 36 jr $ra # Function END diff --git a/src/testing.py b/src/testing.py index 955864cd..599b5286 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,16 +60,387 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""(* hairy . . .*) -(* scary . . . *) -class Main inherits IO { - main(): IO { { - out_int((10 - 12) * 6 / 3); - out_string("\n"); - out_string("Hello".substr(1,2)); - out_string("\n"); - } }; +text = r"""(* + * Cool program reading descriptions of weighted directed graphs + * from stdin. It builds up a graph objects with a list of vertices + * and a list of edges. Every vertice has a list of outgoing edges. + * + * INPUT FORMAT + * Every line has the form vertice successor* + * Where vertice is an int, and successor is vertice,weight + * + * An empty line or EOF terminates the input. + * + * The list of vertices and the edge list is printed out by the Main + * class. + * + * TEST + * Once compiled, the file g1.graph can be fed to the program. + * The output should look like this: + +nautilus.CS.Berkeley.EDU 53# spim -file graph.s break") + self.register_instruction(BEQZ(a0, node.end_label)) + self.register_instruction(LB(a1, f"0($v1)")) + self.comment("Move strings pointers") + self.register_instruction(ADDU(v0, v0, 1, True)) + self.register_instruction(ADDU(v1, v1, 1, True)) + self.comment("Compare chars") + self.register_instruction(SUB(a0, a0, a1)) + self.register_instruction(BEQZ(a0, node.while_label)) + self.comment("False") + self.register_instruction(LI(a2, 1)) + self.register_instruction(Label(node.end_label)) + + # Guardar el resultado + self.comment("Store result") + self.register_instruction(SW(a2, dest)) + + @visit.register + def _(self, node: ReferenceEqualNode): + # Comparar por referencias es simplemente + # cargar los punteros y restar + dest = self.visit(node.dest) + left = self.visit(node.left) + right = self.visit(node.right) + + assert dest is not None + assert left is not None + assert right is not None + + self.comment("Load pointers and SUB") + self.register_instruction(LW(a0, left)) + self.register_instruction(LW(a1, right)) + self.register_instruction(SUB(a0, a0, a1)) + + self.register_instruction(SW(a0, dest)) + + @visit.register + def _(self, node: MinusNodeComp): + # operate por valor sin devolver una instancia de int + # Comparar por referencias es simplemente + # cargar los punteros y restar + dest = self.visit(node.dest) + left = self.visit(node.left) + right = self.visit(node.right) + + assert dest is not None + assert left is not None + assert right is not None + + # Load pointers + self.register_instruction(LW(a0, left)) + self.register_instruction(LW(a1, right)) - if not isinstance(left, int): - self.register_instruction(LW(reg, left)) + self.comment("Load values") + self.register_instruction(LW(a0, "12($a0)")) + self.register_instruction(LW(a1, "12($a1)")) + self.comment("SUB and store") + self.register_instruction(SUB(a0, a0, a1)) + self.register_instruction(SW(a0, dest)) class MipsCodeGenerator(CilToMipsVisitor): diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index bb7f130d..16749c61 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -20,14 +20,19 @@ from cil.nodes import ( AbortNode, - AllocateBoolNode, AllocateIntNode, + AllocateBoolNode, + AllocateIntNode, AllocateNode, AllocateStringNode, ArgNode, AssignNode, BitwiseNotNode, + CharToCharStringCompare, CilNode, CilProgramNode, + CompareSTRType, + CompareStringLengthNode, + CompareType, ConcatString, DataNode, DivNode, @@ -36,6 +41,7 @@ FunctionNode, GetAttributeNode, GetTypeIndex, + GetValue, IfZeroJump, InitSelfNode, InstructionNode, @@ -45,13 +51,16 @@ LoadNode, LocalNode, MinusNode, + MinusNodeComp, NotZeroJump, ParamNode, PlusNode, PrintIntNode, PrintNode, + PureMinus, ReadIntNode, ReadNode, + ReferenceEqualNode, RestoreSelf, ReturnNode, SaveSelf, @@ -202,6 +211,7 @@ def _(self, node: coolAst.AttributeDef, scope: Scope) -> None: self.current_function = self.register_function( f"__{self.current_type.name}__attrib__{node.idx}__init" ) + local = self.define_internal_local() if node.default_value is not None: # Generar el codigo de la expresion de inicializacion # y devolver el valor de esta @@ -214,9 +224,14 @@ def _(self, node: coolAst.AttributeDef, scope: Scope) -> None: # (0 = false y 0 = void) attribute_type = self.context.get_type(node.typex) if attribute_type.name == "String": - local = self.define_internal_local() self.register_instruction(AllocateStringNode(local, self.null, 0)) self.register_instruction(ReturnNode(local)) + elif attribute_type.name == "Bool": + self.register_instruction(AllocateBoolNode(local, 0)) + self.register_instruction(ReturnNode(local)) + elif attribute_type.name == "Int": + self.register_instruction(AllocateIntNode(local, 0)) + self.register_instruction(ReturnNode(local)) else: self.register_instruction(ReturnNode(0)) @@ -262,15 +277,18 @@ def _(self, node: coolAst.IfThenElseNode, scope: Scope): # noqa: F811 # Crear un LABEL al cual realizar un salto. false_label = self.do_label("FALSEIF") end_label = self.do_label("ENDIF") + cond_value = self.define_internal_local() return_expr = self.define_internal_local() # Salvar las instrucciones relacionadas con la condicion, # cada expresion retorna el nombre de la variable interna que contiene el valor ?? internal_cond_vm_holder = self.visit(node.cond, scope) + # Condicion es un Bool + self.register_instruction(GetValue(cond_value, internal_cond_vm_holder)) + # Chequear y saltar si es necesario. - assert isinstance(internal_cond_vm_holder, LocalNode) - self.register_instruction(IfZeroJump(internal_cond_vm_holder, false_label)) + self.register_instruction(IfZeroJump(cond_value, false_label)) # Salvar las instrucciones relacionadas con la rama TRUE. expr = self.visit(node.expr1, scope) @@ -304,6 +322,10 @@ def _(self, node: coolAst.VariableDeclaration, scope: Scope) -> CilNode: self.register_instruction(AllocateNode(var_info.type, local_var)) elif var_info.type.name == "String": self.register_instruction(AllocateStringNode(local_var, self.null, 0)) + elif var_info.type.name == "Int": + self.register_instruction(AllocateIntNode(local_var, 0)) + elif var_info.type.name == "Bool": + self.register_instruction(AllocateBoolNode(local_var, 0)) else: # Si la variable tiene una expresion de inicializacion # entonces no es necesario ponerle valor por defecto @@ -328,7 +350,16 @@ def _(self, node: coolAst.InstantiateClassNode, scope: Scope) -> LocalNode: # Reservar una variable que guarde la nueva instancia type_ = self.context.get_type(node.type_) instance_vm_holder = self.define_internal_local() - self.register_instruction(AllocateNode(type_, instance_vm_holder)) + + if type_.name not in ("String", "Int", "Bool"): + self.register_instruction(AllocateNode(type_, instance_vm_holder)) + elif type_.name == "String": + self.register_instruction(AllocateStringNode(instance_vm_holder, self.null, 0)) + elif type_.name == "Int": + self.register_instruction(AllocateIntNode(instance_vm_holder, 0)) + elif type_.name == "Bool": + self.register_instruction(AllocateBoolNode(instance_vm_holder, 0)) + return instance_vm_holder @visit.register @@ -411,14 +442,17 @@ def _(self, node: str, scope: Scope): def _(self, node: coolAst.WhileBlockNode, scope: Scope): # Evaluar la condicion y definir un LABEL al cual # retornar + cond_value = self.define_internal_local() while_label = self.do_label("WHILE") end_label = self.do_label("WHILE_END") self.register_instruction(LabelNode(while_label)) cond_vm_holder = self.visit(node.cond, scope) + # Lo que viene en cond es un Bool + self.register_instruction(GetValue(cond_value, cond_vm_holder)) + # Probar la condicion, si es true continuar la ejecucion, sino saltar al LABEL end - assert isinstance(cond_vm_holder, LocalNode), cond_vm_holder.__class__.__name__ - self.register_instruction(IfZeroJump(cond_vm_holder, end_label)) + self.register_instruction(IfZeroJump(cond_value, end_label)) # Registrar las instrucciones del cuerpo del while self.visit(node.statements, scope) @@ -438,7 +472,6 @@ def _(self, node: coolAst.CaseNode, scope: Scope): sub_vm_local_holder = self.define_internal_local() result_vm_holder = self.define_internal_local() - assert isinstance(expr_vm_holder, LocalNode) self.register_instruction( TypeOffsetNode(expr_vm_holder, type_internal_local_holder) ) @@ -468,7 +501,9 @@ def _(self, node: coolAst.CaseNode, scope: Scope): # en los branches del case. # Comprobar que tengamos una coincidencia self.register_instruction(AssignNode(tdt_result, len(self.context.types))) - self.register_instruction(MinusNode(tdt_result, min_, sub_vm_local_holder)) + self.register_instruction( + ReferenceEqualNode(tdt_result, min_, sub_vm_local_holder) + ) error_label = self.do_label("ERROR") self.register_instruction(IfZeroJump(sub_vm_local_holder, error_label)) @@ -617,14 +652,14 @@ def _(self, node: coolAst.StringConstant, scope: Scope) -> LocalNode: def _(self, node: coolAst.TrueConstant, scope: Scope): # variable interna que devuelve el valor de la constante expr = self.define_internal_local() - self.register_instruction(AssignNode(expr, 1)) + self.register_instruction(AllocateBoolNode(expr, 1)) return expr @visit.register def _(self, node: coolAst.FalseConstant, scope: Scope): # variable interna que devuelve el valor de la constante expr = self.define_internal_local() - self.register_instruction(AssignNode(expr, 0)) + self.register_instruction(AllocateBoolNode(expr, 0)) return expr # ******************* Implementacion de las comparaciones ******************** @@ -647,20 +682,22 @@ def _(self, node: coolAst.NegNode, scope: Scope): false_label = self.do_label("FALSE") not_end_label = self.do_label("NOT_END") assert isinstance(expr_result, LocalNode) + self.register_instruction(GetValue(expr_result, expr_result)) # Si expr = 0 entonces devolver 1 self.register_instruction(IfZeroJump(expr_result, false_label)) # Si expr = 1 devolver 0 - self.register_instruction(AssignNode(result_vm_holder, 0)) + self.register_instruction(AllocateBoolNode(result_vm_holder, 0)) self.register_instruction(UnconditionalJump(not_end_label)) self.register_instruction(LabelNode(false_label)) # Si expr = 0 entonces devolver 1 - self.register_instruction(AssignNode(result_vm_holder, 1)) + self.register_instruction(AllocateBoolNode(result_vm_holder, 1)) self.register_instruction(LabelNode(not_end_label)) return result_vm_holder @visit.register def _(self, node: coolAst.EqualToNode, scope: Scope) -> LocalNode: expr_result_vm_holder = self.define_internal_local() + temp_expr_vm_holder = self.define_internal_local() # Obtener el valor de la expresion izquierda left_vm_holder = self.visit(node.left, scope) @@ -668,9 +705,81 @@ def _(self, node: coolAst.EqualToNode, scope: Scope) -> LocalNode: # obtener el valor de la expresion derecha right_vm_holder = self.visit(node.right, scope) + false_ = self.do_label("FALSE") + true_ = self.do_label("TRUE") + end = self.do_label("END") + compare_string = self.do_label("COMPARE_STRING") + compare_by_value = self.do_label("COMPARE_BY_VALUE") + continue_ = self.do_label("CONTINUE") + while_label = self.do_label("WHILE_STR_COMP") + end_while_label = self.do_label("WHILE_STR_COMP_END") + + # Si left es un string realizar la comparacion entre strings + # si no realizar una resta y devolver el resultado + + # Si right = void o left = void (0) devolver false + self.register_instruction(IfZeroJump(left_vm_holder, false_)) + self.register_instruction(IfZeroJump(right_vm_holder, false_)) + + # Si es un string comparar char a char + self.register_instruction(CompareSTRType(temp_expr_vm_holder, left_vm_holder)) + # CompareType devuelve 0 para True y 1 para False + self.register_instruction(IfZeroJump(temp_expr_vm_holder, compare_string)) + # No es un string, comparar por valor si es bool o int self.register_instruction( - EqualToCilNode(left_vm_holder, right_vm_holder, expr_result_vm_holder) + CompareType(temp_expr_vm_holder, left_vm_holder, "Bool") ) + self.register_instruction(IfZeroJump(temp_expr_vm_holder, compare_by_value)) + + self.register_instruction( + CompareType(temp_expr_vm_holder, left_vm_holder, "Int") + ) + self.register_instruction(IfZeroJump(temp_expr_vm_holder, compare_by_value)) + + # Comparar por referencia + self.register_instruction( + ReferenceEqualNode(left_vm_holder, right_vm_holder, temp_expr_vm_holder) + ) + self.register_instruction(IfZeroJump(temp_expr_vm_holder, true_)) + self.register_instruction(UnconditionalJump(false_)) + + self.register_instruction(LabelNode(compare_by_value)) + self.register_instruction( + MinusNodeComp(left_vm_holder, right_vm_holder, temp_expr_vm_holder) + ) + self.register_instruction(IfZeroJump(temp_expr_vm_holder, true_)) + self.register_instruction(UnconditionalJump(false_)) + + self.register_instruction(LabelNode(compare_string)) + self.register_instruction( + CompareStringLengthNode( + temp_expr_vm_holder, left_vm_holder, right_vm_holder + ) + ) + # Compare devuelve 0 para true y 1 para true + self.register_instruction(IfZeroJump(temp_expr_vm_holder, continue_)) + self.register_instruction(UnconditionalJump(false_)) + + # Los lengths son iguales, seguir comparando + self.register_instruction(LabelNode(continue_)) + self.register_instruction( + CharToCharStringCompare( + temp_expr_vm_holder, + left_vm_holder, + right_vm_holder, + while_label, + end_while_label, + ) + ) + self.register_instruction(IfZeroJump(temp_expr_vm_holder, true_)) + + self.register_instruction(LabelNode(false_)) + self.register_instruction(AllocateBoolNode(expr_result_vm_holder, 0)) + self.register_instruction(UnconditionalJump(end)) + + self.register_instruction(LabelNode(true_)) + self.register_instruction(AllocateBoolNode(expr_result_vm_holder, 1)) + self.register_instruction(LabelNode(end)) # Devolver la variable con el resultado return expr_result_vm_holder @@ -688,7 +797,7 @@ def _(self, node: coolAst.LowerThanNode, scope: Scope) -> LocalNode: right_vm_holder = self.visit(node.right, scope) self.register_instruction( - MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder) + MinusNodeComp(left_vm_holder, right_vm_holder, expr_result_vm_holder) ) self.register_instruction( @@ -696,11 +805,11 @@ def _(self, node: coolAst.LowerThanNode, scope: Scope) -> LocalNode: ) self.register_instruction(IfZeroJump(expr_result_vm_holder, false_label)) - self.register_instruction(AssignNode(expr_result_vm_holder, 1)) + self.register_instruction(AllocateBoolNode(expr_result_vm_holder, 1)) self.register_instruction(UnconditionalJump(end_label)) self.register_instruction(LabelNode(false_label)) - self.register_instruction(AssignNode(expr_result_vm_holder, 0)) + self.register_instruction(AllocateBoolNode(expr_result_vm_holder, 0)) self.register_instruction(LabelNode(end_label)) return expr_result_vm_holder @@ -717,23 +826,19 @@ def _(self, node: coolAst.LowerEqual, scope: Scope) -> LocalNode: # Obtener el valor de la expresion derecha right_vm_holder = self.visit(node.right, scope) - assert isinstance(left_vm_holder, LocalNode) and isinstance( - right_vm_holder, LocalNode - ) - self.register_instruction( - MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder) + MinusNodeComp(left_vm_holder, right_vm_holder, expr_result_vm_holder) ) self.register_instruction( JumpIfGreaterThanZeroNode(expr_result_vm_holder, false_label) ) - self.register_instruction(AssignNode(expr_result_vm_holder, 1)) + self.register_instruction(AllocateBoolNode(expr_result_vm_holder, 1)) self.register_instruction(UnconditionalJump(end_label)) self.register_instruction(LabelNode(false_label)) - self.register_instruction(AssignNode(expr_result_vm_holder, 0)) + self.register_instruction(AllocateBoolNode(expr_result_vm_holder, 0)) self.register_instruction(LabelNode(end_label)) return expr_result_vm_holder @@ -755,7 +860,7 @@ def _(self, node: coolAst.GreaterThanNode, scope: Scope) -> LocalNode: ) self.register_instruction( - MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder) + MinusNodeComp(left_vm_holder, right_vm_holder, expr_result_vm_holder) ) self.register_instruction( @@ -763,12 +868,12 @@ def _(self, node: coolAst.GreaterThanNode, scope: Scope) -> LocalNode: ) # False Branch - self.register_instruction(AssignNode(expr_result_vm_holder, 0)) + self.register_instruction(AllocateBoolNode(expr_result_vm_holder, 0)) self.register_instruction(UnconditionalJump(end_label)) # True Branch self.register_instruction(LabelNode(true_label)) - self.register_instruction(AssignNode(expr_result_vm_holder, 1)) + self.register_instruction(AllocateBoolNode(expr_result_vm_holder, 1)) self.register_instruction(LabelNode(end_label)) return expr_result_vm_holder @@ -790,7 +895,7 @@ def _(self, node: coolAst.GreaterEqualNode, scope: Scope) -> LocalNode: ) self.register_instruction( - MinusNode(left_vm_holder, right_vm_holder, expr_result_vm_holder) + MinusNodeComp(left_vm_holder, right_vm_holder, expr_result_vm_holder) ) self.register_instruction( @@ -799,12 +904,12 @@ def _(self, node: coolAst.GreaterEqualNode, scope: Scope) -> LocalNode: self.register_instruction(IfZeroJump(expr_result_vm_holder, true_label)) # False Branch - self.register_instruction(AssignNode(expr_result_vm_holder, 1)) + self.register_instruction(AllocateBoolNode(expr_result_vm_holder, 0)) self.register_instruction(UnconditionalJump(end_label)) # True Branch self.register_instruction(LabelNode(true_label)) - self.register_instruction(AssignNode(expr_result_vm_holder, 1)) + self.register_instruction(AllocateBoolNode(expr_result_vm_holder, 1)) self.register_instruction(LabelNode(end_label)) return expr_result_vm_holder @@ -887,6 +992,7 @@ def _(self, node: NotNode, scope: Scope): expr = self.define_internal_local() result = self.visit(node.lex, scope) self.register_instruction(BitwiseNotNode(result, expr)) + self.register_instruction(AllocateIntNode(expr, expr)) return expr diff --git a/src/travels/inference.py b/src/travels/inference.py index 39852396..75ca85c1 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -544,9 +544,6 @@ def _( if ret_type in ( self.AUTO_TYPE, void, - self.STRING, - self.INTEGER, - self.BOOL, ): self.errors.append(f"Cannot instantiate {ret_type.name}") return ret_type diff --git a/src/travels/typecollector.py b/src/travels/typecollector.py index b348d62c..7e766838 100755 --- a/src/travels/typecollector.py +++ b/src/travels/typecollector.py @@ -19,12 +19,12 @@ BUILTINS = ("Int", "Bool", "Object", "String", "IO", "AUTO_TYPE") -def bootstrap_string(obj: StringType): +def bootstrap_string(obj: StringType, intType: IntegerType): def length() -> Method: method_name = "length" param_names = [] params_types = [] - return_type = IntegerType() + return_type = intType return Method(method_name, param_names, params_types, return_type) @@ -49,7 +49,7 @@ def substr() -> Method: obj.methods["substr"] = substr() -def bootstrap_io(io: IoType, strType: StringType, selfType: SelfType): +def bootstrap_io(io: IoType, strType: StringType, selfType: SelfType, intType: IntegerType): def out_string() -> Method: method_name = "out_string" param_names = ["x"] @@ -78,7 +78,7 @@ def in_int() -> Method: method_name = "in_int" param_names = [] params_types = [] - return_type = IntegerType() + return_type = intType return Method(method_name, param_names, params_types, return_type) @@ -141,16 +141,16 @@ def _(self, node: coolAst.ProgramNode): # noqa: F811 ) ioType = IoType() - # Agregar los metodos builtin - bootstrap_string(STRING) - bootstrap_io(ioType, STRING, SELF_TYPE) - bootstrap_object(OBJECT, STRING) - INTEGER.set_parent(OBJECT) STRING.set_parent(OBJECT) BOOL.set_parent(OBJECT) ioType.set_parent(OBJECT) + # Agregar los metodos builtin + bootstrap_string(STRING, INTEGER) + bootstrap_io(ioType, STRING, SELF_TYPE, INTEGER) + bootstrap_object(OBJECT, STRING) + # Agregar al objeto IO los metodos de OBJECT ioType.methods.update(OBJECT.methods) diff --git a/tests/codegen/arith.mips b/tests/codegen/arith.mips new file mode 100644 index 00000000..991ef1f8 --- /dev/null +++ b/tests/codegen/arith.mips @@ -0,0 +1,22317 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:21 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +A2I: .asciiz "A2I" +# Function END +A: .asciiz "A" +# Function END +B: .asciiz "B" +# Function END +D: .asciiz "D" +# Function END +E: .asciiz "E" +# Function END +C: .asciiz "C" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type A2I **** +A2I_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_c2i_at_A2I, function_i2c_at_A2I, function_a2i_at_A2I, function_a2i_aux_at_A2I, function_i2a_at_A2I, function_i2a_aux_at_A2I +# Function END +# + + +# **** Type RECORD for type A2I **** +A2I_start: + A2I_vtable_pointer: .word A2I_vtable + # Function END +A2I_end: +# + + +# **** VTABLE for type A **** +A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_value_at_A, function_set_var_at_A, function_method1_at_A, function_method2_at_A, function_method3_at_A, function_method4_at_A, function_method5_at_A +# Function END +# + + +# **** Type RECORD for type A **** +A_start: + A_vtable_pointer: .word A_vtable + # Function END +A_end: +# + + +# **** VTABLE for type B **** +B_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_value_at_A, function_set_var_at_A, function_method1_at_A, function_method2_at_A, function_method3_at_A, function_method4_at_A, function_method5_at_B +# Function END +# + + +# **** Type RECORD for type B **** +B_start: + B_vtable_pointer: .word B_vtable + # Function END +B_end: +# + + +# **** VTABLE for type D **** +D_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_value_at_A, function_set_var_at_A, function_method1_at_A, function_method2_at_A, function_method3_at_A, function_method4_at_A, function_method5_at_B, function_method7_at_D +# Function END +# + + +# **** Type RECORD for type D **** +D_start: + D_vtable_pointer: .word D_vtable + # Function END +D_end: +# + + +# **** VTABLE for type E **** +E_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_value_at_A, function_set_var_at_A, function_method1_at_A, function_method2_at_A, function_method3_at_A, function_method4_at_A, function_method5_at_B, function_method7_at_D, function_method6_at_E +# Function END +# + + +# **** Type RECORD for type E **** +E_start: + E_vtable_pointer: .word E_vtable + # Function END +E_end: +# + + +# **** VTABLE for type C **** +C_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_value_at_A, function_set_var_at_A, function_method1_at_A, function_method2_at_A, function_method3_at_A, function_method4_at_A, function_method5_at_C, function_method6_at_C +# Function END +# + + +# **** Type RECORD for type C **** +C_start: + C_vtable_pointer: .word C_vtable + # Function END +C_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_menu_at_Main, function_prompt_at_Main, function_get_int_at_Main, function_is_even_at_Main, function_class_type_at_Main, function_print_at_Main, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 1, 1, 2, 3, 4, 3, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1 +A2I__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 +A__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 2, -1 +B__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 1, -1 +D__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1 +E__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 +C__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "0" +# + + +data_5: .asciiz "1" +# + + +data_6: .asciiz "2" +# + + +data_7: .asciiz "3" +# + + +data_8: .asciiz "4" +# + + +data_9: .asciiz "5" +# + + +data_10: .asciiz "6" +# + + +data_11: .asciiz "7" +# + + +data_12: .asciiz "8" +# + + +data_13: .asciiz "9" +# + + +data_14: .asciiz "0" +# + + +data_15: .asciiz "1" +# + + +data_16: .asciiz "2" +# + + +data_17: .asciiz "3" +# + + +data_18: .asciiz "4" +# + + +data_19: .asciiz "5" +# + + +data_20: .asciiz "6" +# + + +data_21: .asciiz "7" +# + + +data_22: .asciiz "8" +# + + +data_23: .asciiz "9" +# + + +data_24: .asciiz "" +# + + +data_25: .asciiz "-" +# + + +data_26: .asciiz "+" +# + + +data_27: .asciiz "0" +# + + +data_28: .asciiz "-" +# + + +data_29: .asciiz "" +# + + +data_30: .asciiz "\n\tTo add a number to " +# + + +data_31: .asciiz "...enter a:\n" +# + + +data_32: .asciiz "\tTo negate " +# + + +data_33: .asciiz "...enter b:\n" +# + + +data_34: .asciiz "\tTo find the difference between " +# + + +data_35: .asciiz "and another number...enter c:\n" +# + + +data_36: .asciiz "\tTo find the factorial of " +# + + +data_37: .asciiz "...enter d:\n" +# + + +data_38: .asciiz "\tTo square " +# + + +data_39: .asciiz "...enter e:\n" +# + + +data_40: .asciiz "\tTo cube " +# + + +data_41: .asciiz "...enter f:\n" +# + + +data_42: .asciiz "\tTo find out if " +# + + +data_43: .asciiz "is a multiple of 3...enter g:\n" +# + + +data_44: .asciiz "\tTo divide " +# + + +data_45: .asciiz "by 8...enter h:\n" +# + + +data_46: .asciiz "\tTo get a new number...enter j:\n" +# + + +data_47: .asciiz "\tTo quit...enter q:\n\n" +# + + +data_48: .asciiz "\n" +# + + +data_49: .asciiz "Please enter a number... " +# + + +data_50: .asciiz "Class type is now A\n" +# + + +data_51: .asciiz "Class type is now B\n" +# + + +data_52: .asciiz "Class type is now C\n" +# + + +data_53: .asciiz "Class type is now D\n" +# + + +data_54: .asciiz "Class type is now E\n" +# + + +data_55: .asciiz "Oooops\n" +# + + +data_56: .asciiz " " +# + + +data_57: .asciiz "number " +# + + +data_58: .asciiz "is even!\n" +# + + +data_59: .asciiz "is odd!\n" +# + + +data_60: .asciiz "a" +# + + +data_61: .asciiz "b" +# + + +data_62: .asciiz "Oooops\n" +# + + +data_63: .asciiz "c" +# + + +data_64: .asciiz "d" +# + + +data_65: .asciiz "e" +# + + +data_66: .asciiz "f" +# + + +data_67: .asciiz "g" +# + + +data_68: .asciiz "number " +# + + +data_69: .asciiz "is divisible by 3.\n" +# + + +data_70: .asciiz "number " +# + + +data_71: .asciiz "is not divisible by 3.\n" +# + + +data_72: .asciiz "h" +# + + +data_73: .asciiz "number " +# + + +data_74: .asciiz "is equal to " +# + + +data_75: .asciiz "times 8 with a remainder of " +# + + +data_76: .asciiz "\n" +# + + +data_77: .asciiz "j" +# + + +data_78: .asciiz "q" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 28 bytes of memory + li $a0, 28 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 44 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__char__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__avar__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__a_var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__flag__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 52($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_c2i_at_A2I implementation. +# @Params: +# 0($fp) = param_c2i_at_A2I_char_0 +function_c2i_at_A2I: + # Allocate stack frame for function function_c2i_at_A2I. + subu $sp, $sp, 264 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 264 + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -20($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_3 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_3 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_3 + # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_3 + # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_3 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_3 + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_6 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_6 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_6 + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_7 + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_7 + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_4 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_COMPARE_BY_VALUE_7: + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_4 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_COMPARE_STRING_6: + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_CONTINUE_8 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_CONTINUE_8 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_8 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_CONTINUE_8: + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_9: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_10 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_9 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_10: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_4 + label_FALSE_3: + # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_5 +j label_END_5 +label_TRUE_4: + # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_5: +# LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) +# LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSEIF_1 +# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSEIF_1 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_1 +# LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -24($fp) +# LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) +# LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) +# local_c2i_at_A2I_internal_1 = local_c2i_at_A2I_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -44($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_13 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_13 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_13 + # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_13 + # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_13 + lw $t0, -44($fp) + beq $t0, 0, label_FALSE_13 + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_STRING_16 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_STRING_16 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_16 + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_17 + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_17 + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -44($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_14 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_COMPARE_BY_VALUE_17: + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + lw $a0, 0($fp) + lw $a1, -44($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_14 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_COMPARE_STRING_16: + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_CONTINUE_18 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_CONTINUE_18 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_18 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_CONTINUE_18: + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_19: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_20 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_19 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_20: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_14 + label_FALSE_13: + # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_15 +j label_END_15 +label_TRUE_14: + # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_15: +# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) +# LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSEIF_11 +# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSEIF_11 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_11 +# LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -48($fp) +# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) +# LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) +# local_c2i_at_A2I_internal_7 = local_c2i_at_A2I_internal_11 +lw $t0, -48($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_12 +j label_ENDIF_12 +label_FALSEIF_11: + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_6 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -68($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_23 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_23 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_23 + # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_23 + # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_23 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_23 + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_STRING_26 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_STRING_26 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_STRING_26 + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_27 + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_27 + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_24 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_COMPARE_BY_VALUE_27: + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + lw $a0, 0($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_24 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_COMPARE_STRING_26: + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_CONTINUE_28 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_CONTINUE_28 + lw $t0, -64($fp) + beq $t0, 0, label_CONTINUE_28 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_CONTINUE_28: + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_29: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_30 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_29 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_30: + # Store result + sw $a2, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_24 + label_FALSE_23: + # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # GOTO label_END_25 +j label_END_25 +label_TRUE_24: + # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + label_END_25: +# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) +# LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) +# Obtain value from -60($fp) +lw $v0, -60($fp) +lw $v0, 12($v0) +sw $v0, -52($fp) +# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSEIF_21 +# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSEIF_21 +lw $t0, -52($fp) +beq $t0, 0, label_FALSEIF_21 +# LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 2 +sw $t0, 12($v0) +sw $v0, -72($fp) +# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) +# LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) +# local_c2i_at_A2I_internal_13 = local_c2i_at_A2I_internal_17 +lw $t0, -72($fp) +sw $t0, -56($fp) +# GOTO label_ENDIF_22 +j label_ENDIF_22 +label_FALSEIF_21: + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_7 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -92($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_33 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_33 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_33 + # IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_FALSE_33 + # IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_FALSE_33 + lw $t0, -92($fp) + beq $t0, 0, label_FALSE_33 + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_STRING_36 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_STRING_36 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_STRING_36 + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_37 + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_37 + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -92($fp) + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_34 + # GOTO label_FALSE_33 + j label_FALSE_33 + label_COMPARE_BY_VALUE_37: + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + lw $a0, 0($fp) + lw $a1, -92($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_34 + # GOTO label_FALSE_33 + j label_FALSE_33 + label_COMPARE_STRING_36: + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_CONTINUE_38 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_CONTINUE_38 + lw $t0, -88($fp) + beq $t0, 0, label_CONTINUE_38 + # GOTO label_FALSE_33 + j label_FALSE_33 + label_CONTINUE_38: + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_39: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_40 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_39 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_40: + # Store result + sw $a2, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_34 + label_FALSE_33: + # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -84($fp) + # GOTO label_END_35 +j label_END_35 +label_TRUE_34: + # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -84($fp) + label_END_35: +# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) +# LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) +# Obtain value from -84($fp) +lw $v0, -84($fp) +lw $v0, 12($v0) +sw $v0, -76($fp) +# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSEIF_31 +# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSEIF_31 +lw $t0, -76($fp) +beq $t0, 0, label_FALSEIF_31 +# LOCAL local_c2i_at_A2I_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 3 +sw $t0, 12($v0) +sw $v0, -96($fp) +# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) +# LOCAL local_c2i_at_A2I_internal_23 --> -96($fp) +# local_c2i_at_A2I_internal_19 = local_c2i_at_A2I_internal_23 +lw $t0, -96($fp) +sw $t0, -80($fp) +# GOTO label_ENDIF_32 +j label_ENDIF_32 +label_FALSEIF_31: + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_8 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -116($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_43 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_43 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_43 + # IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_FALSE_43 + # IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_FALSE_43 + lw $t0, -116($fp) + beq $t0, 0, label_FALSE_43 + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_STRING_46 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_STRING_46 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_STRING_46 + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_47 + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_47 + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -116($fp) + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_44 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_COMPARE_BY_VALUE_47: + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + lw $a0, 0($fp) + lw $a1, -116($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_44 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_COMPARE_STRING_46: + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_CONTINUE_48 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_CONTINUE_48 + lw $t0, -112($fp) + beq $t0, 0, label_CONTINUE_48 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_CONTINUE_48: + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_49: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_50 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_49 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_50: + # Store result + sw $a2, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_44 + label_FALSE_43: + # LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -108($fp) + # GOTO label_END_45 +j label_END_45 +label_TRUE_44: + # LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -108($fp) + label_END_45: +# LOCAL local_c2i_at_A2I_internal_24 --> -100($fp) +# LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) +# Obtain value from -108($fp) +lw $v0, -108($fp) +lw $v0, 12($v0) +sw $v0, -100($fp) +# IF_ZERO local_c2i_at_A2I_internal_24 GOTO label_FALSEIF_41 +# IF_ZERO local_c2i_at_A2I_internal_24 GOTO label_FALSEIF_41 +lw $t0, -100($fp) +beq $t0, 0, label_FALSEIF_41 +# LOCAL local_c2i_at_A2I_internal_29 --> -120($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 4 +sw $t0, 12($v0) +sw $v0, -120($fp) +# LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) +# LOCAL local_c2i_at_A2I_internal_29 --> -120($fp) +# local_c2i_at_A2I_internal_25 = local_c2i_at_A2I_internal_29 +lw $t0, -120($fp) +sw $t0, -104($fp) +# GOTO label_ENDIF_42 +j label_ENDIF_42 +label_FALSEIF_41: + # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_9 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -140($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_53 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_53 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_53 + # IF_ZERO local_c2i_at_A2I_internal_34 GOTO label_FALSE_53 + # IF_ZERO local_c2i_at_A2I_internal_34 GOTO label_FALSE_53 + lw $t0, -140($fp) + beq $t0, 0, label_FALSE_53 + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_STRING_56 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_STRING_56 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_STRING_56 + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_57 + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_57 + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -140($fp) + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_54 + # GOTO label_FALSE_53 + j label_FALSE_53 + label_COMPARE_BY_VALUE_57: + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) + lw $a0, 0($fp) + lw $a1, -140($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_54 + # GOTO label_FALSE_53 + j label_FALSE_53 + label_COMPARE_STRING_56: + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_CONTINUE_58 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_CONTINUE_58 + lw $t0, -136($fp) + beq $t0, 0, label_CONTINUE_58 + # GOTO label_FALSE_53 + j label_FALSE_53 + label_CONTINUE_58: + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_59: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_60 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_59 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_60: + # Store result + sw $a2, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_54 + label_FALSE_53: + # LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -132($fp) + # GOTO label_END_55 +j label_END_55 +label_TRUE_54: + # LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -132($fp) + label_END_55: +# LOCAL local_c2i_at_A2I_internal_30 --> -124($fp) +# LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) +# Obtain value from -132($fp) +lw $v0, -132($fp) +lw $v0, 12($v0) +sw $v0, -124($fp) +# IF_ZERO local_c2i_at_A2I_internal_30 GOTO label_FALSEIF_51 +# IF_ZERO local_c2i_at_A2I_internal_30 GOTO label_FALSEIF_51 +lw $t0, -124($fp) +beq $t0, 0, label_FALSEIF_51 +# LOCAL local_c2i_at_A2I_internal_35 --> -144($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 5 +sw $t0, 12($v0) +sw $v0, -144($fp) +# LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) +# LOCAL local_c2i_at_A2I_internal_35 --> -144($fp) +# local_c2i_at_A2I_internal_31 = local_c2i_at_A2I_internal_35 +lw $t0, -144($fp) +sw $t0, -128($fp) +# GOTO label_ENDIF_52 +j label_ENDIF_52 +label_FALSEIF_51: + # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_10 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -164($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_63 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_63 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_63 + # IF_ZERO local_c2i_at_A2I_internal_40 GOTO label_FALSE_63 + # IF_ZERO local_c2i_at_A2I_internal_40 GOTO label_FALSE_63 + lw $t0, -164($fp) + beq $t0, 0, label_FALSE_63 + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_STRING_66 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_STRING_66 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_STRING_66 + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_67 + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_67 + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -164($fp) + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_64 + # GOTO label_FALSE_63 + j label_FALSE_63 + label_COMPARE_BY_VALUE_67: + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) + lw $a0, 0($fp) + lw $a1, -164($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_64 + # GOTO label_FALSE_63 + j label_FALSE_63 + label_COMPARE_STRING_66: + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_CONTINUE_68 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_CONTINUE_68 + lw $t0, -160($fp) + beq $t0, 0, label_CONTINUE_68 + # GOTO label_FALSE_63 + j label_FALSE_63 + label_CONTINUE_68: + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_69: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_70 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_69 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_70: + # Store result + sw $a2, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_64 + label_FALSE_63: + # LOCAL local_c2i_at_A2I_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -156($fp) + # GOTO label_END_65 +j label_END_65 +label_TRUE_64: + # LOCAL local_c2i_at_A2I_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -156($fp) + label_END_65: +# LOCAL local_c2i_at_A2I_internal_36 --> -148($fp) +# LOCAL local_c2i_at_A2I_internal_38 --> -156($fp) +# Obtain value from -156($fp) +lw $v0, -156($fp) +lw $v0, 12($v0) +sw $v0, -148($fp) +# IF_ZERO local_c2i_at_A2I_internal_36 GOTO label_FALSEIF_61 +# IF_ZERO local_c2i_at_A2I_internal_36 GOTO label_FALSEIF_61 +lw $t0, -148($fp) +beq $t0, 0, label_FALSEIF_61 +# LOCAL local_c2i_at_A2I_internal_41 --> -168($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 6 +sw $t0, 12($v0) +sw $v0, -168($fp) +# LOCAL local_c2i_at_A2I_internal_37 --> -152($fp) +# LOCAL local_c2i_at_A2I_internal_41 --> -168($fp) +# local_c2i_at_A2I_internal_37 = local_c2i_at_A2I_internal_41 +lw $t0, -168($fp) +sw $t0, -152($fp) +# GOTO label_ENDIF_62 +j label_ENDIF_62 +label_FALSEIF_61: + # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_11 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -188($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_73 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_73 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_73 + # IF_ZERO local_c2i_at_A2I_internal_46 GOTO label_FALSE_73 + # IF_ZERO local_c2i_at_A2I_internal_46 GOTO label_FALSE_73 + lw $t0, -188($fp) + beq $t0, 0, label_FALSE_73 + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_STRING_76 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_STRING_76 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_STRING_76 + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_77 + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_77 + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -188($fp) + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_74 + # GOTO label_FALSE_73 + j label_FALSE_73 + label_COMPARE_BY_VALUE_77: + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) + lw $a0, 0($fp) + lw $a1, -188($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_74 + # GOTO label_FALSE_73 + j label_FALSE_73 + label_COMPARE_STRING_76: + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_CONTINUE_78 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_CONTINUE_78 + lw $t0, -184($fp) + beq $t0, 0, label_CONTINUE_78 + # GOTO label_FALSE_73 + j label_FALSE_73 + label_CONTINUE_78: + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_79: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_80 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_79 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_80: + # Store result + sw $a2, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_74 + label_FALSE_73: + # LOCAL local_c2i_at_A2I_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -180($fp) + # GOTO label_END_75 +j label_END_75 +label_TRUE_74: + # LOCAL local_c2i_at_A2I_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -180($fp) + label_END_75: +# LOCAL local_c2i_at_A2I_internal_42 --> -172($fp) +# LOCAL local_c2i_at_A2I_internal_44 --> -180($fp) +# Obtain value from -180($fp) +lw $v0, -180($fp) +lw $v0, 12($v0) +sw $v0, -172($fp) +# IF_ZERO local_c2i_at_A2I_internal_42 GOTO label_FALSEIF_71 +# IF_ZERO local_c2i_at_A2I_internal_42 GOTO label_FALSEIF_71 +lw $t0, -172($fp) +beq $t0, 0, label_FALSEIF_71 +# LOCAL local_c2i_at_A2I_internal_47 --> -192($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 7 +sw $t0, 12($v0) +sw $v0, -192($fp) +# LOCAL local_c2i_at_A2I_internal_43 --> -176($fp) +# LOCAL local_c2i_at_A2I_internal_47 --> -192($fp) +# local_c2i_at_A2I_internal_43 = local_c2i_at_A2I_internal_47 +lw $t0, -192($fp) +sw $t0, -176($fp) +# GOTO label_ENDIF_72 +j label_ENDIF_72 +label_FALSEIF_71: + # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_12 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -212($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_83 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_83 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_83 + # IF_ZERO local_c2i_at_A2I_internal_52 GOTO label_FALSE_83 + # IF_ZERO local_c2i_at_A2I_internal_52 GOTO label_FALSE_83 + lw $t0, -212($fp) + beq $t0, 0, label_FALSE_83 + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_STRING_86 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_STRING_86 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_STRING_86 + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_87 + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_87 + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -212($fp) + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_84 + # GOTO label_FALSE_83 + j label_FALSE_83 + label_COMPARE_BY_VALUE_87: + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) + lw $a0, 0($fp) + lw $a1, -212($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_84 + # GOTO label_FALSE_83 + j label_FALSE_83 + label_COMPARE_STRING_86: + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_CONTINUE_88 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_CONTINUE_88 + lw $t0, -208($fp) + beq $t0, 0, label_CONTINUE_88 + # GOTO label_FALSE_83 + j label_FALSE_83 + label_CONTINUE_88: + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_89: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_90 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_89 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_90: + # Store result + sw $a2, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_84 + label_FALSE_83: + # LOCAL local_c2i_at_A2I_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -204($fp) + # GOTO label_END_85 +j label_END_85 +label_TRUE_84: + # LOCAL local_c2i_at_A2I_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -204($fp) + label_END_85: +# LOCAL local_c2i_at_A2I_internal_48 --> -196($fp) +# LOCAL local_c2i_at_A2I_internal_50 --> -204($fp) +# Obtain value from -204($fp) +lw $v0, -204($fp) +lw $v0, 12($v0) +sw $v0, -196($fp) +# IF_ZERO local_c2i_at_A2I_internal_48 GOTO label_FALSEIF_81 +# IF_ZERO local_c2i_at_A2I_internal_48 GOTO label_FALSEIF_81 +lw $t0, -196($fp) +beq $t0, 0, label_FALSEIF_81 +# LOCAL local_c2i_at_A2I_internal_53 --> -216($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 8 +sw $t0, 12($v0) +sw $v0, -216($fp) +# LOCAL local_c2i_at_A2I_internal_49 --> -200($fp) +# LOCAL local_c2i_at_A2I_internal_53 --> -216($fp) +# local_c2i_at_A2I_internal_49 = local_c2i_at_A2I_internal_53 +lw $t0, -216($fp) +sw $t0, -200($fp) +# GOTO label_ENDIF_82 +j label_ENDIF_82 +label_FALSEIF_81: + # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_13 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -236($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_93 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_93 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_93 + # IF_ZERO local_c2i_at_A2I_internal_58 GOTO label_FALSE_93 + # IF_ZERO local_c2i_at_A2I_internal_58 GOTO label_FALSE_93 + lw $t0, -236($fp) + beq $t0, 0, label_FALSE_93 + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_STRING_96 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_STRING_96 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_STRING_96 + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_97 + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_97 + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -236($fp) + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_94 + # GOTO label_FALSE_93 + j label_FALSE_93 + label_COMPARE_BY_VALUE_97: + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) + lw $a0, 0($fp) + lw $a1, -236($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_94 + # GOTO label_FALSE_93 + j label_FALSE_93 + label_COMPARE_STRING_96: + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_CONTINUE_98 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_CONTINUE_98 + lw $t0, -232($fp) + beq $t0, 0, label_CONTINUE_98 + # GOTO label_FALSE_93 + j label_FALSE_93 + label_CONTINUE_98: + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_99: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_100 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_99 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_100: + # Store result + sw $a2, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_94 + label_FALSE_93: + # LOCAL local_c2i_at_A2I_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -228($fp) + # GOTO label_END_95 +j label_END_95 +label_TRUE_94: + # LOCAL local_c2i_at_A2I_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -228($fp) + label_END_95: +# LOCAL local_c2i_at_A2I_internal_54 --> -220($fp) +# LOCAL local_c2i_at_A2I_internal_56 --> -228($fp) +# Obtain value from -228($fp) +lw $v0, -228($fp) +lw $v0, 12($v0) +sw $v0, -220($fp) +# IF_ZERO local_c2i_at_A2I_internal_54 GOTO label_FALSEIF_91 +# IF_ZERO local_c2i_at_A2I_internal_54 GOTO label_FALSEIF_91 +lw $t0, -220($fp) +beq $t0, 0, label_FALSEIF_91 +# LOCAL local_c2i_at_A2I_internal_59 --> -240($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 9 +sw $t0, 12($v0) +sw $v0, -240($fp) +# LOCAL local_c2i_at_A2I_internal_55 --> -224($fp) +# LOCAL local_c2i_at_A2I_internal_59 --> -240($fp) +# local_c2i_at_A2I_internal_55 = local_c2i_at_A2I_internal_59 +lw $t0, -240($fp) +sw $t0, -224($fp) +# GOTO label_ENDIF_92 +j label_ENDIF_92 +label_FALSEIF_91: + # LOCAL local_c2i_at_A2I_internal_62 --> -252($fp) + # local_c2i_at_A2I_internal_62 = SELF + sw $s1, -252($fp) + # LOCAL local_c2i_at_A2I_internal_60 --> -244($fp) + # LOCAL local_c2i_at_A2I_internal_62 --> -252($fp) + # local_c2i_at_A2I_internal_60 = local_c2i_at_A2I_internal_62 + lw $t0, -252($fp) + sw $t0, -244($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_c2i_at_A2I_internal_60 --> -244($fp) + # LOCAL local_c2i_at_A2I_internal_61 --> -248($fp) + # local_c2i_at_A2I_internal_61 = VCALL local_c2i_at_A2I_internal_60 abort + # Save new self pointer in $s1 + lw $s1, -244($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -248($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_c2i_at_A2I_internal_63 --> -256($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -256($fp) + # LOCAL local_c2i_at_A2I_internal_55 --> -224($fp) + # LOCAL local_c2i_at_A2I_internal_63 --> -256($fp) + # local_c2i_at_A2I_internal_55 = local_c2i_at_A2I_internal_63 + lw $t0, -256($fp) + sw $t0, -224($fp) + label_ENDIF_92: +# LOCAL local_c2i_at_A2I_internal_49 --> -200($fp) +# LOCAL local_c2i_at_A2I_internal_55 --> -224($fp) +# local_c2i_at_A2I_internal_49 = local_c2i_at_A2I_internal_55 +lw $t0, -224($fp) +sw $t0, -200($fp) +label_ENDIF_82: +# LOCAL local_c2i_at_A2I_internal_43 --> -176($fp) +# LOCAL local_c2i_at_A2I_internal_49 --> -200($fp) +# local_c2i_at_A2I_internal_43 = local_c2i_at_A2I_internal_49 +lw $t0, -200($fp) +sw $t0, -176($fp) +label_ENDIF_72: +# LOCAL local_c2i_at_A2I_internal_37 --> -152($fp) +# LOCAL local_c2i_at_A2I_internal_43 --> -176($fp) +# local_c2i_at_A2I_internal_37 = local_c2i_at_A2I_internal_43 +lw $t0, -176($fp) +sw $t0, -152($fp) +label_ENDIF_62: +# LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) +# LOCAL local_c2i_at_A2I_internal_37 --> -152($fp) +# local_c2i_at_A2I_internal_31 = local_c2i_at_A2I_internal_37 +lw $t0, -152($fp) +sw $t0, -128($fp) +label_ENDIF_52: +# LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) +# LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) +# local_c2i_at_A2I_internal_25 = local_c2i_at_A2I_internal_31 +lw $t0, -128($fp) +sw $t0, -104($fp) +label_ENDIF_42: +# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) +# LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) +# local_c2i_at_A2I_internal_19 = local_c2i_at_A2I_internal_25 +lw $t0, -104($fp) +sw $t0, -80($fp) +label_ENDIF_32: +# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) +# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) +# local_c2i_at_A2I_internal_13 = local_c2i_at_A2I_internal_19 +lw $t0, -80($fp) +sw $t0, -56($fp) +label_ENDIF_22: +# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) +# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) +# local_c2i_at_A2I_internal_7 = local_c2i_at_A2I_internal_13 +lw $t0, -56($fp) +sw $t0, -32($fp) +label_ENDIF_12: +# LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) +# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) +# local_c2i_at_A2I_internal_1 = local_c2i_at_A2I_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +label_ENDIF_2: +# RETURN local_c2i_at_A2I_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_c2i_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 264 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_i2c_at_A2I implementation. +# @Params: +# 0($fp) = param_i2c_at_A2I_i_0 +function_i2c_at_A2I: + # Allocate stack frame for function function_i2c_at_A2I. + subu $sp, $sp, 264 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 264 + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_103 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_103 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_103 + # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_103 + # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_103 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_103 + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_STRING_106 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_STRING_106 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_106 + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_107 + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_107 + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_104 + # GOTO label_FALSE_103 + j label_FALSE_103 + label_COMPARE_BY_VALUE_107: + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_104 + # GOTO label_FALSE_103 + j label_FALSE_103 + label_COMPARE_STRING_106: + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_CONTINUE_108 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_CONTINUE_108 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_108 + # GOTO label_FALSE_103 + j label_FALSE_103 + label_CONTINUE_108: + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_109: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_110 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_109 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_110: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_104 + label_FALSE_103: + # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_105 +j label_END_105 +label_TRUE_104: + # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_105: +# LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSEIF_101 +# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSEIF_101 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_101 +# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_14 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -24($fp) +# LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) +# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) +# local_i2c_at_A2I_internal_1 = local_i2c_at_A2I_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_102 +j label_ENDIF_102 +label_FALSEIF_101: + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_113 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_113 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_113 + # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_113 + # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_113 + lw $t0, -44($fp) + beq $t0, 0, label_FALSE_113 + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_STRING_116 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_STRING_116 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_116 + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_117 + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_117 + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -44($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_114 + # GOTO label_FALSE_113 + j label_FALSE_113 + label_COMPARE_BY_VALUE_117: + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + lw $a0, 0($fp) + lw $a1, -44($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_114 + # GOTO label_FALSE_113 + j label_FALSE_113 + label_COMPARE_STRING_116: + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_CONTINUE_118 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_CONTINUE_118 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_118 + # GOTO label_FALSE_113 + j label_FALSE_113 + label_CONTINUE_118: + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_119: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_120 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_119 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_120: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_114 + label_FALSE_113: + # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_115 +j label_END_115 +label_TRUE_114: + # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_115: +# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) +# LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSEIF_111 +# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSEIF_111 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_111 +# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_15 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -48($fp) +# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) +# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) +# local_i2c_at_A2I_internal_7 = local_i2c_at_A2I_internal_11 +lw $t0, -48($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_112 +j label_ENDIF_112 +label_FALSEIF_111: + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 2 + sw $t0, 12($v0) + sw $v0, -68($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_123 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_123 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_123 + # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_123 + # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_123 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_123 + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_STRING_126 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_STRING_126 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_STRING_126 + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_127 + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_127 + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_124 + # GOTO label_FALSE_123 + j label_FALSE_123 + label_COMPARE_BY_VALUE_127: + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + lw $a0, 0($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_124 + # GOTO label_FALSE_123 + j label_FALSE_123 + label_COMPARE_STRING_126: + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_CONTINUE_128 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_CONTINUE_128 + lw $t0, -64($fp) + beq $t0, 0, label_CONTINUE_128 + # GOTO label_FALSE_123 + j label_FALSE_123 + label_CONTINUE_128: + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_129: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_130 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_129 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_130: + # Store result + sw $a2, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_124 + label_FALSE_123: + # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # GOTO label_END_125 +j label_END_125 +label_TRUE_124: + # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + label_END_125: +# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) +# LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) +# Obtain value from -60($fp) +lw $v0, -60($fp) +lw $v0, 12($v0) +sw $v0, -52($fp) +# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSEIF_121 +# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSEIF_121 +lw $t0, -52($fp) +beq $t0, 0, label_FALSEIF_121 +# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_16 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -72($fp) +# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) +# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) +# local_i2c_at_A2I_internal_13 = local_i2c_at_A2I_internal_17 +lw $t0, -72($fp) +sw $t0, -56($fp) +# GOTO label_ENDIF_122 +j label_ENDIF_122 +label_FALSEIF_121: + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 3 + sw $t0, 12($v0) + sw $v0, -92($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_133 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_133 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_133 + # IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_FALSE_133 + # IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_FALSE_133 + lw $t0, -92($fp) + beq $t0, 0, label_FALSE_133 + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_STRING_136 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_STRING_136 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_STRING_136 + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_137 + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_137 + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -92($fp) + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_134 + # GOTO label_FALSE_133 + j label_FALSE_133 + label_COMPARE_BY_VALUE_137: + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + lw $a0, 0($fp) + lw $a1, -92($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_134 + # GOTO label_FALSE_133 + j label_FALSE_133 + label_COMPARE_STRING_136: + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_CONTINUE_138 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_CONTINUE_138 + lw $t0, -88($fp) + beq $t0, 0, label_CONTINUE_138 + # GOTO label_FALSE_133 + j label_FALSE_133 + label_CONTINUE_138: + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_139: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_140 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_139 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_140: + # Store result + sw $a2, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_134 + label_FALSE_133: + # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -84($fp) + # GOTO label_END_135 +j label_END_135 +label_TRUE_134: + # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -84($fp) + label_END_135: +# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) +# LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) +# Obtain value from -84($fp) +lw $v0, -84($fp) +lw $v0, 12($v0) +sw $v0, -76($fp) +# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSEIF_131 +# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSEIF_131 +lw $t0, -76($fp) +beq $t0, 0, label_FALSEIF_131 +# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_17 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -96($fp) +# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) +# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) +# local_i2c_at_A2I_internal_19 = local_i2c_at_A2I_internal_23 +lw $t0, -96($fp) +sw $t0, -80($fp) +# GOTO label_ENDIF_132 +j label_ENDIF_132 +label_FALSEIF_131: + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 4 + sw $t0, 12($v0) + sw $v0, -116($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_143 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_143 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_143 + # IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_FALSE_143 + # IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_FALSE_143 + lw $t0, -116($fp) + beq $t0, 0, label_FALSE_143 + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_STRING_146 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_STRING_146 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_STRING_146 + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_147 + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_147 + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -116($fp) + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_144 + # GOTO label_FALSE_143 + j label_FALSE_143 + label_COMPARE_BY_VALUE_147: + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + lw $a0, 0($fp) + lw $a1, -116($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_144 + # GOTO label_FALSE_143 + j label_FALSE_143 + label_COMPARE_STRING_146: + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_CONTINUE_148 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_CONTINUE_148 + lw $t0, -112($fp) + beq $t0, 0, label_CONTINUE_148 + # GOTO label_FALSE_143 + j label_FALSE_143 + label_CONTINUE_148: + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_149: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_150 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_149 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_150: + # Store result + sw $a2, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_144 + label_FALSE_143: + # LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -108($fp) + # GOTO label_END_145 +j label_END_145 +label_TRUE_144: + # LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -108($fp) + label_END_145: +# LOCAL local_i2c_at_A2I_internal_24 --> -100($fp) +# LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) +# Obtain value from -108($fp) +lw $v0, -108($fp) +lw $v0, 12($v0) +sw $v0, -100($fp) +# IF_ZERO local_i2c_at_A2I_internal_24 GOTO label_FALSEIF_141 +# IF_ZERO local_i2c_at_A2I_internal_24 GOTO label_FALSEIF_141 +lw $t0, -100($fp) +beq $t0, 0, label_FALSEIF_141 +# LOCAL local_i2c_at_A2I_internal_29 --> -120($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_18 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -120($fp) +# LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) +# LOCAL local_i2c_at_A2I_internal_29 --> -120($fp) +# local_i2c_at_A2I_internal_25 = local_i2c_at_A2I_internal_29 +lw $t0, -120($fp) +sw $t0, -104($fp) +# GOTO label_ENDIF_142 +j label_ENDIF_142 +label_FALSEIF_141: + # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 5 + sw $t0, 12($v0) + sw $v0, -140($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_153 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_153 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_153 + # IF_ZERO local_i2c_at_A2I_internal_34 GOTO label_FALSE_153 + # IF_ZERO local_i2c_at_A2I_internal_34 GOTO label_FALSE_153 + lw $t0, -140($fp) + beq $t0, 0, label_FALSE_153 + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_STRING_156 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_STRING_156 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_STRING_156 + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_157 + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_157 + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -140($fp) + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_154 + # GOTO label_FALSE_153 + j label_FALSE_153 + label_COMPARE_BY_VALUE_157: + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) + lw $a0, 0($fp) + lw $a1, -140($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_154 + # GOTO label_FALSE_153 + j label_FALSE_153 + label_COMPARE_STRING_156: + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_CONTINUE_158 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_CONTINUE_158 + lw $t0, -136($fp) + beq $t0, 0, label_CONTINUE_158 + # GOTO label_FALSE_153 + j label_FALSE_153 + label_CONTINUE_158: + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_159: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_160 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_159 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_160: + # Store result + sw $a2, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_154 + label_FALSE_153: + # LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -132($fp) + # GOTO label_END_155 +j label_END_155 +label_TRUE_154: + # LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -132($fp) + label_END_155: +# LOCAL local_i2c_at_A2I_internal_30 --> -124($fp) +# LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) +# Obtain value from -132($fp) +lw $v0, -132($fp) +lw $v0, 12($v0) +sw $v0, -124($fp) +# IF_ZERO local_i2c_at_A2I_internal_30 GOTO label_FALSEIF_151 +# IF_ZERO local_i2c_at_A2I_internal_30 GOTO label_FALSEIF_151 +lw $t0, -124($fp) +beq $t0, 0, label_FALSEIF_151 +# LOCAL local_i2c_at_A2I_internal_35 --> -144($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_19 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -144($fp) +# LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) +# LOCAL local_i2c_at_A2I_internal_35 --> -144($fp) +# local_i2c_at_A2I_internal_31 = local_i2c_at_A2I_internal_35 +lw $t0, -144($fp) +sw $t0, -128($fp) +# GOTO label_ENDIF_152 +j label_ENDIF_152 +label_FALSEIF_151: + # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 6 + sw $t0, 12($v0) + sw $v0, -164($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_163 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_163 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_163 + # IF_ZERO local_i2c_at_A2I_internal_40 GOTO label_FALSE_163 + # IF_ZERO local_i2c_at_A2I_internal_40 GOTO label_FALSE_163 + lw $t0, -164($fp) + beq $t0, 0, label_FALSE_163 + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_STRING_166 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_STRING_166 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_STRING_166 + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_167 + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_167 + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -164($fp) + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_164 + # GOTO label_FALSE_163 + j label_FALSE_163 + label_COMPARE_BY_VALUE_167: + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) + lw $a0, 0($fp) + lw $a1, -164($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_164 + # GOTO label_FALSE_163 + j label_FALSE_163 + label_COMPARE_STRING_166: + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_CONTINUE_168 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_CONTINUE_168 + lw $t0, -160($fp) + beq $t0, 0, label_CONTINUE_168 + # GOTO label_FALSE_163 + j label_FALSE_163 + label_CONTINUE_168: + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_169: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_170 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_169 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_170: + # Store result + sw $a2, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_164 + label_FALSE_163: + # LOCAL local_i2c_at_A2I_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -156($fp) + # GOTO label_END_165 +j label_END_165 +label_TRUE_164: + # LOCAL local_i2c_at_A2I_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -156($fp) + label_END_165: +# LOCAL local_i2c_at_A2I_internal_36 --> -148($fp) +# LOCAL local_i2c_at_A2I_internal_38 --> -156($fp) +# Obtain value from -156($fp) +lw $v0, -156($fp) +lw $v0, 12($v0) +sw $v0, -148($fp) +# IF_ZERO local_i2c_at_A2I_internal_36 GOTO label_FALSEIF_161 +# IF_ZERO local_i2c_at_A2I_internal_36 GOTO label_FALSEIF_161 +lw $t0, -148($fp) +beq $t0, 0, label_FALSEIF_161 +# LOCAL local_i2c_at_A2I_internal_41 --> -168($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_20 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -168($fp) +# LOCAL local_i2c_at_A2I_internal_37 --> -152($fp) +# LOCAL local_i2c_at_A2I_internal_41 --> -168($fp) +# local_i2c_at_A2I_internal_37 = local_i2c_at_A2I_internal_41 +lw $t0, -168($fp) +sw $t0, -152($fp) +# GOTO label_ENDIF_162 +j label_ENDIF_162 +label_FALSEIF_161: + # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 7 + sw $t0, 12($v0) + sw $v0, -188($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_173 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_173 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_173 + # IF_ZERO local_i2c_at_A2I_internal_46 GOTO label_FALSE_173 + # IF_ZERO local_i2c_at_A2I_internal_46 GOTO label_FALSE_173 + lw $t0, -188($fp) + beq $t0, 0, label_FALSE_173 + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_STRING_176 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_STRING_176 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_STRING_176 + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_177 + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_177 + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -188($fp) + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_174 + # GOTO label_FALSE_173 + j label_FALSE_173 + label_COMPARE_BY_VALUE_177: + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) + lw $a0, 0($fp) + lw $a1, -188($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_174 + # GOTO label_FALSE_173 + j label_FALSE_173 + label_COMPARE_STRING_176: + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_CONTINUE_178 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_CONTINUE_178 + lw $t0, -184($fp) + beq $t0, 0, label_CONTINUE_178 + # GOTO label_FALSE_173 + j label_FALSE_173 + label_CONTINUE_178: + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_179: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_180 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_179 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_180: + # Store result + sw $a2, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_174 + label_FALSE_173: + # LOCAL local_i2c_at_A2I_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -180($fp) + # GOTO label_END_175 +j label_END_175 +label_TRUE_174: + # LOCAL local_i2c_at_A2I_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -180($fp) + label_END_175: +# LOCAL local_i2c_at_A2I_internal_42 --> -172($fp) +# LOCAL local_i2c_at_A2I_internal_44 --> -180($fp) +# Obtain value from -180($fp) +lw $v0, -180($fp) +lw $v0, 12($v0) +sw $v0, -172($fp) +# IF_ZERO local_i2c_at_A2I_internal_42 GOTO label_FALSEIF_171 +# IF_ZERO local_i2c_at_A2I_internal_42 GOTO label_FALSEIF_171 +lw $t0, -172($fp) +beq $t0, 0, label_FALSEIF_171 +# LOCAL local_i2c_at_A2I_internal_47 --> -192($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_21 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -192($fp) +# LOCAL local_i2c_at_A2I_internal_43 --> -176($fp) +# LOCAL local_i2c_at_A2I_internal_47 --> -192($fp) +# local_i2c_at_A2I_internal_43 = local_i2c_at_A2I_internal_47 +lw $t0, -192($fp) +sw $t0, -176($fp) +# GOTO label_ENDIF_172 +j label_ENDIF_172 +label_FALSEIF_171: + # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 8 + sw $t0, 12($v0) + sw $v0, -212($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_183 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_183 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_183 + # IF_ZERO local_i2c_at_A2I_internal_52 GOTO label_FALSE_183 + # IF_ZERO local_i2c_at_A2I_internal_52 GOTO label_FALSE_183 + lw $t0, -212($fp) + beq $t0, 0, label_FALSE_183 + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_STRING_186 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_STRING_186 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_STRING_186 + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_187 + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_187 + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -212($fp) + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_184 + # GOTO label_FALSE_183 + j label_FALSE_183 + label_COMPARE_BY_VALUE_187: + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) + lw $a0, 0($fp) + lw $a1, -212($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_184 + # GOTO label_FALSE_183 + j label_FALSE_183 + label_COMPARE_STRING_186: + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_CONTINUE_188 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_CONTINUE_188 + lw $t0, -208($fp) + beq $t0, 0, label_CONTINUE_188 + # GOTO label_FALSE_183 + j label_FALSE_183 + label_CONTINUE_188: + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_189: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_190 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_189 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_190: + # Store result + sw $a2, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_184 + label_FALSE_183: + # LOCAL local_i2c_at_A2I_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -204($fp) + # GOTO label_END_185 +j label_END_185 +label_TRUE_184: + # LOCAL local_i2c_at_A2I_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -204($fp) + label_END_185: +# LOCAL local_i2c_at_A2I_internal_48 --> -196($fp) +# LOCAL local_i2c_at_A2I_internal_50 --> -204($fp) +# Obtain value from -204($fp) +lw $v0, -204($fp) +lw $v0, 12($v0) +sw $v0, -196($fp) +# IF_ZERO local_i2c_at_A2I_internal_48 GOTO label_FALSEIF_181 +# IF_ZERO local_i2c_at_A2I_internal_48 GOTO label_FALSEIF_181 +lw $t0, -196($fp) +beq $t0, 0, label_FALSEIF_181 +# LOCAL local_i2c_at_A2I_internal_53 --> -216($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_22 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -216($fp) +# LOCAL local_i2c_at_A2I_internal_49 --> -200($fp) +# LOCAL local_i2c_at_A2I_internal_53 --> -216($fp) +# local_i2c_at_A2I_internal_49 = local_i2c_at_A2I_internal_53 +lw $t0, -216($fp) +sw $t0, -200($fp) +# GOTO label_ENDIF_182 +j label_ENDIF_182 +label_FALSEIF_181: + # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 9 + sw $t0, 12($v0) + sw $v0, -236($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_193 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_193 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_193 + # IF_ZERO local_i2c_at_A2I_internal_58 GOTO label_FALSE_193 + # IF_ZERO local_i2c_at_A2I_internal_58 GOTO label_FALSE_193 + lw $t0, -236($fp) + beq $t0, 0, label_FALSE_193 + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_STRING_196 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_STRING_196 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_STRING_196 + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_197 + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_197 + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -236($fp) + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_194 + # GOTO label_FALSE_193 + j label_FALSE_193 + label_COMPARE_BY_VALUE_197: + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) + lw $a0, 0($fp) + lw $a1, -236($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_194 + # GOTO label_FALSE_193 + j label_FALSE_193 + label_COMPARE_STRING_196: + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_CONTINUE_198 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_CONTINUE_198 + lw $t0, -232($fp) + beq $t0, 0, label_CONTINUE_198 + # GOTO label_FALSE_193 + j label_FALSE_193 + label_CONTINUE_198: + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_199: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_200 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_199 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_200: + # Store result + sw $a2, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_194 + label_FALSE_193: + # LOCAL local_i2c_at_A2I_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -228($fp) + # GOTO label_END_195 +j label_END_195 +label_TRUE_194: + # LOCAL local_i2c_at_A2I_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -228($fp) + label_END_195: +# LOCAL local_i2c_at_A2I_internal_54 --> -220($fp) +# LOCAL local_i2c_at_A2I_internal_56 --> -228($fp) +# Obtain value from -228($fp) +lw $v0, -228($fp) +lw $v0, 12($v0) +sw $v0, -220($fp) +# IF_ZERO local_i2c_at_A2I_internal_54 GOTO label_FALSEIF_191 +# IF_ZERO local_i2c_at_A2I_internal_54 GOTO label_FALSEIF_191 +lw $t0, -220($fp) +beq $t0, 0, label_FALSEIF_191 +# LOCAL local_i2c_at_A2I_internal_59 --> -240($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_23 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -240($fp) +# LOCAL local_i2c_at_A2I_internal_55 --> -224($fp) +# LOCAL local_i2c_at_A2I_internal_59 --> -240($fp) +# local_i2c_at_A2I_internal_55 = local_i2c_at_A2I_internal_59 +lw $t0, -240($fp) +sw $t0, -224($fp) +# GOTO label_ENDIF_192 +j label_ENDIF_192 +label_FALSEIF_191: + # LOCAL local_i2c_at_A2I_internal_62 --> -252($fp) + # local_i2c_at_A2I_internal_62 = SELF + sw $s1, -252($fp) + # LOCAL local_i2c_at_A2I_internal_60 --> -244($fp) + # LOCAL local_i2c_at_A2I_internal_62 --> -252($fp) + # local_i2c_at_A2I_internal_60 = local_i2c_at_A2I_internal_62 + lw $t0, -252($fp) + sw $t0, -244($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2c_at_A2I_internal_60 --> -244($fp) + # LOCAL local_i2c_at_A2I_internal_61 --> -248($fp) + # local_i2c_at_A2I_internal_61 = VCALL local_i2c_at_A2I_internal_60 abort + # Save new self pointer in $s1 + lw $s1, -244($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -248($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2c_at_A2I_internal_63 --> -256($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_24 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -256($fp) + # LOCAL local_i2c_at_A2I_internal_55 --> -224($fp) + # LOCAL local_i2c_at_A2I_internal_63 --> -256($fp) + # local_i2c_at_A2I_internal_55 = local_i2c_at_A2I_internal_63 + lw $t0, -256($fp) + sw $t0, -224($fp) + label_ENDIF_192: +# LOCAL local_i2c_at_A2I_internal_49 --> -200($fp) +# LOCAL local_i2c_at_A2I_internal_55 --> -224($fp) +# local_i2c_at_A2I_internal_49 = local_i2c_at_A2I_internal_55 +lw $t0, -224($fp) +sw $t0, -200($fp) +label_ENDIF_182: +# LOCAL local_i2c_at_A2I_internal_43 --> -176($fp) +# LOCAL local_i2c_at_A2I_internal_49 --> -200($fp) +# local_i2c_at_A2I_internal_43 = local_i2c_at_A2I_internal_49 +lw $t0, -200($fp) +sw $t0, -176($fp) +label_ENDIF_172: +# LOCAL local_i2c_at_A2I_internal_37 --> -152($fp) +# LOCAL local_i2c_at_A2I_internal_43 --> -176($fp) +# local_i2c_at_A2I_internal_37 = local_i2c_at_A2I_internal_43 +lw $t0, -176($fp) +sw $t0, -152($fp) +label_ENDIF_162: +# LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) +# LOCAL local_i2c_at_A2I_internal_37 --> -152($fp) +# local_i2c_at_A2I_internal_31 = local_i2c_at_A2I_internal_37 +lw $t0, -152($fp) +sw $t0, -128($fp) +label_ENDIF_152: +# LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) +# LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) +# local_i2c_at_A2I_internal_25 = local_i2c_at_A2I_internal_31 +lw $t0, -128($fp) +sw $t0, -104($fp) +label_ENDIF_142: +# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) +# LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) +# local_i2c_at_A2I_internal_19 = local_i2c_at_A2I_internal_25 +lw $t0, -104($fp) +sw $t0, -80($fp) +label_ENDIF_132: +# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) +# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) +# local_i2c_at_A2I_internal_13 = local_i2c_at_A2I_internal_19 +lw $t0, -80($fp) +sw $t0, -56($fp) +label_ENDIF_122: +# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) +# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) +# local_i2c_at_A2I_internal_7 = local_i2c_at_A2I_internal_13 +lw $t0, -56($fp) +sw $t0, -32($fp) +label_ENDIF_112: +# LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) +# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) +# local_i2c_at_A2I_internal_1 = local_i2c_at_A2I_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +label_ENDIF_102: +# RETURN local_i2c_at_A2I_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_i2c_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 264 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_at_A2I implementation. +# @Params: +# 0($fp) = param_a2i_at_A2I_s_0 +function_a2i_at_A2I: + # Allocate stack frame for function function_a2i_at_A2I. + subu $sp, $sp, 208 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 208 + # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_4 = PARAM param_a2i_at_A2I_s_0 + lw $t0, 0($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # local_a2i_at_A2I_internal_5 = VCALL local_a2i_at_A2I_internal_4 length + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_FALSE_203 + # IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_FALSE_203 + lw $t0, -24($fp) + beq $t0, 0, label_FALSE_203 + # IF_ZERO local_a2i_at_A2I_internal_6 GOTO label_FALSE_203 + # IF_ZERO local_a2i_at_A2I_internal_6 GOTO label_FALSE_203 + lw $t0, -28($fp) + beq $t0, 0, label_FALSE_203 + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # Comparing -24($fp) type with String + la $v0, String + lw $a0, -24($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_206 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_206 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_206 + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # Comparing -24($fp) type with Bool + la $v0, Bool + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_207 + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # Comparing -24($fp) type with Int + la $v0, Int + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_207 + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + # Load pointers and SUB + lw $a0, -24($fp) + lw $a1, -28($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_204 + # GOTO label_FALSE_203 + j label_FALSE_203 + label_COMPARE_BY_VALUE_207: + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + lw $a0, -24($fp) + lw $a1, -28($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_204 + # GOTO label_FALSE_203 + j label_FALSE_203 + label_COMPARE_STRING_206: + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -28($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_CONTINUE_208 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_CONTINUE_208 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_208 + # GOTO label_FALSE_203 + j label_FALSE_203 + label_CONTINUE_208: + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -28($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_209: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_210 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_209 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_210: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_204 + label_FALSE_203: + # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_205 +j label_END_205 +label_TRUE_204: + # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_205: +# LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) +# LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSEIF_201 +# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSEIF_201 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_201 +# LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -32($fp) +# LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) +# LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) +# local_a2i_at_A2I_internal_1 = local_a2i_at_A2I_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_202 +j label_ENDIF_202 +label_FALSEIF_201: + # LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_12 = PARAM param_a2i_at_A2I_s_0 + lw $t0, 0($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # ARG local_a2i_at_A2I_internal_14 + # LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) + lw $t0, -60($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -64($fp) + # ARG local_a2i_at_A2I_internal_15 + # LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # local_a2i_at_A2I_internal_13 = VCALL local_a2i_at_A2I_internal_12 substr + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_25 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -68($fp) + # IF_ZERO local_a2i_at_A2I_internal_13 GOTO label_FALSE_213 + # IF_ZERO local_a2i_at_A2I_internal_13 GOTO label_FALSE_213 + lw $t0, -56($fp) + beq $t0, 0, label_FALSE_213 + # IF_ZERO local_a2i_at_A2I_internal_16 GOTO label_FALSE_213 + # IF_ZERO local_a2i_at_A2I_internal_16 GOTO label_FALSE_213 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_213 + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # Comparing -56($fp) type with String + la $v0, String + lw $a0, -56($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_STRING_216 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_STRING_216 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_STRING_216 + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # Comparing -56($fp) type with Bool + la $v0, Bool + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_217 + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # Comparing -56($fp) type with Int + la $v0, Int + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_217 + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, -56($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_214 + # GOTO label_FALSE_213 + j label_FALSE_213 + label_COMPARE_BY_VALUE_217: + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) + lw $a0, -56($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_214 + # GOTO label_FALSE_213 + j label_FALSE_213 + label_COMPARE_STRING_216: + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_CONTINUE_218 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_CONTINUE_218 + lw $t0, -48($fp) + beq $t0, 0, label_CONTINUE_218 + # GOTO label_FALSE_213 + j label_FALSE_213 + label_CONTINUE_218: + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_219: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_220 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_219 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_220: + # Store result + sw $a2, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_214 + label_FALSE_213: + # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -44($fp) + # GOTO label_END_215 +j label_END_215 +label_TRUE_214: + # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + label_END_215: +# LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) +# LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) +# Obtain value from -44($fp) +lw $v0, -44($fp) +lw $v0, 12($v0) +sw $v0, -36($fp) +# IF_ZERO local_a2i_at_A2I_internal_8 GOTO label_FALSEIF_211 +# IF_ZERO local_a2i_at_A2I_internal_8 GOTO label_FALSEIF_211 +lw $t0, -36($fp) +beq $t0, 0, label_FALSEIF_211 +# LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) +# local_a2i_at_A2I_internal_20 = SELF +sw $s1, -84($fp) +# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) +# LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) +# local_a2i_at_A2I_internal_18 = local_a2i_at_A2I_internal_20 +lw $t0, -84($fp) +sw $t0, -76($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_21 = PARAM param_a2i_at_A2I_s_0 +lw $t0, 0($fp) +sw $t0, -88($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -96($fp) +# ARG local_a2i_at_A2I_internal_23 +# LOCAL local_a2i_at_A2I_internal_23 --> -96($fp) +lw $t0, -96($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_25 --> -104($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_25 = PARAM param_a2i_at_A2I_s_0 +lw $t0, 0($fp) +sw $t0, -104($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_25 --> -104($fp) +# LOCAL local_a2i_at_A2I_internal_26 --> -108($fp) +# local_a2i_at_A2I_internal_26 = VCALL local_a2i_at_A2I_internal_25 length +# Save new self pointer in $s1 +lw $s1, -104($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 20($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -108($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_27 --> -112($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -112($fp) +# LOCAL local_a2i_at_A2I_internal_24 --> -100($fp) +# LOCAL local_a2i_at_A2I_internal_26 --> -108($fp) +# LOCAL local_a2i_at_A2I_internal_27 --> -112($fp) +# local_a2i_at_A2I_internal_24 = local_a2i_at_A2I_internal_26 - local_a2i_at_A2I_internal_27 +lw $t1, -108($fp) +lw $t0, 12($t1) +lw $t1, -112($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -100($fp) +# ARG local_a2i_at_A2I_internal_24 +# LOCAL local_a2i_at_A2I_internal_24 --> -100($fp) +lw $t0, -100($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) +# LOCAL local_a2i_at_A2I_internal_22 --> -92($fp) +# local_a2i_at_A2I_internal_22 = VCALL local_a2i_at_A2I_internal_21 substr +# Save new self pointer in $s1 +lw $s1, -88($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -92($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_at_A2I_internal_22 +# LOCAL local_a2i_at_A2I_internal_22 --> -92($fp) +lw $t0, -92($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) +# LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) +# local_a2i_at_A2I_internal_19 = VCALL local_a2i_at_A2I_internal_18 a2i_aux +# Save new self pointer in $s1 +lw $s1, -76($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 24($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -80($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) +lw $t0, -80($fp) +lw $t0, 12($t0) +not $t0, $t0 +add $t0, $t0, 1 +sw $t0, -72($fp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +lw $t0, -72($fp) +sw $t0, 12($v0) +sw $v0, -72($fp) +# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# local_a2i_at_A2I_internal_9 = local_a2i_at_A2I_internal_17 +lw $t0, -72($fp) +sw $t0, -40($fp) +# GOTO label_ENDIF_212 +j label_ENDIF_212 +label_FALSEIF_211: + # LOCAL local_a2i_at_A2I_internal_32 --> -132($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_32 = PARAM param_a2i_at_A2I_s_0 + lw $t0, 0($fp) + sw $t0, -132($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -140($fp) + # ARG local_a2i_at_A2I_internal_34 + # LOCAL local_a2i_at_A2I_internal_34 --> -140($fp) + lw $t0, -140($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_A2I_internal_35 --> -144($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -144($fp) + # ARG local_a2i_at_A2I_internal_35 + # LOCAL local_a2i_at_A2I_internal_35 --> -144($fp) + lw $t0, -144($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_A2I_internal_32 --> -132($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # local_a2i_at_A2I_internal_33 = VCALL local_a2i_at_A2I_internal_32 substr + # Save new self pointer in $s1 + lw $s1, -132($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -136($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_26 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -148($fp) + # IF_ZERO local_a2i_at_A2I_internal_33 GOTO label_FALSE_223 + # IF_ZERO local_a2i_at_A2I_internal_33 GOTO label_FALSE_223 + lw $t0, -136($fp) + beq $t0, 0, label_FALSE_223 + # IF_ZERO local_a2i_at_A2I_internal_36 GOTO label_FALSE_223 + # IF_ZERO local_a2i_at_A2I_internal_36 GOTO label_FALSE_223 + lw $t0, -148($fp) + beq $t0, 0, label_FALSE_223 + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # Comparing -136($fp) type with String + la $v0, String + lw $a0, -136($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_STRING_226 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_STRING_226 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_STRING_226 + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # Comparing -136($fp) type with Bool + la $v0, Bool + lw $a0, -136($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_227 + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # Comparing -136($fp) type with Int + la $v0, Int + lw $a0, -136($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_227 + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) + # Load pointers and SUB + lw $a0, -136($fp) + lw $a1, -148($fp) + sub $a0, $a0, $a1 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_224 + # GOTO label_FALSE_223 + j label_FALSE_223 + label_COMPARE_BY_VALUE_227: + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) + lw $a0, -136($fp) + lw $a1, -148($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_224 + # GOTO label_FALSE_223 + j label_FALSE_223 + label_COMPARE_STRING_226: + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) + # Load strings for comparison + lw $v0, -136($fp) + lw $v1, -148($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_CONTINUE_228 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_CONTINUE_228 + lw $t0, -128($fp) + beq $t0, 0, label_CONTINUE_228 + # GOTO label_FALSE_223 + j label_FALSE_223 + label_CONTINUE_228: + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -136($fp) + lw $v1, -148($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_229: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_230 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_229 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_230: + # Store result + sw $a2, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_224 + label_FALSE_223: + # LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -124($fp) + # GOTO label_END_225 +j label_END_225 +label_TRUE_224: + # LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -124($fp) + label_END_225: +# LOCAL local_a2i_at_A2I_internal_28 --> -116($fp) +# LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) +# Obtain value from -124($fp) +lw $v0, -124($fp) +lw $v0, 12($v0) +sw $v0, -116($fp) +# IF_ZERO local_a2i_at_A2I_internal_28 GOTO label_FALSEIF_221 +# IF_ZERO local_a2i_at_A2I_internal_28 GOTO label_FALSEIF_221 +lw $t0, -116($fp) +beq $t0, 0, label_FALSEIF_221 +# LOCAL local_a2i_at_A2I_internal_39 --> -160($fp) +# local_a2i_at_A2I_internal_39 = SELF +sw $s1, -160($fp) +# LOCAL local_a2i_at_A2I_internal_37 --> -152($fp) +# LOCAL local_a2i_at_A2I_internal_39 --> -160($fp) +# local_a2i_at_A2I_internal_37 = local_a2i_at_A2I_internal_39 +lw $t0, -160($fp) +sw $t0, -152($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_40 --> -164($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_40 = PARAM param_a2i_at_A2I_s_0 +lw $t0, 0($fp) +sw $t0, -164($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_42 --> -172($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -172($fp) +# ARG local_a2i_at_A2I_internal_42 +# LOCAL local_a2i_at_A2I_internal_42 --> -172($fp) +lw $t0, -172($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_44 --> -180($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_44 = PARAM param_a2i_at_A2I_s_0 +lw $t0, 0($fp) +sw $t0, -180($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_44 --> -180($fp) +# LOCAL local_a2i_at_A2I_internal_45 --> -184($fp) +# local_a2i_at_A2I_internal_45 = VCALL local_a2i_at_A2I_internal_44 length +# Save new self pointer in $s1 +lw $s1, -180($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 20($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -184($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_46 --> -188($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -188($fp) +# LOCAL local_a2i_at_A2I_internal_43 --> -176($fp) +# LOCAL local_a2i_at_A2I_internal_45 --> -184($fp) +# LOCAL local_a2i_at_A2I_internal_46 --> -188($fp) +# local_a2i_at_A2I_internal_43 = local_a2i_at_A2I_internal_45 - local_a2i_at_A2I_internal_46 +lw $t1, -184($fp) +lw $t0, 12($t1) +lw $t1, -188($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -176($fp) +# ARG local_a2i_at_A2I_internal_43 +# LOCAL local_a2i_at_A2I_internal_43 --> -176($fp) +lw $t0, -176($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_40 --> -164($fp) +# LOCAL local_a2i_at_A2I_internal_41 --> -168($fp) +# local_a2i_at_A2I_internal_41 = VCALL local_a2i_at_A2I_internal_40 substr +# Save new self pointer in $s1 +lw $s1, -164($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -168($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_at_A2I_internal_41 +# LOCAL local_a2i_at_A2I_internal_41 --> -168($fp) +lw $t0, -168($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_37 --> -152($fp) +# LOCAL local_a2i_at_A2I_internal_38 --> -156($fp) +# local_a2i_at_A2I_internal_38 = VCALL local_a2i_at_A2I_internal_37 a2i_aux +# Save new self pointer in $s1 +lw $s1, -152($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 24($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -156($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) +# LOCAL local_a2i_at_A2I_internal_38 --> -156($fp) +# local_a2i_at_A2I_internal_29 = local_a2i_at_A2I_internal_38 +lw $t0, -156($fp) +sw $t0, -120($fp) +# GOTO label_ENDIF_222 +j label_ENDIF_222 +label_FALSEIF_221: + # LOCAL local_a2i_at_A2I_internal_49 --> -200($fp) + # local_a2i_at_A2I_internal_49 = SELF + sw $s1, -200($fp) + # LOCAL local_a2i_at_A2I_internal_47 --> -192($fp) + # LOCAL local_a2i_at_A2I_internal_49 --> -200($fp) + # local_a2i_at_A2I_internal_47 = local_a2i_at_A2I_internal_49 + lw $t0, -200($fp) + sw $t0, -192($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_a2i_at_A2I_s_0 + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_A2I_internal_47 --> -192($fp) + # LOCAL local_a2i_at_A2I_internal_48 --> -196($fp) + # local_a2i_at_A2I_internal_48 = VCALL local_a2i_at_A2I_internal_47 a2i_aux + # Save new self pointer in $s1 + lw $s1, -192($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 24($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -196($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) + # LOCAL local_a2i_at_A2I_internal_48 --> -196($fp) + # local_a2i_at_A2I_internal_29 = local_a2i_at_A2I_internal_48 + lw $t0, -196($fp) + sw $t0, -120($fp) + label_ENDIF_222: +# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) +# LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) +# local_a2i_at_A2I_internal_9 = local_a2i_at_A2I_internal_29 +lw $t0, -120($fp) +sw $t0, -40($fp) +label_ENDIF_212: +# LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) +# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) +# local_a2i_at_A2I_internal_1 = local_a2i_at_A2I_internal_9 +lw $t0, -40($fp) +sw $t0, -8($fp) +label_ENDIF_202: +# RETURN local_a2i_at_A2I_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_a2i_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 208 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_aux_at_A2I implementation. +# @Params: +# 0($fp) = param_a2i_aux_at_A2I_s_0 +function_a2i_aux_at_A2I: + # Allocate stack frame for function function_a2i_aux_at_A2I. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_a2i_aux_at_A2I_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) + # LOCAL local_a2i_aux_at_A2I_internal_1 --> -8($fp) + # local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_a2i_aux_at_A2I_j_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) + # local_a2i_aux_at_A2I_internal_3 = PARAM param_a2i_aux_at_A2I_s_0 + lw $t0, 0($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_aux_at_A2I_internal_4 --> -20($fp) + # local_a2i_aux_at_A2I_internal_4 = VCALL local_a2i_aux_at_A2I_internal_3 length + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_aux_at_A2I_j_2 --> -12($fp) + # LOCAL local_a2i_aux_at_A2I_internal_4 --> -20($fp) + # local_a2i_aux_at_A2I_j_2 = local_a2i_aux_at_A2I_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) + # local_a2i_aux_at_A2I_i_5 = local_a2i_aux_at_A2I_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + label_WHILE_231: + # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) + # LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_A2I_j_2 --> -12($fp) + lw $a0, -24($fp) + lw $a1, -12($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -36($fp) + # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 + # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 + lw $t0, -36($fp) + bgt $t0, 0, label_FALSE_233 + # IF_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 + # IF_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 + lw $t0, -36($fp) + beq $t0, 0, label_FALSE_233 + # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_234 +j label_END_234 +label_FALSE_233: + # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_234: +# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) +# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_a2i_aux_at_A2I_internal_7 GOTO label_WHILE_END_232 +# IF_ZERO local_a2i_aux_at_A2I_internal_7 GOTO label_WHILE_END_232 +lw $t0, -32($fp) +beq $t0, 0, label_WHILE_END_232 +# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 10 +sw $t0, 12($v0) +sw $v0, -48($fp) +# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) +# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) +# local_a2i_aux_at_A2I_internal_10 = local_a2i_aux_at_A2I_int_0 * local_a2i_aux_at_A2I_internal_11 +lw $t1, -4($fp) +lw $t0, 12($t1) +lw $t1, -48($fp) +lw $t2, 12($t1) +mul $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -44($fp) +# LOCAL local_a2i_aux_at_A2I_internal_14 --> -60($fp) +# local_a2i_aux_at_A2I_internal_14 = SELF +sw $s1, -60($fp) +# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) +# LOCAL local_a2i_aux_at_A2I_internal_14 --> -60($fp) +# local_a2i_aux_at_A2I_internal_12 = local_a2i_aux_at_A2I_internal_14 +lw $t0, -60($fp) +sw $t0, -52($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_15 --> -64($fp) +# PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) +# local_a2i_aux_at_A2I_internal_15 = PARAM param_a2i_aux_at_A2I_s_0 +lw $t0, 0($fp) +sw $t0, -64($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_a2i_aux_at_A2I_i_5 +# LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) +lw $t0, -24($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -72($fp) +# ARG local_a2i_aux_at_A2I_internal_17 +# LOCAL local_a2i_aux_at_A2I_internal_17 --> -72($fp) +lw $t0, -72($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_15 --> -64($fp) +# LOCAL local_a2i_aux_at_A2I_internal_16 --> -68($fp) +# local_a2i_aux_at_A2I_internal_16 = VCALL local_a2i_aux_at_A2I_internal_15 substr +# Save new self pointer in $s1 +lw $s1, -64($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -68($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_aux_at_A2I_internal_16 +# LOCAL local_a2i_aux_at_A2I_internal_16 --> -68($fp) +lw $t0, -68($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) +# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) +# local_a2i_aux_at_A2I_internal_13 = VCALL local_a2i_aux_at_A2I_internal_12 c2i +# Save new self pointer in $s1 +lw $s1, -52($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -56($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) +# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) +# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) +# local_a2i_aux_at_A2I_internal_9 = local_a2i_aux_at_A2I_internal_10 + local_a2i_aux_at_A2I_internal_13 +lw $t1, -44($fp) +lw $t0, 12($t1) +lw $t1, -56($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -40($fp) +# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) +# local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_9 +lw $t0, -40($fp) +sw $t0, -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_19 --> -80($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -80($fp) +# LOCAL local_a2i_aux_at_A2I_internal_18 --> -76($fp) +# LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) +# LOCAL local_a2i_aux_at_A2I_internal_19 --> -80($fp) +# local_a2i_aux_at_A2I_internal_18 = local_a2i_aux_at_A2I_i_5 + local_a2i_aux_at_A2I_internal_19 +lw $t1, -24($fp) +lw $t0, 12($t1) +lw $t1, -80($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -76($fp) +# LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) +# LOCAL local_a2i_aux_at_A2I_internal_18 --> -76($fp) +# local_a2i_aux_at_A2I_i_5 = local_a2i_aux_at_A2I_internal_18 +lw $t0, -76($fp) +sw $t0, -24($fp) +# GOTO label_WHILE_231 +j label_WHILE_231 +label_WHILE_END_232: + # RETURN local_a2i_aux_at_A2I_int_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_a2i_aux_at_A2I. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 88 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_i2a_at_A2I implementation. +# @Params: +# 0($fp) = param_i2a_at_A2I_i_0 +function_i2a_at_A2I: + # Allocate stack frame for function function_i2a_at_A2I. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # IF_ZERO param_i2a_at_A2I_i_0 GOTO label_FALSE_237 + # IF_ZERO param_i2a_at_A2I_i_0 GOTO label_FALSE_237 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_237 + # IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_237 + # IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_237 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_237 + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_STRING_240 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_STRING_240 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_240 + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_241 + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_241 + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_238 + # GOTO label_FALSE_237 + j label_FALSE_237 + label_COMPARE_BY_VALUE_241: + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_238 + # GOTO label_FALSE_237 + j label_FALSE_237 + label_COMPARE_STRING_240: + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_CONTINUE_242 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_CONTINUE_242 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_242 + # GOTO label_FALSE_237 + j label_FALSE_237 + label_CONTINUE_242: + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_243: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_244 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_243 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_244: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_238 + label_FALSE_237: + # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_239 +j label_END_239 +label_TRUE_238: + # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_239: +# LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSEIF_235 +# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSEIF_235 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_235 +# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_27 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -24($fp) +# LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) +# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) +# local_i2a_at_A2I_internal_1 = local_i2a_at_A2I_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_236 +j label_ENDIF_236 +label_FALSEIF_235: + # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -40($fp) + # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) + # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + lw $a0, -40($fp) + lw $a1, 0($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -36($fp) + # IF_GREATER_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 + # IF_GREATER_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 + lw $t0, -36($fp) + bgt $t0, 0, label_FALSE_247 + # IF_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 + # IF_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 + lw $t0, -36($fp) + beq $t0, 0, label_FALSE_247 + # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_248 +j label_END_248 +label_FALSE_247: + # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_248: +# LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) +# LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_i2a_at_A2I_internal_6 GOTO label_FALSEIF_245 +# IF_ZERO local_i2a_at_A2I_internal_6 GOTO label_FALSEIF_245 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_245 +# LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) +# local_i2a_at_A2I_internal_12 = SELF +sw $s1, -52($fp) +# LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) +# LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) +# local_i2a_at_A2I_internal_10 = local_i2a_at_A2I_internal_12 +lw $t0, -52($fp) +sw $t0, -44($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_i2a_at_A2I_i_0 +# PARAM param_i2a_at_A2I_i_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) +# LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) +# local_i2a_at_A2I_internal_11 = VCALL local_i2a_at_A2I_internal_10 i2a_aux +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 32($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) +# LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) +# local_i2a_at_A2I_internal_7 = local_i2a_at_A2I_internal_11 +lw $t0, -48($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_246 +j label_ENDIF_246 +label_FALSEIF_245: + # LOCAL local_i2a_at_A2I_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_28 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -64($fp) + # LOCAL local_i2a_at_A2I_internal_13 --> -56($fp) + # LOCAL local_i2a_at_A2I_internal_15 --> -64($fp) + # local_i2a_at_A2I_internal_13 = local_i2a_at_A2I_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_18 --> -76($fp) + # local_i2a_at_A2I_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_i2a_at_A2I_internal_16 --> -68($fp) + # LOCAL local_i2a_at_A2I_internal_18 --> -76($fp) + # local_i2a_at_A2I_internal_16 = local_i2a_at_A2I_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -84($fp) + # LOCAL local_i2a_at_A2I_internal_19 --> -80($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) + # local_i2a_at_A2I_internal_19 = PARAM param_i2a_at_A2I_i_0 * local_i2a_at_A2I_internal_20 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -84($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -80($fp) + # ARG local_i2a_at_A2I_internal_19 + # LOCAL local_i2a_at_A2I_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_i2a_at_A2I_internal_16 --> -68($fp) + # LOCAL local_i2a_at_A2I_internal_17 --> -72($fp) + # local_i2a_at_A2I_internal_17 = VCALL local_i2a_at_A2I_internal_16 i2a_aux + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_i2a_at_A2I_internal_17 + # LOCAL local_i2a_at_A2I_internal_17 --> -72($fp) + lw $t0, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_i2a_at_A2I_internal_13 --> -56($fp) + # LOCAL local_i2a_at_A2I_internal_14 --> -60($fp) + # local_i2a_at_A2I_internal_14 = VCALL local_i2a_at_A2I_internal_13 concat + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) + # LOCAL local_i2a_at_A2I_internal_14 --> -60($fp) + # local_i2a_at_A2I_internal_7 = local_i2a_at_A2I_internal_14 + lw $t0, -60($fp) + sw $t0, -32($fp) + label_ENDIF_246: +# LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) +# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) +# local_i2a_at_A2I_internal_1 = local_i2a_at_A2I_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +label_ENDIF_236: +# RETURN local_i2a_at_A2I_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_i2a_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 92 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_i2a_aux_at_A2I implementation. +# @Params: +# 0($fp) = param_i2a_aux_at_A2I_i_0 +function_i2a_aux_at_A2I: + # Allocate stack frame for function function_i2a_aux_at_A2I. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # IF_ZERO param_i2a_aux_at_A2I_i_0 GOTO label_FALSE_251 + # IF_ZERO param_i2a_aux_at_A2I_i_0 GOTO label_FALSE_251 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_251 + # IF_ZERO local_i2a_aux_at_A2I_internal_4 GOTO label_FALSE_251 + # IF_ZERO local_i2a_aux_at_A2I_internal_4 GOTO label_FALSE_251 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_251 + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_STRING_254 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_STRING_254 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_254 + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_255 + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_255 + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_252 + # GOTO label_FALSE_251 + j label_FALSE_251 + label_COMPARE_BY_VALUE_255: + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_252 + # GOTO label_FALSE_251 + j label_FALSE_251 + label_COMPARE_STRING_254: + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_CONTINUE_256 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_CONTINUE_256 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_256 + # GOTO label_FALSE_251 + j label_FALSE_251 + label_CONTINUE_256: + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_257: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_258 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_257 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_258: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_252 + label_FALSE_251: + # LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_253 +j label_END_253 +label_TRUE_252: + # LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_253: +# LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSEIF_249 +# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSEIF_249 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_249 +# LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_29 +sw $t0, 12($v0) +li $t0, 0 +sw $t0, 16($v0) +sw $v0, -24($fp) +# LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) +# LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) +# local_i2a_aux_at_A2I_internal_1 = local_i2a_aux_at_A2I_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_250 +j label_ENDIF_250 +label_FALSEIF_249: + # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 10 + sw $t0, 12($v0) + sw $v0, -36($fp) + # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) + # local_i2a_aux_at_A2I_internal_7 = PARAM param_i2a_aux_at_A2I_i_0 / local_i2a_aux_at_A2I_internal_8 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -36($fp) + lw $t2, 12($t1) + div $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -32($fp) + # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) + # local_i2a_aux_at_A2I_next_6 = local_i2a_aux_at_A2I_internal_7 + lw $t0, -32($fp) + sw $t0, -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) + # local_i2a_aux_at_A2I_internal_13 = SELF + sw $s1, -56($fp) + # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) + # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) + # local_i2a_aux_at_A2I_internal_11 = local_i2a_aux_at_A2I_internal_13 + lw $t0, -56($fp) + sw $t0, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_i2a_aux_at_A2I_next_6 + # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) + lw $t0, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) + # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) + # local_i2a_aux_at_A2I_internal_12 = VCALL local_i2a_aux_at_A2I_internal_11 i2a_aux + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) + # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) + # local_i2a_aux_at_A2I_internal_9 = local_i2a_aux_at_A2I_internal_12 + lw $t0, -52($fp) + sw $t0, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_16 --> -68($fp) + # local_i2a_aux_at_A2I_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_i2a_aux_at_A2I_internal_14 --> -60($fp) + # LOCAL local_i2a_aux_at_A2I_internal_16 --> -68($fp) + # local_i2a_aux_at_A2I_internal_14 = local_i2a_aux_at_A2I_internal_16 + lw $t0, -68($fp) + sw $t0, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 10 + sw $t0, 12($v0) + sw $v0, -80($fp) + # LOCAL local_i2a_aux_at_A2I_internal_18 --> -76($fp) + # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_19 --> -80($fp) + # local_i2a_aux_at_A2I_internal_18 = local_i2a_aux_at_A2I_next_6 * local_i2a_aux_at_A2I_internal_19 + lw $t1, -28($fp) + lw $t0, 12($t1) + lw $t1, -80($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -76($fp) + # LOCAL local_i2a_aux_at_A2I_internal_17 --> -72($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_18 --> -76($fp) + # local_i2a_aux_at_A2I_internal_17 = PARAM param_i2a_aux_at_A2I_i_0 - local_i2a_aux_at_A2I_internal_18 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -76($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -72($fp) + # ARG local_i2a_aux_at_A2I_internal_17 + # LOCAL local_i2a_aux_at_A2I_internal_17 --> -72($fp) + lw $t0, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_14 --> -60($fp) + # LOCAL local_i2a_aux_at_A2I_internal_15 --> -64($fp) + # local_i2a_aux_at_A2I_internal_15 = VCALL local_i2a_aux_at_A2I_internal_14 i2c + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_i2a_aux_at_A2I_internal_15 + # LOCAL local_i2a_aux_at_A2I_internal_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) + # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) + # local_i2a_aux_at_A2I_internal_10 = VCALL local_i2a_aux_at_A2I_internal_9 concat + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) + # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) + # local_i2a_aux_at_A2I_internal_1 = local_i2a_aux_at_A2I_internal_10 + lw $t0, -44($fp) + sw $t0, -8($fp) + label_ENDIF_250: +# RETURN local_i2a_aux_at_A2I_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_i2a_aux_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# __A__attrib__var__init implementation. +# @Params: +__A__attrib__var__init: + # Allocate stack frame for function __A__attrib__var__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ib__var__init_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_ib__var__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __A__attrib__var__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_value_at_A implementation. +# @Params: +function_value_at_A: + # Allocate stack frame for function function_value_at_A. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_value_at_A_internal_0 = GETATTRIBUTE var A + # LOCAL local_value_at_A_internal_0 --> -4($fp) + lw $t0, 12($s1) + sw $t0, -4($fp) + # RETURN local_value_at_A_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_value_at_A. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_set_var_at_A implementation. +# @Params: +# 0($fp) = param_set_var_at_A_num_0 +function_set_var_at_A: + # Allocate stack frame for function function_set_var_at_A. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_set_var_at_A_num_0 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 12($s1) + # LOCAL local_set_var_at_A_internal_0 --> -4($fp) + # local_set_var_at_A_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_set_var_at_A_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_set_var_at_A. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_method1_at_A implementation. +# @Params: +# 0($fp) = param_method1_at_A_num_0 +function_method1_at_A: + # Allocate stack frame for function function_method1_at_A. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_method1_at_A_internal_0 --> -4($fp) + # local_method1_at_A_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_method1_at_A_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_method1_at_A. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_method2_at_A implementation. +# @Params: +# 0($fp) = param_method2_at_A_num1_0 +# 4($fp) = param_method2_at_A_num2_1 +function_method2_at_A: + # Allocate stack frame for function function_method2_at_A. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_method2_at_A_x_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_method2_at_A_internal_1 --> -8($fp) + # PARAM param_method2_at_A_num1_0 --> 4($fp) + # PARAM param_method2_at_A_num2_1 --> 0($fp) + # local_method2_at_A_internal_1 = PARAM param_method2_at_A_num1_0 + PARAM param_method2_at_A_num2_1 + lw $t1, 4($fp) + lw $t0, 12($t1) + lw $t1, 0($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_method2_at_A_x_0 --> -4($fp) + # LOCAL local_method2_at_A_internal_1 --> -8($fp) + # local_method2_at_A_x_0 = local_method2_at_A_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_method2_at_A_internal_4 --> -20($fp) + # local_method2_at_A_internal_4 = ALLOCATE B + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, B + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, B_start + sw $t0, 4($v0) + # Load type offset + li $t0, 28 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -20($fp) + # LOCAL local_method2_at_A_internal_2 --> -12($fp) + # LOCAL local_method2_at_A_internal_4 --> -20($fp) + # local_method2_at_A_internal_2 = local_method2_at_A_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_method2_at_A_x_0 + # LOCAL local_method2_at_A_x_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_method2_at_A_internal_2 --> -12($fp) + # LOCAL local_method2_at_A_internal_3 --> -16($fp) + # local_method2_at_A_internal_3 = VCALL local_method2_at_A_internal_2 set_var + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_method2_at_A_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_method2_at_A. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_method3_at_A implementation. +# @Params: +# 0($fp) = param_method3_at_A_num_0 +function_method3_at_A: + # Allocate stack frame for function function_method3_at_A. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_method3_at_A_x_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_method3_at_A_internal_1 --> -8($fp) + # PARAM param_method3_at_A_num_0 --> 0($fp) + lw $t0, 0($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -8($fp) + # LOCAL local_method3_at_A_internal_1 --> -8($fp) + # LOCAL local_method3_at_A_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -8($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_method3_at_A_x_0 --> -4($fp) + # LOCAL local_method3_at_A_internal_1 --> -8($fp) + # local_method3_at_A_x_0 = local_method3_at_A_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_method3_at_A_internal_4 --> -20($fp) + # local_method3_at_A_internal_4 = ALLOCATE C + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, C + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, C_start + sw $t0, 4($v0) + # Load type offset + li $t0, 40 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -20($fp) + # LOCAL local_method3_at_A_internal_2 --> -12($fp) + # LOCAL local_method3_at_A_internal_4 --> -20($fp) + # local_method3_at_A_internal_2 = local_method3_at_A_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_method3_at_A_x_0 + # LOCAL local_method3_at_A_x_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_method3_at_A_internal_2 --> -12($fp) + # LOCAL local_method3_at_A_internal_3 --> -16($fp) + # local_method3_at_A_internal_3 = VCALL local_method3_at_A_internal_2 set_var + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_method3_at_A_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_method3_at_A. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_method4_at_A implementation. +# @Params: +# 0($fp) = param_method4_at_A_num1_0 +# 4($fp) = param_method4_at_A_num2_1 +function_method4_at_A: + # Allocate stack frame for function function_method4_at_A. + subu $sp, $sp, 60 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 60 + # LOCAL local_method4_at_A_internal_2 --> -12($fp) + # PARAM param_method4_at_A_num2_1 --> 0($fp) + # PARAM param_method4_at_A_num1_0 --> 4($fp) + lw $a0, 0($fp) + lw $a1, 4($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -12($fp) + # IF_GREATER_ZERO local_method4_at_A_internal_2 GOTO label_FALSE_261 + # IF_GREATER_ZERO local_method4_at_A_internal_2 GOTO label_FALSE_261 + lw $t0, -12($fp) + bgt $t0, 0, label_FALSE_261 + # IF_ZERO local_method4_at_A_internal_2 GOTO label_FALSE_261 + # IF_ZERO local_method4_at_A_internal_2 GOTO label_FALSE_261 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_261 + # LOCAL local_method4_at_A_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_262 +j label_END_262 +label_FALSE_261: + # LOCAL local_method4_at_A_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_262: +# LOCAL local_method4_at_A_internal_0 --> -4($fp) +# LOCAL local_method4_at_A_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_method4_at_A_internal_0 GOTO label_FALSEIF_259 +# IF_ZERO local_method4_at_A_internal_0 GOTO label_FALSEIF_259 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_259 +# LOCAL local_method4_at_A_x_3 --> -16($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -16($fp) +# LOCAL local_method4_at_A_internal_4 --> -20($fp) +# PARAM param_method4_at_A_num1_0 --> 4($fp) +# PARAM param_method4_at_A_num2_1 --> 0($fp) +# local_method4_at_A_internal_4 = PARAM param_method4_at_A_num1_0 - PARAM param_method4_at_A_num2_1 +lw $t1, 4($fp) +lw $t0, 12($t1) +lw $t1, 0($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -20($fp) +# LOCAL local_method4_at_A_x_3 --> -16($fp) +# LOCAL local_method4_at_A_internal_4 --> -20($fp) +# local_method4_at_A_x_3 = local_method4_at_A_internal_4 +lw $t0, -20($fp) +sw $t0, -16($fp) +# LOCAL local_method4_at_A_internal_7 --> -32($fp) +# local_method4_at_A_internal_7 = ALLOCATE D +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, D +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, D_start +sw $t0, 4($v0) +# Load type offset +li $t0, 32 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -32($fp) +# LOCAL local_method4_at_A_internal_5 --> -24($fp) +# LOCAL local_method4_at_A_internal_7 --> -32($fp) +# local_method4_at_A_internal_5 = local_method4_at_A_internal_7 +lw $t0, -32($fp) +sw $t0, -24($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_method4_at_A_x_3 +# LOCAL local_method4_at_A_x_3 --> -16($fp) +lw $t0, -16($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_method4_at_A_internal_5 --> -24($fp) +# LOCAL local_method4_at_A_internal_6 --> -28($fp) +# local_method4_at_A_internal_6 = VCALL local_method4_at_A_internal_5 set_var +# Save new self pointer in $s1 +lw $s1, -24($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -28($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_method4_at_A_internal_1 --> -8($fp) +# LOCAL local_method4_at_A_internal_6 --> -28($fp) +# local_method4_at_A_internal_1 = local_method4_at_A_internal_6 +lw $t0, -28($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_260 +j label_ENDIF_260 +label_FALSEIF_259: + # LOCAL local_method4_at_A_x_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # LOCAL local_method4_at_A_internal_9 --> -40($fp) + # PARAM param_method4_at_A_num2_1 --> 0($fp) + # PARAM param_method4_at_A_num1_0 --> 4($fp) + # local_method4_at_A_internal_9 = PARAM param_method4_at_A_num2_1 - PARAM param_method4_at_A_num1_0 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, 4($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -40($fp) + # LOCAL local_method4_at_A_x_3 --> -16($fp) + # LOCAL local_method4_at_A_internal_9 --> -40($fp) + # local_method4_at_A_x_3 = local_method4_at_A_internal_9 + lw $t0, -40($fp) + sw $t0, -16($fp) + # LOCAL local_method4_at_A_internal_12 --> -52($fp) + # local_method4_at_A_internal_12 = ALLOCATE D + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, D + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, D_start + sw $t0, 4($v0) + # Load type offset + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -52($fp) + # LOCAL local_method4_at_A_internal_10 --> -44($fp) + # LOCAL local_method4_at_A_internal_12 --> -52($fp) + # local_method4_at_A_internal_10 = local_method4_at_A_internal_12 + lw $t0, -52($fp) + sw $t0, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_method4_at_A_x_8 + # LOCAL local_method4_at_A_x_8 --> -36($fp) + lw $t0, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_method4_at_A_internal_10 --> -44($fp) + # LOCAL local_method4_at_A_internal_11 --> -48($fp) + # local_method4_at_A_internal_11 = VCALL local_method4_at_A_internal_10 set_var + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_method4_at_A_internal_1 --> -8($fp) + # LOCAL local_method4_at_A_internal_11 --> -48($fp) + # local_method4_at_A_internal_1 = local_method4_at_A_internal_11 + lw $t0, -48($fp) + sw $t0, -8($fp) + label_ENDIF_260: +# RETURN local_method4_at_A_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_method4_at_A. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 60 +# Deallocate function args +addu $sp, $sp, 8 +jr $ra +# Function END + + +# function_method5_at_A implementation. +# @Params: +# 0($fp) = param_method5_at_A_num_0 +function_method5_at_A: + # Allocate stack frame for function function_method5_at_A. + subu $sp, $sp, 56 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 56 + # LOCAL local_method5_at_A_x_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_method5_at_A_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_method5_at_A_x_0 --> -4($fp) + # LOCAL local_method5_at_A_internal_1 --> -8($fp) + # local_method5_at_A_x_0 = local_method5_at_A_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_method5_at_A_y_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_method5_at_A_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -16($fp) + # LOCAL local_method5_at_A_y_2 --> -12($fp) + # LOCAL local_method5_at_A_internal_3 --> -16($fp) + # local_method5_at_A_y_2 = local_method5_at_A_internal_3 + lw $t0, -16($fp) + sw $t0, -12($fp) + label_WHILE_263: + # LOCAL local_method5_at_A_internal_5 --> -24($fp) + # LOCAL local_method5_at_A_y_2 --> -12($fp) + # PARAM param_method5_at_A_num_0 --> 0($fp) + lw $a0, -12($fp) + lw $a1, 0($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -24($fp) + # IF_GREATER_ZERO local_method5_at_A_internal_5 GOTO label_FALSE_265 + # IF_GREATER_ZERO local_method5_at_A_internal_5 GOTO label_FALSE_265 + lw $t0, -24($fp) + bgt $t0, 0, label_FALSE_265 + # LOCAL local_method5_at_A_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -24($fp) + # GOTO label_END_266 +j label_END_266 +label_FALSE_265: + # LOCAL local_method5_at_A_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + label_END_266: +# LOCAL local_method5_at_A_internal_4 --> -20($fp) +# LOCAL local_method5_at_A_internal_5 --> -24($fp) +# Obtain value from -24($fp) +lw $v0, -24($fp) +lw $v0, 12($v0) +sw $v0, -20($fp) +# IF_ZERO local_method5_at_A_internal_4 GOTO label_WHILE_END_264 +# IF_ZERO local_method5_at_A_internal_4 GOTO label_WHILE_END_264 +lw $t0, -20($fp) +beq $t0, 0, label_WHILE_END_264 +# LOCAL local_method5_at_A_internal_6 --> -28($fp) +# LOCAL local_method5_at_A_x_0 --> -4($fp) +# LOCAL local_method5_at_A_y_2 --> -12($fp) +# local_method5_at_A_internal_6 = local_method5_at_A_x_0 * local_method5_at_A_y_2 +lw $t1, -4($fp) +lw $t0, 12($t1) +lw $t1, -12($fp) +lw $t2, 12($t1) +mul $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -28($fp) +# LOCAL local_method5_at_A_x_0 --> -4($fp) +# LOCAL local_method5_at_A_internal_6 --> -28($fp) +# local_method5_at_A_x_0 = local_method5_at_A_internal_6 +lw $t0, -28($fp) +sw $t0, -4($fp) +# LOCAL local_method5_at_A_internal_8 --> -36($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -36($fp) +# LOCAL local_method5_at_A_internal_7 --> -32($fp) +# LOCAL local_method5_at_A_y_2 --> -12($fp) +# LOCAL local_method5_at_A_internal_8 --> -36($fp) +# local_method5_at_A_internal_7 = local_method5_at_A_y_2 + local_method5_at_A_internal_8 +lw $t1, -12($fp) +lw $t0, 12($t1) +lw $t1, -36($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -32($fp) +# LOCAL local_method5_at_A_y_2 --> -12($fp) +# LOCAL local_method5_at_A_internal_7 --> -32($fp) +# local_method5_at_A_y_2 = local_method5_at_A_internal_7 +lw $t0, -32($fp) +sw $t0, -12($fp) +# GOTO label_WHILE_263 +j label_WHILE_263 +label_WHILE_END_264: + # LOCAL local_method5_at_A_internal_11 --> -48($fp) + # local_method5_at_A_internal_11 = ALLOCATE E + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, E + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, E_start + sw $t0, 4($v0) + # Load type offset + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -48($fp) + # LOCAL local_method5_at_A_internal_9 --> -40($fp) + # LOCAL local_method5_at_A_internal_11 --> -48($fp) + # local_method5_at_A_internal_9 = local_method5_at_A_internal_11 + lw $t0, -48($fp) + sw $t0, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_method5_at_A_x_0 + # LOCAL local_method5_at_A_x_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_method5_at_A_internal_9 --> -40($fp) + # LOCAL local_method5_at_A_internal_10 --> -44($fp) + # local_method5_at_A_internal_10 = VCALL local_method5_at_A_internal_9 set_var + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_method5_at_A_internal_10 + lw $v0, -44($fp) + # Deallocate stack frame for function function_method5_at_A. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 56 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_method5_at_B implementation. +# @Params: +# 0($fp) = param_method5_at_B_num_0 +function_method5_at_B: + # Allocate stack frame for function function_method5_at_B. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_method5_at_B_x_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_method5_at_B_internal_1 --> -8($fp) + # PARAM param_method5_at_B_num_0 --> 0($fp) + # PARAM param_method5_at_B_num_0 --> 0($fp) + # local_method5_at_B_internal_1 = PARAM param_method5_at_B_num_0 * PARAM param_method5_at_B_num_0 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, 0($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_method5_at_B_x_0 --> -4($fp) + # LOCAL local_method5_at_B_internal_1 --> -8($fp) + # local_method5_at_B_x_0 = local_method5_at_B_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_method5_at_B_internal_4 --> -20($fp) + # local_method5_at_B_internal_4 = ALLOCATE E + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, E + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, E_start + sw $t0, 4($v0) + # Load type offset + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -20($fp) + # LOCAL local_method5_at_B_internal_2 --> -12($fp) + # LOCAL local_method5_at_B_internal_4 --> -20($fp) + # local_method5_at_B_internal_2 = local_method5_at_B_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_method5_at_B_x_0 + # LOCAL local_method5_at_B_x_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_method5_at_B_internal_2 --> -12($fp) + # LOCAL local_method5_at_B_internal_3 --> -16($fp) + # local_method5_at_B_internal_3 = VCALL local_method5_at_B_internal_2 set_var + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_method5_at_B_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_method5_at_B. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_method7_at_D implementation. +# @Params: +# 0($fp) = param_method7_at_D_num_0 +function_method7_at_D: + # Allocate stack frame for function function_method7_at_D. + subu $sp, $sp, 136 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 136 + # LOCAL local_method7_at_D_x_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + # PARAM param_method7_at_D_num_0 --> 0($fp) + # local_method7_at_D_x_0 = PARAM param_method7_at_D_num_0 + lw $t0, 0($fp) + sw $t0, -4($fp) + # LOCAL local_method7_at_D_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # LOCAL local_method7_at_D_internal_3 --> -16($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + # LOCAL local_method7_at_D_internal_4 --> -20($fp) + lw $a0, -4($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_GREATER_ZERO local_method7_at_D_internal_3 GOTO label_FALSE_269 + # IF_GREATER_ZERO local_method7_at_D_internal_3 GOTO label_FALSE_269 + lw $t0, -16($fp) + bgt $t0, 0, label_FALSE_269 + # IF_ZERO local_method7_at_D_internal_3 GOTO label_FALSE_269 + # IF_ZERO local_method7_at_D_internal_3 GOTO label_FALSE_269 + lw $t0, -16($fp) + beq $t0, 0, label_FALSE_269 + # LOCAL local_method7_at_D_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -16($fp) + # GOTO label_END_270 +j label_END_270 +label_FALSE_269: + # LOCAL local_method7_at_D_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -16($fp) + label_END_270: +# LOCAL local_method7_at_D_internal_1 --> -8($fp) +# LOCAL local_method7_at_D_internal_3 --> -16($fp) +# Obtain value from -16($fp) +lw $v0, -16($fp) +lw $v0, 12($v0) +sw $v0, -8($fp) +# IF_ZERO local_method7_at_D_internal_1 GOTO label_FALSEIF_267 +# IF_ZERO local_method7_at_D_internal_1 GOTO label_FALSEIF_267 +lw $t0, -8($fp) +beq $t0, 0, label_FALSEIF_267 +# LOCAL local_method7_at_D_internal_7 --> -32($fp) +# local_method7_at_D_internal_7 = SELF +sw $s1, -32($fp) +# LOCAL local_method7_at_D_internal_5 --> -24($fp) +# LOCAL local_method7_at_D_internal_7 --> -32($fp) +# local_method7_at_D_internal_5 = local_method7_at_D_internal_7 +lw $t0, -32($fp) +sw $t0, -24($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_method7_at_D_internal_8 --> -36($fp) +# LOCAL local_method7_at_D_x_0 --> -4($fp) +lw $t0, -4($fp) +lw $t0, 12($t0) +not $t0, $t0 +add $t0, $t0, 1 +sw $t0, -36($fp) +# LOCAL local_method7_at_D_internal_8 --> -36($fp) +# LOCAL local_method7_at_D_internal_8 --> -36($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +lw $t0, -36($fp) +sw $t0, 12($v0) +sw $v0, -36($fp) +# ARG local_method7_at_D_internal_8 +# LOCAL local_method7_at_D_internal_8 --> -36($fp) +lw $t0, -36($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_method7_at_D_internal_5 --> -24($fp) +# LOCAL local_method7_at_D_internal_6 --> -28($fp) +# local_method7_at_D_internal_6 = VCALL local_method7_at_D_internal_5 method7 +# Save new self pointer in $s1 +lw $s1, -24($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 40($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -28($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_method7_at_D_internal_2 --> -12($fp) +# LOCAL local_method7_at_D_internal_6 --> -28($fp) +# local_method7_at_D_internal_2 = local_method7_at_D_internal_6 +lw $t0, -28($fp) +sw $t0, -12($fp) +# GOTO label_ENDIF_268 +j label_ENDIF_268 +label_FALSEIF_267: + # LOCAL local_method7_at_D_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -56($fp) + # IF_ZERO local_method7_at_D_internal_13 GOTO label_FALSE_273 + # IF_ZERO local_method7_at_D_internal_13 GOTO label_FALSE_273 + lw $t0, -56($fp) + beq $t0, 0, label_FALSE_273 + # IF_ZERO local_method7_at_D_x_0 GOTO label_FALSE_273 + # IF_ZERO local_method7_at_D_x_0 GOTO label_FALSE_273 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_273 + # LOCAL local_method7_at_D_internal_12 --> -52($fp) + # LOCAL local_method7_at_D_internal_13 --> -56($fp) + # Comparing -56($fp) type with String + la $v0, String + lw $a0, -56($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -52($fp) + # IF_ZERO local_method7_at_D_internal_12 GOTO label_COMPARE_STRING_276 + # IF_ZERO local_method7_at_D_internal_12 GOTO label_COMPARE_STRING_276 + lw $t0, -52($fp) + beq $t0, 0, label_COMPARE_STRING_276 + # LOCAL local_method7_at_D_internal_12 --> -52($fp) + # LOCAL local_method7_at_D_internal_13 --> -56($fp) + # Comparing -56($fp) type with Bool + la $v0, Bool + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -52($fp) + # IF_ZERO local_method7_at_D_internal_12 GOTO label_COMPARE_BY_VALUE_277 + # IF_ZERO local_method7_at_D_internal_12 GOTO label_COMPARE_BY_VALUE_277 + lw $t0, -52($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_277 + # LOCAL local_method7_at_D_internal_12 --> -52($fp) + # LOCAL local_method7_at_D_internal_13 --> -56($fp) + # Comparing -56($fp) type with Int + la $v0, Int + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -52($fp) + # IF_ZERO local_method7_at_D_internal_12 GOTO label_COMPARE_BY_VALUE_277 + # IF_ZERO local_method7_at_D_internal_12 GOTO label_COMPARE_BY_VALUE_277 + lw $t0, -52($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_277 + # LOCAL local_method7_at_D_internal_12 --> -52($fp) + # LOCAL local_method7_at_D_internal_13 --> -56($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + # Load pointers and SUB + lw $a0, -56($fp) + lw $a1, -4($fp) + sub $a0, $a0, $a1 + sw $a0, -52($fp) + # IF_ZERO local_method7_at_D_internal_12 GOTO label_TRUE_274 + # IF_ZERO local_method7_at_D_internal_12 GOTO label_TRUE_274 + lw $t0, -52($fp) + beq $t0, 0, label_TRUE_274 + # GOTO label_FALSE_273 + j label_FALSE_273 + label_COMPARE_BY_VALUE_277: + # LOCAL local_method7_at_D_internal_12 --> -52($fp) + # LOCAL local_method7_at_D_internal_13 --> -56($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + lw $a0, -56($fp) + lw $a1, -4($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -52($fp) + # IF_ZERO local_method7_at_D_internal_12 GOTO label_TRUE_274 + # IF_ZERO local_method7_at_D_internal_12 GOTO label_TRUE_274 + lw $t0, -52($fp) + beq $t0, 0, label_TRUE_274 + # GOTO label_FALSE_273 + j label_FALSE_273 + label_COMPARE_STRING_276: + # LOCAL local_method7_at_D_internal_12 --> -52($fp) + # LOCAL local_method7_at_D_internal_13 --> -56($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -4($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -52($fp) + # IF_ZERO local_method7_at_D_internal_12 GOTO label_CONTINUE_278 + # IF_ZERO local_method7_at_D_internal_12 GOTO label_CONTINUE_278 + lw $t0, -52($fp) + beq $t0, 0, label_CONTINUE_278 + # GOTO label_FALSE_273 + j label_FALSE_273 + label_CONTINUE_278: + # LOCAL local_method7_at_D_internal_12 --> -52($fp) + # LOCAL local_method7_at_D_internal_13 --> -56($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -4($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_279: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_280 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_279 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_280: + # Store result + sw $a2, -52($fp) + # IF_ZERO local_method7_at_D_internal_12 GOTO label_TRUE_274 + # IF_ZERO local_method7_at_D_internal_12 GOTO label_TRUE_274 + lw $t0, -52($fp) + beq $t0, 0, label_TRUE_274 + label_FALSE_273: + # LOCAL local_method7_at_D_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -48($fp) + # GOTO label_END_275 +j label_END_275 +label_TRUE_274: + # LOCAL local_method7_at_D_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -48($fp) + label_END_275: +# LOCAL local_method7_at_D_internal_9 --> -40($fp) +# LOCAL local_method7_at_D_internal_11 --> -48($fp) +# Obtain value from -48($fp) +lw $v0, -48($fp) +lw $v0, 12($v0) +sw $v0, -40($fp) +# IF_ZERO local_method7_at_D_internal_9 GOTO label_FALSEIF_271 +# IF_ZERO local_method7_at_D_internal_9 GOTO label_FALSEIF_271 +lw $t0, -40($fp) +beq $t0, 0, label_FALSEIF_271 +# LOCAL local_method7_at_D_internal_14 --> -60($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -60($fp) +# LOCAL local_method7_at_D_internal_10 --> -44($fp) +# LOCAL local_method7_at_D_internal_14 --> -60($fp) +# local_method7_at_D_internal_10 = local_method7_at_D_internal_14 +lw $t0, -60($fp) +sw $t0, -44($fp) +# GOTO label_ENDIF_272 +j label_ENDIF_272 +label_FALSEIF_271: + # LOCAL local_method7_at_D_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -80($fp) + # IF_ZERO local_method7_at_D_internal_19 GOTO label_FALSE_283 + # IF_ZERO local_method7_at_D_internal_19 GOTO label_FALSE_283 + lw $t0, -80($fp) + beq $t0, 0, label_FALSE_283 + # IF_ZERO local_method7_at_D_x_0 GOTO label_FALSE_283 + # IF_ZERO local_method7_at_D_x_0 GOTO label_FALSE_283 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_283 + # LOCAL local_method7_at_D_internal_18 --> -76($fp) + # LOCAL local_method7_at_D_internal_19 --> -80($fp) + # Comparing -80($fp) type with String + la $v0, String + lw $a0, -80($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -76($fp) + # IF_ZERO local_method7_at_D_internal_18 GOTO label_COMPARE_STRING_286 + # IF_ZERO local_method7_at_D_internal_18 GOTO label_COMPARE_STRING_286 + lw $t0, -76($fp) + beq $t0, 0, label_COMPARE_STRING_286 + # LOCAL local_method7_at_D_internal_18 --> -76($fp) + # LOCAL local_method7_at_D_internal_19 --> -80($fp) + # Comparing -80($fp) type with Bool + la $v0, Bool + lw $a0, -80($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -76($fp) + # IF_ZERO local_method7_at_D_internal_18 GOTO label_COMPARE_BY_VALUE_287 + # IF_ZERO local_method7_at_D_internal_18 GOTO label_COMPARE_BY_VALUE_287 + lw $t0, -76($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_287 + # LOCAL local_method7_at_D_internal_18 --> -76($fp) + # LOCAL local_method7_at_D_internal_19 --> -80($fp) + # Comparing -80($fp) type with Int + la $v0, Int + lw $a0, -80($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -76($fp) + # IF_ZERO local_method7_at_D_internal_18 GOTO label_COMPARE_BY_VALUE_287 + # IF_ZERO local_method7_at_D_internal_18 GOTO label_COMPARE_BY_VALUE_287 + lw $t0, -76($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_287 + # LOCAL local_method7_at_D_internal_18 --> -76($fp) + # LOCAL local_method7_at_D_internal_19 --> -80($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + # Load pointers and SUB + lw $a0, -80($fp) + lw $a1, -4($fp) + sub $a0, $a0, $a1 + sw $a0, -76($fp) + # IF_ZERO local_method7_at_D_internal_18 GOTO label_TRUE_284 + # IF_ZERO local_method7_at_D_internal_18 GOTO label_TRUE_284 + lw $t0, -76($fp) + beq $t0, 0, label_TRUE_284 + # GOTO label_FALSE_283 + j label_FALSE_283 + label_COMPARE_BY_VALUE_287: + # LOCAL local_method7_at_D_internal_18 --> -76($fp) + # LOCAL local_method7_at_D_internal_19 --> -80($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + lw $a0, -80($fp) + lw $a1, -4($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -76($fp) + # IF_ZERO local_method7_at_D_internal_18 GOTO label_TRUE_284 + # IF_ZERO local_method7_at_D_internal_18 GOTO label_TRUE_284 + lw $t0, -76($fp) + beq $t0, 0, label_TRUE_284 + # GOTO label_FALSE_283 + j label_FALSE_283 + label_COMPARE_STRING_286: + # LOCAL local_method7_at_D_internal_18 --> -76($fp) + # LOCAL local_method7_at_D_internal_19 --> -80($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + # Load strings for comparison + lw $v0, -80($fp) + lw $v1, -4($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -76($fp) + # IF_ZERO local_method7_at_D_internal_18 GOTO label_CONTINUE_288 + # IF_ZERO local_method7_at_D_internal_18 GOTO label_CONTINUE_288 + lw $t0, -76($fp) + beq $t0, 0, label_CONTINUE_288 + # GOTO label_FALSE_283 + j label_FALSE_283 + label_CONTINUE_288: + # LOCAL local_method7_at_D_internal_18 --> -76($fp) + # LOCAL local_method7_at_D_internal_19 --> -80($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -80($fp) + lw $v1, -4($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_289: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_290 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_289 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_290: + # Store result + sw $a2, -76($fp) + # IF_ZERO local_method7_at_D_internal_18 GOTO label_TRUE_284 + # IF_ZERO local_method7_at_D_internal_18 GOTO label_TRUE_284 + lw $t0, -76($fp) + beq $t0, 0, label_TRUE_284 + label_FALSE_283: + # LOCAL local_method7_at_D_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -72($fp) + # GOTO label_END_285 +j label_END_285 +label_TRUE_284: + # LOCAL local_method7_at_D_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -72($fp) + label_END_285: +# LOCAL local_method7_at_D_internal_15 --> -64($fp) +# LOCAL local_method7_at_D_internal_17 --> -72($fp) +# Obtain value from -72($fp) +lw $v0, -72($fp) +lw $v0, 12($v0) +sw $v0, -64($fp) +# IF_ZERO local_method7_at_D_internal_15 GOTO label_FALSEIF_281 +# IF_ZERO local_method7_at_D_internal_15 GOTO label_FALSEIF_281 +lw $t0, -64($fp) +beq $t0, 0, label_FALSEIF_281 +# LOCAL local_method7_at_D_internal_20 --> -84($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -84($fp) +# LOCAL local_method7_at_D_internal_16 --> -68($fp) +# LOCAL local_method7_at_D_internal_20 --> -84($fp) +# local_method7_at_D_internal_16 = local_method7_at_D_internal_20 +lw $t0, -84($fp) +sw $t0, -68($fp) +# GOTO label_ENDIF_282 +j label_ENDIF_282 +label_FALSEIF_281: + # LOCAL local_method7_at_D_internal_25 --> -104($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 2 + sw $t0, 12($v0) + sw $v0, -104($fp) + # IF_ZERO local_method7_at_D_internal_25 GOTO label_FALSE_293 + # IF_ZERO local_method7_at_D_internal_25 GOTO label_FALSE_293 + lw $t0, -104($fp) + beq $t0, 0, label_FALSE_293 + # IF_ZERO local_method7_at_D_x_0 GOTO label_FALSE_293 + # IF_ZERO local_method7_at_D_x_0 GOTO label_FALSE_293 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_293 + # LOCAL local_method7_at_D_internal_24 --> -100($fp) + # LOCAL local_method7_at_D_internal_25 --> -104($fp) + # Comparing -104($fp) type with String + la $v0, String + lw $a0, -104($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -100($fp) + # IF_ZERO local_method7_at_D_internal_24 GOTO label_COMPARE_STRING_296 + # IF_ZERO local_method7_at_D_internal_24 GOTO label_COMPARE_STRING_296 + lw $t0, -100($fp) + beq $t0, 0, label_COMPARE_STRING_296 + # LOCAL local_method7_at_D_internal_24 --> -100($fp) + # LOCAL local_method7_at_D_internal_25 --> -104($fp) + # Comparing -104($fp) type with Bool + la $v0, Bool + lw $a0, -104($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -100($fp) + # IF_ZERO local_method7_at_D_internal_24 GOTO label_COMPARE_BY_VALUE_297 + # IF_ZERO local_method7_at_D_internal_24 GOTO label_COMPARE_BY_VALUE_297 + lw $t0, -100($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_297 + # LOCAL local_method7_at_D_internal_24 --> -100($fp) + # LOCAL local_method7_at_D_internal_25 --> -104($fp) + # Comparing -104($fp) type with Int + la $v0, Int + lw $a0, -104($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -100($fp) + # IF_ZERO local_method7_at_D_internal_24 GOTO label_COMPARE_BY_VALUE_297 + # IF_ZERO local_method7_at_D_internal_24 GOTO label_COMPARE_BY_VALUE_297 + lw $t0, -100($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_297 + # LOCAL local_method7_at_D_internal_24 --> -100($fp) + # LOCAL local_method7_at_D_internal_25 --> -104($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + # Load pointers and SUB + lw $a0, -104($fp) + lw $a1, -4($fp) + sub $a0, $a0, $a1 + sw $a0, -100($fp) + # IF_ZERO local_method7_at_D_internal_24 GOTO label_TRUE_294 + # IF_ZERO local_method7_at_D_internal_24 GOTO label_TRUE_294 + lw $t0, -100($fp) + beq $t0, 0, label_TRUE_294 + # GOTO label_FALSE_293 + j label_FALSE_293 + label_COMPARE_BY_VALUE_297: + # LOCAL local_method7_at_D_internal_24 --> -100($fp) + # LOCAL local_method7_at_D_internal_25 --> -104($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + lw $a0, -104($fp) + lw $a1, -4($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -100($fp) + # IF_ZERO local_method7_at_D_internal_24 GOTO label_TRUE_294 + # IF_ZERO local_method7_at_D_internal_24 GOTO label_TRUE_294 + lw $t0, -100($fp) + beq $t0, 0, label_TRUE_294 + # GOTO label_FALSE_293 + j label_FALSE_293 + label_COMPARE_STRING_296: + # LOCAL local_method7_at_D_internal_24 --> -100($fp) + # LOCAL local_method7_at_D_internal_25 --> -104($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + # Load strings for comparison + lw $v0, -104($fp) + lw $v1, -4($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -100($fp) + # IF_ZERO local_method7_at_D_internal_24 GOTO label_CONTINUE_298 + # IF_ZERO local_method7_at_D_internal_24 GOTO label_CONTINUE_298 + lw $t0, -100($fp) + beq $t0, 0, label_CONTINUE_298 + # GOTO label_FALSE_293 + j label_FALSE_293 + label_CONTINUE_298: + # LOCAL local_method7_at_D_internal_24 --> -100($fp) + # LOCAL local_method7_at_D_internal_25 --> -104($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -104($fp) + lw $v1, -4($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_299: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_300 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_299 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_300: + # Store result + sw $a2, -100($fp) + # IF_ZERO local_method7_at_D_internal_24 GOTO label_TRUE_294 + # IF_ZERO local_method7_at_D_internal_24 GOTO label_TRUE_294 + lw $t0, -100($fp) + beq $t0, 0, label_TRUE_294 + label_FALSE_293: + # LOCAL local_method7_at_D_internal_23 --> -96($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -96($fp) + # GOTO label_END_295 +j label_END_295 +label_TRUE_294: + # LOCAL local_method7_at_D_internal_23 --> -96($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -96($fp) + label_END_295: +# LOCAL local_method7_at_D_internal_21 --> -88($fp) +# LOCAL local_method7_at_D_internal_23 --> -96($fp) +# Obtain value from -96($fp) +lw $v0, -96($fp) +lw $v0, 12($v0) +sw $v0, -88($fp) +# IF_ZERO local_method7_at_D_internal_21 GOTO label_FALSEIF_291 +# IF_ZERO local_method7_at_D_internal_21 GOTO label_FALSEIF_291 +lw $t0, -88($fp) +beq $t0, 0, label_FALSEIF_291 +# LOCAL local_method7_at_D_internal_26 --> -108($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -108($fp) +# LOCAL local_method7_at_D_internal_22 --> -92($fp) +# LOCAL local_method7_at_D_internal_26 --> -108($fp) +# local_method7_at_D_internal_22 = local_method7_at_D_internal_26 +lw $t0, -108($fp) +sw $t0, -92($fp) +# GOTO label_ENDIF_292 +j label_ENDIF_292 +label_FALSEIF_291: + # LOCAL local_method7_at_D_internal_29 --> -120($fp) + # local_method7_at_D_internal_29 = SELF + sw $s1, -120($fp) + # LOCAL local_method7_at_D_internal_27 --> -112($fp) + # LOCAL local_method7_at_D_internal_29 --> -120($fp) + # local_method7_at_D_internal_27 = local_method7_at_D_internal_29 + lw $t0, -120($fp) + sw $t0, -112($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_method7_at_D_internal_31 --> -128($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 3 + sw $t0, 12($v0) + sw $v0, -128($fp) + # LOCAL local_method7_at_D_internal_30 --> -124($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + # LOCAL local_method7_at_D_internal_31 --> -128($fp) + # local_method7_at_D_internal_30 = local_method7_at_D_x_0 - local_method7_at_D_internal_31 + lw $t1, -4($fp) + lw $t0, 12($t1) + lw $t1, -128($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -124($fp) + # ARG local_method7_at_D_internal_30 + # LOCAL local_method7_at_D_internal_30 --> -124($fp) + lw $t0, -124($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_method7_at_D_internal_27 --> -112($fp) + # LOCAL local_method7_at_D_internal_28 --> -116($fp) + # local_method7_at_D_internal_28 = VCALL local_method7_at_D_internal_27 method7 + # Save new self pointer in $s1 + lw $s1, -112($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -116($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_method7_at_D_internal_22 --> -92($fp) + # LOCAL local_method7_at_D_internal_28 --> -116($fp) + # local_method7_at_D_internal_22 = local_method7_at_D_internal_28 + lw $t0, -116($fp) + sw $t0, -92($fp) + label_ENDIF_292: +# LOCAL local_method7_at_D_internal_16 --> -68($fp) +# LOCAL local_method7_at_D_internal_22 --> -92($fp) +# local_method7_at_D_internal_16 = local_method7_at_D_internal_22 +lw $t0, -92($fp) +sw $t0, -68($fp) +label_ENDIF_282: +# LOCAL local_method7_at_D_internal_10 --> -44($fp) +# LOCAL local_method7_at_D_internal_16 --> -68($fp) +# local_method7_at_D_internal_10 = local_method7_at_D_internal_16 +lw $t0, -68($fp) +sw $t0, -44($fp) +label_ENDIF_272: +# LOCAL local_method7_at_D_internal_2 --> -12($fp) +# LOCAL local_method7_at_D_internal_10 --> -44($fp) +# local_method7_at_D_internal_2 = local_method7_at_D_internal_10 +lw $t0, -44($fp) +sw $t0, -12($fp) +label_ENDIF_268: +# RETURN local_method7_at_D_internal_2 +lw $v0, -12($fp) +# Deallocate stack frame for function function_method7_at_D. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 136 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_method6_at_E implementation. +# @Params: +# 0($fp) = param_method6_at_E_num_0 +function_method6_at_E: + # Allocate stack frame for function function_method6_at_E. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_method6_at_E_x_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_method6_at_E_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 8 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_method6_at_E_internal_1 --> -8($fp) + # PARAM param_method6_at_E_num_0 --> 0($fp) + # LOCAL local_method6_at_E_internal_2 --> -12($fp) + # local_method6_at_E_internal_1 = PARAM param_method6_at_E_num_0 / local_method6_at_E_internal_2 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -12($fp) + lw $t2, 12($t1) + div $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_method6_at_E_x_0 --> -4($fp) + # LOCAL local_method6_at_E_internal_1 --> -8($fp) + # local_method6_at_E_x_0 = local_method6_at_E_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_method6_at_E_internal_5 --> -24($fp) + # local_method6_at_E_internal_5 = ALLOCATE A + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, A + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, A_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -24($fp) + # LOCAL local_method6_at_E_internal_3 --> -16($fp) + # LOCAL local_method6_at_E_internal_5 --> -24($fp) + # local_method6_at_E_internal_3 = local_method6_at_E_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_method6_at_E_x_0 + # LOCAL local_method6_at_E_x_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_method6_at_E_internal_3 --> -16($fp) + # LOCAL local_method6_at_E_internal_4 --> -20($fp) + # local_method6_at_E_internal_4 = VCALL local_method6_at_E_internal_3 set_var + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_method6_at_E_internal_4 + lw $v0, -20($fp) + # Deallocate stack frame for function function_method6_at_E. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_method6_at_C implementation. +# @Params: +# 0($fp) = param_method6_at_C_num_0 +function_method6_at_C: + # Allocate stack frame for function function_method6_at_C. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_method6_at_C_x_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_method6_at_C_internal_1 --> -8($fp) + # PARAM param_method6_at_C_num_0 --> 0($fp) + lw $t0, 0($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -8($fp) + # LOCAL local_method6_at_C_internal_1 --> -8($fp) + # LOCAL local_method6_at_C_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -8($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_method6_at_C_x_0 --> -4($fp) + # LOCAL local_method6_at_C_internal_1 --> -8($fp) + # local_method6_at_C_x_0 = local_method6_at_C_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_method6_at_C_internal_4 --> -20($fp) + # local_method6_at_C_internal_4 = ALLOCATE A + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, A + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, A_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -20($fp) + # LOCAL local_method6_at_C_internal_2 --> -12($fp) + # LOCAL local_method6_at_C_internal_4 --> -20($fp) + # local_method6_at_C_internal_2 = local_method6_at_C_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_method6_at_C_x_0 + # LOCAL local_method6_at_C_x_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_method6_at_C_internal_2 --> -12($fp) + # LOCAL local_method6_at_C_internal_3 --> -16($fp) + # local_method6_at_C_internal_3 = VCALL local_method6_at_C_internal_2 set_var + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_method6_at_C_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_method6_at_C. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_method5_at_C implementation. +# @Params: +# 0($fp) = param_method5_at_C_num_0 +function_method5_at_C: + # Allocate stack frame for function function_method5_at_C. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_method5_at_C_x_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_method5_at_C_internal_2 --> -12($fp) + # PARAM param_method5_at_C_num_0 --> 0($fp) + # PARAM param_method5_at_C_num_0 --> 0($fp) + # local_method5_at_C_internal_2 = PARAM param_method5_at_C_num_0 * PARAM param_method5_at_C_num_0 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, 0($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_method5_at_C_internal_1 --> -8($fp) + # LOCAL local_method5_at_C_internal_2 --> -12($fp) + # PARAM param_method5_at_C_num_0 --> 0($fp) + # local_method5_at_C_internal_1 = local_method5_at_C_internal_2 * PARAM param_method5_at_C_num_0 + lw $t1, -12($fp) + lw $t0, 12($t1) + lw $t1, 0($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_method5_at_C_x_0 --> -4($fp) + # LOCAL local_method5_at_C_internal_1 --> -8($fp) + # local_method5_at_C_x_0 = local_method5_at_C_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_method5_at_C_internal_5 --> -24($fp) + # local_method5_at_C_internal_5 = ALLOCATE E + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, E + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, E_start + sw $t0, 4($v0) + # Load type offset + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -24($fp) + # LOCAL local_method5_at_C_internal_3 --> -16($fp) + # LOCAL local_method5_at_C_internal_5 --> -24($fp) + # local_method5_at_C_internal_3 = local_method5_at_C_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_method5_at_C_x_0 + # LOCAL local_method5_at_C_x_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_method5_at_C_internal_3 --> -16($fp) + # LOCAL local_method5_at_C_internal_4 --> -20($fp) + # local_method5_at_C_internal_4 = VCALL local_method5_at_C_internal_3 set_var + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_method5_at_C_internal_4 + lw $v0, -20($fp) + # Deallocate stack frame for function function_method5_at_C. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# __Main__attrib__char__init implementation. +# @Params: +__Main__attrib__char__init: + # Allocate stack frame for function __Main__attrib__char__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__char__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__char__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__char__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__avar__init implementation. +# @Params: +__Main__attrib__avar__init: + # Allocate stack frame for function __Main__attrib__avar__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__avar__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__a_var__init implementation. +# @Params: +__Main__attrib__a_var__init: + # Allocate stack frame for function __Main__attrib__a_var__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__a_var__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__flag__init implementation. +# @Params: +__Main__attrib__flag__init: + # Allocate stack frame for function __Main__attrib__flag__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__flag__init_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_ttrib__flag__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Main__attrib__flag__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_menu_at_Main implementation. +# @Params: +function_menu_at_Main: + # Allocate stack frame for function function_menu_at_Main. + subu $sp, $sp, 436 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 436 + # LOCAL local_menu_at_Main_internal_2 --> -12($fp) + # local_menu_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_menu_at_Main_internal_0 --> -4($fp) + # LOCAL local_menu_at_Main_internal_2 --> -12($fp) + # local_menu_at_Main_internal_0 = local_menu_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_30 + sw $t0, 12($v0) + li $t0, 22 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_menu_at_Main_internal_3 + # LOCAL local_menu_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_0 --> -4($fp) + # LOCAL local_menu_at_Main_internal_1 --> -8($fp) + # local_menu_at_Main_internal_1 = VCALL local_menu_at_Main_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_6 --> -28($fp) + # local_menu_at_Main_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_menu_at_Main_internal_4 --> -20($fp) + # LOCAL local_menu_at_Main_internal_6 --> -28($fp) + # local_menu_at_Main_internal_4 = local_menu_at_Main_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_menu_at_Main_internal_7 = GETATTRIBUTE avar Main + # LOCAL local_menu_at_Main_internal_7 --> -32($fp) + lw $t0, 16($s1) + sw $t0, -32($fp) + # ARG local_menu_at_Main_internal_7 + # LOCAL local_menu_at_Main_internal_7 --> -32($fp) + lw $t0, -32($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_4 --> -20($fp) + # LOCAL local_menu_at_Main_internal_5 --> -24($fp) + # local_menu_at_Main_internal_5 = VCALL local_menu_at_Main_internal_4 print + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_10 --> -44($fp) + # local_menu_at_Main_internal_10 = SELF + sw $s1, -44($fp) + # LOCAL local_menu_at_Main_internal_8 --> -36($fp) + # LOCAL local_menu_at_Main_internal_10 --> -44($fp) + # local_menu_at_Main_internal_8 = local_menu_at_Main_internal_10 + lw $t0, -44($fp) + sw $t0, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_31 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -48($fp) + # ARG local_menu_at_Main_internal_11 + # LOCAL local_menu_at_Main_internal_11 --> -48($fp) + lw $t0, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_8 --> -36($fp) + # LOCAL local_menu_at_Main_internal_9 --> -40($fp) + # local_menu_at_Main_internal_9 = VCALL local_menu_at_Main_internal_8 out_string + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_14 --> -60($fp) + # local_menu_at_Main_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_menu_at_Main_internal_12 --> -52($fp) + # LOCAL local_menu_at_Main_internal_14 --> -60($fp) + # local_menu_at_Main_internal_12 = local_menu_at_Main_internal_14 + lw $t0, -60($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_32 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -64($fp) + # ARG local_menu_at_Main_internal_15 + # LOCAL local_menu_at_Main_internal_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_12 --> -52($fp) + # LOCAL local_menu_at_Main_internal_13 --> -56($fp) + # local_menu_at_Main_internal_13 = VCALL local_menu_at_Main_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_18 --> -76($fp) + # local_menu_at_Main_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_menu_at_Main_internal_16 --> -68($fp) + # LOCAL local_menu_at_Main_internal_18 --> -76($fp) + # local_menu_at_Main_internal_16 = local_menu_at_Main_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_menu_at_Main_internal_19 = GETATTRIBUTE avar Main + # LOCAL local_menu_at_Main_internal_19 --> -80($fp) + lw $t0, 16($s1) + sw $t0, -80($fp) + # ARG local_menu_at_Main_internal_19 + # LOCAL local_menu_at_Main_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_16 --> -68($fp) + # LOCAL local_menu_at_Main_internal_17 --> -72($fp) + # local_menu_at_Main_internal_17 = VCALL local_menu_at_Main_internal_16 print + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_22 --> -92($fp) + # local_menu_at_Main_internal_22 = SELF + sw $s1, -92($fp) + # LOCAL local_menu_at_Main_internal_20 --> -84($fp) + # LOCAL local_menu_at_Main_internal_22 --> -92($fp) + # local_menu_at_Main_internal_20 = local_menu_at_Main_internal_22 + lw $t0, -92($fp) + sw $t0, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_23 --> -96($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_33 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -96($fp) + # ARG local_menu_at_Main_internal_23 + # LOCAL local_menu_at_Main_internal_23 --> -96($fp) + lw $t0, -96($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_20 --> -84($fp) + # LOCAL local_menu_at_Main_internal_21 --> -88($fp) + # local_menu_at_Main_internal_21 = VCALL local_menu_at_Main_internal_20 out_string + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_26 --> -108($fp) + # local_menu_at_Main_internal_26 = SELF + sw $s1, -108($fp) + # LOCAL local_menu_at_Main_internal_24 --> -100($fp) + # LOCAL local_menu_at_Main_internal_26 --> -108($fp) + # local_menu_at_Main_internal_24 = local_menu_at_Main_internal_26 + lw $t0, -108($fp) + sw $t0, -100($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_27 --> -112($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_34 + sw $t0, 12($v0) + li $t0, 33 + sw $t0, 16($v0) + sw $v0, -112($fp) + # ARG local_menu_at_Main_internal_27 + # LOCAL local_menu_at_Main_internal_27 --> -112($fp) + lw $t0, -112($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_24 --> -100($fp) + # LOCAL local_menu_at_Main_internal_25 --> -104($fp) + # local_menu_at_Main_internal_25 = VCALL local_menu_at_Main_internal_24 out_string + # Save new self pointer in $s1 + lw $s1, -100($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -104($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_30 --> -124($fp) + # local_menu_at_Main_internal_30 = SELF + sw $s1, -124($fp) + # LOCAL local_menu_at_Main_internal_28 --> -116($fp) + # LOCAL local_menu_at_Main_internal_30 --> -124($fp) + # local_menu_at_Main_internal_28 = local_menu_at_Main_internal_30 + lw $t0, -124($fp) + sw $t0, -116($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_menu_at_Main_internal_31 = GETATTRIBUTE avar Main + # LOCAL local_menu_at_Main_internal_31 --> -128($fp) + lw $t0, 16($s1) + sw $t0, -128($fp) + # ARG local_menu_at_Main_internal_31 + # LOCAL local_menu_at_Main_internal_31 --> -128($fp) + lw $t0, -128($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_28 --> -116($fp) + # LOCAL local_menu_at_Main_internal_29 --> -120($fp) + # local_menu_at_Main_internal_29 = VCALL local_menu_at_Main_internal_28 print + # Save new self pointer in $s1 + lw $s1, -116($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -120($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_34 --> -140($fp) + # local_menu_at_Main_internal_34 = SELF + sw $s1, -140($fp) + # LOCAL local_menu_at_Main_internal_32 --> -132($fp) + # LOCAL local_menu_at_Main_internal_34 --> -140($fp) + # local_menu_at_Main_internal_32 = local_menu_at_Main_internal_34 + lw $t0, -140($fp) + sw $t0, -132($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_35 --> -144($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_35 + sw $t0, 12($v0) + li $t0, 30 + sw $t0, 16($v0) + sw $v0, -144($fp) + # ARG local_menu_at_Main_internal_35 + # LOCAL local_menu_at_Main_internal_35 --> -144($fp) + lw $t0, -144($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_32 --> -132($fp) + # LOCAL local_menu_at_Main_internal_33 --> -136($fp) + # local_menu_at_Main_internal_33 = VCALL local_menu_at_Main_internal_32 out_string + # Save new self pointer in $s1 + lw $s1, -132($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -136($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_38 --> -156($fp) + # local_menu_at_Main_internal_38 = SELF + sw $s1, -156($fp) + # LOCAL local_menu_at_Main_internal_36 --> -148($fp) + # LOCAL local_menu_at_Main_internal_38 --> -156($fp) + # local_menu_at_Main_internal_36 = local_menu_at_Main_internal_38 + lw $t0, -156($fp) + sw $t0, -148($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_39 --> -160($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_36 + sw $t0, 12($v0) + li $t0, 27 + sw $t0, 16($v0) + sw $v0, -160($fp) + # ARG local_menu_at_Main_internal_39 + # LOCAL local_menu_at_Main_internal_39 --> -160($fp) + lw $t0, -160($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_36 --> -148($fp) + # LOCAL local_menu_at_Main_internal_37 --> -152($fp) + # local_menu_at_Main_internal_37 = VCALL local_menu_at_Main_internal_36 out_string + # Save new self pointer in $s1 + lw $s1, -148($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -152($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_42 --> -172($fp) + # local_menu_at_Main_internal_42 = SELF + sw $s1, -172($fp) + # LOCAL local_menu_at_Main_internal_40 --> -164($fp) + # LOCAL local_menu_at_Main_internal_42 --> -172($fp) + # local_menu_at_Main_internal_40 = local_menu_at_Main_internal_42 + lw $t0, -172($fp) + sw $t0, -164($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_menu_at_Main_internal_43 = GETATTRIBUTE avar Main + # LOCAL local_menu_at_Main_internal_43 --> -176($fp) + lw $t0, 16($s1) + sw $t0, -176($fp) + # ARG local_menu_at_Main_internal_43 + # LOCAL local_menu_at_Main_internal_43 --> -176($fp) + lw $t0, -176($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_40 --> -164($fp) + # LOCAL local_menu_at_Main_internal_41 --> -168($fp) + # local_menu_at_Main_internal_41 = VCALL local_menu_at_Main_internal_40 print + # Save new self pointer in $s1 + lw $s1, -164($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -168($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_46 --> -188($fp) + # local_menu_at_Main_internal_46 = SELF + sw $s1, -188($fp) + # LOCAL local_menu_at_Main_internal_44 --> -180($fp) + # LOCAL local_menu_at_Main_internal_46 --> -188($fp) + # local_menu_at_Main_internal_44 = local_menu_at_Main_internal_46 + lw $t0, -188($fp) + sw $t0, -180($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_47 --> -192($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_37 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -192($fp) + # ARG local_menu_at_Main_internal_47 + # LOCAL local_menu_at_Main_internal_47 --> -192($fp) + lw $t0, -192($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_44 --> -180($fp) + # LOCAL local_menu_at_Main_internal_45 --> -184($fp) + # local_menu_at_Main_internal_45 = VCALL local_menu_at_Main_internal_44 out_string + # Save new self pointer in $s1 + lw $s1, -180($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -184($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_50 --> -204($fp) + # local_menu_at_Main_internal_50 = SELF + sw $s1, -204($fp) + # LOCAL local_menu_at_Main_internal_48 --> -196($fp) + # LOCAL local_menu_at_Main_internal_50 --> -204($fp) + # local_menu_at_Main_internal_48 = local_menu_at_Main_internal_50 + lw $t0, -204($fp) + sw $t0, -196($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_51 --> -208($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_38 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -208($fp) + # ARG local_menu_at_Main_internal_51 + # LOCAL local_menu_at_Main_internal_51 --> -208($fp) + lw $t0, -208($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_48 --> -196($fp) + # LOCAL local_menu_at_Main_internal_49 --> -200($fp) + # local_menu_at_Main_internal_49 = VCALL local_menu_at_Main_internal_48 out_string + # Save new self pointer in $s1 + lw $s1, -196($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -200($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_54 --> -220($fp) + # local_menu_at_Main_internal_54 = SELF + sw $s1, -220($fp) + # LOCAL local_menu_at_Main_internal_52 --> -212($fp) + # LOCAL local_menu_at_Main_internal_54 --> -220($fp) + # local_menu_at_Main_internal_52 = local_menu_at_Main_internal_54 + lw $t0, -220($fp) + sw $t0, -212($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_menu_at_Main_internal_55 = GETATTRIBUTE avar Main + # LOCAL local_menu_at_Main_internal_55 --> -224($fp) + lw $t0, 16($s1) + sw $t0, -224($fp) + # ARG local_menu_at_Main_internal_55 + # LOCAL local_menu_at_Main_internal_55 --> -224($fp) + lw $t0, -224($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_52 --> -212($fp) + # LOCAL local_menu_at_Main_internal_53 --> -216($fp) + # local_menu_at_Main_internal_53 = VCALL local_menu_at_Main_internal_52 print + # Save new self pointer in $s1 + lw $s1, -212($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -216($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_58 --> -236($fp) + # local_menu_at_Main_internal_58 = SELF + sw $s1, -236($fp) + # LOCAL local_menu_at_Main_internal_56 --> -228($fp) + # LOCAL local_menu_at_Main_internal_58 --> -236($fp) + # local_menu_at_Main_internal_56 = local_menu_at_Main_internal_58 + lw $t0, -236($fp) + sw $t0, -228($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_59 --> -240($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_39 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -240($fp) + # ARG local_menu_at_Main_internal_59 + # LOCAL local_menu_at_Main_internal_59 --> -240($fp) + lw $t0, -240($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_56 --> -228($fp) + # LOCAL local_menu_at_Main_internal_57 --> -232($fp) + # local_menu_at_Main_internal_57 = VCALL local_menu_at_Main_internal_56 out_string + # Save new self pointer in $s1 + lw $s1, -228($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -232($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_62 --> -252($fp) + # local_menu_at_Main_internal_62 = SELF + sw $s1, -252($fp) + # LOCAL local_menu_at_Main_internal_60 --> -244($fp) + # LOCAL local_menu_at_Main_internal_62 --> -252($fp) + # local_menu_at_Main_internal_60 = local_menu_at_Main_internal_62 + lw $t0, -252($fp) + sw $t0, -244($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_63 --> -256($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_40 + sw $t0, 12($v0) + li $t0, 10 + sw $t0, 16($v0) + sw $v0, -256($fp) + # ARG local_menu_at_Main_internal_63 + # LOCAL local_menu_at_Main_internal_63 --> -256($fp) + lw $t0, -256($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_60 --> -244($fp) + # LOCAL local_menu_at_Main_internal_61 --> -248($fp) + # local_menu_at_Main_internal_61 = VCALL local_menu_at_Main_internal_60 out_string + # Save new self pointer in $s1 + lw $s1, -244($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -248($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_66 --> -268($fp) + # local_menu_at_Main_internal_66 = SELF + sw $s1, -268($fp) + # LOCAL local_menu_at_Main_internal_64 --> -260($fp) + # LOCAL local_menu_at_Main_internal_66 --> -268($fp) + # local_menu_at_Main_internal_64 = local_menu_at_Main_internal_66 + lw $t0, -268($fp) + sw $t0, -260($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_menu_at_Main_internal_67 = GETATTRIBUTE avar Main + # LOCAL local_menu_at_Main_internal_67 --> -272($fp) + lw $t0, 16($s1) + sw $t0, -272($fp) + # ARG local_menu_at_Main_internal_67 + # LOCAL local_menu_at_Main_internal_67 --> -272($fp) + lw $t0, -272($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_64 --> -260($fp) + # LOCAL local_menu_at_Main_internal_65 --> -264($fp) + # local_menu_at_Main_internal_65 = VCALL local_menu_at_Main_internal_64 print + # Save new self pointer in $s1 + lw $s1, -260($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -264($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_70 --> -284($fp) + # local_menu_at_Main_internal_70 = SELF + sw $s1, -284($fp) + # LOCAL local_menu_at_Main_internal_68 --> -276($fp) + # LOCAL local_menu_at_Main_internal_70 --> -284($fp) + # local_menu_at_Main_internal_68 = local_menu_at_Main_internal_70 + lw $t0, -284($fp) + sw $t0, -276($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_71 --> -288($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_41 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -288($fp) + # ARG local_menu_at_Main_internal_71 + # LOCAL local_menu_at_Main_internal_71 --> -288($fp) + lw $t0, -288($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_68 --> -276($fp) + # LOCAL local_menu_at_Main_internal_69 --> -280($fp) + # local_menu_at_Main_internal_69 = VCALL local_menu_at_Main_internal_68 out_string + # Save new self pointer in $s1 + lw $s1, -276($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -280($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_74 --> -300($fp) + # local_menu_at_Main_internal_74 = SELF + sw $s1, -300($fp) + # LOCAL local_menu_at_Main_internal_72 --> -292($fp) + # LOCAL local_menu_at_Main_internal_74 --> -300($fp) + # local_menu_at_Main_internal_72 = local_menu_at_Main_internal_74 + lw $t0, -300($fp) + sw $t0, -292($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_75 --> -304($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_42 + sw $t0, 12($v0) + li $t0, 17 + sw $t0, 16($v0) + sw $v0, -304($fp) + # ARG local_menu_at_Main_internal_75 + # LOCAL local_menu_at_Main_internal_75 --> -304($fp) + lw $t0, -304($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_72 --> -292($fp) + # LOCAL local_menu_at_Main_internal_73 --> -296($fp) + # local_menu_at_Main_internal_73 = VCALL local_menu_at_Main_internal_72 out_string + # Save new self pointer in $s1 + lw $s1, -292($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -296($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_78 --> -316($fp) + # local_menu_at_Main_internal_78 = SELF + sw $s1, -316($fp) + # LOCAL local_menu_at_Main_internal_76 --> -308($fp) + # LOCAL local_menu_at_Main_internal_78 --> -316($fp) + # local_menu_at_Main_internal_76 = local_menu_at_Main_internal_78 + lw $t0, -316($fp) + sw $t0, -308($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_menu_at_Main_internal_79 = GETATTRIBUTE avar Main + # LOCAL local_menu_at_Main_internal_79 --> -320($fp) + lw $t0, 16($s1) + sw $t0, -320($fp) + # ARG local_menu_at_Main_internal_79 + # LOCAL local_menu_at_Main_internal_79 --> -320($fp) + lw $t0, -320($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_76 --> -308($fp) + # LOCAL local_menu_at_Main_internal_77 --> -312($fp) + # local_menu_at_Main_internal_77 = VCALL local_menu_at_Main_internal_76 print + # Save new self pointer in $s1 + lw $s1, -308($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -312($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_82 --> -332($fp) + # local_menu_at_Main_internal_82 = SELF + sw $s1, -332($fp) + # LOCAL local_menu_at_Main_internal_80 --> -324($fp) + # LOCAL local_menu_at_Main_internal_82 --> -332($fp) + # local_menu_at_Main_internal_80 = local_menu_at_Main_internal_82 + lw $t0, -332($fp) + sw $t0, -324($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_83 --> -336($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_43 + sw $t0, 12($v0) + li $t0, 30 + sw $t0, 16($v0) + sw $v0, -336($fp) + # ARG local_menu_at_Main_internal_83 + # LOCAL local_menu_at_Main_internal_83 --> -336($fp) + lw $t0, -336($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_80 --> -324($fp) + # LOCAL local_menu_at_Main_internal_81 --> -328($fp) + # local_menu_at_Main_internal_81 = VCALL local_menu_at_Main_internal_80 out_string + # Save new self pointer in $s1 + lw $s1, -324($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -328($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_86 --> -348($fp) + # local_menu_at_Main_internal_86 = SELF + sw $s1, -348($fp) + # LOCAL local_menu_at_Main_internal_84 --> -340($fp) + # LOCAL local_menu_at_Main_internal_86 --> -348($fp) + # local_menu_at_Main_internal_84 = local_menu_at_Main_internal_86 + lw $t0, -348($fp) + sw $t0, -340($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_87 --> -352($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_44 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -352($fp) + # ARG local_menu_at_Main_internal_87 + # LOCAL local_menu_at_Main_internal_87 --> -352($fp) + lw $t0, -352($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_84 --> -340($fp) + # LOCAL local_menu_at_Main_internal_85 --> -344($fp) + # local_menu_at_Main_internal_85 = VCALL local_menu_at_Main_internal_84 out_string + # Save new self pointer in $s1 + lw $s1, -340($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -344($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_90 --> -364($fp) + # local_menu_at_Main_internal_90 = SELF + sw $s1, -364($fp) + # LOCAL local_menu_at_Main_internal_88 --> -356($fp) + # LOCAL local_menu_at_Main_internal_90 --> -364($fp) + # local_menu_at_Main_internal_88 = local_menu_at_Main_internal_90 + lw $t0, -364($fp) + sw $t0, -356($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_menu_at_Main_internal_91 = GETATTRIBUTE avar Main + # LOCAL local_menu_at_Main_internal_91 --> -368($fp) + lw $t0, 16($s1) + sw $t0, -368($fp) + # ARG local_menu_at_Main_internal_91 + # LOCAL local_menu_at_Main_internal_91 --> -368($fp) + lw $t0, -368($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_88 --> -356($fp) + # LOCAL local_menu_at_Main_internal_89 --> -360($fp) + # local_menu_at_Main_internal_89 = VCALL local_menu_at_Main_internal_88 print + # Save new self pointer in $s1 + lw $s1, -356($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -360($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_94 --> -380($fp) + # local_menu_at_Main_internal_94 = SELF + sw $s1, -380($fp) + # LOCAL local_menu_at_Main_internal_92 --> -372($fp) + # LOCAL local_menu_at_Main_internal_94 --> -380($fp) + # local_menu_at_Main_internal_92 = local_menu_at_Main_internal_94 + lw $t0, -380($fp) + sw $t0, -372($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_95 --> -384($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_45 + sw $t0, 12($v0) + li $t0, 16 + sw $t0, 16($v0) + sw $v0, -384($fp) + # ARG local_menu_at_Main_internal_95 + # LOCAL local_menu_at_Main_internal_95 --> -384($fp) + lw $t0, -384($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_92 --> -372($fp) + # LOCAL local_menu_at_Main_internal_93 --> -376($fp) + # local_menu_at_Main_internal_93 = VCALL local_menu_at_Main_internal_92 out_string + # Save new self pointer in $s1 + lw $s1, -372($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -376($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_98 --> -396($fp) + # local_menu_at_Main_internal_98 = SELF + sw $s1, -396($fp) + # LOCAL local_menu_at_Main_internal_96 --> -388($fp) + # LOCAL local_menu_at_Main_internal_98 --> -396($fp) + # local_menu_at_Main_internal_96 = local_menu_at_Main_internal_98 + lw $t0, -396($fp) + sw $t0, -388($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_99 --> -400($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_46 + sw $t0, 12($v0) + li $t0, 33 + sw $t0, 16($v0) + sw $v0, -400($fp) + # ARG local_menu_at_Main_internal_99 + # LOCAL local_menu_at_Main_internal_99 --> -400($fp) + lw $t0, -400($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_96 --> -388($fp) + # LOCAL local_menu_at_Main_internal_97 --> -392($fp) + # local_menu_at_Main_internal_97 = VCALL local_menu_at_Main_internal_96 out_string + # Save new self pointer in $s1 + lw $s1, -388($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -392($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_102 --> -412($fp) + # local_menu_at_Main_internal_102 = SELF + sw $s1, -412($fp) + # LOCAL local_menu_at_Main_internal_100 --> -404($fp) + # LOCAL local_menu_at_Main_internal_102 --> -412($fp) + # local_menu_at_Main_internal_100 = local_menu_at_Main_internal_102 + lw $t0, -412($fp) + sw $t0, -404($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_103 --> -416($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_47 + sw $t0, 12($v0) + li $t0, 22 + sw $t0, 16($v0) + sw $v0, -416($fp) + # ARG local_menu_at_Main_internal_103 + # LOCAL local_menu_at_Main_internal_103 --> -416($fp) + lw $t0, -416($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_100 --> -404($fp) + # LOCAL local_menu_at_Main_internal_101 --> -408($fp) + # local_menu_at_Main_internal_101 = VCALL local_menu_at_Main_internal_100 out_string + # Save new self pointer in $s1 + lw $s1, -404($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -408($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_106 --> -428($fp) + # local_menu_at_Main_internal_106 = SELF + sw $s1, -428($fp) + # LOCAL local_menu_at_Main_internal_104 --> -420($fp) + # LOCAL local_menu_at_Main_internal_106 --> -428($fp) + # local_menu_at_Main_internal_104 = local_menu_at_Main_internal_106 + lw $t0, -428($fp) + sw $t0, -420($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_104 --> -420($fp) + # LOCAL local_menu_at_Main_internal_105 --> -424($fp) + # local_menu_at_Main_internal_105 = VCALL local_menu_at_Main_internal_104 in_string + # Save new self pointer in $s1 + lw $s1, -420($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -424($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_menu_at_Main_internal_105 + lw $v0, -424($fp) + # Deallocate stack frame for function function_menu_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 436 + jr $ra + # Function END + + +# function_prompt_at_Main implementation. +# @Params: +function_prompt_at_Main: + # Allocate stack frame for function function_prompt_at_Main. + subu $sp, $sp, 52 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 52 + # LOCAL local_prompt_at_Main_internal_2 --> -12($fp) + # local_prompt_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_prompt_at_Main_internal_0 --> -4($fp) + # LOCAL local_prompt_at_Main_internal_2 --> -12($fp) + # local_prompt_at_Main_internal_0 = local_prompt_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_Main_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_48 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_prompt_at_Main_internal_3 + # LOCAL local_prompt_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_prompt_at_Main_internal_0 --> -4($fp) + # LOCAL local_prompt_at_Main_internal_1 --> -8($fp) + # local_prompt_at_Main_internal_1 = VCALL local_prompt_at_Main_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt_at_Main_internal_6 --> -28($fp) + # local_prompt_at_Main_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_prompt_at_Main_internal_4 --> -20($fp) + # LOCAL local_prompt_at_Main_internal_6 --> -28($fp) + # local_prompt_at_Main_internal_4 = local_prompt_at_Main_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_Main_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_49 + sw $t0, 12($v0) + li $t0, 26 + sw $t0, 16($v0) + sw $v0, -32($fp) + # ARG local_prompt_at_Main_internal_7 + # LOCAL local_prompt_at_Main_internal_7 --> -32($fp) + lw $t0, -32($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_prompt_at_Main_internal_4 --> -20($fp) + # LOCAL local_prompt_at_Main_internal_5 --> -24($fp) + # local_prompt_at_Main_internal_5 = VCALL local_prompt_at_Main_internal_4 out_string + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt_at_Main_internal_10 --> -44($fp) + # local_prompt_at_Main_internal_10 = SELF + sw $s1, -44($fp) + # LOCAL local_prompt_at_Main_internal_8 --> -36($fp) + # LOCAL local_prompt_at_Main_internal_10 --> -44($fp) + # local_prompt_at_Main_internal_8 = local_prompt_at_Main_internal_10 + lw $t0, -44($fp) + sw $t0, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_Main_internal_8 --> -36($fp) + # LOCAL local_prompt_at_Main_internal_9 --> -40($fp) + # local_prompt_at_Main_internal_9 = VCALL local_prompt_at_Main_internal_8 in_string + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_prompt_at_Main_internal_9 + lw $v0, -40($fp) + # Deallocate stack frame for function function_prompt_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 52 + jr $ra + # Function END + + +# function_get_int_at_Main implementation. +# @Params: +function_get_int_at_Main: + # Allocate stack frame for function function_get_int_at_Main. + subu $sp, $sp, 40 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 40 + # LOCAL local_get_int_at_Main_z_0 --> -4($fp) + # local_get_int_at_Main_z_0 = ALLOCATE A2I + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, A2I + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, A2I_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local_get_int_at_Main_internal_1 --> -8($fp) + # local_get_int_at_Main_internal_1 = ALLOCATE A2I + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, A2I + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, A2I_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # LOCAL local_get_int_at_Main_z_0 --> -4($fp) + # LOCAL local_get_int_at_Main_internal_1 --> -8($fp) + # local_get_int_at_Main_z_0 = local_get_int_at_Main_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_get_int_at_Main_s_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -12($fp) + # LOCAL local_get_int_at_Main_internal_5 --> -24($fp) + # local_get_int_at_Main_internal_5 = SELF + sw $s1, -24($fp) + # LOCAL local_get_int_at_Main_internal_3 --> -16($fp) + # LOCAL local_get_int_at_Main_internal_5 --> -24($fp) + # local_get_int_at_Main_internal_3 = local_get_int_at_Main_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_get_int_at_Main_internal_3 --> -16($fp) + # LOCAL local_get_int_at_Main_internal_4 --> -20($fp) + # local_get_int_at_Main_internal_4 = VCALL local_get_int_at_Main_internal_3 prompt + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_get_int_at_Main_s_2 --> -12($fp) + # LOCAL local_get_int_at_Main_internal_4 --> -20($fp) + # local_get_int_at_Main_s_2 = local_get_int_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # LOCAL local_get_int_at_Main_internal_6 --> -28($fp) + # LOCAL local_get_int_at_Main_z_0 --> -4($fp) + # local_get_int_at_Main_internal_6 = local_get_int_at_Main_z_0 + lw $t0, -4($fp) + sw $t0, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_get_int_at_Main_s_2 + # LOCAL local_get_int_at_Main_s_2 --> -12($fp) + lw $t0, -12($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_get_int_at_Main_internal_6 --> -28($fp) + # LOCAL local_get_int_at_Main_internal_7 --> -32($fp) + # local_get_int_at_Main_internal_7 = VCALL local_get_int_at_Main_internal_6 a2i + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_get_int_at_Main_internal_7 + lw $v0, -32($fp) + # Deallocate stack frame for function function_get_int_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 40 + jr $ra + # Function END + + +# function_is_even_at_Main implementation. +# @Params: +# 0($fp) = param_is_even_at_Main_num_0 +function_is_even_at_Main: + # Allocate stack frame for function function_is_even_at_Main. + subu $sp, $sp, 112 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 112 + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + # PARAM param_is_even_at_Main_num_0 --> 0($fp) + # local_is_even_at_Main_x_0 = PARAM param_is_even_at_Main_num_0 + lw $t0, 0($fp) + sw $t0, -4($fp) + # LOCAL local_is_even_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # LOCAL local_is_even_at_Main_internal_3 --> -16($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + # LOCAL local_is_even_at_Main_internal_4 --> -20($fp) + lw $a0, -4($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_GREATER_ZERO local_is_even_at_Main_internal_3 GOTO label_FALSE_303 + # IF_GREATER_ZERO local_is_even_at_Main_internal_3 GOTO label_FALSE_303 + lw $t0, -16($fp) + bgt $t0, 0, label_FALSE_303 + # IF_ZERO local_is_even_at_Main_internal_3 GOTO label_FALSE_303 + # IF_ZERO local_is_even_at_Main_internal_3 GOTO label_FALSE_303 + lw $t0, -16($fp) + beq $t0, 0, label_FALSE_303 + # LOCAL local_is_even_at_Main_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -16($fp) + # GOTO label_END_304 +j label_END_304 +label_FALSE_303: + # LOCAL local_is_even_at_Main_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -16($fp) + label_END_304: +# LOCAL local_is_even_at_Main_internal_1 --> -8($fp) +# LOCAL local_is_even_at_Main_internal_3 --> -16($fp) +# Obtain value from -16($fp) +lw $v0, -16($fp) +lw $v0, 12($v0) +sw $v0, -8($fp) +# IF_ZERO local_is_even_at_Main_internal_1 GOTO label_FALSEIF_301 +# IF_ZERO local_is_even_at_Main_internal_1 GOTO label_FALSEIF_301 +lw $t0, -8($fp) +beq $t0, 0, label_FALSEIF_301 +# LOCAL local_is_even_at_Main_internal_7 --> -32($fp) +# local_is_even_at_Main_internal_7 = SELF +sw $s1, -32($fp) +# LOCAL local_is_even_at_Main_internal_5 --> -24($fp) +# LOCAL local_is_even_at_Main_internal_7 --> -32($fp) +# local_is_even_at_Main_internal_5 = local_is_even_at_Main_internal_7 +lw $t0, -32($fp) +sw $t0, -24($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_is_even_at_Main_internal_8 --> -36($fp) +# LOCAL local_is_even_at_Main_x_0 --> -4($fp) +lw $t0, -4($fp) +lw $t0, 12($t0) +not $t0, $t0 +add $t0, $t0, 1 +sw $t0, -36($fp) +# LOCAL local_is_even_at_Main_internal_8 --> -36($fp) +# LOCAL local_is_even_at_Main_internal_8 --> -36($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +lw $t0, -36($fp) +sw $t0, 12($v0) +sw $v0, -36($fp) +# ARG local_is_even_at_Main_internal_8 +# LOCAL local_is_even_at_Main_internal_8 --> -36($fp) +lw $t0, -36($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_is_even_at_Main_internal_5 --> -24($fp) +# LOCAL local_is_even_at_Main_internal_6 --> -28($fp) +# local_is_even_at_Main_internal_6 = VCALL local_is_even_at_Main_internal_5 is_even +# Save new self pointer in $s1 +lw $s1, -24($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 40($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -28($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_is_even_at_Main_internal_2 --> -12($fp) +# LOCAL local_is_even_at_Main_internal_6 --> -28($fp) +# local_is_even_at_Main_internal_2 = local_is_even_at_Main_internal_6 +lw $t0, -28($fp) +sw $t0, -12($fp) +# GOTO label_ENDIF_302 +j label_ENDIF_302 +label_FALSEIF_301: + # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -56($fp) + # IF_ZERO local_is_even_at_Main_internal_13 GOTO label_FALSE_307 + # IF_ZERO local_is_even_at_Main_internal_13 GOTO label_FALSE_307 + lw $t0, -56($fp) + beq $t0, 0, label_FALSE_307 + # IF_ZERO local_is_even_at_Main_x_0 GOTO label_FALSE_307 + # IF_ZERO local_is_even_at_Main_x_0 GOTO label_FALSE_307 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_307 + # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) + # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) + # Comparing -56($fp) type with String + la $v0, String + lw $a0, -56($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -52($fp) + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_COMPARE_STRING_310 + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_COMPARE_STRING_310 + lw $t0, -52($fp) + beq $t0, 0, label_COMPARE_STRING_310 + # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) + # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) + # Comparing -56($fp) type with Bool + la $v0, Bool + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -52($fp) + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_COMPARE_BY_VALUE_311 + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_COMPARE_BY_VALUE_311 + lw $t0, -52($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_311 + # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) + # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) + # Comparing -56($fp) type with Int + la $v0, Int + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -52($fp) + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_COMPARE_BY_VALUE_311 + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_COMPARE_BY_VALUE_311 + lw $t0, -52($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_311 + # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) + # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + # Load pointers and SUB + lw $a0, -56($fp) + lw $a1, -4($fp) + sub $a0, $a0, $a1 + sw $a0, -52($fp) + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_TRUE_308 + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_TRUE_308 + lw $t0, -52($fp) + beq $t0, 0, label_TRUE_308 + # GOTO label_FALSE_307 + j label_FALSE_307 + label_COMPARE_BY_VALUE_311: + # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) + # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + lw $a0, -56($fp) + lw $a1, -4($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -52($fp) + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_TRUE_308 + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_TRUE_308 + lw $t0, -52($fp) + beq $t0, 0, label_TRUE_308 + # GOTO label_FALSE_307 + j label_FALSE_307 + label_COMPARE_STRING_310: + # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) + # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -4($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -52($fp) + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_CONTINUE_312 + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_CONTINUE_312 + lw $t0, -52($fp) + beq $t0, 0, label_CONTINUE_312 + # GOTO label_FALSE_307 + j label_FALSE_307 + label_CONTINUE_312: + # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) + # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -4($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_313: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_314 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_313 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_314: + # Store result + sw $a2, -52($fp) + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_TRUE_308 + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_TRUE_308 + lw $t0, -52($fp) + beq $t0, 0, label_TRUE_308 + label_FALSE_307: + # LOCAL local_is_even_at_Main_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -48($fp) + # GOTO label_END_309 +j label_END_309 +label_TRUE_308: + # LOCAL local_is_even_at_Main_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -48($fp) + label_END_309: +# LOCAL local_is_even_at_Main_internal_9 --> -40($fp) +# LOCAL local_is_even_at_Main_internal_11 --> -48($fp) +# Obtain value from -48($fp) +lw $v0, -48($fp) +lw $v0, 12($v0) +sw $v0, -40($fp) +# IF_ZERO local_is_even_at_Main_internal_9 GOTO label_FALSEIF_305 +# IF_ZERO local_is_even_at_Main_internal_9 GOTO label_FALSEIF_305 +lw $t0, -40($fp) +beq $t0, 0, label_FALSEIF_305 +# LOCAL local_is_even_at_Main_internal_14 --> -60($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -60($fp) +# LOCAL local_is_even_at_Main_internal_10 --> -44($fp) +# LOCAL local_is_even_at_Main_internal_14 --> -60($fp) +# local_is_even_at_Main_internal_10 = local_is_even_at_Main_internal_14 +lw $t0, -60($fp) +sw $t0, -44($fp) +# GOTO label_ENDIF_306 +j label_ENDIF_306 +label_FALSEIF_305: + # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -80($fp) + # IF_ZERO local_is_even_at_Main_internal_19 GOTO label_FALSE_317 + # IF_ZERO local_is_even_at_Main_internal_19 GOTO label_FALSE_317 + lw $t0, -80($fp) + beq $t0, 0, label_FALSE_317 + # IF_ZERO local_is_even_at_Main_x_0 GOTO label_FALSE_317 + # IF_ZERO local_is_even_at_Main_x_0 GOTO label_FALSE_317 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_317 + # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) + # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) + # Comparing -80($fp) type with String + la $v0, String + lw $a0, -80($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -76($fp) + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_COMPARE_STRING_320 + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_COMPARE_STRING_320 + lw $t0, -76($fp) + beq $t0, 0, label_COMPARE_STRING_320 + # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) + # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) + # Comparing -80($fp) type with Bool + la $v0, Bool + lw $a0, -80($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -76($fp) + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_COMPARE_BY_VALUE_321 + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_COMPARE_BY_VALUE_321 + lw $t0, -76($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_321 + # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) + # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) + # Comparing -80($fp) type with Int + la $v0, Int + lw $a0, -80($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -76($fp) + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_COMPARE_BY_VALUE_321 + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_COMPARE_BY_VALUE_321 + lw $t0, -76($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_321 + # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) + # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + # Load pointers and SUB + lw $a0, -80($fp) + lw $a1, -4($fp) + sub $a0, $a0, $a1 + sw $a0, -76($fp) + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_TRUE_318 + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_TRUE_318 + lw $t0, -76($fp) + beq $t0, 0, label_TRUE_318 + # GOTO label_FALSE_317 + j label_FALSE_317 + label_COMPARE_BY_VALUE_321: + # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) + # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + lw $a0, -80($fp) + lw $a1, -4($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -76($fp) + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_TRUE_318 + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_TRUE_318 + lw $t0, -76($fp) + beq $t0, 0, label_TRUE_318 + # GOTO label_FALSE_317 + j label_FALSE_317 + label_COMPARE_STRING_320: + # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) + # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + # Load strings for comparison + lw $v0, -80($fp) + lw $v1, -4($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -76($fp) + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_CONTINUE_322 + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_CONTINUE_322 + lw $t0, -76($fp) + beq $t0, 0, label_CONTINUE_322 + # GOTO label_FALSE_317 + j label_FALSE_317 + label_CONTINUE_322: + # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) + # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -80($fp) + lw $v1, -4($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_323: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_324 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_323 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_324: + # Store result + sw $a2, -76($fp) + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_TRUE_318 + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_TRUE_318 + lw $t0, -76($fp) + beq $t0, 0, label_TRUE_318 + label_FALSE_317: + # LOCAL local_is_even_at_Main_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -72($fp) + # GOTO label_END_319 +j label_END_319 +label_TRUE_318: + # LOCAL local_is_even_at_Main_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -72($fp) + label_END_319: +# LOCAL local_is_even_at_Main_internal_15 --> -64($fp) +# LOCAL local_is_even_at_Main_internal_17 --> -72($fp) +# Obtain value from -72($fp) +lw $v0, -72($fp) +lw $v0, 12($v0) +sw $v0, -64($fp) +# IF_ZERO local_is_even_at_Main_internal_15 GOTO label_FALSEIF_315 +# IF_ZERO local_is_even_at_Main_internal_15 GOTO label_FALSEIF_315 +lw $t0, -64($fp) +beq $t0, 0, label_FALSEIF_315 +# LOCAL local_is_even_at_Main_internal_20 --> -84($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -84($fp) +# LOCAL local_is_even_at_Main_internal_16 --> -68($fp) +# LOCAL local_is_even_at_Main_internal_20 --> -84($fp) +# local_is_even_at_Main_internal_16 = local_is_even_at_Main_internal_20 +lw $t0, -84($fp) +sw $t0, -68($fp) +# GOTO label_ENDIF_316 +j label_ENDIF_316 +label_FALSEIF_315: + # LOCAL local_is_even_at_Main_internal_23 --> -96($fp) + # local_is_even_at_Main_internal_23 = SELF + sw $s1, -96($fp) + # LOCAL local_is_even_at_Main_internal_21 --> -88($fp) + # LOCAL local_is_even_at_Main_internal_23 --> -96($fp) + # local_is_even_at_Main_internal_21 = local_is_even_at_Main_internal_23 + lw $t0, -96($fp) + sw $t0, -88($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_is_even_at_Main_internal_25 --> -104($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 2 + sw $t0, 12($v0) + sw $v0, -104($fp) + # LOCAL local_is_even_at_Main_internal_24 --> -100($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + # LOCAL local_is_even_at_Main_internal_25 --> -104($fp) + # local_is_even_at_Main_internal_24 = local_is_even_at_Main_x_0 - local_is_even_at_Main_internal_25 + lw $t1, -4($fp) + lw $t0, 12($t1) + lw $t1, -104($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -100($fp) + # ARG local_is_even_at_Main_internal_24 + # LOCAL local_is_even_at_Main_internal_24 --> -100($fp) + lw $t0, -100($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_is_even_at_Main_internal_21 --> -88($fp) + # LOCAL local_is_even_at_Main_internal_22 --> -92($fp) + # local_is_even_at_Main_internal_22 = VCALL local_is_even_at_Main_internal_21 is_even + # Save new self pointer in $s1 + lw $s1, -88($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -92($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_is_even_at_Main_internal_16 --> -68($fp) + # LOCAL local_is_even_at_Main_internal_22 --> -92($fp) + # local_is_even_at_Main_internal_16 = local_is_even_at_Main_internal_22 + lw $t0, -92($fp) + sw $t0, -68($fp) + label_ENDIF_316: +# LOCAL local_is_even_at_Main_internal_10 --> -44($fp) +# LOCAL local_is_even_at_Main_internal_16 --> -68($fp) +# local_is_even_at_Main_internal_10 = local_is_even_at_Main_internal_16 +lw $t0, -68($fp) +sw $t0, -44($fp) +label_ENDIF_306: +# LOCAL local_is_even_at_Main_internal_2 --> -12($fp) +# LOCAL local_is_even_at_Main_internal_10 --> -44($fp) +# local_is_even_at_Main_internal_2 = local_is_even_at_Main_internal_10 +lw $t0, -44($fp) +sw $t0, -12($fp) +label_ENDIF_302: +# RETURN local_is_even_at_Main_internal_2 +lw $v0, -12($fp) +# Deallocate stack frame for function function_is_even_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 112 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_class_type_at_Main implementation. +# @Params: +# 0($fp) = param_class_type_at_Main_var_0 +function_class_type_at_Main: + # Allocate stack frame for function function_class_type_at_Main. + subu $sp, $sp, 148 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 148 + # PARAM param_class_type_at_Main_var_0 --> 0($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # local_class_type_at_Main_internal_0 = TYPEOF param_class_type_at_Main_var_0 + lw $t0, 0($fp) + # Load pointer to type offset + lw $t1, 8($t0) + sw $t1, -4($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # local_class_type_at_Main_internal_3 = 15 + li $t0, 15 + sw $t0, -16($fp) + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type A + la $t0, A__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_Not_min0_325 + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # local_class_type_at_Main_internal_3 = local_class_type_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -16($fp) + label_Not_min0_325: + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type B + la $t0, B__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_Not_min1_326 + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # local_class_type_at_Main_internal_3 = local_class_type_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -16($fp) + label_Not_min1_326: + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type C + la $t0, C__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_Not_min2_327 + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # local_class_type_at_Main_internal_3 = local_class_type_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -16($fp) + label_Not_min2_327: + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type D + la $t0, D__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_Not_min3_328 + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # local_class_type_at_Main_internal_3 = local_class_type_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -16($fp) + label_Not_min3_328: + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type E + la $t0, E__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_Not_min4_329 + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # local_class_type_at_Main_internal_3 = local_class_type_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -16($fp) + label_Not_min4_329: + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type Object + la $t0, Object__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_Not_min5_330 + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # local_class_type_at_Main_internal_3 = local_class_type_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -16($fp) + label_Not_min5_330: + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # local_class_type_at_Main_internal_4 = 15 + li $t0, 15 + sw $t0, -20($fp) + # LOCAL local_class_type_at_Main_internal_1 --> -8($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Load pointers and SUB + lw $a0, -20($fp) + lw $a1, -16($fp) + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_class_type_at_Main_internal_1 GOTO label_ERROR_331 + # IF_ZERO local_class_type_at_Main_internal_1 GOTO label_ERROR_331 + lw $t0, -8($fp) + beq $t0, 0, label_ERROR_331 + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type A + la $t0, A__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_NEXT0_333 + # LOCAL local_class_type_at_Main_a_5 --> -24($fp) + # PARAM param_class_type_at_Main_var_0 --> 0($fp) + # local_class_type_at_Main_a_5 = PARAM param_class_type_at_Main_var_0 + lw $t0, 0($fp) + sw $t0, -24($fp) + # LOCAL local_class_type_at_Main_internal_8 --> -36($fp) + # local_class_type_at_Main_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_class_type_at_Main_internal_6 --> -28($fp) + # LOCAL local_class_type_at_Main_internal_8 --> -36($fp) + # local_class_type_at_Main_internal_6 = local_class_type_at_Main_internal_8 + lw $t0, -36($fp) + sw $t0, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_class_type_at_Main_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_50 + sw $t0, 12($v0) + li $t0, 20 + sw $t0, 16($v0) + sw $v0, -40($fp) + # ARG local_class_type_at_Main_internal_9 + # LOCAL local_class_type_at_Main_internal_9 --> -40($fp) + lw $t0, -40($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_class_type_at_Main_internal_6 --> -28($fp) + # LOCAL local_class_type_at_Main_internal_7 --> -32($fp) + # local_class_type_at_Main_internal_7 = VCALL local_class_type_at_Main_internal_6 out_string + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_class_type_at_Main_internal_2 --> -12($fp) + # LOCAL local_class_type_at_Main_internal_7 --> -32($fp) + # local_class_type_at_Main_internal_2 = local_class_type_at_Main_internal_7 + lw $t0, -32($fp) + sw $t0, -12($fp) + # GOTO label_END_332 +j label_END_332 +label_NEXT0_333: + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type B + la $t0, B__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_NEXT1_334 + # LOCAL local_class_type_at_Main_b_10 --> -44($fp) + # PARAM param_class_type_at_Main_var_0 --> 0($fp) + # local_class_type_at_Main_b_10 = PARAM param_class_type_at_Main_var_0 + lw $t0, 0($fp) + sw $t0, -44($fp) + # LOCAL local_class_type_at_Main_internal_13 --> -56($fp) + # local_class_type_at_Main_internal_13 = SELF + sw $s1, -56($fp) + # LOCAL local_class_type_at_Main_internal_11 --> -48($fp) + # LOCAL local_class_type_at_Main_internal_13 --> -56($fp) + # local_class_type_at_Main_internal_11 = local_class_type_at_Main_internal_13 + lw $t0, -56($fp) + sw $t0, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_class_type_at_Main_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_51 + sw $t0, 12($v0) + li $t0, 20 + sw $t0, 16($v0) + sw $v0, -60($fp) + # ARG local_class_type_at_Main_internal_14 + # LOCAL local_class_type_at_Main_internal_14 --> -60($fp) + lw $t0, -60($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_class_type_at_Main_internal_11 --> -48($fp) + # LOCAL local_class_type_at_Main_internal_12 --> -52($fp) + # local_class_type_at_Main_internal_12 = VCALL local_class_type_at_Main_internal_11 out_string + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_class_type_at_Main_internal_2 --> -12($fp) + # LOCAL local_class_type_at_Main_internal_12 --> -52($fp) + # local_class_type_at_Main_internal_2 = local_class_type_at_Main_internal_12 + lw $t0, -52($fp) + sw $t0, -12($fp) + # GOTO label_END_332 +j label_END_332 +label_NEXT1_334: + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type C + la $t0, C__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_NEXT2_335 + # LOCAL local_class_type_at_Main_c_15 --> -64($fp) + # PARAM param_class_type_at_Main_var_0 --> 0($fp) + # local_class_type_at_Main_c_15 = PARAM param_class_type_at_Main_var_0 + lw $t0, 0($fp) + sw $t0, -64($fp) + # LOCAL local_class_type_at_Main_internal_18 --> -76($fp) + # local_class_type_at_Main_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_class_type_at_Main_internal_16 --> -68($fp) + # LOCAL local_class_type_at_Main_internal_18 --> -76($fp) + # local_class_type_at_Main_internal_16 = local_class_type_at_Main_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_class_type_at_Main_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_52 + sw $t0, 12($v0) + li $t0, 20 + sw $t0, 16($v0) + sw $v0, -80($fp) + # ARG local_class_type_at_Main_internal_19 + # LOCAL local_class_type_at_Main_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_class_type_at_Main_internal_16 --> -68($fp) + # LOCAL local_class_type_at_Main_internal_17 --> -72($fp) + # local_class_type_at_Main_internal_17 = VCALL local_class_type_at_Main_internal_16 out_string + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_class_type_at_Main_internal_2 --> -12($fp) + # LOCAL local_class_type_at_Main_internal_17 --> -72($fp) + # local_class_type_at_Main_internal_2 = local_class_type_at_Main_internal_17 + lw $t0, -72($fp) + sw $t0, -12($fp) + # GOTO label_END_332 +j label_END_332 +label_NEXT2_335: + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type D + la $t0, D__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_NEXT3_336 + # LOCAL local_class_type_at_Main_d_20 --> -84($fp) + # PARAM param_class_type_at_Main_var_0 --> 0($fp) + # local_class_type_at_Main_d_20 = PARAM param_class_type_at_Main_var_0 + lw $t0, 0($fp) + sw $t0, -84($fp) + # LOCAL local_class_type_at_Main_internal_23 --> -96($fp) + # local_class_type_at_Main_internal_23 = SELF + sw $s1, -96($fp) + # LOCAL local_class_type_at_Main_internal_21 --> -88($fp) + # LOCAL local_class_type_at_Main_internal_23 --> -96($fp) + # local_class_type_at_Main_internal_21 = local_class_type_at_Main_internal_23 + lw $t0, -96($fp) + sw $t0, -88($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_class_type_at_Main_internal_24 --> -100($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_53 + sw $t0, 12($v0) + li $t0, 20 + sw $t0, 16($v0) + sw $v0, -100($fp) + # ARG local_class_type_at_Main_internal_24 + # LOCAL local_class_type_at_Main_internal_24 --> -100($fp) + lw $t0, -100($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_class_type_at_Main_internal_21 --> -88($fp) + # LOCAL local_class_type_at_Main_internal_22 --> -92($fp) + # local_class_type_at_Main_internal_22 = VCALL local_class_type_at_Main_internal_21 out_string + # Save new self pointer in $s1 + lw $s1, -88($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -92($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_class_type_at_Main_internal_2 --> -12($fp) + # LOCAL local_class_type_at_Main_internal_22 --> -92($fp) + # local_class_type_at_Main_internal_2 = local_class_type_at_Main_internal_22 + lw $t0, -92($fp) + sw $t0, -12($fp) + # GOTO label_END_332 +j label_END_332 +label_NEXT3_336: + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type E + la $t0, E__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_NEXT4_337 + # LOCAL local_class_type_at_Main_e_25 --> -104($fp) + # PARAM param_class_type_at_Main_var_0 --> 0($fp) + # local_class_type_at_Main_e_25 = PARAM param_class_type_at_Main_var_0 + lw $t0, 0($fp) + sw $t0, -104($fp) + # LOCAL local_class_type_at_Main_internal_28 --> -116($fp) + # local_class_type_at_Main_internal_28 = SELF + sw $s1, -116($fp) + # LOCAL local_class_type_at_Main_internal_26 --> -108($fp) + # LOCAL local_class_type_at_Main_internal_28 --> -116($fp) + # local_class_type_at_Main_internal_26 = local_class_type_at_Main_internal_28 + lw $t0, -116($fp) + sw $t0, -108($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_class_type_at_Main_internal_29 --> -120($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_54 + sw $t0, 12($v0) + li $t0, 20 + sw $t0, 16($v0) + sw $v0, -120($fp) + # ARG local_class_type_at_Main_internal_29 + # LOCAL local_class_type_at_Main_internal_29 --> -120($fp) + lw $t0, -120($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_class_type_at_Main_internal_26 --> -108($fp) + # LOCAL local_class_type_at_Main_internal_27 --> -112($fp) + # local_class_type_at_Main_internal_27 = VCALL local_class_type_at_Main_internal_26 out_string + # Save new self pointer in $s1 + lw $s1, -108($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -112($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_class_type_at_Main_internal_2 --> -12($fp) + # LOCAL local_class_type_at_Main_internal_27 --> -112($fp) + # local_class_type_at_Main_internal_2 = local_class_type_at_Main_internal_27 + lw $t0, -112($fp) + sw $t0, -12($fp) + # GOTO label_END_332 +j label_END_332 +label_NEXT4_337: + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type Object + la $t0, Object__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_NEXT5_338 + # LOCAL local_class_type_at_Main_o_30 --> -124($fp) + # PARAM param_class_type_at_Main_var_0 --> 0($fp) + # local_class_type_at_Main_o_30 = PARAM param_class_type_at_Main_var_0 + lw $t0, 0($fp) + sw $t0, -124($fp) + # LOCAL local_class_type_at_Main_internal_33 --> -136($fp) + # local_class_type_at_Main_internal_33 = SELF + sw $s1, -136($fp) + # LOCAL local_class_type_at_Main_internal_31 --> -128($fp) + # LOCAL local_class_type_at_Main_internal_33 --> -136($fp) + # local_class_type_at_Main_internal_31 = local_class_type_at_Main_internal_33 + lw $t0, -136($fp) + sw $t0, -128($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_class_type_at_Main_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_55 + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + sw $v0, -140($fp) + # ARG local_class_type_at_Main_internal_34 + # LOCAL local_class_type_at_Main_internal_34 --> -140($fp) + lw $t0, -140($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_class_type_at_Main_internal_31 --> -128($fp) + # LOCAL local_class_type_at_Main_internal_32 --> -132($fp) + # local_class_type_at_Main_internal_32 = VCALL local_class_type_at_Main_internal_31 out_string + # Save new self pointer in $s1 + lw $s1, -128($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -132($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_class_type_at_Main_internal_2 --> -12($fp) + # LOCAL local_class_type_at_Main_internal_32 --> -132($fp) + # local_class_type_at_Main_internal_2 = local_class_type_at_Main_internal_32 + lw $t0, -132($fp) + sw $t0, -12($fp) + # GOTO label_END_332 +j label_END_332 +label_NEXT5_338: + label_ERROR_331: + # PARAM param_class_type_at_Main_var_0 --> 0($fp) + lw $t0, 0($s1) + sw $t0, 0($fp) + # PARAM param_class_type_at_Main_var_0 --> 0($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, 0($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + label_END_332: +# RETURN local_class_type_at_Main_internal_2 +lw $v0, -12($fp) +# Deallocate stack frame for function function_class_type_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 148 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_print_at_Main implementation. +# @Params: +# 0($fp) = param_print_at_Main_var_0 +function_print_at_Main: + # Allocate stack frame for function function_print_at_Main. + subu $sp, $sp, 60 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 60 + # LOCAL local_print_at_Main_z_0 --> -4($fp) + # local_print_at_Main_z_0 = ALLOCATE A2I + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, A2I + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, A2I_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local_print_at_Main_internal_1 --> -8($fp) + # local_print_at_Main_internal_1 = ALLOCATE A2I + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, A2I + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, A2I_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # LOCAL local_print_at_Main_z_0 --> -4($fp) + # LOCAL local_print_at_Main_internal_1 --> -8($fp) + # local_print_at_Main_z_0 = local_print_at_Main_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_print_at_Main_internal_4 --> -20($fp) + # local_print_at_Main_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_print_at_Main_internal_2 --> -12($fp) + # LOCAL local_print_at_Main_internal_4 --> -20($fp) + # local_print_at_Main_internal_2 = local_print_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Main_internal_5 --> -24($fp) + # LOCAL local_print_at_Main_z_0 --> -4($fp) + # local_print_at_Main_internal_5 = local_print_at_Main_z_0 + lw $t0, -4($fp) + sw $t0, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Main_internal_7 --> -32($fp) + # PARAM param_print_at_Main_var_0 --> 0($fp) + # local_print_at_Main_internal_7 = PARAM param_print_at_Main_var_0 + lw $t0, 0($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Main_internal_7 --> -32($fp) + # LOCAL local_print_at_Main_internal_8 --> -36($fp) + # local_print_at_Main_internal_8 = VCALL local_print_at_Main_internal_7 value + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_print_at_Main_internal_8 + # LOCAL local_print_at_Main_internal_8 --> -36($fp) + lw $t0, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Main_internal_5 --> -24($fp) + # LOCAL local_print_at_Main_internal_6 --> -28($fp) + # local_print_at_Main_internal_6 = VCALL local_print_at_Main_internal_5 i2a + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_print_at_Main_internal_6 + # LOCAL local_print_at_Main_internal_6 --> -28($fp) + lw $t0, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Main_internal_2 --> -12($fp) + # LOCAL local_print_at_Main_internal_3 --> -16($fp) + # local_print_at_Main_internal_3 = VCALL local_print_at_Main_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Main_internal_11 --> -48($fp) + # local_print_at_Main_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_print_at_Main_internal_9 --> -40($fp) + # LOCAL local_print_at_Main_internal_11 --> -48($fp) + # local_print_at_Main_internal_9 = local_print_at_Main_internal_11 + lw $t0, -48($fp) + sw $t0, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Main_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_56 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -52($fp) + # ARG local_print_at_Main_internal_12 + # LOCAL local_print_at_Main_internal_12 --> -52($fp) + lw $t0, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Main_internal_9 --> -40($fp) + # LOCAL local_print_at_Main_internal_10 --> -44($fp) + # local_print_at_Main_internal_10 = VCALL local_print_at_Main_internal_9 out_string + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_at_Main_internal_10 + lw $v0, -44($fp) + # Deallocate stack frame for function function_print_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 60 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 992 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 992 + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # local_main_at_Main_internal_0 = ALLOCATE A + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, A + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, A_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + lw $t0, -4($fp) + sw $t0, 16($s1) + label_WHILE_339: + # local_main_at_Main_internal_2 = GETATTRIBUTE flag Main + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + lw $t0, 24($s1) + sw $t0, -12($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # Obtain value from -12($fp) + lw $v0, -12($fp) + lw $v0, 12($v0) + sw $v0, -8($fp) + # IF_ZERO local_main_at_Main_internal_1 GOTO label_WHILE_END_340 + # IF_ZERO local_main_at_Main_internal_1 GOTO label_WHILE_END_340 + lw $t0, -8($fp) + beq $t0, 0, label_WHILE_END_340 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = SELF + sw $s1, -24($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_57 + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + sw $v0, -28($fp) + # ARG local_main_at_Main_internal_6 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + lw $t0, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 out_string + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = SELF + sw $s1, -40($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 + lw $t0, -40($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_main_at_Main_internal_10 = GETATTRIBUTE avar Main + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + lw $t0, 16($s1) + sw $t0, -44($fp) + # ARG local_main_at_Main_internal_10 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + lw $t0, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 print + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_main_at_Main_internal_18 = GETATTRIBUTE avar Main + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + lw $t0, 16($s1) + sw $t0, -76($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 value + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_17 + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + lw $t0, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 is_even + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # Obtain value from -60($fp) + lw $v0, -60($fp) + lw $v0, 12($v0) + sw $v0, -48($fp) + # IF_ZERO local_main_at_Main_internal_11 GOTO label_FALSEIF_341 + # IF_ZERO local_main_at_Main_internal_11 GOTO label_FALSEIF_341 + lw $t0, -48($fp) + beq $t0, 0, label_FALSEIF_341 + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_21 = SELF + sw $s1, -88($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 + lw $t0, -88($fp) + sw $t0, -80($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_58 + sw $t0, 12($v0) + li $t0, 9 + sw $t0, 16($v0) + sw $v0, -92($fp) + # ARG local_main_at_Main_internal_22 + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + lw $t0, -92($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 out_string + # Save new self pointer in $s1 + lw $s1, -80($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -84($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_12 = local_main_at_Main_internal_20 + lw $t0, -84($fp) + sw $t0, -52($fp) + # GOTO label_ENDIF_342 +j label_ENDIF_342 +label_FALSEIF_341: + # LOCAL local_main_at_Main_internal_25 --> -104($fp) + # local_main_at_Main_internal_25 = SELF + sw $s1, -104($fp) + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # LOCAL local_main_at_Main_internal_25 --> -104($fp) + # local_main_at_Main_internal_23 = local_main_at_Main_internal_25 + lw $t0, -104($fp) + sw $t0, -96($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_59 + sw $t0, 12($v0) + li $t0, 8 + sw $t0, 16($v0) + sw $v0, -108($fp) + # ARG local_main_at_Main_internal_26 + # LOCAL local_main_at_Main_internal_26 --> -108($fp) + lw $t0, -108($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # LOCAL local_main_at_Main_internal_24 --> -100($fp) + # local_main_at_Main_internal_24 = VCALL local_main_at_Main_internal_23 out_string + # Save new self pointer in $s1 + lw $s1, -96($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -100($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_24 --> -100($fp) + # local_main_at_Main_internal_12 = local_main_at_Main_internal_24 + lw $t0, -100($fp) + sw $t0, -52($fp) + label_ENDIF_342: +# LOCAL local_main_at_Main_internal_29 --> -120($fp) +# local_main_at_Main_internal_29 = SELF +sw $s1, -120($fp) +# LOCAL local_main_at_Main_internal_27 --> -112($fp) +# LOCAL local_main_at_Main_internal_29 --> -120($fp) +# local_main_at_Main_internal_27 = local_main_at_Main_internal_29 +lw $t0, -120($fp) +sw $t0, -112($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_27 --> -112($fp) +# LOCAL local_main_at_Main_internal_28 --> -116($fp) +# local_main_at_Main_internal_28 = VCALL local_main_at_Main_internal_27 menu +# Save new self pointer in $s1 +lw $s1, -112($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 28($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -116($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_main_at_Main_internal_28 --> -116($fp) +lw $t0, -116($fp) +sw $t0, 12($s1) +# local_main_at_Main_internal_34 = GETATTRIBUTE char Main +# LOCAL local_main_at_Main_internal_34 --> -140($fp) +lw $t0, 12($s1) +sw $t0, -140($fp) +# LOCAL local_main_at_Main_internal_35 --> -144($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_60 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -144($fp) +# IF_ZERO local_main_at_Main_internal_34 GOTO label_FALSE_345 +# IF_ZERO local_main_at_Main_internal_34 GOTO label_FALSE_345 +lw $t0, -140($fp) +beq $t0, 0, label_FALSE_345 +# IF_ZERO local_main_at_Main_internal_35 GOTO label_FALSE_345 +# IF_ZERO local_main_at_Main_internal_35 GOTO label_FALSE_345 +lw $t0, -144($fp) +beq $t0, 0, label_FALSE_345 +# LOCAL local_main_at_Main_internal_33 --> -136($fp) +# LOCAL local_main_at_Main_internal_34 --> -140($fp) +# Comparing -140($fp) type with String +la $v0, String +lw $a0, -140($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -136($fp) +# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_STRING_348 +# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_STRING_348 +lw $t0, -136($fp) +beq $t0, 0, label_COMPARE_STRING_348 +# LOCAL local_main_at_Main_internal_33 --> -136($fp) +# LOCAL local_main_at_Main_internal_34 --> -140($fp) +# Comparing -140($fp) type with Bool +la $v0, Bool +lw $a0, -140($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -136($fp) +# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_BY_VALUE_349 +# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_BY_VALUE_349 +lw $t0, -136($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_349 +# LOCAL local_main_at_Main_internal_33 --> -136($fp) +# LOCAL local_main_at_Main_internal_34 --> -140($fp) +# Comparing -140($fp) type with Int +la $v0, Int +lw $a0, -140($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -136($fp) +# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_BY_VALUE_349 +# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_BY_VALUE_349 +lw $t0, -136($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_349 +# LOCAL local_main_at_Main_internal_33 --> -136($fp) +# LOCAL local_main_at_Main_internal_34 --> -140($fp) +# LOCAL local_main_at_Main_internal_35 --> -144($fp) +# Load pointers and SUB +lw $a0, -140($fp) +lw $a1, -144($fp) +sub $a0, $a0, $a1 +sw $a0, -136($fp) +# IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_346 +# IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_346 +lw $t0, -136($fp) +beq $t0, 0, label_TRUE_346 +# GOTO label_FALSE_345 +j label_FALSE_345 +label_COMPARE_BY_VALUE_349: + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # LOCAL local_main_at_Main_internal_34 --> -140($fp) + # LOCAL local_main_at_Main_internal_35 --> -144($fp) + lw $a0, -140($fp) + lw $a1, -144($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_346 + # IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_346 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_346 + # GOTO label_FALSE_345 + j label_FALSE_345 + label_COMPARE_STRING_348: + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # LOCAL local_main_at_Main_internal_34 --> -140($fp) + # LOCAL local_main_at_Main_internal_35 --> -144($fp) + # Load strings for comparison + lw $v0, -140($fp) + lw $v1, -144($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -136($fp) + # IF_ZERO local_main_at_Main_internal_33 GOTO label_CONTINUE_350 + # IF_ZERO local_main_at_Main_internal_33 GOTO label_CONTINUE_350 + lw $t0, -136($fp) + beq $t0, 0, label_CONTINUE_350 + # GOTO label_FALSE_345 + j label_FALSE_345 + label_CONTINUE_350: + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # LOCAL local_main_at_Main_internal_34 --> -140($fp) + # LOCAL local_main_at_Main_internal_35 --> -144($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -140($fp) + lw $v1, -144($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_351: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_352 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_351 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_352: + # Store result + sw $a2, -136($fp) + # IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_346 + # IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_346 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_346 + label_FALSE_345: + # LOCAL local_main_at_Main_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -132($fp) + # GOTO label_END_347 +j label_END_347 +label_TRUE_346: + # LOCAL local_main_at_Main_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -132($fp) + label_END_347: +# LOCAL local_main_at_Main_internal_30 --> -124($fp) +# LOCAL local_main_at_Main_internal_32 --> -132($fp) +# Obtain value from -132($fp) +lw $v0, -132($fp) +lw $v0, 12($v0) +sw $v0, -124($fp) +# IF_ZERO local_main_at_Main_internal_30 GOTO label_FALSEIF_343 +# IF_ZERO local_main_at_Main_internal_30 GOTO label_FALSEIF_343 +lw $t0, -124($fp) +beq $t0, 0, label_FALSEIF_343 +# LOCAL local_main_at_Main_internal_38 --> -156($fp) +# local_main_at_Main_internal_38 = ALLOCATE A +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, A +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, A_start +sw $t0, 4($v0) +# Load type offset +li $t0, 24 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -156($fp) +# LOCAL local_main_at_Main_internal_36 --> -148($fp) +# LOCAL local_main_at_Main_internal_38 --> -156($fp) +# local_main_at_Main_internal_36 = local_main_at_Main_internal_38 +lw $t0, -156($fp) +sw $t0, -148($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_41 --> -168($fp) +# local_main_at_Main_internal_41 = SELF +sw $s1, -168($fp) +# LOCAL local_main_at_Main_internal_39 --> -160($fp) +# LOCAL local_main_at_Main_internal_41 --> -168($fp) +# local_main_at_Main_internal_39 = local_main_at_Main_internal_41 +lw $t0, -168($fp) +sw $t0, -160($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_39 --> -160($fp) +# LOCAL local_main_at_Main_internal_40 --> -164($fp) +# local_main_at_Main_internal_40 = VCALL local_main_at_Main_internal_39 get_int +# Save new self pointer in $s1 +lw $s1, -160($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 36($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -164($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_40 +# LOCAL local_main_at_Main_internal_40 --> -164($fp) +lw $t0, -164($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_36 --> -148($fp) +# LOCAL local_main_at_Main_internal_37 --> -152($fp) +# local_main_at_Main_internal_37 = VCALL local_main_at_Main_internal_36 set_var +# Save new self pointer in $s1 +lw $s1, -148($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -152($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_main_at_Main_internal_37 --> -152($fp) +lw $t0, -152($fp) +sw $t0, 20($s1) +# LOCAL local_main_at_Main_internal_44 --> -180($fp) +# local_main_at_Main_internal_44 = ALLOCATE B +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, B +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, B_start +sw $t0, 4($v0) +# Load type offset +li $t0, 28 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -180($fp) +# LOCAL local_main_at_Main_internal_42 --> -172($fp) +# LOCAL local_main_at_Main_internal_44 --> -180($fp) +# local_main_at_Main_internal_42 = local_main_at_Main_internal_44 +lw $t0, -180($fp) +sw $t0, -172($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_main_at_Main_internal_47 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_47 --> -192($fp) +lw $t0, 16($s1) +sw $t0, -192($fp) +# LOCAL local_main_at_Main_internal_45 --> -184($fp) +# LOCAL local_main_at_Main_internal_47 --> -192($fp) +# local_main_at_Main_internal_45 = local_main_at_Main_internal_47 +lw $t0, -192($fp) +sw $t0, -184($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_45 --> -184($fp) +# LOCAL local_main_at_Main_internal_46 --> -188($fp) +# local_main_at_Main_internal_46 = VCALL local_main_at_Main_internal_45 value +# Save new self pointer in $s1 +lw $s1, -184($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -188($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_46 +# LOCAL local_main_at_Main_internal_46 --> -188($fp) +lw $t0, -188($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# local_main_at_Main_internal_50 = GETATTRIBUTE a_var Main +# LOCAL local_main_at_Main_internal_50 --> -204($fp) +lw $t0, 20($s1) +sw $t0, -204($fp) +# LOCAL local_main_at_Main_internal_48 --> -196($fp) +# LOCAL local_main_at_Main_internal_50 --> -204($fp) +# local_main_at_Main_internal_48 = local_main_at_Main_internal_50 +lw $t0, -204($fp) +sw $t0, -196($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_48 --> -196($fp) +# LOCAL local_main_at_Main_internal_49 --> -200($fp) +# local_main_at_Main_internal_49 = VCALL local_main_at_Main_internal_48 value +# Save new self pointer in $s1 +lw $s1, -196($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -200($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_49 +# LOCAL local_main_at_Main_internal_49 --> -200($fp) +lw $t0, -200($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_42 --> -172($fp) +# LOCAL local_main_at_Main_internal_43 --> -176($fp) +# local_main_at_Main_internal_43 = VCALL local_main_at_Main_internal_42 method2 +# Save new self pointer in $s1 +lw $s1, -172($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 24($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -176($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_main_at_Main_internal_43 --> -176($fp) +lw $t0, -176($fp) +sw $t0, 16($s1) +# LOCAL local_main_at_Main_internal_31 --> -128($fp) +# local_main_at_Main_internal_31 = +# GOTO label_ENDIF_344 +j label_ENDIF_344 +label_FALSEIF_343: + # local_main_at_Main_internal_55 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_55 --> -224($fp) + lw $t0, 12($s1) + sw $t0, -224($fp) + # LOCAL local_main_at_Main_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_61 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -228($fp) + # IF_ZERO local_main_at_Main_internal_55 GOTO label_FALSE_355 + # IF_ZERO local_main_at_Main_internal_55 GOTO label_FALSE_355 + lw $t0, -224($fp) + beq $t0, 0, label_FALSE_355 + # IF_ZERO local_main_at_Main_internal_56 GOTO label_FALSE_355 + # IF_ZERO local_main_at_Main_internal_56 GOTO label_FALSE_355 + lw $t0, -228($fp) + beq $t0, 0, label_FALSE_355 + # LOCAL local_main_at_Main_internal_54 --> -220($fp) + # LOCAL local_main_at_Main_internal_55 --> -224($fp) + # Comparing -224($fp) type with String + la $v0, String + lw $a0, -224($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -220($fp) + # IF_ZERO local_main_at_Main_internal_54 GOTO label_COMPARE_STRING_358 + # IF_ZERO local_main_at_Main_internal_54 GOTO label_COMPARE_STRING_358 + lw $t0, -220($fp) + beq $t0, 0, label_COMPARE_STRING_358 + # LOCAL local_main_at_Main_internal_54 --> -220($fp) + # LOCAL local_main_at_Main_internal_55 --> -224($fp) + # Comparing -224($fp) type with Bool + la $v0, Bool + lw $a0, -224($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -220($fp) + # IF_ZERO local_main_at_Main_internal_54 GOTO label_COMPARE_BY_VALUE_359 + # IF_ZERO local_main_at_Main_internal_54 GOTO label_COMPARE_BY_VALUE_359 + lw $t0, -220($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_359 + # LOCAL local_main_at_Main_internal_54 --> -220($fp) + # LOCAL local_main_at_Main_internal_55 --> -224($fp) + # Comparing -224($fp) type with Int + la $v0, Int + lw $a0, -224($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -220($fp) + # IF_ZERO local_main_at_Main_internal_54 GOTO label_COMPARE_BY_VALUE_359 + # IF_ZERO local_main_at_Main_internal_54 GOTO label_COMPARE_BY_VALUE_359 + lw $t0, -220($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_359 + # LOCAL local_main_at_Main_internal_54 --> -220($fp) + # LOCAL local_main_at_Main_internal_55 --> -224($fp) + # LOCAL local_main_at_Main_internal_56 --> -228($fp) + # Load pointers and SUB + lw $a0, -224($fp) + lw $a1, -228($fp) + sub $a0, $a0, $a1 + sw $a0, -220($fp) + # IF_ZERO local_main_at_Main_internal_54 GOTO label_TRUE_356 + # IF_ZERO local_main_at_Main_internal_54 GOTO label_TRUE_356 + lw $t0, -220($fp) + beq $t0, 0, label_TRUE_356 + # GOTO label_FALSE_355 + j label_FALSE_355 + label_COMPARE_BY_VALUE_359: + # LOCAL local_main_at_Main_internal_54 --> -220($fp) + # LOCAL local_main_at_Main_internal_55 --> -224($fp) + # LOCAL local_main_at_Main_internal_56 --> -228($fp) + lw $a0, -224($fp) + lw $a1, -228($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -220($fp) + # IF_ZERO local_main_at_Main_internal_54 GOTO label_TRUE_356 + # IF_ZERO local_main_at_Main_internal_54 GOTO label_TRUE_356 + lw $t0, -220($fp) + beq $t0, 0, label_TRUE_356 + # GOTO label_FALSE_355 + j label_FALSE_355 + label_COMPARE_STRING_358: + # LOCAL local_main_at_Main_internal_54 --> -220($fp) + # LOCAL local_main_at_Main_internal_55 --> -224($fp) + # LOCAL local_main_at_Main_internal_56 --> -228($fp) + # Load strings for comparison + lw $v0, -224($fp) + lw $v1, -228($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -220($fp) + # IF_ZERO local_main_at_Main_internal_54 GOTO label_CONTINUE_360 + # IF_ZERO local_main_at_Main_internal_54 GOTO label_CONTINUE_360 + lw $t0, -220($fp) + beq $t0, 0, label_CONTINUE_360 + # GOTO label_FALSE_355 + j label_FALSE_355 + label_CONTINUE_360: + # LOCAL local_main_at_Main_internal_54 --> -220($fp) + # LOCAL local_main_at_Main_internal_55 --> -224($fp) + # LOCAL local_main_at_Main_internal_56 --> -228($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -224($fp) + lw $v1, -228($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_361: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_362 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_361 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_362: + # Store result + sw $a2, -220($fp) + # IF_ZERO local_main_at_Main_internal_54 GOTO label_TRUE_356 + # IF_ZERO local_main_at_Main_internal_54 GOTO label_TRUE_356 + lw $t0, -220($fp) + beq $t0, 0, label_TRUE_356 + label_FALSE_355: + # LOCAL local_main_at_Main_internal_53 --> -216($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -216($fp) + # GOTO label_END_357 +j label_END_357 +label_TRUE_356: + # LOCAL local_main_at_Main_internal_53 --> -216($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -216($fp) + label_END_357: +# LOCAL local_main_at_Main_internal_51 --> -208($fp) +# LOCAL local_main_at_Main_internal_53 --> -216($fp) +# Obtain value from -216($fp) +lw $v0, -216($fp) +lw $v0, 12($v0) +sw $v0, -208($fp) +# IF_ZERO local_main_at_Main_internal_51 GOTO label_FALSEIF_353 +# IF_ZERO local_main_at_Main_internal_51 GOTO label_FALSEIF_353 +lw $t0, -208($fp) +beq $t0, 0, label_FALSEIF_353 +# local_main_at_Main_internal_57 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_57 --> -232($fp) +lw $t0, 16($s1) +sw $t0, -232($fp) +# LOCAL local_main_at_Main_internal_57 --> -232($fp) +# LOCAL local_main_at_Main_internal_58 --> -236($fp) +# local_main_at_Main_internal_58 = TYPEOF local_main_at_Main_internal_57 +lw $t0, -232($fp) +# Load pointer to type offset +lw $t1, 8($t0) +sw $t1, -236($fp) +# LOCAL local_main_at_Main_internal_61 --> -248($fp) +# local_main_at_Main_internal_61 = 15 +li $t0, 15 +sw $t0, -248($fp) +# local_main_at_Main_internal_62 = TYPE_DISTANCE C +# LOCAL local_main_at_Main_internal_62 --> -252($fp) +# LOCAL local_main_at_Main_internal_58 --> -236($fp) +# Load TDT pointer to type C +la $t0, C__TDT +lw $t1, -236($fp) +addu $t0, $t0, $t1 +# Save distance +lw $t1, 0($t0) +sw $t1, -252($fp) +# LOCAL local_main_at_Main_internal_62 --> -252($fp) +# LOCAL local_main_at_Main_internal_61 --> -248($fp) +# Update min if 8 < 9 +lw $t0, -252($fp) +lw $t1, -248($fp) +bgtu $t0, $t1, label_Not_min0_363 +# LOCAL local_main_at_Main_internal_61 --> -248($fp) +# LOCAL local_main_at_Main_internal_62 --> -252($fp) +# local_main_at_Main_internal_61 = local_main_at_Main_internal_62 +lw $t0, -252($fp) +sw $t0, -248($fp) +label_Not_min0_363: + # local_main_at_Main_internal_62 = TYPE_DISTANCE A + # LOCAL local_main_at_Main_internal_62 --> -252($fp) + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # Load TDT pointer to type A + la $t0, A__TDT + lw $t1, -236($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -252($fp) + # LOCAL local_main_at_Main_internal_62 --> -252($fp) + # LOCAL local_main_at_Main_internal_61 --> -248($fp) + # Update min if 8 < 9 + lw $t0, -252($fp) + lw $t1, -248($fp) + bgtu $t0, $t1, label_Not_min1_364 + # LOCAL local_main_at_Main_internal_61 --> -248($fp) + # LOCAL local_main_at_Main_internal_62 --> -252($fp) + # local_main_at_Main_internal_61 = local_main_at_Main_internal_62 + lw $t0, -252($fp) + sw $t0, -248($fp) + label_Not_min1_364: + # local_main_at_Main_internal_62 = TYPE_DISTANCE Object + # LOCAL local_main_at_Main_internal_62 --> -252($fp) + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # Load TDT pointer to type Object + la $t0, Object__TDT + lw $t1, -236($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -252($fp) + # LOCAL local_main_at_Main_internal_62 --> -252($fp) + # LOCAL local_main_at_Main_internal_61 --> -248($fp) + # Update min if 8 < 9 + lw $t0, -252($fp) + lw $t1, -248($fp) + bgtu $t0, $t1, label_Not_min2_365 + # LOCAL local_main_at_Main_internal_61 --> -248($fp) + # LOCAL local_main_at_Main_internal_62 --> -252($fp) + # local_main_at_Main_internal_61 = local_main_at_Main_internal_62 + lw $t0, -252($fp) + sw $t0, -248($fp) + label_Not_min2_365: + # LOCAL local_main_at_Main_internal_62 --> -252($fp) + # local_main_at_Main_internal_62 = 15 + li $t0, 15 + sw $t0, -252($fp) + # LOCAL local_main_at_Main_internal_59 --> -240($fp) + # LOCAL local_main_at_Main_internal_62 --> -252($fp) + # LOCAL local_main_at_Main_internal_61 --> -248($fp) + # Load pointers and SUB + lw $a0, -252($fp) + lw $a1, -248($fp) + sub $a0, $a0, $a1 + sw $a0, -240($fp) + # IF_ZERO local_main_at_Main_internal_59 GOTO label_ERROR_366 + # IF_ZERO local_main_at_Main_internal_59 GOTO label_ERROR_366 + lw $t0, -240($fp) + beq $t0, 0, label_ERROR_366 + # local_main_at_Main_internal_62 = TYPE_DISTANCE C + # LOCAL local_main_at_Main_internal_62 --> -252($fp) + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # Load TDT pointer to type C + la $t0, C__TDT + lw $t1, -236($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -252($fp) + # LOCAL local_main_at_Main_internal_62 --> -252($fp) + # LOCAL local_main_at_Main_internal_61 --> -248($fp) + # Update min if 8 < 9 + lw $t0, -252($fp) + lw $t1, -248($fp) + bgtu $t0, $t1, label_NEXT0_368 + # LOCAL local_main_at_Main_c_63 --> -256($fp) + # LOCAL local_main_at_Main_internal_57 --> -232($fp) + # local_main_at_Main_c_63 = local_main_at_Main_internal_57 + lw $t0, -232($fp) + sw $t0, -256($fp) + # LOCAL local_main_at_Main_internal_64 --> -260($fp) + # LOCAL local_main_at_Main_c_63 --> -256($fp) + # local_main_at_Main_internal_64 = local_main_at_Main_c_63 + lw $t0, -256($fp) + sw $t0, -260($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # LOCAL local_main_at_Main_c_63 --> -256($fp) + # local_main_at_Main_internal_66 = local_main_at_Main_c_63 + lw $t0, -256($fp) + sw $t0, -268($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # LOCAL local_main_at_Main_internal_67 --> -272($fp) + # local_main_at_Main_internal_67 = VCALL local_main_at_Main_internal_66 value + # Save new self pointer in $s1 + lw $s1, -268($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -272($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_67 + # LOCAL local_main_at_Main_internal_67 --> -272($fp) + lw $t0, -272($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_64 --> -260($fp) + # LOCAL local_main_at_Main_internal_65 --> -264($fp) + # local_main_at_Main_internal_65 = VCALL local_main_at_Main_internal_64 method6 + # Save new self pointer in $s1 + lw $s1, -260($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -264($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_65 --> -264($fp) + lw $t0, -264($fp) + sw $t0, 16($s1) + # LOCAL local_main_at_Main_internal_60 --> -244($fp) + # local_main_at_Main_internal_60 = + # GOTO label_END_367 +j label_END_367 +label_NEXT0_368: + # local_main_at_Main_internal_62 = TYPE_DISTANCE A + # LOCAL local_main_at_Main_internal_62 --> -252($fp) + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # Load TDT pointer to type A + la $t0, A__TDT + lw $t1, -236($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -252($fp) + # LOCAL local_main_at_Main_internal_62 --> -252($fp) + # LOCAL local_main_at_Main_internal_61 --> -248($fp) + # Update min if 8 < 9 + lw $t0, -252($fp) + lw $t1, -248($fp) + bgtu $t0, $t1, label_NEXT1_369 + # LOCAL local_main_at_Main_a_68 --> -276($fp) + # LOCAL local_main_at_Main_internal_57 --> -232($fp) + # local_main_at_Main_a_68 = local_main_at_Main_internal_57 + lw $t0, -232($fp) + sw $t0, -276($fp) + # LOCAL local_main_at_Main_internal_69 --> -280($fp) + # LOCAL local_main_at_Main_a_68 --> -276($fp) + # local_main_at_Main_internal_69 = local_main_at_Main_a_68 + lw $t0, -276($fp) + sw $t0, -280($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_71 --> -288($fp) + # LOCAL local_main_at_Main_a_68 --> -276($fp) + # local_main_at_Main_internal_71 = local_main_at_Main_a_68 + lw $t0, -276($fp) + sw $t0, -288($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_71 --> -288($fp) + # LOCAL local_main_at_Main_internal_72 --> -292($fp) + # local_main_at_Main_internal_72 = VCALL local_main_at_Main_internal_71 value + # Save new self pointer in $s1 + lw $s1, -288($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -292($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_72 + # LOCAL local_main_at_Main_internal_72 --> -292($fp) + lw $t0, -292($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_69 --> -280($fp) + # LOCAL local_main_at_Main_internal_70 --> -284($fp) + # local_main_at_Main_internal_70 = VCALL local_main_at_Main_internal_69 method3 + # Save new self pointer in $s1 + lw $s1, -280($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -284($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_70 --> -284($fp) + lw $t0, -284($fp) + sw $t0, 16($s1) + # LOCAL local_main_at_Main_internal_60 --> -244($fp) + # local_main_at_Main_internal_60 = + # GOTO label_END_367 +j label_END_367 +label_NEXT1_369: + # local_main_at_Main_internal_62 = TYPE_DISTANCE Object + # LOCAL local_main_at_Main_internal_62 --> -252($fp) + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # Load TDT pointer to type Object + la $t0, Object__TDT + lw $t1, -236($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -252($fp) + # LOCAL local_main_at_Main_internal_62 --> -252($fp) + # LOCAL local_main_at_Main_internal_61 --> -248($fp) + # Update min if 8 < 9 + lw $t0, -252($fp) + lw $t1, -248($fp) + bgtu $t0, $t1, label_NEXT2_370 + # LOCAL local_main_at_Main_o_73 --> -296($fp) + # LOCAL local_main_at_Main_internal_57 --> -232($fp) + # local_main_at_Main_o_73 = local_main_at_Main_internal_57 + lw $t0, -232($fp) + sw $t0, -296($fp) + # LOCAL local_main_at_Main_internal_76 --> -308($fp) + # local_main_at_Main_internal_76 = SELF + sw $s1, -308($fp) + # LOCAL local_main_at_Main_internal_74 --> -300($fp) + # LOCAL local_main_at_Main_internal_76 --> -308($fp) + # local_main_at_Main_internal_74 = local_main_at_Main_internal_76 + lw $t0, -308($fp) + sw $t0, -300($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_77 --> -312($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_62 + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + sw $v0, -312($fp) + # ARG local_main_at_Main_internal_77 + # LOCAL local_main_at_Main_internal_77 --> -312($fp) + lw $t0, -312($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_74 --> -300($fp) + # LOCAL local_main_at_Main_internal_75 --> -304($fp) + # local_main_at_Main_internal_75 = VCALL local_main_at_Main_internal_74 out_string + # Save new self pointer in $s1 + lw $s1, -300($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -304($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_80 --> -324($fp) + # local_main_at_Main_internal_80 = SELF + sw $s1, -324($fp) + # LOCAL local_main_at_Main_internal_78 --> -316($fp) + # LOCAL local_main_at_Main_internal_80 --> -324($fp) + # local_main_at_Main_internal_78 = local_main_at_Main_internal_80 + lw $t0, -324($fp) + sw $t0, -316($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_78 --> -316($fp) + # LOCAL local_main_at_Main_internal_79 --> -320($fp) + # local_main_at_Main_internal_79 = VCALL local_main_at_Main_internal_78 abort + # Save new self pointer in $s1 + lw $s1, -316($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -320($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_81 --> -328($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -328($fp) + # LOCAL local_main_at_Main_internal_60 --> -244($fp) + # LOCAL local_main_at_Main_internal_81 --> -328($fp) + # local_main_at_Main_internal_60 = local_main_at_Main_internal_81 + lw $t0, -328($fp) + sw $t0, -244($fp) + # GOTO label_END_367 +j label_END_367 +label_NEXT2_370: + label_ERROR_366: + # LOCAL local_main_at_Main_internal_57 --> -232($fp) + lw $t0, 0($s1) + sw $t0, -232($fp) + # LOCAL local_main_at_Main_internal_57 --> -232($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -232($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + label_END_367: +# LOCAL local_main_at_Main_internal_52 --> -212($fp) +# LOCAL local_main_at_Main_internal_60 --> -244($fp) +# local_main_at_Main_internal_52 = local_main_at_Main_internal_60 +lw $t0, -244($fp) +sw $t0, -212($fp) +# GOTO label_ENDIF_354 +j label_ENDIF_354 +label_FALSEIF_353: + # local_main_at_Main_internal_86 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_86 --> -348($fp) + lw $t0, 12($s1) + sw $t0, -348($fp) + # LOCAL local_main_at_Main_internal_87 --> -352($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_63 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -352($fp) + # IF_ZERO local_main_at_Main_internal_86 GOTO label_FALSE_373 + # IF_ZERO local_main_at_Main_internal_86 GOTO label_FALSE_373 + lw $t0, -348($fp) + beq $t0, 0, label_FALSE_373 + # IF_ZERO local_main_at_Main_internal_87 GOTO label_FALSE_373 + # IF_ZERO local_main_at_Main_internal_87 GOTO label_FALSE_373 + lw $t0, -352($fp) + beq $t0, 0, label_FALSE_373 + # LOCAL local_main_at_Main_internal_85 --> -344($fp) + # LOCAL local_main_at_Main_internal_86 --> -348($fp) + # Comparing -348($fp) type with String + la $v0, String + lw $a0, -348($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -344($fp) + # IF_ZERO local_main_at_Main_internal_85 GOTO label_COMPARE_STRING_376 + # IF_ZERO local_main_at_Main_internal_85 GOTO label_COMPARE_STRING_376 + lw $t0, -344($fp) + beq $t0, 0, label_COMPARE_STRING_376 + # LOCAL local_main_at_Main_internal_85 --> -344($fp) + # LOCAL local_main_at_Main_internal_86 --> -348($fp) + # Comparing -348($fp) type with Bool + la $v0, Bool + lw $a0, -348($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -344($fp) + # IF_ZERO local_main_at_Main_internal_85 GOTO label_COMPARE_BY_VALUE_377 + # IF_ZERO local_main_at_Main_internal_85 GOTO label_COMPARE_BY_VALUE_377 + lw $t0, -344($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_377 + # LOCAL local_main_at_Main_internal_85 --> -344($fp) + # LOCAL local_main_at_Main_internal_86 --> -348($fp) + # Comparing -348($fp) type with Int + la $v0, Int + lw $a0, -348($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -344($fp) + # IF_ZERO local_main_at_Main_internal_85 GOTO label_COMPARE_BY_VALUE_377 + # IF_ZERO local_main_at_Main_internal_85 GOTO label_COMPARE_BY_VALUE_377 + lw $t0, -344($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_377 + # LOCAL local_main_at_Main_internal_85 --> -344($fp) + # LOCAL local_main_at_Main_internal_86 --> -348($fp) + # LOCAL local_main_at_Main_internal_87 --> -352($fp) + # Load pointers and SUB + lw $a0, -348($fp) + lw $a1, -352($fp) + sub $a0, $a0, $a1 + sw $a0, -344($fp) + # IF_ZERO local_main_at_Main_internal_85 GOTO label_TRUE_374 + # IF_ZERO local_main_at_Main_internal_85 GOTO label_TRUE_374 + lw $t0, -344($fp) + beq $t0, 0, label_TRUE_374 + # GOTO label_FALSE_373 + j label_FALSE_373 + label_COMPARE_BY_VALUE_377: + # LOCAL local_main_at_Main_internal_85 --> -344($fp) + # LOCAL local_main_at_Main_internal_86 --> -348($fp) + # LOCAL local_main_at_Main_internal_87 --> -352($fp) + lw $a0, -348($fp) + lw $a1, -352($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -344($fp) + # IF_ZERO local_main_at_Main_internal_85 GOTO label_TRUE_374 + # IF_ZERO local_main_at_Main_internal_85 GOTO label_TRUE_374 + lw $t0, -344($fp) + beq $t0, 0, label_TRUE_374 + # GOTO label_FALSE_373 + j label_FALSE_373 + label_COMPARE_STRING_376: + # LOCAL local_main_at_Main_internal_85 --> -344($fp) + # LOCAL local_main_at_Main_internal_86 --> -348($fp) + # LOCAL local_main_at_Main_internal_87 --> -352($fp) + # Load strings for comparison + lw $v0, -348($fp) + lw $v1, -352($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -344($fp) + # IF_ZERO local_main_at_Main_internal_85 GOTO label_CONTINUE_378 + # IF_ZERO local_main_at_Main_internal_85 GOTO label_CONTINUE_378 + lw $t0, -344($fp) + beq $t0, 0, label_CONTINUE_378 + # GOTO label_FALSE_373 + j label_FALSE_373 + label_CONTINUE_378: + # LOCAL local_main_at_Main_internal_85 --> -344($fp) + # LOCAL local_main_at_Main_internal_86 --> -348($fp) + # LOCAL local_main_at_Main_internal_87 --> -352($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -348($fp) + lw $v1, -352($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_379: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_380 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_379 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_380: + # Store result + sw $a2, -344($fp) + # IF_ZERO local_main_at_Main_internal_85 GOTO label_TRUE_374 + # IF_ZERO local_main_at_Main_internal_85 GOTO label_TRUE_374 + lw $t0, -344($fp) + beq $t0, 0, label_TRUE_374 + label_FALSE_373: + # LOCAL local_main_at_Main_internal_84 --> -340($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -340($fp) + # GOTO label_END_375 +j label_END_375 +label_TRUE_374: + # LOCAL local_main_at_Main_internal_84 --> -340($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -340($fp) + label_END_375: +# LOCAL local_main_at_Main_internal_82 --> -332($fp) +# LOCAL local_main_at_Main_internal_84 --> -340($fp) +# Obtain value from -340($fp) +lw $v0, -340($fp) +lw $v0, 12($v0) +sw $v0, -332($fp) +# IF_ZERO local_main_at_Main_internal_82 GOTO label_FALSEIF_371 +# IF_ZERO local_main_at_Main_internal_82 GOTO label_FALSEIF_371 +lw $t0, -332($fp) +beq $t0, 0, label_FALSEIF_371 +# LOCAL local_main_at_Main_internal_90 --> -364($fp) +# local_main_at_Main_internal_90 = ALLOCATE A +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, A +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, A_start +sw $t0, 4($v0) +# Load type offset +li $t0, 24 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -364($fp) +# LOCAL local_main_at_Main_internal_88 --> -356($fp) +# LOCAL local_main_at_Main_internal_90 --> -364($fp) +# local_main_at_Main_internal_88 = local_main_at_Main_internal_90 +lw $t0, -364($fp) +sw $t0, -356($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_93 --> -376($fp) +# local_main_at_Main_internal_93 = SELF +sw $s1, -376($fp) +# LOCAL local_main_at_Main_internal_91 --> -368($fp) +# LOCAL local_main_at_Main_internal_93 --> -376($fp) +# local_main_at_Main_internal_91 = local_main_at_Main_internal_93 +lw $t0, -376($fp) +sw $t0, -368($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_91 --> -368($fp) +# LOCAL local_main_at_Main_internal_92 --> -372($fp) +# local_main_at_Main_internal_92 = VCALL local_main_at_Main_internal_91 get_int +# Save new self pointer in $s1 +lw $s1, -368($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 36($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -372($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_92 +# LOCAL local_main_at_Main_internal_92 --> -372($fp) +lw $t0, -372($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_88 --> -356($fp) +# LOCAL local_main_at_Main_internal_89 --> -360($fp) +# local_main_at_Main_internal_89 = VCALL local_main_at_Main_internal_88 set_var +# Save new self pointer in $s1 +lw $s1, -356($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -360($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_main_at_Main_internal_89 --> -360($fp) +lw $t0, -360($fp) +sw $t0, 20($s1) +# LOCAL local_main_at_Main_internal_96 --> -388($fp) +# local_main_at_Main_internal_96 = ALLOCATE D +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, D +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, D_start +sw $t0, 4($v0) +# Load type offset +li $t0, 32 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -388($fp) +# LOCAL local_main_at_Main_internal_94 --> -380($fp) +# LOCAL local_main_at_Main_internal_96 --> -388($fp) +# local_main_at_Main_internal_94 = local_main_at_Main_internal_96 +lw $t0, -388($fp) +sw $t0, -380($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_main_at_Main_internal_99 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_99 --> -400($fp) +lw $t0, 16($s1) +sw $t0, -400($fp) +# LOCAL local_main_at_Main_internal_97 --> -392($fp) +# LOCAL local_main_at_Main_internal_99 --> -400($fp) +# local_main_at_Main_internal_97 = local_main_at_Main_internal_99 +lw $t0, -400($fp) +sw $t0, -392($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_97 --> -392($fp) +# LOCAL local_main_at_Main_internal_98 --> -396($fp) +# local_main_at_Main_internal_98 = VCALL local_main_at_Main_internal_97 value +# Save new self pointer in $s1 +lw $s1, -392($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -396($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_98 +# LOCAL local_main_at_Main_internal_98 --> -396($fp) +lw $t0, -396($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# local_main_at_Main_internal_102 = GETATTRIBUTE a_var Main +# LOCAL local_main_at_Main_internal_102 --> -412($fp) +lw $t0, 20($s1) +sw $t0, -412($fp) +# LOCAL local_main_at_Main_internal_100 --> -404($fp) +# LOCAL local_main_at_Main_internal_102 --> -412($fp) +# local_main_at_Main_internal_100 = local_main_at_Main_internal_102 +lw $t0, -412($fp) +sw $t0, -404($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_100 --> -404($fp) +# LOCAL local_main_at_Main_internal_101 --> -408($fp) +# local_main_at_Main_internal_101 = VCALL local_main_at_Main_internal_100 value +# Save new self pointer in $s1 +lw $s1, -404($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -408($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_101 +# LOCAL local_main_at_Main_internal_101 --> -408($fp) +lw $t0, -408($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_94 --> -380($fp) +# LOCAL local_main_at_Main_internal_95 --> -384($fp) +# local_main_at_Main_internal_95 = VCALL local_main_at_Main_internal_94 method4 +# Save new self pointer in $s1 +lw $s1, -380($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 32($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -384($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_main_at_Main_internal_95 --> -384($fp) +lw $t0, -384($fp) +sw $t0, 16($s1) +# LOCAL local_main_at_Main_internal_83 --> -336($fp) +# local_main_at_Main_internal_83 = +# GOTO label_ENDIF_372 +j label_ENDIF_372 +label_FALSEIF_371: + # local_main_at_Main_internal_107 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_107 --> -432($fp) + lw $t0, 12($s1) + sw $t0, -432($fp) + # LOCAL local_main_at_Main_internal_108 --> -436($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_64 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -436($fp) + # IF_ZERO local_main_at_Main_internal_107 GOTO label_FALSE_383 + # IF_ZERO local_main_at_Main_internal_107 GOTO label_FALSE_383 + lw $t0, -432($fp) + beq $t0, 0, label_FALSE_383 + # IF_ZERO local_main_at_Main_internal_108 GOTO label_FALSE_383 + # IF_ZERO local_main_at_Main_internal_108 GOTO label_FALSE_383 + lw $t0, -436($fp) + beq $t0, 0, label_FALSE_383 + # LOCAL local_main_at_Main_internal_106 --> -428($fp) + # LOCAL local_main_at_Main_internal_107 --> -432($fp) + # Comparing -432($fp) type with String + la $v0, String + lw $a0, -432($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -428($fp) + # IF_ZERO local_main_at_Main_internal_106 GOTO label_COMPARE_STRING_386 + # IF_ZERO local_main_at_Main_internal_106 GOTO label_COMPARE_STRING_386 + lw $t0, -428($fp) + beq $t0, 0, label_COMPARE_STRING_386 + # LOCAL local_main_at_Main_internal_106 --> -428($fp) + # LOCAL local_main_at_Main_internal_107 --> -432($fp) + # Comparing -432($fp) type with Bool + la $v0, Bool + lw $a0, -432($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -428($fp) + # IF_ZERO local_main_at_Main_internal_106 GOTO label_COMPARE_BY_VALUE_387 + # IF_ZERO local_main_at_Main_internal_106 GOTO label_COMPARE_BY_VALUE_387 + lw $t0, -428($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_387 + # LOCAL local_main_at_Main_internal_106 --> -428($fp) + # LOCAL local_main_at_Main_internal_107 --> -432($fp) + # Comparing -432($fp) type with Int + la $v0, Int + lw $a0, -432($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -428($fp) + # IF_ZERO local_main_at_Main_internal_106 GOTO label_COMPARE_BY_VALUE_387 + # IF_ZERO local_main_at_Main_internal_106 GOTO label_COMPARE_BY_VALUE_387 + lw $t0, -428($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_387 + # LOCAL local_main_at_Main_internal_106 --> -428($fp) + # LOCAL local_main_at_Main_internal_107 --> -432($fp) + # LOCAL local_main_at_Main_internal_108 --> -436($fp) + # Load pointers and SUB + lw $a0, -432($fp) + lw $a1, -436($fp) + sub $a0, $a0, $a1 + sw $a0, -428($fp) + # IF_ZERO local_main_at_Main_internal_106 GOTO label_TRUE_384 + # IF_ZERO local_main_at_Main_internal_106 GOTO label_TRUE_384 + lw $t0, -428($fp) + beq $t0, 0, label_TRUE_384 + # GOTO label_FALSE_383 + j label_FALSE_383 + label_COMPARE_BY_VALUE_387: + # LOCAL local_main_at_Main_internal_106 --> -428($fp) + # LOCAL local_main_at_Main_internal_107 --> -432($fp) + # LOCAL local_main_at_Main_internal_108 --> -436($fp) + lw $a0, -432($fp) + lw $a1, -436($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -428($fp) + # IF_ZERO local_main_at_Main_internal_106 GOTO label_TRUE_384 + # IF_ZERO local_main_at_Main_internal_106 GOTO label_TRUE_384 + lw $t0, -428($fp) + beq $t0, 0, label_TRUE_384 + # GOTO label_FALSE_383 + j label_FALSE_383 + label_COMPARE_STRING_386: + # LOCAL local_main_at_Main_internal_106 --> -428($fp) + # LOCAL local_main_at_Main_internal_107 --> -432($fp) + # LOCAL local_main_at_Main_internal_108 --> -436($fp) + # Load strings for comparison + lw $v0, -432($fp) + lw $v1, -436($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -428($fp) + # IF_ZERO local_main_at_Main_internal_106 GOTO label_CONTINUE_388 + # IF_ZERO local_main_at_Main_internal_106 GOTO label_CONTINUE_388 + lw $t0, -428($fp) + beq $t0, 0, label_CONTINUE_388 + # GOTO label_FALSE_383 + j label_FALSE_383 + label_CONTINUE_388: + # LOCAL local_main_at_Main_internal_106 --> -428($fp) + # LOCAL local_main_at_Main_internal_107 --> -432($fp) + # LOCAL local_main_at_Main_internal_108 --> -436($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -432($fp) + lw $v1, -436($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_389: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_390 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_389 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_390: + # Store result + sw $a2, -428($fp) + # IF_ZERO local_main_at_Main_internal_106 GOTO label_TRUE_384 + # IF_ZERO local_main_at_Main_internal_106 GOTO label_TRUE_384 + lw $t0, -428($fp) + beq $t0, 0, label_TRUE_384 + label_FALSE_383: + # LOCAL local_main_at_Main_internal_105 --> -424($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -424($fp) + # GOTO label_END_385 +j label_END_385 +label_TRUE_384: + # LOCAL local_main_at_Main_internal_105 --> -424($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -424($fp) + label_END_385: +# LOCAL local_main_at_Main_internal_103 --> -416($fp) +# LOCAL local_main_at_Main_internal_105 --> -424($fp) +# Obtain value from -424($fp) +lw $v0, -424($fp) +lw $v0, 12($v0) +sw $v0, -416($fp) +# IF_ZERO local_main_at_Main_internal_103 GOTO label_FALSEIF_381 +# IF_ZERO local_main_at_Main_internal_103 GOTO label_FALSEIF_381 +lw $t0, -416($fp) +beq $t0, 0, label_FALSEIF_381 +# LOCAL local_main_at_Main_internal_110 --> -444($fp) +# local_main_at_Main_internal_110 = ALLOCATE C +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, C +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, C_start +sw $t0, 4($v0) +# Load type offset +li $t0, 40 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -444($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_main_at_Main_internal_113 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_113 --> -456($fp) +lw $t0, 16($s1) +sw $t0, -456($fp) +# LOCAL local_main_at_Main_internal_111 --> -448($fp) +# LOCAL local_main_at_Main_internal_113 --> -456($fp) +# local_main_at_Main_internal_111 = local_main_at_Main_internal_113 +lw $t0, -456($fp) +sw $t0, -448($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_111 --> -448($fp) +# LOCAL local_main_at_Main_internal_112 --> -452($fp) +# local_main_at_Main_internal_112 = VCALL local_main_at_Main_internal_111 value +# Save new self pointer in $s1 +lw $s1, -448($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -452($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_112 +# LOCAL local_main_at_Main_internal_112 --> -452($fp) +lw $t0, -452($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# local_main_at_Main_internal_109 = CALL method5 +# LOCAL local_main_at_Main_internal_109 --> -440($fp) +# LOCAL local_main_at_Main_internal_110 --> -444($fp) +# Save new self pointer in $s1 +lw $s1, -444($fp) +# Get pointer to type's VTABLE +la $t0, A_vtable +# Get pointer to function address +lw $t1, 36($t0) +# Call function. Result is on $v0 +jalr $t1 +sw $v0, -440($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_main_at_Main_internal_109 --> -440($fp) +lw $t0, -440($fp) +sw $t0, 16($s1) +# LOCAL local_main_at_Main_internal_104 --> -420($fp) +# local_main_at_Main_internal_104 = +# GOTO label_ENDIF_382 +j label_ENDIF_382 +label_FALSEIF_381: + # local_main_at_Main_internal_118 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_118 --> -476($fp) + lw $t0, 12($s1) + sw $t0, -476($fp) + # LOCAL local_main_at_Main_internal_119 --> -480($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_65 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -480($fp) + # IF_ZERO local_main_at_Main_internal_118 GOTO label_FALSE_393 + # IF_ZERO local_main_at_Main_internal_118 GOTO label_FALSE_393 + lw $t0, -476($fp) + beq $t0, 0, label_FALSE_393 + # IF_ZERO local_main_at_Main_internal_119 GOTO label_FALSE_393 + # IF_ZERO local_main_at_Main_internal_119 GOTO label_FALSE_393 + lw $t0, -480($fp) + beq $t0, 0, label_FALSE_393 + # LOCAL local_main_at_Main_internal_117 --> -472($fp) + # LOCAL local_main_at_Main_internal_118 --> -476($fp) + # Comparing -476($fp) type with String + la $v0, String + lw $a0, -476($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -472($fp) + # IF_ZERO local_main_at_Main_internal_117 GOTO label_COMPARE_STRING_396 + # IF_ZERO local_main_at_Main_internal_117 GOTO label_COMPARE_STRING_396 + lw $t0, -472($fp) + beq $t0, 0, label_COMPARE_STRING_396 + # LOCAL local_main_at_Main_internal_117 --> -472($fp) + # LOCAL local_main_at_Main_internal_118 --> -476($fp) + # Comparing -476($fp) type with Bool + la $v0, Bool + lw $a0, -476($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -472($fp) + # IF_ZERO local_main_at_Main_internal_117 GOTO label_COMPARE_BY_VALUE_397 + # IF_ZERO local_main_at_Main_internal_117 GOTO label_COMPARE_BY_VALUE_397 + lw $t0, -472($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_397 + # LOCAL local_main_at_Main_internal_117 --> -472($fp) + # LOCAL local_main_at_Main_internal_118 --> -476($fp) + # Comparing -476($fp) type with Int + la $v0, Int + lw $a0, -476($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -472($fp) + # IF_ZERO local_main_at_Main_internal_117 GOTO label_COMPARE_BY_VALUE_397 + # IF_ZERO local_main_at_Main_internal_117 GOTO label_COMPARE_BY_VALUE_397 + lw $t0, -472($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_397 + # LOCAL local_main_at_Main_internal_117 --> -472($fp) + # LOCAL local_main_at_Main_internal_118 --> -476($fp) + # LOCAL local_main_at_Main_internal_119 --> -480($fp) + # Load pointers and SUB + lw $a0, -476($fp) + lw $a1, -480($fp) + sub $a0, $a0, $a1 + sw $a0, -472($fp) + # IF_ZERO local_main_at_Main_internal_117 GOTO label_TRUE_394 + # IF_ZERO local_main_at_Main_internal_117 GOTO label_TRUE_394 + lw $t0, -472($fp) + beq $t0, 0, label_TRUE_394 + # GOTO label_FALSE_393 + j label_FALSE_393 + label_COMPARE_BY_VALUE_397: + # LOCAL local_main_at_Main_internal_117 --> -472($fp) + # LOCAL local_main_at_Main_internal_118 --> -476($fp) + # LOCAL local_main_at_Main_internal_119 --> -480($fp) + lw $a0, -476($fp) + lw $a1, -480($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -472($fp) + # IF_ZERO local_main_at_Main_internal_117 GOTO label_TRUE_394 + # IF_ZERO local_main_at_Main_internal_117 GOTO label_TRUE_394 + lw $t0, -472($fp) + beq $t0, 0, label_TRUE_394 + # GOTO label_FALSE_393 + j label_FALSE_393 + label_COMPARE_STRING_396: + # LOCAL local_main_at_Main_internal_117 --> -472($fp) + # LOCAL local_main_at_Main_internal_118 --> -476($fp) + # LOCAL local_main_at_Main_internal_119 --> -480($fp) + # Load strings for comparison + lw $v0, -476($fp) + lw $v1, -480($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -472($fp) + # IF_ZERO local_main_at_Main_internal_117 GOTO label_CONTINUE_398 + # IF_ZERO local_main_at_Main_internal_117 GOTO label_CONTINUE_398 + lw $t0, -472($fp) + beq $t0, 0, label_CONTINUE_398 + # GOTO label_FALSE_393 + j label_FALSE_393 + label_CONTINUE_398: + # LOCAL local_main_at_Main_internal_117 --> -472($fp) + # LOCAL local_main_at_Main_internal_118 --> -476($fp) + # LOCAL local_main_at_Main_internal_119 --> -480($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -476($fp) + lw $v1, -480($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_399: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_400 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_399 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_400: + # Store result + sw $a2, -472($fp) + # IF_ZERO local_main_at_Main_internal_117 GOTO label_TRUE_394 + # IF_ZERO local_main_at_Main_internal_117 GOTO label_TRUE_394 + lw $t0, -472($fp) + beq $t0, 0, label_TRUE_394 + label_FALSE_393: + # LOCAL local_main_at_Main_internal_116 --> -468($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -468($fp) + # GOTO label_END_395 +j label_END_395 +label_TRUE_394: + # LOCAL local_main_at_Main_internal_116 --> -468($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -468($fp) + label_END_395: +# LOCAL local_main_at_Main_internal_114 --> -460($fp) +# LOCAL local_main_at_Main_internal_116 --> -468($fp) +# Obtain value from -468($fp) +lw $v0, -468($fp) +lw $v0, 12($v0) +sw $v0, -460($fp) +# IF_ZERO local_main_at_Main_internal_114 GOTO label_FALSEIF_391 +# IF_ZERO local_main_at_Main_internal_114 GOTO label_FALSEIF_391 +lw $t0, -460($fp) +beq $t0, 0, label_FALSEIF_391 +# LOCAL local_main_at_Main_internal_121 --> -488($fp) +# local_main_at_Main_internal_121 = ALLOCATE C +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, C +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, C_start +sw $t0, 4($v0) +# Load type offset +li $t0, 40 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -488($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_main_at_Main_internal_124 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_124 --> -500($fp) +lw $t0, 16($s1) +sw $t0, -500($fp) +# LOCAL local_main_at_Main_internal_122 --> -492($fp) +# LOCAL local_main_at_Main_internal_124 --> -500($fp) +# local_main_at_Main_internal_122 = local_main_at_Main_internal_124 +lw $t0, -500($fp) +sw $t0, -492($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_122 --> -492($fp) +# LOCAL local_main_at_Main_internal_123 --> -496($fp) +# local_main_at_Main_internal_123 = VCALL local_main_at_Main_internal_122 value +# Save new self pointer in $s1 +lw $s1, -492($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -496($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_123 +# LOCAL local_main_at_Main_internal_123 --> -496($fp) +lw $t0, -496($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# local_main_at_Main_internal_120 = CALL method5 +# LOCAL local_main_at_Main_internal_120 --> -484($fp) +# LOCAL local_main_at_Main_internal_121 --> -488($fp) +# Save new self pointer in $s1 +lw $s1, -488($fp) +# Get pointer to type's VTABLE +la $t0, B_vtable +# Get pointer to function address +lw $t1, 36($t0) +# Call function. Result is on $v0 +jalr $t1 +sw $v0, -484($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_main_at_Main_internal_120 --> -484($fp) +lw $t0, -484($fp) +sw $t0, 16($s1) +# LOCAL local_main_at_Main_internal_115 --> -464($fp) +# local_main_at_Main_internal_115 = +# GOTO label_ENDIF_392 +j label_ENDIF_392 +label_FALSEIF_391: + # local_main_at_Main_internal_129 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_129 --> -520($fp) + lw $t0, 12($s1) + sw $t0, -520($fp) + # LOCAL local_main_at_Main_internal_130 --> -524($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_66 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -524($fp) + # IF_ZERO local_main_at_Main_internal_129 GOTO label_FALSE_403 + # IF_ZERO local_main_at_Main_internal_129 GOTO label_FALSE_403 + lw $t0, -520($fp) + beq $t0, 0, label_FALSE_403 + # IF_ZERO local_main_at_Main_internal_130 GOTO label_FALSE_403 + # IF_ZERO local_main_at_Main_internal_130 GOTO label_FALSE_403 + lw $t0, -524($fp) + beq $t0, 0, label_FALSE_403 + # LOCAL local_main_at_Main_internal_128 --> -516($fp) + # LOCAL local_main_at_Main_internal_129 --> -520($fp) + # Comparing -520($fp) type with String + la $v0, String + lw $a0, -520($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -516($fp) + # IF_ZERO local_main_at_Main_internal_128 GOTO label_COMPARE_STRING_406 + # IF_ZERO local_main_at_Main_internal_128 GOTO label_COMPARE_STRING_406 + lw $t0, -516($fp) + beq $t0, 0, label_COMPARE_STRING_406 + # LOCAL local_main_at_Main_internal_128 --> -516($fp) + # LOCAL local_main_at_Main_internal_129 --> -520($fp) + # Comparing -520($fp) type with Bool + la $v0, Bool + lw $a0, -520($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -516($fp) + # IF_ZERO local_main_at_Main_internal_128 GOTO label_COMPARE_BY_VALUE_407 + # IF_ZERO local_main_at_Main_internal_128 GOTO label_COMPARE_BY_VALUE_407 + lw $t0, -516($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_407 + # LOCAL local_main_at_Main_internal_128 --> -516($fp) + # LOCAL local_main_at_Main_internal_129 --> -520($fp) + # Comparing -520($fp) type with Int + la $v0, Int + lw $a0, -520($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -516($fp) + # IF_ZERO local_main_at_Main_internal_128 GOTO label_COMPARE_BY_VALUE_407 + # IF_ZERO local_main_at_Main_internal_128 GOTO label_COMPARE_BY_VALUE_407 + lw $t0, -516($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_407 + # LOCAL local_main_at_Main_internal_128 --> -516($fp) + # LOCAL local_main_at_Main_internal_129 --> -520($fp) + # LOCAL local_main_at_Main_internal_130 --> -524($fp) + # Load pointers and SUB + lw $a0, -520($fp) + lw $a1, -524($fp) + sub $a0, $a0, $a1 + sw $a0, -516($fp) + # IF_ZERO local_main_at_Main_internal_128 GOTO label_TRUE_404 + # IF_ZERO local_main_at_Main_internal_128 GOTO label_TRUE_404 + lw $t0, -516($fp) + beq $t0, 0, label_TRUE_404 + # GOTO label_FALSE_403 + j label_FALSE_403 + label_COMPARE_BY_VALUE_407: + # LOCAL local_main_at_Main_internal_128 --> -516($fp) + # LOCAL local_main_at_Main_internal_129 --> -520($fp) + # LOCAL local_main_at_Main_internal_130 --> -524($fp) + lw $a0, -520($fp) + lw $a1, -524($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -516($fp) + # IF_ZERO local_main_at_Main_internal_128 GOTO label_TRUE_404 + # IF_ZERO local_main_at_Main_internal_128 GOTO label_TRUE_404 + lw $t0, -516($fp) + beq $t0, 0, label_TRUE_404 + # GOTO label_FALSE_403 + j label_FALSE_403 + label_COMPARE_STRING_406: + # LOCAL local_main_at_Main_internal_128 --> -516($fp) + # LOCAL local_main_at_Main_internal_129 --> -520($fp) + # LOCAL local_main_at_Main_internal_130 --> -524($fp) + # Load strings for comparison + lw $v0, -520($fp) + lw $v1, -524($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -516($fp) + # IF_ZERO local_main_at_Main_internal_128 GOTO label_CONTINUE_408 + # IF_ZERO local_main_at_Main_internal_128 GOTO label_CONTINUE_408 + lw $t0, -516($fp) + beq $t0, 0, label_CONTINUE_408 + # GOTO label_FALSE_403 + j label_FALSE_403 + label_CONTINUE_408: + # LOCAL local_main_at_Main_internal_128 --> -516($fp) + # LOCAL local_main_at_Main_internal_129 --> -520($fp) + # LOCAL local_main_at_Main_internal_130 --> -524($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -520($fp) + lw $v1, -524($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_409: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_410 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_409 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_410: + # Store result + sw $a2, -516($fp) + # IF_ZERO local_main_at_Main_internal_128 GOTO label_TRUE_404 + # IF_ZERO local_main_at_Main_internal_128 GOTO label_TRUE_404 + lw $t0, -516($fp) + beq $t0, 0, label_TRUE_404 + label_FALSE_403: + # LOCAL local_main_at_Main_internal_127 --> -512($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -512($fp) + # GOTO label_END_405 +j label_END_405 +label_TRUE_404: + # LOCAL local_main_at_Main_internal_127 --> -512($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -512($fp) + label_END_405: +# LOCAL local_main_at_Main_internal_125 --> -504($fp) +# LOCAL local_main_at_Main_internal_127 --> -512($fp) +# Obtain value from -512($fp) +lw $v0, -512($fp) +lw $v0, 12($v0) +sw $v0, -504($fp) +# IF_ZERO local_main_at_Main_internal_125 GOTO label_FALSEIF_401 +# IF_ZERO local_main_at_Main_internal_125 GOTO label_FALSEIF_401 +lw $t0, -504($fp) +beq $t0, 0, label_FALSEIF_401 +# LOCAL local_main_at_Main_internal_132 --> -532($fp) +# local_main_at_Main_internal_132 = ALLOCATE C +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, C +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, C_start +sw $t0, 4($v0) +# Load type offset +li $t0, 40 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -532($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_main_at_Main_internal_135 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_135 --> -544($fp) +lw $t0, 16($s1) +sw $t0, -544($fp) +# LOCAL local_main_at_Main_internal_133 --> -536($fp) +# LOCAL local_main_at_Main_internal_135 --> -544($fp) +# local_main_at_Main_internal_133 = local_main_at_Main_internal_135 +lw $t0, -544($fp) +sw $t0, -536($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_133 --> -536($fp) +# LOCAL local_main_at_Main_internal_134 --> -540($fp) +# local_main_at_Main_internal_134 = VCALL local_main_at_Main_internal_133 value +# Save new self pointer in $s1 +lw $s1, -536($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -540($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_134 +# LOCAL local_main_at_Main_internal_134 --> -540($fp) +lw $t0, -540($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# local_main_at_Main_internal_131 = CALL method5 +# LOCAL local_main_at_Main_internal_131 --> -528($fp) +# LOCAL local_main_at_Main_internal_132 --> -532($fp) +# Save new self pointer in $s1 +lw $s1, -532($fp) +# Get pointer to type's VTABLE +la $t0, C_vtable +# Get pointer to function address +lw $t1, 36($t0) +# Call function. Result is on $v0 +jalr $t1 +sw $v0, -528($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_main_at_Main_internal_131 --> -528($fp) +lw $t0, -528($fp) +sw $t0, 16($s1) +# LOCAL local_main_at_Main_internal_126 --> -508($fp) +# local_main_at_Main_internal_126 = +# GOTO label_ENDIF_402 +j label_ENDIF_402 +label_FALSEIF_401: + # local_main_at_Main_internal_140 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_140 --> -564($fp) + lw $t0, 12($s1) + sw $t0, -564($fp) + # LOCAL local_main_at_Main_internal_141 --> -568($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_67 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -568($fp) + # IF_ZERO local_main_at_Main_internal_140 GOTO label_FALSE_413 + # IF_ZERO local_main_at_Main_internal_140 GOTO label_FALSE_413 + lw $t0, -564($fp) + beq $t0, 0, label_FALSE_413 + # IF_ZERO local_main_at_Main_internal_141 GOTO label_FALSE_413 + # IF_ZERO local_main_at_Main_internal_141 GOTO label_FALSE_413 + lw $t0, -568($fp) + beq $t0, 0, label_FALSE_413 + # LOCAL local_main_at_Main_internal_139 --> -560($fp) + # LOCAL local_main_at_Main_internal_140 --> -564($fp) + # Comparing -564($fp) type with String + la $v0, String + lw $a0, -564($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -560($fp) + # IF_ZERO local_main_at_Main_internal_139 GOTO label_COMPARE_STRING_416 + # IF_ZERO local_main_at_Main_internal_139 GOTO label_COMPARE_STRING_416 + lw $t0, -560($fp) + beq $t0, 0, label_COMPARE_STRING_416 + # LOCAL local_main_at_Main_internal_139 --> -560($fp) + # LOCAL local_main_at_Main_internal_140 --> -564($fp) + # Comparing -564($fp) type with Bool + la $v0, Bool + lw $a0, -564($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -560($fp) + # IF_ZERO local_main_at_Main_internal_139 GOTO label_COMPARE_BY_VALUE_417 + # IF_ZERO local_main_at_Main_internal_139 GOTO label_COMPARE_BY_VALUE_417 + lw $t0, -560($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_417 + # LOCAL local_main_at_Main_internal_139 --> -560($fp) + # LOCAL local_main_at_Main_internal_140 --> -564($fp) + # Comparing -564($fp) type with Int + la $v0, Int + lw $a0, -564($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -560($fp) + # IF_ZERO local_main_at_Main_internal_139 GOTO label_COMPARE_BY_VALUE_417 + # IF_ZERO local_main_at_Main_internal_139 GOTO label_COMPARE_BY_VALUE_417 + lw $t0, -560($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_417 + # LOCAL local_main_at_Main_internal_139 --> -560($fp) + # LOCAL local_main_at_Main_internal_140 --> -564($fp) + # LOCAL local_main_at_Main_internal_141 --> -568($fp) + # Load pointers and SUB + lw $a0, -564($fp) + lw $a1, -568($fp) + sub $a0, $a0, $a1 + sw $a0, -560($fp) + # IF_ZERO local_main_at_Main_internal_139 GOTO label_TRUE_414 + # IF_ZERO local_main_at_Main_internal_139 GOTO label_TRUE_414 + lw $t0, -560($fp) + beq $t0, 0, label_TRUE_414 + # GOTO label_FALSE_413 + j label_FALSE_413 + label_COMPARE_BY_VALUE_417: + # LOCAL local_main_at_Main_internal_139 --> -560($fp) + # LOCAL local_main_at_Main_internal_140 --> -564($fp) + # LOCAL local_main_at_Main_internal_141 --> -568($fp) + lw $a0, -564($fp) + lw $a1, -568($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -560($fp) + # IF_ZERO local_main_at_Main_internal_139 GOTO label_TRUE_414 + # IF_ZERO local_main_at_Main_internal_139 GOTO label_TRUE_414 + lw $t0, -560($fp) + beq $t0, 0, label_TRUE_414 + # GOTO label_FALSE_413 + j label_FALSE_413 + label_COMPARE_STRING_416: + # LOCAL local_main_at_Main_internal_139 --> -560($fp) + # LOCAL local_main_at_Main_internal_140 --> -564($fp) + # LOCAL local_main_at_Main_internal_141 --> -568($fp) + # Load strings for comparison + lw $v0, -564($fp) + lw $v1, -568($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -560($fp) + # IF_ZERO local_main_at_Main_internal_139 GOTO label_CONTINUE_418 + # IF_ZERO local_main_at_Main_internal_139 GOTO label_CONTINUE_418 + lw $t0, -560($fp) + beq $t0, 0, label_CONTINUE_418 + # GOTO label_FALSE_413 + j label_FALSE_413 + label_CONTINUE_418: + # LOCAL local_main_at_Main_internal_139 --> -560($fp) + # LOCAL local_main_at_Main_internal_140 --> -564($fp) + # LOCAL local_main_at_Main_internal_141 --> -568($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -564($fp) + lw $v1, -568($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_419: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_420 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_419 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_420: + # Store result + sw $a2, -560($fp) + # IF_ZERO local_main_at_Main_internal_139 GOTO label_TRUE_414 + # IF_ZERO local_main_at_Main_internal_139 GOTO label_TRUE_414 + lw $t0, -560($fp) + beq $t0, 0, label_TRUE_414 + label_FALSE_413: + # LOCAL local_main_at_Main_internal_138 --> -556($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -556($fp) + # GOTO label_END_415 +j label_END_415 +label_TRUE_414: + # LOCAL local_main_at_Main_internal_138 --> -556($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -556($fp) + label_END_415: +# LOCAL local_main_at_Main_internal_136 --> -548($fp) +# LOCAL local_main_at_Main_internal_138 --> -556($fp) +# Obtain value from -556($fp) +lw $v0, -556($fp) +lw $v0, 12($v0) +sw $v0, -548($fp) +# IF_ZERO local_main_at_Main_internal_136 GOTO label_FALSEIF_411 +# IF_ZERO local_main_at_Main_internal_136 GOTO label_FALSEIF_411 +lw $t0, -548($fp) +beq $t0, 0, label_FALSEIF_411 +# LOCAL local_main_at_Main_internal_146 --> -588($fp) +# local_main_at_Main_internal_146 = ALLOCATE D +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, D +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, D_start +sw $t0, 4($v0) +# Load type offset +li $t0, 32 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -588($fp) +# LOCAL local_main_at_Main_internal_144 --> -580($fp) +# LOCAL local_main_at_Main_internal_146 --> -588($fp) +# local_main_at_Main_internal_144 = local_main_at_Main_internal_146 +lw $t0, -588($fp) +sw $t0, -580($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_main_at_Main_internal_149 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_149 --> -600($fp) +lw $t0, 16($s1) +sw $t0, -600($fp) +# LOCAL local_main_at_Main_internal_147 --> -592($fp) +# LOCAL local_main_at_Main_internal_149 --> -600($fp) +# local_main_at_Main_internal_147 = local_main_at_Main_internal_149 +lw $t0, -600($fp) +sw $t0, -592($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_147 --> -592($fp) +# LOCAL local_main_at_Main_internal_148 --> -596($fp) +# local_main_at_Main_internal_148 = VCALL local_main_at_Main_internal_147 value +# Save new self pointer in $s1 +lw $s1, -592($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -596($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_148 +# LOCAL local_main_at_Main_internal_148 --> -596($fp) +lw $t0, -596($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_144 --> -580($fp) +# LOCAL local_main_at_Main_internal_145 --> -584($fp) +# local_main_at_Main_internal_145 = VCALL local_main_at_Main_internal_144 method7 +# Save new self pointer in $s1 +lw $s1, -580($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 40($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -584($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_142 --> -572($fp) +# LOCAL local_main_at_Main_internal_145 --> -584($fp) +# Obtain value from -584($fp) +lw $v0, -584($fp) +lw $v0, 12($v0) +sw $v0, -572($fp) +# IF_ZERO local_main_at_Main_internal_142 GOTO label_FALSEIF_421 +# IF_ZERO local_main_at_Main_internal_142 GOTO label_FALSEIF_421 +lw $t0, -572($fp) +beq $t0, 0, label_FALSEIF_421 +# LOCAL local_main_at_Main_internal_152 --> -612($fp) +# local_main_at_Main_internal_152 = SELF +sw $s1, -612($fp) +# LOCAL local_main_at_Main_internal_150 --> -604($fp) +# LOCAL local_main_at_Main_internal_152 --> -612($fp) +# local_main_at_Main_internal_150 = local_main_at_Main_internal_152 +lw $t0, -612($fp) +sw $t0, -604($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_153 --> -616($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_68 +sw $t0, 12($v0) +li $t0, 7 +sw $t0, 16($v0) +sw $v0, -616($fp) +# ARG local_main_at_Main_internal_153 +# LOCAL local_main_at_Main_internal_153 --> -616($fp) +lw $t0, -616($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_150 --> -604($fp) +# LOCAL local_main_at_Main_internal_151 --> -608($fp) +# local_main_at_Main_internal_151 = VCALL local_main_at_Main_internal_150 out_string +# Save new self pointer in $s1 +lw $s1, -604($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -608($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_156 --> -628($fp) +# local_main_at_Main_internal_156 = SELF +sw $s1, -628($fp) +# LOCAL local_main_at_Main_internal_154 --> -620($fp) +# LOCAL local_main_at_Main_internal_156 --> -628($fp) +# local_main_at_Main_internal_154 = local_main_at_Main_internal_156 +lw $t0, -628($fp) +sw $t0, -620($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_main_at_Main_internal_157 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_157 --> -632($fp) +lw $t0, 16($s1) +sw $t0, -632($fp) +# ARG local_main_at_Main_internal_157 +# LOCAL local_main_at_Main_internal_157 --> -632($fp) +lw $t0, -632($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_154 --> -620($fp) +# LOCAL local_main_at_Main_internal_155 --> -624($fp) +# local_main_at_Main_internal_155 = VCALL local_main_at_Main_internal_154 print +# Save new self pointer in $s1 +lw $s1, -620($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 48($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -624($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_160 --> -644($fp) +# local_main_at_Main_internal_160 = SELF +sw $s1, -644($fp) +# LOCAL local_main_at_Main_internal_158 --> -636($fp) +# LOCAL local_main_at_Main_internal_160 --> -644($fp) +# local_main_at_Main_internal_158 = local_main_at_Main_internal_160 +lw $t0, -644($fp) +sw $t0, -636($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_161 --> -648($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_69 +sw $t0, 12($v0) +li $t0, 19 +sw $t0, 16($v0) +sw $v0, -648($fp) +# ARG local_main_at_Main_internal_161 +# LOCAL local_main_at_Main_internal_161 --> -648($fp) +lw $t0, -648($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_158 --> -636($fp) +# LOCAL local_main_at_Main_internal_159 --> -640($fp) +# local_main_at_Main_internal_159 = VCALL local_main_at_Main_internal_158 out_string +# Save new self pointer in $s1 +lw $s1, -636($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -640($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_143 --> -576($fp) +# LOCAL local_main_at_Main_internal_159 --> -640($fp) +# local_main_at_Main_internal_143 = local_main_at_Main_internal_159 +lw $t0, -640($fp) +sw $t0, -576($fp) +# GOTO label_ENDIF_422 +j label_ENDIF_422 +label_FALSEIF_421: + # LOCAL local_main_at_Main_internal_164 --> -660($fp) + # local_main_at_Main_internal_164 = SELF + sw $s1, -660($fp) + # LOCAL local_main_at_Main_internal_162 --> -652($fp) + # LOCAL local_main_at_Main_internal_164 --> -660($fp) + # local_main_at_Main_internal_162 = local_main_at_Main_internal_164 + lw $t0, -660($fp) + sw $t0, -652($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_165 --> -664($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_70 + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + sw $v0, -664($fp) + # ARG local_main_at_Main_internal_165 + # LOCAL local_main_at_Main_internal_165 --> -664($fp) + lw $t0, -664($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_162 --> -652($fp) + # LOCAL local_main_at_Main_internal_163 --> -656($fp) + # local_main_at_Main_internal_163 = VCALL local_main_at_Main_internal_162 out_string + # Save new self pointer in $s1 + lw $s1, -652($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -656($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_168 --> -676($fp) + # local_main_at_Main_internal_168 = SELF + sw $s1, -676($fp) + # LOCAL local_main_at_Main_internal_166 --> -668($fp) + # LOCAL local_main_at_Main_internal_168 --> -676($fp) + # local_main_at_Main_internal_166 = local_main_at_Main_internal_168 + lw $t0, -676($fp) + sw $t0, -668($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_main_at_Main_internal_169 = GETATTRIBUTE avar Main + # LOCAL local_main_at_Main_internal_169 --> -680($fp) + lw $t0, 16($s1) + sw $t0, -680($fp) + # ARG local_main_at_Main_internal_169 + # LOCAL local_main_at_Main_internal_169 --> -680($fp) + lw $t0, -680($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_166 --> -668($fp) + # LOCAL local_main_at_Main_internal_167 --> -672($fp) + # local_main_at_Main_internal_167 = VCALL local_main_at_Main_internal_166 print + # Save new self pointer in $s1 + lw $s1, -668($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -672($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_172 --> -692($fp) + # local_main_at_Main_internal_172 = SELF + sw $s1, -692($fp) + # LOCAL local_main_at_Main_internal_170 --> -684($fp) + # LOCAL local_main_at_Main_internal_172 --> -692($fp) + # local_main_at_Main_internal_170 = local_main_at_Main_internal_172 + lw $t0, -692($fp) + sw $t0, -684($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_173 --> -696($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_71 + sw $t0, 12($v0) + li $t0, 23 + sw $t0, 16($v0) + sw $v0, -696($fp) + # ARG local_main_at_Main_internal_173 + # LOCAL local_main_at_Main_internal_173 --> -696($fp) + lw $t0, -696($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_170 --> -684($fp) + # LOCAL local_main_at_Main_internal_171 --> -688($fp) + # local_main_at_Main_internal_171 = VCALL local_main_at_Main_internal_170 out_string + # Save new self pointer in $s1 + lw $s1, -684($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -688($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_143 --> -576($fp) + # LOCAL local_main_at_Main_internal_171 --> -688($fp) + # local_main_at_Main_internal_143 = local_main_at_Main_internal_171 + lw $t0, -688($fp) + sw $t0, -576($fp) + label_ENDIF_422: +# LOCAL local_main_at_Main_internal_137 --> -552($fp) +# LOCAL local_main_at_Main_internal_143 --> -576($fp) +# local_main_at_Main_internal_137 = local_main_at_Main_internal_143 +lw $t0, -576($fp) +sw $t0, -552($fp) +# GOTO label_ENDIF_412 +j label_ENDIF_412 +label_FALSEIF_411: + # local_main_at_Main_internal_178 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_178 --> -716($fp) + lw $t0, 12($s1) + sw $t0, -716($fp) + # LOCAL local_main_at_Main_internal_179 --> -720($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_72 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -720($fp) + # IF_ZERO local_main_at_Main_internal_178 GOTO label_FALSE_425 + # IF_ZERO local_main_at_Main_internal_178 GOTO label_FALSE_425 + lw $t0, -716($fp) + beq $t0, 0, label_FALSE_425 + # IF_ZERO local_main_at_Main_internal_179 GOTO label_FALSE_425 + # IF_ZERO local_main_at_Main_internal_179 GOTO label_FALSE_425 + lw $t0, -720($fp) + beq $t0, 0, label_FALSE_425 + # LOCAL local_main_at_Main_internal_177 --> -712($fp) + # LOCAL local_main_at_Main_internal_178 --> -716($fp) + # Comparing -716($fp) type with String + la $v0, String + lw $a0, -716($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -712($fp) + # IF_ZERO local_main_at_Main_internal_177 GOTO label_COMPARE_STRING_428 + # IF_ZERO local_main_at_Main_internal_177 GOTO label_COMPARE_STRING_428 + lw $t0, -712($fp) + beq $t0, 0, label_COMPARE_STRING_428 + # LOCAL local_main_at_Main_internal_177 --> -712($fp) + # LOCAL local_main_at_Main_internal_178 --> -716($fp) + # Comparing -716($fp) type with Bool + la $v0, Bool + lw $a0, -716($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -712($fp) + # IF_ZERO local_main_at_Main_internal_177 GOTO label_COMPARE_BY_VALUE_429 + # IF_ZERO local_main_at_Main_internal_177 GOTO label_COMPARE_BY_VALUE_429 + lw $t0, -712($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_429 + # LOCAL local_main_at_Main_internal_177 --> -712($fp) + # LOCAL local_main_at_Main_internal_178 --> -716($fp) + # Comparing -716($fp) type with Int + la $v0, Int + lw $a0, -716($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -712($fp) + # IF_ZERO local_main_at_Main_internal_177 GOTO label_COMPARE_BY_VALUE_429 + # IF_ZERO local_main_at_Main_internal_177 GOTO label_COMPARE_BY_VALUE_429 + lw $t0, -712($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_429 + # LOCAL local_main_at_Main_internal_177 --> -712($fp) + # LOCAL local_main_at_Main_internal_178 --> -716($fp) + # LOCAL local_main_at_Main_internal_179 --> -720($fp) + # Load pointers and SUB + lw $a0, -716($fp) + lw $a1, -720($fp) + sub $a0, $a0, $a1 + sw $a0, -712($fp) + # IF_ZERO local_main_at_Main_internal_177 GOTO label_TRUE_426 + # IF_ZERO local_main_at_Main_internal_177 GOTO label_TRUE_426 + lw $t0, -712($fp) + beq $t0, 0, label_TRUE_426 + # GOTO label_FALSE_425 + j label_FALSE_425 + label_COMPARE_BY_VALUE_429: + # LOCAL local_main_at_Main_internal_177 --> -712($fp) + # LOCAL local_main_at_Main_internal_178 --> -716($fp) + # LOCAL local_main_at_Main_internal_179 --> -720($fp) + lw $a0, -716($fp) + lw $a1, -720($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -712($fp) + # IF_ZERO local_main_at_Main_internal_177 GOTO label_TRUE_426 + # IF_ZERO local_main_at_Main_internal_177 GOTO label_TRUE_426 + lw $t0, -712($fp) + beq $t0, 0, label_TRUE_426 + # GOTO label_FALSE_425 + j label_FALSE_425 + label_COMPARE_STRING_428: + # LOCAL local_main_at_Main_internal_177 --> -712($fp) + # LOCAL local_main_at_Main_internal_178 --> -716($fp) + # LOCAL local_main_at_Main_internal_179 --> -720($fp) + # Load strings for comparison + lw $v0, -716($fp) + lw $v1, -720($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -712($fp) + # IF_ZERO local_main_at_Main_internal_177 GOTO label_CONTINUE_430 + # IF_ZERO local_main_at_Main_internal_177 GOTO label_CONTINUE_430 + lw $t0, -712($fp) + beq $t0, 0, label_CONTINUE_430 + # GOTO label_FALSE_425 + j label_FALSE_425 + label_CONTINUE_430: + # LOCAL local_main_at_Main_internal_177 --> -712($fp) + # LOCAL local_main_at_Main_internal_178 --> -716($fp) + # LOCAL local_main_at_Main_internal_179 --> -720($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -716($fp) + lw $v1, -720($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_431: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_432 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_431 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_432: + # Store result + sw $a2, -712($fp) + # IF_ZERO local_main_at_Main_internal_177 GOTO label_TRUE_426 + # IF_ZERO local_main_at_Main_internal_177 GOTO label_TRUE_426 + lw $t0, -712($fp) + beq $t0, 0, label_TRUE_426 + label_FALSE_425: + # LOCAL local_main_at_Main_internal_176 --> -708($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -708($fp) + # GOTO label_END_427 +j label_END_427 +label_TRUE_426: + # LOCAL local_main_at_Main_internal_176 --> -708($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -708($fp) + label_END_427: +# LOCAL local_main_at_Main_internal_174 --> -700($fp) +# LOCAL local_main_at_Main_internal_176 --> -708($fp) +# Obtain value from -708($fp) +lw $v0, -708($fp) +lw $v0, 12($v0) +sw $v0, -700($fp) +# IF_ZERO local_main_at_Main_internal_174 GOTO label_FALSEIF_423 +# IF_ZERO local_main_at_Main_internal_174 GOTO label_FALSEIF_423 +lw $t0, -700($fp) +beq $t0, 0, label_FALSEIF_423 +# LOCAL local_main_at_Main_x_180 --> -724($fp) +# local_main_at_Main_x_180 = ALLOCATE A +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, A +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, A_start +sw $t0, 4($v0) +# Load type offset +li $t0, 24 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -724($fp) +# LOCAL local_main_at_Main_internal_183 --> -736($fp) +# local_main_at_Main_internal_183 = ALLOCATE E +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, E +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, E_start +sw $t0, 4($v0) +# Load type offset +li $t0, 36 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -736($fp) +# LOCAL local_main_at_Main_internal_181 --> -728($fp) +# LOCAL local_main_at_Main_internal_183 --> -736($fp) +# local_main_at_Main_internal_181 = local_main_at_Main_internal_183 +lw $t0, -736($fp) +sw $t0, -728($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_main_at_Main_internal_186 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_186 --> -748($fp) +lw $t0, 16($s1) +sw $t0, -748($fp) +# LOCAL local_main_at_Main_internal_184 --> -740($fp) +# LOCAL local_main_at_Main_internal_186 --> -748($fp) +# local_main_at_Main_internal_184 = local_main_at_Main_internal_186 +lw $t0, -748($fp) +sw $t0, -740($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_184 --> -740($fp) +# LOCAL local_main_at_Main_internal_185 --> -744($fp) +# local_main_at_Main_internal_185 = VCALL local_main_at_Main_internal_184 value +# Save new self pointer in $s1 +lw $s1, -740($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -744($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_185 +# LOCAL local_main_at_Main_internal_185 --> -744($fp) +lw $t0, -744($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_181 --> -728($fp) +# LOCAL local_main_at_Main_internal_182 --> -732($fp) +# local_main_at_Main_internal_182 = VCALL local_main_at_Main_internal_181 method6 +# Save new self pointer in $s1 +lw $s1, -728($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 44($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -732($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_x_180 --> -724($fp) +# LOCAL local_main_at_Main_internal_182 --> -732($fp) +# local_main_at_Main_x_180 = local_main_at_Main_internal_182 +lw $t0, -732($fp) +sw $t0, -724($fp) +# LOCAL local_main_at_Main_r_187 --> -752($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -752($fp) +# local_main_at_Main_internal_191 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_191 --> -768($fp) +lw $t0, 16($s1) +sw $t0, -768($fp) +# LOCAL local_main_at_Main_internal_189 --> -760($fp) +# LOCAL local_main_at_Main_internal_191 --> -768($fp) +# local_main_at_Main_internal_189 = local_main_at_Main_internal_191 +lw $t0, -768($fp) +sw $t0, -760($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_189 --> -760($fp) +# LOCAL local_main_at_Main_internal_190 --> -764($fp) +# local_main_at_Main_internal_190 = VCALL local_main_at_Main_internal_189 value +# Save new self pointer in $s1 +lw $s1, -760($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -764($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_193 --> -776($fp) +# LOCAL local_main_at_Main_x_180 --> -724($fp) +# local_main_at_Main_internal_193 = local_main_at_Main_x_180 +lw $t0, -724($fp) +sw $t0, -776($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_193 --> -776($fp) +# LOCAL local_main_at_Main_internal_194 --> -780($fp) +# local_main_at_Main_internal_194 = VCALL local_main_at_Main_internal_193 value +# Save new self pointer in $s1 +lw $s1, -776($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -780($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_195 --> -784($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 8 +sw $t0, 12($v0) +sw $v0, -784($fp) +# LOCAL local_main_at_Main_internal_192 --> -772($fp) +# LOCAL local_main_at_Main_internal_194 --> -780($fp) +# LOCAL local_main_at_Main_internal_195 --> -784($fp) +# local_main_at_Main_internal_192 = local_main_at_Main_internal_194 * local_main_at_Main_internal_195 +lw $t1, -780($fp) +lw $t0, 12($t1) +lw $t1, -784($fp) +lw $t2, 12($t1) +mul $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -772($fp) +# LOCAL local_main_at_Main_internal_188 --> -756($fp) +# LOCAL local_main_at_Main_internal_190 --> -764($fp) +# LOCAL local_main_at_Main_internal_192 --> -772($fp) +# local_main_at_Main_internal_188 = local_main_at_Main_internal_190 - local_main_at_Main_internal_192 +lw $t1, -764($fp) +lw $t0, 12($t1) +lw $t1, -772($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -756($fp) +# LOCAL local_main_at_Main_r_187 --> -752($fp) +# LOCAL local_main_at_Main_internal_188 --> -756($fp) +# local_main_at_Main_r_187 = local_main_at_Main_internal_188 +lw $t0, -756($fp) +sw $t0, -752($fp) +# LOCAL local_main_at_Main_internal_198 --> -796($fp) +# local_main_at_Main_internal_198 = SELF +sw $s1, -796($fp) +# LOCAL local_main_at_Main_internal_196 --> -788($fp) +# LOCAL local_main_at_Main_internal_198 --> -796($fp) +# local_main_at_Main_internal_196 = local_main_at_Main_internal_198 +lw $t0, -796($fp) +sw $t0, -788($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_199 --> -800($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_73 +sw $t0, 12($v0) +li $t0, 7 +sw $t0, 16($v0) +sw $v0, -800($fp) +# ARG local_main_at_Main_internal_199 +# LOCAL local_main_at_Main_internal_199 --> -800($fp) +lw $t0, -800($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_196 --> -788($fp) +# LOCAL local_main_at_Main_internal_197 --> -792($fp) +# local_main_at_Main_internal_197 = VCALL local_main_at_Main_internal_196 out_string +# Save new self pointer in $s1 +lw $s1, -788($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -792($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_202 --> -812($fp) +# local_main_at_Main_internal_202 = SELF +sw $s1, -812($fp) +# LOCAL local_main_at_Main_internal_200 --> -804($fp) +# LOCAL local_main_at_Main_internal_202 --> -812($fp) +# local_main_at_Main_internal_200 = local_main_at_Main_internal_202 +lw $t0, -812($fp) +sw $t0, -804($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_main_at_Main_internal_203 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_203 --> -816($fp) +lw $t0, 16($s1) +sw $t0, -816($fp) +# ARG local_main_at_Main_internal_203 +# LOCAL local_main_at_Main_internal_203 --> -816($fp) +lw $t0, -816($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_200 --> -804($fp) +# LOCAL local_main_at_Main_internal_201 --> -808($fp) +# local_main_at_Main_internal_201 = VCALL local_main_at_Main_internal_200 print +# Save new self pointer in $s1 +lw $s1, -804($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 48($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -808($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_206 --> -828($fp) +# local_main_at_Main_internal_206 = SELF +sw $s1, -828($fp) +# LOCAL local_main_at_Main_internal_204 --> -820($fp) +# LOCAL local_main_at_Main_internal_206 --> -828($fp) +# local_main_at_Main_internal_204 = local_main_at_Main_internal_206 +lw $t0, -828($fp) +sw $t0, -820($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_207 --> -832($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_74 +sw $t0, 12($v0) +li $t0, 12 +sw $t0, 16($v0) +sw $v0, -832($fp) +# ARG local_main_at_Main_internal_207 +# LOCAL local_main_at_Main_internal_207 --> -832($fp) +lw $t0, -832($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_204 --> -820($fp) +# LOCAL local_main_at_Main_internal_205 --> -824($fp) +# local_main_at_Main_internal_205 = VCALL local_main_at_Main_internal_204 out_string +# Save new self pointer in $s1 +lw $s1, -820($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -824($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_210 --> -844($fp) +# local_main_at_Main_internal_210 = SELF +sw $s1, -844($fp) +# LOCAL local_main_at_Main_internal_208 --> -836($fp) +# LOCAL local_main_at_Main_internal_210 --> -844($fp) +# local_main_at_Main_internal_208 = local_main_at_Main_internal_210 +lw $t0, -844($fp) +sw $t0, -836($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_main_at_Main_x_180 +# LOCAL local_main_at_Main_x_180 --> -724($fp) +lw $t0, -724($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_208 --> -836($fp) +# LOCAL local_main_at_Main_internal_209 --> -840($fp) +# local_main_at_Main_internal_209 = VCALL local_main_at_Main_internal_208 print +# Save new self pointer in $s1 +lw $s1, -836($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 48($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -840($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_213 --> -856($fp) +# local_main_at_Main_internal_213 = SELF +sw $s1, -856($fp) +# LOCAL local_main_at_Main_internal_211 --> -848($fp) +# LOCAL local_main_at_Main_internal_213 --> -856($fp) +# local_main_at_Main_internal_211 = local_main_at_Main_internal_213 +lw $t0, -856($fp) +sw $t0, -848($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_214 --> -860($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_75 +sw $t0, 12($v0) +li $t0, 28 +sw $t0, 16($v0) +sw $v0, -860($fp) +# ARG local_main_at_Main_internal_214 +# LOCAL local_main_at_Main_internal_214 --> -860($fp) +lw $t0, -860($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_211 --> -848($fp) +# LOCAL local_main_at_Main_internal_212 --> -852($fp) +# local_main_at_Main_internal_212 = VCALL local_main_at_Main_internal_211 out_string +# Save new self pointer in $s1 +lw $s1, -848($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -852($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_a_215 --> -864($fp) +# local_main_at_Main_a_215 = ALLOCATE A2I +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, A2I +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 12 bytes of memory +li $a0, 12 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, A2I_start +sw $t0, 4($v0) +# Load type offset +li $t0, 20 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -864($fp) +# LOCAL local_main_at_Main_internal_216 --> -868($fp) +# local_main_at_Main_internal_216 = ALLOCATE A2I +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, A2I +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 12 bytes of memory +li $a0, 12 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, A2I_start +sw $t0, 4($v0) +# Load type offset +li $t0, 20 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -868($fp) +# LOCAL local_main_at_Main_a_215 --> -864($fp) +# LOCAL local_main_at_Main_internal_216 --> -868($fp) +# local_main_at_Main_a_215 = local_main_at_Main_internal_216 +lw $t0, -868($fp) +sw $t0, -864($fp) +# LOCAL local_main_at_Main_internal_219 --> -880($fp) +# local_main_at_Main_internal_219 = SELF +sw $s1, -880($fp) +# LOCAL local_main_at_Main_internal_217 --> -872($fp) +# LOCAL local_main_at_Main_internal_219 --> -880($fp) +# local_main_at_Main_internal_217 = local_main_at_Main_internal_219 +lw $t0, -880($fp) +sw $t0, -872($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_220 --> -884($fp) +# LOCAL local_main_at_Main_a_215 --> -864($fp) +# local_main_at_Main_internal_220 = local_main_at_Main_a_215 +lw $t0, -864($fp) +sw $t0, -884($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_main_at_Main_r_187 +# LOCAL local_main_at_Main_r_187 --> -752($fp) +lw $t0, -752($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_220 --> -884($fp) +# LOCAL local_main_at_Main_internal_221 --> -888($fp) +# local_main_at_Main_internal_221 = VCALL local_main_at_Main_internal_220 i2a +# Save new self pointer in $s1 +lw $s1, -884($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 28($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -888($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_221 +# LOCAL local_main_at_Main_internal_221 --> -888($fp) +lw $t0, -888($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_217 --> -872($fp) +# LOCAL local_main_at_Main_internal_218 --> -876($fp) +# local_main_at_Main_internal_218 = VCALL local_main_at_Main_internal_217 out_string +# Save new self pointer in $s1 +lw $s1, -872($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -876($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_224 --> -900($fp) +# local_main_at_Main_internal_224 = SELF +sw $s1, -900($fp) +# LOCAL local_main_at_Main_internal_222 --> -892($fp) +# LOCAL local_main_at_Main_internal_224 --> -900($fp) +# local_main_at_Main_internal_222 = local_main_at_Main_internal_224 +lw $t0, -900($fp) +sw $t0, -892($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_225 --> -904($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_76 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -904($fp) +# ARG local_main_at_Main_internal_225 +# LOCAL local_main_at_Main_internal_225 --> -904($fp) +lw $t0, -904($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_222 --> -892($fp) +# LOCAL local_main_at_Main_internal_223 --> -896($fp) +# local_main_at_Main_internal_223 = VCALL local_main_at_Main_internal_222 out_string +# Save new self pointer in $s1 +lw $s1, -892($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -896($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_main_at_Main_x_180 --> -724($fp) +lw $t0, -724($fp) +sw $t0, 16($s1) +# LOCAL local_main_at_Main_internal_175 --> -704($fp) +# local_main_at_Main_internal_175 = +# GOTO label_ENDIF_424 +j label_ENDIF_424 +label_FALSEIF_423: + # local_main_at_Main_internal_230 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_230 --> -924($fp) + lw $t0, 12($s1) + sw $t0, -924($fp) + # LOCAL local_main_at_Main_internal_231 --> -928($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_77 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -928($fp) + # IF_ZERO local_main_at_Main_internal_230 GOTO label_FALSE_435 + # IF_ZERO local_main_at_Main_internal_230 GOTO label_FALSE_435 + lw $t0, -924($fp) + beq $t0, 0, label_FALSE_435 + # IF_ZERO local_main_at_Main_internal_231 GOTO label_FALSE_435 + # IF_ZERO local_main_at_Main_internal_231 GOTO label_FALSE_435 + lw $t0, -928($fp) + beq $t0, 0, label_FALSE_435 + # LOCAL local_main_at_Main_internal_229 --> -920($fp) + # LOCAL local_main_at_Main_internal_230 --> -924($fp) + # Comparing -924($fp) type with String + la $v0, String + lw $a0, -924($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -920($fp) + # IF_ZERO local_main_at_Main_internal_229 GOTO label_COMPARE_STRING_438 + # IF_ZERO local_main_at_Main_internal_229 GOTO label_COMPARE_STRING_438 + lw $t0, -920($fp) + beq $t0, 0, label_COMPARE_STRING_438 + # LOCAL local_main_at_Main_internal_229 --> -920($fp) + # LOCAL local_main_at_Main_internal_230 --> -924($fp) + # Comparing -924($fp) type with Bool + la $v0, Bool + lw $a0, -924($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -920($fp) + # IF_ZERO local_main_at_Main_internal_229 GOTO label_COMPARE_BY_VALUE_439 + # IF_ZERO local_main_at_Main_internal_229 GOTO label_COMPARE_BY_VALUE_439 + lw $t0, -920($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_439 + # LOCAL local_main_at_Main_internal_229 --> -920($fp) + # LOCAL local_main_at_Main_internal_230 --> -924($fp) + # Comparing -924($fp) type with Int + la $v0, Int + lw $a0, -924($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -920($fp) + # IF_ZERO local_main_at_Main_internal_229 GOTO label_COMPARE_BY_VALUE_439 + # IF_ZERO local_main_at_Main_internal_229 GOTO label_COMPARE_BY_VALUE_439 + lw $t0, -920($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_439 + # LOCAL local_main_at_Main_internal_229 --> -920($fp) + # LOCAL local_main_at_Main_internal_230 --> -924($fp) + # LOCAL local_main_at_Main_internal_231 --> -928($fp) + # Load pointers and SUB + lw $a0, -924($fp) + lw $a1, -928($fp) + sub $a0, $a0, $a1 + sw $a0, -920($fp) + # IF_ZERO local_main_at_Main_internal_229 GOTO label_TRUE_436 + # IF_ZERO local_main_at_Main_internal_229 GOTO label_TRUE_436 + lw $t0, -920($fp) + beq $t0, 0, label_TRUE_436 + # GOTO label_FALSE_435 + j label_FALSE_435 + label_COMPARE_BY_VALUE_439: + # LOCAL local_main_at_Main_internal_229 --> -920($fp) + # LOCAL local_main_at_Main_internal_230 --> -924($fp) + # LOCAL local_main_at_Main_internal_231 --> -928($fp) + lw $a0, -924($fp) + lw $a1, -928($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -920($fp) + # IF_ZERO local_main_at_Main_internal_229 GOTO label_TRUE_436 + # IF_ZERO local_main_at_Main_internal_229 GOTO label_TRUE_436 + lw $t0, -920($fp) + beq $t0, 0, label_TRUE_436 + # GOTO label_FALSE_435 + j label_FALSE_435 + label_COMPARE_STRING_438: + # LOCAL local_main_at_Main_internal_229 --> -920($fp) + # LOCAL local_main_at_Main_internal_230 --> -924($fp) + # LOCAL local_main_at_Main_internal_231 --> -928($fp) + # Load strings for comparison + lw $v0, -924($fp) + lw $v1, -928($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -920($fp) + # IF_ZERO local_main_at_Main_internal_229 GOTO label_CONTINUE_440 + # IF_ZERO local_main_at_Main_internal_229 GOTO label_CONTINUE_440 + lw $t0, -920($fp) + beq $t0, 0, label_CONTINUE_440 + # GOTO label_FALSE_435 + j label_FALSE_435 + label_CONTINUE_440: + # LOCAL local_main_at_Main_internal_229 --> -920($fp) + # LOCAL local_main_at_Main_internal_230 --> -924($fp) + # LOCAL local_main_at_Main_internal_231 --> -928($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -924($fp) + lw $v1, -928($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_441: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_442 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_441 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_442: + # Store result + sw $a2, -920($fp) + # IF_ZERO local_main_at_Main_internal_229 GOTO label_TRUE_436 + # IF_ZERO local_main_at_Main_internal_229 GOTO label_TRUE_436 + lw $t0, -920($fp) + beq $t0, 0, label_TRUE_436 + label_FALSE_435: + # LOCAL local_main_at_Main_internal_228 --> -916($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -916($fp) + # GOTO label_END_437 +j label_END_437 +label_TRUE_436: + # LOCAL local_main_at_Main_internal_228 --> -916($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -916($fp) + label_END_437: +# LOCAL local_main_at_Main_internal_226 --> -908($fp) +# LOCAL local_main_at_Main_internal_228 --> -916($fp) +# Obtain value from -916($fp) +lw $v0, -916($fp) +lw $v0, 12($v0) +sw $v0, -908($fp) +# IF_ZERO local_main_at_Main_internal_226 GOTO label_FALSEIF_433 +# IF_ZERO local_main_at_Main_internal_226 GOTO label_FALSEIF_433 +lw $t0, -908($fp) +beq $t0, 0, label_FALSEIF_433 +# LOCAL local_main_at_Main_internal_232 --> -932($fp) +# local_main_at_Main_internal_232 = ALLOCATE A +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, A +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, A_start +sw $t0, 4($v0) +# Load type offset +li $t0, 24 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -932($fp) +# +# LOCAL local_main_at_Main_internal_232 --> -932($fp) +lw $t0, -932($fp) +sw $t0, 16($s1) +# LOCAL local_main_at_Main_internal_227 --> -912($fp) +# local_main_at_Main_internal_227 = +# GOTO label_ENDIF_434 +j label_ENDIF_434 +label_FALSEIF_433: + # local_main_at_Main_internal_237 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_237 --> -952($fp) + lw $t0, 12($s1) + sw $t0, -952($fp) + # LOCAL local_main_at_Main_internal_238 --> -956($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_78 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -956($fp) + # IF_ZERO local_main_at_Main_internal_237 GOTO label_FALSE_445 + # IF_ZERO local_main_at_Main_internal_237 GOTO label_FALSE_445 + lw $t0, -952($fp) + beq $t0, 0, label_FALSE_445 + # IF_ZERO local_main_at_Main_internal_238 GOTO label_FALSE_445 + # IF_ZERO local_main_at_Main_internal_238 GOTO label_FALSE_445 + lw $t0, -956($fp) + beq $t0, 0, label_FALSE_445 + # LOCAL local_main_at_Main_internal_236 --> -948($fp) + # LOCAL local_main_at_Main_internal_237 --> -952($fp) + # Comparing -952($fp) type with String + la $v0, String + lw $a0, -952($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -948($fp) + # IF_ZERO local_main_at_Main_internal_236 GOTO label_COMPARE_STRING_448 + # IF_ZERO local_main_at_Main_internal_236 GOTO label_COMPARE_STRING_448 + lw $t0, -948($fp) + beq $t0, 0, label_COMPARE_STRING_448 + # LOCAL local_main_at_Main_internal_236 --> -948($fp) + # LOCAL local_main_at_Main_internal_237 --> -952($fp) + # Comparing -952($fp) type with Bool + la $v0, Bool + lw $a0, -952($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -948($fp) + # IF_ZERO local_main_at_Main_internal_236 GOTO label_COMPARE_BY_VALUE_449 + # IF_ZERO local_main_at_Main_internal_236 GOTO label_COMPARE_BY_VALUE_449 + lw $t0, -948($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_449 + # LOCAL local_main_at_Main_internal_236 --> -948($fp) + # LOCAL local_main_at_Main_internal_237 --> -952($fp) + # Comparing -952($fp) type with Int + la $v0, Int + lw $a0, -952($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -948($fp) + # IF_ZERO local_main_at_Main_internal_236 GOTO label_COMPARE_BY_VALUE_449 + # IF_ZERO local_main_at_Main_internal_236 GOTO label_COMPARE_BY_VALUE_449 + lw $t0, -948($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_449 + # LOCAL local_main_at_Main_internal_236 --> -948($fp) + # LOCAL local_main_at_Main_internal_237 --> -952($fp) + # LOCAL local_main_at_Main_internal_238 --> -956($fp) + # Load pointers and SUB + lw $a0, -952($fp) + lw $a1, -956($fp) + sub $a0, $a0, $a1 + sw $a0, -948($fp) + # IF_ZERO local_main_at_Main_internal_236 GOTO label_TRUE_446 + # IF_ZERO local_main_at_Main_internal_236 GOTO label_TRUE_446 + lw $t0, -948($fp) + beq $t0, 0, label_TRUE_446 + # GOTO label_FALSE_445 + j label_FALSE_445 + label_COMPARE_BY_VALUE_449: + # LOCAL local_main_at_Main_internal_236 --> -948($fp) + # LOCAL local_main_at_Main_internal_237 --> -952($fp) + # LOCAL local_main_at_Main_internal_238 --> -956($fp) + lw $a0, -952($fp) + lw $a1, -956($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -948($fp) + # IF_ZERO local_main_at_Main_internal_236 GOTO label_TRUE_446 + # IF_ZERO local_main_at_Main_internal_236 GOTO label_TRUE_446 + lw $t0, -948($fp) + beq $t0, 0, label_TRUE_446 + # GOTO label_FALSE_445 + j label_FALSE_445 + label_COMPARE_STRING_448: + # LOCAL local_main_at_Main_internal_236 --> -948($fp) + # LOCAL local_main_at_Main_internal_237 --> -952($fp) + # LOCAL local_main_at_Main_internal_238 --> -956($fp) + # Load strings for comparison + lw $v0, -952($fp) + lw $v1, -956($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -948($fp) + # IF_ZERO local_main_at_Main_internal_236 GOTO label_CONTINUE_450 + # IF_ZERO local_main_at_Main_internal_236 GOTO label_CONTINUE_450 + lw $t0, -948($fp) + beq $t0, 0, label_CONTINUE_450 + # GOTO label_FALSE_445 + j label_FALSE_445 + label_CONTINUE_450: + # LOCAL local_main_at_Main_internal_236 --> -948($fp) + # LOCAL local_main_at_Main_internal_237 --> -952($fp) + # LOCAL local_main_at_Main_internal_238 --> -956($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -952($fp) + lw $v1, -956($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_451: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_452 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_451 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_452: + # Store result + sw $a2, -948($fp) + # IF_ZERO local_main_at_Main_internal_236 GOTO label_TRUE_446 + # IF_ZERO local_main_at_Main_internal_236 GOTO label_TRUE_446 + lw $t0, -948($fp) + beq $t0, 0, label_TRUE_446 + label_FALSE_445: + # LOCAL local_main_at_Main_internal_235 --> -944($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -944($fp) + # GOTO label_END_447 +j label_END_447 +label_TRUE_446: + # LOCAL local_main_at_Main_internal_235 --> -944($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -944($fp) + label_END_447: +# LOCAL local_main_at_Main_internal_233 --> -936($fp) +# LOCAL local_main_at_Main_internal_235 --> -944($fp) +# Obtain value from -944($fp) +lw $v0, -944($fp) +lw $v0, 12($v0) +sw $v0, -936($fp) +# IF_ZERO local_main_at_Main_internal_233 GOTO label_FALSEIF_443 +# IF_ZERO local_main_at_Main_internal_233 GOTO label_FALSEIF_443 +lw $t0, -936($fp) +beq $t0, 0, label_FALSEIF_443 +# LOCAL local_main_at_Main_internal_239 --> -960($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -960($fp) +# +# LOCAL local_main_at_Main_internal_239 --> -960($fp) +lw $t0, -960($fp) +sw $t0, 24($s1) +# LOCAL local_main_at_Main_internal_234 --> -940($fp) +# local_main_at_Main_internal_234 = +# GOTO label_ENDIF_444 +j label_ENDIF_444 +label_FALSEIF_443: + # LOCAL local_main_at_Main_internal_242 --> -972($fp) + # local_main_at_Main_internal_242 = ALLOCATE A + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, A + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, A_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -972($fp) + # LOCAL local_main_at_Main_internal_240 --> -964($fp) + # LOCAL local_main_at_Main_internal_242 --> -972($fp) + # local_main_at_Main_internal_240 = local_main_at_Main_internal_242 + lw $t0, -972($fp) + sw $t0, -964($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_main_at_Main_internal_245 = GETATTRIBUTE avar Main + # LOCAL local_main_at_Main_internal_245 --> -984($fp) + lw $t0, 16($s1) + sw $t0, -984($fp) + # LOCAL local_main_at_Main_internal_243 --> -976($fp) + # LOCAL local_main_at_Main_internal_245 --> -984($fp) + # local_main_at_Main_internal_243 = local_main_at_Main_internal_245 + lw $t0, -984($fp) + sw $t0, -976($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_243 --> -976($fp) + # LOCAL local_main_at_Main_internal_244 --> -980($fp) + # local_main_at_Main_internal_244 = VCALL local_main_at_Main_internal_243 value + # Save new self pointer in $s1 + lw $s1, -976($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -980($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_244 + # LOCAL local_main_at_Main_internal_244 --> -980($fp) + lw $t0, -980($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_240 --> -964($fp) + # LOCAL local_main_at_Main_internal_241 --> -968($fp) + # local_main_at_Main_internal_241 = VCALL local_main_at_Main_internal_240 method1 + # Save new self pointer in $s1 + lw $s1, -964($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -968($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_241 --> -968($fp) + lw $t0, -968($fp) + sw $t0, 16($s1) + # LOCAL local_main_at_Main_internal_234 --> -940($fp) + # local_main_at_Main_internal_234 = + label_ENDIF_444: +# LOCAL local_main_at_Main_internal_227 --> -912($fp) +# LOCAL local_main_at_Main_internal_234 --> -940($fp) +# local_main_at_Main_internal_227 = local_main_at_Main_internal_234 +lw $t0, -940($fp) +sw $t0, -912($fp) +label_ENDIF_434: +# LOCAL local_main_at_Main_internal_175 --> -704($fp) +# LOCAL local_main_at_Main_internal_227 --> -912($fp) +# local_main_at_Main_internal_175 = local_main_at_Main_internal_227 +lw $t0, -912($fp) +sw $t0, -704($fp) +label_ENDIF_424: +# LOCAL local_main_at_Main_internal_137 --> -552($fp) +# LOCAL local_main_at_Main_internal_175 --> -704($fp) +# local_main_at_Main_internal_137 = local_main_at_Main_internal_175 +lw $t0, -704($fp) +sw $t0, -552($fp) +label_ENDIF_412: +# LOCAL local_main_at_Main_internal_126 --> -508($fp) +# LOCAL local_main_at_Main_internal_137 --> -552($fp) +# local_main_at_Main_internal_126 = local_main_at_Main_internal_137 +lw $t0, -552($fp) +sw $t0, -508($fp) +label_ENDIF_402: +# LOCAL local_main_at_Main_internal_115 --> -464($fp) +# LOCAL local_main_at_Main_internal_126 --> -508($fp) +# local_main_at_Main_internal_115 = local_main_at_Main_internal_126 +lw $t0, -508($fp) +sw $t0, -464($fp) +label_ENDIF_392: +# LOCAL local_main_at_Main_internal_104 --> -420($fp) +# LOCAL local_main_at_Main_internal_115 --> -464($fp) +# local_main_at_Main_internal_104 = local_main_at_Main_internal_115 +lw $t0, -464($fp) +sw $t0, -420($fp) +label_ENDIF_382: +# LOCAL local_main_at_Main_internal_83 --> -336($fp) +# LOCAL local_main_at_Main_internal_104 --> -420($fp) +# local_main_at_Main_internal_83 = local_main_at_Main_internal_104 +lw $t0, -420($fp) +sw $t0, -336($fp) +label_ENDIF_372: +# LOCAL local_main_at_Main_internal_52 --> -212($fp) +# LOCAL local_main_at_Main_internal_83 --> -336($fp) +# local_main_at_Main_internal_52 = local_main_at_Main_internal_83 +lw $t0, -336($fp) +sw $t0, -212($fp) +label_ENDIF_354: +# LOCAL local_main_at_Main_internal_31 --> -128($fp) +# LOCAL local_main_at_Main_internal_52 --> -212($fp) +# local_main_at_Main_internal_31 = local_main_at_Main_internal_52 +lw $t0, -212($fp) +sw $t0, -128($fp) +label_ENDIF_344: +# GOTO label_WHILE_339 +j label_WHILE_339 +label_WHILE_END_340: + # RETURN + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 992 + jr $ra + # Function END + diff --git a/tests/codegen/book_list.mips b/tests/codegen/book_list.mips index 73a17c12..b395beea 100644 --- a/tests/codegen/book_list.mips +++ b/tests/codegen/book_list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:41 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:22 2020 # School of Math and Computer Science, University of Havana # @@ -13,6 +13,8 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END +Int: .asciiz "Int" +# Function END Main: .asciiz "Main" # Function END BookList: .asciiz "BookList" @@ -84,6 +86,20 @@ Bool_end: # +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + # **** VTABLE for type Main **** Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main # Function END @@ -180,16 +196,17 @@ data_2: .asciiz "\n" # -IO__TDT: .word 0, -1, -1, -1, -1, 1, 2, 2, 1, 2 -Object__TDT: .word 1, 0, 1, 1, 1, 2, 3, 3, 2, 3 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 -Main__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1, -1 -BookList__TDT: .word -1, -1, -1, -1, -1, 0, 1, 1, -1, -1 -Nil__TDT: .word -1, -1, -1, -1, -1, -1, 0, -1, -1, -1 -Cons__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 -Book__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, 1 -Article__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 +IO__TDT: .word 0, -1, -1, -1, -1, -1, 1, 2, 2, 1, 2 +Object__TDT: .word 1, 0, 1, 1, 1, 1, 2, 3, 3, 2, 3 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1 +BookList__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 1, -1, -1 +Nil__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1 +Cons__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 +Book__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1 +Article__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 # @@ -323,7 +340,8 @@ function_out_int_at_IO: addu $fp, $sp, 32 # PRINT_INT param_out_int_at_IO_x_0 # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) li $v0, 1 syscall # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) @@ -389,6 +407,35 @@ function_in_int_at_IO: # local_in_int_at_IO_internal_0 = READ_INT li $v0, 5 syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) sw $v0, -4($fp) # RETURN local_in_int_at_IO_internal_0 lw $v0, -4($fp) @@ -486,7 +533,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -575,8 +622,10 @@ function_substr_at_String: # PARAM param_substr_at_String_r_1 --> 0($fp) lw $t0, 12($s1) lw $t2, 4($fp) + lw $t2, 12($t2) addu $t0, $t0, $t2 lw $a0, 0($fp) + lw $a0, 12($a0) move $t3, $a0 move $t1, $a0 addu $a0, $a0, 1 @@ -636,8 +685,40 @@ function_length_at_String: # LOCAL local_length_at_String_internal_0 --> -4($fp) lw $t0, 16($s1) sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function function_length_at_String. # Restore $ra lw $ra, 4($sp) @@ -664,28 +745,28 @@ entry: li $v0, 9 syscall # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) # Load type offset - li $t2, 16 - sw $t2, 8($v0) + li $t0, 20 + sw $t0, 8($v0) move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 @@ -711,11 +792,11 @@ entry: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type's VTABLE - la $t1, Main_vtable + la $t0, Main_vtable # Get pointer to function address - lw $t2, 12($t1) + lw $t1, 12($t0) # Call function. Result is on $v0 - jalr $t2 + jalr $t1 sw $v0, -8($fp) # RETURN 0 li $v0, 0 @@ -766,53 +847,53 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Book - sw $t3, 12($v0) - li $t3, 4 - sw $t3, 16($v0) - move $t3, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Book + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - sw $t3, 0($v0) - la $t3, Book_start - sw $t3, 4($v0) + sw $t0, 0($v0) + la $t0, Book_start + sw $t0, 4($v0) # Load type offset - li $t3, 32 - sw $t3, 8($v0) - move $t2, $v0 + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t2 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t2) - # Push register t2 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t2) + sw $v0, 16($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t2, -4($fp) + sw $t1, -4($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_3 = ALLOCATE Book # Allocating 20 bytes of memory @@ -820,58 +901,58 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Book - sw $t4, 12($v0) - li $t4, 4 - sw $t4, 16($v0) - move $t4, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Book + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - sw $t4, 0($v0) - la $t4, Book_start - sw $t4, 4($v0) + sw $t0, 0($v0) + la $t0, Book_start + sw $t0, 4($v0) # Load type offset - li $t4, 32 - sw $t4, 8($v0) - move $t3, $v0 + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t3 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t1, 0($sp) jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t3) - # Push register t3 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t1, 0($sp) jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t3) + sw $v0, 16($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t3, -16($fp) + sw $t1, -16($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t3, -16($fp) - sw $t3, -8($fp) + lw $t0, -16($fp) + sw $t0, -8($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -881,61 +962,61 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_4 - sw $t3, 12($v0) - li $t3, 44 - sw $t3, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 44 + sw $t0, 16($v0) sw $v0, -20($fp) # ARG local_main_at_Main_internal_4 # LOCAL local_main_at_Main_internal_4 --> -20($fp) - lw $t3, -20($fp) + lw $t0, -20($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_5 --> -24($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_5 - sw $t3, 12($v0) - li $t3, 22 - sw $t3, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 22 + sw $t0, 16($v0) sw $v0, -24($fp) # ARG local_main_at_Main_internal_5 # LOCAL local_main_at_Main_internal_5 --> -24($fp) - lw $t3, -24($fp) + lw $t0, -24($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 initBook # Save new self pointer in $s1 lw $s1, -8($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t0, 0($t0) # Get pointer to function address - lw $t5, 28($t4) + lw $t0, 28($t0) # Call function. Result is on $v0 - jalr $t5 + jalr $t0 sw $v0, -12($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -943,8 +1024,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_a_book_0 --> -4($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_a_book_0 = local_main_at_Main_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) + lw $t0, -12($fp) + sw $t0, -4($fp) # LOCAL local_main_at_Main_an_article_6 --> -28($fp) # local_main_at_Main_an_article_6 = ALLOCATE Article # Allocating 20 bytes of memory @@ -952,61 +1033,61 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string for type name - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, Article - sw $t5, 12($v0) - li $t5, 7 - sw $t5, 16($v0) - move $t5, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Article + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 24 bytes of memory li $a0, 24 li $v0, 9 syscall - sw $t5, 0($v0) - la $t5, Article_start - sw $t5, 4($v0) + sw $t0, 0($v0) + la $t0, Article_start + sw $t0, 4($v0) # Load type offset - li $t5, 36 - sw $t5, 8($v0) - move $t4, $v0 + li $t0, 40 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t4 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t1, 0($sp) jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t4) - # Push register t4 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t1, 0($sp) jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t4) - # Push register t4 into stack + sw $v0, 16($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t1, 0($sp) jal __Article__attrib__per_title__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 20($t4) + sw $v0, 20($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t4, -28($fp) + sw $t1, -28($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # local_main_at_Main_internal_9 = ALLOCATE Article # Allocating 20 bytes of memory @@ -1014,66 +1095,66 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string for type name - la $t6, String - sw $t6, 0($v0) - la $t6, String_start - sw $t6, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t6, 8 - sw $t6, 8($v0) - la $t6, Article - sw $t6, 12($v0) - li $t6, 7 - sw $t6, 16($v0) - move $t6, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Article + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 24 bytes of memory li $a0, 24 li $v0, 9 syscall - sw $t6, 0($v0) - la $t6, Article_start - sw $t6, 4($v0) + sw $t0, 0($v0) + la $t0, Article_start + sw $t0, 4($v0) # Load type offset - li $t6, 36 - sw $t6, 8($v0) - move $t5, $v0 + li $t0, 40 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t5 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t5, 0($sp) + sw $t1, 0($sp) jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t5) - # Push register t5 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t5, 0($sp) + sw $t1, 0($sp) jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t5) - # Push register t5 into stack + sw $v0, 16($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t5, 0($sp) + sw $t1, 0($sp) jal __Article__attrib__per_title__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 20($t5) + sw $v0, 20($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t5, -40($fp) + sw $t1, -40($fp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t5, -40($fp) - sw $t5, -32($fp) + lw $t0, -40($fp) + sw $t0, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1083,85 +1164,85 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, data_6 - sw $t5, 12($v0) - li $t5, 19 - sw $t5, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_6 + sw $t0, 12($v0) + li $t0, 19 + sw $t0, 16($v0) sw $v0, -44($fp) # ARG local_main_at_Main_internal_10 # LOCAL local_main_at_Main_internal_10 --> -44($fp) - lw $t5, -44($fp) + lw $t0, -44($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t5, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_11 --> -48($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, data_7 - sw $t5, 12($v0) - li $t5, 7 - sw $t5, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_7 + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) sw $v0, -48($fp) # ARG local_main_at_Main_internal_11 # LOCAL local_main_at_Main_internal_11 --> -48($fp) - lw $t5, -48($fp) + lw $t0, -48($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t5, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_12 --> -52($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, data_8 - sw $t5, 12($v0) - li $t5, 11 - sw $t5, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_8 + sw $t0, 12($v0) + li $t0, 11 + sw $t0, 16($v0) sw $v0, -52($fp) # ARG local_main_at_Main_internal_12 # LOCAL local_main_at_Main_internal_12 --> -52($fp) - lw $t5, -52($fp) + lw $t0, -52($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t5, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 initArticle # Save new self pointer in $s1 lw $s1, -32($fp) # Get pointer to type - lw $t5, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t6, 0($t5) + lw $t0, 0($t0) # Get pointer to function address - lw $t7, 36($t6) + lw $t0, 36($t0) # Call function. Result is on $v0 - jalr $t7 + jalr $t0 sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1169,8 +1250,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_an_article_6 --> -28($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # local_main_at_Main_an_article_6 = local_main_at_Main_internal_8 - lw $t5, -36($fp) - sw $t5, -28($fp) + lw $t0, -36($fp) + sw $t0, -28($fp) # LOCAL local_main_at_Main_internal_17 --> -72($fp) # local_main_at_Main_internal_17 = ALLOCATE Nil # Allocating 20 bytes of memory @@ -1178,29 +1259,29 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string for type name - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t7, 8 - sw $t7, 8($v0) - la $t7, Nil - sw $t7, 12($v0) - li $t7, 3 - sw $t7, 16($v0) - move $t7, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Nil + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - sw $t7, 0($v0) - la $t7, Nil_start - sw $t7, 4($v0) + sw $t0, 0($v0) + la $t0, Nil_start + sw $t0, 4($v0) # Load type offset - li $t7, 24 - sw $t7, 8($v0) - move $t6, $v0 + li $t0, 28 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1208,34 +1289,34 @@ function_main_at_Main: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t6, -72($fp) + sw $t1, -72($fp) # LOCAL local_main_at_Main_internal_15 --> -64($fp) # LOCAL local_main_at_Main_internal_17 --> -72($fp) # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 - lw $t6, -72($fp) - sw $t6, -64($fp) + lw $t0, -72($fp) + sw $t0, -64($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG local_main_at_Main_a_book_0 # LOCAL local_main_at_Main_a_book_0 --> -4($fp) - lw $t6, -4($fp) + lw $t0, -4($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t6, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_15 --> -64($fp) # LOCAL local_main_at_Main_internal_16 --> -68($fp) # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 cons # Save new self pointer in $s1 lw $s1, -64($fp) # Get pointer to type - lw $t6, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t7, 0($t6) + lw $t0, 0($t0) # Get pointer to function address - lw $t8, 32($t7) + lw $t0, 32($t0) # Call function. Result is on $v0 - jalr $t8 + jalr $t0 sw $v0, -68($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1243,47 +1324,47 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_13 --> -56($fp) # LOCAL local_main_at_Main_internal_16 --> -68($fp) # local_main_at_Main_internal_13 = local_main_at_Main_internal_16 - lw $t6, -68($fp) - sw $t6, -56($fp) + lw $t0, -68($fp) + sw $t0, -56($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG local_main_at_Main_an_article_6 # LOCAL local_main_at_Main_an_article_6 --> -28($fp) - lw $t6, -28($fp) + lw $t0, -28($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t6, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_13 --> -56($fp) # LOCAL local_main_at_Main_internal_14 --> -60($fp) # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 cons # Save new self pointer in $s1 lw $s1, -56($fp) # Get pointer to type - lw $t6, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t7, 0($t6) + lw $t0, 0($t0) # Get pointer to function address - lw $t8, 32($t7) + lw $t0, 32($t0) # Call function. Result is on $v0 - jalr $t8 + jalr $t0 sw $v0, -60($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # # LOCAL local_main_at_Main_internal_14 --> -60($fp) - lw $t6, -60($fp) - sw $t6, 12($s1) + lw $t0, -60($fp) + sw $t0, 12($s1) # local_main_at_Main_internal_20 = GETATTRIBUTE books Main # LOCAL local_main_at_Main_internal_20 --> -84($fp) - lw $t6, 12($s1) - sw $t6, -84($fp) + lw $t0, 12($s1) + sw $t0, -84($fp) # LOCAL local_main_at_Main_internal_18 --> -76($fp) # LOCAL local_main_at_Main_internal_20 --> -84($fp) # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 - lw $t6, -84($fp) - sw $t6, -76($fp) + lw $t0, -84($fp) + sw $t0, -76($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1293,13 +1374,13 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -76($fp) # Get pointer to type - lw $t6, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t7, 0($t6) + lw $t0, 0($t0) # Get pointer to function address - lw $t8, 44($t7) + lw $t0, 44($t0) # Call function. Result is on $v0 - jalr $t8 + jalr $t0 sw $v0, -80($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1331,8 +1412,8 @@ function_isNil_at_BookList: # LOCAL local_isNil_at_BookList_internal_0 --> -4($fp) # LOCAL local_isNil_at_BookList_internal_2 --> -12($fp) # local_isNil_at_BookList_internal_0 = local_isNil_at_BookList_internal_2 - lw $t6, -12($fp) - sw $t6, -4($fp) + lw $t0, -12($fp) + sw $t0, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1342,21 +1423,48 @@ function_isNil_at_BookList: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t6, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t7, 0($t6) + lw $t0, 0($t0) # Get pointer to function address - lw $t8, 0($t7) + lw $t0, 0($t0) # Call function. Result is on $v0 - jalr $t8 + jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # LOCAL local_isNil_at_BookList_internal_3 --> -16($fp) - # local_isNil_at_BookList_internal_3 = 1 - li $t6, 1 - sw $t6, -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -16($fp) # RETURN local_isNil_at_BookList_internal_3 lw $v0, -16($fp) # Deallocate stack frame for function function_isNil_at_BookList. @@ -1386,53 +1494,53 @@ function_cons_at_BookList: li $v0, 9 syscall # Allocating string for type name - la $t8, String - sw $t8, 0($v0) - la $t8, String_start - sw $t8, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t8, 8 - sw $t8, 8($v0) - la $t8, Cons - sw $t8, 12($v0) - li $t8, 4 - sw $t8, 16($v0) - move $t8, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Cons + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - sw $t8, 0($v0) - la $t8, Cons_start - sw $t8, 4($v0) + sw $t0, 0($v0) + la $t0, Cons_start + sw $t0, 4($v0) # Load type offset - li $t8, 28 - sw $t8, 8($v0) - move $t7, $v0 + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t7 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t7, 0($sp) + sw $t1, 0($sp) jal __Cons__attrib__xcar__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t7) - # Push register t7 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t7, 0($sp) + sw $t1, 0($sp) jal __Cons__attrib__xcdr__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t7) + sw $v0, 16($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t7, -4($fp) + sw $t1, -4($fp) # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) # local_cons_at_BookList_internal_1 = ALLOCATE Cons # Allocating 20 bytes of memory @@ -1440,94 +1548,94 @@ function_cons_at_BookList: li $v0, 9 syscall # Allocating string for type name - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t9, 8 - sw $t9, 8($v0) - la $t9, Cons - sw $t9, 12($v0) - li $t9, 4 - sw $t9, 16($v0) - move $t9, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Cons + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - sw $t9, 0($v0) - la $t9, Cons_start - sw $t9, 4($v0) + sw $t0, 0($v0) + la $t0, Cons_start + sw $t0, 4($v0) # Load type offset - li $t9, 28 - sw $t9, 8($v0) - move $t8, $v0 + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t8 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t8, 0($sp) + sw $t1, 0($sp) jal __Cons__attrib__xcar__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t8) - # Push register t8 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t8, 0($sp) + sw $t1, 0($sp) jal __Cons__attrib__xcdr__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t8) + sw $v0, 16($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t8, -8($fp) + sw $t1, -8($fp) # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) # local_cons_at_BookList_new_cell_0 = local_cons_at_BookList_internal_1 - lw $t8, -8($fp) - sw $t8, -4($fp) + lw $t0, -8($fp) + sw $t0, -4($fp) # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) # local_cons_at_BookList_internal_2 = local_cons_at_BookList_new_cell_0 - lw $t8, -4($fp) - sw $t8, -12($fp) + lw $t0, -4($fp) + sw $t0, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG param_cons_at_BookList_hd_0 # PARAM param_cons_at_BookList_hd_0 --> 0($fp) - lw $t8, 0($fp) + lw $t0, 0($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t8, 0($sp) + sw $t0, 0($sp) # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) # local_cons_at_BookList_internal_4 = SELF sw $s1, -20($fp) # ARG local_cons_at_BookList_internal_4 # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) - lw $t8, -20($fp) + lw $t0, -20($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t8, 0($sp) + sw $t0, 0($sp) # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) # LOCAL local_cons_at_BookList_internal_3 --> -16($fp) # local_cons_at_BookList_internal_3 = VCALL local_cons_at_BookList_internal_2 init # Save new self pointer in $s1 lw $s1, -12($fp) # Get pointer to type - lw $t8, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t9, 0($t8) + lw $t0, 0($t0) # Get pointer to function address - lw $s2, 48($t9) + lw $t0, 48($t0) # Call function. Result is on $v0 - jalr $s2 + jalr $t0 sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1561,8 +1669,8 @@ function_car_at_BookList: # LOCAL local_car_at_BookList_internal_0 --> -4($fp) # LOCAL local_car_at_BookList_internal_2 --> -12($fp) # local_car_at_BookList_internal_0 = local_car_at_BookList_internal_2 - lw $t8, -12($fp) - sw $t8, -4($fp) + lw $t0, -12($fp) + sw $t0, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1572,13 +1680,13 @@ function_car_at_BookList: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t8, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t9, 0($t8) + lw $t0, 0($t0) # Get pointer to function address - lw $s2, 0($t9) + lw $t0, 0($t0) # Call function. Result is on $v0 - jalr $s2 + jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1590,53 +1698,53 @@ function_car_at_BookList: li $v0, 9 syscall # Allocating string for type name - la $s2, String - sw $s2, 0($v0) - la $s2, String_start - sw $s2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $s2, 8 - sw $s2, 8($v0) - la $s2, Book - sw $s2, 12($v0) - li $s2, 4 - sw $s2, 16($v0) - move $s2, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Book + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - sw $s2, 0($v0) - la $s2, Book_start - sw $s2, 4($v0) + sw $t0, 0($v0) + la $t0, Book_start + sw $t0, 4($v0) # Load type offset - li $s2, 32 - sw $s2, 8($v0) - move $t9, $v0 + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t9 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t9, 0($sp) + sw $t1, 0($sp) jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t9) - # Push register t9 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t9, 0($sp) + sw $t1, 0($sp) jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t9) + sw $v0, 16($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t9, -16($fp) + sw $t1, -16($fp) # RETURN local_car_at_BookList_internal_3 lw $v0, -16($fp) # Deallocate stack frame for function function_car_at_BookList. @@ -1664,8 +1772,8 @@ function_cdr_at_BookList: # LOCAL local_cdr_at_BookList_internal_0 --> -4($fp) # LOCAL local_cdr_at_BookList_internal_2 --> -12($fp) # local_cdr_at_BookList_internal_0 = local_cdr_at_BookList_internal_2 - lw $t9, -12($fp) - sw $t9, -4($fp) + lw $t0, -12($fp) + sw $t0, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1675,13 +1783,13 @@ function_cdr_at_BookList: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t9, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s2, 0($t9) + lw $t0, 0($t0) # Get pointer to function address - lw $s3, 0($s2) + lw $t0, 0($t0) # Call function. Result is on $v0 - jalr $s3 + jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1693,29 +1801,29 @@ function_cdr_at_BookList: li $v0, 9 syscall # Allocating string for type name - la $s3, String - sw $s3, 0($v0) - la $s3, String_start - sw $s3, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $s3, 8 - sw $s3, 8($v0) - la $s3, BookList - sw $s3, 12($v0) - li $s3, 8 - sw $s3, 16($v0) - move $s3, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, BookList + sw $t0, 12($v0) + li $t0, 8 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - sw $s3, 0($v0) - la $s3, BookList_start - sw $s3, 4($v0) + sw $t0, 0($v0) + la $t0, BookList_start + sw $t0, 4($v0) # Load type offset - li $s3, 20 - sw $s3, 8($v0) - move $s2, $v0 + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1723,7 +1831,7 @@ function_cdr_at_BookList: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $s2, -16($fp) + sw $t1, -16($fp) # RETURN local_cdr_at_BookList_internal_3 lw $v0, -16($fp) # Deallocate stack frame for function function_cdr_at_BookList. @@ -1751,8 +1859,8 @@ function_print_list_at_BookList: # LOCAL local_print_list_at_BookList_internal_0 --> -4($fp) # LOCAL local_print_list_at_BookList_internal_2 --> -12($fp) # local_print_list_at_BookList_internal_0 = local_print_list_at_BookList_internal_2 - lw $s2, -12($fp) - sw $s2, -4($fp) + lw $t0, -12($fp) + sw $t0, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1762,13 +1870,13 @@ function_print_list_at_BookList: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $s2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s3, 0($s2) + lw $t0, 0($t0) # Get pointer to function address - lw $s4, 0($s3) + lw $t0, 0($t0) # Call function. Result is on $v0 - jalr $s4 + jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1795,9 +1903,36 @@ function_isNil_at_Nil: sw $fp, 0($sp) addu $fp, $sp, 32 # LOCAL local_isNil_at_Nil_internal_0 --> -4($fp) - # local_isNil_at_Nil_internal_0 = 1 - li $s2, 1 - sw $s2, -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) # RETURN local_isNil_at_Nil_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_isNil_at_Nil. @@ -1820,9 +1955,36 @@ function_print_list_at_Nil: sw $fp, 0($sp) addu $fp, $sp, 32 # LOCAL local_print_list_at_Nil_internal_0 --> -4($fp) - # local_print_list_at_Nil_internal_0 = 1 - li $s2, 1 - sw $s2, -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) # RETURN local_print_list_at_Nil_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_print_list_at_Nil. @@ -1887,9 +2049,36 @@ function_isNil_at_Cons: sw $fp, 0($sp) addu $fp, $sp, 32 # LOCAL local_isNil_at_Cons_internal_0 --> -4($fp) - # local_isNil_at_Cons_internal_0 = 0 - li $s2, 0 - sw $s2, -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) # RETURN local_isNil_at_Cons_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_isNil_at_Cons. @@ -1915,12 +2104,12 @@ function_init_at_Cons: addu $fp, $sp, 32 # # PARAM param_init_at_Cons_hd_0 --> 4($fp) - lw $s2, 4($fp) - sw $s2, 12($s1) + lw $t0, 4($fp) + sw $t0, 12($s1) # # PARAM param_init_at_Cons_tl_1 --> 0($fp) - lw $s2, 0($fp) - sw $s2, 16($s1) + lw $t0, 0($fp) + sw $t0, 16($s1) # LOCAL local_init_at_Cons_internal_0 --> -4($fp) # local_init_at_Cons_internal_0 = SELF sw $s1, -4($fp) @@ -1949,8 +2138,8 @@ function_car_at_Cons: addu $fp, $sp, 32 # local_car_at_Cons_internal_0 = GETATTRIBUTE xcar Cons # LOCAL local_car_at_Cons_internal_0 --> -4($fp) - lw $s2, 12($s1) - sw $s2, -4($fp) + lw $t0, 12($s1) + sw $t0, -4($fp) # RETURN local_car_at_Cons_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_car_at_Cons. @@ -1974,8 +2163,8 @@ function_cdr_at_Cons: addu $fp, $sp, 32 # local_cdr_at_Cons_internal_0 = GETATTRIBUTE xcdr Cons # LOCAL local_cdr_at_Cons_internal_0 --> -4($fp) - lw $s2, 16($s1) - sw $s2, -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) # RETURN local_cdr_at_Cons_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_cdr_at_Cons. @@ -1999,13 +2188,13 @@ function_print_list_at_Cons: addu $fp, $sp, 92 # local_print_list_at_Cons_internal_2 = GETATTRIBUTE xcar Cons # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) - lw $s2, 12($s1) - sw $s2, -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) # local_print_list_at_Cons_internal_0 = local_print_list_at_Cons_internal_2 - lw $s2, -12($fp) - sw $s2, -4($fp) + lw $t0, -12($fp) + sw $t0, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2015,13 +2204,13 @@ function_print_list_at_Cons: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $s2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s3, 0($s2) + lw $t0, 0($t0) # Get pointer to function address - lw $s4, 32($s3) + lw $t0, 32($t0) # Call function. Result is on $v0 - jalr $s4 + jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2029,103 +2218,103 @@ function_print_list_at_Cons: # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # local_print_list_at_Cons_internal_3 = TYPEOF local_print_list_at_Cons_internal_1 - lw $s2, -8($fp) + lw $t0, -8($fp) # Load pointer to type offset - lw $s3, 8($s2) - sw $s3, -16($fp) + lw $t1, 8($t0) + sw $t1, -16($fp) # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) # local_print_list_at_Cons_internal_6 = 14 - li $s2, 14 - sw $s2, -28($fp) - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book + li $t0, 14 + sw $t0, -28($fp) + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Book - la $s2, Book__TDT - lw $s3, -16($fp) - addu $s2, $s2, $s3 + la $t0, Book__TDT + lw $t1, -16($fp) + addu $t0, $t0, $t1 # Save distance - lw $s3, 0($s2) - sw $s3, -32($fp) + lw $t1, 0($t0) + sw $t1, -32($fp) # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # Update min if 18 < 19 - lw $s2, -32($fp) - lw $s3, -28($fp) - bgtu $s2, $s3, label_Not_min0_1 + # Update min if 8 < 9 + lw $t0, -32($fp) + lw $t1, -28($fp) + bgtu $t0, $t1, label_Not_min0_1 # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # local_print_list_at_Cons_internal_6 = local_print_list_at_Cons_internal_7 - lw $s2, -32($fp) - sw $s2, -28($fp) + lw $t0, -32($fp) + sw $t0, -28($fp) label_Not_min0_1: - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Article - la $s2, Article__TDT - lw $s3, -16($fp) - addu $s2, $s2, $s3 + la $t0, Article__TDT + lw $t1, -16($fp) + addu $t0, $t0, $t1 # Save distance - lw $s3, 0($s2) - sw $s3, -32($fp) + lw $t1, 0($t0) + sw $t1, -32($fp) # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # Update min if 18 < 19 - lw $s2, -32($fp) - lw $s3, -28($fp) - bgtu $s2, $s3, label_Not_min1_2 + # Update min if 8 < 9 + lw $t0, -32($fp) + lw $t1, -28($fp) + bgtu $t0, $t1, label_Not_min1_2 # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # local_print_list_at_Cons_internal_6 = local_print_list_at_Cons_internal_7 - lw $s2, -32($fp) - sw $s2, -28($fp) + lw $t0, -32($fp) + sw $t0, -28($fp) label_Not_min1_2: # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # local_print_list_at_Cons_internal_7 = 14 - li $s2, 14 - sw $s2, -32($fp) + li $t0, 14 + sw $t0, -32($fp) # LOCAL local_print_list_at_Cons_internal_4 --> -20($fp) # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_4 = local_print_list_at_Cons_internal_7 - local_print_list_at_Cons_internal_6 - lw $s2, -32($fp) - lw $s3, -28($fp) - sub $s2, $s2, $s3 - sw $s2, -20($fp) + # Load pointers and SUB + lw $a0, -32($fp) + lw $a1, -28($fp) + sub $a0, $a0, $a1 + sw $a0, -20($fp) # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 - lw $s2, -20($fp) - beq $s2, 0, label_ERROR_3 - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book + lw $t0, -20($fp) + beq $t0, 0, label_ERROR_3 + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Book - la $s2, Book__TDT - lw $s3, -16($fp) - addu $s2, $s2, $s3 + la $t0, Book__TDT + lw $t1, -16($fp) + addu $t0, $t0, $t1 # Save distance - lw $s3, 0($s2) - sw $s3, -32($fp) + lw $t1, 0($t0) + sw $t1, -32($fp) # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # Update min if 18 < 19 - lw $s2, -32($fp) - lw $s3, -28($fp) - bgtu $s2, $s3, label_NEXT0_5 + # Update min if 8 < 9 + lw $t0, -32($fp) + lw $t1, -28($fp) + bgtu $t0, $t1, label_NEXT0_5 # LOCAL local_print_list_at_Cons_dummy_8 --> -36($fp) # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) # local_print_list_at_Cons_dummy_8 = local_print_list_at_Cons_internal_1 - lw $s2, -8($fp) - sw $s2, -36($fp) + lw $t0, -8($fp) + sw $t0, -36($fp) # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) # local_print_list_at_Cons_internal_11 = SELF sw $s1, -48($fp) # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) # local_print_list_at_Cons_internal_9 = local_print_list_at_Cons_internal_11 - lw $s2, -48($fp) - sw $s2, -40($fp) + lw $t0, -48($fp) + sw $t0, -40($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2135,37 +2324,37 @@ function_print_list_at_Cons: li $v0, 9 syscall # Allocating string - la $s2, String - sw $s2, 0($v0) - la $s2, String_start - sw $s2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $s2, 8 - sw $s2, 8($v0) - la $s2, data_9 - sw $s2, 12($v0) - li $s2, 26 - sw $s2, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_9 + sw $t0, 12($v0) + li $t0, 26 + sw $t0, 16($v0) sw $v0, -52($fp) # ARG local_print_list_at_Cons_internal_12 # LOCAL local_print_list_at_Cons_internal_12 --> -52($fp) - lw $s2, -52($fp) + lw $t0, -52($fp) # Push arg into stack subu $sp, $sp, 4 - sw $s2, 0($sp) + sw $t0, 0($sp) # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) # local_print_list_at_Cons_internal_10 = VCALL local_print_list_at_Cons_internal_9 out_string # Save new self pointer in $s1 lw $s1, -40($fp) # Get pointer to type - lw $s2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s3, 0($s2) + lw $t0, 0($t0) # Get pointer to function address - lw $s4, 12($s3) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $s4 + jalr $t0 sw $v0, -44($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2173,40 +2362,40 @@ function_print_list_at_Cons: # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_10 - lw $s2, -44($fp) - sw $s2, -24($fp) + lw $t0, -44($fp) + sw $t0, -24($fp) # GOTO label_END_4 j label_END_4 label_NEXT0_5: - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Article - la $s2, Article__TDT - lw $s3, -16($fp) - addu $s2, $s2, $s3 + la $t0, Article__TDT + lw $t1, -16($fp) + addu $t0, $t0, $t1 # Save distance - lw $s3, 0($s2) - sw $s3, -32($fp) + lw $t1, 0($t0) + sw $t1, -32($fp) # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # Update min if 18 < 19 - lw $s2, -32($fp) - lw $s3, -28($fp) - bgtu $s2, $s3, label_NEXT1_6 + # Update min if 8 < 9 + lw $t0, -32($fp) + lw $t1, -28($fp) + bgtu $t0, $t1, label_NEXT1_6 # LOCAL local_print_list_at_Cons_dummy_13 --> -56($fp) # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) # local_print_list_at_Cons_dummy_13 = local_print_list_at_Cons_internal_1 - lw $s2, -8($fp) - sw $s2, -56($fp) + lw $t0, -8($fp) + sw $t0, -56($fp) # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) # local_print_list_at_Cons_internal_16 = SELF sw $s1, -68($fp) # LOCAL local_print_list_at_Cons_internal_14 --> -60($fp) # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) # local_print_list_at_Cons_internal_14 = local_print_list_at_Cons_internal_16 - lw $s2, -68($fp) - sw $s2, -60($fp) + lw $t0, -68($fp) + sw $t0, -60($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2216,37 +2405,37 @@ label_NEXT0_5: li $v0, 9 syscall # Allocating string - la $s2, String - sw $s2, 0($v0) - la $s2, String_start - sw $s2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $s2, 8 - sw $s2, 8($v0) - la $s2, data_10 - sw $s2, 12($v0) - li $s2, 29 - sw $s2, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_10 + sw $t0, 12($v0) + li $t0, 29 + sw $t0, 16($v0) sw $v0, -72($fp) # ARG local_print_list_at_Cons_internal_17 # LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) - lw $s2, -72($fp) + lw $t0, -72($fp) # Push arg into stack subu $sp, $sp, 4 - sw $s2, 0($sp) + sw $t0, 0($sp) # LOCAL local_print_list_at_Cons_internal_14 --> -60($fp) # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) # local_print_list_at_Cons_internal_15 = VCALL local_print_list_at_Cons_internal_14 out_string # Save new self pointer in $s1 lw $s1, -60($fp) # Get pointer to type - lw $s2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s3, 0($s2) + lw $t0, 0($t0) # Get pointer to function address - lw $s4, 12($s3) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $s4 + jalr $t0 sw $v0, -64($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2254,15 +2443,15 @@ label_NEXT0_5: # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_15 - lw $s2, -64($fp) - sw $s2, -24($fp) + lw $t0, -64($fp) + sw $t0, -24($fp) # GOTO label_END_4 j label_END_4 label_NEXT1_6: label_ERROR_3: # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - lw $s2, 0($s1) - sw $s2, -8($fp) + lw $t0, 0($s1) + sw $t0, -8($fp) # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) la $a0, data_1 li $v0, 4 @@ -2278,13 +2467,13 @@ label_NEXT1_6: label_END_4: # local_print_list_at_Cons_internal_20 = GETATTRIBUTE xcdr Cons # LOCAL local_print_list_at_Cons_internal_20 --> -84($fp) -lw $s2, 16($s1) -sw $s2, -84($fp) +lw $t0, 16($s1) +sw $t0, -84($fp) # LOCAL local_print_list_at_Cons_internal_18 --> -76($fp) # LOCAL local_print_list_at_Cons_internal_20 --> -84($fp) # local_print_list_at_Cons_internal_18 = local_print_list_at_Cons_internal_20 -lw $s2, -84($fp) -sw $s2, -76($fp) +lw $t0, -84($fp) +sw $t0, -76($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2294,13 +2483,13 @@ sw $s1, 0($sp) # Save new self pointer in $s1 lw $s1, -76($fp) # Get pointer to type -lw $s2, 4($s1) +lw $t0, 4($s1) # Get pointer to type's VTABLE -lw $s3, 0($s2) +lw $t0, 0($t0) # Get pointer to function address -lw $s4, 44($s3) +lw $t0, 44($t0) # Call function. Result is on $v0 -jalr $s4 +jalr $t0 sw $v0, -80($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2332,17 +2521,17 @@ __Book__attrib__title__init: li $v0, 9 syscall # Allocating string - la $s2, String - sw $s2, 0($v0) - la $s2, String_start - sw $s2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $s2, 8 - sw $s2, 8($v0) - la $s2, data_0 - sw $s2, 12($v0) - li $s2, 0 - sw $s2, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) sw $v0, -4($fp) # RETURN local_ttrib__title__init_internal_0 lw $v0, -4($fp) @@ -2371,17 +2560,17 @@ __Book__attrib__author__init: li $v0, 9 syscall # Allocating string - la $s2, String - sw $s2, 0($v0) - la $s2, String_start - sw $s2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $s2, 8 - sw $s2, 8($v0) - la $s2, data_0 - sw $s2, 12($v0) - li $s2, 0 - sw $s2, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) sw $v0, -4($fp) # RETURN local_ttrib__author__init_internal_0 lw $v0, -4($fp) @@ -2408,12 +2597,12 @@ function_initBook_at_Book: addu $fp, $sp, 32 # # PARAM param_initBook_at_Book_title_p_0 --> 4($fp) - lw $s2, 4($fp) - sw $s2, 12($s1) + lw $t0, 4($fp) + sw $t0, 12($s1) # # PARAM param_initBook_at_Book_author_p_1 --> 0($fp) - lw $s2, 0($fp) - sw $s2, 16($s1) + lw $t0, 0($fp) + sw $t0, 16($s1) # LOCAL local_initBook_at_Book_internal_0 --> -4($fp) # local_initBook_at_Book_internal_0 = SELF sw $s1, -4($fp) @@ -2446,8 +2635,8 @@ function_print_at_Book: # LOCAL local_print_at_Book_internal_4 --> -20($fp) # LOCAL local_print_at_Book_internal_6 --> -28($fp) # local_print_at_Book_internal_4 = local_print_at_Book_internal_6 - lw $s2, -28($fp) - sw $s2, -20($fp) + lw $t0, -28($fp) + sw $t0, -20($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2457,37 +2646,37 @@ function_print_at_Book: li $v0, 9 syscall # Allocating string - la $s2, String - sw $s2, 0($v0) - la $s2, String_start - sw $s2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $s2, 8 - sw $s2, 8($v0) - la $s2, data_11 - sw $s2, 12($v0) - li $s2, 12 - sw $s2, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_11 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) sw $v0, -32($fp) # ARG local_print_at_Book_internal_7 # LOCAL local_print_at_Book_internal_7 --> -32($fp) - lw $s2, -32($fp) + lw $t0, -32($fp) # Push arg into stack subu $sp, $sp, 4 - sw $s2, 0($sp) + sw $t0, 0($sp) # LOCAL local_print_at_Book_internal_4 --> -20($fp) # LOCAL local_print_at_Book_internal_5 --> -24($fp) # local_print_at_Book_internal_5 = VCALL local_print_at_Book_internal_4 out_string # Save new self pointer in $s1 lw $s1, -20($fp) # Get pointer to type - lw $s2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s3, 0($s2) + lw $t0, 0($t0) # Get pointer to function address - lw $s4, 12($s3) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $s4 + jalr $t0 sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2495,34 +2684,34 @@ function_print_at_Book: # LOCAL local_print_at_Book_internal_2 --> -12($fp) # LOCAL local_print_at_Book_internal_5 --> -24($fp) # local_print_at_Book_internal_2 = local_print_at_Book_internal_5 - lw $s2, -24($fp) - sw $s2, -12($fp) + lw $t0, -24($fp) + sw $t0, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # local_print_at_Book_internal_8 = GETATTRIBUTE title Book # LOCAL local_print_at_Book_internal_8 --> -36($fp) - lw $s2, 12($s1) - sw $s2, -36($fp) + lw $t0, 12($s1) + sw $t0, -36($fp) # ARG local_print_at_Book_internal_8 # LOCAL local_print_at_Book_internal_8 --> -36($fp) - lw $s2, -36($fp) + lw $t0, -36($fp) # Push arg into stack subu $sp, $sp, 4 - sw $s2, 0($sp) + sw $t0, 0($sp) # LOCAL local_print_at_Book_internal_2 --> -12($fp) # LOCAL local_print_at_Book_internal_3 --> -16($fp) # local_print_at_Book_internal_3 = VCALL local_print_at_Book_internal_2 out_string # Save new self pointer in $s1 lw $s1, -12($fp) # Get pointer to type - lw $s2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s3, 0($s2) + lw $t0, 0($t0) # Get pointer to function address - lw $s4, 12($s3) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $s4 + jalr $t0 sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2530,8 +2719,8 @@ function_print_at_Book: # LOCAL local_print_at_Book_internal_0 --> -4($fp) # LOCAL local_print_at_Book_internal_3 --> -16($fp) # local_print_at_Book_internal_0 = local_print_at_Book_internal_3 - lw $s2, -16($fp) - sw $s2, -4($fp) + lw $t0, -16($fp) + sw $t0, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2541,37 +2730,37 @@ function_print_at_Book: li $v0, 9 syscall # Allocating string - la $s2, String - sw $s2, 0($v0) - la $s2, String_start - sw $s2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $s2, 8 - sw $s2, 8($v0) - la $s2, data_12 - sw $s2, 12($v0) - li $s2, 1 - sw $s2, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_12 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) sw $v0, -40($fp) # ARG local_print_at_Book_internal_9 # LOCAL local_print_at_Book_internal_9 --> -40($fp) - lw $s2, -40($fp) + lw $t0, -40($fp) # Push arg into stack subu $sp, $sp, 4 - sw $s2, 0($sp) + sw $t0, 0($sp) # LOCAL local_print_at_Book_internal_0 --> -4($fp) # LOCAL local_print_at_Book_internal_1 --> -8($fp) # local_print_at_Book_internal_1 = VCALL local_print_at_Book_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $s2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s3, 0($s2) + lw $t0, 0($t0) # Get pointer to function address - lw $s4, 12($s3) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $s4 + jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2582,8 +2771,8 @@ function_print_at_Book: # LOCAL local_print_at_Book_internal_14 --> -60($fp) # LOCAL local_print_at_Book_internal_16 --> -68($fp) # local_print_at_Book_internal_14 = local_print_at_Book_internal_16 - lw $s2, -68($fp) - sw $s2, -60($fp) + lw $t0, -68($fp) + sw $t0, -60($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2593,37 +2782,37 @@ function_print_at_Book: li $v0, 9 syscall # Allocating string - la $s2, String - sw $s2, 0($v0) - la $s2, String_start - sw $s2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $s2, 8 - sw $s2, 8($v0) - la $s2, data_13 - sw $s2, 12($v0) - li $s2, 12 - sw $s2, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_13 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) sw $v0, -72($fp) # ARG local_print_at_Book_internal_17 # LOCAL local_print_at_Book_internal_17 --> -72($fp) - lw $s2, -72($fp) + lw $t0, -72($fp) # Push arg into stack subu $sp, $sp, 4 - sw $s2, 0($sp) + sw $t0, 0($sp) # LOCAL local_print_at_Book_internal_14 --> -60($fp) # LOCAL local_print_at_Book_internal_15 --> -64($fp) # local_print_at_Book_internal_15 = VCALL local_print_at_Book_internal_14 out_string # Save new self pointer in $s1 lw $s1, -60($fp) # Get pointer to type - lw $s2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s3, 0($s2) + lw $t0, 0($t0) # Get pointer to function address - lw $s4, 12($s3) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $s4 + jalr $t0 sw $v0, -64($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2631,34 +2820,34 @@ function_print_at_Book: # LOCAL local_print_at_Book_internal_12 --> -52($fp) # LOCAL local_print_at_Book_internal_15 --> -64($fp) # local_print_at_Book_internal_12 = local_print_at_Book_internal_15 - lw $s2, -64($fp) - sw $s2, -52($fp) + lw $t0, -64($fp) + sw $t0, -52($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # local_print_at_Book_internal_18 = GETATTRIBUTE author Book # LOCAL local_print_at_Book_internal_18 --> -76($fp) - lw $s2, 16($s1) - sw $s2, -76($fp) + lw $t0, 16($s1) + sw $t0, -76($fp) # ARG local_print_at_Book_internal_18 # LOCAL local_print_at_Book_internal_18 --> -76($fp) - lw $s2, -76($fp) + lw $t0, -76($fp) # Push arg into stack subu $sp, $sp, 4 - sw $s2, 0($sp) + sw $t0, 0($sp) # LOCAL local_print_at_Book_internal_12 --> -52($fp) # LOCAL local_print_at_Book_internal_13 --> -56($fp) # local_print_at_Book_internal_13 = VCALL local_print_at_Book_internal_12 out_string # Save new self pointer in $s1 lw $s1, -52($fp) # Get pointer to type - lw $s2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s3, 0($s2) + lw $t0, 0($t0) # Get pointer to function address - lw $s4, 12($s3) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $s4 + jalr $t0 sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2666,8 +2855,8 @@ function_print_at_Book: # LOCAL local_print_at_Book_internal_10 --> -44($fp) # LOCAL local_print_at_Book_internal_13 --> -56($fp) # local_print_at_Book_internal_10 = local_print_at_Book_internal_13 - lw $s2, -56($fp) - sw $s2, -44($fp) + lw $t0, -56($fp) + sw $t0, -44($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2677,37 +2866,37 @@ function_print_at_Book: li $v0, 9 syscall # Allocating string - la $s2, String - sw $s2, 0($v0) - la $s2, String_start - sw $s2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $s2, 8 - sw $s2, 8($v0) - la $s2, data_14 - sw $s2, 12($v0) - li $s2, 1 - sw $s2, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_14 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) sw $v0, -80($fp) # ARG local_print_at_Book_internal_19 # LOCAL local_print_at_Book_internal_19 --> -80($fp) - lw $s2, -80($fp) + lw $t0, -80($fp) # Push arg into stack subu $sp, $sp, 4 - sw $s2, 0($sp) + sw $t0, 0($sp) # LOCAL local_print_at_Book_internal_10 --> -44($fp) # LOCAL local_print_at_Book_internal_11 --> -48($fp) # local_print_at_Book_internal_11 = VCALL local_print_at_Book_internal_10 out_string # Save new self pointer in $s1 lw $s1, -44($fp) # Get pointer to type - lw $s2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s3, 0($s2) + lw $t0, 0($t0) # Get pointer to function address - lw $s4, 12($s3) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $s4 + jalr $t0 sw $v0, -48($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2742,17 +2931,17 @@ __Article__attrib__per_title__init: li $v0, 9 syscall # Allocating string - la $s2, String - sw $s2, 0($v0) - la $s2, String_start - sw $s2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $s2, 8 - sw $s2, 8($v0) - la $s2, data_0 - sw $s2, 12($v0) - li $s2, 0 - sw $s2, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) sw $v0, -4($fp) # RETURN local___attrib__per_title__init_internal_0 lw $v0, -4($fp) @@ -2784,44 +2973,44 @@ function_initArticle_at_Article: # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) # local_initArticle_at_Article_internal_0 = local_initArticle_at_Article_internal_2 - lw $s2, -12($fp) - sw $s2, -4($fp) + lw $t0, -12($fp) + sw $t0, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG param_initArticle_at_Article_title_p_0 # PARAM param_initArticle_at_Article_title_p_0 --> 8($fp) - lw $s2, 8($fp) + lw $t0, 8($fp) # Push arg into stack subu $sp, $sp, 4 - sw $s2, 0($sp) + sw $t0, 0($sp) # ARG param_initArticle_at_Article_author_p_1 # PARAM param_initArticle_at_Article_author_p_1 --> 4($fp) - lw $s2, 4($fp) + lw $t0, 4($fp) # Push arg into stack subu $sp, $sp, 4 - sw $s2, 0($sp) + sw $t0, 0($sp) # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) # LOCAL local_initArticle_at_Article_internal_1 --> -8($fp) # local_initArticle_at_Article_internal_1 = VCALL local_initArticle_at_Article_internal_0 initBook # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $s2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s3, 0($s2) + lw $t0, 0($t0) # Get pointer to function address - lw $s4, 28($s3) + lw $t0, 28($t0) # Call function. Result is on $v0 - jalr $s4 + jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # # PARAM param_initArticle_at_Article_per_title_p_2 --> 0($fp) - lw $s2, 0($fp) - sw $s2, 20($s1) + lw $t0, 0($fp) + sw $t0, 20($s1) # LOCAL local_initArticle_at_Article_internal_3 --> -16($fp) # local_initArticle_at_Article_internal_3 = SELF sw $s1, -16($fp) @@ -2860,11 +3049,11 @@ function_print_at_Article: # Save new self pointer in $s1 lw $s1, -8($fp) # Get pointer to type's VTABLE - la $s2, Book_vtable + la $t0, Book_vtable # Get pointer to function address - lw $s3, 32($s2) + lw $t1, 32($t0) # Call function. Result is on $v0 - jalr $s3 + jalr $t1 sw $v0, -4($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2875,8 +3064,8 @@ function_print_at_Article: # LOCAL local_print_at_Article_internal_6 --> -28($fp) # LOCAL local_print_at_Article_internal_8 --> -36($fp) # local_print_at_Article_internal_6 = local_print_at_Article_internal_8 - lw $s2, -36($fp) - sw $s2, -28($fp) + lw $t0, -36($fp) + sw $t0, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2886,37 +3075,37 @@ function_print_at_Article: li $v0, 9 syscall # Allocating string - la $s2, String - sw $s2, 0($v0) - la $s2, String_start - sw $s2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $s2, 8 - sw $s2, 8($v0) - la $s2, data_15 - sw $s2, 12($v0) - li $s2, 13 - sw $s2, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_15 + sw $t0, 12($v0) + li $t0, 13 + sw $t0, 16($v0) sw $v0, -40($fp) # ARG local_print_at_Article_internal_9 # LOCAL local_print_at_Article_internal_9 --> -40($fp) - lw $s2, -40($fp) + lw $t0, -40($fp) # Push arg into stack subu $sp, $sp, 4 - sw $s2, 0($sp) + sw $t0, 0($sp) # LOCAL local_print_at_Article_internal_6 --> -28($fp) # LOCAL local_print_at_Article_internal_7 --> -32($fp) # local_print_at_Article_internal_7 = VCALL local_print_at_Article_internal_6 out_string # Save new self pointer in $s1 lw $s1, -28($fp) # Get pointer to type - lw $s2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s3, 0($s2) + lw $t0, 0($t0) # Get pointer to function address - lw $s4, 12($s3) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $s4 + jalr $t0 sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2924,34 +3113,34 @@ function_print_at_Article: # LOCAL local_print_at_Article_internal_4 --> -20($fp) # LOCAL local_print_at_Article_internal_7 --> -32($fp) # local_print_at_Article_internal_4 = local_print_at_Article_internal_7 - lw $s2, -32($fp) - sw $s2, -20($fp) + lw $t0, -32($fp) + sw $t0, -20($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # local_print_at_Article_internal_10 = GETATTRIBUTE per_title Article # LOCAL local_print_at_Article_internal_10 --> -44($fp) - lw $s2, 20($s1) - sw $s2, -44($fp) + lw $t0, 20($s1) + sw $t0, -44($fp) # ARG local_print_at_Article_internal_10 # LOCAL local_print_at_Article_internal_10 --> -44($fp) - lw $s2, -44($fp) + lw $t0, -44($fp) # Push arg into stack subu $sp, $sp, 4 - sw $s2, 0($sp) + sw $t0, 0($sp) # LOCAL local_print_at_Article_internal_4 --> -20($fp) # LOCAL local_print_at_Article_internal_5 --> -24($fp) # local_print_at_Article_internal_5 = VCALL local_print_at_Article_internal_4 out_string # Save new self pointer in $s1 lw $s1, -20($fp) # Get pointer to type - lw $s2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s3, 0($s2) + lw $t0, 0($t0) # Get pointer to function address - lw $s4, 12($s3) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $s4 + jalr $t0 sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2959,8 +3148,8 @@ function_print_at_Article: # LOCAL local_print_at_Article_internal_2 --> -12($fp) # LOCAL local_print_at_Article_internal_5 --> -24($fp) # local_print_at_Article_internal_2 = local_print_at_Article_internal_5 - lw $s2, -24($fp) - sw $s2, -12($fp) + lw $t0, -24($fp) + sw $t0, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2970,37 +3159,37 @@ function_print_at_Article: li $v0, 9 syscall # Allocating string - la $s2, String - sw $s2, 0($v0) - la $s2, String_start - sw $s2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $s2, 8 - sw $s2, 8($v0) - la $s2, data_16 - sw $s2, 12($v0) - li $s2, 1 - sw $s2, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_16 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) sw $v0, -48($fp) # ARG local_print_at_Article_internal_11 # LOCAL local_print_at_Article_internal_11 --> -48($fp) - lw $s2, -48($fp) + lw $t0, -48($fp) # Push arg into stack subu $sp, $sp, 4 - sw $s2, 0($sp) + sw $t0, 0($sp) # LOCAL local_print_at_Article_internal_2 --> -12($fp) # LOCAL local_print_at_Article_internal_3 --> -16($fp) # local_print_at_Article_internal_3 = VCALL local_print_at_Article_internal_2 out_string # Save new self pointer in $s1 lw $s1, -12($fp) # Get pointer to type - lw $s2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s3, 0($s2) + lw $t0, 0($t0) # Get pointer to function address - lw $s4, 12($s3) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $s4 + jalr $t0 sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) diff --git a/tests/codegen/cells.mips b/tests/codegen/cells.mips index a820dcad..9ecbf6d2 100644 --- a/tests/codegen/cells.mips +++ b/tests/codegen/cells.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:43 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 07:49:34 2020 # School of Math and Computer Science, University of Havana # @@ -13,6 +13,8 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END +Int: .asciiz "Int" +# Function END Main: .asciiz "Main" # Function END CellularAutomaton: .asciiz "CellularAutomaton" @@ -76,6 +78,20 @@ Bool_end: # +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + # **** VTABLE for type Main **** Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main # Function END @@ -116,12 +132,13 @@ data_2: .asciiz "\n" # -IO__TDT: .word 0, -1, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1 -Main__TDT: .word -1, -1, -1, -1, 0, -1 -CellularAutomaton__TDT: .word -1, -1, -1, -1, -1, 0 +IO__TDT: .word 0, -1, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0, -1 +CellularAutomaton__TDT: .word -1, -1, -1, -1, -1, -1, 0 # @@ -231,7 +248,8 @@ function_out_int_at_IO: addu $fp, $sp, 32 # PRINT_INT param_out_int_at_IO_x_0 # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) li $v0, 1 syscall # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) @@ -297,6 +315,35 @@ function_in_int_at_IO: # local_in_int_at_IO_internal_0 = READ_INT li $v0, 5 syscall + move $a0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a0, 12($v0) sw $v0, -4($fp) # RETURN local_in_int_at_IO_internal_0 lw $v0, -4($fp) @@ -394,7 +441,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -483,8 +530,10 @@ function_substr_at_String: # PARAM param_substr_at_String_r_1 --> 0($fp) lw $t0, 12($s1) lw $t2, 4($fp) + lw $t2, 12($t2) addu $t0, $t0, $t2 lw $a0, 0($fp) + lw $a0, 12($a0) move $t3, $a0 move $t1, $a0 addu $a0, $a0, 1 @@ -544,8 +593,40 @@ function_length_at_String: # LOCAL local_length_at_String_internal_0 --> -4($fp) lw $t0, 16($s1) sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function function_length_at_String. # Restore $ra lw $ra, 4($sp) @@ -592,7 +673,7 @@ entry: la $t2, Main_start sw $t2, 4($v0) # Load type offset - li $t2, 16 + li $t2, 20 sw $t2, 8($v0) move $t1, $v0 # Push register s1 into stack @@ -663,10 +744,10 @@ __Main__attrib__cells__init: # @Params: function_main_at_Main: # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 76 + subu $sp, $sp, 88 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 76 + addu $fp, $sp, 88 # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_internal_2 = ALLOCATE CellularAutomaton # Allocating 20 bytes of memory @@ -694,7 +775,7 @@ function_main_at_Main: la $t3, CellularAutomaton_start sw $t3, 4($v0) # Load type offset - li $t3, 20 + li $t3, 24 sw $t3, 8($v0) move $t2, $v0 # Push register s1 into stack @@ -795,59 +876,153 @@ function_main_at_Main: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_countdown_7 --> -32($fp) - # local_main_at_Main_countdown_7 = 20 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Int + sw $t2, 12($v0) + li $t2, 3 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Int_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) li $t2, 20 + sw $t2, 12($v0) + sw $v0, -36($fp) + # LOCAL local_main_at_Main_countdown_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_countdown_7 = local_main_at_Main_internal_8 + lw $t2, -36($fp) sw $t2, -32($fp) label_WHILE_1: - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_countdown_7 --> -32($fp) - # local_main_at_Main_internal_8 = 0 - local_main_at_Main_countdown_7 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Int + sw $t2, 12($v0) + li $t2, 3 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Int_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) li $t2, 0 + sw $t2, 12($v0) + sw $v0, -44($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_countdown_7 --> -32($fp) + # local_main_at_Main_internal_9 = local_main_at_Main_internal_10 - local_main_at_Main_countdown_7 + lw $t3, -44($fp) + lw $t2, 12($t3) lw $t3, -32($fp) - sub $t2, $t2, $t3 - sw $t2, -36($fp) - # IF_GREATER_ZERO local_main_at_Main_internal_8 GOTO label_FALSE_3 - # IF_GREATER_ZERO local_main_at_Main_internal_8 GOTO label_FALSE_3 - lw $t2, -36($fp) + lw $t4, 12($t3) + sub $t2, $t2, $t4 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Int + sw $t3, 12($v0) + li $t3, 3 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Int_start + sw $t3, 4($v0) + # Load type offset + li $t3, 16 + sw $t3, 8($v0) + sw $t2, 12($v0) + sw $v0, -40($fp) + # IF_GREATER_ZERO local_main_at_Main_internal_9 GOTO label_FALSE_3 + # IF_GREATER_ZERO local_main_at_Main_internal_9 GOTO label_FALSE_3 + lw $t2, -40($fp) bgt $t2, 0, label_FALSE_3 - # IF_ZERO local_main_at_Main_internal_8 GOTO label_FALSE_3 - # IF_ZERO local_main_at_Main_internal_8 GOTO label_FALSE_3 - lw $t2, -36($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_FALSE_3 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_FALSE_3 + lw $t2, -40($fp) beq $t2, 0, label_FALSE_3 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = 1 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = 1 li $t2, 1 - sw $t2, -36($fp) + sw $t2, -40($fp) # GOTO label_END_4 j label_END_4 label_FALSE_3: - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = 0 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = 0 li $t2, 0 - sw $t2, -36($fp) + sw $t2, -40($fp) label_END_4: -# IF_ZERO local_main_at_Main_internal_8 GOTO label_WHILE_END_2 -# IF_ZERO local_main_at_Main_internal_8 GOTO label_WHILE_END_2 -lw $t2, -36($fp) +# IF_ZERO local_main_at_Main_internal_9 GOTO label_WHILE_END_2 +# IF_ZERO local_main_at_Main_internal_9 GOTO label_WHILE_END_2 +lw $t2, -40($fp) beq $t2, 0, label_WHILE_END_2 -# local_main_at_Main_internal_11 = GETATTRIBUTE cells Main -# LOCAL local_main_at_Main_internal_11 --> -48($fp) +# local_main_at_Main_internal_13 = GETATTRIBUTE cells Main +# LOCAL local_main_at_Main_internal_13 --> -56($fp) lw $t2, 12($s1) -sw $t2, -48($fp) -# LOCAL local_main_at_Main_internal_9 --> -40($fp) +sw $t2, -56($fp) # LOCAL local_main_at_Main_internal_11 --> -48($fp) -# local_main_at_Main_internal_9 = local_main_at_Main_internal_11 -lw $t2, -48($fp) -sw $t2, -40($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_11 = local_main_at_Main_internal_13 +lw $t2, -56($fp) +sw $t2, -48($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_9 --> -40($fp) -# LOCAL local_main_at_Main_internal_10 --> -44($fp) -# local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 evolve +# LOCAL local_main_at_Main_internal_11 --> -48($fp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# local_main_at_Main_internal_12 = VCALL local_main_at_Main_internal_11 evolve # Save new self pointer in $s1 -lw $s1, -40($fp) +lw $s1, -48($fp) # Get pointer to type lw $t2, 4($s1) # Get pointer to type's VTABLE @@ -856,27 +1031,27 @@ lw $t3, 0($t2) lw $t4, 56($t3) # Call function. Result is on $v0 jalr $t4 -sw $v0, -44($fp) +sw $v0, -52($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# local_main_at_Main_internal_14 = GETATTRIBUTE cells Main -# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# local_main_at_Main_internal_16 = GETATTRIBUTE cells Main +# LOCAL local_main_at_Main_internal_16 --> -68($fp) lw $t2, 12($s1) -sw $t2, -60($fp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) +sw $t2, -68($fp) # LOCAL local_main_at_Main_internal_14 --> -60($fp) -# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 -lw $t2, -60($fp) -sw $t2, -52($fp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# local_main_at_Main_internal_14 = local_main_at_Main_internal_16 +lw $t2, -68($fp) +sw $t2, -60($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 print +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 print # Save new self pointer in $s1 -lw $s1, -52($fp) +lw $s1, -60($fp) # Get pointer to type lw $t2, 4($s1) # Get pointer to type's VTABLE @@ -885,36 +1060,99 @@ lw $t3, 0($t2) lw $t4, 32($t3) # Call function. Result is on $v0 jalr $t4 -sw $v0, -56($fp) +sw $v0, -64($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t2, String +sw $t2, 0($v0) +la $t2, String_start +sw $t2, 4($v0) +# Load type offset +li $t2, 8 +sw $t2, 8($v0) +la $t2, Int +sw $t2, 12($v0) +li $t2, 3 +sw $t2, 16($v0) +move $t2, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t2, 0($v0) +la $t2, Int_start +sw $t2, 4($v0) +# Load type offset +li $t2, 16 +sw $t2, 8($v0) +li $t2, 1 +sw $t2, 12($v0) +sw $v0, -76($fp) +# LOCAL local_main_at_Main_internal_17 --> -72($fp) # LOCAL local_main_at_Main_countdown_7 --> -32($fp) -# local_main_at_Main_internal_15 = local_main_at_Main_countdown_7 - 1 -lw $t2, -32($fp) -sub $t2, $t2, 1 -sw $t2, -64($fp) +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# local_main_at_Main_internal_17 = local_main_at_Main_countdown_7 - local_main_at_Main_internal_18 +lw $t3, -32($fp) +lw $t2, 12($t3) +lw $t3, -76($fp) +lw $t4, 12($t3) +sub $t2, $t2, $t4 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t3, String +sw $t3, 0($v0) +la $t3, String_start +sw $t3, 4($v0) +# Load type offset +li $t3, 8 +sw $t3, 8($v0) +la $t3, Int +sw $t3, 12($v0) +li $t3, 3 +sw $t3, 16($v0) +move $t3, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t3, 0($v0) +la $t3, Int_start +sw $t3, 4($v0) +# Load type offset +li $t3, 16 +sw $t3, 8($v0) +sw $t2, 12($v0) +sw $v0, -72($fp) # LOCAL local_main_at_Main_countdown_7 --> -32($fp) -# LOCAL local_main_at_Main_internal_15 --> -64($fp) -# local_main_at_Main_countdown_7 = local_main_at_Main_internal_15 -lw $t2, -64($fp) +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +# local_main_at_Main_countdown_7 = local_main_at_Main_internal_17 +lw $t2, -72($fp) sw $t2, -32($fp) # GOTO label_WHILE_1 j label_WHILE_1 label_WHILE_END_2: - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_16 = SELF - sw $s1, -68($fp) - # RETURN local_main_at_Main_internal_16 - lw $v0, -68($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_19 = SELF + sw $s1, -80($fp) + # RETURN local_main_at_Main_internal_19 + lw $v0, -80($fp) # Deallocate stack frame for function function_main_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 76 + addu $sp, $sp, 88 jr $ra # Function END @@ -1177,8 +1415,40 @@ function_cell_at_CellularAutomaton: # Push arg into stack subu $sp, $sp, 4 sw $t2, 0($sp) - # ARG 1 + # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Int + sw $t2, 12($v0) + li $t2, 3 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Int_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) li $t2, 1 + sw $t2, 12($v0) + sw $v0, -16($fp) + # ARG local_cell_at_CellularAutomaton_internal_3 + # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) + lw $t2, -16($fp) # Push arg into stack subu $sp, $sp, 4 sw $t2, 0($sp) @@ -1219,157 +1489,296 @@ function_cell_at_CellularAutomaton: # 0($fp) = param_cell_left_neighbor_at_CellularAutomaton_position_0 function_cell_left_neighbor_at_CellularAutomaton: # Allocate stack frame for function function_cell_left_neighbor_at_CellularAutomaton. - subu $sp, $sp, 60 + subu $sp, $sp, 72 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 60 + addu $fp, $sp, 72 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Int + sw $t2, 12($v0) + li $t2, 3 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Int_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) + li $t2, 0 + sw $t2, 12($v0) + sw $v0, -12($fp) # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_1 = PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 - 0 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) lw $t2, 0($fp) - sub $t2, $t2, 0 - sw $t2, -8($fp) - # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_1 GOTO label_TRUE_7 - # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_1 GOTO label_TRUE_7 - lw $t2, -8($fp) - beq $t2, 0, label_TRUE_7 - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_1 = 0 - li $t2, 0 - sw $t2, -8($fp) - # GOTO label_END_8 -j label_END_8 -label_TRUE_7: - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_1 = 1 - li $t2, 1 - sw $t2, -8($fp) - label_END_8: -# IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_5 -# IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_5 -lw $t2, -8($fp) -beq $t2, 0, label_FALSEIF_5 -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) -# local_cell_left_neighbor_at_CellularAutomaton_internal_4 = SELF -sw $s1, -20($fp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) -# local_cell_left_neighbor_at_CellularAutomaton_internal_2 = local_cell_left_neighbor_at_CellularAutomaton_internal_4 -lw $t2, -20($fp) -sw $t2, -12($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) -# local_cell_left_neighbor_at_CellularAutomaton_internal_8 = SELF -sw $s1, -36($fp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) -# local_cell_left_neighbor_at_CellularAutomaton_internal_6 = local_cell_left_neighbor_at_CellularAutomaton_internal_8 -lw $t2, -36($fp) -sw $t2, -28($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) -# local_cell_left_neighbor_at_CellularAutomaton_internal_7 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_6 num_cells -# Save new self pointer in $s1 -lw $s1, -28($fp) -# Get pointer to type -lw $t2, 4($s1) -# Get pointer to type's VTABLE -lw $t3, 0($t2) -# Get pointer to function address -lw $t4, 36($t3) -# Call function. Result is on $v0 -jalr $t4 -sw $v0, -32($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) -# local_cell_left_neighbor_at_CellularAutomaton_internal_5 = local_cell_left_neighbor_at_CellularAutomaton_internal_7 - 1 -lw $t2, -32($fp) -sub $t2, $t2, 1 -sw $t2, -24($fp) -# ARG local_cell_left_neighbor_at_CellularAutomaton_internal_5 -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) -lw $t2, -24($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t2, 0($sp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) -# local_cell_left_neighbor_at_CellularAutomaton_internal_3 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_2 cell -# Save new self pointer in $s1 -lw $s1, -12($fp) -# Get pointer to type -lw $t2, 4($s1) -# Get pointer to type's VTABLE -lw $t3, 0($t2) -# Get pointer to function address -lw $t4, 40($t3) -# Call function. Result is on $v0 -jalr $t4 -sw $v0, -16($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) -# local_cell_left_neighbor_at_CellularAutomaton_internal_0 = local_cell_left_neighbor_at_CellularAutomaton_internal_3 -lw $t2, -16($fp) -sw $t2, -4($fp) -# GOTO label_ENDIF_6 -j label_ENDIF_6 -label_FALSEIF_5: - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_9 = local_cell_left_neighbor_at_CellularAutomaton_internal_11 - lw $t2, -48($fp) - sw $t2, -40($fp) + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_5 + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_5 + lw $t3, -8($fp) + beq $t3, 0, label_FALSEIF_5 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_5 = SELF + sw $s1, -24($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_3 = local_cell_left_neighbor_at_CellularAutomaton_internal_5 + lw $t3, -24($fp) + sw $t3, -16($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) - # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_12 = PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 - 1 - lw $t2, 0($fp) - sub $t2, $t2, 1 - sw $t2, -52($fp) - # ARG local_cell_left_neighbor_at_CellularAutomaton_internal_12 - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) - lw $t2, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_10 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_9 cell + # local_cell_left_neighbor_at_CellularAutomaton_internal_9 = SELF + sw $s1, -40($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_7 = local_cell_left_neighbor_at_CellularAutomaton_internal_9 + lw $t3, -40($fp) + sw $t3, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_8 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_7 num_cells # Save new self pointer in $s1 - lw $s1, -40($fp) + lw $s1, -32($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t4, 0($t3) # Get pointer to function address - lw $t4, 40($t3) + lw $t5, 36($t4) # Call function. Result is on $v0 - jalr $t4 + jalr $t5 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Int + sw $t3, 12($v0) + li $t3, 3 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Int_start + sw $t3, 4($v0) + # Load type offset + li $t3, 16 + sw $t3, 8($v0) + li $t3, 1 + sw $t3, 12($v0) sw $v0, -44($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_6 = local_cell_left_neighbor_at_CellularAutomaton_internal_8 - local_cell_left_neighbor_at_CellularAutomaton_internal_10 + lw $t4, -36($fp) + lw $t3, 12($t4) + lw $t4, -44($fp) + lw $t5, 12($t4) + sub $t3, $t3, $t5 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Int + sw $t4, 12($v0) + li $t4, 3 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Int_start + sw $t4, 4($v0) + # Load type offset + li $t4, 16 + sw $t4, 8($v0) + sw $t3, 12($v0) + sw $v0, -28($fp) + # ARG local_cell_left_neighbor_at_CellularAutomaton_internal_6 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) + lw $t3, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_4 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_3 cell + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 40($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -20($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_0 = local_cell_left_neighbor_at_CellularAutomaton_internal_10 - lw $t2, -44($fp) - sw $t2, -4($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_0 = local_cell_left_neighbor_at_CellularAutomaton_internal_4 + lw $t3, -20($fp) + sw $t3, -4($fp) + # GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_13 --> -56($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_13 = SELF + sw $s1, -56($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_13 --> -56($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_11 = local_cell_left_neighbor_at_CellularAutomaton_internal_13 + lw $t3, -56($fp) + sw $t3, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Int + sw $t3, 12($v0) + li $t3, 3 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Int_start + sw $t3, 4($v0) + # Load type offset + li $t3, 16 + sw $t3, 8($v0) + li $t3, 1 + sw $t3, 12($v0) + sw $v0, -64($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_14 --> -60($fp) + # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_15 --> -64($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_14 = PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 - local_cell_left_neighbor_at_CellularAutomaton_internal_15 + lw $t4, 0($fp) + lw $t3, 12($t4) + lw $t4, -64($fp) + lw $t5, 12($t4) + sub $t3, $t3, $t5 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Int + sw $t4, 12($v0) + li $t4, 3 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Int_start + sw $t4, 4($v0) + # Load type offset + li $t4, 16 + sw $t4, 8($v0) + sw $t3, 12($v0) + sw $v0, -60($fp) + # ARG local_cell_left_neighbor_at_CellularAutomaton_internal_14 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_14 --> -60($fp) + lw $t3, -60($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t3, 0($sp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_12 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_11 cell + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t3, 4($s1) + # Get pointer to type's VTABLE + lw $t4, 0($t3) + # Get pointer to function address + lw $t5, 40($t4) + # Call function. Result is on $v0 + jalr $t5 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_0 = local_cell_left_neighbor_at_CellularAutomaton_internal_12 + lw $t3, -52($fp) + sw $t3, -4($fp) label_ENDIF_6: # RETURN local_cell_left_neighbor_at_CellularAutomaton_internal_0 lw $v0, -4($fp) @@ -1379,7 +1788,7 @@ lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 60 +addu $sp, $sp, 72 # Deallocate function args addu $sp, $sp, 4 jr $ra @@ -1391,18 +1800,18 @@ jr $ra # 0($fp) = param_cell_right_neighbor_at_CellularAutomaton_position_0 function_cell_right_neighbor_at_CellularAutomaton: # Allocate stack frame for function function_cell_right_neighbor_at_CellularAutomaton. - subu $sp, $sp, 60 + subu $sp, $sp, 72 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 60 + addu $fp, $sp, 72 # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) # local_cell_right_neighbor_at_CellularAutomaton_internal_5 = SELF sw $s1, -24($fp) # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) # local_cell_right_neighbor_at_CellularAutomaton_internal_3 = local_cell_right_neighbor_at_CellularAutomaton_internal_5 - lw $t2, -24($fp) - sw $t2, -16($fp) + lw $t3, -24($fp) + sw $t3, -16($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1412,138 +1821,276 @@ function_cell_right_neighbor_at_CellularAutomaton: # Save new self pointer in $s1 lw $s1, -16($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t4, 0($t3) # Get pointer to function address - lw $t4, 36($t3) + lw $t5, 36($t4) # Call function. Result is on $v0 - jalr $t4 + jalr $t5 sw $v0, -20($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Int + sw $t3, 12($v0) + li $t3, 3 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Int_start + sw $t3, 4($v0) + # Load type offset + li $t3, 16 + sw $t3, 8($v0) + li $t3, 1 + sw $t3, 12($v0) + sw $v0, -28($fp) # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_2 = local_cell_right_neighbor_at_CellularAutomaton_internal_4 - 1 - lw $t2, -20($fp) - sub $t2, $t2, 1 - sw $t2, -12($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_2 = local_cell_right_neighbor_at_CellularAutomaton_internal_4 - local_cell_right_neighbor_at_CellularAutomaton_internal_6 + lw $t4, -20($fp) + lw $t3, 12($t4) + lw $t4, -28($fp) + lw $t5, 12($t4) + sub $t3, $t3, $t5 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Int + sw $t4, 12($v0) + li $t4, 3 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Int_start + sw $t4, 4($v0) + # Load type offset + li $t4, 16 + sw $t4, 8($v0) + sw $t3, 12($v0) + sw $v0, -12($fp) # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_1 = PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 - local_cell_right_neighbor_at_CellularAutomaton_internal_2 - lw $t2, 0($fp) - lw $t3, -12($fp) - sub $t2, $t2, $t3 - sw $t2, -8($fp) - # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_1 GOTO label_TRUE_11 - # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_1 GOTO label_TRUE_11 - lw $t2, -8($fp) - beq $t2, 0, label_TRUE_11 - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_1 = 0 - li $t2, 0 - sw $t2, -8($fp) - # GOTO label_END_12 -j label_END_12 -label_TRUE_11: - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_1 = 1 - li $t2, 1 - sw $t2, -8($fp) - label_END_12: -# IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_9 -# IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_9 -lw $t2, -8($fp) -beq $t2, 0, label_FALSEIF_9 -# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) -# local_cell_right_neighbor_at_CellularAutomaton_internal_8 = SELF -sw $s1, -36($fp) -# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) -# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) -# local_cell_right_neighbor_at_CellularAutomaton_internal_6 = local_cell_right_neighbor_at_CellularAutomaton_internal_8 -lw $t2, -36($fp) -sw $t2, -28($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG 0 -li $t2, 0 -# Push arg into stack -subu $sp, $sp, 4 -sw $t2, 0($sp) -# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) -# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) -# local_cell_right_neighbor_at_CellularAutomaton_internal_7 = VCALL local_cell_right_neighbor_at_CellularAutomaton_internal_6 cell -# Save new self pointer in $s1 -lw $s1, -28($fp) -# Get pointer to type -lw $t2, 4($s1) -# Get pointer to type's VTABLE -lw $t3, 0($t2) -# Get pointer to function address -lw $t4, 40($t3) -# Call function. Result is on $v0 -jalr $t4 -sw $v0, -32($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) -# local_cell_right_neighbor_at_CellularAutomaton_internal_0 = local_cell_right_neighbor_at_CellularAutomaton_internal_7 -lw $t2, -32($fp) -sw $t2, -4($fp) -# GOTO label_ENDIF_10 -j label_ENDIF_10 -label_FALSEIF_9: - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_11 = SELF - sw $s1, -48($fp) + lw $t3, 0($fp) + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_7 + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_7 + lw $t4, -8($fp) + beq $t4, 0, label_FALSEIF_7 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_9 = SELF + sw $s1, -40($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_7 = local_cell_right_neighbor_at_CellularAutomaton_internal_9 + lw $t4, -40($fp) + sw $t4, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Int + sw $t4, 12($v0) + li $t4, 3 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Int_start + sw $t4, 4($v0) + # Load type offset + li $t4, 16 + sw $t4, 8($v0) + li $t4, 0 + sw $t4, 12($v0) + sw $v0, -44($fp) + # ARG local_cell_right_neighbor_at_CellularAutomaton_internal_10 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) + lw $t4, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_8 = VCALL local_cell_right_neighbor_at_CellularAutomaton_internal_7 cell + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t4, 4($s1) + # Get pointer to type's VTABLE + lw $t5, 0($t4) + # Get pointer to function address + lw $t6, 40($t5) + # Call function. Result is on $v0 + jalr $t6 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_0 = local_cell_right_neighbor_at_CellularAutomaton_internal_8 + lw $t4, -36($fp) + sw $t4, -4($fp) + # GOTO label_ENDIF_8 +j label_ENDIF_8 +label_FALSEIF_7: + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_13 --> -56($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_13 = SELF + sw $s1, -56($fp) # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_9 = local_cell_right_neighbor_at_CellularAutomaton_internal_11 - lw $t2, -48($fp) - sw $t2, -40($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_13 --> -56($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_11 = local_cell_right_neighbor_at_CellularAutomaton_internal_13 + lw $t4, -56($fp) + sw $t4, -48($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Int + sw $t4, 12($v0) + li $t4, 3 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Int_start + sw $t4, 4($v0) + # Load type offset + li $t4, 16 + sw $t4, 8($v0) + li $t4, 1 + sw $t4, 12($v0) + sw $v0, -64($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_14 --> -60($fp) # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_12 = PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 + 1 - lw $t2, 0($fp) - add $t2, $t2, 1 - sw $t2, -52($fp) - # ARG local_cell_right_neighbor_at_CellularAutomaton_internal_12 - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) - lw $t2, -52($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_15 --> -64($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_14 = PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 + local_cell_right_neighbor_at_CellularAutomaton_internal_15 + lw $t5, 0($fp) + lw $t4, 12($t5) + lw $t5, -64($fp) + lw $t6, 12($t5) + add $t4, $t4, $t6 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, Int + sw $t5, 12($v0) + li $t5, 3 + sw $t5, 16($v0) + move $t5, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t5, 0($v0) + la $t5, Int_start + sw $t5, 4($v0) + # Load type offset + li $t5, 16 + sw $t5, 8($v0) + sw $t4, 12($v0) + sw $v0, -60($fp) + # ARG local_cell_right_neighbor_at_CellularAutomaton_internal_14 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_14 --> -60($fp) + lw $t4, -60($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_10 = VCALL local_cell_right_neighbor_at_CellularAutomaton_internal_9 cell + sw $t4, 0($sp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_12 = VCALL local_cell_right_neighbor_at_CellularAutomaton_internal_11 cell # Save new self pointer in $s1 - lw $s1, -40($fp) + lw $s1, -48($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t5, 0($t4) # Get pointer to function address - lw $t4, 40($t3) + lw $t6, 40($t5) # Call function. Result is on $v0 - jalr $t4 - sw $v0, -44($fp) + jalr $t6 + sw $v0, -52($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_0 = local_cell_right_neighbor_at_CellularAutomaton_internal_10 - lw $t2, -44($fp) - sw $t2, -4($fp) - label_ENDIF_10: + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_0 = local_cell_right_neighbor_at_CellularAutomaton_internal_12 + lw $t4, -52($fp) + sw $t4, -4($fp) + label_ENDIF_8: # RETURN local_cell_right_neighbor_at_CellularAutomaton_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_cell_right_neighbor_at_CellularAutomaton. @@ -1552,7 +2099,7 @@ lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 60 +addu $sp, $sp, 72 # Deallocate function args addu $sp, $sp, 4 jr $ra @@ -1564,40 +2111,40 @@ jr $ra # 0($fp) = param_cell_at_next_evolution_at_CellularAutomaton_position_0 function_cell_at_next_evolution_at_CellularAutomaton: # Allocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. - subu $sp, $sp, 104 + subu $sp, $sp, 132 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 104 + addu $fp, $sp, 132 # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) # local_cell_at_next_evolution_at_CellularAutomaton_internal_8 = SELF sw $s1, -36($fp) # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) # local_cell_at_next_evolution_at_CellularAutomaton_internal_6 = local_cell_at_next_evolution_at_CellularAutomaton_internal_8 - lw $t2, -36($fp) - sw $t2, -28($fp) + lw $t4, -36($fp) + sw $t4, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) - lw $t2, 0($fp) + lw $t4, 0($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t4, 0($sp) # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) # local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 cell # Save new self pointer in $s1 lw $s1, -28($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t5, 0($t4) # Get pointer to function address - lw $t4, 40($t3) + lw $t6, 40($t5) # Call function. Result is on $v0 - jalr $t4 + jalr $t6 sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1607,335 +2154,540 @@ function_cell_at_next_evolution_at_CellularAutomaton: li $a0, 20 li $v0, 9 syscall - # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + # Allocating string + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, data_6 + sw $t4, 12($v0) + li $t4, 1 + sw $t4, 16($v0) + sw $v0, -40($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + lw $t4, -32($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_5 GOTO label_FALSEIF_11 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_5 GOTO label_FALSEIF_11 + lw $t5, -24($fp) + beq $t5, 0, label_FALSEIF_11 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, Int + sw $t5, 12($v0) + li $t5, 3 + sw $t5, 16($v0) + move $t5, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t5, 0($v0) + la $t5, Int_start + sw $t5, 4($v0) + # Load type offset + li $t5, 16 + sw $t5, 8($v0) + li $t5, 1 + sw $t5, 12($v0) + sw $v0, -44($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_4 = local_cell_at_next_evolution_at_CellularAutomaton_internal_10 + lw $t5, -44($fp) + sw $t5, -20($fp) + # GOTO label_ENDIF_12 +j label_ENDIF_12 +label_FALSEIF_11: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, Int + sw $t5, 12($v0) + li $t5, 3 + sw $t5, 16($v0) + move $t5, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t5, 0($v0) + la $t5, Int_start + sw $t5, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_6 - sw $t2, 12($v0) - li $t2, 1 - sw $t2, 16($v0) - sw $v0, -40($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_5 = local_cell_at_next_evolution_at_CellularAutomaton_internal_7 - local_cell_at_next_evolution_at_CellularAutomaton_internal_9 - lw $t2, -32($fp) - lw $t3, -40($fp) - sub $t2, $t2, $t3 - sw $t2, -24($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_5 GOTO label_TRUE_19 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_5 GOTO label_TRUE_19 - lw $t2, -24($fp) - beq $t2, 0, label_TRUE_19 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_5 = 0 - li $t2, 0 - sw $t2, -24($fp) - # GOTO label_END_20 -j label_END_20 -label_TRUE_19: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_5 = 1 - li $t2, 1 - sw $t2, -24($fp) - label_END_20: -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_5 GOTO label_FALSEIF_17 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_5 GOTO label_FALSEIF_17 -lw $t2, -24($fp) -beq $t2, 0, label_FALSEIF_17 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_4 = 1 -li $t2, 1 -sw $t2, -20($fp) -# GOTO label_ENDIF_18 -j label_ENDIF_18 -label_FALSEIF_17: + li $t5, 16 + sw $t5, 8($v0) + li $t5, 0 + sw $t5, 12($v0) + sw $v0, -48($fp) # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_4 = 0 - li $t2, 0 - sw $t2, -20($fp) - label_ENDIF_18: -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_14 = SELF -sw $s1, -60($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_4 = local_cell_at_next_evolution_at_CellularAutomaton_internal_11 + lw $t5, -48($fp) + sw $t5, -20($fp) + label_ENDIF_12: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_16 = SELF +sw $s1, -68($fp) # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = local_cell_at_next_evolution_at_CellularAutomaton_internal_14 -lw $t2, -60($fp) -sw $t2, -52($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_14 = local_cell_at_next_evolution_at_CellularAutomaton_internal_16 +lw $t5, -68($fp) +sw $t5, -60($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) -lw $t2, 0($fp) +lw $t5, 0($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t2, 0($sp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_13 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 cell_left_neighbor +sw $t5, 0($sp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_15 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 cell_left_neighbor # Save new self pointer in $s1 -lw $s1, -52($fp) +lw $s1, -60($fp) # Get pointer to type -lw $t2, 4($s1) +lw $t5, 4($s1) # Get pointer to type's VTABLE -lw $t3, 0($t2) +lw $t6, 0($t5) # Get pointer to function address -lw $t4, 44($t3) +lw $t7, 44($t6) # Call function. Result is on $v0 -jalr $t4 -sw $v0, -56($fp) +jalr $t7 +sw $v0, -64($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string -la $t2, String -sw $t2, 0($v0) -la $t2, String_start -sw $t2, 4($v0) +la $t5, String +sw $t5, 0($v0) +la $t5, String_start +sw $t5, 4($v0) # Load type offset -li $t2, 8 -sw $t2, 8($v0) -la $t2, data_7 -sw $t2, 12($v0) -li $t2, 1 -sw $t2, 16($v0) -sw $v0, -64($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) +li $t5, 8 +sw $t5, 8($v0) +la $t5, data_7 +sw $t5, 12($v0) +li $t5, 1 +sw $t5, 16($v0) +sw $v0, -72($fp) # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_11 = local_cell_at_next_evolution_at_CellularAutomaton_internal_13 - local_cell_at_next_evolution_at_CellularAutomaton_internal_15 -lw $t2, -56($fp) -lw $t3, -64($fp) -sub $t2, $t2, $t3 -sw $t2, -48($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_11 GOTO label_TRUE_23 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_11 GOTO label_TRUE_23 -lw $t2, -48($fp) -beq $t2, 0, label_TRUE_23 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_11 = 0 -li $t2, 0 -sw $t2, -48($fp) -# GOTO label_END_24 -j label_END_24 -label_TRUE_23: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_11 = 1 - li $t2, 1 - sw $t2, -48($fp) - label_END_24: -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_11 GOTO label_FALSEIF_21 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_11 GOTO label_FALSEIF_21 -lw $t2, -48($fp) -beq $t2, 0, label_FALSEIF_21 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_10 = 1 -li $t2, 1 -sw $t2, -44($fp) -# GOTO label_ENDIF_22 -j label_ENDIF_22 -label_FALSEIF_21: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_10 = 0 - li $t2, 0 - sw $t2, -44($fp) - label_ENDIF_22: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) +lw $t5, -64($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_13 GOTO label_FALSEIF_13 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_13 GOTO label_FALSEIF_13 +lw $t6, -56($fp) +beq $t6, 0, label_FALSEIF_13 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t6, String +sw $t6, 0($v0) +la $t6, String_start +sw $t6, 4($v0) +# Load type offset +li $t6, 8 +sw $t6, 8($v0) +la $t6, Int +sw $t6, 12($v0) +li $t6, 3 +sw $t6, 16($v0) +move $t6, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t6, 0($v0) +la $t6, Int_start +sw $t6, 4($v0) +# Load type offset +li $t6, 16 +sw $t6, 8($v0) +li $t6, 1 +sw $t6, 12($v0) +sw $v0, -76($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = local_cell_at_next_evolution_at_CellularAutomaton_internal_18 +lw $t6, -76($fp) +sw $t6, -52($fp) +# GOTO label_ENDIF_14 +j label_ENDIF_14 +label_FALSEIF_13: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t6, String + sw $t6, 0($v0) + la $t6, String_start + sw $t6, 4($v0) + # Load type offset + li $t6, 8 + sw $t6, 8($v0) + la $t6, Int + sw $t6, 12($v0) + li $t6, 3 + sw $t6, 16($v0) + move $t6, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t6, 0($v0) + la $t6, Int_start + sw $t6, 4($v0) + # Load type offset + li $t6, 16 + sw $t6, 8($v0) + li $t6, 0 + sw $t6, 12($v0) + sw $v0, -80($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = local_cell_at_next_evolution_at_CellularAutomaton_internal_19 + lw $t6, -80($fp) + sw $t6, -52($fp) + label_ENDIF_14: # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_3 = local_cell_at_next_evolution_at_CellularAutomaton_internal_4 + local_cell_at_next_evolution_at_CellularAutomaton_internal_10 -lw $t2, -20($fp) -lw $t3, -44($fp) -add $t2, $t2, $t3 -sw $t2, -16($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_20 = SELF -sw $s1, -84($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_18 = local_cell_at_next_evolution_at_CellularAutomaton_internal_20 -lw $t2, -84($fp) -sw $t2, -76($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_3 = local_cell_at_next_evolution_at_CellularAutomaton_internal_4 + local_cell_at_next_evolution_at_CellularAutomaton_internal_12 +lw $t7, -20($fp) +lw $t6, 12($t7) +lw $t7, -52($fp) +lw $t8, 12($t7) +add $t6, $t6, $t8 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t7, String +sw $t7, 0($v0) +la $t7, String_start +sw $t7, 4($v0) +# Load type offset +li $t7, 8 +sw $t7, 8($v0) +la $t7, Int +sw $t7, 12($v0) +li $t7, 3 +sw $t7, 16($v0) +move $t7, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t7, 0($v0) +la $t7, Int_start +sw $t7, 4($v0) +# Load type offset +li $t7, 16 +sw $t7, 8($v0) +sw $t6, 12($v0) +sw $v0, -16($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_24 = SELF +sw $s1, -100($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_22 = local_cell_at_next_evolution_at_CellularAutomaton_internal_24 +lw $t6, -100($fp) +sw $t6, -92($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) -lw $t2, 0($fp) +lw $t6, 0($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t2, 0($sp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_19 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 cell_right_neighbor +sw $t6, 0($sp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_23 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 cell_right_neighbor # Save new self pointer in $s1 -lw $s1, -76($fp) +lw $s1, -92($fp) # Get pointer to type -lw $t2, 4($s1) +lw $t6, 4($s1) # Get pointer to type's VTABLE -lw $t3, 0($t2) +lw $t7, 0($t6) # Get pointer to function address -lw $t4, 48($t3) +lw $t8, 48($t7) # Call function. Result is on $v0 -jalr $t4 -sw $v0, -80($fp) +jalr $t8 +sw $v0, -96($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_25 --> -104($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string -la $t2, String -sw $t2, 0($v0) -la $t2, String_start -sw $t2, 4($v0) +la $t6, String +sw $t6, 0($v0) +la $t6, String_start +sw $t6, 4($v0) # Load type offset -li $t2, 8 -sw $t2, 8($v0) -la $t2, data_8 -sw $t2, 12($v0) -li $t2, 1 -sw $t2, 16($v0) -sw $v0, -88($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) +li $t6, 8 +sw $t6, 8($v0) +la $t6, data_8 +sw $t6, 12($v0) +li $t6, 1 +sw $t6, 16($v0) +sw $v0, -104($fp) # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_17 = local_cell_at_next_evolution_at_CellularAutomaton_internal_19 - local_cell_at_next_evolution_at_CellularAutomaton_internal_21 -lw $t2, -80($fp) -lw $t3, -88($fp) -sub $t2, $t2, $t3 -sw $t2, -72($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_17 GOTO label_TRUE_27 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_17 GOTO label_TRUE_27 -lw $t2, -72($fp) -beq $t2, 0, label_TRUE_27 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_17 = 0 -li $t2, 0 -sw $t2, -72($fp) -# GOTO label_END_28 -j label_END_28 -label_TRUE_27: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_17 = 1 - li $t2, 1 - sw $t2, -72($fp) - label_END_28: -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_25 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_25 -lw $t2, -72($fp) -beq $t2, 0, label_FALSEIF_25 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_16 = 1 -li $t2, 1 -sw $t2, -68($fp) -# GOTO label_ENDIF_26 -j label_ENDIF_26 -label_FALSEIF_25: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_16 = 0 - li $t2, 0 - sw $t2, -68($fp) - label_ENDIF_26: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_25 --> -104($fp) +lw $t6, -96($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_21 GOTO label_FALSEIF_15 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_21 GOTO label_FALSEIF_15 +lw $t7, -88($fp) +beq $t7, 0, label_FALSEIF_15 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_26 --> -108($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t7, String +sw $t7, 0($v0) +la $t7, String_start +sw $t7, 4($v0) +# Load type offset +li $t7, 8 +sw $t7, 8($v0) +la $t7, Int +sw $t7, 12($v0) +li $t7, 3 +sw $t7, 16($v0) +move $t7, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t7, 0($v0) +la $t7, Int_start +sw $t7, 4($v0) +# Load type offset +li $t7, 16 +sw $t7, 8($v0) +li $t7, 1 +sw $t7, 12($v0) +sw $v0, -108($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_26 --> -108($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_20 = local_cell_at_next_evolution_at_CellularAutomaton_internal_26 +lw $t7, -108($fp) +sw $t7, -84($fp) +# GOTO label_ENDIF_16 +j label_ENDIF_16 +label_FALSEIF_15: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_27 --> -112($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t7, String + sw $t7, 0($v0) + la $t7, String_start + sw $t7, 4($v0) + # Load type offset + li $t7, 8 + sw $t7, 8($v0) + la $t7, Int + sw $t7, 12($v0) + li $t7, 3 + sw $t7, 16($v0) + move $t7, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t7, 0($v0) + la $t7, Int_start + sw $t7, 4($v0) + # Load type offset + li $t7, 16 + sw $t7, 8($v0) + li $t7, 0 + sw $t7, 12($v0) + sw $v0, -112($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_27 --> -112($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_20 = local_cell_at_next_evolution_at_CellularAutomaton_internal_27 + lw $t7, -112($fp) + sw $t7, -84($fp) + label_ENDIF_16: # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_2 = local_cell_at_next_evolution_at_CellularAutomaton_internal_3 + local_cell_at_next_evolution_at_CellularAutomaton_internal_16 -lw $t2, -16($fp) -lw $t3, -68($fp) -add $t2, $t2, $t3 -sw $t2, -12($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_2 = local_cell_at_next_evolution_at_CellularAutomaton_internal_3 + local_cell_at_next_evolution_at_CellularAutomaton_internal_20 +lw $t8, -16($fp) +lw $t7, 12($t8) +lw $t8, -84($fp) +lw $t9, 12($t8) +add $t7, $t7, $t9 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t8, String +sw $t8, 0($v0) +la $t8, String_start +sw $t8, 4($v0) +# Load type offset +li $t8, 8 +sw $t8, 8($v0) +la $t8, Int +sw $t8, 12($v0) +li $t8, 3 +sw $t8, 16($v0) +move $t8, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t8, 0($v0) +la $t8, Int_start +sw $t8, 4($v0) +# Load type offset +li $t8, 16 +sw $t8, 8($v0) +sw $t7, 12($v0) +sw $v0, -12($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_28 --> -116($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t7, String +sw $t7, 0($v0) +la $t7, String_start +sw $t7, 4($v0) +# Load type offset +li $t7, 8 +sw $t7, 8($v0) +la $t7, Int +sw $t7, 12($v0) +li $t7, 3 +sw $t7, 16($v0) +move $t7, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t7, 0($v0) +la $t7, Int_start +sw $t7, 4($v0) +# Load type offset +li $t7, 16 +sw $t7, 8($v0) +li $t7, 1 +sw $t7, 12($v0) +sw $v0, -116($fp) # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = local_cell_at_next_evolution_at_CellularAutomaton_internal_2 - 1 -lw $t2, -12($fp) -sub $t2, $t2, 1 -sw $t2, -8($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_TRUE_15 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_TRUE_15 -lw $t2, -8($fp) -beq $t2, 0, label_TRUE_15 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = 0 -li $t2, 0 -sw $t2, -8($fp) -# GOTO label_END_16 -j label_END_16 -label_TRUE_15: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = 1 - li $t2, 1 - sw $t2, -8($fp) - label_END_16: -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_13 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_13 -lw $t2, -8($fp) -beq $t2, 0, label_FALSEIF_13 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_28 --> -116($fp) +lw $t7, -12($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_9 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_9 +lw $t8, -8($fp) +beq $t8, 0, label_FALSEIF_9 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string -la $t2, String -sw $t2, 0($v0) -la $t2, String_start -sw $t2, 4($v0) +la $t8, String +sw $t8, 0($v0) +la $t8, String_start +sw $t8, 4($v0) # Load type offset -li $t2, 8 -sw $t2, 8($v0) -la $t2, data_9 -sw $t2, 12($v0) -li $t2, 1 -sw $t2, 16($v0) -sw $v0, -92($fp) +li $t8, 8 +sw $t8, 8($v0) +la $t8, data_9 +sw $t8, 12($v0) +li $t8, 1 +sw $t8, 16($v0) +sw $v0, -120($fp) # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_0 = local_cell_at_next_evolution_at_CellularAutomaton_internal_22 -lw $t2, -92($fp) -sw $t2, -4($fp) -# GOTO label_ENDIF_14 -j label_ENDIF_14 -label_FALSEIF_13: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_0 = local_cell_at_next_evolution_at_CellularAutomaton_internal_29 +lw $t8, -120($fp) +sw $t8, -4($fp) +# GOTO label_ENDIF_10 +j label_ENDIF_10 +label_FALSEIF_9: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_30 --> -124($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + la $t8, String + sw $t8, 0($v0) + la $t8, String_start + sw $t8, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_10 - sw $t2, 12($v0) - li $t2, 1 - sw $t2, 16($v0) - sw $v0, -96($fp) + li $t8, 8 + sw $t8, 8($v0) + la $t8, data_10 + sw $t8, 12($v0) + li $t8, 1 + sw $t8, 16($v0) + sw $v0, -124($fp) # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_0 = local_cell_at_next_evolution_at_CellularAutomaton_internal_23 - lw $t2, -96($fp) - sw $t2, -4($fp) - label_ENDIF_14: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_30 --> -124($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_0 = local_cell_at_next_evolution_at_CellularAutomaton_internal_30 + lw $t8, -124($fp) + sw $t8, -4($fp) + label_ENDIF_10: # RETURN local_cell_at_next_evolution_at_CellularAutomaton_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. @@ -1944,7 +2696,7 @@ lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 104 +addu $sp, $sp, 132 # Deallocate function args addu $sp, $sp, 4 jr $ra @@ -1955,22 +2707,22 @@ jr $ra # @Params: function_evolve_at_CellularAutomaton: # Allocate stack frame for function function_evolve_at_CellularAutomaton. - subu $sp, $sp, 64 + subu $sp, $sp, 68 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 64 + addu $fp, $sp, 68 # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) # local_evolve_at_CellularAutomaton_position_0 = 0 - li $t2, 0 - sw $t2, -4($fp) + li $t8, 0 + sw $t8, -4($fp) # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) # local_evolve_at_CellularAutomaton_internal_4 = SELF sw $s1, -20($fp) # LOCAL local_evolve_at_CellularAutomaton_internal_2 --> -12($fp) # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) # local_evolve_at_CellularAutomaton_internal_2 = local_evolve_at_CellularAutomaton_internal_4 - lw $t2, -20($fp) - sw $t2, -12($fp) + lw $t8, -20($fp) + sw $t8, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1980,13 +2732,13 @@ function_evolve_at_CellularAutomaton: # Save new self pointer in $s1 lw $s1, -12($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t8, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t9, 0($t8) # Get pointer to function address - lw $t4, 36($t3) + lw $s2, 36($t9) # Call function. Result is on $v0 - jalr $t4 + jalr $s2 sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1994,64 +2746,94 @@ function_evolve_at_CellularAutomaton: # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) # local_evolve_at_CellularAutomaton_num_1 = local_evolve_at_CellularAutomaton_internal_3 - lw $t2, -16($fp) - sw $t2, -8($fp) + lw $t8, -16($fp) + sw $t8, -8($fp) # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + la $t8, String + sw $t8, 0($v0) + la $t8, String_start + sw $t8, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_0 - sw $t2, 12($v0) - li $t2, 0 - sw $t2, 16($v0) + li $t8, 8 + sw $t8, 8($v0) + la $t8, data_0 + sw $t8, 12($v0) + li $t8, 0 + sw $t8, 16($v0) sw $v0, -24($fp) - label_WHILE_29: + label_WHILE_17: # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) # local_evolve_at_CellularAutomaton_internal_6 = local_evolve_at_CellularAutomaton_position_0 - local_evolve_at_CellularAutomaton_num_1 - lw $t2, -4($fp) - lw $t3, -8($fp) - sub $t2, $t2, $t3 - sw $t2, -28($fp) - # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_31 - # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_31 - lw $t2, -28($fp) - bgt $t2, 0, label_FALSE_31 - # IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_31 - # IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_31 - lw $t2, -28($fp) - beq $t2, 0, label_FALSE_31 + lw $t9, -4($fp) + lw $t8, 12($t9) + lw $t9, -8($fp) + lw $s2, 12($t9) + sub $t8, $t8, $s2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t9, String + sw $t9, 0($v0) + la $t9, String_start + sw $t9, 4($v0) + # Load type offset + li $t9, 8 + sw $t9, 8($v0) + la $t9, Int + sw $t9, 12($v0) + li $t9, 3 + sw $t9, 16($v0) + move $t9, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t9, 0($v0) + la $t9, Int_start + sw $t9, 4($v0) + # Load type offset + li $t9, 16 + sw $t9, 8($v0) + sw $t8, 12($v0) + sw $v0, -28($fp) + # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_19 + # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_19 + lw $t8, -28($fp) + bgt $t8, 0, label_FALSE_19 + # IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_19 + # IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_19 + lw $t8, -28($fp) + beq $t8, 0, label_FALSE_19 # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) # local_evolve_at_CellularAutomaton_internal_6 = 1 - li $t2, 1 - sw $t2, -28($fp) - # GOTO label_END_32 -j label_END_32 -label_FALSE_31: + li $t8, 1 + sw $t8, -28($fp) + # GOTO label_END_20 +j label_END_20 +label_FALSE_19: # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) # local_evolve_at_CellularAutomaton_internal_6 = 0 - li $t2, 0 - sw $t2, -28($fp) - label_END_32: -# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_30 -# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_30 -lw $t2, -28($fp) -beq $t2, 0, label_WHILE_END_30 + li $t8, 0 + sw $t8, -28($fp) + label_END_20: +# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_18 +# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_18 +lw $t8, -28($fp) +beq $t8, 0, label_WHILE_END_18 # LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) # local_evolve_at_CellularAutomaton_internal_7 = local_evolve_at_CellularAutomaton_temp_5 -lw $t2, -24($fp) -sw $t2, -32($fp) +lw $t8, -24($fp) +sw $t8, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -2061,53 +2843,53 @@ sw $s1, -48($fp) # LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) # LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) # local_evolve_at_CellularAutomaton_internal_9 = local_evolve_at_CellularAutomaton_internal_11 -lw $t2, -48($fp) -sw $t2, -40($fp) +lw $t8, -48($fp) +sw $t8, -40($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG local_evolve_at_CellularAutomaton_position_0 # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) -lw $t2, -4($fp) +lw $t8, -4($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t2, 0($sp) +sw $t8, 0($sp) # LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) # LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) # local_evolve_at_CellularAutomaton_internal_10 = VCALL local_evolve_at_CellularAutomaton_internal_9 cell_at_next_evolution # Save new self pointer in $s1 lw $s1, -40($fp) # Get pointer to type -lw $t2, 4($s1) +lw $t8, 4($s1) # Get pointer to type's VTABLE -lw $t3, 0($t2) +lw $t9, 0($t8) # Get pointer to function address -lw $t4, 52($t3) +lw $s2, 52($t9) # Call function. Result is on $v0 -jalr $t4 +jalr $s2 sw $v0, -44($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_evolve_at_CellularAutomaton_internal_10 # LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) -lw $t2, -44($fp) +lw $t8, -44($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t2, 0($sp) +sw $t8, 0($sp) # LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) # LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) # local_evolve_at_CellularAutomaton_internal_8 = VCALL local_evolve_at_CellularAutomaton_internal_7 concat # Save new self pointer in $s1 lw $s1, -32($fp) # Get pointer to type -lw $t2, 4($s1) +lw $t8, 4($s1) # Get pointer to type's VTABLE -lw $t3, 0($t2) +lw $t9, 0($t8) # Get pointer to function address -lw $t4, 12($t3) +lw $s2, 12($t9) # Call function. Result is on $v0 -jalr $t4 +jalr $s2 sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -2115,38 +2897,101 @@ addu $sp, $sp, 4 # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) # LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) # local_evolve_at_CellularAutomaton_temp_5 = local_evolve_at_CellularAutomaton_internal_8 -lw $t2, -36($fp) -sw $t2, -24($fp) +lw $t8, -36($fp) +sw $t8, -24($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t8, String +sw $t8, 0($v0) +la $t8, String_start +sw $t8, 4($v0) +# Load type offset +li $t8, 8 +sw $t8, 8($v0) +la $t8, Int +sw $t8, 12($v0) +li $t8, 3 +sw $t8, 16($v0) +move $t8, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t8, 0($v0) +la $t8, Int_start +sw $t8, 4($v0) +# Load type offset +li $t8, 16 +sw $t8, 8($v0) +li $t8, 1 +sw $t8, 12($v0) +sw $v0, -56($fp) # LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) -# local_evolve_at_CellularAutomaton_internal_12 = local_evolve_at_CellularAutomaton_position_0 + 1 -lw $t2, -4($fp) -add $t2, $t2, 1 -sw $t2, -52($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) +# local_evolve_at_CellularAutomaton_internal_12 = local_evolve_at_CellularAutomaton_position_0 + local_evolve_at_CellularAutomaton_internal_13 +lw $t9, -4($fp) +lw $t8, 12($t9) +lw $t9, -56($fp) +lw $s2, 12($t9) +add $t8, $t8, $s2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t9, String +sw $t9, 0($v0) +la $t9, String_start +sw $t9, 4($v0) +# Load type offset +li $t9, 8 +sw $t9, 8($v0) +la $t9, Int +sw $t9, 12($v0) +li $t9, 3 +sw $t9, 16($v0) +move $t9, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t9, 0($v0) +la $t9, Int_start +sw $t9, 4($v0) +# Load type offset +li $t9, 16 +sw $t9, 8($v0) +sw $t8, 12($v0) +sw $v0, -52($fp) # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) # LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) # local_evolve_at_CellularAutomaton_position_0 = local_evolve_at_CellularAutomaton_internal_12 -lw $t2, -52($fp) -sw $t2, -4($fp) -# GOTO label_WHILE_29 -j label_WHILE_29 -label_WHILE_END_30: +lw $t8, -52($fp) +sw $t8, -4($fp) +# GOTO label_WHILE_17 +j label_WHILE_17 +label_WHILE_END_18: # # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) - lw $t2, -24($fp) - sw $t2, 12($s1) - # LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) - # local_evolve_at_CellularAutomaton_internal_13 = SELF - sw $s1, -56($fp) - # RETURN local_evolve_at_CellularAutomaton_internal_13 - lw $v0, -56($fp) + lw $t8, -24($fp) + sw $t8, 12($s1) + # LOCAL local_evolve_at_CellularAutomaton_internal_14 --> -60($fp) + # local_evolve_at_CellularAutomaton_internal_14 = SELF + sw $s1, -60($fp) + # RETURN local_evolve_at_CellularAutomaton_internal_14 + lw $v0, -60($fp) # Deallocate stack frame for function function_evolve_at_CellularAutomaton. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 64 + addu $sp, $sp, 68 jr $ra # Function END diff --git a/tests/codegen/complex.mips b/tests/codegen/complex.mips index 5b990e63..54ea0dff 100644 --- a/tests/codegen/complex.mips +++ b/tests/codegen/complex.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:41 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:21 2020 # School of Math and Computer Science, University of Havana # @@ -13,6 +13,8 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END +Int: .asciiz "Int" +# Function END Complex: .asciiz "Complex" # Function END Main: .asciiz "Main" @@ -76,6 +78,20 @@ Bool_end: # +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + # **** VTABLE for type Complex **** Complex_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Complex, function_print_at_Complex, function_reflect_0_at_Complex, function_reflect_X_at_Complex, function_reflect_Y_at_Complex # Function END @@ -116,12 +132,13 @@ data_2: .asciiz "\n" # -IO__TDT: .word 0, -1, -1, -1, 1, 1 -Object__TDT: .word 1, 0, 1, 1, 2, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1 -Complex__TDT: .word -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, 0 +IO__TDT: .word 0, -1, -1, -1, -1, 1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1 +Complex__TDT: .word -1, -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, 0 # @@ -219,7 +236,8 @@ function_out_int_at_IO: addu $fp, $sp, 32 # PRINT_INT param_out_int_at_IO_x_0 # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) li $v0, 1 syscall # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) @@ -285,6 +303,35 @@ function_in_int_at_IO: # local_in_int_at_IO_internal_0 = READ_INT li $v0, 5 syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) sw $v0, -4($fp) # RETURN local_in_int_at_IO_internal_0 lw $v0, -4($fp) @@ -382,7 +429,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -471,8 +518,10 @@ function_substr_at_String: # PARAM param_substr_at_String_r_1 --> 0($fp) lw $t0, 12($s1) lw $t2, 4($fp) + lw $t2, 12($t2) addu $t0, $t0, $t2 lw $a0, 0($fp) + lw $a0, 12($a0) move $t3, $a0 move $t1, $a0 addu $a0, $a0, 1 @@ -532,8 +581,40 @@ function_length_at_String: # LOCAL local_length_at_String_internal_0 --> -4($fp) lw $t0, 16($s1) sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function function_length_at_String. # Restore $ra lw $ra, 4($sp) @@ -560,28 +641,28 @@ entry: li $v0, 9 syscall # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) # Load type offset - li $t2, 20 - sw $t2, 8($v0) + li $t0, 24 + sw $t0, 8($v0) move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 @@ -599,11 +680,11 @@ entry: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type's VTABLE - la $t1, Main_vtable + la $t0, Main_vtable # Get pointer to function address - lw $t2, 28($t1) + lw $t1, 28($t0) # Call function. Result is on $v0 - jalr $t2 + jalr $t1 sw $v0, -8($fp) # RETURN 0 li $v0, 0 @@ -626,8 +707,39 @@ __Complex__attrib__x__init: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 + # LOCAL local___attrib__x__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local___attrib__x__init_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function __Complex__attrib__x__init. # Restore $ra lw $ra, 4($sp) @@ -647,8 +759,39 @@ __Complex__attrib__y__init: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 + # LOCAL local___attrib__y__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local___attrib__y__init_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function __Complex__attrib__y__init. # Restore $ra lw $ra, 4($sp) @@ -666,78 +809,420 @@ __Complex__attrib__y__init: # 4($fp) = param_init_at_Complex_b_1 function_init_at_Complex: # Allocate stack frame for function function_init_at_Complex. - subu $sp, $sp, 32 + subu $sp, $sp, 36 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_init_at_Complex_internal_1 = GETATTRIBUTE x Complex + addu $fp, $sp, 36 + # local_init_at_Complex_internal_2 = GETATTRIBUTE x Complex + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # IF_ZERO local_init_at_Complex_internal_2 GOTO label_FALSE_1 + # IF_ZERO local_init_at_Complex_internal_2 GOTO label_FALSE_1 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_1 + # IF_ZERO param_init_at_Complex_a_0 GOTO label_FALSE_1 + # IF_ZERO param_init_at_Complex_a_0 GOTO label_FALSE_1 + lw $t0, 4($fp) + beq $t0, 0, label_FALSE_1 # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - lw $t1, 12($s1) - sw $t1, -8($fp) - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_STRING_4 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_STRING_4 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_STRING_4 + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_5 # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_5 + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) # PARAM param_init_at_Complex_a_0 --> 4($fp) - # local_init_at_Complex_internal_0 = local_init_at_Complex_internal_1 - PARAM param_init_at_Complex_a_0 - lw $t1, -8($fp) - lw $t2, 4($fp) - sub $t1, $t1, $t2 - sw $t1, -4($fp) - # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_1 - # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_1 - lw $t1, -4($fp) - beq $t1, 0, label_TRUE_1 - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # local_init_at_Complex_internal_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # GOTO label_END_2 -j label_END_2 -label_TRUE_1: + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, 4($fp) + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_2 + # GOTO label_FALSE_1 + j label_FALSE_1 + label_COMPARE_BY_VALUE_5: + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + lw $a0, -12($fp) + lw $a1, 4($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_2 + # GOTO label_FALSE_1 + j label_FALSE_1 + label_COMPARE_STRING_4: + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, 4($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_CONTINUE_6 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_CONTINUE_6 + lw $t0, -8($fp) + beq $t0, 0, label_CONTINUE_6 + # GOTO label_FALSE_1 + j label_FALSE_1 + label_CONTINUE_6: + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, 4($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_7: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_8 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_7 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_8: + # Store result + sw $a2, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_2 + label_FALSE_1: + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # GOTO label_END_3 +j label_END_3 +label_TRUE_2: # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # local_init_at_Complex_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - label_END_2: -# local_init_at_Complex_internal_3 = GETATTRIBUTE y Complex -# LOCAL local_init_at_Complex_internal_3 --> -16($fp) -lw $t1, 16($s1) -sw $t1, -16($fp) -# LOCAL local_init_at_Complex_internal_2 --> -12($fp) -# LOCAL local_init_at_Complex_internal_3 --> -16($fp) -# PARAM param_init_at_Complex_b_1 --> 0($fp) -# local_init_at_Complex_internal_2 = local_init_at_Complex_internal_3 - PARAM param_init_at_Complex_b_1 -lw $t1, -16($fp) -lw $t2, 0($fp) -sub $t1, $t1, $t2 -sw $t1, -12($fp) -# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_3 -# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_3 -lw $t1, -12($fp) -beq $t1, 0, label_TRUE_3 -# LOCAL local_init_at_Complex_internal_2 --> -12($fp) -# local_init_at_Complex_internal_2 = 0 -li $t1, 0 -sw $t1, -12($fp) -# GOTO label_END_4 -j label_END_4 -label_TRUE_3: - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # local_init_at_Complex_internal_2 = 1 - li $t1, 1 - sw $t1, -12($fp) - label_END_4: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + label_END_3: +# local_init_at_Complex_internal_5 = GETATTRIBUTE y Complex +# LOCAL local_init_at_Complex_internal_5 --> -24($fp) +lw $t0, 16($s1) +sw $t0, -24($fp) +# IF_ZERO local_init_at_Complex_internal_5 GOTO label_FALSE_9 +# IF_ZERO local_init_at_Complex_internal_5 GOTO label_FALSE_9 +lw $t0, -24($fp) +beq $t0, 0, label_FALSE_9 +# IF_ZERO param_init_at_Complex_b_1 GOTO label_FALSE_9 +# IF_ZERO param_init_at_Complex_b_1 GOTO label_FALSE_9 +lw $t0, 0($fp) +beq $t0, 0, label_FALSE_9 +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# LOCAL local_init_at_Complex_internal_5 --> -24($fp) +# Comparing -24($fp) type with String +la $v0, String +lw $a0, -24($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -20($fp) +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_STRING_12 +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_STRING_12 +lw $t0, -20($fp) +beq $t0, 0, label_COMPARE_STRING_12 +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# LOCAL local_init_at_Complex_internal_5 --> -24($fp) +# Comparing -24($fp) type with Bool +la $v0, Bool +lw $a0, -24($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -20($fp) +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 +lw $t0, -20($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_13 # LOCAL local_init_at_Complex_internal_4 --> -20($fp) -# local_init_at_Complex_internal_4 = SELF -sw $s1, -20($fp) -# RETURN local_init_at_Complex_internal_4 -lw $v0, -20($fp) +# LOCAL local_init_at_Complex_internal_5 --> -24($fp) +# Comparing -24($fp) type with Int +la $v0, Int +lw $a0, -24($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -20($fp) +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 +lw $t0, -20($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_13 +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# LOCAL local_init_at_Complex_internal_5 --> -24($fp) +# PARAM param_init_at_Complex_b_1 --> 0($fp) +# Load pointers and SUB +lw $a0, -24($fp) +lw $a1, 0($fp) +sub $a0, $a0, $a1 +sw $a0, -20($fp) +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 +lw $t0, -20($fp) +beq $t0, 0, label_TRUE_10 +# GOTO label_FALSE_9 +j label_FALSE_9 +label_COMPARE_BY_VALUE_13: + # LOCAL local_init_at_Complex_internal_4 --> -20($fp) + # LOCAL local_init_at_Complex_internal_5 --> -24($fp) + # PARAM param_init_at_Complex_b_1 --> 0($fp) + lw $a0, -24($fp) + lw $a1, 0($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -20($fp) + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 + lw $t0, -20($fp) + beq $t0, 0, label_TRUE_10 + # GOTO label_FALSE_9 + j label_FALSE_9 + label_COMPARE_STRING_12: + # LOCAL local_init_at_Complex_internal_4 --> -20($fp) + # LOCAL local_init_at_Complex_internal_5 --> -24($fp) + # PARAM param_init_at_Complex_b_1 --> 0($fp) + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, 0($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -20($fp) + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_CONTINUE_14 + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_CONTINUE_14 + lw $t0, -20($fp) + beq $t0, 0, label_CONTINUE_14 + # GOTO label_FALSE_9 + j label_FALSE_9 + label_CONTINUE_14: + # LOCAL local_init_at_Complex_internal_4 --> -20($fp) + # LOCAL local_init_at_Complex_internal_5 --> -24($fp) + # PARAM param_init_at_Complex_b_1 --> 0($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, 0($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_15: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_16 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_15 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_16: + # Store result + sw $a2, -20($fp) + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 + lw $t0, -20($fp) + beq $t0, 0, label_TRUE_10 + label_FALSE_9: + # LOCAL local_init_at_Complex_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -16($fp) + # GOTO label_END_11 +j label_END_11 +label_TRUE_10: + # LOCAL local_init_at_Complex_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -16($fp) + label_END_11: +# LOCAL local_init_at_Complex_internal_6 --> -28($fp) +# local_init_at_Complex_internal_6 = SELF +sw $s1, -28($fp) +# RETURN local_init_at_Complex_internal_6 +lw $v0, -28($fp) # Deallocate stack frame for function function_init_at_Complex. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 32 +addu $sp, $sp, 36 # Deallocate function args addu $sp, $sp, 8 jr $ra @@ -748,272 +1233,482 @@ jr $ra # @Params: function_print_at_Complex: # Allocate stack frame for function function_print_at_Complex. - subu $sp, $sp, 88 + subu $sp, $sp, 100 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 88 - # local_print_at_Complex_internal_2 = GETATTRIBUTE y Complex - # LOCAL local_print_at_Complex_internal_2 --> -12($fp) - lw $t1, 16($s1) - sw $t1, -12($fp) - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + addu $fp, $sp, 100 + # local_print_at_Complex_internal_4 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # LOCAL local_print_at_Complex_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # IF_ZERO local_print_at_Complex_internal_4 GOTO label_FALSE_19 + # IF_ZERO local_print_at_Complex_internal_4 GOTO label_FALSE_19 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_19 + # IF_ZERO local_print_at_Complex_internal_5 GOTO label_FALSE_19 + # IF_ZERO local_print_at_Complex_internal_5 GOTO label_FALSE_19 + lw $t0, -24($fp) + beq $t0, 0, label_FALSE_19 + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # Comparing -20($fp) type with String + la $v0, String + lw $a0, -20($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_STRING_22 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_STRING_22 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_22 + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # Comparing -20($fp) type with Bool + la $v0, Bool + lw $a0, -20($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_23 + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # Comparing -20($fp) type with Int + la $v0, Int + lw $a0, -20($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_23 + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # LOCAL local_print_at_Complex_internal_5 --> -24($fp) + # Load pointers and SUB + lw $a0, -20($fp) + lw $a1, -24($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_20 + # GOTO label_FALSE_19 + j label_FALSE_19 + label_COMPARE_BY_VALUE_23: + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # LOCAL local_print_at_Complex_internal_5 --> -24($fp) + lw $a0, -20($fp) + lw $a1, -24($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_20 + # GOTO label_FALSE_19 + j label_FALSE_19 + label_COMPARE_STRING_22: + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # LOCAL local_print_at_Complex_internal_5 --> -24($fp) + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -24($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_CONTINUE_24 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_CONTINUE_24 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_24 + # GOTO label_FALSE_19 + j label_FALSE_19 + label_CONTINUE_24: + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # LOCAL local_print_at_Complex_internal_5 --> -24($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -24($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_25: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_26 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_25 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_26: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_20 + label_FALSE_19: + # LOCAL local_print_at_Complex_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_21 +j label_END_21 +label_TRUE_20: # LOCAL local_print_at_Complex_internal_2 --> -12($fp) - # local_print_at_Complex_internal_1 = local_print_at_Complex_internal_2 - 0 - lw $t1, -12($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_7 - # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_7 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_7 - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # local_print_at_Complex_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_8 -j label_END_8 -label_TRUE_7: - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # local_print_at_Complex_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_8: -# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_5 -# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_5 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_5 -# LOCAL local_print_at_Complex_internal_5 --> -24($fp) -# local_print_at_Complex_internal_5 = SELF -sw $s1, -24($fp) -# LOCAL local_print_at_Complex_internal_3 --> -16($fp) -# LOCAL local_print_at_Complex_internal_5 --> -24($fp) -# local_print_at_Complex_internal_3 = local_print_at_Complex_internal_5 -lw $t1, -24($fp) -sw $t1, -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_21: +# LOCAL local_print_at_Complex_internal_0 --> -4($fp) +# LOCAL local_print_at_Complex_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_print_at_Complex_internal_0 GOTO label_FALSEIF_17 +# IF_ZERO local_print_at_Complex_internal_0 GOTO label_FALSEIF_17 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_17 +# LOCAL local_print_at_Complex_internal_8 --> -36($fp) +# local_print_at_Complex_internal_8 = SELF +sw $s1, -36($fp) +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +# LOCAL local_print_at_Complex_internal_8 --> -36($fp) +# local_print_at_Complex_internal_6 = local_print_at_Complex_internal_8 +lw $t0, -36($fp) +sw $t0, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# local_print_at_Complex_internal_6 = GETATTRIBUTE x Complex -# LOCAL local_print_at_Complex_internal_6 --> -28($fp) -lw $t1, 12($s1) -sw $t1, -28($fp) -# ARG local_print_at_Complex_internal_6 -# LOCAL local_print_at_Complex_internal_6 --> -28($fp) -lw $t1, -28($fp) +# local_print_at_Complex_internal_9 = GETATTRIBUTE x Complex +# LOCAL local_print_at_Complex_internal_9 --> -40($fp) +lw $t0, 12($s1) +sw $t0, -40($fp) +# ARG local_print_at_Complex_internal_9 +# LOCAL local_print_at_Complex_internal_9 --> -40($fp) +lw $t0, -40($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_print_at_Complex_internal_3 --> -16($fp) -# LOCAL local_print_at_Complex_internal_4 --> -20($fp) -# local_print_at_Complex_internal_4 = VCALL local_print_at_Complex_internal_3 out_int +sw $t0, 0($sp) +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +# LOCAL local_print_at_Complex_internal_7 --> -32($fp) +# local_print_at_Complex_internal_7 = VCALL local_print_at_Complex_internal_6 out_int # Save new self pointer in $s1 -lw $s1, -16($fp) +lw $s1, -28($fp) # Get pointer to type -lw $t1, 4($s1) +lw $t0, 4($s1) # Get pointer to type's VTABLE -lw $t2, 0($t1) +lw $t0, 0($t0) # Get pointer to function address -lw $t3, 16($t2) +lw $t0, 16($t0) # Call function. Result is on $v0 -jalr $t3 -sw $v0, -20($fp) +jalr $t0 +sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_print_at_Complex_internal_0 --> -4($fp) -# LOCAL local_print_at_Complex_internal_4 --> -20($fp) -# local_print_at_Complex_internal_0 = local_print_at_Complex_internal_4 -lw $t1, -20($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_6 -j label_ENDIF_6 -label_FALSEIF_5: - # LOCAL local_print_at_Complex_internal_15 --> -64($fp) - # local_print_at_Complex_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_print_at_Complex_internal_13 --> -56($fp) - # LOCAL local_print_at_Complex_internal_15 --> -64($fp) - # local_print_at_Complex_internal_13 = local_print_at_Complex_internal_15 - lw $t1, -64($fp) - sw $t1, -56($fp) +# LOCAL local_print_at_Complex_internal_1 --> -8($fp) +# LOCAL local_print_at_Complex_internal_7 --> -32($fp) +# local_print_at_Complex_internal_1 = local_print_at_Complex_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_18 +j label_ENDIF_18 +label_FALSEIF_17: + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + # local_print_at_Complex_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + # local_print_at_Complex_internal_16 = local_print_at_Complex_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_print_at_Complex_internal_16 = GETATTRIBUTE x Complex - # LOCAL local_print_at_Complex_internal_16 --> -68($fp) - lw $t1, 12($s1) - sw $t1, -68($fp) - # ARG local_print_at_Complex_internal_16 - # LOCAL local_print_at_Complex_internal_16 --> -68($fp) - lw $t1, -68($fp) + # local_print_at_Complex_internal_19 = GETATTRIBUTE x Complex + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + lw $t0, 12($s1) + sw $t0, -80($fp) + # ARG local_print_at_Complex_internal_19 + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + lw $t0, -80($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Complex_internal_13 --> -56($fp) - # LOCAL local_print_at_Complex_internal_14 --> -60($fp) - # local_print_at_Complex_internal_14 = VCALL local_print_at_Complex_internal_13 out_int + sw $t0, 0($sp) + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + # local_print_at_Complex_internal_17 = VCALL local_print_at_Complex_internal_16 out_int # Save new self pointer in $s1 - lw $s1, -56($fp) + lw $s1, -68($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 16($t2) + lw $t0, 16($t0) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -60($fp) + jalr $t0 + sw $v0, -72($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_11 --> -48($fp) # LOCAL local_print_at_Complex_internal_14 --> -60($fp) - # local_print_at_Complex_internal_11 = local_print_at_Complex_internal_14 - lw $t1, -60($fp) - sw $t1, -48($fp) + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + # local_print_at_Complex_internal_14 = local_print_at_Complex_internal_17 + lw $t0, -72($fp) + sw $t0, -60($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + # LOCAL local_print_at_Complex_internal_20 --> -84($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_4 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -72($fp) - # ARG local_print_at_Complex_internal_17 - # LOCAL local_print_at_Complex_internal_17 --> -72($fp) - lw $t1, -72($fp) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -84($fp) + # ARG local_print_at_Complex_internal_20 + # LOCAL local_print_at_Complex_internal_20 --> -84($fp) + lw $t0, -84($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Complex_internal_11 --> -48($fp) - # LOCAL local_print_at_Complex_internal_12 --> -52($fp) - # local_print_at_Complex_internal_12 = VCALL local_print_at_Complex_internal_11 out_string + sw $t0, 0($sp) + # LOCAL local_print_at_Complex_internal_14 --> -60($fp) + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_15 = VCALL local_print_at_Complex_internal_14 out_string # Save new self pointer in $s1 - lw $s1, -48($fp) + lw $s1, -60($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 12($t2) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -52($fp) + jalr $t0 + sw $v0, -64($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_9 --> -40($fp) # LOCAL local_print_at_Complex_internal_12 --> -52($fp) - # local_print_at_Complex_internal_9 = local_print_at_Complex_internal_12 - lw $t1, -52($fp) - sw $t1, -40($fp) + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_12 = local_print_at_Complex_internal_15 + lw $t0, -64($fp) + sw $t0, -52($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_print_at_Complex_internal_18 = GETATTRIBUTE y Complex - # LOCAL local_print_at_Complex_internal_18 --> -76($fp) - lw $t1, 16($s1) - sw $t1, -76($fp) - # ARG local_print_at_Complex_internal_18 - # LOCAL local_print_at_Complex_internal_18 --> -76($fp) - lw $t1, -76($fp) + # local_print_at_Complex_internal_21 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_21 --> -88($fp) + lw $t0, 16($s1) + sw $t0, -88($fp) + # ARG local_print_at_Complex_internal_21 + # LOCAL local_print_at_Complex_internal_21 --> -88($fp) + lw $t0, -88($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Complex_internal_9 --> -40($fp) - # LOCAL local_print_at_Complex_internal_10 --> -44($fp) - # local_print_at_Complex_internal_10 = VCALL local_print_at_Complex_internal_9 out_int + sw $t0, 0($sp) + # LOCAL local_print_at_Complex_internal_12 --> -52($fp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # local_print_at_Complex_internal_13 = VCALL local_print_at_Complex_internal_12 out_int # Save new self pointer in $s1 - lw $s1, -40($fp) + lw $s1, -52($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 16($t2) + lw $t0, 16($t0) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) + jalr $t0 + sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_7 --> -32($fp) # LOCAL local_print_at_Complex_internal_10 --> -44($fp) - # local_print_at_Complex_internal_7 = local_print_at_Complex_internal_10 - lw $t1, -44($fp) - sw $t1, -32($fp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # local_print_at_Complex_internal_10 = local_print_at_Complex_internal_13 + lw $t0, -56($fp) + sw $t0, -44($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + # LOCAL local_print_at_Complex_internal_22 --> -92($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_5 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -80($fp) - # ARG local_print_at_Complex_internal_19 - # LOCAL local_print_at_Complex_internal_19 --> -80($fp) - lw $t1, -80($fp) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -92($fp) + # ARG local_print_at_Complex_internal_22 + # LOCAL local_print_at_Complex_internal_22 --> -92($fp) + lw $t0, -92($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Complex_internal_7 --> -32($fp) - # LOCAL local_print_at_Complex_internal_8 --> -36($fp) - # local_print_at_Complex_internal_8 = VCALL local_print_at_Complex_internal_7 out_string + sw $t0, 0($sp) + # LOCAL local_print_at_Complex_internal_10 --> -44($fp) + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # local_print_at_Complex_internal_11 = VCALL local_print_at_Complex_internal_10 out_string # Save new self pointer in $s1 - lw $s1, -32($fp) + lw $s1, -44($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 12($t2) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -36($fp) + jalr $t0 + sw $v0, -48($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_0 --> -4($fp) - # LOCAL local_print_at_Complex_internal_8 --> -36($fp) - # local_print_at_Complex_internal_0 = local_print_at_Complex_internal_8 - lw $t1, -36($fp) - sw $t1, -4($fp) - label_ENDIF_6: -# RETURN local_print_at_Complex_internal_0 -lw $v0, -4($fp) + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # local_print_at_Complex_internal_1 = local_print_at_Complex_internal_11 + lw $t0, -48($fp) + sw $t0, -8($fp) + label_ENDIF_18: +# RETURN local_print_at_Complex_internal_1 +lw $v0, -8($fp) # Deallocate stack frame for function function_print_at_Complex. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 88 +addu $sp, $sp, 100 jr $ra # Function END @@ -1022,96 +1717,506 @@ jr $ra # @Params: function_reflect_0_at_Complex: # Allocate stack frame for function function_reflect_0_at_Complex. - subu $sp, $sp, 44 + subu $sp, $sp, 52 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 44 - # local_reflect_0_at_Complex_internal_1 = GETATTRIBUTE x Complex - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - lw $t1, 12($s1) - sw $t1, -8($fp) - # local_reflect_0_at_Complex_internal_3 = GETATTRIBUTE x Complex - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - lw $t1, 12($s1) - sw $t1, -16($fp) + addu $fp, $sp, 52 + # local_reflect_0_at_Complex_internal_2 = GETATTRIBUTE x Complex # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # local_reflect_0_at_Complex_internal_4 = GETATTRIBUTE x Complex + # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) + lw $t0, 12($s1) + sw $t0, -20($fp) # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - lw $t1, -16($fp) - not $t1, $t1 - sw $t1, -12($fp) - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) + lw $t0, -20($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -16($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -16($fp) + sw $t0, 12($v0) + sw $v0, -16($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_2 GOTO label_FALSE_27 + # IF_ZERO local_reflect_0_at_Complex_internal_2 GOTO label_FALSE_27 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_27 + # IF_ZERO local_reflect_0_at_Complex_internal_3 GOTO label_FALSE_27 + # IF_ZERO local_reflect_0_at_Complex_internal_3 GOTO label_FALSE_27 + lw $t0, -16($fp) + beq $t0, 0, label_FALSE_27 # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # local_reflect_0_at_Complex_internal_0 = local_reflect_0_at_Complex_internal_1 - local_reflect_0_at_Complex_internal_2 - lw $t1, -8($fp) - lw $t2, -12($fp) - sub $t1, $t1, $t2 - sw $t1, -4($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_9 - # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_9 - lw $t1, -4($fp) - beq $t1, 0, label_TRUE_9 - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # local_reflect_0_at_Complex_internal_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # GOTO label_END_10 -j label_END_10 -label_TRUE_9: + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_STRING_30 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_STRING_30 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_STRING_30 + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_31 + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_31 + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, -16($fp) + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_28 + # GOTO label_FALSE_27 + j label_FALSE_27 + label_COMPARE_BY_VALUE_31: + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + lw $a0, -12($fp) + lw $a1, -16($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_28 + # GOTO label_FALSE_27 + j label_FALSE_27 + label_COMPARE_STRING_30: + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_CONTINUE_32 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_CONTINUE_32 + lw $t0, -8($fp) + beq $t0, 0, label_CONTINUE_32 + # GOTO label_FALSE_27 + j label_FALSE_27 + label_CONTINUE_32: + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_33: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_34 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_33 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_34: + # Store result + sw $a2, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_28 + label_FALSE_27: + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # GOTO label_END_29 +j label_END_29 +label_TRUE_28: # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # local_reflect_0_at_Complex_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - label_END_10: -# local_reflect_0_at_Complex_internal_5 = GETATTRIBUTE y Complex -# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) -lw $t1, 16($s1) -sw $t1, -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + label_END_29: # local_reflect_0_at_Complex_internal_7 = GETATTRIBUTE y Complex # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -lw $t1, 16($s1) -sw $t1, -32($fp) +lw $t0, 16($s1) +sw $t0, -32($fp) +# local_reflect_0_at_Complex_internal_9 = GETATTRIBUTE y Complex +# LOCAL local_reflect_0_at_Complex_internal_9 --> -40($fp) +lw $t0, 16($s1) +sw $t0, -40($fp) +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# LOCAL local_reflect_0_at_Complex_internal_9 --> -40($fp) +lw $t0, -40($fp) +lw $t0, 12($t0) +not $t0, $t0 +add $t0, $t0, 1 +sw $t0, -36($fp) +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +lw $t0, -36($fp) +sw $t0, 12($v0) +sw $v0, -36($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_7 GOTO label_FALSE_35 +# IF_ZERO local_reflect_0_at_Complex_internal_7 GOTO label_FALSE_35 +lw $t0, -32($fp) +beq $t0, 0, label_FALSE_35 +# IF_ZERO local_reflect_0_at_Complex_internal_8 GOTO label_FALSE_35 +# IF_ZERO local_reflect_0_at_Complex_internal_8 GOTO label_FALSE_35 +lw $t0, -36($fp) +beq $t0, 0, label_FALSE_35 # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -lw $t1, -32($fp) -not $t1, $t1 -sw $t1, -28($fp) -# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) -# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) +# Comparing -32($fp) type with String +la $v0, String +lw $a0, -32($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -28($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_STRING_38 +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_STRING_38 +lw $t0, -28($fp) +beq $t0, 0, label_COMPARE_STRING_38 # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) -# local_reflect_0_at_Complex_internal_4 = local_reflect_0_at_Complex_internal_5 - local_reflect_0_at_Complex_internal_6 -lw $t1, -24($fp) -lw $t2, -28($fp) -sub $t1, $t1, $t2 -sw $t1, -20($fp) -# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_11 -# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_11 -lw $t1, -20($fp) -beq $t1, 0, label_TRUE_11 -# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) -# local_reflect_0_at_Complex_internal_4 = 0 -li $t1, 0 -sw $t1, -20($fp) -# GOTO label_END_12 -j label_END_12 -label_TRUE_11: - # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) - # local_reflect_0_at_Complex_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) - label_END_12: +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +# Comparing -32($fp) type with Bool +la $v0, Bool +lw $a0, -32($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -28($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 +lw $t0, -28($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_39 +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +# Comparing -32($fp) type with Int +la $v0, Int +lw $a0, -32($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -28($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 +lw $t0, -28($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_39 +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) # LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) -# local_reflect_0_at_Complex_internal_8 = SELF -sw $s1, -36($fp) -# RETURN local_reflect_0_at_Complex_internal_8 -lw $v0, -36($fp) +# Load pointers and SUB +lw $a0, -32($fp) +lw $a1, -36($fp) +sub $a0, $a0, $a1 +sw $a0, -28($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 +lw $t0, -28($fp) +beq $t0, 0, label_TRUE_36 +# GOTO label_FALSE_35 +j label_FALSE_35 +label_COMPARE_BY_VALUE_39: + # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) + # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) + # LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) + lw $a0, -32($fp) + lw $a1, -36($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -28($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 + lw $t0, -28($fp) + beq $t0, 0, label_TRUE_36 + # GOTO label_FALSE_35 + j label_FALSE_35 + label_COMPARE_STRING_38: + # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) + # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) + # LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) + # Load strings for comparison + lw $v0, -32($fp) + lw $v1, -36($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -28($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_CONTINUE_40 + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_CONTINUE_40 + lw $t0, -28($fp) + beq $t0, 0, label_CONTINUE_40 + # GOTO label_FALSE_35 + j label_FALSE_35 + label_CONTINUE_40: + # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) + # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) + # LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -32($fp) + lw $v1, -36($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_41: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_42 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_41 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_42: + # Store result + sw $a2, -28($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 + lw $t0, -28($fp) + beq $t0, 0, label_TRUE_36 + label_FALSE_35: + # LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # GOTO label_END_37 +j label_END_37 +label_TRUE_36: + # LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -24($fp) + label_END_37: +# LOCAL local_reflect_0_at_Complex_internal_10 --> -44($fp) +# local_reflect_0_at_Complex_internal_10 = SELF +sw $s1, -44($fp) +# RETURN local_reflect_0_at_Complex_internal_10 +lw $v0, -44($fp) # Deallocate stack frame for function function_reflect_0_at_Complex. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 44 +addu $sp, $sp, 52 jr $ra # Function END @@ -1124,48 +2229,253 @@ function_reflect_X_at_Complex: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_reflect_X_at_Complex_internal_1 = GETATTRIBUTE y Complex - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - lw $t1, 16($s1) - sw $t1, -8($fp) - # local_reflect_X_at_Complex_internal_3 = GETATTRIBUTE y Complex - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - lw $t1, 16($s1) - sw $t1, -16($fp) + # local_reflect_X_at_Complex_internal_2 = GETATTRIBUTE y Complex # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + lw $t0, 16($s1) + sw $t0, -12($fp) + # local_reflect_X_at_Complex_internal_4 = GETATTRIBUTE y Complex + # LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - lw $t1, -16($fp) - not $t1, $t1 - sw $t1, -12($fp) - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) + lw $t0, -20($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -16($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -16($fp) + sw $t0, 12($v0) + sw $v0, -16($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_2 GOTO label_FALSE_43 + # IF_ZERO local_reflect_X_at_Complex_internal_2 GOTO label_FALSE_43 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_43 + # IF_ZERO local_reflect_X_at_Complex_internal_3 GOTO label_FALSE_43 + # IF_ZERO local_reflect_X_at_Complex_internal_3 GOTO label_FALSE_43 + lw $t0, -16($fp) + beq $t0, 0, label_FALSE_43 # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # local_reflect_X_at_Complex_internal_0 = local_reflect_X_at_Complex_internal_1 - local_reflect_X_at_Complex_internal_2 - lw $t1, -8($fp) - lw $t2, -12($fp) - sub $t1, $t1, $t2 - sw $t1, -4($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_13 - # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_13 - lw $t1, -4($fp) - beq $t1, 0, label_TRUE_13 - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # local_reflect_X_at_Complex_internal_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # GOTO label_END_14 -j label_END_14 -label_TRUE_13: + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_STRING_46 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_STRING_46 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_STRING_46 + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_47 + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_47 + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, -16($fp) + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_44 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_COMPARE_BY_VALUE_47: + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + lw $a0, -12($fp) + lw $a1, -16($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_44 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_COMPARE_STRING_46: + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_CONTINUE_48 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_CONTINUE_48 + lw $t0, -8($fp) + beq $t0, 0, label_CONTINUE_48 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_CONTINUE_48: + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_49: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_50 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_49 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_50: + # Store result + sw $a2, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_44 + label_FALSE_43: + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # GOTO label_END_45 +j label_END_45 +label_TRUE_44: # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # local_reflect_X_at_Complex_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - label_END_14: -# LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) -# local_reflect_X_at_Complex_internal_4 = SELF -sw $s1, -20($fp) -# RETURN local_reflect_X_at_Complex_internal_4 -lw $v0, -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + label_END_45: +# LOCAL local_reflect_X_at_Complex_internal_5 --> -24($fp) +# local_reflect_X_at_Complex_internal_5 = SELF +sw $s1, -24($fp) +# RETURN local_reflect_X_at_Complex_internal_5 +lw $v0, -24($fp) # Deallocate stack frame for function function_reflect_X_at_Complex. # Restore $ra lw $ra, 4($sp) @@ -1185,48 +2495,253 @@ function_reflect_Y_at_Complex: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_reflect_Y_at_Complex_internal_1 = GETATTRIBUTE x Complex - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - lw $t1, 12($s1) - sw $t1, -8($fp) - # local_reflect_Y_at_Complex_internal_3 = GETATTRIBUTE x Complex - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - lw $t1, 12($s1) - sw $t1, -16($fp) + # local_reflect_Y_at_Complex_internal_2 = GETATTRIBUTE x Complex # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # local_reflect_Y_at_Complex_internal_4 = GETATTRIBUTE x Complex + # LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) + lw $t0, 12($s1) + sw $t0, -20($fp) # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - lw $t1, -16($fp) - not $t1, $t1 - sw $t1, -12($fp) - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) + lw $t0, -20($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -16($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -16($fp) + sw $t0, 12($v0) + sw $v0, -16($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_2 GOTO label_FALSE_51 + # IF_ZERO local_reflect_Y_at_Complex_internal_2 GOTO label_FALSE_51 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_51 + # IF_ZERO local_reflect_Y_at_Complex_internal_3 GOTO label_FALSE_51 + # IF_ZERO local_reflect_Y_at_Complex_internal_3 GOTO label_FALSE_51 + lw $t0, -16($fp) + beq $t0, 0, label_FALSE_51 # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # local_reflect_Y_at_Complex_internal_0 = local_reflect_Y_at_Complex_internal_1 - local_reflect_Y_at_Complex_internal_2 - lw $t1, -8($fp) - lw $t2, -12($fp) - sub $t1, $t1, $t2 - sw $t1, -4($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_15 - # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_15 - lw $t1, -4($fp) - beq $t1, 0, label_TRUE_15 - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # local_reflect_Y_at_Complex_internal_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # GOTO label_END_16 -j label_END_16 -label_TRUE_15: + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_STRING_54 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_STRING_54 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_STRING_54 + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_55 + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_55 + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, -16($fp) + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_52 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_COMPARE_BY_VALUE_55: + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + lw $a0, -12($fp) + lw $a1, -16($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_52 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_COMPARE_STRING_54: + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_CONTINUE_56 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_CONTINUE_56 + lw $t0, -8($fp) + beq $t0, 0, label_CONTINUE_56 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_CONTINUE_56: + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_57: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_58 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_57 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_58: + # Store result + sw $a2, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_52 + label_FALSE_51: + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # GOTO label_END_53 +j label_END_53 +label_TRUE_52: # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # local_reflect_Y_at_Complex_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - label_END_16: -# LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) -# local_reflect_Y_at_Complex_internal_4 = SELF -sw $s1, -20($fp) -# RETURN local_reflect_Y_at_Complex_internal_4 -lw $v0, -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + label_END_53: +# LOCAL local_reflect_Y_at_Complex_internal_5 --> -24($fp) +# local_reflect_Y_at_Complex_internal_5 = SELF +sw $s1, -24($fp) +# RETURN local_reflect_Y_at_Complex_internal_5 +lw $v0, -24($fp) # Deallocate stack frame for function function_reflect_Y_at_Complex. # Restore $ra lw $ra, 4($sp) @@ -1242,10 +2757,10 @@ jr $ra # @Params: function_main_at_Main: # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 88 + subu $sp, $sp, 104 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 88 + addu $fp, $sp, 104 # LOCAL local_main_at_Main_c_0 --> -4($fp) # local_main_at_Main_c_0 = ALLOCATE Complex # Allocating 20 bytes of memory @@ -1253,53 +2768,53 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Complex - sw $t3, 12($v0) - li $t3, 7 - sw $t3, 16($v0) - move $t3, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Complex + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - sw $t3, 0($v0) - la $t3, Complex_start - sw $t3, 4($v0) + sw $t0, 0($v0) + la $t0, Complex_start + sw $t0, 4($v0) # Load type offset - li $t3, 16 - sw $t3, 8($v0) - move $t2, $v0 + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t2 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) jal __Complex__attrib__x__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t2) - # Push register t2 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) jal __Complex__attrib__y__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t2) + sw $v0, 16($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t2, -4($fp) + sw $t1, -4($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_3 = ALLOCATE Complex # Allocating 20 bytes of memory @@ -1307,84 +2822,148 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Complex - sw $t4, 12($v0) - li $t4, 7 - sw $t4, 16($v0) - move $t4, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Complex + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - sw $t4, 0($v0) - la $t4, Complex_start - sw $t4, 4($v0) + sw $t0, 0($v0) + la $t0, Complex_start + sw $t0, 4($v0) # Load type offset - li $t4, 16 - sw $t4, 8($v0) - move $t3, $v0 + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t3 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t1, 0($sp) jal __Complex__attrib__x__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t3) - # Push register t3 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t1, 0($sp) jal __Complex__attrib__y__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t3) + sw $v0, 16($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t3, -16($fp) + sw $t1, -16($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t3, -16($fp) - sw $t3, -8($fp) + lw $t0, -16($fp) + sw $t0, -8($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # ARG 1 - li $t3, 1 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -20($fp) + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t0, -20($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) - # ARG 1 - li $t3, 1 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -24($fp) + # ARG local_main_at_Main_internal_5 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t0, -24($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init # Save new self pointer in $s1 lw $s1, -8($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t0, 0($t0) # Get pointer to function address - lw $t5, 28($t4) + lw $t0, 28($t0) # Call function. Result is on $v0 - jalr $t5 + jalr $t0 sw $v0, -12($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1392,238 +2971,415 @@ function_main_at_Main: # LOCAL local_main_at_Main_c_0 --> -4($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_c_0 = local_main_at_Main_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) + lw $t0, -12($fp) + sw $t0, -4($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_internal_8 = local_main_at_Main_c_0 - lw $t3, -4($fp) - sw $t3, -36($fp) + # local_main_at_Main_internal_12 = local_main_at_Main_c_0 + lw $t0, -4($fp) + sw $t0, -52($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 reflect_X + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 reflect_X # Save new self pointer in $s1 - lw $s1, -36($fp) + lw $s1, -52($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t0, 0($t0) # Get pointer to function address - lw $t5, 40($t4) + lw $t0, 40($t0) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -40($fp) + jalr $t0 + sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_9 - lw $t3, -40($fp) - sw $t3, -28($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_internal_13 + lw $t0, -56($fp) + sw $t0, -44($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 reflect_Y + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 reflect_Y # Save new self pointer in $s1 - lw $s1, -28($fp) + lw $s1, -44($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t0, 0($t0) # Get pointer to function address - lw $t5, 44($t4) + lw $t0, 44($t0) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -32($fp) + jalr $t0 + sw $v0, -48($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_internal_10 = local_main_at_Main_c_0 - lw $t3, -4($fp) - sw $t3, -44($fp) + # local_main_at_Main_internal_14 = local_main_at_Main_c_0 + lw $t0, -4($fp) + sw $t0, -60($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 reflect_0 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 reflect_0 # Save new self pointer in $s1 - lw $s1, -44($fp) + lw $s1, -60($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t0, 0($t0) # Get pointer to function address - lw $t5, 36($t4) + lw $t0, 36($t0) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -48($fp) + jalr $t0 + sw $v0, -64($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # IF_ZERO local_main_at_Main_internal_11 GOTO label_FALSE_61 + # IF_ZERO local_main_at_Main_internal_11 GOTO label_FALSE_61 + lw $t0, -48($fp) + beq $t0, 0, label_FALSE_61 + # IF_ZERO local_main_at_Main_internal_15 GOTO label_FALSE_61 + # IF_ZERO local_main_at_Main_internal_15 GOTO label_FALSE_61 + lw $t0, -64($fp) + beq $t0, 0, label_FALSE_61 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_5 = local_main_at_Main_internal_7 - local_main_at_Main_internal_11 - lw $t3, -32($fp) - lw $t4, -48($fp) - sub $t3, $t3, $t4 - sw $t3, -24($fp) - # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_19 - # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_19 - lw $t3, -24($fp) - beq $t3, 0, label_TRUE_19 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = 0 - li $t3, 0 - sw $t3, -24($fp) - # GOTO label_END_20 -j label_END_20 -label_TRUE_19: - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = 1 - li $t3, 1 - sw $t3, -24($fp) - label_END_20: -# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_17 -# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_17 -lw $t3, -24($fp) -beq $t3, 0, label_FALSEIF_17 -# LOCAL local_main_at_Main_internal_14 --> -60($fp) -# local_main_at_Main_internal_14 = SELF -sw $s1, -60($fp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# LOCAL local_main_at_Main_internal_14 --> -60($fp) -# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 -lw $t3, -60($fp) -sw $t3, -52($fp) + # Comparing -48($fp) type with String + la $v0, String + lw $a0, -48($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_STRING_64 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_STRING_64 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_64 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Comparing -48($fp) type with Bool + la $v0, Bool + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_65 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_65 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_65 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Comparing -48($fp) type with Int + la $v0, Int + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_65 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_65 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_65 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # Load pointers and SUB + lw $a0, -48($fp) + lw $a1, -64($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_62 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_62 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_62 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_COMPARE_BY_VALUE_65: + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + lw $a0, -48($fp) + lw $a1, -64($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_62 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_62 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_62 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_COMPARE_STRING_64: + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -64($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_CONTINUE_66 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_CONTINUE_66 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_66 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_CONTINUE_66: + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -64($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_67: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_68 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_67 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_68: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_62 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_62 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_62 + label_FALSE_61: + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_63 +j label_END_63 +label_TRUE_62: + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_63: +# LOCAL local_main_at_Main_internal_6 --> -28($fp) +# LOCAL local_main_at_Main_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_main_at_Main_internal_6 GOTO label_FALSEIF_59 +# IF_ZERO local_main_at_Main_internal_6 GOTO label_FALSEIF_59 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_59 +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# local_main_at_Main_internal_18 = SELF +sw $s1, -76($fp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# local_main_at_Main_internal_16 = local_main_at_Main_internal_18 +lw $t0, -76($fp) +sw $t0, -68($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string -la $t3, String -sw $t3, 0($v0) -la $t3, String_start -sw $t3, 4($v0) +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) # Load type offset -li $t3, 8 -sw $t3, 8($v0) -la $t3, data_6 -sw $t3, 12($v0) -li $t3, 3 -sw $t3, 16($v0) -sw $v0, -64($fp) -# ARG local_main_at_Main_internal_15 -# LOCAL local_main_at_Main_internal_15 --> -64($fp) -lw $t3, -64($fp) +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_6 +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +sw $v0, -80($fp) +# ARG local_main_at_Main_internal_19 +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +lw $t0, -80($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +# local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string # Save new self pointer in $s1 -lw $s1, -52($fp) +lw $s1, -68($fp) # Get pointer to type -lw $t3, 4($s1) +lw $t0, 4($s1) # Get pointer to type's VTABLE -lw $t4, 0($t3) +lw $t0, 0($t0) # Get pointer to function address -lw $t5, 12($t4) +lw $t0, 12($t0) # Call function. Result is on $v0 -jalr $t5 -sw $v0, -56($fp) +jalr $t0 +sw $v0, -72($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_4 --> -20($fp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# local_main_at_Main_internal_4 = local_main_at_Main_internal_13 -lw $t3, -56($fp) -sw $t3, -20($fp) -# GOTO label_ENDIF_18 -j label_ENDIF_18 -label_FALSEIF_17: - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 - lw $t3, -76($fp) - sw $t3, -68($fp) +# LOCAL local_main_at_Main_internal_7 --> -32($fp) +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +# local_main_at_Main_internal_7 = local_main_at_Main_internal_17 +lw $t0, -72($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_60 +j label_ENDIF_60 +label_FALSEIF_59: + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # local_main_at_Main_internal_22 = SELF + sw $s1, -92($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # local_main_at_Main_internal_20 = local_main_at_Main_internal_22 + lw $t0, -92($fp) + sw $t0, -84($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_23 --> -96($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_7 - sw $t3, 12($v0) - li $t3, 3 - sw $t3, 16($v0) - sw $v0, -80($fp) - # ARG local_main_at_Main_internal_19 - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - lw $t3, -80($fp) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_7 + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + sw $v0, -96($fp) + # ARG local_main_at_Main_internal_23 + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + lw $t0, -96($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_21 = VCALL local_main_at_Main_internal_20 out_string # Save new self pointer in $s1 - lw $s1, -68($fp) + lw $s1, -84($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t0, 0($t0) # Get pointer to function address - lw $t5, 12($t4) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -72($fp) + jalr $t0 + sw $v0, -88($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_4 = local_main_at_Main_internal_17 - lw $t3, -72($fp) - sw $t3, -20($fp) - label_ENDIF_18: -# RETURN local_main_at_Main_internal_4 -lw $v0, -20($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_21 + lw $t0, -88($fp) + sw $t0, -32($fp) + label_ENDIF_60: +# RETURN local_main_at_Main_internal_7 +lw $v0, -32($fp) # Deallocate stack frame for function function_main_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 88 +addu $sp, $sp, 104 jr $ra # Function END diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips index 8662b01b..84998bfd 100644 --- a/tests/codegen/fib.mips +++ b/tests/codegen/fib.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:41 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:21 2020 # School of Math and Computer Science, University of Havana # @@ -13,6 +13,8 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END +Int: .asciiz "Int" +# Function END Main: .asciiz "Main" # Function END # @@ -74,6 +76,20 @@ Bool_end: # +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + # **** VTABLE for type Main **** Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main, function_fib_at_Main # Function END @@ -100,11 +116,12 @@ data_2: .asciiz "\n" # -IO__TDT: .word 0, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, 0 +IO__TDT: .word 0, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0 # @@ -194,7 +211,8 @@ function_out_int_at_IO: addu $fp, $sp, 32 # PRINT_INT param_out_int_at_IO_x_0 # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) li $v0, 1 syscall # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) @@ -260,6 +278,35 @@ function_in_int_at_IO: # local_in_int_at_IO_internal_0 = READ_INT li $v0, 5 syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) sw $v0, -4($fp) # RETURN local_in_int_at_IO_internal_0 lw $v0, -4($fp) @@ -357,7 +404,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -446,8 +493,10 @@ function_substr_at_String: # PARAM param_substr_at_String_r_1 --> 0($fp) lw $t0, 12($s1) lw $t2, 4($fp) + lw $t2, 12($t2) addu $t0, $t0, $t2 lw $a0, 0($fp) + lw $a0, 12($a0) move $t3, $a0 move $t1, $a0 addu $a0, $a0, 1 @@ -507,8 +556,40 @@ function_length_at_String: # LOCAL local_length_at_String_internal_0 --> -4($fp) lw $t0, 16($s1) sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function function_length_at_String. # Restore $ra lw $ra, 4($sp) @@ -535,28 +616,28 @@ entry: li $v0, 9 syscall # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) # Load type offset - li $t2, 16 - sw $t2, 8($v0) + li $t0, 20 + sw $t0, 8($v0) move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 @@ -574,11 +655,11 @@ entry: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type's VTABLE - la $t1, Main_vtable + la $t0, Main_vtable # Get pointer to function address - lw $t2, 28($t1) + lw $t1, 28($t0) # Call function. Result is on $v0 - jalr $t2 + jalr $t1 sw $v0, -8($fp) # RETURN 0 li $v0, 0 @@ -607,8 +688,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + lw $t0, -12($fp) + sw $t0, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -618,37 +699,37 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_4 - sw $t1, 12($v0) - li $t1, 38 - sw $t1, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 38 + sw $t0, 16($v0) sw $v0, -16($fp) # ARG local_main_at_Main_internal_3 # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t1, -16($fp) + lw $t0, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 12($t2) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t3 + jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -659,8 +740,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_4 --> -20($fp) # LOCAL local_main_at_Main_internal_6 --> -28($fp) # local_main_at_Main_internal_4 = local_main_at_Main_internal_6 - lw $t1, -28($fp) - sw $t1, -20($fp) + lw $t0, -28($fp) + sw $t0, -20($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -670,8 +751,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_7 --> -32($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t1, -40($fp) - sw $t1, -32($fp) + lw $t0, -40($fp) + sw $t0, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -681,8 +762,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_10 --> -44($fp) # LOCAL local_main_at_Main_internal_12 --> -52($fp) # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 - lw $t1, -52($fp) - sw $t1, -44($fp) + lw $t0, -52($fp) + sw $t0, -44($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -692,59 +773,59 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -44($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 24($t2) + lw $t0, 24($t0) # Call function. Result is on $v0 - jalr $t3 + jalr $t0 sw $v0, -48($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_main_at_Main_internal_11 # LOCAL local_main_at_Main_internal_11 --> -48($fp) - lw $t1, -48($fp) + lw $t0, -48($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 fib # Save new self pointer in $s1 lw $s1, -32($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 32($t2) + lw $t0, 32($t0) # Call function. Result is on $v0 - jalr $t3 + jalr $t0 sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_main_at_Main_internal_8 # LOCAL local_main_at_Main_internal_8 --> -36($fp) - lw $t1, -36($fp) + lw $t0, -36($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_4 --> -20($fp) # LOCAL local_main_at_Main_internal_5 --> -24($fp) # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 out_int # Save new self pointer in $s1 lw $s1, -20($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 16($t2) + lw $t0, 16($t0) # Call function. Result is on $v0 - jalr $t3 + jalr $t0 sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -755,8 +836,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_13 --> -56($fp) # LOCAL local_main_at_Main_internal_15 --> -64($fp) # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 - lw $t1, -64($fp) - sw $t1, -56($fp) + lw $t0, -64($fp) + sw $t0, -56($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -766,37 +847,37 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_5 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) sw $v0, -68($fp) # ARG local_main_at_Main_internal_16 # LOCAL local_main_at_Main_internal_16 --> -68($fp) - lw $t1, -68($fp) + lw $t0, -68($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_13 --> -56($fp) # LOCAL local_main_at_Main_internal_14 --> -60($fp) # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 out_string # Save new self pointer in $s1 lw $s1, -56($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 12($t2) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t3 + jalr $t0 sw $v0, -60($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -819,111 +900,663 @@ function_main_at_Main: # 0($fp) = param_fib_at_Main_i_0 function_fib_at_Main: # Allocate stack frame for function function_fib_at_Main. - subu $sp, $sp, 36 + subu $sp, $sp, 64 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 36 + addu $fp, $sp, 64 # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # local_fib_at_Main_a_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - # LOCAL local_fib_at_Main_b_1 --> -8($fp) - # local_fib_at_Main_b_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # LOCAL local_fib_at_Main_c_2 --> -12($fp) - # local_fib_at_Main_c_2 = 0 - li $t1, 0 - sw $t1, -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_fib_at_Main_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # LOCAL local_fib_at_Main_internal_1 --> -8($fp) + # local_fib_at_Main_a_0 = local_fib_at_Main_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_fib_at_Main_b_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -16($fp) + # LOCAL local_fib_at_Main_b_2 --> -12($fp) + # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # local_fib_at_Main_b_2 = local_fib_at_Main_internal_3 + lw $t0, -16($fp) + sw $t0, -12($fp) + # LOCAL local_fib_at_Main_c_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # LOCAL local_fib_at_Main_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # LOCAL local_fib_at_Main_c_4 --> -20($fp) + # LOCAL local_fib_at_Main_internal_5 --> -24($fp) + # local_fib_at_Main_c_4 = local_fib_at_Main_internal_5 + lw $t0, -24($fp) + sw $t0, -20($fp) label_WHILE_1: - # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # LOCAL local_fib_at_Main_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -40($fp) + # IF_ZERO param_fib_at_Main_i_0 GOTO label_FALSE_3 + # IF_ZERO param_fib_at_Main_i_0 GOTO label_FALSE_3 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_3 + # IF_ZERO local_fib_at_Main_internal_9 GOTO label_FALSE_3 + # IF_ZERO local_fib_at_Main_internal_9 GOTO label_FALSE_3 + lw $t0, -40($fp) + beq $t0, 0, label_FALSE_3 + # LOCAL local_fib_at_Main_internal_8 --> -36($fp) # PARAM param_fib_at_Main_i_0 --> 0($fp) - # local_fib_at_Main_internal_3 = PARAM param_fib_at_Main_i_0 - 0 - lw $t1, 0($fp) - sub $t1, $t1, 0 - sw $t1, -16($fp) - # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 - # IF_ZERO local_fib_at_Main_internal_3 GOTO label_TRUE_3 - lw $t1, -16($fp) - beq $t1, 0, label_TRUE_3 - # LOCAL local_fib_at_Main_internal_3 --> -16($fp) - # local_fib_at_Main_internal_3 = 0 - li $t1, 0 - sw $t1, -16($fp) - # GOTO label_END_4 -j label_END_4 -label_TRUE_3: - # LOCAL local_fib_at_Main_internal_3 --> -16($fp) - # local_fib_at_Main_internal_3 = 1 - li $t1, 1 - sw $t1, -16($fp) - label_END_4: -# IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 -# IF_ZERO local_fib_at_Main_internal_3 GOTO label_FALSE_5 -lw $t1, -16($fp) -beq $t1, 0, label_FALSE_5 -# LOCAL local_fib_at_Main_internal_4 --> -20($fp) -# local_fib_at_Main_internal_4 = 0 -li $t1, 0 -sw $t1, -20($fp) -# GOTO label_NOT_END_6 -j label_NOT_END_6 -label_FALSE_5: - # LOCAL local_fib_at_Main_internal_4 --> -20($fp) - # local_fib_at_Main_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) - label_NOT_END_6: - # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 - # IF_ZERO local_fib_at_Main_internal_4 GOTO label_WHILE_END_2 - lw $t1, -20($fp) - beq $t1, 0, label_WHILE_END_2 - # LOCAL local_fib_at_Main_internal_5 --> -24($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -36($fp) + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_COMPARE_STRING_6 + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_COMPARE_STRING_6 + lw $t0, -36($fp) + beq $t0, 0, label_COMPARE_STRING_6 + # LOCAL local_fib_at_Main_internal_8 --> -36($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -36($fp) + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_COMPARE_BY_VALUE_7 + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_COMPARE_BY_VALUE_7 + lw $t0, -36($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_7 + # LOCAL local_fib_at_Main_internal_8 --> -36($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -36($fp) + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_COMPARE_BY_VALUE_7 + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_COMPARE_BY_VALUE_7 + lw $t0, -36($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_7 + # LOCAL local_fib_at_Main_internal_8 --> -36($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # LOCAL local_fib_at_Main_internal_9 --> -40($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -40($fp) + sub $a0, $a0, $a1 + sw $a0, -36($fp) + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_TRUE_4 + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_TRUE_4 + lw $t0, -36($fp) + beq $t0, 0, label_TRUE_4 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_COMPARE_BY_VALUE_7: + # LOCAL local_fib_at_Main_internal_8 --> -36($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # LOCAL local_fib_at_Main_internal_9 --> -40($fp) + lw $a0, 0($fp) + lw $a1, -40($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -36($fp) + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_TRUE_4 + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_TRUE_4 + lw $t0, -36($fp) + beq $t0, 0, label_TRUE_4 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_COMPARE_STRING_6: + # LOCAL local_fib_at_Main_internal_8 --> -36($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # LOCAL local_fib_at_Main_internal_9 --> -40($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -40($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -36($fp) + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_CONTINUE_8 + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_CONTINUE_8 + lw $t0, -36($fp) + beq $t0, 0, label_CONTINUE_8 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_CONTINUE_8: + # LOCAL local_fib_at_Main_internal_8 --> -36($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # LOCAL local_fib_at_Main_internal_9 --> -40($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -40($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_9: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_10 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_9 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_10: + # Store result + sw $a2, -36($fp) + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_TRUE_4 + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_TRUE_4 + lw $t0, -36($fp) + beq $t0, 0, label_TRUE_4 + label_FALSE_3: + # LOCAL local_fib_at_Main_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -32($fp) + # GOTO label_END_5 +j label_END_5 +label_TRUE_4: + # LOCAL local_fib_at_Main_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -32($fp) + label_END_5: +# LOCAL local_fib_at_Main_internal_7 --> -32($fp) +# LOCAL local_fib_at_Main_internal_7 --> -32($fp) +# Obtain value from -32($fp) +lw $v0, -32($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_fib_at_Main_internal_7 GOTO label_FALSE_11 +# IF_ZERO local_fib_at_Main_internal_7 GOTO label_FALSE_11 +lw $t0, -32($fp) +beq $t0, 0, label_FALSE_11 +# LOCAL local_fib_at_Main_internal_10 --> -44($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -44($fp) +# GOTO label_NOT_END_12 +j label_NOT_END_12 +label_FALSE_11: + # LOCAL local_fib_at_Main_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + label_NOT_END_12: + # LOCAL local_fib_at_Main_internal_6 --> -28($fp) + # LOCAL local_fib_at_Main_internal_10 --> -44($fp) + # Obtain value from -44($fp) + lw $v0, -44($fp) + lw $v0, 12($v0) + sw $v0, -28($fp) + # IF_ZERO local_fib_at_Main_internal_6 GOTO label_WHILE_END_2 + # IF_ZERO local_fib_at_Main_internal_6 GOTO label_WHILE_END_2 + lw $t0, -28($fp) + beq $t0, 0, label_WHILE_END_2 + # LOCAL local_fib_at_Main_internal_11 --> -48($fp) # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # LOCAL local_fib_at_Main_b_1 --> -8($fp) - # local_fib_at_Main_internal_5 = local_fib_at_Main_a_0 + local_fib_at_Main_b_1 + # LOCAL local_fib_at_Main_b_2 --> -12($fp) + # local_fib_at_Main_internal_11 = local_fib_at_Main_a_0 + local_fib_at_Main_b_2 lw $t1, -4($fp) - lw $t2, -8($fp) - add $t1, $t1, $t2 - sw $t1, -24($fp) - # LOCAL local_fib_at_Main_c_2 --> -12($fp) - # LOCAL local_fib_at_Main_internal_5 --> -24($fp) - # local_fib_at_Main_c_2 = local_fib_at_Main_internal_5 - lw $t1, -24($fp) - sw $t1, -12($fp) - # LOCAL local_fib_at_Main_internal_6 --> -28($fp) + lw $t0, 12($t1) + lw $t1, -12($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -48($fp) + # LOCAL local_fib_at_Main_c_4 --> -20($fp) + # LOCAL local_fib_at_Main_internal_11 --> -48($fp) + # local_fib_at_Main_c_4 = local_fib_at_Main_internal_11 + lw $t0, -48($fp) + sw $t0, -20($fp) + # LOCAL local_fib_at_Main_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -56($fp) + # LOCAL local_fib_at_Main_internal_12 --> -52($fp) # PARAM param_fib_at_Main_i_0 --> 0($fp) - # local_fib_at_Main_internal_6 = PARAM param_fib_at_Main_i_0 - 1 + # LOCAL local_fib_at_Main_internal_13 --> -56($fp) + # local_fib_at_Main_internal_12 = PARAM param_fib_at_Main_i_0 - local_fib_at_Main_internal_13 lw $t1, 0($fp) - sub $t1, $t1, 1 - sw $t1, -28($fp) + lw $t0, 12($t1) + lw $t1, -56($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -52($fp) # PARAM param_fib_at_Main_i_0 --> 0($fp) - # LOCAL local_fib_at_Main_internal_6 --> -28($fp) - # PARAM param_fib_at_Main_i_0 = local_fib_at_Main_internal_6 - lw $t1, -28($fp) - sw $t1, 0($fp) - # LOCAL local_fib_at_Main_b_1 --> -8($fp) + # LOCAL local_fib_at_Main_internal_12 --> -52($fp) + # PARAM param_fib_at_Main_i_0 = local_fib_at_Main_internal_12 + lw $t0, -52($fp) + sw $t0, 0($fp) + # LOCAL local_fib_at_Main_b_2 --> -12($fp) # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # local_fib_at_Main_b_1 = local_fib_at_Main_a_0 - lw $t1, -4($fp) - sw $t1, -8($fp) + # local_fib_at_Main_b_2 = local_fib_at_Main_a_0 + lw $t0, -4($fp) + sw $t0, -12($fp) # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # LOCAL local_fib_at_Main_c_2 --> -12($fp) - # local_fib_at_Main_a_0 = local_fib_at_Main_c_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + # LOCAL local_fib_at_Main_c_4 --> -20($fp) + # local_fib_at_Main_a_0 = local_fib_at_Main_c_4 + lw $t0, -20($fp) + sw $t0, -4($fp) # GOTO label_WHILE_1 j label_WHILE_1 label_WHILE_END_2: - # RETURN local_fib_at_Main_c_2 - lw $v0, -12($fp) + # RETURN local_fib_at_Main_c_4 + lw $v0, -20($fp) # Deallocate stack frame for function function_fib_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 36 + addu $sp, $sp, 64 # Deallocate function args addu $sp, $sp, 4 jr $ra diff --git a/tests/codegen/graph.mips b/tests/codegen/graph.mips new file mode 100644 index 00000000..7f3ffb82 --- /dev/null +++ b/tests/codegen/graph.mips @@ -0,0 +1,11849 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:22 2020 +# School of Math and Computer Science, University of Havana +# + +.data +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +BoolOp: .asciiz "BoolOp" +# Function END +Graph: .asciiz "Graph" +# Function END +Parse: .asciiz "Parse" +# Function END +Main: .asciiz "Main" +# Function END +VList: .asciiz "VList" +# Function END +VCons: .asciiz "VCons" +# Function END +EList: .asciiz "EList" +# Function END +ECons: .asciiz "ECons" +# Function END +Edge: .asciiz "Edge" +# Function END +Vertice: .asciiz "Vertice" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type BoolOp **** +BoolOp_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_and_at_BoolOp, function_or_at_BoolOp +# Function END +# + + +# **** Type RECORD for type BoolOp **** +BoolOp_start: + BoolOp_vtable_pointer: .word BoolOp_vtable + # Function END +BoolOp_end: +# + + +# **** VTABLE for type Graph **** +Graph_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_add_vertice_at_Graph, function_print_E_at_Graph, function_print_V_at_Graph +# Function END +# + + +# **** Type RECORD for type Graph **** +Graph_start: + Graph_vtable_pointer: .word Graph_vtable + # Function END +Graph_end: +# + + +# **** VTABLE for type Parse **** +Parse_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_read_input_at_Parse, function_parse_line_at_Parse, function_c2i_at_Parse, function_a2i_at_Parse, function_a2i_aux_at_Parse +# Function END +# + + +# **** Type RECORD for type Parse **** +Parse_start: + Parse_vtable_pointer: .word Parse_vtable + # Function END +Parse_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_read_input_at_Parse, function_parse_line_at_Parse, function_c2i_at_Parse, function_a2i_at_Parse, function_a2i_aux_at_Parse, function_main_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +# **** VTABLE for type VList **** +VList_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_VList, function_head_at_VList, function_tail_at_VList, function_cons_at_VList, function_print_at_VList +# Function END +# + + +# **** Type RECORD for type VList **** +VList_start: + VList_vtable_pointer: .word VList_vtable + # Function END +VList_end: +# + + +# **** VTABLE for type VCons **** +VCons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_VCons, function_head_at_VCons, function_tail_at_VCons, function_cons_at_VList, function_print_at_VCons, function_init_at_VCons +# Function END +# + + +# **** Type RECORD for type VCons **** +VCons_start: + VCons_vtable_pointer: .word VCons_vtable + # Function END +VCons_end: +# + + +# **** VTABLE for type EList **** +EList_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_EList, function_head_at_EList, function_tail_at_EList, function_cons_at_EList, function_append_at_EList, function_print_at_EList +# Function END +# + + +# **** Type RECORD for type EList **** +EList_start: + EList_vtable_pointer: .word EList_vtable + # Function END +EList_end: +# + + +# **** VTABLE for type ECons **** +ECons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_ECons, function_head_at_ECons, function_tail_at_ECons, function_cons_at_EList, function_append_at_EList, function_print_at_ECons, function_init_at_ECons +# Function END +# + + +# **** Type RECORD for type ECons **** +ECons_start: + ECons_vtable_pointer: .word ECons_vtable + # Function END +ECons_end: +# + + +# **** VTABLE for type Edge **** +Edge_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Edge, function_print_at_Edge +# Function END +# + + +# **** Type RECORD for type Edge **** +Edge_start: + Edge_vtable_pointer: .word Edge_vtable + # Function END +Edge_end: +# + + +# **** VTABLE for type Vertice **** +Vertice_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_outgoing_at_Vertice, function_number_at_Vertice, function_init_at_Vertice, function_add_out_at_Vertice, function_print_at_Vertice +# Function END +# + + +# **** Type RECORD for type Vertice **** +Vertice_start: + Vertice_vtable_pointer: .word Vertice_vtable + # Function END +Vertice_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, -1, -1, 1, 2, 1, 2, 1, 2, 1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 1, 1, 2, 3, 2, 3, 2, 3, 2, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 +BoolOp__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1 +Graph__TDT: .word -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1 +Parse__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, -1, -1, -1, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 +VList__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, -1, -1 +VCons__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1 +EList__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1 +ECons__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 +Edge__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1 +Vertice__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "\n" +# + + +data_5: .asciiz "" +# + + +data_6: .asciiz "0" +# + + +data_7: .asciiz "1" +# + + +data_8: .asciiz "2" +# + + +data_9: .asciiz "3" +# + + +data_10: .asciiz "4" +# + + +data_11: .asciiz "5" +# + + +data_12: .asciiz "6" +# + + +data_13: .asciiz "7" +# + + +data_14: .asciiz "8" +# + + +data_15: .asciiz "9" +# + + +data_16: .asciiz "-" +# + + +data_17: .asciiz " " +# + + +data_18: .asciiz " " +# + + +data_19: .asciiz "," +# + + +data_20: .asciiz "" +# + + +data_21: .asciiz "" +# + + +data_22: .asciiz "\n" +# + + +data_23: .asciiz "\n" +# + + +data_24: .asciiz " (" +# + + +data_25: .asciiz "," +# + + +data_26: .asciiz ")" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 24 bytes of memory + li $a0, 24 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Parse__attrib__boolop__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Parse__attrib__rest__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__g__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 48($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_and_at_BoolOp implementation. +# @Params: +# 0($fp) = param_and_at_BoolOp_b1_0 +# 4($fp) = param_and_at_BoolOp_b2_1 +function_and_at_BoolOp: + # Allocate stack frame for function function_and_at_BoolOp. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_and_at_BoolOp_internal_0 --> -4($fp) + # PARAM param_and_at_BoolOp_b1_0 --> 4($fp) + # Obtain value from 4($fp) + lw $v0, 4($fp) + lw $v0, 12($v0) + sw $v0, -4($fp) + # IF_ZERO local_and_at_BoolOp_internal_0 GOTO label_FALSEIF_1 + # IF_ZERO local_and_at_BoolOp_internal_0 GOTO label_FALSEIF_1 + lw $t0, -4($fp) + beq $t0, 0, label_FALSEIF_1 + # LOCAL local_and_at_BoolOp_internal_1 --> -8($fp) + # PARAM param_and_at_BoolOp_b2_1 --> 0($fp) + # local_and_at_BoolOp_internal_1 = PARAM param_and_at_BoolOp_b2_1 + lw $t0, 0($fp) + sw $t0, -8($fp) + # GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_and_at_BoolOp_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_and_at_BoolOp_internal_1 --> -8($fp) + # LOCAL local_and_at_BoolOp_internal_2 --> -12($fp) + # local_and_at_BoolOp_internal_1 = local_and_at_BoolOp_internal_2 + lw $t0, -12($fp) + sw $t0, -8($fp) + label_ENDIF_2: +# RETURN local_and_at_BoolOp_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_and_at_BoolOp. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +# Deallocate function args +addu $sp, $sp, 8 +jr $ra +# Function END + + +# function_or_at_BoolOp implementation. +# @Params: +# 0($fp) = param_or_at_BoolOp_b1_0 +# 4($fp) = param_or_at_BoolOp_b2_1 +function_or_at_BoolOp: + # Allocate stack frame for function function_or_at_BoolOp. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_or_at_BoolOp_internal_0 --> -4($fp) + # PARAM param_or_at_BoolOp_b1_0 --> 4($fp) + # Obtain value from 4($fp) + lw $v0, 4($fp) + lw $v0, 12($v0) + sw $v0, -4($fp) + # IF_ZERO local_or_at_BoolOp_internal_0 GOTO label_FALSEIF_3 + # IF_ZERO local_or_at_BoolOp_internal_0 GOTO label_FALSEIF_3 + lw $t0, -4($fp) + beq $t0, 0, label_FALSEIF_3 + # LOCAL local_or_at_BoolOp_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_or_at_BoolOp_internal_1 --> -8($fp) + # LOCAL local_or_at_BoolOp_internal_2 --> -12($fp) + # local_or_at_BoolOp_internal_1 = local_or_at_BoolOp_internal_2 + lw $t0, -12($fp) + sw $t0, -8($fp) + # GOTO label_ENDIF_4 +j label_ENDIF_4 +label_FALSEIF_3: + # LOCAL local_or_at_BoolOp_internal_1 --> -8($fp) + # PARAM param_or_at_BoolOp_b2_1 --> 0($fp) + # local_or_at_BoolOp_internal_1 = PARAM param_or_at_BoolOp_b2_1 + lw $t0, 0($fp) + sw $t0, -8($fp) + label_ENDIF_4: +# RETURN local_or_at_BoolOp_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_or_at_BoolOp. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +# Deallocate function args +addu $sp, $sp, 8 +jr $ra +# Function END + + +# __Graph__attrib__vertices__init implementation. +# @Params: +__Graph__attrib__vertices__init: + # Allocate stack frame for function __Graph__attrib__vertices__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_attrib__vertices__init_internal_1 --> -8($fp) + # local_attrib__vertices__init_internal_1 = ALLOCATE VList + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, VList + sw $t0, 12($v0) + li $t0, 5 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, VList_start + sw $t0, 4($v0) + # Load type offset + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __VList__attrib__car__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # RETURN local_attrib__vertices__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Graph__attrib__vertices__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Graph__attrib__edges__init implementation. +# @Params: +__Graph__attrib__edges__init: + # Allocate stack frame for function __Graph__attrib__edges__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_attrib__edges__init_internal_1 --> -8($fp) + # local_attrib__edges__init_internal_1 = ALLOCATE EList + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, EList + sw $t0, 12($v0) + li $t0, 5 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, EList_start + sw $t0, 4($v0) + # Load type offset + li $t0, 44 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __EList__attrib__car__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # RETURN local_attrib__edges__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Graph__attrib__edges__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_add_vertice_at_Graph implementation. +# @Params: +# 0($fp) = param_add_vertice_at_Graph_v_0 +function_add_vertice_at_Graph: + # Allocate stack frame for function function_add_vertice_at_Graph. + subu $sp, $sp, 40 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 40 + # LOCAL local_add_vertice_at_Graph_internal_2 --> -12($fp) + # PARAM param_add_vertice_at_Graph_v_0 --> 0($fp) + # local_add_vertice_at_Graph_internal_2 = PARAM param_add_vertice_at_Graph_v_0 + lw $t0, 0($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_add_vertice_at_Graph_internal_2 --> -12($fp) + # LOCAL local_add_vertice_at_Graph_internal_3 --> -16($fp) + # local_add_vertice_at_Graph_internal_3 = VCALL local_add_vertice_at_Graph_internal_2 outgoing + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_add_vertice_at_Graph_internal_0 --> -4($fp) + # LOCAL local_add_vertice_at_Graph_internal_3 --> -16($fp) + # local_add_vertice_at_Graph_internal_0 = local_add_vertice_at_Graph_internal_3 + lw $t0, -16($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_add_vertice_at_Graph_internal_4 = GETATTRIBUTE edges Graph + # LOCAL local_add_vertice_at_Graph_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # ARG local_add_vertice_at_Graph_internal_4 + # LOCAL local_add_vertice_at_Graph_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_add_vertice_at_Graph_internal_0 --> -4($fp) + # LOCAL local_add_vertice_at_Graph_internal_1 --> -8($fp) + # local_add_vertice_at_Graph_internal_1 = VCALL local_add_vertice_at_Graph_internal_0 append + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_add_vertice_at_Graph_internal_1 --> -8($fp) + lw $t0, -8($fp) + sw $t0, 16($s1) + # local_add_vertice_at_Graph_internal_7 = GETATTRIBUTE vertices Graph + # LOCAL local_add_vertice_at_Graph_internal_7 --> -32($fp) + lw $t0, 12($s1) + sw $t0, -32($fp) + # LOCAL local_add_vertice_at_Graph_internal_5 --> -24($fp) + # LOCAL local_add_vertice_at_Graph_internal_7 --> -32($fp) + # local_add_vertice_at_Graph_internal_5 = local_add_vertice_at_Graph_internal_7 + lw $t0, -32($fp) + sw $t0, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_add_vertice_at_Graph_v_0 + # PARAM param_add_vertice_at_Graph_v_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_add_vertice_at_Graph_internal_5 --> -24($fp) + # LOCAL local_add_vertice_at_Graph_internal_6 --> -28($fp) + # local_add_vertice_at_Graph_internal_6 = VCALL local_add_vertice_at_Graph_internal_5 cons + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_add_vertice_at_Graph_internal_6 --> -28($fp) + lw $t0, -28($fp) + sw $t0, 12($s1) + # RETURN + # Deallocate stack frame for function function_add_vertice_at_Graph. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 40 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_E_at_Graph implementation. +# @Params: +function_print_E_at_Graph: + # Allocate stack frame for function function_print_E_at_Graph. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_print_E_at_Graph_internal_2 = GETATTRIBUTE edges Graph + # LOCAL local_print_E_at_Graph_internal_2 --> -12($fp) + lw $t0, 16($s1) + sw $t0, -12($fp) + # LOCAL local_print_E_at_Graph_internal_0 --> -4($fp) + # LOCAL local_print_E_at_Graph_internal_2 --> -12($fp) + # local_print_E_at_Graph_internal_0 = local_print_E_at_Graph_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_E_at_Graph_internal_0 --> -4($fp) + # LOCAL local_print_E_at_Graph_internal_1 --> -8($fp) + # local_print_E_at_Graph_internal_1 = VCALL local_print_E_at_Graph_internal_0 print + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_E_at_Graph_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_print_E_at_Graph. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_V_at_Graph implementation. +# @Params: +function_print_V_at_Graph: + # Allocate stack frame for function function_print_V_at_Graph. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_print_V_at_Graph_internal_2 = GETATTRIBUTE vertices Graph + # LOCAL local_print_V_at_Graph_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # LOCAL local_print_V_at_Graph_internal_0 --> -4($fp) + # LOCAL local_print_V_at_Graph_internal_2 --> -12($fp) + # local_print_V_at_Graph_internal_0 = local_print_V_at_Graph_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_V_at_Graph_internal_0 --> -4($fp) + # LOCAL local_print_V_at_Graph_internal_1 --> -8($fp) + # local_print_V_at_Graph_internal_1 = VCALL local_print_V_at_Graph_internal_0 print + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_V_at_Graph_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_print_V_at_Graph. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Parse__attrib__boolop__init implementation. +# @Params: +__Parse__attrib__boolop__init: + # Allocate stack frame for function __Parse__attrib__boolop__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_attrib__boolop__init_internal_1 --> -8($fp) + # local_attrib__boolop__init_internal_1 = ALLOCATE BoolOp + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, BoolOp + sw $t0, 12($v0) + li $t0, 6 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, BoolOp_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # RETURN local_attrib__boolop__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Parse__attrib__boolop__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Parse__attrib__rest__init implementation. +# @Params: +__Parse__attrib__rest__init: + # Allocate stack frame for function __Parse__attrib__rest__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_attrib__rest__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -4($fp) + # RETURN local_attrib__rest__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Parse__attrib__rest__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_read_input_at_Parse implementation. +# @Params: +function_read_input_at_Parse: + # Allocate stack frame for function function_read_input_at_Parse. + subu $sp, $sp, 112 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 112 + # LOCAL local_read_input_at_Parse_g_0 --> -4($fp) + # local_read_input_at_Parse_g_0 = ALLOCATE Graph + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Graph + sw $t0, 12($v0) + li $t0, 5 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Graph_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Graph__attrib__vertices__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Graph__attrib__edges__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local_read_input_at_Parse_internal_1 --> -8($fp) + # local_read_input_at_Parse_internal_1 = ALLOCATE Graph + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Graph + sw $t0, 12($v0) + li $t0, 5 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Graph_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Graph__attrib__vertices__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Graph__attrib__edges__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # LOCAL local_read_input_at_Parse_g_0 --> -4($fp) + # LOCAL local_read_input_at_Parse_internal_1 --> -8($fp) + # local_read_input_at_Parse_g_0 = local_read_input_at_Parse_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -12($fp) + # LOCAL local_read_input_at_Parse_internal_5 --> -24($fp) + # local_read_input_at_Parse_internal_5 = SELF + sw $s1, -24($fp) + # LOCAL local_read_input_at_Parse_internal_3 --> -16($fp) + # LOCAL local_read_input_at_Parse_internal_5 --> -24($fp) + # local_read_input_at_Parse_internal_3 = local_read_input_at_Parse_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_read_input_at_Parse_internal_3 --> -16($fp) + # LOCAL local_read_input_at_Parse_internal_4 --> -20($fp) + # local_read_input_at_Parse_internal_4 = VCALL local_read_input_at_Parse_internal_3 in_string + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_4 --> -20($fp) + # local_read_input_at_Parse_line_2 = local_read_input_at_Parse_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + label_WHILE_5: + # local_read_input_at_Parse_internal_9 = GETATTRIBUTE boolop Parse + # LOCAL local_read_input_at_Parse_internal_9 --> -40($fp) + lw $t0, 12($s1) + sw $t0, -40($fp) + # LOCAL local_read_input_at_Parse_internal_7 --> -32($fp) + # LOCAL local_read_input_at_Parse_internal_9 --> -40($fp) + # local_read_input_at_Parse_internal_7 = local_read_input_at_Parse_internal_9 + lw $t0, -40($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -52($fp) + # IF_ZERO local_read_input_at_Parse_line_2 GOTO label_FALSE_7 + # IF_ZERO local_read_input_at_Parse_line_2 GOTO label_FALSE_7 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_7 + # IF_ZERO local_read_input_at_Parse_internal_12 GOTO label_FALSE_7 + # IF_ZERO local_read_input_at_Parse_internal_12 GOTO label_FALSE_7 + lw $t0, -52($fp) + beq $t0, 0, label_FALSE_7 + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_STRING_10 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_STRING_10 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_STRING_10 + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_11 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_11 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_11 + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_11 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_11 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_11 + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, -52($fp) + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_8 + # GOTO label_FALSE_7 + j label_FALSE_7 + label_COMPARE_BY_VALUE_11: + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) + lw $a0, -12($fp) + lw $a1, -52($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_8 + # GOTO label_FALSE_7 + j label_FALSE_7 + label_COMPARE_STRING_10: + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -52($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_CONTINUE_12 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_CONTINUE_12 + lw $t0, -48($fp) + beq $t0, 0, label_CONTINUE_12 + # GOTO label_FALSE_7 + j label_FALSE_7 + label_CONTINUE_12: + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -52($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_13: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_14 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_13 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_14: + # Store result + sw $a2, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_8 + label_FALSE_7: + # LOCAL local_read_input_at_Parse_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -44($fp) + # GOTO label_END_9 +j label_END_9 +label_TRUE_8: + # LOCAL local_read_input_at_Parse_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + label_END_9: +# LOCAL local_read_input_at_Parse_internal_10 --> -44($fp) +# LOCAL local_read_input_at_Parse_internal_10 --> -44($fp) +# Obtain value from -44($fp) +lw $v0, -44($fp) +lw $v0, 12($v0) +sw $v0, -44($fp) +# IF_ZERO local_read_input_at_Parse_internal_10 GOTO label_FALSE_15 +# IF_ZERO local_read_input_at_Parse_internal_10 GOTO label_FALSE_15 +lw $t0, -44($fp) +beq $t0, 0, label_FALSE_15 +# LOCAL local_read_input_at_Parse_internal_13 --> -56($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -56($fp) +# GOTO label_NOT_END_16 +j label_NOT_END_16 +label_FALSE_15: + # LOCAL local_read_input_at_Parse_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -56($fp) + label_NOT_END_16: + # ARG local_read_input_at_Parse_internal_13 + # LOCAL local_read_input_at_Parse_internal_13 --> -56($fp) + lw $t0, -56($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -68($fp) + # IF_ZERO local_read_input_at_Parse_line_2 GOTO label_FALSE_17 + # IF_ZERO local_read_input_at_Parse_line_2 GOTO label_FALSE_17 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_17 + # IF_ZERO local_read_input_at_Parse_internal_16 GOTO label_FALSE_17 + # IF_ZERO local_read_input_at_Parse_internal_16 GOTO label_FALSE_17 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_17 + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_STRING_20 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_STRING_20 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_STRING_20 + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_21 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_21 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_21 + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_21 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_21 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_21 + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_18 + # GOTO label_FALSE_17 + j label_FALSE_17 + label_COMPARE_BY_VALUE_21: + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) + lw $a0, -12($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_18 + # GOTO label_FALSE_17 + j label_FALSE_17 + label_COMPARE_STRING_20: + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_CONTINUE_22 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_CONTINUE_22 + lw $t0, -64($fp) + beq $t0, 0, label_CONTINUE_22 + # GOTO label_FALSE_17 + j label_FALSE_17 + label_CONTINUE_22: + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_23: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_24 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_23 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_24: + # Store result + sw $a2, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_18 + label_FALSE_17: + # LOCAL local_read_input_at_Parse_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # GOTO label_END_19 +j label_END_19 +label_TRUE_18: + # LOCAL local_read_input_at_Parse_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + label_END_19: +# LOCAL local_read_input_at_Parse_internal_14 --> -60($fp) +# LOCAL local_read_input_at_Parse_internal_14 --> -60($fp) +# Obtain value from -60($fp) +lw $v0, -60($fp) +lw $v0, 12($v0) +sw $v0, -60($fp) +# IF_ZERO local_read_input_at_Parse_internal_14 GOTO label_FALSE_25 +# IF_ZERO local_read_input_at_Parse_internal_14 GOTO label_FALSE_25 +lw $t0, -60($fp) +beq $t0, 0, label_FALSE_25 +# LOCAL local_read_input_at_Parse_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -72($fp) +# GOTO label_NOT_END_26 +j label_NOT_END_26 +label_FALSE_25: + # LOCAL local_read_input_at_Parse_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -72($fp) + label_NOT_END_26: + # ARG local_read_input_at_Parse_internal_17 + # LOCAL local_read_input_at_Parse_internal_17 --> -72($fp) + lw $t0, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_read_input_at_Parse_internal_7 --> -32($fp) + # LOCAL local_read_input_at_Parse_internal_8 --> -36($fp) + # local_read_input_at_Parse_internal_8 = VCALL local_read_input_at_Parse_internal_7 and + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_read_input_at_Parse_internal_6 --> -28($fp) + # LOCAL local_read_input_at_Parse_internal_8 --> -36($fp) + # Obtain value from -36($fp) + lw $v0, -36($fp) + lw $v0, 12($v0) + sw $v0, -28($fp) + # IF_ZERO local_read_input_at_Parse_internal_6 GOTO label_WHILE_END_6 + # IF_ZERO local_read_input_at_Parse_internal_6 GOTO label_WHILE_END_6 + lw $t0, -28($fp) + beq $t0, 0, label_WHILE_END_6 + # LOCAL local_read_input_at_Parse_internal_18 --> -76($fp) + # LOCAL local_read_input_at_Parse_g_0 --> -4($fp) + # local_read_input_at_Parse_internal_18 = local_read_input_at_Parse_g_0 + lw $t0, -4($fp) + sw $t0, -76($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_read_input_at_Parse_internal_22 --> -92($fp) + # local_read_input_at_Parse_internal_22 = SELF + sw $s1, -92($fp) + # LOCAL local_read_input_at_Parse_internal_20 --> -84($fp) + # LOCAL local_read_input_at_Parse_internal_22 --> -92($fp) + # local_read_input_at_Parse_internal_20 = local_read_input_at_Parse_internal_22 + lw $t0, -92($fp) + sw $t0, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_read_input_at_Parse_line_2 + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + lw $t0, -12($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_read_input_at_Parse_internal_20 --> -84($fp) + # LOCAL local_read_input_at_Parse_internal_21 --> -88($fp) + # local_read_input_at_Parse_internal_21 = VCALL local_read_input_at_Parse_internal_20 parse_line + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_read_input_at_Parse_internal_21 + # LOCAL local_read_input_at_Parse_internal_21 --> -88($fp) + lw $t0, -88($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_read_input_at_Parse_internal_18 --> -76($fp) + # LOCAL local_read_input_at_Parse_internal_19 --> -80($fp) + # local_read_input_at_Parse_internal_19 = VCALL local_read_input_at_Parse_internal_18 add_vertice + # Save new self pointer in $s1 + lw $s1, -76($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -80($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_read_input_at_Parse_internal_25 --> -104($fp) + # local_read_input_at_Parse_internal_25 = SELF + sw $s1, -104($fp) + # LOCAL local_read_input_at_Parse_internal_23 --> -96($fp) + # LOCAL local_read_input_at_Parse_internal_25 --> -104($fp) + # local_read_input_at_Parse_internal_23 = local_read_input_at_Parse_internal_25 + lw $t0, -104($fp) + sw $t0, -96($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_read_input_at_Parse_internal_23 --> -96($fp) + # LOCAL local_read_input_at_Parse_internal_24 --> -100($fp) + # local_read_input_at_Parse_internal_24 = VCALL local_read_input_at_Parse_internal_23 in_string + # Save new self pointer in $s1 + lw $s1, -96($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -100($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_24 --> -100($fp) + # local_read_input_at_Parse_line_2 = local_read_input_at_Parse_internal_24 + lw $t0, -100($fp) + sw $t0, -12($fp) + # GOTO label_WHILE_5 + j label_WHILE_5 + label_WHILE_END_6: + # RETURN local_read_input_at_Parse_g_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_read_input_at_Parse. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 112 + jr $ra + # Function END + + +# function_parse_line_at_Parse implementation. +# @Params: +# 0($fp) = param_parse_line_at_Parse_s_0 +function_parse_line_at_Parse: + # Allocate stack frame for function function_parse_line_at_Parse. + subu $sp, $sp, 136 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 136 + # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) + # local_parse_line_at_Parse_v_0 = ALLOCATE Vertice + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Vertice + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Vertice_start + sw $t0, 4($v0) + # Load type offset + li $t0, 56 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Vertice__attrib__num__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Vertice__attrib__out__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local_parse_line_at_Parse_internal_3 --> -16($fp) + # local_parse_line_at_Parse_internal_3 = ALLOCATE Vertice + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Vertice + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Vertice_start + sw $t0, 4($v0) + # Load type offset + li $t0, 56 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Vertice__attrib__num__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Vertice__attrib__out__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -16($fp) + # LOCAL local_parse_line_at_Parse_internal_1 --> -8($fp) + # LOCAL local_parse_line_at_Parse_internal_3 --> -16($fp) + # local_parse_line_at_Parse_internal_1 = local_parse_line_at_Parse_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_6 --> -28($fp) + # local_parse_line_at_Parse_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_parse_line_at_Parse_internal_4 --> -20($fp) + # LOCAL local_parse_line_at_Parse_internal_6 --> -28($fp) + # local_parse_line_at_Parse_internal_4 = local_parse_line_at_Parse_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_parse_line_at_Parse_s_0 + # PARAM param_parse_line_at_Parse_s_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_4 --> -20($fp) + # LOCAL local_parse_line_at_Parse_internal_5 --> -24($fp) + # local_parse_line_at_Parse_internal_5 = VCALL local_parse_line_at_Parse_internal_4 a2i + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_parse_line_at_Parse_internal_5 + # LOCAL local_parse_line_at_Parse_internal_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_1 --> -8($fp) + # LOCAL local_parse_line_at_Parse_internal_2 --> -12($fp) + # local_parse_line_at_Parse_internal_2 = VCALL local_parse_line_at_Parse_internal_1 init + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) + # LOCAL local_parse_line_at_Parse_internal_2 --> -12($fp) + # local_parse_line_at_Parse_v_0 = local_parse_line_at_Parse_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + label_WHILE_27: + # local_parse_line_at_Parse_internal_12 = GETATTRIBUTE rest Parse + # LOCAL local_parse_line_at_Parse_internal_12 --> -52($fp) + lw $t0, 16($s1) + sw $t0, -52($fp) + # LOCAL local_parse_line_at_Parse_internal_10 --> -44($fp) + # LOCAL local_parse_line_at_Parse_internal_12 --> -52($fp) + # local_parse_line_at_Parse_internal_10 = local_parse_line_at_Parse_internal_12 + lw $t0, -52($fp) + sw $t0, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_10 --> -44($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # local_parse_line_at_Parse_internal_11 = VCALL local_parse_line_at_Parse_internal_10 length + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -56($fp) + # IF_ZERO local_parse_line_at_Parse_internal_11 GOTO label_FALSE_29 + # IF_ZERO local_parse_line_at_Parse_internal_11 GOTO label_FALSE_29 + lw $t0, -48($fp) + beq $t0, 0, label_FALSE_29 + # IF_ZERO local_parse_line_at_Parse_internal_13 GOTO label_FALSE_29 + # IF_ZERO local_parse_line_at_Parse_internal_13 GOTO label_FALSE_29 + lw $t0, -56($fp) + beq $t0, 0, label_FALSE_29 + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # Comparing -48($fp) type with String + la $v0, String + lw $a0, -48($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_STRING_32 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_STRING_32 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_32 + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # Comparing -48($fp) type with Bool + la $v0, Bool + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_33 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_33 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_33 + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # Comparing -48($fp) type with Int + la $v0, Int + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_33 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_33 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_33 + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) + # Load pointers and SUB + lw $a0, -48($fp) + lw $a1, -56($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_30 + # GOTO label_FALSE_29 + j label_FALSE_29 + label_COMPARE_BY_VALUE_33: + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) + lw $a0, -48($fp) + lw $a1, -56($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_30 + # GOTO label_FALSE_29 + j label_FALSE_29 + label_COMPARE_STRING_32: + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -56($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_CONTINUE_34 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_CONTINUE_34 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_34 + # GOTO label_FALSE_29 + j label_FALSE_29 + label_CONTINUE_34: + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -56($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_35: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_36 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_35 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_36: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_30 + label_FALSE_29: + # LOCAL local_parse_line_at_Parse_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_31 +j label_END_31 +label_TRUE_30: + # LOCAL local_parse_line_at_Parse_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_31: +# LOCAL local_parse_line_at_Parse_internal_8 --> -36($fp) +# LOCAL local_parse_line_at_Parse_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -36($fp) +# IF_ZERO local_parse_line_at_Parse_internal_8 GOTO label_FALSE_37 +# IF_ZERO local_parse_line_at_Parse_internal_8 GOTO label_FALSE_37 +lw $t0, -36($fp) +beq $t0, 0, label_FALSE_37 +# LOCAL local_parse_line_at_Parse_internal_14 --> -60($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -60($fp) +# GOTO label_NOT_END_38 +j label_NOT_END_38 +label_FALSE_37: + # LOCAL local_parse_line_at_Parse_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + label_NOT_END_38: + # LOCAL local_parse_line_at_Parse_internal_7 --> -32($fp) + # LOCAL local_parse_line_at_Parse_internal_14 --> -60($fp) + # Obtain value from -60($fp) + lw $v0, -60($fp) + lw $v0, 12($v0) + sw $v0, -32($fp) + # IF_ZERO local_parse_line_at_Parse_internal_7 GOTO label_WHILE_END_28 + # IF_ZERO local_parse_line_at_Parse_internal_7 GOTO label_WHILE_END_28 + lw $t0, -32($fp) + beq $t0, 0, label_WHILE_END_28 + # LOCAL local_parse_line_at_Parse_succ_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -64($fp) + # LOCAL local_parse_line_at_Parse_internal_18 --> -76($fp) + # local_parse_line_at_Parse_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_parse_line_at_Parse_internal_16 --> -68($fp) + # LOCAL local_parse_line_at_Parse_internal_18 --> -76($fp) + # local_parse_line_at_Parse_internal_16 = local_parse_line_at_Parse_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_parse_line_at_Parse_internal_19 = GETATTRIBUTE rest Parse + # LOCAL local_parse_line_at_Parse_internal_19 --> -80($fp) + lw $t0, 16($s1) + sw $t0, -80($fp) + # ARG local_parse_line_at_Parse_internal_19 + # LOCAL local_parse_line_at_Parse_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_16 --> -68($fp) + # LOCAL local_parse_line_at_Parse_internal_17 --> -72($fp) + # local_parse_line_at_Parse_internal_17 = VCALL local_parse_line_at_Parse_internal_16 a2i + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_parse_line_at_Parse_succ_15 --> -64($fp) + # LOCAL local_parse_line_at_Parse_internal_17 --> -72($fp) + # local_parse_line_at_Parse_succ_15 = local_parse_line_at_Parse_internal_17 + lw $t0, -72($fp) + sw $t0, -64($fp) + # LOCAL local_parse_line_at_Parse_weight_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -84($fp) + # LOCAL local_parse_line_at_Parse_internal_23 --> -96($fp) + # local_parse_line_at_Parse_internal_23 = SELF + sw $s1, -96($fp) + # LOCAL local_parse_line_at_Parse_internal_21 --> -88($fp) + # LOCAL local_parse_line_at_Parse_internal_23 --> -96($fp) + # local_parse_line_at_Parse_internal_21 = local_parse_line_at_Parse_internal_23 + lw $t0, -96($fp) + sw $t0, -88($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_parse_line_at_Parse_internal_24 = GETATTRIBUTE rest Parse + # LOCAL local_parse_line_at_Parse_internal_24 --> -100($fp) + lw $t0, 16($s1) + sw $t0, -100($fp) + # ARG local_parse_line_at_Parse_internal_24 + # LOCAL local_parse_line_at_Parse_internal_24 --> -100($fp) + lw $t0, -100($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_21 --> -88($fp) + # LOCAL local_parse_line_at_Parse_internal_22 --> -92($fp) + # local_parse_line_at_Parse_internal_22 = VCALL local_parse_line_at_Parse_internal_21 a2i + # Save new self pointer in $s1 + lw $s1, -88($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -92($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_parse_line_at_Parse_weight_20 --> -84($fp) + # LOCAL local_parse_line_at_Parse_internal_22 --> -92($fp) + # local_parse_line_at_Parse_weight_20 = local_parse_line_at_Parse_internal_22 + lw $t0, -92($fp) + sw $t0, -84($fp) + # LOCAL local_parse_line_at_Parse_internal_25 --> -104($fp) + # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) + # local_parse_line_at_Parse_internal_25 = local_parse_line_at_Parse_v_0 + lw $t0, -4($fp) + sw $t0, -104($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_29 --> -120($fp) + # local_parse_line_at_Parse_internal_29 = ALLOCATE Edge + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Edge + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 24 bytes of memory + li $a0, 24 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Edge_start + sw $t0, 4($v0) + # Load type offset + li $t0, 52 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Edge__attrib__from__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Edge__attrib__to__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Edge__attrib__weight__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -120($fp) + # LOCAL local_parse_line_at_Parse_internal_27 --> -112($fp) + # LOCAL local_parse_line_at_Parse_internal_29 --> -120($fp) + # local_parse_line_at_Parse_internal_27 = local_parse_line_at_Parse_internal_29 + lw $t0, -120($fp) + sw $t0, -112($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_30 --> -124($fp) + # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) + # local_parse_line_at_Parse_internal_30 = local_parse_line_at_Parse_v_0 + lw $t0, -4($fp) + sw $t0, -124($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_30 --> -124($fp) + # LOCAL local_parse_line_at_Parse_internal_31 --> -128($fp) + # local_parse_line_at_Parse_internal_31 = VCALL local_parse_line_at_Parse_internal_30 number + # Save new self pointer in $s1 + lw $s1, -124($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -128($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_parse_line_at_Parse_internal_31 + # LOCAL local_parse_line_at_Parse_internal_31 --> -128($fp) + lw $t0, -128($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # ARG local_parse_line_at_Parse_succ_15 + # LOCAL local_parse_line_at_Parse_succ_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # ARG local_parse_line_at_Parse_weight_20 + # LOCAL local_parse_line_at_Parse_weight_20 --> -84($fp) + lw $t0, -84($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_27 --> -112($fp) + # LOCAL local_parse_line_at_Parse_internal_28 --> -116($fp) + # local_parse_line_at_Parse_internal_28 = VCALL local_parse_line_at_Parse_internal_27 init + # Save new self pointer in $s1 + lw $s1, -112($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -116($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_parse_line_at_Parse_internal_28 + # LOCAL local_parse_line_at_Parse_internal_28 --> -116($fp) + lw $t0, -116($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_25 --> -104($fp) + # LOCAL local_parse_line_at_Parse_internal_26 --> -108($fp) + # local_parse_line_at_Parse_internal_26 = VCALL local_parse_line_at_Parse_internal_25 add_out + # Save new self pointer in $s1 + lw $s1, -104($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -108($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # GOTO label_WHILE_27 + j label_WHILE_27 + label_WHILE_END_28: + # RETURN local_parse_line_at_Parse_v_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_parse_line_at_Parse. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 136 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_c2i_at_Parse implementation. +# @Params: +# 0($fp) = param_c2i_at_Parse_char_0 +function_c2i_at_Parse: + # Allocate stack frame for function function_c2i_at_Parse. + subu $sp, $sp, 264 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 264 + # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_6 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -20($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_41 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_41 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_41 + # IF_ZERO local_c2i_at_Parse_internal_4 GOTO label_FALSE_41 + # IF_ZERO local_c2i_at_Parse_internal_4 GOTO label_FALSE_41 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_41 + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_STRING_44 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_STRING_44 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_44 + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_45 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_45 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_45 + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_45 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_45 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_45 + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_42 + # GOTO label_FALSE_41 + j label_FALSE_41 + label_COMPARE_BY_VALUE_45: + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_42 + # GOTO label_FALSE_41 + j label_FALSE_41 + label_COMPARE_STRING_44: + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_CONTINUE_46 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_CONTINUE_46 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_46 + # GOTO label_FALSE_41 + j label_FALSE_41 + label_CONTINUE_46: + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_47: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_48 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_47 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_48: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_42 + label_FALSE_41: + # LOCAL local_c2i_at_Parse_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_43 +j label_END_43 +label_TRUE_42: + # LOCAL local_c2i_at_Parse_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_43: +# LOCAL local_c2i_at_Parse_internal_0 --> -4($fp) +# LOCAL local_c2i_at_Parse_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_c2i_at_Parse_internal_0 GOTO label_FALSEIF_39 +# IF_ZERO local_c2i_at_Parse_internal_0 GOTO label_FALSEIF_39 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_39 +# LOCAL local_c2i_at_Parse_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -24($fp) +# LOCAL local_c2i_at_Parse_internal_1 --> -8($fp) +# LOCAL local_c2i_at_Parse_internal_5 --> -24($fp) +# local_c2i_at_Parse_internal_1 = local_c2i_at_Parse_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_40 +j label_ENDIF_40 +label_FALSEIF_39: + # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_7 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -44($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_51 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_51 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_51 + # IF_ZERO local_c2i_at_Parse_internal_10 GOTO label_FALSE_51 + # IF_ZERO local_c2i_at_Parse_internal_10 GOTO label_FALSE_51 + lw $t0, -44($fp) + beq $t0, 0, label_FALSE_51 + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_STRING_54 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_STRING_54 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_54 + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_55 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_55 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_55 + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_55 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_55 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_55 + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -44($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_52 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_COMPARE_BY_VALUE_55: + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) + lw $a0, 0($fp) + lw $a1, -44($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_52 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_COMPARE_STRING_54: + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_CONTINUE_56 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_CONTINUE_56 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_56 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_CONTINUE_56: + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_57: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_58 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_57 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_58: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_52 + label_FALSE_51: + # LOCAL local_c2i_at_Parse_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_53 +j label_END_53 +label_TRUE_52: + # LOCAL local_c2i_at_Parse_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_53: +# LOCAL local_c2i_at_Parse_internal_6 --> -28($fp) +# LOCAL local_c2i_at_Parse_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_c2i_at_Parse_internal_6 GOTO label_FALSEIF_49 +# IF_ZERO local_c2i_at_Parse_internal_6 GOTO label_FALSEIF_49 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_49 +# LOCAL local_c2i_at_Parse_internal_11 --> -48($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -48($fp) +# LOCAL local_c2i_at_Parse_internal_7 --> -32($fp) +# LOCAL local_c2i_at_Parse_internal_11 --> -48($fp) +# local_c2i_at_Parse_internal_7 = local_c2i_at_Parse_internal_11 +lw $t0, -48($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_50 +j label_ENDIF_50 +label_FALSEIF_49: + # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_8 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -68($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_61 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_61 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_61 + # IF_ZERO local_c2i_at_Parse_internal_16 GOTO label_FALSE_61 + # IF_ZERO local_c2i_at_Parse_internal_16 GOTO label_FALSE_61 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_61 + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_STRING_64 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_STRING_64 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_STRING_64 + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_65 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_65 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_65 + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_65 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_65 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_65 + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_62 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_COMPARE_BY_VALUE_65: + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) + lw $a0, 0($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_62 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_COMPARE_STRING_64: + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_CONTINUE_66 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_CONTINUE_66 + lw $t0, -64($fp) + beq $t0, 0, label_CONTINUE_66 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_CONTINUE_66: + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_67: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_68 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_67 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_68: + # Store result + sw $a2, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_62 + label_FALSE_61: + # LOCAL local_c2i_at_Parse_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # GOTO label_END_63 +j label_END_63 +label_TRUE_62: + # LOCAL local_c2i_at_Parse_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + label_END_63: +# LOCAL local_c2i_at_Parse_internal_12 --> -52($fp) +# LOCAL local_c2i_at_Parse_internal_14 --> -60($fp) +# Obtain value from -60($fp) +lw $v0, -60($fp) +lw $v0, 12($v0) +sw $v0, -52($fp) +# IF_ZERO local_c2i_at_Parse_internal_12 GOTO label_FALSEIF_59 +# IF_ZERO local_c2i_at_Parse_internal_12 GOTO label_FALSEIF_59 +lw $t0, -52($fp) +beq $t0, 0, label_FALSEIF_59 +# LOCAL local_c2i_at_Parse_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 2 +sw $t0, 12($v0) +sw $v0, -72($fp) +# LOCAL local_c2i_at_Parse_internal_13 --> -56($fp) +# LOCAL local_c2i_at_Parse_internal_17 --> -72($fp) +# local_c2i_at_Parse_internal_13 = local_c2i_at_Parse_internal_17 +lw $t0, -72($fp) +sw $t0, -56($fp) +# GOTO label_ENDIF_60 +j label_ENDIF_60 +label_FALSEIF_59: + # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_9 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -92($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_71 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_71 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_71 + # IF_ZERO local_c2i_at_Parse_internal_22 GOTO label_FALSE_71 + # IF_ZERO local_c2i_at_Parse_internal_22 GOTO label_FALSE_71 + lw $t0, -92($fp) + beq $t0, 0, label_FALSE_71 + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_STRING_74 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_STRING_74 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_STRING_74 + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_BY_VALUE_75 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_BY_VALUE_75 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_75 + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_BY_VALUE_75 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_BY_VALUE_75 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_75 + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -92($fp) + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_72 + # GOTO label_FALSE_71 + j label_FALSE_71 + label_COMPARE_BY_VALUE_75: + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) + lw $a0, 0($fp) + lw $a1, -92($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_72 + # GOTO label_FALSE_71 + j label_FALSE_71 + label_COMPARE_STRING_74: + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_CONTINUE_76 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_CONTINUE_76 + lw $t0, -88($fp) + beq $t0, 0, label_CONTINUE_76 + # GOTO label_FALSE_71 + j label_FALSE_71 + label_CONTINUE_76: + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_77: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_78 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_77 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_78: + # Store result + sw $a2, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_72 + label_FALSE_71: + # LOCAL local_c2i_at_Parse_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -84($fp) + # GOTO label_END_73 +j label_END_73 +label_TRUE_72: + # LOCAL local_c2i_at_Parse_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -84($fp) + label_END_73: +# LOCAL local_c2i_at_Parse_internal_18 --> -76($fp) +# LOCAL local_c2i_at_Parse_internal_20 --> -84($fp) +# Obtain value from -84($fp) +lw $v0, -84($fp) +lw $v0, 12($v0) +sw $v0, -76($fp) +# IF_ZERO local_c2i_at_Parse_internal_18 GOTO label_FALSEIF_69 +# IF_ZERO local_c2i_at_Parse_internal_18 GOTO label_FALSEIF_69 +lw $t0, -76($fp) +beq $t0, 0, label_FALSEIF_69 +# LOCAL local_c2i_at_Parse_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 3 +sw $t0, 12($v0) +sw $v0, -96($fp) +# LOCAL local_c2i_at_Parse_internal_19 --> -80($fp) +# LOCAL local_c2i_at_Parse_internal_23 --> -96($fp) +# local_c2i_at_Parse_internal_19 = local_c2i_at_Parse_internal_23 +lw $t0, -96($fp) +sw $t0, -80($fp) +# GOTO label_ENDIF_70 +j label_ENDIF_70 +label_FALSEIF_69: + # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_10 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -116($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_81 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_81 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_81 + # IF_ZERO local_c2i_at_Parse_internal_28 GOTO label_FALSE_81 + # IF_ZERO local_c2i_at_Parse_internal_28 GOTO label_FALSE_81 + lw $t0, -116($fp) + beq $t0, 0, label_FALSE_81 + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_STRING_84 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_STRING_84 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_STRING_84 + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_BY_VALUE_85 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_BY_VALUE_85 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_85 + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_BY_VALUE_85 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_BY_VALUE_85 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_85 + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -116($fp) + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_82 + # GOTO label_FALSE_81 + j label_FALSE_81 + label_COMPARE_BY_VALUE_85: + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) + lw $a0, 0($fp) + lw $a1, -116($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_82 + # GOTO label_FALSE_81 + j label_FALSE_81 + label_COMPARE_STRING_84: + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_CONTINUE_86 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_CONTINUE_86 + lw $t0, -112($fp) + beq $t0, 0, label_CONTINUE_86 + # GOTO label_FALSE_81 + j label_FALSE_81 + label_CONTINUE_86: + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_87: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_88 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_87 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_88: + # Store result + sw $a2, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_82 + label_FALSE_81: + # LOCAL local_c2i_at_Parse_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -108($fp) + # GOTO label_END_83 +j label_END_83 +label_TRUE_82: + # LOCAL local_c2i_at_Parse_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -108($fp) + label_END_83: +# LOCAL local_c2i_at_Parse_internal_24 --> -100($fp) +# LOCAL local_c2i_at_Parse_internal_26 --> -108($fp) +# Obtain value from -108($fp) +lw $v0, -108($fp) +lw $v0, 12($v0) +sw $v0, -100($fp) +# IF_ZERO local_c2i_at_Parse_internal_24 GOTO label_FALSEIF_79 +# IF_ZERO local_c2i_at_Parse_internal_24 GOTO label_FALSEIF_79 +lw $t0, -100($fp) +beq $t0, 0, label_FALSEIF_79 +# LOCAL local_c2i_at_Parse_internal_29 --> -120($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 4 +sw $t0, 12($v0) +sw $v0, -120($fp) +# LOCAL local_c2i_at_Parse_internal_25 --> -104($fp) +# LOCAL local_c2i_at_Parse_internal_29 --> -120($fp) +# local_c2i_at_Parse_internal_25 = local_c2i_at_Parse_internal_29 +lw $t0, -120($fp) +sw $t0, -104($fp) +# GOTO label_ENDIF_80 +j label_ENDIF_80 +label_FALSEIF_79: + # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_11 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -140($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_91 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_91 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_91 + # IF_ZERO local_c2i_at_Parse_internal_34 GOTO label_FALSE_91 + # IF_ZERO local_c2i_at_Parse_internal_34 GOTO label_FALSE_91 + lw $t0, -140($fp) + beq $t0, 0, label_FALSE_91 + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_STRING_94 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_STRING_94 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_STRING_94 + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_BY_VALUE_95 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_BY_VALUE_95 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_95 + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_BY_VALUE_95 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_BY_VALUE_95 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_95 + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -140($fp) + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_92 + # GOTO label_FALSE_91 + j label_FALSE_91 + label_COMPARE_BY_VALUE_95: + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) + lw $a0, 0($fp) + lw $a1, -140($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_92 + # GOTO label_FALSE_91 + j label_FALSE_91 + label_COMPARE_STRING_94: + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_CONTINUE_96 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_CONTINUE_96 + lw $t0, -136($fp) + beq $t0, 0, label_CONTINUE_96 + # GOTO label_FALSE_91 + j label_FALSE_91 + label_CONTINUE_96: + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_97: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_98 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_97 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_98: + # Store result + sw $a2, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_92 + label_FALSE_91: + # LOCAL local_c2i_at_Parse_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -132($fp) + # GOTO label_END_93 +j label_END_93 +label_TRUE_92: + # LOCAL local_c2i_at_Parse_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -132($fp) + label_END_93: +# LOCAL local_c2i_at_Parse_internal_30 --> -124($fp) +# LOCAL local_c2i_at_Parse_internal_32 --> -132($fp) +# Obtain value from -132($fp) +lw $v0, -132($fp) +lw $v0, 12($v0) +sw $v0, -124($fp) +# IF_ZERO local_c2i_at_Parse_internal_30 GOTO label_FALSEIF_89 +# IF_ZERO local_c2i_at_Parse_internal_30 GOTO label_FALSEIF_89 +lw $t0, -124($fp) +beq $t0, 0, label_FALSEIF_89 +# LOCAL local_c2i_at_Parse_internal_35 --> -144($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 5 +sw $t0, 12($v0) +sw $v0, -144($fp) +# LOCAL local_c2i_at_Parse_internal_31 --> -128($fp) +# LOCAL local_c2i_at_Parse_internal_35 --> -144($fp) +# local_c2i_at_Parse_internal_31 = local_c2i_at_Parse_internal_35 +lw $t0, -144($fp) +sw $t0, -128($fp) +# GOTO label_ENDIF_90 +j label_ENDIF_90 +label_FALSEIF_89: + # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_12 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -164($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_101 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_101 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_101 + # IF_ZERO local_c2i_at_Parse_internal_40 GOTO label_FALSE_101 + # IF_ZERO local_c2i_at_Parse_internal_40 GOTO label_FALSE_101 + lw $t0, -164($fp) + beq $t0, 0, label_FALSE_101 + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_STRING_104 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_STRING_104 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_STRING_104 + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_BY_VALUE_105 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_BY_VALUE_105 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_105 + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_BY_VALUE_105 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_BY_VALUE_105 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_105 + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -164($fp) + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_102 + # GOTO label_FALSE_101 + j label_FALSE_101 + label_COMPARE_BY_VALUE_105: + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) + lw $a0, 0($fp) + lw $a1, -164($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_102 + # GOTO label_FALSE_101 + j label_FALSE_101 + label_COMPARE_STRING_104: + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_CONTINUE_106 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_CONTINUE_106 + lw $t0, -160($fp) + beq $t0, 0, label_CONTINUE_106 + # GOTO label_FALSE_101 + j label_FALSE_101 + label_CONTINUE_106: + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_107: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_108 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_107 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_108: + # Store result + sw $a2, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_102 + label_FALSE_101: + # LOCAL local_c2i_at_Parse_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -156($fp) + # GOTO label_END_103 +j label_END_103 +label_TRUE_102: + # LOCAL local_c2i_at_Parse_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -156($fp) + label_END_103: +# LOCAL local_c2i_at_Parse_internal_36 --> -148($fp) +# LOCAL local_c2i_at_Parse_internal_38 --> -156($fp) +# Obtain value from -156($fp) +lw $v0, -156($fp) +lw $v0, 12($v0) +sw $v0, -148($fp) +# IF_ZERO local_c2i_at_Parse_internal_36 GOTO label_FALSEIF_99 +# IF_ZERO local_c2i_at_Parse_internal_36 GOTO label_FALSEIF_99 +lw $t0, -148($fp) +beq $t0, 0, label_FALSEIF_99 +# LOCAL local_c2i_at_Parse_internal_41 --> -168($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 6 +sw $t0, 12($v0) +sw $v0, -168($fp) +# LOCAL local_c2i_at_Parse_internal_37 --> -152($fp) +# LOCAL local_c2i_at_Parse_internal_41 --> -168($fp) +# local_c2i_at_Parse_internal_37 = local_c2i_at_Parse_internal_41 +lw $t0, -168($fp) +sw $t0, -152($fp) +# GOTO label_ENDIF_100 +j label_ENDIF_100 +label_FALSEIF_99: + # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_13 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -188($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_111 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_111 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_111 + # IF_ZERO local_c2i_at_Parse_internal_46 GOTO label_FALSE_111 + # IF_ZERO local_c2i_at_Parse_internal_46 GOTO label_FALSE_111 + lw $t0, -188($fp) + beq $t0, 0, label_FALSE_111 + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_STRING_114 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_STRING_114 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_STRING_114 + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_BY_VALUE_115 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_BY_VALUE_115 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_115 + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_BY_VALUE_115 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_BY_VALUE_115 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_115 + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -188($fp) + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_112 + # GOTO label_FALSE_111 + j label_FALSE_111 + label_COMPARE_BY_VALUE_115: + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) + lw $a0, 0($fp) + lw $a1, -188($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_112 + # GOTO label_FALSE_111 + j label_FALSE_111 + label_COMPARE_STRING_114: + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_CONTINUE_116 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_CONTINUE_116 + lw $t0, -184($fp) + beq $t0, 0, label_CONTINUE_116 + # GOTO label_FALSE_111 + j label_FALSE_111 + label_CONTINUE_116: + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_117: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_118 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_117 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_118: + # Store result + sw $a2, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_112 + label_FALSE_111: + # LOCAL local_c2i_at_Parse_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -180($fp) + # GOTO label_END_113 +j label_END_113 +label_TRUE_112: + # LOCAL local_c2i_at_Parse_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -180($fp) + label_END_113: +# LOCAL local_c2i_at_Parse_internal_42 --> -172($fp) +# LOCAL local_c2i_at_Parse_internal_44 --> -180($fp) +# Obtain value from -180($fp) +lw $v0, -180($fp) +lw $v0, 12($v0) +sw $v0, -172($fp) +# IF_ZERO local_c2i_at_Parse_internal_42 GOTO label_FALSEIF_109 +# IF_ZERO local_c2i_at_Parse_internal_42 GOTO label_FALSEIF_109 +lw $t0, -172($fp) +beq $t0, 0, label_FALSEIF_109 +# LOCAL local_c2i_at_Parse_internal_47 --> -192($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 7 +sw $t0, 12($v0) +sw $v0, -192($fp) +# LOCAL local_c2i_at_Parse_internal_43 --> -176($fp) +# LOCAL local_c2i_at_Parse_internal_47 --> -192($fp) +# local_c2i_at_Parse_internal_43 = local_c2i_at_Parse_internal_47 +lw $t0, -192($fp) +sw $t0, -176($fp) +# GOTO label_ENDIF_110 +j label_ENDIF_110 +label_FALSEIF_109: + # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_14 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -212($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_121 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_121 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_121 + # IF_ZERO local_c2i_at_Parse_internal_52 GOTO label_FALSE_121 + # IF_ZERO local_c2i_at_Parse_internal_52 GOTO label_FALSE_121 + lw $t0, -212($fp) + beq $t0, 0, label_FALSE_121 + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_STRING_124 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_STRING_124 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_STRING_124 + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_BY_VALUE_125 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_BY_VALUE_125 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_125 + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_BY_VALUE_125 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_BY_VALUE_125 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_125 + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -212($fp) + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_122 + # GOTO label_FALSE_121 + j label_FALSE_121 + label_COMPARE_BY_VALUE_125: + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) + lw $a0, 0($fp) + lw $a1, -212($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_122 + # GOTO label_FALSE_121 + j label_FALSE_121 + label_COMPARE_STRING_124: + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_CONTINUE_126 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_CONTINUE_126 + lw $t0, -208($fp) + beq $t0, 0, label_CONTINUE_126 + # GOTO label_FALSE_121 + j label_FALSE_121 + label_CONTINUE_126: + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_127: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_128 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_127 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_128: + # Store result + sw $a2, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_122 + label_FALSE_121: + # LOCAL local_c2i_at_Parse_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -204($fp) + # GOTO label_END_123 +j label_END_123 +label_TRUE_122: + # LOCAL local_c2i_at_Parse_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -204($fp) + label_END_123: +# LOCAL local_c2i_at_Parse_internal_48 --> -196($fp) +# LOCAL local_c2i_at_Parse_internal_50 --> -204($fp) +# Obtain value from -204($fp) +lw $v0, -204($fp) +lw $v0, 12($v0) +sw $v0, -196($fp) +# IF_ZERO local_c2i_at_Parse_internal_48 GOTO label_FALSEIF_119 +# IF_ZERO local_c2i_at_Parse_internal_48 GOTO label_FALSEIF_119 +lw $t0, -196($fp) +beq $t0, 0, label_FALSEIF_119 +# LOCAL local_c2i_at_Parse_internal_53 --> -216($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 8 +sw $t0, 12($v0) +sw $v0, -216($fp) +# LOCAL local_c2i_at_Parse_internal_49 --> -200($fp) +# LOCAL local_c2i_at_Parse_internal_53 --> -216($fp) +# local_c2i_at_Parse_internal_49 = local_c2i_at_Parse_internal_53 +lw $t0, -216($fp) +sw $t0, -200($fp) +# GOTO label_ENDIF_120 +j label_ENDIF_120 +label_FALSEIF_119: + # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_15 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -236($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_131 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_131 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_131 + # IF_ZERO local_c2i_at_Parse_internal_58 GOTO label_FALSE_131 + # IF_ZERO local_c2i_at_Parse_internal_58 GOTO label_FALSE_131 + lw $t0, -236($fp) + beq $t0, 0, label_FALSE_131 + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_STRING_134 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_STRING_134 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_STRING_134 + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_BY_VALUE_135 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_BY_VALUE_135 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_135 + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_BY_VALUE_135 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_BY_VALUE_135 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_135 + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -236($fp) + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_132 + # GOTO label_FALSE_131 + j label_FALSE_131 + label_COMPARE_BY_VALUE_135: + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) + lw $a0, 0($fp) + lw $a1, -236($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_132 + # GOTO label_FALSE_131 + j label_FALSE_131 + label_COMPARE_STRING_134: + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_CONTINUE_136 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_CONTINUE_136 + lw $t0, -232($fp) + beq $t0, 0, label_CONTINUE_136 + # GOTO label_FALSE_131 + j label_FALSE_131 + label_CONTINUE_136: + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_137: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_138 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_137 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_138: + # Store result + sw $a2, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_132 + label_FALSE_131: + # LOCAL local_c2i_at_Parse_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -228($fp) + # GOTO label_END_133 +j label_END_133 +label_TRUE_132: + # LOCAL local_c2i_at_Parse_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -228($fp) + label_END_133: +# LOCAL local_c2i_at_Parse_internal_54 --> -220($fp) +# LOCAL local_c2i_at_Parse_internal_56 --> -228($fp) +# Obtain value from -228($fp) +lw $v0, -228($fp) +lw $v0, 12($v0) +sw $v0, -220($fp) +# IF_ZERO local_c2i_at_Parse_internal_54 GOTO label_FALSEIF_129 +# IF_ZERO local_c2i_at_Parse_internal_54 GOTO label_FALSEIF_129 +lw $t0, -220($fp) +beq $t0, 0, label_FALSEIF_129 +# LOCAL local_c2i_at_Parse_internal_59 --> -240($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 9 +sw $t0, 12($v0) +sw $v0, -240($fp) +# LOCAL local_c2i_at_Parse_internal_55 --> -224($fp) +# LOCAL local_c2i_at_Parse_internal_59 --> -240($fp) +# local_c2i_at_Parse_internal_55 = local_c2i_at_Parse_internal_59 +lw $t0, -240($fp) +sw $t0, -224($fp) +# GOTO label_ENDIF_130 +j label_ENDIF_130 +label_FALSEIF_129: + # LOCAL local_c2i_at_Parse_internal_62 --> -252($fp) + # local_c2i_at_Parse_internal_62 = SELF + sw $s1, -252($fp) + # LOCAL local_c2i_at_Parse_internal_60 --> -244($fp) + # LOCAL local_c2i_at_Parse_internal_62 --> -252($fp) + # local_c2i_at_Parse_internal_60 = local_c2i_at_Parse_internal_62 + lw $t0, -252($fp) + sw $t0, -244($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_c2i_at_Parse_internal_60 --> -244($fp) + # LOCAL local_c2i_at_Parse_internal_61 --> -248($fp) + # local_c2i_at_Parse_internal_61 = VCALL local_c2i_at_Parse_internal_60 abort + # Save new self pointer in $s1 + lw $s1, -244($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -248($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_c2i_at_Parse_internal_63 --> -256($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -256($fp) + # LOCAL local_c2i_at_Parse_internal_55 --> -224($fp) + # LOCAL local_c2i_at_Parse_internal_63 --> -256($fp) + # local_c2i_at_Parse_internal_55 = local_c2i_at_Parse_internal_63 + lw $t0, -256($fp) + sw $t0, -224($fp) + label_ENDIF_130: +# LOCAL local_c2i_at_Parse_internal_49 --> -200($fp) +# LOCAL local_c2i_at_Parse_internal_55 --> -224($fp) +# local_c2i_at_Parse_internal_49 = local_c2i_at_Parse_internal_55 +lw $t0, -224($fp) +sw $t0, -200($fp) +label_ENDIF_120: +# LOCAL local_c2i_at_Parse_internal_43 --> -176($fp) +# LOCAL local_c2i_at_Parse_internal_49 --> -200($fp) +# local_c2i_at_Parse_internal_43 = local_c2i_at_Parse_internal_49 +lw $t0, -200($fp) +sw $t0, -176($fp) +label_ENDIF_110: +# LOCAL local_c2i_at_Parse_internal_37 --> -152($fp) +# LOCAL local_c2i_at_Parse_internal_43 --> -176($fp) +# local_c2i_at_Parse_internal_37 = local_c2i_at_Parse_internal_43 +lw $t0, -176($fp) +sw $t0, -152($fp) +label_ENDIF_100: +# LOCAL local_c2i_at_Parse_internal_31 --> -128($fp) +# LOCAL local_c2i_at_Parse_internal_37 --> -152($fp) +# local_c2i_at_Parse_internal_31 = local_c2i_at_Parse_internal_37 +lw $t0, -152($fp) +sw $t0, -128($fp) +label_ENDIF_90: +# LOCAL local_c2i_at_Parse_internal_25 --> -104($fp) +# LOCAL local_c2i_at_Parse_internal_31 --> -128($fp) +# local_c2i_at_Parse_internal_25 = local_c2i_at_Parse_internal_31 +lw $t0, -128($fp) +sw $t0, -104($fp) +label_ENDIF_80: +# LOCAL local_c2i_at_Parse_internal_19 --> -80($fp) +# LOCAL local_c2i_at_Parse_internal_25 --> -104($fp) +# local_c2i_at_Parse_internal_19 = local_c2i_at_Parse_internal_25 +lw $t0, -104($fp) +sw $t0, -80($fp) +label_ENDIF_70: +# LOCAL local_c2i_at_Parse_internal_13 --> -56($fp) +# LOCAL local_c2i_at_Parse_internal_19 --> -80($fp) +# local_c2i_at_Parse_internal_13 = local_c2i_at_Parse_internal_19 +lw $t0, -80($fp) +sw $t0, -56($fp) +label_ENDIF_60: +# LOCAL local_c2i_at_Parse_internal_7 --> -32($fp) +# LOCAL local_c2i_at_Parse_internal_13 --> -56($fp) +# local_c2i_at_Parse_internal_7 = local_c2i_at_Parse_internal_13 +lw $t0, -56($fp) +sw $t0, -32($fp) +label_ENDIF_50: +# LOCAL local_c2i_at_Parse_internal_1 --> -8($fp) +# LOCAL local_c2i_at_Parse_internal_7 --> -32($fp) +# local_c2i_at_Parse_internal_1 = local_c2i_at_Parse_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +label_ENDIF_40: +# RETURN local_c2i_at_Parse_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_c2i_at_Parse. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 264 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_at_Parse implementation. +# @Params: +# 0($fp) = param_a2i_at_Parse_s_0 +function_a2i_at_Parse: + # Allocate stack frame for function function_a2i_at_Parse. + subu $sp, $sp, 208 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 208 + # LOCAL local_a2i_at_Parse_internal_4 --> -20($fp) + # PARAM param_a2i_at_Parse_s_0 --> 0($fp) + # local_a2i_at_Parse_internal_4 = PARAM param_a2i_at_Parse_s_0 + lw $t0, 0($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_Parse_internal_4 --> -20($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # local_a2i_at_Parse_internal_5 = VCALL local_a2i_at_Parse_internal_4 length + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # IF_ZERO local_a2i_at_Parse_internal_5 GOTO label_FALSE_141 + # IF_ZERO local_a2i_at_Parse_internal_5 GOTO label_FALSE_141 + lw $t0, -24($fp) + beq $t0, 0, label_FALSE_141 + # IF_ZERO local_a2i_at_Parse_internal_6 GOTO label_FALSE_141 + # IF_ZERO local_a2i_at_Parse_internal_6 GOTO label_FALSE_141 + lw $t0, -28($fp) + beq $t0, 0, label_FALSE_141 + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # Comparing -24($fp) type with String + la $v0, String + lw $a0, -24($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_STRING_144 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_STRING_144 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_144 + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # Comparing -24($fp) type with Bool + la $v0, Bool + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_145 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_145 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_145 + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # Comparing -24($fp) type with Int + la $v0, Int + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_145 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_145 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_145 + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) + # Load pointers and SUB + lw $a0, -24($fp) + lw $a1, -28($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_142 + # GOTO label_FALSE_141 + j label_FALSE_141 + label_COMPARE_BY_VALUE_145: + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) + lw $a0, -24($fp) + lw $a1, -28($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_142 + # GOTO label_FALSE_141 + j label_FALSE_141 + label_COMPARE_STRING_144: + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -28($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_CONTINUE_146 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_CONTINUE_146 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_146 + # GOTO label_FALSE_141 + j label_FALSE_141 + label_CONTINUE_146: + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -28($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_147: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_148 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_147 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_148: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_142 + label_FALSE_141: + # LOCAL local_a2i_at_Parse_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_143 +j label_END_143 +label_TRUE_142: + # LOCAL local_a2i_at_Parse_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_143: +# LOCAL local_a2i_at_Parse_internal_0 --> -4($fp) +# LOCAL local_a2i_at_Parse_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_a2i_at_Parse_internal_0 GOTO label_FALSEIF_139 +# IF_ZERO local_a2i_at_Parse_internal_0 GOTO label_FALSEIF_139 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_139 +# LOCAL local_a2i_at_Parse_internal_7 --> -32($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -32($fp) +# LOCAL local_a2i_at_Parse_internal_1 --> -8($fp) +# LOCAL local_a2i_at_Parse_internal_7 --> -32($fp) +# local_a2i_at_Parse_internal_1 = local_a2i_at_Parse_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_140 +j label_ENDIF_140 +label_FALSEIF_139: + # LOCAL local_a2i_at_Parse_internal_12 --> -52($fp) + # PARAM param_a2i_at_Parse_s_0 --> 0($fp) + # local_a2i_at_Parse_internal_12 = PARAM param_a2i_at_Parse_s_0 + lw $t0, 0($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_Parse_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # ARG local_a2i_at_Parse_internal_14 + # LOCAL local_a2i_at_Parse_internal_14 --> -60($fp) + lw $t0, -60($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_Parse_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -64($fp) + # ARG local_a2i_at_Parse_internal_15 + # LOCAL local_a2i_at_Parse_internal_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_Parse_internal_12 --> -52($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # local_a2i_at_Parse_internal_13 = VCALL local_a2i_at_Parse_internal_12 substr + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_16 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -68($fp) + # IF_ZERO local_a2i_at_Parse_internal_13 GOTO label_FALSE_151 + # IF_ZERO local_a2i_at_Parse_internal_13 GOTO label_FALSE_151 + lw $t0, -56($fp) + beq $t0, 0, label_FALSE_151 + # IF_ZERO local_a2i_at_Parse_internal_16 GOTO label_FALSE_151 + # IF_ZERO local_a2i_at_Parse_internal_16 GOTO label_FALSE_151 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_151 + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # Comparing -56($fp) type with String + la $v0, String + lw $a0, -56($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_STRING_154 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_STRING_154 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_STRING_154 + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # Comparing -56($fp) type with Bool + la $v0, Bool + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_155 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_155 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_155 + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # Comparing -56($fp) type with Int + la $v0, Int + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_155 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_155 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_155 + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, -56($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_152 + # GOTO label_FALSE_151 + j label_FALSE_151 + label_COMPARE_BY_VALUE_155: + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) + lw $a0, -56($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_152 + # GOTO label_FALSE_151 + j label_FALSE_151 + label_COMPARE_STRING_154: + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_CONTINUE_156 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_CONTINUE_156 + lw $t0, -48($fp) + beq $t0, 0, label_CONTINUE_156 + # GOTO label_FALSE_151 + j label_FALSE_151 + label_CONTINUE_156: + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_157: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_158 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_157 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_158: + # Store result + sw $a2, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_152 + label_FALSE_151: + # LOCAL local_a2i_at_Parse_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -44($fp) + # GOTO label_END_153 +j label_END_153 +label_TRUE_152: + # LOCAL local_a2i_at_Parse_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + label_END_153: +# LOCAL local_a2i_at_Parse_internal_8 --> -36($fp) +# LOCAL local_a2i_at_Parse_internal_10 --> -44($fp) +# Obtain value from -44($fp) +lw $v0, -44($fp) +lw $v0, 12($v0) +sw $v0, -36($fp) +# IF_ZERO local_a2i_at_Parse_internal_8 GOTO label_FALSEIF_149 +# IF_ZERO local_a2i_at_Parse_internal_8 GOTO label_FALSEIF_149 +lw $t0, -36($fp) +beq $t0, 0, label_FALSEIF_149 +# LOCAL local_a2i_at_Parse_internal_20 --> -84($fp) +# local_a2i_at_Parse_internal_20 = SELF +sw $s1, -84($fp) +# LOCAL local_a2i_at_Parse_internal_18 --> -76($fp) +# LOCAL local_a2i_at_Parse_internal_20 --> -84($fp) +# local_a2i_at_Parse_internal_18 = local_a2i_at_Parse_internal_20 +lw $t0, -84($fp) +sw $t0, -76($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_Parse_internal_21 --> -88($fp) +# PARAM param_a2i_at_Parse_s_0 --> 0($fp) +# local_a2i_at_Parse_internal_21 = PARAM param_a2i_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -88($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_Parse_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -96($fp) +# ARG local_a2i_at_Parse_internal_23 +# LOCAL local_a2i_at_Parse_internal_23 --> -96($fp) +lw $t0, -96($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_Parse_internal_25 --> -104($fp) +# PARAM param_a2i_at_Parse_s_0 --> 0($fp) +# local_a2i_at_Parse_internal_25 = PARAM param_a2i_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -104($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_Parse_internal_25 --> -104($fp) +# LOCAL local_a2i_at_Parse_internal_26 --> -108($fp) +# local_a2i_at_Parse_internal_26 = VCALL local_a2i_at_Parse_internal_25 length +# Save new self pointer in $s1 +lw $s1, -104($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 20($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -108($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_Parse_internal_27 --> -112($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -112($fp) +# LOCAL local_a2i_at_Parse_internal_24 --> -100($fp) +# LOCAL local_a2i_at_Parse_internal_26 --> -108($fp) +# LOCAL local_a2i_at_Parse_internal_27 --> -112($fp) +# local_a2i_at_Parse_internal_24 = local_a2i_at_Parse_internal_26 - local_a2i_at_Parse_internal_27 +lw $t1, -108($fp) +lw $t0, 12($t1) +lw $t1, -112($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -100($fp) +# ARG local_a2i_at_Parse_internal_24 +# LOCAL local_a2i_at_Parse_internal_24 --> -100($fp) +lw $t0, -100($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_Parse_internal_21 --> -88($fp) +# LOCAL local_a2i_at_Parse_internal_22 --> -92($fp) +# local_a2i_at_Parse_internal_22 = VCALL local_a2i_at_Parse_internal_21 substr +# Save new self pointer in $s1 +lw $s1, -88($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -92($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_at_Parse_internal_22 +# LOCAL local_a2i_at_Parse_internal_22 --> -92($fp) +lw $t0, -92($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_Parse_internal_18 --> -76($fp) +# LOCAL local_a2i_at_Parse_internal_19 --> -80($fp) +# local_a2i_at_Parse_internal_19 = VCALL local_a2i_at_Parse_internal_18 a2i_aux +# Save new self pointer in $s1 +lw $s1, -76($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 44($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -80($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_Parse_internal_17 --> -72($fp) +# LOCAL local_a2i_at_Parse_internal_19 --> -80($fp) +lw $t0, -80($fp) +lw $t0, 12($t0) +not $t0, $t0 +add $t0, $t0, 1 +sw $t0, -72($fp) +# LOCAL local_a2i_at_Parse_internal_17 --> -72($fp) +# LOCAL local_a2i_at_Parse_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +lw $t0, -72($fp) +sw $t0, 12($v0) +sw $v0, -72($fp) +# LOCAL local_a2i_at_Parse_internal_9 --> -40($fp) +# LOCAL local_a2i_at_Parse_internal_17 --> -72($fp) +# local_a2i_at_Parse_internal_9 = local_a2i_at_Parse_internal_17 +lw $t0, -72($fp) +sw $t0, -40($fp) +# GOTO label_ENDIF_150 +j label_ENDIF_150 +label_FALSEIF_149: + # LOCAL local_a2i_at_Parse_internal_32 --> -132($fp) + # PARAM param_a2i_at_Parse_s_0 --> 0($fp) + # local_a2i_at_Parse_internal_32 = PARAM param_a2i_at_Parse_s_0 + lw $t0, 0($fp) + sw $t0, -132($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_Parse_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -140($fp) + # ARG local_a2i_at_Parse_internal_34 + # LOCAL local_a2i_at_Parse_internal_34 --> -140($fp) + lw $t0, -140($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_Parse_internal_35 --> -144($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -144($fp) + # ARG local_a2i_at_Parse_internal_35 + # LOCAL local_a2i_at_Parse_internal_35 --> -144($fp) + lw $t0, -144($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_Parse_internal_32 --> -132($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # local_a2i_at_Parse_internal_33 = VCALL local_a2i_at_Parse_internal_32 substr + # Save new self pointer in $s1 + lw $s1, -132($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -136($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_17 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -148($fp) + # IF_ZERO local_a2i_at_Parse_internal_33 GOTO label_FALSE_161 + # IF_ZERO local_a2i_at_Parse_internal_33 GOTO label_FALSE_161 + lw $t0, -136($fp) + beq $t0, 0, label_FALSE_161 + # IF_ZERO local_a2i_at_Parse_internal_36 GOTO label_FALSE_161 + # IF_ZERO local_a2i_at_Parse_internal_36 GOTO label_FALSE_161 + lw $t0, -148($fp) + beq $t0, 0, label_FALSE_161 + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # Comparing -136($fp) type with String + la $v0, String + lw $a0, -136($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_STRING_164 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_STRING_164 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_STRING_164 + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # Comparing -136($fp) type with Bool + la $v0, Bool + lw $a0, -136($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_BY_VALUE_165 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_BY_VALUE_165 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_165 + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # Comparing -136($fp) type with Int + la $v0, Int + lw $a0, -136($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_BY_VALUE_165 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_BY_VALUE_165 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_165 + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) + # Load pointers and SUB + lw $a0, -136($fp) + lw $a1, -148($fp) + sub $a0, $a0, $a1 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_162 + # GOTO label_FALSE_161 + j label_FALSE_161 + label_COMPARE_BY_VALUE_165: + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) + lw $a0, -136($fp) + lw $a1, -148($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_162 + # GOTO label_FALSE_161 + j label_FALSE_161 + label_COMPARE_STRING_164: + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) + # Load strings for comparison + lw $v0, -136($fp) + lw $v1, -148($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_CONTINUE_166 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_CONTINUE_166 + lw $t0, -128($fp) + beq $t0, 0, label_CONTINUE_166 + # GOTO label_FALSE_161 + j label_FALSE_161 + label_CONTINUE_166: + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -136($fp) + lw $v1, -148($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_167: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_168 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_167 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_168: + # Store result + sw $a2, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_162 + label_FALSE_161: + # LOCAL local_a2i_at_Parse_internal_30 --> -124($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -124($fp) + # GOTO label_END_163 +j label_END_163 +label_TRUE_162: + # LOCAL local_a2i_at_Parse_internal_30 --> -124($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -124($fp) + label_END_163: +# LOCAL local_a2i_at_Parse_internal_28 --> -116($fp) +# LOCAL local_a2i_at_Parse_internal_30 --> -124($fp) +# Obtain value from -124($fp) +lw $v0, -124($fp) +lw $v0, 12($v0) +sw $v0, -116($fp) +# IF_ZERO local_a2i_at_Parse_internal_28 GOTO label_FALSEIF_159 +# IF_ZERO local_a2i_at_Parse_internal_28 GOTO label_FALSEIF_159 +lw $t0, -116($fp) +beq $t0, 0, label_FALSEIF_159 +# LOCAL local_a2i_at_Parse_internal_39 --> -160($fp) +# local_a2i_at_Parse_internal_39 = SELF +sw $s1, -160($fp) +# LOCAL local_a2i_at_Parse_internal_37 --> -152($fp) +# LOCAL local_a2i_at_Parse_internal_39 --> -160($fp) +# local_a2i_at_Parse_internal_37 = local_a2i_at_Parse_internal_39 +lw $t0, -160($fp) +sw $t0, -152($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_Parse_internal_40 --> -164($fp) +# PARAM param_a2i_at_Parse_s_0 --> 0($fp) +# local_a2i_at_Parse_internal_40 = PARAM param_a2i_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -164($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_Parse_internal_42 --> -172($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -172($fp) +# ARG local_a2i_at_Parse_internal_42 +# LOCAL local_a2i_at_Parse_internal_42 --> -172($fp) +lw $t0, -172($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_Parse_internal_44 --> -180($fp) +# PARAM param_a2i_at_Parse_s_0 --> 0($fp) +# local_a2i_at_Parse_internal_44 = PARAM param_a2i_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -180($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_Parse_internal_44 --> -180($fp) +# LOCAL local_a2i_at_Parse_internal_45 --> -184($fp) +# local_a2i_at_Parse_internal_45 = VCALL local_a2i_at_Parse_internal_44 length +# Save new self pointer in $s1 +lw $s1, -180($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 20($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -184($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_Parse_internal_46 --> -188($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -188($fp) +# LOCAL local_a2i_at_Parse_internal_43 --> -176($fp) +# LOCAL local_a2i_at_Parse_internal_45 --> -184($fp) +# LOCAL local_a2i_at_Parse_internal_46 --> -188($fp) +# local_a2i_at_Parse_internal_43 = local_a2i_at_Parse_internal_45 - local_a2i_at_Parse_internal_46 +lw $t1, -184($fp) +lw $t0, 12($t1) +lw $t1, -188($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -176($fp) +# ARG local_a2i_at_Parse_internal_43 +# LOCAL local_a2i_at_Parse_internal_43 --> -176($fp) +lw $t0, -176($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_Parse_internal_40 --> -164($fp) +# LOCAL local_a2i_at_Parse_internal_41 --> -168($fp) +# local_a2i_at_Parse_internal_41 = VCALL local_a2i_at_Parse_internal_40 substr +# Save new self pointer in $s1 +lw $s1, -164($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -168($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_at_Parse_internal_41 +# LOCAL local_a2i_at_Parse_internal_41 --> -168($fp) +lw $t0, -168($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_Parse_internal_37 --> -152($fp) +# LOCAL local_a2i_at_Parse_internal_38 --> -156($fp) +# local_a2i_at_Parse_internal_38 = VCALL local_a2i_at_Parse_internal_37 a2i +# Save new self pointer in $s1 +lw $s1, -152($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 40($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -156($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_Parse_internal_29 --> -120($fp) +# LOCAL local_a2i_at_Parse_internal_38 --> -156($fp) +# local_a2i_at_Parse_internal_29 = local_a2i_at_Parse_internal_38 +lw $t0, -156($fp) +sw $t0, -120($fp) +# GOTO label_ENDIF_160 +j label_ENDIF_160 +label_FALSEIF_159: + # LOCAL local_a2i_at_Parse_internal_49 --> -200($fp) + # local_a2i_at_Parse_internal_49 = SELF + sw $s1, -200($fp) + # LOCAL local_a2i_at_Parse_internal_47 --> -192($fp) + # LOCAL local_a2i_at_Parse_internal_49 --> -200($fp) + # local_a2i_at_Parse_internal_47 = local_a2i_at_Parse_internal_49 + lw $t0, -200($fp) + sw $t0, -192($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_a2i_at_Parse_s_0 + # PARAM param_a2i_at_Parse_s_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_Parse_internal_47 --> -192($fp) + # LOCAL local_a2i_at_Parse_internal_48 --> -196($fp) + # local_a2i_at_Parse_internal_48 = VCALL local_a2i_at_Parse_internal_47 a2i_aux + # Save new self pointer in $s1 + lw $s1, -192($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -196($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_Parse_internal_29 --> -120($fp) + # LOCAL local_a2i_at_Parse_internal_48 --> -196($fp) + # local_a2i_at_Parse_internal_29 = local_a2i_at_Parse_internal_48 + lw $t0, -196($fp) + sw $t0, -120($fp) + label_ENDIF_160: +# LOCAL local_a2i_at_Parse_internal_9 --> -40($fp) +# LOCAL local_a2i_at_Parse_internal_29 --> -120($fp) +# local_a2i_at_Parse_internal_9 = local_a2i_at_Parse_internal_29 +lw $t0, -120($fp) +sw $t0, -40($fp) +label_ENDIF_150: +# LOCAL local_a2i_at_Parse_internal_1 --> -8($fp) +# LOCAL local_a2i_at_Parse_internal_9 --> -40($fp) +# local_a2i_at_Parse_internal_1 = local_a2i_at_Parse_internal_9 +lw $t0, -40($fp) +sw $t0, -8($fp) +label_ENDIF_140: +# RETURN local_a2i_at_Parse_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_a2i_at_Parse. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 208 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_aux_at_Parse implementation. +# @Params: +# 0($fp) = param_a2i_aux_at_Parse_s_0 +function_a2i_aux_at_Parse: + # Allocate stack frame for function function_a2i_aux_at_Parse. + subu $sp, $sp, 240 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 240 + # LOCAL local_a2i_aux_at_Parse_int_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_a2i_aux_at_Parse_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_a2i_aux_at_Parse_int_0 --> -4($fp) + # LOCAL local_a2i_aux_at_Parse_internal_1 --> -8($fp) + # local_a2i_aux_at_Parse_int_0 = local_a2i_aux_at_Parse_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_a2i_aux_at_Parse_internal_3 --> -16($fp) + # PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) + # local_a2i_aux_at_Parse_internal_3 = PARAM param_a2i_aux_at_Parse_s_0 + lw $t0, 0($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_aux_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_aux_at_Parse_internal_4 --> -20($fp) + # local_a2i_aux_at_Parse_internal_4 = VCALL local_a2i_aux_at_Parse_internal_3 length + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + # LOCAL local_a2i_aux_at_Parse_internal_4 --> -20($fp) + # local_a2i_aux_at_Parse_j_2 = local_a2i_aux_at_Parse_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # LOCAL local_a2i_aux_at_Parse_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_internal_6 --> -28($fp) + # local_a2i_aux_at_Parse_i_5 = local_a2i_aux_at_Parse_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + label_WHILE_169: + # LOCAL local_a2i_aux_at_Parse_internal_8 --> -36($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + lw $a0, -24($fp) + lw $a1, -12($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -36($fp) + # IF_GREATER_ZERO local_a2i_aux_at_Parse_internal_8 GOTO label_FALSE_171 + # IF_GREATER_ZERO local_a2i_aux_at_Parse_internal_8 GOTO label_FALSE_171 + lw $t0, -36($fp) + bgt $t0, 0, label_FALSE_171 + # IF_ZERO local_a2i_aux_at_Parse_internal_8 GOTO label_FALSE_171 + # IF_ZERO local_a2i_aux_at_Parse_internal_8 GOTO label_FALSE_171 + lw $t0, -36($fp) + beq $t0, 0, label_FALSE_171 + # LOCAL local_a2i_aux_at_Parse_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_172 +j label_END_172 +label_FALSE_171: + # LOCAL local_a2i_aux_at_Parse_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_172: +# LOCAL local_a2i_aux_at_Parse_internal_7 --> -32($fp) +# LOCAL local_a2i_aux_at_Parse_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_7 GOTO label_WHILE_END_170 +# IF_ZERO local_a2i_aux_at_Parse_internal_7 GOTO label_WHILE_END_170 +lw $t0, -32($fp) +beq $t0, 0, label_WHILE_END_170 +# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_0 +sw $t0, 12($v0) +li $t0, 0 +sw $t0, 16($v0) +sw $v0, -40($fp) +# LOCAL local_a2i_aux_at_Parse_internal_10 --> -44($fp) +# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) +# local_a2i_aux_at_Parse_internal_10 = PARAM param_a2i_aux_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -44($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_a2i_aux_at_Parse_i_5 +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +lw $t0, -24($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_12 --> -52($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -52($fp) +# ARG local_a2i_aux_at_Parse_internal_12 +# LOCAL local_a2i_aux_at_Parse_internal_12 --> -52($fp) +lw $t0, -52($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_10 --> -44($fp) +# LOCAL local_a2i_aux_at_Parse_internal_11 --> -48($fp) +# local_a2i_aux_at_Parse_internal_11 = VCALL local_a2i_aux_at_Parse_internal_10 substr +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) +# LOCAL local_a2i_aux_at_Parse_internal_11 --> -48($fp) +# local_a2i_aux_at_Parse_c_9 = local_a2i_aux_at_Parse_internal_11 +lw $t0, -48($fp) +sw $t0, -40($fp) +# LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_18 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -72($fp) +# IF_ZERO local_a2i_aux_at_Parse_c_9 GOTO label_FALSE_175 +# IF_ZERO local_a2i_aux_at_Parse_c_9 GOTO label_FALSE_175 +lw $t0, -40($fp) +beq $t0, 0, label_FALSE_175 +# IF_ZERO local_a2i_aux_at_Parse_internal_17 GOTO label_FALSE_175 +# IF_ZERO local_a2i_aux_at_Parse_internal_17 GOTO label_FALSE_175 +lw $t0, -72($fp) +beq $t0, 0, label_FALSE_175 +# LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) +# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) +# Comparing -40($fp) type with String +la $v0, String +lw $a0, -40($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -68($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_STRING_178 +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_STRING_178 +lw $t0, -68($fp) +beq $t0, 0, label_COMPARE_STRING_178 +# LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) +# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) +# Comparing -40($fp) type with Bool +la $v0, Bool +lw $a0, -40($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -68($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_BY_VALUE_179 +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_BY_VALUE_179 +lw $t0, -68($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_179 +# LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) +# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) +# Comparing -40($fp) type with Int +la $v0, Int +lw $a0, -40($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -68($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_BY_VALUE_179 +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_BY_VALUE_179 +lw $t0, -68($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_179 +# LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) +# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) +# LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) +# Load pointers and SUB +lw $a0, -40($fp) +lw $a1, -72($fp) +sub $a0, $a0, $a1 +sw $a0, -68($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 +lw $t0, -68($fp) +beq $t0, 0, label_TRUE_176 +# GOTO label_FALSE_175 +j label_FALSE_175 +label_COMPARE_BY_VALUE_179: + # LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) + lw $a0, -40($fp) + lw $a1, -72($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -68($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 + # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 + lw $t0, -68($fp) + beq $t0, 0, label_TRUE_176 + # GOTO label_FALSE_175 + j label_FALSE_175 + label_COMPARE_STRING_178: + # LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) + # Load strings for comparison + lw $v0, -40($fp) + lw $v1, -72($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -68($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_CONTINUE_180 + # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_CONTINUE_180 + lw $t0, -68($fp) + beq $t0, 0, label_CONTINUE_180 + # GOTO label_FALSE_175 + j label_FALSE_175 + label_CONTINUE_180: + # LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -40($fp) + lw $v1, -72($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_181: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_182 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_181 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_182: + # Store result + sw $a2, -68($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 + # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 + lw $t0, -68($fp) + beq $t0, 0, label_TRUE_176 + label_FALSE_175: + # LOCAL local_a2i_aux_at_Parse_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -64($fp) + # GOTO label_END_177 +j label_END_177 +label_TRUE_176: + # LOCAL local_a2i_aux_at_Parse_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -64($fp) + label_END_177: +# LOCAL local_a2i_aux_at_Parse_internal_13 --> -56($fp) +# LOCAL local_a2i_aux_at_Parse_internal_15 --> -64($fp) +# Obtain value from -64($fp) +lw $v0, -64($fp) +lw $v0, 12($v0) +sw $v0, -56($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_13 GOTO label_FALSEIF_173 +# IF_ZERO local_a2i_aux_at_Parse_internal_13 GOTO label_FALSEIF_173 +lw $t0, -56($fp) +beq $t0, 0, label_FALSEIF_173 +# LOCAL local_a2i_aux_at_Parse_internal_18 --> -76($fp) +# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) +# local_a2i_aux_at_Parse_internal_18 = PARAM param_a2i_aux_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -76($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_21 --> -88($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -88($fp) +# LOCAL local_a2i_aux_at_Parse_internal_20 --> -84($fp) +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +# LOCAL local_a2i_aux_at_Parse_internal_21 --> -88($fp) +# local_a2i_aux_at_Parse_internal_20 = local_a2i_aux_at_Parse_i_5 + local_a2i_aux_at_Parse_internal_21 +lw $t1, -24($fp) +lw $t0, 12($t1) +lw $t1, -88($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -84($fp) +# ARG local_a2i_aux_at_Parse_internal_20 +# LOCAL local_a2i_aux_at_Parse_internal_20 --> -84($fp) +lw $t0, -84($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_24 --> -100($fp) +# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) +# local_a2i_aux_at_Parse_internal_24 = PARAM param_a2i_aux_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -100($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_24 --> -100($fp) +# LOCAL local_a2i_aux_at_Parse_internal_25 --> -104($fp) +# local_a2i_aux_at_Parse_internal_25 = VCALL local_a2i_aux_at_Parse_internal_24 length +# Save new self pointer in $s1 +lw $s1, -100($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 20($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -104($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_aux_at_Parse_internal_23 --> -96($fp) +# LOCAL local_a2i_aux_at_Parse_internal_25 --> -104($fp) +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +# local_a2i_aux_at_Parse_internal_23 = local_a2i_aux_at_Parse_internal_25 - local_a2i_aux_at_Parse_i_5 +lw $t1, -104($fp) +lw $t0, 12($t1) +lw $t1, -24($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -96($fp) +# LOCAL local_a2i_aux_at_Parse_internal_26 --> -108($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -108($fp) +# LOCAL local_a2i_aux_at_Parse_internal_22 --> -92($fp) +# LOCAL local_a2i_aux_at_Parse_internal_23 --> -96($fp) +# LOCAL local_a2i_aux_at_Parse_internal_26 --> -108($fp) +# local_a2i_aux_at_Parse_internal_22 = local_a2i_aux_at_Parse_internal_23 - local_a2i_aux_at_Parse_internal_26 +lw $t1, -96($fp) +lw $t0, 12($t1) +lw $t1, -108($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -92($fp) +# ARG local_a2i_aux_at_Parse_internal_22 +# LOCAL local_a2i_aux_at_Parse_internal_22 --> -92($fp) +lw $t0, -92($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_18 --> -76($fp) +# LOCAL local_a2i_aux_at_Parse_internal_19 --> -80($fp) +# local_a2i_aux_at_Parse_internal_19 = VCALL local_a2i_aux_at_Parse_internal_18 substr +# Save new self pointer in $s1 +lw $s1, -76($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -80($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_a2i_aux_at_Parse_internal_19 --> -80($fp) +lw $t0, -80($fp) +sw $t0, 16($s1) +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +# LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) +# local_a2i_aux_at_Parse_i_5 = local_a2i_aux_at_Parse_j_2 +lw $t0, -12($fp) +sw $t0, -24($fp) +# LOCAL local_a2i_aux_at_Parse_internal_14 --> -60($fp) +# local_a2i_aux_at_Parse_internal_14 = +# GOTO label_ENDIF_174 +j label_ENDIF_174 +label_FALSEIF_173: + # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_19 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -128($fp) + # IF_ZERO local_a2i_aux_at_Parse_c_9 GOTO label_FALSE_185 + # IF_ZERO local_a2i_aux_at_Parse_c_9 GOTO label_FALSE_185 + lw $t0, -40($fp) + beq $t0, 0, label_FALSE_185 + # IF_ZERO local_a2i_aux_at_Parse_internal_31 GOTO label_FALSE_185 + # IF_ZERO local_a2i_aux_at_Parse_internal_31 GOTO label_FALSE_185 + lw $t0, -128($fp) + beq $t0, 0, label_FALSE_185 + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # Comparing -40($fp) type with String + la $v0, String + lw $a0, -40($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_STRING_188 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_STRING_188 + lw $t0, -124($fp) + beq $t0, 0, label_COMPARE_STRING_188 + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # Comparing -40($fp) type with Bool + la $v0, Bool + lw $a0, -40($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_BY_VALUE_189 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_BY_VALUE_189 + lw $t0, -124($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_189 + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # Comparing -40($fp) type with Int + la $v0, Int + lw $a0, -40($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_BY_VALUE_189 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_BY_VALUE_189 + lw $t0, -124($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_189 + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) + # Load pointers and SUB + lw $a0, -40($fp) + lw $a1, -128($fp) + sub $a0, $a0, $a1 + sw $a0, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 + lw $t0, -124($fp) + beq $t0, 0, label_TRUE_186 + # GOTO label_FALSE_185 + j label_FALSE_185 + label_COMPARE_BY_VALUE_189: + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) + lw $a0, -40($fp) + lw $a1, -128($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 + lw $t0, -124($fp) + beq $t0, 0, label_TRUE_186 + # GOTO label_FALSE_185 + j label_FALSE_185 + label_COMPARE_STRING_188: + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) + # Load strings for comparison + lw $v0, -40($fp) + lw $v1, -128($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_CONTINUE_190 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_CONTINUE_190 + lw $t0, -124($fp) + beq $t0, 0, label_CONTINUE_190 + # GOTO label_FALSE_185 + j label_FALSE_185 + label_CONTINUE_190: + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -40($fp) + lw $v1, -128($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_191: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_192 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_191 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_192: + # Store result + sw $a2, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 + lw $t0, -124($fp) + beq $t0, 0, label_TRUE_186 + label_FALSE_185: + # LOCAL local_a2i_aux_at_Parse_internal_29 --> -120($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -120($fp) + # GOTO label_END_187 +j label_END_187 +label_TRUE_186: + # LOCAL local_a2i_aux_at_Parse_internal_29 --> -120($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -120($fp) + label_END_187: +# LOCAL local_a2i_aux_at_Parse_internal_27 --> -112($fp) +# LOCAL local_a2i_aux_at_Parse_internal_29 --> -120($fp) +# Obtain value from -120($fp) +lw $v0, -120($fp) +lw $v0, 12($v0) +sw $v0, -112($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_27 GOTO label_FALSEIF_183 +# IF_ZERO local_a2i_aux_at_Parse_internal_27 GOTO label_FALSEIF_183 +lw $t0, -112($fp) +beq $t0, 0, label_FALSEIF_183 +# LOCAL local_a2i_aux_at_Parse_internal_32 --> -132($fp) +# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) +# local_a2i_aux_at_Parse_internal_32 = PARAM param_a2i_aux_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -132($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_35 --> -144($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -144($fp) +# LOCAL local_a2i_aux_at_Parse_internal_34 --> -140($fp) +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +# LOCAL local_a2i_aux_at_Parse_internal_35 --> -144($fp) +# local_a2i_aux_at_Parse_internal_34 = local_a2i_aux_at_Parse_i_5 + local_a2i_aux_at_Parse_internal_35 +lw $t1, -24($fp) +lw $t0, 12($t1) +lw $t1, -144($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -140($fp) +# ARG local_a2i_aux_at_Parse_internal_34 +# LOCAL local_a2i_aux_at_Parse_internal_34 --> -140($fp) +lw $t0, -140($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_38 --> -156($fp) +# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) +# local_a2i_aux_at_Parse_internal_38 = PARAM param_a2i_aux_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -156($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_38 --> -156($fp) +# LOCAL local_a2i_aux_at_Parse_internal_39 --> -160($fp) +# local_a2i_aux_at_Parse_internal_39 = VCALL local_a2i_aux_at_Parse_internal_38 length +# Save new self pointer in $s1 +lw $s1, -156($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 20($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -160($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_aux_at_Parse_internal_37 --> -152($fp) +# LOCAL local_a2i_aux_at_Parse_internal_39 --> -160($fp) +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +# local_a2i_aux_at_Parse_internal_37 = local_a2i_aux_at_Parse_internal_39 - local_a2i_aux_at_Parse_i_5 +lw $t1, -160($fp) +lw $t0, 12($t1) +lw $t1, -24($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -152($fp) +# LOCAL local_a2i_aux_at_Parse_internal_40 --> -164($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -164($fp) +# LOCAL local_a2i_aux_at_Parse_internal_36 --> -148($fp) +# LOCAL local_a2i_aux_at_Parse_internal_37 --> -152($fp) +# LOCAL local_a2i_aux_at_Parse_internal_40 --> -164($fp) +# local_a2i_aux_at_Parse_internal_36 = local_a2i_aux_at_Parse_internal_37 - local_a2i_aux_at_Parse_internal_40 +lw $t1, -152($fp) +lw $t0, 12($t1) +lw $t1, -164($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -148($fp) +# ARG local_a2i_aux_at_Parse_internal_36 +# LOCAL local_a2i_aux_at_Parse_internal_36 --> -148($fp) +lw $t0, -148($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_32 --> -132($fp) +# LOCAL local_a2i_aux_at_Parse_internal_33 --> -136($fp) +# local_a2i_aux_at_Parse_internal_33 = VCALL local_a2i_aux_at_Parse_internal_32 substr +# Save new self pointer in $s1 +lw $s1, -132($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -136($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_a2i_aux_at_Parse_internal_33 --> -136($fp) +lw $t0, -136($fp) +sw $t0, 16($s1) +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +# LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) +# local_a2i_aux_at_Parse_i_5 = local_a2i_aux_at_Parse_j_2 +lw $t0, -12($fp) +sw $t0, -24($fp) +# LOCAL local_a2i_aux_at_Parse_internal_28 --> -116($fp) +# local_a2i_aux_at_Parse_internal_28 = +# GOTO label_ENDIF_184 +j label_ENDIF_184 +label_FALSEIF_183: + # LOCAL local_a2i_aux_at_Parse_internal_43 --> -176($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 10 + sw $t0, 12($v0) + sw $v0, -176($fp) + # LOCAL local_a2i_aux_at_Parse_internal_42 --> -172($fp) + # LOCAL local_a2i_aux_at_Parse_int_0 --> -4($fp) + # LOCAL local_a2i_aux_at_Parse_internal_43 --> -176($fp) + # local_a2i_aux_at_Parse_internal_42 = local_a2i_aux_at_Parse_int_0 * local_a2i_aux_at_Parse_internal_43 + lw $t1, -4($fp) + lw $t0, 12($t1) + lw $t1, -176($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -172($fp) + # LOCAL local_a2i_aux_at_Parse_internal_46 --> -188($fp) + # local_a2i_aux_at_Parse_internal_46 = SELF + sw $s1, -188($fp) + # LOCAL local_a2i_aux_at_Parse_internal_44 --> -180($fp) + # LOCAL local_a2i_aux_at_Parse_internal_46 --> -188($fp) + # local_a2i_aux_at_Parse_internal_44 = local_a2i_aux_at_Parse_internal_46 + lw $t0, -188($fp) + sw $t0, -180($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_aux_at_Parse_internal_47 --> -192($fp) + # PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) + # local_a2i_aux_at_Parse_internal_47 = PARAM param_a2i_aux_at_Parse_s_0 + lw $t0, 0($fp) + sw $t0, -192($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_a2i_aux_at_Parse_i_5 + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_aux_at_Parse_internal_49 --> -200($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -200($fp) + # ARG local_a2i_aux_at_Parse_internal_49 + # LOCAL local_a2i_aux_at_Parse_internal_49 --> -200($fp) + lw $t0, -200($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_aux_at_Parse_internal_47 --> -192($fp) + # LOCAL local_a2i_aux_at_Parse_internal_48 --> -196($fp) + # local_a2i_aux_at_Parse_internal_48 = VCALL local_a2i_aux_at_Parse_internal_47 substr + # Save new self pointer in $s1 + lw $s1, -192($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -196($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_a2i_aux_at_Parse_internal_48 + # LOCAL local_a2i_aux_at_Parse_internal_48 --> -196($fp) + lw $t0, -196($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_aux_at_Parse_internal_44 --> -180($fp) + # LOCAL local_a2i_aux_at_Parse_internal_45 --> -184($fp) + # local_a2i_aux_at_Parse_internal_45 = VCALL local_a2i_aux_at_Parse_internal_44 c2i + # Save new self pointer in $s1 + lw $s1, -180($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 36($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -184($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_aux_at_Parse_internal_41 --> -168($fp) + # LOCAL local_a2i_aux_at_Parse_internal_42 --> -172($fp) + # LOCAL local_a2i_aux_at_Parse_internal_45 --> -184($fp) + # local_a2i_aux_at_Parse_internal_41 = local_a2i_aux_at_Parse_internal_42 + local_a2i_aux_at_Parse_internal_45 + lw $t1, -172($fp) + lw $t0, 12($t1) + lw $t1, -184($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -168($fp) + # LOCAL local_a2i_aux_at_Parse_int_0 --> -4($fp) + # LOCAL local_a2i_aux_at_Parse_internal_41 --> -168($fp) + # local_a2i_aux_at_Parse_int_0 = local_a2i_aux_at_Parse_internal_41 + lw $t0, -168($fp) + sw $t0, -4($fp) + # LOCAL local_a2i_aux_at_Parse_internal_51 --> -208($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -208($fp) + # LOCAL local_a2i_aux_at_Parse_internal_50 --> -204($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_internal_51 --> -208($fp) + # local_a2i_aux_at_Parse_internal_50 = local_a2i_aux_at_Parse_i_5 + local_a2i_aux_at_Parse_internal_51 + lw $t1, -24($fp) + lw $t0, 12($t1) + lw $t1, -208($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -204($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_internal_50 --> -204($fp) + # local_a2i_aux_at_Parse_i_5 = local_a2i_aux_at_Parse_internal_50 + lw $t0, -204($fp) + sw $t0, -24($fp) + # IF_ZERO local_a2i_aux_at_Parse_i_5 GOTO label_FALSE_195 + # IF_ZERO local_a2i_aux_at_Parse_i_5 GOTO label_FALSE_195 + lw $t0, -24($fp) + beq $t0, 0, label_FALSE_195 + # IF_ZERO local_a2i_aux_at_Parse_j_2 GOTO label_FALSE_195 + # IF_ZERO local_a2i_aux_at_Parse_j_2 GOTO label_FALSE_195 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_195 + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # Comparing -24($fp) type with String + la $v0, String + lw $a0, -24($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_STRING_198 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_STRING_198 + lw $t0, -224($fp) + beq $t0, 0, label_COMPARE_STRING_198 + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # Comparing -24($fp) type with Bool + la $v0, Bool + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_BY_VALUE_199 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_BY_VALUE_199 + lw $t0, -224($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_199 + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # Comparing -24($fp) type with Int + la $v0, Int + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_BY_VALUE_199 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_BY_VALUE_199 + lw $t0, -224($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_199 + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + # Load pointers and SUB + lw $a0, -24($fp) + lw $a1, -12($fp) + sub $a0, $a0, $a1 + sw $a0, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 + lw $t0, -224($fp) + beq $t0, 0, label_TRUE_196 + # GOTO label_FALSE_195 + j label_FALSE_195 + label_COMPARE_BY_VALUE_199: + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + lw $a0, -24($fp) + lw $a1, -12($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 + lw $t0, -224($fp) + beq $t0, 0, label_TRUE_196 + # GOTO label_FALSE_195 + j label_FALSE_195 + label_COMPARE_STRING_198: + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -12($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_CONTINUE_200 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_CONTINUE_200 + lw $t0, -224($fp) + beq $t0, 0, label_CONTINUE_200 + # GOTO label_FALSE_195 + j label_FALSE_195 + label_CONTINUE_200: + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -12($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_201: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_202 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_201 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_202: + # Store result + sw $a2, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 + lw $t0, -224($fp) + beq $t0, 0, label_TRUE_196 + label_FALSE_195: + # LOCAL local_a2i_aux_at_Parse_internal_54 --> -220($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -220($fp) + # GOTO label_END_197 +j label_END_197 +label_TRUE_196: + # LOCAL local_a2i_aux_at_Parse_internal_54 --> -220($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -220($fp) + label_END_197: +# LOCAL local_a2i_aux_at_Parse_internal_52 --> -212($fp) +# LOCAL local_a2i_aux_at_Parse_internal_54 --> -220($fp) +# Obtain value from -220($fp) +lw $v0, -220($fp) +lw $v0, 12($v0) +sw $v0, -212($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_52 GOTO label_FALSEIF_193 +# IF_ZERO local_a2i_aux_at_Parse_internal_52 GOTO label_FALSEIF_193 +lw $t0, -212($fp) +beq $t0, 0, label_FALSEIF_193 +# LOCAL local_a2i_aux_at_Parse_internal_56 --> -228($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_20 +sw $t0, 12($v0) +li $t0, 0 +sw $t0, 16($v0) +sw $v0, -228($fp) +# +# LOCAL local_a2i_aux_at_Parse_internal_56 --> -228($fp) +lw $t0, -228($fp) +sw $t0, 16($s1) +# LOCAL local_a2i_aux_at_Parse_internal_53 --> -216($fp) +# local_a2i_aux_at_Parse_internal_53 = +# GOTO label_ENDIF_194 +j label_ENDIF_194 +label_FALSEIF_193: + # LOCAL local_a2i_aux_at_Parse_internal_57 --> -232($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_21 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -232($fp) + # LOCAL local_a2i_aux_at_Parse_internal_53 --> -216($fp) + # LOCAL local_a2i_aux_at_Parse_internal_57 --> -232($fp) + # local_a2i_aux_at_Parse_internal_53 = local_a2i_aux_at_Parse_internal_57 + lw $t0, -232($fp) + sw $t0, -216($fp) + label_ENDIF_194: +# LOCAL local_a2i_aux_at_Parse_internal_28 --> -116($fp) +# LOCAL local_a2i_aux_at_Parse_internal_53 --> -216($fp) +# local_a2i_aux_at_Parse_internal_28 = local_a2i_aux_at_Parse_internal_53 +lw $t0, -216($fp) +sw $t0, -116($fp) +label_ENDIF_184: +# LOCAL local_a2i_aux_at_Parse_internal_14 --> -60($fp) +# LOCAL local_a2i_aux_at_Parse_internal_28 --> -116($fp) +# local_a2i_aux_at_Parse_internal_14 = local_a2i_aux_at_Parse_internal_28 +lw $t0, -116($fp) +sw $t0, -60($fp) +label_ENDIF_174: +# GOTO label_WHILE_169 +j label_WHILE_169 +label_WHILE_END_170: + # RETURN local_a2i_aux_at_Parse_int_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_a2i_aux_at_Parse. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 240 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# __Main__attrib__g__init implementation. +# @Params: +__Main__attrib__g__init: + # Allocate stack frame for function __Main__attrib__g__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # local_ttrib__g__init_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # local_ttrib__g__init_internal_1 = local_ttrib__g__init_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) + # local_ttrib__g__init_internal_2 = VCALL local_ttrib__g__init_internal_1 read_input + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_ttrib__g__init_internal_2 + lw $v0, -12($fp) + # Deallocate stack frame for function __Main__attrib__g__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_main_at_Main_internal_2 = GETATTRIBUTE g Main + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + lw $t0, 20($s1) + sw $t0, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 print_V + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_main_at_Main_internal_5 = GETATTRIBUTE g Main + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t0, 20($s1) + sw $t0, -24($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 print_E + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_4 + lw $v0, -20($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __VList__attrib__car__init implementation. +# @Params: +__VList__attrib__car__init: + # Allocate stack frame for function __VList__attrib__car__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __VList__attrib__car__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_VList implementation. +# @Params: +function_isNil_at_VList: + # Allocate stack frame for function function_isNil_at_VList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_VList_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_isNil_at_VList_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_VList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_head_at_VList implementation. +# @Params: +function_head_at_VList: + # Allocate stack frame for function function_head_at_VList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_head_at_VList_internal_2 --> -12($fp) + # local_head_at_VList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_head_at_VList_internal_0 --> -4($fp) + # LOCAL local_head_at_VList_internal_2 --> -12($fp) + # local_head_at_VList_internal_0 = local_head_at_VList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_head_at_VList_internal_0 --> -4($fp) + # LOCAL local_head_at_VList_internal_1 --> -8($fp) + # local_head_at_VList_internal_1 = VCALL local_head_at_VList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_head_at_VList_internal_3 = GETATTRIBUTE car VList + # LOCAL local_head_at_VList_internal_3 --> -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) + # RETURN local_head_at_VList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_head_at_VList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_tail_at_VList implementation. +# @Params: +function_tail_at_VList: + # Allocate stack frame for function function_tail_at_VList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_tail_at_VList_internal_2 --> -12($fp) + # local_tail_at_VList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_tail_at_VList_internal_0 --> -4($fp) + # LOCAL local_tail_at_VList_internal_2 --> -12($fp) + # local_tail_at_VList_internal_0 = local_tail_at_VList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_tail_at_VList_internal_0 --> -4($fp) + # LOCAL local_tail_at_VList_internal_1 --> -8($fp) + # local_tail_at_VList_internal_1 = VCALL local_tail_at_VList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_tail_at_VList_internal_3 --> -16($fp) + # local_tail_at_VList_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_tail_at_VList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_tail_at_VList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cons_at_VList implementation. +# @Params: +# 0($fp) = param_cons_at_VList_v_0 +function_cons_at_VList: + # Allocate stack frame for function function_cons_at_VList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cons_at_VList_internal_2 --> -12($fp) + # local_cons_at_VList_internal_2 = ALLOCATE VCons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, VCons + sw $t0, 12($v0) + li $t0, 5 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, VCons_start + sw $t0, 4($v0) + # Load type offset + li $t0, 40 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __VList__attrib__car__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __VCons__attrib__cdr__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -12($fp) + # LOCAL local_cons_at_VList_internal_0 --> -4($fp) + # LOCAL local_cons_at_VList_internal_2 --> -12($fp) + # local_cons_at_VList_internal_0 = local_cons_at_VList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cons_at_VList_v_0 + # PARAM param_cons_at_VList_v_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cons_at_VList_internal_3 --> -16($fp) + # local_cons_at_VList_internal_3 = SELF + sw $s1, -16($fp) + # ARG local_cons_at_VList_internal_3 + # LOCAL local_cons_at_VList_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cons_at_VList_internal_0 --> -4($fp) + # LOCAL local_cons_at_VList_internal_1 --> -8($fp) + # local_cons_at_VList_internal_1 = VCALL local_cons_at_VList_internal_0 init + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_cons_at_VList_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_cons_at_VList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_at_VList implementation. +# @Params: +function_print_at_VList: + # Allocate stack frame for function function_print_at_VList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_print_at_VList_internal_2 --> -12($fp) + # local_print_at_VList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_at_VList_internal_0 --> -4($fp) + # LOCAL local_print_at_VList_internal_2 --> -12($fp) + # local_print_at_VList_internal_0 = local_print_at_VList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_VList_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_22 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_print_at_VList_internal_3 + # LOCAL local_print_at_VList_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_VList_internal_0 --> -4($fp) + # LOCAL local_print_at_VList_internal_1 --> -8($fp) + # local_print_at_VList_internal_1 = VCALL local_print_at_VList_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_at_VList_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_print_at_VList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __VCons__attrib__cdr__init implementation. +# @Params: +__VCons__attrib__cdr__init: + # Allocate stack frame for function __VCons__attrib__cdr__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __VCons__attrib__cdr__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_VCons implementation. +# @Params: +function_isNil_at_VCons: + # Allocate stack frame for function function_isNil_at_VCons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_VCons_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_isNil_at_VCons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_VCons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_head_at_VCons implementation. +# @Params: +function_head_at_VCons: + # Allocate stack frame for function function_head_at_VCons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_head_at_VCons_internal_0 = GETATTRIBUTE car VCons + # LOCAL local_head_at_VCons_internal_0 --> -4($fp) + lw $t0, 12($s1) + sw $t0, -4($fp) + # RETURN local_head_at_VCons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_head_at_VCons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_tail_at_VCons implementation. +# @Params: +function_tail_at_VCons: + # Allocate stack frame for function function_tail_at_VCons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_tail_at_VCons_internal_0 = GETATTRIBUTE cdr VCons + # LOCAL local_tail_at_VCons_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_tail_at_VCons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_tail_at_VCons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_VCons implementation. +# @Params: +# 0($fp) = param_init_at_VCons_v_0 +# 4($fp) = param_init_at_VCons_rest_1 +function_init_at_VCons: + # Allocate stack frame for function function_init_at_VCons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_VCons_v_0 --> 4($fp) + lw $t0, 4($fp) + sw $t0, 12($s1) + # + # PARAM param_init_at_VCons_rest_1 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 16($s1) + # LOCAL local_init_at_VCons_internal_0 --> -4($fp) + # local_init_at_VCons_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_VCons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_VCons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_print_at_VCons implementation. +# @Params: +function_print_at_VCons: + # Allocate stack frame for function function_print_at_VCons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_print_at_VCons_internal_2 = GETATTRIBUTE car VCons + # LOCAL local_print_at_VCons_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # LOCAL local_print_at_VCons_internal_0 --> -4($fp) + # LOCAL local_print_at_VCons_internal_2 --> -12($fp) + # local_print_at_VCons_internal_0 = local_print_at_VCons_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_VCons_internal_0 --> -4($fp) + # LOCAL local_print_at_VCons_internal_1 --> -8($fp) + # local_print_at_VCons_internal_1 = VCALL local_print_at_VCons_internal_0 print + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_print_at_VCons_internal_5 = GETATTRIBUTE cdr VCons + # LOCAL local_print_at_VCons_internal_5 --> -24($fp) + lw $t0, 16($s1) + sw $t0, -24($fp) + # LOCAL local_print_at_VCons_internal_3 --> -16($fp) + # LOCAL local_print_at_VCons_internal_5 --> -24($fp) + # local_print_at_VCons_internal_3 = local_print_at_VCons_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_VCons_internal_3 --> -16($fp) + # LOCAL local_print_at_VCons_internal_4 --> -20($fp) + # local_print_at_VCons_internal_4 = VCALL local_print_at_VCons_internal_3 print + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_at_VCons_internal_4 + lw $v0, -20($fp) + # Deallocate stack frame for function function_print_at_VCons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __EList__attrib__car__init implementation. +# @Params: +__EList__attrib__car__init: + # Allocate stack frame for function __EList__attrib__car__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __EList__attrib__car__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_EList implementation. +# @Params: +function_isNil_at_EList: + # Allocate stack frame for function function_isNil_at_EList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_EList_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_isNil_at_EList_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_EList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_head_at_EList implementation. +# @Params: +function_head_at_EList: + # Allocate stack frame for function function_head_at_EList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_head_at_EList_internal_2 --> -12($fp) + # local_head_at_EList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_head_at_EList_internal_0 --> -4($fp) + # LOCAL local_head_at_EList_internal_2 --> -12($fp) + # local_head_at_EList_internal_0 = local_head_at_EList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_head_at_EList_internal_0 --> -4($fp) + # LOCAL local_head_at_EList_internal_1 --> -8($fp) + # local_head_at_EList_internal_1 = VCALL local_head_at_EList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_head_at_EList_internal_3 = GETATTRIBUTE car EList + # LOCAL local_head_at_EList_internal_3 --> -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) + # RETURN local_head_at_EList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_head_at_EList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_tail_at_EList implementation. +# @Params: +function_tail_at_EList: + # Allocate stack frame for function function_tail_at_EList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_tail_at_EList_internal_2 --> -12($fp) + # local_tail_at_EList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_tail_at_EList_internal_0 --> -4($fp) + # LOCAL local_tail_at_EList_internal_2 --> -12($fp) + # local_tail_at_EList_internal_0 = local_tail_at_EList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_tail_at_EList_internal_0 --> -4($fp) + # LOCAL local_tail_at_EList_internal_1 --> -8($fp) + # local_tail_at_EList_internal_1 = VCALL local_tail_at_EList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_tail_at_EList_internal_3 --> -16($fp) + # local_tail_at_EList_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_tail_at_EList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_tail_at_EList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cons_at_EList implementation. +# @Params: +# 0($fp) = param_cons_at_EList_e_0 +function_cons_at_EList: + # Allocate stack frame for function function_cons_at_EList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cons_at_EList_internal_2 --> -12($fp) + # local_cons_at_EList_internal_2 = ALLOCATE ECons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, ECons + sw $t0, 12($v0) + li $t0, 5 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, ECons_start + sw $t0, 4($v0) + # Load type offset + li $t0, 48 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __EList__attrib__car__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __ECons__attrib__cdr__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -12($fp) + # LOCAL local_cons_at_EList_internal_0 --> -4($fp) + # LOCAL local_cons_at_EList_internal_2 --> -12($fp) + # local_cons_at_EList_internal_0 = local_cons_at_EList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cons_at_EList_e_0 + # PARAM param_cons_at_EList_e_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cons_at_EList_internal_3 --> -16($fp) + # local_cons_at_EList_internal_3 = SELF + sw $s1, -16($fp) + # ARG local_cons_at_EList_internal_3 + # LOCAL local_cons_at_EList_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cons_at_EList_internal_0 --> -4($fp) + # LOCAL local_cons_at_EList_internal_1 --> -8($fp) + # local_cons_at_EList_internal_1 = VCALL local_cons_at_EList_internal_0 init + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_cons_at_EList_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_cons_at_EList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_append_at_EList implementation. +# @Params: +# 0($fp) = param_append_at_EList_l_0 +function_append_at_EList: +# Allocate stack frame for function function_append_at_EList. +subu $sp, $sp, 68 +sw $ra, 4($sp) +sw $fp, 0($sp) +addu $fp, $sp, 68 +# LOCAL local_append_at_EList_internal_4 --> -20($fp) +# local_append_at_EList_internal_4 = SELF +sw $s1, -20($fp) +# LOCAL local_append_at_EList_internal_2 --> -12($fp) +# LOCAL local_append_at_EList_internal_4 --> -20($fp) +# local_append_at_EList_internal_2 = local_append_at_EList_internal_4 +lw $t0, -20($fp) +sw $t0, -12($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_append_at_EList_internal_2 --> -12($fp) +# LOCAL local_append_at_EList_internal_3 --> -16($fp) +# local_append_at_EList_internal_3 = VCALL local_append_at_EList_internal_2 isNil +# Save new self pointer in $s1 +lw $s1, -12($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 28($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -16($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_append_at_EList_internal_0 --> -4($fp) +# LOCAL local_append_at_EList_internal_3 --> -16($fp) +# Obtain value from -16($fp) +lw $v0, -16($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_append_at_EList_internal_0 GOTO label_FALSEIF_203 +# IF_ZERO local_append_at_EList_internal_0 GOTO label_FALSEIF_203 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_203 +# LOCAL local_append_at_EList_internal_1 --> -8($fp) +# PARAM param_append_at_EList_l_0 --> 0($fp) +# local_append_at_EList_internal_1 = PARAM param_append_at_EList_l_0 +lw $t0, 0($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_204 +j label_ENDIF_204 +label_FALSEIF_203: + # LOCAL local_append_at_EList_internal_11 --> -48($fp) + # local_append_at_EList_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_append_at_EList_internal_9 --> -40($fp) + # LOCAL local_append_at_EList_internal_11 --> -48($fp) + # local_append_at_EList_internal_9 = local_append_at_EList_internal_11 + lw $t0, -48($fp) + sw $t0, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_append_at_EList_internal_9 --> -40($fp) + # LOCAL local_append_at_EList_internal_10 --> -44($fp) + # local_append_at_EList_internal_10 = VCALL local_append_at_EList_internal_9 tail + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 36($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_append_at_EList_internal_7 --> -32($fp) + # LOCAL local_append_at_EList_internal_10 --> -44($fp) + # local_append_at_EList_internal_7 = local_append_at_EList_internal_10 + lw $t0, -44($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_append_at_EList_l_0 + # PARAM param_append_at_EList_l_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_append_at_EList_internal_7 --> -32($fp) + # LOCAL local_append_at_EList_internal_8 --> -36($fp) + # local_append_at_EList_internal_8 = VCALL local_append_at_EList_internal_7 append + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_append_at_EList_internal_5 --> -24($fp) + # LOCAL local_append_at_EList_internal_8 --> -36($fp) + # local_append_at_EList_internal_5 = local_append_at_EList_internal_8 + lw $t0, -36($fp) + sw $t0, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_append_at_EList_internal_14 --> -60($fp) + # local_append_at_EList_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_append_at_EList_internal_12 --> -52($fp) + # LOCAL local_append_at_EList_internal_14 --> -60($fp) + # local_append_at_EList_internal_12 = local_append_at_EList_internal_14 + lw $t0, -60($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_append_at_EList_internal_12 --> -52($fp) + # LOCAL local_append_at_EList_internal_13 --> -56($fp) + # local_append_at_EList_internal_13 = VCALL local_append_at_EList_internal_12 head + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_append_at_EList_internal_13 + # LOCAL local_append_at_EList_internal_13 --> -56($fp) + lw $t0, -56($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_append_at_EList_internal_5 --> -24($fp) + # LOCAL local_append_at_EList_internal_6 --> -28($fp) + # local_append_at_EList_internal_6 = VCALL local_append_at_EList_internal_5 cons + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_append_at_EList_internal_1 --> -8($fp) + # LOCAL local_append_at_EList_internal_6 --> -28($fp) + # local_append_at_EList_internal_1 = local_append_at_EList_internal_6 + lw $t0, -28($fp) + sw $t0, -8($fp) + label_ENDIF_204: +# RETURN local_append_at_EList_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_append_at_EList. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 68 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_print_at_EList implementation. +# @Params: +function_print_at_EList: + # Allocate stack frame for function function_print_at_EList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_print_at_EList_internal_2 --> -12($fp) + # local_print_at_EList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_at_EList_internal_0 --> -4($fp) + # LOCAL local_print_at_EList_internal_2 --> -12($fp) + # local_print_at_EList_internal_0 = local_print_at_EList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_EList_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_23 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_print_at_EList_internal_3 + # LOCAL local_print_at_EList_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_EList_internal_0 --> -4($fp) + # LOCAL local_print_at_EList_internal_1 --> -8($fp) + # local_print_at_EList_internal_1 = VCALL local_print_at_EList_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_at_EList_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_print_at_EList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __ECons__attrib__cdr__init implementation. +# @Params: +__ECons__attrib__cdr__init: + # Allocate stack frame for function __ECons__attrib__cdr__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __ECons__attrib__cdr__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_ECons implementation. +# @Params: +function_isNil_at_ECons: + # Allocate stack frame for function function_isNil_at_ECons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_ECons_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_isNil_at_ECons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_ECons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_head_at_ECons implementation. +# @Params: +function_head_at_ECons: + # Allocate stack frame for function function_head_at_ECons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_head_at_ECons_internal_0 = GETATTRIBUTE car ECons + # LOCAL local_head_at_ECons_internal_0 --> -4($fp) + lw $t0, 12($s1) + sw $t0, -4($fp) + # RETURN local_head_at_ECons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_head_at_ECons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_tail_at_ECons implementation. +# @Params: +function_tail_at_ECons: + # Allocate stack frame for function function_tail_at_ECons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_tail_at_ECons_internal_0 = GETATTRIBUTE cdr ECons + # LOCAL local_tail_at_ECons_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_tail_at_ECons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_tail_at_ECons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_ECons implementation. +# @Params: +# 0($fp) = param_init_at_ECons_e_0 +# 4($fp) = param_init_at_ECons_rest_1 +function_init_at_ECons: + # Allocate stack frame for function function_init_at_ECons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_ECons_e_0 --> 4($fp) + lw $t0, 4($fp) + sw $t0, 12($s1) + # + # PARAM param_init_at_ECons_rest_1 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 16($s1) + # LOCAL local_init_at_ECons_internal_0 --> -4($fp) + # local_init_at_ECons_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_ECons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_ECons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_print_at_ECons implementation. +# @Params: +function_print_at_ECons: + # Allocate stack frame for function function_print_at_ECons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_print_at_ECons_internal_2 = GETATTRIBUTE car ECons + # LOCAL local_print_at_ECons_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # LOCAL local_print_at_ECons_internal_0 --> -4($fp) + # LOCAL local_print_at_ECons_internal_2 --> -12($fp) + # local_print_at_ECons_internal_0 = local_print_at_ECons_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_ECons_internal_0 --> -4($fp) + # LOCAL local_print_at_ECons_internal_1 --> -8($fp) + # local_print_at_ECons_internal_1 = VCALL local_print_at_ECons_internal_0 print + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_print_at_ECons_internal_5 = GETATTRIBUTE cdr ECons + # LOCAL local_print_at_ECons_internal_5 --> -24($fp) + lw $t0, 16($s1) + sw $t0, -24($fp) + # LOCAL local_print_at_ECons_internal_3 --> -16($fp) + # LOCAL local_print_at_ECons_internal_5 --> -24($fp) + # local_print_at_ECons_internal_3 = local_print_at_ECons_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_ECons_internal_3 --> -16($fp) + # LOCAL local_print_at_ECons_internal_4 --> -20($fp) + # local_print_at_ECons_internal_4 = VCALL local_print_at_ECons_internal_3 print + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_at_ECons_internal_4 + lw $v0, -20($fp) + # Deallocate stack frame for function function_print_at_ECons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Edge__attrib__from__init implementation. +# @Params: +__Edge__attrib__from__init: + # Allocate stack frame for function __Edge__attrib__from__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__from__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__from__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Edge__attrib__from__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Edge__attrib__to__init implementation. +# @Params: +__Edge__attrib__to__init: + # Allocate stack frame for function __Edge__attrib__to__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__to__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__to__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Edge__attrib__to__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Edge__attrib__weight__init implementation. +# @Params: +__Edge__attrib__weight__init: + # Allocate stack frame for function __Edge__attrib__weight__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__weight__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__weight__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Edge__attrib__weight__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Edge implementation. +# @Params: +# 0($fp) = param_init_at_Edge_f_0 +# 4($fp) = param_init_at_Edge_t_1 +# 8($fp) = param_init_at_Edge_w_2 +function_init_at_Edge: + # Allocate stack frame for function function_init_at_Edge. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_Edge_f_0 --> 8($fp) + lw $t0, 8($fp) + sw $t0, 12($s1) + # + # PARAM param_init_at_Edge_t_1 --> 4($fp) + lw $t0, 4($fp) + sw $t0, 16($s1) + # + # PARAM param_init_at_Edge_w_2 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 20($s1) + # LOCAL local_init_at_Edge_internal_0 --> -4($fp) + # local_init_at_Edge_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_Edge_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_Edge. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 12 + jr $ra + # Function END + + +# function_print_at_Edge implementation. +# @Params: +function_print_at_Edge: + # Allocate stack frame for function function_print_at_Edge. + subu $sp, $sp, 104 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 104 + # LOCAL local_print_at_Edge_internal_2 --> -12($fp) + # local_print_at_Edge_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_at_Edge_internal_0 --> -4($fp) + # LOCAL local_print_at_Edge_internal_2 --> -12($fp) + # local_print_at_Edge_internal_0 = local_print_at_Edge_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Edge_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_24 + sw $t0, 12($v0) + li $t0, 2 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_print_at_Edge_internal_3 + # LOCAL local_print_at_Edge_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Edge_internal_0 --> -4($fp) + # LOCAL local_print_at_Edge_internal_1 --> -8($fp) + # local_print_at_Edge_internal_1 = VCALL local_print_at_Edge_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Edge_internal_6 --> -28($fp) + # local_print_at_Edge_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_print_at_Edge_internal_4 --> -20($fp) + # LOCAL local_print_at_Edge_internal_6 --> -28($fp) + # local_print_at_Edge_internal_4 = local_print_at_Edge_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Edge_internal_7 = GETATTRIBUTE from Edge + # LOCAL local_print_at_Edge_internal_7 --> -32($fp) + lw $t0, 12($s1) + sw $t0, -32($fp) + # ARG local_print_at_Edge_internal_7 + # LOCAL local_print_at_Edge_internal_7 --> -32($fp) + lw $t0, -32($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Edge_internal_4 --> -20($fp) + # LOCAL local_print_at_Edge_internal_5 --> -24($fp) + # local_print_at_Edge_internal_5 = VCALL local_print_at_Edge_internal_4 out_int + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Edge_internal_10 --> -44($fp) + # local_print_at_Edge_internal_10 = SELF + sw $s1, -44($fp) + # LOCAL local_print_at_Edge_internal_8 --> -36($fp) + # LOCAL local_print_at_Edge_internal_10 --> -44($fp) + # local_print_at_Edge_internal_8 = local_print_at_Edge_internal_10 + lw $t0, -44($fp) + sw $t0, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Edge_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_25 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -48($fp) + # ARG local_print_at_Edge_internal_11 + # LOCAL local_print_at_Edge_internal_11 --> -48($fp) + lw $t0, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Edge_internal_8 --> -36($fp) + # LOCAL local_print_at_Edge_internal_9 --> -40($fp) + # local_print_at_Edge_internal_9 = VCALL local_print_at_Edge_internal_8 out_string + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Edge_internal_14 --> -60($fp) + # local_print_at_Edge_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_print_at_Edge_internal_12 --> -52($fp) + # LOCAL local_print_at_Edge_internal_14 --> -60($fp) + # local_print_at_Edge_internal_12 = local_print_at_Edge_internal_14 + lw $t0, -60($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Edge_internal_15 = GETATTRIBUTE to Edge + # LOCAL local_print_at_Edge_internal_15 --> -64($fp) + lw $t0, 16($s1) + sw $t0, -64($fp) + # ARG local_print_at_Edge_internal_15 + # LOCAL local_print_at_Edge_internal_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Edge_internal_12 --> -52($fp) + # LOCAL local_print_at_Edge_internal_13 --> -56($fp) + # local_print_at_Edge_internal_13 = VCALL local_print_at_Edge_internal_12 out_int + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Edge_internal_18 --> -76($fp) + # local_print_at_Edge_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_print_at_Edge_internal_16 --> -68($fp) + # LOCAL local_print_at_Edge_internal_18 --> -76($fp) + # local_print_at_Edge_internal_16 = local_print_at_Edge_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Edge_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_26 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -80($fp) + # ARG local_print_at_Edge_internal_19 + # LOCAL local_print_at_Edge_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Edge_internal_16 --> -68($fp) + # LOCAL local_print_at_Edge_internal_17 --> -72($fp) + # local_print_at_Edge_internal_17 = VCALL local_print_at_Edge_internal_16 out_string + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Edge_internal_22 --> -92($fp) + # local_print_at_Edge_internal_22 = SELF + sw $s1, -92($fp) + # LOCAL local_print_at_Edge_internal_20 --> -84($fp) + # LOCAL local_print_at_Edge_internal_22 --> -92($fp) + # local_print_at_Edge_internal_20 = local_print_at_Edge_internal_22 + lw $t0, -92($fp) + sw $t0, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Edge_internal_23 = GETATTRIBUTE weight Edge + # LOCAL local_print_at_Edge_internal_23 --> -96($fp) + lw $t0, 20($s1) + sw $t0, -96($fp) + # ARG local_print_at_Edge_internal_23 + # LOCAL local_print_at_Edge_internal_23 --> -96($fp) + lw $t0, -96($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Edge_internal_20 --> -84($fp) + # LOCAL local_print_at_Edge_internal_21 --> -88($fp) + # local_print_at_Edge_internal_21 = VCALL local_print_at_Edge_internal_20 out_int + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_at_Edge_internal_21 + lw $v0, -88($fp) + # Deallocate stack frame for function function_print_at_Edge. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 104 + jr $ra + # Function END + + +# __Vertice__attrib__num__init implementation. +# @Params: +__Vertice__attrib__num__init: + # Allocate stack frame for function __Vertice__attrib__num__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local___attrib__num__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local___attrib__num__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Vertice__attrib__num__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Vertice__attrib__out__init implementation. +# @Params: +__Vertice__attrib__out__init: + # Allocate stack frame for function __Vertice__attrib__out__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local___attrib__out__init_internal_1 --> -8($fp) + # local___attrib__out__init_internal_1 = ALLOCATE EList + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, EList + sw $t0, 12($v0) + li $t0, 5 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, EList_start + sw $t0, 4($v0) + # Load type offset + li $t0, 44 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __EList__attrib__car__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # RETURN local___attrib__out__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Vertice__attrib__out__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_outgoing_at_Vertice implementation. +# @Params: +function_outgoing_at_Vertice: + # Allocate stack frame for function function_outgoing_at_Vertice. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_outgoing_at_Vertice_internal_0 = GETATTRIBUTE out Vertice + # LOCAL local_outgoing_at_Vertice_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_outgoing_at_Vertice_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_outgoing_at_Vertice. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_number_at_Vertice implementation. +# @Params: +function_number_at_Vertice: + # Allocate stack frame for function function_number_at_Vertice. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_number_at_Vertice_internal_0 = GETATTRIBUTE num Vertice + # LOCAL local_number_at_Vertice_internal_0 --> -4($fp) + lw $t0, 12($s1) + sw $t0, -4($fp) + # RETURN local_number_at_Vertice_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_number_at_Vertice. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Vertice implementation. +# @Params: +# 0($fp) = param_init_at_Vertice_n_0 +function_init_at_Vertice: + # Allocate stack frame for function function_init_at_Vertice. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_Vertice_n_0 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 12($s1) + # LOCAL local_init_at_Vertice_internal_0 --> -4($fp) + # local_init_at_Vertice_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_Vertice_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_Vertice. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_add_out_at_Vertice implementation. +# @Params: +# 0($fp) = param_add_out_at_Vertice_s_0 +function_add_out_at_Vertice: + # Allocate stack frame for function function_add_out_at_Vertice. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_add_out_at_Vertice_internal_2 = GETATTRIBUTE out Vertice + # LOCAL local_add_out_at_Vertice_internal_2 --> -12($fp) + lw $t0, 16($s1) + sw $t0, -12($fp) + # LOCAL local_add_out_at_Vertice_internal_0 --> -4($fp) + # LOCAL local_add_out_at_Vertice_internal_2 --> -12($fp) + # local_add_out_at_Vertice_internal_0 = local_add_out_at_Vertice_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_add_out_at_Vertice_s_0 + # PARAM param_add_out_at_Vertice_s_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_add_out_at_Vertice_internal_0 --> -4($fp) + # LOCAL local_add_out_at_Vertice_internal_1 --> -8($fp) + # local_add_out_at_Vertice_internal_1 = VCALL local_add_out_at_Vertice_internal_0 cons + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_add_out_at_Vertice_internal_1 --> -8($fp) + lw $t0, -8($fp) + sw $t0, 16($s1) + # LOCAL local_add_out_at_Vertice_internal_3 --> -16($fp) + # local_add_out_at_Vertice_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_add_out_at_Vertice_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_add_out_at_Vertice. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_at_Vertice implementation. +# @Params: +function_print_at_Vertice: + # Allocate stack frame for function function_print_at_Vertice. + subu $sp, $sp, 36 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 36 + # LOCAL local_print_at_Vertice_internal_2 --> -12($fp) + # local_print_at_Vertice_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_at_Vertice_internal_0 --> -4($fp) + # LOCAL local_print_at_Vertice_internal_2 --> -12($fp) + # local_print_at_Vertice_internal_0 = local_print_at_Vertice_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Vertice_internal_3 = GETATTRIBUTE num Vertice + # LOCAL local_print_at_Vertice_internal_3 --> -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) + # ARG local_print_at_Vertice_internal_3 + # LOCAL local_print_at_Vertice_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Vertice_internal_0 --> -4($fp) + # LOCAL local_print_at_Vertice_internal_1 --> -8($fp) + # local_print_at_Vertice_internal_1 = VCALL local_print_at_Vertice_internal_0 out_int + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_print_at_Vertice_internal_6 = GETATTRIBUTE out Vertice + # LOCAL local_print_at_Vertice_internal_6 --> -28($fp) + lw $t0, 16($s1) + sw $t0, -28($fp) + # LOCAL local_print_at_Vertice_internal_4 --> -20($fp) + # LOCAL local_print_at_Vertice_internal_6 --> -28($fp) + # local_print_at_Vertice_internal_4 = local_print_at_Vertice_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Vertice_internal_4 --> -20($fp) + # LOCAL local_print_at_Vertice_internal_5 --> -24($fp) + # local_print_at_Vertice_internal_5 = VCALL local_print_at_Vertice_internal_4 print + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_at_Vertice_internal_5 + lw $v0, -24($fp) + # Deallocate stack frame for function function_print_at_Vertice. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 36 + jr $ra + # Function END + diff --git a/tests/codegen/hairyscary.mips b/tests/codegen/hairyscary.mips index 4bc2ec87..c1e2441e 100644 --- a/tests/codegen/hairyscary.mips +++ b/tests/codegen/hairyscary.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:40 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:20 2020 # School of Math and Computer Science, University of Havana # @@ -13,6 +13,8 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END +Int: .asciiz "Int" +# Function END Main: .asciiz "Main" # Function END Bazz: .asciiz "Bazz" @@ -82,6 +84,20 @@ Bool_end: # +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + # **** VTABLE for type Main **** Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main # Function END @@ -164,15 +180,16 @@ data_2: .asciiz "\n" # -IO__TDT: .word 0, -1, -1, -1, -1, 1, 2, 3, 4 -Object__TDT: .word 1, 0, 1, 1, 1, 2, 3, 4, 5 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1 -Main__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1 -Bazz__TDT: .word -1, -1, -1, -1, -1, 0, 1, 2, 3 -Foo__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 2 -Razz__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, 1 -Bar__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0 +IO__TDT: .word 0, -1, -1, -1, -1, -1, 1, 2, 3, 4 +Object__TDT: .word 1, 0, 1, 1, 1, 1, 2, 3, 4, 5 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1, -1 +Bazz__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 2, 3 +Foo__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, 1, 2 +Razz__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, 1 +Bar__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 # @@ -258,7 +275,8 @@ function_out_int_at_IO: addu $fp, $sp, 32 # PRINT_INT param_out_int_at_IO_x_0 # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) li $v0, 1 syscall # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) @@ -324,6 +342,35 @@ function_in_int_at_IO: # local_in_int_at_IO_internal_0 = READ_INT li $v0, 5 syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) sw $v0, -4($fp) # RETURN local_in_int_at_IO_internal_0 lw $v0, -4($fp) @@ -421,7 +468,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -510,8 +557,10 @@ function_substr_at_String: # PARAM param_substr_at_String_r_1 --> 0($fp) lw $t0, 12($s1) lw $t2, 4($fp) + lw $t2, 12($t2) addu $t0, $t0, $t2 lw $a0, 0($fp) + lw $a0, 12($a0) move $t3, $a0 move $t1, $a0 addu $a0, $a0, 1 @@ -571,8 +620,40 @@ function_length_at_String: # LOCAL local_length_at_String_internal_0 --> -4($fp) lw $t0, 16($s1) sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function function_length_at_String. # Restore $ra lw $ra, 4($sp) @@ -599,28 +680,28 @@ entry: li $v0, 9 syscall # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 28 bytes of memory li $a0, 28 li $v0, 9 syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) # Load type offset - li $t2, 16 - sw $t2, 8($v0) + li $t0, 20 + sw $t0, 8($v0) move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 @@ -670,11 +751,11 @@ entry: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type's VTABLE - la $t1, Main_vtable + la $t0, Main_vtable # Get pointer to function address - lw $t2, 12($t1) + lw $t1, 12($t0) # Call function. Result is on $v0 - jalr $t2 + jalr $t1 sw $v0, -8($fp) # RETURN 0 li $v0, 0 @@ -697,70 +778,70 @@ __Main__attrib__a__init: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_ttrib__a__init_internal_0 --> -4($fp) - # local_ttrib__a__init_internal_0 = ALLOCATE Bazz + # LOCAL local_ttrib__a__init_internal_1 --> -8($fp) + # local_ttrib__a__init_internal_1 = ALLOCATE Bazz # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Bazz - sw $t3, 12($v0) - li $t3, 4 - sw $t3, 16($v0) - move $t3, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bazz + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 24 bytes of memory li $a0, 24 li $v0, 9 syscall - sw $t3, 0($v0) - la $t3, Bazz_start - sw $t3, 4($v0) + sw $t0, 0($v0) + la $t0, Bazz_start + sw $t0, 4($v0) # Load type offset - li $t3, 20 - sw $t3, 8($v0) - move $t2, $v0 + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t2 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t2) - # Push register t2 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t2) - # Push register t2 into stack + sw $v0, 16($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 20($t2) + sw $v0, 20($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t2, -4($fp) - # RETURN local_ttrib__a__init_internal_0 - lw $v0, -4($fp) + sw $t1, -8($fp) + # RETURN local_ttrib__a__init_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function __Main__attrib__a__init. # Restore $ra lw $ra, 4($sp) @@ -780,86 +861,86 @@ __Main__attrib__b__init: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_ttrib__b__init_internal_0 --> -4($fp) - # local_ttrib__b__init_internal_0 = ALLOCATE Foo + # LOCAL local_ttrib__b__init_internal_1 --> -8($fp) + # local_ttrib__b__init_internal_1 = ALLOCATE Foo # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Foo - sw $t4, 12($v0) - li $t4, 3 - sw $t4, 16($v0) - move $t4, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Foo + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 32 bytes of memory li $a0, 32 li $v0, 9 syscall - sw $t4, 0($v0) - la $t4, Foo_start - sw $t4, 4($v0) + sw $t0, 0($v0) + la $t0, Foo_start + sw $t0, 4($v0) # Load type offset - li $t4, 24 - sw $t4, 8($v0) - move $t3, $v0 + li $t0, 28 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t3 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t3) - # Push register t3 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t3) - # Push register t3 into stack + sw $v0, 16($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 20($t3) - # Push register t3 into stack + sw $v0, 20($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t1, 0($sp) jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 24($t3) - # Push register t3 into stack + sw $v0, 24($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t1, 0($sp) jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 28($t3) + sw $v0, 28($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t3, -4($fp) - # RETURN local_ttrib__b__init_internal_0 - lw $v0, -4($fp) + sw $t1, -8($fp) + # RETURN local_ttrib__b__init_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function __Main__attrib__b__init. # Restore $ra lw $ra, 4($sp) @@ -879,102 +960,102 @@ __Main__attrib__c__init: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_ttrib__c__init_internal_0 --> -4($fp) - # local_ttrib__c__init_internal_0 = ALLOCATE Razz + # LOCAL local_ttrib__c__init_internal_1 --> -8($fp) + # local_ttrib__c__init_internal_1 = ALLOCATE Razz # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, Razz - sw $t5, 12($v0) - li $t5, 4 - sw $t5, 16($v0) - move $t5, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Razz + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 40 bytes of memory li $a0, 40 li $v0, 9 syscall - sw $t5, 0($v0) - la $t5, Razz_start - sw $t5, 4($v0) + sw $t0, 0($v0) + la $t0, Razz_start + sw $t0, 4($v0) # Load type offset - li $t5, 28 - sw $t5, 8($v0) - move $t4, $v0 + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t4 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t4) - # Push register t4 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t4) - # Push register t4 into stack + sw $v0, 16($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 20($t4) - # Push register t4 into stack + sw $v0, 20($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t1, 0($sp) jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 24($t4) - # Push register t4 into stack + sw $v0, 24($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t1, 0($sp) jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 28($t4) - # Push register t4 into stack + sw $v0, 28($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t1, 0($sp) jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 32($t4) - # Push register t4 into stack + sw $v0, 32($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t1, 0($sp) jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 36($t4) + sw $v0, 36($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t4, -4($fp) - # RETURN local_ttrib__c__init_internal_0 - lw $v0, -4($fp) + sw $t1, -8($fp) + # RETURN local_ttrib__c__init_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function __Main__attrib__c__init. # Restore $ra lw $ra, 4($sp) @@ -994,118 +1075,118 @@ __Main__attrib__d__init: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_ttrib__d__init_internal_0 --> -4($fp) - # local_ttrib__d__init_internal_0 = ALLOCATE Bar + # LOCAL local_ttrib__d__init_internal_1 --> -8($fp) + # local_ttrib__d__init_internal_1 = ALLOCATE Bar # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t6, String - sw $t6, 0($v0) - la $t6, String_start - sw $t6, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t6, 8 - sw $t6, 8($v0) - la $t6, Bar - sw $t6, 12($v0) - li $t6, 3 - sw $t6, 16($v0) - move $t6, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bar + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 48 bytes of memory li $a0, 48 li $v0, 9 syscall - sw $t6, 0($v0) - la $t6, Bar_start - sw $t6, 4($v0) + sw $t0, 0($v0) + la $t0, Bar_start + sw $t0, 4($v0) # Load type offset - li $t6, 32 - sw $t6, 8($v0) - move $t5, $v0 + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t5 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t5, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t5) - # Push register t5 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t5, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t5) - # Push register t5 into stack + sw $v0, 16($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t5, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 20($t5) - # Push register t5 into stack + sw $v0, 20($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t5, 0($sp) + sw $t1, 0($sp) jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 24($t5) - # Push register t5 into stack + sw $v0, 24($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t5, 0($sp) + sw $t1, 0($sp) jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 28($t5) - # Push register t5 into stack + sw $v0, 28($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t5, 0($sp) + sw $t1, 0($sp) jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 32($t5) - # Push register t5 into stack + sw $v0, 32($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t5, 0($sp) + sw $t1, 0($sp) jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 36($t5) - # Push register t5 into stack + sw $v0, 36($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t5, 0($sp) + sw $t1, 0($sp) jal __Bar__attrib__c__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 40($t5) - # Push register t5 into stack + sw $v0, 40($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t5, 0($sp) + sw $t1, 0($sp) jal __Bar__attrib__d__init - # Pop 4 bytes from stack into register t5 - lw $t5, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 44($t5) + sw $v0, 44($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t5, -4($fp) - # RETURN local_ttrib__d__init_internal_0 - lw $v0, -4($fp) + sw $t1, -8($fp) + # RETURN local_ttrib__d__init_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function __Main__attrib__d__init. # Restore $ra lw $ra, 4($sp) @@ -1131,17 +1212,17 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, data_4 - sw $t5, 12($v0) - li $t5, 10 - sw $t5, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 10 + sw $t0, 16($v0) sw $v0, -4($fp) # RETURN local_main_at_Main_internal_0 lw $v0, -4($fp) @@ -1164,8 +1245,39 @@ __Bazz__attrib__h__init: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN 1 - li $v0, 1 + # LOCAL local_ttrib__h__init_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_ttrib__h__init_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function __Bazz__attrib__h__init. # Restore $ra lw $ra, 4($sp) @@ -1181,535 +1293,535 @@ __Bazz__attrib__h__init: # @Params: __Bazz__attrib__g__init: # Allocate stack frame for function __Bazz__attrib__g__init. - subu $sp, $sp, 60 + subu $sp, $sp, 64 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 60 - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_internal_0 = SELF - sw $s1, -4($fp) - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + addu $fp, $sp, 64 # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # local_ttrib__g__init_internal_1 = TYPEOF local_ttrib__g__init_internal_0 - lw $t5, -4($fp) + # local_ttrib__g__init_internal_1 = SELF + sw $s1, -8($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) + # local_ttrib__g__init_internal_2 = TYPEOF local_ttrib__g__init_internal_1 + lw $t0, -8($fp) # Load pointer to type offset - lw $t6, 8($t5) - sw $t6, -8($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # local_ttrib__g__init_internal_4 = 13 - li $t5, 13 - sw $t5, -20($fp) - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bazz + lw $t1, 8($t0) + sw $t1, -12($fp) # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # local_ttrib__g__init_internal_5 = 13 + li $t0, 13 + sw $t0, -24($fp) + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Bazz - la $t5, Bazz__TDT - lw $t6, -8($fp) - addu $t5, $t5, $t6 + la $t0, Bazz__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 # Save distance - lw $t6, 0($t5) - sw $t6, -24($fp) + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # Update min if 13 < 14 - lw $t5, -24($fp) - lw $t6, -20($fp) - bgtu $t5, $t6, label_Not_min0_1 - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_Not_min0_1 # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_5 - lw $t5, -24($fp) - sw $t5, -20($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # local_ttrib__g__init_internal_5 = local_ttrib__g__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) label_Not_min0_1: - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz - la $t5, Razz__TDT - lw $t6, -8($fp) - addu $t5, $t5, $t6 + la $t0, Razz__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 # Save distance - lw $t6, 0($t5) - sw $t6, -24($fp) + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # Update min if 13 < 14 - lw $t5, -24($fp) - lw $t6, -20($fp) - bgtu $t5, $t6, label_Not_min1_2 - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_Not_min1_2 # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_5 - lw $t5, -24($fp) - sw $t5, -20($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # local_ttrib__g__init_internal_5 = local_ttrib__g__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) label_Not_min1_2: - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Foo - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Foo - la $t5, Foo__TDT - lw $t6, -8($fp) - addu $t5, $t5, $t6 + la $t0, Foo__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 # Save distance - lw $t6, 0($t5) - sw $t6, -24($fp) + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # Update min if 13 < 14 - lw $t5, -24($fp) - lw $t6, -20($fp) - bgtu $t5, $t6, label_Not_min2_3 - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_Not_min2_3 # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_5 - lw $t5, -24($fp) - sw $t5, -20($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # local_ttrib__g__init_internal_5 = local_ttrib__g__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) label_Not_min2_3: - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar - la $t5, Bar__TDT - lw $t6, -8($fp) - addu $t5, $t5, $t6 + la $t0, Bar__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 # Save distance - lw $t6, 0($t5) - sw $t6, -24($fp) + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # Update min if 13 < 14 - lw $t5, -24($fp) - lw $t6, -20($fp) - bgtu $t5, $t6, label_Not_min3_4 - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_Not_min3_4 # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_5 - lw $t5, -24($fp) - sw $t5, -20($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # local_ttrib__g__init_internal_5 = local_ttrib__g__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) label_Not_min3_4: + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # local_ttrib__g__init_internal_6 = 13 + li $t0, 13 + sw $t0, -28($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # local_ttrib__g__init_internal_5 = 13 - li $t5, 13 - sw $t5, -24($fp) + # Load pointers and SUB + lw $a0, -28($fp) + lw $a1, -24($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_ttrib__g__init_internal_3 GOTO label_ERROR_5 + # IF_ZERO local_ttrib__g__init_internal_3 GOTO label_ERROR_5 + lw $t0, -16($fp) + beq $t0, 0, label_ERROR_5 + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # local_ttrib__g__init_internal_2 = local_ttrib__g__init_internal_5 - local_ttrib__g__init_internal_4 - lw $t5, -24($fp) - lw $t6, -20($fp) - sub $t5, $t5, $t6 - sw $t5, -12($fp) - # IF_ZERO local_ttrib__g__init_internal_2 GOTO label_ERROR_5 - # IF_ZERO local_ttrib__g__init_internal_2 GOTO label_ERROR_5 - lw $t5, -12($fp) - beq $t5, 0, label_ERROR_5 - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bazz - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) # Load TDT pointer to type Bazz - la $t5, Bazz__TDT - lw $t6, -8($fp) - addu $t5, $t5, $t6 + la $t0, Bazz__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 # Save distance - lw $t6, 0($t5) - sw $t6, -24($fp) + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # Update min if 13 < 14 - lw $t5, -24($fp) - lw $t6, -20($fp) - bgtu $t5, $t6, label_NEXT0_7 - # LOCAL local_ttrib__g__init_n_6 --> -28($fp) - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_n_6 = local_ttrib__g__init_internal_0 - lw $t5, -4($fp) - sw $t5, -28($fp) - # LOCAL local_ttrib__g__init_internal_7 --> -32($fp) - # local_ttrib__g__init_internal_7 = ALLOCATE Foo + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_NEXT0_7 + # LOCAL local_ttrib__g__init_n_7 --> -32($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # local_ttrib__g__init_n_7 = local_ttrib__g__init_internal_1 + lw $t0, -8($fp) + sw $t0, -32($fp) + # LOCAL local_ttrib__g__init_internal_8 --> -36($fp) + # local_ttrib__g__init_internal_8 = ALLOCATE Foo # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t7, 8 - sw $t7, 8($v0) - la $t7, Foo - sw $t7, 12($v0) - li $t7, 3 - sw $t7, 16($v0) - move $t7, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Foo + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 32 bytes of memory li $a0, 32 li $v0, 9 syscall - sw $t7, 0($v0) - la $t7, Foo_start - sw $t7, 4($v0) + sw $t0, 0($v0) + la $t0, Foo_start + sw $t0, 4($v0) # Load type offset - li $t7, 24 - sw $t7, 8($v0) - move $t6, $v0 + li $t0, 28 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t6 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t6, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t6) - # Push register t6 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t6, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t6) - # Push register t6 into stack + sw $v0, 16($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t6, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 20($t6) - # Push register t6 into stack + sw $v0, 20($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t6, 0($sp) + sw $t1, 0($sp) jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 24($t6) - # Push register t6 into stack + sw $v0, 24($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t6, 0($sp) + sw $t1, 0($sp) jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t6 - lw $t6, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 28($t6) + sw $v0, 28($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t6, -32($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__g__init_internal_7 --> -32($fp) - # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_7 - lw $t6, -32($fp) - sw $t6, -16($fp) + sw $t1, -36($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_8 --> -36($fp) + # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_8 + lw $t0, -36($fp) + sw $t0, -20($fp) # GOTO label_END_6 j label_END_6 label_NEXT0_7: - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz - la $t6, Razz__TDT - lw $t7, -8($fp) - addu $t6, $t6, $t7 + la $t0, Razz__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 # Save distance - lw $t7, 0($t6) - sw $t7, -24($fp) + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # Update min if 14 < 15 - lw $t6, -24($fp) - lw $t7, -20($fp) - bgtu $t6, $t7, label_NEXT1_8 - # LOCAL local_ttrib__g__init_n_8 --> -36($fp) - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_n_8 = local_ttrib__g__init_internal_0 - lw $t6, -4($fp) - sw $t6, -36($fp) - # LOCAL local_ttrib__g__init_internal_9 --> -40($fp) - # local_ttrib__g__init_internal_9 = ALLOCATE Bar + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_NEXT1_8 + # LOCAL local_ttrib__g__init_n_9 --> -40($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # local_ttrib__g__init_n_9 = local_ttrib__g__init_internal_1 + lw $t0, -8($fp) + sw $t0, -40($fp) + # LOCAL local_ttrib__g__init_internal_10 --> -44($fp) + # local_ttrib__g__init_internal_10 = ALLOCATE Bar # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t8, String - sw $t8, 0($v0) - la $t8, String_start - sw $t8, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t8, 8 - sw $t8, 8($v0) - la $t8, Bar - sw $t8, 12($v0) - li $t8, 3 - sw $t8, 16($v0) - move $t8, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bar + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 48 bytes of memory li $a0, 48 li $v0, 9 syscall - sw $t8, 0($v0) - la $t8, Bar_start - sw $t8, 4($v0) + sw $t0, 0($v0) + la $t0, Bar_start + sw $t0, 4($v0) # Load type offset - li $t8, 32 - sw $t8, 8($v0) - move $t7, $v0 + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t7 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t7, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t7) - # Push register t7 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t7, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t7) - # Push register t7 into stack + sw $v0, 16($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t7, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 20($t7) - # Push register t7 into stack + sw $v0, 20($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t7, 0($sp) + sw $t1, 0($sp) jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 24($t7) - # Push register t7 into stack + sw $v0, 24($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t7, 0($sp) + sw $t1, 0($sp) jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 28($t7) - # Push register t7 into stack + sw $v0, 28($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t7, 0($sp) + sw $t1, 0($sp) jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 32($t7) - # Push register t7 into stack + sw $v0, 32($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t7, 0($sp) + sw $t1, 0($sp) jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 36($t7) - # Push register t7 into stack + sw $v0, 36($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t7, 0($sp) + sw $t1, 0($sp) jal __Bar__attrib__c__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 40($t7) - # Push register t7 into stack + sw $v0, 40($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t7, 0($sp) + sw $t1, 0($sp) jal __Bar__attrib__d__init - # Pop 4 bytes from stack into register t7 - lw $t7, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 44($t7) + sw $v0, 44($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t7, -40($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__g__init_internal_9 --> -40($fp) - # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_9 - lw $t7, -40($fp) - sw $t7, -16($fp) + sw $t1, -44($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_10 --> -44($fp) + # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_10 + lw $t0, -44($fp) + sw $t0, -20($fp) # GOTO label_END_6 j label_END_6 label_NEXT1_8: - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Foo - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Foo - la $t7, Foo__TDT - lw $t8, -8($fp) - addu $t7, $t7, $t8 + la $t0, Foo__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 # Save distance - lw $t8, 0($t7) - sw $t8, -24($fp) + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # Update min if 15 < 24 - lw $t7, -24($fp) - lw $t8, -20($fp) - bgtu $t7, $t8, label_NEXT2_9 - # LOCAL local_ttrib__g__init_n_10 --> -44($fp) - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_n_10 = local_ttrib__g__init_internal_0 - lw $t7, -4($fp) - sw $t7, -44($fp) - # LOCAL local_ttrib__g__init_internal_11 --> -48($fp) - # local_ttrib__g__init_internal_11 = ALLOCATE Razz + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_NEXT2_9 + # LOCAL local_ttrib__g__init_n_11 --> -48($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # local_ttrib__g__init_n_11 = local_ttrib__g__init_internal_1 + lw $t0, -8($fp) + sw $t0, -48($fp) + # LOCAL local_ttrib__g__init_internal_12 --> -52($fp) + # local_ttrib__g__init_internal_12 = ALLOCATE Razz # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t9, 8 - sw $t9, 8($v0) - la $t9, Razz - sw $t9, 12($v0) - li $t9, 4 - sw $t9, 16($v0) - move $t9, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Razz + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 40 bytes of memory li $a0, 40 li $v0, 9 syscall - sw $t9, 0($v0) - la $t9, Razz_start - sw $t9, 4($v0) + sw $t0, 0($v0) + la $t0, Razz_start + sw $t0, 4($v0) # Load type offset - li $t9, 28 - sw $t9, 8($v0) - move $t8, $v0 + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t8 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t8, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t8) - # Push register t8 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t8, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t8) - # Push register t8 into stack + sw $v0, 16($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t8, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 20($t8) - # Push register t8 into stack + sw $v0, 20($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t8, 0($sp) + sw $t1, 0($sp) jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 24($t8) - # Push register t8 into stack + sw $v0, 24($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t8, 0($sp) + sw $t1, 0($sp) jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 28($t8) - # Push register t8 into stack + sw $v0, 28($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t8, 0($sp) + sw $t1, 0($sp) jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 32($t8) - # Push register t8 into stack + sw $v0, 32($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t8, 0($sp) + sw $t1, 0($sp) jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register t8 - lw $t8, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 36($t8) + sw $v0, 36($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t8, -48($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__g__init_internal_11 --> -48($fp) - # local_ttrib__g__init_internal_3 = local_ttrib__g__init_internal_11 - lw $t8, -48($fp) - sw $t8, -16($fp) + sw $t1, -52($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_12 --> -52($fp) + # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_12 + lw $t0, -52($fp) + sw $t0, -20($fp) # GOTO label_END_6 j label_END_6 label_NEXT2_9: - # local_ttrib__g__init_internal_5 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar - la $t8, Bar__TDT - lw $t9, -8($fp) - addu $t8, $t8, $t9 + la $t0, Bar__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 # Save distance - lw $t9, 0($t8) - sw $t9, -24($fp) + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_NEXT3_10 + # LOCAL local_ttrib__g__init_n_13 --> -56($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # local_ttrib__g__init_n_13 = local_ttrib__g__init_internal_1 + lw $t0, -8($fp) + sw $t0, -56($fp) # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # Update min if 24 < 25 - lw $t8, -24($fp) - lw $t9, -20($fp) - bgtu $t8, $t9, label_NEXT3_10 - # LOCAL local_ttrib__g__init_n_12 --> -52($fp) - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - # local_ttrib__g__init_n_12 = local_ttrib__g__init_internal_0 - lw $t8, -4($fp) - sw $t8, -52($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__g__init_n_12 --> -52($fp) - # local_ttrib__g__init_internal_3 = local_ttrib__g__init_n_12 - lw $t8, -52($fp) - sw $t8, -16($fp) + # LOCAL local_ttrib__g__init_n_13 --> -56($fp) + # local_ttrib__g__init_internal_4 = local_ttrib__g__init_n_13 + lw $t0, -56($fp) + sw $t0, -20($fp) # GOTO label_END_6 j label_END_6 label_NEXT3_10: label_ERROR_5: - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) - lw $t8, 0($s1) - sw $t8, -4($fp) - # LOCAL local_ttrib__g__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + lw $t0, 0($s1) + sw $t0, -8($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) la $a0, data_1 li $v0, 4 syscall - lw $a0, -4($fp) + lw $a0, -8($fp) li $v0, 4 syscall la $a0, data_2 @@ -1718,15 +1830,15 @@ label_NEXT3_10: li $v0, 10 syscall label_END_6: -# RETURN local_ttrib__g__init_internal_3 -lw $v0, -16($fp) +# RETURN local_ttrib__g__init_internal_4 +lw $v0, -20($fp) # Deallocate stack frame for function __Bazz__attrib__g__init. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 60 +addu $sp, $sp, 64 jr $ra # Function END @@ -1739,36 +1851,36 @@ __Bazz__attrib__i__init: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_ttrib__i__init_internal_2 --> -12($fp) - # local_ttrib__i__init_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_ttrib__i__init_internal_0 --> -4($fp) - # LOCAL local_ttrib__i__init_internal_2 --> -12($fp) - # local_ttrib__i__init_internal_0 = local_ttrib__i__init_internal_2 - lw $t8, -12($fp) - sw $t8, -4($fp) + # LOCAL local_ttrib__i__init_internal_3 --> -16($fp) + # local_ttrib__i__init_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_ttrib__i__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__i__init_internal_3 --> -16($fp) + # local_ttrib__i__init_internal_1 = local_ttrib__i__init_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_ttrib__i__init_internal_0 --> -4($fp) # LOCAL local_ttrib__i__init_internal_1 --> -8($fp) - # local_ttrib__i__init_internal_1 = VCALL local_ttrib__i__init_internal_0 printh + # LOCAL local_ttrib__i__init_internal_2 --> -12($fp) + # local_ttrib__i__init_internal_2 = VCALL local_ttrib__i__init_internal_1 printh # Save new self pointer in $s1 - lw $s1, -4($fp) + lw $s1, -8($fp) # Get pointer to type - lw $t8, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t9, 0($t8) + lw $t0, 0($t0) # Get pointer to function address - lw $s2, 28($t9) + lw $t0, 28($t0) # Call function. Result is on $v0 - jalr $s2 - sw $v0, -8($fp) + jalr $t0 + sw $v0, -12($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN local_ttrib__i__init_internal_1 - lw $v0, -8($fp) + # RETURN local_ttrib__i__init_internal_2 + lw $v0, -12($fp) # Deallocate stack frame for function __Bazz__attrib__i__init. # Restore $ra lw $ra, 4($sp) @@ -1794,40 +1906,71 @@ function_printh_at_Bazz: # LOCAL local_printh_at_Bazz_internal_0 --> -4($fp) # LOCAL local_printh_at_Bazz_internal_2 --> -12($fp) # local_printh_at_Bazz_internal_0 = local_printh_at_Bazz_internal_2 - lw $t8, -12($fp) - sw $t8, -4($fp) + lw $t0, -12($fp) + sw $t0, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # local_printh_at_Bazz_internal_3 = GETATTRIBUTE h Bazz # LOCAL local_printh_at_Bazz_internal_3 --> -16($fp) - lw $t8, 12($s1) - sw $t8, -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) # ARG local_printh_at_Bazz_internal_3 # LOCAL local_printh_at_Bazz_internal_3 --> -16($fp) - lw $t8, -16($fp) + lw $t0, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t8, 0($sp) + sw $t0, 0($sp) # LOCAL local_printh_at_Bazz_internal_0 --> -4($fp) # LOCAL local_printh_at_Bazz_internal_1 --> -8($fp) # local_printh_at_Bazz_internal_1 = VCALL local_printh_at_Bazz_internal_0 out_int # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t8, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t9, 0($t8) + lw $t0, 0($t0) # Get pointer to function address - lw $s2, 16($t9) + lw $t0, 16($t0) # Call function. Result is on $v0 - jalr $s2 + jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN 0 - li $v0, 0 + # LOCAL local_printh_at_Bazz_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # RETURN local_printh_at_Bazz_internal_4 + lw $v0, -20($fp) # Deallocate stack frame for function function_printh_at_Bazz. # Restore $ra lw $ra, 4($sp) @@ -1847,29 +1990,123 @@ function_doh_at_Bazz: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 + # LOCAL local_doh_at_Bazz_i_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) # local_doh_at_Bazz_internal_1 = GETATTRIBUTE h Bazz # LOCAL local_doh_at_Bazz_internal_1 --> -8($fp) - lw $t8, 12($s1) - sw $t8, -8($fp) + lw $t0, 12($s1) + sw $t0, -8($fp) # LOCAL local_doh_at_Bazz_i_0 --> -4($fp) # LOCAL local_doh_at_Bazz_internal_1 --> -8($fp) # local_doh_at_Bazz_i_0 = local_doh_at_Bazz_internal_1 - lw $t8, -8($fp) - sw $t8, -4($fp) + lw $t0, -8($fp) + sw $t0, -4($fp) # local_doh_at_Bazz_internal_3 = GETATTRIBUTE h Bazz # LOCAL local_doh_at_Bazz_internal_3 --> -16($fp) - lw $t8, 12($s1) - sw $t8, -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) + # LOCAL local_doh_at_Bazz_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -20($fp) # LOCAL local_doh_at_Bazz_internal_2 --> -12($fp) # LOCAL local_doh_at_Bazz_internal_3 --> -16($fp) - # local_doh_at_Bazz_internal_2 = local_doh_at_Bazz_internal_3 + 1 - lw $t8, -16($fp) - add $t8, $t8, 1 - sw $t8, -12($fp) + # LOCAL local_doh_at_Bazz_internal_4 --> -20($fp) + # local_doh_at_Bazz_internal_2 = local_doh_at_Bazz_internal_3 + local_doh_at_Bazz_internal_4 + lw $t1, -16($fp) + lw $t0, 12($t1) + lw $t1, -20($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -12($fp) # # LOCAL local_doh_at_Bazz_internal_2 --> -12($fp) - lw $t8, -12($fp) - sw $t8, 12($s1) + lw $t0, -12($fp) + sw $t0, 12($s1) # RETURN local_doh_at_Bazz_i_0 lw $v0, -4($fp) # Deallocate stack frame for function function_doh_at_Bazz. @@ -1887,406 +2124,406 @@ function_doh_at_Bazz: # @Params: __Foo__attrib__a__init: # Allocate stack frame for function __Foo__attrib__a__init. - subu $sp, $sp, 52 + subu $sp, $sp, 56 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 52 - # LOCAL local_trib__a__init_internal_0 --> -4($fp) - # local_trib__a__init_internal_0 = SELF - sw $s1, -4($fp) - # LOCAL local_trib__a__init_internal_0 --> -4($fp) + addu $fp, $sp, 56 + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # local_trib__a__init_internal_1 = SELF + sw $s1, -8($fp) # LOCAL local_trib__a__init_internal_1 --> -8($fp) - # local_trib__a__init_internal_1 = TYPEOF local_trib__a__init_internal_0 - lw $t8, -4($fp) + # LOCAL local_trib__a__init_internal_2 --> -12($fp) + # local_trib__a__init_internal_2 = TYPEOF local_trib__a__init_internal_1 + lw $t0, -8($fp) # Load pointer to type offset - lw $t9, 8($t8) - sw $t9, -8($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # local_trib__a__init_internal_4 = 13 - li $t8, 13 - sw $t8, -20($fp) - # local_trib__a__init_internal_5 = TYPE_DISTANCE Razz + lw $t1, 8($t0) + sw $t1, -12($fp) # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # local_trib__a__init_internal_5 = 13 + li $t0, 13 + sw $t0, -24($fp) + # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz - la $t8, Razz__TDT - lw $t9, -8($fp) - addu $t8, $t8, $t9 + la $t0, Razz__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 # Save distance - lw $t9, 0($t8) - sw $t9, -24($fp) + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # Update min if 24 < 25 - lw $t8, -24($fp) - lw $t9, -20($fp) - bgtu $t8, $t9, label_Not_min0_11 - # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_Not_min0_11 # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # local_trib__a__init_internal_4 = local_trib__a__init_internal_5 - lw $t8, -24($fp) - sw $t8, -20($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # local_trib__a__init_internal_5 = local_trib__a__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) label_Not_min0_11: - # local_trib__a__init_internal_5 = TYPE_DISTANCE Foo - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Foo - la $t8, Foo__TDT - lw $t9, -8($fp) - addu $t8, $t8, $t9 + la $t0, Foo__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 # Save distance - lw $t9, 0($t8) - sw $t9, -24($fp) + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # Update min if 24 < 25 - lw $t8, -24($fp) - lw $t9, -20($fp) - bgtu $t8, $t9, label_Not_min1_12 - # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_Not_min1_12 # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # local_trib__a__init_internal_4 = local_trib__a__init_internal_5 - lw $t8, -24($fp) - sw $t8, -20($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # local_trib__a__init_internal_5 = local_trib__a__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) label_Not_min1_12: - # local_trib__a__init_internal_5 = TYPE_DISTANCE Bar - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar - la $t8, Bar__TDT - lw $t9, -8($fp) - addu $t8, $t8, $t9 + la $t0, Bar__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 # Save distance - lw $t9, 0($t8) - sw $t9, -24($fp) + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # Update min if 24 < 25 - lw $t8, -24($fp) - lw $t9, -20($fp) - bgtu $t8, $t9, label_Not_min2_13 - # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_Not_min2_13 # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # local_trib__a__init_internal_4 = local_trib__a__init_internal_5 - lw $t8, -24($fp) - sw $t8, -20($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # local_trib__a__init_internal_5 = local_trib__a__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) label_Not_min2_13: + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # local_trib__a__init_internal_6 = 13 + li $t0, 13 + sw $t0, -28($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # local_trib__a__init_internal_5 = 13 - li $t8, 13 - sw $t8, -24($fp) + # Load pointers and SUB + lw $a0, -28($fp) + lw $a1, -24($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_trib__a__init_internal_3 GOTO label_ERROR_14 + # IF_ZERO local_trib__a__init_internal_3 GOTO label_ERROR_14 + lw $t0, -16($fp) + beq $t0, 0, label_ERROR_14 + # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz + # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # local_trib__a__init_internal_2 = local_trib__a__init_internal_5 - local_trib__a__init_internal_4 - lw $t8, -24($fp) - lw $t9, -20($fp) - sub $t8, $t8, $t9 - sw $t8, -12($fp) - # IF_ZERO local_trib__a__init_internal_2 GOTO label_ERROR_14 - # IF_ZERO local_trib__a__init_internal_2 GOTO label_ERROR_14 - lw $t8, -12($fp) - beq $t8, 0, label_ERROR_14 - # local_trib__a__init_internal_5 = TYPE_DISTANCE Razz - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) # Load TDT pointer to type Razz - la $t8, Razz__TDT - lw $t9, -8($fp) - addu $t8, $t8, $t9 + la $t0, Razz__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 # Save distance - lw $t9, 0($t8) - sw $t9, -24($fp) + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # Update min if 24 < 25 - lw $t8, -24($fp) - lw $t9, -20($fp) - bgtu $t8, $t9, label_NEXT0_16 - # LOCAL local_trib__a__init_n_6 --> -28($fp) - # LOCAL local_trib__a__init_internal_0 --> -4($fp) - # local_trib__a__init_n_6 = local_trib__a__init_internal_0 - lw $t8, -4($fp) - sw $t8, -28($fp) - # LOCAL local_trib__a__init_internal_7 --> -32($fp) - # local_trib__a__init_internal_7 = ALLOCATE Bar + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_NEXT0_16 + # LOCAL local_trib__a__init_n_7 --> -32($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # local_trib__a__init_n_7 = local_trib__a__init_internal_1 + lw $t0, -8($fp) + sw $t0, -32($fp) + # LOCAL local_trib__a__init_internal_8 --> -36($fp) + # local_trib__a__init_internal_8 = ALLOCATE Bar # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $s2, String - sw $s2, 0($v0) - la $s2, String_start - sw $s2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $s2, 8 - sw $s2, 8($v0) - la $s2, Bar - sw $s2, 12($v0) - li $s2, 3 - sw $s2, 16($v0) - move $s2, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bar + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 48 bytes of memory li $a0, 48 li $v0, 9 syscall - sw $s2, 0($v0) - la $s2, Bar_start - sw $s2, 4($v0) + sw $t0, 0($v0) + la $t0, Bar_start + sw $t0, 4($v0) # Load type offset - li $s2, 32 - sw $s2, 8($v0) - move $t9, $v0 + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t9 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t9, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t9) - # Push register t9 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t9, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t9) - # Push register t9 into stack + sw $v0, 16($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t9, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 20($t9) - # Push register t9 into stack + sw $v0, 20($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t9, 0($sp) + sw $t1, 0($sp) jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 24($t9) - # Push register t9 into stack + sw $v0, 24($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t9, 0($sp) + sw $t1, 0($sp) jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 28($t9) - # Push register t9 into stack + sw $v0, 28($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t9, 0($sp) + sw $t1, 0($sp) jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 32($t9) - # Push register t9 into stack + sw $v0, 32($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t9, 0($sp) + sw $t1, 0($sp) jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 36($t9) - # Push register t9 into stack + sw $v0, 36($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t9, 0($sp) + sw $t1, 0($sp) jal __Bar__attrib__c__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 40($t9) - # Push register t9 into stack + sw $v0, 40($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t9, 0($sp) + sw $t1, 0($sp) jal __Bar__attrib__d__init - # Pop 4 bytes from stack into register t9 - lw $t9, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 44($t9) + sw $v0, 44($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t9, -32($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # LOCAL local_trib__a__init_internal_7 --> -32($fp) - # local_trib__a__init_internal_3 = local_trib__a__init_internal_7 - lw $t9, -32($fp) - sw $t9, -16($fp) + sw $t1, -36($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_8 --> -36($fp) + # local_trib__a__init_internal_4 = local_trib__a__init_internal_8 + lw $t0, -36($fp) + sw $t0, -20($fp) # GOTO label_END_15 j label_END_15 label_NEXT0_16: - # local_trib__a__init_internal_5 = TYPE_DISTANCE Foo - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Foo - la $t9, Foo__TDT - lw $s2, -8($fp) - addu $t9, $t9, $s2 + la $t0, Foo__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 # Save distance - lw $s2, 0($t9) - sw $s2, -24($fp) + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # Update min if 25 < 18 - lw $t9, -24($fp) - lw $s2, -20($fp) - bgtu $t9, $s2, label_NEXT1_17 - # LOCAL local_trib__a__init_n_8 --> -36($fp) - # LOCAL local_trib__a__init_internal_0 --> -4($fp) - # local_trib__a__init_n_8 = local_trib__a__init_internal_0 - lw $t9, -4($fp) - sw $t9, -36($fp) - # LOCAL local_trib__a__init_internal_9 --> -40($fp) - # local_trib__a__init_internal_9 = ALLOCATE Razz + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_NEXT1_17 + # LOCAL local_trib__a__init_n_9 --> -40($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # local_trib__a__init_n_9 = local_trib__a__init_internal_1 + lw $t0, -8($fp) + sw $t0, -40($fp) + # LOCAL local_trib__a__init_internal_10 --> -44($fp) + # local_trib__a__init_internal_10 = ALLOCATE Razz # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $s3, String - sw $s3, 0($v0) - la $s3, String_start - sw $s3, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $s3, 8 - sw $s3, 8($v0) - la $s3, Razz - sw $s3, 12($v0) - li $s3, 4 - sw $s3, 16($v0) - move $s3, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Razz + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 40 bytes of memory li $a0, 40 li $v0, 9 syscall - sw $s3, 0($v0) - la $s3, Razz_start - sw $s3, 4($v0) + sw $t0, 0($v0) + la $t0, Razz_start + sw $t0, 4($v0) # Load type offset - li $s3, 28 - sw $s3, 8($v0) - move $s2, $v0 + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register s2 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $s2, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register s2 - lw $s2, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($s2) - # Push register s2 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $s2, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register s2 - lw $s2, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($s2) - # Push register s2 into stack + sw $v0, 16($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $s2, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register s2 - lw $s2, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 20($s2) - # Push register s2 into stack + sw $v0, 20($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $s2, 0($sp) + sw $t1, 0($sp) jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register s2 - lw $s2, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 24($s2) - # Push register s2 into stack + sw $v0, 24($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $s2, 0($sp) + sw $t1, 0($sp) jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register s2 - lw $s2, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 28($s2) - # Push register s2 into stack + sw $v0, 28($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $s2, 0($sp) + sw $t1, 0($sp) jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register s2 - lw $s2, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 32($s2) - # Push register s2 into stack + sw $v0, 32($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $s2, 0($sp) + sw $t1, 0($sp) jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register s2 - lw $s2, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 36($s2) + sw $v0, 36($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $s2, -40($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # LOCAL local_trib__a__init_internal_9 --> -40($fp) - # local_trib__a__init_internal_3 = local_trib__a__init_internal_9 - lw $s2, -40($fp) - sw $s2, -16($fp) + sw $t1, -44($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_10 --> -44($fp) + # local_trib__a__init_internal_4 = local_trib__a__init_internal_10 + lw $t0, -44($fp) + sw $t0, -20($fp) # GOTO label_END_15 j label_END_15 label_NEXT1_17: - # local_trib__a__init_internal_5 = TYPE_DISTANCE Bar - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar - la $s2, Bar__TDT - lw $s3, -8($fp) - addu $s2, $s2, $s3 + la $t0, Bar__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 # Save distance - lw $s3, 0($s2) - sw $s3, -24($fp) + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_NEXT2_18 + # LOCAL local_trib__a__init_n_11 --> -48($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # local_trib__a__init_n_11 = local_trib__a__init_internal_1 + lw $t0, -8($fp) + sw $t0, -48($fp) # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # Update min if 18 < 19 - lw $s2, -24($fp) - lw $s3, -20($fp) - bgtu $s2, $s3, label_NEXT2_18 - # LOCAL local_trib__a__init_n_10 --> -44($fp) - # LOCAL local_trib__a__init_internal_0 --> -4($fp) - # local_trib__a__init_n_10 = local_trib__a__init_internal_0 - lw $s2, -4($fp) - sw $s2, -44($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # LOCAL local_trib__a__init_n_10 --> -44($fp) - # local_trib__a__init_internal_3 = local_trib__a__init_n_10 - lw $s2, -44($fp) - sw $s2, -16($fp) + # LOCAL local_trib__a__init_n_11 --> -48($fp) + # local_trib__a__init_internal_4 = local_trib__a__init_n_11 + lw $t0, -48($fp) + sw $t0, -20($fp) # GOTO label_END_15 j label_END_15 label_NEXT2_18: label_ERROR_14: - # LOCAL local_trib__a__init_internal_0 --> -4($fp) - lw $s2, 0($s1) - sw $s2, -4($fp) - # LOCAL local_trib__a__init_internal_0 --> -4($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + lw $t0, 0($s1) + sw $t0, -8($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) la $a0, data_1 li $v0, 4 syscall - lw $a0, -4($fp) + lw $a0, -8($fp) li $v0, 4 syscall la $a0, data_2 @@ -2295,15 +2532,15 @@ label_NEXT2_18: li $v0, 10 syscall label_END_15: -# RETURN local_trib__a__init_internal_3 -lw $v0, -16($fp) +# RETURN local_trib__a__init_internal_4 +lw $v0, -20($fp) # Deallocate stack frame for function __Foo__attrib__a__init. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 52 +addu $sp, $sp, 56 jr $ra # Function END @@ -2312,157 +2549,247 @@ jr $ra # @Params: __Foo__attrib__b__init: # Allocate stack frame for function __Foo__attrib__b__init. - subu $sp, $sp, 68 + subu $sp, $sp, 72 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 68 - # local_trib__b__init_internal_5 = GETATTRIBUTE a Foo - # LOCAL local_trib__b__init_internal_5 --> -24($fp) - lw $s2, 24($s1) - sw $s2, -24($fp) - # LOCAL local_trib__b__init_internal_3 --> -16($fp) - # LOCAL local_trib__b__init_internal_5 --> -24($fp) - # local_trib__b__init_internal_3 = local_trib__b__init_internal_5 - lw $s2, -24($fp) - sw $s2, -16($fp) + addu $fp, $sp, 72 + # local_trib__b__init_internal_6 = GETATTRIBUTE a Foo + # LOCAL local_trib__b__init_internal_6 --> -28($fp) + lw $t0, 24($s1) + sw $t0, -28($fp) + # LOCAL local_trib__b__init_internal_4 --> -20($fp) + # LOCAL local_trib__b__init_internal_6 --> -28($fp) + # local_trib__b__init_internal_4 = local_trib__b__init_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_trib__b__init_internal_3 --> -16($fp) # LOCAL local_trib__b__init_internal_4 --> -20($fp) - # local_trib__b__init_internal_4 = VCALL local_trib__b__init_internal_3 doh + # LOCAL local_trib__b__init_internal_5 --> -24($fp) + # local_trib__b__init_internal_5 = VCALL local_trib__b__init_internal_4 doh # Save new self pointer in $s1 - lw $s1, -16($fp) + lw $s1, -20($fp) # Get pointer to type - lw $s2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s3, 0($s2) + lw $t0, 0($t0) # Get pointer to function address - lw $s4, 32($s3) + lw $t0, 32($t0) # Call function. Result is on $v0 - jalr $s4 - sw $v0, -20($fp) + jalr $t0 + sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # local_trib__b__init_internal_8 = GETATTRIBUTE g Foo - # LOCAL local_trib__b__init_internal_8 --> -36($fp) - lw $s2, 16($s1) - sw $s2, -36($fp) - # LOCAL local_trib__b__init_internal_6 --> -28($fp) - # LOCAL local_trib__b__init_internal_8 --> -36($fp) - # local_trib__b__init_internal_6 = local_trib__b__init_internal_8 - lw $s2, -36($fp) - sw $s2, -28($fp) + # local_trib__b__init_internal_9 = GETATTRIBUTE g Foo + # LOCAL local_trib__b__init_internal_9 --> -40($fp) + lw $t0, 16($s1) + sw $t0, -40($fp) + # LOCAL local_trib__b__init_internal_7 --> -32($fp) + # LOCAL local_trib__b__init_internal_9 --> -40($fp) + # local_trib__b__init_internal_7 = local_trib__b__init_internal_9 + lw $t0, -40($fp) + sw $t0, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_trib__b__init_internal_6 --> -28($fp) # LOCAL local_trib__b__init_internal_7 --> -32($fp) - # local_trib__b__init_internal_7 = VCALL local_trib__b__init_internal_6 doh + # LOCAL local_trib__b__init_internal_8 --> -36($fp) + # local_trib__b__init_internal_8 = VCALL local_trib__b__init_internal_7 doh # Save new self pointer in $s1 - lw $s1, -28($fp) + lw $s1, -32($fp) # Get pointer to type - lw $s2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s3, 0($s2) + lw $t0, 0($t0) # Get pointer to function address - lw $s4, 32($s3) + lw $t0, 32($t0) # Call function. Result is on $v0 - jalr $s4 - sw $v0, -32($fp) + jalr $t0 + sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_trib__b__init_internal_2 --> -12($fp) - # LOCAL local_trib__b__init_internal_4 --> -20($fp) - # LOCAL local_trib__b__init_internal_7 --> -32($fp) - # local_trib__b__init_internal_2 = local_trib__b__init_internal_4 + local_trib__b__init_internal_7 - lw $s2, -20($fp) - lw $s3, -32($fp) - add $s2, $s2, $s3 - sw $s2, -12($fp) - # LOCAL local_trib__b__init_internal_11 --> -48($fp) - # local_trib__b__init_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_trib__b__init_internal_9 --> -40($fp) - # LOCAL local_trib__b__init_internal_11 --> -48($fp) - # local_trib__b__init_internal_9 = local_trib__b__init_internal_11 - lw $s2, -48($fp) - sw $s2, -40($fp) + # LOCAL local_trib__b__init_internal_3 --> -16($fp) + # LOCAL local_trib__b__init_internal_5 --> -24($fp) + # LOCAL local_trib__b__init_internal_8 --> -36($fp) + # local_trib__b__init_internal_3 = local_trib__b__init_internal_5 + local_trib__b__init_internal_8 + lw $t1, -24($fp) + lw $t0, 12($t1) + lw $t1, -36($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -16($fp) + # LOCAL local_trib__b__init_internal_12 --> -52($fp) + # local_trib__b__init_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_trib__b__init_internal_10 --> -44($fp) + # LOCAL local_trib__b__init_internal_12 --> -52($fp) + # local_trib__b__init_internal_10 = local_trib__b__init_internal_12 + lw $t0, -52($fp) + sw $t0, -44($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_trib__b__init_internal_9 --> -40($fp) # LOCAL local_trib__b__init_internal_10 --> -44($fp) - # local_trib__b__init_internal_10 = VCALL local_trib__b__init_internal_9 doh + # LOCAL local_trib__b__init_internal_11 --> -48($fp) + # local_trib__b__init_internal_11 = VCALL local_trib__b__init_internal_10 doh # Save new self pointer in $s1 - lw $s1, -40($fp) + lw $s1, -44($fp) # Get pointer to type - lw $s2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s3, 0($s2) + lw $t0, 0($t0) # Get pointer to function address - lw $s4, 32($s3) + lw $t0, 32($t0) # Call function. Result is on $v0 - jalr $s4 - sw $v0, -44($fp) + jalr $t0 + sw $v0, -48($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_trib__b__init_internal_1 --> -8($fp) # LOCAL local_trib__b__init_internal_2 --> -12($fp) - # LOCAL local_trib__b__init_internal_10 --> -44($fp) - # local_trib__b__init_internal_1 = local_trib__b__init_internal_2 + local_trib__b__init_internal_10 - lw $s2, -12($fp) - lw $s3, -44($fp) - add $s2, $s2, $s3 - sw $s2, -8($fp) - # LOCAL local_trib__b__init_internal_14 --> -60($fp) - # local_trib__b__init_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_trib__b__init_internal_12 --> -52($fp) - # LOCAL local_trib__b__init_internal_14 --> -60($fp) - # local_trib__b__init_internal_12 = local_trib__b__init_internal_14 - lw $s2, -60($fp) - sw $s2, -52($fp) + # LOCAL local_trib__b__init_internal_3 --> -16($fp) + # LOCAL local_trib__b__init_internal_11 --> -48($fp) + # local_trib__b__init_internal_2 = local_trib__b__init_internal_3 + local_trib__b__init_internal_11 + lw $t1, -16($fp) + lw $t0, 12($t1) + lw $t1, -48($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_trib__b__init_internal_15 --> -64($fp) + # local_trib__b__init_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_trib__b__init_internal_13 --> -56($fp) + # LOCAL local_trib__b__init_internal_15 --> -64($fp) + # local_trib__b__init_internal_13 = local_trib__b__init_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_trib__b__init_internal_12 --> -52($fp) # LOCAL local_trib__b__init_internal_13 --> -56($fp) - # local_trib__b__init_internal_13 = VCALL local_trib__b__init_internal_12 printh + # LOCAL local_trib__b__init_internal_14 --> -60($fp) + # local_trib__b__init_internal_14 = VCALL local_trib__b__init_internal_13 printh # Save new self pointer in $s1 - lw $s1, -52($fp) + lw $s1, -56($fp) # Get pointer to type - lw $s2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s3, 0($s2) + lw $t0, 0($t0) # Get pointer to function address - lw $s4, 28($s3) + lw $t0, 28($t0) # Call function. Result is on $v0 - jalr $s4 - sw $v0, -56($fp) + jalr $t0 + sw $v0, -60($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_trib__b__init_internal_0 --> -4($fp) # LOCAL local_trib__b__init_internal_1 --> -8($fp) - # LOCAL local_trib__b__init_internal_13 --> -56($fp) - # local_trib__b__init_internal_0 = local_trib__b__init_internal_1 + local_trib__b__init_internal_13 - lw $s2, -8($fp) - lw $s3, -56($fp) - add $s2, $s2, $s3 - sw $s2, -4($fp) - # RETURN local_trib__b__init_internal_0 - lw $v0, -4($fp) + # LOCAL local_trib__b__init_internal_2 --> -12($fp) + # LOCAL local_trib__b__init_internal_14 --> -60($fp) + # local_trib__b__init_internal_1 = local_trib__b__init_internal_2 + local_trib__b__init_internal_14 + lw $t1, -12($fp) + lw $t0, 12($t1) + lw $t1, -60($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_trib__b__init_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function __Foo__attrib__b__init. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 68 + addu $sp, $sp, 72 jr $ra # Function END @@ -2475,29 +2802,123 @@ function_doh_at_Foo: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 + # LOCAL local_doh_at_Foo_i_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) # local_doh_at_Foo_internal_1 = GETATTRIBUTE h Foo # LOCAL local_doh_at_Foo_internal_1 --> -8($fp) - lw $s2, 12($s1) - sw $s2, -8($fp) + lw $t0, 12($s1) + sw $t0, -8($fp) # LOCAL local_doh_at_Foo_i_0 --> -4($fp) # LOCAL local_doh_at_Foo_internal_1 --> -8($fp) # local_doh_at_Foo_i_0 = local_doh_at_Foo_internal_1 - lw $s2, -8($fp) - sw $s2, -4($fp) + lw $t0, -8($fp) + sw $t0, -4($fp) # local_doh_at_Foo_internal_3 = GETATTRIBUTE h Foo # LOCAL local_doh_at_Foo_internal_3 --> -16($fp) - lw $s2, 12($s1) - sw $s2, -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) + # LOCAL local_doh_at_Foo_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 2 + sw $t0, 12($v0) + sw $v0, -20($fp) # LOCAL local_doh_at_Foo_internal_2 --> -12($fp) # LOCAL local_doh_at_Foo_internal_3 --> -16($fp) - # local_doh_at_Foo_internal_2 = local_doh_at_Foo_internal_3 + 2 - lw $s2, -16($fp) - add $s2, $s2, 2 - sw $s2, -12($fp) + # LOCAL local_doh_at_Foo_internal_4 --> -20($fp) + # local_doh_at_Foo_internal_2 = local_doh_at_Foo_internal_3 + local_doh_at_Foo_internal_4 + lw $t1, -16($fp) + lw $t0, 12($t1) + lw $t1, -20($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -12($fp) # # LOCAL local_doh_at_Foo_internal_2 --> -12($fp) - lw $s2, -12($fp) - sw $s2, 12($s1) + lw $t0, -12($fp) + sw $t0, 12($s1) # RETURN local_doh_at_Foo_i_0 lw $v0, -4($fp) # Deallocate stack frame for function function_doh_at_Foo. @@ -2515,261 +2936,261 @@ function_doh_at_Foo: # @Params: __Razz__attrib__e__init: # Allocate stack frame for function __Razz__attrib__e__init. - subu $sp, $sp, 44 + subu $sp, $sp, 48 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 44 - # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) - # local_ttrib__e__init_internal_0 = SELF - sw $s1, -4($fp) - # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) + addu $fp, $sp, 48 + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # local_ttrib__e__init_internal_1 = SELF + sw $s1, -8($fp) # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) - # local_ttrib__e__init_internal_1 = TYPEOF local_ttrib__e__init_internal_0 - lw $s2, -4($fp) + # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) + # local_ttrib__e__init_internal_2 = TYPEOF local_ttrib__e__init_internal_1 + lw $t0, -8($fp) # Load pointer to type offset - lw $s3, 8($s2) - sw $s3, -8($fp) - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # local_ttrib__e__init_internal_4 = 13 - li $s2, 13 - sw $s2, -20($fp) - # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Razz + lw $t1, 8($t0) + sw $t1, -12($fp) # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # local_ttrib__e__init_internal_5 = 13 + li $t0, 13 + sw $t0, -24($fp) + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz - la $s2, Razz__TDT - lw $s3, -8($fp) - addu $s2, $s2, $s3 + la $t0, Razz__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 # Save distance - lw $s3, 0($s2) - sw $s3, -24($fp) + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # Update min if 18 < 19 - lw $s2, -24($fp) - lw $s3, -20($fp) - bgtu $s2, $s3, label_Not_min0_19 - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_Not_min0_19 # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # local_ttrib__e__init_internal_4 = local_ttrib__e__init_internal_5 - lw $s2, -24($fp) - sw $s2, -20($fp) + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # local_ttrib__e__init_internal_5 = local_ttrib__e__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) label_Not_min0_19: - # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar - la $s2, Bar__TDT - lw $s3, -8($fp) - addu $s2, $s2, $s3 + la $t0, Bar__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 # Save distance - lw $s3, 0($s2) - sw $s3, -24($fp) + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # Update min if 18 < 19 - lw $s2, -24($fp) - lw $s3, -20($fp) - bgtu $s2, $s3, label_Not_min1_20 - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_Not_min1_20 # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # local_ttrib__e__init_internal_4 = local_ttrib__e__init_internal_5 - lw $s2, -24($fp) - sw $s2, -20($fp) + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # local_ttrib__e__init_internal_5 = local_ttrib__e__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) label_Not_min1_20: + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # local_ttrib__e__init_internal_6 = 13 + li $t0, 13 + sw $t0, -28($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # local_ttrib__e__init_internal_5 = 13 - li $s2, 13 - sw $s2, -24($fp) + # Load pointers and SUB + lw $a0, -28($fp) + lw $a1, -24($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_ttrib__e__init_internal_3 GOTO label_ERROR_21 + # IF_ZERO local_ttrib__e__init_internal_3 GOTO label_ERROR_21 + lw $t0, -16($fp) + beq $t0, 0, label_ERROR_21 + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # local_ttrib__e__init_internal_2 = local_ttrib__e__init_internal_5 - local_ttrib__e__init_internal_4 - lw $s2, -24($fp) - lw $s3, -20($fp) - sub $s2, $s2, $s3 - sw $s2, -12($fp) - # IF_ZERO local_ttrib__e__init_internal_2 GOTO label_ERROR_21 - # IF_ZERO local_ttrib__e__init_internal_2 GOTO label_ERROR_21 - lw $s2, -12($fp) - beq $s2, 0, label_ERROR_21 - # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) # Load TDT pointer to type Razz - la $s2, Razz__TDT - lw $s3, -8($fp) - addu $s2, $s2, $s3 + la $t0, Razz__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 # Save distance - lw $s3, 0($s2) - sw $s3, -24($fp) + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # Update min if 18 < 19 - lw $s2, -24($fp) - lw $s3, -20($fp) - bgtu $s2, $s3, label_NEXT0_23 - # LOCAL local_ttrib__e__init_n_6 --> -28($fp) - # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) - # local_ttrib__e__init_n_6 = local_ttrib__e__init_internal_0 - lw $s2, -4($fp) - sw $s2, -28($fp) - # LOCAL local_ttrib__e__init_internal_7 --> -32($fp) - # local_ttrib__e__init_internal_7 = ALLOCATE Bar + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_NEXT0_23 + # LOCAL local_ttrib__e__init_n_7 --> -32($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # local_ttrib__e__init_n_7 = local_ttrib__e__init_internal_1 + lw $t0, -8($fp) + sw $t0, -32($fp) + # LOCAL local_ttrib__e__init_internal_8 --> -36($fp) + # local_ttrib__e__init_internal_8 = ALLOCATE Bar # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $s4, String - sw $s4, 0($v0) - la $s4, String_start - sw $s4, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $s4, 8 - sw $s4, 8($v0) - la $s4, Bar - sw $s4, 12($v0) - li $s4, 3 - sw $s4, 16($v0) - move $s4, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bar + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 48 bytes of memory li $a0, 48 li $v0, 9 syscall - sw $s4, 0($v0) - la $s4, Bar_start - sw $s4, 4($v0) + sw $t0, 0($v0) + la $t0, Bar_start + sw $t0, 4($v0) # Load type offset - li $s4, 32 - sw $s4, 8($v0) - move $s3, $v0 + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register s3 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $s3, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register s3 - lw $s3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($s3) - # Push register s3 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $s3, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register s3 - lw $s3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($s3) - # Push register s3 into stack + sw $v0, 16($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $s3, 0($sp) + sw $t1, 0($sp) jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register s3 - lw $s3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 20($s3) - # Push register s3 into stack + sw $v0, 20($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $s3, 0($sp) + sw $t1, 0($sp) jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register s3 - lw $s3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 24($s3) - # Push register s3 into stack + sw $v0, 24($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $s3, 0($sp) + sw $t1, 0($sp) jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register s3 - lw $s3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 28($s3) - # Push register s3 into stack + sw $v0, 28($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $s3, 0($sp) + sw $t1, 0($sp) jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register s3 - lw $s3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 32($s3) - # Push register s3 into stack + sw $v0, 32($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $s3, 0($sp) + sw $t1, 0($sp) jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register s3 - lw $s3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 36($s3) - # Push register s3 into stack + sw $v0, 36($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $s3, 0($sp) + sw $t1, 0($sp) jal __Bar__attrib__c__init - # Pop 4 bytes from stack into register s3 - lw $s3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 40($s3) - # Push register s3 into stack + sw $v0, 40($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $s3, 0($sp) + sw $t1, 0($sp) jal __Bar__attrib__d__init - # Pop 4 bytes from stack into register s3 - lw $s3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 44($s3) + sw $v0, 44($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $s3, -32($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__e__init_internal_7 --> -32($fp) - # local_ttrib__e__init_internal_3 = local_ttrib__e__init_internal_7 - lw $s3, -32($fp) - sw $s3, -16($fp) + sw $t1, -36($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_8 --> -36($fp) + # local_ttrib__e__init_internal_4 = local_ttrib__e__init_internal_8 + lw $t0, -36($fp) + sw $t0, -20($fp) # GOTO label_END_22 j label_END_22 label_NEXT0_23: - # local_ttrib__e__init_internal_5 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar - la $s3, Bar__TDT - lw $s4, -8($fp) - addu $s3, $s3, $s4 + la $t0, Bar__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 # Save distance - lw $s4, 0($s3) - sw $s4, -24($fp) + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_NEXT1_24 + # LOCAL local_ttrib__e__init_n_9 --> -40($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # local_ttrib__e__init_n_9 = local_ttrib__e__init_internal_1 + lw $t0, -8($fp) + sw $t0, -40($fp) # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # Update min if 19 < 20 - lw $s3, -24($fp) - lw $s4, -20($fp) - bgtu $s3, $s4, label_NEXT1_24 - # LOCAL local_ttrib__e__init_n_8 --> -36($fp) - # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) - # local_ttrib__e__init_n_8 = local_ttrib__e__init_internal_0 - lw $s3, -4($fp) - sw $s3, -36($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__e__init_n_8 --> -36($fp) - # local_ttrib__e__init_internal_3 = local_ttrib__e__init_n_8 - lw $s3, -36($fp) - sw $s3, -16($fp) + # LOCAL local_ttrib__e__init_n_9 --> -40($fp) + # local_ttrib__e__init_internal_4 = local_ttrib__e__init_n_9 + lw $t0, -40($fp) + sw $t0, -20($fp) # GOTO label_END_22 j label_END_22 label_NEXT1_24: label_ERROR_21: - # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) - lw $s3, 0($s1) - sw $s3, -4($fp) - # LOCAL local_ttrib__e__init_internal_0 --> -4($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + lw $t0, 0($s1) + sw $t0, -8($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) la $a0, data_1 li $v0, 4 syscall - lw $a0, -4($fp) + lw $a0, -8($fp) li $v0, 4 syscall la $a0, data_2 @@ -2778,15 +3199,15 @@ label_NEXT1_24: li $v0, 10 syscall label_END_22: -# RETURN local_ttrib__e__init_internal_3 -lw $v0, -16($fp) +# RETURN local_ttrib__e__init_internal_4 +lw $v0, -20($fp) # Deallocate stack frame for function __Razz__attrib__e__init. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 44 +addu $sp, $sp, 48 jr $ra # Function END @@ -2795,187 +3216,307 @@ jr $ra # @Params: __Razz__attrib__f__init: # Allocate stack frame for function __Razz__attrib__f__init. - subu $sp, $sp, 80 + subu $sp, $sp, 84 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 80 - # local_ttrib__f__init_internal_5 = GETATTRIBUTE a Razz - # LOCAL local_ttrib__f__init_internal_5 --> -24($fp) - lw $s3, 24($s1) - sw $s3, -24($fp) + addu $fp, $sp, 84 + # local_ttrib__f__init_internal_6 = GETATTRIBUTE a Razz + # LOCAL local_ttrib__f__init_internal_6 --> -28($fp) + lw $t0, 24($s1) + sw $t0, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_ttrib__f__init_internal_4 = CALL doh - # LOCAL local_ttrib__f__init_internal_4 --> -20($fp) + # local_ttrib__f__init_internal_5 = CALL doh # LOCAL local_ttrib__f__init_internal_5 --> -24($fp) + # LOCAL local_ttrib__f__init_internal_6 --> -28($fp) # Save new self pointer in $s1 - lw $s1, -24($fp) + lw $s1, -28($fp) # Get pointer to type's VTABLE - la $s3, Bazz_vtable + la $t0, Bazz_vtable # Get pointer to function address - lw $s4, 32($s3) + lw $t1, 32($t0) # Call function. Result is on $v0 - jalr $s4 - sw $v0, -20($fp) + jalr $t1 + sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # local_ttrib__f__init_internal_8 = GETATTRIBUTE g Razz - # LOCAL local_ttrib__f__init_internal_8 --> -36($fp) - lw $s3, 16($s1) - sw $s3, -36($fp) - # LOCAL local_ttrib__f__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__f__init_internal_8 --> -36($fp) - # local_ttrib__f__init_internal_6 = local_ttrib__f__init_internal_8 - lw $s3, -36($fp) - sw $s3, -28($fp) + # local_ttrib__f__init_internal_9 = GETATTRIBUTE g Razz + # LOCAL local_ttrib__f__init_internal_9 --> -40($fp) + lw $t0, 16($s1) + sw $t0, -40($fp) + # LOCAL local_ttrib__f__init_internal_7 --> -32($fp) + # LOCAL local_ttrib__f__init_internal_9 --> -40($fp) + # local_ttrib__f__init_internal_7 = local_ttrib__f__init_internal_9 + lw $t0, -40($fp) + sw $t0, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_ttrib__f__init_internal_6 --> -28($fp) # LOCAL local_ttrib__f__init_internal_7 --> -32($fp) - # local_ttrib__f__init_internal_7 = VCALL local_ttrib__f__init_internal_6 doh + # LOCAL local_ttrib__f__init_internal_8 --> -36($fp) + # local_ttrib__f__init_internal_8 = VCALL local_ttrib__f__init_internal_7 doh # Save new self pointer in $s1 - lw $s1, -28($fp) + lw $s1, -32($fp) # Get pointer to type - lw $s3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s4, 0($s3) + lw $t0, 0($t0) # Get pointer to function address - lw $s5, 32($s4) + lw $t0, 32($t0) # Call function. Result is on $v0 - jalr $s5 - sw $v0, -32($fp) + jalr $t0 + sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_ttrib__f__init_internal_3 --> -16($fp) # LOCAL local_ttrib__f__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__f__init_internal_7 --> -32($fp) - # local_ttrib__f__init_internal_3 = local_ttrib__f__init_internal_4 + local_ttrib__f__init_internal_7 - lw $s3, -20($fp) - lw $s4, -32($fp) - add $s3, $s3, $s4 - sw $s3, -16($fp) - # local_ttrib__f__init_internal_11 = GETATTRIBUTE e Razz - # LOCAL local_ttrib__f__init_internal_11 --> -48($fp) - lw $s3, 32($s1) - sw $s3, -48($fp) - # LOCAL local_ttrib__f__init_internal_9 --> -40($fp) - # LOCAL local_ttrib__f__init_internal_11 --> -48($fp) - # local_ttrib__f__init_internal_9 = local_ttrib__f__init_internal_11 - lw $s3, -48($fp) - sw $s3, -40($fp) + # LOCAL local_ttrib__f__init_internal_5 --> -24($fp) + # LOCAL local_ttrib__f__init_internal_8 --> -36($fp) + # local_ttrib__f__init_internal_4 = local_ttrib__f__init_internal_5 + local_ttrib__f__init_internal_8 + lw $t1, -24($fp) + lw $t0, 12($t1) + lw $t1, -36($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -20($fp) + # local_ttrib__f__init_internal_12 = GETATTRIBUTE e Razz + # LOCAL local_ttrib__f__init_internal_12 --> -52($fp) + lw $t0, 32($s1) + sw $t0, -52($fp) + # LOCAL local_ttrib__f__init_internal_10 --> -44($fp) + # LOCAL local_ttrib__f__init_internal_12 --> -52($fp) + # local_ttrib__f__init_internal_10 = local_ttrib__f__init_internal_12 + lw $t0, -52($fp) + sw $t0, -44($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_ttrib__f__init_internal_9 --> -40($fp) # LOCAL local_ttrib__f__init_internal_10 --> -44($fp) - # local_ttrib__f__init_internal_10 = VCALL local_ttrib__f__init_internal_9 doh + # LOCAL local_ttrib__f__init_internal_11 --> -48($fp) + # local_ttrib__f__init_internal_11 = VCALL local_ttrib__f__init_internal_10 doh # Save new self pointer in $s1 - lw $s1, -40($fp) + lw $s1, -44($fp) # Get pointer to type - lw $s3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s4, 0($s3) + lw $t0, 0($t0) # Get pointer to function address - lw $s5, 32($s4) + lw $t0, 32($t0) # Call function. Result is on $v0 - jalr $s5 - sw $v0, -44($fp) + jalr $t0 + sw $v0, -48($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_ttrib__f__init_internal_2 --> -12($fp) # LOCAL local_ttrib__f__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__f__init_internal_10 --> -44($fp) - # local_ttrib__f__init_internal_2 = local_ttrib__f__init_internal_3 + local_ttrib__f__init_internal_10 - lw $s3, -16($fp) - lw $s4, -44($fp) - add $s3, $s3, $s4 - sw $s3, -12($fp) - # LOCAL local_ttrib__f__init_internal_14 --> -60($fp) - # local_ttrib__f__init_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_ttrib__f__init_internal_12 --> -52($fp) - # LOCAL local_ttrib__f__init_internal_14 --> -60($fp) - # local_ttrib__f__init_internal_12 = local_ttrib__f__init_internal_14 - lw $s3, -60($fp) - sw $s3, -52($fp) + # LOCAL local_ttrib__f__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__f__init_internal_11 --> -48($fp) + # local_ttrib__f__init_internal_3 = local_ttrib__f__init_internal_4 + local_ttrib__f__init_internal_11 + lw $t1, -20($fp) + lw $t0, 12($t1) + lw $t1, -48($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -16($fp) + # LOCAL local_ttrib__f__init_internal_15 --> -64($fp) + # local_ttrib__f__init_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_ttrib__f__init_internal_13 --> -56($fp) + # LOCAL local_ttrib__f__init_internal_15 --> -64($fp) + # local_ttrib__f__init_internal_13 = local_ttrib__f__init_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_ttrib__f__init_internal_12 --> -52($fp) # LOCAL local_ttrib__f__init_internal_13 --> -56($fp) - # local_ttrib__f__init_internal_13 = VCALL local_ttrib__f__init_internal_12 doh + # LOCAL local_ttrib__f__init_internal_14 --> -60($fp) + # local_ttrib__f__init_internal_14 = VCALL local_ttrib__f__init_internal_13 doh # Save new self pointer in $s1 - lw $s1, -52($fp) + lw $s1, -56($fp) # Get pointer to type - lw $s3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s4, 0($s3) + lw $t0, 0($t0) # Get pointer to function address - lw $s5, 32($s4) + lw $t0, 32($t0) # Call function. Result is on $v0 - jalr $s5 - sw $v0, -56($fp) + jalr $t0 + sw $v0, -60($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_ttrib__f__init_internal_1 --> -8($fp) # LOCAL local_ttrib__f__init_internal_2 --> -12($fp) - # LOCAL local_ttrib__f__init_internal_13 --> -56($fp) - # local_ttrib__f__init_internal_1 = local_ttrib__f__init_internal_2 + local_ttrib__f__init_internal_13 - lw $s3, -12($fp) - lw $s4, -56($fp) - add $s3, $s3, $s4 - sw $s3, -8($fp) - # LOCAL local_ttrib__f__init_internal_17 --> -72($fp) - # local_ttrib__f__init_internal_17 = SELF - sw $s1, -72($fp) - # LOCAL local_ttrib__f__init_internal_15 --> -64($fp) - # LOCAL local_ttrib__f__init_internal_17 --> -72($fp) - # local_ttrib__f__init_internal_15 = local_ttrib__f__init_internal_17 - lw $s3, -72($fp) - sw $s3, -64($fp) + # LOCAL local_ttrib__f__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__f__init_internal_14 --> -60($fp) + # local_ttrib__f__init_internal_2 = local_ttrib__f__init_internal_3 + local_ttrib__f__init_internal_14 + lw $t1, -16($fp) + lw $t0, 12($t1) + lw $t1, -60($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_ttrib__f__init_internal_18 --> -76($fp) + # local_ttrib__f__init_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_ttrib__f__init_internal_16 --> -68($fp) + # LOCAL local_ttrib__f__init_internal_18 --> -76($fp) + # local_ttrib__f__init_internal_16 = local_ttrib__f__init_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_ttrib__f__init_internal_15 --> -64($fp) # LOCAL local_ttrib__f__init_internal_16 --> -68($fp) - # local_ttrib__f__init_internal_16 = VCALL local_ttrib__f__init_internal_15 printh + # LOCAL local_ttrib__f__init_internal_17 --> -72($fp) + # local_ttrib__f__init_internal_17 = VCALL local_ttrib__f__init_internal_16 printh # Save new self pointer in $s1 - lw $s1, -64($fp) + lw $s1, -68($fp) # Get pointer to type - lw $s3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s4, 0($s3) + lw $t0, 0($t0) # Get pointer to function address - lw $s5, 28($s4) + lw $t0, 28($t0) # Call function. Result is on $v0 - jalr $s5 - sw $v0, -68($fp) + jalr $t0 + sw $v0, -72($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_ttrib__f__init_internal_0 --> -4($fp) # LOCAL local_ttrib__f__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__f__init_internal_16 --> -68($fp) - # local_ttrib__f__init_internal_0 = local_ttrib__f__init_internal_1 + local_ttrib__f__init_internal_16 - lw $s3, -8($fp) - lw $s4, -68($fp) - add $s3, $s3, $s4 - sw $s3, -4($fp) - # RETURN local_ttrib__f__init_internal_0 - lw $v0, -4($fp) + # LOCAL local_ttrib__f__init_internal_2 --> -12($fp) + # LOCAL local_ttrib__f__init_internal_17 --> -72($fp) + # local_ttrib__f__init_internal_1 = local_ttrib__f__init_internal_2 + local_ttrib__f__init_internal_17 + lw $t1, -12($fp) + lw $t0, 12($t1) + lw $t1, -72($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_ttrib__f__init_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function __Razz__attrib__f__init. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 80 + addu $sp, $sp, 84 jr $ra # Function END @@ -2988,36 +3529,36 @@ __Bar__attrib__c__init: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_trib__c__init_internal_2 --> -12($fp) - # local_trib__c__init_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_trib__c__init_internal_0 --> -4($fp) - # LOCAL local_trib__c__init_internal_2 --> -12($fp) - # local_trib__c__init_internal_0 = local_trib__c__init_internal_2 - lw $s3, -12($fp) - sw $s3, -4($fp) + # LOCAL local_trib__c__init_internal_3 --> -16($fp) + # local_trib__c__init_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_trib__c__init_internal_1 --> -8($fp) + # LOCAL local_trib__c__init_internal_3 --> -16($fp) + # local_trib__c__init_internal_1 = local_trib__c__init_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_trib__c__init_internal_0 --> -4($fp) # LOCAL local_trib__c__init_internal_1 --> -8($fp) - # local_trib__c__init_internal_1 = VCALL local_trib__c__init_internal_0 doh + # LOCAL local_trib__c__init_internal_2 --> -12($fp) + # local_trib__c__init_internal_2 = VCALL local_trib__c__init_internal_1 doh # Save new self pointer in $s1 - lw $s1, -4($fp) + lw $s1, -8($fp) # Get pointer to type - lw $s3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s4, 0($s3) + lw $t0, 0($t0) # Get pointer to function address - lw $s5, 32($s4) + lw $t0, 32($t0) # Call function. Result is on $v0 - jalr $s5 - sw $v0, -8($fp) + jalr $t0 + sw $v0, -12($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN local_trib__c__init_internal_1 - lw $v0, -8($fp) + # RETURN local_trib__c__init_internal_2 + lw $v0, -12($fp) # Deallocate stack frame for function __Bar__attrib__c__init. # Restore $ra lw $ra, 4($sp) @@ -3037,36 +3578,36 @@ __Bar__attrib__d__init: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_trib__d__init_internal_2 --> -12($fp) - # local_trib__d__init_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_trib__d__init_internal_0 --> -4($fp) - # LOCAL local_trib__d__init_internal_2 --> -12($fp) - # local_trib__d__init_internal_0 = local_trib__d__init_internal_2 - lw $s3, -12($fp) - sw $s3, -4($fp) + # LOCAL local_trib__d__init_internal_3 --> -16($fp) + # local_trib__d__init_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_trib__d__init_internal_1 --> -8($fp) + # LOCAL local_trib__d__init_internal_3 --> -16($fp) + # local_trib__d__init_internal_1 = local_trib__d__init_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_trib__d__init_internal_0 --> -4($fp) # LOCAL local_trib__d__init_internal_1 --> -8($fp) - # local_trib__d__init_internal_1 = VCALL local_trib__d__init_internal_0 printh + # LOCAL local_trib__d__init_internal_2 --> -12($fp) + # local_trib__d__init_internal_2 = VCALL local_trib__d__init_internal_1 printh # Save new self pointer in $s1 - lw $s1, -4($fp) + lw $s1, -8($fp) # Get pointer to type - lw $s3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $s4, 0($s3) + lw $t0, 0($t0) # Get pointer to function address - lw $s5, 28($s4) + lw $t0, 28($t0) # Call function. Result is on $v0 - jalr $s5 - sw $v0, -8($fp) + jalr $t0 + sw $v0, -12($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN local_trib__d__init_internal_1 - lw $v0, -8($fp) + # RETURN local_trib__d__init_internal_2 + lw $v0, -12($fp) # Deallocate stack frame for function __Bar__attrib__d__init. # Restore $ra lw $ra, 4($sp) diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips index 013ed82f..1bb3ccc3 100644 --- a/tests/codegen/hello_world.mips +++ b/tests/codegen/hello_world.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:40 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:20 2020 # School of Math and Computer Science, University of Havana # @@ -13,6 +13,8 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END +Int: .asciiz "Int" +# Function END Main: .asciiz "Main" # Function END # @@ -74,6 +76,20 @@ Bool_end: # +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + # **** VTABLE for type Main **** Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main # Function END @@ -100,11 +116,12 @@ data_2: .asciiz "\n" # -IO__TDT: .word 0, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, 0 +IO__TDT: .word 0, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0 # @@ -190,7 +207,8 @@ function_out_int_at_IO: addu $fp, $sp, 32 # PRINT_INT param_out_int_at_IO_x_0 # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) li $v0, 1 syscall # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) @@ -256,6 +274,35 @@ function_in_int_at_IO: # local_in_int_at_IO_internal_0 = READ_INT li $v0, 5 syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) sw $v0, -4($fp) # RETURN local_in_int_at_IO_internal_0 lw $v0, -4($fp) @@ -353,7 +400,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -442,8 +489,10 @@ function_substr_at_String: # PARAM param_substr_at_String_r_1 --> 0($fp) lw $t0, 12($s1) lw $t2, 4($fp) + lw $t2, 12($t2) addu $t0, $t0, $t2 lw $a0, 0($fp) + lw $a0, 12($a0) move $t3, $a0 move $t1, $a0 addu $a0, $a0, 1 @@ -503,8 +552,40 @@ function_length_at_String: # LOCAL local_length_at_String_internal_0 --> -4($fp) lw $t0, 16($s1) sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function function_length_at_String. # Restore $ra lw $ra, 4($sp) @@ -531,28 +612,28 @@ entry: li $v0, 9 syscall # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) # Load type offset - li $t2, 16 - sw $t2, 8($v0) + li $t0, 20 + sw $t0, 8($v0) move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 @@ -570,11 +651,11 @@ entry: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type's VTABLE - la $t1, Main_vtable + la $t0, Main_vtable # Get pointer to function address - lw $t2, 28($t1) + lw $t1, 28($t0) # Call function. Result is on $v0 - jalr $t2 + jalr $t1 sw $v0, -8($fp) # RETURN 0 li $v0, 0 @@ -603,8 +684,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + lw $t0, -12($fp) + sw $t0, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -614,37 +695,37 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_4 - sw $t1, 12($v0) - li $t1, 14 - sw $t1, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 14 + sw $t0, 16($v0) sw $v0, -16($fp) # ARG local_main_at_Main_internal_3 # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t1, -16($fp) + lw $t0, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 12($t2) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t3 + jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips index f346ea75..668ac22a 100644 --- a/tests/codegen/io.mips +++ b/tests/codegen/io.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:41 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:22 2020 # School of Math and Computer Science, University of Havana # @@ -13,6 +13,8 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END +Int: .asciiz "Int" +# Function END A: .asciiz "A" # Function END B: .asciiz "B" @@ -82,6 +84,20 @@ Bool_end: # +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + # **** VTABLE for type A **** A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A # Function END @@ -164,15 +180,16 @@ data_2: .asciiz "\n" # -IO__TDT: .word 0, -1, -1, -1, -1, -1, 1, 1, 2 -Object__TDT: .word 1, 0, 1, 1, 1, 2, 2, 2, 3 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1 -A__TDT: .word -1, -1, -1, -1, 0, 1, -1, -1, -1 -B__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1 -Main__TDT: .word -1, -1, -1, -1, -1, -1, 0, -1, -1 -C__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, 1 -D__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0 +IO__TDT: .word 0, -1, -1, -1, -1, -1, -1, 1, 1, 2 +Object__TDT: .word 1, 0, 1, 1, 1, 1, 2, 2, 2, 3 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1, -1 +A__TDT: .word -1, -1, -1, -1, -1, 0, 1, -1, -1, -1 +B__TDT: .word -1, -1, -1, -1, -1, -1, 0, -1, -1, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 +C__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, 1 +D__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 # @@ -274,7 +291,8 @@ function_out_int_at_IO: addu $fp, $sp, 32 # PRINT_INT param_out_int_at_IO_x_0 # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) li $v0, 1 syscall # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) @@ -340,6 +358,35 @@ function_in_int_at_IO: # local_in_int_at_IO_internal_0 = READ_INT li $v0, 5 syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) sw $v0, -4($fp) # RETURN local_in_int_at_IO_internal_0 lw $v0, -4($fp) @@ -437,7 +484,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -526,8 +573,10 @@ function_substr_at_String: # PARAM param_substr_at_String_r_1 --> 0($fp) lw $t0, 12($s1) lw $t2, 4($fp) + lw $t2, 12($t2) addu $t0, $t0, $t2 lw $a0, 0($fp) + lw $a0, 12($a0) move $t3, $a0 move $t1, $a0 addu $a0, $a0, 1 @@ -587,8 +636,40 @@ function_length_at_String: # LOCAL local_length_at_String_internal_0 --> -4($fp) lw $t0, 16($s1) sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function function_length_at_String. # Restore $ra lw $ra, 4($sp) @@ -615,28 +696,28 @@ entry: li $v0, 9 syscall # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) # Load type offset - li $t2, 24 - sw $t2, 8($v0) + li $t0, 28 + sw $t0, 8($v0) move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 @@ -654,11 +735,11 @@ entry: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type's VTABLE - la $t1, Main_vtable + la $t0, Main_vtable # Get pointer to function address - lw $t2, 28($t1) + lw $t1, 28($t0) # Call function. Result is on $v0 - jalr $t2 + jalr $t1 sw $v0, -8($fp) # RETURN 0 li $v0, 0 @@ -681,36 +762,36 @@ __A__attrib__io__init: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_ib__io__init_internal_0 --> -4($fp) - # local_ib__io__init_internal_0 = ALLOCATE IO + # LOCAL local_ib__io__init_internal_1 --> -8($fp) + # local_ib__io__init_internal_1 = ALLOCATE IO # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, IO - sw $t3, 12($v0) - li $t3, 2 - sw $t3, 16($v0) - move $t3, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, IO + sw $t0, 12($v0) + li $t0, 2 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - sw $t3, 0($v0) - la $t3, IO_start - sw $t3, 4($v0) + sw $t0, 0($v0) + la $t0, IO_start + sw $t0, 4($v0) # Load type offset - li $t3, 0 - sw $t3, 8($v0) - move $t2, $v0 + li $t0, 0 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -718,9 +799,9 @@ __A__attrib__io__init: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t2, -4($fp) - # RETURN local_ib__io__init_internal_0 - lw $v0, -4($fp) + sw $t1, -8($fp) + # RETURN local_ib__io__init_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function __A__attrib__io__init. # Restore $ra lw $ra, 4($sp) @@ -742,13 +823,13 @@ function_out_a_at_A: addu $fp, $sp, 32 # local_out_a_at_A_internal_2 = GETATTRIBUTE io A # LOCAL local_out_a_at_A_internal_2 --> -12($fp) - lw $t2, 12($s1) - sw $t2, -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) # LOCAL local_out_a_at_A_internal_0 --> -4($fp) # LOCAL local_out_a_at_A_internal_2 --> -12($fp) # local_out_a_at_A_internal_0 = local_out_a_at_A_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) + lw $t0, -12($fp) + sw $t0, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -758,37 +839,37 @@ function_out_a_at_A: li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_4 - sw $t2, 12($v0) - li $t2, 15 - sw $t2, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 15 + sw $t0, 16($v0) sw $v0, -16($fp) # ARG local_out_a_at_A_internal_3 # LOCAL local_out_a_at_A_internal_3 --> -16($fp) - lw $t2, -16($fp) + lw $t0, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t0, 0($sp) # LOCAL local_out_a_at_A_internal_0 --> -4($fp) # LOCAL local_out_a_at_A_internal_1 --> -8($fp) # local_out_a_at_A_internal_1 = VCALL local_out_a_at_A_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t0, 0($t0) # Get pointer to function address - lw $t4, 12($t3) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t4 + jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -816,13 +897,13 @@ function_out_b_at_B: addu $fp, $sp, 32 # local_out_b_at_B_internal_2 = GETATTRIBUTE io B # LOCAL local_out_b_at_B_internal_2 --> -12($fp) - lw $t2, 12($s1) - sw $t2, -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) # LOCAL local_out_b_at_B_internal_0 --> -4($fp) # LOCAL local_out_b_at_B_internal_2 --> -12($fp) # local_out_b_at_B_internal_0 = local_out_b_at_B_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) + lw $t0, -12($fp) + sw $t0, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -832,37 +913,37 @@ function_out_b_at_B: li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_5 - sw $t2, 12($v0) - li $t2, 15 - sw $t2, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 15 + sw $t0, 16($v0) sw $v0, -16($fp) # ARG local_out_b_at_B_internal_3 # LOCAL local_out_b_at_B_internal_3 --> -16($fp) - lw $t2, -16($fp) + lw $t0, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t0, 0($sp) # LOCAL local_out_b_at_B_internal_0 --> -4($fp) # LOCAL local_out_b_at_B_internal_1 --> -8($fp) # local_out_b_at_B_internal_1 = VCALL local_out_b_at_B_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t0, 0($t0) # Get pointer to function address - lw $t4, 12($t3) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t4 + jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -895,50 +976,50 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, A - sw $t4, 12($v0) - li $t4, 1 - sw $t4, 16($v0) - move $t4, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, A + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall - sw $t4, 0($v0) - la $t4, A_start - sw $t4, 4($v0) + sw $t0, 0($v0) + la $t0, A_start + sw $t0, 4($v0) # Load type offset - li $t4, 16 - sw $t4, 8($v0) - move $t3, $v0 + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t3 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t1, 0($sp) jal __A__attrib__io__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t3) + sw $v0, 12($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t3, -12($fp) + sw $t1, -12($fp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) + lw $t0, -12($fp) + sw $t0, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -948,13 +1029,13 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t0, 0($t0) # Get pointer to function address - lw $t5, 12($t4) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t5 + jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -966,50 +1047,50 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string for type name - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, B - sw $t5, 12($v0) - li $t5, 1 - sw $t5, 16($v0) - move $t5, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, B + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall - sw $t5, 0($v0) - la $t5, B_start - sw $t5, 4($v0) + sw $t0, 0($v0) + la $t0, B_start + sw $t0, 4($v0) # Load type offset - li $t5, 20 - sw $t5, 8($v0) - move $t4, $v0 + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t4 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t4, 0($sp) + sw $t1, 0($sp) jal __A__attrib__io__init - # Pop 4 bytes from stack into register t4 - lw $t4, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t4) + sw $v0, 12($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t4, -24($fp) + sw $t1, -24($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # LOCAL local_main_at_Main_internal_5 --> -24($fp) # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 - lw $t4, -24($fp) - sw $t4, -16($fp) + lw $t0, -24($fp) + sw $t0, -16($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1019,13 +1100,13 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -16($fp) # Get pointer to type - lw $t4, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t5, 0($t4) + lw $t0, 0($t0) # Get pointer to function address - lw $t6, 16($t5) + lw $t0, 16($t0) # Call function. Result is on $v0 - jalr $t6 + jalr $t0 sw $v0, -20($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1037,29 +1118,29 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string for type name - la $t6, String - sw $t6, 0($v0) - la $t6, String_start - sw $t6, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t6, 8 - sw $t6, 8($v0) - la $t6, C - sw $t6, 12($v0) - li $t6, 1 - sw $t6, 16($v0) - move $t6, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, C + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - sw $t6, 0($v0) - la $t6, C_start - sw $t6, 4($v0) + sw $t0, 0($v0) + la $t0, C_start + sw $t0, 4($v0) # Load type offset - li $t6, 28 - sw $t6, 8($v0) - move $t5, $v0 + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1067,12 +1148,12 @@ function_main_at_Main: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t5, -36($fp) + sw $t1, -36($fp) # LOCAL local_main_at_Main_internal_6 --> -28($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 - lw $t5, -36($fp) - sw $t5, -28($fp) + lw $t0, -36($fp) + sw $t0, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1082,13 +1163,13 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -28($fp) # Get pointer to type - lw $t5, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t6, 0($t5) + lw $t0, 0($t0) # Get pointer to function address - lw $t7, 28($t6) + lw $t0, 28($t0) # Call function. Result is on $v0 - jalr $t7 + jalr $t0 sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1100,29 +1181,29 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string for type name - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t7, 8 - sw $t7, 8($v0) - la $t7, D - sw $t7, 12($v0) - li $t7, 1 - sw $t7, 16($v0) - move $t7, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, D + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - sw $t7, 0($v0) - la $t7, D_start - sw $t7, 4($v0) + sw $t0, 0($v0) + la $t0, D_start + sw $t0, 4($v0) # Load type offset - li $t7, 32 - sw $t7, 8($v0) - move $t6, $v0 + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1130,12 +1211,12 @@ function_main_at_Main: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t6, -48($fp) + sw $t1, -48($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # LOCAL local_main_at_Main_internal_11 --> -48($fp) # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 - lw $t6, -48($fp) - sw $t6, -40($fp) + lw $t0, -48($fp) + sw $t0, -40($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1145,13 +1226,13 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -40($fp) # Get pointer to type - lw $t6, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t7, 0($t6) + lw $t0, 0($t0) # Get pointer to function address - lw $t8, 32($t7) + lw $t0, 32($t0) # Call function. Result is on $v0 - jalr $t8 + jalr $t0 sw $v0, -44($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1162,8 +1243,8 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_12 --> -52($fp) # LOCAL local_main_at_Main_internal_14 --> -60($fp) # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 - lw $t6, -60($fp) - sw $t6, -52($fp) + lw $t0, -60($fp) + sw $t0, -52($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1173,37 +1254,37 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string - la $t6, String - sw $t6, 0($v0) - la $t6, String_start - sw $t6, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t6, 8 - sw $t6, 8($v0) - la $t6, data_6 - sw $t6, 12($v0) - li $t6, 6 - sw $t6, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_6 + sw $t0, 12($v0) + li $t0, 6 + sw $t0, 16($v0) sw $v0, -64($fp) # ARG local_main_at_Main_internal_15 # LOCAL local_main_at_Main_internal_15 --> -64($fp) - lw $t6, -64($fp) + lw $t0, -64($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t6, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_12 --> -52($fp) # LOCAL local_main_at_Main_internal_13 --> -56($fp) # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string # Save new self pointer in $s1 lw $s1, -52($fp) # Get pointer to type - lw $t6, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t7, 0($t6) + lw $t0, 0($t0) # Get pointer to function address - lw $t8, 12($t7) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t8 + jalr $t0 sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1235,8 +1316,8 @@ function_out_c_at_C: # LOCAL local_out_c_at_C_internal_0 --> -4($fp) # LOCAL local_out_c_at_C_internal_2 --> -12($fp) # local_out_c_at_C_internal_0 = local_out_c_at_C_internal_2 - lw $t6, -12($fp) - sw $t6, -4($fp) + lw $t0, -12($fp) + sw $t0, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1246,37 +1327,37 @@ function_out_c_at_C: li $v0, 9 syscall # Allocating string - la $t6, String - sw $t6, 0($v0) - la $t6, String_start - sw $t6, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t6, 8 - sw $t6, 8($v0) - la $t6, data_7 - sw $t6, 12($v0) - li $t6, 15 - sw $t6, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_7 + sw $t0, 12($v0) + li $t0, 15 + sw $t0, 16($v0) sw $v0, -16($fp) # ARG local_out_c_at_C_internal_3 # LOCAL local_out_c_at_C_internal_3 --> -16($fp) - lw $t6, -16($fp) + lw $t0, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t6, 0($sp) + sw $t0, 0($sp) # LOCAL local_out_c_at_C_internal_0 --> -4($fp) # LOCAL local_out_c_at_C_internal_1 --> -8($fp) # local_out_c_at_C_internal_1 = VCALL local_out_c_at_C_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t6, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t7, 0($t6) + lw $t0, 0($t0) # Get pointer to function address - lw $t8, 12($t7) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t8 + jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1308,8 +1389,8 @@ function_out_d_at_D: # LOCAL local_out_d_at_D_internal_0 --> -4($fp) # LOCAL local_out_d_at_D_internal_2 --> -12($fp) # local_out_d_at_D_internal_0 = local_out_d_at_D_internal_2 - lw $t6, -12($fp) - sw $t6, -4($fp) + lw $t0, -12($fp) + sw $t0, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1319,37 +1400,37 @@ function_out_d_at_D: li $v0, 9 syscall # Allocating string - la $t6, String - sw $t6, 0($v0) - la $t6, String_start - sw $t6, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t6, 8 - sw $t6, 8($v0) - la $t6, data_8 - sw $t6, 12($v0) - li $t6, 15 - sw $t6, 16($v0) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_8 + sw $t0, 12($v0) + li $t0, 15 + sw $t0, 16($v0) sw $v0, -16($fp) # ARG local_out_d_at_D_internal_3 # LOCAL local_out_d_at_D_internal_3 --> -16($fp) - lw $t6, -16($fp) + lw $t0, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t6, 0($sp) + sw $t0, 0($sp) # LOCAL local_out_d_at_D_internal_0 --> -4($fp) # LOCAL local_out_d_at_D_internal_1 --> -8($fp) # local_out_d_at_D_internal_1 = VCALL local_out_d_at_D_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t6, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t7, 0($t6) + lw $t0, 0($t0) # Get pointer to function address - lw $t8, 12($t7) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t8 + jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) diff --git a/tests/codegen/list.mips b/tests/codegen/list.mips index 2f971753..a01febaf 100644 --- a/tests/codegen/list.mips +++ b/tests/codegen/list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:41 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:22 2020 # School of Math and Computer Science, University of Havana # @@ -13,6 +13,8 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END +Int: .asciiz "Int" +# Function END List: .asciiz "List" # Function END Cons: .asciiz "Cons" @@ -78,6 +80,20 @@ Bool_end: # +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + # **** VTABLE for type List **** List_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_isNil_at_List, function_head_at_List, function_tail_at_List, function_cons_at_List # Function END @@ -132,13 +148,14 @@ data_2: .asciiz "\n" # -IO__TDT: .word 0, -1, -1, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 2, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 -List__TDT: .word -1, -1, -1, -1, 0, 1, -1 -Cons__TDT: .word -1, -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, -1, 0 +IO__TDT: .word 0, -1, -1, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 1, 2, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1 +List__TDT: .word -1, -1, -1, -1, -1, 0, 1, -1 +Cons__TDT: .word -1, -1, -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0 # @@ -228,7 +245,8 @@ function_out_int_at_IO: addu $fp, $sp, 32 # PRINT_INT param_out_int_at_IO_x_0 # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) li $v0, 1 syscall # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) @@ -294,6 +312,35 @@ function_in_int_at_IO: # local_in_int_at_IO_internal_0 = READ_INT li $v0, 5 syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) sw $v0, -4($fp) # RETURN local_in_int_at_IO_internal_0 lw $v0, -4($fp) @@ -391,7 +438,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -480,8 +527,10 @@ function_substr_at_String: # PARAM param_substr_at_String_r_1 --> 0($fp) lw $t0, 12($s1) lw $t2, 4($fp) + lw $t2, 12($t2) addu $t0, $t0, $t2 lw $a0, 0($fp) + lw $a0, 12($a0) move $t3, $a0 move $t1, $a0 addu $a0, $a0, 1 @@ -541,8 +590,40 @@ function_length_at_String: # LOCAL local_length_at_String_internal_0 --> -4($fp) lw $t0, 16($s1) sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function function_length_at_String. # Restore $ra lw $ra, 4($sp) @@ -569,28 +650,28 @@ entry: li $v0, 9 syscall # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) # Load type offset - li $t2, 24 - sw $t2, 8($v0) + li $t0, 28 + sw $t0, 8($v0) move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 @@ -616,11 +697,11 @@ entry: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type's VTABLE - la $t1, Main_vtable + la $t0, Main_vtable # Get pointer to function address - lw $t2, 32($t1) + lw $t1, 32($t0) # Call function. Result is on $v0 - jalr $t2 + jalr $t1 sw $v0, -8($fp) # RETURN 0 li $v0, 0 @@ -644,9 +725,36 @@ function_isNil_at_List: sw $fp, 0($sp) addu $fp, $sp, 32 # LOCAL local_isNil_at_List_internal_0 --> -4($fp) - # local_isNil_at_List_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) # RETURN local_isNil_at_List_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_isNil_at_List. @@ -674,8 +782,8 @@ function_head_at_List: # LOCAL local_head_at_List_internal_0 --> -4($fp) # LOCAL local_head_at_List_internal_2 --> -12($fp) # local_head_at_List_internal_0 = local_head_at_List_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + lw $t0, -12($fp) + sw $t0, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -685,19 +793,50 @@ function_head_at_List: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 0($t2) + lw $t0, 0($t0) # Call function. Result is on $v0 - jalr $t3 + jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN 0 - li $v0, 0 + # LOCAL local_head_at_List_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -16($fp) + # RETURN local_head_at_List_internal_3 + lw $v0, -16($fp) # Deallocate stack frame for function function_head_at_List. # Restore $ra lw $ra, 4($sp) @@ -723,8 +862,8 @@ function_tail_at_List: # LOCAL local_tail_at_List_internal_0 --> -4($fp) # LOCAL local_tail_at_List_internal_2 --> -12($fp) # local_tail_at_List_internal_0 = local_tail_at_List_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + lw $t0, -12($fp) + sw $t0, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -734,13 +873,13 @@ function_tail_at_List: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 0($t2) + lw $t0, 0($t0) # Call function. Result is on $v0 - jalr $t3 + jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -777,89 +916,89 @@ function_cons_at_List: li $v0, 9 syscall # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Cons - sw $t3, 12($v0) - li $t3, 4 - sw $t3, 16($v0) - move $t3, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Cons + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - sw $t3, 0($v0) - la $t3, Cons_start - sw $t3, 4($v0) + sw $t0, 0($v0) + la $t0, Cons_start + sw $t0, 4($v0) # Load type offset - li $t3, 20 - sw $t3, 8($v0) - move $t2, $v0 + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t2 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) jal __Cons__attrib__car__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t2) - # Push register t2 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) jal __Cons__attrib__cdr__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t2) + sw $v0, 16($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t2, -12($fp) + sw $t1, -12($fp) # LOCAL local_cons_at_List_internal_0 --> -4($fp) # LOCAL local_cons_at_List_internal_2 --> -12($fp) # local_cons_at_List_internal_0 = local_cons_at_List_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) + lw $t0, -12($fp) + sw $t0, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) # ARG param_cons_at_List_i_0 # PARAM param_cons_at_List_i_0 --> 0($fp) - lw $t2, 0($fp) + lw $t0, 0($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t0, 0($sp) # LOCAL local_cons_at_List_internal_3 --> -16($fp) # local_cons_at_List_internal_3 = SELF sw $s1, -16($fp) # ARG local_cons_at_List_internal_3 # LOCAL local_cons_at_List_internal_3 --> -16($fp) - lw $t2, -16($fp) + lw $t0, -16($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t0, 0($sp) # LOCAL local_cons_at_List_internal_0 --> -4($fp) # LOCAL local_cons_at_List_internal_1 --> -8($fp) # local_cons_at_List_internal_1 = VCALL local_cons_at_List_internal_0 init # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t0, 0($t0) # Get pointer to function address - lw $t4, 28($t3) + lw $t0, 28($t0) # Call function. Result is on $v0 - jalr $t4 + jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -887,8 +1026,39 @@ __Cons__attrib__car__init: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 + # LOCAL local_ttrib__car__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__car__init_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function __Cons__attrib__car__init. # Restore $ra lw $ra, 4($sp) @@ -930,9 +1100,36 @@ function_isNil_at_Cons: sw $fp, 0($sp) addu $fp, $sp, 32 # LOCAL local_isNil_at_Cons_internal_0 --> -4($fp) - # local_isNil_at_Cons_internal_0 = 0 - li $t2, 0 - sw $t2, -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) # RETURN local_isNil_at_Cons_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_isNil_at_Cons. @@ -956,8 +1153,8 @@ function_head_at_Cons: addu $fp, $sp, 32 # local_head_at_Cons_internal_0 = GETATTRIBUTE car Cons # LOCAL local_head_at_Cons_internal_0 --> -4($fp) - lw $t2, 12($s1) - sw $t2, -4($fp) + lw $t0, 12($s1) + sw $t0, -4($fp) # RETURN local_head_at_Cons_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_head_at_Cons. @@ -981,8 +1178,8 @@ function_tail_at_Cons: addu $fp, $sp, 32 # local_tail_at_Cons_internal_0 = GETATTRIBUTE cdr Cons # LOCAL local_tail_at_Cons_internal_0 --> -4($fp) - lw $t2, 16($s1) - sw $t2, -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) # RETURN local_tail_at_Cons_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_tail_at_Cons. @@ -1008,12 +1205,12 @@ function_init_at_Cons: addu $fp, $sp, 32 # # PARAM param_init_at_Cons_i_0 --> 4($fp) - lw $t2, 4($fp) - sw $t2, 12($s1) + lw $t0, 4($fp) + sw $t0, 12($s1) # # PARAM param_init_at_Cons_rest_1 --> 0($fp) - lw $t2, 0($fp) - sw $t2, 16($s1) + lw $t0, 0($fp) + sw $t0, 16($s1) # LOCAL local_init_at_Cons_internal_0 --> -4($fp) # local_init_at_Cons_internal_0 = SELF sw $s1, -4($fp) @@ -1058,284 +1255,290 @@ __Main__attrib__mylist__init: # 0($fp) = param_print_list_at_Main_l_0 function_print_list_at_Main: # Allocate stack frame for function function_print_list_at_Main. - subu $sp, $sp, 92 + subu $sp, $sp, 96 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 92 - # LOCAL local_print_list_at_Main_internal_1 --> -8($fp) + addu $fp, $sp, 96 + # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) # PARAM param_print_list_at_Main_l_0 --> 0($fp) - # local_print_list_at_Main_internal_1 = PARAM param_print_list_at_Main_l_0 - lw $t2, 0($fp) - sw $t2, -8($fp) + # local_print_list_at_Main_internal_2 = PARAM param_print_list_at_Main_l_0 + lw $t0, 0($fp) + sw $t0, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_1 --> -8($fp) # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) - # local_print_list_at_Main_internal_2 = VCALL local_print_list_at_Main_internal_1 isNil + # LOCAL local_print_list_at_Main_internal_3 --> -16($fp) + # local_print_list_at_Main_internal_3 = VCALL local_print_list_at_Main_internal_2 isNil # Save new self pointer in $s1 - lw $s1, -8($fp) + lw $s1, -12($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t0, 0($t0) # Get pointer to function address - lw $t4, 12($t3) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t4 - sw $v0, -12($fp) + jalr $t0 + sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # IF_ZERO local_print_list_at_Main_internal_2 GOTO label_FALSEIF_1 - # IF_ZERO local_print_list_at_Main_internal_2 GOTO label_FALSEIF_1 - lw $t2, -12($fp) - beq $t2, 0, label_FALSEIF_1 - # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) - # local_print_list_at_Main_internal_5 = SELF - sw $s1, -24($fp) + # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) # LOCAL local_print_list_at_Main_internal_3 --> -16($fp) - # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) - # local_print_list_at_Main_internal_3 = local_print_list_at_Main_internal_5 - lw $t2, -24($fp) - sw $t2, -16($fp) + # Obtain value from -16($fp) + lw $v0, -16($fp) + lw $v0, 12($v0) + sw $v0, -4($fp) + # IF_ZERO local_print_list_at_Main_internal_0 GOTO label_FALSEIF_1 + # IF_ZERO local_print_list_at_Main_internal_0 GOTO label_FALSEIF_1 + lw $t0, -4($fp) + beq $t0, 0, label_FALSEIF_1 + # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) + # local_print_list_at_Main_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) + # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) + # local_print_list_at_Main_internal_4 = local_print_list_at_Main_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Main_internal_7 --> -32($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_4 - sw $t2, 12($v0) - li $t2, 1 - sw $t2, 16($v0) - sw $v0, -28($fp) - # ARG local_print_list_at_Main_internal_6 - # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) - lw $t2, -28($fp) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -32($fp) + # ARG local_print_list_at_Main_internal_7 + # LOCAL local_print_list_at_Main_internal_7 --> -32($fp) + lw $t0, -32($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_print_list_at_Main_internal_3 --> -16($fp) + sw $t0, 0($sp) # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) - # local_print_list_at_Main_internal_4 = VCALL local_print_list_at_Main_internal_3 out_string + # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) + # local_print_list_at_Main_internal_5 = VCALL local_print_list_at_Main_internal_4 out_string # Save new self pointer in $s1 - lw $s1, -16($fp) + lw $s1, -20($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t0, 0($t0) # Get pointer to function address - lw $t4, 12($t3) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t4 - sw $v0, -20($fp) + jalr $t0 + sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) - # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) - # local_print_list_at_Main_internal_0 = local_print_list_at_Main_internal_4 - lw $t2, -20($fp) - sw $t2, -4($fp) + # LOCAL local_print_list_at_Main_internal_1 --> -8($fp) + # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) + # local_print_list_at_Main_internal_1 = local_print_list_at_Main_internal_5 + lw $t0, -24($fp) + sw $t0, -8($fp) # GOTO label_ENDIF_2 j label_ENDIF_2 label_FALSEIF_1: - # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) - # local_print_list_at_Main_internal_9 = SELF - sw $s1, -40($fp) - # LOCAL local_print_list_at_Main_internal_7 --> -32($fp) - # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) - # local_print_list_at_Main_internal_7 = local_print_list_at_Main_internal_9 - lw $t2, -40($fp) - sw $t2, -32($fp) + # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) + # local_print_list_at_Main_internal_10 = SELF + sw $s1, -44($fp) + # LOCAL local_print_list_at_Main_internal_8 --> -36($fp) + # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) + # local_print_list_at_Main_internal_8 = local_print_list_at_Main_internal_10 + lw $t0, -44($fp) + sw $t0, -36($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) + # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) # PARAM param_print_list_at_Main_l_0 --> 0($fp) - # local_print_list_at_Main_internal_10 = PARAM param_print_list_at_Main_l_0 - lw $t2, 0($fp) - sw $t2, -44($fp) + # local_print_list_at_Main_internal_11 = PARAM param_print_list_at_Main_l_0 + lw $t0, 0($fp) + sw $t0, -48($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) - # local_print_list_at_Main_internal_11 = VCALL local_print_list_at_Main_internal_10 head + # LOCAL local_print_list_at_Main_internal_12 --> -52($fp) + # local_print_list_at_Main_internal_12 = VCALL local_print_list_at_Main_internal_11 head # Save new self pointer in $s1 - lw $s1, -44($fp) + lw $s1, -48($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t0, 0($t0) # Get pointer to function address - lw $t4, 16($t3) + lw $t0, 16($t0) # Call function. Result is on $v0 - jalr $t4 - sw $v0, -48($fp) + jalr $t0 + sw $v0, -52($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # ARG local_print_list_at_Main_internal_11 - # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) - lw $t2, -48($fp) + # ARG local_print_list_at_Main_internal_12 + # LOCAL local_print_list_at_Main_internal_12 --> -52($fp) + lw $t0, -52($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_print_list_at_Main_internal_7 --> -32($fp) + sw $t0, 0($sp) # LOCAL local_print_list_at_Main_internal_8 --> -36($fp) - # local_print_list_at_Main_internal_8 = VCALL local_print_list_at_Main_internal_7 out_int + # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) + # local_print_list_at_Main_internal_9 = VCALL local_print_list_at_Main_internal_8 out_int # Save new self pointer in $s1 - lw $s1, -32($fp) + lw $s1, -36($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t0, 0($t0) # Get pointer to function address - lw $t4, 16($t3) + lw $t0, 16($t0) # Call function. Result is on $v0 - jalr $t4 - sw $v0, -36($fp) + jalr $t0 + sw $v0, -40($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) - # local_print_list_at_Main_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_print_list_at_Main_internal_12 --> -52($fp) - # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) - # local_print_list_at_Main_internal_12 = local_print_list_at_Main_internal_14 - lw $t2, -60($fp) - sw $t2, -52($fp) + # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) + # local_print_list_at_Main_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_print_list_at_Main_internal_13 --> -56($fp) + # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) + # local_print_list_at_Main_internal_13 = local_print_list_at_Main_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) + # LOCAL local_print_list_at_Main_internal_16 --> -68($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_5 - sw $t2, 12($v0) - li $t2, 1 - sw $t2, 16($v0) - sw $v0, -64($fp) - # ARG local_print_list_at_Main_internal_15 - # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) - lw $t2, -64($fp) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -68($fp) + # ARG local_print_list_at_Main_internal_16 + # LOCAL local_print_list_at_Main_internal_16 --> -68($fp) + lw $t0, -68($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_print_list_at_Main_internal_12 --> -52($fp) + sw $t0, 0($sp) # LOCAL local_print_list_at_Main_internal_13 --> -56($fp) - # local_print_list_at_Main_internal_13 = VCALL local_print_list_at_Main_internal_12 out_string + # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) + # local_print_list_at_Main_internal_14 = VCALL local_print_list_at_Main_internal_13 out_string # Save new self pointer in $s1 - lw $s1, -52($fp) + lw $s1, -56($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t0, 0($t0) # Get pointer to function address - lw $t4, 12($t3) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t4 - sw $v0, -56($fp) + jalr $t0 + sw $v0, -60($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) - # local_print_list_at_Main_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_print_list_at_Main_internal_16 --> -68($fp) - # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) - # local_print_list_at_Main_internal_16 = local_print_list_at_Main_internal_18 - lw $t2, -76($fp) - sw $t2, -68($fp) + # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) + # local_print_list_at_Main_internal_19 = SELF + sw $s1, -80($fp) + # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) + # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) + # local_print_list_at_Main_internal_17 = local_print_list_at_Main_internal_19 + lw $t0, -80($fp) + sw $t0, -72($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) + # LOCAL local_print_list_at_Main_internal_20 --> -84($fp) # PARAM param_print_list_at_Main_l_0 --> 0($fp) - # local_print_list_at_Main_internal_19 = PARAM param_print_list_at_Main_l_0 - lw $t2, 0($fp) - sw $t2, -80($fp) + # local_print_list_at_Main_internal_20 = PARAM param_print_list_at_Main_l_0 + lw $t0, 0($fp) + sw $t0, -84($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) # LOCAL local_print_list_at_Main_internal_20 --> -84($fp) - # local_print_list_at_Main_internal_20 = VCALL local_print_list_at_Main_internal_19 tail + # LOCAL local_print_list_at_Main_internal_21 --> -88($fp) + # local_print_list_at_Main_internal_21 = VCALL local_print_list_at_Main_internal_20 tail # Save new self pointer in $s1 - lw $s1, -80($fp) + lw $s1, -84($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t0, 0($t0) # Get pointer to function address - lw $t4, 20($t3) + lw $t0, 20($t0) # Call function. Result is on $v0 - jalr $t4 - sw $v0, -84($fp) + jalr $t0 + sw $v0, -88($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # ARG local_print_list_at_Main_internal_20 - # LOCAL local_print_list_at_Main_internal_20 --> -84($fp) - lw $t2, -84($fp) + # ARG local_print_list_at_Main_internal_21 + # LOCAL local_print_list_at_Main_internal_21 --> -88($fp) + lw $t0, -88($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_print_list_at_Main_internal_16 --> -68($fp) + sw $t0, 0($sp) # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) - # local_print_list_at_Main_internal_17 = VCALL local_print_list_at_Main_internal_16 print_list + # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) + # local_print_list_at_Main_internal_18 = VCALL local_print_list_at_Main_internal_17 print_list # Save new self pointer in $s1 - lw $s1, -68($fp) + lw $s1, -72($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t0, 0($t0) # Get pointer to function address - lw $t4, 28($t3) + lw $t0, 28($t0) # Call function. Result is on $v0 - jalr $t4 - sw $v0, -72($fp) + jalr $t0 + sw $v0, -76($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) - # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) - # local_print_list_at_Main_internal_0 = local_print_list_at_Main_internal_17 - lw $t2, -72($fp) - sw $t2, -4($fp) + # LOCAL local_print_list_at_Main_internal_1 --> -8($fp) + # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) + # local_print_list_at_Main_internal_1 = local_print_list_at_Main_internal_18 + lw $t0, -76($fp) + sw $t0, -8($fp) label_ENDIF_2: -# RETURN local_print_list_at_Main_internal_0 -lw $v0, -4($fp) +# RETURN local_print_list_at_Main_internal_1 +lw $v0, -8($fp) # Deallocate stack frame for function function_print_list_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 92 +addu $sp, $sp, 96 # Deallocate function args addu $sp, $sp, 4 jr $ra @@ -1346,10 +1549,10 @@ jr $ra # @Params: function_main_at_Main: # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 96 + subu $sp, $sp, 120 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 96 + addu $fp, $sp, 120 # LOCAL local_main_at_Main_internal_10 --> -44($fp) # local_main_at_Main_internal_10 = ALLOCATE List # Allocating 20 bytes of memory @@ -1357,29 +1560,29 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, List - sw $t4, 12($v0) - li $t4, 4 - sw $t4, 16($v0) - move $t4, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, List + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - sw $t4, 0($v0) - la $t4, List_start - sw $t4, 4($v0) + sw $t0, 0($v0) + la $t0, List_start + sw $t0, 4($v0) # Load type offset - li $t4, 16 - sw $t4, 8($v0) - move $t3, $v0 + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -1387,33 +1590,65 @@ function_main_at_Main: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t3, -44($fp) + sw $t1, -44($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # LOCAL local_main_at_Main_internal_10 --> -44($fp) # local_main_at_Main_internal_8 = local_main_at_Main_internal_10 - lw $t3, -44($fp) - sw $t3, -36($fp) + lw $t0, -44($fp) + sw $t0, -36($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # ARG 1 - li $t3, 1 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -48($fp) + # ARG local_main_at_Main_internal_11 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + lw $t0, -48($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 cons # Save new self pointer in $s1 lw $s1, -36($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t0, 0($t0) # Get pointer to function address - lw $t5, 24($t4) + lw $t0, 24($t0) # Call function. Result is on $v0 - jalr $t5 + jalr $t0 sw $v0, -40($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1421,29 +1656,61 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_6 --> -28($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # local_main_at_Main_internal_6 = local_main_at_Main_internal_9 - lw $t3, -40($fp) - sw $t3, -28($fp) + lw $t0, -40($fp) + sw $t0, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # ARG 2 - li $t3, 2 + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 2 + sw $t0, 12($v0) + sw $v0, -52($fp) + # ARG local_main_at_Main_internal_12 + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + lw $t0, -52($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_6 --> -28($fp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 cons # Save new self pointer in $s1 lw $s1, -28($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t0, 0($t0) # Get pointer to function address - lw $t5, 24($t4) + lw $t0, 24($t0) # Call function. Result is on $v0 - jalr $t5 + jalr $t0 sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1451,29 +1718,61 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_4 --> -20($fp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # local_main_at_Main_internal_4 = local_main_at_Main_internal_7 - lw $t3, -32($fp) - sw $t3, -20($fp) + lw $t0, -32($fp) + sw $t0, -20($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # ARG 3 - li $t3, 3 + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 3 + sw $t0, 12($v0) + sw $v0, -56($fp) + # ARG local_main_at_Main_internal_13 + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + lw $t0, -56($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_4 --> -20($fp) # LOCAL local_main_at_Main_internal_5 --> -24($fp) # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 cons # Save new self pointer in $s1 lw $s1, -20($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t0, 0($t0) # Get pointer to function address - lw $t5, 24($t4) + lw $t0, 24($t0) # Call function. Result is on $v0 - jalr $t5 + jalr $t0 sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1481,29 +1780,61 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_2 --> -12($fp) # LOCAL local_main_at_Main_internal_5 --> -24($fp) # local_main_at_Main_internal_2 = local_main_at_Main_internal_5 - lw $t3, -24($fp) - sw $t3, -12($fp) + lw $t0, -24($fp) + sw $t0, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # ARG 4 - li $t3, 4 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 4 + sw $t0, 12($v0) + sw $v0, -60($fp) + # ARG local_main_at_Main_internal_14 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + lw $t0, -60($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 cons # Save new self pointer in $s1 lw $s1, -12($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t0, 0($t0) # Get pointer to function address - lw $t5, 24($t4) + lw $t0, 24($t0) # Call function. Result is on $v0 - jalr $t5 + jalr $t0 sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1511,158 +1842,256 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 - lw $t3, -16($fp) - sw $t3, -4($fp) + lw $t0, -16($fp) + sw $t0, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # ARG 5 - li $t3, 5 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 5 + sw $t0, 12($v0) + sw $v0, -64($fp) + # ARG local_main_at_Main_internal_15 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + lw $t0, -64($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 cons # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t0, 0($t0) # Get pointer to function address - lw $t5, 24($t4) + lw $t0, 24($t0) # Call function. Result is on $v0 - jalr $t5 + jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # # LOCAL local_main_at_Main_internal_1 --> -8($fp) - lw $t3, -8($fp) - sw $t3, 12($s1) + lw $t0, -8($fp) + sw $t0, 12($s1) label_WHILE_3: - # local_main_at_Main_internal_13 = GETATTRIBUTE mylist Main - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - lw $t3, 12($s1) - sw $t3, -56($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_11 = local_main_at_Main_internal_13 - lw $t3, -56($fp) - sw $t3, -48($fp) + # local_main_at_Main_internal_19 = GETATTRIBUTE mylist Main + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + lw $t0, 12($s1) + sw $t0, -80($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_17 = local_main_at_Main_internal_19 + lw $t0, -80($fp) + sw $t0, -72($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_12 = VCALL local_main_at_Main_internal_11 isNil + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_18 = VCALL local_main_at_Main_internal_17 isNil # Save new self pointer in $s1 - lw $s1, -48($fp) + lw $s1, -72($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t0, 0($t0) # Get pointer to function address - lw $t5, 12($t4) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -52($fp) + jalr $t0 + sw $v0, -76($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # IF_ZERO local_main_at_Main_internal_12 GOTO label_FALSE_5 - # IF_ZERO local_main_at_Main_internal_12 GOTO label_FALSE_5 - lw $t3, -52($fp) - beq $t3, 0, label_FALSE_5 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = 0 - li $t3, 0 - sw $t3, -60($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # Obtain value from -76($fp) + lw $v0, -76($fp) + lw $v0, 12($v0) + sw $v0, -76($fp) + # IF_ZERO local_main_at_Main_internal_18 GOTO label_FALSE_5 + # IF_ZERO local_main_at_Main_internal_18 GOTO label_FALSE_5 + lw $t0, -76($fp) + beq $t0, 0, label_FALSE_5 + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -84($fp) # GOTO label_NOT_END_6 j label_NOT_END_6 label_FALSE_5: - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = 1 - li $t3, 1 - sw $t3, -60($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -84($fp) label_NOT_END_6: - # IF_ZERO local_main_at_Main_internal_14 GOTO label_WHILE_END_4 - # IF_ZERO local_main_at_Main_internal_14 GOTO label_WHILE_END_4 - lw $t3, -60($fp) - beq $t3, 0, label_WHILE_END_4 - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = SELF - sw $s1, -72($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 - lw $t3, -72($fp) - sw $t3, -64($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # Obtain value from -84($fp) + lw $v0, -84($fp) + lw $v0, 12($v0) + sw $v0, -68($fp) + # IF_ZERO local_main_at_Main_internal_16 GOTO label_WHILE_END_4 + # IF_ZERO local_main_at_Main_internal_16 GOTO label_WHILE_END_4 + lw $t0, -68($fp) + beq $t0, 0, label_WHILE_END_4 + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # local_main_at_Main_internal_23 = SELF + sw $s1, -96($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # local_main_at_Main_internal_21 = local_main_at_Main_internal_23 + lw $t0, -96($fp) + sw $t0, -88($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_main_at_Main_internal_18 = GETATTRIBUTE mylist Main - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - lw $t3, 12($s1) - sw $t3, -76($fp) - # ARG local_main_at_Main_internal_18 - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - lw $t3, -76($fp) + # local_main_at_Main_internal_24 = GETATTRIBUTE mylist Main + # LOCAL local_main_at_Main_internal_24 --> -100($fp) + lw $t0, 12($s1) + sw $t0, -100($fp) + # ARG local_main_at_Main_internal_24 + # LOCAL local_main_at_Main_internal_24 --> -100($fp) + lw $t0, -100($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 print_list + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # local_main_at_Main_internal_22 = VCALL local_main_at_Main_internal_21 print_list # Save new self pointer in $s1 - lw $s1, -64($fp) + lw $s1, -88($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t0, 0($t0) # Get pointer to function address - lw $t5, 28($t4) + lw $t0, 28($t0) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -68($fp) + jalr $t0 + sw $v0, -92($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # local_main_at_Main_internal_21 = GETATTRIBUTE mylist Main - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - lw $t3, 12($s1) - sw $t3, -88($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 - lw $t3, -88($fp) - sw $t3, -80($fp) + # local_main_at_Main_internal_27 = GETATTRIBUTE mylist Main + # LOCAL local_main_at_Main_internal_27 --> -112($fp) + lw $t0, 12($s1) + sw $t0, -112($fp) + # LOCAL local_main_at_Main_internal_25 --> -104($fp) + # LOCAL local_main_at_Main_internal_27 --> -112($fp) + # local_main_at_Main_internal_25 = local_main_at_Main_internal_27 + lw $t0, -112($fp) + sw $t0, -104($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 tail + # LOCAL local_main_at_Main_internal_25 --> -104($fp) + # LOCAL local_main_at_Main_internal_26 --> -108($fp) + # local_main_at_Main_internal_26 = VCALL local_main_at_Main_internal_25 tail # Save new self pointer in $s1 - lw $s1, -80($fp) + lw $s1, -104($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t0, 0($t0) # Get pointer to function address - lw $t5, 20($t4) + lw $t0, 20($t0) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -84($fp) + jalr $t0 + sw $v0, -108($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - lw $t3, -84($fp) - sw $t3, 12($s1) + # LOCAL local_main_at_Main_internal_26 --> -108($fp) + lw $t0, -108($fp) + sw $t0, 12($s1) # GOTO label_WHILE_3 j label_WHILE_3 label_WHILE_END_4: @@ -1673,7 +2102,7 @@ function_main_at_Main: # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 96 + addu $sp, $sp, 120 jr $ra # Function END diff --git a/tests/codegen/new_complex.mips b/tests/codegen/new_complex.mips index 36a026e9..eabfe52d 100644 --- a/tests/codegen/new_complex.mips +++ b/tests/codegen/new_complex.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:40 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:20 2020 # School of Math and Computer Science, University of Havana # @@ -13,6 +13,8 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END +Int: .asciiz "Int" +# Function END Complex: .asciiz "Complex" # Function END Main: .asciiz "Main" @@ -76,6 +78,20 @@ Bool_end: # +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + # **** VTABLE for type Complex **** Complex_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Complex, function_print_at_Complex, function_reflect_0_at_Complex, function_reflect_X_at_Complex, function_reflect_Y_at_Complex, function_equal_at_Complex, function_x_value_at_Complex, function_y_value_at_Complex # Function END @@ -116,12 +132,13 @@ data_2: .asciiz "\n" # -IO__TDT: .word 0, -1, -1, -1, 1, 1 -Object__TDT: .word 1, 0, 1, 1, 2, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1 -Complex__TDT: .word -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, 0 +IO__TDT: .word 0, -1, -1, -1, -1, 1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1 +Complex__TDT: .word -1, -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, 0 # @@ -227,7 +244,8 @@ function_out_int_at_IO: addu $fp, $sp, 32 # PRINT_INT param_out_int_at_IO_x_0 # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) li $v0, 1 syscall # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) @@ -293,6 +311,35 @@ function_in_int_at_IO: # local_in_int_at_IO_internal_0 = READ_INT li $v0, 5 syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) sw $v0, -4($fp) # RETURN local_in_int_at_IO_internal_0 lw $v0, -4($fp) @@ -390,7 +437,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -479,8 +526,10 @@ function_substr_at_String: # PARAM param_substr_at_String_r_1 --> 0($fp) lw $t0, 12($s1) lw $t2, 4($fp) + lw $t2, 12($t2) addu $t0, $t0, $t2 lw $a0, 0($fp) + lw $a0, 12($a0) move $t3, $a0 move $t1, $a0 addu $a0, $a0, 1 @@ -540,8 +589,40 @@ function_length_at_String: # LOCAL local_length_at_String_internal_0 --> -4($fp) lw $t0, 16($s1) sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function function_length_at_String. # Restore $ra lw $ra, 4($sp) @@ -568,28 +649,28 @@ entry: li $v0, 9 syscall # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) # Load type offset - li $t2, 20 - sw $t2, 8($v0) + li $t0, 24 + sw $t0, 8($v0) move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 @@ -607,11 +688,11 @@ entry: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type's VTABLE - la $t1, Main_vtable + la $t0, Main_vtable # Get pointer to function address - lw $t2, 28($t1) + lw $t1, 28($t0) # Call function. Result is on $v0 - jalr $t2 + jalr $t1 sw $v0, -8($fp) # RETURN 0 li $v0, 0 @@ -634,8 +715,39 @@ __Complex__attrib__x__init: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 + # LOCAL local___attrib__x__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local___attrib__x__init_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function __Complex__attrib__x__init. # Restore $ra lw $ra, 4($sp) @@ -655,8 +767,39 @@ __Complex__attrib__y__init: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 + # LOCAL local___attrib__y__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local___attrib__y__init_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function __Complex__attrib__y__init. # Restore $ra lw $ra, 4($sp) @@ -674,78 +817,420 @@ __Complex__attrib__y__init: # 4($fp) = param_init_at_Complex_b_1 function_init_at_Complex: # Allocate stack frame for function function_init_at_Complex. - subu $sp, $sp, 32 + subu $sp, $sp, 36 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_init_at_Complex_internal_1 = GETATTRIBUTE x Complex + addu $fp, $sp, 36 + # local_init_at_Complex_internal_2 = GETATTRIBUTE x Complex + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # IF_ZERO local_init_at_Complex_internal_2 GOTO label_FALSE_1 + # IF_ZERO local_init_at_Complex_internal_2 GOTO label_FALSE_1 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_1 + # IF_ZERO param_init_at_Complex_a_0 GOTO label_FALSE_1 + # IF_ZERO param_init_at_Complex_a_0 GOTO label_FALSE_1 + lw $t0, 4($fp) + beq $t0, 0, label_FALSE_1 # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - lw $t1, 12($s1) - sw $t1, -8($fp) - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_STRING_4 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_STRING_4 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_STRING_4 + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_5 + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_5 # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) # PARAM param_init_at_Complex_a_0 --> 4($fp) - # local_init_at_Complex_internal_0 = local_init_at_Complex_internal_1 - PARAM param_init_at_Complex_a_0 - lw $t1, -8($fp) - lw $t2, 4($fp) - sub $t1, $t1, $t2 - sw $t1, -4($fp) - # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_1 - # IF_ZERO local_init_at_Complex_internal_0 GOTO label_TRUE_1 - lw $t1, -4($fp) - beq $t1, 0, label_TRUE_1 - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # local_init_at_Complex_internal_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # GOTO label_END_2 -j label_END_2 -label_TRUE_1: + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, 4($fp) + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_2 + # GOTO label_FALSE_1 + j label_FALSE_1 + label_COMPARE_BY_VALUE_5: + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + lw $a0, -12($fp) + lw $a1, 4($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_2 + # GOTO label_FALSE_1 + j label_FALSE_1 + label_COMPARE_STRING_4: + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, 4($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_CONTINUE_6 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_CONTINUE_6 + lw $t0, -8($fp) + beq $t0, 0, label_CONTINUE_6 + # GOTO label_FALSE_1 + j label_FALSE_1 + label_CONTINUE_6: + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, 4($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_7: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_8 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_7 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_8: + # Store result + sw $a2, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_2 + label_FALSE_1: + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # GOTO label_END_3 +j label_END_3 +label_TRUE_2: # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # local_init_at_Complex_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - label_END_2: -# local_init_at_Complex_internal_3 = GETATTRIBUTE y Complex -# LOCAL local_init_at_Complex_internal_3 --> -16($fp) -lw $t1, 16($s1) -sw $t1, -16($fp) -# LOCAL local_init_at_Complex_internal_2 --> -12($fp) -# LOCAL local_init_at_Complex_internal_3 --> -16($fp) -# PARAM param_init_at_Complex_b_1 --> 0($fp) -# local_init_at_Complex_internal_2 = local_init_at_Complex_internal_3 - PARAM param_init_at_Complex_b_1 -lw $t1, -16($fp) -lw $t2, 0($fp) -sub $t1, $t1, $t2 -sw $t1, -12($fp) -# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_3 -# IF_ZERO local_init_at_Complex_internal_2 GOTO label_TRUE_3 -lw $t1, -12($fp) -beq $t1, 0, label_TRUE_3 -# LOCAL local_init_at_Complex_internal_2 --> -12($fp) -# local_init_at_Complex_internal_2 = 0 -li $t1, 0 -sw $t1, -12($fp) -# GOTO label_END_4 -j label_END_4 -label_TRUE_3: - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # local_init_at_Complex_internal_2 = 1 - li $t1, 1 - sw $t1, -12($fp) - label_END_4: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + label_END_3: +# local_init_at_Complex_internal_5 = GETATTRIBUTE y Complex +# LOCAL local_init_at_Complex_internal_5 --> -24($fp) +lw $t0, 16($s1) +sw $t0, -24($fp) +# IF_ZERO local_init_at_Complex_internal_5 GOTO label_FALSE_9 +# IF_ZERO local_init_at_Complex_internal_5 GOTO label_FALSE_9 +lw $t0, -24($fp) +beq $t0, 0, label_FALSE_9 +# IF_ZERO param_init_at_Complex_b_1 GOTO label_FALSE_9 +# IF_ZERO param_init_at_Complex_b_1 GOTO label_FALSE_9 +lw $t0, 0($fp) +beq $t0, 0, label_FALSE_9 +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# LOCAL local_init_at_Complex_internal_5 --> -24($fp) +# Comparing -24($fp) type with String +la $v0, String +lw $a0, -24($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -20($fp) +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_STRING_12 +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_STRING_12 +lw $t0, -20($fp) +beq $t0, 0, label_COMPARE_STRING_12 +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# LOCAL local_init_at_Complex_internal_5 --> -24($fp) +# Comparing -24($fp) type with Bool +la $v0, Bool +lw $a0, -24($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -20($fp) +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 +lw $t0, -20($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_13 # LOCAL local_init_at_Complex_internal_4 --> -20($fp) -# local_init_at_Complex_internal_4 = SELF -sw $s1, -20($fp) -# RETURN local_init_at_Complex_internal_4 -lw $v0, -20($fp) +# LOCAL local_init_at_Complex_internal_5 --> -24($fp) +# Comparing -24($fp) type with Int +la $v0, Int +lw $a0, -24($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -20($fp) +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 +lw $t0, -20($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_13 +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# LOCAL local_init_at_Complex_internal_5 --> -24($fp) +# PARAM param_init_at_Complex_b_1 --> 0($fp) +# Load pointers and SUB +lw $a0, -24($fp) +lw $a1, 0($fp) +sub $a0, $a0, $a1 +sw $a0, -20($fp) +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 +lw $t0, -20($fp) +beq $t0, 0, label_TRUE_10 +# GOTO label_FALSE_9 +j label_FALSE_9 +label_COMPARE_BY_VALUE_13: + # LOCAL local_init_at_Complex_internal_4 --> -20($fp) + # LOCAL local_init_at_Complex_internal_5 --> -24($fp) + # PARAM param_init_at_Complex_b_1 --> 0($fp) + lw $a0, -24($fp) + lw $a1, 0($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -20($fp) + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 + lw $t0, -20($fp) + beq $t0, 0, label_TRUE_10 + # GOTO label_FALSE_9 + j label_FALSE_9 + label_COMPARE_STRING_12: + # LOCAL local_init_at_Complex_internal_4 --> -20($fp) + # LOCAL local_init_at_Complex_internal_5 --> -24($fp) + # PARAM param_init_at_Complex_b_1 --> 0($fp) + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, 0($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -20($fp) + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_CONTINUE_14 + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_CONTINUE_14 + lw $t0, -20($fp) + beq $t0, 0, label_CONTINUE_14 + # GOTO label_FALSE_9 + j label_FALSE_9 + label_CONTINUE_14: + # LOCAL local_init_at_Complex_internal_4 --> -20($fp) + # LOCAL local_init_at_Complex_internal_5 --> -24($fp) + # PARAM param_init_at_Complex_b_1 --> 0($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, 0($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_15: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_16 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_15 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_16: + # Store result + sw $a2, -20($fp) + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 + lw $t0, -20($fp) + beq $t0, 0, label_TRUE_10 + label_FALSE_9: + # LOCAL local_init_at_Complex_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -16($fp) + # GOTO label_END_11 +j label_END_11 +label_TRUE_10: + # LOCAL local_init_at_Complex_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -16($fp) + label_END_11: +# LOCAL local_init_at_Complex_internal_6 --> -28($fp) +# local_init_at_Complex_internal_6 = SELF +sw $s1, -28($fp) +# RETURN local_init_at_Complex_internal_6 +lw $v0, -28($fp) # Deallocate stack frame for function function_init_at_Complex. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 32 +addu $sp, $sp, 36 # Deallocate function args addu $sp, $sp, 8 jr $ra @@ -756,272 +1241,482 @@ jr $ra # @Params: function_print_at_Complex: # Allocate stack frame for function function_print_at_Complex. - subu $sp, $sp, 88 + subu $sp, $sp, 100 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 88 - # local_print_at_Complex_internal_2 = GETATTRIBUTE y Complex - # LOCAL local_print_at_Complex_internal_2 --> -12($fp) - lw $t1, 16($s1) - sw $t1, -12($fp) - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + addu $fp, $sp, 100 + # local_print_at_Complex_internal_4 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # LOCAL local_print_at_Complex_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # IF_ZERO local_print_at_Complex_internal_4 GOTO label_FALSE_19 + # IF_ZERO local_print_at_Complex_internal_4 GOTO label_FALSE_19 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_19 + # IF_ZERO local_print_at_Complex_internal_5 GOTO label_FALSE_19 + # IF_ZERO local_print_at_Complex_internal_5 GOTO label_FALSE_19 + lw $t0, -24($fp) + beq $t0, 0, label_FALSE_19 + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # Comparing -20($fp) type with String + la $v0, String + lw $a0, -20($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_STRING_22 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_STRING_22 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_22 + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # Comparing -20($fp) type with Bool + la $v0, Bool + lw $a0, -20($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_23 + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # Comparing -20($fp) type with Int + la $v0, Int + lw $a0, -20($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_23 + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # LOCAL local_print_at_Complex_internal_5 --> -24($fp) + # Load pointers and SUB + lw $a0, -20($fp) + lw $a1, -24($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_20 + # GOTO label_FALSE_19 + j label_FALSE_19 + label_COMPARE_BY_VALUE_23: + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # LOCAL local_print_at_Complex_internal_5 --> -24($fp) + lw $a0, -20($fp) + lw $a1, -24($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_20 + # GOTO label_FALSE_19 + j label_FALSE_19 + label_COMPARE_STRING_22: + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # LOCAL local_print_at_Complex_internal_5 --> -24($fp) + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -24($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_CONTINUE_24 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_CONTINUE_24 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_24 + # GOTO label_FALSE_19 + j label_FALSE_19 + label_CONTINUE_24: + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # LOCAL local_print_at_Complex_internal_5 --> -24($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -24($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_25: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_26 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_25 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_26: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_20 + label_FALSE_19: + # LOCAL local_print_at_Complex_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_21 +j label_END_21 +label_TRUE_20: # LOCAL local_print_at_Complex_internal_2 --> -12($fp) - # local_print_at_Complex_internal_1 = local_print_at_Complex_internal_2 - 0 - lw $t1, -12($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_7 - # IF_ZERO local_print_at_Complex_internal_1 GOTO label_TRUE_7 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_7 - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # local_print_at_Complex_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_8 -j label_END_8 -label_TRUE_7: - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # local_print_at_Complex_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_8: -# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_5 -# IF_ZERO local_print_at_Complex_internal_1 GOTO label_FALSEIF_5 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_5 -# LOCAL local_print_at_Complex_internal_5 --> -24($fp) -# local_print_at_Complex_internal_5 = SELF -sw $s1, -24($fp) -# LOCAL local_print_at_Complex_internal_3 --> -16($fp) -# LOCAL local_print_at_Complex_internal_5 --> -24($fp) -# local_print_at_Complex_internal_3 = local_print_at_Complex_internal_5 -lw $t1, -24($fp) -sw $t1, -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_21: +# LOCAL local_print_at_Complex_internal_0 --> -4($fp) +# LOCAL local_print_at_Complex_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_print_at_Complex_internal_0 GOTO label_FALSEIF_17 +# IF_ZERO local_print_at_Complex_internal_0 GOTO label_FALSEIF_17 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_17 +# LOCAL local_print_at_Complex_internal_8 --> -36($fp) +# local_print_at_Complex_internal_8 = SELF +sw $s1, -36($fp) +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +# LOCAL local_print_at_Complex_internal_8 --> -36($fp) +# local_print_at_Complex_internal_6 = local_print_at_Complex_internal_8 +lw $t0, -36($fp) +sw $t0, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# local_print_at_Complex_internal_6 = GETATTRIBUTE x Complex -# LOCAL local_print_at_Complex_internal_6 --> -28($fp) -lw $t1, 12($s1) -sw $t1, -28($fp) -# ARG local_print_at_Complex_internal_6 -# LOCAL local_print_at_Complex_internal_6 --> -28($fp) -lw $t1, -28($fp) +# local_print_at_Complex_internal_9 = GETATTRIBUTE x Complex +# LOCAL local_print_at_Complex_internal_9 --> -40($fp) +lw $t0, 12($s1) +sw $t0, -40($fp) +# ARG local_print_at_Complex_internal_9 +# LOCAL local_print_at_Complex_internal_9 --> -40($fp) +lw $t0, -40($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_print_at_Complex_internal_3 --> -16($fp) -# LOCAL local_print_at_Complex_internal_4 --> -20($fp) -# local_print_at_Complex_internal_4 = VCALL local_print_at_Complex_internal_3 out_int +sw $t0, 0($sp) +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +# LOCAL local_print_at_Complex_internal_7 --> -32($fp) +# local_print_at_Complex_internal_7 = VCALL local_print_at_Complex_internal_6 out_int # Save new self pointer in $s1 -lw $s1, -16($fp) +lw $s1, -28($fp) # Get pointer to type -lw $t1, 4($s1) +lw $t0, 4($s1) # Get pointer to type's VTABLE -lw $t2, 0($t1) +lw $t0, 0($t0) # Get pointer to function address -lw $t3, 16($t2) +lw $t0, 16($t0) # Call function. Result is on $v0 -jalr $t3 -sw $v0, -20($fp) +jalr $t0 +sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_print_at_Complex_internal_0 --> -4($fp) -# LOCAL local_print_at_Complex_internal_4 --> -20($fp) -# local_print_at_Complex_internal_0 = local_print_at_Complex_internal_4 -lw $t1, -20($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_6 -j label_ENDIF_6 -label_FALSEIF_5: - # LOCAL local_print_at_Complex_internal_15 --> -64($fp) - # local_print_at_Complex_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_print_at_Complex_internal_13 --> -56($fp) - # LOCAL local_print_at_Complex_internal_15 --> -64($fp) - # local_print_at_Complex_internal_13 = local_print_at_Complex_internal_15 - lw $t1, -64($fp) - sw $t1, -56($fp) +# LOCAL local_print_at_Complex_internal_1 --> -8($fp) +# LOCAL local_print_at_Complex_internal_7 --> -32($fp) +# local_print_at_Complex_internal_1 = local_print_at_Complex_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_18 +j label_ENDIF_18 +label_FALSEIF_17: + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + # local_print_at_Complex_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + # local_print_at_Complex_internal_16 = local_print_at_Complex_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_print_at_Complex_internal_16 = GETATTRIBUTE x Complex - # LOCAL local_print_at_Complex_internal_16 --> -68($fp) - lw $t1, 12($s1) - sw $t1, -68($fp) - # ARG local_print_at_Complex_internal_16 - # LOCAL local_print_at_Complex_internal_16 --> -68($fp) - lw $t1, -68($fp) + # local_print_at_Complex_internal_19 = GETATTRIBUTE x Complex + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + lw $t0, 12($s1) + sw $t0, -80($fp) + # ARG local_print_at_Complex_internal_19 + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + lw $t0, -80($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Complex_internal_13 --> -56($fp) - # LOCAL local_print_at_Complex_internal_14 --> -60($fp) - # local_print_at_Complex_internal_14 = VCALL local_print_at_Complex_internal_13 out_int + sw $t0, 0($sp) + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + # local_print_at_Complex_internal_17 = VCALL local_print_at_Complex_internal_16 out_int # Save new self pointer in $s1 - lw $s1, -56($fp) + lw $s1, -68($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 16($t2) + lw $t0, 16($t0) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -60($fp) + jalr $t0 + sw $v0, -72($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_11 --> -48($fp) # LOCAL local_print_at_Complex_internal_14 --> -60($fp) - # local_print_at_Complex_internal_11 = local_print_at_Complex_internal_14 - lw $t1, -60($fp) - sw $t1, -48($fp) + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + # local_print_at_Complex_internal_14 = local_print_at_Complex_internal_17 + lw $t0, -72($fp) + sw $t0, -60($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + # LOCAL local_print_at_Complex_internal_20 --> -84($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_4 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -72($fp) - # ARG local_print_at_Complex_internal_17 - # LOCAL local_print_at_Complex_internal_17 --> -72($fp) - lw $t1, -72($fp) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -84($fp) + # ARG local_print_at_Complex_internal_20 + # LOCAL local_print_at_Complex_internal_20 --> -84($fp) + lw $t0, -84($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Complex_internal_11 --> -48($fp) - # LOCAL local_print_at_Complex_internal_12 --> -52($fp) - # local_print_at_Complex_internal_12 = VCALL local_print_at_Complex_internal_11 out_string + sw $t0, 0($sp) + # LOCAL local_print_at_Complex_internal_14 --> -60($fp) + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_15 = VCALL local_print_at_Complex_internal_14 out_string # Save new self pointer in $s1 - lw $s1, -48($fp) + lw $s1, -60($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 12($t2) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -52($fp) + jalr $t0 + sw $v0, -64($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_9 --> -40($fp) # LOCAL local_print_at_Complex_internal_12 --> -52($fp) - # local_print_at_Complex_internal_9 = local_print_at_Complex_internal_12 - lw $t1, -52($fp) - sw $t1, -40($fp) + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_12 = local_print_at_Complex_internal_15 + lw $t0, -64($fp) + sw $t0, -52($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_print_at_Complex_internal_18 = GETATTRIBUTE y Complex - # LOCAL local_print_at_Complex_internal_18 --> -76($fp) - lw $t1, 16($s1) - sw $t1, -76($fp) - # ARG local_print_at_Complex_internal_18 - # LOCAL local_print_at_Complex_internal_18 --> -76($fp) - lw $t1, -76($fp) + # local_print_at_Complex_internal_21 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_21 --> -88($fp) + lw $t0, 16($s1) + sw $t0, -88($fp) + # ARG local_print_at_Complex_internal_21 + # LOCAL local_print_at_Complex_internal_21 --> -88($fp) + lw $t0, -88($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Complex_internal_9 --> -40($fp) - # LOCAL local_print_at_Complex_internal_10 --> -44($fp) - # local_print_at_Complex_internal_10 = VCALL local_print_at_Complex_internal_9 out_int + sw $t0, 0($sp) + # LOCAL local_print_at_Complex_internal_12 --> -52($fp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # local_print_at_Complex_internal_13 = VCALL local_print_at_Complex_internal_12 out_int # Save new self pointer in $s1 - lw $s1, -40($fp) + lw $s1, -52($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 16($t2) + lw $t0, 16($t0) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) + jalr $t0 + sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_7 --> -32($fp) # LOCAL local_print_at_Complex_internal_10 --> -44($fp) - # local_print_at_Complex_internal_7 = local_print_at_Complex_internal_10 - lw $t1, -44($fp) - sw $t1, -32($fp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # local_print_at_Complex_internal_10 = local_print_at_Complex_internal_13 + lw $t0, -56($fp) + sw $t0, -44($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + # LOCAL local_print_at_Complex_internal_22 --> -92($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_5 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -80($fp) - # ARG local_print_at_Complex_internal_19 - # LOCAL local_print_at_Complex_internal_19 --> -80($fp) - lw $t1, -80($fp) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -92($fp) + # ARG local_print_at_Complex_internal_22 + # LOCAL local_print_at_Complex_internal_22 --> -92($fp) + lw $t0, -92($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_Complex_internal_7 --> -32($fp) - # LOCAL local_print_at_Complex_internal_8 --> -36($fp) - # local_print_at_Complex_internal_8 = VCALL local_print_at_Complex_internal_7 out_string + sw $t0, 0($sp) + # LOCAL local_print_at_Complex_internal_10 --> -44($fp) + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # local_print_at_Complex_internal_11 = VCALL local_print_at_Complex_internal_10 out_string # Save new self pointer in $s1 - lw $s1, -32($fp) + lw $s1, -44($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 12($t2) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -36($fp) + jalr $t0 + sw $v0, -48($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_0 --> -4($fp) - # LOCAL local_print_at_Complex_internal_8 --> -36($fp) - # local_print_at_Complex_internal_0 = local_print_at_Complex_internal_8 - lw $t1, -36($fp) - sw $t1, -4($fp) - label_ENDIF_6: -# RETURN local_print_at_Complex_internal_0 -lw $v0, -4($fp) + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # local_print_at_Complex_internal_1 = local_print_at_Complex_internal_11 + lw $t0, -48($fp) + sw $t0, -8($fp) + label_ENDIF_18: +# RETURN local_print_at_Complex_internal_1 +lw $v0, -8($fp) # Deallocate stack frame for function function_print_at_Complex. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 88 +addu $sp, $sp, 100 jr $ra # Function END @@ -1030,97 +1725,507 @@ jr $ra # @Params: function_reflect_0_at_Complex: # Allocate stack frame for function function_reflect_0_at_Complex. - subu $sp, $sp, 44 + subu $sp, $sp, 52 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 44 - # local_reflect_0_at_Complex_internal_1 = GETATTRIBUTE x Complex - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - lw $t1, 12($s1) - sw $t1, -8($fp) - # local_reflect_0_at_Complex_internal_3 = GETATTRIBUTE x Complex - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - lw $t1, 12($s1) - sw $t1, -16($fp) + addu $fp, $sp, 52 + # local_reflect_0_at_Complex_internal_2 = GETATTRIBUTE x Complex # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # local_reflect_0_at_Complex_internal_4 = GETATTRIBUTE x Complex + # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) + lw $t0, 12($s1) + sw $t0, -20($fp) # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - lw $t1, -16($fp) - not $t1, $t1 - sw $t1, -12($fp) - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) + lw $t0, -20($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -16($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -16($fp) + sw $t0, 12($v0) + sw $v0, -16($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_2 GOTO label_FALSE_27 + # IF_ZERO local_reflect_0_at_Complex_internal_2 GOTO label_FALSE_27 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_27 + # IF_ZERO local_reflect_0_at_Complex_internal_3 GOTO label_FALSE_27 + # IF_ZERO local_reflect_0_at_Complex_internal_3 GOTO label_FALSE_27 + lw $t0, -16($fp) + beq $t0, 0, label_FALSE_27 # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # local_reflect_0_at_Complex_internal_0 = local_reflect_0_at_Complex_internal_1 - local_reflect_0_at_Complex_internal_2 - lw $t1, -8($fp) - lw $t2, -12($fp) - sub $t1, $t1, $t2 - sw $t1, -4($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_9 - # IF_ZERO local_reflect_0_at_Complex_internal_0 GOTO label_TRUE_9 - lw $t1, -4($fp) - beq $t1, 0, label_TRUE_9 - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # local_reflect_0_at_Complex_internal_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # GOTO label_END_10 -j label_END_10 -label_TRUE_9: + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_STRING_30 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_STRING_30 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_STRING_30 + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_31 + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_31 + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, -16($fp) + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_28 + # GOTO label_FALSE_27 + j label_FALSE_27 + label_COMPARE_BY_VALUE_31: + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + lw $a0, -12($fp) + lw $a1, -16($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_28 + # GOTO label_FALSE_27 + j label_FALSE_27 + label_COMPARE_STRING_30: + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_CONTINUE_32 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_CONTINUE_32 + lw $t0, -8($fp) + beq $t0, 0, label_CONTINUE_32 + # GOTO label_FALSE_27 + j label_FALSE_27 + label_CONTINUE_32: + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_33: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_34 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_33 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_34: + # Store result + sw $a2, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_28 + label_FALSE_27: + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # GOTO label_END_29 +j label_END_29 +label_TRUE_28: # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # local_reflect_0_at_Complex_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - label_END_10: -# local_reflect_0_at_Complex_internal_5 = GETATTRIBUTE y Complex -# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) -lw $t1, 16($s1) -sw $t1, -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + label_END_29: # local_reflect_0_at_Complex_internal_7 = GETATTRIBUTE y Complex # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -lw $t1, 16($s1) -sw $t1, -32($fp) +lw $t0, 16($s1) +sw $t0, -32($fp) +# local_reflect_0_at_Complex_internal_9 = GETATTRIBUTE y Complex +# LOCAL local_reflect_0_at_Complex_internal_9 --> -40($fp) +lw $t0, 16($s1) +sw $t0, -40($fp) +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# LOCAL local_reflect_0_at_Complex_internal_9 --> -40($fp) +lw $t0, -40($fp) +lw $t0, 12($t0) +not $t0, $t0 +add $t0, $t0, 1 +sw $t0, -36($fp) +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +lw $t0, -36($fp) +sw $t0, 12($v0) +sw $v0, -36($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_7 GOTO label_FALSE_35 +# IF_ZERO local_reflect_0_at_Complex_internal_7 GOTO label_FALSE_35 +lw $t0, -32($fp) +beq $t0, 0, label_FALSE_35 +# IF_ZERO local_reflect_0_at_Complex_internal_8 GOTO label_FALSE_35 +# IF_ZERO local_reflect_0_at_Complex_internal_8 GOTO label_FALSE_35 +lw $t0, -36($fp) +beq $t0, 0, label_FALSE_35 +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +# Comparing -32($fp) type with String +la $v0, String +lw $a0, -32($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -28($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_STRING_38 +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_STRING_38 +lw $t0, -28($fp) +beq $t0, 0, label_COMPARE_STRING_38 # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -lw $t1, -32($fp) -not $t1, $t1 -sw $t1, -28($fp) -# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) -# LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) +# Comparing -32($fp) type with Bool +la $v0, Bool +lw $a0, -32($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -28($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 +lw $t0, -28($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_39 # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) -# local_reflect_0_at_Complex_internal_4 = local_reflect_0_at_Complex_internal_5 - local_reflect_0_at_Complex_internal_6 -lw $t1, -24($fp) -lw $t2, -28($fp) -sub $t1, $t1, $t2 -sw $t1, -20($fp) -# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_11 -# IF_ZERO local_reflect_0_at_Complex_internal_4 GOTO label_TRUE_11 -lw $t1, -20($fp) -beq $t1, 0, label_TRUE_11 -# LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) -# local_reflect_0_at_Complex_internal_4 = 0 -li $t1, 0 -sw $t1, -20($fp) -# GOTO label_END_12 -j label_END_12 -label_TRUE_11: - # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) - # local_reflect_0_at_Complex_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) - label_END_12: +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +# Comparing -32($fp) type with Int +la $v0, Int +lw $a0, -32($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -28($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 +lw $t0, -28($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_39 +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) # LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) -# local_reflect_0_at_Complex_internal_8 = SELF -sw $s1, -36($fp) -# RETURN local_reflect_0_at_Complex_internal_8 -lw $v0, -36($fp) -# Deallocate stack frame for function function_reflect_0_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 44 -jr $ra +# Load pointers and SUB +lw $a0, -32($fp) +lw $a1, -36($fp) +sub $a0, $a0, $a1 +sw $a0, -28($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 +lw $t0, -28($fp) +beq $t0, 0, label_TRUE_36 +# GOTO label_FALSE_35 +j label_FALSE_35 +label_COMPARE_BY_VALUE_39: + # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) + # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) + # LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) + lw $a0, -32($fp) + lw $a1, -36($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -28($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 + lw $t0, -28($fp) + beq $t0, 0, label_TRUE_36 + # GOTO label_FALSE_35 + j label_FALSE_35 + label_COMPARE_STRING_38: + # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) + # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) + # LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) + # Load strings for comparison + lw $v0, -32($fp) + lw $v1, -36($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -28($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_CONTINUE_40 + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_CONTINUE_40 + lw $t0, -28($fp) + beq $t0, 0, label_CONTINUE_40 + # GOTO label_FALSE_35 + j label_FALSE_35 + label_CONTINUE_40: + # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) + # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) + # LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -32($fp) + lw $v1, -36($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_41: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_42 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_41 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_42: + # Store result + sw $a2, -28($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 + lw $t0, -28($fp) + beq $t0, 0, label_TRUE_36 + label_FALSE_35: + # LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # GOTO label_END_37 +j label_END_37 +label_TRUE_36: + # LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -24($fp) + label_END_37: +# LOCAL local_reflect_0_at_Complex_internal_10 --> -44($fp) +# local_reflect_0_at_Complex_internal_10 = SELF +sw $s1, -44($fp) +# RETURN local_reflect_0_at_Complex_internal_10 +lw $v0, -44($fp) +# Deallocate stack frame for function function_reflect_0_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 52 +jr $ra # Function END @@ -1132,48 +2237,253 @@ function_reflect_X_at_Complex: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_reflect_X_at_Complex_internal_1 = GETATTRIBUTE y Complex - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - lw $t1, 16($s1) - sw $t1, -8($fp) - # local_reflect_X_at_Complex_internal_3 = GETATTRIBUTE y Complex - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - lw $t1, 16($s1) - sw $t1, -16($fp) + # local_reflect_X_at_Complex_internal_2 = GETATTRIBUTE y Complex # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + lw $t0, 16($s1) + sw $t0, -12($fp) + # local_reflect_X_at_Complex_internal_4 = GETATTRIBUTE y Complex + # LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - lw $t1, -16($fp) - not $t1, $t1 - sw $t1, -12($fp) - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) + lw $t0, -20($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -16($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -16($fp) + sw $t0, 12($v0) + sw $v0, -16($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_2 GOTO label_FALSE_43 + # IF_ZERO local_reflect_X_at_Complex_internal_2 GOTO label_FALSE_43 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_43 + # IF_ZERO local_reflect_X_at_Complex_internal_3 GOTO label_FALSE_43 + # IF_ZERO local_reflect_X_at_Complex_internal_3 GOTO label_FALSE_43 + lw $t0, -16($fp) + beq $t0, 0, label_FALSE_43 # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # local_reflect_X_at_Complex_internal_0 = local_reflect_X_at_Complex_internal_1 - local_reflect_X_at_Complex_internal_2 - lw $t1, -8($fp) - lw $t2, -12($fp) - sub $t1, $t1, $t2 - sw $t1, -4($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_13 - # IF_ZERO local_reflect_X_at_Complex_internal_0 GOTO label_TRUE_13 - lw $t1, -4($fp) - beq $t1, 0, label_TRUE_13 - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # local_reflect_X_at_Complex_internal_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # GOTO label_END_14 -j label_END_14 -label_TRUE_13: + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_STRING_46 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_STRING_46 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_STRING_46 + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_47 + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_47 + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, -16($fp) + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_44 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_COMPARE_BY_VALUE_47: + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + lw $a0, -12($fp) + lw $a1, -16($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_44 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_COMPARE_STRING_46: + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_CONTINUE_48 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_CONTINUE_48 + lw $t0, -8($fp) + beq $t0, 0, label_CONTINUE_48 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_CONTINUE_48: + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_49: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_50 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_49 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_50: + # Store result + sw $a2, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_44 + label_FALSE_43: + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # GOTO label_END_45 +j label_END_45 +label_TRUE_44: # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # local_reflect_X_at_Complex_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - label_END_14: -# LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) -# local_reflect_X_at_Complex_internal_4 = SELF -sw $s1, -20($fp) -# RETURN local_reflect_X_at_Complex_internal_4 -lw $v0, -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + label_END_45: +# LOCAL local_reflect_X_at_Complex_internal_5 --> -24($fp) +# local_reflect_X_at_Complex_internal_5 = SELF +sw $s1, -24($fp) +# RETURN local_reflect_X_at_Complex_internal_5 +lw $v0, -24($fp) # Deallocate stack frame for function function_reflect_X_at_Complex. # Restore $ra lw $ra, 4($sp) @@ -1193,48 +2503,253 @@ function_reflect_Y_at_Complex: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_reflect_Y_at_Complex_internal_1 = GETATTRIBUTE x Complex - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - lw $t1, 12($s1) - sw $t1, -8($fp) - # local_reflect_Y_at_Complex_internal_3 = GETATTRIBUTE x Complex - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - lw $t1, 12($s1) - sw $t1, -16($fp) + # local_reflect_Y_at_Complex_internal_2 = GETATTRIBUTE x Complex # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # local_reflect_Y_at_Complex_internal_4 = GETATTRIBUTE x Complex + # LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) + lw $t0, 12($s1) + sw $t0, -20($fp) # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - lw $t1, -16($fp) - not $t1, $t1 - sw $t1, -12($fp) - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) + lw $t0, -20($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -16($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -16($fp) + sw $t0, 12($v0) + sw $v0, -16($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_2 GOTO label_FALSE_51 + # IF_ZERO local_reflect_Y_at_Complex_internal_2 GOTO label_FALSE_51 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_51 + # IF_ZERO local_reflect_Y_at_Complex_internal_3 GOTO label_FALSE_51 + # IF_ZERO local_reflect_Y_at_Complex_internal_3 GOTO label_FALSE_51 + lw $t0, -16($fp) + beq $t0, 0, label_FALSE_51 # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # local_reflect_Y_at_Complex_internal_0 = local_reflect_Y_at_Complex_internal_1 - local_reflect_Y_at_Complex_internal_2 - lw $t1, -8($fp) - lw $t2, -12($fp) - sub $t1, $t1, $t2 - sw $t1, -4($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_15 - # IF_ZERO local_reflect_Y_at_Complex_internal_0 GOTO label_TRUE_15 - lw $t1, -4($fp) - beq $t1, 0, label_TRUE_15 - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # local_reflect_Y_at_Complex_internal_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # GOTO label_END_16 -j label_END_16 -label_TRUE_15: + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_STRING_54 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_STRING_54 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_STRING_54 + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_55 + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_55 + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, -16($fp) + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_52 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_COMPARE_BY_VALUE_55: + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + lw $a0, -12($fp) + lw $a1, -16($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_52 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_COMPARE_STRING_54: + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_CONTINUE_56 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_CONTINUE_56 + lw $t0, -8($fp) + beq $t0, 0, label_CONTINUE_56 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_CONTINUE_56: + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_57: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_58 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_57 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_58: + # Store result + sw $a2, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_52 + label_FALSE_51: + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # GOTO label_END_53 +j label_END_53 +label_TRUE_52: # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # local_reflect_Y_at_Complex_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - label_END_16: -# LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) -# local_reflect_Y_at_Complex_internal_4 = SELF -sw $s1, -20($fp) -# RETURN local_reflect_Y_at_Complex_internal_4 -lw $v0, -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + label_END_53: +# LOCAL local_reflect_Y_at_Complex_internal_5 --> -24($fp) +# local_reflect_Y_at_Complex_internal_5 = SELF +sw $s1, -24($fp) +# RETURN local_reflect_Y_at_Complex_internal_5 +lw $v0, -24($fp) # Deallocate stack frame for function function_reflect_Y_at_Complex. # Restore $ra lw $ra, 4($sp) @@ -1251,173 +2766,608 @@ jr $ra # 0($fp) = param_equal_at_Complex_d_0 function_equal_at_Complex: # Allocate stack frame for function function_equal_at_Complex. - subu $sp, $sp, 60 + subu $sp, $sp, 76 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 60 - # local_equal_at_Complex_internal_2 = GETATTRIBUTE x Complex - # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) - lw $t1, 12($s1) - sw $t1, -12($fp) - # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + addu $fp, $sp, 76 + # local_equal_at_Complex_internal_4 = GETATTRIBUTE x Complex + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + lw $t0, 12($s1) + sw $t0, -20($fp) + # LOCAL local_equal_at_Complex_internal_5 --> -24($fp) # PARAM param_equal_at_Complex_d_0 --> 0($fp) - # local_equal_at_Complex_internal_3 = PARAM param_equal_at_Complex_d_0 - lw $t1, 0($fp) - sw $t1, -16($fp) + # local_equal_at_Complex_internal_5 = PARAM param_equal_at_Complex_d_0 + lw $t0, 0($fp) + sw $t0, -24($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) - # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) - # local_equal_at_Complex_internal_4 = VCALL local_equal_at_Complex_internal_3 x_value + # LOCAL local_equal_at_Complex_internal_5 --> -24($fp) + # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) + # local_equal_at_Complex_internal_6 = VCALL local_equal_at_Complex_internal_5 x_value # Save new self pointer in $s1 - lw $s1, -16($fp) + lw $s1, -24($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 52($t2) + lw $t0, 52($t0) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -20($fp) + jalr $t0 + sw $v0, -28($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) - # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) + # IF_ZERO local_equal_at_Complex_internal_4 GOTO label_FALSE_61 + # IF_ZERO local_equal_at_Complex_internal_4 GOTO label_FALSE_61 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_61 + # IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSE_61 + # IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSE_61 + lw $t0, -28($fp) + beq $t0, 0, label_FALSE_61 + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) - # local_equal_at_Complex_internal_1 = local_equal_at_Complex_internal_2 - local_equal_at_Complex_internal_4 - lw $t1, -12($fp) - lw $t2, -20($fp) - sub $t1, $t1, $t2 - sw $t1, -8($fp) - # IF_ZERO local_equal_at_Complex_internal_1 GOTO label_TRUE_19 - # IF_ZERO local_equal_at_Complex_internal_1 GOTO label_TRUE_19 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_19 - # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) - # local_equal_at_Complex_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_20 -j label_END_20 -label_TRUE_19: - # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) - # local_equal_at_Complex_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_20: -# IF_ZERO local_equal_at_Complex_internal_1 GOTO label_FALSEIF_17 -# IF_ZERO local_equal_at_Complex_internal_1 GOTO label_FALSEIF_17 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_17 -# local_equal_at_Complex_internal_7 = GETATTRIBUTE y Complex -# LOCAL local_equal_at_Complex_internal_7 --> -32($fp) -lw $t1, 16($s1) -sw $t1, -32($fp) -# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) + # Comparing -20($fp) type with String + la $v0, String + lw $a0, -20($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_COMPARE_STRING_64 + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_COMPARE_STRING_64 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_64 + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # Comparing -20($fp) type with Bool + la $v0, Bool + lw $a0, -20($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_65 + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_65 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_65 + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # Comparing -20($fp) type with Int + la $v0, Int + lw $a0, -20($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_65 + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_65 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_65 + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) + # Load pointers and SUB + lw $a0, -20($fp) + lw $a1, -28($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_TRUE_62 + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_TRUE_62 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_62 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_COMPARE_BY_VALUE_65: + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) + lw $a0, -20($fp) + lw $a1, -28($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_TRUE_62 + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_TRUE_62 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_62 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_COMPARE_STRING_64: + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -28($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_CONTINUE_66 + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_CONTINUE_66 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_66 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_CONTINUE_66: + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -28($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_67: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_68 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_67 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_68: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_TRUE_62 + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_TRUE_62 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_62 + label_FALSE_61: + # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_63 +j label_END_63 +label_TRUE_62: + # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_63: +# LOCAL local_equal_at_Complex_internal_0 --> -4($fp) +# LOCAL local_equal_at_Complex_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_equal_at_Complex_internal_0 GOTO label_FALSEIF_59 +# IF_ZERO local_equal_at_Complex_internal_0 GOTO label_FALSEIF_59 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_59 +# local_equal_at_Complex_internal_11 = GETATTRIBUTE y Complex +# LOCAL local_equal_at_Complex_internal_11 --> -48($fp) +lw $t0, 16($s1) +sw $t0, -48($fp) +# LOCAL local_equal_at_Complex_internal_12 --> -52($fp) # PARAM param_equal_at_Complex_d_0 --> 0($fp) -# local_equal_at_Complex_internal_8 = PARAM param_equal_at_Complex_d_0 -lw $t1, 0($fp) -sw $t1, -36($fp) +# local_equal_at_Complex_internal_12 = PARAM param_equal_at_Complex_d_0 +lw $t0, 0($fp) +sw $t0, -52($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) -# LOCAL local_equal_at_Complex_internal_9 --> -40($fp) -# local_equal_at_Complex_internal_9 = VCALL local_equal_at_Complex_internal_8 y_value +# LOCAL local_equal_at_Complex_internal_12 --> -52($fp) +# LOCAL local_equal_at_Complex_internal_13 --> -56($fp) +# local_equal_at_Complex_internal_13 = VCALL local_equal_at_Complex_internal_12 y_value # Save new self pointer in $s1 -lw $s1, -36($fp) +lw $s1, -52($fp) # Get pointer to type -lw $t1, 4($s1) +lw $t0, 4($s1) # Get pointer to type's VTABLE -lw $t2, 0($t1) +lw $t0, 0($t0) # Get pointer to function address -lw $t3, 56($t2) +lw $t0, 56($t0) # Call function. Result is on $v0 -jalr $t3 -sw $v0, -40($fp) +jalr $t0 +sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_equal_at_Complex_internal_6 --> -28($fp) -# LOCAL local_equal_at_Complex_internal_7 --> -32($fp) -# LOCAL local_equal_at_Complex_internal_9 --> -40($fp) -# local_equal_at_Complex_internal_6 = local_equal_at_Complex_internal_7 - local_equal_at_Complex_internal_9 -lw $t1, -32($fp) -lw $t2, -40($fp) -sub $t1, $t1, $t2 -sw $t1, -28($fp) -# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_TRUE_23 -# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_TRUE_23 -lw $t1, -28($fp) -beq $t1, 0, label_TRUE_23 -# LOCAL local_equal_at_Complex_internal_6 --> -28($fp) -# local_equal_at_Complex_internal_6 = 0 -li $t1, 0 -sw $t1, -28($fp) -# GOTO label_END_24 -j label_END_24 -label_TRUE_23: - # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) - # local_equal_at_Complex_internal_6 = 1 - li $t1, 1 - sw $t1, -28($fp) - label_END_24: -# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSEIF_21 -# IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSEIF_21 -lw $t1, -28($fp) -beq $t1, 0, label_FALSEIF_21 +# IF_ZERO local_equal_at_Complex_internal_11 GOTO label_FALSE_71 +# IF_ZERO local_equal_at_Complex_internal_11 GOTO label_FALSE_71 +lw $t0, -48($fp) +beq $t0, 0, label_FALSE_71 +# IF_ZERO local_equal_at_Complex_internal_13 GOTO label_FALSE_71 +# IF_ZERO local_equal_at_Complex_internal_13 GOTO label_FALSE_71 +lw $t0, -56($fp) +beq $t0, 0, label_FALSE_71 # LOCAL local_equal_at_Complex_internal_10 --> -44($fp) -# local_equal_at_Complex_internal_10 = 1 -li $t1, 1 -sw $t1, -44($fp) -# LOCAL local_equal_at_Complex_internal_5 --> -24($fp) +# LOCAL local_equal_at_Complex_internal_11 --> -48($fp) +# Comparing -48($fp) type with String +la $v0, String +lw $a0, -48($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -44($fp) +# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_COMPARE_STRING_74 +# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_COMPARE_STRING_74 +lw $t0, -44($fp) +beq $t0, 0, label_COMPARE_STRING_74 # LOCAL local_equal_at_Complex_internal_10 --> -44($fp) -# local_equal_at_Complex_internal_5 = local_equal_at_Complex_internal_10 -lw $t1, -44($fp) -sw $t1, -24($fp) -# GOTO label_ENDIF_22 -j label_ENDIF_22 -label_FALSEIF_21: - # LOCAL local_equal_at_Complex_internal_11 --> -48($fp) - # local_equal_at_Complex_internal_11 = 0 - li $t1, 0 - sw $t1, -48($fp) - # LOCAL local_equal_at_Complex_internal_5 --> -24($fp) +# LOCAL local_equal_at_Complex_internal_11 --> -48($fp) +# Comparing -48($fp) type with Bool +la $v0, Bool +lw $a0, -48($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -44($fp) +# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_COMPARE_BY_VALUE_75 +# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_COMPARE_BY_VALUE_75 +lw $t0, -44($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_75 +# LOCAL local_equal_at_Complex_internal_10 --> -44($fp) +# LOCAL local_equal_at_Complex_internal_11 --> -48($fp) +# Comparing -48($fp) type with Int +la $v0, Int +lw $a0, -48($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -44($fp) +# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_COMPARE_BY_VALUE_75 +# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_COMPARE_BY_VALUE_75 +lw $t0, -44($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_75 +# LOCAL local_equal_at_Complex_internal_10 --> -44($fp) +# LOCAL local_equal_at_Complex_internal_11 --> -48($fp) +# LOCAL local_equal_at_Complex_internal_13 --> -56($fp) +# Load pointers and SUB +lw $a0, -48($fp) +lw $a1, -56($fp) +sub $a0, $a0, $a1 +sw $a0, -44($fp) +# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_TRUE_72 +# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_TRUE_72 +lw $t0, -44($fp) +beq $t0, 0, label_TRUE_72 +# GOTO label_FALSE_71 +j label_FALSE_71 +label_COMPARE_BY_VALUE_75: + # LOCAL local_equal_at_Complex_internal_10 --> -44($fp) # LOCAL local_equal_at_Complex_internal_11 --> -48($fp) - # local_equal_at_Complex_internal_5 = local_equal_at_Complex_internal_11 - lw $t1, -48($fp) - sw $t1, -24($fp) - label_ENDIF_22: -# LOCAL local_equal_at_Complex_internal_0 --> -4($fp) -# LOCAL local_equal_at_Complex_internal_5 --> -24($fp) -# local_equal_at_Complex_internal_0 = local_equal_at_Complex_internal_5 -lw $t1, -24($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_18 -j label_ENDIF_18 -label_FALSEIF_17: - # LOCAL local_equal_at_Complex_internal_12 --> -52($fp) - # local_equal_at_Complex_internal_12 = 0 - li $t1, 0 - sw $t1, -52($fp) - # LOCAL local_equal_at_Complex_internal_0 --> -4($fp) - # LOCAL local_equal_at_Complex_internal_12 --> -52($fp) - # local_equal_at_Complex_internal_0 = local_equal_at_Complex_internal_12 - lw $t1, -52($fp) - sw $t1, -4($fp) - label_ENDIF_18: -# RETURN local_equal_at_Complex_internal_0 -lw $v0, -4($fp) + # LOCAL local_equal_at_Complex_internal_13 --> -56($fp) + lw $a0, -48($fp) + lw $a1, -56($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_equal_at_Complex_internal_10 GOTO label_TRUE_72 + # IF_ZERO local_equal_at_Complex_internal_10 GOTO label_TRUE_72 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_72 + # GOTO label_FALSE_71 + j label_FALSE_71 + label_COMPARE_STRING_74: + # LOCAL local_equal_at_Complex_internal_10 --> -44($fp) + # LOCAL local_equal_at_Complex_internal_11 --> -48($fp) + # LOCAL local_equal_at_Complex_internal_13 --> -56($fp) + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -56($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -44($fp) + # IF_ZERO local_equal_at_Complex_internal_10 GOTO label_CONTINUE_76 + # IF_ZERO local_equal_at_Complex_internal_10 GOTO label_CONTINUE_76 + lw $t0, -44($fp) + beq $t0, 0, label_CONTINUE_76 + # GOTO label_FALSE_71 + j label_FALSE_71 + label_CONTINUE_76: + # LOCAL local_equal_at_Complex_internal_10 --> -44($fp) + # LOCAL local_equal_at_Complex_internal_11 --> -48($fp) + # LOCAL local_equal_at_Complex_internal_13 --> -56($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -56($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_77: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_78 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_77 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_78: + # Store result + sw $a2, -44($fp) + # IF_ZERO local_equal_at_Complex_internal_10 GOTO label_TRUE_72 + # IF_ZERO local_equal_at_Complex_internal_10 GOTO label_TRUE_72 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_72 + label_FALSE_71: + # LOCAL local_equal_at_Complex_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -40($fp) + # GOTO label_END_73 +j label_END_73 +label_TRUE_72: + # LOCAL local_equal_at_Complex_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -40($fp) + label_END_73: +# LOCAL local_equal_at_Complex_internal_7 --> -32($fp) +# LOCAL local_equal_at_Complex_internal_9 --> -40($fp) +# Obtain value from -40($fp) +lw $v0, -40($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_equal_at_Complex_internal_7 GOTO label_FALSEIF_69 +# IF_ZERO local_equal_at_Complex_internal_7 GOTO label_FALSEIF_69 +lw $t0, -32($fp) +beq $t0, 0, label_FALSEIF_69 +# LOCAL local_equal_at_Complex_internal_14 --> -60($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -60($fp) +# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) +# LOCAL local_equal_at_Complex_internal_14 --> -60($fp) +# local_equal_at_Complex_internal_8 = local_equal_at_Complex_internal_14 +lw $t0, -60($fp) +sw $t0, -36($fp) +# GOTO label_ENDIF_70 +j label_ENDIF_70 +label_FALSEIF_69: + # LOCAL local_equal_at_Complex_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -64($fp) + # LOCAL local_equal_at_Complex_internal_8 --> -36($fp) + # LOCAL local_equal_at_Complex_internal_15 --> -64($fp) + # local_equal_at_Complex_internal_8 = local_equal_at_Complex_internal_15 + lw $t0, -64($fp) + sw $t0, -36($fp) + label_ENDIF_70: +# LOCAL local_equal_at_Complex_internal_1 --> -8($fp) +# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) +# local_equal_at_Complex_internal_1 = local_equal_at_Complex_internal_8 +lw $t0, -36($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_60 +j label_ENDIF_60 +label_FALSEIF_59: + # LOCAL local_equal_at_Complex_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -68($fp) + # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) + # LOCAL local_equal_at_Complex_internal_16 --> -68($fp) + # local_equal_at_Complex_internal_1 = local_equal_at_Complex_internal_16 + lw $t0, -68($fp) + sw $t0, -8($fp) + label_ENDIF_60: +# RETURN local_equal_at_Complex_internal_1 +lw $v0, -8($fp) # Deallocate stack frame for function function_equal_at_Complex. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 60 +addu $sp, $sp, 76 # Deallocate function args addu $sp, $sp, 4 jr $ra @@ -1434,8 +3384,8 @@ function_x_value_at_Complex: addu $fp, $sp, 32 # local_x_value_at_Complex_internal_0 = GETATTRIBUTE x Complex # LOCAL local_x_value_at_Complex_internal_0 --> -4($fp) - lw $t1, 12($s1) - sw $t1, -4($fp) + lw $t0, 12($s1) + sw $t0, -4($fp) # RETURN local_x_value_at_Complex_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_x_value_at_Complex. @@ -1459,8 +3409,8 @@ function_y_value_at_Complex: addu $fp, $sp, 32 # local_y_value_at_Complex_internal_0 = GETATTRIBUTE y Complex # LOCAL local_y_value_at_Complex_internal_0 --> -4($fp) - lw $t1, 16($s1) - sw $t1, -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) # RETURN local_y_value_at_Complex_internal_0 lw $v0, -4($fp) # Deallocate stack frame for function function_y_value_at_Complex. @@ -1478,10 +3428,10 @@ function_y_value_at_Complex: # @Params: function_main_at_Main: # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 148 + subu $sp, $sp, 168 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 148 + addu $fp, $sp, 168 # LOCAL local_main_at_Main_c_0 --> -4($fp) # local_main_at_Main_c_0 = ALLOCATE Complex # Allocating 20 bytes of memory @@ -1489,53 +3439,53 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Complex - sw $t3, 12($v0) - li $t3, 7 - sw $t3, 16($v0) - move $t3, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Complex + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - sw $t3, 0($v0) - la $t3, Complex_start - sw $t3, 4($v0) + sw $t0, 0($v0) + la $t0, Complex_start + sw $t0, 4($v0) # Load type offset - li $t3, 16 - sw $t3, 8($v0) - move $t2, $v0 + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t2 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) jal __Complex__attrib__x__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t2) - # Push register t2 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t1, 0($sp) jal __Complex__attrib__y__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t2) + sw $v0, 16($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t2, -4($fp) + sw $t1, -4($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_3 = ALLOCATE Complex # Allocating 20 bytes of memory @@ -1543,84 +3493,148 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Complex - sw $t4, 12($v0) - li $t4, 7 - sw $t4, 16($v0) - move $t4, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Complex + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - sw $t4, 0($v0) - la $t4, Complex_start - sw $t4, 4($v0) + sw $t0, 0($v0) + la $t0, Complex_start + sw $t0, 4($v0) # Load type offset - li $t4, 16 - sw $t4, 8($v0) - move $t3, $v0 + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t3 into stack + # Push register t1 into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t1, 0($sp) jal __Complex__attrib__x__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 12($t3) - # Push register t3 into stack + sw $v0, 12($t1) + # Push register t1 into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t1, 0($sp) jal __Complex__attrib__y__init - # Pop 4 bytes from stack into register t3 - lw $t3, 0($sp) + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) addu $sp, $sp, 4 - sw $v0, 16($t3) + sw $v0, 16($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t3, -16($fp) + sw $t1, -16($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t3, -16($fp) - sw $t3, -8($fp) + lw $t0, -16($fp) + sw $t0, -8($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # ARG 1 - li $t3, 1 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -20($fp) + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t0, -20($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) - # ARG 1 - li $t3, 1 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -24($fp) + # ARG local_main_at_Main_internal_5 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t0, -24($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init # Save new self pointer in $s1 lw $s1, -8($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t0, 0($t0) # Get pointer to function address - lw $t5, 28($t4) + lw $t0, 28($t0) # Call function. Result is on $v0 - jalr $t5 + jalr $t0 sw $v0, -12($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -1628,441 +3642,624 @@ function_main_at_Main: # LOCAL local_main_at_Main_c_0 --> -4($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # local_main_at_Main_c_0 = local_main_at_Main_internal_2 - lw $t3, -12($fp) - sw $t3, -4($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) + lw $t0, -12($fp) + sw $t0, -4($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_c_0 - lw $t3, -4($fp) - sw $t3, -28($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_c_0 + lw $t0, -4($fp) + sw $t0, -44($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 reflect_X + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 reflect_X # Save new self pointer in $s1 - lw $s1, -28($fp) + lw $s1, -44($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t0, 0($t0) # Get pointer to function address - lw $t5, 40($t4) + lw $t0, 40($t0) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -32($fp) + jalr $t0 + sw $v0, -48($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_internal_8 = local_main_at_Main_c_0 - lw $t3, -4($fp) - sw $t3, -36($fp) + # local_main_at_Main_internal_12 = local_main_at_Main_c_0 + lw $t0, -4($fp) + sw $t0, -52($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 reflect_0 + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 reflect_0 # Save new self pointer in $s1 - lw $s1, -36($fp) + lw $s1, -52($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t0, 0($t0) # Get pointer to function address - lw $t5, 36($t4) + lw $t0, 36($t0) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -40($fp) + jalr $t0 + sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # IF_ZERO local_main_at_Main_internal_11 GOTO label_FALSE_81 + # IF_ZERO local_main_at_Main_internal_11 GOTO label_FALSE_81 + lw $t0, -48($fp) + beq $t0, 0, label_FALSE_81 + # IF_ZERO local_main_at_Main_internal_13 GOTO label_FALSE_81 + # IF_ZERO local_main_at_Main_internal_13 GOTO label_FALSE_81 + lw $t0, -56($fp) + beq $t0, 0, label_FALSE_81 # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_5 = local_main_at_Main_internal_7 - local_main_at_Main_internal_9 - lw $t3, -32($fp) - lw $t4, -40($fp) - sub $t3, $t3, $t4 - sw $t3, -24($fp) - # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_27 - # IF_ZERO local_main_at_Main_internal_5 GOTO label_TRUE_27 - lw $t3, -24($fp) - beq $t3, 0, label_TRUE_27 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = 0 - li $t3, 0 - sw $t3, -24($fp) - # GOTO label_END_28 -j label_END_28 -label_TRUE_27: - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = 1 - li $t3, 1 - sw $t3, -24($fp) - label_END_28: -# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_25 -# IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSEIF_25 -lw $t3, -24($fp) -beq $t3, 0, label_FALSEIF_25 -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# local_main_at_Main_internal_12 = SELF -sw $s1, -52($fp) -# LOCAL local_main_at_Main_internal_10 --> -44($fp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# local_main_at_Main_internal_10 = local_main_at_Main_internal_12 -lw $t3, -52($fp) -sw $t3, -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Comparing -48($fp) type with String + la $v0, String + lw $a0, -48($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_STRING_84 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_STRING_84 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_84 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Comparing -48($fp) type with Bool + la $v0, Bool + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_85 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_85 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_85 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Comparing -48($fp) type with Int + la $v0, Int + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_85 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_85 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_85 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # Load pointers and SUB + lw $a0, -48($fp) + lw $a1, -56($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_82 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_82 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_82 + # GOTO label_FALSE_81 + j label_FALSE_81 + label_COMPARE_BY_VALUE_85: + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + lw $a0, -48($fp) + lw $a1, -56($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_82 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_82 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_82 + # GOTO label_FALSE_81 + j label_FALSE_81 + label_COMPARE_STRING_84: + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -56($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_CONTINUE_86 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_CONTINUE_86 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_86 + # GOTO label_FALSE_81 + j label_FALSE_81 + label_CONTINUE_86: + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -56($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_87: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_88 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_87 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_88: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_82 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_82 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_82 + label_FALSE_81: + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_83 +j label_END_83 +label_TRUE_82: + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_83: +# LOCAL local_main_at_Main_internal_6 --> -28($fp) +# LOCAL local_main_at_Main_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_main_at_Main_internal_6 GOTO label_FALSEIF_79 +# IF_ZERO local_main_at_Main_internal_6 GOTO label_FALSEIF_79 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_79 +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# local_main_at_Main_internal_16 = SELF +sw $s1, -68($fp) +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# local_main_at_Main_internal_14 = local_main_at_Main_internal_16 +lw $t0, -68($fp) +sw $t0, -60($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# LOCAL local_main_at_Main_internal_17 --> -72($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string -la $t3, String -sw $t3, 0($v0) -la $t3, String_start -sw $t3, 4($v0) +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) # Load type offset -li $t3, 8 -sw $t3, 8($v0) -la $t3, data_6 -sw $t3, 12($v0) -li $t3, 3 -sw $t3, 16($v0) -sw $v0, -56($fp) -# ARG local_main_at_Main_internal_13 -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -lw $t3, -56($fp) +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_6 +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +sw $v0, -72($fp) +# ARG local_main_at_Main_internal_17 +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +lw $t0, -72($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_main_at_Main_internal_10 --> -44($fp) -# LOCAL local_main_at_Main_internal_11 --> -48($fp) -# local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 out_string +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 out_string # Save new self pointer in $s1 -lw $s1, -44($fp) +lw $s1, -60($fp) # Get pointer to type -lw $t3, 4($s1) +lw $t0, 4($s1) # Get pointer to type's VTABLE -lw $t4, 0($t3) +lw $t0, 0($t0) # Get pointer to function address -lw $t5, 12($t4) +lw $t0, 12($t0) # Call function. Result is on $v0 -jalr $t5 -sw $v0, -48($fp) +jalr $t0 +sw $v0, -64($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_4 --> -20($fp) -# LOCAL local_main_at_Main_internal_11 --> -48($fp) -# local_main_at_Main_internal_4 = local_main_at_Main_internal_11 -lw $t3, -48($fp) -sw $t3, -20($fp) -# GOTO label_ENDIF_26 -j label_ENDIF_26 -label_FALSEIF_25: - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_16 = SELF - sw $s1, -68($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_14 = local_main_at_Main_internal_16 - lw $t3, -68($fp) - sw $t3, -60($fp) +# LOCAL local_main_at_Main_internal_7 --> -32($fp) +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# local_main_at_Main_internal_7 = local_main_at_Main_internal_15 +lw $t0, -64($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_80 +j label_ENDIF_80 +label_FALSEIF_79: + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_20 = SELF + sw $s1, -84($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 + lw $t0, -84($fp) + sw $t0, -76($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_7 - sw $t3, 12($v0) - li $t3, 3 - sw $t3, 16($v0) - sw $v0, -72($fp) - # ARG local_main_at_Main_internal_17 - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - lw $t3, -72($fp) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_7 + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + sw $v0, -88($fp) + # ARG local_main_at_Main_internal_21 + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + lw $t0, -88($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 out_string + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 out_string # Save new self pointer in $s1 - lw $s1, -60($fp) + lw $s1, -76($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t0, 0($t0) # Get pointer to function address - lw $t5, 12($t4) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -64($fp) + jalr $t0 + sw $v0, -80($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_4 = local_main_at_Main_internal_15 - lw $t3, -64($fp) - sw $t3, -20($fp) - label_ENDIF_26: -# LOCAL local_main_at_Main_internal_23 --> -96($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_19 + lw $t0, -80($fp) + sw $t0, -32($fp) + label_ENDIF_80: +# LOCAL local_main_at_Main_internal_28 --> -116($fp) # LOCAL local_main_at_Main_c_0 --> -4($fp) -# local_main_at_Main_internal_23 = local_main_at_Main_c_0 -lw $t3, -4($fp) -sw $t3, -96($fp) +# local_main_at_Main_internal_28 = local_main_at_Main_c_0 +lw $t0, -4($fp) +sw $t0, -116($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_23 --> -96($fp) -# LOCAL local_main_at_Main_internal_24 --> -100($fp) -# local_main_at_Main_internal_24 = VCALL local_main_at_Main_internal_23 reflect_X +# LOCAL local_main_at_Main_internal_28 --> -116($fp) +# LOCAL local_main_at_Main_internal_29 --> -120($fp) +# local_main_at_Main_internal_29 = VCALL local_main_at_Main_internal_28 reflect_X # Save new self pointer in $s1 -lw $s1, -96($fp) +lw $s1, -116($fp) # Get pointer to type -lw $t3, 4($s1) +lw $t0, 4($s1) # Get pointer to type's VTABLE -lw $t4, 0($t3) +lw $t0, 0($t0) # Get pointer to function address -lw $t5, 40($t4) +lw $t0, 40($t0) # Call function. Result is on $v0 -jalr $t5 -sw $v0, -100($fp) +jalr $t0 +sw $v0, -120($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_21 --> -88($fp) -# LOCAL local_main_at_Main_internal_24 --> -100($fp) -# local_main_at_Main_internal_21 = local_main_at_Main_internal_24 -lw $t3, -100($fp) -sw $t3, -88($fp) +# LOCAL local_main_at_Main_internal_26 --> -108($fp) +# LOCAL local_main_at_Main_internal_29 --> -120($fp) +# local_main_at_Main_internal_26 = local_main_at_Main_internal_29 +lw $t0, -120($fp) +sw $t0, -108($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_21 --> -88($fp) -# LOCAL local_main_at_Main_internal_22 --> -92($fp) -# local_main_at_Main_internal_22 = VCALL local_main_at_Main_internal_21 reflect_Y +# LOCAL local_main_at_Main_internal_26 --> -108($fp) +# LOCAL local_main_at_Main_internal_27 --> -112($fp) +# local_main_at_Main_internal_27 = VCALL local_main_at_Main_internal_26 reflect_Y # Save new self pointer in $s1 -lw $s1, -88($fp) +lw $s1, -108($fp) # Get pointer to type -lw $t3, 4($s1) +lw $t0, 4($s1) # Get pointer to type's VTABLE -lw $t4, 0($t3) +lw $t0, 0($t0) # Get pointer to function address -lw $t5, 44($t4) +lw $t0, 44($t0) # Call function. Result is on $v0 -jalr $t5 -sw $v0, -92($fp) +jalr $t0 +sw $v0, -112($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# LOCAL local_main_at_Main_internal_22 --> -92($fp) -# local_main_at_Main_internal_19 = local_main_at_Main_internal_22 -lw $t3, -92($fp) -sw $t3, -80($fp) +# LOCAL local_main_at_Main_internal_24 --> -100($fp) +# LOCAL local_main_at_Main_internal_27 --> -112($fp) +# local_main_at_Main_internal_24 = local_main_at_Main_internal_27 +lw $t0, -112($fp) +sw $t0, -100($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_25 --> -104($fp) +# LOCAL local_main_at_Main_internal_30 --> -124($fp) # LOCAL local_main_at_Main_c_0 --> -4($fp) -# local_main_at_Main_internal_25 = local_main_at_Main_c_0 -lw $t3, -4($fp) -sw $t3, -104($fp) +# local_main_at_Main_internal_30 = local_main_at_Main_c_0 +lw $t0, -4($fp) +sw $t0, -124($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_25 --> -104($fp) -# LOCAL local_main_at_Main_internal_26 --> -108($fp) -# local_main_at_Main_internal_26 = VCALL local_main_at_Main_internal_25 reflect_0 +# LOCAL local_main_at_Main_internal_30 --> -124($fp) +# LOCAL local_main_at_Main_internal_31 --> -128($fp) +# local_main_at_Main_internal_31 = VCALL local_main_at_Main_internal_30 reflect_0 # Save new self pointer in $s1 -lw $s1, -104($fp) +lw $s1, -124($fp) # Get pointer to type -lw $t3, 4($s1) +lw $t0, 4($s1) # Get pointer to type's VTABLE -lw $t4, 0($t3) +lw $t0, 0($t0) # Get pointer to function address -lw $t5, 36($t4) +lw $t0, 36($t0) # Call function. Result is on $v0 -jalr $t5 -sw $v0, -108($fp) +jalr $t0 +sw $v0, -128($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_26 -# LOCAL local_main_at_Main_internal_26 --> -108($fp) -lw $t3, -108($fp) +# ARG local_main_at_Main_internal_31 +# LOCAL local_main_at_Main_internal_31 --> -128($fp) +lw $t0, -128($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# LOCAL local_main_at_Main_internal_20 --> -84($fp) -# local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 equal +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_24 --> -100($fp) +# LOCAL local_main_at_Main_internal_25 --> -104($fp) +# local_main_at_Main_internal_25 = VCALL local_main_at_Main_internal_24 equal # Save new self pointer in $s1 -lw $s1, -80($fp) +lw $s1, -100($fp) # Get pointer to type -lw $t3, 4($s1) +lw $t0, 4($s1) # Get pointer to type's VTABLE -lw $t4, 0($t3) +lw $t0, 0($t0) # Get pointer to function address -lw $t5, 48($t4) +lw $t0, 48($t0) # Call function. Result is on $v0 -jalr $t5 -sw $v0, -84($fp) +jalr $t0 +sw $v0, -104($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# IF_ZERO local_main_at_Main_internal_20 GOTO label_FALSEIF_29 -# IF_ZERO local_main_at_Main_internal_20 GOTO label_FALSEIF_29 -lw $t3, -84($fp) -beq $t3, 0, label_FALSEIF_29 -# LOCAL local_main_at_Main_internal_29 --> -120($fp) -# local_main_at_Main_internal_29 = SELF -sw $s1, -120($fp) -# LOCAL local_main_at_Main_internal_27 --> -112($fp) -# LOCAL local_main_at_Main_internal_29 --> -120($fp) -# local_main_at_Main_internal_27 = local_main_at_Main_internal_29 -lw $t3, -120($fp) -sw $t3, -112($fp) +# LOCAL local_main_at_Main_internal_22 --> -92($fp) +# LOCAL local_main_at_Main_internal_25 --> -104($fp) +# Obtain value from -104($fp) +lw $v0, -104($fp) +lw $v0, 12($v0) +sw $v0, -92($fp) +# IF_ZERO local_main_at_Main_internal_22 GOTO label_FALSEIF_89 +# IF_ZERO local_main_at_Main_internal_22 GOTO label_FALSEIF_89 +lw $t0, -92($fp) +beq $t0, 0, label_FALSEIF_89 +# LOCAL local_main_at_Main_internal_34 --> -140($fp) +# local_main_at_Main_internal_34 = SELF +sw $s1, -140($fp) +# LOCAL local_main_at_Main_internal_32 --> -132($fp) +# LOCAL local_main_at_Main_internal_34 --> -140($fp) +# local_main_at_Main_internal_32 = local_main_at_Main_internal_34 +lw $t0, -140($fp) +sw $t0, -132($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_30 --> -124($fp) +# LOCAL local_main_at_Main_internal_35 --> -144($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string -la $t3, String -sw $t3, 0($v0) -la $t3, String_start -sw $t3, 4($v0) +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) # Load type offset -li $t3, 8 -sw $t3, 8($v0) -la $t3, data_8 -sw $t3, 12($v0) -li $t3, 3 -sw $t3, 16($v0) -sw $v0, -124($fp) -# ARG local_main_at_Main_internal_30 -# LOCAL local_main_at_Main_internal_30 --> -124($fp) -lw $t3, -124($fp) +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_8 +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +sw $v0, -144($fp) +# ARG local_main_at_Main_internal_35 +# LOCAL local_main_at_Main_internal_35 --> -144($fp) +lw $t0, -144($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t3, 0($sp) -# LOCAL local_main_at_Main_internal_27 --> -112($fp) -# LOCAL local_main_at_Main_internal_28 --> -116($fp) -# local_main_at_Main_internal_28 = VCALL local_main_at_Main_internal_27 out_string +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_32 --> -132($fp) +# LOCAL local_main_at_Main_internal_33 --> -136($fp) +# local_main_at_Main_internal_33 = VCALL local_main_at_Main_internal_32 out_string # Save new self pointer in $s1 -lw $s1, -112($fp) +lw $s1, -132($fp) # Get pointer to type -lw $t3, 4($s1) +lw $t0, 4($s1) # Get pointer to type's VTABLE -lw $t4, 0($t3) +lw $t0, 0($t0) # Get pointer to function address -lw $t5, 12($t4) +lw $t0, 12($t0) # Call function. Result is on $v0 -jalr $t5 -sw $v0, -116($fp) +jalr $t0 +sw $v0, -136($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# LOCAL local_main_at_Main_internal_28 --> -116($fp) -# local_main_at_Main_internal_18 = local_main_at_Main_internal_28 -lw $t3, -116($fp) -sw $t3, -76($fp) -# GOTO label_ENDIF_30 -j label_ENDIF_30 -label_FALSEIF_29: - # LOCAL local_main_at_Main_internal_33 --> -136($fp) - # local_main_at_Main_internal_33 = SELF - sw $s1, -136($fp) - # LOCAL local_main_at_Main_internal_31 --> -128($fp) - # LOCAL local_main_at_Main_internal_33 --> -136($fp) - # local_main_at_Main_internal_31 = local_main_at_Main_internal_33 - lw $t3, -136($fp) - sw $t3, -128($fp) +# LOCAL local_main_at_Main_internal_23 --> -96($fp) +# LOCAL local_main_at_Main_internal_33 --> -136($fp) +# local_main_at_Main_internal_23 = local_main_at_Main_internal_33 +lw $t0, -136($fp) +sw $t0, -96($fp) +# GOTO label_ENDIF_90 +j label_ENDIF_90 +label_FALSEIF_89: + # LOCAL local_main_at_Main_internal_38 --> -156($fp) + # local_main_at_Main_internal_38 = SELF + sw $s1, -156($fp) + # LOCAL local_main_at_Main_internal_36 --> -148($fp) + # LOCAL local_main_at_Main_internal_38 --> -156($fp) + # local_main_at_Main_internal_36 = local_main_at_Main_internal_38 + lw $t0, -156($fp) + sw $t0, -148($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_34 --> -140($fp) + # LOCAL local_main_at_Main_internal_39 --> -160($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_9 - sw $t3, 12($v0) - li $t3, 3 - sw $t3, 16($v0) - sw $v0, -140($fp) - # ARG local_main_at_Main_internal_34 - # LOCAL local_main_at_Main_internal_34 --> -140($fp) - lw $t3, -140($fp) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_9 + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + sw $v0, -160($fp) + # ARG local_main_at_Main_internal_39 + # LOCAL local_main_at_Main_internal_39 --> -160($fp) + lw $t0, -160($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_31 --> -128($fp) - # LOCAL local_main_at_Main_internal_32 --> -132($fp) - # local_main_at_Main_internal_32 = VCALL local_main_at_Main_internal_31 out_string + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_36 --> -148($fp) + # LOCAL local_main_at_Main_internal_37 --> -152($fp) + # local_main_at_Main_internal_37 = VCALL local_main_at_Main_internal_36 out_string # Save new self pointer in $s1 - lw $s1, -128($fp) + lw $s1, -148($fp) # Get pointer to type - lw $t3, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t4, 0($t3) + lw $t0, 0($t0) # Get pointer to function address - lw $t5, 12($t4) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t5 - sw $v0, -132($fp) + jalr $t0 + sw $v0, -152($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_32 --> -132($fp) - # local_main_at_Main_internal_18 = local_main_at_Main_internal_32 - lw $t3, -132($fp) - sw $t3, -76($fp) - label_ENDIF_30: -# RETURN local_main_at_Main_internal_18 -lw $v0, -76($fp) + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # LOCAL local_main_at_Main_internal_37 --> -152($fp) + # local_main_at_Main_internal_23 = local_main_at_Main_internal_37 + lw $t0, -152($fp) + sw $t0, -96($fp) + label_ENDIF_90: +# RETURN local_main_at_Main_internal_23 +lw $v0, -96($fp) # Deallocate stack frame for function function_main_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 148 +addu $sp, $sp, 168 jr $ra # Function END diff --git a/tests/codegen/palindrome.mips b/tests/codegen/palindrome.mips index 596bd9ee..9bbda234 100644 --- a/tests/codegen/palindrome.mips +++ b/tests/codegen/palindrome.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:42 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 07:49:32 2020 # School of Math and Computer Science, University of Havana # @@ -13,6 +13,8 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END +Int: .asciiz "Int" +# Function END Main: .asciiz "Main" # Function END # @@ -74,6 +76,20 @@ Bool_end: # +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + # **** VTABLE for type Main **** Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_pal_at_Main, function_main_at_Main # Function END @@ -100,11 +116,12 @@ data_2: .asciiz "\n" # -IO__TDT: .word 0, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, 0 +IO__TDT: .word 0, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0 # @@ -198,7 +215,8 @@ function_out_int_at_IO: addu $fp, $sp, 32 # PRINT_INT param_out_int_at_IO_x_0 # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) li $v0, 1 syscall # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) @@ -264,6 +282,35 @@ function_in_int_at_IO: # local_in_int_at_IO_internal_0 = READ_INT li $v0, 5 syscall + move $a0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a0, 12($v0) sw $v0, -4($fp) # RETURN local_in_int_at_IO_internal_0 lw $v0, -4($fp) @@ -361,7 +408,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -450,8 +497,10 @@ function_substr_at_String: # PARAM param_substr_at_String_r_1 --> 0($fp) lw $t0, 12($s1) lw $t2, 4($fp) + lw $t2, 12($t2) addu $t0, $t0, $t2 lw $a0, 0($fp) + lw $a0, 12($a0) move $t3, $a0 move $t1, $a0 addu $a0, $a0, 1 @@ -511,8 +560,40 @@ function_length_at_String: # LOCAL local_length_at_String_internal_0 --> -4($fp) lw $t0, 16($s1) sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function function_length_at_String. # Restore $ra lw $ra, 4($sp) @@ -559,7 +640,7 @@ entry: la $t2, Main_start sw $t2, 4($v0) # Load type offset - li $t2, 16 + li $t2, 20 sw $t2, 8($v0) move $t1, $v0 # Push register s1 into stack @@ -631,10 +712,10 @@ __Main__attrib__i__init: # 0($fp) = param_pal_at_Main_s_0 function_pal_at_Main: # Allocate stack frame for function function_pal_at_Main. - subu $sp, $sp, 120 + subu $sp, $sp, 152 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 120 + addu $fp, $sp, 152 # LOCAL local_pal_at_Main_internal_2 --> -12($fp) # PARAM param_pal_at_Main_s_0 --> 0($fp) # local_pal_at_Main_internal_2 = PARAM param_pal_at_Main_s_0 @@ -660,367 +741,708 @@ function_pal_at_Main: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + li $t1, 0 + sw $t1, 12($v0) + sw $v0, -20($fp) # LOCAL local_pal_at_Main_internal_1 --> -8($fp) # LOCAL local_pal_at_Main_internal_3 --> -16($fp) - # local_pal_at_Main_internal_1 = local_pal_at_Main_internal_3 - 0 + # LOCAL local_pal_at_Main_internal_4 --> -20($fp) lw $t1, -16($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_ZERO local_pal_at_Main_internal_1 GOTO label_TRUE_3 - # IF_ZERO local_pal_at_Main_internal_1 GOTO label_TRUE_3 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_3 - # LOCAL local_pal_at_Main_internal_1 --> -8($fp) - # local_pal_at_Main_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_4 -j label_END_4 -label_TRUE_3: - # LOCAL local_pal_at_Main_internal_1 --> -8($fp) - # local_pal_at_Main_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_4: -# IF_ZERO local_pal_at_Main_internal_1 GOTO label_FALSEIF_1 -# IF_ZERO local_pal_at_Main_internal_1 GOTO label_FALSEIF_1 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_1 -# LOCAL local_pal_at_Main_internal_4 --> -20($fp) -# local_pal_at_Main_internal_4 = 1 -li $t1, 1 -sw $t1, -20($fp) -# LOCAL local_pal_at_Main_internal_0 --> -4($fp) -# LOCAL local_pal_at_Main_internal_4 --> -20($fp) -# local_pal_at_Main_internal_0 = local_pal_at_Main_internal_4 -lw $t1, -20($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_2 + # IF_ZERO local_pal_at_Main_internal_1 GOTO label_FALSEIF_1 + # IF_ZERO local_pal_at_Main_internal_1 GOTO label_FALSEIF_1 + lw $t2, -8($fp) + beq $t2, 0, label_FALSEIF_1 + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Bool + sw $t2, 12($v0) + li $t2, 4 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Bool_start + sw $t2, 4($v0) + # Load type offset + li $t2, 12 + sw $t2, 8($v0) + li $t2, 1 + sw $t2, 12($v0) + sw $v0, -24($fp) + # LOCAL local_pal_at_Main_internal_0 --> -4($fp) + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # local_pal_at_Main_internal_0 = local_pal_at_Main_internal_5 + lw $t2, -24($fp) + sw $t2, -4($fp) + # GOTO label_ENDIF_2 j label_ENDIF_2 label_FALSEIF_1: - # LOCAL local_pal_at_Main_internal_7 --> -32($fp) + # LOCAL local_pal_at_Main_internal_8 --> -36($fp) # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_7 = PARAM param_pal_at_Main_s_0 - lw $t1, 0($fp) - sw $t1, -32($fp) + # local_pal_at_Main_internal_8 = PARAM param_pal_at_Main_s_0 + lw $t2, 0($fp) + sw $t2, -36($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_7 --> -32($fp) # LOCAL local_pal_at_Main_internal_8 --> -36($fp) - # local_pal_at_Main_internal_8 = VCALL local_pal_at_Main_internal_7 length + # LOCAL local_pal_at_Main_internal_9 --> -40($fp) + # local_pal_at_Main_internal_9 = VCALL local_pal_at_Main_internal_8 length # Save new self pointer in $s1 - lw $s1, -32($fp) + lw $s1, -36($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t2, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t3, 0($t2) # Get pointer to function address - lw $t3, 20($t2) + lw $t4, 20($t3) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -36($fp) + jalr $t4 + sw $v0, -40($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t2, String + sw $t2, 0($v0) + la $t2, String_start + sw $t2, 4($v0) + # Load type offset + li $t2, 8 + sw $t2, 8($v0) + la $t2, Int + sw $t2, 12($v0) + li $t2, 3 + sw $t2, 16($v0) + move $t2, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t2, 0($v0) + la $t2, Int_start + sw $t2, 4($v0) + # Load type offset + li $t2, 16 + sw $t2, 8($v0) + li $t2, 1 + sw $t2, 12($v0) + sw $v0, -44($fp) + # LOCAL local_pal_at_Main_internal_7 --> -32($fp) + # LOCAL local_pal_at_Main_internal_9 --> -40($fp) + # LOCAL local_pal_at_Main_internal_10 --> -44($fp) + lw $t2, -40($fp) + # IF_ZERO local_pal_at_Main_internal_7 GOTO label_FALSEIF_3 + # IF_ZERO local_pal_at_Main_internal_7 GOTO label_FALSEIF_3 + lw $t3, -32($fp) + beq $t3, 0, label_FALSEIF_3 + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Bool + sw $t3, 12($v0) + li $t3, 4 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Bool_start + sw $t3, 4($v0) + # Load type offset + li $t3, 12 + sw $t3, 8($v0) + li $t3, 1 + sw $t3, 12($v0) + sw $v0, -48($fp) # LOCAL local_pal_at_Main_internal_6 --> -28($fp) - # LOCAL local_pal_at_Main_internal_8 --> -36($fp) - # local_pal_at_Main_internal_6 = local_pal_at_Main_internal_8 - 1 - lw $t1, -36($fp) - sub $t1, $t1, 1 - sw $t1, -28($fp) - # IF_ZERO local_pal_at_Main_internal_6 GOTO label_TRUE_7 - # IF_ZERO local_pal_at_Main_internal_6 GOTO label_TRUE_7 - lw $t1, -28($fp) - beq $t1, 0, label_TRUE_7 - # LOCAL local_pal_at_Main_internal_6 --> -28($fp) - # local_pal_at_Main_internal_6 = 0 - li $t1, 0 - sw $t1, -28($fp) - # GOTO label_END_8 -j label_END_8 -label_TRUE_7: - # LOCAL local_pal_at_Main_internal_6 --> -28($fp) - # local_pal_at_Main_internal_6 = 1 - li $t1, 1 - sw $t1, -28($fp) - label_END_8: -# IF_ZERO local_pal_at_Main_internal_6 GOTO label_FALSEIF_5 -# IF_ZERO local_pal_at_Main_internal_6 GOTO label_FALSEIF_5 -lw $t1, -28($fp) -beq $t1, 0, label_FALSEIF_5 -# LOCAL local_pal_at_Main_internal_9 --> -40($fp) -# local_pal_at_Main_internal_9 = 1 -li $t1, 1 -sw $t1, -40($fp) -# LOCAL local_pal_at_Main_internal_5 --> -24($fp) -# LOCAL local_pal_at_Main_internal_9 --> -40($fp) -# local_pal_at_Main_internal_5 = local_pal_at_Main_internal_9 -lw $t1, -40($fp) -sw $t1, -24($fp) -# GOTO label_ENDIF_6 -j label_ENDIF_6 -label_FALSEIF_5: - # LOCAL local_pal_at_Main_internal_12 --> -52($fp) + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # local_pal_at_Main_internal_6 = local_pal_at_Main_internal_11 + lw $t3, -48($fp) + sw $t3, -28($fp) + # GOTO label_ENDIF_4 +j label_ENDIF_4 +label_FALSEIF_3: + # LOCAL local_pal_at_Main_internal_14 --> -60($fp) # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_12 = PARAM param_pal_at_Main_s_0 - lw $t1, 0($fp) - sw $t1, -52($fp) + # local_pal_at_Main_internal_14 = PARAM param_pal_at_Main_s_0 + lw $t3, 0($fp) + sw $t3, -60($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # ARG 0 - li $t1, 0 + # LOCAL local_pal_at_Main_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Int + sw $t3, 12($v0) + li $t3, 3 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Int_start + sw $t3, 4($v0) + # Load type offset + li $t3, 16 + sw $t3, 8($v0) + li $t3, 0 + sw $t3, 12($v0) + sw $v0, -68($fp) + # ARG local_pal_at_Main_internal_16 + # LOCAL local_pal_at_Main_internal_16 --> -68($fp) + lw $t3, -68($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # ARG 1 - li $t1, 1 + sw $t3, 0($sp) + # LOCAL local_pal_at_Main_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Int + sw $t3, 12($v0) + li $t3, 3 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Int_start + sw $t3, 4($v0) + # Load type offset + li $t3, 16 + sw $t3, 8($v0) + li $t3, 1 + sw $t3, 12($v0) + sw $v0, -72($fp) + # ARG local_pal_at_Main_internal_17 + # LOCAL local_pal_at_Main_internal_17 --> -72($fp) + lw $t3, -72($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_pal_at_Main_internal_12 --> -52($fp) - # LOCAL local_pal_at_Main_internal_13 --> -56($fp) - # local_pal_at_Main_internal_13 = VCALL local_pal_at_Main_internal_12 substr + sw $t3, 0($sp) + # LOCAL local_pal_at_Main_internal_14 --> -60($fp) + # LOCAL local_pal_at_Main_internal_15 --> -64($fp) + # local_pal_at_Main_internal_15 = VCALL local_pal_at_Main_internal_14 substr # Save new self pointer in $s1 - lw $s1, -52($fp) + lw $s1, -60($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 16($t2) + lw $t5, 16($t4) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -56($fp) + jalr $t5 + sw $v0, -64($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_14 --> -60($fp) + # LOCAL local_pal_at_Main_internal_18 --> -76($fp) # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_14 = PARAM param_pal_at_Main_s_0 - lw $t1, 0($fp) - sw $t1, -60($fp) + # local_pal_at_Main_internal_18 = PARAM param_pal_at_Main_s_0 + lw $t3, 0($fp) + sw $t3, -76($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_17 --> -72($fp) + # LOCAL local_pal_at_Main_internal_21 --> -88($fp) # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_17 = PARAM param_pal_at_Main_s_0 - lw $t1, 0($fp) - sw $t1, -72($fp) + # local_pal_at_Main_internal_21 = PARAM param_pal_at_Main_s_0 + lw $t3, 0($fp) + sw $t3, -88($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_17 --> -72($fp) - # LOCAL local_pal_at_Main_internal_18 --> -76($fp) - # local_pal_at_Main_internal_18 = VCALL local_pal_at_Main_internal_17 length + # LOCAL local_pal_at_Main_internal_21 --> -88($fp) + # LOCAL local_pal_at_Main_internal_22 --> -92($fp) + # local_pal_at_Main_internal_22 = VCALL local_pal_at_Main_internal_21 length # Save new self pointer in $s1 - lw $s1, -72($fp) + lw $s1, -88($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 20($t2) + lw $t5, 20($t4) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -76($fp) + jalr $t5 + sw $v0, -92($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_16 --> -68($fp) - # LOCAL local_pal_at_Main_internal_18 --> -76($fp) - # local_pal_at_Main_internal_16 = local_pal_at_Main_internal_18 - 1 - lw $t1, -76($fp) - sub $t1, $t1, 1 - sw $t1, -68($fp) - # ARG local_pal_at_Main_internal_16 - # LOCAL local_pal_at_Main_internal_16 --> -68($fp) - lw $t1, -68($fp) + # LOCAL local_pal_at_Main_internal_23 --> -96($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Int + sw $t3, 12($v0) + li $t3, 3 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Int_start + sw $t3, 4($v0) + # Load type offset + li $t3, 16 + sw $t3, 8($v0) + li $t3, 1 + sw $t3, 12($v0) + sw $v0, -96($fp) + # LOCAL local_pal_at_Main_internal_20 --> -84($fp) + # LOCAL local_pal_at_Main_internal_22 --> -92($fp) + # LOCAL local_pal_at_Main_internal_23 --> -96($fp) + # local_pal_at_Main_internal_20 = local_pal_at_Main_internal_22 - local_pal_at_Main_internal_23 + lw $t4, -92($fp) + lw $t3, 12($t4) + lw $t4, -96($fp) + lw $t5, 12($t4) + sub $t3, $t3, $t5 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Int + sw $t4, 12($v0) + li $t4, 3 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Int_start + sw $t4, 4($v0) + # Load type offset + li $t4, 16 + sw $t4, 8($v0) + sw $t3, 12($v0) + sw $v0, -84($fp) + # ARG local_pal_at_Main_internal_20 + # LOCAL local_pal_at_Main_internal_20 --> -84($fp) + lw $t3, -84($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # ARG 1 - li $t1, 1 + sw $t3, 0($sp) + # LOCAL local_pal_at_Main_internal_24 --> -100($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t3, String + sw $t3, 0($v0) + la $t3, String_start + sw $t3, 4($v0) + # Load type offset + li $t3, 8 + sw $t3, 8($v0) + la $t3, Int + sw $t3, 12($v0) + li $t3, 3 + sw $t3, 16($v0) + move $t3, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t3, 0($v0) + la $t3, Int_start + sw $t3, 4($v0) + # Load type offset + li $t3, 16 + sw $t3, 8($v0) + li $t3, 1 + sw $t3, 12($v0) + sw $v0, -100($fp) + # ARG local_pal_at_Main_internal_24 + # LOCAL local_pal_at_Main_internal_24 --> -100($fp) + lw $t3, -100($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_pal_at_Main_internal_14 --> -60($fp) - # LOCAL local_pal_at_Main_internal_15 --> -64($fp) - # local_pal_at_Main_internal_15 = VCALL local_pal_at_Main_internal_14 substr + sw $t3, 0($sp) + # LOCAL local_pal_at_Main_internal_18 --> -76($fp) + # LOCAL local_pal_at_Main_internal_19 --> -80($fp) + # local_pal_at_Main_internal_19 = VCALL local_pal_at_Main_internal_18 substr # Save new self pointer in $s1 - lw $s1, -60($fp) + lw $s1, -76($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t3, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t4, 0($t3) # Get pointer to function address - lw $t3, 16($t2) + lw $t5, 16($t4) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -64($fp) + jalr $t5 + sw $v0, -80($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_11 --> -48($fp) # LOCAL local_pal_at_Main_internal_13 --> -56($fp) # LOCAL local_pal_at_Main_internal_15 --> -64($fp) - # local_pal_at_Main_internal_11 = local_pal_at_Main_internal_13 - local_pal_at_Main_internal_15 - lw $t1, -56($fp) - lw $t2, -64($fp) - sub $t1, $t1, $t2 - sw $t1, -48($fp) - # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_11 - # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_11 - lw $t1, -48($fp) - beq $t1, 0, label_TRUE_11 - # LOCAL local_pal_at_Main_internal_11 --> -48($fp) - # local_pal_at_Main_internal_11 = 0 - li $t1, 0 - sw $t1, -48($fp) - # GOTO label_END_12 -j label_END_12 -label_TRUE_11: - # LOCAL local_pal_at_Main_internal_11 --> -48($fp) - # local_pal_at_Main_internal_11 = 1 - li $t1, 1 - sw $t1, -48($fp) - label_END_12: -# IF_ZERO local_pal_at_Main_internal_11 GOTO label_FALSEIF_9 -# IF_ZERO local_pal_at_Main_internal_11 GOTO label_FALSEIF_9 -lw $t1, -48($fp) -beq $t1, 0, label_FALSEIF_9 -# LOCAL local_pal_at_Main_internal_21 --> -88($fp) -# local_pal_at_Main_internal_21 = SELF -sw $s1, -88($fp) -# LOCAL local_pal_at_Main_internal_19 --> -80($fp) -# LOCAL local_pal_at_Main_internal_21 --> -88($fp) -# local_pal_at_Main_internal_19 = local_pal_at_Main_internal_21 -lw $t1, -88($fp) -sw $t1, -80($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_pal_at_Main_internal_22 --> -92($fp) -# PARAM param_pal_at_Main_s_0 --> 0($fp) -# local_pal_at_Main_internal_22 = PARAM param_pal_at_Main_s_0 -lw $t1, 0($fp) -sw $t1, -92($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG 1 -li $t1, 1 -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_pal_at_Main_internal_25 --> -104($fp) -# PARAM param_pal_at_Main_s_0 --> 0($fp) -# local_pal_at_Main_internal_25 = PARAM param_pal_at_Main_s_0 -lw $t1, 0($fp) -sw $t1, -104($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_pal_at_Main_internal_25 --> -104($fp) -# LOCAL local_pal_at_Main_internal_26 --> -108($fp) -# local_pal_at_Main_internal_26 = VCALL local_pal_at_Main_internal_25 length -# Save new self pointer in $s1 -lw $s1, -104($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 20($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -108($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_pal_at_Main_internal_24 --> -100($fp) -# LOCAL local_pal_at_Main_internal_26 --> -108($fp) -# local_pal_at_Main_internal_24 = local_pal_at_Main_internal_26 - 2 -lw $t1, -108($fp) -sub $t1, $t1, 2 -sw $t1, -100($fp) -# ARG local_pal_at_Main_internal_24 -# LOCAL local_pal_at_Main_internal_24 --> -100($fp) -lw $t1, -100($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_pal_at_Main_internal_22 --> -92($fp) -# LOCAL local_pal_at_Main_internal_23 --> -96($fp) -# local_pal_at_Main_internal_23 = VCALL local_pal_at_Main_internal_22 substr -# Save new self pointer in $s1 -lw $s1, -92($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 16($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -96($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_pal_at_Main_internal_23 -# LOCAL local_pal_at_Main_internal_23 --> -96($fp) -lw $t1, -96($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_pal_at_Main_internal_19 --> -80($fp) -# LOCAL local_pal_at_Main_internal_20 --> -84($fp) -# local_pal_at_Main_internal_20 = VCALL local_pal_at_Main_internal_19 pal -# Save new self pointer in $s1 -lw $s1, -80($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 28($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -84($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_pal_at_Main_internal_10 --> -44($fp) -# LOCAL local_pal_at_Main_internal_20 --> -84($fp) -# local_pal_at_Main_internal_10 = local_pal_at_Main_internal_20 -lw $t1, -84($fp) -sw $t1, -44($fp) -# GOTO label_ENDIF_10 -j label_ENDIF_10 -label_FALSEIF_9: + # LOCAL local_pal_at_Main_internal_19 --> -80($fp) + lw $t3, -64($fp) + # IF_ZERO local_pal_at_Main_internal_13 GOTO label_FALSEIF_5 + # IF_ZERO local_pal_at_Main_internal_13 GOTO label_FALSEIF_5 + lw $t4, -56($fp) + beq $t4, 0, label_FALSEIF_5 # LOCAL local_pal_at_Main_internal_27 --> -112($fp) - # local_pal_at_Main_internal_27 = 0 - li $t1, 0 - sw $t1, -112($fp) - # LOCAL local_pal_at_Main_internal_10 --> -44($fp) + # local_pal_at_Main_internal_27 = SELF + sw $s1, -112($fp) + # LOCAL local_pal_at_Main_internal_25 --> -104($fp) # LOCAL local_pal_at_Main_internal_27 --> -112($fp) - # local_pal_at_Main_internal_10 = local_pal_at_Main_internal_27 - lw $t1, -112($fp) - sw $t1, -44($fp) - label_ENDIF_10: -# LOCAL local_pal_at_Main_internal_5 --> -24($fp) -# LOCAL local_pal_at_Main_internal_10 --> -44($fp) -# local_pal_at_Main_internal_5 = local_pal_at_Main_internal_10 -lw $t1, -44($fp) -sw $t1, -24($fp) -label_ENDIF_6: + # local_pal_at_Main_internal_25 = local_pal_at_Main_internal_27 + lw $t4, -112($fp) + sw $t4, -104($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_28 --> -116($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_28 = PARAM param_pal_at_Main_s_0 + lw $t4, 0($fp) + sw $t4, -116($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_30 --> -124($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Int + sw $t4, 12($v0) + li $t4, 3 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Int_start + sw $t4, 4($v0) + # Load type offset + li $t4, 16 + sw $t4, 8($v0) + li $t4, 1 + sw $t4, 12($v0) + sw $v0, -124($fp) + # ARG local_pal_at_Main_internal_30 + # LOCAL local_pal_at_Main_internal_30 --> -124($fp) + lw $t4, -124($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + # LOCAL local_pal_at_Main_internal_32 --> -132($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_32 = PARAM param_pal_at_Main_s_0 + lw $t4, 0($fp) + sw $t4, -132($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_32 --> -132($fp) + # LOCAL local_pal_at_Main_internal_33 --> -136($fp) + # local_pal_at_Main_internal_33 = VCALL local_pal_at_Main_internal_32 length + # Save new self pointer in $s1 + lw $s1, -132($fp) + # Get pointer to type + lw $t4, 4($s1) + # Get pointer to type's VTABLE + lw $t5, 0($t4) + # Get pointer to function address + lw $t6, 20($t5) + # Call function. Result is on $v0 + jalr $t6 + sw $v0, -136($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Int + sw $t4, 12($v0) + li $t4, 3 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Int_start + sw $t4, 4($v0) + # Load type offset + li $t4, 16 + sw $t4, 8($v0) + li $t4, 2 + sw $t4, 12($v0) + sw $v0, -140($fp) + # LOCAL local_pal_at_Main_internal_31 --> -128($fp) + # LOCAL local_pal_at_Main_internal_33 --> -136($fp) + # LOCAL local_pal_at_Main_internal_34 --> -140($fp) + # local_pal_at_Main_internal_31 = local_pal_at_Main_internal_33 - local_pal_at_Main_internal_34 + lw $t5, -136($fp) + lw $t4, 12($t5) + lw $t5, -140($fp) + lw $t6, 12($t5) + sub $t4, $t4, $t6 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t5, String + sw $t5, 0($v0) + la $t5, String_start + sw $t5, 4($v0) + # Load type offset + li $t5, 8 + sw $t5, 8($v0) + la $t5, Int + sw $t5, 12($v0) + li $t5, 3 + sw $t5, 16($v0) + move $t5, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t5, 0($v0) + la $t5, Int_start + sw $t5, 4($v0) + # Load type offset + li $t5, 16 + sw $t5, 8($v0) + sw $t4, 12($v0) + sw $v0, -128($fp) + # ARG local_pal_at_Main_internal_31 + # LOCAL local_pal_at_Main_internal_31 --> -128($fp) + lw $t4, -128($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + # LOCAL local_pal_at_Main_internal_28 --> -116($fp) + # LOCAL local_pal_at_Main_internal_29 --> -120($fp) + # local_pal_at_Main_internal_29 = VCALL local_pal_at_Main_internal_28 substr + # Save new self pointer in $s1 + lw $s1, -116($fp) + # Get pointer to type + lw $t4, 4($s1) + # Get pointer to type's VTABLE + lw $t5, 0($t4) + # Get pointer to function address + lw $t6, 16($t5) + # Call function. Result is on $v0 + jalr $t6 + sw $v0, -120($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_pal_at_Main_internal_29 + # LOCAL local_pal_at_Main_internal_29 --> -120($fp) + lw $t4, -120($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t4, 0($sp) + # LOCAL local_pal_at_Main_internal_25 --> -104($fp) + # LOCAL local_pal_at_Main_internal_26 --> -108($fp) + # local_pal_at_Main_internal_26 = VCALL local_pal_at_Main_internal_25 pal + # Save new self pointer in $s1 + lw $s1, -104($fp) + # Get pointer to type + lw $t4, 4($s1) + # Get pointer to type's VTABLE + lw $t5, 0($t4) + # Get pointer to function address + lw $t6, 28($t5) + # Call function. Result is on $v0 + jalr $t6 + sw $v0, -108($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_12 --> -52($fp) + # LOCAL local_pal_at_Main_internal_26 --> -108($fp) + # local_pal_at_Main_internal_12 = local_pal_at_Main_internal_26 + lw $t4, -108($fp) + sw $t4, -52($fp) + # GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # LOCAL local_pal_at_Main_internal_35 --> -144($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Bool + sw $t4, 12($v0) + li $t4, 4 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Bool_start + sw $t4, 4($v0) + # Load type offset + li $t4, 12 + sw $t4, 8($v0) + li $t4, 0 + sw $t4, 12($v0) + sw $v0, -144($fp) + # LOCAL local_pal_at_Main_internal_12 --> -52($fp) + # LOCAL local_pal_at_Main_internal_35 --> -144($fp) + # local_pal_at_Main_internal_12 = local_pal_at_Main_internal_35 + lw $t4, -144($fp) + sw $t4, -52($fp) + label_ENDIF_6: +# LOCAL local_pal_at_Main_internal_6 --> -28($fp) +# LOCAL local_pal_at_Main_internal_12 --> -52($fp) +# local_pal_at_Main_internal_6 = local_pal_at_Main_internal_12 +lw $t4, -52($fp) +sw $t4, -28($fp) +label_ENDIF_4: # LOCAL local_pal_at_Main_internal_0 --> -4($fp) -# LOCAL local_pal_at_Main_internal_5 --> -24($fp) -# local_pal_at_Main_internal_0 = local_pal_at_Main_internal_5 -lw $t1, -24($fp) -sw $t1, -4($fp) +# LOCAL local_pal_at_Main_internal_6 --> -28($fp) +# local_pal_at_Main_internal_0 = local_pal_at_Main_internal_6 +lw $t4, -28($fp) +sw $t4, -4($fp) label_ENDIF_2: # RETURN local_pal_at_Main_internal_0 lw $v0, -4($fp) @@ -1030,7 +1452,7 @@ lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 120 +addu $sp, $sp, 152 # Deallocate function args addu $sp, $sp, 4 jr $ra @@ -1041,263 +1463,295 @@ jr $ra # @Params: function_main_at_Main: # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 88 + subu $sp, $sp, 92 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 88 + addu $fp, $sp, 92 + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) + # Load type offset + li $t4, 8 + sw $t4, 8($v0) + la $t4, Int + sw $t4, 12($v0) + li $t4, 3 + sw $t4, 16($v0) + move $t4, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t4, 0($v0) + la $t4, Int_start + sw $t4, 4($v0) + # Load type offset + li $t4, 16 + sw $t4, 8($v0) + li $t4, 1 + sw $t4, 12($v0) + sw $v0, -8($fp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) - li $t1, 1 - not $t1, $t1 - sw $t1, -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + lw $t4, -8($fp) + not $t4, $t4 + sw $t4, -4($fp) # # LOCAL local_main_at_Main_internal_0 --> -4($fp) - lw $t1, -4($fp) - sw $t1, 12($s1) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t1, -16($fp) - sw $t1, -8($fp) + lw $t4, -4($fp) + sw $t4, 12($s1) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 + lw $t4, -20($fp) + sw $t4, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_4 - sw $t1, 12($v0) - li $t1, 15 - sw $t1, 16($v0) - sw $v0, -20($fp) - # ARG local_main_at_Main_internal_4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - lw $t1, -20($fp) + li $t4, 8 + sw $t4, 8($v0) + la $t4, data_4 + sw $t4, 12($v0) + li $t4, 15 + sw $t4, 16($v0) + sw $v0, -24($fp) + # ARG local_main_at_Main_internal_5 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t4, -24($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) + sw $t4, 0($sp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 out_string + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string # Save new self pointer in $s1 - lw $s1, -8($fp) + lw $s1, -12($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t5, 0($t4) # Get pointer to function address - lw $t3, 12($t2) + lw $t6, 12($t5) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -12($fp) + jalr $t6 + sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = SELF - sw $s1, -36($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = SELF + sw $s1, -40($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 + lw $t4, -40($fp) + sw $t4, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 + lw $t4, -52($fp) + sw $t4, -44($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 in_string + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 in_string # Save new self pointer in $s1 - lw $s1, -40($fp) + lw $s1, -44($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t5, 0($t4) # Get pointer to function address - lw $t3, 20($t2) + lw $t6, 20($t5) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) + jalr $t6 + sw $v0, -48($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_10 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - lw $t1, -44($fp) + # ARG local_main_at_Main_internal_11 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + lw $t4, -48($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) + sw $t4, 0($sp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 pal + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 pal # Save new self pointer in $s1 - lw $s1, -28($fp) + lw $s1, -32($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t5, 0($t4) # Get pointer to function address - lw $t3, 28($t2) + lw $t6, 28($t5) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) + jalr $t6 + sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # IF_ZERO local_main_at_Main_internal_7 GOTO label_FALSEIF_13 - # IF_ZERO local_main_at_Main_internal_7 GOTO label_FALSEIF_13 - lw $t1, -32($fp) - beq $t1, 0, label_FALSEIF_13 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 - lw $t1, -60($fp) - sw $t1, -52($fp) + # IF_ZERO local_main_at_Main_internal_8 GOTO label_FALSEIF_7 + # IF_ZERO local_main_at_Main_internal_8 GOTO label_FALSEIF_7 + lw $t4, -36($fp) + beq $t4, 0, label_FALSEIF_7 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 + lw $t4, -64($fp) + sw $t4, -56($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_5 - sw $t1, 12($v0) - li $t1, 22 - sw $t1, 16($v0) - sw $v0, -64($fp) - # ARG local_main_at_Main_internal_15 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - lw $t1, -64($fp) + li $t4, 8 + sw $t4, 8($v0) + la $t4, data_5 + sw $t4, 12($v0) + li $t4, 22 + sw $t4, 16($v0) + sw $v0, -68($fp) + # ARG local_main_at_Main_internal_16 + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + lw $t4, -68($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) + sw $t4, 0($sp) # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 out_string # Save new self pointer in $s1 - lw $s1, -52($fp) + lw $s1, -56($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t5, 0($t4) # Get pointer to function address - lw $t3, 12($t2) + lw $t6, 12($t5) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -56($fp) + jalr $t6 + sw $v0, -60($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_5 = local_main_at_Main_internal_13 - lw $t1, -56($fp) - sw $t1, -24($fp) - # GOTO label_ENDIF_14 -j label_ENDIF_14 -label_FALSEIF_13: - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 - lw $t1, -76($fp) - sw $t1, -68($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_14 + lw $t4, -60($fp) + sw $t4, -28($fp) + # GOTO label_ENDIF_8 +j label_ENDIF_8 +label_FALSEIF_7: + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_19 = SELF + sw $s1, -80($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_17 = local_main_at_Main_internal_19 + lw $t4, -80($fp) + sw $t4, -72($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t4, String + sw $t4, 0($v0) + la $t4, String_start + sw $t4, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_6 - sw $t1, 12($v0) - li $t1, 26 - sw $t1, 16($v0) - sw $v0, -80($fp) - # ARG local_main_at_Main_internal_19 - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - lw $t1, -80($fp) + li $t4, 8 + sw $t4, 8($v0) + la $t4, data_6 + sw $t4, 12($v0) + li $t4, 26 + sw $t4, 16($v0) + sw $v0, -84($fp) + # ARG local_main_at_Main_internal_20 + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + lw $t4, -84($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) + sw $t4, 0($sp) # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_18 = VCALL local_main_at_Main_internal_17 out_string # Save new self pointer in $s1 - lw $s1, -68($fp) + lw $s1, -72($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t4, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t5, 0($t4) # Get pointer to function address - lw $t3, 12($t2) + lw $t6, 12($t5) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -72($fp) + jalr $t6 + sw $v0, -76($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_5 = local_main_at_Main_internal_17 - lw $t1, -72($fp) - sw $t1, -24($fp) - label_ENDIF_14: -# RETURN local_main_at_Main_internal_5 -lw $v0, -24($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_18 + lw $t4, -76($fp) + sw $t4, -28($fp) + label_ENDIF_8: +# RETURN local_main_at_Main_internal_6 +lw $v0, -28($fp) # Deallocate stack frame for function function_main_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 88 +addu $sp, $sp, 92 jr $ra # Function END diff --git a/tests/codegen/primes.mips b/tests/codegen/primes.mips index c9fe6191..0eb65a07 100644 --- a/tests/codegen/primes.mips +++ b/tests/codegen/primes.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:39 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:19 2020 # School of Math and Computer Science, University of Havana # @@ -13,6 +13,8 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END +Int: .asciiz "Int" +# Function END Main: .asciiz "Main" # Function END # @@ -74,6 +76,20 @@ Bool_end: # +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + # **** VTABLE for type Main **** Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main # Function END @@ -100,11 +116,12 @@ data_2: .asciiz "\n" # -IO__TDT: .word 0, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, 0 +IO__TDT: .word 0, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0 # @@ -202,7 +219,8 @@ function_out_int_at_IO: addu $fp, $sp, 32 # PRINT_INT param_out_int_at_IO_x_0 # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) li $v0, 1 syscall # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) @@ -268,6 +286,35 @@ function_in_int_at_IO: # local_in_int_at_IO_internal_0 = READ_INT li $v0, 5 syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) sw $v0, -4($fp) # RETURN local_in_int_at_IO_internal_0 lw $v0, -4($fp) @@ -365,7 +412,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -454,8 +501,10 @@ function_substr_at_String: # PARAM param_substr_at_String_r_1 --> 0($fp) lw $t0, 12($s1) lw $t2, 4($fp) + lw $t2, 12($t2) addu $t0, $t0, $t2 lw $a0, 0($fp) + lw $a0, 12($a0) move $t3, $a0 move $t1, $a0 addu $a0, $a0, 1 @@ -515,8 +564,40 @@ function_length_at_String: # LOCAL local_length_at_String_internal_0 --> -4($fp) lw $t0, 16($s1) sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function function_length_at_String. # Restore $ra lw $ra, 4($sp) @@ -543,28 +624,28 @@ entry: li $v0, 9 syscall # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 32 bytes of memory li $a0, 32 li $v0, 9 syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) # Load type offset - li $t2, 16 - sw $t2, 8($v0) + li $t0, 20 + sw $t0, 8($v0) move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 @@ -622,11 +703,11 @@ entry: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type's VTABLE - la $t1, Main_vtable + la $t0, Main_vtable # Get pointer to function address - lw $t2, 28($t1) + lw $t1, 28($t0) # Call function. Result is on $v0 - jalr $t2 + jalr $t1 sw $v0, -8($fp) # RETURN 0 li $v0, 0 @@ -649,60 +730,91 @@ __Main__attrib__out__init: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_ttrib__out__init_internal_2 --> -12($fp) - # local_ttrib__out__init_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_ttrib__out__init_internal_0 --> -4($fp) - # LOCAL local_ttrib__out__init_internal_2 --> -12($fp) - # local_ttrib__out__init_internal_0 = local_ttrib__out__init_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) + # LOCAL local_ttrib__out__init_internal_3 --> -16($fp) + # local_ttrib__out__init_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_ttrib__out__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__out__init_internal_3 --> -16($fp) + # local_ttrib__out__init_internal_1 = local_ttrib__out__init_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_ttrib__out__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__out__init_internal_4 --> -20($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_4 - sw $t1, 12($v0) - li $t1, 22 - sw $t1, 16($v0) - sw $v0, -16($fp) - # ARG local_ttrib__out__init_internal_3 - # LOCAL local_ttrib__out__init_internal_3 --> -16($fp) - lw $t1, -16($fp) + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 22 + sw $t0, 16($v0) + sw $v0, -20($fp) + # ARG local_ttrib__out__init_internal_4 + # LOCAL local_ttrib__out__init_internal_4 --> -20($fp) + lw $t0, -20($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_ttrib__out__init_internal_0 --> -4($fp) + sw $t0, 0($sp) # LOCAL local_ttrib__out__init_internal_1 --> -8($fp) - # local_ttrib__out__init_internal_1 = VCALL local_ttrib__out__init_internal_0 out_string + # LOCAL local_ttrib__out__init_internal_2 --> -12($fp) + # local_ttrib__out__init_internal_2 = VCALL local_ttrib__out__init_internal_1 out_string # Save new self pointer in $s1 - lw $s1, -4($fp) + lw $s1, -8($fp) # Get pointer to type - lw $t1, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t2, 0($t1) + lw $t0, 0($t0) # Get pointer to function address - lw $t3, 12($t2) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) + jalr $t0 + sw $v0, -12($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN 2 - li $v0, 2 + # LOCAL local_ttrib__out__init_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 2 + sw $t0, 12($v0) + sw $v0, -24($fp) + # RETURN local_ttrib__out__init_internal_5 + lw $v0, -24($fp) # Deallocate stack frame for function __Main__attrib__out__init. # Restore $ra lw $ra, 4($sp) @@ -722,12 +834,12 @@ __Main__attrib__testee__init: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_ttrib__testee__init_internal_0 = GETATTRIBUTE out Main - # LOCAL local_ttrib__testee__init_internal_0 --> -4($fp) - lw $t1, 12($s1) - sw $t1, -4($fp) - # RETURN local_ttrib__testee__init_internal_0 - lw $v0, -4($fp) + # local_ttrib__testee__init_internal_1 = GETATTRIBUTE out Main + # LOCAL local_ttrib__testee__init_internal_1 --> -8($fp) + lw $t0, 12($s1) + sw $t0, -8($fp) + # RETURN local_ttrib__testee__init_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function __Main__attrib__testee__init. # Restore $ra lw $ra, 4($sp) @@ -747,8 +859,39 @@ __Main__attrib__divisor__init: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 + # LOCAL local_ttrib__divisor__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__divisor__init_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function __Main__attrib__divisor__init. # Restore $ra lw $ra, 4($sp) @@ -768,8 +911,39 @@ __Main__attrib__stop__init: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN 500 - li $v0, 500 + # LOCAL local_ttrib__stop__init_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 500 + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_ttrib__stop__init_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function __Main__attrib__stop__init. # Restore $ra lw $ra, 4($sp) @@ -785,490 +959,1349 @@ __Main__attrib__stop__init: # @Params: __Main__attrib__m__init: # Allocate stack frame for function __Main__attrib__m__init. - subu $sp, $sp, 192 + subu $sp, $sp, 244 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 192 + addu $fp, $sp, 244 label_WHILE_1: - # LOCAL local_ttrib__m__init_internal_0 --> -4($fp) - # local_ttrib__m__init_internal_0 = 1 - li $t1, 1 - sw $t1, -4($fp) - # IF_ZERO local_ttrib__m__init_internal_0 GOTO label_WHILE_END_2 - # IF_ZERO local_ttrib__m__init_internal_0 GOTO label_WHILE_END_2 - lw $t1, -4($fp) - beq $t1, 0, label_WHILE_END_2 - # local_ttrib__m__init_internal_2 = GETATTRIBUTE testee Main # LOCAL local_ttrib__m__init_internal_2 --> -12($fp) - lw $t1, 16($s1) - sw $t1, -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) # LOCAL local_ttrib__m__init_internal_1 --> -8($fp) # LOCAL local_ttrib__m__init_internal_2 --> -12($fp) - # local_ttrib__m__init_internal_1 = local_ttrib__m__init_internal_2 + 1 - lw $t1, -12($fp) - add $t1, $t1, 1 - sw $t1, -8($fp) + # Obtain value from -12($fp) + lw $v0, -12($fp) + lw $v0, 12($v0) + sw $v0, -8($fp) + # IF_ZERO local_ttrib__m__init_internal_1 GOTO label_WHILE_END_2 + # IF_ZERO local_ttrib__m__init_internal_1 GOTO label_WHILE_END_2 + lw $t0, -8($fp) + beq $t0, 0, label_WHILE_END_2 + # local_ttrib__m__init_internal_4 = GETATTRIBUTE testee Main + # LOCAL local_ttrib__m__init_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # LOCAL local_ttrib__m__init_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -24($fp) + # LOCAL local_ttrib__m__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__m__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__m__init_internal_5 --> -24($fp) + # local_ttrib__m__init_internal_3 = local_ttrib__m__init_internal_4 + local_ttrib__m__init_internal_5 + lw $t1, -20($fp) + lw $t0, 12($t1) + lw $t1, -24($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -16($fp) # - # LOCAL local_ttrib__m__init_internal_1 --> -8($fp) - lw $t1, -8($fp) - sw $t1, 16($s1) + # LOCAL local_ttrib__m__init_internal_3 --> -16($fp) + lw $t0, -16($fp) + sw $t0, 16($s1) + # LOCAL local_ttrib__m__init_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 2 + sw $t0, 12($v0) + sw $v0, -28($fp) # - li $t1, 2 - sw $t1, 20($s1) + # LOCAL local_ttrib__m__init_internal_6 --> -28($fp) + lw $t0, -28($fp) + sw $t0, 20($s1) label_WHILE_3: - # local_ttrib__m__init_internal_5 = GETATTRIBUTE testee Main - # LOCAL local_ttrib__m__init_internal_5 --> -24($fp) - lw $t1, 16($s1) - sw $t1, -24($fp) - # local_ttrib__m__init_internal_7 = GETATTRIBUTE divisor Main - # LOCAL local_ttrib__m__init_internal_7 --> -32($fp) - lw $t1, 20($s1) - sw $t1, -32($fp) - # local_ttrib__m__init_internal_8 = GETATTRIBUTE divisor Main - # LOCAL local_ttrib__m__init_internal_8 --> -36($fp) - lw $t1, 20($s1) - sw $t1, -36($fp) - # LOCAL local_ttrib__m__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__m__init_internal_7 --> -32($fp) - # LOCAL local_ttrib__m__init_internal_8 --> -36($fp) - # local_ttrib__m__init_internal_6 = local_ttrib__m__init_internal_7 * local_ttrib__m__init_internal_8 - lw $t1, -32($fp) - lw $t2, -36($fp) - mul $t1, $t1, $t2 - sw $t1, -28($fp) - # LOCAL local_ttrib__m__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__m__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__m__init_internal_6 --> -28($fp) - # local_ttrib__m__init_internal_4 = local_ttrib__m__init_internal_5 - local_ttrib__m__init_internal_6 - lw $t1, -24($fp) - lw $t2, -28($fp) - sub $t1, $t1, $t2 - sw $t1, -20($fp) - # IF_GREATER_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSE_7 - # IF_GREATER_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSE_7 - lw $t1, -20($fp) - bgt $t1, 0, label_FALSE_7 - # IF_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSE_7 - # IF_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSE_7 - lw $t1, -20($fp) - beq $t1, 0, label_FALSE_7 - # LOCAL local_ttrib__m__init_internal_4 --> -20($fp) - # local_ttrib__m__init_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) + # local_ttrib__m__init_internal_11 = GETATTRIBUTE testee Main + # LOCAL local_ttrib__m__init_internal_11 --> -48($fp) + lw $t0, 16($s1) + sw $t0, -48($fp) + # local_ttrib__m__init_internal_13 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_13 --> -56($fp) + lw $t0, 20($s1) + sw $t0, -56($fp) + # local_ttrib__m__init_internal_14 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_14 --> -60($fp) + lw $t0, 20($s1) + sw $t0, -60($fp) + # LOCAL local_ttrib__m__init_internal_12 --> -52($fp) + # LOCAL local_ttrib__m__init_internal_13 --> -56($fp) + # LOCAL local_ttrib__m__init_internal_14 --> -60($fp) + # local_ttrib__m__init_internal_12 = local_ttrib__m__init_internal_13 * local_ttrib__m__init_internal_14 + lw $t1, -56($fp) + lw $t0, 12($t1) + lw $t1, -60($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -52($fp) + # LOCAL local_ttrib__m__init_internal_10 --> -44($fp) + # LOCAL local_ttrib__m__init_internal_11 --> -48($fp) + # LOCAL local_ttrib__m__init_internal_12 --> -52($fp) + lw $a0, -48($fp) + lw $a1, -52($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_GREATER_ZERO local_ttrib__m__init_internal_10 GOTO label_FALSE_7 + # IF_GREATER_ZERO local_ttrib__m__init_internal_10 GOTO label_FALSE_7 + lw $t0, -44($fp) + bgt $t0, 0, label_FALSE_7 + # IF_ZERO local_ttrib__m__init_internal_10 GOTO label_FALSE_7 + # IF_ZERO local_ttrib__m__init_internal_10 GOTO label_FALSE_7 + lw $t0, -44($fp) + beq $t0, 0, label_FALSE_7 + # LOCAL local_ttrib__m__init_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) # GOTO label_END_8 j label_END_8 label_FALSE_7: - # LOCAL local_ttrib__m__init_internal_4 --> -20($fp) - # local_ttrib__m__init_internal_4 = 0 - li $t1, 0 - sw $t1, -20($fp) + # LOCAL local_ttrib__m__init_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -44($fp) label_END_8: -# IF_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSEIF_5 -# IF_ZERO local_ttrib__m__init_internal_4 GOTO label_FALSEIF_5 -lw $t1, -20($fp) -beq $t1, 0, label_FALSEIF_5 -# LOCAL local_ttrib__m__init_internal_9 --> -40($fp) -# local_ttrib__m__init_internal_9 = 0 -li $t1, 0 -sw $t1, -40($fp) -# LOCAL local_ttrib__m__init_internal_3 --> -16($fp) +# LOCAL local_ttrib__m__init_internal_8 --> -36($fp) +# LOCAL local_ttrib__m__init_internal_10 --> -44($fp) +# Obtain value from -44($fp) +lw $v0, -44($fp) +lw $v0, 12($v0) +sw $v0, -36($fp) +# IF_ZERO local_ttrib__m__init_internal_8 GOTO label_FALSEIF_5 +# IF_ZERO local_ttrib__m__init_internal_8 GOTO label_FALSEIF_5 +lw $t0, -36($fp) +beq $t0, 0, label_FALSEIF_5 +# LOCAL local_ttrib__m__init_internal_15 --> -64($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -64($fp) # LOCAL local_ttrib__m__init_internal_9 --> -40($fp) -# local_ttrib__m__init_internal_3 = local_ttrib__m__init_internal_9 -lw $t1, -40($fp) -sw $t1, -16($fp) +# LOCAL local_ttrib__m__init_internal_15 --> -64($fp) +# local_ttrib__m__init_internal_9 = local_ttrib__m__init_internal_15 +lw $t0, -64($fp) +sw $t0, -40($fp) # GOTO label_ENDIF_6 j label_ENDIF_6 label_FALSEIF_5: - # local_ttrib__m__init_internal_13 = GETATTRIBUTE testee Main - # LOCAL local_ttrib__m__init_internal_13 --> -56($fp) - lw $t1, 16($s1) - sw $t1, -56($fp) - # local_ttrib__m__init_internal_15 = GETATTRIBUTE divisor Main - # LOCAL local_ttrib__m__init_internal_15 --> -64($fp) - lw $t1, 20($s1) - sw $t1, -64($fp) - # local_ttrib__m__init_internal_17 = GETATTRIBUTE testee Main - # LOCAL local_ttrib__m__init_internal_17 --> -72($fp) - lw $t1, 16($s1) - sw $t1, -72($fp) - # local_ttrib__m__init_internal_18 = GETATTRIBUTE divisor Main - # LOCAL local_ttrib__m__init_internal_18 --> -76($fp) - lw $t1, 20($s1) - sw $t1, -76($fp) - # LOCAL local_ttrib__m__init_internal_16 --> -68($fp) - # LOCAL local_ttrib__m__init_internal_17 --> -72($fp) - # LOCAL local_ttrib__m__init_internal_18 --> -76($fp) - # local_ttrib__m__init_internal_16 = local_ttrib__m__init_internal_17 / local_ttrib__m__init_internal_18 - lw $t1, -72($fp) - lw $t2, -76($fp) - div $t1, $t1, $t2 - sw $t1, -68($fp) - # LOCAL local_ttrib__m__init_internal_14 --> -60($fp) - # LOCAL local_ttrib__m__init_internal_15 --> -64($fp) - # LOCAL local_ttrib__m__init_internal_16 --> -68($fp) - # local_ttrib__m__init_internal_14 = local_ttrib__m__init_internal_15 * local_ttrib__m__init_internal_16 - lw $t1, -64($fp) - lw $t2, -68($fp) - mul $t1, $t1, $t2 - sw $t1, -60($fp) - # LOCAL local_ttrib__m__init_internal_12 --> -52($fp) - # LOCAL local_ttrib__m__init_internal_13 --> -56($fp) - # LOCAL local_ttrib__m__init_internal_14 --> -60($fp) - # local_ttrib__m__init_internal_12 = local_ttrib__m__init_internal_13 - local_ttrib__m__init_internal_14 - lw $t1, -56($fp) - lw $t2, -60($fp) - sub $t1, $t1, $t2 - sw $t1, -52($fp) - # LOCAL local_ttrib__m__init_internal_11 --> -48($fp) - # LOCAL local_ttrib__m__init_internal_12 --> -52($fp) - # local_ttrib__m__init_internal_11 = local_ttrib__m__init_internal_12 - 0 - lw $t1, -52($fp) - sub $t1, $t1, 0 - sw $t1, -48($fp) - # IF_ZERO local_ttrib__m__init_internal_11 GOTO label_TRUE_11 - # IF_ZERO local_ttrib__m__init_internal_11 GOTO label_TRUE_11 - lw $t1, -48($fp) - beq $t1, 0, label_TRUE_11 - # LOCAL local_ttrib__m__init_internal_11 --> -48($fp) - # local_ttrib__m__init_internal_11 = 0 - li $t1, 0 - sw $t1, -48($fp) - # GOTO label_END_12 -j label_END_12 -label_TRUE_11: - # LOCAL local_ttrib__m__init_internal_11 --> -48($fp) - # local_ttrib__m__init_internal_11 = 1 - li $t1, 1 - sw $t1, -48($fp) - label_END_12: -# IF_ZERO local_ttrib__m__init_internal_11 GOTO label_FALSEIF_9 -# IF_ZERO local_ttrib__m__init_internal_11 GOTO label_FALSEIF_9 -lw $t1, -48($fp) -beq $t1, 0, label_FALSEIF_9 -# LOCAL local_ttrib__m__init_internal_19 --> -80($fp) -# local_ttrib__m__init_internal_19 = 0 -li $t1, 0 -sw $t1, -80($fp) -# LOCAL local_ttrib__m__init_internal_10 --> -44($fp) -# LOCAL local_ttrib__m__init_internal_19 --> -80($fp) -# local_ttrib__m__init_internal_10 = local_ttrib__m__init_internal_19 -lw $t1, -80($fp) -sw $t1, -44($fp) -# GOTO label_ENDIF_10 -j label_ENDIF_10 -label_FALSEIF_9: - # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) - # local_ttrib__m__init_internal_20 = 1 - li $t1, 1 - sw $t1, -84($fp) - # LOCAL local_ttrib__m__init_internal_10 --> -44($fp) - # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) - # local_ttrib__m__init_internal_10 = local_ttrib__m__init_internal_20 - lw $t1, -84($fp) - sw $t1, -44($fp) - label_ENDIF_10: -# LOCAL local_ttrib__m__init_internal_3 --> -16($fp) -# LOCAL local_ttrib__m__init_internal_10 --> -44($fp) -# local_ttrib__m__init_internal_3 = local_ttrib__m__init_internal_10 -lw $t1, -44($fp) -sw $t1, -16($fp) -label_ENDIF_6: -# IF_ZERO local_ttrib__m__init_internal_3 GOTO label_WHILE_END_4 -# IF_ZERO local_ttrib__m__init_internal_3 GOTO label_WHILE_END_4 -lw $t1, -16($fp) -beq $t1, 0, label_WHILE_END_4 -# local_ttrib__m__init_internal_22 = GETATTRIBUTE divisor Main -# LOCAL local_ttrib__m__init_internal_22 --> -92($fp) -lw $t1, 20($s1) -sw $t1, -92($fp) -# LOCAL local_ttrib__m__init_internal_21 --> -88($fp) -# LOCAL local_ttrib__m__init_internal_22 --> -92($fp) -# local_ttrib__m__init_internal_21 = local_ttrib__m__init_internal_22 + 1 -lw $t1, -92($fp) -add $t1, $t1, 1 -sw $t1, -88($fp) -# -# LOCAL local_ttrib__m__init_internal_21 --> -88($fp) -lw $t1, -88($fp) -sw $t1, 20($s1) -# GOTO label_WHILE_3 -j label_WHILE_3 -label_WHILE_END_4: + # local_ttrib__m__init_internal_21 = GETATTRIBUTE testee Main + # LOCAL local_ttrib__m__init_internal_21 --> -88($fp) + lw $t0, 16($s1) + sw $t0, -88($fp) + # local_ttrib__m__init_internal_23 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_23 --> -96($fp) + lw $t0, 20($s1) + sw $t0, -96($fp) # local_ttrib__m__init_internal_25 = GETATTRIBUTE testee Main # LOCAL local_ttrib__m__init_internal_25 --> -104($fp) - lw $t1, 16($s1) - sw $t1, -104($fp) - # local_ttrib__m__init_internal_27 = GETATTRIBUTE divisor Main - # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) - lw $t1, 20($s1) - sw $t1, -112($fp) - # local_ttrib__m__init_internal_28 = GETATTRIBUTE divisor Main - # LOCAL local_ttrib__m__init_internal_28 --> -116($fp) - lw $t1, 20($s1) - sw $t1, -116($fp) + lw $t0, 16($s1) + sw $t0, -104($fp) + # local_ttrib__m__init_internal_26 = GETATTRIBUTE divisor Main # LOCAL local_ttrib__m__init_internal_26 --> -108($fp) - # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) - # LOCAL local_ttrib__m__init_internal_28 --> -116($fp) - # local_ttrib__m__init_internal_26 = local_ttrib__m__init_internal_27 * local_ttrib__m__init_internal_28 - lw $t1, -112($fp) - lw $t2, -116($fp) - mul $t1, $t1, $t2 - sw $t1, -108($fp) + lw $t0, 20($s1) + sw $t0, -108($fp) # LOCAL local_ttrib__m__init_internal_24 --> -100($fp) # LOCAL local_ttrib__m__init_internal_25 --> -104($fp) # LOCAL local_ttrib__m__init_internal_26 --> -108($fp) - # local_ttrib__m__init_internal_24 = local_ttrib__m__init_internal_25 - local_ttrib__m__init_internal_26 + # local_ttrib__m__init_internal_24 = local_ttrib__m__init_internal_25 / local_ttrib__m__init_internal_26 lw $t1, -104($fp) - lw $t2, -108($fp) - sub $t1, $t1, $t2 - sw $t1, -100($fp) - # IF_GREATER_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSE_15 - # IF_GREATER_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSE_15 - lw $t1, -100($fp) - bgt $t1, 0, label_FALSE_15 - # IF_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSE_15 - # IF_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSE_15 - lw $t1, -100($fp) - beq $t1, 0, label_FALSE_15 - # LOCAL local_ttrib__m__init_internal_24 --> -100($fp) - # local_ttrib__m__init_internal_24 = 1 - li $t1, 1 - sw $t1, -100($fp) - # GOTO label_END_16 -j label_END_16 -label_FALSE_15: - # LOCAL local_ttrib__m__init_internal_24 --> -100($fp) - # local_ttrib__m__init_internal_24 = 0 - li $t1, 0 - sw $t1, -100($fp) - label_END_16: -# IF_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSEIF_13 -# IF_ZERO local_ttrib__m__init_internal_24 GOTO label_FALSEIF_13 -lw $t1, -100($fp) -beq $t1, 0, label_FALSEIF_13 -# local_ttrib__m__init_internal_29 = GETATTRIBUTE testee Main -# LOCAL local_ttrib__m__init_internal_29 --> -120($fp) -lw $t1, 16($s1) -sw $t1, -120($fp) -# -# LOCAL local_ttrib__m__init_internal_29 --> -120($fp) -lw $t1, -120($fp) -sw $t1, 12($s1) -# LOCAL local_ttrib__m__init_internal_32 --> -132($fp) -# local_ttrib__m__init_internal_32 = SELF -sw $s1, -132($fp) -# LOCAL local_ttrib__m__init_internal_30 --> -124($fp) -# LOCAL local_ttrib__m__init_internal_32 --> -132($fp) -# local_ttrib__m__init_internal_30 = local_ttrib__m__init_internal_32 -lw $t1, -132($fp) -sw $t1, -124($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_ttrib__m__init_internal_33 = GETATTRIBUTE out Main -# LOCAL local_ttrib__m__init_internal_33 --> -136($fp) -lw $t1, 12($s1) -sw $t1, -136($fp) -# ARG local_ttrib__m__init_internal_33 -# LOCAL local_ttrib__m__init_internal_33 --> -136($fp) -lw $t1, -136($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) + lw $t0, 12($t1) + lw $t1, -108($fp) + lw $t2, 12($t1) + div $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -100($fp) + # LOCAL local_ttrib__m__init_internal_22 --> -92($fp) + # LOCAL local_ttrib__m__init_internal_23 --> -96($fp) + # LOCAL local_ttrib__m__init_internal_24 --> -100($fp) + # local_ttrib__m__init_internal_22 = local_ttrib__m__init_internal_23 * local_ttrib__m__init_internal_24 + lw $t1, -96($fp) + lw $t0, 12($t1) + lw $t1, -100($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -92($fp) + # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) + # LOCAL local_ttrib__m__init_internal_21 --> -88($fp) + # LOCAL local_ttrib__m__init_internal_22 --> -92($fp) + # local_ttrib__m__init_internal_20 = local_ttrib__m__init_internal_21 - local_ttrib__m__init_internal_22 + lw $t1, -88($fp) + lw $t0, 12($t1) + lw $t1, -92($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -84($fp) + # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -112($fp) + # IF_ZERO local_ttrib__m__init_internal_20 GOTO label_FALSE_11 + # IF_ZERO local_ttrib__m__init_internal_20 GOTO label_FALSE_11 + lw $t0, -84($fp) + beq $t0, 0, label_FALSE_11 + # IF_ZERO local_ttrib__m__init_internal_27 GOTO label_FALSE_11 + # IF_ZERO local_ttrib__m__init_internal_27 GOTO label_FALSE_11 + lw $t0, -112($fp) + beq $t0, 0, label_FALSE_11 + # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) + # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) + # Comparing -84($fp) type with String + la $v0, String + lw $a0, -84($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_COMPARE_STRING_14 + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_COMPARE_STRING_14 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_STRING_14 + # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) + # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) + # Comparing -84($fp) type with Bool + la $v0, Bool + lw $a0, -84($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_COMPARE_BY_VALUE_15 + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_COMPARE_BY_VALUE_15 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_15 + # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) + # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) + # Comparing -84($fp) type with Int + la $v0, Int + lw $a0, -84($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_COMPARE_BY_VALUE_15 + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_COMPARE_BY_VALUE_15 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_15 + # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) + # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) + # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) + # Load pointers and SUB + lw $a0, -84($fp) + lw $a1, -112($fp) + sub $a0, $a0, $a1 + sw $a0, -80($fp) + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_TRUE_12 + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_TRUE_12 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_12 + # GOTO label_FALSE_11 + j label_FALSE_11 + label_COMPARE_BY_VALUE_15: + # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) + # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) + # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) + lw $a0, -84($fp) + lw $a1, -112($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -80($fp) + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_TRUE_12 + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_TRUE_12 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_12 + # GOTO label_FALSE_11 + j label_FALSE_11 + label_COMPARE_STRING_14: + # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) + # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) + # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) + # Load strings for comparison + lw $v0, -84($fp) + lw $v1, -112($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -80($fp) + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_CONTINUE_16 + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_CONTINUE_16 + lw $t0, -80($fp) + beq $t0, 0, label_CONTINUE_16 + # GOTO label_FALSE_11 + j label_FALSE_11 + label_CONTINUE_16: + # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) + # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) + # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -84($fp) + lw $v1, -112($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_17: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_18 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_17 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_18: + # Store result + sw $a2, -80($fp) + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_TRUE_12 + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_TRUE_12 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_12 + label_FALSE_11: + # LOCAL local_ttrib__m__init_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -76($fp) + # GOTO label_END_13 +j label_END_13 +label_TRUE_12: + # LOCAL local_ttrib__m__init_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -76($fp) + label_END_13: +# LOCAL local_ttrib__m__init_internal_16 --> -68($fp) +# LOCAL local_ttrib__m__init_internal_18 --> -76($fp) +# Obtain value from -76($fp) +lw $v0, -76($fp) +lw $v0, 12($v0) +sw $v0, -68($fp) +# IF_ZERO local_ttrib__m__init_internal_16 GOTO label_FALSEIF_9 +# IF_ZERO local_ttrib__m__init_internal_16 GOTO label_FALSEIF_9 +lw $t0, -68($fp) +beq $t0, 0, label_FALSEIF_9 +# LOCAL local_ttrib__m__init_internal_28 --> -116($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -116($fp) +# LOCAL local_ttrib__m__init_internal_17 --> -72($fp) +# LOCAL local_ttrib__m__init_internal_28 --> -116($fp) +# local_ttrib__m__init_internal_17 = local_ttrib__m__init_internal_28 +lw $t0, -116($fp) +sw $t0, -72($fp) +# GOTO label_ENDIF_10 +j label_ENDIF_10 +label_FALSEIF_9: + # LOCAL local_ttrib__m__init_internal_29 --> -120($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -120($fp) + # LOCAL local_ttrib__m__init_internal_17 --> -72($fp) + # LOCAL local_ttrib__m__init_internal_29 --> -120($fp) + # local_ttrib__m__init_internal_17 = local_ttrib__m__init_internal_29 + lw $t0, -120($fp) + sw $t0, -72($fp) + label_ENDIF_10: +# LOCAL local_ttrib__m__init_internal_9 --> -40($fp) +# LOCAL local_ttrib__m__init_internal_17 --> -72($fp) +# local_ttrib__m__init_internal_9 = local_ttrib__m__init_internal_17 +lw $t0, -72($fp) +sw $t0, -40($fp) +label_ENDIF_6: +# LOCAL local_ttrib__m__init_internal_7 --> -32($fp) +# LOCAL local_ttrib__m__init_internal_9 --> -40($fp) +# Obtain value from -40($fp) +lw $v0, -40($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_ttrib__m__init_internal_7 GOTO label_WHILE_END_4 +# IF_ZERO local_ttrib__m__init_internal_7 GOTO label_WHILE_END_4 +lw $t0, -32($fp) +beq $t0, 0, label_WHILE_END_4 +# local_ttrib__m__init_internal_31 = GETATTRIBUTE divisor Main +# LOCAL local_ttrib__m__init_internal_31 --> -128($fp) +lw $t0, 20($s1) +sw $t0, -128($fp) +# LOCAL local_ttrib__m__init_internal_32 --> -132($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -132($fp) # LOCAL local_ttrib__m__init_internal_30 --> -124($fp) # LOCAL local_ttrib__m__init_internal_31 --> -128($fp) -# local_ttrib__m__init_internal_31 = VCALL local_ttrib__m__init_internal_30 out_int +# LOCAL local_ttrib__m__init_internal_32 --> -132($fp) +# local_ttrib__m__init_internal_30 = local_ttrib__m__init_internal_31 + local_ttrib__m__init_internal_32 +lw $t1, -128($fp) +lw $t0, 12($t1) +lw $t1, -132($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -124($fp) +# +# LOCAL local_ttrib__m__init_internal_30 --> -124($fp) +lw $t0, -124($fp) +sw $t0, 20($s1) +# GOTO label_WHILE_3 +j label_WHILE_3 +label_WHILE_END_4: + # local_ttrib__m__init_internal_36 = GETATTRIBUTE testee Main + # LOCAL local_ttrib__m__init_internal_36 --> -148($fp) + lw $t0, 16($s1) + sw $t0, -148($fp) + # local_ttrib__m__init_internal_38 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_38 --> -156($fp) + lw $t0, 20($s1) + sw $t0, -156($fp) + # local_ttrib__m__init_internal_39 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_39 --> -160($fp) + lw $t0, 20($s1) + sw $t0, -160($fp) + # LOCAL local_ttrib__m__init_internal_37 --> -152($fp) + # LOCAL local_ttrib__m__init_internal_38 --> -156($fp) + # LOCAL local_ttrib__m__init_internal_39 --> -160($fp) + # local_ttrib__m__init_internal_37 = local_ttrib__m__init_internal_38 * local_ttrib__m__init_internal_39 + lw $t1, -156($fp) + lw $t0, 12($t1) + lw $t1, -160($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -152($fp) + # LOCAL local_ttrib__m__init_internal_35 --> -144($fp) + # LOCAL local_ttrib__m__init_internal_36 --> -148($fp) + # LOCAL local_ttrib__m__init_internal_37 --> -152($fp) + lw $a0, -148($fp) + lw $a1, -152($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -144($fp) + # IF_GREATER_ZERO local_ttrib__m__init_internal_35 GOTO label_FALSE_21 + # IF_GREATER_ZERO local_ttrib__m__init_internal_35 GOTO label_FALSE_21 + lw $t0, -144($fp) + bgt $t0, 0, label_FALSE_21 + # IF_ZERO local_ttrib__m__init_internal_35 GOTO label_FALSE_21 + # IF_ZERO local_ttrib__m__init_internal_35 GOTO label_FALSE_21 + lw $t0, -144($fp) + beq $t0, 0, label_FALSE_21 + # LOCAL local_ttrib__m__init_internal_35 --> -144($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -144($fp) + # GOTO label_END_22 +j label_END_22 +label_FALSE_21: + # LOCAL local_ttrib__m__init_internal_35 --> -144($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -144($fp) + label_END_22: +# LOCAL local_ttrib__m__init_internal_33 --> -136($fp) +# LOCAL local_ttrib__m__init_internal_35 --> -144($fp) +# Obtain value from -144($fp) +lw $v0, -144($fp) +lw $v0, 12($v0) +sw $v0, -136($fp) +# IF_ZERO local_ttrib__m__init_internal_33 GOTO label_FALSEIF_19 +# IF_ZERO local_ttrib__m__init_internal_33 GOTO label_FALSEIF_19 +lw $t0, -136($fp) +beq $t0, 0, label_FALSEIF_19 +# local_ttrib__m__init_internal_40 = GETATTRIBUTE testee Main +# LOCAL local_ttrib__m__init_internal_40 --> -164($fp) +lw $t0, 16($s1) +sw $t0, -164($fp) +# +# LOCAL local_ttrib__m__init_internal_40 --> -164($fp) +lw $t0, -164($fp) +sw $t0, 12($s1) +# LOCAL local_ttrib__m__init_internal_43 --> -176($fp) +# local_ttrib__m__init_internal_43 = SELF +sw $s1, -176($fp) +# LOCAL local_ttrib__m__init_internal_41 --> -168($fp) +# LOCAL local_ttrib__m__init_internal_43 --> -176($fp) +# local_ttrib__m__init_internal_41 = local_ttrib__m__init_internal_43 +lw $t0, -176($fp) +sw $t0, -168($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_ttrib__m__init_internal_44 = GETATTRIBUTE out Main +# LOCAL local_ttrib__m__init_internal_44 --> -180($fp) +lw $t0, 12($s1) +sw $t0, -180($fp) +# ARG local_ttrib__m__init_internal_44 +# LOCAL local_ttrib__m__init_internal_44 --> -180($fp) +lw $t0, -180($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_ttrib__m__init_internal_41 --> -168($fp) +# LOCAL local_ttrib__m__init_internal_42 --> -172($fp) +# local_ttrib__m__init_internal_42 = VCALL local_ttrib__m__init_internal_41 out_int # Save new self pointer in $s1 -lw $s1, -124($fp) +lw $s1, -168($fp) # Get pointer to type -lw $t1, 4($s1) +lw $t0, 4($s1) # Get pointer to type's VTABLE -lw $t2, 0($t1) +lw $t0, 0($t0) # Get pointer to function address -lw $t3, 16($t2) +lw $t0, 16($t0) # Call function. Result is on $v0 -jalr $t3 -sw $v0, -128($fp) +jalr $t0 +sw $v0, -172($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_ttrib__m__init_internal_36 --> -148($fp) -# local_ttrib__m__init_internal_36 = SELF -sw $s1, -148($fp) -# LOCAL local_ttrib__m__init_internal_34 --> -140($fp) -# LOCAL local_ttrib__m__init_internal_36 --> -148($fp) -# local_ttrib__m__init_internal_34 = local_ttrib__m__init_internal_36 -lw $t1, -148($fp) -sw $t1, -140($fp) +# LOCAL local_ttrib__m__init_internal_47 --> -192($fp) +# local_ttrib__m__init_internal_47 = SELF +sw $s1, -192($fp) +# LOCAL local_ttrib__m__init_internal_45 --> -184($fp) +# LOCAL local_ttrib__m__init_internal_47 --> -192($fp) +# local_ttrib__m__init_internal_45 = local_ttrib__m__init_internal_47 +lw $t0, -192($fp) +sw $t0, -184($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_ttrib__m__init_internal_37 --> -152($fp) +# LOCAL local_ttrib__m__init_internal_48 --> -196($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) # Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_5 -sw $t1, 12($v0) -li $t1, 11 -sw $t1, 16($v0) -sw $v0, -152($fp) -# ARG local_ttrib__m__init_internal_37 -# LOCAL local_ttrib__m__init_internal_37 --> -152($fp) -lw $t1, -152($fp) +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_5 +sw $t0, 12($v0) +li $t0, 11 +sw $t0, 16($v0) +sw $v0, -196($fp) +# ARG local_ttrib__m__init_internal_48 +# LOCAL local_ttrib__m__init_internal_48 --> -196($fp) +lw $t0, -196($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_ttrib__m__init_internal_34 --> -140($fp) -# LOCAL local_ttrib__m__init_internal_35 --> -144($fp) -# local_ttrib__m__init_internal_35 = VCALL local_ttrib__m__init_internal_34 out_string +sw $t0, 0($sp) +# LOCAL local_ttrib__m__init_internal_45 --> -184($fp) +# LOCAL local_ttrib__m__init_internal_46 --> -188($fp) +# local_ttrib__m__init_internal_46 = VCALL local_ttrib__m__init_internal_45 out_string # Save new self pointer in $s1 -lw $s1, -140($fp) +lw $s1, -184($fp) # Get pointer to type -lw $t1, 4($s1) +lw $t0, 4($s1) # Get pointer to type's VTABLE -lw $t2, 0($t1) +lw $t0, 0($t0) # Get pointer to function address -lw $t3, 12($t2) +lw $t0, 12($t0) # Call function. Result is on $v0 -jalr $t3 -sw $v0, -144($fp) +jalr $t0 +sw $v0, -188($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_ttrib__m__init_internal_23 --> -96($fp) -# LOCAL local_ttrib__m__init_internal_35 --> -144($fp) -# local_ttrib__m__init_internal_23 = local_ttrib__m__init_internal_35 -lw $t1, -144($fp) -sw $t1, -96($fp) -# GOTO label_ENDIF_14 -j label_ENDIF_14 -label_FALSEIF_13: - # LOCAL local_ttrib__m__init_internal_23 --> -96($fp) - # local_ttrib__m__init_internal_23 = 0 - li $t1, 0 - sw $t1, -96($fp) - label_ENDIF_14: -# local_ttrib__m__init_internal_40 = GETATTRIBUTE stop Main -# LOCAL local_ttrib__m__init_internal_40 --> -164($fp) -lw $t1, 24($s1) -sw $t1, -164($fp) -# local_ttrib__m__init_internal_41 = GETATTRIBUTE testee Main -# LOCAL local_ttrib__m__init_internal_41 --> -168($fp) -lw $t1, 16($s1) -sw $t1, -168($fp) -# LOCAL local_ttrib__m__init_internal_39 --> -160($fp) -# LOCAL local_ttrib__m__init_internal_40 --> -164($fp) -# LOCAL local_ttrib__m__init_internal_41 --> -168($fp) -# local_ttrib__m__init_internal_39 = local_ttrib__m__init_internal_40 - local_ttrib__m__init_internal_41 -lw $t1, -164($fp) -lw $t2, -168($fp) -sub $t1, $t1, $t2 -sw $t1, -160($fp) -# IF_GREATER_ZERO local_ttrib__m__init_internal_39 GOTO label_FALSE_19 -# IF_GREATER_ZERO local_ttrib__m__init_internal_39 GOTO label_FALSE_19 -lw $t1, -160($fp) -bgt $t1, 0, label_FALSE_19 -# LOCAL local_ttrib__m__init_internal_39 --> -160($fp) -# local_ttrib__m__init_internal_39 = 1 -li $t1, 1 -sw $t1, -160($fp) -# GOTO label_END_20 -j label_END_20 -label_FALSE_19: - # LOCAL local_ttrib__m__init_internal_39 --> -160($fp) - # local_ttrib__m__init_internal_39 = 0 - li $t1, 0 - sw $t1, -160($fp) - label_END_20: -# IF_ZERO local_ttrib__m__init_internal_39 GOTO label_FALSEIF_17 -# IF_ZERO local_ttrib__m__init_internal_39 GOTO label_FALSEIF_17 -lw $t1, -160($fp) -beq $t1, 0, label_FALSEIF_17 -# LOCAL local_ttrib__m__init_internal_44 --> -180($fp) +# LOCAL local_ttrib__m__init_internal_34 --> -140($fp) +# LOCAL local_ttrib__m__init_internal_46 --> -188($fp) +# local_ttrib__m__init_internal_34 = local_ttrib__m__init_internal_46 +lw $t0, -188($fp) +sw $t0, -140($fp) +# GOTO label_ENDIF_20 +j label_ENDIF_20 +label_FALSEIF_19: + # LOCAL local_ttrib__m__init_internal_49 --> -200($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -200($fp) + # LOCAL local_ttrib__m__init_internal_34 --> -140($fp) + # LOCAL local_ttrib__m__init_internal_49 --> -200($fp) + # local_ttrib__m__init_internal_34 = local_ttrib__m__init_internal_49 + lw $t0, -200($fp) + sw $t0, -140($fp) + label_ENDIF_20: +# local_ttrib__m__init_internal_53 = GETATTRIBUTE stop Main +# LOCAL local_ttrib__m__init_internal_53 --> -216($fp) +lw $t0, 24($s1) +sw $t0, -216($fp) +# local_ttrib__m__init_internal_54 = GETATTRIBUTE testee Main +# LOCAL local_ttrib__m__init_internal_54 --> -220($fp) +lw $t0, 16($s1) +sw $t0, -220($fp) +# LOCAL local_ttrib__m__init_internal_52 --> -212($fp) +# LOCAL local_ttrib__m__init_internal_53 --> -216($fp) +# LOCAL local_ttrib__m__init_internal_54 --> -220($fp) +lw $a0, -216($fp) +lw $a1, -220($fp) +# Load values +lw $a0, 12($a0) +lw $a1, 12($a1) +# SUB and store +sub $a0, $a0, $a1 +sw $a0, -212($fp) +# IF_GREATER_ZERO local_ttrib__m__init_internal_52 GOTO label_FALSE_25 +# IF_GREATER_ZERO local_ttrib__m__init_internal_52 GOTO label_FALSE_25 +lw $t0, -212($fp) +bgt $t0, 0, label_FALSE_25 +# LOCAL local_ttrib__m__init_internal_52 --> -212($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -212($fp) +# GOTO label_END_26 +j label_END_26 +label_FALSE_25: + # LOCAL local_ttrib__m__init_internal_52 --> -212($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -212($fp) + label_END_26: +# LOCAL local_ttrib__m__init_internal_50 --> -204($fp) +# LOCAL local_ttrib__m__init_internal_52 --> -212($fp) +# Obtain value from -212($fp) +lw $v0, -212($fp) +lw $v0, 12($v0) +sw $v0, -204($fp) +# IF_ZERO local_ttrib__m__init_internal_50 GOTO label_FALSEIF_23 +# IF_ZERO local_ttrib__m__init_internal_50 GOTO label_FALSEIF_23 +lw $t0, -204($fp) +beq $t0, 0, label_FALSEIF_23 +# LOCAL local_ttrib__m__init_internal_57 --> -232($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) # Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_6 -sw $t1, 12($v0) -li $t1, 4 -sw $t1, 16($v0) -sw $v0, -180($fp) -# LOCAL local_ttrib__m__init_internal_42 --> -172($fp) -# LOCAL local_ttrib__m__init_internal_44 --> -180($fp) -# local_ttrib__m__init_internal_42 = local_ttrib__m__init_internal_44 -lw $t1, -180($fp) -sw $t1, -172($fp) +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_6 +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +sw $v0, -232($fp) +# LOCAL local_ttrib__m__init_internal_55 --> -224($fp) +# LOCAL local_ttrib__m__init_internal_57 --> -232($fp) +# local_ttrib__m__init_internal_55 = local_ttrib__m__init_internal_57 +lw $t0, -232($fp) +sw $t0, -224($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_ttrib__m__init_internal_42 --> -172($fp) -# LOCAL local_ttrib__m__init_internal_43 --> -176($fp) -# local_ttrib__m__init_internal_43 = VCALL local_ttrib__m__init_internal_42 abort +# LOCAL local_ttrib__m__init_internal_55 --> -224($fp) +# LOCAL local_ttrib__m__init_internal_56 --> -228($fp) +# local_ttrib__m__init_internal_56 = VCALL local_ttrib__m__init_internal_55 abort # Save new self pointer in $s1 -lw $s1, -172($fp) +lw $s1, -224($fp) # Get pointer to type -lw $t1, 4($s1) +lw $t0, 4($s1) # Get pointer to type's VTABLE -lw $t2, 0($t1) +lw $t0, 0($t0) # Get pointer to function address -lw $t3, 0($t2) +lw $t0, 0($t0) # Call function. Result is on $v0 -jalr $t3 -sw $v0, -176($fp) +jalr $t0 +sw $v0, -228($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_ttrib__m__init_internal_38 --> -156($fp) -# LOCAL local_ttrib__m__init_internal_43 --> -176($fp) -# local_ttrib__m__init_internal_38 = local_ttrib__m__init_internal_43 -lw $t1, -176($fp) -sw $t1, -156($fp) -# GOTO label_ENDIF_18 -j label_ENDIF_18 -label_FALSEIF_17: - # LOCAL local_ttrib__m__init_internal_45 --> -184($fp) +# LOCAL local_ttrib__m__init_internal_51 --> -208($fp) +# LOCAL local_ttrib__m__init_internal_56 --> -228($fp) +# local_ttrib__m__init_internal_51 = local_ttrib__m__init_internal_56 +lw $t0, -228($fp) +sw $t0, -208($fp) +# GOTO label_ENDIF_24 +j label_ENDIF_24 +label_FALSEIF_23: + # LOCAL local_ttrib__m__init_internal_58 --> -236($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_7 - sw $t1, 12($v0) - li $t1, 8 - sw $t1, 16($v0) - sw $v0, -184($fp) - # LOCAL local_ttrib__m__init_internal_38 --> -156($fp) - # LOCAL local_ttrib__m__init_internal_45 --> -184($fp) - # local_ttrib__m__init_internal_38 = local_ttrib__m__init_internal_45 - lw $t1, -184($fp) - sw $t1, -156($fp) - label_ENDIF_18: + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_7 + sw $t0, 12($v0) + li $t0, 8 + sw $t0, 16($v0) + sw $v0, -236($fp) + # LOCAL local_ttrib__m__init_internal_51 --> -208($fp) + # LOCAL local_ttrib__m__init_internal_58 --> -236($fp) + # local_ttrib__m__init_internal_51 = local_ttrib__m__init_internal_58 + lw $t0, -236($fp) + sw $t0, -208($fp) + label_ENDIF_24: # GOTO label_WHILE_1 j label_WHILE_1 label_WHILE_END_2: @@ -1279,7 +2312,7 @@ label_WHILE_END_2: # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 192 + addu $sp, $sp, 244 jr $ra # Function END @@ -1292,8 +2325,39 @@ function_main_at_Main: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_main_at_Main_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function function_main_at_Main. # Restore $ra lw $ra, 4($sp) diff --git a/tests/codegen/print-cool.mips b/tests/codegen/print-cool.mips index dbf7c97e..385e14a4 100644 --- a/tests/codegen/print-cool.mips +++ b/tests/codegen/print-cool.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:40 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:20 2020 # School of Math and Computer Science, University of Havana # @@ -13,6 +13,8 @@ String: .asciiz "String" # Function END Bool: .asciiz "Bool" # Function END +Int: .asciiz "Int" +# Function END Main: .asciiz "Main" # Function END # @@ -74,6 +76,20 @@ Bool_end: # +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + # **** VTABLE for type Main **** Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main # Function END @@ -100,11 +116,12 @@ data_2: .asciiz "\n" # -IO__TDT: .word 0, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, 0 +IO__TDT: .word 0, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0 # @@ -190,7 +207,8 @@ function_out_int_at_IO: addu $fp, $sp, 32 # PRINT_INT param_out_int_at_IO_x_0 # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) li $v0, 1 syscall # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) @@ -256,6 +274,35 @@ function_in_int_at_IO: # local_in_int_at_IO_internal_0 = READ_INT li $v0, 5 syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) sw $v0, -4($fp) # RETURN local_in_int_at_IO_internal_0 lw $v0, -4($fp) @@ -353,7 +400,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -442,8 +489,10 @@ function_substr_at_String: # PARAM param_substr_at_String_r_1 --> 0($fp) lw $t0, 12($s1) lw $t2, 4($fp) + lw $t2, 12($t2) addu $t0, $t0, $t2 lw $a0, 0($fp) + lw $a0, 12($a0) move $t3, $a0 move $t1, $a0 addu $a0, $a0, 1 @@ -503,8 +552,40 @@ function_length_at_String: # LOCAL local_length_at_String_internal_0 --> -4($fp) lw $t0, 16($s1) sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) # Deallocate stack frame for function function_length_at_String. # Restore $ra lw $ra, 4($sp) @@ -531,28 +612,28 @@ entry: li $v0, 9 syscall # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) # Load type offset - li $t2, 16 - sw $t2, 8($v0) + li $t0, 20 + sw $t0, 8($v0) move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 @@ -570,11 +651,11 @@ entry: # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type's VTABLE - la $t1, Main_vtable + la $t0, Main_vtable # Get pointer to function address - lw $t2, 28($t1) + lw $t1, 28($t0) # Call function. Result is on $v0 - jalr $t2 + jalr $t1 sw $v0, -8($fp) # RETURN 0 li $v0, 0 @@ -593,18 +674,18 @@ entry: # @Params: function_main_at_Main: # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 88 + subu $sp, $sp, 104 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 88 + addu $fp, $sp, 104 # LOCAL local_main_at_Main_internal_4 --> -20($fp) # local_main_at_Main_internal_4 = SELF sw $s1, -20($fp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # LOCAL local_main_at_Main_internal_4 --> -20($fp) # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 - lw $t1, -20($fp) - sw $t1, -12($fp) + lw $t0, -20($fp) + sw $t0, -12($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -615,29 +696,29 @@ function_main_at_Main: li $v0, 9 syscall # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Object - sw $t3, 12($v0) - li $t3, 6 - sw $t3, 16($v0) - move $t3, $v0 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Object + sw $t0, 12($v0) + li $t0, 6 + sw $t0, 16($v0) + move $t0, $v0 # Allocating 12 bytes of memory li $a0, 12 li $v0, 9 syscall - sw $t3, 0($v0) - la $t3, Object_start - sw $t3, 4($v0) + sw $t0, 0($v0) + la $t0, Object_start + sw $t0, 4($v0) # Load type offset - li $t3, 4 - sw $t3, 8($v0) - move $t2, $v0 + li $t0, 4 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -645,12 +726,12 @@ function_main_at_Main: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t2, -40($fp) + sw $t1, -40($fp) # LOCAL local_main_at_Main_internal_7 --> -32($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t2, -40($fp) - sw $t2, -32($fp) + lw $t0, -40($fp) + sw $t0, -32($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) @@ -660,13 +741,13 @@ function_main_at_Main: # Save new self pointer in $s1 lw $s1, -32($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t0, 0($t0) # Get pointer to function address - lw $t4, 4($t3) + lw $t0, 4($t0) # Call function. Result is on $v0 - jalr $t4 + jalr $t0 sw $v0, -36($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -674,57 +755,121 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_5 --> -24($fp) # LOCAL local_main_at_Main_internal_8 --> -36($fp) # local_main_at_Main_internal_5 = local_main_at_Main_internal_8 - lw $t2, -36($fp) - sw $t2, -24($fp) + lw $t0, -36($fp) + sw $t0, -24($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # ARG 4 - li $t2, 4 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 4 + sw $t0, 12($v0) + sw $v0, -44($fp) + # ARG local_main_at_Main_internal_10 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + lw $t0, -44($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) - # ARG 1 - li $t2, 1 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -48($fp) + # ARG local_main_at_Main_internal_11 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + lw $t0, -48($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_5 --> -24($fp) # LOCAL local_main_at_Main_internal_6 --> -28($fp) # local_main_at_Main_internal_6 = VCALL local_main_at_Main_internal_5 substr # Save new self pointer in $s1 lw $s1, -24($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t0, 0($t0) # Get pointer to function address - lw $t4, 16($t3) + lw $t0, 16($t0) # Call function. Result is on $v0 - jalr $t4 + jalr $t0 sw $v0, -28($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # ARG local_main_at_Main_internal_6 # LOCAL local_main_at_Main_internal_6 --> -28($fp) - lw $t2, -28($fp) + lw $t0, -28($fp) # Push arg into stack subu $sp, $sp, 4 - sw $t2, 0($sp) + sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_2 --> -12($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string # Save new self pointer in $s1 lw $s1, -12($fp) # Get pointer to type - lw $t2, 4($s1) + lw $t0, 4($s1) # Get pointer to type's VTABLE - lw $t3, 0($t2) + lw $t0, 0($t0) # Get pointer to function address - lw $t4, 12($t3) + lw $t0, 12($t0) # Call function. Result is on $v0 - jalr $t4 + jalr $t0 sw $v0, -16($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) @@ -732,222 +877,292 @@ function_main_at_Main: # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 - lw $t2, -16($fp) - sw $t2, -4($fp) + lw $t0, -16($fp) + sw $t0, -4($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = SELF - sw $s1, -64($fp) - # IF_ZERO local_main_at_Main_internal_15 GOTO label_TRUE_1 - # IF_ZERO local_main_at_Main_internal_15 GOTO label_TRUE_1 - lw $t2, -64($fp) - beq $t2, 0, label_TRUE_1 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = SELF + sw $s1, -72($fp) + # IF_ZERO local_main_at_Main_internal_17 GOTO label_TRUE_1 + # IF_ZERO local_main_at_Main_internal_17 GOTO label_TRUE_1 + lw $t0, -72($fp) + beq $t0, 0, label_TRUE_1 + # LOCAL local_main_at_Main_internal_16 --> -68($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string for type Bool - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Bool - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 12 bytes of memory - li $a0, 12 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 li $v0, 9 syscall - sw $t2, 0($v0) - la $t2, Bool_start - sw $t2, 4($v0) - li $t2, 0 - sw $t2, 8($v0) - sw $v0, -60($fp) + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -68($fp) # GOTO label_END_2 j label_END_2 label_TRUE_1: - # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string for type Bool - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Bool - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 12 bytes of memory - li $a0, 12 + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 li $v0, 9 syscall - sw $t2, 0($v0) - la $t2, Bool_start - sw $t2, 4($v0) - li $t2, 1 - sw $t2, 8($v0) - sw $v0, -60($fp) + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -68($fp) label_END_2: -# LOCAL local_main_at_Main_internal_12 --> -52($fp) # LOCAL local_main_at_Main_internal_14 --> -60($fp) -# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 -lw $t2, -60($fp) -sw $t2, -52($fp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# local_main_at_Main_internal_14 = local_main_at_Main_internal_16 +lw $t0, -68($fp) +sw $t0, -60($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 type_name +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 type_name # Save new self pointer in $s1 -lw $s1, -52($fp) +lw $s1, -60($fp) # Get pointer to type -lw $t2, 4($s1) +lw $t0, 4($s1) # Get pointer to type's VTABLE -lw $t3, 0($t2) +lw $t0, 0($t0) # Get pointer to function address -lw $t4, 4($t3) +lw $t0, 4($t0) # Call function. Result is on $v0 -jalr $t4 -sw $v0, -56($fp) +jalr $t0 +sw $v0, -64($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_10 --> -44($fp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# local_main_at_Main_internal_10 = local_main_at_Main_internal_13 -lw $t2, -56($fp) -sw $t2, -44($fp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# local_main_at_Main_internal_12 = local_main_at_Main_internal_15 +lw $t0, -64($fp) +sw $t0, -52($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# ARG 1 -li $t2, 1 +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -76($fp) +# ARG local_main_at_Main_internal_18 +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +lw $t0, -76($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t2, 0($sp) -# ARG 3 -li $t2, 3 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 3 +sw $t0, 12($v0) +sw $v0, -80($fp) +# ARG local_main_at_Main_internal_19 +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +lw $t0, -80($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t2, 0($sp) -# LOCAL local_main_at_Main_internal_10 --> -44($fp) -# LOCAL local_main_at_Main_internal_11 --> -48($fp) -# local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 substr +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 substr # Save new self pointer in $s1 -lw $s1, -44($fp) +lw $s1, -52($fp) # Get pointer to type -lw $t2, 4($s1) +lw $t0, 4($s1) # Get pointer to type's VTABLE -lw $t3, 0($t2) +lw $t0, 0($t0) # Get pointer to function address -lw $t4, 16($t3) +lw $t0, 16($t0) # Call function. Result is on $v0 -jalr $t4 -sw $v0, -48($fp) +jalr $t0 +sw $v0, -56($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_11 -# LOCAL local_main_at_Main_internal_11 --> -48($fp) -lw $t2, -48($fp) +# ARG local_main_at_Main_internal_13 +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +lw $t0, -56($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t2, 0($sp) +sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string # Save new self pointer in $s1 lw $s1, -4($fp) # Get pointer to type -lw $t2, 4($s1) +lw $t0, 4($s1) # Get pointer to type's VTABLE -lw $t3, 0($t2) +lw $t0, 0($t0) # Get pointer to function address -lw $t4, 12($t3) +lw $t0, 12($t0) # Call function. Result is on $v0 -jalr $t4 +jalr $t0 sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# local_main_at_Main_internal_18 = SELF -sw $s1, -76($fp) -# LOCAL local_main_at_Main_internal_16 --> -68($fp) -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# local_main_at_Main_internal_16 = local_main_at_Main_internal_18 -lw $t2, -76($fp) -sw $t2, -68($fp) +# LOCAL local_main_at_Main_internal_22 --> -92($fp) +# local_main_at_Main_internal_22 = SELF +sw $s1, -92($fp) +# LOCAL local_main_at_Main_internal_20 --> -84($fp) +# LOCAL local_main_at_Main_internal_22 --> -92($fp) +# local_main_at_Main_internal_20 = local_main_at_Main_internal_22 +lw $t0, -92($fp) +sw $t0, -84($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# LOCAL local_main_at_Main_internal_23 --> -96($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall # Allocating string -la $t2, String -sw $t2, 0($v0) -la $t2, String_start -sw $t2, 4($v0) +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) # Load type offset -li $t2, 8 -sw $t2, 8($v0) -la $t2, data_4 -sw $t2, 12($v0) -li $t2, 1 -sw $t2, 16($v0) -sw $v0, -80($fp) -# ARG local_main_at_Main_internal_19 -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -lw $t2, -80($fp) +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_4 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -96($fp) +# ARG local_main_at_Main_internal_23 +# LOCAL local_main_at_Main_internal_23 --> -96($fp) +lw $t0, -96($fp) # Push arg into stack subu $sp, $sp, 4 -sw $t2, 0($sp) -# LOCAL local_main_at_Main_internal_16 --> -68($fp) -# LOCAL local_main_at_Main_internal_17 --> -72($fp) -# local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_20 --> -84($fp) +# LOCAL local_main_at_Main_internal_21 --> -88($fp) +# local_main_at_Main_internal_21 = VCALL local_main_at_Main_internal_20 out_string # Save new self pointer in $s1 -lw $s1, -68($fp) +lw $s1, -84($fp) # Get pointer to type -lw $t2, 4($s1) +lw $t0, 4($s1) # Get pointer to type's VTABLE -lw $t3, 0($t2) +lw $t0, 0($t0) # Get pointer to function address -lw $t4, 12($t3) +lw $t0, 12($t0) # Call function. Result is on $v0 -jalr $t4 -sw $v0, -72($fp) +jalr $t0 +sw $v0, -88($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# RETURN local_main_at_Main_internal_17 -lw $v0, -72($fp) +# RETURN local_main_at_Main_internal_21 +lw $v0, -88($fp) # Deallocate stack frame for function function_main_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 88 +addu $sp, $sp, 104 jr $ra # Function END From 13661f4a7d15e26d2898d7e586034ac7f0815a0c Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Mon, 7 Dec 2020 21:31:19 -0500 Subject: [PATCH 155/162] Just need to fix a bug in VTABLE --- src/.builds | 1 + src/comments.py | 64 +- src/coolgrammar/grammar.py | 28 +- src/testing.mips | 526 +- src/testing.py | 31 +- src/travels/ctcill.py | 9 +- tests/codegen/arith.mips | 3845 +++++++------- tests/codegen/atoi.mips | 3559 ------------- tests/codegen/book_list.mips | 188 +- tests/codegen/cells.mips | 2997 ----------- tests/codegen/complex.mips | 60 +- tests/codegen/fib.mips | 4 +- tests/codegen/graph.mips | 116 +- tests/codegen/hairyscary.mips | 40 +- tests/codegen/hello_world.mips | 4 +- tests/codegen/io.mips | 4 +- tests/codegen/life.mips | 8661 -------------------------------- tests/codegen/list.mips | 4 +- tests/codegen/new_complex.mips | 60 +- tests/codegen/palindrome.mips | 1757 ------- tests/codegen/primes.mips | 4 +- tests/codegen/print-cool.mips | 4 +- 22 files changed, 2389 insertions(+), 19577 deletions(-) delete mode 100644 tests/codegen/atoi.mips delete mode 100644 tests/codegen/cells.mips delete mode 100644 tests/codegen/life.mips delete mode 100644 tests/codegen/palindrome.mips diff --git a/src/.builds b/src/.builds index 0765be88..09604598 100644 --- a/src/.builds +++ b/src/.builds @@ -211,3 +211,4 @@ 1 1 1 +1 diff --git a/src/comments.py b/src/comments.py index fab2c85c..40f9c7a6 100644 --- a/src/comments.py +++ b/src/comments.py @@ -52,43 +52,33 @@ def find_comments(program: Any) -> str: except StopIteration: break assert not stack, "(%d, %d) - LexicographicError: EOF in comment" % (line, column) - iter_char = iter(enumerate(program)) - column = 1 - line = 1 - while 1: - try: - i, char = next(iter_char) - column += 1 - if char == "-" and i > 0 and program[i - 1] != "<": - i, char = next(iter_char) - column += 1 - if char == "-": - stack.append(i - 1) - elif char == "\n": - if stack: - first = stack.pop() - pairs.append((first, i)) - column = 1 - line += 1 - elif char == '-' and i == 0: - i, char = next(iter_char) - column += 1 - if char == "-": - stack.append(i - 1) - elif char == "\n": - if stack: - first = stack.pop() - pairs.append((first, i)) - column = 1 - line += 1 - elif char == "\n": - if stack: - first = stack.pop() - pairs.append((first, i)) - column = 1 - line += 1 - except StopIteration: - break + + i = 0 + while i < len(program): + c = program[i] + if c =='-' and i > 0 and program[i - 1] != '<': + i += 1 + c = program[i] + if c == "-": + eol = "".join(program).find("\n", i) + for j in range(i - 1, eol): + program[j] = " " + i = eol + else: + i += 1 + elif c =='-' and i == 0: + i += 1 + c = program[i] + if c == "-": + eol = "".join(program).find("\n", i) + for j in range(i - 1, eol): + program[j] = " " + i = eol + else: + i += 1 + else: + i += 1 + while pairs: i, j = pairs.pop() for k in range(i, j + 1): diff --git a/src/coolgrammar/grammar.py b/src/coolgrammar/grammar.py index c83d0968..8dce1035 100755 --- a/src/coolgrammar/grammar.py +++ b/src/coolgrammar/grammar.py @@ -181,7 +181,13 @@ def build_cool_grammar(): nested_lets %= ( idx + dd + typex + coma + nested_lets, lambda s: [ - (s[1].lex, s[3].lex, None, s[3].token_line, s[3].token_column - len(s[3].lex)) + ( + s[1].lex, + s[3].lex, + None, + s[3].token_line, + s[3].token_column - len(s[3].lex), + ) ] + s[5], ) @@ -193,7 +199,13 @@ def build_cool_grammar(): nested_lets %= ( idx + dd + typex + assign + exp + coma + nested_lets, lambda s: [ - (s[1].lex, s[3].lex, s[5], s[3].token_line, s[3].token_column - len(s[3].lex)) + ( + s[1].lex, + s[3].lex, + s[5], + s[3].token_line, + s[3].token_column - len(s[3].lex), + ) ] + s[7], ) @@ -260,11 +272,17 @@ def build_cool_grammar(): ) term %= term + star + not_ + factor, lambda s: MulNode( - s[1], s[4], s[2].token_line, s[2].token_column - 1 + s[1], + NotNode(s[4], s[3].token_line, s[3].token_column), + s[2].token_line, + s[2].token_column - 1, ) - term %= term + div + not_ + factor, lambda s: DivNode( - s[1], s[4], s[2].token_line, s[2].token_column - 1 + term %= term + div + not_ + factor, lambda s: DivNode( + s[1], + NotNode(s[4], s[3].token_line, s[3].token_column), + s[2].token_line, + s[2].token_column - 1, ) term %= factor, lambda s: s[1] diff --git a/src/testing.mips b/src/testing.mips index 659fdf33..3a27dc3b 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:20:35 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 20:53:36 2020 # School of Math and Computer Science, University of Havana # @@ -350,7 +350,7 @@ data_21: .asciiz "" # -data_22: .asciiz "\n" +data_22: .asciiz "Success in init\n" # @@ -358,15 +358,23 @@ data_23: .asciiz "\n" # -data_24: .asciiz " (" +data_24: .asciiz "\n" # -data_25: .asciiz "," +data_25: .asciiz " (" # -data_26: .asciiz ")" +data_26: .asciiz "," +# + + +data_27: .asciiz ")" +# + + +data_28: .asciiz "initializing Vertice\n" # @@ -641,7 +649,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -899,7 +907,7 @@ entry: # Push register t1 into stack subu $sp, $sp, 4 sw $t1, 0($sp) - jal __Main__attrib__g__init + jal __Main__attrib__s__init # Pop 4 bytes from stack into register t1 lw $t1, 0($sp) addu $sp, $sp, 4 @@ -1562,59 +1570,9 @@ function_read_input_at_Parse: sw $fp, 0($sp) addu $fp, $sp, 112 # LOCAL local_read_input_at_Parse_g_0 --> -4($fp) - # local_read_input_at_Parse_g_0 = ALLOCATE Graph - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Graph - sw $t0, 12($v0) - li $t0, 5 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Graph_start - sw $t0, 4($v0) - # Load type offset - li $t0, 24 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Graph__attrib__vertices__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Graph__attrib__edges__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) + # local_read_input_at_Parse_g_0 = 0 + li $t0, 0 + sw $t0, -4($fp) # LOCAL local_read_input_at_Parse_internal_1 --> -8($fp) # local_read_input_at_Parse_internal_1 = ALLOCATE Graph # Allocating 20 bytes of memory @@ -2479,59 +2437,9 @@ function_parse_line_at_Parse: sw $fp, 0($sp) addu $fp, $sp, 136 # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) - # local_parse_line_at_Parse_v_0 = ALLOCATE Vertice - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Vertice - sw $t0, 12($v0) - li $t0, 7 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Vertice_start - sw $t0, 4($v0) - # Load type offset - li $t0, 56 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Vertice__attrib__num__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Vertice__attrib__out__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) + # local_parse_line_at_Parse_v_0 = 0 + li $t0, 0 + sw $t0, -4($fp) # LOCAL local_parse_line_at_Parse_internal_3 --> -16($fp) # local_parse_line_at_Parse_internal_3 = ALLOCATE Vertice # Allocating 20 bytes of memory @@ -9470,28 +9378,28 @@ label_WHILE_END_170: # Function END -# __Main__attrib__g__init implementation. +# __Main__attrib__s__init implementation. # @Params: -__Main__attrib__g__init: - # Allocate stack frame for function __Main__attrib__g__init. +__Main__attrib__s__init: + # Allocate stack frame for function __Main__attrib__s__init. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # local_ttrib__g__init_internal_3 = SELF + # LOCAL local_ttrib__s__init_internal_3 --> -16($fp) + # local_ttrib__s__init_internal_3 = SELF sw $s1, -16($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # local_ttrib__g__init_internal_1 = local_ttrib__g__init_internal_3 + # LOCAL local_ttrib__s__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__s__init_internal_3 --> -16($fp) + # local_ttrib__s__init_internal_1 = local_ttrib__s__init_internal_3 lw $t0, -16($fp) sw $t0, -8($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) - # local_ttrib__g__init_internal_2 = VCALL local_ttrib__g__init_internal_1 read_input + # LOCAL local_ttrib__s__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__s__init_internal_2 --> -12($fp) + # local_ttrib__s__init_internal_2 = VCALL local_ttrib__s__init_internal_1 in_string # Save new self pointer in $s1 lw $s1, -8($fp) # Get pointer to type @@ -9499,16 +9407,16 @@ __Main__attrib__g__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN local_ttrib__g__init_internal_2 + # RETURN local_ttrib__s__init_internal_2 lw $v0, -12($fp) - # Deallocate stack frame for function __Main__attrib__g__init. + # Deallocate stack frame for function __Main__attrib__s__init. # Restore $ra lw $ra, 4($sp) # Restore $fp @@ -9523,77 +9431,203 @@ __Main__attrib__g__init: # @Params: function_main_at_Main: # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 + subu $sp, $sp, 56 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_main_at_Main_internal_2 = GETATTRIBUTE g Main - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - lw $t0, 20($s1) - sw $t0, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t0, -12($fp) + addu $fp, $sp, 56 + # LOCAL local_main_at_Main_v_0 --> -4($fp) + # local_main_at_Main_v_0 = 0 + li $t0, 0 sw $t0, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE Vertice + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Vertice + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Vertice_start + sw $t0, 4($v0) + # Load type offset + li $t0, 56 + sw $t0, 8($v0) + move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Vertice__attrib__num__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Vertice__attrib__out__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -16($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 print_V + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_main_at_Main_internal_7 = GETATTRIBUTE s Main + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + lw $t0, 20($s1) + sw $t0, -32($fp) + # ARG local_main_at_Main_internal_7 + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + lw $t0, -32($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 a2i # Save new self pointer in $s1 - lw $s1, -4($fp) + lw $s1, -20($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 - sw $v0, -8($fp) + sw $v0, -24($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # local_main_at_Main_internal_5 = GETATTRIBUTE g Main - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - lw $t0, 20($s1) - sw $t0, -24($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # ARG local_main_at_Main_internal_5 # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 lw $t0, -24($fp) - sw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_v_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_v_0 = local_main_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = SELF + sw $s1, -44($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_8 = local_main_at_Main_internal_10 + lw $t0, -44($fp) + sw $t0, -36($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 print_E + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_22 + sw $t0, 12($v0) + li $t0, 16 + sw $t0, 16($v0) + sw $v0, -48($fp) + # ARG local_main_at_Main_internal_11 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + lw $t0, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 out_string # Save new self pointer in $s1 - lw $s1, -16($fp) + lw $s1, -36($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 - sw $v0, -20($fp) + sw $v0, -40($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_4 - lw $v0, -20($fp) + # RETURN local_main_at_Main_internal_9 + lw $v0, -40($fp) # Deallocate stack frame for function function_main_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 32 + addu $sp, $sp, 56 jr $ra # Function END @@ -9926,7 +9960,7 @@ function_print_at_VList: # Load type offset li $t0, 8 sw $t0, 8($v0) - la $t0, data_22 + la $t0, data_23 sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) @@ -10727,7 +10761,7 @@ function_print_at_EList: # Load type offset li $t0, 8 sw $t0, 8($v0) - la $t0, data_23 + la $t0, data_24 sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) @@ -11235,7 +11269,7 @@ function_print_at_Edge: # Load type offset li $t0, 8 sw $t0, 8($v0) - la $t0, data_24 + la $t0, data_25 sw $t0, 12($v0) li $t0, 2 sw $t0, 16($v0) @@ -11325,7 +11359,7 @@ function_print_at_Edge: # Load type offset li $t0, 8 sw $t0, 8($v0) - la $t0, data_25 + la $t0, data_26 sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) @@ -11415,7 +11449,7 @@ function_print_at_Edge: # Load type offset li $t0, 8 sw $t0, 8($v0) - la $t0, data_26 + la $t0, data_27 sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) @@ -11668,26 +11702,176 @@ function_number_at_Vertice: # 0($fp) = param_init_at_Vertice_n_0 function_init_at_Vertice: # Allocate stack frame for function function_init_at_Vertice. - subu $sp, $sp, 32 + subu $sp, $sp, 40 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 32 + addu $fp, $sp, 40 + # LOCAL local_init_at_Vertice_internal_2 --> -12($fp) + # local_init_at_Vertice_internal_2 = ALLOCATE IO + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, IO + sw $t0, 12($v0) + li $t0, 2 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, IO_start + sw $t0, 4($v0) + # Load type offset + li $t0, 0 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -12($fp) + # LOCAL local_init_at_Vertice_internal_0 --> -4($fp) + # LOCAL local_init_at_Vertice_internal_2 --> -12($fp) + # local_init_at_Vertice_internal_0 = local_init_at_Vertice_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_init_at_Vertice_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_28 + sw $t0, 12($v0) + li $t0, 21 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_init_at_Vertice_internal_3 + # LOCAL local_init_at_Vertice_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_init_at_Vertice_internal_0 --> -4($fp) + # LOCAL local_init_at_Vertice_internal_1 --> -8($fp) + # local_init_at_Vertice_internal_1 = VCALL local_init_at_Vertice_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_init_at_Vertice_internal_6 --> -28($fp) + # local_init_at_Vertice_internal_6 = ALLOCATE IO + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, IO + sw $t0, 12($v0) + li $t0, 2 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, IO_start + sw $t0, 4($v0) + # Load type offset + li $t0, 0 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -28($fp) + # LOCAL local_init_at_Vertice_internal_4 --> -20($fp) + # LOCAL local_init_at_Vertice_internal_6 --> -28($fp) + # local_init_at_Vertice_internal_4 = local_init_at_Vertice_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_init_at_Vertice_internal_4 --> -20($fp) + # LOCAL local_init_at_Vertice_internal_5 --> -24($fp) + # local_init_at_Vertice_internal_5 = VCALL local_init_at_Vertice_internal_4 in_string + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 # # PARAM param_init_at_Vertice_n_0 --> 0($fp) lw $t0, 0($fp) sw $t0, 12($s1) - # LOCAL local_init_at_Vertice_internal_0 --> -4($fp) - # local_init_at_Vertice_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_init_at_Vertice_internal_0 - lw $v0, -4($fp) + # LOCAL local_init_at_Vertice_internal_7 --> -32($fp) + # local_init_at_Vertice_internal_7 = SELF + sw $s1, -32($fp) + # RETURN local_init_at_Vertice_internal_7 + lw $v0, -32($fp) # Deallocate stack frame for function function_init_at_Vertice. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 32 + addu $sp, $sp, 40 # Deallocate function args addu $sp, $sp, 4 jr $ra diff --git a/src/testing.py b/src/testing.py index 599b5286..83f08be3 100755 --- a/src/testing.py +++ b/src/testing.py @@ -123,6 +123,8 @@ class Vertice inherits IO { init(n : Int) : Vertice { { + new IO.out_string("initializing Vertice\n"); + new IO.in_string(); num <- n; self; } @@ -418,12 +420,12 @@ class Parse inherits IO { class Main inherits Parse { - g : Graph <- read_input(); + s : String <- in_string(); main() : Object { { - g.print_V(); - g.print_E(); + let v : Vertice <- (new Vertice).init(a2i(s)) in + out_string("Success in init\n"); } }; @@ -441,6 +443,27 @@ class BoolOp { }; }; - + +""" + +testProg = r""" +class Main inherits IO { + num1 : Int; + num2 : Int; + main(): Object { + { + num1 <- ~1; + num2 <- 0; + out_int(num2 - num1); + out_string("\n"); + let x: Int in + { + x <- num2 - num1; + out_int(x); + }; + out_string("\n"); + } + }; +}; """ pipeline(text, 1) diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 16749c61..7f950001 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -319,18 +319,13 @@ def _(self, node: coolAst.VariableDeclaration, scope: Scope) -> CilNode: # Si la variable es int, string o boolean, su valor por defecto es 0 if var_info.type.name not in ("String", "Int", "Bool"): - self.register_instruction(AllocateNode(var_info.type, local_var)) + self.register_instruction(AssignNode(local_var, 0)) elif var_info.type.name == "String": self.register_instruction(AllocateStringNode(local_var, self.null, 0)) elif var_info.type.name == "Int": self.register_instruction(AllocateIntNode(local_var, 0)) elif var_info.type.name == "Bool": self.register_instruction(AllocateBoolNode(local_var, 0)) - else: - # Si la variable tiene una expresion de inicializacion - # entonces no es necesario ponerle valor por defecto - if var_init_expr is None: - self.register_instruction(AssignNode(local_var, 0)) if var_init_expr is not None: expr_init_vm_holder = self.visit(var_init_expr, scope) @@ -397,7 +392,7 @@ def _(self, node: coolAst.AssignNode, scope: Scope): elif var_inf.location == "LOCAL": var = next( v - for v in self.localvars + for v in list(reversed(self.localvars)) if f"local_{self.current_function.name[9:]}_{var_inf.name}_" in v.name ) self.register_instruction(AssignNode(var, rvalue_vm_holder)) diff --git a/tests/codegen/arith.mips b/tests/codegen/arith.mips index 991ef1f8..62fac818 100644 --- a/tests/codegen/arith.mips +++ b/tests/codegen/arith.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:21 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:50 2020 # School of Math and Computer Science, University of Havana # @@ -798,7 +798,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -8691,10 +8691,10 @@ label_WHILE_END_232: # 0($fp) = param_i2a_at_A2I_i_0 function_i2a_at_A2I: # Allocate stack frame for function function_i2a_at_A2I. - subu $sp, $sp, 92 + subu $sp, $sp, 96 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 92 + addu $fp, $sp, 96 # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) # Allocating 20 bytes of memory li $a0, 20 @@ -9162,7 +9162,7 @@ label_FALSEIF_245: # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) + # LOCAL local_i2a_at_A2I_internal_21 --> -88($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -9192,6 +9192,45 @@ label_FALSEIF_245: sw $t0, 8($v0) li $t0, 1 sw $t0, 12($v0) + sw $v0, -88($fp) + # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) + # LOCAL local_i2a_at_A2I_internal_21 --> -88($fp) + lw $t0, -88($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -84($fp) + # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) + # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -84($fp) + sw $t0, 12($v0) sw $v0, -84($fp) # LOCAL local_i2a_at_A2I_internal_19 --> -80($fp) # PARAM param_i2a_at_A2I_i_0 --> 0($fp) @@ -9297,7 +9336,7 @@ lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp -addu $sp, $sp, 92 +addu $sp, $sp, 96 # Deallocate function args addu $sp, $sp, 4 jr $ra @@ -10727,11 +10766,11 @@ label_FALSEIF_259: sw $t1, 8($v0) sw $t0, 12($v0) sw $v0, -40($fp) - # LOCAL local_method4_at_A_x_3 --> -16($fp) + # LOCAL local_method4_at_A_x_8 --> -36($fp) # LOCAL local_method4_at_A_internal_9 --> -40($fp) - # local_method4_at_A_x_3 = local_method4_at_A_internal_9 + # local_method4_at_A_x_8 = local_method4_at_A_internal_9 lw $t0, -40($fp) - sw $t0, -16($fp) + sw $t0, -36($fp) # LOCAL local_method4_at_A_internal_12 --> -52($fp) # local_method4_at_A_internal_12 = ALLOCATE D # Allocating 20 bytes of memory @@ -14850,43 +14889,9 @@ function_get_int_at_Main: sw $fp, 0($sp) addu $fp, $sp, 40 # LOCAL local_get_int_at_Main_z_0 --> -4($fp) - # local_get_int_at_Main_z_0 = ALLOCATE A2I - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, A2I - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, A2I_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) + # local_get_int_at_Main_z_0 = 0 + li $t0, 0 + sw $t0, -4($fp) # LOCAL local_get_int_at_Main_internal_1 --> -8($fp) # local_get_int_at_Main_internal_1 = ALLOCATE A2I # Allocating 20 bytes of memory @@ -15983,7 +15988,7 @@ function_class_type_at_Main: # local_class_type_at_Main_internal_3 = 15 li $t0, 15 sw $t0, -16($fp) - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type A @@ -16005,7 +16010,7 @@ function_class_type_at_Main: lw $t0, -20($fp) sw $t0, -16($fp) label_Not_min0_325: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type B @@ -16027,7 +16032,7 @@ function_class_type_at_Main: lw $t0, -20($fp) sw $t0, -16($fp) label_Not_min1_326: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type C @@ -16049,7 +16054,7 @@ function_class_type_at_Main: lw $t0, -20($fp) sw $t0, -16($fp) label_Not_min2_327: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type D @@ -16071,7 +16076,7 @@ function_class_type_at_Main: lw $t0, -20($fp) sw $t0, -16($fp) label_Not_min3_328: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type E @@ -16093,7 +16098,7 @@ function_class_type_at_Main: lw $t0, -20($fp) sw $t0, -16($fp) label_Not_min4_329: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type Object @@ -16131,7 +16136,7 @@ function_class_type_at_Main: # IF_ZERO local_class_type_at_Main_internal_1 GOTO label_ERROR_331 lw $t0, -8($fp) beq $t0, 0, label_ERROR_331 - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type A @@ -16212,7 +16217,7 @@ function_class_type_at_Main: # GOTO label_END_332 j label_END_332 label_NEXT0_333: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type B @@ -16293,7 +16298,7 @@ label_NEXT0_333: # GOTO label_END_332 j label_END_332 label_NEXT1_334: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type C @@ -16374,7 +16379,7 @@ label_NEXT1_334: # GOTO label_END_332 j label_END_332 label_NEXT2_335: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type D @@ -16455,7 +16460,7 @@ label_NEXT2_335: # GOTO label_END_332 j label_END_332 label_NEXT3_336: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type E @@ -16536,7 +16541,7 @@ label_NEXT3_336: # GOTO label_END_332 j label_END_332 label_NEXT4_337: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type Object @@ -16659,43 +16664,9 @@ function_print_at_Main: sw $fp, 0($sp) addu $fp, $sp, 60 # LOCAL local_print_at_Main_z_0 --> -4($fp) - # local_print_at_Main_z_0 = ALLOCATE A2I - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, A2I - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, A2I_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) + # local_print_at_Main_z_0 = 0 + li $t0, 0 + sw $t0, -4($fp) # LOCAL local_print_at_Main_internal_1 --> -8($fp) # local_print_at_Main_internal_1 = ALLOCATE A2I # Allocating 20 bytes of memory @@ -16900,10 +16871,10 @@ function_print_at_Main: # @Params: function_main_at_Main: # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 992 + subu $sp, $sp, 1008 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 992 + addu $fp, $sp, 1008 # LOCAL local_main_at_Main_internal_0 --> -4($fp) # local_main_at_Main_internal_0 = ALLOCATE A # Allocating 20 bytes of memory @@ -17261,9 +17232,19 @@ sw $t0, -112($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) +# local_main_at_Main_internal_30 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_30 --> -124($fp) +lw $t0, 16($s1) +sw $t0, -124($fp) +# ARG local_main_at_Main_internal_30 +# LOCAL local_main_at_Main_internal_30 --> -124($fp) +lw $t0, -124($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_27 --> -112($fp) # LOCAL local_main_at_Main_internal_28 --> -116($fp) -# local_main_at_Main_internal_28 = VCALL local_main_at_Main_internal_27 menu +# local_main_at_Main_internal_28 = VCALL local_main_at_Main_internal_27 class_type # Save new self pointer in $s1 lw $s1, -112($fp) # Get pointer to type @@ -17271,22 +17252,50 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 28($t0) +lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -116($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_33 --> -136($fp) +# local_main_at_Main_internal_33 = SELF +sw $s1, -136($fp) +# LOCAL local_main_at_Main_internal_31 --> -128($fp) +# LOCAL local_main_at_Main_internal_33 --> -136($fp) +# local_main_at_Main_internal_31 = local_main_at_Main_internal_33 +lw $t0, -136($fp) +sw $t0, -128($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_31 --> -128($fp) +# LOCAL local_main_at_Main_internal_32 --> -132($fp) +# local_main_at_Main_internal_32 = VCALL local_main_at_Main_internal_31 menu +# Save new self pointer in $s1 +lw $s1, -128($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 28($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -132($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 # -# LOCAL local_main_at_Main_internal_28 --> -116($fp) -lw $t0, -116($fp) +# LOCAL local_main_at_Main_internal_32 --> -132($fp) +lw $t0, -132($fp) sw $t0, 12($s1) -# local_main_at_Main_internal_34 = GETATTRIBUTE char Main -# LOCAL local_main_at_Main_internal_34 --> -140($fp) +# local_main_at_Main_internal_38 = GETATTRIBUTE char Main +# LOCAL local_main_at_Main_internal_38 --> -156($fp) lw $t0, 12($s1) -sw $t0, -140($fp) -# LOCAL local_main_at_Main_internal_35 --> -144($fp) +sw $t0, -156($fp) +# LOCAL local_main_at_Main_internal_39 --> -160($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -17303,111 +17312,111 @@ la $t0, data_60 sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) -sw $v0, -144($fp) -# IF_ZERO local_main_at_Main_internal_34 GOTO label_FALSE_345 -# IF_ZERO local_main_at_Main_internal_34 GOTO label_FALSE_345 -lw $t0, -140($fp) +sw $v0, -160($fp) +# IF_ZERO local_main_at_Main_internal_38 GOTO label_FALSE_345 +# IF_ZERO local_main_at_Main_internal_38 GOTO label_FALSE_345 +lw $t0, -156($fp) beq $t0, 0, label_FALSE_345 -# IF_ZERO local_main_at_Main_internal_35 GOTO label_FALSE_345 -# IF_ZERO local_main_at_Main_internal_35 GOTO label_FALSE_345 -lw $t0, -144($fp) +# IF_ZERO local_main_at_Main_internal_39 GOTO label_FALSE_345 +# IF_ZERO local_main_at_Main_internal_39 GOTO label_FALSE_345 +lw $t0, -160($fp) beq $t0, 0, label_FALSE_345 -# LOCAL local_main_at_Main_internal_33 --> -136($fp) -# LOCAL local_main_at_Main_internal_34 --> -140($fp) -# Comparing -140($fp) type with String +# LOCAL local_main_at_Main_internal_37 --> -152($fp) +# LOCAL local_main_at_Main_internal_38 --> -156($fp) +# Comparing -156($fp) type with String la $v0, String -lw $a0, -140($fp) +lw $a0, -156($fp) lw $a0, 0($a0) sub $a0, $a0, $v0 -sw $a0, -136($fp) -# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_STRING_348 -# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_STRING_348 -lw $t0, -136($fp) +sw $a0, -152($fp) +# IF_ZERO local_main_at_Main_internal_37 GOTO label_COMPARE_STRING_348 +# IF_ZERO local_main_at_Main_internal_37 GOTO label_COMPARE_STRING_348 +lw $t0, -152($fp) beq $t0, 0, label_COMPARE_STRING_348 -# LOCAL local_main_at_Main_internal_33 --> -136($fp) -# LOCAL local_main_at_Main_internal_34 --> -140($fp) -# Comparing -140($fp) type with Bool +# LOCAL local_main_at_Main_internal_37 --> -152($fp) +# LOCAL local_main_at_Main_internal_38 --> -156($fp) +# Comparing -156($fp) type with Bool la $v0, Bool -lw $a0, -140($fp) +lw $a0, -156($fp) lw $a0, 0($a0) lw $a0, 12($a0) sub $a0, $a0, $v0 -sw $a0, -136($fp) -# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_BY_VALUE_349 -# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_BY_VALUE_349 -lw $t0, -136($fp) +sw $a0, -152($fp) +# IF_ZERO local_main_at_Main_internal_37 GOTO label_COMPARE_BY_VALUE_349 +# IF_ZERO local_main_at_Main_internal_37 GOTO label_COMPARE_BY_VALUE_349 +lw $t0, -152($fp) beq $t0, 0, label_COMPARE_BY_VALUE_349 -# LOCAL local_main_at_Main_internal_33 --> -136($fp) -# LOCAL local_main_at_Main_internal_34 --> -140($fp) -# Comparing -140($fp) type with Int +# LOCAL local_main_at_Main_internal_37 --> -152($fp) +# LOCAL local_main_at_Main_internal_38 --> -156($fp) +# Comparing -156($fp) type with Int la $v0, Int -lw $a0, -140($fp) +lw $a0, -156($fp) lw $a0, 0($a0) lw $a0, 12($a0) sub $a0, $a0, $v0 -sw $a0, -136($fp) -# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_BY_VALUE_349 -# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_BY_VALUE_349 -lw $t0, -136($fp) +sw $a0, -152($fp) +# IF_ZERO local_main_at_Main_internal_37 GOTO label_COMPARE_BY_VALUE_349 +# IF_ZERO local_main_at_Main_internal_37 GOTO label_COMPARE_BY_VALUE_349 +lw $t0, -152($fp) beq $t0, 0, label_COMPARE_BY_VALUE_349 -# LOCAL local_main_at_Main_internal_33 --> -136($fp) -# LOCAL local_main_at_Main_internal_34 --> -140($fp) -# LOCAL local_main_at_Main_internal_35 --> -144($fp) +# LOCAL local_main_at_Main_internal_37 --> -152($fp) +# LOCAL local_main_at_Main_internal_38 --> -156($fp) +# LOCAL local_main_at_Main_internal_39 --> -160($fp) # Load pointers and SUB -lw $a0, -140($fp) -lw $a1, -144($fp) +lw $a0, -156($fp) +lw $a1, -160($fp) sub $a0, $a0, $a1 -sw $a0, -136($fp) -# IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_346 -# IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_346 -lw $t0, -136($fp) +sw $a0, -152($fp) +# IF_ZERO local_main_at_Main_internal_37 GOTO label_TRUE_346 +# IF_ZERO local_main_at_Main_internal_37 GOTO label_TRUE_346 +lw $t0, -152($fp) beq $t0, 0, label_TRUE_346 # GOTO label_FALSE_345 j label_FALSE_345 label_COMPARE_BY_VALUE_349: - # LOCAL local_main_at_Main_internal_33 --> -136($fp) - # LOCAL local_main_at_Main_internal_34 --> -140($fp) - # LOCAL local_main_at_Main_internal_35 --> -144($fp) - lw $a0, -140($fp) - lw $a1, -144($fp) + # LOCAL local_main_at_Main_internal_37 --> -152($fp) + # LOCAL local_main_at_Main_internal_38 --> -156($fp) + # LOCAL local_main_at_Main_internal_39 --> -160($fp) + lw $a0, -156($fp) + lw $a1, -160($fp) # Load values lw $a0, 12($a0) lw $a1, 12($a1) # SUB and store sub $a0, $a0, $a1 - sw $a0, -136($fp) - # IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_346 - # IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_346 - lw $t0, -136($fp) + sw $a0, -152($fp) + # IF_ZERO local_main_at_Main_internal_37 GOTO label_TRUE_346 + # IF_ZERO local_main_at_Main_internal_37 GOTO label_TRUE_346 + lw $t0, -152($fp) beq $t0, 0, label_TRUE_346 # GOTO label_FALSE_345 j label_FALSE_345 label_COMPARE_STRING_348: - # LOCAL local_main_at_Main_internal_33 --> -136($fp) - # LOCAL local_main_at_Main_internal_34 --> -140($fp) - # LOCAL local_main_at_Main_internal_35 --> -144($fp) + # LOCAL local_main_at_Main_internal_37 --> -152($fp) + # LOCAL local_main_at_Main_internal_38 --> -156($fp) + # LOCAL local_main_at_Main_internal_39 --> -160($fp) # Load strings for comparison - lw $v0, -140($fp) - lw $v1, -144($fp) + lw $v0, -156($fp) + lw $v1, -160($fp) # Compare lengths lw $v0, 16($v0) lw $v1, 16($v1) sub $v0, $v0, $v1 - sw $v0, -136($fp) - # IF_ZERO local_main_at_Main_internal_33 GOTO label_CONTINUE_350 - # IF_ZERO local_main_at_Main_internal_33 GOTO label_CONTINUE_350 - lw $t0, -136($fp) + sw $v0, -152($fp) + # IF_ZERO local_main_at_Main_internal_37 GOTO label_CONTINUE_350 + # IF_ZERO local_main_at_Main_internal_37 GOTO label_CONTINUE_350 + lw $t0, -152($fp) beq $t0, 0, label_CONTINUE_350 # GOTO label_FALSE_345 j label_FALSE_345 label_CONTINUE_350: - # LOCAL local_main_at_Main_internal_33 --> -136($fp) - # LOCAL local_main_at_Main_internal_34 --> -140($fp) - # LOCAL local_main_at_Main_internal_35 --> -144($fp) + # LOCAL local_main_at_Main_internal_37 --> -152($fp) + # LOCAL local_main_at_Main_internal_38 --> -156($fp) + # LOCAL local_main_at_Main_internal_39 --> -160($fp) move $a2, $zero # Load strings for comparison - lw $v0, -140($fp) - lw $v1, -144($fp) + lw $v0, -156($fp) + lw $v1, -160($fp) # Load strings pointers lw $v0, 12($v0) lw $v1, 12($v1) @@ -17427,13 +17436,13 @@ label_COMPARE_BY_VALUE_349: li $a2, 1 label_WHILE_STR_COMP_END_352: # Store result - sw $a2, -136($fp) - # IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_346 - # IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_346 - lw $t0, -136($fp) + sw $a2, -152($fp) + # IF_ZERO local_main_at_Main_internal_37 GOTO label_TRUE_346 + # IF_ZERO local_main_at_Main_internal_37 GOTO label_TRUE_346 + lw $t0, -152($fp) beq $t0, 0, label_TRUE_346 label_FALSE_345: - # LOCAL local_main_at_Main_internal_32 --> -132($fp) + # LOCAL local_main_at_Main_internal_36 --> -148($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -17463,11 +17472,11 @@ label_COMPARE_BY_VALUE_349: sw $t0, 8($v0) li $t0, 0 sw $t0, 12($v0) - sw $v0, -132($fp) + sw $v0, -148($fp) # GOTO label_END_347 j label_END_347 label_TRUE_346: - # LOCAL local_main_at_Main_internal_32 --> -132($fp) + # LOCAL local_main_at_Main_internal_36 --> -148($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -17497,20 +17506,20 @@ label_TRUE_346: sw $t0, 8($v0) li $t0, 1 sw $t0, 12($v0) - sw $v0, -132($fp) + sw $v0, -148($fp) label_END_347: -# LOCAL local_main_at_Main_internal_30 --> -124($fp) -# LOCAL local_main_at_Main_internal_32 --> -132($fp) -# Obtain value from -132($fp) -lw $v0, -132($fp) +# LOCAL local_main_at_Main_internal_34 --> -140($fp) +# LOCAL local_main_at_Main_internal_36 --> -148($fp) +# Obtain value from -148($fp) +lw $v0, -148($fp) lw $v0, 12($v0) -sw $v0, -124($fp) -# IF_ZERO local_main_at_Main_internal_30 GOTO label_FALSEIF_343 -# IF_ZERO local_main_at_Main_internal_30 GOTO label_FALSEIF_343 -lw $t0, -124($fp) +sw $v0, -140($fp) +# IF_ZERO local_main_at_Main_internal_34 GOTO label_FALSEIF_343 +# IF_ZERO local_main_at_Main_internal_34 GOTO label_FALSEIF_343 +lw $t0, -140($fp) beq $t0, 0, label_FALSEIF_343 -# LOCAL local_main_at_Main_internal_38 --> -156($fp) -# local_main_at_Main_internal_38 = ALLOCATE A +# LOCAL local_main_at_Main_internal_42 --> -172($fp) +# local_main_at_Main_internal_42 = ALLOCATE A # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -17554,31 +17563,31 @@ sw $v0, 12($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -sw $t1, -156($fp) -# LOCAL local_main_at_Main_internal_36 --> -148($fp) -# LOCAL local_main_at_Main_internal_38 --> -156($fp) -# local_main_at_Main_internal_36 = local_main_at_Main_internal_38 -lw $t0, -156($fp) -sw $t0, -148($fp) +sw $t1, -172($fp) +# LOCAL local_main_at_Main_internal_40 --> -164($fp) +# LOCAL local_main_at_Main_internal_42 --> -172($fp) +# local_main_at_Main_internal_40 = local_main_at_Main_internal_42 +lw $t0, -172($fp) +sw $t0, -164($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_41 --> -168($fp) -# local_main_at_Main_internal_41 = SELF -sw $s1, -168($fp) -# LOCAL local_main_at_Main_internal_39 --> -160($fp) -# LOCAL local_main_at_Main_internal_41 --> -168($fp) -# local_main_at_Main_internal_39 = local_main_at_Main_internal_41 -lw $t0, -168($fp) -sw $t0, -160($fp) +# LOCAL local_main_at_Main_internal_45 --> -184($fp) +# local_main_at_Main_internal_45 = SELF +sw $s1, -184($fp) +# LOCAL local_main_at_Main_internal_43 --> -176($fp) +# LOCAL local_main_at_Main_internal_45 --> -184($fp) +# local_main_at_Main_internal_43 = local_main_at_Main_internal_45 +lw $t0, -184($fp) +sw $t0, -176($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_39 --> -160($fp) -# LOCAL local_main_at_Main_internal_40 --> -164($fp) -# local_main_at_Main_internal_40 = VCALL local_main_at_Main_internal_39 get_int +# LOCAL local_main_at_Main_internal_43 --> -176($fp) +# LOCAL local_main_at_Main_internal_44 --> -180($fp) +# local_main_at_Main_internal_44 = VCALL local_main_at_Main_internal_43 get_int # Save new self pointer in $s1 -lw $s1, -160($fp) +lw $s1, -176($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -17587,21 +17596,21 @@ lw $t0, 0($t0) lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -164($fp) +sw $v0, -180($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_40 -# LOCAL local_main_at_Main_internal_40 --> -164($fp) -lw $t0, -164($fp) +# ARG local_main_at_Main_internal_44 +# LOCAL local_main_at_Main_internal_44 --> -180($fp) +lw $t0, -180($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_36 --> -148($fp) -# LOCAL local_main_at_Main_internal_37 --> -152($fp) -# local_main_at_Main_internal_37 = VCALL local_main_at_Main_internal_36 set_var +# LOCAL local_main_at_Main_internal_40 --> -164($fp) +# LOCAL local_main_at_Main_internal_41 --> -168($fp) +# local_main_at_Main_internal_41 = VCALL local_main_at_Main_internal_40 set_var # Save new self pointer in $s1 -lw $s1, -148($fp) +lw $s1, -164($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -17610,16 +17619,16 @@ lw $t0, 0($t0) lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -152($fp) +sw $v0, -168($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # -# LOCAL local_main_at_Main_internal_37 --> -152($fp) -lw $t0, -152($fp) +# LOCAL local_main_at_Main_internal_41 --> -168($fp) +lw $t0, -168($fp) sw $t0, 20($s1) -# LOCAL local_main_at_Main_internal_44 --> -180($fp) -# local_main_at_Main_internal_44 = ALLOCATE B +# LOCAL local_main_at_Main_internal_48 --> -196($fp) +# local_main_at_Main_internal_48 = ALLOCATE B # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -17663,32 +17672,32 @@ sw $v0, 12($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -sw $t1, -180($fp) -# LOCAL local_main_at_Main_internal_42 --> -172($fp) -# LOCAL local_main_at_Main_internal_44 --> -180($fp) -# local_main_at_Main_internal_42 = local_main_at_Main_internal_44 -lw $t0, -180($fp) -sw $t0, -172($fp) +sw $t1, -196($fp) +# LOCAL local_main_at_Main_internal_46 --> -188($fp) +# LOCAL local_main_at_Main_internal_48 --> -196($fp) +# local_main_at_Main_internal_46 = local_main_at_Main_internal_48 +lw $t0, -196($fp) +sw $t0, -188($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# local_main_at_Main_internal_47 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_47 --> -192($fp) +# local_main_at_Main_internal_51 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_51 --> -208($fp) lw $t0, 16($s1) -sw $t0, -192($fp) -# LOCAL local_main_at_Main_internal_45 --> -184($fp) -# LOCAL local_main_at_Main_internal_47 --> -192($fp) -# local_main_at_Main_internal_45 = local_main_at_Main_internal_47 -lw $t0, -192($fp) -sw $t0, -184($fp) +sw $t0, -208($fp) +# LOCAL local_main_at_Main_internal_49 --> -200($fp) +# LOCAL local_main_at_Main_internal_51 --> -208($fp) +# local_main_at_Main_internal_49 = local_main_at_Main_internal_51 +lw $t0, -208($fp) +sw $t0, -200($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_45 --> -184($fp) -# LOCAL local_main_at_Main_internal_46 --> -188($fp) -# local_main_at_Main_internal_46 = VCALL local_main_at_Main_internal_45 value +# LOCAL local_main_at_Main_internal_49 --> -200($fp) +# LOCAL local_main_at_Main_internal_50 --> -204($fp) +# local_main_at_Main_internal_50 = VCALL local_main_at_Main_internal_49 value # Save new self pointer in $s1 -lw $s1, -184($fp) +lw $s1, -200($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -17697,33 +17706,33 @@ lw $t0, 0($t0) lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -188($fp) +sw $v0, -204($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_46 -# LOCAL local_main_at_Main_internal_46 --> -188($fp) -lw $t0, -188($fp) +# ARG local_main_at_Main_internal_50 +# LOCAL local_main_at_Main_internal_50 --> -204($fp) +lw $t0, -204($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) -# local_main_at_Main_internal_50 = GETATTRIBUTE a_var Main -# LOCAL local_main_at_Main_internal_50 --> -204($fp) +# local_main_at_Main_internal_54 = GETATTRIBUTE a_var Main +# LOCAL local_main_at_Main_internal_54 --> -220($fp) lw $t0, 20($s1) -sw $t0, -204($fp) -# LOCAL local_main_at_Main_internal_48 --> -196($fp) -# LOCAL local_main_at_Main_internal_50 --> -204($fp) -# local_main_at_Main_internal_48 = local_main_at_Main_internal_50 -lw $t0, -204($fp) -sw $t0, -196($fp) +sw $t0, -220($fp) +# LOCAL local_main_at_Main_internal_52 --> -212($fp) +# LOCAL local_main_at_Main_internal_54 --> -220($fp) +# local_main_at_Main_internal_52 = local_main_at_Main_internal_54 +lw $t0, -220($fp) +sw $t0, -212($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_48 --> -196($fp) -# LOCAL local_main_at_Main_internal_49 --> -200($fp) -# local_main_at_Main_internal_49 = VCALL local_main_at_Main_internal_48 value +# LOCAL local_main_at_Main_internal_52 --> -212($fp) +# LOCAL local_main_at_Main_internal_53 --> -216($fp) +# local_main_at_Main_internal_53 = VCALL local_main_at_Main_internal_52 value # Save new self pointer in $s1 -lw $s1, -196($fp) +lw $s1, -212($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -17732,21 +17741,21 @@ lw $t0, 0($t0) lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -200($fp) +sw $v0, -216($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_49 -# LOCAL local_main_at_Main_internal_49 --> -200($fp) -lw $t0, -200($fp) +# ARG local_main_at_Main_internal_53 +# LOCAL local_main_at_Main_internal_53 --> -216($fp) +lw $t0, -216($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_42 --> -172($fp) -# LOCAL local_main_at_Main_internal_43 --> -176($fp) -# local_main_at_Main_internal_43 = VCALL local_main_at_Main_internal_42 method2 +# LOCAL local_main_at_Main_internal_46 --> -188($fp) +# LOCAL local_main_at_Main_internal_47 --> -192($fp) +# local_main_at_Main_internal_47 = VCALL local_main_at_Main_internal_46 method2 # Save new self pointer in $s1 -lw $s1, -172($fp) +lw $s1, -188($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -17755,24 +17764,24 @@ lw $t0, 0($t0) lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -176($fp) +sw $v0, -192($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # -# LOCAL local_main_at_Main_internal_43 --> -176($fp) -lw $t0, -176($fp) +# LOCAL local_main_at_Main_internal_47 --> -192($fp) +lw $t0, -192($fp) sw $t0, 16($s1) -# LOCAL local_main_at_Main_internal_31 --> -128($fp) -# local_main_at_Main_internal_31 = +# LOCAL local_main_at_Main_internal_35 --> -144($fp) +# local_main_at_Main_internal_35 = # GOTO label_ENDIF_344 j label_ENDIF_344 label_FALSEIF_343: - # local_main_at_Main_internal_55 = GETATTRIBUTE char Main - # LOCAL local_main_at_Main_internal_55 --> -224($fp) + # local_main_at_Main_internal_59 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_59 --> -240($fp) lw $t0, 12($s1) - sw $t0, -224($fp) - # LOCAL local_main_at_Main_internal_56 --> -228($fp) + sw $t0, -240($fp) + # LOCAL local_main_at_Main_internal_60 --> -244($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -17789,111 +17798,111 @@ label_FALSEIF_343: sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) - sw $v0, -228($fp) - # IF_ZERO local_main_at_Main_internal_55 GOTO label_FALSE_355 - # IF_ZERO local_main_at_Main_internal_55 GOTO label_FALSE_355 - lw $t0, -224($fp) + sw $v0, -244($fp) + # IF_ZERO local_main_at_Main_internal_59 GOTO label_FALSE_355 + # IF_ZERO local_main_at_Main_internal_59 GOTO label_FALSE_355 + lw $t0, -240($fp) beq $t0, 0, label_FALSE_355 - # IF_ZERO local_main_at_Main_internal_56 GOTO label_FALSE_355 - # IF_ZERO local_main_at_Main_internal_56 GOTO label_FALSE_355 - lw $t0, -228($fp) + # IF_ZERO local_main_at_Main_internal_60 GOTO label_FALSE_355 + # IF_ZERO local_main_at_Main_internal_60 GOTO label_FALSE_355 + lw $t0, -244($fp) beq $t0, 0, label_FALSE_355 - # LOCAL local_main_at_Main_internal_54 --> -220($fp) - # LOCAL local_main_at_Main_internal_55 --> -224($fp) - # Comparing -224($fp) type with String + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # LOCAL local_main_at_Main_internal_59 --> -240($fp) + # Comparing -240($fp) type with String la $v0, String - lw $a0, -224($fp) + lw $a0, -240($fp) lw $a0, 0($a0) sub $a0, $a0, $v0 - sw $a0, -220($fp) - # IF_ZERO local_main_at_Main_internal_54 GOTO label_COMPARE_STRING_358 - # IF_ZERO local_main_at_Main_internal_54 GOTO label_COMPARE_STRING_358 - lw $t0, -220($fp) + sw $a0, -236($fp) + # IF_ZERO local_main_at_Main_internal_58 GOTO label_COMPARE_STRING_358 + # IF_ZERO local_main_at_Main_internal_58 GOTO label_COMPARE_STRING_358 + lw $t0, -236($fp) beq $t0, 0, label_COMPARE_STRING_358 - # LOCAL local_main_at_Main_internal_54 --> -220($fp) - # LOCAL local_main_at_Main_internal_55 --> -224($fp) - # Comparing -224($fp) type with Bool + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # LOCAL local_main_at_Main_internal_59 --> -240($fp) + # Comparing -240($fp) type with Bool la $v0, Bool - lw $a0, -224($fp) + lw $a0, -240($fp) lw $a0, 0($a0) lw $a0, 12($a0) sub $a0, $a0, $v0 - sw $a0, -220($fp) - # IF_ZERO local_main_at_Main_internal_54 GOTO label_COMPARE_BY_VALUE_359 - # IF_ZERO local_main_at_Main_internal_54 GOTO label_COMPARE_BY_VALUE_359 - lw $t0, -220($fp) + sw $a0, -236($fp) + # IF_ZERO local_main_at_Main_internal_58 GOTO label_COMPARE_BY_VALUE_359 + # IF_ZERO local_main_at_Main_internal_58 GOTO label_COMPARE_BY_VALUE_359 + lw $t0, -236($fp) beq $t0, 0, label_COMPARE_BY_VALUE_359 - # LOCAL local_main_at_Main_internal_54 --> -220($fp) - # LOCAL local_main_at_Main_internal_55 --> -224($fp) - # Comparing -224($fp) type with Int + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # LOCAL local_main_at_Main_internal_59 --> -240($fp) + # Comparing -240($fp) type with Int la $v0, Int - lw $a0, -224($fp) + lw $a0, -240($fp) lw $a0, 0($a0) lw $a0, 12($a0) sub $a0, $a0, $v0 - sw $a0, -220($fp) - # IF_ZERO local_main_at_Main_internal_54 GOTO label_COMPARE_BY_VALUE_359 - # IF_ZERO local_main_at_Main_internal_54 GOTO label_COMPARE_BY_VALUE_359 - lw $t0, -220($fp) + sw $a0, -236($fp) + # IF_ZERO local_main_at_Main_internal_58 GOTO label_COMPARE_BY_VALUE_359 + # IF_ZERO local_main_at_Main_internal_58 GOTO label_COMPARE_BY_VALUE_359 + lw $t0, -236($fp) beq $t0, 0, label_COMPARE_BY_VALUE_359 - # LOCAL local_main_at_Main_internal_54 --> -220($fp) - # LOCAL local_main_at_Main_internal_55 --> -224($fp) - # LOCAL local_main_at_Main_internal_56 --> -228($fp) + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # LOCAL local_main_at_Main_internal_59 --> -240($fp) + # LOCAL local_main_at_Main_internal_60 --> -244($fp) # Load pointers and SUB - lw $a0, -224($fp) - lw $a1, -228($fp) + lw $a0, -240($fp) + lw $a1, -244($fp) sub $a0, $a0, $a1 - sw $a0, -220($fp) - # IF_ZERO local_main_at_Main_internal_54 GOTO label_TRUE_356 - # IF_ZERO local_main_at_Main_internal_54 GOTO label_TRUE_356 - lw $t0, -220($fp) + sw $a0, -236($fp) + # IF_ZERO local_main_at_Main_internal_58 GOTO label_TRUE_356 + # IF_ZERO local_main_at_Main_internal_58 GOTO label_TRUE_356 + lw $t0, -236($fp) beq $t0, 0, label_TRUE_356 # GOTO label_FALSE_355 j label_FALSE_355 label_COMPARE_BY_VALUE_359: - # LOCAL local_main_at_Main_internal_54 --> -220($fp) - # LOCAL local_main_at_Main_internal_55 --> -224($fp) - # LOCAL local_main_at_Main_internal_56 --> -228($fp) - lw $a0, -224($fp) - lw $a1, -228($fp) + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # LOCAL local_main_at_Main_internal_59 --> -240($fp) + # LOCAL local_main_at_Main_internal_60 --> -244($fp) + lw $a0, -240($fp) + lw $a1, -244($fp) # Load values lw $a0, 12($a0) lw $a1, 12($a1) # SUB and store sub $a0, $a0, $a1 - sw $a0, -220($fp) - # IF_ZERO local_main_at_Main_internal_54 GOTO label_TRUE_356 - # IF_ZERO local_main_at_Main_internal_54 GOTO label_TRUE_356 - lw $t0, -220($fp) + sw $a0, -236($fp) + # IF_ZERO local_main_at_Main_internal_58 GOTO label_TRUE_356 + # IF_ZERO local_main_at_Main_internal_58 GOTO label_TRUE_356 + lw $t0, -236($fp) beq $t0, 0, label_TRUE_356 # GOTO label_FALSE_355 j label_FALSE_355 label_COMPARE_STRING_358: - # LOCAL local_main_at_Main_internal_54 --> -220($fp) - # LOCAL local_main_at_Main_internal_55 --> -224($fp) - # LOCAL local_main_at_Main_internal_56 --> -228($fp) + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # LOCAL local_main_at_Main_internal_59 --> -240($fp) + # LOCAL local_main_at_Main_internal_60 --> -244($fp) # Load strings for comparison - lw $v0, -224($fp) - lw $v1, -228($fp) + lw $v0, -240($fp) + lw $v1, -244($fp) # Compare lengths lw $v0, 16($v0) lw $v1, 16($v1) sub $v0, $v0, $v1 - sw $v0, -220($fp) - # IF_ZERO local_main_at_Main_internal_54 GOTO label_CONTINUE_360 - # IF_ZERO local_main_at_Main_internal_54 GOTO label_CONTINUE_360 - lw $t0, -220($fp) + sw $v0, -236($fp) + # IF_ZERO local_main_at_Main_internal_58 GOTO label_CONTINUE_360 + # IF_ZERO local_main_at_Main_internal_58 GOTO label_CONTINUE_360 + lw $t0, -236($fp) beq $t0, 0, label_CONTINUE_360 # GOTO label_FALSE_355 j label_FALSE_355 label_CONTINUE_360: - # LOCAL local_main_at_Main_internal_54 --> -220($fp) - # LOCAL local_main_at_Main_internal_55 --> -224($fp) - # LOCAL local_main_at_Main_internal_56 --> -228($fp) + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # LOCAL local_main_at_Main_internal_59 --> -240($fp) + # LOCAL local_main_at_Main_internal_60 --> -244($fp) move $a2, $zero # Load strings for comparison - lw $v0, -224($fp) - lw $v1, -228($fp) + lw $v0, -240($fp) + lw $v1, -244($fp) # Load strings pointers lw $v0, 12($v0) lw $v1, 12($v1) @@ -17913,13 +17922,13 @@ label_FALSEIF_343: li $a2, 1 label_WHILE_STR_COMP_END_362: # Store result - sw $a2, -220($fp) - # IF_ZERO local_main_at_Main_internal_54 GOTO label_TRUE_356 - # IF_ZERO local_main_at_Main_internal_54 GOTO label_TRUE_356 - lw $t0, -220($fp) + sw $a2, -236($fp) + # IF_ZERO local_main_at_Main_internal_58 GOTO label_TRUE_356 + # IF_ZERO local_main_at_Main_internal_58 GOTO label_TRUE_356 + lw $t0, -236($fp) beq $t0, 0, label_TRUE_356 label_FALSE_355: - # LOCAL local_main_at_Main_internal_53 --> -216($fp) + # LOCAL local_main_at_Main_internal_57 --> -232($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -17949,11 +17958,11 @@ label_FALSEIF_343: sw $t0, 8($v0) li $t0, 0 sw $t0, 12($v0) - sw $v0, -216($fp) + sw $v0, -232($fp) # GOTO label_END_357 j label_END_357 label_TRUE_356: - # LOCAL local_main_at_Main_internal_53 --> -216($fp) + # LOCAL local_main_at_Main_internal_57 --> -232($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -17983,157 +17992,157 @@ label_TRUE_356: sw $t0, 8($v0) li $t0, 1 sw $t0, 12($v0) - sw $v0, -216($fp) + sw $v0, -232($fp) label_END_357: -# LOCAL local_main_at_Main_internal_51 --> -208($fp) -# LOCAL local_main_at_Main_internal_53 --> -216($fp) -# Obtain value from -216($fp) -lw $v0, -216($fp) +# LOCAL local_main_at_Main_internal_55 --> -224($fp) +# LOCAL local_main_at_Main_internal_57 --> -232($fp) +# Obtain value from -232($fp) +lw $v0, -232($fp) lw $v0, 12($v0) -sw $v0, -208($fp) -# IF_ZERO local_main_at_Main_internal_51 GOTO label_FALSEIF_353 -# IF_ZERO local_main_at_Main_internal_51 GOTO label_FALSEIF_353 -lw $t0, -208($fp) +sw $v0, -224($fp) +# IF_ZERO local_main_at_Main_internal_55 GOTO label_FALSEIF_353 +# IF_ZERO local_main_at_Main_internal_55 GOTO label_FALSEIF_353 +lw $t0, -224($fp) beq $t0, 0, label_FALSEIF_353 -# local_main_at_Main_internal_57 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_57 --> -232($fp) +# local_main_at_Main_internal_61 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_61 --> -248($fp) lw $t0, 16($s1) -sw $t0, -232($fp) -# LOCAL local_main_at_Main_internal_57 --> -232($fp) -# LOCAL local_main_at_Main_internal_58 --> -236($fp) -# local_main_at_Main_internal_58 = TYPEOF local_main_at_Main_internal_57 -lw $t0, -232($fp) +sw $t0, -248($fp) +# LOCAL local_main_at_Main_internal_61 --> -248($fp) +# LOCAL local_main_at_Main_internal_62 --> -252($fp) +# local_main_at_Main_internal_62 = TYPEOF local_main_at_Main_internal_61 +lw $t0, -248($fp) # Load pointer to type offset lw $t1, 8($t0) -sw $t1, -236($fp) -# LOCAL local_main_at_Main_internal_61 --> -248($fp) -# local_main_at_Main_internal_61 = 15 +sw $t1, -252($fp) +# LOCAL local_main_at_Main_internal_65 --> -264($fp) +# local_main_at_Main_internal_65 = 15 li $t0, 15 -sw $t0, -248($fp) -# local_main_at_Main_internal_62 = TYPE_DISTANCE C +sw $t0, -264($fp) +# local_main_at_Main_internal_66 = TYPE_DISTANCE C +# LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) -# LOCAL local_main_at_Main_internal_58 --> -236($fp) # Load TDT pointer to type C la $t0, C__TDT -lw $t1, -236($fp) +lw $t1, -252($fp) addu $t0, $t0, $t1 # Save distance lw $t1, 0($t0) -sw $t1, -252($fp) -# LOCAL local_main_at_Main_internal_62 --> -252($fp) -# LOCAL local_main_at_Main_internal_61 --> -248($fp) +sw $t1, -268($fp) +# LOCAL local_main_at_Main_internal_66 --> -268($fp) +# LOCAL local_main_at_Main_internal_65 --> -264($fp) # Update min if 8 < 9 -lw $t0, -252($fp) -lw $t1, -248($fp) +lw $t0, -268($fp) +lw $t1, -264($fp) bgtu $t0, $t1, label_Not_min0_363 -# LOCAL local_main_at_Main_internal_61 --> -248($fp) -# LOCAL local_main_at_Main_internal_62 --> -252($fp) -# local_main_at_Main_internal_61 = local_main_at_Main_internal_62 -lw $t0, -252($fp) -sw $t0, -248($fp) +# LOCAL local_main_at_Main_internal_65 --> -264($fp) +# LOCAL local_main_at_Main_internal_66 --> -268($fp) +# local_main_at_Main_internal_65 = local_main_at_Main_internal_66 +lw $t0, -268($fp) +sw $t0, -264($fp) label_Not_min0_363: - # local_main_at_Main_internal_62 = TYPE_DISTANCE A + # local_main_at_Main_internal_66 = TYPE_DISTANCE A + # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) - # LOCAL local_main_at_Main_internal_58 --> -236($fp) # Load TDT pointer to type A la $t0, A__TDT - lw $t1, -236($fp) + lw $t1, -252($fp) addu $t0, $t0, $t1 # Save distance lw $t1, 0($t0) - sw $t1, -252($fp) - # LOCAL local_main_at_Main_internal_62 --> -252($fp) - # LOCAL local_main_at_Main_internal_61 --> -248($fp) + sw $t1, -268($fp) + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # LOCAL local_main_at_Main_internal_65 --> -264($fp) # Update min if 8 < 9 - lw $t0, -252($fp) - lw $t1, -248($fp) + lw $t0, -268($fp) + lw $t1, -264($fp) bgtu $t0, $t1, label_Not_min1_364 - # LOCAL local_main_at_Main_internal_61 --> -248($fp) - # LOCAL local_main_at_Main_internal_62 --> -252($fp) - # local_main_at_Main_internal_61 = local_main_at_Main_internal_62 - lw $t0, -252($fp) - sw $t0, -248($fp) + # LOCAL local_main_at_Main_internal_65 --> -264($fp) + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # local_main_at_Main_internal_65 = local_main_at_Main_internal_66 + lw $t0, -268($fp) + sw $t0, -264($fp) label_Not_min1_364: - # local_main_at_Main_internal_62 = TYPE_DISTANCE Object + # local_main_at_Main_internal_66 = TYPE_DISTANCE Object + # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) - # LOCAL local_main_at_Main_internal_58 --> -236($fp) # Load TDT pointer to type Object la $t0, Object__TDT - lw $t1, -236($fp) + lw $t1, -252($fp) addu $t0, $t0, $t1 # Save distance lw $t1, 0($t0) - sw $t1, -252($fp) - # LOCAL local_main_at_Main_internal_62 --> -252($fp) - # LOCAL local_main_at_Main_internal_61 --> -248($fp) + sw $t1, -268($fp) + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # LOCAL local_main_at_Main_internal_65 --> -264($fp) # Update min if 8 < 9 - lw $t0, -252($fp) - lw $t1, -248($fp) + lw $t0, -268($fp) + lw $t1, -264($fp) bgtu $t0, $t1, label_Not_min2_365 - # LOCAL local_main_at_Main_internal_61 --> -248($fp) - # LOCAL local_main_at_Main_internal_62 --> -252($fp) - # local_main_at_Main_internal_61 = local_main_at_Main_internal_62 - lw $t0, -252($fp) - sw $t0, -248($fp) + # LOCAL local_main_at_Main_internal_65 --> -264($fp) + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # local_main_at_Main_internal_65 = local_main_at_Main_internal_66 + lw $t0, -268($fp) + sw $t0, -264($fp) label_Not_min2_365: - # LOCAL local_main_at_Main_internal_62 --> -252($fp) - # local_main_at_Main_internal_62 = 15 + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # local_main_at_Main_internal_66 = 15 li $t0, 15 - sw $t0, -252($fp) - # LOCAL local_main_at_Main_internal_59 --> -240($fp) - # LOCAL local_main_at_Main_internal_62 --> -252($fp) - # LOCAL local_main_at_Main_internal_61 --> -248($fp) + sw $t0, -268($fp) + # LOCAL local_main_at_Main_internal_63 --> -256($fp) + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # LOCAL local_main_at_Main_internal_65 --> -264($fp) # Load pointers and SUB - lw $a0, -252($fp) - lw $a1, -248($fp) + lw $a0, -268($fp) + lw $a1, -264($fp) sub $a0, $a0, $a1 - sw $a0, -240($fp) - # IF_ZERO local_main_at_Main_internal_59 GOTO label_ERROR_366 - # IF_ZERO local_main_at_Main_internal_59 GOTO label_ERROR_366 - lw $t0, -240($fp) + sw $a0, -256($fp) + # IF_ZERO local_main_at_Main_internal_63 GOTO label_ERROR_366 + # IF_ZERO local_main_at_Main_internal_63 GOTO label_ERROR_366 + lw $t0, -256($fp) beq $t0, 0, label_ERROR_366 - # local_main_at_Main_internal_62 = TYPE_DISTANCE C + # local_main_at_Main_internal_66 = TYPE_DISTANCE C + # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) - # LOCAL local_main_at_Main_internal_58 --> -236($fp) # Load TDT pointer to type C la $t0, C__TDT - lw $t1, -236($fp) + lw $t1, -252($fp) addu $t0, $t0, $t1 # Save distance lw $t1, 0($t0) - sw $t1, -252($fp) - # LOCAL local_main_at_Main_internal_62 --> -252($fp) - # LOCAL local_main_at_Main_internal_61 --> -248($fp) + sw $t1, -268($fp) + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # LOCAL local_main_at_Main_internal_65 --> -264($fp) # Update min if 8 < 9 - lw $t0, -252($fp) - lw $t1, -248($fp) + lw $t0, -268($fp) + lw $t1, -264($fp) bgtu $t0, $t1, label_NEXT0_368 - # LOCAL local_main_at_Main_c_63 --> -256($fp) - # LOCAL local_main_at_Main_internal_57 --> -232($fp) - # local_main_at_Main_c_63 = local_main_at_Main_internal_57 - lw $t0, -232($fp) - sw $t0, -256($fp) - # LOCAL local_main_at_Main_internal_64 --> -260($fp) - # LOCAL local_main_at_Main_c_63 --> -256($fp) - # local_main_at_Main_internal_64 = local_main_at_Main_c_63 - lw $t0, -256($fp) - sw $t0, -260($fp) + # LOCAL local_main_at_Main_c_67 --> -272($fp) + # LOCAL local_main_at_Main_internal_61 --> -248($fp) + # local_main_at_Main_c_67 = local_main_at_Main_internal_61 + lw $t0, -248($fp) + sw $t0, -272($fp) + # LOCAL local_main_at_Main_internal_68 --> -276($fp) + # LOCAL local_main_at_Main_c_67 --> -272($fp) + # local_main_at_Main_internal_68 = local_main_at_Main_c_67 + lw $t0, -272($fp) + sw $t0, -276($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_66 --> -268($fp) - # LOCAL local_main_at_Main_c_63 --> -256($fp) - # local_main_at_Main_internal_66 = local_main_at_Main_c_63 - lw $t0, -256($fp) - sw $t0, -268($fp) + # LOCAL local_main_at_Main_internal_70 --> -284($fp) + # LOCAL local_main_at_Main_c_67 --> -272($fp) + # local_main_at_Main_internal_70 = local_main_at_Main_c_67 + lw $t0, -272($fp) + sw $t0, -284($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_66 --> -268($fp) - # LOCAL local_main_at_Main_internal_67 --> -272($fp) - # local_main_at_Main_internal_67 = VCALL local_main_at_Main_internal_66 value + # LOCAL local_main_at_Main_internal_70 --> -284($fp) + # LOCAL local_main_at_Main_internal_71 --> -288($fp) + # local_main_at_Main_internal_71 = VCALL local_main_at_Main_internal_70 value # Save new self pointer in $s1 - lw $s1, -268($fp) + lw $s1, -284($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -18142,21 +18151,21 @@ label_Not_min0_363: lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 - sw $v0, -272($fp) + sw $v0, -288($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_67 - # LOCAL local_main_at_Main_internal_67 --> -272($fp) - lw $t0, -272($fp) + # ARG local_main_at_Main_internal_71 + # LOCAL local_main_at_Main_internal_71 --> -288($fp) + lw $t0, -288($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_64 --> -260($fp) - # LOCAL local_main_at_Main_internal_65 --> -264($fp) - # local_main_at_Main_internal_65 = VCALL local_main_at_Main_internal_64 method6 + # LOCAL local_main_at_Main_internal_68 --> -276($fp) + # LOCAL local_main_at_Main_internal_69 --> -280($fp) + # local_main_at_Main_internal_69 = VCALL local_main_at_Main_internal_68 method6 # Save new self pointer in $s1 - lw $s1, -260($fp) + lw $s1, -276($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -18165,61 +18174,61 @@ label_Not_min0_363: lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 - sw $v0, -264($fp) + sw $v0, -280($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # - # LOCAL local_main_at_Main_internal_65 --> -264($fp) - lw $t0, -264($fp) + # LOCAL local_main_at_Main_internal_69 --> -280($fp) + lw $t0, -280($fp) sw $t0, 16($s1) - # LOCAL local_main_at_Main_internal_60 --> -244($fp) - # local_main_at_Main_internal_60 = + # LOCAL local_main_at_Main_internal_64 --> -260($fp) + # local_main_at_Main_internal_64 = # GOTO label_END_367 j label_END_367 label_NEXT0_368: - # local_main_at_Main_internal_62 = TYPE_DISTANCE A + # local_main_at_Main_internal_66 = TYPE_DISTANCE A + # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) - # LOCAL local_main_at_Main_internal_58 --> -236($fp) # Load TDT pointer to type A la $t0, A__TDT - lw $t1, -236($fp) + lw $t1, -252($fp) addu $t0, $t0, $t1 # Save distance lw $t1, 0($t0) - sw $t1, -252($fp) - # LOCAL local_main_at_Main_internal_62 --> -252($fp) - # LOCAL local_main_at_Main_internal_61 --> -248($fp) + sw $t1, -268($fp) + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # LOCAL local_main_at_Main_internal_65 --> -264($fp) # Update min if 8 < 9 - lw $t0, -252($fp) - lw $t1, -248($fp) + lw $t0, -268($fp) + lw $t1, -264($fp) bgtu $t0, $t1, label_NEXT1_369 - # LOCAL local_main_at_Main_a_68 --> -276($fp) - # LOCAL local_main_at_Main_internal_57 --> -232($fp) - # local_main_at_Main_a_68 = local_main_at_Main_internal_57 - lw $t0, -232($fp) - sw $t0, -276($fp) - # LOCAL local_main_at_Main_internal_69 --> -280($fp) - # LOCAL local_main_at_Main_a_68 --> -276($fp) - # local_main_at_Main_internal_69 = local_main_at_Main_a_68 - lw $t0, -276($fp) - sw $t0, -280($fp) + # LOCAL local_main_at_Main_a_72 --> -292($fp) + # LOCAL local_main_at_Main_internal_61 --> -248($fp) + # local_main_at_Main_a_72 = local_main_at_Main_internal_61 + lw $t0, -248($fp) + sw $t0, -292($fp) + # LOCAL local_main_at_Main_internal_73 --> -296($fp) + # LOCAL local_main_at_Main_a_72 --> -292($fp) + # local_main_at_Main_internal_73 = local_main_at_Main_a_72 + lw $t0, -292($fp) + sw $t0, -296($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_71 --> -288($fp) - # LOCAL local_main_at_Main_a_68 --> -276($fp) - # local_main_at_Main_internal_71 = local_main_at_Main_a_68 - lw $t0, -276($fp) - sw $t0, -288($fp) + # LOCAL local_main_at_Main_internal_75 --> -304($fp) + # LOCAL local_main_at_Main_a_72 --> -292($fp) + # local_main_at_Main_internal_75 = local_main_at_Main_a_72 + lw $t0, -292($fp) + sw $t0, -304($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_71 --> -288($fp) - # LOCAL local_main_at_Main_internal_72 --> -292($fp) - # local_main_at_Main_internal_72 = VCALL local_main_at_Main_internal_71 value + # LOCAL local_main_at_Main_internal_75 --> -304($fp) + # LOCAL local_main_at_Main_internal_76 --> -308($fp) + # local_main_at_Main_internal_76 = VCALL local_main_at_Main_internal_75 value # Save new self pointer in $s1 - lw $s1, -288($fp) + lw $s1, -304($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -18228,21 +18237,21 @@ label_NEXT0_368: lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 - sw $v0, -292($fp) + sw $v0, -308($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_72 - # LOCAL local_main_at_Main_internal_72 --> -292($fp) - lw $t0, -292($fp) + # ARG local_main_at_Main_internal_76 + # LOCAL local_main_at_Main_internal_76 --> -308($fp) + lw $t0, -308($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_69 --> -280($fp) - # LOCAL local_main_at_Main_internal_70 --> -284($fp) - # local_main_at_Main_internal_70 = VCALL local_main_at_Main_internal_69 method3 + # LOCAL local_main_at_Main_internal_73 --> -296($fp) + # LOCAL local_main_at_Main_internal_74 --> -300($fp) + # local_main_at_Main_internal_74 = VCALL local_main_at_Main_internal_73 method3 # Save new self pointer in $s1 - lw $s1, -280($fp) + lw $s1, -296($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -18251,52 +18260,52 @@ label_NEXT0_368: lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 - sw $v0, -284($fp) + sw $v0, -300($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # - # LOCAL local_main_at_Main_internal_70 --> -284($fp) - lw $t0, -284($fp) + # LOCAL local_main_at_Main_internal_74 --> -300($fp) + lw $t0, -300($fp) sw $t0, 16($s1) - # LOCAL local_main_at_Main_internal_60 --> -244($fp) - # local_main_at_Main_internal_60 = + # LOCAL local_main_at_Main_internal_64 --> -260($fp) + # local_main_at_Main_internal_64 = # GOTO label_END_367 j label_END_367 label_NEXT1_369: - # local_main_at_Main_internal_62 = TYPE_DISTANCE Object + # local_main_at_Main_internal_66 = TYPE_DISTANCE Object + # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) - # LOCAL local_main_at_Main_internal_58 --> -236($fp) # Load TDT pointer to type Object la $t0, Object__TDT - lw $t1, -236($fp) + lw $t1, -252($fp) addu $t0, $t0, $t1 # Save distance lw $t1, 0($t0) - sw $t1, -252($fp) - # LOCAL local_main_at_Main_internal_62 --> -252($fp) - # LOCAL local_main_at_Main_internal_61 --> -248($fp) + sw $t1, -268($fp) + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # LOCAL local_main_at_Main_internal_65 --> -264($fp) # Update min if 8 < 9 - lw $t0, -252($fp) - lw $t1, -248($fp) + lw $t0, -268($fp) + lw $t1, -264($fp) bgtu $t0, $t1, label_NEXT2_370 - # LOCAL local_main_at_Main_o_73 --> -296($fp) - # LOCAL local_main_at_Main_internal_57 --> -232($fp) - # local_main_at_Main_o_73 = local_main_at_Main_internal_57 - lw $t0, -232($fp) - sw $t0, -296($fp) - # LOCAL local_main_at_Main_internal_76 --> -308($fp) - # local_main_at_Main_internal_76 = SELF - sw $s1, -308($fp) - # LOCAL local_main_at_Main_internal_74 --> -300($fp) - # LOCAL local_main_at_Main_internal_76 --> -308($fp) - # local_main_at_Main_internal_74 = local_main_at_Main_internal_76 - lw $t0, -308($fp) - sw $t0, -300($fp) + # LOCAL local_main_at_Main_o_77 --> -312($fp) + # LOCAL local_main_at_Main_internal_61 --> -248($fp) + # local_main_at_Main_o_77 = local_main_at_Main_internal_61 + lw $t0, -248($fp) + sw $t0, -312($fp) + # LOCAL local_main_at_Main_internal_80 --> -324($fp) + # local_main_at_Main_internal_80 = SELF + sw $s1, -324($fp) + # LOCAL local_main_at_Main_internal_78 --> -316($fp) + # LOCAL local_main_at_Main_internal_80 --> -324($fp) + # local_main_at_Main_internal_78 = local_main_at_Main_internal_80 + lw $t0, -324($fp) + sw $t0, -316($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_77 --> -312($fp) + # LOCAL local_main_at_Main_internal_81 --> -328($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -18313,18 +18322,18 @@ label_NEXT1_369: sw $t0, 12($v0) li $t0, 7 sw $t0, 16($v0) - sw $v0, -312($fp) - # ARG local_main_at_Main_internal_77 - # LOCAL local_main_at_Main_internal_77 --> -312($fp) - lw $t0, -312($fp) + sw $v0, -328($fp) + # ARG local_main_at_Main_internal_81 + # LOCAL local_main_at_Main_internal_81 --> -328($fp) + lw $t0, -328($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_74 --> -300($fp) - # LOCAL local_main_at_Main_internal_75 --> -304($fp) - # local_main_at_Main_internal_75 = VCALL local_main_at_Main_internal_74 out_string + # LOCAL local_main_at_Main_internal_78 --> -316($fp) + # LOCAL local_main_at_Main_internal_79 --> -320($fp) + # local_main_at_Main_internal_79 = VCALL local_main_at_Main_internal_78 out_string # Save new self pointer in $s1 - lw $s1, -300($fp) + lw $s1, -316($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -18333,26 +18342,26 @@ label_NEXT1_369: lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 - sw $v0, -304($fp) + sw $v0, -320($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_80 --> -324($fp) - # local_main_at_Main_internal_80 = SELF - sw $s1, -324($fp) - # LOCAL local_main_at_Main_internal_78 --> -316($fp) - # LOCAL local_main_at_Main_internal_80 --> -324($fp) - # local_main_at_Main_internal_78 = local_main_at_Main_internal_80 - lw $t0, -324($fp) - sw $t0, -316($fp) + # LOCAL local_main_at_Main_internal_84 --> -340($fp) + # local_main_at_Main_internal_84 = SELF + sw $s1, -340($fp) + # LOCAL local_main_at_Main_internal_82 --> -332($fp) + # LOCAL local_main_at_Main_internal_84 --> -340($fp) + # local_main_at_Main_internal_82 = local_main_at_Main_internal_84 + lw $t0, -340($fp) + sw $t0, -332($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_78 --> -316($fp) - # LOCAL local_main_at_Main_internal_79 --> -320($fp) - # local_main_at_Main_internal_79 = VCALL local_main_at_Main_internal_78 abort + # LOCAL local_main_at_Main_internal_82 --> -332($fp) + # LOCAL local_main_at_Main_internal_83 --> -336($fp) + # local_main_at_Main_internal_83 = VCALL local_main_at_Main_internal_82 abort # Save new self pointer in $s1 - lw $s1, -316($fp) + lw $s1, -332($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -18361,11 +18370,11 @@ label_NEXT1_369: lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 - sw $v0, -320($fp) + sw $v0, -336($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_81 --> -328($fp) + # LOCAL local_main_at_Main_internal_85 --> -344($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -18395,24 +18404,24 @@ label_NEXT1_369: sw $t0, 8($v0) li $t0, 0 sw $t0, 12($v0) - sw $v0, -328($fp) - # LOCAL local_main_at_Main_internal_60 --> -244($fp) - # LOCAL local_main_at_Main_internal_81 --> -328($fp) - # local_main_at_Main_internal_60 = local_main_at_Main_internal_81 - lw $t0, -328($fp) - sw $t0, -244($fp) + sw $v0, -344($fp) + # LOCAL local_main_at_Main_internal_64 --> -260($fp) + # LOCAL local_main_at_Main_internal_85 --> -344($fp) + # local_main_at_Main_internal_64 = local_main_at_Main_internal_85 + lw $t0, -344($fp) + sw $t0, -260($fp) # GOTO label_END_367 j label_END_367 label_NEXT2_370: label_ERROR_366: - # LOCAL local_main_at_Main_internal_57 --> -232($fp) + # LOCAL local_main_at_Main_internal_61 --> -248($fp) lw $t0, 0($s1) - sw $t0, -232($fp) - # LOCAL local_main_at_Main_internal_57 --> -232($fp) + sw $t0, -248($fp) + # LOCAL local_main_at_Main_internal_61 --> -248($fp) la $a0, data_1 li $v0, 4 syscall - lw $a0, -232($fp) + lw $a0, -248($fp) li $v0, 4 syscall la $a0, data_2 @@ -18421,19 +18430,19 @@ label_NEXT2_370: li $v0, 10 syscall label_END_367: -# LOCAL local_main_at_Main_internal_52 --> -212($fp) -# LOCAL local_main_at_Main_internal_60 --> -244($fp) -# local_main_at_Main_internal_52 = local_main_at_Main_internal_60 -lw $t0, -244($fp) -sw $t0, -212($fp) +# LOCAL local_main_at_Main_internal_56 --> -228($fp) +# LOCAL local_main_at_Main_internal_64 --> -260($fp) +# local_main_at_Main_internal_56 = local_main_at_Main_internal_64 +lw $t0, -260($fp) +sw $t0, -228($fp) # GOTO label_ENDIF_354 j label_ENDIF_354 label_FALSEIF_353: - # local_main_at_Main_internal_86 = GETATTRIBUTE char Main - # LOCAL local_main_at_Main_internal_86 --> -348($fp) + # local_main_at_Main_internal_90 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_90 --> -364($fp) lw $t0, 12($s1) - sw $t0, -348($fp) - # LOCAL local_main_at_Main_internal_87 --> -352($fp) + sw $t0, -364($fp) + # LOCAL local_main_at_Main_internal_91 --> -368($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -18450,111 +18459,111 @@ label_FALSEIF_353: sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) - sw $v0, -352($fp) - # IF_ZERO local_main_at_Main_internal_86 GOTO label_FALSE_373 - # IF_ZERO local_main_at_Main_internal_86 GOTO label_FALSE_373 - lw $t0, -348($fp) + sw $v0, -368($fp) + # IF_ZERO local_main_at_Main_internal_90 GOTO label_FALSE_373 + # IF_ZERO local_main_at_Main_internal_90 GOTO label_FALSE_373 + lw $t0, -364($fp) beq $t0, 0, label_FALSE_373 - # IF_ZERO local_main_at_Main_internal_87 GOTO label_FALSE_373 - # IF_ZERO local_main_at_Main_internal_87 GOTO label_FALSE_373 - lw $t0, -352($fp) + # IF_ZERO local_main_at_Main_internal_91 GOTO label_FALSE_373 + # IF_ZERO local_main_at_Main_internal_91 GOTO label_FALSE_373 + lw $t0, -368($fp) beq $t0, 0, label_FALSE_373 - # LOCAL local_main_at_Main_internal_85 --> -344($fp) - # LOCAL local_main_at_Main_internal_86 --> -348($fp) - # Comparing -348($fp) type with String + # LOCAL local_main_at_Main_internal_89 --> -360($fp) + # LOCAL local_main_at_Main_internal_90 --> -364($fp) + # Comparing -364($fp) type with String la $v0, String - lw $a0, -348($fp) + lw $a0, -364($fp) lw $a0, 0($a0) sub $a0, $a0, $v0 - sw $a0, -344($fp) - # IF_ZERO local_main_at_Main_internal_85 GOTO label_COMPARE_STRING_376 - # IF_ZERO local_main_at_Main_internal_85 GOTO label_COMPARE_STRING_376 - lw $t0, -344($fp) + sw $a0, -360($fp) + # IF_ZERO local_main_at_Main_internal_89 GOTO label_COMPARE_STRING_376 + # IF_ZERO local_main_at_Main_internal_89 GOTO label_COMPARE_STRING_376 + lw $t0, -360($fp) beq $t0, 0, label_COMPARE_STRING_376 - # LOCAL local_main_at_Main_internal_85 --> -344($fp) - # LOCAL local_main_at_Main_internal_86 --> -348($fp) - # Comparing -348($fp) type with Bool + # LOCAL local_main_at_Main_internal_89 --> -360($fp) + # LOCAL local_main_at_Main_internal_90 --> -364($fp) + # Comparing -364($fp) type with Bool la $v0, Bool - lw $a0, -348($fp) + lw $a0, -364($fp) lw $a0, 0($a0) lw $a0, 12($a0) sub $a0, $a0, $v0 - sw $a0, -344($fp) - # IF_ZERO local_main_at_Main_internal_85 GOTO label_COMPARE_BY_VALUE_377 - # IF_ZERO local_main_at_Main_internal_85 GOTO label_COMPARE_BY_VALUE_377 - lw $t0, -344($fp) + sw $a0, -360($fp) + # IF_ZERO local_main_at_Main_internal_89 GOTO label_COMPARE_BY_VALUE_377 + # IF_ZERO local_main_at_Main_internal_89 GOTO label_COMPARE_BY_VALUE_377 + lw $t0, -360($fp) beq $t0, 0, label_COMPARE_BY_VALUE_377 - # LOCAL local_main_at_Main_internal_85 --> -344($fp) - # LOCAL local_main_at_Main_internal_86 --> -348($fp) - # Comparing -348($fp) type with Int + # LOCAL local_main_at_Main_internal_89 --> -360($fp) + # LOCAL local_main_at_Main_internal_90 --> -364($fp) + # Comparing -364($fp) type with Int la $v0, Int - lw $a0, -348($fp) + lw $a0, -364($fp) lw $a0, 0($a0) lw $a0, 12($a0) sub $a0, $a0, $v0 - sw $a0, -344($fp) - # IF_ZERO local_main_at_Main_internal_85 GOTO label_COMPARE_BY_VALUE_377 - # IF_ZERO local_main_at_Main_internal_85 GOTO label_COMPARE_BY_VALUE_377 - lw $t0, -344($fp) + sw $a0, -360($fp) + # IF_ZERO local_main_at_Main_internal_89 GOTO label_COMPARE_BY_VALUE_377 + # IF_ZERO local_main_at_Main_internal_89 GOTO label_COMPARE_BY_VALUE_377 + lw $t0, -360($fp) beq $t0, 0, label_COMPARE_BY_VALUE_377 - # LOCAL local_main_at_Main_internal_85 --> -344($fp) - # LOCAL local_main_at_Main_internal_86 --> -348($fp) - # LOCAL local_main_at_Main_internal_87 --> -352($fp) + # LOCAL local_main_at_Main_internal_89 --> -360($fp) + # LOCAL local_main_at_Main_internal_90 --> -364($fp) + # LOCAL local_main_at_Main_internal_91 --> -368($fp) # Load pointers and SUB - lw $a0, -348($fp) - lw $a1, -352($fp) + lw $a0, -364($fp) + lw $a1, -368($fp) sub $a0, $a0, $a1 - sw $a0, -344($fp) - # IF_ZERO local_main_at_Main_internal_85 GOTO label_TRUE_374 - # IF_ZERO local_main_at_Main_internal_85 GOTO label_TRUE_374 - lw $t0, -344($fp) + sw $a0, -360($fp) + # IF_ZERO local_main_at_Main_internal_89 GOTO label_TRUE_374 + # IF_ZERO local_main_at_Main_internal_89 GOTO label_TRUE_374 + lw $t0, -360($fp) beq $t0, 0, label_TRUE_374 # GOTO label_FALSE_373 j label_FALSE_373 label_COMPARE_BY_VALUE_377: - # LOCAL local_main_at_Main_internal_85 --> -344($fp) - # LOCAL local_main_at_Main_internal_86 --> -348($fp) - # LOCAL local_main_at_Main_internal_87 --> -352($fp) - lw $a0, -348($fp) - lw $a1, -352($fp) + # LOCAL local_main_at_Main_internal_89 --> -360($fp) + # LOCAL local_main_at_Main_internal_90 --> -364($fp) + # LOCAL local_main_at_Main_internal_91 --> -368($fp) + lw $a0, -364($fp) + lw $a1, -368($fp) # Load values lw $a0, 12($a0) lw $a1, 12($a1) # SUB and store sub $a0, $a0, $a1 - sw $a0, -344($fp) - # IF_ZERO local_main_at_Main_internal_85 GOTO label_TRUE_374 - # IF_ZERO local_main_at_Main_internal_85 GOTO label_TRUE_374 - lw $t0, -344($fp) + sw $a0, -360($fp) + # IF_ZERO local_main_at_Main_internal_89 GOTO label_TRUE_374 + # IF_ZERO local_main_at_Main_internal_89 GOTO label_TRUE_374 + lw $t0, -360($fp) beq $t0, 0, label_TRUE_374 # GOTO label_FALSE_373 j label_FALSE_373 label_COMPARE_STRING_376: - # LOCAL local_main_at_Main_internal_85 --> -344($fp) - # LOCAL local_main_at_Main_internal_86 --> -348($fp) - # LOCAL local_main_at_Main_internal_87 --> -352($fp) + # LOCAL local_main_at_Main_internal_89 --> -360($fp) + # LOCAL local_main_at_Main_internal_90 --> -364($fp) + # LOCAL local_main_at_Main_internal_91 --> -368($fp) # Load strings for comparison - lw $v0, -348($fp) - lw $v1, -352($fp) + lw $v0, -364($fp) + lw $v1, -368($fp) # Compare lengths lw $v0, 16($v0) lw $v1, 16($v1) sub $v0, $v0, $v1 - sw $v0, -344($fp) - # IF_ZERO local_main_at_Main_internal_85 GOTO label_CONTINUE_378 - # IF_ZERO local_main_at_Main_internal_85 GOTO label_CONTINUE_378 - lw $t0, -344($fp) + sw $v0, -360($fp) + # IF_ZERO local_main_at_Main_internal_89 GOTO label_CONTINUE_378 + # IF_ZERO local_main_at_Main_internal_89 GOTO label_CONTINUE_378 + lw $t0, -360($fp) beq $t0, 0, label_CONTINUE_378 # GOTO label_FALSE_373 j label_FALSE_373 label_CONTINUE_378: - # LOCAL local_main_at_Main_internal_85 --> -344($fp) - # LOCAL local_main_at_Main_internal_86 --> -348($fp) - # LOCAL local_main_at_Main_internal_87 --> -352($fp) + # LOCAL local_main_at_Main_internal_89 --> -360($fp) + # LOCAL local_main_at_Main_internal_90 --> -364($fp) + # LOCAL local_main_at_Main_internal_91 --> -368($fp) move $a2, $zero # Load strings for comparison - lw $v0, -348($fp) - lw $v1, -352($fp) + lw $v0, -364($fp) + lw $v1, -368($fp) # Load strings pointers lw $v0, 12($v0) lw $v1, 12($v1) @@ -18574,13 +18583,13 @@ label_FALSEIF_353: li $a2, 1 label_WHILE_STR_COMP_END_380: # Store result - sw $a2, -344($fp) - # IF_ZERO local_main_at_Main_internal_85 GOTO label_TRUE_374 - # IF_ZERO local_main_at_Main_internal_85 GOTO label_TRUE_374 - lw $t0, -344($fp) + sw $a2, -360($fp) + # IF_ZERO local_main_at_Main_internal_89 GOTO label_TRUE_374 + # IF_ZERO local_main_at_Main_internal_89 GOTO label_TRUE_374 + lw $t0, -360($fp) beq $t0, 0, label_TRUE_374 label_FALSE_373: - # LOCAL local_main_at_Main_internal_84 --> -340($fp) + # LOCAL local_main_at_Main_internal_88 --> -356($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -18610,11 +18619,11 @@ label_FALSEIF_353: sw $t0, 8($v0) li $t0, 0 sw $t0, 12($v0) - sw $v0, -340($fp) + sw $v0, -356($fp) # GOTO label_END_375 j label_END_375 label_TRUE_374: - # LOCAL local_main_at_Main_internal_84 --> -340($fp) + # LOCAL local_main_at_Main_internal_88 --> -356($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -18644,20 +18653,20 @@ label_TRUE_374: sw $t0, 8($v0) li $t0, 1 sw $t0, 12($v0) - sw $v0, -340($fp) + sw $v0, -356($fp) label_END_375: -# LOCAL local_main_at_Main_internal_82 --> -332($fp) -# LOCAL local_main_at_Main_internal_84 --> -340($fp) -# Obtain value from -340($fp) -lw $v0, -340($fp) +# LOCAL local_main_at_Main_internal_86 --> -348($fp) +# LOCAL local_main_at_Main_internal_88 --> -356($fp) +# Obtain value from -356($fp) +lw $v0, -356($fp) lw $v0, 12($v0) -sw $v0, -332($fp) -# IF_ZERO local_main_at_Main_internal_82 GOTO label_FALSEIF_371 -# IF_ZERO local_main_at_Main_internal_82 GOTO label_FALSEIF_371 -lw $t0, -332($fp) +sw $v0, -348($fp) +# IF_ZERO local_main_at_Main_internal_86 GOTO label_FALSEIF_371 +# IF_ZERO local_main_at_Main_internal_86 GOTO label_FALSEIF_371 +lw $t0, -348($fp) beq $t0, 0, label_FALSEIF_371 -# LOCAL local_main_at_Main_internal_90 --> -364($fp) -# local_main_at_Main_internal_90 = ALLOCATE A +# LOCAL local_main_at_Main_internal_94 --> -380($fp) +# local_main_at_Main_internal_94 = ALLOCATE A # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -18701,31 +18710,31 @@ sw $v0, 12($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -sw $t1, -364($fp) -# LOCAL local_main_at_Main_internal_88 --> -356($fp) -# LOCAL local_main_at_Main_internal_90 --> -364($fp) -# local_main_at_Main_internal_88 = local_main_at_Main_internal_90 -lw $t0, -364($fp) -sw $t0, -356($fp) +sw $t1, -380($fp) +# LOCAL local_main_at_Main_internal_92 --> -372($fp) +# LOCAL local_main_at_Main_internal_94 --> -380($fp) +# local_main_at_Main_internal_92 = local_main_at_Main_internal_94 +lw $t0, -380($fp) +sw $t0, -372($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_93 --> -376($fp) -# local_main_at_Main_internal_93 = SELF -sw $s1, -376($fp) -# LOCAL local_main_at_Main_internal_91 --> -368($fp) -# LOCAL local_main_at_Main_internal_93 --> -376($fp) -# local_main_at_Main_internal_91 = local_main_at_Main_internal_93 -lw $t0, -376($fp) -sw $t0, -368($fp) +# LOCAL local_main_at_Main_internal_97 --> -392($fp) +# local_main_at_Main_internal_97 = SELF +sw $s1, -392($fp) +# LOCAL local_main_at_Main_internal_95 --> -384($fp) +# LOCAL local_main_at_Main_internal_97 --> -392($fp) +# local_main_at_Main_internal_95 = local_main_at_Main_internal_97 +lw $t0, -392($fp) +sw $t0, -384($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_91 --> -368($fp) -# LOCAL local_main_at_Main_internal_92 --> -372($fp) -# local_main_at_Main_internal_92 = VCALL local_main_at_Main_internal_91 get_int +# LOCAL local_main_at_Main_internal_95 --> -384($fp) +# LOCAL local_main_at_Main_internal_96 --> -388($fp) +# local_main_at_Main_internal_96 = VCALL local_main_at_Main_internal_95 get_int # Save new self pointer in $s1 -lw $s1, -368($fp) +lw $s1, -384($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -18734,21 +18743,21 @@ lw $t0, 0($t0) lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -372($fp) +sw $v0, -388($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_92 -# LOCAL local_main_at_Main_internal_92 --> -372($fp) -lw $t0, -372($fp) +# ARG local_main_at_Main_internal_96 +# LOCAL local_main_at_Main_internal_96 --> -388($fp) +lw $t0, -388($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_88 --> -356($fp) -# LOCAL local_main_at_Main_internal_89 --> -360($fp) -# local_main_at_Main_internal_89 = VCALL local_main_at_Main_internal_88 set_var +# LOCAL local_main_at_Main_internal_92 --> -372($fp) +# LOCAL local_main_at_Main_internal_93 --> -376($fp) +# local_main_at_Main_internal_93 = VCALL local_main_at_Main_internal_92 set_var # Save new self pointer in $s1 -lw $s1, -356($fp) +lw $s1, -372($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -18757,16 +18766,16 @@ lw $t0, 0($t0) lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -360($fp) +sw $v0, -376($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # -# LOCAL local_main_at_Main_internal_89 --> -360($fp) -lw $t0, -360($fp) +# LOCAL local_main_at_Main_internal_93 --> -376($fp) +lw $t0, -376($fp) sw $t0, 20($s1) -# LOCAL local_main_at_Main_internal_96 --> -388($fp) -# local_main_at_Main_internal_96 = ALLOCATE D +# LOCAL local_main_at_Main_internal_100 --> -404($fp) +# local_main_at_Main_internal_100 = ALLOCATE D # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -18810,32 +18819,32 @@ sw $v0, 12($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -sw $t1, -388($fp) -# LOCAL local_main_at_Main_internal_94 --> -380($fp) -# LOCAL local_main_at_Main_internal_96 --> -388($fp) -# local_main_at_Main_internal_94 = local_main_at_Main_internal_96 -lw $t0, -388($fp) -sw $t0, -380($fp) +sw $t1, -404($fp) +# LOCAL local_main_at_Main_internal_98 --> -396($fp) +# LOCAL local_main_at_Main_internal_100 --> -404($fp) +# local_main_at_Main_internal_98 = local_main_at_Main_internal_100 +lw $t0, -404($fp) +sw $t0, -396($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# local_main_at_Main_internal_99 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_99 --> -400($fp) +# local_main_at_Main_internal_103 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_103 --> -416($fp) lw $t0, 16($s1) -sw $t0, -400($fp) -# LOCAL local_main_at_Main_internal_97 --> -392($fp) -# LOCAL local_main_at_Main_internal_99 --> -400($fp) -# local_main_at_Main_internal_97 = local_main_at_Main_internal_99 -lw $t0, -400($fp) -sw $t0, -392($fp) +sw $t0, -416($fp) +# LOCAL local_main_at_Main_internal_101 --> -408($fp) +# LOCAL local_main_at_Main_internal_103 --> -416($fp) +# local_main_at_Main_internal_101 = local_main_at_Main_internal_103 +lw $t0, -416($fp) +sw $t0, -408($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_97 --> -392($fp) -# LOCAL local_main_at_Main_internal_98 --> -396($fp) -# local_main_at_Main_internal_98 = VCALL local_main_at_Main_internal_97 value +# LOCAL local_main_at_Main_internal_101 --> -408($fp) +# LOCAL local_main_at_Main_internal_102 --> -412($fp) +# local_main_at_Main_internal_102 = VCALL local_main_at_Main_internal_101 value # Save new self pointer in $s1 -lw $s1, -392($fp) +lw $s1, -408($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -18844,33 +18853,33 @@ lw $t0, 0($t0) lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -396($fp) +sw $v0, -412($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_98 -# LOCAL local_main_at_Main_internal_98 --> -396($fp) -lw $t0, -396($fp) +# ARG local_main_at_Main_internal_102 +# LOCAL local_main_at_Main_internal_102 --> -412($fp) +lw $t0, -412($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) -# local_main_at_Main_internal_102 = GETATTRIBUTE a_var Main -# LOCAL local_main_at_Main_internal_102 --> -412($fp) +# local_main_at_Main_internal_106 = GETATTRIBUTE a_var Main +# LOCAL local_main_at_Main_internal_106 --> -428($fp) lw $t0, 20($s1) -sw $t0, -412($fp) -# LOCAL local_main_at_Main_internal_100 --> -404($fp) -# LOCAL local_main_at_Main_internal_102 --> -412($fp) -# local_main_at_Main_internal_100 = local_main_at_Main_internal_102 -lw $t0, -412($fp) -sw $t0, -404($fp) +sw $t0, -428($fp) +# LOCAL local_main_at_Main_internal_104 --> -420($fp) +# LOCAL local_main_at_Main_internal_106 --> -428($fp) +# local_main_at_Main_internal_104 = local_main_at_Main_internal_106 +lw $t0, -428($fp) +sw $t0, -420($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_100 --> -404($fp) -# LOCAL local_main_at_Main_internal_101 --> -408($fp) -# local_main_at_Main_internal_101 = VCALL local_main_at_Main_internal_100 value +# LOCAL local_main_at_Main_internal_104 --> -420($fp) +# LOCAL local_main_at_Main_internal_105 --> -424($fp) +# local_main_at_Main_internal_105 = VCALL local_main_at_Main_internal_104 value # Save new self pointer in $s1 -lw $s1, -404($fp) +lw $s1, -420($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -18879,21 +18888,21 @@ lw $t0, 0($t0) lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -408($fp) +sw $v0, -424($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_101 -# LOCAL local_main_at_Main_internal_101 --> -408($fp) -lw $t0, -408($fp) +# ARG local_main_at_Main_internal_105 +# LOCAL local_main_at_Main_internal_105 --> -424($fp) +lw $t0, -424($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_94 --> -380($fp) -# LOCAL local_main_at_Main_internal_95 --> -384($fp) -# local_main_at_Main_internal_95 = VCALL local_main_at_Main_internal_94 method4 +# LOCAL local_main_at_Main_internal_98 --> -396($fp) +# LOCAL local_main_at_Main_internal_99 --> -400($fp) +# local_main_at_Main_internal_99 = VCALL local_main_at_Main_internal_98 method4 # Save new self pointer in $s1 -lw $s1, -380($fp) +lw $s1, -396($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -18902,24 +18911,24 @@ lw $t0, 0($t0) lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -384($fp) +sw $v0, -400($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # -# LOCAL local_main_at_Main_internal_95 --> -384($fp) -lw $t0, -384($fp) +# LOCAL local_main_at_Main_internal_99 --> -400($fp) +lw $t0, -400($fp) sw $t0, 16($s1) -# LOCAL local_main_at_Main_internal_83 --> -336($fp) -# local_main_at_Main_internal_83 = +# LOCAL local_main_at_Main_internal_87 --> -352($fp) +# local_main_at_Main_internal_87 = # GOTO label_ENDIF_372 j label_ENDIF_372 label_FALSEIF_371: - # local_main_at_Main_internal_107 = GETATTRIBUTE char Main - # LOCAL local_main_at_Main_internal_107 --> -432($fp) + # local_main_at_Main_internal_111 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_111 --> -448($fp) lw $t0, 12($s1) - sw $t0, -432($fp) - # LOCAL local_main_at_Main_internal_108 --> -436($fp) + sw $t0, -448($fp) + # LOCAL local_main_at_Main_internal_112 --> -452($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -18936,111 +18945,111 @@ label_FALSEIF_371: sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) - sw $v0, -436($fp) - # IF_ZERO local_main_at_Main_internal_107 GOTO label_FALSE_383 - # IF_ZERO local_main_at_Main_internal_107 GOTO label_FALSE_383 - lw $t0, -432($fp) + sw $v0, -452($fp) + # IF_ZERO local_main_at_Main_internal_111 GOTO label_FALSE_383 + # IF_ZERO local_main_at_Main_internal_111 GOTO label_FALSE_383 + lw $t0, -448($fp) beq $t0, 0, label_FALSE_383 - # IF_ZERO local_main_at_Main_internal_108 GOTO label_FALSE_383 - # IF_ZERO local_main_at_Main_internal_108 GOTO label_FALSE_383 - lw $t0, -436($fp) + # IF_ZERO local_main_at_Main_internal_112 GOTO label_FALSE_383 + # IF_ZERO local_main_at_Main_internal_112 GOTO label_FALSE_383 + lw $t0, -452($fp) beq $t0, 0, label_FALSE_383 - # LOCAL local_main_at_Main_internal_106 --> -428($fp) - # LOCAL local_main_at_Main_internal_107 --> -432($fp) - # Comparing -432($fp) type with String + # LOCAL local_main_at_Main_internal_110 --> -444($fp) + # LOCAL local_main_at_Main_internal_111 --> -448($fp) + # Comparing -448($fp) type with String la $v0, String - lw $a0, -432($fp) + lw $a0, -448($fp) lw $a0, 0($a0) sub $a0, $a0, $v0 - sw $a0, -428($fp) - # IF_ZERO local_main_at_Main_internal_106 GOTO label_COMPARE_STRING_386 - # IF_ZERO local_main_at_Main_internal_106 GOTO label_COMPARE_STRING_386 - lw $t0, -428($fp) + sw $a0, -444($fp) + # IF_ZERO local_main_at_Main_internal_110 GOTO label_COMPARE_STRING_386 + # IF_ZERO local_main_at_Main_internal_110 GOTO label_COMPARE_STRING_386 + lw $t0, -444($fp) beq $t0, 0, label_COMPARE_STRING_386 - # LOCAL local_main_at_Main_internal_106 --> -428($fp) - # LOCAL local_main_at_Main_internal_107 --> -432($fp) - # Comparing -432($fp) type with Bool + # LOCAL local_main_at_Main_internal_110 --> -444($fp) + # LOCAL local_main_at_Main_internal_111 --> -448($fp) + # Comparing -448($fp) type with Bool la $v0, Bool - lw $a0, -432($fp) + lw $a0, -448($fp) lw $a0, 0($a0) lw $a0, 12($a0) sub $a0, $a0, $v0 - sw $a0, -428($fp) - # IF_ZERO local_main_at_Main_internal_106 GOTO label_COMPARE_BY_VALUE_387 - # IF_ZERO local_main_at_Main_internal_106 GOTO label_COMPARE_BY_VALUE_387 - lw $t0, -428($fp) + sw $a0, -444($fp) + # IF_ZERO local_main_at_Main_internal_110 GOTO label_COMPARE_BY_VALUE_387 + # IF_ZERO local_main_at_Main_internal_110 GOTO label_COMPARE_BY_VALUE_387 + lw $t0, -444($fp) beq $t0, 0, label_COMPARE_BY_VALUE_387 - # LOCAL local_main_at_Main_internal_106 --> -428($fp) - # LOCAL local_main_at_Main_internal_107 --> -432($fp) - # Comparing -432($fp) type with Int + # LOCAL local_main_at_Main_internal_110 --> -444($fp) + # LOCAL local_main_at_Main_internal_111 --> -448($fp) + # Comparing -448($fp) type with Int la $v0, Int - lw $a0, -432($fp) + lw $a0, -448($fp) lw $a0, 0($a0) lw $a0, 12($a0) sub $a0, $a0, $v0 - sw $a0, -428($fp) - # IF_ZERO local_main_at_Main_internal_106 GOTO label_COMPARE_BY_VALUE_387 - # IF_ZERO local_main_at_Main_internal_106 GOTO label_COMPARE_BY_VALUE_387 - lw $t0, -428($fp) + sw $a0, -444($fp) + # IF_ZERO local_main_at_Main_internal_110 GOTO label_COMPARE_BY_VALUE_387 + # IF_ZERO local_main_at_Main_internal_110 GOTO label_COMPARE_BY_VALUE_387 + lw $t0, -444($fp) beq $t0, 0, label_COMPARE_BY_VALUE_387 - # LOCAL local_main_at_Main_internal_106 --> -428($fp) - # LOCAL local_main_at_Main_internal_107 --> -432($fp) - # LOCAL local_main_at_Main_internal_108 --> -436($fp) + # LOCAL local_main_at_Main_internal_110 --> -444($fp) + # LOCAL local_main_at_Main_internal_111 --> -448($fp) + # LOCAL local_main_at_Main_internal_112 --> -452($fp) # Load pointers and SUB - lw $a0, -432($fp) - lw $a1, -436($fp) + lw $a0, -448($fp) + lw $a1, -452($fp) sub $a0, $a0, $a1 - sw $a0, -428($fp) - # IF_ZERO local_main_at_Main_internal_106 GOTO label_TRUE_384 - # IF_ZERO local_main_at_Main_internal_106 GOTO label_TRUE_384 - lw $t0, -428($fp) + sw $a0, -444($fp) + # IF_ZERO local_main_at_Main_internal_110 GOTO label_TRUE_384 + # IF_ZERO local_main_at_Main_internal_110 GOTO label_TRUE_384 + lw $t0, -444($fp) beq $t0, 0, label_TRUE_384 # GOTO label_FALSE_383 j label_FALSE_383 label_COMPARE_BY_VALUE_387: - # LOCAL local_main_at_Main_internal_106 --> -428($fp) - # LOCAL local_main_at_Main_internal_107 --> -432($fp) - # LOCAL local_main_at_Main_internal_108 --> -436($fp) - lw $a0, -432($fp) - lw $a1, -436($fp) + # LOCAL local_main_at_Main_internal_110 --> -444($fp) + # LOCAL local_main_at_Main_internal_111 --> -448($fp) + # LOCAL local_main_at_Main_internal_112 --> -452($fp) + lw $a0, -448($fp) + lw $a1, -452($fp) # Load values lw $a0, 12($a0) lw $a1, 12($a1) # SUB and store sub $a0, $a0, $a1 - sw $a0, -428($fp) - # IF_ZERO local_main_at_Main_internal_106 GOTO label_TRUE_384 - # IF_ZERO local_main_at_Main_internal_106 GOTO label_TRUE_384 - lw $t0, -428($fp) + sw $a0, -444($fp) + # IF_ZERO local_main_at_Main_internal_110 GOTO label_TRUE_384 + # IF_ZERO local_main_at_Main_internal_110 GOTO label_TRUE_384 + lw $t0, -444($fp) beq $t0, 0, label_TRUE_384 # GOTO label_FALSE_383 j label_FALSE_383 label_COMPARE_STRING_386: - # LOCAL local_main_at_Main_internal_106 --> -428($fp) - # LOCAL local_main_at_Main_internal_107 --> -432($fp) - # LOCAL local_main_at_Main_internal_108 --> -436($fp) + # LOCAL local_main_at_Main_internal_110 --> -444($fp) + # LOCAL local_main_at_Main_internal_111 --> -448($fp) + # LOCAL local_main_at_Main_internal_112 --> -452($fp) # Load strings for comparison - lw $v0, -432($fp) - lw $v1, -436($fp) + lw $v0, -448($fp) + lw $v1, -452($fp) # Compare lengths lw $v0, 16($v0) lw $v1, 16($v1) sub $v0, $v0, $v1 - sw $v0, -428($fp) - # IF_ZERO local_main_at_Main_internal_106 GOTO label_CONTINUE_388 - # IF_ZERO local_main_at_Main_internal_106 GOTO label_CONTINUE_388 - lw $t0, -428($fp) + sw $v0, -444($fp) + # IF_ZERO local_main_at_Main_internal_110 GOTO label_CONTINUE_388 + # IF_ZERO local_main_at_Main_internal_110 GOTO label_CONTINUE_388 + lw $t0, -444($fp) beq $t0, 0, label_CONTINUE_388 # GOTO label_FALSE_383 j label_FALSE_383 label_CONTINUE_388: - # LOCAL local_main_at_Main_internal_106 --> -428($fp) - # LOCAL local_main_at_Main_internal_107 --> -432($fp) - # LOCAL local_main_at_Main_internal_108 --> -436($fp) + # LOCAL local_main_at_Main_internal_110 --> -444($fp) + # LOCAL local_main_at_Main_internal_111 --> -448($fp) + # LOCAL local_main_at_Main_internal_112 --> -452($fp) move $a2, $zero # Load strings for comparison - lw $v0, -432($fp) - lw $v1, -436($fp) + lw $v0, -448($fp) + lw $v1, -452($fp) # Load strings pointers lw $v0, 12($v0) lw $v1, 12($v1) @@ -19060,13 +19069,13 @@ label_FALSEIF_371: li $a2, 1 label_WHILE_STR_COMP_END_390: # Store result - sw $a2, -428($fp) - # IF_ZERO local_main_at_Main_internal_106 GOTO label_TRUE_384 - # IF_ZERO local_main_at_Main_internal_106 GOTO label_TRUE_384 - lw $t0, -428($fp) + sw $a2, -444($fp) + # IF_ZERO local_main_at_Main_internal_110 GOTO label_TRUE_384 + # IF_ZERO local_main_at_Main_internal_110 GOTO label_TRUE_384 + lw $t0, -444($fp) beq $t0, 0, label_TRUE_384 label_FALSE_383: - # LOCAL local_main_at_Main_internal_105 --> -424($fp) + # LOCAL local_main_at_Main_internal_109 --> -440($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -19096,11 +19105,11 @@ label_FALSEIF_371: sw $t0, 8($v0) li $t0, 0 sw $t0, 12($v0) - sw $v0, -424($fp) + sw $v0, -440($fp) # GOTO label_END_385 j label_END_385 label_TRUE_384: - # LOCAL local_main_at_Main_internal_105 --> -424($fp) + # LOCAL local_main_at_Main_internal_109 --> -440($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -19130,20 +19139,20 @@ label_TRUE_384: sw $t0, 8($v0) li $t0, 1 sw $t0, 12($v0) - sw $v0, -424($fp) + sw $v0, -440($fp) label_END_385: -# LOCAL local_main_at_Main_internal_103 --> -416($fp) -# LOCAL local_main_at_Main_internal_105 --> -424($fp) -# Obtain value from -424($fp) -lw $v0, -424($fp) +# LOCAL local_main_at_Main_internal_107 --> -432($fp) +# LOCAL local_main_at_Main_internal_109 --> -440($fp) +# Obtain value from -440($fp) +lw $v0, -440($fp) lw $v0, 12($v0) -sw $v0, -416($fp) -# IF_ZERO local_main_at_Main_internal_103 GOTO label_FALSEIF_381 -# IF_ZERO local_main_at_Main_internal_103 GOTO label_FALSEIF_381 -lw $t0, -416($fp) +sw $v0, -432($fp) +# IF_ZERO local_main_at_Main_internal_107 GOTO label_FALSEIF_381 +# IF_ZERO local_main_at_Main_internal_107 GOTO label_FALSEIF_381 +lw $t0, -432($fp) beq $t0, 0, label_FALSEIF_381 -# LOCAL local_main_at_Main_internal_110 --> -444($fp) -# local_main_at_Main_internal_110 = ALLOCATE C +# LOCAL local_main_at_Main_internal_114 --> -460($fp) +# local_main_at_Main_internal_114 = ALLOCATE C # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -19187,27 +19196,27 @@ sw $v0, 12($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -sw $t1, -444($fp) +sw $t1, -460($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# local_main_at_Main_internal_113 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_113 --> -456($fp) +# local_main_at_Main_internal_117 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_117 --> -472($fp) lw $t0, 16($s1) -sw $t0, -456($fp) -# LOCAL local_main_at_Main_internal_111 --> -448($fp) -# LOCAL local_main_at_Main_internal_113 --> -456($fp) -# local_main_at_Main_internal_111 = local_main_at_Main_internal_113 -lw $t0, -456($fp) -sw $t0, -448($fp) +sw $t0, -472($fp) +# LOCAL local_main_at_Main_internal_115 --> -464($fp) +# LOCAL local_main_at_Main_internal_117 --> -472($fp) +# local_main_at_Main_internal_115 = local_main_at_Main_internal_117 +lw $t0, -472($fp) +sw $t0, -464($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_111 --> -448($fp) -# LOCAL local_main_at_Main_internal_112 --> -452($fp) -# local_main_at_Main_internal_112 = VCALL local_main_at_Main_internal_111 value +# LOCAL local_main_at_Main_internal_115 --> -464($fp) +# LOCAL local_main_at_Main_internal_116 --> -468($fp) +# local_main_at_Main_internal_116 = VCALL local_main_at_Main_internal_115 value # Save new self pointer in $s1 -lw $s1, -448($fp) +lw $s1, -464($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -19216,45 +19225,45 @@ lw $t0, 0($t0) lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -452($fp) +sw $v0, -468($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_112 -# LOCAL local_main_at_Main_internal_112 --> -452($fp) -lw $t0, -452($fp) +# ARG local_main_at_Main_internal_116 +# LOCAL local_main_at_Main_internal_116 --> -468($fp) +lw $t0, -468($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) -# local_main_at_Main_internal_109 = CALL method5 -# LOCAL local_main_at_Main_internal_109 --> -440($fp) -# LOCAL local_main_at_Main_internal_110 --> -444($fp) +# local_main_at_Main_internal_113 = CALL method5 +# LOCAL local_main_at_Main_internal_113 --> -456($fp) +# LOCAL local_main_at_Main_internal_114 --> -460($fp) # Save new self pointer in $s1 -lw $s1, -444($fp) +lw $s1, -460($fp) # Get pointer to type's VTABLE la $t0, A_vtable # Get pointer to function address lw $t1, 36($t0) # Call function. Result is on $v0 jalr $t1 -sw $v0, -440($fp) +sw $v0, -456($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # -# LOCAL local_main_at_Main_internal_109 --> -440($fp) -lw $t0, -440($fp) +# LOCAL local_main_at_Main_internal_113 --> -456($fp) +lw $t0, -456($fp) sw $t0, 16($s1) -# LOCAL local_main_at_Main_internal_104 --> -420($fp) -# local_main_at_Main_internal_104 = +# LOCAL local_main_at_Main_internal_108 --> -436($fp) +# local_main_at_Main_internal_108 = # GOTO label_ENDIF_382 j label_ENDIF_382 label_FALSEIF_381: - # local_main_at_Main_internal_118 = GETATTRIBUTE char Main - # LOCAL local_main_at_Main_internal_118 --> -476($fp) + # local_main_at_Main_internal_122 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_122 --> -492($fp) lw $t0, 12($s1) - sw $t0, -476($fp) - # LOCAL local_main_at_Main_internal_119 --> -480($fp) + sw $t0, -492($fp) + # LOCAL local_main_at_Main_internal_123 --> -496($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -19271,111 +19280,111 @@ label_FALSEIF_381: sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) - sw $v0, -480($fp) - # IF_ZERO local_main_at_Main_internal_118 GOTO label_FALSE_393 - # IF_ZERO local_main_at_Main_internal_118 GOTO label_FALSE_393 - lw $t0, -476($fp) + sw $v0, -496($fp) + # IF_ZERO local_main_at_Main_internal_122 GOTO label_FALSE_393 + # IF_ZERO local_main_at_Main_internal_122 GOTO label_FALSE_393 + lw $t0, -492($fp) beq $t0, 0, label_FALSE_393 - # IF_ZERO local_main_at_Main_internal_119 GOTO label_FALSE_393 - # IF_ZERO local_main_at_Main_internal_119 GOTO label_FALSE_393 - lw $t0, -480($fp) + # IF_ZERO local_main_at_Main_internal_123 GOTO label_FALSE_393 + # IF_ZERO local_main_at_Main_internal_123 GOTO label_FALSE_393 + lw $t0, -496($fp) beq $t0, 0, label_FALSE_393 - # LOCAL local_main_at_Main_internal_117 --> -472($fp) - # LOCAL local_main_at_Main_internal_118 --> -476($fp) - # Comparing -476($fp) type with String + # LOCAL local_main_at_Main_internal_121 --> -488($fp) + # LOCAL local_main_at_Main_internal_122 --> -492($fp) + # Comparing -492($fp) type with String la $v0, String - lw $a0, -476($fp) + lw $a0, -492($fp) lw $a0, 0($a0) sub $a0, $a0, $v0 - sw $a0, -472($fp) - # IF_ZERO local_main_at_Main_internal_117 GOTO label_COMPARE_STRING_396 - # IF_ZERO local_main_at_Main_internal_117 GOTO label_COMPARE_STRING_396 - lw $t0, -472($fp) + sw $a0, -488($fp) + # IF_ZERO local_main_at_Main_internal_121 GOTO label_COMPARE_STRING_396 + # IF_ZERO local_main_at_Main_internal_121 GOTO label_COMPARE_STRING_396 + lw $t0, -488($fp) beq $t0, 0, label_COMPARE_STRING_396 - # LOCAL local_main_at_Main_internal_117 --> -472($fp) - # LOCAL local_main_at_Main_internal_118 --> -476($fp) - # Comparing -476($fp) type with Bool + # LOCAL local_main_at_Main_internal_121 --> -488($fp) + # LOCAL local_main_at_Main_internal_122 --> -492($fp) + # Comparing -492($fp) type with Bool la $v0, Bool - lw $a0, -476($fp) + lw $a0, -492($fp) lw $a0, 0($a0) lw $a0, 12($a0) sub $a0, $a0, $v0 - sw $a0, -472($fp) - # IF_ZERO local_main_at_Main_internal_117 GOTO label_COMPARE_BY_VALUE_397 - # IF_ZERO local_main_at_Main_internal_117 GOTO label_COMPARE_BY_VALUE_397 - lw $t0, -472($fp) + sw $a0, -488($fp) + # IF_ZERO local_main_at_Main_internal_121 GOTO label_COMPARE_BY_VALUE_397 + # IF_ZERO local_main_at_Main_internal_121 GOTO label_COMPARE_BY_VALUE_397 + lw $t0, -488($fp) beq $t0, 0, label_COMPARE_BY_VALUE_397 - # LOCAL local_main_at_Main_internal_117 --> -472($fp) - # LOCAL local_main_at_Main_internal_118 --> -476($fp) - # Comparing -476($fp) type with Int + # LOCAL local_main_at_Main_internal_121 --> -488($fp) + # LOCAL local_main_at_Main_internal_122 --> -492($fp) + # Comparing -492($fp) type with Int la $v0, Int - lw $a0, -476($fp) + lw $a0, -492($fp) lw $a0, 0($a0) lw $a0, 12($a0) sub $a0, $a0, $v0 - sw $a0, -472($fp) - # IF_ZERO local_main_at_Main_internal_117 GOTO label_COMPARE_BY_VALUE_397 - # IF_ZERO local_main_at_Main_internal_117 GOTO label_COMPARE_BY_VALUE_397 - lw $t0, -472($fp) + sw $a0, -488($fp) + # IF_ZERO local_main_at_Main_internal_121 GOTO label_COMPARE_BY_VALUE_397 + # IF_ZERO local_main_at_Main_internal_121 GOTO label_COMPARE_BY_VALUE_397 + lw $t0, -488($fp) beq $t0, 0, label_COMPARE_BY_VALUE_397 - # LOCAL local_main_at_Main_internal_117 --> -472($fp) - # LOCAL local_main_at_Main_internal_118 --> -476($fp) - # LOCAL local_main_at_Main_internal_119 --> -480($fp) + # LOCAL local_main_at_Main_internal_121 --> -488($fp) + # LOCAL local_main_at_Main_internal_122 --> -492($fp) + # LOCAL local_main_at_Main_internal_123 --> -496($fp) # Load pointers and SUB - lw $a0, -476($fp) - lw $a1, -480($fp) + lw $a0, -492($fp) + lw $a1, -496($fp) sub $a0, $a0, $a1 - sw $a0, -472($fp) - # IF_ZERO local_main_at_Main_internal_117 GOTO label_TRUE_394 - # IF_ZERO local_main_at_Main_internal_117 GOTO label_TRUE_394 - lw $t0, -472($fp) + sw $a0, -488($fp) + # IF_ZERO local_main_at_Main_internal_121 GOTO label_TRUE_394 + # IF_ZERO local_main_at_Main_internal_121 GOTO label_TRUE_394 + lw $t0, -488($fp) beq $t0, 0, label_TRUE_394 # GOTO label_FALSE_393 j label_FALSE_393 label_COMPARE_BY_VALUE_397: - # LOCAL local_main_at_Main_internal_117 --> -472($fp) - # LOCAL local_main_at_Main_internal_118 --> -476($fp) - # LOCAL local_main_at_Main_internal_119 --> -480($fp) - lw $a0, -476($fp) - lw $a1, -480($fp) + # LOCAL local_main_at_Main_internal_121 --> -488($fp) + # LOCAL local_main_at_Main_internal_122 --> -492($fp) + # LOCAL local_main_at_Main_internal_123 --> -496($fp) + lw $a0, -492($fp) + lw $a1, -496($fp) # Load values lw $a0, 12($a0) lw $a1, 12($a1) # SUB and store sub $a0, $a0, $a1 - sw $a0, -472($fp) - # IF_ZERO local_main_at_Main_internal_117 GOTO label_TRUE_394 - # IF_ZERO local_main_at_Main_internal_117 GOTO label_TRUE_394 - lw $t0, -472($fp) + sw $a0, -488($fp) + # IF_ZERO local_main_at_Main_internal_121 GOTO label_TRUE_394 + # IF_ZERO local_main_at_Main_internal_121 GOTO label_TRUE_394 + lw $t0, -488($fp) beq $t0, 0, label_TRUE_394 # GOTO label_FALSE_393 j label_FALSE_393 label_COMPARE_STRING_396: - # LOCAL local_main_at_Main_internal_117 --> -472($fp) - # LOCAL local_main_at_Main_internal_118 --> -476($fp) - # LOCAL local_main_at_Main_internal_119 --> -480($fp) + # LOCAL local_main_at_Main_internal_121 --> -488($fp) + # LOCAL local_main_at_Main_internal_122 --> -492($fp) + # LOCAL local_main_at_Main_internal_123 --> -496($fp) # Load strings for comparison - lw $v0, -476($fp) - lw $v1, -480($fp) + lw $v0, -492($fp) + lw $v1, -496($fp) # Compare lengths lw $v0, 16($v0) lw $v1, 16($v1) sub $v0, $v0, $v1 - sw $v0, -472($fp) - # IF_ZERO local_main_at_Main_internal_117 GOTO label_CONTINUE_398 - # IF_ZERO local_main_at_Main_internal_117 GOTO label_CONTINUE_398 - lw $t0, -472($fp) + sw $v0, -488($fp) + # IF_ZERO local_main_at_Main_internal_121 GOTO label_CONTINUE_398 + # IF_ZERO local_main_at_Main_internal_121 GOTO label_CONTINUE_398 + lw $t0, -488($fp) beq $t0, 0, label_CONTINUE_398 # GOTO label_FALSE_393 j label_FALSE_393 label_CONTINUE_398: - # LOCAL local_main_at_Main_internal_117 --> -472($fp) - # LOCAL local_main_at_Main_internal_118 --> -476($fp) - # LOCAL local_main_at_Main_internal_119 --> -480($fp) + # LOCAL local_main_at_Main_internal_121 --> -488($fp) + # LOCAL local_main_at_Main_internal_122 --> -492($fp) + # LOCAL local_main_at_Main_internal_123 --> -496($fp) move $a2, $zero # Load strings for comparison - lw $v0, -476($fp) - lw $v1, -480($fp) + lw $v0, -492($fp) + lw $v1, -496($fp) # Load strings pointers lw $v0, 12($v0) lw $v1, 12($v1) @@ -19395,13 +19404,13 @@ label_FALSEIF_381: li $a2, 1 label_WHILE_STR_COMP_END_400: # Store result - sw $a2, -472($fp) - # IF_ZERO local_main_at_Main_internal_117 GOTO label_TRUE_394 - # IF_ZERO local_main_at_Main_internal_117 GOTO label_TRUE_394 - lw $t0, -472($fp) + sw $a2, -488($fp) + # IF_ZERO local_main_at_Main_internal_121 GOTO label_TRUE_394 + # IF_ZERO local_main_at_Main_internal_121 GOTO label_TRUE_394 + lw $t0, -488($fp) beq $t0, 0, label_TRUE_394 label_FALSE_393: - # LOCAL local_main_at_Main_internal_116 --> -468($fp) + # LOCAL local_main_at_Main_internal_120 --> -484($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -19431,11 +19440,11 @@ label_FALSEIF_381: sw $t0, 8($v0) li $t0, 0 sw $t0, 12($v0) - sw $v0, -468($fp) + sw $v0, -484($fp) # GOTO label_END_395 j label_END_395 label_TRUE_394: - # LOCAL local_main_at_Main_internal_116 --> -468($fp) + # LOCAL local_main_at_Main_internal_120 --> -484($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -19465,20 +19474,20 @@ label_TRUE_394: sw $t0, 8($v0) li $t0, 1 sw $t0, 12($v0) - sw $v0, -468($fp) + sw $v0, -484($fp) label_END_395: -# LOCAL local_main_at_Main_internal_114 --> -460($fp) -# LOCAL local_main_at_Main_internal_116 --> -468($fp) -# Obtain value from -468($fp) -lw $v0, -468($fp) +# LOCAL local_main_at_Main_internal_118 --> -476($fp) +# LOCAL local_main_at_Main_internal_120 --> -484($fp) +# Obtain value from -484($fp) +lw $v0, -484($fp) lw $v0, 12($v0) -sw $v0, -460($fp) -# IF_ZERO local_main_at_Main_internal_114 GOTO label_FALSEIF_391 -# IF_ZERO local_main_at_Main_internal_114 GOTO label_FALSEIF_391 -lw $t0, -460($fp) +sw $v0, -476($fp) +# IF_ZERO local_main_at_Main_internal_118 GOTO label_FALSEIF_391 +# IF_ZERO local_main_at_Main_internal_118 GOTO label_FALSEIF_391 +lw $t0, -476($fp) beq $t0, 0, label_FALSEIF_391 -# LOCAL local_main_at_Main_internal_121 --> -488($fp) -# local_main_at_Main_internal_121 = ALLOCATE C +# LOCAL local_main_at_Main_internal_125 --> -504($fp) +# local_main_at_Main_internal_125 = ALLOCATE C # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -19522,27 +19531,27 @@ sw $v0, 12($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -sw $t1, -488($fp) +sw $t1, -504($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# local_main_at_Main_internal_124 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_124 --> -500($fp) +# local_main_at_Main_internal_128 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_128 --> -516($fp) lw $t0, 16($s1) -sw $t0, -500($fp) -# LOCAL local_main_at_Main_internal_122 --> -492($fp) -# LOCAL local_main_at_Main_internal_124 --> -500($fp) -# local_main_at_Main_internal_122 = local_main_at_Main_internal_124 -lw $t0, -500($fp) -sw $t0, -492($fp) +sw $t0, -516($fp) +# LOCAL local_main_at_Main_internal_126 --> -508($fp) +# LOCAL local_main_at_Main_internal_128 --> -516($fp) +# local_main_at_Main_internal_126 = local_main_at_Main_internal_128 +lw $t0, -516($fp) +sw $t0, -508($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_122 --> -492($fp) -# LOCAL local_main_at_Main_internal_123 --> -496($fp) -# local_main_at_Main_internal_123 = VCALL local_main_at_Main_internal_122 value +# LOCAL local_main_at_Main_internal_126 --> -508($fp) +# LOCAL local_main_at_Main_internal_127 --> -512($fp) +# local_main_at_Main_internal_127 = VCALL local_main_at_Main_internal_126 value # Save new self pointer in $s1 -lw $s1, -492($fp) +lw $s1, -508($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -19551,45 +19560,45 @@ lw $t0, 0($t0) lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -496($fp) +sw $v0, -512($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_123 -# LOCAL local_main_at_Main_internal_123 --> -496($fp) -lw $t0, -496($fp) +# ARG local_main_at_Main_internal_127 +# LOCAL local_main_at_Main_internal_127 --> -512($fp) +lw $t0, -512($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) -# local_main_at_Main_internal_120 = CALL method5 -# LOCAL local_main_at_Main_internal_120 --> -484($fp) -# LOCAL local_main_at_Main_internal_121 --> -488($fp) +# local_main_at_Main_internal_124 = CALL method5 +# LOCAL local_main_at_Main_internal_124 --> -500($fp) +# LOCAL local_main_at_Main_internal_125 --> -504($fp) # Save new self pointer in $s1 -lw $s1, -488($fp) +lw $s1, -504($fp) # Get pointer to type's VTABLE la $t0, B_vtable # Get pointer to function address lw $t1, 36($t0) # Call function. Result is on $v0 jalr $t1 -sw $v0, -484($fp) +sw $v0, -500($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # -# LOCAL local_main_at_Main_internal_120 --> -484($fp) -lw $t0, -484($fp) +# LOCAL local_main_at_Main_internal_124 --> -500($fp) +lw $t0, -500($fp) sw $t0, 16($s1) -# LOCAL local_main_at_Main_internal_115 --> -464($fp) -# local_main_at_Main_internal_115 = +# LOCAL local_main_at_Main_internal_119 --> -480($fp) +# local_main_at_Main_internal_119 = # GOTO label_ENDIF_392 j label_ENDIF_392 label_FALSEIF_391: - # local_main_at_Main_internal_129 = GETATTRIBUTE char Main - # LOCAL local_main_at_Main_internal_129 --> -520($fp) + # local_main_at_Main_internal_133 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_133 --> -536($fp) lw $t0, 12($s1) - sw $t0, -520($fp) - # LOCAL local_main_at_Main_internal_130 --> -524($fp) + sw $t0, -536($fp) + # LOCAL local_main_at_Main_internal_134 --> -540($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -19606,111 +19615,111 @@ label_FALSEIF_391: sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) - sw $v0, -524($fp) - # IF_ZERO local_main_at_Main_internal_129 GOTO label_FALSE_403 - # IF_ZERO local_main_at_Main_internal_129 GOTO label_FALSE_403 - lw $t0, -520($fp) + sw $v0, -540($fp) + # IF_ZERO local_main_at_Main_internal_133 GOTO label_FALSE_403 + # IF_ZERO local_main_at_Main_internal_133 GOTO label_FALSE_403 + lw $t0, -536($fp) beq $t0, 0, label_FALSE_403 - # IF_ZERO local_main_at_Main_internal_130 GOTO label_FALSE_403 - # IF_ZERO local_main_at_Main_internal_130 GOTO label_FALSE_403 - lw $t0, -524($fp) + # IF_ZERO local_main_at_Main_internal_134 GOTO label_FALSE_403 + # IF_ZERO local_main_at_Main_internal_134 GOTO label_FALSE_403 + lw $t0, -540($fp) beq $t0, 0, label_FALSE_403 - # LOCAL local_main_at_Main_internal_128 --> -516($fp) - # LOCAL local_main_at_Main_internal_129 --> -520($fp) - # Comparing -520($fp) type with String + # LOCAL local_main_at_Main_internal_132 --> -532($fp) + # LOCAL local_main_at_Main_internal_133 --> -536($fp) + # Comparing -536($fp) type with String la $v0, String - lw $a0, -520($fp) + lw $a0, -536($fp) lw $a0, 0($a0) sub $a0, $a0, $v0 - sw $a0, -516($fp) - # IF_ZERO local_main_at_Main_internal_128 GOTO label_COMPARE_STRING_406 - # IF_ZERO local_main_at_Main_internal_128 GOTO label_COMPARE_STRING_406 - lw $t0, -516($fp) + sw $a0, -532($fp) + # IF_ZERO local_main_at_Main_internal_132 GOTO label_COMPARE_STRING_406 + # IF_ZERO local_main_at_Main_internal_132 GOTO label_COMPARE_STRING_406 + lw $t0, -532($fp) beq $t0, 0, label_COMPARE_STRING_406 - # LOCAL local_main_at_Main_internal_128 --> -516($fp) - # LOCAL local_main_at_Main_internal_129 --> -520($fp) - # Comparing -520($fp) type with Bool + # LOCAL local_main_at_Main_internal_132 --> -532($fp) + # LOCAL local_main_at_Main_internal_133 --> -536($fp) + # Comparing -536($fp) type with Bool la $v0, Bool - lw $a0, -520($fp) + lw $a0, -536($fp) lw $a0, 0($a0) lw $a0, 12($a0) sub $a0, $a0, $v0 - sw $a0, -516($fp) - # IF_ZERO local_main_at_Main_internal_128 GOTO label_COMPARE_BY_VALUE_407 - # IF_ZERO local_main_at_Main_internal_128 GOTO label_COMPARE_BY_VALUE_407 - lw $t0, -516($fp) + sw $a0, -532($fp) + # IF_ZERO local_main_at_Main_internal_132 GOTO label_COMPARE_BY_VALUE_407 + # IF_ZERO local_main_at_Main_internal_132 GOTO label_COMPARE_BY_VALUE_407 + lw $t0, -532($fp) beq $t0, 0, label_COMPARE_BY_VALUE_407 - # LOCAL local_main_at_Main_internal_128 --> -516($fp) - # LOCAL local_main_at_Main_internal_129 --> -520($fp) - # Comparing -520($fp) type with Int + # LOCAL local_main_at_Main_internal_132 --> -532($fp) + # LOCAL local_main_at_Main_internal_133 --> -536($fp) + # Comparing -536($fp) type with Int la $v0, Int - lw $a0, -520($fp) + lw $a0, -536($fp) lw $a0, 0($a0) lw $a0, 12($a0) sub $a0, $a0, $v0 - sw $a0, -516($fp) - # IF_ZERO local_main_at_Main_internal_128 GOTO label_COMPARE_BY_VALUE_407 - # IF_ZERO local_main_at_Main_internal_128 GOTO label_COMPARE_BY_VALUE_407 - lw $t0, -516($fp) + sw $a0, -532($fp) + # IF_ZERO local_main_at_Main_internal_132 GOTO label_COMPARE_BY_VALUE_407 + # IF_ZERO local_main_at_Main_internal_132 GOTO label_COMPARE_BY_VALUE_407 + lw $t0, -532($fp) beq $t0, 0, label_COMPARE_BY_VALUE_407 - # LOCAL local_main_at_Main_internal_128 --> -516($fp) - # LOCAL local_main_at_Main_internal_129 --> -520($fp) - # LOCAL local_main_at_Main_internal_130 --> -524($fp) + # LOCAL local_main_at_Main_internal_132 --> -532($fp) + # LOCAL local_main_at_Main_internal_133 --> -536($fp) + # LOCAL local_main_at_Main_internal_134 --> -540($fp) # Load pointers and SUB - lw $a0, -520($fp) - lw $a1, -524($fp) + lw $a0, -536($fp) + lw $a1, -540($fp) sub $a0, $a0, $a1 - sw $a0, -516($fp) - # IF_ZERO local_main_at_Main_internal_128 GOTO label_TRUE_404 - # IF_ZERO local_main_at_Main_internal_128 GOTO label_TRUE_404 - lw $t0, -516($fp) + sw $a0, -532($fp) + # IF_ZERO local_main_at_Main_internal_132 GOTO label_TRUE_404 + # IF_ZERO local_main_at_Main_internal_132 GOTO label_TRUE_404 + lw $t0, -532($fp) beq $t0, 0, label_TRUE_404 # GOTO label_FALSE_403 j label_FALSE_403 label_COMPARE_BY_VALUE_407: - # LOCAL local_main_at_Main_internal_128 --> -516($fp) - # LOCAL local_main_at_Main_internal_129 --> -520($fp) - # LOCAL local_main_at_Main_internal_130 --> -524($fp) - lw $a0, -520($fp) - lw $a1, -524($fp) + # LOCAL local_main_at_Main_internal_132 --> -532($fp) + # LOCAL local_main_at_Main_internal_133 --> -536($fp) + # LOCAL local_main_at_Main_internal_134 --> -540($fp) + lw $a0, -536($fp) + lw $a1, -540($fp) # Load values lw $a0, 12($a0) lw $a1, 12($a1) # SUB and store sub $a0, $a0, $a1 - sw $a0, -516($fp) - # IF_ZERO local_main_at_Main_internal_128 GOTO label_TRUE_404 - # IF_ZERO local_main_at_Main_internal_128 GOTO label_TRUE_404 - lw $t0, -516($fp) + sw $a0, -532($fp) + # IF_ZERO local_main_at_Main_internal_132 GOTO label_TRUE_404 + # IF_ZERO local_main_at_Main_internal_132 GOTO label_TRUE_404 + lw $t0, -532($fp) beq $t0, 0, label_TRUE_404 # GOTO label_FALSE_403 j label_FALSE_403 label_COMPARE_STRING_406: - # LOCAL local_main_at_Main_internal_128 --> -516($fp) - # LOCAL local_main_at_Main_internal_129 --> -520($fp) - # LOCAL local_main_at_Main_internal_130 --> -524($fp) + # LOCAL local_main_at_Main_internal_132 --> -532($fp) + # LOCAL local_main_at_Main_internal_133 --> -536($fp) + # LOCAL local_main_at_Main_internal_134 --> -540($fp) # Load strings for comparison - lw $v0, -520($fp) - lw $v1, -524($fp) + lw $v0, -536($fp) + lw $v1, -540($fp) # Compare lengths lw $v0, 16($v0) lw $v1, 16($v1) sub $v0, $v0, $v1 - sw $v0, -516($fp) - # IF_ZERO local_main_at_Main_internal_128 GOTO label_CONTINUE_408 - # IF_ZERO local_main_at_Main_internal_128 GOTO label_CONTINUE_408 - lw $t0, -516($fp) + sw $v0, -532($fp) + # IF_ZERO local_main_at_Main_internal_132 GOTO label_CONTINUE_408 + # IF_ZERO local_main_at_Main_internal_132 GOTO label_CONTINUE_408 + lw $t0, -532($fp) beq $t0, 0, label_CONTINUE_408 # GOTO label_FALSE_403 j label_FALSE_403 label_CONTINUE_408: - # LOCAL local_main_at_Main_internal_128 --> -516($fp) - # LOCAL local_main_at_Main_internal_129 --> -520($fp) - # LOCAL local_main_at_Main_internal_130 --> -524($fp) + # LOCAL local_main_at_Main_internal_132 --> -532($fp) + # LOCAL local_main_at_Main_internal_133 --> -536($fp) + # LOCAL local_main_at_Main_internal_134 --> -540($fp) move $a2, $zero # Load strings for comparison - lw $v0, -520($fp) - lw $v1, -524($fp) + lw $v0, -536($fp) + lw $v1, -540($fp) # Load strings pointers lw $v0, 12($v0) lw $v1, 12($v1) @@ -19730,13 +19739,13 @@ label_FALSEIF_391: li $a2, 1 label_WHILE_STR_COMP_END_410: # Store result - sw $a2, -516($fp) - # IF_ZERO local_main_at_Main_internal_128 GOTO label_TRUE_404 - # IF_ZERO local_main_at_Main_internal_128 GOTO label_TRUE_404 - lw $t0, -516($fp) + sw $a2, -532($fp) + # IF_ZERO local_main_at_Main_internal_132 GOTO label_TRUE_404 + # IF_ZERO local_main_at_Main_internal_132 GOTO label_TRUE_404 + lw $t0, -532($fp) beq $t0, 0, label_TRUE_404 label_FALSE_403: - # LOCAL local_main_at_Main_internal_127 --> -512($fp) + # LOCAL local_main_at_Main_internal_131 --> -528($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -19766,11 +19775,11 @@ label_FALSEIF_391: sw $t0, 8($v0) li $t0, 0 sw $t0, 12($v0) - sw $v0, -512($fp) + sw $v0, -528($fp) # GOTO label_END_405 j label_END_405 label_TRUE_404: - # LOCAL local_main_at_Main_internal_127 --> -512($fp) + # LOCAL local_main_at_Main_internal_131 --> -528($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -19800,20 +19809,20 @@ label_TRUE_404: sw $t0, 8($v0) li $t0, 1 sw $t0, 12($v0) - sw $v0, -512($fp) + sw $v0, -528($fp) label_END_405: -# LOCAL local_main_at_Main_internal_125 --> -504($fp) -# LOCAL local_main_at_Main_internal_127 --> -512($fp) -# Obtain value from -512($fp) -lw $v0, -512($fp) +# LOCAL local_main_at_Main_internal_129 --> -520($fp) +# LOCAL local_main_at_Main_internal_131 --> -528($fp) +# Obtain value from -528($fp) +lw $v0, -528($fp) lw $v0, 12($v0) -sw $v0, -504($fp) -# IF_ZERO local_main_at_Main_internal_125 GOTO label_FALSEIF_401 -# IF_ZERO local_main_at_Main_internal_125 GOTO label_FALSEIF_401 -lw $t0, -504($fp) +sw $v0, -520($fp) +# IF_ZERO local_main_at_Main_internal_129 GOTO label_FALSEIF_401 +# IF_ZERO local_main_at_Main_internal_129 GOTO label_FALSEIF_401 +lw $t0, -520($fp) beq $t0, 0, label_FALSEIF_401 -# LOCAL local_main_at_Main_internal_132 --> -532($fp) -# local_main_at_Main_internal_132 = ALLOCATE C +# LOCAL local_main_at_Main_internal_136 --> -548($fp) +# local_main_at_Main_internal_136 = ALLOCATE C # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -19857,27 +19866,27 @@ sw $v0, 12($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -sw $t1, -532($fp) +sw $t1, -548($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# local_main_at_Main_internal_135 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_135 --> -544($fp) +# local_main_at_Main_internal_139 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_139 --> -560($fp) lw $t0, 16($s1) -sw $t0, -544($fp) -# LOCAL local_main_at_Main_internal_133 --> -536($fp) -# LOCAL local_main_at_Main_internal_135 --> -544($fp) -# local_main_at_Main_internal_133 = local_main_at_Main_internal_135 -lw $t0, -544($fp) -sw $t0, -536($fp) +sw $t0, -560($fp) +# LOCAL local_main_at_Main_internal_137 --> -552($fp) +# LOCAL local_main_at_Main_internal_139 --> -560($fp) +# local_main_at_Main_internal_137 = local_main_at_Main_internal_139 +lw $t0, -560($fp) +sw $t0, -552($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_133 --> -536($fp) -# LOCAL local_main_at_Main_internal_134 --> -540($fp) -# local_main_at_Main_internal_134 = VCALL local_main_at_Main_internal_133 value +# LOCAL local_main_at_Main_internal_137 --> -552($fp) +# LOCAL local_main_at_Main_internal_138 --> -556($fp) +# local_main_at_Main_internal_138 = VCALL local_main_at_Main_internal_137 value # Save new self pointer in $s1 -lw $s1, -536($fp) +lw $s1, -552($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -19886,45 +19895,45 @@ lw $t0, 0($t0) lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -540($fp) +sw $v0, -556($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_134 -# LOCAL local_main_at_Main_internal_134 --> -540($fp) -lw $t0, -540($fp) +# ARG local_main_at_Main_internal_138 +# LOCAL local_main_at_Main_internal_138 --> -556($fp) +lw $t0, -556($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) -# local_main_at_Main_internal_131 = CALL method5 -# LOCAL local_main_at_Main_internal_131 --> -528($fp) -# LOCAL local_main_at_Main_internal_132 --> -532($fp) +# local_main_at_Main_internal_135 = CALL method5 +# LOCAL local_main_at_Main_internal_135 --> -544($fp) +# LOCAL local_main_at_Main_internal_136 --> -548($fp) # Save new self pointer in $s1 -lw $s1, -532($fp) +lw $s1, -548($fp) # Get pointer to type's VTABLE la $t0, C_vtable # Get pointer to function address lw $t1, 36($t0) # Call function. Result is on $v0 jalr $t1 -sw $v0, -528($fp) +sw $v0, -544($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # -# LOCAL local_main_at_Main_internal_131 --> -528($fp) -lw $t0, -528($fp) +# LOCAL local_main_at_Main_internal_135 --> -544($fp) +lw $t0, -544($fp) sw $t0, 16($s1) -# LOCAL local_main_at_Main_internal_126 --> -508($fp) -# local_main_at_Main_internal_126 = +# LOCAL local_main_at_Main_internal_130 --> -524($fp) +# local_main_at_Main_internal_130 = # GOTO label_ENDIF_402 j label_ENDIF_402 label_FALSEIF_401: - # local_main_at_Main_internal_140 = GETATTRIBUTE char Main - # LOCAL local_main_at_Main_internal_140 --> -564($fp) + # local_main_at_Main_internal_144 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_144 --> -580($fp) lw $t0, 12($s1) - sw $t0, -564($fp) - # LOCAL local_main_at_Main_internal_141 --> -568($fp) + sw $t0, -580($fp) + # LOCAL local_main_at_Main_internal_145 --> -584($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -19941,111 +19950,111 @@ label_FALSEIF_401: sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) - sw $v0, -568($fp) - # IF_ZERO local_main_at_Main_internal_140 GOTO label_FALSE_413 - # IF_ZERO local_main_at_Main_internal_140 GOTO label_FALSE_413 - lw $t0, -564($fp) + sw $v0, -584($fp) + # IF_ZERO local_main_at_Main_internal_144 GOTO label_FALSE_413 + # IF_ZERO local_main_at_Main_internal_144 GOTO label_FALSE_413 + lw $t0, -580($fp) beq $t0, 0, label_FALSE_413 - # IF_ZERO local_main_at_Main_internal_141 GOTO label_FALSE_413 - # IF_ZERO local_main_at_Main_internal_141 GOTO label_FALSE_413 - lw $t0, -568($fp) + # IF_ZERO local_main_at_Main_internal_145 GOTO label_FALSE_413 + # IF_ZERO local_main_at_Main_internal_145 GOTO label_FALSE_413 + lw $t0, -584($fp) beq $t0, 0, label_FALSE_413 - # LOCAL local_main_at_Main_internal_139 --> -560($fp) - # LOCAL local_main_at_Main_internal_140 --> -564($fp) - # Comparing -564($fp) type with String + # LOCAL local_main_at_Main_internal_143 --> -576($fp) + # LOCAL local_main_at_Main_internal_144 --> -580($fp) + # Comparing -580($fp) type with String la $v0, String - lw $a0, -564($fp) + lw $a0, -580($fp) lw $a0, 0($a0) sub $a0, $a0, $v0 - sw $a0, -560($fp) - # IF_ZERO local_main_at_Main_internal_139 GOTO label_COMPARE_STRING_416 - # IF_ZERO local_main_at_Main_internal_139 GOTO label_COMPARE_STRING_416 - lw $t0, -560($fp) + sw $a0, -576($fp) + # IF_ZERO local_main_at_Main_internal_143 GOTO label_COMPARE_STRING_416 + # IF_ZERO local_main_at_Main_internal_143 GOTO label_COMPARE_STRING_416 + lw $t0, -576($fp) beq $t0, 0, label_COMPARE_STRING_416 - # LOCAL local_main_at_Main_internal_139 --> -560($fp) - # LOCAL local_main_at_Main_internal_140 --> -564($fp) - # Comparing -564($fp) type with Bool + # LOCAL local_main_at_Main_internal_143 --> -576($fp) + # LOCAL local_main_at_Main_internal_144 --> -580($fp) + # Comparing -580($fp) type with Bool la $v0, Bool - lw $a0, -564($fp) + lw $a0, -580($fp) lw $a0, 0($a0) lw $a0, 12($a0) sub $a0, $a0, $v0 - sw $a0, -560($fp) - # IF_ZERO local_main_at_Main_internal_139 GOTO label_COMPARE_BY_VALUE_417 - # IF_ZERO local_main_at_Main_internal_139 GOTO label_COMPARE_BY_VALUE_417 - lw $t0, -560($fp) + sw $a0, -576($fp) + # IF_ZERO local_main_at_Main_internal_143 GOTO label_COMPARE_BY_VALUE_417 + # IF_ZERO local_main_at_Main_internal_143 GOTO label_COMPARE_BY_VALUE_417 + lw $t0, -576($fp) beq $t0, 0, label_COMPARE_BY_VALUE_417 - # LOCAL local_main_at_Main_internal_139 --> -560($fp) - # LOCAL local_main_at_Main_internal_140 --> -564($fp) - # Comparing -564($fp) type with Int + # LOCAL local_main_at_Main_internal_143 --> -576($fp) + # LOCAL local_main_at_Main_internal_144 --> -580($fp) + # Comparing -580($fp) type with Int la $v0, Int - lw $a0, -564($fp) + lw $a0, -580($fp) lw $a0, 0($a0) lw $a0, 12($a0) sub $a0, $a0, $v0 - sw $a0, -560($fp) - # IF_ZERO local_main_at_Main_internal_139 GOTO label_COMPARE_BY_VALUE_417 - # IF_ZERO local_main_at_Main_internal_139 GOTO label_COMPARE_BY_VALUE_417 - lw $t0, -560($fp) + sw $a0, -576($fp) + # IF_ZERO local_main_at_Main_internal_143 GOTO label_COMPARE_BY_VALUE_417 + # IF_ZERO local_main_at_Main_internal_143 GOTO label_COMPARE_BY_VALUE_417 + lw $t0, -576($fp) beq $t0, 0, label_COMPARE_BY_VALUE_417 - # LOCAL local_main_at_Main_internal_139 --> -560($fp) - # LOCAL local_main_at_Main_internal_140 --> -564($fp) - # LOCAL local_main_at_Main_internal_141 --> -568($fp) + # LOCAL local_main_at_Main_internal_143 --> -576($fp) + # LOCAL local_main_at_Main_internal_144 --> -580($fp) + # LOCAL local_main_at_Main_internal_145 --> -584($fp) # Load pointers and SUB - lw $a0, -564($fp) - lw $a1, -568($fp) + lw $a0, -580($fp) + lw $a1, -584($fp) sub $a0, $a0, $a1 - sw $a0, -560($fp) - # IF_ZERO local_main_at_Main_internal_139 GOTO label_TRUE_414 - # IF_ZERO local_main_at_Main_internal_139 GOTO label_TRUE_414 - lw $t0, -560($fp) + sw $a0, -576($fp) + # IF_ZERO local_main_at_Main_internal_143 GOTO label_TRUE_414 + # IF_ZERO local_main_at_Main_internal_143 GOTO label_TRUE_414 + lw $t0, -576($fp) beq $t0, 0, label_TRUE_414 # GOTO label_FALSE_413 j label_FALSE_413 label_COMPARE_BY_VALUE_417: - # LOCAL local_main_at_Main_internal_139 --> -560($fp) - # LOCAL local_main_at_Main_internal_140 --> -564($fp) - # LOCAL local_main_at_Main_internal_141 --> -568($fp) - lw $a0, -564($fp) - lw $a1, -568($fp) + # LOCAL local_main_at_Main_internal_143 --> -576($fp) + # LOCAL local_main_at_Main_internal_144 --> -580($fp) + # LOCAL local_main_at_Main_internal_145 --> -584($fp) + lw $a0, -580($fp) + lw $a1, -584($fp) # Load values lw $a0, 12($a0) lw $a1, 12($a1) # SUB and store sub $a0, $a0, $a1 - sw $a0, -560($fp) - # IF_ZERO local_main_at_Main_internal_139 GOTO label_TRUE_414 - # IF_ZERO local_main_at_Main_internal_139 GOTO label_TRUE_414 - lw $t0, -560($fp) + sw $a0, -576($fp) + # IF_ZERO local_main_at_Main_internal_143 GOTO label_TRUE_414 + # IF_ZERO local_main_at_Main_internal_143 GOTO label_TRUE_414 + lw $t0, -576($fp) beq $t0, 0, label_TRUE_414 # GOTO label_FALSE_413 j label_FALSE_413 label_COMPARE_STRING_416: - # LOCAL local_main_at_Main_internal_139 --> -560($fp) - # LOCAL local_main_at_Main_internal_140 --> -564($fp) - # LOCAL local_main_at_Main_internal_141 --> -568($fp) + # LOCAL local_main_at_Main_internal_143 --> -576($fp) + # LOCAL local_main_at_Main_internal_144 --> -580($fp) + # LOCAL local_main_at_Main_internal_145 --> -584($fp) # Load strings for comparison - lw $v0, -564($fp) - lw $v1, -568($fp) + lw $v0, -580($fp) + lw $v1, -584($fp) # Compare lengths lw $v0, 16($v0) lw $v1, 16($v1) sub $v0, $v0, $v1 - sw $v0, -560($fp) - # IF_ZERO local_main_at_Main_internal_139 GOTO label_CONTINUE_418 - # IF_ZERO local_main_at_Main_internal_139 GOTO label_CONTINUE_418 - lw $t0, -560($fp) + sw $v0, -576($fp) + # IF_ZERO local_main_at_Main_internal_143 GOTO label_CONTINUE_418 + # IF_ZERO local_main_at_Main_internal_143 GOTO label_CONTINUE_418 + lw $t0, -576($fp) beq $t0, 0, label_CONTINUE_418 # GOTO label_FALSE_413 j label_FALSE_413 label_CONTINUE_418: - # LOCAL local_main_at_Main_internal_139 --> -560($fp) - # LOCAL local_main_at_Main_internal_140 --> -564($fp) - # LOCAL local_main_at_Main_internal_141 --> -568($fp) + # LOCAL local_main_at_Main_internal_143 --> -576($fp) + # LOCAL local_main_at_Main_internal_144 --> -580($fp) + # LOCAL local_main_at_Main_internal_145 --> -584($fp) move $a2, $zero # Load strings for comparison - lw $v0, -564($fp) - lw $v1, -568($fp) + lw $v0, -580($fp) + lw $v1, -584($fp) # Load strings pointers lw $v0, 12($v0) lw $v1, 12($v1) @@ -20065,13 +20074,13 @@ label_FALSEIF_401: li $a2, 1 label_WHILE_STR_COMP_END_420: # Store result - sw $a2, -560($fp) - # IF_ZERO local_main_at_Main_internal_139 GOTO label_TRUE_414 - # IF_ZERO local_main_at_Main_internal_139 GOTO label_TRUE_414 - lw $t0, -560($fp) + sw $a2, -576($fp) + # IF_ZERO local_main_at_Main_internal_143 GOTO label_TRUE_414 + # IF_ZERO local_main_at_Main_internal_143 GOTO label_TRUE_414 + lw $t0, -576($fp) beq $t0, 0, label_TRUE_414 label_FALSE_413: - # LOCAL local_main_at_Main_internal_138 --> -556($fp) + # LOCAL local_main_at_Main_internal_142 --> -572($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -20101,11 +20110,11 @@ label_FALSEIF_401: sw $t0, 8($v0) li $t0, 0 sw $t0, 12($v0) - sw $v0, -556($fp) + sw $v0, -572($fp) # GOTO label_END_415 j label_END_415 label_TRUE_414: - # LOCAL local_main_at_Main_internal_138 --> -556($fp) + # LOCAL local_main_at_Main_internal_142 --> -572($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -20135,20 +20144,20 @@ label_TRUE_414: sw $t0, 8($v0) li $t0, 1 sw $t0, 12($v0) - sw $v0, -556($fp) + sw $v0, -572($fp) label_END_415: -# LOCAL local_main_at_Main_internal_136 --> -548($fp) -# LOCAL local_main_at_Main_internal_138 --> -556($fp) -# Obtain value from -556($fp) -lw $v0, -556($fp) +# LOCAL local_main_at_Main_internal_140 --> -564($fp) +# LOCAL local_main_at_Main_internal_142 --> -572($fp) +# Obtain value from -572($fp) +lw $v0, -572($fp) lw $v0, 12($v0) -sw $v0, -548($fp) -# IF_ZERO local_main_at_Main_internal_136 GOTO label_FALSEIF_411 -# IF_ZERO local_main_at_Main_internal_136 GOTO label_FALSEIF_411 -lw $t0, -548($fp) +sw $v0, -564($fp) +# IF_ZERO local_main_at_Main_internal_140 GOTO label_FALSEIF_411 +# IF_ZERO local_main_at_Main_internal_140 GOTO label_FALSEIF_411 +lw $t0, -564($fp) beq $t0, 0, label_FALSEIF_411 -# LOCAL local_main_at_Main_internal_146 --> -588($fp) -# local_main_at_Main_internal_146 = ALLOCATE D +# LOCAL local_main_at_Main_internal_150 --> -604($fp) +# local_main_at_Main_internal_150 = ALLOCATE D # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -20192,32 +20201,32 @@ sw $v0, 12($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -sw $t1, -588($fp) -# LOCAL local_main_at_Main_internal_144 --> -580($fp) -# LOCAL local_main_at_Main_internal_146 --> -588($fp) -# local_main_at_Main_internal_144 = local_main_at_Main_internal_146 -lw $t0, -588($fp) -sw $t0, -580($fp) +sw $t1, -604($fp) +# LOCAL local_main_at_Main_internal_148 --> -596($fp) +# LOCAL local_main_at_Main_internal_150 --> -604($fp) +# local_main_at_Main_internal_148 = local_main_at_Main_internal_150 +lw $t0, -604($fp) +sw $t0, -596($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# local_main_at_Main_internal_149 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_149 --> -600($fp) +# local_main_at_Main_internal_153 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_153 --> -616($fp) lw $t0, 16($s1) -sw $t0, -600($fp) -# LOCAL local_main_at_Main_internal_147 --> -592($fp) -# LOCAL local_main_at_Main_internal_149 --> -600($fp) -# local_main_at_Main_internal_147 = local_main_at_Main_internal_149 -lw $t0, -600($fp) -sw $t0, -592($fp) +sw $t0, -616($fp) +# LOCAL local_main_at_Main_internal_151 --> -608($fp) +# LOCAL local_main_at_Main_internal_153 --> -616($fp) +# local_main_at_Main_internal_151 = local_main_at_Main_internal_153 +lw $t0, -616($fp) +sw $t0, -608($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_147 --> -592($fp) -# LOCAL local_main_at_Main_internal_148 --> -596($fp) -# local_main_at_Main_internal_148 = VCALL local_main_at_Main_internal_147 value +# LOCAL local_main_at_Main_internal_151 --> -608($fp) +# LOCAL local_main_at_Main_internal_152 --> -612($fp) +# local_main_at_Main_internal_152 = VCALL local_main_at_Main_internal_151 value # Save new self pointer in $s1 -lw $s1, -592($fp) +lw $s1, -608($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -20226,21 +20235,21 @@ lw $t0, 0($t0) lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -596($fp) +sw $v0, -612($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_148 -# LOCAL local_main_at_Main_internal_148 --> -596($fp) -lw $t0, -596($fp) +# ARG local_main_at_Main_internal_152 +# LOCAL local_main_at_Main_internal_152 --> -612($fp) +lw $t0, -612($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_144 --> -580($fp) -# LOCAL local_main_at_Main_internal_145 --> -584($fp) -# local_main_at_Main_internal_145 = VCALL local_main_at_Main_internal_144 method7 +# LOCAL local_main_at_Main_internal_148 --> -596($fp) +# LOCAL local_main_at_Main_internal_149 --> -600($fp) +# local_main_at_Main_internal_149 = VCALL local_main_at_Main_internal_148 method7 # Save new self pointer in $s1 -lw $s1, -580($fp) +lw $s1, -596($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -20249,32 +20258,32 @@ lw $t0, 0($t0) lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -584($fp) +sw $v0, -600($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_142 --> -572($fp) -# LOCAL local_main_at_Main_internal_145 --> -584($fp) -# Obtain value from -584($fp) -lw $v0, -584($fp) +# LOCAL local_main_at_Main_internal_146 --> -588($fp) +# LOCAL local_main_at_Main_internal_149 --> -600($fp) +# Obtain value from -600($fp) +lw $v0, -600($fp) lw $v0, 12($v0) -sw $v0, -572($fp) -# IF_ZERO local_main_at_Main_internal_142 GOTO label_FALSEIF_421 -# IF_ZERO local_main_at_Main_internal_142 GOTO label_FALSEIF_421 -lw $t0, -572($fp) +sw $v0, -588($fp) +# IF_ZERO local_main_at_Main_internal_146 GOTO label_FALSEIF_421 +# IF_ZERO local_main_at_Main_internal_146 GOTO label_FALSEIF_421 +lw $t0, -588($fp) beq $t0, 0, label_FALSEIF_421 -# LOCAL local_main_at_Main_internal_152 --> -612($fp) -# local_main_at_Main_internal_152 = SELF -sw $s1, -612($fp) -# LOCAL local_main_at_Main_internal_150 --> -604($fp) -# LOCAL local_main_at_Main_internal_152 --> -612($fp) -# local_main_at_Main_internal_150 = local_main_at_Main_internal_152 -lw $t0, -612($fp) -sw $t0, -604($fp) +# LOCAL local_main_at_Main_internal_156 --> -628($fp) +# local_main_at_Main_internal_156 = SELF +sw $s1, -628($fp) +# LOCAL local_main_at_Main_internal_154 --> -620($fp) +# LOCAL local_main_at_Main_internal_156 --> -628($fp) +# local_main_at_Main_internal_154 = local_main_at_Main_internal_156 +lw $t0, -628($fp) +sw $t0, -620($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_153 --> -616($fp) +# LOCAL local_main_at_Main_internal_157 --> -632($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -20291,18 +20300,18 @@ la $t0, data_68 sw $t0, 12($v0) li $t0, 7 sw $t0, 16($v0) -sw $v0, -616($fp) -# ARG local_main_at_Main_internal_153 -# LOCAL local_main_at_Main_internal_153 --> -616($fp) -lw $t0, -616($fp) +sw $v0, -632($fp) +# ARG local_main_at_Main_internal_157 +# LOCAL local_main_at_Main_internal_157 --> -632($fp) +lw $t0, -632($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_150 --> -604($fp) -# LOCAL local_main_at_Main_internal_151 --> -608($fp) -# local_main_at_Main_internal_151 = VCALL local_main_at_Main_internal_150 out_string +# LOCAL local_main_at_Main_internal_154 --> -620($fp) +# LOCAL local_main_at_Main_internal_155 --> -624($fp) +# local_main_at_Main_internal_155 = VCALL local_main_at_Main_internal_154 out_string # Save new self pointer in $s1 -lw $s1, -604($fp) +lw $s1, -620($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -20311,36 +20320,36 @@ lw $t0, 0($t0) lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -608($fp) +sw $v0, -624($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_156 --> -628($fp) -# local_main_at_Main_internal_156 = SELF -sw $s1, -628($fp) -# LOCAL local_main_at_Main_internal_154 --> -620($fp) -# LOCAL local_main_at_Main_internal_156 --> -628($fp) -# local_main_at_Main_internal_154 = local_main_at_Main_internal_156 -lw $t0, -628($fp) -sw $t0, -620($fp) +# LOCAL local_main_at_Main_internal_160 --> -644($fp) +# local_main_at_Main_internal_160 = SELF +sw $s1, -644($fp) +# LOCAL local_main_at_Main_internal_158 --> -636($fp) +# LOCAL local_main_at_Main_internal_160 --> -644($fp) +# local_main_at_Main_internal_158 = local_main_at_Main_internal_160 +lw $t0, -644($fp) +sw $t0, -636($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# local_main_at_Main_internal_157 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_157 --> -632($fp) +# local_main_at_Main_internal_161 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_161 --> -648($fp) lw $t0, 16($s1) -sw $t0, -632($fp) -# ARG local_main_at_Main_internal_157 -# LOCAL local_main_at_Main_internal_157 --> -632($fp) -lw $t0, -632($fp) +sw $t0, -648($fp) +# ARG local_main_at_Main_internal_161 +# LOCAL local_main_at_Main_internal_161 --> -648($fp) +lw $t0, -648($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_154 --> -620($fp) -# LOCAL local_main_at_Main_internal_155 --> -624($fp) -# local_main_at_Main_internal_155 = VCALL local_main_at_Main_internal_154 print +# LOCAL local_main_at_Main_internal_158 --> -636($fp) +# LOCAL local_main_at_Main_internal_159 --> -640($fp) +# local_main_at_Main_internal_159 = VCALL local_main_at_Main_internal_158 print # Save new self pointer in $s1 -lw $s1, -620($fp) +lw $s1, -636($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -20349,22 +20358,22 @@ lw $t0, 0($t0) lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -624($fp) +sw $v0, -640($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_160 --> -644($fp) -# local_main_at_Main_internal_160 = SELF -sw $s1, -644($fp) -# LOCAL local_main_at_Main_internal_158 --> -636($fp) -# LOCAL local_main_at_Main_internal_160 --> -644($fp) -# local_main_at_Main_internal_158 = local_main_at_Main_internal_160 -lw $t0, -644($fp) -sw $t0, -636($fp) +# LOCAL local_main_at_Main_internal_164 --> -660($fp) +# local_main_at_Main_internal_164 = SELF +sw $s1, -660($fp) +# LOCAL local_main_at_Main_internal_162 --> -652($fp) +# LOCAL local_main_at_Main_internal_164 --> -660($fp) +# local_main_at_Main_internal_162 = local_main_at_Main_internal_164 +lw $t0, -660($fp) +sw $t0, -652($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_161 --> -648($fp) +# LOCAL local_main_at_Main_internal_165 --> -664($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -20381,18 +20390,18 @@ la $t0, data_69 sw $t0, 12($v0) li $t0, 19 sw $t0, 16($v0) -sw $v0, -648($fp) -# ARG local_main_at_Main_internal_161 -# LOCAL local_main_at_Main_internal_161 --> -648($fp) -lw $t0, -648($fp) +sw $v0, -664($fp) +# ARG local_main_at_Main_internal_165 +# LOCAL local_main_at_Main_internal_165 --> -664($fp) +lw $t0, -664($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_158 --> -636($fp) -# LOCAL local_main_at_Main_internal_159 --> -640($fp) -# local_main_at_Main_internal_159 = VCALL local_main_at_Main_internal_158 out_string +# LOCAL local_main_at_Main_internal_162 --> -652($fp) +# LOCAL local_main_at_Main_internal_163 --> -656($fp) +# local_main_at_Main_internal_163 = VCALL local_main_at_Main_internal_162 out_string # Save new self pointer in $s1 -lw $s1, -636($fp) +lw $s1, -652($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -20401,30 +20410,30 @@ lw $t0, 0($t0) lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -640($fp) +sw $v0, -656($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_143 --> -576($fp) -# LOCAL local_main_at_Main_internal_159 --> -640($fp) -# local_main_at_Main_internal_143 = local_main_at_Main_internal_159 -lw $t0, -640($fp) -sw $t0, -576($fp) +# LOCAL local_main_at_Main_internal_147 --> -592($fp) +# LOCAL local_main_at_Main_internal_163 --> -656($fp) +# local_main_at_Main_internal_147 = local_main_at_Main_internal_163 +lw $t0, -656($fp) +sw $t0, -592($fp) # GOTO label_ENDIF_422 j label_ENDIF_422 label_FALSEIF_421: - # LOCAL local_main_at_Main_internal_164 --> -660($fp) - # local_main_at_Main_internal_164 = SELF - sw $s1, -660($fp) - # LOCAL local_main_at_Main_internal_162 --> -652($fp) - # LOCAL local_main_at_Main_internal_164 --> -660($fp) - # local_main_at_Main_internal_162 = local_main_at_Main_internal_164 - lw $t0, -660($fp) - sw $t0, -652($fp) + # LOCAL local_main_at_Main_internal_168 --> -676($fp) + # local_main_at_Main_internal_168 = SELF + sw $s1, -676($fp) + # LOCAL local_main_at_Main_internal_166 --> -668($fp) + # LOCAL local_main_at_Main_internal_168 --> -676($fp) + # local_main_at_Main_internal_166 = local_main_at_Main_internal_168 + lw $t0, -676($fp) + sw $t0, -668($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_165 --> -664($fp) + # LOCAL local_main_at_Main_internal_169 --> -680($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -20441,18 +20450,18 @@ label_FALSEIF_421: sw $t0, 12($v0) li $t0, 7 sw $t0, 16($v0) - sw $v0, -664($fp) - # ARG local_main_at_Main_internal_165 - # LOCAL local_main_at_Main_internal_165 --> -664($fp) - lw $t0, -664($fp) + sw $v0, -680($fp) + # ARG local_main_at_Main_internal_169 + # LOCAL local_main_at_Main_internal_169 --> -680($fp) + lw $t0, -680($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_162 --> -652($fp) - # LOCAL local_main_at_Main_internal_163 --> -656($fp) - # local_main_at_Main_internal_163 = VCALL local_main_at_Main_internal_162 out_string + # LOCAL local_main_at_Main_internal_166 --> -668($fp) + # LOCAL local_main_at_Main_internal_167 --> -672($fp) + # local_main_at_Main_internal_167 = VCALL local_main_at_Main_internal_166 out_string # Save new self pointer in $s1 - lw $s1, -652($fp) + lw $s1, -668($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -20461,36 +20470,36 @@ label_FALSEIF_421: lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 - sw $v0, -656($fp) + sw $v0, -672($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_168 --> -676($fp) - # local_main_at_Main_internal_168 = SELF - sw $s1, -676($fp) - # LOCAL local_main_at_Main_internal_166 --> -668($fp) - # LOCAL local_main_at_Main_internal_168 --> -676($fp) - # local_main_at_Main_internal_166 = local_main_at_Main_internal_168 - lw $t0, -676($fp) - sw $t0, -668($fp) + # LOCAL local_main_at_Main_internal_172 --> -692($fp) + # local_main_at_Main_internal_172 = SELF + sw $s1, -692($fp) + # LOCAL local_main_at_Main_internal_170 --> -684($fp) + # LOCAL local_main_at_Main_internal_172 --> -692($fp) + # local_main_at_Main_internal_170 = local_main_at_Main_internal_172 + lw $t0, -692($fp) + sw $t0, -684($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_main_at_Main_internal_169 = GETATTRIBUTE avar Main - # LOCAL local_main_at_Main_internal_169 --> -680($fp) + # local_main_at_Main_internal_173 = GETATTRIBUTE avar Main + # LOCAL local_main_at_Main_internal_173 --> -696($fp) lw $t0, 16($s1) - sw $t0, -680($fp) - # ARG local_main_at_Main_internal_169 - # LOCAL local_main_at_Main_internal_169 --> -680($fp) - lw $t0, -680($fp) + sw $t0, -696($fp) + # ARG local_main_at_Main_internal_173 + # LOCAL local_main_at_Main_internal_173 --> -696($fp) + lw $t0, -696($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_166 --> -668($fp) - # LOCAL local_main_at_Main_internal_167 --> -672($fp) - # local_main_at_Main_internal_167 = VCALL local_main_at_Main_internal_166 print + # LOCAL local_main_at_Main_internal_170 --> -684($fp) + # LOCAL local_main_at_Main_internal_171 --> -688($fp) + # local_main_at_Main_internal_171 = VCALL local_main_at_Main_internal_170 print # Save new self pointer in $s1 - lw $s1, -668($fp) + lw $s1, -684($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -20499,22 +20508,22 @@ label_FALSEIF_421: lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 - sw $v0, -672($fp) + sw $v0, -688($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_172 --> -692($fp) - # local_main_at_Main_internal_172 = SELF - sw $s1, -692($fp) - # LOCAL local_main_at_Main_internal_170 --> -684($fp) - # LOCAL local_main_at_Main_internal_172 --> -692($fp) - # local_main_at_Main_internal_170 = local_main_at_Main_internal_172 - lw $t0, -692($fp) - sw $t0, -684($fp) + # LOCAL local_main_at_Main_internal_176 --> -708($fp) + # local_main_at_Main_internal_176 = SELF + sw $s1, -708($fp) + # LOCAL local_main_at_Main_internal_174 --> -700($fp) + # LOCAL local_main_at_Main_internal_176 --> -708($fp) + # local_main_at_Main_internal_174 = local_main_at_Main_internal_176 + lw $t0, -708($fp) + sw $t0, -700($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_173 --> -696($fp) + # LOCAL local_main_at_Main_internal_177 --> -712($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -20531,18 +20540,18 @@ label_FALSEIF_421: sw $t0, 12($v0) li $t0, 23 sw $t0, 16($v0) - sw $v0, -696($fp) - # ARG local_main_at_Main_internal_173 - # LOCAL local_main_at_Main_internal_173 --> -696($fp) - lw $t0, -696($fp) + sw $v0, -712($fp) + # ARG local_main_at_Main_internal_177 + # LOCAL local_main_at_Main_internal_177 --> -712($fp) + lw $t0, -712($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_170 --> -684($fp) - # LOCAL local_main_at_Main_internal_171 --> -688($fp) - # local_main_at_Main_internal_171 = VCALL local_main_at_Main_internal_170 out_string + # LOCAL local_main_at_Main_internal_174 --> -700($fp) + # LOCAL local_main_at_Main_internal_175 --> -704($fp) + # local_main_at_Main_internal_175 = VCALL local_main_at_Main_internal_174 out_string # Save new self pointer in $s1 - lw $s1, -684($fp) + lw $s1, -700($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -20551,29 +20560,29 @@ label_FALSEIF_421: lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 - sw $v0, -688($fp) + sw $v0, -704($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_143 --> -576($fp) - # LOCAL local_main_at_Main_internal_171 --> -688($fp) - # local_main_at_Main_internal_143 = local_main_at_Main_internal_171 - lw $t0, -688($fp) - sw $t0, -576($fp) + # LOCAL local_main_at_Main_internal_147 --> -592($fp) + # LOCAL local_main_at_Main_internal_175 --> -704($fp) + # local_main_at_Main_internal_147 = local_main_at_Main_internal_175 + lw $t0, -704($fp) + sw $t0, -592($fp) label_ENDIF_422: -# LOCAL local_main_at_Main_internal_137 --> -552($fp) -# LOCAL local_main_at_Main_internal_143 --> -576($fp) -# local_main_at_Main_internal_137 = local_main_at_Main_internal_143 -lw $t0, -576($fp) -sw $t0, -552($fp) +# LOCAL local_main_at_Main_internal_141 --> -568($fp) +# LOCAL local_main_at_Main_internal_147 --> -592($fp) +# local_main_at_Main_internal_141 = local_main_at_Main_internal_147 +lw $t0, -592($fp) +sw $t0, -568($fp) # GOTO label_ENDIF_412 j label_ENDIF_412 label_FALSEIF_411: - # local_main_at_Main_internal_178 = GETATTRIBUTE char Main - # LOCAL local_main_at_Main_internal_178 --> -716($fp) + # local_main_at_Main_internal_182 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_182 --> -732($fp) lw $t0, 12($s1) - sw $t0, -716($fp) - # LOCAL local_main_at_Main_internal_179 --> -720($fp) + sw $t0, -732($fp) + # LOCAL local_main_at_Main_internal_183 --> -736($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -20590,111 +20599,111 @@ label_FALSEIF_411: sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) - sw $v0, -720($fp) - # IF_ZERO local_main_at_Main_internal_178 GOTO label_FALSE_425 - # IF_ZERO local_main_at_Main_internal_178 GOTO label_FALSE_425 - lw $t0, -716($fp) + sw $v0, -736($fp) + # IF_ZERO local_main_at_Main_internal_182 GOTO label_FALSE_425 + # IF_ZERO local_main_at_Main_internal_182 GOTO label_FALSE_425 + lw $t0, -732($fp) beq $t0, 0, label_FALSE_425 - # IF_ZERO local_main_at_Main_internal_179 GOTO label_FALSE_425 - # IF_ZERO local_main_at_Main_internal_179 GOTO label_FALSE_425 - lw $t0, -720($fp) + # IF_ZERO local_main_at_Main_internal_183 GOTO label_FALSE_425 + # IF_ZERO local_main_at_Main_internal_183 GOTO label_FALSE_425 + lw $t0, -736($fp) beq $t0, 0, label_FALSE_425 - # LOCAL local_main_at_Main_internal_177 --> -712($fp) - # LOCAL local_main_at_Main_internal_178 --> -716($fp) - # Comparing -716($fp) type with String + # LOCAL local_main_at_Main_internal_181 --> -728($fp) + # LOCAL local_main_at_Main_internal_182 --> -732($fp) + # Comparing -732($fp) type with String la $v0, String - lw $a0, -716($fp) + lw $a0, -732($fp) lw $a0, 0($a0) sub $a0, $a0, $v0 - sw $a0, -712($fp) - # IF_ZERO local_main_at_Main_internal_177 GOTO label_COMPARE_STRING_428 - # IF_ZERO local_main_at_Main_internal_177 GOTO label_COMPARE_STRING_428 - lw $t0, -712($fp) + sw $a0, -728($fp) + # IF_ZERO local_main_at_Main_internal_181 GOTO label_COMPARE_STRING_428 + # IF_ZERO local_main_at_Main_internal_181 GOTO label_COMPARE_STRING_428 + lw $t0, -728($fp) beq $t0, 0, label_COMPARE_STRING_428 - # LOCAL local_main_at_Main_internal_177 --> -712($fp) - # LOCAL local_main_at_Main_internal_178 --> -716($fp) - # Comparing -716($fp) type with Bool + # LOCAL local_main_at_Main_internal_181 --> -728($fp) + # LOCAL local_main_at_Main_internal_182 --> -732($fp) + # Comparing -732($fp) type with Bool la $v0, Bool - lw $a0, -716($fp) + lw $a0, -732($fp) lw $a0, 0($a0) lw $a0, 12($a0) sub $a0, $a0, $v0 - sw $a0, -712($fp) - # IF_ZERO local_main_at_Main_internal_177 GOTO label_COMPARE_BY_VALUE_429 - # IF_ZERO local_main_at_Main_internal_177 GOTO label_COMPARE_BY_VALUE_429 - lw $t0, -712($fp) + sw $a0, -728($fp) + # IF_ZERO local_main_at_Main_internal_181 GOTO label_COMPARE_BY_VALUE_429 + # IF_ZERO local_main_at_Main_internal_181 GOTO label_COMPARE_BY_VALUE_429 + lw $t0, -728($fp) beq $t0, 0, label_COMPARE_BY_VALUE_429 - # LOCAL local_main_at_Main_internal_177 --> -712($fp) - # LOCAL local_main_at_Main_internal_178 --> -716($fp) - # Comparing -716($fp) type with Int + # LOCAL local_main_at_Main_internal_181 --> -728($fp) + # LOCAL local_main_at_Main_internal_182 --> -732($fp) + # Comparing -732($fp) type with Int la $v0, Int - lw $a0, -716($fp) + lw $a0, -732($fp) lw $a0, 0($a0) lw $a0, 12($a0) sub $a0, $a0, $v0 - sw $a0, -712($fp) - # IF_ZERO local_main_at_Main_internal_177 GOTO label_COMPARE_BY_VALUE_429 - # IF_ZERO local_main_at_Main_internal_177 GOTO label_COMPARE_BY_VALUE_429 - lw $t0, -712($fp) + sw $a0, -728($fp) + # IF_ZERO local_main_at_Main_internal_181 GOTO label_COMPARE_BY_VALUE_429 + # IF_ZERO local_main_at_Main_internal_181 GOTO label_COMPARE_BY_VALUE_429 + lw $t0, -728($fp) beq $t0, 0, label_COMPARE_BY_VALUE_429 - # LOCAL local_main_at_Main_internal_177 --> -712($fp) - # LOCAL local_main_at_Main_internal_178 --> -716($fp) - # LOCAL local_main_at_Main_internal_179 --> -720($fp) + # LOCAL local_main_at_Main_internal_181 --> -728($fp) + # LOCAL local_main_at_Main_internal_182 --> -732($fp) + # LOCAL local_main_at_Main_internal_183 --> -736($fp) # Load pointers and SUB - lw $a0, -716($fp) - lw $a1, -720($fp) + lw $a0, -732($fp) + lw $a1, -736($fp) sub $a0, $a0, $a1 - sw $a0, -712($fp) - # IF_ZERO local_main_at_Main_internal_177 GOTO label_TRUE_426 - # IF_ZERO local_main_at_Main_internal_177 GOTO label_TRUE_426 - lw $t0, -712($fp) + sw $a0, -728($fp) + # IF_ZERO local_main_at_Main_internal_181 GOTO label_TRUE_426 + # IF_ZERO local_main_at_Main_internal_181 GOTO label_TRUE_426 + lw $t0, -728($fp) beq $t0, 0, label_TRUE_426 # GOTO label_FALSE_425 j label_FALSE_425 label_COMPARE_BY_VALUE_429: - # LOCAL local_main_at_Main_internal_177 --> -712($fp) - # LOCAL local_main_at_Main_internal_178 --> -716($fp) - # LOCAL local_main_at_Main_internal_179 --> -720($fp) - lw $a0, -716($fp) - lw $a1, -720($fp) + # LOCAL local_main_at_Main_internal_181 --> -728($fp) + # LOCAL local_main_at_Main_internal_182 --> -732($fp) + # LOCAL local_main_at_Main_internal_183 --> -736($fp) + lw $a0, -732($fp) + lw $a1, -736($fp) # Load values lw $a0, 12($a0) lw $a1, 12($a1) # SUB and store sub $a0, $a0, $a1 - sw $a0, -712($fp) - # IF_ZERO local_main_at_Main_internal_177 GOTO label_TRUE_426 - # IF_ZERO local_main_at_Main_internal_177 GOTO label_TRUE_426 - lw $t0, -712($fp) + sw $a0, -728($fp) + # IF_ZERO local_main_at_Main_internal_181 GOTO label_TRUE_426 + # IF_ZERO local_main_at_Main_internal_181 GOTO label_TRUE_426 + lw $t0, -728($fp) beq $t0, 0, label_TRUE_426 # GOTO label_FALSE_425 j label_FALSE_425 label_COMPARE_STRING_428: - # LOCAL local_main_at_Main_internal_177 --> -712($fp) - # LOCAL local_main_at_Main_internal_178 --> -716($fp) - # LOCAL local_main_at_Main_internal_179 --> -720($fp) + # LOCAL local_main_at_Main_internal_181 --> -728($fp) + # LOCAL local_main_at_Main_internal_182 --> -732($fp) + # LOCAL local_main_at_Main_internal_183 --> -736($fp) # Load strings for comparison - lw $v0, -716($fp) - lw $v1, -720($fp) + lw $v0, -732($fp) + lw $v1, -736($fp) # Compare lengths lw $v0, 16($v0) lw $v1, 16($v1) sub $v0, $v0, $v1 - sw $v0, -712($fp) - # IF_ZERO local_main_at_Main_internal_177 GOTO label_CONTINUE_430 - # IF_ZERO local_main_at_Main_internal_177 GOTO label_CONTINUE_430 - lw $t0, -712($fp) + sw $v0, -728($fp) + # IF_ZERO local_main_at_Main_internal_181 GOTO label_CONTINUE_430 + # IF_ZERO local_main_at_Main_internal_181 GOTO label_CONTINUE_430 + lw $t0, -728($fp) beq $t0, 0, label_CONTINUE_430 # GOTO label_FALSE_425 j label_FALSE_425 label_CONTINUE_430: - # LOCAL local_main_at_Main_internal_177 --> -712($fp) - # LOCAL local_main_at_Main_internal_178 --> -716($fp) - # LOCAL local_main_at_Main_internal_179 --> -720($fp) + # LOCAL local_main_at_Main_internal_181 --> -728($fp) + # LOCAL local_main_at_Main_internal_182 --> -732($fp) + # LOCAL local_main_at_Main_internal_183 --> -736($fp) move $a2, $zero # Load strings for comparison - lw $v0, -716($fp) - lw $v1, -720($fp) + lw $v0, -732($fp) + lw $v1, -736($fp) # Load strings pointers lw $v0, 12($v0) lw $v1, 12($v1) @@ -20714,13 +20723,13 @@ label_FALSEIF_411: li $a2, 1 label_WHILE_STR_COMP_END_432: # Store result - sw $a2, -712($fp) - # IF_ZERO local_main_at_Main_internal_177 GOTO label_TRUE_426 - # IF_ZERO local_main_at_Main_internal_177 GOTO label_TRUE_426 - lw $t0, -712($fp) + sw $a2, -728($fp) + # IF_ZERO local_main_at_Main_internal_181 GOTO label_TRUE_426 + # IF_ZERO local_main_at_Main_internal_181 GOTO label_TRUE_426 + lw $t0, -728($fp) beq $t0, 0, label_TRUE_426 label_FALSE_425: - # LOCAL local_main_at_Main_internal_176 --> -708($fp) + # LOCAL local_main_at_Main_internal_180 --> -724($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -20750,11 +20759,11 @@ label_FALSEIF_411: sw $t0, 8($v0) li $t0, 0 sw $t0, 12($v0) - sw $v0, -708($fp) + sw $v0, -724($fp) # GOTO label_END_427 j label_END_427 label_TRUE_426: - # LOCAL local_main_at_Main_internal_176 --> -708($fp) + # LOCAL local_main_at_Main_internal_180 --> -724($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -20784,66 +20793,24 @@ label_TRUE_426: sw $t0, 8($v0) li $t0, 1 sw $t0, 12($v0) - sw $v0, -708($fp) + sw $v0, -724($fp) label_END_427: -# LOCAL local_main_at_Main_internal_174 --> -700($fp) -# LOCAL local_main_at_Main_internal_176 --> -708($fp) -# Obtain value from -708($fp) -lw $v0, -708($fp) +# LOCAL local_main_at_Main_internal_178 --> -716($fp) +# LOCAL local_main_at_Main_internal_180 --> -724($fp) +# Obtain value from -724($fp) +lw $v0, -724($fp) lw $v0, 12($v0) -sw $v0, -700($fp) -# IF_ZERO local_main_at_Main_internal_174 GOTO label_FALSEIF_423 -# IF_ZERO local_main_at_Main_internal_174 GOTO label_FALSEIF_423 -lw $t0, -700($fp) +sw $v0, -716($fp) +# IF_ZERO local_main_at_Main_internal_178 GOTO label_FALSEIF_423 +# IF_ZERO local_main_at_Main_internal_178 GOTO label_FALSEIF_423 +lw $t0, -716($fp) beq $t0, 0, label_FALSEIF_423 -# LOCAL local_main_at_Main_x_180 --> -724($fp) -# local_main_at_Main_x_180 = ALLOCATE A -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type name -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, A -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, A_start -sw $t0, 4($v0) -# Load type offset -li $t0, 24 -sw $t0, 8($v0) -move $t1, $v0 -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -move $s1, $v0 -# Push register t1 into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -jal __A__attrib__var__init -# Pop 4 bytes from stack into register t1 -lw $t1, 0($sp) -addu $sp, $sp, 4 -sw $v0, 12($t1) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -sw $t1, -724($fp) -# LOCAL local_main_at_Main_internal_183 --> -736($fp) -# local_main_at_Main_internal_183 = ALLOCATE E +# LOCAL local_main_at_Main_x_184 --> -740($fp) +# local_main_at_Main_x_184 = 0 +li $t0, 0 +sw $t0, -740($fp) +# LOCAL local_main_at_Main_internal_187 --> -752($fp) +# local_main_at_Main_internal_187 = ALLOCATE E # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -20887,32 +20854,32 @@ sw $v0, 12($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -sw $t1, -736($fp) -# LOCAL local_main_at_Main_internal_181 --> -728($fp) -# LOCAL local_main_at_Main_internal_183 --> -736($fp) -# local_main_at_Main_internal_181 = local_main_at_Main_internal_183 -lw $t0, -736($fp) -sw $t0, -728($fp) +sw $t1, -752($fp) +# LOCAL local_main_at_Main_internal_185 --> -744($fp) +# LOCAL local_main_at_Main_internal_187 --> -752($fp) +# local_main_at_Main_internal_185 = local_main_at_Main_internal_187 +lw $t0, -752($fp) +sw $t0, -744($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# local_main_at_Main_internal_186 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_186 --> -748($fp) +# local_main_at_Main_internal_190 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_190 --> -764($fp) lw $t0, 16($s1) -sw $t0, -748($fp) -# LOCAL local_main_at_Main_internal_184 --> -740($fp) -# LOCAL local_main_at_Main_internal_186 --> -748($fp) -# local_main_at_Main_internal_184 = local_main_at_Main_internal_186 -lw $t0, -748($fp) -sw $t0, -740($fp) +sw $t0, -764($fp) +# LOCAL local_main_at_Main_internal_188 --> -756($fp) +# LOCAL local_main_at_Main_internal_190 --> -764($fp) +# local_main_at_Main_internal_188 = local_main_at_Main_internal_190 +lw $t0, -764($fp) +sw $t0, -756($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_184 --> -740($fp) -# LOCAL local_main_at_Main_internal_185 --> -744($fp) -# local_main_at_Main_internal_185 = VCALL local_main_at_Main_internal_184 value +# LOCAL local_main_at_Main_internal_188 --> -756($fp) +# LOCAL local_main_at_Main_internal_189 --> -760($fp) +# local_main_at_Main_internal_189 = VCALL local_main_at_Main_internal_188 value # Save new self pointer in $s1 -lw $s1, -740($fp) +lw $s1, -756($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -20921,21 +20888,21 @@ lw $t0, 0($t0) lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -744($fp) +sw $v0, -760($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_185 -# LOCAL local_main_at_Main_internal_185 --> -744($fp) -lw $t0, -744($fp) +# ARG local_main_at_Main_internal_189 +# LOCAL local_main_at_Main_internal_189 --> -760($fp) +lw $t0, -760($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_181 --> -728($fp) -# LOCAL local_main_at_Main_internal_182 --> -732($fp) -# local_main_at_Main_internal_182 = VCALL local_main_at_Main_internal_181 method6 +# LOCAL local_main_at_Main_internal_185 --> -744($fp) +# LOCAL local_main_at_Main_internal_186 --> -748($fp) +# local_main_at_Main_internal_186 = VCALL local_main_at_Main_internal_185 method6 # Save new self pointer in $s1 -lw $s1, -728($fp) +lw $s1, -744($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -20944,16 +20911,16 @@ lw $t0, 0($t0) lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -732($fp) +sw $v0, -748($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_main_at_Main_x_180 --> -724($fp) -# LOCAL local_main_at_Main_internal_182 --> -732($fp) -# local_main_at_Main_x_180 = local_main_at_Main_internal_182 -lw $t0, -732($fp) -sw $t0, -724($fp) -# LOCAL local_main_at_Main_r_187 --> -752($fp) +# LOCAL local_main_at_Main_x_184 --> -740($fp) +# LOCAL local_main_at_Main_internal_186 --> -748($fp) +# local_main_at_Main_x_184 = local_main_at_Main_internal_186 +lw $t0, -748($fp) +sw $t0, -740($fp) +# LOCAL local_main_at_Main_r_191 --> -768($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -20983,24 +20950,24 @@ li $t0, 16 sw $t0, 8($v0) li $t0, 0 sw $t0, 12($v0) -sw $v0, -752($fp) -# local_main_at_Main_internal_191 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_191 --> -768($fp) +sw $v0, -768($fp) +# local_main_at_Main_internal_195 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_195 --> -784($fp) lw $t0, 16($s1) -sw $t0, -768($fp) -# LOCAL local_main_at_Main_internal_189 --> -760($fp) -# LOCAL local_main_at_Main_internal_191 --> -768($fp) -# local_main_at_Main_internal_189 = local_main_at_Main_internal_191 -lw $t0, -768($fp) -sw $t0, -760($fp) +sw $t0, -784($fp) +# LOCAL local_main_at_Main_internal_193 --> -776($fp) +# LOCAL local_main_at_Main_internal_195 --> -784($fp) +# local_main_at_Main_internal_193 = local_main_at_Main_internal_195 +lw $t0, -784($fp) +sw $t0, -776($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_189 --> -760($fp) -# LOCAL local_main_at_Main_internal_190 --> -764($fp) -# local_main_at_Main_internal_190 = VCALL local_main_at_Main_internal_189 value +# LOCAL local_main_at_Main_internal_193 --> -776($fp) +# LOCAL local_main_at_Main_internal_194 --> -780($fp) +# local_main_at_Main_internal_194 = VCALL local_main_at_Main_internal_193 value # Save new self pointer in $s1 -lw $s1, -760($fp) +lw $s1, -776($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -21009,23 +20976,23 @@ lw $t0, 0($t0) lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -764($fp) +sw $v0, -780($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_193 --> -776($fp) -# LOCAL local_main_at_Main_x_180 --> -724($fp) -# local_main_at_Main_internal_193 = local_main_at_Main_x_180 -lw $t0, -724($fp) -sw $t0, -776($fp) +# LOCAL local_main_at_Main_internal_197 --> -792($fp) +# LOCAL local_main_at_Main_x_184 --> -740($fp) +# local_main_at_Main_internal_197 = local_main_at_Main_x_184 +lw $t0, -740($fp) +sw $t0, -792($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_193 --> -776($fp) -# LOCAL local_main_at_Main_internal_194 --> -780($fp) -# local_main_at_Main_internal_194 = VCALL local_main_at_Main_internal_193 value +# LOCAL local_main_at_Main_internal_197 --> -792($fp) +# LOCAL local_main_at_Main_internal_198 --> -796($fp) +# local_main_at_Main_internal_198 = VCALL local_main_at_Main_internal_197 value # Save new self pointer in $s1 -lw $s1, -776($fp) +lw $s1, -792($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -21034,11 +21001,11 @@ lw $t0, 0($t0) lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -780($fp) +sw $v0, -796($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_195 --> -784($fp) +# LOCAL local_main_at_Main_internal_199 --> -800($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -21068,14 +21035,14 @@ li $t0, 16 sw $t0, 8($v0) li $t0, 8 sw $t0, 12($v0) -sw $v0, -784($fp) -# LOCAL local_main_at_Main_internal_192 --> -772($fp) -# LOCAL local_main_at_Main_internal_194 --> -780($fp) -# LOCAL local_main_at_Main_internal_195 --> -784($fp) -# local_main_at_Main_internal_192 = local_main_at_Main_internal_194 * local_main_at_Main_internal_195 -lw $t1, -780($fp) +sw $v0, -800($fp) +# LOCAL local_main_at_Main_internal_196 --> -788($fp) +# LOCAL local_main_at_Main_internal_198 --> -796($fp) +# LOCAL local_main_at_Main_internal_199 --> -800($fp) +# local_main_at_Main_internal_196 = local_main_at_Main_internal_198 * local_main_at_Main_internal_199 +lw $t1, -796($fp) lw $t0, 12($t1) -lw $t1, -784($fp) +lw $t1, -800($fp) lw $t2, 12($t1) mul $t0, $t0, $t2 # Allocating 20 bytes of memory @@ -21106,14 +21073,14 @@ sw $t1, 4($v0) li $t1, 16 sw $t1, 8($v0) sw $t0, 12($v0) -sw $v0, -772($fp) -# LOCAL local_main_at_Main_internal_188 --> -756($fp) -# LOCAL local_main_at_Main_internal_190 --> -764($fp) +sw $v0, -788($fp) # LOCAL local_main_at_Main_internal_192 --> -772($fp) -# local_main_at_Main_internal_188 = local_main_at_Main_internal_190 - local_main_at_Main_internal_192 -lw $t1, -764($fp) +# LOCAL local_main_at_Main_internal_194 --> -780($fp) +# LOCAL local_main_at_Main_internal_196 --> -788($fp) +# local_main_at_Main_internal_192 = local_main_at_Main_internal_194 - local_main_at_Main_internal_196 +lw $t1, -780($fp) lw $t0, 12($t1) -lw $t1, -772($fp) +lw $t1, -788($fp) lw $t2, 12($t1) sub $t0, $t0, $t2 # Allocating 20 bytes of memory @@ -21138,70 +21105,18 @@ li $a0, 16 li $v0, 9 syscall sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -756($fp) -# LOCAL local_main_at_Main_r_187 --> -752($fp) -# LOCAL local_main_at_Main_internal_188 --> -756($fp) -# local_main_at_Main_r_187 = local_main_at_Main_internal_188 -lw $t0, -756($fp) -sw $t0, -752($fp) -# LOCAL local_main_at_Main_internal_198 --> -796($fp) -# local_main_at_Main_internal_198 = SELF -sw $s1, -796($fp) -# LOCAL local_main_at_Main_internal_196 --> -788($fp) -# LOCAL local_main_at_Main_internal_198 --> -796($fp) -# local_main_at_Main_internal_196 = local_main_at_Main_internal_198 -lw $t0, -796($fp) -sw $t0, -788($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_199 --> -800($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_73 -sw $t0, 12($v0) -li $t0, 7 -sw $t0, 16($v0) -sw $v0, -800($fp) -# ARG local_main_at_Main_internal_199 -# LOCAL local_main_at_Main_internal_199 --> -800($fp) -lw $t0, -800($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_196 --> -788($fp) -# LOCAL local_main_at_Main_internal_197 --> -792($fp) -# local_main_at_Main_internal_197 = VCALL local_main_at_Main_internal_196 out_string -# Save new self pointer in $s1 -lw $s1, -788($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 12($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -792($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -772($fp) +# LOCAL local_main_at_Main_r_191 --> -768($fp) +# LOCAL local_main_at_Main_internal_192 --> -772($fp) +# local_main_at_Main_r_191 = local_main_at_Main_internal_192 +lw $t0, -772($fp) +sw $t0, -768($fp) # LOCAL local_main_at_Main_internal_202 --> -812($fp) # local_main_at_Main_internal_202 = SELF sw $s1, -812($fp) @@ -21213,10 +21128,24 @@ sw $t0, -804($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# local_main_at_Main_internal_203 = GETATTRIBUTE avar Main # LOCAL local_main_at_Main_internal_203 --> -816($fp) -lw $t0, 16($s1) -sw $t0, -816($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_73 +sw $t0, 12($v0) +li $t0, 7 +sw $t0, 16($v0) +sw $v0, -816($fp) # ARG local_main_at_Main_internal_203 # LOCAL local_main_at_Main_internal_203 --> -816($fp) lw $t0, -816($fp) @@ -21225,7 +21154,7 @@ subu $sp, $sp, 4 sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_200 --> -804($fp) # LOCAL local_main_at_Main_internal_201 --> -808($fp) -# local_main_at_Main_internal_201 = VCALL local_main_at_Main_internal_200 print +# local_main_at_Main_internal_201 = VCALL local_main_at_Main_internal_200 out_string # Save new self pointer in $s1 lw $s1, -804($fp) # Get pointer to type @@ -21233,7 +21162,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 48($t0) +lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -808($fp) @@ -21251,24 +21180,10 @@ sw $t0, -820($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) +# local_main_at_Main_internal_207 = GETATTRIBUTE avar Main # LOCAL local_main_at_Main_internal_207 --> -832($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_74 -sw $t0, 12($v0) -li $t0, 12 -sw $t0, 16($v0) -sw $v0, -832($fp) +lw $t0, 16($s1) +sw $t0, -832($fp) # ARG local_main_at_Main_internal_207 # LOCAL local_main_at_Main_internal_207 --> -832($fp) lw $t0, -832($fp) @@ -21277,7 +21192,7 @@ subu $sp, $sp, 4 sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_204 --> -820($fp) # LOCAL local_main_at_Main_internal_205 --> -824($fp) -# local_main_at_Main_internal_205 = VCALL local_main_at_Main_internal_204 out_string +# local_main_at_Main_internal_205 = VCALL local_main_at_Main_internal_204 print # Save new self pointer in $s1 lw $s1, -820($fp) # Get pointer to type @@ -21285,7 +21200,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -824($fp) @@ -21303,15 +21218,33 @@ sw $t0, -836($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# ARG local_main_at_Main_x_180 -# LOCAL local_main_at_Main_x_180 --> -724($fp) -lw $t0, -724($fp) +# LOCAL local_main_at_Main_internal_211 --> -848($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_74 +sw $t0, 12($v0) +li $t0, 12 +sw $t0, 16($v0) +sw $v0, -848($fp) +# ARG local_main_at_Main_internal_211 +# LOCAL local_main_at_Main_internal_211 --> -848($fp) +lw $t0, -848($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) # LOCAL local_main_at_Main_internal_208 --> -836($fp) # LOCAL local_main_at_Main_internal_209 --> -840($fp) -# local_main_at_Main_internal_209 = VCALL local_main_at_Main_internal_208 print +# local_main_at_Main_internal_209 = VCALL local_main_at_Main_internal_208 out_string # Save new self pointer in $s1 lw $s1, -836($fp) # Get pointer to type @@ -21319,25 +21252,59 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 48($t0) +lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -840($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_214 --> -860($fp) +# local_main_at_Main_internal_214 = SELF +sw $s1, -860($fp) +# LOCAL local_main_at_Main_internal_212 --> -852($fp) +# LOCAL local_main_at_Main_internal_214 --> -860($fp) +# local_main_at_Main_internal_212 = local_main_at_Main_internal_214 +lw $t0, -860($fp) +sw $t0, -852($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_main_at_Main_x_184 +# LOCAL local_main_at_Main_x_184 --> -740($fp) +lw $t0, -740($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_212 --> -852($fp) # LOCAL local_main_at_Main_internal_213 --> -856($fp) -# local_main_at_Main_internal_213 = SELF -sw $s1, -856($fp) -# LOCAL local_main_at_Main_internal_211 --> -848($fp) -# LOCAL local_main_at_Main_internal_213 --> -856($fp) -# local_main_at_Main_internal_211 = local_main_at_Main_internal_213 -lw $t0, -856($fp) -sw $t0, -848($fp) +# local_main_at_Main_internal_213 = VCALL local_main_at_Main_internal_212 print +# Save new self pointer in $s1 +lw $s1, -852($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 48($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -856($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_217 --> -872($fp) +# local_main_at_Main_internal_217 = SELF +sw $s1, -872($fp) +# LOCAL local_main_at_Main_internal_215 --> -864($fp) +# LOCAL local_main_at_Main_internal_217 --> -872($fp) +# local_main_at_Main_internal_215 = local_main_at_Main_internal_217 +lw $t0, -872($fp) +sw $t0, -864($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_214 --> -860($fp) +# LOCAL local_main_at_Main_internal_218 --> -876($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -21354,18 +21321,18 @@ la $t0, data_75 sw $t0, 12($v0) li $t0, 28 sw $t0, 16($v0) -sw $v0, -860($fp) -# ARG local_main_at_Main_internal_214 -# LOCAL local_main_at_Main_internal_214 --> -860($fp) -lw $t0, -860($fp) +sw $v0, -876($fp) +# ARG local_main_at_Main_internal_218 +# LOCAL local_main_at_Main_internal_218 --> -876($fp) +lw $t0, -876($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_211 --> -848($fp) -# LOCAL local_main_at_Main_internal_212 --> -852($fp) -# local_main_at_Main_internal_212 = VCALL local_main_at_Main_internal_211 out_string +# LOCAL local_main_at_Main_internal_215 --> -864($fp) +# LOCAL local_main_at_Main_internal_216 --> -868($fp) +# local_main_at_Main_internal_216 = VCALL local_main_at_Main_internal_215 out_string # Save new self pointer in $s1 -lw $s1, -848($fp) +lw $s1, -864($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -21374,12 +21341,16 @@ lw $t0, 0($t0) lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -852($fp) +sw $v0, -868($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_main_at_Main_a_215 --> -864($fp) -# local_main_at_Main_a_215 = ALLOCATE A2I +# LOCAL local_main_at_Main_a_219 --> -880($fp) +# local_main_at_Main_a_219 = 0 +li $t0, 0 +sw $t0, -880($fp) +# LOCAL local_main_at_Main_internal_220 --> -884($fp) +# local_main_at_Main_internal_220 = ALLOCATE A2I # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -21415,80 +21386,42 @@ move $s1, $v0 # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -sw $t1, -864($fp) -# LOCAL local_main_at_Main_internal_216 --> -868($fp) -# local_main_at_Main_internal_216 = ALLOCATE A2I -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type name -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, A2I -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 12 bytes of memory -li $a0, 12 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, A2I_start -sw $t0, 4($v0) -# Load type offset -li $t0, 20 -sw $t0, 8($v0) -move $t1, $v0 +sw $t1, -884($fp) +# LOCAL local_main_at_Main_a_219 --> -880($fp) +# LOCAL local_main_at_Main_internal_220 --> -884($fp) +# local_main_at_Main_a_219 = local_main_at_Main_internal_220 +lw $t0, -884($fp) +sw $t0, -880($fp) +# LOCAL local_main_at_Main_internal_223 --> -896($fp) +# local_main_at_Main_internal_223 = SELF +sw $s1, -896($fp) +# LOCAL local_main_at_Main_internal_221 --> -888($fp) +# LOCAL local_main_at_Main_internal_223 --> -896($fp) +# local_main_at_Main_internal_221 = local_main_at_Main_internal_223 +lw $t0, -896($fp) +sw $t0, -888($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -move $s1, $v0 -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -sw $t1, -868($fp) -# LOCAL local_main_at_Main_a_215 --> -864($fp) -# LOCAL local_main_at_Main_internal_216 --> -868($fp) -# local_main_at_Main_a_215 = local_main_at_Main_internal_216 -lw $t0, -868($fp) -sw $t0, -864($fp) -# LOCAL local_main_at_Main_internal_219 --> -880($fp) -# local_main_at_Main_internal_219 = SELF -sw $s1, -880($fp) -# LOCAL local_main_at_Main_internal_217 --> -872($fp) -# LOCAL local_main_at_Main_internal_219 --> -880($fp) -# local_main_at_Main_internal_217 = local_main_at_Main_internal_219 +# LOCAL local_main_at_Main_internal_224 --> -900($fp) +# LOCAL local_main_at_Main_a_219 --> -880($fp) +# local_main_at_Main_internal_224 = local_main_at_Main_a_219 lw $t0, -880($fp) -sw $t0, -872($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_220 --> -884($fp) -# LOCAL local_main_at_Main_a_215 --> -864($fp) -# local_main_at_Main_internal_220 = local_main_at_Main_a_215 -lw $t0, -864($fp) -sw $t0, -884($fp) +sw $t0, -900($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# ARG local_main_at_Main_r_187 -# LOCAL local_main_at_Main_r_187 --> -752($fp) -lw $t0, -752($fp) +# ARG local_main_at_Main_r_191 +# LOCAL local_main_at_Main_r_191 --> -768($fp) +lw $t0, -768($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_220 --> -884($fp) -# LOCAL local_main_at_Main_internal_221 --> -888($fp) -# local_main_at_Main_internal_221 = VCALL local_main_at_Main_internal_220 i2a +# LOCAL local_main_at_Main_internal_224 --> -900($fp) +# LOCAL local_main_at_Main_internal_225 --> -904($fp) +# local_main_at_Main_internal_225 = VCALL local_main_at_Main_internal_224 i2a # Save new self pointer in $s1 -lw $s1, -884($fp) +lw $s1, -900($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -21497,21 +21430,21 @@ lw $t0, 0($t0) lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -888($fp) +sw $v0, -904($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_221 -# LOCAL local_main_at_Main_internal_221 --> -888($fp) -lw $t0, -888($fp) +# ARG local_main_at_Main_internal_225 +# LOCAL local_main_at_Main_internal_225 --> -904($fp) +lw $t0, -904($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_217 --> -872($fp) -# LOCAL local_main_at_Main_internal_218 --> -876($fp) -# local_main_at_Main_internal_218 = VCALL local_main_at_Main_internal_217 out_string +# LOCAL local_main_at_Main_internal_221 --> -888($fp) +# LOCAL local_main_at_Main_internal_222 --> -892($fp) +# local_main_at_Main_internal_222 = VCALL local_main_at_Main_internal_221 out_string # Save new self pointer in $s1 -lw $s1, -872($fp) +lw $s1, -888($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -21520,22 +21453,22 @@ lw $t0, 0($t0) lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -876($fp) +sw $v0, -892($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_224 --> -900($fp) -# local_main_at_Main_internal_224 = SELF -sw $s1, -900($fp) -# LOCAL local_main_at_Main_internal_222 --> -892($fp) -# LOCAL local_main_at_Main_internal_224 --> -900($fp) -# local_main_at_Main_internal_222 = local_main_at_Main_internal_224 -lw $t0, -900($fp) -sw $t0, -892($fp) +# LOCAL local_main_at_Main_internal_228 --> -916($fp) +# local_main_at_Main_internal_228 = SELF +sw $s1, -916($fp) +# LOCAL local_main_at_Main_internal_226 --> -908($fp) +# LOCAL local_main_at_Main_internal_228 --> -916($fp) +# local_main_at_Main_internal_226 = local_main_at_Main_internal_228 +lw $t0, -916($fp) +sw $t0, -908($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_225 --> -904($fp) +# LOCAL local_main_at_Main_internal_229 --> -920($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -21552,18 +21485,18 @@ la $t0, data_76 sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) -sw $v0, -904($fp) -# ARG local_main_at_Main_internal_225 -# LOCAL local_main_at_Main_internal_225 --> -904($fp) -lw $t0, -904($fp) +sw $v0, -920($fp) +# ARG local_main_at_Main_internal_229 +# LOCAL local_main_at_Main_internal_229 --> -920($fp) +lw $t0, -920($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_222 --> -892($fp) -# LOCAL local_main_at_Main_internal_223 --> -896($fp) -# local_main_at_Main_internal_223 = VCALL local_main_at_Main_internal_222 out_string +# LOCAL local_main_at_Main_internal_226 --> -908($fp) +# LOCAL local_main_at_Main_internal_227 --> -912($fp) +# local_main_at_Main_internal_227 = VCALL local_main_at_Main_internal_226 out_string # Save new self pointer in $s1 -lw $s1, -892($fp) +lw $s1, -908($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -21572,24 +21505,24 @@ lw $t0, 0($t0) lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 -sw $v0, -896($fp) +sw $v0, -912($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # -# LOCAL local_main_at_Main_x_180 --> -724($fp) -lw $t0, -724($fp) +# LOCAL local_main_at_Main_x_184 --> -740($fp) +lw $t0, -740($fp) sw $t0, 16($s1) -# LOCAL local_main_at_Main_internal_175 --> -704($fp) -# local_main_at_Main_internal_175 = +# LOCAL local_main_at_Main_internal_179 --> -720($fp) +# local_main_at_Main_internal_179 = # GOTO label_ENDIF_424 j label_ENDIF_424 label_FALSEIF_423: - # local_main_at_Main_internal_230 = GETATTRIBUTE char Main - # LOCAL local_main_at_Main_internal_230 --> -924($fp) + # local_main_at_Main_internal_234 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_234 --> -940($fp) lw $t0, 12($s1) - sw $t0, -924($fp) - # LOCAL local_main_at_Main_internal_231 --> -928($fp) + sw $t0, -940($fp) + # LOCAL local_main_at_Main_internal_235 --> -944($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -21606,111 +21539,111 @@ label_FALSEIF_423: sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) - sw $v0, -928($fp) - # IF_ZERO local_main_at_Main_internal_230 GOTO label_FALSE_435 - # IF_ZERO local_main_at_Main_internal_230 GOTO label_FALSE_435 - lw $t0, -924($fp) + sw $v0, -944($fp) + # IF_ZERO local_main_at_Main_internal_234 GOTO label_FALSE_435 + # IF_ZERO local_main_at_Main_internal_234 GOTO label_FALSE_435 + lw $t0, -940($fp) beq $t0, 0, label_FALSE_435 - # IF_ZERO local_main_at_Main_internal_231 GOTO label_FALSE_435 - # IF_ZERO local_main_at_Main_internal_231 GOTO label_FALSE_435 - lw $t0, -928($fp) + # IF_ZERO local_main_at_Main_internal_235 GOTO label_FALSE_435 + # IF_ZERO local_main_at_Main_internal_235 GOTO label_FALSE_435 + lw $t0, -944($fp) beq $t0, 0, label_FALSE_435 - # LOCAL local_main_at_Main_internal_229 --> -920($fp) - # LOCAL local_main_at_Main_internal_230 --> -924($fp) - # Comparing -924($fp) type with String + # LOCAL local_main_at_Main_internal_233 --> -936($fp) + # LOCAL local_main_at_Main_internal_234 --> -940($fp) + # Comparing -940($fp) type with String la $v0, String - lw $a0, -924($fp) + lw $a0, -940($fp) lw $a0, 0($a0) sub $a0, $a0, $v0 - sw $a0, -920($fp) - # IF_ZERO local_main_at_Main_internal_229 GOTO label_COMPARE_STRING_438 - # IF_ZERO local_main_at_Main_internal_229 GOTO label_COMPARE_STRING_438 - lw $t0, -920($fp) + sw $a0, -936($fp) + # IF_ZERO local_main_at_Main_internal_233 GOTO label_COMPARE_STRING_438 + # IF_ZERO local_main_at_Main_internal_233 GOTO label_COMPARE_STRING_438 + lw $t0, -936($fp) beq $t0, 0, label_COMPARE_STRING_438 - # LOCAL local_main_at_Main_internal_229 --> -920($fp) - # LOCAL local_main_at_Main_internal_230 --> -924($fp) - # Comparing -924($fp) type with Bool + # LOCAL local_main_at_Main_internal_233 --> -936($fp) + # LOCAL local_main_at_Main_internal_234 --> -940($fp) + # Comparing -940($fp) type with Bool la $v0, Bool - lw $a0, -924($fp) + lw $a0, -940($fp) lw $a0, 0($a0) lw $a0, 12($a0) sub $a0, $a0, $v0 - sw $a0, -920($fp) - # IF_ZERO local_main_at_Main_internal_229 GOTO label_COMPARE_BY_VALUE_439 - # IF_ZERO local_main_at_Main_internal_229 GOTO label_COMPARE_BY_VALUE_439 - lw $t0, -920($fp) + sw $a0, -936($fp) + # IF_ZERO local_main_at_Main_internal_233 GOTO label_COMPARE_BY_VALUE_439 + # IF_ZERO local_main_at_Main_internal_233 GOTO label_COMPARE_BY_VALUE_439 + lw $t0, -936($fp) beq $t0, 0, label_COMPARE_BY_VALUE_439 - # LOCAL local_main_at_Main_internal_229 --> -920($fp) - # LOCAL local_main_at_Main_internal_230 --> -924($fp) - # Comparing -924($fp) type with Int + # LOCAL local_main_at_Main_internal_233 --> -936($fp) + # LOCAL local_main_at_Main_internal_234 --> -940($fp) + # Comparing -940($fp) type with Int la $v0, Int - lw $a0, -924($fp) + lw $a0, -940($fp) lw $a0, 0($a0) lw $a0, 12($a0) sub $a0, $a0, $v0 - sw $a0, -920($fp) - # IF_ZERO local_main_at_Main_internal_229 GOTO label_COMPARE_BY_VALUE_439 - # IF_ZERO local_main_at_Main_internal_229 GOTO label_COMPARE_BY_VALUE_439 - lw $t0, -920($fp) + sw $a0, -936($fp) + # IF_ZERO local_main_at_Main_internal_233 GOTO label_COMPARE_BY_VALUE_439 + # IF_ZERO local_main_at_Main_internal_233 GOTO label_COMPARE_BY_VALUE_439 + lw $t0, -936($fp) beq $t0, 0, label_COMPARE_BY_VALUE_439 - # LOCAL local_main_at_Main_internal_229 --> -920($fp) - # LOCAL local_main_at_Main_internal_230 --> -924($fp) - # LOCAL local_main_at_Main_internal_231 --> -928($fp) + # LOCAL local_main_at_Main_internal_233 --> -936($fp) + # LOCAL local_main_at_Main_internal_234 --> -940($fp) + # LOCAL local_main_at_Main_internal_235 --> -944($fp) # Load pointers and SUB - lw $a0, -924($fp) - lw $a1, -928($fp) + lw $a0, -940($fp) + lw $a1, -944($fp) sub $a0, $a0, $a1 - sw $a0, -920($fp) - # IF_ZERO local_main_at_Main_internal_229 GOTO label_TRUE_436 - # IF_ZERO local_main_at_Main_internal_229 GOTO label_TRUE_436 - lw $t0, -920($fp) + sw $a0, -936($fp) + # IF_ZERO local_main_at_Main_internal_233 GOTO label_TRUE_436 + # IF_ZERO local_main_at_Main_internal_233 GOTO label_TRUE_436 + lw $t0, -936($fp) beq $t0, 0, label_TRUE_436 # GOTO label_FALSE_435 j label_FALSE_435 label_COMPARE_BY_VALUE_439: - # LOCAL local_main_at_Main_internal_229 --> -920($fp) - # LOCAL local_main_at_Main_internal_230 --> -924($fp) - # LOCAL local_main_at_Main_internal_231 --> -928($fp) - lw $a0, -924($fp) - lw $a1, -928($fp) + # LOCAL local_main_at_Main_internal_233 --> -936($fp) + # LOCAL local_main_at_Main_internal_234 --> -940($fp) + # LOCAL local_main_at_Main_internal_235 --> -944($fp) + lw $a0, -940($fp) + lw $a1, -944($fp) # Load values lw $a0, 12($a0) lw $a1, 12($a1) # SUB and store sub $a0, $a0, $a1 - sw $a0, -920($fp) - # IF_ZERO local_main_at_Main_internal_229 GOTO label_TRUE_436 - # IF_ZERO local_main_at_Main_internal_229 GOTO label_TRUE_436 - lw $t0, -920($fp) + sw $a0, -936($fp) + # IF_ZERO local_main_at_Main_internal_233 GOTO label_TRUE_436 + # IF_ZERO local_main_at_Main_internal_233 GOTO label_TRUE_436 + lw $t0, -936($fp) beq $t0, 0, label_TRUE_436 # GOTO label_FALSE_435 j label_FALSE_435 label_COMPARE_STRING_438: - # LOCAL local_main_at_Main_internal_229 --> -920($fp) - # LOCAL local_main_at_Main_internal_230 --> -924($fp) - # LOCAL local_main_at_Main_internal_231 --> -928($fp) + # LOCAL local_main_at_Main_internal_233 --> -936($fp) + # LOCAL local_main_at_Main_internal_234 --> -940($fp) + # LOCAL local_main_at_Main_internal_235 --> -944($fp) # Load strings for comparison - lw $v0, -924($fp) - lw $v1, -928($fp) + lw $v0, -940($fp) + lw $v1, -944($fp) # Compare lengths lw $v0, 16($v0) lw $v1, 16($v1) sub $v0, $v0, $v1 - sw $v0, -920($fp) - # IF_ZERO local_main_at_Main_internal_229 GOTO label_CONTINUE_440 - # IF_ZERO local_main_at_Main_internal_229 GOTO label_CONTINUE_440 - lw $t0, -920($fp) + sw $v0, -936($fp) + # IF_ZERO local_main_at_Main_internal_233 GOTO label_CONTINUE_440 + # IF_ZERO local_main_at_Main_internal_233 GOTO label_CONTINUE_440 + lw $t0, -936($fp) beq $t0, 0, label_CONTINUE_440 # GOTO label_FALSE_435 j label_FALSE_435 label_CONTINUE_440: - # LOCAL local_main_at_Main_internal_229 --> -920($fp) - # LOCAL local_main_at_Main_internal_230 --> -924($fp) - # LOCAL local_main_at_Main_internal_231 --> -928($fp) + # LOCAL local_main_at_Main_internal_233 --> -936($fp) + # LOCAL local_main_at_Main_internal_234 --> -940($fp) + # LOCAL local_main_at_Main_internal_235 --> -944($fp) move $a2, $zero # Load strings for comparison - lw $v0, -924($fp) - lw $v1, -928($fp) + lw $v0, -940($fp) + lw $v1, -944($fp) # Load strings pointers lw $v0, 12($v0) lw $v1, 12($v1) @@ -21730,13 +21663,13 @@ label_FALSEIF_423: li $a2, 1 label_WHILE_STR_COMP_END_442: # Store result - sw $a2, -920($fp) - # IF_ZERO local_main_at_Main_internal_229 GOTO label_TRUE_436 - # IF_ZERO local_main_at_Main_internal_229 GOTO label_TRUE_436 - lw $t0, -920($fp) + sw $a2, -936($fp) + # IF_ZERO local_main_at_Main_internal_233 GOTO label_TRUE_436 + # IF_ZERO local_main_at_Main_internal_233 GOTO label_TRUE_436 + lw $t0, -936($fp) beq $t0, 0, label_TRUE_436 label_FALSE_435: - # LOCAL local_main_at_Main_internal_228 --> -916($fp) + # LOCAL local_main_at_Main_internal_232 --> -932($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -21766,11 +21699,11 @@ label_FALSEIF_423: sw $t0, 8($v0) li $t0, 0 sw $t0, 12($v0) - sw $v0, -916($fp) + sw $v0, -932($fp) # GOTO label_END_437 j label_END_437 label_TRUE_436: - # LOCAL local_main_at_Main_internal_228 --> -916($fp) + # LOCAL local_main_at_Main_internal_232 --> -932($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -21800,20 +21733,20 @@ label_TRUE_436: sw $t0, 8($v0) li $t0, 1 sw $t0, 12($v0) - sw $v0, -916($fp) + sw $v0, -932($fp) label_END_437: -# LOCAL local_main_at_Main_internal_226 --> -908($fp) -# LOCAL local_main_at_Main_internal_228 --> -916($fp) -# Obtain value from -916($fp) -lw $v0, -916($fp) +# LOCAL local_main_at_Main_internal_230 --> -924($fp) +# LOCAL local_main_at_Main_internal_232 --> -932($fp) +# Obtain value from -932($fp) +lw $v0, -932($fp) lw $v0, 12($v0) -sw $v0, -908($fp) -# IF_ZERO local_main_at_Main_internal_226 GOTO label_FALSEIF_433 -# IF_ZERO local_main_at_Main_internal_226 GOTO label_FALSEIF_433 -lw $t0, -908($fp) +sw $v0, -924($fp) +# IF_ZERO local_main_at_Main_internal_230 GOTO label_FALSEIF_433 +# IF_ZERO local_main_at_Main_internal_230 GOTO label_FALSEIF_433 +lw $t0, -924($fp) beq $t0, 0, label_FALSEIF_433 -# LOCAL local_main_at_Main_internal_232 --> -932($fp) -# local_main_at_Main_internal_232 = ALLOCATE A +# LOCAL local_main_at_Main_internal_236 --> -948($fp) +# local_main_at_Main_internal_236 = ALLOCATE A # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -21857,21 +21790,21 @@ sw $v0, 12($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 -sw $t1, -932($fp) +sw $t1, -948($fp) # -# LOCAL local_main_at_Main_internal_232 --> -932($fp) -lw $t0, -932($fp) +# LOCAL local_main_at_Main_internal_236 --> -948($fp) +lw $t0, -948($fp) sw $t0, 16($s1) -# LOCAL local_main_at_Main_internal_227 --> -912($fp) -# local_main_at_Main_internal_227 = +# LOCAL local_main_at_Main_internal_231 --> -928($fp) +# local_main_at_Main_internal_231 = # GOTO label_ENDIF_434 j label_ENDIF_434 label_FALSEIF_433: - # local_main_at_Main_internal_237 = GETATTRIBUTE char Main - # LOCAL local_main_at_Main_internal_237 --> -952($fp) + # local_main_at_Main_internal_241 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_241 --> -968($fp) lw $t0, 12($s1) - sw $t0, -952($fp) - # LOCAL local_main_at_Main_internal_238 --> -956($fp) + sw $t0, -968($fp) + # LOCAL local_main_at_Main_internal_242 --> -972($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -21888,111 +21821,111 @@ label_FALSEIF_433: sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) - sw $v0, -956($fp) - # IF_ZERO local_main_at_Main_internal_237 GOTO label_FALSE_445 - # IF_ZERO local_main_at_Main_internal_237 GOTO label_FALSE_445 - lw $t0, -952($fp) + sw $v0, -972($fp) + # IF_ZERO local_main_at_Main_internal_241 GOTO label_FALSE_445 + # IF_ZERO local_main_at_Main_internal_241 GOTO label_FALSE_445 + lw $t0, -968($fp) beq $t0, 0, label_FALSE_445 - # IF_ZERO local_main_at_Main_internal_238 GOTO label_FALSE_445 - # IF_ZERO local_main_at_Main_internal_238 GOTO label_FALSE_445 - lw $t0, -956($fp) + # IF_ZERO local_main_at_Main_internal_242 GOTO label_FALSE_445 + # IF_ZERO local_main_at_Main_internal_242 GOTO label_FALSE_445 + lw $t0, -972($fp) beq $t0, 0, label_FALSE_445 - # LOCAL local_main_at_Main_internal_236 --> -948($fp) - # LOCAL local_main_at_Main_internal_237 --> -952($fp) - # Comparing -952($fp) type with String + # LOCAL local_main_at_Main_internal_240 --> -964($fp) + # LOCAL local_main_at_Main_internal_241 --> -968($fp) + # Comparing -968($fp) type with String la $v0, String - lw $a0, -952($fp) + lw $a0, -968($fp) lw $a0, 0($a0) sub $a0, $a0, $v0 - sw $a0, -948($fp) - # IF_ZERO local_main_at_Main_internal_236 GOTO label_COMPARE_STRING_448 - # IF_ZERO local_main_at_Main_internal_236 GOTO label_COMPARE_STRING_448 - lw $t0, -948($fp) + sw $a0, -964($fp) + # IF_ZERO local_main_at_Main_internal_240 GOTO label_COMPARE_STRING_448 + # IF_ZERO local_main_at_Main_internal_240 GOTO label_COMPARE_STRING_448 + lw $t0, -964($fp) beq $t0, 0, label_COMPARE_STRING_448 - # LOCAL local_main_at_Main_internal_236 --> -948($fp) - # LOCAL local_main_at_Main_internal_237 --> -952($fp) - # Comparing -952($fp) type with Bool + # LOCAL local_main_at_Main_internal_240 --> -964($fp) + # LOCAL local_main_at_Main_internal_241 --> -968($fp) + # Comparing -968($fp) type with Bool la $v0, Bool - lw $a0, -952($fp) + lw $a0, -968($fp) lw $a0, 0($a0) lw $a0, 12($a0) sub $a0, $a0, $v0 - sw $a0, -948($fp) - # IF_ZERO local_main_at_Main_internal_236 GOTO label_COMPARE_BY_VALUE_449 - # IF_ZERO local_main_at_Main_internal_236 GOTO label_COMPARE_BY_VALUE_449 - lw $t0, -948($fp) + sw $a0, -964($fp) + # IF_ZERO local_main_at_Main_internal_240 GOTO label_COMPARE_BY_VALUE_449 + # IF_ZERO local_main_at_Main_internal_240 GOTO label_COMPARE_BY_VALUE_449 + lw $t0, -964($fp) beq $t0, 0, label_COMPARE_BY_VALUE_449 - # LOCAL local_main_at_Main_internal_236 --> -948($fp) - # LOCAL local_main_at_Main_internal_237 --> -952($fp) - # Comparing -952($fp) type with Int + # LOCAL local_main_at_Main_internal_240 --> -964($fp) + # LOCAL local_main_at_Main_internal_241 --> -968($fp) + # Comparing -968($fp) type with Int la $v0, Int - lw $a0, -952($fp) + lw $a0, -968($fp) lw $a0, 0($a0) lw $a0, 12($a0) sub $a0, $a0, $v0 - sw $a0, -948($fp) - # IF_ZERO local_main_at_Main_internal_236 GOTO label_COMPARE_BY_VALUE_449 - # IF_ZERO local_main_at_Main_internal_236 GOTO label_COMPARE_BY_VALUE_449 - lw $t0, -948($fp) + sw $a0, -964($fp) + # IF_ZERO local_main_at_Main_internal_240 GOTO label_COMPARE_BY_VALUE_449 + # IF_ZERO local_main_at_Main_internal_240 GOTO label_COMPARE_BY_VALUE_449 + lw $t0, -964($fp) beq $t0, 0, label_COMPARE_BY_VALUE_449 - # LOCAL local_main_at_Main_internal_236 --> -948($fp) - # LOCAL local_main_at_Main_internal_237 --> -952($fp) - # LOCAL local_main_at_Main_internal_238 --> -956($fp) + # LOCAL local_main_at_Main_internal_240 --> -964($fp) + # LOCAL local_main_at_Main_internal_241 --> -968($fp) + # LOCAL local_main_at_Main_internal_242 --> -972($fp) # Load pointers and SUB - lw $a0, -952($fp) - lw $a1, -956($fp) + lw $a0, -968($fp) + lw $a1, -972($fp) sub $a0, $a0, $a1 - sw $a0, -948($fp) - # IF_ZERO local_main_at_Main_internal_236 GOTO label_TRUE_446 - # IF_ZERO local_main_at_Main_internal_236 GOTO label_TRUE_446 - lw $t0, -948($fp) + sw $a0, -964($fp) + # IF_ZERO local_main_at_Main_internal_240 GOTO label_TRUE_446 + # IF_ZERO local_main_at_Main_internal_240 GOTO label_TRUE_446 + lw $t0, -964($fp) beq $t0, 0, label_TRUE_446 # GOTO label_FALSE_445 j label_FALSE_445 label_COMPARE_BY_VALUE_449: - # LOCAL local_main_at_Main_internal_236 --> -948($fp) - # LOCAL local_main_at_Main_internal_237 --> -952($fp) - # LOCAL local_main_at_Main_internal_238 --> -956($fp) - lw $a0, -952($fp) - lw $a1, -956($fp) + # LOCAL local_main_at_Main_internal_240 --> -964($fp) + # LOCAL local_main_at_Main_internal_241 --> -968($fp) + # LOCAL local_main_at_Main_internal_242 --> -972($fp) + lw $a0, -968($fp) + lw $a1, -972($fp) # Load values lw $a0, 12($a0) lw $a1, 12($a1) # SUB and store sub $a0, $a0, $a1 - sw $a0, -948($fp) - # IF_ZERO local_main_at_Main_internal_236 GOTO label_TRUE_446 - # IF_ZERO local_main_at_Main_internal_236 GOTO label_TRUE_446 - lw $t0, -948($fp) + sw $a0, -964($fp) + # IF_ZERO local_main_at_Main_internal_240 GOTO label_TRUE_446 + # IF_ZERO local_main_at_Main_internal_240 GOTO label_TRUE_446 + lw $t0, -964($fp) beq $t0, 0, label_TRUE_446 # GOTO label_FALSE_445 j label_FALSE_445 label_COMPARE_STRING_448: - # LOCAL local_main_at_Main_internal_236 --> -948($fp) - # LOCAL local_main_at_Main_internal_237 --> -952($fp) - # LOCAL local_main_at_Main_internal_238 --> -956($fp) + # LOCAL local_main_at_Main_internal_240 --> -964($fp) + # LOCAL local_main_at_Main_internal_241 --> -968($fp) + # LOCAL local_main_at_Main_internal_242 --> -972($fp) # Load strings for comparison - lw $v0, -952($fp) - lw $v1, -956($fp) + lw $v0, -968($fp) + lw $v1, -972($fp) # Compare lengths lw $v0, 16($v0) lw $v1, 16($v1) sub $v0, $v0, $v1 - sw $v0, -948($fp) - # IF_ZERO local_main_at_Main_internal_236 GOTO label_CONTINUE_450 - # IF_ZERO local_main_at_Main_internal_236 GOTO label_CONTINUE_450 - lw $t0, -948($fp) + sw $v0, -964($fp) + # IF_ZERO local_main_at_Main_internal_240 GOTO label_CONTINUE_450 + # IF_ZERO local_main_at_Main_internal_240 GOTO label_CONTINUE_450 + lw $t0, -964($fp) beq $t0, 0, label_CONTINUE_450 # GOTO label_FALSE_445 j label_FALSE_445 label_CONTINUE_450: - # LOCAL local_main_at_Main_internal_236 --> -948($fp) - # LOCAL local_main_at_Main_internal_237 --> -952($fp) - # LOCAL local_main_at_Main_internal_238 --> -956($fp) + # LOCAL local_main_at_Main_internal_240 --> -964($fp) + # LOCAL local_main_at_Main_internal_241 --> -968($fp) + # LOCAL local_main_at_Main_internal_242 --> -972($fp) move $a2, $zero # Load strings for comparison - lw $v0, -952($fp) - lw $v1, -956($fp) + lw $v0, -968($fp) + lw $v1, -972($fp) # Load strings pointers lw $v0, 12($v0) lw $v1, 12($v1) @@ -22012,13 +21945,13 @@ label_FALSEIF_433: li $a2, 1 label_WHILE_STR_COMP_END_452: # Store result - sw $a2, -948($fp) - # IF_ZERO local_main_at_Main_internal_236 GOTO label_TRUE_446 - # IF_ZERO local_main_at_Main_internal_236 GOTO label_TRUE_446 - lw $t0, -948($fp) + sw $a2, -964($fp) + # IF_ZERO local_main_at_Main_internal_240 GOTO label_TRUE_446 + # IF_ZERO local_main_at_Main_internal_240 GOTO label_TRUE_446 + lw $t0, -964($fp) beq $t0, 0, label_TRUE_446 label_FALSE_445: - # LOCAL local_main_at_Main_internal_235 --> -944($fp) + # LOCAL local_main_at_Main_internal_239 --> -960($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -22048,11 +21981,11 @@ label_FALSEIF_433: sw $t0, 8($v0) li $t0, 0 sw $t0, 12($v0) - sw $v0, -944($fp) + sw $v0, -960($fp) # GOTO label_END_447 j label_END_447 label_TRUE_446: - # LOCAL local_main_at_Main_internal_235 --> -944($fp) + # LOCAL local_main_at_Main_internal_239 --> -960($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -22082,19 +22015,19 @@ label_TRUE_446: sw $t0, 8($v0) li $t0, 1 sw $t0, 12($v0) - sw $v0, -944($fp) + sw $v0, -960($fp) label_END_447: -# LOCAL local_main_at_Main_internal_233 --> -936($fp) -# LOCAL local_main_at_Main_internal_235 --> -944($fp) -# Obtain value from -944($fp) -lw $v0, -944($fp) +# LOCAL local_main_at_Main_internal_237 --> -952($fp) +# LOCAL local_main_at_Main_internal_239 --> -960($fp) +# Obtain value from -960($fp) +lw $v0, -960($fp) lw $v0, 12($v0) -sw $v0, -936($fp) -# IF_ZERO local_main_at_Main_internal_233 GOTO label_FALSEIF_443 -# IF_ZERO local_main_at_Main_internal_233 GOTO label_FALSEIF_443 -lw $t0, -936($fp) +sw $v0, -952($fp) +# IF_ZERO local_main_at_Main_internal_237 GOTO label_FALSEIF_443 +# IF_ZERO local_main_at_Main_internal_237 GOTO label_FALSEIF_443 +lw $t0, -952($fp) beq $t0, 0, label_FALSEIF_443 -# LOCAL local_main_at_Main_internal_239 --> -960($fp) +# LOCAL local_main_at_Main_internal_243 --> -976($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -22124,18 +22057,18 @@ li $t0, 12 sw $t0, 8($v0) li $t0, 0 sw $t0, 12($v0) -sw $v0, -960($fp) +sw $v0, -976($fp) # -# LOCAL local_main_at_Main_internal_239 --> -960($fp) -lw $t0, -960($fp) +# LOCAL local_main_at_Main_internal_243 --> -976($fp) +lw $t0, -976($fp) sw $t0, 24($s1) -# LOCAL local_main_at_Main_internal_234 --> -940($fp) -# local_main_at_Main_internal_234 = +# LOCAL local_main_at_Main_internal_238 --> -956($fp) +# local_main_at_Main_internal_238 = # GOTO label_ENDIF_444 j label_ENDIF_444 label_FALSEIF_443: - # LOCAL local_main_at_Main_internal_242 --> -972($fp) - # local_main_at_Main_internal_242 = ALLOCATE A + # LOCAL local_main_at_Main_internal_246 --> -988($fp) + # local_main_at_Main_internal_246 = ALLOCATE A # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -22179,32 +22112,32 @@ label_FALSEIF_443: # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t1, -972($fp) - # LOCAL local_main_at_Main_internal_240 --> -964($fp) - # LOCAL local_main_at_Main_internal_242 --> -972($fp) - # local_main_at_Main_internal_240 = local_main_at_Main_internal_242 - lw $t0, -972($fp) - sw $t0, -964($fp) + sw $t1, -988($fp) + # LOCAL local_main_at_Main_internal_244 --> -980($fp) + # LOCAL local_main_at_Main_internal_246 --> -988($fp) + # local_main_at_Main_internal_244 = local_main_at_Main_internal_246 + lw $t0, -988($fp) + sw $t0, -980($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_main_at_Main_internal_245 = GETATTRIBUTE avar Main - # LOCAL local_main_at_Main_internal_245 --> -984($fp) + # local_main_at_Main_internal_249 = GETATTRIBUTE avar Main + # LOCAL local_main_at_Main_internal_249 --> -1000($fp) lw $t0, 16($s1) - sw $t0, -984($fp) - # LOCAL local_main_at_Main_internal_243 --> -976($fp) - # LOCAL local_main_at_Main_internal_245 --> -984($fp) - # local_main_at_Main_internal_243 = local_main_at_Main_internal_245 - lw $t0, -984($fp) - sw $t0, -976($fp) + sw $t0, -1000($fp) + # LOCAL local_main_at_Main_internal_247 --> -992($fp) + # LOCAL local_main_at_Main_internal_249 --> -1000($fp) + # local_main_at_Main_internal_247 = local_main_at_Main_internal_249 + lw $t0, -1000($fp) + sw $t0, -992($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_243 --> -976($fp) - # LOCAL local_main_at_Main_internal_244 --> -980($fp) - # local_main_at_Main_internal_244 = VCALL local_main_at_Main_internal_243 value + # LOCAL local_main_at_Main_internal_247 --> -992($fp) + # LOCAL local_main_at_Main_internal_248 --> -996($fp) + # local_main_at_Main_internal_248 = VCALL local_main_at_Main_internal_247 value # Save new self pointer in $s1 - lw $s1, -976($fp) + lw $s1, -992($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -22213,21 +22146,21 @@ label_FALSEIF_443: lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 - sw $v0, -980($fp) + sw $v0, -996($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_244 - # LOCAL local_main_at_Main_internal_244 --> -980($fp) - lw $t0, -980($fp) + # ARG local_main_at_Main_internal_248 + # LOCAL local_main_at_Main_internal_248 --> -996($fp) + lw $t0, -996($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_240 --> -964($fp) - # LOCAL local_main_at_Main_internal_241 --> -968($fp) - # local_main_at_Main_internal_241 = VCALL local_main_at_Main_internal_240 method1 + # LOCAL local_main_at_Main_internal_244 --> -980($fp) + # LOCAL local_main_at_Main_internal_245 --> -984($fp) + # local_main_at_Main_internal_245 = VCALL local_main_at_Main_internal_244 method1 # Save new self pointer in $s1 - lw $s1, -964($fp) + lw $s1, -980($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE @@ -22236,70 +22169,70 @@ label_FALSEIF_443: lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 - sw $v0, -968($fp) + sw $v0, -984($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 # - # LOCAL local_main_at_Main_internal_241 --> -968($fp) - lw $t0, -968($fp) + # LOCAL local_main_at_Main_internal_245 --> -984($fp) + lw $t0, -984($fp) sw $t0, 16($s1) - # LOCAL local_main_at_Main_internal_234 --> -940($fp) - # local_main_at_Main_internal_234 = + # LOCAL local_main_at_Main_internal_238 --> -956($fp) + # local_main_at_Main_internal_238 = label_ENDIF_444: -# LOCAL local_main_at_Main_internal_227 --> -912($fp) -# LOCAL local_main_at_Main_internal_234 --> -940($fp) -# local_main_at_Main_internal_227 = local_main_at_Main_internal_234 -lw $t0, -940($fp) -sw $t0, -912($fp) +# LOCAL local_main_at_Main_internal_231 --> -928($fp) +# LOCAL local_main_at_Main_internal_238 --> -956($fp) +# local_main_at_Main_internal_231 = local_main_at_Main_internal_238 +lw $t0, -956($fp) +sw $t0, -928($fp) label_ENDIF_434: -# LOCAL local_main_at_Main_internal_175 --> -704($fp) -# LOCAL local_main_at_Main_internal_227 --> -912($fp) -# local_main_at_Main_internal_175 = local_main_at_Main_internal_227 -lw $t0, -912($fp) -sw $t0, -704($fp) +# LOCAL local_main_at_Main_internal_179 --> -720($fp) +# LOCAL local_main_at_Main_internal_231 --> -928($fp) +# local_main_at_Main_internal_179 = local_main_at_Main_internal_231 +lw $t0, -928($fp) +sw $t0, -720($fp) label_ENDIF_424: -# LOCAL local_main_at_Main_internal_137 --> -552($fp) -# LOCAL local_main_at_Main_internal_175 --> -704($fp) -# local_main_at_Main_internal_137 = local_main_at_Main_internal_175 -lw $t0, -704($fp) -sw $t0, -552($fp) +# LOCAL local_main_at_Main_internal_141 --> -568($fp) +# LOCAL local_main_at_Main_internal_179 --> -720($fp) +# local_main_at_Main_internal_141 = local_main_at_Main_internal_179 +lw $t0, -720($fp) +sw $t0, -568($fp) label_ENDIF_412: -# LOCAL local_main_at_Main_internal_126 --> -508($fp) -# LOCAL local_main_at_Main_internal_137 --> -552($fp) -# local_main_at_Main_internal_126 = local_main_at_Main_internal_137 -lw $t0, -552($fp) -sw $t0, -508($fp) +# LOCAL local_main_at_Main_internal_130 --> -524($fp) +# LOCAL local_main_at_Main_internal_141 --> -568($fp) +# local_main_at_Main_internal_130 = local_main_at_Main_internal_141 +lw $t0, -568($fp) +sw $t0, -524($fp) label_ENDIF_402: -# LOCAL local_main_at_Main_internal_115 --> -464($fp) -# LOCAL local_main_at_Main_internal_126 --> -508($fp) -# local_main_at_Main_internal_115 = local_main_at_Main_internal_126 -lw $t0, -508($fp) -sw $t0, -464($fp) +# LOCAL local_main_at_Main_internal_119 --> -480($fp) +# LOCAL local_main_at_Main_internal_130 --> -524($fp) +# local_main_at_Main_internal_119 = local_main_at_Main_internal_130 +lw $t0, -524($fp) +sw $t0, -480($fp) label_ENDIF_392: -# LOCAL local_main_at_Main_internal_104 --> -420($fp) -# LOCAL local_main_at_Main_internal_115 --> -464($fp) -# local_main_at_Main_internal_104 = local_main_at_Main_internal_115 -lw $t0, -464($fp) -sw $t0, -420($fp) +# LOCAL local_main_at_Main_internal_108 --> -436($fp) +# LOCAL local_main_at_Main_internal_119 --> -480($fp) +# local_main_at_Main_internal_108 = local_main_at_Main_internal_119 +lw $t0, -480($fp) +sw $t0, -436($fp) label_ENDIF_382: -# LOCAL local_main_at_Main_internal_83 --> -336($fp) -# LOCAL local_main_at_Main_internal_104 --> -420($fp) -# local_main_at_Main_internal_83 = local_main_at_Main_internal_104 -lw $t0, -420($fp) -sw $t0, -336($fp) +# LOCAL local_main_at_Main_internal_87 --> -352($fp) +# LOCAL local_main_at_Main_internal_108 --> -436($fp) +# local_main_at_Main_internal_87 = local_main_at_Main_internal_108 +lw $t0, -436($fp) +sw $t0, -352($fp) label_ENDIF_372: -# LOCAL local_main_at_Main_internal_52 --> -212($fp) -# LOCAL local_main_at_Main_internal_83 --> -336($fp) -# local_main_at_Main_internal_52 = local_main_at_Main_internal_83 -lw $t0, -336($fp) -sw $t0, -212($fp) +# LOCAL local_main_at_Main_internal_56 --> -228($fp) +# LOCAL local_main_at_Main_internal_87 --> -352($fp) +# local_main_at_Main_internal_56 = local_main_at_Main_internal_87 +lw $t0, -352($fp) +sw $t0, -228($fp) label_ENDIF_354: -# LOCAL local_main_at_Main_internal_31 --> -128($fp) -# LOCAL local_main_at_Main_internal_52 --> -212($fp) -# local_main_at_Main_internal_31 = local_main_at_Main_internal_52 -lw $t0, -212($fp) -sw $t0, -128($fp) +# LOCAL local_main_at_Main_internal_35 --> -144($fp) +# LOCAL local_main_at_Main_internal_56 --> -228($fp) +# local_main_at_Main_internal_35 = local_main_at_Main_internal_56 +lw $t0, -228($fp) +sw $t0, -144($fp) label_ENDIF_344: # GOTO label_WHILE_339 j label_WHILE_339 @@ -22311,7 +22244,7 @@ label_WHILE_END_340: # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 992 + addu $sp, $sp, 1008 jr $ra # Function END diff --git a/tests/codegen/atoi.mips b/tests/codegen/atoi.mips deleted file mode 100644 index 91d74820..00000000 --- a/tests/codegen/atoi.mips +++ /dev/null @@ -1,3559 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:42 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -A2I: .asciiz "A2I" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type A2I **** -A2I_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_c2i_at_A2I, function_i2c_at_A2I, function_a2i_at_A2I, function_a2i_aux_at_A2I, function_i2a_at_A2I, function_i2a_aux_at_A2I -# Function END -# - - -# **** Type RECORD for type A2I **** -A2I_start: - A2I_vtable_pointer: .word A2I_vtable - # Function END -A2I_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1 -A2I__TDT: .word -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz "0" -# - - -data_5: .asciiz "1" -# - - -data_6: .asciiz "2" -# - - -data_7: .asciiz "3" -# - - -data_8: .asciiz "4" -# - - -data_9: .asciiz "5" -# - - -data_10: .asciiz "6" -# - - -data_11: .asciiz "7" -# - - -data_12: .asciiz "8" -# - - -data_13: .asciiz "9" -# - - -data_14: .asciiz "0" -# - - -data_15: .asciiz "1" -# - - -data_16: .asciiz "2" -# - - -data_17: .asciiz "3" -# - - -data_18: .asciiz "4" -# - - -data_19: .asciiz "5" -# - - -data_20: .asciiz "6" -# - - -data_21: .asciiz "7" -# - - -data_22: .asciiz "8" -# - - -data_23: .asciiz "9" -# - - -data_24: .asciiz "" -# - - -data_25: .asciiz "-" -# - - -data_26: .asciiz "+" -# - - -data_27: .asciiz "0" -# - - -data_28: .asciiz "-" -# - - -data_29: .asciiz "" -# - - -data_30: .asciiz "678987" -# - - -data_31: .asciiz " == " -# - - -data_32: .asciiz "\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) - # Load type offset - li $t2, 20 - sw $t2, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t1, Main_vtable - # Get pointer to function address - lw $t2, 28($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_c2i_at_A2I implementation. -# @Params: -# 0($fp) = param_c2i_at_A2I_char_0 -function_c2i_at_A2I: - # Allocate stack frame for function function_c2i_at_A2I. - subu $sp, $sp, 140 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 140 - # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_4 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -12($fp) - # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) - # local_c2i_at_A2I_internal_1 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_2 - lw $t1, 0($fp) - lw $t2, -12($fp) - sub $t1, $t1, $t2 - sw $t1, -8($fp) - # IF_ZERO local_c2i_at_A2I_internal_1 GOTO label_TRUE_3 - # IF_ZERO local_c2i_at_A2I_internal_1 GOTO label_TRUE_3 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_3 - # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) - # local_c2i_at_A2I_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_4 -j label_END_4 -label_TRUE_3: - # LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) - # local_c2i_at_A2I_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_4: -# IF_ZERO local_c2i_at_A2I_internal_1 GOTO label_FALSEIF_1 -# IF_ZERO local_c2i_at_A2I_internal_1 GOTO label_FALSEIF_1 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_1 -# LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) -# local_c2i_at_A2I_internal_0 = 0 -li $t1, 0 -sw $t1, -4($fp) -# GOTO label_ENDIF_2 -j label_ENDIF_2 -label_FALSEIF_1: - # LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_5 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -24($fp) - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) - # local_c2i_at_A2I_internal_4 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_5 - lw $t1, 0($fp) - lw $t2, -24($fp) - sub $t1, $t1, $t2 - sw $t1, -20($fp) - # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_7 - # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_TRUE_7 - lw $t1, -20($fp) - beq $t1, 0, label_TRUE_7 - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - # local_c2i_at_A2I_internal_4 = 0 - li $t1, 0 - sw $t1, -20($fp) - # GOTO label_END_8 -j label_END_8 -label_TRUE_7: - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - # local_c2i_at_A2I_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) - label_END_8: -# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSEIF_5 -# IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSEIF_5 -lw $t1, -20($fp) -beq $t1, 0, label_FALSEIF_5 -# LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) -# local_c2i_at_A2I_internal_3 = 1 -li $t1, 1 -sw $t1, -16($fp) -# GOTO label_ENDIF_6 -j label_ENDIF_6 -label_FALSEIF_5: - # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_6 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -36($fp) - # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) - # local_c2i_at_A2I_internal_7 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_8 - lw $t1, 0($fp) - lw $t2, -36($fp) - sub $t1, $t1, $t2 - sw $t1, -32($fp) - # IF_ZERO local_c2i_at_A2I_internal_7 GOTO label_TRUE_11 - # IF_ZERO local_c2i_at_A2I_internal_7 GOTO label_TRUE_11 - lw $t1, -32($fp) - beq $t1, 0, label_TRUE_11 - # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) - # local_c2i_at_A2I_internal_7 = 0 - li $t1, 0 - sw $t1, -32($fp) - # GOTO label_END_12 -j label_END_12 -label_TRUE_11: - # LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) - # local_c2i_at_A2I_internal_7 = 1 - li $t1, 1 - sw $t1, -32($fp) - label_END_12: -# IF_ZERO local_c2i_at_A2I_internal_7 GOTO label_FALSEIF_9 -# IF_ZERO local_c2i_at_A2I_internal_7 GOTO label_FALSEIF_9 -lw $t1, -32($fp) -beq $t1, 0, label_FALSEIF_9 -# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) -# local_c2i_at_A2I_internal_6 = 2 -li $t1, 2 -sw $t1, -28($fp) -# GOTO label_ENDIF_10 -j label_ENDIF_10 -label_FALSEIF_9: - # LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_7 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -48($fp) - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) - # local_c2i_at_A2I_internal_10 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_11 - lw $t1, 0($fp) - lw $t2, -48($fp) - sub $t1, $t1, $t2 - sw $t1, -44($fp) - # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_15 - # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_TRUE_15 - lw $t1, -44($fp) - beq $t1, 0, label_TRUE_15 - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - # local_c2i_at_A2I_internal_10 = 0 - li $t1, 0 - sw $t1, -44($fp) - # GOTO label_END_16 -j label_END_16 -label_TRUE_15: - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - # local_c2i_at_A2I_internal_10 = 1 - li $t1, 1 - sw $t1, -44($fp) - label_END_16: -# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSEIF_13 -# IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSEIF_13 -lw $t1, -44($fp) -beq $t1, 0, label_FALSEIF_13 -# LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) -# local_c2i_at_A2I_internal_9 = 3 -li $t1, 3 -sw $t1, -40($fp) -# GOTO label_ENDIF_14 -j label_ENDIF_14 -label_FALSEIF_13: - # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_8 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -60($fp) - # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) - # local_c2i_at_A2I_internal_13 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_14 - lw $t1, 0($fp) - lw $t2, -60($fp) - sub $t1, $t1, $t2 - sw $t1, -56($fp) - # IF_ZERO local_c2i_at_A2I_internal_13 GOTO label_TRUE_19 - # IF_ZERO local_c2i_at_A2I_internal_13 GOTO label_TRUE_19 - lw $t1, -56($fp) - beq $t1, 0, label_TRUE_19 - # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) - # local_c2i_at_A2I_internal_13 = 0 - li $t1, 0 - sw $t1, -56($fp) - # GOTO label_END_20 -j label_END_20 -label_TRUE_19: - # LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) - # local_c2i_at_A2I_internal_13 = 1 - li $t1, 1 - sw $t1, -56($fp) - label_END_20: -# IF_ZERO local_c2i_at_A2I_internal_13 GOTO label_FALSEIF_17 -# IF_ZERO local_c2i_at_A2I_internal_13 GOTO label_FALSEIF_17 -lw $t1, -56($fp) -beq $t1, 0, label_FALSEIF_17 -# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) -# local_c2i_at_A2I_internal_12 = 4 -li $t1, 4 -sw $t1, -52($fp) -# GOTO label_ENDIF_18 -j label_ENDIF_18 -label_FALSEIF_17: - # LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_9 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -72($fp) - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) - # local_c2i_at_A2I_internal_16 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_17 - lw $t1, 0($fp) - lw $t2, -72($fp) - sub $t1, $t1, $t2 - sw $t1, -68($fp) - # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_23 - # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_TRUE_23 - lw $t1, -68($fp) - beq $t1, 0, label_TRUE_23 - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - # local_c2i_at_A2I_internal_16 = 0 - li $t1, 0 - sw $t1, -68($fp) - # GOTO label_END_24 -j label_END_24 -label_TRUE_23: - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - # local_c2i_at_A2I_internal_16 = 1 - li $t1, 1 - sw $t1, -68($fp) - label_END_24: -# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSEIF_21 -# IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSEIF_21 -lw $t1, -68($fp) -beq $t1, 0, label_FALSEIF_21 -# LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) -# local_c2i_at_A2I_internal_15 = 5 -li $t1, 5 -sw $t1, -64($fp) -# GOTO label_ENDIF_22 -j label_ENDIF_22 -label_FALSEIF_21: - # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_10 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -84($fp) - # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) - # local_c2i_at_A2I_internal_19 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_20 - lw $t1, 0($fp) - lw $t2, -84($fp) - sub $t1, $t1, $t2 - sw $t1, -80($fp) - # IF_ZERO local_c2i_at_A2I_internal_19 GOTO label_TRUE_27 - # IF_ZERO local_c2i_at_A2I_internal_19 GOTO label_TRUE_27 - lw $t1, -80($fp) - beq $t1, 0, label_TRUE_27 - # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) - # local_c2i_at_A2I_internal_19 = 0 - li $t1, 0 - sw $t1, -80($fp) - # GOTO label_END_28 -j label_END_28 -label_TRUE_27: - # LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) - # local_c2i_at_A2I_internal_19 = 1 - li $t1, 1 - sw $t1, -80($fp) - label_END_28: -# IF_ZERO local_c2i_at_A2I_internal_19 GOTO label_FALSEIF_25 -# IF_ZERO local_c2i_at_A2I_internal_19 GOTO label_FALSEIF_25 -lw $t1, -80($fp) -beq $t1, 0, label_FALSEIF_25 -# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) -# local_c2i_at_A2I_internal_18 = 6 -li $t1, 6 -sw $t1, -76($fp) -# GOTO label_ENDIF_26 -j label_ENDIF_26 -label_FALSEIF_25: - # LOCAL local_c2i_at_A2I_internal_23 --> -96($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_11 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -96($fp) - # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_23 --> -96($fp) - # local_c2i_at_A2I_internal_22 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_23 - lw $t1, 0($fp) - lw $t2, -96($fp) - sub $t1, $t1, $t2 - sw $t1, -92($fp) - # IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_TRUE_31 - # IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_TRUE_31 - lw $t1, -92($fp) - beq $t1, 0, label_TRUE_31 - # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) - # local_c2i_at_A2I_internal_22 = 0 - li $t1, 0 - sw $t1, -92($fp) - # GOTO label_END_32 -j label_END_32 -label_TRUE_31: - # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) - # local_c2i_at_A2I_internal_22 = 1 - li $t1, 1 - sw $t1, -92($fp) - label_END_32: -# IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_FALSEIF_29 -# IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_FALSEIF_29 -lw $t1, -92($fp) -beq $t1, 0, label_FALSEIF_29 -# LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) -# local_c2i_at_A2I_internal_21 = 7 -li $t1, 7 -sw $t1, -88($fp) -# GOTO label_ENDIF_30 -j label_ENDIF_30 -label_FALSEIF_29: - # LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_12 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -108($fp) - # LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) - # local_c2i_at_A2I_internal_25 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_26 - lw $t1, 0($fp) - lw $t2, -108($fp) - sub $t1, $t1, $t2 - sw $t1, -104($fp) - # IF_ZERO local_c2i_at_A2I_internal_25 GOTO label_TRUE_35 - # IF_ZERO local_c2i_at_A2I_internal_25 GOTO label_TRUE_35 - lw $t1, -104($fp) - beq $t1, 0, label_TRUE_35 - # LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) - # local_c2i_at_A2I_internal_25 = 0 - li $t1, 0 - sw $t1, -104($fp) - # GOTO label_END_36 -j label_END_36 -label_TRUE_35: - # LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) - # local_c2i_at_A2I_internal_25 = 1 - li $t1, 1 - sw $t1, -104($fp) - label_END_36: -# IF_ZERO local_c2i_at_A2I_internal_25 GOTO label_FALSEIF_33 -# IF_ZERO local_c2i_at_A2I_internal_25 GOTO label_FALSEIF_33 -lw $t1, -104($fp) -beq $t1, 0, label_FALSEIF_33 -# LOCAL local_c2i_at_A2I_internal_24 --> -100($fp) -# local_c2i_at_A2I_internal_24 = 8 -li $t1, 8 -sw $t1, -100($fp) -# GOTO label_ENDIF_34 -j label_ENDIF_34 -label_FALSEIF_33: - # LOCAL local_c2i_at_A2I_internal_29 --> -120($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_13 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -120($fp) - # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_29 --> -120($fp) - # local_c2i_at_A2I_internal_28 = PARAM param_c2i_at_A2I_char_0 - local_c2i_at_A2I_internal_29 - lw $t1, 0($fp) - lw $t2, -120($fp) - sub $t1, $t1, $t2 - sw $t1, -116($fp) - # IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_TRUE_39 - # IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_TRUE_39 - lw $t1, -116($fp) - beq $t1, 0, label_TRUE_39 - # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) - # local_c2i_at_A2I_internal_28 = 0 - li $t1, 0 - sw $t1, -116($fp) - # GOTO label_END_40 -j label_END_40 -label_TRUE_39: - # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) - # local_c2i_at_A2I_internal_28 = 1 - li $t1, 1 - sw $t1, -116($fp) - label_END_40: -# IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_FALSEIF_37 -# IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_FALSEIF_37 -lw $t1, -116($fp) -beq $t1, 0, label_FALSEIF_37 -# LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) -# local_c2i_at_A2I_internal_27 = 9 -li $t1, 9 -sw $t1, -112($fp) -# GOTO label_ENDIF_38 -j label_ENDIF_38 -label_FALSEIF_37: - # LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) - # local_c2i_at_A2I_internal_32 = SELF - sw $s1, -132($fp) - # LOCAL local_c2i_at_A2I_internal_30 --> -124($fp) - # LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) - # local_c2i_at_A2I_internal_30 = local_c2i_at_A2I_internal_32 - lw $t1, -132($fp) - sw $t1, -124($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_c2i_at_A2I_internal_30 --> -124($fp) - # LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) - # local_c2i_at_A2I_internal_31 = VCALL local_c2i_at_A2I_internal_30 abort - # Save new self pointer in $s1 - lw $s1, -124($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -128($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) - # local_c2i_at_A2I_internal_27 = 0 - li $t1, 0 - sw $t1, -112($fp) - label_ENDIF_38: -# LOCAL local_c2i_at_A2I_internal_24 --> -100($fp) -# LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) -# local_c2i_at_A2I_internal_24 = local_c2i_at_A2I_internal_27 -lw $t1, -112($fp) -sw $t1, -100($fp) -label_ENDIF_34: -# LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) -# LOCAL local_c2i_at_A2I_internal_24 --> -100($fp) -# local_c2i_at_A2I_internal_21 = local_c2i_at_A2I_internal_24 -lw $t1, -100($fp) -sw $t1, -88($fp) -label_ENDIF_30: -# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) -# LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) -# local_c2i_at_A2I_internal_18 = local_c2i_at_A2I_internal_21 -lw $t1, -88($fp) -sw $t1, -76($fp) -label_ENDIF_26: -# LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) -# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) -# local_c2i_at_A2I_internal_15 = local_c2i_at_A2I_internal_18 -lw $t1, -76($fp) -sw $t1, -64($fp) -label_ENDIF_22: -# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) -# LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) -# local_c2i_at_A2I_internal_12 = local_c2i_at_A2I_internal_15 -lw $t1, -64($fp) -sw $t1, -52($fp) -label_ENDIF_18: -# LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) -# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) -# local_c2i_at_A2I_internal_9 = local_c2i_at_A2I_internal_12 -lw $t1, -52($fp) -sw $t1, -40($fp) -label_ENDIF_14: -# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) -# LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) -# local_c2i_at_A2I_internal_6 = local_c2i_at_A2I_internal_9 -lw $t1, -40($fp) -sw $t1, -28($fp) -label_ENDIF_10: -# LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) -# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) -# local_c2i_at_A2I_internal_3 = local_c2i_at_A2I_internal_6 -lw $t1, -28($fp) -sw $t1, -16($fp) -label_ENDIF_6: -# LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) -# LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) -# local_c2i_at_A2I_internal_0 = local_c2i_at_A2I_internal_3 -lw $t1, -16($fp) -sw $t1, -4($fp) -label_ENDIF_2: -# RETURN local_c2i_at_A2I_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_c2i_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 140 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_i2c_at_A2I implementation. -# @Params: -# 0($fp) = param_i2c_at_A2I_i_0 -function_i2c_at_A2I: - # Allocate stack frame for function function_i2c_at_A2I. - subu $sp, $sp, 144 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 144 - # LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_1 = PARAM param_i2c_at_A2I_i_0 - 0 - lw $t1, 0($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_ZERO local_i2c_at_A2I_internal_1 GOTO label_TRUE_43 - # IF_ZERO local_i2c_at_A2I_internal_1 GOTO label_TRUE_43 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_43 - # LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) - # local_i2c_at_A2I_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_44 -j label_END_44 -label_TRUE_43: - # LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) - # local_i2c_at_A2I_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_44: -# IF_ZERO local_i2c_at_A2I_internal_1 GOTO label_FALSEIF_41 -# IF_ZERO local_i2c_at_A2I_internal_1 GOTO label_FALSEIF_41 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_41 -# LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_14 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -12($fp) -# LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) -# LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) -# local_i2c_at_A2I_internal_0 = local_i2c_at_A2I_internal_2 -lw $t1, -12($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_42 -j label_ENDIF_42 -label_FALSEIF_41: - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_4 = PARAM param_i2c_at_A2I_i_0 - 1 - lw $t1, 0($fp) - sub $t1, $t1, 1 - sw $t1, -20($fp) - # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_47 - # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_TRUE_47 - lw $t1, -20($fp) - beq $t1, 0, label_TRUE_47 - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - # local_i2c_at_A2I_internal_4 = 0 - li $t1, 0 - sw $t1, -20($fp) - # GOTO label_END_48 -j label_END_48 -label_TRUE_47: - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - # local_i2c_at_A2I_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) - label_END_48: -# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSEIF_45 -# IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSEIF_45 -lw $t1, -20($fp) -beq $t1, 0, label_FALSEIF_45 -# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_15 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -24($fp) -# LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) -# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) -# local_i2c_at_A2I_internal_3 = local_i2c_at_A2I_internal_5 -lw $t1, -24($fp) -sw $t1, -16($fp) -# GOTO label_ENDIF_46 -j label_ENDIF_46 -label_FALSEIF_45: - # LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_7 = PARAM param_i2c_at_A2I_i_0 - 2 - lw $t1, 0($fp) - sub $t1, $t1, 2 - sw $t1, -32($fp) - # IF_ZERO local_i2c_at_A2I_internal_7 GOTO label_TRUE_51 - # IF_ZERO local_i2c_at_A2I_internal_7 GOTO label_TRUE_51 - lw $t1, -32($fp) - beq $t1, 0, label_TRUE_51 - # LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) - # local_i2c_at_A2I_internal_7 = 0 - li $t1, 0 - sw $t1, -32($fp) - # GOTO label_END_52 -j label_END_52 -label_TRUE_51: - # LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) - # local_i2c_at_A2I_internal_7 = 1 - li $t1, 1 - sw $t1, -32($fp) - label_END_52: -# IF_ZERO local_i2c_at_A2I_internal_7 GOTO label_FALSEIF_49 -# IF_ZERO local_i2c_at_A2I_internal_7 GOTO label_FALSEIF_49 -lw $t1, -32($fp) -beq $t1, 0, label_FALSEIF_49 -# LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_16 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -36($fp) -# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) -# LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) -# local_i2c_at_A2I_internal_6 = local_i2c_at_A2I_internal_8 -lw $t1, -36($fp) -sw $t1, -28($fp) -# GOTO label_ENDIF_50 -j label_ENDIF_50 -label_FALSEIF_49: - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_10 = PARAM param_i2c_at_A2I_i_0 - 3 - lw $t1, 0($fp) - sub $t1, $t1, 3 - sw $t1, -44($fp) - # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_55 - # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_TRUE_55 - lw $t1, -44($fp) - beq $t1, 0, label_TRUE_55 - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - # local_i2c_at_A2I_internal_10 = 0 - li $t1, 0 - sw $t1, -44($fp) - # GOTO label_END_56 -j label_END_56 -label_TRUE_55: - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - # local_i2c_at_A2I_internal_10 = 1 - li $t1, 1 - sw $t1, -44($fp) - label_END_56: -# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSEIF_53 -# IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSEIF_53 -lw $t1, -44($fp) -beq $t1, 0, label_FALSEIF_53 -# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_17 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -48($fp) -# LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) -# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) -# local_i2c_at_A2I_internal_9 = local_i2c_at_A2I_internal_11 -lw $t1, -48($fp) -sw $t1, -40($fp) -# GOTO label_ENDIF_54 -j label_ENDIF_54 -label_FALSEIF_53: - # LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_13 = PARAM param_i2c_at_A2I_i_0 - 4 - lw $t1, 0($fp) - sub $t1, $t1, 4 - sw $t1, -56($fp) - # IF_ZERO local_i2c_at_A2I_internal_13 GOTO label_TRUE_59 - # IF_ZERO local_i2c_at_A2I_internal_13 GOTO label_TRUE_59 - lw $t1, -56($fp) - beq $t1, 0, label_TRUE_59 - # LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) - # local_i2c_at_A2I_internal_13 = 0 - li $t1, 0 - sw $t1, -56($fp) - # GOTO label_END_60 -j label_END_60 -label_TRUE_59: - # LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) - # local_i2c_at_A2I_internal_13 = 1 - li $t1, 1 - sw $t1, -56($fp) - label_END_60: -# IF_ZERO local_i2c_at_A2I_internal_13 GOTO label_FALSEIF_57 -# IF_ZERO local_i2c_at_A2I_internal_13 GOTO label_FALSEIF_57 -lw $t1, -56($fp) -beq $t1, 0, label_FALSEIF_57 -# LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_18 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -60($fp) -# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) -# LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) -# local_i2c_at_A2I_internal_12 = local_i2c_at_A2I_internal_14 -lw $t1, -60($fp) -sw $t1, -52($fp) -# GOTO label_ENDIF_58 -j label_ENDIF_58 -label_FALSEIF_57: - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_16 = PARAM param_i2c_at_A2I_i_0 - 5 - lw $t1, 0($fp) - sub $t1, $t1, 5 - sw $t1, -68($fp) - # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_63 - # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_TRUE_63 - lw $t1, -68($fp) - beq $t1, 0, label_TRUE_63 - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - # local_i2c_at_A2I_internal_16 = 0 - li $t1, 0 - sw $t1, -68($fp) - # GOTO label_END_64 -j label_END_64 -label_TRUE_63: - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - # local_i2c_at_A2I_internal_16 = 1 - li $t1, 1 - sw $t1, -68($fp) - label_END_64: -# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSEIF_61 -# IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSEIF_61 -lw $t1, -68($fp) -beq $t1, 0, label_FALSEIF_61 -# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_19 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -72($fp) -# LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) -# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) -# local_i2c_at_A2I_internal_15 = local_i2c_at_A2I_internal_17 -lw $t1, -72($fp) -sw $t1, -64($fp) -# GOTO label_ENDIF_62 -j label_ENDIF_62 -label_FALSEIF_61: - # LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_19 = PARAM param_i2c_at_A2I_i_0 - 6 - lw $t1, 0($fp) - sub $t1, $t1, 6 - sw $t1, -80($fp) - # IF_ZERO local_i2c_at_A2I_internal_19 GOTO label_TRUE_67 - # IF_ZERO local_i2c_at_A2I_internal_19 GOTO label_TRUE_67 - lw $t1, -80($fp) - beq $t1, 0, label_TRUE_67 - # LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) - # local_i2c_at_A2I_internal_19 = 0 - li $t1, 0 - sw $t1, -80($fp) - # GOTO label_END_68 -j label_END_68 -label_TRUE_67: - # LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) - # local_i2c_at_A2I_internal_19 = 1 - li $t1, 1 - sw $t1, -80($fp) - label_END_68: -# IF_ZERO local_i2c_at_A2I_internal_19 GOTO label_FALSEIF_65 -# IF_ZERO local_i2c_at_A2I_internal_19 GOTO label_FALSEIF_65 -lw $t1, -80($fp) -beq $t1, 0, label_FALSEIF_65 -# LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_20 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -84($fp) -# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) -# LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) -# local_i2c_at_A2I_internal_18 = local_i2c_at_A2I_internal_20 -lw $t1, -84($fp) -sw $t1, -76($fp) -# GOTO label_ENDIF_66 -j label_ENDIF_66 -label_FALSEIF_65: - # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_22 = PARAM param_i2c_at_A2I_i_0 - 7 - lw $t1, 0($fp) - sub $t1, $t1, 7 - sw $t1, -92($fp) - # IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_TRUE_71 - # IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_TRUE_71 - lw $t1, -92($fp) - beq $t1, 0, label_TRUE_71 - # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) - # local_i2c_at_A2I_internal_22 = 0 - li $t1, 0 - sw $t1, -92($fp) - # GOTO label_END_72 -j label_END_72 -label_TRUE_71: - # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) - # local_i2c_at_A2I_internal_22 = 1 - li $t1, 1 - sw $t1, -92($fp) - label_END_72: -# IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_FALSEIF_69 -# IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_FALSEIF_69 -lw $t1, -92($fp) -beq $t1, 0, label_FALSEIF_69 -# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_21 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -96($fp) -# LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) -# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) -# local_i2c_at_A2I_internal_21 = local_i2c_at_A2I_internal_23 -lw $t1, -96($fp) -sw $t1, -88($fp) -# GOTO label_ENDIF_70 -j label_ENDIF_70 -label_FALSEIF_69: - # LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_25 = PARAM param_i2c_at_A2I_i_0 - 8 - lw $t1, 0($fp) - sub $t1, $t1, 8 - sw $t1, -104($fp) - # IF_ZERO local_i2c_at_A2I_internal_25 GOTO label_TRUE_75 - # IF_ZERO local_i2c_at_A2I_internal_25 GOTO label_TRUE_75 - lw $t1, -104($fp) - beq $t1, 0, label_TRUE_75 - # LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) - # local_i2c_at_A2I_internal_25 = 0 - li $t1, 0 - sw $t1, -104($fp) - # GOTO label_END_76 -j label_END_76 -label_TRUE_75: - # LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) - # local_i2c_at_A2I_internal_25 = 1 - li $t1, 1 - sw $t1, -104($fp) - label_END_76: -# IF_ZERO local_i2c_at_A2I_internal_25 GOTO label_FALSEIF_73 -# IF_ZERO local_i2c_at_A2I_internal_25 GOTO label_FALSEIF_73 -lw $t1, -104($fp) -beq $t1, 0, label_FALSEIF_73 -# LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_22 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -108($fp) -# LOCAL local_i2c_at_A2I_internal_24 --> -100($fp) -# LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) -# local_i2c_at_A2I_internal_24 = local_i2c_at_A2I_internal_26 -lw $t1, -108($fp) -sw $t1, -100($fp) -# GOTO label_ENDIF_74 -j label_ENDIF_74 -label_FALSEIF_73: - # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # local_i2c_at_A2I_internal_28 = PARAM param_i2c_at_A2I_i_0 - 9 - lw $t1, 0($fp) - sub $t1, $t1, 9 - sw $t1, -116($fp) - # IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_TRUE_79 - # IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_TRUE_79 - lw $t1, -116($fp) - beq $t1, 0, label_TRUE_79 - # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) - # local_i2c_at_A2I_internal_28 = 0 - li $t1, 0 - sw $t1, -116($fp) - # GOTO label_END_80 -j label_END_80 -label_TRUE_79: - # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) - # local_i2c_at_A2I_internal_28 = 1 - li $t1, 1 - sw $t1, -116($fp) - label_END_80: -# IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_FALSEIF_77 -# IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_FALSEIF_77 -lw $t1, -116($fp) -beq $t1, 0, label_FALSEIF_77 -# LOCAL local_i2c_at_A2I_internal_29 --> -120($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_23 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -120($fp) -# LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) -# LOCAL local_i2c_at_A2I_internal_29 --> -120($fp) -# local_i2c_at_A2I_internal_27 = local_i2c_at_A2I_internal_29 -lw $t1, -120($fp) -sw $t1, -112($fp) -# GOTO label_ENDIF_78 -j label_ENDIF_78 -label_FALSEIF_77: - # LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) - # local_i2c_at_A2I_internal_32 = SELF - sw $s1, -132($fp) - # LOCAL local_i2c_at_A2I_internal_30 --> -124($fp) - # LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) - # local_i2c_at_A2I_internal_30 = local_i2c_at_A2I_internal_32 - lw $t1, -132($fp) - sw $t1, -124($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2c_at_A2I_internal_30 --> -124($fp) - # LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) - # local_i2c_at_A2I_internal_31 = VCALL local_i2c_at_A2I_internal_30 abort - # Save new self pointer in $s1 - lw $s1, -124($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 0($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -128($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_24 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -136($fp) - # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) - # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) - # local_i2c_at_A2I_internal_27 = local_i2c_at_A2I_internal_33 - lw $t1, -136($fp) - sw $t1, -112($fp) - label_ENDIF_78: -# LOCAL local_i2c_at_A2I_internal_24 --> -100($fp) -# LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) -# local_i2c_at_A2I_internal_24 = local_i2c_at_A2I_internal_27 -lw $t1, -112($fp) -sw $t1, -100($fp) -label_ENDIF_74: -# LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) -# LOCAL local_i2c_at_A2I_internal_24 --> -100($fp) -# local_i2c_at_A2I_internal_21 = local_i2c_at_A2I_internal_24 -lw $t1, -100($fp) -sw $t1, -88($fp) -label_ENDIF_70: -# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) -# LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) -# local_i2c_at_A2I_internal_18 = local_i2c_at_A2I_internal_21 -lw $t1, -88($fp) -sw $t1, -76($fp) -label_ENDIF_66: -# LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) -# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) -# local_i2c_at_A2I_internal_15 = local_i2c_at_A2I_internal_18 -lw $t1, -76($fp) -sw $t1, -64($fp) -label_ENDIF_62: -# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) -# LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) -# local_i2c_at_A2I_internal_12 = local_i2c_at_A2I_internal_15 -lw $t1, -64($fp) -sw $t1, -52($fp) -label_ENDIF_58: -# LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) -# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) -# local_i2c_at_A2I_internal_9 = local_i2c_at_A2I_internal_12 -lw $t1, -52($fp) -sw $t1, -40($fp) -label_ENDIF_54: -# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) -# LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) -# local_i2c_at_A2I_internal_6 = local_i2c_at_A2I_internal_9 -lw $t1, -40($fp) -sw $t1, -28($fp) -label_ENDIF_50: -# LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) -# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) -# local_i2c_at_A2I_internal_3 = local_i2c_at_A2I_internal_6 -lw $t1, -28($fp) -sw $t1, -16($fp) -label_ENDIF_46: -# LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) -# LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) -# local_i2c_at_A2I_internal_0 = local_i2c_at_A2I_internal_3 -lw $t1, -16($fp) -sw $t1, -4($fp) -label_ENDIF_42: -# RETURN local_i2c_at_A2I_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_i2c_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 144 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_a2i_at_A2I implementation. -# @Params: -# 0($fp) = param_a2i_at_A2I_s_0 -function_a2i_at_A2I: - # Allocate stack frame for function function_a2i_at_A2I. - subu $sp, $sp, 144 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 144 - # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) - # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - # local_a2i_at_A2I_internal_2 = PARAM param_a2i_at_A2I_s_0 - lw $t1, 0($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # local_a2i_at_A2I_internal_3 = VCALL local_a2i_at_A2I_internal_2 length - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # local_a2i_at_A2I_internal_1 = local_a2i_at_A2I_internal_3 - 0 - lw $t1, -16($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_ZERO local_a2i_at_A2I_internal_1 GOTO label_TRUE_83 - # IF_ZERO local_a2i_at_A2I_internal_1 GOTO label_TRUE_83 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_83 - # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) - # local_a2i_at_A2I_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_84 -j label_END_84 -label_TRUE_83: - # LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) - # local_a2i_at_A2I_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_84: -# IF_ZERO local_a2i_at_A2I_internal_1 GOTO label_FALSEIF_81 -# IF_ZERO local_a2i_at_A2I_internal_1 GOTO label_FALSEIF_81 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_81 -# LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) -# local_a2i_at_A2I_internal_0 = 0 -li $t1, 0 -sw $t1, -4($fp) -# GOTO label_ENDIF_82 -j label_ENDIF_82 -label_FALSEIF_81: - # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) - # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - # local_a2i_at_A2I_internal_6 = PARAM param_a2i_at_A2I_s_0 - lw $t1, 0($fp) - sw $t1, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 0 - li $t1, 0 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # ARG 1 - li $t1, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) - # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) - # local_a2i_at_A2I_internal_7 = VCALL local_a2i_at_A2I_internal_6 substr - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 16($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_25 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -36($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) - # LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) - # local_a2i_at_A2I_internal_5 = local_a2i_at_A2I_internal_7 - local_a2i_at_A2I_internal_8 - lw $t1, -32($fp) - lw $t2, -36($fp) - sub $t1, $t1, $t2 - sw $t1, -24($fp) - # IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_TRUE_87 - # IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_TRUE_87 - lw $t1, -24($fp) - beq $t1, 0, label_TRUE_87 - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # local_a2i_at_A2I_internal_5 = 0 - li $t1, 0 - sw $t1, -24($fp) - # GOTO label_END_88 -j label_END_88 -label_TRUE_87: - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # local_a2i_at_A2I_internal_5 = 1 - li $t1, 1 - sw $t1, -24($fp) - label_END_88: -# IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_FALSEIF_85 -# IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_FALSEIF_85 -lw $t1, -24($fp) -beq $t1, 0, label_FALSEIF_85 -# LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) -# local_a2i_at_A2I_internal_12 = SELF -sw $s1, -52($fp) -# LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) -# LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) -# local_a2i_at_A2I_internal_10 = local_a2i_at_A2I_internal_12 -lw $t1, -52($fp) -sw $t1, -44($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_13 = PARAM param_a2i_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -56($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG 1 -li $t1, 1 -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_16 = PARAM param_a2i_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -68($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) -# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) -# local_a2i_at_A2I_internal_17 = VCALL local_a2i_at_A2I_internal_16 length -# Save new self pointer in $s1 -lw $s1, -68($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 20($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -72($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) -# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) -# local_a2i_at_A2I_internal_15 = local_a2i_at_A2I_internal_17 - 1 -lw $t1, -72($fp) -sub $t1, $t1, 1 -sw $t1, -64($fp) -# ARG local_a2i_at_A2I_internal_15 -# LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) -lw $t1, -64($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) -# LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) -# local_a2i_at_A2I_internal_14 = VCALL local_a2i_at_A2I_internal_13 substr -# Save new self pointer in $s1 -lw $s1, -56($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 16($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -60($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_a2i_at_A2I_internal_14 -# LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) -lw $t1, -60($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) -# LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) -# local_a2i_at_A2I_internal_11 = VCALL local_a2i_at_A2I_internal_10 a2i_aux -# Save new self pointer in $s1 -lw $s1, -44($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 24($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -48($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) -# LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) -lw $t1, -48($fp) -not $t1, $t1 -sw $t1, -40($fp) -# LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) -# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) -# local_a2i_at_A2I_internal_4 = local_a2i_at_A2I_internal_9 -lw $t1, -40($fp) -sw $t1, -20($fp) -# GOTO label_ENDIF_86 -j label_ENDIF_86 -label_FALSEIF_85: - # LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) - # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - # local_a2i_at_A2I_internal_20 = PARAM param_a2i_at_A2I_s_0 - lw $t1, 0($fp) - sw $t1, -84($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 0 - li $t1, 0 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # ARG 1 - li $t1, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) - # LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) - # local_a2i_at_A2I_internal_21 = VCALL local_a2i_at_A2I_internal_20 substr - # Save new self pointer in $s1 - lw $s1, -84($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 16($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -88($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_22 --> -92($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_26 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -92($fp) - # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) - # LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) - # LOCAL local_a2i_at_A2I_internal_22 --> -92($fp) - # local_a2i_at_A2I_internal_19 = local_a2i_at_A2I_internal_21 - local_a2i_at_A2I_internal_22 - lw $t1, -88($fp) - lw $t2, -92($fp) - sub $t1, $t1, $t2 - sw $t1, -80($fp) - # IF_ZERO local_a2i_at_A2I_internal_19 GOTO label_TRUE_91 - # IF_ZERO local_a2i_at_A2I_internal_19 GOTO label_TRUE_91 - lw $t1, -80($fp) - beq $t1, 0, label_TRUE_91 - # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) - # local_a2i_at_A2I_internal_19 = 0 - li $t1, 0 - sw $t1, -80($fp) - # GOTO label_END_92 -j label_END_92 -label_TRUE_91: - # LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) - # local_a2i_at_A2I_internal_19 = 1 - li $t1, 1 - sw $t1, -80($fp) - label_END_92: -# IF_ZERO local_a2i_at_A2I_internal_19 GOTO label_FALSEIF_89 -# IF_ZERO local_a2i_at_A2I_internal_19 GOTO label_FALSEIF_89 -lw $t1, -80($fp) -beq $t1, 0, label_FALSEIF_89 -# LOCAL local_a2i_at_A2I_internal_25 --> -104($fp) -# local_a2i_at_A2I_internal_25 = SELF -sw $s1, -104($fp) -# LOCAL local_a2i_at_A2I_internal_23 --> -96($fp) -# LOCAL local_a2i_at_A2I_internal_25 --> -104($fp) -# local_a2i_at_A2I_internal_23 = local_a2i_at_A2I_internal_25 -lw $t1, -104($fp) -sw $t1, -96($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_26 --> -108($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_26 = PARAM param_a2i_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -108($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG 1 -li $t1, 1 -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_29 = PARAM param_a2i_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -120($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) -# LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) -# local_a2i_at_A2I_internal_30 = VCALL local_a2i_at_A2I_internal_29 length -# Save new self pointer in $s1 -lw $s1, -120($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 20($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -124($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_28 --> -116($fp) -# LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) -# local_a2i_at_A2I_internal_28 = local_a2i_at_A2I_internal_30 - 1 -lw $t1, -124($fp) -sub $t1, $t1, 1 -sw $t1, -116($fp) -# ARG local_a2i_at_A2I_internal_28 -# LOCAL local_a2i_at_A2I_internal_28 --> -116($fp) -lw $t1, -116($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_26 --> -108($fp) -# LOCAL local_a2i_at_A2I_internal_27 --> -112($fp) -# local_a2i_at_A2I_internal_27 = VCALL local_a2i_at_A2I_internal_26 substr -# Save new self pointer in $s1 -lw $s1, -108($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 16($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -112($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_a2i_at_A2I_internal_27 -# LOCAL local_a2i_at_A2I_internal_27 --> -112($fp) -lw $t1, -112($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_23 --> -96($fp) -# LOCAL local_a2i_at_A2I_internal_24 --> -100($fp) -# local_a2i_at_A2I_internal_24 = VCALL local_a2i_at_A2I_internal_23 a2i_aux -# Save new self pointer in $s1 -lw $s1, -96($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 24($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -100($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) -# LOCAL local_a2i_at_A2I_internal_24 --> -100($fp) -# local_a2i_at_A2I_internal_18 = local_a2i_at_A2I_internal_24 -lw $t1, -100($fp) -sw $t1, -76($fp) -# GOTO label_ENDIF_90 -j label_ENDIF_90 -label_FALSEIF_89: - # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) - # local_a2i_at_A2I_internal_33 = SELF - sw $s1, -136($fp) - # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) - # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) - # local_a2i_at_A2I_internal_31 = local_a2i_at_A2I_internal_33 - lw $t1, -136($fp) - sw $t1, -128($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_a2i_at_A2I_s_0 - # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - lw $t1, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) - # LOCAL local_a2i_at_A2I_internal_32 --> -132($fp) - # local_a2i_at_A2I_internal_32 = VCALL local_a2i_at_A2I_internal_31 a2i_aux - # Save new self pointer in $s1 - lw $s1, -128($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 24($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -132($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) - # LOCAL local_a2i_at_A2I_internal_32 --> -132($fp) - # local_a2i_at_A2I_internal_18 = local_a2i_at_A2I_internal_32 - lw $t1, -132($fp) - sw $t1, -76($fp) - label_ENDIF_90: -# LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) -# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) -# local_a2i_at_A2I_internal_4 = local_a2i_at_A2I_internal_18 -lw $t1, -76($fp) -sw $t1, -20($fp) -label_ENDIF_86: -# LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) -# LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) -# local_a2i_at_A2I_internal_0 = local_a2i_at_A2I_internal_4 -lw $t1, -20($fp) -sw $t1, -4($fp) -label_ENDIF_82: -# RETURN local_a2i_at_A2I_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_a2i_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 144 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_a2i_aux_at_A2I implementation. -# @Params: -# 0($fp) = param_a2i_aux_at_A2I_s_0 -function_a2i_aux_at_A2I: - # Allocate stack frame for function function_a2i_aux_at_A2I. - subu $sp, $sp, 64 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 64 - # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) - # local_a2i_aux_at_A2I_int_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # LOCAL local_a2i_aux_at_A2I_internal_2 --> -12($fp) - # PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) - # local_a2i_aux_at_A2I_internal_2 = PARAM param_a2i_aux_at_A2I_s_0 - lw $t1, 0($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_aux_at_A2I_internal_2 --> -12($fp) - # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) - # local_a2i_aux_at_A2I_internal_3 = VCALL local_a2i_aux_at_A2I_internal_2 length - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_aux_at_A2I_j_1 --> -8($fp) - # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) - # local_a2i_aux_at_A2I_j_1 = local_a2i_aux_at_A2I_internal_3 - lw $t1, -16($fp) - sw $t1, -8($fp) - # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) - # local_a2i_aux_at_A2I_i_4 = 0 - li $t1, 0 - sw $t1, -20($fp) - label_WHILE_93: - # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) - # LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) - # LOCAL local_a2i_aux_at_A2I_j_1 --> -8($fp) - # local_a2i_aux_at_A2I_internal_5 = local_a2i_aux_at_A2I_i_4 - local_a2i_aux_at_A2I_j_1 - lw $t1, -20($fp) - lw $t2, -8($fp) - sub $t1, $t1, $t2 - sw $t1, -24($fp) - # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 - # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 - lw $t1, -24($fp) - bgt $t1, 0, label_FALSE_95 - # IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 - # IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_FALSE_95 - lw $t1, -24($fp) - beq $t1, 0, label_FALSE_95 - # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) - # local_a2i_aux_at_A2I_internal_5 = 1 - li $t1, 1 - sw $t1, -24($fp) - # GOTO label_END_96 -j label_END_96 -label_FALSE_95: - # LOCAL local_a2i_aux_at_A2I_internal_5 --> -24($fp) - # local_a2i_aux_at_A2I_internal_5 = 0 - li $t1, 0 - sw $t1, -24($fp) - label_END_96: -# IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_WHILE_END_94 -# IF_ZERO local_a2i_aux_at_A2I_internal_5 GOTO label_WHILE_END_94 -lw $t1, -24($fp) -beq $t1, 0, label_WHILE_END_94 -# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) -# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) -# local_a2i_aux_at_A2I_internal_7 = local_a2i_aux_at_A2I_int_0 * 10 -lw $t1, -4($fp) -mul $t1, $t1, 10 -sw $t1, -32($fp) -# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) -# local_a2i_aux_at_A2I_internal_10 = SELF -sw $s1, -44($fp) -# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) -# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) -# local_a2i_aux_at_A2I_internal_8 = local_a2i_aux_at_A2I_internal_10 -lw $t1, -44($fp) -sw $t1, -36($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) -# PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) -# local_a2i_aux_at_A2I_internal_11 = PARAM param_a2i_aux_at_A2I_s_0 -lw $t1, 0($fp) -sw $t1, -48($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_a2i_aux_at_A2I_i_4 -# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) -lw $t1, -20($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# ARG 1 -li $t1, 1 -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) -# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) -# local_a2i_aux_at_A2I_internal_12 = VCALL local_a2i_aux_at_A2I_internal_11 substr -# Save new self pointer in $s1 -lw $s1, -48($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 16($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -52($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_a2i_aux_at_A2I_internal_12 -# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) -lw $t1, -52($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) -# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) -# local_a2i_aux_at_A2I_internal_9 = VCALL local_a2i_aux_at_A2I_internal_8 c2i -# Save new self pointer in $s1 -lw $s1, -36($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 12($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -40($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) -# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) -# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) -# local_a2i_aux_at_A2I_internal_6 = local_a2i_aux_at_A2I_internal_7 + local_a2i_aux_at_A2I_internal_9 -lw $t1, -32($fp) -lw $t2, -40($fp) -add $t1, $t1, $t2 -sw $t1, -28($fp) -# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) -# LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) -# local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_6 -lw $t1, -28($fp) -sw $t1, -4($fp) -# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) -# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) -# local_a2i_aux_at_A2I_internal_13 = local_a2i_aux_at_A2I_i_4 + 1 -lw $t1, -20($fp) -add $t1, $t1, 1 -sw $t1, -56($fp) -# LOCAL local_a2i_aux_at_A2I_i_4 --> -20($fp) -# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) -# local_a2i_aux_at_A2I_i_4 = local_a2i_aux_at_A2I_internal_13 -lw $t1, -56($fp) -sw $t1, -20($fp) -# GOTO label_WHILE_93 -j label_WHILE_93 -label_WHILE_END_94: - # RETURN local_a2i_aux_at_A2I_int_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_a2i_aux_at_A2I. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 64 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_i2a_at_A2I implementation. -# @Params: -# 0($fp) = param_i2a_at_A2I_i_0 -function_i2a_at_A2I: - # Allocate stack frame for function function_i2a_at_A2I. - subu $sp, $sp, 68 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 68 - # LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # local_i2a_at_A2I_internal_1 = PARAM param_i2a_at_A2I_i_0 - 0 - lw $t1, 0($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_ZERO local_i2a_at_A2I_internal_1 GOTO label_TRUE_99 - # IF_ZERO local_i2a_at_A2I_internal_1 GOTO label_TRUE_99 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_99 - # LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) - # local_i2a_at_A2I_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_100 -j label_END_100 -label_TRUE_99: - # LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) - # local_i2a_at_A2I_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_100: -# IF_ZERO local_i2a_at_A2I_internal_1 GOTO label_FALSEIF_97 -# IF_ZERO local_i2a_at_A2I_internal_1 GOTO label_FALSEIF_97 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_97 -# LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_27 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -12($fp) -# LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) -# LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) -# local_i2a_at_A2I_internal_0 = local_i2a_at_A2I_internal_2 -lw $t1, -12($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_98 -j label_ENDIF_98 -label_FALSEIF_97: - # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # local_i2a_at_A2I_internal_4 = 0 - PARAM param_i2a_at_A2I_i_0 - li $t1, 0 - lw $t2, 0($fp) - sub $t1, $t1, $t2 - sw $t1, -20($fp) - # IF_GREATER_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_103 - # IF_GREATER_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_103 - lw $t1, -20($fp) - bgt $t1, 0, label_FALSE_103 - # IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_103 - # IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_103 - lw $t1, -20($fp) - beq $t1, 0, label_FALSE_103 - # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) - # local_i2a_at_A2I_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) - # GOTO label_END_104 -j label_END_104 -label_FALSE_103: - # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) - # local_i2a_at_A2I_internal_4 = 0 - li $t1, 0 - sw $t1, -20($fp) - label_END_104: -# IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSEIF_101 -# IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSEIF_101 -lw $t1, -20($fp) -beq $t1, 0, label_FALSEIF_101 -# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) -# local_i2a_at_A2I_internal_7 = SELF -sw $s1, -32($fp) -# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) -# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) -# local_i2a_at_A2I_internal_5 = local_i2a_at_A2I_internal_7 -lw $t1, -32($fp) -sw $t1, -24($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_i2a_at_A2I_i_0 -# PARAM param_i2a_at_A2I_i_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) -# LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) -# local_i2a_at_A2I_internal_6 = VCALL local_i2a_at_A2I_internal_5 i2a_aux -# Save new self pointer in $s1 -lw $s1, -24($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 32($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -28($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) -# LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) -# local_i2a_at_A2I_internal_3 = local_i2a_at_A2I_internal_6 -lw $t1, -28($fp) -sw $t1, -16($fp) -# GOTO label_ENDIF_102 -j label_ENDIF_102 -label_FALSEIF_101: - # LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_28 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -44($fp) - # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) - # LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) - # local_i2a_at_A2I_internal_8 = local_i2a_at_A2I_internal_10 - lw $t1, -44($fp) - sw $t1, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2a_at_A2I_internal_13 --> -56($fp) - # local_i2a_at_A2I_internal_13 = SELF - sw $s1, -56($fp) - # LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) - # LOCAL local_i2a_at_A2I_internal_13 --> -56($fp) - # local_i2a_at_A2I_internal_11 = local_i2a_at_A2I_internal_13 - lw $t1, -56($fp) - sw $t1, -48($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2a_at_A2I_internal_14 --> -60($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # local_i2a_at_A2I_internal_14 = PARAM param_i2a_at_A2I_i_0 * 1 - lw $t1, 0($fp) - mul $t1, $t1, 1 - sw $t1, -60($fp) - # ARG local_i2a_at_A2I_internal_14 - # LOCAL local_i2a_at_A2I_internal_14 --> -60($fp) - lw $t1, -60($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) - # LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) - # local_i2a_at_A2I_internal_12 = VCALL local_i2a_at_A2I_internal_11 i2a_aux - # Save new self pointer in $s1 - lw $s1, -48($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 32($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -52($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_i2a_at_A2I_internal_12 - # LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) - lw $t1, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) - # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) - # local_i2a_at_A2I_internal_9 = VCALL local_i2a_at_A2I_internal_8 concat - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) - # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) - # local_i2a_at_A2I_internal_3 = local_i2a_at_A2I_internal_9 - lw $t1, -40($fp) - sw $t1, -16($fp) - label_ENDIF_102: -# LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) -# LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) -# local_i2a_at_A2I_internal_0 = local_i2a_at_A2I_internal_3 -lw $t1, -16($fp) -sw $t1, -4($fp) -label_ENDIF_98: -# RETURN local_i2a_at_A2I_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_i2a_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 68 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_i2a_aux_at_A2I implementation. -# @Params: -# 0($fp) = param_i2a_aux_at_A2I_i_0 -function_i2a_aux_at_A2I: - # Allocate stack frame for function function_i2a_aux_at_A2I. - subu $sp, $sp, 68 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 68 - # LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # local_i2a_aux_at_A2I_internal_1 = PARAM param_i2a_aux_at_A2I_i_0 - 0 - lw $t1, 0($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_ZERO local_i2a_aux_at_A2I_internal_1 GOTO label_TRUE_107 - # IF_ZERO local_i2a_aux_at_A2I_internal_1 GOTO label_TRUE_107 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_107 - # LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) - # local_i2a_aux_at_A2I_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_108 -j label_END_108 -label_TRUE_107: - # LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) - # local_i2a_aux_at_A2I_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_108: -# IF_ZERO local_i2a_aux_at_A2I_internal_1 GOTO label_FALSEIF_105 -# IF_ZERO local_i2a_aux_at_A2I_internal_1 GOTO label_FALSEIF_105 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_105 -# LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_29 -sw $t1, 12($v0) -li $t1, 0 -sw $t1, 16($v0) -sw $v0, -12($fp) -# LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) -# LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) -# local_i2a_aux_at_A2I_internal_0 = local_i2a_aux_at_A2I_internal_2 -lw $t1, -12($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_106 -j label_ENDIF_106 -label_FALSEIF_105: - # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # local_i2a_aux_at_A2I_internal_4 = PARAM param_i2a_aux_at_A2I_i_0 / 10 - lw $t1, 0($fp) - div $t1, $t1, 10 - sw $t1, -20($fp) - # LOCAL local_i2a_aux_at_A2I_next_3 --> -16($fp) - # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) - # local_i2a_aux_at_A2I_next_3 = local_i2a_aux_at_A2I_internal_4 - lw $t1, -20($fp) - sw $t1, -16($fp) - # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) - # local_i2a_aux_at_A2I_internal_9 = SELF - sw $s1, -40($fp) - # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) - # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) - # local_i2a_aux_at_A2I_internal_7 = local_i2a_aux_at_A2I_internal_9 - lw $t1, -40($fp) - sw $t1, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_i2a_aux_at_A2I_next_3 - # LOCAL local_i2a_aux_at_A2I_next_3 --> -16($fp) - lw $t1, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) - # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) - # local_i2a_aux_at_A2I_internal_8 = VCALL local_i2a_aux_at_A2I_internal_7 i2a_aux - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 32($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) - # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) - # local_i2a_aux_at_A2I_internal_5 = local_i2a_aux_at_A2I_internal_8 - lw $t1, -36($fp) - sw $t1, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) - # local_i2a_aux_at_A2I_internal_12 = SELF - sw $s1, -52($fp) - # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) - # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) - # local_i2a_aux_at_A2I_internal_10 = local_i2a_aux_at_A2I_internal_12 - lw $t1, -52($fp) - sw $t1, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_14 --> -60($fp) - # LOCAL local_i2a_aux_at_A2I_next_3 --> -16($fp) - # local_i2a_aux_at_A2I_internal_14 = local_i2a_aux_at_A2I_next_3 * 10 - lw $t1, -16($fp) - mul $t1, $t1, 10 - sw $t1, -60($fp) - # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_aux_at_A2I_internal_14 --> -60($fp) - # local_i2a_aux_at_A2I_internal_13 = PARAM param_i2a_aux_at_A2I_i_0 - local_i2a_aux_at_A2I_internal_14 - lw $t1, 0($fp) - lw $t2, -60($fp) - sub $t1, $t1, $t2 - sw $t1, -56($fp) - # ARG local_i2a_aux_at_A2I_internal_13 - # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) - lw $t1, -56($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) - # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) - # local_i2a_aux_at_A2I_internal_11 = VCALL local_i2a_aux_at_A2I_internal_10 i2c - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 16($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_i2a_aux_at_A2I_internal_11 - # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) - lw $t1, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) - # LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) - # local_i2a_aux_at_A2I_internal_6 = VCALL local_i2a_aux_at_A2I_internal_5 concat - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) - # LOCAL local_i2a_aux_at_A2I_internal_6 --> -28($fp) - # local_i2a_aux_at_A2I_internal_0 = local_i2a_aux_at_A2I_internal_6 - lw $t1, -28($fp) - sw $t1, -4($fp) - label_ENDIF_106: -# RETURN local_i2a_aux_at_A2I_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_i2a_aux_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 68 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 100 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 100 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = ALLOCATE A2I - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, A2I - sw $t3, 12($v0) - li $t3, 3 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, A2I_start - sw $t3, 4($v0) - # Load type offset - li $t3, 16 - sw $t3, 8($v0) - move $t2, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t2, -16($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t2, -16($fp) - sw $t2, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_30 - sw $t2, 12($v0) - li $t2, 6 - sw $t2, 16($v0) - sw $v0, -20($fp) - # ARG local_main_at_Main_internal_4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - lw $t2, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 a2i - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 20($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_a_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_a_0 = local_main_at_Main_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) - # LOCAL local_main_at_Main_b_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_0 - sw $t2, 12($v0) - li $t2, 0 - sw $t2, 16($v0) - sw $v0, -24($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = ALLOCATE A2I - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, A2I - sw $t4, 12($v0) - li $t4, 3 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, A2I_start - sw $t4, 4($v0) - # Load type offset - li $t4, 16 - sw $t4, 8($v0) - move $t3, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t3, -36($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 - lw $t3, -36($fp) - sw $t3, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG 678987 - li $t3, 678987 - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 i2a - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 28($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_b_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_b_5 = local_main_at_Main_internal_7 - lw $t3, -32($fp) - sw $t3, -24($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 - lw $t3, -48($fp) - sw $t3, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_main_at_Main_a_0 - # LOCAL local_main_at_Main_a_0 --> -4($fp) - lw $t3, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_int - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 16($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 - lw $t3, -60($fp) - sw $t3, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_31 - sw $t3, 12($v0) - li $t3, 4 - sw $t3, 16($v0) - sw $v0, -64($fp) - # ARG local_main_at_Main_internal_15 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - lw $t3, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 12($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 - lw $t3, -76($fp) - sw $t3, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_main_at_Main_b_5 - # LOCAL local_main_at_Main_b_5 --> -24($fp) - lw $t3, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 12($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # local_main_at_Main_internal_21 = SELF - sw $s1, -88($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 - lw $t3, -88($fp) - sw $t3, -80($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, data_32 - sw $t3, 12($v0) - li $t3, 1 - sw $t3, 16($v0) - sw $v0, -92($fp) - # ARG local_main_at_Main_internal_22 - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - lw $t3, -92($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 out_string - # Save new self pointer in $s1 - lw $s1, -80($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 12($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -84($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_20 - lw $v0, -84($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 100 - jr $ra - # Function END - diff --git a/tests/codegen/book_list.mips b/tests/codegen/book_list.mips index b395beea..22b6fed8 100644 --- a/tests/codegen/book_list.mips +++ b/tests/codegen/book_list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:22 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:51 2020 # School of Math and Computer Science, University of Havana # @@ -533,7 +533,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -841,59 +841,9 @@ function_main_at_Main: sw $fp, 0($sp) addu $fp, $sp, 92 # LOCAL local_main_at_Main_a_book_0 --> -4($fp) - # local_main_at_Main_a_book_0 = ALLOCATE Book - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Book - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Book_start - sw $t0, 4($v0) - # Load type offset - li $t0, 36 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) + # local_main_at_Main_a_book_0 = 0 + li $t0, 0 + sw $t0, -4($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_3 = ALLOCATE Book # Allocating 20 bytes of memory @@ -1027,67 +977,9 @@ function_main_at_Main: lw $t0, -12($fp) sw $t0, -4($fp) # LOCAL local_main_at_Main_an_article_6 --> -28($fp) - # local_main_at_Main_an_article_6 = ALLOCATE Article - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Article - sw $t0, 12($v0) - li $t0, 7 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 24 bytes of memory - li $a0, 24 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Article_start - sw $t0, 4($v0) - # Load type offset - li $t0, 40 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Article__attrib__per_title__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -28($fp) + # local_main_at_Main_an_article_6 = 0 + li $t0, 0 + sw $t0, -28($fp) # LOCAL local_main_at_Main_internal_9 --> -40($fp) # local_main_at_Main_internal_9 = ALLOCATE Article # Allocating 20 bytes of memory @@ -1488,59 +1380,9 @@ function_cons_at_BookList: sw $fp, 0($sp) addu $fp, $sp, 32 # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) - # local_cons_at_BookList_new_cell_0 = ALLOCATE Cons - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Cons - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Cons_start - sw $t0, 4($v0) - # Load type offset - li $t0, 32 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Cons__attrib__xcar__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Cons__attrib__xcdr__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) + # local_cons_at_BookList_new_cell_0 = 0 + li $t0, 0 + sw $t0, -4($fp) # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) # local_cons_at_BookList_internal_1 = ALLOCATE Cons # Allocating 20 bytes of memory @@ -2226,7 +2068,7 @@ function_print_list_at_Cons: # local_print_list_at_Cons_internal_6 = 14 li $t0, 14 sw $t0, -28($fp) - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Book @@ -2248,7 +2090,7 @@ function_print_list_at_Cons: lw $t0, -32($fp) sw $t0, -28($fp) label_Not_min0_1: - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Article @@ -2286,7 +2128,7 @@ function_print_list_at_Cons: # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 lw $t0, -20($fp) beq $t0, 0, label_ERROR_3 - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Book @@ -2367,7 +2209,7 @@ function_print_list_at_Cons: # GOTO label_END_4 j label_END_4 label_NEXT0_5: - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Article diff --git a/tests/codegen/cells.mips b/tests/codegen/cells.mips deleted file mode 100644 index 9ecbf6d2..00000000 --- a/tests/codegen/cells.mips +++ /dev/null @@ -1,2997 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 07:49:34 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Int: .asciiz "Int" -# Function END -Main: .asciiz "Main" -# Function END -CellularAutomaton: .asciiz "CellularAutomaton" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Int **** -Int_start: - Int_vtable_pointer: .word Int_vtable - # Function END -Int_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -# **** VTABLE for type CellularAutomaton **** -CellularAutomaton_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_CellularAutomaton, function_print_at_CellularAutomaton, function_num_cells_at_CellularAutomaton, function_cell_at_CellularAutomaton, function_cell_left_neighbor_at_CellularAutomaton, function_cell_right_neighbor_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_evolve_at_CellularAutomaton -# Function END -# - - -# **** Type RECORD for type CellularAutomaton **** -CellularAutomaton_start: - CellularAutomaton_vtable_pointer: .word CellularAutomaton_vtable - # Function END -CellularAutomaton_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1, -1 -Main__TDT: .word -1, -1, -1, -1, -1, 0, -1 -CellularAutomaton__TDT: .word -1, -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz " X " -# - - -data_5: .asciiz "\n" -# - - -data_6: .asciiz "X" -# - - -data_7: .asciiz "X" -# - - -data_8: .asciiz "X" -# - - -data_9: .asciiz "X" -# - - -data_10: .asciiz "." -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - move $a0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - sw $a0, 12($v0) - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - lw $t2, 12($t2) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - lw $a0, 12($a0) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # LOCAL local_length_at_String_internal_1 --> -8($fp) - # LOCAL local_length_at_String_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -4($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_length_at_String_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) - # Load type offset - li $t2, 20 - sw $t2, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__cells__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t1, Main_vtable - # Get pointer to function address - lw $t2, 12($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__cells__init implementation. -# @Params: -__Main__attrib__cells__init: - # Allocate stack frame for function __Main__attrib__cells__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Main__attrib__cells__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 88 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 88 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = ALLOCATE CellularAutomaton - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, CellularAutomaton - sw $t3, 12($v0) - li $t3, 17 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, CellularAutomaton_start - sw $t3, 4($v0) - # Load type offset - li $t3, 24 - sw $t3, 8($v0) - move $t2, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __CellularAutomaton__attrib__population_map__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t2) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t2, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_4 - sw $t2, 12($v0) - li $t2, 19 - sw $t2, 16($v0) - sw $v0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t2, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 init - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 28($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - lw $t2, -8($fp) - sw $t2, 12($s1) - # local_main_at_Main_internal_6 = GETATTRIBUTE cells Main - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - lw $t2, 12($s1) - sw $t2, -28($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # local_main_at_Main_internal_4 = local_main_at_Main_internal_6 - lw $t2, -28($fp) - sw $t2, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 print - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 32($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Int - sw $t2, 12($v0) - li $t2, 3 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Int_start - sw $t2, 4($v0) - # Load type offset - li $t2, 16 - sw $t2, 8($v0) - li $t2, 20 - sw $t2, 12($v0) - sw $v0, -36($fp) - # LOCAL local_main_at_Main_countdown_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_countdown_7 = local_main_at_Main_internal_8 - lw $t2, -36($fp) - sw $t2, -32($fp) - label_WHILE_1: - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Int - sw $t2, 12($v0) - li $t2, 3 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Int_start - sw $t2, 4($v0) - # Load type offset - li $t2, 16 - sw $t2, 8($v0) - li $t2, 0 - sw $t2, 12($v0) - sw $v0, -44($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_countdown_7 --> -32($fp) - # local_main_at_Main_internal_9 = local_main_at_Main_internal_10 - local_main_at_Main_countdown_7 - lw $t3, -44($fp) - lw $t2, 12($t3) - lw $t3, -32($fp) - lw $t4, 12($t3) - sub $t2, $t2, $t4 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Int - sw $t3, 12($v0) - li $t3, 3 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Int_start - sw $t3, 4($v0) - # Load type offset - li $t3, 16 - sw $t3, 8($v0) - sw $t2, 12($v0) - sw $v0, -40($fp) - # IF_GREATER_ZERO local_main_at_Main_internal_9 GOTO label_FALSE_3 - # IF_GREATER_ZERO local_main_at_Main_internal_9 GOTO label_FALSE_3 - lw $t2, -40($fp) - bgt $t2, 0, label_FALSE_3 - # IF_ZERO local_main_at_Main_internal_9 GOTO label_FALSE_3 - # IF_ZERO local_main_at_Main_internal_9 GOTO label_FALSE_3 - lw $t2, -40($fp) - beq $t2, 0, label_FALSE_3 - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = 1 - li $t2, 1 - sw $t2, -40($fp) - # GOTO label_END_4 -j label_END_4 -label_FALSE_3: - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = 0 - li $t2, 0 - sw $t2, -40($fp) - label_END_4: -# IF_ZERO local_main_at_Main_internal_9 GOTO label_WHILE_END_2 -# IF_ZERO local_main_at_Main_internal_9 GOTO label_WHILE_END_2 -lw $t2, -40($fp) -beq $t2, 0, label_WHILE_END_2 -# local_main_at_Main_internal_13 = GETATTRIBUTE cells Main -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -lw $t2, 12($s1) -sw $t2, -56($fp) -# LOCAL local_main_at_Main_internal_11 --> -48($fp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# local_main_at_Main_internal_11 = local_main_at_Main_internal_13 -lw $t2, -56($fp) -sw $t2, -48($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_11 --> -48($fp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# local_main_at_Main_internal_12 = VCALL local_main_at_Main_internal_11 evolve -# Save new self pointer in $s1 -lw $s1, -48($fp) -# Get pointer to type -lw $t2, 4($s1) -# Get pointer to type's VTABLE -lw $t3, 0($t2) -# Get pointer to function address -lw $t4, 56($t3) -# Call function. Result is on $v0 -jalr $t4 -sw $v0, -52($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# local_main_at_Main_internal_16 = GETATTRIBUTE cells Main -# LOCAL local_main_at_Main_internal_16 --> -68($fp) -lw $t2, 12($s1) -sw $t2, -68($fp) -# LOCAL local_main_at_Main_internal_14 --> -60($fp) -# LOCAL local_main_at_Main_internal_16 --> -68($fp) -# local_main_at_Main_internal_14 = local_main_at_Main_internal_16 -lw $t2, -68($fp) -sw $t2, -60($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_14 --> -60($fp) -# LOCAL local_main_at_Main_internal_15 --> -64($fp) -# local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 print -# Save new self pointer in $s1 -lw $s1, -60($fp) -# Get pointer to type -lw $t2, 4($s1) -# Get pointer to type's VTABLE -lw $t3, 0($t2) -# Get pointer to function address -lw $t4, 32($t3) -# Call function. Result is on $v0 -jalr $t4 -sw $v0, -64($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t2, String -sw $t2, 0($v0) -la $t2, String_start -sw $t2, 4($v0) -# Load type offset -li $t2, 8 -sw $t2, 8($v0) -la $t2, Int -sw $t2, 12($v0) -li $t2, 3 -sw $t2, 16($v0) -move $t2, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t2, 0($v0) -la $t2, Int_start -sw $t2, 4($v0) -# Load type offset -li $t2, 16 -sw $t2, 8($v0) -li $t2, 1 -sw $t2, 12($v0) -sw $v0, -76($fp) -# LOCAL local_main_at_Main_internal_17 --> -72($fp) -# LOCAL local_main_at_Main_countdown_7 --> -32($fp) -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# local_main_at_Main_internal_17 = local_main_at_Main_countdown_7 - local_main_at_Main_internal_18 -lw $t3, -32($fp) -lw $t2, 12($t3) -lw $t3, -76($fp) -lw $t4, 12($t3) -sub $t2, $t2, $t4 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t3, String -sw $t3, 0($v0) -la $t3, String_start -sw $t3, 4($v0) -# Load type offset -li $t3, 8 -sw $t3, 8($v0) -la $t3, Int -sw $t3, 12($v0) -li $t3, 3 -sw $t3, 16($v0) -move $t3, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t3, 0($v0) -la $t3, Int_start -sw $t3, 4($v0) -# Load type offset -li $t3, 16 -sw $t3, 8($v0) -sw $t2, 12($v0) -sw $v0, -72($fp) -# LOCAL local_main_at_Main_countdown_7 --> -32($fp) -# LOCAL local_main_at_Main_internal_17 --> -72($fp) -# local_main_at_Main_countdown_7 = local_main_at_Main_internal_17 -lw $t2, -72($fp) -sw $t2, -32($fp) -# GOTO label_WHILE_1 -j label_WHILE_1 -label_WHILE_END_2: - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_19 = SELF - sw $s1, -80($fp) - # RETURN local_main_at_Main_internal_19 - lw $v0, -80($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 88 - jr $ra - # Function END - - -# __CellularAutomaton__attrib__population_map__init implementation. -# @Params: -__CellularAutomaton__attrib__population_map__init: - # Allocate stack frame for function __CellularAutomaton__attrib__population_map__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_rAutomaton__attrib__population_map__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_0 - sw $t2, 12($v0) - li $t2, 0 - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_rAutomaton__attrib__population_map__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __CellularAutomaton__attrib__population_map__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_init_at_CellularAutomaton_map_0 -function_init_at_CellularAutomaton: - # Allocate stack frame for function function_init_at_CellularAutomaton. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_CellularAutomaton_map_0 --> 0($fp) - lw $t2, 0($fp) - sw $t2, 12($s1) - # LOCAL local_init_at_CellularAutomaton_internal_0 --> -4($fp) - # local_init_at_CellularAutomaton_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_init_at_CellularAutomaton_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_init_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_print_at_CellularAutomaton implementation. -# @Params: -function_print_at_CellularAutomaton: - # Allocate stack frame for function function_print_at_CellularAutomaton. - subu $sp, $sp, 40 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 40 - # LOCAL local_print_at_CellularAutomaton_internal_2 --> -12($fp) - # local_print_at_CellularAutomaton_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_print_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_print_at_CellularAutomaton_internal_2 --> -12($fp) - # local_print_at_CellularAutomaton_internal_0 = local_print_at_CellularAutomaton_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_CellularAutomaton_internal_5 = GETATTRIBUTE population_map CellularAutomaton - # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) - lw $t2, 12($s1) - sw $t2, -24($fp) - # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) - # local_print_at_CellularAutomaton_internal_3 = local_print_at_CellularAutomaton_internal_5 - lw $t2, -24($fp) - sw $t2, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, data_5 - sw $t2, 12($v0) - li $t2, 1 - sw $t2, 16($v0) - sw $v0, -28($fp) - # ARG local_print_at_CellularAutomaton_internal_6 - # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) - lw $t2, -28($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_print_at_CellularAutomaton_internal_4 --> -20($fp) - # local_print_at_CellularAutomaton_internal_4 = VCALL local_print_at_CellularAutomaton_internal_3 concat - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 12($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_print_at_CellularAutomaton_internal_4 - # LOCAL local_print_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t2, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_print_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_print_at_CellularAutomaton_internal_1 --> -8($fp) - # local_print_at_CellularAutomaton_internal_1 = VCALL local_print_at_CellularAutomaton_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 12($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) - # local_print_at_CellularAutomaton_internal_7 = SELF - sw $s1, -32($fp) - # RETURN local_print_at_CellularAutomaton_internal_7 - lw $v0, -32($fp) - # Deallocate stack frame for function function_print_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 40 - jr $ra - # Function END - - -# function_num_cells_at_CellularAutomaton implementation. -# @Params: -function_num_cells_at_CellularAutomaton: - # Allocate stack frame for function function_num_cells_at_CellularAutomaton. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_num_cells_at_CellularAutomaton_internal_2 = GETATTRIBUTE population_map CellularAutomaton - # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) - lw $t2, 12($s1) - sw $t2, -12($fp) - # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) - # local_num_cells_at_CellularAutomaton_internal_0 = local_num_cells_at_CellularAutomaton_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_num_cells_at_CellularAutomaton_internal_1 --> -8($fp) - # local_num_cells_at_CellularAutomaton_internal_1 = VCALL local_num_cells_at_CellularAutomaton_internal_0 length - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 20($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_num_cells_at_CellularAutomaton_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_num_cells_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cell_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_cell_at_CellularAutomaton_position_0 -function_cell_at_CellularAutomaton: - # Allocate stack frame for function function_cell_at_CellularAutomaton. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_cell_at_CellularAutomaton_internal_2 = GETATTRIBUTE population_map CellularAutomaton - # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) - lw $t2, 12($s1) - sw $t2, -12($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) - # local_cell_at_CellularAutomaton_internal_0 = local_cell_at_CellularAutomaton_internal_2 - lw $t2, -12($fp) - sw $t2, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cell_at_CellularAutomaton_position_0 - # PARAM param_cell_at_CellularAutomaton_position_0 --> 0($fp) - lw $t2, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Int - sw $t2, 12($v0) - li $t2, 3 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Int_start - sw $t2, 4($v0) - # Load type offset - li $t2, 16 - sw $t2, 8($v0) - li $t2, 1 - sw $t2, 12($v0) - sw $v0, -16($fp) - # ARG local_cell_at_CellularAutomaton_internal_3 - # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) - lw $t2, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) - # local_cell_at_CellularAutomaton_internal_1 = VCALL local_cell_at_CellularAutomaton_internal_0 substr - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 16($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_cell_at_CellularAutomaton_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_cell_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_cell_left_neighbor_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_cell_left_neighbor_at_CellularAutomaton_position_0 -function_cell_left_neighbor_at_CellularAutomaton: - # Allocate stack frame for function function_cell_left_neighbor_at_CellularAutomaton. - subu $sp, $sp, 72 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 72 - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Int - sw $t2, 12($v0) - li $t2, 3 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Int_start - sw $t2, 4($v0) - # Load type offset - li $t2, 16 - sw $t2, 8($v0) - li $t2, 0 - sw $t2, 12($v0) - sw $v0, -12($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) - # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) - lw $t2, 0($fp) - # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_5 - # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_5 - lw $t3, -8($fp) - beq $t3, 0, label_FALSEIF_5 - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_5 = SELF - sw $s1, -24($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_3 = local_cell_left_neighbor_at_CellularAutomaton_internal_5 - lw $t3, -24($fp) - sw $t3, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_9 = SELF - sw $s1, -40($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_7 = local_cell_left_neighbor_at_CellularAutomaton_internal_9 - lw $t3, -40($fp) - sw $t3, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_8 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_7 num_cells - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 36($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Int - sw $t3, 12($v0) - li $t3, 3 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Int_start - sw $t3, 4($v0) - # Load type offset - li $t3, 16 - sw $t3, 8($v0) - li $t3, 1 - sw $t3, 12($v0) - sw $v0, -44($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_6 = local_cell_left_neighbor_at_CellularAutomaton_internal_8 - local_cell_left_neighbor_at_CellularAutomaton_internal_10 - lw $t4, -36($fp) - lw $t3, 12($t4) - lw $t4, -44($fp) - lw $t5, 12($t4) - sub $t3, $t3, $t5 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Int - sw $t4, 12($v0) - li $t4, 3 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, Int_start - sw $t4, 4($v0) - # Load type offset - li $t4, 16 - sw $t4, 8($v0) - sw $t3, 12($v0) - sw $v0, -28($fp) - # ARG local_cell_left_neighbor_at_CellularAutomaton_internal_6 - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) - lw $t3, -28($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_4 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_3 cell - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 40($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_0 = local_cell_left_neighbor_at_CellularAutomaton_internal_4 - lw $t3, -20($fp) - sw $t3, -4($fp) - # GOTO label_ENDIF_6 -j label_ENDIF_6 -label_FALSEIF_5: - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_13 --> -56($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_13 = SELF - sw $s1, -56($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_13 --> -56($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_11 = local_cell_left_neighbor_at_CellularAutomaton_internal_13 - lw $t3, -56($fp) - sw $t3, -48($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Int - sw $t3, 12($v0) - li $t3, 3 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Int_start - sw $t3, 4($v0) - # Load type offset - li $t3, 16 - sw $t3, 8($v0) - li $t3, 1 - sw $t3, 12($v0) - sw $v0, -64($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_14 --> -60($fp) - # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_15 --> -64($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_14 = PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 - local_cell_left_neighbor_at_CellularAutomaton_internal_15 - lw $t4, 0($fp) - lw $t3, 12($t4) - lw $t4, -64($fp) - lw $t5, 12($t4) - sub $t3, $t3, $t5 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Int - sw $t4, 12($v0) - li $t4, 3 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, Int_start - sw $t4, 4($v0) - # Load type offset - li $t4, 16 - sw $t4, 8($v0) - sw $t3, 12($v0) - sw $v0, -60($fp) - # ARG local_cell_left_neighbor_at_CellularAutomaton_internal_14 - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_14 --> -60($fp) - lw $t3, -60($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_12 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_11 cell - # Save new self pointer in $s1 - lw $s1, -48($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 40($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -52($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_0 = local_cell_left_neighbor_at_CellularAutomaton_internal_12 - lw $t3, -52($fp) - sw $t3, -4($fp) - label_ENDIF_6: -# RETURN local_cell_left_neighbor_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_cell_left_neighbor_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 72 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_cell_right_neighbor_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_cell_right_neighbor_at_CellularAutomaton_position_0 -function_cell_right_neighbor_at_CellularAutomaton: - # Allocate stack frame for function function_cell_right_neighbor_at_CellularAutomaton. - subu $sp, $sp, 72 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 72 - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_5 = SELF - sw $s1, -24($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_3 = local_cell_right_neighbor_at_CellularAutomaton_internal_5 - lw $t3, -24($fp) - sw $t3, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_4 = VCALL local_cell_right_neighbor_at_CellularAutomaton_internal_3 num_cells - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 36($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Int - sw $t3, 12($v0) - li $t3, 3 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Int_start - sw $t3, 4($v0) - # Load type offset - li $t3, 16 - sw $t3, 8($v0) - li $t3, 1 - sw $t3, 12($v0) - sw $v0, -28($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_2 = local_cell_right_neighbor_at_CellularAutomaton_internal_4 - local_cell_right_neighbor_at_CellularAutomaton_internal_6 - lw $t4, -20($fp) - lw $t3, 12($t4) - lw $t4, -28($fp) - lw $t5, 12($t4) - sub $t3, $t3, $t5 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Int - sw $t4, 12($v0) - li $t4, 3 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, Int_start - sw $t4, 4($v0) - # Load type offset - li $t4, 16 - sw $t4, 8($v0) - sw $t3, 12($v0) - sw $v0, -12($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) - # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) - lw $t3, 0($fp) - # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_7 - # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_7 - lw $t4, -8($fp) - beq $t4, 0, label_FALSEIF_7 - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_9 = SELF - sw $s1, -40($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_7 = local_cell_right_neighbor_at_CellularAutomaton_internal_9 - lw $t4, -40($fp) - sw $t4, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Int - sw $t4, 12($v0) - li $t4, 3 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, Int_start - sw $t4, 4($v0) - # Load type offset - li $t4, 16 - sw $t4, 8($v0) - li $t4, 0 - sw $t4, 12($v0) - sw $v0, -44($fp) - # ARG local_cell_right_neighbor_at_CellularAutomaton_internal_10 - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) - lw $t4, -44($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_8 = VCALL local_cell_right_neighbor_at_CellularAutomaton_internal_7 cell - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t4, 4($s1) - # Get pointer to type's VTABLE - lw $t5, 0($t4) - # Get pointer to function address - lw $t6, 40($t5) - # Call function. Result is on $v0 - jalr $t6 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_0 = local_cell_right_neighbor_at_CellularAutomaton_internal_8 - lw $t4, -36($fp) - sw $t4, -4($fp) - # GOTO label_ENDIF_8 -j label_ENDIF_8 -label_FALSEIF_7: - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_13 --> -56($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_13 = SELF - sw $s1, -56($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_13 --> -56($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_11 = local_cell_right_neighbor_at_CellularAutomaton_internal_13 - lw $t4, -56($fp) - sw $t4, -48($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Int - sw $t4, 12($v0) - li $t4, 3 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, Int_start - sw $t4, 4($v0) - # Load type offset - li $t4, 16 - sw $t4, 8($v0) - li $t4, 1 - sw $t4, 12($v0) - sw $v0, -64($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_14 --> -60($fp) - # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_15 --> -64($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_14 = PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 + local_cell_right_neighbor_at_CellularAutomaton_internal_15 - lw $t5, 0($fp) - lw $t4, 12($t5) - lw $t5, -64($fp) - lw $t6, 12($t5) - add $t4, $t4, $t6 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) - # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, Int - sw $t5, 12($v0) - li $t5, 3 - sw $t5, 16($v0) - move $t5, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t5, 0($v0) - la $t5, Int_start - sw $t5, 4($v0) - # Load type offset - li $t5, 16 - sw $t5, 8($v0) - sw $t4, 12($v0) - sw $v0, -60($fp) - # ARG local_cell_right_neighbor_at_CellularAutomaton_internal_14 - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_14 --> -60($fp) - lw $t4, -60($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_12 = VCALL local_cell_right_neighbor_at_CellularAutomaton_internal_11 cell - # Save new self pointer in $s1 - lw $s1, -48($fp) - # Get pointer to type - lw $t4, 4($s1) - # Get pointer to type's VTABLE - lw $t5, 0($t4) - # Get pointer to function address - lw $t6, 40($t5) - # Call function. Result is on $v0 - jalr $t6 - sw $v0, -52($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_0 = local_cell_right_neighbor_at_CellularAutomaton_internal_12 - lw $t4, -52($fp) - sw $t4, -4($fp) - label_ENDIF_8: -# RETURN local_cell_right_neighbor_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_cell_right_neighbor_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 72 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_cell_at_next_evolution_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_cell_at_next_evolution_at_CellularAutomaton_position_0 -function_cell_at_next_evolution_at_CellularAutomaton: - # Allocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. - subu $sp, $sp, 132 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 132 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_8 = SELF - sw $s1, -36($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_6 = local_cell_at_next_evolution_at_CellularAutomaton_internal_8 - lw $t4, -36($fp) - sw $t4, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 - # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) - lw $t4, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 cell - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t4, 4($s1) - # Get pointer to type's VTABLE - lw $t5, 0($t4) - # Get pointer to function address - lw $t6, 40($t5) - # Call function. Result is on $v0 - jalr $t6 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, data_6 - sw $t4, 12($v0) - li $t4, 1 - sw $t4, 16($v0) - sw $v0, -40($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) - lw $t4, -32($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_5 GOTO label_FALSEIF_11 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_5 GOTO label_FALSEIF_11 - lw $t5, -24($fp) - beq $t5, 0, label_FALSEIF_11 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) - # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, Int - sw $t5, 12($v0) - li $t5, 3 - sw $t5, 16($v0) - move $t5, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t5, 0($v0) - la $t5, Int_start - sw $t5, 4($v0) - # Load type offset - li $t5, 16 - sw $t5, 8($v0) - li $t5, 1 - sw $t5, 12($v0) - sw $v0, -44($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_4 = local_cell_at_next_evolution_at_CellularAutomaton_internal_10 - lw $t5, -44($fp) - sw $t5, -20($fp) - # GOTO label_ENDIF_12 -j label_ENDIF_12 -label_FALSEIF_11: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) - # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, Int - sw $t5, 12($v0) - li $t5, 3 - sw $t5, 16($v0) - move $t5, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t5, 0($v0) - la $t5, Int_start - sw $t5, 4($v0) - # Load type offset - li $t5, 16 - sw $t5, 8($v0) - li $t5, 0 - sw $t5, 12($v0) - sw $v0, -48($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_4 = local_cell_at_next_evolution_at_CellularAutomaton_internal_11 - lw $t5, -48($fp) - sw $t5, -20($fp) - label_ENDIF_12: -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_16 = SELF -sw $s1, -68($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_14 = local_cell_at_next_evolution_at_CellularAutomaton_internal_16 -lw $t5, -68($fp) -sw $t5, -60($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 -# PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) -lw $t5, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t5, 0($sp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_15 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 cell_left_neighbor -# Save new self pointer in $s1 -lw $s1, -60($fp) -# Get pointer to type -lw $t5, 4($s1) -# Get pointer to type's VTABLE -lw $t6, 0($t5) -# Get pointer to function address -lw $t7, 44($t6) -# Call function. Result is on $v0 -jalr $t7 -sw $v0, -64($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t5, String -sw $t5, 0($v0) -la $t5, String_start -sw $t5, 4($v0) -# Load type offset -li $t5, 8 -sw $t5, 8($v0) -la $t5, data_7 -sw $t5, 12($v0) -li $t5, 1 -sw $t5, 16($v0) -sw $v0, -72($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) -lw $t5, -64($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_13 GOTO label_FALSEIF_13 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_13 GOTO label_FALSEIF_13 -lw $t6, -56($fp) -beq $t6, 0, label_FALSEIF_13 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t6, String -sw $t6, 0($v0) -la $t6, String_start -sw $t6, 4($v0) -# Load type offset -li $t6, 8 -sw $t6, 8($v0) -la $t6, Int -sw $t6, 12($v0) -li $t6, 3 -sw $t6, 16($v0) -move $t6, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t6, 0($v0) -la $t6, Int_start -sw $t6, 4($v0) -# Load type offset -li $t6, 16 -sw $t6, 8($v0) -li $t6, 1 -sw $t6, 12($v0) -sw $v0, -76($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = local_cell_at_next_evolution_at_CellularAutomaton_internal_18 -lw $t6, -76($fp) -sw $t6, -52($fp) -# GOTO label_ENDIF_14 -j label_ENDIF_14 -label_FALSEIF_13: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t6, String - sw $t6, 0($v0) - la $t6, String_start - sw $t6, 4($v0) - # Load type offset - li $t6, 8 - sw $t6, 8($v0) - la $t6, Int - sw $t6, 12($v0) - li $t6, 3 - sw $t6, 16($v0) - move $t6, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t6, 0($v0) - la $t6, Int_start - sw $t6, 4($v0) - # Load type offset - li $t6, 16 - sw $t6, 8($v0) - li $t6, 0 - sw $t6, 12($v0) - sw $v0, -80($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = local_cell_at_next_evolution_at_CellularAutomaton_internal_19 - lw $t6, -80($fp) - sw $t6, -52($fp) - label_ENDIF_14: -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_3 = local_cell_at_next_evolution_at_CellularAutomaton_internal_4 + local_cell_at_next_evolution_at_CellularAutomaton_internal_12 -lw $t7, -20($fp) -lw $t6, 12($t7) -lw $t7, -52($fp) -lw $t8, 12($t7) -add $t6, $t6, $t8 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t7, String -sw $t7, 0($v0) -la $t7, String_start -sw $t7, 4($v0) -# Load type offset -li $t7, 8 -sw $t7, 8($v0) -la $t7, Int -sw $t7, 12($v0) -li $t7, 3 -sw $t7, 16($v0) -move $t7, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t7, 0($v0) -la $t7, Int_start -sw $t7, 4($v0) -# Load type offset -li $t7, 16 -sw $t7, 8($v0) -sw $t6, 12($v0) -sw $v0, -16($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_24 = SELF -sw $s1, -100($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_22 = local_cell_at_next_evolution_at_CellularAutomaton_internal_24 -lw $t6, -100($fp) -sw $t6, -92($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 -# PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) -lw $t6, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t6, 0($sp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_23 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 cell_right_neighbor -# Save new self pointer in $s1 -lw $s1, -92($fp) -# Get pointer to type -lw $t6, 4($s1) -# Get pointer to type's VTABLE -lw $t7, 0($t6) -# Get pointer to function address -lw $t8, 48($t7) -# Call function. Result is on $v0 -jalr $t8 -sw $v0, -96($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_25 --> -104($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t6, String -sw $t6, 0($v0) -la $t6, String_start -sw $t6, 4($v0) -# Load type offset -li $t6, 8 -sw $t6, 8($v0) -la $t6, data_8 -sw $t6, 12($v0) -li $t6, 1 -sw $t6, 16($v0) -sw $v0, -104($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_25 --> -104($fp) -lw $t6, -96($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_21 GOTO label_FALSEIF_15 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_21 GOTO label_FALSEIF_15 -lw $t7, -88($fp) -beq $t7, 0, label_FALSEIF_15 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_26 --> -108($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t7, String -sw $t7, 0($v0) -la $t7, String_start -sw $t7, 4($v0) -# Load type offset -li $t7, 8 -sw $t7, 8($v0) -la $t7, Int -sw $t7, 12($v0) -li $t7, 3 -sw $t7, 16($v0) -move $t7, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t7, 0($v0) -la $t7, Int_start -sw $t7, 4($v0) -# Load type offset -li $t7, 16 -sw $t7, 8($v0) -li $t7, 1 -sw $t7, 12($v0) -sw $v0, -108($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_26 --> -108($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_20 = local_cell_at_next_evolution_at_CellularAutomaton_internal_26 -lw $t7, -108($fp) -sw $t7, -84($fp) -# GOTO label_ENDIF_16 -j label_ENDIF_16 -label_FALSEIF_15: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_27 --> -112($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t7, String - sw $t7, 0($v0) - la $t7, String_start - sw $t7, 4($v0) - # Load type offset - li $t7, 8 - sw $t7, 8($v0) - la $t7, Int - sw $t7, 12($v0) - li $t7, 3 - sw $t7, 16($v0) - move $t7, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t7, 0($v0) - la $t7, Int_start - sw $t7, 4($v0) - # Load type offset - li $t7, 16 - sw $t7, 8($v0) - li $t7, 0 - sw $t7, 12($v0) - sw $v0, -112($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_27 --> -112($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_20 = local_cell_at_next_evolution_at_CellularAutomaton_internal_27 - lw $t7, -112($fp) - sw $t7, -84($fp) - label_ENDIF_16: -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_2 = local_cell_at_next_evolution_at_CellularAutomaton_internal_3 + local_cell_at_next_evolution_at_CellularAutomaton_internal_20 -lw $t8, -16($fp) -lw $t7, 12($t8) -lw $t8, -84($fp) -lw $t9, 12($t8) -add $t7, $t7, $t9 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t8, String -sw $t8, 0($v0) -la $t8, String_start -sw $t8, 4($v0) -# Load type offset -li $t8, 8 -sw $t8, 8($v0) -la $t8, Int -sw $t8, 12($v0) -li $t8, 3 -sw $t8, 16($v0) -move $t8, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t8, 0($v0) -la $t8, Int_start -sw $t8, 4($v0) -# Load type offset -li $t8, 16 -sw $t8, 8($v0) -sw $t7, 12($v0) -sw $v0, -12($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_28 --> -116($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t7, String -sw $t7, 0($v0) -la $t7, String_start -sw $t7, 4($v0) -# Load type offset -li $t7, 8 -sw $t7, 8($v0) -la $t7, Int -sw $t7, 12($v0) -li $t7, 3 -sw $t7, 16($v0) -move $t7, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t7, 0($v0) -la $t7, Int_start -sw $t7, 4($v0) -# Load type offset -li $t7, 16 -sw $t7, 8($v0) -li $t7, 1 -sw $t7, 12($v0) -sw $v0, -116($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_28 --> -116($fp) -lw $t7, -12($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_9 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_9 -lw $t8, -8($fp) -beq $t8, 0, label_FALSEIF_9 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t8, String -sw $t8, 0($v0) -la $t8, String_start -sw $t8, 4($v0) -# Load type offset -li $t8, 8 -sw $t8, 8($v0) -la $t8, data_9 -sw $t8, 12($v0) -li $t8, 1 -sw $t8, 16($v0) -sw $v0, -120($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_0 = local_cell_at_next_evolution_at_CellularAutomaton_internal_29 -lw $t8, -120($fp) -sw $t8, -4($fp) -# GOTO label_ENDIF_10 -j label_ENDIF_10 -label_FALSEIF_9: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_30 --> -124($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t8, String - sw $t8, 0($v0) - la $t8, String_start - sw $t8, 4($v0) - # Load type offset - li $t8, 8 - sw $t8, 8($v0) - la $t8, data_10 - sw $t8, 12($v0) - li $t8, 1 - sw $t8, 16($v0) - sw $v0, -124($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_30 --> -124($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_0 = local_cell_at_next_evolution_at_CellularAutomaton_internal_30 - lw $t8, -124($fp) - sw $t8, -4($fp) - label_ENDIF_10: -# RETURN local_cell_at_next_evolution_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 132 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_evolve_at_CellularAutomaton implementation. -# @Params: -function_evolve_at_CellularAutomaton: - # Allocate stack frame for function function_evolve_at_CellularAutomaton. - subu $sp, $sp, 68 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 68 - # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) - # local_evolve_at_CellularAutomaton_position_0 = 0 - li $t8, 0 - sw $t8, -4($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) - # local_evolve_at_CellularAutomaton_internal_4 = SELF - sw $s1, -20($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) - # local_evolve_at_CellularAutomaton_internal_2 = local_evolve_at_CellularAutomaton_internal_4 - lw $t8, -20($fp) - sw $t8, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_evolve_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) - # local_evolve_at_CellularAutomaton_internal_3 = VCALL local_evolve_at_CellularAutomaton_internal_2 num_cells - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t8, 4($s1) - # Get pointer to type's VTABLE - lw $t9, 0($t8) - # Get pointer to function address - lw $s2, 36($t9) - # Call function. Result is on $v0 - jalr $s2 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) - # local_evolve_at_CellularAutomaton_num_1 = local_evolve_at_CellularAutomaton_internal_3 - lw $t8, -16($fp) - sw $t8, -8($fp) - # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t8, String - sw $t8, 0($v0) - la $t8, String_start - sw $t8, 4($v0) - # Load type offset - li $t8, 8 - sw $t8, 8($v0) - la $t8, data_0 - sw $t8, 12($v0) - li $t8, 0 - sw $t8, 16($v0) - sw $v0, -24($fp) - label_WHILE_17: - # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) - # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) - # local_evolve_at_CellularAutomaton_internal_6 = local_evolve_at_CellularAutomaton_position_0 - local_evolve_at_CellularAutomaton_num_1 - lw $t9, -4($fp) - lw $t8, 12($t9) - lw $t9, -8($fp) - lw $s2, 12($t9) - sub $t8, $t8, $s2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t9, String - sw $t9, 0($v0) - la $t9, String_start - sw $t9, 4($v0) - # Load type offset - li $t9, 8 - sw $t9, 8($v0) - la $t9, Int - sw $t9, 12($v0) - li $t9, 3 - sw $t9, 16($v0) - move $t9, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t9, 0($v0) - la $t9, Int_start - sw $t9, 4($v0) - # Load type offset - li $t9, 16 - sw $t9, 8($v0) - sw $t8, 12($v0) - sw $v0, -28($fp) - # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_19 - # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_19 - lw $t8, -28($fp) - bgt $t8, 0, label_FALSE_19 - # IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_19 - # IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_19 - lw $t8, -28($fp) - beq $t8, 0, label_FALSE_19 - # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) - # local_evolve_at_CellularAutomaton_internal_6 = 1 - li $t8, 1 - sw $t8, -28($fp) - # GOTO label_END_20 -j label_END_20 -label_FALSE_19: - # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) - # local_evolve_at_CellularAutomaton_internal_6 = 0 - li $t8, 0 - sw $t8, -28($fp) - label_END_20: -# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_18 -# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_18 -lw $t8, -28($fp) -beq $t8, 0, label_WHILE_END_18 -# LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) -# LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) -# local_evolve_at_CellularAutomaton_internal_7 = local_evolve_at_CellularAutomaton_temp_5 -lw $t8, -24($fp) -sw $t8, -32($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) -# local_evolve_at_CellularAutomaton_internal_11 = SELF -sw $s1, -48($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) -# local_evolve_at_CellularAutomaton_internal_9 = local_evolve_at_CellularAutomaton_internal_11 -lw $t8, -48($fp) -sw $t8, -40($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_evolve_at_CellularAutomaton_position_0 -# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) -lw $t8, -4($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t8, 0($sp) -# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) -# local_evolve_at_CellularAutomaton_internal_10 = VCALL local_evolve_at_CellularAutomaton_internal_9 cell_at_next_evolution -# Save new self pointer in $s1 -lw $s1, -40($fp) -# Get pointer to type -lw $t8, 4($s1) -# Get pointer to type's VTABLE -lw $t9, 0($t8) -# Get pointer to function address -lw $s2, 52($t9) -# Call function. Result is on $v0 -jalr $s2 -sw $v0, -44($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_evolve_at_CellularAutomaton_internal_10 -# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) -lw $t8, -44($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t8, 0($sp) -# LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) -# local_evolve_at_CellularAutomaton_internal_8 = VCALL local_evolve_at_CellularAutomaton_internal_7 concat -# Save new self pointer in $s1 -lw $s1, -32($fp) -# Get pointer to type -lw $t8, 4($s1) -# Get pointer to type's VTABLE -lw $t9, 0($t8) -# Get pointer to function address -lw $s2, 12($t9) -# Call function. Result is on $v0 -jalr $s2 -sw $v0, -36($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) -# local_evolve_at_CellularAutomaton_temp_5 = local_evolve_at_CellularAutomaton_internal_8 -lw $t8, -36($fp) -sw $t8, -24($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t8, String -sw $t8, 0($v0) -la $t8, String_start -sw $t8, 4($v0) -# Load type offset -li $t8, 8 -sw $t8, 8($v0) -la $t8, Int -sw $t8, 12($v0) -li $t8, 3 -sw $t8, 16($v0) -move $t8, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t8, 0($v0) -la $t8, Int_start -sw $t8, 4($v0) -# Load type offset -li $t8, 16 -sw $t8, 8($v0) -li $t8, 1 -sw $t8, 12($v0) -sw $v0, -56($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) -# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) -# local_evolve_at_CellularAutomaton_internal_12 = local_evolve_at_CellularAutomaton_position_0 + local_evolve_at_CellularAutomaton_internal_13 -lw $t9, -4($fp) -lw $t8, 12($t9) -lw $t9, -56($fp) -lw $s2, 12($t9) -add $t8, $t8, $s2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t9, String -sw $t9, 0($v0) -la $t9, String_start -sw $t9, 4($v0) -# Load type offset -li $t9, 8 -sw $t9, 8($v0) -la $t9, Int -sw $t9, 12($v0) -li $t9, 3 -sw $t9, 16($v0) -move $t9, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t9, 0($v0) -la $t9, Int_start -sw $t9, 4($v0) -# Load type offset -li $t9, 16 -sw $t9, 8($v0) -sw $t8, 12($v0) -sw $v0, -52($fp) -# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) -# local_evolve_at_CellularAutomaton_position_0 = local_evolve_at_CellularAutomaton_internal_12 -lw $t8, -52($fp) -sw $t8, -4($fp) -# GOTO label_WHILE_17 -j label_WHILE_17 -label_WHILE_END_18: - # - # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) - lw $t8, -24($fp) - sw $t8, 12($s1) - # LOCAL local_evolve_at_CellularAutomaton_internal_14 --> -60($fp) - # local_evolve_at_CellularAutomaton_internal_14 = SELF - sw $s1, -60($fp) - # RETURN local_evolve_at_CellularAutomaton_internal_14 - lw $v0, -60($fp) - # Deallocate stack frame for function function_evolve_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 68 - jr $ra - # Function END - diff --git a/tests/codegen/complex.mips b/tests/codegen/complex.mips index 54ea0dff..72e1c90f 100644 --- a/tests/codegen/complex.mips +++ b/tests/codegen/complex.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:21 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:51 2020 # School of Math and Computer Science, University of Havana # @@ -429,7 +429,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -2762,59 +2762,9 @@ function_main_at_Main: sw $fp, 0($sp) addu $fp, $sp, 104 # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_c_0 = ALLOCATE Complex - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Complex - sw $t0, 12($v0) - li $t0, 7 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Complex_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Complex__attrib__x__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Complex__attrib__y__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) + # local_main_at_Main_c_0 = 0 + li $t0, 0 + sw $t0, -4($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_3 = ALLOCATE Complex # Allocating 20 bytes of memory diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips index 84998bfd..89fb5601 100644 --- a/tests/codegen/fib.mips +++ b/tests/codegen/fib.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:21 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:51 2020 # School of Math and Computer Science, University of Havana # @@ -404,7 +404,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/graph.mips b/tests/codegen/graph.mips index 7f3ffb82..1ea016b0 100644 --- a/tests/codegen/graph.mips +++ b/tests/codegen/graph.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:22 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:52 2020 # School of Math and Computer Science, University of Havana # @@ -641,7 +641,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -1562,59 +1562,9 @@ function_read_input_at_Parse: sw $fp, 0($sp) addu $fp, $sp, 112 # LOCAL local_read_input_at_Parse_g_0 --> -4($fp) - # local_read_input_at_Parse_g_0 = ALLOCATE Graph - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Graph - sw $t0, 12($v0) - li $t0, 5 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Graph_start - sw $t0, 4($v0) - # Load type offset - li $t0, 24 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Graph__attrib__vertices__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Graph__attrib__edges__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) + # local_read_input_at_Parse_g_0 = 0 + li $t0, 0 + sw $t0, -4($fp) # LOCAL local_read_input_at_Parse_internal_1 --> -8($fp) # local_read_input_at_Parse_internal_1 = ALLOCATE Graph # Allocating 20 bytes of memory @@ -2479,59 +2429,9 @@ function_parse_line_at_Parse: sw $fp, 0($sp) addu $fp, $sp, 136 # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) - # local_parse_line_at_Parse_v_0 = ALLOCATE Vertice - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Vertice - sw $t0, 12($v0) - li $t0, 7 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Vertice_start - sw $t0, 4($v0) - # Load type offset - li $t0, 56 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Vertice__attrib__num__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Vertice__attrib__out__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) + # local_parse_line_at_Parse_v_0 = 0 + li $t0, 0 + sw $t0, -4($fp) # LOCAL local_parse_line_at_Parse_internal_3 --> -16($fp) # local_parse_line_at_Parse_internal_3 = ALLOCATE Vertice # Allocating 20 bytes of memory diff --git a/tests/codegen/hairyscary.mips b/tests/codegen/hairyscary.mips index c1e2441e..65f71ab2 100644 --- a/tests/codegen/hairyscary.mips +++ b/tests/codegen/hairyscary.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:20 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:50 2020 # School of Math and Computer Science, University of Havana # @@ -468,7 +468,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -1311,7 +1311,7 @@ __Bazz__attrib__g__init: # local_ttrib__g__init_internal_5 = 13 li $t0, 13 sw $t0, -24($fp) - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Bazz @@ -1333,7 +1333,7 @@ __Bazz__attrib__g__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min0_1: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -1355,7 +1355,7 @@ __Bazz__attrib__g__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min1_2: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Foo @@ -1377,7 +1377,7 @@ __Bazz__attrib__g__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min2_3: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -1415,7 +1415,7 @@ __Bazz__attrib__g__init: # IF_ZERO local_ttrib__g__init_internal_3 GOTO label_ERROR_5 lw $t0, -16($fp) beq $t0, 0, label_ERROR_5 - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Bazz @@ -1522,7 +1522,7 @@ __Bazz__attrib__g__init: # GOTO label_END_6 j label_END_6 label_NEXT0_7: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -1661,7 +1661,7 @@ label_NEXT0_7: # GOTO label_END_6 j label_END_6 label_NEXT1_8: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Foo @@ -1784,7 +1784,7 @@ label_NEXT1_8: # GOTO label_END_6 j label_END_6 label_NEXT2_9: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -2142,7 +2142,7 @@ __Foo__attrib__a__init: # local_trib__a__init_internal_5 = 13 li $t0, 13 sw $t0, -24($fp) - # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz + # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -2164,7 +2164,7 @@ __Foo__attrib__a__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min0_11: - # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo + # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Foo @@ -2186,7 +2186,7 @@ __Foo__attrib__a__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min1_12: - # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar + # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -2224,7 +2224,7 @@ __Foo__attrib__a__init: # IF_ZERO local_trib__a__init_internal_3 GOTO label_ERROR_14 lw $t0, -16($fp) beq $t0, 0, label_ERROR_14 - # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz + # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -2363,7 +2363,7 @@ __Foo__attrib__a__init: # GOTO label_END_15 j label_END_15 label_NEXT0_16: - # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo + # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Foo @@ -2486,7 +2486,7 @@ label_NEXT0_16: # GOTO label_END_15 j label_END_15 label_NEXT1_17: - # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar + # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -2954,7 +2954,7 @@ __Razz__attrib__e__init: # local_ttrib__e__init_internal_5 = 13 li $t0, 13 sw $t0, -24($fp) - # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -2976,7 +2976,7 @@ __Razz__attrib__e__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min0_19: - # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -3014,7 +3014,7 @@ __Razz__attrib__e__init: # IF_ZERO local_ttrib__e__init_internal_3 GOTO label_ERROR_21 lw $t0, -16($fp) beq $t0, 0, label_ERROR_21 - # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -3153,7 +3153,7 @@ __Razz__attrib__e__init: # GOTO label_END_22 j label_END_22 label_NEXT0_23: - # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips index 1bb3ccc3..a11c9bc5 100644 --- a/tests/codegen/hello_world.mips +++ b/tests/codegen/hello_world.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:20 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:50 2020 # School of Math and Computer Science, University of Havana # @@ -400,7 +400,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips index 668ac22a..50424ab1 100644 --- a/tests/codegen/io.mips +++ b/tests/codegen/io.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:22 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:51 2020 # School of Math and Computer Science, University of Havana # @@ -484,7 +484,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/life.mips b/tests/codegen/life.mips deleted file mode 100644 index ef8bbf4b..00000000 --- a/tests/codegen/life.mips +++ /dev/null @@ -1,8661 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Sun Dec 6 22:31:43 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Board: .asciiz "Board" -# Function END -CellularAutomaton: .asciiz "CellularAutomaton" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Board **** -Board_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_size_of_board_at_Board, function_board_init_at_Board -# Function END -# - - -# **** Type RECORD for type Board **** -Board_start: - Board_vtable_pointer: .word Board_vtable - # Function END -Board_end: -# - - -# **** VTABLE for type CellularAutomaton **** -CellularAutomaton_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_size_of_board_at_Board, function_board_init_at_Board, function_init_at_CellularAutomaton, function_print_at_CellularAutomaton, function_num_cells_at_CellularAutomaton, function_cell_at_CellularAutomaton, function_north_at_CellularAutomaton, function_south_at_CellularAutomaton, function_east_at_CellularAutomaton, function_west_at_CellularAutomaton, function_northwest_at_CellularAutomaton, function_northeast_at_CellularAutomaton, function_southeast_at_CellularAutomaton, function_southwest_at_CellularAutomaton, function_neighbors_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_evolve_at_CellularAutomaton, function_option_at_CellularAutomaton, function_prompt_at_CellularAutomaton, function_prompt2_at_CellularAutomaton -# Function END -# - - -# **** Type RECORD for type CellularAutomaton **** -CellularAutomaton_start: - CellularAutomaton_vtable_pointer: .word CellularAutomaton_vtable - # Function END -CellularAutomaton_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_size_of_board_at_Board, function_board_init_at_Board, function_init_at_CellularAutomaton, function_print_at_CellularAutomaton, function_num_cells_at_CellularAutomaton, function_cell_at_CellularAutomaton, function_north_at_CellularAutomaton, function_south_at_CellularAutomaton, function_east_at_CellularAutomaton, function_west_at_CellularAutomaton, function_northwest_at_CellularAutomaton, function_northeast_at_CellularAutomaton, function_southeast_at_CellularAutomaton, function_southwest_at_CellularAutomaton, function_neighbors_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_evolve_at_CellularAutomaton, function_option_at_CellularAutomaton, function_prompt_at_CellularAutomaton, function_prompt2_at_CellularAutomaton, function_main_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, 1, 2, 3 -Object__TDT: .word 1, 0, 1, 1, 2, 3, 4 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 -Board__TDT: .word -1, -1, -1, -1, 0, 1, 2 -CellularAutomaton__TDT: .word -1, -1, -1, -1, -1, 0, 1 -Main__TDT: .word -1, -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz "\n" -# - - -data_5: .asciiz "\n" -# - - -data_6: .asciiz "\n" -# - - -data_7: .asciiz " " -# - - -data_8: .asciiz " " -# - - -data_9: .asciiz " " -# - - -data_10: .asciiz " " -# - - -data_11: .asciiz " " -# - - -data_12: .asciiz " " -# - - -data_13: .asciiz " " -# - - -data_14: .asciiz " " -# - - -data_15: .asciiz " " -# - - -data_16: .asciiz " " -# - - -data_17: .asciiz " " -# - - -data_18: .asciiz " " -# - - -data_19: .asciiz " " -# - - -data_20: .asciiz " " -# - - -data_21: .asciiz "X" -# - - -data_22: .asciiz "X" -# - - -data_23: .asciiz "X" -# - - -data_24: .asciiz "X" -# - - -data_25: .asciiz "X" -# - - -data_26: .asciiz "X" -# - - -data_27: .asciiz "X" -# - - -data_28: .asciiz "X" -# - - -data_29: .asciiz "X" -# - - -data_30: .asciiz "X" -# - - -data_31: .asciiz "X" -# - - -data_32: .asciiz "-" -# - - -data_33: .asciiz "-" -# - - -data_34: .asciiz "\nPlease chose a number:\n" -# - - -data_35: .asciiz "\t1: A cross\n" -# - - -data_36: .asciiz "\t2: A slash from the upper left to lower right\n" -# - - -data_37: .asciiz "\t3: A slash from the upper right to lower left\n" -# - - -data_38: .asciiz "\t4: An X\n" -# - - -data_39: .asciiz "\t5: A greater than sign \n" -# - - -data_40: .asciiz "\t6: A less than sign\n" -# - - -data_41: .asciiz "\t7: Two greater than signs\n" -# - - -data_42: .asciiz "\t8: Two less than signs\n" -# - - -data_43: .asciiz "\t9: A 'V'\n" -# - - -data_44: .asciiz "\t10: An inverse 'V'\n" -# - - -data_45: .asciiz "\t11: Numbers 9 and 10 combined\n" -# - - -data_46: .asciiz "\t12: A full grid\n" -# - - -data_47: .asciiz "\t13: A 'T'\n" -# - - -data_48: .asciiz "\t14: A plus '+'\n" -# - - -data_49: .asciiz "\t15: A 'W'\n" -# - - -data_50: .asciiz "\t16: An 'M'\n" -# - - -data_51: .asciiz "\t17: An 'E'\n" -# - - -data_52: .asciiz "\t18: A '3'\n" -# - - -data_53: .asciiz "\t19: An 'O'\n" -# - - -data_54: .asciiz "\t20: An '8'\n" -# - - -data_55: .asciiz "\t21: An 'S'\n" -# - - -data_56: .asciiz "Your choice => " -# - - -data_57: .asciiz "\n" -# - - -data_58: .asciiz " XX XXXX XXXX XX " -# - - -data_59: .asciiz " X X X X X " -# - - -data_60: .asciiz "X X X X X" -# - - -data_61: .asciiz "X X X X X X X X X" -# - - -data_62: .asciiz "X X X X X " -# - - -data_63: .asciiz " X X X X X" -# - - -data_64: .asciiz "X X X XX X " -# - - -data_65: .asciiz " X XX X X X " -# - - -data_66: .asciiz "X X X X X " -# - - -data_67: .asciiz " X X X X X" -# - - -data_68: .asciiz "X X X X X X X X" -# - - -data_69: .asciiz "XXXXXXXXXXXXXXXXXXXXXXXXX" -# - - -data_70: .asciiz "XXXXX X X X X " -# - - -data_71: .asciiz " X X XXXXX X X " -# - - -data_72: .asciiz "X X X X X X X " -# - - -data_73: .asciiz " X X X X X X X" -# - - -data_74: .asciiz "XXXXX X XXXXX X XXXX" -# - - -data_75: .asciiz "XXX X X X X XXXX " -# - - -data_76: .asciiz " XX X XX X XX " -# - - -data_77: .asciiz " XX X XX X XX X XX X XX " -# - - -data_78: .asciiz " XXXX X XX X XXXX " -# - - -data_79: .asciiz " " -# - - -data_80: .asciiz "Would you like to continue with the next generation? \n" -# - - -data_81: .asciiz "Please use lowercase y or n for your answer [y]: " -# - - -data_82: .asciiz "\n" -# - - -data_83: .asciiz "n" -# - - -data_84: .asciiz "\n\n" -# - - -data_85: .asciiz "Would you like to choose a background pattern? \n" -# - - -data_86: .asciiz "Please use lowercase y or n for your answer [n]: " -# - - -data_87: .asciiz "y" -# - - -data_88: .asciiz "Welcome to the Game of Life.\n" -# - - -data_89: .asciiz "There are many initial states to choose from. \n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $a0, 0($fp) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_length_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 32 bytes of memory - li $a0, 32 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) - # Load type offset - li $t2, 24 - sw $t2, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Board__attrib__rows__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Board__attrib__columns__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Board__attrib__board_size__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __CellularAutomaton__attrib__population_map__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__cells__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t1, Main_vtable - # Get pointer to function address - lw $t2, 108($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Board__attrib__rows__init implementation. -# @Params: -__Board__attrib__rows__init: - # Allocate stack frame for function __Board__attrib__rows__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Board__attrib__rows__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Board__attrib__columns__init implementation. -# @Params: -__Board__attrib__columns__init: - # Allocate stack frame for function __Board__attrib__columns__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Board__attrib__columns__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Board__attrib__board_size__init implementation. -# @Params: -__Board__attrib__board_size__init: - # Allocate stack frame for function __Board__attrib__board_size__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Board__attrib__board_size__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_size_of_board_at_Board implementation. -# @Params: -# 0($fp) = param_size_of_board_at_Board_initial_0 -function_size_of_board_at_Board: - # Allocate stack frame for function function_size_of_board_at_Board. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_size_of_board_at_Board_internal_0 --> -4($fp) - # PARAM param_size_of_board_at_Board_initial_0 --> 0($fp) - # local_size_of_board_at_Board_internal_0 = PARAM param_size_of_board_at_Board_initial_0 - lw $t1, 0($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_size_of_board_at_Board_internal_0 --> -4($fp) - # LOCAL local_size_of_board_at_Board_internal_1 --> -8($fp) - # local_size_of_board_at_Board_internal_1 = VCALL local_size_of_board_at_Board_internal_0 length - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_size_of_board_at_Board_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_size_of_board_at_Board. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_board_init_at_Board implementation. -# @Params: -# 0($fp) = param_board_init_at_Board_start_0 -function_board_init_at_Board: - # Allocate stack frame for function function_board_init_at_Board. - subu $sp, $sp, 76 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 76 - # LOCAL local_board_init_at_Board_internal_3 --> -16($fp) - # local_board_init_at_Board_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_board_init_at_Board_internal_1 --> -8($fp) - # LOCAL local_board_init_at_Board_internal_3 --> -16($fp) - # local_board_init_at_Board_internal_1 = local_board_init_at_Board_internal_3 - lw $t1, -16($fp) - sw $t1, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_board_init_at_Board_start_0 - # PARAM param_board_init_at_Board_start_0 --> 0($fp) - lw $t1, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_board_init_at_Board_internal_1 --> -8($fp) - # LOCAL local_board_init_at_Board_internal_2 --> -12($fp) - # local_board_init_at_Board_internal_2 = VCALL local_board_init_at_Board_internal_1 size_of_board - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 28($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_2 --> -12($fp) - # local_board_init_at_Board_size_0 = local_board_init_at_Board_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # LOCAL local_board_init_at_Board_internal_5 --> -24($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # local_board_init_at_Board_internal_5 = local_board_init_at_Board_size_0 - 15 - lw $t1, -4($fp) - sub $t1, $t1, 15 - sw $t1, -24($fp) - # IF_ZERO local_board_init_at_Board_internal_5 GOTO label_TRUE_3 - # IF_ZERO local_board_init_at_Board_internal_5 GOTO label_TRUE_3 - lw $t1, -24($fp) - beq $t1, 0, label_TRUE_3 - # LOCAL local_board_init_at_Board_internal_5 --> -24($fp) - # local_board_init_at_Board_internal_5 = 0 - li $t1, 0 - sw $t1, -24($fp) - # GOTO label_END_4 -j label_END_4 -label_TRUE_3: - # LOCAL local_board_init_at_Board_internal_5 --> -24($fp) - # local_board_init_at_Board_internal_5 = 1 - li $t1, 1 - sw $t1, -24($fp) - label_END_4: -# IF_ZERO local_board_init_at_Board_internal_5 GOTO label_FALSEIF_1 -# IF_ZERO local_board_init_at_Board_internal_5 GOTO label_FALSEIF_1 -lw $t1, -24($fp) -beq $t1, 0, label_FALSEIF_1 -# -li $t1, 3 -sw $t1, 12($s1) -# -li $t1, 5 -sw $t1, 16($s1) -# -# LOCAL local_board_init_at_Board_size_0 --> -4($fp) -lw $t1, -4($fp) -sw $t1, 20($s1) -# LOCAL local_board_init_at_Board_internal_4 --> -20($fp) -# local_board_init_at_Board_internal_4 = -# GOTO label_ENDIF_2 -j label_ENDIF_2 -label_FALSEIF_1: - # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # local_board_init_at_Board_internal_7 = local_board_init_at_Board_size_0 - 16 - lw $t1, -4($fp) - sub $t1, $t1, 16 - sw $t1, -32($fp) - # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_7 - # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_7 - lw $t1, -32($fp) - beq $t1, 0, label_TRUE_7 - # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) - # local_board_init_at_Board_internal_7 = 0 - li $t1, 0 - sw $t1, -32($fp) - # GOTO label_END_8 -j label_END_8 -label_TRUE_7: - # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) - # local_board_init_at_Board_internal_7 = 1 - li $t1, 1 - sw $t1, -32($fp) - label_END_8: -# IF_ZERO local_board_init_at_Board_internal_7 GOTO label_FALSEIF_5 -# IF_ZERO local_board_init_at_Board_internal_7 GOTO label_FALSEIF_5 -lw $t1, -32($fp) -beq $t1, 0, label_FALSEIF_5 -# -li $t1, 4 -sw $t1, 12($s1) -# -li $t1, 4 -sw $t1, 16($s1) -# -# LOCAL local_board_init_at_Board_size_0 --> -4($fp) -lw $t1, -4($fp) -sw $t1, 20($s1) -# LOCAL local_board_init_at_Board_internal_6 --> -28($fp) -# local_board_init_at_Board_internal_6 = -# GOTO label_ENDIF_6 -j label_ENDIF_6 -label_FALSEIF_5: - # LOCAL local_board_init_at_Board_internal_9 --> -40($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # local_board_init_at_Board_internal_9 = local_board_init_at_Board_size_0 - 20 - lw $t1, -4($fp) - sub $t1, $t1, 20 - sw $t1, -40($fp) - # IF_ZERO local_board_init_at_Board_internal_9 GOTO label_TRUE_11 - # IF_ZERO local_board_init_at_Board_internal_9 GOTO label_TRUE_11 - lw $t1, -40($fp) - beq $t1, 0, label_TRUE_11 - # LOCAL local_board_init_at_Board_internal_9 --> -40($fp) - # local_board_init_at_Board_internal_9 = 0 - li $t1, 0 - sw $t1, -40($fp) - # GOTO label_END_12 -j label_END_12 -label_TRUE_11: - # LOCAL local_board_init_at_Board_internal_9 --> -40($fp) - # local_board_init_at_Board_internal_9 = 1 - li $t1, 1 - sw $t1, -40($fp) - label_END_12: -# IF_ZERO local_board_init_at_Board_internal_9 GOTO label_FALSEIF_9 -# IF_ZERO local_board_init_at_Board_internal_9 GOTO label_FALSEIF_9 -lw $t1, -40($fp) -beq $t1, 0, label_FALSEIF_9 -# -li $t1, 4 -sw $t1, 12($s1) -# -li $t1, 5 -sw $t1, 16($s1) -# -# LOCAL local_board_init_at_Board_size_0 --> -4($fp) -lw $t1, -4($fp) -sw $t1, 20($s1) -# LOCAL local_board_init_at_Board_internal_8 --> -36($fp) -# local_board_init_at_Board_internal_8 = -# GOTO label_ENDIF_10 -j label_ENDIF_10 -label_FALSEIF_9: - # LOCAL local_board_init_at_Board_internal_11 --> -48($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # local_board_init_at_Board_internal_11 = local_board_init_at_Board_size_0 - 21 - lw $t1, -4($fp) - sub $t1, $t1, 21 - sw $t1, -48($fp) - # IF_ZERO local_board_init_at_Board_internal_11 GOTO label_TRUE_15 - # IF_ZERO local_board_init_at_Board_internal_11 GOTO label_TRUE_15 - lw $t1, -48($fp) - beq $t1, 0, label_TRUE_15 - # LOCAL local_board_init_at_Board_internal_11 --> -48($fp) - # local_board_init_at_Board_internal_11 = 0 - li $t1, 0 - sw $t1, -48($fp) - # GOTO label_END_16 -j label_END_16 -label_TRUE_15: - # LOCAL local_board_init_at_Board_internal_11 --> -48($fp) - # local_board_init_at_Board_internal_11 = 1 - li $t1, 1 - sw $t1, -48($fp) - label_END_16: -# IF_ZERO local_board_init_at_Board_internal_11 GOTO label_FALSEIF_13 -# IF_ZERO local_board_init_at_Board_internal_11 GOTO label_FALSEIF_13 -lw $t1, -48($fp) -beq $t1, 0, label_FALSEIF_13 -# -li $t1, 3 -sw $t1, 12($s1) -# -li $t1, 7 -sw $t1, 16($s1) -# -# LOCAL local_board_init_at_Board_size_0 --> -4($fp) -lw $t1, -4($fp) -sw $t1, 20($s1) -# LOCAL local_board_init_at_Board_internal_10 --> -44($fp) -# local_board_init_at_Board_internal_10 = -# GOTO label_ENDIF_14 -j label_ENDIF_14 -label_FALSEIF_13: - # LOCAL local_board_init_at_Board_internal_13 --> -56($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # local_board_init_at_Board_internal_13 = local_board_init_at_Board_size_0 - 25 - lw $t1, -4($fp) - sub $t1, $t1, 25 - sw $t1, -56($fp) - # IF_ZERO local_board_init_at_Board_internal_13 GOTO label_TRUE_19 - # IF_ZERO local_board_init_at_Board_internal_13 GOTO label_TRUE_19 - lw $t1, -56($fp) - beq $t1, 0, label_TRUE_19 - # LOCAL local_board_init_at_Board_internal_13 --> -56($fp) - # local_board_init_at_Board_internal_13 = 0 - li $t1, 0 - sw $t1, -56($fp) - # GOTO label_END_20 -j label_END_20 -label_TRUE_19: - # LOCAL local_board_init_at_Board_internal_13 --> -56($fp) - # local_board_init_at_Board_internal_13 = 1 - li $t1, 1 - sw $t1, -56($fp) - label_END_20: -# IF_ZERO local_board_init_at_Board_internal_13 GOTO label_FALSEIF_17 -# IF_ZERO local_board_init_at_Board_internal_13 GOTO label_FALSEIF_17 -lw $t1, -56($fp) -beq $t1, 0, label_FALSEIF_17 -# -li $t1, 5 -sw $t1, 12($s1) -# -li $t1, 5 -sw $t1, 16($s1) -# -# LOCAL local_board_init_at_Board_size_0 --> -4($fp) -lw $t1, -4($fp) -sw $t1, 20($s1) -# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) -# local_board_init_at_Board_internal_12 = -# GOTO label_ENDIF_18 -j label_ENDIF_18 -label_FALSEIF_17: - # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # local_board_init_at_Board_internal_15 = local_board_init_at_Board_size_0 - 28 - lw $t1, -4($fp) - sub $t1, $t1, 28 - sw $t1, -64($fp) - # IF_ZERO local_board_init_at_Board_internal_15 GOTO label_TRUE_23 - # IF_ZERO local_board_init_at_Board_internal_15 GOTO label_TRUE_23 - lw $t1, -64($fp) - beq $t1, 0, label_TRUE_23 - # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) - # local_board_init_at_Board_internal_15 = 0 - li $t1, 0 - sw $t1, -64($fp) - # GOTO label_END_24 -j label_END_24 -label_TRUE_23: - # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) - # local_board_init_at_Board_internal_15 = 1 - li $t1, 1 - sw $t1, -64($fp) - label_END_24: -# IF_ZERO local_board_init_at_Board_internal_15 GOTO label_FALSEIF_21 -# IF_ZERO local_board_init_at_Board_internal_15 GOTO label_FALSEIF_21 -lw $t1, -64($fp) -beq $t1, 0, label_FALSEIF_21 -# -li $t1, 7 -sw $t1, 12($s1) -# -li $t1, 4 -sw $t1, 16($s1) -# -# LOCAL local_board_init_at_Board_size_0 --> -4($fp) -lw $t1, -4($fp) -sw $t1, 20($s1) -# LOCAL local_board_init_at_Board_internal_14 --> -60($fp) -# local_board_init_at_Board_internal_14 = -# GOTO label_ENDIF_22 -j label_ENDIF_22 -label_FALSEIF_21: - # - li $t1, 5 - sw $t1, 12($s1) - # - li $t1, 5 - sw $t1, 16($s1) - # - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - lw $t1, -4($fp) - sw $t1, 20($s1) - # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) - # local_board_init_at_Board_internal_14 = - label_ENDIF_22: -# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) -# LOCAL local_board_init_at_Board_internal_14 --> -60($fp) -# local_board_init_at_Board_internal_12 = local_board_init_at_Board_internal_14 -lw $t1, -60($fp) -sw $t1, -52($fp) -label_ENDIF_18: -# LOCAL local_board_init_at_Board_internal_10 --> -44($fp) -# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) -# local_board_init_at_Board_internal_10 = local_board_init_at_Board_internal_12 -lw $t1, -52($fp) -sw $t1, -44($fp) -label_ENDIF_14: -# LOCAL local_board_init_at_Board_internal_8 --> -36($fp) -# LOCAL local_board_init_at_Board_internal_10 --> -44($fp) -# local_board_init_at_Board_internal_8 = local_board_init_at_Board_internal_10 -lw $t1, -44($fp) -sw $t1, -36($fp) -label_ENDIF_10: -# LOCAL local_board_init_at_Board_internal_6 --> -28($fp) -# LOCAL local_board_init_at_Board_internal_8 --> -36($fp) -# local_board_init_at_Board_internal_6 = local_board_init_at_Board_internal_8 -lw $t1, -36($fp) -sw $t1, -28($fp) -label_ENDIF_6: -# LOCAL local_board_init_at_Board_internal_4 --> -20($fp) -# LOCAL local_board_init_at_Board_internal_6 --> -28($fp) -# local_board_init_at_Board_internal_4 = local_board_init_at_Board_internal_6 -lw $t1, -28($fp) -sw $t1, -20($fp) -label_ENDIF_2: -# LOCAL local_board_init_at_Board_internal_16 --> -68($fp) -# local_board_init_at_Board_internal_16 = SELF -sw $s1, -68($fp) -# RETURN local_board_init_at_Board_internal_16 -lw $v0, -68($fp) -# Deallocate stack frame for function function_board_init_at_Board. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 76 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# __CellularAutomaton__attrib__population_map__init implementation. -# @Params: -__CellularAutomaton__attrib__population_map__init: - # Allocate stack frame for function __CellularAutomaton__attrib__population_map__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_rAutomaton__attrib__population_map__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_0 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -4($fp) - # RETURN local_rAutomaton__attrib__population_map__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __CellularAutomaton__attrib__population_map__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_init_at_CellularAutomaton_map_0 -function_init_at_CellularAutomaton: - # Allocate stack frame for function function_init_at_CellularAutomaton. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_CellularAutomaton_map_0 --> 0($fp) - lw $t1, 0($fp) - sw $t1, 24($s1) - # LOCAL local_init_at_CellularAutomaton_internal_2 --> -12($fp) - # local_init_at_CellularAutomaton_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_init_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_init_at_CellularAutomaton_internal_2 --> -12($fp) - # local_init_at_CellularAutomaton_internal_0 = local_init_at_CellularAutomaton_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_init_at_CellularAutomaton_map_0 - # PARAM param_init_at_CellularAutomaton_map_0 --> 0($fp) - lw $t1, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_init_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_init_at_CellularAutomaton_internal_1 --> -8($fp) - # local_init_at_CellularAutomaton_internal_1 = VCALL local_init_at_CellularAutomaton_internal_0 board_init - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 32($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_init_at_CellularAutomaton_internal_3 --> -16($fp) - # local_init_at_CellularAutomaton_internal_3 = SELF - sw $s1, -16($fp) - # RETURN local_init_at_CellularAutomaton_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_init_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_print_at_CellularAutomaton implementation. -# @Params: -function_print_at_CellularAutomaton: - # Allocate stack frame for function function_print_at_CellularAutomaton. - subu $sp, $sp, 112 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 112 - # LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) - # local_print_at_CellularAutomaton_i_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # local_print_at_CellularAutomaton_internal_2 = GETATTRIBUTE board_size CellularAutomaton - # LOCAL local_print_at_CellularAutomaton_internal_2 --> -12($fp) - lw $t1, 20($s1) - sw $t1, -12($fp) - # LOCAL local_print_at_CellularAutomaton_num_1 --> -8($fp) - # LOCAL local_print_at_CellularAutomaton_internal_2 --> -12($fp) - # local_print_at_CellularAutomaton_num_1 = local_print_at_CellularAutomaton_internal_2 - lw $t1, -12($fp) - sw $t1, -8($fp) - # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) - # local_print_at_CellularAutomaton_internal_5 = SELF - sw $s1, -24($fp) - # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) - # local_print_at_CellularAutomaton_internal_3 = local_print_at_CellularAutomaton_internal_5 - lw $t1, -24($fp) - sw $t1, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_4 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -28($fp) - # ARG local_print_at_CellularAutomaton_internal_6 - # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) - lw $t1, -28($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_print_at_CellularAutomaton_internal_4 --> -20($fp) - # local_print_at_CellularAutomaton_internal_4 = VCALL local_print_at_CellularAutomaton_internal_3 out_string - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - label_WHILE_25: - # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) - # LOCAL local_print_at_CellularAutomaton_num_1 --> -8($fp) - # local_print_at_CellularAutomaton_internal_7 = local_print_at_CellularAutomaton_i_0 - local_print_at_CellularAutomaton_num_1 - lw $t1, -4($fp) - lw $t2, -8($fp) - sub $t1, $t1, $t2 - sw $t1, -32($fp) - # IF_GREATER_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_FALSE_27 - # IF_GREATER_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_FALSE_27 - lw $t1, -32($fp) - bgt $t1, 0, label_FALSE_27 - # IF_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_FALSE_27 - # IF_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_FALSE_27 - lw $t1, -32($fp) - beq $t1, 0, label_FALSE_27 - # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) - # local_print_at_CellularAutomaton_internal_7 = 1 - li $t1, 1 - sw $t1, -32($fp) - # GOTO label_END_28 -j label_END_28 -label_FALSE_27: - # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) - # local_print_at_CellularAutomaton_internal_7 = 0 - li $t1, 0 - sw $t1, -32($fp) - label_END_28: -# IF_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_WHILE_END_26 -# IF_ZERO local_print_at_CellularAutomaton_internal_7 GOTO label_WHILE_END_26 -lw $t1, -32($fp) -beq $t1, 0, label_WHILE_END_26 -# LOCAL local_print_at_CellularAutomaton_internal_10 --> -44($fp) -# local_print_at_CellularAutomaton_internal_10 = SELF -sw $s1, -44($fp) -# LOCAL local_print_at_CellularAutomaton_internal_8 --> -36($fp) -# LOCAL local_print_at_CellularAutomaton_internal_10 --> -44($fp) -# local_print_at_CellularAutomaton_internal_8 = local_print_at_CellularAutomaton_internal_10 -lw $t1, -44($fp) -sw $t1, -36($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_print_at_CellularAutomaton_internal_13 = GETATTRIBUTE population_map CellularAutomaton -# LOCAL local_print_at_CellularAutomaton_internal_13 --> -56($fp) -lw $t1, 24($s1) -sw $t1, -56($fp) -# LOCAL local_print_at_CellularAutomaton_internal_11 --> -48($fp) -# LOCAL local_print_at_CellularAutomaton_internal_13 --> -56($fp) -# local_print_at_CellularAutomaton_internal_11 = local_print_at_CellularAutomaton_internal_13 -lw $t1, -56($fp) -sw $t1, -48($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_print_at_CellularAutomaton_i_0 -# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) -lw $t1, -4($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# local_print_at_CellularAutomaton_internal_14 = GETATTRIBUTE columns CellularAutomaton -# LOCAL local_print_at_CellularAutomaton_internal_14 --> -60($fp) -lw $t1, 16($s1) -sw $t1, -60($fp) -# ARG local_print_at_CellularAutomaton_internal_14 -# LOCAL local_print_at_CellularAutomaton_internal_14 --> -60($fp) -lw $t1, -60($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_print_at_CellularAutomaton_internal_11 --> -48($fp) -# LOCAL local_print_at_CellularAutomaton_internal_12 --> -52($fp) -# local_print_at_CellularAutomaton_internal_12 = VCALL local_print_at_CellularAutomaton_internal_11 substr -# Save new self pointer in $s1 -lw $s1, -48($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 16($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -52($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_print_at_CellularAutomaton_internal_12 -# LOCAL local_print_at_CellularAutomaton_internal_12 --> -52($fp) -lw $t1, -52($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_print_at_CellularAutomaton_internal_8 --> -36($fp) -# LOCAL local_print_at_CellularAutomaton_internal_9 --> -40($fp) -# local_print_at_CellularAutomaton_internal_9 = VCALL local_print_at_CellularAutomaton_internal_8 out_string -# Save new self pointer in $s1 -lw $s1, -36($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 12($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -40($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_print_at_CellularAutomaton_internal_17 --> -72($fp) -# local_print_at_CellularAutomaton_internal_17 = SELF -sw $s1, -72($fp) -# LOCAL local_print_at_CellularAutomaton_internal_15 --> -64($fp) -# LOCAL local_print_at_CellularAutomaton_internal_17 --> -72($fp) -# local_print_at_CellularAutomaton_internal_15 = local_print_at_CellularAutomaton_internal_17 -lw $t1, -72($fp) -sw $t1, -64($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_print_at_CellularAutomaton_internal_18 --> -76($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_5 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -76($fp) -# ARG local_print_at_CellularAutomaton_internal_18 -# LOCAL local_print_at_CellularAutomaton_internal_18 --> -76($fp) -lw $t1, -76($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_print_at_CellularAutomaton_internal_15 --> -64($fp) -# LOCAL local_print_at_CellularAutomaton_internal_16 --> -68($fp) -# local_print_at_CellularAutomaton_internal_16 = VCALL local_print_at_CellularAutomaton_internal_15 out_string -# Save new self pointer in $s1 -lw $s1, -64($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 12($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -68($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# local_print_at_CellularAutomaton_internal_20 = GETATTRIBUTE columns CellularAutomaton -# LOCAL local_print_at_CellularAutomaton_internal_20 --> -84($fp) -lw $t1, 16($s1) -sw $t1, -84($fp) -# LOCAL local_print_at_CellularAutomaton_internal_19 --> -80($fp) -# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) -# LOCAL local_print_at_CellularAutomaton_internal_20 --> -84($fp) -# local_print_at_CellularAutomaton_internal_19 = local_print_at_CellularAutomaton_i_0 + local_print_at_CellularAutomaton_internal_20 -lw $t1, -4($fp) -lw $t2, -84($fp) -add $t1, $t1, $t2 -sw $t1, -80($fp) -# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) -# LOCAL local_print_at_CellularAutomaton_internal_19 --> -80($fp) -# local_print_at_CellularAutomaton_i_0 = local_print_at_CellularAutomaton_internal_19 -lw $t1, -80($fp) -sw $t1, -4($fp) -# GOTO label_WHILE_25 -j label_WHILE_25 -label_WHILE_END_26: - # LOCAL local_print_at_CellularAutomaton_internal_23 --> -96($fp) - # local_print_at_CellularAutomaton_internal_23 = SELF - sw $s1, -96($fp) - # LOCAL local_print_at_CellularAutomaton_internal_21 --> -88($fp) - # LOCAL local_print_at_CellularAutomaton_internal_23 --> -96($fp) - # local_print_at_CellularAutomaton_internal_21 = local_print_at_CellularAutomaton_internal_23 - lw $t1, -96($fp) - sw $t1, -88($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_CellularAutomaton_internal_24 --> -100($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_6 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -100($fp) - # ARG local_print_at_CellularAutomaton_internal_24 - # LOCAL local_print_at_CellularAutomaton_internal_24 --> -100($fp) - lw $t1, -100($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_print_at_CellularAutomaton_internal_21 --> -88($fp) - # LOCAL local_print_at_CellularAutomaton_internal_22 --> -92($fp) - # local_print_at_CellularAutomaton_internal_22 = VCALL local_print_at_CellularAutomaton_internal_21 out_string - # Save new self pointer in $s1 - lw $s1, -88($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -92($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_CellularAutomaton_internal_25 --> -104($fp) - # local_print_at_CellularAutomaton_internal_25 = SELF - sw $s1, -104($fp) - # RETURN local_print_at_CellularAutomaton_internal_25 - lw $v0, -104($fp) - # Deallocate stack frame for function function_print_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 112 - jr $ra - # Function END - - -# function_num_cells_at_CellularAutomaton implementation. -# @Params: -function_num_cells_at_CellularAutomaton: - # Allocate stack frame for function function_num_cells_at_CellularAutomaton. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_num_cells_at_CellularAutomaton_internal_2 = GETATTRIBUTE population_map CellularAutomaton - # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) - lw $t1, 24($s1) - sw $t1, -12($fp) - # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) - # local_num_cells_at_CellularAutomaton_internal_0 = local_num_cells_at_CellularAutomaton_internal_2 - lw $t1, -12($fp) - sw $t1, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_num_cells_at_CellularAutomaton_internal_1 --> -8($fp) - # local_num_cells_at_CellularAutomaton_internal_1 = VCALL local_num_cells_at_CellularAutomaton_internal_0 length - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_num_cells_at_CellularAutomaton_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_num_cells_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cell_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_cell_at_CellularAutomaton_position_0 -function_cell_at_CellularAutomaton: - # Allocate stack frame for function function_cell_at_CellularAutomaton. - subu $sp, $sp, 40 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 40 - # local_cell_at_CellularAutomaton_internal_3 = GETATTRIBUTE board_size CellularAutomaton - # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) - lw $t1, 20($s1) - sw $t1, -16($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) - # local_cell_at_CellularAutomaton_internal_2 = local_cell_at_CellularAutomaton_internal_3 - 1 - lw $t1, -16($fp) - sub $t1, $t1, 1 - sw $t1, -12($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) - # PARAM param_cell_at_CellularAutomaton_position_0 --> 0($fp) - # local_cell_at_CellularAutomaton_internal_1 = local_cell_at_CellularAutomaton_internal_2 - PARAM param_cell_at_CellularAutomaton_position_0 - lw $t1, -12($fp) - lw $t2, 0($fp) - sub $t1, $t1, $t2 - sw $t1, -8($fp) - # IF_GREATER_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSE_31 - # IF_GREATER_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSE_31 - lw $t1, -8($fp) - bgt $t1, 0, label_FALSE_31 - # IF_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSE_31 - # IF_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSE_31 - lw $t1, -8($fp) - beq $t1, 0, label_FALSE_31 - # LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) - # local_cell_at_CellularAutomaton_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - # GOTO label_END_32 -j label_END_32 -label_FALSE_31: - # LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) - # local_cell_at_CellularAutomaton_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - label_END_32: -# IF_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_29 -# IF_ZERO local_cell_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_29 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_29 -# LOCAL local_cell_at_CellularAutomaton_internal_4 --> -20($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_7 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -20($fp) -# LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_cell_at_CellularAutomaton_internal_4 --> -20($fp) -# local_cell_at_CellularAutomaton_internal_0 = local_cell_at_CellularAutomaton_internal_4 -lw $t1, -20($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_30 -j label_ENDIF_30 -label_FALSEIF_29: - # local_cell_at_CellularAutomaton_internal_7 = GETATTRIBUTE population_map CellularAutomaton - # LOCAL local_cell_at_CellularAutomaton_internal_7 --> -32($fp) - lw $t1, 24($s1) - sw $t1, -32($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_7 --> -32($fp) - # local_cell_at_CellularAutomaton_internal_5 = local_cell_at_CellularAutomaton_internal_7 - lw $t1, -32($fp) - sw $t1, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cell_at_CellularAutomaton_position_0 - # PARAM param_cell_at_CellularAutomaton_position_0 --> 0($fp) - lw $t1, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # ARG 1 - li $t1, 1 - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_cell_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_6 --> -28($fp) - # local_cell_at_CellularAutomaton_internal_6 = VCALL local_cell_at_CellularAutomaton_internal_5 substr - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 16($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_6 --> -28($fp) - # local_cell_at_CellularAutomaton_internal_0 = local_cell_at_CellularAutomaton_internal_6 - lw $t1, -28($fp) - sw $t1, -4($fp) - label_ENDIF_30: -# RETURN local_cell_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_cell_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 40 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_north_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_north_at_CellularAutomaton_position_0 -function_north_at_CellularAutomaton: - # Allocate stack frame for function function_north_at_CellularAutomaton. - subu $sp, $sp, 48 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 48 - # local_north_at_CellularAutomaton_internal_3 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_north_at_CellularAutomaton_internal_3 --> -16($fp) - lw $t1, 16($s1) - sw $t1, -16($fp) - # LOCAL local_north_at_CellularAutomaton_internal_2 --> -12($fp) - # PARAM param_north_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_north_at_CellularAutomaton_internal_3 --> -16($fp) - # local_north_at_CellularAutomaton_internal_2 = PARAM param_north_at_CellularAutomaton_position_0 - local_north_at_CellularAutomaton_internal_3 - lw $t1, 0($fp) - lw $t2, -16($fp) - sub $t1, $t1, $t2 - sw $t1, -12($fp) - # LOCAL local_north_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_north_at_CellularAutomaton_internal_2 --> -12($fp) - # local_north_at_CellularAutomaton_internal_1 = local_north_at_CellularAutomaton_internal_2 - 0 - lw $t1, -12($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_GREATER_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSE_35 - # IF_GREATER_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSE_35 - lw $t1, -8($fp) - bgt $t1, 0, label_FALSE_35 - # IF_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSE_35 - # IF_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSE_35 - lw $t1, -8($fp) - beq $t1, 0, label_FALSE_35 - # LOCAL local_north_at_CellularAutomaton_internal_1 --> -8($fp) - # local_north_at_CellularAutomaton_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - # GOTO label_END_36 -j label_END_36 -label_FALSE_35: - # LOCAL local_north_at_CellularAutomaton_internal_1 --> -8($fp) - # local_north_at_CellularAutomaton_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - label_END_36: -# IF_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_33 -# IF_ZERO local_north_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_33 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_33 -# LOCAL local_north_at_CellularAutomaton_internal_4 --> -20($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_8 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -20($fp) -# LOCAL local_north_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_north_at_CellularAutomaton_internal_4 --> -20($fp) -# local_north_at_CellularAutomaton_internal_0 = local_north_at_CellularAutomaton_internal_4 -lw $t1, -20($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_34 -j label_ENDIF_34 -label_FALSEIF_33: - # LOCAL local_north_at_CellularAutomaton_internal_7 --> -32($fp) - # local_north_at_CellularAutomaton_internal_7 = SELF - sw $s1, -32($fp) - # LOCAL local_north_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_north_at_CellularAutomaton_internal_7 --> -32($fp) - # local_north_at_CellularAutomaton_internal_5 = local_north_at_CellularAutomaton_internal_7 - lw $t1, -32($fp) - sw $t1, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_north_at_CellularAutomaton_internal_9 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_north_at_CellularAutomaton_internal_9 --> -40($fp) - lw $t1, 16($s1) - sw $t1, -40($fp) - # LOCAL local_north_at_CellularAutomaton_internal_8 --> -36($fp) - # PARAM param_north_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_north_at_CellularAutomaton_internal_9 --> -40($fp) - # local_north_at_CellularAutomaton_internal_8 = PARAM param_north_at_CellularAutomaton_position_0 - local_north_at_CellularAutomaton_internal_9 - lw $t1, 0($fp) - lw $t2, -40($fp) - sub $t1, $t1, $t2 - sw $t1, -36($fp) - # ARG local_north_at_CellularAutomaton_internal_8 - # LOCAL local_north_at_CellularAutomaton_internal_8 --> -36($fp) - lw $t1, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_north_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_north_at_CellularAutomaton_internal_6 --> -28($fp) - # local_north_at_CellularAutomaton_internal_6 = VCALL local_north_at_CellularAutomaton_internal_5 cell - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 48($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_north_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_north_at_CellularAutomaton_internal_6 --> -28($fp) - # local_north_at_CellularAutomaton_internal_0 = local_north_at_CellularAutomaton_internal_6 - lw $t1, -28($fp) - sw $t1, -4($fp) - label_ENDIF_34: -# RETURN local_north_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_north_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 48 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_south_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_south_at_CellularAutomaton_position_0 -function_south_at_CellularAutomaton: - # Allocate stack frame for function function_south_at_CellularAutomaton. - subu $sp, $sp, 52 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 52 - # local_south_at_CellularAutomaton_internal_2 = GETATTRIBUTE board_size CellularAutomaton - # LOCAL local_south_at_CellularAutomaton_internal_2 --> -12($fp) - lw $t1, 20($s1) - sw $t1, -12($fp) - # local_south_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_south_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t1, 16($s1) - sw $t1, -20($fp) - # LOCAL local_south_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_south_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_south_at_CellularAutomaton_internal_4 --> -20($fp) - # local_south_at_CellularAutomaton_internal_3 = PARAM param_south_at_CellularAutomaton_position_0 + local_south_at_CellularAutomaton_internal_4 - lw $t1, 0($fp) - lw $t2, -20($fp) - add $t1, $t1, $t2 - sw $t1, -16($fp) - # LOCAL local_south_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_south_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_south_at_CellularAutomaton_internal_3 --> -16($fp) - # local_south_at_CellularAutomaton_internal_1 = local_south_at_CellularAutomaton_internal_2 - local_south_at_CellularAutomaton_internal_3 - lw $t1, -12($fp) - lw $t2, -16($fp) - sub $t1, $t1, $t2 - sw $t1, -8($fp) - # IF_GREATER_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSE_39 - # IF_GREATER_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSE_39 - lw $t1, -8($fp) - bgt $t1, 0, label_FALSE_39 - # IF_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSE_39 - # IF_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSE_39 - lw $t1, -8($fp) - beq $t1, 0, label_FALSE_39 - # LOCAL local_south_at_CellularAutomaton_internal_1 --> -8($fp) - # local_south_at_CellularAutomaton_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - # GOTO label_END_40 -j label_END_40 -label_FALSE_39: - # LOCAL local_south_at_CellularAutomaton_internal_1 --> -8($fp) - # local_south_at_CellularAutomaton_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - label_END_40: -# IF_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_37 -# IF_ZERO local_south_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_37 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_37 -# LOCAL local_south_at_CellularAutomaton_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_9 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -24($fp) -# LOCAL local_south_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_south_at_CellularAutomaton_internal_5 --> -24($fp) -# local_south_at_CellularAutomaton_internal_0 = local_south_at_CellularAutomaton_internal_5 -lw $t1, -24($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_38 -j label_ENDIF_38 -label_FALSEIF_37: - # LOCAL local_south_at_CellularAutomaton_internal_8 --> -36($fp) - # local_south_at_CellularAutomaton_internal_8 = SELF - sw $s1, -36($fp) - # LOCAL local_south_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_south_at_CellularAutomaton_internal_8 --> -36($fp) - # local_south_at_CellularAutomaton_internal_6 = local_south_at_CellularAutomaton_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_south_at_CellularAutomaton_internal_10 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_south_at_CellularAutomaton_internal_10 --> -44($fp) - lw $t1, 16($s1) - sw $t1, -44($fp) - # LOCAL local_south_at_CellularAutomaton_internal_9 --> -40($fp) - # PARAM param_south_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_south_at_CellularAutomaton_internal_10 --> -44($fp) - # local_south_at_CellularAutomaton_internal_9 = PARAM param_south_at_CellularAutomaton_position_0 + local_south_at_CellularAutomaton_internal_10 - lw $t1, 0($fp) - lw $t2, -44($fp) - add $t1, $t1, $t2 - sw $t1, -40($fp) - # ARG local_south_at_CellularAutomaton_internal_9 - # LOCAL local_south_at_CellularAutomaton_internal_9 --> -40($fp) - lw $t1, -40($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_south_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_south_at_CellularAutomaton_internal_7 --> -32($fp) - # local_south_at_CellularAutomaton_internal_7 = VCALL local_south_at_CellularAutomaton_internal_6 cell - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 48($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_south_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_south_at_CellularAutomaton_internal_7 --> -32($fp) - # local_south_at_CellularAutomaton_internal_0 = local_south_at_CellularAutomaton_internal_7 - lw $t1, -32($fp) - sw $t1, -4($fp) - label_ENDIF_38: -# RETURN local_south_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_south_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 52 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_east_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_east_at_CellularAutomaton_position_0 -function_east_at_CellularAutomaton: - # Allocate stack frame for function function_east_at_CellularAutomaton. - subu $sp, $sp, 60 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 60 - # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) - # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) - # local_east_at_CellularAutomaton_internal_4 = PARAM param_east_at_CellularAutomaton_position_0 + 1 - lw $t1, 0($fp) - add $t1, $t1, 1 - sw $t1, -20($fp) - # local_east_at_CellularAutomaton_internal_5 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_east_at_CellularAutomaton_internal_5 --> -24($fp) - lw $t1, 16($s1) - sw $t1, -24($fp) - # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_east_at_CellularAutomaton_internal_5 --> -24($fp) - # local_east_at_CellularAutomaton_internal_3 = local_east_at_CellularAutomaton_internal_4 / local_east_at_CellularAutomaton_internal_5 - lw $t1, -20($fp) - lw $t2, -24($fp) - div $t1, $t1, $t2 - sw $t1, -16($fp) - # local_east_at_CellularAutomaton_internal_6 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_east_at_CellularAutomaton_internal_6 --> -28($fp) - lw $t1, 16($s1) - sw $t1, -28($fp) - # LOCAL local_east_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_east_at_CellularAutomaton_internal_6 --> -28($fp) - # local_east_at_CellularAutomaton_internal_2 = local_east_at_CellularAutomaton_internal_3 * local_east_at_CellularAutomaton_internal_6 - lw $t1, -16($fp) - lw $t2, -28($fp) - mul $t1, $t1, $t2 - sw $t1, -12($fp) - # LOCAL local_east_at_CellularAutomaton_internal_7 --> -32($fp) - # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) - # local_east_at_CellularAutomaton_internal_7 = PARAM param_east_at_CellularAutomaton_position_0 + 1 - lw $t1, 0($fp) - add $t1, $t1, 1 - sw $t1, -32($fp) - # LOCAL local_east_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_east_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_east_at_CellularAutomaton_internal_7 --> -32($fp) - # local_east_at_CellularAutomaton_internal_1 = local_east_at_CellularAutomaton_internal_2 - local_east_at_CellularAutomaton_internal_7 - lw $t1, -12($fp) - lw $t2, -32($fp) - sub $t1, $t1, $t2 - sw $t1, -8($fp) - # IF_ZERO local_east_at_CellularAutomaton_internal_1 GOTO label_TRUE_43 - # IF_ZERO local_east_at_CellularAutomaton_internal_1 GOTO label_TRUE_43 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_43 - # LOCAL local_east_at_CellularAutomaton_internal_1 --> -8($fp) - # local_east_at_CellularAutomaton_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_44 -j label_END_44 -label_TRUE_43: - # LOCAL local_east_at_CellularAutomaton_internal_1 --> -8($fp) - # local_east_at_CellularAutomaton_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_44: -# IF_ZERO local_east_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_41 -# IF_ZERO local_east_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_41 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_41 -# LOCAL local_east_at_CellularAutomaton_internal_8 --> -36($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_10 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -36($fp) -# LOCAL local_east_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_east_at_CellularAutomaton_internal_8 --> -36($fp) -# local_east_at_CellularAutomaton_internal_0 = local_east_at_CellularAutomaton_internal_8 -lw $t1, -36($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_42 -j label_ENDIF_42 -label_FALSEIF_41: - # LOCAL local_east_at_CellularAutomaton_internal_11 --> -48($fp) - # local_east_at_CellularAutomaton_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_east_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_east_at_CellularAutomaton_internal_11 --> -48($fp) - # local_east_at_CellularAutomaton_internal_9 = local_east_at_CellularAutomaton_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_east_at_CellularAutomaton_internal_12 --> -52($fp) - # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) - # local_east_at_CellularAutomaton_internal_12 = PARAM param_east_at_CellularAutomaton_position_0 + 1 - lw $t1, 0($fp) - add $t1, $t1, 1 - sw $t1, -52($fp) - # ARG local_east_at_CellularAutomaton_internal_12 - # LOCAL local_east_at_CellularAutomaton_internal_12 --> -52($fp) - lw $t1, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_east_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) - # local_east_at_CellularAutomaton_internal_10 = VCALL local_east_at_CellularAutomaton_internal_9 cell - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 48($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_east_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) - # local_east_at_CellularAutomaton_internal_0 = local_east_at_CellularAutomaton_internal_10 - lw $t1, -44($fp) - sw $t1, -4($fp) - label_ENDIF_42: -# RETURN local_east_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_east_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 60 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_west_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_west_at_CellularAutomaton_position_0 -function_west_at_CellularAutomaton: - # Allocate stack frame for function function_west_at_CellularAutomaton. - subu $sp, $sp, 64 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 64 - # LOCAL local_west_at_CellularAutomaton_internal_1 --> -8($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - # local_west_at_CellularAutomaton_internal_1 = PARAM param_west_at_CellularAutomaton_position_0 - 0 - lw $t1, 0($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_ZERO local_west_at_CellularAutomaton_internal_1 GOTO label_TRUE_47 - # IF_ZERO local_west_at_CellularAutomaton_internal_1 GOTO label_TRUE_47 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_47 - # LOCAL local_west_at_CellularAutomaton_internal_1 --> -8($fp) - # local_west_at_CellularAutomaton_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_48 -j label_END_48 -label_TRUE_47: - # LOCAL local_west_at_CellularAutomaton_internal_1 --> -8($fp) - # local_west_at_CellularAutomaton_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_48: -# IF_ZERO local_west_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_45 -# IF_ZERO local_west_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_45 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_45 -# LOCAL local_west_at_CellularAutomaton_internal_2 --> -12($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_11 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -12($fp) -# LOCAL local_west_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_west_at_CellularAutomaton_internal_2 --> -12($fp) -# local_west_at_CellularAutomaton_internal_0 = local_west_at_CellularAutomaton_internal_2 -lw $t1, -12($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_46 -j label_ENDIF_46 -label_FALSEIF_45: - # local_west_at_CellularAutomaton_internal_7 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_west_at_CellularAutomaton_internal_7 --> -32($fp) - lw $t1, 16($s1) - sw $t1, -32($fp) - # LOCAL local_west_at_CellularAutomaton_internal_6 --> -28($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_west_at_CellularAutomaton_internal_7 --> -32($fp) - # local_west_at_CellularAutomaton_internal_6 = PARAM param_west_at_CellularAutomaton_position_0 / local_west_at_CellularAutomaton_internal_7 - lw $t1, 0($fp) - lw $t2, -32($fp) - div $t1, $t1, $t2 - sw $t1, -28($fp) - # local_west_at_CellularAutomaton_internal_8 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_west_at_CellularAutomaton_internal_8 --> -36($fp) - lw $t1, 16($s1) - sw $t1, -36($fp) - # LOCAL local_west_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_west_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_west_at_CellularAutomaton_internal_8 --> -36($fp) - # local_west_at_CellularAutomaton_internal_5 = local_west_at_CellularAutomaton_internal_6 * local_west_at_CellularAutomaton_internal_8 - lw $t1, -28($fp) - lw $t2, -36($fp) - mul $t1, $t1, $t2 - sw $t1, -24($fp) - # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_west_at_CellularAutomaton_internal_5 --> -24($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - # local_west_at_CellularAutomaton_internal_4 = local_west_at_CellularAutomaton_internal_5 - PARAM param_west_at_CellularAutomaton_position_0 - lw $t1, -24($fp) - lw $t2, 0($fp) - sub $t1, $t1, $t2 - sw $t1, -20($fp) - # IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_TRUE_51 - # IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_TRUE_51 - lw $t1, -20($fp) - beq $t1, 0, label_TRUE_51 - # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) - # local_west_at_CellularAutomaton_internal_4 = 0 - li $t1, 0 - sw $t1, -20($fp) - # GOTO label_END_52 -j label_END_52 -label_TRUE_51: - # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) - # local_west_at_CellularAutomaton_internal_4 = 1 - li $t1, 1 - sw $t1, -20($fp) - label_END_52: -# IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_FALSEIF_49 -# IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_FALSEIF_49 -lw $t1, -20($fp) -beq $t1, 0, label_FALSEIF_49 -# LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_12 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -40($fp) -# LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) -# LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) -# local_west_at_CellularAutomaton_internal_3 = local_west_at_CellularAutomaton_internal_9 -lw $t1, -40($fp) -sw $t1, -16($fp) -# GOTO label_ENDIF_50 -j label_ENDIF_50 -label_FALSEIF_49: - # LOCAL local_west_at_CellularAutomaton_internal_12 --> -52($fp) - # local_west_at_CellularAutomaton_internal_12 = SELF - sw $s1, -52($fp) - # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_west_at_CellularAutomaton_internal_12 --> -52($fp) - # local_west_at_CellularAutomaton_internal_10 = local_west_at_CellularAutomaton_internal_12 - lw $t1, -52($fp) - sw $t1, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_west_at_CellularAutomaton_internal_13 --> -56($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - # local_west_at_CellularAutomaton_internal_13 = PARAM param_west_at_CellularAutomaton_position_0 - 1 - lw $t1, 0($fp) - sub $t1, $t1, 1 - sw $t1, -56($fp) - # ARG local_west_at_CellularAutomaton_internal_13 - # LOCAL local_west_at_CellularAutomaton_internal_13 --> -56($fp) - lw $t1, -56($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_west_at_CellularAutomaton_internal_11 --> -48($fp) - # local_west_at_CellularAutomaton_internal_11 = VCALL local_west_at_CellularAutomaton_internal_10 cell - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 48($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_west_at_CellularAutomaton_internal_11 --> -48($fp) - # local_west_at_CellularAutomaton_internal_3 = local_west_at_CellularAutomaton_internal_11 - lw $t1, -48($fp) - sw $t1, -16($fp) - label_ENDIF_50: -# LOCAL local_west_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) -# local_west_at_CellularAutomaton_internal_0 = local_west_at_CellularAutomaton_internal_3 -lw $t1, -16($fp) -sw $t1, -4($fp) -label_ENDIF_46: -# RETURN local_west_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_west_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 64 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_northwest_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_northwest_at_CellularAutomaton_position_0 -function_northwest_at_CellularAutomaton: - # Allocate stack frame for function function_northwest_at_CellularAutomaton. - subu $sp, $sp, 72 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 72 - # local_northwest_at_CellularAutomaton_internal_3 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_northwest_at_CellularAutomaton_internal_3 --> -16($fp) - lw $t1, 16($s1) - sw $t1, -16($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_2 --> -12($fp) - # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_3 --> -16($fp) - # local_northwest_at_CellularAutomaton_internal_2 = PARAM param_northwest_at_CellularAutomaton_position_0 - local_northwest_at_CellularAutomaton_internal_3 - lw $t1, 0($fp) - lw $t2, -16($fp) - sub $t1, $t1, $t2 - sw $t1, -12($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_2 --> -12($fp) - # local_northwest_at_CellularAutomaton_internal_1 = local_northwest_at_CellularAutomaton_internal_2 - 0 - lw $t1, -12($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_GREATER_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_55 - # IF_GREATER_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_55 - lw $t1, -8($fp) - bgt $t1, 0, label_FALSE_55 - # IF_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_55 - # IF_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_55 - lw $t1, -8($fp) - beq $t1, 0, label_FALSE_55 - # LOCAL local_northwest_at_CellularAutomaton_internal_1 --> -8($fp) - # local_northwest_at_CellularAutomaton_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - # GOTO label_END_56 -j label_END_56 -label_FALSE_55: - # LOCAL local_northwest_at_CellularAutomaton_internal_1 --> -8($fp) - # local_northwest_at_CellularAutomaton_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - label_END_56: -# IF_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_53 -# IF_ZERO local_northwest_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_53 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_53 -# LOCAL local_northwest_at_CellularAutomaton_internal_4 --> -20($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_13 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -20($fp) -# LOCAL local_northwest_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_northwest_at_CellularAutomaton_internal_4 --> -20($fp) -# local_northwest_at_CellularAutomaton_internal_0 = local_northwest_at_CellularAutomaton_internal_4 -lw $t1, -20($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_54 -j label_ENDIF_54 -label_FALSEIF_53: - # local_northwest_at_CellularAutomaton_internal_9 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_northwest_at_CellularAutomaton_internal_9 --> -40($fp) - lw $t1, 16($s1) - sw $t1, -40($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_8 --> -36($fp) - # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_9 --> -40($fp) - # local_northwest_at_CellularAutomaton_internal_8 = PARAM param_northwest_at_CellularAutomaton_position_0 / local_northwest_at_CellularAutomaton_internal_9 - lw $t1, 0($fp) - lw $t2, -40($fp) - div $t1, $t1, $t2 - sw $t1, -36($fp) - # local_northwest_at_CellularAutomaton_internal_10 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) - lw $t1, 16($s1) - sw $t1, -44($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) - # local_northwest_at_CellularAutomaton_internal_7 = local_northwest_at_CellularAutomaton_internal_8 * local_northwest_at_CellularAutomaton_internal_10 - lw $t1, -36($fp) - lw $t2, -44($fp) - mul $t1, $t1, $t2 - sw $t1, -32($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_7 --> -32($fp) - # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) - # local_northwest_at_CellularAutomaton_internal_6 = local_northwest_at_CellularAutomaton_internal_7 - PARAM param_northwest_at_CellularAutomaton_position_0 - lw $t1, -32($fp) - lw $t2, 0($fp) - sub $t1, $t1, $t2 - sw $t1, -28($fp) - # IF_ZERO local_northwest_at_CellularAutomaton_internal_6 GOTO label_TRUE_59 - # IF_ZERO local_northwest_at_CellularAutomaton_internal_6 GOTO label_TRUE_59 - lw $t1, -28($fp) - beq $t1, 0, label_TRUE_59 - # LOCAL local_northwest_at_CellularAutomaton_internal_6 --> -28($fp) - # local_northwest_at_CellularAutomaton_internal_6 = 0 - li $t1, 0 - sw $t1, -28($fp) - # GOTO label_END_60 -j label_END_60 -label_TRUE_59: - # LOCAL local_northwest_at_CellularAutomaton_internal_6 --> -28($fp) - # local_northwest_at_CellularAutomaton_internal_6 = 1 - li $t1, 1 - sw $t1, -28($fp) - label_END_60: -# IF_ZERO local_northwest_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_57 -# IF_ZERO local_northwest_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_57 -lw $t1, -28($fp) -beq $t1, 0, label_FALSEIF_57 -# LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_14 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -48($fp) -# LOCAL local_northwest_at_CellularAutomaton_internal_5 --> -24($fp) -# LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) -# local_northwest_at_CellularAutomaton_internal_5 = local_northwest_at_CellularAutomaton_internal_11 -lw $t1, -48($fp) -sw $t1, -24($fp) -# GOTO label_ENDIF_58 -j label_ENDIF_58 -label_FALSEIF_57: - # LOCAL local_northwest_at_CellularAutomaton_internal_14 --> -60($fp) - # local_northwest_at_CellularAutomaton_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_14 --> -60($fp) - # local_northwest_at_CellularAutomaton_internal_12 = local_northwest_at_CellularAutomaton_internal_14 - lw $t1, -60($fp) - sw $t1, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_northwest_at_CellularAutomaton_internal_15 --> -64($fp) - # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) - # local_northwest_at_CellularAutomaton_internal_15 = PARAM param_northwest_at_CellularAutomaton_position_0 - 1 - lw $t1, 0($fp) - sub $t1, $t1, 1 - sw $t1, -64($fp) - # ARG local_northwest_at_CellularAutomaton_internal_15 - # LOCAL local_northwest_at_CellularAutomaton_internal_15 --> -64($fp) - lw $t1, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_northwest_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_13 --> -56($fp) - # local_northwest_at_CellularAutomaton_internal_13 = VCALL local_northwest_at_CellularAutomaton_internal_12 north - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 52($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_northwest_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_13 --> -56($fp) - # local_northwest_at_CellularAutomaton_internal_5 = local_northwest_at_CellularAutomaton_internal_13 - lw $t1, -56($fp) - sw $t1, -24($fp) - label_ENDIF_58: -# LOCAL local_northwest_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_northwest_at_CellularAutomaton_internal_5 --> -24($fp) -# local_northwest_at_CellularAutomaton_internal_0 = local_northwest_at_CellularAutomaton_internal_5 -lw $t1, -24($fp) -sw $t1, -4($fp) -label_ENDIF_54: -# RETURN local_northwest_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_northwest_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 72 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_northeast_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_northeast_at_CellularAutomaton_position_0 -function_northeast_at_CellularAutomaton: - # Allocate stack frame for function function_northeast_at_CellularAutomaton. - subu $sp, $sp, 80 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 80 - # local_northeast_at_CellularAutomaton_internal_3 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_northeast_at_CellularAutomaton_internal_3 --> -16($fp) - lw $t1, 16($s1) - sw $t1, -16($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_2 --> -12($fp) - # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_3 --> -16($fp) - # local_northeast_at_CellularAutomaton_internal_2 = PARAM param_northeast_at_CellularAutomaton_position_0 - local_northeast_at_CellularAutomaton_internal_3 - lw $t1, 0($fp) - lw $t2, -16($fp) - sub $t1, $t1, $t2 - sw $t1, -12($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_2 --> -12($fp) - # local_northeast_at_CellularAutomaton_internal_1 = local_northeast_at_CellularAutomaton_internal_2 - 0 - lw $t1, -12($fp) - sub $t1, $t1, 0 - sw $t1, -8($fp) - # IF_GREATER_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_63 - # IF_GREATER_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_63 - lw $t1, -8($fp) - bgt $t1, 0, label_FALSE_63 - # IF_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_63 - # IF_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_63 - lw $t1, -8($fp) - beq $t1, 0, label_FALSE_63 - # LOCAL local_northeast_at_CellularAutomaton_internal_1 --> -8($fp) - # local_northeast_at_CellularAutomaton_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - # GOTO label_END_64 -j label_END_64 -label_FALSE_63: - # LOCAL local_northeast_at_CellularAutomaton_internal_1 --> -8($fp) - # local_northeast_at_CellularAutomaton_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - label_END_64: -# IF_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_61 -# IF_ZERO local_northeast_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_61 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_61 -# LOCAL local_northeast_at_CellularAutomaton_internal_4 --> -20($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_15 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -20($fp) -# LOCAL local_northeast_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_northeast_at_CellularAutomaton_internal_4 --> -20($fp) -# local_northeast_at_CellularAutomaton_internal_0 = local_northeast_at_CellularAutomaton_internal_4 -lw $t1, -20($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_62 -j label_ENDIF_62 -label_FALSEIF_61: - # LOCAL local_northeast_at_CellularAutomaton_internal_9 --> -40($fp) - # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) - # local_northeast_at_CellularAutomaton_internal_9 = PARAM param_northeast_at_CellularAutomaton_position_0 + 1 - lw $t1, 0($fp) - add $t1, $t1, 1 - sw $t1, -40($fp) - # local_northeast_at_CellularAutomaton_internal_10 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) - lw $t1, 16($s1) - sw $t1, -44($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) - # local_northeast_at_CellularAutomaton_internal_8 = local_northeast_at_CellularAutomaton_internal_9 / local_northeast_at_CellularAutomaton_internal_10 - lw $t1, -40($fp) - lw $t2, -44($fp) - div $t1, $t1, $t2 - sw $t1, -36($fp) - # local_northeast_at_CellularAutomaton_internal_11 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) - lw $t1, 16($s1) - sw $t1, -48($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) - # local_northeast_at_CellularAutomaton_internal_7 = local_northeast_at_CellularAutomaton_internal_8 * local_northeast_at_CellularAutomaton_internal_11 - lw $t1, -36($fp) - lw $t2, -48($fp) - mul $t1, $t1, $t2 - sw $t1, -32($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_12 --> -52($fp) - # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) - # local_northeast_at_CellularAutomaton_internal_12 = PARAM param_northeast_at_CellularAutomaton_position_0 + 1 - lw $t1, 0($fp) - add $t1, $t1, 1 - sw $t1, -52($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_12 --> -52($fp) - # local_northeast_at_CellularAutomaton_internal_6 = local_northeast_at_CellularAutomaton_internal_7 - local_northeast_at_CellularAutomaton_internal_12 - lw $t1, -32($fp) - lw $t2, -52($fp) - sub $t1, $t1, $t2 - sw $t1, -28($fp) - # IF_ZERO local_northeast_at_CellularAutomaton_internal_6 GOTO label_TRUE_67 - # IF_ZERO local_northeast_at_CellularAutomaton_internal_6 GOTO label_TRUE_67 - lw $t1, -28($fp) - beq $t1, 0, label_TRUE_67 - # LOCAL local_northeast_at_CellularAutomaton_internal_6 --> -28($fp) - # local_northeast_at_CellularAutomaton_internal_6 = 0 - li $t1, 0 - sw $t1, -28($fp) - # GOTO label_END_68 -j label_END_68 -label_TRUE_67: - # LOCAL local_northeast_at_CellularAutomaton_internal_6 --> -28($fp) - # local_northeast_at_CellularAutomaton_internal_6 = 1 - li $t1, 1 - sw $t1, -28($fp) - label_END_68: -# IF_ZERO local_northeast_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_65 -# IF_ZERO local_northeast_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_65 -lw $t1, -28($fp) -beq $t1, 0, label_FALSEIF_65 -# LOCAL local_northeast_at_CellularAutomaton_internal_13 --> -56($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_16 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -56($fp) -# LOCAL local_northeast_at_CellularAutomaton_internal_5 --> -24($fp) -# LOCAL local_northeast_at_CellularAutomaton_internal_13 --> -56($fp) -# local_northeast_at_CellularAutomaton_internal_5 = local_northeast_at_CellularAutomaton_internal_13 -lw $t1, -56($fp) -sw $t1, -24($fp) -# GOTO label_ENDIF_66 -j label_ENDIF_66 -label_FALSEIF_65: - # LOCAL local_northeast_at_CellularAutomaton_internal_16 --> -68($fp) - # local_northeast_at_CellularAutomaton_internal_16 = SELF - sw $s1, -68($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_14 --> -60($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_16 --> -68($fp) - # local_northeast_at_CellularAutomaton_internal_14 = local_northeast_at_CellularAutomaton_internal_16 - lw $t1, -68($fp) - sw $t1, -60($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) - # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) - # local_northeast_at_CellularAutomaton_internal_17 = PARAM param_northeast_at_CellularAutomaton_position_0 + 1 - lw $t1, 0($fp) - add $t1, $t1, 1 - sw $t1, -72($fp) - # ARG local_northeast_at_CellularAutomaton_internal_17 - # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) - lw $t1, -72($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_northeast_at_CellularAutomaton_internal_14 --> -60($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_15 --> -64($fp) - # local_northeast_at_CellularAutomaton_internal_15 = VCALL local_northeast_at_CellularAutomaton_internal_14 north - # Save new self pointer in $s1 - lw $s1, -60($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 52($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -64($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_northeast_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_15 --> -64($fp) - # local_northeast_at_CellularAutomaton_internal_5 = local_northeast_at_CellularAutomaton_internal_15 - lw $t1, -64($fp) - sw $t1, -24($fp) - label_ENDIF_66: -# LOCAL local_northeast_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_northeast_at_CellularAutomaton_internal_5 --> -24($fp) -# local_northeast_at_CellularAutomaton_internal_0 = local_northeast_at_CellularAutomaton_internal_5 -lw $t1, -24($fp) -sw $t1, -4($fp) -label_ENDIF_62: -# RETURN local_northeast_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_northeast_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 80 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_southeast_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_southeast_at_CellularAutomaton_position_0 -function_southeast_at_CellularAutomaton: - # Allocate stack frame for function function_southeast_at_CellularAutomaton. - subu $sp, $sp, 84 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 84 - # local_southeast_at_CellularAutomaton_internal_2 = GETATTRIBUTE board_size CellularAutomaton - # LOCAL local_southeast_at_CellularAutomaton_internal_2 --> -12($fp) - lw $t1, 20($s1) - sw $t1, -12($fp) - # local_southeast_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_southeast_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t1, 16($s1) - sw $t1, -20($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_4 --> -20($fp) - # local_southeast_at_CellularAutomaton_internal_3 = PARAM param_southeast_at_CellularAutomaton_position_0 + local_southeast_at_CellularAutomaton_internal_4 - lw $t1, 0($fp) - lw $t2, -20($fp) - add $t1, $t1, $t2 - sw $t1, -16($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_3 --> -16($fp) - # local_southeast_at_CellularAutomaton_internal_1 = local_southeast_at_CellularAutomaton_internal_2 - local_southeast_at_CellularAutomaton_internal_3 - lw $t1, -12($fp) - lw $t2, -16($fp) - sub $t1, $t1, $t2 - sw $t1, -8($fp) - # IF_GREATER_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_71 - # IF_GREATER_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_71 - lw $t1, -8($fp) - bgt $t1, 0, label_FALSE_71 - # IF_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_71 - # IF_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSE_71 - lw $t1, -8($fp) - beq $t1, 0, label_FALSE_71 - # LOCAL local_southeast_at_CellularAutomaton_internal_1 --> -8($fp) - # local_southeast_at_CellularAutomaton_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - # GOTO label_END_72 -j label_END_72 -label_FALSE_71: - # LOCAL local_southeast_at_CellularAutomaton_internal_1 --> -8($fp) - # local_southeast_at_CellularAutomaton_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - label_END_72: -# IF_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_69 -# IF_ZERO local_southeast_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_69 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_69 -# LOCAL local_southeast_at_CellularAutomaton_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_17 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -24($fp) -# LOCAL local_southeast_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_southeast_at_CellularAutomaton_internal_5 --> -24($fp) -# local_southeast_at_CellularAutomaton_internal_0 = local_southeast_at_CellularAutomaton_internal_5 -lw $t1, -24($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_70 -j label_ENDIF_70 -label_FALSEIF_69: - # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) - # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) - # local_southeast_at_CellularAutomaton_internal_10 = PARAM param_southeast_at_CellularAutomaton_position_0 + 1 - lw $t1, 0($fp) - add $t1, $t1, 1 - sw $t1, -44($fp) - # local_southeast_at_CellularAutomaton_internal_11 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) - lw $t1, 16($s1) - sw $t1, -48($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) - # local_southeast_at_CellularAutomaton_internal_9 = local_southeast_at_CellularAutomaton_internal_10 / local_southeast_at_CellularAutomaton_internal_11 - lw $t1, -44($fp) - lw $t2, -48($fp) - div $t1, $t1, $t2 - sw $t1, -40($fp) - # local_southeast_at_CellularAutomaton_internal_12 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_southeast_at_CellularAutomaton_internal_12 --> -52($fp) - lw $t1, 16($s1) - sw $t1, -52($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_12 --> -52($fp) - # local_southeast_at_CellularAutomaton_internal_8 = local_southeast_at_CellularAutomaton_internal_9 * local_southeast_at_CellularAutomaton_internal_12 - lw $t1, -40($fp) - lw $t2, -52($fp) - mul $t1, $t1, $t2 - sw $t1, -36($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_13 --> -56($fp) - # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) - # local_southeast_at_CellularAutomaton_internal_13 = PARAM param_southeast_at_CellularAutomaton_position_0 + 1 - lw $t1, 0($fp) - add $t1, $t1, 1 - sw $t1, -56($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_13 --> -56($fp) - # local_southeast_at_CellularAutomaton_internal_7 = local_southeast_at_CellularAutomaton_internal_8 - local_southeast_at_CellularAutomaton_internal_13 - lw $t1, -36($fp) - lw $t2, -56($fp) - sub $t1, $t1, $t2 - sw $t1, -32($fp) - # IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_TRUE_75 - # IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_TRUE_75 - lw $t1, -32($fp) - beq $t1, 0, label_TRUE_75 - # LOCAL local_southeast_at_CellularAutomaton_internal_7 --> -32($fp) - # local_southeast_at_CellularAutomaton_internal_7 = 0 - li $t1, 0 - sw $t1, -32($fp) - # GOTO label_END_76 -j label_END_76 -label_TRUE_75: - # LOCAL local_southeast_at_CellularAutomaton_internal_7 --> -32($fp) - # local_southeast_at_CellularAutomaton_internal_7 = 1 - li $t1, 1 - sw $t1, -32($fp) - label_END_76: -# IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_73 -# IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_73 -lw $t1, -32($fp) -beq $t1, 0, label_FALSEIF_73 -# LOCAL local_southeast_at_CellularAutomaton_internal_14 --> -60($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_18 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -60($fp) -# LOCAL local_southeast_at_CellularAutomaton_internal_6 --> -28($fp) -# LOCAL local_southeast_at_CellularAutomaton_internal_14 --> -60($fp) -# local_southeast_at_CellularAutomaton_internal_6 = local_southeast_at_CellularAutomaton_internal_14 -lw $t1, -60($fp) -sw $t1, -28($fp) -# GOTO label_ENDIF_74 -j label_ENDIF_74 -label_FALSEIF_73: - # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) - # local_southeast_at_CellularAutomaton_internal_17 = SELF - sw $s1, -72($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_15 --> -64($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) - # local_southeast_at_CellularAutomaton_internal_15 = local_southeast_at_CellularAutomaton_internal_17 - lw $t1, -72($fp) - sw $t1, -64($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_southeast_at_CellularAutomaton_internal_18 --> -76($fp) - # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) - # local_southeast_at_CellularAutomaton_internal_18 = PARAM param_southeast_at_CellularAutomaton_position_0 + 1 - lw $t1, 0($fp) - add $t1, $t1, 1 - sw $t1, -76($fp) - # ARG local_southeast_at_CellularAutomaton_internal_18 - # LOCAL local_southeast_at_CellularAutomaton_internal_18 --> -76($fp) - lw $t1, -76($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_southeast_at_CellularAutomaton_internal_15 --> -64($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_16 --> -68($fp) - # local_southeast_at_CellularAutomaton_internal_16 = VCALL local_southeast_at_CellularAutomaton_internal_15 south - # Save new self pointer in $s1 - lw $s1, -64($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 56($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -68($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_southeast_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_16 --> -68($fp) - # local_southeast_at_CellularAutomaton_internal_6 = local_southeast_at_CellularAutomaton_internal_16 - lw $t1, -68($fp) - sw $t1, -28($fp) - label_ENDIF_74: -# LOCAL local_southeast_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_southeast_at_CellularAutomaton_internal_6 --> -28($fp) -# local_southeast_at_CellularAutomaton_internal_0 = local_southeast_at_CellularAutomaton_internal_6 -lw $t1, -28($fp) -sw $t1, -4($fp) -label_ENDIF_70: -# RETURN local_southeast_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_southeast_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 84 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_southwest_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_southwest_at_CellularAutomaton_position_0 -function_southwest_at_CellularAutomaton: - # Allocate stack frame for function function_southwest_at_CellularAutomaton. - subu $sp, $sp, 76 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 76 - # local_southwest_at_CellularAutomaton_internal_2 = GETATTRIBUTE board_size CellularAutomaton - # LOCAL local_southwest_at_CellularAutomaton_internal_2 --> -12($fp) - lw $t1, 20($s1) - sw $t1, -12($fp) - # local_southwest_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_southwest_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t1, 16($s1) - sw $t1, -20($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_4 --> -20($fp) - # local_southwest_at_CellularAutomaton_internal_3 = PARAM param_southwest_at_CellularAutomaton_position_0 + local_southwest_at_CellularAutomaton_internal_4 - lw $t1, 0($fp) - lw $t2, -20($fp) - add $t1, $t1, $t2 - sw $t1, -16($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_3 --> -16($fp) - # local_southwest_at_CellularAutomaton_internal_1 = local_southwest_at_CellularAutomaton_internal_2 - local_southwest_at_CellularAutomaton_internal_3 - lw $t1, -12($fp) - lw $t2, -16($fp) - sub $t1, $t1, $t2 - sw $t1, -8($fp) - # IF_GREATER_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_79 - # IF_GREATER_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_79 - lw $t1, -8($fp) - bgt $t1, 0, label_FALSE_79 - # IF_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_79 - # IF_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSE_79 - lw $t1, -8($fp) - beq $t1, 0, label_FALSE_79 - # LOCAL local_southwest_at_CellularAutomaton_internal_1 --> -8($fp) - # local_southwest_at_CellularAutomaton_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - # GOTO label_END_80 -j label_END_80 -label_FALSE_79: - # LOCAL local_southwest_at_CellularAutomaton_internal_1 --> -8($fp) - # local_southwest_at_CellularAutomaton_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - label_END_80: -# IF_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_77 -# IF_ZERO local_southwest_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_77 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_77 -# LOCAL local_southwest_at_CellularAutomaton_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_19 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -24($fp) -# LOCAL local_southwest_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_southwest_at_CellularAutomaton_internal_5 --> -24($fp) -# local_southwest_at_CellularAutomaton_internal_0 = local_southwest_at_CellularAutomaton_internal_5 -lw $t1, -24($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_78 -j label_ENDIF_78 -label_FALSEIF_77: - # local_southwest_at_CellularAutomaton_internal_10 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) - lw $t1, 16($s1) - sw $t1, -44($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_9 --> -40($fp) - # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) - # local_southwest_at_CellularAutomaton_internal_9 = PARAM param_southwest_at_CellularAutomaton_position_0 / local_southwest_at_CellularAutomaton_internal_10 - lw $t1, 0($fp) - lw $t2, -44($fp) - div $t1, $t1, $t2 - sw $t1, -40($fp) - # local_southwest_at_CellularAutomaton_internal_11 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) - lw $t1, 16($s1) - sw $t1, -48($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) - # local_southwest_at_CellularAutomaton_internal_8 = local_southwest_at_CellularAutomaton_internal_9 * local_southwest_at_CellularAutomaton_internal_11 - lw $t1, -40($fp) - lw $t2, -48($fp) - mul $t1, $t1, $t2 - sw $t1, -36($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_8 --> -36($fp) - # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) - # local_southwest_at_CellularAutomaton_internal_7 = local_southwest_at_CellularAutomaton_internal_8 - PARAM param_southwest_at_CellularAutomaton_position_0 - lw $t1, -36($fp) - lw $t2, 0($fp) - sub $t1, $t1, $t2 - sw $t1, -32($fp) - # IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_TRUE_83 - # IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_TRUE_83 - lw $t1, -32($fp) - beq $t1, 0, label_TRUE_83 - # LOCAL local_southwest_at_CellularAutomaton_internal_7 --> -32($fp) - # local_southwest_at_CellularAutomaton_internal_7 = 0 - li $t1, 0 - sw $t1, -32($fp) - # GOTO label_END_84 -j label_END_84 -label_TRUE_83: - # LOCAL local_southwest_at_CellularAutomaton_internal_7 --> -32($fp) - # local_southwest_at_CellularAutomaton_internal_7 = 1 - li $t1, 1 - sw $t1, -32($fp) - label_END_84: -# IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_81 -# IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_81 -lw $t1, -32($fp) -beq $t1, 0, label_FALSEIF_81 -# LOCAL local_southwest_at_CellularAutomaton_internal_12 --> -52($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_20 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -52($fp) -# LOCAL local_southwest_at_CellularAutomaton_internal_6 --> -28($fp) -# LOCAL local_southwest_at_CellularAutomaton_internal_12 --> -52($fp) -# local_southwest_at_CellularAutomaton_internal_6 = local_southwest_at_CellularAutomaton_internal_12 -lw $t1, -52($fp) -sw $t1, -28($fp) -# GOTO label_ENDIF_82 -j label_ENDIF_82 -label_FALSEIF_81: - # LOCAL local_southwest_at_CellularAutomaton_internal_15 --> -64($fp) - # local_southwest_at_CellularAutomaton_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_15 --> -64($fp) - # local_southwest_at_CellularAutomaton_internal_13 = local_southwest_at_CellularAutomaton_internal_15 - lw $t1, -64($fp) - sw $t1, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_southwest_at_CellularAutomaton_internal_16 --> -68($fp) - # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) - # local_southwest_at_CellularAutomaton_internal_16 = PARAM param_southwest_at_CellularAutomaton_position_0 - 1 - lw $t1, 0($fp) - sub $t1, $t1, 1 - sw $t1, -68($fp) - # ARG local_southwest_at_CellularAutomaton_internal_16 - # LOCAL local_southwest_at_CellularAutomaton_internal_16 --> -68($fp) - lw $t1, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_southwest_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_14 --> -60($fp) - # local_southwest_at_CellularAutomaton_internal_14 = VCALL local_southwest_at_CellularAutomaton_internal_13 south - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 56($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_southwest_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_14 --> -60($fp) - # local_southwest_at_CellularAutomaton_internal_6 = local_southwest_at_CellularAutomaton_internal_14 - lw $t1, -60($fp) - sw $t1, -28($fp) - label_ENDIF_82: -# LOCAL local_southwest_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_southwest_at_CellularAutomaton_internal_6 --> -28($fp) -# local_southwest_at_CellularAutomaton_internal_0 = local_southwest_at_CellularAutomaton_internal_6 -lw $t1, -28($fp) -sw $t1, -4($fp) -label_ENDIF_78: -# RETURN local_southwest_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_southwest_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 76 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_neighbors_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_neighbors_at_CellularAutomaton_position_0 -function_neighbors_at_CellularAutomaton: - # Allocate stack frame for function function_neighbors_at_CellularAutomaton. - subu $sp, $sp, 228 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 228 - # LOCAL local_neighbors_at_CellularAutomaton_internal_11 --> -48($fp) - # local_neighbors_at_CellularAutomaton_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_11 --> -48($fp) - # local_neighbors_at_CellularAutomaton_internal_9 = local_neighbors_at_CellularAutomaton_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_neighbors_at_CellularAutomaton_position_0 - # PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) - lw $t1, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) - # local_neighbors_at_CellularAutomaton_internal_10 = VCALL local_neighbors_at_CellularAutomaton_internal_9 north - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 52($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_21 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -52($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) - # local_neighbors_at_CellularAutomaton_internal_8 = local_neighbors_at_CellularAutomaton_internal_10 - local_neighbors_at_CellularAutomaton_internal_12 - lw $t1, -44($fp) - lw $t2, -52($fp) - sub $t1, $t1, $t2 - sw $t1, -36($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_8 GOTO label_TRUE_87 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_8 GOTO label_TRUE_87 - lw $t1, -36($fp) - beq $t1, 0, label_TRUE_87 - # LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) - # local_neighbors_at_CellularAutomaton_internal_8 = 0 - li $t1, 0 - sw $t1, -36($fp) - # GOTO label_END_88 -j label_END_88 -label_TRUE_87: - # LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) - # local_neighbors_at_CellularAutomaton_internal_8 = 1 - li $t1, 1 - sw $t1, -36($fp) - label_END_88: -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_8 GOTO label_FALSEIF_85 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_8 GOTO label_FALSEIF_85 -lw $t1, -36($fp) -beq $t1, 0, label_FALSEIF_85 -# LOCAL local_neighbors_at_CellularAutomaton_internal_7 --> -32($fp) -# local_neighbors_at_CellularAutomaton_internal_7 = 1 -li $t1, 1 -sw $t1, -32($fp) -# GOTO label_ENDIF_86 -j label_ENDIF_86 -label_FALSEIF_85: - # LOCAL local_neighbors_at_CellularAutomaton_internal_7 --> -32($fp) - # local_neighbors_at_CellularAutomaton_internal_7 = 0 - li $t1, 0 - sw $t1, -32($fp) - label_ENDIF_86: -# LOCAL local_neighbors_at_CellularAutomaton_internal_17 --> -72($fp) -# local_neighbors_at_CellularAutomaton_internal_17 = SELF -sw $s1, -72($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_15 --> -64($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_17 --> -72($fp) -# local_neighbors_at_CellularAutomaton_internal_15 = local_neighbors_at_CellularAutomaton_internal_17 -lw $t1, -72($fp) -sw $t1, -64($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_15 --> -64($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_16 --> -68($fp) -# local_neighbors_at_CellularAutomaton_internal_16 = VCALL local_neighbors_at_CellularAutomaton_internal_15 south -# Save new self pointer in $s1 -lw $s1, -64($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 56($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -68($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_18 --> -76($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_22 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -76($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_16 --> -68($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_18 --> -76($fp) -# local_neighbors_at_CellularAutomaton_internal_14 = local_neighbors_at_CellularAutomaton_internal_16 - local_neighbors_at_CellularAutomaton_internal_18 -lw $t1, -68($fp) -lw $t2, -76($fp) -sub $t1, $t1, $t2 -sw $t1, -60($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_TRUE_91 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_TRUE_91 -lw $t1, -60($fp) -beq $t1, 0, label_TRUE_91 -# LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) -# local_neighbors_at_CellularAutomaton_internal_14 = 0 -li $t1, 0 -sw $t1, -60($fp) -# GOTO label_END_92 -j label_END_92 -label_TRUE_91: - # LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) - # local_neighbors_at_CellularAutomaton_internal_14 = 1 - li $t1, 1 - sw $t1, -60($fp) - label_END_92: -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_FALSEIF_89 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_FALSEIF_89 -lw $t1, -60($fp) -beq $t1, 0, label_FALSEIF_89 -# LOCAL local_neighbors_at_CellularAutomaton_internal_13 --> -56($fp) -# local_neighbors_at_CellularAutomaton_internal_13 = 1 -li $t1, 1 -sw $t1, -56($fp) -# GOTO label_ENDIF_90 -j label_ENDIF_90 -label_FALSEIF_89: - # LOCAL local_neighbors_at_CellularAutomaton_internal_13 --> -56($fp) - # local_neighbors_at_CellularAutomaton_internal_13 = 0 - li $t1, 0 - sw $t1, -56($fp) - label_ENDIF_90: -# LOCAL local_neighbors_at_CellularAutomaton_internal_6 --> -28($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_7 --> -32($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_13 --> -56($fp) -# local_neighbors_at_CellularAutomaton_internal_6 = local_neighbors_at_CellularAutomaton_internal_7 + local_neighbors_at_CellularAutomaton_internal_13 -lw $t1, -32($fp) -lw $t2, -56($fp) -add $t1, $t1, $t2 -sw $t1, -28($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_23 --> -96($fp) -# local_neighbors_at_CellularAutomaton_internal_23 = SELF -sw $s1, -96($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_21 --> -88($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_23 --> -96($fp) -# local_neighbors_at_CellularAutomaton_internal_21 = local_neighbors_at_CellularAutomaton_internal_23 -lw $t1, -96($fp) -sw $t1, -88($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_21 --> -88($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) -# local_neighbors_at_CellularAutomaton_internal_22 = VCALL local_neighbors_at_CellularAutomaton_internal_21 east -# Save new self pointer in $s1 -lw $s1, -88($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 60($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -92($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_23 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -100($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) -# local_neighbors_at_CellularAutomaton_internal_20 = local_neighbors_at_CellularAutomaton_internal_22 - local_neighbors_at_CellularAutomaton_internal_24 -lw $t1, -92($fp) -lw $t2, -100($fp) -sub $t1, $t1, $t2 -sw $t1, -84($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_95 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_95 -lw $t1, -84($fp) -beq $t1, 0, label_TRUE_95 -# LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) -# local_neighbors_at_CellularAutomaton_internal_20 = 0 -li $t1, 0 -sw $t1, -84($fp) -# GOTO label_END_96 -j label_END_96 -label_TRUE_95: - # LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) - # local_neighbors_at_CellularAutomaton_internal_20 = 1 - li $t1, 1 - sw $t1, -84($fp) - label_END_96: -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_FALSEIF_93 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_FALSEIF_93 -lw $t1, -84($fp) -beq $t1, 0, label_FALSEIF_93 -# LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) -# local_neighbors_at_CellularAutomaton_internal_19 = 1 -li $t1, 1 -sw $t1, -80($fp) -# GOTO label_ENDIF_94 -j label_ENDIF_94 -label_FALSEIF_93: - # LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) - # local_neighbors_at_CellularAutomaton_internal_19 = 0 - li $t1, 0 - sw $t1, -80($fp) - label_ENDIF_94: -# LOCAL local_neighbors_at_CellularAutomaton_internal_5 --> -24($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_6 --> -28($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) -# local_neighbors_at_CellularAutomaton_internal_5 = local_neighbors_at_CellularAutomaton_internal_6 + local_neighbors_at_CellularAutomaton_internal_19 -lw $t1, -28($fp) -lw $t2, -80($fp) -add $t1, $t1, $t2 -sw $t1, -24($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_29 --> -120($fp) -# local_neighbors_at_CellularAutomaton_internal_29 = SELF -sw $s1, -120($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_27 --> -112($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_29 --> -120($fp) -# local_neighbors_at_CellularAutomaton_internal_27 = local_neighbors_at_CellularAutomaton_internal_29 -lw $t1, -120($fp) -sw $t1, -112($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_27 --> -112($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_28 --> -116($fp) -# local_neighbors_at_CellularAutomaton_internal_28 = VCALL local_neighbors_at_CellularAutomaton_internal_27 west -# Save new self pointer in $s1 -lw $s1, -112($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 64($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -116($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_24 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -124($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_26 --> -108($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_28 --> -116($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) -# local_neighbors_at_CellularAutomaton_internal_26 = local_neighbors_at_CellularAutomaton_internal_28 - local_neighbors_at_CellularAutomaton_internal_30 -lw $t1, -116($fp) -lw $t2, -124($fp) -sub $t1, $t1, $t2 -sw $t1, -108($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_26 GOTO label_TRUE_99 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_26 GOTO label_TRUE_99 -lw $t1, -108($fp) -beq $t1, 0, label_TRUE_99 -# LOCAL local_neighbors_at_CellularAutomaton_internal_26 --> -108($fp) -# local_neighbors_at_CellularAutomaton_internal_26 = 0 -li $t1, 0 -sw $t1, -108($fp) -# GOTO label_END_100 -j label_END_100 -label_TRUE_99: - # LOCAL local_neighbors_at_CellularAutomaton_internal_26 --> -108($fp) - # local_neighbors_at_CellularAutomaton_internal_26 = 1 - li $t1, 1 - sw $t1, -108($fp) - label_END_100: -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_26 GOTO label_FALSEIF_97 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_26 GOTO label_FALSEIF_97 -lw $t1, -108($fp) -beq $t1, 0, label_FALSEIF_97 -# LOCAL local_neighbors_at_CellularAutomaton_internal_25 --> -104($fp) -# local_neighbors_at_CellularAutomaton_internal_25 = 1 -li $t1, 1 -sw $t1, -104($fp) -# GOTO label_ENDIF_98 -j label_ENDIF_98 -label_FALSEIF_97: - # LOCAL local_neighbors_at_CellularAutomaton_internal_25 --> -104($fp) - # local_neighbors_at_CellularAutomaton_internal_25 = 0 - li $t1, 0 - sw $t1, -104($fp) - label_ENDIF_98: -# LOCAL local_neighbors_at_CellularAutomaton_internal_4 --> -20($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_5 --> -24($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_25 --> -104($fp) -# local_neighbors_at_CellularAutomaton_internal_4 = local_neighbors_at_CellularAutomaton_internal_5 + local_neighbors_at_CellularAutomaton_internal_25 -lw $t1, -24($fp) -lw $t2, -104($fp) -add $t1, $t1, $t2 -sw $t1, -20($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_35 --> -144($fp) -# local_neighbors_at_CellularAutomaton_internal_35 = SELF -sw $s1, -144($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_33 --> -136($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_35 --> -144($fp) -# local_neighbors_at_CellularAutomaton_internal_33 = local_neighbors_at_CellularAutomaton_internal_35 -lw $t1, -144($fp) -sw $t1, -136($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_33 --> -136($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) -# local_neighbors_at_CellularAutomaton_internal_34 = VCALL local_neighbors_at_CellularAutomaton_internal_33 northeast -# Save new self pointer in $s1 -lw $s1, -136($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 72($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -140($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_36 --> -148($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_25 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -148($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_36 --> -148($fp) -# local_neighbors_at_CellularAutomaton_internal_32 = local_neighbors_at_CellularAutomaton_internal_34 - local_neighbors_at_CellularAutomaton_internal_36 -lw $t1, -140($fp) -lw $t2, -148($fp) -sub $t1, $t1, $t2 -sw $t1, -132($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_TRUE_103 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_TRUE_103 -lw $t1, -132($fp) -beq $t1, 0, label_TRUE_103 -# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) -# local_neighbors_at_CellularAutomaton_internal_32 = 0 -li $t1, 0 -sw $t1, -132($fp) -# GOTO label_END_104 -j label_END_104 -label_TRUE_103: - # LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) - # local_neighbors_at_CellularAutomaton_internal_32 = 1 - li $t1, 1 - sw $t1, -132($fp) - label_END_104: -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_FALSEIF_101 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_FALSEIF_101 -lw $t1, -132($fp) -beq $t1, 0, label_FALSEIF_101 -# LOCAL local_neighbors_at_CellularAutomaton_internal_31 --> -128($fp) -# local_neighbors_at_CellularAutomaton_internal_31 = 1 -li $t1, 1 -sw $t1, -128($fp) -# GOTO label_ENDIF_102 -j label_ENDIF_102 -label_FALSEIF_101: - # LOCAL local_neighbors_at_CellularAutomaton_internal_31 --> -128($fp) - # local_neighbors_at_CellularAutomaton_internal_31 = 0 - li $t1, 0 - sw $t1, -128($fp) - label_ENDIF_102: -# LOCAL local_neighbors_at_CellularAutomaton_internal_3 --> -16($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_4 --> -20($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_31 --> -128($fp) -# local_neighbors_at_CellularAutomaton_internal_3 = local_neighbors_at_CellularAutomaton_internal_4 + local_neighbors_at_CellularAutomaton_internal_31 -lw $t1, -20($fp) -lw $t2, -128($fp) -add $t1, $t1, $t2 -sw $t1, -16($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_41 --> -168($fp) -# local_neighbors_at_CellularAutomaton_internal_41 = SELF -sw $s1, -168($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_39 --> -160($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_41 --> -168($fp) -# local_neighbors_at_CellularAutomaton_internal_39 = local_neighbors_at_CellularAutomaton_internal_41 -lw $t1, -168($fp) -sw $t1, -160($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_39 --> -160($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) -# local_neighbors_at_CellularAutomaton_internal_40 = VCALL local_neighbors_at_CellularAutomaton_internal_39 northwest -# Save new self pointer in $s1 -lw $s1, -160($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 68($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -164($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_26 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -172($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) -# local_neighbors_at_CellularAutomaton_internal_38 = local_neighbors_at_CellularAutomaton_internal_40 - local_neighbors_at_CellularAutomaton_internal_42 -lw $t1, -164($fp) -lw $t2, -172($fp) -sub $t1, $t1, $t2 -sw $t1, -156($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_38 GOTO label_TRUE_107 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_38 GOTO label_TRUE_107 -lw $t1, -156($fp) -beq $t1, 0, label_TRUE_107 -# LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) -# local_neighbors_at_CellularAutomaton_internal_38 = 0 -li $t1, 0 -sw $t1, -156($fp) -# GOTO label_END_108 -j label_END_108 -label_TRUE_107: - # LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) - # local_neighbors_at_CellularAutomaton_internal_38 = 1 - li $t1, 1 - sw $t1, -156($fp) - label_END_108: -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_38 GOTO label_FALSEIF_105 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_38 GOTO label_FALSEIF_105 -lw $t1, -156($fp) -beq $t1, 0, label_FALSEIF_105 -# LOCAL local_neighbors_at_CellularAutomaton_internal_37 --> -152($fp) -# local_neighbors_at_CellularAutomaton_internal_37 = 1 -li $t1, 1 -sw $t1, -152($fp) -# GOTO label_ENDIF_106 -j label_ENDIF_106 -label_FALSEIF_105: - # LOCAL local_neighbors_at_CellularAutomaton_internal_37 --> -152($fp) - # local_neighbors_at_CellularAutomaton_internal_37 = 0 - li $t1, 0 - sw $t1, -152($fp) - label_ENDIF_106: -# LOCAL local_neighbors_at_CellularAutomaton_internal_2 --> -12($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_3 --> -16($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_37 --> -152($fp) -# local_neighbors_at_CellularAutomaton_internal_2 = local_neighbors_at_CellularAutomaton_internal_3 + local_neighbors_at_CellularAutomaton_internal_37 -lw $t1, -16($fp) -lw $t2, -152($fp) -add $t1, $t1, $t2 -sw $t1, -12($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_47 --> -192($fp) -# local_neighbors_at_CellularAutomaton_internal_47 = SELF -sw $s1, -192($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_45 --> -184($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_47 --> -192($fp) -# local_neighbors_at_CellularAutomaton_internal_45 = local_neighbors_at_CellularAutomaton_internal_47 -lw $t1, -192($fp) -sw $t1, -184($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_45 --> -184($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_46 --> -188($fp) -# local_neighbors_at_CellularAutomaton_internal_46 = VCALL local_neighbors_at_CellularAutomaton_internal_45 southeast -# Save new self pointer in $s1 -lw $s1, -184($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 76($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -188($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_48 --> -196($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_27 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -196($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_46 --> -188($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_48 --> -196($fp) -# local_neighbors_at_CellularAutomaton_internal_44 = local_neighbors_at_CellularAutomaton_internal_46 - local_neighbors_at_CellularAutomaton_internal_48 -lw $t1, -188($fp) -lw $t2, -196($fp) -sub $t1, $t1, $t2 -sw $t1, -180($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_TRUE_111 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_TRUE_111 -lw $t1, -180($fp) -beq $t1, 0, label_TRUE_111 -# LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) -# local_neighbors_at_CellularAutomaton_internal_44 = 0 -li $t1, 0 -sw $t1, -180($fp) -# GOTO label_END_112 -j label_END_112 -label_TRUE_111: - # LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) - # local_neighbors_at_CellularAutomaton_internal_44 = 1 - li $t1, 1 - sw $t1, -180($fp) - label_END_112: -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_FALSEIF_109 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_FALSEIF_109 -lw $t1, -180($fp) -beq $t1, 0, label_FALSEIF_109 -# LOCAL local_neighbors_at_CellularAutomaton_internal_43 --> -176($fp) -# local_neighbors_at_CellularAutomaton_internal_43 = 1 -li $t1, 1 -sw $t1, -176($fp) -# GOTO label_ENDIF_110 -j label_ENDIF_110 -label_FALSEIF_109: - # LOCAL local_neighbors_at_CellularAutomaton_internal_43 --> -176($fp) - # local_neighbors_at_CellularAutomaton_internal_43 = 0 - li $t1, 0 - sw $t1, -176($fp) - label_ENDIF_110: -# LOCAL local_neighbors_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_2 --> -12($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_43 --> -176($fp) -# local_neighbors_at_CellularAutomaton_internal_1 = local_neighbors_at_CellularAutomaton_internal_2 + local_neighbors_at_CellularAutomaton_internal_43 -lw $t1, -12($fp) -lw $t2, -176($fp) -add $t1, $t1, $t2 -sw $t1, -8($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_53 --> -216($fp) -# local_neighbors_at_CellularAutomaton_internal_53 = SELF -sw $s1, -216($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_51 --> -208($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_53 --> -216($fp) -# local_neighbors_at_CellularAutomaton_internal_51 = local_neighbors_at_CellularAutomaton_internal_53 -lw $t1, -216($fp) -sw $t1, -208($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_51 --> -208($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) -# local_neighbors_at_CellularAutomaton_internal_52 = VCALL local_neighbors_at_CellularAutomaton_internal_51 southwest -# Save new self pointer in $s1 -lw $s1, -208($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 80($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -212($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_28 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -220($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) -# local_neighbors_at_CellularAutomaton_internal_50 = local_neighbors_at_CellularAutomaton_internal_52 - local_neighbors_at_CellularAutomaton_internal_54 -lw $t1, -212($fp) -lw $t2, -220($fp) -sub $t1, $t1, $t2 -sw $t1, -204($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_115 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_115 -lw $t1, -204($fp) -beq $t1, 0, label_TRUE_115 -# LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) -# local_neighbors_at_CellularAutomaton_internal_50 = 0 -li $t1, 0 -sw $t1, -204($fp) -# GOTO label_END_116 -j label_END_116 -label_TRUE_115: - # LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) - # local_neighbors_at_CellularAutomaton_internal_50 = 1 - li $t1, 1 - sw $t1, -204($fp) - label_END_116: -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_FALSEIF_113 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_FALSEIF_113 -lw $t1, -204($fp) -beq $t1, 0, label_FALSEIF_113 -# LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) -# local_neighbors_at_CellularAutomaton_internal_49 = 1 -li $t1, 1 -sw $t1, -200($fp) -# GOTO label_ENDIF_114 -j label_ENDIF_114 -label_FALSEIF_113: - # LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) - # local_neighbors_at_CellularAutomaton_internal_49 = 0 - li $t1, 0 - sw $t1, -200($fp) - label_ENDIF_114: -# LOCAL local_neighbors_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) -# local_neighbors_at_CellularAutomaton_internal_0 = local_neighbors_at_CellularAutomaton_internal_1 + local_neighbors_at_CellularAutomaton_internal_49 -lw $t1, -8($fp) -lw $t2, -200($fp) -add $t1, $t1, $t2 -sw $t1, -4($fp) -# RETURN local_neighbors_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_neighbors_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 228 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_cell_at_next_evolution_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_cell_at_next_evolution_at_CellularAutomaton_position_0 -function_cell_at_next_evolution_at_CellularAutomaton: - # Allocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. - subu $sp, $sp, 88 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 88 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_4 = SELF - sw $s1, -20($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_2 = local_cell_at_next_evolution_at_CellularAutomaton_internal_4 - lw $t1, -20($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 - # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) - lw $t1, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_3 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 neighbors - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 84($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = local_cell_at_next_evolution_at_CellularAutomaton_internal_3 - 3 - lw $t1, -16($fp) - sub $t1, $t1, 3 - sw $t1, -8($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_TRUE_119 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_TRUE_119 - lw $t1, -8($fp) - beq $t1, 0, label_TRUE_119 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = 0 - li $t1, 0 - sw $t1, -8($fp) - # GOTO label_END_120 -j label_END_120 -label_TRUE_119: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = 1 - li $t1, 1 - sw $t1, -8($fp) - label_END_120: -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_117 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_1 GOTO label_FALSEIF_117 -lw $t1, -8($fp) -beq $t1, 0, label_FALSEIF_117 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_29 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -24($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_0 = local_cell_at_next_evolution_at_CellularAutomaton_internal_5 -lw $t1, -24($fp) -sw $t1, -4($fp) -# GOTO label_ENDIF_118 -j label_ENDIF_118 -label_FALSEIF_117: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_10 = SELF - sw $s1, -44($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_8 = local_cell_at_next_evolution_at_CellularAutomaton_internal_10 - lw $t1, -44($fp) - sw $t1, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 - # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) - lw $t1, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_9 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 neighbors - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 84($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = local_cell_at_next_evolution_at_CellularAutomaton_internal_9 - 2 - lw $t1, -40($fp) - sub $t1, $t1, 2 - sw $t1, -32($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_TRUE_123 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_TRUE_123 - lw $t1, -32($fp) - beq $t1, 0, label_TRUE_123 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = 0 - li $t1, 0 - sw $t1, -32($fp) - # GOTO label_END_124 -j label_END_124 -label_TRUE_123: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = 1 - li $t1, 1 - sw $t1, -32($fp) - label_END_124: -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_121 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_121 -lw $t1, -32($fp) -beq $t1, 0, label_FALSEIF_121 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_15 = SELF -sw $s1, -64($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_13 = local_cell_at_next_evolution_at_CellularAutomaton_internal_15 -lw $t1, -64($fp) -sw $t1, -56($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 -# PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) -lw $t1, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_14 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 cell -# Save new self pointer in $s1 -lw $s1, -56($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 48($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -60($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_30 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -68($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = local_cell_at_next_evolution_at_CellularAutomaton_internal_14 - local_cell_at_next_evolution_at_CellularAutomaton_internal_16 -lw $t1, -60($fp) -lw $t2, -68($fp) -sub $t1, $t1, $t2 -sw $t1, -52($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_127 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_127 -lw $t1, -52($fp) -beq $t1, 0, label_TRUE_127 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = 0 -li $t1, 0 -sw $t1, -52($fp) -# GOTO label_END_128 -j label_END_128 -label_TRUE_127: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = 1 - li $t1, 1 - sw $t1, -52($fp) - label_END_128: -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_FALSEIF_125 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_FALSEIF_125 -lw $t1, -52($fp) -beq $t1, 0, label_FALSEIF_125 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_31 -sw $t1, 12($v0) -li $t1, 1 -sw $t1, 16($v0) -sw $v0, -72($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_11 = local_cell_at_next_evolution_at_CellularAutomaton_internal_17 -lw $t1, -72($fp) -sw $t1, -48($fp) -# GOTO label_ENDIF_126 -j label_ENDIF_126 -label_FALSEIF_125: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_32 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -76($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_11 = local_cell_at_next_evolution_at_CellularAutomaton_internal_18 - lw $t1, -76($fp) - sw $t1, -48($fp) - label_ENDIF_126: -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_6 = local_cell_at_next_evolution_at_CellularAutomaton_internal_11 -lw $t1, -48($fp) -sw $t1, -28($fp) -# GOTO label_ENDIF_122 -j label_ENDIF_122 -label_FALSEIF_121: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_33 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -80($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_6 = local_cell_at_next_evolution_at_CellularAutomaton_internal_19 - lw $t1, -80($fp) - sw $t1, -28($fp) - label_ENDIF_122: -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_0 = local_cell_at_next_evolution_at_CellularAutomaton_internal_6 -lw $t1, -28($fp) -sw $t1, -4($fp) -label_ENDIF_118: -# RETURN local_cell_at_next_evolution_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 88 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_evolve_at_CellularAutomaton implementation. -# @Params: -function_evolve_at_CellularAutomaton: - # Allocate stack frame for function function_evolve_at_CellularAutomaton. - subu $sp, $sp, 64 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 64 - # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) - # local_evolve_at_CellularAutomaton_position_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) - # local_evolve_at_CellularAutomaton_internal_4 = SELF - sw $s1, -20($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) - # local_evolve_at_CellularAutomaton_internal_2 = local_evolve_at_CellularAutomaton_internal_4 - lw $t1, -20($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_evolve_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) - # local_evolve_at_CellularAutomaton_internal_3 = VCALL local_evolve_at_CellularAutomaton_internal_2 num_cells - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 44($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) - # local_evolve_at_CellularAutomaton_num_1 = local_evolve_at_CellularAutomaton_internal_3 - lw $t1, -16($fp) - sw $t1, -8($fp) - # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_0 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -24($fp) - label_WHILE_129: - # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) - # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) - # local_evolve_at_CellularAutomaton_internal_6 = local_evolve_at_CellularAutomaton_position_0 - local_evolve_at_CellularAutomaton_num_1 - lw $t1, -4($fp) - lw $t2, -8($fp) - sub $t1, $t1, $t2 - sw $t1, -28($fp) - # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_131 - # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_131 - lw $t1, -28($fp) - bgt $t1, 0, label_FALSE_131 - # IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_131 - # IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_FALSE_131 - lw $t1, -28($fp) - beq $t1, 0, label_FALSE_131 - # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) - # local_evolve_at_CellularAutomaton_internal_6 = 1 - li $t1, 1 - sw $t1, -28($fp) - # GOTO label_END_132 -j label_END_132 -label_FALSE_131: - # LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) - # local_evolve_at_CellularAutomaton_internal_6 = 0 - li $t1, 0 - sw $t1, -28($fp) - label_END_132: -# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_130 -# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_130 -lw $t1, -28($fp) -beq $t1, 0, label_WHILE_END_130 -# LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) -# LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) -# local_evolve_at_CellularAutomaton_internal_7 = local_evolve_at_CellularAutomaton_temp_5 -lw $t1, -24($fp) -sw $t1, -32($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) -# local_evolve_at_CellularAutomaton_internal_11 = SELF -sw $s1, -48($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) -# local_evolve_at_CellularAutomaton_internal_9 = local_evolve_at_CellularAutomaton_internal_11 -lw $t1, -48($fp) -sw $t1, -40($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_evolve_at_CellularAutomaton_position_0 -# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) -lw $t1, -4($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) -# local_evolve_at_CellularAutomaton_internal_10 = VCALL local_evolve_at_CellularAutomaton_internal_9 cell_at_next_evolution -# Save new self pointer in $s1 -lw $s1, -40($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 88($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -44($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_evolve_at_CellularAutomaton_internal_10 -# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) -lw $t1, -44($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -# LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) -# local_evolve_at_CellularAutomaton_internal_8 = VCALL local_evolve_at_CellularAutomaton_internal_7 concat -# Save new self pointer in $s1 -lw $s1, -32($fp) -# Get pointer to type -lw $t1, 4($s1) -# Get pointer to type's VTABLE -lw $t2, 0($t1) -# Get pointer to function address -lw $t3, 12($t2) -# Call function. Result is on $v0 -jalr $t3 -sw $v0, -36($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) -# local_evolve_at_CellularAutomaton_temp_5 = local_evolve_at_CellularAutomaton_internal_8 -lw $t1, -36($fp) -sw $t1, -24($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) -# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) -# local_evolve_at_CellularAutomaton_internal_12 = local_evolve_at_CellularAutomaton_position_0 + 1 -lw $t1, -4($fp) -add $t1, $t1, 1 -sw $t1, -52($fp) -# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) -# local_evolve_at_CellularAutomaton_position_0 = local_evolve_at_CellularAutomaton_internal_12 -lw $t1, -52($fp) -sw $t1, -4($fp) -# GOTO label_WHILE_129 -j label_WHILE_129 -label_WHILE_END_130: - # - # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) - lw $t1, -24($fp) - sw $t1, 24($s1) - # LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) - # local_evolve_at_CellularAutomaton_internal_13 = SELF - sw $s1, -56($fp) - # RETURN local_evolve_at_CellularAutomaton_internal_13 - lw $v0, -56($fp) - # Deallocate stack frame for function function_evolve_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 64 - jr $ra - # Function END - - -# function_option_at_CellularAutomaton implementation. -# @Params: -function_option_at_CellularAutomaton: - # Allocate stack frame for function function_option_at_CellularAutomaton. - subu $sp, $sp, 664 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 664 - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_num_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_3 --> -16($fp) - # local_option_at_CellularAutomaton_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_option_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_option_at_CellularAutomaton_internal_3 --> -16($fp) - # local_option_at_CellularAutomaton_internal_1 = local_option_at_CellularAutomaton_internal_3 - lw $t1, -16($fp) - sw $t1, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_34 - sw $t1, 12($v0) - li $t1, 24 - sw $t1, 16($v0) - sw $v0, -20($fp) - # ARG local_option_at_CellularAutomaton_internal_4 - # LOCAL local_option_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t1, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_option_at_CellularAutomaton_internal_2 --> -12($fp) - # local_option_at_CellularAutomaton_internal_2 = VCALL local_option_at_CellularAutomaton_internal_1 out_string - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_7 --> -32($fp) - # local_option_at_CellularAutomaton_internal_7 = SELF - sw $s1, -32($fp) - # LOCAL local_option_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_option_at_CellularAutomaton_internal_7 --> -32($fp) - # local_option_at_CellularAutomaton_internal_5 = local_option_at_CellularAutomaton_internal_7 - lw $t1, -32($fp) - sw $t1, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_35 - sw $t1, 12($v0) - li $t1, 13 - sw $t1, 16($v0) - sw $v0, -36($fp) - # ARG local_option_at_CellularAutomaton_internal_8 - # LOCAL local_option_at_CellularAutomaton_internal_8 --> -36($fp) - lw $t1, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_option_at_CellularAutomaton_internal_6 --> -28($fp) - # local_option_at_CellularAutomaton_internal_6 = VCALL local_option_at_CellularAutomaton_internal_5 out_string - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_11 --> -48($fp) - # local_option_at_CellularAutomaton_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_option_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_option_at_CellularAutomaton_internal_11 --> -48($fp) - # local_option_at_CellularAutomaton_internal_9 = local_option_at_CellularAutomaton_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_12 --> -52($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_36 - sw $t1, 12($v0) - li $t1, 48 - sw $t1, 16($v0) - sw $v0, -52($fp) - # ARG local_option_at_CellularAutomaton_internal_12 - # LOCAL local_option_at_CellularAutomaton_internal_12 --> -52($fp) - lw $t1, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_option_at_CellularAutomaton_internal_10 --> -44($fp) - # local_option_at_CellularAutomaton_internal_10 = VCALL local_option_at_CellularAutomaton_internal_9 out_string - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_15 --> -64($fp) - # local_option_at_CellularAutomaton_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_option_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_option_at_CellularAutomaton_internal_15 --> -64($fp) - # local_option_at_CellularAutomaton_internal_13 = local_option_at_CellularAutomaton_internal_15 - lw $t1, -64($fp) - sw $t1, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_37 - sw $t1, 12($v0) - li $t1, 48 - sw $t1, 16($v0) - sw $v0, -68($fp) - # ARG local_option_at_CellularAutomaton_internal_16 - # LOCAL local_option_at_CellularAutomaton_internal_16 --> -68($fp) - lw $t1, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_option_at_CellularAutomaton_internal_14 --> -60($fp) - # local_option_at_CellularAutomaton_internal_14 = VCALL local_option_at_CellularAutomaton_internal_13 out_string - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_19 --> -80($fp) - # local_option_at_CellularAutomaton_internal_19 = SELF - sw $s1, -80($fp) - # LOCAL local_option_at_CellularAutomaton_internal_17 --> -72($fp) - # LOCAL local_option_at_CellularAutomaton_internal_19 --> -80($fp) - # local_option_at_CellularAutomaton_internal_17 = local_option_at_CellularAutomaton_internal_19 - lw $t1, -80($fp) - sw $t1, -72($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_38 - sw $t1, 12($v0) - li $t1, 10 - sw $t1, 16($v0) - sw $v0, -84($fp) - # ARG local_option_at_CellularAutomaton_internal_20 - # LOCAL local_option_at_CellularAutomaton_internal_20 --> -84($fp) - lw $t1, -84($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_17 --> -72($fp) - # LOCAL local_option_at_CellularAutomaton_internal_18 --> -76($fp) - # local_option_at_CellularAutomaton_internal_18 = VCALL local_option_at_CellularAutomaton_internal_17 out_string - # Save new self pointer in $s1 - lw $s1, -72($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -76($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_23 --> -96($fp) - # local_option_at_CellularAutomaton_internal_23 = SELF - sw $s1, -96($fp) - # LOCAL local_option_at_CellularAutomaton_internal_21 --> -88($fp) - # LOCAL local_option_at_CellularAutomaton_internal_23 --> -96($fp) - # local_option_at_CellularAutomaton_internal_21 = local_option_at_CellularAutomaton_internal_23 - lw $t1, -96($fp) - sw $t1, -88($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_24 --> -100($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_39 - sw $t1, 12($v0) - li $t1, 26 - sw $t1, 16($v0) - sw $v0, -100($fp) - # ARG local_option_at_CellularAutomaton_internal_24 - # LOCAL local_option_at_CellularAutomaton_internal_24 --> -100($fp) - lw $t1, -100($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_21 --> -88($fp) - # LOCAL local_option_at_CellularAutomaton_internal_22 --> -92($fp) - # local_option_at_CellularAutomaton_internal_22 = VCALL local_option_at_CellularAutomaton_internal_21 out_string - # Save new self pointer in $s1 - lw $s1, -88($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -92($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_27 --> -112($fp) - # local_option_at_CellularAutomaton_internal_27 = SELF - sw $s1, -112($fp) - # LOCAL local_option_at_CellularAutomaton_internal_25 --> -104($fp) - # LOCAL local_option_at_CellularAutomaton_internal_27 --> -112($fp) - # local_option_at_CellularAutomaton_internal_25 = local_option_at_CellularAutomaton_internal_27 - lw $t1, -112($fp) - sw $t1, -104($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_28 --> -116($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_40 - sw $t1, 12($v0) - li $t1, 22 - sw $t1, 16($v0) - sw $v0, -116($fp) - # ARG local_option_at_CellularAutomaton_internal_28 - # LOCAL local_option_at_CellularAutomaton_internal_28 --> -116($fp) - lw $t1, -116($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_25 --> -104($fp) - # LOCAL local_option_at_CellularAutomaton_internal_26 --> -108($fp) - # local_option_at_CellularAutomaton_internal_26 = VCALL local_option_at_CellularAutomaton_internal_25 out_string - # Save new self pointer in $s1 - lw $s1, -104($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -108($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_31 --> -128($fp) - # local_option_at_CellularAutomaton_internal_31 = SELF - sw $s1, -128($fp) - # LOCAL local_option_at_CellularAutomaton_internal_29 --> -120($fp) - # LOCAL local_option_at_CellularAutomaton_internal_31 --> -128($fp) - # local_option_at_CellularAutomaton_internal_29 = local_option_at_CellularAutomaton_internal_31 - lw $t1, -128($fp) - sw $t1, -120($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_32 --> -132($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_41 - sw $t1, 12($v0) - li $t1, 28 - sw $t1, 16($v0) - sw $v0, -132($fp) - # ARG local_option_at_CellularAutomaton_internal_32 - # LOCAL local_option_at_CellularAutomaton_internal_32 --> -132($fp) - lw $t1, -132($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_29 --> -120($fp) - # LOCAL local_option_at_CellularAutomaton_internal_30 --> -124($fp) - # local_option_at_CellularAutomaton_internal_30 = VCALL local_option_at_CellularAutomaton_internal_29 out_string - # Save new self pointer in $s1 - lw $s1, -120($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -124($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_35 --> -144($fp) - # local_option_at_CellularAutomaton_internal_35 = SELF - sw $s1, -144($fp) - # LOCAL local_option_at_CellularAutomaton_internal_33 --> -136($fp) - # LOCAL local_option_at_CellularAutomaton_internal_35 --> -144($fp) - # local_option_at_CellularAutomaton_internal_33 = local_option_at_CellularAutomaton_internal_35 - lw $t1, -144($fp) - sw $t1, -136($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_36 --> -148($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_42 - sw $t1, 12($v0) - li $t1, 25 - sw $t1, 16($v0) - sw $v0, -148($fp) - # ARG local_option_at_CellularAutomaton_internal_36 - # LOCAL local_option_at_CellularAutomaton_internal_36 --> -148($fp) - lw $t1, -148($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_33 --> -136($fp) - # LOCAL local_option_at_CellularAutomaton_internal_34 --> -140($fp) - # local_option_at_CellularAutomaton_internal_34 = VCALL local_option_at_CellularAutomaton_internal_33 out_string - # Save new self pointer in $s1 - lw $s1, -136($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -140($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_39 --> -160($fp) - # local_option_at_CellularAutomaton_internal_39 = SELF - sw $s1, -160($fp) - # LOCAL local_option_at_CellularAutomaton_internal_37 --> -152($fp) - # LOCAL local_option_at_CellularAutomaton_internal_39 --> -160($fp) - # local_option_at_CellularAutomaton_internal_37 = local_option_at_CellularAutomaton_internal_39 - lw $t1, -160($fp) - sw $t1, -152($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_40 --> -164($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_43 - sw $t1, 12($v0) - li $t1, 11 - sw $t1, 16($v0) - sw $v0, -164($fp) - # ARG local_option_at_CellularAutomaton_internal_40 - # LOCAL local_option_at_CellularAutomaton_internal_40 --> -164($fp) - lw $t1, -164($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_37 --> -152($fp) - # LOCAL local_option_at_CellularAutomaton_internal_38 --> -156($fp) - # local_option_at_CellularAutomaton_internal_38 = VCALL local_option_at_CellularAutomaton_internal_37 out_string - # Save new self pointer in $s1 - lw $s1, -152($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -156($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_43 --> -176($fp) - # local_option_at_CellularAutomaton_internal_43 = SELF - sw $s1, -176($fp) - # LOCAL local_option_at_CellularAutomaton_internal_41 --> -168($fp) - # LOCAL local_option_at_CellularAutomaton_internal_43 --> -176($fp) - # local_option_at_CellularAutomaton_internal_41 = local_option_at_CellularAutomaton_internal_43 - lw $t1, -176($fp) - sw $t1, -168($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_44 --> -180($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_44 - sw $t1, 12($v0) - li $t1, 21 - sw $t1, 16($v0) - sw $v0, -180($fp) - # ARG local_option_at_CellularAutomaton_internal_44 - # LOCAL local_option_at_CellularAutomaton_internal_44 --> -180($fp) - lw $t1, -180($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_41 --> -168($fp) - # LOCAL local_option_at_CellularAutomaton_internal_42 --> -172($fp) - # local_option_at_CellularAutomaton_internal_42 = VCALL local_option_at_CellularAutomaton_internal_41 out_string - # Save new self pointer in $s1 - lw $s1, -168($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -172($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_47 --> -192($fp) - # local_option_at_CellularAutomaton_internal_47 = SELF - sw $s1, -192($fp) - # LOCAL local_option_at_CellularAutomaton_internal_45 --> -184($fp) - # LOCAL local_option_at_CellularAutomaton_internal_47 --> -192($fp) - # local_option_at_CellularAutomaton_internal_45 = local_option_at_CellularAutomaton_internal_47 - lw $t1, -192($fp) - sw $t1, -184($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_48 --> -196($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_45 - sw $t1, 12($v0) - li $t1, 32 - sw $t1, 16($v0) - sw $v0, -196($fp) - # ARG local_option_at_CellularAutomaton_internal_48 - # LOCAL local_option_at_CellularAutomaton_internal_48 --> -196($fp) - lw $t1, -196($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_45 --> -184($fp) - # LOCAL local_option_at_CellularAutomaton_internal_46 --> -188($fp) - # local_option_at_CellularAutomaton_internal_46 = VCALL local_option_at_CellularAutomaton_internal_45 out_string - # Save new self pointer in $s1 - lw $s1, -184($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -188($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_51 --> -208($fp) - # local_option_at_CellularAutomaton_internal_51 = SELF - sw $s1, -208($fp) - # LOCAL local_option_at_CellularAutomaton_internal_49 --> -200($fp) - # LOCAL local_option_at_CellularAutomaton_internal_51 --> -208($fp) - # local_option_at_CellularAutomaton_internal_49 = local_option_at_CellularAutomaton_internal_51 - lw $t1, -208($fp) - sw $t1, -200($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_52 --> -212($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_46 - sw $t1, 12($v0) - li $t1, 18 - sw $t1, 16($v0) - sw $v0, -212($fp) - # ARG local_option_at_CellularAutomaton_internal_52 - # LOCAL local_option_at_CellularAutomaton_internal_52 --> -212($fp) - lw $t1, -212($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_49 --> -200($fp) - # LOCAL local_option_at_CellularAutomaton_internal_50 --> -204($fp) - # local_option_at_CellularAutomaton_internal_50 = VCALL local_option_at_CellularAutomaton_internal_49 out_string - # Save new self pointer in $s1 - lw $s1, -200($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -204($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_55 --> -224($fp) - # local_option_at_CellularAutomaton_internal_55 = SELF - sw $s1, -224($fp) - # LOCAL local_option_at_CellularAutomaton_internal_53 --> -216($fp) - # LOCAL local_option_at_CellularAutomaton_internal_55 --> -224($fp) - # local_option_at_CellularAutomaton_internal_53 = local_option_at_CellularAutomaton_internal_55 - lw $t1, -224($fp) - sw $t1, -216($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_56 --> -228($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_47 - sw $t1, 12($v0) - li $t1, 12 - sw $t1, 16($v0) - sw $v0, -228($fp) - # ARG local_option_at_CellularAutomaton_internal_56 - # LOCAL local_option_at_CellularAutomaton_internal_56 --> -228($fp) - lw $t1, -228($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_53 --> -216($fp) - # LOCAL local_option_at_CellularAutomaton_internal_54 --> -220($fp) - # local_option_at_CellularAutomaton_internal_54 = VCALL local_option_at_CellularAutomaton_internal_53 out_string - # Save new self pointer in $s1 - lw $s1, -216($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -220($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_59 --> -240($fp) - # local_option_at_CellularAutomaton_internal_59 = SELF - sw $s1, -240($fp) - # LOCAL local_option_at_CellularAutomaton_internal_57 --> -232($fp) - # LOCAL local_option_at_CellularAutomaton_internal_59 --> -240($fp) - # local_option_at_CellularAutomaton_internal_57 = local_option_at_CellularAutomaton_internal_59 - lw $t1, -240($fp) - sw $t1, -232($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_60 --> -244($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_48 - sw $t1, 12($v0) - li $t1, 17 - sw $t1, 16($v0) - sw $v0, -244($fp) - # ARG local_option_at_CellularAutomaton_internal_60 - # LOCAL local_option_at_CellularAutomaton_internal_60 --> -244($fp) - lw $t1, -244($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_57 --> -232($fp) - # LOCAL local_option_at_CellularAutomaton_internal_58 --> -236($fp) - # local_option_at_CellularAutomaton_internal_58 = VCALL local_option_at_CellularAutomaton_internal_57 out_string - # Save new self pointer in $s1 - lw $s1, -232($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -236($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_63 --> -256($fp) - # local_option_at_CellularAutomaton_internal_63 = SELF - sw $s1, -256($fp) - # LOCAL local_option_at_CellularAutomaton_internal_61 --> -248($fp) - # LOCAL local_option_at_CellularAutomaton_internal_63 --> -256($fp) - # local_option_at_CellularAutomaton_internal_61 = local_option_at_CellularAutomaton_internal_63 - lw $t1, -256($fp) - sw $t1, -248($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_64 --> -260($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_49 - sw $t1, 12($v0) - li $t1, 12 - sw $t1, 16($v0) - sw $v0, -260($fp) - # ARG local_option_at_CellularAutomaton_internal_64 - # LOCAL local_option_at_CellularAutomaton_internal_64 --> -260($fp) - lw $t1, -260($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_61 --> -248($fp) - # LOCAL local_option_at_CellularAutomaton_internal_62 --> -252($fp) - # local_option_at_CellularAutomaton_internal_62 = VCALL local_option_at_CellularAutomaton_internal_61 out_string - # Save new self pointer in $s1 - lw $s1, -248($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -252($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_67 --> -272($fp) - # local_option_at_CellularAutomaton_internal_67 = SELF - sw $s1, -272($fp) - # LOCAL local_option_at_CellularAutomaton_internal_65 --> -264($fp) - # LOCAL local_option_at_CellularAutomaton_internal_67 --> -272($fp) - # local_option_at_CellularAutomaton_internal_65 = local_option_at_CellularAutomaton_internal_67 - lw $t1, -272($fp) - sw $t1, -264($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_68 --> -276($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_50 - sw $t1, 12($v0) - li $t1, 13 - sw $t1, 16($v0) - sw $v0, -276($fp) - # ARG local_option_at_CellularAutomaton_internal_68 - # LOCAL local_option_at_CellularAutomaton_internal_68 --> -276($fp) - lw $t1, -276($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_65 --> -264($fp) - # LOCAL local_option_at_CellularAutomaton_internal_66 --> -268($fp) - # local_option_at_CellularAutomaton_internal_66 = VCALL local_option_at_CellularAutomaton_internal_65 out_string - # Save new self pointer in $s1 - lw $s1, -264($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -268($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_71 --> -288($fp) - # local_option_at_CellularAutomaton_internal_71 = SELF - sw $s1, -288($fp) - # LOCAL local_option_at_CellularAutomaton_internal_69 --> -280($fp) - # LOCAL local_option_at_CellularAutomaton_internal_71 --> -288($fp) - # local_option_at_CellularAutomaton_internal_69 = local_option_at_CellularAutomaton_internal_71 - lw $t1, -288($fp) - sw $t1, -280($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_72 --> -292($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_51 - sw $t1, 12($v0) - li $t1, 13 - sw $t1, 16($v0) - sw $v0, -292($fp) - # ARG local_option_at_CellularAutomaton_internal_72 - # LOCAL local_option_at_CellularAutomaton_internal_72 --> -292($fp) - lw $t1, -292($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_69 --> -280($fp) - # LOCAL local_option_at_CellularAutomaton_internal_70 --> -284($fp) - # local_option_at_CellularAutomaton_internal_70 = VCALL local_option_at_CellularAutomaton_internal_69 out_string - # Save new self pointer in $s1 - lw $s1, -280($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -284($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_75 --> -304($fp) - # local_option_at_CellularAutomaton_internal_75 = SELF - sw $s1, -304($fp) - # LOCAL local_option_at_CellularAutomaton_internal_73 --> -296($fp) - # LOCAL local_option_at_CellularAutomaton_internal_75 --> -304($fp) - # local_option_at_CellularAutomaton_internal_73 = local_option_at_CellularAutomaton_internal_75 - lw $t1, -304($fp) - sw $t1, -296($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_76 --> -308($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_52 - sw $t1, 12($v0) - li $t1, 12 - sw $t1, 16($v0) - sw $v0, -308($fp) - # ARG local_option_at_CellularAutomaton_internal_76 - # LOCAL local_option_at_CellularAutomaton_internal_76 --> -308($fp) - lw $t1, -308($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_73 --> -296($fp) - # LOCAL local_option_at_CellularAutomaton_internal_74 --> -300($fp) - # local_option_at_CellularAutomaton_internal_74 = VCALL local_option_at_CellularAutomaton_internal_73 out_string - # Save new self pointer in $s1 - lw $s1, -296($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -300($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_79 --> -320($fp) - # local_option_at_CellularAutomaton_internal_79 = SELF - sw $s1, -320($fp) - # LOCAL local_option_at_CellularAutomaton_internal_77 --> -312($fp) - # LOCAL local_option_at_CellularAutomaton_internal_79 --> -320($fp) - # local_option_at_CellularAutomaton_internal_77 = local_option_at_CellularAutomaton_internal_79 - lw $t1, -320($fp) - sw $t1, -312($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_80 --> -324($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_53 - sw $t1, 12($v0) - li $t1, 13 - sw $t1, 16($v0) - sw $v0, -324($fp) - # ARG local_option_at_CellularAutomaton_internal_80 - # LOCAL local_option_at_CellularAutomaton_internal_80 --> -324($fp) - lw $t1, -324($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_77 --> -312($fp) - # LOCAL local_option_at_CellularAutomaton_internal_78 --> -316($fp) - # local_option_at_CellularAutomaton_internal_78 = VCALL local_option_at_CellularAutomaton_internal_77 out_string - # Save new self pointer in $s1 - lw $s1, -312($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -316($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_83 --> -336($fp) - # local_option_at_CellularAutomaton_internal_83 = SELF - sw $s1, -336($fp) - # LOCAL local_option_at_CellularAutomaton_internal_81 --> -328($fp) - # LOCAL local_option_at_CellularAutomaton_internal_83 --> -336($fp) - # local_option_at_CellularAutomaton_internal_81 = local_option_at_CellularAutomaton_internal_83 - lw $t1, -336($fp) - sw $t1, -328($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_84 --> -340($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_54 - sw $t1, 12($v0) - li $t1, 13 - sw $t1, 16($v0) - sw $v0, -340($fp) - # ARG local_option_at_CellularAutomaton_internal_84 - # LOCAL local_option_at_CellularAutomaton_internal_84 --> -340($fp) - lw $t1, -340($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_81 --> -328($fp) - # LOCAL local_option_at_CellularAutomaton_internal_82 --> -332($fp) - # local_option_at_CellularAutomaton_internal_82 = VCALL local_option_at_CellularAutomaton_internal_81 out_string - # Save new self pointer in $s1 - lw $s1, -328($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -332($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_87 --> -352($fp) - # local_option_at_CellularAutomaton_internal_87 = SELF - sw $s1, -352($fp) - # LOCAL local_option_at_CellularAutomaton_internal_85 --> -344($fp) - # LOCAL local_option_at_CellularAutomaton_internal_87 --> -352($fp) - # local_option_at_CellularAutomaton_internal_85 = local_option_at_CellularAutomaton_internal_87 - lw $t1, -352($fp) - sw $t1, -344($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_88 --> -356($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_55 - sw $t1, 12($v0) - li $t1, 13 - sw $t1, 16($v0) - sw $v0, -356($fp) - # ARG local_option_at_CellularAutomaton_internal_88 - # LOCAL local_option_at_CellularAutomaton_internal_88 --> -356($fp) - lw $t1, -356($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_85 --> -344($fp) - # LOCAL local_option_at_CellularAutomaton_internal_86 --> -348($fp) - # local_option_at_CellularAutomaton_internal_86 = VCALL local_option_at_CellularAutomaton_internal_85 out_string - # Save new self pointer in $s1 - lw $s1, -344($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -348($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_91 --> -368($fp) - # local_option_at_CellularAutomaton_internal_91 = SELF - sw $s1, -368($fp) - # LOCAL local_option_at_CellularAutomaton_internal_89 --> -360($fp) - # LOCAL local_option_at_CellularAutomaton_internal_91 --> -368($fp) - # local_option_at_CellularAutomaton_internal_89 = local_option_at_CellularAutomaton_internal_91 - lw $t1, -368($fp) - sw $t1, -360($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_92 --> -372($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_56 - sw $t1, 12($v0) - li $t1, 15 - sw $t1, 16($v0) - sw $v0, -372($fp) - # ARG local_option_at_CellularAutomaton_internal_92 - # LOCAL local_option_at_CellularAutomaton_internal_92 --> -372($fp) - lw $t1, -372($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_89 --> -360($fp) - # LOCAL local_option_at_CellularAutomaton_internal_90 --> -364($fp) - # local_option_at_CellularAutomaton_internal_90 = VCALL local_option_at_CellularAutomaton_internal_89 out_string - # Save new self pointer in $s1 - lw $s1, -360($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -364($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_95 --> -384($fp) - # local_option_at_CellularAutomaton_internal_95 = SELF - sw $s1, -384($fp) - # LOCAL local_option_at_CellularAutomaton_internal_93 --> -376($fp) - # LOCAL local_option_at_CellularAutomaton_internal_95 --> -384($fp) - # local_option_at_CellularAutomaton_internal_93 = local_option_at_CellularAutomaton_internal_95 - lw $t1, -384($fp) - sw $t1, -376($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_93 --> -376($fp) - # LOCAL local_option_at_CellularAutomaton_internal_94 --> -380($fp) - # local_option_at_CellularAutomaton_internal_94 = VCALL local_option_at_CellularAutomaton_internal_93 in_int - # Save new self pointer in $s1 - lw $s1, -376($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 24($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -380($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_94 --> -380($fp) - # local_option_at_CellularAutomaton_num_0 = local_option_at_CellularAutomaton_internal_94 - lw $t1, -380($fp) - sw $t1, -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_98 --> -396($fp) - # local_option_at_CellularAutomaton_internal_98 = SELF - sw $s1, -396($fp) - # LOCAL local_option_at_CellularAutomaton_internal_96 --> -388($fp) - # LOCAL local_option_at_CellularAutomaton_internal_98 --> -396($fp) - # local_option_at_CellularAutomaton_internal_96 = local_option_at_CellularAutomaton_internal_98 - lw $t1, -396($fp) - sw $t1, -388($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_99 --> -400($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_57 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -400($fp) - # ARG local_option_at_CellularAutomaton_internal_99 - # LOCAL local_option_at_CellularAutomaton_internal_99 --> -400($fp) - lw $t1, -400($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_96 --> -388($fp) - # LOCAL local_option_at_CellularAutomaton_internal_97 --> -392($fp) - # local_option_at_CellularAutomaton_internal_97 = VCALL local_option_at_CellularAutomaton_internal_96 out_string - # Save new self pointer in $s1 - lw $s1, -388($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -392($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_101 --> -408($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_101 = local_option_at_CellularAutomaton_num_0 - 1 - lw $t1, -4($fp) - sub $t1, $t1, 1 - sw $t1, -408($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_101 GOTO label_TRUE_135 - # IF_ZERO local_option_at_CellularAutomaton_internal_101 GOTO label_TRUE_135 - lw $t1, -408($fp) - beq $t1, 0, label_TRUE_135 - # LOCAL local_option_at_CellularAutomaton_internal_101 --> -408($fp) - # local_option_at_CellularAutomaton_internal_101 = 0 - li $t1, 0 - sw $t1, -408($fp) - # GOTO label_END_136 -j label_END_136 -label_TRUE_135: - # LOCAL local_option_at_CellularAutomaton_internal_101 --> -408($fp) - # local_option_at_CellularAutomaton_internal_101 = 1 - li $t1, 1 - sw $t1, -408($fp) - label_END_136: -# IF_ZERO local_option_at_CellularAutomaton_internal_101 GOTO label_FALSEIF_133 -# IF_ZERO local_option_at_CellularAutomaton_internal_101 GOTO label_FALSEIF_133 -lw $t1, -408($fp) -beq $t1, 0, label_FALSEIF_133 -# LOCAL local_option_at_CellularAutomaton_internal_102 --> -412($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_58 -sw $t1, 12($v0) -li $t1, 20 -sw $t1, 16($v0) -sw $v0, -412($fp) -# LOCAL local_option_at_CellularAutomaton_internal_100 --> -404($fp) -# LOCAL local_option_at_CellularAutomaton_internal_102 --> -412($fp) -# local_option_at_CellularAutomaton_internal_100 = local_option_at_CellularAutomaton_internal_102 -lw $t1, -412($fp) -sw $t1, -404($fp) -# GOTO label_ENDIF_134 -j label_ENDIF_134 -label_FALSEIF_133: - # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_104 = local_option_at_CellularAutomaton_num_0 - 2 - lw $t1, -4($fp) - sub $t1, $t1, 2 - sw $t1, -420($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_TRUE_139 - # IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_TRUE_139 - lw $t1, -420($fp) - beq $t1, 0, label_TRUE_139 - # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) - # local_option_at_CellularAutomaton_internal_104 = 0 - li $t1, 0 - sw $t1, -420($fp) - # GOTO label_END_140 -j label_END_140 -label_TRUE_139: - # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) - # local_option_at_CellularAutomaton_internal_104 = 1 - li $t1, 1 - sw $t1, -420($fp) - label_END_140: -# IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_FALSEIF_137 -# IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_FALSEIF_137 -lw $t1, -420($fp) -beq $t1, 0, label_FALSEIF_137 -# LOCAL local_option_at_CellularAutomaton_internal_105 --> -424($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_59 -sw $t1, 12($v0) -li $t1, 25 -sw $t1, 16($v0) -sw $v0, -424($fp) -# LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) -# LOCAL local_option_at_CellularAutomaton_internal_105 --> -424($fp) -# local_option_at_CellularAutomaton_internal_103 = local_option_at_CellularAutomaton_internal_105 -lw $t1, -424($fp) -sw $t1, -416($fp) -# GOTO label_ENDIF_138 -j label_ENDIF_138 -label_FALSEIF_137: - # LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_107 = local_option_at_CellularAutomaton_num_0 - 3 - lw $t1, -4($fp) - sub $t1, $t1, 3 - sw $t1, -432($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_107 GOTO label_TRUE_143 - # IF_ZERO local_option_at_CellularAutomaton_internal_107 GOTO label_TRUE_143 - lw $t1, -432($fp) - beq $t1, 0, label_TRUE_143 - # LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) - # local_option_at_CellularAutomaton_internal_107 = 0 - li $t1, 0 - sw $t1, -432($fp) - # GOTO label_END_144 -j label_END_144 -label_TRUE_143: - # LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) - # local_option_at_CellularAutomaton_internal_107 = 1 - li $t1, 1 - sw $t1, -432($fp) - label_END_144: -# IF_ZERO local_option_at_CellularAutomaton_internal_107 GOTO label_FALSEIF_141 -# IF_ZERO local_option_at_CellularAutomaton_internal_107 GOTO label_FALSEIF_141 -lw $t1, -432($fp) -beq $t1, 0, label_FALSEIF_141 -# LOCAL local_option_at_CellularAutomaton_internal_108 --> -436($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_60 -sw $t1, 12($v0) -li $t1, 25 -sw $t1, 16($v0) -sw $v0, -436($fp) -# LOCAL local_option_at_CellularAutomaton_internal_106 --> -428($fp) -# LOCAL local_option_at_CellularAutomaton_internal_108 --> -436($fp) -# local_option_at_CellularAutomaton_internal_106 = local_option_at_CellularAutomaton_internal_108 -lw $t1, -436($fp) -sw $t1, -428($fp) -# GOTO label_ENDIF_142 -j label_ENDIF_142 -label_FALSEIF_141: - # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_110 = local_option_at_CellularAutomaton_num_0 - 4 - lw $t1, -4($fp) - sub $t1, $t1, 4 - sw $t1, -444($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_TRUE_147 - # IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_TRUE_147 - lw $t1, -444($fp) - beq $t1, 0, label_TRUE_147 - # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) - # local_option_at_CellularAutomaton_internal_110 = 0 - li $t1, 0 - sw $t1, -444($fp) - # GOTO label_END_148 -j label_END_148 -label_TRUE_147: - # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) - # local_option_at_CellularAutomaton_internal_110 = 1 - li $t1, 1 - sw $t1, -444($fp) - label_END_148: -# IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_FALSEIF_145 -# IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_FALSEIF_145 -lw $t1, -444($fp) -beq $t1, 0, label_FALSEIF_145 -# LOCAL local_option_at_CellularAutomaton_internal_111 --> -448($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_61 -sw $t1, 12($v0) -li $t1, 25 -sw $t1, 16($v0) -sw $v0, -448($fp) -# LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) -# LOCAL local_option_at_CellularAutomaton_internal_111 --> -448($fp) -# local_option_at_CellularAutomaton_internal_109 = local_option_at_CellularAutomaton_internal_111 -lw $t1, -448($fp) -sw $t1, -440($fp) -# GOTO label_ENDIF_146 -j label_ENDIF_146 -label_FALSEIF_145: - # LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_113 = local_option_at_CellularAutomaton_num_0 - 5 - lw $t1, -4($fp) - sub $t1, $t1, 5 - sw $t1, -456($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_113 GOTO label_TRUE_151 - # IF_ZERO local_option_at_CellularAutomaton_internal_113 GOTO label_TRUE_151 - lw $t1, -456($fp) - beq $t1, 0, label_TRUE_151 - # LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) - # local_option_at_CellularAutomaton_internal_113 = 0 - li $t1, 0 - sw $t1, -456($fp) - # GOTO label_END_152 -j label_END_152 -label_TRUE_151: - # LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) - # local_option_at_CellularAutomaton_internal_113 = 1 - li $t1, 1 - sw $t1, -456($fp) - label_END_152: -# IF_ZERO local_option_at_CellularAutomaton_internal_113 GOTO label_FALSEIF_149 -# IF_ZERO local_option_at_CellularAutomaton_internal_113 GOTO label_FALSEIF_149 -lw $t1, -456($fp) -beq $t1, 0, label_FALSEIF_149 -# LOCAL local_option_at_CellularAutomaton_internal_114 --> -460($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_62 -sw $t1, 12($v0) -li $t1, 25 -sw $t1, 16($v0) -sw $v0, -460($fp) -# LOCAL local_option_at_CellularAutomaton_internal_112 --> -452($fp) -# LOCAL local_option_at_CellularAutomaton_internal_114 --> -460($fp) -# local_option_at_CellularAutomaton_internal_112 = local_option_at_CellularAutomaton_internal_114 -lw $t1, -460($fp) -sw $t1, -452($fp) -# GOTO label_ENDIF_150 -j label_ENDIF_150 -label_FALSEIF_149: - # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_116 = local_option_at_CellularAutomaton_num_0 - 6 - lw $t1, -4($fp) - sub $t1, $t1, 6 - sw $t1, -468($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_TRUE_155 - # IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_TRUE_155 - lw $t1, -468($fp) - beq $t1, 0, label_TRUE_155 - # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) - # local_option_at_CellularAutomaton_internal_116 = 0 - li $t1, 0 - sw $t1, -468($fp) - # GOTO label_END_156 -j label_END_156 -label_TRUE_155: - # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) - # local_option_at_CellularAutomaton_internal_116 = 1 - li $t1, 1 - sw $t1, -468($fp) - label_END_156: -# IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_FALSEIF_153 -# IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_FALSEIF_153 -lw $t1, -468($fp) -beq $t1, 0, label_FALSEIF_153 -# LOCAL local_option_at_CellularAutomaton_internal_117 --> -472($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_63 -sw $t1, 12($v0) -li $t1, 25 -sw $t1, 16($v0) -sw $v0, -472($fp) -# LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) -# LOCAL local_option_at_CellularAutomaton_internal_117 --> -472($fp) -# local_option_at_CellularAutomaton_internal_115 = local_option_at_CellularAutomaton_internal_117 -lw $t1, -472($fp) -sw $t1, -464($fp) -# GOTO label_ENDIF_154 -j label_ENDIF_154 -label_FALSEIF_153: - # LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_119 = local_option_at_CellularAutomaton_num_0 - 7 - lw $t1, -4($fp) - sub $t1, $t1, 7 - sw $t1, -480($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_119 GOTO label_TRUE_159 - # IF_ZERO local_option_at_CellularAutomaton_internal_119 GOTO label_TRUE_159 - lw $t1, -480($fp) - beq $t1, 0, label_TRUE_159 - # LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) - # local_option_at_CellularAutomaton_internal_119 = 0 - li $t1, 0 - sw $t1, -480($fp) - # GOTO label_END_160 -j label_END_160 -label_TRUE_159: - # LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) - # local_option_at_CellularAutomaton_internal_119 = 1 - li $t1, 1 - sw $t1, -480($fp) - label_END_160: -# IF_ZERO local_option_at_CellularAutomaton_internal_119 GOTO label_FALSEIF_157 -# IF_ZERO local_option_at_CellularAutomaton_internal_119 GOTO label_FALSEIF_157 -lw $t1, -480($fp) -beq $t1, 0, label_FALSEIF_157 -# LOCAL local_option_at_CellularAutomaton_internal_120 --> -484($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_64 -sw $t1, 12($v0) -li $t1, 20 -sw $t1, 16($v0) -sw $v0, -484($fp) -# LOCAL local_option_at_CellularAutomaton_internal_118 --> -476($fp) -# LOCAL local_option_at_CellularAutomaton_internal_120 --> -484($fp) -# local_option_at_CellularAutomaton_internal_118 = local_option_at_CellularAutomaton_internal_120 -lw $t1, -484($fp) -sw $t1, -476($fp) -# GOTO label_ENDIF_158 -j label_ENDIF_158 -label_FALSEIF_157: - # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_122 = local_option_at_CellularAutomaton_num_0 - 8 - lw $t1, -4($fp) - sub $t1, $t1, 8 - sw $t1, -492($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_TRUE_163 - # IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_TRUE_163 - lw $t1, -492($fp) - beq $t1, 0, label_TRUE_163 - # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) - # local_option_at_CellularAutomaton_internal_122 = 0 - li $t1, 0 - sw $t1, -492($fp) - # GOTO label_END_164 -j label_END_164 -label_TRUE_163: - # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) - # local_option_at_CellularAutomaton_internal_122 = 1 - li $t1, 1 - sw $t1, -492($fp) - label_END_164: -# IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_FALSEIF_161 -# IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_FALSEIF_161 -lw $t1, -492($fp) -beq $t1, 0, label_FALSEIF_161 -# LOCAL local_option_at_CellularAutomaton_internal_123 --> -496($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_65 -sw $t1, 12($v0) -li $t1, 20 -sw $t1, 16($v0) -sw $v0, -496($fp) -# LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) -# LOCAL local_option_at_CellularAutomaton_internal_123 --> -496($fp) -# local_option_at_CellularAutomaton_internal_121 = local_option_at_CellularAutomaton_internal_123 -lw $t1, -496($fp) -sw $t1, -488($fp) -# GOTO label_ENDIF_162 -j label_ENDIF_162 -label_FALSEIF_161: - # LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_125 = local_option_at_CellularAutomaton_num_0 - 9 - lw $t1, -4($fp) - sub $t1, $t1, 9 - sw $t1, -504($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_125 GOTO label_TRUE_167 - # IF_ZERO local_option_at_CellularAutomaton_internal_125 GOTO label_TRUE_167 - lw $t1, -504($fp) - beq $t1, 0, label_TRUE_167 - # LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) - # local_option_at_CellularAutomaton_internal_125 = 0 - li $t1, 0 - sw $t1, -504($fp) - # GOTO label_END_168 -j label_END_168 -label_TRUE_167: - # LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) - # local_option_at_CellularAutomaton_internal_125 = 1 - li $t1, 1 - sw $t1, -504($fp) - label_END_168: -# IF_ZERO local_option_at_CellularAutomaton_internal_125 GOTO label_FALSEIF_165 -# IF_ZERO local_option_at_CellularAutomaton_internal_125 GOTO label_FALSEIF_165 -lw $t1, -504($fp) -beq $t1, 0, label_FALSEIF_165 -# LOCAL local_option_at_CellularAutomaton_internal_126 --> -508($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_66 -sw $t1, 12($v0) -li $t1, 15 -sw $t1, 16($v0) -sw $v0, -508($fp) -# LOCAL local_option_at_CellularAutomaton_internal_124 --> -500($fp) -# LOCAL local_option_at_CellularAutomaton_internal_126 --> -508($fp) -# local_option_at_CellularAutomaton_internal_124 = local_option_at_CellularAutomaton_internal_126 -lw $t1, -508($fp) -sw $t1, -500($fp) -# GOTO label_ENDIF_166 -j label_ENDIF_166 -label_FALSEIF_165: - # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_128 = local_option_at_CellularAutomaton_num_0 - 10 - lw $t1, -4($fp) - sub $t1, $t1, 10 - sw $t1, -516($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_TRUE_171 - # IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_TRUE_171 - lw $t1, -516($fp) - beq $t1, 0, label_TRUE_171 - # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) - # local_option_at_CellularAutomaton_internal_128 = 0 - li $t1, 0 - sw $t1, -516($fp) - # GOTO label_END_172 -j label_END_172 -label_TRUE_171: - # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) - # local_option_at_CellularAutomaton_internal_128 = 1 - li $t1, 1 - sw $t1, -516($fp) - label_END_172: -# IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_FALSEIF_169 -# IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_FALSEIF_169 -lw $t1, -516($fp) -beq $t1, 0, label_FALSEIF_169 -# LOCAL local_option_at_CellularAutomaton_internal_129 --> -520($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_67 -sw $t1, 12($v0) -li $t1, 15 -sw $t1, 16($v0) -sw $v0, -520($fp) -# LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) -# LOCAL local_option_at_CellularAutomaton_internal_129 --> -520($fp) -# local_option_at_CellularAutomaton_internal_127 = local_option_at_CellularAutomaton_internal_129 -lw $t1, -520($fp) -sw $t1, -512($fp) -# GOTO label_ENDIF_170 -j label_ENDIF_170 -label_FALSEIF_169: - # LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_131 = local_option_at_CellularAutomaton_num_0 - 11 - lw $t1, -4($fp) - sub $t1, $t1, 11 - sw $t1, -528($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_131 GOTO label_TRUE_175 - # IF_ZERO local_option_at_CellularAutomaton_internal_131 GOTO label_TRUE_175 - lw $t1, -528($fp) - beq $t1, 0, label_TRUE_175 - # LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) - # local_option_at_CellularAutomaton_internal_131 = 0 - li $t1, 0 - sw $t1, -528($fp) - # GOTO label_END_176 -j label_END_176 -label_TRUE_175: - # LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) - # local_option_at_CellularAutomaton_internal_131 = 1 - li $t1, 1 - sw $t1, -528($fp) - label_END_176: -# IF_ZERO local_option_at_CellularAutomaton_internal_131 GOTO label_FALSEIF_173 -# IF_ZERO local_option_at_CellularAutomaton_internal_131 GOTO label_FALSEIF_173 -lw $t1, -528($fp) -beq $t1, 0, label_FALSEIF_173 -# LOCAL local_option_at_CellularAutomaton_internal_132 --> -532($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_68 -sw $t1, 12($v0) -li $t1, 15 -sw $t1, 16($v0) -sw $v0, -532($fp) -# LOCAL local_option_at_CellularAutomaton_internal_130 --> -524($fp) -# LOCAL local_option_at_CellularAutomaton_internal_132 --> -532($fp) -# local_option_at_CellularAutomaton_internal_130 = local_option_at_CellularAutomaton_internal_132 -lw $t1, -532($fp) -sw $t1, -524($fp) -# GOTO label_ENDIF_174 -j label_ENDIF_174 -label_FALSEIF_173: - # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_134 = local_option_at_CellularAutomaton_num_0 - 12 - lw $t1, -4($fp) - sub $t1, $t1, 12 - sw $t1, -540($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_TRUE_179 - # IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_TRUE_179 - lw $t1, -540($fp) - beq $t1, 0, label_TRUE_179 - # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) - # local_option_at_CellularAutomaton_internal_134 = 0 - li $t1, 0 - sw $t1, -540($fp) - # GOTO label_END_180 -j label_END_180 -label_TRUE_179: - # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) - # local_option_at_CellularAutomaton_internal_134 = 1 - li $t1, 1 - sw $t1, -540($fp) - label_END_180: -# IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_FALSEIF_177 -# IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_FALSEIF_177 -lw $t1, -540($fp) -beq $t1, 0, label_FALSEIF_177 -# LOCAL local_option_at_CellularAutomaton_internal_135 --> -544($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_69 -sw $t1, 12($v0) -li $t1, 25 -sw $t1, 16($v0) -sw $v0, -544($fp) -# LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) -# LOCAL local_option_at_CellularAutomaton_internal_135 --> -544($fp) -# local_option_at_CellularAutomaton_internal_133 = local_option_at_CellularAutomaton_internal_135 -lw $t1, -544($fp) -sw $t1, -536($fp) -# GOTO label_ENDIF_178 -j label_ENDIF_178 -label_FALSEIF_177: - # LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_137 = local_option_at_CellularAutomaton_num_0 - 13 - lw $t1, -4($fp) - sub $t1, $t1, 13 - sw $t1, -552($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_137 GOTO label_TRUE_183 - # IF_ZERO local_option_at_CellularAutomaton_internal_137 GOTO label_TRUE_183 - lw $t1, -552($fp) - beq $t1, 0, label_TRUE_183 - # LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) - # local_option_at_CellularAutomaton_internal_137 = 0 - li $t1, 0 - sw $t1, -552($fp) - # GOTO label_END_184 -j label_END_184 -label_TRUE_183: - # LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) - # local_option_at_CellularAutomaton_internal_137 = 1 - li $t1, 1 - sw $t1, -552($fp) - label_END_184: -# IF_ZERO local_option_at_CellularAutomaton_internal_137 GOTO label_FALSEIF_181 -# IF_ZERO local_option_at_CellularAutomaton_internal_137 GOTO label_FALSEIF_181 -lw $t1, -552($fp) -beq $t1, 0, label_FALSEIF_181 -# LOCAL local_option_at_CellularAutomaton_internal_138 --> -556($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_70 -sw $t1, 12($v0) -li $t1, 25 -sw $t1, 16($v0) -sw $v0, -556($fp) -# LOCAL local_option_at_CellularAutomaton_internal_136 --> -548($fp) -# LOCAL local_option_at_CellularAutomaton_internal_138 --> -556($fp) -# local_option_at_CellularAutomaton_internal_136 = local_option_at_CellularAutomaton_internal_138 -lw $t1, -556($fp) -sw $t1, -548($fp) -# GOTO label_ENDIF_182 -j label_ENDIF_182 -label_FALSEIF_181: - # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_140 = local_option_at_CellularAutomaton_num_0 - 14 - lw $t1, -4($fp) - sub $t1, $t1, 14 - sw $t1, -564($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_TRUE_187 - # IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_TRUE_187 - lw $t1, -564($fp) - beq $t1, 0, label_TRUE_187 - # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) - # local_option_at_CellularAutomaton_internal_140 = 0 - li $t1, 0 - sw $t1, -564($fp) - # GOTO label_END_188 -j label_END_188 -label_TRUE_187: - # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) - # local_option_at_CellularAutomaton_internal_140 = 1 - li $t1, 1 - sw $t1, -564($fp) - label_END_188: -# IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_FALSEIF_185 -# IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_FALSEIF_185 -lw $t1, -564($fp) -beq $t1, 0, label_FALSEIF_185 -# LOCAL local_option_at_CellularAutomaton_internal_141 --> -568($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_71 -sw $t1, 12($v0) -li $t1, 25 -sw $t1, 16($v0) -sw $v0, -568($fp) -# LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) -# LOCAL local_option_at_CellularAutomaton_internal_141 --> -568($fp) -# local_option_at_CellularAutomaton_internal_139 = local_option_at_CellularAutomaton_internal_141 -lw $t1, -568($fp) -sw $t1, -560($fp) -# GOTO label_ENDIF_186 -j label_ENDIF_186 -label_FALSEIF_185: - # LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_143 = local_option_at_CellularAutomaton_num_0 - 15 - lw $t1, -4($fp) - sub $t1, $t1, 15 - sw $t1, -576($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_143 GOTO label_TRUE_191 - # IF_ZERO local_option_at_CellularAutomaton_internal_143 GOTO label_TRUE_191 - lw $t1, -576($fp) - beq $t1, 0, label_TRUE_191 - # LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) - # local_option_at_CellularAutomaton_internal_143 = 0 - li $t1, 0 - sw $t1, -576($fp) - # GOTO label_END_192 -j label_END_192 -label_TRUE_191: - # LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) - # local_option_at_CellularAutomaton_internal_143 = 1 - li $t1, 1 - sw $t1, -576($fp) - label_END_192: -# IF_ZERO local_option_at_CellularAutomaton_internal_143 GOTO label_FALSEIF_189 -# IF_ZERO local_option_at_CellularAutomaton_internal_143 GOTO label_FALSEIF_189 -lw $t1, -576($fp) -beq $t1, 0, label_FALSEIF_189 -# LOCAL local_option_at_CellularAutomaton_internal_144 --> -580($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_72 -sw $t1, 12($v0) -li $t1, 21 -sw $t1, 16($v0) -sw $v0, -580($fp) -# LOCAL local_option_at_CellularAutomaton_internal_142 --> -572($fp) -# LOCAL local_option_at_CellularAutomaton_internal_144 --> -580($fp) -# local_option_at_CellularAutomaton_internal_142 = local_option_at_CellularAutomaton_internal_144 -lw $t1, -580($fp) -sw $t1, -572($fp) -# GOTO label_ENDIF_190 -j label_ENDIF_190 -label_FALSEIF_189: - # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_146 = local_option_at_CellularAutomaton_num_0 - 16 - lw $t1, -4($fp) - sub $t1, $t1, 16 - sw $t1, -588($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_TRUE_195 - # IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_TRUE_195 - lw $t1, -588($fp) - beq $t1, 0, label_TRUE_195 - # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) - # local_option_at_CellularAutomaton_internal_146 = 0 - li $t1, 0 - sw $t1, -588($fp) - # GOTO label_END_196 -j label_END_196 -label_TRUE_195: - # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) - # local_option_at_CellularAutomaton_internal_146 = 1 - li $t1, 1 - sw $t1, -588($fp) - label_END_196: -# IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_FALSEIF_193 -# IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_FALSEIF_193 -lw $t1, -588($fp) -beq $t1, 0, label_FALSEIF_193 -# LOCAL local_option_at_CellularAutomaton_internal_147 --> -592($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_73 -sw $t1, 12($v0) -li $t1, 21 -sw $t1, 16($v0) -sw $v0, -592($fp) -# LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) -# LOCAL local_option_at_CellularAutomaton_internal_147 --> -592($fp) -# local_option_at_CellularAutomaton_internal_145 = local_option_at_CellularAutomaton_internal_147 -lw $t1, -592($fp) -sw $t1, -584($fp) -# GOTO label_ENDIF_194 -j label_ENDIF_194 -label_FALSEIF_193: - # LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_149 = local_option_at_CellularAutomaton_num_0 - 17 - lw $t1, -4($fp) - sub $t1, $t1, 17 - sw $t1, -600($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_149 GOTO label_TRUE_199 - # IF_ZERO local_option_at_CellularAutomaton_internal_149 GOTO label_TRUE_199 - lw $t1, -600($fp) - beq $t1, 0, label_TRUE_199 - # LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) - # local_option_at_CellularAutomaton_internal_149 = 0 - li $t1, 0 - sw $t1, -600($fp) - # GOTO label_END_200 -j label_END_200 -label_TRUE_199: - # LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) - # local_option_at_CellularAutomaton_internal_149 = 1 - li $t1, 1 - sw $t1, -600($fp) - label_END_200: -# IF_ZERO local_option_at_CellularAutomaton_internal_149 GOTO label_FALSEIF_197 -# IF_ZERO local_option_at_CellularAutomaton_internal_149 GOTO label_FALSEIF_197 -lw $t1, -600($fp) -beq $t1, 0, label_FALSEIF_197 -# LOCAL local_option_at_CellularAutomaton_internal_150 --> -604($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_74 -sw $t1, 12($v0) -li $t1, 28 -sw $t1, 16($v0) -sw $v0, -604($fp) -# LOCAL local_option_at_CellularAutomaton_internal_148 --> -596($fp) -# LOCAL local_option_at_CellularAutomaton_internal_150 --> -604($fp) -# local_option_at_CellularAutomaton_internal_148 = local_option_at_CellularAutomaton_internal_150 -lw $t1, -604($fp) -sw $t1, -596($fp) -# GOTO label_ENDIF_198 -j label_ENDIF_198 -label_FALSEIF_197: - # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_152 = local_option_at_CellularAutomaton_num_0 - 18 - lw $t1, -4($fp) - sub $t1, $t1, 18 - sw $t1, -612($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_TRUE_203 - # IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_TRUE_203 - lw $t1, -612($fp) - beq $t1, 0, label_TRUE_203 - # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) - # local_option_at_CellularAutomaton_internal_152 = 0 - li $t1, 0 - sw $t1, -612($fp) - # GOTO label_END_204 -j label_END_204 -label_TRUE_203: - # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) - # local_option_at_CellularAutomaton_internal_152 = 1 - li $t1, 1 - sw $t1, -612($fp) - label_END_204: -# IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_FALSEIF_201 -# IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_FALSEIF_201 -lw $t1, -612($fp) -beq $t1, 0, label_FALSEIF_201 -# LOCAL local_option_at_CellularAutomaton_internal_153 --> -616($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_75 -sw $t1, 12($v0) -li $t1, 28 -sw $t1, 16($v0) -sw $v0, -616($fp) -# LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) -# LOCAL local_option_at_CellularAutomaton_internal_153 --> -616($fp) -# local_option_at_CellularAutomaton_internal_151 = local_option_at_CellularAutomaton_internal_153 -lw $t1, -616($fp) -sw $t1, -608($fp) -# GOTO label_ENDIF_202 -j label_ENDIF_202 -label_FALSEIF_201: - # LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_155 = local_option_at_CellularAutomaton_num_0 - 19 - lw $t1, -4($fp) - sub $t1, $t1, 19 - sw $t1, -624($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_155 GOTO label_TRUE_207 - # IF_ZERO local_option_at_CellularAutomaton_internal_155 GOTO label_TRUE_207 - lw $t1, -624($fp) - beq $t1, 0, label_TRUE_207 - # LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) - # local_option_at_CellularAutomaton_internal_155 = 0 - li $t1, 0 - sw $t1, -624($fp) - # GOTO label_END_208 -j label_END_208 -label_TRUE_207: - # LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) - # local_option_at_CellularAutomaton_internal_155 = 1 - li $t1, 1 - sw $t1, -624($fp) - label_END_208: -# IF_ZERO local_option_at_CellularAutomaton_internal_155 GOTO label_FALSEIF_205 -# IF_ZERO local_option_at_CellularAutomaton_internal_155 GOTO label_FALSEIF_205 -lw $t1, -624($fp) -beq $t1, 0, label_FALSEIF_205 -# LOCAL local_option_at_CellularAutomaton_internal_156 --> -628($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_76 -sw $t1, 12($v0) -li $t1, 16 -sw $t1, 16($v0) -sw $v0, -628($fp) -# LOCAL local_option_at_CellularAutomaton_internal_154 --> -620($fp) -# LOCAL local_option_at_CellularAutomaton_internal_156 --> -628($fp) -# local_option_at_CellularAutomaton_internal_154 = local_option_at_CellularAutomaton_internal_156 -lw $t1, -628($fp) -sw $t1, -620($fp) -# GOTO label_ENDIF_206 -j label_ENDIF_206 -label_FALSEIF_205: - # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_158 = local_option_at_CellularAutomaton_num_0 - 20 - lw $t1, -4($fp) - sub $t1, $t1, 20 - sw $t1, -636($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_TRUE_211 - # IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_TRUE_211 - lw $t1, -636($fp) - beq $t1, 0, label_TRUE_211 - # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) - # local_option_at_CellularAutomaton_internal_158 = 0 - li $t1, 0 - sw $t1, -636($fp) - # GOTO label_END_212 -j label_END_212 -label_TRUE_211: - # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) - # local_option_at_CellularAutomaton_internal_158 = 1 - li $t1, 1 - sw $t1, -636($fp) - label_END_212: -# IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_FALSEIF_209 -# IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_FALSEIF_209 -lw $t1, -636($fp) -beq $t1, 0, label_FALSEIF_209 -# LOCAL local_option_at_CellularAutomaton_internal_159 --> -640($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_77 -sw $t1, 12($v0) -li $t1, 28 -sw $t1, 16($v0) -sw $v0, -640($fp) -# LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) -# LOCAL local_option_at_CellularAutomaton_internal_159 --> -640($fp) -# local_option_at_CellularAutomaton_internal_157 = local_option_at_CellularAutomaton_internal_159 -lw $t1, -640($fp) -sw $t1, -632($fp) -# GOTO label_ENDIF_210 -j label_ENDIF_210 -label_FALSEIF_209: - # LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # local_option_at_CellularAutomaton_internal_161 = local_option_at_CellularAutomaton_num_0 - 21 - lw $t1, -4($fp) - sub $t1, $t1, 21 - sw $t1, -648($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_161 GOTO label_TRUE_215 - # IF_ZERO local_option_at_CellularAutomaton_internal_161 GOTO label_TRUE_215 - lw $t1, -648($fp) - beq $t1, 0, label_TRUE_215 - # LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) - # local_option_at_CellularAutomaton_internal_161 = 0 - li $t1, 0 - sw $t1, -648($fp) - # GOTO label_END_216 -j label_END_216 -label_TRUE_215: - # LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) - # local_option_at_CellularAutomaton_internal_161 = 1 - li $t1, 1 - sw $t1, -648($fp) - label_END_216: -# IF_ZERO local_option_at_CellularAutomaton_internal_161 GOTO label_FALSEIF_213 -# IF_ZERO local_option_at_CellularAutomaton_internal_161 GOTO label_FALSEIF_213 -lw $t1, -648($fp) -beq $t1, 0, label_FALSEIF_213 -# LOCAL local_option_at_CellularAutomaton_internal_162 --> -652($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, data_78 -sw $t1, 12($v0) -li $t1, 28 -sw $t1, 16($v0) -sw $v0, -652($fp) -# LOCAL local_option_at_CellularAutomaton_internal_160 --> -644($fp) -# LOCAL local_option_at_CellularAutomaton_internal_162 --> -652($fp) -# local_option_at_CellularAutomaton_internal_160 = local_option_at_CellularAutomaton_internal_162 -lw $t1, -652($fp) -sw $t1, -644($fp) -# GOTO label_ENDIF_214 -j label_ENDIF_214 -label_FALSEIF_213: - # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_79 - sw $t1, 12($v0) - li $t1, 25 - sw $t1, 16($v0) - sw $v0, -656($fp) - # LOCAL local_option_at_CellularAutomaton_internal_160 --> -644($fp) - # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) - # local_option_at_CellularAutomaton_internal_160 = local_option_at_CellularAutomaton_internal_163 - lw $t1, -656($fp) - sw $t1, -644($fp) - label_ENDIF_214: -# LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) -# LOCAL local_option_at_CellularAutomaton_internal_160 --> -644($fp) -# local_option_at_CellularAutomaton_internal_157 = local_option_at_CellularAutomaton_internal_160 -lw $t1, -644($fp) -sw $t1, -632($fp) -label_ENDIF_210: -# LOCAL local_option_at_CellularAutomaton_internal_154 --> -620($fp) -# LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) -# local_option_at_CellularAutomaton_internal_154 = local_option_at_CellularAutomaton_internal_157 -lw $t1, -632($fp) -sw $t1, -620($fp) -label_ENDIF_206: -# LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) -# LOCAL local_option_at_CellularAutomaton_internal_154 --> -620($fp) -# local_option_at_CellularAutomaton_internal_151 = local_option_at_CellularAutomaton_internal_154 -lw $t1, -620($fp) -sw $t1, -608($fp) -label_ENDIF_202: -# LOCAL local_option_at_CellularAutomaton_internal_148 --> -596($fp) -# LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) -# local_option_at_CellularAutomaton_internal_148 = local_option_at_CellularAutomaton_internal_151 -lw $t1, -608($fp) -sw $t1, -596($fp) -label_ENDIF_198: -# LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) -# LOCAL local_option_at_CellularAutomaton_internal_148 --> -596($fp) -# local_option_at_CellularAutomaton_internal_145 = local_option_at_CellularAutomaton_internal_148 -lw $t1, -596($fp) -sw $t1, -584($fp) -label_ENDIF_194: -# LOCAL local_option_at_CellularAutomaton_internal_142 --> -572($fp) -# LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) -# local_option_at_CellularAutomaton_internal_142 = local_option_at_CellularAutomaton_internal_145 -lw $t1, -584($fp) -sw $t1, -572($fp) -label_ENDIF_190: -# LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) -# LOCAL local_option_at_CellularAutomaton_internal_142 --> -572($fp) -# local_option_at_CellularAutomaton_internal_139 = local_option_at_CellularAutomaton_internal_142 -lw $t1, -572($fp) -sw $t1, -560($fp) -label_ENDIF_186: -# LOCAL local_option_at_CellularAutomaton_internal_136 --> -548($fp) -# LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) -# local_option_at_CellularAutomaton_internal_136 = local_option_at_CellularAutomaton_internal_139 -lw $t1, -560($fp) -sw $t1, -548($fp) -label_ENDIF_182: -# LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) -# LOCAL local_option_at_CellularAutomaton_internal_136 --> -548($fp) -# local_option_at_CellularAutomaton_internal_133 = local_option_at_CellularAutomaton_internal_136 -lw $t1, -548($fp) -sw $t1, -536($fp) -label_ENDIF_178: -# LOCAL local_option_at_CellularAutomaton_internal_130 --> -524($fp) -# LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) -# local_option_at_CellularAutomaton_internal_130 = local_option_at_CellularAutomaton_internal_133 -lw $t1, -536($fp) -sw $t1, -524($fp) -label_ENDIF_174: -# LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) -# LOCAL local_option_at_CellularAutomaton_internal_130 --> -524($fp) -# local_option_at_CellularAutomaton_internal_127 = local_option_at_CellularAutomaton_internal_130 -lw $t1, -524($fp) -sw $t1, -512($fp) -label_ENDIF_170: -# LOCAL local_option_at_CellularAutomaton_internal_124 --> -500($fp) -# LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) -# local_option_at_CellularAutomaton_internal_124 = local_option_at_CellularAutomaton_internal_127 -lw $t1, -512($fp) -sw $t1, -500($fp) -label_ENDIF_166: -# LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) -# LOCAL local_option_at_CellularAutomaton_internal_124 --> -500($fp) -# local_option_at_CellularAutomaton_internal_121 = local_option_at_CellularAutomaton_internal_124 -lw $t1, -500($fp) -sw $t1, -488($fp) -label_ENDIF_162: -# LOCAL local_option_at_CellularAutomaton_internal_118 --> -476($fp) -# LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) -# local_option_at_CellularAutomaton_internal_118 = local_option_at_CellularAutomaton_internal_121 -lw $t1, -488($fp) -sw $t1, -476($fp) -label_ENDIF_158: -# LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) -# LOCAL local_option_at_CellularAutomaton_internal_118 --> -476($fp) -# local_option_at_CellularAutomaton_internal_115 = local_option_at_CellularAutomaton_internal_118 -lw $t1, -476($fp) -sw $t1, -464($fp) -label_ENDIF_154: -# LOCAL local_option_at_CellularAutomaton_internal_112 --> -452($fp) -# LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) -# local_option_at_CellularAutomaton_internal_112 = local_option_at_CellularAutomaton_internal_115 -lw $t1, -464($fp) -sw $t1, -452($fp) -label_ENDIF_150: -# LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) -# LOCAL local_option_at_CellularAutomaton_internal_112 --> -452($fp) -# local_option_at_CellularAutomaton_internal_109 = local_option_at_CellularAutomaton_internal_112 -lw $t1, -452($fp) -sw $t1, -440($fp) -label_ENDIF_146: -# LOCAL local_option_at_CellularAutomaton_internal_106 --> -428($fp) -# LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) -# local_option_at_CellularAutomaton_internal_106 = local_option_at_CellularAutomaton_internal_109 -lw $t1, -440($fp) -sw $t1, -428($fp) -label_ENDIF_142: -# LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) -# LOCAL local_option_at_CellularAutomaton_internal_106 --> -428($fp) -# local_option_at_CellularAutomaton_internal_103 = local_option_at_CellularAutomaton_internal_106 -lw $t1, -428($fp) -sw $t1, -416($fp) -label_ENDIF_138: -# LOCAL local_option_at_CellularAutomaton_internal_100 --> -404($fp) -# LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) -# local_option_at_CellularAutomaton_internal_100 = local_option_at_CellularAutomaton_internal_103 -lw $t1, -416($fp) -sw $t1, -404($fp) -label_ENDIF_134: -# RETURN local_option_at_CellularAutomaton_internal_100 -lw $v0, -404($fp) -# Deallocate stack frame for function function_option_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 664 -jr $ra -# Function END - - -# function_prompt_at_CellularAutomaton implementation. -# @Params: -function_prompt_at_CellularAutomaton: - # Allocate stack frame for function function_prompt_at_CellularAutomaton. - subu $sp, $sp, 92 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 92 - # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_0 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -4($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_3 --> -16($fp) - # local_prompt_at_CellularAutomaton_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_3 --> -16($fp) - # local_prompt_at_CellularAutomaton_internal_1 = local_prompt_at_CellularAutomaton_internal_3 - lw $t1, -16($fp) - sw $t1, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_80 - sw $t1, 12($v0) - li $t1, 54 - sw $t1, 16($v0) - sw $v0, -20($fp) - # ARG local_prompt_at_CellularAutomaton_internal_4 - # LOCAL local_prompt_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t1, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_2 --> -12($fp) - # local_prompt_at_CellularAutomaton_internal_2 = VCALL local_prompt_at_CellularAutomaton_internal_1 out_string - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt_at_CellularAutomaton_internal_7 --> -32($fp) - # local_prompt_at_CellularAutomaton_internal_7 = SELF - sw $s1, -32($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_7 --> -32($fp) - # local_prompt_at_CellularAutomaton_internal_5 = local_prompt_at_CellularAutomaton_internal_7 - lw $t1, -32($fp) - sw $t1, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_81 - sw $t1, 12($v0) - li $t1, 49 - sw $t1, 16($v0) - sw $v0, -36($fp) - # ARG local_prompt_at_CellularAutomaton_internal_8 - # LOCAL local_prompt_at_CellularAutomaton_internal_8 --> -36($fp) - lw $t1, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_6 --> -28($fp) - # local_prompt_at_CellularAutomaton_internal_6 = VCALL local_prompt_at_CellularAutomaton_internal_5 out_string - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt_at_CellularAutomaton_internal_11 --> -48($fp) - # local_prompt_at_CellularAutomaton_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_11 --> -48($fp) - # local_prompt_at_CellularAutomaton_internal_9 = local_prompt_at_CellularAutomaton_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_10 --> -44($fp) - # local_prompt_at_CellularAutomaton_internal_10 = VCALL local_prompt_at_CellularAutomaton_internal_9 in_string - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_10 --> -44($fp) - # local_prompt_at_CellularAutomaton_ans_0 = local_prompt_at_CellularAutomaton_internal_10 - lw $t1, -44($fp) - sw $t1, -4($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_14 --> -60($fp) - # local_prompt_at_CellularAutomaton_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_14 --> -60($fp) - # local_prompt_at_CellularAutomaton_internal_12 = local_prompt_at_CellularAutomaton_internal_14 - lw $t1, -60($fp) - sw $t1, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_82 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -64($fp) - # ARG local_prompt_at_CellularAutomaton_internal_15 - # LOCAL local_prompt_at_CellularAutomaton_internal_15 --> -64($fp) - lw $t1, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_13 --> -56($fp) - # local_prompt_at_CellularAutomaton_internal_13 = VCALL local_prompt_at_CellularAutomaton_internal_12 out_string - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt_at_CellularAutomaton_internal_18 --> -76($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_83 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -76($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_17 --> -72($fp) - # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_18 --> -76($fp) - # local_prompt_at_CellularAutomaton_internal_17 = local_prompt_at_CellularAutomaton_ans_0 - local_prompt_at_CellularAutomaton_internal_18 - lw $t1, -4($fp) - lw $t2, -76($fp) - sub $t1, $t1, $t2 - sw $t1, -72($fp) - # IF_ZERO local_prompt_at_CellularAutomaton_internal_17 GOTO label_TRUE_219 - # IF_ZERO local_prompt_at_CellularAutomaton_internal_17 GOTO label_TRUE_219 - lw $t1, -72($fp) - beq $t1, 0, label_TRUE_219 - # LOCAL local_prompt_at_CellularAutomaton_internal_17 --> -72($fp) - # local_prompt_at_CellularAutomaton_internal_17 = 0 - li $t1, 0 - sw $t1, -72($fp) - # GOTO label_END_220 -j label_END_220 -label_TRUE_219: - # LOCAL local_prompt_at_CellularAutomaton_internal_17 --> -72($fp) - # local_prompt_at_CellularAutomaton_internal_17 = 1 - li $t1, 1 - sw $t1, -72($fp) - label_END_220: -# IF_ZERO local_prompt_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_217 -# IF_ZERO local_prompt_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_217 -lw $t1, -72($fp) -beq $t1, 0, label_FALSEIF_217 -# LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) -# local_prompt_at_CellularAutomaton_internal_19 = 0 -li $t1, 0 -sw $t1, -80($fp) -# LOCAL local_prompt_at_CellularAutomaton_internal_16 --> -68($fp) -# LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) -# local_prompt_at_CellularAutomaton_internal_16 = local_prompt_at_CellularAutomaton_internal_19 -lw $t1, -80($fp) -sw $t1, -68($fp) -# GOTO label_ENDIF_218 -j label_ENDIF_218 -label_FALSEIF_217: - # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) - # local_prompt_at_CellularAutomaton_internal_20 = 1 - li $t1, 1 - sw $t1, -84($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_16 --> -68($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) - # local_prompt_at_CellularAutomaton_internal_16 = local_prompt_at_CellularAutomaton_internal_20 - lw $t1, -84($fp) - sw $t1, -68($fp) - label_ENDIF_218: -# RETURN local_prompt_at_CellularAutomaton_internal_16 -lw $v0, -68($fp) -# Deallocate stack frame for function function_prompt_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 92 -jr $ra -# Function END - - -# function_prompt2_at_CellularAutomaton implementation. -# @Params: -function_prompt2_at_CellularAutomaton: - # Allocate stack frame for function function_prompt2_at_CellularAutomaton. - subu $sp, $sp, 92 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 92 - # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_0 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -4($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_3 --> -16($fp) - # local_prompt2_at_CellularAutomaton_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_3 --> -16($fp) - # local_prompt2_at_CellularAutomaton_internal_1 = local_prompt2_at_CellularAutomaton_internal_3 - lw $t1, -16($fp) - sw $t1, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_84 - sw $t1, 12($v0) - li $t1, 2 - sw $t1, 16($v0) - sw $v0, -20($fp) - # ARG local_prompt2_at_CellularAutomaton_internal_4 - # LOCAL local_prompt2_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t1, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_2 --> -12($fp) - # local_prompt2_at_CellularAutomaton_internal_2 = VCALL local_prompt2_at_CellularAutomaton_internal_1 out_string - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt2_at_CellularAutomaton_internal_7 --> -32($fp) - # local_prompt2_at_CellularAutomaton_internal_7 = SELF - sw $s1, -32($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_7 --> -32($fp) - # local_prompt2_at_CellularAutomaton_internal_5 = local_prompt2_at_CellularAutomaton_internal_7 - lw $t1, -32($fp) - sw $t1, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_85 - sw $t1, 12($v0) - li $t1, 48 - sw $t1, 16($v0) - sw $v0, -36($fp) - # ARG local_prompt2_at_CellularAutomaton_internal_8 - # LOCAL local_prompt2_at_CellularAutomaton_internal_8 --> -36($fp) - lw $t1, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_6 --> -28($fp) - # local_prompt2_at_CellularAutomaton_internal_6 = VCALL local_prompt2_at_CellularAutomaton_internal_5 out_string - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt2_at_CellularAutomaton_internal_11 --> -48($fp) - # local_prompt2_at_CellularAutomaton_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_11 --> -48($fp) - # local_prompt2_at_CellularAutomaton_internal_9 = local_prompt2_at_CellularAutomaton_internal_11 - lw $t1, -48($fp) - sw $t1, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_12 --> -52($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_86 - sw $t1, 12($v0) - li $t1, 49 - sw $t1, 16($v0) - sw $v0, -52($fp) - # ARG local_prompt2_at_CellularAutomaton_internal_12 - # LOCAL local_prompt2_at_CellularAutomaton_internal_12 --> -52($fp) - lw $t1, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_10 --> -44($fp) - # local_prompt2_at_CellularAutomaton_internal_10 = VCALL local_prompt2_at_CellularAutomaton_internal_9 out_string - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt2_at_CellularAutomaton_internal_15 --> -64($fp) - # local_prompt2_at_CellularAutomaton_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_15 --> -64($fp) - # local_prompt2_at_CellularAutomaton_internal_13 = local_prompt2_at_CellularAutomaton_internal_15 - lw $t1, -64($fp) - sw $t1, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_14 --> -60($fp) - # local_prompt2_at_CellularAutomaton_internal_14 = VCALL local_prompt2_at_CellularAutomaton_internal_13 in_string - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_14 --> -60($fp) - # local_prompt2_at_CellularAutomaton_ans_0 = local_prompt2_at_CellularAutomaton_internal_14 - lw $t1, -60($fp) - sw $t1, -4($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_18 --> -76($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_87 - sw $t1, 12($v0) - li $t1, 1 - sw $t1, 16($v0) - sw $v0, -76($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_17 --> -72($fp) - # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_18 --> -76($fp) - # local_prompt2_at_CellularAutomaton_internal_17 = local_prompt2_at_CellularAutomaton_ans_0 - local_prompt2_at_CellularAutomaton_internal_18 - lw $t1, -4($fp) - lw $t2, -76($fp) - sub $t1, $t1, $t2 - sw $t1, -72($fp) - # IF_ZERO local_prompt2_at_CellularAutomaton_internal_17 GOTO label_TRUE_223 - # IF_ZERO local_prompt2_at_CellularAutomaton_internal_17 GOTO label_TRUE_223 - lw $t1, -72($fp) - beq $t1, 0, label_TRUE_223 - # LOCAL local_prompt2_at_CellularAutomaton_internal_17 --> -72($fp) - # local_prompt2_at_CellularAutomaton_internal_17 = 0 - li $t1, 0 - sw $t1, -72($fp) - # GOTO label_END_224 -j label_END_224 -label_TRUE_223: - # LOCAL local_prompt2_at_CellularAutomaton_internal_17 --> -72($fp) - # local_prompt2_at_CellularAutomaton_internal_17 = 1 - li $t1, 1 - sw $t1, -72($fp) - label_END_224: -# IF_ZERO local_prompt2_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_221 -# IF_ZERO local_prompt2_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_221 -lw $t1, -72($fp) -beq $t1, 0, label_FALSEIF_221 -# LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) -# local_prompt2_at_CellularAutomaton_internal_19 = 1 -li $t1, 1 -sw $t1, -80($fp) -# LOCAL local_prompt2_at_CellularAutomaton_internal_16 --> -68($fp) -# LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) -# local_prompt2_at_CellularAutomaton_internal_16 = local_prompt2_at_CellularAutomaton_internal_19 -lw $t1, -80($fp) -sw $t1, -68($fp) -# GOTO label_ENDIF_222 -j label_ENDIF_222 -label_FALSEIF_221: - # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) - # local_prompt2_at_CellularAutomaton_internal_20 = 0 - li $t1, 0 - sw $t1, -84($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_16 --> -68($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) - # local_prompt2_at_CellularAutomaton_internal_16 = local_prompt2_at_CellularAutomaton_internal_20 - lw $t1, -84($fp) - sw $t1, -68($fp) - label_ENDIF_222: -# RETURN local_prompt2_at_CellularAutomaton_internal_16 -lw $v0, -68($fp) -# Deallocate stack frame for function function_prompt2_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 92 -jr $ra -# Function END - - -# __Main__attrib__cells__init implementation. -# @Params: -__Main__attrib__cells__init: - # Allocate stack frame for function __Main__attrib__cells__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Main__attrib__cells__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 148 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 148 - # LOCAL local_main_at_Main_continue_0 --> -4($fp) - # local_main_at_Main_continue_0 = 0 - li $t1, 0 - sw $t1, -4($fp) - # LOCAL local_main_at_Main_choice_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_0 - sw $t1, 12($v0) - li $t1, 0 - sw $t1, 16($v0) - sw $v0, -8($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = SELF - sw $s1, -20($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 - lw $t1, -20($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_88 - sw $t1, 12($v0) - li $t1, 29 - sw $t1, 16($v0) - sw $v0, -24($fp) - # ARG local_main_at_Main_internal_5 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - lw $t1, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = SELF - sw $s1, -36($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 - lw $t1, -36($fp) - sw $t1, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, data_89 - sw $t1, 12($v0) - li $t1, 47 - sw $t1, 16($v0) - sw $v0, -40($fp) - # ARG local_main_at_Main_internal_9 - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - lw $t1, -40($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_string - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 12($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - label_WHILE_225: - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_12 = SELF - sw $s1, -52($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 - lw $t1, -52($fp) - sw $t1, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 prompt2 - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 104($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # IF_ZERO local_main_at_Main_internal_11 GOTO label_WHILE_END_226 - # IF_ZERO local_main_at_Main_internal_11 GOTO label_WHILE_END_226 - lw $t1, -48($fp) - beq $t1, 0, label_WHILE_END_226 - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_13 = 1 - li $t1, 1 - sw $t1, -56($fp) - # LOCAL local_main_at_Main_continue_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_continue_0 = local_main_at_Main_internal_13 - lw $t1, -56($fp) - sw $t1, -4($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_16 = SELF - sw $s1, -68($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_14 = local_main_at_Main_internal_16 - lw $t1, -68($fp) - sw $t1, -60($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 option - # Save new self pointer in $s1 - lw $s1, -60($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 96($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -64($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_choice_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_choice_1 = local_main_at_Main_internal_15 - lw $t1, -64($fp) - sw $t1, -8($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_19 = ALLOCATE CellularAutomaton - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, CellularAutomaton - sw $t3, 12($v0) - li $t3, 17 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 28 bytes of memory - li $a0, 28 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, CellularAutomaton_start - sw $t3, 4($v0) - # Load type offset - li $t3, 20 - sw $t3, 8($v0) - move $t2, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Board__attrib__rows__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t2) - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Board__attrib__columns__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t2) - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __Board__attrib__board_size__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t2) - # Push register t2 into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - jal __CellularAutomaton__attrib__population_map__init - # Pop 4 bytes from stack into register t2 - lw $t2, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t2) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t2, -80($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_17 = local_main_at_Main_internal_19 - lw $t2, -80($fp) - sw $t2, -72($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_main_at_Main_choice_1 - # LOCAL local_main_at_Main_choice_1 --> -8($fp) - lw $t2, -8($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t2, 0($sp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_18 = VCALL local_main_at_Main_internal_17 init - # Save new self pointer in $s1 - lw $s1, -72($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 36($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -76($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - lw $t2, -76($fp) - sw $t2, 28($s1) - # local_main_at_Main_internal_22 = GETATTRIBUTE cells Main - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - lw $t2, 28($s1) - sw $t2, -92($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - # local_main_at_Main_internal_20 = local_main_at_Main_internal_22 - lw $t2, -92($fp) - sw $t2, -84($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # local_main_at_Main_internal_21 = VCALL local_main_at_Main_internal_20 print - # Save new self pointer in $s1 - lw $s1, -84($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 40($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -88($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - label_WHILE_227: - # IF_ZERO local_main_at_Main_continue_0 GOTO label_WHILE_END_228 - # IF_ZERO local_main_at_Main_continue_0 GOTO label_WHILE_END_228 - lw $t2, -4($fp) - beq $t2, 0, label_WHILE_END_228 - # LOCAL local_main_at_Main_internal_26 --> -108($fp) - # local_main_at_Main_internal_26 = SELF - sw $s1, -108($fp) - # LOCAL local_main_at_Main_internal_24 --> -100($fp) - # LOCAL local_main_at_Main_internal_26 --> -108($fp) - # local_main_at_Main_internal_24 = local_main_at_Main_internal_26 - lw $t2, -108($fp) - sw $t2, -100($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_24 --> -100($fp) - # LOCAL local_main_at_Main_internal_25 --> -104($fp) - # local_main_at_Main_internal_25 = VCALL local_main_at_Main_internal_24 prompt - # Save new self pointer in $s1 - lw $s1, -100($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 100($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -104($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # IF_ZERO local_main_at_Main_internal_25 GOTO label_FALSEIF_229 - # IF_ZERO local_main_at_Main_internal_25 GOTO label_FALSEIF_229 - lw $t2, -104($fp) - beq $t2, 0, label_FALSEIF_229 - # local_main_at_Main_internal_29 = GETATTRIBUTE cells Main - # LOCAL local_main_at_Main_internal_29 --> -120($fp) - lw $t2, 28($s1) - sw $t2, -120($fp) - # LOCAL local_main_at_Main_internal_27 --> -112($fp) - # LOCAL local_main_at_Main_internal_29 --> -120($fp) - # local_main_at_Main_internal_27 = local_main_at_Main_internal_29 - lw $t2, -120($fp) - sw $t2, -112($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_27 --> -112($fp) - # LOCAL local_main_at_Main_internal_28 --> -116($fp) - # local_main_at_Main_internal_28 = VCALL local_main_at_Main_internal_27 evolve - # Save new self pointer in $s1 - lw $s1, -112($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 92($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -116($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_main_at_Main_internal_32 = GETATTRIBUTE cells Main - # LOCAL local_main_at_Main_internal_32 --> -132($fp) - lw $t2, 28($s1) - sw $t2, -132($fp) - # LOCAL local_main_at_Main_internal_30 --> -124($fp) - # LOCAL local_main_at_Main_internal_32 --> -132($fp) - # local_main_at_Main_internal_30 = local_main_at_Main_internal_32 - lw $t2, -132($fp) - sw $t2, -124($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_30 --> -124($fp) - # LOCAL local_main_at_Main_internal_31 --> -128($fp) - # local_main_at_Main_internal_31 = VCALL local_main_at_Main_internal_30 print - # Save new self pointer in $s1 - lw $s1, -124($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 40($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -128($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_23 --> -96($fp) - # LOCAL local_main_at_Main_internal_31 --> -128($fp) - # local_main_at_Main_internal_23 = local_main_at_Main_internal_31 - lw $t2, -128($fp) - sw $t2, -96($fp) - # GOTO label_ENDIF_230 -j label_ENDIF_230 -label_FALSEIF_229: - # LOCAL local_main_at_Main_internal_33 --> -136($fp) - # local_main_at_Main_internal_33 = 0 - li $t2, 0 - sw $t2, -136($fp) - # LOCAL local_main_at_Main_continue_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_33 --> -136($fp) - # local_main_at_Main_continue_0 = local_main_at_Main_internal_33 - lw $t2, -136($fp) - sw $t2, -4($fp) - # LOCAL local_main_at_Main_internal_23 --> -96($fp) - # local_main_at_Main_internal_23 = - label_ENDIF_230: -# GOTO label_WHILE_227 -j label_WHILE_227 -label_WHILE_END_228: - # GOTO label_WHILE_225 - j label_WHILE_225 - label_WHILE_END_226: - # LOCAL local_main_at_Main_internal_34 --> -140($fp) - # local_main_at_Main_internal_34 = SELF - sw $s1, -140($fp) - # RETURN local_main_at_Main_internal_34 - lw $v0, -140($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 148 - jr $ra - # Function END - diff --git a/tests/codegen/list.mips b/tests/codegen/list.mips index a01febaf..2bb9cfab 100644 --- a/tests/codegen/list.mips +++ b/tests/codegen/list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:22 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:51 2020 # School of Math and Computer Science, University of Havana # @@ -438,7 +438,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/new_complex.mips b/tests/codegen/new_complex.mips index eabfe52d..40b4db59 100644 --- a/tests/codegen/new_complex.mips +++ b/tests/codegen/new_complex.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:20 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:49 2020 # School of Math and Computer Science, University of Havana # @@ -437,7 +437,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -3433,59 +3433,9 @@ function_main_at_Main: sw $fp, 0($sp) addu $fp, $sp, 168 # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_c_0 = ALLOCATE Complex - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Complex - sw $t0, 12($v0) - li $t0, 7 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Complex_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Complex__attrib__x__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Complex__attrib__y__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) + # local_main_at_Main_c_0 = 0 + li $t0, 0 + sw $t0, -4($fp) # LOCAL local_main_at_Main_internal_3 --> -16($fp) # local_main_at_Main_internal_3 = ALLOCATE Complex # Allocating 20 bytes of memory diff --git a/tests/codegen/palindrome.mips b/tests/codegen/palindrome.mips deleted file mode 100644 index 9bbda234..00000000 --- a/tests/codegen/palindrome.mips +++ /dev/null @@ -1,1757 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 07:49:32 2020 -# School of Math and Computer Science, University of Havana -# - -.data -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Int: .asciiz "Int" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Int **** -Int_start: - Int_vtable_pointer: .word Int_vtable - # Function END -Int_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_pal_at_Main, function_main_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz "enter a string\n" -# - - -data_5: .asciiz "that was a palindrome\n" -# - - -data_6: .asciiz "that was not a palindrome\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - move $a0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - sw $a0, 12($v0) - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - lw $t2, 12($t2) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - lw $a0, 12($a0) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # LOCAL local_length_at_String_internal_1 --> -8($fp) - # LOCAL local_length_at_String_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -4($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_length_at_String_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Main - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Main_start - sw $t2, 4($v0) - # Load type offset - li $t2, 20 - sw $t2, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__i__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t1, Main_vtable - # Get pointer to function address - lw $t2, 32($t1) - # Call function. Result is on $v0 - jalr $t2 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__i__init implementation. -# @Params: -__Main__attrib__i__init: - # Allocate stack frame for function __Main__attrib__i__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Main__attrib__i__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_pal_at_Main implementation. -# @Params: -# 0($fp) = param_pal_at_Main_s_0 -function_pal_at_Main: - # Allocate stack frame for function function_pal_at_Main. - subu $sp, $sp, 152 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 152 - # LOCAL local_pal_at_Main_internal_2 --> -12($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_2 = PARAM param_pal_at_Main_s_0 - lw $t1, 0($fp) - sw $t1, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_2 --> -12($fp) - # LOCAL local_pal_at_Main_internal_3 --> -16($fp) - # local_pal_at_Main_internal_3 = VCALL local_pal_at_Main_internal_2 length - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t1, 4($s1) - # Get pointer to type's VTABLE - lw $t2, 0($t1) - # Get pointer to function address - lw $t3, 20($t2) - # Call function. Result is on $v0 - jalr $t3 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - li $t1, 0 - sw $t1, 12($v0) - sw $v0, -20($fp) - # LOCAL local_pal_at_Main_internal_1 --> -8($fp) - # LOCAL local_pal_at_Main_internal_3 --> -16($fp) - # LOCAL local_pal_at_Main_internal_4 --> -20($fp) - lw $t1, -16($fp) - # IF_ZERO local_pal_at_Main_internal_1 GOTO label_FALSEIF_1 - # IF_ZERO local_pal_at_Main_internal_1 GOTO label_FALSEIF_1 - lw $t2, -8($fp) - beq $t2, 0, label_FALSEIF_1 - # LOCAL local_pal_at_Main_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Bool - sw $t2, 12($v0) - li $t2, 4 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Bool_start - sw $t2, 4($v0) - # Load type offset - li $t2, 12 - sw $t2, 8($v0) - li $t2, 1 - sw $t2, 12($v0) - sw $v0, -24($fp) - # LOCAL local_pal_at_Main_internal_0 --> -4($fp) - # LOCAL local_pal_at_Main_internal_5 --> -24($fp) - # local_pal_at_Main_internal_0 = local_pal_at_Main_internal_5 - lw $t2, -24($fp) - sw $t2, -4($fp) - # GOTO label_ENDIF_2 -j label_ENDIF_2 -label_FALSEIF_1: - # LOCAL local_pal_at_Main_internal_8 --> -36($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_8 = PARAM param_pal_at_Main_s_0 - lw $t2, 0($fp) - sw $t2, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_8 --> -36($fp) - # LOCAL local_pal_at_Main_internal_9 --> -40($fp) - # local_pal_at_Main_internal_9 = VCALL local_pal_at_Main_internal_8 length - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t2, 4($s1) - # Get pointer to type's VTABLE - lw $t3, 0($t2) - # Get pointer to function address - lw $t4, 20($t3) - # Call function. Result is on $v0 - jalr $t4 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t2, String - sw $t2, 0($v0) - la $t2, String_start - sw $t2, 4($v0) - # Load type offset - li $t2, 8 - sw $t2, 8($v0) - la $t2, Int - sw $t2, 12($v0) - li $t2, 3 - sw $t2, 16($v0) - move $t2, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t2, 0($v0) - la $t2, Int_start - sw $t2, 4($v0) - # Load type offset - li $t2, 16 - sw $t2, 8($v0) - li $t2, 1 - sw $t2, 12($v0) - sw $v0, -44($fp) - # LOCAL local_pal_at_Main_internal_7 --> -32($fp) - # LOCAL local_pal_at_Main_internal_9 --> -40($fp) - # LOCAL local_pal_at_Main_internal_10 --> -44($fp) - lw $t2, -40($fp) - # IF_ZERO local_pal_at_Main_internal_7 GOTO label_FALSEIF_3 - # IF_ZERO local_pal_at_Main_internal_7 GOTO label_FALSEIF_3 - lw $t3, -32($fp) - beq $t3, 0, label_FALSEIF_3 - # LOCAL local_pal_at_Main_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Bool - sw $t3, 12($v0) - li $t3, 4 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Bool_start - sw $t3, 4($v0) - # Load type offset - li $t3, 12 - sw $t3, 8($v0) - li $t3, 1 - sw $t3, 12($v0) - sw $v0, -48($fp) - # LOCAL local_pal_at_Main_internal_6 --> -28($fp) - # LOCAL local_pal_at_Main_internal_11 --> -48($fp) - # local_pal_at_Main_internal_6 = local_pal_at_Main_internal_11 - lw $t3, -48($fp) - sw $t3, -28($fp) - # GOTO label_ENDIF_4 -j label_ENDIF_4 -label_FALSEIF_3: - # LOCAL local_pal_at_Main_internal_14 --> -60($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_14 = PARAM param_pal_at_Main_s_0 - lw $t3, 0($fp) - sw $t3, -60($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Int - sw $t3, 12($v0) - li $t3, 3 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Int_start - sw $t3, 4($v0) - # Load type offset - li $t3, 16 - sw $t3, 8($v0) - li $t3, 0 - sw $t3, 12($v0) - sw $v0, -68($fp) - # ARG local_pal_at_Main_internal_16 - # LOCAL local_pal_at_Main_internal_16 --> -68($fp) - lw $t3, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_pal_at_Main_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Int - sw $t3, 12($v0) - li $t3, 3 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Int_start - sw $t3, 4($v0) - # Load type offset - li $t3, 16 - sw $t3, 8($v0) - li $t3, 1 - sw $t3, 12($v0) - sw $v0, -72($fp) - # ARG local_pal_at_Main_internal_17 - # LOCAL local_pal_at_Main_internal_17 --> -72($fp) - lw $t3, -72($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_pal_at_Main_internal_14 --> -60($fp) - # LOCAL local_pal_at_Main_internal_15 --> -64($fp) - # local_pal_at_Main_internal_15 = VCALL local_pal_at_Main_internal_14 substr - # Save new self pointer in $s1 - lw $s1, -60($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 16($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -64($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_18 --> -76($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_18 = PARAM param_pal_at_Main_s_0 - lw $t3, 0($fp) - sw $t3, -76($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_21 --> -88($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_21 = PARAM param_pal_at_Main_s_0 - lw $t3, 0($fp) - sw $t3, -88($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_21 --> -88($fp) - # LOCAL local_pal_at_Main_internal_22 --> -92($fp) - # local_pal_at_Main_internal_22 = VCALL local_pal_at_Main_internal_21 length - # Save new self pointer in $s1 - lw $s1, -88($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 20($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -92($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_23 --> -96($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Int - sw $t3, 12($v0) - li $t3, 3 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Int_start - sw $t3, 4($v0) - # Load type offset - li $t3, 16 - sw $t3, 8($v0) - li $t3, 1 - sw $t3, 12($v0) - sw $v0, -96($fp) - # LOCAL local_pal_at_Main_internal_20 --> -84($fp) - # LOCAL local_pal_at_Main_internal_22 --> -92($fp) - # LOCAL local_pal_at_Main_internal_23 --> -96($fp) - # local_pal_at_Main_internal_20 = local_pal_at_Main_internal_22 - local_pal_at_Main_internal_23 - lw $t4, -92($fp) - lw $t3, 12($t4) - lw $t4, -96($fp) - lw $t5, 12($t4) - sub $t3, $t3, $t5 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Int - sw $t4, 12($v0) - li $t4, 3 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, Int_start - sw $t4, 4($v0) - # Load type offset - li $t4, 16 - sw $t4, 8($v0) - sw $t3, 12($v0) - sw $v0, -84($fp) - # ARG local_pal_at_Main_internal_20 - # LOCAL local_pal_at_Main_internal_20 --> -84($fp) - lw $t3, -84($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_pal_at_Main_internal_24 --> -100($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t3, String - sw $t3, 0($v0) - la $t3, String_start - sw $t3, 4($v0) - # Load type offset - li $t3, 8 - sw $t3, 8($v0) - la $t3, Int - sw $t3, 12($v0) - li $t3, 3 - sw $t3, 16($v0) - move $t3, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t3, 0($v0) - la $t3, Int_start - sw $t3, 4($v0) - # Load type offset - li $t3, 16 - sw $t3, 8($v0) - li $t3, 1 - sw $t3, 12($v0) - sw $v0, -100($fp) - # ARG local_pal_at_Main_internal_24 - # LOCAL local_pal_at_Main_internal_24 --> -100($fp) - lw $t3, -100($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t3, 0($sp) - # LOCAL local_pal_at_Main_internal_18 --> -76($fp) - # LOCAL local_pal_at_Main_internal_19 --> -80($fp) - # local_pal_at_Main_internal_19 = VCALL local_pal_at_Main_internal_18 substr - # Save new self pointer in $s1 - lw $s1, -76($fp) - # Get pointer to type - lw $t3, 4($s1) - # Get pointer to type's VTABLE - lw $t4, 0($t3) - # Get pointer to function address - lw $t5, 16($t4) - # Call function. Result is on $v0 - jalr $t5 - sw $v0, -80($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_13 --> -56($fp) - # LOCAL local_pal_at_Main_internal_15 --> -64($fp) - # LOCAL local_pal_at_Main_internal_19 --> -80($fp) - lw $t3, -64($fp) - # IF_ZERO local_pal_at_Main_internal_13 GOTO label_FALSEIF_5 - # IF_ZERO local_pal_at_Main_internal_13 GOTO label_FALSEIF_5 - lw $t4, -56($fp) - beq $t4, 0, label_FALSEIF_5 - # LOCAL local_pal_at_Main_internal_27 --> -112($fp) - # local_pal_at_Main_internal_27 = SELF - sw $s1, -112($fp) - # LOCAL local_pal_at_Main_internal_25 --> -104($fp) - # LOCAL local_pal_at_Main_internal_27 --> -112($fp) - # local_pal_at_Main_internal_25 = local_pal_at_Main_internal_27 - lw $t4, -112($fp) - sw $t4, -104($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_28 --> -116($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_28 = PARAM param_pal_at_Main_s_0 - lw $t4, 0($fp) - sw $t4, -116($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_30 --> -124($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Int - sw $t4, 12($v0) - li $t4, 3 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, Int_start - sw $t4, 4($v0) - # Load type offset - li $t4, 16 - sw $t4, 8($v0) - li $t4, 1 - sw $t4, 12($v0) - sw $v0, -124($fp) - # ARG local_pal_at_Main_internal_30 - # LOCAL local_pal_at_Main_internal_30 --> -124($fp) - lw $t4, -124($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - # LOCAL local_pal_at_Main_internal_32 --> -132($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_32 = PARAM param_pal_at_Main_s_0 - lw $t4, 0($fp) - sw $t4, -132($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_32 --> -132($fp) - # LOCAL local_pal_at_Main_internal_33 --> -136($fp) - # local_pal_at_Main_internal_33 = VCALL local_pal_at_Main_internal_32 length - # Save new self pointer in $s1 - lw $s1, -132($fp) - # Get pointer to type - lw $t4, 4($s1) - # Get pointer to type's VTABLE - lw $t5, 0($t4) - # Get pointer to function address - lw $t6, 20($t5) - # Call function. Result is on $v0 - jalr $t6 - sw $v0, -136($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_34 --> -140($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Int - sw $t4, 12($v0) - li $t4, 3 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, Int_start - sw $t4, 4($v0) - # Load type offset - li $t4, 16 - sw $t4, 8($v0) - li $t4, 2 - sw $t4, 12($v0) - sw $v0, -140($fp) - # LOCAL local_pal_at_Main_internal_31 --> -128($fp) - # LOCAL local_pal_at_Main_internal_33 --> -136($fp) - # LOCAL local_pal_at_Main_internal_34 --> -140($fp) - # local_pal_at_Main_internal_31 = local_pal_at_Main_internal_33 - local_pal_at_Main_internal_34 - lw $t5, -136($fp) - lw $t4, 12($t5) - lw $t5, -140($fp) - lw $t6, 12($t5) - sub $t4, $t4, $t6 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t5, String - sw $t5, 0($v0) - la $t5, String_start - sw $t5, 4($v0) - # Load type offset - li $t5, 8 - sw $t5, 8($v0) - la $t5, Int - sw $t5, 12($v0) - li $t5, 3 - sw $t5, 16($v0) - move $t5, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t5, 0($v0) - la $t5, Int_start - sw $t5, 4($v0) - # Load type offset - li $t5, 16 - sw $t5, 8($v0) - sw $t4, 12($v0) - sw $v0, -128($fp) - # ARG local_pal_at_Main_internal_31 - # LOCAL local_pal_at_Main_internal_31 --> -128($fp) - lw $t4, -128($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - # LOCAL local_pal_at_Main_internal_28 --> -116($fp) - # LOCAL local_pal_at_Main_internal_29 --> -120($fp) - # local_pal_at_Main_internal_29 = VCALL local_pal_at_Main_internal_28 substr - # Save new self pointer in $s1 - lw $s1, -116($fp) - # Get pointer to type - lw $t4, 4($s1) - # Get pointer to type's VTABLE - lw $t5, 0($t4) - # Get pointer to function address - lw $t6, 16($t5) - # Call function. Result is on $v0 - jalr $t6 - sw $v0, -120($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_pal_at_Main_internal_29 - # LOCAL local_pal_at_Main_internal_29 --> -120($fp) - lw $t4, -120($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - # LOCAL local_pal_at_Main_internal_25 --> -104($fp) - # LOCAL local_pal_at_Main_internal_26 --> -108($fp) - # local_pal_at_Main_internal_26 = VCALL local_pal_at_Main_internal_25 pal - # Save new self pointer in $s1 - lw $s1, -104($fp) - # Get pointer to type - lw $t4, 4($s1) - # Get pointer to type's VTABLE - lw $t5, 0($t4) - # Get pointer to function address - lw $t6, 28($t5) - # Call function. Result is on $v0 - jalr $t6 - sw $v0, -108($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_12 --> -52($fp) - # LOCAL local_pal_at_Main_internal_26 --> -108($fp) - # local_pal_at_Main_internal_12 = local_pal_at_Main_internal_26 - lw $t4, -108($fp) - sw $t4, -52($fp) - # GOTO label_ENDIF_6 -j label_ENDIF_6 -label_FALSEIF_5: - # LOCAL local_pal_at_Main_internal_35 --> -144($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Bool - sw $t4, 12($v0) - li $t4, 4 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, Bool_start - sw $t4, 4($v0) - # Load type offset - li $t4, 12 - sw $t4, 8($v0) - li $t4, 0 - sw $t4, 12($v0) - sw $v0, -144($fp) - # LOCAL local_pal_at_Main_internal_12 --> -52($fp) - # LOCAL local_pal_at_Main_internal_35 --> -144($fp) - # local_pal_at_Main_internal_12 = local_pal_at_Main_internal_35 - lw $t4, -144($fp) - sw $t4, -52($fp) - label_ENDIF_6: -# LOCAL local_pal_at_Main_internal_6 --> -28($fp) -# LOCAL local_pal_at_Main_internal_12 --> -52($fp) -# local_pal_at_Main_internal_6 = local_pal_at_Main_internal_12 -lw $t4, -52($fp) -sw $t4, -28($fp) -label_ENDIF_4: -# LOCAL local_pal_at_Main_internal_0 --> -4($fp) -# LOCAL local_pal_at_Main_internal_6 --> -28($fp) -# local_pal_at_Main_internal_0 = local_pal_at_Main_internal_6 -lw $t4, -28($fp) -sw $t4, -4($fp) -label_ENDIF_2: -# RETURN local_pal_at_Main_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_pal_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 152 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 92 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 92 - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, Int - sw $t4, 12($v0) - li $t4, 3 - sw $t4, 16($v0) - move $t4, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t4, 0($v0) - la $t4, Int_start - sw $t4, 4($v0) - # Load type offset - li $t4, 16 - sw $t4, 8($v0) - li $t4, 1 - sw $t4, 12($v0) - sw $v0, -8($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - lw $t4, -8($fp) - not $t4, $t4 - sw $t4, -4($fp) - # - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - lw $t4, -4($fp) - sw $t4, 12($s1) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = SELF - sw $s1, -20($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 - lw $t4, -20($fp) - sw $t4, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, data_4 - sw $t4, 12($v0) - li $t4, 15 - sw $t4, 16($v0) - sw $v0, -24($fp) - # ARG local_main_at_Main_internal_5 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - lw $t4, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t4, 4($s1) - # Get pointer to type's VTABLE - lw $t5, 0($t4) - # Get pointer to function address - lw $t6, 12($t5) - # Call function. Result is on $v0 - jalr $t6 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = SELF - sw $s1, -40($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t4, -40($fp) - sw $t4, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_12 = SELF - sw $s1, -52($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 - lw $t4, -52($fp) - sw $t4, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 in_string - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t4, 4($s1) - # Get pointer to type's VTABLE - lw $t5, 0($t4) - # Get pointer to function address - lw $t6, 20($t5) - # Call function. Result is on $v0 - jalr $t6 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_11 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - lw $t4, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 pal - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t4, 4($s1) - # Get pointer to type's VTABLE - lw $t5, 0($t4) - # Get pointer to function address - lw $t6, 28($t5) - # Call function. Result is on $v0 - jalr $t6 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # IF_ZERO local_main_at_Main_internal_8 GOTO label_FALSEIF_7 - # IF_ZERO local_main_at_Main_internal_8 GOTO label_FALSEIF_7 - lw $t4, -36($fp) - beq $t4, 0, label_FALSEIF_7 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 - lw $t4, -64($fp) - sw $t4, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, data_5 - sw $t4, 12($v0) - li $t4, 22 - sw $t4, 16($v0) - sw $v0, -68($fp) - # ARG local_main_at_Main_internal_16 - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - lw $t4, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 out_string - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t4, 4($s1) - # Get pointer to type's VTABLE - lw $t5, 0($t4) - # Get pointer to function address - lw $t6, 12($t5) - # Call function. Result is on $v0 - jalr $t6 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_14 - lw $t4, -60($fp) - sw $t4, -28($fp) - # GOTO label_ENDIF_8 -j label_ENDIF_8 -label_FALSEIF_7: - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_19 = SELF - sw $s1, -80($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_17 = local_main_at_Main_internal_19 - lw $t4, -80($fp) - sw $t4, -72($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t4, String - sw $t4, 0($v0) - la $t4, String_start - sw $t4, 4($v0) - # Load type offset - li $t4, 8 - sw $t4, 8($v0) - la $t4, data_6 - sw $t4, 12($v0) - li $t4, 26 - sw $t4, 16($v0) - sw $v0, -84($fp) - # ARG local_main_at_Main_internal_20 - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - lw $t4, -84($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t4, 0($sp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_18 = VCALL local_main_at_Main_internal_17 out_string - # Save new self pointer in $s1 - lw $s1, -72($fp) - # Get pointer to type - lw $t4, 4($s1) - # Get pointer to type's VTABLE - lw $t5, 0($t4) - # Get pointer to function address - lw $t6, 12($t5) - # Call function. Result is on $v0 - jalr $t6 - sw $v0, -76($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_18 - lw $t4, -76($fp) - sw $t4, -28($fp) - label_ENDIF_8: -# RETURN local_main_at_Main_internal_6 -lw $v0, -28($fp) -# Deallocate stack frame for function function_main_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 92 -jr $ra -# Function END - diff --git a/tests/codegen/primes.mips b/tests/codegen/primes.mips index 0eb65a07..d3b9e60b 100644 --- a/tests/codegen/primes.mips +++ b/tests/codegen/primes.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:19 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:49 2020 # School of Math and Computer Science, University of Havana # @@ -412,7 +412,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self diff --git a/tests/codegen/print-cool.mips b/tests/codegen/print-cool.mips index 385e14a4..cba51357 100644 --- a/tests/codegen/print-cool.mips +++ b/tests/codegen/print-cool.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 13:10:20 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:49 2020 # School of Math and Computer Science, University of Havana # @@ -400,7 +400,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self From 64d25fe649a9a023b6cb7ec8f3c5b07844916af6 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Mon, 7 Dec 2020 23:10:07 -0500 Subject: [PATCH 156/162] Fix vtables bugs --- src/.builds | 1 + src/pycoolc.py | 64 +- src/testing.mips | 571 +- src/testing.py | 29 +- src/travels/ciltomips.py | 1 + src/travels/ctcill.py | 29 +- tests/codegen/arith.mips | 315 +- tests/codegen/atoi.mips | 10086 ++++++++++++++ tests/codegen/book_list.mips | 87 +- tests/codegen/cells.mips | 4335 ++++++ tests/codegen/complex.mips | 43 +- tests/codegen/fib.mips | 25 +- tests/codegen/graph.mips | 169 +- tests/codegen/hairyscary.mips | 89 +- tests/codegen/hello_world.mips | 19 +- tests/codegen/io.mips | 43 +- tests/codegen/life.mips | 21978 +++++++++++++++++++++++++++++++ tests/codegen/list.mips | 49 +- tests/codegen/new_complex.mips | 57 +- tests/codegen/palindrome.mips | 2420 ++++ tests/codegen/primes.mips | 27 +- tests/codegen/print-cool.mips | 33 +- tests/codegen/sort-list.mips | 3364 +++++ 23 files changed, 42868 insertions(+), 966 deletions(-) create mode 100644 tests/codegen/atoi.mips create mode 100644 tests/codegen/cells.mips create mode 100644 tests/codegen/life.mips create mode 100644 tests/codegen/palindrome.mips create mode 100644 tests/codegen/sort-list.mips diff --git a/src/.builds b/src/.builds index 09604598..35688886 100644 --- a/src/.builds +++ b/src/.builds @@ -212,3 +212,4 @@ 1 1 1 +1 diff --git a/src/pycoolc.py b/src/pycoolc.py index 521b08d3..f826ad20 100644 --- a/src/pycoolc.py +++ b/src/pycoolc.py @@ -1,80 +1,66 @@ +from argparse import ArgumentParser from build.compiler_struct import LEXER, PARSER from cil.nodes import CilProgramNode from travels.ciltomips import MipsCodeGenerator -from travels.ctcill import CoolToCILVisitor from typecheck.evaluator import evaluate_right_parse from comments import find_comments -from argparse import ArgumentParser +from travels.ctcill import CilDisplayFormatter, CoolToCILVisitor import sys def report(errors: list): - for error in errors: + for error in set(errors): print(error) -def pipeline(program: str, deep: int, file_name: str) -> None: +def pipeline(program: str, deep: int, file_name) -> None: try: program = find_comments(program) - # Tratar los \t en el programa como 4 espacios por comodidad - # a la hora de reportar errores de fila y columna - program = program.replace("\t", " " * 4) + program = program.replace('\t', ' ' * 4) except AssertionError as e: print(e) sys.exit(1) - # El programa no contiene comentarios en esta fase - # por lo que es seguro pasarselo al LEXER + # Right now, program has no comments, so is safe to pass it to the LEXER try: tokens = LEXER(program) except Exception as e: print(e) sys.exit(1) - # Parsear los tokens para obtener un arbol de derivacion + # Parse the tokens to obtain a derivation tree try: parse = PARSER(tokens) except Exception as e: print(e) sys.exit(1) - # Construir el AST a partir del arbol de derivacion obtenido - try: - ast = evaluate_right_parse(parse, tokens[:-1]) - except Exception as e: - print(e) - sys.exit(1) - ######################## - # Empezar los visitors # - ######################## + # build the AST from the obtained parse + # try: + ast = evaluate_right_parse(parse, tokens[:-1]) + # except Exception as e: + # print(e) + # sys.exit(1) + ##################### + # Start the visitors # + ###################### - # Ejecutar los visitors que recolectan los tipos, - # los crean y luego realizan un chequeo semantico - # sobre el programa y la inferencia de tipos + # Run type checker visitor errors, context, scope = ast.check_semantics(deep) if errors: report(errors) sys.exit(1) - # Correr el visitor que transforma el AST de COOL - # en un AST de CIL - cil_visitor = CoolToCILVisitor(context) - try: - cil_program = cil_visitor.visit(ast, scope) - except Exception as e: - print(e) - sys.exit(1) - - assert isinstance(cil_program, CilProgramNode) - - # Convertir el AST de CIL en instrucciones de MIPS - code_gen = MipsCodeGenerator() + cil_travel = CoolToCILVisitor(context) + cil_program_node = cil_travel.visit(ast, scope) + # formatter = CilDisplayFormatter() + # print(formatter(cil_program_node)) - # Obtener la representacion en str de las instrucciones - # en MIPS - file_str = code_gen(cil_program) + mips_gen = MipsCodeGenerator() + assert isinstance(cil_program_node, CilProgramNode) + source = mips_gen(cil_program_node) with open(f"{file_name[: len(file_name) - 3]}.mips", "w+") as f: - f.write(file_str) + f.write(source) if __name__ == "__main__": diff --git a/src/testing.mips b/src/testing.mips index 3a27dc3b..5d66bb1a 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,10 +1,11 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 20:53:36 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:58:52 2020 # School of Math and Computer Science, University of Havana # .data +dummy: .word 0 IO: .asciiz "IO" # Function END Object: .asciiz "Object" @@ -39,7 +40,7 @@ Vertice: .asciiz "Vertice" # **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +IO_vtable: .word dummy, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_in_int_at_IO, dummy, function_copy_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy # Function END # @@ -53,7 +54,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy # Function END # @@ -67,7 +68,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word dummy, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_length_at_String, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, function_concat_at_String, dummy, dummy # Function END # @@ -81,7 +82,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy # Function END # @@ -95,7 +96,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy # Function END # @@ -109,7 +110,7 @@ Int_end: # **** VTABLE for type BoolOp **** -BoolOp_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_and_at_BoolOp, function_or_at_BoolOp +BoolOp_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_or_at_BoolOp, dummy, dummy, function_abort_at_Object, dummy, function_and_at_BoolOp, dummy # Function END # @@ -123,7 +124,7 @@ BoolOp_end: # **** VTABLE for type Graph **** -Graph_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_add_vertice_at_Graph, function_print_E_at_Graph, function_print_V_at_Graph +Graph_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_add_vertice_at_Graph, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_print_V_at_Graph, dummy, dummy, function_print_E_at_Graph, dummy, function_abort_at_Object, dummy, dummy, dummy # Function END # @@ -137,7 +138,7 @@ Graph_end: # **** VTABLE for type Parse **** -Parse_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_read_input_at_Parse, function_parse_line_at_Parse, function_c2i_at_Parse, function_a2i_at_Parse, function_a2i_aux_at_Parse +Parse_vtable: .word function_read_input_at_Parse, function_in_string_at_IO, function_a2i_at_Parse, dummy, dummy, function_a2i_aux_at_Parse, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_c2i_at_Parse, dummy, function_in_int_at_IO, dummy, function_copy_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_parse_line_at_Parse # Function END # @@ -151,7 +152,7 @@ Parse_end: # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_read_input_at_Parse, function_parse_line_at_Parse, function_c2i_at_Parse, function_a2i_at_Parse, function_a2i_aux_at_Parse, function_main_at_Main +Main_vtable: .word function_read_input_at_Parse, function_in_string_at_IO, function_a2i_at_Parse, dummy, dummy, function_a2i_aux_at_Parse, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, function_main_at_Main, dummy, function_type_name_at_Object, dummy, function_c2i_at_Parse, dummy, function_in_int_at_IO, dummy, function_copy_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_parse_line_at_Parse # Function END # @@ -165,7 +166,7 @@ Main_end: # **** VTABLE for type VList **** -VList_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_VList, function_head_at_VList, function_tail_at_VList, function_cons_at_VList, function_print_at_VList +VList_vtable: .word dummy, function_in_string_at_IO, dummy, dummy, function_print_at_VList, dummy, function_isNil_at_VList, function_cons_at_VList, function_out_int_at_IO, dummy, function_head_at_VList, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_in_int_at_IO, dummy, function_copy_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, function_tail_at_VList, function_abort_at_Object, dummy, dummy, dummy # Function END # @@ -179,7 +180,7 @@ VList_end: # **** VTABLE for type VCons **** -VCons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_VCons, function_head_at_VCons, function_tail_at_VCons, function_cons_at_VList, function_print_at_VCons, function_init_at_VCons +VCons_vtable: .word dummy, function_in_string_at_IO, dummy, dummy, function_print_at_VCons, dummy, function_isNil_at_VCons, function_cons_at_VList, function_out_int_at_IO, dummy, function_head_at_VCons, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_in_int_at_IO, function_init_at_VCons, function_copy_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, function_tail_at_VCons, function_abort_at_Object, dummy, dummy, dummy # Function END # @@ -193,7 +194,7 @@ VCons_end: # **** VTABLE for type EList **** -EList_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_EList, function_head_at_EList, function_tail_at_EList, function_cons_at_EList, function_append_at_EList, function_print_at_EList +EList_vtable: .word dummy, function_in_string_at_IO, dummy, dummy, function_print_at_EList, dummy, function_isNil_at_EList, function_cons_at_EList, function_out_int_at_IO, dummy, function_head_at_EList, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_append_at_EList, function_in_int_at_IO, dummy, function_copy_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, function_tail_at_EList, function_abort_at_Object, dummy, dummy, dummy # Function END # @@ -207,7 +208,7 @@ EList_end: # **** VTABLE for type ECons **** -ECons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_ECons, function_head_at_ECons, function_tail_at_ECons, function_cons_at_EList, function_append_at_EList, function_print_at_ECons, function_init_at_ECons +ECons_vtable: .word dummy, function_in_string_at_IO, dummy, dummy, function_print_at_ECons, dummy, function_isNil_at_ECons, function_cons_at_EList, function_out_int_at_IO, dummy, function_head_at_ECons, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_append_at_EList, function_in_int_at_IO, function_init_at_ECons, function_copy_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, function_tail_at_ECons, function_abort_at_Object, dummy, dummy, dummy # Function END # @@ -221,7 +222,7 @@ ECons_end: # **** VTABLE for type Edge **** -Edge_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Edge, function_print_at_Edge +Edge_vtable: .word dummy, function_in_string_at_IO, dummy, dummy, function_print_at_Edge, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_in_int_at_IO, function_init_at_Edge, function_copy_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy # Function END # @@ -235,7 +236,7 @@ Edge_end: # **** VTABLE for type Vertice **** -Vertice_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_outgoing_at_Vertice, function_number_at_Vertice, function_init_at_Vertice, function_add_out_at_Vertice, function_print_at_Vertice +Vertice_vtable: .word dummy, function_in_string_at_IO, dummy, dummy, function_print_at_Vertice, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, function_number_at_Vertice, dummy, function_outgoing_at_Vertice, function_type_name_at_Object, dummy, dummy, dummy, function_in_int_at_IO, function_init_at_Vertice, function_copy_at_Object, function_out_string_at_IO, dummy, function_add_out_at_Vertice, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy # Function END # @@ -350,7 +351,7 @@ data_21: .asciiz "" # -data_22: .asciiz "Success in init\n" +data_22: .asciiz "\n" # @@ -358,23 +359,15 @@ data_23: .asciiz "\n" # -data_24: .asciiz "\n" +data_24: .asciiz " (" # -data_25: .asciiz " (" +data_25: .asciiz "," # -data_26: .asciiz "," -# - - -data_27: .asciiz ")" -# - - -data_28: .asciiz "initializing Vertice\n" +data_26: .asciiz ")" # @@ -649,7 +642,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -907,7 +900,7 @@ entry: # Push register t1 into stack subu $sp, $sp, 4 sw $t1, 0($sp) - jal __Main__attrib__s__init + jal __Main__attrib__g__init # Pop 4 bytes from stack into register t1 lw $t1, 0($sp) addu $sp, $sp, 4 @@ -1264,7 +1257,7 @@ function_add_vertice_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -1299,7 +1292,7 @@ function_add_vertice_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1338,7 +1331,7 @@ function_add_vertice_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -1393,7 +1386,7 @@ function_print_E_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1443,7 +1436,7 @@ function_print_V_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1671,7 +1664,7 @@ function_read_input_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -2296,7 +2289,7 @@ label_FALSE_25: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 116($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -2348,7 +2341,7 @@ label_FALSE_25: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -2371,7 +2364,7 @@ label_FALSE_25: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -2399,7 +2392,7 @@ label_FALSE_25: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -100($fp) @@ -2529,7 +2522,7 @@ function_parse_line_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -2552,7 +2545,7 @@ function_parse_line_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -2587,7 +2580,7 @@ function_parse_line_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -2968,7 +2961,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -3042,7 +3035,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -3150,7 +3143,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -128($fp) @@ -3185,7 +3178,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -116($fp) @@ -3208,7 +3201,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -108($fp) @@ -5883,7 +5876,7 @@ label_FALSEIF_129: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -248($fp) @@ -6023,7 +6016,7 @@ function_a2i_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -6397,7 +6390,7 @@ label_FALSEIF_139: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -6701,7 +6694,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 20($t0) +lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -108($fp) @@ -6793,7 +6786,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -6816,7 +6809,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 44($t0) +lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -6962,7 +6955,7 @@ label_FALSEIF_149: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -7266,7 +7259,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 20($t0) +lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -184($fp) @@ -7358,7 +7351,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -168($fp) @@ -7381,7 +7374,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 40($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -156($fp) @@ -7423,7 +7416,7 @@ label_FALSEIF_159: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -196($fp) @@ -7588,7 +7581,7 @@ function_a2i_aux_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -7842,7 +7835,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -8178,7 +8171,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 20($t0) +lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -104($fp) @@ -8308,7 +8301,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -8653,7 +8646,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 20($t0) +lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -160($fp) @@ -8783,7 +8776,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -8945,7 +8938,7 @@ label_FALSEIF_183: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -196($fp) @@ -8968,7 +8961,7 @@ label_FALSEIF_183: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -184($fp) @@ -9378,28 +9371,28 @@ label_WHILE_END_170: # Function END -# __Main__attrib__s__init implementation. +# __Main__attrib__g__init implementation. # @Params: -__Main__attrib__s__init: - # Allocate stack frame for function __Main__attrib__s__init. +__Main__attrib__g__init: + # Allocate stack frame for function __Main__attrib__g__init. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_ttrib__s__init_internal_3 --> -16($fp) - # local_ttrib__s__init_internal_3 = SELF + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # local_ttrib__g__init_internal_3 = SELF sw $s1, -16($fp) - # LOCAL local_ttrib__s__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__s__init_internal_3 --> -16($fp) - # local_ttrib__s__init_internal_1 = local_ttrib__s__init_internal_3 + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # local_ttrib__g__init_internal_1 = local_ttrib__g__init_internal_3 lw $t0, -16($fp) sw $t0, -8($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_ttrib__s__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__s__init_internal_2 --> -12($fp) - # local_ttrib__s__init_internal_2 = VCALL local_ttrib__s__init_internal_1 in_string + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) + # local_ttrib__g__init_internal_2 = VCALL local_ttrib__g__init_internal_1 read_input # Save new self pointer in $s1 lw $s1, -8($fp) # Get pointer to type @@ -9407,16 +9400,16 @@ __Main__attrib__s__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN local_ttrib__s__init_internal_2 + # RETURN local_ttrib__g__init_internal_2 lw $v0, -12($fp) - # Deallocate stack frame for function __Main__attrib__s__init. + # Deallocate stack frame for function __Main__attrib__g__init. # Restore $ra lw $ra, 4($sp) # Restore $fp @@ -9431,203 +9424,77 @@ __Main__attrib__s__init: # @Params: function_main_at_Main: # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 56 + subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 56 - # LOCAL local_main_at_Main_v_0 --> -4($fp) - # local_main_at_Main_v_0 = 0 - li $t0, 0 + addu $fp, $sp, 32 + # local_main_at_Main_internal_2 = GETATTRIBUTE g Main + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + lw $t0, 20($s1) + sw $t0, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t0, -12($fp) sw $t0, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = ALLOCATE Vertice - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Vertice - sw $t0, 12($v0) - li $t0, 7 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Vertice_start - sw $t0, 4($v0) - # Load type offset - li $t0, 56 - sw $t0, 8($v0) - move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Vertice__attrib__num__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Vertice__attrib__out__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -16($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t0, -16($fp) - sw $t0, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # local_main_at_Main_internal_6 = SELF - sw $s1, -28($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # local_main_at_Main_internal_4 = local_main_at_Main_internal_6 - lw $t0, -28($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_main_at_Main_internal_7 = GETATTRIBUTE s Main - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - lw $t0, 20($s1) - sw $t0, -32($fp) - # ARG local_main_at_Main_internal_7 - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - lw $t0, -32($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 a2i + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 print_V # Save new self pointer in $s1 - lw $s1, -20($fp) + lw $s1, -4($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 - sw $v0, -24($fp) + sw $v0, -8($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_5 + # local_main_at_Main_internal_5 = GETATTRIBUTE g Main + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t0, 20($s1) + sw $t0, -24($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 lw $t0, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 48($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_v_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_v_0 = local_main_at_Main_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_10 = SELF - sw $s1, -44($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_8 = local_main_at_Main_internal_10 - lw $t0, -44($fp) - sw $t0, -36($fp) + sw $t0, -16($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_22 - sw $t0, 12($v0) - li $t0, 16 - sw $t0, 16($v0) - sw $v0, -48($fp) - # ARG local_main_at_Main_internal_11 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - lw $t0, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 out_string + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 print_E # Save new self pointer in $s1 - lw $s1, -36($fp) + lw $s1, -16($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 100($t0) # Call function. Result is on $v0 jalr $t0 - sw $v0, -40($fp) + sw $v0, -20($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_9 - lw $v0, -40($fp) + # RETURN local_main_at_Main_internal_4 + lw $v0, -20($fp) # Deallocate stack frame for function function_main_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 56 + addu $sp, $sp, 32 jr $ra # Function END @@ -9734,7 +9601,7 @@ function_head_at_VList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -9787,7 +9654,7 @@ function_tail_at_VList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -9906,7 +9773,7 @@ function_cons_at_VList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -9960,7 +9827,7 @@ function_print_at_VList: # Load type offset li $t0, 8 sw $t0, 8($v0) - la $t0, data_23 + la $t0, data_22 sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) @@ -9981,7 +9848,7 @@ function_print_at_VList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10190,7 +10057,7 @@ function_print_at_VCons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10219,7 +10086,7 @@ function_print_at_VCons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -10341,7 +10208,7 @@ function_head_at_EList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10394,7 +10261,7 @@ function_tail_at_EList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10513,7 +10380,7 @@ function_cons_at_EList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10565,7 +10432,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 28($t0) +lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -10611,7 +10478,7 @@ label_FALSEIF_203: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -10642,7 +10509,7 @@ label_FALSEIF_203: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -10678,7 +10545,7 @@ label_FALSEIF_203: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -10701,7 +10568,7 @@ label_FALSEIF_203: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -10761,7 +10628,7 @@ function_print_at_EList: # Load type offset li $t0, 8 sw $t0, 8($v0) - la $t0, data_24 + la $t0, data_23 sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) @@ -10782,7 +10649,7 @@ function_print_at_EList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10991,7 +10858,7 @@ function_print_at_ECons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -11020,7 +10887,7 @@ function_print_at_ECons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -11269,7 +11136,7 @@ function_print_at_Edge: # Load type offset li $t0, 8 sw $t0, 8($v0) - la $t0, data_25 + la $t0, data_24 sw $t0, 12($v0) li $t0, 2 sw $t0, 16($v0) @@ -11290,7 +11157,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -11328,7 +11195,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -11359,7 +11226,7 @@ function_print_at_Edge: # Load type offset li $t0, 8 sw $t0, 8($v0) - la $t0, data_26 + la $t0, data_25 sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) @@ -11380,7 +11247,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -11418,7 +11285,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -11449,7 +11316,7 @@ function_print_at_Edge: # Load type offset li $t0, 8 sw $t0, 8($v0) - la $t0, data_27 + la $t0, data_26 sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) @@ -11470,7 +11337,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -11508,7 +11375,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -11702,176 +11569,26 @@ function_number_at_Vertice: # 0($fp) = param_init_at_Vertice_n_0 function_init_at_Vertice: # Allocate stack frame for function function_init_at_Vertice. - subu $sp, $sp, 40 + subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 40 - # LOCAL local_init_at_Vertice_internal_2 --> -12($fp) - # local_init_at_Vertice_internal_2 = ALLOCATE IO - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, IO - sw $t0, 12($v0) - li $t0, 2 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, IO_start - sw $t0, 4($v0) - # Load type offset - li $t0, 0 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -12($fp) - # LOCAL local_init_at_Vertice_internal_0 --> -4($fp) - # LOCAL local_init_at_Vertice_internal_2 --> -12($fp) - # local_init_at_Vertice_internal_0 = local_init_at_Vertice_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_init_at_Vertice_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_28 - sw $t0, 12($v0) - li $t0, 21 - sw $t0, 16($v0) - sw $v0, -16($fp) - # ARG local_init_at_Vertice_internal_3 - # LOCAL local_init_at_Vertice_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_init_at_Vertice_internal_0 --> -4($fp) - # LOCAL local_init_at_Vertice_internal_1 --> -8($fp) - # local_init_at_Vertice_internal_1 = VCALL local_init_at_Vertice_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 12($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_init_at_Vertice_internal_6 --> -28($fp) - # local_init_at_Vertice_internal_6 = ALLOCATE IO - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, IO - sw $t0, 12($v0) - li $t0, 2 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, IO_start - sw $t0, 4($v0) - # Load type offset - li $t0, 0 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -28($fp) - # LOCAL local_init_at_Vertice_internal_4 --> -20($fp) - # LOCAL local_init_at_Vertice_internal_6 --> -28($fp) - # local_init_at_Vertice_internal_4 = local_init_at_Vertice_internal_6 - lw $t0, -28($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_init_at_Vertice_internal_4 --> -20($fp) - # LOCAL local_init_at_Vertice_internal_5 --> -24($fp) - # local_init_at_Vertice_internal_5 = VCALL local_init_at_Vertice_internal_4 in_string - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 20($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 + addu $fp, $sp, 32 # # PARAM param_init_at_Vertice_n_0 --> 0($fp) lw $t0, 0($fp) sw $t0, 12($s1) - # LOCAL local_init_at_Vertice_internal_7 --> -32($fp) - # local_init_at_Vertice_internal_7 = SELF - sw $s1, -32($fp) - # RETURN local_init_at_Vertice_internal_7 - lw $v0, -32($fp) + # LOCAL local_init_at_Vertice_internal_0 --> -4($fp) + # local_init_at_Vertice_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_Vertice_internal_0 + lw $v0, -4($fp) # Deallocate stack frame for function function_init_at_Vertice. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 40 + addu $sp, $sp, 32 # Deallocate function args addu $sp, $sp, 4 jr $ra @@ -11915,7 +11632,7 @@ function_add_out_at_Vertice: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -11983,7 +11700,7 @@ function_print_at_Vertice: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -12012,7 +11729,7 @@ function_print_at_Vertice: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) diff --git a/src/testing.py b/src/testing.py index 83f08be3..906d5231 100755 --- a/src/testing.py +++ b/src/testing.py @@ -123,8 +123,6 @@ class Vertice inherits IO { init(n : Int) : Vertice { { - new IO.out_string("initializing Vertice\n"); - new IO.in_string(); num <- n; self; } @@ -420,12 +418,12 @@ class Parse inherits IO { class Main inherits Parse { - s : String <- in_string(); + g : Graph <- read_input(); main() : Object { { - let v : Vertice <- (new Vertice).init(a2i(s)) in - out_string("Success in init\n"); + g.print_V(); + g.print_E(); } }; @@ -444,26 +442,5 @@ class BoolOp { }; -""" - -testProg = r""" -class Main inherits IO { - num1 : Int; - num2 : Int; - main(): Object { - { - num1 <- ~1; - num2 <- 0; - out_int(num2 - num1); - out_string("\n"); - let x: Int in - { - x <- num2 - num1; - out_int(x); - }; - out_string("\n"); - } - }; -}; """ pipeline(text, 1) diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 2d4a637b..45e6e2c1 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -67,6 +67,7 @@ def _(self, node: cil.CilProgramNode): # Los tipos los definiremos en la seccion .data self.register_instruction(DotDataDirective()) + self.register_instruction(FixedData("dummy", 0)) # Generar los tipos self.create_type_array(node.dottypes) diff --git a/src/travels/ctcill.py b/src/travels/ctcill.py index 7f950001..cf21b38c 100644 --- a/src/travels/ctcill.py +++ b/src/travels/ctcill.py @@ -74,7 +74,25 @@ TypeOffsetNode, UnconditionalJump, ) -from mips.branch import J + + +def find_min_i(vtables: List[List[Tuple[str, str]]], method: str): + return min( + [i for vtable in vtables for i, (m, _) in enumerate(vtable) if m == method] + ) + + +def sort_methods_tables(vtables: List[List[Tuple[str, str]]]): + methods = set([m for v in vtables for m, _ in v]) + new_tables = [[] for _ in vtables] + for m in methods: + for i, vtable in enumerate(vtables): + if m in [x for x, _ in vtable]: + name = next(n for x, n in vtable if x == m) + new_tables[i].append((m, name)) + else: + new_tables[i].append(("__not_a_func", "dummy")) + return new_tables def find_method_in_parent(type_: Type, method: str, typeNodes: List[TypeNode]): @@ -131,6 +149,11 @@ def _(self, node: coolAst.ProgramNode, scope: Scope) -> CilProgramNode: for klass, child_scope in zip(class_list, children): self.visit(klass, child_scope) + # print("\n".join(str(x) for x in sort_methods_tables([t.methods for t in self.dot_types]))) + new_vtable = sort_methods_tables([t.methods for t in self.dot_types]) + for i in range(len(self.dot_types)): + self.dot_types[i].methods = new_vtable[i] + return CilProgramNode(self.dot_types, self.dot_data, self.dot_code) # *************** IMPLEMENTACION DE LAS DEFINICIONES DE CLASES ***************** @@ -349,7 +372,9 @@ def _(self, node: coolAst.InstantiateClassNode, scope: Scope) -> LocalNode: if type_.name not in ("String", "Int", "Bool"): self.register_instruction(AllocateNode(type_, instance_vm_holder)) elif type_.name == "String": - self.register_instruction(AllocateStringNode(instance_vm_holder, self.null, 0)) + self.register_instruction( + AllocateStringNode(instance_vm_holder, self.null, 0) + ) elif type_.name == "Int": self.register_instruction(AllocateIntNode(instance_vm_holder, 0)) elif type_.name == "Bool": diff --git a/tests/codegen/arith.mips b/tests/codegen/arith.mips index 62fac818..a8c817ec 100644 --- a/tests/codegen/arith.mips +++ b/tests/codegen/arith.mips @@ -1,10 +1,11 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:50 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:12 2020 # School of Math and Computer Science, University of Havana # .data +dummy: .word 0 IO: .asciiz "IO" # Function END Object: .asciiz "Object" @@ -33,7 +34,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +IO_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_out_string_at_IO, function_out_int_at_IO, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object # Function END # @@ -47,7 +48,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object # Function END # @@ -61,7 +62,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word dummy, dummy, dummy, dummy, dummy, function_length_at_String, function_copy_at_Object, dummy, function_concat_at_String, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object # Function END # @@ -75,7 +76,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object # Function END # @@ -89,7 +90,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object # Function END # @@ -103,7 +104,7 @@ Int_end: # **** VTABLE for type A2I **** -A2I_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_c2i_at_A2I, function_i2c_at_A2I, function_a2i_at_A2I, function_a2i_aux_at_A2I, function_i2a_at_A2I, function_i2a_aux_at_A2I +A2I_vtable: .word dummy, function_i2a_aux_at_A2I, dummy, function_a2i_at_A2I, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_c2i_at_A2I, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_i2c_at_A2I, dummy, dummy, dummy, dummy, dummy, dummy, function_a2i_aux_at_A2I, dummy, function_i2a_at_A2I, function_abort_at_Object # Function END # @@ -117,7 +118,7 @@ A2I_end: # **** VTABLE for type A **** -A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_value_at_A, function_set_var_at_A, function_method1_at_A, function_method2_at_A, function_method3_at_A, function_method4_at_A, function_method5_at_A +A_vtable: .word function_method5_at_A, dummy, function_method2_at_A, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_method4_at_A, function_type_name_at_Object, dummy, function_method3_at_A, dummy, function_value_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method1_at_A, dummy, dummy, dummy, dummy, function_set_var_at_A, dummy, function_abort_at_Object # Function END # @@ -131,7 +132,7 @@ A_end: # **** VTABLE for type B **** -B_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_value_at_A, function_set_var_at_A, function_method1_at_A, function_method2_at_A, function_method3_at_A, function_method4_at_A, function_method5_at_B +B_vtable: .word function_method5_at_B, dummy, function_method2_at_A, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_method4_at_A, function_type_name_at_Object, dummy, function_method3_at_A, dummy, function_value_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method1_at_A, dummy, dummy, dummy, dummy, function_set_var_at_A, dummy, function_abort_at_Object # Function END # @@ -145,7 +146,7 @@ B_end: # **** VTABLE for type D **** -D_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_value_at_A, function_set_var_at_A, function_method1_at_A, function_method2_at_A, function_method3_at_A, function_method4_at_A, function_method5_at_B, function_method7_at_D +D_vtable: .word function_method5_at_B, dummy, function_method2_at_A, dummy, dummy, dummy, function_copy_at_Object, function_method7_at_D, dummy, function_method4_at_A, function_type_name_at_Object, dummy, function_method3_at_A, dummy, function_value_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method1_at_A, dummy, dummy, dummy, dummy, function_set_var_at_A, dummy, function_abort_at_Object # Function END # @@ -159,7 +160,7 @@ D_end: # **** VTABLE for type E **** -E_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_value_at_A, function_set_var_at_A, function_method1_at_A, function_method2_at_A, function_method3_at_A, function_method4_at_A, function_method5_at_B, function_method7_at_D, function_method6_at_E +E_vtable: .word function_method5_at_B, dummy, function_method2_at_A, dummy, function_method6_at_E, dummy, function_copy_at_Object, function_method7_at_D, dummy, function_method4_at_A, function_type_name_at_Object, dummy, function_method3_at_A, dummy, function_value_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method1_at_A, dummy, dummy, dummy, dummy, function_set_var_at_A, dummy, function_abort_at_Object # Function END # @@ -173,7 +174,7 @@ E_end: # **** VTABLE for type C **** -C_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_value_at_A, function_set_var_at_A, function_method1_at_A, function_method2_at_A, function_method3_at_A, function_method4_at_A, function_method5_at_C, function_method6_at_C +C_vtable: .word function_method5_at_C, dummy, function_method2_at_A, dummy, function_method6_at_C, dummy, function_copy_at_Object, dummy, dummy, function_method4_at_A, function_type_name_at_Object, dummy, function_method3_at_A, dummy, function_value_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method1_at_A, dummy, dummy, dummy, dummy, function_set_var_at_A, dummy, function_abort_at_Object # Function END # @@ -187,7 +188,7 @@ C_end: # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_menu_at_Main, function_prompt_at_Main, function_get_int_at_Main, function_is_even_at_Main, function_class_type_at_Main, function_print_at_Main, function_main_at_Main +Main_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_type_name_at_Object, function_main_at_Main, dummy, dummy, dummy, dummy, function_prompt_at_Main, function_out_string_at_IO, function_out_int_at_IO, function_class_type_at_Main, function_in_string_at_IO, dummy, function_in_int_at_IO, function_print_at_Main, dummy, function_menu_at_Main, function_is_even_at_Main, function_get_int_at_Main, dummy, dummy, dummy, function_abort_at_Object # Function END # @@ -798,7 +799,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -1083,7 +1084,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 52($t0) + lw $t1, 44($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -3750,7 +3751,7 @@ label_FALSEIF_91: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 124($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -248($fp) @@ -6513,7 +6514,7 @@ label_FALSEIF_191: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 124($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -248($fp) @@ -7014,7 +7015,7 @@ label_FALSEIF_201: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -7410,7 +7411,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -7433,7 +7434,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 24($t0) +lw $t0, 112($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -7579,7 +7580,7 @@ label_FALSEIF_211: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -7975,7 +7976,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -168($fp) @@ -7998,7 +7999,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 24($t0) +lw $t0, 112($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -156($fp) @@ -8040,7 +8041,7 @@ label_FALSEIF_221: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 24($t0) + lw $t0, 112($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -196($fp) @@ -8521,7 +8522,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -68($fp) @@ -8544,7 +8545,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -9110,7 +9111,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 32($t0) +lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -9286,7 +9287,7 @@ label_FALSEIF_245: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -9309,7 +9310,7 @@ label_FALSEIF_245: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -9746,7 +9747,7 @@ label_FALSEIF_249: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -52($fp) @@ -9895,7 +9896,7 @@ label_FALSEIF_249: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -9918,7 +9919,7 @@ label_FALSEIF_249: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -10235,7 +10236,7 @@ function_method2_at_A: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 116($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -10411,7 +10412,7 @@ function_method3_at_A: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 116($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -10682,7 +10683,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 116($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -10841,7 +10842,7 @@ label_FALSEIF_259: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 116($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -11294,7 +11295,7 @@ label_WHILE_END_264: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 116($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -11469,7 +11470,7 @@ function_method5_at_B: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 116($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -11728,7 +11729,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 40($t0) +lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -12664,7 +12665,7 @@ label_FALSEIF_291: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -116($fp) @@ -12894,7 +12895,7 @@ function_method6_at_E: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 116($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -13070,7 +13071,7 @@ function_method6_at_C: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 116($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -13283,7 +13284,7 @@ function_method5_at_C: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 116($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -13491,7 +13492,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -13529,7 +13530,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -13581,7 +13582,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -13633,7 +13634,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -13671,7 +13672,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -13723,7 +13724,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -13775,7 +13776,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -104($fp) @@ -13813,7 +13814,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -120($fp) @@ -13865,7 +13866,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -13917,7 +13918,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -152($fp) @@ -13955,7 +13956,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -168($fp) @@ -14007,7 +14008,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -184($fp) @@ -14059,7 +14060,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -200($fp) @@ -14097,7 +14098,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -216($fp) @@ -14149,7 +14150,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -232($fp) @@ -14201,7 +14202,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -248($fp) @@ -14239,7 +14240,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -264($fp) @@ -14291,7 +14292,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -280($fp) @@ -14343,7 +14344,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -296($fp) @@ -14381,7 +14382,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -312($fp) @@ -14433,7 +14434,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -328($fp) @@ -14485,7 +14486,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -344($fp) @@ -14523,7 +14524,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -360($fp) @@ -14575,7 +14576,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -376($fp) @@ -14627,7 +14628,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -392($fp) @@ -14679,7 +14680,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -408($fp) @@ -14707,7 +14708,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -424($fp) @@ -14780,7 +14781,7 @@ function_prompt_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -14832,7 +14833,7 @@ function_prompt_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -14860,7 +14861,7 @@ function_prompt_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -14974,7 +14975,7 @@ function_get_int_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -15010,7 +15011,7 @@ function_get_int_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -15267,7 +15268,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 40($t0) +lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -15928,7 +15929,7 @@ label_FALSEIF_315: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -15988,7 +15989,7 @@ function_class_type_at_Main: # local_class_type_at_Main_internal_3 = 15 li $t0, 15 sw $t0, -16($fp) - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type A @@ -16010,7 +16011,7 @@ function_class_type_at_Main: lw $t0, -20($fp) sw $t0, -16($fp) label_Not_min0_325: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type B @@ -16032,7 +16033,7 @@ function_class_type_at_Main: lw $t0, -20($fp) sw $t0, -16($fp) label_Not_min1_326: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type C @@ -16054,7 +16055,7 @@ function_class_type_at_Main: lw $t0, -20($fp) sw $t0, -16($fp) label_Not_min2_327: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type D @@ -16076,7 +16077,7 @@ function_class_type_at_Main: lw $t0, -20($fp) sw $t0, -16($fp) label_Not_min3_328: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type E @@ -16098,7 +16099,7 @@ function_class_type_at_Main: lw $t0, -20($fp) sw $t0, -16($fp) label_Not_min4_329: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type Object @@ -16136,7 +16137,7 @@ function_class_type_at_Main: # IF_ZERO local_class_type_at_Main_internal_1 GOTO label_ERROR_331 lw $t0, -8($fp) beq $t0, 0, label_ERROR_331 - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type A @@ -16202,7 +16203,7 @@ function_class_type_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -16217,7 +16218,7 @@ function_class_type_at_Main: # GOTO label_END_332 j label_END_332 label_NEXT0_333: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type B @@ -16283,7 +16284,7 @@ label_NEXT0_333: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -52($fp) @@ -16298,7 +16299,7 @@ label_NEXT0_333: # GOTO label_END_332 j label_END_332 label_NEXT1_334: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type C @@ -16364,7 +16365,7 @@ label_NEXT1_334: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -16379,7 +16380,7 @@ label_NEXT1_334: # GOTO label_END_332 j label_END_332 label_NEXT2_335: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type D @@ -16445,7 +16446,7 @@ label_NEXT2_335: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -16460,7 +16461,7 @@ label_NEXT2_335: # GOTO label_END_332 j label_END_332 label_NEXT3_336: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type E @@ -16526,7 +16527,7 @@ label_NEXT3_336: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -112($fp) @@ -16541,7 +16542,7 @@ label_NEXT3_336: # GOTO label_END_332 j label_END_332 label_NEXT4_337: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type Object @@ -16607,7 +16608,7 @@ label_NEXT4_337: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -132($fp) @@ -16747,7 +16748,7 @@ function_print_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -16770,7 +16771,7 @@ function_print_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -16793,7 +16794,7 @@ function_print_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -16845,7 +16846,7 @@ function_print_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -16985,7 +16986,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -17023,7 +17024,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -17063,7 +17064,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -17086,7 +17087,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -17148,7 +17149,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -84($fp) @@ -17208,7 +17209,7 @@ label_FALSEIF_341: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -100($fp) @@ -17252,7 +17253,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 44($t0) +lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -116($fp) @@ -17280,7 +17281,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 28($t0) +lw $t0, 100($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -132($fp) @@ -17593,7 +17594,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 36($t0) +lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -180($fp) @@ -17616,7 +17617,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 116($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -168($fp) @@ -17703,7 +17704,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -204($fp) @@ -17738,7 +17739,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -216($fp) @@ -17761,7 +17762,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 24($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -192($fp) @@ -18019,7 +18020,7 @@ sw $t1, -252($fp) # local_main_at_Main_internal_65 = 15 li $t0, 15 sw $t0, -264($fp) -# local_main_at_Main_internal_66 = TYPE_DISTANCE C +# local_main_at_Main_internal_66 = TYPE_DISTANCE C # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) # Load TDT pointer to type C @@ -18041,7 +18042,7 @@ bgtu $t0, $t1, label_Not_min0_363 lw $t0, -268($fp) sw $t0, -264($fp) label_Not_min0_363: - # local_main_at_Main_internal_66 = TYPE_DISTANCE A + # local_main_at_Main_internal_66 = TYPE_DISTANCE A # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) # Load TDT pointer to type A @@ -18063,7 +18064,7 @@ label_Not_min0_363: lw $t0, -268($fp) sw $t0, -264($fp) label_Not_min1_364: - # local_main_at_Main_internal_66 = TYPE_DISTANCE Object + # local_main_at_Main_internal_66 = TYPE_DISTANCE Object # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) # Load TDT pointer to type Object @@ -18101,7 +18102,7 @@ label_Not_min0_363: # IF_ZERO local_main_at_Main_internal_63 GOTO label_ERROR_366 lw $t0, -256($fp) beq $t0, 0, label_ERROR_366 - # local_main_at_Main_internal_66 = TYPE_DISTANCE C + # local_main_at_Main_internal_66 = TYPE_DISTANCE C # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) # Load TDT pointer to type C @@ -18148,7 +18149,7 @@ label_Not_min0_363: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -288($fp) @@ -18171,7 +18172,7 @@ label_Not_min0_363: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -280($fp) @@ -18187,7 +18188,7 @@ label_Not_min0_363: # GOTO label_END_367 j label_END_367 label_NEXT0_368: - # local_main_at_Main_internal_66 = TYPE_DISTANCE A + # local_main_at_Main_internal_66 = TYPE_DISTANCE A # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) # Load TDT pointer to type A @@ -18234,7 +18235,7 @@ label_NEXT0_368: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -308($fp) @@ -18257,7 +18258,7 @@ label_NEXT0_368: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -300($fp) @@ -18273,7 +18274,7 @@ label_NEXT0_368: # GOTO label_END_367 j label_END_367 label_NEXT1_369: - # local_main_at_Main_internal_66 = TYPE_DISTANCE Object + # local_main_at_Main_internal_66 = TYPE_DISTANCE Object # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) # Load TDT pointer to type Object @@ -18339,7 +18340,7 @@ label_NEXT1_369: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -320($fp) @@ -18367,7 +18368,7 @@ label_NEXT1_369: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 124($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -336($fp) @@ -18740,7 +18741,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 36($t0) +lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -388($fp) @@ -18763,7 +18764,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 116($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -376($fp) @@ -18850,7 +18851,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -412($fp) @@ -18885,7 +18886,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -424($fp) @@ -18908,7 +18909,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 32($t0) +lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -400($fp) @@ -19222,7 +19223,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -468($fp) @@ -19243,7 +19244,7 @@ lw $s1, -460($fp) # Get pointer to type's VTABLE la $t0, A_vtable # Get pointer to function address -lw $t1, 36($t0) +lw $t1, 0($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -456($fp) @@ -19557,7 +19558,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -512($fp) @@ -19578,7 +19579,7 @@ lw $s1, -504($fp) # Get pointer to type's VTABLE la $t0, B_vtable # Get pointer to function address -lw $t1, 36($t0) +lw $t1, 0($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -500($fp) @@ -19892,7 +19893,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -556($fp) @@ -19913,7 +19914,7 @@ lw $s1, -548($fp) # Get pointer to type's VTABLE la $t0, C_vtable # Get pointer to function address -lw $t1, 36($t0) +lw $t1, 0($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -544($fp) @@ -20232,7 +20233,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -612($fp) @@ -20255,7 +20256,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 40($t0) +lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -600($fp) @@ -20317,7 +20318,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -624($fp) @@ -20355,7 +20356,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 48($t0) +lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -640($fp) @@ -20407,7 +20408,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -656($fp) @@ -20467,7 +20468,7 @@ label_FALSEIF_421: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -672($fp) @@ -20505,7 +20506,7 @@ label_FALSEIF_421: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -688($fp) @@ -20557,7 +20558,7 @@ label_FALSEIF_421: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -704($fp) @@ -20885,7 +20886,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -760($fp) @@ -20908,7 +20909,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 44($t0) +lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -748($fp) @@ -20973,7 +20974,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -780($fp) @@ -20998,7 +20999,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -796($fp) @@ -21162,7 +21163,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -808($fp) @@ -21200,7 +21201,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 48($t0) +lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -824($fp) @@ -21252,7 +21253,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -840($fp) @@ -21286,7 +21287,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 48($t0) +lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -856($fp) @@ -21338,7 +21339,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -868($fp) @@ -21427,7 +21428,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 28($t0) +lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -904($fp) @@ -21450,7 +21451,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -892($fp) @@ -21502,7 +21503,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -912($fp) @@ -22143,7 +22144,7 @@ label_FALSEIF_443: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -996($fp) @@ -22166,7 +22167,7 @@ label_FALSEIF_443: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 96($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -984($fp) diff --git a/tests/codegen/atoi.mips b/tests/codegen/atoi.mips new file mode 100644 index 00000000..718cf846 --- /dev/null +++ b/tests/codegen/atoi.mips @@ -0,0 +1,10086 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:14 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +A2I: .asciiz "A2I" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_copy_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_copy_at_Object, dummy, dummy, function_length_at_String, dummy, dummy, dummy, dummy, function_concat_at_String, dummy, dummy, function_substr_at_String, dummy, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type A2I **** +A2I_vtable: .word function_abort_at_Object, function_copy_at_Object, dummy, function_a2i_at_A2I, dummy, dummy, function_i2a_at_A2I, dummy, function_i2a_aux_at_A2I, dummy, function_i2c_at_A2I, dummy, dummy, dummy, function_a2i_aux_at_A2I, function_type_name_at_Object, function_c2i_at_A2I +# Function END +# + + +# **** Type RECORD for type A2I **** +A2I_start: + A2I_vtable_pointer: .word A2I_vtable + # Function END +A2I_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_copy_at_Object, function_out_string_at_IO, dummy, dummy, function_main_at_Main, dummy, function_out_int_at_IO, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1 +A2I__TDT: .word -1, -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "0" +# + + +data_5: .asciiz "1" +# + + +data_6: .asciiz "2" +# + + +data_7: .asciiz "3" +# + + +data_8: .asciiz "4" +# + + +data_9: .asciiz "5" +# + + +data_10: .asciiz "6" +# + + +data_11: .asciiz "7" +# + + +data_12: .asciiz "8" +# + + +data_13: .asciiz "9" +# + + +data_14: .asciiz "0" +# + + +data_15: .asciiz "1" +# + + +data_16: .asciiz "2" +# + + +data_17: .asciiz "3" +# + + +data_18: .asciiz "4" +# + + +data_19: .asciiz "5" +# + + +data_20: .asciiz "6" +# + + +data_21: .asciiz "7" +# + + +data_22: .asciiz "8" +# + + +data_23: .asciiz "9" +# + + +data_24: .asciiz "" +# + + +data_25: .asciiz "-" +# + + +data_26: .asciiz "+" +# + + +data_27: .asciiz "0" +# + + +data_28: .asciiz "-" +# + + +data_29: .asciiz "" +# + + +data_30: .asciiz "678987" +# + + +data_31: .asciiz " == " +# + + +data_32: .asciiz "\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 20($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_c2i_at_A2I implementation. +# @Params: +# 0($fp) = param_c2i_at_A2I_char_0 +function_c2i_at_A2I: + # Allocate stack frame for function function_c2i_at_A2I. + subu $sp, $sp, 264 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 264 + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -20($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_3 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_3 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_3 + # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_3 + # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_3 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_3 + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_6 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_6 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_6 + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_7 + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_7 + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_4 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_COMPARE_BY_VALUE_7: + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_4 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_COMPARE_STRING_6: + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_CONTINUE_8 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_CONTINUE_8 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_8 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_CONTINUE_8: + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_9: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_10 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_9 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_10: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_4 + label_FALSE_3: + # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_5 +j label_END_5 +label_TRUE_4: + # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_5: +# LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) +# LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSEIF_1 +# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSEIF_1 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_1 +# LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -24($fp) +# LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) +# LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) +# local_c2i_at_A2I_internal_1 = local_c2i_at_A2I_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -44($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_13 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_13 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_13 + # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_13 + # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_13 + lw $t0, -44($fp) + beq $t0, 0, label_FALSE_13 + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_STRING_16 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_STRING_16 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_16 + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_17 + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_17 + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -44($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_14 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_COMPARE_BY_VALUE_17: + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + lw $a0, 0($fp) + lw $a1, -44($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_14 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_COMPARE_STRING_16: + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_CONTINUE_18 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_CONTINUE_18 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_18 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_CONTINUE_18: + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_19: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_20 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_19 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_20: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_14 + label_FALSE_13: + # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_15 +j label_END_15 +label_TRUE_14: + # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_15: +# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) +# LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSEIF_11 +# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSEIF_11 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_11 +# LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -48($fp) +# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) +# LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) +# local_c2i_at_A2I_internal_7 = local_c2i_at_A2I_internal_11 +lw $t0, -48($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_12 +j label_ENDIF_12 +label_FALSEIF_11: + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_6 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -68($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_23 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_23 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_23 + # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_23 + # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_23 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_23 + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_STRING_26 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_STRING_26 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_STRING_26 + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_27 + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_27 + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_24 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_COMPARE_BY_VALUE_27: + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + lw $a0, 0($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_24 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_COMPARE_STRING_26: + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_CONTINUE_28 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_CONTINUE_28 + lw $t0, -64($fp) + beq $t0, 0, label_CONTINUE_28 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_CONTINUE_28: + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_29: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_30 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_29 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_30: + # Store result + sw $a2, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_24 + label_FALSE_23: + # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # GOTO label_END_25 +j label_END_25 +label_TRUE_24: + # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + label_END_25: +# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) +# LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) +# Obtain value from -60($fp) +lw $v0, -60($fp) +lw $v0, 12($v0) +sw $v0, -52($fp) +# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSEIF_21 +# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSEIF_21 +lw $t0, -52($fp) +beq $t0, 0, label_FALSEIF_21 +# LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 2 +sw $t0, 12($v0) +sw $v0, -72($fp) +# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) +# LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) +# local_c2i_at_A2I_internal_13 = local_c2i_at_A2I_internal_17 +lw $t0, -72($fp) +sw $t0, -56($fp) +# GOTO label_ENDIF_22 +j label_ENDIF_22 +label_FALSEIF_21: + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_7 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -92($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_33 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_33 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_33 + # IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_FALSE_33 + # IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_FALSE_33 + lw $t0, -92($fp) + beq $t0, 0, label_FALSE_33 + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_STRING_36 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_STRING_36 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_STRING_36 + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_37 + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_37 + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -92($fp) + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_34 + # GOTO label_FALSE_33 + j label_FALSE_33 + label_COMPARE_BY_VALUE_37: + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + lw $a0, 0($fp) + lw $a1, -92($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_34 + # GOTO label_FALSE_33 + j label_FALSE_33 + label_COMPARE_STRING_36: + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_CONTINUE_38 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_CONTINUE_38 + lw $t0, -88($fp) + beq $t0, 0, label_CONTINUE_38 + # GOTO label_FALSE_33 + j label_FALSE_33 + label_CONTINUE_38: + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_39: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_40 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_39 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_40: + # Store result + sw $a2, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_34 + label_FALSE_33: + # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -84($fp) + # GOTO label_END_35 +j label_END_35 +label_TRUE_34: + # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -84($fp) + label_END_35: +# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) +# LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) +# Obtain value from -84($fp) +lw $v0, -84($fp) +lw $v0, 12($v0) +sw $v0, -76($fp) +# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSEIF_31 +# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSEIF_31 +lw $t0, -76($fp) +beq $t0, 0, label_FALSEIF_31 +# LOCAL local_c2i_at_A2I_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 3 +sw $t0, 12($v0) +sw $v0, -96($fp) +# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) +# LOCAL local_c2i_at_A2I_internal_23 --> -96($fp) +# local_c2i_at_A2I_internal_19 = local_c2i_at_A2I_internal_23 +lw $t0, -96($fp) +sw $t0, -80($fp) +# GOTO label_ENDIF_32 +j label_ENDIF_32 +label_FALSEIF_31: + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_8 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -116($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_43 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_43 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_43 + # IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_FALSE_43 + # IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_FALSE_43 + lw $t0, -116($fp) + beq $t0, 0, label_FALSE_43 + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_STRING_46 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_STRING_46 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_STRING_46 + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_47 + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_47 + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -116($fp) + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_44 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_COMPARE_BY_VALUE_47: + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + lw $a0, 0($fp) + lw $a1, -116($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_44 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_COMPARE_STRING_46: + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_CONTINUE_48 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_CONTINUE_48 + lw $t0, -112($fp) + beq $t0, 0, label_CONTINUE_48 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_CONTINUE_48: + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_49: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_50 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_49 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_50: + # Store result + sw $a2, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_44 + label_FALSE_43: + # LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -108($fp) + # GOTO label_END_45 +j label_END_45 +label_TRUE_44: + # LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -108($fp) + label_END_45: +# LOCAL local_c2i_at_A2I_internal_24 --> -100($fp) +# LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) +# Obtain value from -108($fp) +lw $v0, -108($fp) +lw $v0, 12($v0) +sw $v0, -100($fp) +# IF_ZERO local_c2i_at_A2I_internal_24 GOTO label_FALSEIF_41 +# IF_ZERO local_c2i_at_A2I_internal_24 GOTO label_FALSEIF_41 +lw $t0, -100($fp) +beq $t0, 0, label_FALSEIF_41 +# LOCAL local_c2i_at_A2I_internal_29 --> -120($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 4 +sw $t0, 12($v0) +sw $v0, -120($fp) +# LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) +# LOCAL local_c2i_at_A2I_internal_29 --> -120($fp) +# local_c2i_at_A2I_internal_25 = local_c2i_at_A2I_internal_29 +lw $t0, -120($fp) +sw $t0, -104($fp) +# GOTO label_ENDIF_42 +j label_ENDIF_42 +label_FALSEIF_41: + # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_9 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -140($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_53 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_53 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_53 + # IF_ZERO local_c2i_at_A2I_internal_34 GOTO label_FALSE_53 + # IF_ZERO local_c2i_at_A2I_internal_34 GOTO label_FALSE_53 + lw $t0, -140($fp) + beq $t0, 0, label_FALSE_53 + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_STRING_56 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_STRING_56 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_STRING_56 + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_57 + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_57 + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -140($fp) + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_54 + # GOTO label_FALSE_53 + j label_FALSE_53 + label_COMPARE_BY_VALUE_57: + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) + lw $a0, 0($fp) + lw $a1, -140($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_54 + # GOTO label_FALSE_53 + j label_FALSE_53 + label_COMPARE_STRING_56: + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_CONTINUE_58 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_CONTINUE_58 + lw $t0, -136($fp) + beq $t0, 0, label_CONTINUE_58 + # GOTO label_FALSE_53 + j label_FALSE_53 + label_CONTINUE_58: + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_59: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_60 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_59 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_60: + # Store result + sw $a2, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_54 + label_FALSE_53: + # LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -132($fp) + # GOTO label_END_55 +j label_END_55 +label_TRUE_54: + # LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -132($fp) + label_END_55: +# LOCAL local_c2i_at_A2I_internal_30 --> -124($fp) +# LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) +# Obtain value from -132($fp) +lw $v0, -132($fp) +lw $v0, 12($v0) +sw $v0, -124($fp) +# IF_ZERO local_c2i_at_A2I_internal_30 GOTO label_FALSEIF_51 +# IF_ZERO local_c2i_at_A2I_internal_30 GOTO label_FALSEIF_51 +lw $t0, -124($fp) +beq $t0, 0, label_FALSEIF_51 +# LOCAL local_c2i_at_A2I_internal_35 --> -144($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 5 +sw $t0, 12($v0) +sw $v0, -144($fp) +# LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) +# LOCAL local_c2i_at_A2I_internal_35 --> -144($fp) +# local_c2i_at_A2I_internal_31 = local_c2i_at_A2I_internal_35 +lw $t0, -144($fp) +sw $t0, -128($fp) +# GOTO label_ENDIF_52 +j label_ENDIF_52 +label_FALSEIF_51: + # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_10 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -164($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_63 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_63 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_63 + # IF_ZERO local_c2i_at_A2I_internal_40 GOTO label_FALSE_63 + # IF_ZERO local_c2i_at_A2I_internal_40 GOTO label_FALSE_63 + lw $t0, -164($fp) + beq $t0, 0, label_FALSE_63 + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_STRING_66 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_STRING_66 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_STRING_66 + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_67 + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_67 + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -164($fp) + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_64 + # GOTO label_FALSE_63 + j label_FALSE_63 + label_COMPARE_BY_VALUE_67: + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) + lw $a0, 0($fp) + lw $a1, -164($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_64 + # GOTO label_FALSE_63 + j label_FALSE_63 + label_COMPARE_STRING_66: + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_CONTINUE_68 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_CONTINUE_68 + lw $t0, -160($fp) + beq $t0, 0, label_CONTINUE_68 + # GOTO label_FALSE_63 + j label_FALSE_63 + label_CONTINUE_68: + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_69: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_70 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_69 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_70: + # Store result + sw $a2, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_64 + label_FALSE_63: + # LOCAL local_c2i_at_A2I_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -156($fp) + # GOTO label_END_65 +j label_END_65 +label_TRUE_64: + # LOCAL local_c2i_at_A2I_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -156($fp) + label_END_65: +# LOCAL local_c2i_at_A2I_internal_36 --> -148($fp) +# LOCAL local_c2i_at_A2I_internal_38 --> -156($fp) +# Obtain value from -156($fp) +lw $v0, -156($fp) +lw $v0, 12($v0) +sw $v0, -148($fp) +# IF_ZERO local_c2i_at_A2I_internal_36 GOTO label_FALSEIF_61 +# IF_ZERO local_c2i_at_A2I_internal_36 GOTO label_FALSEIF_61 +lw $t0, -148($fp) +beq $t0, 0, label_FALSEIF_61 +# LOCAL local_c2i_at_A2I_internal_41 --> -168($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 6 +sw $t0, 12($v0) +sw $v0, -168($fp) +# LOCAL local_c2i_at_A2I_internal_37 --> -152($fp) +# LOCAL local_c2i_at_A2I_internal_41 --> -168($fp) +# local_c2i_at_A2I_internal_37 = local_c2i_at_A2I_internal_41 +lw $t0, -168($fp) +sw $t0, -152($fp) +# GOTO label_ENDIF_62 +j label_ENDIF_62 +label_FALSEIF_61: + # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_11 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -188($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_73 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_73 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_73 + # IF_ZERO local_c2i_at_A2I_internal_46 GOTO label_FALSE_73 + # IF_ZERO local_c2i_at_A2I_internal_46 GOTO label_FALSE_73 + lw $t0, -188($fp) + beq $t0, 0, label_FALSE_73 + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_STRING_76 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_STRING_76 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_STRING_76 + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_77 + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_77 + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -188($fp) + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_74 + # GOTO label_FALSE_73 + j label_FALSE_73 + label_COMPARE_BY_VALUE_77: + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) + lw $a0, 0($fp) + lw $a1, -188($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_74 + # GOTO label_FALSE_73 + j label_FALSE_73 + label_COMPARE_STRING_76: + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_CONTINUE_78 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_CONTINUE_78 + lw $t0, -184($fp) + beq $t0, 0, label_CONTINUE_78 + # GOTO label_FALSE_73 + j label_FALSE_73 + label_CONTINUE_78: + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_79: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_80 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_79 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_80: + # Store result + sw $a2, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_74 + label_FALSE_73: + # LOCAL local_c2i_at_A2I_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -180($fp) + # GOTO label_END_75 +j label_END_75 +label_TRUE_74: + # LOCAL local_c2i_at_A2I_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -180($fp) + label_END_75: +# LOCAL local_c2i_at_A2I_internal_42 --> -172($fp) +# LOCAL local_c2i_at_A2I_internal_44 --> -180($fp) +# Obtain value from -180($fp) +lw $v0, -180($fp) +lw $v0, 12($v0) +sw $v0, -172($fp) +# IF_ZERO local_c2i_at_A2I_internal_42 GOTO label_FALSEIF_71 +# IF_ZERO local_c2i_at_A2I_internal_42 GOTO label_FALSEIF_71 +lw $t0, -172($fp) +beq $t0, 0, label_FALSEIF_71 +# LOCAL local_c2i_at_A2I_internal_47 --> -192($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 7 +sw $t0, 12($v0) +sw $v0, -192($fp) +# LOCAL local_c2i_at_A2I_internal_43 --> -176($fp) +# LOCAL local_c2i_at_A2I_internal_47 --> -192($fp) +# local_c2i_at_A2I_internal_43 = local_c2i_at_A2I_internal_47 +lw $t0, -192($fp) +sw $t0, -176($fp) +# GOTO label_ENDIF_72 +j label_ENDIF_72 +label_FALSEIF_71: + # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_12 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -212($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_83 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_83 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_83 + # IF_ZERO local_c2i_at_A2I_internal_52 GOTO label_FALSE_83 + # IF_ZERO local_c2i_at_A2I_internal_52 GOTO label_FALSE_83 + lw $t0, -212($fp) + beq $t0, 0, label_FALSE_83 + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_STRING_86 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_STRING_86 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_STRING_86 + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_87 + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_87 + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -212($fp) + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_84 + # GOTO label_FALSE_83 + j label_FALSE_83 + label_COMPARE_BY_VALUE_87: + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) + lw $a0, 0($fp) + lw $a1, -212($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_84 + # GOTO label_FALSE_83 + j label_FALSE_83 + label_COMPARE_STRING_86: + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_CONTINUE_88 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_CONTINUE_88 + lw $t0, -208($fp) + beq $t0, 0, label_CONTINUE_88 + # GOTO label_FALSE_83 + j label_FALSE_83 + label_CONTINUE_88: + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_89: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_90 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_89 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_90: + # Store result + sw $a2, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_84 + label_FALSE_83: + # LOCAL local_c2i_at_A2I_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -204($fp) + # GOTO label_END_85 +j label_END_85 +label_TRUE_84: + # LOCAL local_c2i_at_A2I_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -204($fp) + label_END_85: +# LOCAL local_c2i_at_A2I_internal_48 --> -196($fp) +# LOCAL local_c2i_at_A2I_internal_50 --> -204($fp) +# Obtain value from -204($fp) +lw $v0, -204($fp) +lw $v0, 12($v0) +sw $v0, -196($fp) +# IF_ZERO local_c2i_at_A2I_internal_48 GOTO label_FALSEIF_81 +# IF_ZERO local_c2i_at_A2I_internal_48 GOTO label_FALSEIF_81 +lw $t0, -196($fp) +beq $t0, 0, label_FALSEIF_81 +# LOCAL local_c2i_at_A2I_internal_53 --> -216($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 8 +sw $t0, 12($v0) +sw $v0, -216($fp) +# LOCAL local_c2i_at_A2I_internal_49 --> -200($fp) +# LOCAL local_c2i_at_A2I_internal_53 --> -216($fp) +# local_c2i_at_A2I_internal_49 = local_c2i_at_A2I_internal_53 +lw $t0, -216($fp) +sw $t0, -200($fp) +# GOTO label_ENDIF_82 +j label_ENDIF_82 +label_FALSEIF_81: + # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_13 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -236($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_93 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_93 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_93 + # IF_ZERO local_c2i_at_A2I_internal_58 GOTO label_FALSE_93 + # IF_ZERO local_c2i_at_A2I_internal_58 GOTO label_FALSE_93 + lw $t0, -236($fp) + beq $t0, 0, label_FALSE_93 + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_STRING_96 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_STRING_96 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_STRING_96 + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_97 + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_97 + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -236($fp) + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_94 + # GOTO label_FALSE_93 + j label_FALSE_93 + label_COMPARE_BY_VALUE_97: + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) + lw $a0, 0($fp) + lw $a1, -236($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_94 + # GOTO label_FALSE_93 + j label_FALSE_93 + label_COMPARE_STRING_96: + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_CONTINUE_98 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_CONTINUE_98 + lw $t0, -232($fp) + beq $t0, 0, label_CONTINUE_98 + # GOTO label_FALSE_93 + j label_FALSE_93 + label_CONTINUE_98: + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_99: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_100 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_99 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_100: + # Store result + sw $a2, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_94 + label_FALSE_93: + # LOCAL local_c2i_at_A2I_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -228($fp) + # GOTO label_END_95 +j label_END_95 +label_TRUE_94: + # LOCAL local_c2i_at_A2I_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -228($fp) + label_END_95: +# LOCAL local_c2i_at_A2I_internal_54 --> -220($fp) +# LOCAL local_c2i_at_A2I_internal_56 --> -228($fp) +# Obtain value from -228($fp) +lw $v0, -228($fp) +lw $v0, 12($v0) +sw $v0, -220($fp) +# IF_ZERO local_c2i_at_A2I_internal_54 GOTO label_FALSEIF_91 +# IF_ZERO local_c2i_at_A2I_internal_54 GOTO label_FALSEIF_91 +lw $t0, -220($fp) +beq $t0, 0, label_FALSEIF_91 +# LOCAL local_c2i_at_A2I_internal_59 --> -240($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 9 +sw $t0, 12($v0) +sw $v0, -240($fp) +# LOCAL local_c2i_at_A2I_internal_55 --> -224($fp) +# LOCAL local_c2i_at_A2I_internal_59 --> -240($fp) +# local_c2i_at_A2I_internal_55 = local_c2i_at_A2I_internal_59 +lw $t0, -240($fp) +sw $t0, -224($fp) +# GOTO label_ENDIF_92 +j label_ENDIF_92 +label_FALSEIF_91: + # LOCAL local_c2i_at_A2I_internal_62 --> -252($fp) + # local_c2i_at_A2I_internal_62 = SELF + sw $s1, -252($fp) + # LOCAL local_c2i_at_A2I_internal_60 --> -244($fp) + # LOCAL local_c2i_at_A2I_internal_62 --> -252($fp) + # local_c2i_at_A2I_internal_60 = local_c2i_at_A2I_internal_62 + lw $t0, -252($fp) + sw $t0, -244($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_c2i_at_A2I_internal_60 --> -244($fp) + # LOCAL local_c2i_at_A2I_internal_61 --> -248($fp) + # local_c2i_at_A2I_internal_61 = VCALL local_c2i_at_A2I_internal_60 abort + # Save new self pointer in $s1 + lw $s1, -244($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -248($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_c2i_at_A2I_internal_63 --> -256($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -256($fp) + # LOCAL local_c2i_at_A2I_internal_55 --> -224($fp) + # LOCAL local_c2i_at_A2I_internal_63 --> -256($fp) + # local_c2i_at_A2I_internal_55 = local_c2i_at_A2I_internal_63 + lw $t0, -256($fp) + sw $t0, -224($fp) + label_ENDIF_92: +# LOCAL local_c2i_at_A2I_internal_49 --> -200($fp) +# LOCAL local_c2i_at_A2I_internal_55 --> -224($fp) +# local_c2i_at_A2I_internal_49 = local_c2i_at_A2I_internal_55 +lw $t0, -224($fp) +sw $t0, -200($fp) +label_ENDIF_82: +# LOCAL local_c2i_at_A2I_internal_43 --> -176($fp) +# LOCAL local_c2i_at_A2I_internal_49 --> -200($fp) +# local_c2i_at_A2I_internal_43 = local_c2i_at_A2I_internal_49 +lw $t0, -200($fp) +sw $t0, -176($fp) +label_ENDIF_72: +# LOCAL local_c2i_at_A2I_internal_37 --> -152($fp) +# LOCAL local_c2i_at_A2I_internal_43 --> -176($fp) +# local_c2i_at_A2I_internal_37 = local_c2i_at_A2I_internal_43 +lw $t0, -176($fp) +sw $t0, -152($fp) +label_ENDIF_62: +# LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) +# LOCAL local_c2i_at_A2I_internal_37 --> -152($fp) +# local_c2i_at_A2I_internal_31 = local_c2i_at_A2I_internal_37 +lw $t0, -152($fp) +sw $t0, -128($fp) +label_ENDIF_52: +# LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) +# LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) +# local_c2i_at_A2I_internal_25 = local_c2i_at_A2I_internal_31 +lw $t0, -128($fp) +sw $t0, -104($fp) +label_ENDIF_42: +# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) +# LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) +# local_c2i_at_A2I_internal_19 = local_c2i_at_A2I_internal_25 +lw $t0, -104($fp) +sw $t0, -80($fp) +label_ENDIF_32: +# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) +# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) +# local_c2i_at_A2I_internal_13 = local_c2i_at_A2I_internal_19 +lw $t0, -80($fp) +sw $t0, -56($fp) +label_ENDIF_22: +# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) +# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) +# local_c2i_at_A2I_internal_7 = local_c2i_at_A2I_internal_13 +lw $t0, -56($fp) +sw $t0, -32($fp) +label_ENDIF_12: +# LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) +# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) +# local_c2i_at_A2I_internal_1 = local_c2i_at_A2I_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +label_ENDIF_2: +# RETURN local_c2i_at_A2I_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_c2i_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 264 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_i2c_at_A2I implementation. +# @Params: +# 0($fp) = param_i2c_at_A2I_i_0 +function_i2c_at_A2I: + # Allocate stack frame for function function_i2c_at_A2I. + subu $sp, $sp, 264 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 264 + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_103 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_103 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_103 + # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_103 + # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_103 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_103 + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_STRING_106 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_STRING_106 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_106 + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_107 + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_107 + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_104 + # GOTO label_FALSE_103 + j label_FALSE_103 + label_COMPARE_BY_VALUE_107: + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_104 + # GOTO label_FALSE_103 + j label_FALSE_103 + label_COMPARE_STRING_106: + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_CONTINUE_108 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_CONTINUE_108 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_108 + # GOTO label_FALSE_103 + j label_FALSE_103 + label_CONTINUE_108: + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_109: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_110 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_109 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_110: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_104 + label_FALSE_103: + # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_105 +j label_END_105 +label_TRUE_104: + # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_105: +# LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSEIF_101 +# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSEIF_101 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_101 +# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_14 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -24($fp) +# LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) +# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) +# local_i2c_at_A2I_internal_1 = local_i2c_at_A2I_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_102 +j label_ENDIF_102 +label_FALSEIF_101: + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_113 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_113 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_113 + # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_113 + # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_113 + lw $t0, -44($fp) + beq $t0, 0, label_FALSE_113 + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_STRING_116 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_STRING_116 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_116 + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_117 + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_117 + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -44($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_114 + # GOTO label_FALSE_113 + j label_FALSE_113 + label_COMPARE_BY_VALUE_117: + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + lw $a0, 0($fp) + lw $a1, -44($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_114 + # GOTO label_FALSE_113 + j label_FALSE_113 + label_COMPARE_STRING_116: + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_CONTINUE_118 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_CONTINUE_118 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_118 + # GOTO label_FALSE_113 + j label_FALSE_113 + label_CONTINUE_118: + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_119: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_120 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_119 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_120: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_114 + label_FALSE_113: + # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_115 +j label_END_115 +label_TRUE_114: + # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_115: +# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) +# LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSEIF_111 +# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSEIF_111 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_111 +# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_15 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -48($fp) +# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) +# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) +# local_i2c_at_A2I_internal_7 = local_i2c_at_A2I_internal_11 +lw $t0, -48($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_112 +j label_ENDIF_112 +label_FALSEIF_111: + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 2 + sw $t0, 12($v0) + sw $v0, -68($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_123 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_123 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_123 + # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_123 + # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_123 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_123 + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_STRING_126 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_STRING_126 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_STRING_126 + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_127 + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_127 + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_124 + # GOTO label_FALSE_123 + j label_FALSE_123 + label_COMPARE_BY_VALUE_127: + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + lw $a0, 0($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_124 + # GOTO label_FALSE_123 + j label_FALSE_123 + label_COMPARE_STRING_126: + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_CONTINUE_128 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_CONTINUE_128 + lw $t0, -64($fp) + beq $t0, 0, label_CONTINUE_128 + # GOTO label_FALSE_123 + j label_FALSE_123 + label_CONTINUE_128: + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_129: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_130 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_129 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_130: + # Store result + sw $a2, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_124 + label_FALSE_123: + # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # GOTO label_END_125 +j label_END_125 +label_TRUE_124: + # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + label_END_125: +# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) +# LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) +# Obtain value from -60($fp) +lw $v0, -60($fp) +lw $v0, 12($v0) +sw $v0, -52($fp) +# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSEIF_121 +# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSEIF_121 +lw $t0, -52($fp) +beq $t0, 0, label_FALSEIF_121 +# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_16 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -72($fp) +# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) +# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) +# local_i2c_at_A2I_internal_13 = local_i2c_at_A2I_internal_17 +lw $t0, -72($fp) +sw $t0, -56($fp) +# GOTO label_ENDIF_122 +j label_ENDIF_122 +label_FALSEIF_121: + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 3 + sw $t0, 12($v0) + sw $v0, -92($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_133 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_133 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_133 + # IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_FALSE_133 + # IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_FALSE_133 + lw $t0, -92($fp) + beq $t0, 0, label_FALSE_133 + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_STRING_136 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_STRING_136 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_STRING_136 + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_137 + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_137 + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -92($fp) + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_134 + # GOTO label_FALSE_133 + j label_FALSE_133 + label_COMPARE_BY_VALUE_137: + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + lw $a0, 0($fp) + lw $a1, -92($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_134 + # GOTO label_FALSE_133 + j label_FALSE_133 + label_COMPARE_STRING_136: + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_CONTINUE_138 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_CONTINUE_138 + lw $t0, -88($fp) + beq $t0, 0, label_CONTINUE_138 + # GOTO label_FALSE_133 + j label_FALSE_133 + label_CONTINUE_138: + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_139: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_140 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_139 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_140: + # Store result + sw $a2, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_134 + label_FALSE_133: + # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -84($fp) + # GOTO label_END_135 +j label_END_135 +label_TRUE_134: + # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -84($fp) + label_END_135: +# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) +# LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) +# Obtain value from -84($fp) +lw $v0, -84($fp) +lw $v0, 12($v0) +sw $v0, -76($fp) +# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSEIF_131 +# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSEIF_131 +lw $t0, -76($fp) +beq $t0, 0, label_FALSEIF_131 +# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_17 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -96($fp) +# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) +# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) +# local_i2c_at_A2I_internal_19 = local_i2c_at_A2I_internal_23 +lw $t0, -96($fp) +sw $t0, -80($fp) +# GOTO label_ENDIF_132 +j label_ENDIF_132 +label_FALSEIF_131: + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 4 + sw $t0, 12($v0) + sw $v0, -116($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_143 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_143 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_143 + # IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_FALSE_143 + # IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_FALSE_143 + lw $t0, -116($fp) + beq $t0, 0, label_FALSE_143 + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_STRING_146 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_STRING_146 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_STRING_146 + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_147 + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_147 + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -116($fp) + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_144 + # GOTO label_FALSE_143 + j label_FALSE_143 + label_COMPARE_BY_VALUE_147: + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + lw $a0, 0($fp) + lw $a1, -116($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_144 + # GOTO label_FALSE_143 + j label_FALSE_143 + label_COMPARE_STRING_146: + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_CONTINUE_148 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_CONTINUE_148 + lw $t0, -112($fp) + beq $t0, 0, label_CONTINUE_148 + # GOTO label_FALSE_143 + j label_FALSE_143 + label_CONTINUE_148: + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_149: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_150 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_149 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_150: + # Store result + sw $a2, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_144 + label_FALSE_143: + # LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -108($fp) + # GOTO label_END_145 +j label_END_145 +label_TRUE_144: + # LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -108($fp) + label_END_145: +# LOCAL local_i2c_at_A2I_internal_24 --> -100($fp) +# LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) +# Obtain value from -108($fp) +lw $v0, -108($fp) +lw $v0, 12($v0) +sw $v0, -100($fp) +# IF_ZERO local_i2c_at_A2I_internal_24 GOTO label_FALSEIF_141 +# IF_ZERO local_i2c_at_A2I_internal_24 GOTO label_FALSEIF_141 +lw $t0, -100($fp) +beq $t0, 0, label_FALSEIF_141 +# LOCAL local_i2c_at_A2I_internal_29 --> -120($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_18 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -120($fp) +# LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) +# LOCAL local_i2c_at_A2I_internal_29 --> -120($fp) +# local_i2c_at_A2I_internal_25 = local_i2c_at_A2I_internal_29 +lw $t0, -120($fp) +sw $t0, -104($fp) +# GOTO label_ENDIF_142 +j label_ENDIF_142 +label_FALSEIF_141: + # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 5 + sw $t0, 12($v0) + sw $v0, -140($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_153 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_153 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_153 + # IF_ZERO local_i2c_at_A2I_internal_34 GOTO label_FALSE_153 + # IF_ZERO local_i2c_at_A2I_internal_34 GOTO label_FALSE_153 + lw $t0, -140($fp) + beq $t0, 0, label_FALSE_153 + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_STRING_156 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_STRING_156 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_STRING_156 + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_157 + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_157 + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -140($fp) + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_154 + # GOTO label_FALSE_153 + j label_FALSE_153 + label_COMPARE_BY_VALUE_157: + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) + lw $a0, 0($fp) + lw $a1, -140($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_154 + # GOTO label_FALSE_153 + j label_FALSE_153 + label_COMPARE_STRING_156: + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_CONTINUE_158 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_CONTINUE_158 + lw $t0, -136($fp) + beq $t0, 0, label_CONTINUE_158 + # GOTO label_FALSE_153 + j label_FALSE_153 + label_CONTINUE_158: + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_159: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_160 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_159 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_160: + # Store result + sw $a2, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_154 + label_FALSE_153: + # LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -132($fp) + # GOTO label_END_155 +j label_END_155 +label_TRUE_154: + # LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -132($fp) + label_END_155: +# LOCAL local_i2c_at_A2I_internal_30 --> -124($fp) +# LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) +# Obtain value from -132($fp) +lw $v0, -132($fp) +lw $v0, 12($v0) +sw $v0, -124($fp) +# IF_ZERO local_i2c_at_A2I_internal_30 GOTO label_FALSEIF_151 +# IF_ZERO local_i2c_at_A2I_internal_30 GOTO label_FALSEIF_151 +lw $t0, -124($fp) +beq $t0, 0, label_FALSEIF_151 +# LOCAL local_i2c_at_A2I_internal_35 --> -144($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_19 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -144($fp) +# LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) +# LOCAL local_i2c_at_A2I_internal_35 --> -144($fp) +# local_i2c_at_A2I_internal_31 = local_i2c_at_A2I_internal_35 +lw $t0, -144($fp) +sw $t0, -128($fp) +# GOTO label_ENDIF_152 +j label_ENDIF_152 +label_FALSEIF_151: + # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 6 + sw $t0, 12($v0) + sw $v0, -164($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_163 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_163 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_163 + # IF_ZERO local_i2c_at_A2I_internal_40 GOTO label_FALSE_163 + # IF_ZERO local_i2c_at_A2I_internal_40 GOTO label_FALSE_163 + lw $t0, -164($fp) + beq $t0, 0, label_FALSE_163 + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_STRING_166 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_STRING_166 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_STRING_166 + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_167 + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_167 + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -164($fp) + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_164 + # GOTO label_FALSE_163 + j label_FALSE_163 + label_COMPARE_BY_VALUE_167: + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) + lw $a0, 0($fp) + lw $a1, -164($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_164 + # GOTO label_FALSE_163 + j label_FALSE_163 + label_COMPARE_STRING_166: + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_CONTINUE_168 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_CONTINUE_168 + lw $t0, -160($fp) + beq $t0, 0, label_CONTINUE_168 + # GOTO label_FALSE_163 + j label_FALSE_163 + label_CONTINUE_168: + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_169: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_170 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_169 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_170: + # Store result + sw $a2, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_164 + label_FALSE_163: + # LOCAL local_i2c_at_A2I_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -156($fp) + # GOTO label_END_165 +j label_END_165 +label_TRUE_164: + # LOCAL local_i2c_at_A2I_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -156($fp) + label_END_165: +# LOCAL local_i2c_at_A2I_internal_36 --> -148($fp) +# LOCAL local_i2c_at_A2I_internal_38 --> -156($fp) +# Obtain value from -156($fp) +lw $v0, -156($fp) +lw $v0, 12($v0) +sw $v0, -148($fp) +# IF_ZERO local_i2c_at_A2I_internal_36 GOTO label_FALSEIF_161 +# IF_ZERO local_i2c_at_A2I_internal_36 GOTO label_FALSEIF_161 +lw $t0, -148($fp) +beq $t0, 0, label_FALSEIF_161 +# LOCAL local_i2c_at_A2I_internal_41 --> -168($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_20 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -168($fp) +# LOCAL local_i2c_at_A2I_internal_37 --> -152($fp) +# LOCAL local_i2c_at_A2I_internal_41 --> -168($fp) +# local_i2c_at_A2I_internal_37 = local_i2c_at_A2I_internal_41 +lw $t0, -168($fp) +sw $t0, -152($fp) +# GOTO label_ENDIF_162 +j label_ENDIF_162 +label_FALSEIF_161: + # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 7 + sw $t0, 12($v0) + sw $v0, -188($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_173 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_173 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_173 + # IF_ZERO local_i2c_at_A2I_internal_46 GOTO label_FALSE_173 + # IF_ZERO local_i2c_at_A2I_internal_46 GOTO label_FALSE_173 + lw $t0, -188($fp) + beq $t0, 0, label_FALSE_173 + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_STRING_176 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_STRING_176 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_STRING_176 + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_177 + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_177 + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -188($fp) + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_174 + # GOTO label_FALSE_173 + j label_FALSE_173 + label_COMPARE_BY_VALUE_177: + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) + lw $a0, 0($fp) + lw $a1, -188($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_174 + # GOTO label_FALSE_173 + j label_FALSE_173 + label_COMPARE_STRING_176: + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_CONTINUE_178 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_CONTINUE_178 + lw $t0, -184($fp) + beq $t0, 0, label_CONTINUE_178 + # GOTO label_FALSE_173 + j label_FALSE_173 + label_CONTINUE_178: + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_179: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_180 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_179 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_180: + # Store result + sw $a2, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_174 + label_FALSE_173: + # LOCAL local_i2c_at_A2I_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -180($fp) + # GOTO label_END_175 +j label_END_175 +label_TRUE_174: + # LOCAL local_i2c_at_A2I_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -180($fp) + label_END_175: +# LOCAL local_i2c_at_A2I_internal_42 --> -172($fp) +# LOCAL local_i2c_at_A2I_internal_44 --> -180($fp) +# Obtain value from -180($fp) +lw $v0, -180($fp) +lw $v0, 12($v0) +sw $v0, -172($fp) +# IF_ZERO local_i2c_at_A2I_internal_42 GOTO label_FALSEIF_171 +# IF_ZERO local_i2c_at_A2I_internal_42 GOTO label_FALSEIF_171 +lw $t0, -172($fp) +beq $t0, 0, label_FALSEIF_171 +# LOCAL local_i2c_at_A2I_internal_47 --> -192($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_21 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -192($fp) +# LOCAL local_i2c_at_A2I_internal_43 --> -176($fp) +# LOCAL local_i2c_at_A2I_internal_47 --> -192($fp) +# local_i2c_at_A2I_internal_43 = local_i2c_at_A2I_internal_47 +lw $t0, -192($fp) +sw $t0, -176($fp) +# GOTO label_ENDIF_172 +j label_ENDIF_172 +label_FALSEIF_171: + # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 8 + sw $t0, 12($v0) + sw $v0, -212($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_183 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_183 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_183 + # IF_ZERO local_i2c_at_A2I_internal_52 GOTO label_FALSE_183 + # IF_ZERO local_i2c_at_A2I_internal_52 GOTO label_FALSE_183 + lw $t0, -212($fp) + beq $t0, 0, label_FALSE_183 + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_STRING_186 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_STRING_186 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_STRING_186 + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_187 + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_187 + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -212($fp) + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_184 + # GOTO label_FALSE_183 + j label_FALSE_183 + label_COMPARE_BY_VALUE_187: + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) + lw $a0, 0($fp) + lw $a1, -212($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_184 + # GOTO label_FALSE_183 + j label_FALSE_183 + label_COMPARE_STRING_186: + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_CONTINUE_188 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_CONTINUE_188 + lw $t0, -208($fp) + beq $t0, 0, label_CONTINUE_188 + # GOTO label_FALSE_183 + j label_FALSE_183 + label_CONTINUE_188: + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_189: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_190 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_189 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_190: + # Store result + sw $a2, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_184 + label_FALSE_183: + # LOCAL local_i2c_at_A2I_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -204($fp) + # GOTO label_END_185 +j label_END_185 +label_TRUE_184: + # LOCAL local_i2c_at_A2I_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -204($fp) + label_END_185: +# LOCAL local_i2c_at_A2I_internal_48 --> -196($fp) +# LOCAL local_i2c_at_A2I_internal_50 --> -204($fp) +# Obtain value from -204($fp) +lw $v0, -204($fp) +lw $v0, 12($v0) +sw $v0, -196($fp) +# IF_ZERO local_i2c_at_A2I_internal_48 GOTO label_FALSEIF_181 +# IF_ZERO local_i2c_at_A2I_internal_48 GOTO label_FALSEIF_181 +lw $t0, -196($fp) +beq $t0, 0, label_FALSEIF_181 +# LOCAL local_i2c_at_A2I_internal_53 --> -216($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_22 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -216($fp) +# LOCAL local_i2c_at_A2I_internal_49 --> -200($fp) +# LOCAL local_i2c_at_A2I_internal_53 --> -216($fp) +# local_i2c_at_A2I_internal_49 = local_i2c_at_A2I_internal_53 +lw $t0, -216($fp) +sw $t0, -200($fp) +# GOTO label_ENDIF_182 +j label_ENDIF_182 +label_FALSEIF_181: + # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 9 + sw $t0, 12($v0) + sw $v0, -236($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_193 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_193 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_193 + # IF_ZERO local_i2c_at_A2I_internal_58 GOTO label_FALSE_193 + # IF_ZERO local_i2c_at_A2I_internal_58 GOTO label_FALSE_193 + lw $t0, -236($fp) + beq $t0, 0, label_FALSE_193 + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_STRING_196 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_STRING_196 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_STRING_196 + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_197 + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_197 + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -236($fp) + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_194 + # GOTO label_FALSE_193 + j label_FALSE_193 + label_COMPARE_BY_VALUE_197: + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) + lw $a0, 0($fp) + lw $a1, -236($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_194 + # GOTO label_FALSE_193 + j label_FALSE_193 + label_COMPARE_STRING_196: + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_CONTINUE_198 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_CONTINUE_198 + lw $t0, -232($fp) + beq $t0, 0, label_CONTINUE_198 + # GOTO label_FALSE_193 + j label_FALSE_193 + label_CONTINUE_198: + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_199: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_200 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_199 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_200: + # Store result + sw $a2, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_194 + label_FALSE_193: + # LOCAL local_i2c_at_A2I_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -228($fp) + # GOTO label_END_195 +j label_END_195 +label_TRUE_194: + # LOCAL local_i2c_at_A2I_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -228($fp) + label_END_195: +# LOCAL local_i2c_at_A2I_internal_54 --> -220($fp) +# LOCAL local_i2c_at_A2I_internal_56 --> -228($fp) +# Obtain value from -228($fp) +lw $v0, -228($fp) +lw $v0, 12($v0) +sw $v0, -220($fp) +# IF_ZERO local_i2c_at_A2I_internal_54 GOTO label_FALSEIF_191 +# IF_ZERO local_i2c_at_A2I_internal_54 GOTO label_FALSEIF_191 +lw $t0, -220($fp) +beq $t0, 0, label_FALSEIF_191 +# LOCAL local_i2c_at_A2I_internal_59 --> -240($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_23 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -240($fp) +# LOCAL local_i2c_at_A2I_internal_55 --> -224($fp) +# LOCAL local_i2c_at_A2I_internal_59 --> -240($fp) +# local_i2c_at_A2I_internal_55 = local_i2c_at_A2I_internal_59 +lw $t0, -240($fp) +sw $t0, -224($fp) +# GOTO label_ENDIF_192 +j label_ENDIF_192 +label_FALSEIF_191: + # LOCAL local_i2c_at_A2I_internal_62 --> -252($fp) + # local_i2c_at_A2I_internal_62 = SELF + sw $s1, -252($fp) + # LOCAL local_i2c_at_A2I_internal_60 --> -244($fp) + # LOCAL local_i2c_at_A2I_internal_62 --> -252($fp) + # local_i2c_at_A2I_internal_60 = local_i2c_at_A2I_internal_62 + lw $t0, -252($fp) + sw $t0, -244($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2c_at_A2I_internal_60 --> -244($fp) + # LOCAL local_i2c_at_A2I_internal_61 --> -248($fp) + # local_i2c_at_A2I_internal_61 = VCALL local_i2c_at_A2I_internal_60 abort + # Save new self pointer in $s1 + lw $s1, -244($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -248($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2c_at_A2I_internal_63 --> -256($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_24 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -256($fp) + # LOCAL local_i2c_at_A2I_internal_55 --> -224($fp) + # LOCAL local_i2c_at_A2I_internal_63 --> -256($fp) + # local_i2c_at_A2I_internal_55 = local_i2c_at_A2I_internal_63 + lw $t0, -256($fp) + sw $t0, -224($fp) + label_ENDIF_192: +# LOCAL local_i2c_at_A2I_internal_49 --> -200($fp) +# LOCAL local_i2c_at_A2I_internal_55 --> -224($fp) +# local_i2c_at_A2I_internal_49 = local_i2c_at_A2I_internal_55 +lw $t0, -224($fp) +sw $t0, -200($fp) +label_ENDIF_182: +# LOCAL local_i2c_at_A2I_internal_43 --> -176($fp) +# LOCAL local_i2c_at_A2I_internal_49 --> -200($fp) +# local_i2c_at_A2I_internal_43 = local_i2c_at_A2I_internal_49 +lw $t0, -200($fp) +sw $t0, -176($fp) +label_ENDIF_172: +# LOCAL local_i2c_at_A2I_internal_37 --> -152($fp) +# LOCAL local_i2c_at_A2I_internal_43 --> -176($fp) +# local_i2c_at_A2I_internal_37 = local_i2c_at_A2I_internal_43 +lw $t0, -176($fp) +sw $t0, -152($fp) +label_ENDIF_162: +# LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) +# LOCAL local_i2c_at_A2I_internal_37 --> -152($fp) +# local_i2c_at_A2I_internal_31 = local_i2c_at_A2I_internal_37 +lw $t0, -152($fp) +sw $t0, -128($fp) +label_ENDIF_152: +# LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) +# LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) +# local_i2c_at_A2I_internal_25 = local_i2c_at_A2I_internal_31 +lw $t0, -128($fp) +sw $t0, -104($fp) +label_ENDIF_142: +# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) +# LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) +# local_i2c_at_A2I_internal_19 = local_i2c_at_A2I_internal_25 +lw $t0, -104($fp) +sw $t0, -80($fp) +label_ENDIF_132: +# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) +# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) +# local_i2c_at_A2I_internal_13 = local_i2c_at_A2I_internal_19 +lw $t0, -80($fp) +sw $t0, -56($fp) +label_ENDIF_122: +# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) +# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) +# local_i2c_at_A2I_internal_7 = local_i2c_at_A2I_internal_13 +lw $t0, -56($fp) +sw $t0, -32($fp) +label_ENDIF_112: +# LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) +# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) +# local_i2c_at_A2I_internal_1 = local_i2c_at_A2I_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +label_ENDIF_102: +# RETURN local_i2c_at_A2I_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_i2c_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 264 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_at_A2I implementation. +# @Params: +# 0($fp) = param_a2i_at_A2I_s_0 +function_a2i_at_A2I: + # Allocate stack frame for function function_a2i_at_A2I. + subu $sp, $sp, 208 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 208 + # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_4 = PARAM param_a2i_at_A2I_s_0 + lw $t0, 0($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # local_a2i_at_A2I_internal_5 = VCALL local_a2i_at_A2I_internal_4 length + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_FALSE_203 + # IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_FALSE_203 + lw $t0, -24($fp) + beq $t0, 0, label_FALSE_203 + # IF_ZERO local_a2i_at_A2I_internal_6 GOTO label_FALSE_203 + # IF_ZERO local_a2i_at_A2I_internal_6 GOTO label_FALSE_203 + lw $t0, -28($fp) + beq $t0, 0, label_FALSE_203 + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # Comparing -24($fp) type with String + la $v0, String + lw $a0, -24($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_206 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_206 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_206 + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # Comparing -24($fp) type with Bool + la $v0, Bool + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_207 + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # Comparing -24($fp) type with Int + la $v0, Int + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_207 + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + # Load pointers and SUB + lw $a0, -24($fp) + lw $a1, -28($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_204 + # GOTO label_FALSE_203 + j label_FALSE_203 + label_COMPARE_BY_VALUE_207: + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + lw $a0, -24($fp) + lw $a1, -28($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_204 + # GOTO label_FALSE_203 + j label_FALSE_203 + label_COMPARE_STRING_206: + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -28($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_CONTINUE_208 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_CONTINUE_208 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_208 + # GOTO label_FALSE_203 + j label_FALSE_203 + label_CONTINUE_208: + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -28($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_209: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_210 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_209 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_210: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_204 + label_FALSE_203: + # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_205 +j label_END_205 +label_TRUE_204: + # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_205: +# LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) +# LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSEIF_201 +# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSEIF_201 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_201 +# LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -32($fp) +# LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) +# LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) +# local_a2i_at_A2I_internal_1 = local_a2i_at_A2I_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_202 +j label_ENDIF_202 +label_FALSEIF_201: + # LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_12 = PARAM param_a2i_at_A2I_s_0 + lw $t0, 0($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # ARG local_a2i_at_A2I_internal_14 + # LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) + lw $t0, -60($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -64($fp) + # ARG local_a2i_at_A2I_internal_15 + # LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # local_a2i_at_A2I_internal_13 = VCALL local_a2i_at_A2I_internal_12 substr + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_25 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -68($fp) + # IF_ZERO local_a2i_at_A2I_internal_13 GOTO label_FALSE_213 + # IF_ZERO local_a2i_at_A2I_internal_13 GOTO label_FALSE_213 + lw $t0, -56($fp) + beq $t0, 0, label_FALSE_213 + # IF_ZERO local_a2i_at_A2I_internal_16 GOTO label_FALSE_213 + # IF_ZERO local_a2i_at_A2I_internal_16 GOTO label_FALSE_213 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_213 + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # Comparing -56($fp) type with String + la $v0, String + lw $a0, -56($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_STRING_216 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_STRING_216 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_STRING_216 + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # Comparing -56($fp) type with Bool + la $v0, Bool + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_217 + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # Comparing -56($fp) type with Int + la $v0, Int + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_217 + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, -56($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_214 + # GOTO label_FALSE_213 + j label_FALSE_213 + label_COMPARE_BY_VALUE_217: + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) + lw $a0, -56($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_214 + # GOTO label_FALSE_213 + j label_FALSE_213 + label_COMPARE_STRING_216: + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_CONTINUE_218 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_CONTINUE_218 + lw $t0, -48($fp) + beq $t0, 0, label_CONTINUE_218 + # GOTO label_FALSE_213 + j label_FALSE_213 + label_CONTINUE_218: + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_219: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_220 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_219 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_220: + # Store result + sw $a2, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_214 + label_FALSE_213: + # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -44($fp) + # GOTO label_END_215 +j label_END_215 +label_TRUE_214: + # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + label_END_215: +# LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) +# LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) +# Obtain value from -44($fp) +lw $v0, -44($fp) +lw $v0, 12($v0) +sw $v0, -36($fp) +# IF_ZERO local_a2i_at_A2I_internal_8 GOTO label_FALSEIF_211 +# IF_ZERO local_a2i_at_A2I_internal_8 GOTO label_FALSEIF_211 +lw $t0, -36($fp) +beq $t0, 0, label_FALSEIF_211 +# LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) +# local_a2i_at_A2I_internal_20 = SELF +sw $s1, -84($fp) +# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) +# LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) +# local_a2i_at_A2I_internal_18 = local_a2i_at_A2I_internal_20 +lw $t0, -84($fp) +sw $t0, -76($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_21 = PARAM param_a2i_at_A2I_s_0 +lw $t0, 0($fp) +sw $t0, -88($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -96($fp) +# ARG local_a2i_at_A2I_internal_23 +# LOCAL local_a2i_at_A2I_internal_23 --> -96($fp) +lw $t0, -96($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_25 --> -104($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_25 = PARAM param_a2i_at_A2I_s_0 +lw $t0, 0($fp) +sw $t0, -104($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_25 --> -104($fp) +# LOCAL local_a2i_at_A2I_internal_26 --> -108($fp) +# local_a2i_at_A2I_internal_26 = VCALL local_a2i_at_A2I_internal_25 length +# Save new self pointer in $s1 +lw $s1, -104($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -108($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_27 --> -112($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -112($fp) +# LOCAL local_a2i_at_A2I_internal_24 --> -100($fp) +# LOCAL local_a2i_at_A2I_internal_26 --> -108($fp) +# LOCAL local_a2i_at_A2I_internal_27 --> -112($fp) +# local_a2i_at_A2I_internal_24 = local_a2i_at_A2I_internal_26 - local_a2i_at_A2I_internal_27 +lw $t1, -108($fp) +lw $t0, 12($t1) +lw $t1, -112($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -100($fp) +# ARG local_a2i_at_A2I_internal_24 +# LOCAL local_a2i_at_A2I_internal_24 --> -100($fp) +lw $t0, -100($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) +# LOCAL local_a2i_at_A2I_internal_22 --> -92($fp) +# local_a2i_at_A2I_internal_22 = VCALL local_a2i_at_A2I_internal_21 substr +# Save new self pointer in $s1 +lw $s1, -88($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 48($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -92($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_at_A2I_internal_22 +# LOCAL local_a2i_at_A2I_internal_22 --> -92($fp) +lw $t0, -92($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) +# LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) +# local_a2i_at_A2I_internal_19 = VCALL local_a2i_at_A2I_internal_18 a2i_aux +# Save new self pointer in $s1 +lw $s1, -76($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 56($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -80($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) +lw $t0, -80($fp) +lw $t0, 12($t0) +not $t0, $t0 +add $t0, $t0, 1 +sw $t0, -72($fp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +lw $t0, -72($fp) +sw $t0, 12($v0) +sw $v0, -72($fp) +# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# local_a2i_at_A2I_internal_9 = local_a2i_at_A2I_internal_17 +lw $t0, -72($fp) +sw $t0, -40($fp) +# GOTO label_ENDIF_212 +j label_ENDIF_212 +label_FALSEIF_211: + # LOCAL local_a2i_at_A2I_internal_32 --> -132($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_32 = PARAM param_a2i_at_A2I_s_0 + lw $t0, 0($fp) + sw $t0, -132($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -140($fp) + # ARG local_a2i_at_A2I_internal_34 + # LOCAL local_a2i_at_A2I_internal_34 --> -140($fp) + lw $t0, -140($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_A2I_internal_35 --> -144($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -144($fp) + # ARG local_a2i_at_A2I_internal_35 + # LOCAL local_a2i_at_A2I_internal_35 --> -144($fp) + lw $t0, -144($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_A2I_internal_32 --> -132($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # local_a2i_at_A2I_internal_33 = VCALL local_a2i_at_A2I_internal_32 substr + # Save new self pointer in $s1 + lw $s1, -132($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -136($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_26 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -148($fp) + # IF_ZERO local_a2i_at_A2I_internal_33 GOTO label_FALSE_223 + # IF_ZERO local_a2i_at_A2I_internal_33 GOTO label_FALSE_223 + lw $t0, -136($fp) + beq $t0, 0, label_FALSE_223 + # IF_ZERO local_a2i_at_A2I_internal_36 GOTO label_FALSE_223 + # IF_ZERO local_a2i_at_A2I_internal_36 GOTO label_FALSE_223 + lw $t0, -148($fp) + beq $t0, 0, label_FALSE_223 + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # Comparing -136($fp) type with String + la $v0, String + lw $a0, -136($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_STRING_226 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_STRING_226 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_STRING_226 + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # Comparing -136($fp) type with Bool + la $v0, Bool + lw $a0, -136($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_227 + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # Comparing -136($fp) type with Int + la $v0, Int + lw $a0, -136($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_227 + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) + # Load pointers and SUB + lw $a0, -136($fp) + lw $a1, -148($fp) + sub $a0, $a0, $a1 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_224 + # GOTO label_FALSE_223 + j label_FALSE_223 + label_COMPARE_BY_VALUE_227: + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) + lw $a0, -136($fp) + lw $a1, -148($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_224 + # GOTO label_FALSE_223 + j label_FALSE_223 + label_COMPARE_STRING_226: + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) + # Load strings for comparison + lw $v0, -136($fp) + lw $v1, -148($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_CONTINUE_228 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_CONTINUE_228 + lw $t0, -128($fp) + beq $t0, 0, label_CONTINUE_228 + # GOTO label_FALSE_223 + j label_FALSE_223 + label_CONTINUE_228: + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -136($fp) + lw $v1, -148($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_229: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_230 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_229 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_230: + # Store result + sw $a2, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_224 + label_FALSE_223: + # LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -124($fp) + # GOTO label_END_225 +j label_END_225 +label_TRUE_224: + # LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -124($fp) + label_END_225: +# LOCAL local_a2i_at_A2I_internal_28 --> -116($fp) +# LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) +# Obtain value from -124($fp) +lw $v0, -124($fp) +lw $v0, 12($v0) +sw $v0, -116($fp) +# IF_ZERO local_a2i_at_A2I_internal_28 GOTO label_FALSEIF_221 +# IF_ZERO local_a2i_at_A2I_internal_28 GOTO label_FALSEIF_221 +lw $t0, -116($fp) +beq $t0, 0, label_FALSEIF_221 +# LOCAL local_a2i_at_A2I_internal_39 --> -160($fp) +# local_a2i_at_A2I_internal_39 = SELF +sw $s1, -160($fp) +# LOCAL local_a2i_at_A2I_internal_37 --> -152($fp) +# LOCAL local_a2i_at_A2I_internal_39 --> -160($fp) +# local_a2i_at_A2I_internal_37 = local_a2i_at_A2I_internal_39 +lw $t0, -160($fp) +sw $t0, -152($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_40 --> -164($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_40 = PARAM param_a2i_at_A2I_s_0 +lw $t0, 0($fp) +sw $t0, -164($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_42 --> -172($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -172($fp) +# ARG local_a2i_at_A2I_internal_42 +# LOCAL local_a2i_at_A2I_internal_42 --> -172($fp) +lw $t0, -172($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_44 --> -180($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_44 = PARAM param_a2i_at_A2I_s_0 +lw $t0, 0($fp) +sw $t0, -180($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_44 --> -180($fp) +# LOCAL local_a2i_at_A2I_internal_45 --> -184($fp) +# local_a2i_at_A2I_internal_45 = VCALL local_a2i_at_A2I_internal_44 length +# Save new self pointer in $s1 +lw $s1, -180($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -184($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_46 --> -188($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -188($fp) +# LOCAL local_a2i_at_A2I_internal_43 --> -176($fp) +# LOCAL local_a2i_at_A2I_internal_45 --> -184($fp) +# LOCAL local_a2i_at_A2I_internal_46 --> -188($fp) +# local_a2i_at_A2I_internal_43 = local_a2i_at_A2I_internal_45 - local_a2i_at_A2I_internal_46 +lw $t1, -184($fp) +lw $t0, 12($t1) +lw $t1, -188($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -176($fp) +# ARG local_a2i_at_A2I_internal_43 +# LOCAL local_a2i_at_A2I_internal_43 --> -176($fp) +lw $t0, -176($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_40 --> -164($fp) +# LOCAL local_a2i_at_A2I_internal_41 --> -168($fp) +# local_a2i_at_A2I_internal_41 = VCALL local_a2i_at_A2I_internal_40 substr +# Save new self pointer in $s1 +lw $s1, -164($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 48($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -168($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_at_A2I_internal_41 +# LOCAL local_a2i_at_A2I_internal_41 --> -168($fp) +lw $t0, -168($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_37 --> -152($fp) +# LOCAL local_a2i_at_A2I_internal_38 --> -156($fp) +# local_a2i_at_A2I_internal_38 = VCALL local_a2i_at_A2I_internal_37 a2i_aux +# Save new self pointer in $s1 +lw $s1, -152($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 56($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -156($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) +# LOCAL local_a2i_at_A2I_internal_38 --> -156($fp) +# local_a2i_at_A2I_internal_29 = local_a2i_at_A2I_internal_38 +lw $t0, -156($fp) +sw $t0, -120($fp) +# GOTO label_ENDIF_222 +j label_ENDIF_222 +label_FALSEIF_221: + # LOCAL local_a2i_at_A2I_internal_49 --> -200($fp) + # local_a2i_at_A2I_internal_49 = SELF + sw $s1, -200($fp) + # LOCAL local_a2i_at_A2I_internal_47 --> -192($fp) + # LOCAL local_a2i_at_A2I_internal_49 --> -200($fp) + # local_a2i_at_A2I_internal_47 = local_a2i_at_A2I_internal_49 + lw $t0, -200($fp) + sw $t0, -192($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_a2i_at_A2I_s_0 + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_A2I_internal_47 --> -192($fp) + # LOCAL local_a2i_at_A2I_internal_48 --> -196($fp) + # local_a2i_at_A2I_internal_48 = VCALL local_a2i_at_A2I_internal_47 a2i_aux + # Save new self pointer in $s1 + lw $s1, -192($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 56($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -196($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) + # LOCAL local_a2i_at_A2I_internal_48 --> -196($fp) + # local_a2i_at_A2I_internal_29 = local_a2i_at_A2I_internal_48 + lw $t0, -196($fp) + sw $t0, -120($fp) + label_ENDIF_222: +# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) +# LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) +# local_a2i_at_A2I_internal_9 = local_a2i_at_A2I_internal_29 +lw $t0, -120($fp) +sw $t0, -40($fp) +label_ENDIF_212: +# LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) +# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) +# local_a2i_at_A2I_internal_1 = local_a2i_at_A2I_internal_9 +lw $t0, -40($fp) +sw $t0, -8($fp) +label_ENDIF_202: +# RETURN local_a2i_at_A2I_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_a2i_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 208 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_aux_at_A2I implementation. +# @Params: +# 0($fp) = param_a2i_aux_at_A2I_s_0 +function_a2i_aux_at_A2I: + # Allocate stack frame for function function_a2i_aux_at_A2I. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_a2i_aux_at_A2I_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) + # LOCAL local_a2i_aux_at_A2I_internal_1 --> -8($fp) + # local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_a2i_aux_at_A2I_j_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) + # local_a2i_aux_at_A2I_internal_3 = PARAM param_a2i_aux_at_A2I_s_0 + lw $t0, 0($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_aux_at_A2I_internal_4 --> -20($fp) + # local_a2i_aux_at_A2I_internal_4 = VCALL local_a2i_aux_at_A2I_internal_3 length + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_aux_at_A2I_j_2 --> -12($fp) + # LOCAL local_a2i_aux_at_A2I_internal_4 --> -20($fp) + # local_a2i_aux_at_A2I_j_2 = local_a2i_aux_at_A2I_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) + # local_a2i_aux_at_A2I_i_5 = local_a2i_aux_at_A2I_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + label_WHILE_231: + # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) + # LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_A2I_j_2 --> -12($fp) + lw $a0, -24($fp) + lw $a1, -12($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -36($fp) + # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 + # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 + lw $t0, -36($fp) + bgt $t0, 0, label_FALSE_233 + # IF_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 + # IF_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 + lw $t0, -36($fp) + beq $t0, 0, label_FALSE_233 + # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_234 +j label_END_234 +label_FALSE_233: + # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_234: +# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) +# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_a2i_aux_at_A2I_internal_7 GOTO label_WHILE_END_232 +# IF_ZERO local_a2i_aux_at_A2I_internal_7 GOTO label_WHILE_END_232 +lw $t0, -32($fp) +beq $t0, 0, label_WHILE_END_232 +# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 10 +sw $t0, 12($v0) +sw $v0, -48($fp) +# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) +# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) +# local_a2i_aux_at_A2I_internal_10 = local_a2i_aux_at_A2I_int_0 * local_a2i_aux_at_A2I_internal_11 +lw $t1, -4($fp) +lw $t0, 12($t1) +lw $t1, -48($fp) +lw $t2, 12($t1) +mul $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -44($fp) +# LOCAL local_a2i_aux_at_A2I_internal_14 --> -60($fp) +# local_a2i_aux_at_A2I_internal_14 = SELF +sw $s1, -60($fp) +# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) +# LOCAL local_a2i_aux_at_A2I_internal_14 --> -60($fp) +# local_a2i_aux_at_A2I_internal_12 = local_a2i_aux_at_A2I_internal_14 +lw $t0, -60($fp) +sw $t0, -52($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_15 --> -64($fp) +# PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) +# local_a2i_aux_at_A2I_internal_15 = PARAM param_a2i_aux_at_A2I_s_0 +lw $t0, 0($fp) +sw $t0, -64($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_a2i_aux_at_A2I_i_5 +# LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) +lw $t0, -24($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -72($fp) +# ARG local_a2i_aux_at_A2I_internal_17 +# LOCAL local_a2i_aux_at_A2I_internal_17 --> -72($fp) +lw $t0, -72($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_15 --> -64($fp) +# LOCAL local_a2i_aux_at_A2I_internal_16 --> -68($fp) +# local_a2i_aux_at_A2I_internal_16 = VCALL local_a2i_aux_at_A2I_internal_15 substr +# Save new self pointer in $s1 +lw $s1, -64($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 48($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -68($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_aux_at_A2I_internal_16 +# LOCAL local_a2i_aux_at_A2I_internal_16 --> -68($fp) +lw $t0, -68($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) +# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) +# local_a2i_aux_at_A2I_internal_13 = VCALL local_a2i_aux_at_A2I_internal_12 c2i +# Save new self pointer in $s1 +lw $s1, -52($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 64($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -56($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) +# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) +# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) +# local_a2i_aux_at_A2I_internal_9 = local_a2i_aux_at_A2I_internal_10 + local_a2i_aux_at_A2I_internal_13 +lw $t1, -44($fp) +lw $t0, 12($t1) +lw $t1, -56($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -40($fp) +# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) +# local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_9 +lw $t0, -40($fp) +sw $t0, -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_19 --> -80($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -80($fp) +# LOCAL local_a2i_aux_at_A2I_internal_18 --> -76($fp) +# LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) +# LOCAL local_a2i_aux_at_A2I_internal_19 --> -80($fp) +# local_a2i_aux_at_A2I_internal_18 = local_a2i_aux_at_A2I_i_5 + local_a2i_aux_at_A2I_internal_19 +lw $t1, -24($fp) +lw $t0, 12($t1) +lw $t1, -80($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -76($fp) +# LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) +# LOCAL local_a2i_aux_at_A2I_internal_18 --> -76($fp) +# local_a2i_aux_at_A2I_i_5 = local_a2i_aux_at_A2I_internal_18 +lw $t0, -76($fp) +sw $t0, -24($fp) +# GOTO label_WHILE_231 +j label_WHILE_231 +label_WHILE_END_232: + # RETURN local_a2i_aux_at_A2I_int_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_a2i_aux_at_A2I. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 88 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_i2a_at_A2I implementation. +# @Params: +# 0($fp) = param_i2a_at_A2I_i_0 +function_i2a_at_A2I: + # Allocate stack frame for function function_i2a_at_A2I. + subu $sp, $sp, 96 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 96 + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # IF_ZERO param_i2a_at_A2I_i_0 GOTO label_FALSE_237 + # IF_ZERO param_i2a_at_A2I_i_0 GOTO label_FALSE_237 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_237 + # IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_237 + # IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_237 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_237 + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_STRING_240 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_STRING_240 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_240 + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_241 + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_241 + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_238 + # GOTO label_FALSE_237 + j label_FALSE_237 + label_COMPARE_BY_VALUE_241: + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_238 + # GOTO label_FALSE_237 + j label_FALSE_237 + label_COMPARE_STRING_240: + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_CONTINUE_242 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_CONTINUE_242 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_242 + # GOTO label_FALSE_237 + j label_FALSE_237 + label_CONTINUE_242: + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_243: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_244 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_243 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_244: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_238 + label_FALSE_237: + # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_239 +j label_END_239 +label_TRUE_238: + # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_239: +# LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSEIF_235 +# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSEIF_235 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_235 +# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_27 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -24($fp) +# LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) +# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) +# local_i2a_at_A2I_internal_1 = local_i2a_at_A2I_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_236 +j label_ENDIF_236 +label_FALSEIF_235: + # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -40($fp) + # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) + # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + lw $a0, -40($fp) + lw $a1, 0($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -36($fp) + # IF_GREATER_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 + # IF_GREATER_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 + lw $t0, -36($fp) + bgt $t0, 0, label_FALSE_247 + # IF_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 + # IF_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 + lw $t0, -36($fp) + beq $t0, 0, label_FALSE_247 + # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_248 +j label_END_248 +label_FALSE_247: + # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_248: +# LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) +# LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_i2a_at_A2I_internal_6 GOTO label_FALSEIF_245 +# IF_ZERO local_i2a_at_A2I_internal_6 GOTO label_FALSEIF_245 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_245 +# LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) +# local_i2a_at_A2I_internal_12 = SELF +sw $s1, -52($fp) +# LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) +# LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) +# local_i2a_at_A2I_internal_10 = local_i2a_at_A2I_internal_12 +lw $t0, -52($fp) +sw $t0, -44($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_i2a_at_A2I_i_0 +# PARAM param_i2a_at_A2I_i_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) +# LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) +# local_i2a_at_A2I_internal_11 = VCALL local_i2a_at_A2I_internal_10 i2a_aux +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 32($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) +# LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) +# local_i2a_at_A2I_internal_7 = local_i2a_at_A2I_internal_11 +lw $t0, -48($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_246 +j label_ENDIF_246 +label_FALSEIF_245: + # LOCAL local_i2a_at_A2I_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_28 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -64($fp) + # LOCAL local_i2a_at_A2I_internal_13 --> -56($fp) + # LOCAL local_i2a_at_A2I_internal_15 --> -64($fp) + # local_i2a_at_A2I_internal_13 = local_i2a_at_A2I_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_18 --> -76($fp) + # local_i2a_at_A2I_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_i2a_at_A2I_internal_16 --> -68($fp) + # LOCAL local_i2a_at_A2I_internal_18 --> -76($fp) + # local_i2a_at_A2I_internal_16 = local_i2a_at_A2I_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_21 --> -88($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -88($fp) + # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) + # LOCAL local_i2a_at_A2I_internal_21 --> -88($fp) + lw $t0, -88($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -84($fp) + # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) + # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -84($fp) + sw $t0, 12($v0) + sw $v0, -84($fp) + # LOCAL local_i2a_at_A2I_internal_19 --> -80($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) + # local_i2a_at_A2I_internal_19 = PARAM param_i2a_at_A2I_i_0 * local_i2a_at_A2I_internal_20 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -84($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -80($fp) + # ARG local_i2a_at_A2I_internal_19 + # LOCAL local_i2a_at_A2I_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_i2a_at_A2I_internal_16 --> -68($fp) + # LOCAL local_i2a_at_A2I_internal_17 --> -72($fp) + # local_i2a_at_A2I_internal_17 = VCALL local_i2a_at_A2I_internal_16 i2a_aux + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_i2a_at_A2I_internal_17 + # LOCAL local_i2a_at_A2I_internal_17 --> -72($fp) + lw $t0, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_i2a_at_A2I_internal_13 --> -56($fp) + # LOCAL local_i2a_at_A2I_internal_14 --> -60($fp) + # local_i2a_at_A2I_internal_14 = VCALL local_i2a_at_A2I_internal_13 concat + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 36($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) + # LOCAL local_i2a_at_A2I_internal_14 --> -60($fp) + # local_i2a_at_A2I_internal_7 = local_i2a_at_A2I_internal_14 + lw $t0, -60($fp) + sw $t0, -32($fp) + label_ENDIF_246: +# LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) +# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) +# local_i2a_at_A2I_internal_1 = local_i2a_at_A2I_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +label_ENDIF_236: +# RETURN local_i2a_at_A2I_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_i2a_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 96 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_i2a_aux_at_A2I implementation. +# @Params: +# 0($fp) = param_i2a_aux_at_A2I_i_0 +function_i2a_aux_at_A2I: + # Allocate stack frame for function function_i2a_aux_at_A2I. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # IF_ZERO param_i2a_aux_at_A2I_i_0 GOTO label_FALSE_251 + # IF_ZERO param_i2a_aux_at_A2I_i_0 GOTO label_FALSE_251 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_251 + # IF_ZERO local_i2a_aux_at_A2I_internal_4 GOTO label_FALSE_251 + # IF_ZERO local_i2a_aux_at_A2I_internal_4 GOTO label_FALSE_251 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_251 + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_STRING_254 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_STRING_254 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_254 + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_255 + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_255 + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_252 + # GOTO label_FALSE_251 + j label_FALSE_251 + label_COMPARE_BY_VALUE_255: + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_252 + # GOTO label_FALSE_251 + j label_FALSE_251 + label_COMPARE_STRING_254: + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_CONTINUE_256 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_CONTINUE_256 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_256 + # GOTO label_FALSE_251 + j label_FALSE_251 + label_CONTINUE_256: + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_257: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_258 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_257 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_258: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_252 + label_FALSE_251: + # LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_253 +j label_END_253 +label_TRUE_252: + # LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_253: +# LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSEIF_249 +# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSEIF_249 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_249 +# LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_29 +sw $t0, 12($v0) +li $t0, 0 +sw $t0, 16($v0) +sw $v0, -24($fp) +# LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) +# LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) +# local_i2a_aux_at_A2I_internal_1 = local_i2a_aux_at_A2I_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_250 +j label_ENDIF_250 +label_FALSEIF_249: + # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 10 + sw $t0, 12($v0) + sw $v0, -36($fp) + # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) + # local_i2a_aux_at_A2I_internal_7 = PARAM param_i2a_aux_at_A2I_i_0 / local_i2a_aux_at_A2I_internal_8 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -36($fp) + lw $t2, 12($t1) + div $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -32($fp) + # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) + # local_i2a_aux_at_A2I_next_6 = local_i2a_aux_at_A2I_internal_7 + lw $t0, -32($fp) + sw $t0, -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) + # local_i2a_aux_at_A2I_internal_13 = SELF + sw $s1, -56($fp) + # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) + # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) + # local_i2a_aux_at_A2I_internal_11 = local_i2a_aux_at_A2I_internal_13 + lw $t0, -56($fp) + sw $t0, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_i2a_aux_at_A2I_next_6 + # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) + lw $t0, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) + # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) + # local_i2a_aux_at_A2I_internal_12 = VCALL local_i2a_aux_at_A2I_internal_11 i2a_aux + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) + # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) + # local_i2a_aux_at_A2I_internal_9 = local_i2a_aux_at_A2I_internal_12 + lw $t0, -52($fp) + sw $t0, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_16 --> -68($fp) + # local_i2a_aux_at_A2I_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_i2a_aux_at_A2I_internal_14 --> -60($fp) + # LOCAL local_i2a_aux_at_A2I_internal_16 --> -68($fp) + # local_i2a_aux_at_A2I_internal_14 = local_i2a_aux_at_A2I_internal_16 + lw $t0, -68($fp) + sw $t0, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 10 + sw $t0, 12($v0) + sw $v0, -80($fp) + # LOCAL local_i2a_aux_at_A2I_internal_18 --> -76($fp) + # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_19 --> -80($fp) + # local_i2a_aux_at_A2I_internal_18 = local_i2a_aux_at_A2I_next_6 * local_i2a_aux_at_A2I_internal_19 + lw $t1, -28($fp) + lw $t0, 12($t1) + lw $t1, -80($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -76($fp) + # LOCAL local_i2a_aux_at_A2I_internal_17 --> -72($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_18 --> -76($fp) + # local_i2a_aux_at_A2I_internal_17 = PARAM param_i2a_aux_at_A2I_i_0 - local_i2a_aux_at_A2I_internal_18 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -76($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -72($fp) + # ARG local_i2a_aux_at_A2I_internal_17 + # LOCAL local_i2a_aux_at_A2I_internal_17 --> -72($fp) + lw $t0, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_14 --> -60($fp) + # LOCAL local_i2a_aux_at_A2I_internal_15 --> -64($fp) + # local_i2a_aux_at_A2I_internal_15 = VCALL local_i2a_aux_at_A2I_internal_14 i2c + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_i2a_aux_at_A2I_internal_15 + # LOCAL local_i2a_aux_at_A2I_internal_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) + # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) + # local_i2a_aux_at_A2I_internal_10 = VCALL local_i2a_aux_at_A2I_internal_9 concat + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 36($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) + # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) + # local_i2a_aux_at_A2I_internal_1 = local_i2a_aux_at_A2I_internal_10 + lw $t0, -44($fp) + sw $t0, -8($fp) + label_ENDIF_250: +# RETURN local_i2a_aux_at_A2I_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_i2a_aux_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 104 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 104 + # LOCAL local_main_at_Main_a_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE A2I + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, A2I + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, A2I_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_30 + sw $t0, 12($v0) + li $t0, 6 + sw $t0, 16($v0) + sw $v0, -20($fp) + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 a2i + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_a_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_a_0 = local_main_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # LOCAL local_main_at_Main_b_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -24($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = ALLOCATE A2I + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, A2I + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, A2I_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -36($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 + lw $t0, -36($fp) + sw $t0, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 678987 + sw $t0, 12($v0) + sw $v0, -40($fp) + # ARG local_main_at_Main_internal_9 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + lw $t0, -40($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 i2a + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 24($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_b_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_b_5 = local_main_at_Main_internal_7 + lw $t0, -32($fp) + sw $t0, -24($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 + lw $t0, -52($fp) + sw $t0, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_a_0 + # LOCAL local_main_at_Main_a_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 out_int + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_31 + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + sw $v0, -68($fp) + # ARG local_main_at_Main_internal_16 + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + lw $t0, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 out_string + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 8($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_19 = SELF + sw $s1, -80($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_17 = local_main_at_Main_internal_19 + lw $t0, -80($fp) + sw $t0, -72($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_b_5 + # LOCAL local_main_at_Main_b_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_18 = VCALL local_main_at_Main_internal_17 out_string + # Save new self pointer in $s1 + lw $s1, -72($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 8($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -76($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # local_main_at_Main_internal_22 = SELF + sw $s1, -92($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # local_main_at_Main_internal_20 = local_main_at_Main_internal_22 + lw $t0, -92($fp) + sw $t0, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_32 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -96($fp) + # ARG local_main_at_Main_internal_23 + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + lw $t0, -96($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_21 = VCALL local_main_at_Main_internal_20 out_string + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 8($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_21 + lw $v0, -88($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 104 + jr $ra + # Function END + diff --git a/tests/codegen/book_list.mips b/tests/codegen/book_list.mips index 22b6fed8..32067886 100644 --- a/tests/codegen/book_list.mips +++ b/tests/codegen/book_list.mips @@ -1,10 +1,11 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:51 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:13 2020 # School of Math and Computer Science, University of Havana # .data +dummy: .word 0 IO: .asciiz "IO" # Function END Object: .asciiz "Object" @@ -31,7 +32,7 @@ Article: .asciiz "Article" # **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +IO_vtable: .word function_out_int_at_IO, function_abort_at_Object, dummy, dummy, function_in_string_at_IO, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_out_string_at_IO, dummy, dummy, function_in_int_at_IO # Function END # @@ -45,7 +46,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Object_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -59,7 +60,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_length_at_String, dummy, dummy, function_type_name_at_Object, function_concat_at_String, dummy, dummy, function_substr_at_String, dummy, dummy # Function END # @@ -73,7 +74,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Bool_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -87,7 +88,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Int_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -101,7 +102,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main +Main_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_main_at_Main, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -115,7 +116,7 @@ Main_end: # **** VTABLE for type BookList **** -BookList_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_BookList, function_cons_at_BookList, function_car_at_BookList, function_cdr_at_BookList, function_print_list_at_BookList +BookList_vtable: .word function_out_int_at_IO, function_abort_at_Object, dummy, function_cons_at_BookList, function_in_string_at_IO, function_car_at_BookList, dummy, dummy, function_copy_at_Object, function_cdr_at_BookList, dummy, function_isNil_at_BookList, dummy, function_type_name_at_Object, dummy, function_print_list_at_BookList, function_out_string_at_IO, dummy, dummy, function_in_int_at_IO # Function END # @@ -129,7 +130,7 @@ BookList_end: # **** VTABLE for type Nil **** -Nil_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_Nil, function_cons_at_BookList, function_car_at_BookList, function_cdr_at_BookList, function_print_list_at_Nil +Nil_vtable: .word function_out_int_at_IO, function_abort_at_Object, dummy, function_cons_at_BookList, function_in_string_at_IO, function_car_at_BookList, dummy, dummy, function_copy_at_Object, function_cdr_at_BookList, dummy, function_isNil_at_Nil, dummy, function_type_name_at_Object, dummy, function_print_list_at_Nil, function_out_string_at_IO, dummy, dummy, function_in_int_at_IO # Function END # @@ -143,7 +144,7 @@ Nil_end: # **** VTABLE for type Cons **** -Cons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_Cons, function_cons_at_BookList, function_car_at_Cons, function_cdr_at_Cons, function_print_list_at_Cons, function_init_at_Cons +Cons_vtable: .word function_out_int_at_IO, function_abort_at_Object, dummy, function_cons_at_BookList, function_in_string_at_IO, function_car_at_Cons, function_init_at_Cons, dummy, function_copy_at_Object, function_cdr_at_Cons, dummy, function_isNil_at_Cons, dummy, function_type_name_at_Object, dummy, function_print_list_at_Cons, function_out_string_at_IO, dummy, dummy, function_in_int_at_IO # Function END # @@ -157,7 +158,7 @@ Cons_end: # **** VTABLE for type Book **** -Book_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_initBook_at_Book, function_print_at_Book +Book_vtable: .word function_out_int_at_IO, function_abort_at_Object, function_initBook_at_Book, dummy, function_in_string_at_IO, dummy, dummy, function_print_at_Book, function_copy_at_Object, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_out_string_at_IO, dummy, dummy, function_in_int_at_IO # Function END # @@ -171,7 +172,7 @@ Book_end: # **** VTABLE for type Article **** -Article_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_initBook_at_Book, function_print_at_Article, function_initArticle_at_Article +Article_vtable: .word function_out_int_at_IO, function_abort_at_Object, function_initBook_at_Book, dummy, function_in_string_at_IO, dummy, dummy, function_print_at_Article, function_copy_at_Object, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_out_string_at_IO, dummy, function_initArticle_at_Article, function_in_int_at_IO # Function END # @@ -533,7 +534,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -794,7 +795,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 12($t0) + lw $t1, 48($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -964,7 +965,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -1132,7 +1133,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -1206,7 +1207,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -68($fp) @@ -1237,7 +1238,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -1270,7 +1271,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -1319,7 +1320,7 @@ function_isNil_at_BookList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1475,7 +1476,7 @@ function_cons_at_BookList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -1526,7 +1527,7 @@ function_car_at_BookList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1629,7 +1630,7 @@ function_cdr_at_BookList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1716,7 +1717,7 @@ function_print_list_at_BookList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2050,7 +2051,7 @@ function_print_list_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2068,7 +2069,7 @@ function_print_list_at_Cons: # local_print_list_at_Cons_internal_6 = 14 li $t0, 14 sw $t0, -28($fp) - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Book @@ -2090,7 +2091,7 @@ function_print_list_at_Cons: lw $t0, -32($fp) sw $t0, -28($fp) label_Not_min0_1: - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Article @@ -2128,7 +2129,7 @@ function_print_list_at_Cons: # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 lw $t0, -20($fp) beq $t0, 0, label_ERROR_3 - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Book @@ -2194,7 +2195,7 @@ function_print_list_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -2209,7 +2210,7 @@ function_print_list_at_Cons: # GOTO label_END_4 j label_END_4 label_NEXT0_5: - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Article @@ -2275,7 +2276,7 @@ label_NEXT0_5: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -2329,7 +2330,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 44($t0) +lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -2516,7 +2517,7 @@ function_print_at_Book: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -2551,7 +2552,7 @@ function_print_at_Book: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -2600,7 +2601,7 @@ function_print_at_Book: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2652,7 +2653,7 @@ function_print_at_Book: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -2687,7 +2688,7 @@ function_print_at_Book: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -2736,7 +2737,7 @@ function_print_at_Book: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -2842,7 +2843,7 @@ function_initArticle_at_Article: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2893,7 +2894,7 @@ function_print_at_Article: # Get pointer to type's VTABLE la $t0, Book_vtable # Get pointer to function address - lw $t1, 32($t0) + lw $t1, 28($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -4($fp) @@ -2945,7 +2946,7 @@ function_print_at_Article: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -2980,7 +2981,7 @@ function_print_at_Article: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -3029,7 +3030,7 @@ function_print_at_Article: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) diff --git a/tests/codegen/cells.mips b/tests/codegen/cells.mips new file mode 100644 index 00000000..468243ed --- /dev/null +++ b/tests/codegen/cells.mips @@ -0,0 +1,4335 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:15 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +Main: .asciiz "Main" +# Function END +CellularAutomaton: .asciiz "CellularAutomaton" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, dummy, function_in_int_at_IO, dummy, function_in_string_at_IO, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_out_string_at_IO, function_out_int_at_IO, dummy, dummy +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_concat_at_String, function_copy_at_Object, function_length_at_String, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_main_at_Main, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +# **** VTABLE for type CellularAutomaton **** +CellularAutomaton_vtable: .word function_abort_at_Object, dummy, function_in_int_at_IO, function_cell_at_CellularAutomaton, function_in_string_at_IO, function_evolve_at_CellularAutomaton, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, function_num_cells_at_CellularAutomaton, function_init_at_CellularAutomaton, dummy, function_print_at_CellularAutomaton, function_cell_right_neighbor_at_CellularAutomaton, function_out_string_at_IO, function_out_int_at_IO, function_cell_left_neighbor_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton +# Function END +# + + +# **** Type RECORD for type CellularAutomaton **** +CellularAutomaton_start: + CellularAutomaton_vtable_pointer: .word CellularAutomaton_vtable + # Function END +CellularAutomaton_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0, -1 +CellularAutomaton__TDT: .word -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz " X " +# + + +data_5: .asciiz "\n" +# + + +data_6: .asciiz "X" +# + + +data_7: .asciiz "X" +# + + +data_8: .asciiz "X" +# + + +data_9: .asciiz "X" +# + + +data_10: .asciiz "." +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__cells__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 4($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__cells__init implementation. +# @Params: +__Main__attrib__cells__init: + # Allocate stack frame for function __Main__attrib__cells__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__cells__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = ALLOCATE CellularAutomaton + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, CellularAutomaton + sw $t0, 12($v0) + li $t0, 17 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, CellularAutomaton_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __CellularAutomaton__attrib__population_map__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 19 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 init + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + lw $t0, -8($fp) + sw $t0, 12($s1) + # local_main_at_Main_internal_6 = GETATTRIBUTE cells Main + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + lw $t0, 12($s1) + sw $t0, -28($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 print + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 52($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_countdown_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 20 + sw $t0, 12($v0) + sw $v0, -36($fp) + # LOCAL local_main_at_Main_countdown_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_countdown_7 = local_main_at_Main_internal_8 + lw $t0, -36($fp) + sw $t0, -32($fp) + label_WHILE_1: + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -48($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_countdown_7 --> -32($fp) + lw $a0, -48($fp) + lw $a1, -32($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_GREATER_ZERO local_main_at_Main_internal_10 GOTO label_FALSE_3 + # IF_GREATER_ZERO local_main_at_Main_internal_10 GOTO label_FALSE_3 + lw $t0, -44($fp) + bgt $t0, 0, label_FALSE_3 + # IF_ZERO local_main_at_Main_internal_10 GOTO label_FALSE_3 + # IF_ZERO local_main_at_Main_internal_10 GOTO label_FALSE_3 + lw $t0, -44($fp) + beq $t0, 0, label_FALSE_3 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + # GOTO label_END_4 +j label_END_4 +label_FALSE_3: + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -44($fp) + label_END_4: +# LOCAL local_main_at_Main_internal_9 --> -40($fp) +# LOCAL local_main_at_Main_internal_10 --> -44($fp) +# Obtain value from -44($fp) +lw $v0, -44($fp) +lw $v0, 12($v0) +sw $v0, -40($fp) +# IF_ZERO local_main_at_Main_internal_9 GOTO label_WHILE_END_2 +# IF_ZERO local_main_at_Main_internal_9 GOTO label_WHILE_END_2 +lw $t0, -40($fp) +beq $t0, 0, label_WHILE_END_2 +# local_main_at_Main_internal_14 = GETATTRIBUTE cells Main +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +lw $t0, 12($s1) +sw $t0, -60($fp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 +lw $t0, -60($fp) +sw $t0, -52($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 evolve +# Save new self pointer in $s1 +lw $s1, -52($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 20($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -56($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# local_main_at_Main_internal_17 = GETATTRIBUTE cells Main +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +lw $t0, 12($s1) +sw $t0, -72($fp) +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +# local_main_at_Main_internal_15 = local_main_at_Main_internal_17 +lw $t0, -72($fp) +sw $t0, -64($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 print +# Save new self pointer in $s1 +lw $s1, -64($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 52($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -68($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -80($fp) +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# LOCAL local_main_at_Main_countdown_7 --> -32($fp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# local_main_at_Main_internal_18 = local_main_at_Main_countdown_7 - local_main_at_Main_internal_19 +lw $t1, -32($fp) +lw $t0, 12($t1) +lw $t1, -80($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -76($fp) +# LOCAL local_main_at_Main_countdown_7 --> -32($fp) +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# local_main_at_Main_countdown_7 = local_main_at_Main_internal_18 +lw $t0, -76($fp) +sw $t0, -32($fp) +# GOTO label_WHILE_1 +j label_WHILE_1 +label_WHILE_END_2: + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_20 = SELF + sw $s1, -84($fp) + # RETURN local_main_at_Main_internal_20 + lw $v0, -84($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 92 + jr $ra + # Function END + + +# __CellularAutomaton__attrib__population_map__init implementation. +# @Params: +__CellularAutomaton__attrib__population_map__init: + # Allocate stack frame for function __CellularAutomaton__attrib__population_map__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_rAutomaton__attrib__population_map__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -4($fp) + # RETURN local_rAutomaton__attrib__population_map__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __CellularAutomaton__attrib__population_map__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_init_at_CellularAutomaton_map_0 +function_init_at_CellularAutomaton: + # Allocate stack frame for function function_init_at_CellularAutomaton. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_CellularAutomaton_map_0 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 12($s1) + # LOCAL local_init_at_CellularAutomaton_internal_0 --> -4($fp) + # local_init_at_CellularAutomaton_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_CellularAutomaton_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_at_CellularAutomaton implementation. +# @Params: +function_print_at_CellularAutomaton: + # Allocate stack frame for function function_print_at_CellularAutomaton. + subu $sp, $sp, 40 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 40 + # LOCAL local_print_at_CellularAutomaton_internal_2 --> -12($fp) + # local_print_at_CellularAutomaton_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_print_at_CellularAutomaton_internal_2 --> -12($fp) + # local_print_at_CellularAutomaton_internal_0 = local_print_at_CellularAutomaton_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_CellularAutomaton_internal_5 = GETATTRIBUTE population_map CellularAutomaton + # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) + lw $t0, 12($s1) + sw $t0, -24($fp) + # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) + # local_print_at_CellularAutomaton_internal_3 = local_print_at_CellularAutomaton_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -28($fp) + # ARG local_print_at_CellularAutomaton_internal_6 + # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) + lw $t0, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_print_at_CellularAutomaton_internal_4 --> -20($fp) + # local_print_at_CellularAutomaton_internal_4 = VCALL local_print_at_CellularAutomaton_internal_3 concat + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_print_at_CellularAutomaton_internal_4 + # LOCAL local_print_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_print_at_CellularAutomaton_internal_1 --> -8($fp) + # local_print_at_CellularAutomaton_internal_1 = VCALL local_print_at_CellularAutomaton_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 60($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) + # local_print_at_CellularAutomaton_internal_7 = SELF + sw $s1, -32($fp) + # RETURN local_print_at_CellularAutomaton_internal_7 + lw $v0, -32($fp) + # Deallocate stack frame for function function_print_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 40 + jr $ra + # Function END + + +# function_num_cells_at_CellularAutomaton implementation. +# @Params: +function_num_cells_at_CellularAutomaton: + # Allocate stack frame for function function_num_cells_at_CellularAutomaton. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_num_cells_at_CellularAutomaton_internal_2 = GETATTRIBUTE population_map CellularAutomaton + # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) + # local_num_cells_at_CellularAutomaton_internal_0 = local_num_cells_at_CellularAutomaton_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_1 --> -8($fp) + # local_num_cells_at_CellularAutomaton_internal_1 = VCALL local_num_cells_at_CellularAutomaton_internal_0 length + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 36($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_num_cells_at_CellularAutomaton_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_num_cells_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cell_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_cell_at_CellularAutomaton_position_0 +function_cell_at_CellularAutomaton: + # Allocate stack frame for function function_cell_at_CellularAutomaton. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_cell_at_CellularAutomaton_internal_2 = GETATTRIBUTE population_map CellularAutomaton + # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) + # local_cell_at_CellularAutomaton_internal_0 = local_cell_at_CellularAutomaton_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cell_at_CellularAutomaton_position_0 + # PARAM param_cell_at_CellularAutomaton_position_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -16($fp) + # ARG local_cell_at_CellularAutomaton_internal_3 + # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) + # local_cell_at_CellularAutomaton_internal_1 = VCALL local_cell_at_CellularAutomaton_internal_0 substr + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_cell_at_CellularAutomaton_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_cell_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_cell_left_neighbor_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_cell_left_neighbor_at_CellularAutomaton_position_0 +function_cell_left_neighbor_at_CellularAutomaton: + # Allocate stack frame for function function_cell_left_neighbor_at_CellularAutomaton. + subu $sp, $sp, 80 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 80 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # IF_ZERO param_cell_left_neighbor_at_CellularAutomaton_position_0 GOTO label_FALSE_7 + # IF_ZERO param_cell_left_neighbor_at_CellularAutomaton_position_0 GOTO label_FALSE_7 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_7 + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_4 GOTO label_FALSE_7 + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_4 GOTO label_FALSE_7 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_7 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_10 + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_10 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_10 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_11 + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_11 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_11 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_11 + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_11 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_11 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_8 + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_8 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_8 + # GOTO label_FALSE_7 + j label_FALSE_7 + label_COMPARE_BY_VALUE_11: + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_8 + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_8 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_8 + # GOTO label_FALSE_7 + j label_FALSE_7 + label_COMPARE_STRING_10: + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_12 + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_12 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_12 + # GOTO label_FALSE_7 + j label_FALSE_7 + label_CONTINUE_12: + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_13: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_14 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_13 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_14: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_8 + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_8 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_8 + label_FALSE_7: + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_9 +j label_END_9 +label_TRUE_8: + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_9: +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_5 +# IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_5 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_5 +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_7 = SELF +sw $s1, -32($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_5 = local_cell_left_neighbor_at_CellularAutomaton_internal_7 +lw $t0, -32($fp) +sw $t0, -24($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_11 = SELF +sw $s1, -48($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_9 = local_cell_left_neighbor_at_CellularAutomaton_internal_11 +lw $t0, -48($fp) +sw $t0, -40($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_10 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_9 num_cells +# Save new self pointer in $s1 +lw $s1, -40($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 40($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -44($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -52($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_8 = local_cell_left_neighbor_at_CellularAutomaton_internal_10 - local_cell_left_neighbor_at_CellularAutomaton_internal_12 +lw $t1, -44($fp) +lw $t0, 12($t1) +lw $t1, -52($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -36($fp) +# ARG local_cell_left_neighbor_at_CellularAutomaton_internal_8 +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) +lw $t0, -36($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_6 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_5 cell +# Save new self pointer in $s1 +lw $s1, -24($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -28($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_1 = local_cell_left_neighbor_at_CellularAutomaton_internal_6 +lw $t0, -28($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_15 --> -64($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_15 --> -64($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_13 = local_cell_left_neighbor_at_CellularAutomaton_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -72($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_16 --> -68($fp) + # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_17 --> -72($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_16 = PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 - local_cell_left_neighbor_at_CellularAutomaton_internal_17 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -72($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -68($fp) + # ARG local_cell_left_neighbor_at_CellularAutomaton_internal_16 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_16 --> -68($fp) + lw $t0, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_14 --> -60($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_14 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_13 cell + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_14 --> -60($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_1 = local_cell_left_neighbor_at_CellularAutomaton_internal_14 + lw $t0, -60($fp) + sw $t0, -8($fp) + label_ENDIF_6: +# RETURN local_cell_left_neighbor_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_cell_left_neighbor_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 80 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_cell_right_neighbor_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_cell_right_neighbor_at_CellularAutomaton_position_0 +function_cell_right_neighbor_at_CellularAutomaton: + # Allocate stack frame for function function_cell_right_neighbor_at_CellularAutomaton. + subu $sp, $sp, 80 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 80 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_7 = SELF + sw $s1, -32($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_5 = local_cell_right_neighbor_at_CellularAutomaton_internal_7 + lw $t0, -32($fp) + sw $t0, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_6 = VCALL local_cell_right_neighbor_at_CellularAutomaton_internal_5 num_cells + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_4 = local_cell_right_neighbor_at_CellularAutomaton_internal_6 - local_cell_right_neighbor_at_CellularAutomaton_internal_8 + lw $t1, -28($fp) + lw $t0, 12($t1) + lw $t1, -36($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -20($fp) + # IF_ZERO param_cell_right_neighbor_at_CellularAutomaton_position_0 GOTO label_FALSE_17 + # IF_ZERO param_cell_right_neighbor_at_CellularAutomaton_position_0 GOTO label_FALSE_17 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_17 + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_4 GOTO label_FALSE_17 + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_4 GOTO label_FALSE_17 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_17 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_20 + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_20 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_20 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_21 + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_21 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_21 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_21 + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_21 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_21 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_18 + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_18 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_18 + # GOTO label_FALSE_17 + j label_FALSE_17 + label_COMPARE_BY_VALUE_21: + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_18 + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_18 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_18 + # GOTO label_FALSE_17 + j label_FALSE_17 + label_COMPARE_STRING_20: + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_22 + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_22 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_22 + # GOTO label_FALSE_17 + j label_FALSE_17 + label_CONTINUE_22: + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_23: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_24 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_23 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_24: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_18 + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_18 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_18 + label_FALSE_17: + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_19 +j label_END_19 +label_TRUE_18: + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_19: +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_15 +# IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_15 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_15 +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) +# local_cell_right_neighbor_at_CellularAutomaton_internal_11 = SELF +sw $s1, -48($fp) +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) +# local_cell_right_neighbor_at_CellularAutomaton_internal_9 = local_cell_right_neighbor_at_CellularAutomaton_internal_11 +lw $t0, -48($fp) +sw $t0, -40($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -52($fp) +# ARG local_cell_right_neighbor_at_CellularAutomaton_internal_12 +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) +lw $t0, -52($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) +# local_cell_right_neighbor_at_CellularAutomaton_internal_10 = VCALL local_cell_right_neighbor_at_CellularAutomaton_internal_9 cell +# Save new self pointer in $s1 +lw $s1, -40($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -44($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) +# local_cell_right_neighbor_at_CellularAutomaton_internal_1 = local_cell_right_neighbor_at_CellularAutomaton_internal_10 +lw $t0, -44($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_16 +j label_ENDIF_16 +label_FALSEIF_15: + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_15 --> -64($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_15 --> -64($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_13 = local_cell_right_neighbor_at_CellularAutomaton_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -72($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_16 --> -68($fp) + # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_17 --> -72($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_16 = PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 + local_cell_right_neighbor_at_CellularAutomaton_internal_17 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -72($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -68($fp) + # ARG local_cell_right_neighbor_at_CellularAutomaton_internal_16 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_16 --> -68($fp) + lw $t0, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_14 --> -60($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_14 = VCALL local_cell_right_neighbor_at_CellularAutomaton_internal_13 cell + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_14 --> -60($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_1 = local_cell_right_neighbor_at_CellularAutomaton_internal_14 + lw $t0, -60($fp) + sw $t0, -8($fp) + label_ENDIF_16: +# RETURN local_cell_right_neighbor_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_cell_right_neighbor_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 80 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_cell_at_next_evolution_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_cell_at_next_evolution_at_CellularAutomaton_position_0 +function_cell_at_next_evolution_at_CellularAutomaton: + # Allocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. + subu $sp, $sp, 164 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 164 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_10 = local_cell_at_next_evolution_at_CellularAutomaton_internal_12 + lw $t0, -52($fp) + sw $t0, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 + # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_11 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 cell + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_6 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -56($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_11 GOTO label_FALSE_29 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_11 GOTO label_FALSE_29 + lw $t0, -48($fp) + beq $t0, 0, label_FALSE_29 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_13 GOTO label_FALSE_29 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_13 GOTO label_FALSE_29 + lw $t0, -56($fp) + beq $t0, 0, label_FALSE_29 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with String + la $v0, String + lw $a0, -48($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_COMPARE_STRING_32 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_COMPARE_STRING_32 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_32 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with Bool + la $v0, Bool + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_33 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_33 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_33 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with Int + la $v0, Int + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_33 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_33 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_33 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) + # Load pointers and SUB + lw $a0, -48($fp) + lw $a1, -56($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_TRUE_30 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_TRUE_30 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_30 + # GOTO label_FALSE_29 + j label_FALSE_29 + label_COMPARE_BY_VALUE_33: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) + lw $a0, -48($fp) + lw $a1, -56($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_TRUE_30 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_TRUE_30 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_30 + # GOTO label_FALSE_29 + j label_FALSE_29 + label_COMPARE_STRING_32: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -56($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_CONTINUE_34 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_CONTINUE_34 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_34 + # GOTO label_FALSE_29 + j label_FALSE_29 + label_CONTINUE_34: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -56($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_35: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_36 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_35 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_36: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_TRUE_30 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_TRUE_30 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_30 + label_FALSE_29: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_31 +j label_END_31 +label_TRUE_30: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_31: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_27 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_27 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_27 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -60($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = local_cell_at_next_evolution_at_CellularAutomaton_internal_14 +lw $t0, -60($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_28 +j label_ENDIF_28 +label_FALSEIF_27: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -64($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = local_cell_at_next_evolution_at_CellularAutomaton_internal_15 + lw $t0, -64($fp) + sw $t0, -32($fp) + label_ENDIF_28: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_22 = SELF +sw $s1, -92($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_20 = local_cell_at_next_evolution_at_CellularAutomaton_internal_22 +lw $t0, -92($fp) +sw $t0, -84($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 +# PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_21 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 cell_left_neighbor +# Save new self pointer in $s1 +lw $s1, -84($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 68($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -88($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_7 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -96($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_21 GOTO label_FALSE_39 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_21 GOTO label_FALSE_39 +lw $t0, -88($fp) +beq $t0, 0, label_FALSE_39 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_23 GOTO label_FALSE_39 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_23 GOTO label_FALSE_39 +lw $t0, -96($fp) +beq $t0, 0, label_FALSE_39 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) +# Comparing -88($fp) type with String +la $v0, String +lw $a0, -88($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -80($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_COMPARE_STRING_42 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_COMPARE_STRING_42 +lw $t0, -80($fp) +beq $t0, 0, label_COMPARE_STRING_42 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) +# Comparing -88($fp) type with Bool +la $v0, Bool +lw $a0, -88($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -80($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_43 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_43 +lw $t0, -80($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_43 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) +# Comparing -88($fp) type with Int +la $v0, Int +lw $a0, -88($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -80($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_43 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_43 +lw $t0, -80($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_43 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) +# Load pointers and SUB +lw $a0, -88($fp) +lw $a1, -96($fp) +sub $a0, $a0, $a1 +sw $a0, -80($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_TRUE_40 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_TRUE_40 +lw $t0, -80($fp) +beq $t0, 0, label_TRUE_40 +# GOTO label_FALSE_39 +j label_FALSE_39 +label_COMPARE_BY_VALUE_43: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) + lw $a0, -88($fp) + lw $a1, -96($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -80($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_TRUE_40 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_TRUE_40 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_40 + # GOTO label_FALSE_39 + j label_FALSE_39 + label_COMPARE_STRING_42: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) + # Load strings for comparison + lw $v0, -88($fp) + lw $v1, -96($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -80($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_CONTINUE_44 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_CONTINUE_44 + lw $t0, -80($fp) + beq $t0, 0, label_CONTINUE_44 + # GOTO label_FALSE_39 + j label_FALSE_39 + label_CONTINUE_44: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -88($fp) + lw $v1, -96($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_45: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_46 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_45 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_46: + # Store result + sw $a2, -80($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_TRUE_40 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_TRUE_40 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_40 + label_FALSE_39: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -76($fp) + # GOTO label_END_41 +j label_END_41 +label_TRUE_40: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -76($fp) + label_END_41: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) +# Obtain value from -76($fp) +lw $v0, -76($fp) +lw $v0, 12($v0) +sw $v0, -68($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_16 GOTO label_FALSEIF_37 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_16 GOTO label_FALSEIF_37 +lw $t0, -68($fp) +beq $t0, 0, label_FALSEIF_37 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -100($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_17 = local_cell_at_next_evolution_at_CellularAutomaton_internal_24 +lw $t0, -100($fp) +sw $t0, -72($fp) +# GOTO label_ENDIF_38 +j label_ENDIF_38 +label_FALSEIF_37: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_25 --> -104($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -104($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_25 --> -104($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_17 = local_cell_at_next_evolution_at_CellularAutomaton_internal_25 + lw $t0, -104($fp) + sw $t0, -72($fp) + label_ENDIF_38: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_5 = local_cell_at_next_evolution_at_CellularAutomaton_internal_7 + local_cell_at_next_evolution_at_CellularAutomaton_internal_17 +lw $t1, -32($fp) +lw $t0, 12($t1) +lw $t1, -72($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -24($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_32 --> -132($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_32 = SELF +sw $s1, -132($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_30 --> -124($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_32 --> -132($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_30 = local_cell_at_next_evolution_at_CellularAutomaton_internal_32 +lw $t0, -132($fp) +sw $t0, -124($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 +# PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_30 --> -124($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_31 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_30 cell_right_neighbor +# Save new self pointer in $s1 +lw $s1, -124($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 56($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -128($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_33 --> -136($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_8 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -136($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_31 GOTO label_FALSE_49 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_31 GOTO label_FALSE_49 +lw $t0, -128($fp) +beq $t0, 0, label_FALSE_49 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_33 GOTO label_FALSE_49 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_33 GOTO label_FALSE_49 +lw $t0, -136($fp) +beq $t0, 0, label_FALSE_49 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) +# Comparing -128($fp) type with String +la $v0, String +lw $a0, -128($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -120($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_COMPARE_STRING_52 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_COMPARE_STRING_52 +lw $t0, -120($fp) +beq $t0, 0, label_COMPARE_STRING_52 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) +# Comparing -128($fp) type with Bool +la $v0, Bool +lw $a0, -128($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -120($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_COMPARE_BY_VALUE_53 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_COMPARE_BY_VALUE_53 +lw $t0, -120($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_53 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) +# Comparing -128($fp) type with Int +la $v0, Int +lw $a0, -128($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -120($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_COMPARE_BY_VALUE_53 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_COMPARE_BY_VALUE_53 +lw $t0, -120($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_53 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_33 --> -136($fp) +# Load pointers and SUB +lw $a0, -128($fp) +lw $a1, -136($fp) +sub $a0, $a0, $a1 +sw $a0, -120($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_TRUE_50 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_TRUE_50 +lw $t0, -120($fp) +beq $t0, 0, label_TRUE_50 +# GOTO label_FALSE_49 +j label_FALSE_49 +label_COMPARE_BY_VALUE_53: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_33 --> -136($fp) + lw $a0, -128($fp) + lw $a1, -136($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -120($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_TRUE_50 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_TRUE_50 + lw $t0, -120($fp) + beq $t0, 0, label_TRUE_50 + # GOTO label_FALSE_49 + j label_FALSE_49 + label_COMPARE_STRING_52: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_33 --> -136($fp) + # Load strings for comparison + lw $v0, -128($fp) + lw $v1, -136($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -120($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_CONTINUE_54 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_CONTINUE_54 + lw $t0, -120($fp) + beq $t0, 0, label_CONTINUE_54 + # GOTO label_FALSE_49 + j label_FALSE_49 + label_CONTINUE_54: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_33 --> -136($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -128($fp) + lw $v1, -136($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_55: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_56 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_55 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_56: + # Store result + sw $a2, -120($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_TRUE_50 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_TRUE_50 + lw $t0, -120($fp) + beq $t0, 0, label_TRUE_50 + label_FALSE_49: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_28 --> -116($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -116($fp) + # GOTO label_END_51 +j label_END_51 +label_TRUE_50: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_28 --> -116($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -116($fp) + label_END_51: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_26 --> -108($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_28 --> -116($fp) +# Obtain value from -116($fp) +lw $v0, -116($fp) +lw $v0, 12($v0) +sw $v0, -108($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_26 GOTO label_FALSEIF_47 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_26 GOTO label_FALSEIF_47 +lw $t0, -108($fp) +beq $t0, 0, label_FALSEIF_47 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_34 --> -140($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -140($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_27 --> -112($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_34 --> -140($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_27 = local_cell_at_next_evolution_at_CellularAutomaton_internal_34 +lw $t0, -140($fp) +sw $t0, -112($fp) +# GOTO label_ENDIF_48 +j label_ENDIF_48 +label_FALSEIF_47: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_35 --> -144($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -144($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_27 --> -112($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_35 --> -144($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_27 = local_cell_at_next_evolution_at_CellularAutomaton_internal_35 + lw $t0, -144($fp) + sw $t0, -112($fp) + label_ENDIF_48: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_27 --> -112($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_4 = local_cell_at_next_evolution_at_CellularAutomaton_internal_5 + local_cell_at_next_evolution_at_CellularAutomaton_internal_27 +lw $t1, -24($fp) +lw $t0, 12($t1) +lw $t1, -112($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -20($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_36 --> -148($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -148($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_4 GOTO label_FALSE_57 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_4 GOTO label_FALSE_57 +lw $t0, -20($fp) +beq $t0, 0, label_FALSE_57 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_36 GOTO label_FALSE_57 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_36 GOTO label_FALSE_57 +lw $t0, -148($fp) +beq $t0, 0, label_FALSE_57 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) +# Comparing -20($fp) type with String +la $v0, String +lw $a0, -20($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -16($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_60 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_60 +lw $t0, -16($fp) +beq $t0, 0, label_COMPARE_STRING_60 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) +# Comparing -20($fp) type with Bool +la $v0, Bool +lw $a0, -20($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -16($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_61 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_61 +lw $t0, -16($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_61 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) +# Comparing -20($fp) type with Int +la $v0, Int +lw $a0, -20($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -16($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_61 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_61 +lw $t0, -16($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_61 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_36 --> -148($fp) +# Load pointers and SUB +lw $a0, -20($fp) +lw $a1, -148($fp) +sub $a0, $a0, $a1 +sw $a0, -16($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_58 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_58 +lw $t0, -16($fp) +beq $t0, 0, label_TRUE_58 +# GOTO label_FALSE_57 +j label_FALSE_57 +label_COMPARE_BY_VALUE_61: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_36 --> -148($fp) + lw $a0, -20($fp) + lw $a1, -148($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_58 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_58 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_58 + # GOTO label_FALSE_57 + j label_FALSE_57 + label_COMPARE_STRING_60: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_36 --> -148($fp) + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -148($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_62 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_62 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_62 + # GOTO label_FALSE_57 + j label_FALSE_57 + label_CONTINUE_62: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_36 --> -148($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -148($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_63: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_64 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_63 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_64: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_58 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_58 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_58 + label_FALSE_57: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_59 +j label_END_59 +label_TRUE_58: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_59: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_25 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_25 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_25 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_37 --> -152($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_9 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -152($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_37 --> -152($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = local_cell_at_next_evolution_at_CellularAutomaton_internal_37 +lw $t0, -152($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_26 +j label_ENDIF_26 +label_FALSEIF_25: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_10 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -156($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_38 --> -156($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = local_cell_at_next_evolution_at_CellularAutomaton_internal_38 + lw $t0, -156($fp) + sw $t0, -8($fp) + label_ENDIF_26: +# RETURN local_cell_at_next_evolution_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 164 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_evolve_at_CellularAutomaton implementation. +# @Params: +function_evolve_at_CellularAutomaton: + # Allocate stack frame for function function_evolve_at_CellularAutomaton. + subu $sp, $sp, 72 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 72 + # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) + # local_evolve_at_CellularAutomaton_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) + # local_evolve_at_CellularAutomaton_internal_2 = local_evolve_at_CellularAutomaton_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_evolve_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) + # local_evolve_at_CellularAutomaton_internal_3 = VCALL local_evolve_at_CellularAutomaton_internal_2 num_cells + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) + # local_evolve_at_CellularAutomaton_num_1 = local_evolve_at_CellularAutomaton_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -24($fp) + label_WHILE_65: + # LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) + # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) + lw $a0, -4($fp) + lw $a1, -8($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -32($fp) + # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_7 GOTO label_FALSE_67 + # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_7 GOTO label_FALSE_67 + lw $t0, -32($fp) + bgt $t0, 0, label_FALSE_67 + # IF_ZERO local_evolve_at_CellularAutomaton_internal_7 GOTO label_FALSE_67 + # IF_ZERO local_evolve_at_CellularAutomaton_internal_7 GOTO label_FALSE_67 + lw $t0, -32($fp) + beq $t0, 0, label_FALSE_67 + # LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -32($fp) + # GOTO label_END_68 +j label_END_68 +label_FALSE_67: + # LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -32($fp) + label_END_68: +# LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) +# Obtain value from -32($fp) +lw $v0, -32($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_66 +# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_66 +lw $t0, -28($fp) +beq $t0, 0, label_WHILE_END_66 +# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) +# local_evolve_at_CellularAutomaton_internal_8 = local_evolve_at_CellularAutomaton_temp_5 +lw $t0, -24($fp) +sw $t0, -36($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) +# local_evolve_at_CellularAutomaton_internal_12 = SELF +sw $s1, -52($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) +# local_evolve_at_CellularAutomaton_internal_10 = local_evolve_at_CellularAutomaton_internal_12 +lw $t0, -52($fp) +sw $t0, -44($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_evolve_at_CellularAutomaton_position_0 +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +lw $t0, -4($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) +# local_evolve_at_CellularAutomaton_internal_11 = VCALL local_evolve_at_CellularAutomaton_internal_10 cell_at_next_evolution +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 72($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_evolve_at_CellularAutomaton_internal_11 +# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) +lw $t0, -48($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) +# local_evolve_at_CellularAutomaton_internal_9 = VCALL local_evolve_at_CellularAutomaton_internal_8 concat +# Save new self pointer in $s1 +lw $s1, -36($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 28($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -40($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) +# local_evolve_at_CellularAutomaton_temp_5 = local_evolve_at_CellularAutomaton_internal_9 +lw $t0, -40($fp) +sw $t0, -24($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_14 --> -60($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -60($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_14 --> -60($fp) +# local_evolve_at_CellularAutomaton_internal_13 = local_evolve_at_CellularAutomaton_position_0 + local_evolve_at_CellularAutomaton_internal_14 +lw $t1, -4($fp) +lw $t0, 12($t1) +lw $t1, -60($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -56($fp) +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) +# local_evolve_at_CellularAutomaton_position_0 = local_evolve_at_CellularAutomaton_internal_13 +lw $t0, -56($fp) +sw $t0, -4($fp) +# GOTO label_WHILE_65 +j label_WHILE_65 +label_WHILE_END_66: + # + # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) + lw $t0, -24($fp) + sw $t0, 12($s1) + # LOCAL local_evolve_at_CellularAutomaton_internal_15 --> -64($fp) + # local_evolve_at_CellularAutomaton_internal_15 = SELF + sw $s1, -64($fp) + # RETURN local_evolve_at_CellularAutomaton_internal_15 + lw $v0, -64($fp) + # Deallocate stack frame for function function_evolve_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 72 + jr $ra + # Function END + diff --git a/tests/codegen/complex.mips b/tests/codegen/complex.mips index 72e1c90f..74951590 100644 --- a/tests/codegen/complex.mips +++ b/tests/codegen/complex.mips @@ -1,10 +1,11 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:51 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:12 2020 # School of Math and Computer Science, University of Havana # .data +dummy: .word 0 IO: .asciiz "IO" # Function END Object: .asciiz "Object" @@ -23,7 +24,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +IO_vtable: .word dummy, function_out_int_at_IO, dummy, function_in_int_at_IO, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, function_out_string_at_IO, dummy, function_type_name_at_Object, function_in_string_at_IO, function_abort_at_Object, dummy # Function END # @@ -37,7 +38,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, dummy # Function END # @@ -51,7 +52,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word function_substr_at_String, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_concat_at_String, function_type_name_at_Object, dummy, function_abort_at_Object, function_length_at_String # Function END # @@ -65,7 +66,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, dummy # Function END # @@ -79,7 +80,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, dummy # Function END # @@ -93,7 +94,7 @@ Int_end: # **** VTABLE for type Complex **** -Complex_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Complex, function_print_at_Complex, function_reflect_0_at_Complex, function_reflect_X_at_Complex, function_reflect_Y_at_Complex +Complex_vtable: .word dummy, function_out_int_at_IO, function_reflect_X_at_Complex, function_in_int_at_IO, function_reflect_0_at_Complex, function_init_at_Complex, dummy, function_print_at_Complex, function_reflect_Y_at_Complex, function_copy_at_Object, function_out_string_at_IO, dummy, function_type_name_at_Object, function_in_string_at_IO, function_abort_at_Object, dummy # Function END # @@ -107,7 +108,7 @@ Complex_end: # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +Main_vtable: .word dummy, function_out_int_at_IO, dummy, function_in_int_at_IO, dummy, dummy, function_main_at_Main, dummy, dummy, function_copy_at_Object, function_out_string_at_IO, dummy, function_type_name_at_Object, function_in_string_at_IO, function_abort_at_Object, dummy # Function END # @@ -429,7 +430,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -682,7 +683,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 28($t0) + lw $t1, 24($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -1508,7 +1509,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -1554,7 +1555,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -1603,7 +1604,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -1638,7 +1639,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -1687,7 +1688,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -2911,7 +2912,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -2941,7 +2942,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -2966,7 +2967,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -2991,7 +2992,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -3248,7 +3249,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -3308,7 +3309,7 @@ label_FALSEIF_59: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips index 89fb5601..2fbb08cd 100644 --- a/tests/codegen/fib.mips +++ b/tests/codegen/fib.mips @@ -1,10 +1,11 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:51 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:12 2020 # School of Math and Computer Science, University of Havana # .data +dummy: .word 0 IO: .asciiz "IO" # Function END Object: .asciiz "Object" @@ -21,7 +22,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +IO_vtable: .word dummy, function_abort_at_Object, dummy, function_in_string_at_IO, function_out_int_at_IO, dummy, function_in_int_at_IO, function_type_name_at_Object, function_copy_at_Object, dummy, function_out_string_at_IO, dummy # Function END # @@ -35,7 +36,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Object_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy # Function END # @@ -49,7 +50,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word dummy, function_abort_at_Object, function_substr_at_String, dummy, dummy, function_concat_at_String, dummy, function_type_name_at_Object, function_copy_at_Object, function_length_at_String, dummy, dummy # Function END # @@ -63,7 +64,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Bool_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy # Function END # @@ -77,7 +78,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Int_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy # Function END # @@ -91,7 +92,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main, function_fib_at_Main +Main_vtable: .word function_fib_at_Main, function_abort_at_Object, dummy, function_in_string_at_IO, function_out_int_at_IO, dummy, function_in_int_at_IO, function_type_name_at_Object, function_copy_at_Object, dummy, function_out_string_at_IO, function_main_at_Main # Function END # @@ -404,7 +405,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -657,7 +658,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 28($t0) + lw $t1, 44($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -727,7 +728,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -800,7 +801,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -875,7 +876,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) diff --git a/tests/codegen/graph.mips b/tests/codegen/graph.mips index 1ea016b0..86021a47 100644 --- a/tests/codegen/graph.mips +++ b/tests/codegen/graph.mips @@ -1,10 +1,11 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:52 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:13 2020 # School of Math and Computer Science, University of Havana # .data +dummy: .word 0 IO: .asciiz "IO" # Function END Object: .asciiz "Object" @@ -39,7 +40,7 @@ Vertice: .asciiz "Vertice" # **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +IO_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, dummy, function_out_int_at_IO, dummy, dummy, function_out_string_at_IO # Function END # @@ -53,7 +54,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Object_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -67,7 +68,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, function_concat_at_String, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_length_at_String, dummy, dummy, dummy, dummy, dummy, dummy, function_substr_at_String, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -81,7 +82,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Bool_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -95,7 +96,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Int_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -109,7 +110,7 @@ Int_end: # **** VTABLE for type BoolOp **** -BoolOp_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_and_at_BoolOp, function_or_at_BoolOp +BoolOp_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, function_or_at_BoolOp, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_and_at_BoolOp, dummy, dummy # Function END # @@ -123,7 +124,7 @@ BoolOp_end: # **** VTABLE for type Graph **** -Graph_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_add_vertice_at_Graph, function_print_E_at_Graph, function_print_V_at_Graph +Graph_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, function_print_V_at_Graph, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_add_vertice_at_Graph, dummy, dummy, dummy, dummy, dummy, dummy, function_print_E_at_Graph, dummy # Function END # @@ -137,7 +138,7 @@ Graph_end: # **** VTABLE for type Parse **** -Parse_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_read_input_at_Parse, function_parse_line_at_Parse, function_c2i_at_Parse, function_a2i_at_Parse, function_a2i_aux_at_Parse +Parse_vtable: .word dummy, function_a2i_aux_at_Parse, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_a2i_at_Parse, function_parse_line_at_Parse, dummy, dummy, dummy, dummy, function_abort_at_Object, function_read_input_at_Parse, dummy, dummy, function_in_string_at_IO, function_c2i_at_Parse, function_in_int_at_IO, dummy, function_out_int_at_IO, dummy, dummy, function_out_string_at_IO # Function END # @@ -151,7 +152,7 @@ Parse_end: # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_read_input_at_Parse, function_parse_line_at_Parse, function_c2i_at_Parse, function_a2i_at_Parse, function_a2i_aux_at_Parse, function_main_at_Main +Main_vtable: .word dummy, function_a2i_aux_at_Parse, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_main_at_Main, dummy, dummy, function_a2i_at_Parse, function_parse_line_at_Parse, dummy, dummy, dummy, dummy, function_abort_at_Object, function_read_input_at_Parse, dummy, dummy, function_in_string_at_IO, function_c2i_at_Parse, function_in_int_at_IO, dummy, function_out_int_at_IO, dummy, dummy, function_out_string_at_IO # Function END # @@ -165,7 +166,7 @@ Main_end: # **** VTABLE for type VList **** -VList_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_VList, function_head_at_VList, function_tail_at_VList, function_cons_at_VList, function_print_at_VList +VList_vtable: .word dummy, dummy, function_isNil_at_VList, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_tail_at_VList, dummy, dummy, function_cons_at_VList, dummy, function_head_at_VList, dummy, function_abort_at_Object, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, function_print_at_VList, function_out_int_at_IO, dummy, dummy, function_out_string_at_IO # Function END # @@ -179,7 +180,7 @@ VList_end: # **** VTABLE for type VCons **** -VCons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_VCons, function_head_at_VCons, function_tail_at_VCons, function_cons_at_VList, function_print_at_VCons, function_init_at_VCons +VCons_vtable: .word dummy, dummy, function_isNil_at_VCons, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, function_init_at_VCons, dummy, dummy, dummy, dummy, function_tail_at_VCons, dummy, dummy, function_cons_at_VList, dummy, function_head_at_VCons, dummy, function_abort_at_Object, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, function_print_at_VCons, function_out_int_at_IO, dummy, dummy, function_out_string_at_IO # Function END # @@ -193,7 +194,7 @@ VCons_end: # **** VTABLE for type EList **** -EList_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_EList, function_head_at_EList, function_tail_at_EList, function_cons_at_EList, function_append_at_EList, function_print_at_EList +EList_vtable: .word dummy, dummy, function_isNil_at_EList, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, function_append_at_EList, dummy, dummy, dummy, function_tail_at_EList, dummy, dummy, function_cons_at_EList, dummy, function_head_at_EList, dummy, function_abort_at_Object, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, function_print_at_EList, function_out_int_at_IO, dummy, dummy, function_out_string_at_IO # Function END # @@ -207,7 +208,7 @@ EList_end: # **** VTABLE for type ECons **** -ECons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_isNil_at_ECons, function_head_at_ECons, function_tail_at_ECons, function_cons_at_EList, function_append_at_EList, function_print_at_ECons, function_init_at_ECons +ECons_vtable: .word dummy, dummy, function_isNil_at_ECons, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, function_init_at_ECons, function_append_at_EList, dummy, dummy, dummy, function_tail_at_ECons, dummy, dummy, function_cons_at_EList, dummy, function_head_at_ECons, dummy, function_abort_at_Object, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, function_print_at_ECons, function_out_int_at_IO, dummy, dummy, function_out_string_at_IO # Function END # @@ -221,7 +222,7 @@ ECons_end: # **** VTABLE for type Edge **** -Edge_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Edge, function_print_at_Edge +Edge_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, function_init_at_Edge, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, function_print_at_Edge, function_out_int_at_IO, dummy, dummy, function_out_string_at_IO # Function END # @@ -235,7 +236,7 @@ Edge_end: # **** VTABLE for type Vertice **** -Vertice_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_outgoing_at_Vertice, function_number_at_Vertice, function_init_at_Vertice, function_add_out_at_Vertice, function_print_at_Vertice +Vertice_vtable: .word function_outgoing_at_Vertice, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, function_init_at_Vertice, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_number_at_Vertice, dummy, dummy, function_abort_at_Object, dummy, function_add_out_at_Vertice, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, function_print_at_Vertice, function_out_int_at_IO, dummy, dummy, function_out_string_at_IO # Function END # @@ -641,7 +642,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -918,7 +919,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 48($t0) + lw $t1, 40($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -1256,7 +1257,7 @@ function_add_vertice_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -1291,7 +1292,7 @@ function_add_vertice_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1330,7 +1331,7 @@ function_add_vertice_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -1385,7 +1386,7 @@ function_print_E_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1435,7 +1436,7 @@ function_print_V_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1663,7 +1664,7 @@ function_read_input_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -2288,7 +2289,7 @@ label_FALSE_25: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 112($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -2340,7 +2341,7 @@ label_FALSE_25: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -2363,7 +2364,7 @@ label_FALSE_25: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -2391,7 +2392,7 @@ label_FALSE_25: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -100($fp) @@ -2521,7 +2522,7 @@ function_parse_line_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -2544,7 +2545,7 @@ function_parse_line_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -2579,7 +2580,7 @@ function_parse_line_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -2960,7 +2961,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -3034,7 +3035,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -3142,7 +3143,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -128($fp) @@ -3177,7 +3178,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -116($fp) @@ -3200,7 +3201,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -108($fp) @@ -5875,7 +5876,7 @@ label_FALSEIF_129: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -248($fp) @@ -6015,7 +6016,7 @@ function_a2i_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -6389,7 +6390,7 @@ label_FALSEIF_139: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -6693,7 +6694,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 20($t0) +lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -108($fp) @@ -6785,7 +6786,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -6808,7 +6809,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 44($t0) +lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -6954,7 +6955,7 @@ label_FALSEIF_149: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -7258,7 +7259,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 20($t0) +lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -184($fp) @@ -7350,7 +7351,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -168($fp) @@ -7373,7 +7374,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 40($t0) +lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -156($fp) @@ -7415,7 +7416,7 @@ label_FALSEIF_159: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -196($fp) @@ -7580,7 +7581,7 @@ function_a2i_aux_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -7834,7 +7835,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -8170,7 +8171,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 20($t0) +lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -104($fp) @@ -8300,7 +8301,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -8645,7 +8646,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 20($t0) +lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -160($fp) @@ -8775,7 +8776,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -8937,7 +8938,7 @@ label_FALSEIF_183: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -196($fp) @@ -8960,7 +8961,7 @@ label_FALSEIF_183: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 96($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -184($fp) @@ -9399,7 +9400,7 @@ __Main__attrib__g__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -9449,7 +9450,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -9478,7 +9479,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 116($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -9600,7 +9601,7 @@ function_head_at_VList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -9653,7 +9654,7 @@ function_tail_at_VList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -9772,7 +9773,7 @@ function_cons_at_VList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -9847,7 +9848,7 @@ function_print_at_VList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10056,7 +10057,7 @@ function_print_at_VCons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10085,7 +10086,7 @@ function_print_at_VCons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -10207,7 +10208,7 @@ function_head_at_EList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10260,7 +10261,7 @@ function_tail_at_EList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10379,7 +10380,7 @@ function_cons_at_EList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10431,7 +10432,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 28($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -10477,7 +10478,7 @@ label_FALSEIF_203: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -10508,7 +10509,7 @@ label_FALSEIF_203: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -10544,7 +10545,7 @@ label_FALSEIF_203: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -10567,7 +10568,7 @@ label_FALSEIF_203: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -10648,7 +10649,7 @@ function_print_at_EList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10857,7 +10858,7 @@ function_print_at_ECons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10886,7 +10887,7 @@ function_print_at_ECons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -11156,7 +11157,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -11194,7 +11195,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -11246,7 +11247,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -11284,7 +11285,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -11336,7 +11337,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -11374,7 +11375,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -11631,7 +11632,7 @@ function_add_out_at_Vertice: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -11699,7 +11700,7 @@ function_print_at_Vertice: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -11728,7 +11729,7 @@ function_print_at_Vertice: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) diff --git a/tests/codegen/hairyscary.mips b/tests/codegen/hairyscary.mips index 65f71ab2..091b5158 100644 --- a/tests/codegen/hairyscary.mips +++ b/tests/codegen/hairyscary.mips @@ -1,10 +1,11 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:50 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:11 2020 # School of Math and Computer Science, University of Havana # .data +dummy: .word 0 IO: .asciiz "IO" # Function END Object: .asciiz "Object" @@ -29,7 +30,7 @@ Bar: .asciiz "Bar" # **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +IO_vtable: .word dummy, function_out_int_at_IO, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, dummy, dummy, dummy, function_abort_at_Object, function_in_int_at_IO # Function END # @@ -43,7 +44,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Object_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy # Function END # @@ -57,7 +58,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word function_concat_at_String, dummy, function_length_at_String, function_type_name_at_Object, function_substr_at_String, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy # Function END # @@ -71,7 +72,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Bool_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy # Function END # @@ -85,7 +86,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Int_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy # Function END # @@ -99,7 +100,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_main_at_Main +Main_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_main_at_Main, function_abort_at_Object, dummy # Function END # @@ -113,7 +114,7 @@ Main_end: # **** VTABLE for type Bazz **** -Bazz_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_printh_at_Bazz, function_doh_at_Bazz +Bazz_vtable: .word dummy, function_out_int_at_IO, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, function_printh_at_Bazz, function_doh_at_Bazz, dummy, function_abort_at_Object, function_in_int_at_IO # Function END # @@ -127,7 +128,7 @@ Bazz_end: # **** VTABLE for type Foo **** -Foo_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_printh_at_Bazz, function_doh_at_Foo +Foo_vtable: .word dummy, function_out_int_at_IO, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, function_printh_at_Bazz, function_doh_at_Foo, dummy, function_abort_at_Object, function_in_int_at_IO # Function END # @@ -141,7 +142,7 @@ Foo_end: # **** VTABLE for type Razz **** -Razz_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_printh_at_Bazz, function_doh_at_Foo +Razz_vtable: .word dummy, function_out_int_at_IO, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, function_printh_at_Bazz, function_doh_at_Foo, dummy, function_abort_at_Object, function_in_int_at_IO # Function END # @@ -155,7 +156,7 @@ Razz_end: # **** VTABLE for type Bar **** -Bar_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_printh_at_Bazz, function_doh_at_Foo +Bar_vtable: .word dummy, function_out_int_at_IO, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, function_printh_at_Bazz, function_doh_at_Foo, dummy, function_abort_at_Object, function_in_int_at_IO # Function END # @@ -468,7 +469,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -753,7 +754,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 12($t0) + lw $t1, 40($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -1311,7 +1312,7 @@ __Bazz__attrib__g__init: # local_ttrib__g__init_internal_5 = 13 li $t0, 13 sw $t0, -24($fp) - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Bazz @@ -1333,7 +1334,7 @@ __Bazz__attrib__g__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min0_1: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -1355,7 +1356,7 @@ __Bazz__attrib__g__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min1_2: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Foo @@ -1377,7 +1378,7 @@ __Bazz__attrib__g__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min2_3: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -1415,7 +1416,7 @@ __Bazz__attrib__g__init: # IF_ZERO local_ttrib__g__init_internal_3 GOTO label_ERROR_5 lw $t0, -16($fp) beq $t0, 0, label_ERROR_5 - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Bazz @@ -1522,7 +1523,7 @@ __Bazz__attrib__g__init: # GOTO label_END_6 j label_END_6 label_NEXT0_7: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -1661,7 +1662,7 @@ label_NEXT0_7: # GOTO label_END_6 j label_END_6 label_NEXT1_8: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Foo @@ -1784,7 +1785,7 @@ label_NEXT1_8: # GOTO label_END_6 j label_END_6 label_NEXT2_9: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -1872,7 +1873,7 @@ __Bazz__attrib__i__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -1931,7 +1932,7 @@ function_printh_at_Bazz: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2142,7 +2143,7 @@ __Foo__attrib__a__init: # local_trib__a__init_internal_5 = 13 li $t0, 13 sw $t0, -24($fp) - # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz + # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -2164,7 +2165,7 @@ __Foo__attrib__a__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min0_11: - # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo + # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Foo @@ -2186,7 +2187,7 @@ __Foo__attrib__a__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min1_12: - # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar + # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -2224,7 +2225,7 @@ __Foo__attrib__a__init: # IF_ZERO local_trib__a__init_internal_3 GOTO label_ERROR_14 lw $t0, -16($fp) beq $t0, 0, label_ERROR_14 - # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz + # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -2363,7 +2364,7 @@ __Foo__attrib__a__init: # GOTO label_END_15 j label_END_15 label_NEXT0_16: - # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo + # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Foo @@ -2486,7 +2487,7 @@ label_NEXT0_16: # GOTO label_END_15 j label_END_15 label_NEXT1_17: - # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar + # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -2575,7 +2576,7 @@ __Foo__attrib__b__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -2604,7 +2605,7 @@ __Foo__attrib__b__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -2670,7 +2671,7 @@ __Foo__attrib__b__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -2736,7 +2737,7 @@ __Foo__attrib__b__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -2954,7 +2955,7 @@ __Razz__attrib__e__init: # local_ttrib__e__init_internal_5 = 13 li $t0, 13 sw $t0, -24($fp) - # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -2976,7 +2977,7 @@ __Razz__attrib__e__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min0_19: - # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -3014,7 +3015,7 @@ __Razz__attrib__e__init: # IF_ZERO local_ttrib__e__init_internal_3 GOTO label_ERROR_21 lw $t0, -16($fp) beq $t0, 0, label_ERROR_21 - # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -3153,7 +3154,7 @@ __Razz__attrib__e__init: # GOTO label_END_22 j label_END_22 label_NEXT0_23: - # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -3235,7 +3236,7 @@ __Razz__attrib__f__init: # Get pointer to type's VTABLE la $t0, Bazz_vtable # Get pointer to function address - lw $t1, 32($t0) + lw $t1, 36($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -24($fp) @@ -3264,7 +3265,7 @@ __Razz__attrib__f__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -3331,7 +3332,7 @@ __Razz__attrib__f__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -3397,7 +3398,7 @@ __Razz__attrib__f__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -3463,7 +3464,7 @@ __Razz__attrib__f__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -3550,7 +3551,7 @@ __Bar__attrib__c__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -3599,7 +3600,7 @@ __Bar__attrib__d__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips index a11c9bc5..7aca9f5f 100644 --- a/tests/codegen/hello_world.mips +++ b/tests/codegen/hello_world.mips @@ -1,10 +1,11 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:50 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:11 2020 # School of Math and Computer Science, University of Havana # .data +dummy: .word 0 IO: .asciiz "IO" # Function END Object: .asciiz "Object" @@ -21,7 +22,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +IO_vtable: .word function_out_int_at_IO, function_abort_at_Object, dummy, dummy, function_copy_at_Object, function_type_name_at_Object, function_in_int_at_IO, dummy, dummy, function_in_string_at_IO, function_out_string_at_IO # Function END # @@ -35,7 +36,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Object_vtable: .word dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy # Function END # @@ -49,7 +50,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word dummy, function_abort_at_Object, function_concat_at_String, function_substr_at_String, function_copy_at_Object, function_type_name_at_Object, dummy, dummy, function_length_at_String, dummy, dummy # Function END # @@ -63,7 +64,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Bool_vtable: .word dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy # Function END # @@ -77,7 +78,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Int_vtable: .word dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy # Function END # @@ -91,7 +92,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +Main_vtable: .word function_out_int_at_IO, function_abort_at_Object, dummy, dummy, function_copy_at_Object, function_type_name_at_Object, function_in_int_at_IO, function_main_at_Main, dummy, function_in_string_at_IO, function_out_string_at_IO # Function END # @@ -400,7 +401,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -723,7 +724,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips index 50424ab1..95001e53 100644 --- a/tests/codegen/io.mips +++ b/tests/codegen/io.mips @@ -1,10 +1,11 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:51 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:12 2020 # School of Math and Computer Science, University of Havana # .data +dummy: .word 0 IO: .asciiz "IO" # Function END Object: .asciiz "Object" @@ -29,7 +30,7 @@ D: .asciiz "D" # **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +IO_vtable: .word dummy, dummy, dummy, function_in_int_at_IO, function_out_int_at_IO, function_abort_at_Object, dummy, dummy, function_out_string_at_IO, dummy, function_in_string_at_IO, dummy, function_copy_at_Object, function_type_name_at_Object, dummy # Function END # @@ -43,7 +44,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Object_vtable: .word dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, function_type_name_at_Object, dummy # Function END # @@ -57,7 +58,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, function_length_at_String, dummy, dummy, dummy, dummy, function_concat_at_String, function_copy_at_Object, function_type_name_at_Object, function_substr_at_String # Function END # @@ -71,7 +72,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, function_type_name_at_Object, dummy # Function END # @@ -85,7 +86,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Int_vtable: .word dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, function_type_name_at_Object, dummy # Function END # @@ -99,7 +100,7 @@ Int_end: # **** VTABLE for type A **** -A_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A +A_vtable: .word function_out_a_at_A, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, function_type_name_at_Object, dummy # Function END # @@ -113,7 +114,7 @@ A_end: # **** VTABLE for type B **** -B_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_a_at_A, function_out_b_at_B +B_vtable: .word function_out_a_at_A, function_out_b_at_B, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, function_type_name_at_Object, dummy # Function END # @@ -127,7 +128,7 @@ B_end: # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +Main_vtable: .word dummy, dummy, dummy, function_in_int_at_IO, function_out_int_at_IO, function_abort_at_Object, dummy, function_main_at_Main, function_out_string_at_IO, dummy, function_in_string_at_IO, dummy, function_copy_at_Object, function_type_name_at_Object, dummy # Function END # @@ -141,7 +142,7 @@ Main_end: # **** VTABLE for type C **** -C_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_out_c_at_C +C_vtable: .word dummy, dummy, dummy, function_in_int_at_IO, function_out_int_at_IO, function_abort_at_Object, dummy, dummy, function_out_string_at_IO, function_out_c_at_C, function_in_string_at_IO, dummy, function_copy_at_Object, function_type_name_at_Object, dummy # Function END # @@ -155,7 +156,7 @@ C_end: # **** VTABLE for type D **** -D_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_out_c_at_C, function_out_d_at_D +D_vtable: .word dummy, dummy, function_out_d_at_D, function_in_int_at_IO, function_out_int_at_IO, function_abort_at_Object, dummy, dummy, function_out_string_at_IO, function_out_c_at_C, function_in_string_at_IO, dummy, function_copy_at_Object, function_type_name_at_Object, dummy # Function END # @@ -484,7 +485,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -867,7 +868,7 @@ function_out_a_at_A: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -941,7 +942,7 @@ function_out_b_at_B: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1033,7 +1034,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1104,7 +1105,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -1167,7 +1168,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -1230,7 +1231,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -1282,7 +1283,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -1355,7 +1356,7 @@ function_out_c_at_C: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1428,7 +1429,7 @@ function_out_d_at_D: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) diff --git a/tests/codegen/life.mips b/tests/codegen/life.mips new file mode 100644 index 00000000..1a72e65e --- /dev/null +++ b/tests/codegen/life.mips @@ -0,0 +1,21978 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:14 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +Board: .asciiz "Board" +# Function END +CellularAutomaton: .asciiz "CellularAutomaton" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_in_string_at_IO, function_in_int_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_out_string_at_IO, dummy, dummy, function_copy_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_concat_at_String, function_substr_at_String, dummy, function_abort_at_Object, dummy, function_length_at_String, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type Board **** +Board_vtable: .word function_in_string_at_IO, function_in_int_at_IO, dummy, function_size_of_board_at_Board, dummy, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_board_init_at_Board, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_out_string_at_IO, dummy, dummy, function_copy_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Board **** +Board_start: + Board_vtable_pointer: .word Board_vtable + # Function END +Board_end: +# + + +# **** VTABLE for type CellularAutomaton **** +CellularAutomaton_vtable: .word function_in_string_at_IO, function_in_int_at_IO, function_northeast_at_CellularAutomaton, function_size_of_board_at_Board, function_east_at_CellularAutomaton, function_num_cells_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_prompt_at_CellularAutomaton, function_out_int_at_IO, function_northwest_at_CellularAutomaton, function_southwest_at_CellularAutomaton, function_evolve_at_CellularAutomaton, function_print_at_CellularAutomaton, function_type_name_at_Object, dummy, function_board_init_at_Board, function_southeast_at_CellularAutomaton, dummy, dummy, function_west_at_CellularAutomaton, function_abort_at_Object, function_neighbors_at_CellularAutomaton, dummy, function_init_at_CellularAutomaton, function_option_at_CellularAutomaton, function_north_at_CellularAutomaton, function_out_string_at_IO, function_cell_at_CellularAutomaton, function_prompt2_at_CellularAutomaton, function_copy_at_Object, function_south_at_CellularAutomaton +# Function END +# + + +# **** Type RECORD for type CellularAutomaton **** +CellularAutomaton_start: + CellularAutomaton_vtable_pointer: .word CellularAutomaton_vtable + # Function END +CellularAutomaton_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_in_string_at_IO, function_in_int_at_IO, function_northeast_at_CellularAutomaton, function_size_of_board_at_Board, function_east_at_CellularAutomaton, function_num_cells_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_prompt_at_CellularAutomaton, function_out_int_at_IO, function_northwest_at_CellularAutomaton, function_southwest_at_CellularAutomaton, function_evolve_at_CellularAutomaton, function_print_at_CellularAutomaton, function_type_name_at_Object, function_main_at_Main, function_board_init_at_Board, function_southeast_at_CellularAutomaton, dummy, dummy, function_west_at_CellularAutomaton, function_abort_at_Object, function_neighbors_at_CellularAutomaton, dummy, function_init_at_CellularAutomaton, function_option_at_CellularAutomaton, function_north_at_CellularAutomaton, function_out_string_at_IO, function_cell_at_CellularAutomaton, function_prompt2_at_CellularAutomaton, function_copy_at_Object, function_south_at_CellularAutomaton +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, 1, 2, 3 +Object__TDT: .word 1, 0, 1, 1, 1, 2, 3, 4 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1 +Board__TDT: .word -1, -1, -1, -1, -1, 0, 1, 2 +CellularAutomaton__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "\n" +# + + +data_5: .asciiz "\n" +# + + +data_6: .asciiz "\n" +# + + +data_7: .asciiz " " +# + + +data_8: .asciiz " " +# + + +data_9: .asciiz " " +# + + +data_10: .asciiz " " +# + + +data_11: .asciiz " " +# + + +data_12: .asciiz " " +# + + +data_13: .asciiz " " +# + + +data_14: .asciiz " " +# + + +data_15: .asciiz " " +# + + +data_16: .asciiz " " +# + + +data_17: .asciiz " " +# + + +data_18: .asciiz " " +# + + +data_19: .asciiz " " +# + + +data_20: .asciiz " " +# + + +data_21: .asciiz "X" +# + + +data_22: .asciiz "X" +# + + +data_23: .asciiz "X" +# + + +data_24: .asciiz "X" +# + + +data_25: .asciiz "X" +# + + +data_26: .asciiz "X" +# + + +data_27: .asciiz "X" +# + + +data_28: .asciiz "X" +# + + +data_29: .asciiz "X" +# + + +data_30: .asciiz "X" +# + + +data_31: .asciiz "X" +# + + +data_32: .asciiz "-" +# + + +data_33: .asciiz "-" +# + + +data_34: .asciiz "\nPlease chose a number:\n" +# + + +data_35: .asciiz "\t1: A cross\n" +# + + +data_36: .asciiz "\t2: A slash from the upper left to lower right\n" +# + + +data_37: .asciiz "\t3: A slash from the upper right to lower left\n" +# + + +data_38: .asciiz "\t4: An X\n" +# + + +data_39: .asciiz "\t5: A greater than sign \n" +# + + +data_40: .asciiz "\t6: A less than sign\n" +# + + +data_41: .asciiz "\t7: Two greater than signs\n" +# + + +data_42: .asciiz "\t8: Two less than signs\n" +# + + +data_43: .asciiz "\t9: A 'V'\n" +# + + +data_44: .asciiz "\t10: An inverse 'V'\n" +# + + +data_45: .asciiz "\t11: Numbers 9 and 10 combined\n" +# + + +data_46: .asciiz "\t12: A full grid\n" +# + + +data_47: .asciiz "\t13: A 'T'\n" +# + + +data_48: .asciiz "\t14: A plus '+'\n" +# + + +data_49: .asciiz "\t15: A 'W'\n" +# + + +data_50: .asciiz "\t16: An 'M'\n" +# + + +data_51: .asciiz "\t17: An 'E'\n" +# + + +data_52: .asciiz "\t18: A '3'\n" +# + + +data_53: .asciiz "\t19: An 'O'\n" +# + + +data_54: .asciiz "\t20: An '8'\n" +# + + +data_55: .asciiz "\t21: An 'S'\n" +# + + +data_56: .asciiz "Your choice => " +# + + +data_57: .asciiz "\n" +# + + +data_58: .asciiz " XX XXXX XXXX XX " +# + + +data_59: .asciiz " X X X X X " +# + + +data_60: .asciiz "X X X X X" +# + + +data_61: .asciiz "X X X X X X X X X" +# + + +data_62: .asciiz "X X X X X " +# + + +data_63: .asciiz " X X X X X" +# + + +data_64: .asciiz "X X X XX X " +# + + +data_65: .asciiz " X XX X X X " +# + + +data_66: .asciiz "X X X X X " +# + + +data_67: .asciiz " X X X X X" +# + + +data_68: .asciiz "X X X X X X X X" +# + + +data_69: .asciiz "XXXXXXXXXXXXXXXXXXXXXXXXX" +# + + +data_70: .asciiz "XXXXX X X X X " +# + + +data_71: .asciiz " X X XXXXX X X " +# + + +data_72: .asciiz "X X X X X X X " +# + + +data_73: .asciiz " X X X X X X X" +# + + +data_74: .asciiz "XXXXX X XXXXX X XXXX" +# + + +data_75: .asciiz "XXX X X X X XXXX " +# + + +data_76: .asciiz " XX X XX X XX " +# + + +data_77: .asciiz " XX X XX X XX X XX X XX " +# + + +data_78: .asciiz " XXXX X XX X XXXX " +# + + +data_79: .asciiz " " +# + + +data_80: .asciiz "Would you like to continue with the next generation? \n" +# + + +data_81: .asciiz "Please use lowercase y or n for your answer [y]: " +# + + +data_82: .asciiz "\n" +# + + +data_83: .asciiz "n" +# + + +data_84: .asciiz "\n\n" +# + + +data_85: .asciiz "Would you like to choose a background pattern? \n" +# + + +data_86: .asciiz "Please use lowercase y or n for your answer [n]: " +# + + +data_87: .asciiz "y" +# + + +data_88: .asciiz "Welcome to the Game of Life.\n" +# + + +data_89: .asciiz "There are many initial states to choose from. \n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 32 bytes of memory + li $a0, 32 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 28 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Board__attrib__rows__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Board__attrib__columns__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Board__attrib__board_size__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __CellularAutomaton__attrib__population_map__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__cells__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 56($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Board__attrib__rows__init implementation. +# @Params: +__Board__attrib__rows__init: + # Allocate stack frame for function __Board__attrib__rows__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_attrib__rows__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_attrib__rows__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Board__attrib__rows__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Board__attrib__columns__init implementation. +# @Params: +__Board__attrib__columns__init: + # Allocate stack frame for function __Board__attrib__columns__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_attrib__columns__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_attrib__columns__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Board__attrib__columns__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Board__attrib__board_size__init implementation. +# @Params: +__Board__attrib__board_size__init: + # Allocate stack frame for function __Board__attrib__board_size__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_attrib__board_size__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_attrib__board_size__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Board__attrib__board_size__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_size_of_board_at_Board implementation. +# @Params: +# 0($fp) = param_size_of_board_at_Board_initial_0 +function_size_of_board_at_Board: + # Allocate stack frame for function function_size_of_board_at_Board. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_size_of_board_at_Board_internal_0 --> -4($fp) + # PARAM param_size_of_board_at_Board_initial_0 --> 0($fp) + # local_size_of_board_at_Board_internal_0 = PARAM param_size_of_board_at_Board_initial_0 + lw $t0, 0($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_size_of_board_at_Board_internal_0 --> -4($fp) + # LOCAL local_size_of_board_at_Board_internal_1 --> -8($fp) + # local_size_of_board_at_Board_internal_1 = VCALL local_size_of_board_at_Board_internal_0 length + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 88($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_size_of_board_at_Board_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_size_of_board_at_Board. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_board_init_at_Board implementation. +# @Params: +# 0($fp) = param_board_init_at_Board_start_0 +function_board_init_at_Board: + # Allocate stack frame for function function_board_init_at_Board. + subu $sp, $sp, 204 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 204 + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_board_init_at_Board_internal_3 --> -16($fp) + # local_board_init_at_Board_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_board_init_at_Board_internal_1 --> -8($fp) + # LOCAL local_board_init_at_Board_internal_3 --> -16($fp) + # local_board_init_at_Board_internal_1 = local_board_init_at_Board_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_board_init_at_Board_start_0 + # PARAM param_board_init_at_Board_start_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_board_init_at_Board_internal_1 --> -8($fp) + # LOCAL local_board_init_at_Board_internal_2 --> -12($fp) + # local_board_init_at_Board_internal_2 = VCALL local_board_init_at_Board_internal_1 size_of_board + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_2 --> -12($fp) + # local_board_init_at_Board_size_0 = local_board_init_at_Board_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # LOCAL local_board_init_at_Board_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 15 + sw $t0, 12($v0) + sw $v0, -36($fp) + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_3 + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_3 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_3 + # IF_ZERO local_board_init_at_Board_internal_8 GOTO label_FALSE_3 + # IF_ZERO local_board_init_at_Board_internal_8 GOTO label_FALSE_3 + lw $t0, -36($fp) + beq $t0, 0, label_FALSE_3 + # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -32($fp) + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_COMPARE_STRING_6 + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_COMPARE_STRING_6 + lw $t0, -32($fp) + beq $t0, 0, label_COMPARE_STRING_6 + # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -32($fp) + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_COMPARE_BY_VALUE_7 + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_COMPARE_BY_VALUE_7 + lw $t0, -32($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_7 + # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -32($fp) + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_COMPARE_BY_VALUE_7 + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_COMPARE_BY_VALUE_7 + lw $t0, -32($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_7 + # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_8 --> -36($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -36($fp) + sub $a0, $a0, $a1 + sw $a0, -32($fp) + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_4 + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_4 + lw $t0, -32($fp) + beq $t0, 0, label_TRUE_4 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_COMPARE_BY_VALUE_7: + # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_8 --> -36($fp) + lw $a0, -4($fp) + lw $a1, -36($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -32($fp) + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_4 + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_4 + lw $t0, -32($fp) + beq $t0, 0, label_TRUE_4 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_COMPARE_STRING_6: + # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_8 --> -36($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -36($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -32($fp) + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_CONTINUE_8 + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_CONTINUE_8 + lw $t0, -32($fp) + beq $t0, 0, label_CONTINUE_8 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_CONTINUE_8: + # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_8 --> -36($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -36($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_9: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_10 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_9 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_10: + # Store result + sw $a2, -32($fp) + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_4 + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_4 + lw $t0, -32($fp) + beq $t0, 0, label_TRUE_4 + label_FALSE_3: + # LOCAL local_board_init_at_Board_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # GOTO label_END_5 +j label_END_5 +label_TRUE_4: + # LOCAL local_board_init_at_Board_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -28($fp) + label_END_5: +# LOCAL local_board_init_at_Board_internal_4 --> -20($fp) +# LOCAL local_board_init_at_Board_internal_6 --> -28($fp) +# Obtain value from -28($fp) +lw $v0, -28($fp) +lw $v0, 12($v0) +sw $v0, -20($fp) +# IF_ZERO local_board_init_at_Board_internal_4 GOTO label_FALSEIF_1 +# IF_ZERO local_board_init_at_Board_internal_4 GOTO label_FALSEIF_1 +lw $t0, -20($fp) +beq $t0, 0, label_FALSEIF_1 +# LOCAL local_board_init_at_Board_internal_9 --> -40($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 3 +sw $t0, 12($v0) +sw $v0, -40($fp) +# +# LOCAL local_board_init_at_Board_internal_9 --> -40($fp) +lw $t0, -40($fp) +sw $t0, 12($s1) +# LOCAL local_board_init_at_Board_internal_10 --> -44($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 5 +sw $t0, 12($v0) +sw $v0, -44($fp) +# +# LOCAL local_board_init_at_Board_internal_10 --> -44($fp) +lw $t0, -44($fp) +sw $t0, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t0, -4($fp) +sw $t0, 20($s1) +# LOCAL local_board_init_at_Board_internal_5 --> -24($fp) +# local_board_init_at_Board_internal_5 = +# GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 16 + sw $t0, 12($v0) + sw $v0, -64($fp) + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_13 + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_13 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_13 + # IF_ZERO local_board_init_at_Board_internal_15 GOTO label_FALSE_13 + # IF_ZERO local_board_init_at_Board_internal_15 GOTO label_FALSE_13 + lw $t0, -64($fp) + beq $t0, 0, label_FALSE_13 + # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -60($fp) + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_COMPARE_STRING_16 + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_COMPARE_STRING_16 + lw $t0, -60($fp) + beq $t0, 0, label_COMPARE_STRING_16 + # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -60($fp) + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_COMPARE_BY_VALUE_17 + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_COMPARE_BY_VALUE_17 + lw $t0, -60($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_17 + # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -60($fp) + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_COMPARE_BY_VALUE_17 + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_COMPARE_BY_VALUE_17 + lw $t0, -60($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_17 + # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -64($fp) + sub $a0, $a0, $a1 + sw $a0, -60($fp) + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_TRUE_14 + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_TRUE_14 + lw $t0, -60($fp) + beq $t0, 0, label_TRUE_14 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_COMPARE_BY_VALUE_17: + # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) + lw $a0, -4($fp) + lw $a1, -64($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -60($fp) + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_TRUE_14 + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_TRUE_14 + lw $t0, -60($fp) + beq $t0, 0, label_TRUE_14 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_COMPARE_STRING_16: + # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -64($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -60($fp) + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_CONTINUE_18 + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_CONTINUE_18 + lw $t0, -60($fp) + beq $t0, 0, label_CONTINUE_18 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_CONTINUE_18: + # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -64($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_19: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_20 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_19 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_20: + # Store result + sw $a2, -60($fp) + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_TRUE_14 + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_TRUE_14 + lw $t0, -60($fp) + beq $t0, 0, label_TRUE_14 + label_FALSE_13: + # LOCAL local_board_init_at_Board_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -56($fp) + # GOTO label_END_15 +j label_END_15 +label_TRUE_14: + # LOCAL local_board_init_at_Board_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -56($fp) + label_END_15: +# LOCAL local_board_init_at_Board_internal_11 --> -48($fp) +# LOCAL local_board_init_at_Board_internal_13 --> -56($fp) +# Obtain value from -56($fp) +lw $v0, -56($fp) +lw $v0, 12($v0) +sw $v0, -48($fp) +# IF_ZERO local_board_init_at_Board_internal_11 GOTO label_FALSEIF_11 +# IF_ZERO local_board_init_at_Board_internal_11 GOTO label_FALSEIF_11 +lw $t0, -48($fp) +beq $t0, 0, label_FALSEIF_11 +# LOCAL local_board_init_at_Board_internal_16 --> -68($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 4 +sw $t0, 12($v0) +sw $v0, -68($fp) +# +# LOCAL local_board_init_at_Board_internal_16 --> -68($fp) +lw $t0, -68($fp) +sw $t0, 12($s1) +# LOCAL local_board_init_at_Board_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 4 +sw $t0, 12($v0) +sw $v0, -72($fp) +# +# LOCAL local_board_init_at_Board_internal_17 --> -72($fp) +lw $t0, -72($fp) +sw $t0, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t0, -4($fp) +sw $t0, 20($s1) +# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) +# local_board_init_at_Board_internal_12 = +# GOTO label_ENDIF_12 +j label_ENDIF_12 +label_FALSEIF_11: + # LOCAL local_board_init_at_Board_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 20 + sw $t0, 12($v0) + sw $v0, -92($fp) + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_23 + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_23 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_23 + # IF_ZERO local_board_init_at_Board_internal_22 GOTO label_FALSE_23 + # IF_ZERO local_board_init_at_Board_internal_22 GOTO label_FALSE_23 + lw $t0, -92($fp) + beq $t0, 0, label_FALSE_23 + # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_COMPARE_STRING_26 + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_COMPARE_STRING_26 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_STRING_26 + # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_COMPARE_BY_VALUE_27 + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_COMPARE_BY_VALUE_27 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_27 + # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_COMPARE_BY_VALUE_27 + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_COMPARE_BY_VALUE_27 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_27 + # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_22 --> -92($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -92($fp) + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_TRUE_24 + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_TRUE_24 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_24 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_COMPARE_BY_VALUE_27: + # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_22 --> -92($fp) + lw $a0, -4($fp) + lw $a1, -92($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_TRUE_24 + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_TRUE_24 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_24 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_COMPARE_STRING_26: + # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_22 --> -92($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -92($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -88($fp) + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_CONTINUE_28 + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_CONTINUE_28 + lw $t0, -88($fp) + beq $t0, 0, label_CONTINUE_28 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_CONTINUE_28: + # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_22 --> -92($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -92($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_29: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_30 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_29 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_30: + # Store result + sw $a2, -88($fp) + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_TRUE_24 + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_TRUE_24 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_24 + label_FALSE_23: + # LOCAL local_board_init_at_Board_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -84($fp) + # GOTO label_END_25 +j label_END_25 +label_TRUE_24: + # LOCAL local_board_init_at_Board_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -84($fp) + label_END_25: +# LOCAL local_board_init_at_Board_internal_18 --> -76($fp) +# LOCAL local_board_init_at_Board_internal_20 --> -84($fp) +# Obtain value from -84($fp) +lw $v0, -84($fp) +lw $v0, 12($v0) +sw $v0, -76($fp) +# IF_ZERO local_board_init_at_Board_internal_18 GOTO label_FALSEIF_21 +# IF_ZERO local_board_init_at_Board_internal_18 GOTO label_FALSEIF_21 +lw $t0, -76($fp) +beq $t0, 0, label_FALSEIF_21 +# LOCAL local_board_init_at_Board_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 4 +sw $t0, 12($v0) +sw $v0, -96($fp) +# +# LOCAL local_board_init_at_Board_internal_23 --> -96($fp) +lw $t0, -96($fp) +sw $t0, 12($s1) +# LOCAL local_board_init_at_Board_internal_24 --> -100($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 5 +sw $t0, 12($v0) +sw $v0, -100($fp) +# +# LOCAL local_board_init_at_Board_internal_24 --> -100($fp) +lw $t0, -100($fp) +sw $t0, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t0, -4($fp) +sw $t0, 20($s1) +# LOCAL local_board_init_at_Board_internal_19 --> -80($fp) +# local_board_init_at_Board_internal_19 = +# GOTO label_ENDIF_22 +j label_ENDIF_22 +label_FALSEIF_21: + # LOCAL local_board_init_at_Board_internal_29 --> -120($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 21 + sw $t0, 12($v0) + sw $v0, -120($fp) + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_33 + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_33 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_33 + # IF_ZERO local_board_init_at_Board_internal_29 GOTO label_FALSE_33 + # IF_ZERO local_board_init_at_Board_internal_29 GOTO label_FALSE_33 + lw $t0, -120($fp) + beq $t0, 0, label_FALSE_33 + # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -116($fp) + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_COMPARE_STRING_36 + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_COMPARE_STRING_36 + lw $t0, -116($fp) + beq $t0, 0, label_COMPARE_STRING_36 + # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -116($fp) + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_COMPARE_BY_VALUE_37 + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_COMPARE_BY_VALUE_37 + lw $t0, -116($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_37 + # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -116($fp) + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_COMPARE_BY_VALUE_37 + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_COMPARE_BY_VALUE_37 + lw $t0, -116($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_37 + # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_29 --> -120($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -120($fp) + sub $a0, $a0, $a1 + sw $a0, -116($fp) + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_TRUE_34 + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_TRUE_34 + lw $t0, -116($fp) + beq $t0, 0, label_TRUE_34 + # GOTO label_FALSE_33 + j label_FALSE_33 + label_COMPARE_BY_VALUE_37: + # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_29 --> -120($fp) + lw $a0, -4($fp) + lw $a1, -120($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -116($fp) + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_TRUE_34 + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_TRUE_34 + lw $t0, -116($fp) + beq $t0, 0, label_TRUE_34 + # GOTO label_FALSE_33 + j label_FALSE_33 + label_COMPARE_STRING_36: + # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_29 --> -120($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -120($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -116($fp) + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_CONTINUE_38 + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_CONTINUE_38 + lw $t0, -116($fp) + beq $t0, 0, label_CONTINUE_38 + # GOTO label_FALSE_33 + j label_FALSE_33 + label_CONTINUE_38: + # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_29 --> -120($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -120($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_39: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_40 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_39 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_40: + # Store result + sw $a2, -116($fp) + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_TRUE_34 + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_TRUE_34 + lw $t0, -116($fp) + beq $t0, 0, label_TRUE_34 + label_FALSE_33: + # LOCAL local_board_init_at_Board_internal_27 --> -112($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -112($fp) + # GOTO label_END_35 +j label_END_35 +label_TRUE_34: + # LOCAL local_board_init_at_Board_internal_27 --> -112($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -112($fp) + label_END_35: +# LOCAL local_board_init_at_Board_internal_25 --> -104($fp) +# LOCAL local_board_init_at_Board_internal_27 --> -112($fp) +# Obtain value from -112($fp) +lw $v0, -112($fp) +lw $v0, 12($v0) +sw $v0, -104($fp) +# IF_ZERO local_board_init_at_Board_internal_25 GOTO label_FALSEIF_31 +# IF_ZERO local_board_init_at_Board_internal_25 GOTO label_FALSEIF_31 +lw $t0, -104($fp) +beq $t0, 0, label_FALSEIF_31 +# LOCAL local_board_init_at_Board_internal_30 --> -124($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 3 +sw $t0, 12($v0) +sw $v0, -124($fp) +# +# LOCAL local_board_init_at_Board_internal_30 --> -124($fp) +lw $t0, -124($fp) +sw $t0, 12($s1) +# LOCAL local_board_init_at_Board_internal_31 --> -128($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 7 +sw $t0, 12($v0) +sw $v0, -128($fp) +# +# LOCAL local_board_init_at_Board_internal_31 --> -128($fp) +lw $t0, -128($fp) +sw $t0, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t0, -4($fp) +sw $t0, 20($s1) +# LOCAL local_board_init_at_Board_internal_26 --> -108($fp) +# local_board_init_at_Board_internal_26 = +# GOTO label_ENDIF_32 +j label_ENDIF_32 +label_FALSEIF_31: + # LOCAL local_board_init_at_Board_internal_36 --> -148($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 25 + sw $t0, 12($v0) + sw $v0, -148($fp) + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_43 + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_43 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_43 + # IF_ZERO local_board_init_at_Board_internal_36 GOTO label_FALSE_43 + # IF_ZERO local_board_init_at_Board_internal_36 GOTO label_FALSE_43 + lw $t0, -148($fp) + beq $t0, 0, label_FALSE_43 + # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -144($fp) + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_COMPARE_STRING_46 + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_COMPARE_STRING_46 + lw $t0, -144($fp) + beq $t0, 0, label_COMPARE_STRING_46 + # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -144($fp) + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_COMPARE_BY_VALUE_47 + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_COMPARE_BY_VALUE_47 + lw $t0, -144($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_47 + # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -144($fp) + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_COMPARE_BY_VALUE_47 + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_COMPARE_BY_VALUE_47 + lw $t0, -144($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_47 + # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_36 --> -148($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -148($fp) + sub $a0, $a0, $a1 + sw $a0, -144($fp) + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_TRUE_44 + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_TRUE_44 + lw $t0, -144($fp) + beq $t0, 0, label_TRUE_44 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_COMPARE_BY_VALUE_47: + # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_36 --> -148($fp) + lw $a0, -4($fp) + lw $a1, -148($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -144($fp) + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_TRUE_44 + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_TRUE_44 + lw $t0, -144($fp) + beq $t0, 0, label_TRUE_44 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_COMPARE_STRING_46: + # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_36 --> -148($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -148($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -144($fp) + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_CONTINUE_48 + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_CONTINUE_48 + lw $t0, -144($fp) + beq $t0, 0, label_CONTINUE_48 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_CONTINUE_48: + # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_36 --> -148($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -148($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_49: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_50 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_49 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_50: + # Store result + sw $a2, -144($fp) + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_TRUE_44 + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_TRUE_44 + lw $t0, -144($fp) + beq $t0, 0, label_TRUE_44 + label_FALSE_43: + # LOCAL local_board_init_at_Board_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -140($fp) + # GOTO label_END_45 +j label_END_45 +label_TRUE_44: + # LOCAL local_board_init_at_Board_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -140($fp) + label_END_45: +# LOCAL local_board_init_at_Board_internal_32 --> -132($fp) +# LOCAL local_board_init_at_Board_internal_34 --> -140($fp) +# Obtain value from -140($fp) +lw $v0, -140($fp) +lw $v0, 12($v0) +sw $v0, -132($fp) +# IF_ZERO local_board_init_at_Board_internal_32 GOTO label_FALSEIF_41 +# IF_ZERO local_board_init_at_Board_internal_32 GOTO label_FALSEIF_41 +lw $t0, -132($fp) +beq $t0, 0, label_FALSEIF_41 +# LOCAL local_board_init_at_Board_internal_37 --> -152($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 5 +sw $t0, 12($v0) +sw $v0, -152($fp) +# +# LOCAL local_board_init_at_Board_internal_37 --> -152($fp) +lw $t0, -152($fp) +sw $t0, 12($s1) +# LOCAL local_board_init_at_Board_internal_38 --> -156($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 5 +sw $t0, 12($v0) +sw $v0, -156($fp) +# +# LOCAL local_board_init_at_Board_internal_38 --> -156($fp) +lw $t0, -156($fp) +sw $t0, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t0, -4($fp) +sw $t0, 20($s1) +# LOCAL local_board_init_at_Board_internal_33 --> -136($fp) +# local_board_init_at_Board_internal_33 = +# GOTO label_ENDIF_42 +j label_ENDIF_42 +label_FALSEIF_41: + # LOCAL local_board_init_at_Board_internal_43 --> -176($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 28 + sw $t0, 12($v0) + sw $v0, -176($fp) + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_53 + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_53 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_53 + # IF_ZERO local_board_init_at_Board_internal_43 GOTO label_FALSE_53 + # IF_ZERO local_board_init_at_Board_internal_43 GOTO label_FALSE_53 + lw $t0, -176($fp) + beq $t0, 0, label_FALSE_53 + # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -172($fp) + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_COMPARE_STRING_56 + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_COMPARE_STRING_56 + lw $t0, -172($fp) + beq $t0, 0, label_COMPARE_STRING_56 + # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -172($fp) + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_COMPARE_BY_VALUE_57 + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_COMPARE_BY_VALUE_57 + lw $t0, -172($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_57 + # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -172($fp) + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_COMPARE_BY_VALUE_57 + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_COMPARE_BY_VALUE_57 + lw $t0, -172($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_57 + # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_43 --> -176($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -176($fp) + sub $a0, $a0, $a1 + sw $a0, -172($fp) + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_TRUE_54 + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_TRUE_54 + lw $t0, -172($fp) + beq $t0, 0, label_TRUE_54 + # GOTO label_FALSE_53 + j label_FALSE_53 + label_COMPARE_BY_VALUE_57: + # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_43 --> -176($fp) + lw $a0, -4($fp) + lw $a1, -176($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -172($fp) + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_TRUE_54 + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_TRUE_54 + lw $t0, -172($fp) + beq $t0, 0, label_TRUE_54 + # GOTO label_FALSE_53 + j label_FALSE_53 + label_COMPARE_STRING_56: + # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_43 --> -176($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -176($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -172($fp) + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_CONTINUE_58 + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_CONTINUE_58 + lw $t0, -172($fp) + beq $t0, 0, label_CONTINUE_58 + # GOTO label_FALSE_53 + j label_FALSE_53 + label_CONTINUE_58: + # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_43 --> -176($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -176($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_59: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_60 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_59 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_60: + # Store result + sw $a2, -172($fp) + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_TRUE_54 + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_TRUE_54 + lw $t0, -172($fp) + beq $t0, 0, label_TRUE_54 + label_FALSE_53: + # LOCAL local_board_init_at_Board_internal_41 --> -168($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -168($fp) + # GOTO label_END_55 +j label_END_55 +label_TRUE_54: + # LOCAL local_board_init_at_Board_internal_41 --> -168($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -168($fp) + label_END_55: +# LOCAL local_board_init_at_Board_internal_39 --> -160($fp) +# LOCAL local_board_init_at_Board_internal_41 --> -168($fp) +# Obtain value from -168($fp) +lw $v0, -168($fp) +lw $v0, 12($v0) +sw $v0, -160($fp) +# IF_ZERO local_board_init_at_Board_internal_39 GOTO label_FALSEIF_51 +# IF_ZERO local_board_init_at_Board_internal_39 GOTO label_FALSEIF_51 +lw $t0, -160($fp) +beq $t0, 0, label_FALSEIF_51 +# LOCAL local_board_init_at_Board_internal_44 --> -180($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 7 +sw $t0, 12($v0) +sw $v0, -180($fp) +# +# LOCAL local_board_init_at_Board_internal_44 --> -180($fp) +lw $t0, -180($fp) +sw $t0, 12($s1) +# LOCAL local_board_init_at_Board_internal_45 --> -184($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 4 +sw $t0, 12($v0) +sw $v0, -184($fp) +# +# LOCAL local_board_init_at_Board_internal_45 --> -184($fp) +lw $t0, -184($fp) +sw $t0, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t0, -4($fp) +sw $t0, 20($s1) +# LOCAL local_board_init_at_Board_internal_40 --> -164($fp) +# local_board_init_at_Board_internal_40 = +# GOTO label_ENDIF_52 +j label_ENDIF_52 +label_FALSEIF_51: + # LOCAL local_board_init_at_Board_internal_46 --> -188($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 5 + sw $t0, 12($v0) + sw $v0, -188($fp) + # + # LOCAL local_board_init_at_Board_internal_46 --> -188($fp) + lw $t0, -188($fp) + sw $t0, 12($s1) + # LOCAL local_board_init_at_Board_internal_47 --> -192($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 5 + sw $t0, 12($v0) + sw $v0, -192($fp) + # + # LOCAL local_board_init_at_Board_internal_47 --> -192($fp) + lw $t0, -192($fp) + sw $t0, 16($s1) + # + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + lw $t0, -4($fp) + sw $t0, 20($s1) + # LOCAL local_board_init_at_Board_internal_40 --> -164($fp) + # local_board_init_at_Board_internal_40 = + label_ENDIF_52: +# LOCAL local_board_init_at_Board_internal_33 --> -136($fp) +# LOCAL local_board_init_at_Board_internal_40 --> -164($fp) +# local_board_init_at_Board_internal_33 = local_board_init_at_Board_internal_40 +lw $t0, -164($fp) +sw $t0, -136($fp) +label_ENDIF_42: +# LOCAL local_board_init_at_Board_internal_26 --> -108($fp) +# LOCAL local_board_init_at_Board_internal_33 --> -136($fp) +# local_board_init_at_Board_internal_26 = local_board_init_at_Board_internal_33 +lw $t0, -136($fp) +sw $t0, -108($fp) +label_ENDIF_32: +# LOCAL local_board_init_at_Board_internal_19 --> -80($fp) +# LOCAL local_board_init_at_Board_internal_26 --> -108($fp) +# local_board_init_at_Board_internal_19 = local_board_init_at_Board_internal_26 +lw $t0, -108($fp) +sw $t0, -80($fp) +label_ENDIF_22: +# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) +# LOCAL local_board_init_at_Board_internal_19 --> -80($fp) +# local_board_init_at_Board_internal_12 = local_board_init_at_Board_internal_19 +lw $t0, -80($fp) +sw $t0, -52($fp) +label_ENDIF_12: +# LOCAL local_board_init_at_Board_internal_5 --> -24($fp) +# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) +# local_board_init_at_Board_internal_5 = local_board_init_at_Board_internal_12 +lw $t0, -52($fp) +sw $t0, -24($fp) +label_ENDIF_2: +# LOCAL local_board_init_at_Board_internal_48 --> -196($fp) +# local_board_init_at_Board_internal_48 = SELF +sw $s1, -196($fp) +# RETURN local_board_init_at_Board_internal_48 +lw $v0, -196($fp) +# Deallocate stack frame for function function_board_init_at_Board. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 204 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# __CellularAutomaton__attrib__population_map__init implementation. +# @Params: +__CellularAutomaton__attrib__population_map__init: + # Allocate stack frame for function __CellularAutomaton__attrib__population_map__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_rAutomaton__attrib__population_map__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -4($fp) + # RETURN local_rAutomaton__attrib__population_map__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __CellularAutomaton__attrib__population_map__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_init_at_CellularAutomaton_map_0 +function_init_at_CellularAutomaton: + # Allocate stack frame for function function_init_at_CellularAutomaton. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_CellularAutomaton_map_0 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 24($s1) + # LOCAL local_init_at_CellularAutomaton_internal_2 --> -12($fp) + # local_init_at_CellularAutomaton_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_init_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_init_at_CellularAutomaton_internal_2 --> -12($fp) + # local_init_at_CellularAutomaton_internal_0 = local_init_at_CellularAutomaton_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_init_at_CellularAutomaton_map_0 + # PARAM param_init_at_CellularAutomaton_map_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_init_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_init_at_CellularAutomaton_internal_1 --> -8($fp) + # local_init_at_CellularAutomaton_internal_1 = VCALL local_init_at_CellularAutomaton_internal_0 board_init + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 60($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_init_at_CellularAutomaton_internal_3 --> -16($fp) + # local_init_at_CellularAutomaton_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_init_at_CellularAutomaton_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_init_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_at_CellularAutomaton implementation. +# @Params: +function_print_at_CellularAutomaton: + # Allocate stack frame for function function_print_at_CellularAutomaton. + subu $sp, $sp, 120 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 120 + # LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_print_at_CellularAutomaton_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) + # LOCAL local_print_at_CellularAutomaton_internal_1 --> -8($fp) + # local_print_at_CellularAutomaton_i_0 = local_print_at_CellularAutomaton_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_print_at_CellularAutomaton_num_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # local_print_at_CellularAutomaton_internal_3 = GETATTRIBUTE board_size CellularAutomaton + # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) + lw $t0, 20($s1) + sw $t0, -16($fp) + # LOCAL local_print_at_CellularAutomaton_num_2 --> -12($fp) + # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) + # local_print_at_CellularAutomaton_num_2 = local_print_at_CellularAutomaton_internal_3 + lw $t0, -16($fp) + sw $t0, -12($fp) + # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) + # local_print_at_CellularAutomaton_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_print_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) + # local_print_at_CellularAutomaton_internal_4 = local_print_at_CellularAutomaton_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -32($fp) + # ARG local_print_at_CellularAutomaton_internal_7 + # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) + lw $t0, -32($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) + # local_print_at_CellularAutomaton_internal_5 = VCALL local_print_at_CellularAutomaton_internal_4 out_string + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_WHILE_61: + # LOCAL local_print_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) + # LOCAL local_print_at_CellularAutomaton_num_2 --> -12($fp) + lw $a0, -4($fp) + lw $a1, -12($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_GREATER_ZERO local_print_at_CellularAutomaton_internal_9 GOTO label_FALSE_63 + # IF_GREATER_ZERO local_print_at_CellularAutomaton_internal_9 GOTO label_FALSE_63 + lw $t0, -40($fp) + bgt $t0, 0, label_FALSE_63 + # IF_ZERO local_print_at_CellularAutomaton_internal_9 GOTO label_FALSE_63 + # IF_ZERO local_print_at_CellularAutomaton_internal_9 GOTO label_FALSE_63 + lw $t0, -40($fp) + beq $t0, 0, label_FALSE_63 + # LOCAL local_print_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -40($fp) + # GOTO label_END_64 +j label_END_64 +label_FALSE_63: + # LOCAL local_print_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -40($fp) + label_END_64: +# LOCAL local_print_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_print_at_CellularAutomaton_internal_9 --> -40($fp) +# Obtain value from -40($fp) +lw $v0, -40($fp) +lw $v0, 12($v0) +sw $v0, -36($fp) +# IF_ZERO local_print_at_CellularAutomaton_internal_8 GOTO label_WHILE_END_62 +# IF_ZERO local_print_at_CellularAutomaton_internal_8 GOTO label_WHILE_END_62 +lw $t0, -36($fp) +beq $t0, 0, label_WHILE_END_62 +# LOCAL local_print_at_CellularAutomaton_internal_12 --> -52($fp) +# local_print_at_CellularAutomaton_internal_12 = SELF +sw $s1, -52($fp) +# LOCAL local_print_at_CellularAutomaton_internal_10 --> -44($fp) +# LOCAL local_print_at_CellularAutomaton_internal_12 --> -52($fp) +# local_print_at_CellularAutomaton_internal_10 = local_print_at_CellularAutomaton_internal_12 +lw $t0, -52($fp) +sw $t0, -44($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_print_at_CellularAutomaton_internal_15 = GETATTRIBUTE population_map CellularAutomaton +# LOCAL local_print_at_CellularAutomaton_internal_15 --> -64($fp) +lw $t0, 24($s1) +sw $t0, -64($fp) +# LOCAL local_print_at_CellularAutomaton_internal_13 --> -56($fp) +# LOCAL local_print_at_CellularAutomaton_internal_15 --> -64($fp) +# local_print_at_CellularAutomaton_internal_13 = local_print_at_CellularAutomaton_internal_15 +lw $t0, -64($fp) +sw $t0, -56($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_print_at_CellularAutomaton_i_0 +# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) +lw $t0, -4($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# local_print_at_CellularAutomaton_internal_16 = GETATTRIBUTE columns CellularAutomaton +# LOCAL local_print_at_CellularAutomaton_internal_16 --> -68($fp) +lw $t0, 16($s1) +sw $t0, -68($fp) +# ARG local_print_at_CellularAutomaton_internal_16 +# LOCAL local_print_at_CellularAutomaton_internal_16 --> -68($fp) +lw $t0, -68($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_print_at_CellularAutomaton_internal_13 --> -56($fp) +# LOCAL local_print_at_CellularAutomaton_internal_14 --> -60($fp) +# local_print_at_CellularAutomaton_internal_14 = VCALL local_print_at_CellularAutomaton_internal_13 substr +# Save new self pointer in $s1 +lw $s1, -56($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 72($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -60($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_print_at_CellularAutomaton_internal_14 +# LOCAL local_print_at_CellularAutomaton_internal_14 --> -60($fp) +lw $t0, -60($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_print_at_CellularAutomaton_internal_10 --> -44($fp) +# LOCAL local_print_at_CellularAutomaton_internal_11 --> -48($fp) +# local_print_at_CellularAutomaton_internal_11 = VCALL local_print_at_CellularAutomaton_internal_10 out_string +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 104($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_print_at_CellularAutomaton_internal_19 --> -80($fp) +# local_print_at_CellularAutomaton_internal_19 = SELF +sw $s1, -80($fp) +# LOCAL local_print_at_CellularAutomaton_internal_17 --> -72($fp) +# LOCAL local_print_at_CellularAutomaton_internal_19 --> -80($fp) +# local_print_at_CellularAutomaton_internal_17 = local_print_at_CellularAutomaton_internal_19 +lw $t0, -80($fp) +sw $t0, -72($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_print_at_CellularAutomaton_internal_20 --> -84($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_5 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -84($fp) +# ARG local_print_at_CellularAutomaton_internal_20 +# LOCAL local_print_at_CellularAutomaton_internal_20 --> -84($fp) +lw $t0, -84($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_print_at_CellularAutomaton_internal_17 --> -72($fp) +# LOCAL local_print_at_CellularAutomaton_internal_18 --> -76($fp) +# local_print_at_CellularAutomaton_internal_18 = VCALL local_print_at_CellularAutomaton_internal_17 out_string +# Save new self pointer in $s1 +lw $s1, -72($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 104($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -76($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# local_print_at_CellularAutomaton_internal_22 = GETATTRIBUTE columns CellularAutomaton +# LOCAL local_print_at_CellularAutomaton_internal_22 --> -92($fp) +lw $t0, 16($s1) +sw $t0, -92($fp) +# LOCAL local_print_at_CellularAutomaton_internal_21 --> -88($fp) +# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) +# LOCAL local_print_at_CellularAutomaton_internal_22 --> -92($fp) +# local_print_at_CellularAutomaton_internal_21 = local_print_at_CellularAutomaton_i_0 + local_print_at_CellularAutomaton_internal_22 +lw $t1, -4($fp) +lw $t0, 12($t1) +lw $t1, -92($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -88($fp) +# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) +# LOCAL local_print_at_CellularAutomaton_internal_21 --> -88($fp) +# local_print_at_CellularAutomaton_i_0 = local_print_at_CellularAutomaton_internal_21 +lw $t0, -88($fp) +sw $t0, -4($fp) +# GOTO label_WHILE_61 +j label_WHILE_61 +label_WHILE_END_62: + # LOCAL local_print_at_CellularAutomaton_internal_25 --> -104($fp) + # local_print_at_CellularAutomaton_internal_25 = SELF + sw $s1, -104($fp) + # LOCAL local_print_at_CellularAutomaton_internal_23 --> -96($fp) + # LOCAL local_print_at_CellularAutomaton_internal_25 --> -104($fp) + # local_print_at_CellularAutomaton_internal_23 = local_print_at_CellularAutomaton_internal_25 + lw $t0, -104($fp) + sw $t0, -96($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_6 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -108($fp) + # ARG local_print_at_CellularAutomaton_internal_26 + # LOCAL local_print_at_CellularAutomaton_internal_26 --> -108($fp) + lw $t0, -108($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_23 --> -96($fp) + # LOCAL local_print_at_CellularAutomaton_internal_24 --> -100($fp) + # local_print_at_CellularAutomaton_internal_24 = VCALL local_print_at_CellularAutomaton_internal_23 out_string + # Save new self pointer in $s1 + lw $s1, -96($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -100($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_CellularAutomaton_internal_27 --> -112($fp) + # local_print_at_CellularAutomaton_internal_27 = SELF + sw $s1, -112($fp) + # RETURN local_print_at_CellularAutomaton_internal_27 + lw $v0, -112($fp) + # Deallocate stack frame for function function_print_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 120 + jr $ra + # Function END + + +# function_num_cells_at_CellularAutomaton implementation. +# @Params: +function_num_cells_at_CellularAutomaton: + # Allocate stack frame for function function_num_cells_at_CellularAutomaton. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_num_cells_at_CellularAutomaton_internal_2 = GETATTRIBUTE population_map CellularAutomaton + # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) + lw $t0, 24($s1) + sw $t0, -12($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) + # local_num_cells_at_CellularAutomaton_internal_0 = local_num_cells_at_CellularAutomaton_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_1 --> -8($fp) + # local_num_cells_at_CellularAutomaton_internal_1 = VCALL local_num_cells_at_CellularAutomaton_internal_0 length + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 88($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_num_cells_at_CellularAutomaton_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_num_cells_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cell_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_cell_at_CellularAutomaton_position_0 +function_cell_at_CellularAutomaton: + # Allocate stack frame for function function_cell_at_CellularAutomaton. + subu $sp, $sp, 52 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 52 + # local_cell_at_CellularAutomaton_internal_4 = GETATTRIBUTE board_size CellularAutomaton + # LOCAL local_cell_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t0, 20($s1) + sw $t0, -20($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -24($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_5 --> -24($fp) + # local_cell_at_CellularAutomaton_internal_3 = local_cell_at_CellularAutomaton_internal_4 - local_cell_at_CellularAutomaton_internal_5 + lw $t1, -20($fp) + lw $t0, 12($t1) + lw $t1, -24($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -16($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_at_CellularAutomaton_position_0 --> 0($fp) + lw $a0, -16($fp) + lw $a1, 0($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -12($fp) + # IF_GREATER_ZERO local_cell_at_CellularAutomaton_internal_2 GOTO label_FALSE_67 + # IF_GREATER_ZERO local_cell_at_CellularAutomaton_internal_2 GOTO label_FALSE_67 + lw $t0, -12($fp) + bgt $t0, 0, label_FALSE_67 + # IF_ZERO local_cell_at_CellularAutomaton_internal_2 GOTO label_FALSE_67 + # IF_ZERO local_cell_at_CellularAutomaton_internal_2 GOTO label_FALSE_67 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_67 + # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_68 +j label_END_68 +label_FALSE_67: + # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_68: +# LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_cell_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_65 +# IF_ZERO local_cell_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_65 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_65 +# LOCAL local_cell_at_CellularAutomaton_internal_6 --> -28($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_7 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -28($fp) +# LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_cell_at_CellularAutomaton_internal_6 --> -28($fp) +# local_cell_at_CellularAutomaton_internal_1 = local_cell_at_CellularAutomaton_internal_6 +lw $t0, -28($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_66 +j label_ENDIF_66 +label_FALSEIF_65: + # local_cell_at_CellularAutomaton_internal_9 = GETATTRIBUTE population_map CellularAutomaton + # LOCAL local_cell_at_CellularAutomaton_internal_9 --> -40($fp) + lw $t0, 24($s1) + sw $t0, -40($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_9 --> -40($fp) + # local_cell_at_CellularAutomaton_internal_7 = local_cell_at_CellularAutomaton_internal_9 + lw $t0, -40($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cell_at_CellularAutomaton_position_0 + # PARAM param_cell_at_CellularAutomaton_position_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cell_at_CellularAutomaton_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + # ARG local_cell_at_CellularAutomaton_internal_10 + # LOCAL local_cell_at_CellularAutomaton_internal_10 --> -44($fp) + lw $t0, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cell_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_8 --> -36($fp) + # local_cell_at_CellularAutomaton_internal_8 = VCALL local_cell_at_CellularAutomaton_internal_7 substr + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 72($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_8 --> -36($fp) + # local_cell_at_CellularAutomaton_internal_1 = local_cell_at_CellularAutomaton_internal_8 + lw $t0, -36($fp) + sw $t0, -8($fp) + label_ENDIF_66: +# RETURN local_cell_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_cell_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 52 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_north_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_north_at_CellularAutomaton_position_0 +function_north_at_CellularAutomaton: + # Allocate stack frame for function function_north_at_CellularAutomaton. + subu $sp, $sp, 56 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 56 + # local_north_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_north_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # LOCAL local_north_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_north_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_north_at_CellularAutomaton_internal_4 --> -20($fp) + # local_north_at_CellularAutomaton_internal_3 = PARAM param_north_at_CellularAutomaton_position_0 - local_north_at_CellularAutomaton_internal_4 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -20($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -16($fp) + # LOCAL local_north_at_CellularAutomaton_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # LOCAL local_north_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_north_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_north_at_CellularAutomaton_internal_5 --> -24($fp) + lw $a0, -16($fp) + lw $a1, -24($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -12($fp) + # IF_GREATER_ZERO local_north_at_CellularAutomaton_internal_2 GOTO label_FALSE_71 + # IF_GREATER_ZERO local_north_at_CellularAutomaton_internal_2 GOTO label_FALSE_71 + lw $t0, -12($fp) + bgt $t0, 0, label_FALSE_71 + # IF_ZERO local_north_at_CellularAutomaton_internal_2 GOTO label_FALSE_71 + # IF_ZERO local_north_at_CellularAutomaton_internal_2 GOTO label_FALSE_71 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_71 + # LOCAL local_north_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_72 +j label_END_72 +label_FALSE_71: + # LOCAL local_north_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_72: +# LOCAL local_north_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_north_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_north_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_69 +# IF_ZERO local_north_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_69 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_69 +# LOCAL local_north_at_CellularAutomaton_internal_6 --> -28($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_8 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -28($fp) +# LOCAL local_north_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_north_at_CellularAutomaton_internal_6 --> -28($fp) +# local_north_at_CellularAutomaton_internal_1 = local_north_at_CellularAutomaton_internal_6 +lw $t0, -28($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_70 +j label_ENDIF_70 +label_FALSEIF_69: + # LOCAL local_north_at_CellularAutomaton_internal_9 --> -40($fp) + # local_north_at_CellularAutomaton_internal_9 = SELF + sw $s1, -40($fp) + # LOCAL local_north_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_north_at_CellularAutomaton_internal_9 --> -40($fp) + # local_north_at_CellularAutomaton_internal_7 = local_north_at_CellularAutomaton_internal_9 + lw $t0, -40($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_north_at_CellularAutomaton_internal_11 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_north_at_CellularAutomaton_internal_11 --> -48($fp) + lw $t0, 16($s1) + sw $t0, -48($fp) + # LOCAL local_north_at_CellularAutomaton_internal_10 --> -44($fp) + # PARAM param_north_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_north_at_CellularAutomaton_internal_11 --> -48($fp) + # local_north_at_CellularAutomaton_internal_10 = PARAM param_north_at_CellularAutomaton_position_0 - local_north_at_CellularAutomaton_internal_11 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -48($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -44($fp) + # ARG local_north_at_CellularAutomaton_internal_10 + # LOCAL local_north_at_CellularAutomaton_internal_10 --> -44($fp) + lw $t0, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_north_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_north_at_CellularAutomaton_internal_8 --> -36($fp) + # local_north_at_CellularAutomaton_internal_8 = VCALL local_north_at_CellularAutomaton_internal_7 cell + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 108($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_north_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_north_at_CellularAutomaton_internal_8 --> -36($fp) + # local_north_at_CellularAutomaton_internal_1 = local_north_at_CellularAutomaton_internal_8 + lw $t0, -36($fp) + sw $t0, -8($fp) + label_ENDIF_70: +# RETURN local_north_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_north_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 56 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_south_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_south_at_CellularAutomaton_position_0 +function_south_at_CellularAutomaton: + # Allocate stack frame for function function_south_at_CellularAutomaton. + subu $sp, $sp, 56 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 56 + # local_south_at_CellularAutomaton_internal_3 = GETATTRIBUTE board_size CellularAutomaton + # LOCAL local_south_at_CellularAutomaton_internal_3 --> -16($fp) + lw $t0, 20($s1) + sw $t0, -16($fp) + # local_south_at_CellularAutomaton_internal_5 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_south_at_CellularAutomaton_internal_5 --> -24($fp) + lw $t0, 16($s1) + sw $t0, -24($fp) + # LOCAL local_south_at_CellularAutomaton_internal_4 --> -20($fp) + # PARAM param_south_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_south_at_CellularAutomaton_internal_5 --> -24($fp) + # local_south_at_CellularAutomaton_internal_4 = PARAM param_south_at_CellularAutomaton_position_0 + local_south_at_CellularAutomaton_internal_5 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -24($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -20($fp) + # LOCAL local_south_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_south_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_south_at_CellularAutomaton_internal_4 --> -20($fp) + lw $a0, -16($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -12($fp) + # IF_GREATER_ZERO local_south_at_CellularAutomaton_internal_2 GOTO label_FALSE_75 + # IF_GREATER_ZERO local_south_at_CellularAutomaton_internal_2 GOTO label_FALSE_75 + lw $t0, -12($fp) + bgt $t0, 0, label_FALSE_75 + # IF_ZERO local_south_at_CellularAutomaton_internal_2 GOTO label_FALSE_75 + # IF_ZERO local_south_at_CellularAutomaton_internal_2 GOTO label_FALSE_75 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_75 + # LOCAL local_south_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_76 +j label_END_76 +label_FALSE_75: + # LOCAL local_south_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_76: +# LOCAL local_south_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_south_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_south_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_73 +# IF_ZERO local_south_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_73 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_73 +# LOCAL local_south_at_CellularAutomaton_internal_6 --> -28($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_9 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -28($fp) +# LOCAL local_south_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_south_at_CellularAutomaton_internal_6 --> -28($fp) +# local_south_at_CellularAutomaton_internal_1 = local_south_at_CellularAutomaton_internal_6 +lw $t0, -28($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_74 +j label_ENDIF_74 +label_FALSEIF_73: + # LOCAL local_south_at_CellularAutomaton_internal_9 --> -40($fp) + # local_south_at_CellularAutomaton_internal_9 = SELF + sw $s1, -40($fp) + # LOCAL local_south_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_south_at_CellularAutomaton_internal_9 --> -40($fp) + # local_south_at_CellularAutomaton_internal_7 = local_south_at_CellularAutomaton_internal_9 + lw $t0, -40($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_south_at_CellularAutomaton_internal_11 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_south_at_CellularAutomaton_internal_11 --> -48($fp) + lw $t0, 16($s1) + sw $t0, -48($fp) + # LOCAL local_south_at_CellularAutomaton_internal_10 --> -44($fp) + # PARAM param_south_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_south_at_CellularAutomaton_internal_11 --> -48($fp) + # local_south_at_CellularAutomaton_internal_10 = PARAM param_south_at_CellularAutomaton_position_0 + local_south_at_CellularAutomaton_internal_11 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -48($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -44($fp) + # ARG local_south_at_CellularAutomaton_internal_10 + # LOCAL local_south_at_CellularAutomaton_internal_10 --> -44($fp) + lw $t0, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_south_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_south_at_CellularAutomaton_internal_8 --> -36($fp) + # local_south_at_CellularAutomaton_internal_8 = VCALL local_south_at_CellularAutomaton_internal_7 cell + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 108($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_south_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_south_at_CellularAutomaton_internal_8 --> -36($fp) + # local_south_at_CellularAutomaton_internal_1 = local_south_at_CellularAutomaton_internal_8 + lw $t0, -36($fp) + sw $t0, -8($fp) + label_ENDIF_74: +# RETURN local_south_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_south_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 56 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_east_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_east_at_CellularAutomaton_position_0 +function_east_at_CellularAutomaton: + # Allocate stack frame for function function_east_at_CellularAutomaton. + subu $sp, $sp, 80 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 80 + # LOCAL local_east_at_CellularAutomaton_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -32($fp) + # LOCAL local_east_at_CellularAutomaton_internal_6 --> -28($fp) + # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_east_at_CellularAutomaton_internal_7 --> -32($fp) + # local_east_at_CellularAutomaton_internal_6 = PARAM param_east_at_CellularAutomaton_position_0 + local_east_at_CellularAutomaton_internal_7 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -32($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -28($fp) + # local_east_at_CellularAutomaton_internal_8 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_east_at_CellularAutomaton_internal_8 --> -36($fp) + lw $t0, 16($s1) + sw $t0, -36($fp) + # LOCAL local_east_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_east_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_east_at_CellularAutomaton_internal_8 --> -36($fp) + # local_east_at_CellularAutomaton_internal_5 = local_east_at_CellularAutomaton_internal_6 / local_east_at_CellularAutomaton_internal_8 + lw $t1, -28($fp) + lw $t0, 12($t1) + lw $t1, -36($fp) + lw $t2, 12($t1) + div $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -24($fp) + # local_east_at_CellularAutomaton_internal_9 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_east_at_CellularAutomaton_internal_9 --> -40($fp) + lw $t0, 16($s1) + sw $t0, -40($fp) + # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_east_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_east_at_CellularAutomaton_internal_9 --> -40($fp) + # local_east_at_CellularAutomaton_internal_4 = local_east_at_CellularAutomaton_internal_5 * local_east_at_CellularAutomaton_internal_9 + lw $t1, -24($fp) + lw $t0, 12($t1) + lw $t1, -40($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -20($fp) + # LOCAL local_east_at_CellularAutomaton_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -48($fp) + # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) + # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_east_at_CellularAutomaton_internal_11 --> -48($fp) + # local_east_at_CellularAutomaton_internal_10 = PARAM param_east_at_CellularAutomaton_position_0 + local_east_at_CellularAutomaton_internal_11 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -48($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -44($fp) + # IF_ZERO local_east_at_CellularAutomaton_internal_4 GOTO label_FALSE_79 + # IF_ZERO local_east_at_CellularAutomaton_internal_4 GOTO label_FALSE_79 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_79 + # IF_ZERO local_east_at_CellularAutomaton_internal_10 GOTO label_FALSE_79 + # IF_ZERO local_east_at_CellularAutomaton_internal_10 GOTO label_FALSE_79 + lw $t0, -44($fp) + beq $t0, 0, label_FALSE_79 + # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) + # Comparing -20($fp) type with String + la $v0, String + lw $a0, -20($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_82 + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_82 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_82 + # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) + # Comparing -20($fp) type with Bool + la $v0, Bool + lw $a0, -20($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_83 + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_83 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_83 + # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) + # Comparing -20($fp) type with Int + la $v0, Int + lw $a0, -20($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_83 + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_83 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_83 + # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) + # Load pointers and SUB + lw $a0, -20($fp) + lw $a1, -44($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_TRUE_80 + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_TRUE_80 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_80 + # GOTO label_FALSE_79 + j label_FALSE_79 + label_COMPARE_BY_VALUE_83: + # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) + lw $a0, -20($fp) + lw $a1, -44($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_TRUE_80 + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_TRUE_80 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_80 + # GOTO label_FALSE_79 + j label_FALSE_79 + label_COMPARE_STRING_82: + # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -44($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_84 + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_84 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_84 + # GOTO label_FALSE_79 + j label_FALSE_79 + label_CONTINUE_84: + # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -44($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_85: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_86 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_85 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_86: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_TRUE_80 + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_TRUE_80 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_80 + label_FALSE_79: + # LOCAL local_east_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_81 +j label_END_81 +label_TRUE_80: + # LOCAL local_east_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_81: +# LOCAL local_east_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_east_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_east_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_77 +# IF_ZERO local_east_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_77 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_77 +# LOCAL local_east_at_CellularAutomaton_internal_12 --> -52($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_10 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -52($fp) +# LOCAL local_east_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_east_at_CellularAutomaton_internal_12 --> -52($fp) +# local_east_at_CellularAutomaton_internal_1 = local_east_at_CellularAutomaton_internal_12 +lw $t0, -52($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_78 +j label_ENDIF_78 +label_FALSEIF_77: + # LOCAL local_east_at_CellularAutomaton_internal_15 --> -64($fp) + # local_east_at_CellularAutomaton_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_east_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_east_at_CellularAutomaton_internal_15 --> -64($fp) + # local_east_at_CellularAutomaton_internal_13 = local_east_at_CellularAutomaton_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_east_at_CellularAutomaton_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -72($fp) + # LOCAL local_east_at_CellularAutomaton_internal_16 --> -68($fp) + # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_east_at_CellularAutomaton_internal_17 --> -72($fp) + # local_east_at_CellularAutomaton_internal_16 = PARAM param_east_at_CellularAutomaton_position_0 + local_east_at_CellularAutomaton_internal_17 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -72($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -68($fp) + # ARG local_east_at_CellularAutomaton_internal_16 + # LOCAL local_east_at_CellularAutomaton_internal_16 --> -68($fp) + lw $t0, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_east_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_east_at_CellularAutomaton_internal_14 --> -60($fp) + # local_east_at_CellularAutomaton_internal_14 = VCALL local_east_at_CellularAutomaton_internal_13 cell + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 108($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_east_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_east_at_CellularAutomaton_internal_14 --> -60($fp) + # local_east_at_CellularAutomaton_internal_1 = local_east_at_CellularAutomaton_internal_14 + lw $t0, -60($fp) + sw $t0, -8($fp) + label_ENDIF_78: +# RETURN local_east_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_east_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 80 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_west_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_west_at_CellularAutomaton_position_0 +function_west_at_CellularAutomaton: + # Allocate stack frame for function function_west_at_CellularAutomaton. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # IF_ZERO param_west_at_CellularAutomaton_position_0 GOTO label_FALSE_89 + # IF_ZERO param_west_at_CellularAutomaton_position_0 GOTO label_FALSE_89 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_89 + # IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_FALSE_89 + # IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_FALSE_89 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_89 + # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_92 + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_92 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_92 + # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_93 + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_93 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_93 + # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_93 + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_93 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_93 + # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_TRUE_90 + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_TRUE_90 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_90 + # GOTO label_FALSE_89 + j label_FALSE_89 + label_COMPARE_BY_VALUE_93: + # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_TRUE_90 + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_TRUE_90 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_90 + # GOTO label_FALSE_89 + j label_FALSE_89 + label_COMPARE_STRING_92: + # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_94 + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_94 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_94 + # GOTO label_FALSE_89 + j label_FALSE_89 + label_CONTINUE_94: + # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_95: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_96 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_95 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_96: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_TRUE_90 + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_TRUE_90 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_90 + label_FALSE_89: + # LOCAL local_west_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_91 +j label_END_91 +label_TRUE_90: + # LOCAL local_west_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_91: +# LOCAL local_west_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_west_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_west_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_87 +# IF_ZERO local_west_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_87 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_87 +# LOCAL local_west_at_CellularAutomaton_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_11 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -24($fp) +# LOCAL local_west_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_west_at_CellularAutomaton_internal_5 --> -24($fp) +# local_west_at_CellularAutomaton_internal_1 = local_west_at_CellularAutomaton_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_88 +j label_ENDIF_88 +label_FALSEIF_87: + # local_west_at_CellularAutomaton_internal_12 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_west_at_CellularAutomaton_internal_12 --> -52($fp) + lw $t0, 16($s1) + sw $t0, -52($fp) + # LOCAL local_west_at_CellularAutomaton_internal_11 --> -48($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_west_at_CellularAutomaton_internal_12 --> -52($fp) + # local_west_at_CellularAutomaton_internal_11 = PARAM param_west_at_CellularAutomaton_position_0 / local_west_at_CellularAutomaton_internal_12 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -52($fp) + lw $t2, 12($t1) + div $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -48($fp) + # local_west_at_CellularAutomaton_internal_13 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_west_at_CellularAutomaton_internal_13 --> -56($fp) + lw $t0, 16($s1) + sw $t0, -56($fp) + # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_west_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_west_at_CellularAutomaton_internal_13 --> -56($fp) + # local_west_at_CellularAutomaton_internal_10 = local_west_at_CellularAutomaton_internal_11 * local_west_at_CellularAutomaton_internal_13 + lw $t1, -48($fp) + lw $t0, 12($t1) + lw $t1, -56($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -44($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_10 GOTO label_FALSE_99 + # IF_ZERO local_west_at_CellularAutomaton_internal_10 GOTO label_FALSE_99 + lw $t0, -44($fp) + beq $t0, 0, label_FALSE_99 + # IF_ZERO param_west_at_CellularAutomaton_position_0 GOTO label_FALSE_99 + # IF_ZERO param_west_at_CellularAutomaton_position_0 GOTO label_FALSE_99 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_99 + # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) + # Comparing -44($fp) type with String + la $v0, String + lw $a0, -44($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_COMPARE_STRING_102 + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_COMPARE_STRING_102 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_102 + # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) + # Comparing -44($fp) type with Bool + la $v0, Bool + lw $a0, -44($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_103 + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_103 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_103 + # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) + # Comparing -44($fp) type with Int + la $v0, Int + lw $a0, -44($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_103 + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_103 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_103 + # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # Load pointers and SUB + lw $a0, -44($fp) + lw $a1, 0($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_TRUE_100 + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_TRUE_100 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_100 + # GOTO label_FALSE_99 + j label_FALSE_99 + label_COMPARE_BY_VALUE_103: + # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + lw $a0, -44($fp) + lw $a1, 0($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_TRUE_100 + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_TRUE_100 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_100 + # GOTO label_FALSE_99 + j label_FALSE_99 + label_COMPARE_STRING_102: + # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # Load strings for comparison + lw $v0, -44($fp) + lw $v1, 0($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_CONTINUE_104 + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_CONTINUE_104 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_104 + # GOTO label_FALSE_99 + j label_FALSE_99 + label_CONTINUE_104: + # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -44($fp) + lw $v1, 0($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_105: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_106 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_105 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_106: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_TRUE_100 + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_TRUE_100 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_100 + label_FALSE_99: + # LOCAL local_west_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_101 +j label_END_101 +label_TRUE_100: + # LOCAL local_west_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_101: +# LOCAL local_west_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_west_at_CellularAutomaton_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_west_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_97 +# IF_ZERO local_west_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_97 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_97 +# LOCAL local_west_at_CellularAutomaton_internal_14 --> -60($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_12 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -60($fp) +# LOCAL local_west_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_west_at_CellularAutomaton_internal_14 --> -60($fp) +# local_west_at_CellularAutomaton_internal_7 = local_west_at_CellularAutomaton_internal_14 +lw $t0, -60($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_98 +j label_ENDIF_98 +label_FALSEIF_97: + # LOCAL local_west_at_CellularAutomaton_internal_17 --> -72($fp) + # local_west_at_CellularAutomaton_internal_17 = SELF + sw $s1, -72($fp) + # LOCAL local_west_at_CellularAutomaton_internal_15 --> -64($fp) + # LOCAL local_west_at_CellularAutomaton_internal_17 --> -72($fp) + # local_west_at_CellularAutomaton_internal_15 = local_west_at_CellularAutomaton_internal_17 + lw $t0, -72($fp) + sw $t0, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_west_at_CellularAutomaton_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -80($fp) + # LOCAL local_west_at_CellularAutomaton_internal_18 --> -76($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_west_at_CellularAutomaton_internal_19 --> -80($fp) + # local_west_at_CellularAutomaton_internal_18 = PARAM param_west_at_CellularAutomaton_position_0 - local_west_at_CellularAutomaton_internal_19 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -80($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -76($fp) + # ARG local_west_at_CellularAutomaton_internal_18 + # LOCAL local_west_at_CellularAutomaton_internal_18 --> -76($fp) + lw $t0, -76($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_west_at_CellularAutomaton_internal_15 --> -64($fp) + # LOCAL local_west_at_CellularAutomaton_internal_16 --> -68($fp) + # local_west_at_CellularAutomaton_internal_16 = VCALL local_west_at_CellularAutomaton_internal_15 cell + # Save new self pointer in $s1 + lw $s1, -64($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 108($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_west_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_west_at_CellularAutomaton_internal_16 --> -68($fp) + # local_west_at_CellularAutomaton_internal_7 = local_west_at_CellularAutomaton_internal_16 + lw $t0, -68($fp) + sw $t0, -32($fp) + label_ENDIF_98: +# LOCAL local_west_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_west_at_CellularAutomaton_internal_7 --> -32($fp) +# local_west_at_CellularAutomaton_internal_1 = local_west_at_CellularAutomaton_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +label_ENDIF_88: +# RETURN local_west_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_west_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_northwest_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_northwest_at_CellularAutomaton_position_0 +function_northwest_at_CellularAutomaton: + # Allocate stack frame for function function_northwest_at_CellularAutomaton. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # local_northwest_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northwest_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_4 --> -20($fp) + # local_northwest_at_CellularAutomaton_internal_3 = PARAM param_northwest_at_CellularAutomaton_position_0 - local_northwest_at_CellularAutomaton_internal_4 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -20($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -16($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_5 --> -24($fp) + lw $a0, -16($fp) + lw $a1, -24($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -12($fp) + # IF_GREATER_ZERO local_northwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_109 + # IF_GREATER_ZERO local_northwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_109 + lw $t0, -12($fp) + bgt $t0, 0, label_FALSE_109 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_109 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_109 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_109 + # LOCAL local_northwest_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_110 +j label_END_110 +label_FALSE_109: + # LOCAL local_northwest_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_110: +# LOCAL local_northwest_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_northwest_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_107 +# IF_ZERO local_northwest_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_107 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_107 +# LOCAL local_northwest_at_CellularAutomaton_internal_6 --> -28($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_13 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -28($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_6 --> -28($fp) +# local_northwest_at_CellularAutomaton_internal_1 = local_northwest_at_CellularAutomaton_internal_6 +lw $t0, -28($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_108 +j label_ENDIF_108 +label_FALSEIF_107: + # local_northwest_at_CellularAutomaton_internal_13 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northwest_at_CellularAutomaton_internal_13 --> -56($fp) + lw $t0, 16($s1) + sw $t0, -56($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_12 --> -52($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_13 --> -56($fp) + # local_northwest_at_CellularAutomaton_internal_12 = PARAM param_northwest_at_CellularAutomaton_position_0 / local_northwest_at_CellularAutomaton_internal_13 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -56($fp) + lw $t2, 12($t1) + div $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -52($fp) + # local_northwest_at_CellularAutomaton_internal_14 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northwest_at_CellularAutomaton_internal_14 --> -60($fp) + lw $t0, 16($s1) + sw $t0, -60($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_14 --> -60($fp) + # local_northwest_at_CellularAutomaton_internal_11 = local_northwest_at_CellularAutomaton_internal_12 * local_northwest_at_CellularAutomaton_internal_14 + lw $t1, -52($fp) + lw $t0, 12($t1) + lw $t1, -60($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -48($fp) + # IF_ZERO local_northwest_at_CellularAutomaton_internal_11 GOTO label_FALSE_113 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_11 GOTO label_FALSE_113 + lw $t0, -48($fp) + beq $t0, 0, label_FALSE_113 + # IF_ZERO param_northwest_at_CellularAutomaton_position_0 GOTO label_FALSE_113 + # IF_ZERO param_northwest_at_CellularAutomaton_position_0 GOTO label_FALSE_113 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_113 + # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with String + la $v0, String + lw $a0, -48($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_116 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_116 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_STRING_116 + # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with Bool + la $v0, Bool + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_117 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_117 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_117 + # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with Int + la $v0, Int + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_117 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_117 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_117 + # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + # Load pointers and SUB + lw $a0, -48($fp) + lw $a1, 0($fp) + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_114 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_114 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_114 + # GOTO label_FALSE_113 + j label_FALSE_113 + label_COMPARE_BY_VALUE_117: + # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + lw $a0, -48($fp) + lw $a1, 0($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_114 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_114 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_114 + # GOTO label_FALSE_113 + j label_FALSE_113 + label_COMPARE_STRING_116: + # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, 0($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -44($fp) + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_118 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_118 + lw $t0, -44($fp) + beq $t0, 0, label_CONTINUE_118 + # GOTO label_FALSE_113 + j label_FALSE_113 + label_CONTINUE_118: + # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, 0($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_119: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_120 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_119 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_120: + # Store result + sw $a2, -44($fp) + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_114 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_114 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_114 + label_FALSE_113: + # LOCAL local_northwest_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -40($fp) + # GOTO label_END_115 +j label_END_115 +label_TRUE_114: + # LOCAL local_northwest_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -40($fp) + label_END_115: +# LOCAL local_northwest_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_9 --> -40($fp) +# Obtain value from -40($fp) +lw $v0, -40($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_northwest_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_111 +# IF_ZERO local_northwest_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_111 +lw $t0, -32($fp) +beq $t0, 0, label_FALSEIF_111 +# LOCAL local_northwest_at_CellularAutomaton_internal_15 --> -64($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_14 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -64($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_15 --> -64($fp) +# local_northwest_at_CellularAutomaton_internal_8 = local_northwest_at_CellularAutomaton_internal_15 +lw $t0, -64($fp) +sw $t0, -36($fp) +# GOTO label_ENDIF_112 +j label_ENDIF_112 +label_FALSEIF_111: + # LOCAL local_northwest_at_CellularAutomaton_internal_18 --> -76($fp) + # local_northwest_at_CellularAutomaton_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_16 --> -68($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_18 --> -76($fp) + # local_northwest_at_CellularAutomaton_internal_16 = local_northwest_at_CellularAutomaton_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_northwest_at_CellularAutomaton_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -84($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_19 --> -80($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_20 --> -84($fp) + # local_northwest_at_CellularAutomaton_internal_19 = PARAM param_northwest_at_CellularAutomaton_position_0 - local_northwest_at_CellularAutomaton_internal_20 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -84($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -80($fp) + # ARG local_northwest_at_CellularAutomaton_internal_19 + # LOCAL local_northwest_at_CellularAutomaton_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_northwest_at_CellularAutomaton_internal_16 --> -68($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_17 --> -72($fp) + # local_northwest_at_CellularAutomaton_internal_17 = VCALL local_northwest_at_CellularAutomaton_internal_16 north + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 100($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_northwest_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_17 --> -72($fp) + # local_northwest_at_CellularAutomaton_internal_8 = local_northwest_at_CellularAutomaton_internal_17 + lw $t0, -72($fp) + sw $t0, -36($fp) + label_ENDIF_112: +# LOCAL local_northwest_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_8 --> -36($fp) +# local_northwest_at_CellularAutomaton_internal_1 = local_northwest_at_CellularAutomaton_internal_8 +lw $t0, -36($fp) +sw $t0, -8($fp) +label_ENDIF_108: +# RETURN local_northwest_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_northwest_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 92 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_northeast_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_northeast_at_CellularAutomaton_position_0 +function_northeast_at_CellularAutomaton: + # Allocate stack frame for function function_northeast_at_CellularAutomaton. + subu $sp, $sp, 108 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 108 + # local_northeast_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northeast_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_4 --> -20($fp) + # local_northeast_at_CellularAutomaton_internal_3 = PARAM param_northeast_at_CellularAutomaton_position_0 - local_northeast_at_CellularAutomaton_internal_4 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -20($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -16($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_5 --> -24($fp) + lw $a0, -16($fp) + lw $a1, -24($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -12($fp) + # IF_GREATER_ZERO local_northeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_123 + # IF_GREATER_ZERO local_northeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_123 + lw $t0, -12($fp) + bgt $t0, 0, label_FALSE_123 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_123 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_123 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_123 + # LOCAL local_northeast_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_124 +j label_END_124 +label_FALSE_123: + # LOCAL local_northeast_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_124: +# LOCAL local_northeast_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_northeast_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_121 +# IF_ZERO local_northeast_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_121 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_121 +# LOCAL local_northeast_at_CellularAutomaton_internal_6 --> -28($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_15 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -28($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_6 --> -28($fp) +# local_northeast_at_CellularAutomaton_internal_1 = local_northeast_at_CellularAutomaton_internal_6 +lw $t0, -28($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_122 +j label_ENDIF_122 +label_FALSEIF_121: + # LOCAL local_northeast_at_CellularAutomaton_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_13 --> -56($fp) + # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_14 --> -60($fp) + # local_northeast_at_CellularAutomaton_internal_13 = PARAM param_northeast_at_CellularAutomaton_position_0 + local_northeast_at_CellularAutomaton_internal_14 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -60($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -56($fp) + # local_northeast_at_CellularAutomaton_internal_15 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northeast_at_CellularAutomaton_internal_15 --> -64($fp) + lw $t0, 16($s1) + sw $t0, -64($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_15 --> -64($fp) + # local_northeast_at_CellularAutomaton_internal_12 = local_northeast_at_CellularAutomaton_internal_13 / local_northeast_at_CellularAutomaton_internal_15 + lw $t1, -56($fp) + lw $t0, 12($t1) + lw $t1, -64($fp) + lw $t2, 12($t1) + div $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -52($fp) + # local_northeast_at_CellularAutomaton_internal_16 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northeast_at_CellularAutomaton_internal_16 --> -68($fp) + lw $t0, 16($s1) + sw $t0, -68($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_16 --> -68($fp) + # local_northeast_at_CellularAutomaton_internal_11 = local_northeast_at_CellularAutomaton_internal_12 * local_northeast_at_CellularAutomaton_internal_16 + lw $t1, -52($fp) + lw $t0, 12($t1) + lw $t1, -68($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -48($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -76($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) + # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_18 --> -76($fp) + # local_northeast_at_CellularAutomaton_internal_17 = PARAM param_northeast_at_CellularAutomaton_position_0 + local_northeast_at_CellularAutomaton_internal_18 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -76($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -72($fp) + # IF_ZERO local_northeast_at_CellularAutomaton_internal_11 GOTO label_FALSE_127 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_11 GOTO label_FALSE_127 + lw $t0, -48($fp) + beq $t0, 0, label_FALSE_127 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_17 GOTO label_FALSE_127 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_17 GOTO label_FALSE_127 + lw $t0, -72($fp) + beq $t0, 0, label_FALSE_127 + # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with String + la $v0, String + lw $a0, -48($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_130 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_130 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_STRING_130 + # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with Bool + la $v0, Bool + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_131 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_131 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_131 + # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with Int + la $v0, Int + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_131 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_131 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_131 + # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) + # Load pointers and SUB + lw $a0, -48($fp) + lw $a1, -72($fp) + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_128 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_128 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_128 + # GOTO label_FALSE_127 + j label_FALSE_127 + label_COMPARE_BY_VALUE_131: + # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) + lw $a0, -48($fp) + lw $a1, -72($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_128 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_128 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_128 + # GOTO label_FALSE_127 + j label_FALSE_127 + label_COMPARE_STRING_130: + # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -72($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -44($fp) + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_132 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_132 + lw $t0, -44($fp) + beq $t0, 0, label_CONTINUE_132 + # GOTO label_FALSE_127 + j label_FALSE_127 + label_CONTINUE_132: + # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -72($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_133: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_134 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_133 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_134: + # Store result + sw $a2, -44($fp) + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_128 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_128 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_128 + label_FALSE_127: + # LOCAL local_northeast_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -40($fp) + # GOTO label_END_129 +j label_END_129 +label_TRUE_128: + # LOCAL local_northeast_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -40($fp) + label_END_129: +# LOCAL local_northeast_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_9 --> -40($fp) +# Obtain value from -40($fp) +lw $v0, -40($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_northeast_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_125 +# IF_ZERO local_northeast_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_125 +lw $t0, -32($fp) +beq $t0, 0, label_FALSEIF_125 +# LOCAL local_northeast_at_CellularAutomaton_internal_19 --> -80($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_16 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -80($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_19 --> -80($fp) +# local_northeast_at_CellularAutomaton_internal_8 = local_northeast_at_CellularAutomaton_internal_19 +lw $t0, -80($fp) +sw $t0, -36($fp) +# GOTO label_ENDIF_126 +j label_ENDIF_126 +label_FALSEIF_125: + # LOCAL local_northeast_at_CellularAutomaton_internal_22 --> -92($fp) + # local_northeast_at_CellularAutomaton_internal_22 = SELF + sw $s1, -92($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_22 --> -92($fp) + # local_northeast_at_CellularAutomaton_internal_20 = local_northeast_at_CellularAutomaton_internal_22 + lw $t0, -92($fp) + sw $t0, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_northeast_at_CellularAutomaton_internal_24 --> -100($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -100($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_23 --> -96($fp) + # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_24 --> -100($fp) + # local_northeast_at_CellularAutomaton_internal_23 = PARAM param_northeast_at_CellularAutomaton_position_0 + local_northeast_at_CellularAutomaton_internal_24 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -100($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -96($fp) + # ARG local_northeast_at_CellularAutomaton_internal_23 + # LOCAL local_northeast_at_CellularAutomaton_internal_23 --> -96($fp) + lw $t0, -96($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_northeast_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_21 --> -88($fp) + # local_northeast_at_CellularAutomaton_internal_21 = VCALL local_northeast_at_CellularAutomaton_internal_20 north + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 100($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_northeast_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_21 --> -88($fp) + # local_northeast_at_CellularAutomaton_internal_8 = local_northeast_at_CellularAutomaton_internal_21 + lw $t0, -88($fp) + sw $t0, -36($fp) + label_ENDIF_126: +# LOCAL local_northeast_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_8 --> -36($fp) +# local_northeast_at_CellularAutomaton_internal_1 = local_northeast_at_CellularAutomaton_internal_8 +lw $t0, -36($fp) +sw $t0, -8($fp) +label_ENDIF_122: +# RETURN local_northeast_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_northeast_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 108 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_southeast_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_southeast_at_CellularAutomaton_position_0 +function_southeast_at_CellularAutomaton: + # Allocate stack frame for function function_southeast_at_CellularAutomaton. + subu $sp, $sp, 108 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 108 + # local_southeast_at_CellularAutomaton_internal_3 = GETATTRIBUTE board_size CellularAutomaton + # LOCAL local_southeast_at_CellularAutomaton_internal_3 --> -16($fp) + lw $t0, 20($s1) + sw $t0, -16($fp) + # local_southeast_at_CellularAutomaton_internal_5 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southeast_at_CellularAutomaton_internal_5 --> -24($fp) + lw $t0, 16($s1) + sw $t0, -24($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_4 --> -20($fp) + # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_5 --> -24($fp) + # local_southeast_at_CellularAutomaton_internal_4 = PARAM param_southeast_at_CellularAutomaton_position_0 + local_southeast_at_CellularAutomaton_internal_5 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -24($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -20($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_4 --> -20($fp) + lw $a0, -16($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -12($fp) + # IF_GREATER_ZERO local_southeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_137 + # IF_GREATER_ZERO local_southeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_137 + lw $t0, -12($fp) + bgt $t0, 0, label_FALSE_137 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_137 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_137 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_137 + # LOCAL local_southeast_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_138 +j label_END_138 +label_FALSE_137: + # LOCAL local_southeast_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_138: +# LOCAL local_southeast_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_southeast_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_135 +# IF_ZERO local_southeast_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_135 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_135 +# LOCAL local_southeast_at_CellularAutomaton_internal_6 --> -28($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_17 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -28($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_6 --> -28($fp) +# local_southeast_at_CellularAutomaton_internal_1 = local_southeast_at_CellularAutomaton_internal_6 +lw $t0, -28($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_136 +j label_ENDIF_136 +label_FALSEIF_135: + # LOCAL local_southeast_at_CellularAutomaton_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_13 --> -56($fp) + # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_14 --> -60($fp) + # local_southeast_at_CellularAutomaton_internal_13 = PARAM param_southeast_at_CellularAutomaton_position_0 + local_southeast_at_CellularAutomaton_internal_14 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -60($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -56($fp) + # local_southeast_at_CellularAutomaton_internal_15 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southeast_at_CellularAutomaton_internal_15 --> -64($fp) + lw $t0, 16($s1) + sw $t0, -64($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_15 --> -64($fp) + # local_southeast_at_CellularAutomaton_internal_12 = local_southeast_at_CellularAutomaton_internal_13 / local_southeast_at_CellularAutomaton_internal_15 + lw $t1, -56($fp) + lw $t0, 12($t1) + lw $t1, -64($fp) + lw $t2, 12($t1) + div $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -52($fp) + # local_southeast_at_CellularAutomaton_internal_16 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southeast_at_CellularAutomaton_internal_16 --> -68($fp) + lw $t0, 16($s1) + sw $t0, -68($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_16 --> -68($fp) + # local_southeast_at_CellularAutomaton_internal_11 = local_southeast_at_CellularAutomaton_internal_12 * local_southeast_at_CellularAutomaton_internal_16 + lw $t1, -52($fp) + lw $t0, 12($t1) + lw $t1, -68($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -48($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -76($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) + # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_18 --> -76($fp) + # local_southeast_at_CellularAutomaton_internal_17 = PARAM param_southeast_at_CellularAutomaton_position_0 + local_southeast_at_CellularAutomaton_internal_18 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -76($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -72($fp) + # IF_ZERO local_southeast_at_CellularAutomaton_internal_11 GOTO label_FALSE_141 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_11 GOTO label_FALSE_141 + lw $t0, -48($fp) + beq $t0, 0, label_FALSE_141 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_17 GOTO label_FALSE_141 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_17 GOTO label_FALSE_141 + lw $t0, -72($fp) + beq $t0, 0, label_FALSE_141 + # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with String + la $v0, String + lw $a0, -48($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_144 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_144 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_STRING_144 + # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with Bool + la $v0, Bool + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_145 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_145 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_145 + # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with Int + la $v0, Int + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_145 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_145 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_145 + # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) + # Load pointers and SUB + lw $a0, -48($fp) + lw $a1, -72($fp) + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_142 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_142 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_142 + # GOTO label_FALSE_141 + j label_FALSE_141 + label_COMPARE_BY_VALUE_145: + # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) + lw $a0, -48($fp) + lw $a1, -72($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_142 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_142 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_142 + # GOTO label_FALSE_141 + j label_FALSE_141 + label_COMPARE_STRING_144: + # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -72($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -44($fp) + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_146 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_146 + lw $t0, -44($fp) + beq $t0, 0, label_CONTINUE_146 + # GOTO label_FALSE_141 + j label_FALSE_141 + label_CONTINUE_146: + # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -72($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_147: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_148 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_147 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_148: + # Store result + sw $a2, -44($fp) + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_142 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_142 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_142 + label_FALSE_141: + # LOCAL local_southeast_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -40($fp) + # GOTO label_END_143 +j label_END_143 +label_TRUE_142: + # LOCAL local_southeast_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -40($fp) + label_END_143: +# LOCAL local_southeast_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_9 --> -40($fp) +# Obtain value from -40($fp) +lw $v0, -40($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_139 +# IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_139 +lw $t0, -32($fp) +beq $t0, 0, label_FALSEIF_139 +# LOCAL local_southeast_at_CellularAutomaton_internal_19 --> -80($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_18 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -80($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_19 --> -80($fp) +# local_southeast_at_CellularAutomaton_internal_8 = local_southeast_at_CellularAutomaton_internal_19 +lw $t0, -80($fp) +sw $t0, -36($fp) +# GOTO label_ENDIF_140 +j label_ENDIF_140 +label_FALSEIF_139: + # LOCAL local_southeast_at_CellularAutomaton_internal_22 --> -92($fp) + # local_southeast_at_CellularAutomaton_internal_22 = SELF + sw $s1, -92($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_22 --> -92($fp) + # local_southeast_at_CellularAutomaton_internal_20 = local_southeast_at_CellularAutomaton_internal_22 + lw $t0, -92($fp) + sw $t0, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_southeast_at_CellularAutomaton_internal_24 --> -100($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -100($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_23 --> -96($fp) + # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_24 --> -100($fp) + # local_southeast_at_CellularAutomaton_internal_23 = PARAM param_southeast_at_CellularAutomaton_position_0 + local_southeast_at_CellularAutomaton_internal_24 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -100($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -96($fp) + # ARG local_southeast_at_CellularAutomaton_internal_23 + # LOCAL local_southeast_at_CellularAutomaton_internal_23 --> -96($fp) + lw $t0, -96($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_southeast_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_21 --> -88($fp) + # local_southeast_at_CellularAutomaton_internal_21 = VCALL local_southeast_at_CellularAutomaton_internal_20 south + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 120($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_southeast_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_21 --> -88($fp) + # local_southeast_at_CellularAutomaton_internal_8 = local_southeast_at_CellularAutomaton_internal_21 + lw $t0, -88($fp) + sw $t0, -36($fp) + label_ENDIF_140: +# LOCAL local_southeast_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_8 --> -36($fp) +# local_southeast_at_CellularAutomaton_internal_1 = local_southeast_at_CellularAutomaton_internal_8 +lw $t0, -36($fp) +sw $t0, -8($fp) +label_ENDIF_136: +# RETURN local_southeast_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_southeast_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 108 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_southwest_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_southwest_at_CellularAutomaton_position_0 +function_southwest_at_CellularAutomaton: + # Allocate stack frame for function function_southwest_at_CellularAutomaton. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # local_southwest_at_CellularAutomaton_internal_3 = GETATTRIBUTE board_size CellularAutomaton + # LOCAL local_southwest_at_CellularAutomaton_internal_3 --> -16($fp) + lw $t0, 20($s1) + sw $t0, -16($fp) + # local_southwest_at_CellularAutomaton_internal_5 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southwest_at_CellularAutomaton_internal_5 --> -24($fp) + lw $t0, 16($s1) + sw $t0, -24($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_4 --> -20($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_5 --> -24($fp) + # local_southwest_at_CellularAutomaton_internal_4 = PARAM param_southwest_at_CellularAutomaton_position_0 + local_southwest_at_CellularAutomaton_internal_5 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -24($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -20($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_4 --> -20($fp) + lw $a0, -16($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -12($fp) + # IF_GREATER_ZERO local_southwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_151 + # IF_GREATER_ZERO local_southwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_151 + lw $t0, -12($fp) + bgt $t0, 0, label_FALSE_151 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_151 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_151 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_151 + # LOCAL local_southwest_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_152 +j label_END_152 +label_FALSE_151: + # LOCAL local_southwest_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_152: +# LOCAL local_southwest_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_southwest_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_149 +# IF_ZERO local_southwest_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_149 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_149 +# LOCAL local_southwest_at_CellularAutomaton_internal_6 --> -28($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_19 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -28($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_6 --> -28($fp) +# local_southwest_at_CellularAutomaton_internal_1 = local_southwest_at_CellularAutomaton_internal_6 +lw $t0, -28($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_150 +j label_ENDIF_150 +label_FALSEIF_149: + # local_southwest_at_CellularAutomaton_internal_13 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southwest_at_CellularAutomaton_internal_13 --> -56($fp) + lw $t0, 16($s1) + sw $t0, -56($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_12 --> -52($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_13 --> -56($fp) + # local_southwest_at_CellularAutomaton_internal_12 = PARAM param_southwest_at_CellularAutomaton_position_0 / local_southwest_at_CellularAutomaton_internal_13 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -56($fp) + lw $t2, 12($t1) + div $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -52($fp) + # local_southwest_at_CellularAutomaton_internal_14 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southwest_at_CellularAutomaton_internal_14 --> -60($fp) + lw $t0, 16($s1) + sw $t0, -60($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_14 --> -60($fp) + # local_southwest_at_CellularAutomaton_internal_11 = local_southwest_at_CellularAutomaton_internal_12 * local_southwest_at_CellularAutomaton_internal_14 + lw $t1, -52($fp) + lw $t0, 12($t1) + lw $t1, -60($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -48($fp) + # IF_ZERO local_southwest_at_CellularAutomaton_internal_11 GOTO label_FALSE_155 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_11 GOTO label_FALSE_155 + lw $t0, -48($fp) + beq $t0, 0, label_FALSE_155 + # IF_ZERO param_southwest_at_CellularAutomaton_position_0 GOTO label_FALSE_155 + # IF_ZERO param_southwest_at_CellularAutomaton_position_0 GOTO label_FALSE_155 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_155 + # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with String + la $v0, String + lw $a0, -48($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_158 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_158 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_STRING_158 + # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with Bool + la $v0, Bool + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_159 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_159 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_159 + # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with Int + la $v0, Int + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_159 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_159 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_159 + # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + # Load pointers and SUB + lw $a0, -48($fp) + lw $a1, 0($fp) + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_156 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_156 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_156 + # GOTO label_FALSE_155 + j label_FALSE_155 + label_COMPARE_BY_VALUE_159: + # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + lw $a0, -48($fp) + lw $a1, 0($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_156 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_156 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_156 + # GOTO label_FALSE_155 + j label_FALSE_155 + label_COMPARE_STRING_158: + # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, 0($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -44($fp) + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_160 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_160 + lw $t0, -44($fp) + beq $t0, 0, label_CONTINUE_160 + # GOTO label_FALSE_155 + j label_FALSE_155 + label_CONTINUE_160: + # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, 0($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_161: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_162 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_161 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_162: + # Store result + sw $a2, -44($fp) + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_156 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_156 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_156 + label_FALSE_155: + # LOCAL local_southwest_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -40($fp) + # GOTO label_END_157 +j label_END_157 +label_TRUE_156: + # LOCAL local_southwest_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -40($fp) + label_END_157: +# LOCAL local_southwest_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_9 --> -40($fp) +# Obtain value from -40($fp) +lw $v0, -40($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_153 +# IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_153 +lw $t0, -32($fp) +beq $t0, 0, label_FALSEIF_153 +# LOCAL local_southwest_at_CellularAutomaton_internal_15 --> -64($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_20 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -64($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_15 --> -64($fp) +# local_southwest_at_CellularAutomaton_internal_8 = local_southwest_at_CellularAutomaton_internal_15 +lw $t0, -64($fp) +sw $t0, -36($fp) +# GOTO label_ENDIF_154 +j label_ENDIF_154 +label_FALSEIF_153: + # LOCAL local_southwest_at_CellularAutomaton_internal_18 --> -76($fp) + # local_southwest_at_CellularAutomaton_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_16 --> -68($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_18 --> -76($fp) + # local_southwest_at_CellularAutomaton_internal_16 = local_southwest_at_CellularAutomaton_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_southwest_at_CellularAutomaton_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -84($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_19 --> -80($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_20 --> -84($fp) + # local_southwest_at_CellularAutomaton_internal_19 = PARAM param_southwest_at_CellularAutomaton_position_0 - local_southwest_at_CellularAutomaton_internal_20 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -84($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -80($fp) + # ARG local_southwest_at_CellularAutomaton_internal_19 + # LOCAL local_southwest_at_CellularAutomaton_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_southwest_at_CellularAutomaton_internal_16 --> -68($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_17 --> -72($fp) + # local_southwest_at_CellularAutomaton_internal_17 = VCALL local_southwest_at_CellularAutomaton_internal_16 south + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 120($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_southwest_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_17 --> -72($fp) + # local_southwest_at_CellularAutomaton_internal_8 = local_southwest_at_CellularAutomaton_internal_17 + lw $t0, -72($fp) + sw $t0, -36($fp) + label_ENDIF_154: +# LOCAL local_southwest_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_8 --> -36($fp) +# local_southwest_at_CellularAutomaton_internal_1 = local_southwest_at_CellularAutomaton_internal_8 +lw $t0, -36($fp) +sw $t0, -8($fp) +label_ENDIF_150: +# RETURN local_southwest_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_southwest_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 92 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_neighbors_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_neighbors_at_CellularAutomaton_position_0 +function_neighbors_at_CellularAutomaton: + # Allocate stack frame for function function_neighbors_at_CellularAutomaton. + subu $sp, $sp, 356 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 356 + # LOCAL local_neighbors_at_CellularAutomaton_internal_13 --> -56($fp) + # local_neighbors_at_CellularAutomaton_internal_13 = SELF + sw $s1, -56($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_13 --> -56($fp) + # local_neighbors_at_CellularAutomaton_internal_11 = local_neighbors_at_CellularAutomaton_internal_13 + lw $t0, -56($fp) + sw $t0, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_neighbors_at_CellularAutomaton_position_0 + # PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) + # local_neighbors_at_CellularAutomaton_internal_12 = VCALL local_neighbors_at_CellularAutomaton_internal_11 north + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 100($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_21 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -60($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_12 GOTO label_FALSE_165 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_12 GOTO label_FALSE_165 + lw $t0, -52($fp) + beq $t0, 0, label_FALSE_165 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_FALSE_165 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_FALSE_165 + lw $t0, -60($fp) + beq $t0, 0, label_FALSE_165 + # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) + # Comparing -52($fp) type with String + la $v0, String + lw $a0, -52($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_168 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_168 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_STRING_168 + # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) + # Comparing -52($fp) type with Bool + la $v0, Bool + lw $a0, -52($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_169 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_169 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_169 + # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) + # Comparing -52($fp) type with Int + la $v0, Int + lw $a0, -52($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_169 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_169 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_169 + # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) + # Load pointers and SUB + lw $a0, -52($fp) + lw $a1, -60($fp) + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_TRUE_166 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_TRUE_166 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_166 + # GOTO label_FALSE_165 + j label_FALSE_165 + label_COMPARE_BY_VALUE_169: + # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) + lw $a0, -52($fp) + lw $a1, -60($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_TRUE_166 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_TRUE_166 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_166 + # GOTO label_FALSE_165 + j label_FALSE_165 + label_COMPARE_STRING_168: + # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) + # Load strings for comparison + lw $v0, -52($fp) + lw $v1, -60($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -44($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_170 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_170 + lw $t0, -44($fp) + beq $t0, 0, label_CONTINUE_170 + # GOTO label_FALSE_165 + j label_FALSE_165 + label_CONTINUE_170: + # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -52($fp) + lw $v1, -60($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_171: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_172 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_171 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_172: + # Store result + sw $a2, -44($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_TRUE_166 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_TRUE_166 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_166 + label_FALSE_165: + # LOCAL local_neighbors_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -40($fp) + # GOTO label_END_167 +j label_END_167 +label_TRUE_166: + # LOCAL local_neighbors_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -40($fp) + label_END_167: +# LOCAL local_neighbors_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_9 --> -40($fp) +# Obtain value from -40($fp) +lw $v0, -40($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_163 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_163 +lw $t0, -32($fp) +beq $t0, 0, label_FALSEIF_163 +# LOCAL local_neighbors_at_CellularAutomaton_internal_15 --> -64($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -64($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_15 --> -64($fp) +# local_neighbors_at_CellularAutomaton_internal_8 = local_neighbors_at_CellularAutomaton_internal_15 +lw $t0, -64($fp) +sw $t0, -36($fp) +# GOTO label_ENDIF_164 +j label_ENDIF_164 +label_FALSEIF_163: + # LOCAL local_neighbors_at_CellularAutomaton_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -68($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_16 --> -68($fp) + # local_neighbors_at_CellularAutomaton_internal_8 = local_neighbors_at_CellularAutomaton_internal_16 + lw $t0, -68($fp) + sw $t0, -36($fp) + label_ENDIF_164: +# LOCAL local_neighbors_at_CellularAutomaton_internal_23 --> -96($fp) +# local_neighbors_at_CellularAutomaton_internal_23 = SELF +sw $s1, -96($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_21 --> -88($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_23 --> -96($fp) +# local_neighbors_at_CellularAutomaton_internal_21 = local_neighbors_at_CellularAutomaton_internal_23 +lw $t0, -96($fp) +sw $t0, -88($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_21 --> -88($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) +# local_neighbors_at_CellularAutomaton_internal_22 = VCALL local_neighbors_at_CellularAutomaton_internal_21 south +# Save new self pointer in $s1 +lw $s1, -88($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 120($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -92($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_22 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -100($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_22 GOTO label_FALSE_175 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_22 GOTO label_FALSE_175 +lw $t0, -92($fp) +beq $t0, 0, label_FALSE_175 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_24 GOTO label_FALSE_175 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_24 GOTO label_FALSE_175 +lw $t0, -100($fp) +beq $t0, 0, label_FALSE_175 +# LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) +# Comparing -92($fp) type with String +la $v0, String +lw $a0, -92($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -84($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_COMPARE_STRING_178 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_COMPARE_STRING_178 +lw $t0, -84($fp) +beq $t0, 0, label_COMPARE_STRING_178 +# LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) +# Comparing -92($fp) type with Bool +la $v0, Bool +lw $a0, -92($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -84($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_179 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_179 +lw $t0, -84($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_179 +# LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) +# Comparing -92($fp) type with Int +la $v0, Int +lw $a0, -92($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -84($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_179 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_179 +lw $t0, -84($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_179 +# LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) +# Load pointers and SUB +lw $a0, -92($fp) +lw $a1, -100($fp) +sub $a0, $a0, $a1 +sw $a0, -84($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_176 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_176 +lw $t0, -84($fp) +beq $t0, 0, label_TRUE_176 +# GOTO label_FALSE_175 +j label_FALSE_175 +label_COMPARE_BY_VALUE_179: + # LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) + lw $a0, -92($fp) + lw $a1, -100($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -84($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_176 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_176 + lw $t0, -84($fp) + beq $t0, 0, label_TRUE_176 + # GOTO label_FALSE_175 + j label_FALSE_175 + label_COMPARE_STRING_178: + # LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) + # Load strings for comparison + lw $v0, -92($fp) + lw $v1, -100($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -84($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_CONTINUE_180 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_CONTINUE_180 + lw $t0, -84($fp) + beq $t0, 0, label_CONTINUE_180 + # GOTO label_FALSE_175 + j label_FALSE_175 + label_CONTINUE_180: + # LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -92($fp) + lw $v1, -100($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_181: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_182 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_181 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_182: + # Store result + sw $a2, -84($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_176 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_176 + lw $t0, -84($fp) + beq $t0, 0, label_TRUE_176 + label_FALSE_175: + # LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -80($fp) + # GOTO label_END_177 +j label_END_177 +label_TRUE_176: + # LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -80($fp) + label_END_177: +# LOCAL local_neighbors_at_CellularAutomaton_internal_17 --> -72($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) +# Obtain value from -80($fp) +lw $v0, -80($fp) +lw $v0, 12($v0) +sw $v0, -72($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_173 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_173 +lw $t0, -72($fp) +beq $t0, 0, label_FALSEIF_173 +# LOCAL local_neighbors_at_CellularAutomaton_internal_25 --> -104($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -104($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_18 --> -76($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_25 --> -104($fp) +# local_neighbors_at_CellularAutomaton_internal_18 = local_neighbors_at_CellularAutomaton_internal_25 +lw $t0, -104($fp) +sw $t0, -76($fp) +# GOTO label_ENDIF_174 +j label_ENDIF_174 +label_FALSEIF_173: + # LOCAL local_neighbors_at_CellularAutomaton_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -108($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_18 --> -76($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_26 --> -108($fp) + # local_neighbors_at_CellularAutomaton_internal_18 = local_neighbors_at_CellularAutomaton_internal_26 + lw $t0, -108($fp) + sw $t0, -76($fp) + label_ENDIF_174: +# LOCAL local_neighbors_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_18 --> -76($fp) +# local_neighbors_at_CellularAutomaton_internal_6 = local_neighbors_at_CellularAutomaton_internal_8 + local_neighbors_at_CellularAutomaton_internal_18 +lw $t1, -36($fp) +lw $t0, 12($t1) +lw $t1, -76($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -28($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_33 --> -136($fp) +# local_neighbors_at_CellularAutomaton_internal_33 = SELF +sw $s1, -136($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_31 --> -128($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_33 --> -136($fp) +# local_neighbors_at_CellularAutomaton_internal_31 = local_neighbors_at_CellularAutomaton_internal_33 +lw $t0, -136($fp) +sw $t0, -128($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_31 --> -128($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) +# local_neighbors_at_CellularAutomaton_internal_32 = VCALL local_neighbors_at_CellularAutomaton_internal_31 east +# Save new self pointer in $s1 +lw $s1, -128($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -132($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_23 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -140($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_FALSE_185 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_FALSE_185 +lw $t0, -132($fp) +beq $t0, 0, label_FALSE_185 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_34 GOTO label_FALSE_185 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_34 GOTO label_FALSE_185 +lw $t0, -140($fp) +beq $t0, 0, label_FALSE_185 +# LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) +# Comparing -132($fp) type with String +la $v0, String +lw $a0, -132($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -124($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_COMPARE_STRING_188 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_COMPARE_STRING_188 +lw $t0, -124($fp) +beq $t0, 0, label_COMPARE_STRING_188 +# LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) +# Comparing -132($fp) type with Bool +la $v0, Bool +lw $a0, -132($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -124($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_COMPARE_BY_VALUE_189 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_COMPARE_BY_VALUE_189 +lw $t0, -124($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_189 +# LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) +# Comparing -132($fp) type with Int +la $v0, Int +lw $a0, -132($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -124($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_COMPARE_BY_VALUE_189 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_COMPARE_BY_VALUE_189 +lw $t0, -124($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_189 +# LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) +# Load pointers and SUB +lw $a0, -132($fp) +lw $a1, -140($fp) +sub $a0, $a0, $a1 +sw $a0, -124($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_TRUE_186 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_TRUE_186 +lw $t0, -124($fp) +beq $t0, 0, label_TRUE_186 +# GOTO label_FALSE_185 +j label_FALSE_185 +label_COMPARE_BY_VALUE_189: + # LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) + lw $a0, -132($fp) + lw $a1, -140($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -124($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_TRUE_186 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_TRUE_186 + lw $t0, -124($fp) + beq $t0, 0, label_TRUE_186 + # GOTO label_FALSE_185 + j label_FALSE_185 + label_COMPARE_STRING_188: + # LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) + # Load strings for comparison + lw $v0, -132($fp) + lw $v1, -140($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -124($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_CONTINUE_190 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_CONTINUE_190 + lw $t0, -124($fp) + beq $t0, 0, label_CONTINUE_190 + # GOTO label_FALSE_185 + j label_FALSE_185 + label_CONTINUE_190: + # LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -132($fp) + lw $v1, -140($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_191: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_192 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_191 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_192: + # Store result + sw $a2, -124($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_TRUE_186 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_TRUE_186 + lw $t0, -124($fp) + beq $t0, 0, label_TRUE_186 + label_FALSE_185: + # LOCAL local_neighbors_at_CellularAutomaton_internal_29 --> -120($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -120($fp) + # GOTO label_END_187 +j label_END_187 +label_TRUE_186: + # LOCAL local_neighbors_at_CellularAutomaton_internal_29 --> -120($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -120($fp) + label_END_187: +# LOCAL local_neighbors_at_CellularAutomaton_internal_27 --> -112($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_29 --> -120($fp) +# Obtain value from -120($fp) +lw $v0, -120($fp) +lw $v0, 12($v0) +sw $v0, -112($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_27 GOTO label_FALSEIF_183 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_27 GOTO label_FALSEIF_183 +lw $t0, -112($fp) +beq $t0, 0, label_FALSEIF_183 +# LOCAL local_neighbors_at_CellularAutomaton_internal_35 --> -144($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -144($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_28 --> -116($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_35 --> -144($fp) +# local_neighbors_at_CellularAutomaton_internal_28 = local_neighbors_at_CellularAutomaton_internal_35 +lw $t0, -144($fp) +sw $t0, -116($fp) +# GOTO label_ENDIF_184 +j label_ENDIF_184 +label_FALSEIF_183: + # LOCAL local_neighbors_at_CellularAutomaton_internal_36 --> -148($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -148($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_28 --> -116($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_36 --> -148($fp) + # local_neighbors_at_CellularAutomaton_internal_28 = local_neighbors_at_CellularAutomaton_internal_36 + lw $t0, -148($fp) + sw $t0, -116($fp) + label_ENDIF_184: +# LOCAL local_neighbors_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_28 --> -116($fp) +# local_neighbors_at_CellularAutomaton_internal_5 = local_neighbors_at_CellularAutomaton_internal_6 + local_neighbors_at_CellularAutomaton_internal_28 +lw $t1, -28($fp) +lw $t0, 12($t1) +lw $t1, -116($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -24($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_43 --> -176($fp) +# local_neighbors_at_CellularAutomaton_internal_43 = SELF +sw $s1, -176($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_41 --> -168($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_43 --> -176($fp) +# local_neighbors_at_CellularAutomaton_internal_41 = local_neighbors_at_CellularAutomaton_internal_43 +lw $t0, -176($fp) +sw $t0, -168($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_41 --> -168($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) +# local_neighbors_at_CellularAutomaton_internal_42 = VCALL local_neighbors_at_CellularAutomaton_internal_41 west +# Save new self pointer in $s1 +lw $s1, -168($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 76($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -172($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_24 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -180($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_42 GOTO label_FALSE_195 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_42 GOTO label_FALSE_195 +lw $t0, -172($fp) +beq $t0, 0, label_FALSE_195 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_FALSE_195 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_FALSE_195 +lw $t0, -180($fp) +beq $t0, 0, label_FALSE_195 +# LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) +# Comparing -172($fp) type with String +la $v0, String +lw $a0, -172($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -164($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_COMPARE_STRING_198 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_COMPARE_STRING_198 +lw $t0, -164($fp) +beq $t0, 0, label_COMPARE_STRING_198 +# LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) +# Comparing -172($fp) type with Bool +la $v0, Bool +lw $a0, -172($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -164($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_COMPARE_BY_VALUE_199 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_COMPARE_BY_VALUE_199 +lw $t0, -164($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_199 +# LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) +# Comparing -172($fp) type with Int +la $v0, Int +lw $a0, -172($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -164($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_COMPARE_BY_VALUE_199 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_COMPARE_BY_VALUE_199 +lw $t0, -164($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_199 +# LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) +# Load pointers and SUB +lw $a0, -172($fp) +lw $a1, -180($fp) +sub $a0, $a0, $a1 +sw $a0, -164($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_TRUE_196 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_TRUE_196 +lw $t0, -164($fp) +beq $t0, 0, label_TRUE_196 +# GOTO label_FALSE_195 +j label_FALSE_195 +label_COMPARE_BY_VALUE_199: + # LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) + lw $a0, -172($fp) + lw $a1, -180($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -164($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_TRUE_196 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_TRUE_196 + lw $t0, -164($fp) + beq $t0, 0, label_TRUE_196 + # GOTO label_FALSE_195 + j label_FALSE_195 + label_COMPARE_STRING_198: + # LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) + # Load strings for comparison + lw $v0, -172($fp) + lw $v1, -180($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -164($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_CONTINUE_200 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_CONTINUE_200 + lw $t0, -164($fp) + beq $t0, 0, label_CONTINUE_200 + # GOTO label_FALSE_195 + j label_FALSE_195 + label_CONTINUE_200: + # LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -172($fp) + lw $v1, -180($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_201: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_202 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_201 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_202: + # Store result + sw $a2, -164($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_TRUE_196 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_TRUE_196 + lw $t0, -164($fp) + beq $t0, 0, label_TRUE_196 + label_FALSE_195: + # LOCAL local_neighbors_at_CellularAutomaton_internal_39 --> -160($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -160($fp) + # GOTO label_END_197 +j label_END_197 +label_TRUE_196: + # LOCAL local_neighbors_at_CellularAutomaton_internal_39 --> -160($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -160($fp) + label_END_197: +# LOCAL local_neighbors_at_CellularAutomaton_internal_37 --> -152($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_39 --> -160($fp) +# Obtain value from -160($fp) +lw $v0, -160($fp) +lw $v0, 12($v0) +sw $v0, -152($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_37 GOTO label_FALSEIF_193 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_37 GOTO label_FALSEIF_193 +lw $t0, -152($fp) +beq $t0, 0, label_FALSEIF_193 +# LOCAL local_neighbors_at_CellularAutomaton_internal_45 --> -184($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -184($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_45 --> -184($fp) +# local_neighbors_at_CellularAutomaton_internal_38 = local_neighbors_at_CellularAutomaton_internal_45 +lw $t0, -184($fp) +sw $t0, -156($fp) +# GOTO label_ENDIF_194 +j label_ENDIF_194 +label_FALSEIF_193: + # LOCAL local_neighbors_at_CellularAutomaton_internal_46 --> -188($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -188($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_46 --> -188($fp) + # local_neighbors_at_CellularAutomaton_internal_38 = local_neighbors_at_CellularAutomaton_internal_46 + lw $t0, -188($fp) + sw $t0, -156($fp) + label_ENDIF_194: +# LOCAL local_neighbors_at_CellularAutomaton_internal_4 --> -20($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) +# local_neighbors_at_CellularAutomaton_internal_4 = local_neighbors_at_CellularAutomaton_internal_5 + local_neighbors_at_CellularAutomaton_internal_38 +lw $t1, -24($fp) +lw $t0, 12($t1) +lw $t1, -156($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -20($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_53 --> -216($fp) +# local_neighbors_at_CellularAutomaton_internal_53 = SELF +sw $s1, -216($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_51 --> -208($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_53 --> -216($fp) +# local_neighbors_at_CellularAutomaton_internal_51 = local_neighbors_at_CellularAutomaton_internal_53 +lw $t0, -216($fp) +sw $t0, -208($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_51 --> -208($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) +# local_neighbors_at_CellularAutomaton_internal_52 = VCALL local_neighbors_at_CellularAutomaton_internal_51 northeast +# Save new self pointer in $s1 +lw $s1, -208($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 8($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -212($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_25 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -220($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_52 GOTO label_FALSE_205 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_52 GOTO label_FALSE_205 +lw $t0, -212($fp) +beq $t0, 0, label_FALSE_205 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_54 GOTO label_FALSE_205 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_54 GOTO label_FALSE_205 +lw $t0, -220($fp) +beq $t0, 0, label_FALSE_205 +# LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) +# Comparing -212($fp) type with String +la $v0, String +lw $a0, -212($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -204($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_COMPARE_STRING_208 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_COMPARE_STRING_208 +lw $t0, -204($fp) +beq $t0, 0, label_COMPARE_STRING_208 +# LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) +# Comparing -212($fp) type with Bool +la $v0, Bool +lw $a0, -212($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -204($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_COMPARE_BY_VALUE_209 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_COMPARE_BY_VALUE_209 +lw $t0, -204($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_209 +# LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) +# Comparing -212($fp) type with Int +la $v0, Int +lw $a0, -212($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -204($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_COMPARE_BY_VALUE_209 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_COMPARE_BY_VALUE_209 +lw $t0, -204($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_209 +# LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) +# Load pointers and SUB +lw $a0, -212($fp) +lw $a1, -220($fp) +sub $a0, $a0, $a1 +sw $a0, -204($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_206 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_206 +lw $t0, -204($fp) +beq $t0, 0, label_TRUE_206 +# GOTO label_FALSE_205 +j label_FALSE_205 +label_COMPARE_BY_VALUE_209: + # LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) + lw $a0, -212($fp) + lw $a1, -220($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -204($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_206 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_206 + lw $t0, -204($fp) + beq $t0, 0, label_TRUE_206 + # GOTO label_FALSE_205 + j label_FALSE_205 + label_COMPARE_STRING_208: + # LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) + # Load strings for comparison + lw $v0, -212($fp) + lw $v1, -220($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -204($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_CONTINUE_210 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_CONTINUE_210 + lw $t0, -204($fp) + beq $t0, 0, label_CONTINUE_210 + # GOTO label_FALSE_205 + j label_FALSE_205 + label_CONTINUE_210: + # LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -212($fp) + lw $v1, -220($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_211: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_212 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_211 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_212: + # Store result + sw $a2, -204($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_206 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_206 + lw $t0, -204($fp) + beq $t0, 0, label_TRUE_206 + label_FALSE_205: + # LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -200($fp) + # GOTO label_END_207 +j label_END_207 +label_TRUE_206: + # LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -200($fp) + label_END_207: +# LOCAL local_neighbors_at_CellularAutomaton_internal_47 --> -192($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) +# Obtain value from -200($fp) +lw $v0, -200($fp) +lw $v0, 12($v0) +sw $v0, -192($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_47 GOTO label_FALSEIF_203 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_47 GOTO label_FALSEIF_203 +lw $t0, -192($fp) +beq $t0, 0, label_FALSEIF_203 +# LOCAL local_neighbors_at_CellularAutomaton_internal_55 --> -224($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -224($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_48 --> -196($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_55 --> -224($fp) +# local_neighbors_at_CellularAutomaton_internal_48 = local_neighbors_at_CellularAutomaton_internal_55 +lw $t0, -224($fp) +sw $t0, -196($fp) +# GOTO label_ENDIF_204 +j label_ENDIF_204 +label_FALSEIF_203: + # LOCAL local_neighbors_at_CellularAutomaton_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -228($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_48 --> -196($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_56 --> -228($fp) + # local_neighbors_at_CellularAutomaton_internal_48 = local_neighbors_at_CellularAutomaton_internal_56 + lw $t0, -228($fp) + sw $t0, -196($fp) + label_ENDIF_204: +# LOCAL local_neighbors_at_CellularAutomaton_internal_3 --> -16($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_4 --> -20($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_48 --> -196($fp) +# local_neighbors_at_CellularAutomaton_internal_3 = local_neighbors_at_CellularAutomaton_internal_4 + local_neighbors_at_CellularAutomaton_internal_48 +lw $t1, -20($fp) +lw $t0, 12($t1) +lw $t1, -196($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -16($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_63 --> -256($fp) +# local_neighbors_at_CellularAutomaton_internal_63 = SELF +sw $s1, -256($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_61 --> -248($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_63 --> -256($fp) +# local_neighbors_at_CellularAutomaton_internal_61 = local_neighbors_at_CellularAutomaton_internal_63 +lw $t0, -256($fp) +sw $t0, -248($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_61 --> -248($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) +# local_neighbors_at_CellularAutomaton_internal_62 = VCALL local_neighbors_at_CellularAutomaton_internal_61 northwest +# Save new self pointer in $s1 +lw $s1, -248($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 36($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -252($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_64 --> -260($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_26 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -260($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_62 GOTO label_FALSE_215 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_62 GOTO label_FALSE_215 +lw $t0, -252($fp) +beq $t0, 0, label_FALSE_215 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_64 GOTO label_FALSE_215 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_64 GOTO label_FALSE_215 +lw $t0, -260($fp) +beq $t0, 0, label_FALSE_215 +# LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) +# Comparing -252($fp) type with String +la $v0, String +lw $a0, -252($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -244($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_COMPARE_STRING_218 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_COMPARE_STRING_218 +lw $t0, -244($fp) +beq $t0, 0, label_COMPARE_STRING_218 +# LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) +# Comparing -252($fp) type with Bool +la $v0, Bool +lw $a0, -252($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -244($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_COMPARE_BY_VALUE_219 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_COMPARE_BY_VALUE_219 +lw $t0, -244($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_219 +# LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) +# Comparing -252($fp) type with Int +la $v0, Int +lw $a0, -252($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -244($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_COMPARE_BY_VALUE_219 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_COMPARE_BY_VALUE_219 +lw $t0, -244($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_219 +# LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_64 --> -260($fp) +# Load pointers and SUB +lw $a0, -252($fp) +lw $a1, -260($fp) +sub $a0, $a0, $a1 +sw $a0, -244($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_TRUE_216 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_TRUE_216 +lw $t0, -244($fp) +beq $t0, 0, label_TRUE_216 +# GOTO label_FALSE_215 +j label_FALSE_215 +label_COMPARE_BY_VALUE_219: + # LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_64 --> -260($fp) + lw $a0, -252($fp) + lw $a1, -260($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -244($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_TRUE_216 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_TRUE_216 + lw $t0, -244($fp) + beq $t0, 0, label_TRUE_216 + # GOTO label_FALSE_215 + j label_FALSE_215 + label_COMPARE_STRING_218: + # LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_64 --> -260($fp) + # Load strings for comparison + lw $v0, -252($fp) + lw $v1, -260($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -244($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_CONTINUE_220 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_CONTINUE_220 + lw $t0, -244($fp) + beq $t0, 0, label_CONTINUE_220 + # GOTO label_FALSE_215 + j label_FALSE_215 + label_CONTINUE_220: + # LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_64 --> -260($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -252($fp) + lw $v1, -260($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_221: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_222 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_221 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_222: + # Store result + sw $a2, -244($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_TRUE_216 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_TRUE_216 + lw $t0, -244($fp) + beq $t0, 0, label_TRUE_216 + label_FALSE_215: + # LOCAL local_neighbors_at_CellularAutomaton_internal_59 --> -240($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -240($fp) + # GOTO label_END_217 +j label_END_217 +label_TRUE_216: + # LOCAL local_neighbors_at_CellularAutomaton_internal_59 --> -240($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -240($fp) + label_END_217: +# LOCAL local_neighbors_at_CellularAutomaton_internal_57 --> -232($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_59 --> -240($fp) +# Obtain value from -240($fp) +lw $v0, -240($fp) +lw $v0, 12($v0) +sw $v0, -232($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_57 GOTO label_FALSEIF_213 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_57 GOTO label_FALSEIF_213 +lw $t0, -232($fp) +beq $t0, 0, label_FALSEIF_213 +# LOCAL local_neighbors_at_CellularAutomaton_internal_65 --> -264($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -264($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_58 --> -236($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_65 --> -264($fp) +# local_neighbors_at_CellularAutomaton_internal_58 = local_neighbors_at_CellularAutomaton_internal_65 +lw $t0, -264($fp) +sw $t0, -236($fp) +# GOTO label_ENDIF_214 +j label_ENDIF_214 +label_FALSEIF_213: + # LOCAL local_neighbors_at_CellularAutomaton_internal_66 --> -268($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -268($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_58 --> -236($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_66 --> -268($fp) + # local_neighbors_at_CellularAutomaton_internal_58 = local_neighbors_at_CellularAutomaton_internal_66 + lw $t0, -268($fp) + sw $t0, -236($fp) + label_ENDIF_214: +# LOCAL local_neighbors_at_CellularAutomaton_internal_2 --> -12($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_3 --> -16($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_58 --> -236($fp) +# local_neighbors_at_CellularAutomaton_internal_2 = local_neighbors_at_CellularAutomaton_internal_3 + local_neighbors_at_CellularAutomaton_internal_58 +lw $t1, -16($fp) +lw $t0, 12($t1) +lw $t1, -236($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -12($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_73 --> -296($fp) +# local_neighbors_at_CellularAutomaton_internal_73 = SELF +sw $s1, -296($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_71 --> -288($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_73 --> -296($fp) +# local_neighbors_at_CellularAutomaton_internal_71 = local_neighbors_at_CellularAutomaton_internal_73 +lw $t0, -296($fp) +sw $t0, -288($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_71 --> -288($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) +# local_neighbors_at_CellularAutomaton_internal_72 = VCALL local_neighbors_at_CellularAutomaton_internal_71 southeast +# Save new self pointer in $s1 +lw $s1, -288($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 64($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -292($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_74 --> -300($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_27 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -300($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_72 GOTO label_FALSE_225 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_72 GOTO label_FALSE_225 +lw $t0, -292($fp) +beq $t0, 0, label_FALSE_225 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_74 GOTO label_FALSE_225 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_74 GOTO label_FALSE_225 +lw $t0, -300($fp) +beq $t0, 0, label_FALSE_225 +# LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) +# Comparing -292($fp) type with String +la $v0, String +lw $a0, -292($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -284($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_COMPARE_STRING_228 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_COMPARE_STRING_228 +lw $t0, -284($fp) +beq $t0, 0, label_COMPARE_STRING_228 +# LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) +# Comparing -292($fp) type with Bool +la $v0, Bool +lw $a0, -292($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -284($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_COMPARE_BY_VALUE_229 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_COMPARE_BY_VALUE_229 +lw $t0, -284($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_229 +# LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) +# Comparing -292($fp) type with Int +la $v0, Int +lw $a0, -292($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -284($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_COMPARE_BY_VALUE_229 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_COMPARE_BY_VALUE_229 +lw $t0, -284($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_229 +# LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_74 --> -300($fp) +# Load pointers and SUB +lw $a0, -292($fp) +lw $a1, -300($fp) +sub $a0, $a0, $a1 +sw $a0, -284($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_TRUE_226 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_TRUE_226 +lw $t0, -284($fp) +beq $t0, 0, label_TRUE_226 +# GOTO label_FALSE_225 +j label_FALSE_225 +label_COMPARE_BY_VALUE_229: + # LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_74 --> -300($fp) + lw $a0, -292($fp) + lw $a1, -300($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -284($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_TRUE_226 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_TRUE_226 + lw $t0, -284($fp) + beq $t0, 0, label_TRUE_226 + # GOTO label_FALSE_225 + j label_FALSE_225 + label_COMPARE_STRING_228: + # LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_74 --> -300($fp) + # Load strings for comparison + lw $v0, -292($fp) + lw $v1, -300($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -284($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_CONTINUE_230 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_CONTINUE_230 + lw $t0, -284($fp) + beq $t0, 0, label_CONTINUE_230 + # GOTO label_FALSE_225 + j label_FALSE_225 + label_CONTINUE_230: + # LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_74 --> -300($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -292($fp) + lw $v1, -300($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_231: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_232 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_231 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_232: + # Store result + sw $a2, -284($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_TRUE_226 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_TRUE_226 + lw $t0, -284($fp) + beq $t0, 0, label_TRUE_226 + label_FALSE_225: + # LOCAL local_neighbors_at_CellularAutomaton_internal_69 --> -280($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -280($fp) + # GOTO label_END_227 +j label_END_227 +label_TRUE_226: + # LOCAL local_neighbors_at_CellularAutomaton_internal_69 --> -280($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -280($fp) + label_END_227: +# LOCAL local_neighbors_at_CellularAutomaton_internal_67 --> -272($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_69 --> -280($fp) +# Obtain value from -280($fp) +lw $v0, -280($fp) +lw $v0, 12($v0) +sw $v0, -272($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_67 GOTO label_FALSEIF_223 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_67 GOTO label_FALSEIF_223 +lw $t0, -272($fp) +beq $t0, 0, label_FALSEIF_223 +# LOCAL local_neighbors_at_CellularAutomaton_internal_75 --> -304($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -304($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_68 --> -276($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_75 --> -304($fp) +# local_neighbors_at_CellularAutomaton_internal_68 = local_neighbors_at_CellularAutomaton_internal_75 +lw $t0, -304($fp) +sw $t0, -276($fp) +# GOTO label_ENDIF_224 +j label_ENDIF_224 +label_FALSEIF_223: + # LOCAL local_neighbors_at_CellularAutomaton_internal_76 --> -308($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -308($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_68 --> -276($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_76 --> -308($fp) + # local_neighbors_at_CellularAutomaton_internal_68 = local_neighbors_at_CellularAutomaton_internal_76 + lw $t0, -308($fp) + sw $t0, -276($fp) + label_ENDIF_224: +# LOCAL local_neighbors_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_2 --> -12($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_68 --> -276($fp) +# local_neighbors_at_CellularAutomaton_internal_1 = local_neighbors_at_CellularAutomaton_internal_2 + local_neighbors_at_CellularAutomaton_internal_68 +lw $t1, -12($fp) +lw $t0, 12($t1) +lw $t1, -276($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -8($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_83 --> -336($fp) +# local_neighbors_at_CellularAutomaton_internal_83 = SELF +sw $s1, -336($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_81 --> -328($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_83 --> -336($fp) +# local_neighbors_at_CellularAutomaton_internal_81 = local_neighbors_at_CellularAutomaton_internal_83 +lw $t0, -336($fp) +sw $t0, -328($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_81 --> -328($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) +# local_neighbors_at_CellularAutomaton_internal_82 = VCALL local_neighbors_at_CellularAutomaton_internal_81 southwest +# Save new self pointer in $s1 +lw $s1, -328($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 40($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -332($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_84 --> -340($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_28 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -340($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_82 GOTO label_FALSE_235 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_82 GOTO label_FALSE_235 +lw $t0, -332($fp) +beq $t0, 0, label_FALSE_235 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_84 GOTO label_FALSE_235 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_84 GOTO label_FALSE_235 +lw $t0, -340($fp) +beq $t0, 0, label_FALSE_235 +# LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) +# Comparing -332($fp) type with String +la $v0, String +lw $a0, -332($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -324($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_COMPARE_STRING_238 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_COMPARE_STRING_238 +lw $t0, -324($fp) +beq $t0, 0, label_COMPARE_STRING_238 +# LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) +# Comparing -332($fp) type with Bool +la $v0, Bool +lw $a0, -332($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -324($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_COMPARE_BY_VALUE_239 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_COMPARE_BY_VALUE_239 +lw $t0, -324($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_239 +# LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) +# Comparing -332($fp) type with Int +la $v0, Int +lw $a0, -332($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -324($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_COMPARE_BY_VALUE_239 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_COMPARE_BY_VALUE_239 +lw $t0, -324($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_239 +# LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_84 --> -340($fp) +# Load pointers and SUB +lw $a0, -332($fp) +lw $a1, -340($fp) +sub $a0, $a0, $a1 +sw $a0, -324($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_TRUE_236 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_TRUE_236 +lw $t0, -324($fp) +beq $t0, 0, label_TRUE_236 +# GOTO label_FALSE_235 +j label_FALSE_235 +label_COMPARE_BY_VALUE_239: + # LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_84 --> -340($fp) + lw $a0, -332($fp) + lw $a1, -340($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -324($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_TRUE_236 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_TRUE_236 + lw $t0, -324($fp) + beq $t0, 0, label_TRUE_236 + # GOTO label_FALSE_235 + j label_FALSE_235 + label_COMPARE_STRING_238: + # LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_84 --> -340($fp) + # Load strings for comparison + lw $v0, -332($fp) + lw $v1, -340($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -324($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_CONTINUE_240 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_CONTINUE_240 + lw $t0, -324($fp) + beq $t0, 0, label_CONTINUE_240 + # GOTO label_FALSE_235 + j label_FALSE_235 + label_CONTINUE_240: + # LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_84 --> -340($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -332($fp) + lw $v1, -340($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_241: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_242 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_241 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_242: + # Store result + sw $a2, -324($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_TRUE_236 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_TRUE_236 + lw $t0, -324($fp) + beq $t0, 0, label_TRUE_236 + label_FALSE_235: + # LOCAL local_neighbors_at_CellularAutomaton_internal_79 --> -320($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -320($fp) + # GOTO label_END_237 +j label_END_237 +label_TRUE_236: + # LOCAL local_neighbors_at_CellularAutomaton_internal_79 --> -320($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -320($fp) + label_END_237: +# LOCAL local_neighbors_at_CellularAutomaton_internal_77 --> -312($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_79 --> -320($fp) +# Obtain value from -320($fp) +lw $v0, -320($fp) +lw $v0, 12($v0) +sw $v0, -312($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_77 GOTO label_FALSEIF_233 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_77 GOTO label_FALSEIF_233 +lw $t0, -312($fp) +beq $t0, 0, label_FALSEIF_233 +# LOCAL local_neighbors_at_CellularAutomaton_internal_85 --> -344($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -344($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_78 --> -316($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_85 --> -344($fp) +# local_neighbors_at_CellularAutomaton_internal_78 = local_neighbors_at_CellularAutomaton_internal_85 +lw $t0, -344($fp) +sw $t0, -316($fp) +# GOTO label_ENDIF_234 +j label_ENDIF_234 +label_FALSEIF_233: + # LOCAL local_neighbors_at_CellularAutomaton_internal_86 --> -348($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -348($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_78 --> -316($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_86 --> -348($fp) + # local_neighbors_at_CellularAutomaton_internal_78 = local_neighbors_at_CellularAutomaton_internal_86 + lw $t0, -348($fp) + sw $t0, -316($fp) + label_ENDIF_234: +# LOCAL local_neighbors_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_78 --> -316($fp) +# local_neighbors_at_CellularAutomaton_internal_0 = local_neighbors_at_CellularAutomaton_internal_1 + local_neighbors_at_CellularAutomaton_internal_78 +lw $t1, -8($fp) +lw $t0, 12($t1) +lw $t1, -316($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -4($fp) +# RETURN local_neighbors_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_neighbors_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 356 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_cell_at_next_evolution_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_cell_at_next_evolution_at_CellularAutomaton_position_0 +function_cell_at_next_evolution_at_CellularAutomaton: + # Allocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. + subu $sp, $sp, 120 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 120 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_4 = local_cell_at_next_evolution_at_CellularAutomaton_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 + # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_5 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 neighbors + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 84($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 3 + sw $t0, 12($v0) + sw $v0, -32($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_5 GOTO label_FALSE_245 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_5 GOTO label_FALSE_245 + lw $t0, -24($fp) + beq $t0, 0, label_FALSE_245 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_FALSE_245 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_FALSE_245 + lw $t0, -32($fp) + beq $t0, 0, label_FALSE_245 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) + # Comparing -24($fp) type with String + la $v0, String + lw $a0, -24($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_248 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_248 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_248 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) + # Comparing -24($fp) type with Bool + la $v0, Bool + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_249 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_249 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_249 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) + # Comparing -24($fp) type with Int + la $v0, Int + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_249 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_249 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_249 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + # Load pointers and SUB + lw $a0, -24($fp) + lw $a1, -32($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_246 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_246 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_246 + # GOTO label_FALSE_245 + j label_FALSE_245 + label_COMPARE_BY_VALUE_249: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + lw $a0, -24($fp) + lw $a1, -32($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_246 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_246 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_246 + # GOTO label_FALSE_245 + j label_FALSE_245 + label_COMPARE_STRING_248: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -32($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_250 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_250 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_250 + # GOTO label_FALSE_245 + j label_FALSE_245 + label_CONTINUE_250: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -32($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_251: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_252 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_251 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_252: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_246 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_246 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_246 + label_FALSE_245: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_247 +j label_END_247 +label_TRUE_246: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_247: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_243 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_243 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_243 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_29 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -36($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = local_cell_at_next_evolution_at_CellularAutomaton_internal_8 +lw $t0, -36($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_244 +j label_ENDIF_244 +label_FALSEIF_243: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_13 = local_cell_at_next_evolution_at_CellularAutomaton_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 + # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_14 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 neighbors + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 84($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 2 + sw $t0, 12($v0) + sw $v0, -68($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_14 GOTO label_FALSE_255 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_14 GOTO label_FALSE_255 + lw $t0, -60($fp) + beq $t0, 0, label_FALSE_255 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_16 GOTO label_FALSE_255 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_16 GOTO label_FALSE_255 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_255 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) + # Comparing -60($fp) type with String + la $v0, String + lw $a0, -60($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -52($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_COMPARE_STRING_258 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_COMPARE_STRING_258 + lw $t0, -52($fp) + beq $t0, 0, label_COMPARE_STRING_258 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) + # Comparing -60($fp) type with Bool + la $v0, Bool + lw $a0, -60($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -52($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_COMPARE_BY_VALUE_259 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_COMPARE_BY_VALUE_259 + lw $t0, -52($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_259 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) + # Comparing -60($fp) type with Int + la $v0, Int + lw $a0, -60($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -52($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_COMPARE_BY_VALUE_259 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_COMPARE_BY_VALUE_259 + lw $t0, -52($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_259 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, -60($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -52($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_256 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_256 + lw $t0, -52($fp) + beq $t0, 0, label_TRUE_256 + # GOTO label_FALSE_255 + j label_FALSE_255 + label_COMPARE_BY_VALUE_259: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) + lw $a0, -60($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -52($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_256 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_256 + lw $t0, -52($fp) + beq $t0, 0, label_TRUE_256 + # GOTO label_FALSE_255 + j label_FALSE_255 + label_COMPARE_STRING_258: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, -60($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -52($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_CONTINUE_260 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_CONTINUE_260 + lw $t0, -52($fp) + beq $t0, 0, label_CONTINUE_260 + # GOTO label_FALSE_255 + j label_FALSE_255 + label_CONTINUE_260: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -60($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_261: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_262 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_261 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_262: + # Store result + sw $a2, -52($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_256 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_256 + lw $t0, -52($fp) + beq $t0, 0, label_TRUE_256 + label_FALSE_255: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -48($fp) + # GOTO label_END_257 +j label_END_257 +label_TRUE_256: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -48($fp) + label_END_257: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) +# Obtain value from -48($fp) +lw $v0, -48($fp) +lw $v0, 12($v0) +sw $v0, -40($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_FALSEIF_253 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_FALSEIF_253 +lw $t0, -40($fp) +beq $t0, 0, label_FALSEIF_253 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_23 = SELF +sw $s1, -96($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_21 = local_cell_at_next_evolution_at_CellularAutomaton_internal_23 +lw $t0, -96($fp) +sw $t0, -88($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 +# PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_22 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 cell +# Save new self pointer in $s1 +lw $s1, -88($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 108($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -92($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_30 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -100($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_22 GOTO label_FALSE_265 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_22 GOTO label_FALSE_265 +lw $t0, -92($fp) +beq $t0, 0, label_FALSE_265 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_24 GOTO label_FALSE_265 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_24 GOTO label_FALSE_265 +lw $t0, -100($fp) +beq $t0, 0, label_FALSE_265 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) +# Comparing -92($fp) type with String +la $v0, String +lw $a0, -92($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -84($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_COMPARE_STRING_268 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_COMPARE_STRING_268 +lw $t0, -84($fp) +beq $t0, 0, label_COMPARE_STRING_268 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) +# Comparing -92($fp) type with Bool +la $v0, Bool +lw $a0, -92($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -84($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_269 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_269 +lw $t0, -84($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_269 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) +# Comparing -92($fp) type with Int +la $v0, Int +lw $a0, -92($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -84($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_269 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_269 +lw $t0, -84($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_269 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) +# Load pointers and SUB +lw $a0, -92($fp) +lw $a1, -100($fp) +sub $a0, $a0, $a1 +sw $a0, -84($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_TRUE_266 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_TRUE_266 +lw $t0, -84($fp) +beq $t0, 0, label_TRUE_266 +# GOTO label_FALSE_265 +j label_FALSE_265 +label_COMPARE_BY_VALUE_269: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) + lw $a0, -92($fp) + lw $a1, -100($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -84($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_TRUE_266 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_TRUE_266 + lw $t0, -84($fp) + beq $t0, 0, label_TRUE_266 + # GOTO label_FALSE_265 + j label_FALSE_265 + label_COMPARE_STRING_268: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) + # Load strings for comparison + lw $v0, -92($fp) + lw $v1, -100($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -84($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_CONTINUE_270 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_CONTINUE_270 + lw $t0, -84($fp) + beq $t0, 0, label_CONTINUE_270 + # GOTO label_FALSE_265 + j label_FALSE_265 + label_CONTINUE_270: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -92($fp) + lw $v1, -100($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_271: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_272 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_271 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_272: + # Store result + sw $a2, -84($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_TRUE_266 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_TRUE_266 + lw $t0, -84($fp) + beq $t0, 0, label_TRUE_266 + label_FALSE_265: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -80($fp) + # GOTO label_END_267 +j label_END_267 +label_TRUE_266: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -80($fp) + label_END_267: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) +# Obtain value from -80($fp) +lw $v0, -80($fp) +lw $v0, 12($v0) +sw $v0, -72($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_263 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_263 +lw $t0, -72($fp) +beq $t0, 0, label_FALSEIF_263 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_25 --> -104($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_31 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -104($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_25 --> -104($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_18 = local_cell_at_next_evolution_at_CellularAutomaton_internal_25 +lw $t0, -104($fp) +sw $t0, -76($fp) +# GOTO label_ENDIF_264 +j label_ENDIF_264 +label_FALSEIF_263: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_32 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -108($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_26 --> -108($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_18 = local_cell_at_next_evolution_at_CellularAutomaton_internal_26 + lw $t0, -108($fp) + sw $t0, -76($fp) + label_ENDIF_264: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_10 = local_cell_at_next_evolution_at_CellularAutomaton_internal_18 +lw $t0, -76($fp) +sw $t0, -44($fp) +# GOTO label_ENDIF_254 +j label_ENDIF_254 +label_FALSEIF_253: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_27 --> -112($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_33 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -112($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_27 --> -112($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_10 = local_cell_at_next_evolution_at_CellularAutomaton_internal_27 + lw $t0, -112($fp) + sw $t0, -44($fp) + label_ENDIF_254: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = local_cell_at_next_evolution_at_CellularAutomaton_internal_10 +lw $t0, -44($fp) +sw $t0, -8($fp) +label_ENDIF_244: +# RETURN local_cell_at_next_evolution_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 120 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_evolve_at_CellularAutomaton implementation. +# @Params: +function_evolve_at_CellularAutomaton: + # Allocate stack frame for function function_evolve_at_CellularAutomaton. + subu $sp, $sp, 76 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 76 + # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_1 --> -8($fp) + # local_evolve_at_CellularAutomaton_position_0 = local_evolve_at_CellularAutomaton_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_evolve_at_CellularAutomaton_num_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_5 --> -24($fp) + # local_evolve_at_CellularAutomaton_internal_5 = SELF + sw $s1, -24($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_5 --> -24($fp) + # local_evolve_at_CellularAutomaton_internal_3 = local_evolve_at_CellularAutomaton_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) + # local_evolve_at_CellularAutomaton_internal_4 = VCALL local_evolve_at_CellularAutomaton_internal_3 num_cells + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_evolve_at_CellularAutomaton_num_2 --> -12($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) + # local_evolve_at_CellularAutomaton_num_2 = local_evolve_at_CellularAutomaton_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # LOCAL local_evolve_at_CellularAutomaton_temp_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -28($fp) + label_WHILE_273: + # LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) + # LOCAL local_evolve_at_CellularAutomaton_num_2 --> -12($fp) + lw $a0, -4($fp) + lw $a1, -12($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -36($fp) + # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_8 GOTO label_FALSE_275 + # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_8 GOTO label_FALSE_275 + lw $t0, -36($fp) + bgt $t0, 0, label_FALSE_275 + # IF_ZERO local_evolve_at_CellularAutomaton_internal_8 GOTO label_FALSE_275 + # IF_ZERO local_evolve_at_CellularAutomaton_internal_8 GOTO label_FALSE_275 + lw $t0, -36($fp) + beq $t0, 0, label_FALSE_275 + # LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_276 +j label_END_276 +label_FALSE_275: + # LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_276: +# LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_evolve_at_CellularAutomaton_internal_7 GOTO label_WHILE_END_274 +# IF_ZERO local_evolve_at_CellularAutomaton_internal_7 GOTO label_WHILE_END_274 +lw $t0, -32($fp) +beq $t0, 0, label_WHILE_END_274 +# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) +# LOCAL local_evolve_at_CellularAutomaton_temp_6 --> -28($fp) +# local_evolve_at_CellularAutomaton_internal_9 = local_evolve_at_CellularAutomaton_temp_6 +lw $t0, -28($fp) +sw $t0, -40($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) +# local_evolve_at_CellularAutomaton_internal_13 = SELF +sw $s1, -56($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) +# local_evolve_at_CellularAutomaton_internal_11 = local_evolve_at_CellularAutomaton_internal_13 +lw $t0, -56($fp) +sw $t0, -48($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_evolve_at_CellularAutomaton_position_0 +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +lw $t0, -4($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) +# local_evolve_at_CellularAutomaton_internal_12 = VCALL local_evolve_at_CellularAutomaton_internal_11 cell_at_next_evolution +# Save new self pointer in $s1 +lw $s1, -48($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 24($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -52($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_evolve_at_CellularAutomaton_internal_12 +# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) +lw $t0, -52($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) +# local_evolve_at_CellularAutomaton_internal_10 = VCALL local_evolve_at_CellularAutomaton_internal_9 concat +# Save new self pointer in $s1 +lw $s1, -40($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 68($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -44($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_evolve_at_CellularAutomaton_temp_6 --> -28($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) +# local_evolve_at_CellularAutomaton_temp_6 = local_evolve_at_CellularAutomaton_internal_10 +lw $t0, -44($fp) +sw $t0, -28($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_15 --> -64($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -64($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_14 --> -60($fp) +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_15 --> -64($fp) +# local_evolve_at_CellularAutomaton_internal_14 = local_evolve_at_CellularAutomaton_position_0 + local_evolve_at_CellularAutomaton_internal_15 +lw $t1, -4($fp) +lw $t0, 12($t1) +lw $t1, -64($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -60($fp) +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_14 --> -60($fp) +# local_evolve_at_CellularAutomaton_position_0 = local_evolve_at_CellularAutomaton_internal_14 +lw $t0, -60($fp) +sw $t0, -4($fp) +# GOTO label_WHILE_273 +j label_WHILE_273 +label_WHILE_END_274: + # + # LOCAL local_evolve_at_CellularAutomaton_temp_6 --> -28($fp) + lw $t0, -28($fp) + sw $t0, 24($s1) + # LOCAL local_evolve_at_CellularAutomaton_internal_16 --> -68($fp) + # local_evolve_at_CellularAutomaton_internal_16 = SELF + sw $s1, -68($fp) + # RETURN local_evolve_at_CellularAutomaton_internal_16 + lw $v0, -68($fp) + # Deallocate stack frame for function function_evolve_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 76 + jr $ra + # Function END + + +# function_option_at_CellularAutomaton implementation. +# @Params: +function_option_at_CellularAutomaton: + # Allocate stack frame for function function_option_at_CellularAutomaton. + subu $sp, $sp, 916 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 916 + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_3 --> -16($fp) + # local_option_at_CellularAutomaton_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_option_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_option_at_CellularAutomaton_internal_3 --> -16($fp) + # local_option_at_CellularAutomaton_internal_1 = local_option_at_CellularAutomaton_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_34 + sw $t0, 12($v0) + li $t0, 24 + sw $t0, 16($v0) + sw $v0, -20($fp) + # ARG local_option_at_CellularAutomaton_internal_4 + # LOCAL local_option_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_option_at_CellularAutomaton_internal_2 --> -12($fp) + # local_option_at_CellularAutomaton_internal_2 = VCALL local_option_at_CellularAutomaton_internal_1 out_string + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_7 --> -32($fp) + # local_option_at_CellularAutomaton_internal_7 = SELF + sw $s1, -32($fp) + # LOCAL local_option_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_option_at_CellularAutomaton_internal_7 --> -32($fp) + # local_option_at_CellularAutomaton_internal_5 = local_option_at_CellularAutomaton_internal_7 + lw $t0, -32($fp) + sw $t0, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_35 + sw $t0, 12($v0) + li $t0, 13 + sw $t0, 16($v0) + sw $v0, -36($fp) + # ARG local_option_at_CellularAutomaton_internal_8 + # LOCAL local_option_at_CellularAutomaton_internal_8 --> -36($fp) + lw $t0, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_option_at_CellularAutomaton_internal_6 --> -28($fp) + # local_option_at_CellularAutomaton_internal_6 = VCALL local_option_at_CellularAutomaton_internal_5 out_string + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_11 --> -48($fp) + # local_option_at_CellularAutomaton_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_option_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_option_at_CellularAutomaton_internal_11 --> -48($fp) + # local_option_at_CellularAutomaton_internal_9 = local_option_at_CellularAutomaton_internal_11 + lw $t0, -48($fp) + sw $t0, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_36 + sw $t0, 12($v0) + li $t0, 48 + sw $t0, 16($v0) + sw $v0, -52($fp) + # ARG local_option_at_CellularAutomaton_internal_12 + # LOCAL local_option_at_CellularAutomaton_internal_12 --> -52($fp) + lw $t0, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_option_at_CellularAutomaton_internal_10 --> -44($fp) + # local_option_at_CellularAutomaton_internal_10 = VCALL local_option_at_CellularAutomaton_internal_9 out_string + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_15 --> -64($fp) + # local_option_at_CellularAutomaton_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_option_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_option_at_CellularAutomaton_internal_15 --> -64($fp) + # local_option_at_CellularAutomaton_internal_13 = local_option_at_CellularAutomaton_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_37 + sw $t0, 12($v0) + li $t0, 48 + sw $t0, 16($v0) + sw $v0, -68($fp) + # ARG local_option_at_CellularAutomaton_internal_16 + # LOCAL local_option_at_CellularAutomaton_internal_16 --> -68($fp) + lw $t0, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_option_at_CellularAutomaton_internal_14 --> -60($fp) + # local_option_at_CellularAutomaton_internal_14 = VCALL local_option_at_CellularAutomaton_internal_13 out_string + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_19 --> -80($fp) + # local_option_at_CellularAutomaton_internal_19 = SELF + sw $s1, -80($fp) + # LOCAL local_option_at_CellularAutomaton_internal_17 --> -72($fp) + # LOCAL local_option_at_CellularAutomaton_internal_19 --> -80($fp) + # local_option_at_CellularAutomaton_internal_17 = local_option_at_CellularAutomaton_internal_19 + lw $t0, -80($fp) + sw $t0, -72($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_38 + sw $t0, 12($v0) + li $t0, 10 + sw $t0, 16($v0) + sw $v0, -84($fp) + # ARG local_option_at_CellularAutomaton_internal_20 + # LOCAL local_option_at_CellularAutomaton_internal_20 --> -84($fp) + lw $t0, -84($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_17 --> -72($fp) + # LOCAL local_option_at_CellularAutomaton_internal_18 --> -76($fp) + # local_option_at_CellularAutomaton_internal_18 = VCALL local_option_at_CellularAutomaton_internal_17 out_string + # Save new self pointer in $s1 + lw $s1, -72($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -76($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_23 --> -96($fp) + # local_option_at_CellularAutomaton_internal_23 = SELF + sw $s1, -96($fp) + # LOCAL local_option_at_CellularAutomaton_internal_21 --> -88($fp) + # LOCAL local_option_at_CellularAutomaton_internal_23 --> -96($fp) + # local_option_at_CellularAutomaton_internal_21 = local_option_at_CellularAutomaton_internal_23 + lw $t0, -96($fp) + sw $t0, -88($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_24 --> -100($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_39 + sw $t0, 12($v0) + li $t0, 26 + sw $t0, 16($v0) + sw $v0, -100($fp) + # ARG local_option_at_CellularAutomaton_internal_24 + # LOCAL local_option_at_CellularAutomaton_internal_24 --> -100($fp) + lw $t0, -100($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_21 --> -88($fp) + # LOCAL local_option_at_CellularAutomaton_internal_22 --> -92($fp) + # local_option_at_CellularAutomaton_internal_22 = VCALL local_option_at_CellularAutomaton_internal_21 out_string + # Save new self pointer in $s1 + lw $s1, -88($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -92($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_27 --> -112($fp) + # local_option_at_CellularAutomaton_internal_27 = SELF + sw $s1, -112($fp) + # LOCAL local_option_at_CellularAutomaton_internal_25 --> -104($fp) + # LOCAL local_option_at_CellularAutomaton_internal_27 --> -112($fp) + # local_option_at_CellularAutomaton_internal_25 = local_option_at_CellularAutomaton_internal_27 + lw $t0, -112($fp) + sw $t0, -104($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_28 --> -116($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_40 + sw $t0, 12($v0) + li $t0, 22 + sw $t0, 16($v0) + sw $v0, -116($fp) + # ARG local_option_at_CellularAutomaton_internal_28 + # LOCAL local_option_at_CellularAutomaton_internal_28 --> -116($fp) + lw $t0, -116($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_25 --> -104($fp) + # LOCAL local_option_at_CellularAutomaton_internal_26 --> -108($fp) + # local_option_at_CellularAutomaton_internal_26 = VCALL local_option_at_CellularAutomaton_internal_25 out_string + # Save new self pointer in $s1 + lw $s1, -104($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -108($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_31 --> -128($fp) + # local_option_at_CellularAutomaton_internal_31 = SELF + sw $s1, -128($fp) + # LOCAL local_option_at_CellularAutomaton_internal_29 --> -120($fp) + # LOCAL local_option_at_CellularAutomaton_internal_31 --> -128($fp) + # local_option_at_CellularAutomaton_internal_29 = local_option_at_CellularAutomaton_internal_31 + lw $t0, -128($fp) + sw $t0, -120($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_41 + sw $t0, 12($v0) + li $t0, 28 + sw $t0, 16($v0) + sw $v0, -132($fp) + # ARG local_option_at_CellularAutomaton_internal_32 + # LOCAL local_option_at_CellularAutomaton_internal_32 --> -132($fp) + lw $t0, -132($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_29 --> -120($fp) + # LOCAL local_option_at_CellularAutomaton_internal_30 --> -124($fp) + # local_option_at_CellularAutomaton_internal_30 = VCALL local_option_at_CellularAutomaton_internal_29 out_string + # Save new self pointer in $s1 + lw $s1, -120($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -124($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_35 --> -144($fp) + # local_option_at_CellularAutomaton_internal_35 = SELF + sw $s1, -144($fp) + # LOCAL local_option_at_CellularAutomaton_internal_33 --> -136($fp) + # LOCAL local_option_at_CellularAutomaton_internal_35 --> -144($fp) + # local_option_at_CellularAutomaton_internal_33 = local_option_at_CellularAutomaton_internal_35 + lw $t0, -144($fp) + sw $t0, -136($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_36 --> -148($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_42 + sw $t0, 12($v0) + li $t0, 25 + sw $t0, 16($v0) + sw $v0, -148($fp) + # ARG local_option_at_CellularAutomaton_internal_36 + # LOCAL local_option_at_CellularAutomaton_internal_36 --> -148($fp) + lw $t0, -148($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_33 --> -136($fp) + # LOCAL local_option_at_CellularAutomaton_internal_34 --> -140($fp) + # local_option_at_CellularAutomaton_internal_34 = VCALL local_option_at_CellularAutomaton_internal_33 out_string + # Save new self pointer in $s1 + lw $s1, -136($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -140($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_39 --> -160($fp) + # local_option_at_CellularAutomaton_internal_39 = SELF + sw $s1, -160($fp) + # LOCAL local_option_at_CellularAutomaton_internal_37 --> -152($fp) + # LOCAL local_option_at_CellularAutomaton_internal_39 --> -160($fp) + # local_option_at_CellularAutomaton_internal_37 = local_option_at_CellularAutomaton_internal_39 + lw $t0, -160($fp) + sw $t0, -152($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_40 --> -164($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_43 + sw $t0, 12($v0) + li $t0, 11 + sw $t0, 16($v0) + sw $v0, -164($fp) + # ARG local_option_at_CellularAutomaton_internal_40 + # LOCAL local_option_at_CellularAutomaton_internal_40 --> -164($fp) + lw $t0, -164($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_37 --> -152($fp) + # LOCAL local_option_at_CellularAutomaton_internal_38 --> -156($fp) + # local_option_at_CellularAutomaton_internal_38 = VCALL local_option_at_CellularAutomaton_internal_37 out_string + # Save new self pointer in $s1 + lw $s1, -152($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -156($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_43 --> -176($fp) + # local_option_at_CellularAutomaton_internal_43 = SELF + sw $s1, -176($fp) + # LOCAL local_option_at_CellularAutomaton_internal_41 --> -168($fp) + # LOCAL local_option_at_CellularAutomaton_internal_43 --> -176($fp) + # local_option_at_CellularAutomaton_internal_41 = local_option_at_CellularAutomaton_internal_43 + lw $t0, -176($fp) + sw $t0, -168($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_44 + sw $t0, 12($v0) + li $t0, 21 + sw $t0, 16($v0) + sw $v0, -180($fp) + # ARG local_option_at_CellularAutomaton_internal_44 + # LOCAL local_option_at_CellularAutomaton_internal_44 --> -180($fp) + lw $t0, -180($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_41 --> -168($fp) + # LOCAL local_option_at_CellularAutomaton_internal_42 --> -172($fp) + # local_option_at_CellularAutomaton_internal_42 = VCALL local_option_at_CellularAutomaton_internal_41 out_string + # Save new self pointer in $s1 + lw $s1, -168($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -172($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_47 --> -192($fp) + # local_option_at_CellularAutomaton_internal_47 = SELF + sw $s1, -192($fp) + # LOCAL local_option_at_CellularAutomaton_internal_45 --> -184($fp) + # LOCAL local_option_at_CellularAutomaton_internal_47 --> -192($fp) + # local_option_at_CellularAutomaton_internal_45 = local_option_at_CellularAutomaton_internal_47 + lw $t0, -192($fp) + sw $t0, -184($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_48 --> -196($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_45 + sw $t0, 12($v0) + li $t0, 32 + sw $t0, 16($v0) + sw $v0, -196($fp) + # ARG local_option_at_CellularAutomaton_internal_48 + # LOCAL local_option_at_CellularAutomaton_internal_48 --> -196($fp) + lw $t0, -196($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_45 --> -184($fp) + # LOCAL local_option_at_CellularAutomaton_internal_46 --> -188($fp) + # local_option_at_CellularAutomaton_internal_46 = VCALL local_option_at_CellularAutomaton_internal_45 out_string + # Save new self pointer in $s1 + lw $s1, -184($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -188($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_51 --> -208($fp) + # local_option_at_CellularAutomaton_internal_51 = SELF + sw $s1, -208($fp) + # LOCAL local_option_at_CellularAutomaton_internal_49 --> -200($fp) + # LOCAL local_option_at_CellularAutomaton_internal_51 --> -208($fp) + # local_option_at_CellularAutomaton_internal_49 = local_option_at_CellularAutomaton_internal_51 + lw $t0, -208($fp) + sw $t0, -200($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_52 --> -212($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_46 + sw $t0, 12($v0) + li $t0, 18 + sw $t0, 16($v0) + sw $v0, -212($fp) + # ARG local_option_at_CellularAutomaton_internal_52 + # LOCAL local_option_at_CellularAutomaton_internal_52 --> -212($fp) + lw $t0, -212($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_49 --> -200($fp) + # LOCAL local_option_at_CellularAutomaton_internal_50 --> -204($fp) + # local_option_at_CellularAutomaton_internal_50 = VCALL local_option_at_CellularAutomaton_internal_49 out_string + # Save new self pointer in $s1 + lw $s1, -200($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -204($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_55 --> -224($fp) + # local_option_at_CellularAutomaton_internal_55 = SELF + sw $s1, -224($fp) + # LOCAL local_option_at_CellularAutomaton_internal_53 --> -216($fp) + # LOCAL local_option_at_CellularAutomaton_internal_55 --> -224($fp) + # local_option_at_CellularAutomaton_internal_53 = local_option_at_CellularAutomaton_internal_55 + lw $t0, -224($fp) + sw $t0, -216($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_47 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -228($fp) + # ARG local_option_at_CellularAutomaton_internal_56 + # LOCAL local_option_at_CellularAutomaton_internal_56 --> -228($fp) + lw $t0, -228($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_53 --> -216($fp) + # LOCAL local_option_at_CellularAutomaton_internal_54 --> -220($fp) + # local_option_at_CellularAutomaton_internal_54 = VCALL local_option_at_CellularAutomaton_internal_53 out_string + # Save new self pointer in $s1 + lw $s1, -216($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -220($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_59 --> -240($fp) + # local_option_at_CellularAutomaton_internal_59 = SELF + sw $s1, -240($fp) + # LOCAL local_option_at_CellularAutomaton_internal_57 --> -232($fp) + # LOCAL local_option_at_CellularAutomaton_internal_59 --> -240($fp) + # local_option_at_CellularAutomaton_internal_57 = local_option_at_CellularAutomaton_internal_59 + lw $t0, -240($fp) + sw $t0, -232($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_60 --> -244($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_48 + sw $t0, 12($v0) + li $t0, 17 + sw $t0, 16($v0) + sw $v0, -244($fp) + # ARG local_option_at_CellularAutomaton_internal_60 + # LOCAL local_option_at_CellularAutomaton_internal_60 --> -244($fp) + lw $t0, -244($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_57 --> -232($fp) + # LOCAL local_option_at_CellularAutomaton_internal_58 --> -236($fp) + # local_option_at_CellularAutomaton_internal_58 = VCALL local_option_at_CellularAutomaton_internal_57 out_string + # Save new self pointer in $s1 + lw $s1, -232($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -236($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_63 --> -256($fp) + # local_option_at_CellularAutomaton_internal_63 = SELF + sw $s1, -256($fp) + # LOCAL local_option_at_CellularAutomaton_internal_61 --> -248($fp) + # LOCAL local_option_at_CellularAutomaton_internal_63 --> -256($fp) + # local_option_at_CellularAutomaton_internal_61 = local_option_at_CellularAutomaton_internal_63 + lw $t0, -256($fp) + sw $t0, -248($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_64 --> -260($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_49 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -260($fp) + # ARG local_option_at_CellularAutomaton_internal_64 + # LOCAL local_option_at_CellularAutomaton_internal_64 --> -260($fp) + lw $t0, -260($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_61 --> -248($fp) + # LOCAL local_option_at_CellularAutomaton_internal_62 --> -252($fp) + # local_option_at_CellularAutomaton_internal_62 = VCALL local_option_at_CellularAutomaton_internal_61 out_string + # Save new self pointer in $s1 + lw $s1, -248($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -252($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_67 --> -272($fp) + # local_option_at_CellularAutomaton_internal_67 = SELF + sw $s1, -272($fp) + # LOCAL local_option_at_CellularAutomaton_internal_65 --> -264($fp) + # LOCAL local_option_at_CellularAutomaton_internal_67 --> -272($fp) + # local_option_at_CellularAutomaton_internal_65 = local_option_at_CellularAutomaton_internal_67 + lw $t0, -272($fp) + sw $t0, -264($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_68 --> -276($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_50 + sw $t0, 12($v0) + li $t0, 13 + sw $t0, 16($v0) + sw $v0, -276($fp) + # ARG local_option_at_CellularAutomaton_internal_68 + # LOCAL local_option_at_CellularAutomaton_internal_68 --> -276($fp) + lw $t0, -276($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_65 --> -264($fp) + # LOCAL local_option_at_CellularAutomaton_internal_66 --> -268($fp) + # local_option_at_CellularAutomaton_internal_66 = VCALL local_option_at_CellularAutomaton_internal_65 out_string + # Save new self pointer in $s1 + lw $s1, -264($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -268($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_71 --> -288($fp) + # local_option_at_CellularAutomaton_internal_71 = SELF + sw $s1, -288($fp) + # LOCAL local_option_at_CellularAutomaton_internal_69 --> -280($fp) + # LOCAL local_option_at_CellularAutomaton_internal_71 --> -288($fp) + # local_option_at_CellularAutomaton_internal_69 = local_option_at_CellularAutomaton_internal_71 + lw $t0, -288($fp) + sw $t0, -280($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_72 --> -292($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_51 + sw $t0, 12($v0) + li $t0, 13 + sw $t0, 16($v0) + sw $v0, -292($fp) + # ARG local_option_at_CellularAutomaton_internal_72 + # LOCAL local_option_at_CellularAutomaton_internal_72 --> -292($fp) + lw $t0, -292($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_69 --> -280($fp) + # LOCAL local_option_at_CellularAutomaton_internal_70 --> -284($fp) + # local_option_at_CellularAutomaton_internal_70 = VCALL local_option_at_CellularAutomaton_internal_69 out_string + # Save new self pointer in $s1 + lw $s1, -280($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -284($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_75 --> -304($fp) + # local_option_at_CellularAutomaton_internal_75 = SELF + sw $s1, -304($fp) + # LOCAL local_option_at_CellularAutomaton_internal_73 --> -296($fp) + # LOCAL local_option_at_CellularAutomaton_internal_75 --> -304($fp) + # local_option_at_CellularAutomaton_internal_73 = local_option_at_CellularAutomaton_internal_75 + lw $t0, -304($fp) + sw $t0, -296($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_76 --> -308($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_52 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -308($fp) + # ARG local_option_at_CellularAutomaton_internal_76 + # LOCAL local_option_at_CellularAutomaton_internal_76 --> -308($fp) + lw $t0, -308($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_73 --> -296($fp) + # LOCAL local_option_at_CellularAutomaton_internal_74 --> -300($fp) + # local_option_at_CellularAutomaton_internal_74 = VCALL local_option_at_CellularAutomaton_internal_73 out_string + # Save new self pointer in $s1 + lw $s1, -296($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -300($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_79 --> -320($fp) + # local_option_at_CellularAutomaton_internal_79 = SELF + sw $s1, -320($fp) + # LOCAL local_option_at_CellularAutomaton_internal_77 --> -312($fp) + # LOCAL local_option_at_CellularAutomaton_internal_79 --> -320($fp) + # local_option_at_CellularAutomaton_internal_77 = local_option_at_CellularAutomaton_internal_79 + lw $t0, -320($fp) + sw $t0, -312($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_80 --> -324($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_53 + sw $t0, 12($v0) + li $t0, 13 + sw $t0, 16($v0) + sw $v0, -324($fp) + # ARG local_option_at_CellularAutomaton_internal_80 + # LOCAL local_option_at_CellularAutomaton_internal_80 --> -324($fp) + lw $t0, -324($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_77 --> -312($fp) + # LOCAL local_option_at_CellularAutomaton_internal_78 --> -316($fp) + # local_option_at_CellularAutomaton_internal_78 = VCALL local_option_at_CellularAutomaton_internal_77 out_string + # Save new self pointer in $s1 + lw $s1, -312($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -316($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_83 --> -336($fp) + # local_option_at_CellularAutomaton_internal_83 = SELF + sw $s1, -336($fp) + # LOCAL local_option_at_CellularAutomaton_internal_81 --> -328($fp) + # LOCAL local_option_at_CellularAutomaton_internal_83 --> -336($fp) + # local_option_at_CellularAutomaton_internal_81 = local_option_at_CellularAutomaton_internal_83 + lw $t0, -336($fp) + sw $t0, -328($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_84 --> -340($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_54 + sw $t0, 12($v0) + li $t0, 13 + sw $t0, 16($v0) + sw $v0, -340($fp) + # ARG local_option_at_CellularAutomaton_internal_84 + # LOCAL local_option_at_CellularAutomaton_internal_84 --> -340($fp) + lw $t0, -340($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_81 --> -328($fp) + # LOCAL local_option_at_CellularAutomaton_internal_82 --> -332($fp) + # local_option_at_CellularAutomaton_internal_82 = VCALL local_option_at_CellularAutomaton_internal_81 out_string + # Save new self pointer in $s1 + lw $s1, -328($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -332($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_87 --> -352($fp) + # local_option_at_CellularAutomaton_internal_87 = SELF + sw $s1, -352($fp) + # LOCAL local_option_at_CellularAutomaton_internal_85 --> -344($fp) + # LOCAL local_option_at_CellularAutomaton_internal_87 --> -352($fp) + # local_option_at_CellularAutomaton_internal_85 = local_option_at_CellularAutomaton_internal_87 + lw $t0, -352($fp) + sw $t0, -344($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_88 --> -356($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_55 + sw $t0, 12($v0) + li $t0, 13 + sw $t0, 16($v0) + sw $v0, -356($fp) + # ARG local_option_at_CellularAutomaton_internal_88 + # LOCAL local_option_at_CellularAutomaton_internal_88 --> -356($fp) + lw $t0, -356($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_85 --> -344($fp) + # LOCAL local_option_at_CellularAutomaton_internal_86 --> -348($fp) + # local_option_at_CellularAutomaton_internal_86 = VCALL local_option_at_CellularAutomaton_internal_85 out_string + # Save new self pointer in $s1 + lw $s1, -344($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -348($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_91 --> -368($fp) + # local_option_at_CellularAutomaton_internal_91 = SELF + sw $s1, -368($fp) + # LOCAL local_option_at_CellularAutomaton_internal_89 --> -360($fp) + # LOCAL local_option_at_CellularAutomaton_internal_91 --> -368($fp) + # local_option_at_CellularAutomaton_internal_89 = local_option_at_CellularAutomaton_internal_91 + lw $t0, -368($fp) + sw $t0, -360($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_92 --> -372($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_56 + sw $t0, 12($v0) + li $t0, 15 + sw $t0, 16($v0) + sw $v0, -372($fp) + # ARG local_option_at_CellularAutomaton_internal_92 + # LOCAL local_option_at_CellularAutomaton_internal_92 --> -372($fp) + lw $t0, -372($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_89 --> -360($fp) + # LOCAL local_option_at_CellularAutomaton_internal_90 --> -364($fp) + # local_option_at_CellularAutomaton_internal_90 = VCALL local_option_at_CellularAutomaton_internal_89 out_string + # Save new self pointer in $s1 + lw $s1, -360($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -364($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_95 --> -384($fp) + # local_option_at_CellularAutomaton_internal_95 = SELF + sw $s1, -384($fp) + # LOCAL local_option_at_CellularAutomaton_internal_93 --> -376($fp) + # LOCAL local_option_at_CellularAutomaton_internal_95 --> -384($fp) + # local_option_at_CellularAutomaton_internal_93 = local_option_at_CellularAutomaton_internal_95 + lw $t0, -384($fp) + sw $t0, -376($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_93 --> -376($fp) + # LOCAL local_option_at_CellularAutomaton_internal_94 --> -380($fp) + # local_option_at_CellularAutomaton_internal_94 = VCALL local_option_at_CellularAutomaton_internal_93 in_int + # Save new self pointer in $s1 + lw $s1, -376($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -380($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_94 --> -380($fp) + # local_option_at_CellularAutomaton_num_0 = local_option_at_CellularAutomaton_internal_94 + lw $t0, -380($fp) + sw $t0, -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_98 --> -396($fp) + # local_option_at_CellularAutomaton_internal_98 = SELF + sw $s1, -396($fp) + # LOCAL local_option_at_CellularAutomaton_internal_96 --> -388($fp) + # LOCAL local_option_at_CellularAutomaton_internal_98 --> -396($fp) + # local_option_at_CellularAutomaton_internal_96 = local_option_at_CellularAutomaton_internal_98 + lw $t0, -396($fp) + sw $t0, -388($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_99 --> -400($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_57 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -400($fp) + # ARG local_option_at_CellularAutomaton_internal_99 + # LOCAL local_option_at_CellularAutomaton_internal_99 --> -400($fp) + lw $t0, -400($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_96 --> -388($fp) + # LOCAL local_option_at_CellularAutomaton_internal_97 --> -392($fp) + # local_option_at_CellularAutomaton_internal_97 = VCALL local_option_at_CellularAutomaton_internal_96 out_string + # Save new self pointer in $s1 + lw $s1, -388($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -392($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -420($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_279 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_279 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_279 + # IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_FALSE_279 + # IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_FALSE_279 + lw $t0, -420($fp) + beq $t0, 0, label_FALSE_279 + # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -416($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_COMPARE_STRING_282 + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_COMPARE_STRING_282 + lw $t0, -416($fp) + beq $t0, 0, label_COMPARE_STRING_282 + # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -416($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_COMPARE_BY_VALUE_283 + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_COMPARE_BY_VALUE_283 + lw $t0, -416($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_283 + # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -416($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_COMPARE_BY_VALUE_283 + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_COMPARE_BY_VALUE_283 + lw $t0, -416($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_283 + # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -420($fp) + sub $a0, $a0, $a1 + sw $a0, -416($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_TRUE_280 + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_TRUE_280 + lw $t0, -416($fp) + beq $t0, 0, label_TRUE_280 + # GOTO label_FALSE_279 + j label_FALSE_279 + label_COMPARE_BY_VALUE_283: + # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) + lw $a0, -4($fp) + lw $a1, -420($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -416($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_TRUE_280 + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_TRUE_280 + lw $t0, -416($fp) + beq $t0, 0, label_TRUE_280 + # GOTO label_FALSE_279 + j label_FALSE_279 + label_COMPARE_STRING_282: + # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -420($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -416($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_CONTINUE_284 + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_CONTINUE_284 + lw $t0, -416($fp) + beq $t0, 0, label_CONTINUE_284 + # GOTO label_FALSE_279 + j label_FALSE_279 + label_CONTINUE_284: + # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -420($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_285: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_286 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_285 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_286: + # Store result + sw $a2, -416($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_TRUE_280 + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_TRUE_280 + lw $t0, -416($fp) + beq $t0, 0, label_TRUE_280 + label_FALSE_279: + # LOCAL local_option_at_CellularAutomaton_internal_102 --> -412($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -412($fp) + # GOTO label_END_281 +j label_END_281 +label_TRUE_280: + # LOCAL local_option_at_CellularAutomaton_internal_102 --> -412($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -412($fp) + label_END_281: +# LOCAL local_option_at_CellularAutomaton_internal_100 --> -404($fp) +# LOCAL local_option_at_CellularAutomaton_internal_102 --> -412($fp) +# Obtain value from -412($fp) +lw $v0, -412($fp) +lw $v0, 12($v0) +sw $v0, -404($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_100 GOTO label_FALSEIF_277 +# IF_ZERO local_option_at_CellularAutomaton_internal_100 GOTO label_FALSEIF_277 +lw $t0, -404($fp) +beq $t0, 0, label_FALSEIF_277 +# LOCAL local_option_at_CellularAutomaton_internal_105 --> -424($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_58 +sw $t0, 12($v0) +li $t0, 20 +sw $t0, 16($v0) +sw $v0, -424($fp) +# LOCAL local_option_at_CellularAutomaton_internal_101 --> -408($fp) +# LOCAL local_option_at_CellularAutomaton_internal_105 --> -424($fp) +# local_option_at_CellularAutomaton_internal_101 = local_option_at_CellularAutomaton_internal_105 +lw $t0, -424($fp) +sw $t0, -408($fp) +# GOTO label_ENDIF_278 +j label_ENDIF_278 +label_FALSEIF_277: + # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 2 + sw $t0, 12($v0) + sw $v0, -444($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_289 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_289 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_289 + # IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_FALSE_289 + # IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_FALSE_289 + lw $t0, -444($fp) + beq $t0, 0, label_FALSE_289 + # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -440($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_COMPARE_STRING_292 + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_COMPARE_STRING_292 + lw $t0, -440($fp) + beq $t0, 0, label_COMPARE_STRING_292 + # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -440($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_COMPARE_BY_VALUE_293 + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_COMPARE_BY_VALUE_293 + lw $t0, -440($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_293 + # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -440($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_COMPARE_BY_VALUE_293 + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_COMPARE_BY_VALUE_293 + lw $t0, -440($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_293 + # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -444($fp) + sub $a0, $a0, $a1 + sw $a0, -440($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_TRUE_290 + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_TRUE_290 + lw $t0, -440($fp) + beq $t0, 0, label_TRUE_290 + # GOTO label_FALSE_289 + j label_FALSE_289 + label_COMPARE_BY_VALUE_293: + # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) + lw $a0, -4($fp) + lw $a1, -444($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -440($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_TRUE_290 + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_TRUE_290 + lw $t0, -440($fp) + beq $t0, 0, label_TRUE_290 + # GOTO label_FALSE_289 + j label_FALSE_289 + label_COMPARE_STRING_292: + # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -444($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -440($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_CONTINUE_294 + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_CONTINUE_294 + lw $t0, -440($fp) + beq $t0, 0, label_CONTINUE_294 + # GOTO label_FALSE_289 + j label_FALSE_289 + label_CONTINUE_294: + # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -444($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_295: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_296 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_295 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_296: + # Store result + sw $a2, -440($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_TRUE_290 + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_TRUE_290 + lw $t0, -440($fp) + beq $t0, 0, label_TRUE_290 + label_FALSE_289: + # LOCAL local_option_at_CellularAutomaton_internal_108 --> -436($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -436($fp) + # GOTO label_END_291 +j label_END_291 +label_TRUE_290: + # LOCAL local_option_at_CellularAutomaton_internal_108 --> -436($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -436($fp) + label_END_291: +# LOCAL local_option_at_CellularAutomaton_internal_106 --> -428($fp) +# LOCAL local_option_at_CellularAutomaton_internal_108 --> -436($fp) +# Obtain value from -436($fp) +lw $v0, -436($fp) +lw $v0, 12($v0) +sw $v0, -428($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_106 GOTO label_FALSEIF_287 +# IF_ZERO local_option_at_CellularAutomaton_internal_106 GOTO label_FALSEIF_287 +lw $t0, -428($fp) +beq $t0, 0, label_FALSEIF_287 +# LOCAL local_option_at_CellularAutomaton_internal_111 --> -448($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_59 +sw $t0, 12($v0) +li $t0, 25 +sw $t0, 16($v0) +sw $v0, -448($fp) +# LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) +# LOCAL local_option_at_CellularAutomaton_internal_111 --> -448($fp) +# local_option_at_CellularAutomaton_internal_107 = local_option_at_CellularAutomaton_internal_111 +lw $t0, -448($fp) +sw $t0, -432($fp) +# GOTO label_ENDIF_288 +j label_ENDIF_288 +label_FALSEIF_287: + # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 3 + sw $t0, 12($v0) + sw $v0, -468($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_299 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_299 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_299 + # IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_FALSE_299 + # IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_FALSE_299 + lw $t0, -468($fp) + beq $t0, 0, label_FALSE_299 + # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -464($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_COMPARE_STRING_302 + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_COMPARE_STRING_302 + lw $t0, -464($fp) + beq $t0, 0, label_COMPARE_STRING_302 + # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -464($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_COMPARE_BY_VALUE_303 + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_COMPARE_BY_VALUE_303 + lw $t0, -464($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_303 + # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -464($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_COMPARE_BY_VALUE_303 + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_COMPARE_BY_VALUE_303 + lw $t0, -464($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_303 + # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -468($fp) + sub $a0, $a0, $a1 + sw $a0, -464($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_TRUE_300 + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_TRUE_300 + lw $t0, -464($fp) + beq $t0, 0, label_TRUE_300 + # GOTO label_FALSE_299 + j label_FALSE_299 + label_COMPARE_BY_VALUE_303: + # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) + lw $a0, -4($fp) + lw $a1, -468($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -464($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_TRUE_300 + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_TRUE_300 + lw $t0, -464($fp) + beq $t0, 0, label_TRUE_300 + # GOTO label_FALSE_299 + j label_FALSE_299 + label_COMPARE_STRING_302: + # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -468($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -464($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_CONTINUE_304 + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_CONTINUE_304 + lw $t0, -464($fp) + beq $t0, 0, label_CONTINUE_304 + # GOTO label_FALSE_299 + j label_FALSE_299 + label_CONTINUE_304: + # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -468($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_305: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_306 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_305 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_306: + # Store result + sw $a2, -464($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_TRUE_300 + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_TRUE_300 + lw $t0, -464($fp) + beq $t0, 0, label_TRUE_300 + label_FALSE_299: + # LOCAL local_option_at_CellularAutomaton_internal_114 --> -460($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -460($fp) + # GOTO label_END_301 +j label_END_301 +label_TRUE_300: + # LOCAL local_option_at_CellularAutomaton_internal_114 --> -460($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -460($fp) + label_END_301: +# LOCAL local_option_at_CellularAutomaton_internal_112 --> -452($fp) +# LOCAL local_option_at_CellularAutomaton_internal_114 --> -460($fp) +# Obtain value from -460($fp) +lw $v0, -460($fp) +lw $v0, 12($v0) +sw $v0, -452($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_112 GOTO label_FALSEIF_297 +# IF_ZERO local_option_at_CellularAutomaton_internal_112 GOTO label_FALSEIF_297 +lw $t0, -452($fp) +beq $t0, 0, label_FALSEIF_297 +# LOCAL local_option_at_CellularAutomaton_internal_117 --> -472($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_60 +sw $t0, 12($v0) +li $t0, 25 +sw $t0, 16($v0) +sw $v0, -472($fp) +# LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) +# LOCAL local_option_at_CellularAutomaton_internal_117 --> -472($fp) +# local_option_at_CellularAutomaton_internal_113 = local_option_at_CellularAutomaton_internal_117 +lw $t0, -472($fp) +sw $t0, -456($fp) +# GOTO label_ENDIF_298 +j label_ENDIF_298 +label_FALSEIF_297: + # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 4 + sw $t0, 12($v0) + sw $v0, -492($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_309 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_309 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_309 + # IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_FALSE_309 + # IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_FALSE_309 + lw $t0, -492($fp) + beq $t0, 0, label_FALSE_309 + # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -488($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_COMPARE_STRING_312 + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_COMPARE_STRING_312 + lw $t0, -488($fp) + beq $t0, 0, label_COMPARE_STRING_312 + # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -488($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_COMPARE_BY_VALUE_313 + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_COMPARE_BY_VALUE_313 + lw $t0, -488($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_313 + # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -488($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_COMPARE_BY_VALUE_313 + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_COMPARE_BY_VALUE_313 + lw $t0, -488($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_313 + # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -492($fp) + sub $a0, $a0, $a1 + sw $a0, -488($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_TRUE_310 + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_TRUE_310 + lw $t0, -488($fp) + beq $t0, 0, label_TRUE_310 + # GOTO label_FALSE_309 + j label_FALSE_309 + label_COMPARE_BY_VALUE_313: + # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) + lw $a0, -4($fp) + lw $a1, -492($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -488($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_TRUE_310 + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_TRUE_310 + lw $t0, -488($fp) + beq $t0, 0, label_TRUE_310 + # GOTO label_FALSE_309 + j label_FALSE_309 + label_COMPARE_STRING_312: + # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -492($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -488($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_CONTINUE_314 + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_CONTINUE_314 + lw $t0, -488($fp) + beq $t0, 0, label_CONTINUE_314 + # GOTO label_FALSE_309 + j label_FALSE_309 + label_CONTINUE_314: + # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -492($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_315: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_316 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_315 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_316: + # Store result + sw $a2, -488($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_TRUE_310 + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_TRUE_310 + lw $t0, -488($fp) + beq $t0, 0, label_TRUE_310 + label_FALSE_309: + # LOCAL local_option_at_CellularAutomaton_internal_120 --> -484($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -484($fp) + # GOTO label_END_311 +j label_END_311 +label_TRUE_310: + # LOCAL local_option_at_CellularAutomaton_internal_120 --> -484($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -484($fp) + label_END_311: +# LOCAL local_option_at_CellularAutomaton_internal_118 --> -476($fp) +# LOCAL local_option_at_CellularAutomaton_internal_120 --> -484($fp) +# Obtain value from -484($fp) +lw $v0, -484($fp) +lw $v0, 12($v0) +sw $v0, -476($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_118 GOTO label_FALSEIF_307 +# IF_ZERO local_option_at_CellularAutomaton_internal_118 GOTO label_FALSEIF_307 +lw $t0, -476($fp) +beq $t0, 0, label_FALSEIF_307 +# LOCAL local_option_at_CellularAutomaton_internal_123 --> -496($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_61 +sw $t0, 12($v0) +li $t0, 25 +sw $t0, 16($v0) +sw $v0, -496($fp) +# LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) +# LOCAL local_option_at_CellularAutomaton_internal_123 --> -496($fp) +# local_option_at_CellularAutomaton_internal_119 = local_option_at_CellularAutomaton_internal_123 +lw $t0, -496($fp) +sw $t0, -480($fp) +# GOTO label_ENDIF_308 +j label_ENDIF_308 +label_FALSEIF_307: + # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 5 + sw $t0, 12($v0) + sw $v0, -516($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_319 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_319 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_319 + # IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_FALSE_319 + # IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_FALSE_319 + lw $t0, -516($fp) + beq $t0, 0, label_FALSE_319 + # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -512($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_COMPARE_STRING_322 + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_COMPARE_STRING_322 + lw $t0, -512($fp) + beq $t0, 0, label_COMPARE_STRING_322 + # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -512($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_COMPARE_BY_VALUE_323 + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_COMPARE_BY_VALUE_323 + lw $t0, -512($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_323 + # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -512($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_COMPARE_BY_VALUE_323 + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_COMPARE_BY_VALUE_323 + lw $t0, -512($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_323 + # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -516($fp) + sub $a0, $a0, $a1 + sw $a0, -512($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_TRUE_320 + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_TRUE_320 + lw $t0, -512($fp) + beq $t0, 0, label_TRUE_320 + # GOTO label_FALSE_319 + j label_FALSE_319 + label_COMPARE_BY_VALUE_323: + # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) + lw $a0, -4($fp) + lw $a1, -516($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -512($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_TRUE_320 + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_TRUE_320 + lw $t0, -512($fp) + beq $t0, 0, label_TRUE_320 + # GOTO label_FALSE_319 + j label_FALSE_319 + label_COMPARE_STRING_322: + # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -516($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -512($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_CONTINUE_324 + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_CONTINUE_324 + lw $t0, -512($fp) + beq $t0, 0, label_CONTINUE_324 + # GOTO label_FALSE_319 + j label_FALSE_319 + label_CONTINUE_324: + # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -516($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_325: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_326 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_325 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_326: + # Store result + sw $a2, -512($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_TRUE_320 + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_TRUE_320 + lw $t0, -512($fp) + beq $t0, 0, label_TRUE_320 + label_FALSE_319: + # LOCAL local_option_at_CellularAutomaton_internal_126 --> -508($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -508($fp) + # GOTO label_END_321 +j label_END_321 +label_TRUE_320: + # LOCAL local_option_at_CellularAutomaton_internal_126 --> -508($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -508($fp) + label_END_321: +# LOCAL local_option_at_CellularAutomaton_internal_124 --> -500($fp) +# LOCAL local_option_at_CellularAutomaton_internal_126 --> -508($fp) +# Obtain value from -508($fp) +lw $v0, -508($fp) +lw $v0, 12($v0) +sw $v0, -500($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_124 GOTO label_FALSEIF_317 +# IF_ZERO local_option_at_CellularAutomaton_internal_124 GOTO label_FALSEIF_317 +lw $t0, -500($fp) +beq $t0, 0, label_FALSEIF_317 +# LOCAL local_option_at_CellularAutomaton_internal_129 --> -520($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_62 +sw $t0, 12($v0) +li $t0, 25 +sw $t0, 16($v0) +sw $v0, -520($fp) +# LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) +# LOCAL local_option_at_CellularAutomaton_internal_129 --> -520($fp) +# local_option_at_CellularAutomaton_internal_125 = local_option_at_CellularAutomaton_internal_129 +lw $t0, -520($fp) +sw $t0, -504($fp) +# GOTO label_ENDIF_318 +j label_ENDIF_318 +label_FALSEIF_317: + # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 6 + sw $t0, 12($v0) + sw $v0, -540($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_329 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_329 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_329 + # IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_FALSE_329 + # IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_FALSE_329 + lw $t0, -540($fp) + beq $t0, 0, label_FALSE_329 + # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -536($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_COMPARE_STRING_332 + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_COMPARE_STRING_332 + lw $t0, -536($fp) + beq $t0, 0, label_COMPARE_STRING_332 + # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -536($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_COMPARE_BY_VALUE_333 + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_COMPARE_BY_VALUE_333 + lw $t0, -536($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_333 + # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -536($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_COMPARE_BY_VALUE_333 + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_COMPARE_BY_VALUE_333 + lw $t0, -536($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_333 + # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -540($fp) + sub $a0, $a0, $a1 + sw $a0, -536($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_TRUE_330 + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_TRUE_330 + lw $t0, -536($fp) + beq $t0, 0, label_TRUE_330 + # GOTO label_FALSE_329 + j label_FALSE_329 + label_COMPARE_BY_VALUE_333: + # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) + lw $a0, -4($fp) + lw $a1, -540($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -536($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_TRUE_330 + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_TRUE_330 + lw $t0, -536($fp) + beq $t0, 0, label_TRUE_330 + # GOTO label_FALSE_329 + j label_FALSE_329 + label_COMPARE_STRING_332: + # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -540($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -536($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_CONTINUE_334 + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_CONTINUE_334 + lw $t0, -536($fp) + beq $t0, 0, label_CONTINUE_334 + # GOTO label_FALSE_329 + j label_FALSE_329 + label_CONTINUE_334: + # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -540($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_335: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_336 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_335 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_336: + # Store result + sw $a2, -536($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_TRUE_330 + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_TRUE_330 + lw $t0, -536($fp) + beq $t0, 0, label_TRUE_330 + label_FALSE_329: + # LOCAL local_option_at_CellularAutomaton_internal_132 --> -532($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -532($fp) + # GOTO label_END_331 +j label_END_331 +label_TRUE_330: + # LOCAL local_option_at_CellularAutomaton_internal_132 --> -532($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -532($fp) + label_END_331: +# LOCAL local_option_at_CellularAutomaton_internal_130 --> -524($fp) +# LOCAL local_option_at_CellularAutomaton_internal_132 --> -532($fp) +# Obtain value from -532($fp) +lw $v0, -532($fp) +lw $v0, 12($v0) +sw $v0, -524($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_130 GOTO label_FALSEIF_327 +# IF_ZERO local_option_at_CellularAutomaton_internal_130 GOTO label_FALSEIF_327 +lw $t0, -524($fp) +beq $t0, 0, label_FALSEIF_327 +# LOCAL local_option_at_CellularAutomaton_internal_135 --> -544($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_63 +sw $t0, 12($v0) +li $t0, 25 +sw $t0, 16($v0) +sw $v0, -544($fp) +# LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) +# LOCAL local_option_at_CellularAutomaton_internal_135 --> -544($fp) +# local_option_at_CellularAutomaton_internal_131 = local_option_at_CellularAutomaton_internal_135 +lw $t0, -544($fp) +sw $t0, -528($fp) +# GOTO label_ENDIF_328 +j label_ENDIF_328 +label_FALSEIF_327: + # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 7 + sw $t0, 12($v0) + sw $v0, -564($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_339 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_339 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_339 + # IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_FALSE_339 + # IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_FALSE_339 + lw $t0, -564($fp) + beq $t0, 0, label_FALSE_339 + # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -560($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_COMPARE_STRING_342 + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_COMPARE_STRING_342 + lw $t0, -560($fp) + beq $t0, 0, label_COMPARE_STRING_342 + # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -560($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_COMPARE_BY_VALUE_343 + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_COMPARE_BY_VALUE_343 + lw $t0, -560($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_343 + # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -560($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_COMPARE_BY_VALUE_343 + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_COMPARE_BY_VALUE_343 + lw $t0, -560($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_343 + # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -564($fp) + sub $a0, $a0, $a1 + sw $a0, -560($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_TRUE_340 + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_TRUE_340 + lw $t0, -560($fp) + beq $t0, 0, label_TRUE_340 + # GOTO label_FALSE_339 + j label_FALSE_339 + label_COMPARE_BY_VALUE_343: + # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) + lw $a0, -4($fp) + lw $a1, -564($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -560($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_TRUE_340 + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_TRUE_340 + lw $t0, -560($fp) + beq $t0, 0, label_TRUE_340 + # GOTO label_FALSE_339 + j label_FALSE_339 + label_COMPARE_STRING_342: + # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -564($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -560($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_CONTINUE_344 + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_CONTINUE_344 + lw $t0, -560($fp) + beq $t0, 0, label_CONTINUE_344 + # GOTO label_FALSE_339 + j label_FALSE_339 + label_CONTINUE_344: + # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -564($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_345: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_346 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_345 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_346: + # Store result + sw $a2, -560($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_TRUE_340 + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_TRUE_340 + lw $t0, -560($fp) + beq $t0, 0, label_TRUE_340 + label_FALSE_339: + # LOCAL local_option_at_CellularAutomaton_internal_138 --> -556($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -556($fp) + # GOTO label_END_341 +j label_END_341 +label_TRUE_340: + # LOCAL local_option_at_CellularAutomaton_internal_138 --> -556($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -556($fp) + label_END_341: +# LOCAL local_option_at_CellularAutomaton_internal_136 --> -548($fp) +# LOCAL local_option_at_CellularAutomaton_internal_138 --> -556($fp) +# Obtain value from -556($fp) +lw $v0, -556($fp) +lw $v0, 12($v0) +sw $v0, -548($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_136 GOTO label_FALSEIF_337 +# IF_ZERO local_option_at_CellularAutomaton_internal_136 GOTO label_FALSEIF_337 +lw $t0, -548($fp) +beq $t0, 0, label_FALSEIF_337 +# LOCAL local_option_at_CellularAutomaton_internal_141 --> -568($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_64 +sw $t0, 12($v0) +li $t0, 20 +sw $t0, 16($v0) +sw $v0, -568($fp) +# LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) +# LOCAL local_option_at_CellularAutomaton_internal_141 --> -568($fp) +# local_option_at_CellularAutomaton_internal_137 = local_option_at_CellularAutomaton_internal_141 +lw $t0, -568($fp) +sw $t0, -552($fp) +# GOTO label_ENDIF_338 +j label_ENDIF_338 +label_FALSEIF_337: + # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 8 + sw $t0, 12($v0) + sw $v0, -588($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_349 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_349 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_349 + # IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_FALSE_349 + # IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_FALSE_349 + lw $t0, -588($fp) + beq $t0, 0, label_FALSE_349 + # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -584($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_COMPARE_STRING_352 + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_COMPARE_STRING_352 + lw $t0, -584($fp) + beq $t0, 0, label_COMPARE_STRING_352 + # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -584($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_COMPARE_BY_VALUE_353 + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_COMPARE_BY_VALUE_353 + lw $t0, -584($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_353 + # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -584($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_COMPARE_BY_VALUE_353 + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_COMPARE_BY_VALUE_353 + lw $t0, -584($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_353 + # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -588($fp) + sub $a0, $a0, $a1 + sw $a0, -584($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_TRUE_350 + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_TRUE_350 + lw $t0, -584($fp) + beq $t0, 0, label_TRUE_350 + # GOTO label_FALSE_349 + j label_FALSE_349 + label_COMPARE_BY_VALUE_353: + # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) + lw $a0, -4($fp) + lw $a1, -588($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -584($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_TRUE_350 + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_TRUE_350 + lw $t0, -584($fp) + beq $t0, 0, label_TRUE_350 + # GOTO label_FALSE_349 + j label_FALSE_349 + label_COMPARE_STRING_352: + # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -588($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -584($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_CONTINUE_354 + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_CONTINUE_354 + lw $t0, -584($fp) + beq $t0, 0, label_CONTINUE_354 + # GOTO label_FALSE_349 + j label_FALSE_349 + label_CONTINUE_354: + # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -588($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_355: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_356 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_355 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_356: + # Store result + sw $a2, -584($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_TRUE_350 + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_TRUE_350 + lw $t0, -584($fp) + beq $t0, 0, label_TRUE_350 + label_FALSE_349: + # LOCAL local_option_at_CellularAutomaton_internal_144 --> -580($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -580($fp) + # GOTO label_END_351 +j label_END_351 +label_TRUE_350: + # LOCAL local_option_at_CellularAutomaton_internal_144 --> -580($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -580($fp) + label_END_351: +# LOCAL local_option_at_CellularAutomaton_internal_142 --> -572($fp) +# LOCAL local_option_at_CellularAutomaton_internal_144 --> -580($fp) +# Obtain value from -580($fp) +lw $v0, -580($fp) +lw $v0, 12($v0) +sw $v0, -572($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_142 GOTO label_FALSEIF_347 +# IF_ZERO local_option_at_CellularAutomaton_internal_142 GOTO label_FALSEIF_347 +lw $t0, -572($fp) +beq $t0, 0, label_FALSEIF_347 +# LOCAL local_option_at_CellularAutomaton_internal_147 --> -592($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_65 +sw $t0, 12($v0) +li $t0, 20 +sw $t0, 16($v0) +sw $v0, -592($fp) +# LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) +# LOCAL local_option_at_CellularAutomaton_internal_147 --> -592($fp) +# local_option_at_CellularAutomaton_internal_143 = local_option_at_CellularAutomaton_internal_147 +lw $t0, -592($fp) +sw $t0, -576($fp) +# GOTO label_ENDIF_348 +j label_ENDIF_348 +label_FALSEIF_347: + # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 9 + sw $t0, 12($v0) + sw $v0, -612($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_359 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_359 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_359 + # IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_FALSE_359 + # IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_FALSE_359 + lw $t0, -612($fp) + beq $t0, 0, label_FALSE_359 + # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -608($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_COMPARE_STRING_362 + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_COMPARE_STRING_362 + lw $t0, -608($fp) + beq $t0, 0, label_COMPARE_STRING_362 + # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -608($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_COMPARE_BY_VALUE_363 + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_COMPARE_BY_VALUE_363 + lw $t0, -608($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_363 + # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -608($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_COMPARE_BY_VALUE_363 + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_COMPARE_BY_VALUE_363 + lw $t0, -608($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_363 + # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -612($fp) + sub $a0, $a0, $a1 + sw $a0, -608($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_TRUE_360 + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_TRUE_360 + lw $t0, -608($fp) + beq $t0, 0, label_TRUE_360 + # GOTO label_FALSE_359 + j label_FALSE_359 + label_COMPARE_BY_VALUE_363: + # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) + lw $a0, -4($fp) + lw $a1, -612($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -608($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_TRUE_360 + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_TRUE_360 + lw $t0, -608($fp) + beq $t0, 0, label_TRUE_360 + # GOTO label_FALSE_359 + j label_FALSE_359 + label_COMPARE_STRING_362: + # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -612($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -608($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_CONTINUE_364 + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_CONTINUE_364 + lw $t0, -608($fp) + beq $t0, 0, label_CONTINUE_364 + # GOTO label_FALSE_359 + j label_FALSE_359 + label_CONTINUE_364: + # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -612($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_365: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_366 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_365 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_366: + # Store result + sw $a2, -608($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_TRUE_360 + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_TRUE_360 + lw $t0, -608($fp) + beq $t0, 0, label_TRUE_360 + label_FALSE_359: + # LOCAL local_option_at_CellularAutomaton_internal_150 --> -604($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -604($fp) + # GOTO label_END_361 +j label_END_361 +label_TRUE_360: + # LOCAL local_option_at_CellularAutomaton_internal_150 --> -604($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -604($fp) + label_END_361: +# LOCAL local_option_at_CellularAutomaton_internal_148 --> -596($fp) +# LOCAL local_option_at_CellularAutomaton_internal_150 --> -604($fp) +# Obtain value from -604($fp) +lw $v0, -604($fp) +lw $v0, 12($v0) +sw $v0, -596($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_148 GOTO label_FALSEIF_357 +# IF_ZERO local_option_at_CellularAutomaton_internal_148 GOTO label_FALSEIF_357 +lw $t0, -596($fp) +beq $t0, 0, label_FALSEIF_357 +# LOCAL local_option_at_CellularAutomaton_internal_153 --> -616($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_66 +sw $t0, 12($v0) +li $t0, 15 +sw $t0, 16($v0) +sw $v0, -616($fp) +# LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) +# LOCAL local_option_at_CellularAutomaton_internal_153 --> -616($fp) +# local_option_at_CellularAutomaton_internal_149 = local_option_at_CellularAutomaton_internal_153 +lw $t0, -616($fp) +sw $t0, -600($fp) +# GOTO label_ENDIF_358 +j label_ENDIF_358 +label_FALSEIF_357: + # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 10 + sw $t0, 12($v0) + sw $v0, -636($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_369 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_369 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_369 + # IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_FALSE_369 + # IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_FALSE_369 + lw $t0, -636($fp) + beq $t0, 0, label_FALSE_369 + # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -632($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_COMPARE_STRING_372 + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_COMPARE_STRING_372 + lw $t0, -632($fp) + beq $t0, 0, label_COMPARE_STRING_372 + # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -632($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_COMPARE_BY_VALUE_373 + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_COMPARE_BY_VALUE_373 + lw $t0, -632($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_373 + # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -632($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_COMPARE_BY_VALUE_373 + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_COMPARE_BY_VALUE_373 + lw $t0, -632($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_373 + # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -636($fp) + sub $a0, $a0, $a1 + sw $a0, -632($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_TRUE_370 + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_TRUE_370 + lw $t0, -632($fp) + beq $t0, 0, label_TRUE_370 + # GOTO label_FALSE_369 + j label_FALSE_369 + label_COMPARE_BY_VALUE_373: + # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) + lw $a0, -4($fp) + lw $a1, -636($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -632($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_TRUE_370 + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_TRUE_370 + lw $t0, -632($fp) + beq $t0, 0, label_TRUE_370 + # GOTO label_FALSE_369 + j label_FALSE_369 + label_COMPARE_STRING_372: + # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -636($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -632($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_CONTINUE_374 + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_CONTINUE_374 + lw $t0, -632($fp) + beq $t0, 0, label_CONTINUE_374 + # GOTO label_FALSE_369 + j label_FALSE_369 + label_CONTINUE_374: + # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -636($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_375: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_376 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_375 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_376: + # Store result + sw $a2, -632($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_TRUE_370 + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_TRUE_370 + lw $t0, -632($fp) + beq $t0, 0, label_TRUE_370 + label_FALSE_369: + # LOCAL local_option_at_CellularAutomaton_internal_156 --> -628($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -628($fp) + # GOTO label_END_371 +j label_END_371 +label_TRUE_370: + # LOCAL local_option_at_CellularAutomaton_internal_156 --> -628($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -628($fp) + label_END_371: +# LOCAL local_option_at_CellularAutomaton_internal_154 --> -620($fp) +# LOCAL local_option_at_CellularAutomaton_internal_156 --> -628($fp) +# Obtain value from -628($fp) +lw $v0, -628($fp) +lw $v0, 12($v0) +sw $v0, -620($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_154 GOTO label_FALSEIF_367 +# IF_ZERO local_option_at_CellularAutomaton_internal_154 GOTO label_FALSEIF_367 +lw $t0, -620($fp) +beq $t0, 0, label_FALSEIF_367 +# LOCAL local_option_at_CellularAutomaton_internal_159 --> -640($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_67 +sw $t0, 12($v0) +li $t0, 15 +sw $t0, 16($v0) +sw $v0, -640($fp) +# LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) +# LOCAL local_option_at_CellularAutomaton_internal_159 --> -640($fp) +# local_option_at_CellularAutomaton_internal_155 = local_option_at_CellularAutomaton_internal_159 +lw $t0, -640($fp) +sw $t0, -624($fp) +# GOTO label_ENDIF_368 +j label_ENDIF_368 +label_FALSEIF_367: + # LOCAL local_option_at_CellularAutomaton_internal_164 --> -660($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 11 + sw $t0, 12($v0) + sw $v0, -660($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_379 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_379 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_379 + # IF_ZERO local_option_at_CellularAutomaton_internal_164 GOTO label_FALSE_379 + # IF_ZERO local_option_at_CellularAutomaton_internal_164 GOTO label_FALSE_379 + lw $t0, -660($fp) + beq $t0, 0, label_FALSE_379 + # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -656($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_COMPARE_STRING_382 + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_COMPARE_STRING_382 + lw $t0, -656($fp) + beq $t0, 0, label_COMPARE_STRING_382 + # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -656($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_COMPARE_BY_VALUE_383 + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_COMPARE_BY_VALUE_383 + lw $t0, -656($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_383 + # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -656($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_COMPARE_BY_VALUE_383 + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_COMPARE_BY_VALUE_383 + lw $t0, -656($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_383 + # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_164 --> -660($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -660($fp) + sub $a0, $a0, $a1 + sw $a0, -656($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_TRUE_380 + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_TRUE_380 + lw $t0, -656($fp) + beq $t0, 0, label_TRUE_380 + # GOTO label_FALSE_379 + j label_FALSE_379 + label_COMPARE_BY_VALUE_383: + # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_164 --> -660($fp) + lw $a0, -4($fp) + lw $a1, -660($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -656($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_TRUE_380 + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_TRUE_380 + lw $t0, -656($fp) + beq $t0, 0, label_TRUE_380 + # GOTO label_FALSE_379 + j label_FALSE_379 + label_COMPARE_STRING_382: + # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_164 --> -660($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -660($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -656($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_CONTINUE_384 + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_CONTINUE_384 + lw $t0, -656($fp) + beq $t0, 0, label_CONTINUE_384 + # GOTO label_FALSE_379 + j label_FALSE_379 + label_CONTINUE_384: + # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_164 --> -660($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -660($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_385: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_386 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_385 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_386: + # Store result + sw $a2, -656($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_TRUE_380 + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_TRUE_380 + lw $t0, -656($fp) + beq $t0, 0, label_TRUE_380 + label_FALSE_379: + # LOCAL local_option_at_CellularAutomaton_internal_162 --> -652($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -652($fp) + # GOTO label_END_381 +j label_END_381 +label_TRUE_380: + # LOCAL local_option_at_CellularAutomaton_internal_162 --> -652($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -652($fp) + label_END_381: +# LOCAL local_option_at_CellularAutomaton_internal_160 --> -644($fp) +# LOCAL local_option_at_CellularAutomaton_internal_162 --> -652($fp) +# Obtain value from -652($fp) +lw $v0, -652($fp) +lw $v0, 12($v0) +sw $v0, -644($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_160 GOTO label_FALSEIF_377 +# IF_ZERO local_option_at_CellularAutomaton_internal_160 GOTO label_FALSEIF_377 +lw $t0, -644($fp) +beq $t0, 0, label_FALSEIF_377 +# LOCAL local_option_at_CellularAutomaton_internal_165 --> -664($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_68 +sw $t0, 12($v0) +li $t0, 15 +sw $t0, 16($v0) +sw $v0, -664($fp) +# LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) +# LOCAL local_option_at_CellularAutomaton_internal_165 --> -664($fp) +# local_option_at_CellularAutomaton_internal_161 = local_option_at_CellularAutomaton_internal_165 +lw $t0, -664($fp) +sw $t0, -648($fp) +# GOTO label_ENDIF_378 +j label_ENDIF_378 +label_FALSEIF_377: + # LOCAL local_option_at_CellularAutomaton_internal_170 --> -684($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 12 + sw $t0, 12($v0) + sw $v0, -684($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_389 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_389 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_389 + # IF_ZERO local_option_at_CellularAutomaton_internal_170 GOTO label_FALSE_389 + # IF_ZERO local_option_at_CellularAutomaton_internal_170 GOTO label_FALSE_389 + lw $t0, -684($fp) + beq $t0, 0, label_FALSE_389 + # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -680($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_COMPARE_STRING_392 + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_COMPARE_STRING_392 + lw $t0, -680($fp) + beq $t0, 0, label_COMPARE_STRING_392 + # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -680($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_COMPARE_BY_VALUE_393 + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_COMPARE_BY_VALUE_393 + lw $t0, -680($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_393 + # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -680($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_COMPARE_BY_VALUE_393 + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_COMPARE_BY_VALUE_393 + lw $t0, -680($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_393 + # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_170 --> -684($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -684($fp) + sub $a0, $a0, $a1 + sw $a0, -680($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_TRUE_390 + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_TRUE_390 + lw $t0, -680($fp) + beq $t0, 0, label_TRUE_390 + # GOTO label_FALSE_389 + j label_FALSE_389 + label_COMPARE_BY_VALUE_393: + # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_170 --> -684($fp) + lw $a0, -4($fp) + lw $a1, -684($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -680($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_TRUE_390 + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_TRUE_390 + lw $t0, -680($fp) + beq $t0, 0, label_TRUE_390 + # GOTO label_FALSE_389 + j label_FALSE_389 + label_COMPARE_STRING_392: + # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_170 --> -684($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -684($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -680($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_CONTINUE_394 + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_CONTINUE_394 + lw $t0, -680($fp) + beq $t0, 0, label_CONTINUE_394 + # GOTO label_FALSE_389 + j label_FALSE_389 + label_CONTINUE_394: + # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_170 --> -684($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -684($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_395: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_396 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_395 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_396: + # Store result + sw $a2, -680($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_TRUE_390 + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_TRUE_390 + lw $t0, -680($fp) + beq $t0, 0, label_TRUE_390 + label_FALSE_389: + # LOCAL local_option_at_CellularAutomaton_internal_168 --> -676($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -676($fp) + # GOTO label_END_391 +j label_END_391 +label_TRUE_390: + # LOCAL local_option_at_CellularAutomaton_internal_168 --> -676($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -676($fp) + label_END_391: +# LOCAL local_option_at_CellularAutomaton_internal_166 --> -668($fp) +# LOCAL local_option_at_CellularAutomaton_internal_168 --> -676($fp) +# Obtain value from -676($fp) +lw $v0, -676($fp) +lw $v0, 12($v0) +sw $v0, -668($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_166 GOTO label_FALSEIF_387 +# IF_ZERO local_option_at_CellularAutomaton_internal_166 GOTO label_FALSEIF_387 +lw $t0, -668($fp) +beq $t0, 0, label_FALSEIF_387 +# LOCAL local_option_at_CellularAutomaton_internal_171 --> -688($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_69 +sw $t0, 12($v0) +li $t0, 25 +sw $t0, 16($v0) +sw $v0, -688($fp) +# LOCAL local_option_at_CellularAutomaton_internal_167 --> -672($fp) +# LOCAL local_option_at_CellularAutomaton_internal_171 --> -688($fp) +# local_option_at_CellularAutomaton_internal_167 = local_option_at_CellularAutomaton_internal_171 +lw $t0, -688($fp) +sw $t0, -672($fp) +# GOTO label_ENDIF_388 +j label_ENDIF_388 +label_FALSEIF_387: + # LOCAL local_option_at_CellularAutomaton_internal_176 --> -708($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 13 + sw $t0, 12($v0) + sw $v0, -708($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_399 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_399 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_399 + # IF_ZERO local_option_at_CellularAutomaton_internal_176 GOTO label_FALSE_399 + # IF_ZERO local_option_at_CellularAutomaton_internal_176 GOTO label_FALSE_399 + lw $t0, -708($fp) + beq $t0, 0, label_FALSE_399 + # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -704($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_COMPARE_STRING_402 + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_COMPARE_STRING_402 + lw $t0, -704($fp) + beq $t0, 0, label_COMPARE_STRING_402 + # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -704($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_COMPARE_BY_VALUE_403 + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_COMPARE_BY_VALUE_403 + lw $t0, -704($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_403 + # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -704($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_COMPARE_BY_VALUE_403 + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_COMPARE_BY_VALUE_403 + lw $t0, -704($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_403 + # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_176 --> -708($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -708($fp) + sub $a0, $a0, $a1 + sw $a0, -704($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_TRUE_400 + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_TRUE_400 + lw $t0, -704($fp) + beq $t0, 0, label_TRUE_400 + # GOTO label_FALSE_399 + j label_FALSE_399 + label_COMPARE_BY_VALUE_403: + # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_176 --> -708($fp) + lw $a0, -4($fp) + lw $a1, -708($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -704($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_TRUE_400 + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_TRUE_400 + lw $t0, -704($fp) + beq $t0, 0, label_TRUE_400 + # GOTO label_FALSE_399 + j label_FALSE_399 + label_COMPARE_STRING_402: + # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_176 --> -708($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -708($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -704($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_CONTINUE_404 + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_CONTINUE_404 + lw $t0, -704($fp) + beq $t0, 0, label_CONTINUE_404 + # GOTO label_FALSE_399 + j label_FALSE_399 + label_CONTINUE_404: + # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_176 --> -708($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -708($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_405: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_406 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_405 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_406: + # Store result + sw $a2, -704($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_TRUE_400 + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_TRUE_400 + lw $t0, -704($fp) + beq $t0, 0, label_TRUE_400 + label_FALSE_399: + # LOCAL local_option_at_CellularAutomaton_internal_174 --> -700($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -700($fp) + # GOTO label_END_401 +j label_END_401 +label_TRUE_400: + # LOCAL local_option_at_CellularAutomaton_internal_174 --> -700($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -700($fp) + label_END_401: +# LOCAL local_option_at_CellularAutomaton_internal_172 --> -692($fp) +# LOCAL local_option_at_CellularAutomaton_internal_174 --> -700($fp) +# Obtain value from -700($fp) +lw $v0, -700($fp) +lw $v0, 12($v0) +sw $v0, -692($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_172 GOTO label_FALSEIF_397 +# IF_ZERO local_option_at_CellularAutomaton_internal_172 GOTO label_FALSEIF_397 +lw $t0, -692($fp) +beq $t0, 0, label_FALSEIF_397 +# LOCAL local_option_at_CellularAutomaton_internal_177 --> -712($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_70 +sw $t0, 12($v0) +li $t0, 25 +sw $t0, 16($v0) +sw $v0, -712($fp) +# LOCAL local_option_at_CellularAutomaton_internal_173 --> -696($fp) +# LOCAL local_option_at_CellularAutomaton_internal_177 --> -712($fp) +# local_option_at_CellularAutomaton_internal_173 = local_option_at_CellularAutomaton_internal_177 +lw $t0, -712($fp) +sw $t0, -696($fp) +# GOTO label_ENDIF_398 +j label_ENDIF_398 +label_FALSEIF_397: + # LOCAL local_option_at_CellularAutomaton_internal_182 --> -732($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 14 + sw $t0, 12($v0) + sw $v0, -732($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_409 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_409 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_409 + # IF_ZERO local_option_at_CellularAutomaton_internal_182 GOTO label_FALSE_409 + # IF_ZERO local_option_at_CellularAutomaton_internal_182 GOTO label_FALSE_409 + lw $t0, -732($fp) + beq $t0, 0, label_FALSE_409 + # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -728($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_COMPARE_STRING_412 + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_COMPARE_STRING_412 + lw $t0, -728($fp) + beq $t0, 0, label_COMPARE_STRING_412 + # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -728($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_COMPARE_BY_VALUE_413 + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_COMPARE_BY_VALUE_413 + lw $t0, -728($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_413 + # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -728($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_COMPARE_BY_VALUE_413 + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_COMPARE_BY_VALUE_413 + lw $t0, -728($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_413 + # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_182 --> -732($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -732($fp) + sub $a0, $a0, $a1 + sw $a0, -728($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_TRUE_410 + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_TRUE_410 + lw $t0, -728($fp) + beq $t0, 0, label_TRUE_410 + # GOTO label_FALSE_409 + j label_FALSE_409 + label_COMPARE_BY_VALUE_413: + # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_182 --> -732($fp) + lw $a0, -4($fp) + lw $a1, -732($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -728($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_TRUE_410 + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_TRUE_410 + lw $t0, -728($fp) + beq $t0, 0, label_TRUE_410 + # GOTO label_FALSE_409 + j label_FALSE_409 + label_COMPARE_STRING_412: + # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_182 --> -732($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -732($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -728($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_CONTINUE_414 + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_CONTINUE_414 + lw $t0, -728($fp) + beq $t0, 0, label_CONTINUE_414 + # GOTO label_FALSE_409 + j label_FALSE_409 + label_CONTINUE_414: + # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_182 --> -732($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -732($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_415: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_416 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_415 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_416: + # Store result + sw $a2, -728($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_TRUE_410 + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_TRUE_410 + lw $t0, -728($fp) + beq $t0, 0, label_TRUE_410 + label_FALSE_409: + # LOCAL local_option_at_CellularAutomaton_internal_180 --> -724($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -724($fp) + # GOTO label_END_411 +j label_END_411 +label_TRUE_410: + # LOCAL local_option_at_CellularAutomaton_internal_180 --> -724($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -724($fp) + label_END_411: +# LOCAL local_option_at_CellularAutomaton_internal_178 --> -716($fp) +# LOCAL local_option_at_CellularAutomaton_internal_180 --> -724($fp) +# Obtain value from -724($fp) +lw $v0, -724($fp) +lw $v0, 12($v0) +sw $v0, -716($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_178 GOTO label_FALSEIF_407 +# IF_ZERO local_option_at_CellularAutomaton_internal_178 GOTO label_FALSEIF_407 +lw $t0, -716($fp) +beq $t0, 0, label_FALSEIF_407 +# LOCAL local_option_at_CellularAutomaton_internal_183 --> -736($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_71 +sw $t0, 12($v0) +li $t0, 25 +sw $t0, 16($v0) +sw $v0, -736($fp) +# LOCAL local_option_at_CellularAutomaton_internal_179 --> -720($fp) +# LOCAL local_option_at_CellularAutomaton_internal_183 --> -736($fp) +# local_option_at_CellularAutomaton_internal_179 = local_option_at_CellularAutomaton_internal_183 +lw $t0, -736($fp) +sw $t0, -720($fp) +# GOTO label_ENDIF_408 +j label_ENDIF_408 +label_FALSEIF_407: + # LOCAL local_option_at_CellularAutomaton_internal_188 --> -756($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 15 + sw $t0, 12($v0) + sw $v0, -756($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_419 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_419 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_419 + # IF_ZERO local_option_at_CellularAutomaton_internal_188 GOTO label_FALSE_419 + # IF_ZERO local_option_at_CellularAutomaton_internal_188 GOTO label_FALSE_419 + lw $t0, -756($fp) + beq $t0, 0, label_FALSE_419 + # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -752($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_COMPARE_STRING_422 + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_COMPARE_STRING_422 + lw $t0, -752($fp) + beq $t0, 0, label_COMPARE_STRING_422 + # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -752($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_COMPARE_BY_VALUE_423 + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_COMPARE_BY_VALUE_423 + lw $t0, -752($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_423 + # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -752($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_COMPARE_BY_VALUE_423 + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_COMPARE_BY_VALUE_423 + lw $t0, -752($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_423 + # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_188 --> -756($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -756($fp) + sub $a0, $a0, $a1 + sw $a0, -752($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_TRUE_420 + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_TRUE_420 + lw $t0, -752($fp) + beq $t0, 0, label_TRUE_420 + # GOTO label_FALSE_419 + j label_FALSE_419 + label_COMPARE_BY_VALUE_423: + # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_188 --> -756($fp) + lw $a0, -4($fp) + lw $a1, -756($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -752($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_TRUE_420 + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_TRUE_420 + lw $t0, -752($fp) + beq $t0, 0, label_TRUE_420 + # GOTO label_FALSE_419 + j label_FALSE_419 + label_COMPARE_STRING_422: + # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_188 --> -756($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -756($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -752($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_CONTINUE_424 + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_CONTINUE_424 + lw $t0, -752($fp) + beq $t0, 0, label_CONTINUE_424 + # GOTO label_FALSE_419 + j label_FALSE_419 + label_CONTINUE_424: + # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_188 --> -756($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -756($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_425: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_426 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_425 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_426: + # Store result + sw $a2, -752($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_TRUE_420 + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_TRUE_420 + lw $t0, -752($fp) + beq $t0, 0, label_TRUE_420 + label_FALSE_419: + # LOCAL local_option_at_CellularAutomaton_internal_186 --> -748($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -748($fp) + # GOTO label_END_421 +j label_END_421 +label_TRUE_420: + # LOCAL local_option_at_CellularAutomaton_internal_186 --> -748($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -748($fp) + label_END_421: +# LOCAL local_option_at_CellularAutomaton_internal_184 --> -740($fp) +# LOCAL local_option_at_CellularAutomaton_internal_186 --> -748($fp) +# Obtain value from -748($fp) +lw $v0, -748($fp) +lw $v0, 12($v0) +sw $v0, -740($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_184 GOTO label_FALSEIF_417 +# IF_ZERO local_option_at_CellularAutomaton_internal_184 GOTO label_FALSEIF_417 +lw $t0, -740($fp) +beq $t0, 0, label_FALSEIF_417 +# LOCAL local_option_at_CellularAutomaton_internal_189 --> -760($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_72 +sw $t0, 12($v0) +li $t0, 21 +sw $t0, 16($v0) +sw $v0, -760($fp) +# LOCAL local_option_at_CellularAutomaton_internal_185 --> -744($fp) +# LOCAL local_option_at_CellularAutomaton_internal_189 --> -760($fp) +# local_option_at_CellularAutomaton_internal_185 = local_option_at_CellularAutomaton_internal_189 +lw $t0, -760($fp) +sw $t0, -744($fp) +# GOTO label_ENDIF_418 +j label_ENDIF_418 +label_FALSEIF_417: + # LOCAL local_option_at_CellularAutomaton_internal_194 --> -780($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 16 + sw $t0, 12($v0) + sw $v0, -780($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_429 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_429 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_429 + # IF_ZERO local_option_at_CellularAutomaton_internal_194 GOTO label_FALSE_429 + # IF_ZERO local_option_at_CellularAutomaton_internal_194 GOTO label_FALSE_429 + lw $t0, -780($fp) + beq $t0, 0, label_FALSE_429 + # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -776($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_COMPARE_STRING_432 + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_COMPARE_STRING_432 + lw $t0, -776($fp) + beq $t0, 0, label_COMPARE_STRING_432 + # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -776($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_COMPARE_BY_VALUE_433 + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_COMPARE_BY_VALUE_433 + lw $t0, -776($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_433 + # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -776($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_COMPARE_BY_VALUE_433 + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_COMPARE_BY_VALUE_433 + lw $t0, -776($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_433 + # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_194 --> -780($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -780($fp) + sub $a0, $a0, $a1 + sw $a0, -776($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_TRUE_430 + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_TRUE_430 + lw $t0, -776($fp) + beq $t0, 0, label_TRUE_430 + # GOTO label_FALSE_429 + j label_FALSE_429 + label_COMPARE_BY_VALUE_433: + # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_194 --> -780($fp) + lw $a0, -4($fp) + lw $a1, -780($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -776($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_TRUE_430 + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_TRUE_430 + lw $t0, -776($fp) + beq $t0, 0, label_TRUE_430 + # GOTO label_FALSE_429 + j label_FALSE_429 + label_COMPARE_STRING_432: + # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_194 --> -780($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -780($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -776($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_CONTINUE_434 + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_CONTINUE_434 + lw $t0, -776($fp) + beq $t0, 0, label_CONTINUE_434 + # GOTO label_FALSE_429 + j label_FALSE_429 + label_CONTINUE_434: + # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_194 --> -780($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -780($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_435: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_436 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_435 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_436: + # Store result + sw $a2, -776($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_TRUE_430 + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_TRUE_430 + lw $t0, -776($fp) + beq $t0, 0, label_TRUE_430 + label_FALSE_429: + # LOCAL local_option_at_CellularAutomaton_internal_192 --> -772($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -772($fp) + # GOTO label_END_431 +j label_END_431 +label_TRUE_430: + # LOCAL local_option_at_CellularAutomaton_internal_192 --> -772($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -772($fp) + label_END_431: +# LOCAL local_option_at_CellularAutomaton_internal_190 --> -764($fp) +# LOCAL local_option_at_CellularAutomaton_internal_192 --> -772($fp) +# Obtain value from -772($fp) +lw $v0, -772($fp) +lw $v0, 12($v0) +sw $v0, -764($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_190 GOTO label_FALSEIF_427 +# IF_ZERO local_option_at_CellularAutomaton_internal_190 GOTO label_FALSEIF_427 +lw $t0, -764($fp) +beq $t0, 0, label_FALSEIF_427 +# LOCAL local_option_at_CellularAutomaton_internal_195 --> -784($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_73 +sw $t0, 12($v0) +li $t0, 21 +sw $t0, 16($v0) +sw $v0, -784($fp) +# LOCAL local_option_at_CellularAutomaton_internal_191 --> -768($fp) +# LOCAL local_option_at_CellularAutomaton_internal_195 --> -784($fp) +# local_option_at_CellularAutomaton_internal_191 = local_option_at_CellularAutomaton_internal_195 +lw $t0, -784($fp) +sw $t0, -768($fp) +# GOTO label_ENDIF_428 +j label_ENDIF_428 +label_FALSEIF_427: + # LOCAL local_option_at_CellularAutomaton_internal_200 --> -804($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 17 + sw $t0, 12($v0) + sw $v0, -804($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_439 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_439 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_439 + # IF_ZERO local_option_at_CellularAutomaton_internal_200 GOTO label_FALSE_439 + # IF_ZERO local_option_at_CellularAutomaton_internal_200 GOTO label_FALSE_439 + lw $t0, -804($fp) + beq $t0, 0, label_FALSE_439 + # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -800($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_COMPARE_STRING_442 + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_COMPARE_STRING_442 + lw $t0, -800($fp) + beq $t0, 0, label_COMPARE_STRING_442 + # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -800($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_COMPARE_BY_VALUE_443 + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_COMPARE_BY_VALUE_443 + lw $t0, -800($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_443 + # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -800($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_COMPARE_BY_VALUE_443 + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_COMPARE_BY_VALUE_443 + lw $t0, -800($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_443 + # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_200 --> -804($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -804($fp) + sub $a0, $a0, $a1 + sw $a0, -800($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_TRUE_440 + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_TRUE_440 + lw $t0, -800($fp) + beq $t0, 0, label_TRUE_440 + # GOTO label_FALSE_439 + j label_FALSE_439 + label_COMPARE_BY_VALUE_443: + # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_200 --> -804($fp) + lw $a0, -4($fp) + lw $a1, -804($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -800($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_TRUE_440 + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_TRUE_440 + lw $t0, -800($fp) + beq $t0, 0, label_TRUE_440 + # GOTO label_FALSE_439 + j label_FALSE_439 + label_COMPARE_STRING_442: + # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_200 --> -804($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -804($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -800($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_CONTINUE_444 + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_CONTINUE_444 + lw $t0, -800($fp) + beq $t0, 0, label_CONTINUE_444 + # GOTO label_FALSE_439 + j label_FALSE_439 + label_CONTINUE_444: + # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_200 --> -804($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -804($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_445: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_446 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_445 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_446: + # Store result + sw $a2, -800($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_TRUE_440 + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_TRUE_440 + lw $t0, -800($fp) + beq $t0, 0, label_TRUE_440 + label_FALSE_439: + # LOCAL local_option_at_CellularAutomaton_internal_198 --> -796($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -796($fp) + # GOTO label_END_441 +j label_END_441 +label_TRUE_440: + # LOCAL local_option_at_CellularAutomaton_internal_198 --> -796($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -796($fp) + label_END_441: +# LOCAL local_option_at_CellularAutomaton_internal_196 --> -788($fp) +# LOCAL local_option_at_CellularAutomaton_internal_198 --> -796($fp) +# Obtain value from -796($fp) +lw $v0, -796($fp) +lw $v0, 12($v0) +sw $v0, -788($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_196 GOTO label_FALSEIF_437 +# IF_ZERO local_option_at_CellularAutomaton_internal_196 GOTO label_FALSEIF_437 +lw $t0, -788($fp) +beq $t0, 0, label_FALSEIF_437 +# LOCAL local_option_at_CellularAutomaton_internal_201 --> -808($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_74 +sw $t0, 12($v0) +li $t0, 28 +sw $t0, 16($v0) +sw $v0, -808($fp) +# LOCAL local_option_at_CellularAutomaton_internal_197 --> -792($fp) +# LOCAL local_option_at_CellularAutomaton_internal_201 --> -808($fp) +# local_option_at_CellularAutomaton_internal_197 = local_option_at_CellularAutomaton_internal_201 +lw $t0, -808($fp) +sw $t0, -792($fp) +# GOTO label_ENDIF_438 +j label_ENDIF_438 +label_FALSEIF_437: + # LOCAL local_option_at_CellularAutomaton_internal_206 --> -828($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 18 + sw $t0, 12($v0) + sw $v0, -828($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_449 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_449 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_449 + # IF_ZERO local_option_at_CellularAutomaton_internal_206 GOTO label_FALSE_449 + # IF_ZERO local_option_at_CellularAutomaton_internal_206 GOTO label_FALSE_449 + lw $t0, -828($fp) + beq $t0, 0, label_FALSE_449 + # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -824($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_COMPARE_STRING_452 + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_COMPARE_STRING_452 + lw $t0, -824($fp) + beq $t0, 0, label_COMPARE_STRING_452 + # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -824($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_COMPARE_BY_VALUE_453 + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_COMPARE_BY_VALUE_453 + lw $t0, -824($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_453 + # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -824($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_COMPARE_BY_VALUE_453 + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_COMPARE_BY_VALUE_453 + lw $t0, -824($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_453 + # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_206 --> -828($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -828($fp) + sub $a0, $a0, $a1 + sw $a0, -824($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_TRUE_450 + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_TRUE_450 + lw $t0, -824($fp) + beq $t0, 0, label_TRUE_450 + # GOTO label_FALSE_449 + j label_FALSE_449 + label_COMPARE_BY_VALUE_453: + # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_206 --> -828($fp) + lw $a0, -4($fp) + lw $a1, -828($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -824($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_TRUE_450 + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_TRUE_450 + lw $t0, -824($fp) + beq $t0, 0, label_TRUE_450 + # GOTO label_FALSE_449 + j label_FALSE_449 + label_COMPARE_STRING_452: + # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_206 --> -828($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -828($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -824($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_CONTINUE_454 + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_CONTINUE_454 + lw $t0, -824($fp) + beq $t0, 0, label_CONTINUE_454 + # GOTO label_FALSE_449 + j label_FALSE_449 + label_CONTINUE_454: + # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_206 --> -828($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -828($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_455: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_456 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_455 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_456: + # Store result + sw $a2, -824($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_TRUE_450 + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_TRUE_450 + lw $t0, -824($fp) + beq $t0, 0, label_TRUE_450 + label_FALSE_449: + # LOCAL local_option_at_CellularAutomaton_internal_204 --> -820($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -820($fp) + # GOTO label_END_451 +j label_END_451 +label_TRUE_450: + # LOCAL local_option_at_CellularAutomaton_internal_204 --> -820($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -820($fp) + label_END_451: +# LOCAL local_option_at_CellularAutomaton_internal_202 --> -812($fp) +# LOCAL local_option_at_CellularAutomaton_internal_204 --> -820($fp) +# Obtain value from -820($fp) +lw $v0, -820($fp) +lw $v0, 12($v0) +sw $v0, -812($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_202 GOTO label_FALSEIF_447 +# IF_ZERO local_option_at_CellularAutomaton_internal_202 GOTO label_FALSEIF_447 +lw $t0, -812($fp) +beq $t0, 0, label_FALSEIF_447 +# LOCAL local_option_at_CellularAutomaton_internal_207 --> -832($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_75 +sw $t0, 12($v0) +li $t0, 28 +sw $t0, 16($v0) +sw $v0, -832($fp) +# LOCAL local_option_at_CellularAutomaton_internal_203 --> -816($fp) +# LOCAL local_option_at_CellularAutomaton_internal_207 --> -832($fp) +# local_option_at_CellularAutomaton_internal_203 = local_option_at_CellularAutomaton_internal_207 +lw $t0, -832($fp) +sw $t0, -816($fp) +# GOTO label_ENDIF_448 +j label_ENDIF_448 +label_FALSEIF_447: + # LOCAL local_option_at_CellularAutomaton_internal_212 --> -852($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 19 + sw $t0, 12($v0) + sw $v0, -852($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_459 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_459 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_459 + # IF_ZERO local_option_at_CellularAutomaton_internal_212 GOTO label_FALSE_459 + # IF_ZERO local_option_at_CellularAutomaton_internal_212 GOTO label_FALSE_459 + lw $t0, -852($fp) + beq $t0, 0, label_FALSE_459 + # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -848($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_COMPARE_STRING_462 + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_COMPARE_STRING_462 + lw $t0, -848($fp) + beq $t0, 0, label_COMPARE_STRING_462 + # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -848($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_COMPARE_BY_VALUE_463 + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_COMPARE_BY_VALUE_463 + lw $t0, -848($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_463 + # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -848($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_COMPARE_BY_VALUE_463 + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_COMPARE_BY_VALUE_463 + lw $t0, -848($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_463 + # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_212 --> -852($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -852($fp) + sub $a0, $a0, $a1 + sw $a0, -848($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_TRUE_460 + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_TRUE_460 + lw $t0, -848($fp) + beq $t0, 0, label_TRUE_460 + # GOTO label_FALSE_459 + j label_FALSE_459 + label_COMPARE_BY_VALUE_463: + # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_212 --> -852($fp) + lw $a0, -4($fp) + lw $a1, -852($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -848($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_TRUE_460 + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_TRUE_460 + lw $t0, -848($fp) + beq $t0, 0, label_TRUE_460 + # GOTO label_FALSE_459 + j label_FALSE_459 + label_COMPARE_STRING_462: + # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_212 --> -852($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -852($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -848($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_CONTINUE_464 + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_CONTINUE_464 + lw $t0, -848($fp) + beq $t0, 0, label_CONTINUE_464 + # GOTO label_FALSE_459 + j label_FALSE_459 + label_CONTINUE_464: + # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_212 --> -852($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -852($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_465: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_466 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_465 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_466: + # Store result + sw $a2, -848($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_TRUE_460 + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_TRUE_460 + lw $t0, -848($fp) + beq $t0, 0, label_TRUE_460 + label_FALSE_459: + # LOCAL local_option_at_CellularAutomaton_internal_210 --> -844($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -844($fp) + # GOTO label_END_461 +j label_END_461 +label_TRUE_460: + # LOCAL local_option_at_CellularAutomaton_internal_210 --> -844($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -844($fp) + label_END_461: +# LOCAL local_option_at_CellularAutomaton_internal_208 --> -836($fp) +# LOCAL local_option_at_CellularAutomaton_internal_210 --> -844($fp) +# Obtain value from -844($fp) +lw $v0, -844($fp) +lw $v0, 12($v0) +sw $v0, -836($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_208 GOTO label_FALSEIF_457 +# IF_ZERO local_option_at_CellularAutomaton_internal_208 GOTO label_FALSEIF_457 +lw $t0, -836($fp) +beq $t0, 0, label_FALSEIF_457 +# LOCAL local_option_at_CellularAutomaton_internal_213 --> -856($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_76 +sw $t0, 12($v0) +li $t0, 16 +sw $t0, 16($v0) +sw $v0, -856($fp) +# LOCAL local_option_at_CellularAutomaton_internal_209 --> -840($fp) +# LOCAL local_option_at_CellularAutomaton_internal_213 --> -856($fp) +# local_option_at_CellularAutomaton_internal_209 = local_option_at_CellularAutomaton_internal_213 +lw $t0, -856($fp) +sw $t0, -840($fp) +# GOTO label_ENDIF_458 +j label_ENDIF_458 +label_FALSEIF_457: + # LOCAL local_option_at_CellularAutomaton_internal_218 --> -876($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 20 + sw $t0, 12($v0) + sw $v0, -876($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_469 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_469 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_469 + # IF_ZERO local_option_at_CellularAutomaton_internal_218 GOTO label_FALSE_469 + # IF_ZERO local_option_at_CellularAutomaton_internal_218 GOTO label_FALSE_469 + lw $t0, -876($fp) + beq $t0, 0, label_FALSE_469 + # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -872($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_COMPARE_STRING_472 + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_COMPARE_STRING_472 + lw $t0, -872($fp) + beq $t0, 0, label_COMPARE_STRING_472 + # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -872($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_COMPARE_BY_VALUE_473 + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_COMPARE_BY_VALUE_473 + lw $t0, -872($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_473 + # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -872($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_COMPARE_BY_VALUE_473 + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_COMPARE_BY_VALUE_473 + lw $t0, -872($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_473 + # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_218 --> -876($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -876($fp) + sub $a0, $a0, $a1 + sw $a0, -872($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_TRUE_470 + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_TRUE_470 + lw $t0, -872($fp) + beq $t0, 0, label_TRUE_470 + # GOTO label_FALSE_469 + j label_FALSE_469 + label_COMPARE_BY_VALUE_473: + # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_218 --> -876($fp) + lw $a0, -4($fp) + lw $a1, -876($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -872($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_TRUE_470 + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_TRUE_470 + lw $t0, -872($fp) + beq $t0, 0, label_TRUE_470 + # GOTO label_FALSE_469 + j label_FALSE_469 + label_COMPARE_STRING_472: + # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_218 --> -876($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -876($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -872($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_CONTINUE_474 + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_CONTINUE_474 + lw $t0, -872($fp) + beq $t0, 0, label_CONTINUE_474 + # GOTO label_FALSE_469 + j label_FALSE_469 + label_CONTINUE_474: + # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_218 --> -876($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -876($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_475: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_476 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_475 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_476: + # Store result + sw $a2, -872($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_TRUE_470 + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_TRUE_470 + lw $t0, -872($fp) + beq $t0, 0, label_TRUE_470 + label_FALSE_469: + # LOCAL local_option_at_CellularAutomaton_internal_216 --> -868($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -868($fp) + # GOTO label_END_471 +j label_END_471 +label_TRUE_470: + # LOCAL local_option_at_CellularAutomaton_internal_216 --> -868($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -868($fp) + label_END_471: +# LOCAL local_option_at_CellularAutomaton_internal_214 --> -860($fp) +# LOCAL local_option_at_CellularAutomaton_internal_216 --> -868($fp) +# Obtain value from -868($fp) +lw $v0, -868($fp) +lw $v0, 12($v0) +sw $v0, -860($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_214 GOTO label_FALSEIF_467 +# IF_ZERO local_option_at_CellularAutomaton_internal_214 GOTO label_FALSEIF_467 +lw $t0, -860($fp) +beq $t0, 0, label_FALSEIF_467 +# LOCAL local_option_at_CellularAutomaton_internal_219 --> -880($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_77 +sw $t0, 12($v0) +li $t0, 28 +sw $t0, 16($v0) +sw $v0, -880($fp) +# LOCAL local_option_at_CellularAutomaton_internal_215 --> -864($fp) +# LOCAL local_option_at_CellularAutomaton_internal_219 --> -880($fp) +# local_option_at_CellularAutomaton_internal_215 = local_option_at_CellularAutomaton_internal_219 +lw $t0, -880($fp) +sw $t0, -864($fp) +# GOTO label_ENDIF_468 +j label_ENDIF_468 +label_FALSEIF_467: + # LOCAL local_option_at_CellularAutomaton_internal_224 --> -900($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 21 + sw $t0, 12($v0) + sw $v0, -900($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_479 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_479 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_479 + # IF_ZERO local_option_at_CellularAutomaton_internal_224 GOTO label_FALSE_479 + # IF_ZERO local_option_at_CellularAutomaton_internal_224 GOTO label_FALSE_479 + lw $t0, -900($fp) + beq $t0, 0, label_FALSE_479 + # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -896($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_COMPARE_STRING_482 + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_COMPARE_STRING_482 + lw $t0, -896($fp) + beq $t0, 0, label_COMPARE_STRING_482 + # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -896($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_COMPARE_BY_VALUE_483 + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_COMPARE_BY_VALUE_483 + lw $t0, -896($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_483 + # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -896($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_COMPARE_BY_VALUE_483 + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_COMPARE_BY_VALUE_483 + lw $t0, -896($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_483 + # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_224 --> -900($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -900($fp) + sub $a0, $a0, $a1 + sw $a0, -896($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_TRUE_480 + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_TRUE_480 + lw $t0, -896($fp) + beq $t0, 0, label_TRUE_480 + # GOTO label_FALSE_479 + j label_FALSE_479 + label_COMPARE_BY_VALUE_483: + # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_224 --> -900($fp) + lw $a0, -4($fp) + lw $a1, -900($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -896($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_TRUE_480 + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_TRUE_480 + lw $t0, -896($fp) + beq $t0, 0, label_TRUE_480 + # GOTO label_FALSE_479 + j label_FALSE_479 + label_COMPARE_STRING_482: + # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_224 --> -900($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -900($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -896($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_CONTINUE_484 + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_CONTINUE_484 + lw $t0, -896($fp) + beq $t0, 0, label_CONTINUE_484 + # GOTO label_FALSE_479 + j label_FALSE_479 + label_CONTINUE_484: + # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_224 --> -900($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -900($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_485: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_486 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_485 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_486: + # Store result + sw $a2, -896($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_TRUE_480 + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_TRUE_480 + lw $t0, -896($fp) + beq $t0, 0, label_TRUE_480 + label_FALSE_479: + # LOCAL local_option_at_CellularAutomaton_internal_222 --> -892($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -892($fp) + # GOTO label_END_481 +j label_END_481 +label_TRUE_480: + # LOCAL local_option_at_CellularAutomaton_internal_222 --> -892($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -892($fp) + label_END_481: +# LOCAL local_option_at_CellularAutomaton_internal_220 --> -884($fp) +# LOCAL local_option_at_CellularAutomaton_internal_222 --> -892($fp) +# Obtain value from -892($fp) +lw $v0, -892($fp) +lw $v0, 12($v0) +sw $v0, -884($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_220 GOTO label_FALSEIF_477 +# IF_ZERO local_option_at_CellularAutomaton_internal_220 GOTO label_FALSEIF_477 +lw $t0, -884($fp) +beq $t0, 0, label_FALSEIF_477 +# LOCAL local_option_at_CellularAutomaton_internal_225 --> -904($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_78 +sw $t0, 12($v0) +li $t0, 28 +sw $t0, 16($v0) +sw $v0, -904($fp) +# LOCAL local_option_at_CellularAutomaton_internal_221 --> -888($fp) +# LOCAL local_option_at_CellularAutomaton_internal_225 --> -904($fp) +# local_option_at_CellularAutomaton_internal_221 = local_option_at_CellularAutomaton_internal_225 +lw $t0, -904($fp) +sw $t0, -888($fp) +# GOTO label_ENDIF_478 +j label_ENDIF_478 +label_FALSEIF_477: + # LOCAL local_option_at_CellularAutomaton_internal_226 --> -908($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_79 + sw $t0, 12($v0) + li $t0, 25 + sw $t0, 16($v0) + sw $v0, -908($fp) + # LOCAL local_option_at_CellularAutomaton_internal_221 --> -888($fp) + # LOCAL local_option_at_CellularAutomaton_internal_226 --> -908($fp) + # local_option_at_CellularAutomaton_internal_221 = local_option_at_CellularAutomaton_internal_226 + lw $t0, -908($fp) + sw $t0, -888($fp) + label_ENDIF_478: +# LOCAL local_option_at_CellularAutomaton_internal_215 --> -864($fp) +# LOCAL local_option_at_CellularAutomaton_internal_221 --> -888($fp) +# local_option_at_CellularAutomaton_internal_215 = local_option_at_CellularAutomaton_internal_221 +lw $t0, -888($fp) +sw $t0, -864($fp) +label_ENDIF_468: +# LOCAL local_option_at_CellularAutomaton_internal_209 --> -840($fp) +# LOCAL local_option_at_CellularAutomaton_internal_215 --> -864($fp) +# local_option_at_CellularAutomaton_internal_209 = local_option_at_CellularAutomaton_internal_215 +lw $t0, -864($fp) +sw $t0, -840($fp) +label_ENDIF_458: +# LOCAL local_option_at_CellularAutomaton_internal_203 --> -816($fp) +# LOCAL local_option_at_CellularAutomaton_internal_209 --> -840($fp) +# local_option_at_CellularAutomaton_internal_203 = local_option_at_CellularAutomaton_internal_209 +lw $t0, -840($fp) +sw $t0, -816($fp) +label_ENDIF_448: +# LOCAL local_option_at_CellularAutomaton_internal_197 --> -792($fp) +# LOCAL local_option_at_CellularAutomaton_internal_203 --> -816($fp) +# local_option_at_CellularAutomaton_internal_197 = local_option_at_CellularAutomaton_internal_203 +lw $t0, -816($fp) +sw $t0, -792($fp) +label_ENDIF_438: +# LOCAL local_option_at_CellularAutomaton_internal_191 --> -768($fp) +# LOCAL local_option_at_CellularAutomaton_internal_197 --> -792($fp) +# local_option_at_CellularAutomaton_internal_191 = local_option_at_CellularAutomaton_internal_197 +lw $t0, -792($fp) +sw $t0, -768($fp) +label_ENDIF_428: +# LOCAL local_option_at_CellularAutomaton_internal_185 --> -744($fp) +# LOCAL local_option_at_CellularAutomaton_internal_191 --> -768($fp) +# local_option_at_CellularAutomaton_internal_185 = local_option_at_CellularAutomaton_internal_191 +lw $t0, -768($fp) +sw $t0, -744($fp) +label_ENDIF_418: +# LOCAL local_option_at_CellularAutomaton_internal_179 --> -720($fp) +# LOCAL local_option_at_CellularAutomaton_internal_185 --> -744($fp) +# local_option_at_CellularAutomaton_internal_179 = local_option_at_CellularAutomaton_internal_185 +lw $t0, -744($fp) +sw $t0, -720($fp) +label_ENDIF_408: +# LOCAL local_option_at_CellularAutomaton_internal_173 --> -696($fp) +# LOCAL local_option_at_CellularAutomaton_internal_179 --> -720($fp) +# local_option_at_CellularAutomaton_internal_173 = local_option_at_CellularAutomaton_internal_179 +lw $t0, -720($fp) +sw $t0, -696($fp) +label_ENDIF_398: +# LOCAL local_option_at_CellularAutomaton_internal_167 --> -672($fp) +# LOCAL local_option_at_CellularAutomaton_internal_173 --> -696($fp) +# local_option_at_CellularAutomaton_internal_167 = local_option_at_CellularAutomaton_internal_173 +lw $t0, -696($fp) +sw $t0, -672($fp) +label_ENDIF_388: +# LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) +# LOCAL local_option_at_CellularAutomaton_internal_167 --> -672($fp) +# local_option_at_CellularAutomaton_internal_161 = local_option_at_CellularAutomaton_internal_167 +lw $t0, -672($fp) +sw $t0, -648($fp) +label_ENDIF_378: +# LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) +# LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) +# local_option_at_CellularAutomaton_internal_155 = local_option_at_CellularAutomaton_internal_161 +lw $t0, -648($fp) +sw $t0, -624($fp) +label_ENDIF_368: +# LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) +# LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) +# local_option_at_CellularAutomaton_internal_149 = local_option_at_CellularAutomaton_internal_155 +lw $t0, -624($fp) +sw $t0, -600($fp) +label_ENDIF_358: +# LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) +# LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) +# local_option_at_CellularAutomaton_internal_143 = local_option_at_CellularAutomaton_internal_149 +lw $t0, -600($fp) +sw $t0, -576($fp) +label_ENDIF_348: +# LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) +# LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) +# local_option_at_CellularAutomaton_internal_137 = local_option_at_CellularAutomaton_internal_143 +lw $t0, -576($fp) +sw $t0, -552($fp) +label_ENDIF_338: +# LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) +# LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) +# local_option_at_CellularAutomaton_internal_131 = local_option_at_CellularAutomaton_internal_137 +lw $t0, -552($fp) +sw $t0, -528($fp) +label_ENDIF_328: +# LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) +# LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) +# local_option_at_CellularAutomaton_internal_125 = local_option_at_CellularAutomaton_internal_131 +lw $t0, -528($fp) +sw $t0, -504($fp) +label_ENDIF_318: +# LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) +# LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) +# local_option_at_CellularAutomaton_internal_119 = local_option_at_CellularAutomaton_internal_125 +lw $t0, -504($fp) +sw $t0, -480($fp) +label_ENDIF_308: +# LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) +# LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) +# local_option_at_CellularAutomaton_internal_113 = local_option_at_CellularAutomaton_internal_119 +lw $t0, -480($fp) +sw $t0, -456($fp) +label_ENDIF_298: +# LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) +# LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) +# local_option_at_CellularAutomaton_internal_107 = local_option_at_CellularAutomaton_internal_113 +lw $t0, -456($fp) +sw $t0, -432($fp) +label_ENDIF_288: +# LOCAL local_option_at_CellularAutomaton_internal_101 --> -408($fp) +# LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) +# local_option_at_CellularAutomaton_internal_101 = local_option_at_CellularAutomaton_internal_107 +lw $t0, -432($fp) +sw $t0, -408($fp) +label_ENDIF_278: +# RETURN local_option_at_CellularAutomaton_internal_101 +lw $v0, -408($fp) +# Deallocate stack frame for function function_option_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 916 +jr $ra +# Function END + + +# function_prompt_at_CellularAutomaton implementation. +# @Params: +function_prompt_at_CellularAutomaton: + # Allocate stack frame for function function_prompt_at_CellularAutomaton. + subu $sp, $sp, 100 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 100 + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_3 --> -16($fp) + # local_prompt_at_CellularAutomaton_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_3 --> -16($fp) + # local_prompt_at_CellularAutomaton_internal_1 = local_prompt_at_CellularAutomaton_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_80 + sw $t0, 12($v0) + li $t0, 54 + sw $t0, 16($v0) + sw $v0, -20($fp) + # ARG local_prompt_at_CellularAutomaton_internal_4 + # LOCAL local_prompt_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_2 --> -12($fp) + # local_prompt_at_CellularAutomaton_internal_2 = VCALL local_prompt_at_CellularAutomaton_internal_1 out_string + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt_at_CellularAutomaton_internal_7 --> -32($fp) + # local_prompt_at_CellularAutomaton_internal_7 = SELF + sw $s1, -32($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_7 --> -32($fp) + # local_prompt_at_CellularAutomaton_internal_5 = local_prompt_at_CellularAutomaton_internal_7 + lw $t0, -32($fp) + sw $t0, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_81 + sw $t0, 12($v0) + li $t0, 49 + sw $t0, 16($v0) + sw $v0, -36($fp) + # ARG local_prompt_at_CellularAutomaton_internal_8 + # LOCAL local_prompt_at_CellularAutomaton_internal_8 --> -36($fp) + lw $t0, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_6 --> -28($fp) + # local_prompt_at_CellularAutomaton_internal_6 = VCALL local_prompt_at_CellularAutomaton_internal_5 out_string + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt_at_CellularAutomaton_internal_11 --> -48($fp) + # local_prompt_at_CellularAutomaton_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_11 --> -48($fp) + # local_prompt_at_CellularAutomaton_internal_9 = local_prompt_at_CellularAutomaton_internal_11 + lw $t0, -48($fp) + sw $t0, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_10 --> -44($fp) + # local_prompt_at_CellularAutomaton_internal_10 = VCALL local_prompt_at_CellularAutomaton_internal_9 in_string + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_10 --> -44($fp) + # local_prompt_at_CellularAutomaton_ans_0 = local_prompt_at_CellularAutomaton_internal_10 + lw $t0, -44($fp) + sw $t0, -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_14 --> -60($fp) + # local_prompt_at_CellularAutomaton_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_14 --> -60($fp) + # local_prompt_at_CellularAutomaton_internal_12 = local_prompt_at_CellularAutomaton_internal_14 + lw $t0, -60($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_82 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -64($fp) + # ARG local_prompt_at_CellularAutomaton_internal_15 + # LOCAL local_prompt_at_CellularAutomaton_internal_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_13 --> -56($fp) + # local_prompt_at_CellularAutomaton_internal_13 = VCALL local_prompt_at_CellularAutomaton_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_83 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -84($fp) + # IF_ZERO local_prompt_at_CellularAutomaton_ans_0 GOTO label_FALSE_489 + # IF_ZERO local_prompt_at_CellularAutomaton_ans_0 GOTO label_FALSE_489 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_489 + # IF_ZERO local_prompt_at_CellularAutomaton_internal_20 GOTO label_FALSE_489 + # IF_ZERO local_prompt_at_CellularAutomaton_internal_20 GOTO label_FALSE_489 + lw $t0, -84($fp) + beq $t0, 0, label_FALSE_489 + # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_COMPARE_STRING_492 + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_COMPARE_STRING_492 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_STRING_492 + # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_493 + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_493 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_493 + # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_493 + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_493 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_493 + # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -84($fp) + sub $a0, $a0, $a1 + sw $a0, -80($fp) + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_TRUE_490 + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_TRUE_490 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_490 + # GOTO label_FALSE_489 + j label_FALSE_489 + label_COMPARE_BY_VALUE_493: + # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) + lw $a0, -4($fp) + lw $a1, -84($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -80($fp) + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_TRUE_490 + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_TRUE_490 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_490 + # GOTO label_FALSE_489 + j label_FALSE_489 + label_COMPARE_STRING_492: + # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -84($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -80($fp) + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_CONTINUE_494 + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_CONTINUE_494 + lw $t0, -80($fp) + beq $t0, 0, label_CONTINUE_494 + # GOTO label_FALSE_489 + j label_FALSE_489 + label_CONTINUE_494: + # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -84($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_495: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_496 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_495 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_496: + # Store result + sw $a2, -80($fp) + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_TRUE_490 + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_TRUE_490 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_490 + label_FALSE_489: + # LOCAL local_prompt_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -76($fp) + # GOTO label_END_491 +j label_END_491 +label_TRUE_490: + # LOCAL local_prompt_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -76($fp) + label_END_491: +# LOCAL local_prompt_at_CellularAutomaton_internal_16 --> -68($fp) +# LOCAL local_prompt_at_CellularAutomaton_internal_18 --> -76($fp) +# Obtain value from -76($fp) +lw $v0, -76($fp) +lw $v0, 12($v0) +sw $v0, -68($fp) +# IF_ZERO local_prompt_at_CellularAutomaton_internal_16 GOTO label_FALSEIF_487 +# IF_ZERO local_prompt_at_CellularAutomaton_internal_16 GOTO label_FALSEIF_487 +lw $t0, -68($fp) +beq $t0, 0, label_FALSEIF_487 +# LOCAL local_prompt_at_CellularAutomaton_internal_21 --> -88($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -88($fp) +# LOCAL local_prompt_at_CellularAutomaton_internal_17 --> -72($fp) +# LOCAL local_prompt_at_CellularAutomaton_internal_21 --> -88($fp) +# local_prompt_at_CellularAutomaton_internal_17 = local_prompt_at_CellularAutomaton_internal_21 +lw $t0, -88($fp) +sw $t0, -72($fp) +# GOTO label_ENDIF_488 +j label_ENDIF_488 +label_FALSEIF_487: + # LOCAL local_prompt_at_CellularAutomaton_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -92($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_17 --> -72($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_22 --> -92($fp) + # local_prompt_at_CellularAutomaton_internal_17 = local_prompt_at_CellularAutomaton_internal_22 + lw $t0, -92($fp) + sw $t0, -72($fp) + label_ENDIF_488: +# RETURN local_prompt_at_CellularAutomaton_internal_17 +lw $v0, -72($fp) +# Deallocate stack frame for function function_prompt_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 100 +jr $ra +# Function END + + +# function_prompt2_at_CellularAutomaton implementation. +# @Params: +function_prompt2_at_CellularAutomaton: + # Allocate stack frame for function function_prompt2_at_CellularAutomaton. + subu $sp, $sp, 100 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 100 + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_3 --> -16($fp) + # local_prompt2_at_CellularAutomaton_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_3 --> -16($fp) + # local_prompt2_at_CellularAutomaton_internal_1 = local_prompt2_at_CellularAutomaton_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_84 + sw $t0, 12($v0) + li $t0, 2 + sw $t0, 16($v0) + sw $v0, -20($fp) + # ARG local_prompt2_at_CellularAutomaton_internal_4 + # LOCAL local_prompt2_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_2 --> -12($fp) + # local_prompt2_at_CellularAutomaton_internal_2 = VCALL local_prompt2_at_CellularAutomaton_internal_1 out_string + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt2_at_CellularAutomaton_internal_7 --> -32($fp) + # local_prompt2_at_CellularAutomaton_internal_7 = SELF + sw $s1, -32($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_7 --> -32($fp) + # local_prompt2_at_CellularAutomaton_internal_5 = local_prompt2_at_CellularAutomaton_internal_7 + lw $t0, -32($fp) + sw $t0, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_85 + sw $t0, 12($v0) + li $t0, 48 + sw $t0, 16($v0) + sw $v0, -36($fp) + # ARG local_prompt2_at_CellularAutomaton_internal_8 + # LOCAL local_prompt2_at_CellularAutomaton_internal_8 --> -36($fp) + lw $t0, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_6 --> -28($fp) + # local_prompt2_at_CellularAutomaton_internal_6 = VCALL local_prompt2_at_CellularAutomaton_internal_5 out_string + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt2_at_CellularAutomaton_internal_11 --> -48($fp) + # local_prompt2_at_CellularAutomaton_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_11 --> -48($fp) + # local_prompt2_at_CellularAutomaton_internal_9 = local_prompt2_at_CellularAutomaton_internal_11 + lw $t0, -48($fp) + sw $t0, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_86 + sw $t0, 12($v0) + li $t0, 49 + sw $t0, 16($v0) + sw $v0, -52($fp) + # ARG local_prompt2_at_CellularAutomaton_internal_12 + # LOCAL local_prompt2_at_CellularAutomaton_internal_12 --> -52($fp) + lw $t0, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_10 --> -44($fp) + # local_prompt2_at_CellularAutomaton_internal_10 = VCALL local_prompt2_at_CellularAutomaton_internal_9 out_string + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt2_at_CellularAutomaton_internal_15 --> -64($fp) + # local_prompt2_at_CellularAutomaton_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_15 --> -64($fp) + # local_prompt2_at_CellularAutomaton_internal_13 = local_prompt2_at_CellularAutomaton_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_14 --> -60($fp) + # local_prompt2_at_CellularAutomaton_internal_14 = VCALL local_prompt2_at_CellularAutomaton_internal_13 in_string + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_14 --> -60($fp) + # local_prompt2_at_CellularAutomaton_ans_0 = local_prompt2_at_CellularAutomaton_internal_14 + lw $t0, -60($fp) + sw $t0, -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_87 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -84($fp) + # IF_ZERO local_prompt2_at_CellularAutomaton_ans_0 GOTO label_FALSE_499 + # IF_ZERO local_prompt2_at_CellularAutomaton_ans_0 GOTO label_FALSE_499 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_499 + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_20 GOTO label_FALSE_499 + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_20 GOTO label_FALSE_499 + lw $t0, -84($fp) + beq $t0, 0, label_FALSE_499 + # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_COMPARE_STRING_502 + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_COMPARE_STRING_502 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_STRING_502 + # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_503 + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_503 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_503 + # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_503 + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_503 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_503 + # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -84($fp) + sub $a0, $a0, $a1 + sw $a0, -80($fp) + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_TRUE_500 + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_TRUE_500 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_500 + # GOTO label_FALSE_499 + j label_FALSE_499 + label_COMPARE_BY_VALUE_503: + # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) + lw $a0, -4($fp) + lw $a1, -84($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -80($fp) + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_TRUE_500 + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_TRUE_500 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_500 + # GOTO label_FALSE_499 + j label_FALSE_499 + label_COMPARE_STRING_502: + # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -84($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -80($fp) + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_CONTINUE_504 + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_CONTINUE_504 + lw $t0, -80($fp) + beq $t0, 0, label_CONTINUE_504 + # GOTO label_FALSE_499 + j label_FALSE_499 + label_CONTINUE_504: + # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -84($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_505: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_506 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_505 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_506: + # Store result + sw $a2, -80($fp) + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_TRUE_500 + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_TRUE_500 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_500 + label_FALSE_499: + # LOCAL local_prompt2_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -76($fp) + # GOTO label_END_501 +j label_END_501 +label_TRUE_500: + # LOCAL local_prompt2_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -76($fp) + label_END_501: +# LOCAL local_prompt2_at_CellularAutomaton_internal_16 --> -68($fp) +# LOCAL local_prompt2_at_CellularAutomaton_internal_18 --> -76($fp) +# Obtain value from -76($fp) +lw $v0, -76($fp) +lw $v0, 12($v0) +sw $v0, -68($fp) +# IF_ZERO local_prompt2_at_CellularAutomaton_internal_16 GOTO label_FALSEIF_497 +# IF_ZERO local_prompt2_at_CellularAutomaton_internal_16 GOTO label_FALSEIF_497 +lw $t0, -68($fp) +beq $t0, 0, label_FALSEIF_497 +# LOCAL local_prompt2_at_CellularAutomaton_internal_21 --> -88($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -88($fp) +# LOCAL local_prompt2_at_CellularAutomaton_internal_17 --> -72($fp) +# LOCAL local_prompt2_at_CellularAutomaton_internal_21 --> -88($fp) +# local_prompt2_at_CellularAutomaton_internal_17 = local_prompt2_at_CellularAutomaton_internal_21 +lw $t0, -88($fp) +sw $t0, -72($fp) +# GOTO label_ENDIF_498 +j label_ENDIF_498 +label_FALSEIF_497: + # LOCAL local_prompt2_at_CellularAutomaton_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -92($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_17 --> -72($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_22 --> -92($fp) + # local_prompt2_at_CellularAutomaton_internal_17 = local_prompt2_at_CellularAutomaton_internal_22 + lw $t0, -92($fp) + sw $t0, -72($fp) + label_ENDIF_498: +# RETURN local_prompt2_at_CellularAutomaton_internal_17 +lw $v0, -72($fp) +# Deallocate stack frame for function function_prompt2_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 100 +jr $ra +# Function END + + +# __Main__attrib__cells__init implementation. +# @Params: +__Main__attrib__cells__init: + # Allocate stack frame for function __Main__attrib__cells__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__cells__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 160 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 160 + # LOCAL local_main_at_Main_continue_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_main_at_Main_choice_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -8($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_88 + sw $t0, 12($v0) + li $t0, 29 + sw $t0, 16($v0) + sw $v0, -24($fp) + # ARG local_main_at_Main_internal_5 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 + lw $t0, -36($fp) + sw $t0, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_89 + sw $t0, 12($v0) + li $t0, 47 + sw $t0, 16($v0) + sw $v0, -40($fp) + # ARG local_main_at_Main_internal_9 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + lw $t0, -40($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_string + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_WHILE_507: + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = SELF + sw $s1, -56($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_11 = local_main_at_Main_internal_13 + lw $t0, -56($fp) + sw $t0, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = VCALL local_main_at_Main_internal_11 prompt2 + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 112($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # Obtain value from -52($fp) + lw $v0, -52($fp) + lw $v0, 12($v0) + sw $v0, -44($fp) + # IF_ZERO local_main_at_Main_internal_10 GOTO label_WHILE_END_508 + # IF_ZERO local_main_at_Main_internal_10 GOTO label_WHILE_END_508 + lw $t0, -44($fp) + beq $t0, 0, label_WHILE_END_508 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + # LOCAL local_main_at_Main_continue_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_continue_0 = local_main_at_Main_internal_14 + lw $t0, -60($fp) + sw $t0, -4($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = SELF + sw $s1, -72($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 + lw $t0, -72($fp) + sw $t0, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 option + # Save new self pointer in $s1 + lw $s1, -64($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_choice_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_choice_1 = local_main_at_Main_internal_16 + lw $t0, -68($fp) + sw $t0, -8($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_20 = ALLOCATE CellularAutomaton + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, CellularAutomaton + sw $t0, 12($v0) + li $t0, 17 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 28 bytes of memory + li $a0, 28 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, CellularAutomaton_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Board__attrib__rows__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Board__attrib__columns__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Board__attrib__board_size__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __CellularAutomaton__attrib__population_map__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -84($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 + lw $t0, -84($fp) + sw $t0, -76($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_choice_1 + # LOCAL local_main_at_Main_choice_1 --> -8($fp) + lw $t0, -8($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 init + # Save new self pointer in $s1 + lw $s1, -76($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 92($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -80($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + lw $t0, -80($fp) + sw $t0, 28($s1) + # local_main_at_Main_internal_23 = GETATTRIBUTE cells Main + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + lw $t0, 28($s1) + sw $t0, -96($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # local_main_at_Main_internal_21 = local_main_at_Main_internal_23 + lw $t0, -96($fp) + sw $t0, -88($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # local_main_at_Main_internal_22 = VCALL local_main_at_Main_internal_21 print + # Save new self pointer in $s1 + lw $s1, -88($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -92($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_WHILE_509: + # LOCAL local_main_at_Main_internal_24 --> -100($fp) + # LOCAL local_main_at_Main_continue_0 --> -4($fp) + # Obtain value from -4($fp) + lw $v0, -4($fp) + lw $v0, 12($v0) + sw $v0, -100($fp) + # IF_ZERO local_main_at_Main_internal_24 GOTO label_WHILE_END_510 + # IF_ZERO local_main_at_Main_internal_24 GOTO label_WHILE_END_510 + lw $t0, -100($fp) + beq $t0, 0, label_WHILE_END_510 + # LOCAL local_main_at_Main_internal_29 --> -120($fp) + # local_main_at_Main_internal_29 = SELF + sw $s1, -120($fp) + # LOCAL local_main_at_Main_internal_27 --> -112($fp) + # LOCAL local_main_at_Main_internal_29 --> -120($fp) + # local_main_at_Main_internal_27 = local_main_at_Main_internal_29 + lw $t0, -120($fp) + sw $t0, -112($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_27 --> -112($fp) + # LOCAL local_main_at_Main_internal_28 --> -116($fp) + # local_main_at_Main_internal_28 = VCALL local_main_at_Main_internal_27 prompt + # Save new self pointer in $s1 + lw $s1, -112($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -116($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_25 --> -104($fp) + # LOCAL local_main_at_Main_internal_28 --> -116($fp) + # Obtain value from -116($fp) + lw $v0, -116($fp) + lw $v0, 12($v0) + sw $v0, -104($fp) + # IF_ZERO local_main_at_Main_internal_25 GOTO label_FALSEIF_511 + # IF_ZERO local_main_at_Main_internal_25 GOTO label_FALSEIF_511 + lw $t0, -104($fp) + beq $t0, 0, label_FALSEIF_511 + # local_main_at_Main_internal_32 = GETATTRIBUTE cells Main + # LOCAL local_main_at_Main_internal_32 --> -132($fp) + lw $t0, 28($s1) + sw $t0, -132($fp) + # LOCAL local_main_at_Main_internal_30 --> -124($fp) + # LOCAL local_main_at_Main_internal_32 --> -132($fp) + # local_main_at_Main_internal_30 = local_main_at_Main_internal_32 + lw $t0, -132($fp) + sw $t0, -124($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_30 --> -124($fp) + # LOCAL local_main_at_Main_internal_31 --> -128($fp) + # local_main_at_Main_internal_31 = VCALL local_main_at_Main_internal_30 evolve + # Save new self pointer in $s1 + lw $s1, -124($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -128($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_main_at_Main_internal_35 = GETATTRIBUTE cells Main + # LOCAL local_main_at_Main_internal_35 --> -144($fp) + lw $t0, 28($s1) + sw $t0, -144($fp) + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # LOCAL local_main_at_Main_internal_35 --> -144($fp) + # local_main_at_Main_internal_33 = local_main_at_Main_internal_35 + lw $t0, -144($fp) + sw $t0, -136($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # LOCAL local_main_at_Main_internal_34 --> -140($fp) + # local_main_at_Main_internal_34 = VCALL local_main_at_Main_internal_33 print + # Save new self pointer in $s1 + lw $s1, -136($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -140($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_26 --> -108($fp) + # LOCAL local_main_at_Main_internal_34 --> -140($fp) + # local_main_at_Main_internal_26 = local_main_at_Main_internal_34 + lw $t0, -140($fp) + sw $t0, -108($fp) + # GOTO label_ENDIF_512 +j label_ENDIF_512 +label_FALSEIF_511: + # LOCAL local_main_at_Main_internal_36 --> -148($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -148($fp) + # LOCAL local_main_at_Main_continue_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_36 --> -148($fp) + # local_main_at_Main_continue_0 = local_main_at_Main_internal_36 + lw $t0, -148($fp) + sw $t0, -4($fp) + # LOCAL local_main_at_Main_internal_26 --> -108($fp) + # local_main_at_Main_internal_26 = + label_ENDIF_512: +# GOTO label_WHILE_509 +j label_WHILE_509 +label_WHILE_END_510: + # GOTO label_WHILE_507 + j label_WHILE_507 + label_WHILE_END_508: + # LOCAL local_main_at_Main_internal_37 --> -152($fp) + # local_main_at_Main_internal_37 = SELF + sw $s1, -152($fp) + # RETURN local_main_at_Main_internal_37 + lw $v0, -152($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 160 + jr $ra + # Function END + diff --git a/tests/codegen/list.mips b/tests/codegen/list.mips index 2bb9cfab..e52d078d 100644 --- a/tests/codegen/list.mips +++ b/tests/codegen/list.mips @@ -1,10 +1,11 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:51 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:13 2020 # School of Math and Computer Science, University of Havana # .data +dummy: .word 0 IO: .asciiz "IO" # Function END Object: .asciiz "Object" @@ -25,7 +26,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +IO_vtable: .word dummy, function_in_string_at_IO, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, function_out_string_at_IO, function_type_name_at_Object, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, function_out_int_at_IO, dummy # Function END # @@ -39,7 +40,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Object_vtable: .word dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -53,7 +54,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, function_concat_at_String, function_length_at_String, dummy, dummy, dummy, dummy, dummy, function_substr_at_String # Function END # @@ -67,7 +68,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Bool_vtable: .word dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -81,7 +82,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Int_vtable: .word dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -95,7 +96,7 @@ Int_end: # **** VTABLE for type List **** -List_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_isNil_at_List, function_head_at_List, function_tail_at_List, function_cons_at_List +List_vtable: .word function_isNil_at_List, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, function_cons_at_List, dummy, function_type_name_at_Object, dummy, dummy, function_head_at_List, dummy, dummy, function_tail_at_List, dummy, dummy # Function END # @@ -109,7 +110,7 @@ List_end: # **** VTABLE for type Cons **** -Cons_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_isNil_at_Cons, function_head_at_Cons, function_tail_at_Cons, function_cons_at_List, function_init_at_Cons +Cons_vtable: .word function_isNil_at_Cons, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, function_cons_at_List, dummy, function_type_name_at_Object, dummy, dummy, function_head_at_Cons, dummy, function_init_at_Cons, function_tail_at_Cons, dummy, dummy # Function END # @@ -123,7 +124,7 @@ Cons_end: # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_print_list_at_Main, function_main_at_Main +Main_vtable: .word dummy, function_in_string_at_IO, function_abort_at_Object, function_print_list_at_Main, function_main_at_Main, function_copy_at_Object, dummy, function_out_string_at_IO, function_type_name_at_Object, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, function_out_int_at_IO, dummy # Function END # @@ -438,7 +439,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -699,7 +700,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 32($t0) + lw $t1, 16($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -797,7 +798,7 @@ function_head_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -877,7 +878,7 @@ function_tail_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -996,7 +997,7 @@ function_cons_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1277,7 +1278,7 @@ function_print_list_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -1339,7 +1340,7 @@ function_print_list_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -1383,7 +1384,7 @@ label_FALSEIF_1: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -52($fp) @@ -1406,7 +1407,7 @@ label_FALSEIF_1: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -1458,7 +1459,7 @@ label_FALSEIF_1: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -1494,7 +1495,7 @@ label_FALSEIF_1: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -1517,7 +1518,7 @@ label_FALSEIF_1: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -76($fp) @@ -1928,7 +1929,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -76($fp) @@ -2052,7 +2053,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -2081,7 +2082,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -108($fp) diff --git a/tests/codegen/new_complex.mips b/tests/codegen/new_complex.mips index 40b4db59..808308d4 100644 --- a/tests/codegen/new_complex.mips +++ b/tests/codegen/new_complex.mips @@ -1,10 +1,11 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:49 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:11 2020 # School of Math and Computer Science, University of Havana # .data +dummy: .word 0 IO: .asciiz "IO" # Function END Object: .asciiz "Object" @@ -23,7 +24,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +IO_vtable: .word function_in_int_at_IO, dummy, function_out_string_at_IO, function_out_int_at_IO, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_in_string_at_IO, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy # Function END # @@ -37,7 +38,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy # Function END # @@ -51,7 +52,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_length_at_String, function_type_name_at_Object, function_concat_at_String, dummy, dummy, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, function_substr_at_String, dummy # Function END # @@ -65,7 +66,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy # Function END # @@ -79,7 +80,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy # Function END # @@ -93,7 +94,7 @@ Int_end: # **** VTABLE for type Complex **** -Complex_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Complex, function_print_at_Complex, function_reflect_0_at_Complex, function_reflect_X_at_Complex, function_reflect_Y_at_Complex, function_equal_at_Complex, function_x_value_at_Complex, function_y_value_at_Complex +Complex_vtable: .word function_in_int_at_IO, function_equal_at_Complex, function_out_string_at_IO, function_out_int_at_IO, function_reflect_X_at_Complex, function_reflect_Y_at_Complex, dummy, function_type_name_at_Object, dummy, function_print_at_Complex, function_in_string_at_IO, function_abort_at_Object, function_init_at_Complex, function_copy_at_Object, dummy, function_y_value_at_Complex, function_x_value_at_Complex, dummy, function_reflect_0_at_Complex # Function END # @@ -107,7 +108,7 @@ Complex_end: # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +Main_vtable: .word function_in_int_at_IO, dummy, function_out_string_at_IO, function_out_int_at_IO, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_in_string_at_IO, function_abort_at_Object, dummy, function_copy_at_Object, function_main_at_Main, dummy, dummy, dummy, dummy # Function END # @@ -437,7 +438,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -690,7 +691,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 28($t0) + lw $t1, 56($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -1516,7 +1517,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -1562,7 +1563,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -1611,7 +1612,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -1646,7 +1647,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -1695,7 +1696,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -2792,7 +2793,7 @@ function_equal_at_Complex: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -3026,7 +3027,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 56($t0) +lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -3582,7 +3583,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -3612,7 +3613,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -3637,7 +3638,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -3894,7 +3895,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -3954,7 +3955,7 @@ label_FALSEIF_79: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -3985,7 +3986,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 40($t0) +lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -120($fp) @@ -4010,7 +4011,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 44($t0) +lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -112($fp) @@ -4043,7 +4044,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 36($t0) +lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -128($fp) @@ -4066,7 +4067,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 48($t0) +lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -104($fp) @@ -4128,7 +4129,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -4188,7 +4189,7 @@ label_FALSEIF_89: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -152($fp) diff --git a/tests/codegen/palindrome.mips b/tests/codegen/palindrome.mips new file mode 100644 index 00000000..286b6a9f --- /dev/null +++ b/tests/codegen/palindrome.mips @@ -0,0 +1,2420 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:14 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_out_string_at_IO, dummy, function_out_int_at_IO, dummy, function_in_string_at_IO, dummy, function_type_name_at_Object, function_copy_at_Object, function_abort_at_Object, dummy, function_in_int_at_IO, dummy +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word dummy, function_length_at_String, dummy, dummy, dummy, function_substr_at_String, function_type_name_at_Object, function_copy_at_Object, function_abort_at_Object, function_concat_at_String, dummy, dummy +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, dummy, function_out_int_at_IO, function_main_at_Main, function_in_string_at_IO, dummy, function_type_name_at_Object, function_copy_at_Object, function_abort_at_Object, dummy, function_in_int_at_IO, function_pal_at_Main +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "enter a string\n" +# + + +data_5: .asciiz "that was a palindrome\n" +# + + +data_6: .asciiz "that was not a palindrome\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__i__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 12($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__i__init implementation. +# @Params: +__Main__attrib__i__init: + # Allocate stack frame for function __Main__attrib__i__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__i__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__i__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__i__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_pal_at_Main implementation. +# @Params: +# 0($fp) = param_pal_at_Main_s_0 +function_pal_at_Main: + # Allocate stack frame for function function_pal_at_Main. + subu $sp, $sp, 176 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 176 + # LOCAL local_pal_at_Main_internal_4 --> -20($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_4 = PARAM param_pal_at_Main_s_0 + lw $t0, 0($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_4 --> -20($fp) + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # local_pal_at_Main_internal_5 = VCALL local_pal_at_Main_internal_4 length + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # IF_ZERO local_pal_at_Main_internal_5 GOTO label_FALSE_3 + # IF_ZERO local_pal_at_Main_internal_5 GOTO label_FALSE_3 + lw $t0, -24($fp) + beq $t0, 0, label_FALSE_3 + # IF_ZERO local_pal_at_Main_internal_6 GOTO label_FALSE_3 + # IF_ZERO local_pal_at_Main_internal_6 GOTO label_FALSE_3 + lw $t0, -28($fp) + beq $t0, 0, label_FALSE_3 + # LOCAL local_pal_at_Main_internal_3 --> -16($fp) + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # Comparing -24($fp) type with String + la $v0, String + lw $a0, -24($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_COMPARE_STRING_6 + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_COMPARE_STRING_6 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_6 + # LOCAL local_pal_at_Main_internal_3 --> -16($fp) + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # Comparing -24($fp) type with Bool + la $v0, Bool + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_COMPARE_BY_VALUE_7 + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_COMPARE_BY_VALUE_7 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_7 + # LOCAL local_pal_at_Main_internal_3 --> -16($fp) + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # Comparing -24($fp) type with Int + la $v0, Int + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_COMPARE_BY_VALUE_7 + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_COMPARE_BY_VALUE_7 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_7 + # LOCAL local_pal_at_Main_internal_3 --> -16($fp) + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + # Load pointers and SUB + lw $a0, -24($fp) + lw $a1, -28($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_TRUE_4 + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_TRUE_4 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_4 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_COMPARE_BY_VALUE_7: + # LOCAL local_pal_at_Main_internal_3 --> -16($fp) + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + lw $a0, -24($fp) + lw $a1, -28($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_TRUE_4 + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_TRUE_4 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_4 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_COMPARE_STRING_6: + # LOCAL local_pal_at_Main_internal_3 --> -16($fp) + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -28($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_CONTINUE_8 + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_CONTINUE_8 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_8 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_CONTINUE_8: + # LOCAL local_pal_at_Main_internal_3 --> -16($fp) + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -28($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_9: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_10 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_9 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_10: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_TRUE_4 + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_TRUE_4 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_4 + label_FALSE_3: + # LOCAL local_pal_at_Main_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_5 +j label_END_5 +label_TRUE_4: + # LOCAL local_pal_at_Main_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_5: +# LOCAL local_pal_at_Main_internal_0 --> -4($fp) +# LOCAL local_pal_at_Main_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_pal_at_Main_internal_0 GOTO label_FALSEIF_1 +# IF_ZERO local_pal_at_Main_internal_0 GOTO label_FALSEIF_1 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_1 +# LOCAL local_pal_at_Main_internal_7 --> -32($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -32($fp) +# LOCAL local_pal_at_Main_internal_1 --> -8($fp) +# LOCAL local_pal_at_Main_internal_7 --> -32($fp) +# local_pal_at_Main_internal_1 = local_pal_at_Main_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_pal_at_Main_internal_12 --> -52($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_12 = PARAM param_pal_at_Main_s_0 + lw $t0, 0($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_12 --> -52($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # local_pal_at_Main_internal_13 = VCALL local_pal_at_Main_internal_12 length + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + # IF_ZERO local_pal_at_Main_internal_13 GOTO label_FALSE_13 + # IF_ZERO local_pal_at_Main_internal_13 GOTO label_FALSE_13 + lw $t0, -56($fp) + beq $t0, 0, label_FALSE_13 + # IF_ZERO local_pal_at_Main_internal_14 GOTO label_FALSE_13 + # IF_ZERO local_pal_at_Main_internal_14 GOTO label_FALSE_13 + lw $t0, -60($fp) + beq $t0, 0, label_FALSE_13 + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # Comparing -56($fp) type with String + la $v0, String + lw $a0, -56($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_COMPARE_STRING_16 + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_COMPARE_STRING_16 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_STRING_16 + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # Comparing -56($fp) type with Bool + la $v0, Bool + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_COMPARE_BY_VALUE_17 + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_COMPARE_BY_VALUE_17 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_17 + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # Comparing -56($fp) type with Int + la $v0, Int + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_COMPARE_BY_VALUE_17 + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_COMPARE_BY_VALUE_17 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_17 + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # LOCAL local_pal_at_Main_internal_14 --> -60($fp) + # Load pointers and SUB + lw $a0, -56($fp) + lw $a1, -60($fp) + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_14 + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_14 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_14 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_COMPARE_BY_VALUE_17: + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # LOCAL local_pal_at_Main_internal_14 --> -60($fp) + lw $a0, -56($fp) + lw $a1, -60($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_14 + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_14 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_14 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_COMPARE_STRING_16: + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # LOCAL local_pal_at_Main_internal_14 --> -60($fp) + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -60($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -48($fp) + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_CONTINUE_18 + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_CONTINUE_18 + lw $t0, -48($fp) + beq $t0, 0, label_CONTINUE_18 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_CONTINUE_18: + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # LOCAL local_pal_at_Main_internal_14 --> -60($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -60($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_19: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_20 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_19 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_20: + # Store result + sw $a2, -48($fp) + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_14 + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_14 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_14 + label_FALSE_13: + # LOCAL local_pal_at_Main_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -44($fp) + # GOTO label_END_15 +j label_END_15 +label_TRUE_14: + # LOCAL local_pal_at_Main_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + label_END_15: +# LOCAL local_pal_at_Main_internal_8 --> -36($fp) +# LOCAL local_pal_at_Main_internal_10 --> -44($fp) +# Obtain value from -44($fp) +lw $v0, -44($fp) +lw $v0, 12($v0) +sw $v0, -36($fp) +# IF_ZERO local_pal_at_Main_internal_8 GOTO label_FALSEIF_11 +# IF_ZERO local_pal_at_Main_internal_8 GOTO label_FALSEIF_11 +lw $t0, -36($fp) +beq $t0, 0, label_FALSEIF_11 +# LOCAL local_pal_at_Main_internal_15 --> -64($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -64($fp) +# LOCAL local_pal_at_Main_internal_9 --> -40($fp) +# LOCAL local_pal_at_Main_internal_15 --> -64($fp) +# local_pal_at_Main_internal_9 = local_pal_at_Main_internal_15 +lw $t0, -64($fp) +sw $t0, -40($fp) +# GOTO label_ENDIF_12 +j label_ENDIF_12 +label_FALSEIF_11: + # LOCAL local_pal_at_Main_internal_20 --> -84($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_20 = PARAM param_pal_at_Main_s_0 + lw $t0, 0($fp) + sw $t0, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -92($fp) + # ARG local_pal_at_Main_internal_22 + # LOCAL local_pal_at_Main_internal_22 --> -92($fp) + lw $t0, -92($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_pal_at_Main_internal_23 --> -96($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -96($fp) + # ARG local_pal_at_Main_internal_23 + # LOCAL local_pal_at_Main_internal_23 --> -96($fp) + lw $t0, -96($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_pal_at_Main_internal_20 --> -84($fp) + # LOCAL local_pal_at_Main_internal_21 --> -88($fp) + # local_pal_at_Main_internal_21 = VCALL local_pal_at_Main_internal_20 substr + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_24 --> -100($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_24 = PARAM param_pal_at_Main_s_0 + lw $t0, 0($fp) + sw $t0, -100($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_27 --> -112($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_27 = PARAM param_pal_at_Main_s_0 + lw $t0, 0($fp) + sw $t0, -112($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_27 --> -112($fp) + # LOCAL local_pal_at_Main_internal_28 --> -116($fp) + # local_pal_at_Main_internal_28 = VCALL local_pal_at_Main_internal_27 length + # Save new self pointer in $s1 + lw $s1, -112($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -116($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_29 --> -120($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -120($fp) + # LOCAL local_pal_at_Main_internal_26 --> -108($fp) + # LOCAL local_pal_at_Main_internal_28 --> -116($fp) + # LOCAL local_pal_at_Main_internal_29 --> -120($fp) + # local_pal_at_Main_internal_26 = local_pal_at_Main_internal_28 - local_pal_at_Main_internal_29 + lw $t1, -116($fp) + lw $t0, 12($t1) + lw $t1, -120($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -108($fp) + # ARG local_pal_at_Main_internal_26 + # LOCAL local_pal_at_Main_internal_26 --> -108($fp) + lw $t0, -108($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_pal_at_Main_internal_30 --> -124($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -124($fp) + # ARG local_pal_at_Main_internal_30 + # LOCAL local_pal_at_Main_internal_30 --> -124($fp) + lw $t0, -124($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_pal_at_Main_internal_24 --> -100($fp) + # LOCAL local_pal_at_Main_internal_25 --> -104($fp) + # local_pal_at_Main_internal_25 = VCALL local_pal_at_Main_internal_24 substr + # Save new self pointer in $s1 + lw $s1, -100($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -104($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # IF_ZERO local_pal_at_Main_internal_21 GOTO label_FALSE_23 + # IF_ZERO local_pal_at_Main_internal_21 GOTO label_FALSE_23 + lw $t0, -88($fp) + beq $t0, 0, label_FALSE_23 + # IF_ZERO local_pal_at_Main_internal_25 GOTO label_FALSE_23 + # IF_ZERO local_pal_at_Main_internal_25 GOTO label_FALSE_23 + lw $t0, -104($fp) + beq $t0, 0, label_FALSE_23 + # LOCAL local_pal_at_Main_internal_19 --> -80($fp) + # LOCAL local_pal_at_Main_internal_21 --> -88($fp) + # Comparing -88($fp) type with String + la $v0, String + lw $a0, -88($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_COMPARE_STRING_26 + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_COMPARE_STRING_26 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_STRING_26 + # LOCAL local_pal_at_Main_internal_19 --> -80($fp) + # LOCAL local_pal_at_Main_internal_21 --> -88($fp) + # Comparing -88($fp) type with Bool + la $v0, Bool + lw $a0, -88($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_COMPARE_BY_VALUE_27 + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_COMPARE_BY_VALUE_27 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_27 + # LOCAL local_pal_at_Main_internal_19 --> -80($fp) + # LOCAL local_pal_at_Main_internal_21 --> -88($fp) + # Comparing -88($fp) type with Int + la $v0, Int + lw $a0, -88($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_COMPARE_BY_VALUE_27 + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_COMPARE_BY_VALUE_27 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_27 + # LOCAL local_pal_at_Main_internal_19 --> -80($fp) + # LOCAL local_pal_at_Main_internal_21 --> -88($fp) + # LOCAL local_pal_at_Main_internal_25 --> -104($fp) + # Load pointers and SUB + lw $a0, -88($fp) + lw $a1, -104($fp) + sub $a0, $a0, $a1 + sw $a0, -80($fp) + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_TRUE_24 + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_TRUE_24 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_24 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_COMPARE_BY_VALUE_27: + # LOCAL local_pal_at_Main_internal_19 --> -80($fp) + # LOCAL local_pal_at_Main_internal_21 --> -88($fp) + # LOCAL local_pal_at_Main_internal_25 --> -104($fp) + lw $a0, -88($fp) + lw $a1, -104($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -80($fp) + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_TRUE_24 + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_TRUE_24 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_24 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_COMPARE_STRING_26: + # LOCAL local_pal_at_Main_internal_19 --> -80($fp) + # LOCAL local_pal_at_Main_internal_21 --> -88($fp) + # LOCAL local_pal_at_Main_internal_25 --> -104($fp) + # Load strings for comparison + lw $v0, -88($fp) + lw $v1, -104($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -80($fp) + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_CONTINUE_28 + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_CONTINUE_28 + lw $t0, -80($fp) + beq $t0, 0, label_CONTINUE_28 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_CONTINUE_28: + # LOCAL local_pal_at_Main_internal_19 --> -80($fp) + # LOCAL local_pal_at_Main_internal_21 --> -88($fp) + # LOCAL local_pal_at_Main_internal_25 --> -104($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -88($fp) + lw $v1, -104($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_29: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_30 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_29 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_30: + # Store result + sw $a2, -80($fp) + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_TRUE_24 + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_TRUE_24 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_24 + label_FALSE_23: + # LOCAL local_pal_at_Main_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -76($fp) + # GOTO label_END_25 +j label_END_25 +label_TRUE_24: + # LOCAL local_pal_at_Main_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -76($fp) + label_END_25: +# LOCAL local_pal_at_Main_internal_16 --> -68($fp) +# LOCAL local_pal_at_Main_internal_18 --> -76($fp) +# Obtain value from -76($fp) +lw $v0, -76($fp) +lw $v0, 12($v0) +sw $v0, -68($fp) +# IF_ZERO local_pal_at_Main_internal_16 GOTO label_FALSEIF_21 +# IF_ZERO local_pal_at_Main_internal_16 GOTO label_FALSEIF_21 +lw $t0, -68($fp) +beq $t0, 0, label_FALSEIF_21 +# LOCAL local_pal_at_Main_internal_33 --> -136($fp) +# local_pal_at_Main_internal_33 = SELF +sw $s1, -136($fp) +# LOCAL local_pal_at_Main_internal_31 --> -128($fp) +# LOCAL local_pal_at_Main_internal_33 --> -136($fp) +# local_pal_at_Main_internal_31 = local_pal_at_Main_internal_33 +lw $t0, -136($fp) +sw $t0, -128($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_pal_at_Main_internal_34 --> -140($fp) +# PARAM param_pal_at_Main_s_0 --> 0($fp) +# local_pal_at_Main_internal_34 = PARAM param_pal_at_Main_s_0 +lw $t0, 0($fp) +sw $t0, -140($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_pal_at_Main_internal_36 --> -148($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -148($fp) +# ARG local_pal_at_Main_internal_36 +# LOCAL local_pal_at_Main_internal_36 --> -148($fp) +lw $t0, -148($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_pal_at_Main_internal_38 --> -156($fp) +# PARAM param_pal_at_Main_s_0 --> 0($fp) +# local_pal_at_Main_internal_38 = PARAM param_pal_at_Main_s_0 +lw $t0, 0($fp) +sw $t0, -156($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_pal_at_Main_internal_38 --> -156($fp) +# LOCAL local_pal_at_Main_internal_39 --> -160($fp) +# local_pal_at_Main_internal_39 = VCALL local_pal_at_Main_internal_38 length +# Save new self pointer in $s1 +lw $s1, -156($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 4($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -160($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_pal_at_Main_internal_40 --> -164($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 2 +sw $t0, 12($v0) +sw $v0, -164($fp) +# LOCAL local_pal_at_Main_internal_37 --> -152($fp) +# LOCAL local_pal_at_Main_internal_39 --> -160($fp) +# LOCAL local_pal_at_Main_internal_40 --> -164($fp) +# local_pal_at_Main_internal_37 = local_pal_at_Main_internal_39 - local_pal_at_Main_internal_40 +lw $t1, -160($fp) +lw $t0, 12($t1) +lw $t1, -164($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -152($fp) +# ARG local_pal_at_Main_internal_37 +# LOCAL local_pal_at_Main_internal_37 --> -152($fp) +lw $t0, -152($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_pal_at_Main_internal_34 --> -140($fp) +# LOCAL local_pal_at_Main_internal_35 --> -144($fp) +# local_pal_at_Main_internal_35 = VCALL local_pal_at_Main_internal_34 substr +# Save new self pointer in $s1 +lw $s1, -140($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 20($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -144($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_pal_at_Main_internal_35 +# LOCAL local_pal_at_Main_internal_35 --> -144($fp) +lw $t0, -144($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_pal_at_Main_internal_31 --> -128($fp) +# LOCAL local_pal_at_Main_internal_32 --> -132($fp) +# local_pal_at_Main_internal_32 = VCALL local_pal_at_Main_internal_31 pal +# Save new self pointer in $s1 +lw $s1, -128($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 44($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -132($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_pal_at_Main_internal_17 --> -72($fp) +# LOCAL local_pal_at_Main_internal_32 --> -132($fp) +# local_pal_at_Main_internal_17 = local_pal_at_Main_internal_32 +lw $t0, -132($fp) +sw $t0, -72($fp) +# GOTO label_ENDIF_22 +j label_ENDIF_22 +label_FALSEIF_21: + # LOCAL local_pal_at_Main_internal_41 --> -168($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -168($fp) + # LOCAL local_pal_at_Main_internal_17 --> -72($fp) + # LOCAL local_pal_at_Main_internal_41 --> -168($fp) + # local_pal_at_Main_internal_17 = local_pal_at_Main_internal_41 + lw $t0, -168($fp) + sw $t0, -72($fp) + label_ENDIF_22: +# LOCAL local_pal_at_Main_internal_9 --> -40($fp) +# LOCAL local_pal_at_Main_internal_17 --> -72($fp) +# local_pal_at_Main_internal_9 = local_pal_at_Main_internal_17 +lw $t0, -72($fp) +sw $t0, -40($fp) +label_ENDIF_12: +# LOCAL local_pal_at_Main_internal_1 --> -8($fp) +# LOCAL local_pal_at_Main_internal_9 --> -40($fp) +# local_pal_at_Main_internal_1 = local_pal_at_Main_internal_9 +lw $t0, -40($fp) +sw $t0, -8($fp) +label_ENDIF_2: +# RETURN local_pal_at_Main_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_pal_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 176 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 96 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 96 + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + lw $t0, -8($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -4($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -4($fp) + # + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + lw $t0, -4($fp) + sw $t0, 12($s1) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 15 + sw $t0, 16($v0) + sw $v0, -24($fp) + # ARG local_main_at_Main_internal_5 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = SELF + sw $s1, -44($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_8 = local_main_at_Main_internal_10 + lw $t0, -44($fp) + sw $t0, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = SELF + sw $s1, -56($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_11 = local_main_at_Main_internal_13 + lw $t0, -56($fp) + sw $t0, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = VCALL local_main_at_Main_internal_11 in_string + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_12 + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + lw $t0, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 pal + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # Obtain value from -40($fp) + lw $v0, -40($fp) + lw $v0, 12($v0) + sw $v0, -28($fp) + # IF_ZERO local_main_at_Main_internal_6 GOTO label_FALSEIF_31 + # IF_ZERO local_main_at_Main_internal_6 GOTO label_FALSEIF_31 + lw $t0, -28($fp) + beq $t0, 0, label_FALSEIF_31 + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_14 = local_main_at_Main_internal_16 + lw $t0, -68($fp) + sw $t0, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 22 + sw $t0, 16($v0) + sw $v0, -72($fp) + # ARG local_main_at_Main_internal_17 + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + lw $t0, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 out_string + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_15 + lw $t0, -64($fp) + sw $t0, -32($fp) + # GOTO label_ENDIF_32 +j label_ENDIF_32 +label_FALSEIF_31: + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_20 = SELF + sw $s1, -84($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 + lw $t0, -84($fp) + sw $t0, -76($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_6 + sw $t0, 12($v0) + li $t0, 26 + sw $t0, 16($v0) + sw $v0, -88($fp) + # ARG local_main_at_Main_internal_21 + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + lw $t0, -88($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 out_string + # Save new self pointer in $s1 + lw $s1, -76($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -80($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_19 + lw $t0, -80($fp) + sw $t0, -32($fp) + label_ENDIF_32: +# RETURN local_main_at_Main_internal_7 +lw $v0, -32($fp) +# Deallocate stack frame for function function_main_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 96 +jr $ra +# Function END + diff --git a/tests/codegen/primes.mips b/tests/codegen/primes.mips index d3b9e60b..62cb44d7 100644 --- a/tests/codegen/primes.mips +++ b/tests/codegen/primes.mips @@ -1,10 +1,11 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:49 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:10 2020 # School of Math and Computer Science, University of Havana # .data +dummy: .word 0 IO: .asciiz "IO" # Function END Object: .asciiz "Object" @@ -21,7 +22,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +IO_vtable: .word dummy, function_abort_at_Object, function_type_name_at_Object, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, dummy, function_out_int_at_IO, function_out_string_at_IO, function_copy_at_Object # Function END # @@ -35,7 +36,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Object_vtable: .word dummy, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object # Function END # @@ -49,7 +50,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word function_length_at_String, function_abort_at_Object, function_type_name_at_Object, function_substr_at_String, dummy, dummy, dummy, function_concat_at_String, dummy, dummy, function_copy_at_Object # Function END # @@ -63,7 +64,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Bool_vtable: .word dummy, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object # Function END # @@ -77,7 +78,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Int_vtable: .word dummy, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object # Function END # @@ -91,7 +92,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +Main_vtable: .word dummy, function_abort_at_Object, function_type_name_at_Object, dummy, function_in_string_at_IO, function_main_at_Main, function_in_int_at_IO, dummy, function_out_int_at_IO, function_out_string_at_IO, function_copy_at_Object # Function END # @@ -412,7 +413,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -705,7 +706,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 28($t0) + lw $t1, 20($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -775,7 +776,7 @@ __Main__attrib__out__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -2024,7 +2025,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -172($fp) @@ -2076,7 +2077,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -188($fp) @@ -2263,7 +2264,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 0($t0) +lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -228($fp) diff --git a/tests/codegen/print-cool.mips b/tests/codegen/print-cool.mips index cba51357..cd17ad79 100644 --- a/tests/codegen/print-cool.mips +++ b/tests/codegen/print-cool.mips @@ -1,10 +1,11 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 16:47:49 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:11 2020 # School of Math and Computer Science, University of Havana # .data +dummy: .word 0 IO: .asciiz "IO" # Function END Object: .asciiz "Object" @@ -21,7 +22,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO +IO_vtable: .word function_in_string_at_IO, function_abort_at_Object, function_copy_at_Object, function_in_int_at_IO, dummy, dummy, function_out_int_at_IO, function_out_string_at_IO, function_type_name_at_Object, dummy, dummy # Function END # @@ -35,7 +36,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Object_vtable: .word dummy, function_abort_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy # Function END # @@ -49,7 +50,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_concat_at_String, function_substr_at_String, function_length_at_String +String_vtable: .word dummy, function_abort_at_Object, function_copy_at_Object, dummy, function_length_at_String, function_concat_at_String, dummy, dummy, function_type_name_at_Object, dummy, function_substr_at_String # Function END # @@ -63,7 +64,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Bool_vtable: .word dummy, function_abort_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy # Function END # @@ -77,7 +78,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object +Int_vtable: .word dummy, function_abort_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy # Function END # @@ -91,7 +92,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_type_name_at_Object, function_copy_at_Object, function_out_string_at_IO, function_out_int_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_main_at_Main +Main_vtable: .word function_in_string_at_IO, function_abort_at_Object, function_copy_at_Object, function_in_int_at_IO, dummy, dummy, function_out_int_at_IO, function_out_string_at_IO, function_type_name_at_Object, function_main_at_Main, dummy # Function END # @@ -400,7 +401,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -653,7 +654,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 28($t0) + lw $t1, 36($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -745,7 +746,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -844,7 +845,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -867,7 +868,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -973,7 +974,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 4($t0) +lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -1072,7 +1073,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -1095,7 +1096,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1147,7 +1148,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) diff --git a/tests/codegen/sort-list.mips b/tests/codegen/sort-list.mips new file mode 100644 index 00000000..7904e774 --- /dev/null +++ b/tests/codegen/sort-list.mips @@ -0,0 +1,3364 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:14 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +Main: .asciiz "Main" +# Function END +List: .asciiz "List" +# Function END +Nil: .asciiz "Nil" +# Function END +Cons: .asciiz "Cons" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_out_string_at_IO, function_out_int_at_IO, function_in_int_at_IO, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, function_length_at_String, function_concat_at_String, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, dummy, function_iota_at_Main, function_main_at_Main, dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_out_string_at_IO, function_out_int_at_IO, function_in_int_at_IO, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +# **** VTABLE for type List **** +List_vtable: .word function_abort_at_Object, function_sort_at_List, dummy, dummy, dummy, function_rev_at_List, dummy, function_in_string_at_IO, function_isNil_at_List, function_cons_at_List, function_cdr_at_List, dummy, dummy, function_copy_at_Object, function_insert_at_List, function_car_at_List, function_out_string_at_IO, function_out_int_at_IO, function_in_int_at_IO, function_rcons_at_List, function_type_name_at_Object, function_print_list_at_List +# Function END +# + + +# **** Type RECORD for type List **** +List_start: + List_vtable_pointer: .word List_vtable + # Function END +List_end: +# + + +# **** VTABLE for type Nil **** +Nil_vtable: .word function_abort_at_Object, function_sort_at_Nil, dummy, dummy, dummy, function_rev_at_Nil, dummy, function_in_string_at_IO, function_isNil_at_Nil, function_cons_at_List, function_cdr_at_List, dummy, dummy, function_copy_at_Object, function_insert_at_Nil, function_car_at_List, function_out_string_at_IO, function_out_int_at_IO, function_in_int_at_IO, function_rcons_at_Nil, function_type_name_at_Object, function_print_list_at_Nil +# Function END +# + + +# **** Type RECORD for type Nil **** +Nil_start: + Nil_vtable_pointer: .word Nil_vtable + # Function END +Nil_end: +# + + +# **** VTABLE for type Cons **** +Cons_vtable: .word function_abort_at_Object, function_sort_at_Cons, dummy, dummy, function_init_at_Cons, function_rev_at_Cons, dummy, function_in_string_at_IO, function_isNil_at_Cons, function_cons_at_List, function_cdr_at_Cons, dummy, dummy, function_copy_at_Object, function_insert_at_Cons, function_car_at_Cons, function_out_string_at_IO, function_out_int_at_IO, function_in_int_at_IO, function_rcons_at_Cons, function_type_name_at_Object, function_print_list_at_Cons +# Function END +# + + +# **** Type RECORD for type Cons **** +Cons_start: + Cons_vtable_pointer: .word Cons_vtable + # Function END +Cons_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, 1, 1, 2, 2 +Object__TDT: .word 1, 0, 1, 1, 1, 2, 2, 3, 3 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1 +List__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 1 +Nil__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, -1 +Cons__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "How many numbers to sort? " +# + + +data_5: .asciiz "\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__l__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 12($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__l__init implementation. +# @Params: +__Main__attrib__l__init: + # Allocate stack frame for function __Main__attrib__l__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__l__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_iota_at_Main implementation. +# @Params: +# 0($fp) = param_iota_at_Main_i_0 +function_iota_at_Main: + # Allocate stack frame for function function_iota_at_Main. + subu $sp, $sp, 56 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 56 + # LOCAL local_iota_at_Main_internal_0 --> -4($fp) + # local_iota_at_Main_internal_0 = ALLOCATE Nil + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Nil + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Nil_start + sw $t0, 4($v0) + # Load type offset + li $t0, 28 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # + # LOCAL local_iota_at_Main_internal_0 --> -4($fp) + lw $t0, -4($fp) + sw $t0, 12($s1) + # LOCAL local_iota_at_Main_j_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_iota_at_Main_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_iota_at_Main_j_1 --> -8($fp) + # LOCAL local_iota_at_Main_internal_2 --> -12($fp) + # local_iota_at_Main_j_1 = local_iota_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -8($fp) + label_WHILE_1: + # LOCAL local_iota_at_Main_internal_4 --> -20($fp) + # LOCAL local_iota_at_Main_j_1 --> -8($fp) + # PARAM param_iota_at_Main_i_0 --> 0($fp) + lw $a0, -8($fp) + lw $a1, 0($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -20($fp) + # IF_GREATER_ZERO local_iota_at_Main_internal_4 GOTO label_FALSE_3 + # IF_GREATER_ZERO local_iota_at_Main_internal_4 GOTO label_FALSE_3 + lw $t0, -20($fp) + bgt $t0, 0, label_FALSE_3 + # IF_ZERO local_iota_at_Main_internal_4 GOTO label_FALSE_3 + # IF_ZERO local_iota_at_Main_internal_4 GOTO label_FALSE_3 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_3 + # LOCAL local_iota_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -20($fp) + # GOTO label_END_4 +j label_END_4 +label_FALSE_3: + # LOCAL local_iota_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + label_END_4: +# LOCAL local_iota_at_Main_internal_3 --> -16($fp) +# LOCAL local_iota_at_Main_internal_4 --> -20($fp) +# Obtain value from -20($fp) +lw $v0, -20($fp) +lw $v0, 12($v0) +sw $v0, -16($fp) +# IF_ZERO local_iota_at_Main_internal_3 GOTO label_WHILE_END_2 +# IF_ZERO local_iota_at_Main_internal_3 GOTO label_WHILE_END_2 +lw $t0, -16($fp) +beq $t0, 0, label_WHILE_END_2 +# LOCAL local_iota_at_Main_internal_7 --> -32($fp) +# local_iota_at_Main_internal_7 = ALLOCATE Cons +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Cons +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Cons_start +sw $t0, 4($v0) +# Load type offset +li $t0, 32 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __Cons__attrib__xcar__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __Cons__attrib__xcdr__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 16($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -32($fp) +# LOCAL local_iota_at_Main_internal_5 --> -24($fp) +# LOCAL local_iota_at_Main_internal_7 --> -32($fp) +# local_iota_at_Main_internal_5 = local_iota_at_Main_internal_7 +lw $t0, -32($fp) +sw $t0, -24($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_iota_at_Main_j_1 +# LOCAL local_iota_at_Main_j_1 --> -8($fp) +lw $t0, -8($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# local_iota_at_Main_internal_8 = GETATTRIBUTE l Main +# LOCAL local_iota_at_Main_internal_8 --> -36($fp) +lw $t0, 12($s1) +sw $t0, -36($fp) +# ARG local_iota_at_Main_internal_8 +# LOCAL local_iota_at_Main_internal_8 --> -36($fp) +lw $t0, -36($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_iota_at_Main_internal_5 --> -24($fp) +# LOCAL local_iota_at_Main_internal_6 --> -28($fp) +# local_iota_at_Main_internal_6 = VCALL local_iota_at_Main_internal_5 init +# Save new self pointer in $s1 +lw $s1, -24($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -28($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_iota_at_Main_internal_6 --> -28($fp) +lw $t0, -28($fp) +sw $t0, 12($s1) +# LOCAL local_iota_at_Main_internal_10 --> -44($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -44($fp) +# LOCAL local_iota_at_Main_internal_9 --> -40($fp) +# LOCAL local_iota_at_Main_j_1 --> -8($fp) +# LOCAL local_iota_at_Main_internal_10 --> -44($fp) +# local_iota_at_Main_internal_9 = local_iota_at_Main_j_1 + local_iota_at_Main_internal_10 +lw $t1, -8($fp) +lw $t0, 12($t1) +lw $t1, -44($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -40($fp) +# LOCAL local_iota_at_Main_j_1 --> -8($fp) +# LOCAL local_iota_at_Main_internal_9 --> -40($fp) +# local_iota_at_Main_j_1 = local_iota_at_Main_internal_9 +lw $t0, -40($fp) +sw $t0, -8($fp) +# GOTO label_WHILE_1 +j label_WHILE_1 +label_WHILE_END_2: + # local_iota_at_Main_internal_11 = GETATTRIBUTE l Main + # LOCAL local_iota_at_Main_internal_11 --> -48($fp) + lw $t0, 12($s1) + sw $t0, -48($fp) + # RETURN local_iota_at_Main_internal_11 + lw $v0, -48($fp) + # Deallocate stack frame for function function_iota_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 56 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 72 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 72 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 26 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 64($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 + lw $t0, -52($fp) + sw $t0, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 in_int + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 72($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_14 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + lw $t0, -60($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 iota + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 8($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_8 = local_main_at_Main_internal_11 + lw $t0, -48($fp) + sw $t0, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 rev + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_9 + lw $t0, -40($fp) + sw $t0, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 sort + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_7 + lw $t0, -32($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 print_list + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 84($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_5 + lw $v0, -24($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 72 + jr $ra + # Function END + + +# function_isNil_at_List implementation. +# @Params: +function_isNil_at_List: + # Allocate stack frame for function function_isNil_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_List_internal_2 --> -12($fp) + # local_isNil_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_isNil_at_List_internal_0 --> -4($fp) + # LOCAL local_isNil_at_List_internal_2 --> -12($fp) + # local_isNil_at_List_internal_0 = local_isNil_at_List_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_isNil_at_List_internal_0 --> -4($fp) + # LOCAL local_isNil_at_List_internal_1 --> -8($fp) + # local_isNil_at_List_internal_1 = VCALL local_isNil_at_List_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_isNil_at_List_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -16($fp) + # RETURN local_isNil_at_List_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_isNil_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cons_at_List implementation. +# @Params: +# 0($fp) = param_cons_at_List_hd_0 +function_cons_at_List: + # Allocate stack frame for function function_cons_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cons_at_List_new_cell_0 --> -4($fp) + # local_cons_at_List_new_cell_0 = 0 + li $t0, 0 + sw $t0, -4($fp) + # LOCAL local_cons_at_List_internal_1 --> -8($fp) + # local_cons_at_List_internal_1 = ALLOCATE Cons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Cons + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Cons_start + sw $t0, 4($v0) + # Load type offset + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Cons__attrib__xcar__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Cons__attrib__xcdr__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # LOCAL local_cons_at_List_new_cell_0 --> -4($fp) + # LOCAL local_cons_at_List_internal_1 --> -8($fp) + # local_cons_at_List_new_cell_0 = local_cons_at_List_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_cons_at_List_internal_2 --> -12($fp) + # LOCAL local_cons_at_List_new_cell_0 --> -4($fp) + # local_cons_at_List_internal_2 = local_cons_at_List_new_cell_0 + lw $t0, -4($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cons_at_List_hd_0 + # PARAM param_cons_at_List_hd_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cons_at_List_internal_4 --> -20($fp) + # local_cons_at_List_internal_4 = SELF + sw $s1, -20($fp) + # ARG local_cons_at_List_internal_4 + # LOCAL local_cons_at_List_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cons_at_List_internal_2 --> -12($fp) + # LOCAL local_cons_at_List_internal_3 --> -16($fp) + # local_cons_at_List_internal_3 = VCALL local_cons_at_List_internal_2 init + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_cons_at_List_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_cons_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_car_at_List implementation. +# @Params: +function_car_at_List: + # Allocate stack frame for function function_car_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_car_at_List_internal_2 --> -12($fp) + # local_car_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_car_at_List_internal_0 --> -4($fp) + # LOCAL local_car_at_List_internal_2 --> -12($fp) + # local_car_at_List_internal_0 = local_car_at_List_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_car_at_List_internal_0 --> -4($fp) + # LOCAL local_car_at_List_internal_1 --> -8($fp) + # local_car_at_List_internal_1 = VCALL local_car_at_List_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_car_at_List_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -16($fp) + # RETURN local_car_at_List_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_car_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cdr_at_List implementation. +# @Params: +function_cdr_at_List: + # Allocate stack frame for function function_cdr_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cdr_at_List_internal_2 --> -12($fp) + # local_cdr_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_cdr_at_List_internal_0 --> -4($fp) + # LOCAL local_cdr_at_List_internal_2 --> -12($fp) + # local_cdr_at_List_internal_0 = local_cdr_at_List_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_cdr_at_List_internal_0 --> -4($fp) + # LOCAL local_cdr_at_List_internal_1 --> -8($fp) + # local_cdr_at_List_internal_1 = VCALL local_cdr_at_List_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cdr_at_List_internal_3 --> -16($fp) + # local_cdr_at_List_internal_3 = ALLOCATE List + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, List + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, List_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -16($fp) + # RETURN local_cdr_at_List_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_cdr_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_rev_at_List implementation. +# @Params: +function_rev_at_List: + # Allocate stack frame for function function_rev_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_rev_at_List_internal_2 --> -12($fp) + # local_rev_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_rev_at_List_internal_0 --> -4($fp) + # LOCAL local_rev_at_List_internal_2 --> -12($fp) + # local_rev_at_List_internal_0 = local_rev_at_List_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_rev_at_List_internal_0 --> -4($fp) + # LOCAL local_rev_at_List_internal_1 --> -8($fp) + # local_rev_at_List_internal_1 = VCALL local_rev_at_List_internal_0 cdr + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_rev_at_List_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_rev_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_sort_at_List implementation. +# @Params: +function_sort_at_List: + # Allocate stack frame for function function_sort_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_sort_at_List_internal_2 --> -12($fp) + # local_sort_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_sort_at_List_internal_0 --> -4($fp) + # LOCAL local_sort_at_List_internal_2 --> -12($fp) + # local_sort_at_List_internal_0 = local_sort_at_List_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_sort_at_List_internal_0 --> -4($fp) + # LOCAL local_sort_at_List_internal_1 --> -8($fp) + # local_sort_at_List_internal_1 = VCALL local_sort_at_List_internal_0 cdr + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_sort_at_List_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_sort_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_insert_at_List implementation. +# @Params: +# 0($fp) = param_insert_at_List_i_0 +function_insert_at_List: + # Allocate stack frame for function function_insert_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_insert_at_List_internal_2 --> -12($fp) + # local_insert_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_insert_at_List_internal_0 --> -4($fp) + # LOCAL local_insert_at_List_internal_2 --> -12($fp) + # local_insert_at_List_internal_0 = local_insert_at_List_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_insert_at_List_internal_0 --> -4($fp) + # LOCAL local_insert_at_List_internal_1 --> -8($fp) + # local_insert_at_List_internal_1 = VCALL local_insert_at_List_internal_0 cdr + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_insert_at_List_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_insert_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_rcons_at_List implementation. +# @Params: +# 0($fp) = param_rcons_at_List_i_0 +function_rcons_at_List: + # Allocate stack frame for function function_rcons_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_rcons_at_List_internal_2 --> -12($fp) + # local_rcons_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_rcons_at_List_internal_0 --> -4($fp) + # LOCAL local_rcons_at_List_internal_2 --> -12($fp) + # local_rcons_at_List_internal_0 = local_rcons_at_List_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_rcons_at_List_internal_0 --> -4($fp) + # LOCAL local_rcons_at_List_internal_1 --> -8($fp) + # local_rcons_at_List_internal_1 = VCALL local_rcons_at_List_internal_0 cdr + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_rcons_at_List_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_rcons_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_list_at_List implementation. +# @Params: +function_print_list_at_List: + # Allocate stack frame for function function_print_list_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_print_list_at_List_internal_2 --> -12($fp) + # local_print_list_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_list_at_List_internal_0 --> -4($fp) + # LOCAL local_print_list_at_List_internal_2 --> -12($fp) + # local_print_list_at_List_internal_0 = local_print_list_at_List_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_List_internal_0 --> -4($fp) + # LOCAL local_print_list_at_List_internal_1 --> -8($fp) + # local_print_list_at_List_internal_1 = VCALL local_print_list_at_List_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_list_at_List_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_print_list_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_Nil implementation. +# @Params: +function_isNil_at_Nil: + # Allocate stack frame for function function_isNil_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_Nil_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_isNil_at_Nil_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_rev_at_Nil implementation. +# @Params: +function_rev_at_Nil: + # Allocate stack frame for function function_rev_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_rev_at_Nil_internal_0 --> -4($fp) + # local_rev_at_Nil_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_rev_at_Nil_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_rev_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_sort_at_Nil implementation. +# @Params: +function_sort_at_Nil: + # Allocate stack frame for function function_sort_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_sort_at_Nil_internal_0 --> -4($fp) + # local_sort_at_Nil_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_sort_at_Nil_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_sort_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_insert_at_Nil implementation. +# @Params: +# 0($fp) = param_insert_at_Nil_i_0 +function_insert_at_Nil: + # Allocate stack frame for function function_insert_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_insert_at_Nil_internal_2 --> -12($fp) + # local_insert_at_Nil_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_insert_at_Nil_internal_0 --> -4($fp) + # LOCAL local_insert_at_Nil_internal_2 --> -12($fp) + # local_insert_at_Nil_internal_0 = local_insert_at_Nil_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_insert_at_Nil_i_0 + # PARAM param_insert_at_Nil_i_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_insert_at_Nil_internal_0 --> -4($fp) + # LOCAL local_insert_at_Nil_internal_1 --> -8($fp) + # local_insert_at_Nil_internal_1 = VCALL local_insert_at_Nil_internal_0 rcons + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 76($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_insert_at_Nil_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_insert_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_rcons_at_Nil implementation. +# @Params: +# 0($fp) = param_rcons_at_Nil_i_0 +function_rcons_at_Nil: + # Allocate stack frame for function function_rcons_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_rcons_at_Nil_internal_2 --> -12($fp) + # local_rcons_at_Nil_internal_2 = ALLOCATE Cons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Cons + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Cons_start + sw $t0, 4($v0) + # Load type offset + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Cons__attrib__xcar__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Cons__attrib__xcdr__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -12($fp) + # LOCAL local_rcons_at_Nil_internal_0 --> -4($fp) + # LOCAL local_rcons_at_Nil_internal_2 --> -12($fp) + # local_rcons_at_Nil_internal_0 = local_rcons_at_Nil_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_rcons_at_Nil_i_0 + # PARAM param_rcons_at_Nil_i_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_rcons_at_Nil_internal_3 --> -16($fp) + # local_rcons_at_Nil_internal_3 = SELF + sw $s1, -16($fp) + # ARG local_rcons_at_Nil_internal_3 + # LOCAL local_rcons_at_Nil_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_rcons_at_Nil_internal_0 --> -4($fp) + # LOCAL local_rcons_at_Nil_internal_1 --> -8($fp) + # local_rcons_at_Nil_internal_1 = VCALL local_rcons_at_Nil_internal_0 init + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_rcons_at_Nil_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_rcons_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_list_at_Nil implementation. +# @Params: +function_print_list_at_Nil: + # Allocate stack frame for function function_print_list_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_print_list_at_Nil_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_print_list_at_Nil_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_print_list_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Cons__attrib__xcar__init implementation. +# @Params: +__Cons__attrib__xcar__init: + # Allocate stack frame for function __Cons__attrib__xcar__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__xcar__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__xcar__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Cons__attrib__xcar__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Cons__attrib__xcdr__init implementation. +# @Params: +__Cons__attrib__xcdr__init: + # Allocate stack frame for function __Cons__attrib__xcdr__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Cons__attrib__xcdr__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_Cons implementation. +# @Params: +function_isNil_at_Cons: + # Allocate stack frame for function function_isNil_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_Cons_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_isNil_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Cons implementation. +# @Params: +# 0($fp) = param_init_at_Cons_hd_0 +# 4($fp) = param_init_at_Cons_tl_1 +function_init_at_Cons: + # Allocate stack frame for function function_init_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_Cons_hd_0 --> 4($fp) + lw $t0, 4($fp) + sw $t0, 12($s1) + # + # PARAM param_init_at_Cons_tl_1 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 16($s1) + # LOCAL local_init_at_Cons_internal_0 --> -4($fp) + # local_init_at_Cons_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_car_at_Cons implementation. +# @Params: +function_car_at_Cons: + # Allocate stack frame for function function_car_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_car_at_Cons_internal_0 = GETATTRIBUTE xcar Cons + # LOCAL local_car_at_Cons_internal_0 --> -4($fp) + lw $t0, 12($s1) + sw $t0, -4($fp) + # RETURN local_car_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_car_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cdr_at_Cons implementation. +# @Params: +function_cdr_at_Cons: + # Allocate stack frame for function function_cdr_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_cdr_at_Cons_internal_0 = GETATTRIBUTE xcdr Cons + # LOCAL local_cdr_at_Cons_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_cdr_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_cdr_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_rev_at_Cons implementation. +# @Params: +function_rev_at_Cons: + # Allocate stack frame for function function_rev_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_rev_at_Cons_internal_4 = GETATTRIBUTE xcdr Cons + # LOCAL local_rev_at_Cons_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # LOCAL local_rev_at_Cons_internal_2 --> -12($fp) + # LOCAL local_rev_at_Cons_internal_4 --> -20($fp) + # local_rev_at_Cons_internal_2 = local_rev_at_Cons_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_rev_at_Cons_internal_2 --> -12($fp) + # LOCAL local_rev_at_Cons_internal_3 --> -16($fp) + # local_rev_at_Cons_internal_3 = VCALL local_rev_at_Cons_internal_2 rev + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_rev_at_Cons_internal_0 --> -4($fp) + # LOCAL local_rev_at_Cons_internal_3 --> -16($fp) + # local_rev_at_Cons_internal_0 = local_rev_at_Cons_internal_3 + lw $t0, -16($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_rev_at_Cons_internal_5 = GETATTRIBUTE xcar Cons + # LOCAL local_rev_at_Cons_internal_5 --> -24($fp) + lw $t0, 12($s1) + sw $t0, -24($fp) + # ARG local_rev_at_Cons_internal_5 + # LOCAL local_rev_at_Cons_internal_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_rev_at_Cons_internal_0 --> -4($fp) + # LOCAL local_rev_at_Cons_internal_1 --> -8($fp) + # local_rev_at_Cons_internal_1 = VCALL local_rev_at_Cons_internal_0 rcons + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 76($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_rev_at_Cons_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_rev_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_sort_at_Cons implementation. +# @Params: +function_sort_at_Cons: + # Allocate stack frame for function function_sort_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_sort_at_Cons_internal_4 = GETATTRIBUTE xcdr Cons + # LOCAL local_sort_at_Cons_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # LOCAL local_sort_at_Cons_internal_2 --> -12($fp) + # LOCAL local_sort_at_Cons_internal_4 --> -20($fp) + # local_sort_at_Cons_internal_2 = local_sort_at_Cons_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_sort_at_Cons_internal_2 --> -12($fp) + # LOCAL local_sort_at_Cons_internal_3 --> -16($fp) + # local_sort_at_Cons_internal_3 = VCALL local_sort_at_Cons_internal_2 sort + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_sort_at_Cons_internal_0 --> -4($fp) + # LOCAL local_sort_at_Cons_internal_3 --> -16($fp) + # local_sort_at_Cons_internal_0 = local_sort_at_Cons_internal_3 + lw $t0, -16($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_sort_at_Cons_internal_5 = GETATTRIBUTE xcar Cons + # LOCAL local_sort_at_Cons_internal_5 --> -24($fp) + lw $t0, 12($s1) + sw $t0, -24($fp) + # ARG local_sort_at_Cons_internal_5 + # LOCAL local_sort_at_Cons_internal_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_sort_at_Cons_internal_0 --> -4($fp) + # LOCAL local_sort_at_Cons_internal_1 --> -8($fp) + # local_sort_at_Cons_internal_1 = VCALL local_sort_at_Cons_internal_0 insert + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 56($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_sort_at_Cons_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_sort_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_insert_at_Cons implementation. +# @Params: +# 0($fp) = param_insert_at_Cons_i_0 +function_insert_at_Cons: + # Allocate stack frame for function function_insert_at_Cons. + subu $sp, $sp, 68 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 68 + # local_insert_at_Cons_internal_3 = GETATTRIBUTE xcar Cons + # LOCAL local_insert_at_Cons_internal_3 --> -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) + # LOCAL local_insert_at_Cons_internal_2 --> -12($fp) + # PARAM param_insert_at_Cons_i_0 --> 0($fp) + # LOCAL local_insert_at_Cons_internal_3 --> -16($fp) + lw $a0, 0($fp) + lw $a1, -16($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -12($fp) + # IF_GREATER_ZERO local_insert_at_Cons_internal_2 GOTO label_FALSE_7 + # IF_GREATER_ZERO local_insert_at_Cons_internal_2 GOTO label_FALSE_7 + lw $t0, -12($fp) + bgt $t0, 0, label_FALSE_7 + # IF_ZERO local_insert_at_Cons_internal_2 GOTO label_FALSE_7 + # IF_ZERO local_insert_at_Cons_internal_2 GOTO label_FALSE_7 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_7 + # LOCAL local_insert_at_Cons_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_8 +j label_END_8 +label_FALSE_7: + # LOCAL local_insert_at_Cons_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_8: +# LOCAL local_insert_at_Cons_internal_0 --> -4($fp) +# LOCAL local_insert_at_Cons_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_insert_at_Cons_internal_0 GOTO label_FALSEIF_5 +# IF_ZERO local_insert_at_Cons_internal_0 GOTO label_FALSEIF_5 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_5 +# LOCAL local_insert_at_Cons_internal_6 --> -28($fp) +# local_insert_at_Cons_internal_6 = ALLOCATE Cons +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Cons +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Cons_start +sw $t0, 4($v0) +# Load type offset +li $t0, 32 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __Cons__attrib__xcar__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __Cons__attrib__xcdr__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 16($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -28($fp) +# LOCAL local_insert_at_Cons_internal_4 --> -20($fp) +# LOCAL local_insert_at_Cons_internal_6 --> -28($fp) +# local_insert_at_Cons_internal_4 = local_insert_at_Cons_internal_6 +lw $t0, -28($fp) +sw $t0, -20($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_insert_at_Cons_i_0 +# PARAM param_insert_at_Cons_i_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_insert_at_Cons_internal_7 --> -32($fp) +# local_insert_at_Cons_internal_7 = SELF +sw $s1, -32($fp) +# ARG local_insert_at_Cons_internal_7 +# LOCAL local_insert_at_Cons_internal_7 --> -32($fp) +lw $t0, -32($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_insert_at_Cons_internal_4 --> -20($fp) +# LOCAL local_insert_at_Cons_internal_5 --> -24($fp) +# local_insert_at_Cons_internal_5 = VCALL local_insert_at_Cons_internal_4 init +# Save new self pointer in $s1 +lw $s1, -20($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -24($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_insert_at_Cons_internal_1 --> -8($fp) +# LOCAL local_insert_at_Cons_internal_5 --> -24($fp) +# local_insert_at_Cons_internal_1 = local_insert_at_Cons_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # LOCAL local_insert_at_Cons_internal_10 --> -44($fp) + # local_insert_at_Cons_internal_10 = ALLOCATE Cons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Cons + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Cons_start + sw $t0, 4($v0) + # Load type offset + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Cons__attrib__xcar__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Cons__attrib__xcdr__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -44($fp) + # LOCAL local_insert_at_Cons_internal_8 --> -36($fp) + # LOCAL local_insert_at_Cons_internal_10 --> -44($fp) + # local_insert_at_Cons_internal_8 = local_insert_at_Cons_internal_10 + lw $t0, -44($fp) + sw $t0, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_insert_at_Cons_internal_11 = GETATTRIBUTE xcar Cons + # LOCAL local_insert_at_Cons_internal_11 --> -48($fp) + lw $t0, 12($s1) + sw $t0, -48($fp) + # ARG local_insert_at_Cons_internal_11 + # LOCAL local_insert_at_Cons_internal_11 --> -48($fp) + lw $t0, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # local_insert_at_Cons_internal_14 = GETATTRIBUTE xcdr Cons + # LOCAL local_insert_at_Cons_internal_14 --> -60($fp) + lw $t0, 16($s1) + sw $t0, -60($fp) + # LOCAL local_insert_at_Cons_internal_12 --> -52($fp) + # LOCAL local_insert_at_Cons_internal_14 --> -60($fp) + # local_insert_at_Cons_internal_12 = local_insert_at_Cons_internal_14 + lw $t0, -60($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_insert_at_Cons_i_0 + # PARAM param_insert_at_Cons_i_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_insert_at_Cons_internal_12 --> -52($fp) + # LOCAL local_insert_at_Cons_internal_13 --> -56($fp) + # local_insert_at_Cons_internal_13 = VCALL local_insert_at_Cons_internal_12 insert + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 56($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_insert_at_Cons_internal_13 + # LOCAL local_insert_at_Cons_internal_13 --> -56($fp) + lw $t0, -56($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_insert_at_Cons_internal_8 --> -36($fp) + # LOCAL local_insert_at_Cons_internal_9 --> -40($fp) + # local_insert_at_Cons_internal_9 = VCALL local_insert_at_Cons_internal_8 init + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_insert_at_Cons_internal_1 --> -8($fp) + # LOCAL local_insert_at_Cons_internal_9 --> -40($fp) + # local_insert_at_Cons_internal_1 = local_insert_at_Cons_internal_9 + lw $t0, -40($fp) + sw $t0, -8($fp) + label_ENDIF_6: +# RETURN local_insert_at_Cons_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_insert_at_Cons. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 68 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_rcons_at_Cons implementation. +# @Params: +# 0($fp) = param_rcons_at_Cons_i_0 +function_rcons_at_Cons: + # Allocate stack frame for function function_rcons_at_Cons. + subu $sp, $sp, 36 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 36 + # LOCAL local_rcons_at_Cons_internal_2 --> -12($fp) + # local_rcons_at_Cons_internal_2 = ALLOCATE Cons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Cons + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Cons_start + sw $t0, 4($v0) + # Load type offset + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Cons__attrib__xcar__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Cons__attrib__xcdr__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -12($fp) + # LOCAL local_rcons_at_Cons_internal_0 --> -4($fp) + # LOCAL local_rcons_at_Cons_internal_2 --> -12($fp) + # local_rcons_at_Cons_internal_0 = local_rcons_at_Cons_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_rcons_at_Cons_internal_3 = GETATTRIBUTE xcar Cons + # LOCAL local_rcons_at_Cons_internal_3 --> -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) + # ARG local_rcons_at_Cons_internal_3 + # LOCAL local_rcons_at_Cons_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # local_rcons_at_Cons_internal_6 = GETATTRIBUTE xcdr Cons + # LOCAL local_rcons_at_Cons_internal_6 --> -28($fp) + lw $t0, 16($s1) + sw $t0, -28($fp) + # LOCAL local_rcons_at_Cons_internal_4 --> -20($fp) + # LOCAL local_rcons_at_Cons_internal_6 --> -28($fp) + # local_rcons_at_Cons_internal_4 = local_rcons_at_Cons_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_rcons_at_Cons_i_0 + # PARAM param_rcons_at_Cons_i_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_rcons_at_Cons_internal_4 --> -20($fp) + # LOCAL local_rcons_at_Cons_internal_5 --> -24($fp) + # local_rcons_at_Cons_internal_5 = VCALL local_rcons_at_Cons_internal_4 rcons + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 76($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_rcons_at_Cons_internal_5 + # LOCAL local_rcons_at_Cons_internal_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_rcons_at_Cons_internal_0 --> -4($fp) + # LOCAL local_rcons_at_Cons_internal_1 --> -8($fp) + # local_rcons_at_Cons_internal_1 = VCALL local_rcons_at_Cons_internal_0 init + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_rcons_at_Cons_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_rcons_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 36 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_list_at_Cons implementation. +# @Params: +function_print_list_at_Cons: + # Allocate stack frame for function function_print_list_at_Cons. + subu $sp, $sp, 52 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 52 + # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) + # local_print_list_at_Cons_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) + # local_print_list_at_Cons_internal_0 = local_print_list_at_Cons_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_list_at_Cons_internal_3 = GETATTRIBUTE xcar Cons + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) + # ARG local_print_list_at_Cons_internal_3 + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # local_print_list_at_Cons_internal_1 = VCALL local_print_list_at_Cons_internal_0 out_int + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 68($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_print_list_at_Cons_internal_4 --> -20($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_4 = local_print_list_at_Cons_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -32($fp) + # ARG local_print_list_at_Cons_internal_7 + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + lw $t0, -32($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_list_at_Cons_internal_4 --> -20($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # local_print_list_at_Cons_internal_5 = VCALL local_print_list_at_Cons_internal_4 out_string + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 64($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_print_list_at_Cons_internal_10 = GETATTRIBUTE xcdr Cons + # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) + lw $t0, 16($s1) + sw $t0, -44($fp) + # LOCAL local_print_list_at_Cons_internal_8 --> -36($fp) + # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) + # local_print_list_at_Cons_internal_8 = local_print_list_at_Cons_internal_10 + lw $t0, -44($fp) + sw $t0, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Cons_internal_8 --> -36($fp) + # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) + # local_print_list_at_Cons_internal_9 = VCALL local_print_list_at_Cons_internal_8 print_list + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 84($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_list_at_Cons_internal_9 + lw $v0, -40($fp) + # Deallocate stack frame for function function_print_list_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 52 + jr $ra + # Function END + From 682f2b48b8a10f62fb00ff530e4900747330acd9 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Mon, 7 Dec 2020 23:12:40 -0500 Subject: [PATCH 157/162] clean --- tests/codegen/arith.mips | 22251 ------------------------------- tests/codegen/atoi.mips | 10086 -------------- tests/codegen/book_list.mips | 3054 ----- tests/codegen/cells.mips | 4335 ------ tests/codegen/complex.mips | 3336 ----- tests/codegen/fib.mips | 1565 --- tests/codegen/graph.mips | 11750 ---------------- tests/codegen/hairyscary.mips | 3621 ----- tests/codegen/hello_world.mips | 745 -- tests/codegen/io.mips | 1450 -- tests/codegen/life.mips | 21978 ------------------------------ tests/codegen/list.mips | 2109 --- tests/codegen/new_complex.mips | 4216 ------ tests/codegen/palindrome.mips | 2420 ---- tests/codegen/primes.mips | 2371 ---- tests/codegen/print-cool.mips | 1169 -- tests/codegen/sort-list.mips | 3364 ----- 17 files changed, 99820 deletions(-) delete mode 100644 tests/codegen/arith.mips delete mode 100644 tests/codegen/atoi.mips delete mode 100644 tests/codegen/book_list.mips delete mode 100644 tests/codegen/cells.mips delete mode 100644 tests/codegen/complex.mips delete mode 100644 tests/codegen/fib.mips delete mode 100644 tests/codegen/graph.mips delete mode 100644 tests/codegen/hairyscary.mips delete mode 100644 tests/codegen/hello_world.mips delete mode 100644 tests/codegen/io.mips delete mode 100644 tests/codegen/life.mips delete mode 100644 tests/codegen/list.mips delete mode 100644 tests/codegen/new_complex.mips delete mode 100644 tests/codegen/palindrome.mips delete mode 100644 tests/codegen/primes.mips delete mode 100644 tests/codegen/print-cool.mips delete mode 100644 tests/codegen/sort-list.mips diff --git a/tests/codegen/arith.mips b/tests/codegen/arith.mips deleted file mode 100644 index a8c817ec..00000000 --- a/tests/codegen/arith.mips +++ /dev/null @@ -1,22251 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:12 2020 -# School of Math and Computer Science, University of Havana -# - -.data -dummy: .word 0 -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Int: .asciiz "Int" -# Function END -A2I: .asciiz "A2I" -# Function END -A: .asciiz "A" -# Function END -B: .asciiz "B" -# Function END -D: .asciiz "D" -# Function END -E: .asciiz "E" -# Function END -C: .asciiz "C" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_out_string_at_IO, function_out_int_at_IO, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word dummy, dummy, dummy, dummy, dummy, function_length_at_String, function_copy_at_Object, dummy, function_concat_at_String, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object -# Function END -# - - -# **** Type RECORD for type Int **** -Int_start: - Int_vtable_pointer: .word Int_vtable - # Function END -Int_end: -# - - -# **** VTABLE for type A2I **** -A2I_vtable: .word dummy, function_i2a_aux_at_A2I, dummy, function_a2i_at_A2I, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_c2i_at_A2I, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_i2c_at_A2I, dummy, dummy, dummy, dummy, dummy, dummy, function_a2i_aux_at_A2I, dummy, function_i2a_at_A2I, function_abort_at_Object -# Function END -# - - -# **** Type RECORD for type A2I **** -A2I_start: - A2I_vtable_pointer: .word A2I_vtable - # Function END -A2I_end: -# - - -# **** VTABLE for type A **** -A_vtable: .word function_method5_at_A, dummy, function_method2_at_A, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_method4_at_A, function_type_name_at_Object, dummy, function_method3_at_A, dummy, function_value_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method1_at_A, dummy, dummy, dummy, dummy, function_set_var_at_A, dummy, function_abort_at_Object -# Function END -# - - -# **** Type RECORD for type A **** -A_start: - A_vtable_pointer: .word A_vtable - # Function END -A_end: -# - - -# **** VTABLE for type B **** -B_vtable: .word function_method5_at_B, dummy, function_method2_at_A, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_method4_at_A, function_type_name_at_Object, dummy, function_method3_at_A, dummy, function_value_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method1_at_A, dummy, dummy, dummy, dummy, function_set_var_at_A, dummy, function_abort_at_Object -# Function END -# - - -# **** Type RECORD for type B **** -B_start: - B_vtable_pointer: .word B_vtable - # Function END -B_end: -# - - -# **** VTABLE for type D **** -D_vtable: .word function_method5_at_B, dummy, function_method2_at_A, dummy, dummy, dummy, function_copy_at_Object, function_method7_at_D, dummy, function_method4_at_A, function_type_name_at_Object, dummy, function_method3_at_A, dummy, function_value_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method1_at_A, dummy, dummy, dummy, dummy, function_set_var_at_A, dummy, function_abort_at_Object -# Function END -# - - -# **** Type RECORD for type D **** -D_start: - D_vtable_pointer: .word D_vtable - # Function END -D_end: -# - - -# **** VTABLE for type E **** -E_vtable: .word function_method5_at_B, dummy, function_method2_at_A, dummy, function_method6_at_E, dummy, function_copy_at_Object, function_method7_at_D, dummy, function_method4_at_A, function_type_name_at_Object, dummy, function_method3_at_A, dummy, function_value_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method1_at_A, dummy, dummy, dummy, dummy, function_set_var_at_A, dummy, function_abort_at_Object -# Function END -# - - -# **** Type RECORD for type E **** -E_start: - E_vtable_pointer: .word E_vtable - # Function END -E_end: -# - - -# **** VTABLE for type C **** -C_vtable: .word function_method5_at_C, dummy, function_method2_at_A, dummy, function_method6_at_C, dummy, function_copy_at_Object, dummy, dummy, function_method4_at_A, function_type_name_at_Object, dummy, function_method3_at_A, dummy, function_value_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method1_at_A, dummy, dummy, dummy, dummy, function_set_var_at_A, dummy, function_abort_at_Object -# Function END -# - - -# **** Type RECORD for type C **** -C_start: - C_vtable_pointer: .word C_vtable - # Function END -C_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_type_name_at_Object, function_main_at_Main, dummy, dummy, dummy, dummy, function_prompt_at_Main, function_out_string_at_IO, function_out_int_at_IO, function_class_type_at_Main, function_in_string_at_IO, dummy, function_in_int_at_IO, function_print_at_Main, dummy, function_menu_at_Main, function_is_even_at_Main, function_get_int_at_Main, dummy, dummy, dummy, function_abort_at_Object -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 1, 1, 2, 3, 4, 3, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1 -A2I__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 -A__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 2, -1 -B__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 1, -1 -D__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1 -E__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 -C__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz "0" -# - - -data_5: .asciiz "1" -# - - -data_6: .asciiz "2" -# - - -data_7: .asciiz "3" -# - - -data_8: .asciiz "4" -# - - -data_9: .asciiz "5" -# - - -data_10: .asciiz "6" -# - - -data_11: .asciiz "7" -# - - -data_12: .asciiz "8" -# - - -data_13: .asciiz "9" -# - - -data_14: .asciiz "0" -# - - -data_15: .asciiz "1" -# - - -data_16: .asciiz "2" -# - - -data_17: .asciiz "3" -# - - -data_18: .asciiz "4" -# - - -data_19: .asciiz "5" -# - - -data_20: .asciiz "6" -# - - -data_21: .asciiz "7" -# - - -data_22: .asciiz "8" -# - - -data_23: .asciiz "9" -# - - -data_24: .asciiz "" -# - - -data_25: .asciiz "-" -# - - -data_26: .asciiz "+" -# - - -data_27: .asciiz "0" -# - - -data_28: .asciiz "-" -# - - -data_29: .asciiz "" -# - - -data_30: .asciiz "\n\tTo add a number to " -# - - -data_31: .asciiz "...enter a:\n" -# - - -data_32: .asciiz "\tTo negate " -# - - -data_33: .asciiz "...enter b:\n" -# - - -data_34: .asciiz "\tTo find the difference between " -# - - -data_35: .asciiz "and another number...enter c:\n" -# - - -data_36: .asciiz "\tTo find the factorial of " -# - - -data_37: .asciiz "...enter d:\n" -# - - -data_38: .asciiz "\tTo square " -# - - -data_39: .asciiz "...enter e:\n" -# - - -data_40: .asciiz "\tTo cube " -# - - -data_41: .asciiz "...enter f:\n" -# - - -data_42: .asciiz "\tTo find out if " -# - - -data_43: .asciiz "is a multiple of 3...enter g:\n" -# - - -data_44: .asciiz "\tTo divide " -# - - -data_45: .asciiz "by 8...enter h:\n" -# - - -data_46: .asciiz "\tTo get a new number...enter j:\n" -# - - -data_47: .asciiz "\tTo quit...enter q:\n\n" -# - - -data_48: .asciiz "\n" -# - - -data_49: .asciiz "Please enter a number... " -# - - -data_50: .asciiz "Class type is now A\n" -# - - -data_51: .asciiz "Class type is now B\n" -# - - -data_52: .asciiz "Class type is now C\n" -# - - -data_53: .asciiz "Class type is now D\n" -# - - -data_54: .asciiz "Class type is now E\n" -# - - -data_55: .asciiz "Oooops\n" -# - - -data_56: .asciiz " " -# - - -data_57: .asciiz "number " -# - - -data_58: .asciiz "is even!\n" -# - - -data_59: .asciiz "is odd!\n" -# - - -data_60: .asciiz "a" -# - - -data_61: .asciiz "b" -# - - -data_62: .asciiz "Oooops\n" -# - - -data_63: .asciiz "c" -# - - -data_64: .asciiz "d" -# - - -data_65: .asciiz "e" -# - - -data_66: .asciiz "f" -# - - -data_67: .asciiz "g" -# - - -data_68: .asciiz "number " -# - - -data_69: .asciiz "is divisible by 3.\n" -# - - -data_70: .asciiz "number " -# - - -data_71: .asciiz "is not divisible by 3.\n" -# - - -data_72: .asciiz "h" -# - - -data_73: .asciiz "number " -# - - -data_74: .asciiz "is equal to " -# - - -data_75: .asciiz "times 8 with a remainder of " -# - - -data_76: .asciiz "\n" -# - - -data_77: .asciiz "j" -# - - -data_78: .asciiz "q" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - move $a2, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - sw $a2, 12($v0) - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - lw $t2, 12($t2) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - lw $a0, 12($a0) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # LOCAL local_length_at_String_internal_1 --> -8($fp) - # LOCAL local_length_at_String_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -4($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_length_at_String_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Main - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 28 bytes of memory - li $a0, 28 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - # Load type offset - li $t0, 44 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__char__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__avar__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__a_var__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__flag__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t0, Main_vtable - # Get pointer to function address - lw $t1, 44($t0) - # Call function. Result is on $v0 - jalr $t1 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_c2i_at_A2I implementation. -# @Params: -# 0($fp) = param_c2i_at_A2I_char_0 -function_c2i_at_A2I: - # Allocate stack frame for function function_c2i_at_A2I. - subu $sp, $sp, 264 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 264 - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_4 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -20($fp) - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_3 - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_3 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_3 - # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_3 - # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_3 - lw $t0, -20($fp) - beq $t0, 0, label_FALSE_3 - # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_6 - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_6 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_6 - # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_7 - # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_7 - # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -20($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_4 - # GOTO label_FALSE_3 - j label_FALSE_3 - label_COMPARE_BY_VALUE_7: - # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - lw $a0, 0($fp) - lw $a1, -20($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_4 - # GOTO label_FALSE_3 - j label_FALSE_3 - label_COMPARE_STRING_6: - # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_CONTINUE_8 - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_CONTINUE_8 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_8 - # GOTO label_FALSE_3 - j label_FALSE_3 - label_CONTINUE_8: - # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_9: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_10 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_9 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_10: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_4 - label_FALSE_3: - # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_5 -j label_END_5 -label_TRUE_4: - # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_5: -# LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) -# LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSEIF_1 -# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSEIF_1 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_1 -# LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -24($fp) -# LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) -# LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) -# local_c2i_at_A2I_internal_1 = local_c2i_at_A2I_internal_5 -lw $t0, -24($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_2 -j label_ENDIF_2 -label_FALSEIF_1: - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_5 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -44($fp) - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_13 - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_13 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_13 - # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_13 - # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_13 - lw $t0, -44($fp) - beq $t0, 0, label_FALSE_13 - # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_STRING_16 - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_STRING_16 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_STRING_16 - # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_17 - # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_17 - # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -44($fp) - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_14 - # GOTO label_FALSE_13 - j label_FALSE_13 - label_COMPARE_BY_VALUE_17: - # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - lw $a0, 0($fp) - lw $a1, -44($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_14 - # GOTO label_FALSE_13 - j label_FALSE_13 - label_COMPARE_STRING_16: - # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -44($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -40($fp) - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_CONTINUE_18 - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_CONTINUE_18 - lw $t0, -40($fp) - beq $t0, 0, label_CONTINUE_18 - # GOTO label_FALSE_13 - j label_FALSE_13 - label_CONTINUE_18: - # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -44($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_19: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_20 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_19 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_20: - # Store result - sw $a2, -40($fp) - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_14 - label_FALSE_13: - # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -36($fp) - # GOTO label_END_15 -j label_END_15 -label_TRUE_14: - # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -36($fp) - label_END_15: -# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) -# LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) -# Obtain value from -36($fp) -lw $v0, -36($fp) -lw $v0, 12($v0) -sw $v0, -28($fp) -# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSEIF_11 -# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSEIF_11 -lw $t0, -28($fp) -beq $t0, 0, label_FALSEIF_11 -# LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -48($fp) -# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) -# LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) -# local_c2i_at_A2I_internal_7 = local_c2i_at_A2I_internal_11 -lw $t0, -48($fp) -sw $t0, -32($fp) -# GOTO label_ENDIF_12 -j label_ENDIF_12 -label_FALSEIF_11: - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_6 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -68($fp) - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_23 - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_23 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_23 - # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_23 - # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_23 - lw $t0, -68($fp) - beq $t0, 0, label_FALSE_23 - # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_STRING_26 - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_STRING_26 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_STRING_26 - # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_27 - # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_27 - # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -68($fp) - sub $a0, $a0, $a1 - sw $a0, -64($fp) - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_24 - # GOTO label_FALSE_23 - j label_FALSE_23 - label_COMPARE_BY_VALUE_27: - # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - lw $a0, 0($fp) - lw $a1, -68($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -64($fp) - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_24 - # GOTO label_FALSE_23 - j label_FALSE_23 - label_COMPARE_STRING_26: - # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -68($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -64($fp) - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_CONTINUE_28 - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_CONTINUE_28 - lw $t0, -64($fp) - beq $t0, 0, label_CONTINUE_28 - # GOTO label_FALSE_23 - j label_FALSE_23 - label_CONTINUE_28: - # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -68($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_29: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_30 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_29 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_30: - # Store result - sw $a2, -64($fp) - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_24 - label_FALSE_23: - # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -60($fp) - # GOTO label_END_25 -j label_END_25 -label_TRUE_24: - # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -60($fp) - label_END_25: -# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) -# LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) -# Obtain value from -60($fp) -lw $v0, -60($fp) -lw $v0, 12($v0) -sw $v0, -52($fp) -# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSEIF_21 -# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSEIF_21 -lw $t0, -52($fp) -beq $t0, 0, label_FALSEIF_21 -# LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 2 -sw $t0, 12($v0) -sw $v0, -72($fp) -# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) -# LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) -# local_c2i_at_A2I_internal_13 = local_c2i_at_A2I_internal_17 -lw $t0, -72($fp) -sw $t0, -56($fp) -# GOTO label_ENDIF_22 -j label_ENDIF_22 -label_FALSEIF_21: - # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_7 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -92($fp) - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_33 - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_33 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_33 - # IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_FALSE_33 - # IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_FALSE_33 - lw $t0, -92($fp) - beq $t0, 0, label_FALSE_33 - # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_STRING_36 - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_STRING_36 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_STRING_36 - # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_37 - # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_37 - # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -92($fp) - sub $a0, $a0, $a1 - sw $a0, -88($fp) - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_34 - # GOTO label_FALSE_33 - j label_FALSE_33 - label_COMPARE_BY_VALUE_37: - # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) - lw $a0, 0($fp) - lw $a1, -92($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -88($fp) - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_34 - # GOTO label_FALSE_33 - j label_FALSE_33 - label_COMPARE_STRING_36: - # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -92($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -88($fp) - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_CONTINUE_38 - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_CONTINUE_38 - lw $t0, -88($fp) - beq $t0, 0, label_CONTINUE_38 - # GOTO label_FALSE_33 - j label_FALSE_33 - label_CONTINUE_38: - # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -92($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_39: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_40 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_39 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_40: - # Store result - sw $a2, -88($fp) - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_34 - label_FALSE_33: - # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -84($fp) - # GOTO label_END_35 -j label_END_35 -label_TRUE_34: - # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -84($fp) - label_END_35: -# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) -# LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) -# Obtain value from -84($fp) -lw $v0, -84($fp) -lw $v0, 12($v0) -sw $v0, -76($fp) -# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSEIF_31 -# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSEIF_31 -lw $t0, -76($fp) -beq $t0, 0, label_FALSEIF_31 -# LOCAL local_c2i_at_A2I_internal_23 --> -96($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 3 -sw $t0, 12($v0) -sw $v0, -96($fp) -# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) -# LOCAL local_c2i_at_A2I_internal_23 --> -96($fp) -# local_c2i_at_A2I_internal_19 = local_c2i_at_A2I_internal_23 -lw $t0, -96($fp) -sw $t0, -80($fp) -# GOTO label_ENDIF_32 -j label_ENDIF_32 -label_FALSEIF_31: - # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_8 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -116($fp) - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_43 - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_43 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_43 - # IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_FALSE_43 - # IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_FALSE_43 - lw $t0, -116($fp) - beq $t0, 0, label_FALSE_43 - # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -112($fp) - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_STRING_46 - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_STRING_46 - lw $t0, -112($fp) - beq $t0, 0, label_COMPARE_STRING_46 - # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -112($fp) - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 - lw $t0, -112($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_47 - # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -112($fp) - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 - lw $t0, -112($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_47 - # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -116($fp) - sub $a0, $a0, $a1 - sw $a0, -112($fp) - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 - lw $t0, -112($fp) - beq $t0, 0, label_TRUE_44 - # GOTO label_FALSE_43 - j label_FALSE_43 - label_COMPARE_BY_VALUE_47: - # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) - lw $a0, 0($fp) - lw $a1, -116($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -112($fp) - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 - lw $t0, -112($fp) - beq $t0, 0, label_TRUE_44 - # GOTO label_FALSE_43 - j label_FALSE_43 - label_COMPARE_STRING_46: - # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -116($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -112($fp) - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_CONTINUE_48 - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_CONTINUE_48 - lw $t0, -112($fp) - beq $t0, 0, label_CONTINUE_48 - # GOTO label_FALSE_43 - j label_FALSE_43 - label_CONTINUE_48: - # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -116($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_49: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_50 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_49 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_50: - # Store result - sw $a2, -112($fp) - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 - lw $t0, -112($fp) - beq $t0, 0, label_TRUE_44 - label_FALSE_43: - # LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -108($fp) - # GOTO label_END_45 -j label_END_45 -label_TRUE_44: - # LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -108($fp) - label_END_45: -# LOCAL local_c2i_at_A2I_internal_24 --> -100($fp) -# LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) -# Obtain value from -108($fp) -lw $v0, -108($fp) -lw $v0, 12($v0) -sw $v0, -100($fp) -# IF_ZERO local_c2i_at_A2I_internal_24 GOTO label_FALSEIF_41 -# IF_ZERO local_c2i_at_A2I_internal_24 GOTO label_FALSEIF_41 -lw $t0, -100($fp) -beq $t0, 0, label_FALSEIF_41 -# LOCAL local_c2i_at_A2I_internal_29 --> -120($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 4 -sw $t0, 12($v0) -sw $v0, -120($fp) -# LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) -# LOCAL local_c2i_at_A2I_internal_29 --> -120($fp) -# local_c2i_at_A2I_internal_25 = local_c2i_at_A2I_internal_29 -lw $t0, -120($fp) -sw $t0, -104($fp) -# GOTO label_ENDIF_42 -j label_ENDIF_42 -label_FALSEIF_41: - # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_9 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -140($fp) - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_53 - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_53 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_53 - # IF_ZERO local_c2i_at_A2I_internal_34 GOTO label_FALSE_53 - # IF_ZERO local_c2i_at_A2I_internal_34 GOTO label_FALSE_53 - lw $t0, -140($fp) - beq $t0, 0, label_FALSE_53 - # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -136($fp) - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_STRING_56 - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_STRING_56 - lw $t0, -136($fp) - beq $t0, 0, label_COMPARE_STRING_56 - # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -136($fp) - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 - lw $t0, -136($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_57 - # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -136($fp) - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 - lw $t0, -136($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_57 - # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -140($fp) - sub $a0, $a0, $a1 - sw $a0, -136($fp) - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 - lw $t0, -136($fp) - beq $t0, 0, label_TRUE_54 - # GOTO label_FALSE_53 - j label_FALSE_53 - label_COMPARE_BY_VALUE_57: - # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) - lw $a0, 0($fp) - lw $a1, -140($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -136($fp) - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 - lw $t0, -136($fp) - beq $t0, 0, label_TRUE_54 - # GOTO label_FALSE_53 - j label_FALSE_53 - label_COMPARE_STRING_56: - # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -140($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -136($fp) - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_CONTINUE_58 - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_CONTINUE_58 - lw $t0, -136($fp) - beq $t0, 0, label_CONTINUE_58 - # GOTO label_FALSE_53 - j label_FALSE_53 - label_CONTINUE_58: - # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -140($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_59: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_60 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_59 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_60: - # Store result - sw $a2, -136($fp) - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 - lw $t0, -136($fp) - beq $t0, 0, label_TRUE_54 - label_FALSE_53: - # LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -132($fp) - # GOTO label_END_55 -j label_END_55 -label_TRUE_54: - # LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -132($fp) - label_END_55: -# LOCAL local_c2i_at_A2I_internal_30 --> -124($fp) -# LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) -# Obtain value from -132($fp) -lw $v0, -132($fp) -lw $v0, 12($v0) -sw $v0, -124($fp) -# IF_ZERO local_c2i_at_A2I_internal_30 GOTO label_FALSEIF_51 -# IF_ZERO local_c2i_at_A2I_internal_30 GOTO label_FALSEIF_51 -lw $t0, -124($fp) -beq $t0, 0, label_FALSEIF_51 -# LOCAL local_c2i_at_A2I_internal_35 --> -144($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 5 -sw $t0, 12($v0) -sw $v0, -144($fp) -# LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) -# LOCAL local_c2i_at_A2I_internal_35 --> -144($fp) -# local_c2i_at_A2I_internal_31 = local_c2i_at_A2I_internal_35 -lw $t0, -144($fp) -sw $t0, -128($fp) -# GOTO label_ENDIF_52 -j label_ENDIF_52 -label_FALSEIF_51: - # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_10 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -164($fp) - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_63 - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_63 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_63 - # IF_ZERO local_c2i_at_A2I_internal_40 GOTO label_FALSE_63 - # IF_ZERO local_c2i_at_A2I_internal_40 GOTO label_FALSE_63 - lw $t0, -164($fp) - beq $t0, 0, label_FALSE_63 - # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -160($fp) - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_STRING_66 - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_STRING_66 - lw $t0, -160($fp) - beq $t0, 0, label_COMPARE_STRING_66 - # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -160($fp) - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 - lw $t0, -160($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_67 - # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -160($fp) - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 - lw $t0, -160($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_67 - # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -164($fp) - sub $a0, $a0, $a1 - sw $a0, -160($fp) - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 - lw $t0, -160($fp) - beq $t0, 0, label_TRUE_64 - # GOTO label_FALSE_63 - j label_FALSE_63 - label_COMPARE_BY_VALUE_67: - # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) - lw $a0, 0($fp) - lw $a1, -164($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -160($fp) - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 - lw $t0, -160($fp) - beq $t0, 0, label_TRUE_64 - # GOTO label_FALSE_63 - j label_FALSE_63 - label_COMPARE_STRING_66: - # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -164($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -160($fp) - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_CONTINUE_68 - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_CONTINUE_68 - lw $t0, -160($fp) - beq $t0, 0, label_CONTINUE_68 - # GOTO label_FALSE_63 - j label_FALSE_63 - label_CONTINUE_68: - # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -164($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_69: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_70 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_69 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_70: - # Store result - sw $a2, -160($fp) - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 - lw $t0, -160($fp) - beq $t0, 0, label_TRUE_64 - label_FALSE_63: - # LOCAL local_c2i_at_A2I_internal_38 --> -156($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -156($fp) - # GOTO label_END_65 -j label_END_65 -label_TRUE_64: - # LOCAL local_c2i_at_A2I_internal_38 --> -156($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -156($fp) - label_END_65: -# LOCAL local_c2i_at_A2I_internal_36 --> -148($fp) -# LOCAL local_c2i_at_A2I_internal_38 --> -156($fp) -# Obtain value from -156($fp) -lw $v0, -156($fp) -lw $v0, 12($v0) -sw $v0, -148($fp) -# IF_ZERO local_c2i_at_A2I_internal_36 GOTO label_FALSEIF_61 -# IF_ZERO local_c2i_at_A2I_internal_36 GOTO label_FALSEIF_61 -lw $t0, -148($fp) -beq $t0, 0, label_FALSEIF_61 -# LOCAL local_c2i_at_A2I_internal_41 --> -168($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 6 -sw $t0, 12($v0) -sw $v0, -168($fp) -# LOCAL local_c2i_at_A2I_internal_37 --> -152($fp) -# LOCAL local_c2i_at_A2I_internal_41 --> -168($fp) -# local_c2i_at_A2I_internal_37 = local_c2i_at_A2I_internal_41 -lw $t0, -168($fp) -sw $t0, -152($fp) -# GOTO label_ENDIF_62 -j label_ENDIF_62 -label_FALSEIF_61: - # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_11 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -188($fp) - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_73 - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_73 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_73 - # IF_ZERO local_c2i_at_A2I_internal_46 GOTO label_FALSE_73 - # IF_ZERO local_c2i_at_A2I_internal_46 GOTO label_FALSE_73 - lw $t0, -188($fp) - beq $t0, 0, label_FALSE_73 - # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -184($fp) - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_STRING_76 - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_STRING_76 - lw $t0, -184($fp) - beq $t0, 0, label_COMPARE_STRING_76 - # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -184($fp) - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 - lw $t0, -184($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_77 - # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -184($fp) - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 - lw $t0, -184($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_77 - # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -188($fp) - sub $a0, $a0, $a1 - sw $a0, -184($fp) - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 - lw $t0, -184($fp) - beq $t0, 0, label_TRUE_74 - # GOTO label_FALSE_73 - j label_FALSE_73 - label_COMPARE_BY_VALUE_77: - # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) - lw $a0, 0($fp) - lw $a1, -188($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -184($fp) - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 - lw $t0, -184($fp) - beq $t0, 0, label_TRUE_74 - # GOTO label_FALSE_73 - j label_FALSE_73 - label_COMPARE_STRING_76: - # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -188($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -184($fp) - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_CONTINUE_78 - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_CONTINUE_78 - lw $t0, -184($fp) - beq $t0, 0, label_CONTINUE_78 - # GOTO label_FALSE_73 - j label_FALSE_73 - label_CONTINUE_78: - # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -188($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_79: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_80 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_79 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_80: - # Store result - sw $a2, -184($fp) - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 - lw $t0, -184($fp) - beq $t0, 0, label_TRUE_74 - label_FALSE_73: - # LOCAL local_c2i_at_A2I_internal_44 --> -180($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -180($fp) - # GOTO label_END_75 -j label_END_75 -label_TRUE_74: - # LOCAL local_c2i_at_A2I_internal_44 --> -180($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -180($fp) - label_END_75: -# LOCAL local_c2i_at_A2I_internal_42 --> -172($fp) -# LOCAL local_c2i_at_A2I_internal_44 --> -180($fp) -# Obtain value from -180($fp) -lw $v0, -180($fp) -lw $v0, 12($v0) -sw $v0, -172($fp) -# IF_ZERO local_c2i_at_A2I_internal_42 GOTO label_FALSEIF_71 -# IF_ZERO local_c2i_at_A2I_internal_42 GOTO label_FALSEIF_71 -lw $t0, -172($fp) -beq $t0, 0, label_FALSEIF_71 -# LOCAL local_c2i_at_A2I_internal_47 --> -192($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 7 -sw $t0, 12($v0) -sw $v0, -192($fp) -# LOCAL local_c2i_at_A2I_internal_43 --> -176($fp) -# LOCAL local_c2i_at_A2I_internal_47 --> -192($fp) -# local_c2i_at_A2I_internal_43 = local_c2i_at_A2I_internal_47 -lw $t0, -192($fp) -sw $t0, -176($fp) -# GOTO label_ENDIF_72 -j label_ENDIF_72 -label_FALSEIF_71: - # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_12 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -212($fp) - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_83 - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_83 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_83 - # IF_ZERO local_c2i_at_A2I_internal_52 GOTO label_FALSE_83 - # IF_ZERO local_c2i_at_A2I_internal_52 GOTO label_FALSE_83 - lw $t0, -212($fp) - beq $t0, 0, label_FALSE_83 - # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -208($fp) - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_STRING_86 - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_STRING_86 - lw $t0, -208($fp) - beq $t0, 0, label_COMPARE_STRING_86 - # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -208($fp) - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 - lw $t0, -208($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_87 - # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -208($fp) - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 - lw $t0, -208($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_87 - # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -212($fp) - sub $a0, $a0, $a1 - sw $a0, -208($fp) - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 - lw $t0, -208($fp) - beq $t0, 0, label_TRUE_84 - # GOTO label_FALSE_83 - j label_FALSE_83 - label_COMPARE_BY_VALUE_87: - # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) - lw $a0, 0($fp) - lw $a1, -212($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -208($fp) - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 - lw $t0, -208($fp) - beq $t0, 0, label_TRUE_84 - # GOTO label_FALSE_83 - j label_FALSE_83 - label_COMPARE_STRING_86: - # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -212($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -208($fp) - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_CONTINUE_88 - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_CONTINUE_88 - lw $t0, -208($fp) - beq $t0, 0, label_CONTINUE_88 - # GOTO label_FALSE_83 - j label_FALSE_83 - label_CONTINUE_88: - # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -212($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_89: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_90 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_89 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_90: - # Store result - sw $a2, -208($fp) - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 - lw $t0, -208($fp) - beq $t0, 0, label_TRUE_84 - label_FALSE_83: - # LOCAL local_c2i_at_A2I_internal_50 --> -204($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -204($fp) - # GOTO label_END_85 -j label_END_85 -label_TRUE_84: - # LOCAL local_c2i_at_A2I_internal_50 --> -204($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -204($fp) - label_END_85: -# LOCAL local_c2i_at_A2I_internal_48 --> -196($fp) -# LOCAL local_c2i_at_A2I_internal_50 --> -204($fp) -# Obtain value from -204($fp) -lw $v0, -204($fp) -lw $v0, 12($v0) -sw $v0, -196($fp) -# IF_ZERO local_c2i_at_A2I_internal_48 GOTO label_FALSEIF_81 -# IF_ZERO local_c2i_at_A2I_internal_48 GOTO label_FALSEIF_81 -lw $t0, -196($fp) -beq $t0, 0, label_FALSEIF_81 -# LOCAL local_c2i_at_A2I_internal_53 --> -216($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 8 -sw $t0, 12($v0) -sw $v0, -216($fp) -# LOCAL local_c2i_at_A2I_internal_49 --> -200($fp) -# LOCAL local_c2i_at_A2I_internal_53 --> -216($fp) -# local_c2i_at_A2I_internal_49 = local_c2i_at_A2I_internal_53 -lw $t0, -216($fp) -sw $t0, -200($fp) -# GOTO label_ENDIF_82 -j label_ENDIF_82 -label_FALSEIF_81: - # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_13 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -236($fp) - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_93 - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_93 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_93 - # IF_ZERO local_c2i_at_A2I_internal_58 GOTO label_FALSE_93 - # IF_ZERO local_c2i_at_A2I_internal_58 GOTO label_FALSE_93 - lw $t0, -236($fp) - beq $t0, 0, label_FALSE_93 - # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -232($fp) - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_STRING_96 - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_STRING_96 - lw $t0, -232($fp) - beq $t0, 0, label_COMPARE_STRING_96 - # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -232($fp) - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 - lw $t0, -232($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_97 - # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -232($fp) - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 - lw $t0, -232($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_97 - # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -236($fp) - sub $a0, $a0, $a1 - sw $a0, -232($fp) - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 - lw $t0, -232($fp) - beq $t0, 0, label_TRUE_94 - # GOTO label_FALSE_93 - j label_FALSE_93 - label_COMPARE_BY_VALUE_97: - # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) - lw $a0, 0($fp) - lw $a1, -236($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -232($fp) - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 - lw $t0, -232($fp) - beq $t0, 0, label_TRUE_94 - # GOTO label_FALSE_93 - j label_FALSE_93 - label_COMPARE_STRING_96: - # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -236($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -232($fp) - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_CONTINUE_98 - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_CONTINUE_98 - lw $t0, -232($fp) - beq $t0, 0, label_CONTINUE_98 - # GOTO label_FALSE_93 - j label_FALSE_93 - label_CONTINUE_98: - # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -236($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_99: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_100 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_99 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_100: - # Store result - sw $a2, -232($fp) - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 - lw $t0, -232($fp) - beq $t0, 0, label_TRUE_94 - label_FALSE_93: - # LOCAL local_c2i_at_A2I_internal_56 --> -228($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -228($fp) - # GOTO label_END_95 -j label_END_95 -label_TRUE_94: - # LOCAL local_c2i_at_A2I_internal_56 --> -228($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -228($fp) - label_END_95: -# LOCAL local_c2i_at_A2I_internal_54 --> -220($fp) -# LOCAL local_c2i_at_A2I_internal_56 --> -228($fp) -# Obtain value from -228($fp) -lw $v0, -228($fp) -lw $v0, 12($v0) -sw $v0, -220($fp) -# IF_ZERO local_c2i_at_A2I_internal_54 GOTO label_FALSEIF_91 -# IF_ZERO local_c2i_at_A2I_internal_54 GOTO label_FALSEIF_91 -lw $t0, -220($fp) -beq $t0, 0, label_FALSEIF_91 -# LOCAL local_c2i_at_A2I_internal_59 --> -240($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 9 -sw $t0, 12($v0) -sw $v0, -240($fp) -# LOCAL local_c2i_at_A2I_internal_55 --> -224($fp) -# LOCAL local_c2i_at_A2I_internal_59 --> -240($fp) -# local_c2i_at_A2I_internal_55 = local_c2i_at_A2I_internal_59 -lw $t0, -240($fp) -sw $t0, -224($fp) -# GOTO label_ENDIF_92 -j label_ENDIF_92 -label_FALSEIF_91: - # LOCAL local_c2i_at_A2I_internal_62 --> -252($fp) - # local_c2i_at_A2I_internal_62 = SELF - sw $s1, -252($fp) - # LOCAL local_c2i_at_A2I_internal_60 --> -244($fp) - # LOCAL local_c2i_at_A2I_internal_62 --> -252($fp) - # local_c2i_at_A2I_internal_60 = local_c2i_at_A2I_internal_62 - lw $t0, -252($fp) - sw $t0, -244($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_c2i_at_A2I_internal_60 --> -244($fp) - # LOCAL local_c2i_at_A2I_internal_61 --> -248($fp) - # local_c2i_at_A2I_internal_61 = VCALL local_c2i_at_A2I_internal_60 abort - # Save new self pointer in $s1 - lw $s1, -244($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 124($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -248($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_c2i_at_A2I_internal_63 --> -256($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -256($fp) - # LOCAL local_c2i_at_A2I_internal_55 --> -224($fp) - # LOCAL local_c2i_at_A2I_internal_63 --> -256($fp) - # local_c2i_at_A2I_internal_55 = local_c2i_at_A2I_internal_63 - lw $t0, -256($fp) - sw $t0, -224($fp) - label_ENDIF_92: -# LOCAL local_c2i_at_A2I_internal_49 --> -200($fp) -# LOCAL local_c2i_at_A2I_internal_55 --> -224($fp) -# local_c2i_at_A2I_internal_49 = local_c2i_at_A2I_internal_55 -lw $t0, -224($fp) -sw $t0, -200($fp) -label_ENDIF_82: -# LOCAL local_c2i_at_A2I_internal_43 --> -176($fp) -# LOCAL local_c2i_at_A2I_internal_49 --> -200($fp) -# local_c2i_at_A2I_internal_43 = local_c2i_at_A2I_internal_49 -lw $t0, -200($fp) -sw $t0, -176($fp) -label_ENDIF_72: -# LOCAL local_c2i_at_A2I_internal_37 --> -152($fp) -# LOCAL local_c2i_at_A2I_internal_43 --> -176($fp) -# local_c2i_at_A2I_internal_37 = local_c2i_at_A2I_internal_43 -lw $t0, -176($fp) -sw $t0, -152($fp) -label_ENDIF_62: -# LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) -# LOCAL local_c2i_at_A2I_internal_37 --> -152($fp) -# local_c2i_at_A2I_internal_31 = local_c2i_at_A2I_internal_37 -lw $t0, -152($fp) -sw $t0, -128($fp) -label_ENDIF_52: -# LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) -# LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) -# local_c2i_at_A2I_internal_25 = local_c2i_at_A2I_internal_31 -lw $t0, -128($fp) -sw $t0, -104($fp) -label_ENDIF_42: -# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) -# LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) -# local_c2i_at_A2I_internal_19 = local_c2i_at_A2I_internal_25 -lw $t0, -104($fp) -sw $t0, -80($fp) -label_ENDIF_32: -# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) -# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) -# local_c2i_at_A2I_internal_13 = local_c2i_at_A2I_internal_19 -lw $t0, -80($fp) -sw $t0, -56($fp) -label_ENDIF_22: -# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) -# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) -# local_c2i_at_A2I_internal_7 = local_c2i_at_A2I_internal_13 -lw $t0, -56($fp) -sw $t0, -32($fp) -label_ENDIF_12: -# LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) -# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) -# local_c2i_at_A2I_internal_1 = local_c2i_at_A2I_internal_7 -lw $t0, -32($fp) -sw $t0, -8($fp) -label_ENDIF_2: -# RETURN local_c2i_at_A2I_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_c2i_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 264 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_i2c_at_A2I implementation. -# @Params: -# 0($fp) = param_i2c_at_A2I_i_0 -function_i2c_at_A2I: - # Allocate stack frame for function function_i2c_at_A2I. - subu $sp, $sp, 264 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 264 - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -20($fp) - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_103 - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_103 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_103 - # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_103 - # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_103 - lw $t0, -20($fp) - beq $t0, 0, label_FALSE_103 - # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_STRING_106 - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_STRING_106 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_106 - # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_107 - # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_107 - # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -20($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_104 - # GOTO label_FALSE_103 - j label_FALSE_103 - label_COMPARE_BY_VALUE_107: - # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - lw $a0, 0($fp) - lw $a1, -20($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_104 - # GOTO label_FALSE_103 - j label_FALSE_103 - label_COMPARE_STRING_106: - # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_CONTINUE_108 - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_CONTINUE_108 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_108 - # GOTO label_FALSE_103 - j label_FALSE_103 - label_CONTINUE_108: - # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_109: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_110 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_109 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_110: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_104 - label_FALSE_103: - # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_105 -j label_END_105 -label_TRUE_104: - # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_105: -# LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) -# LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSEIF_101 -# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSEIF_101 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_101 -# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_14 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -24($fp) -# LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) -# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) -# local_i2c_at_A2I_internal_1 = local_i2c_at_A2I_internal_5 -lw $t0, -24($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_102 -j label_ENDIF_102 -label_FALSEIF_101: - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -44($fp) - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_113 - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_113 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_113 - # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_113 - # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_113 - lw $t0, -44($fp) - beq $t0, 0, label_FALSE_113 - # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_STRING_116 - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_STRING_116 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_STRING_116 - # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_117 - # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_117 - # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -44($fp) - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_114 - # GOTO label_FALSE_113 - j label_FALSE_113 - label_COMPARE_BY_VALUE_117: - # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - lw $a0, 0($fp) - lw $a1, -44($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_114 - # GOTO label_FALSE_113 - j label_FALSE_113 - label_COMPARE_STRING_116: - # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -44($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -40($fp) - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_CONTINUE_118 - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_CONTINUE_118 - lw $t0, -40($fp) - beq $t0, 0, label_CONTINUE_118 - # GOTO label_FALSE_113 - j label_FALSE_113 - label_CONTINUE_118: - # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -44($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_119: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_120 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_119 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_120: - # Store result - sw $a2, -40($fp) - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_114 - label_FALSE_113: - # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -36($fp) - # GOTO label_END_115 -j label_END_115 -label_TRUE_114: - # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -36($fp) - label_END_115: -# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) -# LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) -# Obtain value from -36($fp) -lw $v0, -36($fp) -lw $v0, 12($v0) -sw $v0, -28($fp) -# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSEIF_111 -# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSEIF_111 -lw $t0, -28($fp) -beq $t0, 0, label_FALSEIF_111 -# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_15 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -48($fp) -# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) -# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) -# local_i2c_at_A2I_internal_7 = local_i2c_at_A2I_internal_11 -lw $t0, -48($fp) -sw $t0, -32($fp) -# GOTO label_ENDIF_112 -j label_ENDIF_112 -label_FALSEIF_111: - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 2 - sw $t0, 12($v0) - sw $v0, -68($fp) - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_123 - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_123 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_123 - # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_123 - # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_123 - lw $t0, -68($fp) - beq $t0, 0, label_FALSE_123 - # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_STRING_126 - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_STRING_126 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_STRING_126 - # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_127 - # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_127 - # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -68($fp) - sub $a0, $a0, $a1 - sw $a0, -64($fp) - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_124 - # GOTO label_FALSE_123 - j label_FALSE_123 - label_COMPARE_BY_VALUE_127: - # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - lw $a0, 0($fp) - lw $a1, -68($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -64($fp) - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_124 - # GOTO label_FALSE_123 - j label_FALSE_123 - label_COMPARE_STRING_126: - # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -68($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -64($fp) - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_CONTINUE_128 - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_CONTINUE_128 - lw $t0, -64($fp) - beq $t0, 0, label_CONTINUE_128 - # GOTO label_FALSE_123 - j label_FALSE_123 - label_CONTINUE_128: - # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -68($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_129: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_130 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_129 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_130: - # Store result - sw $a2, -64($fp) - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_124 - label_FALSE_123: - # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -60($fp) - # GOTO label_END_125 -j label_END_125 -label_TRUE_124: - # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -60($fp) - label_END_125: -# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) -# LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) -# Obtain value from -60($fp) -lw $v0, -60($fp) -lw $v0, 12($v0) -sw $v0, -52($fp) -# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSEIF_121 -# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSEIF_121 -lw $t0, -52($fp) -beq $t0, 0, label_FALSEIF_121 -# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_16 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -72($fp) -# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) -# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) -# local_i2c_at_A2I_internal_13 = local_i2c_at_A2I_internal_17 -lw $t0, -72($fp) -sw $t0, -56($fp) -# GOTO label_ENDIF_122 -j label_ENDIF_122 -label_FALSEIF_121: - # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 3 - sw $t0, 12($v0) - sw $v0, -92($fp) - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_133 - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_133 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_133 - # IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_FALSE_133 - # IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_FALSE_133 - lw $t0, -92($fp) - beq $t0, 0, label_FALSE_133 - # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_STRING_136 - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_STRING_136 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_STRING_136 - # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_137 - # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_137 - # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -92($fp) - sub $a0, $a0, $a1 - sw $a0, -88($fp) - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_134 - # GOTO label_FALSE_133 - j label_FALSE_133 - label_COMPARE_BY_VALUE_137: - # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) - lw $a0, 0($fp) - lw $a1, -92($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -88($fp) - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_134 - # GOTO label_FALSE_133 - j label_FALSE_133 - label_COMPARE_STRING_136: - # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -92($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -88($fp) - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_CONTINUE_138 - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_CONTINUE_138 - lw $t0, -88($fp) - beq $t0, 0, label_CONTINUE_138 - # GOTO label_FALSE_133 - j label_FALSE_133 - label_CONTINUE_138: - # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -92($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_139: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_140 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_139 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_140: - # Store result - sw $a2, -88($fp) - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_134 - label_FALSE_133: - # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -84($fp) - # GOTO label_END_135 -j label_END_135 -label_TRUE_134: - # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -84($fp) - label_END_135: -# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) -# LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) -# Obtain value from -84($fp) -lw $v0, -84($fp) -lw $v0, 12($v0) -sw $v0, -76($fp) -# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSEIF_131 -# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSEIF_131 -lw $t0, -76($fp) -beq $t0, 0, label_FALSEIF_131 -# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_17 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -96($fp) -# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) -# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) -# local_i2c_at_A2I_internal_19 = local_i2c_at_A2I_internal_23 -lw $t0, -96($fp) -sw $t0, -80($fp) -# GOTO label_ENDIF_132 -j label_ENDIF_132 -label_FALSEIF_131: - # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 4 - sw $t0, 12($v0) - sw $v0, -116($fp) - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_143 - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_143 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_143 - # IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_FALSE_143 - # IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_FALSE_143 - lw $t0, -116($fp) - beq $t0, 0, label_FALSE_143 - # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -112($fp) - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_STRING_146 - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_STRING_146 - lw $t0, -112($fp) - beq $t0, 0, label_COMPARE_STRING_146 - # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -112($fp) - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 - lw $t0, -112($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_147 - # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -112($fp) - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 - lw $t0, -112($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_147 - # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -116($fp) - sub $a0, $a0, $a1 - sw $a0, -112($fp) - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 - lw $t0, -112($fp) - beq $t0, 0, label_TRUE_144 - # GOTO label_FALSE_143 - j label_FALSE_143 - label_COMPARE_BY_VALUE_147: - # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) - lw $a0, 0($fp) - lw $a1, -116($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -112($fp) - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 - lw $t0, -112($fp) - beq $t0, 0, label_TRUE_144 - # GOTO label_FALSE_143 - j label_FALSE_143 - label_COMPARE_STRING_146: - # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -116($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -112($fp) - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_CONTINUE_148 - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_CONTINUE_148 - lw $t0, -112($fp) - beq $t0, 0, label_CONTINUE_148 - # GOTO label_FALSE_143 - j label_FALSE_143 - label_CONTINUE_148: - # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -116($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_149: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_150 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_149 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_150: - # Store result - sw $a2, -112($fp) - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 - lw $t0, -112($fp) - beq $t0, 0, label_TRUE_144 - label_FALSE_143: - # LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -108($fp) - # GOTO label_END_145 -j label_END_145 -label_TRUE_144: - # LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -108($fp) - label_END_145: -# LOCAL local_i2c_at_A2I_internal_24 --> -100($fp) -# LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) -# Obtain value from -108($fp) -lw $v0, -108($fp) -lw $v0, 12($v0) -sw $v0, -100($fp) -# IF_ZERO local_i2c_at_A2I_internal_24 GOTO label_FALSEIF_141 -# IF_ZERO local_i2c_at_A2I_internal_24 GOTO label_FALSEIF_141 -lw $t0, -100($fp) -beq $t0, 0, label_FALSEIF_141 -# LOCAL local_i2c_at_A2I_internal_29 --> -120($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_18 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -120($fp) -# LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) -# LOCAL local_i2c_at_A2I_internal_29 --> -120($fp) -# local_i2c_at_A2I_internal_25 = local_i2c_at_A2I_internal_29 -lw $t0, -120($fp) -sw $t0, -104($fp) -# GOTO label_ENDIF_142 -j label_ENDIF_142 -label_FALSEIF_141: - # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 5 - sw $t0, 12($v0) - sw $v0, -140($fp) - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_153 - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_153 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_153 - # IF_ZERO local_i2c_at_A2I_internal_34 GOTO label_FALSE_153 - # IF_ZERO local_i2c_at_A2I_internal_34 GOTO label_FALSE_153 - lw $t0, -140($fp) - beq $t0, 0, label_FALSE_153 - # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -136($fp) - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_STRING_156 - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_STRING_156 - lw $t0, -136($fp) - beq $t0, 0, label_COMPARE_STRING_156 - # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -136($fp) - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 - lw $t0, -136($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_157 - # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -136($fp) - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 - lw $t0, -136($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_157 - # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -140($fp) - sub $a0, $a0, $a1 - sw $a0, -136($fp) - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 - lw $t0, -136($fp) - beq $t0, 0, label_TRUE_154 - # GOTO label_FALSE_153 - j label_FALSE_153 - label_COMPARE_BY_VALUE_157: - # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) - lw $a0, 0($fp) - lw $a1, -140($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -136($fp) - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 - lw $t0, -136($fp) - beq $t0, 0, label_TRUE_154 - # GOTO label_FALSE_153 - j label_FALSE_153 - label_COMPARE_STRING_156: - # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -140($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -136($fp) - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_CONTINUE_158 - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_CONTINUE_158 - lw $t0, -136($fp) - beq $t0, 0, label_CONTINUE_158 - # GOTO label_FALSE_153 - j label_FALSE_153 - label_CONTINUE_158: - # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -140($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_159: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_160 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_159 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_160: - # Store result - sw $a2, -136($fp) - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 - lw $t0, -136($fp) - beq $t0, 0, label_TRUE_154 - label_FALSE_153: - # LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -132($fp) - # GOTO label_END_155 -j label_END_155 -label_TRUE_154: - # LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -132($fp) - label_END_155: -# LOCAL local_i2c_at_A2I_internal_30 --> -124($fp) -# LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) -# Obtain value from -132($fp) -lw $v0, -132($fp) -lw $v0, 12($v0) -sw $v0, -124($fp) -# IF_ZERO local_i2c_at_A2I_internal_30 GOTO label_FALSEIF_151 -# IF_ZERO local_i2c_at_A2I_internal_30 GOTO label_FALSEIF_151 -lw $t0, -124($fp) -beq $t0, 0, label_FALSEIF_151 -# LOCAL local_i2c_at_A2I_internal_35 --> -144($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_19 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -144($fp) -# LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) -# LOCAL local_i2c_at_A2I_internal_35 --> -144($fp) -# local_i2c_at_A2I_internal_31 = local_i2c_at_A2I_internal_35 -lw $t0, -144($fp) -sw $t0, -128($fp) -# GOTO label_ENDIF_152 -j label_ENDIF_152 -label_FALSEIF_151: - # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 6 - sw $t0, 12($v0) - sw $v0, -164($fp) - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_163 - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_163 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_163 - # IF_ZERO local_i2c_at_A2I_internal_40 GOTO label_FALSE_163 - # IF_ZERO local_i2c_at_A2I_internal_40 GOTO label_FALSE_163 - lw $t0, -164($fp) - beq $t0, 0, label_FALSE_163 - # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -160($fp) - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_STRING_166 - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_STRING_166 - lw $t0, -160($fp) - beq $t0, 0, label_COMPARE_STRING_166 - # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -160($fp) - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 - lw $t0, -160($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_167 - # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -160($fp) - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 - lw $t0, -160($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_167 - # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -164($fp) - sub $a0, $a0, $a1 - sw $a0, -160($fp) - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 - lw $t0, -160($fp) - beq $t0, 0, label_TRUE_164 - # GOTO label_FALSE_163 - j label_FALSE_163 - label_COMPARE_BY_VALUE_167: - # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) - lw $a0, 0($fp) - lw $a1, -164($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -160($fp) - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 - lw $t0, -160($fp) - beq $t0, 0, label_TRUE_164 - # GOTO label_FALSE_163 - j label_FALSE_163 - label_COMPARE_STRING_166: - # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -164($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -160($fp) - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_CONTINUE_168 - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_CONTINUE_168 - lw $t0, -160($fp) - beq $t0, 0, label_CONTINUE_168 - # GOTO label_FALSE_163 - j label_FALSE_163 - label_CONTINUE_168: - # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -164($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_169: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_170 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_169 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_170: - # Store result - sw $a2, -160($fp) - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 - lw $t0, -160($fp) - beq $t0, 0, label_TRUE_164 - label_FALSE_163: - # LOCAL local_i2c_at_A2I_internal_38 --> -156($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -156($fp) - # GOTO label_END_165 -j label_END_165 -label_TRUE_164: - # LOCAL local_i2c_at_A2I_internal_38 --> -156($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -156($fp) - label_END_165: -# LOCAL local_i2c_at_A2I_internal_36 --> -148($fp) -# LOCAL local_i2c_at_A2I_internal_38 --> -156($fp) -# Obtain value from -156($fp) -lw $v0, -156($fp) -lw $v0, 12($v0) -sw $v0, -148($fp) -# IF_ZERO local_i2c_at_A2I_internal_36 GOTO label_FALSEIF_161 -# IF_ZERO local_i2c_at_A2I_internal_36 GOTO label_FALSEIF_161 -lw $t0, -148($fp) -beq $t0, 0, label_FALSEIF_161 -# LOCAL local_i2c_at_A2I_internal_41 --> -168($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_20 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -168($fp) -# LOCAL local_i2c_at_A2I_internal_37 --> -152($fp) -# LOCAL local_i2c_at_A2I_internal_41 --> -168($fp) -# local_i2c_at_A2I_internal_37 = local_i2c_at_A2I_internal_41 -lw $t0, -168($fp) -sw $t0, -152($fp) -# GOTO label_ENDIF_162 -j label_ENDIF_162 -label_FALSEIF_161: - # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 7 - sw $t0, 12($v0) - sw $v0, -188($fp) - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_173 - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_173 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_173 - # IF_ZERO local_i2c_at_A2I_internal_46 GOTO label_FALSE_173 - # IF_ZERO local_i2c_at_A2I_internal_46 GOTO label_FALSE_173 - lw $t0, -188($fp) - beq $t0, 0, label_FALSE_173 - # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -184($fp) - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_STRING_176 - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_STRING_176 - lw $t0, -184($fp) - beq $t0, 0, label_COMPARE_STRING_176 - # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -184($fp) - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 - lw $t0, -184($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_177 - # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -184($fp) - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 - lw $t0, -184($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_177 - # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -188($fp) - sub $a0, $a0, $a1 - sw $a0, -184($fp) - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 - lw $t0, -184($fp) - beq $t0, 0, label_TRUE_174 - # GOTO label_FALSE_173 - j label_FALSE_173 - label_COMPARE_BY_VALUE_177: - # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) - lw $a0, 0($fp) - lw $a1, -188($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -184($fp) - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 - lw $t0, -184($fp) - beq $t0, 0, label_TRUE_174 - # GOTO label_FALSE_173 - j label_FALSE_173 - label_COMPARE_STRING_176: - # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -188($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -184($fp) - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_CONTINUE_178 - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_CONTINUE_178 - lw $t0, -184($fp) - beq $t0, 0, label_CONTINUE_178 - # GOTO label_FALSE_173 - j label_FALSE_173 - label_CONTINUE_178: - # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -188($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_179: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_180 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_179 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_180: - # Store result - sw $a2, -184($fp) - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 - lw $t0, -184($fp) - beq $t0, 0, label_TRUE_174 - label_FALSE_173: - # LOCAL local_i2c_at_A2I_internal_44 --> -180($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -180($fp) - # GOTO label_END_175 -j label_END_175 -label_TRUE_174: - # LOCAL local_i2c_at_A2I_internal_44 --> -180($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -180($fp) - label_END_175: -# LOCAL local_i2c_at_A2I_internal_42 --> -172($fp) -# LOCAL local_i2c_at_A2I_internal_44 --> -180($fp) -# Obtain value from -180($fp) -lw $v0, -180($fp) -lw $v0, 12($v0) -sw $v0, -172($fp) -# IF_ZERO local_i2c_at_A2I_internal_42 GOTO label_FALSEIF_171 -# IF_ZERO local_i2c_at_A2I_internal_42 GOTO label_FALSEIF_171 -lw $t0, -172($fp) -beq $t0, 0, label_FALSEIF_171 -# LOCAL local_i2c_at_A2I_internal_47 --> -192($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_21 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -192($fp) -# LOCAL local_i2c_at_A2I_internal_43 --> -176($fp) -# LOCAL local_i2c_at_A2I_internal_47 --> -192($fp) -# local_i2c_at_A2I_internal_43 = local_i2c_at_A2I_internal_47 -lw $t0, -192($fp) -sw $t0, -176($fp) -# GOTO label_ENDIF_172 -j label_ENDIF_172 -label_FALSEIF_171: - # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 8 - sw $t0, 12($v0) - sw $v0, -212($fp) - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_183 - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_183 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_183 - # IF_ZERO local_i2c_at_A2I_internal_52 GOTO label_FALSE_183 - # IF_ZERO local_i2c_at_A2I_internal_52 GOTO label_FALSE_183 - lw $t0, -212($fp) - beq $t0, 0, label_FALSE_183 - # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -208($fp) - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_STRING_186 - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_STRING_186 - lw $t0, -208($fp) - beq $t0, 0, label_COMPARE_STRING_186 - # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -208($fp) - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 - lw $t0, -208($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_187 - # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -208($fp) - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 - lw $t0, -208($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_187 - # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -212($fp) - sub $a0, $a0, $a1 - sw $a0, -208($fp) - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 - lw $t0, -208($fp) - beq $t0, 0, label_TRUE_184 - # GOTO label_FALSE_183 - j label_FALSE_183 - label_COMPARE_BY_VALUE_187: - # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) - lw $a0, 0($fp) - lw $a1, -212($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -208($fp) - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 - lw $t0, -208($fp) - beq $t0, 0, label_TRUE_184 - # GOTO label_FALSE_183 - j label_FALSE_183 - label_COMPARE_STRING_186: - # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -212($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -208($fp) - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_CONTINUE_188 - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_CONTINUE_188 - lw $t0, -208($fp) - beq $t0, 0, label_CONTINUE_188 - # GOTO label_FALSE_183 - j label_FALSE_183 - label_CONTINUE_188: - # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -212($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_189: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_190 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_189 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_190: - # Store result - sw $a2, -208($fp) - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 - lw $t0, -208($fp) - beq $t0, 0, label_TRUE_184 - label_FALSE_183: - # LOCAL local_i2c_at_A2I_internal_50 --> -204($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -204($fp) - # GOTO label_END_185 -j label_END_185 -label_TRUE_184: - # LOCAL local_i2c_at_A2I_internal_50 --> -204($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -204($fp) - label_END_185: -# LOCAL local_i2c_at_A2I_internal_48 --> -196($fp) -# LOCAL local_i2c_at_A2I_internal_50 --> -204($fp) -# Obtain value from -204($fp) -lw $v0, -204($fp) -lw $v0, 12($v0) -sw $v0, -196($fp) -# IF_ZERO local_i2c_at_A2I_internal_48 GOTO label_FALSEIF_181 -# IF_ZERO local_i2c_at_A2I_internal_48 GOTO label_FALSEIF_181 -lw $t0, -196($fp) -beq $t0, 0, label_FALSEIF_181 -# LOCAL local_i2c_at_A2I_internal_53 --> -216($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_22 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -216($fp) -# LOCAL local_i2c_at_A2I_internal_49 --> -200($fp) -# LOCAL local_i2c_at_A2I_internal_53 --> -216($fp) -# local_i2c_at_A2I_internal_49 = local_i2c_at_A2I_internal_53 -lw $t0, -216($fp) -sw $t0, -200($fp) -# GOTO label_ENDIF_182 -j label_ENDIF_182 -label_FALSEIF_181: - # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 9 - sw $t0, 12($v0) - sw $v0, -236($fp) - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_193 - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_193 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_193 - # IF_ZERO local_i2c_at_A2I_internal_58 GOTO label_FALSE_193 - # IF_ZERO local_i2c_at_A2I_internal_58 GOTO label_FALSE_193 - lw $t0, -236($fp) - beq $t0, 0, label_FALSE_193 - # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -232($fp) - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_STRING_196 - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_STRING_196 - lw $t0, -232($fp) - beq $t0, 0, label_COMPARE_STRING_196 - # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -232($fp) - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 - lw $t0, -232($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_197 - # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -232($fp) - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 - lw $t0, -232($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_197 - # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -236($fp) - sub $a0, $a0, $a1 - sw $a0, -232($fp) - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 - lw $t0, -232($fp) - beq $t0, 0, label_TRUE_194 - # GOTO label_FALSE_193 - j label_FALSE_193 - label_COMPARE_BY_VALUE_197: - # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) - lw $a0, 0($fp) - lw $a1, -236($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -232($fp) - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 - lw $t0, -232($fp) - beq $t0, 0, label_TRUE_194 - # GOTO label_FALSE_193 - j label_FALSE_193 - label_COMPARE_STRING_196: - # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -236($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -232($fp) - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_CONTINUE_198 - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_CONTINUE_198 - lw $t0, -232($fp) - beq $t0, 0, label_CONTINUE_198 - # GOTO label_FALSE_193 - j label_FALSE_193 - label_CONTINUE_198: - # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -236($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_199: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_200 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_199 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_200: - # Store result - sw $a2, -232($fp) - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 - lw $t0, -232($fp) - beq $t0, 0, label_TRUE_194 - label_FALSE_193: - # LOCAL local_i2c_at_A2I_internal_56 --> -228($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -228($fp) - # GOTO label_END_195 -j label_END_195 -label_TRUE_194: - # LOCAL local_i2c_at_A2I_internal_56 --> -228($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -228($fp) - label_END_195: -# LOCAL local_i2c_at_A2I_internal_54 --> -220($fp) -# LOCAL local_i2c_at_A2I_internal_56 --> -228($fp) -# Obtain value from -228($fp) -lw $v0, -228($fp) -lw $v0, 12($v0) -sw $v0, -220($fp) -# IF_ZERO local_i2c_at_A2I_internal_54 GOTO label_FALSEIF_191 -# IF_ZERO local_i2c_at_A2I_internal_54 GOTO label_FALSEIF_191 -lw $t0, -220($fp) -beq $t0, 0, label_FALSEIF_191 -# LOCAL local_i2c_at_A2I_internal_59 --> -240($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_23 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -240($fp) -# LOCAL local_i2c_at_A2I_internal_55 --> -224($fp) -# LOCAL local_i2c_at_A2I_internal_59 --> -240($fp) -# local_i2c_at_A2I_internal_55 = local_i2c_at_A2I_internal_59 -lw $t0, -240($fp) -sw $t0, -224($fp) -# GOTO label_ENDIF_192 -j label_ENDIF_192 -label_FALSEIF_191: - # LOCAL local_i2c_at_A2I_internal_62 --> -252($fp) - # local_i2c_at_A2I_internal_62 = SELF - sw $s1, -252($fp) - # LOCAL local_i2c_at_A2I_internal_60 --> -244($fp) - # LOCAL local_i2c_at_A2I_internal_62 --> -252($fp) - # local_i2c_at_A2I_internal_60 = local_i2c_at_A2I_internal_62 - lw $t0, -252($fp) - sw $t0, -244($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2c_at_A2I_internal_60 --> -244($fp) - # LOCAL local_i2c_at_A2I_internal_61 --> -248($fp) - # local_i2c_at_A2I_internal_61 = VCALL local_i2c_at_A2I_internal_60 abort - # Save new self pointer in $s1 - lw $s1, -244($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 124($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -248($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_i2c_at_A2I_internal_63 --> -256($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_24 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -256($fp) - # LOCAL local_i2c_at_A2I_internal_55 --> -224($fp) - # LOCAL local_i2c_at_A2I_internal_63 --> -256($fp) - # local_i2c_at_A2I_internal_55 = local_i2c_at_A2I_internal_63 - lw $t0, -256($fp) - sw $t0, -224($fp) - label_ENDIF_192: -# LOCAL local_i2c_at_A2I_internal_49 --> -200($fp) -# LOCAL local_i2c_at_A2I_internal_55 --> -224($fp) -# local_i2c_at_A2I_internal_49 = local_i2c_at_A2I_internal_55 -lw $t0, -224($fp) -sw $t0, -200($fp) -label_ENDIF_182: -# LOCAL local_i2c_at_A2I_internal_43 --> -176($fp) -# LOCAL local_i2c_at_A2I_internal_49 --> -200($fp) -# local_i2c_at_A2I_internal_43 = local_i2c_at_A2I_internal_49 -lw $t0, -200($fp) -sw $t0, -176($fp) -label_ENDIF_172: -# LOCAL local_i2c_at_A2I_internal_37 --> -152($fp) -# LOCAL local_i2c_at_A2I_internal_43 --> -176($fp) -# local_i2c_at_A2I_internal_37 = local_i2c_at_A2I_internal_43 -lw $t0, -176($fp) -sw $t0, -152($fp) -label_ENDIF_162: -# LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) -# LOCAL local_i2c_at_A2I_internal_37 --> -152($fp) -# local_i2c_at_A2I_internal_31 = local_i2c_at_A2I_internal_37 -lw $t0, -152($fp) -sw $t0, -128($fp) -label_ENDIF_152: -# LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) -# LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) -# local_i2c_at_A2I_internal_25 = local_i2c_at_A2I_internal_31 -lw $t0, -128($fp) -sw $t0, -104($fp) -label_ENDIF_142: -# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) -# LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) -# local_i2c_at_A2I_internal_19 = local_i2c_at_A2I_internal_25 -lw $t0, -104($fp) -sw $t0, -80($fp) -label_ENDIF_132: -# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) -# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) -# local_i2c_at_A2I_internal_13 = local_i2c_at_A2I_internal_19 -lw $t0, -80($fp) -sw $t0, -56($fp) -label_ENDIF_122: -# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) -# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) -# local_i2c_at_A2I_internal_7 = local_i2c_at_A2I_internal_13 -lw $t0, -56($fp) -sw $t0, -32($fp) -label_ENDIF_112: -# LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) -# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) -# local_i2c_at_A2I_internal_1 = local_i2c_at_A2I_internal_7 -lw $t0, -32($fp) -sw $t0, -8($fp) -label_ENDIF_102: -# RETURN local_i2c_at_A2I_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_i2c_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 264 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_a2i_at_A2I implementation. -# @Params: -# 0($fp) = param_a2i_at_A2I_s_0 -function_a2i_at_A2I: - # Allocate stack frame for function function_a2i_at_A2I. - subu $sp, $sp, 208 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 208 - # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) - # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - # local_a2i_at_A2I_internal_4 = PARAM param_a2i_at_A2I_s_0 - lw $t0, 0($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # local_a2i_at_A2I_internal_5 = VCALL local_a2i_at_A2I_internal_4 length - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 20($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -28($fp) - # IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_FALSE_203 - # IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_FALSE_203 - lw $t0, -24($fp) - beq $t0, 0, label_FALSE_203 - # IF_ZERO local_a2i_at_A2I_internal_6 GOTO label_FALSE_203 - # IF_ZERO local_a2i_at_A2I_internal_6 GOTO label_FALSE_203 - lw $t0, -28($fp) - beq $t0, 0, label_FALSE_203 - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # Comparing -24($fp) type with String - la $v0, String - lw $a0, -24($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_206 - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_206 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_206 - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # Comparing -24($fp) type with Bool - la $v0, Bool - lw $a0, -24($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_207 - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # Comparing -24($fp) type with Int - la $v0, Int - lw $a0, -24($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_207 - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) - # Load pointers and SUB - lw $a0, -24($fp) - lw $a1, -28($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_204 - # GOTO label_FALSE_203 - j label_FALSE_203 - label_COMPARE_BY_VALUE_207: - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) - lw $a0, -24($fp) - lw $a1, -28($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_204 - # GOTO label_FALSE_203 - j label_FALSE_203 - label_COMPARE_STRING_206: - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) - # Load strings for comparison - lw $v0, -24($fp) - lw $v1, -28($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_CONTINUE_208 - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_CONTINUE_208 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_208 - # GOTO label_FALSE_203 - j label_FALSE_203 - label_CONTINUE_208: - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -24($fp) - lw $v1, -28($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_209: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_210 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_209 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_210: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_204 - label_FALSE_203: - # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_205 -j label_END_205 -label_TRUE_204: - # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_205: -# LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) -# LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSEIF_201 -# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSEIF_201 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_201 -# LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -32($fp) -# LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) -# LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) -# local_a2i_at_A2I_internal_1 = local_a2i_at_A2I_internal_7 -lw $t0, -32($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_202 -j label_ENDIF_202 -label_FALSEIF_201: - # LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) - # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - # local_a2i_at_A2I_internal_12 = PARAM param_a2i_at_A2I_s_0 - lw $t0, 0($fp) - sw $t0, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -60($fp) - # ARG local_a2i_at_A2I_internal_14 - # LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) - lw $t0, -60($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -64($fp) - # ARG local_a2i_at_A2I_internal_15 - # LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) - lw $t0, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) - # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) - # local_a2i_at_A2I_internal_13 = VCALL local_a2i_at_A2I_internal_12 substr - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 60($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_25 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -68($fp) - # IF_ZERO local_a2i_at_A2I_internal_13 GOTO label_FALSE_213 - # IF_ZERO local_a2i_at_A2I_internal_13 GOTO label_FALSE_213 - lw $t0, -56($fp) - beq $t0, 0, label_FALSE_213 - # IF_ZERO local_a2i_at_A2I_internal_16 GOTO label_FALSE_213 - # IF_ZERO local_a2i_at_A2I_internal_16 GOTO label_FALSE_213 - lw $t0, -68($fp) - beq $t0, 0, label_FALSE_213 - # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) - # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) - # Comparing -56($fp) type with String - la $v0, String - lw $a0, -56($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_STRING_216 - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_STRING_216 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_STRING_216 - # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) - # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) - # Comparing -56($fp) type with Bool - la $v0, Bool - lw $a0, -56($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_217 - # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) - # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) - # Comparing -56($fp) type with Int - la $v0, Int - lw $a0, -56($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_217 - # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) - # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) - # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) - # Load pointers and SUB - lw $a0, -56($fp) - lw $a1, -68($fp) - sub $a0, $a0, $a1 - sw $a0, -48($fp) - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_214 - # GOTO label_FALSE_213 - j label_FALSE_213 - label_COMPARE_BY_VALUE_217: - # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) - # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) - # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) - lw $a0, -56($fp) - lw $a1, -68($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -48($fp) - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_214 - # GOTO label_FALSE_213 - j label_FALSE_213 - label_COMPARE_STRING_216: - # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) - # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) - # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) - # Load strings for comparison - lw $v0, -56($fp) - lw $v1, -68($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -48($fp) - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_CONTINUE_218 - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_CONTINUE_218 - lw $t0, -48($fp) - beq $t0, 0, label_CONTINUE_218 - # GOTO label_FALSE_213 - j label_FALSE_213 - label_CONTINUE_218: - # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) - # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) - # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -56($fp) - lw $v1, -68($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_219: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_220 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_219 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_220: - # Store result - sw $a2, -48($fp) - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_214 - label_FALSE_213: - # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -44($fp) - # GOTO label_END_215 -j label_END_215 -label_TRUE_214: - # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -44($fp) - label_END_215: -# LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) -# LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) -# Obtain value from -44($fp) -lw $v0, -44($fp) -lw $v0, 12($v0) -sw $v0, -36($fp) -# IF_ZERO local_a2i_at_A2I_internal_8 GOTO label_FALSEIF_211 -# IF_ZERO local_a2i_at_A2I_internal_8 GOTO label_FALSEIF_211 -lw $t0, -36($fp) -beq $t0, 0, label_FALSEIF_211 -# LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) -# local_a2i_at_A2I_internal_20 = SELF -sw $s1, -84($fp) -# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) -# LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) -# local_a2i_at_A2I_internal_18 = local_a2i_at_A2I_internal_20 -lw $t0, -84($fp) -sw $t0, -76($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_21 = PARAM param_a2i_at_A2I_s_0 -lw $t0, 0($fp) -sw $t0, -88($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_23 --> -96($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -96($fp) -# ARG local_a2i_at_A2I_internal_23 -# LOCAL local_a2i_at_A2I_internal_23 --> -96($fp) -lw $t0, -96($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_A2I_internal_25 --> -104($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_25 = PARAM param_a2i_at_A2I_s_0 -lw $t0, 0($fp) -sw $t0, -104($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_25 --> -104($fp) -# LOCAL local_a2i_at_A2I_internal_26 --> -108($fp) -# local_a2i_at_A2I_internal_26 = VCALL local_a2i_at_A2I_internal_25 length -# Save new self pointer in $s1 -lw $s1, -104($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 20($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -108($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_27 --> -112($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -112($fp) -# LOCAL local_a2i_at_A2I_internal_24 --> -100($fp) -# LOCAL local_a2i_at_A2I_internal_26 --> -108($fp) -# LOCAL local_a2i_at_A2I_internal_27 --> -112($fp) -# local_a2i_at_A2I_internal_24 = local_a2i_at_A2I_internal_26 - local_a2i_at_A2I_internal_27 -lw $t1, -108($fp) -lw $t0, 12($t1) -lw $t1, -112($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -100($fp) -# ARG local_a2i_at_A2I_internal_24 -# LOCAL local_a2i_at_A2I_internal_24 --> -100($fp) -lw $t0, -100($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) -# LOCAL local_a2i_at_A2I_internal_22 --> -92($fp) -# local_a2i_at_A2I_internal_22 = VCALL local_a2i_at_A2I_internal_21 substr -# Save new self pointer in $s1 -lw $s1, -88($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 60($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -92($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_a2i_at_A2I_internal_22 -# LOCAL local_a2i_at_A2I_internal_22 --> -92($fp) -lw $t0, -92($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) -# LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) -# local_a2i_at_A2I_internal_19 = VCALL local_a2i_at_A2I_internal_18 a2i_aux -# Save new self pointer in $s1 -lw $s1, -76($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 112($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -80($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) -# LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) -lw $t0, -80($fp) -lw $t0, 12($t0) -not $t0, $t0 -add $t0, $t0, 1 -sw $t0, -72($fp) -# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) -# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -lw $t0, -72($fp) -sw $t0, 12($v0) -sw $v0, -72($fp) -# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) -# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) -# local_a2i_at_A2I_internal_9 = local_a2i_at_A2I_internal_17 -lw $t0, -72($fp) -sw $t0, -40($fp) -# GOTO label_ENDIF_212 -j label_ENDIF_212 -label_FALSEIF_211: - # LOCAL local_a2i_at_A2I_internal_32 --> -132($fp) - # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - # local_a2i_at_A2I_internal_32 = PARAM param_a2i_at_A2I_s_0 - lw $t0, 0($fp) - sw $t0, -132($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_34 --> -140($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -140($fp) - # ARG local_a2i_at_A2I_internal_34 - # LOCAL local_a2i_at_A2I_internal_34 --> -140($fp) - lw $t0, -140($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_at_A2I_internal_35 --> -144($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -144($fp) - # ARG local_a2i_at_A2I_internal_35 - # LOCAL local_a2i_at_A2I_internal_35 --> -144($fp) - lw $t0, -144($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_at_A2I_internal_32 --> -132($fp) - # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) - # local_a2i_at_A2I_internal_33 = VCALL local_a2i_at_A2I_internal_32 substr - # Save new self pointer in $s1 - lw $s1, -132($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 60($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -136($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_26 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -148($fp) - # IF_ZERO local_a2i_at_A2I_internal_33 GOTO label_FALSE_223 - # IF_ZERO local_a2i_at_A2I_internal_33 GOTO label_FALSE_223 - lw $t0, -136($fp) - beq $t0, 0, label_FALSE_223 - # IF_ZERO local_a2i_at_A2I_internal_36 GOTO label_FALSE_223 - # IF_ZERO local_a2i_at_A2I_internal_36 GOTO label_FALSE_223 - lw $t0, -148($fp) - beq $t0, 0, label_FALSE_223 - # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) - # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) - # Comparing -136($fp) type with String - la $v0, String - lw $a0, -136($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -128($fp) - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_STRING_226 - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_STRING_226 - lw $t0, -128($fp) - beq $t0, 0, label_COMPARE_STRING_226 - # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) - # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) - # Comparing -136($fp) type with Bool - la $v0, Bool - lw $a0, -136($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -128($fp) - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 - lw $t0, -128($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_227 - # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) - # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) - # Comparing -136($fp) type with Int - la $v0, Int - lw $a0, -136($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -128($fp) - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 - lw $t0, -128($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_227 - # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) - # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) - # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) - # Load pointers and SUB - lw $a0, -136($fp) - lw $a1, -148($fp) - sub $a0, $a0, $a1 - sw $a0, -128($fp) - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 - lw $t0, -128($fp) - beq $t0, 0, label_TRUE_224 - # GOTO label_FALSE_223 - j label_FALSE_223 - label_COMPARE_BY_VALUE_227: - # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) - # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) - # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) - lw $a0, -136($fp) - lw $a1, -148($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -128($fp) - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 - lw $t0, -128($fp) - beq $t0, 0, label_TRUE_224 - # GOTO label_FALSE_223 - j label_FALSE_223 - label_COMPARE_STRING_226: - # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) - # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) - # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) - # Load strings for comparison - lw $v0, -136($fp) - lw $v1, -148($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -128($fp) - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_CONTINUE_228 - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_CONTINUE_228 - lw $t0, -128($fp) - beq $t0, 0, label_CONTINUE_228 - # GOTO label_FALSE_223 - j label_FALSE_223 - label_CONTINUE_228: - # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) - # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) - # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -136($fp) - lw $v1, -148($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_229: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_230 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_229 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_230: - # Store result - sw $a2, -128($fp) - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 - lw $t0, -128($fp) - beq $t0, 0, label_TRUE_224 - label_FALSE_223: - # LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -124($fp) - # GOTO label_END_225 -j label_END_225 -label_TRUE_224: - # LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -124($fp) - label_END_225: -# LOCAL local_a2i_at_A2I_internal_28 --> -116($fp) -# LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) -# Obtain value from -124($fp) -lw $v0, -124($fp) -lw $v0, 12($v0) -sw $v0, -116($fp) -# IF_ZERO local_a2i_at_A2I_internal_28 GOTO label_FALSEIF_221 -# IF_ZERO local_a2i_at_A2I_internal_28 GOTO label_FALSEIF_221 -lw $t0, -116($fp) -beq $t0, 0, label_FALSEIF_221 -# LOCAL local_a2i_at_A2I_internal_39 --> -160($fp) -# local_a2i_at_A2I_internal_39 = SELF -sw $s1, -160($fp) -# LOCAL local_a2i_at_A2I_internal_37 --> -152($fp) -# LOCAL local_a2i_at_A2I_internal_39 --> -160($fp) -# local_a2i_at_A2I_internal_37 = local_a2i_at_A2I_internal_39 -lw $t0, -160($fp) -sw $t0, -152($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_40 --> -164($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_40 = PARAM param_a2i_at_A2I_s_0 -lw $t0, 0($fp) -sw $t0, -164($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_42 --> -172($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -172($fp) -# ARG local_a2i_at_A2I_internal_42 -# LOCAL local_a2i_at_A2I_internal_42 --> -172($fp) -lw $t0, -172($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_A2I_internal_44 --> -180($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_44 = PARAM param_a2i_at_A2I_s_0 -lw $t0, 0($fp) -sw $t0, -180($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_44 --> -180($fp) -# LOCAL local_a2i_at_A2I_internal_45 --> -184($fp) -# local_a2i_at_A2I_internal_45 = VCALL local_a2i_at_A2I_internal_44 length -# Save new self pointer in $s1 -lw $s1, -180($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 20($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -184($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_46 --> -188($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -188($fp) -# LOCAL local_a2i_at_A2I_internal_43 --> -176($fp) -# LOCAL local_a2i_at_A2I_internal_45 --> -184($fp) -# LOCAL local_a2i_at_A2I_internal_46 --> -188($fp) -# local_a2i_at_A2I_internal_43 = local_a2i_at_A2I_internal_45 - local_a2i_at_A2I_internal_46 -lw $t1, -184($fp) -lw $t0, 12($t1) -lw $t1, -188($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -176($fp) -# ARG local_a2i_at_A2I_internal_43 -# LOCAL local_a2i_at_A2I_internal_43 --> -176($fp) -lw $t0, -176($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_A2I_internal_40 --> -164($fp) -# LOCAL local_a2i_at_A2I_internal_41 --> -168($fp) -# local_a2i_at_A2I_internal_41 = VCALL local_a2i_at_A2I_internal_40 substr -# Save new self pointer in $s1 -lw $s1, -164($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 60($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -168($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_a2i_at_A2I_internal_41 -# LOCAL local_a2i_at_A2I_internal_41 --> -168($fp) -lw $t0, -168($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_A2I_internal_37 --> -152($fp) -# LOCAL local_a2i_at_A2I_internal_38 --> -156($fp) -# local_a2i_at_A2I_internal_38 = VCALL local_a2i_at_A2I_internal_37 a2i_aux -# Save new self pointer in $s1 -lw $s1, -152($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 112($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -156($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) -# LOCAL local_a2i_at_A2I_internal_38 --> -156($fp) -# local_a2i_at_A2I_internal_29 = local_a2i_at_A2I_internal_38 -lw $t0, -156($fp) -sw $t0, -120($fp) -# GOTO label_ENDIF_222 -j label_ENDIF_222 -label_FALSEIF_221: - # LOCAL local_a2i_at_A2I_internal_49 --> -200($fp) - # local_a2i_at_A2I_internal_49 = SELF - sw $s1, -200($fp) - # LOCAL local_a2i_at_A2I_internal_47 --> -192($fp) - # LOCAL local_a2i_at_A2I_internal_49 --> -200($fp) - # local_a2i_at_A2I_internal_47 = local_a2i_at_A2I_internal_49 - lw $t0, -200($fp) - sw $t0, -192($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_a2i_at_A2I_s_0 - # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_at_A2I_internal_47 --> -192($fp) - # LOCAL local_a2i_at_A2I_internal_48 --> -196($fp) - # local_a2i_at_A2I_internal_48 = VCALL local_a2i_at_A2I_internal_47 a2i_aux - # Save new self pointer in $s1 - lw $s1, -192($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 112($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -196($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) - # LOCAL local_a2i_at_A2I_internal_48 --> -196($fp) - # local_a2i_at_A2I_internal_29 = local_a2i_at_A2I_internal_48 - lw $t0, -196($fp) - sw $t0, -120($fp) - label_ENDIF_222: -# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) -# LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) -# local_a2i_at_A2I_internal_9 = local_a2i_at_A2I_internal_29 -lw $t0, -120($fp) -sw $t0, -40($fp) -label_ENDIF_212: -# LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) -# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) -# local_a2i_at_A2I_internal_1 = local_a2i_at_A2I_internal_9 -lw $t0, -40($fp) -sw $t0, -8($fp) -label_ENDIF_202: -# RETURN local_a2i_at_A2I_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_a2i_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 208 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_a2i_aux_at_A2I implementation. -# @Params: -# 0($fp) = param_a2i_aux_at_A2I_s_0 -function_a2i_aux_at_A2I: - # Allocate stack frame for function function_a2i_aux_at_A2I. - subu $sp, $sp, 88 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 88 - # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_a2i_aux_at_A2I_internal_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -8($fp) - # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) - # LOCAL local_a2i_aux_at_A2I_internal_1 --> -8($fp) - # local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # LOCAL local_a2i_aux_at_A2I_j_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) - # PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) - # local_a2i_aux_at_A2I_internal_3 = PARAM param_a2i_aux_at_A2I_s_0 - lw $t0, 0($fp) - sw $t0, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) - # LOCAL local_a2i_aux_at_A2I_internal_4 --> -20($fp) - # local_a2i_aux_at_A2I_internal_4 = VCALL local_a2i_aux_at_A2I_internal_3 length - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 20($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_aux_at_A2I_j_2 --> -12($fp) - # LOCAL local_a2i_aux_at_A2I_internal_4 --> -20($fp) - # local_a2i_aux_at_A2I_j_2 = local_a2i_aux_at_A2I_internal_4 - lw $t0, -20($fp) - sw $t0, -12($fp) - # LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -24($fp) - # LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -28($fp) - # LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) - # LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) - # local_a2i_aux_at_A2I_i_5 = local_a2i_aux_at_A2I_internal_6 - lw $t0, -28($fp) - sw $t0, -24($fp) - label_WHILE_231: - # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) - # LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) - # LOCAL local_a2i_aux_at_A2I_j_2 --> -12($fp) - lw $a0, -24($fp) - lw $a1, -12($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -36($fp) - # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 - # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 - lw $t0, -36($fp) - bgt $t0, 0, label_FALSE_233 - # IF_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 - # IF_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 - lw $t0, -36($fp) - beq $t0, 0, label_FALSE_233 - # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -36($fp) - # GOTO label_END_234 -j label_END_234 -label_FALSE_233: - # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -36($fp) - label_END_234: -# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) -# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) -# Obtain value from -36($fp) -lw $v0, -36($fp) -lw $v0, 12($v0) -sw $v0, -32($fp) -# IF_ZERO local_a2i_aux_at_A2I_internal_7 GOTO label_WHILE_END_232 -# IF_ZERO local_a2i_aux_at_A2I_internal_7 GOTO label_WHILE_END_232 -lw $t0, -32($fp) -beq $t0, 0, label_WHILE_END_232 -# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 10 -sw $t0, 12($v0) -sw $v0, -48($fp) -# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) -# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) -# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) -# local_a2i_aux_at_A2I_internal_10 = local_a2i_aux_at_A2I_int_0 * local_a2i_aux_at_A2I_internal_11 -lw $t1, -4($fp) -lw $t0, 12($t1) -lw $t1, -48($fp) -lw $t2, 12($t1) -mul $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -44($fp) -# LOCAL local_a2i_aux_at_A2I_internal_14 --> -60($fp) -# local_a2i_aux_at_A2I_internal_14 = SELF -sw $s1, -60($fp) -# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) -# LOCAL local_a2i_aux_at_A2I_internal_14 --> -60($fp) -# local_a2i_aux_at_A2I_internal_12 = local_a2i_aux_at_A2I_internal_14 -lw $t0, -60($fp) -sw $t0, -52($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_15 --> -64($fp) -# PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) -# local_a2i_aux_at_A2I_internal_15 = PARAM param_a2i_aux_at_A2I_s_0 -lw $t0, 0($fp) -sw $t0, -64($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_a2i_aux_at_A2I_i_5 -# LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) -lw $t0, -24($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -72($fp) -# ARG local_a2i_aux_at_A2I_internal_17 -# LOCAL local_a2i_aux_at_A2I_internal_17 --> -72($fp) -lw $t0, -72($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_15 --> -64($fp) -# LOCAL local_a2i_aux_at_A2I_internal_16 --> -68($fp) -# local_a2i_aux_at_A2I_internal_16 = VCALL local_a2i_aux_at_A2I_internal_15 substr -# Save new self pointer in $s1 -lw $s1, -64($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 60($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -68($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_a2i_aux_at_A2I_internal_16 -# LOCAL local_a2i_aux_at_A2I_internal_16 --> -68($fp) -lw $t0, -68($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) -# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) -# local_a2i_aux_at_A2I_internal_13 = VCALL local_a2i_aux_at_A2I_internal_12 c2i -# Save new self pointer in $s1 -lw $s1, -52($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 52($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -56($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) -# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) -# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) -# local_a2i_aux_at_A2I_internal_9 = local_a2i_aux_at_A2I_internal_10 + local_a2i_aux_at_A2I_internal_13 -lw $t1, -44($fp) -lw $t0, 12($t1) -lw $t1, -56($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -40($fp) -# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) -# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) -# local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_9 -lw $t0, -40($fp) -sw $t0, -4($fp) -# LOCAL local_a2i_aux_at_A2I_internal_19 --> -80($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -80($fp) -# LOCAL local_a2i_aux_at_A2I_internal_18 --> -76($fp) -# LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) -# LOCAL local_a2i_aux_at_A2I_internal_19 --> -80($fp) -# local_a2i_aux_at_A2I_internal_18 = local_a2i_aux_at_A2I_i_5 + local_a2i_aux_at_A2I_internal_19 -lw $t1, -24($fp) -lw $t0, 12($t1) -lw $t1, -80($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -76($fp) -# LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) -# LOCAL local_a2i_aux_at_A2I_internal_18 --> -76($fp) -# local_a2i_aux_at_A2I_i_5 = local_a2i_aux_at_A2I_internal_18 -lw $t0, -76($fp) -sw $t0, -24($fp) -# GOTO label_WHILE_231 -j label_WHILE_231 -label_WHILE_END_232: - # RETURN local_a2i_aux_at_A2I_int_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_a2i_aux_at_A2I. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 88 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_i2a_at_A2I implementation. -# @Params: -# 0($fp) = param_i2a_at_A2I_i_0 -function_i2a_at_A2I: - # Allocate stack frame for function function_i2a_at_A2I. - subu $sp, $sp, 96 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 96 - # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -20($fp) - # IF_ZERO param_i2a_at_A2I_i_0 GOTO label_FALSE_237 - # IF_ZERO param_i2a_at_A2I_i_0 GOTO label_FALSE_237 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_237 - # IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_237 - # IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_237 - lw $t0, -20($fp) - beq $t0, 0, label_FALSE_237 - # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_STRING_240 - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_STRING_240 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_240 - # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_241 - # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_241 - # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -20($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_238 - # GOTO label_FALSE_237 - j label_FALSE_237 - label_COMPARE_BY_VALUE_241: - # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) - lw $a0, 0($fp) - lw $a1, -20($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_238 - # GOTO label_FALSE_237 - j label_FALSE_237 - label_COMPARE_STRING_240: - # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_CONTINUE_242 - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_CONTINUE_242 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_242 - # GOTO label_FALSE_237 - j label_FALSE_237 - label_CONTINUE_242: - # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_243: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_244 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_243 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_244: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_238 - label_FALSE_237: - # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_239 -j label_END_239 -label_TRUE_238: - # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_239: -# LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) -# LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSEIF_235 -# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSEIF_235 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_235 -# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_27 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -24($fp) -# LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) -# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) -# local_i2a_at_A2I_internal_1 = local_i2a_at_A2I_internal_5 -lw $t0, -24($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_236 -j label_ENDIF_236 -label_FALSEIF_235: - # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -40($fp) - # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) - # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - lw $a0, -40($fp) - lw $a1, 0($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -36($fp) - # IF_GREATER_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 - # IF_GREATER_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 - lw $t0, -36($fp) - bgt $t0, 0, label_FALSE_247 - # IF_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 - # IF_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 - lw $t0, -36($fp) - beq $t0, 0, label_FALSE_247 - # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -36($fp) - # GOTO label_END_248 -j label_END_248 -label_FALSE_247: - # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -36($fp) - label_END_248: -# LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) -# LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) -# Obtain value from -36($fp) -lw $v0, -36($fp) -lw $v0, 12($v0) -sw $v0, -28($fp) -# IF_ZERO local_i2a_at_A2I_internal_6 GOTO label_FALSEIF_245 -# IF_ZERO local_i2a_at_A2I_internal_6 GOTO label_FALSEIF_245 -lw $t0, -28($fp) -beq $t0, 0, label_FALSEIF_245 -# LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) -# local_i2a_at_A2I_internal_12 = SELF -sw $s1, -52($fp) -# LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) -# LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) -# local_i2a_at_A2I_internal_10 = local_i2a_at_A2I_internal_12 -lw $t0, -52($fp) -sw $t0, -44($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_i2a_at_A2I_i_0 -# PARAM param_i2a_at_A2I_i_0 --> 0($fp) -lw $t0, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) -# LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) -# local_i2a_at_A2I_internal_11 = VCALL local_i2a_at_A2I_internal_10 i2a_aux -# Save new self pointer in $s1 -lw $s1, -44($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 4($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -48($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) -# LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) -# local_i2a_at_A2I_internal_7 = local_i2a_at_A2I_internal_11 -lw $t0, -48($fp) -sw $t0, -32($fp) -# GOTO label_ENDIF_246 -j label_ENDIF_246 -label_FALSEIF_245: - # LOCAL local_i2a_at_A2I_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_28 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -64($fp) - # LOCAL local_i2a_at_A2I_internal_13 --> -56($fp) - # LOCAL local_i2a_at_A2I_internal_15 --> -64($fp) - # local_i2a_at_A2I_internal_13 = local_i2a_at_A2I_internal_15 - lw $t0, -64($fp) - sw $t0, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2a_at_A2I_internal_18 --> -76($fp) - # local_i2a_at_A2I_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_i2a_at_A2I_internal_16 --> -68($fp) - # LOCAL local_i2a_at_A2I_internal_18 --> -76($fp) - # local_i2a_at_A2I_internal_16 = local_i2a_at_A2I_internal_18 - lw $t0, -76($fp) - sw $t0, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2a_at_A2I_internal_21 --> -88($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -88($fp) - # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) - # LOCAL local_i2a_at_A2I_internal_21 --> -88($fp) - lw $t0, -88($fp) - lw $t0, 12($t0) - not $t0, $t0 - add $t0, $t0, 1 - sw $t0, -84($fp) - # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) - # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -84($fp) - sw $t0, 12($v0) - sw $v0, -84($fp) - # LOCAL local_i2a_at_A2I_internal_19 --> -80($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) - # local_i2a_at_A2I_internal_19 = PARAM param_i2a_at_A2I_i_0 * local_i2a_at_A2I_internal_20 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -84($fp) - lw $t2, 12($t1) - mul $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -80($fp) - # ARG local_i2a_at_A2I_internal_19 - # LOCAL local_i2a_at_A2I_internal_19 --> -80($fp) - lw $t0, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_i2a_at_A2I_internal_16 --> -68($fp) - # LOCAL local_i2a_at_A2I_internal_17 --> -72($fp) - # local_i2a_at_A2I_internal_17 = VCALL local_i2a_at_A2I_internal_16 i2a_aux - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_i2a_at_A2I_internal_17 - # LOCAL local_i2a_at_A2I_internal_17 --> -72($fp) - lw $t0, -72($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_i2a_at_A2I_internal_13 --> -56($fp) - # LOCAL local_i2a_at_A2I_internal_14 --> -60($fp) - # local_i2a_at_A2I_internal_14 = VCALL local_i2a_at_A2I_internal_13 concat - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 32($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) - # LOCAL local_i2a_at_A2I_internal_14 --> -60($fp) - # local_i2a_at_A2I_internal_7 = local_i2a_at_A2I_internal_14 - lw $t0, -60($fp) - sw $t0, -32($fp) - label_ENDIF_246: -# LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) -# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) -# local_i2a_at_A2I_internal_1 = local_i2a_at_A2I_internal_7 -lw $t0, -32($fp) -sw $t0, -8($fp) -label_ENDIF_236: -# RETURN local_i2a_at_A2I_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_i2a_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 96 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_i2a_aux_at_A2I implementation. -# @Params: -# 0($fp) = param_i2a_aux_at_A2I_i_0 -function_i2a_aux_at_A2I: - # Allocate stack frame for function function_i2a_aux_at_A2I. - subu $sp, $sp, 88 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 88 - # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -20($fp) - # IF_ZERO param_i2a_aux_at_A2I_i_0 GOTO label_FALSE_251 - # IF_ZERO param_i2a_aux_at_A2I_i_0 GOTO label_FALSE_251 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_251 - # IF_ZERO local_i2a_aux_at_A2I_internal_4 GOTO label_FALSE_251 - # IF_ZERO local_i2a_aux_at_A2I_internal_4 GOTO label_FALSE_251 - lw $t0, -20($fp) - beq $t0, 0, label_FALSE_251 - # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_STRING_254 - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_STRING_254 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_254 - # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_255 - # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_255 - # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -20($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_252 - # GOTO label_FALSE_251 - j label_FALSE_251 - label_COMPARE_BY_VALUE_255: - # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) - lw $a0, 0($fp) - lw $a1, -20($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_252 - # GOTO label_FALSE_251 - j label_FALSE_251 - label_COMPARE_STRING_254: - # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_CONTINUE_256 - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_CONTINUE_256 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_256 - # GOTO label_FALSE_251 - j label_FALSE_251 - label_CONTINUE_256: - # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_257: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_258 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_257 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_258: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_252 - label_FALSE_251: - # LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_253 -j label_END_253 -label_TRUE_252: - # LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_253: -# LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) -# LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSEIF_249 -# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSEIF_249 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_249 -# LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_29 -sw $t0, 12($v0) -li $t0, 0 -sw $t0, 16($v0) -sw $v0, -24($fp) -# LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) -# LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) -# local_i2a_aux_at_A2I_internal_1 = local_i2a_aux_at_A2I_internal_5 -lw $t0, -24($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_250 -j label_ENDIF_250 -label_FALSEIF_249: - # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -28($fp) - # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 10 - sw $t0, 12($v0) - sw $v0, -36($fp) - # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) - # local_i2a_aux_at_A2I_internal_7 = PARAM param_i2a_aux_at_A2I_i_0 / local_i2a_aux_at_A2I_internal_8 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -36($fp) - lw $t2, 12($t1) - div $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -32($fp) - # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) - # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) - # local_i2a_aux_at_A2I_next_6 = local_i2a_aux_at_A2I_internal_7 - lw $t0, -32($fp) - sw $t0, -28($fp) - # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) - # local_i2a_aux_at_A2I_internal_13 = SELF - sw $s1, -56($fp) - # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) - # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) - # local_i2a_aux_at_A2I_internal_11 = local_i2a_aux_at_A2I_internal_13 - lw $t0, -56($fp) - sw $t0, -48($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_i2a_aux_at_A2I_next_6 - # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) - lw $t0, -28($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) - # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) - # local_i2a_aux_at_A2I_internal_12 = VCALL local_i2a_aux_at_A2I_internal_11 i2a_aux - # Save new self pointer in $s1 - lw $s1, -48($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -52($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) - # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) - # local_i2a_aux_at_A2I_internal_9 = local_i2a_aux_at_A2I_internal_12 - lw $t0, -52($fp) - sw $t0, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_16 --> -68($fp) - # local_i2a_aux_at_A2I_internal_16 = SELF - sw $s1, -68($fp) - # LOCAL local_i2a_aux_at_A2I_internal_14 --> -60($fp) - # LOCAL local_i2a_aux_at_A2I_internal_16 --> -68($fp) - # local_i2a_aux_at_A2I_internal_14 = local_i2a_aux_at_A2I_internal_16 - lw $t0, -68($fp) - sw $t0, -60($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 10 - sw $t0, 12($v0) - sw $v0, -80($fp) - # LOCAL local_i2a_aux_at_A2I_internal_18 --> -76($fp) - # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) - # LOCAL local_i2a_aux_at_A2I_internal_19 --> -80($fp) - # local_i2a_aux_at_A2I_internal_18 = local_i2a_aux_at_A2I_next_6 * local_i2a_aux_at_A2I_internal_19 - lw $t1, -28($fp) - lw $t0, 12($t1) - lw $t1, -80($fp) - lw $t2, 12($t1) - mul $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -76($fp) - # LOCAL local_i2a_aux_at_A2I_internal_17 --> -72($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_aux_at_A2I_internal_18 --> -76($fp) - # local_i2a_aux_at_A2I_internal_17 = PARAM param_i2a_aux_at_A2I_i_0 - local_i2a_aux_at_A2I_internal_18 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -76($fp) - lw $t2, 12($t1) - sub $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -72($fp) - # ARG local_i2a_aux_at_A2I_internal_17 - # LOCAL local_i2a_aux_at_A2I_internal_17 --> -72($fp) - lw $t0, -72($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_14 --> -60($fp) - # LOCAL local_i2a_aux_at_A2I_internal_15 --> -64($fp) - # local_i2a_aux_at_A2I_internal_15 = VCALL local_i2a_aux_at_A2I_internal_14 i2c - # Save new self pointer in $s1 - lw $s1, -60($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 84($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -64($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_i2a_aux_at_A2I_internal_15 - # LOCAL local_i2a_aux_at_A2I_internal_15 --> -64($fp) - lw $t0, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) - # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) - # local_i2a_aux_at_A2I_internal_10 = VCALL local_i2a_aux_at_A2I_internal_9 concat - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 32($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) - # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) - # local_i2a_aux_at_A2I_internal_1 = local_i2a_aux_at_A2I_internal_10 - lw $t0, -44($fp) - sw $t0, -8($fp) - label_ENDIF_250: -# RETURN local_i2a_aux_at_A2I_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_i2a_aux_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 88 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# __A__attrib__var__init implementation. -# @Params: -__A__attrib__var__init: - # Allocate stack frame for function __A__attrib__var__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ib__var__init_internal_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_ib__var__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __A__attrib__var__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_value_at_A implementation. -# @Params: -function_value_at_A: - # Allocate stack frame for function function_value_at_A. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_value_at_A_internal_0 = GETATTRIBUTE var A - # LOCAL local_value_at_A_internal_0 --> -4($fp) - lw $t0, 12($s1) - sw $t0, -4($fp) - # RETURN local_value_at_A_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_value_at_A. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_set_var_at_A implementation. -# @Params: -# 0($fp) = param_set_var_at_A_num_0 -function_set_var_at_A: - # Allocate stack frame for function function_set_var_at_A. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_set_var_at_A_num_0 --> 0($fp) - lw $t0, 0($fp) - sw $t0, 12($s1) - # LOCAL local_set_var_at_A_internal_0 --> -4($fp) - # local_set_var_at_A_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_set_var_at_A_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_set_var_at_A. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_method1_at_A implementation. -# @Params: -# 0($fp) = param_method1_at_A_num_0 -function_method1_at_A: - # Allocate stack frame for function function_method1_at_A. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_method1_at_A_internal_0 --> -4($fp) - # local_method1_at_A_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_method1_at_A_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_method1_at_A. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_method2_at_A implementation. -# @Params: -# 0($fp) = param_method2_at_A_num1_0 -# 4($fp) = param_method2_at_A_num2_1 -function_method2_at_A: - # Allocate stack frame for function function_method2_at_A. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_method2_at_A_x_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_method2_at_A_internal_1 --> -8($fp) - # PARAM param_method2_at_A_num1_0 --> 4($fp) - # PARAM param_method2_at_A_num2_1 --> 0($fp) - # local_method2_at_A_internal_1 = PARAM param_method2_at_A_num1_0 + PARAM param_method2_at_A_num2_1 - lw $t1, 4($fp) - lw $t0, 12($t1) - lw $t1, 0($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -8($fp) - # LOCAL local_method2_at_A_x_0 --> -4($fp) - # LOCAL local_method2_at_A_internal_1 --> -8($fp) - # local_method2_at_A_x_0 = local_method2_at_A_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # LOCAL local_method2_at_A_internal_4 --> -20($fp) - # local_method2_at_A_internal_4 = ALLOCATE B - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, B - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, B_start - sw $t0, 4($v0) - # Load type offset - li $t0, 28 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __A__attrib__var__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -20($fp) - # LOCAL local_method2_at_A_internal_2 --> -12($fp) - # LOCAL local_method2_at_A_internal_4 --> -20($fp) - # local_method2_at_A_internal_2 = local_method2_at_A_internal_4 - lw $t0, -20($fp) - sw $t0, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_method2_at_A_x_0 - # LOCAL local_method2_at_A_x_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_method2_at_A_internal_2 --> -12($fp) - # LOCAL local_method2_at_A_internal_3 --> -16($fp) - # local_method2_at_A_internal_3 = VCALL local_method2_at_A_internal_2 set_var - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 116($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_method2_at_A_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_method2_at_A. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_method3_at_A implementation. -# @Params: -# 0($fp) = param_method3_at_A_num_0 -function_method3_at_A: - # Allocate stack frame for function function_method3_at_A. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_method3_at_A_x_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_method3_at_A_internal_1 --> -8($fp) - # PARAM param_method3_at_A_num_0 --> 0($fp) - lw $t0, 0($fp) - lw $t0, 12($t0) - not $t0, $t0 - add $t0, $t0, 1 - sw $t0, -8($fp) - # LOCAL local_method3_at_A_internal_1 --> -8($fp) - # LOCAL local_method3_at_A_internal_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -8($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # LOCAL local_method3_at_A_x_0 --> -4($fp) - # LOCAL local_method3_at_A_internal_1 --> -8($fp) - # local_method3_at_A_x_0 = local_method3_at_A_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # LOCAL local_method3_at_A_internal_4 --> -20($fp) - # local_method3_at_A_internal_4 = ALLOCATE C - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, C - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, C_start - sw $t0, 4($v0) - # Load type offset - li $t0, 40 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __A__attrib__var__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -20($fp) - # LOCAL local_method3_at_A_internal_2 --> -12($fp) - # LOCAL local_method3_at_A_internal_4 --> -20($fp) - # local_method3_at_A_internal_2 = local_method3_at_A_internal_4 - lw $t0, -20($fp) - sw $t0, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_method3_at_A_x_0 - # LOCAL local_method3_at_A_x_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_method3_at_A_internal_2 --> -12($fp) - # LOCAL local_method3_at_A_internal_3 --> -16($fp) - # local_method3_at_A_internal_3 = VCALL local_method3_at_A_internal_2 set_var - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 116($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_method3_at_A_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_method3_at_A. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_method4_at_A implementation. -# @Params: -# 0($fp) = param_method4_at_A_num1_0 -# 4($fp) = param_method4_at_A_num2_1 -function_method4_at_A: - # Allocate stack frame for function function_method4_at_A. - subu $sp, $sp, 60 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 60 - # LOCAL local_method4_at_A_internal_2 --> -12($fp) - # PARAM param_method4_at_A_num2_1 --> 0($fp) - # PARAM param_method4_at_A_num1_0 --> 4($fp) - lw $a0, 0($fp) - lw $a1, 4($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -12($fp) - # IF_GREATER_ZERO local_method4_at_A_internal_2 GOTO label_FALSE_261 - # IF_GREATER_ZERO local_method4_at_A_internal_2 GOTO label_FALSE_261 - lw $t0, -12($fp) - bgt $t0, 0, label_FALSE_261 - # IF_ZERO local_method4_at_A_internal_2 GOTO label_FALSE_261 - # IF_ZERO local_method4_at_A_internal_2 GOTO label_FALSE_261 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_261 - # LOCAL local_method4_at_A_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_262 -j label_END_262 -label_FALSE_261: - # LOCAL local_method4_at_A_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_262: -# LOCAL local_method4_at_A_internal_0 --> -4($fp) -# LOCAL local_method4_at_A_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_method4_at_A_internal_0 GOTO label_FALSEIF_259 -# IF_ZERO local_method4_at_A_internal_0 GOTO label_FALSEIF_259 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_259 -# LOCAL local_method4_at_A_x_3 --> -16($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -16($fp) -# LOCAL local_method4_at_A_internal_4 --> -20($fp) -# PARAM param_method4_at_A_num1_0 --> 4($fp) -# PARAM param_method4_at_A_num2_1 --> 0($fp) -# local_method4_at_A_internal_4 = PARAM param_method4_at_A_num1_0 - PARAM param_method4_at_A_num2_1 -lw $t1, 4($fp) -lw $t0, 12($t1) -lw $t1, 0($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -20($fp) -# LOCAL local_method4_at_A_x_3 --> -16($fp) -# LOCAL local_method4_at_A_internal_4 --> -20($fp) -# local_method4_at_A_x_3 = local_method4_at_A_internal_4 -lw $t0, -20($fp) -sw $t0, -16($fp) -# LOCAL local_method4_at_A_internal_7 --> -32($fp) -# local_method4_at_A_internal_7 = ALLOCATE D -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type name -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, D -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, D_start -sw $t0, 4($v0) -# Load type offset -li $t0, 32 -sw $t0, 8($v0) -move $t1, $v0 -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -move $s1, $v0 -# Push register t1 into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -jal __A__attrib__var__init -# Pop 4 bytes from stack into register t1 -lw $t1, 0($sp) -addu $sp, $sp, 4 -sw $v0, 12($t1) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -sw $t1, -32($fp) -# LOCAL local_method4_at_A_internal_5 --> -24($fp) -# LOCAL local_method4_at_A_internal_7 --> -32($fp) -# local_method4_at_A_internal_5 = local_method4_at_A_internal_7 -lw $t0, -32($fp) -sw $t0, -24($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_method4_at_A_x_3 -# LOCAL local_method4_at_A_x_3 --> -16($fp) -lw $t0, -16($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_method4_at_A_internal_5 --> -24($fp) -# LOCAL local_method4_at_A_internal_6 --> -28($fp) -# local_method4_at_A_internal_6 = VCALL local_method4_at_A_internal_5 set_var -# Save new self pointer in $s1 -lw $s1, -24($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 116($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -28($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_method4_at_A_internal_1 --> -8($fp) -# LOCAL local_method4_at_A_internal_6 --> -28($fp) -# local_method4_at_A_internal_1 = local_method4_at_A_internal_6 -lw $t0, -28($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_260 -j label_ENDIF_260 -label_FALSEIF_259: - # LOCAL local_method4_at_A_x_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -36($fp) - # LOCAL local_method4_at_A_internal_9 --> -40($fp) - # PARAM param_method4_at_A_num2_1 --> 0($fp) - # PARAM param_method4_at_A_num1_0 --> 4($fp) - # local_method4_at_A_internal_9 = PARAM param_method4_at_A_num2_1 - PARAM param_method4_at_A_num1_0 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, 4($fp) - lw $t2, 12($t1) - sub $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -40($fp) - # LOCAL local_method4_at_A_x_8 --> -36($fp) - # LOCAL local_method4_at_A_internal_9 --> -40($fp) - # local_method4_at_A_x_8 = local_method4_at_A_internal_9 - lw $t0, -40($fp) - sw $t0, -36($fp) - # LOCAL local_method4_at_A_internal_12 --> -52($fp) - # local_method4_at_A_internal_12 = ALLOCATE D - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, D - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, D_start - sw $t0, 4($v0) - # Load type offset - li $t0, 32 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __A__attrib__var__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -52($fp) - # LOCAL local_method4_at_A_internal_10 --> -44($fp) - # LOCAL local_method4_at_A_internal_12 --> -52($fp) - # local_method4_at_A_internal_10 = local_method4_at_A_internal_12 - lw $t0, -52($fp) - sw $t0, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_method4_at_A_x_8 - # LOCAL local_method4_at_A_x_8 --> -36($fp) - lw $t0, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_method4_at_A_internal_10 --> -44($fp) - # LOCAL local_method4_at_A_internal_11 --> -48($fp) - # local_method4_at_A_internal_11 = VCALL local_method4_at_A_internal_10 set_var - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 116($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_method4_at_A_internal_1 --> -8($fp) - # LOCAL local_method4_at_A_internal_11 --> -48($fp) - # local_method4_at_A_internal_1 = local_method4_at_A_internal_11 - lw $t0, -48($fp) - sw $t0, -8($fp) - label_ENDIF_260: -# RETURN local_method4_at_A_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_method4_at_A. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 60 -# Deallocate function args -addu $sp, $sp, 8 -jr $ra -# Function END - - -# function_method5_at_A implementation. -# @Params: -# 0($fp) = param_method5_at_A_num_0 -function_method5_at_A: - # Allocate stack frame for function function_method5_at_A. - subu $sp, $sp, 56 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 56 - # LOCAL local_method5_at_A_x_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_method5_at_A_internal_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -8($fp) - # LOCAL local_method5_at_A_x_0 --> -4($fp) - # LOCAL local_method5_at_A_internal_1 --> -8($fp) - # local_method5_at_A_x_0 = local_method5_at_A_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # LOCAL local_method5_at_A_y_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # LOCAL local_method5_at_A_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -16($fp) - # LOCAL local_method5_at_A_y_2 --> -12($fp) - # LOCAL local_method5_at_A_internal_3 --> -16($fp) - # local_method5_at_A_y_2 = local_method5_at_A_internal_3 - lw $t0, -16($fp) - sw $t0, -12($fp) - label_WHILE_263: - # LOCAL local_method5_at_A_internal_5 --> -24($fp) - # LOCAL local_method5_at_A_y_2 --> -12($fp) - # PARAM param_method5_at_A_num_0 --> 0($fp) - lw $a0, -12($fp) - lw $a1, 0($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -24($fp) - # IF_GREATER_ZERO local_method5_at_A_internal_5 GOTO label_FALSE_265 - # IF_GREATER_ZERO local_method5_at_A_internal_5 GOTO label_FALSE_265 - lw $t0, -24($fp) - bgt $t0, 0, label_FALSE_265 - # LOCAL local_method5_at_A_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -24($fp) - # GOTO label_END_266 -j label_END_266 -label_FALSE_265: - # LOCAL local_method5_at_A_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -24($fp) - label_END_266: -# LOCAL local_method5_at_A_internal_4 --> -20($fp) -# LOCAL local_method5_at_A_internal_5 --> -24($fp) -# Obtain value from -24($fp) -lw $v0, -24($fp) -lw $v0, 12($v0) -sw $v0, -20($fp) -# IF_ZERO local_method5_at_A_internal_4 GOTO label_WHILE_END_264 -# IF_ZERO local_method5_at_A_internal_4 GOTO label_WHILE_END_264 -lw $t0, -20($fp) -beq $t0, 0, label_WHILE_END_264 -# LOCAL local_method5_at_A_internal_6 --> -28($fp) -# LOCAL local_method5_at_A_x_0 --> -4($fp) -# LOCAL local_method5_at_A_y_2 --> -12($fp) -# local_method5_at_A_internal_6 = local_method5_at_A_x_0 * local_method5_at_A_y_2 -lw $t1, -4($fp) -lw $t0, 12($t1) -lw $t1, -12($fp) -lw $t2, 12($t1) -mul $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -28($fp) -# LOCAL local_method5_at_A_x_0 --> -4($fp) -# LOCAL local_method5_at_A_internal_6 --> -28($fp) -# local_method5_at_A_x_0 = local_method5_at_A_internal_6 -lw $t0, -28($fp) -sw $t0, -4($fp) -# LOCAL local_method5_at_A_internal_8 --> -36($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -36($fp) -# LOCAL local_method5_at_A_internal_7 --> -32($fp) -# LOCAL local_method5_at_A_y_2 --> -12($fp) -# LOCAL local_method5_at_A_internal_8 --> -36($fp) -# local_method5_at_A_internal_7 = local_method5_at_A_y_2 + local_method5_at_A_internal_8 -lw $t1, -12($fp) -lw $t0, 12($t1) -lw $t1, -36($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -32($fp) -# LOCAL local_method5_at_A_y_2 --> -12($fp) -# LOCAL local_method5_at_A_internal_7 --> -32($fp) -# local_method5_at_A_y_2 = local_method5_at_A_internal_7 -lw $t0, -32($fp) -sw $t0, -12($fp) -# GOTO label_WHILE_263 -j label_WHILE_263 -label_WHILE_END_264: - # LOCAL local_method5_at_A_internal_11 --> -48($fp) - # local_method5_at_A_internal_11 = ALLOCATE E - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, E - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, E_start - sw $t0, 4($v0) - # Load type offset - li $t0, 36 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __A__attrib__var__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -48($fp) - # LOCAL local_method5_at_A_internal_9 --> -40($fp) - # LOCAL local_method5_at_A_internal_11 --> -48($fp) - # local_method5_at_A_internal_9 = local_method5_at_A_internal_11 - lw $t0, -48($fp) - sw $t0, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_method5_at_A_x_0 - # LOCAL local_method5_at_A_x_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_method5_at_A_internal_9 --> -40($fp) - # LOCAL local_method5_at_A_internal_10 --> -44($fp) - # local_method5_at_A_internal_10 = VCALL local_method5_at_A_internal_9 set_var - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 116($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_method5_at_A_internal_10 - lw $v0, -44($fp) - # Deallocate stack frame for function function_method5_at_A. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 56 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_method5_at_B implementation. -# @Params: -# 0($fp) = param_method5_at_B_num_0 -function_method5_at_B: - # Allocate stack frame for function function_method5_at_B. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_method5_at_B_x_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_method5_at_B_internal_1 --> -8($fp) - # PARAM param_method5_at_B_num_0 --> 0($fp) - # PARAM param_method5_at_B_num_0 --> 0($fp) - # local_method5_at_B_internal_1 = PARAM param_method5_at_B_num_0 * PARAM param_method5_at_B_num_0 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, 0($fp) - lw $t2, 12($t1) - mul $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -8($fp) - # LOCAL local_method5_at_B_x_0 --> -4($fp) - # LOCAL local_method5_at_B_internal_1 --> -8($fp) - # local_method5_at_B_x_0 = local_method5_at_B_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # LOCAL local_method5_at_B_internal_4 --> -20($fp) - # local_method5_at_B_internal_4 = ALLOCATE E - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, E - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, E_start - sw $t0, 4($v0) - # Load type offset - li $t0, 36 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __A__attrib__var__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -20($fp) - # LOCAL local_method5_at_B_internal_2 --> -12($fp) - # LOCAL local_method5_at_B_internal_4 --> -20($fp) - # local_method5_at_B_internal_2 = local_method5_at_B_internal_4 - lw $t0, -20($fp) - sw $t0, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_method5_at_B_x_0 - # LOCAL local_method5_at_B_x_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_method5_at_B_internal_2 --> -12($fp) - # LOCAL local_method5_at_B_internal_3 --> -16($fp) - # local_method5_at_B_internal_3 = VCALL local_method5_at_B_internal_2 set_var - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 116($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_method5_at_B_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_method5_at_B. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_method7_at_D implementation. -# @Params: -# 0($fp) = param_method7_at_D_num_0 -function_method7_at_D: - # Allocate stack frame for function function_method7_at_D. - subu $sp, $sp, 136 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 136 - # LOCAL local_method7_at_D_x_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_method7_at_D_x_0 --> -4($fp) - # PARAM param_method7_at_D_num_0 --> 0($fp) - # local_method7_at_D_x_0 = PARAM param_method7_at_D_num_0 - lw $t0, 0($fp) - sw $t0, -4($fp) - # LOCAL local_method7_at_D_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -20($fp) - # LOCAL local_method7_at_D_internal_3 --> -16($fp) - # LOCAL local_method7_at_D_x_0 --> -4($fp) - # LOCAL local_method7_at_D_internal_4 --> -20($fp) - lw $a0, -4($fp) - lw $a1, -20($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_GREATER_ZERO local_method7_at_D_internal_3 GOTO label_FALSE_269 - # IF_GREATER_ZERO local_method7_at_D_internal_3 GOTO label_FALSE_269 - lw $t0, -16($fp) - bgt $t0, 0, label_FALSE_269 - # IF_ZERO local_method7_at_D_internal_3 GOTO label_FALSE_269 - # IF_ZERO local_method7_at_D_internal_3 GOTO label_FALSE_269 - lw $t0, -16($fp) - beq $t0, 0, label_FALSE_269 - # LOCAL local_method7_at_D_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -16($fp) - # GOTO label_END_270 -j label_END_270 -label_FALSE_269: - # LOCAL local_method7_at_D_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -16($fp) - label_END_270: -# LOCAL local_method7_at_D_internal_1 --> -8($fp) -# LOCAL local_method7_at_D_internal_3 --> -16($fp) -# Obtain value from -16($fp) -lw $v0, -16($fp) -lw $v0, 12($v0) -sw $v0, -8($fp) -# IF_ZERO local_method7_at_D_internal_1 GOTO label_FALSEIF_267 -# IF_ZERO local_method7_at_D_internal_1 GOTO label_FALSEIF_267 -lw $t0, -8($fp) -beq $t0, 0, label_FALSEIF_267 -# LOCAL local_method7_at_D_internal_7 --> -32($fp) -# local_method7_at_D_internal_7 = SELF -sw $s1, -32($fp) -# LOCAL local_method7_at_D_internal_5 --> -24($fp) -# LOCAL local_method7_at_D_internal_7 --> -32($fp) -# local_method7_at_D_internal_5 = local_method7_at_D_internal_7 -lw $t0, -32($fp) -sw $t0, -24($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_method7_at_D_internal_8 --> -36($fp) -# LOCAL local_method7_at_D_x_0 --> -4($fp) -lw $t0, -4($fp) -lw $t0, 12($t0) -not $t0, $t0 -add $t0, $t0, 1 -sw $t0, -36($fp) -# LOCAL local_method7_at_D_internal_8 --> -36($fp) -# LOCAL local_method7_at_D_internal_8 --> -36($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -lw $t0, -36($fp) -sw $t0, 12($v0) -sw $v0, -36($fp) -# ARG local_method7_at_D_internal_8 -# LOCAL local_method7_at_D_internal_8 --> -36($fp) -lw $t0, -36($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_method7_at_D_internal_5 --> -24($fp) -# LOCAL local_method7_at_D_internal_6 --> -28($fp) -# local_method7_at_D_internal_6 = VCALL local_method7_at_D_internal_5 method7 -# Save new self pointer in $s1 -lw $s1, -24($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 28($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -28($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_method7_at_D_internal_2 --> -12($fp) -# LOCAL local_method7_at_D_internal_6 --> -28($fp) -# local_method7_at_D_internal_2 = local_method7_at_D_internal_6 -lw $t0, -28($fp) -sw $t0, -12($fp) -# GOTO label_ENDIF_268 -j label_ENDIF_268 -label_FALSEIF_267: - # LOCAL local_method7_at_D_internal_13 --> -56($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -56($fp) - # IF_ZERO local_method7_at_D_internal_13 GOTO label_FALSE_273 - # IF_ZERO local_method7_at_D_internal_13 GOTO label_FALSE_273 - lw $t0, -56($fp) - beq $t0, 0, label_FALSE_273 - # IF_ZERO local_method7_at_D_x_0 GOTO label_FALSE_273 - # IF_ZERO local_method7_at_D_x_0 GOTO label_FALSE_273 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_273 - # LOCAL local_method7_at_D_internal_12 --> -52($fp) - # LOCAL local_method7_at_D_internal_13 --> -56($fp) - # Comparing -56($fp) type with String - la $v0, String - lw $a0, -56($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -52($fp) - # IF_ZERO local_method7_at_D_internal_12 GOTO label_COMPARE_STRING_276 - # IF_ZERO local_method7_at_D_internal_12 GOTO label_COMPARE_STRING_276 - lw $t0, -52($fp) - beq $t0, 0, label_COMPARE_STRING_276 - # LOCAL local_method7_at_D_internal_12 --> -52($fp) - # LOCAL local_method7_at_D_internal_13 --> -56($fp) - # Comparing -56($fp) type with Bool - la $v0, Bool - lw $a0, -56($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -52($fp) - # IF_ZERO local_method7_at_D_internal_12 GOTO label_COMPARE_BY_VALUE_277 - # IF_ZERO local_method7_at_D_internal_12 GOTO label_COMPARE_BY_VALUE_277 - lw $t0, -52($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_277 - # LOCAL local_method7_at_D_internal_12 --> -52($fp) - # LOCAL local_method7_at_D_internal_13 --> -56($fp) - # Comparing -56($fp) type with Int - la $v0, Int - lw $a0, -56($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -52($fp) - # IF_ZERO local_method7_at_D_internal_12 GOTO label_COMPARE_BY_VALUE_277 - # IF_ZERO local_method7_at_D_internal_12 GOTO label_COMPARE_BY_VALUE_277 - lw $t0, -52($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_277 - # LOCAL local_method7_at_D_internal_12 --> -52($fp) - # LOCAL local_method7_at_D_internal_13 --> -56($fp) - # LOCAL local_method7_at_D_x_0 --> -4($fp) - # Load pointers and SUB - lw $a0, -56($fp) - lw $a1, -4($fp) - sub $a0, $a0, $a1 - sw $a0, -52($fp) - # IF_ZERO local_method7_at_D_internal_12 GOTO label_TRUE_274 - # IF_ZERO local_method7_at_D_internal_12 GOTO label_TRUE_274 - lw $t0, -52($fp) - beq $t0, 0, label_TRUE_274 - # GOTO label_FALSE_273 - j label_FALSE_273 - label_COMPARE_BY_VALUE_277: - # LOCAL local_method7_at_D_internal_12 --> -52($fp) - # LOCAL local_method7_at_D_internal_13 --> -56($fp) - # LOCAL local_method7_at_D_x_0 --> -4($fp) - lw $a0, -56($fp) - lw $a1, -4($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -52($fp) - # IF_ZERO local_method7_at_D_internal_12 GOTO label_TRUE_274 - # IF_ZERO local_method7_at_D_internal_12 GOTO label_TRUE_274 - lw $t0, -52($fp) - beq $t0, 0, label_TRUE_274 - # GOTO label_FALSE_273 - j label_FALSE_273 - label_COMPARE_STRING_276: - # LOCAL local_method7_at_D_internal_12 --> -52($fp) - # LOCAL local_method7_at_D_internal_13 --> -56($fp) - # LOCAL local_method7_at_D_x_0 --> -4($fp) - # Load strings for comparison - lw $v0, -56($fp) - lw $v1, -4($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -52($fp) - # IF_ZERO local_method7_at_D_internal_12 GOTO label_CONTINUE_278 - # IF_ZERO local_method7_at_D_internal_12 GOTO label_CONTINUE_278 - lw $t0, -52($fp) - beq $t0, 0, label_CONTINUE_278 - # GOTO label_FALSE_273 - j label_FALSE_273 - label_CONTINUE_278: - # LOCAL local_method7_at_D_internal_12 --> -52($fp) - # LOCAL local_method7_at_D_internal_13 --> -56($fp) - # LOCAL local_method7_at_D_x_0 --> -4($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -56($fp) - lw $v1, -4($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_279: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_280 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_279 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_280: - # Store result - sw $a2, -52($fp) - # IF_ZERO local_method7_at_D_internal_12 GOTO label_TRUE_274 - # IF_ZERO local_method7_at_D_internal_12 GOTO label_TRUE_274 - lw $t0, -52($fp) - beq $t0, 0, label_TRUE_274 - label_FALSE_273: - # LOCAL local_method7_at_D_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -48($fp) - # GOTO label_END_275 -j label_END_275 -label_TRUE_274: - # LOCAL local_method7_at_D_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -48($fp) - label_END_275: -# LOCAL local_method7_at_D_internal_9 --> -40($fp) -# LOCAL local_method7_at_D_internal_11 --> -48($fp) -# Obtain value from -48($fp) -lw $v0, -48($fp) -lw $v0, 12($v0) -sw $v0, -40($fp) -# IF_ZERO local_method7_at_D_internal_9 GOTO label_FALSEIF_271 -# IF_ZERO local_method7_at_D_internal_9 GOTO label_FALSEIF_271 -lw $t0, -40($fp) -beq $t0, 0, label_FALSEIF_271 -# LOCAL local_method7_at_D_internal_14 --> -60($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -60($fp) -# LOCAL local_method7_at_D_internal_10 --> -44($fp) -# LOCAL local_method7_at_D_internal_14 --> -60($fp) -# local_method7_at_D_internal_10 = local_method7_at_D_internal_14 -lw $t0, -60($fp) -sw $t0, -44($fp) -# GOTO label_ENDIF_272 -j label_ENDIF_272 -label_FALSEIF_271: - # LOCAL local_method7_at_D_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -80($fp) - # IF_ZERO local_method7_at_D_internal_19 GOTO label_FALSE_283 - # IF_ZERO local_method7_at_D_internal_19 GOTO label_FALSE_283 - lw $t0, -80($fp) - beq $t0, 0, label_FALSE_283 - # IF_ZERO local_method7_at_D_x_0 GOTO label_FALSE_283 - # IF_ZERO local_method7_at_D_x_0 GOTO label_FALSE_283 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_283 - # LOCAL local_method7_at_D_internal_18 --> -76($fp) - # LOCAL local_method7_at_D_internal_19 --> -80($fp) - # Comparing -80($fp) type with String - la $v0, String - lw $a0, -80($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -76($fp) - # IF_ZERO local_method7_at_D_internal_18 GOTO label_COMPARE_STRING_286 - # IF_ZERO local_method7_at_D_internal_18 GOTO label_COMPARE_STRING_286 - lw $t0, -76($fp) - beq $t0, 0, label_COMPARE_STRING_286 - # LOCAL local_method7_at_D_internal_18 --> -76($fp) - # LOCAL local_method7_at_D_internal_19 --> -80($fp) - # Comparing -80($fp) type with Bool - la $v0, Bool - lw $a0, -80($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -76($fp) - # IF_ZERO local_method7_at_D_internal_18 GOTO label_COMPARE_BY_VALUE_287 - # IF_ZERO local_method7_at_D_internal_18 GOTO label_COMPARE_BY_VALUE_287 - lw $t0, -76($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_287 - # LOCAL local_method7_at_D_internal_18 --> -76($fp) - # LOCAL local_method7_at_D_internal_19 --> -80($fp) - # Comparing -80($fp) type with Int - la $v0, Int - lw $a0, -80($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -76($fp) - # IF_ZERO local_method7_at_D_internal_18 GOTO label_COMPARE_BY_VALUE_287 - # IF_ZERO local_method7_at_D_internal_18 GOTO label_COMPARE_BY_VALUE_287 - lw $t0, -76($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_287 - # LOCAL local_method7_at_D_internal_18 --> -76($fp) - # LOCAL local_method7_at_D_internal_19 --> -80($fp) - # LOCAL local_method7_at_D_x_0 --> -4($fp) - # Load pointers and SUB - lw $a0, -80($fp) - lw $a1, -4($fp) - sub $a0, $a0, $a1 - sw $a0, -76($fp) - # IF_ZERO local_method7_at_D_internal_18 GOTO label_TRUE_284 - # IF_ZERO local_method7_at_D_internal_18 GOTO label_TRUE_284 - lw $t0, -76($fp) - beq $t0, 0, label_TRUE_284 - # GOTO label_FALSE_283 - j label_FALSE_283 - label_COMPARE_BY_VALUE_287: - # LOCAL local_method7_at_D_internal_18 --> -76($fp) - # LOCAL local_method7_at_D_internal_19 --> -80($fp) - # LOCAL local_method7_at_D_x_0 --> -4($fp) - lw $a0, -80($fp) - lw $a1, -4($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -76($fp) - # IF_ZERO local_method7_at_D_internal_18 GOTO label_TRUE_284 - # IF_ZERO local_method7_at_D_internal_18 GOTO label_TRUE_284 - lw $t0, -76($fp) - beq $t0, 0, label_TRUE_284 - # GOTO label_FALSE_283 - j label_FALSE_283 - label_COMPARE_STRING_286: - # LOCAL local_method7_at_D_internal_18 --> -76($fp) - # LOCAL local_method7_at_D_internal_19 --> -80($fp) - # LOCAL local_method7_at_D_x_0 --> -4($fp) - # Load strings for comparison - lw $v0, -80($fp) - lw $v1, -4($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -76($fp) - # IF_ZERO local_method7_at_D_internal_18 GOTO label_CONTINUE_288 - # IF_ZERO local_method7_at_D_internal_18 GOTO label_CONTINUE_288 - lw $t0, -76($fp) - beq $t0, 0, label_CONTINUE_288 - # GOTO label_FALSE_283 - j label_FALSE_283 - label_CONTINUE_288: - # LOCAL local_method7_at_D_internal_18 --> -76($fp) - # LOCAL local_method7_at_D_internal_19 --> -80($fp) - # LOCAL local_method7_at_D_x_0 --> -4($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -80($fp) - lw $v1, -4($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_289: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_290 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_289 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_290: - # Store result - sw $a2, -76($fp) - # IF_ZERO local_method7_at_D_internal_18 GOTO label_TRUE_284 - # IF_ZERO local_method7_at_D_internal_18 GOTO label_TRUE_284 - lw $t0, -76($fp) - beq $t0, 0, label_TRUE_284 - label_FALSE_283: - # LOCAL local_method7_at_D_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -72($fp) - # GOTO label_END_285 -j label_END_285 -label_TRUE_284: - # LOCAL local_method7_at_D_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -72($fp) - label_END_285: -# LOCAL local_method7_at_D_internal_15 --> -64($fp) -# LOCAL local_method7_at_D_internal_17 --> -72($fp) -# Obtain value from -72($fp) -lw $v0, -72($fp) -lw $v0, 12($v0) -sw $v0, -64($fp) -# IF_ZERO local_method7_at_D_internal_15 GOTO label_FALSEIF_281 -# IF_ZERO local_method7_at_D_internal_15 GOTO label_FALSEIF_281 -lw $t0, -64($fp) -beq $t0, 0, label_FALSEIF_281 -# LOCAL local_method7_at_D_internal_20 --> -84($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -84($fp) -# LOCAL local_method7_at_D_internal_16 --> -68($fp) -# LOCAL local_method7_at_D_internal_20 --> -84($fp) -# local_method7_at_D_internal_16 = local_method7_at_D_internal_20 -lw $t0, -84($fp) -sw $t0, -68($fp) -# GOTO label_ENDIF_282 -j label_ENDIF_282 -label_FALSEIF_281: - # LOCAL local_method7_at_D_internal_25 --> -104($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 2 - sw $t0, 12($v0) - sw $v0, -104($fp) - # IF_ZERO local_method7_at_D_internal_25 GOTO label_FALSE_293 - # IF_ZERO local_method7_at_D_internal_25 GOTO label_FALSE_293 - lw $t0, -104($fp) - beq $t0, 0, label_FALSE_293 - # IF_ZERO local_method7_at_D_x_0 GOTO label_FALSE_293 - # IF_ZERO local_method7_at_D_x_0 GOTO label_FALSE_293 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_293 - # LOCAL local_method7_at_D_internal_24 --> -100($fp) - # LOCAL local_method7_at_D_internal_25 --> -104($fp) - # Comparing -104($fp) type with String - la $v0, String - lw $a0, -104($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -100($fp) - # IF_ZERO local_method7_at_D_internal_24 GOTO label_COMPARE_STRING_296 - # IF_ZERO local_method7_at_D_internal_24 GOTO label_COMPARE_STRING_296 - lw $t0, -100($fp) - beq $t0, 0, label_COMPARE_STRING_296 - # LOCAL local_method7_at_D_internal_24 --> -100($fp) - # LOCAL local_method7_at_D_internal_25 --> -104($fp) - # Comparing -104($fp) type with Bool - la $v0, Bool - lw $a0, -104($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -100($fp) - # IF_ZERO local_method7_at_D_internal_24 GOTO label_COMPARE_BY_VALUE_297 - # IF_ZERO local_method7_at_D_internal_24 GOTO label_COMPARE_BY_VALUE_297 - lw $t0, -100($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_297 - # LOCAL local_method7_at_D_internal_24 --> -100($fp) - # LOCAL local_method7_at_D_internal_25 --> -104($fp) - # Comparing -104($fp) type with Int - la $v0, Int - lw $a0, -104($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -100($fp) - # IF_ZERO local_method7_at_D_internal_24 GOTO label_COMPARE_BY_VALUE_297 - # IF_ZERO local_method7_at_D_internal_24 GOTO label_COMPARE_BY_VALUE_297 - lw $t0, -100($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_297 - # LOCAL local_method7_at_D_internal_24 --> -100($fp) - # LOCAL local_method7_at_D_internal_25 --> -104($fp) - # LOCAL local_method7_at_D_x_0 --> -4($fp) - # Load pointers and SUB - lw $a0, -104($fp) - lw $a1, -4($fp) - sub $a0, $a0, $a1 - sw $a0, -100($fp) - # IF_ZERO local_method7_at_D_internal_24 GOTO label_TRUE_294 - # IF_ZERO local_method7_at_D_internal_24 GOTO label_TRUE_294 - lw $t0, -100($fp) - beq $t0, 0, label_TRUE_294 - # GOTO label_FALSE_293 - j label_FALSE_293 - label_COMPARE_BY_VALUE_297: - # LOCAL local_method7_at_D_internal_24 --> -100($fp) - # LOCAL local_method7_at_D_internal_25 --> -104($fp) - # LOCAL local_method7_at_D_x_0 --> -4($fp) - lw $a0, -104($fp) - lw $a1, -4($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -100($fp) - # IF_ZERO local_method7_at_D_internal_24 GOTO label_TRUE_294 - # IF_ZERO local_method7_at_D_internal_24 GOTO label_TRUE_294 - lw $t0, -100($fp) - beq $t0, 0, label_TRUE_294 - # GOTO label_FALSE_293 - j label_FALSE_293 - label_COMPARE_STRING_296: - # LOCAL local_method7_at_D_internal_24 --> -100($fp) - # LOCAL local_method7_at_D_internal_25 --> -104($fp) - # LOCAL local_method7_at_D_x_0 --> -4($fp) - # Load strings for comparison - lw $v0, -104($fp) - lw $v1, -4($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -100($fp) - # IF_ZERO local_method7_at_D_internal_24 GOTO label_CONTINUE_298 - # IF_ZERO local_method7_at_D_internal_24 GOTO label_CONTINUE_298 - lw $t0, -100($fp) - beq $t0, 0, label_CONTINUE_298 - # GOTO label_FALSE_293 - j label_FALSE_293 - label_CONTINUE_298: - # LOCAL local_method7_at_D_internal_24 --> -100($fp) - # LOCAL local_method7_at_D_internal_25 --> -104($fp) - # LOCAL local_method7_at_D_x_0 --> -4($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -104($fp) - lw $v1, -4($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_299: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_300 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_299 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_300: - # Store result - sw $a2, -100($fp) - # IF_ZERO local_method7_at_D_internal_24 GOTO label_TRUE_294 - # IF_ZERO local_method7_at_D_internal_24 GOTO label_TRUE_294 - lw $t0, -100($fp) - beq $t0, 0, label_TRUE_294 - label_FALSE_293: - # LOCAL local_method7_at_D_internal_23 --> -96($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -96($fp) - # GOTO label_END_295 -j label_END_295 -label_TRUE_294: - # LOCAL local_method7_at_D_internal_23 --> -96($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -96($fp) - label_END_295: -# LOCAL local_method7_at_D_internal_21 --> -88($fp) -# LOCAL local_method7_at_D_internal_23 --> -96($fp) -# Obtain value from -96($fp) -lw $v0, -96($fp) -lw $v0, 12($v0) -sw $v0, -88($fp) -# IF_ZERO local_method7_at_D_internal_21 GOTO label_FALSEIF_291 -# IF_ZERO local_method7_at_D_internal_21 GOTO label_FALSEIF_291 -lw $t0, -88($fp) -beq $t0, 0, label_FALSEIF_291 -# LOCAL local_method7_at_D_internal_26 --> -108($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -108($fp) -# LOCAL local_method7_at_D_internal_22 --> -92($fp) -# LOCAL local_method7_at_D_internal_26 --> -108($fp) -# local_method7_at_D_internal_22 = local_method7_at_D_internal_26 -lw $t0, -108($fp) -sw $t0, -92($fp) -# GOTO label_ENDIF_292 -j label_ENDIF_292 -label_FALSEIF_291: - # LOCAL local_method7_at_D_internal_29 --> -120($fp) - # local_method7_at_D_internal_29 = SELF - sw $s1, -120($fp) - # LOCAL local_method7_at_D_internal_27 --> -112($fp) - # LOCAL local_method7_at_D_internal_29 --> -120($fp) - # local_method7_at_D_internal_27 = local_method7_at_D_internal_29 - lw $t0, -120($fp) - sw $t0, -112($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_method7_at_D_internal_31 --> -128($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 3 - sw $t0, 12($v0) - sw $v0, -128($fp) - # LOCAL local_method7_at_D_internal_30 --> -124($fp) - # LOCAL local_method7_at_D_x_0 --> -4($fp) - # LOCAL local_method7_at_D_internal_31 --> -128($fp) - # local_method7_at_D_internal_30 = local_method7_at_D_x_0 - local_method7_at_D_internal_31 - lw $t1, -4($fp) - lw $t0, 12($t1) - lw $t1, -128($fp) - lw $t2, 12($t1) - sub $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -124($fp) - # ARG local_method7_at_D_internal_30 - # LOCAL local_method7_at_D_internal_30 --> -124($fp) - lw $t0, -124($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_method7_at_D_internal_27 --> -112($fp) - # LOCAL local_method7_at_D_internal_28 --> -116($fp) - # local_method7_at_D_internal_28 = VCALL local_method7_at_D_internal_27 method7 - # Save new self pointer in $s1 - lw $s1, -112($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 28($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -116($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_method7_at_D_internal_22 --> -92($fp) - # LOCAL local_method7_at_D_internal_28 --> -116($fp) - # local_method7_at_D_internal_22 = local_method7_at_D_internal_28 - lw $t0, -116($fp) - sw $t0, -92($fp) - label_ENDIF_292: -# LOCAL local_method7_at_D_internal_16 --> -68($fp) -# LOCAL local_method7_at_D_internal_22 --> -92($fp) -# local_method7_at_D_internal_16 = local_method7_at_D_internal_22 -lw $t0, -92($fp) -sw $t0, -68($fp) -label_ENDIF_282: -# LOCAL local_method7_at_D_internal_10 --> -44($fp) -# LOCAL local_method7_at_D_internal_16 --> -68($fp) -# local_method7_at_D_internal_10 = local_method7_at_D_internal_16 -lw $t0, -68($fp) -sw $t0, -44($fp) -label_ENDIF_272: -# LOCAL local_method7_at_D_internal_2 --> -12($fp) -# LOCAL local_method7_at_D_internal_10 --> -44($fp) -# local_method7_at_D_internal_2 = local_method7_at_D_internal_10 -lw $t0, -44($fp) -sw $t0, -12($fp) -label_ENDIF_268: -# RETURN local_method7_at_D_internal_2 -lw $v0, -12($fp) -# Deallocate stack frame for function function_method7_at_D. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 136 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_method6_at_E implementation. -# @Params: -# 0($fp) = param_method6_at_E_num_0 -function_method6_at_E: - # Allocate stack frame for function function_method6_at_E. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_method6_at_E_x_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_method6_at_E_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 8 - sw $t0, 12($v0) - sw $v0, -12($fp) - # LOCAL local_method6_at_E_internal_1 --> -8($fp) - # PARAM param_method6_at_E_num_0 --> 0($fp) - # LOCAL local_method6_at_E_internal_2 --> -12($fp) - # local_method6_at_E_internal_1 = PARAM param_method6_at_E_num_0 / local_method6_at_E_internal_2 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -12($fp) - lw $t2, 12($t1) - div $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -8($fp) - # LOCAL local_method6_at_E_x_0 --> -4($fp) - # LOCAL local_method6_at_E_internal_1 --> -8($fp) - # local_method6_at_E_x_0 = local_method6_at_E_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # LOCAL local_method6_at_E_internal_5 --> -24($fp) - # local_method6_at_E_internal_5 = ALLOCATE A - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, A - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, A_start - sw $t0, 4($v0) - # Load type offset - li $t0, 24 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __A__attrib__var__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -24($fp) - # LOCAL local_method6_at_E_internal_3 --> -16($fp) - # LOCAL local_method6_at_E_internal_5 --> -24($fp) - # local_method6_at_E_internal_3 = local_method6_at_E_internal_5 - lw $t0, -24($fp) - sw $t0, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_method6_at_E_x_0 - # LOCAL local_method6_at_E_x_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_method6_at_E_internal_3 --> -16($fp) - # LOCAL local_method6_at_E_internal_4 --> -20($fp) - # local_method6_at_E_internal_4 = VCALL local_method6_at_E_internal_3 set_var - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 116($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_method6_at_E_internal_4 - lw $v0, -20($fp) - # Deallocate stack frame for function function_method6_at_E. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_method6_at_C implementation. -# @Params: -# 0($fp) = param_method6_at_C_num_0 -function_method6_at_C: - # Allocate stack frame for function function_method6_at_C. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_method6_at_C_x_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_method6_at_C_internal_1 --> -8($fp) - # PARAM param_method6_at_C_num_0 --> 0($fp) - lw $t0, 0($fp) - lw $t0, 12($t0) - not $t0, $t0 - add $t0, $t0, 1 - sw $t0, -8($fp) - # LOCAL local_method6_at_C_internal_1 --> -8($fp) - # LOCAL local_method6_at_C_internal_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -8($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # LOCAL local_method6_at_C_x_0 --> -4($fp) - # LOCAL local_method6_at_C_internal_1 --> -8($fp) - # local_method6_at_C_x_0 = local_method6_at_C_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # LOCAL local_method6_at_C_internal_4 --> -20($fp) - # local_method6_at_C_internal_4 = ALLOCATE A - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, A - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, A_start - sw $t0, 4($v0) - # Load type offset - li $t0, 24 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __A__attrib__var__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -20($fp) - # LOCAL local_method6_at_C_internal_2 --> -12($fp) - # LOCAL local_method6_at_C_internal_4 --> -20($fp) - # local_method6_at_C_internal_2 = local_method6_at_C_internal_4 - lw $t0, -20($fp) - sw $t0, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_method6_at_C_x_0 - # LOCAL local_method6_at_C_x_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_method6_at_C_internal_2 --> -12($fp) - # LOCAL local_method6_at_C_internal_3 --> -16($fp) - # local_method6_at_C_internal_3 = VCALL local_method6_at_C_internal_2 set_var - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 116($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_method6_at_C_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_method6_at_C. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_method5_at_C implementation. -# @Params: -# 0($fp) = param_method5_at_C_num_0 -function_method5_at_C: - # Allocate stack frame for function function_method5_at_C. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_method5_at_C_x_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_method5_at_C_internal_2 --> -12($fp) - # PARAM param_method5_at_C_num_0 --> 0($fp) - # PARAM param_method5_at_C_num_0 --> 0($fp) - # local_method5_at_C_internal_2 = PARAM param_method5_at_C_num_0 * PARAM param_method5_at_C_num_0 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, 0($fp) - lw $t2, 12($t1) - mul $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -12($fp) - # LOCAL local_method5_at_C_internal_1 --> -8($fp) - # LOCAL local_method5_at_C_internal_2 --> -12($fp) - # PARAM param_method5_at_C_num_0 --> 0($fp) - # local_method5_at_C_internal_1 = local_method5_at_C_internal_2 * PARAM param_method5_at_C_num_0 - lw $t1, -12($fp) - lw $t0, 12($t1) - lw $t1, 0($fp) - lw $t2, 12($t1) - mul $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -8($fp) - # LOCAL local_method5_at_C_x_0 --> -4($fp) - # LOCAL local_method5_at_C_internal_1 --> -8($fp) - # local_method5_at_C_x_0 = local_method5_at_C_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # LOCAL local_method5_at_C_internal_5 --> -24($fp) - # local_method5_at_C_internal_5 = ALLOCATE E - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, E - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, E_start - sw $t0, 4($v0) - # Load type offset - li $t0, 36 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __A__attrib__var__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -24($fp) - # LOCAL local_method5_at_C_internal_3 --> -16($fp) - # LOCAL local_method5_at_C_internal_5 --> -24($fp) - # local_method5_at_C_internal_3 = local_method5_at_C_internal_5 - lw $t0, -24($fp) - sw $t0, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_method5_at_C_x_0 - # LOCAL local_method5_at_C_x_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_method5_at_C_internal_3 --> -16($fp) - # LOCAL local_method5_at_C_internal_4 --> -20($fp) - # local_method5_at_C_internal_4 = VCALL local_method5_at_C_internal_3 set_var - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 116($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_method5_at_C_internal_4 - lw $v0, -20($fp) - # Deallocate stack frame for function function_method5_at_C. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# __Main__attrib__char__init implementation. -# @Params: -__Main__attrib__char__init: - # Allocate stack frame for function __Main__attrib__char__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__char__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_0 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__char__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Main__attrib__char__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__avar__init implementation. -# @Params: -__Main__attrib__avar__init: - # Allocate stack frame for function __Main__attrib__avar__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Main__attrib__avar__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__a_var__init implementation. -# @Params: -__Main__attrib__a_var__init: - # Allocate stack frame for function __Main__attrib__a_var__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Main__attrib__a_var__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__flag__init implementation. -# @Params: -__Main__attrib__flag__init: - # Allocate stack frame for function __Main__attrib__flag__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__flag__init_internal_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_ttrib__flag__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Main__attrib__flag__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_menu_at_Main implementation. -# @Params: -function_menu_at_Main: - # Allocate stack frame for function function_menu_at_Main. - subu $sp, $sp, 436 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 436 - # LOCAL local_menu_at_Main_internal_2 --> -12($fp) - # local_menu_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_menu_at_Main_internal_0 --> -4($fp) - # LOCAL local_menu_at_Main_internal_2 --> -12($fp) - # local_menu_at_Main_internal_0 = local_menu_at_Main_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_menu_at_Main_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_30 - sw $t0, 12($v0) - li $t0, 22 - sw $t0, 16($v0) - sw $v0, -16($fp) - # ARG local_menu_at_Main_internal_3 - # LOCAL local_menu_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_0 --> -4($fp) - # LOCAL local_menu_at_Main_internal_1 --> -8($fp) - # local_menu_at_Main_internal_1 = VCALL local_menu_at_Main_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_6 --> -28($fp) - # local_menu_at_Main_internal_6 = SELF - sw $s1, -28($fp) - # LOCAL local_menu_at_Main_internal_4 --> -20($fp) - # LOCAL local_menu_at_Main_internal_6 --> -28($fp) - # local_menu_at_Main_internal_4 = local_menu_at_Main_internal_6 - lw $t0, -28($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_menu_at_Main_internal_7 = GETATTRIBUTE avar Main - # LOCAL local_menu_at_Main_internal_7 --> -32($fp) - lw $t0, 16($s1) - sw $t0, -32($fp) - # ARG local_menu_at_Main_internal_7 - # LOCAL local_menu_at_Main_internal_7 --> -32($fp) - lw $t0, -32($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_4 --> -20($fp) - # LOCAL local_menu_at_Main_internal_5 --> -24($fp) - # local_menu_at_Main_internal_5 = VCALL local_menu_at_Main_internal_4 print - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_10 --> -44($fp) - # local_menu_at_Main_internal_10 = SELF - sw $s1, -44($fp) - # LOCAL local_menu_at_Main_internal_8 --> -36($fp) - # LOCAL local_menu_at_Main_internal_10 --> -44($fp) - # local_menu_at_Main_internal_8 = local_menu_at_Main_internal_10 - lw $t0, -44($fp) - sw $t0, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_menu_at_Main_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_31 - sw $t0, 12($v0) - li $t0, 12 - sw $t0, 16($v0) - sw $v0, -48($fp) - # ARG local_menu_at_Main_internal_11 - # LOCAL local_menu_at_Main_internal_11 --> -48($fp) - lw $t0, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_8 --> -36($fp) - # LOCAL local_menu_at_Main_internal_9 --> -40($fp) - # local_menu_at_Main_internal_9 = VCALL local_menu_at_Main_internal_8 out_string - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_14 --> -60($fp) - # local_menu_at_Main_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_menu_at_Main_internal_12 --> -52($fp) - # LOCAL local_menu_at_Main_internal_14 --> -60($fp) - # local_menu_at_Main_internal_12 = local_menu_at_Main_internal_14 - lw $t0, -60($fp) - sw $t0, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_menu_at_Main_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_32 - sw $t0, 12($v0) - li $t0, 12 - sw $t0, 16($v0) - sw $v0, -64($fp) - # ARG local_menu_at_Main_internal_15 - # LOCAL local_menu_at_Main_internal_15 --> -64($fp) - lw $t0, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_12 --> -52($fp) - # LOCAL local_menu_at_Main_internal_13 --> -56($fp) - # local_menu_at_Main_internal_13 = VCALL local_menu_at_Main_internal_12 out_string - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_18 --> -76($fp) - # local_menu_at_Main_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_menu_at_Main_internal_16 --> -68($fp) - # LOCAL local_menu_at_Main_internal_18 --> -76($fp) - # local_menu_at_Main_internal_16 = local_menu_at_Main_internal_18 - lw $t0, -76($fp) - sw $t0, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_menu_at_Main_internal_19 = GETATTRIBUTE avar Main - # LOCAL local_menu_at_Main_internal_19 --> -80($fp) - lw $t0, 16($s1) - sw $t0, -80($fp) - # ARG local_menu_at_Main_internal_19 - # LOCAL local_menu_at_Main_internal_19 --> -80($fp) - lw $t0, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_16 --> -68($fp) - # LOCAL local_menu_at_Main_internal_17 --> -72($fp) - # local_menu_at_Main_internal_17 = VCALL local_menu_at_Main_internal_16 print - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_22 --> -92($fp) - # local_menu_at_Main_internal_22 = SELF - sw $s1, -92($fp) - # LOCAL local_menu_at_Main_internal_20 --> -84($fp) - # LOCAL local_menu_at_Main_internal_22 --> -92($fp) - # local_menu_at_Main_internal_20 = local_menu_at_Main_internal_22 - lw $t0, -92($fp) - sw $t0, -84($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_menu_at_Main_internal_23 --> -96($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_33 - sw $t0, 12($v0) - li $t0, 12 - sw $t0, 16($v0) - sw $v0, -96($fp) - # ARG local_menu_at_Main_internal_23 - # LOCAL local_menu_at_Main_internal_23 --> -96($fp) - lw $t0, -96($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_20 --> -84($fp) - # LOCAL local_menu_at_Main_internal_21 --> -88($fp) - # local_menu_at_Main_internal_21 = VCALL local_menu_at_Main_internal_20 out_string - # Save new self pointer in $s1 - lw $s1, -84($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -88($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_26 --> -108($fp) - # local_menu_at_Main_internal_26 = SELF - sw $s1, -108($fp) - # LOCAL local_menu_at_Main_internal_24 --> -100($fp) - # LOCAL local_menu_at_Main_internal_26 --> -108($fp) - # local_menu_at_Main_internal_24 = local_menu_at_Main_internal_26 - lw $t0, -108($fp) - sw $t0, -100($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_menu_at_Main_internal_27 --> -112($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_34 - sw $t0, 12($v0) - li $t0, 33 - sw $t0, 16($v0) - sw $v0, -112($fp) - # ARG local_menu_at_Main_internal_27 - # LOCAL local_menu_at_Main_internal_27 --> -112($fp) - lw $t0, -112($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_24 --> -100($fp) - # LOCAL local_menu_at_Main_internal_25 --> -104($fp) - # local_menu_at_Main_internal_25 = VCALL local_menu_at_Main_internal_24 out_string - # Save new self pointer in $s1 - lw $s1, -100($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -104($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_30 --> -124($fp) - # local_menu_at_Main_internal_30 = SELF - sw $s1, -124($fp) - # LOCAL local_menu_at_Main_internal_28 --> -116($fp) - # LOCAL local_menu_at_Main_internal_30 --> -124($fp) - # local_menu_at_Main_internal_28 = local_menu_at_Main_internal_30 - lw $t0, -124($fp) - sw $t0, -116($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_menu_at_Main_internal_31 = GETATTRIBUTE avar Main - # LOCAL local_menu_at_Main_internal_31 --> -128($fp) - lw $t0, 16($s1) - sw $t0, -128($fp) - # ARG local_menu_at_Main_internal_31 - # LOCAL local_menu_at_Main_internal_31 --> -128($fp) - lw $t0, -128($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_28 --> -116($fp) - # LOCAL local_menu_at_Main_internal_29 --> -120($fp) - # local_menu_at_Main_internal_29 = VCALL local_menu_at_Main_internal_28 print - # Save new self pointer in $s1 - lw $s1, -116($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -120($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_34 --> -140($fp) - # local_menu_at_Main_internal_34 = SELF - sw $s1, -140($fp) - # LOCAL local_menu_at_Main_internal_32 --> -132($fp) - # LOCAL local_menu_at_Main_internal_34 --> -140($fp) - # local_menu_at_Main_internal_32 = local_menu_at_Main_internal_34 - lw $t0, -140($fp) - sw $t0, -132($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_menu_at_Main_internal_35 --> -144($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_35 - sw $t0, 12($v0) - li $t0, 30 - sw $t0, 16($v0) - sw $v0, -144($fp) - # ARG local_menu_at_Main_internal_35 - # LOCAL local_menu_at_Main_internal_35 --> -144($fp) - lw $t0, -144($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_32 --> -132($fp) - # LOCAL local_menu_at_Main_internal_33 --> -136($fp) - # local_menu_at_Main_internal_33 = VCALL local_menu_at_Main_internal_32 out_string - # Save new self pointer in $s1 - lw $s1, -132($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -136($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_38 --> -156($fp) - # local_menu_at_Main_internal_38 = SELF - sw $s1, -156($fp) - # LOCAL local_menu_at_Main_internal_36 --> -148($fp) - # LOCAL local_menu_at_Main_internal_38 --> -156($fp) - # local_menu_at_Main_internal_36 = local_menu_at_Main_internal_38 - lw $t0, -156($fp) - sw $t0, -148($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_menu_at_Main_internal_39 --> -160($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_36 - sw $t0, 12($v0) - li $t0, 27 - sw $t0, 16($v0) - sw $v0, -160($fp) - # ARG local_menu_at_Main_internal_39 - # LOCAL local_menu_at_Main_internal_39 --> -160($fp) - lw $t0, -160($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_36 --> -148($fp) - # LOCAL local_menu_at_Main_internal_37 --> -152($fp) - # local_menu_at_Main_internal_37 = VCALL local_menu_at_Main_internal_36 out_string - # Save new self pointer in $s1 - lw $s1, -148($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -152($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_42 --> -172($fp) - # local_menu_at_Main_internal_42 = SELF - sw $s1, -172($fp) - # LOCAL local_menu_at_Main_internal_40 --> -164($fp) - # LOCAL local_menu_at_Main_internal_42 --> -172($fp) - # local_menu_at_Main_internal_40 = local_menu_at_Main_internal_42 - lw $t0, -172($fp) - sw $t0, -164($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_menu_at_Main_internal_43 = GETATTRIBUTE avar Main - # LOCAL local_menu_at_Main_internal_43 --> -176($fp) - lw $t0, 16($s1) - sw $t0, -176($fp) - # ARG local_menu_at_Main_internal_43 - # LOCAL local_menu_at_Main_internal_43 --> -176($fp) - lw $t0, -176($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_40 --> -164($fp) - # LOCAL local_menu_at_Main_internal_41 --> -168($fp) - # local_menu_at_Main_internal_41 = VCALL local_menu_at_Main_internal_40 print - # Save new self pointer in $s1 - lw $s1, -164($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -168($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_46 --> -188($fp) - # local_menu_at_Main_internal_46 = SELF - sw $s1, -188($fp) - # LOCAL local_menu_at_Main_internal_44 --> -180($fp) - # LOCAL local_menu_at_Main_internal_46 --> -188($fp) - # local_menu_at_Main_internal_44 = local_menu_at_Main_internal_46 - lw $t0, -188($fp) - sw $t0, -180($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_menu_at_Main_internal_47 --> -192($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_37 - sw $t0, 12($v0) - li $t0, 12 - sw $t0, 16($v0) - sw $v0, -192($fp) - # ARG local_menu_at_Main_internal_47 - # LOCAL local_menu_at_Main_internal_47 --> -192($fp) - lw $t0, -192($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_44 --> -180($fp) - # LOCAL local_menu_at_Main_internal_45 --> -184($fp) - # local_menu_at_Main_internal_45 = VCALL local_menu_at_Main_internal_44 out_string - # Save new self pointer in $s1 - lw $s1, -180($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -184($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_50 --> -204($fp) - # local_menu_at_Main_internal_50 = SELF - sw $s1, -204($fp) - # LOCAL local_menu_at_Main_internal_48 --> -196($fp) - # LOCAL local_menu_at_Main_internal_50 --> -204($fp) - # local_menu_at_Main_internal_48 = local_menu_at_Main_internal_50 - lw $t0, -204($fp) - sw $t0, -196($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_menu_at_Main_internal_51 --> -208($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_38 - sw $t0, 12($v0) - li $t0, 12 - sw $t0, 16($v0) - sw $v0, -208($fp) - # ARG local_menu_at_Main_internal_51 - # LOCAL local_menu_at_Main_internal_51 --> -208($fp) - lw $t0, -208($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_48 --> -196($fp) - # LOCAL local_menu_at_Main_internal_49 --> -200($fp) - # local_menu_at_Main_internal_49 = VCALL local_menu_at_Main_internal_48 out_string - # Save new self pointer in $s1 - lw $s1, -196($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -200($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_54 --> -220($fp) - # local_menu_at_Main_internal_54 = SELF - sw $s1, -220($fp) - # LOCAL local_menu_at_Main_internal_52 --> -212($fp) - # LOCAL local_menu_at_Main_internal_54 --> -220($fp) - # local_menu_at_Main_internal_52 = local_menu_at_Main_internal_54 - lw $t0, -220($fp) - sw $t0, -212($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_menu_at_Main_internal_55 = GETATTRIBUTE avar Main - # LOCAL local_menu_at_Main_internal_55 --> -224($fp) - lw $t0, 16($s1) - sw $t0, -224($fp) - # ARG local_menu_at_Main_internal_55 - # LOCAL local_menu_at_Main_internal_55 --> -224($fp) - lw $t0, -224($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_52 --> -212($fp) - # LOCAL local_menu_at_Main_internal_53 --> -216($fp) - # local_menu_at_Main_internal_53 = VCALL local_menu_at_Main_internal_52 print - # Save new self pointer in $s1 - lw $s1, -212($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -216($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_58 --> -236($fp) - # local_menu_at_Main_internal_58 = SELF - sw $s1, -236($fp) - # LOCAL local_menu_at_Main_internal_56 --> -228($fp) - # LOCAL local_menu_at_Main_internal_58 --> -236($fp) - # local_menu_at_Main_internal_56 = local_menu_at_Main_internal_58 - lw $t0, -236($fp) - sw $t0, -228($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_menu_at_Main_internal_59 --> -240($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_39 - sw $t0, 12($v0) - li $t0, 12 - sw $t0, 16($v0) - sw $v0, -240($fp) - # ARG local_menu_at_Main_internal_59 - # LOCAL local_menu_at_Main_internal_59 --> -240($fp) - lw $t0, -240($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_56 --> -228($fp) - # LOCAL local_menu_at_Main_internal_57 --> -232($fp) - # local_menu_at_Main_internal_57 = VCALL local_menu_at_Main_internal_56 out_string - # Save new self pointer in $s1 - lw $s1, -228($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -232($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_62 --> -252($fp) - # local_menu_at_Main_internal_62 = SELF - sw $s1, -252($fp) - # LOCAL local_menu_at_Main_internal_60 --> -244($fp) - # LOCAL local_menu_at_Main_internal_62 --> -252($fp) - # local_menu_at_Main_internal_60 = local_menu_at_Main_internal_62 - lw $t0, -252($fp) - sw $t0, -244($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_menu_at_Main_internal_63 --> -256($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_40 - sw $t0, 12($v0) - li $t0, 10 - sw $t0, 16($v0) - sw $v0, -256($fp) - # ARG local_menu_at_Main_internal_63 - # LOCAL local_menu_at_Main_internal_63 --> -256($fp) - lw $t0, -256($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_60 --> -244($fp) - # LOCAL local_menu_at_Main_internal_61 --> -248($fp) - # local_menu_at_Main_internal_61 = VCALL local_menu_at_Main_internal_60 out_string - # Save new self pointer in $s1 - lw $s1, -244($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -248($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_66 --> -268($fp) - # local_menu_at_Main_internal_66 = SELF - sw $s1, -268($fp) - # LOCAL local_menu_at_Main_internal_64 --> -260($fp) - # LOCAL local_menu_at_Main_internal_66 --> -268($fp) - # local_menu_at_Main_internal_64 = local_menu_at_Main_internal_66 - lw $t0, -268($fp) - sw $t0, -260($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_menu_at_Main_internal_67 = GETATTRIBUTE avar Main - # LOCAL local_menu_at_Main_internal_67 --> -272($fp) - lw $t0, 16($s1) - sw $t0, -272($fp) - # ARG local_menu_at_Main_internal_67 - # LOCAL local_menu_at_Main_internal_67 --> -272($fp) - lw $t0, -272($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_64 --> -260($fp) - # LOCAL local_menu_at_Main_internal_65 --> -264($fp) - # local_menu_at_Main_internal_65 = VCALL local_menu_at_Main_internal_64 print - # Save new self pointer in $s1 - lw $s1, -260($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -264($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_70 --> -284($fp) - # local_menu_at_Main_internal_70 = SELF - sw $s1, -284($fp) - # LOCAL local_menu_at_Main_internal_68 --> -276($fp) - # LOCAL local_menu_at_Main_internal_70 --> -284($fp) - # local_menu_at_Main_internal_68 = local_menu_at_Main_internal_70 - lw $t0, -284($fp) - sw $t0, -276($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_menu_at_Main_internal_71 --> -288($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_41 - sw $t0, 12($v0) - li $t0, 12 - sw $t0, 16($v0) - sw $v0, -288($fp) - # ARG local_menu_at_Main_internal_71 - # LOCAL local_menu_at_Main_internal_71 --> -288($fp) - lw $t0, -288($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_68 --> -276($fp) - # LOCAL local_menu_at_Main_internal_69 --> -280($fp) - # local_menu_at_Main_internal_69 = VCALL local_menu_at_Main_internal_68 out_string - # Save new self pointer in $s1 - lw $s1, -276($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -280($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_74 --> -300($fp) - # local_menu_at_Main_internal_74 = SELF - sw $s1, -300($fp) - # LOCAL local_menu_at_Main_internal_72 --> -292($fp) - # LOCAL local_menu_at_Main_internal_74 --> -300($fp) - # local_menu_at_Main_internal_72 = local_menu_at_Main_internal_74 - lw $t0, -300($fp) - sw $t0, -292($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_menu_at_Main_internal_75 --> -304($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_42 - sw $t0, 12($v0) - li $t0, 17 - sw $t0, 16($v0) - sw $v0, -304($fp) - # ARG local_menu_at_Main_internal_75 - # LOCAL local_menu_at_Main_internal_75 --> -304($fp) - lw $t0, -304($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_72 --> -292($fp) - # LOCAL local_menu_at_Main_internal_73 --> -296($fp) - # local_menu_at_Main_internal_73 = VCALL local_menu_at_Main_internal_72 out_string - # Save new self pointer in $s1 - lw $s1, -292($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -296($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_78 --> -316($fp) - # local_menu_at_Main_internal_78 = SELF - sw $s1, -316($fp) - # LOCAL local_menu_at_Main_internal_76 --> -308($fp) - # LOCAL local_menu_at_Main_internal_78 --> -316($fp) - # local_menu_at_Main_internal_76 = local_menu_at_Main_internal_78 - lw $t0, -316($fp) - sw $t0, -308($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_menu_at_Main_internal_79 = GETATTRIBUTE avar Main - # LOCAL local_menu_at_Main_internal_79 --> -320($fp) - lw $t0, 16($s1) - sw $t0, -320($fp) - # ARG local_menu_at_Main_internal_79 - # LOCAL local_menu_at_Main_internal_79 --> -320($fp) - lw $t0, -320($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_76 --> -308($fp) - # LOCAL local_menu_at_Main_internal_77 --> -312($fp) - # local_menu_at_Main_internal_77 = VCALL local_menu_at_Main_internal_76 print - # Save new self pointer in $s1 - lw $s1, -308($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -312($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_82 --> -332($fp) - # local_menu_at_Main_internal_82 = SELF - sw $s1, -332($fp) - # LOCAL local_menu_at_Main_internal_80 --> -324($fp) - # LOCAL local_menu_at_Main_internal_82 --> -332($fp) - # local_menu_at_Main_internal_80 = local_menu_at_Main_internal_82 - lw $t0, -332($fp) - sw $t0, -324($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_menu_at_Main_internal_83 --> -336($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_43 - sw $t0, 12($v0) - li $t0, 30 - sw $t0, 16($v0) - sw $v0, -336($fp) - # ARG local_menu_at_Main_internal_83 - # LOCAL local_menu_at_Main_internal_83 --> -336($fp) - lw $t0, -336($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_80 --> -324($fp) - # LOCAL local_menu_at_Main_internal_81 --> -328($fp) - # local_menu_at_Main_internal_81 = VCALL local_menu_at_Main_internal_80 out_string - # Save new self pointer in $s1 - lw $s1, -324($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -328($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_86 --> -348($fp) - # local_menu_at_Main_internal_86 = SELF - sw $s1, -348($fp) - # LOCAL local_menu_at_Main_internal_84 --> -340($fp) - # LOCAL local_menu_at_Main_internal_86 --> -348($fp) - # local_menu_at_Main_internal_84 = local_menu_at_Main_internal_86 - lw $t0, -348($fp) - sw $t0, -340($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_menu_at_Main_internal_87 --> -352($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_44 - sw $t0, 12($v0) - li $t0, 12 - sw $t0, 16($v0) - sw $v0, -352($fp) - # ARG local_menu_at_Main_internal_87 - # LOCAL local_menu_at_Main_internal_87 --> -352($fp) - lw $t0, -352($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_84 --> -340($fp) - # LOCAL local_menu_at_Main_internal_85 --> -344($fp) - # local_menu_at_Main_internal_85 = VCALL local_menu_at_Main_internal_84 out_string - # Save new self pointer in $s1 - lw $s1, -340($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -344($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_90 --> -364($fp) - # local_menu_at_Main_internal_90 = SELF - sw $s1, -364($fp) - # LOCAL local_menu_at_Main_internal_88 --> -356($fp) - # LOCAL local_menu_at_Main_internal_90 --> -364($fp) - # local_menu_at_Main_internal_88 = local_menu_at_Main_internal_90 - lw $t0, -364($fp) - sw $t0, -356($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_menu_at_Main_internal_91 = GETATTRIBUTE avar Main - # LOCAL local_menu_at_Main_internal_91 --> -368($fp) - lw $t0, 16($s1) - sw $t0, -368($fp) - # ARG local_menu_at_Main_internal_91 - # LOCAL local_menu_at_Main_internal_91 --> -368($fp) - lw $t0, -368($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_88 --> -356($fp) - # LOCAL local_menu_at_Main_internal_89 --> -360($fp) - # local_menu_at_Main_internal_89 = VCALL local_menu_at_Main_internal_88 print - # Save new self pointer in $s1 - lw $s1, -356($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -360($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_94 --> -380($fp) - # local_menu_at_Main_internal_94 = SELF - sw $s1, -380($fp) - # LOCAL local_menu_at_Main_internal_92 --> -372($fp) - # LOCAL local_menu_at_Main_internal_94 --> -380($fp) - # local_menu_at_Main_internal_92 = local_menu_at_Main_internal_94 - lw $t0, -380($fp) - sw $t0, -372($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_menu_at_Main_internal_95 --> -384($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_45 - sw $t0, 12($v0) - li $t0, 16 - sw $t0, 16($v0) - sw $v0, -384($fp) - # ARG local_menu_at_Main_internal_95 - # LOCAL local_menu_at_Main_internal_95 --> -384($fp) - lw $t0, -384($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_92 --> -372($fp) - # LOCAL local_menu_at_Main_internal_93 --> -376($fp) - # local_menu_at_Main_internal_93 = VCALL local_menu_at_Main_internal_92 out_string - # Save new self pointer in $s1 - lw $s1, -372($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -376($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_98 --> -396($fp) - # local_menu_at_Main_internal_98 = SELF - sw $s1, -396($fp) - # LOCAL local_menu_at_Main_internal_96 --> -388($fp) - # LOCAL local_menu_at_Main_internal_98 --> -396($fp) - # local_menu_at_Main_internal_96 = local_menu_at_Main_internal_98 - lw $t0, -396($fp) - sw $t0, -388($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_menu_at_Main_internal_99 --> -400($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_46 - sw $t0, 12($v0) - li $t0, 33 - sw $t0, 16($v0) - sw $v0, -400($fp) - # ARG local_menu_at_Main_internal_99 - # LOCAL local_menu_at_Main_internal_99 --> -400($fp) - lw $t0, -400($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_96 --> -388($fp) - # LOCAL local_menu_at_Main_internal_97 --> -392($fp) - # local_menu_at_Main_internal_97 = VCALL local_menu_at_Main_internal_96 out_string - # Save new self pointer in $s1 - lw $s1, -388($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -392($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_102 --> -412($fp) - # local_menu_at_Main_internal_102 = SELF - sw $s1, -412($fp) - # LOCAL local_menu_at_Main_internal_100 --> -404($fp) - # LOCAL local_menu_at_Main_internal_102 --> -412($fp) - # local_menu_at_Main_internal_100 = local_menu_at_Main_internal_102 - lw $t0, -412($fp) - sw $t0, -404($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_menu_at_Main_internal_103 --> -416($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_47 - sw $t0, 12($v0) - li $t0, 22 - sw $t0, 16($v0) - sw $v0, -416($fp) - # ARG local_menu_at_Main_internal_103 - # LOCAL local_menu_at_Main_internal_103 --> -416($fp) - lw $t0, -416($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_menu_at_Main_internal_100 --> -404($fp) - # LOCAL local_menu_at_Main_internal_101 --> -408($fp) - # local_menu_at_Main_internal_101 = VCALL local_menu_at_Main_internal_100 out_string - # Save new self pointer in $s1 - lw $s1, -404($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -408($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_menu_at_Main_internal_106 --> -428($fp) - # local_menu_at_Main_internal_106 = SELF - sw $s1, -428($fp) - # LOCAL local_menu_at_Main_internal_104 --> -420($fp) - # LOCAL local_menu_at_Main_internal_106 --> -428($fp) - # local_menu_at_Main_internal_104 = local_menu_at_Main_internal_106 - lw $t0, -428($fp) - sw $t0, -420($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_menu_at_Main_internal_104 --> -420($fp) - # LOCAL local_menu_at_Main_internal_105 --> -424($fp) - # local_menu_at_Main_internal_105 = VCALL local_menu_at_Main_internal_104 in_string - # Save new self pointer in $s1 - lw $s1, -420($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 80($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -424($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_menu_at_Main_internal_105 - lw $v0, -424($fp) - # Deallocate stack frame for function function_menu_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 436 - jr $ra - # Function END - - -# function_prompt_at_Main implementation. -# @Params: -function_prompt_at_Main: - # Allocate stack frame for function function_prompt_at_Main. - subu $sp, $sp, 52 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 52 - # LOCAL local_prompt_at_Main_internal_2 --> -12($fp) - # local_prompt_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_prompt_at_Main_internal_0 --> -4($fp) - # LOCAL local_prompt_at_Main_internal_2 --> -12($fp) - # local_prompt_at_Main_internal_0 = local_prompt_at_Main_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt_at_Main_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_48 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -16($fp) - # ARG local_prompt_at_Main_internal_3 - # LOCAL local_prompt_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_prompt_at_Main_internal_0 --> -4($fp) - # LOCAL local_prompt_at_Main_internal_1 --> -8($fp) - # local_prompt_at_Main_internal_1 = VCALL local_prompt_at_Main_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt_at_Main_internal_6 --> -28($fp) - # local_prompt_at_Main_internal_6 = SELF - sw $s1, -28($fp) - # LOCAL local_prompt_at_Main_internal_4 --> -20($fp) - # LOCAL local_prompt_at_Main_internal_6 --> -28($fp) - # local_prompt_at_Main_internal_4 = local_prompt_at_Main_internal_6 - lw $t0, -28($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt_at_Main_internal_7 --> -32($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_49 - sw $t0, 12($v0) - li $t0, 26 - sw $t0, 16($v0) - sw $v0, -32($fp) - # ARG local_prompt_at_Main_internal_7 - # LOCAL local_prompt_at_Main_internal_7 --> -32($fp) - lw $t0, -32($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_prompt_at_Main_internal_4 --> -20($fp) - # LOCAL local_prompt_at_Main_internal_5 --> -24($fp) - # local_prompt_at_Main_internal_5 = VCALL local_prompt_at_Main_internal_4 out_string - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt_at_Main_internal_10 --> -44($fp) - # local_prompt_at_Main_internal_10 = SELF - sw $s1, -44($fp) - # LOCAL local_prompt_at_Main_internal_8 --> -36($fp) - # LOCAL local_prompt_at_Main_internal_10 --> -44($fp) - # local_prompt_at_Main_internal_8 = local_prompt_at_Main_internal_10 - lw $t0, -44($fp) - sw $t0, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt_at_Main_internal_8 --> -36($fp) - # LOCAL local_prompt_at_Main_internal_9 --> -40($fp) - # local_prompt_at_Main_internal_9 = VCALL local_prompt_at_Main_internal_8 in_string - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 80($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_prompt_at_Main_internal_9 - lw $v0, -40($fp) - # Deallocate stack frame for function function_prompt_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 52 - jr $ra - # Function END - - -# function_get_int_at_Main implementation. -# @Params: -function_get_int_at_Main: - # Allocate stack frame for function function_get_int_at_Main. - subu $sp, $sp, 40 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 40 - # LOCAL local_get_int_at_Main_z_0 --> -4($fp) - # local_get_int_at_Main_z_0 = 0 - li $t0, 0 - sw $t0, -4($fp) - # LOCAL local_get_int_at_Main_internal_1 --> -8($fp) - # local_get_int_at_Main_internal_1 = ALLOCATE A2I - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, A2I - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, A2I_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -8($fp) - # LOCAL local_get_int_at_Main_z_0 --> -4($fp) - # LOCAL local_get_int_at_Main_internal_1 --> -8($fp) - # local_get_int_at_Main_z_0 = local_get_int_at_Main_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # LOCAL local_get_int_at_Main_s_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_0 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -12($fp) - # LOCAL local_get_int_at_Main_internal_5 --> -24($fp) - # local_get_int_at_Main_internal_5 = SELF - sw $s1, -24($fp) - # LOCAL local_get_int_at_Main_internal_3 --> -16($fp) - # LOCAL local_get_int_at_Main_internal_5 --> -24($fp) - # local_get_int_at_Main_internal_3 = local_get_int_at_Main_internal_5 - lw $t0, -24($fp) - sw $t0, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_get_int_at_Main_internal_3 --> -16($fp) - # LOCAL local_get_int_at_Main_internal_4 --> -20($fp) - # local_get_int_at_Main_internal_4 = VCALL local_get_int_at_Main_internal_3 prompt - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 64($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_get_int_at_Main_s_2 --> -12($fp) - # LOCAL local_get_int_at_Main_internal_4 --> -20($fp) - # local_get_int_at_Main_s_2 = local_get_int_at_Main_internal_4 - lw $t0, -20($fp) - sw $t0, -12($fp) - # LOCAL local_get_int_at_Main_internal_6 --> -28($fp) - # LOCAL local_get_int_at_Main_z_0 --> -4($fp) - # local_get_int_at_Main_internal_6 = local_get_int_at_Main_z_0 - lw $t0, -4($fp) - sw $t0, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_get_int_at_Main_s_2 - # LOCAL local_get_int_at_Main_s_2 --> -12($fp) - lw $t0, -12($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_get_int_at_Main_internal_6 --> -28($fp) - # LOCAL local_get_int_at_Main_internal_7 --> -32($fp) - # local_get_int_at_Main_internal_7 = VCALL local_get_int_at_Main_internal_6 a2i - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 12($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_get_int_at_Main_internal_7 - lw $v0, -32($fp) - # Deallocate stack frame for function function_get_int_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 40 - jr $ra - # Function END - - -# function_is_even_at_Main implementation. -# @Params: -# 0($fp) = param_is_even_at_Main_num_0 -function_is_even_at_Main: - # Allocate stack frame for function function_is_even_at_Main. - subu $sp, $sp, 112 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 112 - # LOCAL local_is_even_at_Main_x_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_is_even_at_Main_x_0 --> -4($fp) - # PARAM param_is_even_at_Main_num_0 --> 0($fp) - # local_is_even_at_Main_x_0 = PARAM param_is_even_at_Main_num_0 - lw $t0, 0($fp) - sw $t0, -4($fp) - # LOCAL local_is_even_at_Main_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -20($fp) - # LOCAL local_is_even_at_Main_internal_3 --> -16($fp) - # LOCAL local_is_even_at_Main_x_0 --> -4($fp) - # LOCAL local_is_even_at_Main_internal_4 --> -20($fp) - lw $a0, -4($fp) - lw $a1, -20($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_GREATER_ZERO local_is_even_at_Main_internal_3 GOTO label_FALSE_303 - # IF_GREATER_ZERO local_is_even_at_Main_internal_3 GOTO label_FALSE_303 - lw $t0, -16($fp) - bgt $t0, 0, label_FALSE_303 - # IF_ZERO local_is_even_at_Main_internal_3 GOTO label_FALSE_303 - # IF_ZERO local_is_even_at_Main_internal_3 GOTO label_FALSE_303 - lw $t0, -16($fp) - beq $t0, 0, label_FALSE_303 - # LOCAL local_is_even_at_Main_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -16($fp) - # GOTO label_END_304 -j label_END_304 -label_FALSE_303: - # LOCAL local_is_even_at_Main_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -16($fp) - label_END_304: -# LOCAL local_is_even_at_Main_internal_1 --> -8($fp) -# LOCAL local_is_even_at_Main_internal_3 --> -16($fp) -# Obtain value from -16($fp) -lw $v0, -16($fp) -lw $v0, 12($v0) -sw $v0, -8($fp) -# IF_ZERO local_is_even_at_Main_internal_1 GOTO label_FALSEIF_301 -# IF_ZERO local_is_even_at_Main_internal_1 GOTO label_FALSEIF_301 -lw $t0, -8($fp) -beq $t0, 0, label_FALSEIF_301 -# LOCAL local_is_even_at_Main_internal_7 --> -32($fp) -# local_is_even_at_Main_internal_7 = SELF -sw $s1, -32($fp) -# LOCAL local_is_even_at_Main_internal_5 --> -24($fp) -# LOCAL local_is_even_at_Main_internal_7 --> -32($fp) -# local_is_even_at_Main_internal_5 = local_is_even_at_Main_internal_7 -lw $t0, -32($fp) -sw $t0, -24($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_is_even_at_Main_internal_8 --> -36($fp) -# LOCAL local_is_even_at_Main_x_0 --> -4($fp) -lw $t0, -4($fp) -lw $t0, 12($t0) -not $t0, $t0 -add $t0, $t0, 1 -sw $t0, -36($fp) -# LOCAL local_is_even_at_Main_internal_8 --> -36($fp) -# LOCAL local_is_even_at_Main_internal_8 --> -36($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -lw $t0, -36($fp) -sw $t0, 12($v0) -sw $v0, -36($fp) -# ARG local_is_even_at_Main_internal_8 -# LOCAL local_is_even_at_Main_internal_8 --> -36($fp) -lw $t0, -36($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_is_even_at_Main_internal_5 --> -24($fp) -# LOCAL local_is_even_at_Main_internal_6 --> -28($fp) -# local_is_even_at_Main_internal_6 = VCALL local_is_even_at_Main_internal_5 is_even -# Save new self pointer in $s1 -lw $s1, -24($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 104($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -28($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_is_even_at_Main_internal_2 --> -12($fp) -# LOCAL local_is_even_at_Main_internal_6 --> -28($fp) -# local_is_even_at_Main_internal_2 = local_is_even_at_Main_internal_6 -lw $t0, -28($fp) -sw $t0, -12($fp) -# GOTO label_ENDIF_302 -j label_ENDIF_302 -label_FALSEIF_301: - # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -56($fp) - # IF_ZERO local_is_even_at_Main_internal_13 GOTO label_FALSE_307 - # IF_ZERO local_is_even_at_Main_internal_13 GOTO label_FALSE_307 - lw $t0, -56($fp) - beq $t0, 0, label_FALSE_307 - # IF_ZERO local_is_even_at_Main_x_0 GOTO label_FALSE_307 - # IF_ZERO local_is_even_at_Main_x_0 GOTO label_FALSE_307 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_307 - # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) - # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) - # Comparing -56($fp) type with String - la $v0, String - lw $a0, -56($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -52($fp) - # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_COMPARE_STRING_310 - # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_COMPARE_STRING_310 - lw $t0, -52($fp) - beq $t0, 0, label_COMPARE_STRING_310 - # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) - # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) - # Comparing -56($fp) type with Bool - la $v0, Bool - lw $a0, -56($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -52($fp) - # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_COMPARE_BY_VALUE_311 - # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_COMPARE_BY_VALUE_311 - lw $t0, -52($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_311 - # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) - # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) - # Comparing -56($fp) type with Int - la $v0, Int - lw $a0, -56($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -52($fp) - # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_COMPARE_BY_VALUE_311 - # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_COMPARE_BY_VALUE_311 - lw $t0, -52($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_311 - # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) - # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) - # LOCAL local_is_even_at_Main_x_0 --> -4($fp) - # Load pointers and SUB - lw $a0, -56($fp) - lw $a1, -4($fp) - sub $a0, $a0, $a1 - sw $a0, -52($fp) - # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_TRUE_308 - # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_TRUE_308 - lw $t0, -52($fp) - beq $t0, 0, label_TRUE_308 - # GOTO label_FALSE_307 - j label_FALSE_307 - label_COMPARE_BY_VALUE_311: - # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) - # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) - # LOCAL local_is_even_at_Main_x_0 --> -4($fp) - lw $a0, -56($fp) - lw $a1, -4($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -52($fp) - # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_TRUE_308 - # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_TRUE_308 - lw $t0, -52($fp) - beq $t0, 0, label_TRUE_308 - # GOTO label_FALSE_307 - j label_FALSE_307 - label_COMPARE_STRING_310: - # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) - # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) - # LOCAL local_is_even_at_Main_x_0 --> -4($fp) - # Load strings for comparison - lw $v0, -56($fp) - lw $v1, -4($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -52($fp) - # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_CONTINUE_312 - # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_CONTINUE_312 - lw $t0, -52($fp) - beq $t0, 0, label_CONTINUE_312 - # GOTO label_FALSE_307 - j label_FALSE_307 - label_CONTINUE_312: - # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) - # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) - # LOCAL local_is_even_at_Main_x_0 --> -4($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -56($fp) - lw $v1, -4($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_313: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_314 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_313 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_314: - # Store result - sw $a2, -52($fp) - # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_TRUE_308 - # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_TRUE_308 - lw $t0, -52($fp) - beq $t0, 0, label_TRUE_308 - label_FALSE_307: - # LOCAL local_is_even_at_Main_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -48($fp) - # GOTO label_END_309 -j label_END_309 -label_TRUE_308: - # LOCAL local_is_even_at_Main_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -48($fp) - label_END_309: -# LOCAL local_is_even_at_Main_internal_9 --> -40($fp) -# LOCAL local_is_even_at_Main_internal_11 --> -48($fp) -# Obtain value from -48($fp) -lw $v0, -48($fp) -lw $v0, 12($v0) -sw $v0, -40($fp) -# IF_ZERO local_is_even_at_Main_internal_9 GOTO label_FALSEIF_305 -# IF_ZERO local_is_even_at_Main_internal_9 GOTO label_FALSEIF_305 -lw $t0, -40($fp) -beq $t0, 0, label_FALSEIF_305 -# LOCAL local_is_even_at_Main_internal_14 --> -60($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -60($fp) -# LOCAL local_is_even_at_Main_internal_10 --> -44($fp) -# LOCAL local_is_even_at_Main_internal_14 --> -60($fp) -# local_is_even_at_Main_internal_10 = local_is_even_at_Main_internal_14 -lw $t0, -60($fp) -sw $t0, -44($fp) -# GOTO label_ENDIF_306 -j label_ENDIF_306 -label_FALSEIF_305: - # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -80($fp) - # IF_ZERO local_is_even_at_Main_internal_19 GOTO label_FALSE_317 - # IF_ZERO local_is_even_at_Main_internal_19 GOTO label_FALSE_317 - lw $t0, -80($fp) - beq $t0, 0, label_FALSE_317 - # IF_ZERO local_is_even_at_Main_x_0 GOTO label_FALSE_317 - # IF_ZERO local_is_even_at_Main_x_0 GOTO label_FALSE_317 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_317 - # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) - # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) - # Comparing -80($fp) type with String - la $v0, String - lw $a0, -80($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -76($fp) - # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_COMPARE_STRING_320 - # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_COMPARE_STRING_320 - lw $t0, -76($fp) - beq $t0, 0, label_COMPARE_STRING_320 - # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) - # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) - # Comparing -80($fp) type with Bool - la $v0, Bool - lw $a0, -80($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -76($fp) - # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_COMPARE_BY_VALUE_321 - # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_COMPARE_BY_VALUE_321 - lw $t0, -76($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_321 - # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) - # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) - # Comparing -80($fp) type with Int - la $v0, Int - lw $a0, -80($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -76($fp) - # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_COMPARE_BY_VALUE_321 - # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_COMPARE_BY_VALUE_321 - lw $t0, -76($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_321 - # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) - # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) - # LOCAL local_is_even_at_Main_x_0 --> -4($fp) - # Load pointers and SUB - lw $a0, -80($fp) - lw $a1, -4($fp) - sub $a0, $a0, $a1 - sw $a0, -76($fp) - # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_TRUE_318 - # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_TRUE_318 - lw $t0, -76($fp) - beq $t0, 0, label_TRUE_318 - # GOTO label_FALSE_317 - j label_FALSE_317 - label_COMPARE_BY_VALUE_321: - # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) - # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) - # LOCAL local_is_even_at_Main_x_0 --> -4($fp) - lw $a0, -80($fp) - lw $a1, -4($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -76($fp) - # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_TRUE_318 - # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_TRUE_318 - lw $t0, -76($fp) - beq $t0, 0, label_TRUE_318 - # GOTO label_FALSE_317 - j label_FALSE_317 - label_COMPARE_STRING_320: - # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) - # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) - # LOCAL local_is_even_at_Main_x_0 --> -4($fp) - # Load strings for comparison - lw $v0, -80($fp) - lw $v1, -4($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -76($fp) - # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_CONTINUE_322 - # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_CONTINUE_322 - lw $t0, -76($fp) - beq $t0, 0, label_CONTINUE_322 - # GOTO label_FALSE_317 - j label_FALSE_317 - label_CONTINUE_322: - # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) - # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) - # LOCAL local_is_even_at_Main_x_0 --> -4($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -80($fp) - lw $v1, -4($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_323: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_324 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_323 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_324: - # Store result - sw $a2, -76($fp) - # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_TRUE_318 - # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_TRUE_318 - lw $t0, -76($fp) - beq $t0, 0, label_TRUE_318 - label_FALSE_317: - # LOCAL local_is_even_at_Main_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -72($fp) - # GOTO label_END_319 -j label_END_319 -label_TRUE_318: - # LOCAL local_is_even_at_Main_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -72($fp) - label_END_319: -# LOCAL local_is_even_at_Main_internal_15 --> -64($fp) -# LOCAL local_is_even_at_Main_internal_17 --> -72($fp) -# Obtain value from -72($fp) -lw $v0, -72($fp) -lw $v0, 12($v0) -sw $v0, -64($fp) -# IF_ZERO local_is_even_at_Main_internal_15 GOTO label_FALSEIF_315 -# IF_ZERO local_is_even_at_Main_internal_15 GOTO label_FALSEIF_315 -lw $t0, -64($fp) -beq $t0, 0, label_FALSEIF_315 -# LOCAL local_is_even_at_Main_internal_20 --> -84($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -84($fp) -# LOCAL local_is_even_at_Main_internal_16 --> -68($fp) -# LOCAL local_is_even_at_Main_internal_20 --> -84($fp) -# local_is_even_at_Main_internal_16 = local_is_even_at_Main_internal_20 -lw $t0, -84($fp) -sw $t0, -68($fp) -# GOTO label_ENDIF_316 -j label_ENDIF_316 -label_FALSEIF_315: - # LOCAL local_is_even_at_Main_internal_23 --> -96($fp) - # local_is_even_at_Main_internal_23 = SELF - sw $s1, -96($fp) - # LOCAL local_is_even_at_Main_internal_21 --> -88($fp) - # LOCAL local_is_even_at_Main_internal_23 --> -96($fp) - # local_is_even_at_Main_internal_21 = local_is_even_at_Main_internal_23 - lw $t0, -96($fp) - sw $t0, -88($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_is_even_at_Main_internal_25 --> -104($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 2 - sw $t0, 12($v0) - sw $v0, -104($fp) - # LOCAL local_is_even_at_Main_internal_24 --> -100($fp) - # LOCAL local_is_even_at_Main_x_0 --> -4($fp) - # LOCAL local_is_even_at_Main_internal_25 --> -104($fp) - # local_is_even_at_Main_internal_24 = local_is_even_at_Main_x_0 - local_is_even_at_Main_internal_25 - lw $t1, -4($fp) - lw $t0, 12($t1) - lw $t1, -104($fp) - lw $t2, 12($t1) - sub $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -100($fp) - # ARG local_is_even_at_Main_internal_24 - # LOCAL local_is_even_at_Main_internal_24 --> -100($fp) - lw $t0, -100($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_is_even_at_Main_internal_21 --> -88($fp) - # LOCAL local_is_even_at_Main_internal_22 --> -92($fp) - # local_is_even_at_Main_internal_22 = VCALL local_is_even_at_Main_internal_21 is_even - # Save new self pointer in $s1 - lw $s1, -88($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -92($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_is_even_at_Main_internal_16 --> -68($fp) - # LOCAL local_is_even_at_Main_internal_22 --> -92($fp) - # local_is_even_at_Main_internal_16 = local_is_even_at_Main_internal_22 - lw $t0, -92($fp) - sw $t0, -68($fp) - label_ENDIF_316: -# LOCAL local_is_even_at_Main_internal_10 --> -44($fp) -# LOCAL local_is_even_at_Main_internal_16 --> -68($fp) -# local_is_even_at_Main_internal_10 = local_is_even_at_Main_internal_16 -lw $t0, -68($fp) -sw $t0, -44($fp) -label_ENDIF_306: -# LOCAL local_is_even_at_Main_internal_2 --> -12($fp) -# LOCAL local_is_even_at_Main_internal_10 --> -44($fp) -# local_is_even_at_Main_internal_2 = local_is_even_at_Main_internal_10 -lw $t0, -44($fp) -sw $t0, -12($fp) -label_ENDIF_302: -# RETURN local_is_even_at_Main_internal_2 -lw $v0, -12($fp) -# Deallocate stack frame for function function_is_even_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 112 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_class_type_at_Main implementation. -# @Params: -# 0($fp) = param_class_type_at_Main_var_0 -function_class_type_at_Main: - # Allocate stack frame for function function_class_type_at_Main. - subu $sp, $sp, 148 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 148 - # PARAM param_class_type_at_Main_var_0 --> 0($fp) - # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) - # local_class_type_at_Main_internal_0 = TYPEOF param_class_type_at_Main_var_0 - lw $t0, 0($fp) - # Load pointer to type offset - lw $t1, 8($t0) - sw $t1, -4($fp) - # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) - # local_class_type_at_Main_internal_3 = 15 - li $t0, 15 - sw $t0, -16($fp) - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) - # Load TDT pointer to type A - la $t0, A__TDT - lw $t1, -4($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -20($fp) - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) - # Update min if 8 < 9 - lw $t0, -20($fp) - lw $t1, -16($fp) - bgtu $t0, $t1, label_Not_min0_325 - # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # local_class_type_at_Main_internal_3 = local_class_type_at_Main_internal_4 - lw $t0, -20($fp) - sw $t0, -16($fp) - label_Not_min0_325: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) - # Load TDT pointer to type B - la $t0, B__TDT - lw $t1, -4($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -20($fp) - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) - # Update min if 8 < 9 - lw $t0, -20($fp) - lw $t1, -16($fp) - bgtu $t0, $t1, label_Not_min1_326 - # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # local_class_type_at_Main_internal_3 = local_class_type_at_Main_internal_4 - lw $t0, -20($fp) - sw $t0, -16($fp) - label_Not_min1_326: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) - # Load TDT pointer to type C - la $t0, C__TDT - lw $t1, -4($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -20($fp) - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) - # Update min if 8 < 9 - lw $t0, -20($fp) - lw $t1, -16($fp) - bgtu $t0, $t1, label_Not_min2_327 - # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # local_class_type_at_Main_internal_3 = local_class_type_at_Main_internal_4 - lw $t0, -20($fp) - sw $t0, -16($fp) - label_Not_min2_327: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) - # Load TDT pointer to type D - la $t0, D__TDT - lw $t1, -4($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -20($fp) - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) - # Update min if 8 < 9 - lw $t0, -20($fp) - lw $t1, -16($fp) - bgtu $t0, $t1, label_Not_min3_328 - # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # local_class_type_at_Main_internal_3 = local_class_type_at_Main_internal_4 - lw $t0, -20($fp) - sw $t0, -16($fp) - label_Not_min3_328: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) - # Load TDT pointer to type E - la $t0, E__TDT - lw $t1, -4($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -20($fp) - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) - # Update min if 8 < 9 - lw $t0, -20($fp) - lw $t1, -16($fp) - bgtu $t0, $t1, label_Not_min4_329 - # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # local_class_type_at_Main_internal_3 = local_class_type_at_Main_internal_4 - lw $t0, -20($fp) - sw $t0, -16($fp) - label_Not_min4_329: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) - # Load TDT pointer to type Object - la $t0, Object__TDT - lw $t1, -4($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -20($fp) - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) - # Update min if 8 < 9 - lw $t0, -20($fp) - lw $t1, -16($fp) - bgtu $t0, $t1, label_Not_min5_330 - # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # local_class_type_at_Main_internal_3 = local_class_type_at_Main_internal_4 - lw $t0, -20($fp) - sw $t0, -16($fp) - label_Not_min5_330: - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # local_class_type_at_Main_internal_4 = 15 - li $t0, 15 - sw $t0, -20($fp) - # LOCAL local_class_type_at_Main_internal_1 --> -8($fp) - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) - # Load pointers and SUB - lw $a0, -20($fp) - lw $a1, -16($fp) - sub $a0, $a0, $a1 - sw $a0, -8($fp) - # IF_ZERO local_class_type_at_Main_internal_1 GOTO label_ERROR_331 - # IF_ZERO local_class_type_at_Main_internal_1 GOTO label_ERROR_331 - lw $t0, -8($fp) - beq $t0, 0, label_ERROR_331 - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) - # Load TDT pointer to type A - la $t0, A__TDT - lw $t1, -4($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -20($fp) - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) - # Update min if 8 < 9 - lw $t0, -20($fp) - lw $t1, -16($fp) - bgtu $t0, $t1, label_NEXT0_333 - # LOCAL local_class_type_at_Main_a_5 --> -24($fp) - # PARAM param_class_type_at_Main_var_0 --> 0($fp) - # local_class_type_at_Main_a_5 = PARAM param_class_type_at_Main_var_0 - lw $t0, 0($fp) - sw $t0, -24($fp) - # LOCAL local_class_type_at_Main_internal_8 --> -36($fp) - # local_class_type_at_Main_internal_8 = SELF - sw $s1, -36($fp) - # LOCAL local_class_type_at_Main_internal_6 --> -28($fp) - # LOCAL local_class_type_at_Main_internal_8 --> -36($fp) - # local_class_type_at_Main_internal_6 = local_class_type_at_Main_internal_8 - lw $t0, -36($fp) - sw $t0, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_class_type_at_Main_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_50 - sw $t0, 12($v0) - li $t0, 20 - sw $t0, 16($v0) - sw $v0, -40($fp) - # ARG local_class_type_at_Main_internal_9 - # LOCAL local_class_type_at_Main_internal_9 --> -40($fp) - lw $t0, -40($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_class_type_at_Main_internal_6 --> -28($fp) - # LOCAL local_class_type_at_Main_internal_7 --> -32($fp) - # local_class_type_at_Main_internal_7 = VCALL local_class_type_at_Main_internal_6 out_string - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_class_type_at_Main_internal_2 --> -12($fp) - # LOCAL local_class_type_at_Main_internal_7 --> -32($fp) - # local_class_type_at_Main_internal_2 = local_class_type_at_Main_internal_7 - lw $t0, -32($fp) - sw $t0, -12($fp) - # GOTO label_END_332 -j label_END_332 -label_NEXT0_333: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) - # Load TDT pointer to type B - la $t0, B__TDT - lw $t1, -4($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -20($fp) - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) - # Update min if 8 < 9 - lw $t0, -20($fp) - lw $t1, -16($fp) - bgtu $t0, $t1, label_NEXT1_334 - # LOCAL local_class_type_at_Main_b_10 --> -44($fp) - # PARAM param_class_type_at_Main_var_0 --> 0($fp) - # local_class_type_at_Main_b_10 = PARAM param_class_type_at_Main_var_0 - lw $t0, 0($fp) - sw $t0, -44($fp) - # LOCAL local_class_type_at_Main_internal_13 --> -56($fp) - # local_class_type_at_Main_internal_13 = SELF - sw $s1, -56($fp) - # LOCAL local_class_type_at_Main_internal_11 --> -48($fp) - # LOCAL local_class_type_at_Main_internal_13 --> -56($fp) - # local_class_type_at_Main_internal_11 = local_class_type_at_Main_internal_13 - lw $t0, -56($fp) - sw $t0, -48($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_class_type_at_Main_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_51 - sw $t0, 12($v0) - li $t0, 20 - sw $t0, 16($v0) - sw $v0, -60($fp) - # ARG local_class_type_at_Main_internal_14 - # LOCAL local_class_type_at_Main_internal_14 --> -60($fp) - lw $t0, -60($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_class_type_at_Main_internal_11 --> -48($fp) - # LOCAL local_class_type_at_Main_internal_12 --> -52($fp) - # local_class_type_at_Main_internal_12 = VCALL local_class_type_at_Main_internal_11 out_string - # Save new self pointer in $s1 - lw $s1, -48($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -52($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_class_type_at_Main_internal_2 --> -12($fp) - # LOCAL local_class_type_at_Main_internal_12 --> -52($fp) - # local_class_type_at_Main_internal_2 = local_class_type_at_Main_internal_12 - lw $t0, -52($fp) - sw $t0, -12($fp) - # GOTO label_END_332 -j label_END_332 -label_NEXT1_334: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) - # Load TDT pointer to type C - la $t0, C__TDT - lw $t1, -4($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -20($fp) - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) - # Update min if 8 < 9 - lw $t0, -20($fp) - lw $t1, -16($fp) - bgtu $t0, $t1, label_NEXT2_335 - # LOCAL local_class_type_at_Main_c_15 --> -64($fp) - # PARAM param_class_type_at_Main_var_0 --> 0($fp) - # local_class_type_at_Main_c_15 = PARAM param_class_type_at_Main_var_0 - lw $t0, 0($fp) - sw $t0, -64($fp) - # LOCAL local_class_type_at_Main_internal_18 --> -76($fp) - # local_class_type_at_Main_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_class_type_at_Main_internal_16 --> -68($fp) - # LOCAL local_class_type_at_Main_internal_18 --> -76($fp) - # local_class_type_at_Main_internal_16 = local_class_type_at_Main_internal_18 - lw $t0, -76($fp) - sw $t0, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_class_type_at_Main_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_52 - sw $t0, 12($v0) - li $t0, 20 - sw $t0, 16($v0) - sw $v0, -80($fp) - # ARG local_class_type_at_Main_internal_19 - # LOCAL local_class_type_at_Main_internal_19 --> -80($fp) - lw $t0, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_class_type_at_Main_internal_16 --> -68($fp) - # LOCAL local_class_type_at_Main_internal_17 --> -72($fp) - # local_class_type_at_Main_internal_17 = VCALL local_class_type_at_Main_internal_16 out_string - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_class_type_at_Main_internal_2 --> -12($fp) - # LOCAL local_class_type_at_Main_internal_17 --> -72($fp) - # local_class_type_at_Main_internal_2 = local_class_type_at_Main_internal_17 - lw $t0, -72($fp) - sw $t0, -12($fp) - # GOTO label_END_332 -j label_END_332 -label_NEXT2_335: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) - # Load TDT pointer to type D - la $t0, D__TDT - lw $t1, -4($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -20($fp) - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) - # Update min if 8 < 9 - lw $t0, -20($fp) - lw $t1, -16($fp) - bgtu $t0, $t1, label_NEXT3_336 - # LOCAL local_class_type_at_Main_d_20 --> -84($fp) - # PARAM param_class_type_at_Main_var_0 --> 0($fp) - # local_class_type_at_Main_d_20 = PARAM param_class_type_at_Main_var_0 - lw $t0, 0($fp) - sw $t0, -84($fp) - # LOCAL local_class_type_at_Main_internal_23 --> -96($fp) - # local_class_type_at_Main_internal_23 = SELF - sw $s1, -96($fp) - # LOCAL local_class_type_at_Main_internal_21 --> -88($fp) - # LOCAL local_class_type_at_Main_internal_23 --> -96($fp) - # local_class_type_at_Main_internal_21 = local_class_type_at_Main_internal_23 - lw $t0, -96($fp) - sw $t0, -88($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_class_type_at_Main_internal_24 --> -100($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_53 - sw $t0, 12($v0) - li $t0, 20 - sw $t0, 16($v0) - sw $v0, -100($fp) - # ARG local_class_type_at_Main_internal_24 - # LOCAL local_class_type_at_Main_internal_24 --> -100($fp) - lw $t0, -100($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_class_type_at_Main_internal_21 --> -88($fp) - # LOCAL local_class_type_at_Main_internal_22 --> -92($fp) - # local_class_type_at_Main_internal_22 = VCALL local_class_type_at_Main_internal_21 out_string - # Save new self pointer in $s1 - lw $s1, -88($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -92($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_class_type_at_Main_internal_2 --> -12($fp) - # LOCAL local_class_type_at_Main_internal_22 --> -92($fp) - # local_class_type_at_Main_internal_2 = local_class_type_at_Main_internal_22 - lw $t0, -92($fp) - sw $t0, -12($fp) - # GOTO label_END_332 -j label_END_332 -label_NEXT3_336: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) - # Load TDT pointer to type E - la $t0, E__TDT - lw $t1, -4($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -20($fp) - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) - # Update min if 8 < 9 - lw $t0, -20($fp) - lw $t1, -16($fp) - bgtu $t0, $t1, label_NEXT4_337 - # LOCAL local_class_type_at_Main_e_25 --> -104($fp) - # PARAM param_class_type_at_Main_var_0 --> 0($fp) - # local_class_type_at_Main_e_25 = PARAM param_class_type_at_Main_var_0 - lw $t0, 0($fp) - sw $t0, -104($fp) - # LOCAL local_class_type_at_Main_internal_28 --> -116($fp) - # local_class_type_at_Main_internal_28 = SELF - sw $s1, -116($fp) - # LOCAL local_class_type_at_Main_internal_26 --> -108($fp) - # LOCAL local_class_type_at_Main_internal_28 --> -116($fp) - # local_class_type_at_Main_internal_26 = local_class_type_at_Main_internal_28 - lw $t0, -116($fp) - sw $t0, -108($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_class_type_at_Main_internal_29 --> -120($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_54 - sw $t0, 12($v0) - li $t0, 20 - sw $t0, 16($v0) - sw $v0, -120($fp) - # ARG local_class_type_at_Main_internal_29 - # LOCAL local_class_type_at_Main_internal_29 --> -120($fp) - lw $t0, -120($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_class_type_at_Main_internal_26 --> -108($fp) - # LOCAL local_class_type_at_Main_internal_27 --> -112($fp) - # local_class_type_at_Main_internal_27 = VCALL local_class_type_at_Main_internal_26 out_string - # Save new self pointer in $s1 - lw $s1, -108($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -112($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_class_type_at_Main_internal_2 --> -12($fp) - # LOCAL local_class_type_at_Main_internal_27 --> -112($fp) - # local_class_type_at_Main_internal_2 = local_class_type_at_Main_internal_27 - lw $t0, -112($fp) - sw $t0, -12($fp) - # GOTO label_END_332 -j label_END_332 -label_NEXT4_337: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) - # Load TDT pointer to type Object - la $t0, Object__TDT - lw $t1, -4($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -20($fp) - # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) - # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) - # Update min if 8 < 9 - lw $t0, -20($fp) - lw $t1, -16($fp) - bgtu $t0, $t1, label_NEXT5_338 - # LOCAL local_class_type_at_Main_o_30 --> -124($fp) - # PARAM param_class_type_at_Main_var_0 --> 0($fp) - # local_class_type_at_Main_o_30 = PARAM param_class_type_at_Main_var_0 - lw $t0, 0($fp) - sw $t0, -124($fp) - # LOCAL local_class_type_at_Main_internal_33 --> -136($fp) - # local_class_type_at_Main_internal_33 = SELF - sw $s1, -136($fp) - # LOCAL local_class_type_at_Main_internal_31 --> -128($fp) - # LOCAL local_class_type_at_Main_internal_33 --> -136($fp) - # local_class_type_at_Main_internal_31 = local_class_type_at_Main_internal_33 - lw $t0, -136($fp) - sw $t0, -128($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_class_type_at_Main_internal_34 --> -140($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_55 - sw $t0, 12($v0) - li $t0, 7 - sw $t0, 16($v0) - sw $v0, -140($fp) - # ARG local_class_type_at_Main_internal_34 - # LOCAL local_class_type_at_Main_internal_34 --> -140($fp) - lw $t0, -140($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_class_type_at_Main_internal_31 --> -128($fp) - # LOCAL local_class_type_at_Main_internal_32 --> -132($fp) - # local_class_type_at_Main_internal_32 = VCALL local_class_type_at_Main_internal_31 out_string - # Save new self pointer in $s1 - lw $s1, -128($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -132($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_class_type_at_Main_internal_2 --> -12($fp) - # LOCAL local_class_type_at_Main_internal_32 --> -132($fp) - # local_class_type_at_Main_internal_2 = local_class_type_at_Main_internal_32 - lw $t0, -132($fp) - sw $t0, -12($fp) - # GOTO label_END_332 -j label_END_332 -label_NEXT5_338: - label_ERROR_331: - # PARAM param_class_type_at_Main_var_0 --> 0($fp) - lw $t0, 0($s1) - sw $t0, 0($fp) - # PARAM param_class_type_at_Main_var_0 --> 0($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, 0($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - label_END_332: -# RETURN local_class_type_at_Main_internal_2 -lw $v0, -12($fp) -# Deallocate stack frame for function function_class_type_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 148 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_print_at_Main implementation. -# @Params: -# 0($fp) = param_print_at_Main_var_0 -function_print_at_Main: - # Allocate stack frame for function function_print_at_Main. - subu $sp, $sp, 60 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 60 - # LOCAL local_print_at_Main_z_0 --> -4($fp) - # local_print_at_Main_z_0 = 0 - li $t0, 0 - sw $t0, -4($fp) - # LOCAL local_print_at_Main_internal_1 --> -8($fp) - # local_print_at_Main_internal_1 = ALLOCATE A2I - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, A2I - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, A2I_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -8($fp) - # LOCAL local_print_at_Main_z_0 --> -4($fp) - # LOCAL local_print_at_Main_internal_1 --> -8($fp) - # local_print_at_Main_z_0 = local_print_at_Main_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # LOCAL local_print_at_Main_internal_4 --> -20($fp) - # local_print_at_Main_internal_4 = SELF - sw $s1, -20($fp) - # LOCAL local_print_at_Main_internal_2 --> -12($fp) - # LOCAL local_print_at_Main_internal_4 --> -20($fp) - # local_print_at_Main_internal_2 = local_print_at_Main_internal_4 - lw $t0, -20($fp) - sw $t0, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Main_internal_5 --> -24($fp) - # LOCAL local_print_at_Main_z_0 --> -4($fp) - # local_print_at_Main_internal_5 = local_print_at_Main_z_0 - lw $t0, -4($fp) - sw $t0, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Main_internal_7 --> -32($fp) - # PARAM param_print_at_Main_var_0 --> 0($fp) - # local_print_at_Main_internal_7 = PARAM param_print_at_Main_var_0 - lw $t0, 0($fp) - sw $t0, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Main_internal_7 --> -32($fp) - # LOCAL local_print_at_Main_internal_8 --> -36($fp) - # local_print_at_Main_internal_8 = VCALL local_print_at_Main_internal_7 value - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 56($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_print_at_Main_internal_8 - # LOCAL local_print_at_Main_internal_8 --> -36($fp) - lw $t0, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Main_internal_5 --> -24($fp) - # LOCAL local_print_at_Main_internal_6 --> -28($fp) - # local_print_at_Main_internal_6 = VCALL local_print_at_Main_internal_5 i2a - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 120($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_print_at_Main_internal_6 - # LOCAL local_print_at_Main_internal_6 --> -28($fp) - lw $t0, -28($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Main_internal_2 --> -12($fp) - # LOCAL local_print_at_Main_internal_3 --> -16($fp) - # local_print_at_Main_internal_3 = VCALL local_print_at_Main_internal_2 out_string - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Main_internal_11 --> -48($fp) - # local_print_at_Main_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_print_at_Main_internal_9 --> -40($fp) - # LOCAL local_print_at_Main_internal_11 --> -48($fp) - # local_print_at_Main_internal_9 = local_print_at_Main_internal_11 - lw $t0, -48($fp) - sw $t0, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Main_internal_12 --> -52($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_56 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -52($fp) - # ARG local_print_at_Main_internal_12 - # LOCAL local_print_at_Main_internal_12 --> -52($fp) - lw $t0, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Main_internal_9 --> -40($fp) - # LOCAL local_print_at_Main_internal_10 --> -44($fp) - # local_print_at_Main_internal_10 = VCALL local_print_at_Main_internal_9 out_string - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_at_Main_internal_10 - lw $v0, -44($fp) - # Deallocate stack frame for function function_print_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 60 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 1008 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 1008 - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # local_main_at_Main_internal_0 = ALLOCATE A - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, A - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, A_start - sw $t0, 4($v0) - # Load type offset - li $t0, 24 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __A__attrib__var__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - lw $t0, -4($fp) - sw $t0, 16($s1) - label_WHILE_339: - # local_main_at_Main_internal_2 = GETATTRIBUTE flag Main - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - lw $t0, 24($s1) - sw $t0, -12($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # Obtain value from -12($fp) - lw $v0, -12($fp) - lw $v0, 12($v0) - sw $v0, -8($fp) - # IF_ZERO local_main_at_Main_internal_1 GOTO label_WHILE_END_340 - # IF_ZERO local_main_at_Main_internal_1 GOTO label_WHILE_END_340 - lw $t0, -8($fp) - beq $t0, 0, label_WHILE_END_340 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = SELF - sw $s1, -24($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 - lw $t0, -24($fp) - sw $t0, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_57 - sw $t0, 12($v0) - li $t0, 7 - sw $t0, 16($v0) - sw $v0, -28($fp) - # ARG local_main_at_Main_internal_6 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - lw $t0, -28($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 out_string - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = SELF - sw $s1, -40($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t0, -40($fp) - sw $t0, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_main_at_Main_internal_10 = GETATTRIBUTE avar Main - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - lw $t0, 16($s1) - sw $t0, -44($fp) - # ARG local_main_at_Main_internal_10 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - lw $t0, -44($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 print - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 - lw $t0, -64($fp) - sw $t0, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_main_at_Main_internal_18 = GETATTRIBUTE avar Main - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - lw $t0, 16($s1) - sw $t0, -76($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 - lw $t0, -76($fp) - sw $t0, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 value - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 56($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_17 - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - lw $t0, -72($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 is_even - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # Obtain value from -60($fp) - lw $v0, -60($fp) - lw $v0, 12($v0) - sw $v0, -48($fp) - # IF_ZERO local_main_at_Main_internal_11 GOTO label_FALSEIF_341 - # IF_ZERO local_main_at_Main_internal_11 GOTO label_FALSEIF_341 - lw $t0, -48($fp) - beq $t0, 0, label_FALSEIF_341 - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # local_main_at_Main_internal_21 = SELF - sw $s1, -88($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 - lw $t0, -88($fp) - sw $t0, -80($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_58 - sw $t0, 12($v0) - li $t0, 9 - sw $t0, 16($v0) - sw $v0, -92($fp) - # ARG local_main_at_Main_internal_22 - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - lw $t0, -92($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 out_string - # Save new self pointer in $s1 - lw $s1, -80($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -84($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_12 = local_main_at_Main_internal_20 - lw $t0, -84($fp) - sw $t0, -52($fp) - # GOTO label_ENDIF_342 -j label_ENDIF_342 -label_FALSEIF_341: - # LOCAL local_main_at_Main_internal_25 --> -104($fp) - # local_main_at_Main_internal_25 = SELF - sw $s1, -104($fp) - # LOCAL local_main_at_Main_internal_23 --> -96($fp) - # LOCAL local_main_at_Main_internal_25 --> -104($fp) - # local_main_at_Main_internal_23 = local_main_at_Main_internal_25 - lw $t0, -104($fp) - sw $t0, -96($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_26 --> -108($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_59 - sw $t0, 12($v0) - li $t0, 8 - sw $t0, 16($v0) - sw $v0, -108($fp) - # ARG local_main_at_Main_internal_26 - # LOCAL local_main_at_Main_internal_26 --> -108($fp) - lw $t0, -108($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_23 --> -96($fp) - # LOCAL local_main_at_Main_internal_24 --> -100($fp) - # local_main_at_Main_internal_24 = VCALL local_main_at_Main_internal_23 out_string - # Save new self pointer in $s1 - lw $s1, -96($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -100($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_24 --> -100($fp) - # local_main_at_Main_internal_12 = local_main_at_Main_internal_24 - lw $t0, -100($fp) - sw $t0, -52($fp) - label_ENDIF_342: -# LOCAL local_main_at_Main_internal_29 --> -120($fp) -# local_main_at_Main_internal_29 = SELF -sw $s1, -120($fp) -# LOCAL local_main_at_Main_internal_27 --> -112($fp) -# LOCAL local_main_at_Main_internal_29 --> -120($fp) -# local_main_at_Main_internal_27 = local_main_at_Main_internal_29 -lw $t0, -120($fp) -sw $t0, -112($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_main_at_Main_internal_30 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_30 --> -124($fp) -lw $t0, 16($s1) -sw $t0, -124($fp) -# ARG local_main_at_Main_internal_30 -# LOCAL local_main_at_Main_internal_30 --> -124($fp) -lw $t0, -124($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_27 --> -112($fp) -# LOCAL local_main_at_Main_internal_28 --> -116($fp) -# local_main_at_Main_internal_28 = VCALL local_main_at_Main_internal_27 class_type -# Save new self pointer in $s1 -lw $s1, -112($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 76($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -116($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_33 --> -136($fp) -# local_main_at_Main_internal_33 = SELF -sw $s1, -136($fp) -# LOCAL local_main_at_Main_internal_31 --> -128($fp) -# LOCAL local_main_at_Main_internal_33 --> -136($fp) -# local_main_at_Main_internal_31 = local_main_at_Main_internal_33 -lw $t0, -136($fp) -sw $t0, -128($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_31 --> -128($fp) -# LOCAL local_main_at_Main_internal_32 --> -132($fp) -# local_main_at_Main_internal_32 = VCALL local_main_at_Main_internal_31 menu -# Save new self pointer in $s1 -lw $s1, -128($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 100($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -132($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# -# LOCAL local_main_at_Main_internal_32 --> -132($fp) -lw $t0, -132($fp) -sw $t0, 12($s1) -# local_main_at_Main_internal_38 = GETATTRIBUTE char Main -# LOCAL local_main_at_Main_internal_38 --> -156($fp) -lw $t0, 12($s1) -sw $t0, -156($fp) -# LOCAL local_main_at_Main_internal_39 --> -160($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_60 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -160($fp) -# IF_ZERO local_main_at_Main_internal_38 GOTO label_FALSE_345 -# IF_ZERO local_main_at_Main_internal_38 GOTO label_FALSE_345 -lw $t0, -156($fp) -beq $t0, 0, label_FALSE_345 -# IF_ZERO local_main_at_Main_internal_39 GOTO label_FALSE_345 -# IF_ZERO local_main_at_Main_internal_39 GOTO label_FALSE_345 -lw $t0, -160($fp) -beq $t0, 0, label_FALSE_345 -# LOCAL local_main_at_Main_internal_37 --> -152($fp) -# LOCAL local_main_at_Main_internal_38 --> -156($fp) -# Comparing -156($fp) type with String -la $v0, String -lw $a0, -156($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -152($fp) -# IF_ZERO local_main_at_Main_internal_37 GOTO label_COMPARE_STRING_348 -# IF_ZERO local_main_at_Main_internal_37 GOTO label_COMPARE_STRING_348 -lw $t0, -152($fp) -beq $t0, 0, label_COMPARE_STRING_348 -# LOCAL local_main_at_Main_internal_37 --> -152($fp) -# LOCAL local_main_at_Main_internal_38 --> -156($fp) -# Comparing -156($fp) type with Bool -la $v0, Bool -lw $a0, -156($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -152($fp) -# IF_ZERO local_main_at_Main_internal_37 GOTO label_COMPARE_BY_VALUE_349 -# IF_ZERO local_main_at_Main_internal_37 GOTO label_COMPARE_BY_VALUE_349 -lw $t0, -152($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_349 -# LOCAL local_main_at_Main_internal_37 --> -152($fp) -# LOCAL local_main_at_Main_internal_38 --> -156($fp) -# Comparing -156($fp) type with Int -la $v0, Int -lw $a0, -156($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -152($fp) -# IF_ZERO local_main_at_Main_internal_37 GOTO label_COMPARE_BY_VALUE_349 -# IF_ZERO local_main_at_Main_internal_37 GOTO label_COMPARE_BY_VALUE_349 -lw $t0, -152($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_349 -# LOCAL local_main_at_Main_internal_37 --> -152($fp) -# LOCAL local_main_at_Main_internal_38 --> -156($fp) -# LOCAL local_main_at_Main_internal_39 --> -160($fp) -# Load pointers and SUB -lw $a0, -156($fp) -lw $a1, -160($fp) -sub $a0, $a0, $a1 -sw $a0, -152($fp) -# IF_ZERO local_main_at_Main_internal_37 GOTO label_TRUE_346 -# IF_ZERO local_main_at_Main_internal_37 GOTO label_TRUE_346 -lw $t0, -152($fp) -beq $t0, 0, label_TRUE_346 -# GOTO label_FALSE_345 -j label_FALSE_345 -label_COMPARE_BY_VALUE_349: - # LOCAL local_main_at_Main_internal_37 --> -152($fp) - # LOCAL local_main_at_Main_internal_38 --> -156($fp) - # LOCAL local_main_at_Main_internal_39 --> -160($fp) - lw $a0, -156($fp) - lw $a1, -160($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -152($fp) - # IF_ZERO local_main_at_Main_internal_37 GOTO label_TRUE_346 - # IF_ZERO local_main_at_Main_internal_37 GOTO label_TRUE_346 - lw $t0, -152($fp) - beq $t0, 0, label_TRUE_346 - # GOTO label_FALSE_345 - j label_FALSE_345 - label_COMPARE_STRING_348: - # LOCAL local_main_at_Main_internal_37 --> -152($fp) - # LOCAL local_main_at_Main_internal_38 --> -156($fp) - # LOCAL local_main_at_Main_internal_39 --> -160($fp) - # Load strings for comparison - lw $v0, -156($fp) - lw $v1, -160($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -152($fp) - # IF_ZERO local_main_at_Main_internal_37 GOTO label_CONTINUE_350 - # IF_ZERO local_main_at_Main_internal_37 GOTO label_CONTINUE_350 - lw $t0, -152($fp) - beq $t0, 0, label_CONTINUE_350 - # GOTO label_FALSE_345 - j label_FALSE_345 - label_CONTINUE_350: - # LOCAL local_main_at_Main_internal_37 --> -152($fp) - # LOCAL local_main_at_Main_internal_38 --> -156($fp) - # LOCAL local_main_at_Main_internal_39 --> -160($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -156($fp) - lw $v1, -160($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_351: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_352 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_351 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_352: - # Store result - sw $a2, -152($fp) - # IF_ZERO local_main_at_Main_internal_37 GOTO label_TRUE_346 - # IF_ZERO local_main_at_Main_internal_37 GOTO label_TRUE_346 - lw $t0, -152($fp) - beq $t0, 0, label_TRUE_346 - label_FALSE_345: - # LOCAL local_main_at_Main_internal_36 --> -148($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -148($fp) - # GOTO label_END_347 -j label_END_347 -label_TRUE_346: - # LOCAL local_main_at_Main_internal_36 --> -148($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -148($fp) - label_END_347: -# LOCAL local_main_at_Main_internal_34 --> -140($fp) -# LOCAL local_main_at_Main_internal_36 --> -148($fp) -# Obtain value from -148($fp) -lw $v0, -148($fp) -lw $v0, 12($v0) -sw $v0, -140($fp) -# IF_ZERO local_main_at_Main_internal_34 GOTO label_FALSEIF_343 -# IF_ZERO local_main_at_Main_internal_34 GOTO label_FALSEIF_343 -lw $t0, -140($fp) -beq $t0, 0, label_FALSEIF_343 -# LOCAL local_main_at_Main_internal_42 --> -172($fp) -# local_main_at_Main_internal_42 = ALLOCATE A -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type name -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, A -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, A_start -sw $t0, 4($v0) -# Load type offset -li $t0, 24 -sw $t0, 8($v0) -move $t1, $v0 -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -move $s1, $v0 -# Push register t1 into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -jal __A__attrib__var__init -# Pop 4 bytes from stack into register t1 -lw $t1, 0($sp) -addu $sp, $sp, 4 -sw $v0, 12($t1) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -sw $t1, -172($fp) -# LOCAL local_main_at_Main_internal_40 --> -164($fp) -# LOCAL local_main_at_Main_internal_42 --> -172($fp) -# local_main_at_Main_internal_40 = local_main_at_Main_internal_42 -lw $t0, -172($fp) -sw $t0, -164($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_45 --> -184($fp) -# local_main_at_Main_internal_45 = SELF -sw $s1, -184($fp) -# LOCAL local_main_at_Main_internal_43 --> -176($fp) -# LOCAL local_main_at_Main_internal_45 --> -184($fp) -# local_main_at_Main_internal_43 = local_main_at_Main_internal_45 -lw $t0, -184($fp) -sw $t0, -176($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_43 --> -176($fp) -# LOCAL local_main_at_Main_internal_44 --> -180($fp) -# local_main_at_Main_internal_44 = VCALL local_main_at_Main_internal_43 get_int -# Save new self pointer in $s1 -lw $s1, -176($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 108($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -180($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_44 -# LOCAL local_main_at_Main_internal_44 --> -180($fp) -lw $t0, -180($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_40 --> -164($fp) -# LOCAL local_main_at_Main_internal_41 --> -168($fp) -# local_main_at_Main_internal_41 = VCALL local_main_at_Main_internal_40 set_var -# Save new self pointer in $s1 -lw $s1, -164($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 116($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -168($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# -# LOCAL local_main_at_Main_internal_41 --> -168($fp) -lw $t0, -168($fp) -sw $t0, 20($s1) -# LOCAL local_main_at_Main_internal_48 --> -196($fp) -# local_main_at_Main_internal_48 = ALLOCATE B -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type name -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, B -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, B_start -sw $t0, 4($v0) -# Load type offset -li $t0, 28 -sw $t0, 8($v0) -move $t1, $v0 -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -move $s1, $v0 -# Push register t1 into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -jal __A__attrib__var__init -# Pop 4 bytes from stack into register t1 -lw $t1, 0($sp) -addu $sp, $sp, 4 -sw $v0, 12($t1) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -sw $t1, -196($fp) -# LOCAL local_main_at_Main_internal_46 --> -188($fp) -# LOCAL local_main_at_Main_internal_48 --> -196($fp) -# local_main_at_Main_internal_46 = local_main_at_Main_internal_48 -lw $t0, -196($fp) -sw $t0, -188($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_main_at_Main_internal_51 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_51 --> -208($fp) -lw $t0, 16($s1) -sw $t0, -208($fp) -# LOCAL local_main_at_Main_internal_49 --> -200($fp) -# LOCAL local_main_at_Main_internal_51 --> -208($fp) -# local_main_at_Main_internal_49 = local_main_at_Main_internal_51 -lw $t0, -208($fp) -sw $t0, -200($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_49 --> -200($fp) -# LOCAL local_main_at_Main_internal_50 --> -204($fp) -# local_main_at_Main_internal_50 = VCALL local_main_at_Main_internal_49 value -# Save new self pointer in $s1 -lw $s1, -200($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 56($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -204($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_50 -# LOCAL local_main_at_Main_internal_50 --> -204($fp) -lw $t0, -204($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# local_main_at_Main_internal_54 = GETATTRIBUTE a_var Main -# LOCAL local_main_at_Main_internal_54 --> -220($fp) -lw $t0, 20($s1) -sw $t0, -220($fp) -# LOCAL local_main_at_Main_internal_52 --> -212($fp) -# LOCAL local_main_at_Main_internal_54 --> -220($fp) -# local_main_at_Main_internal_52 = local_main_at_Main_internal_54 -lw $t0, -220($fp) -sw $t0, -212($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_52 --> -212($fp) -# LOCAL local_main_at_Main_internal_53 --> -216($fp) -# local_main_at_Main_internal_53 = VCALL local_main_at_Main_internal_52 value -# Save new self pointer in $s1 -lw $s1, -212($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 56($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -216($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_53 -# LOCAL local_main_at_Main_internal_53 --> -216($fp) -lw $t0, -216($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_46 --> -188($fp) -# LOCAL local_main_at_Main_internal_47 --> -192($fp) -# local_main_at_Main_internal_47 = VCALL local_main_at_Main_internal_46 method2 -# Save new self pointer in $s1 -lw $s1, -188($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 8($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -192($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# -# LOCAL local_main_at_Main_internal_47 --> -192($fp) -lw $t0, -192($fp) -sw $t0, 16($s1) -# LOCAL local_main_at_Main_internal_35 --> -144($fp) -# local_main_at_Main_internal_35 = -# GOTO label_ENDIF_344 -j label_ENDIF_344 -label_FALSEIF_343: - # local_main_at_Main_internal_59 = GETATTRIBUTE char Main - # LOCAL local_main_at_Main_internal_59 --> -240($fp) - lw $t0, 12($s1) - sw $t0, -240($fp) - # LOCAL local_main_at_Main_internal_60 --> -244($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_61 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -244($fp) - # IF_ZERO local_main_at_Main_internal_59 GOTO label_FALSE_355 - # IF_ZERO local_main_at_Main_internal_59 GOTO label_FALSE_355 - lw $t0, -240($fp) - beq $t0, 0, label_FALSE_355 - # IF_ZERO local_main_at_Main_internal_60 GOTO label_FALSE_355 - # IF_ZERO local_main_at_Main_internal_60 GOTO label_FALSE_355 - lw $t0, -244($fp) - beq $t0, 0, label_FALSE_355 - # LOCAL local_main_at_Main_internal_58 --> -236($fp) - # LOCAL local_main_at_Main_internal_59 --> -240($fp) - # Comparing -240($fp) type with String - la $v0, String - lw $a0, -240($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -236($fp) - # IF_ZERO local_main_at_Main_internal_58 GOTO label_COMPARE_STRING_358 - # IF_ZERO local_main_at_Main_internal_58 GOTO label_COMPARE_STRING_358 - lw $t0, -236($fp) - beq $t0, 0, label_COMPARE_STRING_358 - # LOCAL local_main_at_Main_internal_58 --> -236($fp) - # LOCAL local_main_at_Main_internal_59 --> -240($fp) - # Comparing -240($fp) type with Bool - la $v0, Bool - lw $a0, -240($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -236($fp) - # IF_ZERO local_main_at_Main_internal_58 GOTO label_COMPARE_BY_VALUE_359 - # IF_ZERO local_main_at_Main_internal_58 GOTO label_COMPARE_BY_VALUE_359 - lw $t0, -236($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_359 - # LOCAL local_main_at_Main_internal_58 --> -236($fp) - # LOCAL local_main_at_Main_internal_59 --> -240($fp) - # Comparing -240($fp) type with Int - la $v0, Int - lw $a0, -240($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -236($fp) - # IF_ZERO local_main_at_Main_internal_58 GOTO label_COMPARE_BY_VALUE_359 - # IF_ZERO local_main_at_Main_internal_58 GOTO label_COMPARE_BY_VALUE_359 - lw $t0, -236($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_359 - # LOCAL local_main_at_Main_internal_58 --> -236($fp) - # LOCAL local_main_at_Main_internal_59 --> -240($fp) - # LOCAL local_main_at_Main_internal_60 --> -244($fp) - # Load pointers and SUB - lw $a0, -240($fp) - lw $a1, -244($fp) - sub $a0, $a0, $a1 - sw $a0, -236($fp) - # IF_ZERO local_main_at_Main_internal_58 GOTO label_TRUE_356 - # IF_ZERO local_main_at_Main_internal_58 GOTO label_TRUE_356 - lw $t0, -236($fp) - beq $t0, 0, label_TRUE_356 - # GOTO label_FALSE_355 - j label_FALSE_355 - label_COMPARE_BY_VALUE_359: - # LOCAL local_main_at_Main_internal_58 --> -236($fp) - # LOCAL local_main_at_Main_internal_59 --> -240($fp) - # LOCAL local_main_at_Main_internal_60 --> -244($fp) - lw $a0, -240($fp) - lw $a1, -244($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -236($fp) - # IF_ZERO local_main_at_Main_internal_58 GOTO label_TRUE_356 - # IF_ZERO local_main_at_Main_internal_58 GOTO label_TRUE_356 - lw $t0, -236($fp) - beq $t0, 0, label_TRUE_356 - # GOTO label_FALSE_355 - j label_FALSE_355 - label_COMPARE_STRING_358: - # LOCAL local_main_at_Main_internal_58 --> -236($fp) - # LOCAL local_main_at_Main_internal_59 --> -240($fp) - # LOCAL local_main_at_Main_internal_60 --> -244($fp) - # Load strings for comparison - lw $v0, -240($fp) - lw $v1, -244($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -236($fp) - # IF_ZERO local_main_at_Main_internal_58 GOTO label_CONTINUE_360 - # IF_ZERO local_main_at_Main_internal_58 GOTO label_CONTINUE_360 - lw $t0, -236($fp) - beq $t0, 0, label_CONTINUE_360 - # GOTO label_FALSE_355 - j label_FALSE_355 - label_CONTINUE_360: - # LOCAL local_main_at_Main_internal_58 --> -236($fp) - # LOCAL local_main_at_Main_internal_59 --> -240($fp) - # LOCAL local_main_at_Main_internal_60 --> -244($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -240($fp) - lw $v1, -244($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_361: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_362 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_361 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_362: - # Store result - sw $a2, -236($fp) - # IF_ZERO local_main_at_Main_internal_58 GOTO label_TRUE_356 - # IF_ZERO local_main_at_Main_internal_58 GOTO label_TRUE_356 - lw $t0, -236($fp) - beq $t0, 0, label_TRUE_356 - label_FALSE_355: - # LOCAL local_main_at_Main_internal_57 --> -232($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -232($fp) - # GOTO label_END_357 -j label_END_357 -label_TRUE_356: - # LOCAL local_main_at_Main_internal_57 --> -232($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -232($fp) - label_END_357: -# LOCAL local_main_at_Main_internal_55 --> -224($fp) -# LOCAL local_main_at_Main_internal_57 --> -232($fp) -# Obtain value from -232($fp) -lw $v0, -232($fp) -lw $v0, 12($v0) -sw $v0, -224($fp) -# IF_ZERO local_main_at_Main_internal_55 GOTO label_FALSEIF_353 -# IF_ZERO local_main_at_Main_internal_55 GOTO label_FALSEIF_353 -lw $t0, -224($fp) -beq $t0, 0, label_FALSEIF_353 -# local_main_at_Main_internal_61 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_61 --> -248($fp) -lw $t0, 16($s1) -sw $t0, -248($fp) -# LOCAL local_main_at_Main_internal_61 --> -248($fp) -# LOCAL local_main_at_Main_internal_62 --> -252($fp) -# local_main_at_Main_internal_62 = TYPEOF local_main_at_Main_internal_61 -lw $t0, -248($fp) -# Load pointer to type offset -lw $t1, 8($t0) -sw $t1, -252($fp) -# LOCAL local_main_at_Main_internal_65 --> -264($fp) -# local_main_at_Main_internal_65 = 15 -li $t0, 15 -sw $t0, -264($fp) -# local_main_at_Main_internal_66 = TYPE_DISTANCE C -# LOCAL local_main_at_Main_internal_66 --> -268($fp) -# LOCAL local_main_at_Main_internal_62 --> -252($fp) -# Load TDT pointer to type C -la $t0, C__TDT -lw $t1, -252($fp) -addu $t0, $t0, $t1 -# Save distance -lw $t1, 0($t0) -sw $t1, -268($fp) -# LOCAL local_main_at_Main_internal_66 --> -268($fp) -# LOCAL local_main_at_Main_internal_65 --> -264($fp) -# Update min if 8 < 9 -lw $t0, -268($fp) -lw $t1, -264($fp) -bgtu $t0, $t1, label_Not_min0_363 -# LOCAL local_main_at_Main_internal_65 --> -264($fp) -# LOCAL local_main_at_Main_internal_66 --> -268($fp) -# local_main_at_Main_internal_65 = local_main_at_Main_internal_66 -lw $t0, -268($fp) -sw $t0, -264($fp) -label_Not_min0_363: - # local_main_at_Main_internal_66 = TYPE_DISTANCE A - # LOCAL local_main_at_Main_internal_66 --> -268($fp) - # LOCAL local_main_at_Main_internal_62 --> -252($fp) - # Load TDT pointer to type A - la $t0, A__TDT - lw $t1, -252($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -268($fp) - # LOCAL local_main_at_Main_internal_66 --> -268($fp) - # LOCAL local_main_at_Main_internal_65 --> -264($fp) - # Update min if 8 < 9 - lw $t0, -268($fp) - lw $t1, -264($fp) - bgtu $t0, $t1, label_Not_min1_364 - # LOCAL local_main_at_Main_internal_65 --> -264($fp) - # LOCAL local_main_at_Main_internal_66 --> -268($fp) - # local_main_at_Main_internal_65 = local_main_at_Main_internal_66 - lw $t0, -268($fp) - sw $t0, -264($fp) - label_Not_min1_364: - # local_main_at_Main_internal_66 = TYPE_DISTANCE Object - # LOCAL local_main_at_Main_internal_66 --> -268($fp) - # LOCAL local_main_at_Main_internal_62 --> -252($fp) - # Load TDT pointer to type Object - la $t0, Object__TDT - lw $t1, -252($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -268($fp) - # LOCAL local_main_at_Main_internal_66 --> -268($fp) - # LOCAL local_main_at_Main_internal_65 --> -264($fp) - # Update min if 8 < 9 - lw $t0, -268($fp) - lw $t1, -264($fp) - bgtu $t0, $t1, label_Not_min2_365 - # LOCAL local_main_at_Main_internal_65 --> -264($fp) - # LOCAL local_main_at_Main_internal_66 --> -268($fp) - # local_main_at_Main_internal_65 = local_main_at_Main_internal_66 - lw $t0, -268($fp) - sw $t0, -264($fp) - label_Not_min2_365: - # LOCAL local_main_at_Main_internal_66 --> -268($fp) - # local_main_at_Main_internal_66 = 15 - li $t0, 15 - sw $t0, -268($fp) - # LOCAL local_main_at_Main_internal_63 --> -256($fp) - # LOCAL local_main_at_Main_internal_66 --> -268($fp) - # LOCAL local_main_at_Main_internal_65 --> -264($fp) - # Load pointers and SUB - lw $a0, -268($fp) - lw $a1, -264($fp) - sub $a0, $a0, $a1 - sw $a0, -256($fp) - # IF_ZERO local_main_at_Main_internal_63 GOTO label_ERROR_366 - # IF_ZERO local_main_at_Main_internal_63 GOTO label_ERROR_366 - lw $t0, -256($fp) - beq $t0, 0, label_ERROR_366 - # local_main_at_Main_internal_66 = TYPE_DISTANCE C - # LOCAL local_main_at_Main_internal_66 --> -268($fp) - # LOCAL local_main_at_Main_internal_62 --> -252($fp) - # Load TDT pointer to type C - la $t0, C__TDT - lw $t1, -252($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -268($fp) - # LOCAL local_main_at_Main_internal_66 --> -268($fp) - # LOCAL local_main_at_Main_internal_65 --> -264($fp) - # Update min if 8 < 9 - lw $t0, -268($fp) - lw $t1, -264($fp) - bgtu $t0, $t1, label_NEXT0_368 - # LOCAL local_main_at_Main_c_67 --> -272($fp) - # LOCAL local_main_at_Main_internal_61 --> -248($fp) - # local_main_at_Main_c_67 = local_main_at_Main_internal_61 - lw $t0, -248($fp) - sw $t0, -272($fp) - # LOCAL local_main_at_Main_internal_68 --> -276($fp) - # LOCAL local_main_at_Main_c_67 --> -272($fp) - # local_main_at_Main_internal_68 = local_main_at_Main_c_67 - lw $t0, -272($fp) - sw $t0, -276($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_70 --> -284($fp) - # LOCAL local_main_at_Main_c_67 --> -272($fp) - # local_main_at_Main_internal_70 = local_main_at_Main_c_67 - lw $t0, -272($fp) - sw $t0, -284($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_70 --> -284($fp) - # LOCAL local_main_at_Main_internal_71 --> -288($fp) - # local_main_at_Main_internal_71 = VCALL local_main_at_Main_internal_70 value - # Save new self pointer in $s1 - lw $s1, -284($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 56($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -288($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_71 - # LOCAL local_main_at_Main_internal_71 --> -288($fp) - lw $t0, -288($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_68 --> -276($fp) - # LOCAL local_main_at_Main_internal_69 --> -280($fp) - # local_main_at_Main_internal_69 = VCALL local_main_at_Main_internal_68 method6 - # Save new self pointer in $s1 - lw $s1, -276($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 16($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -280($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_main_at_Main_internal_69 --> -280($fp) - lw $t0, -280($fp) - sw $t0, 16($s1) - # LOCAL local_main_at_Main_internal_64 --> -260($fp) - # local_main_at_Main_internal_64 = - # GOTO label_END_367 -j label_END_367 -label_NEXT0_368: - # local_main_at_Main_internal_66 = TYPE_DISTANCE A - # LOCAL local_main_at_Main_internal_66 --> -268($fp) - # LOCAL local_main_at_Main_internal_62 --> -252($fp) - # Load TDT pointer to type A - la $t0, A__TDT - lw $t1, -252($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -268($fp) - # LOCAL local_main_at_Main_internal_66 --> -268($fp) - # LOCAL local_main_at_Main_internal_65 --> -264($fp) - # Update min if 8 < 9 - lw $t0, -268($fp) - lw $t1, -264($fp) - bgtu $t0, $t1, label_NEXT1_369 - # LOCAL local_main_at_Main_a_72 --> -292($fp) - # LOCAL local_main_at_Main_internal_61 --> -248($fp) - # local_main_at_Main_a_72 = local_main_at_Main_internal_61 - lw $t0, -248($fp) - sw $t0, -292($fp) - # LOCAL local_main_at_Main_internal_73 --> -296($fp) - # LOCAL local_main_at_Main_a_72 --> -292($fp) - # local_main_at_Main_internal_73 = local_main_at_Main_a_72 - lw $t0, -292($fp) - sw $t0, -296($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_75 --> -304($fp) - # LOCAL local_main_at_Main_a_72 --> -292($fp) - # local_main_at_Main_internal_75 = local_main_at_Main_a_72 - lw $t0, -292($fp) - sw $t0, -304($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_75 --> -304($fp) - # LOCAL local_main_at_Main_internal_76 --> -308($fp) - # local_main_at_Main_internal_76 = VCALL local_main_at_Main_internal_75 value - # Save new self pointer in $s1 - lw $s1, -304($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 56($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -308($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_76 - # LOCAL local_main_at_Main_internal_76 --> -308($fp) - lw $t0, -308($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_73 --> -296($fp) - # LOCAL local_main_at_Main_internal_74 --> -300($fp) - # local_main_at_Main_internal_74 = VCALL local_main_at_Main_internal_73 method3 - # Save new self pointer in $s1 - lw $s1, -296($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 48($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -300($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_main_at_Main_internal_74 --> -300($fp) - lw $t0, -300($fp) - sw $t0, 16($s1) - # LOCAL local_main_at_Main_internal_64 --> -260($fp) - # local_main_at_Main_internal_64 = - # GOTO label_END_367 -j label_END_367 -label_NEXT1_369: - # local_main_at_Main_internal_66 = TYPE_DISTANCE Object - # LOCAL local_main_at_Main_internal_66 --> -268($fp) - # LOCAL local_main_at_Main_internal_62 --> -252($fp) - # Load TDT pointer to type Object - la $t0, Object__TDT - lw $t1, -252($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -268($fp) - # LOCAL local_main_at_Main_internal_66 --> -268($fp) - # LOCAL local_main_at_Main_internal_65 --> -264($fp) - # Update min if 8 < 9 - lw $t0, -268($fp) - lw $t1, -264($fp) - bgtu $t0, $t1, label_NEXT2_370 - # LOCAL local_main_at_Main_o_77 --> -312($fp) - # LOCAL local_main_at_Main_internal_61 --> -248($fp) - # local_main_at_Main_o_77 = local_main_at_Main_internal_61 - lw $t0, -248($fp) - sw $t0, -312($fp) - # LOCAL local_main_at_Main_internal_80 --> -324($fp) - # local_main_at_Main_internal_80 = SELF - sw $s1, -324($fp) - # LOCAL local_main_at_Main_internal_78 --> -316($fp) - # LOCAL local_main_at_Main_internal_80 --> -324($fp) - # local_main_at_Main_internal_78 = local_main_at_Main_internal_80 - lw $t0, -324($fp) - sw $t0, -316($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_81 --> -328($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_62 - sw $t0, 12($v0) - li $t0, 7 - sw $t0, 16($v0) - sw $v0, -328($fp) - # ARG local_main_at_Main_internal_81 - # LOCAL local_main_at_Main_internal_81 --> -328($fp) - lw $t0, -328($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_78 --> -316($fp) - # LOCAL local_main_at_Main_internal_79 --> -320($fp) - # local_main_at_Main_internal_79 = VCALL local_main_at_Main_internal_78 out_string - # Save new self pointer in $s1 - lw $s1, -316($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -320($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_84 --> -340($fp) - # local_main_at_Main_internal_84 = SELF - sw $s1, -340($fp) - # LOCAL local_main_at_Main_internal_82 --> -332($fp) - # LOCAL local_main_at_Main_internal_84 --> -340($fp) - # local_main_at_Main_internal_82 = local_main_at_Main_internal_84 - lw $t0, -340($fp) - sw $t0, -332($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_82 --> -332($fp) - # LOCAL local_main_at_Main_internal_83 --> -336($fp) - # local_main_at_Main_internal_83 = VCALL local_main_at_Main_internal_82 abort - # Save new self pointer in $s1 - lw $s1, -332($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 124($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -336($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_85 --> -344($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -344($fp) - # LOCAL local_main_at_Main_internal_64 --> -260($fp) - # LOCAL local_main_at_Main_internal_85 --> -344($fp) - # local_main_at_Main_internal_64 = local_main_at_Main_internal_85 - lw $t0, -344($fp) - sw $t0, -260($fp) - # GOTO label_END_367 -j label_END_367 -label_NEXT2_370: - label_ERROR_366: - # LOCAL local_main_at_Main_internal_61 --> -248($fp) - lw $t0, 0($s1) - sw $t0, -248($fp) - # LOCAL local_main_at_Main_internal_61 --> -248($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -248($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - label_END_367: -# LOCAL local_main_at_Main_internal_56 --> -228($fp) -# LOCAL local_main_at_Main_internal_64 --> -260($fp) -# local_main_at_Main_internal_56 = local_main_at_Main_internal_64 -lw $t0, -260($fp) -sw $t0, -228($fp) -# GOTO label_ENDIF_354 -j label_ENDIF_354 -label_FALSEIF_353: - # local_main_at_Main_internal_90 = GETATTRIBUTE char Main - # LOCAL local_main_at_Main_internal_90 --> -364($fp) - lw $t0, 12($s1) - sw $t0, -364($fp) - # LOCAL local_main_at_Main_internal_91 --> -368($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_63 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -368($fp) - # IF_ZERO local_main_at_Main_internal_90 GOTO label_FALSE_373 - # IF_ZERO local_main_at_Main_internal_90 GOTO label_FALSE_373 - lw $t0, -364($fp) - beq $t0, 0, label_FALSE_373 - # IF_ZERO local_main_at_Main_internal_91 GOTO label_FALSE_373 - # IF_ZERO local_main_at_Main_internal_91 GOTO label_FALSE_373 - lw $t0, -368($fp) - beq $t0, 0, label_FALSE_373 - # LOCAL local_main_at_Main_internal_89 --> -360($fp) - # LOCAL local_main_at_Main_internal_90 --> -364($fp) - # Comparing -364($fp) type with String - la $v0, String - lw $a0, -364($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -360($fp) - # IF_ZERO local_main_at_Main_internal_89 GOTO label_COMPARE_STRING_376 - # IF_ZERO local_main_at_Main_internal_89 GOTO label_COMPARE_STRING_376 - lw $t0, -360($fp) - beq $t0, 0, label_COMPARE_STRING_376 - # LOCAL local_main_at_Main_internal_89 --> -360($fp) - # LOCAL local_main_at_Main_internal_90 --> -364($fp) - # Comparing -364($fp) type with Bool - la $v0, Bool - lw $a0, -364($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -360($fp) - # IF_ZERO local_main_at_Main_internal_89 GOTO label_COMPARE_BY_VALUE_377 - # IF_ZERO local_main_at_Main_internal_89 GOTO label_COMPARE_BY_VALUE_377 - lw $t0, -360($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_377 - # LOCAL local_main_at_Main_internal_89 --> -360($fp) - # LOCAL local_main_at_Main_internal_90 --> -364($fp) - # Comparing -364($fp) type with Int - la $v0, Int - lw $a0, -364($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -360($fp) - # IF_ZERO local_main_at_Main_internal_89 GOTO label_COMPARE_BY_VALUE_377 - # IF_ZERO local_main_at_Main_internal_89 GOTO label_COMPARE_BY_VALUE_377 - lw $t0, -360($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_377 - # LOCAL local_main_at_Main_internal_89 --> -360($fp) - # LOCAL local_main_at_Main_internal_90 --> -364($fp) - # LOCAL local_main_at_Main_internal_91 --> -368($fp) - # Load pointers and SUB - lw $a0, -364($fp) - lw $a1, -368($fp) - sub $a0, $a0, $a1 - sw $a0, -360($fp) - # IF_ZERO local_main_at_Main_internal_89 GOTO label_TRUE_374 - # IF_ZERO local_main_at_Main_internal_89 GOTO label_TRUE_374 - lw $t0, -360($fp) - beq $t0, 0, label_TRUE_374 - # GOTO label_FALSE_373 - j label_FALSE_373 - label_COMPARE_BY_VALUE_377: - # LOCAL local_main_at_Main_internal_89 --> -360($fp) - # LOCAL local_main_at_Main_internal_90 --> -364($fp) - # LOCAL local_main_at_Main_internal_91 --> -368($fp) - lw $a0, -364($fp) - lw $a1, -368($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -360($fp) - # IF_ZERO local_main_at_Main_internal_89 GOTO label_TRUE_374 - # IF_ZERO local_main_at_Main_internal_89 GOTO label_TRUE_374 - lw $t0, -360($fp) - beq $t0, 0, label_TRUE_374 - # GOTO label_FALSE_373 - j label_FALSE_373 - label_COMPARE_STRING_376: - # LOCAL local_main_at_Main_internal_89 --> -360($fp) - # LOCAL local_main_at_Main_internal_90 --> -364($fp) - # LOCAL local_main_at_Main_internal_91 --> -368($fp) - # Load strings for comparison - lw $v0, -364($fp) - lw $v1, -368($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -360($fp) - # IF_ZERO local_main_at_Main_internal_89 GOTO label_CONTINUE_378 - # IF_ZERO local_main_at_Main_internal_89 GOTO label_CONTINUE_378 - lw $t0, -360($fp) - beq $t0, 0, label_CONTINUE_378 - # GOTO label_FALSE_373 - j label_FALSE_373 - label_CONTINUE_378: - # LOCAL local_main_at_Main_internal_89 --> -360($fp) - # LOCAL local_main_at_Main_internal_90 --> -364($fp) - # LOCAL local_main_at_Main_internal_91 --> -368($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -364($fp) - lw $v1, -368($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_379: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_380 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_379 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_380: - # Store result - sw $a2, -360($fp) - # IF_ZERO local_main_at_Main_internal_89 GOTO label_TRUE_374 - # IF_ZERO local_main_at_Main_internal_89 GOTO label_TRUE_374 - lw $t0, -360($fp) - beq $t0, 0, label_TRUE_374 - label_FALSE_373: - # LOCAL local_main_at_Main_internal_88 --> -356($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -356($fp) - # GOTO label_END_375 -j label_END_375 -label_TRUE_374: - # LOCAL local_main_at_Main_internal_88 --> -356($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -356($fp) - label_END_375: -# LOCAL local_main_at_Main_internal_86 --> -348($fp) -# LOCAL local_main_at_Main_internal_88 --> -356($fp) -# Obtain value from -356($fp) -lw $v0, -356($fp) -lw $v0, 12($v0) -sw $v0, -348($fp) -# IF_ZERO local_main_at_Main_internal_86 GOTO label_FALSEIF_371 -# IF_ZERO local_main_at_Main_internal_86 GOTO label_FALSEIF_371 -lw $t0, -348($fp) -beq $t0, 0, label_FALSEIF_371 -# LOCAL local_main_at_Main_internal_94 --> -380($fp) -# local_main_at_Main_internal_94 = ALLOCATE A -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type name -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, A -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, A_start -sw $t0, 4($v0) -# Load type offset -li $t0, 24 -sw $t0, 8($v0) -move $t1, $v0 -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -move $s1, $v0 -# Push register t1 into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -jal __A__attrib__var__init -# Pop 4 bytes from stack into register t1 -lw $t1, 0($sp) -addu $sp, $sp, 4 -sw $v0, 12($t1) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -sw $t1, -380($fp) -# LOCAL local_main_at_Main_internal_92 --> -372($fp) -# LOCAL local_main_at_Main_internal_94 --> -380($fp) -# local_main_at_Main_internal_92 = local_main_at_Main_internal_94 -lw $t0, -380($fp) -sw $t0, -372($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_97 --> -392($fp) -# local_main_at_Main_internal_97 = SELF -sw $s1, -392($fp) -# LOCAL local_main_at_Main_internal_95 --> -384($fp) -# LOCAL local_main_at_Main_internal_97 --> -392($fp) -# local_main_at_Main_internal_95 = local_main_at_Main_internal_97 -lw $t0, -392($fp) -sw $t0, -384($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_95 --> -384($fp) -# LOCAL local_main_at_Main_internal_96 --> -388($fp) -# local_main_at_Main_internal_96 = VCALL local_main_at_Main_internal_95 get_int -# Save new self pointer in $s1 -lw $s1, -384($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 108($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -388($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_96 -# LOCAL local_main_at_Main_internal_96 --> -388($fp) -lw $t0, -388($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_92 --> -372($fp) -# LOCAL local_main_at_Main_internal_93 --> -376($fp) -# local_main_at_Main_internal_93 = VCALL local_main_at_Main_internal_92 set_var -# Save new self pointer in $s1 -lw $s1, -372($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 116($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -376($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# -# LOCAL local_main_at_Main_internal_93 --> -376($fp) -lw $t0, -376($fp) -sw $t0, 20($s1) -# LOCAL local_main_at_Main_internal_100 --> -404($fp) -# local_main_at_Main_internal_100 = ALLOCATE D -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type name -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, D -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, D_start -sw $t0, 4($v0) -# Load type offset -li $t0, 32 -sw $t0, 8($v0) -move $t1, $v0 -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -move $s1, $v0 -# Push register t1 into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -jal __A__attrib__var__init -# Pop 4 bytes from stack into register t1 -lw $t1, 0($sp) -addu $sp, $sp, 4 -sw $v0, 12($t1) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -sw $t1, -404($fp) -# LOCAL local_main_at_Main_internal_98 --> -396($fp) -# LOCAL local_main_at_Main_internal_100 --> -404($fp) -# local_main_at_Main_internal_98 = local_main_at_Main_internal_100 -lw $t0, -404($fp) -sw $t0, -396($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_main_at_Main_internal_103 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_103 --> -416($fp) -lw $t0, 16($s1) -sw $t0, -416($fp) -# LOCAL local_main_at_Main_internal_101 --> -408($fp) -# LOCAL local_main_at_Main_internal_103 --> -416($fp) -# local_main_at_Main_internal_101 = local_main_at_Main_internal_103 -lw $t0, -416($fp) -sw $t0, -408($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_101 --> -408($fp) -# LOCAL local_main_at_Main_internal_102 --> -412($fp) -# local_main_at_Main_internal_102 = VCALL local_main_at_Main_internal_101 value -# Save new self pointer in $s1 -lw $s1, -408($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 56($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -412($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_102 -# LOCAL local_main_at_Main_internal_102 --> -412($fp) -lw $t0, -412($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# local_main_at_Main_internal_106 = GETATTRIBUTE a_var Main -# LOCAL local_main_at_Main_internal_106 --> -428($fp) -lw $t0, 20($s1) -sw $t0, -428($fp) -# LOCAL local_main_at_Main_internal_104 --> -420($fp) -# LOCAL local_main_at_Main_internal_106 --> -428($fp) -# local_main_at_Main_internal_104 = local_main_at_Main_internal_106 -lw $t0, -428($fp) -sw $t0, -420($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_104 --> -420($fp) -# LOCAL local_main_at_Main_internal_105 --> -424($fp) -# local_main_at_Main_internal_105 = VCALL local_main_at_Main_internal_104 value -# Save new self pointer in $s1 -lw $s1, -420($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 56($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -424($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_105 -# LOCAL local_main_at_Main_internal_105 --> -424($fp) -lw $t0, -424($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_98 --> -396($fp) -# LOCAL local_main_at_Main_internal_99 --> -400($fp) -# local_main_at_Main_internal_99 = VCALL local_main_at_Main_internal_98 method4 -# Save new self pointer in $s1 -lw $s1, -396($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 36($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -400($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# -# LOCAL local_main_at_Main_internal_99 --> -400($fp) -lw $t0, -400($fp) -sw $t0, 16($s1) -# LOCAL local_main_at_Main_internal_87 --> -352($fp) -# local_main_at_Main_internal_87 = -# GOTO label_ENDIF_372 -j label_ENDIF_372 -label_FALSEIF_371: - # local_main_at_Main_internal_111 = GETATTRIBUTE char Main - # LOCAL local_main_at_Main_internal_111 --> -448($fp) - lw $t0, 12($s1) - sw $t0, -448($fp) - # LOCAL local_main_at_Main_internal_112 --> -452($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_64 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -452($fp) - # IF_ZERO local_main_at_Main_internal_111 GOTO label_FALSE_383 - # IF_ZERO local_main_at_Main_internal_111 GOTO label_FALSE_383 - lw $t0, -448($fp) - beq $t0, 0, label_FALSE_383 - # IF_ZERO local_main_at_Main_internal_112 GOTO label_FALSE_383 - # IF_ZERO local_main_at_Main_internal_112 GOTO label_FALSE_383 - lw $t0, -452($fp) - beq $t0, 0, label_FALSE_383 - # LOCAL local_main_at_Main_internal_110 --> -444($fp) - # LOCAL local_main_at_Main_internal_111 --> -448($fp) - # Comparing -448($fp) type with String - la $v0, String - lw $a0, -448($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -444($fp) - # IF_ZERO local_main_at_Main_internal_110 GOTO label_COMPARE_STRING_386 - # IF_ZERO local_main_at_Main_internal_110 GOTO label_COMPARE_STRING_386 - lw $t0, -444($fp) - beq $t0, 0, label_COMPARE_STRING_386 - # LOCAL local_main_at_Main_internal_110 --> -444($fp) - # LOCAL local_main_at_Main_internal_111 --> -448($fp) - # Comparing -448($fp) type with Bool - la $v0, Bool - lw $a0, -448($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -444($fp) - # IF_ZERO local_main_at_Main_internal_110 GOTO label_COMPARE_BY_VALUE_387 - # IF_ZERO local_main_at_Main_internal_110 GOTO label_COMPARE_BY_VALUE_387 - lw $t0, -444($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_387 - # LOCAL local_main_at_Main_internal_110 --> -444($fp) - # LOCAL local_main_at_Main_internal_111 --> -448($fp) - # Comparing -448($fp) type with Int - la $v0, Int - lw $a0, -448($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -444($fp) - # IF_ZERO local_main_at_Main_internal_110 GOTO label_COMPARE_BY_VALUE_387 - # IF_ZERO local_main_at_Main_internal_110 GOTO label_COMPARE_BY_VALUE_387 - lw $t0, -444($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_387 - # LOCAL local_main_at_Main_internal_110 --> -444($fp) - # LOCAL local_main_at_Main_internal_111 --> -448($fp) - # LOCAL local_main_at_Main_internal_112 --> -452($fp) - # Load pointers and SUB - lw $a0, -448($fp) - lw $a1, -452($fp) - sub $a0, $a0, $a1 - sw $a0, -444($fp) - # IF_ZERO local_main_at_Main_internal_110 GOTO label_TRUE_384 - # IF_ZERO local_main_at_Main_internal_110 GOTO label_TRUE_384 - lw $t0, -444($fp) - beq $t0, 0, label_TRUE_384 - # GOTO label_FALSE_383 - j label_FALSE_383 - label_COMPARE_BY_VALUE_387: - # LOCAL local_main_at_Main_internal_110 --> -444($fp) - # LOCAL local_main_at_Main_internal_111 --> -448($fp) - # LOCAL local_main_at_Main_internal_112 --> -452($fp) - lw $a0, -448($fp) - lw $a1, -452($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -444($fp) - # IF_ZERO local_main_at_Main_internal_110 GOTO label_TRUE_384 - # IF_ZERO local_main_at_Main_internal_110 GOTO label_TRUE_384 - lw $t0, -444($fp) - beq $t0, 0, label_TRUE_384 - # GOTO label_FALSE_383 - j label_FALSE_383 - label_COMPARE_STRING_386: - # LOCAL local_main_at_Main_internal_110 --> -444($fp) - # LOCAL local_main_at_Main_internal_111 --> -448($fp) - # LOCAL local_main_at_Main_internal_112 --> -452($fp) - # Load strings for comparison - lw $v0, -448($fp) - lw $v1, -452($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -444($fp) - # IF_ZERO local_main_at_Main_internal_110 GOTO label_CONTINUE_388 - # IF_ZERO local_main_at_Main_internal_110 GOTO label_CONTINUE_388 - lw $t0, -444($fp) - beq $t0, 0, label_CONTINUE_388 - # GOTO label_FALSE_383 - j label_FALSE_383 - label_CONTINUE_388: - # LOCAL local_main_at_Main_internal_110 --> -444($fp) - # LOCAL local_main_at_Main_internal_111 --> -448($fp) - # LOCAL local_main_at_Main_internal_112 --> -452($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -448($fp) - lw $v1, -452($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_389: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_390 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_389 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_390: - # Store result - sw $a2, -444($fp) - # IF_ZERO local_main_at_Main_internal_110 GOTO label_TRUE_384 - # IF_ZERO local_main_at_Main_internal_110 GOTO label_TRUE_384 - lw $t0, -444($fp) - beq $t0, 0, label_TRUE_384 - label_FALSE_383: - # LOCAL local_main_at_Main_internal_109 --> -440($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -440($fp) - # GOTO label_END_385 -j label_END_385 -label_TRUE_384: - # LOCAL local_main_at_Main_internal_109 --> -440($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -440($fp) - label_END_385: -# LOCAL local_main_at_Main_internal_107 --> -432($fp) -# LOCAL local_main_at_Main_internal_109 --> -440($fp) -# Obtain value from -440($fp) -lw $v0, -440($fp) -lw $v0, 12($v0) -sw $v0, -432($fp) -# IF_ZERO local_main_at_Main_internal_107 GOTO label_FALSEIF_381 -# IF_ZERO local_main_at_Main_internal_107 GOTO label_FALSEIF_381 -lw $t0, -432($fp) -beq $t0, 0, label_FALSEIF_381 -# LOCAL local_main_at_Main_internal_114 --> -460($fp) -# local_main_at_Main_internal_114 = ALLOCATE C -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type name -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, C -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, C_start -sw $t0, 4($v0) -# Load type offset -li $t0, 40 -sw $t0, 8($v0) -move $t1, $v0 -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -move $s1, $v0 -# Push register t1 into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -jal __A__attrib__var__init -# Pop 4 bytes from stack into register t1 -lw $t1, 0($sp) -addu $sp, $sp, 4 -sw $v0, 12($t1) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -sw $t1, -460($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_main_at_Main_internal_117 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_117 --> -472($fp) -lw $t0, 16($s1) -sw $t0, -472($fp) -# LOCAL local_main_at_Main_internal_115 --> -464($fp) -# LOCAL local_main_at_Main_internal_117 --> -472($fp) -# local_main_at_Main_internal_115 = local_main_at_Main_internal_117 -lw $t0, -472($fp) -sw $t0, -464($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_115 --> -464($fp) -# LOCAL local_main_at_Main_internal_116 --> -468($fp) -# local_main_at_Main_internal_116 = VCALL local_main_at_Main_internal_115 value -# Save new self pointer in $s1 -lw $s1, -464($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 56($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -468($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_116 -# LOCAL local_main_at_Main_internal_116 --> -468($fp) -lw $t0, -468($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# local_main_at_Main_internal_113 = CALL method5 -# LOCAL local_main_at_Main_internal_113 --> -456($fp) -# LOCAL local_main_at_Main_internal_114 --> -460($fp) -# Save new self pointer in $s1 -lw $s1, -460($fp) -# Get pointer to type's VTABLE -la $t0, A_vtable -# Get pointer to function address -lw $t1, 0($t0) -# Call function. Result is on $v0 -jalr $t1 -sw $v0, -456($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# -# LOCAL local_main_at_Main_internal_113 --> -456($fp) -lw $t0, -456($fp) -sw $t0, 16($s1) -# LOCAL local_main_at_Main_internal_108 --> -436($fp) -# local_main_at_Main_internal_108 = -# GOTO label_ENDIF_382 -j label_ENDIF_382 -label_FALSEIF_381: - # local_main_at_Main_internal_122 = GETATTRIBUTE char Main - # LOCAL local_main_at_Main_internal_122 --> -492($fp) - lw $t0, 12($s1) - sw $t0, -492($fp) - # LOCAL local_main_at_Main_internal_123 --> -496($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_65 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -496($fp) - # IF_ZERO local_main_at_Main_internal_122 GOTO label_FALSE_393 - # IF_ZERO local_main_at_Main_internal_122 GOTO label_FALSE_393 - lw $t0, -492($fp) - beq $t0, 0, label_FALSE_393 - # IF_ZERO local_main_at_Main_internal_123 GOTO label_FALSE_393 - # IF_ZERO local_main_at_Main_internal_123 GOTO label_FALSE_393 - lw $t0, -496($fp) - beq $t0, 0, label_FALSE_393 - # LOCAL local_main_at_Main_internal_121 --> -488($fp) - # LOCAL local_main_at_Main_internal_122 --> -492($fp) - # Comparing -492($fp) type with String - la $v0, String - lw $a0, -492($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -488($fp) - # IF_ZERO local_main_at_Main_internal_121 GOTO label_COMPARE_STRING_396 - # IF_ZERO local_main_at_Main_internal_121 GOTO label_COMPARE_STRING_396 - lw $t0, -488($fp) - beq $t0, 0, label_COMPARE_STRING_396 - # LOCAL local_main_at_Main_internal_121 --> -488($fp) - # LOCAL local_main_at_Main_internal_122 --> -492($fp) - # Comparing -492($fp) type with Bool - la $v0, Bool - lw $a0, -492($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -488($fp) - # IF_ZERO local_main_at_Main_internal_121 GOTO label_COMPARE_BY_VALUE_397 - # IF_ZERO local_main_at_Main_internal_121 GOTO label_COMPARE_BY_VALUE_397 - lw $t0, -488($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_397 - # LOCAL local_main_at_Main_internal_121 --> -488($fp) - # LOCAL local_main_at_Main_internal_122 --> -492($fp) - # Comparing -492($fp) type with Int - la $v0, Int - lw $a0, -492($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -488($fp) - # IF_ZERO local_main_at_Main_internal_121 GOTO label_COMPARE_BY_VALUE_397 - # IF_ZERO local_main_at_Main_internal_121 GOTO label_COMPARE_BY_VALUE_397 - lw $t0, -488($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_397 - # LOCAL local_main_at_Main_internal_121 --> -488($fp) - # LOCAL local_main_at_Main_internal_122 --> -492($fp) - # LOCAL local_main_at_Main_internal_123 --> -496($fp) - # Load pointers and SUB - lw $a0, -492($fp) - lw $a1, -496($fp) - sub $a0, $a0, $a1 - sw $a0, -488($fp) - # IF_ZERO local_main_at_Main_internal_121 GOTO label_TRUE_394 - # IF_ZERO local_main_at_Main_internal_121 GOTO label_TRUE_394 - lw $t0, -488($fp) - beq $t0, 0, label_TRUE_394 - # GOTO label_FALSE_393 - j label_FALSE_393 - label_COMPARE_BY_VALUE_397: - # LOCAL local_main_at_Main_internal_121 --> -488($fp) - # LOCAL local_main_at_Main_internal_122 --> -492($fp) - # LOCAL local_main_at_Main_internal_123 --> -496($fp) - lw $a0, -492($fp) - lw $a1, -496($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -488($fp) - # IF_ZERO local_main_at_Main_internal_121 GOTO label_TRUE_394 - # IF_ZERO local_main_at_Main_internal_121 GOTO label_TRUE_394 - lw $t0, -488($fp) - beq $t0, 0, label_TRUE_394 - # GOTO label_FALSE_393 - j label_FALSE_393 - label_COMPARE_STRING_396: - # LOCAL local_main_at_Main_internal_121 --> -488($fp) - # LOCAL local_main_at_Main_internal_122 --> -492($fp) - # LOCAL local_main_at_Main_internal_123 --> -496($fp) - # Load strings for comparison - lw $v0, -492($fp) - lw $v1, -496($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -488($fp) - # IF_ZERO local_main_at_Main_internal_121 GOTO label_CONTINUE_398 - # IF_ZERO local_main_at_Main_internal_121 GOTO label_CONTINUE_398 - lw $t0, -488($fp) - beq $t0, 0, label_CONTINUE_398 - # GOTO label_FALSE_393 - j label_FALSE_393 - label_CONTINUE_398: - # LOCAL local_main_at_Main_internal_121 --> -488($fp) - # LOCAL local_main_at_Main_internal_122 --> -492($fp) - # LOCAL local_main_at_Main_internal_123 --> -496($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -492($fp) - lw $v1, -496($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_399: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_400 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_399 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_400: - # Store result - sw $a2, -488($fp) - # IF_ZERO local_main_at_Main_internal_121 GOTO label_TRUE_394 - # IF_ZERO local_main_at_Main_internal_121 GOTO label_TRUE_394 - lw $t0, -488($fp) - beq $t0, 0, label_TRUE_394 - label_FALSE_393: - # LOCAL local_main_at_Main_internal_120 --> -484($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -484($fp) - # GOTO label_END_395 -j label_END_395 -label_TRUE_394: - # LOCAL local_main_at_Main_internal_120 --> -484($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -484($fp) - label_END_395: -# LOCAL local_main_at_Main_internal_118 --> -476($fp) -# LOCAL local_main_at_Main_internal_120 --> -484($fp) -# Obtain value from -484($fp) -lw $v0, -484($fp) -lw $v0, 12($v0) -sw $v0, -476($fp) -# IF_ZERO local_main_at_Main_internal_118 GOTO label_FALSEIF_391 -# IF_ZERO local_main_at_Main_internal_118 GOTO label_FALSEIF_391 -lw $t0, -476($fp) -beq $t0, 0, label_FALSEIF_391 -# LOCAL local_main_at_Main_internal_125 --> -504($fp) -# local_main_at_Main_internal_125 = ALLOCATE C -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type name -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, C -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, C_start -sw $t0, 4($v0) -# Load type offset -li $t0, 40 -sw $t0, 8($v0) -move $t1, $v0 -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -move $s1, $v0 -# Push register t1 into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -jal __A__attrib__var__init -# Pop 4 bytes from stack into register t1 -lw $t1, 0($sp) -addu $sp, $sp, 4 -sw $v0, 12($t1) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -sw $t1, -504($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_main_at_Main_internal_128 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_128 --> -516($fp) -lw $t0, 16($s1) -sw $t0, -516($fp) -# LOCAL local_main_at_Main_internal_126 --> -508($fp) -# LOCAL local_main_at_Main_internal_128 --> -516($fp) -# local_main_at_Main_internal_126 = local_main_at_Main_internal_128 -lw $t0, -516($fp) -sw $t0, -508($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_126 --> -508($fp) -# LOCAL local_main_at_Main_internal_127 --> -512($fp) -# local_main_at_Main_internal_127 = VCALL local_main_at_Main_internal_126 value -# Save new self pointer in $s1 -lw $s1, -508($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 56($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -512($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_127 -# LOCAL local_main_at_Main_internal_127 --> -512($fp) -lw $t0, -512($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# local_main_at_Main_internal_124 = CALL method5 -# LOCAL local_main_at_Main_internal_124 --> -500($fp) -# LOCAL local_main_at_Main_internal_125 --> -504($fp) -# Save new self pointer in $s1 -lw $s1, -504($fp) -# Get pointer to type's VTABLE -la $t0, B_vtable -# Get pointer to function address -lw $t1, 0($t0) -# Call function. Result is on $v0 -jalr $t1 -sw $v0, -500($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# -# LOCAL local_main_at_Main_internal_124 --> -500($fp) -lw $t0, -500($fp) -sw $t0, 16($s1) -# LOCAL local_main_at_Main_internal_119 --> -480($fp) -# local_main_at_Main_internal_119 = -# GOTO label_ENDIF_392 -j label_ENDIF_392 -label_FALSEIF_391: - # local_main_at_Main_internal_133 = GETATTRIBUTE char Main - # LOCAL local_main_at_Main_internal_133 --> -536($fp) - lw $t0, 12($s1) - sw $t0, -536($fp) - # LOCAL local_main_at_Main_internal_134 --> -540($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_66 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -540($fp) - # IF_ZERO local_main_at_Main_internal_133 GOTO label_FALSE_403 - # IF_ZERO local_main_at_Main_internal_133 GOTO label_FALSE_403 - lw $t0, -536($fp) - beq $t0, 0, label_FALSE_403 - # IF_ZERO local_main_at_Main_internal_134 GOTO label_FALSE_403 - # IF_ZERO local_main_at_Main_internal_134 GOTO label_FALSE_403 - lw $t0, -540($fp) - beq $t0, 0, label_FALSE_403 - # LOCAL local_main_at_Main_internal_132 --> -532($fp) - # LOCAL local_main_at_Main_internal_133 --> -536($fp) - # Comparing -536($fp) type with String - la $v0, String - lw $a0, -536($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -532($fp) - # IF_ZERO local_main_at_Main_internal_132 GOTO label_COMPARE_STRING_406 - # IF_ZERO local_main_at_Main_internal_132 GOTO label_COMPARE_STRING_406 - lw $t0, -532($fp) - beq $t0, 0, label_COMPARE_STRING_406 - # LOCAL local_main_at_Main_internal_132 --> -532($fp) - # LOCAL local_main_at_Main_internal_133 --> -536($fp) - # Comparing -536($fp) type with Bool - la $v0, Bool - lw $a0, -536($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -532($fp) - # IF_ZERO local_main_at_Main_internal_132 GOTO label_COMPARE_BY_VALUE_407 - # IF_ZERO local_main_at_Main_internal_132 GOTO label_COMPARE_BY_VALUE_407 - lw $t0, -532($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_407 - # LOCAL local_main_at_Main_internal_132 --> -532($fp) - # LOCAL local_main_at_Main_internal_133 --> -536($fp) - # Comparing -536($fp) type with Int - la $v0, Int - lw $a0, -536($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -532($fp) - # IF_ZERO local_main_at_Main_internal_132 GOTO label_COMPARE_BY_VALUE_407 - # IF_ZERO local_main_at_Main_internal_132 GOTO label_COMPARE_BY_VALUE_407 - lw $t0, -532($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_407 - # LOCAL local_main_at_Main_internal_132 --> -532($fp) - # LOCAL local_main_at_Main_internal_133 --> -536($fp) - # LOCAL local_main_at_Main_internal_134 --> -540($fp) - # Load pointers and SUB - lw $a0, -536($fp) - lw $a1, -540($fp) - sub $a0, $a0, $a1 - sw $a0, -532($fp) - # IF_ZERO local_main_at_Main_internal_132 GOTO label_TRUE_404 - # IF_ZERO local_main_at_Main_internal_132 GOTO label_TRUE_404 - lw $t0, -532($fp) - beq $t0, 0, label_TRUE_404 - # GOTO label_FALSE_403 - j label_FALSE_403 - label_COMPARE_BY_VALUE_407: - # LOCAL local_main_at_Main_internal_132 --> -532($fp) - # LOCAL local_main_at_Main_internal_133 --> -536($fp) - # LOCAL local_main_at_Main_internal_134 --> -540($fp) - lw $a0, -536($fp) - lw $a1, -540($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -532($fp) - # IF_ZERO local_main_at_Main_internal_132 GOTO label_TRUE_404 - # IF_ZERO local_main_at_Main_internal_132 GOTO label_TRUE_404 - lw $t0, -532($fp) - beq $t0, 0, label_TRUE_404 - # GOTO label_FALSE_403 - j label_FALSE_403 - label_COMPARE_STRING_406: - # LOCAL local_main_at_Main_internal_132 --> -532($fp) - # LOCAL local_main_at_Main_internal_133 --> -536($fp) - # LOCAL local_main_at_Main_internal_134 --> -540($fp) - # Load strings for comparison - lw $v0, -536($fp) - lw $v1, -540($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -532($fp) - # IF_ZERO local_main_at_Main_internal_132 GOTO label_CONTINUE_408 - # IF_ZERO local_main_at_Main_internal_132 GOTO label_CONTINUE_408 - lw $t0, -532($fp) - beq $t0, 0, label_CONTINUE_408 - # GOTO label_FALSE_403 - j label_FALSE_403 - label_CONTINUE_408: - # LOCAL local_main_at_Main_internal_132 --> -532($fp) - # LOCAL local_main_at_Main_internal_133 --> -536($fp) - # LOCAL local_main_at_Main_internal_134 --> -540($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -536($fp) - lw $v1, -540($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_409: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_410 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_409 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_410: - # Store result - sw $a2, -532($fp) - # IF_ZERO local_main_at_Main_internal_132 GOTO label_TRUE_404 - # IF_ZERO local_main_at_Main_internal_132 GOTO label_TRUE_404 - lw $t0, -532($fp) - beq $t0, 0, label_TRUE_404 - label_FALSE_403: - # LOCAL local_main_at_Main_internal_131 --> -528($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -528($fp) - # GOTO label_END_405 -j label_END_405 -label_TRUE_404: - # LOCAL local_main_at_Main_internal_131 --> -528($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -528($fp) - label_END_405: -# LOCAL local_main_at_Main_internal_129 --> -520($fp) -# LOCAL local_main_at_Main_internal_131 --> -528($fp) -# Obtain value from -528($fp) -lw $v0, -528($fp) -lw $v0, 12($v0) -sw $v0, -520($fp) -# IF_ZERO local_main_at_Main_internal_129 GOTO label_FALSEIF_401 -# IF_ZERO local_main_at_Main_internal_129 GOTO label_FALSEIF_401 -lw $t0, -520($fp) -beq $t0, 0, label_FALSEIF_401 -# LOCAL local_main_at_Main_internal_136 --> -548($fp) -# local_main_at_Main_internal_136 = ALLOCATE C -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type name -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, C -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, C_start -sw $t0, 4($v0) -# Load type offset -li $t0, 40 -sw $t0, 8($v0) -move $t1, $v0 -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -move $s1, $v0 -# Push register t1 into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -jal __A__attrib__var__init -# Pop 4 bytes from stack into register t1 -lw $t1, 0($sp) -addu $sp, $sp, 4 -sw $v0, 12($t1) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -sw $t1, -548($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_main_at_Main_internal_139 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_139 --> -560($fp) -lw $t0, 16($s1) -sw $t0, -560($fp) -# LOCAL local_main_at_Main_internal_137 --> -552($fp) -# LOCAL local_main_at_Main_internal_139 --> -560($fp) -# local_main_at_Main_internal_137 = local_main_at_Main_internal_139 -lw $t0, -560($fp) -sw $t0, -552($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_137 --> -552($fp) -# LOCAL local_main_at_Main_internal_138 --> -556($fp) -# local_main_at_Main_internal_138 = VCALL local_main_at_Main_internal_137 value -# Save new self pointer in $s1 -lw $s1, -552($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 56($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -556($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_138 -# LOCAL local_main_at_Main_internal_138 --> -556($fp) -lw $t0, -556($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# local_main_at_Main_internal_135 = CALL method5 -# LOCAL local_main_at_Main_internal_135 --> -544($fp) -# LOCAL local_main_at_Main_internal_136 --> -548($fp) -# Save new self pointer in $s1 -lw $s1, -548($fp) -# Get pointer to type's VTABLE -la $t0, C_vtable -# Get pointer to function address -lw $t1, 0($t0) -# Call function. Result is on $v0 -jalr $t1 -sw $v0, -544($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# -# LOCAL local_main_at_Main_internal_135 --> -544($fp) -lw $t0, -544($fp) -sw $t0, 16($s1) -# LOCAL local_main_at_Main_internal_130 --> -524($fp) -# local_main_at_Main_internal_130 = -# GOTO label_ENDIF_402 -j label_ENDIF_402 -label_FALSEIF_401: - # local_main_at_Main_internal_144 = GETATTRIBUTE char Main - # LOCAL local_main_at_Main_internal_144 --> -580($fp) - lw $t0, 12($s1) - sw $t0, -580($fp) - # LOCAL local_main_at_Main_internal_145 --> -584($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_67 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -584($fp) - # IF_ZERO local_main_at_Main_internal_144 GOTO label_FALSE_413 - # IF_ZERO local_main_at_Main_internal_144 GOTO label_FALSE_413 - lw $t0, -580($fp) - beq $t0, 0, label_FALSE_413 - # IF_ZERO local_main_at_Main_internal_145 GOTO label_FALSE_413 - # IF_ZERO local_main_at_Main_internal_145 GOTO label_FALSE_413 - lw $t0, -584($fp) - beq $t0, 0, label_FALSE_413 - # LOCAL local_main_at_Main_internal_143 --> -576($fp) - # LOCAL local_main_at_Main_internal_144 --> -580($fp) - # Comparing -580($fp) type with String - la $v0, String - lw $a0, -580($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -576($fp) - # IF_ZERO local_main_at_Main_internal_143 GOTO label_COMPARE_STRING_416 - # IF_ZERO local_main_at_Main_internal_143 GOTO label_COMPARE_STRING_416 - lw $t0, -576($fp) - beq $t0, 0, label_COMPARE_STRING_416 - # LOCAL local_main_at_Main_internal_143 --> -576($fp) - # LOCAL local_main_at_Main_internal_144 --> -580($fp) - # Comparing -580($fp) type with Bool - la $v0, Bool - lw $a0, -580($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -576($fp) - # IF_ZERO local_main_at_Main_internal_143 GOTO label_COMPARE_BY_VALUE_417 - # IF_ZERO local_main_at_Main_internal_143 GOTO label_COMPARE_BY_VALUE_417 - lw $t0, -576($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_417 - # LOCAL local_main_at_Main_internal_143 --> -576($fp) - # LOCAL local_main_at_Main_internal_144 --> -580($fp) - # Comparing -580($fp) type with Int - la $v0, Int - lw $a0, -580($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -576($fp) - # IF_ZERO local_main_at_Main_internal_143 GOTO label_COMPARE_BY_VALUE_417 - # IF_ZERO local_main_at_Main_internal_143 GOTO label_COMPARE_BY_VALUE_417 - lw $t0, -576($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_417 - # LOCAL local_main_at_Main_internal_143 --> -576($fp) - # LOCAL local_main_at_Main_internal_144 --> -580($fp) - # LOCAL local_main_at_Main_internal_145 --> -584($fp) - # Load pointers and SUB - lw $a0, -580($fp) - lw $a1, -584($fp) - sub $a0, $a0, $a1 - sw $a0, -576($fp) - # IF_ZERO local_main_at_Main_internal_143 GOTO label_TRUE_414 - # IF_ZERO local_main_at_Main_internal_143 GOTO label_TRUE_414 - lw $t0, -576($fp) - beq $t0, 0, label_TRUE_414 - # GOTO label_FALSE_413 - j label_FALSE_413 - label_COMPARE_BY_VALUE_417: - # LOCAL local_main_at_Main_internal_143 --> -576($fp) - # LOCAL local_main_at_Main_internal_144 --> -580($fp) - # LOCAL local_main_at_Main_internal_145 --> -584($fp) - lw $a0, -580($fp) - lw $a1, -584($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -576($fp) - # IF_ZERO local_main_at_Main_internal_143 GOTO label_TRUE_414 - # IF_ZERO local_main_at_Main_internal_143 GOTO label_TRUE_414 - lw $t0, -576($fp) - beq $t0, 0, label_TRUE_414 - # GOTO label_FALSE_413 - j label_FALSE_413 - label_COMPARE_STRING_416: - # LOCAL local_main_at_Main_internal_143 --> -576($fp) - # LOCAL local_main_at_Main_internal_144 --> -580($fp) - # LOCAL local_main_at_Main_internal_145 --> -584($fp) - # Load strings for comparison - lw $v0, -580($fp) - lw $v1, -584($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -576($fp) - # IF_ZERO local_main_at_Main_internal_143 GOTO label_CONTINUE_418 - # IF_ZERO local_main_at_Main_internal_143 GOTO label_CONTINUE_418 - lw $t0, -576($fp) - beq $t0, 0, label_CONTINUE_418 - # GOTO label_FALSE_413 - j label_FALSE_413 - label_CONTINUE_418: - # LOCAL local_main_at_Main_internal_143 --> -576($fp) - # LOCAL local_main_at_Main_internal_144 --> -580($fp) - # LOCAL local_main_at_Main_internal_145 --> -584($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -580($fp) - lw $v1, -584($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_419: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_420 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_419 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_420: - # Store result - sw $a2, -576($fp) - # IF_ZERO local_main_at_Main_internal_143 GOTO label_TRUE_414 - # IF_ZERO local_main_at_Main_internal_143 GOTO label_TRUE_414 - lw $t0, -576($fp) - beq $t0, 0, label_TRUE_414 - label_FALSE_413: - # LOCAL local_main_at_Main_internal_142 --> -572($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -572($fp) - # GOTO label_END_415 -j label_END_415 -label_TRUE_414: - # LOCAL local_main_at_Main_internal_142 --> -572($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -572($fp) - label_END_415: -# LOCAL local_main_at_Main_internal_140 --> -564($fp) -# LOCAL local_main_at_Main_internal_142 --> -572($fp) -# Obtain value from -572($fp) -lw $v0, -572($fp) -lw $v0, 12($v0) -sw $v0, -564($fp) -# IF_ZERO local_main_at_Main_internal_140 GOTO label_FALSEIF_411 -# IF_ZERO local_main_at_Main_internal_140 GOTO label_FALSEIF_411 -lw $t0, -564($fp) -beq $t0, 0, label_FALSEIF_411 -# LOCAL local_main_at_Main_internal_150 --> -604($fp) -# local_main_at_Main_internal_150 = ALLOCATE D -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type name -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, D -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, D_start -sw $t0, 4($v0) -# Load type offset -li $t0, 32 -sw $t0, 8($v0) -move $t1, $v0 -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -move $s1, $v0 -# Push register t1 into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -jal __A__attrib__var__init -# Pop 4 bytes from stack into register t1 -lw $t1, 0($sp) -addu $sp, $sp, 4 -sw $v0, 12($t1) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -sw $t1, -604($fp) -# LOCAL local_main_at_Main_internal_148 --> -596($fp) -# LOCAL local_main_at_Main_internal_150 --> -604($fp) -# local_main_at_Main_internal_148 = local_main_at_Main_internal_150 -lw $t0, -604($fp) -sw $t0, -596($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_main_at_Main_internal_153 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_153 --> -616($fp) -lw $t0, 16($s1) -sw $t0, -616($fp) -# LOCAL local_main_at_Main_internal_151 --> -608($fp) -# LOCAL local_main_at_Main_internal_153 --> -616($fp) -# local_main_at_Main_internal_151 = local_main_at_Main_internal_153 -lw $t0, -616($fp) -sw $t0, -608($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_151 --> -608($fp) -# LOCAL local_main_at_Main_internal_152 --> -612($fp) -# local_main_at_Main_internal_152 = VCALL local_main_at_Main_internal_151 value -# Save new self pointer in $s1 -lw $s1, -608($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 56($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -612($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_152 -# LOCAL local_main_at_Main_internal_152 --> -612($fp) -lw $t0, -612($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_148 --> -596($fp) -# LOCAL local_main_at_Main_internal_149 --> -600($fp) -# local_main_at_Main_internal_149 = VCALL local_main_at_Main_internal_148 method7 -# Save new self pointer in $s1 -lw $s1, -596($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 28($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -600($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_146 --> -588($fp) -# LOCAL local_main_at_Main_internal_149 --> -600($fp) -# Obtain value from -600($fp) -lw $v0, -600($fp) -lw $v0, 12($v0) -sw $v0, -588($fp) -# IF_ZERO local_main_at_Main_internal_146 GOTO label_FALSEIF_421 -# IF_ZERO local_main_at_Main_internal_146 GOTO label_FALSEIF_421 -lw $t0, -588($fp) -beq $t0, 0, label_FALSEIF_421 -# LOCAL local_main_at_Main_internal_156 --> -628($fp) -# local_main_at_Main_internal_156 = SELF -sw $s1, -628($fp) -# LOCAL local_main_at_Main_internal_154 --> -620($fp) -# LOCAL local_main_at_Main_internal_156 --> -628($fp) -# local_main_at_Main_internal_154 = local_main_at_Main_internal_156 -lw $t0, -628($fp) -sw $t0, -620($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_157 --> -632($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_68 -sw $t0, 12($v0) -li $t0, 7 -sw $t0, 16($v0) -sw $v0, -632($fp) -# ARG local_main_at_Main_internal_157 -# LOCAL local_main_at_Main_internal_157 --> -632($fp) -lw $t0, -632($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_154 --> -620($fp) -# LOCAL local_main_at_Main_internal_155 --> -624($fp) -# local_main_at_Main_internal_155 = VCALL local_main_at_Main_internal_154 out_string -# Save new self pointer in $s1 -lw $s1, -620($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 68($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -624($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_160 --> -644($fp) -# local_main_at_Main_internal_160 = SELF -sw $s1, -644($fp) -# LOCAL local_main_at_Main_internal_158 --> -636($fp) -# LOCAL local_main_at_Main_internal_160 --> -644($fp) -# local_main_at_Main_internal_158 = local_main_at_Main_internal_160 -lw $t0, -644($fp) -sw $t0, -636($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_main_at_Main_internal_161 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_161 --> -648($fp) -lw $t0, 16($s1) -sw $t0, -648($fp) -# ARG local_main_at_Main_internal_161 -# LOCAL local_main_at_Main_internal_161 --> -648($fp) -lw $t0, -648($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_158 --> -636($fp) -# LOCAL local_main_at_Main_internal_159 --> -640($fp) -# local_main_at_Main_internal_159 = VCALL local_main_at_Main_internal_158 print -# Save new self pointer in $s1 -lw $s1, -636($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 92($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -640($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_164 --> -660($fp) -# local_main_at_Main_internal_164 = SELF -sw $s1, -660($fp) -# LOCAL local_main_at_Main_internal_162 --> -652($fp) -# LOCAL local_main_at_Main_internal_164 --> -660($fp) -# local_main_at_Main_internal_162 = local_main_at_Main_internal_164 -lw $t0, -660($fp) -sw $t0, -652($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_165 --> -664($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_69 -sw $t0, 12($v0) -li $t0, 19 -sw $t0, 16($v0) -sw $v0, -664($fp) -# ARG local_main_at_Main_internal_165 -# LOCAL local_main_at_Main_internal_165 --> -664($fp) -lw $t0, -664($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_162 --> -652($fp) -# LOCAL local_main_at_Main_internal_163 --> -656($fp) -# local_main_at_Main_internal_163 = VCALL local_main_at_Main_internal_162 out_string -# Save new self pointer in $s1 -lw $s1, -652($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 68($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -656($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_147 --> -592($fp) -# LOCAL local_main_at_Main_internal_163 --> -656($fp) -# local_main_at_Main_internal_147 = local_main_at_Main_internal_163 -lw $t0, -656($fp) -sw $t0, -592($fp) -# GOTO label_ENDIF_422 -j label_ENDIF_422 -label_FALSEIF_421: - # LOCAL local_main_at_Main_internal_168 --> -676($fp) - # local_main_at_Main_internal_168 = SELF - sw $s1, -676($fp) - # LOCAL local_main_at_Main_internal_166 --> -668($fp) - # LOCAL local_main_at_Main_internal_168 --> -676($fp) - # local_main_at_Main_internal_166 = local_main_at_Main_internal_168 - lw $t0, -676($fp) - sw $t0, -668($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_169 --> -680($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_70 - sw $t0, 12($v0) - li $t0, 7 - sw $t0, 16($v0) - sw $v0, -680($fp) - # ARG local_main_at_Main_internal_169 - # LOCAL local_main_at_Main_internal_169 --> -680($fp) - lw $t0, -680($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_166 --> -668($fp) - # LOCAL local_main_at_Main_internal_167 --> -672($fp) - # local_main_at_Main_internal_167 = VCALL local_main_at_Main_internal_166 out_string - # Save new self pointer in $s1 - lw $s1, -668($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -672($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_172 --> -692($fp) - # local_main_at_Main_internal_172 = SELF - sw $s1, -692($fp) - # LOCAL local_main_at_Main_internal_170 --> -684($fp) - # LOCAL local_main_at_Main_internal_172 --> -692($fp) - # local_main_at_Main_internal_170 = local_main_at_Main_internal_172 - lw $t0, -692($fp) - sw $t0, -684($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_main_at_Main_internal_173 = GETATTRIBUTE avar Main - # LOCAL local_main_at_Main_internal_173 --> -696($fp) - lw $t0, 16($s1) - sw $t0, -696($fp) - # ARG local_main_at_Main_internal_173 - # LOCAL local_main_at_Main_internal_173 --> -696($fp) - lw $t0, -696($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_170 --> -684($fp) - # LOCAL local_main_at_Main_internal_171 --> -688($fp) - # local_main_at_Main_internal_171 = VCALL local_main_at_Main_internal_170 print - # Save new self pointer in $s1 - lw $s1, -684($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -688($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_176 --> -708($fp) - # local_main_at_Main_internal_176 = SELF - sw $s1, -708($fp) - # LOCAL local_main_at_Main_internal_174 --> -700($fp) - # LOCAL local_main_at_Main_internal_176 --> -708($fp) - # local_main_at_Main_internal_174 = local_main_at_Main_internal_176 - lw $t0, -708($fp) - sw $t0, -700($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_177 --> -712($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_71 - sw $t0, 12($v0) - li $t0, 23 - sw $t0, 16($v0) - sw $v0, -712($fp) - # ARG local_main_at_Main_internal_177 - # LOCAL local_main_at_Main_internal_177 --> -712($fp) - lw $t0, -712($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_174 --> -700($fp) - # LOCAL local_main_at_Main_internal_175 --> -704($fp) - # local_main_at_Main_internal_175 = VCALL local_main_at_Main_internal_174 out_string - # Save new self pointer in $s1 - lw $s1, -700($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -704($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_147 --> -592($fp) - # LOCAL local_main_at_Main_internal_175 --> -704($fp) - # local_main_at_Main_internal_147 = local_main_at_Main_internal_175 - lw $t0, -704($fp) - sw $t0, -592($fp) - label_ENDIF_422: -# LOCAL local_main_at_Main_internal_141 --> -568($fp) -# LOCAL local_main_at_Main_internal_147 --> -592($fp) -# local_main_at_Main_internal_141 = local_main_at_Main_internal_147 -lw $t0, -592($fp) -sw $t0, -568($fp) -# GOTO label_ENDIF_412 -j label_ENDIF_412 -label_FALSEIF_411: - # local_main_at_Main_internal_182 = GETATTRIBUTE char Main - # LOCAL local_main_at_Main_internal_182 --> -732($fp) - lw $t0, 12($s1) - sw $t0, -732($fp) - # LOCAL local_main_at_Main_internal_183 --> -736($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_72 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -736($fp) - # IF_ZERO local_main_at_Main_internal_182 GOTO label_FALSE_425 - # IF_ZERO local_main_at_Main_internal_182 GOTO label_FALSE_425 - lw $t0, -732($fp) - beq $t0, 0, label_FALSE_425 - # IF_ZERO local_main_at_Main_internal_183 GOTO label_FALSE_425 - # IF_ZERO local_main_at_Main_internal_183 GOTO label_FALSE_425 - lw $t0, -736($fp) - beq $t0, 0, label_FALSE_425 - # LOCAL local_main_at_Main_internal_181 --> -728($fp) - # LOCAL local_main_at_Main_internal_182 --> -732($fp) - # Comparing -732($fp) type with String - la $v0, String - lw $a0, -732($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -728($fp) - # IF_ZERO local_main_at_Main_internal_181 GOTO label_COMPARE_STRING_428 - # IF_ZERO local_main_at_Main_internal_181 GOTO label_COMPARE_STRING_428 - lw $t0, -728($fp) - beq $t0, 0, label_COMPARE_STRING_428 - # LOCAL local_main_at_Main_internal_181 --> -728($fp) - # LOCAL local_main_at_Main_internal_182 --> -732($fp) - # Comparing -732($fp) type with Bool - la $v0, Bool - lw $a0, -732($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -728($fp) - # IF_ZERO local_main_at_Main_internal_181 GOTO label_COMPARE_BY_VALUE_429 - # IF_ZERO local_main_at_Main_internal_181 GOTO label_COMPARE_BY_VALUE_429 - lw $t0, -728($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_429 - # LOCAL local_main_at_Main_internal_181 --> -728($fp) - # LOCAL local_main_at_Main_internal_182 --> -732($fp) - # Comparing -732($fp) type with Int - la $v0, Int - lw $a0, -732($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -728($fp) - # IF_ZERO local_main_at_Main_internal_181 GOTO label_COMPARE_BY_VALUE_429 - # IF_ZERO local_main_at_Main_internal_181 GOTO label_COMPARE_BY_VALUE_429 - lw $t0, -728($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_429 - # LOCAL local_main_at_Main_internal_181 --> -728($fp) - # LOCAL local_main_at_Main_internal_182 --> -732($fp) - # LOCAL local_main_at_Main_internal_183 --> -736($fp) - # Load pointers and SUB - lw $a0, -732($fp) - lw $a1, -736($fp) - sub $a0, $a0, $a1 - sw $a0, -728($fp) - # IF_ZERO local_main_at_Main_internal_181 GOTO label_TRUE_426 - # IF_ZERO local_main_at_Main_internal_181 GOTO label_TRUE_426 - lw $t0, -728($fp) - beq $t0, 0, label_TRUE_426 - # GOTO label_FALSE_425 - j label_FALSE_425 - label_COMPARE_BY_VALUE_429: - # LOCAL local_main_at_Main_internal_181 --> -728($fp) - # LOCAL local_main_at_Main_internal_182 --> -732($fp) - # LOCAL local_main_at_Main_internal_183 --> -736($fp) - lw $a0, -732($fp) - lw $a1, -736($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -728($fp) - # IF_ZERO local_main_at_Main_internal_181 GOTO label_TRUE_426 - # IF_ZERO local_main_at_Main_internal_181 GOTO label_TRUE_426 - lw $t0, -728($fp) - beq $t0, 0, label_TRUE_426 - # GOTO label_FALSE_425 - j label_FALSE_425 - label_COMPARE_STRING_428: - # LOCAL local_main_at_Main_internal_181 --> -728($fp) - # LOCAL local_main_at_Main_internal_182 --> -732($fp) - # LOCAL local_main_at_Main_internal_183 --> -736($fp) - # Load strings for comparison - lw $v0, -732($fp) - lw $v1, -736($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -728($fp) - # IF_ZERO local_main_at_Main_internal_181 GOTO label_CONTINUE_430 - # IF_ZERO local_main_at_Main_internal_181 GOTO label_CONTINUE_430 - lw $t0, -728($fp) - beq $t0, 0, label_CONTINUE_430 - # GOTO label_FALSE_425 - j label_FALSE_425 - label_CONTINUE_430: - # LOCAL local_main_at_Main_internal_181 --> -728($fp) - # LOCAL local_main_at_Main_internal_182 --> -732($fp) - # LOCAL local_main_at_Main_internal_183 --> -736($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -732($fp) - lw $v1, -736($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_431: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_432 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_431 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_432: - # Store result - sw $a2, -728($fp) - # IF_ZERO local_main_at_Main_internal_181 GOTO label_TRUE_426 - # IF_ZERO local_main_at_Main_internal_181 GOTO label_TRUE_426 - lw $t0, -728($fp) - beq $t0, 0, label_TRUE_426 - label_FALSE_425: - # LOCAL local_main_at_Main_internal_180 --> -724($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -724($fp) - # GOTO label_END_427 -j label_END_427 -label_TRUE_426: - # LOCAL local_main_at_Main_internal_180 --> -724($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -724($fp) - label_END_427: -# LOCAL local_main_at_Main_internal_178 --> -716($fp) -# LOCAL local_main_at_Main_internal_180 --> -724($fp) -# Obtain value from -724($fp) -lw $v0, -724($fp) -lw $v0, 12($v0) -sw $v0, -716($fp) -# IF_ZERO local_main_at_Main_internal_178 GOTO label_FALSEIF_423 -# IF_ZERO local_main_at_Main_internal_178 GOTO label_FALSEIF_423 -lw $t0, -716($fp) -beq $t0, 0, label_FALSEIF_423 -# LOCAL local_main_at_Main_x_184 --> -740($fp) -# local_main_at_Main_x_184 = 0 -li $t0, 0 -sw $t0, -740($fp) -# LOCAL local_main_at_Main_internal_187 --> -752($fp) -# local_main_at_Main_internal_187 = ALLOCATE E -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type name -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, E -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, E_start -sw $t0, 4($v0) -# Load type offset -li $t0, 36 -sw $t0, 8($v0) -move $t1, $v0 -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -move $s1, $v0 -# Push register t1 into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -jal __A__attrib__var__init -# Pop 4 bytes from stack into register t1 -lw $t1, 0($sp) -addu $sp, $sp, 4 -sw $v0, 12($t1) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -sw $t1, -752($fp) -# LOCAL local_main_at_Main_internal_185 --> -744($fp) -# LOCAL local_main_at_Main_internal_187 --> -752($fp) -# local_main_at_Main_internal_185 = local_main_at_Main_internal_187 -lw $t0, -752($fp) -sw $t0, -744($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_main_at_Main_internal_190 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_190 --> -764($fp) -lw $t0, 16($s1) -sw $t0, -764($fp) -# LOCAL local_main_at_Main_internal_188 --> -756($fp) -# LOCAL local_main_at_Main_internal_190 --> -764($fp) -# local_main_at_Main_internal_188 = local_main_at_Main_internal_190 -lw $t0, -764($fp) -sw $t0, -756($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_188 --> -756($fp) -# LOCAL local_main_at_Main_internal_189 --> -760($fp) -# local_main_at_Main_internal_189 = VCALL local_main_at_Main_internal_188 value -# Save new self pointer in $s1 -lw $s1, -756($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 56($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -760($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_189 -# LOCAL local_main_at_Main_internal_189 --> -760($fp) -lw $t0, -760($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_185 --> -744($fp) -# LOCAL local_main_at_Main_internal_186 --> -748($fp) -# local_main_at_Main_internal_186 = VCALL local_main_at_Main_internal_185 method6 -# Save new self pointer in $s1 -lw $s1, -744($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 16($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -748($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_x_184 --> -740($fp) -# LOCAL local_main_at_Main_internal_186 --> -748($fp) -# local_main_at_Main_x_184 = local_main_at_Main_internal_186 -lw $t0, -748($fp) -sw $t0, -740($fp) -# LOCAL local_main_at_Main_r_191 --> -768($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -768($fp) -# local_main_at_Main_internal_195 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_195 --> -784($fp) -lw $t0, 16($s1) -sw $t0, -784($fp) -# LOCAL local_main_at_Main_internal_193 --> -776($fp) -# LOCAL local_main_at_Main_internal_195 --> -784($fp) -# local_main_at_Main_internal_193 = local_main_at_Main_internal_195 -lw $t0, -784($fp) -sw $t0, -776($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_193 --> -776($fp) -# LOCAL local_main_at_Main_internal_194 --> -780($fp) -# local_main_at_Main_internal_194 = VCALL local_main_at_Main_internal_193 value -# Save new self pointer in $s1 -lw $s1, -776($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 56($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -780($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_197 --> -792($fp) -# LOCAL local_main_at_Main_x_184 --> -740($fp) -# local_main_at_Main_internal_197 = local_main_at_Main_x_184 -lw $t0, -740($fp) -sw $t0, -792($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_197 --> -792($fp) -# LOCAL local_main_at_Main_internal_198 --> -796($fp) -# local_main_at_Main_internal_198 = VCALL local_main_at_Main_internal_197 value -# Save new self pointer in $s1 -lw $s1, -792($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 56($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -796($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_199 --> -800($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 8 -sw $t0, 12($v0) -sw $v0, -800($fp) -# LOCAL local_main_at_Main_internal_196 --> -788($fp) -# LOCAL local_main_at_Main_internal_198 --> -796($fp) -# LOCAL local_main_at_Main_internal_199 --> -800($fp) -# local_main_at_Main_internal_196 = local_main_at_Main_internal_198 * local_main_at_Main_internal_199 -lw $t1, -796($fp) -lw $t0, 12($t1) -lw $t1, -800($fp) -lw $t2, 12($t1) -mul $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -788($fp) -# LOCAL local_main_at_Main_internal_192 --> -772($fp) -# LOCAL local_main_at_Main_internal_194 --> -780($fp) -# LOCAL local_main_at_Main_internal_196 --> -788($fp) -# local_main_at_Main_internal_192 = local_main_at_Main_internal_194 - local_main_at_Main_internal_196 -lw $t1, -780($fp) -lw $t0, 12($t1) -lw $t1, -788($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -772($fp) -# LOCAL local_main_at_Main_r_191 --> -768($fp) -# LOCAL local_main_at_Main_internal_192 --> -772($fp) -# local_main_at_Main_r_191 = local_main_at_Main_internal_192 -lw $t0, -772($fp) -sw $t0, -768($fp) -# LOCAL local_main_at_Main_internal_202 --> -812($fp) -# local_main_at_Main_internal_202 = SELF -sw $s1, -812($fp) -# LOCAL local_main_at_Main_internal_200 --> -804($fp) -# LOCAL local_main_at_Main_internal_202 --> -812($fp) -# local_main_at_Main_internal_200 = local_main_at_Main_internal_202 -lw $t0, -812($fp) -sw $t0, -804($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_203 --> -816($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_73 -sw $t0, 12($v0) -li $t0, 7 -sw $t0, 16($v0) -sw $v0, -816($fp) -# ARG local_main_at_Main_internal_203 -# LOCAL local_main_at_Main_internal_203 --> -816($fp) -lw $t0, -816($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_200 --> -804($fp) -# LOCAL local_main_at_Main_internal_201 --> -808($fp) -# local_main_at_Main_internal_201 = VCALL local_main_at_Main_internal_200 out_string -# Save new self pointer in $s1 -lw $s1, -804($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 68($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -808($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_206 --> -828($fp) -# local_main_at_Main_internal_206 = SELF -sw $s1, -828($fp) -# LOCAL local_main_at_Main_internal_204 --> -820($fp) -# LOCAL local_main_at_Main_internal_206 --> -828($fp) -# local_main_at_Main_internal_204 = local_main_at_Main_internal_206 -lw $t0, -828($fp) -sw $t0, -820($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_main_at_Main_internal_207 = GETATTRIBUTE avar Main -# LOCAL local_main_at_Main_internal_207 --> -832($fp) -lw $t0, 16($s1) -sw $t0, -832($fp) -# ARG local_main_at_Main_internal_207 -# LOCAL local_main_at_Main_internal_207 --> -832($fp) -lw $t0, -832($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_204 --> -820($fp) -# LOCAL local_main_at_Main_internal_205 --> -824($fp) -# local_main_at_Main_internal_205 = VCALL local_main_at_Main_internal_204 print -# Save new self pointer in $s1 -lw $s1, -820($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 92($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -824($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_210 --> -844($fp) -# local_main_at_Main_internal_210 = SELF -sw $s1, -844($fp) -# LOCAL local_main_at_Main_internal_208 --> -836($fp) -# LOCAL local_main_at_Main_internal_210 --> -844($fp) -# local_main_at_Main_internal_208 = local_main_at_Main_internal_210 -lw $t0, -844($fp) -sw $t0, -836($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_211 --> -848($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_74 -sw $t0, 12($v0) -li $t0, 12 -sw $t0, 16($v0) -sw $v0, -848($fp) -# ARG local_main_at_Main_internal_211 -# LOCAL local_main_at_Main_internal_211 --> -848($fp) -lw $t0, -848($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_208 --> -836($fp) -# LOCAL local_main_at_Main_internal_209 --> -840($fp) -# local_main_at_Main_internal_209 = VCALL local_main_at_Main_internal_208 out_string -# Save new self pointer in $s1 -lw $s1, -836($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 68($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -840($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_214 --> -860($fp) -# local_main_at_Main_internal_214 = SELF -sw $s1, -860($fp) -# LOCAL local_main_at_Main_internal_212 --> -852($fp) -# LOCAL local_main_at_Main_internal_214 --> -860($fp) -# local_main_at_Main_internal_212 = local_main_at_Main_internal_214 -lw $t0, -860($fp) -sw $t0, -852($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_main_at_Main_x_184 -# LOCAL local_main_at_Main_x_184 --> -740($fp) -lw $t0, -740($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_212 --> -852($fp) -# LOCAL local_main_at_Main_internal_213 --> -856($fp) -# local_main_at_Main_internal_213 = VCALL local_main_at_Main_internal_212 print -# Save new self pointer in $s1 -lw $s1, -852($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 92($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -856($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_217 --> -872($fp) -# local_main_at_Main_internal_217 = SELF -sw $s1, -872($fp) -# LOCAL local_main_at_Main_internal_215 --> -864($fp) -# LOCAL local_main_at_Main_internal_217 --> -872($fp) -# local_main_at_Main_internal_215 = local_main_at_Main_internal_217 -lw $t0, -872($fp) -sw $t0, -864($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_218 --> -876($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_75 -sw $t0, 12($v0) -li $t0, 28 -sw $t0, 16($v0) -sw $v0, -876($fp) -# ARG local_main_at_Main_internal_218 -# LOCAL local_main_at_Main_internal_218 --> -876($fp) -lw $t0, -876($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_215 --> -864($fp) -# LOCAL local_main_at_Main_internal_216 --> -868($fp) -# local_main_at_Main_internal_216 = VCALL local_main_at_Main_internal_215 out_string -# Save new self pointer in $s1 -lw $s1, -864($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 68($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -868($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_a_219 --> -880($fp) -# local_main_at_Main_a_219 = 0 -li $t0, 0 -sw $t0, -880($fp) -# LOCAL local_main_at_Main_internal_220 --> -884($fp) -# local_main_at_Main_internal_220 = ALLOCATE A2I -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type name -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, A2I -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 12 bytes of memory -li $a0, 12 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, A2I_start -sw $t0, 4($v0) -# Load type offset -li $t0, 20 -sw $t0, 8($v0) -move $t1, $v0 -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -move $s1, $v0 -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -sw $t1, -884($fp) -# LOCAL local_main_at_Main_a_219 --> -880($fp) -# LOCAL local_main_at_Main_internal_220 --> -884($fp) -# local_main_at_Main_a_219 = local_main_at_Main_internal_220 -lw $t0, -884($fp) -sw $t0, -880($fp) -# LOCAL local_main_at_Main_internal_223 --> -896($fp) -# local_main_at_Main_internal_223 = SELF -sw $s1, -896($fp) -# LOCAL local_main_at_Main_internal_221 --> -888($fp) -# LOCAL local_main_at_Main_internal_223 --> -896($fp) -# local_main_at_Main_internal_221 = local_main_at_Main_internal_223 -lw $t0, -896($fp) -sw $t0, -888($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_224 --> -900($fp) -# LOCAL local_main_at_Main_a_219 --> -880($fp) -# local_main_at_Main_internal_224 = local_main_at_Main_a_219 -lw $t0, -880($fp) -sw $t0, -900($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_main_at_Main_r_191 -# LOCAL local_main_at_Main_r_191 --> -768($fp) -lw $t0, -768($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_224 --> -900($fp) -# LOCAL local_main_at_Main_internal_225 --> -904($fp) -# local_main_at_Main_internal_225 = VCALL local_main_at_Main_internal_224 i2a -# Save new self pointer in $s1 -lw $s1, -900($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 120($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -904($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_225 -# LOCAL local_main_at_Main_internal_225 --> -904($fp) -lw $t0, -904($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_221 --> -888($fp) -# LOCAL local_main_at_Main_internal_222 --> -892($fp) -# local_main_at_Main_internal_222 = VCALL local_main_at_Main_internal_221 out_string -# Save new self pointer in $s1 -lw $s1, -888($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 68($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -892($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_228 --> -916($fp) -# local_main_at_Main_internal_228 = SELF -sw $s1, -916($fp) -# LOCAL local_main_at_Main_internal_226 --> -908($fp) -# LOCAL local_main_at_Main_internal_228 --> -916($fp) -# local_main_at_Main_internal_226 = local_main_at_Main_internal_228 -lw $t0, -916($fp) -sw $t0, -908($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_229 --> -920($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_76 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -920($fp) -# ARG local_main_at_Main_internal_229 -# LOCAL local_main_at_Main_internal_229 --> -920($fp) -lw $t0, -920($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_226 --> -908($fp) -# LOCAL local_main_at_Main_internal_227 --> -912($fp) -# local_main_at_Main_internal_227 = VCALL local_main_at_Main_internal_226 out_string -# Save new self pointer in $s1 -lw $s1, -908($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 68($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -912($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# -# LOCAL local_main_at_Main_x_184 --> -740($fp) -lw $t0, -740($fp) -sw $t0, 16($s1) -# LOCAL local_main_at_Main_internal_179 --> -720($fp) -# local_main_at_Main_internal_179 = -# GOTO label_ENDIF_424 -j label_ENDIF_424 -label_FALSEIF_423: - # local_main_at_Main_internal_234 = GETATTRIBUTE char Main - # LOCAL local_main_at_Main_internal_234 --> -940($fp) - lw $t0, 12($s1) - sw $t0, -940($fp) - # LOCAL local_main_at_Main_internal_235 --> -944($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_77 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -944($fp) - # IF_ZERO local_main_at_Main_internal_234 GOTO label_FALSE_435 - # IF_ZERO local_main_at_Main_internal_234 GOTO label_FALSE_435 - lw $t0, -940($fp) - beq $t0, 0, label_FALSE_435 - # IF_ZERO local_main_at_Main_internal_235 GOTO label_FALSE_435 - # IF_ZERO local_main_at_Main_internal_235 GOTO label_FALSE_435 - lw $t0, -944($fp) - beq $t0, 0, label_FALSE_435 - # LOCAL local_main_at_Main_internal_233 --> -936($fp) - # LOCAL local_main_at_Main_internal_234 --> -940($fp) - # Comparing -940($fp) type with String - la $v0, String - lw $a0, -940($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -936($fp) - # IF_ZERO local_main_at_Main_internal_233 GOTO label_COMPARE_STRING_438 - # IF_ZERO local_main_at_Main_internal_233 GOTO label_COMPARE_STRING_438 - lw $t0, -936($fp) - beq $t0, 0, label_COMPARE_STRING_438 - # LOCAL local_main_at_Main_internal_233 --> -936($fp) - # LOCAL local_main_at_Main_internal_234 --> -940($fp) - # Comparing -940($fp) type with Bool - la $v0, Bool - lw $a0, -940($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -936($fp) - # IF_ZERO local_main_at_Main_internal_233 GOTO label_COMPARE_BY_VALUE_439 - # IF_ZERO local_main_at_Main_internal_233 GOTO label_COMPARE_BY_VALUE_439 - lw $t0, -936($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_439 - # LOCAL local_main_at_Main_internal_233 --> -936($fp) - # LOCAL local_main_at_Main_internal_234 --> -940($fp) - # Comparing -940($fp) type with Int - la $v0, Int - lw $a0, -940($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -936($fp) - # IF_ZERO local_main_at_Main_internal_233 GOTO label_COMPARE_BY_VALUE_439 - # IF_ZERO local_main_at_Main_internal_233 GOTO label_COMPARE_BY_VALUE_439 - lw $t0, -936($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_439 - # LOCAL local_main_at_Main_internal_233 --> -936($fp) - # LOCAL local_main_at_Main_internal_234 --> -940($fp) - # LOCAL local_main_at_Main_internal_235 --> -944($fp) - # Load pointers and SUB - lw $a0, -940($fp) - lw $a1, -944($fp) - sub $a0, $a0, $a1 - sw $a0, -936($fp) - # IF_ZERO local_main_at_Main_internal_233 GOTO label_TRUE_436 - # IF_ZERO local_main_at_Main_internal_233 GOTO label_TRUE_436 - lw $t0, -936($fp) - beq $t0, 0, label_TRUE_436 - # GOTO label_FALSE_435 - j label_FALSE_435 - label_COMPARE_BY_VALUE_439: - # LOCAL local_main_at_Main_internal_233 --> -936($fp) - # LOCAL local_main_at_Main_internal_234 --> -940($fp) - # LOCAL local_main_at_Main_internal_235 --> -944($fp) - lw $a0, -940($fp) - lw $a1, -944($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -936($fp) - # IF_ZERO local_main_at_Main_internal_233 GOTO label_TRUE_436 - # IF_ZERO local_main_at_Main_internal_233 GOTO label_TRUE_436 - lw $t0, -936($fp) - beq $t0, 0, label_TRUE_436 - # GOTO label_FALSE_435 - j label_FALSE_435 - label_COMPARE_STRING_438: - # LOCAL local_main_at_Main_internal_233 --> -936($fp) - # LOCAL local_main_at_Main_internal_234 --> -940($fp) - # LOCAL local_main_at_Main_internal_235 --> -944($fp) - # Load strings for comparison - lw $v0, -940($fp) - lw $v1, -944($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -936($fp) - # IF_ZERO local_main_at_Main_internal_233 GOTO label_CONTINUE_440 - # IF_ZERO local_main_at_Main_internal_233 GOTO label_CONTINUE_440 - lw $t0, -936($fp) - beq $t0, 0, label_CONTINUE_440 - # GOTO label_FALSE_435 - j label_FALSE_435 - label_CONTINUE_440: - # LOCAL local_main_at_Main_internal_233 --> -936($fp) - # LOCAL local_main_at_Main_internal_234 --> -940($fp) - # LOCAL local_main_at_Main_internal_235 --> -944($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -940($fp) - lw $v1, -944($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_441: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_442 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_441 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_442: - # Store result - sw $a2, -936($fp) - # IF_ZERO local_main_at_Main_internal_233 GOTO label_TRUE_436 - # IF_ZERO local_main_at_Main_internal_233 GOTO label_TRUE_436 - lw $t0, -936($fp) - beq $t0, 0, label_TRUE_436 - label_FALSE_435: - # LOCAL local_main_at_Main_internal_232 --> -932($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -932($fp) - # GOTO label_END_437 -j label_END_437 -label_TRUE_436: - # LOCAL local_main_at_Main_internal_232 --> -932($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -932($fp) - label_END_437: -# LOCAL local_main_at_Main_internal_230 --> -924($fp) -# LOCAL local_main_at_Main_internal_232 --> -932($fp) -# Obtain value from -932($fp) -lw $v0, -932($fp) -lw $v0, 12($v0) -sw $v0, -924($fp) -# IF_ZERO local_main_at_Main_internal_230 GOTO label_FALSEIF_433 -# IF_ZERO local_main_at_Main_internal_230 GOTO label_FALSEIF_433 -lw $t0, -924($fp) -beq $t0, 0, label_FALSEIF_433 -# LOCAL local_main_at_Main_internal_236 --> -948($fp) -# local_main_at_Main_internal_236 = ALLOCATE A -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type name -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, A -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, A_start -sw $t0, 4($v0) -# Load type offset -li $t0, 24 -sw $t0, 8($v0) -move $t1, $v0 -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -move $s1, $v0 -# Push register t1 into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -jal __A__attrib__var__init -# Pop 4 bytes from stack into register t1 -lw $t1, 0($sp) -addu $sp, $sp, 4 -sw $v0, 12($t1) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -sw $t1, -948($fp) -# -# LOCAL local_main_at_Main_internal_236 --> -948($fp) -lw $t0, -948($fp) -sw $t0, 16($s1) -# LOCAL local_main_at_Main_internal_231 --> -928($fp) -# local_main_at_Main_internal_231 = -# GOTO label_ENDIF_434 -j label_ENDIF_434 -label_FALSEIF_433: - # local_main_at_Main_internal_241 = GETATTRIBUTE char Main - # LOCAL local_main_at_Main_internal_241 --> -968($fp) - lw $t0, 12($s1) - sw $t0, -968($fp) - # LOCAL local_main_at_Main_internal_242 --> -972($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_78 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -972($fp) - # IF_ZERO local_main_at_Main_internal_241 GOTO label_FALSE_445 - # IF_ZERO local_main_at_Main_internal_241 GOTO label_FALSE_445 - lw $t0, -968($fp) - beq $t0, 0, label_FALSE_445 - # IF_ZERO local_main_at_Main_internal_242 GOTO label_FALSE_445 - # IF_ZERO local_main_at_Main_internal_242 GOTO label_FALSE_445 - lw $t0, -972($fp) - beq $t0, 0, label_FALSE_445 - # LOCAL local_main_at_Main_internal_240 --> -964($fp) - # LOCAL local_main_at_Main_internal_241 --> -968($fp) - # Comparing -968($fp) type with String - la $v0, String - lw $a0, -968($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -964($fp) - # IF_ZERO local_main_at_Main_internal_240 GOTO label_COMPARE_STRING_448 - # IF_ZERO local_main_at_Main_internal_240 GOTO label_COMPARE_STRING_448 - lw $t0, -964($fp) - beq $t0, 0, label_COMPARE_STRING_448 - # LOCAL local_main_at_Main_internal_240 --> -964($fp) - # LOCAL local_main_at_Main_internal_241 --> -968($fp) - # Comparing -968($fp) type with Bool - la $v0, Bool - lw $a0, -968($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -964($fp) - # IF_ZERO local_main_at_Main_internal_240 GOTO label_COMPARE_BY_VALUE_449 - # IF_ZERO local_main_at_Main_internal_240 GOTO label_COMPARE_BY_VALUE_449 - lw $t0, -964($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_449 - # LOCAL local_main_at_Main_internal_240 --> -964($fp) - # LOCAL local_main_at_Main_internal_241 --> -968($fp) - # Comparing -968($fp) type with Int - la $v0, Int - lw $a0, -968($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -964($fp) - # IF_ZERO local_main_at_Main_internal_240 GOTO label_COMPARE_BY_VALUE_449 - # IF_ZERO local_main_at_Main_internal_240 GOTO label_COMPARE_BY_VALUE_449 - lw $t0, -964($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_449 - # LOCAL local_main_at_Main_internal_240 --> -964($fp) - # LOCAL local_main_at_Main_internal_241 --> -968($fp) - # LOCAL local_main_at_Main_internal_242 --> -972($fp) - # Load pointers and SUB - lw $a0, -968($fp) - lw $a1, -972($fp) - sub $a0, $a0, $a1 - sw $a0, -964($fp) - # IF_ZERO local_main_at_Main_internal_240 GOTO label_TRUE_446 - # IF_ZERO local_main_at_Main_internal_240 GOTO label_TRUE_446 - lw $t0, -964($fp) - beq $t0, 0, label_TRUE_446 - # GOTO label_FALSE_445 - j label_FALSE_445 - label_COMPARE_BY_VALUE_449: - # LOCAL local_main_at_Main_internal_240 --> -964($fp) - # LOCAL local_main_at_Main_internal_241 --> -968($fp) - # LOCAL local_main_at_Main_internal_242 --> -972($fp) - lw $a0, -968($fp) - lw $a1, -972($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -964($fp) - # IF_ZERO local_main_at_Main_internal_240 GOTO label_TRUE_446 - # IF_ZERO local_main_at_Main_internal_240 GOTO label_TRUE_446 - lw $t0, -964($fp) - beq $t0, 0, label_TRUE_446 - # GOTO label_FALSE_445 - j label_FALSE_445 - label_COMPARE_STRING_448: - # LOCAL local_main_at_Main_internal_240 --> -964($fp) - # LOCAL local_main_at_Main_internal_241 --> -968($fp) - # LOCAL local_main_at_Main_internal_242 --> -972($fp) - # Load strings for comparison - lw $v0, -968($fp) - lw $v1, -972($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -964($fp) - # IF_ZERO local_main_at_Main_internal_240 GOTO label_CONTINUE_450 - # IF_ZERO local_main_at_Main_internal_240 GOTO label_CONTINUE_450 - lw $t0, -964($fp) - beq $t0, 0, label_CONTINUE_450 - # GOTO label_FALSE_445 - j label_FALSE_445 - label_CONTINUE_450: - # LOCAL local_main_at_Main_internal_240 --> -964($fp) - # LOCAL local_main_at_Main_internal_241 --> -968($fp) - # LOCAL local_main_at_Main_internal_242 --> -972($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -968($fp) - lw $v1, -972($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_451: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_452 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_451 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_452: - # Store result - sw $a2, -964($fp) - # IF_ZERO local_main_at_Main_internal_240 GOTO label_TRUE_446 - # IF_ZERO local_main_at_Main_internal_240 GOTO label_TRUE_446 - lw $t0, -964($fp) - beq $t0, 0, label_TRUE_446 - label_FALSE_445: - # LOCAL local_main_at_Main_internal_239 --> -960($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -960($fp) - # GOTO label_END_447 -j label_END_447 -label_TRUE_446: - # LOCAL local_main_at_Main_internal_239 --> -960($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -960($fp) - label_END_447: -# LOCAL local_main_at_Main_internal_237 --> -952($fp) -# LOCAL local_main_at_Main_internal_239 --> -960($fp) -# Obtain value from -960($fp) -lw $v0, -960($fp) -lw $v0, 12($v0) -sw $v0, -952($fp) -# IF_ZERO local_main_at_Main_internal_237 GOTO label_FALSEIF_443 -# IF_ZERO local_main_at_Main_internal_237 GOTO label_FALSEIF_443 -lw $t0, -952($fp) -beq $t0, 0, label_FALSEIF_443 -# LOCAL local_main_at_Main_internal_243 --> -976($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -976($fp) -# -# LOCAL local_main_at_Main_internal_243 --> -976($fp) -lw $t0, -976($fp) -sw $t0, 24($s1) -# LOCAL local_main_at_Main_internal_238 --> -956($fp) -# local_main_at_Main_internal_238 = -# GOTO label_ENDIF_444 -j label_ENDIF_444 -label_FALSEIF_443: - # LOCAL local_main_at_Main_internal_246 --> -988($fp) - # local_main_at_Main_internal_246 = ALLOCATE A - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, A - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, A_start - sw $t0, 4($v0) - # Load type offset - li $t0, 24 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __A__attrib__var__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -988($fp) - # LOCAL local_main_at_Main_internal_244 --> -980($fp) - # LOCAL local_main_at_Main_internal_246 --> -988($fp) - # local_main_at_Main_internal_244 = local_main_at_Main_internal_246 - lw $t0, -988($fp) - sw $t0, -980($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_main_at_Main_internal_249 = GETATTRIBUTE avar Main - # LOCAL local_main_at_Main_internal_249 --> -1000($fp) - lw $t0, 16($s1) - sw $t0, -1000($fp) - # LOCAL local_main_at_Main_internal_247 --> -992($fp) - # LOCAL local_main_at_Main_internal_249 --> -1000($fp) - # local_main_at_Main_internal_247 = local_main_at_Main_internal_249 - lw $t0, -1000($fp) - sw $t0, -992($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_247 --> -992($fp) - # LOCAL local_main_at_Main_internal_248 --> -996($fp) - # local_main_at_Main_internal_248 = VCALL local_main_at_Main_internal_247 value - # Save new self pointer in $s1 - lw $s1, -992($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 56($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -996($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_248 - # LOCAL local_main_at_Main_internal_248 --> -996($fp) - lw $t0, -996($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_244 --> -980($fp) - # LOCAL local_main_at_Main_internal_245 --> -984($fp) - # local_main_at_Main_internal_245 = VCALL local_main_at_Main_internal_244 method1 - # Save new self pointer in $s1 - lw $s1, -980($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 96($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -984($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_main_at_Main_internal_245 --> -984($fp) - lw $t0, -984($fp) - sw $t0, 16($s1) - # LOCAL local_main_at_Main_internal_238 --> -956($fp) - # local_main_at_Main_internal_238 = - label_ENDIF_444: -# LOCAL local_main_at_Main_internal_231 --> -928($fp) -# LOCAL local_main_at_Main_internal_238 --> -956($fp) -# local_main_at_Main_internal_231 = local_main_at_Main_internal_238 -lw $t0, -956($fp) -sw $t0, -928($fp) -label_ENDIF_434: -# LOCAL local_main_at_Main_internal_179 --> -720($fp) -# LOCAL local_main_at_Main_internal_231 --> -928($fp) -# local_main_at_Main_internal_179 = local_main_at_Main_internal_231 -lw $t0, -928($fp) -sw $t0, -720($fp) -label_ENDIF_424: -# LOCAL local_main_at_Main_internal_141 --> -568($fp) -# LOCAL local_main_at_Main_internal_179 --> -720($fp) -# local_main_at_Main_internal_141 = local_main_at_Main_internal_179 -lw $t0, -720($fp) -sw $t0, -568($fp) -label_ENDIF_412: -# LOCAL local_main_at_Main_internal_130 --> -524($fp) -# LOCAL local_main_at_Main_internal_141 --> -568($fp) -# local_main_at_Main_internal_130 = local_main_at_Main_internal_141 -lw $t0, -568($fp) -sw $t0, -524($fp) -label_ENDIF_402: -# LOCAL local_main_at_Main_internal_119 --> -480($fp) -# LOCAL local_main_at_Main_internal_130 --> -524($fp) -# local_main_at_Main_internal_119 = local_main_at_Main_internal_130 -lw $t0, -524($fp) -sw $t0, -480($fp) -label_ENDIF_392: -# LOCAL local_main_at_Main_internal_108 --> -436($fp) -# LOCAL local_main_at_Main_internal_119 --> -480($fp) -# local_main_at_Main_internal_108 = local_main_at_Main_internal_119 -lw $t0, -480($fp) -sw $t0, -436($fp) -label_ENDIF_382: -# LOCAL local_main_at_Main_internal_87 --> -352($fp) -# LOCAL local_main_at_Main_internal_108 --> -436($fp) -# local_main_at_Main_internal_87 = local_main_at_Main_internal_108 -lw $t0, -436($fp) -sw $t0, -352($fp) -label_ENDIF_372: -# LOCAL local_main_at_Main_internal_56 --> -228($fp) -# LOCAL local_main_at_Main_internal_87 --> -352($fp) -# local_main_at_Main_internal_56 = local_main_at_Main_internal_87 -lw $t0, -352($fp) -sw $t0, -228($fp) -label_ENDIF_354: -# LOCAL local_main_at_Main_internal_35 --> -144($fp) -# LOCAL local_main_at_Main_internal_56 --> -228($fp) -# local_main_at_Main_internal_35 = local_main_at_Main_internal_56 -lw $t0, -228($fp) -sw $t0, -144($fp) -label_ENDIF_344: -# GOTO label_WHILE_339 -j label_WHILE_339 -label_WHILE_END_340: - # RETURN - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 1008 - jr $ra - # Function END - diff --git a/tests/codegen/atoi.mips b/tests/codegen/atoi.mips deleted file mode 100644 index 718cf846..00000000 --- a/tests/codegen/atoi.mips +++ /dev/null @@ -1,10086 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:14 2020 -# School of Math and Computer Science, University of Havana -# - -.data -dummy: .word 0 -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Int: .asciiz "Int" -# Function END -A2I: .asciiz "A2I" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_copy_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, dummy, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_copy_at_Object, dummy, dummy, function_length_at_String, dummy, dummy, dummy, dummy, function_concat_at_String, dummy, dummy, function_substr_at_String, dummy, dummy, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Int **** -Int_start: - Int_vtable_pointer: .word Int_vtable - # Function END -Int_end: -# - - -# **** VTABLE for type A2I **** -A2I_vtable: .word function_abort_at_Object, function_copy_at_Object, dummy, function_a2i_at_A2I, dummy, dummy, function_i2a_at_A2I, dummy, function_i2a_aux_at_A2I, dummy, function_i2c_at_A2I, dummy, dummy, dummy, function_a2i_aux_at_A2I, function_type_name_at_Object, function_c2i_at_A2I -# Function END -# - - -# **** Type RECORD for type A2I **** -A2I_start: - A2I_vtable_pointer: .word A2I_vtable - # Function END -A2I_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_copy_at_Object, function_out_string_at_IO, dummy, dummy, function_main_at_Main, dummy, function_out_int_at_IO, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, dummy, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1, -1 -A2I__TDT: .word -1, -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz "0" -# - - -data_5: .asciiz "1" -# - - -data_6: .asciiz "2" -# - - -data_7: .asciiz "3" -# - - -data_8: .asciiz "4" -# - - -data_9: .asciiz "5" -# - - -data_10: .asciiz "6" -# - - -data_11: .asciiz "7" -# - - -data_12: .asciiz "8" -# - - -data_13: .asciiz "9" -# - - -data_14: .asciiz "0" -# - - -data_15: .asciiz "1" -# - - -data_16: .asciiz "2" -# - - -data_17: .asciiz "3" -# - - -data_18: .asciiz "4" -# - - -data_19: .asciiz "5" -# - - -data_20: .asciiz "6" -# - - -data_21: .asciiz "7" -# - - -data_22: .asciiz "8" -# - - -data_23: .asciiz "9" -# - - -data_24: .asciiz "" -# - - -data_25: .asciiz "-" -# - - -data_26: .asciiz "+" -# - - -data_27: .asciiz "0" -# - - -data_28: .asciiz "-" -# - - -data_29: .asciiz "" -# - - -data_30: .asciiz "678987" -# - - -data_31: .asciiz " == " -# - - -data_32: .asciiz "\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - move $a2, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - sw $a2, 12($v0) - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - lw $t2, 12($t2) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - lw $a0, 12($a0) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # LOCAL local_length_at_String_internal_1 --> -8($fp) - # LOCAL local_length_at_String_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -4($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_length_at_String_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Main - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - # Load type offset - li $t0, 24 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t0, Main_vtable - # Get pointer to function address - lw $t1, 20($t0) - # Call function. Result is on $v0 - jalr $t1 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_c2i_at_A2I implementation. -# @Params: -# 0($fp) = param_c2i_at_A2I_char_0 -function_c2i_at_A2I: - # Allocate stack frame for function function_c2i_at_A2I. - subu $sp, $sp, 264 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 264 - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_4 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -20($fp) - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_3 - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_3 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_3 - # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_3 - # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_3 - lw $t0, -20($fp) - beq $t0, 0, label_FALSE_3 - # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_6 - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_6 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_6 - # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_7 - # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_7 - # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -20($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_4 - # GOTO label_FALSE_3 - j label_FALSE_3 - label_COMPARE_BY_VALUE_7: - # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - lw $a0, 0($fp) - lw $a1, -20($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_4 - # GOTO label_FALSE_3 - j label_FALSE_3 - label_COMPARE_STRING_6: - # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_CONTINUE_8 - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_CONTINUE_8 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_8 - # GOTO label_FALSE_3 - j label_FALSE_3 - label_CONTINUE_8: - # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_9: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_10 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_9 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_10: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 - # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_4 - label_FALSE_3: - # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_5 -j label_END_5 -label_TRUE_4: - # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_5: -# LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) -# LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSEIF_1 -# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSEIF_1 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_1 -# LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -24($fp) -# LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) -# LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) -# local_c2i_at_A2I_internal_1 = local_c2i_at_A2I_internal_5 -lw $t0, -24($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_2 -j label_ENDIF_2 -label_FALSEIF_1: - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_5 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -44($fp) - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_13 - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_13 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_13 - # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_13 - # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_13 - lw $t0, -44($fp) - beq $t0, 0, label_FALSE_13 - # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_STRING_16 - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_STRING_16 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_STRING_16 - # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_17 - # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_17 - # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -44($fp) - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_14 - # GOTO label_FALSE_13 - j label_FALSE_13 - label_COMPARE_BY_VALUE_17: - # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - lw $a0, 0($fp) - lw $a1, -44($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_14 - # GOTO label_FALSE_13 - j label_FALSE_13 - label_COMPARE_STRING_16: - # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -44($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -40($fp) - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_CONTINUE_18 - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_CONTINUE_18 - lw $t0, -40($fp) - beq $t0, 0, label_CONTINUE_18 - # GOTO label_FALSE_13 - j label_FALSE_13 - label_CONTINUE_18: - # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -44($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_19: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_20 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_19 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_20: - # Store result - sw $a2, -40($fp) - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 - # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_14 - label_FALSE_13: - # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -36($fp) - # GOTO label_END_15 -j label_END_15 -label_TRUE_14: - # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -36($fp) - label_END_15: -# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) -# LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) -# Obtain value from -36($fp) -lw $v0, -36($fp) -lw $v0, 12($v0) -sw $v0, -28($fp) -# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSEIF_11 -# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSEIF_11 -lw $t0, -28($fp) -beq $t0, 0, label_FALSEIF_11 -# LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -48($fp) -# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) -# LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) -# local_c2i_at_A2I_internal_7 = local_c2i_at_A2I_internal_11 -lw $t0, -48($fp) -sw $t0, -32($fp) -# GOTO label_ENDIF_12 -j label_ENDIF_12 -label_FALSEIF_11: - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_6 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -68($fp) - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_23 - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_23 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_23 - # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_23 - # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_23 - lw $t0, -68($fp) - beq $t0, 0, label_FALSE_23 - # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_STRING_26 - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_STRING_26 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_STRING_26 - # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_27 - # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_27 - # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -68($fp) - sub $a0, $a0, $a1 - sw $a0, -64($fp) - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_24 - # GOTO label_FALSE_23 - j label_FALSE_23 - label_COMPARE_BY_VALUE_27: - # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - lw $a0, 0($fp) - lw $a1, -68($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -64($fp) - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_24 - # GOTO label_FALSE_23 - j label_FALSE_23 - label_COMPARE_STRING_26: - # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -68($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -64($fp) - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_CONTINUE_28 - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_CONTINUE_28 - lw $t0, -64($fp) - beq $t0, 0, label_CONTINUE_28 - # GOTO label_FALSE_23 - j label_FALSE_23 - label_CONTINUE_28: - # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -68($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_29: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_30 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_29 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_30: - # Store result - sw $a2, -64($fp) - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 - # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_24 - label_FALSE_23: - # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -60($fp) - # GOTO label_END_25 -j label_END_25 -label_TRUE_24: - # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -60($fp) - label_END_25: -# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) -# LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) -# Obtain value from -60($fp) -lw $v0, -60($fp) -lw $v0, 12($v0) -sw $v0, -52($fp) -# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSEIF_21 -# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSEIF_21 -lw $t0, -52($fp) -beq $t0, 0, label_FALSEIF_21 -# LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 2 -sw $t0, 12($v0) -sw $v0, -72($fp) -# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) -# LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) -# local_c2i_at_A2I_internal_13 = local_c2i_at_A2I_internal_17 -lw $t0, -72($fp) -sw $t0, -56($fp) -# GOTO label_ENDIF_22 -j label_ENDIF_22 -label_FALSEIF_21: - # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_7 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -92($fp) - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_33 - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_33 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_33 - # IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_FALSE_33 - # IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_FALSE_33 - lw $t0, -92($fp) - beq $t0, 0, label_FALSE_33 - # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_STRING_36 - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_STRING_36 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_STRING_36 - # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_37 - # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_37 - # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -92($fp) - sub $a0, $a0, $a1 - sw $a0, -88($fp) - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_34 - # GOTO label_FALSE_33 - j label_FALSE_33 - label_COMPARE_BY_VALUE_37: - # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) - lw $a0, 0($fp) - lw $a1, -92($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -88($fp) - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_34 - # GOTO label_FALSE_33 - j label_FALSE_33 - label_COMPARE_STRING_36: - # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -92($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -88($fp) - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_CONTINUE_38 - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_CONTINUE_38 - lw $t0, -88($fp) - beq $t0, 0, label_CONTINUE_38 - # GOTO label_FALSE_33 - j label_FALSE_33 - label_CONTINUE_38: - # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -92($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_39: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_40 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_39 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_40: - # Store result - sw $a2, -88($fp) - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 - # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_34 - label_FALSE_33: - # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -84($fp) - # GOTO label_END_35 -j label_END_35 -label_TRUE_34: - # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -84($fp) - label_END_35: -# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) -# LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) -# Obtain value from -84($fp) -lw $v0, -84($fp) -lw $v0, 12($v0) -sw $v0, -76($fp) -# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSEIF_31 -# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSEIF_31 -lw $t0, -76($fp) -beq $t0, 0, label_FALSEIF_31 -# LOCAL local_c2i_at_A2I_internal_23 --> -96($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 3 -sw $t0, 12($v0) -sw $v0, -96($fp) -# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) -# LOCAL local_c2i_at_A2I_internal_23 --> -96($fp) -# local_c2i_at_A2I_internal_19 = local_c2i_at_A2I_internal_23 -lw $t0, -96($fp) -sw $t0, -80($fp) -# GOTO label_ENDIF_32 -j label_ENDIF_32 -label_FALSEIF_31: - # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_8 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -116($fp) - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_43 - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_43 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_43 - # IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_FALSE_43 - # IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_FALSE_43 - lw $t0, -116($fp) - beq $t0, 0, label_FALSE_43 - # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -112($fp) - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_STRING_46 - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_STRING_46 - lw $t0, -112($fp) - beq $t0, 0, label_COMPARE_STRING_46 - # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -112($fp) - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 - lw $t0, -112($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_47 - # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -112($fp) - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 - lw $t0, -112($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_47 - # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -116($fp) - sub $a0, $a0, $a1 - sw $a0, -112($fp) - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 - lw $t0, -112($fp) - beq $t0, 0, label_TRUE_44 - # GOTO label_FALSE_43 - j label_FALSE_43 - label_COMPARE_BY_VALUE_47: - # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) - lw $a0, 0($fp) - lw $a1, -116($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -112($fp) - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 - lw $t0, -112($fp) - beq $t0, 0, label_TRUE_44 - # GOTO label_FALSE_43 - j label_FALSE_43 - label_COMPARE_STRING_46: - # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -116($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -112($fp) - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_CONTINUE_48 - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_CONTINUE_48 - lw $t0, -112($fp) - beq $t0, 0, label_CONTINUE_48 - # GOTO label_FALSE_43 - j label_FALSE_43 - label_CONTINUE_48: - # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -116($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_49: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_50 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_49 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_50: - # Store result - sw $a2, -112($fp) - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 - # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 - lw $t0, -112($fp) - beq $t0, 0, label_TRUE_44 - label_FALSE_43: - # LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -108($fp) - # GOTO label_END_45 -j label_END_45 -label_TRUE_44: - # LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -108($fp) - label_END_45: -# LOCAL local_c2i_at_A2I_internal_24 --> -100($fp) -# LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) -# Obtain value from -108($fp) -lw $v0, -108($fp) -lw $v0, 12($v0) -sw $v0, -100($fp) -# IF_ZERO local_c2i_at_A2I_internal_24 GOTO label_FALSEIF_41 -# IF_ZERO local_c2i_at_A2I_internal_24 GOTO label_FALSEIF_41 -lw $t0, -100($fp) -beq $t0, 0, label_FALSEIF_41 -# LOCAL local_c2i_at_A2I_internal_29 --> -120($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 4 -sw $t0, 12($v0) -sw $v0, -120($fp) -# LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) -# LOCAL local_c2i_at_A2I_internal_29 --> -120($fp) -# local_c2i_at_A2I_internal_25 = local_c2i_at_A2I_internal_29 -lw $t0, -120($fp) -sw $t0, -104($fp) -# GOTO label_ENDIF_42 -j label_ENDIF_42 -label_FALSEIF_41: - # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_9 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -140($fp) - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_53 - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_53 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_53 - # IF_ZERO local_c2i_at_A2I_internal_34 GOTO label_FALSE_53 - # IF_ZERO local_c2i_at_A2I_internal_34 GOTO label_FALSE_53 - lw $t0, -140($fp) - beq $t0, 0, label_FALSE_53 - # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -136($fp) - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_STRING_56 - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_STRING_56 - lw $t0, -136($fp) - beq $t0, 0, label_COMPARE_STRING_56 - # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -136($fp) - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 - lw $t0, -136($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_57 - # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -136($fp) - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 - lw $t0, -136($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_57 - # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -140($fp) - sub $a0, $a0, $a1 - sw $a0, -136($fp) - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 - lw $t0, -136($fp) - beq $t0, 0, label_TRUE_54 - # GOTO label_FALSE_53 - j label_FALSE_53 - label_COMPARE_BY_VALUE_57: - # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) - lw $a0, 0($fp) - lw $a1, -140($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -136($fp) - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 - lw $t0, -136($fp) - beq $t0, 0, label_TRUE_54 - # GOTO label_FALSE_53 - j label_FALSE_53 - label_COMPARE_STRING_56: - # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -140($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -136($fp) - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_CONTINUE_58 - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_CONTINUE_58 - lw $t0, -136($fp) - beq $t0, 0, label_CONTINUE_58 - # GOTO label_FALSE_53 - j label_FALSE_53 - label_CONTINUE_58: - # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -140($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_59: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_60 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_59 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_60: - # Store result - sw $a2, -136($fp) - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 - # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 - lw $t0, -136($fp) - beq $t0, 0, label_TRUE_54 - label_FALSE_53: - # LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -132($fp) - # GOTO label_END_55 -j label_END_55 -label_TRUE_54: - # LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -132($fp) - label_END_55: -# LOCAL local_c2i_at_A2I_internal_30 --> -124($fp) -# LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) -# Obtain value from -132($fp) -lw $v0, -132($fp) -lw $v0, 12($v0) -sw $v0, -124($fp) -# IF_ZERO local_c2i_at_A2I_internal_30 GOTO label_FALSEIF_51 -# IF_ZERO local_c2i_at_A2I_internal_30 GOTO label_FALSEIF_51 -lw $t0, -124($fp) -beq $t0, 0, label_FALSEIF_51 -# LOCAL local_c2i_at_A2I_internal_35 --> -144($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 5 -sw $t0, 12($v0) -sw $v0, -144($fp) -# LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) -# LOCAL local_c2i_at_A2I_internal_35 --> -144($fp) -# local_c2i_at_A2I_internal_31 = local_c2i_at_A2I_internal_35 -lw $t0, -144($fp) -sw $t0, -128($fp) -# GOTO label_ENDIF_52 -j label_ENDIF_52 -label_FALSEIF_51: - # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_10 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -164($fp) - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_63 - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_63 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_63 - # IF_ZERO local_c2i_at_A2I_internal_40 GOTO label_FALSE_63 - # IF_ZERO local_c2i_at_A2I_internal_40 GOTO label_FALSE_63 - lw $t0, -164($fp) - beq $t0, 0, label_FALSE_63 - # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -160($fp) - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_STRING_66 - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_STRING_66 - lw $t0, -160($fp) - beq $t0, 0, label_COMPARE_STRING_66 - # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -160($fp) - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 - lw $t0, -160($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_67 - # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -160($fp) - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 - lw $t0, -160($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_67 - # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -164($fp) - sub $a0, $a0, $a1 - sw $a0, -160($fp) - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 - lw $t0, -160($fp) - beq $t0, 0, label_TRUE_64 - # GOTO label_FALSE_63 - j label_FALSE_63 - label_COMPARE_BY_VALUE_67: - # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) - lw $a0, 0($fp) - lw $a1, -164($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -160($fp) - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 - lw $t0, -160($fp) - beq $t0, 0, label_TRUE_64 - # GOTO label_FALSE_63 - j label_FALSE_63 - label_COMPARE_STRING_66: - # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -164($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -160($fp) - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_CONTINUE_68 - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_CONTINUE_68 - lw $t0, -160($fp) - beq $t0, 0, label_CONTINUE_68 - # GOTO label_FALSE_63 - j label_FALSE_63 - label_CONTINUE_68: - # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -164($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_69: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_70 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_69 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_70: - # Store result - sw $a2, -160($fp) - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 - # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 - lw $t0, -160($fp) - beq $t0, 0, label_TRUE_64 - label_FALSE_63: - # LOCAL local_c2i_at_A2I_internal_38 --> -156($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -156($fp) - # GOTO label_END_65 -j label_END_65 -label_TRUE_64: - # LOCAL local_c2i_at_A2I_internal_38 --> -156($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -156($fp) - label_END_65: -# LOCAL local_c2i_at_A2I_internal_36 --> -148($fp) -# LOCAL local_c2i_at_A2I_internal_38 --> -156($fp) -# Obtain value from -156($fp) -lw $v0, -156($fp) -lw $v0, 12($v0) -sw $v0, -148($fp) -# IF_ZERO local_c2i_at_A2I_internal_36 GOTO label_FALSEIF_61 -# IF_ZERO local_c2i_at_A2I_internal_36 GOTO label_FALSEIF_61 -lw $t0, -148($fp) -beq $t0, 0, label_FALSEIF_61 -# LOCAL local_c2i_at_A2I_internal_41 --> -168($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 6 -sw $t0, 12($v0) -sw $v0, -168($fp) -# LOCAL local_c2i_at_A2I_internal_37 --> -152($fp) -# LOCAL local_c2i_at_A2I_internal_41 --> -168($fp) -# local_c2i_at_A2I_internal_37 = local_c2i_at_A2I_internal_41 -lw $t0, -168($fp) -sw $t0, -152($fp) -# GOTO label_ENDIF_62 -j label_ENDIF_62 -label_FALSEIF_61: - # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_11 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -188($fp) - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_73 - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_73 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_73 - # IF_ZERO local_c2i_at_A2I_internal_46 GOTO label_FALSE_73 - # IF_ZERO local_c2i_at_A2I_internal_46 GOTO label_FALSE_73 - lw $t0, -188($fp) - beq $t0, 0, label_FALSE_73 - # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -184($fp) - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_STRING_76 - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_STRING_76 - lw $t0, -184($fp) - beq $t0, 0, label_COMPARE_STRING_76 - # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -184($fp) - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 - lw $t0, -184($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_77 - # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -184($fp) - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 - lw $t0, -184($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_77 - # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -188($fp) - sub $a0, $a0, $a1 - sw $a0, -184($fp) - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 - lw $t0, -184($fp) - beq $t0, 0, label_TRUE_74 - # GOTO label_FALSE_73 - j label_FALSE_73 - label_COMPARE_BY_VALUE_77: - # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) - lw $a0, 0($fp) - lw $a1, -188($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -184($fp) - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 - lw $t0, -184($fp) - beq $t0, 0, label_TRUE_74 - # GOTO label_FALSE_73 - j label_FALSE_73 - label_COMPARE_STRING_76: - # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -188($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -184($fp) - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_CONTINUE_78 - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_CONTINUE_78 - lw $t0, -184($fp) - beq $t0, 0, label_CONTINUE_78 - # GOTO label_FALSE_73 - j label_FALSE_73 - label_CONTINUE_78: - # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -188($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_79: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_80 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_79 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_80: - # Store result - sw $a2, -184($fp) - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 - # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 - lw $t0, -184($fp) - beq $t0, 0, label_TRUE_74 - label_FALSE_73: - # LOCAL local_c2i_at_A2I_internal_44 --> -180($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -180($fp) - # GOTO label_END_75 -j label_END_75 -label_TRUE_74: - # LOCAL local_c2i_at_A2I_internal_44 --> -180($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -180($fp) - label_END_75: -# LOCAL local_c2i_at_A2I_internal_42 --> -172($fp) -# LOCAL local_c2i_at_A2I_internal_44 --> -180($fp) -# Obtain value from -180($fp) -lw $v0, -180($fp) -lw $v0, 12($v0) -sw $v0, -172($fp) -# IF_ZERO local_c2i_at_A2I_internal_42 GOTO label_FALSEIF_71 -# IF_ZERO local_c2i_at_A2I_internal_42 GOTO label_FALSEIF_71 -lw $t0, -172($fp) -beq $t0, 0, label_FALSEIF_71 -# LOCAL local_c2i_at_A2I_internal_47 --> -192($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 7 -sw $t0, 12($v0) -sw $v0, -192($fp) -# LOCAL local_c2i_at_A2I_internal_43 --> -176($fp) -# LOCAL local_c2i_at_A2I_internal_47 --> -192($fp) -# local_c2i_at_A2I_internal_43 = local_c2i_at_A2I_internal_47 -lw $t0, -192($fp) -sw $t0, -176($fp) -# GOTO label_ENDIF_72 -j label_ENDIF_72 -label_FALSEIF_71: - # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_12 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -212($fp) - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_83 - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_83 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_83 - # IF_ZERO local_c2i_at_A2I_internal_52 GOTO label_FALSE_83 - # IF_ZERO local_c2i_at_A2I_internal_52 GOTO label_FALSE_83 - lw $t0, -212($fp) - beq $t0, 0, label_FALSE_83 - # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -208($fp) - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_STRING_86 - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_STRING_86 - lw $t0, -208($fp) - beq $t0, 0, label_COMPARE_STRING_86 - # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -208($fp) - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 - lw $t0, -208($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_87 - # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -208($fp) - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 - lw $t0, -208($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_87 - # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -212($fp) - sub $a0, $a0, $a1 - sw $a0, -208($fp) - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 - lw $t0, -208($fp) - beq $t0, 0, label_TRUE_84 - # GOTO label_FALSE_83 - j label_FALSE_83 - label_COMPARE_BY_VALUE_87: - # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) - lw $a0, 0($fp) - lw $a1, -212($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -208($fp) - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 - lw $t0, -208($fp) - beq $t0, 0, label_TRUE_84 - # GOTO label_FALSE_83 - j label_FALSE_83 - label_COMPARE_STRING_86: - # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -212($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -208($fp) - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_CONTINUE_88 - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_CONTINUE_88 - lw $t0, -208($fp) - beq $t0, 0, label_CONTINUE_88 - # GOTO label_FALSE_83 - j label_FALSE_83 - label_CONTINUE_88: - # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -212($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_89: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_90 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_89 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_90: - # Store result - sw $a2, -208($fp) - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 - # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 - lw $t0, -208($fp) - beq $t0, 0, label_TRUE_84 - label_FALSE_83: - # LOCAL local_c2i_at_A2I_internal_50 --> -204($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -204($fp) - # GOTO label_END_85 -j label_END_85 -label_TRUE_84: - # LOCAL local_c2i_at_A2I_internal_50 --> -204($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -204($fp) - label_END_85: -# LOCAL local_c2i_at_A2I_internal_48 --> -196($fp) -# LOCAL local_c2i_at_A2I_internal_50 --> -204($fp) -# Obtain value from -204($fp) -lw $v0, -204($fp) -lw $v0, 12($v0) -sw $v0, -196($fp) -# IF_ZERO local_c2i_at_A2I_internal_48 GOTO label_FALSEIF_81 -# IF_ZERO local_c2i_at_A2I_internal_48 GOTO label_FALSEIF_81 -lw $t0, -196($fp) -beq $t0, 0, label_FALSEIF_81 -# LOCAL local_c2i_at_A2I_internal_53 --> -216($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 8 -sw $t0, 12($v0) -sw $v0, -216($fp) -# LOCAL local_c2i_at_A2I_internal_49 --> -200($fp) -# LOCAL local_c2i_at_A2I_internal_53 --> -216($fp) -# local_c2i_at_A2I_internal_49 = local_c2i_at_A2I_internal_53 -lw $t0, -216($fp) -sw $t0, -200($fp) -# GOTO label_ENDIF_82 -j label_ENDIF_82 -label_FALSEIF_81: - # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_13 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -236($fp) - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_93 - # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_93 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_93 - # IF_ZERO local_c2i_at_A2I_internal_58 GOTO label_FALSE_93 - # IF_ZERO local_c2i_at_A2I_internal_58 GOTO label_FALSE_93 - lw $t0, -236($fp) - beq $t0, 0, label_FALSE_93 - # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -232($fp) - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_STRING_96 - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_STRING_96 - lw $t0, -232($fp) - beq $t0, 0, label_COMPARE_STRING_96 - # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -232($fp) - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 - lw $t0, -232($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_97 - # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -232($fp) - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 - lw $t0, -232($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_97 - # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -236($fp) - sub $a0, $a0, $a1 - sw $a0, -232($fp) - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 - lw $t0, -232($fp) - beq $t0, 0, label_TRUE_94 - # GOTO label_FALSE_93 - j label_FALSE_93 - label_COMPARE_BY_VALUE_97: - # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) - lw $a0, 0($fp) - lw $a1, -236($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -232($fp) - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 - lw $t0, -232($fp) - beq $t0, 0, label_TRUE_94 - # GOTO label_FALSE_93 - j label_FALSE_93 - label_COMPARE_STRING_96: - # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -236($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -232($fp) - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_CONTINUE_98 - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_CONTINUE_98 - lw $t0, -232($fp) - beq $t0, 0, label_CONTINUE_98 - # GOTO label_FALSE_93 - j label_FALSE_93 - label_CONTINUE_98: - # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) - # PARAM param_c2i_at_A2I_char_0 --> 0($fp) - # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -236($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_99: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_100 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_99 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_100: - # Store result - sw $a2, -232($fp) - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 - # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 - lw $t0, -232($fp) - beq $t0, 0, label_TRUE_94 - label_FALSE_93: - # LOCAL local_c2i_at_A2I_internal_56 --> -228($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -228($fp) - # GOTO label_END_95 -j label_END_95 -label_TRUE_94: - # LOCAL local_c2i_at_A2I_internal_56 --> -228($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -228($fp) - label_END_95: -# LOCAL local_c2i_at_A2I_internal_54 --> -220($fp) -# LOCAL local_c2i_at_A2I_internal_56 --> -228($fp) -# Obtain value from -228($fp) -lw $v0, -228($fp) -lw $v0, 12($v0) -sw $v0, -220($fp) -# IF_ZERO local_c2i_at_A2I_internal_54 GOTO label_FALSEIF_91 -# IF_ZERO local_c2i_at_A2I_internal_54 GOTO label_FALSEIF_91 -lw $t0, -220($fp) -beq $t0, 0, label_FALSEIF_91 -# LOCAL local_c2i_at_A2I_internal_59 --> -240($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 9 -sw $t0, 12($v0) -sw $v0, -240($fp) -# LOCAL local_c2i_at_A2I_internal_55 --> -224($fp) -# LOCAL local_c2i_at_A2I_internal_59 --> -240($fp) -# local_c2i_at_A2I_internal_55 = local_c2i_at_A2I_internal_59 -lw $t0, -240($fp) -sw $t0, -224($fp) -# GOTO label_ENDIF_92 -j label_ENDIF_92 -label_FALSEIF_91: - # LOCAL local_c2i_at_A2I_internal_62 --> -252($fp) - # local_c2i_at_A2I_internal_62 = SELF - sw $s1, -252($fp) - # LOCAL local_c2i_at_A2I_internal_60 --> -244($fp) - # LOCAL local_c2i_at_A2I_internal_62 --> -252($fp) - # local_c2i_at_A2I_internal_60 = local_c2i_at_A2I_internal_62 - lw $t0, -252($fp) - sw $t0, -244($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_c2i_at_A2I_internal_60 --> -244($fp) - # LOCAL local_c2i_at_A2I_internal_61 --> -248($fp) - # local_c2i_at_A2I_internal_61 = VCALL local_c2i_at_A2I_internal_60 abort - # Save new self pointer in $s1 - lw $s1, -244($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 0($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -248($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_c2i_at_A2I_internal_63 --> -256($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -256($fp) - # LOCAL local_c2i_at_A2I_internal_55 --> -224($fp) - # LOCAL local_c2i_at_A2I_internal_63 --> -256($fp) - # local_c2i_at_A2I_internal_55 = local_c2i_at_A2I_internal_63 - lw $t0, -256($fp) - sw $t0, -224($fp) - label_ENDIF_92: -# LOCAL local_c2i_at_A2I_internal_49 --> -200($fp) -# LOCAL local_c2i_at_A2I_internal_55 --> -224($fp) -# local_c2i_at_A2I_internal_49 = local_c2i_at_A2I_internal_55 -lw $t0, -224($fp) -sw $t0, -200($fp) -label_ENDIF_82: -# LOCAL local_c2i_at_A2I_internal_43 --> -176($fp) -# LOCAL local_c2i_at_A2I_internal_49 --> -200($fp) -# local_c2i_at_A2I_internal_43 = local_c2i_at_A2I_internal_49 -lw $t0, -200($fp) -sw $t0, -176($fp) -label_ENDIF_72: -# LOCAL local_c2i_at_A2I_internal_37 --> -152($fp) -# LOCAL local_c2i_at_A2I_internal_43 --> -176($fp) -# local_c2i_at_A2I_internal_37 = local_c2i_at_A2I_internal_43 -lw $t0, -176($fp) -sw $t0, -152($fp) -label_ENDIF_62: -# LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) -# LOCAL local_c2i_at_A2I_internal_37 --> -152($fp) -# local_c2i_at_A2I_internal_31 = local_c2i_at_A2I_internal_37 -lw $t0, -152($fp) -sw $t0, -128($fp) -label_ENDIF_52: -# LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) -# LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) -# local_c2i_at_A2I_internal_25 = local_c2i_at_A2I_internal_31 -lw $t0, -128($fp) -sw $t0, -104($fp) -label_ENDIF_42: -# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) -# LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) -# local_c2i_at_A2I_internal_19 = local_c2i_at_A2I_internal_25 -lw $t0, -104($fp) -sw $t0, -80($fp) -label_ENDIF_32: -# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) -# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) -# local_c2i_at_A2I_internal_13 = local_c2i_at_A2I_internal_19 -lw $t0, -80($fp) -sw $t0, -56($fp) -label_ENDIF_22: -# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) -# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) -# local_c2i_at_A2I_internal_7 = local_c2i_at_A2I_internal_13 -lw $t0, -56($fp) -sw $t0, -32($fp) -label_ENDIF_12: -# LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) -# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) -# local_c2i_at_A2I_internal_1 = local_c2i_at_A2I_internal_7 -lw $t0, -32($fp) -sw $t0, -8($fp) -label_ENDIF_2: -# RETURN local_c2i_at_A2I_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_c2i_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 264 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_i2c_at_A2I implementation. -# @Params: -# 0($fp) = param_i2c_at_A2I_i_0 -function_i2c_at_A2I: - # Allocate stack frame for function function_i2c_at_A2I. - subu $sp, $sp, 264 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 264 - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -20($fp) - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_103 - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_103 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_103 - # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_103 - # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_103 - lw $t0, -20($fp) - beq $t0, 0, label_FALSE_103 - # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_STRING_106 - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_STRING_106 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_106 - # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_107 - # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_107 - # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -20($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_104 - # GOTO label_FALSE_103 - j label_FALSE_103 - label_COMPARE_BY_VALUE_107: - # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - lw $a0, 0($fp) - lw $a1, -20($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_104 - # GOTO label_FALSE_103 - j label_FALSE_103 - label_COMPARE_STRING_106: - # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_CONTINUE_108 - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_CONTINUE_108 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_108 - # GOTO label_FALSE_103 - j label_FALSE_103 - label_CONTINUE_108: - # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_109: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_110 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_109 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_110: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 - # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_104 - label_FALSE_103: - # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_105 -j label_END_105 -label_TRUE_104: - # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_105: -# LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) -# LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSEIF_101 -# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSEIF_101 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_101 -# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_14 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -24($fp) -# LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) -# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) -# local_i2c_at_A2I_internal_1 = local_i2c_at_A2I_internal_5 -lw $t0, -24($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_102 -j label_ENDIF_102 -label_FALSEIF_101: - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -44($fp) - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_113 - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_113 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_113 - # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_113 - # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_113 - lw $t0, -44($fp) - beq $t0, 0, label_FALSE_113 - # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_STRING_116 - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_STRING_116 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_STRING_116 - # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_117 - # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_117 - # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -44($fp) - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_114 - # GOTO label_FALSE_113 - j label_FALSE_113 - label_COMPARE_BY_VALUE_117: - # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - lw $a0, 0($fp) - lw $a1, -44($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_114 - # GOTO label_FALSE_113 - j label_FALSE_113 - label_COMPARE_STRING_116: - # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -44($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -40($fp) - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_CONTINUE_118 - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_CONTINUE_118 - lw $t0, -40($fp) - beq $t0, 0, label_CONTINUE_118 - # GOTO label_FALSE_113 - j label_FALSE_113 - label_CONTINUE_118: - # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -44($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_119: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_120 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_119 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_120: - # Store result - sw $a2, -40($fp) - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 - # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_114 - label_FALSE_113: - # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -36($fp) - # GOTO label_END_115 -j label_END_115 -label_TRUE_114: - # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -36($fp) - label_END_115: -# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) -# LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) -# Obtain value from -36($fp) -lw $v0, -36($fp) -lw $v0, 12($v0) -sw $v0, -28($fp) -# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSEIF_111 -# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSEIF_111 -lw $t0, -28($fp) -beq $t0, 0, label_FALSEIF_111 -# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_15 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -48($fp) -# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) -# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) -# local_i2c_at_A2I_internal_7 = local_i2c_at_A2I_internal_11 -lw $t0, -48($fp) -sw $t0, -32($fp) -# GOTO label_ENDIF_112 -j label_ENDIF_112 -label_FALSEIF_111: - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 2 - sw $t0, 12($v0) - sw $v0, -68($fp) - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_123 - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_123 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_123 - # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_123 - # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_123 - lw $t0, -68($fp) - beq $t0, 0, label_FALSE_123 - # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_STRING_126 - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_STRING_126 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_STRING_126 - # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_127 - # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_127 - # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -68($fp) - sub $a0, $a0, $a1 - sw $a0, -64($fp) - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_124 - # GOTO label_FALSE_123 - j label_FALSE_123 - label_COMPARE_BY_VALUE_127: - # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - lw $a0, 0($fp) - lw $a1, -68($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -64($fp) - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_124 - # GOTO label_FALSE_123 - j label_FALSE_123 - label_COMPARE_STRING_126: - # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -68($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -64($fp) - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_CONTINUE_128 - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_CONTINUE_128 - lw $t0, -64($fp) - beq $t0, 0, label_CONTINUE_128 - # GOTO label_FALSE_123 - j label_FALSE_123 - label_CONTINUE_128: - # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -68($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_129: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_130 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_129 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_130: - # Store result - sw $a2, -64($fp) - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 - # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_124 - label_FALSE_123: - # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -60($fp) - # GOTO label_END_125 -j label_END_125 -label_TRUE_124: - # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -60($fp) - label_END_125: -# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) -# LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) -# Obtain value from -60($fp) -lw $v0, -60($fp) -lw $v0, 12($v0) -sw $v0, -52($fp) -# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSEIF_121 -# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSEIF_121 -lw $t0, -52($fp) -beq $t0, 0, label_FALSEIF_121 -# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_16 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -72($fp) -# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) -# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) -# local_i2c_at_A2I_internal_13 = local_i2c_at_A2I_internal_17 -lw $t0, -72($fp) -sw $t0, -56($fp) -# GOTO label_ENDIF_122 -j label_ENDIF_122 -label_FALSEIF_121: - # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 3 - sw $t0, 12($v0) - sw $v0, -92($fp) - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_133 - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_133 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_133 - # IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_FALSE_133 - # IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_FALSE_133 - lw $t0, -92($fp) - beq $t0, 0, label_FALSE_133 - # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_STRING_136 - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_STRING_136 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_STRING_136 - # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_137 - # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_137 - # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -92($fp) - sub $a0, $a0, $a1 - sw $a0, -88($fp) - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_134 - # GOTO label_FALSE_133 - j label_FALSE_133 - label_COMPARE_BY_VALUE_137: - # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) - lw $a0, 0($fp) - lw $a1, -92($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -88($fp) - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_134 - # GOTO label_FALSE_133 - j label_FALSE_133 - label_COMPARE_STRING_136: - # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -92($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -88($fp) - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_CONTINUE_138 - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_CONTINUE_138 - lw $t0, -88($fp) - beq $t0, 0, label_CONTINUE_138 - # GOTO label_FALSE_133 - j label_FALSE_133 - label_CONTINUE_138: - # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -92($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_139: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_140 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_139 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_140: - # Store result - sw $a2, -88($fp) - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 - # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_134 - label_FALSE_133: - # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -84($fp) - # GOTO label_END_135 -j label_END_135 -label_TRUE_134: - # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -84($fp) - label_END_135: -# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) -# LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) -# Obtain value from -84($fp) -lw $v0, -84($fp) -lw $v0, 12($v0) -sw $v0, -76($fp) -# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSEIF_131 -# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSEIF_131 -lw $t0, -76($fp) -beq $t0, 0, label_FALSEIF_131 -# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_17 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -96($fp) -# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) -# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) -# local_i2c_at_A2I_internal_19 = local_i2c_at_A2I_internal_23 -lw $t0, -96($fp) -sw $t0, -80($fp) -# GOTO label_ENDIF_132 -j label_ENDIF_132 -label_FALSEIF_131: - # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 4 - sw $t0, 12($v0) - sw $v0, -116($fp) - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_143 - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_143 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_143 - # IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_FALSE_143 - # IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_FALSE_143 - lw $t0, -116($fp) - beq $t0, 0, label_FALSE_143 - # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -112($fp) - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_STRING_146 - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_STRING_146 - lw $t0, -112($fp) - beq $t0, 0, label_COMPARE_STRING_146 - # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -112($fp) - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 - lw $t0, -112($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_147 - # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -112($fp) - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 - lw $t0, -112($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_147 - # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -116($fp) - sub $a0, $a0, $a1 - sw $a0, -112($fp) - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 - lw $t0, -112($fp) - beq $t0, 0, label_TRUE_144 - # GOTO label_FALSE_143 - j label_FALSE_143 - label_COMPARE_BY_VALUE_147: - # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) - lw $a0, 0($fp) - lw $a1, -116($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -112($fp) - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 - lw $t0, -112($fp) - beq $t0, 0, label_TRUE_144 - # GOTO label_FALSE_143 - j label_FALSE_143 - label_COMPARE_STRING_146: - # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -116($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -112($fp) - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_CONTINUE_148 - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_CONTINUE_148 - lw $t0, -112($fp) - beq $t0, 0, label_CONTINUE_148 - # GOTO label_FALSE_143 - j label_FALSE_143 - label_CONTINUE_148: - # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -116($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_149: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_150 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_149 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_150: - # Store result - sw $a2, -112($fp) - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 - # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 - lw $t0, -112($fp) - beq $t0, 0, label_TRUE_144 - label_FALSE_143: - # LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -108($fp) - # GOTO label_END_145 -j label_END_145 -label_TRUE_144: - # LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -108($fp) - label_END_145: -# LOCAL local_i2c_at_A2I_internal_24 --> -100($fp) -# LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) -# Obtain value from -108($fp) -lw $v0, -108($fp) -lw $v0, 12($v0) -sw $v0, -100($fp) -# IF_ZERO local_i2c_at_A2I_internal_24 GOTO label_FALSEIF_141 -# IF_ZERO local_i2c_at_A2I_internal_24 GOTO label_FALSEIF_141 -lw $t0, -100($fp) -beq $t0, 0, label_FALSEIF_141 -# LOCAL local_i2c_at_A2I_internal_29 --> -120($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_18 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -120($fp) -# LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) -# LOCAL local_i2c_at_A2I_internal_29 --> -120($fp) -# local_i2c_at_A2I_internal_25 = local_i2c_at_A2I_internal_29 -lw $t0, -120($fp) -sw $t0, -104($fp) -# GOTO label_ENDIF_142 -j label_ENDIF_142 -label_FALSEIF_141: - # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 5 - sw $t0, 12($v0) - sw $v0, -140($fp) - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_153 - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_153 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_153 - # IF_ZERO local_i2c_at_A2I_internal_34 GOTO label_FALSE_153 - # IF_ZERO local_i2c_at_A2I_internal_34 GOTO label_FALSE_153 - lw $t0, -140($fp) - beq $t0, 0, label_FALSE_153 - # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -136($fp) - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_STRING_156 - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_STRING_156 - lw $t0, -136($fp) - beq $t0, 0, label_COMPARE_STRING_156 - # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -136($fp) - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 - lw $t0, -136($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_157 - # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -136($fp) - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 - lw $t0, -136($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_157 - # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -140($fp) - sub $a0, $a0, $a1 - sw $a0, -136($fp) - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 - lw $t0, -136($fp) - beq $t0, 0, label_TRUE_154 - # GOTO label_FALSE_153 - j label_FALSE_153 - label_COMPARE_BY_VALUE_157: - # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) - lw $a0, 0($fp) - lw $a1, -140($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -136($fp) - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 - lw $t0, -136($fp) - beq $t0, 0, label_TRUE_154 - # GOTO label_FALSE_153 - j label_FALSE_153 - label_COMPARE_STRING_156: - # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -140($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -136($fp) - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_CONTINUE_158 - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_CONTINUE_158 - lw $t0, -136($fp) - beq $t0, 0, label_CONTINUE_158 - # GOTO label_FALSE_153 - j label_FALSE_153 - label_CONTINUE_158: - # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -140($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_159: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_160 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_159 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_160: - # Store result - sw $a2, -136($fp) - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 - # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 - lw $t0, -136($fp) - beq $t0, 0, label_TRUE_154 - label_FALSE_153: - # LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -132($fp) - # GOTO label_END_155 -j label_END_155 -label_TRUE_154: - # LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -132($fp) - label_END_155: -# LOCAL local_i2c_at_A2I_internal_30 --> -124($fp) -# LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) -# Obtain value from -132($fp) -lw $v0, -132($fp) -lw $v0, 12($v0) -sw $v0, -124($fp) -# IF_ZERO local_i2c_at_A2I_internal_30 GOTO label_FALSEIF_151 -# IF_ZERO local_i2c_at_A2I_internal_30 GOTO label_FALSEIF_151 -lw $t0, -124($fp) -beq $t0, 0, label_FALSEIF_151 -# LOCAL local_i2c_at_A2I_internal_35 --> -144($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_19 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -144($fp) -# LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) -# LOCAL local_i2c_at_A2I_internal_35 --> -144($fp) -# local_i2c_at_A2I_internal_31 = local_i2c_at_A2I_internal_35 -lw $t0, -144($fp) -sw $t0, -128($fp) -# GOTO label_ENDIF_152 -j label_ENDIF_152 -label_FALSEIF_151: - # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 6 - sw $t0, 12($v0) - sw $v0, -164($fp) - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_163 - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_163 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_163 - # IF_ZERO local_i2c_at_A2I_internal_40 GOTO label_FALSE_163 - # IF_ZERO local_i2c_at_A2I_internal_40 GOTO label_FALSE_163 - lw $t0, -164($fp) - beq $t0, 0, label_FALSE_163 - # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -160($fp) - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_STRING_166 - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_STRING_166 - lw $t0, -160($fp) - beq $t0, 0, label_COMPARE_STRING_166 - # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -160($fp) - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 - lw $t0, -160($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_167 - # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -160($fp) - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 - lw $t0, -160($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_167 - # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -164($fp) - sub $a0, $a0, $a1 - sw $a0, -160($fp) - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 - lw $t0, -160($fp) - beq $t0, 0, label_TRUE_164 - # GOTO label_FALSE_163 - j label_FALSE_163 - label_COMPARE_BY_VALUE_167: - # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) - lw $a0, 0($fp) - lw $a1, -164($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -160($fp) - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 - lw $t0, -160($fp) - beq $t0, 0, label_TRUE_164 - # GOTO label_FALSE_163 - j label_FALSE_163 - label_COMPARE_STRING_166: - # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -164($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -160($fp) - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_CONTINUE_168 - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_CONTINUE_168 - lw $t0, -160($fp) - beq $t0, 0, label_CONTINUE_168 - # GOTO label_FALSE_163 - j label_FALSE_163 - label_CONTINUE_168: - # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -164($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_169: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_170 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_169 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_170: - # Store result - sw $a2, -160($fp) - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 - # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 - lw $t0, -160($fp) - beq $t0, 0, label_TRUE_164 - label_FALSE_163: - # LOCAL local_i2c_at_A2I_internal_38 --> -156($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -156($fp) - # GOTO label_END_165 -j label_END_165 -label_TRUE_164: - # LOCAL local_i2c_at_A2I_internal_38 --> -156($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -156($fp) - label_END_165: -# LOCAL local_i2c_at_A2I_internal_36 --> -148($fp) -# LOCAL local_i2c_at_A2I_internal_38 --> -156($fp) -# Obtain value from -156($fp) -lw $v0, -156($fp) -lw $v0, 12($v0) -sw $v0, -148($fp) -# IF_ZERO local_i2c_at_A2I_internal_36 GOTO label_FALSEIF_161 -# IF_ZERO local_i2c_at_A2I_internal_36 GOTO label_FALSEIF_161 -lw $t0, -148($fp) -beq $t0, 0, label_FALSEIF_161 -# LOCAL local_i2c_at_A2I_internal_41 --> -168($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_20 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -168($fp) -# LOCAL local_i2c_at_A2I_internal_37 --> -152($fp) -# LOCAL local_i2c_at_A2I_internal_41 --> -168($fp) -# local_i2c_at_A2I_internal_37 = local_i2c_at_A2I_internal_41 -lw $t0, -168($fp) -sw $t0, -152($fp) -# GOTO label_ENDIF_162 -j label_ENDIF_162 -label_FALSEIF_161: - # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 7 - sw $t0, 12($v0) - sw $v0, -188($fp) - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_173 - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_173 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_173 - # IF_ZERO local_i2c_at_A2I_internal_46 GOTO label_FALSE_173 - # IF_ZERO local_i2c_at_A2I_internal_46 GOTO label_FALSE_173 - lw $t0, -188($fp) - beq $t0, 0, label_FALSE_173 - # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -184($fp) - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_STRING_176 - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_STRING_176 - lw $t0, -184($fp) - beq $t0, 0, label_COMPARE_STRING_176 - # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -184($fp) - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 - lw $t0, -184($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_177 - # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -184($fp) - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 - lw $t0, -184($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_177 - # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -188($fp) - sub $a0, $a0, $a1 - sw $a0, -184($fp) - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 - lw $t0, -184($fp) - beq $t0, 0, label_TRUE_174 - # GOTO label_FALSE_173 - j label_FALSE_173 - label_COMPARE_BY_VALUE_177: - # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) - lw $a0, 0($fp) - lw $a1, -188($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -184($fp) - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 - lw $t0, -184($fp) - beq $t0, 0, label_TRUE_174 - # GOTO label_FALSE_173 - j label_FALSE_173 - label_COMPARE_STRING_176: - # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -188($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -184($fp) - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_CONTINUE_178 - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_CONTINUE_178 - lw $t0, -184($fp) - beq $t0, 0, label_CONTINUE_178 - # GOTO label_FALSE_173 - j label_FALSE_173 - label_CONTINUE_178: - # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -188($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_179: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_180 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_179 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_180: - # Store result - sw $a2, -184($fp) - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 - # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 - lw $t0, -184($fp) - beq $t0, 0, label_TRUE_174 - label_FALSE_173: - # LOCAL local_i2c_at_A2I_internal_44 --> -180($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -180($fp) - # GOTO label_END_175 -j label_END_175 -label_TRUE_174: - # LOCAL local_i2c_at_A2I_internal_44 --> -180($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -180($fp) - label_END_175: -# LOCAL local_i2c_at_A2I_internal_42 --> -172($fp) -# LOCAL local_i2c_at_A2I_internal_44 --> -180($fp) -# Obtain value from -180($fp) -lw $v0, -180($fp) -lw $v0, 12($v0) -sw $v0, -172($fp) -# IF_ZERO local_i2c_at_A2I_internal_42 GOTO label_FALSEIF_171 -# IF_ZERO local_i2c_at_A2I_internal_42 GOTO label_FALSEIF_171 -lw $t0, -172($fp) -beq $t0, 0, label_FALSEIF_171 -# LOCAL local_i2c_at_A2I_internal_47 --> -192($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_21 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -192($fp) -# LOCAL local_i2c_at_A2I_internal_43 --> -176($fp) -# LOCAL local_i2c_at_A2I_internal_47 --> -192($fp) -# local_i2c_at_A2I_internal_43 = local_i2c_at_A2I_internal_47 -lw $t0, -192($fp) -sw $t0, -176($fp) -# GOTO label_ENDIF_172 -j label_ENDIF_172 -label_FALSEIF_171: - # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 8 - sw $t0, 12($v0) - sw $v0, -212($fp) - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_183 - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_183 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_183 - # IF_ZERO local_i2c_at_A2I_internal_52 GOTO label_FALSE_183 - # IF_ZERO local_i2c_at_A2I_internal_52 GOTO label_FALSE_183 - lw $t0, -212($fp) - beq $t0, 0, label_FALSE_183 - # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -208($fp) - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_STRING_186 - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_STRING_186 - lw $t0, -208($fp) - beq $t0, 0, label_COMPARE_STRING_186 - # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -208($fp) - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 - lw $t0, -208($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_187 - # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -208($fp) - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 - lw $t0, -208($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_187 - # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -212($fp) - sub $a0, $a0, $a1 - sw $a0, -208($fp) - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 - lw $t0, -208($fp) - beq $t0, 0, label_TRUE_184 - # GOTO label_FALSE_183 - j label_FALSE_183 - label_COMPARE_BY_VALUE_187: - # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) - lw $a0, 0($fp) - lw $a1, -212($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -208($fp) - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 - lw $t0, -208($fp) - beq $t0, 0, label_TRUE_184 - # GOTO label_FALSE_183 - j label_FALSE_183 - label_COMPARE_STRING_186: - # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -212($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -208($fp) - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_CONTINUE_188 - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_CONTINUE_188 - lw $t0, -208($fp) - beq $t0, 0, label_CONTINUE_188 - # GOTO label_FALSE_183 - j label_FALSE_183 - label_CONTINUE_188: - # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -212($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_189: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_190 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_189 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_190: - # Store result - sw $a2, -208($fp) - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 - # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 - lw $t0, -208($fp) - beq $t0, 0, label_TRUE_184 - label_FALSE_183: - # LOCAL local_i2c_at_A2I_internal_50 --> -204($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -204($fp) - # GOTO label_END_185 -j label_END_185 -label_TRUE_184: - # LOCAL local_i2c_at_A2I_internal_50 --> -204($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -204($fp) - label_END_185: -# LOCAL local_i2c_at_A2I_internal_48 --> -196($fp) -# LOCAL local_i2c_at_A2I_internal_50 --> -204($fp) -# Obtain value from -204($fp) -lw $v0, -204($fp) -lw $v0, 12($v0) -sw $v0, -196($fp) -# IF_ZERO local_i2c_at_A2I_internal_48 GOTO label_FALSEIF_181 -# IF_ZERO local_i2c_at_A2I_internal_48 GOTO label_FALSEIF_181 -lw $t0, -196($fp) -beq $t0, 0, label_FALSEIF_181 -# LOCAL local_i2c_at_A2I_internal_53 --> -216($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_22 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -216($fp) -# LOCAL local_i2c_at_A2I_internal_49 --> -200($fp) -# LOCAL local_i2c_at_A2I_internal_53 --> -216($fp) -# local_i2c_at_A2I_internal_49 = local_i2c_at_A2I_internal_53 -lw $t0, -216($fp) -sw $t0, -200($fp) -# GOTO label_ENDIF_182 -j label_ENDIF_182 -label_FALSEIF_181: - # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 9 - sw $t0, 12($v0) - sw $v0, -236($fp) - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_193 - # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_193 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_193 - # IF_ZERO local_i2c_at_A2I_internal_58 GOTO label_FALSE_193 - # IF_ZERO local_i2c_at_A2I_internal_58 GOTO label_FALSE_193 - lw $t0, -236($fp) - beq $t0, 0, label_FALSE_193 - # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -232($fp) - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_STRING_196 - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_STRING_196 - lw $t0, -232($fp) - beq $t0, 0, label_COMPARE_STRING_196 - # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -232($fp) - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 - lw $t0, -232($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_197 - # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -232($fp) - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 - lw $t0, -232($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_197 - # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -236($fp) - sub $a0, $a0, $a1 - sw $a0, -232($fp) - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 - lw $t0, -232($fp) - beq $t0, 0, label_TRUE_194 - # GOTO label_FALSE_193 - j label_FALSE_193 - label_COMPARE_BY_VALUE_197: - # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) - lw $a0, 0($fp) - lw $a1, -236($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -232($fp) - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 - lw $t0, -232($fp) - beq $t0, 0, label_TRUE_194 - # GOTO label_FALSE_193 - j label_FALSE_193 - label_COMPARE_STRING_196: - # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -236($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -232($fp) - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_CONTINUE_198 - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_CONTINUE_198 - lw $t0, -232($fp) - beq $t0, 0, label_CONTINUE_198 - # GOTO label_FALSE_193 - j label_FALSE_193 - label_CONTINUE_198: - # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) - # PARAM param_i2c_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -236($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_199: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_200 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_199 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_200: - # Store result - sw $a2, -232($fp) - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 - # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 - lw $t0, -232($fp) - beq $t0, 0, label_TRUE_194 - label_FALSE_193: - # LOCAL local_i2c_at_A2I_internal_56 --> -228($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -228($fp) - # GOTO label_END_195 -j label_END_195 -label_TRUE_194: - # LOCAL local_i2c_at_A2I_internal_56 --> -228($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -228($fp) - label_END_195: -# LOCAL local_i2c_at_A2I_internal_54 --> -220($fp) -# LOCAL local_i2c_at_A2I_internal_56 --> -228($fp) -# Obtain value from -228($fp) -lw $v0, -228($fp) -lw $v0, 12($v0) -sw $v0, -220($fp) -# IF_ZERO local_i2c_at_A2I_internal_54 GOTO label_FALSEIF_191 -# IF_ZERO local_i2c_at_A2I_internal_54 GOTO label_FALSEIF_191 -lw $t0, -220($fp) -beq $t0, 0, label_FALSEIF_191 -# LOCAL local_i2c_at_A2I_internal_59 --> -240($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_23 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -240($fp) -# LOCAL local_i2c_at_A2I_internal_55 --> -224($fp) -# LOCAL local_i2c_at_A2I_internal_59 --> -240($fp) -# local_i2c_at_A2I_internal_55 = local_i2c_at_A2I_internal_59 -lw $t0, -240($fp) -sw $t0, -224($fp) -# GOTO label_ENDIF_192 -j label_ENDIF_192 -label_FALSEIF_191: - # LOCAL local_i2c_at_A2I_internal_62 --> -252($fp) - # local_i2c_at_A2I_internal_62 = SELF - sw $s1, -252($fp) - # LOCAL local_i2c_at_A2I_internal_60 --> -244($fp) - # LOCAL local_i2c_at_A2I_internal_62 --> -252($fp) - # local_i2c_at_A2I_internal_60 = local_i2c_at_A2I_internal_62 - lw $t0, -252($fp) - sw $t0, -244($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2c_at_A2I_internal_60 --> -244($fp) - # LOCAL local_i2c_at_A2I_internal_61 --> -248($fp) - # local_i2c_at_A2I_internal_61 = VCALL local_i2c_at_A2I_internal_60 abort - # Save new self pointer in $s1 - lw $s1, -244($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 0($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -248($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_i2c_at_A2I_internal_63 --> -256($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_24 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -256($fp) - # LOCAL local_i2c_at_A2I_internal_55 --> -224($fp) - # LOCAL local_i2c_at_A2I_internal_63 --> -256($fp) - # local_i2c_at_A2I_internal_55 = local_i2c_at_A2I_internal_63 - lw $t0, -256($fp) - sw $t0, -224($fp) - label_ENDIF_192: -# LOCAL local_i2c_at_A2I_internal_49 --> -200($fp) -# LOCAL local_i2c_at_A2I_internal_55 --> -224($fp) -# local_i2c_at_A2I_internal_49 = local_i2c_at_A2I_internal_55 -lw $t0, -224($fp) -sw $t0, -200($fp) -label_ENDIF_182: -# LOCAL local_i2c_at_A2I_internal_43 --> -176($fp) -# LOCAL local_i2c_at_A2I_internal_49 --> -200($fp) -# local_i2c_at_A2I_internal_43 = local_i2c_at_A2I_internal_49 -lw $t0, -200($fp) -sw $t0, -176($fp) -label_ENDIF_172: -# LOCAL local_i2c_at_A2I_internal_37 --> -152($fp) -# LOCAL local_i2c_at_A2I_internal_43 --> -176($fp) -# local_i2c_at_A2I_internal_37 = local_i2c_at_A2I_internal_43 -lw $t0, -176($fp) -sw $t0, -152($fp) -label_ENDIF_162: -# LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) -# LOCAL local_i2c_at_A2I_internal_37 --> -152($fp) -# local_i2c_at_A2I_internal_31 = local_i2c_at_A2I_internal_37 -lw $t0, -152($fp) -sw $t0, -128($fp) -label_ENDIF_152: -# LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) -# LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) -# local_i2c_at_A2I_internal_25 = local_i2c_at_A2I_internal_31 -lw $t0, -128($fp) -sw $t0, -104($fp) -label_ENDIF_142: -# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) -# LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) -# local_i2c_at_A2I_internal_19 = local_i2c_at_A2I_internal_25 -lw $t0, -104($fp) -sw $t0, -80($fp) -label_ENDIF_132: -# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) -# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) -# local_i2c_at_A2I_internal_13 = local_i2c_at_A2I_internal_19 -lw $t0, -80($fp) -sw $t0, -56($fp) -label_ENDIF_122: -# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) -# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) -# local_i2c_at_A2I_internal_7 = local_i2c_at_A2I_internal_13 -lw $t0, -56($fp) -sw $t0, -32($fp) -label_ENDIF_112: -# LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) -# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) -# local_i2c_at_A2I_internal_1 = local_i2c_at_A2I_internal_7 -lw $t0, -32($fp) -sw $t0, -8($fp) -label_ENDIF_102: -# RETURN local_i2c_at_A2I_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_i2c_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 264 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_a2i_at_A2I implementation. -# @Params: -# 0($fp) = param_a2i_at_A2I_s_0 -function_a2i_at_A2I: - # Allocate stack frame for function function_a2i_at_A2I. - subu $sp, $sp, 208 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 208 - # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) - # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - # local_a2i_at_A2I_internal_4 = PARAM param_a2i_at_A2I_s_0 - lw $t0, 0($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # local_a2i_at_A2I_internal_5 = VCALL local_a2i_at_A2I_internal_4 length - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 16($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -28($fp) - # IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_FALSE_203 - # IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_FALSE_203 - lw $t0, -24($fp) - beq $t0, 0, label_FALSE_203 - # IF_ZERO local_a2i_at_A2I_internal_6 GOTO label_FALSE_203 - # IF_ZERO local_a2i_at_A2I_internal_6 GOTO label_FALSE_203 - lw $t0, -28($fp) - beq $t0, 0, label_FALSE_203 - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # Comparing -24($fp) type with String - la $v0, String - lw $a0, -24($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_206 - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_206 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_206 - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # Comparing -24($fp) type with Bool - la $v0, Bool - lw $a0, -24($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_207 - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # Comparing -24($fp) type with Int - la $v0, Int - lw $a0, -24($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_207 - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) - # Load pointers and SUB - lw $a0, -24($fp) - lw $a1, -28($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_204 - # GOTO label_FALSE_203 - j label_FALSE_203 - label_COMPARE_BY_VALUE_207: - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) - lw $a0, -24($fp) - lw $a1, -28($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_204 - # GOTO label_FALSE_203 - j label_FALSE_203 - label_COMPARE_STRING_206: - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) - # Load strings for comparison - lw $v0, -24($fp) - lw $v1, -28($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_CONTINUE_208 - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_CONTINUE_208 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_208 - # GOTO label_FALSE_203 - j label_FALSE_203 - label_CONTINUE_208: - # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) - # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) - # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -24($fp) - lw $v1, -28($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_209: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_210 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_209 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_210: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 - # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_204 - label_FALSE_203: - # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_205 -j label_END_205 -label_TRUE_204: - # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_205: -# LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) -# LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSEIF_201 -# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSEIF_201 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_201 -# LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -32($fp) -# LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) -# LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) -# local_a2i_at_A2I_internal_1 = local_a2i_at_A2I_internal_7 -lw $t0, -32($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_202 -j label_ENDIF_202 -label_FALSEIF_201: - # LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) - # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - # local_a2i_at_A2I_internal_12 = PARAM param_a2i_at_A2I_s_0 - lw $t0, 0($fp) - sw $t0, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -60($fp) - # ARG local_a2i_at_A2I_internal_14 - # LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) - lw $t0, -60($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -64($fp) - # ARG local_a2i_at_A2I_internal_15 - # LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) - lw $t0, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) - # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) - # local_a2i_at_A2I_internal_13 = VCALL local_a2i_at_A2I_internal_12 substr - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 48($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_25 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -68($fp) - # IF_ZERO local_a2i_at_A2I_internal_13 GOTO label_FALSE_213 - # IF_ZERO local_a2i_at_A2I_internal_13 GOTO label_FALSE_213 - lw $t0, -56($fp) - beq $t0, 0, label_FALSE_213 - # IF_ZERO local_a2i_at_A2I_internal_16 GOTO label_FALSE_213 - # IF_ZERO local_a2i_at_A2I_internal_16 GOTO label_FALSE_213 - lw $t0, -68($fp) - beq $t0, 0, label_FALSE_213 - # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) - # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) - # Comparing -56($fp) type with String - la $v0, String - lw $a0, -56($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_STRING_216 - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_STRING_216 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_STRING_216 - # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) - # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) - # Comparing -56($fp) type with Bool - la $v0, Bool - lw $a0, -56($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_217 - # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) - # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) - # Comparing -56($fp) type with Int - la $v0, Int - lw $a0, -56($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_217 - # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) - # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) - # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) - # Load pointers and SUB - lw $a0, -56($fp) - lw $a1, -68($fp) - sub $a0, $a0, $a1 - sw $a0, -48($fp) - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_214 - # GOTO label_FALSE_213 - j label_FALSE_213 - label_COMPARE_BY_VALUE_217: - # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) - # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) - # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) - lw $a0, -56($fp) - lw $a1, -68($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -48($fp) - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_214 - # GOTO label_FALSE_213 - j label_FALSE_213 - label_COMPARE_STRING_216: - # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) - # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) - # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) - # Load strings for comparison - lw $v0, -56($fp) - lw $v1, -68($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -48($fp) - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_CONTINUE_218 - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_CONTINUE_218 - lw $t0, -48($fp) - beq $t0, 0, label_CONTINUE_218 - # GOTO label_FALSE_213 - j label_FALSE_213 - label_CONTINUE_218: - # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) - # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) - # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -56($fp) - lw $v1, -68($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_219: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_220 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_219 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_220: - # Store result - sw $a2, -48($fp) - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 - # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_214 - label_FALSE_213: - # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -44($fp) - # GOTO label_END_215 -j label_END_215 -label_TRUE_214: - # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -44($fp) - label_END_215: -# LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) -# LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) -# Obtain value from -44($fp) -lw $v0, -44($fp) -lw $v0, 12($v0) -sw $v0, -36($fp) -# IF_ZERO local_a2i_at_A2I_internal_8 GOTO label_FALSEIF_211 -# IF_ZERO local_a2i_at_A2I_internal_8 GOTO label_FALSEIF_211 -lw $t0, -36($fp) -beq $t0, 0, label_FALSEIF_211 -# LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) -# local_a2i_at_A2I_internal_20 = SELF -sw $s1, -84($fp) -# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) -# LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) -# local_a2i_at_A2I_internal_18 = local_a2i_at_A2I_internal_20 -lw $t0, -84($fp) -sw $t0, -76($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_21 = PARAM param_a2i_at_A2I_s_0 -lw $t0, 0($fp) -sw $t0, -88($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_23 --> -96($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -96($fp) -# ARG local_a2i_at_A2I_internal_23 -# LOCAL local_a2i_at_A2I_internal_23 --> -96($fp) -lw $t0, -96($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_A2I_internal_25 --> -104($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_25 = PARAM param_a2i_at_A2I_s_0 -lw $t0, 0($fp) -sw $t0, -104($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_25 --> -104($fp) -# LOCAL local_a2i_at_A2I_internal_26 --> -108($fp) -# local_a2i_at_A2I_internal_26 = VCALL local_a2i_at_A2I_internal_25 length -# Save new self pointer in $s1 -lw $s1, -104($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 16($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -108($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_27 --> -112($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -112($fp) -# LOCAL local_a2i_at_A2I_internal_24 --> -100($fp) -# LOCAL local_a2i_at_A2I_internal_26 --> -108($fp) -# LOCAL local_a2i_at_A2I_internal_27 --> -112($fp) -# local_a2i_at_A2I_internal_24 = local_a2i_at_A2I_internal_26 - local_a2i_at_A2I_internal_27 -lw $t1, -108($fp) -lw $t0, 12($t1) -lw $t1, -112($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -100($fp) -# ARG local_a2i_at_A2I_internal_24 -# LOCAL local_a2i_at_A2I_internal_24 --> -100($fp) -lw $t0, -100($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) -# LOCAL local_a2i_at_A2I_internal_22 --> -92($fp) -# local_a2i_at_A2I_internal_22 = VCALL local_a2i_at_A2I_internal_21 substr -# Save new self pointer in $s1 -lw $s1, -88($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 48($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -92($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_a2i_at_A2I_internal_22 -# LOCAL local_a2i_at_A2I_internal_22 --> -92($fp) -lw $t0, -92($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) -# LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) -# local_a2i_at_A2I_internal_19 = VCALL local_a2i_at_A2I_internal_18 a2i_aux -# Save new self pointer in $s1 -lw $s1, -76($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 56($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -80($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) -# LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) -lw $t0, -80($fp) -lw $t0, 12($t0) -not $t0, $t0 -add $t0, $t0, 1 -sw $t0, -72($fp) -# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) -# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -lw $t0, -72($fp) -sw $t0, 12($v0) -sw $v0, -72($fp) -# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) -# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) -# local_a2i_at_A2I_internal_9 = local_a2i_at_A2I_internal_17 -lw $t0, -72($fp) -sw $t0, -40($fp) -# GOTO label_ENDIF_212 -j label_ENDIF_212 -label_FALSEIF_211: - # LOCAL local_a2i_at_A2I_internal_32 --> -132($fp) - # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - # local_a2i_at_A2I_internal_32 = PARAM param_a2i_at_A2I_s_0 - lw $t0, 0($fp) - sw $t0, -132($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_at_A2I_internal_34 --> -140($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -140($fp) - # ARG local_a2i_at_A2I_internal_34 - # LOCAL local_a2i_at_A2I_internal_34 --> -140($fp) - lw $t0, -140($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_at_A2I_internal_35 --> -144($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -144($fp) - # ARG local_a2i_at_A2I_internal_35 - # LOCAL local_a2i_at_A2I_internal_35 --> -144($fp) - lw $t0, -144($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_at_A2I_internal_32 --> -132($fp) - # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) - # local_a2i_at_A2I_internal_33 = VCALL local_a2i_at_A2I_internal_32 substr - # Save new self pointer in $s1 - lw $s1, -132($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 48($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -136($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_26 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -148($fp) - # IF_ZERO local_a2i_at_A2I_internal_33 GOTO label_FALSE_223 - # IF_ZERO local_a2i_at_A2I_internal_33 GOTO label_FALSE_223 - lw $t0, -136($fp) - beq $t0, 0, label_FALSE_223 - # IF_ZERO local_a2i_at_A2I_internal_36 GOTO label_FALSE_223 - # IF_ZERO local_a2i_at_A2I_internal_36 GOTO label_FALSE_223 - lw $t0, -148($fp) - beq $t0, 0, label_FALSE_223 - # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) - # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) - # Comparing -136($fp) type with String - la $v0, String - lw $a0, -136($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -128($fp) - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_STRING_226 - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_STRING_226 - lw $t0, -128($fp) - beq $t0, 0, label_COMPARE_STRING_226 - # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) - # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) - # Comparing -136($fp) type with Bool - la $v0, Bool - lw $a0, -136($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -128($fp) - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 - lw $t0, -128($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_227 - # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) - # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) - # Comparing -136($fp) type with Int - la $v0, Int - lw $a0, -136($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -128($fp) - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 - lw $t0, -128($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_227 - # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) - # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) - # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) - # Load pointers and SUB - lw $a0, -136($fp) - lw $a1, -148($fp) - sub $a0, $a0, $a1 - sw $a0, -128($fp) - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 - lw $t0, -128($fp) - beq $t0, 0, label_TRUE_224 - # GOTO label_FALSE_223 - j label_FALSE_223 - label_COMPARE_BY_VALUE_227: - # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) - # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) - # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) - lw $a0, -136($fp) - lw $a1, -148($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -128($fp) - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 - lw $t0, -128($fp) - beq $t0, 0, label_TRUE_224 - # GOTO label_FALSE_223 - j label_FALSE_223 - label_COMPARE_STRING_226: - # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) - # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) - # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) - # Load strings for comparison - lw $v0, -136($fp) - lw $v1, -148($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -128($fp) - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_CONTINUE_228 - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_CONTINUE_228 - lw $t0, -128($fp) - beq $t0, 0, label_CONTINUE_228 - # GOTO label_FALSE_223 - j label_FALSE_223 - label_CONTINUE_228: - # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) - # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) - # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -136($fp) - lw $v1, -148($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_229: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_230 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_229 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_230: - # Store result - sw $a2, -128($fp) - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 - # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 - lw $t0, -128($fp) - beq $t0, 0, label_TRUE_224 - label_FALSE_223: - # LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -124($fp) - # GOTO label_END_225 -j label_END_225 -label_TRUE_224: - # LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -124($fp) - label_END_225: -# LOCAL local_a2i_at_A2I_internal_28 --> -116($fp) -# LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) -# Obtain value from -124($fp) -lw $v0, -124($fp) -lw $v0, 12($v0) -sw $v0, -116($fp) -# IF_ZERO local_a2i_at_A2I_internal_28 GOTO label_FALSEIF_221 -# IF_ZERO local_a2i_at_A2I_internal_28 GOTO label_FALSEIF_221 -lw $t0, -116($fp) -beq $t0, 0, label_FALSEIF_221 -# LOCAL local_a2i_at_A2I_internal_39 --> -160($fp) -# local_a2i_at_A2I_internal_39 = SELF -sw $s1, -160($fp) -# LOCAL local_a2i_at_A2I_internal_37 --> -152($fp) -# LOCAL local_a2i_at_A2I_internal_39 --> -160($fp) -# local_a2i_at_A2I_internal_37 = local_a2i_at_A2I_internal_39 -lw $t0, -160($fp) -sw $t0, -152($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_40 --> -164($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_40 = PARAM param_a2i_at_A2I_s_0 -lw $t0, 0($fp) -sw $t0, -164($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_42 --> -172($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -172($fp) -# ARG local_a2i_at_A2I_internal_42 -# LOCAL local_a2i_at_A2I_internal_42 --> -172($fp) -lw $t0, -172($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_A2I_internal_44 --> -180($fp) -# PARAM param_a2i_at_A2I_s_0 --> 0($fp) -# local_a2i_at_A2I_internal_44 = PARAM param_a2i_at_A2I_s_0 -lw $t0, 0($fp) -sw $t0, -180($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_A2I_internal_44 --> -180($fp) -# LOCAL local_a2i_at_A2I_internal_45 --> -184($fp) -# local_a2i_at_A2I_internal_45 = VCALL local_a2i_at_A2I_internal_44 length -# Save new self pointer in $s1 -lw $s1, -180($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 16($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -184($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_46 --> -188($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -188($fp) -# LOCAL local_a2i_at_A2I_internal_43 --> -176($fp) -# LOCAL local_a2i_at_A2I_internal_45 --> -184($fp) -# LOCAL local_a2i_at_A2I_internal_46 --> -188($fp) -# local_a2i_at_A2I_internal_43 = local_a2i_at_A2I_internal_45 - local_a2i_at_A2I_internal_46 -lw $t1, -184($fp) -lw $t0, 12($t1) -lw $t1, -188($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -176($fp) -# ARG local_a2i_at_A2I_internal_43 -# LOCAL local_a2i_at_A2I_internal_43 --> -176($fp) -lw $t0, -176($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_A2I_internal_40 --> -164($fp) -# LOCAL local_a2i_at_A2I_internal_41 --> -168($fp) -# local_a2i_at_A2I_internal_41 = VCALL local_a2i_at_A2I_internal_40 substr -# Save new self pointer in $s1 -lw $s1, -164($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 48($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -168($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_a2i_at_A2I_internal_41 -# LOCAL local_a2i_at_A2I_internal_41 --> -168($fp) -lw $t0, -168($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_A2I_internal_37 --> -152($fp) -# LOCAL local_a2i_at_A2I_internal_38 --> -156($fp) -# local_a2i_at_A2I_internal_38 = VCALL local_a2i_at_A2I_internal_37 a2i_aux -# Save new self pointer in $s1 -lw $s1, -152($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 56($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -156($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) -# LOCAL local_a2i_at_A2I_internal_38 --> -156($fp) -# local_a2i_at_A2I_internal_29 = local_a2i_at_A2I_internal_38 -lw $t0, -156($fp) -sw $t0, -120($fp) -# GOTO label_ENDIF_222 -j label_ENDIF_222 -label_FALSEIF_221: - # LOCAL local_a2i_at_A2I_internal_49 --> -200($fp) - # local_a2i_at_A2I_internal_49 = SELF - sw $s1, -200($fp) - # LOCAL local_a2i_at_A2I_internal_47 --> -192($fp) - # LOCAL local_a2i_at_A2I_internal_49 --> -200($fp) - # local_a2i_at_A2I_internal_47 = local_a2i_at_A2I_internal_49 - lw $t0, -200($fp) - sw $t0, -192($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_a2i_at_A2I_s_0 - # PARAM param_a2i_at_A2I_s_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_at_A2I_internal_47 --> -192($fp) - # LOCAL local_a2i_at_A2I_internal_48 --> -196($fp) - # local_a2i_at_A2I_internal_48 = VCALL local_a2i_at_A2I_internal_47 a2i_aux - # Save new self pointer in $s1 - lw $s1, -192($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 56($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -196($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) - # LOCAL local_a2i_at_A2I_internal_48 --> -196($fp) - # local_a2i_at_A2I_internal_29 = local_a2i_at_A2I_internal_48 - lw $t0, -196($fp) - sw $t0, -120($fp) - label_ENDIF_222: -# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) -# LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) -# local_a2i_at_A2I_internal_9 = local_a2i_at_A2I_internal_29 -lw $t0, -120($fp) -sw $t0, -40($fp) -label_ENDIF_212: -# LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) -# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) -# local_a2i_at_A2I_internal_1 = local_a2i_at_A2I_internal_9 -lw $t0, -40($fp) -sw $t0, -8($fp) -label_ENDIF_202: -# RETURN local_a2i_at_A2I_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_a2i_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 208 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_a2i_aux_at_A2I implementation. -# @Params: -# 0($fp) = param_a2i_aux_at_A2I_s_0 -function_a2i_aux_at_A2I: - # Allocate stack frame for function function_a2i_aux_at_A2I. - subu $sp, $sp, 88 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 88 - # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_a2i_aux_at_A2I_internal_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -8($fp) - # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) - # LOCAL local_a2i_aux_at_A2I_internal_1 --> -8($fp) - # local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # LOCAL local_a2i_aux_at_A2I_j_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) - # PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) - # local_a2i_aux_at_A2I_internal_3 = PARAM param_a2i_aux_at_A2I_s_0 - lw $t0, 0($fp) - sw $t0, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) - # LOCAL local_a2i_aux_at_A2I_internal_4 --> -20($fp) - # local_a2i_aux_at_A2I_internal_4 = VCALL local_a2i_aux_at_A2I_internal_3 length - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 16($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_aux_at_A2I_j_2 --> -12($fp) - # LOCAL local_a2i_aux_at_A2I_internal_4 --> -20($fp) - # local_a2i_aux_at_A2I_j_2 = local_a2i_aux_at_A2I_internal_4 - lw $t0, -20($fp) - sw $t0, -12($fp) - # LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -24($fp) - # LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -28($fp) - # LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) - # LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) - # local_a2i_aux_at_A2I_i_5 = local_a2i_aux_at_A2I_internal_6 - lw $t0, -28($fp) - sw $t0, -24($fp) - label_WHILE_231: - # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) - # LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) - # LOCAL local_a2i_aux_at_A2I_j_2 --> -12($fp) - lw $a0, -24($fp) - lw $a1, -12($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -36($fp) - # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 - # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 - lw $t0, -36($fp) - bgt $t0, 0, label_FALSE_233 - # IF_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 - # IF_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 - lw $t0, -36($fp) - beq $t0, 0, label_FALSE_233 - # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -36($fp) - # GOTO label_END_234 -j label_END_234 -label_FALSE_233: - # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -36($fp) - label_END_234: -# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) -# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) -# Obtain value from -36($fp) -lw $v0, -36($fp) -lw $v0, 12($v0) -sw $v0, -32($fp) -# IF_ZERO local_a2i_aux_at_A2I_internal_7 GOTO label_WHILE_END_232 -# IF_ZERO local_a2i_aux_at_A2I_internal_7 GOTO label_WHILE_END_232 -lw $t0, -32($fp) -beq $t0, 0, label_WHILE_END_232 -# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 10 -sw $t0, 12($v0) -sw $v0, -48($fp) -# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) -# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) -# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) -# local_a2i_aux_at_A2I_internal_10 = local_a2i_aux_at_A2I_int_0 * local_a2i_aux_at_A2I_internal_11 -lw $t1, -4($fp) -lw $t0, 12($t1) -lw $t1, -48($fp) -lw $t2, 12($t1) -mul $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -44($fp) -# LOCAL local_a2i_aux_at_A2I_internal_14 --> -60($fp) -# local_a2i_aux_at_A2I_internal_14 = SELF -sw $s1, -60($fp) -# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) -# LOCAL local_a2i_aux_at_A2I_internal_14 --> -60($fp) -# local_a2i_aux_at_A2I_internal_12 = local_a2i_aux_at_A2I_internal_14 -lw $t0, -60($fp) -sw $t0, -52($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_15 --> -64($fp) -# PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) -# local_a2i_aux_at_A2I_internal_15 = PARAM param_a2i_aux_at_A2I_s_0 -lw $t0, 0($fp) -sw $t0, -64($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_a2i_aux_at_A2I_i_5 -# LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) -lw $t0, -24($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -72($fp) -# ARG local_a2i_aux_at_A2I_internal_17 -# LOCAL local_a2i_aux_at_A2I_internal_17 --> -72($fp) -lw $t0, -72($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_15 --> -64($fp) -# LOCAL local_a2i_aux_at_A2I_internal_16 --> -68($fp) -# local_a2i_aux_at_A2I_internal_16 = VCALL local_a2i_aux_at_A2I_internal_15 substr -# Save new self pointer in $s1 -lw $s1, -64($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 48($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -68($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_a2i_aux_at_A2I_internal_16 -# LOCAL local_a2i_aux_at_A2I_internal_16 --> -68($fp) -lw $t0, -68($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) -# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) -# local_a2i_aux_at_A2I_internal_13 = VCALL local_a2i_aux_at_A2I_internal_12 c2i -# Save new self pointer in $s1 -lw $s1, -52($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 64($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -56($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) -# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) -# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) -# local_a2i_aux_at_A2I_internal_9 = local_a2i_aux_at_A2I_internal_10 + local_a2i_aux_at_A2I_internal_13 -lw $t1, -44($fp) -lw $t0, 12($t1) -lw $t1, -56($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -40($fp) -# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) -# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) -# local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_9 -lw $t0, -40($fp) -sw $t0, -4($fp) -# LOCAL local_a2i_aux_at_A2I_internal_19 --> -80($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -80($fp) -# LOCAL local_a2i_aux_at_A2I_internal_18 --> -76($fp) -# LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) -# LOCAL local_a2i_aux_at_A2I_internal_19 --> -80($fp) -# local_a2i_aux_at_A2I_internal_18 = local_a2i_aux_at_A2I_i_5 + local_a2i_aux_at_A2I_internal_19 -lw $t1, -24($fp) -lw $t0, 12($t1) -lw $t1, -80($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -76($fp) -# LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) -# LOCAL local_a2i_aux_at_A2I_internal_18 --> -76($fp) -# local_a2i_aux_at_A2I_i_5 = local_a2i_aux_at_A2I_internal_18 -lw $t0, -76($fp) -sw $t0, -24($fp) -# GOTO label_WHILE_231 -j label_WHILE_231 -label_WHILE_END_232: - # RETURN local_a2i_aux_at_A2I_int_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_a2i_aux_at_A2I. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 88 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_i2a_at_A2I implementation. -# @Params: -# 0($fp) = param_i2a_at_A2I_i_0 -function_i2a_at_A2I: - # Allocate stack frame for function function_i2a_at_A2I. - subu $sp, $sp, 96 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 96 - # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -20($fp) - # IF_ZERO param_i2a_at_A2I_i_0 GOTO label_FALSE_237 - # IF_ZERO param_i2a_at_A2I_i_0 GOTO label_FALSE_237 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_237 - # IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_237 - # IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_237 - lw $t0, -20($fp) - beq $t0, 0, label_FALSE_237 - # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_STRING_240 - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_STRING_240 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_240 - # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_241 - # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_241 - # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -20($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_238 - # GOTO label_FALSE_237 - j label_FALSE_237 - label_COMPARE_BY_VALUE_241: - # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) - lw $a0, 0($fp) - lw $a1, -20($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_238 - # GOTO label_FALSE_237 - j label_FALSE_237 - label_COMPARE_STRING_240: - # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_CONTINUE_242 - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_CONTINUE_242 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_242 - # GOTO label_FALSE_237 - j label_FALSE_237 - label_CONTINUE_242: - # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_243: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_244 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_243 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_244: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 - # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_238 - label_FALSE_237: - # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_239 -j label_END_239 -label_TRUE_238: - # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_239: -# LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) -# LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSEIF_235 -# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSEIF_235 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_235 -# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_27 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -24($fp) -# LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) -# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) -# local_i2a_at_A2I_internal_1 = local_i2a_at_A2I_internal_5 -lw $t0, -24($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_236 -j label_ENDIF_236 -label_FALSEIF_235: - # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -40($fp) - # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) - # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - lw $a0, -40($fp) - lw $a1, 0($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -36($fp) - # IF_GREATER_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 - # IF_GREATER_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 - lw $t0, -36($fp) - bgt $t0, 0, label_FALSE_247 - # IF_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 - # IF_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 - lw $t0, -36($fp) - beq $t0, 0, label_FALSE_247 - # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -36($fp) - # GOTO label_END_248 -j label_END_248 -label_FALSE_247: - # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -36($fp) - label_END_248: -# LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) -# LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) -# Obtain value from -36($fp) -lw $v0, -36($fp) -lw $v0, 12($v0) -sw $v0, -28($fp) -# IF_ZERO local_i2a_at_A2I_internal_6 GOTO label_FALSEIF_245 -# IF_ZERO local_i2a_at_A2I_internal_6 GOTO label_FALSEIF_245 -lw $t0, -28($fp) -beq $t0, 0, label_FALSEIF_245 -# LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) -# local_i2a_at_A2I_internal_12 = SELF -sw $s1, -52($fp) -# LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) -# LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) -# local_i2a_at_A2I_internal_10 = local_i2a_at_A2I_internal_12 -lw $t0, -52($fp) -sw $t0, -44($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_i2a_at_A2I_i_0 -# PARAM param_i2a_at_A2I_i_0 --> 0($fp) -lw $t0, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) -# LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) -# local_i2a_at_A2I_internal_11 = VCALL local_i2a_at_A2I_internal_10 i2a_aux -# Save new self pointer in $s1 -lw $s1, -44($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 32($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -48($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) -# LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) -# local_i2a_at_A2I_internal_7 = local_i2a_at_A2I_internal_11 -lw $t0, -48($fp) -sw $t0, -32($fp) -# GOTO label_ENDIF_246 -j label_ENDIF_246 -label_FALSEIF_245: - # LOCAL local_i2a_at_A2I_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_28 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -64($fp) - # LOCAL local_i2a_at_A2I_internal_13 --> -56($fp) - # LOCAL local_i2a_at_A2I_internal_15 --> -64($fp) - # local_i2a_at_A2I_internal_13 = local_i2a_at_A2I_internal_15 - lw $t0, -64($fp) - sw $t0, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2a_at_A2I_internal_18 --> -76($fp) - # local_i2a_at_A2I_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_i2a_at_A2I_internal_16 --> -68($fp) - # LOCAL local_i2a_at_A2I_internal_18 --> -76($fp) - # local_i2a_at_A2I_internal_16 = local_i2a_at_A2I_internal_18 - lw $t0, -76($fp) - sw $t0, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2a_at_A2I_internal_21 --> -88($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -88($fp) - # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) - # LOCAL local_i2a_at_A2I_internal_21 --> -88($fp) - lw $t0, -88($fp) - lw $t0, 12($t0) - not $t0, $t0 - add $t0, $t0, 1 - sw $t0, -84($fp) - # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) - # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -84($fp) - sw $t0, 12($v0) - sw $v0, -84($fp) - # LOCAL local_i2a_at_A2I_internal_19 --> -80($fp) - # PARAM param_i2a_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) - # local_i2a_at_A2I_internal_19 = PARAM param_i2a_at_A2I_i_0 * local_i2a_at_A2I_internal_20 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -84($fp) - lw $t2, 12($t1) - mul $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -80($fp) - # ARG local_i2a_at_A2I_internal_19 - # LOCAL local_i2a_at_A2I_internal_19 --> -80($fp) - lw $t0, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_i2a_at_A2I_internal_16 --> -68($fp) - # LOCAL local_i2a_at_A2I_internal_17 --> -72($fp) - # local_i2a_at_A2I_internal_17 = VCALL local_i2a_at_A2I_internal_16 i2a_aux - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 32($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_i2a_at_A2I_internal_17 - # LOCAL local_i2a_at_A2I_internal_17 --> -72($fp) - lw $t0, -72($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_i2a_at_A2I_internal_13 --> -56($fp) - # LOCAL local_i2a_at_A2I_internal_14 --> -60($fp) - # local_i2a_at_A2I_internal_14 = VCALL local_i2a_at_A2I_internal_13 concat - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 36($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) - # LOCAL local_i2a_at_A2I_internal_14 --> -60($fp) - # local_i2a_at_A2I_internal_7 = local_i2a_at_A2I_internal_14 - lw $t0, -60($fp) - sw $t0, -32($fp) - label_ENDIF_246: -# LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) -# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) -# local_i2a_at_A2I_internal_1 = local_i2a_at_A2I_internal_7 -lw $t0, -32($fp) -sw $t0, -8($fp) -label_ENDIF_236: -# RETURN local_i2a_at_A2I_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_i2a_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 96 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_i2a_aux_at_A2I implementation. -# @Params: -# 0($fp) = param_i2a_aux_at_A2I_i_0 -function_i2a_aux_at_A2I: - # Allocate stack frame for function function_i2a_aux_at_A2I. - subu $sp, $sp, 88 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 88 - # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -20($fp) - # IF_ZERO param_i2a_aux_at_A2I_i_0 GOTO label_FALSE_251 - # IF_ZERO param_i2a_aux_at_A2I_i_0 GOTO label_FALSE_251 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_251 - # IF_ZERO local_i2a_aux_at_A2I_internal_4 GOTO label_FALSE_251 - # IF_ZERO local_i2a_aux_at_A2I_internal_4 GOTO label_FALSE_251 - lw $t0, -20($fp) - beq $t0, 0, label_FALSE_251 - # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_STRING_254 - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_STRING_254 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_254 - # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_255 - # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_255 - # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -20($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_252 - # GOTO label_FALSE_251 - j label_FALSE_251 - label_COMPARE_BY_VALUE_255: - # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) - lw $a0, 0($fp) - lw $a1, -20($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_252 - # GOTO label_FALSE_251 - j label_FALSE_251 - label_COMPARE_STRING_254: - # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_CONTINUE_256 - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_CONTINUE_256 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_256 - # GOTO label_FALSE_251 - j label_FALSE_251 - label_CONTINUE_256: - # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_257: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_258 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_257 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_258: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 - # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_252 - label_FALSE_251: - # LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_253 -j label_END_253 -label_TRUE_252: - # LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_253: -# LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) -# LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSEIF_249 -# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSEIF_249 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_249 -# LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_29 -sw $t0, 12($v0) -li $t0, 0 -sw $t0, 16($v0) -sw $v0, -24($fp) -# LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) -# LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) -# local_i2a_aux_at_A2I_internal_1 = local_i2a_aux_at_A2I_internal_5 -lw $t0, -24($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_250 -j label_ENDIF_250 -label_FALSEIF_249: - # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -28($fp) - # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 10 - sw $t0, 12($v0) - sw $v0, -36($fp) - # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) - # local_i2a_aux_at_A2I_internal_7 = PARAM param_i2a_aux_at_A2I_i_0 / local_i2a_aux_at_A2I_internal_8 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -36($fp) - lw $t2, 12($t1) - div $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -32($fp) - # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) - # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) - # local_i2a_aux_at_A2I_next_6 = local_i2a_aux_at_A2I_internal_7 - lw $t0, -32($fp) - sw $t0, -28($fp) - # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) - # local_i2a_aux_at_A2I_internal_13 = SELF - sw $s1, -56($fp) - # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) - # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) - # local_i2a_aux_at_A2I_internal_11 = local_i2a_aux_at_A2I_internal_13 - lw $t0, -56($fp) - sw $t0, -48($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_i2a_aux_at_A2I_next_6 - # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) - lw $t0, -28($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) - # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) - # local_i2a_aux_at_A2I_internal_12 = VCALL local_i2a_aux_at_A2I_internal_11 i2a_aux - # Save new self pointer in $s1 - lw $s1, -48($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 32($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -52($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) - # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) - # local_i2a_aux_at_A2I_internal_9 = local_i2a_aux_at_A2I_internal_12 - lw $t0, -52($fp) - sw $t0, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_16 --> -68($fp) - # local_i2a_aux_at_A2I_internal_16 = SELF - sw $s1, -68($fp) - # LOCAL local_i2a_aux_at_A2I_internal_14 --> -60($fp) - # LOCAL local_i2a_aux_at_A2I_internal_16 --> -68($fp) - # local_i2a_aux_at_A2I_internal_14 = local_i2a_aux_at_A2I_internal_16 - lw $t0, -68($fp) - sw $t0, -60($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 10 - sw $t0, 12($v0) - sw $v0, -80($fp) - # LOCAL local_i2a_aux_at_A2I_internal_18 --> -76($fp) - # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) - # LOCAL local_i2a_aux_at_A2I_internal_19 --> -80($fp) - # local_i2a_aux_at_A2I_internal_18 = local_i2a_aux_at_A2I_next_6 * local_i2a_aux_at_A2I_internal_19 - lw $t1, -28($fp) - lw $t0, 12($t1) - lw $t1, -80($fp) - lw $t2, 12($t1) - mul $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -76($fp) - # LOCAL local_i2a_aux_at_A2I_internal_17 --> -72($fp) - # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) - # LOCAL local_i2a_aux_at_A2I_internal_18 --> -76($fp) - # local_i2a_aux_at_A2I_internal_17 = PARAM param_i2a_aux_at_A2I_i_0 - local_i2a_aux_at_A2I_internal_18 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -76($fp) - lw $t2, 12($t1) - sub $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -72($fp) - # ARG local_i2a_aux_at_A2I_internal_17 - # LOCAL local_i2a_aux_at_A2I_internal_17 --> -72($fp) - lw $t0, -72($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_14 --> -60($fp) - # LOCAL local_i2a_aux_at_A2I_internal_15 --> -64($fp) - # local_i2a_aux_at_A2I_internal_15 = VCALL local_i2a_aux_at_A2I_internal_14 i2c - # Save new self pointer in $s1 - lw $s1, -60($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 40($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -64($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_i2a_aux_at_A2I_internal_15 - # LOCAL local_i2a_aux_at_A2I_internal_15 --> -64($fp) - lw $t0, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) - # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) - # local_i2a_aux_at_A2I_internal_10 = VCALL local_i2a_aux_at_A2I_internal_9 concat - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 36($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) - # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) - # local_i2a_aux_at_A2I_internal_1 = local_i2a_aux_at_A2I_internal_10 - lw $t0, -44($fp) - sw $t0, -8($fp) - label_ENDIF_250: -# RETURN local_i2a_aux_at_A2I_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_i2a_aux_at_A2I. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 88 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 104 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 104 - # LOCAL local_main_at_Main_a_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = ALLOCATE A2I - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, A2I - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, A2I_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -16($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t0, -16($fp) - sw $t0, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_30 - sw $t0, 12($v0) - li $t0, 6 - sw $t0, 16($v0) - sw $v0, -20($fp) - # ARG local_main_at_Main_internal_4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - lw $t0, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 a2i - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 12($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_a_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_a_0 = local_main_at_Main_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # LOCAL local_main_at_Main_b_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_0 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -24($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = ALLOCATE A2I - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, A2I - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, A2I_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -36($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 - lw $t0, -36($fp) - sw $t0, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 678987 - sw $t0, 12($v0) - sw $v0, -40($fp) - # ARG local_main_at_Main_internal_9 - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - lw $t0, -40($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 i2a - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 24($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_b_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_b_5 = local_main_at_Main_internal_7 - lw $t0, -32($fp) - sw $t0, -24($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_12 = SELF - sw $s1, -52($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 - lw $t0, -52($fp) - sw $t0, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_main_at_Main_a_0 - # LOCAL local_main_at_Main_a_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 out_int - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 28($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 - lw $t0, -64($fp) - sw $t0, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_31 - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - sw $v0, -68($fp) - # ARG local_main_at_Main_internal_16 - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - lw $t0, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 out_string - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 8($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_19 = SELF - sw $s1, -80($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_17 = local_main_at_Main_internal_19 - lw $t0, -80($fp) - sw $t0, -72($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_main_at_Main_b_5 - # LOCAL local_main_at_Main_b_5 --> -24($fp) - lw $t0, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_18 = VCALL local_main_at_Main_internal_17 out_string - # Save new self pointer in $s1 - lw $s1, -72($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 8($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -76($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - # local_main_at_Main_internal_22 = SELF - sw $s1, -92($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - # local_main_at_Main_internal_20 = local_main_at_Main_internal_22 - lw $t0, -92($fp) - sw $t0, -84($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_23 --> -96($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_32 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -96($fp) - # ARG local_main_at_Main_internal_23 - # LOCAL local_main_at_Main_internal_23 --> -96($fp) - lw $t0, -96($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # local_main_at_Main_internal_21 = VCALL local_main_at_Main_internal_20 out_string - # Save new self pointer in $s1 - lw $s1, -84($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 8($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -88($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_21 - lw $v0, -88($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 104 - jr $ra - # Function END - diff --git a/tests/codegen/book_list.mips b/tests/codegen/book_list.mips deleted file mode 100644 index 32067886..00000000 --- a/tests/codegen/book_list.mips +++ /dev/null @@ -1,3054 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:13 2020 -# School of Math and Computer Science, University of Havana -# - -.data -dummy: .word 0 -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Int: .asciiz "Int" -# Function END -Main: .asciiz "Main" -# Function END -BookList: .asciiz "BookList" -# Function END -Nil: .asciiz "Nil" -# Function END -Cons: .asciiz "Cons" -# Function END -Book: .asciiz "Book" -# Function END -Article: .asciiz "Article" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_out_int_at_IO, function_abort_at_Object, dummy, dummy, function_in_string_at_IO, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_out_string_at_IO, dummy, dummy, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_length_at_String, dummy, dummy, function_type_name_at_Object, function_concat_at_String, dummy, dummy, function_substr_at_String, dummy, dummy -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Int **** -Int_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Int **** -Int_start: - Int_vtable_pointer: .word Int_vtable - # Function END -Int_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_main_at_Main, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -# **** VTABLE for type BookList **** -BookList_vtable: .word function_out_int_at_IO, function_abort_at_Object, dummy, function_cons_at_BookList, function_in_string_at_IO, function_car_at_BookList, dummy, dummy, function_copy_at_Object, function_cdr_at_BookList, dummy, function_isNil_at_BookList, dummy, function_type_name_at_Object, dummy, function_print_list_at_BookList, function_out_string_at_IO, dummy, dummy, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type BookList **** -BookList_start: - BookList_vtable_pointer: .word BookList_vtable - # Function END -BookList_end: -# - - -# **** VTABLE for type Nil **** -Nil_vtable: .word function_out_int_at_IO, function_abort_at_Object, dummy, function_cons_at_BookList, function_in_string_at_IO, function_car_at_BookList, dummy, dummy, function_copy_at_Object, function_cdr_at_BookList, dummy, function_isNil_at_Nil, dummy, function_type_name_at_Object, dummy, function_print_list_at_Nil, function_out_string_at_IO, dummy, dummy, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type Nil **** -Nil_start: - Nil_vtable_pointer: .word Nil_vtable - # Function END -Nil_end: -# - - -# **** VTABLE for type Cons **** -Cons_vtable: .word function_out_int_at_IO, function_abort_at_Object, dummy, function_cons_at_BookList, function_in_string_at_IO, function_car_at_Cons, function_init_at_Cons, dummy, function_copy_at_Object, function_cdr_at_Cons, dummy, function_isNil_at_Cons, dummy, function_type_name_at_Object, dummy, function_print_list_at_Cons, function_out_string_at_IO, dummy, dummy, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type Cons **** -Cons_start: - Cons_vtable_pointer: .word Cons_vtable - # Function END -Cons_end: -# - - -# **** VTABLE for type Book **** -Book_vtable: .word function_out_int_at_IO, function_abort_at_Object, function_initBook_at_Book, dummy, function_in_string_at_IO, dummy, dummy, function_print_at_Book, function_copy_at_Object, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_out_string_at_IO, dummy, dummy, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type Book **** -Book_start: - Book_vtable_pointer: .word Book_vtable - # Function END -Book_end: -# - - -# **** VTABLE for type Article **** -Article_vtable: .word function_out_int_at_IO, function_abort_at_Object, function_initBook_at_Book, dummy, function_in_string_at_IO, dummy, dummy, function_print_at_Article, function_copy_at_Object, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_out_string_at_IO, dummy, function_initArticle_at_Article, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type Article **** -Article_start: - Article_vtable_pointer: .word Article_vtable - # Function END -Article_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, -1, 1, 2, 2, 1, 2 -Object__TDT: .word 1, 0, 1, 1, 1, 1, 2, 3, 3, 2, 3 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 -Main__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1 -BookList__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 1, -1, -1 -Nil__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1 -Cons__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 -Book__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1 -Article__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz "Compilers, Principles, Techniques, and Tools" -# - - -data_5: .asciiz "Aho, Sethi, and Ullman" -# - - -data_6: .asciiz "The Top 100 CD_ROMs" -# - - -data_7: .asciiz "Ulanoff" -# - - -data_8: .asciiz "PC Magazine" -# - - -data_9: .asciiz "- dynamic type was Book -\n" -# - - -data_10: .asciiz "- dynamic type was Article -\n" -# - - -data_11: .asciiz "title: " -# - - -data_12: .asciiz "\n" -# - - -data_13: .asciiz "author: " -# - - -data_14: .asciiz "\n" -# - - -data_15: .asciiz "periodical: " -# - - -data_16: .asciiz "\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - move $a2, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - sw $a2, 12($v0) - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - lw $t2, 12($t2) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - lw $a0, 12($a0) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # LOCAL local_length_at_String_internal_1 --> -8($fp) - # LOCAL local_length_at_String_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -4($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_length_at_String_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Main - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__books__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t0, Main_vtable - # Get pointer to function address - lw $t1, 48($t0) - # Call function. Result is on $v0 - jalr $t1 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__books__init implementation. -# @Params: -__Main__attrib__books__init: - # Allocate stack frame for function __Main__attrib__books__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Main__attrib__books__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 92 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 92 - # LOCAL local_main_at_Main_a_book_0 --> -4($fp) - # local_main_at_Main_a_book_0 = 0 - li $t0, 0 - sw $t0, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = ALLOCATE Book - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Book - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Book_start - sw $t0, 4($v0) - # Load type offset - li $t0, 36 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -16($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t0, -16($fp) - sw $t0, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_4 - sw $t0, 12($v0) - li $t0, 44 - sw $t0, 16($v0) - sw $v0, -20($fp) - # ARG local_main_at_Main_internal_4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - lw $t0, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_5 - sw $t0, 12($v0) - li $t0, 22 - sw $t0, 16($v0) - sw $v0, -24($fp) - # ARG local_main_at_Main_internal_5 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - lw $t0, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 initBook - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 8($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_a_book_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_a_book_0 = local_main_at_Main_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # LOCAL local_main_at_Main_an_article_6 --> -28($fp) - # local_main_at_Main_an_article_6 = 0 - li $t0, 0 - sw $t0, -28($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = ALLOCATE Article - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Article - sw $t0, 12($v0) - li $t0, 7 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 24 bytes of memory - li $a0, 24 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Article_start - sw $t0, 4($v0) - # Load type offset - li $t0, 40 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Article__attrib__per_title__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -40($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t0, -40($fp) - sw $t0, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_6 - sw $t0, 12($v0) - li $t0, 19 - sw $t0, 16($v0) - sw $v0, -44($fp) - # ARG local_main_at_Main_internal_10 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - lw $t0, -44($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_7 - sw $t0, 12($v0) - li $t0, 7 - sw $t0, 16($v0) - sw $v0, -48($fp) - # ARG local_main_at_Main_internal_11 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - lw $t0, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_8 - sw $t0, 12($v0) - li $t0, 11 - sw $t0, 16($v0) - sw $v0, -52($fp) - # ARG local_main_at_Main_internal_12 - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - lw $t0, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 initArticle - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 72($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_an_article_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_an_article_6 = local_main_at_Main_internal_8 - lw $t0, -36($fp) - sw $t0, -28($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = ALLOCATE Nil - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Nil - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Nil_start - sw $t0, 4($v0) - # Load type offset - li $t0, 28 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -72($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 - lw $t0, -72($fp) - sw $t0, -64($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_main_at_Main_a_book_0 - # LOCAL local_main_at_Main_a_book_0 --> -4($fp) - lw $t0, -4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 cons - # Save new self pointer in $s1 - lw $s1, -64($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 12($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -68($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_13 = local_main_at_Main_internal_16 - lw $t0, -68($fp) - sw $t0, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_main_at_Main_an_article_6 - # LOCAL local_main_at_Main_an_article_6 --> -28($fp) - lw $t0, -28($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 cons - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 12($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - lw $t0, -60($fp) - sw $t0, 12($s1) - # local_main_at_Main_internal_20 = GETATTRIBUTE books Main - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - lw $t0, 12($s1) - sw $t0, -84($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 - lw $t0, -84($fp) - sw $t0, -76($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 print_list - # Save new self pointer in $s1 - lw $s1, -76($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 60($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -80($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_19 - lw $v0, -80($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 92 - jr $ra - # Function END - - -# function_isNil_at_BookList implementation. -# @Params: -function_isNil_at_BookList: - # Allocate stack frame for function function_isNil_at_BookList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_BookList_internal_2 --> -12($fp) - # local_isNil_at_BookList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_isNil_at_BookList_internal_0 --> -4($fp) - # LOCAL local_isNil_at_BookList_internal_2 --> -12($fp) - # local_isNil_at_BookList_internal_0 = local_isNil_at_BookList_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_isNil_at_BookList_internal_0 --> -4($fp) - # LOCAL local_isNil_at_BookList_internal_1 --> -8($fp) - # local_isNil_at_BookList_internal_1 = VCALL local_isNil_at_BookList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_isNil_at_BookList_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -16($fp) - # RETURN local_isNil_at_BookList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_isNil_at_BookList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cons_at_BookList implementation. -# @Params: -# 0($fp) = param_cons_at_BookList_hd_0 -function_cons_at_BookList: - # Allocate stack frame for function function_cons_at_BookList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) - # local_cons_at_BookList_new_cell_0 = 0 - li $t0, 0 - sw $t0, -4($fp) - # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) - # local_cons_at_BookList_internal_1 = ALLOCATE Cons - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Cons - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Cons_start - sw $t0, 4($v0) - # Load type offset - li $t0, 32 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Cons__attrib__xcar__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Cons__attrib__xcdr__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -8($fp) - # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) - # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) - # local_cons_at_BookList_new_cell_0 = local_cons_at_BookList_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) - # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) - # local_cons_at_BookList_internal_2 = local_cons_at_BookList_new_cell_0 - lw $t0, -4($fp) - sw $t0, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cons_at_BookList_hd_0 - # PARAM param_cons_at_BookList_hd_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) - # local_cons_at_BookList_internal_4 = SELF - sw $s1, -20($fp) - # ARG local_cons_at_BookList_internal_4 - # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) - lw $t0, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) - # LOCAL local_cons_at_BookList_internal_3 --> -16($fp) - # local_cons_at_BookList_internal_3 = VCALL local_cons_at_BookList_internal_2 init - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 24($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_cons_at_BookList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_cons_at_BookList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_car_at_BookList implementation. -# @Params: -function_car_at_BookList: - # Allocate stack frame for function function_car_at_BookList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_car_at_BookList_internal_2 --> -12($fp) - # local_car_at_BookList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_car_at_BookList_internal_0 --> -4($fp) - # LOCAL local_car_at_BookList_internal_2 --> -12($fp) - # local_car_at_BookList_internal_0 = local_car_at_BookList_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_car_at_BookList_internal_0 --> -4($fp) - # LOCAL local_car_at_BookList_internal_1 --> -8($fp) - # local_car_at_BookList_internal_1 = VCALL local_car_at_BookList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_car_at_BookList_internal_3 --> -16($fp) - # local_car_at_BookList_internal_3 = ALLOCATE Book - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Book - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Book_start - sw $t0, 4($v0) - # Load type offset - li $t0, 36 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Book__attrib__title__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Book__attrib__author__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -16($fp) - # RETURN local_car_at_BookList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_car_at_BookList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cdr_at_BookList implementation. -# @Params: -function_cdr_at_BookList: - # Allocate stack frame for function function_cdr_at_BookList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_cdr_at_BookList_internal_2 --> -12($fp) - # local_cdr_at_BookList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_cdr_at_BookList_internal_0 --> -4($fp) - # LOCAL local_cdr_at_BookList_internal_2 --> -12($fp) - # local_cdr_at_BookList_internal_0 = local_cdr_at_BookList_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_cdr_at_BookList_internal_0 --> -4($fp) - # LOCAL local_cdr_at_BookList_internal_1 --> -8($fp) - # local_cdr_at_BookList_internal_1 = VCALL local_cdr_at_BookList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cdr_at_BookList_internal_3 --> -16($fp) - # local_cdr_at_BookList_internal_3 = ALLOCATE BookList - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, BookList - sw $t0, 12($v0) - li $t0, 8 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, BookList_start - sw $t0, 4($v0) - # Load type offset - li $t0, 24 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -16($fp) - # RETURN local_cdr_at_BookList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_cdr_at_BookList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_print_list_at_BookList implementation. -# @Params: -function_print_list_at_BookList: - # Allocate stack frame for function function_print_list_at_BookList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_print_list_at_BookList_internal_2 --> -12($fp) - # local_print_list_at_BookList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_print_list_at_BookList_internal_0 --> -4($fp) - # LOCAL local_print_list_at_BookList_internal_2 --> -12($fp) - # local_print_list_at_BookList_internal_0 = local_print_list_at_BookList_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_BookList_internal_0 --> -4($fp) - # LOCAL local_print_list_at_BookList_internal_1 --> -8($fp) - # local_print_list_at_BookList_internal_1 = VCALL local_print_list_at_BookList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_list_at_BookList_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_print_list_at_BookList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_Nil implementation. -# @Params: -function_isNil_at_Nil: - # Allocate stack frame for function function_isNil_at_Nil. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_Nil_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_isNil_at_Nil_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_isNil_at_Nil. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_print_list_at_Nil implementation. -# @Params: -function_print_list_at_Nil: - # Allocate stack frame for function function_print_list_at_Nil. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_print_list_at_Nil_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_print_list_at_Nil_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_print_list_at_Nil. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Cons__attrib__xcar__init implementation. -# @Params: -__Cons__attrib__xcar__init: - # Allocate stack frame for function __Cons__attrib__xcar__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Cons__attrib__xcar__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Cons__attrib__xcdr__init implementation. -# @Params: -__Cons__attrib__xcdr__init: - # Allocate stack frame for function __Cons__attrib__xcdr__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Cons__attrib__xcdr__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_Cons implementation. -# @Params: -function_isNil_at_Cons: - # Allocate stack frame for function function_isNil_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_Cons_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_isNil_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_isNil_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_Cons implementation. -# @Params: -# 0($fp) = param_init_at_Cons_hd_0 -# 4($fp) = param_init_at_Cons_tl_1 -function_init_at_Cons: - # Allocate stack frame for function function_init_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_Cons_hd_0 --> 4($fp) - lw $t0, 4($fp) - sw $t0, 12($s1) - # - # PARAM param_init_at_Cons_tl_1 --> 0($fp) - lw $t0, 0($fp) - sw $t0, 16($s1) - # LOCAL local_init_at_Cons_internal_0 --> -4($fp) - # local_init_at_Cons_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_init_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_init_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_car_at_Cons implementation. -# @Params: -function_car_at_Cons: - # Allocate stack frame for function function_car_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_car_at_Cons_internal_0 = GETATTRIBUTE xcar Cons - # LOCAL local_car_at_Cons_internal_0 --> -4($fp) - lw $t0, 12($s1) - sw $t0, -4($fp) - # RETURN local_car_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_car_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cdr_at_Cons implementation. -# @Params: -function_cdr_at_Cons: - # Allocate stack frame for function function_cdr_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_cdr_at_Cons_internal_0 = GETATTRIBUTE xcdr Cons - # LOCAL local_cdr_at_Cons_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_cdr_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_cdr_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_print_list_at_Cons implementation. -# @Params: -function_print_list_at_Cons: - # Allocate stack frame for function function_print_list_at_Cons. - subu $sp, $sp, 92 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 92 - # local_print_list_at_Cons_internal_2 = GETATTRIBUTE xcar Cons - # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) - lw $t0, 12($s1) - sw $t0, -12($fp) - # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) - # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) - # local_print_list_at_Cons_internal_0 = local_print_list_at_Cons_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) - # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # local_print_list_at_Cons_internal_1 = VCALL local_print_list_at_Cons_internal_0 print - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 28($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) - # local_print_list_at_Cons_internal_3 = TYPEOF local_print_list_at_Cons_internal_1 - lw $t0, -8($fp) - # Load pointer to type offset - lw $t1, 8($t0) - sw $t1, -16($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_6 = 14 - li $t0, 14 - sw $t0, -28($fp) - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) - # Load TDT pointer to type Book - la $t0, Book__TDT - lw $t1, -16($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -32($fp) - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # Update min if 8 < 9 - lw $t0, -32($fp) - lw $t1, -28($fp) - bgtu $t0, $t1, label_Not_min0_1 - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # local_print_list_at_Cons_internal_6 = local_print_list_at_Cons_internal_7 - lw $t0, -32($fp) - sw $t0, -28($fp) - label_Not_min0_1: - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) - # Load TDT pointer to type Article - la $t0, Article__TDT - lw $t1, -16($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -32($fp) - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # Update min if 8 < 9 - lw $t0, -32($fp) - lw $t1, -28($fp) - bgtu $t0, $t1, label_Not_min1_2 - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # local_print_list_at_Cons_internal_6 = local_print_list_at_Cons_internal_7 - lw $t0, -32($fp) - sw $t0, -28($fp) - label_Not_min1_2: - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # local_print_list_at_Cons_internal_7 = 14 - li $t0, 14 - sw $t0, -32($fp) - # LOCAL local_print_list_at_Cons_internal_4 --> -20($fp) - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # Load pointers and SUB - lw $a0, -32($fp) - lw $a1, -28($fp) - sub $a0, $a0, $a1 - sw $a0, -20($fp) - # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 - # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 - lw $t0, -20($fp) - beq $t0, 0, label_ERROR_3 - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) - # Load TDT pointer to type Book - la $t0, Book__TDT - lw $t1, -16($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -32($fp) - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # Update min if 8 < 9 - lw $t0, -32($fp) - lw $t1, -28($fp) - bgtu $t0, $t1, label_NEXT0_5 - # LOCAL local_print_list_at_Cons_dummy_8 --> -36($fp) - # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # local_print_list_at_Cons_dummy_8 = local_print_list_at_Cons_internal_1 - lw $t0, -8($fp) - sw $t0, -36($fp) - # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) - # local_print_list_at_Cons_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) - # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) - # local_print_list_at_Cons_internal_9 = local_print_list_at_Cons_internal_11 - lw $t0, -48($fp) - sw $t0, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Cons_internal_12 --> -52($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_9 - sw $t0, 12($v0) - li $t0, 26 - sw $t0, 16($v0) - sw $v0, -52($fp) - # ARG local_print_list_at_Cons_internal_12 - # LOCAL local_print_list_at_Cons_internal_12 --> -52($fp) - lw $t0, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) - # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) - # local_print_list_at_Cons_internal_10 = VCALL local_print_list_at_Cons_internal_9 out_string - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 64($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) - # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_10 - lw $t0, -44($fp) - sw $t0, -24($fp) - # GOTO label_END_4 -j label_END_4 -label_NEXT0_5: - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) - # Load TDT pointer to type Article - la $t0, Article__TDT - lw $t1, -16($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -32($fp) - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # Update min if 8 < 9 - lw $t0, -32($fp) - lw $t1, -28($fp) - bgtu $t0, $t1, label_NEXT1_6 - # LOCAL local_print_list_at_Cons_dummy_13 --> -56($fp) - # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # local_print_list_at_Cons_dummy_13 = local_print_list_at_Cons_internal_1 - lw $t0, -8($fp) - sw $t0, -56($fp) - # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) - # local_print_list_at_Cons_internal_16 = SELF - sw $s1, -68($fp) - # LOCAL local_print_list_at_Cons_internal_14 --> -60($fp) - # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) - # local_print_list_at_Cons_internal_14 = local_print_list_at_Cons_internal_16 - lw $t0, -68($fp) - sw $t0, -60($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_10 - sw $t0, 12($v0) - li $t0, 29 - sw $t0, 16($v0) - sw $v0, -72($fp) - # ARG local_print_list_at_Cons_internal_17 - # LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) - lw $t0, -72($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_list_at_Cons_internal_14 --> -60($fp) - # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) - # local_print_list_at_Cons_internal_15 = VCALL local_print_list_at_Cons_internal_14 out_string - # Save new self pointer in $s1 - lw $s1, -60($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 64($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -64($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) - # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_15 - lw $t0, -64($fp) - sw $t0, -24($fp) - # GOTO label_END_4 -j label_END_4 -label_NEXT1_6: - label_ERROR_3: - # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - lw $t0, 0($s1) - sw $t0, -8($fp) - # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -8($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - label_END_4: -# local_print_list_at_Cons_internal_20 = GETATTRIBUTE xcdr Cons -# LOCAL local_print_list_at_Cons_internal_20 --> -84($fp) -lw $t0, 16($s1) -sw $t0, -84($fp) -# LOCAL local_print_list_at_Cons_internal_18 --> -76($fp) -# LOCAL local_print_list_at_Cons_internal_20 --> -84($fp) -# local_print_list_at_Cons_internal_18 = local_print_list_at_Cons_internal_20 -lw $t0, -84($fp) -sw $t0, -76($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_print_list_at_Cons_internal_18 --> -76($fp) -# LOCAL local_print_list_at_Cons_internal_19 --> -80($fp) -# local_print_list_at_Cons_internal_19 = VCALL local_print_list_at_Cons_internal_18 print_list -# Save new self pointer in $s1 -lw $s1, -76($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 60($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -80($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# RETURN local_print_list_at_Cons_internal_19 -lw $v0, -80($fp) -# Deallocate stack frame for function function_print_list_at_Cons. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 92 -jr $ra -# Function END - - -# __Book__attrib__title__init implementation. -# @Params: -__Book__attrib__title__init: - # Allocate stack frame for function __Book__attrib__title__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__title__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_0 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__title__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Book__attrib__title__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Book__attrib__author__init implementation. -# @Params: -__Book__attrib__author__init: - # Allocate stack frame for function __Book__attrib__author__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__author__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_0 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__author__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Book__attrib__author__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_initBook_at_Book implementation. -# @Params: -# 0($fp) = param_initBook_at_Book_title_p_0 -# 4($fp) = param_initBook_at_Book_author_p_1 -function_initBook_at_Book: - # Allocate stack frame for function function_initBook_at_Book. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_initBook_at_Book_title_p_0 --> 4($fp) - lw $t0, 4($fp) - sw $t0, 12($s1) - # - # PARAM param_initBook_at_Book_author_p_1 --> 0($fp) - lw $t0, 0($fp) - sw $t0, 16($s1) - # LOCAL local_initBook_at_Book_internal_0 --> -4($fp) - # local_initBook_at_Book_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_initBook_at_Book_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_initBook_at_Book. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_print_at_Book implementation. -# @Params: -function_print_at_Book: - # Allocate stack frame for function function_print_at_Book. - subu $sp, $sp, 92 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 92 - # LOCAL local_print_at_Book_internal_6 --> -28($fp) - # local_print_at_Book_internal_6 = SELF - sw $s1, -28($fp) - # LOCAL local_print_at_Book_internal_4 --> -20($fp) - # LOCAL local_print_at_Book_internal_6 --> -28($fp) - # local_print_at_Book_internal_4 = local_print_at_Book_internal_6 - lw $t0, -28($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Book_internal_7 --> -32($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_11 - sw $t0, 12($v0) - li $t0, 12 - sw $t0, 16($v0) - sw $v0, -32($fp) - # ARG local_print_at_Book_internal_7 - # LOCAL local_print_at_Book_internal_7 --> -32($fp) - lw $t0, -32($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Book_internal_4 --> -20($fp) - # LOCAL local_print_at_Book_internal_5 --> -24($fp) - # local_print_at_Book_internal_5 = VCALL local_print_at_Book_internal_4 out_string - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 64($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_2 --> -12($fp) - # LOCAL local_print_at_Book_internal_5 --> -24($fp) - # local_print_at_Book_internal_2 = local_print_at_Book_internal_5 - lw $t0, -24($fp) - sw $t0, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Book_internal_8 = GETATTRIBUTE title Book - # LOCAL local_print_at_Book_internal_8 --> -36($fp) - lw $t0, 12($s1) - sw $t0, -36($fp) - # ARG local_print_at_Book_internal_8 - # LOCAL local_print_at_Book_internal_8 --> -36($fp) - lw $t0, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Book_internal_2 --> -12($fp) - # LOCAL local_print_at_Book_internal_3 --> -16($fp) - # local_print_at_Book_internal_3 = VCALL local_print_at_Book_internal_2 out_string - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 64($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_0 --> -4($fp) - # LOCAL local_print_at_Book_internal_3 --> -16($fp) - # local_print_at_Book_internal_0 = local_print_at_Book_internal_3 - lw $t0, -16($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Book_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_12 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -40($fp) - # ARG local_print_at_Book_internal_9 - # LOCAL local_print_at_Book_internal_9 --> -40($fp) - lw $t0, -40($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Book_internal_0 --> -4($fp) - # LOCAL local_print_at_Book_internal_1 --> -8($fp) - # local_print_at_Book_internal_1 = VCALL local_print_at_Book_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 64($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_16 --> -68($fp) - # local_print_at_Book_internal_16 = SELF - sw $s1, -68($fp) - # LOCAL local_print_at_Book_internal_14 --> -60($fp) - # LOCAL local_print_at_Book_internal_16 --> -68($fp) - # local_print_at_Book_internal_14 = local_print_at_Book_internal_16 - lw $t0, -68($fp) - sw $t0, -60($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Book_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_13 - sw $t0, 12($v0) - li $t0, 12 - sw $t0, 16($v0) - sw $v0, -72($fp) - # ARG local_print_at_Book_internal_17 - # LOCAL local_print_at_Book_internal_17 --> -72($fp) - lw $t0, -72($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Book_internal_14 --> -60($fp) - # LOCAL local_print_at_Book_internal_15 --> -64($fp) - # local_print_at_Book_internal_15 = VCALL local_print_at_Book_internal_14 out_string - # Save new self pointer in $s1 - lw $s1, -60($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 64($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -64($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_12 --> -52($fp) - # LOCAL local_print_at_Book_internal_15 --> -64($fp) - # local_print_at_Book_internal_12 = local_print_at_Book_internal_15 - lw $t0, -64($fp) - sw $t0, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Book_internal_18 = GETATTRIBUTE author Book - # LOCAL local_print_at_Book_internal_18 --> -76($fp) - lw $t0, 16($s1) - sw $t0, -76($fp) - # ARG local_print_at_Book_internal_18 - # LOCAL local_print_at_Book_internal_18 --> -76($fp) - lw $t0, -76($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Book_internal_12 --> -52($fp) - # LOCAL local_print_at_Book_internal_13 --> -56($fp) - # local_print_at_Book_internal_13 = VCALL local_print_at_Book_internal_12 out_string - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 64($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_10 --> -44($fp) - # LOCAL local_print_at_Book_internal_13 --> -56($fp) - # local_print_at_Book_internal_10 = local_print_at_Book_internal_13 - lw $t0, -56($fp) - sw $t0, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Book_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_14 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -80($fp) - # ARG local_print_at_Book_internal_19 - # LOCAL local_print_at_Book_internal_19 --> -80($fp) - lw $t0, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Book_internal_10 --> -44($fp) - # LOCAL local_print_at_Book_internal_11 --> -48($fp) - # local_print_at_Book_internal_11 = VCALL local_print_at_Book_internal_10 out_string - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 64($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Book_internal_20 --> -84($fp) - # local_print_at_Book_internal_20 = SELF - sw $s1, -84($fp) - # RETURN local_print_at_Book_internal_20 - lw $v0, -84($fp) - # Deallocate stack frame for function function_print_at_Book. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 92 - jr $ra - # Function END - - -# __Article__attrib__per_title__init implementation. -# @Params: -__Article__attrib__per_title__init: - # Allocate stack frame for function __Article__attrib__per_title__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local___attrib__per_title__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_0 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -4($fp) - # RETURN local___attrib__per_title__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Article__attrib__per_title__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_initArticle_at_Article implementation. -# @Params: -# 0($fp) = param_initArticle_at_Article_title_p_0 -# 4($fp) = param_initArticle_at_Article_author_p_1 -# 8($fp) = param_initArticle_at_Article_per_title_p_2 -function_initArticle_at_Article: - # Allocate stack frame for function function_initArticle_at_Article. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) - # local_initArticle_at_Article_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) - # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) - # local_initArticle_at_Article_internal_0 = local_initArticle_at_Article_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_initArticle_at_Article_title_p_0 - # PARAM param_initArticle_at_Article_title_p_0 --> 8($fp) - lw $t0, 8($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # ARG param_initArticle_at_Article_author_p_1 - # PARAM param_initArticle_at_Article_author_p_1 --> 4($fp) - lw $t0, 4($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) - # LOCAL local_initArticle_at_Article_internal_1 --> -8($fp) - # local_initArticle_at_Article_internal_1 = VCALL local_initArticle_at_Article_internal_0 initBook - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 8($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # PARAM param_initArticle_at_Article_per_title_p_2 --> 0($fp) - lw $t0, 0($fp) - sw $t0, 20($s1) - # LOCAL local_initArticle_at_Article_internal_3 --> -16($fp) - # local_initArticle_at_Article_internal_3 = SELF - sw $s1, -16($fp) - # RETURN local_initArticle_at_Article_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_initArticle_at_Article. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 12 - jr $ra - # Function END - - -# function_print_at_Article implementation. -# @Params: -function_print_at_Article: - # Allocate stack frame for function function_print_at_Article. - subu $sp, $sp, 60 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 60 - # LOCAL local_print_at_Article_internal_1 --> -8($fp) - # local_print_at_Article_internal_1 = SELF - sw $s1, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Article_internal_0 = CALL print - # LOCAL local_print_at_Article_internal_0 --> -4($fp) - # LOCAL local_print_at_Article_internal_1 --> -8($fp) - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type's VTABLE - la $t0, Book_vtable - # Get pointer to function address - lw $t1, 28($t0) - # Call function. Result is on $v0 - jalr $t1 - sw $v0, -4($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Article_internal_8 --> -36($fp) - # local_print_at_Article_internal_8 = SELF - sw $s1, -36($fp) - # LOCAL local_print_at_Article_internal_6 --> -28($fp) - # LOCAL local_print_at_Article_internal_8 --> -36($fp) - # local_print_at_Article_internal_6 = local_print_at_Article_internal_8 - lw $t0, -36($fp) - sw $t0, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Article_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_15 - sw $t0, 12($v0) - li $t0, 13 - sw $t0, 16($v0) - sw $v0, -40($fp) - # ARG local_print_at_Article_internal_9 - # LOCAL local_print_at_Article_internal_9 --> -40($fp) - lw $t0, -40($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Article_internal_6 --> -28($fp) - # LOCAL local_print_at_Article_internal_7 --> -32($fp) - # local_print_at_Article_internal_7 = VCALL local_print_at_Article_internal_6 out_string - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 64($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Article_internal_4 --> -20($fp) - # LOCAL local_print_at_Article_internal_7 --> -32($fp) - # local_print_at_Article_internal_4 = local_print_at_Article_internal_7 - lw $t0, -32($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Article_internal_10 = GETATTRIBUTE per_title Article - # LOCAL local_print_at_Article_internal_10 --> -44($fp) - lw $t0, 20($s1) - sw $t0, -44($fp) - # ARG local_print_at_Article_internal_10 - # LOCAL local_print_at_Article_internal_10 --> -44($fp) - lw $t0, -44($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Article_internal_4 --> -20($fp) - # LOCAL local_print_at_Article_internal_5 --> -24($fp) - # local_print_at_Article_internal_5 = VCALL local_print_at_Article_internal_4 out_string - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 64($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Article_internal_2 --> -12($fp) - # LOCAL local_print_at_Article_internal_5 --> -24($fp) - # local_print_at_Article_internal_2 = local_print_at_Article_internal_5 - lw $t0, -24($fp) - sw $t0, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Article_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_16 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -48($fp) - # ARG local_print_at_Article_internal_11 - # LOCAL local_print_at_Article_internal_11 --> -48($fp) - lw $t0, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Article_internal_2 --> -12($fp) - # LOCAL local_print_at_Article_internal_3 --> -16($fp) - # local_print_at_Article_internal_3 = VCALL local_print_at_Article_internal_2 out_string - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 64($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Article_internal_12 --> -52($fp) - # local_print_at_Article_internal_12 = SELF - sw $s1, -52($fp) - # RETURN local_print_at_Article_internal_12 - lw $v0, -52($fp) - # Deallocate stack frame for function function_print_at_Article. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 60 - jr $ra - # Function END - diff --git a/tests/codegen/cells.mips b/tests/codegen/cells.mips deleted file mode 100644 index 468243ed..00000000 --- a/tests/codegen/cells.mips +++ /dev/null @@ -1,4335 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:15 2020 -# School of Math and Computer Science, University of Havana -# - -.data -dummy: .word 0 -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Int: .asciiz "Int" -# Function END -Main: .asciiz "Main" -# Function END -CellularAutomaton: .asciiz "CellularAutomaton" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, dummy, function_in_int_at_IO, dummy, function_in_string_at_IO, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_out_string_at_IO, function_out_int_at_IO, dummy, dummy -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_concat_at_String, function_copy_at_Object, function_length_at_String, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Int **** -Int_start: - Int_vtable_pointer: .word Int_vtable - # Function END -Int_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_main_at_Main, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -# **** VTABLE for type CellularAutomaton **** -CellularAutomaton_vtable: .word function_abort_at_Object, dummy, function_in_int_at_IO, function_cell_at_CellularAutomaton, function_in_string_at_IO, function_evolve_at_CellularAutomaton, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, function_num_cells_at_CellularAutomaton, function_init_at_CellularAutomaton, dummy, function_print_at_CellularAutomaton, function_cell_right_neighbor_at_CellularAutomaton, function_out_string_at_IO, function_out_int_at_IO, function_cell_left_neighbor_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton -# Function END -# - - -# **** Type RECORD for type CellularAutomaton **** -CellularAutomaton_start: - CellularAutomaton_vtable_pointer: .word CellularAutomaton_vtable - # Function END -CellularAutomaton_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1, -1 -Main__TDT: .word -1, -1, -1, -1, -1, 0, -1 -CellularAutomaton__TDT: .word -1, -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz " X " -# - - -data_5: .asciiz "\n" -# - - -data_6: .asciiz "X" -# - - -data_7: .asciiz "X" -# - - -data_8: .asciiz "X" -# - - -data_9: .asciiz "X" -# - - -data_10: .asciiz "." -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - move $a2, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - sw $a2, 12($v0) - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - lw $t2, 12($t2) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - lw $a0, 12($a0) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # LOCAL local_length_at_String_internal_1 --> -8($fp) - # LOCAL local_length_at_String_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -4($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_length_at_String_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Main - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__cells__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t0, Main_vtable - # Get pointer to function address - lw $t1, 4($t0) - # Call function. Result is on $v0 - jalr $t1 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__cells__init implementation. -# @Params: -__Main__attrib__cells__init: - # Allocate stack frame for function __Main__attrib__cells__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Main__attrib__cells__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 92 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 92 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = ALLOCATE CellularAutomaton - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, CellularAutomaton - sw $t0, 12($v0) - li $t0, 17 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, CellularAutomaton_start - sw $t0, 4($v0) - # Load type offset - li $t0, 24 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __CellularAutomaton__attrib__population_map__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_4 - sw $t0, 12($v0) - li $t0, 19 - sw $t0, 16($v0) - sw $v0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 init - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 44($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - lw $t0, -8($fp) - sw $t0, 12($s1) - # local_main_at_Main_internal_6 = GETATTRIBUTE cells Main - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - lw $t0, 12($s1) - sw $t0, -28($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # local_main_at_Main_internal_4 = local_main_at_Main_internal_6 - lw $t0, -28($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 print - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 52($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_countdown_7 --> -32($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -32($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 20 - sw $t0, 12($v0) - sw $v0, -36($fp) - # LOCAL local_main_at_Main_countdown_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_countdown_7 = local_main_at_Main_internal_8 - lw $t0, -36($fp) - sw $t0, -32($fp) - label_WHILE_1: - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -48($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # LOCAL local_main_at_Main_countdown_7 --> -32($fp) - lw $a0, -48($fp) - lw $a1, -32($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -44($fp) - # IF_GREATER_ZERO local_main_at_Main_internal_10 GOTO label_FALSE_3 - # IF_GREATER_ZERO local_main_at_Main_internal_10 GOTO label_FALSE_3 - lw $t0, -44($fp) - bgt $t0, 0, label_FALSE_3 - # IF_ZERO local_main_at_Main_internal_10 GOTO label_FALSE_3 - # IF_ZERO local_main_at_Main_internal_10 GOTO label_FALSE_3 - lw $t0, -44($fp) - beq $t0, 0, label_FALSE_3 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -44($fp) - # GOTO label_END_4 -j label_END_4 -label_FALSE_3: - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -44($fp) - label_END_4: -# LOCAL local_main_at_Main_internal_9 --> -40($fp) -# LOCAL local_main_at_Main_internal_10 --> -44($fp) -# Obtain value from -44($fp) -lw $v0, -44($fp) -lw $v0, 12($v0) -sw $v0, -40($fp) -# IF_ZERO local_main_at_Main_internal_9 GOTO label_WHILE_END_2 -# IF_ZERO local_main_at_Main_internal_9 GOTO label_WHILE_END_2 -lw $t0, -40($fp) -beq $t0, 0, label_WHILE_END_2 -# local_main_at_Main_internal_14 = GETATTRIBUTE cells Main -# LOCAL local_main_at_Main_internal_14 --> -60($fp) -lw $t0, 12($s1) -sw $t0, -60($fp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# LOCAL local_main_at_Main_internal_14 --> -60($fp) -# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 -lw $t0, -60($fp) -sw $t0, -52($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 evolve -# Save new self pointer in $s1 -lw $s1, -52($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 20($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -56($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# local_main_at_Main_internal_17 = GETATTRIBUTE cells Main -# LOCAL local_main_at_Main_internal_17 --> -72($fp) -lw $t0, 12($s1) -sw $t0, -72($fp) -# LOCAL local_main_at_Main_internal_15 --> -64($fp) -# LOCAL local_main_at_Main_internal_17 --> -72($fp) -# local_main_at_Main_internal_15 = local_main_at_Main_internal_17 -lw $t0, -72($fp) -sw $t0, -64($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_15 --> -64($fp) -# LOCAL local_main_at_Main_internal_16 --> -68($fp) -# local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 print -# Save new self pointer in $s1 -lw $s1, -64($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 52($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -68($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -80($fp) -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# LOCAL local_main_at_Main_countdown_7 --> -32($fp) -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# local_main_at_Main_internal_18 = local_main_at_Main_countdown_7 - local_main_at_Main_internal_19 -lw $t1, -32($fp) -lw $t0, 12($t1) -lw $t1, -80($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -76($fp) -# LOCAL local_main_at_Main_countdown_7 --> -32($fp) -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# local_main_at_Main_countdown_7 = local_main_at_Main_internal_18 -lw $t0, -76($fp) -sw $t0, -32($fp) -# GOTO label_WHILE_1 -j label_WHILE_1 -label_WHILE_END_2: - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_20 = SELF - sw $s1, -84($fp) - # RETURN local_main_at_Main_internal_20 - lw $v0, -84($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 92 - jr $ra - # Function END - - -# __CellularAutomaton__attrib__population_map__init implementation. -# @Params: -__CellularAutomaton__attrib__population_map__init: - # Allocate stack frame for function __CellularAutomaton__attrib__population_map__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_rAutomaton__attrib__population_map__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_0 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -4($fp) - # RETURN local_rAutomaton__attrib__population_map__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __CellularAutomaton__attrib__population_map__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_init_at_CellularAutomaton_map_0 -function_init_at_CellularAutomaton: - # Allocate stack frame for function function_init_at_CellularAutomaton. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_CellularAutomaton_map_0 --> 0($fp) - lw $t0, 0($fp) - sw $t0, 12($s1) - # LOCAL local_init_at_CellularAutomaton_internal_0 --> -4($fp) - # local_init_at_CellularAutomaton_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_init_at_CellularAutomaton_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_init_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_print_at_CellularAutomaton implementation. -# @Params: -function_print_at_CellularAutomaton: - # Allocate stack frame for function function_print_at_CellularAutomaton. - subu $sp, $sp, 40 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 40 - # LOCAL local_print_at_CellularAutomaton_internal_2 --> -12($fp) - # local_print_at_CellularAutomaton_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_print_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_print_at_CellularAutomaton_internal_2 --> -12($fp) - # local_print_at_CellularAutomaton_internal_0 = local_print_at_CellularAutomaton_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_CellularAutomaton_internal_5 = GETATTRIBUTE population_map CellularAutomaton - # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) - lw $t0, 12($s1) - sw $t0, -24($fp) - # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) - # local_print_at_CellularAutomaton_internal_3 = local_print_at_CellularAutomaton_internal_5 - lw $t0, -24($fp) - sw $t0, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_5 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -28($fp) - # ARG local_print_at_CellularAutomaton_internal_6 - # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) - lw $t0, -28($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_print_at_CellularAutomaton_internal_4 --> -20($fp) - # local_print_at_CellularAutomaton_internal_4 = VCALL local_print_at_CellularAutomaton_internal_3 concat - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 28($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_print_at_CellularAutomaton_internal_4 - # LOCAL local_print_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t0, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_print_at_CellularAutomaton_internal_1 --> -8($fp) - # local_print_at_CellularAutomaton_internal_1 = VCALL local_print_at_CellularAutomaton_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 60($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) - # local_print_at_CellularAutomaton_internal_7 = SELF - sw $s1, -32($fp) - # RETURN local_print_at_CellularAutomaton_internal_7 - lw $v0, -32($fp) - # Deallocate stack frame for function function_print_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 40 - jr $ra - # Function END - - -# function_num_cells_at_CellularAutomaton implementation. -# @Params: -function_num_cells_at_CellularAutomaton: - # Allocate stack frame for function function_num_cells_at_CellularAutomaton. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_num_cells_at_CellularAutomaton_internal_2 = GETATTRIBUTE population_map CellularAutomaton - # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) - lw $t0, 12($s1) - sw $t0, -12($fp) - # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) - # local_num_cells_at_CellularAutomaton_internal_0 = local_num_cells_at_CellularAutomaton_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_num_cells_at_CellularAutomaton_internal_1 --> -8($fp) - # local_num_cells_at_CellularAutomaton_internal_1 = VCALL local_num_cells_at_CellularAutomaton_internal_0 length - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 36($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_num_cells_at_CellularAutomaton_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_num_cells_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cell_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_cell_at_CellularAutomaton_position_0 -function_cell_at_CellularAutomaton: - # Allocate stack frame for function function_cell_at_CellularAutomaton. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_cell_at_CellularAutomaton_internal_2 = GETATTRIBUTE population_map CellularAutomaton - # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) - lw $t0, 12($s1) - sw $t0, -12($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) - # local_cell_at_CellularAutomaton_internal_0 = local_cell_at_CellularAutomaton_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cell_at_CellularAutomaton_position_0 - # PARAM param_cell_at_CellularAutomaton_position_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -16($fp) - # ARG local_cell_at_CellularAutomaton_internal_3 - # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) - # local_cell_at_CellularAutomaton_internal_1 = VCALL local_cell_at_CellularAutomaton_internal_0 substr - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 48($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_cell_at_CellularAutomaton_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_cell_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_cell_left_neighbor_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_cell_left_neighbor_at_CellularAutomaton_position_0 -function_cell_left_neighbor_at_CellularAutomaton: - # Allocate stack frame for function function_cell_left_neighbor_at_CellularAutomaton. - subu $sp, $sp, 80 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 80 - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -20($fp) - # IF_ZERO param_cell_left_neighbor_at_CellularAutomaton_position_0 GOTO label_FALSE_7 - # IF_ZERO param_cell_left_neighbor_at_CellularAutomaton_position_0 GOTO label_FALSE_7 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_7 - # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_4 GOTO label_FALSE_7 - # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_4 GOTO label_FALSE_7 - lw $t0, -20($fp) - beq $t0, 0, label_FALSE_7 - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_10 - # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_10 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_10 - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_11 - # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_11 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_11 - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_11 - # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_11 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_11 - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -20($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_8 - # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_8 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_8 - # GOTO label_FALSE_7 - j label_FALSE_7 - label_COMPARE_BY_VALUE_11: - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) - lw $a0, 0($fp) - lw $a1, -20($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_8 - # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_8 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_8 - # GOTO label_FALSE_7 - j label_FALSE_7 - label_COMPARE_STRING_10: - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_12 - # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_12 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_12 - # GOTO label_FALSE_7 - j label_FALSE_7 - label_CONTINUE_12: - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_13: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_14 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_13 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_14: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_8 - # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_8 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_8 - label_FALSE_7: - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_9 -j label_END_9 -label_TRUE_8: - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_9: -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_5 -# IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_5 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_5 -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) -# local_cell_left_neighbor_at_CellularAutomaton_internal_7 = SELF -sw $s1, -32($fp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) -# local_cell_left_neighbor_at_CellularAutomaton_internal_5 = local_cell_left_neighbor_at_CellularAutomaton_internal_7 -lw $t0, -32($fp) -sw $t0, -24($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) -# local_cell_left_neighbor_at_CellularAutomaton_internal_11 = SELF -sw $s1, -48($fp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) -# local_cell_left_neighbor_at_CellularAutomaton_internal_9 = local_cell_left_neighbor_at_CellularAutomaton_internal_11 -lw $t0, -48($fp) -sw $t0, -40($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) -# local_cell_left_neighbor_at_CellularAutomaton_internal_10 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_9 num_cells -# Save new self pointer in $s1 -lw $s1, -40($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 40($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -44($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -52($fp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) -# local_cell_left_neighbor_at_CellularAutomaton_internal_8 = local_cell_left_neighbor_at_CellularAutomaton_internal_10 - local_cell_left_neighbor_at_CellularAutomaton_internal_12 -lw $t1, -44($fp) -lw $t0, 12($t1) -lw $t1, -52($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -36($fp) -# ARG local_cell_left_neighbor_at_CellularAutomaton_internal_8 -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) -lw $t0, -36($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) -# local_cell_left_neighbor_at_CellularAutomaton_internal_6 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_5 cell -# Save new self pointer in $s1 -lw $s1, -24($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 12($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -28($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) -# local_cell_left_neighbor_at_CellularAutomaton_internal_1 = local_cell_left_neighbor_at_CellularAutomaton_internal_6 -lw $t0, -28($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_6 -j label_ENDIF_6 -label_FALSEIF_5: - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_15 --> -64($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_15 --> -64($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_13 = local_cell_left_neighbor_at_CellularAutomaton_internal_15 - lw $t0, -64($fp) - sw $t0, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -72($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_16 --> -68($fp) - # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_17 --> -72($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_16 = PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 - local_cell_left_neighbor_at_CellularAutomaton_internal_17 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -72($fp) - lw $t2, 12($t1) - sub $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -68($fp) - # ARG local_cell_left_neighbor_at_CellularAutomaton_internal_16 - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_16 --> -68($fp) - lw $t0, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_14 --> -60($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_14 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_13 cell - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 12($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_14 --> -60($fp) - # local_cell_left_neighbor_at_CellularAutomaton_internal_1 = local_cell_left_neighbor_at_CellularAutomaton_internal_14 - lw $t0, -60($fp) - sw $t0, -8($fp) - label_ENDIF_6: -# RETURN local_cell_left_neighbor_at_CellularAutomaton_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_cell_left_neighbor_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 80 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_cell_right_neighbor_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_cell_right_neighbor_at_CellularAutomaton_position_0 -function_cell_right_neighbor_at_CellularAutomaton: - # Allocate stack frame for function function_cell_right_neighbor_at_CellularAutomaton. - subu $sp, $sp, 80 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 80 - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_7 = SELF - sw $s1, -32($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_5 = local_cell_right_neighbor_at_CellularAutomaton_internal_7 - lw $t0, -32($fp) - sw $t0, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_6 = VCALL local_cell_right_neighbor_at_CellularAutomaton_internal_5 num_cells - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 40($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -36($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_4 = local_cell_right_neighbor_at_CellularAutomaton_internal_6 - local_cell_right_neighbor_at_CellularAutomaton_internal_8 - lw $t1, -28($fp) - lw $t0, 12($t1) - lw $t1, -36($fp) - lw $t2, 12($t1) - sub $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -20($fp) - # IF_ZERO param_cell_right_neighbor_at_CellularAutomaton_position_0 GOTO label_FALSE_17 - # IF_ZERO param_cell_right_neighbor_at_CellularAutomaton_position_0 GOTO label_FALSE_17 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_17 - # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_4 GOTO label_FALSE_17 - # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_4 GOTO label_FALSE_17 - lw $t0, -20($fp) - beq $t0, 0, label_FALSE_17 - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_20 - # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_20 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_20 - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_21 - # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_21 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_21 - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_21 - # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_21 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_21 - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -20($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_18 - # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_18 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_18 - # GOTO label_FALSE_17 - j label_FALSE_17 - label_COMPARE_BY_VALUE_21: - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) - lw $a0, 0($fp) - lw $a1, -20($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_18 - # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_18 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_18 - # GOTO label_FALSE_17 - j label_FALSE_17 - label_COMPARE_STRING_20: - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_22 - # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_22 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_22 - # GOTO label_FALSE_17 - j label_FALSE_17 - label_CONTINUE_22: - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_23: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_24 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_23 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_24: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_18 - # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_18 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_18 - label_FALSE_17: - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_19 -j label_END_19 -label_TRUE_18: - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_19: -# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_15 -# IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_15 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_15 -# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) -# local_cell_right_neighbor_at_CellularAutomaton_internal_11 = SELF -sw $s1, -48($fp) -# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) -# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) -# local_cell_right_neighbor_at_CellularAutomaton_internal_9 = local_cell_right_neighbor_at_CellularAutomaton_internal_11 -lw $t0, -48($fp) -sw $t0, -40($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -52($fp) -# ARG local_cell_right_neighbor_at_CellularAutomaton_internal_12 -# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) -lw $t0, -52($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) -# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) -# local_cell_right_neighbor_at_CellularAutomaton_internal_10 = VCALL local_cell_right_neighbor_at_CellularAutomaton_internal_9 cell -# Save new self pointer in $s1 -lw $s1, -40($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 12($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -44($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) -# local_cell_right_neighbor_at_CellularAutomaton_internal_1 = local_cell_right_neighbor_at_CellularAutomaton_internal_10 -lw $t0, -44($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_16 -j label_ENDIF_16 -label_FALSEIF_15: - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_15 --> -64($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_15 --> -64($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_13 = local_cell_right_neighbor_at_CellularAutomaton_internal_15 - lw $t0, -64($fp) - sw $t0, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -72($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_16 --> -68($fp) - # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_17 --> -72($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_16 = PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 + local_cell_right_neighbor_at_CellularAutomaton_internal_17 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -72($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -68($fp) - # ARG local_cell_right_neighbor_at_CellularAutomaton_internal_16 - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_16 --> -68($fp) - lw $t0, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_14 --> -60($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_14 = VCALL local_cell_right_neighbor_at_CellularAutomaton_internal_13 cell - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 12($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_14 --> -60($fp) - # local_cell_right_neighbor_at_CellularAutomaton_internal_1 = local_cell_right_neighbor_at_CellularAutomaton_internal_14 - lw $t0, -60($fp) - sw $t0, -8($fp) - label_ENDIF_16: -# RETURN local_cell_right_neighbor_at_CellularAutomaton_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_cell_right_neighbor_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 80 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_cell_at_next_evolution_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_cell_at_next_evolution_at_CellularAutomaton_position_0 -function_cell_at_next_evolution_at_CellularAutomaton: - # Allocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. - subu $sp, $sp, 164 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 164 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = SELF - sw $s1, -52($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_10 = local_cell_at_next_evolution_at_CellularAutomaton_internal_12 - lw $t0, -52($fp) - sw $t0, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 - # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_11 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 cell - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 12($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_6 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -56($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_11 GOTO label_FALSE_29 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_11 GOTO label_FALSE_29 - lw $t0, -48($fp) - beq $t0, 0, label_FALSE_29 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_13 GOTO label_FALSE_29 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_13 GOTO label_FALSE_29 - lw $t0, -56($fp) - beq $t0, 0, label_FALSE_29 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) - # Comparing -48($fp) type with String - la $v0, String - lw $a0, -48($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_COMPARE_STRING_32 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_COMPARE_STRING_32 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_STRING_32 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) - # Comparing -48($fp) type with Bool - la $v0, Bool - lw $a0, -48($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_33 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_33 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_33 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) - # Comparing -48($fp) type with Int - la $v0, Int - lw $a0, -48($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_33 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_33 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_33 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) - # Load pointers and SUB - lw $a0, -48($fp) - lw $a1, -56($fp) - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_TRUE_30 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_TRUE_30 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_30 - # GOTO label_FALSE_29 - j label_FALSE_29 - label_COMPARE_BY_VALUE_33: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) - lw $a0, -48($fp) - lw $a1, -56($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_TRUE_30 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_TRUE_30 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_30 - # GOTO label_FALSE_29 - j label_FALSE_29 - label_COMPARE_STRING_32: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) - # Load strings for comparison - lw $v0, -48($fp) - lw $v1, -56($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -40($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_CONTINUE_34 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_CONTINUE_34 - lw $t0, -40($fp) - beq $t0, 0, label_CONTINUE_34 - # GOTO label_FALSE_29 - j label_FALSE_29 - label_CONTINUE_34: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -48($fp) - lw $v1, -56($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_35: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_36 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_35 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_36: - # Store result - sw $a2, -40($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_TRUE_30 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_TRUE_30 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_30 - label_FALSE_29: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -36($fp) - # GOTO label_END_31 -j label_END_31 -label_TRUE_30: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -36($fp) - label_END_31: -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) -# Obtain value from -36($fp) -lw $v0, -36($fp) -lw $v0, 12($v0) -sw $v0, -28($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_27 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_27 -lw $t0, -28($fp) -beq $t0, 0, label_FALSEIF_27 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -60($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = local_cell_at_next_evolution_at_CellularAutomaton_internal_14 -lw $t0, -60($fp) -sw $t0, -32($fp) -# GOTO label_ENDIF_28 -j label_ENDIF_28 -label_FALSEIF_27: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -64($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = local_cell_at_next_evolution_at_CellularAutomaton_internal_15 - lw $t0, -64($fp) - sw $t0, -32($fp) - label_ENDIF_28: -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_22 = SELF -sw $s1, -92($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_20 = local_cell_at_next_evolution_at_CellularAutomaton_internal_22 -lw $t0, -92($fp) -sw $t0, -84($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 -# PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) -lw $t0, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_21 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 cell_left_neighbor -# Save new self pointer in $s1 -lw $s1, -84($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 68($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -88($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_7 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -96($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_21 GOTO label_FALSE_39 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_21 GOTO label_FALSE_39 -lw $t0, -88($fp) -beq $t0, 0, label_FALSE_39 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_23 GOTO label_FALSE_39 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_23 GOTO label_FALSE_39 -lw $t0, -96($fp) -beq $t0, 0, label_FALSE_39 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) -# Comparing -88($fp) type with String -la $v0, String -lw $a0, -88($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -80($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_COMPARE_STRING_42 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_COMPARE_STRING_42 -lw $t0, -80($fp) -beq $t0, 0, label_COMPARE_STRING_42 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) -# Comparing -88($fp) type with Bool -la $v0, Bool -lw $a0, -88($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -80($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_43 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_43 -lw $t0, -80($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_43 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) -# Comparing -88($fp) type with Int -la $v0, Int -lw $a0, -88($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -80($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_43 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_43 -lw $t0, -80($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_43 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) -# Load pointers and SUB -lw $a0, -88($fp) -lw $a1, -96($fp) -sub $a0, $a0, $a1 -sw $a0, -80($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_TRUE_40 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_TRUE_40 -lw $t0, -80($fp) -beq $t0, 0, label_TRUE_40 -# GOTO label_FALSE_39 -j label_FALSE_39 -label_COMPARE_BY_VALUE_43: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) - lw $a0, -88($fp) - lw $a1, -96($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -80($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_TRUE_40 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_TRUE_40 - lw $t0, -80($fp) - beq $t0, 0, label_TRUE_40 - # GOTO label_FALSE_39 - j label_FALSE_39 - label_COMPARE_STRING_42: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) - # Load strings for comparison - lw $v0, -88($fp) - lw $v1, -96($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -80($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_CONTINUE_44 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_CONTINUE_44 - lw $t0, -80($fp) - beq $t0, 0, label_CONTINUE_44 - # GOTO label_FALSE_39 - j label_FALSE_39 - label_CONTINUE_44: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -88($fp) - lw $v1, -96($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_45: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_46 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_45 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_46: - # Store result - sw $a2, -80($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_TRUE_40 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_TRUE_40 - lw $t0, -80($fp) - beq $t0, 0, label_TRUE_40 - label_FALSE_39: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -76($fp) - # GOTO label_END_41 -j label_END_41 -label_TRUE_40: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -76($fp) - label_END_41: -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) -# Obtain value from -76($fp) -lw $v0, -76($fp) -lw $v0, 12($v0) -sw $v0, -68($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_16 GOTO label_FALSEIF_37 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_16 GOTO label_FALSEIF_37 -lw $t0, -68($fp) -beq $t0, 0, label_FALSEIF_37 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -100($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_17 = local_cell_at_next_evolution_at_CellularAutomaton_internal_24 -lw $t0, -100($fp) -sw $t0, -72($fp) -# GOTO label_ENDIF_38 -j label_ENDIF_38 -label_FALSEIF_37: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_25 --> -104($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -104($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_25 --> -104($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_17 = local_cell_at_next_evolution_at_CellularAutomaton_internal_25 - lw $t0, -104($fp) - sw $t0, -72($fp) - label_ENDIF_38: -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_5 = local_cell_at_next_evolution_at_CellularAutomaton_internal_7 + local_cell_at_next_evolution_at_CellularAutomaton_internal_17 -lw $t1, -32($fp) -lw $t0, 12($t1) -lw $t1, -72($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -24($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_32 --> -132($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_32 = SELF -sw $s1, -132($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_30 --> -124($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_32 --> -132($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_30 = local_cell_at_next_evolution_at_CellularAutomaton_internal_32 -lw $t0, -132($fp) -sw $t0, -124($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 -# PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) -lw $t0, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_30 --> -124($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_31 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_30 cell_right_neighbor -# Save new self pointer in $s1 -lw $s1, -124($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 56($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -128($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_33 --> -136($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_8 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -136($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_31 GOTO label_FALSE_49 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_31 GOTO label_FALSE_49 -lw $t0, -128($fp) -beq $t0, 0, label_FALSE_49 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_33 GOTO label_FALSE_49 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_33 GOTO label_FALSE_49 -lw $t0, -136($fp) -beq $t0, 0, label_FALSE_49 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) -# Comparing -128($fp) type with String -la $v0, String -lw $a0, -128($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -120($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_COMPARE_STRING_52 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_COMPARE_STRING_52 -lw $t0, -120($fp) -beq $t0, 0, label_COMPARE_STRING_52 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) -# Comparing -128($fp) type with Bool -la $v0, Bool -lw $a0, -128($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -120($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_COMPARE_BY_VALUE_53 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_COMPARE_BY_VALUE_53 -lw $t0, -120($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_53 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) -# Comparing -128($fp) type with Int -la $v0, Int -lw $a0, -128($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -120($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_COMPARE_BY_VALUE_53 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_COMPARE_BY_VALUE_53 -lw $t0, -120($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_53 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_33 --> -136($fp) -# Load pointers and SUB -lw $a0, -128($fp) -lw $a1, -136($fp) -sub $a0, $a0, $a1 -sw $a0, -120($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_TRUE_50 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_TRUE_50 -lw $t0, -120($fp) -beq $t0, 0, label_TRUE_50 -# GOTO label_FALSE_49 -j label_FALSE_49 -label_COMPARE_BY_VALUE_53: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_33 --> -136($fp) - lw $a0, -128($fp) - lw $a1, -136($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -120($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_TRUE_50 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_TRUE_50 - lw $t0, -120($fp) - beq $t0, 0, label_TRUE_50 - # GOTO label_FALSE_49 - j label_FALSE_49 - label_COMPARE_STRING_52: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_33 --> -136($fp) - # Load strings for comparison - lw $v0, -128($fp) - lw $v1, -136($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -120($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_CONTINUE_54 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_CONTINUE_54 - lw $t0, -120($fp) - beq $t0, 0, label_CONTINUE_54 - # GOTO label_FALSE_49 - j label_FALSE_49 - label_CONTINUE_54: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_33 --> -136($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -128($fp) - lw $v1, -136($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_55: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_56 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_55 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_56: - # Store result - sw $a2, -120($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_TRUE_50 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_TRUE_50 - lw $t0, -120($fp) - beq $t0, 0, label_TRUE_50 - label_FALSE_49: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_28 --> -116($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -116($fp) - # GOTO label_END_51 -j label_END_51 -label_TRUE_50: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_28 --> -116($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -116($fp) - label_END_51: -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_26 --> -108($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_28 --> -116($fp) -# Obtain value from -116($fp) -lw $v0, -116($fp) -lw $v0, 12($v0) -sw $v0, -108($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_26 GOTO label_FALSEIF_47 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_26 GOTO label_FALSEIF_47 -lw $t0, -108($fp) -beq $t0, 0, label_FALSEIF_47 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_34 --> -140($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -140($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_27 --> -112($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_34 --> -140($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_27 = local_cell_at_next_evolution_at_CellularAutomaton_internal_34 -lw $t0, -140($fp) -sw $t0, -112($fp) -# GOTO label_ENDIF_48 -j label_ENDIF_48 -label_FALSEIF_47: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_35 --> -144($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -144($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_27 --> -112($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_35 --> -144($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_27 = local_cell_at_next_evolution_at_CellularAutomaton_internal_35 - lw $t0, -144($fp) - sw $t0, -112($fp) - label_ENDIF_48: -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_27 --> -112($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_4 = local_cell_at_next_evolution_at_CellularAutomaton_internal_5 + local_cell_at_next_evolution_at_CellularAutomaton_internal_27 -lw $t1, -24($fp) -lw $t0, 12($t1) -lw $t1, -112($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -20($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_36 --> -148($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -148($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_4 GOTO label_FALSE_57 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_4 GOTO label_FALSE_57 -lw $t0, -20($fp) -beq $t0, 0, label_FALSE_57 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_36 GOTO label_FALSE_57 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_36 GOTO label_FALSE_57 -lw $t0, -148($fp) -beq $t0, 0, label_FALSE_57 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) -# Comparing -20($fp) type with String -la $v0, String -lw $a0, -20($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -16($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_60 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_60 -lw $t0, -16($fp) -beq $t0, 0, label_COMPARE_STRING_60 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) -# Comparing -20($fp) type with Bool -la $v0, Bool -lw $a0, -20($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -16($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_61 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_61 -lw $t0, -16($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_61 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) -# Comparing -20($fp) type with Int -la $v0, Int -lw $a0, -20($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -16($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_61 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_61 -lw $t0, -16($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_61 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_36 --> -148($fp) -# Load pointers and SUB -lw $a0, -20($fp) -lw $a1, -148($fp) -sub $a0, $a0, $a1 -sw $a0, -16($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_58 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_58 -lw $t0, -16($fp) -beq $t0, 0, label_TRUE_58 -# GOTO label_FALSE_57 -j label_FALSE_57 -label_COMPARE_BY_VALUE_61: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_36 --> -148($fp) - lw $a0, -20($fp) - lw $a1, -148($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_58 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_58 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_58 - # GOTO label_FALSE_57 - j label_FALSE_57 - label_COMPARE_STRING_60: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_36 --> -148($fp) - # Load strings for comparison - lw $v0, -20($fp) - lw $v1, -148($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_62 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_62 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_62 - # GOTO label_FALSE_57 - j label_FALSE_57 - label_CONTINUE_62: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_36 --> -148($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -20($fp) - lw $v1, -148($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_63: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_64 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_63 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_64: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_58 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_58 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_58 - label_FALSE_57: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_59 -j label_END_59 -label_TRUE_58: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_59: -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_25 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_25 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_25 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_37 --> -152($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_9 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -152($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_37 --> -152($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = local_cell_at_next_evolution_at_CellularAutomaton_internal_37 -lw $t0, -152($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_26 -j label_ENDIF_26 -label_FALSEIF_25: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_38 --> -156($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_10 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -156($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_38 --> -156($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = local_cell_at_next_evolution_at_CellularAutomaton_internal_38 - lw $t0, -156($fp) - sw $t0, -8($fp) - label_ENDIF_26: -# RETURN local_cell_at_next_evolution_at_CellularAutomaton_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 164 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_evolve_at_CellularAutomaton implementation. -# @Params: -function_evolve_at_CellularAutomaton: - # Allocate stack frame for function function_evolve_at_CellularAutomaton. - subu $sp, $sp, 72 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 72 - # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -8($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) - # local_evolve_at_CellularAutomaton_internal_4 = SELF - sw $s1, -20($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) - # local_evolve_at_CellularAutomaton_internal_2 = local_evolve_at_CellularAutomaton_internal_4 - lw $t0, -20($fp) - sw $t0, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_evolve_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) - # local_evolve_at_CellularAutomaton_internal_3 = VCALL local_evolve_at_CellularAutomaton_internal_2 num_cells - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 40($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) - # local_evolve_at_CellularAutomaton_num_1 = local_evolve_at_CellularAutomaton_internal_3 - lw $t0, -16($fp) - sw $t0, -8($fp) - # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_0 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -24($fp) - label_WHILE_65: - # LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) - # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) - lw $a0, -4($fp) - lw $a1, -8($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -32($fp) - # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_7 GOTO label_FALSE_67 - # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_7 GOTO label_FALSE_67 - lw $t0, -32($fp) - bgt $t0, 0, label_FALSE_67 - # IF_ZERO local_evolve_at_CellularAutomaton_internal_7 GOTO label_FALSE_67 - # IF_ZERO local_evolve_at_CellularAutomaton_internal_7 GOTO label_FALSE_67 - lw $t0, -32($fp) - beq $t0, 0, label_FALSE_67 - # LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -32($fp) - # GOTO label_END_68 -j label_END_68 -label_FALSE_67: - # LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -32($fp) - label_END_68: -# LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) -# Obtain value from -32($fp) -lw $v0, -32($fp) -lw $v0, 12($v0) -sw $v0, -28($fp) -# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_66 -# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_66 -lw $t0, -28($fp) -beq $t0, 0, label_WHILE_END_66 -# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) -# LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) -# local_evolve_at_CellularAutomaton_internal_8 = local_evolve_at_CellularAutomaton_temp_5 -lw $t0, -24($fp) -sw $t0, -36($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) -# local_evolve_at_CellularAutomaton_internal_12 = SELF -sw $s1, -52($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) -# local_evolve_at_CellularAutomaton_internal_10 = local_evolve_at_CellularAutomaton_internal_12 -lw $t0, -52($fp) -sw $t0, -44($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_evolve_at_CellularAutomaton_position_0 -# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) -lw $t0, -4($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) -# local_evolve_at_CellularAutomaton_internal_11 = VCALL local_evolve_at_CellularAutomaton_internal_10 cell_at_next_evolution -# Save new self pointer in $s1 -lw $s1, -44($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 72($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -48($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_evolve_at_CellularAutomaton_internal_11 -# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) -lw $t0, -48($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) -# local_evolve_at_CellularAutomaton_internal_9 = VCALL local_evolve_at_CellularAutomaton_internal_8 concat -# Save new self pointer in $s1 -lw $s1, -36($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 28($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -40($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) -# local_evolve_at_CellularAutomaton_temp_5 = local_evolve_at_CellularAutomaton_internal_9 -lw $t0, -40($fp) -sw $t0, -24($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_14 --> -60($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -60($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) -# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_14 --> -60($fp) -# local_evolve_at_CellularAutomaton_internal_13 = local_evolve_at_CellularAutomaton_position_0 + local_evolve_at_CellularAutomaton_internal_14 -lw $t1, -4($fp) -lw $t0, 12($t1) -lw $t1, -60($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -56($fp) -# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) -# local_evolve_at_CellularAutomaton_position_0 = local_evolve_at_CellularAutomaton_internal_13 -lw $t0, -56($fp) -sw $t0, -4($fp) -# GOTO label_WHILE_65 -j label_WHILE_65 -label_WHILE_END_66: - # - # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) - lw $t0, -24($fp) - sw $t0, 12($s1) - # LOCAL local_evolve_at_CellularAutomaton_internal_15 --> -64($fp) - # local_evolve_at_CellularAutomaton_internal_15 = SELF - sw $s1, -64($fp) - # RETURN local_evolve_at_CellularAutomaton_internal_15 - lw $v0, -64($fp) - # Deallocate stack frame for function function_evolve_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 72 - jr $ra - # Function END - diff --git a/tests/codegen/complex.mips b/tests/codegen/complex.mips deleted file mode 100644 index 74951590..00000000 --- a/tests/codegen/complex.mips +++ /dev/null @@ -1,3336 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:12 2020 -# School of Math and Computer Science, University of Havana -# - -.data -dummy: .word 0 -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Int: .asciiz "Int" -# Function END -Complex: .asciiz "Complex" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word dummy, function_out_int_at_IO, dummy, function_in_int_at_IO, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, function_out_string_at_IO, dummy, function_type_name_at_Object, function_in_string_at_IO, function_abort_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_substr_at_String, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_concat_at_String, function_type_name_at_Object, dummy, function_abort_at_Object, function_length_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Int **** -Int_start: - Int_vtable_pointer: .word Int_vtable - # Function END -Int_end: -# - - -# **** VTABLE for type Complex **** -Complex_vtable: .word dummy, function_out_int_at_IO, function_reflect_X_at_Complex, function_in_int_at_IO, function_reflect_0_at_Complex, function_init_at_Complex, dummy, function_print_at_Complex, function_reflect_Y_at_Complex, function_copy_at_Object, function_out_string_at_IO, dummy, function_type_name_at_Object, function_in_string_at_IO, function_abort_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Complex **** -Complex_start: - Complex_vtable_pointer: .word Complex_vtable - # Function END -Complex_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word dummy, function_out_int_at_IO, dummy, function_in_int_at_IO, dummy, dummy, function_main_at_Main, dummy, dummy, function_copy_at_Object, function_out_string_at_IO, dummy, function_type_name_at_Object, function_in_string_at_IO, function_abort_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, 1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 2, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1, -1 -Complex__TDT: .word -1, -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz "+" -# - - -data_5: .asciiz "I" -# - - -data_6: .asciiz "=)\n" -# - - -data_7: .asciiz "=(\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - move $a2, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - sw $a2, 12($v0) - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - lw $t2, 12($t2) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - lw $a0, 12($a0) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # LOCAL local_length_at_String_internal_1 --> -8($fp) - # LOCAL local_length_at_String_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -4($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_length_at_String_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Main - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - # Load type offset - li $t0, 24 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t0, Main_vtable - # Get pointer to function address - lw $t1, 24($t0) - # Call function. Result is on $v0 - jalr $t1 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Complex__attrib__x__init implementation. -# @Params: -__Complex__attrib__x__init: - # Allocate stack frame for function __Complex__attrib__x__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local___attrib__x__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local___attrib__x__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Complex__attrib__x__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Complex__attrib__y__init implementation. -# @Params: -__Complex__attrib__y__init: - # Allocate stack frame for function __Complex__attrib__y__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local___attrib__y__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local___attrib__y__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Complex__attrib__y__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_Complex implementation. -# @Params: -# 0($fp) = param_init_at_Complex_a_0 -# 4($fp) = param_init_at_Complex_b_1 -function_init_at_Complex: - # Allocate stack frame for function function_init_at_Complex. - subu $sp, $sp, 36 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 36 - # local_init_at_Complex_internal_2 = GETATTRIBUTE x Complex - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - lw $t0, 12($s1) - sw $t0, -12($fp) - # IF_ZERO local_init_at_Complex_internal_2 GOTO label_FALSE_1 - # IF_ZERO local_init_at_Complex_internal_2 GOTO label_FALSE_1 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_1 - # IF_ZERO param_init_at_Complex_a_0 GOTO label_FALSE_1 - # IF_ZERO param_init_at_Complex_a_0 GOTO label_FALSE_1 - lw $t0, 4($fp) - beq $t0, 0, label_FALSE_1 - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with String - la $v0, String - lw $a0, -12($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_STRING_4 - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_STRING_4 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_STRING_4 - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with Bool - la $v0, Bool - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_5 - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with Int - la $v0, Int - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_5 - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # PARAM param_init_at_Complex_a_0 --> 4($fp) - # Load pointers and SUB - lw $a0, -12($fp) - lw $a1, 4($fp) - sub $a0, $a0, $a1 - sw $a0, -8($fp) - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_2 - # GOTO label_FALSE_1 - j label_FALSE_1 - label_COMPARE_BY_VALUE_5: - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # PARAM param_init_at_Complex_a_0 --> 4($fp) - lw $a0, -12($fp) - lw $a1, 4($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -8($fp) - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_2 - # GOTO label_FALSE_1 - j label_FALSE_1 - label_COMPARE_STRING_4: - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # PARAM param_init_at_Complex_a_0 --> 4($fp) - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, 4($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -8($fp) - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_CONTINUE_6 - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_CONTINUE_6 - lw $t0, -8($fp) - beq $t0, 0, label_CONTINUE_6 - # GOTO label_FALSE_1 - j label_FALSE_1 - label_CONTINUE_6: - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # PARAM param_init_at_Complex_a_0 --> 4($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, 4($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_7: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_8 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_7 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_8: - # Store result - sw $a2, -8($fp) - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_2 - label_FALSE_1: - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # GOTO label_END_3 -j label_END_3 -label_TRUE_2: - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -4($fp) - label_END_3: -# local_init_at_Complex_internal_5 = GETATTRIBUTE y Complex -# LOCAL local_init_at_Complex_internal_5 --> -24($fp) -lw $t0, 16($s1) -sw $t0, -24($fp) -# IF_ZERO local_init_at_Complex_internal_5 GOTO label_FALSE_9 -# IF_ZERO local_init_at_Complex_internal_5 GOTO label_FALSE_9 -lw $t0, -24($fp) -beq $t0, 0, label_FALSE_9 -# IF_ZERO param_init_at_Complex_b_1 GOTO label_FALSE_9 -# IF_ZERO param_init_at_Complex_b_1 GOTO label_FALSE_9 -lw $t0, 0($fp) -beq $t0, 0, label_FALSE_9 -# LOCAL local_init_at_Complex_internal_4 --> -20($fp) -# LOCAL local_init_at_Complex_internal_5 --> -24($fp) -# Comparing -24($fp) type with String -la $v0, String -lw $a0, -24($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -20($fp) -# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_STRING_12 -# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_STRING_12 -lw $t0, -20($fp) -beq $t0, 0, label_COMPARE_STRING_12 -# LOCAL local_init_at_Complex_internal_4 --> -20($fp) -# LOCAL local_init_at_Complex_internal_5 --> -24($fp) -# Comparing -24($fp) type with Bool -la $v0, Bool -lw $a0, -24($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -20($fp) -# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 -# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 -lw $t0, -20($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_13 -# LOCAL local_init_at_Complex_internal_4 --> -20($fp) -# LOCAL local_init_at_Complex_internal_5 --> -24($fp) -# Comparing -24($fp) type with Int -la $v0, Int -lw $a0, -24($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -20($fp) -# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 -# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 -lw $t0, -20($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_13 -# LOCAL local_init_at_Complex_internal_4 --> -20($fp) -# LOCAL local_init_at_Complex_internal_5 --> -24($fp) -# PARAM param_init_at_Complex_b_1 --> 0($fp) -# Load pointers and SUB -lw $a0, -24($fp) -lw $a1, 0($fp) -sub $a0, $a0, $a1 -sw $a0, -20($fp) -# IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 -# IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 -lw $t0, -20($fp) -beq $t0, 0, label_TRUE_10 -# GOTO label_FALSE_9 -j label_FALSE_9 -label_COMPARE_BY_VALUE_13: - # LOCAL local_init_at_Complex_internal_4 --> -20($fp) - # LOCAL local_init_at_Complex_internal_5 --> -24($fp) - # PARAM param_init_at_Complex_b_1 --> 0($fp) - lw $a0, -24($fp) - lw $a1, 0($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -20($fp) - # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 - # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 - lw $t0, -20($fp) - beq $t0, 0, label_TRUE_10 - # GOTO label_FALSE_9 - j label_FALSE_9 - label_COMPARE_STRING_12: - # LOCAL local_init_at_Complex_internal_4 --> -20($fp) - # LOCAL local_init_at_Complex_internal_5 --> -24($fp) - # PARAM param_init_at_Complex_b_1 --> 0($fp) - # Load strings for comparison - lw $v0, -24($fp) - lw $v1, 0($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -20($fp) - # IF_ZERO local_init_at_Complex_internal_4 GOTO label_CONTINUE_14 - # IF_ZERO local_init_at_Complex_internal_4 GOTO label_CONTINUE_14 - lw $t0, -20($fp) - beq $t0, 0, label_CONTINUE_14 - # GOTO label_FALSE_9 - j label_FALSE_9 - label_CONTINUE_14: - # LOCAL local_init_at_Complex_internal_4 --> -20($fp) - # LOCAL local_init_at_Complex_internal_5 --> -24($fp) - # PARAM param_init_at_Complex_b_1 --> 0($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -24($fp) - lw $v1, 0($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_15: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_16 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_15 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_16: - # Store result - sw $a2, -20($fp) - # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 - # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 - lw $t0, -20($fp) - beq $t0, 0, label_TRUE_10 - label_FALSE_9: - # LOCAL local_init_at_Complex_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -16($fp) - # GOTO label_END_11 -j label_END_11 -label_TRUE_10: - # LOCAL local_init_at_Complex_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -16($fp) - label_END_11: -# LOCAL local_init_at_Complex_internal_6 --> -28($fp) -# local_init_at_Complex_internal_6 = SELF -sw $s1, -28($fp) -# RETURN local_init_at_Complex_internal_6 -lw $v0, -28($fp) -# Deallocate stack frame for function function_init_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 36 -# Deallocate function args -addu $sp, $sp, 8 -jr $ra -# Function END - - -# function_print_at_Complex implementation. -# @Params: -function_print_at_Complex: - # Allocate stack frame for function function_print_at_Complex. - subu $sp, $sp, 100 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 100 - # local_print_at_Complex_internal_4 = GETATTRIBUTE y Complex - # LOCAL local_print_at_Complex_internal_4 --> -20($fp) - lw $t0, 16($s1) - sw $t0, -20($fp) - # LOCAL local_print_at_Complex_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -24($fp) - # IF_ZERO local_print_at_Complex_internal_4 GOTO label_FALSE_19 - # IF_ZERO local_print_at_Complex_internal_4 GOTO label_FALSE_19 - lw $t0, -20($fp) - beq $t0, 0, label_FALSE_19 - # IF_ZERO local_print_at_Complex_internal_5 GOTO label_FALSE_19 - # IF_ZERO local_print_at_Complex_internal_5 GOTO label_FALSE_19 - lw $t0, -24($fp) - beq $t0, 0, label_FALSE_19 - # LOCAL local_print_at_Complex_internal_3 --> -16($fp) - # LOCAL local_print_at_Complex_internal_4 --> -20($fp) - # Comparing -20($fp) type with String - la $v0, String - lw $a0, -20($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_STRING_22 - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_STRING_22 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_22 - # LOCAL local_print_at_Complex_internal_3 --> -16($fp) - # LOCAL local_print_at_Complex_internal_4 --> -20($fp) - # Comparing -20($fp) type with Bool - la $v0, Bool - lw $a0, -20($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_23 - # LOCAL local_print_at_Complex_internal_3 --> -16($fp) - # LOCAL local_print_at_Complex_internal_4 --> -20($fp) - # Comparing -20($fp) type with Int - la $v0, Int - lw $a0, -20($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_23 - # LOCAL local_print_at_Complex_internal_3 --> -16($fp) - # LOCAL local_print_at_Complex_internal_4 --> -20($fp) - # LOCAL local_print_at_Complex_internal_5 --> -24($fp) - # Load pointers and SUB - lw $a0, -20($fp) - lw $a1, -24($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_20 - # GOTO label_FALSE_19 - j label_FALSE_19 - label_COMPARE_BY_VALUE_23: - # LOCAL local_print_at_Complex_internal_3 --> -16($fp) - # LOCAL local_print_at_Complex_internal_4 --> -20($fp) - # LOCAL local_print_at_Complex_internal_5 --> -24($fp) - lw $a0, -20($fp) - lw $a1, -24($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_20 - # GOTO label_FALSE_19 - j label_FALSE_19 - label_COMPARE_STRING_22: - # LOCAL local_print_at_Complex_internal_3 --> -16($fp) - # LOCAL local_print_at_Complex_internal_4 --> -20($fp) - # LOCAL local_print_at_Complex_internal_5 --> -24($fp) - # Load strings for comparison - lw $v0, -20($fp) - lw $v1, -24($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_CONTINUE_24 - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_CONTINUE_24 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_24 - # GOTO label_FALSE_19 - j label_FALSE_19 - label_CONTINUE_24: - # LOCAL local_print_at_Complex_internal_3 --> -16($fp) - # LOCAL local_print_at_Complex_internal_4 --> -20($fp) - # LOCAL local_print_at_Complex_internal_5 --> -24($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -20($fp) - lw $v1, -24($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_25: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_26 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_25 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_26: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_20 - label_FALSE_19: - # LOCAL local_print_at_Complex_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_21 -j label_END_21 -label_TRUE_20: - # LOCAL local_print_at_Complex_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_21: -# LOCAL local_print_at_Complex_internal_0 --> -4($fp) -# LOCAL local_print_at_Complex_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_print_at_Complex_internal_0 GOTO label_FALSEIF_17 -# IF_ZERO local_print_at_Complex_internal_0 GOTO label_FALSEIF_17 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_17 -# LOCAL local_print_at_Complex_internal_8 --> -36($fp) -# local_print_at_Complex_internal_8 = SELF -sw $s1, -36($fp) -# LOCAL local_print_at_Complex_internal_6 --> -28($fp) -# LOCAL local_print_at_Complex_internal_8 --> -36($fp) -# local_print_at_Complex_internal_6 = local_print_at_Complex_internal_8 -lw $t0, -36($fp) -sw $t0, -28($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_print_at_Complex_internal_9 = GETATTRIBUTE x Complex -# LOCAL local_print_at_Complex_internal_9 --> -40($fp) -lw $t0, 12($s1) -sw $t0, -40($fp) -# ARG local_print_at_Complex_internal_9 -# LOCAL local_print_at_Complex_internal_9 --> -40($fp) -lw $t0, -40($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_print_at_Complex_internal_6 --> -28($fp) -# LOCAL local_print_at_Complex_internal_7 --> -32($fp) -# local_print_at_Complex_internal_7 = VCALL local_print_at_Complex_internal_6 out_int -# Save new self pointer in $s1 -lw $s1, -28($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 4($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -32($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_print_at_Complex_internal_1 --> -8($fp) -# LOCAL local_print_at_Complex_internal_7 --> -32($fp) -# local_print_at_Complex_internal_1 = local_print_at_Complex_internal_7 -lw $t0, -32($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_18 -j label_ENDIF_18 -label_FALSEIF_17: - # LOCAL local_print_at_Complex_internal_18 --> -76($fp) - # local_print_at_Complex_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_print_at_Complex_internal_16 --> -68($fp) - # LOCAL local_print_at_Complex_internal_18 --> -76($fp) - # local_print_at_Complex_internal_16 = local_print_at_Complex_internal_18 - lw $t0, -76($fp) - sw $t0, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Complex_internal_19 = GETATTRIBUTE x Complex - # LOCAL local_print_at_Complex_internal_19 --> -80($fp) - lw $t0, 12($s1) - sw $t0, -80($fp) - # ARG local_print_at_Complex_internal_19 - # LOCAL local_print_at_Complex_internal_19 --> -80($fp) - lw $t0, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Complex_internal_16 --> -68($fp) - # LOCAL local_print_at_Complex_internal_17 --> -72($fp) - # local_print_at_Complex_internal_17 = VCALL local_print_at_Complex_internal_16 out_int - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_14 --> -60($fp) - # LOCAL local_print_at_Complex_internal_17 --> -72($fp) - # local_print_at_Complex_internal_14 = local_print_at_Complex_internal_17 - lw $t0, -72($fp) - sw $t0, -60($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Complex_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_4 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -84($fp) - # ARG local_print_at_Complex_internal_20 - # LOCAL local_print_at_Complex_internal_20 --> -84($fp) - lw $t0, -84($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Complex_internal_14 --> -60($fp) - # LOCAL local_print_at_Complex_internal_15 --> -64($fp) - # local_print_at_Complex_internal_15 = VCALL local_print_at_Complex_internal_14 out_string - # Save new self pointer in $s1 - lw $s1, -60($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 40($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -64($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_12 --> -52($fp) - # LOCAL local_print_at_Complex_internal_15 --> -64($fp) - # local_print_at_Complex_internal_12 = local_print_at_Complex_internal_15 - lw $t0, -64($fp) - sw $t0, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Complex_internal_21 = GETATTRIBUTE y Complex - # LOCAL local_print_at_Complex_internal_21 --> -88($fp) - lw $t0, 16($s1) - sw $t0, -88($fp) - # ARG local_print_at_Complex_internal_21 - # LOCAL local_print_at_Complex_internal_21 --> -88($fp) - lw $t0, -88($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Complex_internal_12 --> -52($fp) - # LOCAL local_print_at_Complex_internal_13 --> -56($fp) - # local_print_at_Complex_internal_13 = VCALL local_print_at_Complex_internal_12 out_int - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_10 --> -44($fp) - # LOCAL local_print_at_Complex_internal_13 --> -56($fp) - # local_print_at_Complex_internal_10 = local_print_at_Complex_internal_13 - lw $t0, -56($fp) - sw $t0, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Complex_internal_22 --> -92($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_5 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -92($fp) - # ARG local_print_at_Complex_internal_22 - # LOCAL local_print_at_Complex_internal_22 --> -92($fp) - lw $t0, -92($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Complex_internal_10 --> -44($fp) - # LOCAL local_print_at_Complex_internal_11 --> -48($fp) - # local_print_at_Complex_internal_11 = VCALL local_print_at_Complex_internal_10 out_string - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 40($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # LOCAL local_print_at_Complex_internal_11 --> -48($fp) - # local_print_at_Complex_internal_1 = local_print_at_Complex_internal_11 - lw $t0, -48($fp) - sw $t0, -8($fp) - label_ENDIF_18: -# RETURN local_print_at_Complex_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_print_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 100 -jr $ra -# Function END - - -# function_reflect_0_at_Complex implementation. -# @Params: -function_reflect_0_at_Complex: - # Allocate stack frame for function function_reflect_0_at_Complex. - subu $sp, $sp, 52 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 52 - # local_reflect_0_at_Complex_internal_2 = GETATTRIBUTE x Complex - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - lw $t0, 12($s1) - sw $t0, -12($fp) - # local_reflect_0_at_Complex_internal_4 = GETATTRIBUTE x Complex - # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) - lw $t0, 12($s1) - sw $t0, -20($fp) - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) - lw $t0, -20($fp) - lw $t0, 12($t0) - not $t0, $t0 - add $t0, $t0, 1 - sw $t0, -16($fp) - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -16($fp) - sw $t0, 12($v0) - sw $v0, -16($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_2 GOTO label_FALSE_27 - # IF_ZERO local_reflect_0_at_Complex_internal_2 GOTO label_FALSE_27 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_27 - # IF_ZERO local_reflect_0_at_Complex_internal_3 GOTO label_FALSE_27 - # IF_ZERO local_reflect_0_at_Complex_internal_3 GOTO label_FALSE_27 - lw $t0, -16($fp) - beq $t0, 0, label_FALSE_27 - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with String - la $v0, String - lw $a0, -12($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_STRING_30 - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_STRING_30 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_STRING_30 - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with Bool - la $v0, Bool - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_31 - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with Int - la $v0, Int - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_31 - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - # Load pointers and SUB - lw $a0, -12($fp) - lw $a1, -16($fp) - sub $a0, $a0, $a1 - sw $a0, -8($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_28 - # GOTO label_FALSE_27 - j label_FALSE_27 - label_COMPARE_BY_VALUE_31: - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - lw $a0, -12($fp) - lw $a1, -16($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -8($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_28 - # GOTO label_FALSE_27 - j label_FALSE_27 - label_COMPARE_STRING_30: - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, -16($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -8($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_CONTINUE_32 - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_CONTINUE_32 - lw $t0, -8($fp) - beq $t0, 0, label_CONTINUE_32 - # GOTO label_FALSE_27 - j label_FALSE_27 - label_CONTINUE_32: - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, -16($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_33: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_34 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_33 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_34: - # Store result - sw $a2, -8($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_28 - label_FALSE_27: - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # GOTO label_END_29 -j label_END_29 -label_TRUE_28: - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -4($fp) - label_END_29: -# local_reflect_0_at_Complex_internal_7 = GETATTRIBUTE y Complex -# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -lw $t0, 16($s1) -sw $t0, -32($fp) -# local_reflect_0_at_Complex_internal_9 = GETATTRIBUTE y Complex -# LOCAL local_reflect_0_at_Complex_internal_9 --> -40($fp) -lw $t0, 16($s1) -sw $t0, -40($fp) -# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) -# LOCAL local_reflect_0_at_Complex_internal_9 --> -40($fp) -lw $t0, -40($fp) -lw $t0, 12($t0) -not $t0, $t0 -add $t0, $t0, 1 -sw $t0, -36($fp) -# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) -# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -lw $t0, -36($fp) -sw $t0, 12($v0) -sw $v0, -36($fp) -# IF_ZERO local_reflect_0_at_Complex_internal_7 GOTO label_FALSE_35 -# IF_ZERO local_reflect_0_at_Complex_internal_7 GOTO label_FALSE_35 -lw $t0, -32($fp) -beq $t0, 0, label_FALSE_35 -# IF_ZERO local_reflect_0_at_Complex_internal_8 GOTO label_FALSE_35 -# IF_ZERO local_reflect_0_at_Complex_internal_8 GOTO label_FALSE_35 -lw $t0, -36($fp) -beq $t0, 0, label_FALSE_35 -# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) -# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -# Comparing -32($fp) type with String -la $v0, String -lw $a0, -32($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -28($fp) -# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_STRING_38 -# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_STRING_38 -lw $t0, -28($fp) -beq $t0, 0, label_COMPARE_STRING_38 -# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) -# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -# Comparing -32($fp) type with Bool -la $v0, Bool -lw $a0, -32($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -28($fp) -# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 -# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 -lw $t0, -28($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_39 -# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) -# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -# Comparing -32($fp) type with Int -la $v0, Int -lw $a0, -32($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -28($fp) -# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 -# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 -lw $t0, -28($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_39 -# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) -# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) -# Load pointers and SUB -lw $a0, -32($fp) -lw $a1, -36($fp) -sub $a0, $a0, $a1 -sw $a0, -28($fp) -# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 -# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 -lw $t0, -28($fp) -beq $t0, 0, label_TRUE_36 -# GOTO label_FALSE_35 -j label_FALSE_35 -label_COMPARE_BY_VALUE_39: - # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) - # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) - # LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) - lw $a0, -32($fp) - lw $a1, -36($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -28($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 - # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 - lw $t0, -28($fp) - beq $t0, 0, label_TRUE_36 - # GOTO label_FALSE_35 - j label_FALSE_35 - label_COMPARE_STRING_38: - # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) - # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) - # LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) - # Load strings for comparison - lw $v0, -32($fp) - lw $v1, -36($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -28($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_CONTINUE_40 - # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_CONTINUE_40 - lw $t0, -28($fp) - beq $t0, 0, label_CONTINUE_40 - # GOTO label_FALSE_35 - j label_FALSE_35 - label_CONTINUE_40: - # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) - # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) - # LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -32($fp) - lw $v1, -36($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_41: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_42 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_41 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_42: - # Store result - sw $a2, -28($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 - # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 - lw $t0, -28($fp) - beq $t0, 0, label_TRUE_36 - label_FALSE_35: - # LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -24($fp) - # GOTO label_END_37 -j label_END_37 -label_TRUE_36: - # LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -24($fp) - label_END_37: -# LOCAL local_reflect_0_at_Complex_internal_10 --> -44($fp) -# local_reflect_0_at_Complex_internal_10 = SELF -sw $s1, -44($fp) -# RETURN local_reflect_0_at_Complex_internal_10 -lw $v0, -44($fp) -# Deallocate stack frame for function function_reflect_0_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 52 -jr $ra -# Function END - - -# function_reflect_X_at_Complex implementation. -# @Params: -function_reflect_X_at_Complex: - # Allocate stack frame for function function_reflect_X_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_reflect_X_at_Complex_internal_2 = GETATTRIBUTE y Complex - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - lw $t0, 16($s1) - sw $t0, -12($fp) - # local_reflect_X_at_Complex_internal_4 = GETATTRIBUTE y Complex - # LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) - lw $t0, 16($s1) - sw $t0, -20($fp) - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - # LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) - lw $t0, -20($fp) - lw $t0, 12($t0) - not $t0, $t0 - add $t0, $t0, 1 - sw $t0, -16($fp) - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -16($fp) - sw $t0, 12($v0) - sw $v0, -16($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_2 GOTO label_FALSE_43 - # IF_ZERO local_reflect_X_at_Complex_internal_2 GOTO label_FALSE_43 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_43 - # IF_ZERO local_reflect_X_at_Complex_internal_3 GOTO label_FALSE_43 - # IF_ZERO local_reflect_X_at_Complex_internal_3 GOTO label_FALSE_43 - lw $t0, -16($fp) - beq $t0, 0, label_FALSE_43 - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with String - la $v0, String - lw $a0, -12($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_STRING_46 - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_STRING_46 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_STRING_46 - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with Bool - la $v0, Bool - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_47 - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with Int - la $v0, Int - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_47 - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - # Load pointers and SUB - lw $a0, -12($fp) - lw $a1, -16($fp) - sub $a0, $a0, $a1 - sw $a0, -8($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_44 - # GOTO label_FALSE_43 - j label_FALSE_43 - label_COMPARE_BY_VALUE_47: - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - lw $a0, -12($fp) - lw $a1, -16($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -8($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_44 - # GOTO label_FALSE_43 - j label_FALSE_43 - label_COMPARE_STRING_46: - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, -16($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -8($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_CONTINUE_48 - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_CONTINUE_48 - lw $t0, -8($fp) - beq $t0, 0, label_CONTINUE_48 - # GOTO label_FALSE_43 - j label_FALSE_43 - label_CONTINUE_48: - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, -16($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_49: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_50 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_49 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_50: - # Store result - sw $a2, -8($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_44 - label_FALSE_43: - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # GOTO label_END_45 -j label_END_45 -label_TRUE_44: - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -4($fp) - label_END_45: -# LOCAL local_reflect_X_at_Complex_internal_5 --> -24($fp) -# local_reflect_X_at_Complex_internal_5 = SELF -sw $s1, -24($fp) -# RETURN local_reflect_X_at_Complex_internal_5 -lw $v0, -24($fp) -# Deallocate stack frame for function function_reflect_X_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 32 -jr $ra -# Function END - - -# function_reflect_Y_at_Complex implementation. -# @Params: -function_reflect_Y_at_Complex: - # Allocate stack frame for function function_reflect_Y_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_reflect_Y_at_Complex_internal_2 = GETATTRIBUTE x Complex - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - lw $t0, 12($s1) - sw $t0, -12($fp) - # local_reflect_Y_at_Complex_internal_4 = GETATTRIBUTE x Complex - # LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) - lw $t0, 12($s1) - sw $t0, -20($fp) - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - # LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) - lw $t0, -20($fp) - lw $t0, 12($t0) - not $t0, $t0 - add $t0, $t0, 1 - sw $t0, -16($fp) - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -16($fp) - sw $t0, 12($v0) - sw $v0, -16($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_2 GOTO label_FALSE_51 - # IF_ZERO local_reflect_Y_at_Complex_internal_2 GOTO label_FALSE_51 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_51 - # IF_ZERO local_reflect_Y_at_Complex_internal_3 GOTO label_FALSE_51 - # IF_ZERO local_reflect_Y_at_Complex_internal_3 GOTO label_FALSE_51 - lw $t0, -16($fp) - beq $t0, 0, label_FALSE_51 - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with String - la $v0, String - lw $a0, -12($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_STRING_54 - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_STRING_54 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_STRING_54 - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with Bool - la $v0, Bool - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_55 - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with Int - la $v0, Int - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_55 - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - # Load pointers and SUB - lw $a0, -12($fp) - lw $a1, -16($fp) - sub $a0, $a0, $a1 - sw $a0, -8($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_52 - # GOTO label_FALSE_51 - j label_FALSE_51 - label_COMPARE_BY_VALUE_55: - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - lw $a0, -12($fp) - lw $a1, -16($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -8($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_52 - # GOTO label_FALSE_51 - j label_FALSE_51 - label_COMPARE_STRING_54: - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, -16($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -8($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_CONTINUE_56 - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_CONTINUE_56 - lw $t0, -8($fp) - beq $t0, 0, label_CONTINUE_56 - # GOTO label_FALSE_51 - j label_FALSE_51 - label_CONTINUE_56: - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, -16($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_57: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_58 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_57 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_58: - # Store result - sw $a2, -8($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_52 - label_FALSE_51: - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # GOTO label_END_53 -j label_END_53 -label_TRUE_52: - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -4($fp) - label_END_53: -# LOCAL local_reflect_Y_at_Complex_internal_5 --> -24($fp) -# local_reflect_Y_at_Complex_internal_5 = SELF -sw $s1, -24($fp) -# RETURN local_reflect_Y_at_Complex_internal_5 -lw $v0, -24($fp) -# Deallocate stack frame for function function_reflect_Y_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 32 -jr $ra -# Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 104 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 104 - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_c_0 = 0 - li $t0, 0 - sw $t0, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = ALLOCATE Complex - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Complex - sw $t0, 12($v0) - li $t0, 7 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Complex_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Complex__attrib__x__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Complex__attrib__y__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -16($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t0, -16($fp) - sw $t0, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -20($fp) - # ARG local_main_at_Main_internal_4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - lw $t0, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -24($fp) - # ARG local_main_at_Main_internal_5 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - lw $t0, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 20($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_c_0 = local_main_at_Main_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_internal_12 = local_main_at_Main_c_0 - lw $t0, -4($fp) - sw $t0, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 reflect_X - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 8($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_10 = local_main_at_Main_internal_13 - lw $t0, -56($fp) - sw $t0, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 reflect_Y - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 32($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_internal_14 = local_main_at_Main_c_0 - lw $t0, -4($fp) - sw $t0, -60($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 reflect_0 - # Save new self pointer in $s1 - lw $s1, -60($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 16($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -64($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # IF_ZERO local_main_at_Main_internal_11 GOTO label_FALSE_61 - # IF_ZERO local_main_at_Main_internal_11 GOTO label_FALSE_61 - lw $t0, -48($fp) - beq $t0, 0, label_FALSE_61 - # IF_ZERO local_main_at_Main_internal_15 GOTO label_FALSE_61 - # IF_ZERO local_main_at_Main_internal_15 GOTO label_FALSE_61 - lw $t0, -64($fp) - beq $t0, 0, label_FALSE_61 - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # Comparing -48($fp) type with String - la $v0, String - lw $a0, -48($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_STRING_64 - # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_STRING_64 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_STRING_64 - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # Comparing -48($fp) type with Bool - la $v0, Bool - lw $a0, -48($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_65 - # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_65 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_65 - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # Comparing -48($fp) type with Int - la $v0, Int - lw $a0, -48($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_65 - # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_65 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_65 - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # Load pointers and SUB - lw $a0, -48($fp) - lw $a1, -64($fp) - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_62 - # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_62 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_62 - # GOTO label_FALSE_61 - j label_FALSE_61 - label_COMPARE_BY_VALUE_65: - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - lw $a0, -48($fp) - lw $a1, -64($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_62 - # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_62 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_62 - # GOTO label_FALSE_61 - j label_FALSE_61 - label_COMPARE_STRING_64: - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # Load strings for comparison - lw $v0, -48($fp) - lw $v1, -64($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -40($fp) - # IF_ZERO local_main_at_Main_internal_9 GOTO label_CONTINUE_66 - # IF_ZERO local_main_at_Main_internal_9 GOTO label_CONTINUE_66 - lw $t0, -40($fp) - beq $t0, 0, label_CONTINUE_66 - # GOTO label_FALSE_61 - j label_FALSE_61 - label_CONTINUE_66: - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -48($fp) - lw $v1, -64($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_67: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_68 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_67 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_68: - # Store result - sw $a2, -40($fp) - # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_62 - # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_62 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_62 - label_FALSE_61: - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -36($fp) - # GOTO label_END_63 -j label_END_63 -label_TRUE_62: - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -36($fp) - label_END_63: -# LOCAL local_main_at_Main_internal_6 --> -28($fp) -# LOCAL local_main_at_Main_internal_8 --> -36($fp) -# Obtain value from -36($fp) -lw $v0, -36($fp) -lw $v0, 12($v0) -sw $v0, -28($fp) -# IF_ZERO local_main_at_Main_internal_6 GOTO label_FALSEIF_59 -# IF_ZERO local_main_at_Main_internal_6 GOTO label_FALSEIF_59 -lw $t0, -28($fp) -beq $t0, 0, label_FALSEIF_59 -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# local_main_at_Main_internal_18 = SELF -sw $s1, -76($fp) -# LOCAL local_main_at_Main_internal_16 --> -68($fp) -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# local_main_at_Main_internal_16 = local_main_at_Main_internal_18 -lw $t0, -76($fp) -sw $t0, -68($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_6 -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -sw $v0, -80($fp) -# ARG local_main_at_Main_internal_19 -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -lw $t0, -80($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_16 --> -68($fp) -# LOCAL local_main_at_Main_internal_17 --> -72($fp) -# local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string -# Save new self pointer in $s1 -lw $s1, -68($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 40($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -72($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_7 --> -32($fp) -# LOCAL local_main_at_Main_internal_17 --> -72($fp) -# local_main_at_Main_internal_7 = local_main_at_Main_internal_17 -lw $t0, -72($fp) -sw $t0, -32($fp) -# GOTO label_ENDIF_60 -j label_ENDIF_60 -label_FALSEIF_59: - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - # local_main_at_Main_internal_22 = SELF - sw $s1, -92($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - # local_main_at_Main_internal_20 = local_main_at_Main_internal_22 - lw $t0, -92($fp) - sw $t0, -84($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_23 --> -96($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_7 - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - sw $v0, -96($fp) - # ARG local_main_at_Main_internal_23 - # LOCAL local_main_at_Main_internal_23 --> -96($fp) - lw $t0, -96($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # local_main_at_Main_internal_21 = VCALL local_main_at_Main_internal_20 out_string - # Save new self pointer in $s1 - lw $s1, -84($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 40($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -88($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # local_main_at_Main_internal_7 = local_main_at_Main_internal_21 - lw $t0, -88($fp) - sw $t0, -32($fp) - label_ENDIF_60: -# RETURN local_main_at_Main_internal_7 -lw $v0, -32($fp) -# Deallocate stack frame for function function_main_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 104 -jr $ra -# Function END - diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips deleted file mode 100644 index 2fbb08cd..00000000 --- a/tests/codegen/fib.mips +++ /dev/null @@ -1,1565 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:12 2020 -# School of Math and Computer Science, University of Havana -# - -.data -dummy: .word 0 -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Int: .asciiz "Int" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word dummy, function_abort_at_Object, dummy, function_in_string_at_IO, function_out_int_at_IO, dummy, function_in_int_at_IO, function_type_name_at_Object, function_copy_at_Object, dummy, function_out_string_at_IO, dummy -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word dummy, function_abort_at_Object, function_substr_at_String, dummy, dummy, function_concat_at_String, dummy, function_type_name_at_Object, function_copy_at_Object, function_length_at_String, dummy, dummy -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Int **** -Int_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Int **** -Int_start: - Int_vtable_pointer: .word Int_vtable - # Function END -Int_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_fib_at_Main, function_abort_at_Object, dummy, function_in_string_at_IO, function_out_int_at_IO, dummy, function_in_int_at_IO, function_type_name_at_Object, function_copy_at_Object, dummy, function_out_string_at_IO, function_main_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz "Enter n to find nth fibonacci number!\n" -# - - -data_5: .asciiz "\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - move $a2, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - sw $a2, 12($v0) - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - lw $t2, 12($t2) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - lw $a0, 12($a0) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # LOCAL local_length_at_String_internal_1 --> -8($fp) - # LOCAL local_length_at_String_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -4($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_length_at_String_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Main - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t0, Main_vtable - # Get pointer to function address - lw $t1, 44($t0) - # Call function. Result is on $v0 - jalr $t1 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 76 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 76 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_4 - sw $t0, 12($v0) - li $t0, 38 - sw $t0, 16($v0) - sw $v0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 40($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # local_main_at_Main_internal_6 = SELF - sw $s1, -28($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # local_main_at_Main_internal_4 = local_main_at_Main_internal_6 - lw $t0, -28($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = SELF - sw $s1, -40($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t0, -40($fp) - sw $t0, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_12 = SELF - sw $s1, -52($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 - lw $t0, -52($fp) - sw $t0, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 in_int - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 24($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_11 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - lw $t0, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 fib - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 0($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_8 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - lw $t0, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 out_int - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 16($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 - lw $t0, -64($fp) - sw $t0, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_5 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -68($fp) - # ARG local_main_at_Main_internal_16 - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - lw $t0, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 out_string - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 40($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_14 - lw $v0, -60($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 76 - jr $ra - # Function END - - -# function_fib_at_Main implementation. -# @Params: -# 0($fp) = param_fib_at_Main_i_0 -function_fib_at_Main: - # Allocate stack frame for function function_fib_at_Main. - subu $sp, $sp, 64 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 64 - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_fib_at_Main_internal_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -8($fp) - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # LOCAL local_fib_at_Main_internal_1 --> -8($fp) - # local_fib_at_Main_a_0 = local_fib_at_Main_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # LOCAL local_fib_at_Main_b_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # LOCAL local_fib_at_Main_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -16($fp) - # LOCAL local_fib_at_Main_b_2 --> -12($fp) - # LOCAL local_fib_at_Main_internal_3 --> -16($fp) - # local_fib_at_Main_b_2 = local_fib_at_Main_internal_3 - lw $t0, -16($fp) - sw $t0, -12($fp) - # LOCAL local_fib_at_Main_c_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -20($fp) - # LOCAL local_fib_at_Main_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -24($fp) - # LOCAL local_fib_at_Main_c_4 --> -20($fp) - # LOCAL local_fib_at_Main_internal_5 --> -24($fp) - # local_fib_at_Main_c_4 = local_fib_at_Main_internal_5 - lw $t0, -24($fp) - sw $t0, -20($fp) - label_WHILE_1: - # LOCAL local_fib_at_Main_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -40($fp) - # IF_ZERO param_fib_at_Main_i_0 GOTO label_FALSE_3 - # IF_ZERO param_fib_at_Main_i_0 GOTO label_FALSE_3 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_3 - # IF_ZERO local_fib_at_Main_internal_9 GOTO label_FALSE_3 - # IF_ZERO local_fib_at_Main_internal_9 GOTO label_FALSE_3 - lw $t0, -40($fp) - beq $t0, 0, label_FALSE_3 - # LOCAL local_fib_at_Main_internal_8 --> -36($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -36($fp) - # IF_ZERO local_fib_at_Main_internal_8 GOTO label_COMPARE_STRING_6 - # IF_ZERO local_fib_at_Main_internal_8 GOTO label_COMPARE_STRING_6 - lw $t0, -36($fp) - beq $t0, 0, label_COMPARE_STRING_6 - # LOCAL local_fib_at_Main_internal_8 --> -36($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -36($fp) - # IF_ZERO local_fib_at_Main_internal_8 GOTO label_COMPARE_BY_VALUE_7 - # IF_ZERO local_fib_at_Main_internal_8 GOTO label_COMPARE_BY_VALUE_7 - lw $t0, -36($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_7 - # LOCAL local_fib_at_Main_internal_8 --> -36($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -36($fp) - # IF_ZERO local_fib_at_Main_internal_8 GOTO label_COMPARE_BY_VALUE_7 - # IF_ZERO local_fib_at_Main_internal_8 GOTO label_COMPARE_BY_VALUE_7 - lw $t0, -36($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_7 - # LOCAL local_fib_at_Main_internal_8 --> -36($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # LOCAL local_fib_at_Main_internal_9 --> -40($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -40($fp) - sub $a0, $a0, $a1 - sw $a0, -36($fp) - # IF_ZERO local_fib_at_Main_internal_8 GOTO label_TRUE_4 - # IF_ZERO local_fib_at_Main_internal_8 GOTO label_TRUE_4 - lw $t0, -36($fp) - beq $t0, 0, label_TRUE_4 - # GOTO label_FALSE_3 - j label_FALSE_3 - label_COMPARE_BY_VALUE_7: - # LOCAL local_fib_at_Main_internal_8 --> -36($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # LOCAL local_fib_at_Main_internal_9 --> -40($fp) - lw $a0, 0($fp) - lw $a1, -40($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -36($fp) - # IF_ZERO local_fib_at_Main_internal_8 GOTO label_TRUE_4 - # IF_ZERO local_fib_at_Main_internal_8 GOTO label_TRUE_4 - lw $t0, -36($fp) - beq $t0, 0, label_TRUE_4 - # GOTO label_FALSE_3 - j label_FALSE_3 - label_COMPARE_STRING_6: - # LOCAL local_fib_at_Main_internal_8 --> -36($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # LOCAL local_fib_at_Main_internal_9 --> -40($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -40($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -36($fp) - # IF_ZERO local_fib_at_Main_internal_8 GOTO label_CONTINUE_8 - # IF_ZERO local_fib_at_Main_internal_8 GOTO label_CONTINUE_8 - lw $t0, -36($fp) - beq $t0, 0, label_CONTINUE_8 - # GOTO label_FALSE_3 - j label_FALSE_3 - label_CONTINUE_8: - # LOCAL local_fib_at_Main_internal_8 --> -36($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # LOCAL local_fib_at_Main_internal_9 --> -40($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -40($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_9: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_10 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_9 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_10: - # Store result - sw $a2, -36($fp) - # IF_ZERO local_fib_at_Main_internal_8 GOTO label_TRUE_4 - # IF_ZERO local_fib_at_Main_internal_8 GOTO label_TRUE_4 - lw $t0, -36($fp) - beq $t0, 0, label_TRUE_4 - label_FALSE_3: - # LOCAL local_fib_at_Main_internal_7 --> -32($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -32($fp) - # GOTO label_END_5 -j label_END_5 -label_TRUE_4: - # LOCAL local_fib_at_Main_internal_7 --> -32($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -32($fp) - label_END_5: -# LOCAL local_fib_at_Main_internal_7 --> -32($fp) -# LOCAL local_fib_at_Main_internal_7 --> -32($fp) -# Obtain value from -32($fp) -lw $v0, -32($fp) -lw $v0, 12($v0) -sw $v0, -32($fp) -# IF_ZERO local_fib_at_Main_internal_7 GOTO label_FALSE_11 -# IF_ZERO local_fib_at_Main_internal_7 GOTO label_FALSE_11 -lw $t0, -32($fp) -beq $t0, 0, label_FALSE_11 -# LOCAL local_fib_at_Main_internal_10 --> -44($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -44($fp) -# GOTO label_NOT_END_12 -j label_NOT_END_12 -label_FALSE_11: - # LOCAL local_fib_at_Main_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -44($fp) - label_NOT_END_12: - # LOCAL local_fib_at_Main_internal_6 --> -28($fp) - # LOCAL local_fib_at_Main_internal_10 --> -44($fp) - # Obtain value from -44($fp) - lw $v0, -44($fp) - lw $v0, 12($v0) - sw $v0, -28($fp) - # IF_ZERO local_fib_at_Main_internal_6 GOTO label_WHILE_END_2 - # IF_ZERO local_fib_at_Main_internal_6 GOTO label_WHILE_END_2 - lw $t0, -28($fp) - beq $t0, 0, label_WHILE_END_2 - # LOCAL local_fib_at_Main_internal_11 --> -48($fp) - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # LOCAL local_fib_at_Main_b_2 --> -12($fp) - # local_fib_at_Main_internal_11 = local_fib_at_Main_a_0 + local_fib_at_Main_b_2 - lw $t1, -4($fp) - lw $t0, 12($t1) - lw $t1, -12($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -48($fp) - # LOCAL local_fib_at_Main_c_4 --> -20($fp) - # LOCAL local_fib_at_Main_internal_11 --> -48($fp) - # local_fib_at_Main_c_4 = local_fib_at_Main_internal_11 - lw $t0, -48($fp) - sw $t0, -20($fp) - # LOCAL local_fib_at_Main_internal_13 --> -56($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -56($fp) - # LOCAL local_fib_at_Main_internal_12 --> -52($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # LOCAL local_fib_at_Main_internal_13 --> -56($fp) - # local_fib_at_Main_internal_12 = PARAM param_fib_at_Main_i_0 - local_fib_at_Main_internal_13 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -56($fp) - lw $t2, 12($t1) - sub $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -52($fp) - # PARAM param_fib_at_Main_i_0 --> 0($fp) - # LOCAL local_fib_at_Main_internal_12 --> -52($fp) - # PARAM param_fib_at_Main_i_0 = local_fib_at_Main_internal_12 - lw $t0, -52($fp) - sw $t0, 0($fp) - # LOCAL local_fib_at_Main_b_2 --> -12($fp) - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # local_fib_at_Main_b_2 = local_fib_at_Main_a_0 - lw $t0, -4($fp) - sw $t0, -12($fp) - # LOCAL local_fib_at_Main_a_0 --> -4($fp) - # LOCAL local_fib_at_Main_c_4 --> -20($fp) - # local_fib_at_Main_a_0 = local_fib_at_Main_c_4 - lw $t0, -20($fp) - sw $t0, -4($fp) - # GOTO label_WHILE_1 - j label_WHILE_1 - label_WHILE_END_2: - # RETURN local_fib_at_Main_c_4 - lw $v0, -20($fp) - # Deallocate stack frame for function function_fib_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 64 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - diff --git a/tests/codegen/graph.mips b/tests/codegen/graph.mips deleted file mode 100644 index 86021a47..00000000 --- a/tests/codegen/graph.mips +++ /dev/null @@ -1,11750 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:13 2020 -# School of Math and Computer Science, University of Havana -# - -.data -dummy: .word 0 -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Int: .asciiz "Int" -# Function END -BoolOp: .asciiz "BoolOp" -# Function END -Graph: .asciiz "Graph" -# Function END -Parse: .asciiz "Parse" -# Function END -Main: .asciiz "Main" -# Function END -VList: .asciiz "VList" -# Function END -VCons: .asciiz "VCons" -# Function END -EList: .asciiz "EList" -# Function END -ECons: .asciiz "ECons" -# Function END -Edge: .asciiz "Edge" -# Function END -Vertice: .asciiz "Vertice" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, dummy, function_out_int_at_IO, dummy, dummy, function_out_string_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, function_concat_at_String, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_length_at_String, dummy, dummy, dummy, dummy, dummy, dummy, function_substr_at_String, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Int **** -Int_start: - Int_vtable_pointer: .word Int_vtable - # Function END -Int_end: -# - - -# **** VTABLE for type BoolOp **** -BoolOp_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, function_or_at_BoolOp, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_and_at_BoolOp, dummy, dummy -# Function END -# - - -# **** Type RECORD for type BoolOp **** -BoolOp_start: - BoolOp_vtable_pointer: .word BoolOp_vtable - # Function END -BoolOp_end: -# - - -# **** VTABLE for type Graph **** -Graph_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, function_print_V_at_Graph, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_add_vertice_at_Graph, dummy, dummy, dummy, dummy, dummy, dummy, function_print_E_at_Graph, dummy -# Function END -# - - -# **** Type RECORD for type Graph **** -Graph_start: - Graph_vtable_pointer: .word Graph_vtable - # Function END -Graph_end: -# - - -# **** VTABLE for type Parse **** -Parse_vtable: .word dummy, function_a2i_aux_at_Parse, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_a2i_at_Parse, function_parse_line_at_Parse, dummy, dummy, dummy, dummy, function_abort_at_Object, function_read_input_at_Parse, dummy, dummy, function_in_string_at_IO, function_c2i_at_Parse, function_in_int_at_IO, dummy, function_out_int_at_IO, dummy, dummy, function_out_string_at_IO -# Function END -# - - -# **** Type RECORD for type Parse **** -Parse_start: - Parse_vtable_pointer: .word Parse_vtable - # Function END -Parse_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word dummy, function_a2i_aux_at_Parse, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_main_at_Main, dummy, dummy, function_a2i_at_Parse, function_parse_line_at_Parse, dummy, dummy, dummy, dummy, function_abort_at_Object, function_read_input_at_Parse, dummy, dummy, function_in_string_at_IO, function_c2i_at_Parse, function_in_int_at_IO, dummy, function_out_int_at_IO, dummy, dummy, function_out_string_at_IO -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -# **** VTABLE for type VList **** -VList_vtable: .word dummy, dummy, function_isNil_at_VList, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_tail_at_VList, dummy, dummy, function_cons_at_VList, dummy, function_head_at_VList, dummy, function_abort_at_Object, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, function_print_at_VList, function_out_int_at_IO, dummy, dummy, function_out_string_at_IO -# Function END -# - - -# **** Type RECORD for type VList **** -VList_start: - VList_vtable_pointer: .word VList_vtable - # Function END -VList_end: -# - - -# **** VTABLE for type VCons **** -VCons_vtable: .word dummy, dummy, function_isNil_at_VCons, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, function_init_at_VCons, dummy, dummy, dummy, dummy, function_tail_at_VCons, dummy, dummy, function_cons_at_VList, dummy, function_head_at_VCons, dummy, function_abort_at_Object, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, function_print_at_VCons, function_out_int_at_IO, dummy, dummy, function_out_string_at_IO -# Function END -# - - -# **** Type RECORD for type VCons **** -VCons_start: - VCons_vtable_pointer: .word VCons_vtable - # Function END -VCons_end: -# - - -# **** VTABLE for type EList **** -EList_vtable: .word dummy, dummy, function_isNil_at_EList, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, function_append_at_EList, dummy, dummy, dummy, function_tail_at_EList, dummy, dummy, function_cons_at_EList, dummy, function_head_at_EList, dummy, function_abort_at_Object, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, function_print_at_EList, function_out_int_at_IO, dummy, dummy, function_out_string_at_IO -# Function END -# - - -# **** Type RECORD for type EList **** -EList_start: - EList_vtable_pointer: .word EList_vtable - # Function END -EList_end: -# - - -# **** VTABLE for type ECons **** -ECons_vtable: .word dummy, dummy, function_isNil_at_ECons, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, function_init_at_ECons, function_append_at_EList, dummy, dummy, dummy, function_tail_at_ECons, dummy, dummy, function_cons_at_EList, dummy, function_head_at_ECons, dummy, function_abort_at_Object, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, function_print_at_ECons, function_out_int_at_IO, dummy, dummy, function_out_string_at_IO -# Function END -# - - -# **** Type RECORD for type ECons **** -ECons_start: - ECons_vtable_pointer: .word ECons_vtable - # Function END -ECons_end: -# - - -# **** VTABLE for type Edge **** -Edge_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, function_init_at_Edge, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, function_print_at_Edge, function_out_int_at_IO, dummy, dummy, function_out_string_at_IO -# Function END -# - - -# **** Type RECORD for type Edge **** -Edge_start: - Edge_vtable_pointer: .word Edge_vtable - # Function END -Edge_end: -# - - -# **** VTABLE for type Vertice **** -Vertice_vtable: .word function_outgoing_at_Vertice, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, function_init_at_Vertice, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_number_at_Vertice, dummy, dummy, function_abort_at_Object, dummy, function_add_out_at_Vertice, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, function_print_at_Vertice, function_out_int_at_IO, dummy, dummy, function_out_string_at_IO -# Function END -# - - -# **** Type RECORD for type Vertice **** -Vertice_start: - Vertice_vtable_pointer: .word Vertice_vtable - # Function END -Vertice_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, -1, -1, 1, 2, 1, 2, 1, 2, 1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 1, 1, 2, 3, 2, 3, 2, 3, 2, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -BoolOp__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1 -Graph__TDT: .word -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1 -Parse__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, -1, -1, -1, -1 -Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 -VList__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, -1, -1 -VCons__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1 -EList__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1 -ECons__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 -Edge__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1 -Vertice__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz "\n" -# - - -data_5: .asciiz "" -# - - -data_6: .asciiz "0" -# - - -data_7: .asciiz "1" -# - - -data_8: .asciiz "2" -# - - -data_9: .asciiz "3" -# - - -data_10: .asciiz "4" -# - - -data_11: .asciiz "5" -# - - -data_12: .asciiz "6" -# - - -data_13: .asciiz "7" -# - - -data_14: .asciiz "8" -# - - -data_15: .asciiz "9" -# - - -data_16: .asciiz "-" -# - - -data_17: .asciiz " " -# - - -data_18: .asciiz " " -# - - -data_19: .asciiz "," -# - - -data_20: .asciiz "" -# - - -data_21: .asciiz "" -# - - -data_22: .asciiz "\n" -# - - -data_23: .asciiz "\n" -# - - -data_24: .asciiz " (" -# - - -data_25: .asciiz "," -# - - -data_26: .asciiz ")" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - move $a2, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - sw $a2, 12($v0) - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - lw $t2, 12($t2) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - lw $a0, 12($a0) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # LOCAL local_length_at_String_internal_1 --> -8($fp) - # LOCAL local_length_at_String_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -4($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_length_at_String_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Main - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 24 bytes of memory - li $a0, 24 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - # Load type offset - li $t0, 32 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Parse__attrib__boolop__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Parse__attrib__rest__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__g__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t0, Main_vtable - # Get pointer to function address - lw $t1, 40($t0) - # Call function. Result is on $v0 - jalr $t1 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_and_at_BoolOp implementation. -# @Params: -# 0($fp) = param_and_at_BoolOp_b1_0 -# 4($fp) = param_and_at_BoolOp_b2_1 -function_and_at_BoolOp: - # Allocate stack frame for function function_and_at_BoolOp. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_and_at_BoolOp_internal_0 --> -4($fp) - # PARAM param_and_at_BoolOp_b1_0 --> 4($fp) - # Obtain value from 4($fp) - lw $v0, 4($fp) - lw $v0, 12($v0) - sw $v0, -4($fp) - # IF_ZERO local_and_at_BoolOp_internal_0 GOTO label_FALSEIF_1 - # IF_ZERO local_and_at_BoolOp_internal_0 GOTO label_FALSEIF_1 - lw $t0, -4($fp) - beq $t0, 0, label_FALSEIF_1 - # LOCAL local_and_at_BoolOp_internal_1 --> -8($fp) - # PARAM param_and_at_BoolOp_b2_1 --> 0($fp) - # local_and_at_BoolOp_internal_1 = PARAM param_and_at_BoolOp_b2_1 - lw $t0, 0($fp) - sw $t0, -8($fp) - # GOTO label_ENDIF_2 -j label_ENDIF_2 -label_FALSEIF_1: - # LOCAL local_and_at_BoolOp_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # LOCAL local_and_at_BoolOp_internal_1 --> -8($fp) - # LOCAL local_and_at_BoolOp_internal_2 --> -12($fp) - # local_and_at_BoolOp_internal_1 = local_and_at_BoolOp_internal_2 - lw $t0, -12($fp) - sw $t0, -8($fp) - label_ENDIF_2: -# RETURN local_and_at_BoolOp_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_and_at_BoolOp. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 32 -# Deallocate function args -addu $sp, $sp, 8 -jr $ra -# Function END - - -# function_or_at_BoolOp implementation. -# @Params: -# 0($fp) = param_or_at_BoolOp_b1_0 -# 4($fp) = param_or_at_BoolOp_b2_1 -function_or_at_BoolOp: - # Allocate stack frame for function function_or_at_BoolOp. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_or_at_BoolOp_internal_0 --> -4($fp) - # PARAM param_or_at_BoolOp_b1_0 --> 4($fp) - # Obtain value from 4($fp) - lw $v0, 4($fp) - lw $v0, 12($v0) - sw $v0, -4($fp) - # IF_ZERO local_or_at_BoolOp_internal_0 GOTO label_FALSEIF_3 - # IF_ZERO local_or_at_BoolOp_internal_0 GOTO label_FALSEIF_3 - lw $t0, -4($fp) - beq $t0, 0, label_FALSEIF_3 - # LOCAL local_or_at_BoolOp_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - # LOCAL local_or_at_BoolOp_internal_1 --> -8($fp) - # LOCAL local_or_at_BoolOp_internal_2 --> -12($fp) - # local_or_at_BoolOp_internal_1 = local_or_at_BoolOp_internal_2 - lw $t0, -12($fp) - sw $t0, -8($fp) - # GOTO label_ENDIF_4 -j label_ENDIF_4 -label_FALSEIF_3: - # LOCAL local_or_at_BoolOp_internal_1 --> -8($fp) - # PARAM param_or_at_BoolOp_b2_1 --> 0($fp) - # local_or_at_BoolOp_internal_1 = PARAM param_or_at_BoolOp_b2_1 - lw $t0, 0($fp) - sw $t0, -8($fp) - label_ENDIF_4: -# RETURN local_or_at_BoolOp_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_or_at_BoolOp. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 32 -# Deallocate function args -addu $sp, $sp, 8 -jr $ra -# Function END - - -# __Graph__attrib__vertices__init implementation. -# @Params: -__Graph__attrib__vertices__init: - # Allocate stack frame for function __Graph__attrib__vertices__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_attrib__vertices__init_internal_1 --> -8($fp) - # local_attrib__vertices__init_internal_1 = ALLOCATE VList - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, VList - sw $t0, 12($v0) - li $t0, 5 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, VList_start - sw $t0, 4($v0) - # Load type offset - li $t0, 36 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __VList__attrib__car__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -8($fp) - # RETURN local_attrib__vertices__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Graph__attrib__vertices__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Graph__attrib__edges__init implementation. -# @Params: -__Graph__attrib__edges__init: - # Allocate stack frame for function __Graph__attrib__edges__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_attrib__edges__init_internal_1 --> -8($fp) - # local_attrib__edges__init_internal_1 = ALLOCATE EList - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, EList - sw $t0, 12($v0) - li $t0, 5 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, EList_start - sw $t0, 4($v0) - # Load type offset - li $t0, 44 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __EList__attrib__car__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -8($fp) - # RETURN local_attrib__edges__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Graph__attrib__edges__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_add_vertice_at_Graph implementation. -# @Params: -# 0($fp) = param_add_vertice_at_Graph_v_0 -function_add_vertice_at_Graph: - # Allocate stack frame for function function_add_vertice_at_Graph. - subu $sp, $sp, 40 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 40 - # LOCAL local_add_vertice_at_Graph_internal_2 --> -12($fp) - # PARAM param_add_vertice_at_Graph_v_0 --> 0($fp) - # local_add_vertice_at_Graph_internal_2 = PARAM param_add_vertice_at_Graph_v_0 - lw $t0, 0($fp) - sw $t0, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_add_vertice_at_Graph_internal_2 --> -12($fp) - # LOCAL local_add_vertice_at_Graph_internal_3 --> -16($fp) - # local_add_vertice_at_Graph_internal_3 = VCALL local_add_vertice_at_Graph_internal_2 outgoing - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 0($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_add_vertice_at_Graph_internal_0 --> -4($fp) - # LOCAL local_add_vertice_at_Graph_internal_3 --> -16($fp) - # local_add_vertice_at_Graph_internal_0 = local_add_vertice_at_Graph_internal_3 - lw $t0, -16($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_add_vertice_at_Graph_internal_4 = GETATTRIBUTE edges Graph - # LOCAL local_add_vertice_at_Graph_internal_4 --> -20($fp) - lw $t0, 16($s1) - sw $t0, -20($fp) - # ARG local_add_vertice_at_Graph_internal_4 - # LOCAL local_add_vertice_at_Graph_internal_4 --> -20($fp) - lw $t0, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_add_vertice_at_Graph_internal_0 --> -4($fp) - # LOCAL local_add_vertice_at_Graph_internal_1 --> -8($fp) - # local_add_vertice_at_Graph_internal_1 = VCALL local_add_vertice_at_Graph_internal_0 append - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 32($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_add_vertice_at_Graph_internal_1 --> -8($fp) - lw $t0, -8($fp) - sw $t0, 16($s1) - # local_add_vertice_at_Graph_internal_7 = GETATTRIBUTE vertices Graph - # LOCAL local_add_vertice_at_Graph_internal_7 --> -32($fp) - lw $t0, 12($s1) - sw $t0, -32($fp) - # LOCAL local_add_vertice_at_Graph_internal_5 --> -24($fp) - # LOCAL local_add_vertice_at_Graph_internal_7 --> -32($fp) - # local_add_vertice_at_Graph_internal_5 = local_add_vertice_at_Graph_internal_7 - lw $t0, -32($fp) - sw $t0, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_add_vertice_at_Graph_v_0 - # PARAM param_add_vertice_at_Graph_v_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_add_vertice_at_Graph_internal_5 --> -24($fp) - # LOCAL local_add_vertice_at_Graph_internal_6 --> -28($fp) - # local_add_vertice_at_Graph_internal_6 = VCALL local_add_vertice_at_Graph_internal_5 cons - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 60($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_add_vertice_at_Graph_internal_6 --> -28($fp) - lw $t0, -28($fp) - sw $t0, 12($s1) - # RETURN - # Deallocate stack frame for function function_add_vertice_at_Graph. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 40 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_print_E_at_Graph implementation. -# @Params: -function_print_E_at_Graph: - # Allocate stack frame for function function_print_E_at_Graph. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_print_E_at_Graph_internal_2 = GETATTRIBUTE edges Graph - # LOCAL local_print_E_at_Graph_internal_2 --> -12($fp) - lw $t0, 16($s1) - sw $t0, -12($fp) - # LOCAL local_print_E_at_Graph_internal_0 --> -4($fp) - # LOCAL local_print_E_at_Graph_internal_2 --> -12($fp) - # local_print_E_at_Graph_internal_0 = local_print_E_at_Graph_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_E_at_Graph_internal_0 --> -4($fp) - # LOCAL local_print_E_at_Graph_internal_1 --> -8($fp) - # local_print_E_at_Graph_internal_1 = VCALL local_print_E_at_Graph_internal_0 print - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_E_at_Graph_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_print_E_at_Graph. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_print_V_at_Graph implementation. -# @Params: -function_print_V_at_Graph: - # Allocate stack frame for function function_print_V_at_Graph. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_print_V_at_Graph_internal_2 = GETATTRIBUTE vertices Graph - # LOCAL local_print_V_at_Graph_internal_2 --> -12($fp) - lw $t0, 12($s1) - sw $t0, -12($fp) - # LOCAL local_print_V_at_Graph_internal_0 --> -4($fp) - # LOCAL local_print_V_at_Graph_internal_2 --> -12($fp) - # local_print_V_at_Graph_internal_0 = local_print_V_at_Graph_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_V_at_Graph_internal_0 --> -4($fp) - # LOCAL local_print_V_at_Graph_internal_1 --> -8($fp) - # local_print_V_at_Graph_internal_1 = VCALL local_print_V_at_Graph_internal_0 print - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_V_at_Graph_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_print_V_at_Graph. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Parse__attrib__boolop__init implementation. -# @Params: -__Parse__attrib__boolop__init: - # Allocate stack frame for function __Parse__attrib__boolop__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_attrib__boolop__init_internal_1 --> -8($fp) - # local_attrib__boolop__init_internal_1 = ALLOCATE BoolOp - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, BoolOp - sw $t0, 12($v0) - li $t0, 6 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, BoolOp_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -8($fp) - # RETURN local_attrib__boolop__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Parse__attrib__boolop__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Parse__attrib__rest__init implementation. -# @Params: -__Parse__attrib__rest__init: - # Allocate stack frame for function __Parse__attrib__rest__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_attrib__rest__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_0 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -4($fp) - # RETURN local_attrib__rest__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Parse__attrib__rest__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_read_input_at_Parse implementation. -# @Params: -function_read_input_at_Parse: - # Allocate stack frame for function function_read_input_at_Parse. - subu $sp, $sp, 112 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 112 - # LOCAL local_read_input_at_Parse_g_0 --> -4($fp) - # local_read_input_at_Parse_g_0 = 0 - li $t0, 0 - sw $t0, -4($fp) - # LOCAL local_read_input_at_Parse_internal_1 --> -8($fp) - # local_read_input_at_Parse_internal_1 = ALLOCATE Graph - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Graph - sw $t0, 12($v0) - li $t0, 5 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Graph_start - sw $t0, 4($v0) - # Load type offset - li $t0, 24 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Graph__attrib__vertices__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Graph__attrib__edges__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -8($fp) - # LOCAL local_read_input_at_Parse_g_0 --> -4($fp) - # LOCAL local_read_input_at_Parse_internal_1 --> -8($fp) - # local_read_input_at_Parse_g_0 = local_read_input_at_Parse_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_0 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -12($fp) - # LOCAL local_read_input_at_Parse_internal_5 --> -24($fp) - # local_read_input_at_Parse_internal_5 = SELF - sw $s1, -24($fp) - # LOCAL local_read_input_at_Parse_internal_3 --> -16($fp) - # LOCAL local_read_input_at_Parse_internal_5 --> -24($fp) - # local_read_input_at_Parse_internal_3 = local_read_input_at_Parse_internal_5 - lw $t0, -24($fp) - sw $t0, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_read_input_at_Parse_internal_3 --> -16($fp) - # LOCAL local_read_input_at_Parse_internal_4 --> -20($fp) - # local_read_input_at_Parse_internal_4 = VCALL local_read_input_at_Parse_internal_3 in_string - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # LOCAL local_read_input_at_Parse_internal_4 --> -20($fp) - # local_read_input_at_Parse_line_2 = local_read_input_at_Parse_internal_4 - lw $t0, -20($fp) - sw $t0, -12($fp) - label_WHILE_5: - # local_read_input_at_Parse_internal_9 = GETATTRIBUTE boolop Parse - # LOCAL local_read_input_at_Parse_internal_9 --> -40($fp) - lw $t0, 12($s1) - sw $t0, -40($fp) - # LOCAL local_read_input_at_Parse_internal_7 --> -32($fp) - # LOCAL local_read_input_at_Parse_internal_9 --> -40($fp) - # local_read_input_at_Parse_internal_7 = local_read_input_at_Parse_internal_9 - lw $t0, -40($fp) - sw $t0, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_4 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -52($fp) - # IF_ZERO local_read_input_at_Parse_line_2 GOTO label_FALSE_7 - # IF_ZERO local_read_input_at_Parse_line_2 GOTO label_FALSE_7 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_7 - # IF_ZERO local_read_input_at_Parse_internal_12 GOTO label_FALSE_7 - # IF_ZERO local_read_input_at_Parse_internal_12 GOTO label_FALSE_7 - lw $t0, -52($fp) - beq $t0, 0, label_FALSE_7 - # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # Comparing -12($fp) type with String - la $v0, String - lw $a0, -12($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_STRING_10 - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_STRING_10 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_STRING_10 - # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # Comparing -12($fp) type with Bool - la $v0, Bool - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_11 - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_11 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_11 - # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # Comparing -12($fp) type with Int - la $v0, Int - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_11 - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_11 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_11 - # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) - # Load pointers and SUB - lw $a0, -12($fp) - lw $a1, -52($fp) - sub $a0, $a0, $a1 - sw $a0, -48($fp) - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_8 - # GOTO label_FALSE_7 - j label_FALSE_7 - label_COMPARE_BY_VALUE_11: - # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) - lw $a0, -12($fp) - lw $a1, -52($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -48($fp) - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_8 - # GOTO label_FALSE_7 - j label_FALSE_7 - label_COMPARE_STRING_10: - # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, -52($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -48($fp) - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_CONTINUE_12 - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_CONTINUE_12 - lw $t0, -48($fp) - beq $t0, 0, label_CONTINUE_12 - # GOTO label_FALSE_7 - j label_FALSE_7 - label_CONTINUE_12: - # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, -52($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_13: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_14 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_13 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_14: - # Store result - sw $a2, -48($fp) - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_8 - label_FALSE_7: - # LOCAL local_read_input_at_Parse_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -44($fp) - # GOTO label_END_9 -j label_END_9 -label_TRUE_8: - # LOCAL local_read_input_at_Parse_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -44($fp) - label_END_9: -# LOCAL local_read_input_at_Parse_internal_10 --> -44($fp) -# LOCAL local_read_input_at_Parse_internal_10 --> -44($fp) -# Obtain value from -44($fp) -lw $v0, -44($fp) -lw $v0, 12($v0) -sw $v0, -44($fp) -# IF_ZERO local_read_input_at_Parse_internal_10 GOTO label_FALSE_15 -# IF_ZERO local_read_input_at_Parse_internal_10 GOTO label_FALSE_15 -lw $t0, -44($fp) -beq $t0, 0, label_FALSE_15 -# LOCAL local_read_input_at_Parse_internal_13 --> -56($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -56($fp) -# GOTO label_NOT_END_16 -j label_NOT_END_16 -label_FALSE_15: - # LOCAL local_read_input_at_Parse_internal_13 --> -56($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -56($fp) - label_NOT_END_16: - # ARG local_read_input_at_Parse_internal_13 - # LOCAL local_read_input_at_Parse_internal_13 --> -56($fp) - lw $t0, -56($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_5 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -68($fp) - # IF_ZERO local_read_input_at_Parse_line_2 GOTO label_FALSE_17 - # IF_ZERO local_read_input_at_Parse_line_2 GOTO label_FALSE_17 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_17 - # IF_ZERO local_read_input_at_Parse_internal_16 GOTO label_FALSE_17 - # IF_ZERO local_read_input_at_Parse_internal_16 GOTO label_FALSE_17 - lw $t0, -68($fp) - beq $t0, 0, label_FALSE_17 - # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # Comparing -12($fp) type with String - la $v0, String - lw $a0, -12($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_STRING_20 - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_STRING_20 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_STRING_20 - # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # Comparing -12($fp) type with Bool - la $v0, Bool - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_21 - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_21 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_21 - # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # Comparing -12($fp) type with Int - la $v0, Int - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_21 - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_21 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_21 - # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) - # Load pointers and SUB - lw $a0, -12($fp) - lw $a1, -68($fp) - sub $a0, $a0, $a1 - sw $a0, -64($fp) - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_18 - # GOTO label_FALSE_17 - j label_FALSE_17 - label_COMPARE_BY_VALUE_21: - # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) - lw $a0, -12($fp) - lw $a1, -68($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -64($fp) - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_18 - # GOTO label_FALSE_17 - j label_FALSE_17 - label_COMPARE_STRING_20: - # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, -68($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -64($fp) - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_CONTINUE_22 - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_CONTINUE_22 - lw $t0, -64($fp) - beq $t0, 0, label_CONTINUE_22 - # GOTO label_FALSE_17 - j label_FALSE_17 - label_CONTINUE_22: - # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, -68($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_23: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_24 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_23 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_24: - # Store result - sw $a2, -64($fp) - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_18 - label_FALSE_17: - # LOCAL local_read_input_at_Parse_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -60($fp) - # GOTO label_END_19 -j label_END_19 -label_TRUE_18: - # LOCAL local_read_input_at_Parse_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -60($fp) - label_END_19: -# LOCAL local_read_input_at_Parse_internal_14 --> -60($fp) -# LOCAL local_read_input_at_Parse_internal_14 --> -60($fp) -# Obtain value from -60($fp) -lw $v0, -60($fp) -lw $v0, 12($v0) -sw $v0, -60($fp) -# IF_ZERO local_read_input_at_Parse_internal_14 GOTO label_FALSE_25 -# IF_ZERO local_read_input_at_Parse_internal_14 GOTO label_FALSE_25 -lw $t0, -60($fp) -beq $t0, 0, label_FALSE_25 -# LOCAL local_read_input_at_Parse_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -72($fp) -# GOTO label_NOT_END_26 -j label_NOT_END_26 -label_FALSE_25: - # LOCAL local_read_input_at_Parse_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -72($fp) - label_NOT_END_26: - # ARG local_read_input_at_Parse_internal_17 - # LOCAL local_read_input_at_Parse_internal_17 --> -72($fp) - lw $t0, -72($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_read_input_at_Parse_internal_7 --> -32($fp) - # LOCAL local_read_input_at_Parse_internal_8 --> -36($fp) - # local_read_input_at_Parse_internal_8 = VCALL local_read_input_at_Parse_internal_7 and - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 112($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_read_input_at_Parse_internal_6 --> -28($fp) - # LOCAL local_read_input_at_Parse_internal_8 --> -36($fp) - # Obtain value from -36($fp) - lw $v0, -36($fp) - lw $v0, 12($v0) - sw $v0, -28($fp) - # IF_ZERO local_read_input_at_Parse_internal_6 GOTO label_WHILE_END_6 - # IF_ZERO local_read_input_at_Parse_internal_6 GOTO label_WHILE_END_6 - lw $t0, -28($fp) - beq $t0, 0, label_WHILE_END_6 - # LOCAL local_read_input_at_Parse_internal_18 --> -76($fp) - # LOCAL local_read_input_at_Parse_g_0 --> -4($fp) - # local_read_input_at_Parse_internal_18 = local_read_input_at_Parse_g_0 - lw $t0, -4($fp) - sw $t0, -76($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_read_input_at_Parse_internal_22 --> -92($fp) - # local_read_input_at_Parse_internal_22 = SELF - sw $s1, -92($fp) - # LOCAL local_read_input_at_Parse_internal_20 --> -84($fp) - # LOCAL local_read_input_at_Parse_internal_22 --> -92($fp) - # local_read_input_at_Parse_internal_20 = local_read_input_at_Parse_internal_22 - lw $t0, -92($fp) - sw $t0, -84($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_read_input_at_Parse_line_2 - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - lw $t0, -12($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_read_input_at_Parse_internal_20 --> -84($fp) - # LOCAL local_read_input_at_Parse_internal_21 --> -88($fp) - # local_read_input_at_Parse_internal_21 = VCALL local_read_input_at_Parse_internal_20 parse_line - # Save new self pointer in $s1 - lw $s1, -84($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 56($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -88($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_read_input_at_Parse_internal_21 - # LOCAL local_read_input_at_Parse_internal_21 --> -88($fp) - lw $t0, -88($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_read_input_at_Parse_internal_18 --> -76($fp) - # LOCAL local_read_input_at_Parse_internal_19 --> -80($fp) - # local_read_input_at_Parse_internal_19 = VCALL local_read_input_at_Parse_internal_18 add_vertice - # Save new self pointer in $s1 - lw $s1, -76($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 88($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -80($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_read_input_at_Parse_internal_25 --> -104($fp) - # local_read_input_at_Parse_internal_25 = SELF - sw $s1, -104($fp) - # LOCAL local_read_input_at_Parse_internal_23 --> -96($fp) - # LOCAL local_read_input_at_Parse_internal_25 --> -104($fp) - # local_read_input_at_Parse_internal_23 = local_read_input_at_Parse_internal_25 - lw $t0, -104($fp) - sw $t0, -96($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_read_input_at_Parse_internal_23 --> -96($fp) - # LOCAL local_read_input_at_Parse_internal_24 --> -100($fp) - # local_read_input_at_Parse_internal_24 = VCALL local_read_input_at_Parse_internal_23 in_string - # Save new self pointer in $s1 - lw $s1, -96($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -100($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # LOCAL local_read_input_at_Parse_internal_24 --> -100($fp) - # local_read_input_at_Parse_line_2 = local_read_input_at_Parse_internal_24 - lw $t0, -100($fp) - sw $t0, -12($fp) - # GOTO label_WHILE_5 - j label_WHILE_5 - label_WHILE_END_6: - # RETURN local_read_input_at_Parse_g_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_read_input_at_Parse. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 112 - jr $ra - # Function END - - -# function_parse_line_at_Parse implementation. -# @Params: -# 0($fp) = param_parse_line_at_Parse_s_0 -function_parse_line_at_Parse: - # Allocate stack frame for function function_parse_line_at_Parse. - subu $sp, $sp, 136 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 136 - # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) - # local_parse_line_at_Parse_v_0 = 0 - li $t0, 0 - sw $t0, -4($fp) - # LOCAL local_parse_line_at_Parse_internal_3 --> -16($fp) - # local_parse_line_at_Parse_internal_3 = ALLOCATE Vertice - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Vertice - sw $t0, 12($v0) - li $t0, 7 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Vertice_start - sw $t0, 4($v0) - # Load type offset - li $t0, 56 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Vertice__attrib__num__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Vertice__attrib__out__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -16($fp) - # LOCAL local_parse_line_at_Parse_internal_1 --> -8($fp) - # LOCAL local_parse_line_at_Parse_internal_3 --> -16($fp) - # local_parse_line_at_Parse_internal_1 = local_parse_line_at_Parse_internal_3 - lw $t0, -16($fp) - sw $t0, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_6 --> -28($fp) - # local_parse_line_at_Parse_internal_6 = SELF - sw $s1, -28($fp) - # LOCAL local_parse_line_at_Parse_internal_4 --> -20($fp) - # LOCAL local_parse_line_at_Parse_internal_6 --> -28($fp) - # local_parse_line_at_Parse_internal_4 = local_parse_line_at_Parse_internal_6 - lw $t0, -28($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_parse_line_at_Parse_s_0 - # PARAM param_parse_line_at_Parse_s_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_4 --> -20($fp) - # LOCAL local_parse_line_at_Parse_internal_5 --> -24($fp) - # local_parse_line_at_Parse_internal_5 = VCALL local_parse_line_at_Parse_internal_4 a2i - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 52($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_parse_line_at_Parse_internal_5 - # LOCAL local_parse_line_at_Parse_internal_5 --> -24($fp) - lw $t0, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_1 --> -8($fp) - # LOCAL local_parse_line_at_Parse_internal_2 --> -12($fp) - # local_parse_line_at_Parse_internal_2 = VCALL local_parse_line_at_Parse_internal_1 init - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 28($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) - # LOCAL local_parse_line_at_Parse_internal_2 --> -12($fp) - # local_parse_line_at_Parse_v_0 = local_parse_line_at_Parse_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - label_WHILE_27: - # local_parse_line_at_Parse_internal_12 = GETATTRIBUTE rest Parse - # LOCAL local_parse_line_at_Parse_internal_12 --> -52($fp) - lw $t0, 16($s1) - sw $t0, -52($fp) - # LOCAL local_parse_line_at_Parse_internal_10 --> -44($fp) - # LOCAL local_parse_line_at_Parse_internal_12 --> -52($fp) - # local_parse_line_at_Parse_internal_10 = local_parse_line_at_Parse_internal_12 - lw $t0, -52($fp) - sw $t0, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_10 --> -44($fp) - # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) - # local_parse_line_at_Parse_internal_11 = VCALL local_parse_line_at_Parse_internal_10 length - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 44($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -56($fp) - # IF_ZERO local_parse_line_at_Parse_internal_11 GOTO label_FALSE_29 - # IF_ZERO local_parse_line_at_Parse_internal_11 GOTO label_FALSE_29 - lw $t0, -48($fp) - beq $t0, 0, label_FALSE_29 - # IF_ZERO local_parse_line_at_Parse_internal_13 GOTO label_FALSE_29 - # IF_ZERO local_parse_line_at_Parse_internal_13 GOTO label_FALSE_29 - lw $t0, -56($fp) - beq $t0, 0, label_FALSE_29 - # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) - # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) - # Comparing -48($fp) type with String - la $v0, String - lw $a0, -48($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_STRING_32 - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_STRING_32 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_STRING_32 - # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) - # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) - # Comparing -48($fp) type with Bool - la $v0, Bool - lw $a0, -48($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_33 - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_33 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_33 - # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) - # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) - # Comparing -48($fp) type with Int - la $v0, Int - lw $a0, -48($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_33 - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_33 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_33 - # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) - # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) - # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) - # Load pointers and SUB - lw $a0, -48($fp) - lw $a1, -56($fp) - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_30 - # GOTO label_FALSE_29 - j label_FALSE_29 - label_COMPARE_BY_VALUE_33: - # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) - # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) - # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) - lw $a0, -48($fp) - lw $a1, -56($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_30 - # GOTO label_FALSE_29 - j label_FALSE_29 - label_COMPARE_STRING_32: - # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) - # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) - # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) - # Load strings for comparison - lw $v0, -48($fp) - lw $v1, -56($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -40($fp) - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_CONTINUE_34 - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_CONTINUE_34 - lw $t0, -40($fp) - beq $t0, 0, label_CONTINUE_34 - # GOTO label_FALSE_29 - j label_FALSE_29 - label_CONTINUE_34: - # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) - # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) - # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -48($fp) - lw $v1, -56($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_35: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_36 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_35 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_36: - # Store result - sw $a2, -40($fp) - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_30 - label_FALSE_29: - # LOCAL local_parse_line_at_Parse_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -36($fp) - # GOTO label_END_31 -j label_END_31 -label_TRUE_30: - # LOCAL local_parse_line_at_Parse_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -36($fp) - label_END_31: -# LOCAL local_parse_line_at_Parse_internal_8 --> -36($fp) -# LOCAL local_parse_line_at_Parse_internal_8 --> -36($fp) -# Obtain value from -36($fp) -lw $v0, -36($fp) -lw $v0, 12($v0) -sw $v0, -36($fp) -# IF_ZERO local_parse_line_at_Parse_internal_8 GOTO label_FALSE_37 -# IF_ZERO local_parse_line_at_Parse_internal_8 GOTO label_FALSE_37 -lw $t0, -36($fp) -beq $t0, 0, label_FALSE_37 -# LOCAL local_parse_line_at_Parse_internal_14 --> -60($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -60($fp) -# GOTO label_NOT_END_38 -j label_NOT_END_38 -label_FALSE_37: - # LOCAL local_parse_line_at_Parse_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -60($fp) - label_NOT_END_38: - # LOCAL local_parse_line_at_Parse_internal_7 --> -32($fp) - # LOCAL local_parse_line_at_Parse_internal_14 --> -60($fp) - # Obtain value from -60($fp) - lw $v0, -60($fp) - lw $v0, 12($v0) - sw $v0, -32($fp) - # IF_ZERO local_parse_line_at_Parse_internal_7 GOTO label_WHILE_END_28 - # IF_ZERO local_parse_line_at_Parse_internal_7 GOTO label_WHILE_END_28 - lw $t0, -32($fp) - beq $t0, 0, label_WHILE_END_28 - # LOCAL local_parse_line_at_Parse_succ_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -64($fp) - # LOCAL local_parse_line_at_Parse_internal_18 --> -76($fp) - # local_parse_line_at_Parse_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_parse_line_at_Parse_internal_16 --> -68($fp) - # LOCAL local_parse_line_at_Parse_internal_18 --> -76($fp) - # local_parse_line_at_Parse_internal_16 = local_parse_line_at_Parse_internal_18 - lw $t0, -76($fp) - sw $t0, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_parse_line_at_Parse_internal_19 = GETATTRIBUTE rest Parse - # LOCAL local_parse_line_at_Parse_internal_19 --> -80($fp) - lw $t0, 16($s1) - sw $t0, -80($fp) - # ARG local_parse_line_at_Parse_internal_19 - # LOCAL local_parse_line_at_Parse_internal_19 --> -80($fp) - lw $t0, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_16 --> -68($fp) - # LOCAL local_parse_line_at_Parse_internal_17 --> -72($fp) - # local_parse_line_at_Parse_internal_17 = VCALL local_parse_line_at_Parse_internal_16 a2i - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 52($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_parse_line_at_Parse_succ_15 --> -64($fp) - # LOCAL local_parse_line_at_Parse_internal_17 --> -72($fp) - # local_parse_line_at_Parse_succ_15 = local_parse_line_at_Parse_internal_17 - lw $t0, -72($fp) - sw $t0, -64($fp) - # LOCAL local_parse_line_at_Parse_weight_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -84($fp) - # LOCAL local_parse_line_at_Parse_internal_23 --> -96($fp) - # local_parse_line_at_Parse_internal_23 = SELF - sw $s1, -96($fp) - # LOCAL local_parse_line_at_Parse_internal_21 --> -88($fp) - # LOCAL local_parse_line_at_Parse_internal_23 --> -96($fp) - # local_parse_line_at_Parse_internal_21 = local_parse_line_at_Parse_internal_23 - lw $t0, -96($fp) - sw $t0, -88($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_parse_line_at_Parse_internal_24 = GETATTRIBUTE rest Parse - # LOCAL local_parse_line_at_Parse_internal_24 --> -100($fp) - lw $t0, 16($s1) - sw $t0, -100($fp) - # ARG local_parse_line_at_Parse_internal_24 - # LOCAL local_parse_line_at_Parse_internal_24 --> -100($fp) - lw $t0, -100($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_21 --> -88($fp) - # LOCAL local_parse_line_at_Parse_internal_22 --> -92($fp) - # local_parse_line_at_Parse_internal_22 = VCALL local_parse_line_at_Parse_internal_21 a2i - # Save new self pointer in $s1 - lw $s1, -88($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 52($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -92($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_parse_line_at_Parse_weight_20 --> -84($fp) - # LOCAL local_parse_line_at_Parse_internal_22 --> -92($fp) - # local_parse_line_at_Parse_weight_20 = local_parse_line_at_Parse_internal_22 - lw $t0, -92($fp) - sw $t0, -84($fp) - # LOCAL local_parse_line_at_Parse_internal_25 --> -104($fp) - # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) - # local_parse_line_at_Parse_internal_25 = local_parse_line_at_Parse_v_0 - lw $t0, -4($fp) - sw $t0, -104($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_29 --> -120($fp) - # local_parse_line_at_Parse_internal_29 = ALLOCATE Edge - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Edge - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 24 bytes of memory - li $a0, 24 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Edge_start - sw $t0, 4($v0) - # Load type offset - li $t0, 52 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Edge__attrib__from__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Edge__attrib__to__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Edge__attrib__weight__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -120($fp) - # LOCAL local_parse_line_at_Parse_internal_27 --> -112($fp) - # LOCAL local_parse_line_at_Parse_internal_29 --> -120($fp) - # local_parse_line_at_Parse_internal_27 = local_parse_line_at_Parse_internal_29 - lw $t0, -120($fp) - sw $t0, -112($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_30 --> -124($fp) - # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) - # local_parse_line_at_Parse_internal_30 = local_parse_line_at_Parse_v_0 - lw $t0, -4($fp) - sw $t0, -124($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_30 --> -124($fp) - # LOCAL local_parse_line_at_Parse_internal_31 --> -128($fp) - # local_parse_line_at_Parse_internal_31 = VCALL local_parse_line_at_Parse_internal_30 number - # Save new self pointer in $s1 - lw $s1, -124($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 64($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -128($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_parse_line_at_Parse_internal_31 - # LOCAL local_parse_line_at_Parse_internal_31 --> -128($fp) - lw $t0, -128($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # ARG local_parse_line_at_Parse_succ_15 - # LOCAL local_parse_line_at_Parse_succ_15 --> -64($fp) - lw $t0, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # ARG local_parse_line_at_Parse_weight_20 - # LOCAL local_parse_line_at_Parse_weight_20 --> -84($fp) - lw $t0, -84($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_27 --> -112($fp) - # LOCAL local_parse_line_at_Parse_internal_28 --> -116($fp) - # local_parse_line_at_Parse_internal_28 = VCALL local_parse_line_at_Parse_internal_27 init - # Save new self pointer in $s1 - lw $s1, -112($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 28($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -116($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_parse_line_at_Parse_internal_28 - # LOCAL local_parse_line_at_Parse_internal_28 --> -116($fp) - lw $t0, -116($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_25 --> -104($fp) - # LOCAL local_parse_line_at_Parse_internal_26 --> -108($fp) - # local_parse_line_at_Parse_internal_26 = VCALL local_parse_line_at_Parse_internal_25 add_out - # Save new self pointer in $s1 - lw $s1, -104($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 84($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -108($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # GOTO label_WHILE_27 - j label_WHILE_27 - label_WHILE_END_28: - # RETURN local_parse_line_at_Parse_v_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_parse_line_at_Parse. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 136 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_c2i_at_Parse implementation. -# @Params: -# 0($fp) = param_c2i_at_Parse_char_0 -function_c2i_at_Parse: - # Allocate stack frame for function function_c2i_at_Parse. - subu $sp, $sp, 264 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 264 - # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_6 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -20($fp) - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_41 - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_41 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_41 - # IF_ZERO local_c2i_at_Parse_internal_4 GOTO label_FALSE_41 - # IF_ZERO local_c2i_at_Parse_internal_4 GOTO label_FALSE_41 - lw $t0, -20($fp) - beq $t0, 0, label_FALSE_41 - # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_STRING_44 - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_STRING_44 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_44 - # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_45 - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_45 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_45 - # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_45 - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_45 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_45 - # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -20($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_42 - # GOTO label_FALSE_41 - j label_FALSE_41 - label_COMPARE_BY_VALUE_45: - # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) - lw $a0, 0($fp) - lw $a1, -20($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_42 - # GOTO label_FALSE_41 - j label_FALSE_41 - label_COMPARE_STRING_44: - # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_CONTINUE_46 - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_CONTINUE_46 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_46 - # GOTO label_FALSE_41 - j label_FALSE_41 - label_CONTINUE_46: - # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_47: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_48 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_47 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_48: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_42 - label_FALSE_41: - # LOCAL local_c2i_at_Parse_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_43 -j label_END_43 -label_TRUE_42: - # LOCAL local_c2i_at_Parse_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_43: -# LOCAL local_c2i_at_Parse_internal_0 --> -4($fp) -# LOCAL local_c2i_at_Parse_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_c2i_at_Parse_internal_0 GOTO label_FALSEIF_39 -# IF_ZERO local_c2i_at_Parse_internal_0 GOTO label_FALSEIF_39 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_39 -# LOCAL local_c2i_at_Parse_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -24($fp) -# LOCAL local_c2i_at_Parse_internal_1 --> -8($fp) -# LOCAL local_c2i_at_Parse_internal_5 --> -24($fp) -# local_c2i_at_Parse_internal_1 = local_c2i_at_Parse_internal_5 -lw $t0, -24($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_40 -j label_ENDIF_40 -label_FALSEIF_39: - # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_7 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -44($fp) - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_51 - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_51 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_51 - # IF_ZERO local_c2i_at_Parse_internal_10 GOTO label_FALSE_51 - # IF_ZERO local_c2i_at_Parse_internal_10 GOTO label_FALSE_51 - lw $t0, -44($fp) - beq $t0, 0, label_FALSE_51 - # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_STRING_54 - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_STRING_54 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_STRING_54 - # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_55 - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_55 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_55 - # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_55 - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_55 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_55 - # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -44($fp) - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_52 - # GOTO label_FALSE_51 - j label_FALSE_51 - label_COMPARE_BY_VALUE_55: - # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) - lw $a0, 0($fp) - lw $a1, -44($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_52 - # GOTO label_FALSE_51 - j label_FALSE_51 - label_COMPARE_STRING_54: - # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -44($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -40($fp) - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_CONTINUE_56 - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_CONTINUE_56 - lw $t0, -40($fp) - beq $t0, 0, label_CONTINUE_56 - # GOTO label_FALSE_51 - j label_FALSE_51 - label_CONTINUE_56: - # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -44($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_57: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_58 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_57 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_58: - # Store result - sw $a2, -40($fp) - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_52 - label_FALSE_51: - # LOCAL local_c2i_at_Parse_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -36($fp) - # GOTO label_END_53 -j label_END_53 -label_TRUE_52: - # LOCAL local_c2i_at_Parse_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -36($fp) - label_END_53: -# LOCAL local_c2i_at_Parse_internal_6 --> -28($fp) -# LOCAL local_c2i_at_Parse_internal_8 --> -36($fp) -# Obtain value from -36($fp) -lw $v0, -36($fp) -lw $v0, 12($v0) -sw $v0, -28($fp) -# IF_ZERO local_c2i_at_Parse_internal_6 GOTO label_FALSEIF_49 -# IF_ZERO local_c2i_at_Parse_internal_6 GOTO label_FALSEIF_49 -lw $t0, -28($fp) -beq $t0, 0, label_FALSEIF_49 -# LOCAL local_c2i_at_Parse_internal_11 --> -48($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -48($fp) -# LOCAL local_c2i_at_Parse_internal_7 --> -32($fp) -# LOCAL local_c2i_at_Parse_internal_11 --> -48($fp) -# local_c2i_at_Parse_internal_7 = local_c2i_at_Parse_internal_11 -lw $t0, -48($fp) -sw $t0, -32($fp) -# GOTO label_ENDIF_50 -j label_ENDIF_50 -label_FALSEIF_49: - # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_8 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -68($fp) - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_61 - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_61 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_61 - # IF_ZERO local_c2i_at_Parse_internal_16 GOTO label_FALSE_61 - # IF_ZERO local_c2i_at_Parse_internal_16 GOTO label_FALSE_61 - lw $t0, -68($fp) - beq $t0, 0, label_FALSE_61 - # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_STRING_64 - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_STRING_64 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_STRING_64 - # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_65 - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_65 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_65 - # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_65 - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_65 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_65 - # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -68($fp) - sub $a0, $a0, $a1 - sw $a0, -64($fp) - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_62 - # GOTO label_FALSE_61 - j label_FALSE_61 - label_COMPARE_BY_VALUE_65: - # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) - lw $a0, 0($fp) - lw $a1, -68($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -64($fp) - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_62 - # GOTO label_FALSE_61 - j label_FALSE_61 - label_COMPARE_STRING_64: - # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -68($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -64($fp) - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_CONTINUE_66 - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_CONTINUE_66 - lw $t0, -64($fp) - beq $t0, 0, label_CONTINUE_66 - # GOTO label_FALSE_61 - j label_FALSE_61 - label_CONTINUE_66: - # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -68($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_67: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_68 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_67 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_68: - # Store result - sw $a2, -64($fp) - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_62 - label_FALSE_61: - # LOCAL local_c2i_at_Parse_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -60($fp) - # GOTO label_END_63 -j label_END_63 -label_TRUE_62: - # LOCAL local_c2i_at_Parse_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -60($fp) - label_END_63: -# LOCAL local_c2i_at_Parse_internal_12 --> -52($fp) -# LOCAL local_c2i_at_Parse_internal_14 --> -60($fp) -# Obtain value from -60($fp) -lw $v0, -60($fp) -lw $v0, 12($v0) -sw $v0, -52($fp) -# IF_ZERO local_c2i_at_Parse_internal_12 GOTO label_FALSEIF_59 -# IF_ZERO local_c2i_at_Parse_internal_12 GOTO label_FALSEIF_59 -lw $t0, -52($fp) -beq $t0, 0, label_FALSEIF_59 -# LOCAL local_c2i_at_Parse_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 2 -sw $t0, 12($v0) -sw $v0, -72($fp) -# LOCAL local_c2i_at_Parse_internal_13 --> -56($fp) -# LOCAL local_c2i_at_Parse_internal_17 --> -72($fp) -# local_c2i_at_Parse_internal_13 = local_c2i_at_Parse_internal_17 -lw $t0, -72($fp) -sw $t0, -56($fp) -# GOTO label_ENDIF_60 -j label_ENDIF_60 -label_FALSEIF_59: - # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_9 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -92($fp) - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_71 - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_71 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_71 - # IF_ZERO local_c2i_at_Parse_internal_22 GOTO label_FALSE_71 - # IF_ZERO local_c2i_at_Parse_internal_22 GOTO label_FALSE_71 - lw $t0, -92($fp) - beq $t0, 0, label_FALSE_71 - # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_STRING_74 - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_STRING_74 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_STRING_74 - # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_BY_VALUE_75 - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_BY_VALUE_75 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_75 - # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_BY_VALUE_75 - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_BY_VALUE_75 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_75 - # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -92($fp) - sub $a0, $a0, $a1 - sw $a0, -88($fp) - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_72 - # GOTO label_FALSE_71 - j label_FALSE_71 - label_COMPARE_BY_VALUE_75: - # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) - lw $a0, 0($fp) - lw $a1, -92($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -88($fp) - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_72 - # GOTO label_FALSE_71 - j label_FALSE_71 - label_COMPARE_STRING_74: - # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -92($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -88($fp) - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_CONTINUE_76 - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_CONTINUE_76 - lw $t0, -88($fp) - beq $t0, 0, label_CONTINUE_76 - # GOTO label_FALSE_71 - j label_FALSE_71 - label_CONTINUE_76: - # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -92($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_77: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_78 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_77 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_78: - # Store result - sw $a2, -88($fp) - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_72 - label_FALSE_71: - # LOCAL local_c2i_at_Parse_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -84($fp) - # GOTO label_END_73 -j label_END_73 -label_TRUE_72: - # LOCAL local_c2i_at_Parse_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -84($fp) - label_END_73: -# LOCAL local_c2i_at_Parse_internal_18 --> -76($fp) -# LOCAL local_c2i_at_Parse_internal_20 --> -84($fp) -# Obtain value from -84($fp) -lw $v0, -84($fp) -lw $v0, 12($v0) -sw $v0, -76($fp) -# IF_ZERO local_c2i_at_Parse_internal_18 GOTO label_FALSEIF_69 -# IF_ZERO local_c2i_at_Parse_internal_18 GOTO label_FALSEIF_69 -lw $t0, -76($fp) -beq $t0, 0, label_FALSEIF_69 -# LOCAL local_c2i_at_Parse_internal_23 --> -96($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 3 -sw $t0, 12($v0) -sw $v0, -96($fp) -# LOCAL local_c2i_at_Parse_internal_19 --> -80($fp) -# LOCAL local_c2i_at_Parse_internal_23 --> -96($fp) -# local_c2i_at_Parse_internal_19 = local_c2i_at_Parse_internal_23 -lw $t0, -96($fp) -sw $t0, -80($fp) -# GOTO label_ENDIF_70 -j label_ENDIF_70 -label_FALSEIF_69: - # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_10 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -116($fp) - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_81 - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_81 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_81 - # IF_ZERO local_c2i_at_Parse_internal_28 GOTO label_FALSE_81 - # IF_ZERO local_c2i_at_Parse_internal_28 GOTO label_FALSE_81 - lw $t0, -116($fp) - beq $t0, 0, label_FALSE_81 - # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -112($fp) - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_STRING_84 - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_STRING_84 - lw $t0, -112($fp) - beq $t0, 0, label_COMPARE_STRING_84 - # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -112($fp) - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_BY_VALUE_85 - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_BY_VALUE_85 - lw $t0, -112($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_85 - # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -112($fp) - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_BY_VALUE_85 - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_BY_VALUE_85 - lw $t0, -112($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_85 - # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -116($fp) - sub $a0, $a0, $a1 - sw $a0, -112($fp) - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 - lw $t0, -112($fp) - beq $t0, 0, label_TRUE_82 - # GOTO label_FALSE_81 - j label_FALSE_81 - label_COMPARE_BY_VALUE_85: - # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) - lw $a0, 0($fp) - lw $a1, -116($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -112($fp) - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 - lw $t0, -112($fp) - beq $t0, 0, label_TRUE_82 - # GOTO label_FALSE_81 - j label_FALSE_81 - label_COMPARE_STRING_84: - # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -116($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -112($fp) - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_CONTINUE_86 - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_CONTINUE_86 - lw $t0, -112($fp) - beq $t0, 0, label_CONTINUE_86 - # GOTO label_FALSE_81 - j label_FALSE_81 - label_CONTINUE_86: - # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -116($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_87: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_88 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_87 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_88: - # Store result - sw $a2, -112($fp) - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 - lw $t0, -112($fp) - beq $t0, 0, label_TRUE_82 - label_FALSE_81: - # LOCAL local_c2i_at_Parse_internal_26 --> -108($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -108($fp) - # GOTO label_END_83 -j label_END_83 -label_TRUE_82: - # LOCAL local_c2i_at_Parse_internal_26 --> -108($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -108($fp) - label_END_83: -# LOCAL local_c2i_at_Parse_internal_24 --> -100($fp) -# LOCAL local_c2i_at_Parse_internal_26 --> -108($fp) -# Obtain value from -108($fp) -lw $v0, -108($fp) -lw $v0, 12($v0) -sw $v0, -100($fp) -# IF_ZERO local_c2i_at_Parse_internal_24 GOTO label_FALSEIF_79 -# IF_ZERO local_c2i_at_Parse_internal_24 GOTO label_FALSEIF_79 -lw $t0, -100($fp) -beq $t0, 0, label_FALSEIF_79 -# LOCAL local_c2i_at_Parse_internal_29 --> -120($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 4 -sw $t0, 12($v0) -sw $v0, -120($fp) -# LOCAL local_c2i_at_Parse_internal_25 --> -104($fp) -# LOCAL local_c2i_at_Parse_internal_29 --> -120($fp) -# local_c2i_at_Parse_internal_25 = local_c2i_at_Parse_internal_29 -lw $t0, -120($fp) -sw $t0, -104($fp) -# GOTO label_ENDIF_80 -j label_ENDIF_80 -label_FALSEIF_79: - # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_11 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -140($fp) - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_91 - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_91 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_91 - # IF_ZERO local_c2i_at_Parse_internal_34 GOTO label_FALSE_91 - # IF_ZERO local_c2i_at_Parse_internal_34 GOTO label_FALSE_91 - lw $t0, -140($fp) - beq $t0, 0, label_FALSE_91 - # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -136($fp) - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_STRING_94 - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_STRING_94 - lw $t0, -136($fp) - beq $t0, 0, label_COMPARE_STRING_94 - # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -136($fp) - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_BY_VALUE_95 - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_BY_VALUE_95 - lw $t0, -136($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_95 - # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -136($fp) - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_BY_VALUE_95 - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_BY_VALUE_95 - lw $t0, -136($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_95 - # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -140($fp) - sub $a0, $a0, $a1 - sw $a0, -136($fp) - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 - lw $t0, -136($fp) - beq $t0, 0, label_TRUE_92 - # GOTO label_FALSE_91 - j label_FALSE_91 - label_COMPARE_BY_VALUE_95: - # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) - lw $a0, 0($fp) - lw $a1, -140($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -136($fp) - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 - lw $t0, -136($fp) - beq $t0, 0, label_TRUE_92 - # GOTO label_FALSE_91 - j label_FALSE_91 - label_COMPARE_STRING_94: - # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -140($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -136($fp) - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_CONTINUE_96 - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_CONTINUE_96 - lw $t0, -136($fp) - beq $t0, 0, label_CONTINUE_96 - # GOTO label_FALSE_91 - j label_FALSE_91 - label_CONTINUE_96: - # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -140($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_97: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_98 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_97 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_98: - # Store result - sw $a2, -136($fp) - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 - lw $t0, -136($fp) - beq $t0, 0, label_TRUE_92 - label_FALSE_91: - # LOCAL local_c2i_at_Parse_internal_32 --> -132($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -132($fp) - # GOTO label_END_93 -j label_END_93 -label_TRUE_92: - # LOCAL local_c2i_at_Parse_internal_32 --> -132($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -132($fp) - label_END_93: -# LOCAL local_c2i_at_Parse_internal_30 --> -124($fp) -# LOCAL local_c2i_at_Parse_internal_32 --> -132($fp) -# Obtain value from -132($fp) -lw $v0, -132($fp) -lw $v0, 12($v0) -sw $v0, -124($fp) -# IF_ZERO local_c2i_at_Parse_internal_30 GOTO label_FALSEIF_89 -# IF_ZERO local_c2i_at_Parse_internal_30 GOTO label_FALSEIF_89 -lw $t0, -124($fp) -beq $t0, 0, label_FALSEIF_89 -# LOCAL local_c2i_at_Parse_internal_35 --> -144($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 5 -sw $t0, 12($v0) -sw $v0, -144($fp) -# LOCAL local_c2i_at_Parse_internal_31 --> -128($fp) -# LOCAL local_c2i_at_Parse_internal_35 --> -144($fp) -# local_c2i_at_Parse_internal_31 = local_c2i_at_Parse_internal_35 -lw $t0, -144($fp) -sw $t0, -128($fp) -# GOTO label_ENDIF_90 -j label_ENDIF_90 -label_FALSEIF_89: - # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_12 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -164($fp) - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_101 - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_101 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_101 - # IF_ZERO local_c2i_at_Parse_internal_40 GOTO label_FALSE_101 - # IF_ZERO local_c2i_at_Parse_internal_40 GOTO label_FALSE_101 - lw $t0, -164($fp) - beq $t0, 0, label_FALSE_101 - # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -160($fp) - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_STRING_104 - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_STRING_104 - lw $t0, -160($fp) - beq $t0, 0, label_COMPARE_STRING_104 - # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -160($fp) - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_BY_VALUE_105 - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_BY_VALUE_105 - lw $t0, -160($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_105 - # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -160($fp) - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_BY_VALUE_105 - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_BY_VALUE_105 - lw $t0, -160($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_105 - # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -164($fp) - sub $a0, $a0, $a1 - sw $a0, -160($fp) - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 - lw $t0, -160($fp) - beq $t0, 0, label_TRUE_102 - # GOTO label_FALSE_101 - j label_FALSE_101 - label_COMPARE_BY_VALUE_105: - # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) - lw $a0, 0($fp) - lw $a1, -164($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -160($fp) - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 - lw $t0, -160($fp) - beq $t0, 0, label_TRUE_102 - # GOTO label_FALSE_101 - j label_FALSE_101 - label_COMPARE_STRING_104: - # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -164($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -160($fp) - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_CONTINUE_106 - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_CONTINUE_106 - lw $t0, -160($fp) - beq $t0, 0, label_CONTINUE_106 - # GOTO label_FALSE_101 - j label_FALSE_101 - label_CONTINUE_106: - # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -164($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_107: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_108 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_107 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_108: - # Store result - sw $a2, -160($fp) - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 - lw $t0, -160($fp) - beq $t0, 0, label_TRUE_102 - label_FALSE_101: - # LOCAL local_c2i_at_Parse_internal_38 --> -156($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -156($fp) - # GOTO label_END_103 -j label_END_103 -label_TRUE_102: - # LOCAL local_c2i_at_Parse_internal_38 --> -156($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -156($fp) - label_END_103: -# LOCAL local_c2i_at_Parse_internal_36 --> -148($fp) -# LOCAL local_c2i_at_Parse_internal_38 --> -156($fp) -# Obtain value from -156($fp) -lw $v0, -156($fp) -lw $v0, 12($v0) -sw $v0, -148($fp) -# IF_ZERO local_c2i_at_Parse_internal_36 GOTO label_FALSEIF_99 -# IF_ZERO local_c2i_at_Parse_internal_36 GOTO label_FALSEIF_99 -lw $t0, -148($fp) -beq $t0, 0, label_FALSEIF_99 -# LOCAL local_c2i_at_Parse_internal_41 --> -168($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 6 -sw $t0, 12($v0) -sw $v0, -168($fp) -# LOCAL local_c2i_at_Parse_internal_37 --> -152($fp) -# LOCAL local_c2i_at_Parse_internal_41 --> -168($fp) -# local_c2i_at_Parse_internal_37 = local_c2i_at_Parse_internal_41 -lw $t0, -168($fp) -sw $t0, -152($fp) -# GOTO label_ENDIF_100 -j label_ENDIF_100 -label_FALSEIF_99: - # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_13 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -188($fp) - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_111 - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_111 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_111 - # IF_ZERO local_c2i_at_Parse_internal_46 GOTO label_FALSE_111 - # IF_ZERO local_c2i_at_Parse_internal_46 GOTO label_FALSE_111 - lw $t0, -188($fp) - beq $t0, 0, label_FALSE_111 - # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -184($fp) - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_STRING_114 - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_STRING_114 - lw $t0, -184($fp) - beq $t0, 0, label_COMPARE_STRING_114 - # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -184($fp) - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_BY_VALUE_115 - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_BY_VALUE_115 - lw $t0, -184($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_115 - # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -184($fp) - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_BY_VALUE_115 - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_BY_VALUE_115 - lw $t0, -184($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_115 - # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -188($fp) - sub $a0, $a0, $a1 - sw $a0, -184($fp) - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 - lw $t0, -184($fp) - beq $t0, 0, label_TRUE_112 - # GOTO label_FALSE_111 - j label_FALSE_111 - label_COMPARE_BY_VALUE_115: - # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) - lw $a0, 0($fp) - lw $a1, -188($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -184($fp) - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 - lw $t0, -184($fp) - beq $t0, 0, label_TRUE_112 - # GOTO label_FALSE_111 - j label_FALSE_111 - label_COMPARE_STRING_114: - # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -188($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -184($fp) - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_CONTINUE_116 - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_CONTINUE_116 - lw $t0, -184($fp) - beq $t0, 0, label_CONTINUE_116 - # GOTO label_FALSE_111 - j label_FALSE_111 - label_CONTINUE_116: - # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -188($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_117: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_118 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_117 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_118: - # Store result - sw $a2, -184($fp) - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 - lw $t0, -184($fp) - beq $t0, 0, label_TRUE_112 - label_FALSE_111: - # LOCAL local_c2i_at_Parse_internal_44 --> -180($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -180($fp) - # GOTO label_END_113 -j label_END_113 -label_TRUE_112: - # LOCAL local_c2i_at_Parse_internal_44 --> -180($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -180($fp) - label_END_113: -# LOCAL local_c2i_at_Parse_internal_42 --> -172($fp) -# LOCAL local_c2i_at_Parse_internal_44 --> -180($fp) -# Obtain value from -180($fp) -lw $v0, -180($fp) -lw $v0, 12($v0) -sw $v0, -172($fp) -# IF_ZERO local_c2i_at_Parse_internal_42 GOTO label_FALSEIF_109 -# IF_ZERO local_c2i_at_Parse_internal_42 GOTO label_FALSEIF_109 -lw $t0, -172($fp) -beq $t0, 0, label_FALSEIF_109 -# LOCAL local_c2i_at_Parse_internal_47 --> -192($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 7 -sw $t0, 12($v0) -sw $v0, -192($fp) -# LOCAL local_c2i_at_Parse_internal_43 --> -176($fp) -# LOCAL local_c2i_at_Parse_internal_47 --> -192($fp) -# local_c2i_at_Parse_internal_43 = local_c2i_at_Parse_internal_47 -lw $t0, -192($fp) -sw $t0, -176($fp) -# GOTO label_ENDIF_110 -j label_ENDIF_110 -label_FALSEIF_109: - # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_14 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -212($fp) - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_121 - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_121 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_121 - # IF_ZERO local_c2i_at_Parse_internal_52 GOTO label_FALSE_121 - # IF_ZERO local_c2i_at_Parse_internal_52 GOTO label_FALSE_121 - lw $t0, -212($fp) - beq $t0, 0, label_FALSE_121 - # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -208($fp) - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_STRING_124 - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_STRING_124 - lw $t0, -208($fp) - beq $t0, 0, label_COMPARE_STRING_124 - # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -208($fp) - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_BY_VALUE_125 - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_BY_VALUE_125 - lw $t0, -208($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_125 - # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -208($fp) - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_BY_VALUE_125 - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_BY_VALUE_125 - lw $t0, -208($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_125 - # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -212($fp) - sub $a0, $a0, $a1 - sw $a0, -208($fp) - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 - lw $t0, -208($fp) - beq $t0, 0, label_TRUE_122 - # GOTO label_FALSE_121 - j label_FALSE_121 - label_COMPARE_BY_VALUE_125: - # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) - lw $a0, 0($fp) - lw $a1, -212($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -208($fp) - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 - lw $t0, -208($fp) - beq $t0, 0, label_TRUE_122 - # GOTO label_FALSE_121 - j label_FALSE_121 - label_COMPARE_STRING_124: - # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -212($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -208($fp) - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_CONTINUE_126 - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_CONTINUE_126 - lw $t0, -208($fp) - beq $t0, 0, label_CONTINUE_126 - # GOTO label_FALSE_121 - j label_FALSE_121 - label_CONTINUE_126: - # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -212($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_127: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_128 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_127 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_128: - # Store result - sw $a2, -208($fp) - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 - lw $t0, -208($fp) - beq $t0, 0, label_TRUE_122 - label_FALSE_121: - # LOCAL local_c2i_at_Parse_internal_50 --> -204($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -204($fp) - # GOTO label_END_123 -j label_END_123 -label_TRUE_122: - # LOCAL local_c2i_at_Parse_internal_50 --> -204($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -204($fp) - label_END_123: -# LOCAL local_c2i_at_Parse_internal_48 --> -196($fp) -# LOCAL local_c2i_at_Parse_internal_50 --> -204($fp) -# Obtain value from -204($fp) -lw $v0, -204($fp) -lw $v0, 12($v0) -sw $v0, -196($fp) -# IF_ZERO local_c2i_at_Parse_internal_48 GOTO label_FALSEIF_119 -# IF_ZERO local_c2i_at_Parse_internal_48 GOTO label_FALSEIF_119 -lw $t0, -196($fp) -beq $t0, 0, label_FALSEIF_119 -# LOCAL local_c2i_at_Parse_internal_53 --> -216($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 8 -sw $t0, 12($v0) -sw $v0, -216($fp) -# LOCAL local_c2i_at_Parse_internal_49 --> -200($fp) -# LOCAL local_c2i_at_Parse_internal_53 --> -216($fp) -# local_c2i_at_Parse_internal_49 = local_c2i_at_Parse_internal_53 -lw $t0, -216($fp) -sw $t0, -200($fp) -# GOTO label_ENDIF_120 -j label_ENDIF_120 -label_FALSEIF_119: - # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_15 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -236($fp) - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_131 - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_131 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_131 - # IF_ZERO local_c2i_at_Parse_internal_58 GOTO label_FALSE_131 - # IF_ZERO local_c2i_at_Parse_internal_58 GOTO label_FALSE_131 - lw $t0, -236($fp) - beq $t0, 0, label_FALSE_131 - # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -232($fp) - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_STRING_134 - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_STRING_134 - lw $t0, -232($fp) - beq $t0, 0, label_COMPARE_STRING_134 - # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -232($fp) - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_BY_VALUE_135 - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_BY_VALUE_135 - lw $t0, -232($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_135 - # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -232($fp) - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_BY_VALUE_135 - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_BY_VALUE_135 - lw $t0, -232($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_135 - # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -236($fp) - sub $a0, $a0, $a1 - sw $a0, -232($fp) - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 - lw $t0, -232($fp) - beq $t0, 0, label_TRUE_132 - # GOTO label_FALSE_131 - j label_FALSE_131 - label_COMPARE_BY_VALUE_135: - # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) - lw $a0, 0($fp) - lw $a1, -236($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -232($fp) - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 - lw $t0, -232($fp) - beq $t0, 0, label_TRUE_132 - # GOTO label_FALSE_131 - j label_FALSE_131 - label_COMPARE_STRING_134: - # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -236($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -232($fp) - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_CONTINUE_136 - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_CONTINUE_136 - lw $t0, -232($fp) - beq $t0, 0, label_CONTINUE_136 - # GOTO label_FALSE_131 - j label_FALSE_131 - label_CONTINUE_136: - # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -236($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_137: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_138 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_137 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_138: - # Store result - sw $a2, -232($fp) - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 - lw $t0, -232($fp) - beq $t0, 0, label_TRUE_132 - label_FALSE_131: - # LOCAL local_c2i_at_Parse_internal_56 --> -228($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -228($fp) - # GOTO label_END_133 -j label_END_133 -label_TRUE_132: - # LOCAL local_c2i_at_Parse_internal_56 --> -228($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -228($fp) - label_END_133: -# LOCAL local_c2i_at_Parse_internal_54 --> -220($fp) -# LOCAL local_c2i_at_Parse_internal_56 --> -228($fp) -# Obtain value from -228($fp) -lw $v0, -228($fp) -lw $v0, 12($v0) -sw $v0, -220($fp) -# IF_ZERO local_c2i_at_Parse_internal_54 GOTO label_FALSEIF_129 -# IF_ZERO local_c2i_at_Parse_internal_54 GOTO label_FALSEIF_129 -lw $t0, -220($fp) -beq $t0, 0, label_FALSEIF_129 -# LOCAL local_c2i_at_Parse_internal_59 --> -240($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 9 -sw $t0, 12($v0) -sw $v0, -240($fp) -# LOCAL local_c2i_at_Parse_internal_55 --> -224($fp) -# LOCAL local_c2i_at_Parse_internal_59 --> -240($fp) -# local_c2i_at_Parse_internal_55 = local_c2i_at_Parse_internal_59 -lw $t0, -240($fp) -sw $t0, -224($fp) -# GOTO label_ENDIF_130 -j label_ENDIF_130 -label_FALSEIF_129: - # LOCAL local_c2i_at_Parse_internal_62 --> -252($fp) - # local_c2i_at_Parse_internal_62 = SELF - sw $s1, -252($fp) - # LOCAL local_c2i_at_Parse_internal_60 --> -244($fp) - # LOCAL local_c2i_at_Parse_internal_62 --> -252($fp) - # local_c2i_at_Parse_internal_60 = local_c2i_at_Parse_internal_62 - lw $t0, -252($fp) - sw $t0, -244($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_c2i_at_Parse_internal_60 --> -244($fp) - # LOCAL local_c2i_at_Parse_internal_61 --> -248($fp) - # local_c2i_at_Parse_internal_61 = VCALL local_c2i_at_Parse_internal_60 abort - # Save new self pointer in $s1 - lw $s1, -244($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 76($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -248($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_c2i_at_Parse_internal_63 --> -256($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -256($fp) - # LOCAL local_c2i_at_Parse_internal_55 --> -224($fp) - # LOCAL local_c2i_at_Parse_internal_63 --> -256($fp) - # local_c2i_at_Parse_internal_55 = local_c2i_at_Parse_internal_63 - lw $t0, -256($fp) - sw $t0, -224($fp) - label_ENDIF_130: -# LOCAL local_c2i_at_Parse_internal_49 --> -200($fp) -# LOCAL local_c2i_at_Parse_internal_55 --> -224($fp) -# local_c2i_at_Parse_internal_49 = local_c2i_at_Parse_internal_55 -lw $t0, -224($fp) -sw $t0, -200($fp) -label_ENDIF_120: -# LOCAL local_c2i_at_Parse_internal_43 --> -176($fp) -# LOCAL local_c2i_at_Parse_internal_49 --> -200($fp) -# local_c2i_at_Parse_internal_43 = local_c2i_at_Parse_internal_49 -lw $t0, -200($fp) -sw $t0, -176($fp) -label_ENDIF_110: -# LOCAL local_c2i_at_Parse_internal_37 --> -152($fp) -# LOCAL local_c2i_at_Parse_internal_43 --> -176($fp) -# local_c2i_at_Parse_internal_37 = local_c2i_at_Parse_internal_43 -lw $t0, -176($fp) -sw $t0, -152($fp) -label_ENDIF_100: -# LOCAL local_c2i_at_Parse_internal_31 --> -128($fp) -# LOCAL local_c2i_at_Parse_internal_37 --> -152($fp) -# local_c2i_at_Parse_internal_31 = local_c2i_at_Parse_internal_37 -lw $t0, -152($fp) -sw $t0, -128($fp) -label_ENDIF_90: -# LOCAL local_c2i_at_Parse_internal_25 --> -104($fp) -# LOCAL local_c2i_at_Parse_internal_31 --> -128($fp) -# local_c2i_at_Parse_internal_25 = local_c2i_at_Parse_internal_31 -lw $t0, -128($fp) -sw $t0, -104($fp) -label_ENDIF_80: -# LOCAL local_c2i_at_Parse_internal_19 --> -80($fp) -# LOCAL local_c2i_at_Parse_internal_25 --> -104($fp) -# local_c2i_at_Parse_internal_19 = local_c2i_at_Parse_internal_25 -lw $t0, -104($fp) -sw $t0, -80($fp) -label_ENDIF_70: -# LOCAL local_c2i_at_Parse_internal_13 --> -56($fp) -# LOCAL local_c2i_at_Parse_internal_19 --> -80($fp) -# local_c2i_at_Parse_internal_13 = local_c2i_at_Parse_internal_19 -lw $t0, -80($fp) -sw $t0, -56($fp) -label_ENDIF_60: -# LOCAL local_c2i_at_Parse_internal_7 --> -32($fp) -# LOCAL local_c2i_at_Parse_internal_13 --> -56($fp) -# local_c2i_at_Parse_internal_7 = local_c2i_at_Parse_internal_13 -lw $t0, -56($fp) -sw $t0, -32($fp) -label_ENDIF_50: -# LOCAL local_c2i_at_Parse_internal_1 --> -8($fp) -# LOCAL local_c2i_at_Parse_internal_7 --> -32($fp) -# local_c2i_at_Parse_internal_1 = local_c2i_at_Parse_internal_7 -lw $t0, -32($fp) -sw $t0, -8($fp) -label_ENDIF_40: -# RETURN local_c2i_at_Parse_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_c2i_at_Parse. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 264 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_a2i_at_Parse implementation. -# @Params: -# 0($fp) = param_a2i_at_Parse_s_0 -function_a2i_at_Parse: - # Allocate stack frame for function function_a2i_at_Parse. - subu $sp, $sp, 208 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 208 - # LOCAL local_a2i_at_Parse_internal_4 --> -20($fp) - # PARAM param_a2i_at_Parse_s_0 --> 0($fp) - # local_a2i_at_Parse_internal_4 = PARAM param_a2i_at_Parse_s_0 - lw $t0, 0($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_at_Parse_internal_4 --> -20($fp) - # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) - # local_a2i_at_Parse_internal_5 = VCALL local_a2i_at_Parse_internal_4 length - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 44($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -28($fp) - # IF_ZERO local_a2i_at_Parse_internal_5 GOTO label_FALSE_141 - # IF_ZERO local_a2i_at_Parse_internal_5 GOTO label_FALSE_141 - lw $t0, -24($fp) - beq $t0, 0, label_FALSE_141 - # IF_ZERO local_a2i_at_Parse_internal_6 GOTO label_FALSE_141 - # IF_ZERO local_a2i_at_Parse_internal_6 GOTO label_FALSE_141 - lw $t0, -28($fp) - beq $t0, 0, label_FALSE_141 - # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) - # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) - # Comparing -24($fp) type with String - la $v0, String - lw $a0, -24($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_STRING_144 - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_STRING_144 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_144 - # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) - # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) - # Comparing -24($fp) type with Bool - la $v0, Bool - lw $a0, -24($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_145 - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_145 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_145 - # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) - # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) - # Comparing -24($fp) type with Int - la $v0, Int - lw $a0, -24($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_145 - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_145 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_145 - # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) - # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) - # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) - # Load pointers and SUB - lw $a0, -24($fp) - lw $a1, -28($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_142 - # GOTO label_FALSE_141 - j label_FALSE_141 - label_COMPARE_BY_VALUE_145: - # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) - # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) - # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) - lw $a0, -24($fp) - lw $a1, -28($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_142 - # GOTO label_FALSE_141 - j label_FALSE_141 - label_COMPARE_STRING_144: - # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) - # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) - # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) - # Load strings for comparison - lw $v0, -24($fp) - lw $v1, -28($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_CONTINUE_146 - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_CONTINUE_146 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_146 - # GOTO label_FALSE_141 - j label_FALSE_141 - label_CONTINUE_146: - # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) - # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) - # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -24($fp) - lw $v1, -28($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_147: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_148 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_147 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_148: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_142 - label_FALSE_141: - # LOCAL local_a2i_at_Parse_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_143 -j label_END_143 -label_TRUE_142: - # LOCAL local_a2i_at_Parse_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_143: -# LOCAL local_a2i_at_Parse_internal_0 --> -4($fp) -# LOCAL local_a2i_at_Parse_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_a2i_at_Parse_internal_0 GOTO label_FALSEIF_139 -# IF_ZERO local_a2i_at_Parse_internal_0 GOTO label_FALSEIF_139 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_139 -# LOCAL local_a2i_at_Parse_internal_7 --> -32($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -32($fp) -# LOCAL local_a2i_at_Parse_internal_1 --> -8($fp) -# LOCAL local_a2i_at_Parse_internal_7 --> -32($fp) -# local_a2i_at_Parse_internal_1 = local_a2i_at_Parse_internal_7 -lw $t0, -32($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_140 -j label_ENDIF_140 -label_FALSEIF_139: - # LOCAL local_a2i_at_Parse_internal_12 --> -52($fp) - # PARAM param_a2i_at_Parse_s_0 --> 0($fp) - # local_a2i_at_Parse_internal_12 = PARAM param_a2i_at_Parse_s_0 - lw $t0, 0($fp) - sw $t0, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_at_Parse_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -60($fp) - # ARG local_a2i_at_Parse_internal_14 - # LOCAL local_a2i_at_Parse_internal_14 --> -60($fp) - lw $t0, -60($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_at_Parse_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -64($fp) - # ARG local_a2i_at_Parse_internal_15 - # LOCAL local_a2i_at_Parse_internal_15 --> -64($fp) - lw $t0, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_at_Parse_internal_12 --> -52($fp) - # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) - # local_a2i_at_Parse_internal_13 = VCALL local_a2i_at_Parse_internal_12 substr - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 72($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_16 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -68($fp) - # IF_ZERO local_a2i_at_Parse_internal_13 GOTO label_FALSE_151 - # IF_ZERO local_a2i_at_Parse_internal_13 GOTO label_FALSE_151 - lw $t0, -56($fp) - beq $t0, 0, label_FALSE_151 - # IF_ZERO local_a2i_at_Parse_internal_16 GOTO label_FALSE_151 - # IF_ZERO local_a2i_at_Parse_internal_16 GOTO label_FALSE_151 - lw $t0, -68($fp) - beq $t0, 0, label_FALSE_151 - # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) - # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) - # Comparing -56($fp) type with String - la $v0, String - lw $a0, -56($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_STRING_154 - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_STRING_154 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_STRING_154 - # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) - # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) - # Comparing -56($fp) type with Bool - la $v0, Bool - lw $a0, -56($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_155 - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_155 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_155 - # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) - # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) - # Comparing -56($fp) type with Int - la $v0, Int - lw $a0, -56($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_155 - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_155 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_155 - # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) - # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) - # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) - # Load pointers and SUB - lw $a0, -56($fp) - lw $a1, -68($fp) - sub $a0, $a0, $a1 - sw $a0, -48($fp) - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_152 - # GOTO label_FALSE_151 - j label_FALSE_151 - label_COMPARE_BY_VALUE_155: - # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) - # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) - # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) - lw $a0, -56($fp) - lw $a1, -68($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -48($fp) - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_152 - # GOTO label_FALSE_151 - j label_FALSE_151 - label_COMPARE_STRING_154: - # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) - # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) - # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) - # Load strings for comparison - lw $v0, -56($fp) - lw $v1, -68($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -48($fp) - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_CONTINUE_156 - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_CONTINUE_156 - lw $t0, -48($fp) - beq $t0, 0, label_CONTINUE_156 - # GOTO label_FALSE_151 - j label_FALSE_151 - label_CONTINUE_156: - # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) - # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) - # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -56($fp) - lw $v1, -68($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_157: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_158 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_157 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_158: - # Store result - sw $a2, -48($fp) - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_152 - label_FALSE_151: - # LOCAL local_a2i_at_Parse_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -44($fp) - # GOTO label_END_153 -j label_END_153 -label_TRUE_152: - # LOCAL local_a2i_at_Parse_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -44($fp) - label_END_153: -# LOCAL local_a2i_at_Parse_internal_8 --> -36($fp) -# LOCAL local_a2i_at_Parse_internal_10 --> -44($fp) -# Obtain value from -44($fp) -lw $v0, -44($fp) -lw $v0, 12($v0) -sw $v0, -36($fp) -# IF_ZERO local_a2i_at_Parse_internal_8 GOTO label_FALSEIF_149 -# IF_ZERO local_a2i_at_Parse_internal_8 GOTO label_FALSEIF_149 -lw $t0, -36($fp) -beq $t0, 0, label_FALSEIF_149 -# LOCAL local_a2i_at_Parse_internal_20 --> -84($fp) -# local_a2i_at_Parse_internal_20 = SELF -sw $s1, -84($fp) -# LOCAL local_a2i_at_Parse_internal_18 --> -76($fp) -# LOCAL local_a2i_at_Parse_internal_20 --> -84($fp) -# local_a2i_at_Parse_internal_18 = local_a2i_at_Parse_internal_20 -lw $t0, -84($fp) -sw $t0, -76($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_Parse_internal_21 --> -88($fp) -# PARAM param_a2i_at_Parse_s_0 --> 0($fp) -# local_a2i_at_Parse_internal_21 = PARAM param_a2i_at_Parse_s_0 -lw $t0, 0($fp) -sw $t0, -88($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_Parse_internal_23 --> -96($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -96($fp) -# ARG local_a2i_at_Parse_internal_23 -# LOCAL local_a2i_at_Parse_internal_23 --> -96($fp) -lw $t0, -96($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_Parse_internal_25 --> -104($fp) -# PARAM param_a2i_at_Parse_s_0 --> 0($fp) -# local_a2i_at_Parse_internal_25 = PARAM param_a2i_at_Parse_s_0 -lw $t0, 0($fp) -sw $t0, -104($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_Parse_internal_25 --> -104($fp) -# LOCAL local_a2i_at_Parse_internal_26 --> -108($fp) -# local_a2i_at_Parse_internal_26 = VCALL local_a2i_at_Parse_internal_25 length -# Save new self pointer in $s1 -lw $s1, -104($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 44($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -108($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_Parse_internal_27 --> -112($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -112($fp) -# LOCAL local_a2i_at_Parse_internal_24 --> -100($fp) -# LOCAL local_a2i_at_Parse_internal_26 --> -108($fp) -# LOCAL local_a2i_at_Parse_internal_27 --> -112($fp) -# local_a2i_at_Parse_internal_24 = local_a2i_at_Parse_internal_26 - local_a2i_at_Parse_internal_27 -lw $t1, -108($fp) -lw $t0, 12($t1) -lw $t1, -112($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -100($fp) -# ARG local_a2i_at_Parse_internal_24 -# LOCAL local_a2i_at_Parse_internal_24 --> -100($fp) -lw $t0, -100($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_Parse_internal_21 --> -88($fp) -# LOCAL local_a2i_at_Parse_internal_22 --> -92($fp) -# local_a2i_at_Parse_internal_22 = VCALL local_a2i_at_Parse_internal_21 substr -# Save new self pointer in $s1 -lw $s1, -88($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 72($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -92($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_a2i_at_Parse_internal_22 -# LOCAL local_a2i_at_Parse_internal_22 --> -92($fp) -lw $t0, -92($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_Parse_internal_18 --> -76($fp) -# LOCAL local_a2i_at_Parse_internal_19 --> -80($fp) -# local_a2i_at_Parse_internal_19 = VCALL local_a2i_at_Parse_internal_18 a2i_aux -# Save new self pointer in $s1 -lw $s1, -76($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 4($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -80($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_Parse_internal_17 --> -72($fp) -# LOCAL local_a2i_at_Parse_internal_19 --> -80($fp) -lw $t0, -80($fp) -lw $t0, 12($t0) -not $t0, $t0 -add $t0, $t0, 1 -sw $t0, -72($fp) -# LOCAL local_a2i_at_Parse_internal_17 --> -72($fp) -# LOCAL local_a2i_at_Parse_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -lw $t0, -72($fp) -sw $t0, 12($v0) -sw $v0, -72($fp) -# LOCAL local_a2i_at_Parse_internal_9 --> -40($fp) -# LOCAL local_a2i_at_Parse_internal_17 --> -72($fp) -# local_a2i_at_Parse_internal_9 = local_a2i_at_Parse_internal_17 -lw $t0, -72($fp) -sw $t0, -40($fp) -# GOTO label_ENDIF_150 -j label_ENDIF_150 -label_FALSEIF_149: - # LOCAL local_a2i_at_Parse_internal_32 --> -132($fp) - # PARAM param_a2i_at_Parse_s_0 --> 0($fp) - # local_a2i_at_Parse_internal_32 = PARAM param_a2i_at_Parse_s_0 - lw $t0, 0($fp) - sw $t0, -132($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_at_Parse_internal_34 --> -140($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -140($fp) - # ARG local_a2i_at_Parse_internal_34 - # LOCAL local_a2i_at_Parse_internal_34 --> -140($fp) - lw $t0, -140($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_at_Parse_internal_35 --> -144($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -144($fp) - # ARG local_a2i_at_Parse_internal_35 - # LOCAL local_a2i_at_Parse_internal_35 --> -144($fp) - lw $t0, -144($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_at_Parse_internal_32 --> -132($fp) - # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) - # local_a2i_at_Parse_internal_33 = VCALL local_a2i_at_Parse_internal_32 substr - # Save new self pointer in $s1 - lw $s1, -132($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 72($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -136($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_17 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -148($fp) - # IF_ZERO local_a2i_at_Parse_internal_33 GOTO label_FALSE_161 - # IF_ZERO local_a2i_at_Parse_internal_33 GOTO label_FALSE_161 - lw $t0, -136($fp) - beq $t0, 0, label_FALSE_161 - # IF_ZERO local_a2i_at_Parse_internal_36 GOTO label_FALSE_161 - # IF_ZERO local_a2i_at_Parse_internal_36 GOTO label_FALSE_161 - lw $t0, -148($fp) - beq $t0, 0, label_FALSE_161 - # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) - # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) - # Comparing -136($fp) type with String - la $v0, String - lw $a0, -136($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -128($fp) - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_STRING_164 - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_STRING_164 - lw $t0, -128($fp) - beq $t0, 0, label_COMPARE_STRING_164 - # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) - # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) - # Comparing -136($fp) type with Bool - la $v0, Bool - lw $a0, -136($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -128($fp) - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_BY_VALUE_165 - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_BY_VALUE_165 - lw $t0, -128($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_165 - # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) - # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) - # Comparing -136($fp) type with Int - la $v0, Int - lw $a0, -136($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -128($fp) - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_BY_VALUE_165 - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_BY_VALUE_165 - lw $t0, -128($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_165 - # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) - # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) - # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) - # Load pointers and SUB - lw $a0, -136($fp) - lw $a1, -148($fp) - sub $a0, $a0, $a1 - sw $a0, -128($fp) - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 - lw $t0, -128($fp) - beq $t0, 0, label_TRUE_162 - # GOTO label_FALSE_161 - j label_FALSE_161 - label_COMPARE_BY_VALUE_165: - # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) - # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) - # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) - lw $a0, -136($fp) - lw $a1, -148($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -128($fp) - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 - lw $t0, -128($fp) - beq $t0, 0, label_TRUE_162 - # GOTO label_FALSE_161 - j label_FALSE_161 - label_COMPARE_STRING_164: - # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) - # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) - # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) - # Load strings for comparison - lw $v0, -136($fp) - lw $v1, -148($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -128($fp) - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_CONTINUE_166 - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_CONTINUE_166 - lw $t0, -128($fp) - beq $t0, 0, label_CONTINUE_166 - # GOTO label_FALSE_161 - j label_FALSE_161 - label_CONTINUE_166: - # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) - # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) - # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -136($fp) - lw $v1, -148($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_167: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_168 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_167 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_168: - # Store result - sw $a2, -128($fp) - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 - lw $t0, -128($fp) - beq $t0, 0, label_TRUE_162 - label_FALSE_161: - # LOCAL local_a2i_at_Parse_internal_30 --> -124($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -124($fp) - # GOTO label_END_163 -j label_END_163 -label_TRUE_162: - # LOCAL local_a2i_at_Parse_internal_30 --> -124($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -124($fp) - label_END_163: -# LOCAL local_a2i_at_Parse_internal_28 --> -116($fp) -# LOCAL local_a2i_at_Parse_internal_30 --> -124($fp) -# Obtain value from -124($fp) -lw $v0, -124($fp) -lw $v0, 12($v0) -sw $v0, -116($fp) -# IF_ZERO local_a2i_at_Parse_internal_28 GOTO label_FALSEIF_159 -# IF_ZERO local_a2i_at_Parse_internal_28 GOTO label_FALSEIF_159 -lw $t0, -116($fp) -beq $t0, 0, label_FALSEIF_159 -# LOCAL local_a2i_at_Parse_internal_39 --> -160($fp) -# local_a2i_at_Parse_internal_39 = SELF -sw $s1, -160($fp) -# LOCAL local_a2i_at_Parse_internal_37 --> -152($fp) -# LOCAL local_a2i_at_Parse_internal_39 --> -160($fp) -# local_a2i_at_Parse_internal_37 = local_a2i_at_Parse_internal_39 -lw $t0, -160($fp) -sw $t0, -152($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_Parse_internal_40 --> -164($fp) -# PARAM param_a2i_at_Parse_s_0 --> 0($fp) -# local_a2i_at_Parse_internal_40 = PARAM param_a2i_at_Parse_s_0 -lw $t0, 0($fp) -sw $t0, -164($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_Parse_internal_42 --> -172($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -172($fp) -# ARG local_a2i_at_Parse_internal_42 -# LOCAL local_a2i_at_Parse_internal_42 --> -172($fp) -lw $t0, -172($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_Parse_internal_44 --> -180($fp) -# PARAM param_a2i_at_Parse_s_0 --> 0($fp) -# local_a2i_at_Parse_internal_44 = PARAM param_a2i_at_Parse_s_0 -lw $t0, 0($fp) -sw $t0, -180($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_Parse_internal_44 --> -180($fp) -# LOCAL local_a2i_at_Parse_internal_45 --> -184($fp) -# local_a2i_at_Parse_internal_45 = VCALL local_a2i_at_Parse_internal_44 length -# Save new self pointer in $s1 -lw $s1, -180($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 44($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -184($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_Parse_internal_46 --> -188($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -188($fp) -# LOCAL local_a2i_at_Parse_internal_43 --> -176($fp) -# LOCAL local_a2i_at_Parse_internal_45 --> -184($fp) -# LOCAL local_a2i_at_Parse_internal_46 --> -188($fp) -# local_a2i_at_Parse_internal_43 = local_a2i_at_Parse_internal_45 - local_a2i_at_Parse_internal_46 -lw $t1, -184($fp) -lw $t0, 12($t1) -lw $t1, -188($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -176($fp) -# ARG local_a2i_at_Parse_internal_43 -# LOCAL local_a2i_at_Parse_internal_43 --> -176($fp) -lw $t0, -176($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_Parse_internal_40 --> -164($fp) -# LOCAL local_a2i_at_Parse_internal_41 --> -168($fp) -# local_a2i_at_Parse_internal_41 = VCALL local_a2i_at_Parse_internal_40 substr -# Save new self pointer in $s1 -lw $s1, -164($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 72($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -168($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_a2i_at_Parse_internal_41 -# LOCAL local_a2i_at_Parse_internal_41 --> -168($fp) -lw $t0, -168($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_Parse_internal_37 --> -152($fp) -# LOCAL local_a2i_at_Parse_internal_38 --> -156($fp) -# local_a2i_at_Parse_internal_38 = VCALL local_a2i_at_Parse_internal_37 a2i -# Save new self pointer in $s1 -lw $s1, -152($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 52($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -156($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_Parse_internal_29 --> -120($fp) -# LOCAL local_a2i_at_Parse_internal_38 --> -156($fp) -# local_a2i_at_Parse_internal_29 = local_a2i_at_Parse_internal_38 -lw $t0, -156($fp) -sw $t0, -120($fp) -# GOTO label_ENDIF_160 -j label_ENDIF_160 -label_FALSEIF_159: - # LOCAL local_a2i_at_Parse_internal_49 --> -200($fp) - # local_a2i_at_Parse_internal_49 = SELF - sw $s1, -200($fp) - # LOCAL local_a2i_at_Parse_internal_47 --> -192($fp) - # LOCAL local_a2i_at_Parse_internal_49 --> -200($fp) - # local_a2i_at_Parse_internal_47 = local_a2i_at_Parse_internal_49 - lw $t0, -200($fp) - sw $t0, -192($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_a2i_at_Parse_s_0 - # PARAM param_a2i_at_Parse_s_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_at_Parse_internal_47 --> -192($fp) - # LOCAL local_a2i_at_Parse_internal_48 --> -196($fp) - # local_a2i_at_Parse_internal_48 = VCALL local_a2i_at_Parse_internal_47 a2i_aux - # Save new self pointer in $s1 - lw $s1, -192($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -196($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_Parse_internal_29 --> -120($fp) - # LOCAL local_a2i_at_Parse_internal_48 --> -196($fp) - # local_a2i_at_Parse_internal_29 = local_a2i_at_Parse_internal_48 - lw $t0, -196($fp) - sw $t0, -120($fp) - label_ENDIF_160: -# LOCAL local_a2i_at_Parse_internal_9 --> -40($fp) -# LOCAL local_a2i_at_Parse_internal_29 --> -120($fp) -# local_a2i_at_Parse_internal_9 = local_a2i_at_Parse_internal_29 -lw $t0, -120($fp) -sw $t0, -40($fp) -label_ENDIF_150: -# LOCAL local_a2i_at_Parse_internal_1 --> -8($fp) -# LOCAL local_a2i_at_Parse_internal_9 --> -40($fp) -# local_a2i_at_Parse_internal_1 = local_a2i_at_Parse_internal_9 -lw $t0, -40($fp) -sw $t0, -8($fp) -label_ENDIF_140: -# RETURN local_a2i_at_Parse_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_a2i_at_Parse. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 208 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_a2i_aux_at_Parse implementation. -# @Params: -# 0($fp) = param_a2i_aux_at_Parse_s_0 -function_a2i_aux_at_Parse: - # Allocate stack frame for function function_a2i_aux_at_Parse. - subu $sp, $sp, 240 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 240 - # LOCAL local_a2i_aux_at_Parse_int_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_a2i_aux_at_Parse_internal_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -8($fp) - # LOCAL local_a2i_aux_at_Parse_int_0 --> -4($fp) - # LOCAL local_a2i_aux_at_Parse_internal_1 --> -8($fp) - # local_a2i_aux_at_Parse_int_0 = local_a2i_aux_at_Parse_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # LOCAL local_a2i_aux_at_Parse_internal_3 --> -16($fp) - # PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) - # local_a2i_aux_at_Parse_internal_3 = PARAM param_a2i_aux_at_Parse_s_0 - lw $t0, 0($fp) - sw $t0, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_aux_at_Parse_internal_3 --> -16($fp) - # LOCAL local_a2i_aux_at_Parse_internal_4 --> -20($fp) - # local_a2i_aux_at_Parse_internal_4 = VCALL local_a2i_aux_at_Parse_internal_3 length - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 44($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) - # LOCAL local_a2i_aux_at_Parse_internal_4 --> -20($fp) - # local_a2i_aux_at_Parse_j_2 = local_a2i_aux_at_Parse_internal_4 - lw $t0, -20($fp) - sw $t0, -12($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -24($fp) - # LOCAL local_a2i_aux_at_Parse_internal_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -28($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # LOCAL local_a2i_aux_at_Parse_internal_6 --> -28($fp) - # local_a2i_aux_at_Parse_i_5 = local_a2i_aux_at_Parse_internal_6 - lw $t0, -28($fp) - sw $t0, -24($fp) - label_WHILE_169: - # LOCAL local_a2i_aux_at_Parse_internal_8 --> -36($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) - lw $a0, -24($fp) - lw $a1, -12($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -36($fp) - # IF_GREATER_ZERO local_a2i_aux_at_Parse_internal_8 GOTO label_FALSE_171 - # IF_GREATER_ZERO local_a2i_aux_at_Parse_internal_8 GOTO label_FALSE_171 - lw $t0, -36($fp) - bgt $t0, 0, label_FALSE_171 - # IF_ZERO local_a2i_aux_at_Parse_internal_8 GOTO label_FALSE_171 - # IF_ZERO local_a2i_aux_at_Parse_internal_8 GOTO label_FALSE_171 - lw $t0, -36($fp) - beq $t0, 0, label_FALSE_171 - # LOCAL local_a2i_aux_at_Parse_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -36($fp) - # GOTO label_END_172 -j label_END_172 -label_FALSE_171: - # LOCAL local_a2i_aux_at_Parse_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -36($fp) - label_END_172: -# LOCAL local_a2i_aux_at_Parse_internal_7 --> -32($fp) -# LOCAL local_a2i_aux_at_Parse_internal_8 --> -36($fp) -# Obtain value from -36($fp) -lw $v0, -36($fp) -lw $v0, 12($v0) -sw $v0, -32($fp) -# IF_ZERO local_a2i_aux_at_Parse_internal_7 GOTO label_WHILE_END_170 -# IF_ZERO local_a2i_aux_at_Parse_internal_7 GOTO label_WHILE_END_170 -lw $t0, -32($fp) -beq $t0, 0, label_WHILE_END_170 -# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_0 -sw $t0, 12($v0) -li $t0, 0 -sw $t0, 16($v0) -sw $v0, -40($fp) -# LOCAL local_a2i_aux_at_Parse_internal_10 --> -44($fp) -# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) -# local_a2i_aux_at_Parse_internal_10 = PARAM param_a2i_aux_at_Parse_s_0 -lw $t0, 0($fp) -sw $t0, -44($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_a2i_aux_at_Parse_i_5 -# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) -lw $t0, -24($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_aux_at_Parse_internal_12 --> -52($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -52($fp) -# ARG local_a2i_aux_at_Parse_internal_12 -# LOCAL local_a2i_aux_at_Parse_internal_12 --> -52($fp) -lw $t0, -52($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_aux_at_Parse_internal_10 --> -44($fp) -# LOCAL local_a2i_aux_at_Parse_internal_11 --> -48($fp) -# local_a2i_aux_at_Parse_internal_11 = VCALL local_a2i_aux_at_Parse_internal_10 substr -# Save new self pointer in $s1 -lw $s1, -44($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 72($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -48($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) -# LOCAL local_a2i_aux_at_Parse_internal_11 --> -48($fp) -# local_a2i_aux_at_Parse_c_9 = local_a2i_aux_at_Parse_internal_11 -lw $t0, -48($fp) -sw $t0, -40($fp) -# LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_18 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -72($fp) -# IF_ZERO local_a2i_aux_at_Parse_c_9 GOTO label_FALSE_175 -# IF_ZERO local_a2i_aux_at_Parse_c_9 GOTO label_FALSE_175 -lw $t0, -40($fp) -beq $t0, 0, label_FALSE_175 -# IF_ZERO local_a2i_aux_at_Parse_internal_17 GOTO label_FALSE_175 -# IF_ZERO local_a2i_aux_at_Parse_internal_17 GOTO label_FALSE_175 -lw $t0, -72($fp) -beq $t0, 0, label_FALSE_175 -# LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) -# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) -# Comparing -40($fp) type with String -la $v0, String -lw $a0, -40($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -68($fp) -# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_STRING_178 -# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_STRING_178 -lw $t0, -68($fp) -beq $t0, 0, label_COMPARE_STRING_178 -# LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) -# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) -# Comparing -40($fp) type with Bool -la $v0, Bool -lw $a0, -40($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -68($fp) -# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_BY_VALUE_179 -# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_BY_VALUE_179 -lw $t0, -68($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_179 -# LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) -# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) -# Comparing -40($fp) type with Int -la $v0, Int -lw $a0, -40($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -68($fp) -# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_BY_VALUE_179 -# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_BY_VALUE_179 -lw $t0, -68($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_179 -# LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) -# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) -# LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) -# Load pointers and SUB -lw $a0, -40($fp) -lw $a1, -72($fp) -sub $a0, $a0, $a1 -sw $a0, -68($fp) -# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 -# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 -lw $t0, -68($fp) -beq $t0, 0, label_TRUE_176 -# GOTO label_FALSE_175 -j label_FALSE_175 -label_COMPARE_BY_VALUE_179: - # LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) - # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) - # LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) - lw $a0, -40($fp) - lw $a1, -72($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -68($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 - # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 - lw $t0, -68($fp) - beq $t0, 0, label_TRUE_176 - # GOTO label_FALSE_175 - j label_FALSE_175 - label_COMPARE_STRING_178: - # LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) - # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) - # LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) - # Load strings for comparison - lw $v0, -40($fp) - lw $v1, -72($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -68($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_CONTINUE_180 - # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_CONTINUE_180 - lw $t0, -68($fp) - beq $t0, 0, label_CONTINUE_180 - # GOTO label_FALSE_175 - j label_FALSE_175 - label_CONTINUE_180: - # LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) - # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) - # LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -40($fp) - lw $v1, -72($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_181: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_182 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_181 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_182: - # Store result - sw $a2, -68($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 - # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 - lw $t0, -68($fp) - beq $t0, 0, label_TRUE_176 - label_FALSE_175: - # LOCAL local_a2i_aux_at_Parse_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -64($fp) - # GOTO label_END_177 -j label_END_177 -label_TRUE_176: - # LOCAL local_a2i_aux_at_Parse_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -64($fp) - label_END_177: -# LOCAL local_a2i_aux_at_Parse_internal_13 --> -56($fp) -# LOCAL local_a2i_aux_at_Parse_internal_15 --> -64($fp) -# Obtain value from -64($fp) -lw $v0, -64($fp) -lw $v0, 12($v0) -sw $v0, -56($fp) -# IF_ZERO local_a2i_aux_at_Parse_internal_13 GOTO label_FALSEIF_173 -# IF_ZERO local_a2i_aux_at_Parse_internal_13 GOTO label_FALSEIF_173 -lw $t0, -56($fp) -beq $t0, 0, label_FALSEIF_173 -# LOCAL local_a2i_aux_at_Parse_internal_18 --> -76($fp) -# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) -# local_a2i_aux_at_Parse_internal_18 = PARAM param_a2i_aux_at_Parse_s_0 -lw $t0, 0($fp) -sw $t0, -76($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_aux_at_Parse_internal_21 --> -88($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -88($fp) -# LOCAL local_a2i_aux_at_Parse_internal_20 --> -84($fp) -# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) -# LOCAL local_a2i_aux_at_Parse_internal_21 --> -88($fp) -# local_a2i_aux_at_Parse_internal_20 = local_a2i_aux_at_Parse_i_5 + local_a2i_aux_at_Parse_internal_21 -lw $t1, -24($fp) -lw $t0, 12($t1) -lw $t1, -88($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -84($fp) -# ARG local_a2i_aux_at_Parse_internal_20 -# LOCAL local_a2i_aux_at_Parse_internal_20 --> -84($fp) -lw $t0, -84($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_aux_at_Parse_internal_24 --> -100($fp) -# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) -# local_a2i_aux_at_Parse_internal_24 = PARAM param_a2i_aux_at_Parse_s_0 -lw $t0, 0($fp) -sw $t0, -100($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_aux_at_Parse_internal_24 --> -100($fp) -# LOCAL local_a2i_aux_at_Parse_internal_25 --> -104($fp) -# local_a2i_aux_at_Parse_internal_25 = VCALL local_a2i_aux_at_Parse_internal_24 length -# Save new self pointer in $s1 -lw $s1, -100($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 44($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -104($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_aux_at_Parse_internal_23 --> -96($fp) -# LOCAL local_a2i_aux_at_Parse_internal_25 --> -104($fp) -# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) -# local_a2i_aux_at_Parse_internal_23 = local_a2i_aux_at_Parse_internal_25 - local_a2i_aux_at_Parse_i_5 -lw $t1, -104($fp) -lw $t0, 12($t1) -lw $t1, -24($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -96($fp) -# LOCAL local_a2i_aux_at_Parse_internal_26 --> -108($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -108($fp) -# LOCAL local_a2i_aux_at_Parse_internal_22 --> -92($fp) -# LOCAL local_a2i_aux_at_Parse_internal_23 --> -96($fp) -# LOCAL local_a2i_aux_at_Parse_internal_26 --> -108($fp) -# local_a2i_aux_at_Parse_internal_22 = local_a2i_aux_at_Parse_internal_23 - local_a2i_aux_at_Parse_internal_26 -lw $t1, -96($fp) -lw $t0, 12($t1) -lw $t1, -108($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -92($fp) -# ARG local_a2i_aux_at_Parse_internal_22 -# LOCAL local_a2i_aux_at_Parse_internal_22 --> -92($fp) -lw $t0, -92($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_aux_at_Parse_internal_18 --> -76($fp) -# LOCAL local_a2i_aux_at_Parse_internal_19 --> -80($fp) -# local_a2i_aux_at_Parse_internal_19 = VCALL local_a2i_aux_at_Parse_internal_18 substr -# Save new self pointer in $s1 -lw $s1, -76($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 72($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -80($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# -# LOCAL local_a2i_aux_at_Parse_internal_19 --> -80($fp) -lw $t0, -80($fp) -sw $t0, 16($s1) -# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) -# LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) -# local_a2i_aux_at_Parse_i_5 = local_a2i_aux_at_Parse_j_2 -lw $t0, -12($fp) -sw $t0, -24($fp) -# LOCAL local_a2i_aux_at_Parse_internal_14 --> -60($fp) -# local_a2i_aux_at_Parse_internal_14 = -# GOTO label_ENDIF_174 -j label_ENDIF_174 -label_FALSEIF_173: - # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_19 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -128($fp) - # IF_ZERO local_a2i_aux_at_Parse_c_9 GOTO label_FALSE_185 - # IF_ZERO local_a2i_aux_at_Parse_c_9 GOTO label_FALSE_185 - lw $t0, -40($fp) - beq $t0, 0, label_FALSE_185 - # IF_ZERO local_a2i_aux_at_Parse_internal_31 GOTO label_FALSE_185 - # IF_ZERO local_a2i_aux_at_Parse_internal_31 GOTO label_FALSE_185 - lw $t0, -128($fp) - beq $t0, 0, label_FALSE_185 - # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) - # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) - # Comparing -40($fp) type with String - la $v0, String - lw $a0, -40($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -124($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_STRING_188 - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_STRING_188 - lw $t0, -124($fp) - beq $t0, 0, label_COMPARE_STRING_188 - # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) - # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) - # Comparing -40($fp) type with Bool - la $v0, Bool - lw $a0, -40($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -124($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_BY_VALUE_189 - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_BY_VALUE_189 - lw $t0, -124($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_189 - # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) - # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) - # Comparing -40($fp) type with Int - la $v0, Int - lw $a0, -40($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -124($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_BY_VALUE_189 - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_BY_VALUE_189 - lw $t0, -124($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_189 - # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) - # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) - # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) - # Load pointers and SUB - lw $a0, -40($fp) - lw $a1, -128($fp) - sub $a0, $a0, $a1 - sw $a0, -124($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 - lw $t0, -124($fp) - beq $t0, 0, label_TRUE_186 - # GOTO label_FALSE_185 - j label_FALSE_185 - label_COMPARE_BY_VALUE_189: - # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) - # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) - # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) - lw $a0, -40($fp) - lw $a1, -128($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -124($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 - lw $t0, -124($fp) - beq $t0, 0, label_TRUE_186 - # GOTO label_FALSE_185 - j label_FALSE_185 - label_COMPARE_STRING_188: - # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) - # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) - # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) - # Load strings for comparison - lw $v0, -40($fp) - lw $v1, -128($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -124($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_CONTINUE_190 - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_CONTINUE_190 - lw $t0, -124($fp) - beq $t0, 0, label_CONTINUE_190 - # GOTO label_FALSE_185 - j label_FALSE_185 - label_CONTINUE_190: - # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) - # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) - # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -40($fp) - lw $v1, -128($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_191: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_192 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_191 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_192: - # Store result - sw $a2, -124($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 - lw $t0, -124($fp) - beq $t0, 0, label_TRUE_186 - label_FALSE_185: - # LOCAL local_a2i_aux_at_Parse_internal_29 --> -120($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -120($fp) - # GOTO label_END_187 -j label_END_187 -label_TRUE_186: - # LOCAL local_a2i_aux_at_Parse_internal_29 --> -120($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -120($fp) - label_END_187: -# LOCAL local_a2i_aux_at_Parse_internal_27 --> -112($fp) -# LOCAL local_a2i_aux_at_Parse_internal_29 --> -120($fp) -# Obtain value from -120($fp) -lw $v0, -120($fp) -lw $v0, 12($v0) -sw $v0, -112($fp) -# IF_ZERO local_a2i_aux_at_Parse_internal_27 GOTO label_FALSEIF_183 -# IF_ZERO local_a2i_aux_at_Parse_internal_27 GOTO label_FALSEIF_183 -lw $t0, -112($fp) -beq $t0, 0, label_FALSEIF_183 -# LOCAL local_a2i_aux_at_Parse_internal_32 --> -132($fp) -# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) -# local_a2i_aux_at_Parse_internal_32 = PARAM param_a2i_aux_at_Parse_s_0 -lw $t0, 0($fp) -sw $t0, -132($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_aux_at_Parse_internal_35 --> -144($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -144($fp) -# LOCAL local_a2i_aux_at_Parse_internal_34 --> -140($fp) -# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) -# LOCAL local_a2i_aux_at_Parse_internal_35 --> -144($fp) -# local_a2i_aux_at_Parse_internal_34 = local_a2i_aux_at_Parse_i_5 + local_a2i_aux_at_Parse_internal_35 -lw $t1, -24($fp) -lw $t0, 12($t1) -lw $t1, -144($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -140($fp) -# ARG local_a2i_aux_at_Parse_internal_34 -# LOCAL local_a2i_aux_at_Parse_internal_34 --> -140($fp) -lw $t0, -140($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_aux_at_Parse_internal_38 --> -156($fp) -# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) -# local_a2i_aux_at_Parse_internal_38 = PARAM param_a2i_aux_at_Parse_s_0 -lw $t0, 0($fp) -sw $t0, -156($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_aux_at_Parse_internal_38 --> -156($fp) -# LOCAL local_a2i_aux_at_Parse_internal_39 --> -160($fp) -# local_a2i_aux_at_Parse_internal_39 = VCALL local_a2i_aux_at_Parse_internal_38 length -# Save new self pointer in $s1 -lw $s1, -156($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 44($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -160($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_aux_at_Parse_internal_37 --> -152($fp) -# LOCAL local_a2i_aux_at_Parse_internal_39 --> -160($fp) -# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) -# local_a2i_aux_at_Parse_internal_37 = local_a2i_aux_at_Parse_internal_39 - local_a2i_aux_at_Parse_i_5 -lw $t1, -160($fp) -lw $t0, 12($t1) -lw $t1, -24($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -152($fp) -# LOCAL local_a2i_aux_at_Parse_internal_40 --> -164($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -164($fp) -# LOCAL local_a2i_aux_at_Parse_internal_36 --> -148($fp) -# LOCAL local_a2i_aux_at_Parse_internal_37 --> -152($fp) -# LOCAL local_a2i_aux_at_Parse_internal_40 --> -164($fp) -# local_a2i_aux_at_Parse_internal_36 = local_a2i_aux_at_Parse_internal_37 - local_a2i_aux_at_Parse_internal_40 -lw $t1, -152($fp) -lw $t0, 12($t1) -lw $t1, -164($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -148($fp) -# ARG local_a2i_aux_at_Parse_internal_36 -# LOCAL local_a2i_aux_at_Parse_internal_36 --> -148($fp) -lw $t0, -148($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_aux_at_Parse_internal_32 --> -132($fp) -# LOCAL local_a2i_aux_at_Parse_internal_33 --> -136($fp) -# local_a2i_aux_at_Parse_internal_33 = VCALL local_a2i_aux_at_Parse_internal_32 substr -# Save new self pointer in $s1 -lw $s1, -132($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 72($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -136($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# -# LOCAL local_a2i_aux_at_Parse_internal_33 --> -136($fp) -lw $t0, -136($fp) -sw $t0, 16($s1) -# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) -# LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) -# local_a2i_aux_at_Parse_i_5 = local_a2i_aux_at_Parse_j_2 -lw $t0, -12($fp) -sw $t0, -24($fp) -# LOCAL local_a2i_aux_at_Parse_internal_28 --> -116($fp) -# local_a2i_aux_at_Parse_internal_28 = -# GOTO label_ENDIF_184 -j label_ENDIF_184 -label_FALSEIF_183: - # LOCAL local_a2i_aux_at_Parse_internal_43 --> -176($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 10 - sw $t0, 12($v0) - sw $v0, -176($fp) - # LOCAL local_a2i_aux_at_Parse_internal_42 --> -172($fp) - # LOCAL local_a2i_aux_at_Parse_int_0 --> -4($fp) - # LOCAL local_a2i_aux_at_Parse_internal_43 --> -176($fp) - # local_a2i_aux_at_Parse_internal_42 = local_a2i_aux_at_Parse_int_0 * local_a2i_aux_at_Parse_internal_43 - lw $t1, -4($fp) - lw $t0, 12($t1) - lw $t1, -176($fp) - lw $t2, 12($t1) - mul $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -172($fp) - # LOCAL local_a2i_aux_at_Parse_internal_46 --> -188($fp) - # local_a2i_aux_at_Parse_internal_46 = SELF - sw $s1, -188($fp) - # LOCAL local_a2i_aux_at_Parse_internal_44 --> -180($fp) - # LOCAL local_a2i_aux_at_Parse_internal_46 --> -188($fp) - # local_a2i_aux_at_Parse_internal_44 = local_a2i_aux_at_Parse_internal_46 - lw $t0, -188($fp) - sw $t0, -180($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_aux_at_Parse_internal_47 --> -192($fp) - # PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) - # local_a2i_aux_at_Parse_internal_47 = PARAM param_a2i_aux_at_Parse_s_0 - lw $t0, 0($fp) - sw $t0, -192($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_a2i_aux_at_Parse_i_5 - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - lw $t0, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_aux_at_Parse_internal_49 --> -200($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -200($fp) - # ARG local_a2i_aux_at_Parse_internal_49 - # LOCAL local_a2i_aux_at_Parse_internal_49 --> -200($fp) - lw $t0, -200($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_aux_at_Parse_internal_47 --> -192($fp) - # LOCAL local_a2i_aux_at_Parse_internal_48 --> -196($fp) - # local_a2i_aux_at_Parse_internal_48 = VCALL local_a2i_aux_at_Parse_internal_47 substr - # Save new self pointer in $s1 - lw $s1, -192($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 72($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -196($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_a2i_aux_at_Parse_internal_48 - # LOCAL local_a2i_aux_at_Parse_internal_48 --> -196($fp) - lw $t0, -196($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_aux_at_Parse_internal_44 --> -180($fp) - # LOCAL local_a2i_aux_at_Parse_internal_45 --> -184($fp) - # local_a2i_aux_at_Parse_internal_45 = VCALL local_a2i_aux_at_Parse_internal_44 c2i - # Save new self pointer in $s1 - lw $s1, -180($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 96($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -184($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_aux_at_Parse_internal_41 --> -168($fp) - # LOCAL local_a2i_aux_at_Parse_internal_42 --> -172($fp) - # LOCAL local_a2i_aux_at_Parse_internal_45 --> -184($fp) - # local_a2i_aux_at_Parse_internal_41 = local_a2i_aux_at_Parse_internal_42 + local_a2i_aux_at_Parse_internal_45 - lw $t1, -172($fp) - lw $t0, 12($t1) - lw $t1, -184($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -168($fp) - # LOCAL local_a2i_aux_at_Parse_int_0 --> -4($fp) - # LOCAL local_a2i_aux_at_Parse_internal_41 --> -168($fp) - # local_a2i_aux_at_Parse_int_0 = local_a2i_aux_at_Parse_internal_41 - lw $t0, -168($fp) - sw $t0, -4($fp) - # LOCAL local_a2i_aux_at_Parse_internal_51 --> -208($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -208($fp) - # LOCAL local_a2i_aux_at_Parse_internal_50 --> -204($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # LOCAL local_a2i_aux_at_Parse_internal_51 --> -208($fp) - # local_a2i_aux_at_Parse_internal_50 = local_a2i_aux_at_Parse_i_5 + local_a2i_aux_at_Parse_internal_51 - lw $t1, -24($fp) - lw $t0, 12($t1) - lw $t1, -208($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -204($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # LOCAL local_a2i_aux_at_Parse_internal_50 --> -204($fp) - # local_a2i_aux_at_Parse_i_5 = local_a2i_aux_at_Parse_internal_50 - lw $t0, -204($fp) - sw $t0, -24($fp) - # IF_ZERO local_a2i_aux_at_Parse_i_5 GOTO label_FALSE_195 - # IF_ZERO local_a2i_aux_at_Parse_i_5 GOTO label_FALSE_195 - lw $t0, -24($fp) - beq $t0, 0, label_FALSE_195 - # IF_ZERO local_a2i_aux_at_Parse_j_2 GOTO label_FALSE_195 - # IF_ZERO local_a2i_aux_at_Parse_j_2 GOTO label_FALSE_195 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_195 - # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # Comparing -24($fp) type with String - la $v0, String - lw $a0, -24($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -224($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_STRING_198 - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_STRING_198 - lw $t0, -224($fp) - beq $t0, 0, label_COMPARE_STRING_198 - # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # Comparing -24($fp) type with Bool - la $v0, Bool - lw $a0, -24($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -224($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_BY_VALUE_199 - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_BY_VALUE_199 - lw $t0, -224($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_199 - # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # Comparing -24($fp) type with Int - la $v0, Int - lw $a0, -24($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -224($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_BY_VALUE_199 - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_BY_VALUE_199 - lw $t0, -224($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_199 - # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) - # Load pointers and SUB - lw $a0, -24($fp) - lw $a1, -12($fp) - sub $a0, $a0, $a1 - sw $a0, -224($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 - lw $t0, -224($fp) - beq $t0, 0, label_TRUE_196 - # GOTO label_FALSE_195 - j label_FALSE_195 - label_COMPARE_BY_VALUE_199: - # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) - lw $a0, -24($fp) - lw $a1, -12($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -224($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 - lw $t0, -224($fp) - beq $t0, 0, label_TRUE_196 - # GOTO label_FALSE_195 - j label_FALSE_195 - label_COMPARE_STRING_198: - # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) - # Load strings for comparison - lw $v0, -24($fp) - lw $v1, -12($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -224($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_CONTINUE_200 - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_CONTINUE_200 - lw $t0, -224($fp) - beq $t0, 0, label_CONTINUE_200 - # GOTO label_FALSE_195 - j label_FALSE_195 - label_CONTINUE_200: - # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -24($fp) - lw $v1, -12($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_201: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_202 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_201 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_202: - # Store result - sw $a2, -224($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 - lw $t0, -224($fp) - beq $t0, 0, label_TRUE_196 - label_FALSE_195: - # LOCAL local_a2i_aux_at_Parse_internal_54 --> -220($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -220($fp) - # GOTO label_END_197 -j label_END_197 -label_TRUE_196: - # LOCAL local_a2i_aux_at_Parse_internal_54 --> -220($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -220($fp) - label_END_197: -# LOCAL local_a2i_aux_at_Parse_internal_52 --> -212($fp) -# LOCAL local_a2i_aux_at_Parse_internal_54 --> -220($fp) -# Obtain value from -220($fp) -lw $v0, -220($fp) -lw $v0, 12($v0) -sw $v0, -212($fp) -# IF_ZERO local_a2i_aux_at_Parse_internal_52 GOTO label_FALSEIF_193 -# IF_ZERO local_a2i_aux_at_Parse_internal_52 GOTO label_FALSEIF_193 -lw $t0, -212($fp) -beq $t0, 0, label_FALSEIF_193 -# LOCAL local_a2i_aux_at_Parse_internal_56 --> -228($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_20 -sw $t0, 12($v0) -li $t0, 0 -sw $t0, 16($v0) -sw $v0, -228($fp) -# -# LOCAL local_a2i_aux_at_Parse_internal_56 --> -228($fp) -lw $t0, -228($fp) -sw $t0, 16($s1) -# LOCAL local_a2i_aux_at_Parse_internal_53 --> -216($fp) -# local_a2i_aux_at_Parse_internal_53 = -# GOTO label_ENDIF_194 -j label_ENDIF_194 -label_FALSEIF_193: - # LOCAL local_a2i_aux_at_Parse_internal_57 --> -232($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_21 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -232($fp) - # LOCAL local_a2i_aux_at_Parse_internal_53 --> -216($fp) - # LOCAL local_a2i_aux_at_Parse_internal_57 --> -232($fp) - # local_a2i_aux_at_Parse_internal_53 = local_a2i_aux_at_Parse_internal_57 - lw $t0, -232($fp) - sw $t0, -216($fp) - label_ENDIF_194: -# LOCAL local_a2i_aux_at_Parse_internal_28 --> -116($fp) -# LOCAL local_a2i_aux_at_Parse_internal_53 --> -216($fp) -# local_a2i_aux_at_Parse_internal_28 = local_a2i_aux_at_Parse_internal_53 -lw $t0, -216($fp) -sw $t0, -116($fp) -label_ENDIF_184: -# LOCAL local_a2i_aux_at_Parse_internal_14 --> -60($fp) -# LOCAL local_a2i_aux_at_Parse_internal_28 --> -116($fp) -# local_a2i_aux_at_Parse_internal_14 = local_a2i_aux_at_Parse_internal_28 -lw $t0, -116($fp) -sw $t0, -60($fp) -label_ENDIF_174: -# GOTO label_WHILE_169 -j label_WHILE_169 -label_WHILE_END_170: - # RETURN local_a2i_aux_at_Parse_int_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_a2i_aux_at_Parse. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 240 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# __Main__attrib__g__init implementation. -# @Params: -__Main__attrib__g__init: - # Allocate stack frame for function __Main__attrib__g__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # local_ttrib__g__init_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # local_ttrib__g__init_internal_1 = local_ttrib__g__init_internal_3 - lw $t0, -16($fp) - sw $t0, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) - # local_ttrib__g__init_internal_2 = VCALL local_ttrib__g__init_internal_1 read_input - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 80($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_ttrib__g__init_internal_2 - lw $v0, -12($fp) - # Deallocate stack frame for function __Main__attrib__g__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_main_at_Main_internal_2 = GETATTRIBUTE g Main - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - lw $t0, 20($s1) - sw $t0, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 print_V - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 36($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_main_at_Main_internal_5 = GETATTRIBUTE g Main - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - lw $t0, 20($s1) - sw $t0, -24($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 - lw $t0, -24($fp) - sw $t0, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 print_E - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 116($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_4 - lw $v0, -20($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __VList__attrib__car__init implementation. -# @Params: -__VList__attrib__car__init: - # Allocate stack frame for function __VList__attrib__car__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __VList__attrib__car__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_VList implementation. -# @Params: -function_isNil_at_VList: - # Allocate stack frame for function function_isNil_at_VList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_VList_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_isNil_at_VList_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_isNil_at_VList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_head_at_VList implementation. -# @Params: -function_head_at_VList: - # Allocate stack frame for function function_head_at_VList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_head_at_VList_internal_2 --> -12($fp) - # local_head_at_VList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_head_at_VList_internal_0 --> -4($fp) - # LOCAL local_head_at_VList_internal_2 --> -12($fp) - # local_head_at_VList_internal_0 = local_head_at_VList_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_head_at_VList_internal_0 --> -4($fp) - # LOCAL local_head_at_VList_internal_1 --> -8($fp) - # local_head_at_VList_internal_1 = VCALL local_head_at_VList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 76($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_head_at_VList_internal_3 = GETATTRIBUTE car VList - # LOCAL local_head_at_VList_internal_3 --> -16($fp) - lw $t0, 12($s1) - sw $t0, -16($fp) - # RETURN local_head_at_VList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_head_at_VList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_tail_at_VList implementation. -# @Params: -function_tail_at_VList: - # Allocate stack frame for function function_tail_at_VList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_tail_at_VList_internal_2 --> -12($fp) - # local_tail_at_VList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_tail_at_VList_internal_0 --> -4($fp) - # LOCAL local_tail_at_VList_internal_2 --> -12($fp) - # local_tail_at_VList_internal_0 = local_tail_at_VList_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_tail_at_VList_internal_0 --> -4($fp) - # LOCAL local_tail_at_VList_internal_1 --> -8($fp) - # local_tail_at_VList_internal_1 = VCALL local_tail_at_VList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 76($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_tail_at_VList_internal_3 --> -16($fp) - # local_tail_at_VList_internal_3 = SELF - sw $s1, -16($fp) - # RETURN local_tail_at_VList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_tail_at_VList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cons_at_VList implementation. -# @Params: -# 0($fp) = param_cons_at_VList_v_0 -function_cons_at_VList: - # Allocate stack frame for function function_cons_at_VList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_cons_at_VList_internal_2 --> -12($fp) - # local_cons_at_VList_internal_2 = ALLOCATE VCons - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, VCons - sw $t0, 12($v0) - li $t0, 5 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, VCons_start - sw $t0, 4($v0) - # Load type offset - li $t0, 40 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __VList__attrib__car__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __VCons__attrib__cdr__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -12($fp) - # LOCAL local_cons_at_VList_internal_0 --> -4($fp) - # LOCAL local_cons_at_VList_internal_2 --> -12($fp) - # local_cons_at_VList_internal_0 = local_cons_at_VList_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cons_at_VList_v_0 - # PARAM param_cons_at_VList_v_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cons_at_VList_internal_3 --> -16($fp) - # local_cons_at_VList_internal_3 = SELF - sw $s1, -16($fp) - # ARG local_cons_at_VList_internal_3 - # LOCAL local_cons_at_VList_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cons_at_VList_internal_0 --> -4($fp) - # LOCAL local_cons_at_VList_internal_1 --> -8($fp) - # local_cons_at_VList_internal_1 = VCALL local_cons_at_VList_internal_0 init - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 28($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_cons_at_VList_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_cons_at_VList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_print_at_VList implementation. -# @Params: -function_print_at_VList: - # Allocate stack frame for function function_print_at_VList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_print_at_VList_internal_2 --> -12($fp) - # local_print_at_VList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_print_at_VList_internal_0 --> -4($fp) - # LOCAL local_print_at_VList_internal_2 --> -12($fp) - # local_print_at_VList_internal_0 = local_print_at_VList_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_VList_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_22 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -16($fp) - # ARG local_print_at_VList_internal_3 - # LOCAL local_print_at_VList_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_VList_internal_0 --> -4($fp) - # LOCAL local_print_at_VList_internal_1 --> -8($fp) - # local_print_at_VList_internal_1 = VCALL local_print_at_VList_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 120($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_at_VList_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_print_at_VList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __VCons__attrib__cdr__init implementation. -# @Params: -__VCons__attrib__cdr__init: - # Allocate stack frame for function __VCons__attrib__cdr__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __VCons__attrib__cdr__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_VCons implementation. -# @Params: -function_isNil_at_VCons: - # Allocate stack frame for function function_isNil_at_VCons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_VCons_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_isNil_at_VCons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_isNil_at_VCons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_head_at_VCons implementation. -# @Params: -function_head_at_VCons: - # Allocate stack frame for function function_head_at_VCons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_head_at_VCons_internal_0 = GETATTRIBUTE car VCons - # LOCAL local_head_at_VCons_internal_0 --> -4($fp) - lw $t0, 12($s1) - sw $t0, -4($fp) - # RETURN local_head_at_VCons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_head_at_VCons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_tail_at_VCons implementation. -# @Params: -function_tail_at_VCons: - # Allocate stack frame for function function_tail_at_VCons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_tail_at_VCons_internal_0 = GETATTRIBUTE cdr VCons - # LOCAL local_tail_at_VCons_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_tail_at_VCons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_tail_at_VCons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_VCons implementation. -# @Params: -# 0($fp) = param_init_at_VCons_v_0 -# 4($fp) = param_init_at_VCons_rest_1 -function_init_at_VCons: - # Allocate stack frame for function function_init_at_VCons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_VCons_v_0 --> 4($fp) - lw $t0, 4($fp) - sw $t0, 12($s1) - # - # PARAM param_init_at_VCons_rest_1 --> 0($fp) - lw $t0, 0($fp) - sw $t0, 16($s1) - # LOCAL local_init_at_VCons_internal_0 --> -4($fp) - # local_init_at_VCons_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_init_at_VCons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_init_at_VCons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_print_at_VCons implementation. -# @Params: -function_print_at_VCons: - # Allocate stack frame for function function_print_at_VCons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_print_at_VCons_internal_2 = GETATTRIBUTE car VCons - # LOCAL local_print_at_VCons_internal_2 --> -12($fp) - lw $t0, 12($s1) - sw $t0, -12($fp) - # LOCAL local_print_at_VCons_internal_0 --> -4($fp) - # LOCAL local_print_at_VCons_internal_2 --> -12($fp) - # local_print_at_VCons_internal_0 = local_print_at_VCons_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_VCons_internal_0 --> -4($fp) - # LOCAL local_print_at_VCons_internal_1 --> -8($fp) - # local_print_at_VCons_internal_1 = VCALL local_print_at_VCons_internal_0 print - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_print_at_VCons_internal_5 = GETATTRIBUTE cdr VCons - # LOCAL local_print_at_VCons_internal_5 --> -24($fp) - lw $t0, 16($s1) - sw $t0, -24($fp) - # LOCAL local_print_at_VCons_internal_3 --> -16($fp) - # LOCAL local_print_at_VCons_internal_5 --> -24($fp) - # local_print_at_VCons_internal_3 = local_print_at_VCons_internal_5 - lw $t0, -24($fp) - sw $t0, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_VCons_internal_3 --> -16($fp) - # LOCAL local_print_at_VCons_internal_4 --> -20($fp) - # local_print_at_VCons_internal_4 = VCALL local_print_at_VCons_internal_3 print - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_at_VCons_internal_4 - lw $v0, -20($fp) - # Deallocate stack frame for function function_print_at_VCons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __EList__attrib__car__init implementation. -# @Params: -__EList__attrib__car__init: - # Allocate stack frame for function __EList__attrib__car__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __EList__attrib__car__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_EList implementation. -# @Params: -function_isNil_at_EList: - # Allocate stack frame for function function_isNil_at_EList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_EList_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_isNil_at_EList_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_isNil_at_EList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_head_at_EList implementation. -# @Params: -function_head_at_EList: - # Allocate stack frame for function function_head_at_EList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_head_at_EList_internal_2 --> -12($fp) - # local_head_at_EList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_head_at_EList_internal_0 --> -4($fp) - # LOCAL local_head_at_EList_internal_2 --> -12($fp) - # local_head_at_EList_internal_0 = local_head_at_EList_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_head_at_EList_internal_0 --> -4($fp) - # LOCAL local_head_at_EList_internal_1 --> -8($fp) - # local_head_at_EList_internal_1 = VCALL local_head_at_EList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 76($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_head_at_EList_internal_3 = GETATTRIBUTE car EList - # LOCAL local_head_at_EList_internal_3 --> -16($fp) - lw $t0, 12($s1) - sw $t0, -16($fp) - # RETURN local_head_at_EList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_head_at_EList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_tail_at_EList implementation. -# @Params: -function_tail_at_EList: - # Allocate stack frame for function function_tail_at_EList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_tail_at_EList_internal_2 --> -12($fp) - # local_tail_at_EList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_tail_at_EList_internal_0 --> -4($fp) - # LOCAL local_tail_at_EList_internal_2 --> -12($fp) - # local_tail_at_EList_internal_0 = local_tail_at_EList_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_tail_at_EList_internal_0 --> -4($fp) - # LOCAL local_tail_at_EList_internal_1 --> -8($fp) - # local_tail_at_EList_internal_1 = VCALL local_tail_at_EList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 76($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_tail_at_EList_internal_3 --> -16($fp) - # local_tail_at_EList_internal_3 = SELF - sw $s1, -16($fp) - # RETURN local_tail_at_EList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_tail_at_EList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cons_at_EList implementation. -# @Params: -# 0($fp) = param_cons_at_EList_e_0 -function_cons_at_EList: - # Allocate stack frame for function function_cons_at_EList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_cons_at_EList_internal_2 --> -12($fp) - # local_cons_at_EList_internal_2 = ALLOCATE ECons - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, ECons - sw $t0, 12($v0) - li $t0, 5 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, ECons_start - sw $t0, 4($v0) - # Load type offset - li $t0, 48 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __EList__attrib__car__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __ECons__attrib__cdr__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -12($fp) - # LOCAL local_cons_at_EList_internal_0 --> -4($fp) - # LOCAL local_cons_at_EList_internal_2 --> -12($fp) - # local_cons_at_EList_internal_0 = local_cons_at_EList_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cons_at_EList_e_0 - # PARAM param_cons_at_EList_e_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cons_at_EList_internal_3 --> -16($fp) - # local_cons_at_EList_internal_3 = SELF - sw $s1, -16($fp) - # ARG local_cons_at_EList_internal_3 - # LOCAL local_cons_at_EList_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cons_at_EList_internal_0 --> -4($fp) - # LOCAL local_cons_at_EList_internal_1 --> -8($fp) - # local_cons_at_EList_internal_1 = VCALL local_cons_at_EList_internal_0 init - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 28($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_cons_at_EList_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_cons_at_EList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_append_at_EList implementation. -# @Params: -# 0($fp) = param_append_at_EList_l_0 -function_append_at_EList: -# Allocate stack frame for function function_append_at_EList. -subu $sp, $sp, 68 -sw $ra, 4($sp) -sw $fp, 0($sp) -addu $fp, $sp, 68 -# LOCAL local_append_at_EList_internal_4 --> -20($fp) -# local_append_at_EList_internal_4 = SELF -sw $s1, -20($fp) -# LOCAL local_append_at_EList_internal_2 --> -12($fp) -# LOCAL local_append_at_EList_internal_4 --> -20($fp) -# local_append_at_EList_internal_2 = local_append_at_EList_internal_4 -lw $t0, -20($fp) -sw $t0, -12($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_append_at_EList_internal_2 --> -12($fp) -# LOCAL local_append_at_EList_internal_3 --> -16($fp) -# local_append_at_EList_internal_3 = VCALL local_append_at_EList_internal_2 isNil -# Save new self pointer in $s1 -lw $s1, -12($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 8($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -16($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_append_at_EList_internal_0 --> -4($fp) -# LOCAL local_append_at_EList_internal_3 --> -16($fp) -# Obtain value from -16($fp) -lw $v0, -16($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_append_at_EList_internal_0 GOTO label_FALSEIF_203 -# IF_ZERO local_append_at_EList_internal_0 GOTO label_FALSEIF_203 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_203 -# LOCAL local_append_at_EList_internal_1 --> -8($fp) -# PARAM param_append_at_EList_l_0 --> 0($fp) -# local_append_at_EList_internal_1 = PARAM param_append_at_EList_l_0 -lw $t0, 0($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_204 -j label_ENDIF_204 -label_FALSEIF_203: - # LOCAL local_append_at_EList_internal_11 --> -48($fp) - # local_append_at_EList_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_append_at_EList_internal_9 --> -40($fp) - # LOCAL local_append_at_EList_internal_11 --> -48($fp) - # local_append_at_EList_internal_9 = local_append_at_EList_internal_11 - lw $t0, -48($fp) - sw $t0, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_append_at_EList_internal_9 --> -40($fp) - # LOCAL local_append_at_EList_internal_10 --> -44($fp) - # local_append_at_EList_internal_10 = VCALL local_append_at_EList_internal_9 tail - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 48($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_append_at_EList_internal_7 --> -32($fp) - # LOCAL local_append_at_EList_internal_10 --> -44($fp) - # local_append_at_EList_internal_7 = local_append_at_EList_internal_10 - lw $t0, -44($fp) - sw $t0, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_append_at_EList_l_0 - # PARAM param_append_at_EList_l_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_append_at_EList_internal_7 --> -32($fp) - # LOCAL local_append_at_EList_internal_8 --> -36($fp) - # local_append_at_EList_internal_8 = VCALL local_append_at_EList_internal_7 append - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 32($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_append_at_EList_internal_5 --> -24($fp) - # LOCAL local_append_at_EList_internal_8 --> -36($fp) - # local_append_at_EList_internal_5 = local_append_at_EList_internal_8 - lw $t0, -36($fp) - sw $t0, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_append_at_EList_internal_14 --> -60($fp) - # local_append_at_EList_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_append_at_EList_internal_12 --> -52($fp) - # LOCAL local_append_at_EList_internal_14 --> -60($fp) - # local_append_at_EList_internal_12 = local_append_at_EList_internal_14 - lw $t0, -60($fp) - sw $t0, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_append_at_EList_internal_12 --> -52($fp) - # LOCAL local_append_at_EList_internal_13 --> -56($fp) - # local_append_at_EList_internal_13 = VCALL local_append_at_EList_internal_12 head - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_append_at_EList_internal_13 - # LOCAL local_append_at_EList_internal_13 --> -56($fp) - lw $t0, -56($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_append_at_EList_internal_5 --> -24($fp) - # LOCAL local_append_at_EList_internal_6 --> -28($fp) - # local_append_at_EList_internal_6 = VCALL local_append_at_EList_internal_5 cons - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 60($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_append_at_EList_internal_1 --> -8($fp) - # LOCAL local_append_at_EList_internal_6 --> -28($fp) - # local_append_at_EList_internal_1 = local_append_at_EList_internal_6 - lw $t0, -28($fp) - sw $t0, -8($fp) - label_ENDIF_204: -# RETURN local_append_at_EList_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_append_at_EList. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 68 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_print_at_EList implementation. -# @Params: -function_print_at_EList: - # Allocate stack frame for function function_print_at_EList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_print_at_EList_internal_2 --> -12($fp) - # local_print_at_EList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_print_at_EList_internal_0 --> -4($fp) - # LOCAL local_print_at_EList_internal_2 --> -12($fp) - # local_print_at_EList_internal_0 = local_print_at_EList_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_EList_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_23 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -16($fp) - # ARG local_print_at_EList_internal_3 - # LOCAL local_print_at_EList_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_EList_internal_0 --> -4($fp) - # LOCAL local_print_at_EList_internal_1 --> -8($fp) - # local_print_at_EList_internal_1 = VCALL local_print_at_EList_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 120($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_at_EList_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_print_at_EList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __ECons__attrib__cdr__init implementation. -# @Params: -__ECons__attrib__cdr__init: - # Allocate stack frame for function __ECons__attrib__cdr__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __ECons__attrib__cdr__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_ECons implementation. -# @Params: -function_isNil_at_ECons: - # Allocate stack frame for function function_isNil_at_ECons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_ECons_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_isNil_at_ECons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_isNil_at_ECons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_head_at_ECons implementation. -# @Params: -function_head_at_ECons: - # Allocate stack frame for function function_head_at_ECons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_head_at_ECons_internal_0 = GETATTRIBUTE car ECons - # LOCAL local_head_at_ECons_internal_0 --> -4($fp) - lw $t0, 12($s1) - sw $t0, -4($fp) - # RETURN local_head_at_ECons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_head_at_ECons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_tail_at_ECons implementation. -# @Params: -function_tail_at_ECons: - # Allocate stack frame for function function_tail_at_ECons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_tail_at_ECons_internal_0 = GETATTRIBUTE cdr ECons - # LOCAL local_tail_at_ECons_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_tail_at_ECons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_tail_at_ECons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_ECons implementation. -# @Params: -# 0($fp) = param_init_at_ECons_e_0 -# 4($fp) = param_init_at_ECons_rest_1 -function_init_at_ECons: - # Allocate stack frame for function function_init_at_ECons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_ECons_e_0 --> 4($fp) - lw $t0, 4($fp) - sw $t0, 12($s1) - # - # PARAM param_init_at_ECons_rest_1 --> 0($fp) - lw $t0, 0($fp) - sw $t0, 16($s1) - # LOCAL local_init_at_ECons_internal_0 --> -4($fp) - # local_init_at_ECons_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_init_at_ECons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_init_at_ECons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_print_at_ECons implementation. -# @Params: -function_print_at_ECons: - # Allocate stack frame for function function_print_at_ECons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_print_at_ECons_internal_2 = GETATTRIBUTE car ECons - # LOCAL local_print_at_ECons_internal_2 --> -12($fp) - lw $t0, 12($s1) - sw $t0, -12($fp) - # LOCAL local_print_at_ECons_internal_0 --> -4($fp) - # LOCAL local_print_at_ECons_internal_2 --> -12($fp) - # local_print_at_ECons_internal_0 = local_print_at_ECons_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_ECons_internal_0 --> -4($fp) - # LOCAL local_print_at_ECons_internal_1 --> -8($fp) - # local_print_at_ECons_internal_1 = VCALL local_print_at_ECons_internal_0 print - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_print_at_ECons_internal_5 = GETATTRIBUTE cdr ECons - # LOCAL local_print_at_ECons_internal_5 --> -24($fp) - lw $t0, 16($s1) - sw $t0, -24($fp) - # LOCAL local_print_at_ECons_internal_3 --> -16($fp) - # LOCAL local_print_at_ECons_internal_5 --> -24($fp) - # local_print_at_ECons_internal_3 = local_print_at_ECons_internal_5 - lw $t0, -24($fp) - sw $t0, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_ECons_internal_3 --> -16($fp) - # LOCAL local_print_at_ECons_internal_4 --> -20($fp) - # local_print_at_ECons_internal_4 = VCALL local_print_at_ECons_internal_3 print - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_at_ECons_internal_4 - lw $v0, -20($fp) - # Deallocate stack frame for function function_print_at_ECons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Edge__attrib__from__init implementation. -# @Params: -__Edge__attrib__from__init: - # Allocate stack frame for function __Edge__attrib__from__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__from__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__from__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Edge__attrib__from__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Edge__attrib__to__init implementation. -# @Params: -__Edge__attrib__to__init: - # Allocate stack frame for function __Edge__attrib__to__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__to__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__to__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Edge__attrib__to__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Edge__attrib__weight__init implementation. -# @Params: -__Edge__attrib__weight__init: - # Allocate stack frame for function __Edge__attrib__weight__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__weight__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__weight__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Edge__attrib__weight__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_Edge implementation. -# @Params: -# 0($fp) = param_init_at_Edge_f_0 -# 4($fp) = param_init_at_Edge_t_1 -# 8($fp) = param_init_at_Edge_w_2 -function_init_at_Edge: - # Allocate stack frame for function function_init_at_Edge. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_Edge_f_0 --> 8($fp) - lw $t0, 8($fp) - sw $t0, 12($s1) - # - # PARAM param_init_at_Edge_t_1 --> 4($fp) - lw $t0, 4($fp) - sw $t0, 16($s1) - # - # PARAM param_init_at_Edge_w_2 --> 0($fp) - lw $t0, 0($fp) - sw $t0, 20($s1) - # LOCAL local_init_at_Edge_internal_0 --> -4($fp) - # local_init_at_Edge_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_init_at_Edge_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_init_at_Edge. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 12 - jr $ra - # Function END - - -# function_print_at_Edge implementation. -# @Params: -function_print_at_Edge: - # Allocate stack frame for function function_print_at_Edge. - subu $sp, $sp, 104 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 104 - # LOCAL local_print_at_Edge_internal_2 --> -12($fp) - # local_print_at_Edge_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_print_at_Edge_internal_0 --> -4($fp) - # LOCAL local_print_at_Edge_internal_2 --> -12($fp) - # local_print_at_Edge_internal_0 = local_print_at_Edge_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Edge_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_24 - sw $t0, 12($v0) - li $t0, 2 - sw $t0, 16($v0) - sw $v0, -16($fp) - # ARG local_print_at_Edge_internal_3 - # LOCAL local_print_at_Edge_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Edge_internal_0 --> -4($fp) - # LOCAL local_print_at_Edge_internal_1 --> -8($fp) - # local_print_at_Edge_internal_1 = VCALL local_print_at_Edge_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 120($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Edge_internal_6 --> -28($fp) - # local_print_at_Edge_internal_6 = SELF - sw $s1, -28($fp) - # LOCAL local_print_at_Edge_internal_4 --> -20($fp) - # LOCAL local_print_at_Edge_internal_6 --> -28($fp) - # local_print_at_Edge_internal_4 = local_print_at_Edge_internal_6 - lw $t0, -28($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Edge_internal_7 = GETATTRIBUTE from Edge - # LOCAL local_print_at_Edge_internal_7 --> -32($fp) - lw $t0, 12($s1) - sw $t0, -32($fp) - # ARG local_print_at_Edge_internal_7 - # LOCAL local_print_at_Edge_internal_7 --> -32($fp) - lw $t0, -32($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Edge_internal_4 --> -20($fp) - # LOCAL local_print_at_Edge_internal_5 --> -24($fp) - # local_print_at_Edge_internal_5 = VCALL local_print_at_Edge_internal_4 out_int - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 108($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Edge_internal_10 --> -44($fp) - # local_print_at_Edge_internal_10 = SELF - sw $s1, -44($fp) - # LOCAL local_print_at_Edge_internal_8 --> -36($fp) - # LOCAL local_print_at_Edge_internal_10 --> -44($fp) - # local_print_at_Edge_internal_8 = local_print_at_Edge_internal_10 - lw $t0, -44($fp) - sw $t0, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Edge_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_25 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -48($fp) - # ARG local_print_at_Edge_internal_11 - # LOCAL local_print_at_Edge_internal_11 --> -48($fp) - lw $t0, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Edge_internal_8 --> -36($fp) - # LOCAL local_print_at_Edge_internal_9 --> -40($fp) - # local_print_at_Edge_internal_9 = VCALL local_print_at_Edge_internal_8 out_string - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 120($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Edge_internal_14 --> -60($fp) - # local_print_at_Edge_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_print_at_Edge_internal_12 --> -52($fp) - # LOCAL local_print_at_Edge_internal_14 --> -60($fp) - # local_print_at_Edge_internal_12 = local_print_at_Edge_internal_14 - lw $t0, -60($fp) - sw $t0, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Edge_internal_15 = GETATTRIBUTE to Edge - # LOCAL local_print_at_Edge_internal_15 --> -64($fp) - lw $t0, 16($s1) - sw $t0, -64($fp) - # ARG local_print_at_Edge_internal_15 - # LOCAL local_print_at_Edge_internal_15 --> -64($fp) - lw $t0, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Edge_internal_12 --> -52($fp) - # LOCAL local_print_at_Edge_internal_13 --> -56($fp) - # local_print_at_Edge_internal_13 = VCALL local_print_at_Edge_internal_12 out_int - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 108($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Edge_internal_18 --> -76($fp) - # local_print_at_Edge_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_print_at_Edge_internal_16 --> -68($fp) - # LOCAL local_print_at_Edge_internal_18 --> -76($fp) - # local_print_at_Edge_internal_16 = local_print_at_Edge_internal_18 - lw $t0, -76($fp) - sw $t0, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Edge_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_26 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -80($fp) - # ARG local_print_at_Edge_internal_19 - # LOCAL local_print_at_Edge_internal_19 --> -80($fp) - lw $t0, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Edge_internal_16 --> -68($fp) - # LOCAL local_print_at_Edge_internal_17 --> -72($fp) - # local_print_at_Edge_internal_17 = VCALL local_print_at_Edge_internal_16 out_string - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 120($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Edge_internal_22 --> -92($fp) - # local_print_at_Edge_internal_22 = SELF - sw $s1, -92($fp) - # LOCAL local_print_at_Edge_internal_20 --> -84($fp) - # LOCAL local_print_at_Edge_internal_22 --> -92($fp) - # local_print_at_Edge_internal_20 = local_print_at_Edge_internal_22 - lw $t0, -92($fp) - sw $t0, -84($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Edge_internal_23 = GETATTRIBUTE weight Edge - # LOCAL local_print_at_Edge_internal_23 --> -96($fp) - lw $t0, 20($s1) - sw $t0, -96($fp) - # ARG local_print_at_Edge_internal_23 - # LOCAL local_print_at_Edge_internal_23 --> -96($fp) - lw $t0, -96($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Edge_internal_20 --> -84($fp) - # LOCAL local_print_at_Edge_internal_21 --> -88($fp) - # local_print_at_Edge_internal_21 = VCALL local_print_at_Edge_internal_20 out_int - # Save new self pointer in $s1 - lw $s1, -84($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 108($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -88($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_at_Edge_internal_21 - lw $v0, -88($fp) - # Deallocate stack frame for function function_print_at_Edge. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 104 - jr $ra - # Function END - - -# __Vertice__attrib__num__init implementation. -# @Params: -__Vertice__attrib__num__init: - # Allocate stack frame for function __Vertice__attrib__num__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local___attrib__num__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local___attrib__num__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Vertice__attrib__num__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Vertice__attrib__out__init implementation. -# @Params: -__Vertice__attrib__out__init: - # Allocate stack frame for function __Vertice__attrib__out__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local___attrib__out__init_internal_1 --> -8($fp) - # local___attrib__out__init_internal_1 = ALLOCATE EList - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, EList - sw $t0, 12($v0) - li $t0, 5 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, EList_start - sw $t0, 4($v0) - # Load type offset - li $t0, 44 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __EList__attrib__car__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -8($fp) - # RETURN local___attrib__out__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Vertice__attrib__out__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_outgoing_at_Vertice implementation. -# @Params: -function_outgoing_at_Vertice: - # Allocate stack frame for function function_outgoing_at_Vertice. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_outgoing_at_Vertice_internal_0 = GETATTRIBUTE out Vertice - # LOCAL local_outgoing_at_Vertice_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_outgoing_at_Vertice_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_outgoing_at_Vertice. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_number_at_Vertice implementation. -# @Params: -function_number_at_Vertice: - # Allocate stack frame for function function_number_at_Vertice. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_number_at_Vertice_internal_0 = GETATTRIBUTE num Vertice - # LOCAL local_number_at_Vertice_internal_0 --> -4($fp) - lw $t0, 12($s1) - sw $t0, -4($fp) - # RETURN local_number_at_Vertice_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_number_at_Vertice. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_Vertice implementation. -# @Params: -# 0($fp) = param_init_at_Vertice_n_0 -function_init_at_Vertice: - # Allocate stack frame for function function_init_at_Vertice. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_Vertice_n_0 --> 0($fp) - lw $t0, 0($fp) - sw $t0, 12($s1) - # LOCAL local_init_at_Vertice_internal_0 --> -4($fp) - # local_init_at_Vertice_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_init_at_Vertice_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_init_at_Vertice. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_add_out_at_Vertice implementation. -# @Params: -# 0($fp) = param_add_out_at_Vertice_s_0 -function_add_out_at_Vertice: - # Allocate stack frame for function function_add_out_at_Vertice. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_add_out_at_Vertice_internal_2 = GETATTRIBUTE out Vertice - # LOCAL local_add_out_at_Vertice_internal_2 --> -12($fp) - lw $t0, 16($s1) - sw $t0, -12($fp) - # LOCAL local_add_out_at_Vertice_internal_0 --> -4($fp) - # LOCAL local_add_out_at_Vertice_internal_2 --> -12($fp) - # local_add_out_at_Vertice_internal_0 = local_add_out_at_Vertice_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_add_out_at_Vertice_s_0 - # PARAM param_add_out_at_Vertice_s_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_add_out_at_Vertice_internal_0 --> -4($fp) - # LOCAL local_add_out_at_Vertice_internal_1 --> -8($fp) - # local_add_out_at_Vertice_internal_1 = VCALL local_add_out_at_Vertice_internal_0 cons - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 60($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_add_out_at_Vertice_internal_1 --> -8($fp) - lw $t0, -8($fp) - sw $t0, 16($s1) - # LOCAL local_add_out_at_Vertice_internal_3 --> -16($fp) - # local_add_out_at_Vertice_internal_3 = SELF - sw $s1, -16($fp) - # RETURN local_add_out_at_Vertice_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_add_out_at_Vertice. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_print_at_Vertice implementation. -# @Params: -function_print_at_Vertice: - # Allocate stack frame for function function_print_at_Vertice. - subu $sp, $sp, 36 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 36 - # LOCAL local_print_at_Vertice_internal_2 --> -12($fp) - # local_print_at_Vertice_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_print_at_Vertice_internal_0 --> -4($fp) - # LOCAL local_print_at_Vertice_internal_2 --> -12($fp) - # local_print_at_Vertice_internal_0 = local_print_at_Vertice_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Vertice_internal_3 = GETATTRIBUTE num Vertice - # LOCAL local_print_at_Vertice_internal_3 --> -16($fp) - lw $t0, 12($s1) - sw $t0, -16($fp) - # ARG local_print_at_Vertice_internal_3 - # LOCAL local_print_at_Vertice_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Vertice_internal_0 --> -4($fp) - # LOCAL local_print_at_Vertice_internal_1 --> -8($fp) - # local_print_at_Vertice_internal_1 = VCALL local_print_at_Vertice_internal_0 out_int - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 108($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_print_at_Vertice_internal_6 = GETATTRIBUTE out Vertice - # LOCAL local_print_at_Vertice_internal_6 --> -28($fp) - lw $t0, 16($s1) - sw $t0, -28($fp) - # LOCAL local_print_at_Vertice_internal_4 --> -20($fp) - # LOCAL local_print_at_Vertice_internal_6 --> -28($fp) - # local_print_at_Vertice_internal_4 = local_print_at_Vertice_internal_6 - lw $t0, -28($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Vertice_internal_4 --> -20($fp) - # LOCAL local_print_at_Vertice_internal_5 --> -24($fp) - # local_print_at_Vertice_internal_5 = VCALL local_print_at_Vertice_internal_4 print - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_at_Vertice_internal_5 - lw $v0, -24($fp) - # Deallocate stack frame for function function_print_at_Vertice. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 36 - jr $ra - # Function END - diff --git a/tests/codegen/hairyscary.mips b/tests/codegen/hairyscary.mips deleted file mode 100644 index 091b5158..00000000 --- a/tests/codegen/hairyscary.mips +++ /dev/null @@ -1,3621 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:11 2020 -# School of Math and Computer Science, University of Havana -# - -.data -dummy: .word 0 -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Int: .asciiz "Int" -# Function END -Main: .asciiz "Main" -# Function END -Bazz: .asciiz "Bazz" -# Function END -Foo: .asciiz "Foo" -# Function END -Razz: .asciiz "Razz" -# Function END -Bar: .asciiz "Bar" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word dummy, function_out_int_at_IO, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, dummy, dummy, dummy, function_abort_at_Object, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_concat_at_String, dummy, function_length_at_String, function_type_name_at_Object, function_substr_at_String, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Int **** -Int_start: - Int_vtable_pointer: .word Int_vtable - # Function END -Int_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_main_at_Main, function_abort_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -# **** VTABLE for type Bazz **** -Bazz_vtable: .word dummy, function_out_int_at_IO, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, function_printh_at_Bazz, function_doh_at_Bazz, dummy, function_abort_at_Object, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type Bazz **** -Bazz_start: - Bazz_vtable_pointer: .word Bazz_vtable - # Function END -Bazz_end: -# - - -# **** VTABLE for type Foo **** -Foo_vtable: .word dummy, function_out_int_at_IO, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, function_printh_at_Bazz, function_doh_at_Foo, dummy, function_abort_at_Object, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type Foo **** -Foo_start: - Foo_vtable_pointer: .word Foo_vtable - # Function END -Foo_end: -# - - -# **** VTABLE for type Razz **** -Razz_vtable: .word dummy, function_out_int_at_IO, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, function_printh_at_Bazz, function_doh_at_Foo, dummy, function_abort_at_Object, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type Razz **** -Razz_start: - Razz_vtable_pointer: .word Razz_vtable - # Function END -Razz_end: -# - - -# **** VTABLE for type Bar **** -Bar_vtable: .word dummy, function_out_int_at_IO, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, function_printh_at_Bazz, function_doh_at_Foo, dummy, function_abort_at_Object, function_in_int_at_IO -# Function END -# - - -# **** Type RECORD for type Bar **** -Bar_start: - Bar_vtable_pointer: .word Bar_vtable - # Function END -Bar_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, -1, 1, 2, 3, 4 -Object__TDT: .word 1, 0, 1, 1, 1, 1, 2, 3, 4, 5 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1, -1 -Main__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1, -1 -Bazz__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 2, 3 -Foo__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, 1, 2 -Razz__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, 1 -Bar__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz "do nothing" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - move $a2, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - sw $a2, 12($v0) - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - lw $t2, 12($t2) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - lw $a0, 12($a0) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # LOCAL local_length_at_String_internal_1 --> -8($fp) - # LOCAL local_length_at_String_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -4($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_length_at_String_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Main - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 28 bytes of memory - li $a0, 28 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__a__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__b__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__c__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__d__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t0, Main_vtable - # Get pointer to function address - lw $t1, 40($t0) - # Call function. Result is on $v0 - jalr $t1 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__a__init implementation. -# @Params: -__Main__attrib__a__init: - # Allocate stack frame for function __Main__attrib__a__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__a__init_internal_1 --> -8($fp) - # local_ttrib__a__init_internal_1 = ALLOCATE Bazz - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bazz - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 24 bytes of memory - li $a0, 24 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bazz_start - sw $t0, 4($v0) - # Load type offset - li $t0, 24 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -8($fp) - # RETURN local_ttrib__a__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Main__attrib__a__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__b__init implementation. -# @Params: -__Main__attrib__b__init: - # Allocate stack frame for function __Main__attrib__b__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__b__init_internal_1 --> -8($fp) - # local_ttrib__b__init_internal_1 = ALLOCATE Foo - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Foo - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 32 bytes of memory - li $a0, 32 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Foo_start - sw $t0, 4($v0) - # Load type offset - li $t0, 28 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -8($fp) - # RETURN local_ttrib__b__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Main__attrib__b__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__c__init implementation. -# @Params: -__Main__attrib__c__init: - # Allocate stack frame for function __Main__attrib__c__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__c__init_internal_1 --> -8($fp) - # local_ttrib__c__init_internal_1 = ALLOCATE Razz - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Razz - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 40 bytes of memory - li $a0, 40 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Razz_start - sw $t0, 4($v0) - # Load type offset - li $t0, 32 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 32($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 36($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -8($fp) - # RETURN local_ttrib__c__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Main__attrib__c__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__d__init implementation. -# @Params: -__Main__attrib__d__init: - # Allocate stack frame for function __Main__attrib__d__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__d__init_internal_1 --> -8($fp) - # local_ttrib__d__init_internal_1 = ALLOCATE Bar - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bar - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 48 bytes of memory - li $a0, 48 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bar_start - sw $t0, 4($v0) - # Load type offset - li $t0, 36 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 32($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 36($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bar__attrib__c__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 40($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bar__attrib__d__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 44($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -8($fp) - # RETURN local_ttrib__d__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Main__attrib__d__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_4 - sw $t0, 12($v0) - li $t0, 10 - sw $t0, 16($v0) - sw $v0, -4($fp) - # RETURN local_main_at_Main_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Bazz__attrib__h__init implementation. -# @Params: -__Bazz__attrib__h__init: - # Allocate stack frame for function __Bazz__attrib__h__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__h__init_internal_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_ttrib__h__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Bazz__attrib__h__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Bazz__attrib__g__init implementation. -# @Params: -__Bazz__attrib__g__init: - # Allocate stack frame for function __Bazz__attrib__g__init. - subu $sp, $sp, 64 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 64 - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # local_ttrib__g__init_internal_1 = SELF - sw $s1, -8($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) - # local_ttrib__g__init_internal_2 = TYPEOF local_ttrib__g__init_internal_1 - lw $t0, -8($fp) - # Load pointer to type offset - lw $t1, 8($t0) - sw $t1, -12($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # local_ttrib__g__init_internal_5 = 13 - li $t0, 13 - sw $t0, -24($fp) - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) - # Load TDT pointer to type Bazz - la $t0, Bazz__TDT - lw $t1, -12($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -28($fp) - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # Update min if 8 < 9 - lw $t0, -28($fp) - lw $t1, -24($fp) - bgtu $t0, $t1, label_Not_min0_1 - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # local_ttrib__g__init_internal_5 = local_ttrib__g__init_internal_6 - lw $t0, -28($fp) - sw $t0, -24($fp) - label_Not_min0_1: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) - # Load TDT pointer to type Razz - la $t0, Razz__TDT - lw $t1, -12($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -28($fp) - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # Update min if 8 < 9 - lw $t0, -28($fp) - lw $t1, -24($fp) - bgtu $t0, $t1, label_Not_min1_2 - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # local_ttrib__g__init_internal_5 = local_ttrib__g__init_internal_6 - lw $t0, -28($fp) - sw $t0, -24($fp) - label_Not_min1_2: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) - # Load TDT pointer to type Foo - la $t0, Foo__TDT - lw $t1, -12($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -28($fp) - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # Update min if 8 < 9 - lw $t0, -28($fp) - lw $t1, -24($fp) - bgtu $t0, $t1, label_Not_min2_3 - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # local_ttrib__g__init_internal_5 = local_ttrib__g__init_internal_6 - lw $t0, -28($fp) - sw $t0, -24($fp) - label_Not_min2_3: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) - # Load TDT pointer to type Bar - la $t0, Bar__TDT - lw $t1, -12($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -28($fp) - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # Update min if 8 < 9 - lw $t0, -28($fp) - lw $t1, -24($fp) - bgtu $t0, $t1, label_Not_min3_4 - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # local_ttrib__g__init_internal_5 = local_ttrib__g__init_internal_6 - lw $t0, -28($fp) - sw $t0, -24($fp) - label_Not_min3_4: - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # local_ttrib__g__init_internal_6 = 13 - li $t0, 13 - sw $t0, -28($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # Load pointers and SUB - lw $a0, -28($fp) - lw $a1, -24($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_ttrib__g__init_internal_3 GOTO label_ERROR_5 - # IF_ZERO local_ttrib__g__init_internal_3 GOTO label_ERROR_5 - lw $t0, -16($fp) - beq $t0, 0, label_ERROR_5 - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) - # Load TDT pointer to type Bazz - la $t0, Bazz__TDT - lw $t1, -12($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -28($fp) - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # Update min if 8 < 9 - lw $t0, -28($fp) - lw $t1, -24($fp) - bgtu $t0, $t1, label_NEXT0_7 - # LOCAL local_ttrib__g__init_n_7 --> -32($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # local_ttrib__g__init_n_7 = local_ttrib__g__init_internal_1 - lw $t0, -8($fp) - sw $t0, -32($fp) - # LOCAL local_ttrib__g__init_internal_8 --> -36($fp) - # local_ttrib__g__init_internal_8 = ALLOCATE Foo - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Foo - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 32 bytes of memory - li $a0, 32 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Foo_start - sw $t0, 4($v0) - # Load type offset - li $t0, 28 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -36($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_8 --> -36($fp) - # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_8 - lw $t0, -36($fp) - sw $t0, -20($fp) - # GOTO label_END_6 -j label_END_6 -label_NEXT0_7: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) - # Load TDT pointer to type Razz - la $t0, Razz__TDT - lw $t1, -12($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -28($fp) - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # Update min if 8 < 9 - lw $t0, -28($fp) - lw $t1, -24($fp) - bgtu $t0, $t1, label_NEXT1_8 - # LOCAL local_ttrib__g__init_n_9 --> -40($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # local_ttrib__g__init_n_9 = local_ttrib__g__init_internal_1 - lw $t0, -8($fp) - sw $t0, -40($fp) - # LOCAL local_ttrib__g__init_internal_10 --> -44($fp) - # local_ttrib__g__init_internal_10 = ALLOCATE Bar - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bar - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 48 bytes of memory - li $a0, 48 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bar_start - sw $t0, 4($v0) - # Load type offset - li $t0, 36 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 32($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 36($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bar__attrib__c__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 40($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bar__attrib__d__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 44($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -44($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_10 --> -44($fp) - # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_10 - lw $t0, -44($fp) - sw $t0, -20($fp) - # GOTO label_END_6 -j label_END_6 -label_NEXT1_8: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) - # Load TDT pointer to type Foo - la $t0, Foo__TDT - lw $t1, -12($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -28($fp) - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # Update min if 8 < 9 - lw $t0, -28($fp) - lw $t1, -24($fp) - bgtu $t0, $t1, label_NEXT2_9 - # LOCAL local_ttrib__g__init_n_11 --> -48($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # local_ttrib__g__init_n_11 = local_ttrib__g__init_internal_1 - lw $t0, -8($fp) - sw $t0, -48($fp) - # LOCAL local_ttrib__g__init_internal_12 --> -52($fp) - # local_ttrib__g__init_internal_12 = ALLOCATE Razz - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Razz - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 40 bytes of memory - li $a0, 40 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Razz_start - sw $t0, 4($v0) - # Load type offset - li $t0, 32 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 32($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 36($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -52($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_internal_12 --> -52($fp) - # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_12 - lw $t0, -52($fp) - sw $t0, -20($fp) - # GOTO label_END_6 -j label_END_6 -label_NEXT2_9: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) - # Load TDT pointer to type Bar - la $t0, Bar__TDT - lw $t1, -12($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -28($fp) - # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) - # Update min if 8 < 9 - lw $t0, -28($fp) - lw $t1, -24($fp) - bgtu $t0, $t1, label_NEXT3_10 - # LOCAL local_ttrib__g__init_n_13 --> -56($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # local_ttrib__g__init_n_13 = local_ttrib__g__init_internal_1 - lw $t0, -8($fp) - sw $t0, -56($fp) - # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__g__init_n_13 --> -56($fp) - # local_ttrib__g__init_internal_4 = local_ttrib__g__init_n_13 - lw $t0, -56($fp) - sw $t0, -20($fp) - # GOTO label_END_6 -j label_END_6 -label_NEXT3_10: - label_ERROR_5: - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - lw $t0, 0($s1) - sw $t0, -8($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -8($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - label_END_6: -# RETURN local_ttrib__g__init_internal_4 -lw $v0, -20($fp) -# Deallocate stack frame for function __Bazz__attrib__g__init. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 64 -jr $ra -# Function END - - -# __Bazz__attrib__i__init implementation. -# @Params: -__Bazz__attrib__i__init: - # Allocate stack frame for function __Bazz__attrib__i__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__i__init_internal_3 --> -16($fp) - # local_ttrib__i__init_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_ttrib__i__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__i__init_internal_3 --> -16($fp) - # local_ttrib__i__init_internal_1 = local_ttrib__i__init_internal_3 - lw $t0, -16($fp) - sw $t0, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_ttrib__i__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__i__init_internal_2 --> -12($fp) - # local_ttrib__i__init_internal_2 = VCALL local_ttrib__i__init_internal_1 printh - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 32($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_ttrib__i__init_internal_2 - lw $v0, -12($fp) - # Deallocate stack frame for function __Bazz__attrib__i__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_printh_at_Bazz implementation. -# @Params: -function_printh_at_Bazz: - # Allocate stack frame for function function_printh_at_Bazz. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_printh_at_Bazz_internal_2 --> -12($fp) - # local_printh_at_Bazz_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_printh_at_Bazz_internal_0 --> -4($fp) - # LOCAL local_printh_at_Bazz_internal_2 --> -12($fp) - # local_printh_at_Bazz_internal_0 = local_printh_at_Bazz_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_printh_at_Bazz_internal_3 = GETATTRIBUTE h Bazz - # LOCAL local_printh_at_Bazz_internal_3 --> -16($fp) - lw $t0, 12($s1) - sw $t0, -16($fp) - # ARG local_printh_at_Bazz_internal_3 - # LOCAL local_printh_at_Bazz_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_printh_at_Bazz_internal_0 --> -4($fp) - # LOCAL local_printh_at_Bazz_internal_1 --> -8($fp) - # local_printh_at_Bazz_internal_1 = VCALL local_printh_at_Bazz_internal_0 out_int - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_printh_at_Bazz_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -20($fp) - # RETURN local_printh_at_Bazz_internal_4 - lw $v0, -20($fp) - # Deallocate stack frame for function function_printh_at_Bazz. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_doh_at_Bazz implementation. -# @Params: -function_doh_at_Bazz: - # Allocate stack frame for function function_doh_at_Bazz. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_doh_at_Bazz_i_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # local_doh_at_Bazz_internal_1 = GETATTRIBUTE h Bazz - # LOCAL local_doh_at_Bazz_internal_1 --> -8($fp) - lw $t0, 12($s1) - sw $t0, -8($fp) - # LOCAL local_doh_at_Bazz_i_0 --> -4($fp) - # LOCAL local_doh_at_Bazz_internal_1 --> -8($fp) - # local_doh_at_Bazz_i_0 = local_doh_at_Bazz_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # local_doh_at_Bazz_internal_3 = GETATTRIBUTE h Bazz - # LOCAL local_doh_at_Bazz_internal_3 --> -16($fp) - lw $t0, 12($s1) - sw $t0, -16($fp) - # LOCAL local_doh_at_Bazz_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -20($fp) - # LOCAL local_doh_at_Bazz_internal_2 --> -12($fp) - # LOCAL local_doh_at_Bazz_internal_3 --> -16($fp) - # LOCAL local_doh_at_Bazz_internal_4 --> -20($fp) - # local_doh_at_Bazz_internal_2 = local_doh_at_Bazz_internal_3 + local_doh_at_Bazz_internal_4 - lw $t1, -16($fp) - lw $t0, 12($t1) - lw $t1, -20($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -12($fp) - # - # LOCAL local_doh_at_Bazz_internal_2 --> -12($fp) - lw $t0, -12($fp) - sw $t0, 12($s1) - # RETURN local_doh_at_Bazz_i_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_doh_at_Bazz. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Foo__attrib__a__init implementation. -# @Params: -__Foo__attrib__a__init: - # Allocate stack frame for function __Foo__attrib__a__init. - subu $sp, $sp, 56 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 56 - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - # local_trib__a__init_internal_1 = SELF - sw $s1, -8($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - # LOCAL local_trib__a__init_internal_2 --> -12($fp) - # local_trib__a__init_internal_2 = TYPEOF local_trib__a__init_internal_1 - lw $t0, -8($fp) - # Load pointer to type offset - lw $t1, 8($t0) - sw $t1, -12($fp) - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # local_trib__a__init_internal_5 = 13 - li $t0, 13 - sw $t0, -24($fp) - # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz - # LOCAL local_trib__a__init_internal_6 --> -28($fp) - # LOCAL local_trib__a__init_internal_2 --> -12($fp) - # Load TDT pointer to type Razz - la $t0, Razz__TDT - lw $t1, -12($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -28($fp) - # LOCAL local_trib__a__init_internal_6 --> -28($fp) - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # Update min if 8 < 9 - lw $t0, -28($fp) - lw $t1, -24($fp) - bgtu $t0, $t1, label_Not_min0_11 - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_6 --> -28($fp) - # local_trib__a__init_internal_5 = local_trib__a__init_internal_6 - lw $t0, -28($fp) - sw $t0, -24($fp) - label_Not_min0_11: - # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo - # LOCAL local_trib__a__init_internal_6 --> -28($fp) - # LOCAL local_trib__a__init_internal_2 --> -12($fp) - # Load TDT pointer to type Foo - la $t0, Foo__TDT - lw $t1, -12($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -28($fp) - # LOCAL local_trib__a__init_internal_6 --> -28($fp) - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # Update min if 8 < 9 - lw $t0, -28($fp) - lw $t1, -24($fp) - bgtu $t0, $t1, label_Not_min1_12 - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_6 --> -28($fp) - # local_trib__a__init_internal_5 = local_trib__a__init_internal_6 - lw $t0, -28($fp) - sw $t0, -24($fp) - label_Not_min1_12: - # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar - # LOCAL local_trib__a__init_internal_6 --> -28($fp) - # LOCAL local_trib__a__init_internal_2 --> -12($fp) - # Load TDT pointer to type Bar - la $t0, Bar__TDT - lw $t1, -12($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -28($fp) - # LOCAL local_trib__a__init_internal_6 --> -28($fp) - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # Update min if 8 < 9 - lw $t0, -28($fp) - lw $t1, -24($fp) - bgtu $t0, $t1, label_Not_min2_13 - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # LOCAL local_trib__a__init_internal_6 --> -28($fp) - # local_trib__a__init_internal_5 = local_trib__a__init_internal_6 - lw $t0, -28($fp) - sw $t0, -24($fp) - label_Not_min2_13: - # LOCAL local_trib__a__init_internal_6 --> -28($fp) - # local_trib__a__init_internal_6 = 13 - li $t0, 13 - sw $t0, -28($fp) - # LOCAL local_trib__a__init_internal_3 --> -16($fp) - # LOCAL local_trib__a__init_internal_6 --> -28($fp) - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # Load pointers and SUB - lw $a0, -28($fp) - lw $a1, -24($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_trib__a__init_internal_3 GOTO label_ERROR_14 - # IF_ZERO local_trib__a__init_internal_3 GOTO label_ERROR_14 - lw $t0, -16($fp) - beq $t0, 0, label_ERROR_14 - # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz - # LOCAL local_trib__a__init_internal_6 --> -28($fp) - # LOCAL local_trib__a__init_internal_2 --> -12($fp) - # Load TDT pointer to type Razz - la $t0, Razz__TDT - lw $t1, -12($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -28($fp) - # LOCAL local_trib__a__init_internal_6 --> -28($fp) - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # Update min if 8 < 9 - lw $t0, -28($fp) - lw $t1, -24($fp) - bgtu $t0, $t1, label_NEXT0_16 - # LOCAL local_trib__a__init_n_7 --> -32($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - # local_trib__a__init_n_7 = local_trib__a__init_internal_1 - lw $t0, -8($fp) - sw $t0, -32($fp) - # LOCAL local_trib__a__init_internal_8 --> -36($fp) - # local_trib__a__init_internal_8 = ALLOCATE Bar - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bar - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 48 bytes of memory - li $a0, 48 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bar_start - sw $t0, 4($v0) - # Load type offset - li $t0, 36 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 32($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 36($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bar__attrib__c__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 40($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bar__attrib__d__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 44($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -36($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_8 --> -36($fp) - # local_trib__a__init_internal_4 = local_trib__a__init_internal_8 - lw $t0, -36($fp) - sw $t0, -20($fp) - # GOTO label_END_15 -j label_END_15 -label_NEXT0_16: - # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo - # LOCAL local_trib__a__init_internal_6 --> -28($fp) - # LOCAL local_trib__a__init_internal_2 --> -12($fp) - # Load TDT pointer to type Foo - la $t0, Foo__TDT - lw $t1, -12($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -28($fp) - # LOCAL local_trib__a__init_internal_6 --> -28($fp) - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # Update min if 8 < 9 - lw $t0, -28($fp) - lw $t1, -24($fp) - bgtu $t0, $t1, label_NEXT1_17 - # LOCAL local_trib__a__init_n_9 --> -40($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - # local_trib__a__init_n_9 = local_trib__a__init_internal_1 - lw $t0, -8($fp) - sw $t0, -40($fp) - # LOCAL local_trib__a__init_internal_10 --> -44($fp) - # local_trib__a__init_internal_10 = ALLOCATE Razz - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Razz - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 40 bytes of memory - li $a0, 40 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Razz_start - sw $t0, 4($v0) - # Load type offset - li $t0, 32 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 32($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 36($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -44($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_internal_10 --> -44($fp) - # local_trib__a__init_internal_4 = local_trib__a__init_internal_10 - lw $t0, -44($fp) - sw $t0, -20($fp) - # GOTO label_END_15 -j label_END_15 -label_NEXT1_17: - # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar - # LOCAL local_trib__a__init_internal_6 --> -28($fp) - # LOCAL local_trib__a__init_internal_2 --> -12($fp) - # Load TDT pointer to type Bar - la $t0, Bar__TDT - lw $t1, -12($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -28($fp) - # LOCAL local_trib__a__init_internal_6 --> -28($fp) - # LOCAL local_trib__a__init_internal_5 --> -24($fp) - # Update min if 8 < 9 - lw $t0, -28($fp) - lw $t1, -24($fp) - bgtu $t0, $t1, label_NEXT2_18 - # LOCAL local_trib__a__init_n_11 --> -48($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - # local_trib__a__init_n_11 = local_trib__a__init_internal_1 - lw $t0, -8($fp) - sw $t0, -48($fp) - # LOCAL local_trib__a__init_internal_4 --> -20($fp) - # LOCAL local_trib__a__init_n_11 --> -48($fp) - # local_trib__a__init_internal_4 = local_trib__a__init_n_11 - lw $t0, -48($fp) - sw $t0, -20($fp) - # GOTO label_END_15 -j label_END_15 -label_NEXT2_18: - label_ERROR_14: - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - lw $t0, 0($s1) - sw $t0, -8($fp) - # LOCAL local_trib__a__init_internal_1 --> -8($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -8($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - label_END_15: -# RETURN local_trib__a__init_internal_4 -lw $v0, -20($fp) -# Deallocate stack frame for function __Foo__attrib__a__init. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 56 -jr $ra -# Function END - - -# __Foo__attrib__b__init implementation. -# @Params: -__Foo__attrib__b__init: - # Allocate stack frame for function __Foo__attrib__b__init. - subu $sp, $sp, 72 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 72 - # local_trib__b__init_internal_6 = GETATTRIBUTE a Foo - # LOCAL local_trib__b__init_internal_6 --> -28($fp) - lw $t0, 24($s1) - sw $t0, -28($fp) - # LOCAL local_trib__b__init_internal_4 --> -20($fp) - # LOCAL local_trib__b__init_internal_6 --> -28($fp) - # local_trib__b__init_internal_4 = local_trib__b__init_internal_6 - lw $t0, -28($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_trib__b__init_internal_4 --> -20($fp) - # LOCAL local_trib__b__init_internal_5 --> -24($fp) - # local_trib__b__init_internal_5 = VCALL local_trib__b__init_internal_4 doh - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 36($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_trib__b__init_internal_9 = GETATTRIBUTE g Foo - # LOCAL local_trib__b__init_internal_9 --> -40($fp) - lw $t0, 16($s1) - sw $t0, -40($fp) - # LOCAL local_trib__b__init_internal_7 --> -32($fp) - # LOCAL local_trib__b__init_internal_9 --> -40($fp) - # local_trib__b__init_internal_7 = local_trib__b__init_internal_9 - lw $t0, -40($fp) - sw $t0, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_trib__b__init_internal_7 --> -32($fp) - # LOCAL local_trib__b__init_internal_8 --> -36($fp) - # local_trib__b__init_internal_8 = VCALL local_trib__b__init_internal_7 doh - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 36($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_trib__b__init_internal_3 --> -16($fp) - # LOCAL local_trib__b__init_internal_5 --> -24($fp) - # LOCAL local_trib__b__init_internal_8 --> -36($fp) - # local_trib__b__init_internal_3 = local_trib__b__init_internal_5 + local_trib__b__init_internal_8 - lw $t1, -24($fp) - lw $t0, 12($t1) - lw $t1, -36($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -16($fp) - # LOCAL local_trib__b__init_internal_12 --> -52($fp) - # local_trib__b__init_internal_12 = SELF - sw $s1, -52($fp) - # LOCAL local_trib__b__init_internal_10 --> -44($fp) - # LOCAL local_trib__b__init_internal_12 --> -52($fp) - # local_trib__b__init_internal_10 = local_trib__b__init_internal_12 - lw $t0, -52($fp) - sw $t0, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_trib__b__init_internal_10 --> -44($fp) - # LOCAL local_trib__b__init_internal_11 --> -48($fp) - # local_trib__b__init_internal_11 = VCALL local_trib__b__init_internal_10 doh - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 36($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_trib__b__init_internal_2 --> -12($fp) - # LOCAL local_trib__b__init_internal_3 --> -16($fp) - # LOCAL local_trib__b__init_internal_11 --> -48($fp) - # local_trib__b__init_internal_2 = local_trib__b__init_internal_3 + local_trib__b__init_internal_11 - lw $t1, -16($fp) - lw $t0, 12($t1) - lw $t1, -48($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -12($fp) - # LOCAL local_trib__b__init_internal_15 --> -64($fp) - # local_trib__b__init_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_trib__b__init_internal_13 --> -56($fp) - # LOCAL local_trib__b__init_internal_15 --> -64($fp) - # local_trib__b__init_internal_13 = local_trib__b__init_internal_15 - lw $t0, -64($fp) - sw $t0, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_trib__b__init_internal_13 --> -56($fp) - # LOCAL local_trib__b__init_internal_14 --> -60($fp) - # local_trib__b__init_internal_14 = VCALL local_trib__b__init_internal_13 printh - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 32($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_trib__b__init_internal_1 --> -8($fp) - # LOCAL local_trib__b__init_internal_2 --> -12($fp) - # LOCAL local_trib__b__init_internal_14 --> -60($fp) - # local_trib__b__init_internal_1 = local_trib__b__init_internal_2 + local_trib__b__init_internal_14 - lw $t1, -12($fp) - lw $t0, 12($t1) - lw $t1, -60($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_trib__b__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Foo__attrib__b__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 72 - jr $ra - # Function END - - -# function_doh_at_Foo implementation. -# @Params: -function_doh_at_Foo: - # Allocate stack frame for function function_doh_at_Foo. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_doh_at_Foo_i_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # local_doh_at_Foo_internal_1 = GETATTRIBUTE h Foo - # LOCAL local_doh_at_Foo_internal_1 --> -8($fp) - lw $t0, 12($s1) - sw $t0, -8($fp) - # LOCAL local_doh_at_Foo_i_0 --> -4($fp) - # LOCAL local_doh_at_Foo_internal_1 --> -8($fp) - # local_doh_at_Foo_i_0 = local_doh_at_Foo_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # local_doh_at_Foo_internal_3 = GETATTRIBUTE h Foo - # LOCAL local_doh_at_Foo_internal_3 --> -16($fp) - lw $t0, 12($s1) - sw $t0, -16($fp) - # LOCAL local_doh_at_Foo_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 2 - sw $t0, 12($v0) - sw $v0, -20($fp) - # LOCAL local_doh_at_Foo_internal_2 --> -12($fp) - # LOCAL local_doh_at_Foo_internal_3 --> -16($fp) - # LOCAL local_doh_at_Foo_internal_4 --> -20($fp) - # local_doh_at_Foo_internal_2 = local_doh_at_Foo_internal_3 + local_doh_at_Foo_internal_4 - lw $t1, -16($fp) - lw $t0, 12($t1) - lw $t1, -20($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -12($fp) - # - # LOCAL local_doh_at_Foo_internal_2 --> -12($fp) - lw $t0, -12($fp) - sw $t0, 12($s1) - # RETURN local_doh_at_Foo_i_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_doh_at_Foo. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Razz__attrib__e__init implementation. -# @Params: -__Razz__attrib__e__init: - # Allocate stack frame for function __Razz__attrib__e__init. - subu $sp, $sp, 48 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 48 - # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) - # local_ttrib__e__init_internal_1 = SELF - sw $s1, -8($fp) - # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) - # local_ttrib__e__init_internal_2 = TYPEOF local_ttrib__e__init_internal_1 - lw $t0, -8($fp) - # Load pointer to type offset - lw $t1, 8($t0) - sw $t1, -12($fp) - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # local_ttrib__e__init_internal_5 = 13 - li $t0, 13 - sw $t0, -24($fp) - # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) - # Load TDT pointer to type Razz - la $t0, Razz__TDT - lw $t1, -12($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -28($fp) - # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # Update min if 8 < 9 - lw $t0, -28($fp) - lw $t1, -24($fp) - bgtu $t0, $t1, label_Not_min0_19 - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) - # local_ttrib__e__init_internal_5 = local_ttrib__e__init_internal_6 - lw $t0, -28($fp) - sw $t0, -24($fp) - label_Not_min0_19: - # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) - # Load TDT pointer to type Bar - la $t0, Bar__TDT - lw $t1, -12($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -28($fp) - # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # Update min if 8 < 9 - lw $t0, -28($fp) - lw $t1, -24($fp) - bgtu $t0, $t1, label_Not_min1_20 - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) - # local_ttrib__e__init_internal_5 = local_ttrib__e__init_internal_6 - lw $t0, -28($fp) - sw $t0, -24($fp) - label_Not_min1_20: - # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) - # local_ttrib__e__init_internal_6 = 13 - li $t0, 13 - sw $t0, -28($fp) - # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # Load pointers and SUB - lw $a0, -28($fp) - lw $a1, -24($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_ttrib__e__init_internal_3 GOTO label_ERROR_21 - # IF_ZERO local_ttrib__e__init_internal_3 GOTO label_ERROR_21 - lw $t0, -16($fp) - beq $t0, 0, label_ERROR_21 - # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz - # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) - # Load TDT pointer to type Razz - la $t0, Razz__TDT - lw $t1, -12($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -28($fp) - # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # Update min if 8 < 9 - lw $t0, -28($fp) - lw $t1, -24($fp) - bgtu $t0, $t1, label_NEXT0_23 - # LOCAL local_ttrib__e__init_n_7 --> -32($fp) - # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) - # local_ttrib__e__init_n_7 = local_ttrib__e__init_internal_1 - lw $t0, -8($fp) - sw $t0, -32($fp) - # LOCAL local_ttrib__e__init_internal_8 --> -36($fp) - # local_ttrib__e__init_internal_8 = ALLOCATE Bar - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bar - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 48 bytes of memory - li $a0, 48 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bar_start - sw $t0, 4($v0) - # Load type offset - li $t0, 36 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__h__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__g__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bazz__attrib__i__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Foo__attrib__a__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Foo__attrib__b__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Razz__attrib__e__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 32($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Razz__attrib__f__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 36($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bar__attrib__c__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 40($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Bar__attrib__d__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 44($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -36($fp) - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_internal_8 --> -36($fp) - # local_ttrib__e__init_internal_4 = local_ttrib__e__init_internal_8 - lw $t0, -36($fp) - sw $t0, -20($fp) - # GOTO label_END_22 -j label_END_22 -label_NEXT0_23: - # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar - # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) - # Load TDT pointer to type Bar - la $t0, Bar__TDT - lw $t1, -12($fp) - addu $t0, $t0, $t1 - # Save distance - lw $t1, 0($t0) - sw $t1, -28($fp) - # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) - # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) - # Update min if 8 < 9 - lw $t0, -28($fp) - lw $t1, -24($fp) - bgtu $t0, $t1, label_NEXT1_24 - # LOCAL local_ttrib__e__init_n_9 --> -40($fp) - # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) - # local_ttrib__e__init_n_9 = local_ttrib__e__init_internal_1 - lw $t0, -8($fp) - sw $t0, -40($fp) - # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__e__init_n_9 --> -40($fp) - # local_ttrib__e__init_internal_4 = local_ttrib__e__init_n_9 - lw $t0, -40($fp) - sw $t0, -20($fp) - # GOTO label_END_22 -j label_END_22 -label_NEXT1_24: - label_ERROR_21: - # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) - lw $t0, 0($s1) - sw $t0, -8($fp) - # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -8($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - label_END_22: -# RETURN local_ttrib__e__init_internal_4 -lw $v0, -20($fp) -# Deallocate stack frame for function __Razz__attrib__e__init. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 48 -jr $ra -# Function END - - -# __Razz__attrib__f__init implementation. -# @Params: -__Razz__attrib__f__init: - # Allocate stack frame for function __Razz__attrib__f__init. - subu $sp, $sp, 84 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 84 - # local_ttrib__f__init_internal_6 = GETATTRIBUTE a Razz - # LOCAL local_ttrib__f__init_internal_6 --> -28($fp) - lw $t0, 24($s1) - sw $t0, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_ttrib__f__init_internal_5 = CALL doh - # LOCAL local_ttrib__f__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__f__init_internal_6 --> -28($fp) - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type's VTABLE - la $t0, Bazz_vtable - # Get pointer to function address - lw $t1, 36($t0) - # Call function. Result is on $v0 - jalr $t1 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_ttrib__f__init_internal_9 = GETATTRIBUTE g Razz - # LOCAL local_ttrib__f__init_internal_9 --> -40($fp) - lw $t0, 16($s1) - sw $t0, -40($fp) - # LOCAL local_ttrib__f__init_internal_7 --> -32($fp) - # LOCAL local_ttrib__f__init_internal_9 --> -40($fp) - # local_ttrib__f__init_internal_7 = local_ttrib__f__init_internal_9 - lw $t0, -40($fp) - sw $t0, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_ttrib__f__init_internal_7 --> -32($fp) - # LOCAL local_ttrib__f__init_internal_8 --> -36($fp) - # local_ttrib__f__init_internal_8 = VCALL local_ttrib__f__init_internal_7 doh - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 36($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_ttrib__f__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__f__init_internal_5 --> -24($fp) - # LOCAL local_ttrib__f__init_internal_8 --> -36($fp) - # local_ttrib__f__init_internal_4 = local_ttrib__f__init_internal_5 + local_ttrib__f__init_internal_8 - lw $t1, -24($fp) - lw $t0, 12($t1) - lw $t1, -36($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -20($fp) - # local_ttrib__f__init_internal_12 = GETATTRIBUTE e Razz - # LOCAL local_ttrib__f__init_internal_12 --> -52($fp) - lw $t0, 32($s1) - sw $t0, -52($fp) - # LOCAL local_ttrib__f__init_internal_10 --> -44($fp) - # LOCAL local_ttrib__f__init_internal_12 --> -52($fp) - # local_ttrib__f__init_internal_10 = local_ttrib__f__init_internal_12 - lw $t0, -52($fp) - sw $t0, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_ttrib__f__init_internal_10 --> -44($fp) - # LOCAL local_ttrib__f__init_internal_11 --> -48($fp) - # local_ttrib__f__init_internal_11 = VCALL local_ttrib__f__init_internal_10 doh - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 36($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_ttrib__f__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__f__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__f__init_internal_11 --> -48($fp) - # local_ttrib__f__init_internal_3 = local_ttrib__f__init_internal_4 + local_ttrib__f__init_internal_11 - lw $t1, -20($fp) - lw $t0, 12($t1) - lw $t1, -48($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -16($fp) - # LOCAL local_ttrib__f__init_internal_15 --> -64($fp) - # local_ttrib__f__init_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_ttrib__f__init_internal_13 --> -56($fp) - # LOCAL local_ttrib__f__init_internal_15 --> -64($fp) - # local_ttrib__f__init_internal_13 = local_ttrib__f__init_internal_15 - lw $t0, -64($fp) - sw $t0, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_ttrib__f__init_internal_13 --> -56($fp) - # LOCAL local_ttrib__f__init_internal_14 --> -60($fp) - # local_ttrib__f__init_internal_14 = VCALL local_ttrib__f__init_internal_13 doh - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 36($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_ttrib__f__init_internal_2 --> -12($fp) - # LOCAL local_ttrib__f__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__f__init_internal_14 --> -60($fp) - # local_ttrib__f__init_internal_2 = local_ttrib__f__init_internal_3 + local_ttrib__f__init_internal_14 - lw $t1, -16($fp) - lw $t0, 12($t1) - lw $t1, -60($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -12($fp) - # LOCAL local_ttrib__f__init_internal_18 --> -76($fp) - # local_ttrib__f__init_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_ttrib__f__init_internal_16 --> -68($fp) - # LOCAL local_ttrib__f__init_internal_18 --> -76($fp) - # local_ttrib__f__init_internal_16 = local_ttrib__f__init_internal_18 - lw $t0, -76($fp) - sw $t0, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_ttrib__f__init_internal_16 --> -68($fp) - # LOCAL local_ttrib__f__init_internal_17 --> -72($fp) - # local_ttrib__f__init_internal_17 = VCALL local_ttrib__f__init_internal_16 printh - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 32($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_ttrib__f__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__f__init_internal_2 --> -12($fp) - # LOCAL local_ttrib__f__init_internal_17 --> -72($fp) - # local_ttrib__f__init_internal_1 = local_ttrib__f__init_internal_2 + local_ttrib__f__init_internal_17 - lw $t1, -12($fp) - lw $t0, 12($t1) - lw $t1, -72($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_ttrib__f__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Razz__attrib__f__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 84 - jr $ra - # Function END - - -# __Bar__attrib__c__init implementation. -# @Params: -__Bar__attrib__c__init: - # Allocate stack frame for function __Bar__attrib__c__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_trib__c__init_internal_3 --> -16($fp) - # local_trib__c__init_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_trib__c__init_internal_1 --> -8($fp) - # LOCAL local_trib__c__init_internal_3 --> -16($fp) - # local_trib__c__init_internal_1 = local_trib__c__init_internal_3 - lw $t0, -16($fp) - sw $t0, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_trib__c__init_internal_1 --> -8($fp) - # LOCAL local_trib__c__init_internal_2 --> -12($fp) - # local_trib__c__init_internal_2 = VCALL local_trib__c__init_internal_1 doh - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 36($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_trib__c__init_internal_2 - lw $v0, -12($fp) - # Deallocate stack frame for function __Bar__attrib__c__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Bar__attrib__d__init implementation. -# @Params: -__Bar__attrib__d__init: - # Allocate stack frame for function __Bar__attrib__d__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_trib__d__init_internal_3 --> -16($fp) - # local_trib__d__init_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_trib__d__init_internal_1 --> -8($fp) - # LOCAL local_trib__d__init_internal_3 --> -16($fp) - # local_trib__d__init_internal_1 = local_trib__d__init_internal_3 - lw $t0, -16($fp) - sw $t0, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_trib__d__init_internal_1 --> -8($fp) - # LOCAL local_trib__d__init_internal_2 --> -12($fp) - # local_trib__d__init_internal_2 = VCALL local_trib__d__init_internal_1 printh - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 32($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_trib__d__init_internal_2 - lw $v0, -12($fp) - # Deallocate stack frame for function __Bar__attrib__d__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips deleted file mode 100644 index 7aca9f5f..00000000 --- a/tests/codegen/hello_world.mips +++ /dev/null @@ -1,745 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:11 2020 -# School of Math and Computer Science, University of Havana -# - -.data -dummy: .word 0 -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Int: .asciiz "Int" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_out_int_at_IO, function_abort_at_Object, dummy, dummy, function_copy_at_Object, function_type_name_at_Object, function_in_int_at_IO, dummy, dummy, function_in_string_at_IO, function_out_string_at_IO -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word dummy, function_abort_at_Object, function_concat_at_String, function_substr_at_String, function_copy_at_Object, function_type_name_at_Object, dummy, dummy, function_length_at_String, dummy, dummy -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Int **** -Int_vtable: .word dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Int **** -Int_start: - Int_vtable_pointer: .word Int_vtable - # Function END -Int_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_out_int_at_IO, function_abort_at_Object, dummy, dummy, function_copy_at_Object, function_type_name_at_Object, function_in_int_at_IO, function_main_at_Main, dummy, function_in_string_at_IO, function_out_string_at_IO -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz "Hello, World.\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - move $a2, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - sw $a2, 12($v0) - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - lw $t2, 12($t2) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - lw $a0, 12($a0) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # LOCAL local_length_at_String_internal_1 --> -8($fp) - # LOCAL local_length_at_String_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -4($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_length_at_String_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Main - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t0, Main_vtable - # Get pointer to function address - lw $t1, 28($t0) - # Call function. Result is on $v0 - jalr $t1 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_4 - sw $t0, 12($v0) - li $t0, 14 - sw $t0, 16($v0) - sw $v0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 40($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips deleted file mode 100644 index 95001e53..00000000 --- a/tests/codegen/io.mips +++ /dev/null @@ -1,1450 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:12 2020 -# School of Math and Computer Science, University of Havana -# - -.data -dummy: .word 0 -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Int: .asciiz "Int" -# Function END -A: .asciiz "A" -# Function END -B: .asciiz "B" -# Function END -Main: .asciiz "Main" -# Function END -C: .asciiz "C" -# Function END -D: .asciiz "D" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word dummy, dummy, dummy, function_in_int_at_IO, function_out_int_at_IO, function_abort_at_Object, dummy, dummy, function_out_string_at_IO, dummy, function_in_string_at_IO, dummy, function_copy_at_Object, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, function_length_at_String, dummy, dummy, dummy, dummy, function_concat_at_String, function_copy_at_Object, function_type_name_at_Object, function_substr_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Int **** -Int_start: - Int_vtable_pointer: .word Int_vtable - # Function END -Int_end: -# - - -# **** VTABLE for type A **** -A_vtable: .word function_out_a_at_A, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type A **** -A_start: - A_vtable_pointer: .word A_vtable - # Function END -A_end: -# - - -# **** VTABLE for type B **** -B_vtable: .word function_out_a_at_A, function_out_b_at_B, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type B **** -B_start: - B_vtable_pointer: .word B_vtable - # Function END -B_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word dummy, dummy, dummy, function_in_int_at_IO, function_out_int_at_IO, function_abort_at_Object, dummy, function_main_at_Main, function_out_string_at_IO, dummy, function_in_string_at_IO, dummy, function_copy_at_Object, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -# **** VTABLE for type C **** -C_vtable: .word dummy, dummy, dummy, function_in_int_at_IO, function_out_int_at_IO, function_abort_at_Object, dummy, dummy, function_out_string_at_IO, function_out_c_at_C, function_in_string_at_IO, dummy, function_copy_at_Object, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type C **** -C_start: - C_vtable_pointer: .word C_vtable - # Function END -C_end: -# - - -# **** VTABLE for type D **** -D_vtable: .word dummy, dummy, function_out_d_at_D, function_in_int_at_IO, function_out_int_at_IO, function_abort_at_Object, dummy, dummy, function_out_string_at_IO, function_out_c_at_C, function_in_string_at_IO, dummy, function_copy_at_Object, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type D **** -D_start: - D_vtable_pointer: .word D_vtable - # Function END -D_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, -1, -1, 1, 1, 2 -Object__TDT: .word 1, 0, 1, 1, 1, 1, 2, 2, 2, 3 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1, -1 -A__TDT: .word -1, -1, -1, -1, -1, 0, 1, -1, -1, -1 -B__TDT: .word -1, -1, -1, -1, -1, -1, 0, -1, -1, -1 -Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 -C__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, 1 -D__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz "A: Hello world\n" -# - - -data_5: .asciiz "B: Hello world\n" -# - - -data_6: .asciiz "Done.\n" -# - - -data_7: .asciiz "C: Hello world\n" -# - - -data_8: .asciiz "D: Hello world\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - move $a2, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - sw $a2, 12($v0) - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - lw $t2, 12($t2) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - lw $a0, 12($a0) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # LOCAL local_length_at_String_internal_1 --> -8($fp) - # LOCAL local_length_at_String_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -4($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_length_at_String_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Main - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - # Load type offset - li $t0, 28 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t0, Main_vtable - # Get pointer to function address - lw $t1, 28($t0) - # Call function. Result is on $v0 - jalr $t1 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __A__attrib__io__init implementation. -# @Params: -__A__attrib__io__init: - # Allocate stack frame for function __A__attrib__io__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ib__io__init_internal_1 --> -8($fp) - # local_ib__io__init_internal_1 = ALLOCATE IO - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, IO - sw $t0, 12($v0) - li $t0, 2 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, IO_start - sw $t0, 4($v0) - # Load type offset - li $t0, 0 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -8($fp) - # RETURN local_ib__io__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __A__attrib__io__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_a_at_A implementation. -# @Params: -function_out_a_at_A: - # Allocate stack frame for function function_out_a_at_A. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_out_a_at_A_internal_2 = GETATTRIBUTE io A - # LOCAL local_out_a_at_A_internal_2 --> -12($fp) - lw $t0, 12($s1) - sw $t0, -12($fp) - # LOCAL local_out_a_at_A_internal_0 --> -4($fp) - # LOCAL local_out_a_at_A_internal_2 --> -12($fp) - # local_out_a_at_A_internal_0 = local_out_a_at_A_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_out_a_at_A_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_4 - sw $t0, 12($v0) - li $t0, 15 - sw $t0, 16($v0) - sw $v0, -16($fp) - # ARG local_out_a_at_A_internal_3 - # LOCAL local_out_a_at_A_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_out_a_at_A_internal_0 --> -4($fp) - # LOCAL local_out_a_at_A_internal_1 --> -8($fp) - # local_out_a_at_A_internal_1 = VCALL local_out_a_at_A_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 32($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_out_a_at_A_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_a_at_A. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_b_at_B implementation. -# @Params: -function_out_b_at_B: - # Allocate stack frame for function function_out_b_at_B. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_out_b_at_B_internal_2 = GETATTRIBUTE io B - # LOCAL local_out_b_at_B_internal_2 --> -12($fp) - lw $t0, 12($s1) - sw $t0, -12($fp) - # LOCAL local_out_b_at_B_internal_0 --> -4($fp) - # LOCAL local_out_b_at_B_internal_2 --> -12($fp) - # local_out_b_at_B_internal_0 = local_out_b_at_B_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_out_b_at_B_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_5 - sw $t0, 12($v0) - li $t0, 15 - sw $t0, 16($v0) - sw $v0, -16($fp) - # ARG local_out_b_at_B_internal_3 - # LOCAL local_out_b_at_B_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_out_b_at_B_internal_0 --> -4($fp) - # LOCAL local_out_b_at_B_internal_1 --> -8($fp) - # local_out_b_at_B_internal_1 = VCALL local_out_b_at_B_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 32($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_out_b_at_B_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_b_at_B. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 72 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 72 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = ALLOCATE A - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, A - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, A_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __A__attrib__io__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_a - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 0($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = ALLOCATE B - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, B - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, B_start - sw $t0, 4($v0) - # Load type offset - li $t0, 24 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __A__attrib__io__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -24($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 - lw $t0, -24($fp) - sw $t0, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 out_b - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = ALLOCATE C - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, C - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, C_start - sw $t0, 4($v0) - # Load type offset - li $t0, 32 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -36($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 - lw $t0, -36($fp) - sw $t0, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_c - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 36($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = ALLOCATE D - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, D - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, D_start - sw $t0, 4($v0) - # Load type offset - li $t0, 36 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -48($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 - lw $t0, -48($fp) - sw $t0, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_d - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 8($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 - lw $t0, -60($fp) - sw $t0, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_6 - sw $t0, 12($v0) - li $t0, 6 - sw $t0, 16($v0) - sw $v0, -64($fp) - # ARG local_main_at_Main_internal_15 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - lw $t0, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 32($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_13 - lw $v0, -56($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 72 - jr $ra - # Function END - - -# function_out_c_at_C implementation. -# @Params: -function_out_c_at_C: - # Allocate stack frame for function function_out_c_at_C. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_out_c_at_C_internal_2 --> -12($fp) - # local_out_c_at_C_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_out_c_at_C_internal_0 --> -4($fp) - # LOCAL local_out_c_at_C_internal_2 --> -12($fp) - # local_out_c_at_C_internal_0 = local_out_c_at_C_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_out_c_at_C_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_7 - sw $t0, 12($v0) - li $t0, 15 - sw $t0, 16($v0) - sw $v0, -16($fp) - # ARG local_out_c_at_C_internal_3 - # LOCAL local_out_c_at_C_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_out_c_at_C_internal_0 --> -4($fp) - # LOCAL local_out_c_at_C_internal_1 --> -8($fp) - # local_out_c_at_C_internal_1 = VCALL local_out_c_at_C_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 32($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_out_c_at_C_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_c_at_C. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_d_at_D implementation. -# @Params: -function_out_d_at_D: - # Allocate stack frame for function function_out_d_at_D. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_out_d_at_D_internal_2 --> -12($fp) - # local_out_d_at_D_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_out_d_at_D_internal_0 --> -4($fp) - # LOCAL local_out_d_at_D_internal_2 --> -12($fp) - # local_out_d_at_D_internal_0 = local_out_d_at_D_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_out_d_at_D_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_8 - sw $t0, 12($v0) - li $t0, 15 - sw $t0, 16($v0) - sw $v0, -16($fp) - # ARG local_out_d_at_D_internal_3 - # LOCAL local_out_d_at_D_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_out_d_at_D_internal_0 --> -4($fp) - # LOCAL local_out_d_at_D_internal_1 --> -8($fp) - # local_out_d_at_D_internal_1 = VCALL local_out_d_at_D_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 32($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_out_d_at_D_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_out_d_at_D. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - diff --git a/tests/codegen/life.mips b/tests/codegen/life.mips deleted file mode 100644 index 1a72e65e..00000000 --- a/tests/codegen/life.mips +++ /dev/null @@ -1,21978 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:14 2020 -# School of Math and Computer Science, University of Havana -# - -.data -dummy: .word 0 -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Int: .asciiz "Int" -# Function END -Board: .asciiz "Board" -# Function END -CellularAutomaton: .asciiz "CellularAutomaton" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_in_string_at_IO, function_in_int_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_out_string_at_IO, dummy, dummy, function_copy_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_concat_at_String, function_substr_at_String, dummy, function_abort_at_Object, dummy, function_length_at_String, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Int **** -Int_start: - Int_vtable_pointer: .word Int_vtable - # Function END -Int_end: -# - - -# **** VTABLE for type Board **** -Board_vtable: .word function_in_string_at_IO, function_in_int_at_IO, dummy, function_size_of_board_at_Board, dummy, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_board_init_at_Board, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_out_string_at_IO, dummy, dummy, function_copy_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Board **** -Board_start: - Board_vtable_pointer: .word Board_vtable - # Function END -Board_end: -# - - -# **** VTABLE for type CellularAutomaton **** -CellularAutomaton_vtable: .word function_in_string_at_IO, function_in_int_at_IO, function_northeast_at_CellularAutomaton, function_size_of_board_at_Board, function_east_at_CellularAutomaton, function_num_cells_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_prompt_at_CellularAutomaton, function_out_int_at_IO, function_northwest_at_CellularAutomaton, function_southwest_at_CellularAutomaton, function_evolve_at_CellularAutomaton, function_print_at_CellularAutomaton, function_type_name_at_Object, dummy, function_board_init_at_Board, function_southeast_at_CellularAutomaton, dummy, dummy, function_west_at_CellularAutomaton, function_abort_at_Object, function_neighbors_at_CellularAutomaton, dummy, function_init_at_CellularAutomaton, function_option_at_CellularAutomaton, function_north_at_CellularAutomaton, function_out_string_at_IO, function_cell_at_CellularAutomaton, function_prompt2_at_CellularAutomaton, function_copy_at_Object, function_south_at_CellularAutomaton -# Function END -# - - -# **** Type RECORD for type CellularAutomaton **** -CellularAutomaton_start: - CellularAutomaton_vtable_pointer: .word CellularAutomaton_vtable - # Function END -CellularAutomaton_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_in_string_at_IO, function_in_int_at_IO, function_northeast_at_CellularAutomaton, function_size_of_board_at_Board, function_east_at_CellularAutomaton, function_num_cells_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_prompt_at_CellularAutomaton, function_out_int_at_IO, function_northwest_at_CellularAutomaton, function_southwest_at_CellularAutomaton, function_evolve_at_CellularAutomaton, function_print_at_CellularAutomaton, function_type_name_at_Object, function_main_at_Main, function_board_init_at_Board, function_southeast_at_CellularAutomaton, dummy, dummy, function_west_at_CellularAutomaton, function_abort_at_Object, function_neighbors_at_CellularAutomaton, dummy, function_init_at_CellularAutomaton, function_option_at_CellularAutomaton, function_north_at_CellularAutomaton, function_out_string_at_IO, function_cell_at_CellularAutomaton, function_prompt2_at_CellularAutomaton, function_copy_at_Object, function_south_at_CellularAutomaton -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, 1, 2, 3 -Object__TDT: .word 1, 0, 1, 1, 1, 2, 3, 4 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1 -Board__TDT: .word -1, -1, -1, -1, -1, 0, 1, 2 -CellularAutomaton__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1 -Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz "\n" -# - - -data_5: .asciiz "\n" -# - - -data_6: .asciiz "\n" -# - - -data_7: .asciiz " " -# - - -data_8: .asciiz " " -# - - -data_9: .asciiz " " -# - - -data_10: .asciiz " " -# - - -data_11: .asciiz " " -# - - -data_12: .asciiz " " -# - - -data_13: .asciiz " " -# - - -data_14: .asciiz " " -# - - -data_15: .asciiz " " -# - - -data_16: .asciiz " " -# - - -data_17: .asciiz " " -# - - -data_18: .asciiz " " -# - - -data_19: .asciiz " " -# - - -data_20: .asciiz " " -# - - -data_21: .asciiz "X" -# - - -data_22: .asciiz "X" -# - - -data_23: .asciiz "X" -# - - -data_24: .asciiz "X" -# - - -data_25: .asciiz "X" -# - - -data_26: .asciiz "X" -# - - -data_27: .asciiz "X" -# - - -data_28: .asciiz "X" -# - - -data_29: .asciiz "X" -# - - -data_30: .asciiz "X" -# - - -data_31: .asciiz "X" -# - - -data_32: .asciiz "-" -# - - -data_33: .asciiz "-" -# - - -data_34: .asciiz "\nPlease chose a number:\n" -# - - -data_35: .asciiz "\t1: A cross\n" -# - - -data_36: .asciiz "\t2: A slash from the upper left to lower right\n" -# - - -data_37: .asciiz "\t3: A slash from the upper right to lower left\n" -# - - -data_38: .asciiz "\t4: An X\n" -# - - -data_39: .asciiz "\t5: A greater than sign \n" -# - - -data_40: .asciiz "\t6: A less than sign\n" -# - - -data_41: .asciiz "\t7: Two greater than signs\n" -# - - -data_42: .asciiz "\t8: Two less than signs\n" -# - - -data_43: .asciiz "\t9: A 'V'\n" -# - - -data_44: .asciiz "\t10: An inverse 'V'\n" -# - - -data_45: .asciiz "\t11: Numbers 9 and 10 combined\n" -# - - -data_46: .asciiz "\t12: A full grid\n" -# - - -data_47: .asciiz "\t13: A 'T'\n" -# - - -data_48: .asciiz "\t14: A plus '+'\n" -# - - -data_49: .asciiz "\t15: A 'W'\n" -# - - -data_50: .asciiz "\t16: An 'M'\n" -# - - -data_51: .asciiz "\t17: An 'E'\n" -# - - -data_52: .asciiz "\t18: A '3'\n" -# - - -data_53: .asciiz "\t19: An 'O'\n" -# - - -data_54: .asciiz "\t20: An '8'\n" -# - - -data_55: .asciiz "\t21: An 'S'\n" -# - - -data_56: .asciiz "Your choice => " -# - - -data_57: .asciiz "\n" -# - - -data_58: .asciiz " XX XXXX XXXX XX " -# - - -data_59: .asciiz " X X X X X " -# - - -data_60: .asciiz "X X X X X" -# - - -data_61: .asciiz "X X X X X X X X X" -# - - -data_62: .asciiz "X X X X X " -# - - -data_63: .asciiz " X X X X X" -# - - -data_64: .asciiz "X X X XX X " -# - - -data_65: .asciiz " X XX X X X " -# - - -data_66: .asciiz "X X X X X " -# - - -data_67: .asciiz " X X X X X" -# - - -data_68: .asciiz "X X X X X X X X" -# - - -data_69: .asciiz "XXXXXXXXXXXXXXXXXXXXXXXXX" -# - - -data_70: .asciiz "XXXXX X X X X " -# - - -data_71: .asciiz " X X XXXXX X X " -# - - -data_72: .asciiz "X X X X X X X " -# - - -data_73: .asciiz " X X X X X X X" -# - - -data_74: .asciiz "XXXXX X XXXXX X XXXX" -# - - -data_75: .asciiz "XXX X X X X XXXX " -# - - -data_76: .asciiz " XX X XX X XX " -# - - -data_77: .asciiz " XX X XX X XX X XX X XX " -# - - -data_78: .asciiz " XXXX X XX X XXXX " -# - - -data_79: .asciiz " " -# - - -data_80: .asciiz "Would you like to continue with the next generation? \n" -# - - -data_81: .asciiz "Please use lowercase y or n for your answer [y]: " -# - - -data_82: .asciiz "\n" -# - - -data_83: .asciiz "n" -# - - -data_84: .asciiz "\n\n" -# - - -data_85: .asciiz "Would you like to choose a background pattern? \n" -# - - -data_86: .asciiz "Please use lowercase y or n for your answer [n]: " -# - - -data_87: .asciiz "y" -# - - -data_88: .asciiz "Welcome to the Game of Life.\n" -# - - -data_89: .asciiz "There are many initial states to choose from. \n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - move $a2, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - sw $a2, 12($v0) - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - lw $t2, 12($t2) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - lw $a0, 12($a0) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # LOCAL local_length_at_String_internal_1 --> -8($fp) - # LOCAL local_length_at_String_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -4($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_length_at_String_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Main - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 32 bytes of memory - li $a0, 32 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - # Load type offset - li $t0, 28 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Board__attrib__rows__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Board__attrib__columns__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Board__attrib__board_size__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __CellularAutomaton__attrib__population_map__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__cells__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t0, Main_vtable - # Get pointer to function address - lw $t1, 56($t0) - # Call function. Result is on $v0 - jalr $t1 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Board__attrib__rows__init implementation. -# @Params: -__Board__attrib__rows__init: - # Allocate stack frame for function __Board__attrib__rows__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_attrib__rows__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_attrib__rows__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Board__attrib__rows__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Board__attrib__columns__init implementation. -# @Params: -__Board__attrib__columns__init: - # Allocate stack frame for function __Board__attrib__columns__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_attrib__columns__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_attrib__columns__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Board__attrib__columns__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Board__attrib__board_size__init implementation. -# @Params: -__Board__attrib__board_size__init: - # Allocate stack frame for function __Board__attrib__board_size__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_attrib__board_size__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_attrib__board_size__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Board__attrib__board_size__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_size_of_board_at_Board implementation. -# @Params: -# 0($fp) = param_size_of_board_at_Board_initial_0 -function_size_of_board_at_Board: - # Allocate stack frame for function function_size_of_board_at_Board. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_size_of_board_at_Board_internal_0 --> -4($fp) - # PARAM param_size_of_board_at_Board_initial_0 --> 0($fp) - # local_size_of_board_at_Board_internal_0 = PARAM param_size_of_board_at_Board_initial_0 - lw $t0, 0($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_size_of_board_at_Board_internal_0 --> -4($fp) - # LOCAL local_size_of_board_at_Board_internal_1 --> -8($fp) - # local_size_of_board_at_Board_internal_1 = VCALL local_size_of_board_at_Board_internal_0 length - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 88($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_size_of_board_at_Board_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_size_of_board_at_Board. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_board_init_at_Board implementation. -# @Params: -# 0($fp) = param_board_init_at_Board_start_0 -function_board_init_at_Board: - # Allocate stack frame for function function_board_init_at_Board. - subu $sp, $sp, 204 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 204 - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_board_init_at_Board_internal_3 --> -16($fp) - # local_board_init_at_Board_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_board_init_at_Board_internal_1 --> -8($fp) - # LOCAL local_board_init_at_Board_internal_3 --> -16($fp) - # local_board_init_at_Board_internal_1 = local_board_init_at_Board_internal_3 - lw $t0, -16($fp) - sw $t0, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_board_init_at_Board_start_0 - # PARAM param_board_init_at_Board_start_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_board_init_at_Board_internal_1 --> -8($fp) - # LOCAL local_board_init_at_Board_internal_2 --> -12($fp) - # local_board_init_at_Board_internal_2 = VCALL local_board_init_at_Board_internal_1 size_of_board - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 12($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_2 --> -12($fp) - # local_board_init_at_Board_size_0 = local_board_init_at_Board_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # LOCAL local_board_init_at_Board_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 15 - sw $t0, 12($v0) - sw $v0, -36($fp) - # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_3 - # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_3 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_3 - # IF_ZERO local_board_init_at_Board_internal_8 GOTO label_FALSE_3 - # IF_ZERO local_board_init_at_Board_internal_8 GOTO label_FALSE_3 - lw $t0, -36($fp) - beq $t0, 0, label_FALSE_3 - # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -32($fp) - # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_COMPARE_STRING_6 - # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_COMPARE_STRING_6 - lw $t0, -32($fp) - beq $t0, 0, label_COMPARE_STRING_6 - # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -32($fp) - # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_COMPARE_BY_VALUE_7 - # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_COMPARE_BY_VALUE_7 - lw $t0, -32($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_7 - # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -32($fp) - # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_COMPARE_BY_VALUE_7 - # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_COMPARE_BY_VALUE_7 - lw $t0, -32($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_7 - # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_8 --> -36($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -36($fp) - sub $a0, $a0, $a1 - sw $a0, -32($fp) - # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_4 - # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_4 - lw $t0, -32($fp) - beq $t0, 0, label_TRUE_4 - # GOTO label_FALSE_3 - j label_FALSE_3 - label_COMPARE_BY_VALUE_7: - # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_8 --> -36($fp) - lw $a0, -4($fp) - lw $a1, -36($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -32($fp) - # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_4 - # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_4 - lw $t0, -32($fp) - beq $t0, 0, label_TRUE_4 - # GOTO label_FALSE_3 - j label_FALSE_3 - label_COMPARE_STRING_6: - # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_8 --> -36($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -36($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -32($fp) - # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_CONTINUE_8 - # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_CONTINUE_8 - lw $t0, -32($fp) - beq $t0, 0, label_CONTINUE_8 - # GOTO label_FALSE_3 - j label_FALSE_3 - label_CONTINUE_8: - # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_8 --> -36($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -36($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_9: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_10 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_9 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_10: - # Store result - sw $a2, -32($fp) - # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_4 - # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_4 - lw $t0, -32($fp) - beq $t0, 0, label_TRUE_4 - label_FALSE_3: - # LOCAL local_board_init_at_Board_internal_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -28($fp) - # GOTO label_END_5 -j label_END_5 -label_TRUE_4: - # LOCAL local_board_init_at_Board_internal_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -28($fp) - label_END_5: -# LOCAL local_board_init_at_Board_internal_4 --> -20($fp) -# LOCAL local_board_init_at_Board_internal_6 --> -28($fp) -# Obtain value from -28($fp) -lw $v0, -28($fp) -lw $v0, 12($v0) -sw $v0, -20($fp) -# IF_ZERO local_board_init_at_Board_internal_4 GOTO label_FALSEIF_1 -# IF_ZERO local_board_init_at_Board_internal_4 GOTO label_FALSEIF_1 -lw $t0, -20($fp) -beq $t0, 0, label_FALSEIF_1 -# LOCAL local_board_init_at_Board_internal_9 --> -40($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 3 -sw $t0, 12($v0) -sw $v0, -40($fp) -# -# LOCAL local_board_init_at_Board_internal_9 --> -40($fp) -lw $t0, -40($fp) -sw $t0, 12($s1) -# LOCAL local_board_init_at_Board_internal_10 --> -44($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 5 -sw $t0, 12($v0) -sw $v0, -44($fp) -# -# LOCAL local_board_init_at_Board_internal_10 --> -44($fp) -lw $t0, -44($fp) -sw $t0, 16($s1) -# -# LOCAL local_board_init_at_Board_size_0 --> -4($fp) -lw $t0, -4($fp) -sw $t0, 20($s1) -# LOCAL local_board_init_at_Board_internal_5 --> -24($fp) -# local_board_init_at_Board_internal_5 = -# GOTO label_ENDIF_2 -j label_ENDIF_2 -label_FALSEIF_1: - # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 16 - sw $t0, 12($v0) - sw $v0, -64($fp) - # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_13 - # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_13 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_13 - # IF_ZERO local_board_init_at_Board_internal_15 GOTO label_FALSE_13 - # IF_ZERO local_board_init_at_Board_internal_15 GOTO label_FALSE_13 - lw $t0, -64($fp) - beq $t0, 0, label_FALSE_13 - # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -60($fp) - # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_COMPARE_STRING_16 - # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_COMPARE_STRING_16 - lw $t0, -60($fp) - beq $t0, 0, label_COMPARE_STRING_16 - # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -60($fp) - # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_COMPARE_BY_VALUE_17 - # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_COMPARE_BY_VALUE_17 - lw $t0, -60($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_17 - # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -60($fp) - # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_COMPARE_BY_VALUE_17 - # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_COMPARE_BY_VALUE_17 - lw $t0, -60($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_17 - # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -64($fp) - sub $a0, $a0, $a1 - sw $a0, -60($fp) - # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_TRUE_14 - # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_TRUE_14 - lw $t0, -60($fp) - beq $t0, 0, label_TRUE_14 - # GOTO label_FALSE_13 - j label_FALSE_13 - label_COMPARE_BY_VALUE_17: - # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) - lw $a0, -4($fp) - lw $a1, -64($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -60($fp) - # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_TRUE_14 - # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_TRUE_14 - lw $t0, -60($fp) - beq $t0, 0, label_TRUE_14 - # GOTO label_FALSE_13 - j label_FALSE_13 - label_COMPARE_STRING_16: - # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -64($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -60($fp) - # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_CONTINUE_18 - # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_CONTINUE_18 - lw $t0, -60($fp) - beq $t0, 0, label_CONTINUE_18 - # GOTO label_FALSE_13 - j label_FALSE_13 - label_CONTINUE_18: - # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -64($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_19: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_20 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_19 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_20: - # Store result - sw $a2, -60($fp) - # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_TRUE_14 - # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_TRUE_14 - lw $t0, -60($fp) - beq $t0, 0, label_TRUE_14 - label_FALSE_13: - # LOCAL local_board_init_at_Board_internal_13 --> -56($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -56($fp) - # GOTO label_END_15 -j label_END_15 -label_TRUE_14: - # LOCAL local_board_init_at_Board_internal_13 --> -56($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -56($fp) - label_END_15: -# LOCAL local_board_init_at_Board_internal_11 --> -48($fp) -# LOCAL local_board_init_at_Board_internal_13 --> -56($fp) -# Obtain value from -56($fp) -lw $v0, -56($fp) -lw $v0, 12($v0) -sw $v0, -48($fp) -# IF_ZERO local_board_init_at_Board_internal_11 GOTO label_FALSEIF_11 -# IF_ZERO local_board_init_at_Board_internal_11 GOTO label_FALSEIF_11 -lw $t0, -48($fp) -beq $t0, 0, label_FALSEIF_11 -# LOCAL local_board_init_at_Board_internal_16 --> -68($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 4 -sw $t0, 12($v0) -sw $v0, -68($fp) -# -# LOCAL local_board_init_at_Board_internal_16 --> -68($fp) -lw $t0, -68($fp) -sw $t0, 12($s1) -# LOCAL local_board_init_at_Board_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 4 -sw $t0, 12($v0) -sw $v0, -72($fp) -# -# LOCAL local_board_init_at_Board_internal_17 --> -72($fp) -lw $t0, -72($fp) -sw $t0, 16($s1) -# -# LOCAL local_board_init_at_Board_size_0 --> -4($fp) -lw $t0, -4($fp) -sw $t0, 20($s1) -# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) -# local_board_init_at_Board_internal_12 = -# GOTO label_ENDIF_12 -j label_ENDIF_12 -label_FALSEIF_11: - # LOCAL local_board_init_at_Board_internal_22 --> -92($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 20 - sw $t0, 12($v0) - sw $v0, -92($fp) - # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_23 - # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_23 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_23 - # IF_ZERO local_board_init_at_Board_internal_22 GOTO label_FALSE_23 - # IF_ZERO local_board_init_at_Board_internal_22 GOTO label_FALSE_23 - lw $t0, -92($fp) - beq $t0, 0, label_FALSE_23 - # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_COMPARE_STRING_26 - # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_COMPARE_STRING_26 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_STRING_26 - # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_COMPARE_BY_VALUE_27 - # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_COMPARE_BY_VALUE_27 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_27 - # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_COMPARE_BY_VALUE_27 - # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_COMPARE_BY_VALUE_27 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_27 - # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_22 --> -92($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -92($fp) - sub $a0, $a0, $a1 - sw $a0, -88($fp) - # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_TRUE_24 - # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_TRUE_24 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_24 - # GOTO label_FALSE_23 - j label_FALSE_23 - label_COMPARE_BY_VALUE_27: - # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_22 --> -92($fp) - lw $a0, -4($fp) - lw $a1, -92($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -88($fp) - # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_TRUE_24 - # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_TRUE_24 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_24 - # GOTO label_FALSE_23 - j label_FALSE_23 - label_COMPARE_STRING_26: - # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_22 --> -92($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -92($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -88($fp) - # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_CONTINUE_28 - # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_CONTINUE_28 - lw $t0, -88($fp) - beq $t0, 0, label_CONTINUE_28 - # GOTO label_FALSE_23 - j label_FALSE_23 - label_CONTINUE_28: - # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_22 --> -92($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -92($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_29: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_30 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_29 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_30: - # Store result - sw $a2, -88($fp) - # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_TRUE_24 - # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_TRUE_24 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_24 - label_FALSE_23: - # LOCAL local_board_init_at_Board_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -84($fp) - # GOTO label_END_25 -j label_END_25 -label_TRUE_24: - # LOCAL local_board_init_at_Board_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -84($fp) - label_END_25: -# LOCAL local_board_init_at_Board_internal_18 --> -76($fp) -# LOCAL local_board_init_at_Board_internal_20 --> -84($fp) -# Obtain value from -84($fp) -lw $v0, -84($fp) -lw $v0, 12($v0) -sw $v0, -76($fp) -# IF_ZERO local_board_init_at_Board_internal_18 GOTO label_FALSEIF_21 -# IF_ZERO local_board_init_at_Board_internal_18 GOTO label_FALSEIF_21 -lw $t0, -76($fp) -beq $t0, 0, label_FALSEIF_21 -# LOCAL local_board_init_at_Board_internal_23 --> -96($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 4 -sw $t0, 12($v0) -sw $v0, -96($fp) -# -# LOCAL local_board_init_at_Board_internal_23 --> -96($fp) -lw $t0, -96($fp) -sw $t0, 12($s1) -# LOCAL local_board_init_at_Board_internal_24 --> -100($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 5 -sw $t0, 12($v0) -sw $v0, -100($fp) -# -# LOCAL local_board_init_at_Board_internal_24 --> -100($fp) -lw $t0, -100($fp) -sw $t0, 16($s1) -# -# LOCAL local_board_init_at_Board_size_0 --> -4($fp) -lw $t0, -4($fp) -sw $t0, 20($s1) -# LOCAL local_board_init_at_Board_internal_19 --> -80($fp) -# local_board_init_at_Board_internal_19 = -# GOTO label_ENDIF_22 -j label_ENDIF_22 -label_FALSEIF_21: - # LOCAL local_board_init_at_Board_internal_29 --> -120($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 21 - sw $t0, 12($v0) - sw $v0, -120($fp) - # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_33 - # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_33 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_33 - # IF_ZERO local_board_init_at_Board_internal_29 GOTO label_FALSE_33 - # IF_ZERO local_board_init_at_Board_internal_29 GOTO label_FALSE_33 - lw $t0, -120($fp) - beq $t0, 0, label_FALSE_33 - # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -116($fp) - # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_COMPARE_STRING_36 - # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_COMPARE_STRING_36 - lw $t0, -116($fp) - beq $t0, 0, label_COMPARE_STRING_36 - # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -116($fp) - # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_COMPARE_BY_VALUE_37 - # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_COMPARE_BY_VALUE_37 - lw $t0, -116($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_37 - # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -116($fp) - # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_COMPARE_BY_VALUE_37 - # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_COMPARE_BY_VALUE_37 - lw $t0, -116($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_37 - # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_29 --> -120($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -120($fp) - sub $a0, $a0, $a1 - sw $a0, -116($fp) - # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_TRUE_34 - # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_TRUE_34 - lw $t0, -116($fp) - beq $t0, 0, label_TRUE_34 - # GOTO label_FALSE_33 - j label_FALSE_33 - label_COMPARE_BY_VALUE_37: - # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_29 --> -120($fp) - lw $a0, -4($fp) - lw $a1, -120($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -116($fp) - # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_TRUE_34 - # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_TRUE_34 - lw $t0, -116($fp) - beq $t0, 0, label_TRUE_34 - # GOTO label_FALSE_33 - j label_FALSE_33 - label_COMPARE_STRING_36: - # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_29 --> -120($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -120($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -116($fp) - # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_CONTINUE_38 - # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_CONTINUE_38 - lw $t0, -116($fp) - beq $t0, 0, label_CONTINUE_38 - # GOTO label_FALSE_33 - j label_FALSE_33 - label_CONTINUE_38: - # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_29 --> -120($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -120($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_39: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_40 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_39 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_40: - # Store result - sw $a2, -116($fp) - # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_TRUE_34 - # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_TRUE_34 - lw $t0, -116($fp) - beq $t0, 0, label_TRUE_34 - label_FALSE_33: - # LOCAL local_board_init_at_Board_internal_27 --> -112($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -112($fp) - # GOTO label_END_35 -j label_END_35 -label_TRUE_34: - # LOCAL local_board_init_at_Board_internal_27 --> -112($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -112($fp) - label_END_35: -# LOCAL local_board_init_at_Board_internal_25 --> -104($fp) -# LOCAL local_board_init_at_Board_internal_27 --> -112($fp) -# Obtain value from -112($fp) -lw $v0, -112($fp) -lw $v0, 12($v0) -sw $v0, -104($fp) -# IF_ZERO local_board_init_at_Board_internal_25 GOTO label_FALSEIF_31 -# IF_ZERO local_board_init_at_Board_internal_25 GOTO label_FALSEIF_31 -lw $t0, -104($fp) -beq $t0, 0, label_FALSEIF_31 -# LOCAL local_board_init_at_Board_internal_30 --> -124($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 3 -sw $t0, 12($v0) -sw $v0, -124($fp) -# -# LOCAL local_board_init_at_Board_internal_30 --> -124($fp) -lw $t0, -124($fp) -sw $t0, 12($s1) -# LOCAL local_board_init_at_Board_internal_31 --> -128($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 7 -sw $t0, 12($v0) -sw $v0, -128($fp) -# -# LOCAL local_board_init_at_Board_internal_31 --> -128($fp) -lw $t0, -128($fp) -sw $t0, 16($s1) -# -# LOCAL local_board_init_at_Board_size_0 --> -4($fp) -lw $t0, -4($fp) -sw $t0, 20($s1) -# LOCAL local_board_init_at_Board_internal_26 --> -108($fp) -# local_board_init_at_Board_internal_26 = -# GOTO label_ENDIF_32 -j label_ENDIF_32 -label_FALSEIF_31: - # LOCAL local_board_init_at_Board_internal_36 --> -148($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 25 - sw $t0, 12($v0) - sw $v0, -148($fp) - # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_43 - # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_43 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_43 - # IF_ZERO local_board_init_at_Board_internal_36 GOTO label_FALSE_43 - # IF_ZERO local_board_init_at_Board_internal_36 GOTO label_FALSE_43 - lw $t0, -148($fp) - beq $t0, 0, label_FALSE_43 - # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -144($fp) - # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_COMPARE_STRING_46 - # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_COMPARE_STRING_46 - lw $t0, -144($fp) - beq $t0, 0, label_COMPARE_STRING_46 - # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -144($fp) - # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_COMPARE_BY_VALUE_47 - # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_COMPARE_BY_VALUE_47 - lw $t0, -144($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_47 - # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -144($fp) - # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_COMPARE_BY_VALUE_47 - # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_COMPARE_BY_VALUE_47 - lw $t0, -144($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_47 - # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_36 --> -148($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -148($fp) - sub $a0, $a0, $a1 - sw $a0, -144($fp) - # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_TRUE_44 - # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_TRUE_44 - lw $t0, -144($fp) - beq $t0, 0, label_TRUE_44 - # GOTO label_FALSE_43 - j label_FALSE_43 - label_COMPARE_BY_VALUE_47: - # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_36 --> -148($fp) - lw $a0, -4($fp) - lw $a1, -148($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -144($fp) - # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_TRUE_44 - # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_TRUE_44 - lw $t0, -144($fp) - beq $t0, 0, label_TRUE_44 - # GOTO label_FALSE_43 - j label_FALSE_43 - label_COMPARE_STRING_46: - # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_36 --> -148($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -148($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -144($fp) - # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_CONTINUE_48 - # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_CONTINUE_48 - lw $t0, -144($fp) - beq $t0, 0, label_CONTINUE_48 - # GOTO label_FALSE_43 - j label_FALSE_43 - label_CONTINUE_48: - # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_36 --> -148($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -148($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_49: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_50 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_49 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_50: - # Store result - sw $a2, -144($fp) - # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_TRUE_44 - # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_TRUE_44 - lw $t0, -144($fp) - beq $t0, 0, label_TRUE_44 - label_FALSE_43: - # LOCAL local_board_init_at_Board_internal_34 --> -140($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -140($fp) - # GOTO label_END_45 -j label_END_45 -label_TRUE_44: - # LOCAL local_board_init_at_Board_internal_34 --> -140($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -140($fp) - label_END_45: -# LOCAL local_board_init_at_Board_internal_32 --> -132($fp) -# LOCAL local_board_init_at_Board_internal_34 --> -140($fp) -# Obtain value from -140($fp) -lw $v0, -140($fp) -lw $v0, 12($v0) -sw $v0, -132($fp) -# IF_ZERO local_board_init_at_Board_internal_32 GOTO label_FALSEIF_41 -# IF_ZERO local_board_init_at_Board_internal_32 GOTO label_FALSEIF_41 -lw $t0, -132($fp) -beq $t0, 0, label_FALSEIF_41 -# LOCAL local_board_init_at_Board_internal_37 --> -152($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 5 -sw $t0, 12($v0) -sw $v0, -152($fp) -# -# LOCAL local_board_init_at_Board_internal_37 --> -152($fp) -lw $t0, -152($fp) -sw $t0, 12($s1) -# LOCAL local_board_init_at_Board_internal_38 --> -156($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 5 -sw $t0, 12($v0) -sw $v0, -156($fp) -# -# LOCAL local_board_init_at_Board_internal_38 --> -156($fp) -lw $t0, -156($fp) -sw $t0, 16($s1) -# -# LOCAL local_board_init_at_Board_size_0 --> -4($fp) -lw $t0, -4($fp) -sw $t0, 20($s1) -# LOCAL local_board_init_at_Board_internal_33 --> -136($fp) -# local_board_init_at_Board_internal_33 = -# GOTO label_ENDIF_42 -j label_ENDIF_42 -label_FALSEIF_41: - # LOCAL local_board_init_at_Board_internal_43 --> -176($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 28 - sw $t0, 12($v0) - sw $v0, -176($fp) - # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_53 - # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_53 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_53 - # IF_ZERO local_board_init_at_Board_internal_43 GOTO label_FALSE_53 - # IF_ZERO local_board_init_at_Board_internal_43 GOTO label_FALSE_53 - lw $t0, -176($fp) - beq $t0, 0, label_FALSE_53 - # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -172($fp) - # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_COMPARE_STRING_56 - # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_COMPARE_STRING_56 - lw $t0, -172($fp) - beq $t0, 0, label_COMPARE_STRING_56 - # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -172($fp) - # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_COMPARE_BY_VALUE_57 - # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_COMPARE_BY_VALUE_57 - lw $t0, -172($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_57 - # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -172($fp) - # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_COMPARE_BY_VALUE_57 - # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_COMPARE_BY_VALUE_57 - lw $t0, -172($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_57 - # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_43 --> -176($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -176($fp) - sub $a0, $a0, $a1 - sw $a0, -172($fp) - # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_TRUE_54 - # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_TRUE_54 - lw $t0, -172($fp) - beq $t0, 0, label_TRUE_54 - # GOTO label_FALSE_53 - j label_FALSE_53 - label_COMPARE_BY_VALUE_57: - # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_43 --> -176($fp) - lw $a0, -4($fp) - lw $a1, -176($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -172($fp) - # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_TRUE_54 - # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_TRUE_54 - lw $t0, -172($fp) - beq $t0, 0, label_TRUE_54 - # GOTO label_FALSE_53 - j label_FALSE_53 - label_COMPARE_STRING_56: - # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_43 --> -176($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -176($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -172($fp) - # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_CONTINUE_58 - # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_CONTINUE_58 - lw $t0, -172($fp) - beq $t0, 0, label_CONTINUE_58 - # GOTO label_FALSE_53 - j label_FALSE_53 - label_CONTINUE_58: - # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - # LOCAL local_board_init_at_Board_internal_43 --> -176($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -176($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_59: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_60 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_59 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_60: - # Store result - sw $a2, -172($fp) - # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_TRUE_54 - # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_TRUE_54 - lw $t0, -172($fp) - beq $t0, 0, label_TRUE_54 - label_FALSE_53: - # LOCAL local_board_init_at_Board_internal_41 --> -168($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -168($fp) - # GOTO label_END_55 -j label_END_55 -label_TRUE_54: - # LOCAL local_board_init_at_Board_internal_41 --> -168($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -168($fp) - label_END_55: -# LOCAL local_board_init_at_Board_internal_39 --> -160($fp) -# LOCAL local_board_init_at_Board_internal_41 --> -168($fp) -# Obtain value from -168($fp) -lw $v0, -168($fp) -lw $v0, 12($v0) -sw $v0, -160($fp) -# IF_ZERO local_board_init_at_Board_internal_39 GOTO label_FALSEIF_51 -# IF_ZERO local_board_init_at_Board_internal_39 GOTO label_FALSEIF_51 -lw $t0, -160($fp) -beq $t0, 0, label_FALSEIF_51 -# LOCAL local_board_init_at_Board_internal_44 --> -180($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 7 -sw $t0, 12($v0) -sw $v0, -180($fp) -# -# LOCAL local_board_init_at_Board_internal_44 --> -180($fp) -lw $t0, -180($fp) -sw $t0, 12($s1) -# LOCAL local_board_init_at_Board_internal_45 --> -184($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 4 -sw $t0, 12($v0) -sw $v0, -184($fp) -# -# LOCAL local_board_init_at_Board_internal_45 --> -184($fp) -lw $t0, -184($fp) -sw $t0, 16($s1) -# -# LOCAL local_board_init_at_Board_size_0 --> -4($fp) -lw $t0, -4($fp) -sw $t0, 20($s1) -# LOCAL local_board_init_at_Board_internal_40 --> -164($fp) -# local_board_init_at_Board_internal_40 = -# GOTO label_ENDIF_52 -j label_ENDIF_52 -label_FALSEIF_51: - # LOCAL local_board_init_at_Board_internal_46 --> -188($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 5 - sw $t0, 12($v0) - sw $v0, -188($fp) - # - # LOCAL local_board_init_at_Board_internal_46 --> -188($fp) - lw $t0, -188($fp) - sw $t0, 12($s1) - # LOCAL local_board_init_at_Board_internal_47 --> -192($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 5 - sw $t0, 12($v0) - sw $v0, -192($fp) - # - # LOCAL local_board_init_at_Board_internal_47 --> -192($fp) - lw $t0, -192($fp) - sw $t0, 16($s1) - # - # LOCAL local_board_init_at_Board_size_0 --> -4($fp) - lw $t0, -4($fp) - sw $t0, 20($s1) - # LOCAL local_board_init_at_Board_internal_40 --> -164($fp) - # local_board_init_at_Board_internal_40 = - label_ENDIF_52: -# LOCAL local_board_init_at_Board_internal_33 --> -136($fp) -# LOCAL local_board_init_at_Board_internal_40 --> -164($fp) -# local_board_init_at_Board_internal_33 = local_board_init_at_Board_internal_40 -lw $t0, -164($fp) -sw $t0, -136($fp) -label_ENDIF_42: -# LOCAL local_board_init_at_Board_internal_26 --> -108($fp) -# LOCAL local_board_init_at_Board_internal_33 --> -136($fp) -# local_board_init_at_Board_internal_26 = local_board_init_at_Board_internal_33 -lw $t0, -136($fp) -sw $t0, -108($fp) -label_ENDIF_32: -# LOCAL local_board_init_at_Board_internal_19 --> -80($fp) -# LOCAL local_board_init_at_Board_internal_26 --> -108($fp) -# local_board_init_at_Board_internal_19 = local_board_init_at_Board_internal_26 -lw $t0, -108($fp) -sw $t0, -80($fp) -label_ENDIF_22: -# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) -# LOCAL local_board_init_at_Board_internal_19 --> -80($fp) -# local_board_init_at_Board_internal_12 = local_board_init_at_Board_internal_19 -lw $t0, -80($fp) -sw $t0, -52($fp) -label_ENDIF_12: -# LOCAL local_board_init_at_Board_internal_5 --> -24($fp) -# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) -# local_board_init_at_Board_internal_5 = local_board_init_at_Board_internal_12 -lw $t0, -52($fp) -sw $t0, -24($fp) -label_ENDIF_2: -# LOCAL local_board_init_at_Board_internal_48 --> -196($fp) -# local_board_init_at_Board_internal_48 = SELF -sw $s1, -196($fp) -# RETURN local_board_init_at_Board_internal_48 -lw $v0, -196($fp) -# Deallocate stack frame for function function_board_init_at_Board. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 204 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# __CellularAutomaton__attrib__population_map__init implementation. -# @Params: -__CellularAutomaton__attrib__population_map__init: - # Allocate stack frame for function __CellularAutomaton__attrib__population_map__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_rAutomaton__attrib__population_map__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_0 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -4($fp) - # RETURN local_rAutomaton__attrib__population_map__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __CellularAutomaton__attrib__population_map__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_init_at_CellularAutomaton_map_0 -function_init_at_CellularAutomaton: - # Allocate stack frame for function function_init_at_CellularAutomaton. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_CellularAutomaton_map_0 --> 0($fp) - lw $t0, 0($fp) - sw $t0, 24($s1) - # LOCAL local_init_at_CellularAutomaton_internal_2 --> -12($fp) - # local_init_at_CellularAutomaton_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_init_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_init_at_CellularAutomaton_internal_2 --> -12($fp) - # local_init_at_CellularAutomaton_internal_0 = local_init_at_CellularAutomaton_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_init_at_CellularAutomaton_map_0 - # PARAM param_init_at_CellularAutomaton_map_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_init_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_init_at_CellularAutomaton_internal_1 --> -8($fp) - # local_init_at_CellularAutomaton_internal_1 = VCALL local_init_at_CellularAutomaton_internal_0 board_init - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 60($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_init_at_CellularAutomaton_internal_3 --> -16($fp) - # local_init_at_CellularAutomaton_internal_3 = SELF - sw $s1, -16($fp) - # RETURN local_init_at_CellularAutomaton_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_init_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_print_at_CellularAutomaton implementation. -# @Params: -function_print_at_CellularAutomaton: - # Allocate stack frame for function function_print_at_CellularAutomaton. - subu $sp, $sp, 120 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 120 - # LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_print_at_CellularAutomaton_internal_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -8($fp) - # LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) - # LOCAL local_print_at_CellularAutomaton_internal_1 --> -8($fp) - # local_print_at_CellularAutomaton_i_0 = local_print_at_CellularAutomaton_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # LOCAL local_print_at_CellularAutomaton_num_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # local_print_at_CellularAutomaton_internal_3 = GETATTRIBUTE board_size CellularAutomaton - # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) - lw $t0, 20($s1) - sw $t0, -16($fp) - # LOCAL local_print_at_CellularAutomaton_num_2 --> -12($fp) - # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) - # local_print_at_CellularAutomaton_num_2 = local_print_at_CellularAutomaton_internal_3 - lw $t0, -16($fp) - sw $t0, -12($fp) - # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) - # local_print_at_CellularAutomaton_internal_6 = SELF - sw $s1, -28($fp) - # LOCAL local_print_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) - # local_print_at_CellularAutomaton_internal_4 = local_print_at_CellularAutomaton_internal_6 - lw $t0, -28($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_4 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -32($fp) - # ARG local_print_at_CellularAutomaton_internal_7 - # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) - lw $t0, -32($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) - # local_print_at_CellularAutomaton_internal_5 = VCALL local_print_at_CellularAutomaton_internal_4 out_string - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - label_WHILE_61: - # LOCAL local_print_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) - # LOCAL local_print_at_CellularAutomaton_num_2 --> -12($fp) - lw $a0, -4($fp) - lw $a1, -12($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_GREATER_ZERO local_print_at_CellularAutomaton_internal_9 GOTO label_FALSE_63 - # IF_GREATER_ZERO local_print_at_CellularAutomaton_internal_9 GOTO label_FALSE_63 - lw $t0, -40($fp) - bgt $t0, 0, label_FALSE_63 - # IF_ZERO local_print_at_CellularAutomaton_internal_9 GOTO label_FALSE_63 - # IF_ZERO local_print_at_CellularAutomaton_internal_9 GOTO label_FALSE_63 - lw $t0, -40($fp) - beq $t0, 0, label_FALSE_63 - # LOCAL local_print_at_CellularAutomaton_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -40($fp) - # GOTO label_END_64 -j label_END_64 -label_FALSE_63: - # LOCAL local_print_at_CellularAutomaton_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -40($fp) - label_END_64: -# LOCAL local_print_at_CellularAutomaton_internal_8 --> -36($fp) -# LOCAL local_print_at_CellularAutomaton_internal_9 --> -40($fp) -# Obtain value from -40($fp) -lw $v0, -40($fp) -lw $v0, 12($v0) -sw $v0, -36($fp) -# IF_ZERO local_print_at_CellularAutomaton_internal_8 GOTO label_WHILE_END_62 -# IF_ZERO local_print_at_CellularAutomaton_internal_8 GOTO label_WHILE_END_62 -lw $t0, -36($fp) -beq $t0, 0, label_WHILE_END_62 -# LOCAL local_print_at_CellularAutomaton_internal_12 --> -52($fp) -# local_print_at_CellularAutomaton_internal_12 = SELF -sw $s1, -52($fp) -# LOCAL local_print_at_CellularAutomaton_internal_10 --> -44($fp) -# LOCAL local_print_at_CellularAutomaton_internal_12 --> -52($fp) -# local_print_at_CellularAutomaton_internal_10 = local_print_at_CellularAutomaton_internal_12 -lw $t0, -52($fp) -sw $t0, -44($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_print_at_CellularAutomaton_internal_15 = GETATTRIBUTE population_map CellularAutomaton -# LOCAL local_print_at_CellularAutomaton_internal_15 --> -64($fp) -lw $t0, 24($s1) -sw $t0, -64($fp) -# LOCAL local_print_at_CellularAutomaton_internal_13 --> -56($fp) -# LOCAL local_print_at_CellularAutomaton_internal_15 --> -64($fp) -# local_print_at_CellularAutomaton_internal_13 = local_print_at_CellularAutomaton_internal_15 -lw $t0, -64($fp) -sw $t0, -56($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_print_at_CellularAutomaton_i_0 -# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) -lw $t0, -4($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# local_print_at_CellularAutomaton_internal_16 = GETATTRIBUTE columns CellularAutomaton -# LOCAL local_print_at_CellularAutomaton_internal_16 --> -68($fp) -lw $t0, 16($s1) -sw $t0, -68($fp) -# ARG local_print_at_CellularAutomaton_internal_16 -# LOCAL local_print_at_CellularAutomaton_internal_16 --> -68($fp) -lw $t0, -68($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_print_at_CellularAutomaton_internal_13 --> -56($fp) -# LOCAL local_print_at_CellularAutomaton_internal_14 --> -60($fp) -# local_print_at_CellularAutomaton_internal_14 = VCALL local_print_at_CellularAutomaton_internal_13 substr -# Save new self pointer in $s1 -lw $s1, -56($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 72($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -60($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_print_at_CellularAutomaton_internal_14 -# LOCAL local_print_at_CellularAutomaton_internal_14 --> -60($fp) -lw $t0, -60($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_print_at_CellularAutomaton_internal_10 --> -44($fp) -# LOCAL local_print_at_CellularAutomaton_internal_11 --> -48($fp) -# local_print_at_CellularAutomaton_internal_11 = VCALL local_print_at_CellularAutomaton_internal_10 out_string -# Save new self pointer in $s1 -lw $s1, -44($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 104($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -48($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_print_at_CellularAutomaton_internal_19 --> -80($fp) -# local_print_at_CellularAutomaton_internal_19 = SELF -sw $s1, -80($fp) -# LOCAL local_print_at_CellularAutomaton_internal_17 --> -72($fp) -# LOCAL local_print_at_CellularAutomaton_internal_19 --> -80($fp) -# local_print_at_CellularAutomaton_internal_17 = local_print_at_CellularAutomaton_internal_19 -lw $t0, -80($fp) -sw $t0, -72($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_print_at_CellularAutomaton_internal_20 --> -84($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_5 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -84($fp) -# ARG local_print_at_CellularAutomaton_internal_20 -# LOCAL local_print_at_CellularAutomaton_internal_20 --> -84($fp) -lw $t0, -84($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_print_at_CellularAutomaton_internal_17 --> -72($fp) -# LOCAL local_print_at_CellularAutomaton_internal_18 --> -76($fp) -# local_print_at_CellularAutomaton_internal_18 = VCALL local_print_at_CellularAutomaton_internal_17 out_string -# Save new self pointer in $s1 -lw $s1, -72($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 104($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -76($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# local_print_at_CellularAutomaton_internal_22 = GETATTRIBUTE columns CellularAutomaton -# LOCAL local_print_at_CellularAutomaton_internal_22 --> -92($fp) -lw $t0, 16($s1) -sw $t0, -92($fp) -# LOCAL local_print_at_CellularAutomaton_internal_21 --> -88($fp) -# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) -# LOCAL local_print_at_CellularAutomaton_internal_22 --> -92($fp) -# local_print_at_CellularAutomaton_internal_21 = local_print_at_CellularAutomaton_i_0 + local_print_at_CellularAutomaton_internal_22 -lw $t1, -4($fp) -lw $t0, 12($t1) -lw $t1, -92($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -88($fp) -# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) -# LOCAL local_print_at_CellularAutomaton_internal_21 --> -88($fp) -# local_print_at_CellularAutomaton_i_0 = local_print_at_CellularAutomaton_internal_21 -lw $t0, -88($fp) -sw $t0, -4($fp) -# GOTO label_WHILE_61 -j label_WHILE_61 -label_WHILE_END_62: - # LOCAL local_print_at_CellularAutomaton_internal_25 --> -104($fp) - # local_print_at_CellularAutomaton_internal_25 = SELF - sw $s1, -104($fp) - # LOCAL local_print_at_CellularAutomaton_internal_23 --> -96($fp) - # LOCAL local_print_at_CellularAutomaton_internal_25 --> -104($fp) - # local_print_at_CellularAutomaton_internal_23 = local_print_at_CellularAutomaton_internal_25 - lw $t0, -104($fp) - sw $t0, -96($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_CellularAutomaton_internal_26 --> -108($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_6 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -108($fp) - # ARG local_print_at_CellularAutomaton_internal_26 - # LOCAL local_print_at_CellularAutomaton_internal_26 --> -108($fp) - lw $t0, -108($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_CellularAutomaton_internal_23 --> -96($fp) - # LOCAL local_print_at_CellularAutomaton_internal_24 --> -100($fp) - # local_print_at_CellularAutomaton_internal_24 = VCALL local_print_at_CellularAutomaton_internal_23 out_string - # Save new self pointer in $s1 - lw $s1, -96($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -100($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_CellularAutomaton_internal_27 --> -112($fp) - # local_print_at_CellularAutomaton_internal_27 = SELF - sw $s1, -112($fp) - # RETURN local_print_at_CellularAutomaton_internal_27 - lw $v0, -112($fp) - # Deallocate stack frame for function function_print_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 120 - jr $ra - # Function END - - -# function_num_cells_at_CellularAutomaton implementation. -# @Params: -function_num_cells_at_CellularAutomaton: - # Allocate stack frame for function function_num_cells_at_CellularAutomaton. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_num_cells_at_CellularAutomaton_internal_2 = GETATTRIBUTE population_map CellularAutomaton - # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) - lw $t0, 24($s1) - sw $t0, -12($fp) - # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) - # local_num_cells_at_CellularAutomaton_internal_0 = local_num_cells_at_CellularAutomaton_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) - # LOCAL local_num_cells_at_CellularAutomaton_internal_1 --> -8($fp) - # local_num_cells_at_CellularAutomaton_internal_1 = VCALL local_num_cells_at_CellularAutomaton_internal_0 length - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 88($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_num_cells_at_CellularAutomaton_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_num_cells_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cell_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_cell_at_CellularAutomaton_position_0 -function_cell_at_CellularAutomaton: - # Allocate stack frame for function function_cell_at_CellularAutomaton. - subu $sp, $sp, 52 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 52 - # local_cell_at_CellularAutomaton_internal_4 = GETATTRIBUTE board_size CellularAutomaton - # LOCAL local_cell_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t0, 20($s1) - sw $t0, -20($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -24($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_5 --> -24($fp) - # local_cell_at_CellularAutomaton_internal_3 = local_cell_at_CellularAutomaton_internal_4 - local_cell_at_CellularAutomaton_internal_5 - lw $t1, -20($fp) - lw $t0, 12($t1) - lw $t1, -24($fp) - lw $t2, 12($t1) - sub $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -16($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_cell_at_CellularAutomaton_position_0 --> 0($fp) - lw $a0, -16($fp) - lw $a1, 0($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -12($fp) - # IF_GREATER_ZERO local_cell_at_CellularAutomaton_internal_2 GOTO label_FALSE_67 - # IF_GREATER_ZERO local_cell_at_CellularAutomaton_internal_2 GOTO label_FALSE_67 - lw $t0, -12($fp) - bgt $t0, 0, label_FALSE_67 - # IF_ZERO local_cell_at_CellularAutomaton_internal_2 GOTO label_FALSE_67 - # IF_ZERO local_cell_at_CellularAutomaton_internal_2 GOTO label_FALSE_67 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_67 - # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_68 -j label_END_68 -label_FALSE_67: - # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_68: -# LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_cell_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_65 -# IF_ZERO local_cell_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_65 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_65 -# LOCAL local_cell_at_CellularAutomaton_internal_6 --> -28($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_7 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -28($fp) -# LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_cell_at_CellularAutomaton_internal_6 --> -28($fp) -# local_cell_at_CellularAutomaton_internal_1 = local_cell_at_CellularAutomaton_internal_6 -lw $t0, -28($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_66 -j label_ENDIF_66 -label_FALSEIF_65: - # local_cell_at_CellularAutomaton_internal_9 = GETATTRIBUTE population_map CellularAutomaton - # LOCAL local_cell_at_CellularAutomaton_internal_9 --> -40($fp) - lw $t0, 24($s1) - sw $t0, -40($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_9 --> -40($fp) - # local_cell_at_CellularAutomaton_internal_7 = local_cell_at_CellularAutomaton_internal_9 - lw $t0, -40($fp) - sw $t0, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cell_at_CellularAutomaton_position_0 - # PARAM param_cell_at_CellularAutomaton_position_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cell_at_CellularAutomaton_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -44($fp) - # ARG local_cell_at_CellularAutomaton_internal_10 - # LOCAL local_cell_at_CellularAutomaton_internal_10 --> -44($fp) - lw $t0, -44($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cell_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_8 --> -36($fp) - # local_cell_at_CellularAutomaton_internal_8 = VCALL local_cell_at_CellularAutomaton_internal_7 substr - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 72($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_cell_at_CellularAutomaton_internal_8 --> -36($fp) - # local_cell_at_CellularAutomaton_internal_1 = local_cell_at_CellularAutomaton_internal_8 - lw $t0, -36($fp) - sw $t0, -8($fp) - label_ENDIF_66: -# RETURN local_cell_at_CellularAutomaton_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_cell_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 52 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_north_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_north_at_CellularAutomaton_position_0 -function_north_at_CellularAutomaton: - # Allocate stack frame for function function_north_at_CellularAutomaton. - subu $sp, $sp, 56 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 56 - # local_north_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_north_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t0, 16($s1) - sw $t0, -20($fp) - # LOCAL local_north_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_north_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_north_at_CellularAutomaton_internal_4 --> -20($fp) - # local_north_at_CellularAutomaton_internal_3 = PARAM param_north_at_CellularAutomaton_position_0 - local_north_at_CellularAutomaton_internal_4 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -20($fp) - lw $t2, 12($t1) - sub $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -16($fp) - # LOCAL local_north_at_CellularAutomaton_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -24($fp) - # LOCAL local_north_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_north_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_north_at_CellularAutomaton_internal_5 --> -24($fp) - lw $a0, -16($fp) - lw $a1, -24($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -12($fp) - # IF_GREATER_ZERO local_north_at_CellularAutomaton_internal_2 GOTO label_FALSE_71 - # IF_GREATER_ZERO local_north_at_CellularAutomaton_internal_2 GOTO label_FALSE_71 - lw $t0, -12($fp) - bgt $t0, 0, label_FALSE_71 - # IF_ZERO local_north_at_CellularAutomaton_internal_2 GOTO label_FALSE_71 - # IF_ZERO local_north_at_CellularAutomaton_internal_2 GOTO label_FALSE_71 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_71 - # LOCAL local_north_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_72 -j label_END_72 -label_FALSE_71: - # LOCAL local_north_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_72: -# LOCAL local_north_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_north_at_CellularAutomaton_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_north_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_69 -# IF_ZERO local_north_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_69 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_69 -# LOCAL local_north_at_CellularAutomaton_internal_6 --> -28($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_8 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -28($fp) -# LOCAL local_north_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_north_at_CellularAutomaton_internal_6 --> -28($fp) -# local_north_at_CellularAutomaton_internal_1 = local_north_at_CellularAutomaton_internal_6 -lw $t0, -28($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_70 -j label_ENDIF_70 -label_FALSEIF_69: - # LOCAL local_north_at_CellularAutomaton_internal_9 --> -40($fp) - # local_north_at_CellularAutomaton_internal_9 = SELF - sw $s1, -40($fp) - # LOCAL local_north_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_north_at_CellularAutomaton_internal_9 --> -40($fp) - # local_north_at_CellularAutomaton_internal_7 = local_north_at_CellularAutomaton_internal_9 - lw $t0, -40($fp) - sw $t0, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_north_at_CellularAutomaton_internal_11 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_north_at_CellularAutomaton_internal_11 --> -48($fp) - lw $t0, 16($s1) - sw $t0, -48($fp) - # LOCAL local_north_at_CellularAutomaton_internal_10 --> -44($fp) - # PARAM param_north_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_north_at_CellularAutomaton_internal_11 --> -48($fp) - # local_north_at_CellularAutomaton_internal_10 = PARAM param_north_at_CellularAutomaton_position_0 - local_north_at_CellularAutomaton_internal_11 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -48($fp) - lw $t2, 12($t1) - sub $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -44($fp) - # ARG local_north_at_CellularAutomaton_internal_10 - # LOCAL local_north_at_CellularAutomaton_internal_10 --> -44($fp) - lw $t0, -44($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_north_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_north_at_CellularAutomaton_internal_8 --> -36($fp) - # local_north_at_CellularAutomaton_internal_8 = VCALL local_north_at_CellularAutomaton_internal_7 cell - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 108($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_north_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_north_at_CellularAutomaton_internal_8 --> -36($fp) - # local_north_at_CellularAutomaton_internal_1 = local_north_at_CellularAutomaton_internal_8 - lw $t0, -36($fp) - sw $t0, -8($fp) - label_ENDIF_70: -# RETURN local_north_at_CellularAutomaton_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_north_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 56 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_south_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_south_at_CellularAutomaton_position_0 -function_south_at_CellularAutomaton: - # Allocate stack frame for function function_south_at_CellularAutomaton. - subu $sp, $sp, 56 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 56 - # local_south_at_CellularAutomaton_internal_3 = GETATTRIBUTE board_size CellularAutomaton - # LOCAL local_south_at_CellularAutomaton_internal_3 --> -16($fp) - lw $t0, 20($s1) - sw $t0, -16($fp) - # local_south_at_CellularAutomaton_internal_5 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_south_at_CellularAutomaton_internal_5 --> -24($fp) - lw $t0, 16($s1) - sw $t0, -24($fp) - # LOCAL local_south_at_CellularAutomaton_internal_4 --> -20($fp) - # PARAM param_south_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_south_at_CellularAutomaton_internal_5 --> -24($fp) - # local_south_at_CellularAutomaton_internal_4 = PARAM param_south_at_CellularAutomaton_position_0 + local_south_at_CellularAutomaton_internal_5 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -24($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -20($fp) - # LOCAL local_south_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_south_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_south_at_CellularAutomaton_internal_4 --> -20($fp) - lw $a0, -16($fp) - lw $a1, -20($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -12($fp) - # IF_GREATER_ZERO local_south_at_CellularAutomaton_internal_2 GOTO label_FALSE_75 - # IF_GREATER_ZERO local_south_at_CellularAutomaton_internal_2 GOTO label_FALSE_75 - lw $t0, -12($fp) - bgt $t0, 0, label_FALSE_75 - # IF_ZERO local_south_at_CellularAutomaton_internal_2 GOTO label_FALSE_75 - # IF_ZERO local_south_at_CellularAutomaton_internal_2 GOTO label_FALSE_75 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_75 - # LOCAL local_south_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_76 -j label_END_76 -label_FALSE_75: - # LOCAL local_south_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_76: -# LOCAL local_south_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_south_at_CellularAutomaton_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_south_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_73 -# IF_ZERO local_south_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_73 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_73 -# LOCAL local_south_at_CellularAutomaton_internal_6 --> -28($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_9 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -28($fp) -# LOCAL local_south_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_south_at_CellularAutomaton_internal_6 --> -28($fp) -# local_south_at_CellularAutomaton_internal_1 = local_south_at_CellularAutomaton_internal_6 -lw $t0, -28($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_74 -j label_ENDIF_74 -label_FALSEIF_73: - # LOCAL local_south_at_CellularAutomaton_internal_9 --> -40($fp) - # local_south_at_CellularAutomaton_internal_9 = SELF - sw $s1, -40($fp) - # LOCAL local_south_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_south_at_CellularAutomaton_internal_9 --> -40($fp) - # local_south_at_CellularAutomaton_internal_7 = local_south_at_CellularAutomaton_internal_9 - lw $t0, -40($fp) - sw $t0, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_south_at_CellularAutomaton_internal_11 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_south_at_CellularAutomaton_internal_11 --> -48($fp) - lw $t0, 16($s1) - sw $t0, -48($fp) - # LOCAL local_south_at_CellularAutomaton_internal_10 --> -44($fp) - # PARAM param_south_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_south_at_CellularAutomaton_internal_11 --> -48($fp) - # local_south_at_CellularAutomaton_internal_10 = PARAM param_south_at_CellularAutomaton_position_0 + local_south_at_CellularAutomaton_internal_11 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -48($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -44($fp) - # ARG local_south_at_CellularAutomaton_internal_10 - # LOCAL local_south_at_CellularAutomaton_internal_10 --> -44($fp) - lw $t0, -44($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_south_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_south_at_CellularAutomaton_internal_8 --> -36($fp) - # local_south_at_CellularAutomaton_internal_8 = VCALL local_south_at_CellularAutomaton_internal_7 cell - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 108($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_south_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_south_at_CellularAutomaton_internal_8 --> -36($fp) - # local_south_at_CellularAutomaton_internal_1 = local_south_at_CellularAutomaton_internal_8 - lw $t0, -36($fp) - sw $t0, -8($fp) - label_ENDIF_74: -# RETURN local_south_at_CellularAutomaton_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_south_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 56 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_east_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_east_at_CellularAutomaton_position_0 -function_east_at_CellularAutomaton: - # Allocate stack frame for function function_east_at_CellularAutomaton. - subu $sp, $sp, 80 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 80 - # LOCAL local_east_at_CellularAutomaton_internal_7 --> -32($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -32($fp) - # LOCAL local_east_at_CellularAutomaton_internal_6 --> -28($fp) - # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_east_at_CellularAutomaton_internal_7 --> -32($fp) - # local_east_at_CellularAutomaton_internal_6 = PARAM param_east_at_CellularAutomaton_position_0 + local_east_at_CellularAutomaton_internal_7 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -32($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -28($fp) - # local_east_at_CellularAutomaton_internal_8 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_east_at_CellularAutomaton_internal_8 --> -36($fp) - lw $t0, 16($s1) - sw $t0, -36($fp) - # LOCAL local_east_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_east_at_CellularAutomaton_internal_6 --> -28($fp) - # LOCAL local_east_at_CellularAutomaton_internal_8 --> -36($fp) - # local_east_at_CellularAutomaton_internal_5 = local_east_at_CellularAutomaton_internal_6 / local_east_at_CellularAutomaton_internal_8 - lw $t1, -28($fp) - lw $t0, 12($t1) - lw $t1, -36($fp) - lw $t2, 12($t1) - div $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -24($fp) - # local_east_at_CellularAutomaton_internal_9 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_east_at_CellularAutomaton_internal_9 --> -40($fp) - lw $t0, 16($s1) - sw $t0, -40($fp) - # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_east_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_east_at_CellularAutomaton_internal_9 --> -40($fp) - # local_east_at_CellularAutomaton_internal_4 = local_east_at_CellularAutomaton_internal_5 * local_east_at_CellularAutomaton_internal_9 - lw $t1, -24($fp) - lw $t0, 12($t1) - lw $t1, -40($fp) - lw $t2, 12($t1) - mul $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -20($fp) - # LOCAL local_east_at_CellularAutomaton_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -48($fp) - # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) - # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_east_at_CellularAutomaton_internal_11 --> -48($fp) - # local_east_at_CellularAutomaton_internal_10 = PARAM param_east_at_CellularAutomaton_position_0 + local_east_at_CellularAutomaton_internal_11 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -48($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -44($fp) - # IF_ZERO local_east_at_CellularAutomaton_internal_4 GOTO label_FALSE_79 - # IF_ZERO local_east_at_CellularAutomaton_internal_4 GOTO label_FALSE_79 - lw $t0, -20($fp) - beq $t0, 0, label_FALSE_79 - # IF_ZERO local_east_at_CellularAutomaton_internal_10 GOTO label_FALSE_79 - # IF_ZERO local_east_at_CellularAutomaton_internal_10 GOTO label_FALSE_79 - lw $t0, -44($fp) - beq $t0, 0, label_FALSE_79 - # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) - # Comparing -20($fp) type with String - la $v0, String - lw $a0, -20($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_82 - # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_82 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_82 - # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) - # Comparing -20($fp) type with Bool - la $v0, Bool - lw $a0, -20($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_83 - # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_83 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_83 - # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) - # Comparing -20($fp) type with Int - la $v0, Int - lw $a0, -20($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_83 - # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_83 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_83 - # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) - # Load pointers and SUB - lw $a0, -20($fp) - lw $a1, -44($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_TRUE_80 - # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_TRUE_80 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_80 - # GOTO label_FALSE_79 - j label_FALSE_79 - label_COMPARE_BY_VALUE_83: - # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) - lw $a0, -20($fp) - lw $a1, -44($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_TRUE_80 - # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_TRUE_80 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_80 - # GOTO label_FALSE_79 - j label_FALSE_79 - label_COMPARE_STRING_82: - # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) - # Load strings for comparison - lw $v0, -20($fp) - lw $v1, -44($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_84 - # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_84 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_84 - # GOTO label_FALSE_79 - j label_FALSE_79 - label_CONTINUE_84: - # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -20($fp) - lw $v1, -44($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_85: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_86 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_85 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_86: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_TRUE_80 - # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_TRUE_80 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_80 - label_FALSE_79: - # LOCAL local_east_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_81 -j label_END_81 -label_TRUE_80: - # LOCAL local_east_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_81: -# LOCAL local_east_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_east_at_CellularAutomaton_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_east_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_77 -# IF_ZERO local_east_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_77 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_77 -# LOCAL local_east_at_CellularAutomaton_internal_12 --> -52($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_10 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -52($fp) -# LOCAL local_east_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_east_at_CellularAutomaton_internal_12 --> -52($fp) -# local_east_at_CellularAutomaton_internal_1 = local_east_at_CellularAutomaton_internal_12 -lw $t0, -52($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_78 -j label_ENDIF_78 -label_FALSEIF_77: - # LOCAL local_east_at_CellularAutomaton_internal_15 --> -64($fp) - # local_east_at_CellularAutomaton_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_east_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_east_at_CellularAutomaton_internal_15 --> -64($fp) - # local_east_at_CellularAutomaton_internal_13 = local_east_at_CellularAutomaton_internal_15 - lw $t0, -64($fp) - sw $t0, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_east_at_CellularAutomaton_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -72($fp) - # LOCAL local_east_at_CellularAutomaton_internal_16 --> -68($fp) - # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_east_at_CellularAutomaton_internal_17 --> -72($fp) - # local_east_at_CellularAutomaton_internal_16 = PARAM param_east_at_CellularAutomaton_position_0 + local_east_at_CellularAutomaton_internal_17 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -72($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -68($fp) - # ARG local_east_at_CellularAutomaton_internal_16 - # LOCAL local_east_at_CellularAutomaton_internal_16 --> -68($fp) - lw $t0, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_east_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_east_at_CellularAutomaton_internal_14 --> -60($fp) - # local_east_at_CellularAutomaton_internal_14 = VCALL local_east_at_CellularAutomaton_internal_13 cell - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 108($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_east_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_east_at_CellularAutomaton_internal_14 --> -60($fp) - # local_east_at_CellularAutomaton_internal_1 = local_east_at_CellularAutomaton_internal_14 - lw $t0, -60($fp) - sw $t0, -8($fp) - label_ENDIF_78: -# RETURN local_east_at_CellularAutomaton_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_east_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 80 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_west_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_west_at_CellularAutomaton_position_0 -function_west_at_CellularAutomaton: - # Allocate stack frame for function function_west_at_CellularAutomaton. - subu $sp, $sp, 88 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 88 - # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -20($fp) - # IF_ZERO param_west_at_CellularAutomaton_position_0 GOTO label_FALSE_89 - # IF_ZERO param_west_at_CellularAutomaton_position_0 GOTO label_FALSE_89 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_89 - # IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_FALSE_89 - # IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_FALSE_89 - lw $t0, -20($fp) - beq $t0, 0, label_FALSE_89 - # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_92 - # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_92 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_92 - # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_93 - # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_93 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_93 - # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_93 - # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_93 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_93 - # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -20($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_TRUE_90 - # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_TRUE_90 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_90 - # GOTO label_FALSE_89 - j label_FALSE_89 - label_COMPARE_BY_VALUE_93: - # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) - lw $a0, 0($fp) - lw $a1, -20($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_TRUE_90 - # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_TRUE_90 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_90 - # GOTO label_FALSE_89 - j label_FALSE_89 - label_COMPARE_STRING_92: - # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_94 - # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_94 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_94 - # GOTO label_FALSE_89 - j label_FALSE_89 - label_CONTINUE_94: - # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_95: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_96 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_95 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_96: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_TRUE_90 - # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_TRUE_90 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_90 - label_FALSE_89: - # LOCAL local_west_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_91 -j label_END_91 -label_TRUE_90: - # LOCAL local_west_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_91: -# LOCAL local_west_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_west_at_CellularAutomaton_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_west_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_87 -# IF_ZERO local_west_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_87 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_87 -# LOCAL local_west_at_CellularAutomaton_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_11 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -24($fp) -# LOCAL local_west_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_west_at_CellularAutomaton_internal_5 --> -24($fp) -# local_west_at_CellularAutomaton_internal_1 = local_west_at_CellularAutomaton_internal_5 -lw $t0, -24($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_88 -j label_ENDIF_88 -label_FALSEIF_87: - # local_west_at_CellularAutomaton_internal_12 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_west_at_CellularAutomaton_internal_12 --> -52($fp) - lw $t0, 16($s1) - sw $t0, -52($fp) - # LOCAL local_west_at_CellularAutomaton_internal_11 --> -48($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_west_at_CellularAutomaton_internal_12 --> -52($fp) - # local_west_at_CellularAutomaton_internal_11 = PARAM param_west_at_CellularAutomaton_position_0 / local_west_at_CellularAutomaton_internal_12 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -52($fp) - lw $t2, 12($t1) - div $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -48($fp) - # local_west_at_CellularAutomaton_internal_13 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_west_at_CellularAutomaton_internal_13 --> -56($fp) - lw $t0, 16($s1) - sw $t0, -56($fp) - # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_west_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_west_at_CellularAutomaton_internal_13 --> -56($fp) - # local_west_at_CellularAutomaton_internal_10 = local_west_at_CellularAutomaton_internal_11 * local_west_at_CellularAutomaton_internal_13 - lw $t1, -48($fp) - lw $t0, 12($t1) - lw $t1, -56($fp) - lw $t2, 12($t1) - mul $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -44($fp) - # IF_ZERO local_west_at_CellularAutomaton_internal_10 GOTO label_FALSE_99 - # IF_ZERO local_west_at_CellularAutomaton_internal_10 GOTO label_FALSE_99 - lw $t0, -44($fp) - beq $t0, 0, label_FALSE_99 - # IF_ZERO param_west_at_CellularAutomaton_position_0 GOTO label_FALSE_99 - # IF_ZERO param_west_at_CellularAutomaton_position_0 GOTO label_FALSE_99 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_99 - # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) - # Comparing -44($fp) type with String - la $v0, String - lw $a0, -44($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_COMPARE_STRING_102 - # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_COMPARE_STRING_102 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_STRING_102 - # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) - # Comparing -44($fp) type with Bool - la $v0, Bool - lw $a0, -44($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_103 - # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_103 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_103 - # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) - # Comparing -44($fp) type with Int - la $v0, Int - lw $a0, -44($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_103 - # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_103 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_103 - # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - # Load pointers and SUB - lw $a0, -44($fp) - lw $a1, 0($fp) - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_TRUE_100 - # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_TRUE_100 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_100 - # GOTO label_FALSE_99 - j label_FALSE_99 - label_COMPARE_BY_VALUE_103: - # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - lw $a0, -44($fp) - lw $a1, 0($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_TRUE_100 - # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_TRUE_100 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_100 - # GOTO label_FALSE_99 - j label_FALSE_99 - label_COMPARE_STRING_102: - # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - # Load strings for comparison - lw $v0, -44($fp) - lw $v1, 0($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -40($fp) - # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_CONTINUE_104 - # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_CONTINUE_104 - lw $t0, -40($fp) - beq $t0, 0, label_CONTINUE_104 - # GOTO label_FALSE_99 - j label_FALSE_99 - label_CONTINUE_104: - # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -44($fp) - lw $v1, 0($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_105: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_106 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_105 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_106: - # Store result - sw $a2, -40($fp) - # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_TRUE_100 - # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_TRUE_100 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_100 - label_FALSE_99: - # LOCAL local_west_at_CellularAutomaton_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -36($fp) - # GOTO label_END_101 -j label_END_101 -label_TRUE_100: - # LOCAL local_west_at_CellularAutomaton_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -36($fp) - label_END_101: -# LOCAL local_west_at_CellularAutomaton_internal_6 --> -28($fp) -# LOCAL local_west_at_CellularAutomaton_internal_8 --> -36($fp) -# Obtain value from -36($fp) -lw $v0, -36($fp) -lw $v0, 12($v0) -sw $v0, -28($fp) -# IF_ZERO local_west_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_97 -# IF_ZERO local_west_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_97 -lw $t0, -28($fp) -beq $t0, 0, label_FALSEIF_97 -# LOCAL local_west_at_CellularAutomaton_internal_14 --> -60($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_12 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -60($fp) -# LOCAL local_west_at_CellularAutomaton_internal_7 --> -32($fp) -# LOCAL local_west_at_CellularAutomaton_internal_14 --> -60($fp) -# local_west_at_CellularAutomaton_internal_7 = local_west_at_CellularAutomaton_internal_14 -lw $t0, -60($fp) -sw $t0, -32($fp) -# GOTO label_ENDIF_98 -j label_ENDIF_98 -label_FALSEIF_97: - # LOCAL local_west_at_CellularAutomaton_internal_17 --> -72($fp) - # local_west_at_CellularAutomaton_internal_17 = SELF - sw $s1, -72($fp) - # LOCAL local_west_at_CellularAutomaton_internal_15 --> -64($fp) - # LOCAL local_west_at_CellularAutomaton_internal_17 --> -72($fp) - # local_west_at_CellularAutomaton_internal_15 = local_west_at_CellularAutomaton_internal_17 - lw $t0, -72($fp) - sw $t0, -64($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_west_at_CellularAutomaton_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -80($fp) - # LOCAL local_west_at_CellularAutomaton_internal_18 --> -76($fp) - # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_west_at_CellularAutomaton_internal_19 --> -80($fp) - # local_west_at_CellularAutomaton_internal_18 = PARAM param_west_at_CellularAutomaton_position_0 - local_west_at_CellularAutomaton_internal_19 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -80($fp) - lw $t2, 12($t1) - sub $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -76($fp) - # ARG local_west_at_CellularAutomaton_internal_18 - # LOCAL local_west_at_CellularAutomaton_internal_18 --> -76($fp) - lw $t0, -76($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_west_at_CellularAutomaton_internal_15 --> -64($fp) - # LOCAL local_west_at_CellularAutomaton_internal_16 --> -68($fp) - # local_west_at_CellularAutomaton_internal_16 = VCALL local_west_at_CellularAutomaton_internal_15 cell - # Save new self pointer in $s1 - lw $s1, -64($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 108($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -68($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_west_at_CellularAutomaton_internal_7 --> -32($fp) - # LOCAL local_west_at_CellularAutomaton_internal_16 --> -68($fp) - # local_west_at_CellularAutomaton_internal_7 = local_west_at_CellularAutomaton_internal_16 - lw $t0, -68($fp) - sw $t0, -32($fp) - label_ENDIF_98: -# LOCAL local_west_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_west_at_CellularAutomaton_internal_7 --> -32($fp) -# local_west_at_CellularAutomaton_internal_1 = local_west_at_CellularAutomaton_internal_7 -lw $t0, -32($fp) -sw $t0, -8($fp) -label_ENDIF_88: -# RETURN local_west_at_CellularAutomaton_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_west_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 88 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_northwest_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_northwest_at_CellularAutomaton_position_0 -function_northwest_at_CellularAutomaton: - # Allocate stack frame for function function_northwest_at_CellularAutomaton. - subu $sp, $sp, 92 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 92 - # local_northwest_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_northwest_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t0, 16($s1) - sw $t0, -20($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_4 --> -20($fp) - # local_northwest_at_CellularAutomaton_internal_3 = PARAM param_northwest_at_CellularAutomaton_position_0 - local_northwest_at_CellularAutomaton_internal_4 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -20($fp) - lw $t2, 12($t1) - sub $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -16($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -24($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_5 --> -24($fp) - lw $a0, -16($fp) - lw $a1, -24($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -12($fp) - # IF_GREATER_ZERO local_northwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_109 - # IF_GREATER_ZERO local_northwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_109 - lw $t0, -12($fp) - bgt $t0, 0, label_FALSE_109 - # IF_ZERO local_northwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_109 - # IF_ZERO local_northwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_109 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_109 - # LOCAL local_northwest_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_110 -j label_END_110 -label_FALSE_109: - # LOCAL local_northwest_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_110: -# LOCAL local_northwest_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_northwest_at_CellularAutomaton_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_northwest_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_107 -# IF_ZERO local_northwest_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_107 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_107 -# LOCAL local_northwest_at_CellularAutomaton_internal_6 --> -28($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_13 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -28($fp) -# LOCAL local_northwest_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_northwest_at_CellularAutomaton_internal_6 --> -28($fp) -# local_northwest_at_CellularAutomaton_internal_1 = local_northwest_at_CellularAutomaton_internal_6 -lw $t0, -28($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_108 -j label_ENDIF_108 -label_FALSEIF_107: - # local_northwest_at_CellularAutomaton_internal_13 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_northwest_at_CellularAutomaton_internal_13 --> -56($fp) - lw $t0, 16($s1) - sw $t0, -56($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_12 --> -52($fp) - # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_13 --> -56($fp) - # local_northwest_at_CellularAutomaton_internal_12 = PARAM param_northwest_at_CellularAutomaton_position_0 / local_northwest_at_CellularAutomaton_internal_13 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -56($fp) - lw $t2, 12($t1) - div $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -52($fp) - # local_northwest_at_CellularAutomaton_internal_14 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_northwest_at_CellularAutomaton_internal_14 --> -60($fp) - lw $t0, 16($s1) - sw $t0, -60($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_14 --> -60($fp) - # local_northwest_at_CellularAutomaton_internal_11 = local_northwest_at_CellularAutomaton_internal_12 * local_northwest_at_CellularAutomaton_internal_14 - lw $t1, -52($fp) - lw $t0, 12($t1) - lw $t1, -60($fp) - lw $t2, 12($t1) - mul $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -48($fp) - # IF_ZERO local_northwest_at_CellularAutomaton_internal_11 GOTO label_FALSE_113 - # IF_ZERO local_northwest_at_CellularAutomaton_internal_11 GOTO label_FALSE_113 - lw $t0, -48($fp) - beq $t0, 0, label_FALSE_113 - # IF_ZERO param_northwest_at_CellularAutomaton_position_0 GOTO label_FALSE_113 - # IF_ZERO param_northwest_at_CellularAutomaton_position_0 GOTO label_FALSE_113 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_113 - # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) - # Comparing -48($fp) type with String - la $v0, String - lw $a0, -48($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -44($fp) - # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_116 - # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_116 - lw $t0, -44($fp) - beq $t0, 0, label_COMPARE_STRING_116 - # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) - # Comparing -48($fp) type with Bool - la $v0, Bool - lw $a0, -48($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -44($fp) - # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_117 - # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_117 - lw $t0, -44($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_117 - # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) - # Comparing -48($fp) type with Int - la $v0, Int - lw $a0, -48($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -44($fp) - # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_117 - # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_117 - lw $t0, -44($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_117 - # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) - # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) - # Load pointers and SUB - lw $a0, -48($fp) - lw $a1, 0($fp) - sub $a0, $a0, $a1 - sw $a0, -44($fp) - # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_114 - # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_114 - lw $t0, -44($fp) - beq $t0, 0, label_TRUE_114 - # GOTO label_FALSE_113 - j label_FALSE_113 - label_COMPARE_BY_VALUE_117: - # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) - # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) - lw $a0, -48($fp) - lw $a1, 0($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -44($fp) - # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_114 - # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_114 - lw $t0, -44($fp) - beq $t0, 0, label_TRUE_114 - # GOTO label_FALSE_113 - j label_FALSE_113 - label_COMPARE_STRING_116: - # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) - # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) - # Load strings for comparison - lw $v0, -48($fp) - lw $v1, 0($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -44($fp) - # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_118 - # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_118 - lw $t0, -44($fp) - beq $t0, 0, label_CONTINUE_118 - # GOTO label_FALSE_113 - j label_FALSE_113 - label_CONTINUE_118: - # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) - # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -48($fp) - lw $v1, 0($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_119: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_120 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_119 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_120: - # Store result - sw $a2, -44($fp) - # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_114 - # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_114 - lw $t0, -44($fp) - beq $t0, 0, label_TRUE_114 - label_FALSE_113: - # LOCAL local_northwest_at_CellularAutomaton_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -40($fp) - # GOTO label_END_115 -j label_END_115 -label_TRUE_114: - # LOCAL local_northwest_at_CellularAutomaton_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -40($fp) - label_END_115: -# LOCAL local_northwest_at_CellularAutomaton_internal_7 --> -32($fp) -# LOCAL local_northwest_at_CellularAutomaton_internal_9 --> -40($fp) -# Obtain value from -40($fp) -lw $v0, -40($fp) -lw $v0, 12($v0) -sw $v0, -32($fp) -# IF_ZERO local_northwest_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_111 -# IF_ZERO local_northwest_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_111 -lw $t0, -32($fp) -beq $t0, 0, label_FALSEIF_111 -# LOCAL local_northwest_at_CellularAutomaton_internal_15 --> -64($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_14 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -64($fp) -# LOCAL local_northwest_at_CellularAutomaton_internal_8 --> -36($fp) -# LOCAL local_northwest_at_CellularAutomaton_internal_15 --> -64($fp) -# local_northwest_at_CellularAutomaton_internal_8 = local_northwest_at_CellularAutomaton_internal_15 -lw $t0, -64($fp) -sw $t0, -36($fp) -# GOTO label_ENDIF_112 -j label_ENDIF_112 -label_FALSEIF_111: - # LOCAL local_northwest_at_CellularAutomaton_internal_18 --> -76($fp) - # local_northwest_at_CellularAutomaton_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_16 --> -68($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_18 --> -76($fp) - # local_northwest_at_CellularAutomaton_internal_16 = local_northwest_at_CellularAutomaton_internal_18 - lw $t0, -76($fp) - sw $t0, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_northwest_at_CellularAutomaton_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -84($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_19 --> -80($fp) - # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_20 --> -84($fp) - # local_northwest_at_CellularAutomaton_internal_19 = PARAM param_northwest_at_CellularAutomaton_position_0 - local_northwest_at_CellularAutomaton_internal_20 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -84($fp) - lw $t2, 12($t1) - sub $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -80($fp) - # ARG local_northwest_at_CellularAutomaton_internal_19 - # LOCAL local_northwest_at_CellularAutomaton_internal_19 --> -80($fp) - lw $t0, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_northwest_at_CellularAutomaton_internal_16 --> -68($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_17 --> -72($fp) - # local_northwest_at_CellularAutomaton_internal_17 = VCALL local_northwest_at_CellularAutomaton_internal_16 north - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 100($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_northwest_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_northwest_at_CellularAutomaton_internal_17 --> -72($fp) - # local_northwest_at_CellularAutomaton_internal_8 = local_northwest_at_CellularAutomaton_internal_17 - lw $t0, -72($fp) - sw $t0, -36($fp) - label_ENDIF_112: -# LOCAL local_northwest_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_northwest_at_CellularAutomaton_internal_8 --> -36($fp) -# local_northwest_at_CellularAutomaton_internal_1 = local_northwest_at_CellularAutomaton_internal_8 -lw $t0, -36($fp) -sw $t0, -8($fp) -label_ENDIF_108: -# RETURN local_northwest_at_CellularAutomaton_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_northwest_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 92 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_northeast_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_northeast_at_CellularAutomaton_position_0 -function_northeast_at_CellularAutomaton: - # Allocate stack frame for function function_northeast_at_CellularAutomaton. - subu $sp, $sp, 108 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 108 - # local_northeast_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_northeast_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t0, 16($s1) - sw $t0, -20($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_3 --> -16($fp) - # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_4 --> -20($fp) - # local_northeast_at_CellularAutomaton_internal_3 = PARAM param_northeast_at_CellularAutomaton_position_0 - local_northeast_at_CellularAutomaton_internal_4 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -20($fp) - lw $t2, 12($t1) - sub $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -16($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -24($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_5 --> -24($fp) - lw $a0, -16($fp) - lw $a1, -24($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -12($fp) - # IF_GREATER_ZERO local_northeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_123 - # IF_GREATER_ZERO local_northeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_123 - lw $t0, -12($fp) - bgt $t0, 0, label_FALSE_123 - # IF_ZERO local_northeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_123 - # IF_ZERO local_northeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_123 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_123 - # LOCAL local_northeast_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_124 -j label_END_124 -label_FALSE_123: - # LOCAL local_northeast_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_124: -# LOCAL local_northeast_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_northeast_at_CellularAutomaton_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_northeast_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_121 -# IF_ZERO local_northeast_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_121 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_121 -# LOCAL local_northeast_at_CellularAutomaton_internal_6 --> -28($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_15 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -28($fp) -# LOCAL local_northeast_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_northeast_at_CellularAutomaton_internal_6 --> -28($fp) -# local_northeast_at_CellularAutomaton_internal_1 = local_northeast_at_CellularAutomaton_internal_6 -lw $t0, -28($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_122 -j label_ENDIF_122 -label_FALSEIF_121: - # LOCAL local_northeast_at_CellularAutomaton_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -60($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_13 --> -56($fp) - # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_14 --> -60($fp) - # local_northeast_at_CellularAutomaton_internal_13 = PARAM param_northeast_at_CellularAutomaton_position_0 + local_northeast_at_CellularAutomaton_internal_14 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -60($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -56($fp) - # local_northeast_at_CellularAutomaton_internal_15 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_northeast_at_CellularAutomaton_internal_15 --> -64($fp) - lw $t0, 16($s1) - sw $t0, -64($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_15 --> -64($fp) - # local_northeast_at_CellularAutomaton_internal_12 = local_northeast_at_CellularAutomaton_internal_13 / local_northeast_at_CellularAutomaton_internal_15 - lw $t1, -56($fp) - lw $t0, 12($t1) - lw $t1, -64($fp) - lw $t2, 12($t1) - div $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -52($fp) - # local_northeast_at_CellularAutomaton_internal_16 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_northeast_at_CellularAutomaton_internal_16 --> -68($fp) - lw $t0, 16($s1) - sw $t0, -68($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_16 --> -68($fp) - # local_northeast_at_CellularAutomaton_internal_11 = local_northeast_at_CellularAutomaton_internal_12 * local_northeast_at_CellularAutomaton_internal_16 - lw $t1, -52($fp) - lw $t0, 12($t1) - lw $t1, -68($fp) - lw $t2, 12($t1) - mul $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -48($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_18 --> -76($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -76($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) - # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_18 --> -76($fp) - # local_northeast_at_CellularAutomaton_internal_17 = PARAM param_northeast_at_CellularAutomaton_position_0 + local_northeast_at_CellularAutomaton_internal_18 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -76($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -72($fp) - # IF_ZERO local_northeast_at_CellularAutomaton_internal_11 GOTO label_FALSE_127 - # IF_ZERO local_northeast_at_CellularAutomaton_internal_11 GOTO label_FALSE_127 - lw $t0, -48($fp) - beq $t0, 0, label_FALSE_127 - # IF_ZERO local_northeast_at_CellularAutomaton_internal_17 GOTO label_FALSE_127 - # IF_ZERO local_northeast_at_CellularAutomaton_internal_17 GOTO label_FALSE_127 - lw $t0, -72($fp) - beq $t0, 0, label_FALSE_127 - # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) - # Comparing -48($fp) type with String - la $v0, String - lw $a0, -48($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -44($fp) - # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_130 - # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_130 - lw $t0, -44($fp) - beq $t0, 0, label_COMPARE_STRING_130 - # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) - # Comparing -48($fp) type with Bool - la $v0, Bool - lw $a0, -48($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -44($fp) - # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_131 - # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_131 - lw $t0, -44($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_131 - # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) - # Comparing -48($fp) type with Int - la $v0, Int - lw $a0, -48($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -44($fp) - # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_131 - # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_131 - lw $t0, -44($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_131 - # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) - # Load pointers and SUB - lw $a0, -48($fp) - lw $a1, -72($fp) - sub $a0, $a0, $a1 - sw $a0, -44($fp) - # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_128 - # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_128 - lw $t0, -44($fp) - beq $t0, 0, label_TRUE_128 - # GOTO label_FALSE_127 - j label_FALSE_127 - label_COMPARE_BY_VALUE_131: - # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) - lw $a0, -48($fp) - lw $a1, -72($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -44($fp) - # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_128 - # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_128 - lw $t0, -44($fp) - beq $t0, 0, label_TRUE_128 - # GOTO label_FALSE_127 - j label_FALSE_127 - label_COMPARE_STRING_130: - # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) - # Load strings for comparison - lw $v0, -48($fp) - lw $v1, -72($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -44($fp) - # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_132 - # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_132 - lw $t0, -44($fp) - beq $t0, 0, label_CONTINUE_132 - # GOTO label_FALSE_127 - j label_FALSE_127 - label_CONTINUE_132: - # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -48($fp) - lw $v1, -72($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_133: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_134 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_133 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_134: - # Store result - sw $a2, -44($fp) - # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_128 - # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_128 - lw $t0, -44($fp) - beq $t0, 0, label_TRUE_128 - label_FALSE_127: - # LOCAL local_northeast_at_CellularAutomaton_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -40($fp) - # GOTO label_END_129 -j label_END_129 -label_TRUE_128: - # LOCAL local_northeast_at_CellularAutomaton_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -40($fp) - label_END_129: -# LOCAL local_northeast_at_CellularAutomaton_internal_7 --> -32($fp) -# LOCAL local_northeast_at_CellularAutomaton_internal_9 --> -40($fp) -# Obtain value from -40($fp) -lw $v0, -40($fp) -lw $v0, 12($v0) -sw $v0, -32($fp) -# IF_ZERO local_northeast_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_125 -# IF_ZERO local_northeast_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_125 -lw $t0, -32($fp) -beq $t0, 0, label_FALSEIF_125 -# LOCAL local_northeast_at_CellularAutomaton_internal_19 --> -80($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_16 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -80($fp) -# LOCAL local_northeast_at_CellularAutomaton_internal_8 --> -36($fp) -# LOCAL local_northeast_at_CellularAutomaton_internal_19 --> -80($fp) -# local_northeast_at_CellularAutomaton_internal_8 = local_northeast_at_CellularAutomaton_internal_19 -lw $t0, -80($fp) -sw $t0, -36($fp) -# GOTO label_ENDIF_126 -j label_ENDIF_126 -label_FALSEIF_125: - # LOCAL local_northeast_at_CellularAutomaton_internal_22 --> -92($fp) - # local_northeast_at_CellularAutomaton_internal_22 = SELF - sw $s1, -92($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_20 --> -84($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_22 --> -92($fp) - # local_northeast_at_CellularAutomaton_internal_20 = local_northeast_at_CellularAutomaton_internal_22 - lw $t0, -92($fp) - sw $t0, -84($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_northeast_at_CellularAutomaton_internal_24 --> -100($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -100($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_23 --> -96($fp) - # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_24 --> -100($fp) - # local_northeast_at_CellularAutomaton_internal_23 = PARAM param_northeast_at_CellularAutomaton_position_0 + local_northeast_at_CellularAutomaton_internal_24 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -100($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -96($fp) - # ARG local_northeast_at_CellularAutomaton_internal_23 - # LOCAL local_northeast_at_CellularAutomaton_internal_23 --> -96($fp) - lw $t0, -96($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_northeast_at_CellularAutomaton_internal_20 --> -84($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_21 --> -88($fp) - # local_northeast_at_CellularAutomaton_internal_21 = VCALL local_northeast_at_CellularAutomaton_internal_20 north - # Save new self pointer in $s1 - lw $s1, -84($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 100($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -88($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_northeast_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_northeast_at_CellularAutomaton_internal_21 --> -88($fp) - # local_northeast_at_CellularAutomaton_internal_8 = local_northeast_at_CellularAutomaton_internal_21 - lw $t0, -88($fp) - sw $t0, -36($fp) - label_ENDIF_126: -# LOCAL local_northeast_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_northeast_at_CellularAutomaton_internal_8 --> -36($fp) -# local_northeast_at_CellularAutomaton_internal_1 = local_northeast_at_CellularAutomaton_internal_8 -lw $t0, -36($fp) -sw $t0, -8($fp) -label_ENDIF_122: -# RETURN local_northeast_at_CellularAutomaton_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_northeast_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 108 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_southeast_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_southeast_at_CellularAutomaton_position_0 -function_southeast_at_CellularAutomaton: - # Allocate stack frame for function function_southeast_at_CellularAutomaton. - subu $sp, $sp, 108 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 108 - # local_southeast_at_CellularAutomaton_internal_3 = GETATTRIBUTE board_size CellularAutomaton - # LOCAL local_southeast_at_CellularAutomaton_internal_3 --> -16($fp) - lw $t0, 20($s1) - sw $t0, -16($fp) - # local_southeast_at_CellularAutomaton_internal_5 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_southeast_at_CellularAutomaton_internal_5 --> -24($fp) - lw $t0, 16($s1) - sw $t0, -24($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_4 --> -20($fp) - # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_5 --> -24($fp) - # local_southeast_at_CellularAutomaton_internal_4 = PARAM param_southeast_at_CellularAutomaton_position_0 + local_southeast_at_CellularAutomaton_internal_5 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -24($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -20($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_4 --> -20($fp) - lw $a0, -16($fp) - lw $a1, -20($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -12($fp) - # IF_GREATER_ZERO local_southeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_137 - # IF_GREATER_ZERO local_southeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_137 - lw $t0, -12($fp) - bgt $t0, 0, label_FALSE_137 - # IF_ZERO local_southeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_137 - # IF_ZERO local_southeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_137 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_137 - # LOCAL local_southeast_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_138 -j label_END_138 -label_FALSE_137: - # LOCAL local_southeast_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_138: -# LOCAL local_southeast_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_southeast_at_CellularAutomaton_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_southeast_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_135 -# IF_ZERO local_southeast_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_135 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_135 -# LOCAL local_southeast_at_CellularAutomaton_internal_6 --> -28($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_17 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -28($fp) -# LOCAL local_southeast_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_southeast_at_CellularAutomaton_internal_6 --> -28($fp) -# local_southeast_at_CellularAutomaton_internal_1 = local_southeast_at_CellularAutomaton_internal_6 -lw $t0, -28($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_136 -j label_ENDIF_136 -label_FALSEIF_135: - # LOCAL local_southeast_at_CellularAutomaton_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -60($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_13 --> -56($fp) - # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_14 --> -60($fp) - # local_southeast_at_CellularAutomaton_internal_13 = PARAM param_southeast_at_CellularAutomaton_position_0 + local_southeast_at_CellularAutomaton_internal_14 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -60($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -56($fp) - # local_southeast_at_CellularAutomaton_internal_15 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_southeast_at_CellularAutomaton_internal_15 --> -64($fp) - lw $t0, 16($s1) - sw $t0, -64($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_15 --> -64($fp) - # local_southeast_at_CellularAutomaton_internal_12 = local_southeast_at_CellularAutomaton_internal_13 / local_southeast_at_CellularAutomaton_internal_15 - lw $t1, -56($fp) - lw $t0, 12($t1) - lw $t1, -64($fp) - lw $t2, 12($t1) - div $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -52($fp) - # local_southeast_at_CellularAutomaton_internal_16 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_southeast_at_CellularAutomaton_internal_16 --> -68($fp) - lw $t0, 16($s1) - sw $t0, -68($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_16 --> -68($fp) - # local_southeast_at_CellularAutomaton_internal_11 = local_southeast_at_CellularAutomaton_internal_12 * local_southeast_at_CellularAutomaton_internal_16 - lw $t1, -52($fp) - lw $t0, 12($t1) - lw $t1, -68($fp) - lw $t2, 12($t1) - mul $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -48($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_18 --> -76($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -76($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) - # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_18 --> -76($fp) - # local_southeast_at_CellularAutomaton_internal_17 = PARAM param_southeast_at_CellularAutomaton_position_0 + local_southeast_at_CellularAutomaton_internal_18 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -76($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -72($fp) - # IF_ZERO local_southeast_at_CellularAutomaton_internal_11 GOTO label_FALSE_141 - # IF_ZERO local_southeast_at_CellularAutomaton_internal_11 GOTO label_FALSE_141 - lw $t0, -48($fp) - beq $t0, 0, label_FALSE_141 - # IF_ZERO local_southeast_at_CellularAutomaton_internal_17 GOTO label_FALSE_141 - # IF_ZERO local_southeast_at_CellularAutomaton_internal_17 GOTO label_FALSE_141 - lw $t0, -72($fp) - beq $t0, 0, label_FALSE_141 - # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) - # Comparing -48($fp) type with String - la $v0, String - lw $a0, -48($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -44($fp) - # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_144 - # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_144 - lw $t0, -44($fp) - beq $t0, 0, label_COMPARE_STRING_144 - # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) - # Comparing -48($fp) type with Bool - la $v0, Bool - lw $a0, -48($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -44($fp) - # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_145 - # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_145 - lw $t0, -44($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_145 - # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) - # Comparing -48($fp) type with Int - la $v0, Int - lw $a0, -48($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -44($fp) - # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_145 - # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_145 - lw $t0, -44($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_145 - # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) - # Load pointers and SUB - lw $a0, -48($fp) - lw $a1, -72($fp) - sub $a0, $a0, $a1 - sw $a0, -44($fp) - # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_142 - # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_142 - lw $t0, -44($fp) - beq $t0, 0, label_TRUE_142 - # GOTO label_FALSE_141 - j label_FALSE_141 - label_COMPARE_BY_VALUE_145: - # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) - lw $a0, -48($fp) - lw $a1, -72($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -44($fp) - # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_142 - # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_142 - lw $t0, -44($fp) - beq $t0, 0, label_TRUE_142 - # GOTO label_FALSE_141 - j label_FALSE_141 - label_COMPARE_STRING_144: - # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) - # Load strings for comparison - lw $v0, -48($fp) - lw $v1, -72($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -44($fp) - # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_146 - # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_146 - lw $t0, -44($fp) - beq $t0, 0, label_CONTINUE_146 - # GOTO label_FALSE_141 - j label_FALSE_141 - label_CONTINUE_146: - # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -48($fp) - lw $v1, -72($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_147: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_148 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_147 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_148: - # Store result - sw $a2, -44($fp) - # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_142 - # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_142 - lw $t0, -44($fp) - beq $t0, 0, label_TRUE_142 - label_FALSE_141: - # LOCAL local_southeast_at_CellularAutomaton_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -40($fp) - # GOTO label_END_143 -j label_END_143 -label_TRUE_142: - # LOCAL local_southeast_at_CellularAutomaton_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -40($fp) - label_END_143: -# LOCAL local_southeast_at_CellularAutomaton_internal_7 --> -32($fp) -# LOCAL local_southeast_at_CellularAutomaton_internal_9 --> -40($fp) -# Obtain value from -40($fp) -lw $v0, -40($fp) -lw $v0, 12($v0) -sw $v0, -32($fp) -# IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_139 -# IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_139 -lw $t0, -32($fp) -beq $t0, 0, label_FALSEIF_139 -# LOCAL local_southeast_at_CellularAutomaton_internal_19 --> -80($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_18 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -80($fp) -# LOCAL local_southeast_at_CellularAutomaton_internal_8 --> -36($fp) -# LOCAL local_southeast_at_CellularAutomaton_internal_19 --> -80($fp) -# local_southeast_at_CellularAutomaton_internal_8 = local_southeast_at_CellularAutomaton_internal_19 -lw $t0, -80($fp) -sw $t0, -36($fp) -# GOTO label_ENDIF_140 -j label_ENDIF_140 -label_FALSEIF_139: - # LOCAL local_southeast_at_CellularAutomaton_internal_22 --> -92($fp) - # local_southeast_at_CellularAutomaton_internal_22 = SELF - sw $s1, -92($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_20 --> -84($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_22 --> -92($fp) - # local_southeast_at_CellularAutomaton_internal_20 = local_southeast_at_CellularAutomaton_internal_22 - lw $t0, -92($fp) - sw $t0, -84($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_southeast_at_CellularAutomaton_internal_24 --> -100($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -100($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_23 --> -96($fp) - # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_24 --> -100($fp) - # local_southeast_at_CellularAutomaton_internal_23 = PARAM param_southeast_at_CellularAutomaton_position_0 + local_southeast_at_CellularAutomaton_internal_24 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -100($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -96($fp) - # ARG local_southeast_at_CellularAutomaton_internal_23 - # LOCAL local_southeast_at_CellularAutomaton_internal_23 --> -96($fp) - lw $t0, -96($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_southeast_at_CellularAutomaton_internal_20 --> -84($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_21 --> -88($fp) - # local_southeast_at_CellularAutomaton_internal_21 = VCALL local_southeast_at_CellularAutomaton_internal_20 south - # Save new self pointer in $s1 - lw $s1, -84($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 120($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -88($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_southeast_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_southeast_at_CellularAutomaton_internal_21 --> -88($fp) - # local_southeast_at_CellularAutomaton_internal_8 = local_southeast_at_CellularAutomaton_internal_21 - lw $t0, -88($fp) - sw $t0, -36($fp) - label_ENDIF_140: -# LOCAL local_southeast_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_southeast_at_CellularAutomaton_internal_8 --> -36($fp) -# local_southeast_at_CellularAutomaton_internal_1 = local_southeast_at_CellularAutomaton_internal_8 -lw $t0, -36($fp) -sw $t0, -8($fp) -label_ENDIF_136: -# RETURN local_southeast_at_CellularAutomaton_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_southeast_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 108 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_southwest_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_southwest_at_CellularAutomaton_position_0 -function_southwest_at_CellularAutomaton: - # Allocate stack frame for function function_southwest_at_CellularAutomaton. - subu $sp, $sp, 92 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 92 - # local_southwest_at_CellularAutomaton_internal_3 = GETATTRIBUTE board_size CellularAutomaton - # LOCAL local_southwest_at_CellularAutomaton_internal_3 --> -16($fp) - lw $t0, 20($s1) - sw $t0, -16($fp) - # local_southwest_at_CellularAutomaton_internal_5 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_southwest_at_CellularAutomaton_internal_5 --> -24($fp) - lw $t0, 16($s1) - sw $t0, -24($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_4 --> -20($fp) - # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_5 --> -24($fp) - # local_southwest_at_CellularAutomaton_internal_4 = PARAM param_southwest_at_CellularAutomaton_position_0 + local_southwest_at_CellularAutomaton_internal_5 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -24($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -20($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_2 --> -12($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_4 --> -20($fp) - lw $a0, -16($fp) - lw $a1, -20($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -12($fp) - # IF_GREATER_ZERO local_southwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_151 - # IF_GREATER_ZERO local_southwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_151 - lw $t0, -12($fp) - bgt $t0, 0, label_FALSE_151 - # IF_ZERO local_southwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_151 - # IF_ZERO local_southwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_151 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_151 - # LOCAL local_southwest_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_152 -j label_END_152 -label_FALSE_151: - # LOCAL local_southwest_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_152: -# LOCAL local_southwest_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_southwest_at_CellularAutomaton_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_southwest_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_149 -# IF_ZERO local_southwest_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_149 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_149 -# LOCAL local_southwest_at_CellularAutomaton_internal_6 --> -28($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_19 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -28($fp) -# LOCAL local_southwest_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_southwest_at_CellularAutomaton_internal_6 --> -28($fp) -# local_southwest_at_CellularAutomaton_internal_1 = local_southwest_at_CellularAutomaton_internal_6 -lw $t0, -28($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_150 -j label_ENDIF_150 -label_FALSEIF_149: - # local_southwest_at_CellularAutomaton_internal_13 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_southwest_at_CellularAutomaton_internal_13 --> -56($fp) - lw $t0, 16($s1) - sw $t0, -56($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_12 --> -52($fp) - # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_13 --> -56($fp) - # local_southwest_at_CellularAutomaton_internal_12 = PARAM param_southwest_at_CellularAutomaton_position_0 / local_southwest_at_CellularAutomaton_internal_13 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -56($fp) - lw $t2, 12($t1) - div $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -52($fp) - # local_southwest_at_CellularAutomaton_internal_14 = GETATTRIBUTE columns CellularAutomaton - # LOCAL local_southwest_at_CellularAutomaton_internal_14 --> -60($fp) - lw $t0, 16($s1) - sw $t0, -60($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_14 --> -60($fp) - # local_southwest_at_CellularAutomaton_internal_11 = local_southwest_at_CellularAutomaton_internal_12 * local_southwest_at_CellularAutomaton_internal_14 - lw $t1, -52($fp) - lw $t0, 12($t1) - lw $t1, -60($fp) - lw $t2, 12($t1) - mul $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -48($fp) - # IF_ZERO local_southwest_at_CellularAutomaton_internal_11 GOTO label_FALSE_155 - # IF_ZERO local_southwest_at_CellularAutomaton_internal_11 GOTO label_FALSE_155 - lw $t0, -48($fp) - beq $t0, 0, label_FALSE_155 - # IF_ZERO param_southwest_at_CellularAutomaton_position_0 GOTO label_FALSE_155 - # IF_ZERO param_southwest_at_CellularAutomaton_position_0 GOTO label_FALSE_155 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_155 - # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) - # Comparing -48($fp) type with String - la $v0, String - lw $a0, -48($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -44($fp) - # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_158 - # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_158 - lw $t0, -44($fp) - beq $t0, 0, label_COMPARE_STRING_158 - # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) - # Comparing -48($fp) type with Bool - la $v0, Bool - lw $a0, -48($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -44($fp) - # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_159 - # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_159 - lw $t0, -44($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_159 - # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) - # Comparing -48($fp) type with Int - la $v0, Int - lw $a0, -48($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -44($fp) - # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_159 - # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_159 - lw $t0, -44($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_159 - # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) - # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) - # Load pointers and SUB - lw $a0, -48($fp) - lw $a1, 0($fp) - sub $a0, $a0, $a1 - sw $a0, -44($fp) - # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_156 - # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_156 - lw $t0, -44($fp) - beq $t0, 0, label_TRUE_156 - # GOTO label_FALSE_155 - j label_FALSE_155 - label_COMPARE_BY_VALUE_159: - # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) - # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) - lw $a0, -48($fp) - lw $a1, 0($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -44($fp) - # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_156 - # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_156 - lw $t0, -44($fp) - beq $t0, 0, label_TRUE_156 - # GOTO label_FALSE_155 - j label_FALSE_155 - label_COMPARE_STRING_158: - # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) - # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) - # Load strings for comparison - lw $v0, -48($fp) - lw $v1, 0($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -44($fp) - # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_160 - # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_160 - lw $t0, -44($fp) - beq $t0, 0, label_CONTINUE_160 - # GOTO label_FALSE_155 - j label_FALSE_155 - label_CONTINUE_160: - # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) - # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -48($fp) - lw $v1, 0($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_161: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_162 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_161 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_162: - # Store result - sw $a2, -44($fp) - # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_156 - # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_156 - lw $t0, -44($fp) - beq $t0, 0, label_TRUE_156 - label_FALSE_155: - # LOCAL local_southwest_at_CellularAutomaton_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -40($fp) - # GOTO label_END_157 -j label_END_157 -label_TRUE_156: - # LOCAL local_southwest_at_CellularAutomaton_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -40($fp) - label_END_157: -# LOCAL local_southwest_at_CellularAutomaton_internal_7 --> -32($fp) -# LOCAL local_southwest_at_CellularAutomaton_internal_9 --> -40($fp) -# Obtain value from -40($fp) -lw $v0, -40($fp) -lw $v0, 12($v0) -sw $v0, -32($fp) -# IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_153 -# IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_153 -lw $t0, -32($fp) -beq $t0, 0, label_FALSEIF_153 -# LOCAL local_southwest_at_CellularAutomaton_internal_15 --> -64($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_20 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -64($fp) -# LOCAL local_southwest_at_CellularAutomaton_internal_8 --> -36($fp) -# LOCAL local_southwest_at_CellularAutomaton_internal_15 --> -64($fp) -# local_southwest_at_CellularAutomaton_internal_8 = local_southwest_at_CellularAutomaton_internal_15 -lw $t0, -64($fp) -sw $t0, -36($fp) -# GOTO label_ENDIF_154 -j label_ENDIF_154 -label_FALSEIF_153: - # LOCAL local_southwest_at_CellularAutomaton_internal_18 --> -76($fp) - # local_southwest_at_CellularAutomaton_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_16 --> -68($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_18 --> -76($fp) - # local_southwest_at_CellularAutomaton_internal_16 = local_southwest_at_CellularAutomaton_internal_18 - lw $t0, -76($fp) - sw $t0, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_southwest_at_CellularAutomaton_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -84($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_19 --> -80($fp) - # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_20 --> -84($fp) - # local_southwest_at_CellularAutomaton_internal_19 = PARAM param_southwest_at_CellularAutomaton_position_0 - local_southwest_at_CellularAutomaton_internal_20 - lw $t1, 0($fp) - lw $t0, 12($t1) - lw $t1, -84($fp) - lw $t2, 12($t1) - sub $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -80($fp) - # ARG local_southwest_at_CellularAutomaton_internal_19 - # LOCAL local_southwest_at_CellularAutomaton_internal_19 --> -80($fp) - lw $t0, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_southwest_at_CellularAutomaton_internal_16 --> -68($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_17 --> -72($fp) - # local_southwest_at_CellularAutomaton_internal_17 = VCALL local_southwest_at_CellularAutomaton_internal_16 south - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 120($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_southwest_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_southwest_at_CellularAutomaton_internal_17 --> -72($fp) - # local_southwest_at_CellularAutomaton_internal_8 = local_southwest_at_CellularAutomaton_internal_17 - lw $t0, -72($fp) - sw $t0, -36($fp) - label_ENDIF_154: -# LOCAL local_southwest_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_southwest_at_CellularAutomaton_internal_8 --> -36($fp) -# local_southwest_at_CellularAutomaton_internal_1 = local_southwest_at_CellularAutomaton_internal_8 -lw $t0, -36($fp) -sw $t0, -8($fp) -label_ENDIF_150: -# RETURN local_southwest_at_CellularAutomaton_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_southwest_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 92 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_neighbors_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_neighbors_at_CellularAutomaton_position_0 -function_neighbors_at_CellularAutomaton: - # Allocate stack frame for function function_neighbors_at_CellularAutomaton. - subu $sp, $sp, 356 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 356 - # LOCAL local_neighbors_at_CellularAutomaton_internal_13 --> -56($fp) - # local_neighbors_at_CellularAutomaton_internal_13 = SELF - sw $s1, -56($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_13 --> -56($fp) - # local_neighbors_at_CellularAutomaton_internal_11 = local_neighbors_at_CellularAutomaton_internal_13 - lw $t0, -56($fp) - sw $t0, -48($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_neighbors_at_CellularAutomaton_position_0 - # PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_11 --> -48($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) - # local_neighbors_at_CellularAutomaton_internal_12 = VCALL local_neighbors_at_CellularAutomaton_internal_11 north - # Save new self pointer in $s1 - lw $s1, -48($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 100($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -52($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_21 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -60($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_12 GOTO label_FALSE_165 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_12 GOTO label_FALSE_165 - lw $t0, -52($fp) - beq $t0, 0, label_FALSE_165 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_FALSE_165 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_FALSE_165 - lw $t0, -60($fp) - beq $t0, 0, label_FALSE_165 - # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) - # Comparing -52($fp) type with String - la $v0, String - lw $a0, -52($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -44($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_168 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_168 - lw $t0, -44($fp) - beq $t0, 0, label_COMPARE_STRING_168 - # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) - # Comparing -52($fp) type with Bool - la $v0, Bool - lw $a0, -52($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -44($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_169 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_169 - lw $t0, -44($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_169 - # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) - # Comparing -52($fp) type with Int - la $v0, Int - lw $a0, -52($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -44($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_169 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_169 - lw $t0, -44($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_169 - # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) - # Load pointers and SUB - lw $a0, -52($fp) - lw $a1, -60($fp) - sub $a0, $a0, $a1 - sw $a0, -44($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_TRUE_166 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_TRUE_166 - lw $t0, -44($fp) - beq $t0, 0, label_TRUE_166 - # GOTO label_FALSE_165 - j label_FALSE_165 - label_COMPARE_BY_VALUE_169: - # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) - lw $a0, -52($fp) - lw $a1, -60($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -44($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_TRUE_166 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_TRUE_166 - lw $t0, -44($fp) - beq $t0, 0, label_TRUE_166 - # GOTO label_FALSE_165 - j label_FALSE_165 - label_COMPARE_STRING_168: - # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) - # Load strings for comparison - lw $v0, -52($fp) - lw $v1, -60($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -44($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_170 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_170 - lw $t0, -44($fp) - beq $t0, 0, label_CONTINUE_170 - # GOTO label_FALSE_165 - j label_FALSE_165 - label_CONTINUE_170: - # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -52($fp) - lw $v1, -60($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_171: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_172 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_171 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_172: - # Store result - sw $a2, -44($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_TRUE_166 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_TRUE_166 - lw $t0, -44($fp) - beq $t0, 0, label_TRUE_166 - label_FALSE_165: - # LOCAL local_neighbors_at_CellularAutomaton_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -40($fp) - # GOTO label_END_167 -j label_END_167 -label_TRUE_166: - # LOCAL local_neighbors_at_CellularAutomaton_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -40($fp) - label_END_167: -# LOCAL local_neighbors_at_CellularAutomaton_internal_7 --> -32($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_9 --> -40($fp) -# Obtain value from -40($fp) -lw $v0, -40($fp) -lw $v0, 12($v0) -sw $v0, -32($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_163 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_163 -lw $t0, -32($fp) -beq $t0, 0, label_FALSEIF_163 -# LOCAL local_neighbors_at_CellularAutomaton_internal_15 --> -64($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -64($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_15 --> -64($fp) -# local_neighbors_at_CellularAutomaton_internal_8 = local_neighbors_at_CellularAutomaton_internal_15 -lw $t0, -64($fp) -sw $t0, -36($fp) -# GOTO label_ENDIF_164 -j label_ENDIF_164 -label_FALSEIF_163: - # LOCAL local_neighbors_at_CellularAutomaton_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -68($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_16 --> -68($fp) - # local_neighbors_at_CellularAutomaton_internal_8 = local_neighbors_at_CellularAutomaton_internal_16 - lw $t0, -68($fp) - sw $t0, -36($fp) - label_ENDIF_164: -# LOCAL local_neighbors_at_CellularAutomaton_internal_23 --> -96($fp) -# local_neighbors_at_CellularAutomaton_internal_23 = SELF -sw $s1, -96($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_21 --> -88($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_23 --> -96($fp) -# local_neighbors_at_CellularAutomaton_internal_21 = local_neighbors_at_CellularAutomaton_internal_23 -lw $t0, -96($fp) -sw $t0, -88($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t0, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_21 --> -88($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) -# local_neighbors_at_CellularAutomaton_internal_22 = VCALL local_neighbors_at_CellularAutomaton_internal_21 south -# Save new self pointer in $s1 -lw $s1, -88($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 120($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -92($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_22 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -100($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_22 GOTO label_FALSE_175 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_22 GOTO label_FALSE_175 -lw $t0, -92($fp) -beq $t0, 0, label_FALSE_175 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_24 GOTO label_FALSE_175 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_24 GOTO label_FALSE_175 -lw $t0, -100($fp) -beq $t0, 0, label_FALSE_175 -# LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) -# Comparing -92($fp) type with String -la $v0, String -lw $a0, -92($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -84($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_COMPARE_STRING_178 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_COMPARE_STRING_178 -lw $t0, -84($fp) -beq $t0, 0, label_COMPARE_STRING_178 -# LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) -# Comparing -92($fp) type with Bool -la $v0, Bool -lw $a0, -92($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -84($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_179 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_179 -lw $t0, -84($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_179 -# LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) -# Comparing -92($fp) type with Int -la $v0, Int -lw $a0, -92($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -84($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_179 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_179 -lw $t0, -84($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_179 -# LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) -# Load pointers and SUB -lw $a0, -92($fp) -lw $a1, -100($fp) -sub $a0, $a0, $a1 -sw $a0, -84($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_176 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_176 -lw $t0, -84($fp) -beq $t0, 0, label_TRUE_176 -# GOTO label_FALSE_175 -j label_FALSE_175 -label_COMPARE_BY_VALUE_179: - # LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) - lw $a0, -92($fp) - lw $a1, -100($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -84($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_176 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_176 - lw $t0, -84($fp) - beq $t0, 0, label_TRUE_176 - # GOTO label_FALSE_175 - j label_FALSE_175 - label_COMPARE_STRING_178: - # LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) - # Load strings for comparison - lw $v0, -92($fp) - lw $v1, -100($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -84($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_CONTINUE_180 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_CONTINUE_180 - lw $t0, -84($fp) - beq $t0, 0, label_CONTINUE_180 - # GOTO label_FALSE_175 - j label_FALSE_175 - label_CONTINUE_180: - # LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -92($fp) - lw $v1, -100($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_181: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_182 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_181 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_182: - # Store result - sw $a2, -84($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_176 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_176 - lw $t0, -84($fp) - beq $t0, 0, label_TRUE_176 - label_FALSE_175: - # LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -80($fp) - # GOTO label_END_177 -j label_END_177 -label_TRUE_176: - # LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -80($fp) - label_END_177: -# LOCAL local_neighbors_at_CellularAutomaton_internal_17 --> -72($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) -# Obtain value from -80($fp) -lw $v0, -80($fp) -lw $v0, 12($v0) -sw $v0, -72($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_173 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_173 -lw $t0, -72($fp) -beq $t0, 0, label_FALSEIF_173 -# LOCAL local_neighbors_at_CellularAutomaton_internal_25 --> -104($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -104($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_18 --> -76($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_25 --> -104($fp) -# local_neighbors_at_CellularAutomaton_internal_18 = local_neighbors_at_CellularAutomaton_internal_25 -lw $t0, -104($fp) -sw $t0, -76($fp) -# GOTO label_ENDIF_174 -j label_ENDIF_174 -label_FALSEIF_173: - # LOCAL local_neighbors_at_CellularAutomaton_internal_26 --> -108($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -108($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_18 --> -76($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_26 --> -108($fp) - # local_neighbors_at_CellularAutomaton_internal_18 = local_neighbors_at_CellularAutomaton_internal_26 - lw $t0, -108($fp) - sw $t0, -76($fp) - label_ENDIF_174: -# LOCAL local_neighbors_at_CellularAutomaton_internal_6 --> -28($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_18 --> -76($fp) -# local_neighbors_at_CellularAutomaton_internal_6 = local_neighbors_at_CellularAutomaton_internal_8 + local_neighbors_at_CellularAutomaton_internal_18 -lw $t1, -36($fp) -lw $t0, 12($t1) -lw $t1, -76($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -28($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_33 --> -136($fp) -# local_neighbors_at_CellularAutomaton_internal_33 = SELF -sw $s1, -136($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_31 --> -128($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_33 --> -136($fp) -# local_neighbors_at_CellularAutomaton_internal_31 = local_neighbors_at_CellularAutomaton_internal_33 -lw $t0, -136($fp) -sw $t0, -128($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t0, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_31 --> -128($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) -# local_neighbors_at_CellularAutomaton_internal_32 = VCALL local_neighbors_at_CellularAutomaton_internal_31 east -# Save new self pointer in $s1 -lw $s1, -128($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 16($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -132($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_23 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -140($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_FALSE_185 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_FALSE_185 -lw $t0, -132($fp) -beq $t0, 0, label_FALSE_185 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_34 GOTO label_FALSE_185 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_34 GOTO label_FALSE_185 -lw $t0, -140($fp) -beq $t0, 0, label_FALSE_185 -# LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) -# Comparing -132($fp) type with String -la $v0, String -lw $a0, -132($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -124($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_COMPARE_STRING_188 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_COMPARE_STRING_188 -lw $t0, -124($fp) -beq $t0, 0, label_COMPARE_STRING_188 -# LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) -# Comparing -132($fp) type with Bool -la $v0, Bool -lw $a0, -132($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -124($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_COMPARE_BY_VALUE_189 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_COMPARE_BY_VALUE_189 -lw $t0, -124($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_189 -# LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) -# Comparing -132($fp) type with Int -la $v0, Int -lw $a0, -132($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -124($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_COMPARE_BY_VALUE_189 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_COMPARE_BY_VALUE_189 -lw $t0, -124($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_189 -# LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) -# Load pointers and SUB -lw $a0, -132($fp) -lw $a1, -140($fp) -sub $a0, $a0, $a1 -sw $a0, -124($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_TRUE_186 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_TRUE_186 -lw $t0, -124($fp) -beq $t0, 0, label_TRUE_186 -# GOTO label_FALSE_185 -j label_FALSE_185 -label_COMPARE_BY_VALUE_189: - # LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) - lw $a0, -132($fp) - lw $a1, -140($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -124($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_TRUE_186 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_TRUE_186 - lw $t0, -124($fp) - beq $t0, 0, label_TRUE_186 - # GOTO label_FALSE_185 - j label_FALSE_185 - label_COMPARE_STRING_188: - # LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) - # Load strings for comparison - lw $v0, -132($fp) - lw $v1, -140($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -124($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_CONTINUE_190 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_CONTINUE_190 - lw $t0, -124($fp) - beq $t0, 0, label_CONTINUE_190 - # GOTO label_FALSE_185 - j label_FALSE_185 - label_CONTINUE_190: - # LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -132($fp) - lw $v1, -140($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_191: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_192 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_191 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_192: - # Store result - sw $a2, -124($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_TRUE_186 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_TRUE_186 - lw $t0, -124($fp) - beq $t0, 0, label_TRUE_186 - label_FALSE_185: - # LOCAL local_neighbors_at_CellularAutomaton_internal_29 --> -120($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -120($fp) - # GOTO label_END_187 -j label_END_187 -label_TRUE_186: - # LOCAL local_neighbors_at_CellularAutomaton_internal_29 --> -120($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -120($fp) - label_END_187: -# LOCAL local_neighbors_at_CellularAutomaton_internal_27 --> -112($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_29 --> -120($fp) -# Obtain value from -120($fp) -lw $v0, -120($fp) -lw $v0, 12($v0) -sw $v0, -112($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_27 GOTO label_FALSEIF_183 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_27 GOTO label_FALSEIF_183 -lw $t0, -112($fp) -beq $t0, 0, label_FALSEIF_183 -# LOCAL local_neighbors_at_CellularAutomaton_internal_35 --> -144($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -144($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_28 --> -116($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_35 --> -144($fp) -# local_neighbors_at_CellularAutomaton_internal_28 = local_neighbors_at_CellularAutomaton_internal_35 -lw $t0, -144($fp) -sw $t0, -116($fp) -# GOTO label_ENDIF_184 -j label_ENDIF_184 -label_FALSEIF_183: - # LOCAL local_neighbors_at_CellularAutomaton_internal_36 --> -148($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -148($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_28 --> -116($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_36 --> -148($fp) - # local_neighbors_at_CellularAutomaton_internal_28 = local_neighbors_at_CellularAutomaton_internal_36 - lw $t0, -148($fp) - sw $t0, -116($fp) - label_ENDIF_184: -# LOCAL local_neighbors_at_CellularAutomaton_internal_5 --> -24($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_6 --> -28($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_28 --> -116($fp) -# local_neighbors_at_CellularAutomaton_internal_5 = local_neighbors_at_CellularAutomaton_internal_6 + local_neighbors_at_CellularAutomaton_internal_28 -lw $t1, -28($fp) -lw $t0, 12($t1) -lw $t1, -116($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -24($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_43 --> -176($fp) -# local_neighbors_at_CellularAutomaton_internal_43 = SELF -sw $s1, -176($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_41 --> -168($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_43 --> -176($fp) -# local_neighbors_at_CellularAutomaton_internal_41 = local_neighbors_at_CellularAutomaton_internal_43 -lw $t0, -176($fp) -sw $t0, -168($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t0, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_41 --> -168($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) -# local_neighbors_at_CellularAutomaton_internal_42 = VCALL local_neighbors_at_CellularAutomaton_internal_41 west -# Save new self pointer in $s1 -lw $s1, -168($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 76($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -172($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_24 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -180($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_42 GOTO label_FALSE_195 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_42 GOTO label_FALSE_195 -lw $t0, -172($fp) -beq $t0, 0, label_FALSE_195 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_FALSE_195 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_FALSE_195 -lw $t0, -180($fp) -beq $t0, 0, label_FALSE_195 -# LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) -# Comparing -172($fp) type with String -la $v0, String -lw $a0, -172($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -164($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_COMPARE_STRING_198 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_COMPARE_STRING_198 -lw $t0, -164($fp) -beq $t0, 0, label_COMPARE_STRING_198 -# LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) -# Comparing -172($fp) type with Bool -la $v0, Bool -lw $a0, -172($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -164($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_COMPARE_BY_VALUE_199 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_COMPARE_BY_VALUE_199 -lw $t0, -164($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_199 -# LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) -# Comparing -172($fp) type with Int -la $v0, Int -lw $a0, -172($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -164($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_COMPARE_BY_VALUE_199 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_COMPARE_BY_VALUE_199 -lw $t0, -164($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_199 -# LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) -# Load pointers and SUB -lw $a0, -172($fp) -lw $a1, -180($fp) -sub $a0, $a0, $a1 -sw $a0, -164($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_TRUE_196 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_TRUE_196 -lw $t0, -164($fp) -beq $t0, 0, label_TRUE_196 -# GOTO label_FALSE_195 -j label_FALSE_195 -label_COMPARE_BY_VALUE_199: - # LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) - lw $a0, -172($fp) - lw $a1, -180($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -164($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_TRUE_196 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_TRUE_196 - lw $t0, -164($fp) - beq $t0, 0, label_TRUE_196 - # GOTO label_FALSE_195 - j label_FALSE_195 - label_COMPARE_STRING_198: - # LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) - # Load strings for comparison - lw $v0, -172($fp) - lw $v1, -180($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -164($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_CONTINUE_200 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_CONTINUE_200 - lw $t0, -164($fp) - beq $t0, 0, label_CONTINUE_200 - # GOTO label_FALSE_195 - j label_FALSE_195 - label_CONTINUE_200: - # LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -172($fp) - lw $v1, -180($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_201: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_202 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_201 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_202: - # Store result - sw $a2, -164($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_TRUE_196 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_TRUE_196 - lw $t0, -164($fp) - beq $t0, 0, label_TRUE_196 - label_FALSE_195: - # LOCAL local_neighbors_at_CellularAutomaton_internal_39 --> -160($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -160($fp) - # GOTO label_END_197 -j label_END_197 -label_TRUE_196: - # LOCAL local_neighbors_at_CellularAutomaton_internal_39 --> -160($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -160($fp) - label_END_197: -# LOCAL local_neighbors_at_CellularAutomaton_internal_37 --> -152($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_39 --> -160($fp) -# Obtain value from -160($fp) -lw $v0, -160($fp) -lw $v0, 12($v0) -sw $v0, -152($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_37 GOTO label_FALSEIF_193 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_37 GOTO label_FALSEIF_193 -lw $t0, -152($fp) -beq $t0, 0, label_FALSEIF_193 -# LOCAL local_neighbors_at_CellularAutomaton_internal_45 --> -184($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -184($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_45 --> -184($fp) -# local_neighbors_at_CellularAutomaton_internal_38 = local_neighbors_at_CellularAutomaton_internal_45 -lw $t0, -184($fp) -sw $t0, -156($fp) -# GOTO label_ENDIF_194 -j label_ENDIF_194 -label_FALSEIF_193: - # LOCAL local_neighbors_at_CellularAutomaton_internal_46 --> -188($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -188($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_46 --> -188($fp) - # local_neighbors_at_CellularAutomaton_internal_38 = local_neighbors_at_CellularAutomaton_internal_46 - lw $t0, -188($fp) - sw $t0, -156($fp) - label_ENDIF_194: -# LOCAL local_neighbors_at_CellularAutomaton_internal_4 --> -20($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_5 --> -24($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) -# local_neighbors_at_CellularAutomaton_internal_4 = local_neighbors_at_CellularAutomaton_internal_5 + local_neighbors_at_CellularAutomaton_internal_38 -lw $t1, -24($fp) -lw $t0, 12($t1) -lw $t1, -156($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -20($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_53 --> -216($fp) -# local_neighbors_at_CellularAutomaton_internal_53 = SELF -sw $s1, -216($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_51 --> -208($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_53 --> -216($fp) -# local_neighbors_at_CellularAutomaton_internal_51 = local_neighbors_at_CellularAutomaton_internal_53 -lw $t0, -216($fp) -sw $t0, -208($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t0, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_51 --> -208($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) -# local_neighbors_at_CellularAutomaton_internal_52 = VCALL local_neighbors_at_CellularAutomaton_internal_51 northeast -# Save new self pointer in $s1 -lw $s1, -208($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 8($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -212($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_25 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -220($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_52 GOTO label_FALSE_205 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_52 GOTO label_FALSE_205 -lw $t0, -212($fp) -beq $t0, 0, label_FALSE_205 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_54 GOTO label_FALSE_205 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_54 GOTO label_FALSE_205 -lw $t0, -220($fp) -beq $t0, 0, label_FALSE_205 -# LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) -# Comparing -212($fp) type with String -la $v0, String -lw $a0, -212($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -204($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_COMPARE_STRING_208 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_COMPARE_STRING_208 -lw $t0, -204($fp) -beq $t0, 0, label_COMPARE_STRING_208 -# LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) -# Comparing -212($fp) type with Bool -la $v0, Bool -lw $a0, -212($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -204($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_COMPARE_BY_VALUE_209 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_COMPARE_BY_VALUE_209 -lw $t0, -204($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_209 -# LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) -# Comparing -212($fp) type with Int -la $v0, Int -lw $a0, -212($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -204($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_COMPARE_BY_VALUE_209 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_COMPARE_BY_VALUE_209 -lw $t0, -204($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_209 -# LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) -# Load pointers and SUB -lw $a0, -212($fp) -lw $a1, -220($fp) -sub $a0, $a0, $a1 -sw $a0, -204($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_206 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_206 -lw $t0, -204($fp) -beq $t0, 0, label_TRUE_206 -# GOTO label_FALSE_205 -j label_FALSE_205 -label_COMPARE_BY_VALUE_209: - # LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) - lw $a0, -212($fp) - lw $a1, -220($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -204($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_206 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_206 - lw $t0, -204($fp) - beq $t0, 0, label_TRUE_206 - # GOTO label_FALSE_205 - j label_FALSE_205 - label_COMPARE_STRING_208: - # LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) - # Load strings for comparison - lw $v0, -212($fp) - lw $v1, -220($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -204($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_CONTINUE_210 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_CONTINUE_210 - lw $t0, -204($fp) - beq $t0, 0, label_CONTINUE_210 - # GOTO label_FALSE_205 - j label_FALSE_205 - label_CONTINUE_210: - # LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -212($fp) - lw $v1, -220($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_211: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_212 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_211 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_212: - # Store result - sw $a2, -204($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_206 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_206 - lw $t0, -204($fp) - beq $t0, 0, label_TRUE_206 - label_FALSE_205: - # LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -200($fp) - # GOTO label_END_207 -j label_END_207 -label_TRUE_206: - # LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -200($fp) - label_END_207: -# LOCAL local_neighbors_at_CellularAutomaton_internal_47 --> -192($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) -# Obtain value from -200($fp) -lw $v0, -200($fp) -lw $v0, 12($v0) -sw $v0, -192($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_47 GOTO label_FALSEIF_203 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_47 GOTO label_FALSEIF_203 -lw $t0, -192($fp) -beq $t0, 0, label_FALSEIF_203 -# LOCAL local_neighbors_at_CellularAutomaton_internal_55 --> -224($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -224($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_48 --> -196($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_55 --> -224($fp) -# local_neighbors_at_CellularAutomaton_internal_48 = local_neighbors_at_CellularAutomaton_internal_55 -lw $t0, -224($fp) -sw $t0, -196($fp) -# GOTO label_ENDIF_204 -j label_ENDIF_204 -label_FALSEIF_203: - # LOCAL local_neighbors_at_CellularAutomaton_internal_56 --> -228($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -228($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_48 --> -196($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_56 --> -228($fp) - # local_neighbors_at_CellularAutomaton_internal_48 = local_neighbors_at_CellularAutomaton_internal_56 - lw $t0, -228($fp) - sw $t0, -196($fp) - label_ENDIF_204: -# LOCAL local_neighbors_at_CellularAutomaton_internal_3 --> -16($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_4 --> -20($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_48 --> -196($fp) -# local_neighbors_at_CellularAutomaton_internal_3 = local_neighbors_at_CellularAutomaton_internal_4 + local_neighbors_at_CellularAutomaton_internal_48 -lw $t1, -20($fp) -lw $t0, 12($t1) -lw $t1, -196($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -16($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_63 --> -256($fp) -# local_neighbors_at_CellularAutomaton_internal_63 = SELF -sw $s1, -256($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_61 --> -248($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_63 --> -256($fp) -# local_neighbors_at_CellularAutomaton_internal_61 = local_neighbors_at_CellularAutomaton_internal_63 -lw $t0, -256($fp) -sw $t0, -248($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t0, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_61 --> -248($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) -# local_neighbors_at_CellularAutomaton_internal_62 = VCALL local_neighbors_at_CellularAutomaton_internal_61 northwest -# Save new self pointer in $s1 -lw $s1, -248($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 36($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -252($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_64 --> -260($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_26 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -260($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_62 GOTO label_FALSE_215 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_62 GOTO label_FALSE_215 -lw $t0, -252($fp) -beq $t0, 0, label_FALSE_215 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_64 GOTO label_FALSE_215 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_64 GOTO label_FALSE_215 -lw $t0, -260($fp) -beq $t0, 0, label_FALSE_215 -# LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) -# Comparing -252($fp) type with String -la $v0, String -lw $a0, -252($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -244($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_COMPARE_STRING_218 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_COMPARE_STRING_218 -lw $t0, -244($fp) -beq $t0, 0, label_COMPARE_STRING_218 -# LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) -# Comparing -252($fp) type with Bool -la $v0, Bool -lw $a0, -252($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -244($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_COMPARE_BY_VALUE_219 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_COMPARE_BY_VALUE_219 -lw $t0, -244($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_219 -# LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) -# Comparing -252($fp) type with Int -la $v0, Int -lw $a0, -252($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -244($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_COMPARE_BY_VALUE_219 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_COMPARE_BY_VALUE_219 -lw $t0, -244($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_219 -# LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_64 --> -260($fp) -# Load pointers and SUB -lw $a0, -252($fp) -lw $a1, -260($fp) -sub $a0, $a0, $a1 -sw $a0, -244($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_TRUE_216 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_TRUE_216 -lw $t0, -244($fp) -beq $t0, 0, label_TRUE_216 -# GOTO label_FALSE_215 -j label_FALSE_215 -label_COMPARE_BY_VALUE_219: - # LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_64 --> -260($fp) - lw $a0, -252($fp) - lw $a1, -260($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -244($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_TRUE_216 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_TRUE_216 - lw $t0, -244($fp) - beq $t0, 0, label_TRUE_216 - # GOTO label_FALSE_215 - j label_FALSE_215 - label_COMPARE_STRING_218: - # LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_64 --> -260($fp) - # Load strings for comparison - lw $v0, -252($fp) - lw $v1, -260($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -244($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_CONTINUE_220 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_CONTINUE_220 - lw $t0, -244($fp) - beq $t0, 0, label_CONTINUE_220 - # GOTO label_FALSE_215 - j label_FALSE_215 - label_CONTINUE_220: - # LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_64 --> -260($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -252($fp) - lw $v1, -260($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_221: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_222 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_221 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_222: - # Store result - sw $a2, -244($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_TRUE_216 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_TRUE_216 - lw $t0, -244($fp) - beq $t0, 0, label_TRUE_216 - label_FALSE_215: - # LOCAL local_neighbors_at_CellularAutomaton_internal_59 --> -240($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -240($fp) - # GOTO label_END_217 -j label_END_217 -label_TRUE_216: - # LOCAL local_neighbors_at_CellularAutomaton_internal_59 --> -240($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -240($fp) - label_END_217: -# LOCAL local_neighbors_at_CellularAutomaton_internal_57 --> -232($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_59 --> -240($fp) -# Obtain value from -240($fp) -lw $v0, -240($fp) -lw $v0, 12($v0) -sw $v0, -232($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_57 GOTO label_FALSEIF_213 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_57 GOTO label_FALSEIF_213 -lw $t0, -232($fp) -beq $t0, 0, label_FALSEIF_213 -# LOCAL local_neighbors_at_CellularAutomaton_internal_65 --> -264($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -264($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_58 --> -236($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_65 --> -264($fp) -# local_neighbors_at_CellularAutomaton_internal_58 = local_neighbors_at_CellularAutomaton_internal_65 -lw $t0, -264($fp) -sw $t0, -236($fp) -# GOTO label_ENDIF_214 -j label_ENDIF_214 -label_FALSEIF_213: - # LOCAL local_neighbors_at_CellularAutomaton_internal_66 --> -268($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -268($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_58 --> -236($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_66 --> -268($fp) - # local_neighbors_at_CellularAutomaton_internal_58 = local_neighbors_at_CellularAutomaton_internal_66 - lw $t0, -268($fp) - sw $t0, -236($fp) - label_ENDIF_214: -# LOCAL local_neighbors_at_CellularAutomaton_internal_2 --> -12($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_3 --> -16($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_58 --> -236($fp) -# local_neighbors_at_CellularAutomaton_internal_2 = local_neighbors_at_CellularAutomaton_internal_3 + local_neighbors_at_CellularAutomaton_internal_58 -lw $t1, -16($fp) -lw $t0, 12($t1) -lw $t1, -236($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -12($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_73 --> -296($fp) -# local_neighbors_at_CellularAutomaton_internal_73 = SELF -sw $s1, -296($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_71 --> -288($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_73 --> -296($fp) -# local_neighbors_at_CellularAutomaton_internal_71 = local_neighbors_at_CellularAutomaton_internal_73 -lw $t0, -296($fp) -sw $t0, -288($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t0, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_71 --> -288($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) -# local_neighbors_at_CellularAutomaton_internal_72 = VCALL local_neighbors_at_CellularAutomaton_internal_71 southeast -# Save new self pointer in $s1 -lw $s1, -288($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 64($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -292($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_74 --> -300($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_27 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -300($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_72 GOTO label_FALSE_225 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_72 GOTO label_FALSE_225 -lw $t0, -292($fp) -beq $t0, 0, label_FALSE_225 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_74 GOTO label_FALSE_225 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_74 GOTO label_FALSE_225 -lw $t0, -300($fp) -beq $t0, 0, label_FALSE_225 -# LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) -# Comparing -292($fp) type with String -la $v0, String -lw $a0, -292($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -284($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_COMPARE_STRING_228 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_COMPARE_STRING_228 -lw $t0, -284($fp) -beq $t0, 0, label_COMPARE_STRING_228 -# LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) -# Comparing -292($fp) type with Bool -la $v0, Bool -lw $a0, -292($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -284($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_COMPARE_BY_VALUE_229 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_COMPARE_BY_VALUE_229 -lw $t0, -284($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_229 -# LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) -# Comparing -292($fp) type with Int -la $v0, Int -lw $a0, -292($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -284($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_COMPARE_BY_VALUE_229 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_COMPARE_BY_VALUE_229 -lw $t0, -284($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_229 -# LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_74 --> -300($fp) -# Load pointers and SUB -lw $a0, -292($fp) -lw $a1, -300($fp) -sub $a0, $a0, $a1 -sw $a0, -284($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_TRUE_226 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_TRUE_226 -lw $t0, -284($fp) -beq $t0, 0, label_TRUE_226 -# GOTO label_FALSE_225 -j label_FALSE_225 -label_COMPARE_BY_VALUE_229: - # LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_74 --> -300($fp) - lw $a0, -292($fp) - lw $a1, -300($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -284($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_TRUE_226 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_TRUE_226 - lw $t0, -284($fp) - beq $t0, 0, label_TRUE_226 - # GOTO label_FALSE_225 - j label_FALSE_225 - label_COMPARE_STRING_228: - # LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_74 --> -300($fp) - # Load strings for comparison - lw $v0, -292($fp) - lw $v1, -300($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -284($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_CONTINUE_230 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_CONTINUE_230 - lw $t0, -284($fp) - beq $t0, 0, label_CONTINUE_230 - # GOTO label_FALSE_225 - j label_FALSE_225 - label_CONTINUE_230: - # LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_74 --> -300($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -292($fp) - lw $v1, -300($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_231: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_232 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_231 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_232: - # Store result - sw $a2, -284($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_TRUE_226 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_TRUE_226 - lw $t0, -284($fp) - beq $t0, 0, label_TRUE_226 - label_FALSE_225: - # LOCAL local_neighbors_at_CellularAutomaton_internal_69 --> -280($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -280($fp) - # GOTO label_END_227 -j label_END_227 -label_TRUE_226: - # LOCAL local_neighbors_at_CellularAutomaton_internal_69 --> -280($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -280($fp) - label_END_227: -# LOCAL local_neighbors_at_CellularAutomaton_internal_67 --> -272($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_69 --> -280($fp) -# Obtain value from -280($fp) -lw $v0, -280($fp) -lw $v0, 12($v0) -sw $v0, -272($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_67 GOTO label_FALSEIF_223 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_67 GOTO label_FALSEIF_223 -lw $t0, -272($fp) -beq $t0, 0, label_FALSEIF_223 -# LOCAL local_neighbors_at_CellularAutomaton_internal_75 --> -304($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -304($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_68 --> -276($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_75 --> -304($fp) -# local_neighbors_at_CellularAutomaton_internal_68 = local_neighbors_at_CellularAutomaton_internal_75 -lw $t0, -304($fp) -sw $t0, -276($fp) -# GOTO label_ENDIF_224 -j label_ENDIF_224 -label_FALSEIF_223: - # LOCAL local_neighbors_at_CellularAutomaton_internal_76 --> -308($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -308($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_68 --> -276($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_76 --> -308($fp) - # local_neighbors_at_CellularAutomaton_internal_68 = local_neighbors_at_CellularAutomaton_internal_76 - lw $t0, -308($fp) - sw $t0, -276($fp) - label_ENDIF_224: -# LOCAL local_neighbors_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_2 --> -12($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_68 --> -276($fp) -# local_neighbors_at_CellularAutomaton_internal_1 = local_neighbors_at_CellularAutomaton_internal_2 + local_neighbors_at_CellularAutomaton_internal_68 -lw $t1, -12($fp) -lw $t0, 12($t1) -lw $t1, -276($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -8($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_83 --> -336($fp) -# local_neighbors_at_CellularAutomaton_internal_83 = SELF -sw $s1, -336($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_81 --> -328($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_83 --> -336($fp) -# local_neighbors_at_CellularAutomaton_internal_81 = local_neighbors_at_CellularAutomaton_internal_83 -lw $t0, -336($fp) -sw $t0, -328($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_neighbors_at_CellularAutomaton_position_0 -# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) -lw $t0, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_81 --> -328($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) -# local_neighbors_at_CellularAutomaton_internal_82 = VCALL local_neighbors_at_CellularAutomaton_internal_81 southwest -# Save new self pointer in $s1 -lw $s1, -328($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 40($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -332($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_neighbors_at_CellularAutomaton_internal_84 --> -340($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_28 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -340($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_82 GOTO label_FALSE_235 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_82 GOTO label_FALSE_235 -lw $t0, -332($fp) -beq $t0, 0, label_FALSE_235 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_84 GOTO label_FALSE_235 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_84 GOTO label_FALSE_235 -lw $t0, -340($fp) -beq $t0, 0, label_FALSE_235 -# LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) -# Comparing -332($fp) type with String -la $v0, String -lw $a0, -332($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -324($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_COMPARE_STRING_238 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_COMPARE_STRING_238 -lw $t0, -324($fp) -beq $t0, 0, label_COMPARE_STRING_238 -# LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) -# Comparing -332($fp) type with Bool -la $v0, Bool -lw $a0, -332($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -324($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_COMPARE_BY_VALUE_239 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_COMPARE_BY_VALUE_239 -lw $t0, -324($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_239 -# LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) -# Comparing -332($fp) type with Int -la $v0, Int -lw $a0, -332($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -324($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_COMPARE_BY_VALUE_239 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_COMPARE_BY_VALUE_239 -lw $t0, -324($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_239 -# LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_84 --> -340($fp) -# Load pointers and SUB -lw $a0, -332($fp) -lw $a1, -340($fp) -sub $a0, $a0, $a1 -sw $a0, -324($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_TRUE_236 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_TRUE_236 -lw $t0, -324($fp) -beq $t0, 0, label_TRUE_236 -# GOTO label_FALSE_235 -j label_FALSE_235 -label_COMPARE_BY_VALUE_239: - # LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_84 --> -340($fp) - lw $a0, -332($fp) - lw $a1, -340($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -324($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_TRUE_236 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_TRUE_236 - lw $t0, -324($fp) - beq $t0, 0, label_TRUE_236 - # GOTO label_FALSE_235 - j label_FALSE_235 - label_COMPARE_STRING_238: - # LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_84 --> -340($fp) - # Load strings for comparison - lw $v0, -332($fp) - lw $v1, -340($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -324($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_CONTINUE_240 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_CONTINUE_240 - lw $t0, -324($fp) - beq $t0, 0, label_CONTINUE_240 - # GOTO label_FALSE_235 - j label_FALSE_235 - label_CONTINUE_240: - # LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_84 --> -340($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -332($fp) - lw $v1, -340($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_241: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_242 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_241 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_242: - # Store result - sw $a2, -324($fp) - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_TRUE_236 - # IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_TRUE_236 - lw $t0, -324($fp) - beq $t0, 0, label_TRUE_236 - label_FALSE_235: - # LOCAL local_neighbors_at_CellularAutomaton_internal_79 --> -320($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -320($fp) - # GOTO label_END_237 -j label_END_237 -label_TRUE_236: - # LOCAL local_neighbors_at_CellularAutomaton_internal_79 --> -320($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -320($fp) - label_END_237: -# LOCAL local_neighbors_at_CellularAutomaton_internal_77 --> -312($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_79 --> -320($fp) -# Obtain value from -320($fp) -lw $v0, -320($fp) -lw $v0, 12($v0) -sw $v0, -312($fp) -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_77 GOTO label_FALSEIF_233 -# IF_ZERO local_neighbors_at_CellularAutomaton_internal_77 GOTO label_FALSEIF_233 -lw $t0, -312($fp) -beq $t0, 0, label_FALSEIF_233 -# LOCAL local_neighbors_at_CellularAutomaton_internal_85 --> -344($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -344($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_78 --> -316($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_85 --> -344($fp) -# local_neighbors_at_CellularAutomaton_internal_78 = local_neighbors_at_CellularAutomaton_internal_85 -lw $t0, -344($fp) -sw $t0, -316($fp) -# GOTO label_ENDIF_234 -j label_ENDIF_234 -label_FALSEIF_233: - # LOCAL local_neighbors_at_CellularAutomaton_internal_86 --> -348($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -348($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_78 --> -316($fp) - # LOCAL local_neighbors_at_CellularAutomaton_internal_86 --> -348($fp) - # local_neighbors_at_CellularAutomaton_internal_78 = local_neighbors_at_CellularAutomaton_internal_86 - lw $t0, -348($fp) - sw $t0, -316($fp) - label_ENDIF_234: -# LOCAL local_neighbors_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_neighbors_at_CellularAutomaton_internal_78 --> -316($fp) -# local_neighbors_at_CellularAutomaton_internal_0 = local_neighbors_at_CellularAutomaton_internal_1 + local_neighbors_at_CellularAutomaton_internal_78 -lw $t1, -8($fp) -lw $t0, 12($t1) -lw $t1, -316($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -4($fp) -# RETURN local_neighbors_at_CellularAutomaton_internal_0 -lw $v0, -4($fp) -# Deallocate stack frame for function function_neighbors_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 356 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_cell_at_next_evolution_at_CellularAutomaton implementation. -# @Params: -# 0($fp) = param_cell_at_next_evolution_at_CellularAutomaton_position_0 -function_cell_at_next_evolution_at_CellularAutomaton: - # Allocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. - subu $sp, $sp, 120 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 120 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_6 = SELF - sw $s1, -28($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_4 = local_cell_at_next_evolution_at_CellularAutomaton_internal_6 - lw $t0, -28($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 - # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_5 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 neighbors - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 84($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 3 - sw $t0, 12($v0) - sw $v0, -32($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_5 GOTO label_FALSE_245 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_5 GOTO label_FALSE_245 - lw $t0, -24($fp) - beq $t0, 0, label_FALSE_245 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_FALSE_245 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_FALSE_245 - lw $t0, -32($fp) - beq $t0, 0, label_FALSE_245 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) - # Comparing -24($fp) type with String - la $v0, String - lw $a0, -24($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_248 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_248 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_248 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) - # Comparing -24($fp) type with Bool - la $v0, Bool - lw $a0, -24($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_249 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_249 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_249 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) - # Comparing -24($fp) type with Int - la $v0, Int - lw $a0, -24($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_249 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_249 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_249 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) - # Load pointers and SUB - lw $a0, -24($fp) - lw $a1, -32($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_246 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_246 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_246 - # GOTO label_FALSE_245 - j label_FALSE_245 - label_COMPARE_BY_VALUE_249: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) - lw $a0, -24($fp) - lw $a1, -32($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_246 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_246 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_246 - # GOTO label_FALSE_245 - j label_FALSE_245 - label_COMPARE_STRING_248: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) - # Load strings for comparison - lw $v0, -24($fp) - lw $v1, -32($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_250 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_250 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_250 - # GOTO label_FALSE_245 - j label_FALSE_245 - label_CONTINUE_250: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -24($fp) - lw $v1, -32($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_251: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_252 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_251 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_252: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_246 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_246 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_246 - label_FALSE_245: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_247 -j label_END_247 -label_TRUE_246: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_247: -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_0 --> -4($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_243 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_243 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_243 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_29 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -36($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = local_cell_at_next_evolution_at_CellularAutomaton_internal_8 -lw $t0, -36($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_244 -j label_ENDIF_244 -label_FALSEIF_243: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_13 = local_cell_at_next_evolution_at_CellularAutomaton_internal_15 - lw $t0, -64($fp) - sw $t0, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 - # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_14 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 neighbors - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 84($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 2 - sw $t0, 12($v0) - sw $v0, -68($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_14 GOTO label_FALSE_255 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_14 GOTO label_FALSE_255 - lw $t0, -60($fp) - beq $t0, 0, label_FALSE_255 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_16 GOTO label_FALSE_255 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_16 GOTO label_FALSE_255 - lw $t0, -68($fp) - beq $t0, 0, label_FALSE_255 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) - # Comparing -60($fp) type with String - la $v0, String - lw $a0, -60($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -52($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_COMPARE_STRING_258 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_COMPARE_STRING_258 - lw $t0, -52($fp) - beq $t0, 0, label_COMPARE_STRING_258 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) - # Comparing -60($fp) type with Bool - la $v0, Bool - lw $a0, -60($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -52($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_COMPARE_BY_VALUE_259 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_COMPARE_BY_VALUE_259 - lw $t0, -52($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_259 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) - # Comparing -60($fp) type with Int - la $v0, Int - lw $a0, -60($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -52($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_COMPARE_BY_VALUE_259 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_COMPARE_BY_VALUE_259 - lw $t0, -52($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_259 - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) - # Load pointers and SUB - lw $a0, -60($fp) - lw $a1, -68($fp) - sub $a0, $a0, $a1 - sw $a0, -52($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_256 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_256 - lw $t0, -52($fp) - beq $t0, 0, label_TRUE_256 - # GOTO label_FALSE_255 - j label_FALSE_255 - label_COMPARE_BY_VALUE_259: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) - lw $a0, -60($fp) - lw $a1, -68($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -52($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_256 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_256 - lw $t0, -52($fp) - beq $t0, 0, label_TRUE_256 - # GOTO label_FALSE_255 - j label_FALSE_255 - label_COMPARE_STRING_258: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) - # Load strings for comparison - lw $v0, -60($fp) - lw $v1, -68($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -52($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_CONTINUE_260 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_CONTINUE_260 - lw $t0, -52($fp) - beq $t0, 0, label_CONTINUE_260 - # GOTO label_FALSE_255 - j label_FALSE_255 - label_CONTINUE_260: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -60($fp) - lw $v1, -68($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_261: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_262 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_261 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_262: - # Store result - sw $a2, -52($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_256 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_256 - lw $t0, -52($fp) - beq $t0, 0, label_TRUE_256 - label_FALSE_255: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -48($fp) - # GOTO label_END_257 -j label_END_257 -label_TRUE_256: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -48($fp) - label_END_257: -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) -# Obtain value from -48($fp) -lw $v0, -48($fp) -lw $v0, 12($v0) -sw $v0, -40($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_FALSEIF_253 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_FALSEIF_253 -lw $t0, -40($fp) -beq $t0, 0, label_FALSEIF_253 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_23 = SELF -sw $s1, -96($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_21 = local_cell_at_next_evolution_at_CellularAutomaton_internal_23 -lw $t0, -96($fp) -sw $t0, -88($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 -# PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) -lw $t0, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_22 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 cell -# Save new self pointer in $s1 -lw $s1, -88($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 108($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -92($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_30 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -100($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_22 GOTO label_FALSE_265 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_22 GOTO label_FALSE_265 -lw $t0, -92($fp) -beq $t0, 0, label_FALSE_265 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_24 GOTO label_FALSE_265 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_24 GOTO label_FALSE_265 -lw $t0, -100($fp) -beq $t0, 0, label_FALSE_265 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) -# Comparing -92($fp) type with String -la $v0, String -lw $a0, -92($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -84($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_COMPARE_STRING_268 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_COMPARE_STRING_268 -lw $t0, -84($fp) -beq $t0, 0, label_COMPARE_STRING_268 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) -# Comparing -92($fp) type with Bool -la $v0, Bool -lw $a0, -92($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -84($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_269 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_269 -lw $t0, -84($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_269 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) -# Comparing -92($fp) type with Int -la $v0, Int -lw $a0, -92($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -84($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_269 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_269 -lw $t0, -84($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_269 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) -# Load pointers and SUB -lw $a0, -92($fp) -lw $a1, -100($fp) -sub $a0, $a0, $a1 -sw $a0, -84($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_TRUE_266 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_TRUE_266 -lw $t0, -84($fp) -beq $t0, 0, label_TRUE_266 -# GOTO label_FALSE_265 -j label_FALSE_265 -label_COMPARE_BY_VALUE_269: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) - lw $a0, -92($fp) - lw $a1, -100($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -84($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_TRUE_266 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_TRUE_266 - lw $t0, -84($fp) - beq $t0, 0, label_TRUE_266 - # GOTO label_FALSE_265 - j label_FALSE_265 - label_COMPARE_STRING_268: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) - # Load strings for comparison - lw $v0, -92($fp) - lw $v1, -100($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -84($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_CONTINUE_270 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_CONTINUE_270 - lw $t0, -84($fp) - beq $t0, 0, label_CONTINUE_270 - # GOTO label_FALSE_265 - j label_FALSE_265 - label_CONTINUE_270: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -92($fp) - lw $v1, -100($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_271: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_272 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_271 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_272: - # Store result - sw $a2, -84($fp) - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_TRUE_266 - # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_TRUE_266 - lw $t0, -84($fp) - beq $t0, 0, label_TRUE_266 - label_FALSE_265: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -80($fp) - # GOTO label_END_267 -j label_END_267 -label_TRUE_266: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -80($fp) - label_END_267: -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) -# Obtain value from -80($fp) -lw $v0, -80($fp) -lw $v0, 12($v0) -sw $v0, -72($fp) -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_263 -# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_263 -lw $t0, -72($fp) -beq $t0, 0, label_FALSEIF_263 -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_25 --> -104($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_31 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -104($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_25 --> -104($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_18 = local_cell_at_next_evolution_at_CellularAutomaton_internal_25 -lw $t0, -104($fp) -sw $t0, -76($fp) -# GOTO label_ENDIF_264 -j label_ENDIF_264 -label_FALSEIF_263: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_26 --> -108($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_32 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -108($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_26 --> -108($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_18 = local_cell_at_next_evolution_at_CellularAutomaton_internal_26 - lw $t0, -108($fp) - sw $t0, -76($fp) - label_ENDIF_264: -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_10 = local_cell_at_next_evolution_at_CellularAutomaton_internal_18 -lw $t0, -76($fp) -sw $t0, -44($fp) -# GOTO label_ENDIF_254 -j label_ENDIF_254 -label_FALSEIF_253: - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_27 --> -112($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_33 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -112($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) - # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_27 --> -112($fp) - # local_cell_at_next_evolution_at_CellularAutomaton_internal_10 = local_cell_at_next_evolution_at_CellularAutomaton_internal_27 - lw $t0, -112($fp) - sw $t0, -44($fp) - label_ENDIF_254: -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) -# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) -# local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = local_cell_at_next_evolution_at_CellularAutomaton_internal_10 -lw $t0, -44($fp) -sw $t0, -8($fp) -label_ENDIF_244: -# RETURN local_cell_at_next_evolution_at_CellularAutomaton_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 120 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_evolve_at_CellularAutomaton implementation. -# @Params: -function_evolve_at_CellularAutomaton: - # Allocate stack frame for function function_evolve_at_CellularAutomaton. - subu $sp, $sp, 76 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 76 - # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -8($fp) - # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_1 --> -8($fp) - # local_evolve_at_CellularAutomaton_position_0 = local_evolve_at_CellularAutomaton_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # LOCAL local_evolve_at_CellularAutomaton_num_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_5 --> -24($fp) - # local_evolve_at_CellularAutomaton_internal_5 = SELF - sw $s1, -24($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_5 --> -24($fp) - # local_evolve_at_CellularAutomaton_internal_3 = local_evolve_at_CellularAutomaton_internal_5 - lw $t0, -24($fp) - sw $t0, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) - # local_evolve_at_CellularAutomaton_internal_4 = VCALL local_evolve_at_CellularAutomaton_internal_3 num_cells - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 20($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_evolve_at_CellularAutomaton_num_2 --> -12($fp) - # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) - # local_evolve_at_CellularAutomaton_num_2 = local_evolve_at_CellularAutomaton_internal_4 - lw $t0, -20($fp) - sw $t0, -12($fp) - # LOCAL local_evolve_at_CellularAutomaton_temp_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_0 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -28($fp) - label_WHILE_273: - # LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) - # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) - # LOCAL local_evolve_at_CellularAutomaton_num_2 --> -12($fp) - lw $a0, -4($fp) - lw $a1, -12($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -36($fp) - # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_8 GOTO label_FALSE_275 - # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_8 GOTO label_FALSE_275 - lw $t0, -36($fp) - bgt $t0, 0, label_FALSE_275 - # IF_ZERO local_evolve_at_CellularAutomaton_internal_8 GOTO label_FALSE_275 - # IF_ZERO local_evolve_at_CellularAutomaton_internal_8 GOTO label_FALSE_275 - lw $t0, -36($fp) - beq $t0, 0, label_FALSE_275 - # LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -36($fp) - # GOTO label_END_276 -j label_END_276 -label_FALSE_275: - # LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -36($fp) - label_END_276: -# LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) -# Obtain value from -36($fp) -lw $v0, -36($fp) -lw $v0, 12($v0) -sw $v0, -32($fp) -# IF_ZERO local_evolve_at_CellularAutomaton_internal_7 GOTO label_WHILE_END_274 -# IF_ZERO local_evolve_at_CellularAutomaton_internal_7 GOTO label_WHILE_END_274 -lw $t0, -32($fp) -beq $t0, 0, label_WHILE_END_274 -# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) -# LOCAL local_evolve_at_CellularAutomaton_temp_6 --> -28($fp) -# local_evolve_at_CellularAutomaton_internal_9 = local_evolve_at_CellularAutomaton_temp_6 -lw $t0, -28($fp) -sw $t0, -40($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) -# local_evolve_at_CellularAutomaton_internal_13 = SELF -sw $s1, -56($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) -# local_evolve_at_CellularAutomaton_internal_11 = local_evolve_at_CellularAutomaton_internal_13 -lw $t0, -56($fp) -sw $t0, -48($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_evolve_at_CellularAutomaton_position_0 -# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) -lw $t0, -4($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) -# local_evolve_at_CellularAutomaton_internal_12 = VCALL local_evolve_at_CellularAutomaton_internal_11 cell_at_next_evolution -# Save new self pointer in $s1 -lw $s1, -48($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 24($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -52($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_evolve_at_CellularAutomaton_internal_12 -# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) -lw $t0, -52($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) -# local_evolve_at_CellularAutomaton_internal_10 = VCALL local_evolve_at_CellularAutomaton_internal_9 concat -# Save new self pointer in $s1 -lw $s1, -40($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 68($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -44($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_evolve_at_CellularAutomaton_temp_6 --> -28($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) -# local_evolve_at_CellularAutomaton_temp_6 = local_evolve_at_CellularAutomaton_internal_10 -lw $t0, -44($fp) -sw $t0, -28($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_15 --> -64($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -64($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_14 --> -60($fp) -# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_15 --> -64($fp) -# local_evolve_at_CellularAutomaton_internal_14 = local_evolve_at_CellularAutomaton_position_0 + local_evolve_at_CellularAutomaton_internal_15 -lw $t1, -4($fp) -lw $t0, 12($t1) -lw $t1, -64($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -60($fp) -# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) -# LOCAL local_evolve_at_CellularAutomaton_internal_14 --> -60($fp) -# local_evolve_at_CellularAutomaton_position_0 = local_evolve_at_CellularAutomaton_internal_14 -lw $t0, -60($fp) -sw $t0, -4($fp) -# GOTO label_WHILE_273 -j label_WHILE_273 -label_WHILE_END_274: - # - # LOCAL local_evolve_at_CellularAutomaton_temp_6 --> -28($fp) - lw $t0, -28($fp) - sw $t0, 24($s1) - # LOCAL local_evolve_at_CellularAutomaton_internal_16 --> -68($fp) - # local_evolve_at_CellularAutomaton_internal_16 = SELF - sw $s1, -68($fp) - # RETURN local_evolve_at_CellularAutomaton_internal_16 - lw $v0, -68($fp) - # Deallocate stack frame for function function_evolve_at_CellularAutomaton. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 76 - jr $ra - # Function END - - -# function_option_at_CellularAutomaton implementation. -# @Params: -function_option_at_CellularAutomaton: - # Allocate stack frame for function function_option_at_CellularAutomaton. - subu $sp, $sp, 916 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 916 - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_3 --> -16($fp) - # local_option_at_CellularAutomaton_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_option_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_option_at_CellularAutomaton_internal_3 --> -16($fp) - # local_option_at_CellularAutomaton_internal_1 = local_option_at_CellularAutomaton_internal_3 - lw $t0, -16($fp) - sw $t0, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_34 - sw $t0, 12($v0) - li $t0, 24 - sw $t0, 16($v0) - sw $v0, -20($fp) - # ARG local_option_at_CellularAutomaton_internal_4 - # LOCAL local_option_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t0, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_option_at_CellularAutomaton_internal_2 --> -12($fp) - # local_option_at_CellularAutomaton_internal_2 = VCALL local_option_at_CellularAutomaton_internal_1 out_string - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_7 --> -32($fp) - # local_option_at_CellularAutomaton_internal_7 = SELF - sw $s1, -32($fp) - # LOCAL local_option_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_option_at_CellularAutomaton_internal_7 --> -32($fp) - # local_option_at_CellularAutomaton_internal_5 = local_option_at_CellularAutomaton_internal_7 - lw $t0, -32($fp) - sw $t0, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_35 - sw $t0, 12($v0) - li $t0, 13 - sw $t0, 16($v0) - sw $v0, -36($fp) - # ARG local_option_at_CellularAutomaton_internal_8 - # LOCAL local_option_at_CellularAutomaton_internal_8 --> -36($fp) - lw $t0, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_option_at_CellularAutomaton_internal_6 --> -28($fp) - # local_option_at_CellularAutomaton_internal_6 = VCALL local_option_at_CellularAutomaton_internal_5 out_string - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_11 --> -48($fp) - # local_option_at_CellularAutomaton_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_option_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_option_at_CellularAutomaton_internal_11 --> -48($fp) - # local_option_at_CellularAutomaton_internal_9 = local_option_at_CellularAutomaton_internal_11 - lw $t0, -48($fp) - sw $t0, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_12 --> -52($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_36 - sw $t0, 12($v0) - li $t0, 48 - sw $t0, 16($v0) - sw $v0, -52($fp) - # ARG local_option_at_CellularAutomaton_internal_12 - # LOCAL local_option_at_CellularAutomaton_internal_12 --> -52($fp) - lw $t0, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_option_at_CellularAutomaton_internal_10 --> -44($fp) - # local_option_at_CellularAutomaton_internal_10 = VCALL local_option_at_CellularAutomaton_internal_9 out_string - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_15 --> -64($fp) - # local_option_at_CellularAutomaton_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_option_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_option_at_CellularAutomaton_internal_15 --> -64($fp) - # local_option_at_CellularAutomaton_internal_13 = local_option_at_CellularAutomaton_internal_15 - lw $t0, -64($fp) - sw $t0, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_37 - sw $t0, 12($v0) - li $t0, 48 - sw $t0, 16($v0) - sw $v0, -68($fp) - # ARG local_option_at_CellularAutomaton_internal_16 - # LOCAL local_option_at_CellularAutomaton_internal_16 --> -68($fp) - lw $t0, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_option_at_CellularAutomaton_internal_14 --> -60($fp) - # local_option_at_CellularAutomaton_internal_14 = VCALL local_option_at_CellularAutomaton_internal_13 out_string - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_19 --> -80($fp) - # local_option_at_CellularAutomaton_internal_19 = SELF - sw $s1, -80($fp) - # LOCAL local_option_at_CellularAutomaton_internal_17 --> -72($fp) - # LOCAL local_option_at_CellularAutomaton_internal_19 --> -80($fp) - # local_option_at_CellularAutomaton_internal_17 = local_option_at_CellularAutomaton_internal_19 - lw $t0, -80($fp) - sw $t0, -72($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_38 - sw $t0, 12($v0) - li $t0, 10 - sw $t0, 16($v0) - sw $v0, -84($fp) - # ARG local_option_at_CellularAutomaton_internal_20 - # LOCAL local_option_at_CellularAutomaton_internal_20 --> -84($fp) - lw $t0, -84($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_17 --> -72($fp) - # LOCAL local_option_at_CellularAutomaton_internal_18 --> -76($fp) - # local_option_at_CellularAutomaton_internal_18 = VCALL local_option_at_CellularAutomaton_internal_17 out_string - # Save new self pointer in $s1 - lw $s1, -72($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -76($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_23 --> -96($fp) - # local_option_at_CellularAutomaton_internal_23 = SELF - sw $s1, -96($fp) - # LOCAL local_option_at_CellularAutomaton_internal_21 --> -88($fp) - # LOCAL local_option_at_CellularAutomaton_internal_23 --> -96($fp) - # local_option_at_CellularAutomaton_internal_21 = local_option_at_CellularAutomaton_internal_23 - lw $t0, -96($fp) - sw $t0, -88($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_24 --> -100($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_39 - sw $t0, 12($v0) - li $t0, 26 - sw $t0, 16($v0) - sw $v0, -100($fp) - # ARG local_option_at_CellularAutomaton_internal_24 - # LOCAL local_option_at_CellularAutomaton_internal_24 --> -100($fp) - lw $t0, -100($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_21 --> -88($fp) - # LOCAL local_option_at_CellularAutomaton_internal_22 --> -92($fp) - # local_option_at_CellularAutomaton_internal_22 = VCALL local_option_at_CellularAutomaton_internal_21 out_string - # Save new self pointer in $s1 - lw $s1, -88($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -92($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_27 --> -112($fp) - # local_option_at_CellularAutomaton_internal_27 = SELF - sw $s1, -112($fp) - # LOCAL local_option_at_CellularAutomaton_internal_25 --> -104($fp) - # LOCAL local_option_at_CellularAutomaton_internal_27 --> -112($fp) - # local_option_at_CellularAutomaton_internal_25 = local_option_at_CellularAutomaton_internal_27 - lw $t0, -112($fp) - sw $t0, -104($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_28 --> -116($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_40 - sw $t0, 12($v0) - li $t0, 22 - sw $t0, 16($v0) - sw $v0, -116($fp) - # ARG local_option_at_CellularAutomaton_internal_28 - # LOCAL local_option_at_CellularAutomaton_internal_28 --> -116($fp) - lw $t0, -116($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_25 --> -104($fp) - # LOCAL local_option_at_CellularAutomaton_internal_26 --> -108($fp) - # local_option_at_CellularAutomaton_internal_26 = VCALL local_option_at_CellularAutomaton_internal_25 out_string - # Save new self pointer in $s1 - lw $s1, -104($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -108($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_31 --> -128($fp) - # local_option_at_CellularAutomaton_internal_31 = SELF - sw $s1, -128($fp) - # LOCAL local_option_at_CellularAutomaton_internal_29 --> -120($fp) - # LOCAL local_option_at_CellularAutomaton_internal_31 --> -128($fp) - # local_option_at_CellularAutomaton_internal_29 = local_option_at_CellularAutomaton_internal_31 - lw $t0, -128($fp) - sw $t0, -120($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_32 --> -132($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_41 - sw $t0, 12($v0) - li $t0, 28 - sw $t0, 16($v0) - sw $v0, -132($fp) - # ARG local_option_at_CellularAutomaton_internal_32 - # LOCAL local_option_at_CellularAutomaton_internal_32 --> -132($fp) - lw $t0, -132($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_29 --> -120($fp) - # LOCAL local_option_at_CellularAutomaton_internal_30 --> -124($fp) - # local_option_at_CellularAutomaton_internal_30 = VCALL local_option_at_CellularAutomaton_internal_29 out_string - # Save new self pointer in $s1 - lw $s1, -120($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -124($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_35 --> -144($fp) - # local_option_at_CellularAutomaton_internal_35 = SELF - sw $s1, -144($fp) - # LOCAL local_option_at_CellularAutomaton_internal_33 --> -136($fp) - # LOCAL local_option_at_CellularAutomaton_internal_35 --> -144($fp) - # local_option_at_CellularAutomaton_internal_33 = local_option_at_CellularAutomaton_internal_35 - lw $t0, -144($fp) - sw $t0, -136($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_36 --> -148($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_42 - sw $t0, 12($v0) - li $t0, 25 - sw $t0, 16($v0) - sw $v0, -148($fp) - # ARG local_option_at_CellularAutomaton_internal_36 - # LOCAL local_option_at_CellularAutomaton_internal_36 --> -148($fp) - lw $t0, -148($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_33 --> -136($fp) - # LOCAL local_option_at_CellularAutomaton_internal_34 --> -140($fp) - # local_option_at_CellularAutomaton_internal_34 = VCALL local_option_at_CellularAutomaton_internal_33 out_string - # Save new self pointer in $s1 - lw $s1, -136($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -140($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_39 --> -160($fp) - # local_option_at_CellularAutomaton_internal_39 = SELF - sw $s1, -160($fp) - # LOCAL local_option_at_CellularAutomaton_internal_37 --> -152($fp) - # LOCAL local_option_at_CellularAutomaton_internal_39 --> -160($fp) - # local_option_at_CellularAutomaton_internal_37 = local_option_at_CellularAutomaton_internal_39 - lw $t0, -160($fp) - sw $t0, -152($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_40 --> -164($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_43 - sw $t0, 12($v0) - li $t0, 11 - sw $t0, 16($v0) - sw $v0, -164($fp) - # ARG local_option_at_CellularAutomaton_internal_40 - # LOCAL local_option_at_CellularAutomaton_internal_40 --> -164($fp) - lw $t0, -164($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_37 --> -152($fp) - # LOCAL local_option_at_CellularAutomaton_internal_38 --> -156($fp) - # local_option_at_CellularAutomaton_internal_38 = VCALL local_option_at_CellularAutomaton_internal_37 out_string - # Save new self pointer in $s1 - lw $s1, -152($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -156($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_43 --> -176($fp) - # local_option_at_CellularAutomaton_internal_43 = SELF - sw $s1, -176($fp) - # LOCAL local_option_at_CellularAutomaton_internal_41 --> -168($fp) - # LOCAL local_option_at_CellularAutomaton_internal_43 --> -176($fp) - # local_option_at_CellularAutomaton_internal_41 = local_option_at_CellularAutomaton_internal_43 - lw $t0, -176($fp) - sw $t0, -168($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_44 --> -180($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_44 - sw $t0, 12($v0) - li $t0, 21 - sw $t0, 16($v0) - sw $v0, -180($fp) - # ARG local_option_at_CellularAutomaton_internal_44 - # LOCAL local_option_at_CellularAutomaton_internal_44 --> -180($fp) - lw $t0, -180($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_41 --> -168($fp) - # LOCAL local_option_at_CellularAutomaton_internal_42 --> -172($fp) - # local_option_at_CellularAutomaton_internal_42 = VCALL local_option_at_CellularAutomaton_internal_41 out_string - # Save new self pointer in $s1 - lw $s1, -168($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -172($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_47 --> -192($fp) - # local_option_at_CellularAutomaton_internal_47 = SELF - sw $s1, -192($fp) - # LOCAL local_option_at_CellularAutomaton_internal_45 --> -184($fp) - # LOCAL local_option_at_CellularAutomaton_internal_47 --> -192($fp) - # local_option_at_CellularAutomaton_internal_45 = local_option_at_CellularAutomaton_internal_47 - lw $t0, -192($fp) - sw $t0, -184($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_48 --> -196($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_45 - sw $t0, 12($v0) - li $t0, 32 - sw $t0, 16($v0) - sw $v0, -196($fp) - # ARG local_option_at_CellularAutomaton_internal_48 - # LOCAL local_option_at_CellularAutomaton_internal_48 --> -196($fp) - lw $t0, -196($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_45 --> -184($fp) - # LOCAL local_option_at_CellularAutomaton_internal_46 --> -188($fp) - # local_option_at_CellularAutomaton_internal_46 = VCALL local_option_at_CellularAutomaton_internal_45 out_string - # Save new self pointer in $s1 - lw $s1, -184($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -188($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_51 --> -208($fp) - # local_option_at_CellularAutomaton_internal_51 = SELF - sw $s1, -208($fp) - # LOCAL local_option_at_CellularAutomaton_internal_49 --> -200($fp) - # LOCAL local_option_at_CellularAutomaton_internal_51 --> -208($fp) - # local_option_at_CellularAutomaton_internal_49 = local_option_at_CellularAutomaton_internal_51 - lw $t0, -208($fp) - sw $t0, -200($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_52 --> -212($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_46 - sw $t0, 12($v0) - li $t0, 18 - sw $t0, 16($v0) - sw $v0, -212($fp) - # ARG local_option_at_CellularAutomaton_internal_52 - # LOCAL local_option_at_CellularAutomaton_internal_52 --> -212($fp) - lw $t0, -212($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_49 --> -200($fp) - # LOCAL local_option_at_CellularAutomaton_internal_50 --> -204($fp) - # local_option_at_CellularAutomaton_internal_50 = VCALL local_option_at_CellularAutomaton_internal_49 out_string - # Save new self pointer in $s1 - lw $s1, -200($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -204($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_55 --> -224($fp) - # local_option_at_CellularAutomaton_internal_55 = SELF - sw $s1, -224($fp) - # LOCAL local_option_at_CellularAutomaton_internal_53 --> -216($fp) - # LOCAL local_option_at_CellularAutomaton_internal_55 --> -224($fp) - # local_option_at_CellularAutomaton_internal_53 = local_option_at_CellularAutomaton_internal_55 - lw $t0, -224($fp) - sw $t0, -216($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_56 --> -228($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_47 - sw $t0, 12($v0) - li $t0, 12 - sw $t0, 16($v0) - sw $v0, -228($fp) - # ARG local_option_at_CellularAutomaton_internal_56 - # LOCAL local_option_at_CellularAutomaton_internal_56 --> -228($fp) - lw $t0, -228($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_53 --> -216($fp) - # LOCAL local_option_at_CellularAutomaton_internal_54 --> -220($fp) - # local_option_at_CellularAutomaton_internal_54 = VCALL local_option_at_CellularAutomaton_internal_53 out_string - # Save new self pointer in $s1 - lw $s1, -216($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -220($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_59 --> -240($fp) - # local_option_at_CellularAutomaton_internal_59 = SELF - sw $s1, -240($fp) - # LOCAL local_option_at_CellularAutomaton_internal_57 --> -232($fp) - # LOCAL local_option_at_CellularAutomaton_internal_59 --> -240($fp) - # local_option_at_CellularAutomaton_internal_57 = local_option_at_CellularAutomaton_internal_59 - lw $t0, -240($fp) - sw $t0, -232($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_60 --> -244($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_48 - sw $t0, 12($v0) - li $t0, 17 - sw $t0, 16($v0) - sw $v0, -244($fp) - # ARG local_option_at_CellularAutomaton_internal_60 - # LOCAL local_option_at_CellularAutomaton_internal_60 --> -244($fp) - lw $t0, -244($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_57 --> -232($fp) - # LOCAL local_option_at_CellularAutomaton_internal_58 --> -236($fp) - # local_option_at_CellularAutomaton_internal_58 = VCALL local_option_at_CellularAutomaton_internal_57 out_string - # Save new self pointer in $s1 - lw $s1, -232($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -236($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_63 --> -256($fp) - # local_option_at_CellularAutomaton_internal_63 = SELF - sw $s1, -256($fp) - # LOCAL local_option_at_CellularAutomaton_internal_61 --> -248($fp) - # LOCAL local_option_at_CellularAutomaton_internal_63 --> -256($fp) - # local_option_at_CellularAutomaton_internal_61 = local_option_at_CellularAutomaton_internal_63 - lw $t0, -256($fp) - sw $t0, -248($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_64 --> -260($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_49 - sw $t0, 12($v0) - li $t0, 12 - sw $t0, 16($v0) - sw $v0, -260($fp) - # ARG local_option_at_CellularAutomaton_internal_64 - # LOCAL local_option_at_CellularAutomaton_internal_64 --> -260($fp) - lw $t0, -260($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_61 --> -248($fp) - # LOCAL local_option_at_CellularAutomaton_internal_62 --> -252($fp) - # local_option_at_CellularAutomaton_internal_62 = VCALL local_option_at_CellularAutomaton_internal_61 out_string - # Save new self pointer in $s1 - lw $s1, -248($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -252($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_67 --> -272($fp) - # local_option_at_CellularAutomaton_internal_67 = SELF - sw $s1, -272($fp) - # LOCAL local_option_at_CellularAutomaton_internal_65 --> -264($fp) - # LOCAL local_option_at_CellularAutomaton_internal_67 --> -272($fp) - # local_option_at_CellularAutomaton_internal_65 = local_option_at_CellularAutomaton_internal_67 - lw $t0, -272($fp) - sw $t0, -264($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_68 --> -276($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_50 - sw $t0, 12($v0) - li $t0, 13 - sw $t0, 16($v0) - sw $v0, -276($fp) - # ARG local_option_at_CellularAutomaton_internal_68 - # LOCAL local_option_at_CellularAutomaton_internal_68 --> -276($fp) - lw $t0, -276($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_65 --> -264($fp) - # LOCAL local_option_at_CellularAutomaton_internal_66 --> -268($fp) - # local_option_at_CellularAutomaton_internal_66 = VCALL local_option_at_CellularAutomaton_internal_65 out_string - # Save new self pointer in $s1 - lw $s1, -264($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -268($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_71 --> -288($fp) - # local_option_at_CellularAutomaton_internal_71 = SELF - sw $s1, -288($fp) - # LOCAL local_option_at_CellularAutomaton_internal_69 --> -280($fp) - # LOCAL local_option_at_CellularAutomaton_internal_71 --> -288($fp) - # local_option_at_CellularAutomaton_internal_69 = local_option_at_CellularAutomaton_internal_71 - lw $t0, -288($fp) - sw $t0, -280($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_72 --> -292($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_51 - sw $t0, 12($v0) - li $t0, 13 - sw $t0, 16($v0) - sw $v0, -292($fp) - # ARG local_option_at_CellularAutomaton_internal_72 - # LOCAL local_option_at_CellularAutomaton_internal_72 --> -292($fp) - lw $t0, -292($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_69 --> -280($fp) - # LOCAL local_option_at_CellularAutomaton_internal_70 --> -284($fp) - # local_option_at_CellularAutomaton_internal_70 = VCALL local_option_at_CellularAutomaton_internal_69 out_string - # Save new self pointer in $s1 - lw $s1, -280($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -284($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_75 --> -304($fp) - # local_option_at_CellularAutomaton_internal_75 = SELF - sw $s1, -304($fp) - # LOCAL local_option_at_CellularAutomaton_internal_73 --> -296($fp) - # LOCAL local_option_at_CellularAutomaton_internal_75 --> -304($fp) - # local_option_at_CellularAutomaton_internal_73 = local_option_at_CellularAutomaton_internal_75 - lw $t0, -304($fp) - sw $t0, -296($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_76 --> -308($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_52 - sw $t0, 12($v0) - li $t0, 12 - sw $t0, 16($v0) - sw $v0, -308($fp) - # ARG local_option_at_CellularAutomaton_internal_76 - # LOCAL local_option_at_CellularAutomaton_internal_76 --> -308($fp) - lw $t0, -308($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_73 --> -296($fp) - # LOCAL local_option_at_CellularAutomaton_internal_74 --> -300($fp) - # local_option_at_CellularAutomaton_internal_74 = VCALL local_option_at_CellularAutomaton_internal_73 out_string - # Save new self pointer in $s1 - lw $s1, -296($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -300($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_79 --> -320($fp) - # local_option_at_CellularAutomaton_internal_79 = SELF - sw $s1, -320($fp) - # LOCAL local_option_at_CellularAutomaton_internal_77 --> -312($fp) - # LOCAL local_option_at_CellularAutomaton_internal_79 --> -320($fp) - # local_option_at_CellularAutomaton_internal_77 = local_option_at_CellularAutomaton_internal_79 - lw $t0, -320($fp) - sw $t0, -312($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_80 --> -324($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_53 - sw $t0, 12($v0) - li $t0, 13 - sw $t0, 16($v0) - sw $v0, -324($fp) - # ARG local_option_at_CellularAutomaton_internal_80 - # LOCAL local_option_at_CellularAutomaton_internal_80 --> -324($fp) - lw $t0, -324($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_77 --> -312($fp) - # LOCAL local_option_at_CellularAutomaton_internal_78 --> -316($fp) - # local_option_at_CellularAutomaton_internal_78 = VCALL local_option_at_CellularAutomaton_internal_77 out_string - # Save new self pointer in $s1 - lw $s1, -312($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -316($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_83 --> -336($fp) - # local_option_at_CellularAutomaton_internal_83 = SELF - sw $s1, -336($fp) - # LOCAL local_option_at_CellularAutomaton_internal_81 --> -328($fp) - # LOCAL local_option_at_CellularAutomaton_internal_83 --> -336($fp) - # local_option_at_CellularAutomaton_internal_81 = local_option_at_CellularAutomaton_internal_83 - lw $t0, -336($fp) - sw $t0, -328($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_84 --> -340($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_54 - sw $t0, 12($v0) - li $t0, 13 - sw $t0, 16($v0) - sw $v0, -340($fp) - # ARG local_option_at_CellularAutomaton_internal_84 - # LOCAL local_option_at_CellularAutomaton_internal_84 --> -340($fp) - lw $t0, -340($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_81 --> -328($fp) - # LOCAL local_option_at_CellularAutomaton_internal_82 --> -332($fp) - # local_option_at_CellularAutomaton_internal_82 = VCALL local_option_at_CellularAutomaton_internal_81 out_string - # Save new self pointer in $s1 - lw $s1, -328($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -332($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_87 --> -352($fp) - # local_option_at_CellularAutomaton_internal_87 = SELF - sw $s1, -352($fp) - # LOCAL local_option_at_CellularAutomaton_internal_85 --> -344($fp) - # LOCAL local_option_at_CellularAutomaton_internal_87 --> -352($fp) - # local_option_at_CellularAutomaton_internal_85 = local_option_at_CellularAutomaton_internal_87 - lw $t0, -352($fp) - sw $t0, -344($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_88 --> -356($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_55 - sw $t0, 12($v0) - li $t0, 13 - sw $t0, 16($v0) - sw $v0, -356($fp) - # ARG local_option_at_CellularAutomaton_internal_88 - # LOCAL local_option_at_CellularAutomaton_internal_88 --> -356($fp) - lw $t0, -356($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_85 --> -344($fp) - # LOCAL local_option_at_CellularAutomaton_internal_86 --> -348($fp) - # local_option_at_CellularAutomaton_internal_86 = VCALL local_option_at_CellularAutomaton_internal_85 out_string - # Save new self pointer in $s1 - lw $s1, -344($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -348($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_91 --> -368($fp) - # local_option_at_CellularAutomaton_internal_91 = SELF - sw $s1, -368($fp) - # LOCAL local_option_at_CellularAutomaton_internal_89 --> -360($fp) - # LOCAL local_option_at_CellularAutomaton_internal_91 --> -368($fp) - # local_option_at_CellularAutomaton_internal_89 = local_option_at_CellularAutomaton_internal_91 - lw $t0, -368($fp) - sw $t0, -360($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_92 --> -372($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_56 - sw $t0, 12($v0) - li $t0, 15 - sw $t0, 16($v0) - sw $v0, -372($fp) - # ARG local_option_at_CellularAutomaton_internal_92 - # LOCAL local_option_at_CellularAutomaton_internal_92 --> -372($fp) - lw $t0, -372($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_89 --> -360($fp) - # LOCAL local_option_at_CellularAutomaton_internal_90 --> -364($fp) - # local_option_at_CellularAutomaton_internal_90 = VCALL local_option_at_CellularAutomaton_internal_89 out_string - # Save new self pointer in $s1 - lw $s1, -360($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -364($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_95 --> -384($fp) - # local_option_at_CellularAutomaton_internal_95 = SELF - sw $s1, -384($fp) - # LOCAL local_option_at_CellularAutomaton_internal_93 --> -376($fp) - # LOCAL local_option_at_CellularAutomaton_internal_95 --> -384($fp) - # local_option_at_CellularAutomaton_internal_93 = local_option_at_CellularAutomaton_internal_95 - lw $t0, -384($fp) - sw $t0, -376($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_93 --> -376($fp) - # LOCAL local_option_at_CellularAutomaton_internal_94 --> -380($fp) - # local_option_at_CellularAutomaton_internal_94 = VCALL local_option_at_CellularAutomaton_internal_93 in_int - # Save new self pointer in $s1 - lw $s1, -376($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -380($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_94 --> -380($fp) - # local_option_at_CellularAutomaton_num_0 = local_option_at_CellularAutomaton_internal_94 - lw $t0, -380($fp) - sw $t0, -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_98 --> -396($fp) - # local_option_at_CellularAutomaton_internal_98 = SELF - sw $s1, -396($fp) - # LOCAL local_option_at_CellularAutomaton_internal_96 --> -388($fp) - # LOCAL local_option_at_CellularAutomaton_internal_98 --> -396($fp) - # local_option_at_CellularAutomaton_internal_96 = local_option_at_CellularAutomaton_internal_98 - lw $t0, -396($fp) - sw $t0, -388($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_99 --> -400($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_57 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -400($fp) - # ARG local_option_at_CellularAutomaton_internal_99 - # LOCAL local_option_at_CellularAutomaton_internal_99 --> -400($fp) - lw $t0, -400($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_option_at_CellularAutomaton_internal_96 --> -388($fp) - # LOCAL local_option_at_CellularAutomaton_internal_97 --> -392($fp) - # local_option_at_CellularAutomaton_internal_97 = VCALL local_option_at_CellularAutomaton_internal_96 out_string - # Save new self pointer in $s1 - lw $s1, -388($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -392($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -420($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_279 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_279 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_279 - # IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_FALSE_279 - # IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_FALSE_279 - lw $t0, -420($fp) - beq $t0, 0, label_FALSE_279 - # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -416($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_COMPARE_STRING_282 - # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_COMPARE_STRING_282 - lw $t0, -416($fp) - beq $t0, 0, label_COMPARE_STRING_282 - # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -416($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_COMPARE_BY_VALUE_283 - # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_COMPARE_BY_VALUE_283 - lw $t0, -416($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_283 - # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -416($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_COMPARE_BY_VALUE_283 - # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_COMPARE_BY_VALUE_283 - lw $t0, -416($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_283 - # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -420($fp) - sub $a0, $a0, $a1 - sw $a0, -416($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_TRUE_280 - # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_TRUE_280 - lw $t0, -416($fp) - beq $t0, 0, label_TRUE_280 - # GOTO label_FALSE_279 - j label_FALSE_279 - label_COMPARE_BY_VALUE_283: - # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) - lw $a0, -4($fp) - lw $a1, -420($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -416($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_TRUE_280 - # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_TRUE_280 - lw $t0, -416($fp) - beq $t0, 0, label_TRUE_280 - # GOTO label_FALSE_279 - j label_FALSE_279 - label_COMPARE_STRING_282: - # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -420($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -416($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_CONTINUE_284 - # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_CONTINUE_284 - lw $t0, -416($fp) - beq $t0, 0, label_CONTINUE_284 - # GOTO label_FALSE_279 - j label_FALSE_279 - label_CONTINUE_284: - # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -420($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_285: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_286 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_285 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_286: - # Store result - sw $a2, -416($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_TRUE_280 - # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_TRUE_280 - lw $t0, -416($fp) - beq $t0, 0, label_TRUE_280 - label_FALSE_279: - # LOCAL local_option_at_CellularAutomaton_internal_102 --> -412($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -412($fp) - # GOTO label_END_281 -j label_END_281 -label_TRUE_280: - # LOCAL local_option_at_CellularAutomaton_internal_102 --> -412($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -412($fp) - label_END_281: -# LOCAL local_option_at_CellularAutomaton_internal_100 --> -404($fp) -# LOCAL local_option_at_CellularAutomaton_internal_102 --> -412($fp) -# Obtain value from -412($fp) -lw $v0, -412($fp) -lw $v0, 12($v0) -sw $v0, -404($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_100 GOTO label_FALSEIF_277 -# IF_ZERO local_option_at_CellularAutomaton_internal_100 GOTO label_FALSEIF_277 -lw $t0, -404($fp) -beq $t0, 0, label_FALSEIF_277 -# LOCAL local_option_at_CellularAutomaton_internal_105 --> -424($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_58 -sw $t0, 12($v0) -li $t0, 20 -sw $t0, 16($v0) -sw $v0, -424($fp) -# LOCAL local_option_at_CellularAutomaton_internal_101 --> -408($fp) -# LOCAL local_option_at_CellularAutomaton_internal_105 --> -424($fp) -# local_option_at_CellularAutomaton_internal_101 = local_option_at_CellularAutomaton_internal_105 -lw $t0, -424($fp) -sw $t0, -408($fp) -# GOTO label_ENDIF_278 -j label_ENDIF_278 -label_FALSEIF_277: - # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 2 - sw $t0, 12($v0) - sw $v0, -444($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_289 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_289 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_289 - # IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_FALSE_289 - # IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_FALSE_289 - lw $t0, -444($fp) - beq $t0, 0, label_FALSE_289 - # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -440($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_COMPARE_STRING_292 - # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_COMPARE_STRING_292 - lw $t0, -440($fp) - beq $t0, 0, label_COMPARE_STRING_292 - # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -440($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_COMPARE_BY_VALUE_293 - # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_COMPARE_BY_VALUE_293 - lw $t0, -440($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_293 - # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -440($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_COMPARE_BY_VALUE_293 - # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_COMPARE_BY_VALUE_293 - lw $t0, -440($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_293 - # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -444($fp) - sub $a0, $a0, $a1 - sw $a0, -440($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_TRUE_290 - # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_TRUE_290 - lw $t0, -440($fp) - beq $t0, 0, label_TRUE_290 - # GOTO label_FALSE_289 - j label_FALSE_289 - label_COMPARE_BY_VALUE_293: - # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) - lw $a0, -4($fp) - lw $a1, -444($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -440($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_TRUE_290 - # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_TRUE_290 - lw $t0, -440($fp) - beq $t0, 0, label_TRUE_290 - # GOTO label_FALSE_289 - j label_FALSE_289 - label_COMPARE_STRING_292: - # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -444($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -440($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_CONTINUE_294 - # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_CONTINUE_294 - lw $t0, -440($fp) - beq $t0, 0, label_CONTINUE_294 - # GOTO label_FALSE_289 - j label_FALSE_289 - label_CONTINUE_294: - # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -444($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_295: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_296 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_295 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_296: - # Store result - sw $a2, -440($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_TRUE_290 - # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_TRUE_290 - lw $t0, -440($fp) - beq $t0, 0, label_TRUE_290 - label_FALSE_289: - # LOCAL local_option_at_CellularAutomaton_internal_108 --> -436($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -436($fp) - # GOTO label_END_291 -j label_END_291 -label_TRUE_290: - # LOCAL local_option_at_CellularAutomaton_internal_108 --> -436($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -436($fp) - label_END_291: -# LOCAL local_option_at_CellularAutomaton_internal_106 --> -428($fp) -# LOCAL local_option_at_CellularAutomaton_internal_108 --> -436($fp) -# Obtain value from -436($fp) -lw $v0, -436($fp) -lw $v0, 12($v0) -sw $v0, -428($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_106 GOTO label_FALSEIF_287 -# IF_ZERO local_option_at_CellularAutomaton_internal_106 GOTO label_FALSEIF_287 -lw $t0, -428($fp) -beq $t0, 0, label_FALSEIF_287 -# LOCAL local_option_at_CellularAutomaton_internal_111 --> -448($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_59 -sw $t0, 12($v0) -li $t0, 25 -sw $t0, 16($v0) -sw $v0, -448($fp) -# LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) -# LOCAL local_option_at_CellularAutomaton_internal_111 --> -448($fp) -# local_option_at_CellularAutomaton_internal_107 = local_option_at_CellularAutomaton_internal_111 -lw $t0, -448($fp) -sw $t0, -432($fp) -# GOTO label_ENDIF_288 -j label_ENDIF_288 -label_FALSEIF_287: - # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 3 - sw $t0, 12($v0) - sw $v0, -468($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_299 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_299 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_299 - # IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_FALSE_299 - # IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_FALSE_299 - lw $t0, -468($fp) - beq $t0, 0, label_FALSE_299 - # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -464($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_COMPARE_STRING_302 - # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_COMPARE_STRING_302 - lw $t0, -464($fp) - beq $t0, 0, label_COMPARE_STRING_302 - # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -464($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_COMPARE_BY_VALUE_303 - # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_COMPARE_BY_VALUE_303 - lw $t0, -464($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_303 - # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -464($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_COMPARE_BY_VALUE_303 - # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_COMPARE_BY_VALUE_303 - lw $t0, -464($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_303 - # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -468($fp) - sub $a0, $a0, $a1 - sw $a0, -464($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_TRUE_300 - # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_TRUE_300 - lw $t0, -464($fp) - beq $t0, 0, label_TRUE_300 - # GOTO label_FALSE_299 - j label_FALSE_299 - label_COMPARE_BY_VALUE_303: - # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) - lw $a0, -4($fp) - lw $a1, -468($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -464($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_TRUE_300 - # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_TRUE_300 - lw $t0, -464($fp) - beq $t0, 0, label_TRUE_300 - # GOTO label_FALSE_299 - j label_FALSE_299 - label_COMPARE_STRING_302: - # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -468($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -464($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_CONTINUE_304 - # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_CONTINUE_304 - lw $t0, -464($fp) - beq $t0, 0, label_CONTINUE_304 - # GOTO label_FALSE_299 - j label_FALSE_299 - label_CONTINUE_304: - # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -468($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_305: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_306 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_305 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_306: - # Store result - sw $a2, -464($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_TRUE_300 - # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_TRUE_300 - lw $t0, -464($fp) - beq $t0, 0, label_TRUE_300 - label_FALSE_299: - # LOCAL local_option_at_CellularAutomaton_internal_114 --> -460($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -460($fp) - # GOTO label_END_301 -j label_END_301 -label_TRUE_300: - # LOCAL local_option_at_CellularAutomaton_internal_114 --> -460($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -460($fp) - label_END_301: -# LOCAL local_option_at_CellularAutomaton_internal_112 --> -452($fp) -# LOCAL local_option_at_CellularAutomaton_internal_114 --> -460($fp) -# Obtain value from -460($fp) -lw $v0, -460($fp) -lw $v0, 12($v0) -sw $v0, -452($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_112 GOTO label_FALSEIF_297 -# IF_ZERO local_option_at_CellularAutomaton_internal_112 GOTO label_FALSEIF_297 -lw $t0, -452($fp) -beq $t0, 0, label_FALSEIF_297 -# LOCAL local_option_at_CellularAutomaton_internal_117 --> -472($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_60 -sw $t0, 12($v0) -li $t0, 25 -sw $t0, 16($v0) -sw $v0, -472($fp) -# LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) -# LOCAL local_option_at_CellularAutomaton_internal_117 --> -472($fp) -# local_option_at_CellularAutomaton_internal_113 = local_option_at_CellularAutomaton_internal_117 -lw $t0, -472($fp) -sw $t0, -456($fp) -# GOTO label_ENDIF_298 -j label_ENDIF_298 -label_FALSEIF_297: - # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 4 - sw $t0, 12($v0) - sw $v0, -492($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_309 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_309 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_309 - # IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_FALSE_309 - # IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_FALSE_309 - lw $t0, -492($fp) - beq $t0, 0, label_FALSE_309 - # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -488($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_COMPARE_STRING_312 - # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_COMPARE_STRING_312 - lw $t0, -488($fp) - beq $t0, 0, label_COMPARE_STRING_312 - # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -488($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_COMPARE_BY_VALUE_313 - # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_COMPARE_BY_VALUE_313 - lw $t0, -488($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_313 - # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -488($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_COMPARE_BY_VALUE_313 - # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_COMPARE_BY_VALUE_313 - lw $t0, -488($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_313 - # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -492($fp) - sub $a0, $a0, $a1 - sw $a0, -488($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_TRUE_310 - # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_TRUE_310 - lw $t0, -488($fp) - beq $t0, 0, label_TRUE_310 - # GOTO label_FALSE_309 - j label_FALSE_309 - label_COMPARE_BY_VALUE_313: - # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) - lw $a0, -4($fp) - lw $a1, -492($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -488($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_TRUE_310 - # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_TRUE_310 - lw $t0, -488($fp) - beq $t0, 0, label_TRUE_310 - # GOTO label_FALSE_309 - j label_FALSE_309 - label_COMPARE_STRING_312: - # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -492($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -488($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_CONTINUE_314 - # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_CONTINUE_314 - lw $t0, -488($fp) - beq $t0, 0, label_CONTINUE_314 - # GOTO label_FALSE_309 - j label_FALSE_309 - label_CONTINUE_314: - # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -492($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_315: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_316 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_315 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_316: - # Store result - sw $a2, -488($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_TRUE_310 - # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_TRUE_310 - lw $t0, -488($fp) - beq $t0, 0, label_TRUE_310 - label_FALSE_309: - # LOCAL local_option_at_CellularAutomaton_internal_120 --> -484($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -484($fp) - # GOTO label_END_311 -j label_END_311 -label_TRUE_310: - # LOCAL local_option_at_CellularAutomaton_internal_120 --> -484($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -484($fp) - label_END_311: -# LOCAL local_option_at_CellularAutomaton_internal_118 --> -476($fp) -# LOCAL local_option_at_CellularAutomaton_internal_120 --> -484($fp) -# Obtain value from -484($fp) -lw $v0, -484($fp) -lw $v0, 12($v0) -sw $v0, -476($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_118 GOTO label_FALSEIF_307 -# IF_ZERO local_option_at_CellularAutomaton_internal_118 GOTO label_FALSEIF_307 -lw $t0, -476($fp) -beq $t0, 0, label_FALSEIF_307 -# LOCAL local_option_at_CellularAutomaton_internal_123 --> -496($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_61 -sw $t0, 12($v0) -li $t0, 25 -sw $t0, 16($v0) -sw $v0, -496($fp) -# LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) -# LOCAL local_option_at_CellularAutomaton_internal_123 --> -496($fp) -# local_option_at_CellularAutomaton_internal_119 = local_option_at_CellularAutomaton_internal_123 -lw $t0, -496($fp) -sw $t0, -480($fp) -# GOTO label_ENDIF_308 -j label_ENDIF_308 -label_FALSEIF_307: - # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 5 - sw $t0, 12($v0) - sw $v0, -516($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_319 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_319 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_319 - # IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_FALSE_319 - # IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_FALSE_319 - lw $t0, -516($fp) - beq $t0, 0, label_FALSE_319 - # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -512($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_COMPARE_STRING_322 - # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_COMPARE_STRING_322 - lw $t0, -512($fp) - beq $t0, 0, label_COMPARE_STRING_322 - # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -512($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_COMPARE_BY_VALUE_323 - # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_COMPARE_BY_VALUE_323 - lw $t0, -512($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_323 - # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -512($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_COMPARE_BY_VALUE_323 - # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_COMPARE_BY_VALUE_323 - lw $t0, -512($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_323 - # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -516($fp) - sub $a0, $a0, $a1 - sw $a0, -512($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_TRUE_320 - # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_TRUE_320 - lw $t0, -512($fp) - beq $t0, 0, label_TRUE_320 - # GOTO label_FALSE_319 - j label_FALSE_319 - label_COMPARE_BY_VALUE_323: - # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) - lw $a0, -4($fp) - lw $a1, -516($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -512($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_TRUE_320 - # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_TRUE_320 - lw $t0, -512($fp) - beq $t0, 0, label_TRUE_320 - # GOTO label_FALSE_319 - j label_FALSE_319 - label_COMPARE_STRING_322: - # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -516($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -512($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_CONTINUE_324 - # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_CONTINUE_324 - lw $t0, -512($fp) - beq $t0, 0, label_CONTINUE_324 - # GOTO label_FALSE_319 - j label_FALSE_319 - label_CONTINUE_324: - # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -516($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_325: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_326 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_325 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_326: - # Store result - sw $a2, -512($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_TRUE_320 - # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_TRUE_320 - lw $t0, -512($fp) - beq $t0, 0, label_TRUE_320 - label_FALSE_319: - # LOCAL local_option_at_CellularAutomaton_internal_126 --> -508($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -508($fp) - # GOTO label_END_321 -j label_END_321 -label_TRUE_320: - # LOCAL local_option_at_CellularAutomaton_internal_126 --> -508($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -508($fp) - label_END_321: -# LOCAL local_option_at_CellularAutomaton_internal_124 --> -500($fp) -# LOCAL local_option_at_CellularAutomaton_internal_126 --> -508($fp) -# Obtain value from -508($fp) -lw $v0, -508($fp) -lw $v0, 12($v0) -sw $v0, -500($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_124 GOTO label_FALSEIF_317 -# IF_ZERO local_option_at_CellularAutomaton_internal_124 GOTO label_FALSEIF_317 -lw $t0, -500($fp) -beq $t0, 0, label_FALSEIF_317 -# LOCAL local_option_at_CellularAutomaton_internal_129 --> -520($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_62 -sw $t0, 12($v0) -li $t0, 25 -sw $t0, 16($v0) -sw $v0, -520($fp) -# LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) -# LOCAL local_option_at_CellularAutomaton_internal_129 --> -520($fp) -# local_option_at_CellularAutomaton_internal_125 = local_option_at_CellularAutomaton_internal_129 -lw $t0, -520($fp) -sw $t0, -504($fp) -# GOTO label_ENDIF_318 -j label_ENDIF_318 -label_FALSEIF_317: - # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 6 - sw $t0, 12($v0) - sw $v0, -540($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_329 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_329 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_329 - # IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_FALSE_329 - # IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_FALSE_329 - lw $t0, -540($fp) - beq $t0, 0, label_FALSE_329 - # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -536($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_COMPARE_STRING_332 - # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_COMPARE_STRING_332 - lw $t0, -536($fp) - beq $t0, 0, label_COMPARE_STRING_332 - # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -536($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_COMPARE_BY_VALUE_333 - # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_COMPARE_BY_VALUE_333 - lw $t0, -536($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_333 - # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -536($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_COMPARE_BY_VALUE_333 - # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_COMPARE_BY_VALUE_333 - lw $t0, -536($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_333 - # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -540($fp) - sub $a0, $a0, $a1 - sw $a0, -536($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_TRUE_330 - # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_TRUE_330 - lw $t0, -536($fp) - beq $t0, 0, label_TRUE_330 - # GOTO label_FALSE_329 - j label_FALSE_329 - label_COMPARE_BY_VALUE_333: - # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) - lw $a0, -4($fp) - lw $a1, -540($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -536($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_TRUE_330 - # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_TRUE_330 - lw $t0, -536($fp) - beq $t0, 0, label_TRUE_330 - # GOTO label_FALSE_329 - j label_FALSE_329 - label_COMPARE_STRING_332: - # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -540($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -536($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_CONTINUE_334 - # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_CONTINUE_334 - lw $t0, -536($fp) - beq $t0, 0, label_CONTINUE_334 - # GOTO label_FALSE_329 - j label_FALSE_329 - label_CONTINUE_334: - # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -540($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_335: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_336 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_335 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_336: - # Store result - sw $a2, -536($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_TRUE_330 - # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_TRUE_330 - lw $t0, -536($fp) - beq $t0, 0, label_TRUE_330 - label_FALSE_329: - # LOCAL local_option_at_CellularAutomaton_internal_132 --> -532($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -532($fp) - # GOTO label_END_331 -j label_END_331 -label_TRUE_330: - # LOCAL local_option_at_CellularAutomaton_internal_132 --> -532($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -532($fp) - label_END_331: -# LOCAL local_option_at_CellularAutomaton_internal_130 --> -524($fp) -# LOCAL local_option_at_CellularAutomaton_internal_132 --> -532($fp) -# Obtain value from -532($fp) -lw $v0, -532($fp) -lw $v0, 12($v0) -sw $v0, -524($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_130 GOTO label_FALSEIF_327 -# IF_ZERO local_option_at_CellularAutomaton_internal_130 GOTO label_FALSEIF_327 -lw $t0, -524($fp) -beq $t0, 0, label_FALSEIF_327 -# LOCAL local_option_at_CellularAutomaton_internal_135 --> -544($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_63 -sw $t0, 12($v0) -li $t0, 25 -sw $t0, 16($v0) -sw $v0, -544($fp) -# LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) -# LOCAL local_option_at_CellularAutomaton_internal_135 --> -544($fp) -# local_option_at_CellularAutomaton_internal_131 = local_option_at_CellularAutomaton_internal_135 -lw $t0, -544($fp) -sw $t0, -528($fp) -# GOTO label_ENDIF_328 -j label_ENDIF_328 -label_FALSEIF_327: - # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 7 - sw $t0, 12($v0) - sw $v0, -564($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_339 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_339 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_339 - # IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_FALSE_339 - # IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_FALSE_339 - lw $t0, -564($fp) - beq $t0, 0, label_FALSE_339 - # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -560($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_COMPARE_STRING_342 - # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_COMPARE_STRING_342 - lw $t0, -560($fp) - beq $t0, 0, label_COMPARE_STRING_342 - # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -560($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_COMPARE_BY_VALUE_343 - # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_COMPARE_BY_VALUE_343 - lw $t0, -560($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_343 - # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -560($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_COMPARE_BY_VALUE_343 - # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_COMPARE_BY_VALUE_343 - lw $t0, -560($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_343 - # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -564($fp) - sub $a0, $a0, $a1 - sw $a0, -560($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_TRUE_340 - # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_TRUE_340 - lw $t0, -560($fp) - beq $t0, 0, label_TRUE_340 - # GOTO label_FALSE_339 - j label_FALSE_339 - label_COMPARE_BY_VALUE_343: - # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) - lw $a0, -4($fp) - lw $a1, -564($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -560($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_TRUE_340 - # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_TRUE_340 - lw $t0, -560($fp) - beq $t0, 0, label_TRUE_340 - # GOTO label_FALSE_339 - j label_FALSE_339 - label_COMPARE_STRING_342: - # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -564($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -560($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_CONTINUE_344 - # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_CONTINUE_344 - lw $t0, -560($fp) - beq $t0, 0, label_CONTINUE_344 - # GOTO label_FALSE_339 - j label_FALSE_339 - label_CONTINUE_344: - # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -564($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_345: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_346 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_345 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_346: - # Store result - sw $a2, -560($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_TRUE_340 - # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_TRUE_340 - lw $t0, -560($fp) - beq $t0, 0, label_TRUE_340 - label_FALSE_339: - # LOCAL local_option_at_CellularAutomaton_internal_138 --> -556($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -556($fp) - # GOTO label_END_341 -j label_END_341 -label_TRUE_340: - # LOCAL local_option_at_CellularAutomaton_internal_138 --> -556($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -556($fp) - label_END_341: -# LOCAL local_option_at_CellularAutomaton_internal_136 --> -548($fp) -# LOCAL local_option_at_CellularAutomaton_internal_138 --> -556($fp) -# Obtain value from -556($fp) -lw $v0, -556($fp) -lw $v0, 12($v0) -sw $v0, -548($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_136 GOTO label_FALSEIF_337 -# IF_ZERO local_option_at_CellularAutomaton_internal_136 GOTO label_FALSEIF_337 -lw $t0, -548($fp) -beq $t0, 0, label_FALSEIF_337 -# LOCAL local_option_at_CellularAutomaton_internal_141 --> -568($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_64 -sw $t0, 12($v0) -li $t0, 20 -sw $t0, 16($v0) -sw $v0, -568($fp) -# LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) -# LOCAL local_option_at_CellularAutomaton_internal_141 --> -568($fp) -# local_option_at_CellularAutomaton_internal_137 = local_option_at_CellularAutomaton_internal_141 -lw $t0, -568($fp) -sw $t0, -552($fp) -# GOTO label_ENDIF_338 -j label_ENDIF_338 -label_FALSEIF_337: - # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 8 - sw $t0, 12($v0) - sw $v0, -588($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_349 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_349 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_349 - # IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_FALSE_349 - # IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_FALSE_349 - lw $t0, -588($fp) - beq $t0, 0, label_FALSE_349 - # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -584($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_COMPARE_STRING_352 - # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_COMPARE_STRING_352 - lw $t0, -584($fp) - beq $t0, 0, label_COMPARE_STRING_352 - # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -584($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_COMPARE_BY_VALUE_353 - # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_COMPARE_BY_VALUE_353 - lw $t0, -584($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_353 - # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -584($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_COMPARE_BY_VALUE_353 - # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_COMPARE_BY_VALUE_353 - lw $t0, -584($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_353 - # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -588($fp) - sub $a0, $a0, $a1 - sw $a0, -584($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_TRUE_350 - # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_TRUE_350 - lw $t0, -584($fp) - beq $t0, 0, label_TRUE_350 - # GOTO label_FALSE_349 - j label_FALSE_349 - label_COMPARE_BY_VALUE_353: - # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) - lw $a0, -4($fp) - lw $a1, -588($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -584($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_TRUE_350 - # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_TRUE_350 - lw $t0, -584($fp) - beq $t0, 0, label_TRUE_350 - # GOTO label_FALSE_349 - j label_FALSE_349 - label_COMPARE_STRING_352: - # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -588($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -584($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_CONTINUE_354 - # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_CONTINUE_354 - lw $t0, -584($fp) - beq $t0, 0, label_CONTINUE_354 - # GOTO label_FALSE_349 - j label_FALSE_349 - label_CONTINUE_354: - # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -588($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_355: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_356 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_355 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_356: - # Store result - sw $a2, -584($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_TRUE_350 - # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_TRUE_350 - lw $t0, -584($fp) - beq $t0, 0, label_TRUE_350 - label_FALSE_349: - # LOCAL local_option_at_CellularAutomaton_internal_144 --> -580($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -580($fp) - # GOTO label_END_351 -j label_END_351 -label_TRUE_350: - # LOCAL local_option_at_CellularAutomaton_internal_144 --> -580($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -580($fp) - label_END_351: -# LOCAL local_option_at_CellularAutomaton_internal_142 --> -572($fp) -# LOCAL local_option_at_CellularAutomaton_internal_144 --> -580($fp) -# Obtain value from -580($fp) -lw $v0, -580($fp) -lw $v0, 12($v0) -sw $v0, -572($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_142 GOTO label_FALSEIF_347 -# IF_ZERO local_option_at_CellularAutomaton_internal_142 GOTO label_FALSEIF_347 -lw $t0, -572($fp) -beq $t0, 0, label_FALSEIF_347 -# LOCAL local_option_at_CellularAutomaton_internal_147 --> -592($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_65 -sw $t0, 12($v0) -li $t0, 20 -sw $t0, 16($v0) -sw $v0, -592($fp) -# LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) -# LOCAL local_option_at_CellularAutomaton_internal_147 --> -592($fp) -# local_option_at_CellularAutomaton_internal_143 = local_option_at_CellularAutomaton_internal_147 -lw $t0, -592($fp) -sw $t0, -576($fp) -# GOTO label_ENDIF_348 -j label_ENDIF_348 -label_FALSEIF_347: - # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 9 - sw $t0, 12($v0) - sw $v0, -612($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_359 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_359 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_359 - # IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_FALSE_359 - # IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_FALSE_359 - lw $t0, -612($fp) - beq $t0, 0, label_FALSE_359 - # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -608($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_COMPARE_STRING_362 - # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_COMPARE_STRING_362 - lw $t0, -608($fp) - beq $t0, 0, label_COMPARE_STRING_362 - # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -608($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_COMPARE_BY_VALUE_363 - # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_COMPARE_BY_VALUE_363 - lw $t0, -608($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_363 - # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -608($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_COMPARE_BY_VALUE_363 - # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_COMPARE_BY_VALUE_363 - lw $t0, -608($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_363 - # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -612($fp) - sub $a0, $a0, $a1 - sw $a0, -608($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_TRUE_360 - # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_TRUE_360 - lw $t0, -608($fp) - beq $t0, 0, label_TRUE_360 - # GOTO label_FALSE_359 - j label_FALSE_359 - label_COMPARE_BY_VALUE_363: - # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) - lw $a0, -4($fp) - lw $a1, -612($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -608($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_TRUE_360 - # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_TRUE_360 - lw $t0, -608($fp) - beq $t0, 0, label_TRUE_360 - # GOTO label_FALSE_359 - j label_FALSE_359 - label_COMPARE_STRING_362: - # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -612($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -608($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_CONTINUE_364 - # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_CONTINUE_364 - lw $t0, -608($fp) - beq $t0, 0, label_CONTINUE_364 - # GOTO label_FALSE_359 - j label_FALSE_359 - label_CONTINUE_364: - # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -612($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_365: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_366 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_365 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_366: - # Store result - sw $a2, -608($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_TRUE_360 - # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_TRUE_360 - lw $t0, -608($fp) - beq $t0, 0, label_TRUE_360 - label_FALSE_359: - # LOCAL local_option_at_CellularAutomaton_internal_150 --> -604($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -604($fp) - # GOTO label_END_361 -j label_END_361 -label_TRUE_360: - # LOCAL local_option_at_CellularAutomaton_internal_150 --> -604($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -604($fp) - label_END_361: -# LOCAL local_option_at_CellularAutomaton_internal_148 --> -596($fp) -# LOCAL local_option_at_CellularAutomaton_internal_150 --> -604($fp) -# Obtain value from -604($fp) -lw $v0, -604($fp) -lw $v0, 12($v0) -sw $v0, -596($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_148 GOTO label_FALSEIF_357 -# IF_ZERO local_option_at_CellularAutomaton_internal_148 GOTO label_FALSEIF_357 -lw $t0, -596($fp) -beq $t0, 0, label_FALSEIF_357 -# LOCAL local_option_at_CellularAutomaton_internal_153 --> -616($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_66 -sw $t0, 12($v0) -li $t0, 15 -sw $t0, 16($v0) -sw $v0, -616($fp) -# LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) -# LOCAL local_option_at_CellularAutomaton_internal_153 --> -616($fp) -# local_option_at_CellularAutomaton_internal_149 = local_option_at_CellularAutomaton_internal_153 -lw $t0, -616($fp) -sw $t0, -600($fp) -# GOTO label_ENDIF_358 -j label_ENDIF_358 -label_FALSEIF_357: - # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 10 - sw $t0, 12($v0) - sw $v0, -636($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_369 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_369 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_369 - # IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_FALSE_369 - # IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_FALSE_369 - lw $t0, -636($fp) - beq $t0, 0, label_FALSE_369 - # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -632($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_COMPARE_STRING_372 - # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_COMPARE_STRING_372 - lw $t0, -632($fp) - beq $t0, 0, label_COMPARE_STRING_372 - # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -632($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_COMPARE_BY_VALUE_373 - # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_COMPARE_BY_VALUE_373 - lw $t0, -632($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_373 - # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -632($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_COMPARE_BY_VALUE_373 - # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_COMPARE_BY_VALUE_373 - lw $t0, -632($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_373 - # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -636($fp) - sub $a0, $a0, $a1 - sw $a0, -632($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_TRUE_370 - # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_TRUE_370 - lw $t0, -632($fp) - beq $t0, 0, label_TRUE_370 - # GOTO label_FALSE_369 - j label_FALSE_369 - label_COMPARE_BY_VALUE_373: - # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) - lw $a0, -4($fp) - lw $a1, -636($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -632($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_TRUE_370 - # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_TRUE_370 - lw $t0, -632($fp) - beq $t0, 0, label_TRUE_370 - # GOTO label_FALSE_369 - j label_FALSE_369 - label_COMPARE_STRING_372: - # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -636($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -632($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_CONTINUE_374 - # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_CONTINUE_374 - lw $t0, -632($fp) - beq $t0, 0, label_CONTINUE_374 - # GOTO label_FALSE_369 - j label_FALSE_369 - label_CONTINUE_374: - # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -636($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_375: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_376 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_375 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_376: - # Store result - sw $a2, -632($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_TRUE_370 - # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_TRUE_370 - lw $t0, -632($fp) - beq $t0, 0, label_TRUE_370 - label_FALSE_369: - # LOCAL local_option_at_CellularAutomaton_internal_156 --> -628($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -628($fp) - # GOTO label_END_371 -j label_END_371 -label_TRUE_370: - # LOCAL local_option_at_CellularAutomaton_internal_156 --> -628($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -628($fp) - label_END_371: -# LOCAL local_option_at_CellularAutomaton_internal_154 --> -620($fp) -# LOCAL local_option_at_CellularAutomaton_internal_156 --> -628($fp) -# Obtain value from -628($fp) -lw $v0, -628($fp) -lw $v0, 12($v0) -sw $v0, -620($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_154 GOTO label_FALSEIF_367 -# IF_ZERO local_option_at_CellularAutomaton_internal_154 GOTO label_FALSEIF_367 -lw $t0, -620($fp) -beq $t0, 0, label_FALSEIF_367 -# LOCAL local_option_at_CellularAutomaton_internal_159 --> -640($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_67 -sw $t0, 12($v0) -li $t0, 15 -sw $t0, 16($v0) -sw $v0, -640($fp) -# LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) -# LOCAL local_option_at_CellularAutomaton_internal_159 --> -640($fp) -# local_option_at_CellularAutomaton_internal_155 = local_option_at_CellularAutomaton_internal_159 -lw $t0, -640($fp) -sw $t0, -624($fp) -# GOTO label_ENDIF_368 -j label_ENDIF_368 -label_FALSEIF_367: - # LOCAL local_option_at_CellularAutomaton_internal_164 --> -660($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 11 - sw $t0, 12($v0) - sw $v0, -660($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_379 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_379 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_379 - # IF_ZERO local_option_at_CellularAutomaton_internal_164 GOTO label_FALSE_379 - # IF_ZERO local_option_at_CellularAutomaton_internal_164 GOTO label_FALSE_379 - lw $t0, -660($fp) - beq $t0, 0, label_FALSE_379 - # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -656($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_COMPARE_STRING_382 - # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_COMPARE_STRING_382 - lw $t0, -656($fp) - beq $t0, 0, label_COMPARE_STRING_382 - # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -656($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_COMPARE_BY_VALUE_383 - # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_COMPARE_BY_VALUE_383 - lw $t0, -656($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_383 - # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -656($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_COMPARE_BY_VALUE_383 - # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_COMPARE_BY_VALUE_383 - lw $t0, -656($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_383 - # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_164 --> -660($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -660($fp) - sub $a0, $a0, $a1 - sw $a0, -656($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_TRUE_380 - # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_TRUE_380 - lw $t0, -656($fp) - beq $t0, 0, label_TRUE_380 - # GOTO label_FALSE_379 - j label_FALSE_379 - label_COMPARE_BY_VALUE_383: - # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_164 --> -660($fp) - lw $a0, -4($fp) - lw $a1, -660($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -656($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_TRUE_380 - # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_TRUE_380 - lw $t0, -656($fp) - beq $t0, 0, label_TRUE_380 - # GOTO label_FALSE_379 - j label_FALSE_379 - label_COMPARE_STRING_382: - # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_164 --> -660($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -660($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -656($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_CONTINUE_384 - # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_CONTINUE_384 - lw $t0, -656($fp) - beq $t0, 0, label_CONTINUE_384 - # GOTO label_FALSE_379 - j label_FALSE_379 - label_CONTINUE_384: - # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_164 --> -660($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -660($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_385: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_386 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_385 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_386: - # Store result - sw $a2, -656($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_TRUE_380 - # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_TRUE_380 - lw $t0, -656($fp) - beq $t0, 0, label_TRUE_380 - label_FALSE_379: - # LOCAL local_option_at_CellularAutomaton_internal_162 --> -652($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -652($fp) - # GOTO label_END_381 -j label_END_381 -label_TRUE_380: - # LOCAL local_option_at_CellularAutomaton_internal_162 --> -652($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -652($fp) - label_END_381: -# LOCAL local_option_at_CellularAutomaton_internal_160 --> -644($fp) -# LOCAL local_option_at_CellularAutomaton_internal_162 --> -652($fp) -# Obtain value from -652($fp) -lw $v0, -652($fp) -lw $v0, 12($v0) -sw $v0, -644($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_160 GOTO label_FALSEIF_377 -# IF_ZERO local_option_at_CellularAutomaton_internal_160 GOTO label_FALSEIF_377 -lw $t0, -644($fp) -beq $t0, 0, label_FALSEIF_377 -# LOCAL local_option_at_CellularAutomaton_internal_165 --> -664($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_68 -sw $t0, 12($v0) -li $t0, 15 -sw $t0, 16($v0) -sw $v0, -664($fp) -# LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) -# LOCAL local_option_at_CellularAutomaton_internal_165 --> -664($fp) -# local_option_at_CellularAutomaton_internal_161 = local_option_at_CellularAutomaton_internal_165 -lw $t0, -664($fp) -sw $t0, -648($fp) -# GOTO label_ENDIF_378 -j label_ENDIF_378 -label_FALSEIF_377: - # LOCAL local_option_at_CellularAutomaton_internal_170 --> -684($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 12 - sw $t0, 12($v0) - sw $v0, -684($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_389 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_389 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_389 - # IF_ZERO local_option_at_CellularAutomaton_internal_170 GOTO label_FALSE_389 - # IF_ZERO local_option_at_CellularAutomaton_internal_170 GOTO label_FALSE_389 - lw $t0, -684($fp) - beq $t0, 0, label_FALSE_389 - # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -680($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_COMPARE_STRING_392 - # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_COMPARE_STRING_392 - lw $t0, -680($fp) - beq $t0, 0, label_COMPARE_STRING_392 - # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -680($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_COMPARE_BY_VALUE_393 - # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_COMPARE_BY_VALUE_393 - lw $t0, -680($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_393 - # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -680($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_COMPARE_BY_VALUE_393 - # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_COMPARE_BY_VALUE_393 - lw $t0, -680($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_393 - # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_170 --> -684($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -684($fp) - sub $a0, $a0, $a1 - sw $a0, -680($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_TRUE_390 - # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_TRUE_390 - lw $t0, -680($fp) - beq $t0, 0, label_TRUE_390 - # GOTO label_FALSE_389 - j label_FALSE_389 - label_COMPARE_BY_VALUE_393: - # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_170 --> -684($fp) - lw $a0, -4($fp) - lw $a1, -684($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -680($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_TRUE_390 - # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_TRUE_390 - lw $t0, -680($fp) - beq $t0, 0, label_TRUE_390 - # GOTO label_FALSE_389 - j label_FALSE_389 - label_COMPARE_STRING_392: - # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_170 --> -684($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -684($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -680($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_CONTINUE_394 - # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_CONTINUE_394 - lw $t0, -680($fp) - beq $t0, 0, label_CONTINUE_394 - # GOTO label_FALSE_389 - j label_FALSE_389 - label_CONTINUE_394: - # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_170 --> -684($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -684($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_395: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_396 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_395 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_396: - # Store result - sw $a2, -680($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_TRUE_390 - # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_TRUE_390 - lw $t0, -680($fp) - beq $t0, 0, label_TRUE_390 - label_FALSE_389: - # LOCAL local_option_at_CellularAutomaton_internal_168 --> -676($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -676($fp) - # GOTO label_END_391 -j label_END_391 -label_TRUE_390: - # LOCAL local_option_at_CellularAutomaton_internal_168 --> -676($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -676($fp) - label_END_391: -# LOCAL local_option_at_CellularAutomaton_internal_166 --> -668($fp) -# LOCAL local_option_at_CellularAutomaton_internal_168 --> -676($fp) -# Obtain value from -676($fp) -lw $v0, -676($fp) -lw $v0, 12($v0) -sw $v0, -668($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_166 GOTO label_FALSEIF_387 -# IF_ZERO local_option_at_CellularAutomaton_internal_166 GOTO label_FALSEIF_387 -lw $t0, -668($fp) -beq $t0, 0, label_FALSEIF_387 -# LOCAL local_option_at_CellularAutomaton_internal_171 --> -688($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_69 -sw $t0, 12($v0) -li $t0, 25 -sw $t0, 16($v0) -sw $v0, -688($fp) -# LOCAL local_option_at_CellularAutomaton_internal_167 --> -672($fp) -# LOCAL local_option_at_CellularAutomaton_internal_171 --> -688($fp) -# local_option_at_CellularAutomaton_internal_167 = local_option_at_CellularAutomaton_internal_171 -lw $t0, -688($fp) -sw $t0, -672($fp) -# GOTO label_ENDIF_388 -j label_ENDIF_388 -label_FALSEIF_387: - # LOCAL local_option_at_CellularAutomaton_internal_176 --> -708($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 13 - sw $t0, 12($v0) - sw $v0, -708($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_399 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_399 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_399 - # IF_ZERO local_option_at_CellularAutomaton_internal_176 GOTO label_FALSE_399 - # IF_ZERO local_option_at_CellularAutomaton_internal_176 GOTO label_FALSE_399 - lw $t0, -708($fp) - beq $t0, 0, label_FALSE_399 - # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -704($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_COMPARE_STRING_402 - # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_COMPARE_STRING_402 - lw $t0, -704($fp) - beq $t0, 0, label_COMPARE_STRING_402 - # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -704($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_COMPARE_BY_VALUE_403 - # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_COMPARE_BY_VALUE_403 - lw $t0, -704($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_403 - # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -704($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_COMPARE_BY_VALUE_403 - # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_COMPARE_BY_VALUE_403 - lw $t0, -704($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_403 - # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_176 --> -708($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -708($fp) - sub $a0, $a0, $a1 - sw $a0, -704($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_TRUE_400 - # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_TRUE_400 - lw $t0, -704($fp) - beq $t0, 0, label_TRUE_400 - # GOTO label_FALSE_399 - j label_FALSE_399 - label_COMPARE_BY_VALUE_403: - # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_176 --> -708($fp) - lw $a0, -4($fp) - lw $a1, -708($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -704($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_TRUE_400 - # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_TRUE_400 - lw $t0, -704($fp) - beq $t0, 0, label_TRUE_400 - # GOTO label_FALSE_399 - j label_FALSE_399 - label_COMPARE_STRING_402: - # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_176 --> -708($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -708($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -704($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_CONTINUE_404 - # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_CONTINUE_404 - lw $t0, -704($fp) - beq $t0, 0, label_CONTINUE_404 - # GOTO label_FALSE_399 - j label_FALSE_399 - label_CONTINUE_404: - # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_176 --> -708($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -708($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_405: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_406 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_405 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_406: - # Store result - sw $a2, -704($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_TRUE_400 - # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_TRUE_400 - lw $t0, -704($fp) - beq $t0, 0, label_TRUE_400 - label_FALSE_399: - # LOCAL local_option_at_CellularAutomaton_internal_174 --> -700($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -700($fp) - # GOTO label_END_401 -j label_END_401 -label_TRUE_400: - # LOCAL local_option_at_CellularAutomaton_internal_174 --> -700($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -700($fp) - label_END_401: -# LOCAL local_option_at_CellularAutomaton_internal_172 --> -692($fp) -# LOCAL local_option_at_CellularAutomaton_internal_174 --> -700($fp) -# Obtain value from -700($fp) -lw $v0, -700($fp) -lw $v0, 12($v0) -sw $v0, -692($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_172 GOTO label_FALSEIF_397 -# IF_ZERO local_option_at_CellularAutomaton_internal_172 GOTO label_FALSEIF_397 -lw $t0, -692($fp) -beq $t0, 0, label_FALSEIF_397 -# LOCAL local_option_at_CellularAutomaton_internal_177 --> -712($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_70 -sw $t0, 12($v0) -li $t0, 25 -sw $t0, 16($v0) -sw $v0, -712($fp) -# LOCAL local_option_at_CellularAutomaton_internal_173 --> -696($fp) -# LOCAL local_option_at_CellularAutomaton_internal_177 --> -712($fp) -# local_option_at_CellularAutomaton_internal_173 = local_option_at_CellularAutomaton_internal_177 -lw $t0, -712($fp) -sw $t0, -696($fp) -# GOTO label_ENDIF_398 -j label_ENDIF_398 -label_FALSEIF_397: - # LOCAL local_option_at_CellularAutomaton_internal_182 --> -732($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 14 - sw $t0, 12($v0) - sw $v0, -732($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_409 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_409 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_409 - # IF_ZERO local_option_at_CellularAutomaton_internal_182 GOTO label_FALSE_409 - # IF_ZERO local_option_at_CellularAutomaton_internal_182 GOTO label_FALSE_409 - lw $t0, -732($fp) - beq $t0, 0, label_FALSE_409 - # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -728($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_COMPARE_STRING_412 - # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_COMPARE_STRING_412 - lw $t0, -728($fp) - beq $t0, 0, label_COMPARE_STRING_412 - # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -728($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_COMPARE_BY_VALUE_413 - # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_COMPARE_BY_VALUE_413 - lw $t0, -728($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_413 - # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -728($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_COMPARE_BY_VALUE_413 - # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_COMPARE_BY_VALUE_413 - lw $t0, -728($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_413 - # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_182 --> -732($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -732($fp) - sub $a0, $a0, $a1 - sw $a0, -728($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_TRUE_410 - # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_TRUE_410 - lw $t0, -728($fp) - beq $t0, 0, label_TRUE_410 - # GOTO label_FALSE_409 - j label_FALSE_409 - label_COMPARE_BY_VALUE_413: - # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_182 --> -732($fp) - lw $a0, -4($fp) - lw $a1, -732($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -728($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_TRUE_410 - # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_TRUE_410 - lw $t0, -728($fp) - beq $t0, 0, label_TRUE_410 - # GOTO label_FALSE_409 - j label_FALSE_409 - label_COMPARE_STRING_412: - # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_182 --> -732($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -732($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -728($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_CONTINUE_414 - # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_CONTINUE_414 - lw $t0, -728($fp) - beq $t0, 0, label_CONTINUE_414 - # GOTO label_FALSE_409 - j label_FALSE_409 - label_CONTINUE_414: - # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_182 --> -732($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -732($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_415: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_416 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_415 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_416: - # Store result - sw $a2, -728($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_TRUE_410 - # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_TRUE_410 - lw $t0, -728($fp) - beq $t0, 0, label_TRUE_410 - label_FALSE_409: - # LOCAL local_option_at_CellularAutomaton_internal_180 --> -724($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -724($fp) - # GOTO label_END_411 -j label_END_411 -label_TRUE_410: - # LOCAL local_option_at_CellularAutomaton_internal_180 --> -724($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -724($fp) - label_END_411: -# LOCAL local_option_at_CellularAutomaton_internal_178 --> -716($fp) -# LOCAL local_option_at_CellularAutomaton_internal_180 --> -724($fp) -# Obtain value from -724($fp) -lw $v0, -724($fp) -lw $v0, 12($v0) -sw $v0, -716($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_178 GOTO label_FALSEIF_407 -# IF_ZERO local_option_at_CellularAutomaton_internal_178 GOTO label_FALSEIF_407 -lw $t0, -716($fp) -beq $t0, 0, label_FALSEIF_407 -# LOCAL local_option_at_CellularAutomaton_internal_183 --> -736($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_71 -sw $t0, 12($v0) -li $t0, 25 -sw $t0, 16($v0) -sw $v0, -736($fp) -# LOCAL local_option_at_CellularAutomaton_internal_179 --> -720($fp) -# LOCAL local_option_at_CellularAutomaton_internal_183 --> -736($fp) -# local_option_at_CellularAutomaton_internal_179 = local_option_at_CellularAutomaton_internal_183 -lw $t0, -736($fp) -sw $t0, -720($fp) -# GOTO label_ENDIF_408 -j label_ENDIF_408 -label_FALSEIF_407: - # LOCAL local_option_at_CellularAutomaton_internal_188 --> -756($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 15 - sw $t0, 12($v0) - sw $v0, -756($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_419 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_419 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_419 - # IF_ZERO local_option_at_CellularAutomaton_internal_188 GOTO label_FALSE_419 - # IF_ZERO local_option_at_CellularAutomaton_internal_188 GOTO label_FALSE_419 - lw $t0, -756($fp) - beq $t0, 0, label_FALSE_419 - # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -752($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_COMPARE_STRING_422 - # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_COMPARE_STRING_422 - lw $t0, -752($fp) - beq $t0, 0, label_COMPARE_STRING_422 - # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -752($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_COMPARE_BY_VALUE_423 - # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_COMPARE_BY_VALUE_423 - lw $t0, -752($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_423 - # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -752($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_COMPARE_BY_VALUE_423 - # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_COMPARE_BY_VALUE_423 - lw $t0, -752($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_423 - # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_188 --> -756($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -756($fp) - sub $a0, $a0, $a1 - sw $a0, -752($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_TRUE_420 - # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_TRUE_420 - lw $t0, -752($fp) - beq $t0, 0, label_TRUE_420 - # GOTO label_FALSE_419 - j label_FALSE_419 - label_COMPARE_BY_VALUE_423: - # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_188 --> -756($fp) - lw $a0, -4($fp) - lw $a1, -756($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -752($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_TRUE_420 - # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_TRUE_420 - lw $t0, -752($fp) - beq $t0, 0, label_TRUE_420 - # GOTO label_FALSE_419 - j label_FALSE_419 - label_COMPARE_STRING_422: - # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_188 --> -756($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -756($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -752($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_CONTINUE_424 - # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_CONTINUE_424 - lw $t0, -752($fp) - beq $t0, 0, label_CONTINUE_424 - # GOTO label_FALSE_419 - j label_FALSE_419 - label_CONTINUE_424: - # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_188 --> -756($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -756($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_425: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_426 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_425 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_426: - # Store result - sw $a2, -752($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_TRUE_420 - # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_TRUE_420 - lw $t0, -752($fp) - beq $t0, 0, label_TRUE_420 - label_FALSE_419: - # LOCAL local_option_at_CellularAutomaton_internal_186 --> -748($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -748($fp) - # GOTO label_END_421 -j label_END_421 -label_TRUE_420: - # LOCAL local_option_at_CellularAutomaton_internal_186 --> -748($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -748($fp) - label_END_421: -# LOCAL local_option_at_CellularAutomaton_internal_184 --> -740($fp) -# LOCAL local_option_at_CellularAutomaton_internal_186 --> -748($fp) -# Obtain value from -748($fp) -lw $v0, -748($fp) -lw $v0, 12($v0) -sw $v0, -740($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_184 GOTO label_FALSEIF_417 -# IF_ZERO local_option_at_CellularAutomaton_internal_184 GOTO label_FALSEIF_417 -lw $t0, -740($fp) -beq $t0, 0, label_FALSEIF_417 -# LOCAL local_option_at_CellularAutomaton_internal_189 --> -760($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_72 -sw $t0, 12($v0) -li $t0, 21 -sw $t0, 16($v0) -sw $v0, -760($fp) -# LOCAL local_option_at_CellularAutomaton_internal_185 --> -744($fp) -# LOCAL local_option_at_CellularAutomaton_internal_189 --> -760($fp) -# local_option_at_CellularAutomaton_internal_185 = local_option_at_CellularAutomaton_internal_189 -lw $t0, -760($fp) -sw $t0, -744($fp) -# GOTO label_ENDIF_418 -j label_ENDIF_418 -label_FALSEIF_417: - # LOCAL local_option_at_CellularAutomaton_internal_194 --> -780($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 16 - sw $t0, 12($v0) - sw $v0, -780($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_429 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_429 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_429 - # IF_ZERO local_option_at_CellularAutomaton_internal_194 GOTO label_FALSE_429 - # IF_ZERO local_option_at_CellularAutomaton_internal_194 GOTO label_FALSE_429 - lw $t0, -780($fp) - beq $t0, 0, label_FALSE_429 - # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -776($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_COMPARE_STRING_432 - # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_COMPARE_STRING_432 - lw $t0, -776($fp) - beq $t0, 0, label_COMPARE_STRING_432 - # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -776($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_COMPARE_BY_VALUE_433 - # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_COMPARE_BY_VALUE_433 - lw $t0, -776($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_433 - # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -776($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_COMPARE_BY_VALUE_433 - # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_COMPARE_BY_VALUE_433 - lw $t0, -776($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_433 - # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_194 --> -780($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -780($fp) - sub $a0, $a0, $a1 - sw $a0, -776($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_TRUE_430 - # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_TRUE_430 - lw $t0, -776($fp) - beq $t0, 0, label_TRUE_430 - # GOTO label_FALSE_429 - j label_FALSE_429 - label_COMPARE_BY_VALUE_433: - # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_194 --> -780($fp) - lw $a0, -4($fp) - lw $a1, -780($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -776($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_TRUE_430 - # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_TRUE_430 - lw $t0, -776($fp) - beq $t0, 0, label_TRUE_430 - # GOTO label_FALSE_429 - j label_FALSE_429 - label_COMPARE_STRING_432: - # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_194 --> -780($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -780($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -776($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_CONTINUE_434 - # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_CONTINUE_434 - lw $t0, -776($fp) - beq $t0, 0, label_CONTINUE_434 - # GOTO label_FALSE_429 - j label_FALSE_429 - label_CONTINUE_434: - # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_194 --> -780($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -780($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_435: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_436 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_435 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_436: - # Store result - sw $a2, -776($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_TRUE_430 - # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_TRUE_430 - lw $t0, -776($fp) - beq $t0, 0, label_TRUE_430 - label_FALSE_429: - # LOCAL local_option_at_CellularAutomaton_internal_192 --> -772($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -772($fp) - # GOTO label_END_431 -j label_END_431 -label_TRUE_430: - # LOCAL local_option_at_CellularAutomaton_internal_192 --> -772($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -772($fp) - label_END_431: -# LOCAL local_option_at_CellularAutomaton_internal_190 --> -764($fp) -# LOCAL local_option_at_CellularAutomaton_internal_192 --> -772($fp) -# Obtain value from -772($fp) -lw $v0, -772($fp) -lw $v0, 12($v0) -sw $v0, -764($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_190 GOTO label_FALSEIF_427 -# IF_ZERO local_option_at_CellularAutomaton_internal_190 GOTO label_FALSEIF_427 -lw $t0, -764($fp) -beq $t0, 0, label_FALSEIF_427 -# LOCAL local_option_at_CellularAutomaton_internal_195 --> -784($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_73 -sw $t0, 12($v0) -li $t0, 21 -sw $t0, 16($v0) -sw $v0, -784($fp) -# LOCAL local_option_at_CellularAutomaton_internal_191 --> -768($fp) -# LOCAL local_option_at_CellularAutomaton_internal_195 --> -784($fp) -# local_option_at_CellularAutomaton_internal_191 = local_option_at_CellularAutomaton_internal_195 -lw $t0, -784($fp) -sw $t0, -768($fp) -# GOTO label_ENDIF_428 -j label_ENDIF_428 -label_FALSEIF_427: - # LOCAL local_option_at_CellularAutomaton_internal_200 --> -804($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 17 - sw $t0, 12($v0) - sw $v0, -804($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_439 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_439 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_439 - # IF_ZERO local_option_at_CellularAutomaton_internal_200 GOTO label_FALSE_439 - # IF_ZERO local_option_at_CellularAutomaton_internal_200 GOTO label_FALSE_439 - lw $t0, -804($fp) - beq $t0, 0, label_FALSE_439 - # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -800($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_COMPARE_STRING_442 - # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_COMPARE_STRING_442 - lw $t0, -800($fp) - beq $t0, 0, label_COMPARE_STRING_442 - # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -800($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_COMPARE_BY_VALUE_443 - # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_COMPARE_BY_VALUE_443 - lw $t0, -800($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_443 - # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -800($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_COMPARE_BY_VALUE_443 - # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_COMPARE_BY_VALUE_443 - lw $t0, -800($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_443 - # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_200 --> -804($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -804($fp) - sub $a0, $a0, $a1 - sw $a0, -800($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_TRUE_440 - # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_TRUE_440 - lw $t0, -800($fp) - beq $t0, 0, label_TRUE_440 - # GOTO label_FALSE_439 - j label_FALSE_439 - label_COMPARE_BY_VALUE_443: - # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_200 --> -804($fp) - lw $a0, -4($fp) - lw $a1, -804($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -800($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_TRUE_440 - # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_TRUE_440 - lw $t0, -800($fp) - beq $t0, 0, label_TRUE_440 - # GOTO label_FALSE_439 - j label_FALSE_439 - label_COMPARE_STRING_442: - # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_200 --> -804($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -804($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -800($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_CONTINUE_444 - # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_CONTINUE_444 - lw $t0, -800($fp) - beq $t0, 0, label_CONTINUE_444 - # GOTO label_FALSE_439 - j label_FALSE_439 - label_CONTINUE_444: - # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_200 --> -804($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -804($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_445: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_446 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_445 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_446: - # Store result - sw $a2, -800($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_TRUE_440 - # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_TRUE_440 - lw $t0, -800($fp) - beq $t0, 0, label_TRUE_440 - label_FALSE_439: - # LOCAL local_option_at_CellularAutomaton_internal_198 --> -796($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -796($fp) - # GOTO label_END_441 -j label_END_441 -label_TRUE_440: - # LOCAL local_option_at_CellularAutomaton_internal_198 --> -796($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -796($fp) - label_END_441: -# LOCAL local_option_at_CellularAutomaton_internal_196 --> -788($fp) -# LOCAL local_option_at_CellularAutomaton_internal_198 --> -796($fp) -# Obtain value from -796($fp) -lw $v0, -796($fp) -lw $v0, 12($v0) -sw $v0, -788($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_196 GOTO label_FALSEIF_437 -# IF_ZERO local_option_at_CellularAutomaton_internal_196 GOTO label_FALSEIF_437 -lw $t0, -788($fp) -beq $t0, 0, label_FALSEIF_437 -# LOCAL local_option_at_CellularAutomaton_internal_201 --> -808($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_74 -sw $t0, 12($v0) -li $t0, 28 -sw $t0, 16($v0) -sw $v0, -808($fp) -# LOCAL local_option_at_CellularAutomaton_internal_197 --> -792($fp) -# LOCAL local_option_at_CellularAutomaton_internal_201 --> -808($fp) -# local_option_at_CellularAutomaton_internal_197 = local_option_at_CellularAutomaton_internal_201 -lw $t0, -808($fp) -sw $t0, -792($fp) -# GOTO label_ENDIF_438 -j label_ENDIF_438 -label_FALSEIF_437: - # LOCAL local_option_at_CellularAutomaton_internal_206 --> -828($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 18 - sw $t0, 12($v0) - sw $v0, -828($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_449 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_449 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_449 - # IF_ZERO local_option_at_CellularAutomaton_internal_206 GOTO label_FALSE_449 - # IF_ZERO local_option_at_CellularAutomaton_internal_206 GOTO label_FALSE_449 - lw $t0, -828($fp) - beq $t0, 0, label_FALSE_449 - # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -824($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_COMPARE_STRING_452 - # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_COMPARE_STRING_452 - lw $t0, -824($fp) - beq $t0, 0, label_COMPARE_STRING_452 - # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -824($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_COMPARE_BY_VALUE_453 - # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_COMPARE_BY_VALUE_453 - lw $t0, -824($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_453 - # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -824($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_COMPARE_BY_VALUE_453 - # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_COMPARE_BY_VALUE_453 - lw $t0, -824($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_453 - # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_206 --> -828($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -828($fp) - sub $a0, $a0, $a1 - sw $a0, -824($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_TRUE_450 - # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_TRUE_450 - lw $t0, -824($fp) - beq $t0, 0, label_TRUE_450 - # GOTO label_FALSE_449 - j label_FALSE_449 - label_COMPARE_BY_VALUE_453: - # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_206 --> -828($fp) - lw $a0, -4($fp) - lw $a1, -828($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -824($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_TRUE_450 - # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_TRUE_450 - lw $t0, -824($fp) - beq $t0, 0, label_TRUE_450 - # GOTO label_FALSE_449 - j label_FALSE_449 - label_COMPARE_STRING_452: - # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_206 --> -828($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -828($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -824($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_CONTINUE_454 - # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_CONTINUE_454 - lw $t0, -824($fp) - beq $t0, 0, label_CONTINUE_454 - # GOTO label_FALSE_449 - j label_FALSE_449 - label_CONTINUE_454: - # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_206 --> -828($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -828($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_455: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_456 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_455 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_456: - # Store result - sw $a2, -824($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_TRUE_450 - # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_TRUE_450 - lw $t0, -824($fp) - beq $t0, 0, label_TRUE_450 - label_FALSE_449: - # LOCAL local_option_at_CellularAutomaton_internal_204 --> -820($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -820($fp) - # GOTO label_END_451 -j label_END_451 -label_TRUE_450: - # LOCAL local_option_at_CellularAutomaton_internal_204 --> -820($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -820($fp) - label_END_451: -# LOCAL local_option_at_CellularAutomaton_internal_202 --> -812($fp) -# LOCAL local_option_at_CellularAutomaton_internal_204 --> -820($fp) -# Obtain value from -820($fp) -lw $v0, -820($fp) -lw $v0, 12($v0) -sw $v0, -812($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_202 GOTO label_FALSEIF_447 -# IF_ZERO local_option_at_CellularAutomaton_internal_202 GOTO label_FALSEIF_447 -lw $t0, -812($fp) -beq $t0, 0, label_FALSEIF_447 -# LOCAL local_option_at_CellularAutomaton_internal_207 --> -832($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_75 -sw $t0, 12($v0) -li $t0, 28 -sw $t0, 16($v0) -sw $v0, -832($fp) -# LOCAL local_option_at_CellularAutomaton_internal_203 --> -816($fp) -# LOCAL local_option_at_CellularAutomaton_internal_207 --> -832($fp) -# local_option_at_CellularAutomaton_internal_203 = local_option_at_CellularAutomaton_internal_207 -lw $t0, -832($fp) -sw $t0, -816($fp) -# GOTO label_ENDIF_448 -j label_ENDIF_448 -label_FALSEIF_447: - # LOCAL local_option_at_CellularAutomaton_internal_212 --> -852($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 19 - sw $t0, 12($v0) - sw $v0, -852($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_459 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_459 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_459 - # IF_ZERO local_option_at_CellularAutomaton_internal_212 GOTO label_FALSE_459 - # IF_ZERO local_option_at_CellularAutomaton_internal_212 GOTO label_FALSE_459 - lw $t0, -852($fp) - beq $t0, 0, label_FALSE_459 - # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -848($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_COMPARE_STRING_462 - # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_COMPARE_STRING_462 - lw $t0, -848($fp) - beq $t0, 0, label_COMPARE_STRING_462 - # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -848($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_COMPARE_BY_VALUE_463 - # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_COMPARE_BY_VALUE_463 - lw $t0, -848($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_463 - # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -848($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_COMPARE_BY_VALUE_463 - # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_COMPARE_BY_VALUE_463 - lw $t0, -848($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_463 - # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_212 --> -852($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -852($fp) - sub $a0, $a0, $a1 - sw $a0, -848($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_TRUE_460 - # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_TRUE_460 - lw $t0, -848($fp) - beq $t0, 0, label_TRUE_460 - # GOTO label_FALSE_459 - j label_FALSE_459 - label_COMPARE_BY_VALUE_463: - # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_212 --> -852($fp) - lw $a0, -4($fp) - lw $a1, -852($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -848($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_TRUE_460 - # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_TRUE_460 - lw $t0, -848($fp) - beq $t0, 0, label_TRUE_460 - # GOTO label_FALSE_459 - j label_FALSE_459 - label_COMPARE_STRING_462: - # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_212 --> -852($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -852($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -848($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_CONTINUE_464 - # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_CONTINUE_464 - lw $t0, -848($fp) - beq $t0, 0, label_CONTINUE_464 - # GOTO label_FALSE_459 - j label_FALSE_459 - label_CONTINUE_464: - # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_212 --> -852($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -852($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_465: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_466 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_465 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_466: - # Store result - sw $a2, -848($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_TRUE_460 - # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_TRUE_460 - lw $t0, -848($fp) - beq $t0, 0, label_TRUE_460 - label_FALSE_459: - # LOCAL local_option_at_CellularAutomaton_internal_210 --> -844($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -844($fp) - # GOTO label_END_461 -j label_END_461 -label_TRUE_460: - # LOCAL local_option_at_CellularAutomaton_internal_210 --> -844($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -844($fp) - label_END_461: -# LOCAL local_option_at_CellularAutomaton_internal_208 --> -836($fp) -# LOCAL local_option_at_CellularAutomaton_internal_210 --> -844($fp) -# Obtain value from -844($fp) -lw $v0, -844($fp) -lw $v0, 12($v0) -sw $v0, -836($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_208 GOTO label_FALSEIF_457 -# IF_ZERO local_option_at_CellularAutomaton_internal_208 GOTO label_FALSEIF_457 -lw $t0, -836($fp) -beq $t0, 0, label_FALSEIF_457 -# LOCAL local_option_at_CellularAutomaton_internal_213 --> -856($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_76 -sw $t0, 12($v0) -li $t0, 16 -sw $t0, 16($v0) -sw $v0, -856($fp) -# LOCAL local_option_at_CellularAutomaton_internal_209 --> -840($fp) -# LOCAL local_option_at_CellularAutomaton_internal_213 --> -856($fp) -# local_option_at_CellularAutomaton_internal_209 = local_option_at_CellularAutomaton_internal_213 -lw $t0, -856($fp) -sw $t0, -840($fp) -# GOTO label_ENDIF_458 -j label_ENDIF_458 -label_FALSEIF_457: - # LOCAL local_option_at_CellularAutomaton_internal_218 --> -876($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 20 - sw $t0, 12($v0) - sw $v0, -876($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_469 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_469 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_469 - # IF_ZERO local_option_at_CellularAutomaton_internal_218 GOTO label_FALSE_469 - # IF_ZERO local_option_at_CellularAutomaton_internal_218 GOTO label_FALSE_469 - lw $t0, -876($fp) - beq $t0, 0, label_FALSE_469 - # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -872($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_COMPARE_STRING_472 - # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_COMPARE_STRING_472 - lw $t0, -872($fp) - beq $t0, 0, label_COMPARE_STRING_472 - # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -872($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_COMPARE_BY_VALUE_473 - # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_COMPARE_BY_VALUE_473 - lw $t0, -872($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_473 - # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -872($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_COMPARE_BY_VALUE_473 - # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_COMPARE_BY_VALUE_473 - lw $t0, -872($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_473 - # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_218 --> -876($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -876($fp) - sub $a0, $a0, $a1 - sw $a0, -872($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_TRUE_470 - # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_TRUE_470 - lw $t0, -872($fp) - beq $t0, 0, label_TRUE_470 - # GOTO label_FALSE_469 - j label_FALSE_469 - label_COMPARE_BY_VALUE_473: - # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_218 --> -876($fp) - lw $a0, -4($fp) - lw $a1, -876($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -872($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_TRUE_470 - # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_TRUE_470 - lw $t0, -872($fp) - beq $t0, 0, label_TRUE_470 - # GOTO label_FALSE_469 - j label_FALSE_469 - label_COMPARE_STRING_472: - # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_218 --> -876($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -876($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -872($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_CONTINUE_474 - # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_CONTINUE_474 - lw $t0, -872($fp) - beq $t0, 0, label_CONTINUE_474 - # GOTO label_FALSE_469 - j label_FALSE_469 - label_CONTINUE_474: - # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_218 --> -876($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -876($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_475: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_476 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_475 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_476: - # Store result - sw $a2, -872($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_TRUE_470 - # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_TRUE_470 - lw $t0, -872($fp) - beq $t0, 0, label_TRUE_470 - label_FALSE_469: - # LOCAL local_option_at_CellularAutomaton_internal_216 --> -868($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -868($fp) - # GOTO label_END_471 -j label_END_471 -label_TRUE_470: - # LOCAL local_option_at_CellularAutomaton_internal_216 --> -868($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -868($fp) - label_END_471: -# LOCAL local_option_at_CellularAutomaton_internal_214 --> -860($fp) -# LOCAL local_option_at_CellularAutomaton_internal_216 --> -868($fp) -# Obtain value from -868($fp) -lw $v0, -868($fp) -lw $v0, 12($v0) -sw $v0, -860($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_214 GOTO label_FALSEIF_467 -# IF_ZERO local_option_at_CellularAutomaton_internal_214 GOTO label_FALSEIF_467 -lw $t0, -860($fp) -beq $t0, 0, label_FALSEIF_467 -# LOCAL local_option_at_CellularAutomaton_internal_219 --> -880($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_77 -sw $t0, 12($v0) -li $t0, 28 -sw $t0, 16($v0) -sw $v0, -880($fp) -# LOCAL local_option_at_CellularAutomaton_internal_215 --> -864($fp) -# LOCAL local_option_at_CellularAutomaton_internal_219 --> -880($fp) -# local_option_at_CellularAutomaton_internal_215 = local_option_at_CellularAutomaton_internal_219 -lw $t0, -880($fp) -sw $t0, -864($fp) -# GOTO label_ENDIF_468 -j label_ENDIF_468 -label_FALSEIF_467: - # LOCAL local_option_at_CellularAutomaton_internal_224 --> -900($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 21 - sw $t0, 12($v0) - sw $v0, -900($fp) - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_479 - # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_479 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_479 - # IF_ZERO local_option_at_CellularAutomaton_internal_224 GOTO label_FALSE_479 - # IF_ZERO local_option_at_CellularAutomaton_internal_224 GOTO label_FALSE_479 - lw $t0, -900($fp) - beq $t0, 0, label_FALSE_479 - # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -896($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_COMPARE_STRING_482 - # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_COMPARE_STRING_482 - lw $t0, -896($fp) - beq $t0, 0, label_COMPARE_STRING_482 - # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -896($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_COMPARE_BY_VALUE_483 - # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_COMPARE_BY_VALUE_483 - lw $t0, -896($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_483 - # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -896($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_COMPARE_BY_VALUE_483 - # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_COMPARE_BY_VALUE_483 - lw $t0, -896($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_483 - # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_224 --> -900($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -900($fp) - sub $a0, $a0, $a1 - sw $a0, -896($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_TRUE_480 - # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_TRUE_480 - lw $t0, -896($fp) - beq $t0, 0, label_TRUE_480 - # GOTO label_FALSE_479 - j label_FALSE_479 - label_COMPARE_BY_VALUE_483: - # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_224 --> -900($fp) - lw $a0, -4($fp) - lw $a1, -900($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -896($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_TRUE_480 - # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_TRUE_480 - lw $t0, -896($fp) - beq $t0, 0, label_TRUE_480 - # GOTO label_FALSE_479 - j label_FALSE_479 - label_COMPARE_STRING_482: - # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_224 --> -900($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -900($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -896($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_CONTINUE_484 - # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_CONTINUE_484 - lw $t0, -896($fp) - beq $t0, 0, label_CONTINUE_484 - # GOTO label_FALSE_479 - j label_FALSE_479 - label_CONTINUE_484: - # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) - # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) - # LOCAL local_option_at_CellularAutomaton_internal_224 --> -900($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -900($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_485: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_486 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_485 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_486: - # Store result - sw $a2, -896($fp) - # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_TRUE_480 - # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_TRUE_480 - lw $t0, -896($fp) - beq $t0, 0, label_TRUE_480 - label_FALSE_479: - # LOCAL local_option_at_CellularAutomaton_internal_222 --> -892($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -892($fp) - # GOTO label_END_481 -j label_END_481 -label_TRUE_480: - # LOCAL local_option_at_CellularAutomaton_internal_222 --> -892($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -892($fp) - label_END_481: -# LOCAL local_option_at_CellularAutomaton_internal_220 --> -884($fp) -# LOCAL local_option_at_CellularAutomaton_internal_222 --> -892($fp) -# Obtain value from -892($fp) -lw $v0, -892($fp) -lw $v0, 12($v0) -sw $v0, -884($fp) -# IF_ZERO local_option_at_CellularAutomaton_internal_220 GOTO label_FALSEIF_477 -# IF_ZERO local_option_at_CellularAutomaton_internal_220 GOTO label_FALSEIF_477 -lw $t0, -884($fp) -beq $t0, 0, label_FALSEIF_477 -# LOCAL local_option_at_CellularAutomaton_internal_225 --> -904($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_78 -sw $t0, 12($v0) -li $t0, 28 -sw $t0, 16($v0) -sw $v0, -904($fp) -# LOCAL local_option_at_CellularAutomaton_internal_221 --> -888($fp) -# LOCAL local_option_at_CellularAutomaton_internal_225 --> -904($fp) -# local_option_at_CellularAutomaton_internal_221 = local_option_at_CellularAutomaton_internal_225 -lw $t0, -904($fp) -sw $t0, -888($fp) -# GOTO label_ENDIF_478 -j label_ENDIF_478 -label_FALSEIF_477: - # LOCAL local_option_at_CellularAutomaton_internal_226 --> -908($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_79 - sw $t0, 12($v0) - li $t0, 25 - sw $t0, 16($v0) - sw $v0, -908($fp) - # LOCAL local_option_at_CellularAutomaton_internal_221 --> -888($fp) - # LOCAL local_option_at_CellularAutomaton_internal_226 --> -908($fp) - # local_option_at_CellularAutomaton_internal_221 = local_option_at_CellularAutomaton_internal_226 - lw $t0, -908($fp) - sw $t0, -888($fp) - label_ENDIF_478: -# LOCAL local_option_at_CellularAutomaton_internal_215 --> -864($fp) -# LOCAL local_option_at_CellularAutomaton_internal_221 --> -888($fp) -# local_option_at_CellularAutomaton_internal_215 = local_option_at_CellularAutomaton_internal_221 -lw $t0, -888($fp) -sw $t0, -864($fp) -label_ENDIF_468: -# LOCAL local_option_at_CellularAutomaton_internal_209 --> -840($fp) -# LOCAL local_option_at_CellularAutomaton_internal_215 --> -864($fp) -# local_option_at_CellularAutomaton_internal_209 = local_option_at_CellularAutomaton_internal_215 -lw $t0, -864($fp) -sw $t0, -840($fp) -label_ENDIF_458: -# LOCAL local_option_at_CellularAutomaton_internal_203 --> -816($fp) -# LOCAL local_option_at_CellularAutomaton_internal_209 --> -840($fp) -# local_option_at_CellularAutomaton_internal_203 = local_option_at_CellularAutomaton_internal_209 -lw $t0, -840($fp) -sw $t0, -816($fp) -label_ENDIF_448: -# LOCAL local_option_at_CellularAutomaton_internal_197 --> -792($fp) -# LOCAL local_option_at_CellularAutomaton_internal_203 --> -816($fp) -# local_option_at_CellularAutomaton_internal_197 = local_option_at_CellularAutomaton_internal_203 -lw $t0, -816($fp) -sw $t0, -792($fp) -label_ENDIF_438: -# LOCAL local_option_at_CellularAutomaton_internal_191 --> -768($fp) -# LOCAL local_option_at_CellularAutomaton_internal_197 --> -792($fp) -# local_option_at_CellularAutomaton_internal_191 = local_option_at_CellularAutomaton_internal_197 -lw $t0, -792($fp) -sw $t0, -768($fp) -label_ENDIF_428: -# LOCAL local_option_at_CellularAutomaton_internal_185 --> -744($fp) -# LOCAL local_option_at_CellularAutomaton_internal_191 --> -768($fp) -# local_option_at_CellularAutomaton_internal_185 = local_option_at_CellularAutomaton_internal_191 -lw $t0, -768($fp) -sw $t0, -744($fp) -label_ENDIF_418: -# LOCAL local_option_at_CellularAutomaton_internal_179 --> -720($fp) -# LOCAL local_option_at_CellularAutomaton_internal_185 --> -744($fp) -# local_option_at_CellularAutomaton_internal_179 = local_option_at_CellularAutomaton_internal_185 -lw $t0, -744($fp) -sw $t0, -720($fp) -label_ENDIF_408: -# LOCAL local_option_at_CellularAutomaton_internal_173 --> -696($fp) -# LOCAL local_option_at_CellularAutomaton_internal_179 --> -720($fp) -# local_option_at_CellularAutomaton_internal_173 = local_option_at_CellularAutomaton_internal_179 -lw $t0, -720($fp) -sw $t0, -696($fp) -label_ENDIF_398: -# LOCAL local_option_at_CellularAutomaton_internal_167 --> -672($fp) -# LOCAL local_option_at_CellularAutomaton_internal_173 --> -696($fp) -# local_option_at_CellularAutomaton_internal_167 = local_option_at_CellularAutomaton_internal_173 -lw $t0, -696($fp) -sw $t0, -672($fp) -label_ENDIF_388: -# LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) -# LOCAL local_option_at_CellularAutomaton_internal_167 --> -672($fp) -# local_option_at_CellularAutomaton_internal_161 = local_option_at_CellularAutomaton_internal_167 -lw $t0, -672($fp) -sw $t0, -648($fp) -label_ENDIF_378: -# LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) -# LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) -# local_option_at_CellularAutomaton_internal_155 = local_option_at_CellularAutomaton_internal_161 -lw $t0, -648($fp) -sw $t0, -624($fp) -label_ENDIF_368: -# LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) -# LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) -# local_option_at_CellularAutomaton_internal_149 = local_option_at_CellularAutomaton_internal_155 -lw $t0, -624($fp) -sw $t0, -600($fp) -label_ENDIF_358: -# LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) -# LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) -# local_option_at_CellularAutomaton_internal_143 = local_option_at_CellularAutomaton_internal_149 -lw $t0, -600($fp) -sw $t0, -576($fp) -label_ENDIF_348: -# LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) -# LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) -# local_option_at_CellularAutomaton_internal_137 = local_option_at_CellularAutomaton_internal_143 -lw $t0, -576($fp) -sw $t0, -552($fp) -label_ENDIF_338: -# LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) -# LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) -# local_option_at_CellularAutomaton_internal_131 = local_option_at_CellularAutomaton_internal_137 -lw $t0, -552($fp) -sw $t0, -528($fp) -label_ENDIF_328: -# LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) -# LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) -# local_option_at_CellularAutomaton_internal_125 = local_option_at_CellularAutomaton_internal_131 -lw $t0, -528($fp) -sw $t0, -504($fp) -label_ENDIF_318: -# LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) -# LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) -# local_option_at_CellularAutomaton_internal_119 = local_option_at_CellularAutomaton_internal_125 -lw $t0, -504($fp) -sw $t0, -480($fp) -label_ENDIF_308: -# LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) -# LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) -# local_option_at_CellularAutomaton_internal_113 = local_option_at_CellularAutomaton_internal_119 -lw $t0, -480($fp) -sw $t0, -456($fp) -label_ENDIF_298: -# LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) -# LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) -# local_option_at_CellularAutomaton_internal_107 = local_option_at_CellularAutomaton_internal_113 -lw $t0, -456($fp) -sw $t0, -432($fp) -label_ENDIF_288: -# LOCAL local_option_at_CellularAutomaton_internal_101 --> -408($fp) -# LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) -# local_option_at_CellularAutomaton_internal_101 = local_option_at_CellularAutomaton_internal_107 -lw $t0, -432($fp) -sw $t0, -408($fp) -label_ENDIF_278: -# RETURN local_option_at_CellularAutomaton_internal_101 -lw $v0, -408($fp) -# Deallocate stack frame for function function_option_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 916 -jr $ra -# Function END - - -# function_prompt_at_CellularAutomaton implementation. -# @Params: -function_prompt_at_CellularAutomaton: - # Allocate stack frame for function function_prompt_at_CellularAutomaton. - subu $sp, $sp, 100 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 100 - # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_0 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -4($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_3 --> -16($fp) - # local_prompt_at_CellularAutomaton_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_3 --> -16($fp) - # local_prompt_at_CellularAutomaton_internal_1 = local_prompt_at_CellularAutomaton_internal_3 - lw $t0, -16($fp) - sw $t0, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_80 - sw $t0, 12($v0) - li $t0, 54 - sw $t0, 16($v0) - sw $v0, -20($fp) - # ARG local_prompt_at_CellularAutomaton_internal_4 - # LOCAL local_prompt_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t0, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_2 --> -12($fp) - # local_prompt_at_CellularAutomaton_internal_2 = VCALL local_prompt_at_CellularAutomaton_internal_1 out_string - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt_at_CellularAutomaton_internal_7 --> -32($fp) - # local_prompt_at_CellularAutomaton_internal_7 = SELF - sw $s1, -32($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_7 --> -32($fp) - # local_prompt_at_CellularAutomaton_internal_5 = local_prompt_at_CellularAutomaton_internal_7 - lw $t0, -32($fp) - sw $t0, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_81 - sw $t0, 12($v0) - li $t0, 49 - sw $t0, 16($v0) - sw $v0, -36($fp) - # ARG local_prompt_at_CellularAutomaton_internal_8 - # LOCAL local_prompt_at_CellularAutomaton_internal_8 --> -36($fp) - lw $t0, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_6 --> -28($fp) - # local_prompt_at_CellularAutomaton_internal_6 = VCALL local_prompt_at_CellularAutomaton_internal_5 out_string - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt_at_CellularAutomaton_internal_11 --> -48($fp) - # local_prompt_at_CellularAutomaton_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_11 --> -48($fp) - # local_prompt_at_CellularAutomaton_internal_9 = local_prompt_at_CellularAutomaton_internal_11 - lw $t0, -48($fp) - sw $t0, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_10 --> -44($fp) - # local_prompt_at_CellularAutomaton_internal_10 = VCALL local_prompt_at_CellularAutomaton_internal_9 in_string - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 0($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_10 --> -44($fp) - # local_prompt_at_CellularAutomaton_ans_0 = local_prompt_at_CellularAutomaton_internal_10 - lw $t0, -44($fp) - sw $t0, -4($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_14 --> -60($fp) - # local_prompt_at_CellularAutomaton_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_14 --> -60($fp) - # local_prompt_at_CellularAutomaton_internal_12 = local_prompt_at_CellularAutomaton_internal_14 - lw $t0, -60($fp) - sw $t0, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_82 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -64($fp) - # ARG local_prompt_at_CellularAutomaton_internal_15 - # LOCAL local_prompt_at_CellularAutomaton_internal_15 --> -64($fp) - lw $t0, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_prompt_at_CellularAutomaton_internal_12 --> -52($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_13 --> -56($fp) - # local_prompt_at_CellularAutomaton_internal_13 = VCALL local_prompt_at_CellularAutomaton_internal_12 out_string - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_83 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -84($fp) - # IF_ZERO local_prompt_at_CellularAutomaton_ans_0 GOTO label_FALSE_489 - # IF_ZERO local_prompt_at_CellularAutomaton_ans_0 GOTO label_FALSE_489 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_489 - # IF_ZERO local_prompt_at_CellularAutomaton_internal_20 GOTO label_FALSE_489 - # IF_ZERO local_prompt_at_CellularAutomaton_internal_20 GOTO label_FALSE_489 - lw $t0, -84($fp) - beq $t0, 0, label_FALSE_489 - # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) - # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -80($fp) - # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_COMPARE_STRING_492 - # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_COMPARE_STRING_492 - lw $t0, -80($fp) - beq $t0, 0, label_COMPARE_STRING_492 - # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) - # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -80($fp) - # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_493 - # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_493 - lw $t0, -80($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_493 - # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) - # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -80($fp) - # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_493 - # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_493 - lw $t0, -80($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_493 - # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) - # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -84($fp) - sub $a0, $a0, $a1 - sw $a0, -80($fp) - # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_TRUE_490 - # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_TRUE_490 - lw $t0, -80($fp) - beq $t0, 0, label_TRUE_490 - # GOTO label_FALSE_489 - j label_FALSE_489 - label_COMPARE_BY_VALUE_493: - # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) - # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) - lw $a0, -4($fp) - lw $a1, -84($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -80($fp) - # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_TRUE_490 - # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_TRUE_490 - lw $t0, -80($fp) - beq $t0, 0, label_TRUE_490 - # GOTO label_FALSE_489 - j label_FALSE_489 - label_COMPARE_STRING_492: - # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) - # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -84($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -80($fp) - # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_CONTINUE_494 - # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_CONTINUE_494 - lw $t0, -80($fp) - beq $t0, 0, label_CONTINUE_494 - # GOTO label_FALSE_489 - j label_FALSE_489 - label_CONTINUE_494: - # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) - # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -84($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_495: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_496 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_495 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_496: - # Store result - sw $a2, -80($fp) - # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_TRUE_490 - # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_TRUE_490 - lw $t0, -80($fp) - beq $t0, 0, label_TRUE_490 - label_FALSE_489: - # LOCAL local_prompt_at_CellularAutomaton_internal_18 --> -76($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -76($fp) - # GOTO label_END_491 -j label_END_491 -label_TRUE_490: - # LOCAL local_prompt_at_CellularAutomaton_internal_18 --> -76($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -76($fp) - label_END_491: -# LOCAL local_prompt_at_CellularAutomaton_internal_16 --> -68($fp) -# LOCAL local_prompt_at_CellularAutomaton_internal_18 --> -76($fp) -# Obtain value from -76($fp) -lw $v0, -76($fp) -lw $v0, 12($v0) -sw $v0, -68($fp) -# IF_ZERO local_prompt_at_CellularAutomaton_internal_16 GOTO label_FALSEIF_487 -# IF_ZERO local_prompt_at_CellularAutomaton_internal_16 GOTO label_FALSEIF_487 -lw $t0, -68($fp) -beq $t0, 0, label_FALSEIF_487 -# LOCAL local_prompt_at_CellularAutomaton_internal_21 --> -88($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -88($fp) -# LOCAL local_prompt_at_CellularAutomaton_internal_17 --> -72($fp) -# LOCAL local_prompt_at_CellularAutomaton_internal_21 --> -88($fp) -# local_prompt_at_CellularAutomaton_internal_17 = local_prompt_at_CellularAutomaton_internal_21 -lw $t0, -88($fp) -sw $t0, -72($fp) -# GOTO label_ENDIF_488 -j label_ENDIF_488 -label_FALSEIF_487: - # LOCAL local_prompt_at_CellularAutomaton_internal_22 --> -92($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -92($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_17 --> -72($fp) - # LOCAL local_prompt_at_CellularAutomaton_internal_22 --> -92($fp) - # local_prompt_at_CellularAutomaton_internal_17 = local_prompt_at_CellularAutomaton_internal_22 - lw $t0, -92($fp) - sw $t0, -72($fp) - label_ENDIF_488: -# RETURN local_prompt_at_CellularAutomaton_internal_17 -lw $v0, -72($fp) -# Deallocate stack frame for function function_prompt_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 100 -jr $ra -# Function END - - -# function_prompt2_at_CellularAutomaton implementation. -# @Params: -function_prompt2_at_CellularAutomaton: - # Allocate stack frame for function function_prompt2_at_CellularAutomaton. - subu $sp, $sp, 100 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 100 - # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_0 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -4($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_3 --> -16($fp) - # local_prompt2_at_CellularAutomaton_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_3 --> -16($fp) - # local_prompt2_at_CellularAutomaton_internal_1 = local_prompt2_at_CellularAutomaton_internal_3 - lw $t0, -16($fp) - sw $t0, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_84 - sw $t0, 12($v0) - li $t0, 2 - sw $t0, 16($v0) - sw $v0, -20($fp) - # ARG local_prompt2_at_CellularAutomaton_internal_4 - # LOCAL local_prompt2_at_CellularAutomaton_internal_4 --> -20($fp) - lw $t0, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_1 --> -8($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_2 --> -12($fp) - # local_prompt2_at_CellularAutomaton_internal_2 = VCALL local_prompt2_at_CellularAutomaton_internal_1 out_string - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt2_at_CellularAutomaton_internal_7 --> -32($fp) - # local_prompt2_at_CellularAutomaton_internal_7 = SELF - sw $s1, -32($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_7 --> -32($fp) - # local_prompt2_at_CellularAutomaton_internal_5 = local_prompt2_at_CellularAutomaton_internal_7 - lw $t0, -32($fp) - sw $t0, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_85 - sw $t0, 12($v0) - li $t0, 48 - sw $t0, 16($v0) - sw $v0, -36($fp) - # ARG local_prompt2_at_CellularAutomaton_internal_8 - # LOCAL local_prompt2_at_CellularAutomaton_internal_8 --> -36($fp) - lw $t0, -36($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_5 --> -24($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_6 --> -28($fp) - # local_prompt2_at_CellularAutomaton_internal_6 = VCALL local_prompt2_at_CellularAutomaton_internal_5 out_string - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt2_at_CellularAutomaton_internal_11 --> -48($fp) - # local_prompt2_at_CellularAutomaton_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_11 --> -48($fp) - # local_prompt2_at_CellularAutomaton_internal_9 = local_prompt2_at_CellularAutomaton_internal_11 - lw $t0, -48($fp) - sw $t0, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_12 --> -52($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_86 - sw $t0, 12($v0) - li $t0, 49 - sw $t0, 16($v0) - sw $v0, -52($fp) - # ARG local_prompt2_at_CellularAutomaton_internal_12 - # LOCAL local_prompt2_at_CellularAutomaton_internal_12 --> -52($fp) - lw $t0, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_9 --> -40($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_10 --> -44($fp) - # local_prompt2_at_CellularAutomaton_internal_10 = VCALL local_prompt2_at_CellularAutomaton_internal_9 out_string - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt2_at_CellularAutomaton_internal_15 --> -64($fp) - # local_prompt2_at_CellularAutomaton_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_15 --> -64($fp) - # local_prompt2_at_CellularAutomaton_internal_13 = local_prompt2_at_CellularAutomaton_internal_15 - lw $t0, -64($fp) - sw $t0, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_13 --> -56($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_14 --> -60($fp) - # local_prompt2_at_CellularAutomaton_internal_14 = VCALL local_prompt2_at_CellularAutomaton_internal_13 in_string - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 0($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_14 --> -60($fp) - # local_prompt2_at_CellularAutomaton_ans_0 = local_prompt2_at_CellularAutomaton_internal_14 - lw $t0, -60($fp) - sw $t0, -4($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_87 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -84($fp) - # IF_ZERO local_prompt2_at_CellularAutomaton_ans_0 GOTO label_FALSE_499 - # IF_ZERO local_prompt2_at_CellularAutomaton_ans_0 GOTO label_FALSE_499 - lw $t0, -4($fp) - beq $t0, 0, label_FALSE_499 - # IF_ZERO local_prompt2_at_CellularAutomaton_internal_20 GOTO label_FALSE_499 - # IF_ZERO local_prompt2_at_CellularAutomaton_internal_20 GOTO label_FALSE_499 - lw $t0, -84($fp) - beq $t0, 0, label_FALSE_499 - # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) - # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) - # Comparing -4($fp) type with String - la $v0, String - lw $a0, -4($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -80($fp) - # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_COMPARE_STRING_502 - # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_COMPARE_STRING_502 - lw $t0, -80($fp) - beq $t0, 0, label_COMPARE_STRING_502 - # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) - # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) - # Comparing -4($fp) type with Bool - la $v0, Bool - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -80($fp) - # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_503 - # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_503 - lw $t0, -80($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_503 - # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) - # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) - # Comparing -4($fp) type with Int - la $v0, Int - lw $a0, -4($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -80($fp) - # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_503 - # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_503 - lw $t0, -80($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_503 - # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) - # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) - # Load pointers and SUB - lw $a0, -4($fp) - lw $a1, -84($fp) - sub $a0, $a0, $a1 - sw $a0, -80($fp) - # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_TRUE_500 - # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_TRUE_500 - lw $t0, -80($fp) - beq $t0, 0, label_TRUE_500 - # GOTO label_FALSE_499 - j label_FALSE_499 - label_COMPARE_BY_VALUE_503: - # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) - # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) - lw $a0, -4($fp) - lw $a1, -84($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -80($fp) - # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_TRUE_500 - # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_TRUE_500 - lw $t0, -80($fp) - beq $t0, 0, label_TRUE_500 - # GOTO label_FALSE_499 - j label_FALSE_499 - label_COMPARE_STRING_502: - # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) - # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -84($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -80($fp) - # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_CONTINUE_504 - # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_CONTINUE_504 - lw $t0, -80($fp) - beq $t0, 0, label_CONTINUE_504 - # GOTO label_FALSE_499 - j label_FALSE_499 - label_CONTINUE_504: - # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) - # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -4($fp) - lw $v1, -84($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_505: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_506 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_505 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_506: - # Store result - sw $a2, -80($fp) - # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_TRUE_500 - # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_TRUE_500 - lw $t0, -80($fp) - beq $t0, 0, label_TRUE_500 - label_FALSE_499: - # LOCAL local_prompt2_at_CellularAutomaton_internal_18 --> -76($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -76($fp) - # GOTO label_END_501 -j label_END_501 -label_TRUE_500: - # LOCAL local_prompt2_at_CellularAutomaton_internal_18 --> -76($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -76($fp) - label_END_501: -# LOCAL local_prompt2_at_CellularAutomaton_internal_16 --> -68($fp) -# LOCAL local_prompt2_at_CellularAutomaton_internal_18 --> -76($fp) -# Obtain value from -76($fp) -lw $v0, -76($fp) -lw $v0, 12($v0) -sw $v0, -68($fp) -# IF_ZERO local_prompt2_at_CellularAutomaton_internal_16 GOTO label_FALSEIF_497 -# IF_ZERO local_prompt2_at_CellularAutomaton_internal_16 GOTO label_FALSEIF_497 -lw $t0, -68($fp) -beq $t0, 0, label_FALSEIF_497 -# LOCAL local_prompt2_at_CellularAutomaton_internal_21 --> -88($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -88($fp) -# LOCAL local_prompt2_at_CellularAutomaton_internal_17 --> -72($fp) -# LOCAL local_prompt2_at_CellularAutomaton_internal_21 --> -88($fp) -# local_prompt2_at_CellularAutomaton_internal_17 = local_prompt2_at_CellularAutomaton_internal_21 -lw $t0, -88($fp) -sw $t0, -72($fp) -# GOTO label_ENDIF_498 -j label_ENDIF_498 -label_FALSEIF_497: - # LOCAL local_prompt2_at_CellularAutomaton_internal_22 --> -92($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -92($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_17 --> -72($fp) - # LOCAL local_prompt2_at_CellularAutomaton_internal_22 --> -92($fp) - # local_prompt2_at_CellularAutomaton_internal_17 = local_prompt2_at_CellularAutomaton_internal_22 - lw $t0, -92($fp) - sw $t0, -72($fp) - label_ENDIF_498: -# RETURN local_prompt2_at_CellularAutomaton_internal_17 -lw $v0, -72($fp) -# Deallocate stack frame for function function_prompt2_at_CellularAutomaton. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 100 -jr $ra -# Function END - - -# __Main__attrib__cells__init implementation. -# @Params: -__Main__attrib__cells__init: - # Allocate stack frame for function __Main__attrib__cells__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Main__attrib__cells__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 160 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 160 - # LOCAL local_main_at_Main_continue_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_main_at_Main_choice_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_0 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -8($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = SELF - sw $s1, -20($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 - lw $t0, -20($fp) - sw $t0, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_88 - sw $t0, 12($v0) - li $t0, 29 - sw $t0, 16($v0) - sw $v0, -24($fp) - # ARG local_main_at_Main_internal_5 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - lw $t0, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = SELF - sw $s1, -36($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 - lw $t0, -36($fp) - sw $t0, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_89 - sw $t0, 12($v0) - li $t0, 47 - sw $t0, 16($v0) - sw $v0, -40($fp) - # ARG local_main_at_Main_internal_9 - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - lw $t0, -40($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_string - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 104($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - label_WHILE_507: - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_13 = SELF - sw $s1, -56($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_11 = local_main_at_Main_internal_13 - lw $t0, -56($fp) - sw $t0, -48($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_12 = VCALL local_main_at_Main_internal_11 prompt2 - # Save new self pointer in $s1 - lw $s1, -48($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 112($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -52($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # Obtain value from -52($fp) - lw $v0, -52($fp) - lw $v0, 12($v0) - sw $v0, -44($fp) - # IF_ZERO local_main_at_Main_internal_10 GOTO label_WHILE_END_508 - # IF_ZERO local_main_at_Main_internal_10 GOTO label_WHILE_END_508 - lw $t0, -44($fp) - beq $t0, 0, label_WHILE_END_508 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -60($fp) - # LOCAL local_main_at_Main_continue_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_continue_0 = local_main_at_Main_internal_14 - lw $t0, -60($fp) - sw $t0, -4($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = SELF - sw $s1, -72($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 - lw $t0, -72($fp) - sw $t0, -64($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 option - # Save new self pointer in $s1 - lw $s1, -64($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 96($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -68($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_choice_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_choice_1 = local_main_at_Main_internal_16 - lw $t0, -68($fp) - sw $t0, -8($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_20 = ALLOCATE CellularAutomaton - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, CellularAutomaton - sw $t0, 12($v0) - li $t0, 17 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 28 bytes of memory - li $a0, 28 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, CellularAutomaton_start - sw $t0, 4($v0) - # Load type offset - li $t0, 24 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Board__attrib__rows__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Board__attrib__columns__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Board__attrib__board_size__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __CellularAutomaton__attrib__population_map__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -84($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 - lw $t0, -84($fp) - sw $t0, -76($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_main_at_Main_choice_1 - # LOCAL local_main_at_Main_choice_1 --> -8($fp) - lw $t0, -8($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 init - # Save new self pointer in $s1 - lw $s1, -76($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -80($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - lw $t0, -80($fp) - sw $t0, 28($s1) - # local_main_at_Main_internal_23 = GETATTRIBUTE cells Main - # LOCAL local_main_at_Main_internal_23 --> -96($fp) - lw $t0, 28($s1) - sw $t0, -96($fp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # LOCAL local_main_at_Main_internal_23 --> -96($fp) - # local_main_at_Main_internal_21 = local_main_at_Main_internal_23 - lw $t0, -96($fp) - sw $t0, -88($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - # local_main_at_Main_internal_22 = VCALL local_main_at_Main_internal_21 print - # Save new self pointer in $s1 - lw $s1, -88($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 48($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -92($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - label_WHILE_509: - # LOCAL local_main_at_Main_internal_24 --> -100($fp) - # LOCAL local_main_at_Main_continue_0 --> -4($fp) - # Obtain value from -4($fp) - lw $v0, -4($fp) - lw $v0, 12($v0) - sw $v0, -100($fp) - # IF_ZERO local_main_at_Main_internal_24 GOTO label_WHILE_END_510 - # IF_ZERO local_main_at_Main_internal_24 GOTO label_WHILE_END_510 - lw $t0, -100($fp) - beq $t0, 0, label_WHILE_END_510 - # LOCAL local_main_at_Main_internal_29 --> -120($fp) - # local_main_at_Main_internal_29 = SELF - sw $s1, -120($fp) - # LOCAL local_main_at_Main_internal_27 --> -112($fp) - # LOCAL local_main_at_Main_internal_29 --> -120($fp) - # local_main_at_Main_internal_27 = local_main_at_Main_internal_29 - lw $t0, -120($fp) - sw $t0, -112($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_27 --> -112($fp) - # LOCAL local_main_at_Main_internal_28 --> -116($fp) - # local_main_at_Main_internal_28 = VCALL local_main_at_Main_internal_27 prompt - # Save new self pointer in $s1 - lw $s1, -112($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 28($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -116($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_25 --> -104($fp) - # LOCAL local_main_at_Main_internal_28 --> -116($fp) - # Obtain value from -116($fp) - lw $v0, -116($fp) - lw $v0, 12($v0) - sw $v0, -104($fp) - # IF_ZERO local_main_at_Main_internal_25 GOTO label_FALSEIF_511 - # IF_ZERO local_main_at_Main_internal_25 GOTO label_FALSEIF_511 - lw $t0, -104($fp) - beq $t0, 0, label_FALSEIF_511 - # local_main_at_Main_internal_32 = GETATTRIBUTE cells Main - # LOCAL local_main_at_Main_internal_32 --> -132($fp) - lw $t0, 28($s1) - sw $t0, -132($fp) - # LOCAL local_main_at_Main_internal_30 --> -124($fp) - # LOCAL local_main_at_Main_internal_32 --> -132($fp) - # local_main_at_Main_internal_30 = local_main_at_Main_internal_32 - lw $t0, -132($fp) - sw $t0, -124($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_30 --> -124($fp) - # LOCAL local_main_at_Main_internal_31 --> -128($fp) - # local_main_at_Main_internal_31 = VCALL local_main_at_Main_internal_30 evolve - # Save new self pointer in $s1 - lw $s1, -124($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 44($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -128($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_main_at_Main_internal_35 = GETATTRIBUTE cells Main - # LOCAL local_main_at_Main_internal_35 --> -144($fp) - lw $t0, 28($s1) - sw $t0, -144($fp) - # LOCAL local_main_at_Main_internal_33 --> -136($fp) - # LOCAL local_main_at_Main_internal_35 --> -144($fp) - # local_main_at_Main_internal_33 = local_main_at_Main_internal_35 - lw $t0, -144($fp) - sw $t0, -136($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_33 --> -136($fp) - # LOCAL local_main_at_Main_internal_34 --> -140($fp) - # local_main_at_Main_internal_34 = VCALL local_main_at_Main_internal_33 print - # Save new self pointer in $s1 - lw $s1, -136($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 48($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -140($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_26 --> -108($fp) - # LOCAL local_main_at_Main_internal_34 --> -140($fp) - # local_main_at_Main_internal_26 = local_main_at_Main_internal_34 - lw $t0, -140($fp) - sw $t0, -108($fp) - # GOTO label_ENDIF_512 -j label_ENDIF_512 -label_FALSEIF_511: - # LOCAL local_main_at_Main_internal_36 --> -148($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -148($fp) - # LOCAL local_main_at_Main_continue_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_36 --> -148($fp) - # local_main_at_Main_continue_0 = local_main_at_Main_internal_36 - lw $t0, -148($fp) - sw $t0, -4($fp) - # LOCAL local_main_at_Main_internal_26 --> -108($fp) - # local_main_at_Main_internal_26 = - label_ENDIF_512: -# GOTO label_WHILE_509 -j label_WHILE_509 -label_WHILE_END_510: - # GOTO label_WHILE_507 - j label_WHILE_507 - label_WHILE_END_508: - # LOCAL local_main_at_Main_internal_37 --> -152($fp) - # local_main_at_Main_internal_37 = SELF - sw $s1, -152($fp) - # RETURN local_main_at_Main_internal_37 - lw $v0, -152($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 160 - jr $ra - # Function END - diff --git a/tests/codegen/list.mips b/tests/codegen/list.mips deleted file mode 100644 index e52d078d..00000000 --- a/tests/codegen/list.mips +++ /dev/null @@ -1,2109 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:13 2020 -# School of Math and Computer Science, University of Havana -# - -.data -dummy: .word 0 -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Int: .asciiz "Int" -# Function END -List: .asciiz "List" -# Function END -Cons: .asciiz "Cons" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word dummy, function_in_string_at_IO, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, function_out_string_at_IO, function_type_name_at_Object, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, function_out_int_at_IO, dummy -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, function_concat_at_String, function_length_at_String, dummy, dummy, dummy, dummy, dummy, function_substr_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Int **** -Int_start: - Int_vtable_pointer: .word Int_vtable - # Function END -Int_end: -# - - -# **** VTABLE for type List **** -List_vtable: .word function_isNil_at_List, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, function_cons_at_List, dummy, function_type_name_at_Object, dummy, dummy, function_head_at_List, dummy, dummy, function_tail_at_List, dummy, dummy -# Function END -# - - -# **** Type RECORD for type List **** -List_start: - List_vtable_pointer: .word List_vtable - # Function END -List_end: -# - - -# **** VTABLE for type Cons **** -Cons_vtable: .word function_isNil_at_Cons, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, function_cons_at_List, dummy, function_type_name_at_Object, dummy, dummy, function_head_at_Cons, dummy, function_init_at_Cons, function_tail_at_Cons, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Cons **** -Cons_start: - Cons_vtable_pointer: .word Cons_vtable - # Function END -Cons_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word dummy, function_in_string_at_IO, function_abort_at_Object, function_print_list_at_Main, function_main_at_Main, function_copy_at_Object, dummy, function_out_string_at_IO, function_type_name_at_Object, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, function_out_int_at_IO, dummy -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 1, 2, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1 -List__TDT: .word -1, -1, -1, -1, -1, 0, 1, -1 -Cons__TDT: .word -1, -1, -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz "\n" -# - - -data_5: .asciiz " " -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - move $a2, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - sw $a2, 12($v0) - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - lw $t2, 12($t2) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - lw $a0, 12($a0) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # LOCAL local_length_at_String_internal_1 --> -8($fp) - # LOCAL local_length_at_String_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -4($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_length_at_String_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Main - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - # Load type offset - li $t0, 28 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__mylist__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t0, Main_vtable - # Get pointer to function address - lw $t1, 16($t0) - # Call function. Result is on $v0 - jalr $t1 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_List implementation. -# @Params: -function_isNil_at_List: - # Allocate stack frame for function function_isNil_at_List. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_List_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_isNil_at_List_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_isNil_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_head_at_List implementation. -# @Params: -function_head_at_List: - # Allocate stack frame for function function_head_at_List. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_head_at_List_internal_2 --> -12($fp) - # local_head_at_List_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_head_at_List_internal_0 --> -4($fp) - # LOCAL local_head_at_List_internal_2 --> -12($fp) - # local_head_at_List_internal_0 = local_head_at_List_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_head_at_List_internal_0 --> -4($fp) - # LOCAL local_head_at_List_internal_1 --> -8($fp) - # local_head_at_List_internal_1 = VCALL local_head_at_List_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 8($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_head_at_List_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -16($fp) - # RETURN local_head_at_List_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_head_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_tail_at_List implementation. -# @Params: -function_tail_at_List: - # Allocate stack frame for function function_tail_at_List. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_tail_at_List_internal_2 --> -12($fp) - # local_tail_at_List_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_tail_at_List_internal_0 --> -4($fp) - # LOCAL local_tail_at_List_internal_2 --> -12($fp) - # local_tail_at_List_internal_0 = local_tail_at_List_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_tail_at_List_internal_0 --> -4($fp) - # LOCAL local_tail_at_List_internal_1 --> -8($fp) - # local_tail_at_List_internal_1 = VCALL local_tail_at_List_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 8($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_tail_at_List_internal_3 --> -16($fp) - # local_tail_at_List_internal_3 = SELF - sw $s1, -16($fp) - # RETURN local_tail_at_List_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_tail_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cons_at_List implementation. -# @Params: -# 0($fp) = param_cons_at_List_i_0 -function_cons_at_List: - # Allocate stack frame for function function_cons_at_List. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_cons_at_List_internal_2 --> -12($fp) - # local_cons_at_List_internal_2 = ALLOCATE Cons - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Cons - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Cons_start - sw $t0, 4($v0) - # Load type offset - li $t0, 24 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Cons__attrib__car__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Cons__attrib__cdr__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -12($fp) - # LOCAL local_cons_at_List_internal_0 --> -4($fp) - # LOCAL local_cons_at_List_internal_2 --> -12($fp) - # local_cons_at_List_internal_0 = local_cons_at_List_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cons_at_List_i_0 - # PARAM param_cons_at_List_i_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cons_at_List_internal_3 --> -16($fp) - # local_cons_at_List_internal_3 = SELF - sw $s1, -16($fp) - # ARG local_cons_at_List_internal_3 - # LOCAL local_cons_at_List_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cons_at_List_internal_0 --> -4($fp) - # LOCAL local_cons_at_List_internal_1 --> -8($fp) - # local_cons_at_List_internal_1 = VCALL local_cons_at_List_internal_0 init - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 52($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_cons_at_List_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_cons_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# __Cons__attrib__car__init implementation. -# @Params: -__Cons__attrib__car__init: - # Allocate stack frame for function __Cons__attrib__car__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__car__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__car__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Cons__attrib__car__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Cons__attrib__cdr__init implementation. -# @Params: -__Cons__attrib__cdr__init: - # Allocate stack frame for function __Cons__attrib__cdr__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Cons__attrib__cdr__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_Cons implementation. -# @Params: -function_isNil_at_Cons: - # Allocate stack frame for function function_isNil_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_Cons_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_isNil_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_isNil_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_head_at_Cons implementation. -# @Params: -function_head_at_Cons: - # Allocate stack frame for function function_head_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_head_at_Cons_internal_0 = GETATTRIBUTE car Cons - # LOCAL local_head_at_Cons_internal_0 --> -4($fp) - lw $t0, 12($s1) - sw $t0, -4($fp) - # RETURN local_head_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_head_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_tail_at_Cons implementation. -# @Params: -function_tail_at_Cons: - # Allocate stack frame for function function_tail_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_tail_at_Cons_internal_0 = GETATTRIBUTE cdr Cons - # LOCAL local_tail_at_Cons_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_tail_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_tail_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_Cons implementation. -# @Params: -# 0($fp) = param_init_at_Cons_i_0 -# 4($fp) = param_init_at_Cons_rest_1 -function_init_at_Cons: - # Allocate stack frame for function function_init_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_Cons_i_0 --> 4($fp) - lw $t0, 4($fp) - sw $t0, 12($s1) - # - # PARAM param_init_at_Cons_rest_1 --> 0($fp) - lw $t0, 0($fp) - sw $t0, 16($s1) - # LOCAL local_init_at_Cons_internal_0 --> -4($fp) - # local_init_at_Cons_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_init_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_init_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# __Main__attrib__mylist__init implementation. -# @Params: -__Main__attrib__mylist__init: - # Allocate stack frame for function __Main__attrib__mylist__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Main__attrib__mylist__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_print_list_at_Main implementation. -# @Params: -# 0($fp) = param_print_list_at_Main_l_0 -function_print_list_at_Main: - # Allocate stack frame for function function_print_list_at_Main. - subu $sp, $sp, 96 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 96 - # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) - # PARAM param_print_list_at_Main_l_0 --> 0($fp) - # local_print_list_at_Main_internal_2 = PARAM param_print_list_at_Main_l_0 - lw $t0, 0($fp) - sw $t0, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) - # LOCAL local_print_list_at_Main_internal_3 --> -16($fp) - # local_print_list_at_Main_internal_3 = VCALL local_print_list_at_Main_internal_2 isNil - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 0($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) - # LOCAL local_print_list_at_Main_internal_3 --> -16($fp) - # Obtain value from -16($fp) - lw $v0, -16($fp) - lw $v0, 12($v0) - sw $v0, -4($fp) - # IF_ZERO local_print_list_at_Main_internal_0 GOTO label_FALSEIF_1 - # IF_ZERO local_print_list_at_Main_internal_0 GOTO label_FALSEIF_1 - lw $t0, -4($fp) - beq $t0, 0, label_FALSEIF_1 - # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) - # local_print_list_at_Main_internal_6 = SELF - sw $s1, -28($fp) - # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) - # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) - # local_print_list_at_Main_internal_4 = local_print_list_at_Main_internal_6 - lw $t0, -28($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_7 --> -32($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_4 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -32($fp) - # ARG local_print_list_at_Main_internal_7 - # LOCAL local_print_list_at_Main_internal_7 --> -32($fp) - lw $t0, -32($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) - # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) - # local_print_list_at_Main_internal_5 = VCALL local_print_list_at_Main_internal_4 out_string - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 28($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_list_at_Main_internal_1 --> -8($fp) - # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) - # local_print_list_at_Main_internal_1 = local_print_list_at_Main_internal_5 - lw $t0, -24($fp) - sw $t0, -8($fp) - # GOTO label_ENDIF_2 -j label_ENDIF_2 -label_FALSEIF_1: - # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) - # local_print_list_at_Main_internal_10 = SELF - sw $s1, -44($fp) - # LOCAL local_print_list_at_Main_internal_8 --> -36($fp) - # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) - # local_print_list_at_Main_internal_8 = local_print_list_at_Main_internal_10 - lw $t0, -44($fp) - sw $t0, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) - # PARAM param_print_list_at_Main_l_0 --> 0($fp) - # local_print_list_at_Main_internal_11 = PARAM param_print_list_at_Main_l_0 - lw $t0, 0($fp) - sw $t0, -48($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) - # LOCAL local_print_list_at_Main_internal_12 --> -52($fp) - # local_print_list_at_Main_internal_12 = VCALL local_print_list_at_Main_internal_11 head - # Save new self pointer in $s1 - lw $s1, -48($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 44($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -52($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_print_list_at_Main_internal_12 - # LOCAL local_print_list_at_Main_internal_12 --> -52($fp) - lw $t0, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_list_at_Main_internal_8 --> -36($fp) - # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) - # local_print_list_at_Main_internal_9 = VCALL local_print_list_at_Main_internal_8 out_int - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 60($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) - # local_print_list_at_Main_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_print_list_at_Main_internal_13 --> -56($fp) - # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) - # local_print_list_at_Main_internal_13 = local_print_list_at_Main_internal_15 - lw $t0, -64($fp) - sw $t0, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_5 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -68($fp) - # ARG local_print_list_at_Main_internal_16 - # LOCAL local_print_list_at_Main_internal_16 --> -68($fp) - lw $t0, -68($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_list_at_Main_internal_13 --> -56($fp) - # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) - # local_print_list_at_Main_internal_14 = VCALL local_print_list_at_Main_internal_13 out_string - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 28($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) - # local_print_list_at_Main_internal_19 = SELF - sw $s1, -80($fp) - # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) - # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) - # local_print_list_at_Main_internal_17 = local_print_list_at_Main_internal_19 - lw $t0, -80($fp) - sw $t0, -72($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_20 --> -84($fp) - # PARAM param_print_list_at_Main_l_0 --> 0($fp) - # local_print_list_at_Main_internal_20 = PARAM param_print_list_at_Main_l_0 - lw $t0, 0($fp) - sw $t0, -84($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Main_internal_20 --> -84($fp) - # LOCAL local_print_list_at_Main_internal_21 --> -88($fp) - # local_print_list_at_Main_internal_21 = VCALL local_print_list_at_Main_internal_20 tail - # Save new self pointer in $s1 - lw $s1, -84($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 56($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -88($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_print_list_at_Main_internal_21 - # LOCAL local_print_list_at_Main_internal_21 --> -88($fp) - lw $t0, -88($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) - # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) - # local_print_list_at_Main_internal_18 = VCALL local_print_list_at_Main_internal_17 print_list - # Save new self pointer in $s1 - lw $s1, -72($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 12($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -76($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_list_at_Main_internal_1 --> -8($fp) - # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) - # local_print_list_at_Main_internal_1 = local_print_list_at_Main_internal_18 - lw $t0, -76($fp) - sw $t0, -8($fp) - label_ENDIF_2: -# RETURN local_print_list_at_Main_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_print_list_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 96 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 120 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 120 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_10 = ALLOCATE List - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, List - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, List_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -44($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_8 = local_main_at_Main_internal_10 - lw $t0, -44($fp) - sw $t0, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -48($fp) - # ARG local_main_at_Main_internal_11 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - lw $t0, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 cons - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 24($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_9 - lw $t0, -40($fp) - sw $t0, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 2 - sw $t0, 12($v0) - sw $v0, -52($fp) - # ARG local_main_at_Main_internal_12 - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - lw $t0, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 cons - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 24($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_4 = local_main_at_Main_internal_7 - lw $t0, -32($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 3 - sw $t0, 12($v0) - sw $v0, -56($fp) - # ARG local_main_at_Main_internal_13 - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - lw $t0, -56($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 cons - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 24($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_2 = local_main_at_Main_internal_5 - lw $t0, -24($fp) - sw $t0, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 4 - sw $t0, 12($v0) - sw $v0, -60($fp) - # ARG local_main_at_Main_internal_14 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - lw $t0, -60($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 cons - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 24($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 - lw $t0, -16($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 5 - sw $t0, 12($v0) - sw $v0, -64($fp) - # ARG local_main_at_Main_internal_15 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - lw $t0, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 cons - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 24($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - lw $t0, -8($fp) - sw $t0, 12($s1) - label_WHILE_3: - # local_main_at_Main_internal_19 = GETATTRIBUTE mylist Main - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - lw $t0, 12($s1) - sw $t0, -80($fp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_17 = local_main_at_Main_internal_19 - lw $t0, -80($fp) - sw $t0, -72($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # local_main_at_Main_internal_18 = VCALL local_main_at_Main_internal_17 isNil - # Save new self pointer in $s1 - lw $s1, -72($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 0($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -76($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # Obtain value from -76($fp) - lw $v0, -76($fp) - lw $v0, 12($v0) - sw $v0, -76($fp) - # IF_ZERO local_main_at_Main_internal_18 GOTO label_FALSE_5 - # IF_ZERO local_main_at_Main_internal_18 GOTO label_FALSE_5 - lw $t0, -76($fp) - beq $t0, 0, label_FALSE_5 - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -84($fp) - # GOTO label_NOT_END_6 - j label_NOT_END_6 - label_FALSE_5: - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -84($fp) - label_NOT_END_6: - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # Obtain value from -84($fp) - lw $v0, -84($fp) - lw $v0, 12($v0) - sw $v0, -68($fp) - # IF_ZERO local_main_at_Main_internal_16 GOTO label_WHILE_END_4 - # IF_ZERO local_main_at_Main_internal_16 GOTO label_WHILE_END_4 - lw $t0, -68($fp) - beq $t0, 0, label_WHILE_END_4 - # LOCAL local_main_at_Main_internal_23 --> -96($fp) - # local_main_at_Main_internal_23 = SELF - sw $s1, -96($fp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # LOCAL local_main_at_Main_internal_23 --> -96($fp) - # local_main_at_Main_internal_21 = local_main_at_Main_internal_23 - lw $t0, -96($fp) - sw $t0, -88($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_main_at_Main_internal_24 = GETATTRIBUTE mylist Main - # LOCAL local_main_at_Main_internal_24 --> -100($fp) - lw $t0, 12($s1) - sw $t0, -100($fp) - # ARG local_main_at_Main_internal_24 - # LOCAL local_main_at_Main_internal_24 --> -100($fp) - lw $t0, -100($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # LOCAL local_main_at_Main_internal_22 --> -92($fp) - # local_main_at_Main_internal_22 = VCALL local_main_at_Main_internal_21 print_list - # Save new self pointer in $s1 - lw $s1, -88($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 12($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -92($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_main_at_Main_internal_27 = GETATTRIBUTE mylist Main - # LOCAL local_main_at_Main_internal_27 --> -112($fp) - lw $t0, 12($s1) - sw $t0, -112($fp) - # LOCAL local_main_at_Main_internal_25 --> -104($fp) - # LOCAL local_main_at_Main_internal_27 --> -112($fp) - # local_main_at_Main_internal_25 = local_main_at_Main_internal_27 - lw $t0, -112($fp) - sw $t0, -104($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_25 --> -104($fp) - # LOCAL local_main_at_Main_internal_26 --> -108($fp) - # local_main_at_Main_internal_26 = VCALL local_main_at_Main_internal_25 tail - # Save new self pointer in $s1 - lw $s1, -104($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 56($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -108($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_main_at_Main_internal_26 --> -108($fp) - lw $t0, -108($fp) - sw $t0, 12($s1) - # GOTO label_WHILE_3 - j label_WHILE_3 - label_WHILE_END_4: - # RETURN - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 120 - jr $ra - # Function END - diff --git a/tests/codegen/new_complex.mips b/tests/codegen/new_complex.mips deleted file mode 100644 index 808308d4..00000000 --- a/tests/codegen/new_complex.mips +++ /dev/null @@ -1,4216 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:11 2020 -# School of Math and Computer Science, University of Havana -# - -.data -dummy: .word 0 -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Int: .asciiz "Int" -# Function END -Complex: .asciiz "Complex" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_in_int_at_IO, dummy, function_out_string_at_IO, function_out_int_at_IO, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_in_string_at_IO, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_length_at_String, function_type_name_at_Object, function_concat_at_String, dummy, dummy, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, function_substr_at_String, dummy -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Int **** -Int_start: - Int_vtable_pointer: .word Int_vtable - # Function END -Int_end: -# - - -# **** VTABLE for type Complex **** -Complex_vtable: .word function_in_int_at_IO, function_equal_at_Complex, function_out_string_at_IO, function_out_int_at_IO, function_reflect_X_at_Complex, function_reflect_Y_at_Complex, dummy, function_type_name_at_Object, dummy, function_print_at_Complex, function_in_string_at_IO, function_abort_at_Object, function_init_at_Complex, function_copy_at_Object, dummy, function_y_value_at_Complex, function_x_value_at_Complex, dummy, function_reflect_0_at_Complex -# Function END -# - - -# **** Type RECORD for type Complex **** -Complex_start: - Complex_vtable_pointer: .word Complex_vtable - # Function END -Complex_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_in_int_at_IO, dummy, function_out_string_at_IO, function_out_int_at_IO, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_in_string_at_IO, function_abort_at_Object, dummy, function_copy_at_Object, function_main_at_Main, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, 1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 2, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1, -1 -Complex__TDT: .word -1, -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz "+" -# - - -data_5: .asciiz "I" -# - - -data_6: .asciiz "=)\n" -# - - -data_7: .asciiz "=(\n" -# - - -data_8: .asciiz "=)\n" -# - - -data_9: .asciiz "=(\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - move $a2, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - sw $a2, 12($v0) - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - lw $t2, 12($t2) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - lw $a0, 12($a0) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # LOCAL local_length_at_String_internal_1 --> -8($fp) - # LOCAL local_length_at_String_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -4($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_length_at_String_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Main - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - # Load type offset - li $t0, 24 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t0, Main_vtable - # Get pointer to function address - lw $t1, 56($t0) - # Call function. Result is on $v0 - jalr $t1 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Complex__attrib__x__init implementation. -# @Params: -__Complex__attrib__x__init: - # Allocate stack frame for function __Complex__attrib__x__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local___attrib__x__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local___attrib__x__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Complex__attrib__x__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Complex__attrib__y__init implementation. -# @Params: -__Complex__attrib__y__init: - # Allocate stack frame for function __Complex__attrib__y__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local___attrib__y__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local___attrib__y__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Complex__attrib__y__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_Complex implementation. -# @Params: -# 0($fp) = param_init_at_Complex_a_0 -# 4($fp) = param_init_at_Complex_b_1 -function_init_at_Complex: - # Allocate stack frame for function function_init_at_Complex. - subu $sp, $sp, 36 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 36 - # local_init_at_Complex_internal_2 = GETATTRIBUTE x Complex - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - lw $t0, 12($s1) - sw $t0, -12($fp) - # IF_ZERO local_init_at_Complex_internal_2 GOTO label_FALSE_1 - # IF_ZERO local_init_at_Complex_internal_2 GOTO label_FALSE_1 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_1 - # IF_ZERO param_init_at_Complex_a_0 GOTO label_FALSE_1 - # IF_ZERO param_init_at_Complex_a_0 GOTO label_FALSE_1 - lw $t0, 4($fp) - beq $t0, 0, label_FALSE_1 - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with String - la $v0, String - lw $a0, -12($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_STRING_4 - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_STRING_4 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_STRING_4 - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with Bool - la $v0, Bool - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_5 - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with Int - la $v0, Int - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_5 - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # PARAM param_init_at_Complex_a_0 --> 4($fp) - # Load pointers and SUB - lw $a0, -12($fp) - lw $a1, 4($fp) - sub $a0, $a0, $a1 - sw $a0, -8($fp) - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_2 - # GOTO label_FALSE_1 - j label_FALSE_1 - label_COMPARE_BY_VALUE_5: - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # PARAM param_init_at_Complex_a_0 --> 4($fp) - lw $a0, -12($fp) - lw $a1, 4($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -8($fp) - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_2 - # GOTO label_FALSE_1 - j label_FALSE_1 - label_COMPARE_STRING_4: - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # PARAM param_init_at_Complex_a_0 --> 4($fp) - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, 4($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -8($fp) - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_CONTINUE_6 - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_CONTINUE_6 - lw $t0, -8($fp) - beq $t0, 0, label_CONTINUE_6 - # GOTO label_FALSE_1 - j label_FALSE_1 - label_CONTINUE_6: - # LOCAL local_init_at_Complex_internal_1 --> -8($fp) - # LOCAL local_init_at_Complex_internal_2 --> -12($fp) - # PARAM param_init_at_Complex_a_0 --> 4($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, 4($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_7: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_8 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_7 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_8: - # Store result - sw $a2, -8($fp) - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 - # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_2 - label_FALSE_1: - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # GOTO label_END_3 -j label_END_3 -label_TRUE_2: - # LOCAL local_init_at_Complex_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -4($fp) - label_END_3: -# local_init_at_Complex_internal_5 = GETATTRIBUTE y Complex -# LOCAL local_init_at_Complex_internal_5 --> -24($fp) -lw $t0, 16($s1) -sw $t0, -24($fp) -# IF_ZERO local_init_at_Complex_internal_5 GOTO label_FALSE_9 -# IF_ZERO local_init_at_Complex_internal_5 GOTO label_FALSE_9 -lw $t0, -24($fp) -beq $t0, 0, label_FALSE_9 -# IF_ZERO param_init_at_Complex_b_1 GOTO label_FALSE_9 -# IF_ZERO param_init_at_Complex_b_1 GOTO label_FALSE_9 -lw $t0, 0($fp) -beq $t0, 0, label_FALSE_9 -# LOCAL local_init_at_Complex_internal_4 --> -20($fp) -# LOCAL local_init_at_Complex_internal_5 --> -24($fp) -# Comparing -24($fp) type with String -la $v0, String -lw $a0, -24($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -20($fp) -# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_STRING_12 -# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_STRING_12 -lw $t0, -20($fp) -beq $t0, 0, label_COMPARE_STRING_12 -# LOCAL local_init_at_Complex_internal_4 --> -20($fp) -# LOCAL local_init_at_Complex_internal_5 --> -24($fp) -# Comparing -24($fp) type with Bool -la $v0, Bool -lw $a0, -24($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -20($fp) -# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 -# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 -lw $t0, -20($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_13 -# LOCAL local_init_at_Complex_internal_4 --> -20($fp) -# LOCAL local_init_at_Complex_internal_5 --> -24($fp) -# Comparing -24($fp) type with Int -la $v0, Int -lw $a0, -24($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -20($fp) -# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 -# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 -lw $t0, -20($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_13 -# LOCAL local_init_at_Complex_internal_4 --> -20($fp) -# LOCAL local_init_at_Complex_internal_5 --> -24($fp) -# PARAM param_init_at_Complex_b_1 --> 0($fp) -# Load pointers and SUB -lw $a0, -24($fp) -lw $a1, 0($fp) -sub $a0, $a0, $a1 -sw $a0, -20($fp) -# IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 -# IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 -lw $t0, -20($fp) -beq $t0, 0, label_TRUE_10 -# GOTO label_FALSE_9 -j label_FALSE_9 -label_COMPARE_BY_VALUE_13: - # LOCAL local_init_at_Complex_internal_4 --> -20($fp) - # LOCAL local_init_at_Complex_internal_5 --> -24($fp) - # PARAM param_init_at_Complex_b_1 --> 0($fp) - lw $a0, -24($fp) - lw $a1, 0($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -20($fp) - # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 - # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 - lw $t0, -20($fp) - beq $t0, 0, label_TRUE_10 - # GOTO label_FALSE_9 - j label_FALSE_9 - label_COMPARE_STRING_12: - # LOCAL local_init_at_Complex_internal_4 --> -20($fp) - # LOCAL local_init_at_Complex_internal_5 --> -24($fp) - # PARAM param_init_at_Complex_b_1 --> 0($fp) - # Load strings for comparison - lw $v0, -24($fp) - lw $v1, 0($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -20($fp) - # IF_ZERO local_init_at_Complex_internal_4 GOTO label_CONTINUE_14 - # IF_ZERO local_init_at_Complex_internal_4 GOTO label_CONTINUE_14 - lw $t0, -20($fp) - beq $t0, 0, label_CONTINUE_14 - # GOTO label_FALSE_9 - j label_FALSE_9 - label_CONTINUE_14: - # LOCAL local_init_at_Complex_internal_4 --> -20($fp) - # LOCAL local_init_at_Complex_internal_5 --> -24($fp) - # PARAM param_init_at_Complex_b_1 --> 0($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -24($fp) - lw $v1, 0($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_15: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_16 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_15 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_16: - # Store result - sw $a2, -20($fp) - # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 - # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 - lw $t0, -20($fp) - beq $t0, 0, label_TRUE_10 - label_FALSE_9: - # LOCAL local_init_at_Complex_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -16($fp) - # GOTO label_END_11 -j label_END_11 -label_TRUE_10: - # LOCAL local_init_at_Complex_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -16($fp) - label_END_11: -# LOCAL local_init_at_Complex_internal_6 --> -28($fp) -# local_init_at_Complex_internal_6 = SELF -sw $s1, -28($fp) -# RETURN local_init_at_Complex_internal_6 -lw $v0, -28($fp) -# Deallocate stack frame for function function_init_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 36 -# Deallocate function args -addu $sp, $sp, 8 -jr $ra -# Function END - - -# function_print_at_Complex implementation. -# @Params: -function_print_at_Complex: - # Allocate stack frame for function function_print_at_Complex. - subu $sp, $sp, 100 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 100 - # local_print_at_Complex_internal_4 = GETATTRIBUTE y Complex - # LOCAL local_print_at_Complex_internal_4 --> -20($fp) - lw $t0, 16($s1) - sw $t0, -20($fp) - # LOCAL local_print_at_Complex_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -24($fp) - # IF_ZERO local_print_at_Complex_internal_4 GOTO label_FALSE_19 - # IF_ZERO local_print_at_Complex_internal_4 GOTO label_FALSE_19 - lw $t0, -20($fp) - beq $t0, 0, label_FALSE_19 - # IF_ZERO local_print_at_Complex_internal_5 GOTO label_FALSE_19 - # IF_ZERO local_print_at_Complex_internal_5 GOTO label_FALSE_19 - lw $t0, -24($fp) - beq $t0, 0, label_FALSE_19 - # LOCAL local_print_at_Complex_internal_3 --> -16($fp) - # LOCAL local_print_at_Complex_internal_4 --> -20($fp) - # Comparing -20($fp) type with String - la $v0, String - lw $a0, -20($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_STRING_22 - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_STRING_22 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_22 - # LOCAL local_print_at_Complex_internal_3 --> -16($fp) - # LOCAL local_print_at_Complex_internal_4 --> -20($fp) - # Comparing -20($fp) type with Bool - la $v0, Bool - lw $a0, -20($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_23 - # LOCAL local_print_at_Complex_internal_3 --> -16($fp) - # LOCAL local_print_at_Complex_internal_4 --> -20($fp) - # Comparing -20($fp) type with Int - la $v0, Int - lw $a0, -20($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_23 - # LOCAL local_print_at_Complex_internal_3 --> -16($fp) - # LOCAL local_print_at_Complex_internal_4 --> -20($fp) - # LOCAL local_print_at_Complex_internal_5 --> -24($fp) - # Load pointers and SUB - lw $a0, -20($fp) - lw $a1, -24($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_20 - # GOTO label_FALSE_19 - j label_FALSE_19 - label_COMPARE_BY_VALUE_23: - # LOCAL local_print_at_Complex_internal_3 --> -16($fp) - # LOCAL local_print_at_Complex_internal_4 --> -20($fp) - # LOCAL local_print_at_Complex_internal_5 --> -24($fp) - lw $a0, -20($fp) - lw $a1, -24($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_20 - # GOTO label_FALSE_19 - j label_FALSE_19 - label_COMPARE_STRING_22: - # LOCAL local_print_at_Complex_internal_3 --> -16($fp) - # LOCAL local_print_at_Complex_internal_4 --> -20($fp) - # LOCAL local_print_at_Complex_internal_5 --> -24($fp) - # Load strings for comparison - lw $v0, -20($fp) - lw $v1, -24($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_CONTINUE_24 - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_CONTINUE_24 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_24 - # GOTO label_FALSE_19 - j label_FALSE_19 - label_CONTINUE_24: - # LOCAL local_print_at_Complex_internal_3 --> -16($fp) - # LOCAL local_print_at_Complex_internal_4 --> -20($fp) - # LOCAL local_print_at_Complex_internal_5 --> -24($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -20($fp) - lw $v1, -24($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_25: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_26 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_25 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_26: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 - # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_20 - label_FALSE_19: - # LOCAL local_print_at_Complex_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_21 -j label_END_21 -label_TRUE_20: - # LOCAL local_print_at_Complex_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_21: -# LOCAL local_print_at_Complex_internal_0 --> -4($fp) -# LOCAL local_print_at_Complex_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_print_at_Complex_internal_0 GOTO label_FALSEIF_17 -# IF_ZERO local_print_at_Complex_internal_0 GOTO label_FALSEIF_17 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_17 -# LOCAL local_print_at_Complex_internal_8 --> -36($fp) -# local_print_at_Complex_internal_8 = SELF -sw $s1, -36($fp) -# LOCAL local_print_at_Complex_internal_6 --> -28($fp) -# LOCAL local_print_at_Complex_internal_8 --> -36($fp) -# local_print_at_Complex_internal_6 = local_print_at_Complex_internal_8 -lw $t0, -36($fp) -sw $t0, -28($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_print_at_Complex_internal_9 = GETATTRIBUTE x Complex -# LOCAL local_print_at_Complex_internal_9 --> -40($fp) -lw $t0, 12($s1) -sw $t0, -40($fp) -# ARG local_print_at_Complex_internal_9 -# LOCAL local_print_at_Complex_internal_9 --> -40($fp) -lw $t0, -40($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_print_at_Complex_internal_6 --> -28($fp) -# LOCAL local_print_at_Complex_internal_7 --> -32($fp) -# local_print_at_Complex_internal_7 = VCALL local_print_at_Complex_internal_6 out_int -# Save new self pointer in $s1 -lw $s1, -28($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 12($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -32($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_print_at_Complex_internal_1 --> -8($fp) -# LOCAL local_print_at_Complex_internal_7 --> -32($fp) -# local_print_at_Complex_internal_1 = local_print_at_Complex_internal_7 -lw $t0, -32($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_18 -j label_ENDIF_18 -label_FALSEIF_17: - # LOCAL local_print_at_Complex_internal_18 --> -76($fp) - # local_print_at_Complex_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_print_at_Complex_internal_16 --> -68($fp) - # LOCAL local_print_at_Complex_internal_18 --> -76($fp) - # local_print_at_Complex_internal_16 = local_print_at_Complex_internal_18 - lw $t0, -76($fp) - sw $t0, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Complex_internal_19 = GETATTRIBUTE x Complex - # LOCAL local_print_at_Complex_internal_19 --> -80($fp) - lw $t0, 12($s1) - sw $t0, -80($fp) - # ARG local_print_at_Complex_internal_19 - # LOCAL local_print_at_Complex_internal_19 --> -80($fp) - lw $t0, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Complex_internal_16 --> -68($fp) - # LOCAL local_print_at_Complex_internal_17 --> -72($fp) - # local_print_at_Complex_internal_17 = VCALL local_print_at_Complex_internal_16 out_int - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 12($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_14 --> -60($fp) - # LOCAL local_print_at_Complex_internal_17 --> -72($fp) - # local_print_at_Complex_internal_14 = local_print_at_Complex_internal_17 - lw $t0, -72($fp) - sw $t0, -60($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Complex_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_4 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -84($fp) - # ARG local_print_at_Complex_internal_20 - # LOCAL local_print_at_Complex_internal_20 --> -84($fp) - lw $t0, -84($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Complex_internal_14 --> -60($fp) - # LOCAL local_print_at_Complex_internal_15 --> -64($fp) - # local_print_at_Complex_internal_15 = VCALL local_print_at_Complex_internal_14 out_string - # Save new self pointer in $s1 - lw $s1, -60($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 8($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -64($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_12 --> -52($fp) - # LOCAL local_print_at_Complex_internal_15 --> -64($fp) - # local_print_at_Complex_internal_12 = local_print_at_Complex_internal_15 - lw $t0, -64($fp) - sw $t0, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Complex_internal_21 = GETATTRIBUTE y Complex - # LOCAL local_print_at_Complex_internal_21 --> -88($fp) - lw $t0, 16($s1) - sw $t0, -88($fp) - # ARG local_print_at_Complex_internal_21 - # LOCAL local_print_at_Complex_internal_21 --> -88($fp) - lw $t0, -88($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Complex_internal_12 --> -52($fp) - # LOCAL local_print_at_Complex_internal_13 --> -56($fp) - # local_print_at_Complex_internal_13 = VCALL local_print_at_Complex_internal_12 out_int - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 12($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_10 --> -44($fp) - # LOCAL local_print_at_Complex_internal_13 --> -56($fp) - # local_print_at_Complex_internal_10 = local_print_at_Complex_internal_13 - lw $t0, -56($fp) - sw $t0, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Complex_internal_22 --> -92($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_5 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -92($fp) - # ARG local_print_at_Complex_internal_22 - # LOCAL local_print_at_Complex_internal_22 --> -92($fp) - lw $t0, -92($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Complex_internal_10 --> -44($fp) - # LOCAL local_print_at_Complex_internal_11 --> -48($fp) - # local_print_at_Complex_internal_11 = VCALL local_print_at_Complex_internal_10 out_string - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 8($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Complex_internal_1 --> -8($fp) - # LOCAL local_print_at_Complex_internal_11 --> -48($fp) - # local_print_at_Complex_internal_1 = local_print_at_Complex_internal_11 - lw $t0, -48($fp) - sw $t0, -8($fp) - label_ENDIF_18: -# RETURN local_print_at_Complex_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_print_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 100 -jr $ra -# Function END - - -# function_reflect_0_at_Complex implementation. -# @Params: -function_reflect_0_at_Complex: - # Allocate stack frame for function function_reflect_0_at_Complex. - subu $sp, $sp, 52 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 52 - # local_reflect_0_at_Complex_internal_2 = GETATTRIBUTE x Complex - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - lw $t0, 12($s1) - sw $t0, -12($fp) - # local_reflect_0_at_Complex_internal_4 = GETATTRIBUTE x Complex - # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) - lw $t0, 12($s1) - sw $t0, -20($fp) - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) - lw $t0, -20($fp) - lw $t0, 12($t0) - not $t0, $t0 - add $t0, $t0, 1 - sw $t0, -16($fp) - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -16($fp) - sw $t0, 12($v0) - sw $v0, -16($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_2 GOTO label_FALSE_27 - # IF_ZERO local_reflect_0_at_Complex_internal_2 GOTO label_FALSE_27 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_27 - # IF_ZERO local_reflect_0_at_Complex_internal_3 GOTO label_FALSE_27 - # IF_ZERO local_reflect_0_at_Complex_internal_3 GOTO label_FALSE_27 - lw $t0, -16($fp) - beq $t0, 0, label_FALSE_27 - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with String - la $v0, String - lw $a0, -12($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_STRING_30 - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_STRING_30 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_STRING_30 - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with Bool - la $v0, Bool - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_31 - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with Int - la $v0, Int - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_31 - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - # Load pointers and SUB - lw $a0, -12($fp) - lw $a1, -16($fp) - sub $a0, $a0, $a1 - sw $a0, -8($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_28 - # GOTO label_FALSE_27 - j label_FALSE_27 - label_COMPARE_BY_VALUE_31: - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - lw $a0, -12($fp) - lw $a1, -16($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -8($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_28 - # GOTO label_FALSE_27 - j label_FALSE_27 - label_COMPARE_STRING_30: - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, -16($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -8($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_CONTINUE_32 - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_CONTINUE_32 - lw $t0, -8($fp) - beq $t0, 0, label_CONTINUE_32 - # GOTO label_FALSE_27 - j label_FALSE_27 - label_CONTINUE_32: - # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, -16($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_33: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_34 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_33 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_34: - # Store result - sw $a2, -8($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 - # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_28 - label_FALSE_27: - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # GOTO label_END_29 -j label_END_29 -label_TRUE_28: - # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -4($fp) - label_END_29: -# local_reflect_0_at_Complex_internal_7 = GETATTRIBUTE y Complex -# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -lw $t0, 16($s1) -sw $t0, -32($fp) -# local_reflect_0_at_Complex_internal_9 = GETATTRIBUTE y Complex -# LOCAL local_reflect_0_at_Complex_internal_9 --> -40($fp) -lw $t0, 16($s1) -sw $t0, -40($fp) -# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) -# LOCAL local_reflect_0_at_Complex_internal_9 --> -40($fp) -lw $t0, -40($fp) -lw $t0, 12($t0) -not $t0, $t0 -add $t0, $t0, 1 -sw $t0, -36($fp) -# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) -# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -lw $t0, -36($fp) -sw $t0, 12($v0) -sw $v0, -36($fp) -# IF_ZERO local_reflect_0_at_Complex_internal_7 GOTO label_FALSE_35 -# IF_ZERO local_reflect_0_at_Complex_internal_7 GOTO label_FALSE_35 -lw $t0, -32($fp) -beq $t0, 0, label_FALSE_35 -# IF_ZERO local_reflect_0_at_Complex_internal_8 GOTO label_FALSE_35 -# IF_ZERO local_reflect_0_at_Complex_internal_8 GOTO label_FALSE_35 -lw $t0, -36($fp) -beq $t0, 0, label_FALSE_35 -# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) -# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -# Comparing -32($fp) type with String -la $v0, String -lw $a0, -32($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -28($fp) -# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_STRING_38 -# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_STRING_38 -lw $t0, -28($fp) -beq $t0, 0, label_COMPARE_STRING_38 -# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) -# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -# Comparing -32($fp) type with Bool -la $v0, Bool -lw $a0, -32($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -28($fp) -# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 -# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 -lw $t0, -28($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_39 -# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) -# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -# Comparing -32($fp) type with Int -la $v0, Int -lw $a0, -32($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -28($fp) -# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 -# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 -lw $t0, -28($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_39 -# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) -# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) -# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) -# Load pointers and SUB -lw $a0, -32($fp) -lw $a1, -36($fp) -sub $a0, $a0, $a1 -sw $a0, -28($fp) -# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 -# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 -lw $t0, -28($fp) -beq $t0, 0, label_TRUE_36 -# GOTO label_FALSE_35 -j label_FALSE_35 -label_COMPARE_BY_VALUE_39: - # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) - # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) - # LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) - lw $a0, -32($fp) - lw $a1, -36($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -28($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 - # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 - lw $t0, -28($fp) - beq $t0, 0, label_TRUE_36 - # GOTO label_FALSE_35 - j label_FALSE_35 - label_COMPARE_STRING_38: - # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) - # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) - # LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) - # Load strings for comparison - lw $v0, -32($fp) - lw $v1, -36($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -28($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_CONTINUE_40 - # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_CONTINUE_40 - lw $t0, -28($fp) - beq $t0, 0, label_CONTINUE_40 - # GOTO label_FALSE_35 - j label_FALSE_35 - label_CONTINUE_40: - # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) - # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) - # LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -32($fp) - lw $v1, -36($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_41: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_42 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_41 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_42: - # Store result - sw $a2, -28($fp) - # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 - # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 - lw $t0, -28($fp) - beq $t0, 0, label_TRUE_36 - label_FALSE_35: - # LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -24($fp) - # GOTO label_END_37 -j label_END_37 -label_TRUE_36: - # LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -24($fp) - label_END_37: -# LOCAL local_reflect_0_at_Complex_internal_10 --> -44($fp) -# local_reflect_0_at_Complex_internal_10 = SELF -sw $s1, -44($fp) -# RETURN local_reflect_0_at_Complex_internal_10 -lw $v0, -44($fp) -# Deallocate stack frame for function function_reflect_0_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 52 -jr $ra -# Function END - - -# function_reflect_X_at_Complex implementation. -# @Params: -function_reflect_X_at_Complex: - # Allocate stack frame for function function_reflect_X_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_reflect_X_at_Complex_internal_2 = GETATTRIBUTE y Complex - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - lw $t0, 16($s1) - sw $t0, -12($fp) - # local_reflect_X_at_Complex_internal_4 = GETATTRIBUTE y Complex - # LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) - lw $t0, 16($s1) - sw $t0, -20($fp) - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - # LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) - lw $t0, -20($fp) - lw $t0, 12($t0) - not $t0, $t0 - add $t0, $t0, 1 - sw $t0, -16($fp) - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -16($fp) - sw $t0, 12($v0) - sw $v0, -16($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_2 GOTO label_FALSE_43 - # IF_ZERO local_reflect_X_at_Complex_internal_2 GOTO label_FALSE_43 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_43 - # IF_ZERO local_reflect_X_at_Complex_internal_3 GOTO label_FALSE_43 - # IF_ZERO local_reflect_X_at_Complex_internal_3 GOTO label_FALSE_43 - lw $t0, -16($fp) - beq $t0, 0, label_FALSE_43 - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with String - la $v0, String - lw $a0, -12($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_STRING_46 - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_STRING_46 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_STRING_46 - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with Bool - la $v0, Bool - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_47 - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with Int - la $v0, Int - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_47 - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - # Load pointers and SUB - lw $a0, -12($fp) - lw $a1, -16($fp) - sub $a0, $a0, $a1 - sw $a0, -8($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_44 - # GOTO label_FALSE_43 - j label_FALSE_43 - label_COMPARE_BY_VALUE_47: - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - lw $a0, -12($fp) - lw $a1, -16($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -8($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_44 - # GOTO label_FALSE_43 - j label_FALSE_43 - label_COMPARE_STRING_46: - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, -16($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -8($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_CONTINUE_48 - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_CONTINUE_48 - lw $t0, -8($fp) - beq $t0, 0, label_CONTINUE_48 - # GOTO label_FALSE_43 - j label_FALSE_43 - label_CONTINUE_48: - # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, -16($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_49: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_50 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_49 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_50: - # Store result - sw $a2, -8($fp) - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 - # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_44 - label_FALSE_43: - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # GOTO label_END_45 -j label_END_45 -label_TRUE_44: - # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -4($fp) - label_END_45: -# LOCAL local_reflect_X_at_Complex_internal_5 --> -24($fp) -# local_reflect_X_at_Complex_internal_5 = SELF -sw $s1, -24($fp) -# RETURN local_reflect_X_at_Complex_internal_5 -lw $v0, -24($fp) -# Deallocate stack frame for function function_reflect_X_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 32 -jr $ra -# Function END - - -# function_reflect_Y_at_Complex implementation. -# @Params: -function_reflect_Y_at_Complex: - # Allocate stack frame for function function_reflect_Y_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_reflect_Y_at_Complex_internal_2 = GETATTRIBUTE x Complex - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - lw $t0, 12($s1) - sw $t0, -12($fp) - # local_reflect_Y_at_Complex_internal_4 = GETATTRIBUTE x Complex - # LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) - lw $t0, 12($s1) - sw $t0, -20($fp) - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - # LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) - lw $t0, -20($fp) - lw $t0, 12($t0) - not $t0, $t0 - add $t0, $t0, 1 - sw $t0, -16($fp) - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -16($fp) - sw $t0, 12($v0) - sw $v0, -16($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_2 GOTO label_FALSE_51 - # IF_ZERO local_reflect_Y_at_Complex_internal_2 GOTO label_FALSE_51 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_51 - # IF_ZERO local_reflect_Y_at_Complex_internal_3 GOTO label_FALSE_51 - # IF_ZERO local_reflect_Y_at_Complex_internal_3 GOTO label_FALSE_51 - lw $t0, -16($fp) - beq $t0, 0, label_FALSE_51 - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with String - la $v0, String - lw $a0, -12($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_STRING_54 - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_STRING_54 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_STRING_54 - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with Bool - la $v0, Bool - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_55 - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # Comparing -12($fp) type with Int - la $v0, Int - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -8($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 - lw $t0, -8($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_55 - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - # Load pointers and SUB - lw $a0, -12($fp) - lw $a1, -16($fp) - sub $a0, $a0, $a1 - sw $a0, -8($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_52 - # GOTO label_FALSE_51 - j label_FALSE_51 - label_COMPARE_BY_VALUE_55: - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - lw $a0, -12($fp) - lw $a1, -16($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -8($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_52 - # GOTO label_FALSE_51 - j label_FALSE_51 - label_COMPARE_STRING_54: - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, -16($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -8($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_CONTINUE_56 - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_CONTINUE_56 - lw $t0, -8($fp) - beq $t0, 0, label_CONTINUE_56 - # GOTO label_FALSE_51 - j label_FALSE_51 - label_CONTINUE_56: - # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) - # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) - # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, -16($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_57: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_58 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_57 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_58: - # Store result - sw $a2, -8($fp) - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 - # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 - lw $t0, -8($fp) - beq $t0, 0, label_TRUE_52 - label_FALSE_51: - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # GOTO label_END_53 -j label_END_53 -label_TRUE_52: - # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -4($fp) - label_END_53: -# LOCAL local_reflect_Y_at_Complex_internal_5 --> -24($fp) -# local_reflect_Y_at_Complex_internal_5 = SELF -sw $s1, -24($fp) -# RETURN local_reflect_Y_at_Complex_internal_5 -lw $v0, -24($fp) -# Deallocate stack frame for function function_reflect_Y_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 32 -jr $ra -# Function END - - -# function_equal_at_Complex implementation. -# @Params: -# 0($fp) = param_equal_at_Complex_d_0 -function_equal_at_Complex: - # Allocate stack frame for function function_equal_at_Complex. - subu $sp, $sp, 76 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 76 - # local_equal_at_Complex_internal_4 = GETATTRIBUTE x Complex - # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) - lw $t0, 12($s1) - sw $t0, -20($fp) - # LOCAL local_equal_at_Complex_internal_5 --> -24($fp) - # PARAM param_equal_at_Complex_d_0 --> 0($fp) - # local_equal_at_Complex_internal_5 = PARAM param_equal_at_Complex_d_0 - lw $t0, 0($fp) - sw $t0, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_equal_at_Complex_internal_5 --> -24($fp) - # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) - # local_equal_at_Complex_internal_6 = VCALL local_equal_at_Complex_internal_5 x_value - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 64($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # IF_ZERO local_equal_at_Complex_internal_4 GOTO label_FALSE_61 - # IF_ZERO local_equal_at_Complex_internal_4 GOTO label_FALSE_61 - lw $t0, -20($fp) - beq $t0, 0, label_FALSE_61 - # IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSE_61 - # IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSE_61 - lw $t0, -28($fp) - beq $t0, 0, label_FALSE_61 - # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) - # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) - # Comparing -20($fp) type with String - la $v0, String - lw $a0, -20($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_COMPARE_STRING_64 - # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_COMPARE_STRING_64 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_64 - # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) - # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) - # Comparing -20($fp) type with Bool - la $v0, Bool - lw $a0, -20($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_65 - # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_65 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_65 - # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) - # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) - # Comparing -20($fp) type with Int - la $v0, Int - lw $a0, -20($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_65 - # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_65 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_65 - # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) - # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) - # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) - # Load pointers and SUB - lw $a0, -20($fp) - lw $a1, -28($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_TRUE_62 - # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_TRUE_62 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_62 - # GOTO label_FALSE_61 - j label_FALSE_61 - label_COMPARE_BY_VALUE_65: - # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) - # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) - # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) - lw $a0, -20($fp) - lw $a1, -28($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_TRUE_62 - # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_TRUE_62 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_62 - # GOTO label_FALSE_61 - j label_FALSE_61 - label_COMPARE_STRING_64: - # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) - # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) - # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) - # Load strings for comparison - lw $v0, -20($fp) - lw $v1, -28($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_CONTINUE_66 - # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_CONTINUE_66 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_66 - # GOTO label_FALSE_61 - j label_FALSE_61 - label_CONTINUE_66: - # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) - # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) - # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -20($fp) - lw $v1, -28($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_67: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_68 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_67 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_68: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_TRUE_62 - # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_TRUE_62 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_62 - label_FALSE_61: - # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_63 -j label_END_63 -label_TRUE_62: - # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_63: -# LOCAL local_equal_at_Complex_internal_0 --> -4($fp) -# LOCAL local_equal_at_Complex_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_equal_at_Complex_internal_0 GOTO label_FALSEIF_59 -# IF_ZERO local_equal_at_Complex_internal_0 GOTO label_FALSEIF_59 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_59 -# local_equal_at_Complex_internal_11 = GETATTRIBUTE y Complex -# LOCAL local_equal_at_Complex_internal_11 --> -48($fp) -lw $t0, 16($s1) -sw $t0, -48($fp) -# LOCAL local_equal_at_Complex_internal_12 --> -52($fp) -# PARAM param_equal_at_Complex_d_0 --> 0($fp) -# local_equal_at_Complex_internal_12 = PARAM param_equal_at_Complex_d_0 -lw $t0, 0($fp) -sw $t0, -52($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_equal_at_Complex_internal_12 --> -52($fp) -# LOCAL local_equal_at_Complex_internal_13 --> -56($fp) -# local_equal_at_Complex_internal_13 = VCALL local_equal_at_Complex_internal_12 y_value -# Save new self pointer in $s1 -lw $s1, -52($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 60($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -56($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# IF_ZERO local_equal_at_Complex_internal_11 GOTO label_FALSE_71 -# IF_ZERO local_equal_at_Complex_internal_11 GOTO label_FALSE_71 -lw $t0, -48($fp) -beq $t0, 0, label_FALSE_71 -# IF_ZERO local_equal_at_Complex_internal_13 GOTO label_FALSE_71 -# IF_ZERO local_equal_at_Complex_internal_13 GOTO label_FALSE_71 -lw $t0, -56($fp) -beq $t0, 0, label_FALSE_71 -# LOCAL local_equal_at_Complex_internal_10 --> -44($fp) -# LOCAL local_equal_at_Complex_internal_11 --> -48($fp) -# Comparing -48($fp) type with String -la $v0, String -lw $a0, -48($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -44($fp) -# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_COMPARE_STRING_74 -# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_COMPARE_STRING_74 -lw $t0, -44($fp) -beq $t0, 0, label_COMPARE_STRING_74 -# LOCAL local_equal_at_Complex_internal_10 --> -44($fp) -# LOCAL local_equal_at_Complex_internal_11 --> -48($fp) -# Comparing -48($fp) type with Bool -la $v0, Bool -lw $a0, -48($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -44($fp) -# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_COMPARE_BY_VALUE_75 -# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_COMPARE_BY_VALUE_75 -lw $t0, -44($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_75 -# LOCAL local_equal_at_Complex_internal_10 --> -44($fp) -# LOCAL local_equal_at_Complex_internal_11 --> -48($fp) -# Comparing -48($fp) type with Int -la $v0, Int -lw $a0, -48($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -44($fp) -# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_COMPARE_BY_VALUE_75 -# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_COMPARE_BY_VALUE_75 -lw $t0, -44($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_75 -# LOCAL local_equal_at_Complex_internal_10 --> -44($fp) -# LOCAL local_equal_at_Complex_internal_11 --> -48($fp) -# LOCAL local_equal_at_Complex_internal_13 --> -56($fp) -# Load pointers and SUB -lw $a0, -48($fp) -lw $a1, -56($fp) -sub $a0, $a0, $a1 -sw $a0, -44($fp) -# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_TRUE_72 -# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_TRUE_72 -lw $t0, -44($fp) -beq $t0, 0, label_TRUE_72 -# GOTO label_FALSE_71 -j label_FALSE_71 -label_COMPARE_BY_VALUE_75: - # LOCAL local_equal_at_Complex_internal_10 --> -44($fp) - # LOCAL local_equal_at_Complex_internal_11 --> -48($fp) - # LOCAL local_equal_at_Complex_internal_13 --> -56($fp) - lw $a0, -48($fp) - lw $a1, -56($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -44($fp) - # IF_ZERO local_equal_at_Complex_internal_10 GOTO label_TRUE_72 - # IF_ZERO local_equal_at_Complex_internal_10 GOTO label_TRUE_72 - lw $t0, -44($fp) - beq $t0, 0, label_TRUE_72 - # GOTO label_FALSE_71 - j label_FALSE_71 - label_COMPARE_STRING_74: - # LOCAL local_equal_at_Complex_internal_10 --> -44($fp) - # LOCAL local_equal_at_Complex_internal_11 --> -48($fp) - # LOCAL local_equal_at_Complex_internal_13 --> -56($fp) - # Load strings for comparison - lw $v0, -48($fp) - lw $v1, -56($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -44($fp) - # IF_ZERO local_equal_at_Complex_internal_10 GOTO label_CONTINUE_76 - # IF_ZERO local_equal_at_Complex_internal_10 GOTO label_CONTINUE_76 - lw $t0, -44($fp) - beq $t0, 0, label_CONTINUE_76 - # GOTO label_FALSE_71 - j label_FALSE_71 - label_CONTINUE_76: - # LOCAL local_equal_at_Complex_internal_10 --> -44($fp) - # LOCAL local_equal_at_Complex_internal_11 --> -48($fp) - # LOCAL local_equal_at_Complex_internal_13 --> -56($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -48($fp) - lw $v1, -56($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_77: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_78 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_77 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_78: - # Store result - sw $a2, -44($fp) - # IF_ZERO local_equal_at_Complex_internal_10 GOTO label_TRUE_72 - # IF_ZERO local_equal_at_Complex_internal_10 GOTO label_TRUE_72 - lw $t0, -44($fp) - beq $t0, 0, label_TRUE_72 - label_FALSE_71: - # LOCAL local_equal_at_Complex_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -40($fp) - # GOTO label_END_73 -j label_END_73 -label_TRUE_72: - # LOCAL local_equal_at_Complex_internal_9 --> -40($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -40($fp) - label_END_73: -# LOCAL local_equal_at_Complex_internal_7 --> -32($fp) -# LOCAL local_equal_at_Complex_internal_9 --> -40($fp) -# Obtain value from -40($fp) -lw $v0, -40($fp) -lw $v0, 12($v0) -sw $v0, -32($fp) -# IF_ZERO local_equal_at_Complex_internal_7 GOTO label_FALSEIF_69 -# IF_ZERO local_equal_at_Complex_internal_7 GOTO label_FALSEIF_69 -lw $t0, -32($fp) -beq $t0, 0, label_FALSEIF_69 -# LOCAL local_equal_at_Complex_internal_14 --> -60($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -60($fp) -# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) -# LOCAL local_equal_at_Complex_internal_14 --> -60($fp) -# local_equal_at_Complex_internal_8 = local_equal_at_Complex_internal_14 -lw $t0, -60($fp) -sw $t0, -36($fp) -# GOTO label_ENDIF_70 -j label_ENDIF_70 -label_FALSEIF_69: - # LOCAL local_equal_at_Complex_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -64($fp) - # LOCAL local_equal_at_Complex_internal_8 --> -36($fp) - # LOCAL local_equal_at_Complex_internal_15 --> -64($fp) - # local_equal_at_Complex_internal_8 = local_equal_at_Complex_internal_15 - lw $t0, -64($fp) - sw $t0, -36($fp) - label_ENDIF_70: -# LOCAL local_equal_at_Complex_internal_1 --> -8($fp) -# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) -# local_equal_at_Complex_internal_1 = local_equal_at_Complex_internal_8 -lw $t0, -36($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_60 -j label_ENDIF_60 -label_FALSEIF_59: - # LOCAL local_equal_at_Complex_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -68($fp) - # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) - # LOCAL local_equal_at_Complex_internal_16 --> -68($fp) - # local_equal_at_Complex_internal_1 = local_equal_at_Complex_internal_16 - lw $t0, -68($fp) - sw $t0, -8($fp) - label_ENDIF_60: -# RETURN local_equal_at_Complex_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_equal_at_Complex. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 76 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_x_value_at_Complex implementation. -# @Params: -function_x_value_at_Complex: - # Allocate stack frame for function function_x_value_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_x_value_at_Complex_internal_0 = GETATTRIBUTE x Complex - # LOCAL local_x_value_at_Complex_internal_0 --> -4($fp) - lw $t0, 12($s1) - sw $t0, -4($fp) - # RETURN local_x_value_at_Complex_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_x_value_at_Complex. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_y_value_at_Complex implementation. -# @Params: -function_y_value_at_Complex: - # Allocate stack frame for function function_y_value_at_Complex. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_y_value_at_Complex_internal_0 = GETATTRIBUTE y Complex - # LOCAL local_y_value_at_Complex_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_y_value_at_Complex_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_y_value_at_Complex. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 168 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 168 - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_c_0 = 0 - li $t0, 0 - sw $t0, -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = ALLOCATE Complex - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Complex - sw $t0, 12($v0) - li $t0, 7 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Complex_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Complex__attrib__x__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Complex__attrib__y__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -16($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 - lw $t0, -16($fp) - sw $t0, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -20($fp) - # ARG local_main_at_Main_internal_4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - lw $t0, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -24($fp) - # ARG local_main_at_Main_internal_5 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - lw $t0, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 48($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_c_0 = local_main_at_Main_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_internal_10 = local_main_at_Main_c_0 - lw $t0, -4($fp) - sw $t0, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 reflect_X - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 16($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_c_0 --> -4($fp) - # local_main_at_Main_internal_12 = local_main_at_Main_c_0 - lw $t0, -4($fp) - sw $t0, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 reflect_0 - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 72($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # IF_ZERO local_main_at_Main_internal_11 GOTO label_FALSE_81 - # IF_ZERO local_main_at_Main_internal_11 GOTO label_FALSE_81 - lw $t0, -48($fp) - beq $t0, 0, label_FALSE_81 - # IF_ZERO local_main_at_Main_internal_13 GOTO label_FALSE_81 - # IF_ZERO local_main_at_Main_internal_13 GOTO label_FALSE_81 - lw $t0, -56($fp) - beq $t0, 0, label_FALSE_81 - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # Comparing -48($fp) type with String - la $v0, String - lw $a0, -48($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_STRING_84 - # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_STRING_84 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_STRING_84 - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # Comparing -48($fp) type with Bool - la $v0, Bool - lw $a0, -48($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_85 - # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_85 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_85 - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # Comparing -48($fp) type with Int - la $v0, Int - lw $a0, -48($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_85 - # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_85 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_85 - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # Load pointers and SUB - lw $a0, -48($fp) - lw $a1, -56($fp) - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_82 - # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_82 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_82 - # GOTO label_FALSE_81 - j label_FALSE_81 - label_COMPARE_BY_VALUE_85: - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - lw $a0, -48($fp) - lw $a1, -56($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_82 - # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_82 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_82 - # GOTO label_FALSE_81 - j label_FALSE_81 - label_COMPARE_STRING_84: - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # Load strings for comparison - lw $v0, -48($fp) - lw $v1, -56($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -40($fp) - # IF_ZERO local_main_at_Main_internal_9 GOTO label_CONTINUE_86 - # IF_ZERO local_main_at_Main_internal_9 GOTO label_CONTINUE_86 - lw $t0, -40($fp) - beq $t0, 0, label_CONTINUE_86 - # GOTO label_FALSE_81 - j label_FALSE_81 - label_CONTINUE_86: - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -48($fp) - lw $v1, -56($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_87: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_88 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_87 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_88: - # Store result - sw $a2, -40($fp) - # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_82 - # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_82 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_82 - label_FALSE_81: - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -36($fp) - # GOTO label_END_83 -j label_END_83 -label_TRUE_82: - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -36($fp) - label_END_83: -# LOCAL local_main_at_Main_internal_6 --> -28($fp) -# LOCAL local_main_at_Main_internal_8 --> -36($fp) -# Obtain value from -36($fp) -lw $v0, -36($fp) -lw $v0, 12($v0) -sw $v0, -28($fp) -# IF_ZERO local_main_at_Main_internal_6 GOTO label_FALSEIF_79 -# IF_ZERO local_main_at_Main_internal_6 GOTO label_FALSEIF_79 -lw $t0, -28($fp) -beq $t0, 0, label_FALSEIF_79 -# LOCAL local_main_at_Main_internal_16 --> -68($fp) -# local_main_at_Main_internal_16 = SELF -sw $s1, -68($fp) -# LOCAL local_main_at_Main_internal_14 --> -60($fp) -# LOCAL local_main_at_Main_internal_16 --> -68($fp) -# local_main_at_Main_internal_14 = local_main_at_Main_internal_16 -lw $t0, -68($fp) -sw $t0, -60($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_6 -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -sw $v0, -72($fp) -# ARG local_main_at_Main_internal_17 -# LOCAL local_main_at_Main_internal_17 --> -72($fp) -lw $t0, -72($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_14 --> -60($fp) -# LOCAL local_main_at_Main_internal_15 --> -64($fp) -# local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 out_string -# Save new self pointer in $s1 -lw $s1, -60($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 8($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -64($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_7 --> -32($fp) -# LOCAL local_main_at_Main_internal_15 --> -64($fp) -# local_main_at_Main_internal_7 = local_main_at_Main_internal_15 -lw $t0, -64($fp) -sw $t0, -32($fp) -# GOTO label_ENDIF_80 -j label_ENDIF_80 -label_FALSEIF_79: - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_20 = SELF - sw $s1, -84($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 - lw $t0, -84($fp) - sw $t0, -76($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_7 - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - sw $v0, -88($fp) - # ARG local_main_at_Main_internal_21 - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - lw $t0, -88($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 out_string - # Save new self pointer in $s1 - lw $s1, -76($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 8($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -80($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_7 = local_main_at_Main_internal_19 - lw $t0, -80($fp) - sw $t0, -32($fp) - label_ENDIF_80: -# LOCAL local_main_at_Main_internal_28 --> -116($fp) -# LOCAL local_main_at_Main_c_0 --> -4($fp) -# local_main_at_Main_internal_28 = local_main_at_Main_c_0 -lw $t0, -4($fp) -sw $t0, -116($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_28 --> -116($fp) -# LOCAL local_main_at_Main_internal_29 --> -120($fp) -# local_main_at_Main_internal_29 = VCALL local_main_at_Main_internal_28 reflect_X -# Save new self pointer in $s1 -lw $s1, -116($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 16($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -120($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_26 --> -108($fp) -# LOCAL local_main_at_Main_internal_29 --> -120($fp) -# local_main_at_Main_internal_26 = local_main_at_Main_internal_29 -lw $t0, -120($fp) -sw $t0, -108($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_26 --> -108($fp) -# LOCAL local_main_at_Main_internal_27 --> -112($fp) -# local_main_at_Main_internal_27 = VCALL local_main_at_Main_internal_26 reflect_Y -# Save new self pointer in $s1 -lw $s1, -108($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 20($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -112($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_24 --> -100($fp) -# LOCAL local_main_at_Main_internal_27 --> -112($fp) -# local_main_at_Main_internal_24 = local_main_at_Main_internal_27 -lw $t0, -112($fp) -sw $t0, -100($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_30 --> -124($fp) -# LOCAL local_main_at_Main_c_0 --> -4($fp) -# local_main_at_Main_internal_30 = local_main_at_Main_c_0 -lw $t0, -4($fp) -sw $t0, -124($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_30 --> -124($fp) -# LOCAL local_main_at_Main_internal_31 --> -128($fp) -# local_main_at_Main_internal_31 = VCALL local_main_at_Main_internal_30 reflect_0 -# Save new self pointer in $s1 -lw $s1, -124($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 72($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -128($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_31 -# LOCAL local_main_at_Main_internal_31 --> -128($fp) -lw $t0, -128($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_24 --> -100($fp) -# LOCAL local_main_at_Main_internal_25 --> -104($fp) -# local_main_at_Main_internal_25 = VCALL local_main_at_Main_internal_24 equal -# Save new self pointer in $s1 -lw $s1, -100($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 4($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -104($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_22 --> -92($fp) -# LOCAL local_main_at_Main_internal_25 --> -104($fp) -# Obtain value from -104($fp) -lw $v0, -104($fp) -lw $v0, 12($v0) -sw $v0, -92($fp) -# IF_ZERO local_main_at_Main_internal_22 GOTO label_FALSEIF_89 -# IF_ZERO local_main_at_Main_internal_22 GOTO label_FALSEIF_89 -lw $t0, -92($fp) -beq $t0, 0, label_FALSEIF_89 -# LOCAL local_main_at_Main_internal_34 --> -140($fp) -# local_main_at_Main_internal_34 = SELF -sw $s1, -140($fp) -# LOCAL local_main_at_Main_internal_32 --> -132($fp) -# LOCAL local_main_at_Main_internal_34 --> -140($fp) -# local_main_at_Main_internal_32 = local_main_at_Main_internal_34 -lw $t0, -140($fp) -sw $t0, -132($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_35 --> -144($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_8 -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -sw $v0, -144($fp) -# ARG local_main_at_Main_internal_35 -# LOCAL local_main_at_Main_internal_35 --> -144($fp) -lw $t0, -144($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_32 --> -132($fp) -# LOCAL local_main_at_Main_internal_33 --> -136($fp) -# local_main_at_Main_internal_33 = VCALL local_main_at_Main_internal_32 out_string -# Save new self pointer in $s1 -lw $s1, -132($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 8($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -136($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_23 --> -96($fp) -# LOCAL local_main_at_Main_internal_33 --> -136($fp) -# local_main_at_Main_internal_23 = local_main_at_Main_internal_33 -lw $t0, -136($fp) -sw $t0, -96($fp) -# GOTO label_ENDIF_90 -j label_ENDIF_90 -label_FALSEIF_89: - # LOCAL local_main_at_Main_internal_38 --> -156($fp) - # local_main_at_Main_internal_38 = SELF - sw $s1, -156($fp) - # LOCAL local_main_at_Main_internal_36 --> -148($fp) - # LOCAL local_main_at_Main_internal_38 --> -156($fp) - # local_main_at_Main_internal_36 = local_main_at_Main_internal_38 - lw $t0, -156($fp) - sw $t0, -148($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_39 --> -160($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_9 - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - sw $v0, -160($fp) - # ARG local_main_at_Main_internal_39 - # LOCAL local_main_at_Main_internal_39 --> -160($fp) - lw $t0, -160($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_36 --> -148($fp) - # LOCAL local_main_at_Main_internal_37 --> -152($fp) - # local_main_at_Main_internal_37 = VCALL local_main_at_Main_internal_36 out_string - # Save new self pointer in $s1 - lw $s1, -148($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 8($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -152($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_23 --> -96($fp) - # LOCAL local_main_at_Main_internal_37 --> -152($fp) - # local_main_at_Main_internal_23 = local_main_at_Main_internal_37 - lw $t0, -152($fp) - sw $t0, -96($fp) - label_ENDIF_90: -# RETURN local_main_at_Main_internal_23 -lw $v0, -96($fp) -# Deallocate stack frame for function function_main_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 168 -jr $ra -# Function END - diff --git a/tests/codegen/palindrome.mips b/tests/codegen/palindrome.mips deleted file mode 100644 index 286b6a9f..00000000 --- a/tests/codegen/palindrome.mips +++ /dev/null @@ -1,2420 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:14 2020 -# School of Math and Computer Science, University of Havana -# - -.data -dummy: .word 0 -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Int: .asciiz "Int" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_out_string_at_IO, dummy, function_out_int_at_IO, dummy, function_in_string_at_IO, dummy, function_type_name_at_Object, function_copy_at_Object, function_abort_at_Object, dummy, function_in_int_at_IO, dummy -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word dummy, function_length_at_String, dummy, dummy, dummy, function_substr_at_String, function_type_name_at_Object, function_copy_at_Object, function_abort_at_Object, function_concat_at_String, dummy, dummy -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Int **** -Int_start: - Int_vtable_pointer: .word Int_vtable - # Function END -Int_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, dummy, function_out_int_at_IO, function_main_at_Main, function_in_string_at_IO, dummy, function_type_name_at_Object, function_copy_at_Object, function_abort_at_Object, dummy, function_in_int_at_IO, function_pal_at_Main -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz "enter a string\n" -# - - -data_5: .asciiz "that was a palindrome\n" -# - - -data_6: .asciiz "that was not a palindrome\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - move $a2, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - sw $a2, 12($v0) - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - lw $t2, 12($t2) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - lw $a0, 12($a0) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # LOCAL local_length_at_String_internal_1 --> -8($fp) - # LOCAL local_length_at_String_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -4($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_length_at_String_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Main - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__i__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t0, Main_vtable - # Get pointer to function address - lw $t1, 12($t0) - # Call function. Result is on $v0 - jalr $t1 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__i__init implementation. -# @Params: -__Main__attrib__i__init: - # Allocate stack frame for function __Main__attrib__i__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__i__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__i__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Main__attrib__i__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_pal_at_Main implementation. -# @Params: -# 0($fp) = param_pal_at_Main_s_0 -function_pal_at_Main: - # Allocate stack frame for function function_pal_at_Main. - subu $sp, $sp, 176 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 176 - # LOCAL local_pal_at_Main_internal_4 --> -20($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_4 = PARAM param_pal_at_Main_s_0 - lw $t0, 0($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_4 --> -20($fp) - # LOCAL local_pal_at_Main_internal_5 --> -24($fp) - # local_pal_at_Main_internal_5 = VCALL local_pal_at_Main_internal_4 length - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -28($fp) - # IF_ZERO local_pal_at_Main_internal_5 GOTO label_FALSE_3 - # IF_ZERO local_pal_at_Main_internal_5 GOTO label_FALSE_3 - lw $t0, -24($fp) - beq $t0, 0, label_FALSE_3 - # IF_ZERO local_pal_at_Main_internal_6 GOTO label_FALSE_3 - # IF_ZERO local_pal_at_Main_internal_6 GOTO label_FALSE_3 - lw $t0, -28($fp) - beq $t0, 0, label_FALSE_3 - # LOCAL local_pal_at_Main_internal_3 --> -16($fp) - # LOCAL local_pal_at_Main_internal_5 --> -24($fp) - # Comparing -24($fp) type with String - la $v0, String - lw $a0, -24($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_pal_at_Main_internal_3 GOTO label_COMPARE_STRING_6 - # IF_ZERO local_pal_at_Main_internal_3 GOTO label_COMPARE_STRING_6 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_6 - # LOCAL local_pal_at_Main_internal_3 --> -16($fp) - # LOCAL local_pal_at_Main_internal_5 --> -24($fp) - # Comparing -24($fp) type with Bool - la $v0, Bool - lw $a0, -24($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_pal_at_Main_internal_3 GOTO label_COMPARE_BY_VALUE_7 - # IF_ZERO local_pal_at_Main_internal_3 GOTO label_COMPARE_BY_VALUE_7 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_7 - # LOCAL local_pal_at_Main_internal_3 --> -16($fp) - # LOCAL local_pal_at_Main_internal_5 --> -24($fp) - # Comparing -24($fp) type with Int - la $v0, Int - lw $a0, -24($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_pal_at_Main_internal_3 GOTO label_COMPARE_BY_VALUE_7 - # IF_ZERO local_pal_at_Main_internal_3 GOTO label_COMPARE_BY_VALUE_7 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_7 - # LOCAL local_pal_at_Main_internal_3 --> -16($fp) - # LOCAL local_pal_at_Main_internal_5 --> -24($fp) - # LOCAL local_pal_at_Main_internal_6 --> -28($fp) - # Load pointers and SUB - lw $a0, -24($fp) - lw $a1, -28($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_pal_at_Main_internal_3 GOTO label_TRUE_4 - # IF_ZERO local_pal_at_Main_internal_3 GOTO label_TRUE_4 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_4 - # GOTO label_FALSE_3 - j label_FALSE_3 - label_COMPARE_BY_VALUE_7: - # LOCAL local_pal_at_Main_internal_3 --> -16($fp) - # LOCAL local_pal_at_Main_internal_5 --> -24($fp) - # LOCAL local_pal_at_Main_internal_6 --> -28($fp) - lw $a0, -24($fp) - lw $a1, -28($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_pal_at_Main_internal_3 GOTO label_TRUE_4 - # IF_ZERO local_pal_at_Main_internal_3 GOTO label_TRUE_4 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_4 - # GOTO label_FALSE_3 - j label_FALSE_3 - label_COMPARE_STRING_6: - # LOCAL local_pal_at_Main_internal_3 --> -16($fp) - # LOCAL local_pal_at_Main_internal_5 --> -24($fp) - # LOCAL local_pal_at_Main_internal_6 --> -28($fp) - # Load strings for comparison - lw $v0, -24($fp) - lw $v1, -28($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_pal_at_Main_internal_3 GOTO label_CONTINUE_8 - # IF_ZERO local_pal_at_Main_internal_3 GOTO label_CONTINUE_8 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_8 - # GOTO label_FALSE_3 - j label_FALSE_3 - label_CONTINUE_8: - # LOCAL local_pal_at_Main_internal_3 --> -16($fp) - # LOCAL local_pal_at_Main_internal_5 --> -24($fp) - # LOCAL local_pal_at_Main_internal_6 --> -28($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -24($fp) - lw $v1, -28($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_9: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_10 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_9 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_10: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_pal_at_Main_internal_3 GOTO label_TRUE_4 - # IF_ZERO local_pal_at_Main_internal_3 GOTO label_TRUE_4 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_4 - label_FALSE_3: - # LOCAL local_pal_at_Main_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_5 -j label_END_5 -label_TRUE_4: - # LOCAL local_pal_at_Main_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_5: -# LOCAL local_pal_at_Main_internal_0 --> -4($fp) -# LOCAL local_pal_at_Main_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_pal_at_Main_internal_0 GOTO label_FALSEIF_1 -# IF_ZERO local_pal_at_Main_internal_0 GOTO label_FALSEIF_1 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_1 -# LOCAL local_pal_at_Main_internal_7 --> -32($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -32($fp) -# LOCAL local_pal_at_Main_internal_1 --> -8($fp) -# LOCAL local_pal_at_Main_internal_7 --> -32($fp) -# local_pal_at_Main_internal_1 = local_pal_at_Main_internal_7 -lw $t0, -32($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_2 -j label_ENDIF_2 -label_FALSEIF_1: - # LOCAL local_pal_at_Main_internal_12 --> -52($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_12 = PARAM param_pal_at_Main_s_0 - lw $t0, 0($fp) - sw $t0, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_12 --> -52($fp) - # LOCAL local_pal_at_Main_internal_13 --> -56($fp) - # local_pal_at_Main_internal_13 = VCALL local_pal_at_Main_internal_12 length - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -60($fp) - # IF_ZERO local_pal_at_Main_internal_13 GOTO label_FALSE_13 - # IF_ZERO local_pal_at_Main_internal_13 GOTO label_FALSE_13 - lw $t0, -56($fp) - beq $t0, 0, label_FALSE_13 - # IF_ZERO local_pal_at_Main_internal_14 GOTO label_FALSE_13 - # IF_ZERO local_pal_at_Main_internal_14 GOTO label_FALSE_13 - lw $t0, -60($fp) - beq $t0, 0, label_FALSE_13 - # LOCAL local_pal_at_Main_internal_11 --> -48($fp) - # LOCAL local_pal_at_Main_internal_13 --> -56($fp) - # Comparing -56($fp) type with String - la $v0, String - lw $a0, -56($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_pal_at_Main_internal_11 GOTO label_COMPARE_STRING_16 - # IF_ZERO local_pal_at_Main_internal_11 GOTO label_COMPARE_STRING_16 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_STRING_16 - # LOCAL local_pal_at_Main_internal_11 --> -48($fp) - # LOCAL local_pal_at_Main_internal_13 --> -56($fp) - # Comparing -56($fp) type with Bool - la $v0, Bool - lw $a0, -56($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_pal_at_Main_internal_11 GOTO label_COMPARE_BY_VALUE_17 - # IF_ZERO local_pal_at_Main_internal_11 GOTO label_COMPARE_BY_VALUE_17 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_17 - # LOCAL local_pal_at_Main_internal_11 --> -48($fp) - # LOCAL local_pal_at_Main_internal_13 --> -56($fp) - # Comparing -56($fp) type with Int - la $v0, Int - lw $a0, -56($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_pal_at_Main_internal_11 GOTO label_COMPARE_BY_VALUE_17 - # IF_ZERO local_pal_at_Main_internal_11 GOTO label_COMPARE_BY_VALUE_17 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_17 - # LOCAL local_pal_at_Main_internal_11 --> -48($fp) - # LOCAL local_pal_at_Main_internal_13 --> -56($fp) - # LOCAL local_pal_at_Main_internal_14 --> -60($fp) - # Load pointers and SUB - lw $a0, -56($fp) - lw $a1, -60($fp) - sub $a0, $a0, $a1 - sw $a0, -48($fp) - # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_14 - # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_14 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_14 - # GOTO label_FALSE_13 - j label_FALSE_13 - label_COMPARE_BY_VALUE_17: - # LOCAL local_pal_at_Main_internal_11 --> -48($fp) - # LOCAL local_pal_at_Main_internal_13 --> -56($fp) - # LOCAL local_pal_at_Main_internal_14 --> -60($fp) - lw $a0, -56($fp) - lw $a1, -60($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -48($fp) - # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_14 - # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_14 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_14 - # GOTO label_FALSE_13 - j label_FALSE_13 - label_COMPARE_STRING_16: - # LOCAL local_pal_at_Main_internal_11 --> -48($fp) - # LOCAL local_pal_at_Main_internal_13 --> -56($fp) - # LOCAL local_pal_at_Main_internal_14 --> -60($fp) - # Load strings for comparison - lw $v0, -56($fp) - lw $v1, -60($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -48($fp) - # IF_ZERO local_pal_at_Main_internal_11 GOTO label_CONTINUE_18 - # IF_ZERO local_pal_at_Main_internal_11 GOTO label_CONTINUE_18 - lw $t0, -48($fp) - beq $t0, 0, label_CONTINUE_18 - # GOTO label_FALSE_13 - j label_FALSE_13 - label_CONTINUE_18: - # LOCAL local_pal_at_Main_internal_11 --> -48($fp) - # LOCAL local_pal_at_Main_internal_13 --> -56($fp) - # LOCAL local_pal_at_Main_internal_14 --> -60($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -56($fp) - lw $v1, -60($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_19: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_20 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_19 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_20: - # Store result - sw $a2, -48($fp) - # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_14 - # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_14 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_14 - label_FALSE_13: - # LOCAL local_pal_at_Main_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -44($fp) - # GOTO label_END_15 -j label_END_15 -label_TRUE_14: - # LOCAL local_pal_at_Main_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -44($fp) - label_END_15: -# LOCAL local_pal_at_Main_internal_8 --> -36($fp) -# LOCAL local_pal_at_Main_internal_10 --> -44($fp) -# Obtain value from -44($fp) -lw $v0, -44($fp) -lw $v0, 12($v0) -sw $v0, -36($fp) -# IF_ZERO local_pal_at_Main_internal_8 GOTO label_FALSEIF_11 -# IF_ZERO local_pal_at_Main_internal_8 GOTO label_FALSEIF_11 -lw $t0, -36($fp) -beq $t0, 0, label_FALSEIF_11 -# LOCAL local_pal_at_Main_internal_15 --> -64($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -64($fp) -# LOCAL local_pal_at_Main_internal_9 --> -40($fp) -# LOCAL local_pal_at_Main_internal_15 --> -64($fp) -# local_pal_at_Main_internal_9 = local_pal_at_Main_internal_15 -lw $t0, -64($fp) -sw $t0, -40($fp) -# GOTO label_ENDIF_12 -j label_ENDIF_12 -label_FALSEIF_11: - # LOCAL local_pal_at_Main_internal_20 --> -84($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_20 = PARAM param_pal_at_Main_s_0 - lw $t0, 0($fp) - sw $t0, -84($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_22 --> -92($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -92($fp) - # ARG local_pal_at_Main_internal_22 - # LOCAL local_pal_at_Main_internal_22 --> -92($fp) - lw $t0, -92($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_pal_at_Main_internal_23 --> -96($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -96($fp) - # ARG local_pal_at_Main_internal_23 - # LOCAL local_pal_at_Main_internal_23 --> -96($fp) - lw $t0, -96($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_pal_at_Main_internal_20 --> -84($fp) - # LOCAL local_pal_at_Main_internal_21 --> -88($fp) - # local_pal_at_Main_internal_21 = VCALL local_pal_at_Main_internal_20 substr - # Save new self pointer in $s1 - lw $s1, -84($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 20($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -88($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_24 --> -100($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_24 = PARAM param_pal_at_Main_s_0 - lw $t0, 0($fp) - sw $t0, -100($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_27 --> -112($fp) - # PARAM param_pal_at_Main_s_0 --> 0($fp) - # local_pal_at_Main_internal_27 = PARAM param_pal_at_Main_s_0 - lw $t0, 0($fp) - sw $t0, -112($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_pal_at_Main_internal_27 --> -112($fp) - # LOCAL local_pal_at_Main_internal_28 --> -116($fp) - # local_pal_at_Main_internal_28 = VCALL local_pal_at_Main_internal_27 length - # Save new self pointer in $s1 - lw $s1, -112($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -116($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_pal_at_Main_internal_29 --> -120($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -120($fp) - # LOCAL local_pal_at_Main_internal_26 --> -108($fp) - # LOCAL local_pal_at_Main_internal_28 --> -116($fp) - # LOCAL local_pal_at_Main_internal_29 --> -120($fp) - # local_pal_at_Main_internal_26 = local_pal_at_Main_internal_28 - local_pal_at_Main_internal_29 - lw $t1, -116($fp) - lw $t0, 12($t1) - lw $t1, -120($fp) - lw $t2, 12($t1) - sub $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -108($fp) - # ARG local_pal_at_Main_internal_26 - # LOCAL local_pal_at_Main_internal_26 --> -108($fp) - lw $t0, -108($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_pal_at_Main_internal_30 --> -124($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -124($fp) - # ARG local_pal_at_Main_internal_30 - # LOCAL local_pal_at_Main_internal_30 --> -124($fp) - lw $t0, -124($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_pal_at_Main_internal_24 --> -100($fp) - # LOCAL local_pal_at_Main_internal_25 --> -104($fp) - # local_pal_at_Main_internal_25 = VCALL local_pal_at_Main_internal_24 substr - # Save new self pointer in $s1 - lw $s1, -100($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 20($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -104($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # IF_ZERO local_pal_at_Main_internal_21 GOTO label_FALSE_23 - # IF_ZERO local_pal_at_Main_internal_21 GOTO label_FALSE_23 - lw $t0, -88($fp) - beq $t0, 0, label_FALSE_23 - # IF_ZERO local_pal_at_Main_internal_25 GOTO label_FALSE_23 - # IF_ZERO local_pal_at_Main_internal_25 GOTO label_FALSE_23 - lw $t0, -104($fp) - beq $t0, 0, label_FALSE_23 - # LOCAL local_pal_at_Main_internal_19 --> -80($fp) - # LOCAL local_pal_at_Main_internal_21 --> -88($fp) - # Comparing -88($fp) type with String - la $v0, String - lw $a0, -88($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -80($fp) - # IF_ZERO local_pal_at_Main_internal_19 GOTO label_COMPARE_STRING_26 - # IF_ZERO local_pal_at_Main_internal_19 GOTO label_COMPARE_STRING_26 - lw $t0, -80($fp) - beq $t0, 0, label_COMPARE_STRING_26 - # LOCAL local_pal_at_Main_internal_19 --> -80($fp) - # LOCAL local_pal_at_Main_internal_21 --> -88($fp) - # Comparing -88($fp) type with Bool - la $v0, Bool - lw $a0, -88($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -80($fp) - # IF_ZERO local_pal_at_Main_internal_19 GOTO label_COMPARE_BY_VALUE_27 - # IF_ZERO local_pal_at_Main_internal_19 GOTO label_COMPARE_BY_VALUE_27 - lw $t0, -80($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_27 - # LOCAL local_pal_at_Main_internal_19 --> -80($fp) - # LOCAL local_pal_at_Main_internal_21 --> -88($fp) - # Comparing -88($fp) type with Int - la $v0, Int - lw $a0, -88($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -80($fp) - # IF_ZERO local_pal_at_Main_internal_19 GOTO label_COMPARE_BY_VALUE_27 - # IF_ZERO local_pal_at_Main_internal_19 GOTO label_COMPARE_BY_VALUE_27 - lw $t0, -80($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_27 - # LOCAL local_pal_at_Main_internal_19 --> -80($fp) - # LOCAL local_pal_at_Main_internal_21 --> -88($fp) - # LOCAL local_pal_at_Main_internal_25 --> -104($fp) - # Load pointers and SUB - lw $a0, -88($fp) - lw $a1, -104($fp) - sub $a0, $a0, $a1 - sw $a0, -80($fp) - # IF_ZERO local_pal_at_Main_internal_19 GOTO label_TRUE_24 - # IF_ZERO local_pal_at_Main_internal_19 GOTO label_TRUE_24 - lw $t0, -80($fp) - beq $t0, 0, label_TRUE_24 - # GOTO label_FALSE_23 - j label_FALSE_23 - label_COMPARE_BY_VALUE_27: - # LOCAL local_pal_at_Main_internal_19 --> -80($fp) - # LOCAL local_pal_at_Main_internal_21 --> -88($fp) - # LOCAL local_pal_at_Main_internal_25 --> -104($fp) - lw $a0, -88($fp) - lw $a1, -104($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -80($fp) - # IF_ZERO local_pal_at_Main_internal_19 GOTO label_TRUE_24 - # IF_ZERO local_pal_at_Main_internal_19 GOTO label_TRUE_24 - lw $t0, -80($fp) - beq $t0, 0, label_TRUE_24 - # GOTO label_FALSE_23 - j label_FALSE_23 - label_COMPARE_STRING_26: - # LOCAL local_pal_at_Main_internal_19 --> -80($fp) - # LOCAL local_pal_at_Main_internal_21 --> -88($fp) - # LOCAL local_pal_at_Main_internal_25 --> -104($fp) - # Load strings for comparison - lw $v0, -88($fp) - lw $v1, -104($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -80($fp) - # IF_ZERO local_pal_at_Main_internal_19 GOTO label_CONTINUE_28 - # IF_ZERO local_pal_at_Main_internal_19 GOTO label_CONTINUE_28 - lw $t0, -80($fp) - beq $t0, 0, label_CONTINUE_28 - # GOTO label_FALSE_23 - j label_FALSE_23 - label_CONTINUE_28: - # LOCAL local_pal_at_Main_internal_19 --> -80($fp) - # LOCAL local_pal_at_Main_internal_21 --> -88($fp) - # LOCAL local_pal_at_Main_internal_25 --> -104($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -88($fp) - lw $v1, -104($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_29: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_30 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_29 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_30: - # Store result - sw $a2, -80($fp) - # IF_ZERO local_pal_at_Main_internal_19 GOTO label_TRUE_24 - # IF_ZERO local_pal_at_Main_internal_19 GOTO label_TRUE_24 - lw $t0, -80($fp) - beq $t0, 0, label_TRUE_24 - label_FALSE_23: - # LOCAL local_pal_at_Main_internal_18 --> -76($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -76($fp) - # GOTO label_END_25 -j label_END_25 -label_TRUE_24: - # LOCAL local_pal_at_Main_internal_18 --> -76($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -76($fp) - label_END_25: -# LOCAL local_pal_at_Main_internal_16 --> -68($fp) -# LOCAL local_pal_at_Main_internal_18 --> -76($fp) -# Obtain value from -76($fp) -lw $v0, -76($fp) -lw $v0, 12($v0) -sw $v0, -68($fp) -# IF_ZERO local_pal_at_Main_internal_16 GOTO label_FALSEIF_21 -# IF_ZERO local_pal_at_Main_internal_16 GOTO label_FALSEIF_21 -lw $t0, -68($fp) -beq $t0, 0, label_FALSEIF_21 -# LOCAL local_pal_at_Main_internal_33 --> -136($fp) -# local_pal_at_Main_internal_33 = SELF -sw $s1, -136($fp) -# LOCAL local_pal_at_Main_internal_31 --> -128($fp) -# LOCAL local_pal_at_Main_internal_33 --> -136($fp) -# local_pal_at_Main_internal_31 = local_pal_at_Main_internal_33 -lw $t0, -136($fp) -sw $t0, -128($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_pal_at_Main_internal_34 --> -140($fp) -# PARAM param_pal_at_Main_s_0 --> 0($fp) -# local_pal_at_Main_internal_34 = PARAM param_pal_at_Main_s_0 -lw $t0, 0($fp) -sw $t0, -140($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_pal_at_Main_internal_36 --> -148($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -148($fp) -# ARG local_pal_at_Main_internal_36 -# LOCAL local_pal_at_Main_internal_36 --> -148($fp) -lw $t0, -148($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_pal_at_Main_internal_38 --> -156($fp) -# PARAM param_pal_at_Main_s_0 --> 0($fp) -# local_pal_at_Main_internal_38 = PARAM param_pal_at_Main_s_0 -lw $t0, 0($fp) -sw $t0, -156($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_pal_at_Main_internal_38 --> -156($fp) -# LOCAL local_pal_at_Main_internal_39 --> -160($fp) -# local_pal_at_Main_internal_39 = VCALL local_pal_at_Main_internal_38 length -# Save new self pointer in $s1 -lw $s1, -156($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 4($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -160($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_pal_at_Main_internal_40 --> -164($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 2 -sw $t0, 12($v0) -sw $v0, -164($fp) -# LOCAL local_pal_at_Main_internal_37 --> -152($fp) -# LOCAL local_pal_at_Main_internal_39 --> -160($fp) -# LOCAL local_pal_at_Main_internal_40 --> -164($fp) -# local_pal_at_Main_internal_37 = local_pal_at_Main_internal_39 - local_pal_at_Main_internal_40 -lw $t1, -160($fp) -lw $t0, 12($t1) -lw $t1, -164($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -152($fp) -# ARG local_pal_at_Main_internal_37 -# LOCAL local_pal_at_Main_internal_37 --> -152($fp) -lw $t0, -152($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_pal_at_Main_internal_34 --> -140($fp) -# LOCAL local_pal_at_Main_internal_35 --> -144($fp) -# local_pal_at_Main_internal_35 = VCALL local_pal_at_Main_internal_34 substr -# Save new self pointer in $s1 -lw $s1, -140($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 20($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -144($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_pal_at_Main_internal_35 -# LOCAL local_pal_at_Main_internal_35 --> -144($fp) -lw $t0, -144($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_pal_at_Main_internal_31 --> -128($fp) -# LOCAL local_pal_at_Main_internal_32 --> -132($fp) -# local_pal_at_Main_internal_32 = VCALL local_pal_at_Main_internal_31 pal -# Save new self pointer in $s1 -lw $s1, -128($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 44($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -132($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_pal_at_Main_internal_17 --> -72($fp) -# LOCAL local_pal_at_Main_internal_32 --> -132($fp) -# local_pal_at_Main_internal_17 = local_pal_at_Main_internal_32 -lw $t0, -132($fp) -sw $t0, -72($fp) -# GOTO label_ENDIF_22 -j label_ENDIF_22 -label_FALSEIF_21: - # LOCAL local_pal_at_Main_internal_41 --> -168($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -168($fp) - # LOCAL local_pal_at_Main_internal_17 --> -72($fp) - # LOCAL local_pal_at_Main_internal_41 --> -168($fp) - # local_pal_at_Main_internal_17 = local_pal_at_Main_internal_41 - lw $t0, -168($fp) - sw $t0, -72($fp) - label_ENDIF_22: -# LOCAL local_pal_at_Main_internal_9 --> -40($fp) -# LOCAL local_pal_at_Main_internal_17 --> -72($fp) -# local_pal_at_Main_internal_9 = local_pal_at_Main_internal_17 -lw $t0, -72($fp) -sw $t0, -40($fp) -label_ENDIF_12: -# LOCAL local_pal_at_Main_internal_1 --> -8($fp) -# LOCAL local_pal_at_Main_internal_9 --> -40($fp) -# local_pal_at_Main_internal_1 = local_pal_at_Main_internal_9 -lw $t0, -40($fp) -sw $t0, -8($fp) -label_ENDIF_2: -# RETURN local_pal_at_Main_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_pal_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 176 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 96 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 96 - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -8($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - lw $t0, -8($fp) - lw $t0, 12($t0) - not $t0, $t0 - add $t0, $t0, 1 - sw $t0, -4($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -4($fp) - sw $t0, 12($v0) - sw $v0, -4($fp) - # - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - lw $t0, -4($fp) - sw $t0, 12($s1) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = SELF - sw $s1, -20($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 - lw $t0, -20($fp) - sw $t0, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_4 - sw $t0, 12($v0) - li $t0, 15 - sw $t0, 16($v0) - sw $v0, -24($fp) - # ARG local_main_at_Main_internal_5 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - lw $t0, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 0($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_10 = SELF - sw $s1, -44($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # local_main_at_Main_internal_8 = local_main_at_Main_internal_10 - lw $t0, -44($fp) - sw $t0, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_13 = SELF - sw $s1, -56($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # local_main_at_Main_internal_11 = local_main_at_Main_internal_13 - lw $t0, -56($fp) - sw $t0, -48($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_12 = VCALL local_main_at_Main_internal_11 in_string - # Save new self pointer in $s1 - lw $s1, -48($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 16($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -52($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_12 - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - lw $t0, -52($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 pal - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 44($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # Obtain value from -40($fp) - lw $v0, -40($fp) - lw $v0, 12($v0) - sw $v0, -28($fp) - # IF_ZERO local_main_at_Main_internal_6 GOTO label_FALSEIF_31 - # IF_ZERO local_main_at_Main_internal_6 GOTO label_FALSEIF_31 - lw $t0, -28($fp) - beq $t0, 0, label_FALSEIF_31 - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_16 = SELF - sw $s1, -68($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # local_main_at_Main_internal_14 = local_main_at_Main_internal_16 - lw $t0, -68($fp) - sw $t0, -60($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_5 - sw $t0, 12($v0) - li $t0, 22 - sw $t0, 16($v0) - sw $v0, -72($fp) - # ARG local_main_at_Main_internal_17 - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - lw $t0, -72($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 out_string - # Save new self pointer in $s1 - lw $s1, -60($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 0($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -64($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_7 = local_main_at_Main_internal_15 - lw $t0, -64($fp) - sw $t0, -32($fp) - # GOTO label_ENDIF_32 -j label_ENDIF_32 -label_FALSEIF_31: - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_20 = SELF - sw $s1, -84($fp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_20 --> -84($fp) - # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 - lw $t0, -84($fp) - sw $t0, -76($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_6 - sw $t0, 12($v0) - li $t0, 26 - sw $t0, 16($v0) - sw $v0, -88($fp) - # ARG local_main_at_Main_internal_21 - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - lw $t0, -88($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_18 --> -76($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 out_string - # Save new self pointer in $s1 - lw $s1, -76($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 0($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -80($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # local_main_at_Main_internal_7 = local_main_at_Main_internal_19 - lw $t0, -80($fp) - sw $t0, -32($fp) - label_ENDIF_32: -# RETURN local_main_at_Main_internal_7 -lw $v0, -32($fp) -# Deallocate stack frame for function function_main_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 96 -jr $ra -# Function END - diff --git a/tests/codegen/primes.mips b/tests/codegen/primes.mips deleted file mode 100644 index 62cb44d7..00000000 --- a/tests/codegen/primes.mips +++ /dev/null @@ -1,2371 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:10 2020 -# School of Math and Computer Science, University of Havana -# - -.data -dummy: .word 0 -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Int: .asciiz "Int" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word dummy, function_abort_at_Object, function_type_name_at_Object, dummy, function_in_string_at_IO, dummy, function_in_int_at_IO, dummy, function_out_int_at_IO, function_out_string_at_IO, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word dummy, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_length_at_String, function_abort_at_Object, function_type_name_at_Object, function_substr_at_String, dummy, dummy, dummy, function_concat_at_String, dummy, dummy, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word dummy, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Int **** -Int_vtable: .word dummy, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Int **** -Int_start: - Int_vtable_pointer: .word Int_vtable - # Function END -Int_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word dummy, function_abort_at_Object, function_type_name_at_Object, dummy, function_in_string_at_IO, function_main_at_Main, function_in_int_at_IO, dummy, function_out_int_at_IO, function_out_string_at_IO, function_copy_at_Object -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz "2 is trivially prime.\n" -# - - -data_5: .asciiz " is prime.\n" -# - - -data_6: .asciiz "halt" -# - - -data_7: .asciiz "continue" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - move $a2, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - sw $a2, 12($v0) - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - lw $t2, 12($t2) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - lw $a0, 12($a0) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # LOCAL local_length_at_String_internal_1 --> -8($fp) - # LOCAL local_length_at_String_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -4($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_length_at_String_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Main - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 32 bytes of memory - li $a0, 32 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__out__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__testee__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__divisor__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__stop__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 24($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__m__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 28($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t0, Main_vtable - # Get pointer to function address - lw $t1, 20($t0) - # Call function. Result is on $v0 - jalr $t1 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__out__init implementation. -# @Params: -__Main__attrib__out__init: - # Allocate stack frame for function __Main__attrib__out__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__out__init_internal_3 --> -16($fp) - # local_ttrib__out__init_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_ttrib__out__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__out__init_internal_3 --> -16($fp) - # local_ttrib__out__init_internal_1 = local_ttrib__out__init_internal_3 - lw $t0, -16($fp) - sw $t0, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_ttrib__out__init_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_4 - sw $t0, 12($v0) - li $t0, 22 - sw $t0, 16($v0) - sw $v0, -20($fp) - # ARG local_ttrib__out__init_internal_4 - # LOCAL local_ttrib__out__init_internal_4 --> -20($fp) - lw $t0, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_ttrib__out__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__out__init_internal_2 --> -12($fp) - # local_ttrib__out__init_internal_2 = VCALL local_ttrib__out__init_internal_1 out_string - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 36($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_ttrib__out__init_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 2 - sw $t0, 12($v0) - sw $v0, -24($fp) - # RETURN local_ttrib__out__init_internal_5 - lw $v0, -24($fp) - # Deallocate stack frame for function __Main__attrib__out__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__testee__init implementation. -# @Params: -__Main__attrib__testee__init: - # Allocate stack frame for function __Main__attrib__testee__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_ttrib__testee__init_internal_1 = GETATTRIBUTE out Main - # LOCAL local_ttrib__testee__init_internal_1 --> -8($fp) - lw $t0, 12($s1) - sw $t0, -8($fp) - # RETURN local_ttrib__testee__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Main__attrib__testee__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__divisor__init implementation. -# @Params: -__Main__attrib__divisor__init: - # Allocate stack frame for function __Main__attrib__divisor__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__divisor__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__divisor__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Main__attrib__divisor__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__stop__init implementation. -# @Params: -__Main__attrib__stop__init: - # Allocate stack frame for function __Main__attrib__stop__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__stop__init_internal_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 500 - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_ttrib__stop__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Main__attrib__stop__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__m__init implementation. -# @Params: -__Main__attrib__m__init: - # Allocate stack frame for function __Main__attrib__m__init. - subu $sp, $sp, 244 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 244 - label_WHILE_1: - # LOCAL local_ttrib__m__init_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - # LOCAL local_ttrib__m__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__m__init_internal_2 --> -12($fp) - # Obtain value from -12($fp) - lw $v0, -12($fp) - lw $v0, 12($v0) - sw $v0, -8($fp) - # IF_ZERO local_ttrib__m__init_internal_1 GOTO label_WHILE_END_2 - # IF_ZERO local_ttrib__m__init_internal_1 GOTO label_WHILE_END_2 - lw $t0, -8($fp) - beq $t0, 0, label_WHILE_END_2 - # local_ttrib__m__init_internal_4 = GETATTRIBUTE testee Main - # LOCAL local_ttrib__m__init_internal_4 --> -20($fp) - lw $t0, 16($s1) - sw $t0, -20($fp) - # LOCAL local_ttrib__m__init_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -24($fp) - # LOCAL local_ttrib__m__init_internal_3 --> -16($fp) - # LOCAL local_ttrib__m__init_internal_4 --> -20($fp) - # LOCAL local_ttrib__m__init_internal_5 --> -24($fp) - # local_ttrib__m__init_internal_3 = local_ttrib__m__init_internal_4 + local_ttrib__m__init_internal_5 - lw $t1, -20($fp) - lw $t0, 12($t1) - lw $t1, -24($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -16($fp) - # - # LOCAL local_ttrib__m__init_internal_3 --> -16($fp) - lw $t0, -16($fp) - sw $t0, 16($s1) - # LOCAL local_ttrib__m__init_internal_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 2 - sw $t0, 12($v0) - sw $v0, -28($fp) - # - # LOCAL local_ttrib__m__init_internal_6 --> -28($fp) - lw $t0, -28($fp) - sw $t0, 20($s1) - label_WHILE_3: - # local_ttrib__m__init_internal_11 = GETATTRIBUTE testee Main - # LOCAL local_ttrib__m__init_internal_11 --> -48($fp) - lw $t0, 16($s1) - sw $t0, -48($fp) - # local_ttrib__m__init_internal_13 = GETATTRIBUTE divisor Main - # LOCAL local_ttrib__m__init_internal_13 --> -56($fp) - lw $t0, 20($s1) - sw $t0, -56($fp) - # local_ttrib__m__init_internal_14 = GETATTRIBUTE divisor Main - # LOCAL local_ttrib__m__init_internal_14 --> -60($fp) - lw $t0, 20($s1) - sw $t0, -60($fp) - # LOCAL local_ttrib__m__init_internal_12 --> -52($fp) - # LOCAL local_ttrib__m__init_internal_13 --> -56($fp) - # LOCAL local_ttrib__m__init_internal_14 --> -60($fp) - # local_ttrib__m__init_internal_12 = local_ttrib__m__init_internal_13 * local_ttrib__m__init_internal_14 - lw $t1, -56($fp) - lw $t0, 12($t1) - lw $t1, -60($fp) - lw $t2, 12($t1) - mul $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -52($fp) - # LOCAL local_ttrib__m__init_internal_10 --> -44($fp) - # LOCAL local_ttrib__m__init_internal_11 --> -48($fp) - # LOCAL local_ttrib__m__init_internal_12 --> -52($fp) - lw $a0, -48($fp) - lw $a1, -52($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -44($fp) - # IF_GREATER_ZERO local_ttrib__m__init_internal_10 GOTO label_FALSE_7 - # IF_GREATER_ZERO local_ttrib__m__init_internal_10 GOTO label_FALSE_7 - lw $t0, -44($fp) - bgt $t0, 0, label_FALSE_7 - # IF_ZERO local_ttrib__m__init_internal_10 GOTO label_FALSE_7 - # IF_ZERO local_ttrib__m__init_internal_10 GOTO label_FALSE_7 - lw $t0, -44($fp) - beq $t0, 0, label_FALSE_7 - # LOCAL local_ttrib__m__init_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -44($fp) - # GOTO label_END_8 -j label_END_8 -label_FALSE_7: - # LOCAL local_ttrib__m__init_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -44($fp) - label_END_8: -# LOCAL local_ttrib__m__init_internal_8 --> -36($fp) -# LOCAL local_ttrib__m__init_internal_10 --> -44($fp) -# Obtain value from -44($fp) -lw $v0, -44($fp) -lw $v0, 12($v0) -sw $v0, -36($fp) -# IF_ZERO local_ttrib__m__init_internal_8 GOTO label_FALSEIF_5 -# IF_ZERO local_ttrib__m__init_internal_8 GOTO label_FALSEIF_5 -lw $t0, -36($fp) -beq $t0, 0, label_FALSEIF_5 -# LOCAL local_ttrib__m__init_internal_15 --> -64($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -64($fp) -# LOCAL local_ttrib__m__init_internal_9 --> -40($fp) -# LOCAL local_ttrib__m__init_internal_15 --> -64($fp) -# local_ttrib__m__init_internal_9 = local_ttrib__m__init_internal_15 -lw $t0, -64($fp) -sw $t0, -40($fp) -# GOTO label_ENDIF_6 -j label_ENDIF_6 -label_FALSEIF_5: - # local_ttrib__m__init_internal_21 = GETATTRIBUTE testee Main - # LOCAL local_ttrib__m__init_internal_21 --> -88($fp) - lw $t0, 16($s1) - sw $t0, -88($fp) - # local_ttrib__m__init_internal_23 = GETATTRIBUTE divisor Main - # LOCAL local_ttrib__m__init_internal_23 --> -96($fp) - lw $t0, 20($s1) - sw $t0, -96($fp) - # local_ttrib__m__init_internal_25 = GETATTRIBUTE testee Main - # LOCAL local_ttrib__m__init_internal_25 --> -104($fp) - lw $t0, 16($s1) - sw $t0, -104($fp) - # local_ttrib__m__init_internal_26 = GETATTRIBUTE divisor Main - # LOCAL local_ttrib__m__init_internal_26 --> -108($fp) - lw $t0, 20($s1) - sw $t0, -108($fp) - # LOCAL local_ttrib__m__init_internal_24 --> -100($fp) - # LOCAL local_ttrib__m__init_internal_25 --> -104($fp) - # LOCAL local_ttrib__m__init_internal_26 --> -108($fp) - # local_ttrib__m__init_internal_24 = local_ttrib__m__init_internal_25 / local_ttrib__m__init_internal_26 - lw $t1, -104($fp) - lw $t0, 12($t1) - lw $t1, -108($fp) - lw $t2, 12($t1) - div $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -100($fp) - # LOCAL local_ttrib__m__init_internal_22 --> -92($fp) - # LOCAL local_ttrib__m__init_internal_23 --> -96($fp) - # LOCAL local_ttrib__m__init_internal_24 --> -100($fp) - # local_ttrib__m__init_internal_22 = local_ttrib__m__init_internal_23 * local_ttrib__m__init_internal_24 - lw $t1, -96($fp) - lw $t0, 12($t1) - lw $t1, -100($fp) - lw $t2, 12($t1) - mul $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -92($fp) - # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) - # LOCAL local_ttrib__m__init_internal_21 --> -88($fp) - # LOCAL local_ttrib__m__init_internal_22 --> -92($fp) - # local_ttrib__m__init_internal_20 = local_ttrib__m__init_internal_21 - local_ttrib__m__init_internal_22 - lw $t1, -88($fp) - lw $t0, 12($t1) - lw $t1, -92($fp) - lw $t2, 12($t1) - sub $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -84($fp) - # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -112($fp) - # IF_ZERO local_ttrib__m__init_internal_20 GOTO label_FALSE_11 - # IF_ZERO local_ttrib__m__init_internal_20 GOTO label_FALSE_11 - lw $t0, -84($fp) - beq $t0, 0, label_FALSE_11 - # IF_ZERO local_ttrib__m__init_internal_27 GOTO label_FALSE_11 - # IF_ZERO local_ttrib__m__init_internal_27 GOTO label_FALSE_11 - lw $t0, -112($fp) - beq $t0, 0, label_FALSE_11 - # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) - # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) - # Comparing -84($fp) type with String - la $v0, String - lw $a0, -84($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -80($fp) - # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_COMPARE_STRING_14 - # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_COMPARE_STRING_14 - lw $t0, -80($fp) - beq $t0, 0, label_COMPARE_STRING_14 - # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) - # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) - # Comparing -84($fp) type with Bool - la $v0, Bool - lw $a0, -84($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -80($fp) - # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_COMPARE_BY_VALUE_15 - # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_COMPARE_BY_VALUE_15 - lw $t0, -80($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_15 - # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) - # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) - # Comparing -84($fp) type with Int - la $v0, Int - lw $a0, -84($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -80($fp) - # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_COMPARE_BY_VALUE_15 - # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_COMPARE_BY_VALUE_15 - lw $t0, -80($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_15 - # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) - # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) - # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) - # Load pointers and SUB - lw $a0, -84($fp) - lw $a1, -112($fp) - sub $a0, $a0, $a1 - sw $a0, -80($fp) - # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_TRUE_12 - # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_TRUE_12 - lw $t0, -80($fp) - beq $t0, 0, label_TRUE_12 - # GOTO label_FALSE_11 - j label_FALSE_11 - label_COMPARE_BY_VALUE_15: - # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) - # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) - # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) - lw $a0, -84($fp) - lw $a1, -112($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -80($fp) - # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_TRUE_12 - # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_TRUE_12 - lw $t0, -80($fp) - beq $t0, 0, label_TRUE_12 - # GOTO label_FALSE_11 - j label_FALSE_11 - label_COMPARE_STRING_14: - # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) - # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) - # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) - # Load strings for comparison - lw $v0, -84($fp) - lw $v1, -112($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -80($fp) - # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_CONTINUE_16 - # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_CONTINUE_16 - lw $t0, -80($fp) - beq $t0, 0, label_CONTINUE_16 - # GOTO label_FALSE_11 - j label_FALSE_11 - label_CONTINUE_16: - # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) - # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) - # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -84($fp) - lw $v1, -112($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_17: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_18 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_17 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_18: - # Store result - sw $a2, -80($fp) - # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_TRUE_12 - # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_TRUE_12 - lw $t0, -80($fp) - beq $t0, 0, label_TRUE_12 - label_FALSE_11: - # LOCAL local_ttrib__m__init_internal_18 --> -76($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -76($fp) - # GOTO label_END_13 -j label_END_13 -label_TRUE_12: - # LOCAL local_ttrib__m__init_internal_18 --> -76($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -76($fp) - label_END_13: -# LOCAL local_ttrib__m__init_internal_16 --> -68($fp) -# LOCAL local_ttrib__m__init_internal_18 --> -76($fp) -# Obtain value from -76($fp) -lw $v0, -76($fp) -lw $v0, 12($v0) -sw $v0, -68($fp) -# IF_ZERO local_ttrib__m__init_internal_16 GOTO label_FALSEIF_9 -# IF_ZERO local_ttrib__m__init_internal_16 GOTO label_FALSEIF_9 -lw $t0, -68($fp) -beq $t0, 0, label_FALSEIF_9 -# LOCAL local_ttrib__m__init_internal_28 --> -116($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -116($fp) -# LOCAL local_ttrib__m__init_internal_17 --> -72($fp) -# LOCAL local_ttrib__m__init_internal_28 --> -116($fp) -# local_ttrib__m__init_internal_17 = local_ttrib__m__init_internal_28 -lw $t0, -116($fp) -sw $t0, -72($fp) -# GOTO label_ENDIF_10 -j label_ENDIF_10 -label_FALSEIF_9: - # LOCAL local_ttrib__m__init_internal_29 --> -120($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -120($fp) - # LOCAL local_ttrib__m__init_internal_17 --> -72($fp) - # LOCAL local_ttrib__m__init_internal_29 --> -120($fp) - # local_ttrib__m__init_internal_17 = local_ttrib__m__init_internal_29 - lw $t0, -120($fp) - sw $t0, -72($fp) - label_ENDIF_10: -# LOCAL local_ttrib__m__init_internal_9 --> -40($fp) -# LOCAL local_ttrib__m__init_internal_17 --> -72($fp) -# local_ttrib__m__init_internal_9 = local_ttrib__m__init_internal_17 -lw $t0, -72($fp) -sw $t0, -40($fp) -label_ENDIF_6: -# LOCAL local_ttrib__m__init_internal_7 --> -32($fp) -# LOCAL local_ttrib__m__init_internal_9 --> -40($fp) -# Obtain value from -40($fp) -lw $v0, -40($fp) -lw $v0, 12($v0) -sw $v0, -32($fp) -# IF_ZERO local_ttrib__m__init_internal_7 GOTO label_WHILE_END_4 -# IF_ZERO local_ttrib__m__init_internal_7 GOTO label_WHILE_END_4 -lw $t0, -32($fp) -beq $t0, 0, label_WHILE_END_4 -# local_ttrib__m__init_internal_31 = GETATTRIBUTE divisor Main -# LOCAL local_ttrib__m__init_internal_31 --> -128($fp) -lw $t0, 20($s1) -sw $t0, -128($fp) -# LOCAL local_ttrib__m__init_internal_32 --> -132($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -132($fp) -# LOCAL local_ttrib__m__init_internal_30 --> -124($fp) -# LOCAL local_ttrib__m__init_internal_31 --> -128($fp) -# LOCAL local_ttrib__m__init_internal_32 --> -132($fp) -# local_ttrib__m__init_internal_30 = local_ttrib__m__init_internal_31 + local_ttrib__m__init_internal_32 -lw $t1, -128($fp) -lw $t0, 12($t1) -lw $t1, -132($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -124($fp) -# -# LOCAL local_ttrib__m__init_internal_30 --> -124($fp) -lw $t0, -124($fp) -sw $t0, 20($s1) -# GOTO label_WHILE_3 -j label_WHILE_3 -label_WHILE_END_4: - # local_ttrib__m__init_internal_36 = GETATTRIBUTE testee Main - # LOCAL local_ttrib__m__init_internal_36 --> -148($fp) - lw $t0, 16($s1) - sw $t0, -148($fp) - # local_ttrib__m__init_internal_38 = GETATTRIBUTE divisor Main - # LOCAL local_ttrib__m__init_internal_38 --> -156($fp) - lw $t0, 20($s1) - sw $t0, -156($fp) - # local_ttrib__m__init_internal_39 = GETATTRIBUTE divisor Main - # LOCAL local_ttrib__m__init_internal_39 --> -160($fp) - lw $t0, 20($s1) - sw $t0, -160($fp) - # LOCAL local_ttrib__m__init_internal_37 --> -152($fp) - # LOCAL local_ttrib__m__init_internal_38 --> -156($fp) - # LOCAL local_ttrib__m__init_internal_39 --> -160($fp) - # local_ttrib__m__init_internal_37 = local_ttrib__m__init_internal_38 * local_ttrib__m__init_internal_39 - lw $t1, -156($fp) - lw $t0, 12($t1) - lw $t1, -160($fp) - lw $t2, 12($t1) - mul $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -152($fp) - # LOCAL local_ttrib__m__init_internal_35 --> -144($fp) - # LOCAL local_ttrib__m__init_internal_36 --> -148($fp) - # LOCAL local_ttrib__m__init_internal_37 --> -152($fp) - lw $a0, -148($fp) - lw $a1, -152($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -144($fp) - # IF_GREATER_ZERO local_ttrib__m__init_internal_35 GOTO label_FALSE_21 - # IF_GREATER_ZERO local_ttrib__m__init_internal_35 GOTO label_FALSE_21 - lw $t0, -144($fp) - bgt $t0, 0, label_FALSE_21 - # IF_ZERO local_ttrib__m__init_internal_35 GOTO label_FALSE_21 - # IF_ZERO local_ttrib__m__init_internal_35 GOTO label_FALSE_21 - lw $t0, -144($fp) - beq $t0, 0, label_FALSE_21 - # LOCAL local_ttrib__m__init_internal_35 --> -144($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -144($fp) - # GOTO label_END_22 -j label_END_22 -label_FALSE_21: - # LOCAL local_ttrib__m__init_internal_35 --> -144($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -144($fp) - label_END_22: -# LOCAL local_ttrib__m__init_internal_33 --> -136($fp) -# LOCAL local_ttrib__m__init_internal_35 --> -144($fp) -# Obtain value from -144($fp) -lw $v0, -144($fp) -lw $v0, 12($v0) -sw $v0, -136($fp) -# IF_ZERO local_ttrib__m__init_internal_33 GOTO label_FALSEIF_19 -# IF_ZERO local_ttrib__m__init_internal_33 GOTO label_FALSEIF_19 -lw $t0, -136($fp) -beq $t0, 0, label_FALSEIF_19 -# local_ttrib__m__init_internal_40 = GETATTRIBUTE testee Main -# LOCAL local_ttrib__m__init_internal_40 --> -164($fp) -lw $t0, 16($s1) -sw $t0, -164($fp) -# -# LOCAL local_ttrib__m__init_internal_40 --> -164($fp) -lw $t0, -164($fp) -sw $t0, 12($s1) -# LOCAL local_ttrib__m__init_internal_43 --> -176($fp) -# local_ttrib__m__init_internal_43 = SELF -sw $s1, -176($fp) -# LOCAL local_ttrib__m__init_internal_41 --> -168($fp) -# LOCAL local_ttrib__m__init_internal_43 --> -176($fp) -# local_ttrib__m__init_internal_41 = local_ttrib__m__init_internal_43 -lw $t0, -176($fp) -sw $t0, -168($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# local_ttrib__m__init_internal_44 = GETATTRIBUTE out Main -# LOCAL local_ttrib__m__init_internal_44 --> -180($fp) -lw $t0, 12($s1) -sw $t0, -180($fp) -# ARG local_ttrib__m__init_internal_44 -# LOCAL local_ttrib__m__init_internal_44 --> -180($fp) -lw $t0, -180($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_ttrib__m__init_internal_41 --> -168($fp) -# LOCAL local_ttrib__m__init_internal_42 --> -172($fp) -# local_ttrib__m__init_internal_42 = VCALL local_ttrib__m__init_internal_41 out_int -# Save new self pointer in $s1 -lw $s1, -168($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 32($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -172($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_ttrib__m__init_internal_47 --> -192($fp) -# local_ttrib__m__init_internal_47 = SELF -sw $s1, -192($fp) -# LOCAL local_ttrib__m__init_internal_45 --> -184($fp) -# LOCAL local_ttrib__m__init_internal_47 --> -192($fp) -# local_ttrib__m__init_internal_45 = local_ttrib__m__init_internal_47 -lw $t0, -192($fp) -sw $t0, -184($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_ttrib__m__init_internal_48 --> -196($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_5 -sw $t0, 12($v0) -li $t0, 11 -sw $t0, 16($v0) -sw $v0, -196($fp) -# ARG local_ttrib__m__init_internal_48 -# LOCAL local_ttrib__m__init_internal_48 --> -196($fp) -lw $t0, -196($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_ttrib__m__init_internal_45 --> -184($fp) -# LOCAL local_ttrib__m__init_internal_46 --> -188($fp) -# local_ttrib__m__init_internal_46 = VCALL local_ttrib__m__init_internal_45 out_string -# Save new self pointer in $s1 -lw $s1, -184($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 36($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -188($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_ttrib__m__init_internal_34 --> -140($fp) -# LOCAL local_ttrib__m__init_internal_46 --> -188($fp) -# local_ttrib__m__init_internal_34 = local_ttrib__m__init_internal_46 -lw $t0, -188($fp) -sw $t0, -140($fp) -# GOTO label_ENDIF_20 -j label_ENDIF_20 -label_FALSEIF_19: - # LOCAL local_ttrib__m__init_internal_49 --> -200($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -200($fp) - # LOCAL local_ttrib__m__init_internal_34 --> -140($fp) - # LOCAL local_ttrib__m__init_internal_49 --> -200($fp) - # local_ttrib__m__init_internal_34 = local_ttrib__m__init_internal_49 - lw $t0, -200($fp) - sw $t0, -140($fp) - label_ENDIF_20: -# local_ttrib__m__init_internal_53 = GETATTRIBUTE stop Main -# LOCAL local_ttrib__m__init_internal_53 --> -216($fp) -lw $t0, 24($s1) -sw $t0, -216($fp) -# local_ttrib__m__init_internal_54 = GETATTRIBUTE testee Main -# LOCAL local_ttrib__m__init_internal_54 --> -220($fp) -lw $t0, 16($s1) -sw $t0, -220($fp) -# LOCAL local_ttrib__m__init_internal_52 --> -212($fp) -# LOCAL local_ttrib__m__init_internal_53 --> -216($fp) -# LOCAL local_ttrib__m__init_internal_54 --> -220($fp) -lw $a0, -216($fp) -lw $a1, -220($fp) -# Load values -lw $a0, 12($a0) -lw $a1, 12($a1) -# SUB and store -sub $a0, $a0, $a1 -sw $a0, -212($fp) -# IF_GREATER_ZERO local_ttrib__m__init_internal_52 GOTO label_FALSE_25 -# IF_GREATER_ZERO local_ttrib__m__init_internal_52 GOTO label_FALSE_25 -lw $t0, -212($fp) -bgt $t0, 0, label_FALSE_25 -# LOCAL local_ttrib__m__init_internal_52 --> -212($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -212($fp) -# GOTO label_END_26 -j label_END_26 -label_FALSE_25: - # LOCAL local_ttrib__m__init_internal_52 --> -212($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -212($fp) - label_END_26: -# LOCAL local_ttrib__m__init_internal_50 --> -204($fp) -# LOCAL local_ttrib__m__init_internal_52 --> -212($fp) -# Obtain value from -212($fp) -lw $v0, -212($fp) -lw $v0, 12($v0) -sw $v0, -204($fp) -# IF_ZERO local_ttrib__m__init_internal_50 GOTO label_FALSEIF_23 -# IF_ZERO local_ttrib__m__init_internal_50 GOTO label_FALSEIF_23 -lw $t0, -204($fp) -beq $t0, 0, label_FALSEIF_23 -# LOCAL local_ttrib__m__init_internal_57 --> -232($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_6 -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -sw $v0, -232($fp) -# LOCAL local_ttrib__m__init_internal_55 --> -224($fp) -# LOCAL local_ttrib__m__init_internal_57 --> -232($fp) -# local_ttrib__m__init_internal_55 = local_ttrib__m__init_internal_57 -lw $t0, -232($fp) -sw $t0, -224($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_ttrib__m__init_internal_55 --> -224($fp) -# LOCAL local_ttrib__m__init_internal_56 --> -228($fp) -# local_ttrib__m__init_internal_56 = VCALL local_ttrib__m__init_internal_55 abort -# Save new self pointer in $s1 -lw $s1, -224($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 4($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -228($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_ttrib__m__init_internal_51 --> -208($fp) -# LOCAL local_ttrib__m__init_internal_56 --> -228($fp) -# local_ttrib__m__init_internal_51 = local_ttrib__m__init_internal_56 -lw $t0, -228($fp) -sw $t0, -208($fp) -# GOTO label_ENDIF_24 -j label_ENDIF_24 -label_FALSEIF_23: - # LOCAL local_ttrib__m__init_internal_58 --> -236($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_7 - sw $t0, 12($v0) - li $t0, 8 - sw $t0, 16($v0) - sw $v0, -236($fp) - # LOCAL local_ttrib__m__init_internal_51 --> -208($fp) - # LOCAL local_ttrib__m__init_internal_58 --> -236($fp) - # local_ttrib__m__init_internal_51 = local_ttrib__m__init_internal_58 - lw $t0, -236($fp) - sw $t0, -208($fp) - label_ENDIF_24: -# GOTO label_WHILE_1 -j label_WHILE_1 -label_WHILE_END_2: - # RETURN - # Deallocate stack frame for function __Main__attrib__m__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 244 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_main_at_Main_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - diff --git a/tests/codegen/print-cool.mips b/tests/codegen/print-cool.mips deleted file mode 100644 index cd17ad79..00000000 --- a/tests/codegen/print-cool.mips +++ /dev/null @@ -1,1169 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:11 2020 -# School of Math and Computer Science, University of Havana -# - -.data -dummy: .word 0 -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Int: .asciiz "Int" -# Function END -Main: .asciiz "Main" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_in_string_at_IO, function_abort_at_Object, function_copy_at_Object, function_in_int_at_IO, dummy, dummy, function_out_int_at_IO, function_out_string_at_IO, function_type_name_at_Object, dummy, dummy -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word dummy, function_abort_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word dummy, function_abort_at_Object, function_copy_at_Object, dummy, function_length_at_String, function_concat_at_String, dummy, dummy, function_type_name_at_Object, dummy, function_substr_at_String -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word dummy, function_abort_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Int **** -Int_vtable: .word dummy, function_abort_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Int **** -Int_start: - Int_vtable_pointer: .word Int_vtable - # Function END -Int_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_in_string_at_IO, function_abort_at_Object, function_copy_at_Object, function_in_int_at_IO, dummy, dummy, function_out_int_at_IO, function_out_string_at_IO, function_type_name_at_Object, function_main_at_Main, dummy -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1 -Main__TDT: .word -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz "\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - move $a2, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - sw $a2, 12($v0) - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - lw $t2, 12($t2) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - lw $a0, 12($a0) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # LOCAL local_length_at_String_internal_1 --> -8($fp) - # LOCAL local_length_at_String_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -4($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_length_at_String_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Main - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t0, Main_vtable - # Get pointer to function address - lw $t1, 36($t0) - # Call function. Result is on $v0 - jalr $t1 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 104 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 104 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = SELF - sw $s1, -20($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 - lw $t0, -20($fp) - sw $t0, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = ALLOCATE Object - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Object - sw $t0, 12($v0) - li $t0, 6 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Object_start - sw $t0, 4($v0) - # Load type offset - li $t0, 4 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -40($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 - lw $t0, -40($fp) - sw $t0, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 type_name - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 32($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # local_main_at_Main_internal_5 = local_main_at_Main_internal_8 - lw $t0, -36($fp) - sw $t0, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 4 - sw $t0, 12($v0) - sw $v0, -44($fp) - # ARG local_main_at_Main_internal_10 - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - lw $t0, -44($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -48($fp) - # ARG local_main_at_Main_internal_11 - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - lw $t0, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # local_main_at_Main_internal_6 = VCALL local_main_at_Main_internal_5 substr - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 40($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_6 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - lw $t0, -28($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 28($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 - lw $t0, -16($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # local_main_at_Main_internal_17 = SELF - sw $s1, -72($fp) - # IF_ZERO local_main_at_Main_internal_17 GOTO label_TRUE_1 - # IF_ZERO local_main_at_Main_internal_17 GOTO label_TRUE_1 - lw $t0, -72($fp) - beq $t0, 0, label_TRUE_1 - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -68($fp) - # GOTO label_END_2 -j label_END_2 -label_TRUE_1: - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -68($fp) - label_END_2: -# LOCAL local_main_at_Main_internal_14 --> -60($fp) -# LOCAL local_main_at_Main_internal_16 --> -68($fp) -# local_main_at_Main_internal_14 = local_main_at_Main_internal_16 -lw $t0, -68($fp) -sw $t0, -60($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_14 --> -60($fp) -# LOCAL local_main_at_Main_internal_15 --> -64($fp) -# local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 type_name -# Save new self pointer in $s1 -lw $s1, -60($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 32($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -64($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# LOCAL local_main_at_Main_internal_15 --> -64($fp) -# local_main_at_Main_internal_12 = local_main_at_Main_internal_15 -lw $t0, -64($fp) -sw $t0, -52($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -76($fp) -# ARG local_main_at_Main_internal_18 -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -lw $t0, -76($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 3 -sw $t0, 12($v0) -sw $v0, -80($fp) -# ARG local_main_at_Main_internal_19 -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -lw $t0, -80($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_12 --> -52($fp) -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 substr -# Save new self pointer in $s1 -lw $s1, -52($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 40($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -56($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_main_at_Main_internal_13 -# LOCAL local_main_at_Main_internal_13 --> -56($fp) -lw $t0, -56($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_0 --> -4($fp) -# LOCAL local_main_at_Main_internal_1 --> -8($fp) -# local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string -# Save new self pointer in $s1 -lw $s1, -4($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 28($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -8($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_22 --> -92($fp) -# local_main_at_Main_internal_22 = SELF -sw $s1, -92($fp) -# LOCAL local_main_at_Main_internal_20 --> -84($fp) -# LOCAL local_main_at_Main_internal_22 --> -92($fp) -# local_main_at_Main_internal_20 = local_main_at_Main_internal_22 -lw $t0, -92($fp) -sw $t0, -84($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_23 --> -96($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_4 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -96($fp) -# ARG local_main_at_Main_internal_23 -# LOCAL local_main_at_Main_internal_23 --> -96($fp) -lw $t0, -96($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_20 --> -84($fp) -# LOCAL local_main_at_Main_internal_21 --> -88($fp) -# local_main_at_Main_internal_21 = VCALL local_main_at_Main_internal_20 out_string -# Save new self pointer in $s1 -lw $s1, -84($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 28($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -88($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# RETURN local_main_at_Main_internal_21 -lw $v0, -88($fp) -# Deallocate stack frame for function function_main_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 104 -jr $ra -# Function END - diff --git a/tests/codegen/sort-list.mips b/tests/codegen/sort-list.mips deleted file mode 100644 index 7904e774..00000000 --- a/tests/codegen/sort-list.mips +++ /dev/null @@ -1,3364 +0,0 @@ - -# Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:57:14 2020 -# School of Math and Computer Science, University of Havana -# - -.data -dummy: .word 0 -IO: .asciiz "IO" -# Function END -Object: .asciiz "Object" -# Function END -String: .asciiz "String" -# Function END -Bool: .asciiz "Bool" -# Function END -Int: .asciiz "Int" -# Function END -Main: .asciiz "Main" -# Function END -List: .asciiz "List" -# Function END -Nil: .asciiz "Nil" -# Function END -Cons: .asciiz "Cons" -# Function END -# - - -# **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_out_string_at_IO, function_out_int_at_IO, function_in_int_at_IO, dummy, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type IO **** -IO_start: - IO_vtable_pointer: .word IO_vtable - # Function END -IO_end: -# - - -# **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Object **** -Object_start: - Object_vtable_pointer: .word Object_vtable - # Function END -Object_end: -# - - -# **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, function_length_at_String, function_concat_at_String, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type String **** -String_start: - String_vtable_pointer: .word String_vtable - # Function END -String_end: -# - - -# **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Bool **** -Bool_start: - Bool_vtable_pointer: .word Bool_vtable - # Function END -Bool_end: -# - - -# **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Int **** -Int_start: - Int_vtable_pointer: .word Int_vtable - # Function END -Int_end: -# - - -# **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, dummy, function_iota_at_Main, function_main_at_Main, dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_out_string_at_IO, function_out_int_at_IO, function_in_int_at_IO, dummy, function_type_name_at_Object, dummy -# Function END -# - - -# **** Type RECORD for type Main **** -Main_start: - Main_vtable_pointer: .word Main_vtable - # Function END -Main_end: -# - - -# **** VTABLE for type List **** -List_vtable: .word function_abort_at_Object, function_sort_at_List, dummy, dummy, dummy, function_rev_at_List, dummy, function_in_string_at_IO, function_isNil_at_List, function_cons_at_List, function_cdr_at_List, dummy, dummy, function_copy_at_Object, function_insert_at_List, function_car_at_List, function_out_string_at_IO, function_out_int_at_IO, function_in_int_at_IO, function_rcons_at_List, function_type_name_at_Object, function_print_list_at_List -# Function END -# - - -# **** Type RECORD for type List **** -List_start: - List_vtable_pointer: .word List_vtable - # Function END -List_end: -# - - -# **** VTABLE for type Nil **** -Nil_vtable: .word function_abort_at_Object, function_sort_at_Nil, dummy, dummy, dummy, function_rev_at_Nil, dummy, function_in_string_at_IO, function_isNil_at_Nil, function_cons_at_List, function_cdr_at_List, dummy, dummy, function_copy_at_Object, function_insert_at_Nil, function_car_at_List, function_out_string_at_IO, function_out_int_at_IO, function_in_int_at_IO, function_rcons_at_Nil, function_type_name_at_Object, function_print_list_at_Nil -# Function END -# - - -# **** Type RECORD for type Nil **** -Nil_start: - Nil_vtable_pointer: .word Nil_vtable - # Function END -Nil_end: -# - - -# **** VTABLE for type Cons **** -Cons_vtable: .word function_abort_at_Object, function_sort_at_Cons, dummy, dummy, function_init_at_Cons, function_rev_at_Cons, dummy, function_in_string_at_IO, function_isNil_at_Cons, function_cons_at_List, function_cdr_at_Cons, dummy, dummy, function_copy_at_Object, function_insert_at_Cons, function_car_at_Cons, function_out_string_at_IO, function_out_int_at_IO, function_in_int_at_IO, function_rcons_at_Cons, function_type_name_at_Object, function_print_list_at_Cons -# Function END -# - - -# **** Type RECORD for type Cons **** -Cons_start: - Cons_vtable_pointer: .word Cons_vtable - # Function END -Cons_end: -# - - -data_0: .asciiz "" -# - - -data_1: .asciiz "Abort called from class " -# - - -data_2: .asciiz "\n" -# - - -IO__TDT: .word 0, -1, -1, -1, -1, 1, 1, 2, 2 -Object__TDT: .word 1, 0, 1, 1, 1, 2, 2, 3, 3 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1 -Main__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1 -List__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 1 -Nil__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, -1 -Cons__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz "How many numbers to sort? " -# - - -data_5: .asciiz "\n" -# - - -.text -main: - jal entry - # syscall code 10 is for exit - li $v0, 10 - syscall - # Function END - -# function_in_string_at_IO implementation. -# @Params: -function_in_string_at_IO: - # Allocate stack frame for function function_in_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) - # Allocating 1024 bytes of memory - li $a0, 1024 - li $v0, 9 - syscall - move $t0, $v0 - move $a0, $v0 - li $a1, 1024 - li $v0, 8 - syscall - move $t2, $zero - move $t3, $zero - move $t1, $t0 - read_length_loop: - lb $t3, 0($t1) - beqz $t3, end_read_length_loop - addu $t1, $t1, 1 - addu $t2, $t2, 1 - j read_length_loop - end_read_length_loop: - subu $t1, $t1, 1 - sb $zero, 0($t1) - subu $t2, $t2, 1 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $t2, 16($v0) - sw $v0, -4($fp) - # RETURN local_in_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_out_int_at_IO implementation. -# @Params: -# 0($fp) = param_out_int_at_IO_x_0 -function_out_int_at_IO: - # Allocate stack frame for function function_out_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PRINT_INT param_out_int_at_IO_x_0 - # PARAM param_out_int_at_IO_x_0 --> 0($fp) - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 1 - syscall - # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) - # local_out_int_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_out_string_at_IO implementation. -# @Params: -# 0($fp) = param_out_string_at_IO_x_0 -function_out_string_at_IO: - # Allocate stack frame for function function_out_string_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # PARAM param_out_string_at_IO_x_0 --> 0($fp) - # PRINT_STR param_out_string_at_IO_x_0 - lw $v0, 0($fp) - lw $a0, 12($v0) - li $v0, 4 - syscall - # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) - # local_out_string_at_IO_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_out_string_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_out_string_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_in_int_at_IO implementation. -# @Params: -function_in_int_at_IO: - # Allocate stack frame for function function_in_int_at_IO. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) - # local_in_int_at_IO_internal_0 = READ_INT - li $v0, 5 - syscall - move $a2, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - sw $a2, 12($v0) - sw $v0, -4($fp) - # RETURN local_in_int_at_IO_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_in_int_at_IO. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_abort_at_Object implementation. -# @Params: -function_abort_at_Object: - # Allocate stack frame for function function_abort_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # LOCAL local_abort_at_Object_internal_0 --> -4($fp) - la $a0, data_1 - li $v0, 4 - syscall - lw $a0, -4($fp) - li $v0, 4 - syscall - la $a0, data_2 - li $v0, 4 - syscall - li $v0, 10 - syscall - # Function END - - -# function_copy_at_Object implementation. -# @Params: -function_copy_at_Object: - # Allocate stack frame for function function_copy_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_copy_at_Object_internal_0 --> -4($fp) - # local_copy_at_Object_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_copy_at_Object_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_copy_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_type_name_at_Object implementation. -# @Params: -function_type_name_at_Object: - # Allocate stack frame for function function_type_name_at_Object. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) - lw $t0, 0($s1) - sw $t0, -4($fp) - # RETURN local_type_name_at_Object_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_type_name_at_Object. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_concat_at_String implementation. -# @Params: -# 0($fp) = param_concat_at_String_s_0 -function_concat_at_String: - # Allocate stack frame for function function_concat_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT - # LOCAL local_concat_at_String_internal_0 --> -4($fp) - # PARAM param_concat_at_String_s_0 --> 0($fp) - # Get first string length from self - lw $t0, 16($s1) - # Get second string length from param - lw $v0, 0($fp) - lw $t1, 16($v0) - # Save new string length in a0 for memory allocation - addu $a0, $t0, $t1 - move $t3, $a0 - # Get first string from self - lw $t0, 12($s1) - # Get second string from param - lw $t1, 12($v0) - addu $a0, $a0, 4 - li $v0, 9 - syscall - move $t2, $v0 - move $t4, $zero - concat_loop1: - # Compare t0 with \0 - lb $t4, 0($t0) - beqz $t4, concat_loop1_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t0, $t0, 1 - j concat_loop1 - concat_loop1_end: - # Copy second string - concat_loop2: - # Compare t1 with \0 - lb $t4, 0($t1) - beqz $t4, concat_loop2_end - # Copy 1 byte - sb $t4, 0($t2) - addu $t2, $t2, 1 - addu $t1, $t1, 1 - j concat_loop2 - concat_loop2_end: - sb $zero, 0($t2) - # v0 contains resulting string - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_concat_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_concat_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_substr_at_String implementation. -# @Params: -# 0($fp) = param_substr_at_String_l_0 -# 4($fp) = param_substr_at_String_r_1 -function_substr_at_String: - # Allocate stack frame for function function_substr_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_substr_at_String_internal_0 --> -4($fp) - # PARAM param_substr_at_String_l_0 --> 4($fp) - # PARAM param_substr_at_String_r_1 --> 0($fp) - lw $t0, 12($s1) - lw $t2, 4($fp) - lw $t2, 12($t2) - addu $t0, $t0, $t2 - lw $a0, 0($fp) - lw $a0, 12($a0) - move $t3, $a0 - move $t1, $a0 - addu $a0, $a0, 1 - li $v0, 9 - syscall - move $t2, $v0 - substr_loop: - beqz $t1, substr_end - lb $a0, 0($t0) - sb $a0, 0($t2) - addu $t0, $t0, 1 - addu $t2, $t2, 1 - subu $t1, $t1, 1 - j substr_loop - substr_end: - sb $zero, 0($t2) - move $t1, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - sw $t1, 12($v0) - sw $t3, 16($v0) - sw $v0, -4($fp) - # RETURN local_substr_at_String_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_substr_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_length_at_String implementation. -# @Params: -function_length_at_String: - # Allocate stack frame for function function_length_at_String. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_length_at_String_internal_0 = GETATTRIBUTE length String - # LOCAL local_length_at_String_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # LOCAL local_length_at_String_internal_1 --> -8($fp) - # LOCAL local_length_at_String_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - lw $t0, -4($fp) - sw $t0, 12($v0) - sw $v0, -8($fp) - # RETURN local_length_at_String_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_length_at_String. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# entry implementation. -# @Params: -entry: - # Allocate stack frame for function entry. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local__internal_0 --> -4($fp) - # local__internal_0 = ALLOCATE Main - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Main - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Main_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__l__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # LOCAL local__internal_0 --> -4($fp) - lw $s1, -4($fp) - # local__internal_1 = CALL main - # LOCAL local__internal_1 --> -8($fp) - # LOCAL local__internal_0 --> -4($fp) - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type's VTABLE - la $t0, Main_vtable - # Get pointer to function address - lw $t1, 12($t0) - # Call function. Result is on $v0 - jalr $t1 - sw $v0, -8($fp) - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function entry. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Main__attrib__l__init implementation. -# @Params: -__Main__attrib__l__init: - # Allocate stack frame for function __Main__attrib__l__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Main__attrib__l__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_iota_at_Main implementation. -# @Params: -# 0($fp) = param_iota_at_Main_i_0 -function_iota_at_Main: - # Allocate stack frame for function function_iota_at_Main. - subu $sp, $sp, 56 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 56 - # LOCAL local_iota_at_Main_internal_0 --> -4($fp) - # local_iota_at_Main_internal_0 = ALLOCATE Nil - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Nil - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Nil_start - sw $t0, 4($v0) - # Load type offset - li $t0, 28 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -4($fp) - # - # LOCAL local_iota_at_Main_internal_0 --> -4($fp) - lw $t0, -4($fp) - sw $t0, 12($s1) - # LOCAL local_iota_at_Main_j_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -8($fp) - # LOCAL local_iota_at_Main_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # LOCAL local_iota_at_Main_j_1 --> -8($fp) - # LOCAL local_iota_at_Main_internal_2 --> -12($fp) - # local_iota_at_Main_j_1 = local_iota_at_Main_internal_2 - lw $t0, -12($fp) - sw $t0, -8($fp) - label_WHILE_1: - # LOCAL local_iota_at_Main_internal_4 --> -20($fp) - # LOCAL local_iota_at_Main_j_1 --> -8($fp) - # PARAM param_iota_at_Main_i_0 --> 0($fp) - lw $a0, -8($fp) - lw $a1, 0($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -20($fp) - # IF_GREATER_ZERO local_iota_at_Main_internal_4 GOTO label_FALSE_3 - # IF_GREATER_ZERO local_iota_at_Main_internal_4 GOTO label_FALSE_3 - lw $t0, -20($fp) - bgt $t0, 0, label_FALSE_3 - # IF_ZERO local_iota_at_Main_internal_4 GOTO label_FALSE_3 - # IF_ZERO local_iota_at_Main_internal_4 GOTO label_FALSE_3 - lw $t0, -20($fp) - beq $t0, 0, label_FALSE_3 - # LOCAL local_iota_at_Main_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -20($fp) - # GOTO label_END_4 -j label_END_4 -label_FALSE_3: - # LOCAL local_iota_at_Main_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -20($fp) - label_END_4: -# LOCAL local_iota_at_Main_internal_3 --> -16($fp) -# LOCAL local_iota_at_Main_internal_4 --> -20($fp) -# Obtain value from -20($fp) -lw $v0, -20($fp) -lw $v0, 12($v0) -sw $v0, -16($fp) -# IF_ZERO local_iota_at_Main_internal_3 GOTO label_WHILE_END_2 -# IF_ZERO local_iota_at_Main_internal_3 GOTO label_WHILE_END_2 -lw $t0, -16($fp) -beq $t0, 0, label_WHILE_END_2 -# LOCAL local_iota_at_Main_internal_7 --> -32($fp) -# local_iota_at_Main_internal_7 = ALLOCATE Cons -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type name -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Cons -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Cons_start -sw $t0, 4($v0) -# Load type offset -li $t0, 32 -sw $t0, 8($v0) -move $t1, $v0 -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -move $s1, $v0 -# Push register t1 into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -jal __Cons__attrib__xcar__init -# Pop 4 bytes from stack into register t1 -lw $t1, 0($sp) -addu $sp, $sp, 4 -sw $v0, 12($t1) -# Push register t1 into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -jal __Cons__attrib__xcdr__init -# Pop 4 bytes from stack into register t1 -lw $t1, 0($sp) -addu $sp, $sp, 4 -sw $v0, 16($t1) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -sw $t1, -32($fp) -# LOCAL local_iota_at_Main_internal_5 --> -24($fp) -# LOCAL local_iota_at_Main_internal_7 --> -32($fp) -# local_iota_at_Main_internal_5 = local_iota_at_Main_internal_7 -lw $t0, -32($fp) -sw $t0, -24($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_iota_at_Main_j_1 -# LOCAL local_iota_at_Main_j_1 --> -8($fp) -lw $t0, -8($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# local_iota_at_Main_internal_8 = GETATTRIBUTE l Main -# LOCAL local_iota_at_Main_internal_8 --> -36($fp) -lw $t0, 12($s1) -sw $t0, -36($fp) -# ARG local_iota_at_Main_internal_8 -# LOCAL local_iota_at_Main_internal_8 --> -36($fp) -lw $t0, -36($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_iota_at_Main_internal_5 --> -24($fp) -# LOCAL local_iota_at_Main_internal_6 --> -28($fp) -# local_iota_at_Main_internal_6 = VCALL local_iota_at_Main_internal_5 init -# Save new self pointer in $s1 -lw $s1, -24($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 16($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -28($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# -# LOCAL local_iota_at_Main_internal_6 --> -28($fp) -lw $t0, -28($fp) -sw $t0, 12($s1) -# LOCAL local_iota_at_Main_internal_10 --> -44($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -44($fp) -# LOCAL local_iota_at_Main_internal_9 --> -40($fp) -# LOCAL local_iota_at_Main_j_1 --> -8($fp) -# LOCAL local_iota_at_Main_internal_10 --> -44($fp) -# local_iota_at_Main_internal_9 = local_iota_at_Main_j_1 + local_iota_at_Main_internal_10 -lw $t1, -8($fp) -lw $t0, 12($t1) -lw $t1, -44($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -40($fp) -# LOCAL local_iota_at_Main_j_1 --> -8($fp) -# LOCAL local_iota_at_Main_internal_9 --> -40($fp) -# local_iota_at_Main_j_1 = local_iota_at_Main_internal_9 -lw $t0, -40($fp) -sw $t0, -8($fp) -# GOTO label_WHILE_1 -j label_WHILE_1 -label_WHILE_END_2: - # local_iota_at_Main_internal_11 = GETATTRIBUTE l Main - # LOCAL local_iota_at_Main_internal_11 --> -48($fp) - lw $t0, 12($s1) - sw $t0, -48($fp) - # RETURN local_iota_at_Main_internal_11 - lw $v0, -48($fp) - # Deallocate stack frame for function function_iota_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 56 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 72 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 72 - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_4 - sw $t0, 12($v0) - li $t0, 26 - sw $t0, 16($v0) - sw $v0, -16($fp) - # ARG local_main_at_Main_internal_3 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 64($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_12 = SELF - sw $s1, -52($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 - lw $t0, -52($fp) - sw $t0, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_15 = SELF - sw $s1, -64($fp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 - lw $t0, -64($fp) - sw $t0, -56($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 in_int - # Save new self pointer in $s1 - lw $s1, -56($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 72($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -60($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_main_at_Main_internal_14 - # LOCAL local_main_at_Main_internal_14 --> -60($fp) - lw $t0, -60($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 iota - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 8($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_8 = local_main_at_Main_internal_11 - lw $t0, -48($fp) - sw $t0, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_8 --> -36($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 rev - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 20($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_9 --> -40($fp) - # local_main_at_Main_internal_6 = local_main_at_Main_internal_9 - lw $t0, -40($fp) - sw $t0, -28($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_6 --> -28($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 sort - # Save new self pointer in $s1 - lw $s1, -28($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -32($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_7 --> -32($fp) - # local_main_at_Main_internal_4 = local_main_at_Main_internal_7 - lw $t0, -32($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 print_list - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 84($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_5 - lw $v0, -24($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 72 - jr $ra - # Function END - - -# function_isNil_at_List implementation. -# @Params: -function_isNil_at_List: - # Allocate stack frame for function function_isNil_at_List. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_List_internal_2 --> -12($fp) - # local_isNil_at_List_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_isNil_at_List_internal_0 --> -4($fp) - # LOCAL local_isNil_at_List_internal_2 --> -12($fp) - # local_isNil_at_List_internal_0 = local_isNil_at_List_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_isNil_at_List_internal_0 --> -4($fp) - # LOCAL local_isNil_at_List_internal_1 --> -8($fp) - # local_isNil_at_List_internal_1 = VCALL local_isNil_at_List_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 0($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_isNil_at_List_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -16($fp) - # RETURN local_isNil_at_List_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_isNil_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cons_at_List implementation. -# @Params: -# 0($fp) = param_cons_at_List_hd_0 -function_cons_at_List: - # Allocate stack frame for function function_cons_at_List. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_cons_at_List_new_cell_0 --> -4($fp) - # local_cons_at_List_new_cell_0 = 0 - li $t0, 0 - sw $t0, -4($fp) - # LOCAL local_cons_at_List_internal_1 --> -8($fp) - # local_cons_at_List_internal_1 = ALLOCATE Cons - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Cons - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Cons_start - sw $t0, 4($v0) - # Load type offset - li $t0, 32 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Cons__attrib__xcar__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Cons__attrib__xcdr__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -8($fp) - # LOCAL local_cons_at_List_new_cell_0 --> -4($fp) - # LOCAL local_cons_at_List_internal_1 --> -8($fp) - # local_cons_at_List_new_cell_0 = local_cons_at_List_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # LOCAL local_cons_at_List_internal_2 --> -12($fp) - # LOCAL local_cons_at_List_new_cell_0 --> -4($fp) - # local_cons_at_List_internal_2 = local_cons_at_List_new_cell_0 - lw $t0, -4($fp) - sw $t0, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cons_at_List_hd_0 - # PARAM param_cons_at_List_hd_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cons_at_List_internal_4 --> -20($fp) - # local_cons_at_List_internal_4 = SELF - sw $s1, -20($fp) - # ARG local_cons_at_List_internal_4 - # LOCAL local_cons_at_List_internal_4 --> -20($fp) - lw $t0, -20($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cons_at_List_internal_2 --> -12($fp) - # LOCAL local_cons_at_List_internal_3 --> -16($fp) - # local_cons_at_List_internal_3 = VCALL local_cons_at_List_internal_2 init - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 16($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_cons_at_List_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_cons_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_car_at_List implementation. -# @Params: -function_car_at_List: - # Allocate stack frame for function function_car_at_List. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_car_at_List_internal_2 --> -12($fp) - # local_car_at_List_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_car_at_List_internal_0 --> -4($fp) - # LOCAL local_car_at_List_internal_2 --> -12($fp) - # local_car_at_List_internal_0 = local_car_at_List_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_car_at_List_internal_0 --> -4($fp) - # LOCAL local_car_at_List_internal_1 --> -8($fp) - # local_car_at_List_internal_1 = VCALL local_car_at_List_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 0($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_car_at_List_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -16($fp) - # RETURN local_car_at_List_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_car_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cdr_at_List implementation. -# @Params: -function_cdr_at_List: - # Allocate stack frame for function function_cdr_at_List. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_cdr_at_List_internal_2 --> -12($fp) - # local_cdr_at_List_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_cdr_at_List_internal_0 --> -4($fp) - # LOCAL local_cdr_at_List_internal_2 --> -12($fp) - # local_cdr_at_List_internal_0 = local_cdr_at_List_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_cdr_at_List_internal_0 --> -4($fp) - # LOCAL local_cdr_at_List_internal_1 --> -8($fp) - # local_cdr_at_List_internal_1 = VCALL local_cdr_at_List_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 0($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_cdr_at_List_internal_3 --> -16($fp) - # local_cdr_at_List_internal_3 = ALLOCATE List - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, List - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, List_start - sw $t0, 4($v0) - # Load type offset - li $t0, 24 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -16($fp) - # RETURN local_cdr_at_List_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_cdr_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_rev_at_List implementation. -# @Params: -function_rev_at_List: - # Allocate stack frame for function function_rev_at_List. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_rev_at_List_internal_2 --> -12($fp) - # local_rev_at_List_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_rev_at_List_internal_0 --> -4($fp) - # LOCAL local_rev_at_List_internal_2 --> -12($fp) - # local_rev_at_List_internal_0 = local_rev_at_List_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_rev_at_List_internal_0 --> -4($fp) - # LOCAL local_rev_at_List_internal_1 --> -8($fp) - # local_rev_at_List_internal_1 = VCALL local_rev_at_List_internal_0 cdr - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 40($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_rev_at_List_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_rev_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_sort_at_List implementation. -# @Params: -function_sort_at_List: - # Allocate stack frame for function function_sort_at_List. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_sort_at_List_internal_2 --> -12($fp) - # local_sort_at_List_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_sort_at_List_internal_0 --> -4($fp) - # LOCAL local_sort_at_List_internal_2 --> -12($fp) - # local_sort_at_List_internal_0 = local_sort_at_List_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_sort_at_List_internal_0 --> -4($fp) - # LOCAL local_sort_at_List_internal_1 --> -8($fp) - # local_sort_at_List_internal_1 = VCALL local_sort_at_List_internal_0 cdr - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 40($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_sort_at_List_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_sort_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_insert_at_List implementation. -# @Params: -# 0($fp) = param_insert_at_List_i_0 -function_insert_at_List: - # Allocate stack frame for function function_insert_at_List. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_insert_at_List_internal_2 --> -12($fp) - # local_insert_at_List_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_insert_at_List_internal_0 --> -4($fp) - # LOCAL local_insert_at_List_internal_2 --> -12($fp) - # local_insert_at_List_internal_0 = local_insert_at_List_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_insert_at_List_internal_0 --> -4($fp) - # LOCAL local_insert_at_List_internal_1 --> -8($fp) - # local_insert_at_List_internal_1 = VCALL local_insert_at_List_internal_0 cdr - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 40($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_insert_at_List_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_insert_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_rcons_at_List implementation. -# @Params: -# 0($fp) = param_rcons_at_List_i_0 -function_rcons_at_List: - # Allocate stack frame for function function_rcons_at_List. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_rcons_at_List_internal_2 --> -12($fp) - # local_rcons_at_List_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_rcons_at_List_internal_0 --> -4($fp) - # LOCAL local_rcons_at_List_internal_2 --> -12($fp) - # local_rcons_at_List_internal_0 = local_rcons_at_List_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_rcons_at_List_internal_0 --> -4($fp) - # LOCAL local_rcons_at_List_internal_1 --> -8($fp) - # local_rcons_at_List_internal_1 = VCALL local_rcons_at_List_internal_0 cdr - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 40($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_rcons_at_List_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_rcons_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_print_list_at_List implementation. -# @Params: -function_print_list_at_List: - # Allocate stack frame for function function_print_list_at_List. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_print_list_at_List_internal_2 --> -12($fp) - # local_print_list_at_List_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_print_list_at_List_internal_0 --> -4($fp) - # LOCAL local_print_list_at_List_internal_2 --> -12($fp) - # local_print_list_at_List_internal_0 = local_print_list_at_List_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_List_internal_0 --> -4($fp) - # LOCAL local_print_list_at_List_internal_1 --> -8($fp) - # local_print_list_at_List_internal_1 = VCALL local_print_list_at_List_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 0($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_list_at_List_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_print_list_at_List. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_Nil implementation. -# @Params: -function_isNil_at_Nil: - # Allocate stack frame for function function_isNil_at_Nil. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_Nil_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_isNil_at_Nil_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_isNil_at_Nil. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_rev_at_Nil implementation. -# @Params: -function_rev_at_Nil: - # Allocate stack frame for function function_rev_at_Nil. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_rev_at_Nil_internal_0 --> -4($fp) - # local_rev_at_Nil_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_rev_at_Nil_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_rev_at_Nil. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_sort_at_Nil implementation. -# @Params: -function_sort_at_Nil: - # Allocate stack frame for function function_sort_at_Nil. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_sort_at_Nil_internal_0 --> -4($fp) - # local_sort_at_Nil_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_sort_at_Nil_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_sort_at_Nil. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_insert_at_Nil implementation. -# @Params: -# 0($fp) = param_insert_at_Nil_i_0 -function_insert_at_Nil: - # Allocate stack frame for function function_insert_at_Nil. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_insert_at_Nil_internal_2 --> -12($fp) - # local_insert_at_Nil_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_insert_at_Nil_internal_0 --> -4($fp) - # LOCAL local_insert_at_Nil_internal_2 --> -12($fp) - # local_insert_at_Nil_internal_0 = local_insert_at_Nil_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_insert_at_Nil_i_0 - # PARAM param_insert_at_Nil_i_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_insert_at_Nil_internal_0 --> -4($fp) - # LOCAL local_insert_at_Nil_internal_1 --> -8($fp) - # local_insert_at_Nil_internal_1 = VCALL local_insert_at_Nil_internal_0 rcons - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 76($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_insert_at_Nil_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_insert_at_Nil. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_rcons_at_Nil implementation. -# @Params: -# 0($fp) = param_rcons_at_Nil_i_0 -function_rcons_at_Nil: - # Allocate stack frame for function function_rcons_at_Nil. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_rcons_at_Nil_internal_2 --> -12($fp) - # local_rcons_at_Nil_internal_2 = ALLOCATE Cons - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Cons - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Cons_start - sw $t0, 4($v0) - # Load type offset - li $t0, 32 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Cons__attrib__xcar__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Cons__attrib__xcdr__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -12($fp) - # LOCAL local_rcons_at_Nil_internal_0 --> -4($fp) - # LOCAL local_rcons_at_Nil_internal_2 --> -12($fp) - # local_rcons_at_Nil_internal_0 = local_rcons_at_Nil_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_rcons_at_Nil_i_0 - # PARAM param_rcons_at_Nil_i_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_rcons_at_Nil_internal_3 --> -16($fp) - # local_rcons_at_Nil_internal_3 = SELF - sw $s1, -16($fp) - # ARG local_rcons_at_Nil_internal_3 - # LOCAL local_rcons_at_Nil_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_rcons_at_Nil_internal_0 --> -4($fp) - # LOCAL local_rcons_at_Nil_internal_1 --> -8($fp) - # local_rcons_at_Nil_internal_1 = VCALL local_rcons_at_Nil_internal_0 init - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 16($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_rcons_at_Nil_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_rcons_at_Nil. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_print_list_at_Nil implementation. -# @Params: -function_print_list_at_Nil: - # Allocate stack frame for function function_print_list_at_Nil. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_print_list_at_Nil_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_print_list_at_Nil_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_print_list_at_Nil. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Cons__attrib__xcar__init implementation. -# @Params: -__Cons__attrib__xcar__init: - # Allocate stack frame for function __Cons__attrib__xcar__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__xcar__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__xcar__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Cons__attrib__xcar__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Cons__attrib__xcdr__init implementation. -# @Params: -__Cons__attrib__xcdr__init: - # Allocate stack frame for function __Cons__attrib__xcdr__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __Cons__attrib__xcdr__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_Cons implementation. -# @Params: -function_isNil_at_Cons: - # Allocate stack frame for function function_isNil_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_Cons_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_isNil_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_isNil_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_Cons implementation. -# @Params: -# 0($fp) = param_init_at_Cons_hd_0 -# 4($fp) = param_init_at_Cons_tl_1 -function_init_at_Cons: - # Allocate stack frame for function function_init_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_Cons_hd_0 --> 4($fp) - lw $t0, 4($fp) - sw $t0, 12($s1) - # - # PARAM param_init_at_Cons_tl_1 --> 0($fp) - lw $t0, 0($fp) - sw $t0, 16($s1) - # LOCAL local_init_at_Cons_internal_0 --> -4($fp) - # local_init_at_Cons_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_init_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_init_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_car_at_Cons implementation. -# @Params: -function_car_at_Cons: - # Allocate stack frame for function function_car_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_car_at_Cons_internal_0 = GETATTRIBUTE xcar Cons - # LOCAL local_car_at_Cons_internal_0 --> -4($fp) - lw $t0, 12($s1) - sw $t0, -4($fp) - # RETURN local_car_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_car_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cdr_at_Cons implementation. -# @Params: -function_cdr_at_Cons: - # Allocate stack frame for function function_cdr_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_cdr_at_Cons_internal_0 = GETATTRIBUTE xcdr Cons - # LOCAL local_cdr_at_Cons_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_cdr_at_Cons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_cdr_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_rev_at_Cons implementation. -# @Params: -function_rev_at_Cons: - # Allocate stack frame for function function_rev_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_rev_at_Cons_internal_4 = GETATTRIBUTE xcdr Cons - # LOCAL local_rev_at_Cons_internal_4 --> -20($fp) - lw $t0, 16($s1) - sw $t0, -20($fp) - # LOCAL local_rev_at_Cons_internal_2 --> -12($fp) - # LOCAL local_rev_at_Cons_internal_4 --> -20($fp) - # local_rev_at_Cons_internal_2 = local_rev_at_Cons_internal_4 - lw $t0, -20($fp) - sw $t0, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_rev_at_Cons_internal_2 --> -12($fp) - # LOCAL local_rev_at_Cons_internal_3 --> -16($fp) - # local_rev_at_Cons_internal_3 = VCALL local_rev_at_Cons_internal_2 rev - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 20($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_rev_at_Cons_internal_0 --> -4($fp) - # LOCAL local_rev_at_Cons_internal_3 --> -16($fp) - # local_rev_at_Cons_internal_0 = local_rev_at_Cons_internal_3 - lw $t0, -16($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_rev_at_Cons_internal_5 = GETATTRIBUTE xcar Cons - # LOCAL local_rev_at_Cons_internal_5 --> -24($fp) - lw $t0, 12($s1) - sw $t0, -24($fp) - # ARG local_rev_at_Cons_internal_5 - # LOCAL local_rev_at_Cons_internal_5 --> -24($fp) - lw $t0, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_rev_at_Cons_internal_0 --> -4($fp) - # LOCAL local_rev_at_Cons_internal_1 --> -8($fp) - # local_rev_at_Cons_internal_1 = VCALL local_rev_at_Cons_internal_0 rcons - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 76($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_rev_at_Cons_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_rev_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_sort_at_Cons implementation. -# @Params: -function_sort_at_Cons: - # Allocate stack frame for function function_sort_at_Cons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_sort_at_Cons_internal_4 = GETATTRIBUTE xcdr Cons - # LOCAL local_sort_at_Cons_internal_4 --> -20($fp) - lw $t0, 16($s1) - sw $t0, -20($fp) - # LOCAL local_sort_at_Cons_internal_2 --> -12($fp) - # LOCAL local_sort_at_Cons_internal_4 --> -20($fp) - # local_sort_at_Cons_internal_2 = local_sort_at_Cons_internal_4 - lw $t0, -20($fp) - sw $t0, -12($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_sort_at_Cons_internal_2 --> -12($fp) - # LOCAL local_sort_at_Cons_internal_3 --> -16($fp) - # local_sort_at_Cons_internal_3 = VCALL local_sort_at_Cons_internal_2 sort - # Save new self pointer in $s1 - lw $s1, -12($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -16($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_sort_at_Cons_internal_0 --> -4($fp) - # LOCAL local_sort_at_Cons_internal_3 --> -16($fp) - # local_sort_at_Cons_internal_0 = local_sort_at_Cons_internal_3 - lw $t0, -16($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_sort_at_Cons_internal_5 = GETATTRIBUTE xcar Cons - # LOCAL local_sort_at_Cons_internal_5 --> -24($fp) - lw $t0, 12($s1) - sw $t0, -24($fp) - # ARG local_sort_at_Cons_internal_5 - # LOCAL local_sort_at_Cons_internal_5 --> -24($fp) - lw $t0, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_sort_at_Cons_internal_0 --> -4($fp) - # LOCAL local_sort_at_Cons_internal_1 --> -8($fp) - # local_sort_at_Cons_internal_1 = VCALL local_sort_at_Cons_internal_0 insert - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 56($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_sort_at_Cons_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_sort_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_insert_at_Cons implementation. -# @Params: -# 0($fp) = param_insert_at_Cons_i_0 -function_insert_at_Cons: - # Allocate stack frame for function function_insert_at_Cons. - subu $sp, $sp, 68 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 68 - # local_insert_at_Cons_internal_3 = GETATTRIBUTE xcar Cons - # LOCAL local_insert_at_Cons_internal_3 --> -16($fp) - lw $t0, 12($s1) - sw $t0, -16($fp) - # LOCAL local_insert_at_Cons_internal_2 --> -12($fp) - # PARAM param_insert_at_Cons_i_0 --> 0($fp) - # LOCAL local_insert_at_Cons_internal_3 --> -16($fp) - lw $a0, 0($fp) - lw $a1, -16($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -12($fp) - # IF_GREATER_ZERO local_insert_at_Cons_internal_2 GOTO label_FALSE_7 - # IF_GREATER_ZERO local_insert_at_Cons_internal_2 GOTO label_FALSE_7 - lw $t0, -12($fp) - bgt $t0, 0, label_FALSE_7 - # IF_ZERO local_insert_at_Cons_internal_2 GOTO label_FALSE_7 - # IF_ZERO local_insert_at_Cons_internal_2 GOTO label_FALSE_7 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_7 - # LOCAL local_insert_at_Cons_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_8 -j label_END_8 -label_FALSE_7: - # LOCAL local_insert_at_Cons_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_8: -# LOCAL local_insert_at_Cons_internal_0 --> -4($fp) -# LOCAL local_insert_at_Cons_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_insert_at_Cons_internal_0 GOTO label_FALSEIF_5 -# IF_ZERO local_insert_at_Cons_internal_0 GOTO label_FALSEIF_5 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_5 -# LOCAL local_insert_at_Cons_internal_6 --> -28($fp) -# local_insert_at_Cons_internal_6 = ALLOCATE Cons -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type name -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Cons -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Cons_start -sw $t0, 4($v0) -# Load type offset -li $t0, 32 -sw $t0, 8($v0) -move $t1, $v0 -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -move $s1, $v0 -# Push register t1 into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -jal __Cons__attrib__xcar__init -# Pop 4 bytes from stack into register t1 -lw $t1, 0($sp) -addu $sp, $sp, 4 -sw $v0, 12($t1) -# Push register t1 into stack -subu $sp, $sp, 4 -sw $t1, 0($sp) -jal __Cons__attrib__xcdr__init -# Pop 4 bytes from stack into register t1 -lw $t1, 0($sp) -addu $sp, $sp, 4 -sw $v0, 16($t1) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -sw $t1, -28($fp) -# LOCAL local_insert_at_Cons_internal_4 --> -20($fp) -# LOCAL local_insert_at_Cons_internal_6 --> -28($fp) -# local_insert_at_Cons_internal_4 = local_insert_at_Cons_internal_6 -lw $t0, -28($fp) -sw $t0, -20($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG param_insert_at_Cons_i_0 -# PARAM param_insert_at_Cons_i_0 --> 0($fp) -lw $t0, 0($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_insert_at_Cons_internal_7 --> -32($fp) -# local_insert_at_Cons_internal_7 = SELF -sw $s1, -32($fp) -# ARG local_insert_at_Cons_internal_7 -# LOCAL local_insert_at_Cons_internal_7 --> -32($fp) -lw $t0, -32($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_insert_at_Cons_internal_4 --> -20($fp) -# LOCAL local_insert_at_Cons_internal_5 --> -24($fp) -# local_insert_at_Cons_internal_5 = VCALL local_insert_at_Cons_internal_4 init -# Save new self pointer in $s1 -lw $s1, -20($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 16($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -24($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_insert_at_Cons_internal_1 --> -8($fp) -# LOCAL local_insert_at_Cons_internal_5 --> -24($fp) -# local_insert_at_Cons_internal_1 = local_insert_at_Cons_internal_5 -lw $t0, -24($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_6 -j label_ENDIF_6 -label_FALSEIF_5: - # LOCAL local_insert_at_Cons_internal_10 --> -44($fp) - # local_insert_at_Cons_internal_10 = ALLOCATE Cons - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Cons - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Cons_start - sw $t0, 4($v0) - # Load type offset - li $t0, 32 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Cons__attrib__xcar__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Cons__attrib__xcdr__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -44($fp) - # LOCAL local_insert_at_Cons_internal_8 --> -36($fp) - # LOCAL local_insert_at_Cons_internal_10 --> -44($fp) - # local_insert_at_Cons_internal_8 = local_insert_at_Cons_internal_10 - lw $t0, -44($fp) - sw $t0, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_insert_at_Cons_internal_11 = GETATTRIBUTE xcar Cons - # LOCAL local_insert_at_Cons_internal_11 --> -48($fp) - lw $t0, 12($s1) - sw $t0, -48($fp) - # ARG local_insert_at_Cons_internal_11 - # LOCAL local_insert_at_Cons_internal_11 --> -48($fp) - lw $t0, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # local_insert_at_Cons_internal_14 = GETATTRIBUTE xcdr Cons - # LOCAL local_insert_at_Cons_internal_14 --> -60($fp) - lw $t0, 16($s1) - sw $t0, -60($fp) - # LOCAL local_insert_at_Cons_internal_12 --> -52($fp) - # LOCAL local_insert_at_Cons_internal_14 --> -60($fp) - # local_insert_at_Cons_internal_12 = local_insert_at_Cons_internal_14 - lw $t0, -60($fp) - sw $t0, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_insert_at_Cons_i_0 - # PARAM param_insert_at_Cons_i_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_insert_at_Cons_internal_12 --> -52($fp) - # LOCAL local_insert_at_Cons_internal_13 --> -56($fp) - # local_insert_at_Cons_internal_13 = VCALL local_insert_at_Cons_internal_12 insert - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 56($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_insert_at_Cons_internal_13 - # LOCAL local_insert_at_Cons_internal_13 --> -56($fp) - lw $t0, -56($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_insert_at_Cons_internal_8 --> -36($fp) - # LOCAL local_insert_at_Cons_internal_9 --> -40($fp) - # local_insert_at_Cons_internal_9 = VCALL local_insert_at_Cons_internal_8 init - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 16($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_insert_at_Cons_internal_1 --> -8($fp) - # LOCAL local_insert_at_Cons_internal_9 --> -40($fp) - # local_insert_at_Cons_internal_1 = local_insert_at_Cons_internal_9 - lw $t0, -40($fp) - sw $t0, -8($fp) - label_ENDIF_6: -# RETURN local_insert_at_Cons_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_insert_at_Cons. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 68 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_rcons_at_Cons implementation. -# @Params: -# 0($fp) = param_rcons_at_Cons_i_0 -function_rcons_at_Cons: - # Allocate stack frame for function function_rcons_at_Cons. - subu $sp, $sp, 36 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 36 - # LOCAL local_rcons_at_Cons_internal_2 --> -12($fp) - # local_rcons_at_Cons_internal_2 = ALLOCATE Cons - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Cons - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Cons_start - sw $t0, 4($v0) - # Load type offset - li $t0, 32 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Cons__attrib__xcar__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Cons__attrib__xcdr__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -12($fp) - # LOCAL local_rcons_at_Cons_internal_0 --> -4($fp) - # LOCAL local_rcons_at_Cons_internal_2 --> -12($fp) - # local_rcons_at_Cons_internal_0 = local_rcons_at_Cons_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_rcons_at_Cons_internal_3 = GETATTRIBUTE xcar Cons - # LOCAL local_rcons_at_Cons_internal_3 --> -16($fp) - lw $t0, 12($s1) - sw $t0, -16($fp) - # ARG local_rcons_at_Cons_internal_3 - # LOCAL local_rcons_at_Cons_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # local_rcons_at_Cons_internal_6 = GETATTRIBUTE xcdr Cons - # LOCAL local_rcons_at_Cons_internal_6 --> -28($fp) - lw $t0, 16($s1) - sw $t0, -28($fp) - # LOCAL local_rcons_at_Cons_internal_4 --> -20($fp) - # LOCAL local_rcons_at_Cons_internal_6 --> -28($fp) - # local_rcons_at_Cons_internal_4 = local_rcons_at_Cons_internal_6 - lw $t0, -28($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_rcons_at_Cons_i_0 - # PARAM param_rcons_at_Cons_i_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_rcons_at_Cons_internal_4 --> -20($fp) - # LOCAL local_rcons_at_Cons_internal_5 --> -24($fp) - # local_rcons_at_Cons_internal_5 = VCALL local_rcons_at_Cons_internal_4 rcons - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 76($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_rcons_at_Cons_internal_5 - # LOCAL local_rcons_at_Cons_internal_5 --> -24($fp) - lw $t0, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_rcons_at_Cons_internal_0 --> -4($fp) - # LOCAL local_rcons_at_Cons_internal_1 --> -8($fp) - # local_rcons_at_Cons_internal_1 = VCALL local_rcons_at_Cons_internal_0 init - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 16($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_rcons_at_Cons_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_rcons_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 36 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_print_list_at_Cons implementation. -# @Params: -function_print_list_at_Cons: - # Allocate stack frame for function function_print_list_at_Cons. - subu $sp, $sp, 52 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 52 - # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) - # local_print_list_at_Cons_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) - # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) - # local_print_list_at_Cons_internal_0 = local_print_list_at_Cons_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_list_at_Cons_internal_3 = GETATTRIBUTE xcar Cons - # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) - lw $t0, 12($s1) - sw $t0, -16($fp) - # ARG local_print_list_at_Cons_internal_3 - # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) - # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) - # local_print_list_at_Cons_internal_1 = VCALL local_print_list_at_Cons_internal_0 out_int - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_6 = SELF - sw $s1, -28($fp) - # LOCAL local_print_list_at_Cons_internal_4 --> -20($fp) - # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) - # local_print_list_at_Cons_internal_4 = local_print_list_at_Cons_internal_6 - lw $t0, -28($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_5 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -32($fp) - # ARG local_print_list_at_Cons_internal_7 - # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) - lw $t0, -32($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_list_at_Cons_internal_4 --> -20($fp) - # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) - # local_print_list_at_Cons_internal_5 = VCALL local_print_list_at_Cons_internal_4 out_string - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 64($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_print_list_at_Cons_internal_10 = GETATTRIBUTE xcdr Cons - # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) - lw $t0, 16($s1) - sw $t0, -44($fp) - # LOCAL local_print_list_at_Cons_internal_8 --> -36($fp) - # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) - # local_print_list_at_Cons_internal_8 = local_print_list_at_Cons_internal_10 - lw $t0, -44($fp) - sw $t0, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_list_at_Cons_internal_8 --> -36($fp) - # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) - # local_print_list_at_Cons_internal_9 = VCALL local_print_list_at_Cons_internal_8 print_list - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 84($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_list_at_Cons_internal_9 - lw $v0, -40($fp) - # Deallocate stack frame for function function_print_list_at_Cons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 52 - jr $ra - # Function END - From 96ad3487b9a880a04a40d6ee2a7fe654bc15fda7 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Mon, 7 Dec 2020 23:14:15 -0500 Subject: [PATCH 158/162] compiled --- src/.builds | 1 + 1 file changed, 1 insertion(+) diff --git a/src/.builds b/src/.builds index 35688886..85294e48 100644 --- a/src/.builds +++ b/src/.builds @@ -213,3 +213,4 @@ 1 1 1 +1 From cec78726b553e686b3bd2eb744efe21b187a7ffe Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Mon, 7 Dec 2020 23:55:28 -0500 Subject: [PATCH 159/162] change makefile --- .vscode/settings.json | 2 +- src/.builds | 2 ++ src/makefile | 28 +--------------------------- 3 files changed, 4 insertions(+), 28 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index d15d2da2..7ffbe79d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,5 @@ { - "python.pythonPath": "/bin/python", + "python.pythonPath": "/usr/bin/python3.9", "cmake.configureOnOpen": false, "python.linting.enabled": false, "python.linting.mypyEnabled": true, diff --git a/src/.builds b/src/.builds index 85294e48..f988f524 100644 --- a/src/.builds +++ b/src/.builds @@ -214,3 +214,5 @@ 1 1 1 +1 +1 diff --git a/src/makefile b/src/makefile index 868f7d90..62cc382f 100644 --- a/src/makefile +++ b/src/makefile @@ -1,40 +1,14 @@ -# Find a python3 version on the System -ifndef PYTHON - PYTHON:=$(shell if which python > "/dev/null" 2>&1; \ - then echo "python"; \ - else \ - echo "No python on system Path"; \ - exit 1; \ - fi) -endif - -# also find pip -PIP:=$(shell which pip3) - -ifeq ($(PIP), "") - echo "*** Please install pip3 and make sure it is in your System PATH ***"; - exit 1; -endif - .PHONY: clean #define some macros COMPSTRUCTFILE=compiler_struct.py -PIPREQUIREMENTS=cloudpickle - -# pyinstaller modules -COOLCIMPORTS= ~/.pycoocl -PYFLAGS= --onefile -n pycoolc --paths $(COOLCIMPORTS) -$MODULES= abstract automatons baseNodeTree coolgrammar grammar lexer parserr tools travels typecheck # This is intended for setting a local compiler for testing. main: - @echo "[*] Installing python dependencies" - @$(PIP) install $(PIPREQUIREMENTS) @echo "[*] Compiling Cool Lexical structures" @mkdir build @touch build/$(COMPSTRUCTFILE) - @$(PYTHON) install.py build/$(COMPSTRUCTFILE) + @python install.py build/$(COMPSTRUCTFILE) @touch build/__init__.py @echo 1 >> .builds From 2cd442de07601fc69c4a1944716934fc70157d02 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Tue, 8 Dec 2020 17:58:07 -0500 Subject: [PATCH 160/162] Fix EOF handling. Case graph was wrongly passed, now it is OK --- .vscode/settings.json | 2 +- src/.builds | 1 + src/testing.mips | 3078 ++++- src/testing.py | 12 +- src/travels/ciltomips.py | 7 +- tests/codegen/arith.mips | 22254 +++++++++++++++++++++++++++++++ tests/codegen/atoi.mips | 10089 ++++++++++++++ tests/codegen/book_list.mips | 3057 +++++ tests/codegen/cells.mips | 4338 ++++++ tests/codegen/complex.mips | 3339 +++++ tests/codegen/fib.mips | 1568 +++ tests/codegen/graph.mips | 11753 ++++++++++++++++ tests/codegen/hairyscary.mips | 3624 +++++ tests/codegen/hello_world.mips | 748 ++ tests/codegen/io.mips | 1453 ++ tests/codegen/life.mips | 21981 ++++++++++++++++++++++++++++++ tests/codegen/list.mips | 2112 +++ tests/codegen/new_complex.mips | 4219 ++++++ tests/codegen/palindrome.mips | 2423 ++++ tests/codegen/primes.mips | 2374 ++++ tests/codegen/print-cool.mips | 1172 ++ tests/codegen/sort-list.mips | 3367 +++++ 22 files changed, 102699 insertions(+), 272 deletions(-) create mode 100644 tests/codegen/arith.mips create mode 100644 tests/codegen/atoi.mips create mode 100644 tests/codegen/book_list.mips create mode 100644 tests/codegen/cells.mips create mode 100644 tests/codegen/complex.mips create mode 100644 tests/codegen/fib.mips create mode 100644 tests/codegen/graph.mips create mode 100644 tests/codegen/hairyscary.mips create mode 100644 tests/codegen/hello_world.mips create mode 100644 tests/codegen/io.mips create mode 100644 tests/codegen/life.mips create mode 100644 tests/codegen/list.mips create mode 100644 tests/codegen/new_complex.mips create mode 100644 tests/codegen/palindrome.mips create mode 100644 tests/codegen/primes.mips create mode 100644 tests/codegen/print-cool.mips create mode 100644 tests/codegen/sort-list.mips diff --git a/.vscode/settings.json b/.vscode/settings.json index 7ffbe79d..d15d2da2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,5 @@ { - "python.pythonPath": "/usr/bin/python3.9", + "python.pythonPath": "/bin/python", "cmake.configureOnOpen": false, "python.linting.enabled": false, "python.linting.mypyEnabled": true, diff --git a/src/.builds b/src/.builds index f988f524..faf6fc65 100644 --- a/src/.builds +++ b/src/.builds @@ -216,3 +216,4 @@ 1 1 1 +1 diff --git a/src/testing.mips b/src/testing.mips index 5d66bb1a..5159c748 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 7 22:58:52 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 01:50:00 2020 # School of Math and Computer Science, University of Havana # @@ -40,7 +40,7 @@ Vertice: .asciiz "Vertice" # **** VTABLE for type IO **** -IO_vtable: .word dummy, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_in_int_at_IO, dummy, function_copy_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy +IO_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy # Function END # @@ -54,7 +54,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy +Object_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -68,7 +68,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_length_at_String, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, function_concat_at_String, dummy, dummy +String_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, function_length_at_String, dummy, dummy, dummy, dummy, function_concat_at_String, dummy, dummy, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -82,7 +82,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy +Bool_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -96,7 +96,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy +Int_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -110,7 +110,7 @@ Int_end: # **** VTABLE for type BoolOp **** -BoolOp_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_or_at_BoolOp, dummy, dummy, function_abort_at_Object, dummy, function_and_at_BoolOp, dummy +BoolOp_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_or_at_BoolOp, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_and_at_BoolOp, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -124,7 +124,7 @@ BoolOp_end: # **** VTABLE for type Graph **** -Graph_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_add_vertice_at_Graph, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_print_V_at_Graph, dummy, dummy, function_print_E_at_Graph, dummy, function_abort_at_Object, dummy, dummy, dummy +Graph_vtable: .word dummy, function_abort_at_Object, dummy, dummy, function_add_vertice_at_Graph, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_print_E_at_Graph, function_print_V_at_Graph, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -138,7 +138,7 @@ Graph_end: # **** VTABLE for type Parse **** -Parse_vtable: .word function_read_input_at_Parse, function_in_string_at_IO, function_a2i_at_Parse, dummy, dummy, function_a2i_aux_at_Parse, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_c2i_at_Parse, dummy, function_in_int_at_IO, dummy, function_copy_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_parse_line_at_Parse +Parse_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, function_a2i_aux_at_Parse, function_out_int_at_IO, function_parse_line_at_Parse, function_a2i_at_Parse, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, dummy, dummy, dummy, function_c2i_at_Parse, function_read_input_at_Parse # Function END # @@ -152,7 +152,7 @@ Parse_end: # **** VTABLE for type Main **** -Main_vtable: .word function_read_input_at_Parse, function_in_string_at_IO, function_a2i_at_Parse, dummy, dummy, function_a2i_aux_at_Parse, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, function_main_at_Main, dummy, function_type_name_at_Object, dummy, function_c2i_at_Parse, dummy, function_in_int_at_IO, dummy, function_copy_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_parse_line_at_Parse +Main_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, function_a2i_aux_at_Parse, function_out_int_at_IO, function_parse_line_at_Parse, function_a2i_at_Parse, dummy, dummy, dummy, dummy, dummy, dummy, function_main_at_Main, function_type_name_at_Object, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, dummy, dummy, dummy, function_c2i_at_Parse, function_read_input_at_Parse # Function END # @@ -166,7 +166,7 @@ Main_end: # **** VTABLE for type VList **** -VList_vtable: .word dummy, function_in_string_at_IO, dummy, dummy, function_print_at_VList, dummy, function_isNil_at_VList, function_cons_at_VList, function_out_int_at_IO, dummy, function_head_at_VList, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_in_int_at_IO, dummy, function_copy_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, function_tail_at_VList, function_abort_at_Object, dummy, dummy, dummy +VList_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, function_head_at_VList, function_print_at_VList, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, function_isNil_at_VList, function_cons_at_VList, function_tail_at_VList, dummy, dummy # Function END # @@ -180,7 +180,7 @@ VList_end: # **** VTABLE for type VCons **** -VCons_vtable: .word dummy, function_in_string_at_IO, dummy, dummy, function_print_at_VCons, dummy, function_isNil_at_VCons, function_cons_at_VList, function_out_int_at_IO, dummy, function_head_at_VCons, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_in_int_at_IO, function_init_at_VCons, function_copy_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, function_tail_at_VCons, function_abort_at_Object, dummy, dummy, dummy +VCons_vtable: .word dummy, function_abort_at_Object, function_init_at_VCons, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, function_head_at_VCons, function_print_at_VCons, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, function_isNil_at_VCons, function_cons_at_VList, function_tail_at_VCons, dummy, dummy # Function END # @@ -194,7 +194,7 @@ VCons_end: # **** VTABLE for type EList **** -EList_vtable: .word dummy, function_in_string_at_IO, dummy, dummy, function_print_at_EList, dummy, function_isNil_at_EList, function_cons_at_EList, function_out_int_at_IO, dummy, function_head_at_EList, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_append_at_EList, function_in_int_at_IO, dummy, function_copy_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, function_tail_at_EList, function_abort_at_Object, dummy, dummy, dummy +EList_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, function_append_at_EList, dummy, function_in_int_at_IO, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, function_head_at_EList, function_print_at_EList, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, function_isNil_at_EList, function_cons_at_EList, function_tail_at_EList, dummy, dummy # Function END # @@ -208,7 +208,7 @@ EList_end: # **** VTABLE for type ECons **** -ECons_vtable: .word dummy, function_in_string_at_IO, dummy, dummy, function_print_at_ECons, dummy, function_isNil_at_ECons, function_cons_at_EList, function_out_int_at_IO, dummy, function_head_at_ECons, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_append_at_EList, function_in_int_at_IO, function_init_at_ECons, function_copy_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, function_tail_at_ECons, function_abort_at_Object, dummy, dummy, dummy +ECons_vtable: .word dummy, function_abort_at_Object, function_init_at_ECons, dummy, dummy, dummy, function_append_at_EList, dummy, function_in_int_at_IO, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, function_head_at_ECons, function_print_at_ECons, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, function_isNil_at_ECons, function_cons_at_EList, function_tail_at_ECons, dummy, dummy # Function END # @@ -222,7 +222,7 @@ ECons_end: # **** VTABLE for type Edge **** -Edge_vtable: .word dummy, function_in_string_at_IO, dummy, dummy, function_print_at_Edge, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_in_int_at_IO, function_init_at_Edge, function_copy_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy +Edge_vtable: .word dummy, function_abort_at_Object, function_init_at_Edge, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, function_print_at_Edge, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy # Function END # @@ -236,7 +236,7 @@ Edge_end: # **** VTABLE for type Vertice **** -Vertice_vtable: .word dummy, function_in_string_at_IO, dummy, dummy, function_print_at_Vertice, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, function_number_at_Vertice, dummy, function_outgoing_at_Vertice, function_type_name_at_Object, dummy, dummy, dummy, function_in_int_at_IO, function_init_at_Vertice, function_copy_at_Object, function_out_string_at_IO, dummy, function_add_out_at_Vertice, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy +Vertice_vtable: .word function_add_out_at_Vertice, function_abort_at_Object, function_init_at_Vertice, function_outgoing_at_Vertice, dummy, dummy, dummy, function_number_at_Vertice, function_in_int_at_IO, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, function_print_at_Vertice, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy # Function END # @@ -351,23 +351,111 @@ data_21: .asciiz "" # -data_22: .asciiz "\n" +data_22: .asciiz "" # -data_23: .asciiz "\n" +data_23: .asciiz "" # -data_24: .asciiz " (" +data_24: .asciiz "True \n" # -data_25: .asciiz "," +data_25: .asciiz "False\n" # -data_26: .asciiz ")" +data_26: .asciiz "" +# + + +data_27: .asciiz "True \n" +# + + +data_28: .asciiz "False\n" +# + + +data_29: .asciiz "" +# + + +data_30: .asciiz "True \n" +# + + +data_31: .asciiz "False\n" +# + + +data_32: .asciiz "" +# + + +data_33: .asciiz "True \n" +# + + +data_34: .asciiz "False\n" +# + + +data_35: .asciiz "" +# + + +data_36: .asciiz "True \n" +# + + +data_37: .asciiz "False\n" +# + + +data_38: .asciiz "" +# + + +data_39: .asciiz "True \n" +# + + +data_40: .asciiz "False\n" +# + + +data_41: .asciiz "" +# + + +data_42: .asciiz "True \n" +# + + +data_43: .asciiz "False\n" +# + + +data_44: .asciiz "\n" +# + + +data_45: .asciiz "\n" +# + + +data_46: .asciiz " (" +# + + +data_47: .asciiz "," +# + + +data_48: .asciiz ")" # @@ -642,7 +730,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -866,8 +954,8 @@ entry: li $t0, 4 sw $t0, 16($v0) move $t0, $v0 - # Allocating 24 bytes of memory - li $a0, 24 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall sw $t0, 0($v0) @@ -897,14 +985,6 @@ entry: lw $t1, 0($sp) addu $sp, $sp, 4 sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Main__attrib__g__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 @@ -919,7 +999,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 48($t0) + lw $t1, 84($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -1257,7 +1337,7 @@ function_add_vertice_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -1292,7 +1372,7 @@ function_add_vertice_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 68($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1331,7 +1411,7 @@ function_add_vertice_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -1386,7 +1466,7 @@ function_print_E_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1436,7 +1516,7 @@ function_print_V_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1664,7 +1744,7 @@ function_read_input_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 100($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -2289,7 +2369,7 @@ label_FALSE_25: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 116($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -2341,7 +2421,7 @@ label_FALSE_25: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 120($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -2364,7 +2444,7 @@ label_FALSE_25: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -2392,7 +2472,7 @@ label_FALSE_25: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 100($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -100($fp) @@ -2522,7 +2602,7 @@ function_parse_line_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 8($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -2545,7 +2625,7 @@ function_parse_line_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -2580,7 +2660,7 @@ function_parse_line_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -2961,7 +3041,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 8($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -3035,7 +3115,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 8($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -3143,7 +3223,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -128($fp) @@ -3178,7 +3258,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -116($fp) @@ -3201,7 +3281,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 92($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -108($fp) @@ -5876,7 +5956,7 @@ label_FALSEIF_129: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 108($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -248($fp) @@ -6016,7 +6096,7 @@ function_a2i_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -6390,7 +6470,7 @@ label_FALSEIF_139: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -6694,7 +6774,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 60($t0) +lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -108($fp) @@ -6786,7 +6866,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -6809,7 +6889,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 20($t0) +lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -6955,7 +7035,7 @@ label_FALSEIF_149: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -7259,7 +7339,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 60($t0) +lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -184($fp) @@ -7351,7 +7431,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -168($fp) @@ -7374,7 +7454,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 8($t0) +lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -156($fp) @@ -7416,7 +7496,7 @@ label_FALSEIF_159: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -196($fp) @@ -7581,7 +7661,7 @@ function_a2i_aux_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -7835,7 +7915,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -8171,7 +8251,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 60($t0) +lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -104($fp) @@ -8301,7 +8381,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -8646,7 +8726,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 60($t0) +lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -160($fp) @@ -8776,7 +8856,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -8938,7 +9018,7 @@ label_FALSEIF_183: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -196($fp) @@ -8961,7 +9041,7 @@ label_FALSEIF_183: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 64($t0) + lw $t0, 116($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -184($fp) @@ -9371,169 +9451,20 @@ label_WHILE_END_170: # Function END -# __Main__attrib__g__init implementation. -# @Params: -__Main__attrib__g__init: - # Allocate stack frame for function __Main__attrib__g__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # local_ttrib__g__init_internal_3 = SELF - sw $s1, -16($fp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) - # local_ttrib__g__init_internal_1 = local_ttrib__g__init_internal_3 - lw $t0, -16($fp) - sw $t0, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) - # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) - # local_ttrib__g__init_internal_2 = VCALL local_ttrib__g__init_internal_1 read_input - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 0($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_ttrib__g__init_internal_2 - lw $v0, -12($fp) - # Deallocate stack frame for function __Main__attrib__g__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - # function_main_at_Main implementation. # @Params: function_main_at_Main: # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 32 + subu $sp, $sp, 448 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_main_at_Main_internal_2 = GETATTRIBUTE g Main - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - lw $t0, 20($s1) - sw $t0, -12($fp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_0 --> -4($fp) - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 print_V - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 88($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_main_at_Main_internal_5 = GETATTRIBUTE g Main - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - lw $t0, 20($s1) - sw $t0, -24($fp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 - lw $t0, -24($fp) - sw $t0, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_3 --> -16($fp) + addu $fp, $sp, 448 # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 print_E - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 100($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_main_at_Main_internal_4 - lw $v0, -20($fp) - # Deallocate stack frame for function function_main_at_Main. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __VList__attrib__car__init implementation. -# @Params: -__VList__attrib__car__init: - # Allocate stack frame for function __VList__attrib__car__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __VList__attrib__car__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_VList implementation. -# @Params: -function_isNil_at_VList: - # Allocate stack frame for function function_isNil_at_VList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_VList_internal_0 --> -4($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type Bool + # Allocating string la $t0, String sw $t0, 0($v0) la $t0, String_start @@ -9541,14 +9472,2629 @@ function_isNil_at_VList: # Load type offset li $t0, 8 sw $t0, 8($v0) - la $t0, Bool + la $t0, data_22 sw $t0, 12($v0) - li $t0, 4 + li $t0, 0 sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 + sw $v0, -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_23 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -24($fp) + # IF_ZERO local_main_at_Main_internal_4 GOTO label_FALSE_205 + # IF_ZERO local_main_at_Main_internal_4 GOTO label_FALSE_205 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_205 + # IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSE_205 + # IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSE_205 + lw $t0, -24($fp) + beq $t0, 0, label_FALSE_205 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Comparing -20($fp) type with String + la $v0, String + lw $a0, -20($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_main_at_Main_internal_3 GOTO label_COMPARE_STRING_208 + # IF_ZERO local_main_at_Main_internal_3 GOTO label_COMPARE_STRING_208 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_208 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Comparing -20($fp) type with Bool + la $v0, Bool + lw $a0, -20($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_main_at_Main_internal_3 GOTO label_COMPARE_BY_VALUE_209 + # IF_ZERO local_main_at_Main_internal_3 GOTO label_COMPARE_BY_VALUE_209 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_209 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Comparing -20($fp) type with Int + la $v0, Int + lw $a0, -20($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_main_at_Main_internal_3 GOTO label_COMPARE_BY_VALUE_209 + # IF_ZERO local_main_at_Main_internal_3 GOTO label_COMPARE_BY_VALUE_209 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_209 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # Load pointers and SUB + lw $a0, -20($fp) + lw $a1, -24($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_main_at_Main_internal_3 GOTO label_TRUE_206 + # IF_ZERO local_main_at_Main_internal_3 GOTO label_TRUE_206 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_206 + # GOTO label_FALSE_205 + j label_FALSE_205 + label_COMPARE_BY_VALUE_209: + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $a0, -20($fp) + lw $a1, -24($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_main_at_Main_internal_3 GOTO label_TRUE_206 + # IF_ZERO local_main_at_Main_internal_3 GOTO label_TRUE_206 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_206 + # GOTO label_FALSE_205 + j label_FALSE_205 + label_COMPARE_STRING_208: + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -24($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_main_at_Main_internal_3 GOTO label_CONTINUE_210 + # IF_ZERO local_main_at_Main_internal_3 GOTO label_CONTINUE_210 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_210 + # GOTO label_FALSE_205 + j label_FALSE_205 + label_CONTINUE_210: + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -24($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_211: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_212 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_211 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_212: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_main_at_Main_internal_3 GOTO label_TRUE_206 + # IF_ZERO local_main_at_Main_internal_3 GOTO label_TRUE_206 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_206 + label_FALSE_205: + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_207 +j label_END_207 +label_TRUE_206: + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_207: +# LOCAL local_main_at_Main_internal_0 --> -4($fp) +# LOCAL local_main_at_Main_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_main_at_Main_internal_0 GOTO label_FALSEIF_203 +# IF_ZERO local_main_at_Main_internal_0 GOTO label_FALSEIF_203 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_203 +# LOCAL local_main_at_Main_internal_8 --> -36($fp) +# local_main_at_Main_internal_8 = SELF +sw $s1, -36($fp) +# LOCAL local_main_at_Main_internal_6 --> -28($fp) +# LOCAL local_main_at_Main_internal_8 --> -36($fp) +# local_main_at_Main_internal_6 = local_main_at_Main_internal_8 +lw $t0, -36($fp) +sw $t0, -28($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_9 --> -40($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_24 +sw $t0, 12($v0) +li $t0, 6 +sw $t0, 16($v0) +sw $v0, -40($fp) +# ARG local_main_at_Main_internal_9 +# LOCAL local_main_at_Main_internal_9 --> -40($fp) +lw $t0, -40($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_6 --> -28($fp) +# LOCAL local_main_at_Main_internal_7 --> -32($fp) +# local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_string +# Save new self pointer in $s1 +lw $s1, -28($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 92($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -32($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_1 --> -8($fp) +# LOCAL local_main_at_Main_internal_7 --> -32($fp) +# local_main_at_Main_internal_1 = local_main_at_Main_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_204 +j label_ENDIF_204 +label_FALSEIF_203: + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 + lw $t0, -52($fp) + sw $t0, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_25 + sw $t0, 12($v0) + li $t0, 6 + sw $t0, 16($v0) + sw $v0, -56($fp) + # ARG local_main_at_Main_internal_13 + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + lw $t0, -56($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 out_string + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 92($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_11 + lw $t0, -48($fp) + sw $t0, -8($fp) + label_ENDIF_204: +# LOCAL local_main_at_Main_internal_20 --> -84($fp) +# local_main_at_Main_internal_20 = SELF +sw $s1, -84($fp) +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# LOCAL local_main_at_Main_internal_20 --> -84($fp) +# local_main_at_Main_internal_18 = local_main_at_Main_internal_20 +lw $t0, -84($fp) +sw $t0, -76($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 in_string +# Save new self pointer in $s1 +lw $s1, -76($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 100($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -80($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_21 --> -88($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_26 +sw $t0, 12($v0) +li $t0, 0 +sw $t0, 16($v0) +sw $v0, -88($fp) +# IF_ZERO local_main_at_Main_internal_19 GOTO label_FALSE_215 +# IF_ZERO local_main_at_Main_internal_19 GOTO label_FALSE_215 +lw $t0, -80($fp) +beq $t0, 0, label_FALSE_215 +# IF_ZERO local_main_at_Main_internal_21 GOTO label_FALSE_215 +# IF_ZERO local_main_at_Main_internal_21 GOTO label_FALSE_215 +lw $t0, -88($fp) +beq $t0, 0, label_FALSE_215 +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# Comparing -80($fp) type with String +la $v0, String +lw $a0, -80($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -72($fp) +# IF_ZERO local_main_at_Main_internal_17 GOTO label_COMPARE_STRING_218 +# IF_ZERO local_main_at_Main_internal_17 GOTO label_COMPARE_STRING_218 +lw $t0, -72($fp) +beq $t0, 0, label_COMPARE_STRING_218 +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# Comparing -80($fp) type with Bool +la $v0, Bool +lw $a0, -80($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -72($fp) +# IF_ZERO local_main_at_Main_internal_17 GOTO label_COMPARE_BY_VALUE_219 +# IF_ZERO local_main_at_Main_internal_17 GOTO label_COMPARE_BY_VALUE_219 +lw $t0, -72($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_219 +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# Comparing -80($fp) type with Int +la $v0, Int +lw $a0, -80($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -72($fp) +# IF_ZERO local_main_at_Main_internal_17 GOTO label_COMPARE_BY_VALUE_219 +# IF_ZERO local_main_at_Main_internal_17 GOTO label_COMPARE_BY_VALUE_219 +lw $t0, -72($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_219 +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# LOCAL local_main_at_Main_internal_21 --> -88($fp) +# Load pointers and SUB +lw $a0, -80($fp) +lw $a1, -88($fp) +sub $a0, $a0, $a1 +sw $a0, -72($fp) +# IF_ZERO local_main_at_Main_internal_17 GOTO label_TRUE_216 +# IF_ZERO local_main_at_Main_internal_17 GOTO label_TRUE_216 +lw $t0, -72($fp) +beq $t0, 0, label_TRUE_216 +# GOTO label_FALSE_215 +j label_FALSE_215 +label_COMPARE_BY_VALUE_219: + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + lw $a0, -80($fp) + lw $a1, -88($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -72($fp) + # IF_ZERO local_main_at_Main_internal_17 GOTO label_TRUE_216 + # IF_ZERO local_main_at_Main_internal_17 GOTO label_TRUE_216 + lw $t0, -72($fp) + beq $t0, 0, label_TRUE_216 + # GOTO label_FALSE_215 + j label_FALSE_215 + label_COMPARE_STRING_218: + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # Load strings for comparison + lw $v0, -80($fp) + lw $v1, -88($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -72($fp) + # IF_ZERO local_main_at_Main_internal_17 GOTO label_CONTINUE_220 + # IF_ZERO local_main_at_Main_internal_17 GOTO label_CONTINUE_220 + lw $t0, -72($fp) + beq $t0, 0, label_CONTINUE_220 + # GOTO label_FALSE_215 + j label_FALSE_215 + label_CONTINUE_220: + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -80($fp) + lw $v1, -88($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_221: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_222 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_221 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_222: + # Store result + sw $a2, -72($fp) + # IF_ZERO local_main_at_Main_internal_17 GOTO label_TRUE_216 + # IF_ZERO local_main_at_Main_internal_17 GOTO label_TRUE_216 + lw $t0, -72($fp) + beq $t0, 0, label_TRUE_216 + label_FALSE_215: + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -68($fp) + # GOTO label_END_217 +j label_END_217 +label_TRUE_216: + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -68($fp) + label_END_217: +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# Obtain value from -68($fp) +lw $v0, -68($fp) +lw $v0, 12($v0) +sw $v0, -60($fp) +# IF_ZERO local_main_at_Main_internal_14 GOTO label_FALSEIF_213 +# IF_ZERO local_main_at_Main_internal_14 GOTO label_FALSEIF_213 +lw $t0, -60($fp) +beq $t0, 0, label_FALSEIF_213 +# LOCAL local_main_at_Main_internal_24 --> -100($fp) +# local_main_at_Main_internal_24 = SELF +sw $s1, -100($fp) +# LOCAL local_main_at_Main_internal_22 --> -92($fp) +# LOCAL local_main_at_Main_internal_24 --> -100($fp) +# local_main_at_Main_internal_22 = local_main_at_Main_internal_24 +lw $t0, -100($fp) +sw $t0, -92($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_25 --> -104($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_27 +sw $t0, 12($v0) +li $t0, 6 +sw $t0, 16($v0) +sw $v0, -104($fp) +# ARG local_main_at_Main_internal_25 +# LOCAL local_main_at_Main_internal_25 --> -104($fp) +lw $t0, -104($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_22 --> -92($fp) +# LOCAL local_main_at_Main_internal_23 --> -96($fp) +# local_main_at_Main_internal_23 = VCALL local_main_at_Main_internal_22 out_string +# Save new self pointer in $s1 +lw $s1, -92($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 92($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -96($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# LOCAL local_main_at_Main_internal_23 --> -96($fp) +# local_main_at_Main_internal_15 = local_main_at_Main_internal_23 +lw $t0, -96($fp) +sw $t0, -64($fp) +# GOTO label_ENDIF_214 +j label_ENDIF_214 +label_FALSEIF_213: + # LOCAL local_main_at_Main_internal_28 --> -116($fp) + # local_main_at_Main_internal_28 = SELF + sw $s1, -116($fp) + # LOCAL local_main_at_Main_internal_26 --> -108($fp) + # LOCAL local_main_at_Main_internal_28 --> -116($fp) + # local_main_at_Main_internal_26 = local_main_at_Main_internal_28 + lw $t0, -116($fp) + sw $t0, -108($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_29 --> -120($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_28 + sw $t0, 12($v0) + li $t0, 6 + sw $t0, 16($v0) + sw $v0, -120($fp) + # ARG local_main_at_Main_internal_29 + # LOCAL local_main_at_Main_internal_29 --> -120($fp) + lw $t0, -120($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_26 --> -108($fp) + # LOCAL local_main_at_Main_internal_27 --> -112($fp) + # local_main_at_Main_internal_27 = VCALL local_main_at_Main_internal_26 out_string + # Save new self pointer in $s1 + lw $s1, -108($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 92($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -112($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_27 --> -112($fp) + # local_main_at_Main_internal_15 = local_main_at_Main_internal_27 + lw $t0, -112($fp) + sw $t0, -64($fp) + label_ENDIF_214: +# LOCAL local_main_at_Main_internal_36 --> -148($fp) +# local_main_at_Main_internal_36 = SELF +sw $s1, -148($fp) +# LOCAL local_main_at_Main_internal_34 --> -140($fp) +# LOCAL local_main_at_Main_internal_36 --> -148($fp) +# local_main_at_Main_internal_34 = local_main_at_Main_internal_36 +lw $t0, -148($fp) +sw $t0, -140($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_34 --> -140($fp) +# LOCAL local_main_at_Main_internal_35 --> -144($fp) +# local_main_at_Main_internal_35 = VCALL local_main_at_Main_internal_34 in_string +# Save new self pointer in $s1 +lw $s1, -140($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 100($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -144($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_37 --> -152($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_29 +sw $t0, 12($v0) +li $t0, 0 +sw $t0, 16($v0) +sw $v0, -152($fp) +# IF_ZERO local_main_at_Main_internal_35 GOTO label_FALSE_225 +# IF_ZERO local_main_at_Main_internal_35 GOTO label_FALSE_225 +lw $t0, -144($fp) +beq $t0, 0, label_FALSE_225 +# IF_ZERO local_main_at_Main_internal_37 GOTO label_FALSE_225 +# IF_ZERO local_main_at_Main_internal_37 GOTO label_FALSE_225 +lw $t0, -152($fp) +beq $t0, 0, label_FALSE_225 +# LOCAL local_main_at_Main_internal_33 --> -136($fp) +# LOCAL local_main_at_Main_internal_35 --> -144($fp) +# Comparing -144($fp) type with String +la $v0, String +lw $a0, -144($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -136($fp) +# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_STRING_228 +# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_STRING_228 +lw $t0, -136($fp) +beq $t0, 0, label_COMPARE_STRING_228 +# LOCAL local_main_at_Main_internal_33 --> -136($fp) +# LOCAL local_main_at_Main_internal_35 --> -144($fp) +# Comparing -144($fp) type with Bool +la $v0, Bool +lw $a0, -144($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -136($fp) +# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_BY_VALUE_229 +# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_BY_VALUE_229 +lw $t0, -136($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_229 +# LOCAL local_main_at_Main_internal_33 --> -136($fp) +# LOCAL local_main_at_Main_internal_35 --> -144($fp) +# Comparing -144($fp) type with Int +la $v0, Int +lw $a0, -144($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -136($fp) +# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_BY_VALUE_229 +# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_BY_VALUE_229 +lw $t0, -136($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_229 +# LOCAL local_main_at_Main_internal_33 --> -136($fp) +# LOCAL local_main_at_Main_internal_35 --> -144($fp) +# LOCAL local_main_at_Main_internal_37 --> -152($fp) +# Load pointers and SUB +lw $a0, -144($fp) +lw $a1, -152($fp) +sub $a0, $a0, $a1 +sw $a0, -136($fp) +# IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_226 +# IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_226 +lw $t0, -136($fp) +beq $t0, 0, label_TRUE_226 +# GOTO label_FALSE_225 +j label_FALSE_225 +label_COMPARE_BY_VALUE_229: + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # LOCAL local_main_at_Main_internal_35 --> -144($fp) + # LOCAL local_main_at_Main_internal_37 --> -152($fp) + lw $a0, -144($fp) + lw $a1, -152($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_226 + # IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_226 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_226 + # GOTO label_FALSE_225 + j label_FALSE_225 + label_COMPARE_STRING_228: + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # LOCAL local_main_at_Main_internal_35 --> -144($fp) + # LOCAL local_main_at_Main_internal_37 --> -152($fp) + # Load strings for comparison + lw $v0, -144($fp) + lw $v1, -152($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -136($fp) + # IF_ZERO local_main_at_Main_internal_33 GOTO label_CONTINUE_230 + # IF_ZERO local_main_at_Main_internal_33 GOTO label_CONTINUE_230 + lw $t0, -136($fp) + beq $t0, 0, label_CONTINUE_230 + # GOTO label_FALSE_225 + j label_FALSE_225 + label_CONTINUE_230: + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # LOCAL local_main_at_Main_internal_35 --> -144($fp) + # LOCAL local_main_at_Main_internal_37 --> -152($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -144($fp) + lw $v1, -152($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_231: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_232 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_231 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_232: + # Store result + sw $a2, -136($fp) + # IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_226 + # IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_226 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_226 + label_FALSE_225: + # LOCAL local_main_at_Main_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -132($fp) + # GOTO label_END_227 +j label_END_227 +label_TRUE_226: + # LOCAL local_main_at_Main_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -132($fp) + label_END_227: +# LOCAL local_main_at_Main_internal_30 --> -124($fp) +# LOCAL local_main_at_Main_internal_32 --> -132($fp) +# Obtain value from -132($fp) +lw $v0, -132($fp) +lw $v0, 12($v0) +sw $v0, -124($fp) +# IF_ZERO local_main_at_Main_internal_30 GOTO label_FALSEIF_223 +# IF_ZERO local_main_at_Main_internal_30 GOTO label_FALSEIF_223 +lw $t0, -124($fp) +beq $t0, 0, label_FALSEIF_223 +# LOCAL local_main_at_Main_internal_40 --> -164($fp) +# local_main_at_Main_internal_40 = SELF +sw $s1, -164($fp) +# LOCAL local_main_at_Main_internal_38 --> -156($fp) +# LOCAL local_main_at_Main_internal_40 --> -164($fp) +# local_main_at_Main_internal_38 = local_main_at_Main_internal_40 +lw $t0, -164($fp) +sw $t0, -156($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_41 --> -168($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_30 +sw $t0, 12($v0) +li $t0, 6 +sw $t0, 16($v0) +sw $v0, -168($fp) +# ARG local_main_at_Main_internal_41 +# LOCAL local_main_at_Main_internal_41 --> -168($fp) +lw $t0, -168($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_38 --> -156($fp) +# LOCAL local_main_at_Main_internal_39 --> -160($fp) +# local_main_at_Main_internal_39 = VCALL local_main_at_Main_internal_38 out_string +# Save new self pointer in $s1 +lw $s1, -156($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 92($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -160($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_31 --> -128($fp) +# LOCAL local_main_at_Main_internal_39 --> -160($fp) +# local_main_at_Main_internal_31 = local_main_at_Main_internal_39 +lw $t0, -160($fp) +sw $t0, -128($fp) +# GOTO label_ENDIF_224 +j label_ENDIF_224 +label_FALSEIF_223: + # LOCAL local_main_at_Main_internal_44 --> -180($fp) + # local_main_at_Main_internal_44 = SELF + sw $s1, -180($fp) + # LOCAL local_main_at_Main_internal_42 --> -172($fp) + # LOCAL local_main_at_Main_internal_44 --> -180($fp) + # local_main_at_Main_internal_42 = local_main_at_Main_internal_44 + lw $t0, -180($fp) + sw $t0, -172($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_45 --> -184($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_31 + sw $t0, 12($v0) + li $t0, 6 + sw $t0, 16($v0) + sw $v0, -184($fp) + # ARG local_main_at_Main_internal_45 + # LOCAL local_main_at_Main_internal_45 --> -184($fp) + lw $t0, -184($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_42 --> -172($fp) + # LOCAL local_main_at_Main_internal_43 --> -176($fp) + # local_main_at_Main_internal_43 = VCALL local_main_at_Main_internal_42 out_string + # Save new self pointer in $s1 + lw $s1, -172($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 92($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -176($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_31 --> -128($fp) + # LOCAL local_main_at_Main_internal_43 --> -176($fp) + # local_main_at_Main_internal_31 = local_main_at_Main_internal_43 + lw $t0, -176($fp) + sw $t0, -128($fp) + label_ENDIF_224: +# LOCAL local_main_at_Main_internal_52 --> -212($fp) +# local_main_at_Main_internal_52 = SELF +sw $s1, -212($fp) +# LOCAL local_main_at_Main_internal_50 --> -204($fp) +# LOCAL local_main_at_Main_internal_52 --> -212($fp) +# local_main_at_Main_internal_50 = local_main_at_Main_internal_52 +lw $t0, -212($fp) +sw $t0, -204($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_50 --> -204($fp) +# LOCAL local_main_at_Main_internal_51 --> -208($fp) +# local_main_at_Main_internal_51 = VCALL local_main_at_Main_internal_50 in_string +# Save new self pointer in $s1 +lw $s1, -204($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 100($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -208($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_53 --> -216($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_32 +sw $t0, 12($v0) +li $t0, 0 +sw $t0, 16($v0) +sw $v0, -216($fp) +# IF_ZERO local_main_at_Main_internal_51 GOTO label_FALSE_235 +# IF_ZERO local_main_at_Main_internal_51 GOTO label_FALSE_235 +lw $t0, -208($fp) +beq $t0, 0, label_FALSE_235 +# IF_ZERO local_main_at_Main_internal_53 GOTO label_FALSE_235 +# IF_ZERO local_main_at_Main_internal_53 GOTO label_FALSE_235 +lw $t0, -216($fp) +beq $t0, 0, label_FALSE_235 +# LOCAL local_main_at_Main_internal_49 --> -200($fp) +# LOCAL local_main_at_Main_internal_51 --> -208($fp) +# Comparing -208($fp) type with String +la $v0, String +lw $a0, -208($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -200($fp) +# IF_ZERO local_main_at_Main_internal_49 GOTO label_COMPARE_STRING_238 +# IF_ZERO local_main_at_Main_internal_49 GOTO label_COMPARE_STRING_238 +lw $t0, -200($fp) +beq $t0, 0, label_COMPARE_STRING_238 +# LOCAL local_main_at_Main_internal_49 --> -200($fp) +# LOCAL local_main_at_Main_internal_51 --> -208($fp) +# Comparing -208($fp) type with Bool +la $v0, Bool +lw $a0, -208($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -200($fp) +# IF_ZERO local_main_at_Main_internal_49 GOTO label_COMPARE_BY_VALUE_239 +# IF_ZERO local_main_at_Main_internal_49 GOTO label_COMPARE_BY_VALUE_239 +lw $t0, -200($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_239 +# LOCAL local_main_at_Main_internal_49 --> -200($fp) +# LOCAL local_main_at_Main_internal_51 --> -208($fp) +# Comparing -208($fp) type with Int +la $v0, Int +lw $a0, -208($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -200($fp) +# IF_ZERO local_main_at_Main_internal_49 GOTO label_COMPARE_BY_VALUE_239 +# IF_ZERO local_main_at_Main_internal_49 GOTO label_COMPARE_BY_VALUE_239 +lw $t0, -200($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_239 +# LOCAL local_main_at_Main_internal_49 --> -200($fp) +# LOCAL local_main_at_Main_internal_51 --> -208($fp) +# LOCAL local_main_at_Main_internal_53 --> -216($fp) +# Load pointers and SUB +lw $a0, -208($fp) +lw $a1, -216($fp) +sub $a0, $a0, $a1 +sw $a0, -200($fp) +# IF_ZERO local_main_at_Main_internal_49 GOTO label_TRUE_236 +# IF_ZERO local_main_at_Main_internal_49 GOTO label_TRUE_236 +lw $t0, -200($fp) +beq $t0, 0, label_TRUE_236 +# GOTO label_FALSE_235 +j label_FALSE_235 +label_COMPARE_BY_VALUE_239: + # LOCAL local_main_at_Main_internal_49 --> -200($fp) + # LOCAL local_main_at_Main_internal_51 --> -208($fp) + # LOCAL local_main_at_Main_internal_53 --> -216($fp) + lw $a0, -208($fp) + lw $a1, -216($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -200($fp) + # IF_ZERO local_main_at_Main_internal_49 GOTO label_TRUE_236 + # IF_ZERO local_main_at_Main_internal_49 GOTO label_TRUE_236 + lw $t0, -200($fp) + beq $t0, 0, label_TRUE_236 + # GOTO label_FALSE_235 + j label_FALSE_235 + label_COMPARE_STRING_238: + # LOCAL local_main_at_Main_internal_49 --> -200($fp) + # LOCAL local_main_at_Main_internal_51 --> -208($fp) + # LOCAL local_main_at_Main_internal_53 --> -216($fp) + # Load strings for comparison + lw $v0, -208($fp) + lw $v1, -216($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -200($fp) + # IF_ZERO local_main_at_Main_internal_49 GOTO label_CONTINUE_240 + # IF_ZERO local_main_at_Main_internal_49 GOTO label_CONTINUE_240 + lw $t0, -200($fp) + beq $t0, 0, label_CONTINUE_240 + # GOTO label_FALSE_235 + j label_FALSE_235 + label_CONTINUE_240: + # LOCAL local_main_at_Main_internal_49 --> -200($fp) + # LOCAL local_main_at_Main_internal_51 --> -208($fp) + # LOCAL local_main_at_Main_internal_53 --> -216($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -208($fp) + lw $v1, -216($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_241: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_242 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_241 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_242: + # Store result + sw $a2, -200($fp) + # IF_ZERO local_main_at_Main_internal_49 GOTO label_TRUE_236 + # IF_ZERO local_main_at_Main_internal_49 GOTO label_TRUE_236 + lw $t0, -200($fp) + beq $t0, 0, label_TRUE_236 + label_FALSE_235: + # LOCAL local_main_at_Main_internal_48 --> -196($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -196($fp) + # GOTO label_END_237 +j label_END_237 +label_TRUE_236: + # LOCAL local_main_at_Main_internal_48 --> -196($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -196($fp) + label_END_237: +# LOCAL local_main_at_Main_internal_46 --> -188($fp) +# LOCAL local_main_at_Main_internal_48 --> -196($fp) +# Obtain value from -196($fp) +lw $v0, -196($fp) +lw $v0, 12($v0) +sw $v0, -188($fp) +# IF_ZERO local_main_at_Main_internal_46 GOTO label_FALSEIF_233 +# IF_ZERO local_main_at_Main_internal_46 GOTO label_FALSEIF_233 +lw $t0, -188($fp) +beq $t0, 0, label_FALSEIF_233 +# LOCAL local_main_at_Main_internal_56 --> -228($fp) +# local_main_at_Main_internal_56 = SELF +sw $s1, -228($fp) +# LOCAL local_main_at_Main_internal_54 --> -220($fp) +# LOCAL local_main_at_Main_internal_56 --> -228($fp) +# local_main_at_Main_internal_54 = local_main_at_Main_internal_56 +lw $t0, -228($fp) +sw $t0, -220($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_57 --> -232($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_33 +sw $t0, 12($v0) +li $t0, 6 +sw $t0, 16($v0) +sw $v0, -232($fp) +# ARG local_main_at_Main_internal_57 +# LOCAL local_main_at_Main_internal_57 --> -232($fp) +lw $t0, -232($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_54 --> -220($fp) +# LOCAL local_main_at_Main_internal_55 --> -224($fp) +# local_main_at_Main_internal_55 = VCALL local_main_at_Main_internal_54 out_string +# Save new self pointer in $s1 +lw $s1, -220($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 92($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -224($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_47 --> -192($fp) +# LOCAL local_main_at_Main_internal_55 --> -224($fp) +# local_main_at_Main_internal_47 = local_main_at_Main_internal_55 +lw $t0, -224($fp) +sw $t0, -192($fp) +# GOTO label_ENDIF_234 +j label_ENDIF_234 +label_FALSEIF_233: + # LOCAL local_main_at_Main_internal_60 --> -244($fp) + # local_main_at_Main_internal_60 = SELF + sw $s1, -244($fp) + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # LOCAL local_main_at_Main_internal_60 --> -244($fp) + # local_main_at_Main_internal_58 = local_main_at_Main_internal_60 + lw $t0, -244($fp) + sw $t0, -236($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_61 --> -248($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_34 + sw $t0, 12($v0) + li $t0, 6 + sw $t0, 16($v0) + sw $v0, -248($fp) + # ARG local_main_at_Main_internal_61 + # LOCAL local_main_at_Main_internal_61 --> -248($fp) + lw $t0, -248($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # LOCAL local_main_at_Main_internal_59 --> -240($fp) + # local_main_at_Main_internal_59 = VCALL local_main_at_Main_internal_58 out_string + # Save new self pointer in $s1 + lw $s1, -236($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 92($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -240($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_47 --> -192($fp) + # LOCAL local_main_at_Main_internal_59 --> -240($fp) + # local_main_at_Main_internal_47 = local_main_at_Main_internal_59 + lw $t0, -240($fp) + sw $t0, -192($fp) + label_ENDIF_234: +# LOCAL local_main_at_Main_internal_68 --> -276($fp) +# local_main_at_Main_internal_68 = SELF +sw $s1, -276($fp) +# LOCAL local_main_at_Main_internal_66 --> -268($fp) +# LOCAL local_main_at_Main_internal_68 --> -276($fp) +# local_main_at_Main_internal_66 = local_main_at_Main_internal_68 +lw $t0, -276($fp) +sw $t0, -268($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_66 --> -268($fp) +# LOCAL local_main_at_Main_internal_67 --> -272($fp) +# local_main_at_Main_internal_67 = VCALL local_main_at_Main_internal_66 in_string +# Save new self pointer in $s1 +lw $s1, -268($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 100($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -272($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_69 --> -280($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_35 +sw $t0, 12($v0) +li $t0, 0 +sw $t0, 16($v0) +sw $v0, -280($fp) +# IF_ZERO local_main_at_Main_internal_67 GOTO label_FALSE_245 +# IF_ZERO local_main_at_Main_internal_67 GOTO label_FALSE_245 +lw $t0, -272($fp) +beq $t0, 0, label_FALSE_245 +# IF_ZERO local_main_at_Main_internal_69 GOTO label_FALSE_245 +# IF_ZERO local_main_at_Main_internal_69 GOTO label_FALSE_245 +lw $t0, -280($fp) +beq $t0, 0, label_FALSE_245 +# LOCAL local_main_at_Main_internal_65 --> -264($fp) +# LOCAL local_main_at_Main_internal_67 --> -272($fp) +# Comparing -272($fp) type with String +la $v0, String +lw $a0, -272($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -264($fp) +# IF_ZERO local_main_at_Main_internal_65 GOTO label_COMPARE_STRING_248 +# IF_ZERO local_main_at_Main_internal_65 GOTO label_COMPARE_STRING_248 +lw $t0, -264($fp) +beq $t0, 0, label_COMPARE_STRING_248 +# LOCAL local_main_at_Main_internal_65 --> -264($fp) +# LOCAL local_main_at_Main_internal_67 --> -272($fp) +# Comparing -272($fp) type with Bool +la $v0, Bool +lw $a0, -272($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -264($fp) +# IF_ZERO local_main_at_Main_internal_65 GOTO label_COMPARE_BY_VALUE_249 +# IF_ZERO local_main_at_Main_internal_65 GOTO label_COMPARE_BY_VALUE_249 +lw $t0, -264($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_249 +# LOCAL local_main_at_Main_internal_65 --> -264($fp) +# LOCAL local_main_at_Main_internal_67 --> -272($fp) +# Comparing -272($fp) type with Int +la $v0, Int +lw $a0, -272($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -264($fp) +# IF_ZERO local_main_at_Main_internal_65 GOTO label_COMPARE_BY_VALUE_249 +# IF_ZERO local_main_at_Main_internal_65 GOTO label_COMPARE_BY_VALUE_249 +lw $t0, -264($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_249 +# LOCAL local_main_at_Main_internal_65 --> -264($fp) +# LOCAL local_main_at_Main_internal_67 --> -272($fp) +# LOCAL local_main_at_Main_internal_69 --> -280($fp) +# Load pointers and SUB +lw $a0, -272($fp) +lw $a1, -280($fp) +sub $a0, $a0, $a1 +sw $a0, -264($fp) +# IF_ZERO local_main_at_Main_internal_65 GOTO label_TRUE_246 +# IF_ZERO local_main_at_Main_internal_65 GOTO label_TRUE_246 +lw $t0, -264($fp) +beq $t0, 0, label_TRUE_246 +# GOTO label_FALSE_245 +j label_FALSE_245 +label_COMPARE_BY_VALUE_249: + # LOCAL local_main_at_Main_internal_65 --> -264($fp) + # LOCAL local_main_at_Main_internal_67 --> -272($fp) + # LOCAL local_main_at_Main_internal_69 --> -280($fp) + lw $a0, -272($fp) + lw $a1, -280($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -264($fp) + # IF_ZERO local_main_at_Main_internal_65 GOTO label_TRUE_246 + # IF_ZERO local_main_at_Main_internal_65 GOTO label_TRUE_246 + lw $t0, -264($fp) + beq $t0, 0, label_TRUE_246 + # GOTO label_FALSE_245 + j label_FALSE_245 + label_COMPARE_STRING_248: + # LOCAL local_main_at_Main_internal_65 --> -264($fp) + # LOCAL local_main_at_Main_internal_67 --> -272($fp) + # LOCAL local_main_at_Main_internal_69 --> -280($fp) + # Load strings for comparison + lw $v0, -272($fp) + lw $v1, -280($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -264($fp) + # IF_ZERO local_main_at_Main_internal_65 GOTO label_CONTINUE_250 + # IF_ZERO local_main_at_Main_internal_65 GOTO label_CONTINUE_250 + lw $t0, -264($fp) + beq $t0, 0, label_CONTINUE_250 + # GOTO label_FALSE_245 + j label_FALSE_245 + label_CONTINUE_250: + # LOCAL local_main_at_Main_internal_65 --> -264($fp) + # LOCAL local_main_at_Main_internal_67 --> -272($fp) + # LOCAL local_main_at_Main_internal_69 --> -280($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -272($fp) + lw $v1, -280($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_251: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_252 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_251 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_252: + # Store result + sw $a2, -264($fp) + # IF_ZERO local_main_at_Main_internal_65 GOTO label_TRUE_246 + # IF_ZERO local_main_at_Main_internal_65 GOTO label_TRUE_246 + lw $t0, -264($fp) + beq $t0, 0, label_TRUE_246 + label_FALSE_245: + # LOCAL local_main_at_Main_internal_64 --> -260($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -260($fp) + # GOTO label_END_247 +j label_END_247 +label_TRUE_246: + # LOCAL local_main_at_Main_internal_64 --> -260($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -260($fp) + label_END_247: +# LOCAL local_main_at_Main_internal_62 --> -252($fp) +# LOCAL local_main_at_Main_internal_64 --> -260($fp) +# Obtain value from -260($fp) +lw $v0, -260($fp) +lw $v0, 12($v0) +sw $v0, -252($fp) +# IF_ZERO local_main_at_Main_internal_62 GOTO label_FALSEIF_243 +# IF_ZERO local_main_at_Main_internal_62 GOTO label_FALSEIF_243 +lw $t0, -252($fp) +beq $t0, 0, label_FALSEIF_243 +# LOCAL local_main_at_Main_internal_72 --> -292($fp) +# local_main_at_Main_internal_72 = SELF +sw $s1, -292($fp) +# LOCAL local_main_at_Main_internal_70 --> -284($fp) +# LOCAL local_main_at_Main_internal_72 --> -292($fp) +# local_main_at_Main_internal_70 = local_main_at_Main_internal_72 +lw $t0, -292($fp) +sw $t0, -284($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_73 --> -296($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_36 +sw $t0, 12($v0) +li $t0, 6 +sw $t0, 16($v0) +sw $v0, -296($fp) +# ARG local_main_at_Main_internal_73 +# LOCAL local_main_at_Main_internal_73 --> -296($fp) +lw $t0, -296($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_70 --> -284($fp) +# LOCAL local_main_at_Main_internal_71 --> -288($fp) +# local_main_at_Main_internal_71 = VCALL local_main_at_Main_internal_70 out_string +# Save new self pointer in $s1 +lw $s1, -284($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 92($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -288($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_63 --> -256($fp) +# LOCAL local_main_at_Main_internal_71 --> -288($fp) +# local_main_at_Main_internal_63 = local_main_at_Main_internal_71 +lw $t0, -288($fp) +sw $t0, -256($fp) +# GOTO label_ENDIF_244 +j label_ENDIF_244 +label_FALSEIF_243: + # LOCAL local_main_at_Main_internal_76 --> -308($fp) + # local_main_at_Main_internal_76 = SELF + sw $s1, -308($fp) + # LOCAL local_main_at_Main_internal_74 --> -300($fp) + # LOCAL local_main_at_Main_internal_76 --> -308($fp) + # local_main_at_Main_internal_74 = local_main_at_Main_internal_76 + lw $t0, -308($fp) + sw $t0, -300($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_77 --> -312($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_37 + sw $t0, 12($v0) + li $t0, 6 + sw $t0, 16($v0) + sw $v0, -312($fp) + # ARG local_main_at_Main_internal_77 + # LOCAL local_main_at_Main_internal_77 --> -312($fp) + lw $t0, -312($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_74 --> -300($fp) + # LOCAL local_main_at_Main_internal_75 --> -304($fp) + # local_main_at_Main_internal_75 = VCALL local_main_at_Main_internal_74 out_string + # Save new self pointer in $s1 + lw $s1, -300($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 92($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -304($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_63 --> -256($fp) + # LOCAL local_main_at_Main_internal_75 --> -304($fp) + # local_main_at_Main_internal_63 = local_main_at_Main_internal_75 + lw $t0, -304($fp) + sw $t0, -256($fp) + label_ENDIF_244: +# LOCAL local_main_at_Main_internal_84 --> -340($fp) +# local_main_at_Main_internal_84 = SELF +sw $s1, -340($fp) +# LOCAL local_main_at_Main_internal_82 --> -332($fp) +# LOCAL local_main_at_Main_internal_84 --> -340($fp) +# local_main_at_Main_internal_82 = local_main_at_Main_internal_84 +lw $t0, -340($fp) +sw $t0, -332($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_82 --> -332($fp) +# LOCAL local_main_at_Main_internal_83 --> -336($fp) +# local_main_at_Main_internal_83 = VCALL local_main_at_Main_internal_82 in_string +# Save new self pointer in $s1 +lw $s1, -332($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 100($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -336($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_85 --> -344($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_38 +sw $t0, 12($v0) +li $t0, 0 +sw $t0, 16($v0) +sw $v0, -344($fp) +# IF_ZERO local_main_at_Main_internal_83 GOTO label_FALSE_255 +# IF_ZERO local_main_at_Main_internal_83 GOTO label_FALSE_255 +lw $t0, -336($fp) +beq $t0, 0, label_FALSE_255 +# IF_ZERO local_main_at_Main_internal_85 GOTO label_FALSE_255 +# IF_ZERO local_main_at_Main_internal_85 GOTO label_FALSE_255 +lw $t0, -344($fp) +beq $t0, 0, label_FALSE_255 +# LOCAL local_main_at_Main_internal_81 --> -328($fp) +# LOCAL local_main_at_Main_internal_83 --> -336($fp) +# Comparing -336($fp) type with String +la $v0, String +lw $a0, -336($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -328($fp) +# IF_ZERO local_main_at_Main_internal_81 GOTO label_COMPARE_STRING_258 +# IF_ZERO local_main_at_Main_internal_81 GOTO label_COMPARE_STRING_258 +lw $t0, -328($fp) +beq $t0, 0, label_COMPARE_STRING_258 +# LOCAL local_main_at_Main_internal_81 --> -328($fp) +# LOCAL local_main_at_Main_internal_83 --> -336($fp) +# Comparing -336($fp) type with Bool +la $v0, Bool +lw $a0, -336($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -328($fp) +# IF_ZERO local_main_at_Main_internal_81 GOTO label_COMPARE_BY_VALUE_259 +# IF_ZERO local_main_at_Main_internal_81 GOTO label_COMPARE_BY_VALUE_259 +lw $t0, -328($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_259 +# LOCAL local_main_at_Main_internal_81 --> -328($fp) +# LOCAL local_main_at_Main_internal_83 --> -336($fp) +# Comparing -336($fp) type with Int +la $v0, Int +lw $a0, -336($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -328($fp) +# IF_ZERO local_main_at_Main_internal_81 GOTO label_COMPARE_BY_VALUE_259 +# IF_ZERO local_main_at_Main_internal_81 GOTO label_COMPARE_BY_VALUE_259 +lw $t0, -328($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_259 +# LOCAL local_main_at_Main_internal_81 --> -328($fp) +# LOCAL local_main_at_Main_internal_83 --> -336($fp) +# LOCAL local_main_at_Main_internal_85 --> -344($fp) +# Load pointers and SUB +lw $a0, -336($fp) +lw $a1, -344($fp) +sub $a0, $a0, $a1 +sw $a0, -328($fp) +# IF_ZERO local_main_at_Main_internal_81 GOTO label_TRUE_256 +# IF_ZERO local_main_at_Main_internal_81 GOTO label_TRUE_256 +lw $t0, -328($fp) +beq $t0, 0, label_TRUE_256 +# GOTO label_FALSE_255 +j label_FALSE_255 +label_COMPARE_BY_VALUE_259: + # LOCAL local_main_at_Main_internal_81 --> -328($fp) + # LOCAL local_main_at_Main_internal_83 --> -336($fp) + # LOCAL local_main_at_Main_internal_85 --> -344($fp) + lw $a0, -336($fp) + lw $a1, -344($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -328($fp) + # IF_ZERO local_main_at_Main_internal_81 GOTO label_TRUE_256 + # IF_ZERO local_main_at_Main_internal_81 GOTO label_TRUE_256 + lw $t0, -328($fp) + beq $t0, 0, label_TRUE_256 + # GOTO label_FALSE_255 + j label_FALSE_255 + label_COMPARE_STRING_258: + # LOCAL local_main_at_Main_internal_81 --> -328($fp) + # LOCAL local_main_at_Main_internal_83 --> -336($fp) + # LOCAL local_main_at_Main_internal_85 --> -344($fp) + # Load strings for comparison + lw $v0, -336($fp) + lw $v1, -344($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -328($fp) + # IF_ZERO local_main_at_Main_internal_81 GOTO label_CONTINUE_260 + # IF_ZERO local_main_at_Main_internal_81 GOTO label_CONTINUE_260 + lw $t0, -328($fp) + beq $t0, 0, label_CONTINUE_260 + # GOTO label_FALSE_255 + j label_FALSE_255 + label_CONTINUE_260: + # LOCAL local_main_at_Main_internal_81 --> -328($fp) + # LOCAL local_main_at_Main_internal_83 --> -336($fp) + # LOCAL local_main_at_Main_internal_85 --> -344($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -336($fp) + lw $v1, -344($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_261: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_262 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_261 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_262: + # Store result + sw $a2, -328($fp) + # IF_ZERO local_main_at_Main_internal_81 GOTO label_TRUE_256 + # IF_ZERO local_main_at_Main_internal_81 GOTO label_TRUE_256 + lw $t0, -328($fp) + beq $t0, 0, label_TRUE_256 + label_FALSE_255: + # LOCAL local_main_at_Main_internal_80 --> -324($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -324($fp) + # GOTO label_END_257 +j label_END_257 +label_TRUE_256: + # LOCAL local_main_at_Main_internal_80 --> -324($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -324($fp) + label_END_257: +# LOCAL local_main_at_Main_internal_78 --> -316($fp) +# LOCAL local_main_at_Main_internal_80 --> -324($fp) +# Obtain value from -324($fp) +lw $v0, -324($fp) +lw $v0, 12($v0) +sw $v0, -316($fp) +# IF_ZERO local_main_at_Main_internal_78 GOTO label_FALSEIF_253 +# IF_ZERO local_main_at_Main_internal_78 GOTO label_FALSEIF_253 +lw $t0, -316($fp) +beq $t0, 0, label_FALSEIF_253 +# LOCAL local_main_at_Main_internal_88 --> -356($fp) +# local_main_at_Main_internal_88 = SELF +sw $s1, -356($fp) +# LOCAL local_main_at_Main_internal_86 --> -348($fp) +# LOCAL local_main_at_Main_internal_88 --> -356($fp) +# local_main_at_Main_internal_86 = local_main_at_Main_internal_88 +lw $t0, -356($fp) +sw $t0, -348($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_89 --> -360($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_39 +sw $t0, 12($v0) +li $t0, 6 +sw $t0, 16($v0) +sw $v0, -360($fp) +# ARG local_main_at_Main_internal_89 +# LOCAL local_main_at_Main_internal_89 --> -360($fp) +lw $t0, -360($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_86 --> -348($fp) +# LOCAL local_main_at_Main_internal_87 --> -352($fp) +# local_main_at_Main_internal_87 = VCALL local_main_at_Main_internal_86 out_string +# Save new self pointer in $s1 +lw $s1, -348($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 92($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -352($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_79 --> -320($fp) +# LOCAL local_main_at_Main_internal_87 --> -352($fp) +# local_main_at_Main_internal_79 = local_main_at_Main_internal_87 +lw $t0, -352($fp) +sw $t0, -320($fp) +# GOTO label_ENDIF_254 +j label_ENDIF_254 +label_FALSEIF_253: + # LOCAL local_main_at_Main_internal_92 --> -372($fp) + # local_main_at_Main_internal_92 = SELF + sw $s1, -372($fp) + # LOCAL local_main_at_Main_internal_90 --> -364($fp) + # LOCAL local_main_at_Main_internal_92 --> -372($fp) + # local_main_at_Main_internal_90 = local_main_at_Main_internal_92 + lw $t0, -372($fp) + sw $t0, -364($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_93 --> -376($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_40 + sw $t0, 12($v0) + li $t0, 6 + sw $t0, 16($v0) + sw $v0, -376($fp) + # ARG local_main_at_Main_internal_93 + # LOCAL local_main_at_Main_internal_93 --> -376($fp) + lw $t0, -376($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_90 --> -364($fp) + # LOCAL local_main_at_Main_internal_91 --> -368($fp) + # local_main_at_Main_internal_91 = VCALL local_main_at_Main_internal_90 out_string + # Save new self pointer in $s1 + lw $s1, -364($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 92($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -368($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_79 --> -320($fp) + # LOCAL local_main_at_Main_internal_91 --> -368($fp) + # local_main_at_Main_internal_79 = local_main_at_Main_internal_91 + lw $t0, -368($fp) + sw $t0, -320($fp) + label_ENDIF_254: +# LOCAL local_main_at_Main_internal_100 --> -404($fp) +# local_main_at_Main_internal_100 = SELF +sw $s1, -404($fp) +# LOCAL local_main_at_Main_internal_98 --> -396($fp) +# LOCAL local_main_at_Main_internal_100 --> -404($fp) +# local_main_at_Main_internal_98 = local_main_at_Main_internal_100 +lw $t0, -404($fp) +sw $t0, -396($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_98 --> -396($fp) +# LOCAL local_main_at_Main_internal_99 --> -400($fp) +# local_main_at_Main_internal_99 = VCALL local_main_at_Main_internal_98 in_string +# Save new self pointer in $s1 +lw $s1, -396($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 100($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -400($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_101 --> -408($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_41 +sw $t0, 12($v0) +li $t0, 0 +sw $t0, 16($v0) +sw $v0, -408($fp) +# IF_ZERO local_main_at_Main_internal_99 GOTO label_FALSE_265 +# IF_ZERO local_main_at_Main_internal_99 GOTO label_FALSE_265 +lw $t0, -400($fp) +beq $t0, 0, label_FALSE_265 +# IF_ZERO local_main_at_Main_internal_101 GOTO label_FALSE_265 +# IF_ZERO local_main_at_Main_internal_101 GOTO label_FALSE_265 +lw $t0, -408($fp) +beq $t0, 0, label_FALSE_265 +# LOCAL local_main_at_Main_internal_97 --> -392($fp) +# LOCAL local_main_at_Main_internal_99 --> -400($fp) +# Comparing -400($fp) type with String +la $v0, String +lw $a0, -400($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -392($fp) +# IF_ZERO local_main_at_Main_internal_97 GOTO label_COMPARE_STRING_268 +# IF_ZERO local_main_at_Main_internal_97 GOTO label_COMPARE_STRING_268 +lw $t0, -392($fp) +beq $t0, 0, label_COMPARE_STRING_268 +# LOCAL local_main_at_Main_internal_97 --> -392($fp) +# LOCAL local_main_at_Main_internal_99 --> -400($fp) +# Comparing -400($fp) type with Bool +la $v0, Bool +lw $a0, -400($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -392($fp) +# IF_ZERO local_main_at_Main_internal_97 GOTO label_COMPARE_BY_VALUE_269 +# IF_ZERO local_main_at_Main_internal_97 GOTO label_COMPARE_BY_VALUE_269 +lw $t0, -392($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_269 +# LOCAL local_main_at_Main_internal_97 --> -392($fp) +# LOCAL local_main_at_Main_internal_99 --> -400($fp) +# Comparing -400($fp) type with Int +la $v0, Int +lw $a0, -400($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -392($fp) +# IF_ZERO local_main_at_Main_internal_97 GOTO label_COMPARE_BY_VALUE_269 +# IF_ZERO local_main_at_Main_internal_97 GOTO label_COMPARE_BY_VALUE_269 +lw $t0, -392($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_269 +# LOCAL local_main_at_Main_internal_97 --> -392($fp) +# LOCAL local_main_at_Main_internal_99 --> -400($fp) +# LOCAL local_main_at_Main_internal_101 --> -408($fp) +# Load pointers and SUB +lw $a0, -400($fp) +lw $a1, -408($fp) +sub $a0, $a0, $a1 +sw $a0, -392($fp) +# IF_ZERO local_main_at_Main_internal_97 GOTO label_TRUE_266 +# IF_ZERO local_main_at_Main_internal_97 GOTO label_TRUE_266 +lw $t0, -392($fp) +beq $t0, 0, label_TRUE_266 +# GOTO label_FALSE_265 +j label_FALSE_265 +label_COMPARE_BY_VALUE_269: + # LOCAL local_main_at_Main_internal_97 --> -392($fp) + # LOCAL local_main_at_Main_internal_99 --> -400($fp) + # LOCAL local_main_at_Main_internal_101 --> -408($fp) + lw $a0, -400($fp) + lw $a1, -408($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -392($fp) + # IF_ZERO local_main_at_Main_internal_97 GOTO label_TRUE_266 + # IF_ZERO local_main_at_Main_internal_97 GOTO label_TRUE_266 + lw $t0, -392($fp) + beq $t0, 0, label_TRUE_266 + # GOTO label_FALSE_265 + j label_FALSE_265 + label_COMPARE_STRING_268: + # LOCAL local_main_at_Main_internal_97 --> -392($fp) + # LOCAL local_main_at_Main_internal_99 --> -400($fp) + # LOCAL local_main_at_Main_internal_101 --> -408($fp) + # Load strings for comparison + lw $v0, -400($fp) + lw $v1, -408($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -392($fp) + # IF_ZERO local_main_at_Main_internal_97 GOTO label_CONTINUE_270 + # IF_ZERO local_main_at_Main_internal_97 GOTO label_CONTINUE_270 + lw $t0, -392($fp) + beq $t0, 0, label_CONTINUE_270 + # GOTO label_FALSE_265 + j label_FALSE_265 + label_CONTINUE_270: + # LOCAL local_main_at_Main_internal_97 --> -392($fp) + # LOCAL local_main_at_Main_internal_99 --> -400($fp) + # LOCAL local_main_at_Main_internal_101 --> -408($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -400($fp) + lw $v1, -408($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_271: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_272 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_271 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_272: + # Store result + sw $a2, -392($fp) + # IF_ZERO local_main_at_Main_internal_97 GOTO label_TRUE_266 + # IF_ZERO local_main_at_Main_internal_97 GOTO label_TRUE_266 + lw $t0, -392($fp) + beq $t0, 0, label_TRUE_266 + label_FALSE_265: + # LOCAL local_main_at_Main_internal_96 --> -388($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -388($fp) + # GOTO label_END_267 +j label_END_267 +label_TRUE_266: + # LOCAL local_main_at_Main_internal_96 --> -388($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -388($fp) + label_END_267: +# LOCAL local_main_at_Main_internal_94 --> -380($fp) +# LOCAL local_main_at_Main_internal_96 --> -388($fp) +# Obtain value from -388($fp) +lw $v0, -388($fp) +lw $v0, 12($v0) +sw $v0, -380($fp) +# IF_ZERO local_main_at_Main_internal_94 GOTO label_FALSEIF_263 +# IF_ZERO local_main_at_Main_internal_94 GOTO label_FALSEIF_263 +lw $t0, -380($fp) +beq $t0, 0, label_FALSEIF_263 +# LOCAL local_main_at_Main_internal_104 --> -420($fp) +# local_main_at_Main_internal_104 = SELF +sw $s1, -420($fp) +# LOCAL local_main_at_Main_internal_102 --> -412($fp) +# LOCAL local_main_at_Main_internal_104 --> -420($fp) +# local_main_at_Main_internal_102 = local_main_at_Main_internal_104 +lw $t0, -420($fp) +sw $t0, -412($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_105 --> -424($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_42 +sw $t0, 12($v0) +li $t0, 6 +sw $t0, 16($v0) +sw $v0, -424($fp) +# ARG local_main_at_Main_internal_105 +# LOCAL local_main_at_Main_internal_105 --> -424($fp) +lw $t0, -424($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_102 --> -412($fp) +# LOCAL local_main_at_Main_internal_103 --> -416($fp) +# local_main_at_Main_internal_103 = VCALL local_main_at_Main_internal_102 out_string +# Save new self pointer in $s1 +lw $s1, -412($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 92($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -416($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_95 --> -384($fp) +# LOCAL local_main_at_Main_internal_103 --> -416($fp) +# local_main_at_Main_internal_95 = local_main_at_Main_internal_103 +lw $t0, -416($fp) +sw $t0, -384($fp) +# GOTO label_ENDIF_264 +j label_ENDIF_264 +label_FALSEIF_263: + # LOCAL local_main_at_Main_internal_108 --> -436($fp) + # local_main_at_Main_internal_108 = SELF + sw $s1, -436($fp) + # LOCAL local_main_at_Main_internal_106 --> -428($fp) + # LOCAL local_main_at_Main_internal_108 --> -436($fp) + # local_main_at_Main_internal_106 = local_main_at_Main_internal_108 + lw $t0, -436($fp) + sw $t0, -428($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_109 --> -440($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_43 + sw $t0, 12($v0) + li $t0, 6 + sw $t0, 16($v0) + sw $v0, -440($fp) + # ARG local_main_at_Main_internal_109 + # LOCAL local_main_at_Main_internal_109 --> -440($fp) + lw $t0, -440($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_106 --> -428($fp) + # LOCAL local_main_at_Main_internal_107 --> -432($fp) + # local_main_at_Main_internal_107 = VCALL local_main_at_Main_internal_106 out_string + # Save new self pointer in $s1 + lw $s1, -428($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 92($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -432($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_95 --> -384($fp) + # LOCAL local_main_at_Main_internal_107 --> -432($fp) + # local_main_at_Main_internal_95 = local_main_at_Main_internal_107 + lw $t0, -432($fp) + sw $t0, -384($fp) + label_ENDIF_264: +# RETURN local_main_at_Main_internal_95 +lw $v0, -384($fp) +# Deallocate stack frame for function function_main_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 448 +jr $ra +# Function END + + +# __VList__attrib__car__init implementation. +# @Params: +__VList__attrib__car__init: + # Allocate stack frame for function __VList__attrib__car__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __VList__attrib__car__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_VList implementation. +# @Params: +function_isNil_at_VList: + # Allocate stack frame for function function_isNil_at_VList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_VList_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 syscall sw $t0, 0($v0) la $t0, Bool_start @@ -9601,7 +12147,7 @@ function_head_at_VList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 108($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -9654,7 +12200,7 @@ function_tail_at_VList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 108($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -9773,7 +12319,7 @@ function_cons_at_VList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -9827,7 +12373,7 @@ function_print_at_VList: # Load type offset li $t0, 8 sw $t0, 8($v0) - la $t0, data_22 + la $t0, data_44 sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) @@ -9848,7 +12394,7 @@ function_print_at_VList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 84($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10057,7 +12603,7 @@ function_print_at_VCons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10086,7 +12632,7 @@ function_print_at_VCons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -10208,7 +12754,7 @@ function_head_at_EList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 108($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10261,7 +12807,7 @@ function_tail_at_EList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 108($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10380,7 +12926,7 @@ function_cons_at_EList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10432,7 +12978,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 24($t0) +lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -10445,18 +12991,18 @@ addu $sp, $sp, 4 lw $v0, -16($fp) lw $v0, 12($v0) sw $v0, -4($fp) -# IF_ZERO local_append_at_EList_internal_0 GOTO label_FALSEIF_203 -# IF_ZERO local_append_at_EList_internal_0 GOTO label_FALSEIF_203 +# IF_ZERO local_append_at_EList_internal_0 GOTO label_FALSEIF_273 +# IF_ZERO local_append_at_EList_internal_0 GOTO label_FALSEIF_273 lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_203 +beq $t0, 0, label_FALSEIF_273 # LOCAL local_append_at_EList_internal_1 --> -8($fp) # PARAM param_append_at_EList_l_0 --> 0($fp) # local_append_at_EList_internal_1 = PARAM param_append_at_EList_l_0 lw $t0, 0($fp) sw $t0, -8($fp) -# GOTO label_ENDIF_204 -j label_ENDIF_204 -label_FALSEIF_203: +# GOTO label_ENDIF_274 +j label_ENDIF_274 +label_FALSEIF_273: # LOCAL local_append_at_EList_internal_11 --> -48($fp) # local_append_at_EList_internal_11 = SELF sw $s1, -48($fp) @@ -10478,7 +13024,7 @@ label_FALSEIF_203: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 104($t0) + lw $t0, 112($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -10509,7 +13055,7 @@ label_FALSEIF_203: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 68($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -10545,7 +13091,7 @@ label_FALSEIF_203: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -10568,7 +13114,7 @@ label_FALSEIF_203: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -10580,7 +13126,7 @@ label_FALSEIF_203: # local_append_at_EList_internal_1 = local_append_at_EList_internal_6 lw $t0, -28($fp) sw $t0, -8($fp) - label_ENDIF_204: + label_ENDIF_274: # RETURN local_append_at_EList_internal_1 lw $v0, -8($fp) # Deallocate stack frame for function function_append_at_EList. @@ -10628,7 +13174,7 @@ function_print_at_EList: # Load type offset li $t0, 8 sw $t0, 8($v0) - la $t0, data_23 + la $t0, data_45 sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) @@ -10649,7 +13195,7 @@ function_print_at_EList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 84($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10858,7 +13404,7 @@ function_print_at_ECons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10887,7 +13433,7 @@ function_print_at_ECons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -11136,7 +13682,7 @@ function_print_at_Edge: # Load type offset li $t0, 8 sw $t0, 8($v0) - la $t0, data_24 + la $t0, data_46 sw $t0, 12($v0) li $t0, 2 sw $t0, 16($v0) @@ -11157,7 +13703,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 84($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -11195,7 +13741,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -11226,7 +13772,7 @@ function_print_at_Edge: # Load type offset li $t0, 8 sw $t0, 8($v0) - la $t0, data_25 + la $t0, data_47 sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) @@ -11247,7 +13793,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 84($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -11285,7 +13831,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -11316,7 +13862,7 @@ function_print_at_Edge: # Load type offset li $t0, 8 sw $t0, 8($v0) - la $t0, data_26 + la $t0, data_48 sw $t0, 12($v0) li $t0, 1 sw $t0, 16($v0) @@ -11337,7 +13883,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 84($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -11375,7 +13921,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -11632,7 +14178,7 @@ function_add_out_at_Vertice: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -11700,7 +14246,7 @@ function_print_at_Vertice: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -11729,7 +14275,7 @@ function_print_at_Vertice: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) diff --git a/src/testing.py b/src/testing.py index 906d5231..f6685632 100755 --- a/src/testing.py +++ b/src/testing.py @@ -418,12 +418,16 @@ class Parse inherits IO { class Main inherits Parse { - g : Graph <- read_input(); - main() : Object { { - g.print_V(); - g.print_E(); + + if "" = "" then out_string("True \n") else out_string("False\n")fi; + if in_string() = "" then out_string("True \n") else out_string("False\n")fi; + if in_string() = "" then out_string("True \n") else out_string("False\n")fi; + if in_string() = "" then out_string("True \n") else out_string("False\n")fi; + if in_string() = "" then out_string("True \n") else out_string("False\n")fi; + if in_string() = "" then out_string("True \n") else out_string("False\n")fi; + if in_string() = "" then out_string("True \n") else out_string("False\n")fi; } }; diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 45e6e2c1..2772a938 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -1,6 +1,5 @@ from pickle import TRUE -from cloudpickle.cloudpickle import instance from abstract.semantics import Type from cil.nodes import ( AbortNode, @@ -1187,6 +1186,10 @@ def _(self, node: cil.ReadNode): self.register_instruction(MOVE(length, zero)) self.register_instruction(MOVE(temp, zero)) self.register_instruction(MOVE(reg2, reg)) + + self.register_instruction(LB(temp, f"0(${REG_TO_STR[reg2]})")) + self.register_instruction(BEQZ(temp, "end_loop")) + self.register_instruction(Label("read_length_loop")) # while [reg2] != 0: length ++ self.register_instruction(LB(temp, f"0(${REG_TO_STR[reg2]})")) @@ -1201,6 +1204,8 @@ def _(self, node: cil.ReadNode): self.register_instruction(SB(zero, f"0(${REG_TO_STR[reg2]})")) self.register_instruction(SUBU(length, length, 1, True)) + self.register_instruction(Label("end_loop")) + # length contiene el length del string # Crear la instancia diff --git a/tests/codegen/arith.mips b/tests/codegen/arith.mips new file mode 100644 index 00000000..3be4ca38 --- /dev/null +++ b/tests/codegen/arith.mips @@ -0,0 +1,22254 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:06 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +A2I: .asciiz "A2I" +# Function END +A: .asciiz "A" +# Function END +B: .asciiz "B" +# Function END +D: .asciiz "D" +# Function END +E: .asciiz "E" +# Function END +C: .asciiz "C" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_out_int_at_IO, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_length_at_String, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, function_concat_at_String, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type A2I **** +A2I_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_i2a_at_A2I, dummy, dummy, dummy, function_i2c_at_A2I, function_a2i_aux_at_A2I, dummy, dummy, function_i2a_aux_at_A2I, dummy, dummy, function_c2i_at_A2I, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_a2i_at_A2I +# Function END +# + + +# **** Type RECORD for type A2I **** +A2I_start: + A2I_vtable_pointer: .word A2I_vtable + # Function END +A2I_end: +# + + +# **** VTABLE for type A **** +A_vtable: .word dummy, dummy, function_method4_at_A, dummy, function_copy_at_Object, function_method1_at_A, function_value_at_A, function_method5_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method3_at_A, dummy, dummy, function_method2_at_A, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_set_var_at_A, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type A **** +A_start: + A_vtable_pointer: .word A_vtable + # Function END +A_end: +# + + +# **** VTABLE for type B **** +B_vtable: .word dummy, dummy, function_method4_at_A, dummy, function_copy_at_Object, function_method1_at_A, function_value_at_A, function_method5_at_B, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method3_at_A, dummy, dummy, function_method2_at_A, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_set_var_at_A, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type B **** +B_start: + B_vtable_pointer: .word B_vtable + # Function END +B_end: +# + + +# **** VTABLE for type D **** +D_vtable: .word dummy, dummy, function_method4_at_A, dummy, function_copy_at_Object, function_method1_at_A, function_value_at_A, function_method5_at_B, dummy, function_method7_at_D, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method3_at_A, dummy, dummy, function_method2_at_A, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_set_var_at_A, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type D **** +D_start: + D_vtable_pointer: .word D_vtable + # Function END +D_end: +# + + +# **** VTABLE for type E **** +E_vtable: .word dummy, dummy, function_method4_at_A, dummy, function_copy_at_Object, function_method1_at_A, function_value_at_A, function_method5_at_B, dummy, function_method7_at_D, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method3_at_A, dummy, dummy, function_method2_at_A, function_abort_at_Object, dummy, dummy, dummy, function_method6_at_E, dummy, dummy, function_set_var_at_A, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type E **** +E_start: + E_vtable_pointer: .word E_vtable + # Function END +E_end: +# + + +# **** VTABLE for type C **** +C_vtable: .word dummy, dummy, function_method4_at_A, dummy, function_copy_at_Object, function_method1_at_A, function_value_at_A, function_method5_at_C, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method3_at_A, dummy, dummy, function_method2_at_A, function_abort_at_Object, dummy, dummy, dummy, function_method6_at_C, dummy, dummy, function_set_var_at_A, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type C **** +C_start: + C_vtable_pointer: .word C_vtable + # Function END +C_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_out_int_at_IO, function_is_even_at_Main, dummy, function_main_at_Main, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_print_at_Main, dummy, dummy, function_in_int_at_IO, function_in_string_at_IO, dummy, function_prompt_at_Main, dummy, dummy, function_class_type_at_Main, dummy, function_abort_at_Object, dummy, function_out_string_at_IO, dummy, dummy, function_menu_at_Main, function_get_int_at_Main, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 1, 1, 2, 3, 4, 3, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1 +A2I__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 +A__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 2, -1 +B__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 1, -1 +D__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1 +E__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 +C__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "0" +# + + +data_5: .asciiz "1" +# + + +data_6: .asciiz "2" +# + + +data_7: .asciiz "3" +# + + +data_8: .asciiz "4" +# + + +data_9: .asciiz "5" +# + + +data_10: .asciiz "6" +# + + +data_11: .asciiz "7" +# + + +data_12: .asciiz "8" +# + + +data_13: .asciiz "9" +# + + +data_14: .asciiz "0" +# + + +data_15: .asciiz "1" +# + + +data_16: .asciiz "2" +# + + +data_17: .asciiz "3" +# + + +data_18: .asciiz "4" +# + + +data_19: .asciiz "5" +# + + +data_20: .asciiz "6" +# + + +data_21: .asciiz "7" +# + + +data_22: .asciiz "8" +# + + +data_23: .asciiz "9" +# + + +data_24: .asciiz "" +# + + +data_25: .asciiz "-" +# + + +data_26: .asciiz "+" +# + + +data_27: .asciiz "0" +# + + +data_28: .asciiz "-" +# + + +data_29: .asciiz "" +# + + +data_30: .asciiz "\n\tTo add a number to " +# + + +data_31: .asciiz "...enter a:\n" +# + + +data_32: .asciiz "\tTo negate " +# + + +data_33: .asciiz "...enter b:\n" +# + + +data_34: .asciiz "\tTo find the difference between " +# + + +data_35: .asciiz "and another number...enter c:\n" +# + + +data_36: .asciiz "\tTo find the factorial of " +# + + +data_37: .asciiz "...enter d:\n" +# + + +data_38: .asciiz "\tTo square " +# + + +data_39: .asciiz "...enter e:\n" +# + + +data_40: .asciiz "\tTo cube " +# + + +data_41: .asciiz "...enter f:\n" +# + + +data_42: .asciiz "\tTo find out if " +# + + +data_43: .asciiz "is a multiple of 3...enter g:\n" +# + + +data_44: .asciiz "\tTo divide " +# + + +data_45: .asciiz "by 8...enter h:\n" +# + + +data_46: .asciiz "\tTo get a new number...enter j:\n" +# + + +data_47: .asciiz "\tTo quit...enter q:\n\n" +# + + +data_48: .asciiz "\n" +# + + +data_49: .asciiz "Please enter a number... " +# + + +data_50: .asciiz "Class type is now A\n" +# + + +data_51: .asciiz "Class type is now B\n" +# + + +data_52: .asciiz "Class type is now C\n" +# + + +data_53: .asciiz "Class type is now D\n" +# + + +data_54: .asciiz "Class type is now E\n" +# + + +data_55: .asciiz "Oooops\n" +# + + +data_56: .asciiz " " +# + + +data_57: .asciiz "number " +# + + +data_58: .asciiz "is even!\n" +# + + +data_59: .asciiz "is odd!\n" +# + + +data_60: .asciiz "a" +# + + +data_61: .asciiz "b" +# + + +data_62: .asciiz "Oooops\n" +# + + +data_63: .asciiz "c" +# + + +data_64: .asciiz "d" +# + + +data_65: .asciiz "e" +# + + +data_66: .asciiz "f" +# + + +data_67: .asciiz "g" +# + + +data_68: .asciiz "number " +# + + +data_69: .asciiz "is divisible by 3.\n" +# + + +data_70: .asciiz "number " +# + + +data_71: .asciiz "is not divisible by 3.\n" +# + + +data_72: .asciiz "h" +# + + +data_73: .asciiz "number " +# + + +data_74: .asciiz "is equal to " +# + + +data_75: .asciiz "times 8 with a remainder of " +# + + +data_76: .asciiz "\n" +# + + +data_77: .asciiz "j" +# + + +data_78: .asciiz "q" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + lb $t3, 0($t1) + beqz $t3, end_loop + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + end_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 28 bytes of memory + li $a0, 28 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 44 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__char__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__avar__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__a_var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__flag__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 12($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_c2i_at_A2I implementation. +# @Params: +# 0($fp) = param_c2i_at_A2I_char_0 +function_c2i_at_A2I: + # Allocate stack frame for function function_c2i_at_A2I. + subu $sp, $sp, 264 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 264 + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -20($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_3 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_3 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_3 + # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_3 + # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_3 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_3 + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_6 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_6 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_6 + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_7 + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_7 + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_4 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_COMPARE_BY_VALUE_7: + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_4 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_COMPARE_STRING_6: + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_CONTINUE_8 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_CONTINUE_8 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_8 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_CONTINUE_8: + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_9: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_10 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_9 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_10: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_4 + label_FALSE_3: + # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_5 +j label_END_5 +label_TRUE_4: + # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_5: +# LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) +# LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSEIF_1 +# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSEIF_1 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_1 +# LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -24($fp) +# LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) +# LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) +# local_c2i_at_A2I_internal_1 = local_c2i_at_A2I_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -44($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_13 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_13 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_13 + # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_13 + # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_13 + lw $t0, -44($fp) + beq $t0, 0, label_FALSE_13 + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_STRING_16 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_STRING_16 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_16 + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_17 + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_17 + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -44($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_14 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_COMPARE_BY_VALUE_17: + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + lw $a0, 0($fp) + lw $a1, -44($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_14 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_COMPARE_STRING_16: + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_CONTINUE_18 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_CONTINUE_18 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_18 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_CONTINUE_18: + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_19: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_20 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_19 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_20: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_14 + label_FALSE_13: + # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_15 +j label_END_15 +label_TRUE_14: + # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_15: +# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) +# LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSEIF_11 +# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSEIF_11 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_11 +# LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -48($fp) +# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) +# LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) +# local_c2i_at_A2I_internal_7 = local_c2i_at_A2I_internal_11 +lw $t0, -48($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_12 +j label_ENDIF_12 +label_FALSEIF_11: + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_6 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -68($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_23 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_23 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_23 + # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_23 + # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_23 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_23 + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_STRING_26 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_STRING_26 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_STRING_26 + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_27 + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_27 + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_24 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_COMPARE_BY_VALUE_27: + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + lw $a0, 0($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_24 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_COMPARE_STRING_26: + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_CONTINUE_28 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_CONTINUE_28 + lw $t0, -64($fp) + beq $t0, 0, label_CONTINUE_28 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_CONTINUE_28: + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_29: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_30 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_29 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_30: + # Store result + sw $a2, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_24 + label_FALSE_23: + # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # GOTO label_END_25 +j label_END_25 +label_TRUE_24: + # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + label_END_25: +# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) +# LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) +# Obtain value from -60($fp) +lw $v0, -60($fp) +lw $v0, 12($v0) +sw $v0, -52($fp) +# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSEIF_21 +# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSEIF_21 +lw $t0, -52($fp) +beq $t0, 0, label_FALSEIF_21 +# LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 2 +sw $t0, 12($v0) +sw $v0, -72($fp) +# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) +# LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) +# local_c2i_at_A2I_internal_13 = local_c2i_at_A2I_internal_17 +lw $t0, -72($fp) +sw $t0, -56($fp) +# GOTO label_ENDIF_22 +j label_ENDIF_22 +label_FALSEIF_21: + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_7 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -92($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_33 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_33 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_33 + # IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_FALSE_33 + # IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_FALSE_33 + lw $t0, -92($fp) + beq $t0, 0, label_FALSE_33 + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_STRING_36 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_STRING_36 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_STRING_36 + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_37 + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_37 + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -92($fp) + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_34 + # GOTO label_FALSE_33 + j label_FALSE_33 + label_COMPARE_BY_VALUE_37: + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + lw $a0, 0($fp) + lw $a1, -92($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_34 + # GOTO label_FALSE_33 + j label_FALSE_33 + label_COMPARE_STRING_36: + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_CONTINUE_38 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_CONTINUE_38 + lw $t0, -88($fp) + beq $t0, 0, label_CONTINUE_38 + # GOTO label_FALSE_33 + j label_FALSE_33 + label_CONTINUE_38: + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_39: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_40 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_39 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_40: + # Store result + sw $a2, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_34 + label_FALSE_33: + # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -84($fp) + # GOTO label_END_35 +j label_END_35 +label_TRUE_34: + # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -84($fp) + label_END_35: +# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) +# LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) +# Obtain value from -84($fp) +lw $v0, -84($fp) +lw $v0, 12($v0) +sw $v0, -76($fp) +# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSEIF_31 +# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSEIF_31 +lw $t0, -76($fp) +beq $t0, 0, label_FALSEIF_31 +# LOCAL local_c2i_at_A2I_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 3 +sw $t0, 12($v0) +sw $v0, -96($fp) +# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) +# LOCAL local_c2i_at_A2I_internal_23 --> -96($fp) +# local_c2i_at_A2I_internal_19 = local_c2i_at_A2I_internal_23 +lw $t0, -96($fp) +sw $t0, -80($fp) +# GOTO label_ENDIF_32 +j label_ENDIF_32 +label_FALSEIF_31: + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_8 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -116($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_43 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_43 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_43 + # IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_FALSE_43 + # IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_FALSE_43 + lw $t0, -116($fp) + beq $t0, 0, label_FALSE_43 + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_STRING_46 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_STRING_46 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_STRING_46 + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_47 + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_47 + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -116($fp) + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_44 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_COMPARE_BY_VALUE_47: + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + lw $a0, 0($fp) + lw $a1, -116($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_44 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_COMPARE_STRING_46: + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_CONTINUE_48 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_CONTINUE_48 + lw $t0, -112($fp) + beq $t0, 0, label_CONTINUE_48 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_CONTINUE_48: + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_49: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_50 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_49 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_50: + # Store result + sw $a2, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_44 + label_FALSE_43: + # LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -108($fp) + # GOTO label_END_45 +j label_END_45 +label_TRUE_44: + # LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -108($fp) + label_END_45: +# LOCAL local_c2i_at_A2I_internal_24 --> -100($fp) +# LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) +# Obtain value from -108($fp) +lw $v0, -108($fp) +lw $v0, 12($v0) +sw $v0, -100($fp) +# IF_ZERO local_c2i_at_A2I_internal_24 GOTO label_FALSEIF_41 +# IF_ZERO local_c2i_at_A2I_internal_24 GOTO label_FALSEIF_41 +lw $t0, -100($fp) +beq $t0, 0, label_FALSEIF_41 +# LOCAL local_c2i_at_A2I_internal_29 --> -120($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 4 +sw $t0, 12($v0) +sw $v0, -120($fp) +# LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) +# LOCAL local_c2i_at_A2I_internal_29 --> -120($fp) +# local_c2i_at_A2I_internal_25 = local_c2i_at_A2I_internal_29 +lw $t0, -120($fp) +sw $t0, -104($fp) +# GOTO label_ENDIF_42 +j label_ENDIF_42 +label_FALSEIF_41: + # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_9 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -140($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_53 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_53 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_53 + # IF_ZERO local_c2i_at_A2I_internal_34 GOTO label_FALSE_53 + # IF_ZERO local_c2i_at_A2I_internal_34 GOTO label_FALSE_53 + lw $t0, -140($fp) + beq $t0, 0, label_FALSE_53 + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_STRING_56 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_STRING_56 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_STRING_56 + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_57 + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_57 + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -140($fp) + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_54 + # GOTO label_FALSE_53 + j label_FALSE_53 + label_COMPARE_BY_VALUE_57: + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) + lw $a0, 0($fp) + lw $a1, -140($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_54 + # GOTO label_FALSE_53 + j label_FALSE_53 + label_COMPARE_STRING_56: + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_CONTINUE_58 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_CONTINUE_58 + lw $t0, -136($fp) + beq $t0, 0, label_CONTINUE_58 + # GOTO label_FALSE_53 + j label_FALSE_53 + label_CONTINUE_58: + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_59: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_60 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_59 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_60: + # Store result + sw $a2, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_54 + label_FALSE_53: + # LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -132($fp) + # GOTO label_END_55 +j label_END_55 +label_TRUE_54: + # LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -132($fp) + label_END_55: +# LOCAL local_c2i_at_A2I_internal_30 --> -124($fp) +# LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) +# Obtain value from -132($fp) +lw $v0, -132($fp) +lw $v0, 12($v0) +sw $v0, -124($fp) +# IF_ZERO local_c2i_at_A2I_internal_30 GOTO label_FALSEIF_51 +# IF_ZERO local_c2i_at_A2I_internal_30 GOTO label_FALSEIF_51 +lw $t0, -124($fp) +beq $t0, 0, label_FALSEIF_51 +# LOCAL local_c2i_at_A2I_internal_35 --> -144($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 5 +sw $t0, 12($v0) +sw $v0, -144($fp) +# LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) +# LOCAL local_c2i_at_A2I_internal_35 --> -144($fp) +# local_c2i_at_A2I_internal_31 = local_c2i_at_A2I_internal_35 +lw $t0, -144($fp) +sw $t0, -128($fp) +# GOTO label_ENDIF_52 +j label_ENDIF_52 +label_FALSEIF_51: + # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_10 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -164($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_63 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_63 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_63 + # IF_ZERO local_c2i_at_A2I_internal_40 GOTO label_FALSE_63 + # IF_ZERO local_c2i_at_A2I_internal_40 GOTO label_FALSE_63 + lw $t0, -164($fp) + beq $t0, 0, label_FALSE_63 + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_STRING_66 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_STRING_66 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_STRING_66 + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_67 + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_67 + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -164($fp) + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_64 + # GOTO label_FALSE_63 + j label_FALSE_63 + label_COMPARE_BY_VALUE_67: + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) + lw $a0, 0($fp) + lw $a1, -164($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_64 + # GOTO label_FALSE_63 + j label_FALSE_63 + label_COMPARE_STRING_66: + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_CONTINUE_68 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_CONTINUE_68 + lw $t0, -160($fp) + beq $t0, 0, label_CONTINUE_68 + # GOTO label_FALSE_63 + j label_FALSE_63 + label_CONTINUE_68: + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_69: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_70 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_69 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_70: + # Store result + sw $a2, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_64 + label_FALSE_63: + # LOCAL local_c2i_at_A2I_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -156($fp) + # GOTO label_END_65 +j label_END_65 +label_TRUE_64: + # LOCAL local_c2i_at_A2I_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -156($fp) + label_END_65: +# LOCAL local_c2i_at_A2I_internal_36 --> -148($fp) +# LOCAL local_c2i_at_A2I_internal_38 --> -156($fp) +# Obtain value from -156($fp) +lw $v0, -156($fp) +lw $v0, 12($v0) +sw $v0, -148($fp) +# IF_ZERO local_c2i_at_A2I_internal_36 GOTO label_FALSEIF_61 +# IF_ZERO local_c2i_at_A2I_internal_36 GOTO label_FALSEIF_61 +lw $t0, -148($fp) +beq $t0, 0, label_FALSEIF_61 +# LOCAL local_c2i_at_A2I_internal_41 --> -168($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 6 +sw $t0, 12($v0) +sw $v0, -168($fp) +# LOCAL local_c2i_at_A2I_internal_37 --> -152($fp) +# LOCAL local_c2i_at_A2I_internal_41 --> -168($fp) +# local_c2i_at_A2I_internal_37 = local_c2i_at_A2I_internal_41 +lw $t0, -168($fp) +sw $t0, -152($fp) +# GOTO label_ENDIF_62 +j label_ENDIF_62 +label_FALSEIF_61: + # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_11 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -188($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_73 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_73 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_73 + # IF_ZERO local_c2i_at_A2I_internal_46 GOTO label_FALSE_73 + # IF_ZERO local_c2i_at_A2I_internal_46 GOTO label_FALSE_73 + lw $t0, -188($fp) + beq $t0, 0, label_FALSE_73 + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_STRING_76 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_STRING_76 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_STRING_76 + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_77 + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_77 + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -188($fp) + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_74 + # GOTO label_FALSE_73 + j label_FALSE_73 + label_COMPARE_BY_VALUE_77: + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) + lw $a0, 0($fp) + lw $a1, -188($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_74 + # GOTO label_FALSE_73 + j label_FALSE_73 + label_COMPARE_STRING_76: + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_CONTINUE_78 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_CONTINUE_78 + lw $t0, -184($fp) + beq $t0, 0, label_CONTINUE_78 + # GOTO label_FALSE_73 + j label_FALSE_73 + label_CONTINUE_78: + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_79: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_80 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_79 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_80: + # Store result + sw $a2, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_74 + label_FALSE_73: + # LOCAL local_c2i_at_A2I_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -180($fp) + # GOTO label_END_75 +j label_END_75 +label_TRUE_74: + # LOCAL local_c2i_at_A2I_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -180($fp) + label_END_75: +# LOCAL local_c2i_at_A2I_internal_42 --> -172($fp) +# LOCAL local_c2i_at_A2I_internal_44 --> -180($fp) +# Obtain value from -180($fp) +lw $v0, -180($fp) +lw $v0, 12($v0) +sw $v0, -172($fp) +# IF_ZERO local_c2i_at_A2I_internal_42 GOTO label_FALSEIF_71 +# IF_ZERO local_c2i_at_A2I_internal_42 GOTO label_FALSEIF_71 +lw $t0, -172($fp) +beq $t0, 0, label_FALSEIF_71 +# LOCAL local_c2i_at_A2I_internal_47 --> -192($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 7 +sw $t0, 12($v0) +sw $v0, -192($fp) +# LOCAL local_c2i_at_A2I_internal_43 --> -176($fp) +# LOCAL local_c2i_at_A2I_internal_47 --> -192($fp) +# local_c2i_at_A2I_internal_43 = local_c2i_at_A2I_internal_47 +lw $t0, -192($fp) +sw $t0, -176($fp) +# GOTO label_ENDIF_72 +j label_ENDIF_72 +label_FALSEIF_71: + # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_12 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -212($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_83 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_83 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_83 + # IF_ZERO local_c2i_at_A2I_internal_52 GOTO label_FALSE_83 + # IF_ZERO local_c2i_at_A2I_internal_52 GOTO label_FALSE_83 + lw $t0, -212($fp) + beq $t0, 0, label_FALSE_83 + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_STRING_86 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_STRING_86 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_STRING_86 + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_87 + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_87 + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -212($fp) + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_84 + # GOTO label_FALSE_83 + j label_FALSE_83 + label_COMPARE_BY_VALUE_87: + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) + lw $a0, 0($fp) + lw $a1, -212($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_84 + # GOTO label_FALSE_83 + j label_FALSE_83 + label_COMPARE_STRING_86: + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_CONTINUE_88 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_CONTINUE_88 + lw $t0, -208($fp) + beq $t0, 0, label_CONTINUE_88 + # GOTO label_FALSE_83 + j label_FALSE_83 + label_CONTINUE_88: + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_89: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_90 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_89 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_90: + # Store result + sw $a2, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_84 + label_FALSE_83: + # LOCAL local_c2i_at_A2I_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -204($fp) + # GOTO label_END_85 +j label_END_85 +label_TRUE_84: + # LOCAL local_c2i_at_A2I_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -204($fp) + label_END_85: +# LOCAL local_c2i_at_A2I_internal_48 --> -196($fp) +# LOCAL local_c2i_at_A2I_internal_50 --> -204($fp) +# Obtain value from -204($fp) +lw $v0, -204($fp) +lw $v0, 12($v0) +sw $v0, -196($fp) +# IF_ZERO local_c2i_at_A2I_internal_48 GOTO label_FALSEIF_81 +# IF_ZERO local_c2i_at_A2I_internal_48 GOTO label_FALSEIF_81 +lw $t0, -196($fp) +beq $t0, 0, label_FALSEIF_81 +# LOCAL local_c2i_at_A2I_internal_53 --> -216($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 8 +sw $t0, 12($v0) +sw $v0, -216($fp) +# LOCAL local_c2i_at_A2I_internal_49 --> -200($fp) +# LOCAL local_c2i_at_A2I_internal_53 --> -216($fp) +# local_c2i_at_A2I_internal_49 = local_c2i_at_A2I_internal_53 +lw $t0, -216($fp) +sw $t0, -200($fp) +# GOTO label_ENDIF_82 +j label_ENDIF_82 +label_FALSEIF_81: + # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_13 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -236($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_93 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_93 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_93 + # IF_ZERO local_c2i_at_A2I_internal_58 GOTO label_FALSE_93 + # IF_ZERO local_c2i_at_A2I_internal_58 GOTO label_FALSE_93 + lw $t0, -236($fp) + beq $t0, 0, label_FALSE_93 + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_STRING_96 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_STRING_96 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_STRING_96 + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_97 + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_97 + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -236($fp) + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_94 + # GOTO label_FALSE_93 + j label_FALSE_93 + label_COMPARE_BY_VALUE_97: + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) + lw $a0, 0($fp) + lw $a1, -236($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_94 + # GOTO label_FALSE_93 + j label_FALSE_93 + label_COMPARE_STRING_96: + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_CONTINUE_98 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_CONTINUE_98 + lw $t0, -232($fp) + beq $t0, 0, label_CONTINUE_98 + # GOTO label_FALSE_93 + j label_FALSE_93 + label_CONTINUE_98: + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_99: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_100 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_99 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_100: + # Store result + sw $a2, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_94 + label_FALSE_93: + # LOCAL local_c2i_at_A2I_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -228($fp) + # GOTO label_END_95 +j label_END_95 +label_TRUE_94: + # LOCAL local_c2i_at_A2I_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -228($fp) + label_END_95: +# LOCAL local_c2i_at_A2I_internal_54 --> -220($fp) +# LOCAL local_c2i_at_A2I_internal_56 --> -228($fp) +# Obtain value from -228($fp) +lw $v0, -228($fp) +lw $v0, 12($v0) +sw $v0, -220($fp) +# IF_ZERO local_c2i_at_A2I_internal_54 GOTO label_FALSEIF_91 +# IF_ZERO local_c2i_at_A2I_internal_54 GOTO label_FALSEIF_91 +lw $t0, -220($fp) +beq $t0, 0, label_FALSEIF_91 +# LOCAL local_c2i_at_A2I_internal_59 --> -240($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 9 +sw $t0, 12($v0) +sw $v0, -240($fp) +# LOCAL local_c2i_at_A2I_internal_55 --> -224($fp) +# LOCAL local_c2i_at_A2I_internal_59 --> -240($fp) +# local_c2i_at_A2I_internal_55 = local_c2i_at_A2I_internal_59 +lw $t0, -240($fp) +sw $t0, -224($fp) +# GOTO label_ENDIF_92 +j label_ENDIF_92 +label_FALSEIF_91: + # LOCAL local_c2i_at_A2I_internal_62 --> -252($fp) + # local_c2i_at_A2I_internal_62 = SELF + sw $s1, -252($fp) + # LOCAL local_c2i_at_A2I_internal_60 --> -244($fp) + # LOCAL local_c2i_at_A2I_internal_62 --> -252($fp) + # local_c2i_at_A2I_internal_60 = local_c2i_at_A2I_internal_62 + lw $t0, -252($fp) + sw $t0, -244($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_c2i_at_A2I_internal_60 --> -244($fp) + # LOCAL local_c2i_at_A2I_internal_61 --> -248($fp) + # local_c2i_at_A2I_internal_61 = VCALL local_c2i_at_A2I_internal_60 abort + # Save new self pointer in $s1 + lw $s1, -244($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 88($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -248($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_c2i_at_A2I_internal_63 --> -256($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -256($fp) + # LOCAL local_c2i_at_A2I_internal_55 --> -224($fp) + # LOCAL local_c2i_at_A2I_internal_63 --> -256($fp) + # local_c2i_at_A2I_internal_55 = local_c2i_at_A2I_internal_63 + lw $t0, -256($fp) + sw $t0, -224($fp) + label_ENDIF_92: +# LOCAL local_c2i_at_A2I_internal_49 --> -200($fp) +# LOCAL local_c2i_at_A2I_internal_55 --> -224($fp) +# local_c2i_at_A2I_internal_49 = local_c2i_at_A2I_internal_55 +lw $t0, -224($fp) +sw $t0, -200($fp) +label_ENDIF_82: +# LOCAL local_c2i_at_A2I_internal_43 --> -176($fp) +# LOCAL local_c2i_at_A2I_internal_49 --> -200($fp) +# local_c2i_at_A2I_internal_43 = local_c2i_at_A2I_internal_49 +lw $t0, -200($fp) +sw $t0, -176($fp) +label_ENDIF_72: +# LOCAL local_c2i_at_A2I_internal_37 --> -152($fp) +# LOCAL local_c2i_at_A2I_internal_43 --> -176($fp) +# local_c2i_at_A2I_internal_37 = local_c2i_at_A2I_internal_43 +lw $t0, -176($fp) +sw $t0, -152($fp) +label_ENDIF_62: +# LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) +# LOCAL local_c2i_at_A2I_internal_37 --> -152($fp) +# local_c2i_at_A2I_internal_31 = local_c2i_at_A2I_internal_37 +lw $t0, -152($fp) +sw $t0, -128($fp) +label_ENDIF_52: +# LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) +# LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) +# local_c2i_at_A2I_internal_25 = local_c2i_at_A2I_internal_31 +lw $t0, -128($fp) +sw $t0, -104($fp) +label_ENDIF_42: +# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) +# LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) +# local_c2i_at_A2I_internal_19 = local_c2i_at_A2I_internal_25 +lw $t0, -104($fp) +sw $t0, -80($fp) +label_ENDIF_32: +# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) +# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) +# local_c2i_at_A2I_internal_13 = local_c2i_at_A2I_internal_19 +lw $t0, -80($fp) +sw $t0, -56($fp) +label_ENDIF_22: +# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) +# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) +# local_c2i_at_A2I_internal_7 = local_c2i_at_A2I_internal_13 +lw $t0, -56($fp) +sw $t0, -32($fp) +label_ENDIF_12: +# LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) +# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) +# local_c2i_at_A2I_internal_1 = local_c2i_at_A2I_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +label_ENDIF_2: +# RETURN local_c2i_at_A2I_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_c2i_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 264 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_i2c_at_A2I implementation. +# @Params: +# 0($fp) = param_i2c_at_A2I_i_0 +function_i2c_at_A2I: + # Allocate stack frame for function function_i2c_at_A2I. + subu $sp, $sp, 264 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 264 + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_103 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_103 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_103 + # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_103 + # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_103 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_103 + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_STRING_106 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_STRING_106 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_106 + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_107 + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_107 + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_104 + # GOTO label_FALSE_103 + j label_FALSE_103 + label_COMPARE_BY_VALUE_107: + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_104 + # GOTO label_FALSE_103 + j label_FALSE_103 + label_COMPARE_STRING_106: + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_CONTINUE_108 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_CONTINUE_108 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_108 + # GOTO label_FALSE_103 + j label_FALSE_103 + label_CONTINUE_108: + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_109: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_110 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_109 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_110: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_104 + label_FALSE_103: + # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_105 +j label_END_105 +label_TRUE_104: + # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_105: +# LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSEIF_101 +# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSEIF_101 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_101 +# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_14 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -24($fp) +# LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) +# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) +# local_i2c_at_A2I_internal_1 = local_i2c_at_A2I_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_102 +j label_ENDIF_102 +label_FALSEIF_101: + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_113 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_113 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_113 + # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_113 + # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_113 + lw $t0, -44($fp) + beq $t0, 0, label_FALSE_113 + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_STRING_116 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_STRING_116 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_116 + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_117 + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_117 + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -44($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_114 + # GOTO label_FALSE_113 + j label_FALSE_113 + label_COMPARE_BY_VALUE_117: + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + lw $a0, 0($fp) + lw $a1, -44($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_114 + # GOTO label_FALSE_113 + j label_FALSE_113 + label_COMPARE_STRING_116: + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_CONTINUE_118 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_CONTINUE_118 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_118 + # GOTO label_FALSE_113 + j label_FALSE_113 + label_CONTINUE_118: + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_119: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_120 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_119 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_120: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_114 + label_FALSE_113: + # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_115 +j label_END_115 +label_TRUE_114: + # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_115: +# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) +# LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSEIF_111 +# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSEIF_111 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_111 +# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_15 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -48($fp) +# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) +# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) +# local_i2c_at_A2I_internal_7 = local_i2c_at_A2I_internal_11 +lw $t0, -48($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_112 +j label_ENDIF_112 +label_FALSEIF_111: + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 2 + sw $t0, 12($v0) + sw $v0, -68($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_123 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_123 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_123 + # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_123 + # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_123 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_123 + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_STRING_126 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_STRING_126 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_STRING_126 + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_127 + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_127 + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_124 + # GOTO label_FALSE_123 + j label_FALSE_123 + label_COMPARE_BY_VALUE_127: + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + lw $a0, 0($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_124 + # GOTO label_FALSE_123 + j label_FALSE_123 + label_COMPARE_STRING_126: + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_CONTINUE_128 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_CONTINUE_128 + lw $t0, -64($fp) + beq $t0, 0, label_CONTINUE_128 + # GOTO label_FALSE_123 + j label_FALSE_123 + label_CONTINUE_128: + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_129: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_130 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_129 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_130: + # Store result + sw $a2, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_124 + label_FALSE_123: + # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # GOTO label_END_125 +j label_END_125 +label_TRUE_124: + # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + label_END_125: +# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) +# LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) +# Obtain value from -60($fp) +lw $v0, -60($fp) +lw $v0, 12($v0) +sw $v0, -52($fp) +# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSEIF_121 +# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSEIF_121 +lw $t0, -52($fp) +beq $t0, 0, label_FALSEIF_121 +# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_16 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -72($fp) +# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) +# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) +# local_i2c_at_A2I_internal_13 = local_i2c_at_A2I_internal_17 +lw $t0, -72($fp) +sw $t0, -56($fp) +# GOTO label_ENDIF_122 +j label_ENDIF_122 +label_FALSEIF_121: + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 3 + sw $t0, 12($v0) + sw $v0, -92($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_133 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_133 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_133 + # IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_FALSE_133 + # IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_FALSE_133 + lw $t0, -92($fp) + beq $t0, 0, label_FALSE_133 + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_STRING_136 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_STRING_136 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_STRING_136 + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_137 + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_137 + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -92($fp) + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_134 + # GOTO label_FALSE_133 + j label_FALSE_133 + label_COMPARE_BY_VALUE_137: + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + lw $a0, 0($fp) + lw $a1, -92($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_134 + # GOTO label_FALSE_133 + j label_FALSE_133 + label_COMPARE_STRING_136: + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_CONTINUE_138 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_CONTINUE_138 + lw $t0, -88($fp) + beq $t0, 0, label_CONTINUE_138 + # GOTO label_FALSE_133 + j label_FALSE_133 + label_CONTINUE_138: + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_139: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_140 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_139 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_140: + # Store result + sw $a2, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_134 + label_FALSE_133: + # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -84($fp) + # GOTO label_END_135 +j label_END_135 +label_TRUE_134: + # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -84($fp) + label_END_135: +# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) +# LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) +# Obtain value from -84($fp) +lw $v0, -84($fp) +lw $v0, 12($v0) +sw $v0, -76($fp) +# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSEIF_131 +# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSEIF_131 +lw $t0, -76($fp) +beq $t0, 0, label_FALSEIF_131 +# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_17 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -96($fp) +# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) +# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) +# local_i2c_at_A2I_internal_19 = local_i2c_at_A2I_internal_23 +lw $t0, -96($fp) +sw $t0, -80($fp) +# GOTO label_ENDIF_132 +j label_ENDIF_132 +label_FALSEIF_131: + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 4 + sw $t0, 12($v0) + sw $v0, -116($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_143 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_143 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_143 + # IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_FALSE_143 + # IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_FALSE_143 + lw $t0, -116($fp) + beq $t0, 0, label_FALSE_143 + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_STRING_146 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_STRING_146 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_STRING_146 + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_147 + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_147 + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -116($fp) + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_144 + # GOTO label_FALSE_143 + j label_FALSE_143 + label_COMPARE_BY_VALUE_147: + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + lw $a0, 0($fp) + lw $a1, -116($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_144 + # GOTO label_FALSE_143 + j label_FALSE_143 + label_COMPARE_STRING_146: + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_CONTINUE_148 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_CONTINUE_148 + lw $t0, -112($fp) + beq $t0, 0, label_CONTINUE_148 + # GOTO label_FALSE_143 + j label_FALSE_143 + label_CONTINUE_148: + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_149: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_150 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_149 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_150: + # Store result + sw $a2, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_144 + label_FALSE_143: + # LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -108($fp) + # GOTO label_END_145 +j label_END_145 +label_TRUE_144: + # LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -108($fp) + label_END_145: +# LOCAL local_i2c_at_A2I_internal_24 --> -100($fp) +# LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) +# Obtain value from -108($fp) +lw $v0, -108($fp) +lw $v0, 12($v0) +sw $v0, -100($fp) +# IF_ZERO local_i2c_at_A2I_internal_24 GOTO label_FALSEIF_141 +# IF_ZERO local_i2c_at_A2I_internal_24 GOTO label_FALSEIF_141 +lw $t0, -100($fp) +beq $t0, 0, label_FALSEIF_141 +# LOCAL local_i2c_at_A2I_internal_29 --> -120($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_18 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -120($fp) +# LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) +# LOCAL local_i2c_at_A2I_internal_29 --> -120($fp) +# local_i2c_at_A2I_internal_25 = local_i2c_at_A2I_internal_29 +lw $t0, -120($fp) +sw $t0, -104($fp) +# GOTO label_ENDIF_142 +j label_ENDIF_142 +label_FALSEIF_141: + # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 5 + sw $t0, 12($v0) + sw $v0, -140($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_153 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_153 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_153 + # IF_ZERO local_i2c_at_A2I_internal_34 GOTO label_FALSE_153 + # IF_ZERO local_i2c_at_A2I_internal_34 GOTO label_FALSE_153 + lw $t0, -140($fp) + beq $t0, 0, label_FALSE_153 + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_STRING_156 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_STRING_156 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_STRING_156 + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_157 + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_157 + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -140($fp) + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_154 + # GOTO label_FALSE_153 + j label_FALSE_153 + label_COMPARE_BY_VALUE_157: + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) + lw $a0, 0($fp) + lw $a1, -140($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_154 + # GOTO label_FALSE_153 + j label_FALSE_153 + label_COMPARE_STRING_156: + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_CONTINUE_158 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_CONTINUE_158 + lw $t0, -136($fp) + beq $t0, 0, label_CONTINUE_158 + # GOTO label_FALSE_153 + j label_FALSE_153 + label_CONTINUE_158: + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_159: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_160 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_159 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_160: + # Store result + sw $a2, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_154 + label_FALSE_153: + # LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -132($fp) + # GOTO label_END_155 +j label_END_155 +label_TRUE_154: + # LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -132($fp) + label_END_155: +# LOCAL local_i2c_at_A2I_internal_30 --> -124($fp) +# LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) +# Obtain value from -132($fp) +lw $v0, -132($fp) +lw $v0, 12($v0) +sw $v0, -124($fp) +# IF_ZERO local_i2c_at_A2I_internal_30 GOTO label_FALSEIF_151 +# IF_ZERO local_i2c_at_A2I_internal_30 GOTO label_FALSEIF_151 +lw $t0, -124($fp) +beq $t0, 0, label_FALSEIF_151 +# LOCAL local_i2c_at_A2I_internal_35 --> -144($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_19 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -144($fp) +# LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) +# LOCAL local_i2c_at_A2I_internal_35 --> -144($fp) +# local_i2c_at_A2I_internal_31 = local_i2c_at_A2I_internal_35 +lw $t0, -144($fp) +sw $t0, -128($fp) +# GOTO label_ENDIF_152 +j label_ENDIF_152 +label_FALSEIF_151: + # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 6 + sw $t0, 12($v0) + sw $v0, -164($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_163 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_163 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_163 + # IF_ZERO local_i2c_at_A2I_internal_40 GOTO label_FALSE_163 + # IF_ZERO local_i2c_at_A2I_internal_40 GOTO label_FALSE_163 + lw $t0, -164($fp) + beq $t0, 0, label_FALSE_163 + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_STRING_166 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_STRING_166 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_STRING_166 + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_167 + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_167 + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -164($fp) + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_164 + # GOTO label_FALSE_163 + j label_FALSE_163 + label_COMPARE_BY_VALUE_167: + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) + lw $a0, 0($fp) + lw $a1, -164($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_164 + # GOTO label_FALSE_163 + j label_FALSE_163 + label_COMPARE_STRING_166: + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_CONTINUE_168 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_CONTINUE_168 + lw $t0, -160($fp) + beq $t0, 0, label_CONTINUE_168 + # GOTO label_FALSE_163 + j label_FALSE_163 + label_CONTINUE_168: + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_169: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_170 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_169 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_170: + # Store result + sw $a2, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_164 + label_FALSE_163: + # LOCAL local_i2c_at_A2I_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -156($fp) + # GOTO label_END_165 +j label_END_165 +label_TRUE_164: + # LOCAL local_i2c_at_A2I_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -156($fp) + label_END_165: +# LOCAL local_i2c_at_A2I_internal_36 --> -148($fp) +# LOCAL local_i2c_at_A2I_internal_38 --> -156($fp) +# Obtain value from -156($fp) +lw $v0, -156($fp) +lw $v0, 12($v0) +sw $v0, -148($fp) +# IF_ZERO local_i2c_at_A2I_internal_36 GOTO label_FALSEIF_161 +# IF_ZERO local_i2c_at_A2I_internal_36 GOTO label_FALSEIF_161 +lw $t0, -148($fp) +beq $t0, 0, label_FALSEIF_161 +# LOCAL local_i2c_at_A2I_internal_41 --> -168($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_20 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -168($fp) +# LOCAL local_i2c_at_A2I_internal_37 --> -152($fp) +# LOCAL local_i2c_at_A2I_internal_41 --> -168($fp) +# local_i2c_at_A2I_internal_37 = local_i2c_at_A2I_internal_41 +lw $t0, -168($fp) +sw $t0, -152($fp) +# GOTO label_ENDIF_162 +j label_ENDIF_162 +label_FALSEIF_161: + # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 7 + sw $t0, 12($v0) + sw $v0, -188($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_173 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_173 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_173 + # IF_ZERO local_i2c_at_A2I_internal_46 GOTO label_FALSE_173 + # IF_ZERO local_i2c_at_A2I_internal_46 GOTO label_FALSE_173 + lw $t0, -188($fp) + beq $t0, 0, label_FALSE_173 + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_STRING_176 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_STRING_176 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_STRING_176 + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_177 + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_177 + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -188($fp) + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_174 + # GOTO label_FALSE_173 + j label_FALSE_173 + label_COMPARE_BY_VALUE_177: + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) + lw $a0, 0($fp) + lw $a1, -188($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_174 + # GOTO label_FALSE_173 + j label_FALSE_173 + label_COMPARE_STRING_176: + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_CONTINUE_178 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_CONTINUE_178 + lw $t0, -184($fp) + beq $t0, 0, label_CONTINUE_178 + # GOTO label_FALSE_173 + j label_FALSE_173 + label_CONTINUE_178: + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_179: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_180 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_179 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_180: + # Store result + sw $a2, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_174 + label_FALSE_173: + # LOCAL local_i2c_at_A2I_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -180($fp) + # GOTO label_END_175 +j label_END_175 +label_TRUE_174: + # LOCAL local_i2c_at_A2I_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -180($fp) + label_END_175: +# LOCAL local_i2c_at_A2I_internal_42 --> -172($fp) +# LOCAL local_i2c_at_A2I_internal_44 --> -180($fp) +# Obtain value from -180($fp) +lw $v0, -180($fp) +lw $v0, 12($v0) +sw $v0, -172($fp) +# IF_ZERO local_i2c_at_A2I_internal_42 GOTO label_FALSEIF_171 +# IF_ZERO local_i2c_at_A2I_internal_42 GOTO label_FALSEIF_171 +lw $t0, -172($fp) +beq $t0, 0, label_FALSEIF_171 +# LOCAL local_i2c_at_A2I_internal_47 --> -192($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_21 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -192($fp) +# LOCAL local_i2c_at_A2I_internal_43 --> -176($fp) +# LOCAL local_i2c_at_A2I_internal_47 --> -192($fp) +# local_i2c_at_A2I_internal_43 = local_i2c_at_A2I_internal_47 +lw $t0, -192($fp) +sw $t0, -176($fp) +# GOTO label_ENDIF_172 +j label_ENDIF_172 +label_FALSEIF_171: + # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 8 + sw $t0, 12($v0) + sw $v0, -212($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_183 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_183 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_183 + # IF_ZERO local_i2c_at_A2I_internal_52 GOTO label_FALSE_183 + # IF_ZERO local_i2c_at_A2I_internal_52 GOTO label_FALSE_183 + lw $t0, -212($fp) + beq $t0, 0, label_FALSE_183 + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_STRING_186 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_STRING_186 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_STRING_186 + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_187 + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_187 + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -212($fp) + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_184 + # GOTO label_FALSE_183 + j label_FALSE_183 + label_COMPARE_BY_VALUE_187: + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) + lw $a0, 0($fp) + lw $a1, -212($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_184 + # GOTO label_FALSE_183 + j label_FALSE_183 + label_COMPARE_STRING_186: + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_CONTINUE_188 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_CONTINUE_188 + lw $t0, -208($fp) + beq $t0, 0, label_CONTINUE_188 + # GOTO label_FALSE_183 + j label_FALSE_183 + label_CONTINUE_188: + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_189: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_190 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_189 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_190: + # Store result + sw $a2, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_184 + label_FALSE_183: + # LOCAL local_i2c_at_A2I_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -204($fp) + # GOTO label_END_185 +j label_END_185 +label_TRUE_184: + # LOCAL local_i2c_at_A2I_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -204($fp) + label_END_185: +# LOCAL local_i2c_at_A2I_internal_48 --> -196($fp) +# LOCAL local_i2c_at_A2I_internal_50 --> -204($fp) +# Obtain value from -204($fp) +lw $v0, -204($fp) +lw $v0, 12($v0) +sw $v0, -196($fp) +# IF_ZERO local_i2c_at_A2I_internal_48 GOTO label_FALSEIF_181 +# IF_ZERO local_i2c_at_A2I_internal_48 GOTO label_FALSEIF_181 +lw $t0, -196($fp) +beq $t0, 0, label_FALSEIF_181 +# LOCAL local_i2c_at_A2I_internal_53 --> -216($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_22 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -216($fp) +# LOCAL local_i2c_at_A2I_internal_49 --> -200($fp) +# LOCAL local_i2c_at_A2I_internal_53 --> -216($fp) +# local_i2c_at_A2I_internal_49 = local_i2c_at_A2I_internal_53 +lw $t0, -216($fp) +sw $t0, -200($fp) +# GOTO label_ENDIF_182 +j label_ENDIF_182 +label_FALSEIF_181: + # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 9 + sw $t0, 12($v0) + sw $v0, -236($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_193 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_193 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_193 + # IF_ZERO local_i2c_at_A2I_internal_58 GOTO label_FALSE_193 + # IF_ZERO local_i2c_at_A2I_internal_58 GOTO label_FALSE_193 + lw $t0, -236($fp) + beq $t0, 0, label_FALSE_193 + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_STRING_196 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_STRING_196 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_STRING_196 + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_197 + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_197 + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -236($fp) + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_194 + # GOTO label_FALSE_193 + j label_FALSE_193 + label_COMPARE_BY_VALUE_197: + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) + lw $a0, 0($fp) + lw $a1, -236($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_194 + # GOTO label_FALSE_193 + j label_FALSE_193 + label_COMPARE_STRING_196: + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_CONTINUE_198 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_CONTINUE_198 + lw $t0, -232($fp) + beq $t0, 0, label_CONTINUE_198 + # GOTO label_FALSE_193 + j label_FALSE_193 + label_CONTINUE_198: + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_199: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_200 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_199 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_200: + # Store result + sw $a2, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_194 + label_FALSE_193: + # LOCAL local_i2c_at_A2I_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -228($fp) + # GOTO label_END_195 +j label_END_195 +label_TRUE_194: + # LOCAL local_i2c_at_A2I_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -228($fp) + label_END_195: +# LOCAL local_i2c_at_A2I_internal_54 --> -220($fp) +# LOCAL local_i2c_at_A2I_internal_56 --> -228($fp) +# Obtain value from -228($fp) +lw $v0, -228($fp) +lw $v0, 12($v0) +sw $v0, -220($fp) +# IF_ZERO local_i2c_at_A2I_internal_54 GOTO label_FALSEIF_191 +# IF_ZERO local_i2c_at_A2I_internal_54 GOTO label_FALSEIF_191 +lw $t0, -220($fp) +beq $t0, 0, label_FALSEIF_191 +# LOCAL local_i2c_at_A2I_internal_59 --> -240($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_23 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -240($fp) +# LOCAL local_i2c_at_A2I_internal_55 --> -224($fp) +# LOCAL local_i2c_at_A2I_internal_59 --> -240($fp) +# local_i2c_at_A2I_internal_55 = local_i2c_at_A2I_internal_59 +lw $t0, -240($fp) +sw $t0, -224($fp) +# GOTO label_ENDIF_192 +j label_ENDIF_192 +label_FALSEIF_191: + # LOCAL local_i2c_at_A2I_internal_62 --> -252($fp) + # local_i2c_at_A2I_internal_62 = SELF + sw $s1, -252($fp) + # LOCAL local_i2c_at_A2I_internal_60 --> -244($fp) + # LOCAL local_i2c_at_A2I_internal_62 --> -252($fp) + # local_i2c_at_A2I_internal_60 = local_i2c_at_A2I_internal_62 + lw $t0, -252($fp) + sw $t0, -244($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2c_at_A2I_internal_60 --> -244($fp) + # LOCAL local_i2c_at_A2I_internal_61 --> -248($fp) + # local_i2c_at_A2I_internal_61 = VCALL local_i2c_at_A2I_internal_60 abort + # Save new self pointer in $s1 + lw $s1, -244($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 88($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -248($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2c_at_A2I_internal_63 --> -256($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_24 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -256($fp) + # LOCAL local_i2c_at_A2I_internal_55 --> -224($fp) + # LOCAL local_i2c_at_A2I_internal_63 --> -256($fp) + # local_i2c_at_A2I_internal_55 = local_i2c_at_A2I_internal_63 + lw $t0, -256($fp) + sw $t0, -224($fp) + label_ENDIF_192: +# LOCAL local_i2c_at_A2I_internal_49 --> -200($fp) +# LOCAL local_i2c_at_A2I_internal_55 --> -224($fp) +# local_i2c_at_A2I_internal_49 = local_i2c_at_A2I_internal_55 +lw $t0, -224($fp) +sw $t0, -200($fp) +label_ENDIF_182: +# LOCAL local_i2c_at_A2I_internal_43 --> -176($fp) +# LOCAL local_i2c_at_A2I_internal_49 --> -200($fp) +# local_i2c_at_A2I_internal_43 = local_i2c_at_A2I_internal_49 +lw $t0, -200($fp) +sw $t0, -176($fp) +label_ENDIF_172: +# LOCAL local_i2c_at_A2I_internal_37 --> -152($fp) +# LOCAL local_i2c_at_A2I_internal_43 --> -176($fp) +# local_i2c_at_A2I_internal_37 = local_i2c_at_A2I_internal_43 +lw $t0, -176($fp) +sw $t0, -152($fp) +label_ENDIF_162: +# LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) +# LOCAL local_i2c_at_A2I_internal_37 --> -152($fp) +# local_i2c_at_A2I_internal_31 = local_i2c_at_A2I_internal_37 +lw $t0, -152($fp) +sw $t0, -128($fp) +label_ENDIF_152: +# LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) +# LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) +# local_i2c_at_A2I_internal_25 = local_i2c_at_A2I_internal_31 +lw $t0, -128($fp) +sw $t0, -104($fp) +label_ENDIF_142: +# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) +# LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) +# local_i2c_at_A2I_internal_19 = local_i2c_at_A2I_internal_25 +lw $t0, -104($fp) +sw $t0, -80($fp) +label_ENDIF_132: +# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) +# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) +# local_i2c_at_A2I_internal_13 = local_i2c_at_A2I_internal_19 +lw $t0, -80($fp) +sw $t0, -56($fp) +label_ENDIF_122: +# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) +# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) +# local_i2c_at_A2I_internal_7 = local_i2c_at_A2I_internal_13 +lw $t0, -56($fp) +sw $t0, -32($fp) +label_ENDIF_112: +# LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) +# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) +# local_i2c_at_A2I_internal_1 = local_i2c_at_A2I_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +label_ENDIF_102: +# RETURN local_i2c_at_A2I_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_i2c_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 264 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_at_A2I implementation. +# @Params: +# 0($fp) = param_a2i_at_A2I_s_0 +function_a2i_at_A2I: + # Allocate stack frame for function function_a2i_at_A2I. + subu $sp, $sp, 208 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 208 + # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_4 = PARAM param_a2i_at_A2I_s_0 + lw $t0, 0($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # local_a2i_at_A2I_internal_5 = VCALL local_a2i_at_A2I_internal_4 length + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_FALSE_203 + # IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_FALSE_203 + lw $t0, -24($fp) + beq $t0, 0, label_FALSE_203 + # IF_ZERO local_a2i_at_A2I_internal_6 GOTO label_FALSE_203 + # IF_ZERO local_a2i_at_A2I_internal_6 GOTO label_FALSE_203 + lw $t0, -28($fp) + beq $t0, 0, label_FALSE_203 + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # Comparing -24($fp) type with String + la $v0, String + lw $a0, -24($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_206 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_206 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_206 + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # Comparing -24($fp) type with Bool + la $v0, Bool + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_207 + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # Comparing -24($fp) type with Int + la $v0, Int + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_207 + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + # Load pointers and SUB + lw $a0, -24($fp) + lw $a1, -28($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_204 + # GOTO label_FALSE_203 + j label_FALSE_203 + label_COMPARE_BY_VALUE_207: + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + lw $a0, -24($fp) + lw $a1, -28($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_204 + # GOTO label_FALSE_203 + j label_FALSE_203 + label_COMPARE_STRING_206: + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -28($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_CONTINUE_208 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_CONTINUE_208 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_208 + # GOTO label_FALSE_203 + j label_FALSE_203 + label_CONTINUE_208: + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -28($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_209: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_210 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_209 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_210: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_204 + label_FALSE_203: + # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_205 +j label_END_205 +label_TRUE_204: + # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_205: +# LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) +# LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSEIF_201 +# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSEIF_201 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_201 +# LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -32($fp) +# LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) +# LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) +# local_a2i_at_A2I_internal_1 = local_a2i_at_A2I_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_202 +j label_ENDIF_202 +label_FALSEIF_201: + # LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_12 = PARAM param_a2i_at_A2I_s_0 + lw $t0, 0($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # ARG local_a2i_at_A2I_internal_14 + # LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) + lw $t0, -60($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -64($fp) + # ARG local_a2i_at_A2I_internal_15 + # LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # local_a2i_at_A2I_internal_13 = VCALL local_a2i_at_A2I_internal_12 substr + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 100($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_25 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -68($fp) + # IF_ZERO local_a2i_at_A2I_internal_13 GOTO label_FALSE_213 + # IF_ZERO local_a2i_at_A2I_internal_13 GOTO label_FALSE_213 + lw $t0, -56($fp) + beq $t0, 0, label_FALSE_213 + # IF_ZERO local_a2i_at_A2I_internal_16 GOTO label_FALSE_213 + # IF_ZERO local_a2i_at_A2I_internal_16 GOTO label_FALSE_213 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_213 + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # Comparing -56($fp) type with String + la $v0, String + lw $a0, -56($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_STRING_216 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_STRING_216 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_STRING_216 + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # Comparing -56($fp) type with Bool + la $v0, Bool + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_217 + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # Comparing -56($fp) type with Int + la $v0, Int + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_217 + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, -56($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_214 + # GOTO label_FALSE_213 + j label_FALSE_213 + label_COMPARE_BY_VALUE_217: + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) + lw $a0, -56($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_214 + # GOTO label_FALSE_213 + j label_FALSE_213 + label_COMPARE_STRING_216: + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_CONTINUE_218 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_CONTINUE_218 + lw $t0, -48($fp) + beq $t0, 0, label_CONTINUE_218 + # GOTO label_FALSE_213 + j label_FALSE_213 + label_CONTINUE_218: + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_219: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_220 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_219 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_220: + # Store result + sw $a2, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_214 + label_FALSE_213: + # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -44($fp) + # GOTO label_END_215 +j label_END_215 +label_TRUE_214: + # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + label_END_215: +# LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) +# LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) +# Obtain value from -44($fp) +lw $v0, -44($fp) +lw $v0, 12($v0) +sw $v0, -36($fp) +# IF_ZERO local_a2i_at_A2I_internal_8 GOTO label_FALSEIF_211 +# IF_ZERO local_a2i_at_A2I_internal_8 GOTO label_FALSEIF_211 +lw $t0, -36($fp) +beq $t0, 0, label_FALSEIF_211 +# LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) +# local_a2i_at_A2I_internal_20 = SELF +sw $s1, -84($fp) +# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) +# LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) +# local_a2i_at_A2I_internal_18 = local_a2i_at_A2I_internal_20 +lw $t0, -84($fp) +sw $t0, -76($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_21 = PARAM param_a2i_at_A2I_s_0 +lw $t0, 0($fp) +sw $t0, -88($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -96($fp) +# ARG local_a2i_at_A2I_internal_23 +# LOCAL local_a2i_at_A2I_internal_23 --> -96($fp) +lw $t0, -96($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_25 --> -104($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_25 = PARAM param_a2i_at_A2I_s_0 +lw $t0, 0($fp) +sw $t0, -104($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_25 --> -104($fp) +# LOCAL local_a2i_at_A2I_internal_26 --> -108($fp) +# local_a2i_at_A2I_internal_26 = VCALL local_a2i_at_A2I_internal_25 length +# Save new self pointer in $s1 +lw $s1, -104($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 40($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -108($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_27 --> -112($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -112($fp) +# LOCAL local_a2i_at_A2I_internal_24 --> -100($fp) +# LOCAL local_a2i_at_A2I_internal_26 --> -108($fp) +# LOCAL local_a2i_at_A2I_internal_27 --> -112($fp) +# local_a2i_at_A2I_internal_24 = local_a2i_at_A2I_internal_26 - local_a2i_at_A2I_internal_27 +lw $t1, -108($fp) +lw $t0, 12($t1) +lw $t1, -112($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -100($fp) +# ARG local_a2i_at_A2I_internal_24 +# LOCAL local_a2i_at_A2I_internal_24 --> -100($fp) +lw $t0, -100($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) +# LOCAL local_a2i_at_A2I_internal_22 --> -92($fp) +# local_a2i_at_A2I_internal_22 = VCALL local_a2i_at_A2I_internal_21 substr +# Save new self pointer in $s1 +lw $s1, -88($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 100($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -92($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_at_A2I_internal_22 +# LOCAL local_a2i_at_A2I_internal_22 --> -92($fp) +lw $t0, -92($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) +# LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) +# local_a2i_at_A2I_internal_19 = VCALL local_a2i_at_A2I_internal_18 a2i_aux +# Save new self pointer in $s1 +lw $s1, -76($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 52($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -80($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) +lw $t0, -80($fp) +lw $t0, 12($t0) +not $t0, $t0 +add $t0, $t0, 1 +sw $t0, -72($fp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +lw $t0, -72($fp) +sw $t0, 12($v0) +sw $v0, -72($fp) +# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# local_a2i_at_A2I_internal_9 = local_a2i_at_A2I_internal_17 +lw $t0, -72($fp) +sw $t0, -40($fp) +# GOTO label_ENDIF_212 +j label_ENDIF_212 +label_FALSEIF_211: + # LOCAL local_a2i_at_A2I_internal_32 --> -132($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_32 = PARAM param_a2i_at_A2I_s_0 + lw $t0, 0($fp) + sw $t0, -132($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -140($fp) + # ARG local_a2i_at_A2I_internal_34 + # LOCAL local_a2i_at_A2I_internal_34 --> -140($fp) + lw $t0, -140($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_A2I_internal_35 --> -144($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -144($fp) + # ARG local_a2i_at_A2I_internal_35 + # LOCAL local_a2i_at_A2I_internal_35 --> -144($fp) + lw $t0, -144($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_A2I_internal_32 --> -132($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # local_a2i_at_A2I_internal_33 = VCALL local_a2i_at_A2I_internal_32 substr + # Save new self pointer in $s1 + lw $s1, -132($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 100($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -136($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_26 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -148($fp) + # IF_ZERO local_a2i_at_A2I_internal_33 GOTO label_FALSE_223 + # IF_ZERO local_a2i_at_A2I_internal_33 GOTO label_FALSE_223 + lw $t0, -136($fp) + beq $t0, 0, label_FALSE_223 + # IF_ZERO local_a2i_at_A2I_internal_36 GOTO label_FALSE_223 + # IF_ZERO local_a2i_at_A2I_internal_36 GOTO label_FALSE_223 + lw $t0, -148($fp) + beq $t0, 0, label_FALSE_223 + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # Comparing -136($fp) type with String + la $v0, String + lw $a0, -136($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_STRING_226 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_STRING_226 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_STRING_226 + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # Comparing -136($fp) type with Bool + la $v0, Bool + lw $a0, -136($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_227 + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # Comparing -136($fp) type with Int + la $v0, Int + lw $a0, -136($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_227 + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) + # Load pointers and SUB + lw $a0, -136($fp) + lw $a1, -148($fp) + sub $a0, $a0, $a1 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_224 + # GOTO label_FALSE_223 + j label_FALSE_223 + label_COMPARE_BY_VALUE_227: + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) + lw $a0, -136($fp) + lw $a1, -148($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_224 + # GOTO label_FALSE_223 + j label_FALSE_223 + label_COMPARE_STRING_226: + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) + # Load strings for comparison + lw $v0, -136($fp) + lw $v1, -148($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_CONTINUE_228 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_CONTINUE_228 + lw $t0, -128($fp) + beq $t0, 0, label_CONTINUE_228 + # GOTO label_FALSE_223 + j label_FALSE_223 + label_CONTINUE_228: + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -136($fp) + lw $v1, -148($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_229: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_230 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_229 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_230: + # Store result + sw $a2, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_224 + label_FALSE_223: + # LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -124($fp) + # GOTO label_END_225 +j label_END_225 +label_TRUE_224: + # LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -124($fp) + label_END_225: +# LOCAL local_a2i_at_A2I_internal_28 --> -116($fp) +# LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) +# Obtain value from -124($fp) +lw $v0, -124($fp) +lw $v0, 12($v0) +sw $v0, -116($fp) +# IF_ZERO local_a2i_at_A2I_internal_28 GOTO label_FALSEIF_221 +# IF_ZERO local_a2i_at_A2I_internal_28 GOTO label_FALSEIF_221 +lw $t0, -116($fp) +beq $t0, 0, label_FALSEIF_221 +# LOCAL local_a2i_at_A2I_internal_39 --> -160($fp) +# local_a2i_at_A2I_internal_39 = SELF +sw $s1, -160($fp) +# LOCAL local_a2i_at_A2I_internal_37 --> -152($fp) +# LOCAL local_a2i_at_A2I_internal_39 --> -160($fp) +# local_a2i_at_A2I_internal_37 = local_a2i_at_A2I_internal_39 +lw $t0, -160($fp) +sw $t0, -152($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_40 --> -164($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_40 = PARAM param_a2i_at_A2I_s_0 +lw $t0, 0($fp) +sw $t0, -164($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_42 --> -172($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -172($fp) +# ARG local_a2i_at_A2I_internal_42 +# LOCAL local_a2i_at_A2I_internal_42 --> -172($fp) +lw $t0, -172($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_44 --> -180($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_44 = PARAM param_a2i_at_A2I_s_0 +lw $t0, 0($fp) +sw $t0, -180($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_44 --> -180($fp) +# LOCAL local_a2i_at_A2I_internal_45 --> -184($fp) +# local_a2i_at_A2I_internal_45 = VCALL local_a2i_at_A2I_internal_44 length +# Save new self pointer in $s1 +lw $s1, -180($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 40($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -184($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_46 --> -188($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -188($fp) +# LOCAL local_a2i_at_A2I_internal_43 --> -176($fp) +# LOCAL local_a2i_at_A2I_internal_45 --> -184($fp) +# LOCAL local_a2i_at_A2I_internal_46 --> -188($fp) +# local_a2i_at_A2I_internal_43 = local_a2i_at_A2I_internal_45 - local_a2i_at_A2I_internal_46 +lw $t1, -184($fp) +lw $t0, 12($t1) +lw $t1, -188($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -176($fp) +# ARG local_a2i_at_A2I_internal_43 +# LOCAL local_a2i_at_A2I_internal_43 --> -176($fp) +lw $t0, -176($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_40 --> -164($fp) +# LOCAL local_a2i_at_A2I_internal_41 --> -168($fp) +# local_a2i_at_A2I_internal_41 = VCALL local_a2i_at_A2I_internal_40 substr +# Save new self pointer in $s1 +lw $s1, -164($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 100($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -168($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_at_A2I_internal_41 +# LOCAL local_a2i_at_A2I_internal_41 --> -168($fp) +lw $t0, -168($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_37 --> -152($fp) +# LOCAL local_a2i_at_A2I_internal_38 --> -156($fp) +# local_a2i_at_A2I_internal_38 = VCALL local_a2i_at_A2I_internal_37 a2i_aux +# Save new self pointer in $s1 +lw $s1, -152($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 52($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -156($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) +# LOCAL local_a2i_at_A2I_internal_38 --> -156($fp) +# local_a2i_at_A2I_internal_29 = local_a2i_at_A2I_internal_38 +lw $t0, -156($fp) +sw $t0, -120($fp) +# GOTO label_ENDIF_222 +j label_ENDIF_222 +label_FALSEIF_221: + # LOCAL local_a2i_at_A2I_internal_49 --> -200($fp) + # local_a2i_at_A2I_internal_49 = SELF + sw $s1, -200($fp) + # LOCAL local_a2i_at_A2I_internal_47 --> -192($fp) + # LOCAL local_a2i_at_A2I_internal_49 --> -200($fp) + # local_a2i_at_A2I_internal_47 = local_a2i_at_A2I_internal_49 + lw $t0, -200($fp) + sw $t0, -192($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_a2i_at_A2I_s_0 + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_A2I_internal_47 --> -192($fp) + # LOCAL local_a2i_at_A2I_internal_48 --> -196($fp) + # local_a2i_at_A2I_internal_48 = VCALL local_a2i_at_A2I_internal_47 a2i_aux + # Save new self pointer in $s1 + lw $s1, -192($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 52($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -196($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) + # LOCAL local_a2i_at_A2I_internal_48 --> -196($fp) + # local_a2i_at_A2I_internal_29 = local_a2i_at_A2I_internal_48 + lw $t0, -196($fp) + sw $t0, -120($fp) + label_ENDIF_222: +# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) +# LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) +# local_a2i_at_A2I_internal_9 = local_a2i_at_A2I_internal_29 +lw $t0, -120($fp) +sw $t0, -40($fp) +label_ENDIF_212: +# LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) +# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) +# local_a2i_at_A2I_internal_1 = local_a2i_at_A2I_internal_9 +lw $t0, -40($fp) +sw $t0, -8($fp) +label_ENDIF_202: +# RETURN local_a2i_at_A2I_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_a2i_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 208 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_aux_at_A2I implementation. +# @Params: +# 0($fp) = param_a2i_aux_at_A2I_s_0 +function_a2i_aux_at_A2I: + # Allocate stack frame for function function_a2i_aux_at_A2I. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_a2i_aux_at_A2I_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) + # LOCAL local_a2i_aux_at_A2I_internal_1 --> -8($fp) + # local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_a2i_aux_at_A2I_j_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) + # local_a2i_aux_at_A2I_internal_3 = PARAM param_a2i_aux_at_A2I_s_0 + lw $t0, 0($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_aux_at_A2I_internal_4 --> -20($fp) + # local_a2i_aux_at_A2I_internal_4 = VCALL local_a2i_aux_at_A2I_internal_3 length + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_aux_at_A2I_j_2 --> -12($fp) + # LOCAL local_a2i_aux_at_A2I_internal_4 --> -20($fp) + # local_a2i_aux_at_A2I_j_2 = local_a2i_aux_at_A2I_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) + # local_a2i_aux_at_A2I_i_5 = local_a2i_aux_at_A2I_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + label_WHILE_231: + # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) + # LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_A2I_j_2 --> -12($fp) + lw $a0, -24($fp) + lw $a1, -12($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -36($fp) + # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 + # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 + lw $t0, -36($fp) + bgt $t0, 0, label_FALSE_233 + # IF_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 + # IF_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 + lw $t0, -36($fp) + beq $t0, 0, label_FALSE_233 + # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_234 +j label_END_234 +label_FALSE_233: + # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_234: +# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) +# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_a2i_aux_at_A2I_internal_7 GOTO label_WHILE_END_232 +# IF_ZERO local_a2i_aux_at_A2I_internal_7 GOTO label_WHILE_END_232 +lw $t0, -32($fp) +beq $t0, 0, label_WHILE_END_232 +# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 10 +sw $t0, 12($v0) +sw $v0, -48($fp) +# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) +# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) +# local_a2i_aux_at_A2I_internal_10 = local_a2i_aux_at_A2I_int_0 * local_a2i_aux_at_A2I_internal_11 +lw $t1, -4($fp) +lw $t0, 12($t1) +lw $t1, -48($fp) +lw $t2, 12($t1) +mul $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -44($fp) +# LOCAL local_a2i_aux_at_A2I_internal_14 --> -60($fp) +# local_a2i_aux_at_A2I_internal_14 = SELF +sw $s1, -60($fp) +# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) +# LOCAL local_a2i_aux_at_A2I_internal_14 --> -60($fp) +# local_a2i_aux_at_A2I_internal_12 = local_a2i_aux_at_A2I_internal_14 +lw $t0, -60($fp) +sw $t0, -52($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_15 --> -64($fp) +# PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) +# local_a2i_aux_at_A2I_internal_15 = PARAM param_a2i_aux_at_A2I_s_0 +lw $t0, 0($fp) +sw $t0, -64($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_a2i_aux_at_A2I_i_5 +# LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) +lw $t0, -24($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -72($fp) +# ARG local_a2i_aux_at_A2I_internal_17 +# LOCAL local_a2i_aux_at_A2I_internal_17 --> -72($fp) +lw $t0, -72($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_15 --> -64($fp) +# LOCAL local_a2i_aux_at_A2I_internal_16 --> -68($fp) +# local_a2i_aux_at_A2I_internal_16 = VCALL local_a2i_aux_at_A2I_internal_15 substr +# Save new self pointer in $s1 +lw $s1, -64($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 100($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -68($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_aux_at_A2I_internal_16 +# LOCAL local_a2i_aux_at_A2I_internal_16 --> -68($fp) +lw $t0, -68($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) +# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) +# local_a2i_aux_at_A2I_internal_13 = VCALL local_a2i_aux_at_A2I_internal_12 c2i +# Save new self pointer in $s1 +lw $s1, -52($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 76($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -56($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) +# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) +# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) +# local_a2i_aux_at_A2I_internal_9 = local_a2i_aux_at_A2I_internal_10 + local_a2i_aux_at_A2I_internal_13 +lw $t1, -44($fp) +lw $t0, 12($t1) +lw $t1, -56($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -40($fp) +# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) +# local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_9 +lw $t0, -40($fp) +sw $t0, -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_19 --> -80($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -80($fp) +# LOCAL local_a2i_aux_at_A2I_internal_18 --> -76($fp) +# LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) +# LOCAL local_a2i_aux_at_A2I_internal_19 --> -80($fp) +# local_a2i_aux_at_A2I_internal_18 = local_a2i_aux_at_A2I_i_5 + local_a2i_aux_at_A2I_internal_19 +lw $t1, -24($fp) +lw $t0, 12($t1) +lw $t1, -80($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -76($fp) +# LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) +# LOCAL local_a2i_aux_at_A2I_internal_18 --> -76($fp) +# local_a2i_aux_at_A2I_i_5 = local_a2i_aux_at_A2I_internal_18 +lw $t0, -76($fp) +sw $t0, -24($fp) +# GOTO label_WHILE_231 +j label_WHILE_231 +label_WHILE_END_232: + # RETURN local_a2i_aux_at_A2I_int_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_a2i_aux_at_A2I. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 88 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_i2a_at_A2I implementation. +# @Params: +# 0($fp) = param_i2a_at_A2I_i_0 +function_i2a_at_A2I: + # Allocate stack frame for function function_i2a_at_A2I. + subu $sp, $sp, 96 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 96 + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # IF_ZERO param_i2a_at_A2I_i_0 GOTO label_FALSE_237 + # IF_ZERO param_i2a_at_A2I_i_0 GOTO label_FALSE_237 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_237 + # IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_237 + # IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_237 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_237 + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_STRING_240 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_STRING_240 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_240 + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_241 + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_241 + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_238 + # GOTO label_FALSE_237 + j label_FALSE_237 + label_COMPARE_BY_VALUE_241: + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_238 + # GOTO label_FALSE_237 + j label_FALSE_237 + label_COMPARE_STRING_240: + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_CONTINUE_242 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_CONTINUE_242 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_242 + # GOTO label_FALSE_237 + j label_FALSE_237 + label_CONTINUE_242: + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_243: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_244 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_243 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_244: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_238 + label_FALSE_237: + # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_239 +j label_END_239 +label_TRUE_238: + # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_239: +# LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSEIF_235 +# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSEIF_235 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_235 +# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_27 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -24($fp) +# LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) +# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) +# local_i2a_at_A2I_internal_1 = local_i2a_at_A2I_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_236 +j label_ENDIF_236 +label_FALSEIF_235: + # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -40($fp) + # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) + # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + lw $a0, -40($fp) + lw $a1, 0($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -36($fp) + # IF_GREATER_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 + # IF_GREATER_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 + lw $t0, -36($fp) + bgt $t0, 0, label_FALSE_247 + # IF_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 + # IF_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 + lw $t0, -36($fp) + beq $t0, 0, label_FALSE_247 + # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_248 +j label_END_248 +label_FALSE_247: + # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_248: +# LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) +# LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_i2a_at_A2I_internal_6 GOTO label_FALSEIF_245 +# IF_ZERO local_i2a_at_A2I_internal_6 GOTO label_FALSEIF_245 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_245 +# LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) +# local_i2a_at_A2I_internal_12 = SELF +sw $s1, -52($fp) +# LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) +# LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) +# local_i2a_at_A2I_internal_10 = local_i2a_at_A2I_internal_12 +lw $t0, -52($fp) +sw $t0, -44($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_i2a_at_A2I_i_0 +# PARAM param_i2a_at_A2I_i_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) +# LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) +# local_i2a_at_A2I_internal_11 = VCALL local_i2a_at_A2I_internal_10 i2a_aux +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 64($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) +# LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) +# local_i2a_at_A2I_internal_7 = local_i2a_at_A2I_internal_11 +lw $t0, -48($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_246 +j label_ENDIF_246 +label_FALSEIF_245: + # LOCAL local_i2a_at_A2I_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_28 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -64($fp) + # LOCAL local_i2a_at_A2I_internal_13 --> -56($fp) + # LOCAL local_i2a_at_A2I_internal_15 --> -64($fp) + # local_i2a_at_A2I_internal_13 = local_i2a_at_A2I_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_18 --> -76($fp) + # local_i2a_at_A2I_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_i2a_at_A2I_internal_16 --> -68($fp) + # LOCAL local_i2a_at_A2I_internal_18 --> -76($fp) + # local_i2a_at_A2I_internal_16 = local_i2a_at_A2I_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_21 --> -88($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -88($fp) + # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) + # LOCAL local_i2a_at_A2I_internal_21 --> -88($fp) + lw $t0, -88($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -84($fp) + # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) + # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -84($fp) + sw $t0, 12($v0) + sw $v0, -84($fp) + # LOCAL local_i2a_at_A2I_internal_19 --> -80($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) + # local_i2a_at_A2I_internal_19 = PARAM param_i2a_at_A2I_i_0 * local_i2a_at_A2I_internal_20 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -84($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -80($fp) + # ARG local_i2a_at_A2I_internal_19 + # LOCAL local_i2a_at_A2I_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_i2a_at_A2I_internal_16 --> -68($fp) + # LOCAL local_i2a_at_A2I_internal_17 --> -72($fp) + # local_i2a_at_A2I_internal_17 = VCALL local_i2a_at_A2I_internal_16 i2a_aux + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 64($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_i2a_at_A2I_internal_17 + # LOCAL local_i2a_at_A2I_internal_17 --> -72($fp) + lw $t0, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_i2a_at_A2I_internal_13 --> -56($fp) + # LOCAL local_i2a_at_A2I_internal_14 --> -60($fp) + # local_i2a_at_A2I_internal_14 = VCALL local_i2a_at_A2I_internal_13 concat + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 92($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) + # LOCAL local_i2a_at_A2I_internal_14 --> -60($fp) + # local_i2a_at_A2I_internal_7 = local_i2a_at_A2I_internal_14 + lw $t0, -60($fp) + sw $t0, -32($fp) + label_ENDIF_246: +# LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) +# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) +# local_i2a_at_A2I_internal_1 = local_i2a_at_A2I_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +label_ENDIF_236: +# RETURN local_i2a_at_A2I_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_i2a_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 96 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_i2a_aux_at_A2I implementation. +# @Params: +# 0($fp) = param_i2a_aux_at_A2I_i_0 +function_i2a_aux_at_A2I: + # Allocate stack frame for function function_i2a_aux_at_A2I. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # IF_ZERO param_i2a_aux_at_A2I_i_0 GOTO label_FALSE_251 + # IF_ZERO param_i2a_aux_at_A2I_i_0 GOTO label_FALSE_251 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_251 + # IF_ZERO local_i2a_aux_at_A2I_internal_4 GOTO label_FALSE_251 + # IF_ZERO local_i2a_aux_at_A2I_internal_4 GOTO label_FALSE_251 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_251 + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_STRING_254 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_STRING_254 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_254 + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_255 + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_255 + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_252 + # GOTO label_FALSE_251 + j label_FALSE_251 + label_COMPARE_BY_VALUE_255: + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_252 + # GOTO label_FALSE_251 + j label_FALSE_251 + label_COMPARE_STRING_254: + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_CONTINUE_256 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_CONTINUE_256 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_256 + # GOTO label_FALSE_251 + j label_FALSE_251 + label_CONTINUE_256: + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_257: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_258 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_257 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_258: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_252 + label_FALSE_251: + # LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_253 +j label_END_253 +label_TRUE_252: + # LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_253: +# LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSEIF_249 +# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSEIF_249 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_249 +# LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_29 +sw $t0, 12($v0) +li $t0, 0 +sw $t0, 16($v0) +sw $v0, -24($fp) +# LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) +# LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) +# local_i2a_aux_at_A2I_internal_1 = local_i2a_aux_at_A2I_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_250 +j label_ENDIF_250 +label_FALSEIF_249: + # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 10 + sw $t0, 12($v0) + sw $v0, -36($fp) + # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) + # local_i2a_aux_at_A2I_internal_7 = PARAM param_i2a_aux_at_A2I_i_0 / local_i2a_aux_at_A2I_internal_8 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -36($fp) + lw $t2, 12($t1) + div $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -32($fp) + # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) + # local_i2a_aux_at_A2I_next_6 = local_i2a_aux_at_A2I_internal_7 + lw $t0, -32($fp) + sw $t0, -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) + # local_i2a_aux_at_A2I_internal_13 = SELF + sw $s1, -56($fp) + # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) + # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) + # local_i2a_aux_at_A2I_internal_11 = local_i2a_aux_at_A2I_internal_13 + lw $t0, -56($fp) + sw $t0, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_i2a_aux_at_A2I_next_6 + # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) + lw $t0, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) + # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) + # local_i2a_aux_at_A2I_internal_12 = VCALL local_i2a_aux_at_A2I_internal_11 i2a_aux + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 64($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) + # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) + # local_i2a_aux_at_A2I_internal_9 = local_i2a_aux_at_A2I_internal_12 + lw $t0, -52($fp) + sw $t0, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_16 --> -68($fp) + # local_i2a_aux_at_A2I_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_i2a_aux_at_A2I_internal_14 --> -60($fp) + # LOCAL local_i2a_aux_at_A2I_internal_16 --> -68($fp) + # local_i2a_aux_at_A2I_internal_14 = local_i2a_aux_at_A2I_internal_16 + lw $t0, -68($fp) + sw $t0, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 10 + sw $t0, 12($v0) + sw $v0, -80($fp) + # LOCAL local_i2a_aux_at_A2I_internal_18 --> -76($fp) + # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_19 --> -80($fp) + # local_i2a_aux_at_A2I_internal_18 = local_i2a_aux_at_A2I_next_6 * local_i2a_aux_at_A2I_internal_19 + lw $t1, -28($fp) + lw $t0, 12($t1) + lw $t1, -80($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -76($fp) + # LOCAL local_i2a_aux_at_A2I_internal_17 --> -72($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_18 --> -76($fp) + # local_i2a_aux_at_A2I_internal_17 = PARAM param_i2a_aux_at_A2I_i_0 - local_i2a_aux_at_A2I_internal_18 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -76($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -72($fp) + # ARG local_i2a_aux_at_A2I_internal_17 + # LOCAL local_i2a_aux_at_A2I_internal_17 --> -72($fp) + lw $t0, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_14 --> -60($fp) + # LOCAL local_i2a_aux_at_A2I_internal_15 --> -64($fp) + # local_i2a_aux_at_A2I_internal_15 = VCALL local_i2a_aux_at_A2I_internal_14 i2c + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_i2a_aux_at_A2I_internal_15 + # LOCAL local_i2a_aux_at_A2I_internal_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) + # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) + # local_i2a_aux_at_A2I_internal_10 = VCALL local_i2a_aux_at_A2I_internal_9 concat + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 92($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) + # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) + # local_i2a_aux_at_A2I_internal_1 = local_i2a_aux_at_A2I_internal_10 + lw $t0, -44($fp) + sw $t0, -8($fp) + label_ENDIF_250: +# RETURN local_i2a_aux_at_A2I_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_i2a_aux_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# __A__attrib__var__init implementation. +# @Params: +__A__attrib__var__init: + # Allocate stack frame for function __A__attrib__var__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ib__var__init_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_ib__var__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __A__attrib__var__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_value_at_A implementation. +# @Params: +function_value_at_A: + # Allocate stack frame for function function_value_at_A. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_value_at_A_internal_0 = GETATTRIBUTE var A + # LOCAL local_value_at_A_internal_0 --> -4($fp) + lw $t0, 12($s1) + sw $t0, -4($fp) + # RETURN local_value_at_A_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_value_at_A. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_set_var_at_A implementation. +# @Params: +# 0($fp) = param_set_var_at_A_num_0 +function_set_var_at_A: + # Allocate stack frame for function function_set_var_at_A. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_set_var_at_A_num_0 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 12($s1) + # LOCAL local_set_var_at_A_internal_0 --> -4($fp) + # local_set_var_at_A_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_set_var_at_A_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_set_var_at_A. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_method1_at_A implementation. +# @Params: +# 0($fp) = param_method1_at_A_num_0 +function_method1_at_A: + # Allocate stack frame for function function_method1_at_A. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_method1_at_A_internal_0 --> -4($fp) + # local_method1_at_A_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_method1_at_A_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_method1_at_A. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_method2_at_A implementation. +# @Params: +# 0($fp) = param_method2_at_A_num1_0 +# 4($fp) = param_method2_at_A_num2_1 +function_method2_at_A: + # Allocate stack frame for function function_method2_at_A. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_method2_at_A_x_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_method2_at_A_internal_1 --> -8($fp) + # PARAM param_method2_at_A_num1_0 --> 4($fp) + # PARAM param_method2_at_A_num2_1 --> 0($fp) + # local_method2_at_A_internal_1 = PARAM param_method2_at_A_num1_0 + PARAM param_method2_at_A_num2_1 + lw $t1, 4($fp) + lw $t0, 12($t1) + lw $t1, 0($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_method2_at_A_x_0 --> -4($fp) + # LOCAL local_method2_at_A_internal_1 --> -8($fp) + # local_method2_at_A_x_0 = local_method2_at_A_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_method2_at_A_internal_4 --> -20($fp) + # local_method2_at_A_internal_4 = ALLOCATE B + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, B + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, B_start + sw $t0, 4($v0) + # Load type offset + li $t0, 28 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -20($fp) + # LOCAL local_method2_at_A_internal_2 --> -12($fp) + # LOCAL local_method2_at_A_internal_4 --> -20($fp) + # local_method2_at_A_internal_2 = local_method2_at_A_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_method2_at_A_x_0 + # LOCAL local_method2_at_A_x_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_method2_at_A_internal_2 --> -12($fp) + # LOCAL local_method2_at_A_internal_3 --> -16($fp) + # local_method2_at_A_internal_3 = VCALL local_method2_at_A_internal_2 set_var + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 116($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_method2_at_A_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_method2_at_A. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_method3_at_A implementation. +# @Params: +# 0($fp) = param_method3_at_A_num_0 +function_method3_at_A: + # Allocate stack frame for function function_method3_at_A. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_method3_at_A_x_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_method3_at_A_internal_1 --> -8($fp) + # PARAM param_method3_at_A_num_0 --> 0($fp) + lw $t0, 0($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -8($fp) + # LOCAL local_method3_at_A_internal_1 --> -8($fp) + # LOCAL local_method3_at_A_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -8($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_method3_at_A_x_0 --> -4($fp) + # LOCAL local_method3_at_A_internal_1 --> -8($fp) + # local_method3_at_A_x_0 = local_method3_at_A_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_method3_at_A_internal_4 --> -20($fp) + # local_method3_at_A_internal_4 = ALLOCATE C + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, C + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, C_start + sw $t0, 4($v0) + # Load type offset + li $t0, 40 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -20($fp) + # LOCAL local_method3_at_A_internal_2 --> -12($fp) + # LOCAL local_method3_at_A_internal_4 --> -20($fp) + # local_method3_at_A_internal_2 = local_method3_at_A_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_method3_at_A_x_0 + # LOCAL local_method3_at_A_x_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_method3_at_A_internal_2 --> -12($fp) + # LOCAL local_method3_at_A_internal_3 --> -16($fp) + # local_method3_at_A_internal_3 = VCALL local_method3_at_A_internal_2 set_var + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 116($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_method3_at_A_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_method3_at_A. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_method4_at_A implementation. +# @Params: +# 0($fp) = param_method4_at_A_num1_0 +# 4($fp) = param_method4_at_A_num2_1 +function_method4_at_A: + # Allocate stack frame for function function_method4_at_A. + subu $sp, $sp, 60 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 60 + # LOCAL local_method4_at_A_internal_2 --> -12($fp) + # PARAM param_method4_at_A_num2_1 --> 0($fp) + # PARAM param_method4_at_A_num1_0 --> 4($fp) + lw $a0, 0($fp) + lw $a1, 4($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -12($fp) + # IF_GREATER_ZERO local_method4_at_A_internal_2 GOTO label_FALSE_261 + # IF_GREATER_ZERO local_method4_at_A_internal_2 GOTO label_FALSE_261 + lw $t0, -12($fp) + bgt $t0, 0, label_FALSE_261 + # IF_ZERO local_method4_at_A_internal_2 GOTO label_FALSE_261 + # IF_ZERO local_method4_at_A_internal_2 GOTO label_FALSE_261 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_261 + # LOCAL local_method4_at_A_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_262 +j label_END_262 +label_FALSE_261: + # LOCAL local_method4_at_A_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_262: +# LOCAL local_method4_at_A_internal_0 --> -4($fp) +# LOCAL local_method4_at_A_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_method4_at_A_internal_0 GOTO label_FALSEIF_259 +# IF_ZERO local_method4_at_A_internal_0 GOTO label_FALSEIF_259 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_259 +# LOCAL local_method4_at_A_x_3 --> -16($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -16($fp) +# LOCAL local_method4_at_A_internal_4 --> -20($fp) +# PARAM param_method4_at_A_num1_0 --> 4($fp) +# PARAM param_method4_at_A_num2_1 --> 0($fp) +# local_method4_at_A_internal_4 = PARAM param_method4_at_A_num1_0 - PARAM param_method4_at_A_num2_1 +lw $t1, 4($fp) +lw $t0, 12($t1) +lw $t1, 0($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -20($fp) +# LOCAL local_method4_at_A_x_3 --> -16($fp) +# LOCAL local_method4_at_A_internal_4 --> -20($fp) +# local_method4_at_A_x_3 = local_method4_at_A_internal_4 +lw $t0, -20($fp) +sw $t0, -16($fp) +# LOCAL local_method4_at_A_internal_7 --> -32($fp) +# local_method4_at_A_internal_7 = ALLOCATE D +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, D +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, D_start +sw $t0, 4($v0) +# Load type offset +li $t0, 32 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -32($fp) +# LOCAL local_method4_at_A_internal_5 --> -24($fp) +# LOCAL local_method4_at_A_internal_7 --> -32($fp) +# local_method4_at_A_internal_5 = local_method4_at_A_internal_7 +lw $t0, -32($fp) +sw $t0, -24($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_method4_at_A_x_3 +# LOCAL local_method4_at_A_x_3 --> -16($fp) +lw $t0, -16($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_method4_at_A_internal_5 --> -24($fp) +# LOCAL local_method4_at_A_internal_6 --> -28($fp) +# local_method4_at_A_internal_6 = VCALL local_method4_at_A_internal_5 set_var +# Save new self pointer in $s1 +lw $s1, -24($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 116($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -28($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_method4_at_A_internal_1 --> -8($fp) +# LOCAL local_method4_at_A_internal_6 --> -28($fp) +# local_method4_at_A_internal_1 = local_method4_at_A_internal_6 +lw $t0, -28($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_260 +j label_ENDIF_260 +label_FALSEIF_259: + # LOCAL local_method4_at_A_x_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # LOCAL local_method4_at_A_internal_9 --> -40($fp) + # PARAM param_method4_at_A_num2_1 --> 0($fp) + # PARAM param_method4_at_A_num1_0 --> 4($fp) + # local_method4_at_A_internal_9 = PARAM param_method4_at_A_num2_1 - PARAM param_method4_at_A_num1_0 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, 4($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -40($fp) + # LOCAL local_method4_at_A_x_8 --> -36($fp) + # LOCAL local_method4_at_A_internal_9 --> -40($fp) + # local_method4_at_A_x_8 = local_method4_at_A_internal_9 + lw $t0, -40($fp) + sw $t0, -36($fp) + # LOCAL local_method4_at_A_internal_12 --> -52($fp) + # local_method4_at_A_internal_12 = ALLOCATE D + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, D + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, D_start + sw $t0, 4($v0) + # Load type offset + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -52($fp) + # LOCAL local_method4_at_A_internal_10 --> -44($fp) + # LOCAL local_method4_at_A_internal_12 --> -52($fp) + # local_method4_at_A_internal_10 = local_method4_at_A_internal_12 + lw $t0, -52($fp) + sw $t0, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_method4_at_A_x_8 + # LOCAL local_method4_at_A_x_8 --> -36($fp) + lw $t0, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_method4_at_A_internal_10 --> -44($fp) + # LOCAL local_method4_at_A_internal_11 --> -48($fp) + # local_method4_at_A_internal_11 = VCALL local_method4_at_A_internal_10 set_var + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 116($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_method4_at_A_internal_1 --> -8($fp) + # LOCAL local_method4_at_A_internal_11 --> -48($fp) + # local_method4_at_A_internal_1 = local_method4_at_A_internal_11 + lw $t0, -48($fp) + sw $t0, -8($fp) + label_ENDIF_260: +# RETURN local_method4_at_A_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_method4_at_A. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 60 +# Deallocate function args +addu $sp, $sp, 8 +jr $ra +# Function END + + +# function_method5_at_A implementation. +# @Params: +# 0($fp) = param_method5_at_A_num_0 +function_method5_at_A: + # Allocate stack frame for function function_method5_at_A. + subu $sp, $sp, 56 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 56 + # LOCAL local_method5_at_A_x_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_method5_at_A_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_method5_at_A_x_0 --> -4($fp) + # LOCAL local_method5_at_A_internal_1 --> -8($fp) + # local_method5_at_A_x_0 = local_method5_at_A_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_method5_at_A_y_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_method5_at_A_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -16($fp) + # LOCAL local_method5_at_A_y_2 --> -12($fp) + # LOCAL local_method5_at_A_internal_3 --> -16($fp) + # local_method5_at_A_y_2 = local_method5_at_A_internal_3 + lw $t0, -16($fp) + sw $t0, -12($fp) + label_WHILE_263: + # LOCAL local_method5_at_A_internal_5 --> -24($fp) + # LOCAL local_method5_at_A_y_2 --> -12($fp) + # PARAM param_method5_at_A_num_0 --> 0($fp) + lw $a0, -12($fp) + lw $a1, 0($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -24($fp) + # IF_GREATER_ZERO local_method5_at_A_internal_5 GOTO label_FALSE_265 + # IF_GREATER_ZERO local_method5_at_A_internal_5 GOTO label_FALSE_265 + lw $t0, -24($fp) + bgt $t0, 0, label_FALSE_265 + # LOCAL local_method5_at_A_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -24($fp) + # GOTO label_END_266 +j label_END_266 +label_FALSE_265: + # LOCAL local_method5_at_A_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + label_END_266: +# LOCAL local_method5_at_A_internal_4 --> -20($fp) +# LOCAL local_method5_at_A_internal_5 --> -24($fp) +# Obtain value from -24($fp) +lw $v0, -24($fp) +lw $v0, 12($v0) +sw $v0, -20($fp) +# IF_ZERO local_method5_at_A_internal_4 GOTO label_WHILE_END_264 +# IF_ZERO local_method5_at_A_internal_4 GOTO label_WHILE_END_264 +lw $t0, -20($fp) +beq $t0, 0, label_WHILE_END_264 +# LOCAL local_method5_at_A_internal_6 --> -28($fp) +# LOCAL local_method5_at_A_x_0 --> -4($fp) +# LOCAL local_method5_at_A_y_2 --> -12($fp) +# local_method5_at_A_internal_6 = local_method5_at_A_x_0 * local_method5_at_A_y_2 +lw $t1, -4($fp) +lw $t0, 12($t1) +lw $t1, -12($fp) +lw $t2, 12($t1) +mul $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -28($fp) +# LOCAL local_method5_at_A_x_0 --> -4($fp) +# LOCAL local_method5_at_A_internal_6 --> -28($fp) +# local_method5_at_A_x_0 = local_method5_at_A_internal_6 +lw $t0, -28($fp) +sw $t0, -4($fp) +# LOCAL local_method5_at_A_internal_8 --> -36($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -36($fp) +# LOCAL local_method5_at_A_internal_7 --> -32($fp) +# LOCAL local_method5_at_A_y_2 --> -12($fp) +# LOCAL local_method5_at_A_internal_8 --> -36($fp) +# local_method5_at_A_internal_7 = local_method5_at_A_y_2 + local_method5_at_A_internal_8 +lw $t1, -12($fp) +lw $t0, 12($t1) +lw $t1, -36($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -32($fp) +# LOCAL local_method5_at_A_y_2 --> -12($fp) +# LOCAL local_method5_at_A_internal_7 --> -32($fp) +# local_method5_at_A_y_2 = local_method5_at_A_internal_7 +lw $t0, -32($fp) +sw $t0, -12($fp) +# GOTO label_WHILE_263 +j label_WHILE_263 +label_WHILE_END_264: + # LOCAL local_method5_at_A_internal_11 --> -48($fp) + # local_method5_at_A_internal_11 = ALLOCATE E + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, E + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, E_start + sw $t0, 4($v0) + # Load type offset + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -48($fp) + # LOCAL local_method5_at_A_internal_9 --> -40($fp) + # LOCAL local_method5_at_A_internal_11 --> -48($fp) + # local_method5_at_A_internal_9 = local_method5_at_A_internal_11 + lw $t0, -48($fp) + sw $t0, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_method5_at_A_x_0 + # LOCAL local_method5_at_A_x_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_method5_at_A_internal_9 --> -40($fp) + # LOCAL local_method5_at_A_internal_10 --> -44($fp) + # local_method5_at_A_internal_10 = VCALL local_method5_at_A_internal_9 set_var + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 116($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_method5_at_A_internal_10 + lw $v0, -44($fp) + # Deallocate stack frame for function function_method5_at_A. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 56 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_method5_at_B implementation. +# @Params: +# 0($fp) = param_method5_at_B_num_0 +function_method5_at_B: + # Allocate stack frame for function function_method5_at_B. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_method5_at_B_x_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_method5_at_B_internal_1 --> -8($fp) + # PARAM param_method5_at_B_num_0 --> 0($fp) + # PARAM param_method5_at_B_num_0 --> 0($fp) + # local_method5_at_B_internal_1 = PARAM param_method5_at_B_num_0 * PARAM param_method5_at_B_num_0 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, 0($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_method5_at_B_x_0 --> -4($fp) + # LOCAL local_method5_at_B_internal_1 --> -8($fp) + # local_method5_at_B_x_0 = local_method5_at_B_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_method5_at_B_internal_4 --> -20($fp) + # local_method5_at_B_internal_4 = ALLOCATE E + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, E + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, E_start + sw $t0, 4($v0) + # Load type offset + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -20($fp) + # LOCAL local_method5_at_B_internal_2 --> -12($fp) + # LOCAL local_method5_at_B_internal_4 --> -20($fp) + # local_method5_at_B_internal_2 = local_method5_at_B_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_method5_at_B_x_0 + # LOCAL local_method5_at_B_x_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_method5_at_B_internal_2 --> -12($fp) + # LOCAL local_method5_at_B_internal_3 --> -16($fp) + # local_method5_at_B_internal_3 = VCALL local_method5_at_B_internal_2 set_var + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 116($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_method5_at_B_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_method5_at_B. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_method7_at_D implementation. +# @Params: +# 0($fp) = param_method7_at_D_num_0 +function_method7_at_D: + # Allocate stack frame for function function_method7_at_D. + subu $sp, $sp, 136 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 136 + # LOCAL local_method7_at_D_x_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + # PARAM param_method7_at_D_num_0 --> 0($fp) + # local_method7_at_D_x_0 = PARAM param_method7_at_D_num_0 + lw $t0, 0($fp) + sw $t0, -4($fp) + # LOCAL local_method7_at_D_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # LOCAL local_method7_at_D_internal_3 --> -16($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + # LOCAL local_method7_at_D_internal_4 --> -20($fp) + lw $a0, -4($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_GREATER_ZERO local_method7_at_D_internal_3 GOTO label_FALSE_269 + # IF_GREATER_ZERO local_method7_at_D_internal_3 GOTO label_FALSE_269 + lw $t0, -16($fp) + bgt $t0, 0, label_FALSE_269 + # IF_ZERO local_method7_at_D_internal_3 GOTO label_FALSE_269 + # IF_ZERO local_method7_at_D_internal_3 GOTO label_FALSE_269 + lw $t0, -16($fp) + beq $t0, 0, label_FALSE_269 + # LOCAL local_method7_at_D_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -16($fp) + # GOTO label_END_270 +j label_END_270 +label_FALSE_269: + # LOCAL local_method7_at_D_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -16($fp) + label_END_270: +# LOCAL local_method7_at_D_internal_1 --> -8($fp) +# LOCAL local_method7_at_D_internal_3 --> -16($fp) +# Obtain value from -16($fp) +lw $v0, -16($fp) +lw $v0, 12($v0) +sw $v0, -8($fp) +# IF_ZERO local_method7_at_D_internal_1 GOTO label_FALSEIF_267 +# IF_ZERO local_method7_at_D_internal_1 GOTO label_FALSEIF_267 +lw $t0, -8($fp) +beq $t0, 0, label_FALSEIF_267 +# LOCAL local_method7_at_D_internal_7 --> -32($fp) +# local_method7_at_D_internal_7 = SELF +sw $s1, -32($fp) +# LOCAL local_method7_at_D_internal_5 --> -24($fp) +# LOCAL local_method7_at_D_internal_7 --> -32($fp) +# local_method7_at_D_internal_5 = local_method7_at_D_internal_7 +lw $t0, -32($fp) +sw $t0, -24($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_method7_at_D_internal_8 --> -36($fp) +# LOCAL local_method7_at_D_x_0 --> -4($fp) +lw $t0, -4($fp) +lw $t0, 12($t0) +not $t0, $t0 +add $t0, $t0, 1 +sw $t0, -36($fp) +# LOCAL local_method7_at_D_internal_8 --> -36($fp) +# LOCAL local_method7_at_D_internal_8 --> -36($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +lw $t0, -36($fp) +sw $t0, 12($v0) +sw $v0, -36($fp) +# ARG local_method7_at_D_internal_8 +# LOCAL local_method7_at_D_internal_8 --> -36($fp) +lw $t0, -36($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_method7_at_D_internal_5 --> -24($fp) +# LOCAL local_method7_at_D_internal_6 --> -28($fp) +# local_method7_at_D_internal_6 = VCALL local_method7_at_D_internal_5 method7 +# Save new self pointer in $s1 +lw $s1, -24($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 36($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -28($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_method7_at_D_internal_2 --> -12($fp) +# LOCAL local_method7_at_D_internal_6 --> -28($fp) +# local_method7_at_D_internal_2 = local_method7_at_D_internal_6 +lw $t0, -28($fp) +sw $t0, -12($fp) +# GOTO label_ENDIF_268 +j label_ENDIF_268 +label_FALSEIF_267: + # LOCAL local_method7_at_D_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -56($fp) + # IF_ZERO local_method7_at_D_internal_13 GOTO label_FALSE_273 + # IF_ZERO local_method7_at_D_internal_13 GOTO label_FALSE_273 + lw $t0, -56($fp) + beq $t0, 0, label_FALSE_273 + # IF_ZERO local_method7_at_D_x_0 GOTO label_FALSE_273 + # IF_ZERO local_method7_at_D_x_0 GOTO label_FALSE_273 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_273 + # LOCAL local_method7_at_D_internal_12 --> -52($fp) + # LOCAL local_method7_at_D_internal_13 --> -56($fp) + # Comparing -56($fp) type with String + la $v0, String + lw $a0, -56($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -52($fp) + # IF_ZERO local_method7_at_D_internal_12 GOTO label_COMPARE_STRING_276 + # IF_ZERO local_method7_at_D_internal_12 GOTO label_COMPARE_STRING_276 + lw $t0, -52($fp) + beq $t0, 0, label_COMPARE_STRING_276 + # LOCAL local_method7_at_D_internal_12 --> -52($fp) + # LOCAL local_method7_at_D_internal_13 --> -56($fp) + # Comparing -56($fp) type with Bool + la $v0, Bool + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -52($fp) + # IF_ZERO local_method7_at_D_internal_12 GOTO label_COMPARE_BY_VALUE_277 + # IF_ZERO local_method7_at_D_internal_12 GOTO label_COMPARE_BY_VALUE_277 + lw $t0, -52($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_277 + # LOCAL local_method7_at_D_internal_12 --> -52($fp) + # LOCAL local_method7_at_D_internal_13 --> -56($fp) + # Comparing -56($fp) type with Int + la $v0, Int + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -52($fp) + # IF_ZERO local_method7_at_D_internal_12 GOTO label_COMPARE_BY_VALUE_277 + # IF_ZERO local_method7_at_D_internal_12 GOTO label_COMPARE_BY_VALUE_277 + lw $t0, -52($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_277 + # LOCAL local_method7_at_D_internal_12 --> -52($fp) + # LOCAL local_method7_at_D_internal_13 --> -56($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + # Load pointers and SUB + lw $a0, -56($fp) + lw $a1, -4($fp) + sub $a0, $a0, $a1 + sw $a0, -52($fp) + # IF_ZERO local_method7_at_D_internal_12 GOTO label_TRUE_274 + # IF_ZERO local_method7_at_D_internal_12 GOTO label_TRUE_274 + lw $t0, -52($fp) + beq $t0, 0, label_TRUE_274 + # GOTO label_FALSE_273 + j label_FALSE_273 + label_COMPARE_BY_VALUE_277: + # LOCAL local_method7_at_D_internal_12 --> -52($fp) + # LOCAL local_method7_at_D_internal_13 --> -56($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + lw $a0, -56($fp) + lw $a1, -4($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -52($fp) + # IF_ZERO local_method7_at_D_internal_12 GOTO label_TRUE_274 + # IF_ZERO local_method7_at_D_internal_12 GOTO label_TRUE_274 + lw $t0, -52($fp) + beq $t0, 0, label_TRUE_274 + # GOTO label_FALSE_273 + j label_FALSE_273 + label_COMPARE_STRING_276: + # LOCAL local_method7_at_D_internal_12 --> -52($fp) + # LOCAL local_method7_at_D_internal_13 --> -56($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -4($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -52($fp) + # IF_ZERO local_method7_at_D_internal_12 GOTO label_CONTINUE_278 + # IF_ZERO local_method7_at_D_internal_12 GOTO label_CONTINUE_278 + lw $t0, -52($fp) + beq $t0, 0, label_CONTINUE_278 + # GOTO label_FALSE_273 + j label_FALSE_273 + label_CONTINUE_278: + # LOCAL local_method7_at_D_internal_12 --> -52($fp) + # LOCAL local_method7_at_D_internal_13 --> -56($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -4($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_279: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_280 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_279 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_280: + # Store result + sw $a2, -52($fp) + # IF_ZERO local_method7_at_D_internal_12 GOTO label_TRUE_274 + # IF_ZERO local_method7_at_D_internal_12 GOTO label_TRUE_274 + lw $t0, -52($fp) + beq $t0, 0, label_TRUE_274 + label_FALSE_273: + # LOCAL local_method7_at_D_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -48($fp) + # GOTO label_END_275 +j label_END_275 +label_TRUE_274: + # LOCAL local_method7_at_D_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -48($fp) + label_END_275: +# LOCAL local_method7_at_D_internal_9 --> -40($fp) +# LOCAL local_method7_at_D_internal_11 --> -48($fp) +# Obtain value from -48($fp) +lw $v0, -48($fp) +lw $v0, 12($v0) +sw $v0, -40($fp) +# IF_ZERO local_method7_at_D_internal_9 GOTO label_FALSEIF_271 +# IF_ZERO local_method7_at_D_internal_9 GOTO label_FALSEIF_271 +lw $t0, -40($fp) +beq $t0, 0, label_FALSEIF_271 +# LOCAL local_method7_at_D_internal_14 --> -60($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -60($fp) +# LOCAL local_method7_at_D_internal_10 --> -44($fp) +# LOCAL local_method7_at_D_internal_14 --> -60($fp) +# local_method7_at_D_internal_10 = local_method7_at_D_internal_14 +lw $t0, -60($fp) +sw $t0, -44($fp) +# GOTO label_ENDIF_272 +j label_ENDIF_272 +label_FALSEIF_271: + # LOCAL local_method7_at_D_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -80($fp) + # IF_ZERO local_method7_at_D_internal_19 GOTO label_FALSE_283 + # IF_ZERO local_method7_at_D_internal_19 GOTO label_FALSE_283 + lw $t0, -80($fp) + beq $t0, 0, label_FALSE_283 + # IF_ZERO local_method7_at_D_x_0 GOTO label_FALSE_283 + # IF_ZERO local_method7_at_D_x_0 GOTO label_FALSE_283 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_283 + # LOCAL local_method7_at_D_internal_18 --> -76($fp) + # LOCAL local_method7_at_D_internal_19 --> -80($fp) + # Comparing -80($fp) type with String + la $v0, String + lw $a0, -80($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -76($fp) + # IF_ZERO local_method7_at_D_internal_18 GOTO label_COMPARE_STRING_286 + # IF_ZERO local_method7_at_D_internal_18 GOTO label_COMPARE_STRING_286 + lw $t0, -76($fp) + beq $t0, 0, label_COMPARE_STRING_286 + # LOCAL local_method7_at_D_internal_18 --> -76($fp) + # LOCAL local_method7_at_D_internal_19 --> -80($fp) + # Comparing -80($fp) type with Bool + la $v0, Bool + lw $a0, -80($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -76($fp) + # IF_ZERO local_method7_at_D_internal_18 GOTO label_COMPARE_BY_VALUE_287 + # IF_ZERO local_method7_at_D_internal_18 GOTO label_COMPARE_BY_VALUE_287 + lw $t0, -76($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_287 + # LOCAL local_method7_at_D_internal_18 --> -76($fp) + # LOCAL local_method7_at_D_internal_19 --> -80($fp) + # Comparing -80($fp) type with Int + la $v0, Int + lw $a0, -80($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -76($fp) + # IF_ZERO local_method7_at_D_internal_18 GOTO label_COMPARE_BY_VALUE_287 + # IF_ZERO local_method7_at_D_internal_18 GOTO label_COMPARE_BY_VALUE_287 + lw $t0, -76($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_287 + # LOCAL local_method7_at_D_internal_18 --> -76($fp) + # LOCAL local_method7_at_D_internal_19 --> -80($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + # Load pointers and SUB + lw $a0, -80($fp) + lw $a1, -4($fp) + sub $a0, $a0, $a1 + sw $a0, -76($fp) + # IF_ZERO local_method7_at_D_internal_18 GOTO label_TRUE_284 + # IF_ZERO local_method7_at_D_internal_18 GOTO label_TRUE_284 + lw $t0, -76($fp) + beq $t0, 0, label_TRUE_284 + # GOTO label_FALSE_283 + j label_FALSE_283 + label_COMPARE_BY_VALUE_287: + # LOCAL local_method7_at_D_internal_18 --> -76($fp) + # LOCAL local_method7_at_D_internal_19 --> -80($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + lw $a0, -80($fp) + lw $a1, -4($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -76($fp) + # IF_ZERO local_method7_at_D_internal_18 GOTO label_TRUE_284 + # IF_ZERO local_method7_at_D_internal_18 GOTO label_TRUE_284 + lw $t0, -76($fp) + beq $t0, 0, label_TRUE_284 + # GOTO label_FALSE_283 + j label_FALSE_283 + label_COMPARE_STRING_286: + # LOCAL local_method7_at_D_internal_18 --> -76($fp) + # LOCAL local_method7_at_D_internal_19 --> -80($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + # Load strings for comparison + lw $v0, -80($fp) + lw $v1, -4($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -76($fp) + # IF_ZERO local_method7_at_D_internal_18 GOTO label_CONTINUE_288 + # IF_ZERO local_method7_at_D_internal_18 GOTO label_CONTINUE_288 + lw $t0, -76($fp) + beq $t0, 0, label_CONTINUE_288 + # GOTO label_FALSE_283 + j label_FALSE_283 + label_CONTINUE_288: + # LOCAL local_method7_at_D_internal_18 --> -76($fp) + # LOCAL local_method7_at_D_internal_19 --> -80($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -80($fp) + lw $v1, -4($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_289: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_290 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_289 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_290: + # Store result + sw $a2, -76($fp) + # IF_ZERO local_method7_at_D_internal_18 GOTO label_TRUE_284 + # IF_ZERO local_method7_at_D_internal_18 GOTO label_TRUE_284 + lw $t0, -76($fp) + beq $t0, 0, label_TRUE_284 + label_FALSE_283: + # LOCAL local_method7_at_D_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -72($fp) + # GOTO label_END_285 +j label_END_285 +label_TRUE_284: + # LOCAL local_method7_at_D_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -72($fp) + label_END_285: +# LOCAL local_method7_at_D_internal_15 --> -64($fp) +# LOCAL local_method7_at_D_internal_17 --> -72($fp) +# Obtain value from -72($fp) +lw $v0, -72($fp) +lw $v0, 12($v0) +sw $v0, -64($fp) +# IF_ZERO local_method7_at_D_internal_15 GOTO label_FALSEIF_281 +# IF_ZERO local_method7_at_D_internal_15 GOTO label_FALSEIF_281 +lw $t0, -64($fp) +beq $t0, 0, label_FALSEIF_281 +# LOCAL local_method7_at_D_internal_20 --> -84($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -84($fp) +# LOCAL local_method7_at_D_internal_16 --> -68($fp) +# LOCAL local_method7_at_D_internal_20 --> -84($fp) +# local_method7_at_D_internal_16 = local_method7_at_D_internal_20 +lw $t0, -84($fp) +sw $t0, -68($fp) +# GOTO label_ENDIF_282 +j label_ENDIF_282 +label_FALSEIF_281: + # LOCAL local_method7_at_D_internal_25 --> -104($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 2 + sw $t0, 12($v0) + sw $v0, -104($fp) + # IF_ZERO local_method7_at_D_internal_25 GOTO label_FALSE_293 + # IF_ZERO local_method7_at_D_internal_25 GOTO label_FALSE_293 + lw $t0, -104($fp) + beq $t0, 0, label_FALSE_293 + # IF_ZERO local_method7_at_D_x_0 GOTO label_FALSE_293 + # IF_ZERO local_method7_at_D_x_0 GOTO label_FALSE_293 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_293 + # LOCAL local_method7_at_D_internal_24 --> -100($fp) + # LOCAL local_method7_at_D_internal_25 --> -104($fp) + # Comparing -104($fp) type with String + la $v0, String + lw $a0, -104($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -100($fp) + # IF_ZERO local_method7_at_D_internal_24 GOTO label_COMPARE_STRING_296 + # IF_ZERO local_method7_at_D_internal_24 GOTO label_COMPARE_STRING_296 + lw $t0, -100($fp) + beq $t0, 0, label_COMPARE_STRING_296 + # LOCAL local_method7_at_D_internal_24 --> -100($fp) + # LOCAL local_method7_at_D_internal_25 --> -104($fp) + # Comparing -104($fp) type with Bool + la $v0, Bool + lw $a0, -104($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -100($fp) + # IF_ZERO local_method7_at_D_internal_24 GOTO label_COMPARE_BY_VALUE_297 + # IF_ZERO local_method7_at_D_internal_24 GOTO label_COMPARE_BY_VALUE_297 + lw $t0, -100($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_297 + # LOCAL local_method7_at_D_internal_24 --> -100($fp) + # LOCAL local_method7_at_D_internal_25 --> -104($fp) + # Comparing -104($fp) type with Int + la $v0, Int + lw $a0, -104($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -100($fp) + # IF_ZERO local_method7_at_D_internal_24 GOTO label_COMPARE_BY_VALUE_297 + # IF_ZERO local_method7_at_D_internal_24 GOTO label_COMPARE_BY_VALUE_297 + lw $t0, -100($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_297 + # LOCAL local_method7_at_D_internal_24 --> -100($fp) + # LOCAL local_method7_at_D_internal_25 --> -104($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + # Load pointers and SUB + lw $a0, -104($fp) + lw $a1, -4($fp) + sub $a0, $a0, $a1 + sw $a0, -100($fp) + # IF_ZERO local_method7_at_D_internal_24 GOTO label_TRUE_294 + # IF_ZERO local_method7_at_D_internal_24 GOTO label_TRUE_294 + lw $t0, -100($fp) + beq $t0, 0, label_TRUE_294 + # GOTO label_FALSE_293 + j label_FALSE_293 + label_COMPARE_BY_VALUE_297: + # LOCAL local_method7_at_D_internal_24 --> -100($fp) + # LOCAL local_method7_at_D_internal_25 --> -104($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + lw $a0, -104($fp) + lw $a1, -4($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -100($fp) + # IF_ZERO local_method7_at_D_internal_24 GOTO label_TRUE_294 + # IF_ZERO local_method7_at_D_internal_24 GOTO label_TRUE_294 + lw $t0, -100($fp) + beq $t0, 0, label_TRUE_294 + # GOTO label_FALSE_293 + j label_FALSE_293 + label_COMPARE_STRING_296: + # LOCAL local_method7_at_D_internal_24 --> -100($fp) + # LOCAL local_method7_at_D_internal_25 --> -104($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + # Load strings for comparison + lw $v0, -104($fp) + lw $v1, -4($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -100($fp) + # IF_ZERO local_method7_at_D_internal_24 GOTO label_CONTINUE_298 + # IF_ZERO local_method7_at_D_internal_24 GOTO label_CONTINUE_298 + lw $t0, -100($fp) + beq $t0, 0, label_CONTINUE_298 + # GOTO label_FALSE_293 + j label_FALSE_293 + label_CONTINUE_298: + # LOCAL local_method7_at_D_internal_24 --> -100($fp) + # LOCAL local_method7_at_D_internal_25 --> -104($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -104($fp) + lw $v1, -4($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_299: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_300 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_299 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_300: + # Store result + sw $a2, -100($fp) + # IF_ZERO local_method7_at_D_internal_24 GOTO label_TRUE_294 + # IF_ZERO local_method7_at_D_internal_24 GOTO label_TRUE_294 + lw $t0, -100($fp) + beq $t0, 0, label_TRUE_294 + label_FALSE_293: + # LOCAL local_method7_at_D_internal_23 --> -96($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -96($fp) + # GOTO label_END_295 +j label_END_295 +label_TRUE_294: + # LOCAL local_method7_at_D_internal_23 --> -96($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -96($fp) + label_END_295: +# LOCAL local_method7_at_D_internal_21 --> -88($fp) +# LOCAL local_method7_at_D_internal_23 --> -96($fp) +# Obtain value from -96($fp) +lw $v0, -96($fp) +lw $v0, 12($v0) +sw $v0, -88($fp) +# IF_ZERO local_method7_at_D_internal_21 GOTO label_FALSEIF_291 +# IF_ZERO local_method7_at_D_internal_21 GOTO label_FALSEIF_291 +lw $t0, -88($fp) +beq $t0, 0, label_FALSEIF_291 +# LOCAL local_method7_at_D_internal_26 --> -108($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -108($fp) +# LOCAL local_method7_at_D_internal_22 --> -92($fp) +# LOCAL local_method7_at_D_internal_26 --> -108($fp) +# local_method7_at_D_internal_22 = local_method7_at_D_internal_26 +lw $t0, -108($fp) +sw $t0, -92($fp) +# GOTO label_ENDIF_292 +j label_ENDIF_292 +label_FALSEIF_291: + # LOCAL local_method7_at_D_internal_29 --> -120($fp) + # local_method7_at_D_internal_29 = SELF + sw $s1, -120($fp) + # LOCAL local_method7_at_D_internal_27 --> -112($fp) + # LOCAL local_method7_at_D_internal_29 --> -120($fp) + # local_method7_at_D_internal_27 = local_method7_at_D_internal_29 + lw $t0, -120($fp) + sw $t0, -112($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_method7_at_D_internal_31 --> -128($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 3 + sw $t0, 12($v0) + sw $v0, -128($fp) + # LOCAL local_method7_at_D_internal_30 --> -124($fp) + # LOCAL local_method7_at_D_x_0 --> -4($fp) + # LOCAL local_method7_at_D_internal_31 --> -128($fp) + # local_method7_at_D_internal_30 = local_method7_at_D_x_0 - local_method7_at_D_internal_31 + lw $t1, -4($fp) + lw $t0, 12($t1) + lw $t1, -128($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -124($fp) + # ARG local_method7_at_D_internal_30 + # LOCAL local_method7_at_D_internal_30 --> -124($fp) + lw $t0, -124($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_method7_at_D_internal_27 --> -112($fp) + # LOCAL local_method7_at_D_internal_28 --> -116($fp) + # local_method7_at_D_internal_28 = VCALL local_method7_at_D_internal_27 method7 + # Save new self pointer in $s1 + lw $s1, -112($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 36($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -116($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_method7_at_D_internal_22 --> -92($fp) + # LOCAL local_method7_at_D_internal_28 --> -116($fp) + # local_method7_at_D_internal_22 = local_method7_at_D_internal_28 + lw $t0, -116($fp) + sw $t0, -92($fp) + label_ENDIF_292: +# LOCAL local_method7_at_D_internal_16 --> -68($fp) +# LOCAL local_method7_at_D_internal_22 --> -92($fp) +# local_method7_at_D_internal_16 = local_method7_at_D_internal_22 +lw $t0, -92($fp) +sw $t0, -68($fp) +label_ENDIF_282: +# LOCAL local_method7_at_D_internal_10 --> -44($fp) +# LOCAL local_method7_at_D_internal_16 --> -68($fp) +# local_method7_at_D_internal_10 = local_method7_at_D_internal_16 +lw $t0, -68($fp) +sw $t0, -44($fp) +label_ENDIF_272: +# LOCAL local_method7_at_D_internal_2 --> -12($fp) +# LOCAL local_method7_at_D_internal_10 --> -44($fp) +# local_method7_at_D_internal_2 = local_method7_at_D_internal_10 +lw $t0, -44($fp) +sw $t0, -12($fp) +label_ENDIF_268: +# RETURN local_method7_at_D_internal_2 +lw $v0, -12($fp) +# Deallocate stack frame for function function_method7_at_D. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 136 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_method6_at_E implementation. +# @Params: +# 0($fp) = param_method6_at_E_num_0 +function_method6_at_E: + # Allocate stack frame for function function_method6_at_E. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_method6_at_E_x_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_method6_at_E_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 8 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_method6_at_E_internal_1 --> -8($fp) + # PARAM param_method6_at_E_num_0 --> 0($fp) + # LOCAL local_method6_at_E_internal_2 --> -12($fp) + # local_method6_at_E_internal_1 = PARAM param_method6_at_E_num_0 / local_method6_at_E_internal_2 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -12($fp) + lw $t2, 12($t1) + div $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_method6_at_E_x_0 --> -4($fp) + # LOCAL local_method6_at_E_internal_1 --> -8($fp) + # local_method6_at_E_x_0 = local_method6_at_E_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_method6_at_E_internal_5 --> -24($fp) + # local_method6_at_E_internal_5 = ALLOCATE A + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, A + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, A_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -24($fp) + # LOCAL local_method6_at_E_internal_3 --> -16($fp) + # LOCAL local_method6_at_E_internal_5 --> -24($fp) + # local_method6_at_E_internal_3 = local_method6_at_E_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_method6_at_E_x_0 + # LOCAL local_method6_at_E_x_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_method6_at_E_internal_3 --> -16($fp) + # LOCAL local_method6_at_E_internal_4 --> -20($fp) + # local_method6_at_E_internal_4 = VCALL local_method6_at_E_internal_3 set_var + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 116($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_method6_at_E_internal_4 + lw $v0, -20($fp) + # Deallocate stack frame for function function_method6_at_E. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_method6_at_C implementation. +# @Params: +# 0($fp) = param_method6_at_C_num_0 +function_method6_at_C: + # Allocate stack frame for function function_method6_at_C. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_method6_at_C_x_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_method6_at_C_internal_1 --> -8($fp) + # PARAM param_method6_at_C_num_0 --> 0($fp) + lw $t0, 0($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -8($fp) + # LOCAL local_method6_at_C_internal_1 --> -8($fp) + # LOCAL local_method6_at_C_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -8($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_method6_at_C_x_0 --> -4($fp) + # LOCAL local_method6_at_C_internal_1 --> -8($fp) + # local_method6_at_C_x_0 = local_method6_at_C_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_method6_at_C_internal_4 --> -20($fp) + # local_method6_at_C_internal_4 = ALLOCATE A + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, A + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, A_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -20($fp) + # LOCAL local_method6_at_C_internal_2 --> -12($fp) + # LOCAL local_method6_at_C_internal_4 --> -20($fp) + # local_method6_at_C_internal_2 = local_method6_at_C_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_method6_at_C_x_0 + # LOCAL local_method6_at_C_x_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_method6_at_C_internal_2 --> -12($fp) + # LOCAL local_method6_at_C_internal_3 --> -16($fp) + # local_method6_at_C_internal_3 = VCALL local_method6_at_C_internal_2 set_var + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 116($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_method6_at_C_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_method6_at_C. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_method5_at_C implementation. +# @Params: +# 0($fp) = param_method5_at_C_num_0 +function_method5_at_C: + # Allocate stack frame for function function_method5_at_C. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_method5_at_C_x_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_method5_at_C_internal_2 --> -12($fp) + # PARAM param_method5_at_C_num_0 --> 0($fp) + # PARAM param_method5_at_C_num_0 --> 0($fp) + # local_method5_at_C_internal_2 = PARAM param_method5_at_C_num_0 * PARAM param_method5_at_C_num_0 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, 0($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_method5_at_C_internal_1 --> -8($fp) + # LOCAL local_method5_at_C_internal_2 --> -12($fp) + # PARAM param_method5_at_C_num_0 --> 0($fp) + # local_method5_at_C_internal_1 = local_method5_at_C_internal_2 * PARAM param_method5_at_C_num_0 + lw $t1, -12($fp) + lw $t0, 12($t1) + lw $t1, 0($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_method5_at_C_x_0 --> -4($fp) + # LOCAL local_method5_at_C_internal_1 --> -8($fp) + # local_method5_at_C_x_0 = local_method5_at_C_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_method5_at_C_internal_5 --> -24($fp) + # local_method5_at_C_internal_5 = ALLOCATE E + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, E + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, E_start + sw $t0, 4($v0) + # Load type offset + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -24($fp) + # LOCAL local_method5_at_C_internal_3 --> -16($fp) + # LOCAL local_method5_at_C_internal_5 --> -24($fp) + # local_method5_at_C_internal_3 = local_method5_at_C_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_method5_at_C_x_0 + # LOCAL local_method5_at_C_x_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_method5_at_C_internal_3 --> -16($fp) + # LOCAL local_method5_at_C_internal_4 --> -20($fp) + # local_method5_at_C_internal_4 = VCALL local_method5_at_C_internal_3 set_var + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 116($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_method5_at_C_internal_4 + lw $v0, -20($fp) + # Deallocate stack frame for function function_method5_at_C. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# __Main__attrib__char__init implementation. +# @Params: +__Main__attrib__char__init: + # Allocate stack frame for function __Main__attrib__char__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__char__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__char__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__char__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__avar__init implementation. +# @Params: +__Main__attrib__avar__init: + # Allocate stack frame for function __Main__attrib__avar__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__avar__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__a_var__init implementation. +# @Params: +__Main__attrib__a_var__init: + # Allocate stack frame for function __Main__attrib__a_var__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__a_var__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__flag__init implementation. +# @Params: +__Main__attrib__flag__init: + # Allocate stack frame for function __Main__attrib__flag__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__flag__init_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_ttrib__flag__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Main__attrib__flag__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_menu_at_Main implementation. +# @Params: +function_menu_at_Main: + # Allocate stack frame for function function_menu_at_Main. + subu $sp, $sp, 436 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 436 + # LOCAL local_menu_at_Main_internal_2 --> -12($fp) + # local_menu_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_menu_at_Main_internal_0 --> -4($fp) + # LOCAL local_menu_at_Main_internal_2 --> -12($fp) + # local_menu_at_Main_internal_0 = local_menu_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_30 + sw $t0, 12($v0) + li $t0, 22 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_menu_at_Main_internal_3 + # LOCAL local_menu_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_0 --> -4($fp) + # LOCAL local_menu_at_Main_internal_1 --> -8($fp) + # local_menu_at_Main_internal_1 = VCALL local_menu_at_Main_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_6 --> -28($fp) + # local_menu_at_Main_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_menu_at_Main_internal_4 --> -20($fp) + # LOCAL local_menu_at_Main_internal_6 --> -28($fp) + # local_menu_at_Main_internal_4 = local_menu_at_Main_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_menu_at_Main_internal_7 = GETATTRIBUTE avar Main + # LOCAL local_menu_at_Main_internal_7 --> -32($fp) + lw $t0, 16($s1) + sw $t0, -32($fp) + # ARG local_menu_at_Main_internal_7 + # LOCAL local_menu_at_Main_internal_7 --> -32($fp) + lw $t0, -32($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_4 --> -20($fp) + # LOCAL local_menu_at_Main_internal_5 --> -24($fp) + # local_menu_at_Main_internal_5 = VCALL local_menu_at_Main_internal_4 print + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_10 --> -44($fp) + # local_menu_at_Main_internal_10 = SELF + sw $s1, -44($fp) + # LOCAL local_menu_at_Main_internal_8 --> -36($fp) + # LOCAL local_menu_at_Main_internal_10 --> -44($fp) + # local_menu_at_Main_internal_8 = local_menu_at_Main_internal_10 + lw $t0, -44($fp) + sw $t0, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_31 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -48($fp) + # ARG local_menu_at_Main_internal_11 + # LOCAL local_menu_at_Main_internal_11 --> -48($fp) + lw $t0, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_8 --> -36($fp) + # LOCAL local_menu_at_Main_internal_9 --> -40($fp) + # local_menu_at_Main_internal_9 = VCALL local_menu_at_Main_internal_8 out_string + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_14 --> -60($fp) + # local_menu_at_Main_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_menu_at_Main_internal_12 --> -52($fp) + # LOCAL local_menu_at_Main_internal_14 --> -60($fp) + # local_menu_at_Main_internal_12 = local_menu_at_Main_internal_14 + lw $t0, -60($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_32 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -64($fp) + # ARG local_menu_at_Main_internal_15 + # LOCAL local_menu_at_Main_internal_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_12 --> -52($fp) + # LOCAL local_menu_at_Main_internal_13 --> -56($fp) + # local_menu_at_Main_internal_13 = VCALL local_menu_at_Main_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_18 --> -76($fp) + # local_menu_at_Main_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_menu_at_Main_internal_16 --> -68($fp) + # LOCAL local_menu_at_Main_internal_18 --> -76($fp) + # local_menu_at_Main_internal_16 = local_menu_at_Main_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_menu_at_Main_internal_19 = GETATTRIBUTE avar Main + # LOCAL local_menu_at_Main_internal_19 --> -80($fp) + lw $t0, 16($s1) + sw $t0, -80($fp) + # ARG local_menu_at_Main_internal_19 + # LOCAL local_menu_at_Main_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_16 --> -68($fp) + # LOCAL local_menu_at_Main_internal_17 --> -72($fp) + # local_menu_at_Main_internal_17 = VCALL local_menu_at_Main_internal_16 print + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_22 --> -92($fp) + # local_menu_at_Main_internal_22 = SELF + sw $s1, -92($fp) + # LOCAL local_menu_at_Main_internal_20 --> -84($fp) + # LOCAL local_menu_at_Main_internal_22 --> -92($fp) + # local_menu_at_Main_internal_20 = local_menu_at_Main_internal_22 + lw $t0, -92($fp) + sw $t0, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_23 --> -96($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_33 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -96($fp) + # ARG local_menu_at_Main_internal_23 + # LOCAL local_menu_at_Main_internal_23 --> -96($fp) + lw $t0, -96($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_20 --> -84($fp) + # LOCAL local_menu_at_Main_internal_21 --> -88($fp) + # local_menu_at_Main_internal_21 = VCALL local_menu_at_Main_internal_20 out_string + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_26 --> -108($fp) + # local_menu_at_Main_internal_26 = SELF + sw $s1, -108($fp) + # LOCAL local_menu_at_Main_internal_24 --> -100($fp) + # LOCAL local_menu_at_Main_internal_26 --> -108($fp) + # local_menu_at_Main_internal_24 = local_menu_at_Main_internal_26 + lw $t0, -108($fp) + sw $t0, -100($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_27 --> -112($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_34 + sw $t0, 12($v0) + li $t0, 33 + sw $t0, 16($v0) + sw $v0, -112($fp) + # ARG local_menu_at_Main_internal_27 + # LOCAL local_menu_at_Main_internal_27 --> -112($fp) + lw $t0, -112($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_24 --> -100($fp) + # LOCAL local_menu_at_Main_internal_25 --> -104($fp) + # local_menu_at_Main_internal_25 = VCALL local_menu_at_Main_internal_24 out_string + # Save new self pointer in $s1 + lw $s1, -100($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -104($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_30 --> -124($fp) + # local_menu_at_Main_internal_30 = SELF + sw $s1, -124($fp) + # LOCAL local_menu_at_Main_internal_28 --> -116($fp) + # LOCAL local_menu_at_Main_internal_30 --> -124($fp) + # local_menu_at_Main_internal_28 = local_menu_at_Main_internal_30 + lw $t0, -124($fp) + sw $t0, -116($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_menu_at_Main_internal_31 = GETATTRIBUTE avar Main + # LOCAL local_menu_at_Main_internal_31 --> -128($fp) + lw $t0, 16($s1) + sw $t0, -128($fp) + # ARG local_menu_at_Main_internal_31 + # LOCAL local_menu_at_Main_internal_31 --> -128($fp) + lw $t0, -128($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_28 --> -116($fp) + # LOCAL local_menu_at_Main_internal_29 --> -120($fp) + # local_menu_at_Main_internal_29 = VCALL local_menu_at_Main_internal_28 print + # Save new self pointer in $s1 + lw $s1, -116($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -120($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_34 --> -140($fp) + # local_menu_at_Main_internal_34 = SELF + sw $s1, -140($fp) + # LOCAL local_menu_at_Main_internal_32 --> -132($fp) + # LOCAL local_menu_at_Main_internal_34 --> -140($fp) + # local_menu_at_Main_internal_32 = local_menu_at_Main_internal_34 + lw $t0, -140($fp) + sw $t0, -132($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_35 --> -144($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_35 + sw $t0, 12($v0) + li $t0, 30 + sw $t0, 16($v0) + sw $v0, -144($fp) + # ARG local_menu_at_Main_internal_35 + # LOCAL local_menu_at_Main_internal_35 --> -144($fp) + lw $t0, -144($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_32 --> -132($fp) + # LOCAL local_menu_at_Main_internal_33 --> -136($fp) + # local_menu_at_Main_internal_33 = VCALL local_menu_at_Main_internal_32 out_string + # Save new self pointer in $s1 + lw $s1, -132($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -136($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_38 --> -156($fp) + # local_menu_at_Main_internal_38 = SELF + sw $s1, -156($fp) + # LOCAL local_menu_at_Main_internal_36 --> -148($fp) + # LOCAL local_menu_at_Main_internal_38 --> -156($fp) + # local_menu_at_Main_internal_36 = local_menu_at_Main_internal_38 + lw $t0, -156($fp) + sw $t0, -148($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_39 --> -160($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_36 + sw $t0, 12($v0) + li $t0, 27 + sw $t0, 16($v0) + sw $v0, -160($fp) + # ARG local_menu_at_Main_internal_39 + # LOCAL local_menu_at_Main_internal_39 --> -160($fp) + lw $t0, -160($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_36 --> -148($fp) + # LOCAL local_menu_at_Main_internal_37 --> -152($fp) + # local_menu_at_Main_internal_37 = VCALL local_menu_at_Main_internal_36 out_string + # Save new self pointer in $s1 + lw $s1, -148($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -152($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_42 --> -172($fp) + # local_menu_at_Main_internal_42 = SELF + sw $s1, -172($fp) + # LOCAL local_menu_at_Main_internal_40 --> -164($fp) + # LOCAL local_menu_at_Main_internal_42 --> -172($fp) + # local_menu_at_Main_internal_40 = local_menu_at_Main_internal_42 + lw $t0, -172($fp) + sw $t0, -164($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_menu_at_Main_internal_43 = GETATTRIBUTE avar Main + # LOCAL local_menu_at_Main_internal_43 --> -176($fp) + lw $t0, 16($s1) + sw $t0, -176($fp) + # ARG local_menu_at_Main_internal_43 + # LOCAL local_menu_at_Main_internal_43 --> -176($fp) + lw $t0, -176($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_40 --> -164($fp) + # LOCAL local_menu_at_Main_internal_41 --> -168($fp) + # local_menu_at_Main_internal_41 = VCALL local_menu_at_Main_internal_40 print + # Save new self pointer in $s1 + lw $s1, -164($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -168($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_46 --> -188($fp) + # local_menu_at_Main_internal_46 = SELF + sw $s1, -188($fp) + # LOCAL local_menu_at_Main_internal_44 --> -180($fp) + # LOCAL local_menu_at_Main_internal_46 --> -188($fp) + # local_menu_at_Main_internal_44 = local_menu_at_Main_internal_46 + lw $t0, -188($fp) + sw $t0, -180($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_47 --> -192($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_37 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -192($fp) + # ARG local_menu_at_Main_internal_47 + # LOCAL local_menu_at_Main_internal_47 --> -192($fp) + lw $t0, -192($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_44 --> -180($fp) + # LOCAL local_menu_at_Main_internal_45 --> -184($fp) + # local_menu_at_Main_internal_45 = VCALL local_menu_at_Main_internal_44 out_string + # Save new self pointer in $s1 + lw $s1, -180($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -184($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_50 --> -204($fp) + # local_menu_at_Main_internal_50 = SELF + sw $s1, -204($fp) + # LOCAL local_menu_at_Main_internal_48 --> -196($fp) + # LOCAL local_menu_at_Main_internal_50 --> -204($fp) + # local_menu_at_Main_internal_48 = local_menu_at_Main_internal_50 + lw $t0, -204($fp) + sw $t0, -196($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_51 --> -208($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_38 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -208($fp) + # ARG local_menu_at_Main_internal_51 + # LOCAL local_menu_at_Main_internal_51 --> -208($fp) + lw $t0, -208($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_48 --> -196($fp) + # LOCAL local_menu_at_Main_internal_49 --> -200($fp) + # local_menu_at_Main_internal_49 = VCALL local_menu_at_Main_internal_48 out_string + # Save new self pointer in $s1 + lw $s1, -196($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -200($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_54 --> -220($fp) + # local_menu_at_Main_internal_54 = SELF + sw $s1, -220($fp) + # LOCAL local_menu_at_Main_internal_52 --> -212($fp) + # LOCAL local_menu_at_Main_internal_54 --> -220($fp) + # local_menu_at_Main_internal_52 = local_menu_at_Main_internal_54 + lw $t0, -220($fp) + sw $t0, -212($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_menu_at_Main_internal_55 = GETATTRIBUTE avar Main + # LOCAL local_menu_at_Main_internal_55 --> -224($fp) + lw $t0, 16($s1) + sw $t0, -224($fp) + # ARG local_menu_at_Main_internal_55 + # LOCAL local_menu_at_Main_internal_55 --> -224($fp) + lw $t0, -224($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_52 --> -212($fp) + # LOCAL local_menu_at_Main_internal_53 --> -216($fp) + # local_menu_at_Main_internal_53 = VCALL local_menu_at_Main_internal_52 print + # Save new self pointer in $s1 + lw $s1, -212($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -216($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_58 --> -236($fp) + # local_menu_at_Main_internal_58 = SELF + sw $s1, -236($fp) + # LOCAL local_menu_at_Main_internal_56 --> -228($fp) + # LOCAL local_menu_at_Main_internal_58 --> -236($fp) + # local_menu_at_Main_internal_56 = local_menu_at_Main_internal_58 + lw $t0, -236($fp) + sw $t0, -228($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_59 --> -240($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_39 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -240($fp) + # ARG local_menu_at_Main_internal_59 + # LOCAL local_menu_at_Main_internal_59 --> -240($fp) + lw $t0, -240($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_56 --> -228($fp) + # LOCAL local_menu_at_Main_internal_57 --> -232($fp) + # local_menu_at_Main_internal_57 = VCALL local_menu_at_Main_internal_56 out_string + # Save new self pointer in $s1 + lw $s1, -228($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -232($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_62 --> -252($fp) + # local_menu_at_Main_internal_62 = SELF + sw $s1, -252($fp) + # LOCAL local_menu_at_Main_internal_60 --> -244($fp) + # LOCAL local_menu_at_Main_internal_62 --> -252($fp) + # local_menu_at_Main_internal_60 = local_menu_at_Main_internal_62 + lw $t0, -252($fp) + sw $t0, -244($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_63 --> -256($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_40 + sw $t0, 12($v0) + li $t0, 10 + sw $t0, 16($v0) + sw $v0, -256($fp) + # ARG local_menu_at_Main_internal_63 + # LOCAL local_menu_at_Main_internal_63 --> -256($fp) + lw $t0, -256($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_60 --> -244($fp) + # LOCAL local_menu_at_Main_internal_61 --> -248($fp) + # local_menu_at_Main_internal_61 = VCALL local_menu_at_Main_internal_60 out_string + # Save new self pointer in $s1 + lw $s1, -244($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -248($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_66 --> -268($fp) + # local_menu_at_Main_internal_66 = SELF + sw $s1, -268($fp) + # LOCAL local_menu_at_Main_internal_64 --> -260($fp) + # LOCAL local_menu_at_Main_internal_66 --> -268($fp) + # local_menu_at_Main_internal_64 = local_menu_at_Main_internal_66 + lw $t0, -268($fp) + sw $t0, -260($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_menu_at_Main_internal_67 = GETATTRIBUTE avar Main + # LOCAL local_menu_at_Main_internal_67 --> -272($fp) + lw $t0, 16($s1) + sw $t0, -272($fp) + # ARG local_menu_at_Main_internal_67 + # LOCAL local_menu_at_Main_internal_67 --> -272($fp) + lw $t0, -272($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_64 --> -260($fp) + # LOCAL local_menu_at_Main_internal_65 --> -264($fp) + # local_menu_at_Main_internal_65 = VCALL local_menu_at_Main_internal_64 print + # Save new self pointer in $s1 + lw $s1, -260($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -264($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_70 --> -284($fp) + # local_menu_at_Main_internal_70 = SELF + sw $s1, -284($fp) + # LOCAL local_menu_at_Main_internal_68 --> -276($fp) + # LOCAL local_menu_at_Main_internal_70 --> -284($fp) + # local_menu_at_Main_internal_68 = local_menu_at_Main_internal_70 + lw $t0, -284($fp) + sw $t0, -276($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_71 --> -288($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_41 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -288($fp) + # ARG local_menu_at_Main_internal_71 + # LOCAL local_menu_at_Main_internal_71 --> -288($fp) + lw $t0, -288($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_68 --> -276($fp) + # LOCAL local_menu_at_Main_internal_69 --> -280($fp) + # local_menu_at_Main_internal_69 = VCALL local_menu_at_Main_internal_68 out_string + # Save new self pointer in $s1 + lw $s1, -276($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -280($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_74 --> -300($fp) + # local_menu_at_Main_internal_74 = SELF + sw $s1, -300($fp) + # LOCAL local_menu_at_Main_internal_72 --> -292($fp) + # LOCAL local_menu_at_Main_internal_74 --> -300($fp) + # local_menu_at_Main_internal_72 = local_menu_at_Main_internal_74 + lw $t0, -300($fp) + sw $t0, -292($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_75 --> -304($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_42 + sw $t0, 12($v0) + li $t0, 17 + sw $t0, 16($v0) + sw $v0, -304($fp) + # ARG local_menu_at_Main_internal_75 + # LOCAL local_menu_at_Main_internal_75 --> -304($fp) + lw $t0, -304($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_72 --> -292($fp) + # LOCAL local_menu_at_Main_internal_73 --> -296($fp) + # local_menu_at_Main_internal_73 = VCALL local_menu_at_Main_internal_72 out_string + # Save new self pointer in $s1 + lw $s1, -292($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -296($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_78 --> -316($fp) + # local_menu_at_Main_internal_78 = SELF + sw $s1, -316($fp) + # LOCAL local_menu_at_Main_internal_76 --> -308($fp) + # LOCAL local_menu_at_Main_internal_78 --> -316($fp) + # local_menu_at_Main_internal_76 = local_menu_at_Main_internal_78 + lw $t0, -316($fp) + sw $t0, -308($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_menu_at_Main_internal_79 = GETATTRIBUTE avar Main + # LOCAL local_menu_at_Main_internal_79 --> -320($fp) + lw $t0, 16($s1) + sw $t0, -320($fp) + # ARG local_menu_at_Main_internal_79 + # LOCAL local_menu_at_Main_internal_79 --> -320($fp) + lw $t0, -320($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_76 --> -308($fp) + # LOCAL local_menu_at_Main_internal_77 --> -312($fp) + # local_menu_at_Main_internal_77 = VCALL local_menu_at_Main_internal_76 print + # Save new self pointer in $s1 + lw $s1, -308($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -312($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_82 --> -332($fp) + # local_menu_at_Main_internal_82 = SELF + sw $s1, -332($fp) + # LOCAL local_menu_at_Main_internal_80 --> -324($fp) + # LOCAL local_menu_at_Main_internal_82 --> -332($fp) + # local_menu_at_Main_internal_80 = local_menu_at_Main_internal_82 + lw $t0, -332($fp) + sw $t0, -324($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_83 --> -336($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_43 + sw $t0, 12($v0) + li $t0, 30 + sw $t0, 16($v0) + sw $v0, -336($fp) + # ARG local_menu_at_Main_internal_83 + # LOCAL local_menu_at_Main_internal_83 --> -336($fp) + lw $t0, -336($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_80 --> -324($fp) + # LOCAL local_menu_at_Main_internal_81 --> -328($fp) + # local_menu_at_Main_internal_81 = VCALL local_menu_at_Main_internal_80 out_string + # Save new self pointer in $s1 + lw $s1, -324($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -328($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_86 --> -348($fp) + # local_menu_at_Main_internal_86 = SELF + sw $s1, -348($fp) + # LOCAL local_menu_at_Main_internal_84 --> -340($fp) + # LOCAL local_menu_at_Main_internal_86 --> -348($fp) + # local_menu_at_Main_internal_84 = local_menu_at_Main_internal_86 + lw $t0, -348($fp) + sw $t0, -340($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_87 --> -352($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_44 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -352($fp) + # ARG local_menu_at_Main_internal_87 + # LOCAL local_menu_at_Main_internal_87 --> -352($fp) + lw $t0, -352($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_84 --> -340($fp) + # LOCAL local_menu_at_Main_internal_85 --> -344($fp) + # local_menu_at_Main_internal_85 = VCALL local_menu_at_Main_internal_84 out_string + # Save new self pointer in $s1 + lw $s1, -340($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -344($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_90 --> -364($fp) + # local_menu_at_Main_internal_90 = SELF + sw $s1, -364($fp) + # LOCAL local_menu_at_Main_internal_88 --> -356($fp) + # LOCAL local_menu_at_Main_internal_90 --> -364($fp) + # local_menu_at_Main_internal_88 = local_menu_at_Main_internal_90 + lw $t0, -364($fp) + sw $t0, -356($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_menu_at_Main_internal_91 = GETATTRIBUTE avar Main + # LOCAL local_menu_at_Main_internal_91 --> -368($fp) + lw $t0, 16($s1) + sw $t0, -368($fp) + # ARG local_menu_at_Main_internal_91 + # LOCAL local_menu_at_Main_internal_91 --> -368($fp) + lw $t0, -368($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_88 --> -356($fp) + # LOCAL local_menu_at_Main_internal_89 --> -360($fp) + # local_menu_at_Main_internal_89 = VCALL local_menu_at_Main_internal_88 print + # Save new self pointer in $s1 + lw $s1, -356($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -360($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_94 --> -380($fp) + # local_menu_at_Main_internal_94 = SELF + sw $s1, -380($fp) + # LOCAL local_menu_at_Main_internal_92 --> -372($fp) + # LOCAL local_menu_at_Main_internal_94 --> -380($fp) + # local_menu_at_Main_internal_92 = local_menu_at_Main_internal_94 + lw $t0, -380($fp) + sw $t0, -372($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_95 --> -384($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_45 + sw $t0, 12($v0) + li $t0, 16 + sw $t0, 16($v0) + sw $v0, -384($fp) + # ARG local_menu_at_Main_internal_95 + # LOCAL local_menu_at_Main_internal_95 --> -384($fp) + lw $t0, -384($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_92 --> -372($fp) + # LOCAL local_menu_at_Main_internal_93 --> -376($fp) + # local_menu_at_Main_internal_93 = VCALL local_menu_at_Main_internal_92 out_string + # Save new self pointer in $s1 + lw $s1, -372($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -376($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_98 --> -396($fp) + # local_menu_at_Main_internal_98 = SELF + sw $s1, -396($fp) + # LOCAL local_menu_at_Main_internal_96 --> -388($fp) + # LOCAL local_menu_at_Main_internal_98 --> -396($fp) + # local_menu_at_Main_internal_96 = local_menu_at_Main_internal_98 + lw $t0, -396($fp) + sw $t0, -388($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_99 --> -400($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_46 + sw $t0, 12($v0) + li $t0, 33 + sw $t0, 16($v0) + sw $v0, -400($fp) + # ARG local_menu_at_Main_internal_99 + # LOCAL local_menu_at_Main_internal_99 --> -400($fp) + lw $t0, -400($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_96 --> -388($fp) + # LOCAL local_menu_at_Main_internal_97 --> -392($fp) + # local_menu_at_Main_internal_97 = VCALL local_menu_at_Main_internal_96 out_string + # Save new self pointer in $s1 + lw $s1, -388($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -392($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_102 --> -412($fp) + # local_menu_at_Main_internal_102 = SELF + sw $s1, -412($fp) + # LOCAL local_menu_at_Main_internal_100 --> -404($fp) + # LOCAL local_menu_at_Main_internal_102 --> -412($fp) + # local_menu_at_Main_internal_100 = local_menu_at_Main_internal_102 + lw $t0, -412($fp) + sw $t0, -404($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_103 --> -416($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_47 + sw $t0, 12($v0) + li $t0, 22 + sw $t0, 16($v0) + sw $v0, -416($fp) + # ARG local_menu_at_Main_internal_103 + # LOCAL local_menu_at_Main_internal_103 --> -416($fp) + lw $t0, -416($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_menu_at_Main_internal_100 --> -404($fp) + # LOCAL local_menu_at_Main_internal_101 --> -408($fp) + # local_menu_at_Main_internal_101 = VCALL local_menu_at_Main_internal_100 out_string + # Save new self pointer in $s1 + lw $s1, -404($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -408($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_menu_at_Main_internal_106 --> -428($fp) + # local_menu_at_Main_internal_106 = SELF + sw $s1, -428($fp) + # LOCAL local_menu_at_Main_internal_104 --> -420($fp) + # LOCAL local_menu_at_Main_internal_106 --> -428($fp) + # local_menu_at_Main_internal_104 = local_menu_at_Main_internal_106 + lw $t0, -428($fp) + sw $t0, -420($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_menu_at_Main_internal_104 --> -420($fp) + # LOCAL local_menu_at_Main_internal_105 --> -424($fp) + # local_menu_at_Main_internal_105 = VCALL local_menu_at_Main_internal_104 in_string + # Save new self pointer in $s1 + lw $s1, -420($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 60($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -424($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_menu_at_Main_internal_105 + lw $v0, -424($fp) + # Deallocate stack frame for function function_menu_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 436 + jr $ra + # Function END + + +# function_prompt_at_Main implementation. +# @Params: +function_prompt_at_Main: + # Allocate stack frame for function function_prompt_at_Main. + subu $sp, $sp, 52 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 52 + # LOCAL local_prompt_at_Main_internal_2 --> -12($fp) + # local_prompt_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_prompt_at_Main_internal_0 --> -4($fp) + # LOCAL local_prompt_at_Main_internal_2 --> -12($fp) + # local_prompt_at_Main_internal_0 = local_prompt_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_Main_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_48 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_prompt_at_Main_internal_3 + # LOCAL local_prompt_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_prompt_at_Main_internal_0 --> -4($fp) + # LOCAL local_prompt_at_Main_internal_1 --> -8($fp) + # local_prompt_at_Main_internal_1 = VCALL local_prompt_at_Main_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt_at_Main_internal_6 --> -28($fp) + # local_prompt_at_Main_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_prompt_at_Main_internal_4 --> -20($fp) + # LOCAL local_prompt_at_Main_internal_6 --> -28($fp) + # local_prompt_at_Main_internal_4 = local_prompt_at_Main_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_Main_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_49 + sw $t0, 12($v0) + li $t0, 26 + sw $t0, 16($v0) + sw $v0, -32($fp) + # ARG local_prompt_at_Main_internal_7 + # LOCAL local_prompt_at_Main_internal_7 --> -32($fp) + lw $t0, -32($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_prompt_at_Main_internal_4 --> -20($fp) + # LOCAL local_prompt_at_Main_internal_5 --> -24($fp) + # local_prompt_at_Main_internal_5 = VCALL local_prompt_at_Main_internal_4 out_string + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt_at_Main_internal_10 --> -44($fp) + # local_prompt_at_Main_internal_10 = SELF + sw $s1, -44($fp) + # LOCAL local_prompt_at_Main_internal_8 --> -36($fp) + # LOCAL local_prompt_at_Main_internal_10 --> -44($fp) + # local_prompt_at_Main_internal_8 = local_prompt_at_Main_internal_10 + lw $t0, -44($fp) + sw $t0, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_Main_internal_8 --> -36($fp) + # LOCAL local_prompt_at_Main_internal_9 --> -40($fp) + # local_prompt_at_Main_internal_9 = VCALL local_prompt_at_Main_internal_8 in_string + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 60($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_prompt_at_Main_internal_9 + lw $v0, -40($fp) + # Deallocate stack frame for function function_prompt_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 52 + jr $ra + # Function END + + +# function_get_int_at_Main implementation. +# @Params: +function_get_int_at_Main: + # Allocate stack frame for function function_get_int_at_Main. + subu $sp, $sp, 40 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 40 + # LOCAL local_get_int_at_Main_z_0 --> -4($fp) + # local_get_int_at_Main_z_0 = 0 + li $t0, 0 + sw $t0, -4($fp) + # LOCAL local_get_int_at_Main_internal_1 --> -8($fp) + # local_get_int_at_Main_internal_1 = ALLOCATE A2I + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, A2I + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, A2I_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # LOCAL local_get_int_at_Main_z_0 --> -4($fp) + # LOCAL local_get_int_at_Main_internal_1 --> -8($fp) + # local_get_int_at_Main_z_0 = local_get_int_at_Main_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_get_int_at_Main_s_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -12($fp) + # LOCAL local_get_int_at_Main_internal_5 --> -24($fp) + # local_get_int_at_Main_internal_5 = SELF + sw $s1, -24($fp) + # LOCAL local_get_int_at_Main_internal_3 --> -16($fp) + # LOCAL local_get_int_at_Main_internal_5 --> -24($fp) + # local_get_int_at_Main_internal_3 = local_get_int_at_Main_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_get_int_at_Main_internal_3 --> -16($fp) + # LOCAL local_get_int_at_Main_internal_4 --> -20($fp) + # local_get_int_at_Main_internal_4 = VCALL local_get_int_at_Main_internal_3 prompt + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 68($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_get_int_at_Main_s_2 --> -12($fp) + # LOCAL local_get_int_at_Main_internal_4 --> -20($fp) + # local_get_int_at_Main_s_2 = local_get_int_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # LOCAL local_get_int_at_Main_internal_6 --> -28($fp) + # LOCAL local_get_int_at_Main_z_0 --> -4($fp) + # local_get_int_at_Main_internal_6 = local_get_int_at_Main_z_0 + lw $t0, -4($fp) + sw $t0, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_get_int_at_Main_s_2 + # LOCAL local_get_int_at_Main_s_2 --> -12($fp) + lw $t0, -12($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_get_int_at_Main_internal_6 --> -28($fp) + # LOCAL local_get_int_at_Main_internal_7 --> -32($fp) + # local_get_int_at_Main_internal_7 = VCALL local_get_int_at_Main_internal_6 a2i + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 124($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_get_int_at_Main_internal_7 + lw $v0, -32($fp) + # Deallocate stack frame for function function_get_int_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 40 + jr $ra + # Function END + + +# function_is_even_at_Main implementation. +# @Params: +# 0($fp) = param_is_even_at_Main_num_0 +function_is_even_at_Main: + # Allocate stack frame for function function_is_even_at_Main. + subu $sp, $sp, 112 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 112 + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + # PARAM param_is_even_at_Main_num_0 --> 0($fp) + # local_is_even_at_Main_x_0 = PARAM param_is_even_at_Main_num_0 + lw $t0, 0($fp) + sw $t0, -4($fp) + # LOCAL local_is_even_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # LOCAL local_is_even_at_Main_internal_3 --> -16($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + # LOCAL local_is_even_at_Main_internal_4 --> -20($fp) + lw $a0, -4($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_GREATER_ZERO local_is_even_at_Main_internal_3 GOTO label_FALSE_303 + # IF_GREATER_ZERO local_is_even_at_Main_internal_3 GOTO label_FALSE_303 + lw $t0, -16($fp) + bgt $t0, 0, label_FALSE_303 + # IF_ZERO local_is_even_at_Main_internal_3 GOTO label_FALSE_303 + # IF_ZERO local_is_even_at_Main_internal_3 GOTO label_FALSE_303 + lw $t0, -16($fp) + beq $t0, 0, label_FALSE_303 + # LOCAL local_is_even_at_Main_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -16($fp) + # GOTO label_END_304 +j label_END_304 +label_FALSE_303: + # LOCAL local_is_even_at_Main_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -16($fp) + label_END_304: +# LOCAL local_is_even_at_Main_internal_1 --> -8($fp) +# LOCAL local_is_even_at_Main_internal_3 --> -16($fp) +# Obtain value from -16($fp) +lw $v0, -16($fp) +lw $v0, 12($v0) +sw $v0, -8($fp) +# IF_ZERO local_is_even_at_Main_internal_1 GOTO label_FALSEIF_301 +# IF_ZERO local_is_even_at_Main_internal_1 GOTO label_FALSEIF_301 +lw $t0, -8($fp) +beq $t0, 0, label_FALSEIF_301 +# LOCAL local_is_even_at_Main_internal_7 --> -32($fp) +# local_is_even_at_Main_internal_7 = SELF +sw $s1, -32($fp) +# LOCAL local_is_even_at_Main_internal_5 --> -24($fp) +# LOCAL local_is_even_at_Main_internal_7 --> -32($fp) +# local_is_even_at_Main_internal_5 = local_is_even_at_Main_internal_7 +lw $t0, -32($fp) +sw $t0, -24($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_is_even_at_Main_internal_8 --> -36($fp) +# LOCAL local_is_even_at_Main_x_0 --> -4($fp) +lw $t0, -4($fp) +lw $t0, 12($t0) +not $t0, $t0 +add $t0, $t0, 1 +sw $t0, -36($fp) +# LOCAL local_is_even_at_Main_internal_8 --> -36($fp) +# LOCAL local_is_even_at_Main_internal_8 --> -36($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +lw $t0, -36($fp) +sw $t0, 12($v0) +sw $v0, -36($fp) +# ARG local_is_even_at_Main_internal_8 +# LOCAL local_is_even_at_Main_internal_8 --> -36($fp) +lw $t0, -36($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_is_even_at_Main_internal_5 --> -24($fp) +# LOCAL local_is_even_at_Main_internal_6 --> -28($fp) +# local_is_even_at_Main_internal_6 = VCALL local_is_even_at_Main_internal_5 is_even +# Save new self pointer in $s1 +lw $s1, -24($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 4($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -28($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_is_even_at_Main_internal_2 --> -12($fp) +# LOCAL local_is_even_at_Main_internal_6 --> -28($fp) +# local_is_even_at_Main_internal_2 = local_is_even_at_Main_internal_6 +lw $t0, -28($fp) +sw $t0, -12($fp) +# GOTO label_ENDIF_302 +j label_ENDIF_302 +label_FALSEIF_301: + # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -56($fp) + # IF_ZERO local_is_even_at_Main_internal_13 GOTO label_FALSE_307 + # IF_ZERO local_is_even_at_Main_internal_13 GOTO label_FALSE_307 + lw $t0, -56($fp) + beq $t0, 0, label_FALSE_307 + # IF_ZERO local_is_even_at_Main_x_0 GOTO label_FALSE_307 + # IF_ZERO local_is_even_at_Main_x_0 GOTO label_FALSE_307 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_307 + # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) + # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) + # Comparing -56($fp) type with String + la $v0, String + lw $a0, -56($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -52($fp) + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_COMPARE_STRING_310 + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_COMPARE_STRING_310 + lw $t0, -52($fp) + beq $t0, 0, label_COMPARE_STRING_310 + # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) + # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) + # Comparing -56($fp) type with Bool + la $v0, Bool + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -52($fp) + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_COMPARE_BY_VALUE_311 + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_COMPARE_BY_VALUE_311 + lw $t0, -52($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_311 + # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) + # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) + # Comparing -56($fp) type with Int + la $v0, Int + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -52($fp) + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_COMPARE_BY_VALUE_311 + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_COMPARE_BY_VALUE_311 + lw $t0, -52($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_311 + # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) + # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + # Load pointers and SUB + lw $a0, -56($fp) + lw $a1, -4($fp) + sub $a0, $a0, $a1 + sw $a0, -52($fp) + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_TRUE_308 + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_TRUE_308 + lw $t0, -52($fp) + beq $t0, 0, label_TRUE_308 + # GOTO label_FALSE_307 + j label_FALSE_307 + label_COMPARE_BY_VALUE_311: + # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) + # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + lw $a0, -56($fp) + lw $a1, -4($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -52($fp) + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_TRUE_308 + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_TRUE_308 + lw $t0, -52($fp) + beq $t0, 0, label_TRUE_308 + # GOTO label_FALSE_307 + j label_FALSE_307 + label_COMPARE_STRING_310: + # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) + # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -4($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -52($fp) + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_CONTINUE_312 + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_CONTINUE_312 + lw $t0, -52($fp) + beq $t0, 0, label_CONTINUE_312 + # GOTO label_FALSE_307 + j label_FALSE_307 + label_CONTINUE_312: + # LOCAL local_is_even_at_Main_internal_12 --> -52($fp) + # LOCAL local_is_even_at_Main_internal_13 --> -56($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -4($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_313: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_314 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_313 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_314: + # Store result + sw $a2, -52($fp) + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_TRUE_308 + # IF_ZERO local_is_even_at_Main_internal_12 GOTO label_TRUE_308 + lw $t0, -52($fp) + beq $t0, 0, label_TRUE_308 + label_FALSE_307: + # LOCAL local_is_even_at_Main_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -48($fp) + # GOTO label_END_309 +j label_END_309 +label_TRUE_308: + # LOCAL local_is_even_at_Main_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -48($fp) + label_END_309: +# LOCAL local_is_even_at_Main_internal_9 --> -40($fp) +# LOCAL local_is_even_at_Main_internal_11 --> -48($fp) +# Obtain value from -48($fp) +lw $v0, -48($fp) +lw $v0, 12($v0) +sw $v0, -40($fp) +# IF_ZERO local_is_even_at_Main_internal_9 GOTO label_FALSEIF_305 +# IF_ZERO local_is_even_at_Main_internal_9 GOTO label_FALSEIF_305 +lw $t0, -40($fp) +beq $t0, 0, label_FALSEIF_305 +# LOCAL local_is_even_at_Main_internal_14 --> -60($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -60($fp) +# LOCAL local_is_even_at_Main_internal_10 --> -44($fp) +# LOCAL local_is_even_at_Main_internal_14 --> -60($fp) +# local_is_even_at_Main_internal_10 = local_is_even_at_Main_internal_14 +lw $t0, -60($fp) +sw $t0, -44($fp) +# GOTO label_ENDIF_306 +j label_ENDIF_306 +label_FALSEIF_305: + # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -80($fp) + # IF_ZERO local_is_even_at_Main_internal_19 GOTO label_FALSE_317 + # IF_ZERO local_is_even_at_Main_internal_19 GOTO label_FALSE_317 + lw $t0, -80($fp) + beq $t0, 0, label_FALSE_317 + # IF_ZERO local_is_even_at_Main_x_0 GOTO label_FALSE_317 + # IF_ZERO local_is_even_at_Main_x_0 GOTO label_FALSE_317 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_317 + # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) + # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) + # Comparing -80($fp) type with String + la $v0, String + lw $a0, -80($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -76($fp) + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_COMPARE_STRING_320 + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_COMPARE_STRING_320 + lw $t0, -76($fp) + beq $t0, 0, label_COMPARE_STRING_320 + # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) + # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) + # Comparing -80($fp) type with Bool + la $v0, Bool + lw $a0, -80($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -76($fp) + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_COMPARE_BY_VALUE_321 + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_COMPARE_BY_VALUE_321 + lw $t0, -76($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_321 + # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) + # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) + # Comparing -80($fp) type with Int + la $v0, Int + lw $a0, -80($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -76($fp) + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_COMPARE_BY_VALUE_321 + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_COMPARE_BY_VALUE_321 + lw $t0, -76($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_321 + # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) + # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + # Load pointers and SUB + lw $a0, -80($fp) + lw $a1, -4($fp) + sub $a0, $a0, $a1 + sw $a0, -76($fp) + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_TRUE_318 + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_TRUE_318 + lw $t0, -76($fp) + beq $t0, 0, label_TRUE_318 + # GOTO label_FALSE_317 + j label_FALSE_317 + label_COMPARE_BY_VALUE_321: + # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) + # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + lw $a0, -80($fp) + lw $a1, -4($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -76($fp) + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_TRUE_318 + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_TRUE_318 + lw $t0, -76($fp) + beq $t0, 0, label_TRUE_318 + # GOTO label_FALSE_317 + j label_FALSE_317 + label_COMPARE_STRING_320: + # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) + # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + # Load strings for comparison + lw $v0, -80($fp) + lw $v1, -4($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -76($fp) + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_CONTINUE_322 + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_CONTINUE_322 + lw $t0, -76($fp) + beq $t0, 0, label_CONTINUE_322 + # GOTO label_FALSE_317 + j label_FALSE_317 + label_CONTINUE_322: + # LOCAL local_is_even_at_Main_internal_18 --> -76($fp) + # LOCAL local_is_even_at_Main_internal_19 --> -80($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -80($fp) + lw $v1, -4($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_323: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_324 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_323 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_324: + # Store result + sw $a2, -76($fp) + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_TRUE_318 + # IF_ZERO local_is_even_at_Main_internal_18 GOTO label_TRUE_318 + lw $t0, -76($fp) + beq $t0, 0, label_TRUE_318 + label_FALSE_317: + # LOCAL local_is_even_at_Main_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -72($fp) + # GOTO label_END_319 +j label_END_319 +label_TRUE_318: + # LOCAL local_is_even_at_Main_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -72($fp) + label_END_319: +# LOCAL local_is_even_at_Main_internal_15 --> -64($fp) +# LOCAL local_is_even_at_Main_internal_17 --> -72($fp) +# Obtain value from -72($fp) +lw $v0, -72($fp) +lw $v0, 12($v0) +sw $v0, -64($fp) +# IF_ZERO local_is_even_at_Main_internal_15 GOTO label_FALSEIF_315 +# IF_ZERO local_is_even_at_Main_internal_15 GOTO label_FALSEIF_315 +lw $t0, -64($fp) +beq $t0, 0, label_FALSEIF_315 +# LOCAL local_is_even_at_Main_internal_20 --> -84($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -84($fp) +# LOCAL local_is_even_at_Main_internal_16 --> -68($fp) +# LOCAL local_is_even_at_Main_internal_20 --> -84($fp) +# local_is_even_at_Main_internal_16 = local_is_even_at_Main_internal_20 +lw $t0, -84($fp) +sw $t0, -68($fp) +# GOTO label_ENDIF_316 +j label_ENDIF_316 +label_FALSEIF_315: + # LOCAL local_is_even_at_Main_internal_23 --> -96($fp) + # local_is_even_at_Main_internal_23 = SELF + sw $s1, -96($fp) + # LOCAL local_is_even_at_Main_internal_21 --> -88($fp) + # LOCAL local_is_even_at_Main_internal_23 --> -96($fp) + # local_is_even_at_Main_internal_21 = local_is_even_at_Main_internal_23 + lw $t0, -96($fp) + sw $t0, -88($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_is_even_at_Main_internal_25 --> -104($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 2 + sw $t0, 12($v0) + sw $v0, -104($fp) + # LOCAL local_is_even_at_Main_internal_24 --> -100($fp) + # LOCAL local_is_even_at_Main_x_0 --> -4($fp) + # LOCAL local_is_even_at_Main_internal_25 --> -104($fp) + # local_is_even_at_Main_internal_24 = local_is_even_at_Main_x_0 - local_is_even_at_Main_internal_25 + lw $t1, -4($fp) + lw $t0, 12($t1) + lw $t1, -104($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -100($fp) + # ARG local_is_even_at_Main_internal_24 + # LOCAL local_is_even_at_Main_internal_24 --> -100($fp) + lw $t0, -100($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_is_even_at_Main_internal_21 --> -88($fp) + # LOCAL local_is_even_at_Main_internal_22 --> -92($fp) + # local_is_even_at_Main_internal_22 = VCALL local_is_even_at_Main_internal_21 is_even + # Save new self pointer in $s1 + lw $s1, -88($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -92($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_is_even_at_Main_internal_16 --> -68($fp) + # LOCAL local_is_even_at_Main_internal_22 --> -92($fp) + # local_is_even_at_Main_internal_16 = local_is_even_at_Main_internal_22 + lw $t0, -92($fp) + sw $t0, -68($fp) + label_ENDIF_316: +# LOCAL local_is_even_at_Main_internal_10 --> -44($fp) +# LOCAL local_is_even_at_Main_internal_16 --> -68($fp) +# local_is_even_at_Main_internal_10 = local_is_even_at_Main_internal_16 +lw $t0, -68($fp) +sw $t0, -44($fp) +label_ENDIF_306: +# LOCAL local_is_even_at_Main_internal_2 --> -12($fp) +# LOCAL local_is_even_at_Main_internal_10 --> -44($fp) +# local_is_even_at_Main_internal_2 = local_is_even_at_Main_internal_10 +lw $t0, -44($fp) +sw $t0, -12($fp) +label_ENDIF_302: +# RETURN local_is_even_at_Main_internal_2 +lw $v0, -12($fp) +# Deallocate stack frame for function function_is_even_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 112 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_class_type_at_Main implementation. +# @Params: +# 0($fp) = param_class_type_at_Main_var_0 +function_class_type_at_Main: + # Allocate stack frame for function function_class_type_at_Main. + subu $sp, $sp, 148 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 148 + # PARAM param_class_type_at_Main_var_0 --> 0($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # local_class_type_at_Main_internal_0 = TYPEOF param_class_type_at_Main_var_0 + lw $t0, 0($fp) + # Load pointer to type offset + lw $t1, 8($t0) + sw $t1, -4($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # local_class_type_at_Main_internal_3 = 15 + li $t0, 15 + sw $t0, -16($fp) + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type A + la $t0, A__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_Not_min0_325 + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # local_class_type_at_Main_internal_3 = local_class_type_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -16($fp) + label_Not_min0_325: + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type B + la $t0, B__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_Not_min1_326 + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # local_class_type_at_Main_internal_3 = local_class_type_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -16($fp) + label_Not_min1_326: + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type C + la $t0, C__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_Not_min2_327 + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # local_class_type_at_Main_internal_3 = local_class_type_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -16($fp) + label_Not_min2_327: + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type D + la $t0, D__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_Not_min3_328 + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # local_class_type_at_Main_internal_3 = local_class_type_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -16($fp) + label_Not_min3_328: + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type E + la $t0, E__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_Not_min4_329 + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # local_class_type_at_Main_internal_3 = local_class_type_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -16($fp) + label_Not_min4_329: + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type Object + la $t0, Object__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_Not_min5_330 + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # local_class_type_at_Main_internal_3 = local_class_type_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -16($fp) + label_Not_min5_330: + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # local_class_type_at_Main_internal_4 = 15 + li $t0, 15 + sw $t0, -20($fp) + # LOCAL local_class_type_at_Main_internal_1 --> -8($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Load pointers and SUB + lw $a0, -20($fp) + lw $a1, -16($fp) + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_class_type_at_Main_internal_1 GOTO label_ERROR_331 + # IF_ZERO local_class_type_at_Main_internal_1 GOTO label_ERROR_331 + lw $t0, -8($fp) + beq $t0, 0, label_ERROR_331 + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type A + la $t0, A__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_NEXT0_333 + # LOCAL local_class_type_at_Main_a_5 --> -24($fp) + # PARAM param_class_type_at_Main_var_0 --> 0($fp) + # local_class_type_at_Main_a_5 = PARAM param_class_type_at_Main_var_0 + lw $t0, 0($fp) + sw $t0, -24($fp) + # LOCAL local_class_type_at_Main_internal_8 --> -36($fp) + # local_class_type_at_Main_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_class_type_at_Main_internal_6 --> -28($fp) + # LOCAL local_class_type_at_Main_internal_8 --> -36($fp) + # local_class_type_at_Main_internal_6 = local_class_type_at_Main_internal_8 + lw $t0, -36($fp) + sw $t0, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_class_type_at_Main_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_50 + sw $t0, 12($v0) + li $t0, 20 + sw $t0, 16($v0) + sw $v0, -40($fp) + # ARG local_class_type_at_Main_internal_9 + # LOCAL local_class_type_at_Main_internal_9 --> -40($fp) + lw $t0, -40($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_class_type_at_Main_internal_6 --> -28($fp) + # LOCAL local_class_type_at_Main_internal_7 --> -32($fp) + # local_class_type_at_Main_internal_7 = VCALL local_class_type_at_Main_internal_6 out_string + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_class_type_at_Main_internal_2 --> -12($fp) + # LOCAL local_class_type_at_Main_internal_7 --> -32($fp) + # local_class_type_at_Main_internal_2 = local_class_type_at_Main_internal_7 + lw $t0, -32($fp) + sw $t0, -12($fp) + # GOTO label_END_332 +j label_END_332 +label_NEXT0_333: + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type B + la $t0, B__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_NEXT1_334 + # LOCAL local_class_type_at_Main_b_10 --> -44($fp) + # PARAM param_class_type_at_Main_var_0 --> 0($fp) + # local_class_type_at_Main_b_10 = PARAM param_class_type_at_Main_var_0 + lw $t0, 0($fp) + sw $t0, -44($fp) + # LOCAL local_class_type_at_Main_internal_13 --> -56($fp) + # local_class_type_at_Main_internal_13 = SELF + sw $s1, -56($fp) + # LOCAL local_class_type_at_Main_internal_11 --> -48($fp) + # LOCAL local_class_type_at_Main_internal_13 --> -56($fp) + # local_class_type_at_Main_internal_11 = local_class_type_at_Main_internal_13 + lw $t0, -56($fp) + sw $t0, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_class_type_at_Main_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_51 + sw $t0, 12($v0) + li $t0, 20 + sw $t0, 16($v0) + sw $v0, -60($fp) + # ARG local_class_type_at_Main_internal_14 + # LOCAL local_class_type_at_Main_internal_14 --> -60($fp) + lw $t0, -60($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_class_type_at_Main_internal_11 --> -48($fp) + # LOCAL local_class_type_at_Main_internal_12 --> -52($fp) + # local_class_type_at_Main_internal_12 = VCALL local_class_type_at_Main_internal_11 out_string + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_class_type_at_Main_internal_2 --> -12($fp) + # LOCAL local_class_type_at_Main_internal_12 --> -52($fp) + # local_class_type_at_Main_internal_2 = local_class_type_at_Main_internal_12 + lw $t0, -52($fp) + sw $t0, -12($fp) + # GOTO label_END_332 +j label_END_332 +label_NEXT1_334: + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type C + la $t0, C__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_NEXT2_335 + # LOCAL local_class_type_at_Main_c_15 --> -64($fp) + # PARAM param_class_type_at_Main_var_0 --> 0($fp) + # local_class_type_at_Main_c_15 = PARAM param_class_type_at_Main_var_0 + lw $t0, 0($fp) + sw $t0, -64($fp) + # LOCAL local_class_type_at_Main_internal_18 --> -76($fp) + # local_class_type_at_Main_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_class_type_at_Main_internal_16 --> -68($fp) + # LOCAL local_class_type_at_Main_internal_18 --> -76($fp) + # local_class_type_at_Main_internal_16 = local_class_type_at_Main_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_class_type_at_Main_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_52 + sw $t0, 12($v0) + li $t0, 20 + sw $t0, 16($v0) + sw $v0, -80($fp) + # ARG local_class_type_at_Main_internal_19 + # LOCAL local_class_type_at_Main_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_class_type_at_Main_internal_16 --> -68($fp) + # LOCAL local_class_type_at_Main_internal_17 --> -72($fp) + # local_class_type_at_Main_internal_17 = VCALL local_class_type_at_Main_internal_16 out_string + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_class_type_at_Main_internal_2 --> -12($fp) + # LOCAL local_class_type_at_Main_internal_17 --> -72($fp) + # local_class_type_at_Main_internal_2 = local_class_type_at_Main_internal_17 + lw $t0, -72($fp) + sw $t0, -12($fp) + # GOTO label_END_332 +j label_END_332 +label_NEXT2_335: + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type D + la $t0, D__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_NEXT3_336 + # LOCAL local_class_type_at_Main_d_20 --> -84($fp) + # PARAM param_class_type_at_Main_var_0 --> 0($fp) + # local_class_type_at_Main_d_20 = PARAM param_class_type_at_Main_var_0 + lw $t0, 0($fp) + sw $t0, -84($fp) + # LOCAL local_class_type_at_Main_internal_23 --> -96($fp) + # local_class_type_at_Main_internal_23 = SELF + sw $s1, -96($fp) + # LOCAL local_class_type_at_Main_internal_21 --> -88($fp) + # LOCAL local_class_type_at_Main_internal_23 --> -96($fp) + # local_class_type_at_Main_internal_21 = local_class_type_at_Main_internal_23 + lw $t0, -96($fp) + sw $t0, -88($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_class_type_at_Main_internal_24 --> -100($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_53 + sw $t0, 12($v0) + li $t0, 20 + sw $t0, 16($v0) + sw $v0, -100($fp) + # ARG local_class_type_at_Main_internal_24 + # LOCAL local_class_type_at_Main_internal_24 --> -100($fp) + lw $t0, -100($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_class_type_at_Main_internal_21 --> -88($fp) + # LOCAL local_class_type_at_Main_internal_22 --> -92($fp) + # local_class_type_at_Main_internal_22 = VCALL local_class_type_at_Main_internal_21 out_string + # Save new self pointer in $s1 + lw $s1, -88($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -92($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_class_type_at_Main_internal_2 --> -12($fp) + # LOCAL local_class_type_at_Main_internal_22 --> -92($fp) + # local_class_type_at_Main_internal_2 = local_class_type_at_Main_internal_22 + lw $t0, -92($fp) + sw $t0, -12($fp) + # GOTO label_END_332 +j label_END_332 +label_NEXT3_336: + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type E + la $t0, E__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_NEXT4_337 + # LOCAL local_class_type_at_Main_e_25 --> -104($fp) + # PARAM param_class_type_at_Main_var_0 --> 0($fp) + # local_class_type_at_Main_e_25 = PARAM param_class_type_at_Main_var_0 + lw $t0, 0($fp) + sw $t0, -104($fp) + # LOCAL local_class_type_at_Main_internal_28 --> -116($fp) + # local_class_type_at_Main_internal_28 = SELF + sw $s1, -116($fp) + # LOCAL local_class_type_at_Main_internal_26 --> -108($fp) + # LOCAL local_class_type_at_Main_internal_28 --> -116($fp) + # local_class_type_at_Main_internal_26 = local_class_type_at_Main_internal_28 + lw $t0, -116($fp) + sw $t0, -108($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_class_type_at_Main_internal_29 --> -120($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_54 + sw $t0, 12($v0) + li $t0, 20 + sw $t0, 16($v0) + sw $v0, -120($fp) + # ARG local_class_type_at_Main_internal_29 + # LOCAL local_class_type_at_Main_internal_29 --> -120($fp) + lw $t0, -120($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_class_type_at_Main_internal_26 --> -108($fp) + # LOCAL local_class_type_at_Main_internal_27 --> -112($fp) + # local_class_type_at_Main_internal_27 = VCALL local_class_type_at_Main_internal_26 out_string + # Save new self pointer in $s1 + lw $s1, -108($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -112($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_class_type_at_Main_internal_2 --> -12($fp) + # LOCAL local_class_type_at_Main_internal_27 --> -112($fp) + # local_class_type_at_Main_internal_2 = local_class_type_at_Main_internal_27 + lw $t0, -112($fp) + sw $t0, -12($fp) + # GOTO label_END_332 +j label_END_332 +label_NEXT4_337: + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) + # Load TDT pointer to type Object + la $t0, Object__TDT + lw $t1, -4($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -20($fp) + # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) + # LOCAL local_class_type_at_Main_internal_3 --> -16($fp) + # Update min if 8 < 9 + lw $t0, -20($fp) + lw $t1, -16($fp) + bgtu $t0, $t1, label_NEXT5_338 + # LOCAL local_class_type_at_Main_o_30 --> -124($fp) + # PARAM param_class_type_at_Main_var_0 --> 0($fp) + # local_class_type_at_Main_o_30 = PARAM param_class_type_at_Main_var_0 + lw $t0, 0($fp) + sw $t0, -124($fp) + # LOCAL local_class_type_at_Main_internal_33 --> -136($fp) + # local_class_type_at_Main_internal_33 = SELF + sw $s1, -136($fp) + # LOCAL local_class_type_at_Main_internal_31 --> -128($fp) + # LOCAL local_class_type_at_Main_internal_33 --> -136($fp) + # local_class_type_at_Main_internal_31 = local_class_type_at_Main_internal_33 + lw $t0, -136($fp) + sw $t0, -128($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_class_type_at_Main_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_55 + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + sw $v0, -140($fp) + # ARG local_class_type_at_Main_internal_34 + # LOCAL local_class_type_at_Main_internal_34 --> -140($fp) + lw $t0, -140($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_class_type_at_Main_internal_31 --> -128($fp) + # LOCAL local_class_type_at_Main_internal_32 --> -132($fp) + # local_class_type_at_Main_internal_32 = VCALL local_class_type_at_Main_internal_31 out_string + # Save new self pointer in $s1 + lw $s1, -128($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -132($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_class_type_at_Main_internal_2 --> -12($fp) + # LOCAL local_class_type_at_Main_internal_32 --> -132($fp) + # local_class_type_at_Main_internal_2 = local_class_type_at_Main_internal_32 + lw $t0, -132($fp) + sw $t0, -12($fp) + # GOTO label_END_332 +j label_END_332 +label_NEXT5_338: + label_ERROR_331: + # PARAM param_class_type_at_Main_var_0 --> 0($fp) + lw $t0, 0($s1) + sw $t0, 0($fp) + # PARAM param_class_type_at_Main_var_0 --> 0($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, 0($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + label_END_332: +# RETURN local_class_type_at_Main_internal_2 +lw $v0, -12($fp) +# Deallocate stack frame for function function_class_type_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 148 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_print_at_Main implementation. +# @Params: +# 0($fp) = param_print_at_Main_var_0 +function_print_at_Main: + # Allocate stack frame for function function_print_at_Main. + subu $sp, $sp, 60 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 60 + # LOCAL local_print_at_Main_z_0 --> -4($fp) + # local_print_at_Main_z_0 = 0 + li $t0, 0 + sw $t0, -4($fp) + # LOCAL local_print_at_Main_internal_1 --> -8($fp) + # local_print_at_Main_internal_1 = ALLOCATE A2I + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, A2I + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, A2I_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # LOCAL local_print_at_Main_z_0 --> -4($fp) + # LOCAL local_print_at_Main_internal_1 --> -8($fp) + # local_print_at_Main_z_0 = local_print_at_Main_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_print_at_Main_internal_4 --> -20($fp) + # local_print_at_Main_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_print_at_Main_internal_2 --> -12($fp) + # LOCAL local_print_at_Main_internal_4 --> -20($fp) + # local_print_at_Main_internal_2 = local_print_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Main_internal_5 --> -24($fp) + # LOCAL local_print_at_Main_z_0 --> -4($fp) + # local_print_at_Main_internal_5 = local_print_at_Main_z_0 + lw $t0, -4($fp) + sw $t0, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Main_internal_7 --> -32($fp) + # PARAM param_print_at_Main_var_0 --> 0($fp) + # local_print_at_Main_internal_7 = PARAM param_print_at_Main_var_0 + lw $t0, 0($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Main_internal_7 --> -32($fp) + # LOCAL local_print_at_Main_internal_8 --> -36($fp) + # local_print_at_Main_internal_8 = VCALL local_print_at_Main_internal_7 value + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 24($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_print_at_Main_internal_8 + # LOCAL local_print_at_Main_internal_8 --> -36($fp) + lw $t0, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Main_internal_5 --> -24($fp) + # LOCAL local_print_at_Main_internal_6 --> -28($fp) + # local_print_at_Main_internal_6 = VCALL local_print_at_Main_internal_5 i2a + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_print_at_Main_internal_6 + # LOCAL local_print_at_Main_internal_6 --> -28($fp) + lw $t0, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Main_internal_2 --> -12($fp) + # LOCAL local_print_at_Main_internal_3 --> -16($fp) + # local_print_at_Main_internal_3 = VCALL local_print_at_Main_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Main_internal_11 --> -48($fp) + # local_print_at_Main_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_print_at_Main_internal_9 --> -40($fp) + # LOCAL local_print_at_Main_internal_11 --> -48($fp) + # local_print_at_Main_internal_9 = local_print_at_Main_internal_11 + lw $t0, -48($fp) + sw $t0, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Main_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_56 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -52($fp) + # ARG local_print_at_Main_internal_12 + # LOCAL local_print_at_Main_internal_12 --> -52($fp) + lw $t0, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Main_internal_9 --> -40($fp) + # LOCAL local_print_at_Main_internal_10 --> -44($fp) + # local_print_at_Main_internal_10 = VCALL local_print_at_Main_internal_9 out_string + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_at_Main_internal_10 + lw $v0, -44($fp) + # Deallocate stack frame for function function_print_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 60 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 1008 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 1008 + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # local_main_at_Main_internal_0 = ALLOCATE A + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, A + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, A_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + lw $t0, -4($fp) + sw $t0, 16($s1) + label_WHILE_339: + # local_main_at_Main_internal_2 = GETATTRIBUTE flag Main + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + lw $t0, 24($s1) + sw $t0, -12($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # Obtain value from -12($fp) + lw $v0, -12($fp) + lw $v0, 12($v0) + sw $v0, -8($fp) + # IF_ZERO local_main_at_Main_internal_1 GOTO label_WHILE_END_340 + # IF_ZERO local_main_at_Main_internal_1 GOTO label_WHILE_END_340 + lw $t0, -8($fp) + beq $t0, 0, label_WHILE_END_340 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = SELF + sw $s1, -24($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_57 + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + sw $v0, -28($fp) + # ARG local_main_at_Main_internal_6 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + lw $t0, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 out_string + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = SELF + sw $s1, -40($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 + lw $t0, -40($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_main_at_Main_internal_10 = GETATTRIBUTE avar Main + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + lw $t0, 16($s1) + sw $t0, -44($fp) + # ARG local_main_at_Main_internal_10 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + lw $t0, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 print + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_main_at_Main_internal_18 = GETATTRIBUTE avar Main + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + lw $t0, 16($s1) + sw $t0, -76($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_16 = local_main_at_Main_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 value + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 24($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_17 + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + lw $t0, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 is_even + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # Obtain value from -60($fp) + lw $v0, -60($fp) + lw $v0, 12($v0) + sw $v0, -48($fp) + # IF_ZERO local_main_at_Main_internal_11 GOTO label_FALSEIF_341 + # IF_ZERO local_main_at_Main_internal_11 GOTO label_FALSEIF_341 + lw $t0, -48($fp) + beq $t0, 0, label_FALSEIF_341 + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_21 = SELF + sw $s1, -88($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_19 = local_main_at_Main_internal_21 + lw $t0, -88($fp) + sw $t0, -80($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_58 + sw $t0, 12($v0) + li $t0, 9 + sw $t0, 16($v0) + sw $v0, -92($fp) + # ARG local_main_at_Main_internal_22 + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + lw $t0, -92($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_20 = VCALL local_main_at_Main_internal_19 out_string + # Save new self pointer in $s1 + lw $s1, -80($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -84($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_12 = local_main_at_Main_internal_20 + lw $t0, -84($fp) + sw $t0, -52($fp) + # GOTO label_ENDIF_342 +j label_ENDIF_342 +label_FALSEIF_341: + # LOCAL local_main_at_Main_internal_25 --> -104($fp) + # local_main_at_Main_internal_25 = SELF + sw $s1, -104($fp) + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # LOCAL local_main_at_Main_internal_25 --> -104($fp) + # local_main_at_Main_internal_23 = local_main_at_Main_internal_25 + lw $t0, -104($fp) + sw $t0, -96($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_59 + sw $t0, 12($v0) + li $t0, 8 + sw $t0, 16($v0) + sw $v0, -108($fp) + # ARG local_main_at_Main_internal_26 + # LOCAL local_main_at_Main_internal_26 --> -108($fp) + lw $t0, -108($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # LOCAL local_main_at_Main_internal_24 --> -100($fp) + # local_main_at_Main_internal_24 = VCALL local_main_at_Main_internal_23 out_string + # Save new self pointer in $s1 + lw $s1, -96($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -100($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_24 --> -100($fp) + # local_main_at_Main_internal_12 = local_main_at_Main_internal_24 + lw $t0, -100($fp) + sw $t0, -52($fp) + label_ENDIF_342: +# LOCAL local_main_at_Main_internal_29 --> -120($fp) +# local_main_at_Main_internal_29 = SELF +sw $s1, -120($fp) +# LOCAL local_main_at_Main_internal_27 --> -112($fp) +# LOCAL local_main_at_Main_internal_29 --> -120($fp) +# local_main_at_Main_internal_27 = local_main_at_Main_internal_29 +lw $t0, -120($fp) +sw $t0, -112($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_main_at_Main_internal_30 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_30 --> -124($fp) +lw $t0, 16($s1) +sw $t0, -124($fp) +# ARG local_main_at_Main_internal_30 +# LOCAL local_main_at_Main_internal_30 --> -124($fp) +lw $t0, -124($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_27 --> -112($fp) +# LOCAL local_main_at_Main_internal_28 --> -116($fp) +# local_main_at_Main_internal_28 = VCALL local_main_at_Main_internal_27 class_type +# Save new self pointer in $s1 +lw $s1, -112($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 80($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -116($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_33 --> -136($fp) +# local_main_at_Main_internal_33 = SELF +sw $s1, -136($fp) +# LOCAL local_main_at_Main_internal_31 --> -128($fp) +# LOCAL local_main_at_Main_internal_33 --> -136($fp) +# local_main_at_Main_internal_31 = local_main_at_Main_internal_33 +lw $t0, -136($fp) +sw $t0, -128($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_31 --> -128($fp) +# LOCAL local_main_at_Main_internal_32 --> -132($fp) +# local_main_at_Main_internal_32 = VCALL local_main_at_Main_internal_31 menu +# Save new self pointer in $s1 +lw $s1, -128($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 108($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -132($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_main_at_Main_internal_32 --> -132($fp) +lw $t0, -132($fp) +sw $t0, 12($s1) +# local_main_at_Main_internal_38 = GETATTRIBUTE char Main +# LOCAL local_main_at_Main_internal_38 --> -156($fp) +lw $t0, 12($s1) +sw $t0, -156($fp) +# LOCAL local_main_at_Main_internal_39 --> -160($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_60 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -160($fp) +# IF_ZERO local_main_at_Main_internal_38 GOTO label_FALSE_345 +# IF_ZERO local_main_at_Main_internal_38 GOTO label_FALSE_345 +lw $t0, -156($fp) +beq $t0, 0, label_FALSE_345 +# IF_ZERO local_main_at_Main_internal_39 GOTO label_FALSE_345 +# IF_ZERO local_main_at_Main_internal_39 GOTO label_FALSE_345 +lw $t0, -160($fp) +beq $t0, 0, label_FALSE_345 +# LOCAL local_main_at_Main_internal_37 --> -152($fp) +# LOCAL local_main_at_Main_internal_38 --> -156($fp) +# Comparing -156($fp) type with String +la $v0, String +lw $a0, -156($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -152($fp) +# IF_ZERO local_main_at_Main_internal_37 GOTO label_COMPARE_STRING_348 +# IF_ZERO local_main_at_Main_internal_37 GOTO label_COMPARE_STRING_348 +lw $t0, -152($fp) +beq $t0, 0, label_COMPARE_STRING_348 +# LOCAL local_main_at_Main_internal_37 --> -152($fp) +# LOCAL local_main_at_Main_internal_38 --> -156($fp) +# Comparing -156($fp) type with Bool +la $v0, Bool +lw $a0, -156($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -152($fp) +# IF_ZERO local_main_at_Main_internal_37 GOTO label_COMPARE_BY_VALUE_349 +# IF_ZERO local_main_at_Main_internal_37 GOTO label_COMPARE_BY_VALUE_349 +lw $t0, -152($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_349 +# LOCAL local_main_at_Main_internal_37 --> -152($fp) +# LOCAL local_main_at_Main_internal_38 --> -156($fp) +# Comparing -156($fp) type with Int +la $v0, Int +lw $a0, -156($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -152($fp) +# IF_ZERO local_main_at_Main_internal_37 GOTO label_COMPARE_BY_VALUE_349 +# IF_ZERO local_main_at_Main_internal_37 GOTO label_COMPARE_BY_VALUE_349 +lw $t0, -152($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_349 +# LOCAL local_main_at_Main_internal_37 --> -152($fp) +# LOCAL local_main_at_Main_internal_38 --> -156($fp) +# LOCAL local_main_at_Main_internal_39 --> -160($fp) +# Load pointers and SUB +lw $a0, -156($fp) +lw $a1, -160($fp) +sub $a0, $a0, $a1 +sw $a0, -152($fp) +# IF_ZERO local_main_at_Main_internal_37 GOTO label_TRUE_346 +# IF_ZERO local_main_at_Main_internal_37 GOTO label_TRUE_346 +lw $t0, -152($fp) +beq $t0, 0, label_TRUE_346 +# GOTO label_FALSE_345 +j label_FALSE_345 +label_COMPARE_BY_VALUE_349: + # LOCAL local_main_at_Main_internal_37 --> -152($fp) + # LOCAL local_main_at_Main_internal_38 --> -156($fp) + # LOCAL local_main_at_Main_internal_39 --> -160($fp) + lw $a0, -156($fp) + lw $a1, -160($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -152($fp) + # IF_ZERO local_main_at_Main_internal_37 GOTO label_TRUE_346 + # IF_ZERO local_main_at_Main_internal_37 GOTO label_TRUE_346 + lw $t0, -152($fp) + beq $t0, 0, label_TRUE_346 + # GOTO label_FALSE_345 + j label_FALSE_345 + label_COMPARE_STRING_348: + # LOCAL local_main_at_Main_internal_37 --> -152($fp) + # LOCAL local_main_at_Main_internal_38 --> -156($fp) + # LOCAL local_main_at_Main_internal_39 --> -160($fp) + # Load strings for comparison + lw $v0, -156($fp) + lw $v1, -160($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -152($fp) + # IF_ZERO local_main_at_Main_internal_37 GOTO label_CONTINUE_350 + # IF_ZERO local_main_at_Main_internal_37 GOTO label_CONTINUE_350 + lw $t0, -152($fp) + beq $t0, 0, label_CONTINUE_350 + # GOTO label_FALSE_345 + j label_FALSE_345 + label_CONTINUE_350: + # LOCAL local_main_at_Main_internal_37 --> -152($fp) + # LOCAL local_main_at_Main_internal_38 --> -156($fp) + # LOCAL local_main_at_Main_internal_39 --> -160($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -156($fp) + lw $v1, -160($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_351: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_352 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_351 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_352: + # Store result + sw $a2, -152($fp) + # IF_ZERO local_main_at_Main_internal_37 GOTO label_TRUE_346 + # IF_ZERO local_main_at_Main_internal_37 GOTO label_TRUE_346 + lw $t0, -152($fp) + beq $t0, 0, label_TRUE_346 + label_FALSE_345: + # LOCAL local_main_at_Main_internal_36 --> -148($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -148($fp) + # GOTO label_END_347 +j label_END_347 +label_TRUE_346: + # LOCAL local_main_at_Main_internal_36 --> -148($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -148($fp) + label_END_347: +# LOCAL local_main_at_Main_internal_34 --> -140($fp) +# LOCAL local_main_at_Main_internal_36 --> -148($fp) +# Obtain value from -148($fp) +lw $v0, -148($fp) +lw $v0, 12($v0) +sw $v0, -140($fp) +# IF_ZERO local_main_at_Main_internal_34 GOTO label_FALSEIF_343 +# IF_ZERO local_main_at_Main_internal_34 GOTO label_FALSEIF_343 +lw $t0, -140($fp) +beq $t0, 0, label_FALSEIF_343 +# LOCAL local_main_at_Main_internal_42 --> -172($fp) +# local_main_at_Main_internal_42 = ALLOCATE A +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, A +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, A_start +sw $t0, 4($v0) +# Load type offset +li $t0, 24 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -172($fp) +# LOCAL local_main_at_Main_internal_40 --> -164($fp) +# LOCAL local_main_at_Main_internal_42 --> -172($fp) +# local_main_at_Main_internal_40 = local_main_at_Main_internal_42 +lw $t0, -172($fp) +sw $t0, -164($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_45 --> -184($fp) +# local_main_at_Main_internal_45 = SELF +sw $s1, -184($fp) +# LOCAL local_main_at_Main_internal_43 --> -176($fp) +# LOCAL local_main_at_Main_internal_45 --> -184($fp) +# local_main_at_Main_internal_43 = local_main_at_Main_internal_45 +lw $t0, -184($fp) +sw $t0, -176($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_43 --> -176($fp) +# LOCAL local_main_at_Main_internal_44 --> -180($fp) +# local_main_at_Main_internal_44 = VCALL local_main_at_Main_internal_43 get_int +# Save new self pointer in $s1 +lw $s1, -176($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 112($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -180($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_44 +# LOCAL local_main_at_Main_internal_44 --> -180($fp) +lw $t0, -180($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_40 --> -164($fp) +# LOCAL local_main_at_Main_internal_41 --> -168($fp) +# local_main_at_Main_internal_41 = VCALL local_main_at_Main_internal_40 set_var +# Save new self pointer in $s1 +lw $s1, -164($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 116($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -168($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_main_at_Main_internal_41 --> -168($fp) +lw $t0, -168($fp) +sw $t0, 20($s1) +# LOCAL local_main_at_Main_internal_48 --> -196($fp) +# local_main_at_Main_internal_48 = ALLOCATE B +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, B +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, B_start +sw $t0, 4($v0) +# Load type offset +li $t0, 28 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -196($fp) +# LOCAL local_main_at_Main_internal_46 --> -188($fp) +# LOCAL local_main_at_Main_internal_48 --> -196($fp) +# local_main_at_Main_internal_46 = local_main_at_Main_internal_48 +lw $t0, -196($fp) +sw $t0, -188($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_main_at_Main_internal_51 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_51 --> -208($fp) +lw $t0, 16($s1) +sw $t0, -208($fp) +# LOCAL local_main_at_Main_internal_49 --> -200($fp) +# LOCAL local_main_at_Main_internal_51 --> -208($fp) +# local_main_at_Main_internal_49 = local_main_at_Main_internal_51 +lw $t0, -208($fp) +sw $t0, -200($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_49 --> -200($fp) +# LOCAL local_main_at_Main_internal_50 --> -204($fp) +# local_main_at_Main_internal_50 = VCALL local_main_at_Main_internal_49 value +# Save new self pointer in $s1 +lw $s1, -200($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 24($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -204($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_50 +# LOCAL local_main_at_Main_internal_50 --> -204($fp) +lw $t0, -204($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# local_main_at_Main_internal_54 = GETATTRIBUTE a_var Main +# LOCAL local_main_at_Main_internal_54 --> -220($fp) +lw $t0, 20($s1) +sw $t0, -220($fp) +# LOCAL local_main_at_Main_internal_52 --> -212($fp) +# LOCAL local_main_at_Main_internal_54 --> -220($fp) +# local_main_at_Main_internal_52 = local_main_at_Main_internal_54 +lw $t0, -220($fp) +sw $t0, -212($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_52 --> -212($fp) +# LOCAL local_main_at_Main_internal_53 --> -216($fp) +# local_main_at_Main_internal_53 = VCALL local_main_at_Main_internal_52 value +# Save new self pointer in $s1 +lw $s1, -212($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 24($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -216($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_53 +# LOCAL local_main_at_Main_internal_53 --> -216($fp) +lw $t0, -216($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_46 --> -188($fp) +# LOCAL local_main_at_Main_internal_47 --> -192($fp) +# local_main_at_Main_internal_47 = VCALL local_main_at_Main_internal_46 method2 +# Save new self pointer in $s1 +lw $s1, -188($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 84($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -192($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_main_at_Main_internal_47 --> -192($fp) +lw $t0, -192($fp) +sw $t0, 16($s1) +# LOCAL local_main_at_Main_internal_35 --> -144($fp) +# local_main_at_Main_internal_35 = +# GOTO label_ENDIF_344 +j label_ENDIF_344 +label_FALSEIF_343: + # local_main_at_Main_internal_59 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_59 --> -240($fp) + lw $t0, 12($s1) + sw $t0, -240($fp) + # LOCAL local_main_at_Main_internal_60 --> -244($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_61 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -244($fp) + # IF_ZERO local_main_at_Main_internal_59 GOTO label_FALSE_355 + # IF_ZERO local_main_at_Main_internal_59 GOTO label_FALSE_355 + lw $t0, -240($fp) + beq $t0, 0, label_FALSE_355 + # IF_ZERO local_main_at_Main_internal_60 GOTO label_FALSE_355 + # IF_ZERO local_main_at_Main_internal_60 GOTO label_FALSE_355 + lw $t0, -244($fp) + beq $t0, 0, label_FALSE_355 + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # LOCAL local_main_at_Main_internal_59 --> -240($fp) + # Comparing -240($fp) type with String + la $v0, String + lw $a0, -240($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -236($fp) + # IF_ZERO local_main_at_Main_internal_58 GOTO label_COMPARE_STRING_358 + # IF_ZERO local_main_at_Main_internal_58 GOTO label_COMPARE_STRING_358 + lw $t0, -236($fp) + beq $t0, 0, label_COMPARE_STRING_358 + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # LOCAL local_main_at_Main_internal_59 --> -240($fp) + # Comparing -240($fp) type with Bool + la $v0, Bool + lw $a0, -240($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -236($fp) + # IF_ZERO local_main_at_Main_internal_58 GOTO label_COMPARE_BY_VALUE_359 + # IF_ZERO local_main_at_Main_internal_58 GOTO label_COMPARE_BY_VALUE_359 + lw $t0, -236($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_359 + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # LOCAL local_main_at_Main_internal_59 --> -240($fp) + # Comparing -240($fp) type with Int + la $v0, Int + lw $a0, -240($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -236($fp) + # IF_ZERO local_main_at_Main_internal_58 GOTO label_COMPARE_BY_VALUE_359 + # IF_ZERO local_main_at_Main_internal_58 GOTO label_COMPARE_BY_VALUE_359 + lw $t0, -236($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_359 + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # LOCAL local_main_at_Main_internal_59 --> -240($fp) + # LOCAL local_main_at_Main_internal_60 --> -244($fp) + # Load pointers and SUB + lw $a0, -240($fp) + lw $a1, -244($fp) + sub $a0, $a0, $a1 + sw $a0, -236($fp) + # IF_ZERO local_main_at_Main_internal_58 GOTO label_TRUE_356 + # IF_ZERO local_main_at_Main_internal_58 GOTO label_TRUE_356 + lw $t0, -236($fp) + beq $t0, 0, label_TRUE_356 + # GOTO label_FALSE_355 + j label_FALSE_355 + label_COMPARE_BY_VALUE_359: + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # LOCAL local_main_at_Main_internal_59 --> -240($fp) + # LOCAL local_main_at_Main_internal_60 --> -244($fp) + lw $a0, -240($fp) + lw $a1, -244($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -236($fp) + # IF_ZERO local_main_at_Main_internal_58 GOTO label_TRUE_356 + # IF_ZERO local_main_at_Main_internal_58 GOTO label_TRUE_356 + lw $t0, -236($fp) + beq $t0, 0, label_TRUE_356 + # GOTO label_FALSE_355 + j label_FALSE_355 + label_COMPARE_STRING_358: + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # LOCAL local_main_at_Main_internal_59 --> -240($fp) + # LOCAL local_main_at_Main_internal_60 --> -244($fp) + # Load strings for comparison + lw $v0, -240($fp) + lw $v1, -244($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -236($fp) + # IF_ZERO local_main_at_Main_internal_58 GOTO label_CONTINUE_360 + # IF_ZERO local_main_at_Main_internal_58 GOTO label_CONTINUE_360 + lw $t0, -236($fp) + beq $t0, 0, label_CONTINUE_360 + # GOTO label_FALSE_355 + j label_FALSE_355 + label_CONTINUE_360: + # LOCAL local_main_at_Main_internal_58 --> -236($fp) + # LOCAL local_main_at_Main_internal_59 --> -240($fp) + # LOCAL local_main_at_Main_internal_60 --> -244($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -240($fp) + lw $v1, -244($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_361: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_362 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_361 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_362: + # Store result + sw $a2, -236($fp) + # IF_ZERO local_main_at_Main_internal_58 GOTO label_TRUE_356 + # IF_ZERO local_main_at_Main_internal_58 GOTO label_TRUE_356 + lw $t0, -236($fp) + beq $t0, 0, label_TRUE_356 + label_FALSE_355: + # LOCAL local_main_at_Main_internal_57 --> -232($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -232($fp) + # GOTO label_END_357 +j label_END_357 +label_TRUE_356: + # LOCAL local_main_at_Main_internal_57 --> -232($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -232($fp) + label_END_357: +# LOCAL local_main_at_Main_internal_55 --> -224($fp) +# LOCAL local_main_at_Main_internal_57 --> -232($fp) +# Obtain value from -232($fp) +lw $v0, -232($fp) +lw $v0, 12($v0) +sw $v0, -224($fp) +# IF_ZERO local_main_at_Main_internal_55 GOTO label_FALSEIF_353 +# IF_ZERO local_main_at_Main_internal_55 GOTO label_FALSEIF_353 +lw $t0, -224($fp) +beq $t0, 0, label_FALSEIF_353 +# local_main_at_Main_internal_61 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_61 --> -248($fp) +lw $t0, 16($s1) +sw $t0, -248($fp) +# LOCAL local_main_at_Main_internal_61 --> -248($fp) +# LOCAL local_main_at_Main_internal_62 --> -252($fp) +# local_main_at_Main_internal_62 = TYPEOF local_main_at_Main_internal_61 +lw $t0, -248($fp) +# Load pointer to type offset +lw $t1, 8($t0) +sw $t1, -252($fp) +# LOCAL local_main_at_Main_internal_65 --> -264($fp) +# local_main_at_Main_internal_65 = 15 +li $t0, 15 +sw $t0, -264($fp) +# local_main_at_Main_internal_66 = TYPE_DISTANCE C +# LOCAL local_main_at_Main_internal_66 --> -268($fp) +# LOCAL local_main_at_Main_internal_62 --> -252($fp) +# Load TDT pointer to type C +la $t0, C__TDT +lw $t1, -252($fp) +addu $t0, $t0, $t1 +# Save distance +lw $t1, 0($t0) +sw $t1, -268($fp) +# LOCAL local_main_at_Main_internal_66 --> -268($fp) +# LOCAL local_main_at_Main_internal_65 --> -264($fp) +# Update min if 8 < 9 +lw $t0, -268($fp) +lw $t1, -264($fp) +bgtu $t0, $t1, label_Not_min0_363 +# LOCAL local_main_at_Main_internal_65 --> -264($fp) +# LOCAL local_main_at_Main_internal_66 --> -268($fp) +# local_main_at_Main_internal_65 = local_main_at_Main_internal_66 +lw $t0, -268($fp) +sw $t0, -264($fp) +label_Not_min0_363: + # local_main_at_Main_internal_66 = TYPE_DISTANCE A + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # LOCAL local_main_at_Main_internal_62 --> -252($fp) + # Load TDT pointer to type A + la $t0, A__TDT + lw $t1, -252($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -268($fp) + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # LOCAL local_main_at_Main_internal_65 --> -264($fp) + # Update min if 8 < 9 + lw $t0, -268($fp) + lw $t1, -264($fp) + bgtu $t0, $t1, label_Not_min1_364 + # LOCAL local_main_at_Main_internal_65 --> -264($fp) + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # local_main_at_Main_internal_65 = local_main_at_Main_internal_66 + lw $t0, -268($fp) + sw $t0, -264($fp) + label_Not_min1_364: + # local_main_at_Main_internal_66 = TYPE_DISTANCE Object + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # LOCAL local_main_at_Main_internal_62 --> -252($fp) + # Load TDT pointer to type Object + la $t0, Object__TDT + lw $t1, -252($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -268($fp) + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # LOCAL local_main_at_Main_internal_65 --> -264($fp) + # Update min if 8 < 9 + lw $t0, -268($fp) + lw $t1, -264($fp) + bgtu $t0, $t1, label_Not_min2_365 + # LOCAL local_main_at_Main_internal_65 --> -264($fp) + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # local_main_at_Main_internal_65 = local_main_at_Main_internal_66 + lw $t0, -268($fp) + sw $t0, -264($fp) + label_Not_min2_365: + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # local_main_at_Main_internal_66 = 15 + li $t0, 15 + sw $t0, -268($fp) + # LOCAL local_main_at_Main_internal_63 --> -256($fp) + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # LOCAL local_main_at_Main_internal_65 --> -264($fp) + # Load pointers and SUB + lw $a0, -268($fp) + lw $a1, -264($fp) + sub $a0, $a0, $a1 + sw $a0, -256($fp) + # IF_ZERO local_main_at_Main_internal_63 GOTO label_ERROR_366 + # IF_ZERO local_main_at_Main_internal_63 GOTO label_ERROR_366 + lw $t0, -256($fp) + beq $t0, 0, label_ERROR_366 + # local_main_at_Main_internal_66 = TYPE_DISTANCE C + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # LOCAL local_main_at_Main_internal_62 --> -252($fp) + # Load TDT pointer to type C + la $t0, C__TDT + lw $t1, -252($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -268($fp) + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # LOCAL local_main_at_Main_internal_65 --> -264($fp) + # Update min if 8 < 9 + lw $t0, -268($fp) + lw $t1, -264($fp) + bgtu $t0, $t1, label_NEXT0_368 + # LOCAL local_main_at_Main_c_67 --> -272($fp) + # LOCAL local_main_at_Main_internal_61 --> -248($fp) + # local_main_at_Main_c_67 = local_main_at_Main_internal_61 + lw $t0, -248($fp) + sw $t0, -272($fp) + # LOCAL local_main_at_Main_internal_68 --> -276($fp) + # LOCAL local_main_at_Main_c_67 --> -272($fp) + # local_main_at_Main_internal_68 = local_main_at_Main_c_67 + lw $t0, -272($fp) + sw $t0, -276($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_70 --> -284($fp) + # LOCAL local_main_at_Main_c_67 --> -272($fp) + # local_main_at_Main_internal_70 = local_main_at_Main_c_67 + lw $t0, -272($fp) + sw $t0, -284($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_70 --> -284($fp) + # LOCAL local_main_at_Main_internal_71 --> -288($fp) + # local_main_at_Main_internal_71 = VCALL local_main_at_Main_internal_70 value + # Save new self pointer in $s1 + lw $s1, -284($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 24($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -288($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_71 + # LOCAL local_main_at_Main_internal_71 --> -288($fp) + lw $t0, -288($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_68 --> -276($fp) + # LOCAL local_main_at_Main_internal_69 --> -280($fp) + # local_main_at_Main_internal_69 = VCALL local_main_at_Main_internal_68 method6 + # Save new self pointer in $s1 + lw $s1, -276($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -280($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_69 --> -280($fp) + lw $t0, -280($fp) + sw $t0, 16($s1) + # LOCAL local_main_at_Main_internal_64 --> -260($fp) + # local_main_at_Main_internal_64 = + # GOTO label_END_367 +j label_END_367 +label_NEXT0_368: + # local_main_at_Main_internal_66 = TYPE_DISTANCE A + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # LOCAL local_main_at_Main_internal_62 --> -252($fp) + # Load TDT pointer to type A + la $t0, A__TDT + lw $t1, -252($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -268($fp) + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # LOCAL local_main_at_Main_internal_65 --> -264($fp) + # Update min if 8 < 9 + lw $t0, -268($fp) + lw $t1, -264($fp) + bgtu $t0, $t1, label_NEXT1_369 + # LOCAL local_main_at_Main_a_72 --> -292($fp) + # LOCAL local_main_at_Main_internal_61 --> -248($fp) + # local_main_at_Main_a_72 = local_main_at_Main_internal_61 + lw $t0, -248($fp) + sw $t0, -292($fp) + # LOCAL local_main_at_Main_internal_73 --> -296($fp) + # LOCAL local_main_at_Main_a_72 --> -292($fp) + # local_main_at_Main_internal_73 = local_main_at_Main_a_72 + lw $t0, -292($fp) + sw $t0, -296($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_75 --> -304($fp) + # LOCAL local_main_at_Main_a_72 --> -292($fp) + # local_main_at_Main_internal_75 = local_main_at_Main_a_72 + lw $t0, -292($fp) + sw $t0, -304($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_75 --> -304($fp) + # LOCAL local_main_at_Main_internal_76 --> -308($fp) + # local_main_at_Main_internal_76 = VCALL local_main_at_Main_internal_75 value + # Save new self pointer in $s1 + lw $s1, -304($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 24($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -308($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_76 + # LOCAL local_main_at_Main_internal_76 --> -308($fp) + lw $t0, -308($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_73 --> -296($fp) + # LOCAL local_main_at_Main_internal_74 --> -300($fp) + # local_main_at_Main_internal_74 = VCALL local_main_at_Main_internal_73 method3 + # Save new self pointer in $s1 + lw $s1, -296($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 72($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -300($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_74 --> -300($fp) + lw $t0, -300($fp) + sw $t0, 16($s1) + # LOCAL local_main_at_Main_internal_64 --> -260($fp) + # local_main_at_Main_internal_64 = + # GOTO label_END_367 +j label_END_367 +label_NEXT1_369: + # local_main_at_Main_internal_66 = TYPE_DISTANCE Object + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # LOCAL local_main_at_Main_internal_62 --> -252($fp) + # Load TDT pointer to type Object + la $t0, Object__TDT + lw $t1, -252($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -268($fp) + # LOCAL local_main_at_Main_internal_66 --> -268($fp) + # LOCAL local_main_at_Main_internal_65 --> -264($fp) + # Update min if 8 < 9 + lw $t0, -268($fp) + lw $t1, -264($fp) + bgtu $t0, $t1, label_NEXT2_370 + # LOCAL local_main_at_Main_o_77 --> -312($fp) + # LOCAL local_main_at_Main_internal_61 --> -248($fp) + # local_main_at_Main_o_77 = local_main_at_Main_internal_61 + lw $t0, -248($fp) + sw $t0, -312($fp) + # LOCAL local_main_at_Main_internal_80 --> -324($fp) + # local_main_at_Main_internal_80 = SELF + sw $s1, -324($fp) + # LOCAL local_main_at_Main_internal_78 --> -316($fp) + # LOCAL local_main_at_Main_internal_80 --> -324($fp) + # local_main_at_Main_internal_78 = local_main_at_Main_internal_80 + lw $t0, -324($fp) + sw $t0, -316($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_81 --> -328($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_62 + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + sw $v0, -328($fp) + # ARG local_main_at_Main_internal_81 + # LOCAL local_main_at_Main_internal_81 --> -328($fp) + lw $t0, -328($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_78 --> -316($fp) + # LOCAL local_main_at_Main_internal_79 --> -320($fp) + # local_main_at_Main_internal_79 = VCALL local_main_at_Main_internal_78 out_string + # Save new self pointer in $s1 + lw $s1, -316($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -320($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_84 --> -340($fp) + # local_main_at_Main_internal_84 = SELF + sw $s1, -340($fp) + # LOCAL local_main_at_Main_internal_82 --> -332($fp) + # LOCAL local_main_at_Main_internal_84 --> -340($fp) + # local_main_at_Main_internal_82 = local_main_at_Main_internal_84 + lw $t0, -340($fp) + sw $t0, -332($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_82 --> -332($fp) + # LOCAL local_main_at_Main_internal_83 --> -336($fp) + # local_main_at_Main_internal_83 = VCALL local_main_at_Main_internal_82 abort + # Save new self pointer in $s1 + lw $s1, -332($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 88($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -336($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_85 --> -344($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -344($fp) + # LOCAL local_main_at_Main_internal_64 --> -260($fp) + # LOCAL local_main_at_Main_internal_85 --> -344($fp) + # local_main_at_Main_internal_64 = local_main_at_Main_internal_85 + lw $t0, -344($fp) + sw $t0, -260($fp) + # GOTO label_END_367 +j label_END_367 +label_NEXT2_370: + label_ERROR_366: + # LOCAL local_main_at_Main_internal_61 --> -248($fp) + lw $t0, 0($s1) + sw $t0, -248($fp) + # LOCAL local_main_at_Main_internal_61 --> -248($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -248($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + label_END_367: +# LOCAL local_main_at_Main_internal_56 --> -228($fp) +# LOCAL local_main_at_Main_internal_64 --> -260($fp) +# local_main_at_Main_internal_56 = local_main_at_Main_internal_64 +lw $t0, -260($fp) +sw $t0, -228($fp) +# GOTO label_ENDIF_354 +j label_ENDIF_354 +label_FALSEIF_353: + # local_main_at_Main_internal_90 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_90 --> -364($fp) + lw $t0, 12($s1) + sw $t0, -364($fp) + # LOCAL local_main_at_Main_internal_91 --> -368($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_63 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -368($fp) + # IF_ZERO local_main_at_Main_internal_90 GOTO label_FALSE_373 + # IF_ZERO local_main_at_Main_internal_90 GOTO label_FALSE_373 + lw $t0, -364($fp) + beq $t0, 0, label_FALSE_373 + # IF_ZERO local_main_at_Main_internal_91 GOTO label_FALSE_373 + # IF_ZERO local_main_at_Main_internal_91 GOTO label_FALSE_373 + lw $t0, -368($fp) + beq $t0, 0, label_FALSE_373 + # LOCAL local_main_at_Main_internal_89 --> -360($fp) + # LOCAL local_main_at_Main_internal_90 --> -364($fp) + # Comparing -364($fp) type with String + la $v0, String + lw $a0, -364($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -360($fp) + # IF_ZERO local_main_at_Main_internal_89 GOTO label_COMPARE_STRING_376 + # IF_ZERO local_main_at_Main_internal_89 GOTO label_COMPARE_STRING_376 + lw $t0, -360($fp) + beq $t0, 0, label_COMPARE_STRING_376 + # LOCAL local_main_at_Main_internal_89 --> -360($fp) + # LOCAL local_main_at_Main_internal_90 --> -364($fp) + # Comparing -364($fp) type with Bool + la $v0, Bool + lw $a0, -364($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -360($fp) + # IF_ZERO local_main_at_Main_internal_89 GOTO label_COMPARE_BY_VALUE_377 + # IF_ZERO local_main_at_Main_internal_89 GOTO label_COMPARE_BY_VALUE_377 + lw $t0, -360($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_377 + # LOCAL local_main_at_Main_internal_89 --> -360($fp) + # LOCAL local_main_at_Main_internal_90 --> -364($fp) + # Comparing -364($fp) type with Int + la $v0, Int + lw $a0, -364($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -360($fp) + # IF_ZERO local_main_at_Main_internal_89 GOTO label_COMPARE_BY_VALUE_377 + # IF_ZERO local_main_at_Main_internal_89 GOTO label_COMPARE_BY_VALUE_377 + lw $t0, -360($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_377 + # LOCAL local_main_at_Main_internal_89 --> -360($fp) + # LOCAL local_main_at_Main_internal_90 --> -364($fp) + # LOCAL local_main_at_Main_internal_91 --> -368($fp) + # Load pointers and SUB + lw $a0, -364($fp) + lw $a1, -368($fp) + sub $a0, $a0, $a1 + sw $a0, -360($fp) + # IF_ZERO local_main_at_Main_internal_89 GOTO label_TRUE_374 + # IF_ZERO local_main_at_Main_internal_89 GOTO label_TRUE_374 + lw $t0, -360($fp) + beq $t0, 0, label_TRUE_374 + # GOTO label_FALSE_373 + j label_FALSE_373 + label_COMPARE_BY_VALUE_377: + # LOCAL local_main_at_Main_internal_89 --> -360($fp) + # LOCAL local_main_at_Main_internal_90 --> -364($fp) + # LOCAL local_main_at_Main_internal_91 --> -368($fp) + lw $a0, -364($fp) + lw $a1, -368($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -360($fp) + # IF_ZERO local_main_at_Main_internal_89 GOTO label_TRUE_374 + # IF_ZERO local_main_at_Main_internal_89 GOTO label_TRUE_374 + lw $t0, -360($fp) + beq $t0, 0, label_TRUE_374 + # GOTO label_FALSE_373 + j label_FALSE_373 + label_COMPARE_STRING_376: + # LOCAL local_main_at_Main_internal_89 --> -360($fp) + # LOCAL local_main_at_Main_internal_90 --> -364($fp) + # LOCAL local_main_at_Main_internal_91 --> -368($fp) + # Load strings for comparison + lw $v0, -364($fp) + lw $v1, -368($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -360($fp) + # IF_ZERO local_main_at_Main_internal_89 GOTO label_CONTINUE_378 + # IF_ZERO local_main_at_Main_internal_89 GOTO label_CONTINUE_378 + lw $t0, -360($fp) + beq $t0, 0, label_CONTINUE_378 + # GOTO label_FALSE_373 + j label_FALSE_373 + label_CONTINUE_378: + # LOCAL local_main_at_Main_internal_89 --> -360($fp) + # LOCAL local_main_at_Main_internal_90 --> -364($fp) + # LOCAL local_main_at_Main_internal_91 --> -368($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -364($fp) + lw $v1, -368($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_379: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_380 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_379 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_380: + # Store result + sw $a2, -360($fp) + # IF_ZERO local_main_at_Main_internal_89 GOTO label_TRUE_374 + # IF_ZERO local_main_at_Main_internal_89 GOTO label_TRUE_374 + lw $t0, -360($fp) + beq $t0, 0, label_TRUE_374 + label_FALSE_373: + # LOCAL local_main_at_Main_internal_88 --> -356($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -356($fp) + # GOTO label_END_375 +j label_END_375 +label_TRUE_374: + # LOCAL local_main_at_Main_internal_88 --> -356($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -356($fp) + label_END_375: +# LOCAL local_main_at_Main_internal_86 --> -348($fp) +# LOCAL local_main_at_Main_internal_88 --> -356($fp) +# Obtain value from -356($fp) +lw $v0, -356($fp) +lw $v0, 12($v0) +sw $v0, -348($fp) +# IF_ZERO local_main_at_Main_internal_86 GOTO label_FALSEIF_371 +# IF_ZERO local_main_at_Main_internal_86 GOTO label_FALSEIF_371 +lw $t0, -348($fp) +beq $t0, 0, label_FALSEIF_371 +# LOCAL local_main_at_Main_internal_94 --> -380($fp) +# local_main_at_Main_internal_94 = ALLOCATE A +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, A +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, A_start +sw $t0, 4($v0) +# Load type offset +li $t0, 24 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -380($fp) +# LOCAL local_main_at_Main_internal_92 --> -372($fp) +# LOCAL local_main_at_Main_internal_94 --> -380($fp) +# local_main_at_Main_internal_92 = local_main_at_Main_internal_94 +lw $t0, -380($fp) +sw $t0, -372($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_97 --> -392($fp) +# local_main_at_Main_internal_97 = SELF +sw $s1, -392($fp) +# LOCAL local_main_at_Main_internal_95 --> -384($fp) +# LOCAL local_main_at_Main_internal_97 --> -392($fp) +# local_main_at_Main_internal_95 = local_main_at_Main_internal_97 +lw $t0, -392($fp) +sw $t0, -384($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_95 --> -384($fp) +# LOCAL local_main_at_Main_internal_96 --> -388($fp) +# local_main_at_Main_internal_96 = VCALL local_main_at_Main_internal_95 get_int +# Save new self pointer in $s1 +lw $s1, -384($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 112($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -388($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_96 +# LOCAL local_main_at_Main_internal_96 --> -388($fp) +lw $t0, -388($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_92 --> -372($fp) +# LOCAL local_main_at_Main_internal_93 --> -376($fp) +# local_main_at_Main_internal_93 = VCALL local_main_at_Main_internal_92 set_var +# Save new self pointer in $s1 +lw $s1, -372($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 116($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -376($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_main_at_Main_internal_93 --> -376($fp) +lw $t0, -376($fp) +sw $t0, 20($s1) +# LOCAL local_main_at_Main_internal_100 --> -404($fp) +# local_main_at_Main_internal_100 = ALLOCATE D +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, D +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, D_start +sw $t0, 4($v0) +# Load type offset +li $t0, 32 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -404($fp) +# LOCAL local_main_at_Main_internal_98 --> -396($fp) +# LOCAL local_main_at_Main_internal_100 --> -404($fp) +# local_main_at_Main_internal_98 = local_main_at_Main_internal_100 +lw $t0, -404($fp) +sw $t0, -396($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_main_at_Main_internal_103 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_103 --> -416($fp) +lw $t0, 16($s1) +sw $t0, -416($fp) +# LOCAL local_main_at_Main_internal_101 --> -408($fp) +# LOCAL local_main_at_Main_internal_103 --> -416($fp) +# local_main_at_Main_internal_101 = local_main_at_Main_internal_103 +lw $t0, -416($fp) +sw $t0, -408($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_101 --> -408($fp) +# LOCAL local_main_at_Main_internal_102 --> -412($fp) +# local_main_at_Main_internal_102 = VCALL local_main_at_Main_internal_101 value +# Save new self pointer in $s1 +lw $s1, -408($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 24($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -412($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_102 +# LOCAL local_main_at_Main_internal_102 --> -412($fp) +lw $t0, -412($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# local_main_at_Main_internal_106 = GETATTRIBUTE a_var Main +# LOCAL local_main_at_Main_internal_106 --> -428($fp) +lw $t0, 20($s1) +sw $t0, -428($fp) +# LOCAL local_main_at_Main_internal_104 --> -420($fp) +# LOCAL local_main_at_Main_internal_106 --> -428($fp) +# local_main_at_Main_internal_104 = local_main_at_Main_internal_106 +lw $t0, -428($fp) +sw $t0, -420($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_104 --> -420($fp) +# LOCAL local_main_at_Main_internal_105 --> -424($fp) +# local_main_at_Main_internal_105 = VCALL local_main_at_Main_internal_104 value +# Save new self pointer in $s1 +lw $s1, -420($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 24($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -424($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_105 +# LOCAL local_main_at_Main_internal_105 --> -424($fp) +lw $t0, -424($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_98 --> -396($fp) +# LOCAL local_main_at_Main_internal_99 --> -400($fp) +# local_main_at_Main_internal_99 = VCALL local_main_at_Main_internal_98 method4 +# Save new self pointer in $s1 +lw $s1, -396($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 8($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -400($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_main_at_Main_internal_99 --> -400($fp) +lw $t0, -400($fp) +sw $t0, 16($s1) +# LOCAL local_main_at_Main_internal_87 --> -352($fp) +# local_main_at_Main_internal_87 = +# GOTO label_ENDIF_372 +j label_ENDIF_372 +label_FALSEIF_371: + # local_main_at_Main_internal_111 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_111 --> -448($fp) + lw $t0, 12($s1) + sw $t0, -448($fp) + # LOCAL local_main_at_Main_internal_112 --> -452($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_64 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -452($fp) + # IF_ZERO local_main_at_Main_internal_111 GOTO label_FALSE_383 + # IF_ZERO local_main_at_Main_internal_111 GOTO label_FALSE_383 + lw $t0, -448($fp) + beq $t0, 0, label_FALSE_383 + # IF_ZERO local_main_at_Main_internal_112 GOTO label_FALSE_383 + # IF_ZERO local_main_at_Main_internal_112 GOTO label_FALSE_383 + lw $t0, -452($fp) + beq $t0, 0, label_FALSE_383 + # LOCAL local_main_at_Main_internal_110 --> -444($fp) + # LOCAL local_main_at_Main_internal_111 --> -448($fp) + # Comparing -448($fp) type with String + la $v0, String + lw $a0, -448($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -444($fp) + # IF_ZERO local_main_at_Main_internal_110 GOTO label_COMPARE_STRING_386 + # IF_ZERO local_main_at_Main_internal_110 GOTO label_COMPARE_STRING_386 + lw $t0, -444($fp) + beq $t0, 0, label_COMPARE_STRING_386 + # LOCAL local_main_at_Main_internal_110 --> -444($fp) + # LOCAL local_main_at_Main_internal_111 --> -448($fp) + # Comparing -448($fp) type with Bool + la $v0, Bool + lw $a0, -448($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -444($fp) + # IF_ZERO local_main_at_Main_internal_110 GOTO label_COMPARE_BY_VALUE_387 + # IF_ZERO local_main_at_Main_internal_110 GOTO label_COMPARE_BY_VALUE_387 + lw $t0, -444($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_387 + # LOCAL local_main_at_Main_internal_110 --> -444($fp) + # LOCAL local_main_at_Main_internal_111 --> -448($fp) + # Comparing -448($fp) type with Int + la $v0, Int + lw $a0, -448($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -444($fp) + # IF_ZERO local_main_at_Main_internal_110 GOTO label_COMPARE_BY_VALUE_387 + # IF_ZERO local_main_at_Main_internal_110 GOTO label_COMPARE_BY_VALUE_387 + lw $t0, -444($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_387 + # LOCAL local_main_at_Main_internal_110 --> -444($fp) + # LOCAL local_main_at_Main_internal_111 --> -448($fp) + # LOCAL local_main_at_Main_internal_112 --> -452($fp) + # Load pointers and SUB + lw $a0, -448($fp) + lw $a1, -452($fp) + sub $a0, $a0, $a1 + sw $a0, -444($fp) + # IF_ZERO local_main_at_Main_internal_110 GOTO label_TRUE_384 + # IF_ZERO local_main_at_Main_internal_110 GOTO label_TRUE_384 + lw $t0, -444($fp) + beq $t0, 0, label_TRUE_384 + # GOTO label_FALSE_383 + j label_FALSE_383 + label_COMPARE_BY_VALUE_387: + # LOCAL local_main_at_Main_internal_110 --> -444($fp) + # LOCAL local_main_at_Main_internal_111 --> -448($fp) + # LOCAL local_main_at_Main_internal_112 --> -452($fp) + lw $a0, -448($fp) + lw $a1, -452($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -444($fp) + # IF_ZERO local_main_at_Main_internal_110 GOTO label_TRUE_384 + # IF_ZERO local_main_at_Main_internal_110 GOTO label_TRUE_384 + lw $t0, -444($fp) + beq $t0, 0, label_TRUE_384 + # GOTO label_FALSE_383 + j label_FALSE_383 + label_COMPARE_STRING_386: + # LOCAL local_main_at_Main_internal_110 --> -444($fp) + # LOCAL local_main_at_Main_internal_111 --> -448($fp) + # LOCAL local_main_at_Main_internal_112 --> -452($fp) + # Load strings for comparison + lw $v0, -448($fp) + lw $v1, -452($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -444($fp) + # IF_ZERO local_main_at_Main_internal_110 GOTO label_CONTINUE_388 + # IF_ZERO local_main_at_Main_internal_110 GOTO label_CONTINUE_388 + lw $t0, -444($fp) + beq $t0, 0, label_CONTINUE_388 + # GOTO label_FALSE_383 + j label_FALSE_383 + label_CONTINUE_388: + # LOCAL local_main_at_Main_internal_110 --> -444($fp) + # LOCAL local_main_at_Main_internal_111 --> -448($fp) + # LOCAL local_main_at_Main_internal_112 --> -452($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -448($fp) + lw $v1, -452($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_389: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_390 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_389 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_390: + # Store result + sw $a2, -444($fp) + # IF_ZERO local_main_at_Main_internal_110 GOTO label_TRUE_384 + # IF_ZERO local_main_at_Main_internal_110 GOTO label_TRUE_384 + lw $t0, -444($fp) + beq $t0, 0, label_TRUE_384 + label_FALSE_383: + # LOCAL local_main_at_Main_internal_109 --> -440($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -440($fp) + # GOTO label_END_385 +j label_END_385 +label_TRUE_384: + # LOCAL local_main_at_Main_internal_109 --> -440($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -440($fp) + label_END_385: +# LOCAL local_main_at_Main_internal_107 --> -432($fp) +# LOCAL local_main_at_Main_internal_109 --> -440($fp) +# Obtain value from -440($fp) +lw $v0, -440($fp) +lw $v0, 12($v0) +sw $v0, -432($fp) +# IF_ZERO local_main_at_Main_internal_107 GOTO label_FALSEIF_381 +# IF_ZERO local_main_at_Main_internal_107 GOTO label_FALSEIF_381 +lw $t0, -432($fp) +beq $t0, 0, label_FALSEIF_381 +# LOCAL local_main_at_Main_internal_114 --> -460($fp) +# local_main_at_Main_internal_114 = ALLOCATE C +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, C +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, C_start +sw $t0, 4($v0) +# Load type offset +li $t0, 40 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -460($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_main_at_Main_internal_117 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_117 --> -472($fp) +lw $t0, 16($s1) +sw $t0, -472($fp) +# LOCAL local_main_at_Main_internal_115 --> -464($fp) +# LOCAL local_main_at_Main_internal_117 --> -472($fp) +# local_main_at_Main_internal_115 = local_main_at_Main_internal_117 +lw $t0, -472($fp) +sw $t0, -464($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_115 --> -464($fp) +# LOCAL local_main_at_Main_internal_116 --> -468($fp) +# local_main_at_Main_internal_116 = VCALL local_main_at_Main_internal_115 value +# Save new self pointer in $s1 +lw $s1, -464($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 24($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -468($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_116 +# LOCAL local_main_at_Main_internal_116 --> -468($fp) +lw $t0, -468($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# local_main_at_Main_internal_113 = CALL method5 +# LOCAL local_main_at_Main_internal_113 --> -456($fp) +# LOCAL local_main_at_Main_internal_114 --> -460($fp) +# Save new self pointer in $s1 +lw $s1, -460($fp) +# Get pointer to type's VTABLE +la $t0, A_vtable +# Get pointer to function address +lw $t1, 28($t0) +# Call function. Result is on $v0 +jalr $t1 +sw $v0, -456($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_main_at_Main_internal_113 --> -456($fp) +lw $t0, -456($fp) +sw $t0, 16($s1) +# LOCAL local_main_at_Main_internal_108 --> -436($fp) +# local_main_at_Main_internal_108 = +# GOTO label_ENDIF_382 +j label_ENDIF_382 +label_FALSEIF_381: + # local_main_at_Main_internal_122 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_122 --> -492($fp) + lw $t0, 12($s1) + sw $t0, -492($fp) + # LOCAL local_main_at_Main_internal_123 --> -496($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_65 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -496($fp) + # IF_ZERO local_main_at_Main_internal_122 GOTO label_FALSE_393 + # IF_ZERO local_main_at_Main_internal_122 GOTO label_FALSE_393 + lw $t0, -492($fp) + beq $t0, 0, label_FALSE_393 + # IF_ZERO local_main_at_Main_internal_123 GOTO label_FALSE_393 + # IF_ZERO local_main_at_Main_internal_123 GOTO label_FALSE_393 + lw $t0, -496($fp) + beq $t0, 0, label_FALSE_393 + # LOCAL local_main_at_Main_internal_121 --> -488($fp) + # LOCAL local_main_at_Main_internal_122 --> -492($fp) + # Comparing -492($fp) type with String + la $v0, String + lw $a0, -492($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -488($fp) + # IF_ZERO local_main_at_Main_internal_121 GOTO label_COMPARE_STRING_396 + # IF_ZERO local_main_at_Main_internal_121 GOTO label_COMPARE_STRING_396 + lw $t0, -488($fp) + beq $t0, 0, label_COMPARE_STRING_396 + # LOCAL local_main_at_Main_internal_121 --> -488($fp) + # LOCAL local_main_at_Main_internal_122 --> -492($fp) + # Comparing -492($fp) type with Bool + la $v0, Bool + lw $a0, -492($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -488($fp) + # IF_ZERO local_main_at_Main_internal_121 GOTO label_COMPARE_BY_VALUE_397 + # IF_ZERO local_main_at_Main_internal_121 GOTO label_COMPARE_BY_VALUE_397 + lw $t0, -488($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_397 + # LOCAL local_main_at_Main_internal_121 --> -488($fp) + # LOCAL local_main_at_Main_internal_122 --> -492($fp) + # Comparing -492($fp) type with Int + la $v0, Int + lw $a0, -492($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -488($fp) + # IF_ZERO local_main_at_Main_internal_121 GOTO label_COMPARE_BY_VALUE_397 + # IF_ZERO local_main_at_Main_internal_121 GOTO label_COMPARE_BY_VALUE_397 + lw $t0, -488($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_397 + # LOCAL local_main_at_Main_internal_121 --> -488($fp) + # LOCAL local_main_at_Main_internal_122 --> -492($fp) + # LOCAL local_main_at_Main_internal_123 --> -496($fp) + # Load pointers and SUB + lw $a0, -492($fp) + lw $a1, -496($fp) + sub $a0, $a0, $a1 + sw $a0, -488($fp) + # IF_ZERO local_main_at_Main_internal_121 GOTO label_TRUE_394 + # IF_ZERO local_main_at_Main_internal_121 GOTO label_TRUE_394 + lw $t0, -488($fp) + beq $t0, 0, label_TRUE_394 + # GOTO label_FALSE_393 + j label_FALSE_393 + label_COMPARE_BY_VALUE_397: + # LOCAL local_main_at_Main_internal_121 --> -488($fp) + # LOCAL local_main_at_Main_internal_122 --> -492($fp) + # LOCAL local_main_at_Main_internal_123 --> -496($fp) + lw $a0, -492($fp) + lw $a1, -496($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -488($fp) + # IF_ZERO local_main_at_Main_internal_121 GOTO label_TRUE_394 + # IF_ZERO local_main_at_Main_internal_121 GOTO label_TRUE_394 + lw $t0, -488($fp) + beq $t0, 0, label_TRUE_394 + # GOTO label_FALSE_393 + j label_FALSE_393 + label_COMPARE_STRING_396: + # LOCAL local_main_at_Main_internal_121 --> -488($fp) + # LOCAL local_main_at_Main_internal_122 --> -492($fp) + # LOCAL local_main_at_Main_internal_123 --> -496($fp) + # Load strings for comparison + lw $v0, -492($fp) + lw $v1, -496($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -488($fp) + # IF_ZERO local_main_at_Main_internal_121 GOTO label_CONTINUE_398 + # IF_ZERO local_main_at_Main_internal_121 GOTO label_CONTINUE_398 + lw $t0, -488($fp) + beq $t0, 0, label_CONTINUE_398 + # GOTO label_FALSE_393 + j label_FALSE_393 + label_CONTINUE_398: + # LOCAL local_main_at_Main_internal_121 --> -488($fp) + # LOCAL local_main_at_Main_internal_122 --> -492($fp) + # LOCAL local_main_at_Main_internal_123 --> -496($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -492($fp) + lw $v1, -496($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_399: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_400 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_399 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_400: + # Store result + sw $a2, -488($fp) + # IF_ZERO local_main_at_Main_internal_121 GOTO label_TRUE_394 + # IF_ZERO local_main_at_Main_internal_121 GOTO label_TRUE_394 + lw $t0, -488($fp) + beq $t0, 0, label_TRUE_394 + label_FALSE_393: + # LOCAL local_main_at_Main_internal_120 --> -484($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -484($fp) + # GOTO label_END_395 +j label_END_395 +label_TRUE_394: + # LOCAL local_main_at_Main_internal_120 --> -484($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -484($fp) + label_END_395: +# LOCAL local_main_at_Main_internal_118 --> -476($fp) +# LOCAL local_main_at_Main_internal_120 --> -484($fp) +# Obtain value from -484($fp) +lw $v0, -484($fp) +lw $v0, 12($v0) +sw $v0, -476($fp) +# IF_ZERO local_main_at_Main_internal_118 GOTO label_FALSEIF_391 +# IF_ZERO local_main_at_Main_internal_118 GOTO label_FALSEIF_391 +lw $t0, -476($fp) +beq $t0, 0, label_FALSEIF_391 +# LOCAL local_main_at_Main_internal_125 --> -504($fp) +# local_main_at_Main_internal_125 = ALLOCATE C +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, C +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, C_start +sw $t0, 4($v0) +# Load type offset +li $t0, 40 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -504($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_main_at_Main_internal_128 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_128 --> -516($fp) +lw $t0, 16($s1) +sw $t0, -516($fp) +# LOCAL local_main_at_Main_internal_126 --> -508($fp) +# LOCAL local_main_at_Main_internal_128 --> -516($fp) +# local_main_at_Main_internal_126 = local_main_at_Main_internal_128 +lw $t0, -516($fp) +sw $t0, -508($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_126 --> -508($fp) +# LOCAL local_main_at_Main_internal_127 --> -512($fp) +# local_main_at_Main_internal_127 = VCALL local_main_at_Main_internal_126 value +# Save new self pointer in $s1 +lw $s1, -508($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 24($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -512($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_127 +# LOCAL local_main_at_Main_internal_127 --> -512($fp) +lw $t0, -512($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# local_main_at_Main_internal_124 = CALL method5 +# LOCAL local_main_at_Main_internal_124 --> -500($fp) +# LOCAL local_main_at_Main_internal_125 --> -504($fp) +# Save new self pointer in $s1 +lw $s1, -504($fp) +# Get pointer to type's VTABLE +la $t0, B_vtable +# Get pointer to function address +lw $t1, 28($t0) +# Call function. Result is on $v0 +jalr $t1 +sw $v0, -500($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_main_at_Main_internal_124 --> -500($fp) +lw $t0, -500($fp) +sw $t0, 16($s1) +# LOCAL local_main_at_Main_internal_119 --> -480($fp) +# local_main_at_Main_internal_119 = +# GOTO label_ENDIF_392 +j label_ENDIF_392 +label_FALSEIF_391: + # local_main_at_Main_internal_133 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_133 --> -536($fp) + lw $t0, 12($s1) + sw $t0, -536($fp) + # LOCAL local_main_at_Main_internal_134 --> -540($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_66 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -540($fp) + # IF_ZERO local_main_at_Main_internal_133 GOTO label_FALSE_403 + # IF_ZERO local_main_at_Main_internal_133 GOTO label_FALSE_403 + lw $t0, -536($fp) + beq $t0, 0, label_FALSE_403 + # IF_ZERO local_main_at_Main_internal_134 GOTO label_FALSE_403 + # IF_ZERO local_main_at_Main_internal_134 GOTO label_FALSE_403 + lw $t0, -540($fp) + beq $t0, 0, label_FALSE_403 + # LOCAL local_main_at_Main_internal_132 --> -532($fp) + # LOCAL local_main_at_Main_internal_133 --> -536($fp) + # Comparing -536($fp) type with String + la $v0, String + lw $a0, -536($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -532($fp) + # IF_ZERO local_main_at_Main_internal_132 GOTO label_COMPARE_STRING_406 + # IF_ZERO local_main_at_Main_internal_132 GOTO label_COMPARE_STRING_406 + lw $t0, -532($fp) + beq $t0, 0, label_COMPARE_STRING_406 + # LOCAL local_main_at_Main_internal_132 --> -532($fp) + # LOCAL local_main_at_Main_internal_133 --> -536($fp) + # Comparing -536($fp) type with Bool + la $v0, Bool + lw $a0, -536($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -532($fp) + # IF_ZERO local_main_at_Main_internal_132 GOTO label_COMPARE_BY_VALUE_407 + # IF_ZERO local_main_at_Main_internal_132 GOTO label_COMPARE_BY_VALUE_407 + lw $t0, -532($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_407 + # LOCAL local_main_at_Main_internal_132 --> -532($fp) + # LOCAL local_main_at_Main_internal_133 --> -536($fp) + # Comparing -536($fp) type with Int + la $v0, Int + lw $a0, -536($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -532($fp) + # IF_ZERO local_main_at_Main_internal_132 GOTO label_COMPARE_BY_VALUE_407 + # IF_ZERO local_main_at_Main_internal_132 GOTO label_COMPARE_BY_VALUE_407 + lw $t0, -532($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_407 + # LOCAL local_main_at_Main_internal_132 --> -532($fp) + # LOCAL local_main_at_Main_internal_133 --> -536($fp) + # LOCAL local_main_at_Main_internal_134 --> -540($fp) + # Load pointers and SUB + lw $a0, -536($fp) + lw $a1, -540($fp) + sub $a0, $a0, $a1 + sw $a0, -532($fp) + # IF_ZERO local_main_at_Main_internal_132 GOTO label_TRUE_404 + # IF_ZERO local_main_at_Main_internal_132 GOTO label_TRUE_404 + lw $t0, -532($fp) + beq $t0, 0, label_TRUE_404 + # GOTO label_FALSE_403 + j label_FALSE_403 + label_COMPARE_BY_VALUE_407: + # LOCAL local_main_at_Main_internal_132 --> -532($fp) + # LOCAL local_main_at_Main_internal_133 --> -536($fp) + # LOCAL local_main_at_Main_internal_134 --> -540($fp) + lw $a0, -536($fp) + lw $a1, -540($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -532($fp) + # IF_ZERO local_main_at_Main_internal_132 GOTO label_TRUE_404 + # IF_ZERO local_main_at_Main_internal_132 GOTO label_TRUE_404 + lw $t0, -532($fp) + beq $t0, 0, label_TRUE_404 + # GOTO label_FALSE_403 + j label_FALSE_403 + label_COMPARE_STRING_406: + # LOCAL local_main_at_Main_internal_132 --> -532($fp) + # LOCAL local_main_at_Main_internal_133 --> -536($fp) + # LOCAL local_main_at_Main_internal_134 --> -540($fp) + # Load strings for comparison + lw $v0, -536($fp) + lw $v1, -540($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -532($fp) + # IF_ZERO local_main_at_Main_internal_132 GOTO label_CONTINUE_408 + # IF_ZERO local_main_at_Main_internal_132 GOTO label_CONTINUE_408 + lw $t0, -532($fp) + beq $t0, 0, label_CONTINUE_408 + # GOTO label_FALSE_403 + j label_FALSE_403 + label_CONTINUE_408: + # LOCAL local_main_at_Main_internal_132 --> -532($fp) + # LOCAL local_main_at_Main_internal_133 --> -536($fp) + # LOCAL local_main_at_Main_internal_134 --> -540($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -536($fp) + lw $v1, -540($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_409: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_410 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_409 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_410: + # Store result + sw $a2, -532($fp) + # IF_ZERO local_main_at_Main_internal_132 GOTO label_TRUE_404 + # IF_ZERO local_main_at_Main_internal_132 GOTO label_TRUE_404 + lw $t0, -532($fp) + beq $t0, 0, label_TRUE_404 + label_FALSE_403: + # LOCAL local_main_at_Main_internal_131 --> -528($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -528($fp) + # GOTO label_END_405 +j label_END_405 +label_TRUE_404: + # LOCAL local_main_at_Main_internal_131 --> -528($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -528($fp) + label_END_405: +# LOCAL local_main_at_Main_internal_129 --> -520($fp) +# LOCAL local_main_at_Main_internal_131 --> -528($fp) +# Obtain value from -528($fp) +lw $v0, -528($fp) +lw $v0, 12($v0) +sw $v0, -520($fp) +# IF_ZERO local_main_at_Main_internal_129 GOTO label_FALSEIF_401 +# IF_ZERO local_main_at_Main_internal_129 GOTO label_FALSEIF_401 +lw $t0, -520($fp) +beq $t0, 0, label_FALSEIF_401 +# LOCAL local_main_at_Main_internal_136 --> -548($fp) +# local_main_at_Main_internal_136 = ALLOCATE C +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, C +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, C_start +sw $t0, 4($v0) +# Load type offset +li $t0, 40 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -548($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_main_at_Main_internal_139 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_139 --> -560($fp) +lw $t0, 16($s1) +sw $t0, -560($fp) +# LOCAL local_main_at_Main_internal_137 --> -552($fp) +# LOCAL local_main_at_Main_internal_139 --> -560($fp) +# local_main_at_Main_internal_137 = local_main_at_Main_internal_139 +lw $t0, -560($fp) +sw $t0, -552($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_137 --> -552($fp) +# LOCAL local_main_at_Main_internal_138 --> -556($fp) +# local_main_at_Main_internal_138 = VCALL local_main_at_Main_internal_137 value +# Save new self pointer in $s1 +lw $s1, -552($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 24($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -556($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_138 +# LOCAL local_main_at_Main_internal_138 --> -556($fp) +lw $t0, -556($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# local_main_at_Main_internal_135 = CALL method5 +# LOCAL local_main_at_Main_internal_135 --> -544($fp) +# LOCAL local_main_at_Main_internal_136 --> -548($fp) +# Save new self pointer in $s1 +lw $s1, -548($fp) +# Get pointer to type's VTABLE +la $t0, C_vtable +# Get pointer to function address +lw $t1, 28($t0) +# Call function. Result is on $v0 +jalr $t1 +sw $v0, -544($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_main_at_Main_internal_135 --> -544($fp) +lw $t0, -544($fp) +sw $t0, 16($s1) +# LOCAL local_main_at_Main_internal_130 --> -524($fp) +# local_main_at_Main_internal_130 = +# GOTO label_ENDIF_402 +j label_ENDIF_402 +label_FALSEIF_401: + # local_main_at_Main_internal_144 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_144 --> -580($fp) + lw $t0, 12($s1) + sw $t0, -580($fp) + # LOCAL local_main_at_Main_internal_145 --> -584($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_67 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -584($fp) + # IF_ZERO local_main_at_Main_internal_144 GOTO label_FALSE_413 + # IF_ZERO local_main_at_Main_internal_144 GOTO label_FALSE_413 + lw $t0, -580($fp) + beq $t0, 0, label_FALSE_413 + # IF_ZERO local_main_at_Main_internal_145 GOTO label_FALSE_413 + # IF_ZERO local_main_at_Main_internal_145 GOTO label_FALSE_413 + lw $t0, -584($fp) + beq $t0, 0, label_FALSE_413 + # LOCAL local_main_at_Main_internal_143 --> -576($fp) + # LOCAL local_main_at_Main_internal_144 --> -580($fp) + # Comparing -580($fp) type with String + la $v0, String + lw $a0, -580($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -576($fp) + # IF_ZERO local_main_at_Main_internal_143 GOTO label_COMPARE_STRING_416 + # IF_ZERO local_main_at_Main_internal_143 GOTO label_COMPARE_STRING_416 + lw $t0, -576($fp) + beq $t0, 0, label_COMPARE_STRING_416 + # LOCAL local_main_at_Main_internal_143 --> -576($fp) + # LOCAL local_main_at_Main_internal_144 --> -580($fp) + # Comparing -580($fp) type with Bool + la $v0, Bool + lw $a0, -580($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -576($fp) + # IF_ZERO local_main_at_Main_internal_143 GOTO label_COMPARE_BY_VALUE_417 + # IF_ZERO local_main_at_Main_internal_143 GOTO label_COMPARE_BY_VALUE_417 + lw $t0, -576($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_417 + # LOCAL local_main_at_Main_internal_143 --> -576($fp) + # LOCAL local_main_at_Main_internal_144 --> -580($fp) + # Comparing -580($fp) type with Int + la $v0, Int + lw $a0, -580($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -576($fp) + # IF_ZERO local_main_at_Main_internal_143 GOTO label_COMPARE_BY_VALUE_417 + # IF_ZERO local_main_at_Main_internal_143 GOTO label_COMPARE_BY_VALUE_417 + lw $t0, -576($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_417 + # LOCAL local_main_at_Main_internal_143 --> -576($fp) + # LOCAL local_main_at_Main_internal_144 --> -580($fp) + # LOCAL local_main_at_Main_internal_145 --> -584($fp) + # Load pointers and SUB + lw $a0, -580($fp) + lw $a1, -584($fp) + sub $a0, $a0, $a1 + sw $a0, -576($fp) + # IF_ZERO local_main_at_Main_internal_143 GOTO label_TRUE_414 + # IF_ZERO local_main_at_Main_internal_143 GOTO label_TRUE_414 + lw $t0, -576($fp) + beq $t0, 0, label_TRUE_414 + # GOTO label_FALSE_413 + j label_FALSE_413 + label_COMPARE_BY_VALUE_417: + # LOCAL local_main_at_Main_internal_143 --> -576($fp) + # LOCAL local_main_at_Main_internal_144 --> -580($fp) + # LOCAL local_main_at_Main_internal_145 --> -584($fp) + lw $a0, -580($fp) + lw $a1, -584($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -576($fp) + # IF_ZERO local_main_at_Main_internal_143 GOTO label_TRUE_414 + # IF_ZERO local_main_at_Main_internal_143 GOTO label_TRUE_414 + lw $t0, -576($fp) + beq $t0, 0, label_TRUE_414 + # GOTO label_FALSE_413 + j label_FALSE_413 + label_COMPARE_STRING_416: + # LOCAL local_main_at_Main_internal_143 --> -576($fp) + # LOCAL local_main_at_Main_internal_144 --> -580($fp) + # LOCAL local_main_at_Main_internal_145 --> -584($fp) + # Load strings for comparison + lw $v0, -580($fp) + lw $v1, -584($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -576($fp) + # IF_ZERO local_main_at_Main_internal_143 GOTO label_CONTINUE_418 + # IF_ZERO local_main_at_Main_internal_143 GOTO label_CONTINUE_418 + lw $t0, -576($fp) + beq $t0, 0, label_CONTINUE_418 + # GOTO label_FALSE_413 + j label_FALSE_413 + label_CONTINUE_418: + # LOCAL local_main_at_Main_internal_143 --> -576($fp) + # LOCAL local_main_at_Main_internal_144 --> -580($fp) + # LOCAL local_main_at_Main_internal_145 --> -584($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -580($fp) + lw $v1, -584($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_419: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_420 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_419 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_420: + # Store result + sw $a2, -576($fp) + # IF_ZERO local_main_at_Main_internal_143 GOTO label_TRUE_414 + # IF_ZERO local_main_at_Main_internal_143 GOTO label_TRUE_414 + lw $t0, -576($fp) + beq $t0, 0, label_TRUE_414 + label_FALSE_413: + # LOCAL local_main_at_Main_internal_142 --> -572($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -572($fp) + # GOTO label_END_415 +j label_END_415 +label_TRUE_414: + # LOCAL local_main_at_Main_internal_142 --> -572($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -572($fp) + label_END_415: +# LOCAL local_main_at_Main_internal_140 --> -564($fp) +# LOCAL local_main_at_Main_internal_142 --> -572($fp) +# Obtain value from -572($fp) +lw $v0, -572($fp) +lw $v0, 12($v0) +sw $v0, -564($fp) +# IF_ZERO local_main_at_Main_internal_140 GOTO label_FALSEIF_411 +# IF_ZERO local_main_at_Main_internal_140 GOTO label_FALSEIF_411 +lw $t0, -564($fp) +beq $t0, 0, label_FALSEIF_411 +# LOCAL local_main_at_Main_internal_150 --> -604($fp) +# local_main_at_Main_internal_150 = ALLOCATE D +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, D +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, D_start +sw $t0, 4($v0) +# Load type offset +li $t0, 32 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -604($fp) +# LOCAL local_main_at_Main_internal_148 --> -596($fp) +# LOCAL local_main_at_Main_internal_150 --> -604($fp) +# local_main_at_Main_internal_148 = local_main_at_Main_internal_150 +lw $t0, -604($fp) +sw $t0, -596($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_main_at_Main_internal_153 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_153 --> -616($fp) +lw $t0, 16($s1) +sw $t0, -616($fp) +# LOCAL local_main_at_Main_internal_151 --> -608($fp) +# LOCAL local_main_at_Main_internal_153 --> -616($fp) +# local_main_at_Main_internal_151 = local_main_at_Main_internal_153 +lw $t0, -616($fp) +sw $t0, -608($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_151 --> -608($fp) +# LOCAL local_main_at_Main_internal_152 --> -612($fp) +# local_main_at_Main_internal_152 = VCALL local_main_at_Main_internal_151 value +# Save new self pointer in $s1 +lw $s1, -608($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 24($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -612($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_152 +# LOCAL local_main_at_Main_internal_152 --> -612($fp) +lw $t0, -612($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_148 --> -596($fp) +# LOCAL local_main_at_Main_internal_149 --> -600($fp) +# local_main_at_Main_internal_149 = VCALL local_main_at_Main_internal_148 method7 +# Save new self pointer in $s1 +lw $s1, -596($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 36($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -600($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_146 --> -588($fp) +# LOCAL local_main_at_Main_internal_149 --> -600($fp) +# Obtain value from -600($fp) +lw $v0, -600($fp) +lw $v0, 12($v0) +sw $v0, -588($fp) +# IF_ZERO local_main_at_Main_internal_146 GOTO label_FALSEIF_421 +# IF_ZERO local_main_at_Main_internal_146 GOTO label_FALSEIF_421 +lw $t0, -588($fp) +beq $t0, 0, label_FALSEIF_421 +# LOCAL local_main_at_Main_internal_156 --> -628($fp) +# local_main_at_Main_internal_156 = SELF +sw $s1, -628($fp) +# LOCAL local_main_at_Main_internal_154 --> -620($fp) +# LOCAL local_main_at_Main_internal_156 --> -628($fp) +# local_main_at_Main_internal_154 = local_main_at_Main_internal_156 +lw $t0, -628($fp) +sw $t0, -620($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_157 --> -632($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_68 +sw $t0, 12($v0) +li $t0, 7 +sw $t0, 16($v0) +sw $v0, -632($fp) +# ARG local_main_at_Main_internal_157 +# LOCAL local_main_at_Main_internal_157 --> -632($fp) +lw $t0, -632($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_154 --> -620($fp) +# LOCAL local_main_at_Main_internal_155 --> -624($fp) +# local_main_at_Main_internal_155 = VCALL local_main_at_Main_internal_154 out_string +# Save new self pointer in $s1 +lw $s1, -620($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 96($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -624($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_160 --> -644($fp) +# local_main_at_Main_internal_160 = SELF +sw $s1, -644($fp) +# LOCAL local_main_at_Main_internal_158 --> -636($fp) +# LOCAL local_main_at_Main_internal_160 --> -644($fp) +# local_main_at_Main_internal_158 = local_main_at_Main_internal_160 +lw $t0, -644($fp) +sw $t0, -636($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_main_at_Main_internal_161 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_161 --> -648($fp) +lw $t0, 16($s1) +sw $t0, -648($fp) +# ARG local_main_at_Main_internal_161 +# LOCAL local_main_at_Main_internal_161 --> -648($fp) +lw $t0, -648($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_158 --> -636($fp) +# LOCAL local_main_at_Main_internal_159 --> -640($fp) +# local_main_at_Main_internal_159 = VCALL local_main_at_Main_internal_158 print +# Save new self pointer in $s1 +lw $s1, -636($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 44($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -640($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_164 --> -660($fp) +# local_main_at_Main_internal_164 = SELF +sw $s1, -660($fp) +# LOCAL local_main_at_Main_internal_162 --> -652($fp) +# LOCAL local_main_at_Main_internal_164 --> -660($fp) +# local_main_at_Main_internal_162 = local_main_at_Main_internal_164 +lw $t0, -660($fp) +sw $t0, -652($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_165 --> -664($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_69 +sw $t0, 12($v0) +li $t0, 19 +sw $t0, 16($v0) +sw $v0, -664($fp) +# ARG local_main_at_Main_internal_165 +# LOCAL local_main_at_Main_internal_165 --> -664($fp) +lw $t0, -664($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_162 --> -652($fp) +# LOCAL local_main_at_Main_internal_163 --> -656($fp) +# local_main_at_Main_internal_163 = VCALL local_main_at_Main_internal_162 out_string +# Save new self pointer in $s1 +lw $s1, -652($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 96($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -656($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_147 --> -592($fp) +# LOCAL local_main_at_Main_internal_163 --> -656($fp) +# local_main_at_Main_internal_147 = local_main_at_Main_internal_163 +lw $t0, -656($fp) +sw $t0, -592($fp) +# GOTO label_ENDIF_422 +j label_ENDIF_422 +label_FALSEIF_421: + # LOCAL local_main_at_Main_internal_168 --> -676($fp) + # local_main_at_Main_internal_168 = SELF + sw $s1, -676($fp) + # LOCAL local_main_at_Main_internal_166 --> -668($fp) + # LOCAL local_main_at_Main_internal_168 --> -676($fp) + # local_main_at_Main_internal_166 = local_main_at_Main_internal_168 + lw $t0, -676($fp) + sw $t0, -668($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_169 --> -680($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_70 + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + sw $v0, -680($fp) + # ARG local_main_at_Main_internal_169 + # LOCAL local_main_at_Main_internal_169 --> -680($fp) + lw $t0, -680($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_166 --> -668($fp) + # LOCAL local_main_at_Main_internal_167 --> -672($fp) + # local_main_at_Main_internal_167 = VCALL local_main_at_Main_internal_166 out_string + # Save new self pointer in $s1 + lw $s1, -668($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -672($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_172 --> -692($fp) + # local_main_at_Main_internal_172 = SELF + sw $s1, -692($fp) + # LOCAL local_main_at_Main_internal_170 --> -684($fp) + # LOCAL local_main_at_Main_internal_172 --> -692($fp) + # local_main_at_Main_internal_170 = local_main_at_Main_internal_172 + lw $t0, -692($fp) + sw $t0, -684($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_main_at_Main_internal_173 = GETATTRIBUTE avar Main + # LOCAL local_main_at_Main_internal_173 --> -696($fp) + lw $t0, 16($s1) + sw $t0, -696($fp) + # ARG local_main_at_Main_internal_173 + # LOCAL local_main_at_Main_internal_173 --> -696($fp) + lw $t0, -696($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_170 --> -684($fp) + # LOCAL local_main_at_Main_internal_171 --> -688($fp) + # local_main_at_Main_internal_171 = VCALL local_main_at_Main_internal_170 print + # Save new self pointer in $s1 + lw $s1, -684($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -688($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_176 --> -708($fp) + # local_main_at_Main_internal_176 = SELF + sw $s1, -708($fp) + # LOCAL local_main_at_Main_internal_174 --> -700($fp) + # LOCAL local_main_at_Main_internal_176 --> -708($fp) + # local_main_at_Main_internal_174 = local_main_at_Main_internal_176 + lw $t0, -708($fp) + sw $t0, -700($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_177 --> -712($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_71 + sw $t0, 12($v0) + li $t0, 23 + sw $t0, 16($v0) + sw $v0, -712($fp) + # ARG local_main_at_Main_internal_177 + # LOCAL local_main_at_Main_internal_177 --> -712($fp) + lw $t0, -712($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_174 --> -700($fp) + # LOCAL local_main_at_Main_internal_175 --> -704($fp) + # local_main_at_Main_internal_175 = VCALL local_main_at_Main_internal_174 out_string + # Save new self pointer in $s1 + lw $s1, -700($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -704($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_147 --> -592($fp) + # LOCAL local_main_at_Main_internal_175 --> -704($fp) + # local_main_at_Main_internal_147 = local_main_at_Main_internal_175 + lw $t0, -704($fp) + sw $t0, -592($fp) + label_ENDIF_422: +# LOCAL local_main_at_Main_internal_141 --> -568($fp) +# LOCAL local_main_at_Main_internal_147 --> -592($fp) +# local_main_at_Main_internal_141 = local_main_at_Main_internal_147 +lw $t0, -592($fp) +sw $t0, -568($fp) +# GOTO label_ENDIF_412 +j label_ENDIF_412 +label_FALSEIF_411: + # local_main_at_Main_internal_182 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_182 --> -732($fp) + lw $t0, 12($s1) + sw $t0, -732($fp) + # LOCAL local_main_at_Main_internal_183 --> -736($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_72 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -736($fp) + # IF_ZERO local_main_at_Main_internal_182 GOTO label_FALSE_425 + # IF_ZERO local_main_at_Main_internal_182 GOTO label_FALSE_425 + lw $t0, -732($fp) + beq $t0, 0, label_FALSE_425 + # IF_ZERO local_main_at_Main_internal_183 GOTO label_FALSE_425 + # IF_ZERO local_main_at_Main_internal_183 GOTO label_FALSE_425 + lw $t0, -736($fp) + beq $t0, 0, label_FALSE_425 + # LOCAL local_main_at_Main_internal_181 --> -728($fp) + # LOCAL local_main_at_Main_internal_182 --> -732($fp) + # Comparing -732($fp) type with String + la $v0, String + lw $a0, -732($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -728($fp) + # IF_ZERO local_main_at_Main_internal_181 GOTO label_COMPARE_STRING_428 + # IF_ZERO local_main_at_Main_internal_181 GOTO label_COMPARE_STRING_428 + lw $t0, -728($fp) + beq $t0, 0, label_COMPARE_STRING_428 + # LOCAL local_main_at_Main_internal_181 --> -728($fp) + # LOCAL local_main_at_Main_internal_182 --> -732($fp) + # Comparing -732($fp) type with Bool + la $v0, Bool + lw $a0, -732($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -728($fp) + # IF_ZERO local_main_at_Main_internal_181 GOTO label_COMPARE_BY_VALUE_429 + # IF_ZERO local_main_at_Main_internal_181 GOTO label_COMPARE_BY_VALUE_429 + lw $t0, -728($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_429 + # LOCAL local_main_at_Main_internal_181 --> -728($fp) + # LOCAL local_main_at_Main_internal_182 --> -732($fp) + # Comparing -732($fp) type with Int + la $v0, Int + lw $a0, -732($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -728($fp) + # IF_ZERO local_main_at_Main_internal_181 GOTO label_COMPARE_BY_VALUE_429 + # IF_ZERO local_main_at_Main_internal_181 GOTO label_COMPARE_BY_VALUE_429 + lw $t0, -728($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_429 + # LOCAL local_main_at_Main_internal_181 --> -728($fp) + # LOCAL local_main_at_Main_internal_182 --> -732($fp) + # LOCAL local_main_at_Main_internal_183 --> -736($fp) + # Load pointers and SUB + lw $a0, -732($fp) + lw $a1, -736($fp) + sub $a0, $a0, $a1 + sw $a0, -728($fp) + # IF_ZERO local_main_at_Main_internal_181 GOTO label_TRUE_426 + # IF_ZERO local_main_at_Main_internal_181 GOTO label_TRUE_426 + lw $t0, -728($fp) + beq $t0, 0, label_TRUE_426 + # GOTO label_FALSE_425 + j label_FALSE_425 + label_COMPARE_BY_VALUE_429: + # LOCAL local_main_at_Main_internal_181 --> -728($fp) + # LOCAL local_main_at_Main_internal_182 --> -732($fp) + # LOCAL local_main_at_Main_internal_183 --> -736($fp) + lw $a0, -732($fp) + lw $a1, -736($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -728($fp) + # IF_ZERO local_main_at_Main_internal_181 GOTO label_TRUE_426 + # IF_ZERO local_main_at_Main_internal_181 GOTO label_TRUE_426 + lw $t0, -728($fp) + beq $t0, 0, label_TRUE_426 + # GOTO label_FALSE_425 + j label_FALSE_425 + label_COMPARE_STRING_428: + # LOCAL local_main_at_Main_internal_181 --> -728($fp) + # LOCAL local_main_at_Main_internal_182 --> -732($fp) + # LOCAL local_main_at_Main_internal_183 --> -736($fp) + # Load strings for comparison + lw $v0, -732($fp) + lw $v1, -736($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -728($fp) + # IF_ZERO local_main_at_Main_internal_181 GOTO label_CONTINUE_430 + # IF_ZERO local_main_at_Main_internal_181 GOTO label_CONTINUE_430 + lw $t0, -728($fp) + beq $t0, 0, label_CONTINUE_430 + # GOTO label_FALSE_425 + j label_FALSE_425 + label_CONTINUE_430: + # LOCAL local_main_at_Main_internal_181 --> -728($fp) + # LOCAL local_main_at_Main_internal_182 --> -732($fp) + # LOCAL local_main_at_Main_internal_183 --> -736($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -732($fp) + lw $v1, -736($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_431: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_432 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_431 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_432: + # Store result + sw $a2, -728($fp) + # IF_ZERO local_main_at_Main_internal_181 GOTO label_TRUE_426 + # IF_ZERO local_main_at_Main_internal_181 GOTO label_TRUE_426 + lw $t0, -728($fp) + beq $t0, 0, label_TRUE_426 + label_FALSE_425: + # LOCAL local_main_at_Main_internal_180 --> -724($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -724($fp) + # GOTO label_END_427 +j label_END_427 +label_TRUE_426: + # LOCAL local_main_at_Main_internal_180 --> -724($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -724($fp) + label_END_427: +# LOCAL local_main_at_Main_internal_178 --> -716($fp) +# LOCAL local_main_at_Main_internal_180 --> -724($fp) +# Obtain value from -724($fp) +lw $v0, -724($fp) +lw $v0, 12($v0) +sw $v0, -716($fp) +# IF_ZERO local_main_at_Main_internal_178 GOTO label_FALSEIF_423 +# IF_ZERO local_main_at_Main_internal_178 GOTO label_FALSEIF_423 +lw $t0, -716($fp) +beq $t0, 0, label_FALSEIF_423 +# LOCAL local_main_at_Main_x_184 --> -740($fp) +# local_main_at_Main_x_184 = 0 +li $t0, 0 +sw $t0, -740($fp) +# LOCAL local_main_at_Main_internal_187 --> -752($fp) +# local_main_at_Main_internal_187 = ALLOCATE E +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, E +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, E_start +sw $t0, 4($v0) +# Load type offset +li $t0, 36 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -752($fp) +# LOCAL local_main_at_Main_internal_185 --> -744($fp) +# LOCAL local_main_at_Main_internal_187 --> -752($fp) +# local_main_at_Main_internal_185 = local_main_at_Main_internal_187 +lw $t0, -752($fp) +sw $t0, -744($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_main_at_Main_internal_190 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_190 --> -764($fp) +lw $t0, 16($s1) +sw $t0, -764($fp) +# LOCAL local_main_at_Main_internal_188 --> -756($fp) +# LOCAL local_main_at_Main_internal_190 --> -764($fp) +# local_main_at_Main_internal_188 = local_main_at_Main_internal_190 +lw $t0, -764($fp) +sw $t0, -756($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_188 --> -756($fp) +# LOCAL local_main_at_Main_internal_189 --> -760($fp) +# local_main_at_Main_internal_189 = VCALL local_main_at_Main_internal_188 value +# Save new self pointer in $s1 +lw $s1, -756($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 24($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -760($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_189 +# LOCAL local_main_at_Main_internal_189 --> -760($fp) +lw $t0, -760($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_185 --> -744($fp) +# LOCAL local_main_at_Main_internal_186 --> -748($fp) +# local_main_at_Main_internal_186 = VCALL local_main_at_Main_internal_185 method6 +# Save new self pointer in $s1 +lw $s1, -744($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 104($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -748($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_x_184 --> -740($fp) +# LOCAL local_main_at_Main_internal_186 --> -748($fp) +# local_main_at_Main_x_184 = local_main_at_Main_internal_186 +lw $t0, -748($fp) +sw $t0, -740($fp) +# LOCAL local_main_at_Main_r_191 --> -768($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -768($fp) +# local_main_at_Main_internal_195 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_195 --> -784($fp) +lw $t0, 16($s1) +sw $t0, -784($fp) +# LOCAL local_main_at_Main_internal_193 --> -776($fp) +# LOCAL local_main_at_Main_internal_195 --> -784($fp) +# local_main_at_Main_internal_193 = local_main_at_Main_internal_195 +lw $t0, -784($fp) +sw $t0, -776($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_193 --> -776($fp) +# LOCAL local_main_at_Main_internal_194 --> -780($fp) +# local_main_at_Main_internal_194 = VCALL local_main_at_Main_internal_193 value +# Save new self pointer in $s1 +lw $s1, -776($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 24($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -780($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_197 --> -792($fp) +# LOCAL local_main_at_Main_x_184 --> -740($fp) +# local_main_at_Main_internal_197 = local_main_at_Main_x_184 +lw $t0, -740($fp) +sw $t0, -792($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_197 --> -792($fp) +# LOCAL local_main_at_Main_internal_198 --> -796($fp) +# local_main_at_Main_internal_198 = VCALL local_main_at_Main_internal_197 value +# Save new self pointer in $s1 +lw $s1, -792($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 24($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -796($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_199 --> -800($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 8 +sw $t0, 12($v0) +sw $v0, -800($fp) +# LOCAL local_main_at_Main_internal_196 --> -788($fp) +# LOCAL local_main_at_Main_internal_198 --> -796($fp) +# LOCAL local_main_at_Main_internal_199 --> -800($fp) +# local_main_at_Main_internal_196 = local_main_at_Main_internal_198 * local_main_at_Main_internal_199 +lw $t1, -796($fp) +lw $t0, 12($t1) +lw $t1, -800($fp) +lw $t2, 12($t1) +mul $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -788($fp) +# LOCAL local_main_at_Main_internal_192 --> -772($fp) +# LOCAL local_main_at_Main_internal_194 --> -780($fp) +# LOCAL local_main_at_Main_internal_196 --> -788($fp) +# local_main_at_Main_internal_192 = local_main_at_Main_internal_194 - local_main_at_Main_internal_196 +lw $t1, -780($fp) +lw $t0, 12($t1) +lw $t1, -788($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -772($fp) +# LOCAL local_main_at_Main_r_191 --> -768($fp) +# LOCAL local_main_at_Main_internal_192 --> -772($fp) +# local_main_at_Main_r_191 = local_main_at_Main_internal_192 +lw $t0, -772($fp) +sw $t0, -768($fp) +# LOCAL local_main_at_Main_internal_202 --> -812($fp) +# local_main_at_Main_internal_202 = SELF +sw $s1, -812($fp) +# LOCAL local_main_at_Main_internal_200 --> -804($fp) +# LOCAL local_main_at_Main_internal_202 --> -812($fp) +# local_main_at_Main_internal_200 = local_main_at_Main_internal_202 +lw $t0, -812($fp) +sw $t0, -804($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_203 --> -816($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_73 +sw $t0, 12($v0) +li $t0, 7 +sw $t0, 16($v0) +sw $v0, -816($fp) +# ARG local_main_at_Main_internal_203 +# LOCAL local_main_at_Main_internal_203 --> -816($fp) +lw $t0, -816($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_200 --> -804($fp) +# LOCAL local_main_at_Main_internal_201 --> -808($fp) +# local_main_at_Main_internal_201 = VCALL local_main_at_Main_internal_200 out_string +# Save new self pointer in $s1 +lw $s1, -804($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 96($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -808($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_206 --> -828($fp) +# local_main_at_Main_internal_206 = SELF +sw $s1, -828($fp) +# LOCAL local_main_at_Main_internal_204 --> -820($fp) +# LOCAL local_main_at_Main_internal_206 --> -828($fp) +# local_main_at_Main_internal_204 = local_main_at_Main_internal_206 +lw $t0, -828($fp) +sw $t0, -820($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_main_at_Main_internal_207 = GETATTRIBUTE avar Main +# LOCAL local_main_at_Main_internal_207 --> -832($fp) +lw $t0, 16($s1) +sw $t0, -832($fp) +# ARG local_main_at_Main_internal_207 +# LOCAL local_main_at_Main_internal_207 --> -832($fp) +lw $t0, -832($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_204 --> -820($fp) +# LOCAL local_main_at_Main_internal_205 --> -824($fp) +# local_main_at_Main_internal_205 = VCALL local_main_at_Main_internal_204 print +# Save new self pointer in $s1 +lw $s1, -820($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 44($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -824($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_210 --> -844($fp) +# local_main_at_Main_internal_210 = SELF +sw $s1, -844($fp) +# LOCAL local_main_at_Main_internal_208 --> -836($fp) +# LOCAL local_main_at_Main_internal_210 --> -844($fp) +# local_main_at_Main_internal_208 = local_main_at_Main_internal_210 +lw $t0, -844($fp) +sw $t0, -836($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_211 --> -848($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_74 +sw $t0, 12($v0) +li $t0, 12 +sw $t0, 16($v0) +sw $v0, -848($fp) +# ARG local_main_at_Main_internal_211 +# LOCAL local_main_at_Main_internal_211 --> -848($fp) +lw $t0, -848($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_208 --> -836($fp) +# LOCAL local_main_at_Main_internal_209 --> -840($fp) +# local_main_at_Main_internal_209 = VCALL local_main_at_Main_internal_208 out_string +# Save new self pointer in $s1 +lw $s1, -836($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 96($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -840($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_214 --> -860($fp) +# local_main_at_Main_internal_214 = SELF +sw $s1, -860($fp) +# LOCAL local_main_at_Main_internal_212 --> -852($fp) +# LOCAL local_main_at_Main_internal_214 --> -860($fp) +# local_main_at_Main_internal_212 = local_main_at_Main_internal_214 +lw $t0, -860($fp) +sw $t0, -852($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_main_at_Main_x_184 +# LOCAL local_main_at_Main_x_184 --> -740($fp) +lw $t0, -740($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_212 --> -852($fp) +# LOCAL local_main_at_Main_internal_213 --> -856($fp) +# local_main_at_Main_internal_213 = VCALL local_main_at_Main_internal_212 print +# Save new self pointer in $s1 +lw $s1, -852($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 44($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -856($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_217 --> -872($fp) +# local_main_at_Main_internal_217 = SELF +sw $s1, -872($fp) +# LOCAL local_main_at_Main_internal_215 --> -864($fp) +# LOCAL local_main_at_Main_internal_217 --> -872($fp) +# local_main_at_Main_internal_215 = local_main_at_Main_internal_217 +lw $t0, -872($fp) +sw $t0, -864($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_218 --> -876($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_75 +sw $t0, 12($v0) +li $t0, 28 +sw $t0, 16($v0) +sw $v0, -876($fp) +# ARG local_main_at_Main_internal_218 +# LOCAL local_main_at_Main_internal_218 --> -876($fp) +lw $t0, -876($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_215 --> -864($fp) +# LOCAL local_main_at_Main_internal_216 --> -868($fp) +# local_main_at_Main_internal_216 = VCALL local_main_at_Main_internal_215 out_string +# Save new self pointer in $s1 +lw $s1, -864($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 96($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -868($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_a_219 --> -880($fp) +# local_main_at_Main_a_219 = 0 +li $t0, 0 +sw $t0, -880($fp) +# LOCAL local_main_at_Main_internal_220 --> -884($fp) +# local_main_at_Main_internal_220 = ALLOCATE A2I +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, A2I +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 12 bytes of memory +li $a0, 12 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, A2I_start +sw $t0, 4($v0) +# Load type offset +li $t0, 20 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -884($fp) +# LOCAL local_main_at_Main_a_219 --> -880($fp) +# LOCAL local_main_at_Main_internal_220 --> -884($fp) +# local_main_at_Main_a_219 = local_main_at_Main_internal_220 +lw $t0, -884($fp) +sw $t0, -880($fp) +# LOCAL local_main_at_Main_internal_223 --> -896($fp) +# local_main_at_Main_internal_223 = SELF +sw $s1, -896($fp) +# LOCAL local_main_at_Main_internal_221 --> -888($fp) +# LOCAL local_main_at_Main_internal_223 --> -896($fp) +# local_main_at_Main_internal_221 = local_main_at_Main_internal_223 +lw $t0, -896($fp) +sw $t0, -888($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_224 --> -900($fp) +# LOCAL local_main_at_Main_a_219 --> -880($fp) +# local_main_at_Main_internal_224 = local_main_at_Main_a_219 +lw $t0, -880($fp) +sw $t0, -900($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_main_at_Main_r_191 +# LOCAL local_main_at_Main_r_191 --> -768($fp) +lw $t0, -768($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_224 --> -900($fp) +# LOCAL local_main_at_Main_internal_225 --> -904($fp) +# local_main_at_Main_internal_225 = VCALL local_main_at_Main_internal_224 i2a +# Save new self pointer in $s1 +lw $s1, -900($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 32($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -904($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_225 +# LOCAL local_main_at_Main_internal_225 --> -904($fp) +lw $t0, -904($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_221 --> -888($fp) +# LOCAL local_main_at_Main_internal_222 --> -892($fp) +# local_main_at_Main_internal_222 = VCALL local_main_at_Main_internal_221 out_string +# Save new self pointer in $s1 +lw $s1, -888($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 96($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -892($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_228 --> -916($fp) +# local_main_at_Main_internal_228 = SELF +sw $s1, -916($fp) +# LOCAL local_main_at_Main_internal_226 --> -908($fp) +# LOCAL local_main_at_Main_internal_228 --> -916($fp) +# local_main_at_Main_internal_226 = local_main_at_Main_internal_228 +lw $t0, -916($fp) +sw $t0, -908($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_229 --> -920($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_76 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -920($fp) +# ARG local_main_at_Main_internal_229 +# LOCAL local_main_at_Main_internal_229 --> -920($fp) +lw $t0, -920($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_226 --> -908($fp) +# LOCAL local_main_at_Main_internal_227 --> -912($fp) +# local_main_at_Main_internal_227 = VCALL local_main_at_Main_internal_226 out_string +# Save new self pointer in $s1 +lw $s1, -908($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 96($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -912($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_main_at_Main_x_184 --> -740($fp) +lw $t0, -740($fp) +sw $t0, 16($s1) +# LOCAL local_main_at_Main_internal_179 --> -720($fp) +# local_main_at_Main_internal_179 = +# GOTO label_ENDIF_424 +j label_ENDIF_424 +label_FALSEIF_423: + # local_main_at_Main_internal_234 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_234 --> -940($fp) + lw $t0, 12($s1) + sw $t0, -940($fp) + # LOCAL local_main_at_Main_internal_235 --> -944($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_77 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -944($fp) + # IF_ZERO local_main_at_Main_internal_234 GOTO label_FALSE_435 + # IF_ZERO local_main_at_Main_internal_234 GOTO label_FALSE_435 + lw $t0, -940($fp) + beq $t0, 0, label_FALSE_435 + # IF_ZERO local_main_at_Main_internal_235 GOTO label_FALSE_435 + # IF_ZERO local_main_at_Main_internal_235 GOTO label_FALSE_435 + lw $t0, -944($fp) + beq $t0, 0, label_FALSE_435 + # LOCAL local_main_at_Main_internal_233 --> -936($fp) + # LOCAL local_main_at_Main_internal_234 --> -940($fp) + # Comparing -940($fp) type with String + la $v0, String + lw $a0, -940($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -936($fp) + # IF_ZERO local_main_at_Main_internal_233 GOTO label_COMPARE_STRING_438 + # IF_ZERO local_main_at_Main_internal_233 GOTO label_COMPARE_STRING_438 + lw $t0, -936($fp) + beq $t0, 0, label_COMPARE_STRING_438 + # LOCAL local_main_at_Main_internal_233 --> -936($fp) + # LOCAL local_main_at_Main_internal_234 --> -940($fp) + # Comparing -940($fp) type with Bool + la $v0, Bool + lw $a0, -940($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -936($fp) + # IF_ZERO local_main_at_Main_internal_233 GOTO label_COMPARE_BY_VALUE_439 + # IF_ZERO local_main_at_Main_internal_233 GOTO label_COMPARE_BY_VALUE_439 + lw $t0, -936($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_439 + # LOCAL local_main_at_Main_internal_233 --> -936($fp) + # LOCAL local_main_at_Main_internal_234 --> -940($fp) + # Comparing -940($fp) type with Int + la $v0, Int + lw $a0, -940($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -936($fp) + # IF_ZERO local_main_at_Main_internal_233 GOTO label_COMPARE_BY_VALUE_439 + # IF_ZERO local_main_at_Main_internal_233 GOTO label_COMPARE_BY_VALUE_439 + lw $t0, -936($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_439 + # LOCAL local_main_at_Main_internal_233 --> -936($fp) + # LOCAL local_main_at_Main_internal_234 --> -940($fp) + # LOCAL local_main_at_Main_internal_235 --> -944($fp) + # Load pointers and SUB + lw $a0, -940($fp) + lw $a1, -944($fp) + sub $a0, $a0, $a1 + sw $a0, -936($fp) + # IF_ZERO local_main_at_Main_internal_233 GOTO label_TRUE_436 + # IF_ZERO local_main_at_Main_internal_233 GOTO label_TRUE_436 + lw $t0, -936($fp) + beq $t0, 0, label_TRUE_436 + # GOTO label_FALSE_435 + j label_FALSE_435 + label_COMPARE_BY_VALUE_439: + # LOCAL local_main_at_Main_internal_233 --> -936($fp) + # LOCAL local_main_at_Main_internal_234 --> -940($fp) + # LOCAL local_main_at_Main_internal_235 --> -944($fp) + lw $a0, -940($fp) + lw $a1, -944($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -936($fp) + # IF_ZERO local_main_at_Main_internal_233 GOTO label_TRUE_436 + # IF_ZERO local_main_at_Main_internal_233 GOTO label_TRUE_436 + lw $t0, -936($fp) + beq $t0, 0, label_TRUE_436 + # GOTO label_FALSE_435 + j label_FALSE_435 + label_COMPARE_STRING_438: + # LOCAL local_main_at_Main_internal_233 --> -936($fp) + # LOCAL local_main_at_Main_internal_234 --> -940($fp) + # LOCAL local_main_at_Main_internal_235 --> -944($fp) + # Load strings for comparison + lw $v0, -940($fp) + lw $v1, -944($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -936($fp) + # IF_ZERO local_main_at_Main_internal_233 GOTO label_CONTINUE_440 + # IF_ZERO local_main_at_Main_internal_233 GOTO label_CONTINUE_440 + lw $t0, -936($fp) + beq $t0, 0, label_CONTINUE_440 + # GOTO label_FALSE_435 + j label_FALSE_435 + label_CONTINUE_440: + # LOCAL local_main_at_Main_internal_233 --> -936($fp) + # LOCAL local_main_at_Main_internal_234 --> -940($fp) + # LOCAL local_main_at_Main_internal_235 --> -944($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -940($fp) + lw $v1, -944($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_441: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_442 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_441 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_442: + # Store result + sw $a2, -936($fp) + # IF_ZERO local_main_at_Main_internal_233 GOTO label_TRUE_436 + # IF_ZERO local_main_at_Main_internal_233 GOTO label_TRUE_436 + lw $t0, -936($fp) + beq $t0, 0, label_TRUE_436 + label_FALSE_435: + # LOCAL local_main_at_Main_internal_232 --> -932($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -932($fp) + # GOTO label_END_437 +j label_END_437 +label_TRUE_436: + # LOCAL local_main_at_Main_internal_232 --> -932($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -932($fp) + label_END_437: +# LOCAL local_main_at_Main_internal_230 --> -924($fp) +# LOCAL local_main_at_Main_internal_232 --> -932($fp) +# Obtain value from -932($fp) +lw $v0, -932($fp) +lw $v0, 12($v0) +sw $v0, -924($fp) +# IF_ZERO local_main_at_Main_internal_230 GOTO label_FALSEIF_433 +# IF_ZERO local_main_at_Main_internal_230 GOTO label_FALSEIF_433 +lw $t0, -924($fp) +beq $t0, 0, label_FALSEIF_433 +# LOCAL local_main_at_Main_internal_236 --> -948($fp) +# local_main_at_Main_internal_236 = ALLOCATE A +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, A +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, A_start +sw $t0, 4($v0) +# Load type offset +li $t0, 24 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __A__attrib__var__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -948($fp) +# +# LOCAL local_main_at_Main_internal_236 --> -948($fp) +lw $t0, -948($fp) +sw $t0, 16($s1) +# LOCAL local_main_at_Main_internal_231 --> -928($fp) +# local_main_at_Main_internal_231 = +# GOTO label_ENDIF_434 +j label_ENDIF_434 +label_FALSEIF_433: + # local_main_at_Main_internal_241 = GETATTRIBUTE char Main + # LOCAL local_main_at_Main_internal_241 --> -968($fp) + lw $t0, 12($s1) + sw $t0, -968($fp) + # LOCAL local_main_at_Main_internal_242 --> -972($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_78 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -972($fp) + # IF_ZERO local_main_at_Main_internal_241 GOTO label_FALSE_445 + # IF_ZERO local_main_at_Main_internal_241 GOTO label_FALSE_445 + lw $t0, -968($fp) + beq $t0, 0, label_FALSE_445 + # IF_ZERO local_main_at_Main_internal_242 GOTO label_FALSE_445 + # IF_ZERO local_main_at_Main_internal_242 GOTO label_FALSE_445 + lw $t0, -972($fp) + beq $t0, 0, label_FALSE_445 + # LOCAL local_main_at_Main_internal_240 --> -964($fp) + # LOCAL local_main_at_Main_internal_241 --> -968($fp) + # Comparing -968($fp) type with String + la $v0, String + lw $a0, -968($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -964($fp) + # IF_ZERO local_main_at_Main_internal_240 GOTO label_COMPARE_STRING_448 + # IF_ZERO local_main_at_Main_internal_240 GOTO label_COMPARE_STRING_448 + lw $t0, -964($fp) + beq $t0, 0, label_COMPARE_STRING_448 + # LOCAL local_main_at_Main_internal_240 --> -964($fp) + # LOCAL local_main_at_Main_internal_241 --> -968($fp) + # Comparing -968($fp) type with Bool + la $v0, Bool + lw $a0, -968($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -964($fp) + # IF_ZERO local_main_at_Main_internal_240 GOTO label_COMPARE_BY_VALUE_449 + # IF_ZERO local_main_at_Main_internal_240 GOTO label_COMPARE_BY_VALUE_449 + lw $t0, -964($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_449 + # LOCAL local_main_at_Main_internal_240 --> -964($fp) + # LOCAL local_main_at_Main_internal_241 --> -968($fp) + # Comparing -968($fp) type with Int + la $v0, Int + lw $a0, -968($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -964($fp) + # IF_ZERO local_main_at_Main_internal_240 GOTO label_COMPARE_BY_VALUE_449 + # IF_ZERO local_main_at_Main_internal_240 GOTO label_COMPARE_BY_VALUE_449 + lw $t0, -964($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_449 + # LOCAL local_main_at_Main_internal_240 --> -964($fp) + # LOCAL local_main_at_Main_internal_241 --> -968($fp) + # LOCAL local_main_at_Main_internal_242 --> -972($fp) + # Load pointers and SUB + lw $a0, -968($fp) + lw $a1, -972($fp) + sub $a0, $a0, $a1 + sw $a0, -964($fp) + # IF_ZERO local_main_at_Main_internal_240 GOTO label_TRUE_446 + # IF_ZERO local_main_at_Main_internal_240 GOTO label_TRUE_446 + lw $t0, -964($fp) + beq $t0, 0, label_TRUE_446 + # GOTO label_FALSE_445 + j label_FALSE_445 + label_COMPARE_BY_VALUE_449: + # LOCAL local_main_at_Main_internal_240 --> -964($fp) + # LOCAL local_main_at_Main_internal_241 --> -968($fp) + # LOCAL local_main_at_Main_internal_242 --> -972($fp) + lw $a0, -968($fp) + lw $a1, -972($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -964($fp) + # IF_ZERO local_main_at_Main_internal_240 GOTO label_TRUE_446 + # IF_ZERO local_main_at_Main_internal_240 GOTO label_TRUE_446 + lw $t0, -964($fp) + beq $t0, 0, label_TRUE_446 + # GOTO label_FALSE_445 + j label_FALSE_445 + label_COMPARE_STRING_448: + # LOCAL local_main_at_Main_internal_240 --> -964($fp) + # LOCAL local_main_at_Main_internal_241 --> -968($fp) + # LOCAL local_main_at_Main_internal_242 --> -972($fp) + # Load strings for comparison + lw $v0, -968($fp) + lw $v1, -972($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -964($fp) + # IF_ZERO local_main_at_Main_internal_240 GOTO label_CONTINUE_450 + # IF_ZERO local_main_at_Main_internal_240 GOTO label_CONTINUE_450 + lw $t0, -964($fp) + beq $t0, 0, label_CONTINUE_450 + # GOTO label_FALSE_445 + j label_FALSE_445 + label_CONTINUE_450: + # LOCAL local_main_at_Main_internal_240 --> -964($fp) + # LOCAL local_main_at_Main_internal_241 --> -968($fp) + # LOCAL local_main_at_Main_internal_242 --> -972($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -968($fp) + lw $v1, -972($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_451: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_452 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_451 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_452: + # Store result + sw $a2, -964($fp) + # IF_ZERO local_main_at_Main_internal_240 GOTO label_TRUE_446 + # IF_ZERO local_main_at_Main_internal_240 GOTO label_TRUE_446 + lw $t0, -964($fp) + beq $t0, 0, label_TRUE_446 + label_FALSE_445: + # LOCAL local_main_at_Main_internal_239 --> -960($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -960($fp) + # GOTO label_END_447 +j label_END_447 +label_TRUE_446: + # LOCAL local_main_at_Main_internal_239 --> -960($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -960($fp) + label_END_447: +# LOCAL local_main_at_Main_internal_237 --> -952($fp) +# LOCAL local_main_at_Main_internal_239 --> -960($fp) +# Obtain value from -960($fp) +lw $v0, -960($fp) +lw $v0, 12($v0) +sw $v0, -952($fp) +# IF_ZERO local_main_at_Main_internal_237 GOTO label_FALSEIF_443 +# IF_ZERO local_main_at_Main_internal_237 GOTO label_FALSEIF_443 +lw $t0, -952($fp) +beq $t0, 0, label_FALSEIF_443 +# LOCAL local_main_at_Main_internal_243 --> -976($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -976($fp) +# +# LOCAL local_main_at_Main_internal_243 --> -976($fp) +lw $t0, -976($fp) +sw $t0, 24($s1) +# LOCAL local_main_at_Main_internal_238 --> -956($fp) +# local_main_at_Main_internal_238 = +# GOTO label_ENDIF_444 +j label_ENDIF_444 +label_FALSEIF_443: + # LOCAL local_main_at_Main_internal_246 --> -988($fp) + # local_main_at_Main_internal_246 = ALLOCATE A + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, A + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, A_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__var__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -988($fp) + # LOCAL local_main_at_Main_internal_244 --> -980($fp) + # LOCAL local_main_at_Main_internal_246 --> -988($fp) + # local_main_at_Main_internal_244 = local_main_at_Main_internal_246 + lw $t0, -988($fp) + sw $t0, -980($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_main_at_Main_internal_249 = GETATTRIBUTE avar Main + # LOCAL local_main_at_Main_internal_249 --> -1000($fp) + lw $t0, 16($s1) + sw $t0, -1000($fp) + # LOCAL local_main_at_Main_internal_247 --> -992($fp) + # LOCAL local_main_at_Main_internal_249 --> -1000($fp) + # local_main_at_Main_internal_247 = local_main_at_Main_internal_249 + lw $t0, -1000($fp) + sw $t0, -992($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_247 --> -992($fp) + # LOCAL local_main_at_Main_internal_248 --> -996($fp) + # local_main_at_Main_internal_248 = VCALL local_main_at_Main_internal_247 value + # Save new self pointer in $s1 + lw $s1, -992($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 24($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -996($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_248 + # LOCAL local_main_at_Main_internal_248 --> -996($fp) + lw $t0, -996($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_244 --> -980($fp) + # LOCAL local_main_at_Main_internal_245 --> -984($fp) + # local_main_at_Main_internal_245 = VCALL local_main_at_Main_internal_244 method1 + # Save new self pointer in $s1 + lw $s1, -980($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -984($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_245 --> -984($fp) + lw $t0, -984($fp) + sw $t0, 16($s1) + # LOCAL local_main_at_Main_internal_238 --> -956($fp) + # local_main_at_Main_internal_238 = + label_ENDIF_444: +# LOCAL local_main_at_Main_internal_231 --> -928($fp) +# LOCAL local_main_at_Main_internal_238 --> -956($fp) +# local_main_at_Main_internal_231 = local_main_at_Main_internal_238 +lw $t0, -956($fp) +sw $t0, -928($fp) +label_ENDIF_434: +# LOCAL local_main_at_Main_internal_179 --> -720($fp) +# LOCAL local_main_at_Main_internal_231 --> -928($fp) +# local_main_at_Main_internal_179 = local_main_at_Main_internal_231 +lw $t0, -928($fp) +sw $t0, -720($fp) +label_ENDIF_424: +# LOCAL local_main_at_Main_internal_141 --> -568($fp) +# LOCAL local_main_at_Main_internal_179 --> -720($fp) +# local_main_at_Main_internal_141 = local_main_at_Main_internal_179 +lw $t0, -720($fp) +sw $t0, -568($fp) +label_ENDIF_412: +# LOCAL local_main_at_Main_internal_130 --> -524($fp) +# LOCAL local_main_at_Main_internal_141 --> -568($fp) +# local_main_at_Main_internal_130 = local_main_at_Main_internal_141 +lw $t0, -568($fp) +sw $t0, -524($fp) +label_ENDIF_402: +# LOCAL local_main_at_Main_internal_119 --> -480($fp) +# LOCAL local_main_at_Main_internal_130 --> -524($fp) +# local_main_at_Main_internal_119 = local_main_at_Main_internal_130 +lw $t0, -524($fp) +sw $t0, -480($fp) +label_ENDIF_392: +# LOCAL local_main_at_Main_internal_108 --> -436($fp) +# LOCAL local_main_at_Main_internal_119 --> -480($fp) +# local_main_at_Main_internal_108 = local_main_at_Main_internal_119 +lw $t0, -480($fp) +sw $t0, -436($fp) +label_ENDIF_382: +# LOCAL local_main_at_Main_internal_87 --> -352($fp) +# LOCAL local_main_at_Main_internal_108 --> -436($fp) +# local_main_at_Main_internal_87 = local_main_at_Main_internal_108 +lw $t0, -436($fp) +sw $t0, -352($fp) +label_ENDIF_372: +# LOCAL local_main_at_Main_internal_56 --> -228($fp) +# LOCAL local_main_at_Main_internal_87 --> -352($fp) +# local_main_at_Main_internal_56 = local_main_at_Main_internal_87 +lw $t0, -352($fp) +sw $t0, -228($fp) +label_ENDIF_354: +# LOCAL local_main_at_Main_internal_35 --> -144($fp) +# LOCAL local_main_at_Main_internal_56 --> -228($fp) +# local_main_at_Main_internal_35 = local_main_at_Main_internal_56 +lw $t0, -228($fp) +sw $t0, -144($fp) +label_ENDIF_344: +# GOTO label_WHILE_339 +j label_WHILE_339 +label_WHILE_END_340: + # RETURN + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 1008 + jr $ra + # Function END + diff --git a/tests/codegen/atoi.mips b/tests/codegen/atoi.mips new file mode 100644 index 00000000..cb161068 --- /dev/null +++ b/tests/codegen/atoi.mips @@ -0,0 +1,10089 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:07 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +A2I: .asciiz "A2I" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word dummy, function_out_string_at_IO, function_in_string_at_IO, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, function_abort_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, function_length_at_String, dummy, dummy, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, function_abort_at_Object, function_concat_at_String +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type A2I **** +A2I_vtable: .word function_c2i_at_A2I, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_i2c_at_A2I, dummy, function_a2i_aux_at_A2I, function_i2a_at_A2I, dummy, function_i2a_aux_at_A2I, dummy, function_a2i_at_A2I, dummy, function_abort_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type A2I **** +A2I_start: + A2I_vtable_pointer: .word A2I_vtable + # Function END +A2I_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word dummy, function_out_string_at_IO, function_in_string_at_IO, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, function_main_at_Main, dummy, function_in_int_at_IO, function_abort_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1 +A2I__TDT: .word -1, -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "0" +# + + +data_5: .asciiz "1" +# + + +data_6: .asciiz "2" +# + + +data_7: .asciiz "3" +# + + +data_8: .asciiz "4" +# + + +data_9: .asciiz "5" +# + + +data_10: .asciiz "6" +# + + +data_11: .asciiz "7" +# + + +data_12: .asciiz "8" +# + + +data_13: .asciiz "9" +# + + +data_14: .asciiz "0" +# + + +data_15: .asciiz "1" +# + + +data_16: .asciiz "2" +# + + +data_17: .asciiz "3" +# + + +data_18: .asciiz "4" +# + + +data_19: .asciiz "5" +# + + +data_20: .asciiz "6" +# + + +data_21: .asciiz "7" +# + + +data_22: .asciiz "8" +# + + +data_23: .asciiz "9" +# + + +data_24: .asciiz "" +# + + +data_25: .asciiz "-" +# + + +data_26: .asciiz "+" +# + + +data_27: .asciiz "0" +# + + +data_28: .asciiz "-" +# + + +data_29: .asciiz "" +# + + +data_30: .asciiz "678987" +# + + +data_31: .asciiz " == " +# + + +data_32: .asciiz "\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + lb $t3, 0($t1) + beqz $t3, end_loop + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + end_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 48($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_c2i_at_A2I implementation. +# @Params: +# 0($fp) = param_c2i_at_A2I_char_0 +function_c2i_at_A2I: + # Allocate stack frame for function function_c2i_at_A2I. + subu $sp, $sp, 264 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 264 + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -20($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_3 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_3 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_3 + # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_3 + # IF_ZERO local_c2i_at_A2I_internal_4 GOTO label_FALSE_3 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_3 + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_6 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_6 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_6 + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_7 + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_7 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_7 + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_4 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_COMPARE_BY_VALUE_7: + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_4 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_COMPARE_STRING_6: + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_CONTINUE_8 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_CONTINUE_8 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_8 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_CONTINUE_8: + # LOCAL local_c2i_at_A2I_internal_3 --> -16($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_9: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_10 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_9 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_10: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + # IF_ZERO local_c2i_at_A2I_internal_3 GOTO label_TRUE_4 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_4 + label_FALSE_3: + # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_5 +j label_END_5 +label_TRUE_4: + # LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_5: +# LOCAL local_c2i_at_A2I_internal_0 --> -4($fp) +# LOCAL local_c2i_at_A2I_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSEIF_1 +# IF_ZERO local_c2i_at_A2I_internal_0 GOTO label_FALSEIF_1 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_1 +# LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -24($fp) +# LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) +# LOCAL local_c2i_at_A2I_internal_5 --> -24($fp) +# local_c2i_at_A2I_internal_1 = local_c2i_at_A2I_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -44($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_13 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_13 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_13 + # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_13 + # IF_ZERO local_c2i_at_A2I_internal_10 GOTO label_FALSE_13 + lw $t0, -44($fp) + beq $t0, 0, label_FALSE_13 + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_STRING_16 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_STRING_16 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_16 + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_17 + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_17 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_17 + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -44($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_14 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_COMPARE_BY_VALUE_17: + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + lw $a0, 0($fp) + lw $a1, -44($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_14 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_COMPARE_STRING_16: + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_CONTINUE_18 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_CONTINUE_18 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_18 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_CONTINUE_18: + # LOCAL local_c2i_at_A2I_internal_9 --> -40($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_10 --> -44($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_19: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_20 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_19 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_20: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + # IF_ZERO local_c2i_at_A2I_internal_9 GOTO label_TRUE_14 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_14 + label_FALSE_13: + # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_15 +j label_END_15 +label_TRUE_14: + # LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_15: +# LOCAL local_c2i_at_A2I_internal_6 --> -28($fp) +# LOCAL local_c2i_at_A2I_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSEIF_11 +# IF_ZERO local_c2i_at_A2I_internal_6 GOTO label_FALSEIF_11 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_11 +# LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -48($fp) +# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) +# LOCAL local_c2i_at_A2I_internal_11 --> -48($fp) +# local_c2i_at_A2I_internal_7 = local_c2i_at_A2I_internal_11 +lw $t0, -48($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_12 +j label_ENDIF_12 +label_FALSEIF_11: + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_6 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -68($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_23 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_23 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_23 + # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_23 + # IF_ZERO local_c2i_at_A2I_internal_16 GOTO label_FALSE_23 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_23 + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_STRING_26 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_STRING_26 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_STRING_26 + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_27 + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_27 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_27 + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_24 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_COMPARE_BY_VALUE_27: + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + lw $a0, 0($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_24 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_COMPARE_STRING_26: + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_CONTINUE_28 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_CONTINUE_28 + lw $t0, -64($fp) + beq $t0, 0, label_CONTINUE_28 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_CONTINUE_28: + # LOCAL local_c2i_at_A2I_internal_15 --> -64($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_29: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_30 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_29 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_30: + # Store result + sw $a2, -64($fp) + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + # IF_ZERO local_c2i_at_A2I_internal_15 GOTO label_TRUE_24 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_24 + label_FALSE_23: + # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # GOTO label_END_25 +j label_END_25 +label_TRUE_24: + # LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + label_END_25: +# LOCAL local_c2i_at_A2I_internal_12 --> -52($fp) +# LOCAL local_c2i_at_A2I_internal_14 --> -60($fp) +# Obtain value from -60($fp) +lw $v0, -60($fp) +lw $v0, 12($v0) +sw $v0, -52($fp) +# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSEIF_21 +# IF_ZERO local_c2i_at_A2I_internal_12 GOTO label_FALSEIF_21 +lw $t0, -52($fp) +beq $t0, 0, label_FALSEIF_21 +# LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 2 +sw $t0, 12($v0) +sw $v0, -72($fp) +# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) +# LOCAL local_c2i_at_A2I_internal_17 --> -72($fp) +# local_c2i_at_A2I_internal_13 = local_c2i_at_A2I_internal_17 +lw $t0, -72($fp) +sw $t0, -56($fp) +# GOTO label_ENDIF_22 +j label_ENDIF_22 +label_FALSEIF_21: + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_7 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -92($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_33 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_33 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_33 + # IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_FALSE_33 + # IF_ZERO local_c2i_at_A2I_internal_22 GOTO label_FALSE_33 + lw $t0, -92($fp) + beq $t0, 0, label_FALSE_33 + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_STRING_36 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_STRING_36 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_STRING_36 + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_37 + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_37 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_37 + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -92($fp) + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_34 + # GOTO label_FALSE_33 + j label_FALSE_33 + label_COMPARE_BY_VALUE_37: + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + lw $a0, 0($fp) + lw $a1, -92($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_34 + # GOTO label_FALSE_33 + j label_FALSE_33 + label_COMPARE_STRING_36: + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_CONTINUE_38 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_CONTINUE_38 + lw $t0, -88($fp) + beq $t0, 0, label_CONTINUE_38 + # GOTO label_FALSE_33 + j label_FALSE_33 + label_CONTINUE_38: + # LOCAL local_c2i_at_A2I_internal_21 --> -88($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_22 --> -92($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_39: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_40 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_39 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_40: + # Store result + sw $a2, -88($fp) + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + # IF_ZERO local_c2i_at_A2I_internal_21 GOTO label_TRUE_34 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_34 + label_FALSE_33: + # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -84($fp) + # GOTO label_END_35 +j label_END_35 +label_TRUE_34: + # LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -84($fp) + label_END_35: +# LOCAL local_c2i_at_A2I_internal_18 --> -76($fp) +# LOCAL local_c2i_at_A2I_internal_20 --> -84($fp) +# Obtain value from -84($fp) +lw $v0, -84($fp) +lw $v0, 12($v0) +sw $v0, -76($fp) +# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSEIF_31 +# IF_ZERO local_c2i_at_A2I_internal_18 GOTO label_FALSEIF_31 +lw $t0, -76($fp) +beq $t0, 0, label_FALSEIF_31 +# LOCAL local_c2i_at_A2I_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 3 +sw $t0, 12($v0) +sw $v0, -96($fp) +# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) +# LOCAL local_c2i_at_A2I_internal_23 --> -96($fp) +# local_c2i_at_A2I_internal_19 = local_c2i_at_A2I_internal_23 +lw $t0, -96($fp) +sw $t0, -80($fp) +# GOTO label_ENDIF_32 +j label_ENDIF_32 +label_FALSEIF_31: + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_8 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -116($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_43 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_43 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_43 + # IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_FALSE_43 + # IF_ZERO local_c2i_at_A2I_internal_28 GOTO label_FALSE_43 + lw $t0, -116($fp) + beq $t0, 0, label_FALSE_43 + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_STRING_46 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_STRING_46 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_STRING_46 + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_47 + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_47 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_47 + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -116($fp) + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_44 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_COMPARE_BY_VALUE_47: + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + lw $a0, 0($fp) + lw $a1, -116($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_44 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_COMPARE_STRING_46: + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_CONTINUE_48 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_CONTINUE_48 + lw $t0, -112($fp) + beq $t0, 0, label_CONTINUE_48 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_CONTINUE_48: + # LOCAL local_c2i_at_A2I_internal_27 --> -112($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_28 --> -116($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_49: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_50 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_49 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_50: + # Store result + sw $a2, -112($fp) + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + # IF_ZERO local_c2i_at_A2I_internal_27 GOTO label_TRUE_44 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_44 + label_FALSE_43: + # LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -108($fp) + # GOTO label_END_45 +j label_END_45 +label_TRUE_44: + # LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -108($fp) + label_END_45: +# LOCAL local_c2i_at_A2I_internal_24 --> -100($fp) +# LOCAL local_c2i_at_A2I_internal_26 --> -108($fp) +# Obtain value from -108($fp) +lw $v0, -108($fp) +lw $v0, 12($v0) +sw $v0, -100($fp) +# IF_ZERO local_c2i_at_A2I_internal_24 GOTO label_FALSEIF_41 +# IF_ZERO local_c2i_at_A2I_internal_24 GOTO label_FALSEIF_41 +lw $t0, -100($fp) +beq $t0, 0, label_FALSEIF_41 +# LOCAL local_c2i_at_A2I_internal_29 --> -120($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 4 +sw $t0, 12($v0) +sw $v0, -120($fp) +# LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) +# LOCAL local_c2i_at_A2I_internal_29 --> -120($fp) +# local_c2i_at_A2I_internal_25 = local_c2i_at_A2I_internal_29 +lw $t0, -120($fp) +sw $t0, -104($fp) +# GOTO label_ENDIF_42 +j label_ENDIF_42 +label_FALSEIF_41: + # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_9 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -140($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_53 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_53 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_53 + # IF_ZERO local_c2i_at_A2I_internal_34 GOTO label_FALSE_53 + # IF_ZERO local_c2i_at_A2I_internal_34 GOTO label_FALSE_53 + lw $t0, -140($fp) + beq $t0, 0, label_FALSE_53 + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_STRING_56 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_STRING_56 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_STRING_56 + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_57 + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_57 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_57 + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -140($fp) + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_54 + # GOTO label_FALSE_53 + j label_FALSE_53 + label_COMPARE_BY_VALUE_57: + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) + lw $a0, 0($fp) + lw $a1, -140($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_54 + # GOTO label_FALSE_53 + j label_FALSE_53 + label_COMPARE_STRING_56: + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_CONTINUE_58 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_CONTINUE_58 + lw $t0, -136($fp) + beq $t0, 0, label_CONTINUE_58 + # GOTO label_FALSE_53 + j label_FALSE_53 + label_CONTINUE_58: + # LOCAL local_c2i_at_A2I_internal_33 --> -136($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_34 --> -140($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_59: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_60 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_59 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_60: + # Store result + sw $a2, -136($fp) + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + # IF_ZERO local_c2i_at_A2I_internal_33 GOTO label_TRUE_54 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_54 + label_FALSE_53: + # LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -132($fp) + # GOTO label_END_55 +j label_END_55 +label_TRUE_54: + # LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -132($fp) + label_END_55: +# LOCAL local_c2i_at_A2I_internal_30 --> -124($fp) +# LOCAL local_c2i_at_A2I_internal_32 --> -132($fp) +# Obtain value from -132($fp) +lw $v0, -132($fp) +lw $v0, 12($v0) +sw $v0, -124($fp) +# IF_ZERO local_c2i_at_A2I_internal_30 GOTO label_FALSEIF_51 +# IF_ZERO local_c2i_at_A2I_internal_30 GOTO label_FALSEIF_51 +lw $t0, -124($fp) +beq $t0, 0, label_FALSEIF_51 +# LOCAL local_c2i_at_A2I_internal_35 --> -144($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 5 +sw $t0, 12($v0) +sw $v0, -144($fp) +# LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) +# LOCAL local_c2i_at_A2I_internal_35 --> -144($fp) +# local_c2i_at_A2I_internal_31 = local_c2i_at_A2I_internal_35 +lw $t0, -144($fp) +sw $t0, -128($fp) +# GOTO label_ENDIF_52 +j label_ENDIF_52 +label_FALSEIF_51: + # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_10 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -164($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_63 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_63 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_63 + # IF_ZERO local_c2i_at_A2I_internal_40 GOTO label_FALSE_63 + # IF_ZERO local_c2i_at_A2I_internal_40 GOTO label_FALSE_63 + lw $t0, -164($fp) + beq $t0, 0, label_FALSE_63 + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_STRING_66 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_STRING_66 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_STRING_66 + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_67 + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_67 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_67 + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -164($fp) + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_64 + # GOTO label_FALSE_63 + j label_FALSE_63 + label_COMPARE_BY_VALUE_67: + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) + lw $a0, 0($fp) + lw $a1, -164($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_64 + # GOTO label_FALSE_63 + j label_FALSE_63 + label_COMPARE_STRING_66: + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_CONTINUE_68 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_CONTINUE_68 + lw $t0, -160($fp) + beq $t0, 0, label_CONTINUE_68 + # GOTO label_FALSE_63 + j label_FALSE_63 + label_CONTINUE_68: + # LOCAL local_c2i_at_A2I_internal_39 --> -160($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_40 --> -164($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_69: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_70 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_69 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_70: + # Store result + sw $a2, -160($fp) + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + # IF_ZERO local_c2i_at_A2I_internal_39 GOTO label_TRUE_64 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_64 + label_FALSE_63: + # LOCAL local_c2i_at_A2I_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -156($fp) + # GOTO label_END_65 +j label_END_65 +label_TRUE_64: + # LOCAL local_c2i_at_A2I_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -156($fp) + label_END_65: +# LOCAL local_c2i_at_A2I_internal_36 --> -148($fp) +# LOCAL local_c2i_at_A2I_internal_38 --> -156($fp) +# Obtain value from -156($fp) +lw $v0, -156($fp) +lw $v0, 12($v0) +sw $v0, -148($fp) +# IF_ZERO local_c2i_at_A2I_internal_36 GOTO label_FALSEIF_61 +# IF_ZERO local_c2i_at_A2I_internal_36 GOTO label_FALSEIF_61 +lw $t0, -148($fp) +beq $t0, 0, label_FALSEIF_61 +# LOCAL local_c2i_at_A2I_internal_41 --> -168($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 6 +sw $t0, 12($v0) +sw $v0, -168($fp) +# LOCAL local_c2i_at_A2I_internal_37 --> -152($fp) +# LOCAL local_c2i_at_A2I_internal_41 --> -168($fp) +# local_c2i_at_A2I_internal_37 = local_c2i_at_A2I_internal_41 +lw $t0, -168($fp) +sw $t0, -152($fp) +# GOTO label_ENDIF_62 +j label_ENDIF_62 +label_FALSEIF_61: + # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_11 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -188($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_73 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_73 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_73 + # IF_ZERO local_c2i_at_A2I_internal_46 GOTO label_FALSE_73 + # IF_ZERO local_c2i_at_A2I_internal_46 GOTO label_FALSE_73 + lw $t0, -188($fp) + beq $t0, 0, label_FALSE_73 + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_STRING_76 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_STRING_76 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_STRING_76 + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_77 + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_77 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_77 + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -188($fp) + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_74 + # GOTO label_FALSE_73 + j label_FALSE_73 + label_COMPARE_BY_VALUE_77: + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) + lw $a0, 0($fp) + lw $a1, -188($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_74 + # GOTO label_FALSE_73 + j label_FALSE_73 + label_COMPARE_STRING_76: + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_CONTINUE_78 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_CONTINUE_78 + lw $t0, -184($fp) + beq $t0, 0, label_CONTINUE_78 + # GOTO label_FALSE_73 + j label_FALSE_73 + label_CONTINUE_78: + # LOCAL local_c2i_at_A2I_internal_45 --> -184($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_46 --> -188($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_79: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_80 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_79 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_80: + # Store result + sw $a2, -184($fp) + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + # IF_ZERO local_c2i_at_A2I_internal_45 GOTO label_TRUE_74 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_74 + label_FALSE_73: + # LOCAL local_c2i_at_A2I_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -180($fp) + # GOTO label_END_75 +j label_END_75 +label_TRUE_74: + # LOCAL local_c2i_at_A2I_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -180($fp) + label_END_75: +# LOCAL local_c2i_at_A2I_internal_42 --> -172($fp) +# LOCAL local_c2i_at_A2I_internal_44 --> -180($fp) +# Obtain value from -180($fp) +lw $v0, -180($fp) +lw $v0, 12($v0) +sw $v0, -172($fp) +# IF_ZERO local_c2i_at_A2I_internal_42 GOTO label_FALSEIF_71 +# IF_ZERO local_c2i_at_A2I_internal_42 GOTO label_FALSEIF_71 +lw $t0, -172($fp) +beq $t0, 0, label_FALSEIF_71 +# LOCAL local_c2i_at_A2I_internal_47 --> -192($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 7 +sw $t0, 12($v0) +sw $v0, -192($fp) +# LOCAL local_c2i_at_A2I_internal_43 --> -176($fp) +# LOCAL local_c2i_at_A2I_internal_47 --> -192($fp) +# local_c2i_at_A2I_internal_43 = local_c2i_at_A2I_internal_47 +lw $t0, -192($fp) +sw $t0, -176($fp) +# GOTO label_ENDIF_72 +j label_ENDIF_72 +label_FALSEIF_71: + # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_12 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -212($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_83 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_83 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_83 + # IF_ZERO local_c2i_at_A2I_internal_52 GOTO label_FALSE_83 + # IF_ZERO local_c2i_at_A2I_internal_52 GOTO label_FALSE_83 + lw $t0, -212($fp) + beq $t0, 0, label_FALSE_83 + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_STRING_86 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_STRING_86 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_STRING_86 + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_87 + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_87 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_87 + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -212($fp) + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_84 + # GOTO label_FALSE_83 + j label_FALSE_83 + label_COMPARE_BY_VALUE_87: + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) + lw $a0, 0($fp) + lw $a1, -212($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_84 + # GOTO label_FALSE_83 + j label_FALSE_83 + label_COMPARE_STRING_86: + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_CONTINUE_88 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_CONTINUE_88 + lw $t0, -208($fp) + beq $t0, 0, label_CONTINUE_88 + # GOTO label_FALSE_83 + j label_FALSE_83 + label_CONTINUE_88: + # LOCAL local_c2i_at_A2I_internal_51 --> -208($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_52 --> -212($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_89: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_90 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_89 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_90: + # Store result + sw $a2, -208($fp) + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + # IF_ZERO local_c2i_at_A2I_internal_51 GOTO label_TRUE_84 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_84 + label_FALSE_83: + # LOCAL local_c2i_at_A2I_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -204($fp) + # GOTO label_END_85 +j label_END_85 +label_TRUE_84: + # LOCAL local_c2i_at_A2I_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -204($fp) + label_END_85: +# LOCAL local_c2i_at_A2I_internal_48 --> -196($fp) +# LOCAL local_c2i_at_A2I_internal_50 --> -204($fp) +# Obtain value from -204($fp) +lw $v0, -204($fp) +lw $v0, 12($v0) +sw $v0, -196($fp) +# IF_ZERO local_c2i_at_A2I_internal_48 GOTO label_FALSEIF_81 +# IF_ZERO local_c2i_at_A2I_internal_48 GOTO label_FALSEIF_81 +lw $t0, -196($fp) +beq $t0, 0, label_FALSEIF_81 +# LOCAL local_c2i_at_A2I_internal_53 --> -216($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 8 +sw $t0, 12($v0) +sw $v0, -216($fp) +# LOCAL local_c2i_at_A2I_internal_49 --> -200($fp) +# LOCAL local_c2i_at_A2I_internal_53 --> -216($fp) +# local_c2i_at_A2I_internal_49 = local_c2i_at_A2I_internal_53 +lw $t0, -216($fp) +sw $t0, -200($fp) +# GOTO label_ENDIF_82 +j label_ENDIF_82 +label_FALSEIF_81: + # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_13 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -236($fp) + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_93 + # IF_ZERO param_c2i_at_A2I_char_0 GOTO label_FALSE_93 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_93 + # IF_ZERO local_c2i_at_A2I_internal_58 GOTO label_FALSE_93 + # IF_ZERO local_c2i_at_A2I_internal_58 GOTO label_FALSE_93 + lw $t0, -236($fp) + beq $t0, 0, label_FALSE_93 + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_STRING_96 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_STRING_96 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_STRING_96 + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_97 + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_97 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_97 + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -236($fp) + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_94 + # GOTO label_FALSE_93 + j label_FALSE_93 + label_COMPARE_BY_VALUE_97: + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) + lw $a0, 0($fp) + lw $a1, -236($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_94 + # GOTO label_FALSE_93 + j label_FALSE_93 + label_COMPARE_STRING_96: + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_CONTINUE_98 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_CONTINUE_98 + lw $t0, -232($fp) + beq $t0, 0, label_CONTINUE_98 + # GOTO label_FALSE_93 + j label_FALSE_93 + label_CONTINUE_98: + # LOCAL local_c2i_at_A2I_internal_57 --> -232($fp) + # PARAM param_c2i_at_A2I_char_0 --> 0($fp) + # LOCAL local_c2i_at_A2I_internal_58 --> -236($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_99: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_100 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_99 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_100: + # Store result + sw $a2, -232($fp) + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + # IF_ZERO local_c2i_at_A2I_internal_57 GOTO label_TRUE_94 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_94 + label_FALSE_93: + # LOCAL local_c2i_at_A2I_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -228($fp) + # GOTO label_END_95 +j label_END_95 +label_TRUE_94: + # LOCAL local_c2i_at_A2I_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -228($fp) + label_END_95: +# LOCAL local_c2i_at_A2I_internal_54 --> -220($fp) +# LOCAL local_c2i_at_A2I_internal_56 --> -228($fp) +# Obtain value from -228($fp) +lw $v0, -228($fp) +lw $v0, 12($v0) +sw $v0, -220($fp) +# IF_ZERO local_c2i_at_A2I_internal_54 GOTO label_FALSEIF_91 +# IF_ZERO local_c2i_at_A2I_internal_54 GOTO label_FALSEIF_91 +lw $t0, -220($fp) +beq $t0, 0, label_FALSEIF_91 +# LOCAL local_c2i_at_A2I_internal_59 --> -240($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 9 +sw $t0, 12($v0) +sw $v0, -240($fp) +# LOCAL local_c2i_at_A2I_internal_55 --> -224($fp) +# LOCAL local_c2i_at_A2I_internal_59 --> -240($fp) +# local_c2i_at_A2I_internal_55 = local_c2i_at_A2I_internal_59 +lw $t0, -240($fp) +sw $t0, -224($fp) +# GOTO label_ENDIF_92 +j label_ENDIF_92 +label_FALSEIF_91: + # LOCAL local_c2i_at_A2I_internal_62 --> -252($fp) + # local_c2i_at_A2I_internal_62 = SELF + sw $s1, -252($fp) + # LOCAL local_c2i_at_A2I_internal_60 --> -244($fp) + # LOCAL local_c2i_at_A2I_internal_62 --> -252($fp) + # local_c2i_at_A2I_internal_60 = local_c2i_at_A2I_internal_62 + lw $t0, -252($fp) + sw $t0, -244($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_c2i_at_A2I_internal_60 --> -244($fp) + # LOCAL local_c2i_at_A2I_internal_61 --> -248($fp) + # local_c2i_at_A2I_internal_61 = VCALL local_c2i_at_A2I_internal_60 abort + # Save new self pointer in $s1 + lw $s1, -244($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 60($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -248($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_c2i_at_A2I_internal_63 --> -256($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -256($fp) + # LOCAL local_c2i_at_A2I_internal_55 --> -224($fp) + # LOCAL local_c2i_at_A2I_internal_63 --> -256($fp) + # local_c2i_at_A2I_internal_55 = local_c2i_at_A2I_internal_63 + lw $t0, -256($fp) + sw $t0, -224($fp) + label_ENDIF_92: +# LOCAL local_c2i_at_A2I_internal_49 --> -200($fp) +# LOCAL local_c2i_at_A2I_internal_55 --> -224($fp) +# local_c2i_at_A2I_internal_49 = local_c2i_at_A2I_internal_55 +lw $t0, -224($fp) +sw $t0, -200($fp) +label_ENDIF_82: +# LOCAL local_c2i_at_A2I_internal_43 --> -176($fp) +# LOCAL local_c2i_at_A2I_internal_49 --> -200($fp) +# local_c2i_at_A2I_internal_43 = local_c2i_at_A2I_internal_49 +lw $t0, -200($fp) +sw $t0, -176($fp) +label_ENDIF_72: +# LOCAL local_c2i_at_A2I_internal_37 --> -152($fp) +# LOCAL local_c2i_at_A2I_internal_43 --> -176($fp) +# local_c2i_at_A2I_internal_37 = local_c2i_at_A2I_internal_43 +lw $t0, -176($fp) +sw $t0, -152($fp) +label_ENDIF_62: +# LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) +# LOCAL local_c2i_at_A2I_internal_37 --> -152($fp) +# local_c2i_at_A2I_internal_31 = local_c2i_at_A2I_internal_37 +lw $t0, -152($fp) +sw $t0, -128($fp) +label_ENDIF_52: +# LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) +# LOCAL local_c2i_at_A2I_internal_31 --> -128($fp) +# local_c2i_at_A2I_internal_25 = local_c2i_at_A2I_internal_31 +lw $t0, -128($fp) +sw $t0, -104($fp) +label_ENDIF_42: +# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) +# LOCAL local_c2i_at_A2I_internal_25 --> -104($fp) +# local_c2i_at_A2I_internal_19 = local_c2i_at_A2I_internal_25 +lw $t0, -104($fp) +sw $t0, -80($fp) +label_ENDIF_32: +# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) +# LOCAL local_c2i_at_A2I_internal_19 --> -80($fp) +# local_c2i_at_A2I_internal_13 = local_c2i_at_A2I_internal_19 +lw $t0, -80($fp) +sw $t0, -56($fp) +label_ENDIF_22: +# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) +# LOCAL local_c2i_at_A2I_internal_13 --> -56($fp) +# local_c2i_at_A2I_internal_7 = local_c2i_at_A2I_internal_13 +lw $t0, -56($fp) +sw $t0, -32($fp) +label_ENDIF_12: +# LOCAL local_c2i_at_A2I_internal_1 --> -8($fp) +# LOCAL local_c2i_at_A2I_internal_7 --> -32($fp) +# local_c2i_at_A2I_internal_1 = local_c2i_at_A2I_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +label_ENDIF_2: +# RETURN local_c2i_at_A2I_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_c2i_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 264 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_i2c_at_A2I implementation. +# @Params: +# 0($fp) = param_i2c_at_A2I_i_0 +function_i2c_at_A2I: + # Allocate stack frame for function function_i2c_at_A2I. + subu $sp, $sp, 264 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 264 + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_103 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_103 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_103 + # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_103 + # IF_ZERO local_i2c_at_A2I_internal_4 GOTO label_FALSE_103 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_103 + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_STRING_106 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_STRING_106 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_106 + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_107 + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_107 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_107 + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_104 + # GOTO label_FALSE_103 + j label_FALSE_103 + label_COMPARE_BY_VALUE_107: + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_104 + # GOTO label_FALSE_103 + j label_FALSE_103 + label_COMPARE_STRING_106: + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_CONTINUE_108 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_CONTINUE_108 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_108 + # GOTO label_FALSE_103 + j label_FALSE_103 + label_CONTINUE_108: + # LOCAL local_i2c_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_109: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_110 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_109 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_110: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + # IF_ZERO local_i2c_at_A2I_internal_3 GOTO label_TRUE_104 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_104 + label_FALSE_103: + # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_105 +j label_END_105 +label_TRUE_104: + # LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_105: +# LOCAL local_i2c_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2c_at_A2I_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSEIF_101 +# IF_ZERO local_i2c_at_A2I_internal_0 GOTO label_FALSEIF_101 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_101 +# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_14 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -24($fp) +# LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) +# LOCAL local_i2c_at_A2I_internal_5 --> -24($fp) +# local_i2c_at_A2I_internal_1 = local_i2c_at_A2I_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_102 +j label_ENDIF_102 +label_FALSEIF_101: + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_113 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_113 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_113 + # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_113 + # IF_ZERO local_i2c_at_A2I_internal_10 GOTO label_FALSE_113 + lw $t0, -44($fp) + beq $t0, 0, label_FALSE_113 + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_STRING_116 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_STRING_116 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_116 + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_117 + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_COMPARE_BY_VALUE_117 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_117 + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -44($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_114 + # GOTO label_FALSE_113 + j label_FALSE_113 + label_COMPARE_BY_VALUE_117: + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + lw $a0, 0($fp) + lw $a1, -44($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_114 + # GOTO label_FALSE_113 + j label_FALSE_113 + label_COMPARE_STRING_116: + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_CONTINUE_118 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_CONTINUE_118 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_118 + # GOTO label_FALSE_113 + j label_FALSE_113 + label_CONTINUE_118: + # LOCAL local_i2c_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_10 --> -44($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_119: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_120 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_119 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_120: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + # IF_ZERO local_i2c_at_A2I_internal_9 GOTO label_TRUE_114 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_114 + label_FALSE_113: + # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_115 +j label_END_115 +label_TRUE_114: + # LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_115: +# LOCAL local_i2c_at_A2I_internal_6 --> -28($fp) +# LOCAL local_i2c_at_A2I_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSEIF_111 +# IF_ZERO local_i2c_at_A2I_internal_6 GOTO label_FALSEIF_111 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_111 +# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_15 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -48($fp) +# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) +# LOCAL local_i2c_at_A2I_internal_11 --> -48($fp) +# local_i2c_at_A2I_internal_7 = local_i2c_at_A2I_internal_11 +lw $t0, -48($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_112 +j label_ENDIF_112 +label_FALSEIF_111: + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 2 + sw $t0, 12($v0) + sw $v0, -68($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_123 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_123 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_123 + # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_123 + # IF_ZERO local_i2c_at_A2I_internal_16 GOTO label_FALSE_123 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_123 + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_STRING_126 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_STRING_126 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_STRING_126 + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_127 + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_COMPARE_BY_VALUE_127 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_127 + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_124 + # GOTO label_FALSE_123 + j label_FALSE_123 + label_COMPARE_BY_VALUE_127: + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + lw $a0, 0($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_124 + # GOTO label_FALSE_123 + j label_FALSE_123 + label_COMPARE_STRING_126: + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_CONTINUE_128 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_CONTINUE_128 + lw $t0, -64($fp) + beq $t0, 0, label_CONTINUE_128 + # GOTO label_FALSE_123 + j label_FALSE_123 + label_CONTINUE_128: + # LOCAL local_i2c_at_A2I_internal_15 --> -64($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_129: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_130 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_129 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_130: + # Store result + sw $a2, -64($fp) + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + # IF_ZERO local_i2c_at_A2I_internal_15 GOTO label_TRUE_124 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_124 + label_FALSE_123: + # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # GOTO label_END_125 +j label_END_125 +label_TRUE_124: + # LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + label_END_125: +# LOCAL local_i2c_at_A2I_internal_12 --> -52($fp) +# LOCAL local_i2c_at_A2I_internal_14 --> -60($fp) +# Obtain value from -60($fp) +lw $v0, -60($fp) +lw $v0, 12($v0) +sw $v0, -52($fp) +# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSEIF_121 +# IF_ZERO local_i2c_at_A2I_internal_12 GOTO label_FALSEIF_121 +lw $t0, -52($fp) +beq $t0, 0, label_FALSEIF_121 +# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_16 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -72($fp) +# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) +# LOCAL local_i2c_at_A2I_internal_17 --> -72($fp) +# local_i2c_at_A2I_internal_13 = local_i2c_at_A2I_internal_17 +lw $t0, -72($fp) +sw $t0, -56($fp) +# GOTO label_ENDIF_122 +j label_ENDIF_122 +label_FALSEIF_121: + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 3 + sw $t0, 12($v0) + sw $v0, -92($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_133 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_133 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_133 + # IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_FALSE_133 + # IF_ZERO local_i2c_at_A2I_internal_22 GOTO label_FALSE_133 + lw $t0, -92($fp) + beq $t0, 0, label_FALSE_133 + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_STRING_136 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_STRING_136 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_STRING_136 + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_137 + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_COMPARE_BY_VALUE_137 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_137 + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -92($fp) + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_134 + # GOTO label_FALSE_133 + j label_FALSE_133 + label_COMPARE_BY_VALUE_137: + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + lw $a0, 0($fp) + lw $a1, -92($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_134 + # GOTO label_FALSE_133 + j label_FALSE_133 + label_COMPARE_STRING_136: + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_CONTINUE_138 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_CONTINUE_138 + lw $t0, -88($fp) + beq $t0, 0, label_CONTINUE_138 + # GOTO label_FALSE_133 + j label_FALSE_133 + label_CONTINUE_138: + # LOCAL local_i2c_at_A2I_internal_21 --> -88($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_22 --> -92($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_139: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_140 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_139 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_140: + # Store result + sw $a2, -88($fp) + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + # IF_ZERO local_i2c_at_A2I_internal_21 GOTO label_TRUE_134 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_134 + label_FALSE_133: + # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -84($fp) + # GOTO label_END_135 +j label_END_135 +label_TRUE_134: + # LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -84($fp) + label_END_135: +# LOCAL local_i2c_at_A2I_internal_18 --> -76($fp) +# LOCAL local_i2c_at_A2I_internal_20 --> -84($fp) +# Obtain value from -84($fp) +lw $v0, -84($fp) +lw $v0, 12($v0) +sw $v0, -76($fp) +# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSEIF_131 +# IF_ZERO local_i2c_at_A2I_internal_18 GOTO label_FALSEIF_131 +lw $t0, -76($fp) +beq $t0, 0, label_FALSEIF_131 +# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_17 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -96($fp) +# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) +# LOCAL local_i2c_at_A2I_internal_23 --> -96($fp) +# local_i2c_at_A2I_internal_19 = local_i2c_at_A2I_internal_23 +lw $t0, -96($fp) +sw $t0, -80($fp) +# GOTO label_ENDIF_132 +j label_ENDIF_132 +label_FALSEIF_131: + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 4 + sw $t0, 12($v0) + sw $v0, -116($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_143 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_143 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_143 + # IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_FALSE_143 + # IF_ZERO local_i2c_at_A2I_internal_28 GOTO label_FALSE_143 + lw $t0, -116($fp) + beq $t0, 0, label_FALSE_143 + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_STRING_146 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_STRING_146 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_STRING_146 + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_147 + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_COMPARE_BY_VALUE_147 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_147 + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -116($fp) + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_144 + # GOTO label_FALSE_143 + j label_FALSE_143 + label_COMPARE_BY_VALUE_147: + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + lw $a0, 0($fp) + lw $a1, -116($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_144 + # GOTO label_FALSE_143 + j label_FALSE_143 + label_COMPARE_STRING_146: + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_CONTINUE_148 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_CONTINUE_148 + lw $t0, -112($fp) + beq $t0, 0, label_CONTINUE_148 + # GOTO label_FALSE_143 + j label_FALSE_143 + label_CONTINUE_148: + # LOCAL local_i2c_at_A2I_internal_27 --> -112($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_28 --> -116($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_149: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_150 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_149 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_150: + # Store result + sw $a2, -112($fp) + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + # IF_ZERO local_i2c_at_A2I_internal_27 GOTO label_TRUE_144 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_144 + label_FALSE_143: + # LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -108($fp) + # GOTO label_END_145 +j label_END_145 +label_TRUE_144: + # LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -108($fp) + label_END_145: +# LOCAL local_i2c_at_A2I_internal_24 --> -100($fp) +# LOCAL local_i2c_at_A2I_internal_26 --> -108($fp) +# Obtain value from -108($fp) +lw $v0, -108($fp) +lw $v0, 12($v0) +sw $v0, -100($fp) +# IF_ZERO local_i2c_at_A2I_internal_24 GOTO label_FALSEIF_141 +# IF_ZERO local_i2c_at_A2I_internal_24 GOTO label_FALSEIF_141 +lw $t0, -100($fp) +beq $t0, 0, label_FALSEIF_141 +# LOCAL local_i2c_at_A2I_internal_29 --> -120($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_18 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -120($fp) +# LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) +# LOCAL local_i2c_at_A2I_internal_29 --> -120($fp) +# local_i2c_at_A2I_internal_25 = local_i2c_at_A2I_internal_29 +lw $t0, -120($fp) +sw $t0, -104($fp) +# GOTO label_ENDIF_142 +j label_ENDIF_142 +label_FALSEIF_141: + # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 5 + sw $t0, 12($v0) + sw $v0, -140($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_153 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_153 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_153 + # IF_ZERO local_i2c_at_A2I_internal_34 GOTO label_FALSE_153 + # IF_ZERO local_i2c_at_A2I_internal_34 GOTO label_FALSE_153 + lw $t0, -140($fp) + beq $t0, 0, label_FALSE_153 + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_STRING_156 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_STRING_156 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_STRING_156 + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_157 + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_COMPARE_BY_VALUE_157 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_157 + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -140($fp) + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_154 + # GOTO label_FALSE_153 + j label_FALSE_153 + label_COMPARE_BY_VALUE_157: + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) + lw $a0, 0($fp) + lw $a1, -140($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_154 + # GOTO label_FALSE_153 + j label_FALSE_153 + label_COMPARE_STRING_156: + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_CONTINUE_158 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_CONTINUE_158 + lw $t0, -136($fp) + beq $t0, 0, label_CONTINUE_158 + # GOTO label_FALSE_153 + j label_FALSE_153 + label_CONTINUE_158: + # LOCAL local_i2c_at_A2I_internal_33 --> -136($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_34 --> -140($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_159: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_160 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_159 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_160: + # Store result + sw $a2, -136($fp) + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + # IF_ZERO local_i2c_at_A2I_internal_33 GOTO label_TRUE_154 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_154 + label_FALSE_153: + # LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -132($fp) + # GOTO label_END_155 +j label_END_155 +label_TRUE_154: + # LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -132($fp) + label_END_155: +# LOCAL local_i2c_at_A2I_internal_30 --> -124($fp) +# LOCAL local_i2c_at_A2I_internal_32 --> -132($fp) +# Obtain value from -132($fp) +lw $v0, -132($fp) +lw $v0, 12($v0) +sw $v0, -124($fp) +# IF_ZERO local_i2c_at_A2I_internal_30 GOTO label_FALSEIF_151 +# IF_ZERO local_i2c_at_A2I_internal_30 GOTO label_FALSEIF_151 +lw $t0, -124($fp) +beq $t0, 0, label_FALSEIF_151 +# LOCAL local_i2c_at_A2I_internal_35 --> -144($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_19 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -144($fp) +# LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) +# LOCAL local_i2c_at_A2I_internal_35 --> -144($fp) +# local_i2c_at_A2I_internal_31 = local_i2c_at_A2I_internal_35 +lw $t0, -144($fp) +sw $t0, -128($fp) +# GOTO label_ENDIF_152 +j label_ENDIF_152 +label_FALSEIF_151: + # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 6 + sw $t0, 12($v0) + sw $v0, -164($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_163 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_163 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_163 + # IF_ZERO local_i2c_at_A2I_internal_40 GOTO label_FALSE_163 + # IF_ZERO local_i2c_at_A2I_internal_40 GOTO label_FALSE_163 + lw $t0, -164($fp) + beq $t0, 0, label_FALSE_163 + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_STRING_166 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_STRING_166 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_STRING_166 + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_167 + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_COMPARE_BY_VALUE_167 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_167 + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -164($fp) + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_164 + # GOTO label_FALSE_163 + j label_FALSE_163 + label_COMPARE_BY_VALUE_167: + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) + lw $a0, 0($fp) + lw $a1, -164($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_164 + # GOTO label_FALSE_163 + j label_FALSE_163 + label_COMPARE_STRING_166: + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_CONTINUE_168 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_CONTINUE_168 + lw $t0, -160($fp) + beq $t0, 0, label_CONTINUE_168 + # GOTO label_FALSE_163 + j label_FALSE_163 + label_CONTINUE_168: + # LOCAL local_i2c_at_A2I_internal_39 --> -160($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_40 --> -164($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_169: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_170 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_169 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_170: + # Store result + sw $a2, -160($fp) + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + # IF_ZERO local_i2c_at_A2I_internal_39 GOTO label_TRUE_164 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_164 + label_FALSE_163: + # LOCAL local_i2c_at_A2I_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -156($fp) + # GOTO label_END_165 +j label_END_165 +label_TRUE_164: + # LOCAL local_i2c_at_A2I_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -156($fp) + label_END_165: +# LOCAL local_i2c_at_A2I_internal_36 --> -148($fp) +# LOCAL local_i2c_at_A2I_internal_38 --> -156($fp) +# Obtain value from -156($fp) +lw $v0, -156($fp) +lw $v0, 12($v0) +sw $v0, -148($fp) +# IF_ZERO local_i2c_at_A2I_internal_36 GOTO label_FALSEIF_161 +# IF_ZERO local_i2c_at_A2I_internal_36 GOTO label_FALSEIF_161 +lw $t0, -148($fp) +beq $t0, 0, label_FALSEIF_161 +# LOCAL local_i2c_at_A2I_internal_41 --> -168($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_20 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -168($fp) +# LOCAL local_i2c_at_A2I_internal_37 --> -152($fp) +# LOCAL local_i2c_at_A2I_internal_41 --> -168($fp) +# local_i2c_at_A2I_internal_37 = local_i2c_at_A2I_internal_41 +lw $t0, -168($fp) +sw $t0, -152($fp) +# GOTO label_ENDIF_162 +j label_ENDIF_162 +label_FALSEIF_161: + # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 7 + sw $t0, 12($v0) + sw $v0, -188($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_173 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_173 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_173 + # IF_ZERO local_i2c_at_A2I_internal_46 GOTO label_FALSE_173 + # IF_ZERO local_i2c_at_A2I_internal_46 GOTO label_FALSE_173 + lw $t0, -188($fp) + beq $t0, 0, label_FALSE_173 + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_STRING_176 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_STRING_176 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_STRING_176 + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_177 + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_COMPARE_BY_VALUE_177 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_177 + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -188($fp) + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_174 + # GOTO label_FALSE_173 + j label_FALSE_173 + label_COMPARE_BY_VALUE_177: + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) + lw $a0, 0($fp) + lw $a1, -188($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_174 + # GOTO label_FALSE_173 + j label_FALSE_173 + label_COMPARE_STRING_176: + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_CONTINUE_178 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_CONTINUE_178 + lw $t0, -184($fp) + beq $t0, 0, label_CONTINUE_178 + # GOTO label_FALSE_173 + j label_FALSE_173 + label_CONTINUE_178: + # LOCAL local_i2c_at_A2I_internal_45 --> -184($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_46 --> -188($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_179: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_180 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_179 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_180: + # Store result + sw $a2, -184($fp) + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + # IF_ZERO local_i2c_at_A2I_internal_45 GOTO label_TRUE_174 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_174 + label_FALSE_173: + # LOCAL local_i2c_at_A2I_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -180($fp) + # GOTO label_END_175 +j label_END_175 +label_TRUE_174: + # LOCAL local_i2c_at_A2I_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -180($fp) + label_END_175: +# LOCAL local_i2c_at_A2I_internal_42 --> -172($fp) +# LOCAL local_i2c_at_A2I_internal_44 --> -180($fp) +# Obtain value from -180($fp) +lw $v0, -180($fp) +lw $v0, 12($v0) +sw $v0, -172($fp) +# IF_ZERO local_i2c_at_A2I_internal_42 GOTO label_FALSEIF_171 +# IF_ZERO local_i2c_at_A2I_internal_42 GOTO label_FALSEIF_171 +lw $t0, -172($fp) +beq $t0, 0, label_FALSEIF_171 +# LOCAL local_i2c_at_A2I_internal_47 --> -192($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_21 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -192($fp) +# LOCAL local_i2c_at_A2I_internal_43 --> -176($fp) +# LOCAL local_i2c_at_A2I_internal_47 --> -192($fp) +# local_i2c_at_A2I_internal_43 = local_i2c_at_A2I_internal_47 +lw $t0, -192($fp) +sw $t0, -176($fp) +# GOTO label_ENDIF_172 +j label_ENDIF_172 +label_FALSEIF_171: + # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 8 + sw $t0, 12($v0) + sw $v0, -212($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_183 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_183 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_183 + # IF_ZERO local_i2c_at_A2I_internal_52 GOTO label_FALSE_183 + # IF_ZERO local_i2c_at_A2I_internal_52 GOTO label_FALSE_183 + lw $t0, -212($fp) + beq $t0, 0, label_FALSE_183 + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_STRING_186 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_STRING_186 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_STRING_186 + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_187 + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_COMPARE_BY_VALUE_187 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_187 + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -212($fp) + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_184 + # GOTO label_FALSE_183 + j label_FALSE_183 + label_COMPARE_BY_VALUE_187: + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) + lw $a0, 0($fp) + lw $a1, -212($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_184 + # GOTO label_FALSE_183 + j label_FALSE_183 + label_COMPARE_STRING_186: + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_CONTINUE_188 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_CONTINUE_188 + lw $t0, -208($fp) + beq $t0, 0, label_CONTINUE_188 + # GOTO label_FALSE_183 + j label_FALSE_183 + label_CONTINUE_188: + # LOCAL local_i2c_at_A2I_internal_51 --> -208($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_52 --> -212($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_189: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_190 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_189 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_190: + # Store result + sw $a2, -208($fp) + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + # IF_ZERO local_i2c_at_A2I_internal_51 GOTO label_TRUE_184 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_184 + label_FALSE_183: + # LOCAL local_i2c_at_A2I_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -204($fp) + # GOTO label_END_185 +j label_END_185 +label_TRUE_184: + # LOCAL local_i2c_at_A2I_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -204($fp) + label_END_185: +# LOCAL local_i2c_at_A2I_internal_48 --> -196($fp) +# LOCAL local_i2c_at_A2I_internal_50 --> -204($fp) +# Obtain value from -204($fp) +lw $v0, -204($fp) +lw $v0, 12($v0) +sw $v0, -196($fp) +# IF_ZERO local_i2c_at_A2I_internal_48 GOTO label_FALSEIF_181 +# IF_ZERO local_i2c_at_A2I_internal_48 GOTO label_FALSEIF_181 +lw $t0, -196($fp) +beq $t0, 0, label_FALSEIF_181 +# LOCAL local_i2c_at_A2I_internal_53 --> -216($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_22 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -216($fp) +# LOCAL local_i2c_at_A2I_internal_49 --> -200($fp) +# LOCAL local_i2c_at_A2I_internal_53 --> -216($fp) +# local_i2c_at_A2I_internal_49 = local_i2c_at_A2I_internal_53 +lw $t0, -216($fp) +sw $t0, -200($fp) +# GOTO label_ENDIF_182 +j label_ENDIF_182 +label_FALSEIF_181: + # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 9 + sw $t0, 12($v0) + sw $v0, -236($fp) + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_193 + # IF_ZERO param_i2c_at_A2I_i_0 GOTO label_FALSE_193 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_193 + # IF_ZERO local_i2c_at_A2I_internal_58 GOTO label_FALSE_193 + # IF_ZERO local_i2c_at_A2I_internal_58 GOTO label_FALSE_193 + lw $t0, -236($fp) + beq $t0, 0, label_FALSE_193 + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_STRING_196 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_STRING_196 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_STRING_196 + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_197 + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_COMPARE_BY_VALUE_197 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_197 + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -236($fp) + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_194 + # GOTO label_FALSE_193 + j label_FALSE_193 + label_COMPARE_BY_VALUE_197: + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) + lw $a0, 0($fp) + lw $a1, -236($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_194 + # GOTO label_FALSE_193 + j label_FALSE_193 + label_COMPARE_STRING_196: + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_CONTINUE_198 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_CONTINUE_198 + lw $t0, -232($fp) + beq $t0, 0, label_CONTINUE_198 + # GOTO label_FALSE_193 + j label_FALSE_193 + label_CONTINUE_198: + # LOCAL local_i2c_at_A2I_internal_57 --> -232($fp) + # PARAM param_i2c_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2c_at_A2I_internal_58 --> -236($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_199: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_200 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_199 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_200: + # Store result + sw $a2, -232($fp) + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + # IF_ZERO local_i2c_at_A2I_internal_57 GOTO label_TRUE_194 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_194 + label_FALSE_193: + # LOCAL local_i2c_at_A2I_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -228($fp) + # GOTO label_END_195 +j label_END_195 +label_TRUE_194: + # LOCAL local_i2c_at_A2I_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -228($fp) + label_END_195: +# LOCAL local_i2c_at_A2I_internal_54 --> -220($fp) +# LOCAL local_i2c_at_A2I_internal_56 --> -228($fp) +# Obtain value from -228($fp) +lw $v0, -228($fp) +lw $v0, 12($v0) +sw $v0, -220($fp) +# IF_ZERO local_i2c_at_A2I_internal_54 GOTO label_FALSEIF_191 +# IF_ZERO local_i2c_at_A2I_internal_54 GOTO label_FALSEIF_191 +lw $t0, -220($fp) +beq $t0, 0, label_FALSEIF_191 +# LOCAL local_i2c_at_A2I_internal_59 --> -240($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_23 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -240($fp) +# LOCAL local_i2c_at_A2I_internal_55 --> -224($fp) +# LOCAL local_i2c_at_A2I_internal_59 --> -240($fp) +# local_i2c_at_A2I_internal_55 = local_i2c_at_A2I_internal_59 +lw $t0, -240($fp) +sw $t0, -224($fp) +# GOTO label_ENDIF_192 +j label_ENDIF_192 +label_FALSEIF_191: + # LOCAL local_i2c_at_A2I_internal_62 --> -252($fp) + # local_i2c_at_A2I_internal_62 = SELF + sw $s1, -252($fp) + # LOCAL local_i2c_at_A2I_internal_60 --> -244($fp) + # LOCAL local_i2c_at_A2I_internal_62 --> -252($fp) + # local_i2c_at_A2I_internal_60 = local_i2c_at_A2I_internal_62 + lw $t0, -252($fp) + sw $t0, -244($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2c_at_A2I_internal_60 --> -244($fp) + # LOCAL local_i2c_at_A2I_internal_61 --> -248($fp) + # local_i2c_at_A2I_internal_61 = VCALL local_i2c_at_A2I_internal_60 abort + # Save new self pointer in $s1 + lw $s1, -244($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 60($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -248($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2c_at_A2I_internal_63 --> -256($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_24 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -256($fp) + # LOCAL local_i2c_at_A2I_internal_55 --> -224($fp) + # LOCAL local_i2c_at_A2I_internal_63 --> -256($fp) + # local_i2c_at_A2I_internal_55 = local_i2c_at_A2I_internal_63 + lw $t0, -256($fp) + sw $t0, -224($fp) + label_ENDIF_192: +# LOCAL local_i2c_at_A2I_internal_49 --> -200($fp) +# LOCAL local_i2c_at_A2I_internal_55 --> -224($fp) +# local_i2c_at_A2I_internal_49 = local_i2c_at_A2I_internal_55 +lw $t0, -224($fp) +sw $t0, -200($fp) +label_ENDIF_182: +# LOCAL local_i2c_at_A2I_internal_43 --> -176($fp) +# LOCAL local_i2c_at_A2I_internal_49 --> -200($fp) +# local_i2c_at_A2I_internal_43 = local_i2c_at_A2I_internal_49 +lw $t0, -200($fp) +sw $t0, -176($fp) +label_ENDIF_172: +# LOCAL local_i2c_at_A2I_internal_37 --> -152($fp) +# LOCAL local_i2c_at_A2I_internal_43 --> -176($fp) +# local_i2c_at_A2I_internal_37 = local_i2c_at_A2I_internal_43 +lw $t0, -176($fp) +sw $t0, -152($fp) +label_ENDIF_162: +# LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) +# LOCAL local_i2c_at_A2I_internal_37 --> -152($fp) +# local_i2c_at_A2I_internal_31 = local_i2c_at_A2I_internal_37 +lw $t0, -152($fp) +sw $t0, -128($fp) +label_ENDIF_152: +# LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) +# LOCAL local_i2c_at_A2I_internal_31 --> -128($fp) +# local_i2c_at_A2I_internal_25 = local_i2c_at_A2I_internal_31 +lw $t0, -128($fp) +sw $t0, -104($fp) +label_ENDIF_142: +# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) +# LOCAL local_i2c_at_A2I_internal_25 --> -104($fp) +# local_i2c_at_A2I_internal_19 = local_i2c_at_A2I_internal_25 +lw $t0, -104($fp) +sw $t0, -80($fp) +label_ENDIF_132: +# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) +# LOCAL local_i2c_at_A2I_internal_19 --> -80($fp) +# local_i2c_at_A2I_internal_13 = local_i2c_at_A2I_internal_19 +lw $t0, -80($fp) +sw $t0, -56($fp) +label_ENDIF_122: +# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) +# LOCAL local_i2c_at_A2I_internal_13 --> -56($fp) +# local_i2c_at_A2I_internal_7 = local_i2c_at_A2I_internal_13 +lw $t0, -56($fp) +sw $t0, -32($fp) +label_ENDIF_112: +# LOCAL local_i2c_at_A2I_internal_1 --> -8($fp) +# LOCAL local_i2c_at_A2I_internal_7 --> -32($fp) +# local_i2c_at_A2I_internal_1 = local_i2c_at_A2I_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +label_ENDIF_102: +# RETURN local_i2c_at_A2I_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_i2c_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 264 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_at_A2I implementation. +# @Params: +# 0($fp) = param_a2i_at_A2I_s_0 +function_a2i_at_A2I: + # Allocate stack frame for function function_a2i_at_A2I. + subu $sp, $sp, 208 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 208 + # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_4 = PARAM param_a2i_at_A2I_s_0 + lw $t0, 0($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_4 --> -20($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # local_a2i_at_A2I_internal_5 = VCALL local_a2i_at_A2I_internal_4 length + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_FALSE_203 + # IF_ZERO local_a2i_at_A2I_internal_5 GOTO label_FALSE_203 + lw $t0, -24($fp) + beq $t0, 0, label_FALSE_203 + # IF_ZERO local_a2i_at_A2I_internal_6 GOTO label_FALSE_203 + # IF_ZERO local_a2i_at_A2I_internal_6 GOTO label_FALSE_203 + lw $t0, -28($fp) + beq $t0, 0, label_FALSE_203 + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # Comparing -24($fp) type with String + la $v0, String + lw $a0, -24($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_206 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_STRING_206 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_206 + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # Comparing -24($fp) type with Bool + la $v0, Bool + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_207 + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # Comparing -24($fp) type with Int + la $v0, Int + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_207 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_207 + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + # Load pointers and SUB + lw $a0, -24($fp) + lw $a1, -28($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_204 + # GOTO label_FALSE_203 + j label_FALSE_203 + label_COMPARE_BY_VALUE_207: + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + lw $a0, -24($fp) + lw $a1, -28($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_204 + # GOTO label_FALSE_203 + j label_FALSE_203 + label_COMPARE_STRING_206: + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -28($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_CONTINUE_208 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_CONTINUE_208 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_208 + # GOTO label_FALSE_203 + j label_FALSE_203 + label_CONTINUE_208: + # LOCAL local_a2i_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_at_A2I_internal_5 --> -24($fp) + # LOCAL local_a2i_at_A2I_internal_6 --> -28($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -28($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_209: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_210 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_209 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_210: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + # IF_ZERO local_a2i_at_A2I_internal_3 GOTO label_TRUE_204 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_204 + label_FALSE_203: + # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_205 +j label_END_205 +label_TRUE_204: + # LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_205: +# LOCAL local_a2i_at_A2I_internal_0 --> -4($fp) +# LOCAL local_a2i_at_A2I_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSEIF_201 +# IF_ZERO local_a2i_at_A2I_internal_0 GOTO label_FALSEIF_201 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_201 +# LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -32($fp) +# LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) +# LOCAL local_a2i_at_A2I_internal_7 --> -32($fp) +# local_a2i_at_A2I_internal_1 = local_a2i_at_A2I_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_202 +j label_ENDIF_202 +label_FALSEIF_201: + # LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_12 = PARAM param_a2i_at_A2I_s_0 + lw $t0, 0($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # ARG local_a2i_at_A2I_internal_14 + # LOCAL local_a2i_at_A2I_internal_14 --> -60($fp) + lw $t0, -60($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -64($fp) + # ARG local_a2i_at_A2I_internal_15 + # LOCAL local_a2i_at_A2I_internal_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_A2I_internal_12 --> -52($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # local_a2i_at_A2I_internal_13 = VCALL local_a2i_at_A2I_internal_12 substr + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_25 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -68($fp) + # IF_ZERO local_a2i_at_A2I_internal_13 GOTO label_FALSE_213 + # IF_ZERO local_a2i_at_A2I_internal_13 GOTO label_FALSE_213 + lw $t0, -56($fp) + beq $t0, 0, label_FALSE_213 + # IF_ZERO local_a2i_at_A2I_internal_16 GOTO label_FALSE_213 + # IF_ZERO local_a2i_at_A2I_internal_16 GOTO label_FALSE_213 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_213 + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # Comparing -56($fp) type with String + la $v0, String + lw $a0, -56($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_STRING_216 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_STRING_216 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_STRING_216 + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # Comparing -56($fp) type with Bool + la $v0, Bool + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_217 + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # Comparing -56($fp) type with Int + la $v0, Int + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_COMPARE_BY_VALUE_217 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_217 + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, -56($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_214 + # GOTO label_FALSE_213 + j label_FALSE_213 + label_COMPARE_BY_VALUE_217: + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) + lw $a0, -56($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_214 + # GOTO label_FALSE_213 + j label_FALSE_213 + label_COMPARE_STRING_216: + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_CONTINUE_218 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_CONTINUE_218 + lw $t0, -48($fp) + beq $t0, 0, label_CONTINUE_218 + # GOTO label_FALSE_213 + j label_FALSE_213 + label_CONTINUE_218: + # LOCAL local_a2i_at_A2I_internal_11 --> -48($fp) + # LOCAL local_a2i_at_A2I_internal_13 --> -56($fp) + # LOCAL local_a2i_at_A2I_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_219: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_220 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_219 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_220: + # Store result + sw $a2, -48($fp) + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + # IF_ZERO local_a2i_at_A2I_internal_11 GOTO label_TRUE_214 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_214 + label_FALSE_213: + # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -44($fp) + # GOTO label_END_215 +j label_END_215 +label_TRUE_214: + # LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + label_END_215: +# LOCAL local_a2i_at_A2I_internal_8 --> -36($fp) +# LOCAL local_a2i_at_A2I_internal_10 --> -44($fp) +# Obtain value from -44($fp) +lw $v0, -44($fp) +lw $v0, 12($v0) +sw $v0, -36($fp) +# IF_ZERO local_a2i_at_A2I_internal_8 GOTO label_FALSEIF_211 +# IF_ZERO local_a2i_at_A2I_internal_8 GOTO label_FALSEIF_211 +lw $t0, -36($fp) +beq $t0, 0, label_FALSEIF_211 +# LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) +# local_a2i_at_A2I_internal_20 = SELF +sw $s1, -84($fp) +# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) +# LOCAL local_a2i_at_A2I_internal_20 --> -84($fp) +# local_a2i_at_A2I_internal_18 = local_a2i_at_A2I_internal_20 +lw $t0, -84($fp) +sw $t0, -76($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_21 = PARAM param_a2i_at_A2I_s_0 +lw $t0, 0($fp) +sw $t0, -88($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -96($fp) +# ARG local_a2i_at_A2I_internal_23 +# LOCAL local_a2i_at_A2I_internal_23 --> -96($fp) +lw $t0, -96($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_25 --> -104($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_25 = PARAM param_a2i_at_A2I_s_0 +lw $t0, 0($fp) +sw $t0, -104($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_25 --> -104($fp) +# LOCAL local_a2i_at_A2I_internal_26 --> -108($fp) +# local_a2i_at_A2I_internal_26 = VCALL local_a2i_at_A2I_internal_25 length +# Save new self pointer in $s1 +lw $s1, -104($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 20($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -108($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_27 --> -112($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -112($fp) +# LOCAL local_a2i_at_A2I_internal_24 --> -100($fp) +# LOCAL local_a2i_at_A2I_internal_26 --> -108($fp) +# LOCAL local_a2i_at_A2I_internal_27 --> -112($fp) +# local_a2i_at_A2I_internal_24 = local_a2i_at_A2I_internal_26 - local_a2i_at_A2I_internal_27 +lw $t1, -108($fp) +lw $t0, 12($t1) +lw $t1, -112($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -100($fp) +# ARG local_a2i_at_A2I_internal_24 +# LOCAL local_a2i_at_A2I_internal_24 --> -100($fp) +lw $t0, -100($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_21 --> -88($fp) +# LOCAL local_a2i_at_A2I_internal_22 --> -92($fp) +# local_a2i_at_A2I_internal_22 = VCALL local_a2i_at_A2I_internal_21 substr +# Save new self pointer in $s1 +lw $s1, -88($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 40($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -92($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_at_A2I_internal_22 +# LOCAL local_a2i_at_A2I_internal_22 --> -92($fp) +lw $t0, -92($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_18 --> -76($fp) +# LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) +# local_a2i_at_A2I_internal_19 = VCALL local_a2i_at_A2I_internal_18 a2i_aux +# Save new self pointer in $s1 +lw $s1, -76($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 32($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -80($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# LOCAL local_a2i_at_A2I_internal_19 --> -80($fp) +lw $t0, -80($fp) +lw $t0, 12($t0) +not $t0, $t0 +add $t0, $t0, 1 +sw $t0, -72($fp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +lw $t0, -72($fp) +sw $t0, 12($v0) +sw $v0, -72($fp) +# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) +# LOCAL local_a2i_at_A2I_internal_17 --> -72($fp) +# local_a2i_at_A2I_internal_9 = local_a2i_at_A2I_internal_17 +lw $t0, -72($fp) +sw $t0, -40($fp) +# GOTO label_ENDIF_212 +j label_ENDIF_212 +label_FALSEIF_211: + # LOCAL local_a2i_at_A2I_internal_32 --> -132($fp) + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + # local_a2i_at_A2I_internal_32 = PARAM param_a2i_at_A2I_s_0 + lw $t0, 0($fp) + sw $t0, -132($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_A2I_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -140($fp) + # ARG local_a2i_at_A2I_internal_34 + # LOCAL local_a2i_at_A2I_internal_34 --> -140($fp) + lw $t0, -140($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_A2I_internal_35 --> -144($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -144($fp) + # ARG local_a2i_at_A2I_internal_35 + # LOCAL local_a2i_at_A2I_internal_35 --> -144($fp) + lw $t0, -144($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_A2I_internal_32 --> -132($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # local_a2i_at_A2I_internal_33 = VCALL local_a2i_at_A2I_internal_32 substr + # Save new self pointer in $s1 + lw $s1, -132($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -136($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_26 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -148($fp) + # IF_ZERO local_a2i_at_A2I_internal_33 GOTO label_FALSE_223 + # IF_ZERO local_a2i_at_A2I_internal_33 GOTO label_FALSE_223 + lw $t0, -136($fp) + beq $t0, 0, label_FALSE_223 + # IF_ZERO local_a2i_at_A2I_internal_36 GOTO label_FALSE_223 + # IF_ZERO local_a2i_at_A2I_internal_36 GOTO label_FALSE_223 + lw $t0, -148($fp) + beq $t0, 0, label_FALSE_223 + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # Comparing -136($fp) type with String + la $v0, String + lw $a0, -136($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_STRING_226 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_STRING_226 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_STRING_226 + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # Comparing -136($fp) type with Bool + la $v0, Bool + lw $a0, -136($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_227 + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # Comparing -136($fp) type with Int + la $v0, Int + lw $a0, -136($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_COMPARE_BY_VALUE_227 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_227 + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) + # Load pointers and SUB + lw $a0, -136($fp) + lw $a1, -148($fp) + sub $a0, $a0, $a1 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_224 + # GOTO label_FALSE_223 + j label_FALSE_223 + label_COMPARE_BY_VALUE_227: + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) + lw $a0, -136($fp) + lw $a1, -148($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_224 + # GOTO label_FALSE_223 + j label_FALSE_223 + label_COMPARE_STRING_226: + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) + # Load strings for comparison + lw $v0, -136($fp) + lw $v1, -148($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_CONTINUE_228 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_CONTINUE_228 + lw $t0, -128($fp) + beq $t0, 0, label_CONTINUE_228 + # GOTO label_FALSE_223 + j label_FALSE_223 + label_CONTINUE_228: + # LOCAL local_a2i_at_A2I_internal_31 --> -128($fp) + # LOCAL local_a2i_at_A2I_internal_33 --> -136($fp) + # LOCAL local_a2i_at_A2I_internal_36 --> -148($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -136($fp) + lw $v1, -148($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_229: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_230 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_229 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_230: + # Store result + sw $a2, -128($fp) + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + # IF_ZERO local_a2i_at_A2I_internal_31 GOTO label_TRUE_224 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_224 + label_FALSE_223: + # LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -124($fp) + # GOTO label_END_225 +j label_END_225 +label_TRUE_224: + # LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -124($fp) + label_END_225: +# LOCAL local_a2i_at_A2I_internal_28 --> -116($fp) +# LOCAL local_a2i_at_A2I_internal_30 --> -124($fp) +# Obtain value from -124($fp) +lw $v0, -124($fp) +lw $v0, 12($v0) +sw $v0, -116($fp) +# IF_ZERO local_a2i_at_A2I_internal_28 GOTO label_FALSEIF_221 +# IF_ZERO local_a2i_at_A2I_internal_28 GOTO label_FALSEIF_221 +lw $t0, -116($fp) +beq $t0, 0, label_FALSEIF_221 +# LOCAL local_a2i_at_A2I_internal_39 --> -160($fp) +# local_a2i_at_A2I_internal_39 = SELF +sw $s1, -160($fp) +# LOCAL local_a2i_at_A2I_internal_37 --> -152($fp) +# LOCAL local_a2i_at_A2I_internal_39 --> -160($fp) +# local_a2i_at_A2I_internal_37 = local_a2i_at_A2I_internal_39 +lw $t0, -160($fp) +sw $t0, -152($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_40 --> -164($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_40 = PARAM param_a2i_at_A2I_s_0 +lw $t0, 0($fp) +sw $t0, -164($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_42 --> -172($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -172($fp) +# ARG local_a2i_at_A2I_internal_42 +# LOCAL local_a2i_at_A2I_internal_42 --> -172($fp) +lw $t0, -172($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_44 --> -180($fp) +# PARAM param_a2i_at_A2I_s_0 --> 0($fp) +# local_a2i_at_A2I_internal_44 = PARAM param_a2i_at_A2I_s_0 +lw $t0, 0($fp) +sw $t0, -180($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_A2I_internal_44 --> -180($fp) +# LOCAL local_a2i_at_A2I_internal_45 --> -184($fp) +# local_a2i_at_A2I_internal_45 = VCALL local_a2i_at_A2I_internal_44 length +# Save new self pointer in $s1 +lw $s1, -180($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 20($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -184($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_46 --> -188($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -188($fp) +# LOCAL local_a2i_at_A2I_internal_43 --> -176($fp) +# LOCAL local_a2i_at_A2I_internal_45 --> -184($fp) +# LOCAL local_a2i_at_A2I_internal_46 --> -188($fp) +# local_a2i_at_A2I_internal_43 = local_a2i_at_A2I_internal_45 - local_a2i_at_A2I_internal_46 +lw $t1, -184($fp) +lw $t0, 12($t1) +lw $t1, -188($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -176($fp) +# ARG local_a2i_at_A2I_internal_43 +# LOCAL local_a2i_at_A2I_internal_43 --> -176($fp) +lw $t0, -176($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_40 --> -164($fp) +# LOCAL local_a2i_at_A2I_internal_41 --> -168($fp) +# local_a2i_at_A2I_internal_41 = VCALL local_a2i_at_A2I_internal_40 substr +# Save new self pointer in $s1 +lw $s1, -164($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 40($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -168($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_at_A2I_internal_41 +# LOCAL local_a2i_at_A2I_internal_41 --> -168($fp) +lw $t0, -168($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_A2I_internal_37 --> -152($fp) +# LOCAL local_a2i_at_A2I_internal_38 --> -156($fp) +# local_a2i_at_A2I_internal_38 = VCALL local_a2i_at_A2I_internal_37 a2i_aux +# Save new self pointer in $s1 +lw $s1, -152($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 32($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -156($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) +# LOCAL local_a2i_at_A2I_internal_38 --> -156($fp) +# local_a2i_at_A2I_internal_29 = local_a2i_at_A2I_internal_38 +lw $t0, -156($fp) +sw $t0, -120($fp) +# GOTO label_ENDIF_222 +j label_ENDIF_222 +label_FALSEIF_221: + # LOCAL local_a2i_at_A2I_internal_49 --> -200($fp) + # local_a2i_at_A2I_internal_49 = SELF + sw $s1, -200($fp) + # LOCAL local_a2i_at_A2I_internal_47 --> -192($fp) + # LOCAL local_a2i_at_A2I_internal_49 --> -200($fp) + # local_a2i_at_A2I_internal_47 = local_a2i_at_A2I_internal_49 + lw $t0, -200($fp) + sw $t0, -192($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_a2i_at_A2I_s_0 + # PARAM param_a2i_at_A2I_s_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_A2I_internal_47 --> -192($fp) + # LOCAL local_a2i_at_A2I_internal_48 --> -196($fp) + # local_a2i_at_A2I_internal_48 = VCALL local_a2i_at_A2I_internal_47 a2i_aux + # Save new self pointer in $s1 + lw $s1, -192($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -196($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) + # LOCAL local_a2i_at_A2I_internal_48 --> -196($fp) + # local_a2i_at_A2I_internal_29 = local_a2i_at_A2I_internal_48 + lw $t0, -196($fp) + sw $t0, -120($fp) + label_ENDIF_222: +# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) +# LOCAL local_a2i_at_A2I_internal_29 --> -120($fp) +# local_a2i_at_A2I_internal_9 = local_a2i_at_A2I_internal_29 +lw $t0, -120($fp) +sw $t0, -40($fp) +label_ENDIF_212: +# LOCAL local_a2i_at_A2I_internal_1 --> -8($fp) +# LOCAL local_a2i_at_A2I_internal_9 --> -40($fp) +# local_a2i_at_A2I_internal_1 = local_a2i_at_A2I_internal_9 +lw $t0, -40($fp) +sw $t0, -8($fp) +label_ENDIF_202: +# RETURN local_a2i_at_A2I_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_a2i_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 208 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_aux_at_A2I implementation. +# @Params: +# 0($fp) = param_a2i_aux_at_A2I_s_0 +function_a2i_aux_at_A2I: + # Allocate stack frame for function function_a2i_aux_at_A2I. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_a2i_aux_at_A2I_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) + # LOCAL local_a2i_aux_at_A2I_internal_1 --> -8($fp) + # local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_a2i_aux_at_A2I_j_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) + # local_a2i_aux_at_A2I_internal_3 = PARAM param_a2i_aux_at_A2I_s_0 + lw $t0, 0($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_aux_at_A2I_internal_3 --> -16($fp) + # LOCAL local_a2i_aux_at_A2I_internal_4 --> -20($fp) + # local_a2i_aux_at_A2I_internal_4 = VCALL local_a2i_aux_at_A2I_internal_3 length + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_aux_at_A2I_j_2 --> -12($fp) + # LOCAL local_a2i_aux_at_A2I_internal_4 --> -20($fp) + # local_a2i_aux_at_A2I_j_2 = local_a2i_aux_at_A2I_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_A2I_internal_6 --> -28($fp) + # local_a2i_aux_at_A2I_i_5 = local_a2i_aux_at_A2I_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + label_WHILE_231: + # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) + # LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_A2I_j_2 --> -12($fp) + lw $a0, -24($fp) + lw $a1, -12($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -36($fp) + # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 + # IF_GREATER_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 + lw $t0, -36($fp) + bgt $t0, 0, label_FALSE_233 + # IF_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 + # IF_ZERO local_a2i_aux_at_A2I_internal_8 GOTO label_FALSE_233 + lw $t0, -36($fp) + beq $t0, 0, label_FALSE_233 + # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_234 +j label_END_234 +label_FALSE_233: + # LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_234: +# LOCAL local_a2i_aux_at_A2I_internal_7 --> -32($fp) +# LOCAL local_a2i_aux_at_A2I_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_a2i_aux_at_A2I_internal_7 GOTO label_WHILE_END_232 +# IF_ZERO local_a2i_aux_at_A2I_internal_7 GOTO label_WHILE_END_232 +lw $t0, -32($fp) +beq $t0, 0, label_WHILE_END_232 +# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 10 +sw $t0, 12($v0) +sw $v0, -48($fp) +# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) +# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_11 --> -48($fp) +# local_a2i_aux_at_A2I_internal_10 = local_a2i_aux_at_A2I_int_0 * local_a2i_aux_at_A2I_internal_11 +lw $t1, -4($fp) +lw $t0, 12($t1) +lw $t1, -48($fp) +lw $t2, 12($t1) +mul $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -44($fp) +# LOCAL local_a2i_aux_at_A2I_internal_14 --> -60($fp) +# local_a2i_aux_at_A2I_internal_14 = SELF +sw $s1, -60($fp) +# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) +# LOCAL local_a2i_aux_at_A2I_internal_14 --> -60($fp) +# local_a2i_aux_at_A2I_internal_12 = local_a2i_aux_at_A2I_internal_14 +lw $t0, -60($fp) +sw $t0, -52($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_15 --> -64($fp) +# PARAM param_a2i_aux_at_A2I_s_0 --> 0($fp) +# local_a2i_aux_at_A2I_internal_15 = PARAM param_a2i_aux_at_A2I_s_0 +lw $t0, 0($fp) +sw $t0, -64($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_a2i_aux_at_A2I_i_5 +# LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) +lw $t0, -24($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -72($fp) +# ARG local_a2i_aux_at_A2I_internal_17 +# LOCAL local_a2i_aux_at_A2I_internal_17 --> -72($fp) +lw $t0, -72($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_15 --> -64($fp) +# LOCAL local_a2i_aux_at_A2I_internal_16 --> -68($fp) +# local_a2i_aux_at_A2I_internal_16 = VCALL local_a2i_aux_at_A2I_internal_15 substr +# Save new self pointer in $s1 +lw $s1, -64($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 40($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -68($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_aux_at_A2I_internal_16 +# LOCAL local_a2i_aux_at_A2I_internal_16 --> -68($fp) +lw $t0, -68($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_A2I_internal_12 --> -52($fp) +# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) +# local_a2i_aux_at_A2I_internal_13 = VCALL local_a2i_aux_at_A2I_internal_12 c2i +# Save new self pointer in $s1 +lw $s1, -52($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 0($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -56($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) +# LOCAL local_a2i_aux_at_A2I_internal_10 --> -44($fp) +# LOCAL local_a2i_aux_at_A2I_internal_13 --> -56($fp) +# local_a2i_aux_at_A2I_internal_9 = local_a2i_aux_at_A2I_internal_10 + local_a2i_aux_at_A2I_internal_13 +lw $t1, -44($fp) +lw $t0, 12($t1) +lw $t1, -56($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -40($fp) +# LOCAL local_a2i_aux_at_A2I_int_0 --> -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_9 --> -40($fp) +# local_a2i_aux_at_A2I_int_0 = local_a2i_aux_at_A2I_internal_9 +lw $t0, -40($fp) +sw $t0, -4($fp) +# LOCAL local_a2i_aux_at_A2I_internal_19 --> -80($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -80($fp) +# LOCAL local_a2i_aux_at_A2I_internal_18 --> -76($fp) +# LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) +# LOCAL local_a2i_aux_at_A2I_internal_19 --> -80($fp) +# local_a2i_aux_at_A2I_internal_18 = local_a2i_aux_at_A2I_i_5 + local_a2i_aux_at_A2I_internal_19 +lw $t1, -24($fp) +lw $t0, 12($t1) +lw $t1, -80($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -76($fp) +# LOCAL local_a2i_aux_at_A2I_i_5 --> -24($fp) +# LOCAL local_a2i_aux_at_A2I_internal_18 --> -76($fp) +# local_a2i_aux_at_A2I_i_5 = local_a2i_aux_at_A2I_internal_18 +lw $t0, -76($fp) +sw $t0, -24($fp) +# GOTO label_WHILE_231 +j label_WHILE_231 +label_WHILE_END_232: + # RETURN local_a2i_aux_at_A2I_int_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_a2i_aux_at_A2I. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 88 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_i2a_at_A2I implementation. +# @Params: +# 0($fp) = param_i2a_at_A2I_i_0 +function_i2a_at_A2I: + # Allocate stack frame for function function_i2a_at_A2I. + subu $sp, $sp, 96 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 96 + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # IF_ZERO param_i2a_at_A2I_i_0 GOTO label_FALSE_237 + # IF_ZERO param_i2a_at_A2I_i_0 GOTO label_FALSE_237 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_237 + # IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_237 + # IF_ZERO local_i2a_at_A2I_internal_4 GOTO label_FALSE_237 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_237 + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_STRING_240 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_STRING_240 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_240 + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_241 + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_241 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_241 + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_238 + # GOTO label_FALSE_237 + j label_FALSE_237 + label_COMPARE_BY_VALUE_241: + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_238 + # GOTO label_FALSE_237 + j label_FALSE_237 + label_COMPARE_STRING_240: + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_CONTINUE_242 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_CONTINUE_242 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_242 + # GOTO label_FALSE_237 + j label_FALSE_237 + label_CONTINUE_242: + # LOCAL local_i2a_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_at_A2I_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_243: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_244 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_243 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_244: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + # IF_ZERO local_i2a_at_A2I_internal_3 GOTO label_TRUE_238 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_238 + label_FALSE_237: + # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_239 +j label_END_239 +label_TRUE_238: + # LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_239: +# LOCAL local_i2a_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2a_at_A2I_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSEIF_235 +# IF_ZERO local_i2a_at_A2I_internal_0 GOTO label_FALSEIF_235 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_235 +# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_27 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -24($fp) +# LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) +# LOCAL local_i2a_at_A2I_internal_5 --> -24($fp) +# local_i2a_at_A2I_internal_1 = local_i2a_at_A2I_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_236 +j label_ENDIF_236 +label_FALSEIF_235: + # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -40($fp) + # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) + # LOCAL local_i2a_at_A2I_internal_9 --> -40($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + lw $a0, -40($fp) + lw $a1, 0($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -36($fp) + # IF_GREATER_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 + # IF_GREATER_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 + lw $t0, -36($fp) + bgt $t0, 0, label_FALSE_247 + # IF_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 + # IF_ZERO local_i2a_at_A2I_internal_8 GOTO label_FALSE_247 + lw $t0, -36($fp) + beq $t0, 0, label_FALSE_247 + # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_248 +j label_END_248 +label_FALSE_247: + # LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_248: +# LOCAL local_i2a_at_A2I_internal_6 --> -28($fp) +# LOCAL local_i2a_at_A2I_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_i2a_at_A2I_internal_6 GOTO label_FALSEIF_245 +# IF_ZERO local_i2a_at_A2I_internal_6 GOTO label_FALSEIF_245 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_245 +# LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) +# local_i2a_at_A2I_internal_12 = SELF +sw $s1, -52($fp) +# LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) +# LOCAL local_i2a_at_A2I_internal_12 --> -52($fp) +# local_i2a_at_A2I_internal_10 = local_i2a_at_A2I_internal_12 +lw $t0, -52($fp) +sw $t0, -44($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_i2a_at_A2I_i_0 +# PARAM param_i2a_at_A2I_i_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_i2a_at_A2I_internal_10 --> -44($fp) +# LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) +# local_i2a_at_A2I_internal_11 = VCALL local_i2a_at_A2I_internal_10 i2a_aux +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 44($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) +# LOCAL local_i2a_at_A2I_internal_11 --> -48($fp) +# local_i2a_at_A2I_internal_7 = local_i2a_at_A2I_internal_11 +lw $t0, -48($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_246 +j label_ENDIF_246 +label_FALSEIF_245: + # LOCAL local_i2a_at_A2I_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_28 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -64($fp) + # LOCAL local_i2a_at_A2I_internal_13 --> -56($fp) + # LOCAL local_i2a_at_A2I_internal_15 --> -64($fp) + # local_i2a_at_A2I_internal_13 = local_i2a_at_A2I_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_18 --> -76($fp) + # local_i2a_at_A2I_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_i2a_at_A2I_internal_16 --> -68($fp) + # LOCAL local_i2a_at_A2I_internal_18 --> -76($fp) + # local_i2a_at_A2I_internal_16 = local_i2a_at_A2I_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_at_A2I_internal_21 --> -88($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -88($fp) + # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) + # LOCAL local_i2a_at_A2I_internal_21 --> -88($fp) + lw $t0, -88($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -84($fp) + # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) + # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -84($fp) + sw $t0, 12($v0) + sw $v0, -84($fp) + # LOCAL local_i2a_at_A2I_internal_19 --> -80($fp) + # PARAM param_i2a_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_at_A2I_internal_20 --> -84($fp) + # local_i2a_at_A2I_internal_19 = PARAM param_i2a_at_A2I_i_0 * local_i2a_at_A2I_internal_20 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -84($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -80($fp) + # ARG local_i2a_at_A2I_internal_19 + # LOCAL local_i2a_at_A2I_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_i2a_at_A2I_internal_16 --> -68($fp) + # LOCAL local_i2a_at_A2I_internal_17 --> -72($fp) + # local_i2a_at_A2I_internal_17 = VCALL local_i2a_at_A2I_internal_16 i2a_aux + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_i2a_at_A2I_internal_17 + # LOCAL local_i2a_at_A2I_internal_17 --> -72($fp) + lw $t0, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_i2a_at_A2I_internal_13 --> -56($fp) + # LOCAL local_i2a_at_A2I_internal_14 --> -60($fp) + # local_i2a_at_A2I_internal_14 = VCALL local_i2a_at_A2I_internal_13 concat + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 64($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) + # LOCAL local_i2a_at_A2I_internal_14 --> -60($fp) + # local_i2a_at_A2I_internal_7 = local_i2a_at_A2I_internal_14 + lw $t0, -60($fp) + sw $t0, -32($fp) + label_ENDIF_246: +# LOCAL local_i2a_at_A2I_internal_1 --> -8($fp) +# LOCAL local_i2a_at_A2I_internal_7 --> -32($fp) +# local_i2a_at_A2I_internal_1 = local_i2a_at_A2I_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +label_ENDIF_236: +# RETURN local_i2a_at_A2I_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_i2a_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 96 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_i2a_aux_at_A2I implementation. +# @Params: +# 0($fp) = param_i2a_aux_at_A2I_i_0 +function_i2a_aux_at_A2I: + # Allocate stack frame for function function_i2a_aux_at_A2I. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # IF_ZERO param_i2a_aux_at_A2I_i_0 GOTO label_FALSE_251 + # IF_ZERO param_i2a_aux_at_A2I_i_0 GOTO label_FALSE_251 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_251 + # IF_ZERO local_i2a_aux_at_A2I_internal_4 GOTO label_FALSE_251 + # IF_ZERO local_i2a_aux_at_A2I_internal_4 GOTO label_FALSE_251 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_251 + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_STRING_254 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_STRING_254 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_254 + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_255 + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_COMPARE_BY_VALUE_255 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_255 + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_252 + # GOTO label_FALSE_251 + j label_FALSE_251 + label_COMPARE_BY_VALUE_255: + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_252 + # GOTO label_FALSE_251 + j label_FALSE_251 + label_COMPARE_STRING_254: + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_CONTINUE_256 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_CONTINUE_256 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_256 + # GOTO label_FALSE_251 + j label_FALSE_251 + label_CONTINUE_256: + # LOCAL local_i2a_aux_at_A2I_internal_3 --> -16($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_257: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_258 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_257 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_258: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + # IF_ZERO local_i2a_aux_at_A2I_internal_3 GOTO label_TRUE_252 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_252 + label_FALSE_251: + # LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_253 +j label_END_253 +label_TRUE_252: + # LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_253: +# LOCAL local_i2a_aux_at_A2I_internal_0 --> -4($fp) +# LOCAL local_i2a_aux_at_A2I_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSEIF_249 +# IF_ZERO local_i2a_aux_at_A2I_internal_0 GOTO label_FALSEIF_249 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_249 +# LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_29 +sw $t0, 12($v0) +li $t0, 0 +sw $t0, 16($v0) +sw $v0, -24($fp) +# LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) +# LOCAL local_i2a_aux_at_A2I_internal_5 --> -24($fp) +# local_i2a_aux_at_A2I_internal_1 = local_i2a_aux_at_A2I_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_250 +j label_ENDIF_250 +label_FALSEIF_249: + # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 10 + sw $t0, 12($v0) + sw $v0, -36($fp) + # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_8 --> -36($fp) + # local_i2a_aux_at_A2I_internal_7 = PARAM param_i2a_aux_at_A2I_i_0 / local_i2a_aux_at_A2I_internal_8 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -36($fp) + lw $t2, 12($t1) + div $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -32($fp) + # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_7 --> -32($fp) + # local_i2a_aux_at_A2I_next_6 = local_i2a_aux_at_A2I_internal_7 + lw $t0, -32($fp) + sw $t0, -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) + # local_i2a_aux_at_A2I_internal_13 = SELF + sw $s1, -56($fp) + # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) + # LOCAL local_i2a_aux_at_A2I_internal_13 --> -56($fp) + # local_i2a_aux_at_A2I_internal_11 = local_i2a_aux_at_A2I_internal_13 + lw $t0, -56($fp) + sw $t0, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_i2a_aux_at_A2I_next_6 + # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) + lw $t0, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_11 --> -48($fp) + # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) + # local_i2a_aux_at_A2I_internal_12 = VCALL local_i2a_aux_at_A2I_internal_11 i2a_aux + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) + # LOCAL local_i2a_aux_at_A2I_internal_12 --> -52($fp) + # local_i2a_aux_at_A2I_internal_9 = local_i2a_aux_at_A2I_internal_12 + lw $t0, -52($fp) + sw $t0, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_16 --> -68($fp) + # local_i2a_aux_at_A2I_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_i2a_aux_at_A2I_internal_14 --> -60($fp) + # LOCAL local_i2a_aux_at_A2I_internal_16 --> -68($fp) + # local_i2a_aux_at_A2I_internal_14 = local_i2a_aux_at_A2I_internal_16 + lw $t0, -68($fp) + sw $t0, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 10 + sw $t0, 12($v0) + sw $v0, -80($fp) + # LOCAL local_i2a_aux_at_A2I_internal_18 --> -76($fp) + # LOCAL local_i2a_aux_at_A2I_next_6 --> -28($fp) + # LOCAL local_i2a_aux_at_A2I_internal_19 --> -80($fp) + # local_i2a_aux_at_A2I_internal_18 = local_i2a_aux_at_A2I_next_6 * local_i2a_aux_at_A2I_internal_19 + lw $t1, -28($fp) + lw $t0, 12($t1) + lw $t1, -80($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -76($fp) + # LOCAL local_i2a_aux_at_A2I_internal_17 --> -72($fp) + # PARAM param_i2a_aux_at_A2I_i_0 --> 0($fp) + # LOCAL local_i2a_aux_at_A2I_internal_18 --> -76($fp) + # local_i2a_aux_at_A2I_internal_17 = PARAM param_i2a_aux_at_A2I_i_0 - local_i2a_aux_at_A2I_internal_18 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -76($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -72($fp) + # ARG local_i2a_aux_at_A2I_internal_17 + # LOCAL local_i2a_aux_at_A2I_internal_17 --> -72($fp) + lw $t0, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_14 --> -60($fp) + # LOCAL local_i2a_aux_at_A2I_internal_15 --> -64($fp) + # local_i2a_aux_at_A2I_internal_15 = VCALL local_i2a_aux_at_A2I_internal_14 i2c + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 24($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_i2a_aux_at_A2I_internal_15 + # LOCAL local_i2a_aux_at_A2I_internal_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_i2a_aux_at_A2I_internal_9 --> -40($fp) + # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) + # local_i2a_aux_at_A2I_internal_10 = VCALL local_i2a_aux_at_A2I_internal_9 concat + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 64($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_i2a_aux_at_A2I_internal_1 --> -8($fp) + # LOCAL local_i2a_aux_at_A2I_internal_10 --> -44($fp) + # local_i2a_aux_at_A2I_internal_1 = local_i2a_aux_at_A2I_internal_10 + lw $t0, -44($fp) + sw $t0, -8($fp) + label_ENDIF_250: +# RETURN local_i2a_aux_at_A2I_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_i2a_aux_at_A2I. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 104 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 104 + # LOCAL local_main_at_Main_a_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE A2I + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, A2I + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, A2I_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_30 + sw $t0, 12($v0) + li $t0, 6 + sw $t0, 16($v0) + sw $v0, -20($fp) + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 a2i + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 52($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_a_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_a_0 = local_main_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # LOCAL local_main_at_Main_b_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -24($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = ALLOCATE A2I + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, A2I + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, A2I_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -36($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 + lw $t0, -36($fp) + sw $t0, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 678987 + sw $t0, 12($v0) + sw $v0, -40($fp) + # ARG local_main_at_Main_internal_9 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + lw $t0, -40($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 i2a + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 36($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_b_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_b_5 = local_main_at_Main_internal_7 + lw $t0, -32($fp) + sw $t0, -24($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 + lw $t0, -52($fp) + sw $t0, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_a_0 + # LOCAL local_main_at_Main_a_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 out_int + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_31 + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + sw $v0, -68($fp) + # ARG local_main_at_Main_internal_16 + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + lw $t0, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 out_string + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_19 = SELF + sw $s1, -80($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_17 = local_main_at_Main_internal_19 + lw $t0, -80($fp) + sw $t0, -72($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_b_5 + # LOCAL local_main_at_Main_b_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_18 = VCALL local_main_at_Main_internal_17 out_string + # Save new self pointer in $s1 + lw $s1, -72($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -76($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # local_main_at_Main_internal_22 = SELF + sw $s1, -92($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # local_main_at_Main_internal_20 = local_main_at_Main_internal_22 + lw $t0, -92($fp) + sw $t0, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_32 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -96($fp) + # ARG local_main_at_Main_internal_23 + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + lw $t0, -96($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_21 = VCALL local_main_at_Main_internal_20 out_string + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_21 + lw $v0, -88($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 104 + jr $ra + # Function END + diff --git a/tests/codegen/book_list.mips b/tests/codegen/book_list.mips new file mode 100644 index 00000000..1a017406 --- /dev/null +++ b/tests/codegen/book_list.mips @@ -0,0 +1,3057 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:07 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +Main: .asciiz "Main" +# Function END +BookList: .asciiz "BookList" +# Function END +Nil: .asciiz "Nil" +# Function END +Cons: .asciiz "Cons" +# Function END +Book: .asciiz "Book" +# Function END +Article: .asciiz "Article" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, dummy, function_out_int_at_IO, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_in_string_at_IO, function_in_int_at_IO, dummy, dummy, dummy, dummy, function_out_string_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word dummy, function_type_name_at_Object, dummy, function_concat_at_String, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, function_length_at_String, dummy, dummy +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word dummy, function_type_name_at_Object, function_main_at_Main, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +# **** VTABLE for type BookList **** +BookList_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, function_isNil_at_BookList, function_out_int_at_IO, function_copy_at_Object, function_car_at_BookList, function_print_list_at_BookList, function_cdr_at_BookList, dummy, dummy, function_in_string_at_IO, function_in_int_at_IO, dummy, function_cons_at_BookList, dummy, dummy, function_out_string_at_IO +# Function END +# + + +# **** Type RECORD for type BookList **** +BookList_start: + BookList_vtable_pointer: .word BookList_vtable + # Function END +BookList_end: +# + + +# **** VTABLE for type Nil **** +Nil_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, function_isNil_at_Nil, function_out_int_at_IO, function_copy_at_Object, function_car_at_BookList, function_print_list_at_Nil, function_cdr_at_BookList, dummy, dummy, function_in_string_at_IO, function_in_int_at_IO, dummy, function_cons_at_BookList, dummy, dummy, function_out_string_at_IO +# Function END +# + + +# **** Type RECORD for type Nil **** +Nil_start: + Nil_vtable_pointer: .word Nil_vtable + # Function END +Nil_end: +# + + +# **** VTABLE for type Cons **** +Cons_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, function_isNil_at_Cons, function_out_int_at_IO, function_copy_at_Object, function_car_at_Cons, function_print_list_at_Cons, function_cdr_at_Cons, dummy, dummy, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Cons, function_cons_at_BookList, dummy, dummy, function_out_string_at_IO +# Function END +# + + +# **** Type RECORD for type Cons **** +Cons_start: + Cons_vtable_pointer: .word Cons_vtable + # Function END +Cons_end: +# + + +# **** VTABLE for type Book **** +Book_vtable: .word function_initBook_at_Book, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, dummy, function_out_int_at_IO, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_in_string_at_IO, function_in_int_at_IO, dummy, dummy, dummy, function_print_at_Book, function_out_string_at_IO +# Function END +# + + +# **** Type RECORD for type Book **** +Book_start: + Book_vtable_pointer: .word Book_vtable + # Function END +Book_end: +# + + +# **** VTABLE for type Article **** +Article_vtable: .word function_initBook_at_Book, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, dummy, function_out_int_at_IO, function_copy_at_Object, dummy, dummy, dummy, function_initArticle_at_Article, dummy, function_in_string_at_IO, function_in_int_at_IO, dummy, dummy, dummy, function_print_at_Article, function_out_string_at_IO +# Function END +# + + +# **** Type RECORD for type Article **** +Article_start: + Article_vtable_pointer: .word Article_vtable + # Function END +Article_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, -1, 1, 2, 2, 1, 2 +Object__TDT: .word 1, 0, 1, 1, 1, 1, 2, 3, 3, 2, 3 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1 +BookList__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 1, -1, -1 +Nil__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1 +Cons__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 +Book__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1 +Article__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "Compilers, Principles, Techniques, and Tools" +# + + +data_5: .asciiz "Aho, Sethi, and Ullman" +# + + +data_6: .asciiz "The Top 100 CD_ROMs" +# + + +data_7: .asciiz "Ulanoff" +# + + +data_8: .asciiz "PC Magazine" +# + + +data_9: .asciiz "- dynamic type was Book -\n" +# + + +data_10: .asciiz "- dynamic type was Article -\n" +# + + +data_11: .asciiz "title: " +# + + +data_12: .asciiz "\n" +# + + +data_13: .asciiz "author: " +# + + +data_14: .asciiz "\n" +# + + +data_15: .asciiz "periodical: " +# + + +data_16: .asciiz "\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + lb $t3, 0($t1) + beqz $t3, end_loop + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + end_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__books__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 8($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__books__init implementation. +# @Params: +__Main__attrib__books__init: + # Allocate stack frame for function __Main__attrib__books__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__books__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # LOCAL local_main_at_Main_a_book_0 --> -4($fp) + # local_main_at_Main_a_book_0 = 0 + li $t0, 0 + sw $t0, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE Book + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Book + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Book_start + sw $t0, 4($v0) + # Load type offset + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 44 + sw $t0, 16($v0) + sw $v0, -20($fp) + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 22 + sw $t0, 16($v0) + sw $v0, -24($fp) + # ARG local_main_at_Main_internal_5 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 initBook + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_a_book_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_a_book_0 = local_main_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # LOCAL local_main_at_Main_an_article_6 --> -28($fp) + # local_main_at_Main_an_article_6 = 0 + li $t0, 0 + sw $t0, -28($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = ALLOCATE Article + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Article + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 24 bytes of memory + li $a0, 24 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Article_start + sw $t0, 4($v0) + # Load type offset + li $t0, 40 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Article__attrib__per_title__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -40($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 + lw $t0, -40($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_6 + sw $t0, 12($v0) + li $t0, 19 + sw $t0, 16($v0) + sw $v0, -44($fp) + # ARG local_main_at_Main_internal_10 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + lw $t0, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_7 + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + sw $v0, -48($fp) + # ARG local_main_at_Main_internal_11 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + lw $t0, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_8 + sw $t0, 12($v0) + li $t0, 11 + sw $t0, 16($v0) + sw $v0, -52($fp) + # ARG local_main_at_Main_internal_12 + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + lw $t0, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 initArticle + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_an_article_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_an_article_6 = local_main_at_Main_internal_8 + lw $t0, -36($fp) + sw $t0, -28($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = ALLOCATE Nil + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Nil + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Nil_start + sw $t0, 4($v0) + # Load type offset + li $t0, 28 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -72($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 + lw $t0, -72($fp) + sw $t0, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_a_book_0 + # LOCAL local_main_at_Main_a_book_0 --> -4($fp) + lw $t0, -4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 cons + # Save new self pointer in $s1 + lw $s1, -64($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 64($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_13 = local_main_at_Main_internal_16 + lw $t0, -68($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_an_article_6 + # LOCAL local_main_at_Main_an_article_6 --> -28($fp) + lw $t0, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 cons + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 64($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + lw $t0, -60($fp) + sw $t0, 12($s1) + # local_main_at_Main_internal_20 = GETATTRIBUTE books Main + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + lw $t0, 12($s1) + sw $t0, -84($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 + lw $t0, -84($fp) + sw $t0, -76($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 print_list + # Save new self pointer in $s1 + lw $s1, -76($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 36($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -80($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_19 + lw $v0, -80($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 92 + jr $ra + # Function END + + +# function_isNil_at_BookList implementation. +# @Params: +function_isNil_at_BookList: + # Allocate stack frame for function function_isNil_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_BookList_internal_2 --> -12($fp) + # local_isNil_at_BookList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_isNil_at_BookList_internal_0 --> -4($fp) + # LOCAL local_isNil_at_BookList_internal_2 --> -12($fp) + # local_isNil_at_BookList_internal_0 = local_isNil_at_BookList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_isNil_at_BookList_internal_0 --> -4($fp) + # LOCAL local_isNil_at_BookList_internal_1 --> -8($fp) + # local_isNil_at_BookList_internal_1 = VCALL local_isNil_at_BookList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_isNil_at_BookList_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -16($fp) + # RETURN local_isNil_at_BookList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_isNil_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cons_at_BookList implementation. +# @Params: +# 0($fp) = param_cons_at_BookList_hd_0 +function_cons_at_BookList: + # Allocate stack frame for function function_cons_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) + # local_cons_at_BookList_new_cell_0 = 0 + li $t0, 0 + sw $t0, -4($fp) + # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) + # local_cons_at_BookList_internal_1 = ALLOCATE Cons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Cons + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Cons_start + sw $t0, 4($v0) + # Load type offset + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Cons__attrib__xcar__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Cons__attrib__xcdr__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) + # LOCAL local_cons_at_BookList_internal_1 --> -8($fp) + # local_cons_at_BookList_new_cell_0 = local_cons_at_BookList_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) + # LOCAL local_cons_at_BookList_new_cell_0 --> -4($fp) + # local_cons_at_BookList_internal_2 = local_cons_at_BookList_new_cell_0 + lw $t0, -4($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cons_at_BookList_hd_0 + # PARAM param_cons_at_BookList_hd_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) + # local_cons_at_BookList_internal_4 = SELF + sw $s1, -20($fp) + # ARG local_cons_at_BookList_internal_4 + # LOCAL local_cons_at_BookList_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cons_at_BookList_internal_2 --> -12($fp) + # LOCAL local_cons_at_BookList_internal_3 --> -16($fp) + # local_cons_at_BookList_internal_3 = VCALL local_cons_at_BookList_internal_2 init + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 60($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_cons_at_BookList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_cons_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_car_at_BookList implementation. +# @Params: +function_car_at_BookList: + # Allocate stack frame for function function_car_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_car_at_BookList_internal_2 --> -12($fp) + # local_car_at_BookList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_car_at_BookList_internal_0 --> -4($fp) + # LOCAL local_car_at_BookList_internal_2 --> -12($fp) + # local_car_at_BookList_internal_0 = local_car_at_BookList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_car_at_BookList_internal_0 --> -4($fp) + # LOCAL local_car_at_BookList_internal_1 --> -8($fp) + # local_car_at_BookList_internal_1 = VCALL local_car_at_BookList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_car_at_BookList_internal_3 --> -16($fp) + # local_car_at_BookList_internal_3 = ALLOCATE Book + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Book + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Book_start + sw $t0, 4($v0) + # Load type offset + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Book__attrib__title__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Book__attrib__author__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -16($fp) + # RETURN local_car_at_BookList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_car_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cdr_at_BookList implementation. +# @Params: +function_cdr_at_BookList: + # Allocate stack frame for function function_cdr_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cdr_at_BookList_internal_2 --> -12($fp) + # local_cdr_at_BookList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_cdr_at_BookList_internal_0 --> -4($fp) + # LOCAL local_cdr_at_BookList_internal_2 --> -12($fp) + # local_cdr_at_BookList_internal_0 = local_cdr_at_BookList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_cdr_at_BookList_internal_0 --> -4($fp) + # LOCAL local_cdr_at_BookList_internal_1 --> -8($fp) + # local_cdr_at_BookList_internal_1 = VCALL local_cdr_at_BookList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cdr_at_BookList_internal_3 --> -16($fp) + # local_cdr_at_BookList_internal_3 = ALLOCATE BookList + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, BookList + sw $t0, 12($v0) + li $t0, 8 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, BookList_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -16($fp) + # RETURN local_cdr_at_BookList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_cdr_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_list_at_BookList implementation. +# @Params: +function_print_list_at_BookList: + # Allocate stack frame for function function_print_list_at_BookList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_print_list_at_BookList_internal_2 --> -12($fp) + # local_print_list_at_BookList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_list_at_BookList_internal_0 --> -4($fp) + # LOCAL local_print_list_at_BookList_internal_2 --> -12($fp) + # local_print_list_at_BookList_internal_0 = local_print_list_at_BookList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_BookList_internal_0 --> -4($fp) + # LOCAL local_print_list_at_BookList_internal_1 --> -8($fp) + # local_print_list_at_BookList_internal_1 = VCALL local_print_list_at_BookList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_list_at_BookList_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_print_list_at_BookList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_Nil implementation. +# @Params: +function_isNil_at_Nil: + # Allocate stack frame for function function_isNil_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_Nil_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_isNil_at_Nil_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_list_at_Nil implementation. +# @Params: +function_print_list_at_Nil: + # Allocate stack frame for function function_print_list_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_print_list_at_Nil_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_print_list_at_Nil_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_print_list_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Cons__attrib__xcar__init implementation. +# @Params: +__Cons__attrib__xcar__init: + # Allocate stack frame for function __Cons__attrib__xcar__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Cons__attrib__xcar__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Cons__attrib__xcdr__init implementation. +# @Params: +__Cons__attrib__xcdr__init: + # Allocate stack frame for function __Cons__attrib__xcdr__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Cons__attrib__xcdr__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_Cons implementation. +# @Params: +function_isNil_at_Cons: + # Allocate stack frame for function function_isNil_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_Cons_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_isNil_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Cons implementation. +# @Params: +# 0($fp) = param_init_at_Cons_hd_0 +# 4($fp) = param_init_at_Cons_tl_1 +function_init_at_Cons: + # Allocate stack frame for function function_init_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_Cons_hd_0 --> 4($fp) + lw $t0, 4($fp) + sw $t0, 12($s1) + # + # PARAM param_init_at_Cons_tl_1 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 16($s1) + # LOCAL local_init_at_Cons_internal_0 --> -4($fp) + # local_init_at_Cons_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_car_at_Cons implementation. +# @Params: +function_car_at_Cons: + # Allocate stack frame for function function_car_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_car_at_Cons_internal_0 = GETATTRIBUTE xcar Cons + # LOCAL local_car_at_Cons_internal_0 --> -4($fp) + lw $t0, 12($s1) + sw $t0, -4($fp) + # RETURN local_car_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_car_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cdr_at_Cons implementation. +# @Params: +function_cdr_at_Cons: + # Allocate stack frame for function function_cdr_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_cdr_at_Cons_internal_0 = GETATTRIBUTE xcdr Cons + # LOCAL local_cdr_at_Cons_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_cdr_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_cdr_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_list_at_Cons implementation. +# @Params: +function_print_list_at_Cons: + # Allocate stack frame for function function_print_list_at_Cons. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # local_print_list_at_Cons_internal_2 = GETATTRIBUTE xcar Cons + # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) + # local_print_list_at_Cons_internal_0 = local_print_list_at_Cons_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # local_print_list_at_Cons_internal_1 = VCALL local_print_list_at_Cons_internal_0 print + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 72($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # local_print_list_at_Cons_internal_3 = TYPEOF local_print_list_at_Cons_internal_1 + lw $t0, -8($fp) + # Load pointer to type offset + lw $t1, 8($t0) + sw $t1, -16($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_6 = 14 + li $t0, 14 + sw $t0, -28($fp) + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # Load TDT pointer to type Book + la $t0, Book__TDT + lw $t1, -16($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -32($fp) + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # Update min if 8 < 9 + lw $t0, -32($fp) + lw $t1, -28($fp) + bgtu $t0, $t1, label_Not_min0_1 + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # local_print_list_at_Cons_internal_6 = local_print_list_at_Cons_internal_7 + lw $t0, -32($fp) + sw $t0, -28($fp) + label_Not_min0_1: + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # Load TDT pointer to type Article + la $t0, Article__TDT + lw $t1, -16($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -32($fp) + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # Update min if 8 < 9 + lw $t0, -32($fp) + lw $t1, -28($fp) + bgtu $t0, $t1, label_Not_min1_2 + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # local_print_list_at_Cons_internal_6 = local_print_list_at_Cons_internal_7 + lw $t0, -32($fp) + sw $t0, -28($fp) + label_Not_min1_2: + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # local_print_list_at_Cons_internal_7 = 14 + li $t0, 14 + sw $t0, -32($fp) + # LOCAL local_print_list_at_Cons_internal_4 --> -20($fp) + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # Load pointers and SUB + lw $a0, -32($fp) + lw $a1, -28($fp) + sub $a0, $a0, $a1 + sw $a0, -20($fp) + # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 + # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 + lw $t0, -20($fp) + beq $t0, 0, label_ERROR_3 + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # Load TDT pointer to type Book + la $t0, Book__TDT + lw $t1, -16($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -32($fp) + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # Update min if 8 < 9 + lw $t0, -32($fp) + lw $t1, -28($fp) + bgtu $t0, $t1, label_NEXT0_5 + # LOCAL local_print_list_at_Cons_dummy_8 --> -36($fp) + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # local_print_list_at_Cons_dummy_8 = local_print_list_at_Cons_internal_1 + lw $t0, -8($fp) + sw $t0, -36($fp) + # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) + # local_print_list_at_Cons_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) + # LOCAL local_print_list_at_Cons_internal_11 --> -48($fp) + # local_print_list_at_Cons_internal_9 = local_print_list_at_Cons_internal_11 + lw $t0, -48($fp) + sw $t0, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Cons_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_9 + sw $t0, 12($v0) + li $t0, 26 + sw $t0, 16($v0) + sw $v0, -52($fp) + # ARG local_print_list_at_Cons_internal_12 + # LOCAL local_print_list_at_Cons_internal_12 --> -52($fp) + lw $t0, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) + # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) + # local_print_list_at_Cons_internal_10 = VCALL local_print_list_at_Cons_internal_9 out_string + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 76($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) + # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_10 + lw $t0, -44($fp) + sw $t0, -24($fp) + # GOTO label_END_4 +j label_END_4 +label_NEXT0_5: + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + # Load TDT pointer to type Article + la $t0, Article__TDT + lw $t1, -16($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -32($fp) + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # Update min if 8 < 9 + lw $t0, -32($fp) + lw $t1, -28($fp) + bgtu $t0, $t1, label_NEXT1_6 + # LOCAL local_print_list_at_Cons_dummy_13 --> -56($fp) + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # local_print_list_at_Cons_dummy_13 = local_print_list_at_Cons_internal_1 + lw $t0, -8($fp) + sw $t0, -56($fp) + # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) + # local_print_list_at_Cons_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_print_list_at_Cons_internal_14 --> -60($fp) + # LOCAL local_print_list_at_Cons_internal_16 --> -68($fp) + # local_print_list_at_Cons_internal_14 = local_print_list_at_Cons_internal_16 + lw $t0, -68($fp) + sw $t0, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_10 + sw $t0, 12($v0) + li $t0, 29 + sw $t0, 16($v0) + sw $v0, -72($fp) + # ARG local_print_list_at_Cons_internal_17 + # LOCAL local_print_list_at_Cons_internal_17 --> -72($fp) + lw $t0, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_list_at_Cons_internal_14 --> -60($fp) + # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) + # local_print_list_at_Cons_internal_15 = VCALL local_print_list_at_Cons_internal_14 out_string + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 76($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # LOCAL local_print_list_at_Cons_internal_15 --> -64($fp) + # local_print_list_at_Cons_internal_5 = local_print_list_at_Cons_internal_15 + lw $t0, -64($fp) + sw $t0, -24($fp) + # GOTO label_END_4 +j label_END_4 +label_NEXT1_6: + label_ERROR_3: + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + lw $t0, 0($s1) + sw $t0, -8($fp) + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -8($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + label_END_4: +# local_print_list_at_Cons_internal_20 = GETATTRIBUTE xcdr Cons +# LOCAL local_print_list_at_Cons_internal_20 --> -84($fp) +lw $t0, 16($s1) +sw $t0, -84($fp) +# LOCAL local_print_list_at_Cons_internal_18 --> -76($fp) +# LOCAL local_print_list_at_Cons_internal_20 --> -84($fp) +# local_print_list_at_Cons_internal_18 = local_print_list_at_Cons_internal_20 +lw $t0, -84($fp) +sw $t0, -76($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_print_list_at_Cons_internal_18 --> -76($fp) +# LOCAL local_print_list_at_Cons_internal_19 --> -80($fp) +# local_print_list_at_Cons_internal_19 = VCALL local_print_list_at_Cons_internal_18 print_list +# Save new self pointer in $s1 +lw $s1, -76($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 36($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -80($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# RETURN local_print_list_at_Cons_internal_19 +lw $v0, -80($fp) +# Deallocate stack frame for function function_print_list_at_Cons. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 92 +jr $ra +# Function END + + +# __Book__attrib__title__init implementation. +# @Params: +__Book__attrib__title__init: + # Allocate stack frame for function __Book__attrib__title__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__title__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__title__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Book__attrib__title__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Book__attrib__author__init implementation. +# @Params: +__Book__attrib__author__init: + # Allocate stack frame for function __Book__attrib__author__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__author__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__author__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Book__attrib__author__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_initBook_at_Book implementation. +# @Params: +# 0($fp) = param_initBook_at_Book_title_p_0 +# 4($fp) = param_initBook_at_Book_author_p_1 +function_initBook_at_Book: + # Allocate stack frame for function function_initBook_at_Book. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_initBook_at_Book_title_p_0 --> 4($fp) + lw $t0, 4($fp) + sw $t0, 12($s1) + # + # PARAM param_initBook_at_Book_author_p_1 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 16($s1) + # LOCAL local_initBook_at_Book_internal_0 --> -4($fp) + # local_initBook_at_Book_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_initBook_at_Book_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_initBook_at_Book. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_print_at_Book implementation. +# @Params: +function_print_at_Book: + # Allocate stack frame for function function_print_at_Book. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # LOCAL local_print_at_Book_internal_6 --> -28($fp) + # local_print_at_Book_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_print_at_Book_internal_4 --> -20($fp) + # LOCAL local_print_at_Book_internal_6 --> -28($fp) + # local_print_at_Book_internal_4 = local_print_at_Book_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Book_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_11 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -32($fp) + # ARG local_print_at_Book_internal_7 + # LOCAL local_print_at_Book_internal_7 --> -32($fp) + lw $t0, -32($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Book_internal_4 --> -20($fp) + # LOCAL local_print_at_Book_internal_5 --> -24($fp) + # local_print_at_Book_internal_5 = VCALL local_print_at_Book_internal_4 out_string + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 76($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_2 --> -12($fp) + # LOCAL local_print_at_Book_internal_5 --> -24($fp) + # local_print_at_Book_internal_2 = local_print_at_Book_internal_5 + lw $t0, -24($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Book_internal_8 = GETATTRIBUTE title Book + # LOCAL local_print_at_Book_internal_8 --> -36($fp) + lw $t0, 12($s1) + sw $t0, -36($fp) + # ARG local_print_at_Book_internal_8 + # LOCAL local_print_at_Book_internal_8 --> -36($fp) + lw $t0, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Book_internal_2 --> -12($fp) + # LOCAL local_print_at_Book_internal_3 --> -16($fp) + # local_print_at_Book_internal_3 = VCALL local_print_at_Book_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 76($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_0 --> -4($fp) + # LOCAL local_print_at_Book_internal_3 --> -16($fp) + # local_print_at_Book_internal_0 = local_print_at_Book_internal_3 + lw $t0, -16($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Book_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_12 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -40($fp) + # ARG local_print_at_Book_internal_9 + # LOCAL local_print_at_Book_internal_9 --> -40($fp) + lw $t0, -40($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Book_internal_0 --> -4($fp) + # LOCAL local_print_at_Book_internal_1 --> -8($fp) + # local_print_at_Book_internal_1 = VCALL local_print_at_Book_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 76($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_16 --> -68($fp) + # local_print_at_Book_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_print_at_Book_internal_14 --> -60($fp) + # LOCAL local_print_at_Book_internal_16 --> -68($fp) + # local_print_at_Book_internal_14 = local_print_at_Book_internal_16 + lw $t0, -68($fp) + sw $t0, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Book_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_13 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -72($fp) + # ARG local_print_at_Book_internal_17 + # LOCAL local_print_at_Book_internal_17 --> -72($fp) + lw $t0, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Book_internal_14 --> -60($fp) + # LOCAL local_print_at_Book_internal_15 --> -64($fp) + # local_print_at_Book_internal_15 = VCALL local_print_at_Book_internal_14 out_string + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 76($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_12 --> -52($fp) + # LOCAL local_print_at_Book_internal_15 --> -64($fp) + # local_print_at_Book_internal_12 = local_print_at_Book_internal_15 + lw $t0, -64($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Book_internal_18 = GETATTRIBUTE author Book + # LOCAL local_print_at_Book_internal_18 --> -76($fp) + lw $t0, 16($s1) + sw $t0, -76($fp) + # ARG local_print_at_Book_internal_18 + # LOCAL local_print_at_Book_internal_18 --> -76($fp) + lw $t0, -76($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Book_internal_12 --> -52($fp) + # LOCAL local_print_at_Book_internal_13 --> -56($fp) + # local_print_at_Book_internal_13 = VCALL local_print_at_Book_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 76($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_10 --> -44($fp) + # LOCAL local_print_at_Book_internal_13 --> -56($fp) + # local_print_at_Book_internal_10 = local_print_at_Book_internal_13 + lw $t0, -56($fp) + sw $t0, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Book_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_14 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -80($fp) + # ARG local_print_at_Book_internal_19 + # LOCAL local_print_at_Book_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Book_internal_10 --> -44($fp) + # LOCAL local_print_at_Book_internal_11 --> -48($fp) + # local_print_at_Book_internal_11 = VCALL local_print_at_Book_internal_10 out_string + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 76($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Book_internal_20 --> -84($fp) + # local_print_at_Book_internal_20 = SELF + sw $s1, -84($fp) + # RETURN local_print_at_Book_internal_20 + lw $v0, -84($fp) + # Deallocate stack frame for function function_print_at_Book. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 92 + jr $ra + # Function END + + +# __Article__attrib__per_title__init implementation. +# @Params: +__Article__attrib__per_title__init: + # Allocate stack frame for function __Article__attrib__per_title__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local___attrib__per_title__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -4($fp) + # RETURN local___attrib__per_title__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Article__attrib__per_title__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_initArticle_at_Article implementation. +# @Params: +# 0($fp) = param_initArticle_at_Article_title_p_0 +# 4($fp) = param_initArticle_at_Article_author_p_1 +# 8($fp) = param_initArticle_at_Article_per_title_p_2 +function_initArticle_at_Article: + # Allocate stack frame for function function_initArticle_at_Article. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) + # local_initArticle_at_Article_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) + # LOCAL local_initArticle_at_Article_internal_2 --> -12($fp) + # local_initArticle_at_Article_internal_0 = local_initArticle_at_Article_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_initArticle_at_Article_title_p_0 + # PARAM param_initArticle_at_Article_title_p_0 --> 8($fp) + lw $t0, 8($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # ARG param_initArticle_at_Article_author_p_1 + # PARAM param_initArticle_at_Article_author_p_1 --> 4($fp) + lw $t0, 4($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_initArticle_at_Article_internal_0 --> -4($fp) + # LOCAL local_initArticle_at_Article_internal_1 --> -8($fp) + # local_initArticle_at_Article_internal_1 = VCALL local_initArticle_at_Article_internal_0 initBook + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # PARAM param_initArticle_at_Article_per_title_p_2 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 20($s1) + # LOCAL local_initArticle_at_Article_internal_3 --> -16($fp) + # local_initArticle_at_Article_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_initArticle_at_Article_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_initArticle_at_Article. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 12 + jr $ra + # Function END + + +# function_print_at_Article implementation. +# @Params: +function_print_at_Article: + # Allocate stack frame for function function_print_at_Article. + subu $sp, $sp, 60 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 60 + # LOCAL local_print_at_Article_internal_1 --> -8($fp) + # local_print_at_Article_internal_1 = SELF + sw $s1, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Article_internal_0 = CALL print + # LOCAL local_print_at_Article_internal_0 --> -4($fp) + # LOCAL local_print_at_Article_internal_1 --> -8($fp) + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type's VTABLE + la $t0, Book_vtable + # Get pointer to function address + lw $t1, 72($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -4($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Article_internal_8 --> -36($fp) + # local_print_at_Article_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_print_at_Article_internal_6 --> -28($fp) + # LOCAL local_print_at_Article_internal_8 --> -36($fp) + # local_print_at_Article_internal_6 = local_print_at_Article_internal_8 + lw $t0, -36($fp) + sw $t0, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Article_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_15 + sw $t0, 12($v0) + li $t0, 13 + sw $t0, 16($v0) + sw $v0, -40($fp) + # ARG local_print_at_Article_internal_9 + # LOCAL local_print_at_Article_internal_9 --> -40($fp) + lw $t0, -40($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Article_internal_6 --> -28($fp) + # LOCAL local_print_at_Article_internal_7 --> -32($fp) + # local_print_at_Article_internal_7 = VCALL local_print_at_Article_internal_6 out_string + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 76($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Article_internal_4 --> -20($fp) + # LOCAL local_print_at_Article_internal_7 --> -32($fp) + # local_print_at_Article_internal_4 = local_print_at_Article_internal_7 + lw $t0, -32($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Article_internal_10 = GETATTRIBUTE per_title Article + # LOCAL local_print_at_Article_internal_10 --> -44($fp) + lw $t0, 20($s1) + sw $t0, -44($fp) + # ARG local_print_at_Article_internal_10 + # LOCAL local_print_at_Article_internal_10 --> -44($fp) + lw $t0, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Article_internal_4 --> -20($fp) + # LOCAL local_print_at_Article_internal_5 --> -24($fp) + # local_print_at_Article_internal_5 = VCALL local_print_at_Article_internal_4 out_string + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 76($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Article_internal_2 --> -12($fp) + # LOCAL local_print_at_Article_internal_5 --> -24($fp) + # local_print_at_Article_internal_2 = local_print_at_Article_internal_5 + lw $t0, -24($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Article_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_16 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -48($fp) + # ARG local_print_at_Article_internal_11 + # LOCAL local_print_at_Article_internal_11 --> -48($fp) + lw $t0, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Article_internal_2 --> -12($fp) + # LOCAL local_print_at_Article_internal_3 --> -16($fp) + # local_print_at_Article_internal_3 = VCALL local_print_at_Article_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 76($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Article_internal_12 --> -52($fp) + # local_print_at_Article_internal_12 = SELF + sw $s1, -52($fp) + # RETURN local_print_at_Article_internal_12 + lw $v0, -52($fp) + # Deallocate stack frame for function function_print_at_Article. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 60 + jr $ra + # Function END + diff --git a/tests/codegen/cells.mips b/tests/codegen/cells.mips new file mode 100644 index 00000000..2d4b6cda --- /dev/null +++ b/tests/codegen/cells.mips @@ -0,0 +1,4338 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:09 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +Main: .asciiz "Main" +# Function END +CellularAutomaton: .asciiz "CellularAutomaton" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, dummy, function_in_int_at_IO, dummy, function_in_string_at_IO, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_out_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_concat_at_String, dummy, dummy, dummy, function_length_at_String, dummy, dummy, function_copy_at_Object, function_substr_at_String, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, dummy, dummy, function_main_at_Main, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +# **** VTABLE for type CellularAutomaton **** +CellularAutomaton_vtable: .word function_abort_at_Object, dummy, function_in_int_at_IO, dummy, function_in_string_at_IO, dummy, function_cell_at_next_evolution_at_CellularAutomaton, function_cell_at_CellularAutomaton, function_copy_at_Object, dummy, function_type_name_at_Object, function_num_cells_at_CellularAutomaton, function_out_string_at_IO, function_init_at_CellularAutomaton, function_cell_left_neighbor_at_CellularAutomaton, function_print_at_CellularAutomaton, function_cell_right_neighbor_at_CellularAutomaton, function_evolve_at_CellularAutomaton, function_out_int_at_IO +# Function END +# + + +# **** Type RECORD for type CellularAutomaton **** +CellularAutomaton_start: + CellularAutomaton_vtable_pointer: .word CellularAutomaton_vtable + # Function END +CellularAutomaton_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0, -1 +CellularAutomaton__TDT: .word -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz " X " +# + + +data_5: .asciiz "\n" +# + + +data_6: .asciiz "X" +# + + +data_7: .asciiz "X" +# + + +data_8: .asciiz "X" +# + + +data_9: .asciiz "X" +# + + +data_10: .asciiz "." +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + lb $t3, 0($t1) + beqz $t3, end_loop + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + end_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__cells__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 12($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__cells__init implementation. +# @Params: +__Main__attrib__cells__init: + # Allocate stack frame for function __Main__attrib__cells__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__cells__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = ALLOCATE CellularAutomaton + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, CellularAutomaton + sw $t0, 12($v0) + li $t0, 17 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, CellularAutomaton_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __CellularAutomaton__attrib__population_map__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 19 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 init + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 52($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + lw $t0, -8($fp) + sw $t0, 12($s1) + # local_main_at_Main_internal_6 = GETATTRIBUTE cells Main + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + lw $t0, 12($s1) + sw $t0, -28($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 print + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 60($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_countdown_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 20 + sw $t0, 12($v0) + sw $v0, -36($fp) + # LOCAL local_main_at_Main_countdown_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_countdown_7 = local_main_at_Main_internal_8 + lw $t0, -36($fp) + sw $t0, -32($fp) + label_WHILE_1: + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -48($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_countdown_7 --> -32($fp) + lw $a0, -48($fp) + lw $a1, -32($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_GREATER_ZERO local_main_at_Main_internal_10 GOTO label_FALSE_3 + # IF_GREATER_ZERO local_main_at_Main_internal_10 GOTO label_FALSE_3 + lw $t0, -44($fp) + bgt $t0, 0, label_FALSE_3 + # IF_ZERO local_main_at_Main_internal_10 GOTO label_FALSE_3 + # IF_ZERO local_main_at_Main_internal_10 GOTO label_FALSE_3 + lw $t0, -44($fp) + beq $t0, 0, label_FALSE_3 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + # GOTO label_END_4 +j label_END_4 +label_FALSE_3: + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -44($fp) + label_END_4: +# LOCAL local_main_at_Main_internal_9 --> -40($fp) +# LOCAL local_main_at_Main_internal_10 --> -44($fp) +# Obtain value from -44($fp) +lw $v0, -44($fp) +lw $v0, 12($v0) +sw $v0, -40($fp) +# IF_ZERO local_main_at_Main_internal_9 GOTO label_WHILE_END_2 +# IF_ZERO local_main_at_Main_internal_9 GOTO label_WHILE_END_2 +lw $t0, -40($fp) +beq $t0, 0, label_WHILE_END_2 +# local_main_at_Main_internal_14 = GETATTRIBUTE cells Main +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +lw $t0, 12($s1) +sw $t0, -60($fp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# local_main_at_Main_internal_12 = local_main_at_Main_internal_14 +lw $t0, -60($fp) +sw $t0, -52($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 evolve +# Save new self pointer in $s1 +lw $s1, -52($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 68($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -56($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# local_main_at_Main_internal_17 = GETATTRIBUTE cells Main +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +lw $t0, 12($s1) +sw $t0, -72($fp) +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +# local_main_at_Main_internal_15 = local_main_at_Main_internal_17 +lw $t0, -72($fp) +sw $t0, -64($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 print +# Save new self pointer in $s1 +lw $s1, -64($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 60($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -68($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -80($fp) +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# LOCAL local_main_at_Main_countdown_7 --> -32($fp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# local_main_at_Main_internal_18 = local_main_at_Main_countdown_7 - local_main_at_Main_internal_19 +lw $t1, -32($fp) +lw $t0, 12($t1) +lw $t1, -80($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -76($fp) +# LOCAL local_main_at_Main_countdown_7 --> -32($fp) +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# local_main_at_Main_countdown_7 = local_main_at_Main_internal_18 +lw $t0, -76($fp) +sw $t0, -32($fp) +# GOTO label_WHILE_1 +j label_WHILE_1 +label_WHILE_END_2: + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_20 = SELF + sw $s1, -84($fp) + # RETURN local_main_at_Main_internal_20 + lw $v0, -84($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 92 + jr $ra + # Function END + + +# __CellularAutomaton__attrib__population_map__init implementation. +# @Params: +__CellularAutomaton__attrib__population_map__init: + # Allocate stack frame for function __CellularAutomaton__attrib__population_map__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_rAutomaton__attrib__population_map__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -4($fp) + # RETURN local_rAutomaton__attrib__population_map__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __CellularAutomaton__attrib__population_map__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_init_at_CellularAutomaton_map_0 +function_init_at_CellularAutomaton: + # Allocate stack frame for function function_init_at_CellularAutomaton. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_CellularAutomaton_map_0 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 12($s1) + # LOCAL local_init_at_CellularAutomaton_internal_0 --> -4($fp) + # local_init_at_CellularAutomaton_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_CellularAutomaton_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_at_CellularAutomaton implementation. +# @Params: +function_print_at_CellularAutomaton: + # Allocate stack frame for function function_print_at_CellularAutomaton. + subu $sp, $sp, 40 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 40 + # LOCAL local_print_at_CellularAutomaton_internal_2 --> -12($fp) + # local_print_at_CellularAutomaton_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_print_at_CellularAutomaton_internal_2 --> -12($fp) + # local_print_at_CellularAutomaton_internal_0 = local_print_at_CellularAutomaton_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_CellularAutomaton_internal_5 = GETATTRIBUTE population_map CellularAutomaton + # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) + lw $t0, 12($s1) + sw $t0, -24($fp) + # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) + # local_print_at_CellularAutomaton_internal_3 = local_print_at_CellularAutomaton_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -28($fp) + # ARG local_print_at_CellularAutomaton_internal_6 + # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) + lw $t0, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_print_at_CellularAutomaton_internal_4 --> -20($fp) + # local_print_at_CellularAutomaton_internal_4 = VCALL local_print_at_CellularAutomaton_internal_3 concat + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_print_at_CellularAutomaton_internal_4 + # LOCAL local_print_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_print_at_CellularAutomaton_internal_1 --> -8($fp) + # local_print_at_CellularAutomaton_internal_1 = VCALL local_print_at_CellularAutomaton_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) + # local_print_at_CellularAutomaton_internal_7 = SELF + sw $s1, -32($fp) + # RETURN local_print_at_CellularAutomaton_internal_7 + lw $v0, -32($fp) + # Deallocate stack frame for function function_print_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 40 + jr $ra + # Function END + + +# function_num_cells_at_CellularAutomaton implementation. +# @Params: +function_num_cells_at_CellularAutomaton: + # Allocate stack frame for function function_num_cells_at_CellularAutomaton. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_num_cells_at_CellularAutomaton_internal_2 = GETATTRIBUTE population_map CellularAutomaton + # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) + # local_num_cells_at_CellularAutomaton_internal_0 = local_num_cells_at_CellularAutomaton_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_1 --> -8($fp) + # local_num_cells_at_CellularAutomaton_internal_1 = VCALL local_num_cells_at_CellularAutomaton_internal_0 length + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_num_cells_at_CellularAutomaton_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_num_cells_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cell_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_cell_at_CellularAutomaton_position_0 +function_cell_at_CellularAutomaton: + # Allocate stack frame for function function_cell_at_CellularAutomaton. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_cell_at_CellularAutomaton_internal_2 = GETATTRIBUTE population_map CellularAutomaton + # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) + # local_cell_at_CellularAutomaton_internal_0 = local_cell_at_CellularAutomaton_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cell_at_CellularAutomaton_position_0 + # PARAM param_cell_at_CellularAutomaton_position_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -16($fp) + # ARG local_cell_at_CellularAutomaton_internal_3 + # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) + # local_cell_at_CellularAutomaton_internal_1 = VCALL local_cell_at_CellularAutomaton_internal_0 substr + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 36($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_cell_at_CellularAutomaton_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_cell_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_cell_left_neighbor_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_cell_left_neighbor_at_CellularAutomaton_position_0 +function_cell_left_neighbor_at_CellularAutomaton: + # Allocate stack frame for function function_cell_left_neighbor_at_CellularAutomaton. + subu $sp, $sp, 80 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 80 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # IF_ZERO param_cell_left_neighbor_at_CellularAutomaton_position_0 GOTO label_FALSE_7 + # IF_ZERO param_cell_left_neighbor_at_CellularAutomaton_position_0 GOTO label_FALSE_7 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_7 + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_4 GOTO label_FALSE_7 + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_4 GOTO label_FALSE_7 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_7 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_10 + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_10 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_10 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_11 + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_11 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_11 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_11 + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_11 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_11 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_8 + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_8 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_8 + # GOTO label_FALSE_7 + j label_FALSE_7 + label_COMPARE_BY_VALUE_11: + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_8 + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_8 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_8 + # GOTO label_FALSE_7 + j label_FALSE_7 + label_COMPARE_STRING_10: + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_12 + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_12 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_12 + # GOTO label_FALSE_7 + j label_FALSE_7 + label_CONTINUE_12: + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_13: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_14 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_13 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_14: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_8 + # IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_8 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_8 + label_FALSE_7: + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_9 +j label_END_9 +label_TRUE_8: + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_9: +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_5 +# IF_ZERO local_cell_left_neighbor_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_5 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_5 +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_7 = SELF +sw $s1, -32($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_5 = local_cell_left_neighbor_at_CellularAutomaton_internal_7 +lw $t0, -32($fp) +sw $t0, -24($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_11 = SELF +sw $s1, -48($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_9 = local_cell_left_neighbor_at_CellularAutomaton_internal_11 +lw $t0, -48($fp) +sw $t0, -40($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_10 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_9 num_cells +# Save new self pointer in $s1 +lw $s1, -40($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 44($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -44($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -52($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_8 = local_cell_left_neighbor_at_CellularAutomaton_internal_10 - local_cell_left_neighbor_at_CellularAutomaton_internal_12 +lw $t1, -44($fp) +lw $t0, 12($t1) +lw $t1, -52($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -36($fp) +# ARG local_cell_left_neighbor_at_CellularAutomaton_internal_8 +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) +lw $t0, -36($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_6 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_5 cell +# Save new self pointer in $s1 +lw $s1, -24($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 28($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -28($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) +# local_cell_left_neighbor_at_CellularAutomaton_internal_1 = local_cell_left_neighbor_at_CellularAutomaton_internal_6 +lw $t0, -28($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_15 --> -64($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_15 --> -64($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_13 = local_cell_left_neighbor_at_CellularAutomaton_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -72($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_16 --> -68($fp) + # PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_17 --> -72($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_16 = PARAM param_cell_left_neighbor_at_CellularAutomaton_position_0 - local_cell_left_neighbor_at_CellularAutomaton_internal_17 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -72($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -68($fp) + # ARG local_cell_left_neighbor_at_CellularAutomaton_internal_16 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_16 --> -68($fp) + lw $t0, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_14 --> -60($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_14 = VCALL local_cell_left_neighbor_at_CellularAutomaton_internal_13 cell + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_cell_left_neighbor_at_CellularAutomaton_internal_14 --> -60($fp) + # local_cell_left_neighbor_at_CellularAutomaton_internal_1 = local_cell_left_neighbor_at_CellularAutomaton_internal_14 + lw $t0, -60($fp) + sw $t0, -8($fp) + label_ENDIF_6: +# RETURN local_cell_left_neighbor_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_cell_left_neighbor_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 80 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_cell_right_neighbor_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_cell_right_neighbor_at_CellularAutomaton_position_0 +function_cell_right_neighbor_at_CellularAutomaton: + # Allocate stack frame for function function_cell_right_neighbor_at_CellularAutomaton. + subu $sp, $sp, 80 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 80 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_7 = SELF + sw $s1, -32($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_7 --> -32($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_5 = local_cell_right_neighbor_at_CellularAutomaton_internal_7 + lw $t0, -32($fp) + sw $t0, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_6 = VCALL local_cell_right_neighbor_at_CellularAutomaton_internal_5 num_cells + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_8 --> -36($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_4 = local_cell_right_neighbor_at_CellularAutomaton_internal_6 - local_cell_right_neighbor_at_CellularAutomaton_internal_8 + lw $t1, -28($fp) + lw $t0, 12($t1) + lw $t1, -36($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -20($fp) + # IF_ZERO param_cell_right_neighbor_at_CellularAutomaton_position_0 GOTO label_FALSE_17 + # IF_ZERO param_cell_right_neighbor_at_CellularAutomaton_position_0 GOTO label_FALSE_17 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_17 + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_4 GOTO label_FALSE_17 + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_4 GOTO label_FALSE_17 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_17 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_20 + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_20 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_20 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_21 + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_21 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_21 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_21 + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_21 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_21 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_18 + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_18 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_18 + # GOTO label_FALSE_17 + j label_FALSE_17 + label_COMPARE_BY_VALUE_21: + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_18 + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_18 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_18 + # GOTO label_FALSE_17 + j label_FALSE_17 + label_COMPARE_STRING_20: + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_22 + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_22 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_22 + # GOTO label_FALSE_17 + j label_FALSE_17 + label_CONTINUE_22: + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_23: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_24 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_23 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_24: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_18 + # IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_3 GOTO label_TRUE_18 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_18 + label_FALSE_17: + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_19 +j label_END_19 +label_TRUE_18: + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_19: +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_15 +# IF_ZERO local_cell_right_neighbor_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_15 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_15 +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) +# local_cell_right_neighbor_at_CellularAutomaton_internal_11 = SELF +sw $s1, -48($fp) +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_11 --> -48($fp) +# local_cell_right_neighbor_at_CellularAutomaton_internal_9 = local_cell_right_neighbor_at_CellularAutomaton_internal_11 +lw $t0, -48($fp) +sw $t0, -40($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -52($fp) +# ARG local_cell_right_neighbor_at_CellularAutomaton_internal_12 +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_12 --> -52($fp) +lw $t0, -52($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_9 --> -40($fp) +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) +# local_cell_right_neighbor_at_CellularAutomaton_internal_10 = VCALL local_cell_right_neighbor_at_CellularAutomaton_internal_9 cell +# Save new self pointer in $s1 +lw $s1, -40($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 28($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -44($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_10 --> -44($fp) +# local_cell_right_neighbor_at_CellularAutomaton_internal_1 = local_cell_right_neighbor_at_CellularAutomaton_internal_10 +lw $t0, -44($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_16 +j label_ENDIF_16 +label_FALSEIF_15: + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_15 --> -64($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_15 --> -64($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_13 = local_cell_right_neighbor_at_CellularAutomaton_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -72($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_16 --> -68($fp) + # PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_17 --> -72($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_16 = PARAM param_cell_right_neighbor_at_CellularAutomaton_position_0 + local_cell_right_neighbor_at_CellularAutomaton_internal_17 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -72($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -68($fp) + # ARG local_cell_right_neighbor_at_CellularAutomaton_internal_16 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_16 --> -68($fp) + lw $t0, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_14 --> -60($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_14 = VCALL local_cell_right_neighbor_at_CellularAutomaton_internal_13 cell + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_cell_right_neighbor_at_CellularAutomaton_internal_14 --> -60($fp) + # local_cell_right_neighbor_at_CellularAutomaton_internal_1 = local_cell_right_neighbor_at_CellularAutomaton_internal_14 + lw $t0, -60($fp) + sw $t0, -8($fp) + label_ENDIF_16: +# RETURN local_cell_right_neighbor_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_cell_right_neighbor_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 80 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_cell_at_next_evolution_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_cell_at_next_evolution_at_CellularAutomaton_position_0 +function_cell_at_next_evolution_at_CellularAutomaton: + # Allocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. + subu $sp, $sp, 164 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 164 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_10 = local_cell_at_next_evolution_at_CellularAutomaton_internal_12 + lw $t0, -52($fp) + sw $t0, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 + # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_11 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 cell + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_6 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -56($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_11 GOTO label_FALSE_29 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_11 GOTO label_FALSE_29 + lw $t0, -48($fp) + beq $t0, 0, label_FALSE_29 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_13 GOTO label_FALSE_29 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_13 GOTO label_FALSE_29 + lw $t0, -56($fp) + beq $t0, 0, label_FALSE_29 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with String + la $v0, String + lw $a0, -48($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_COMPARE_STRING_32 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_COMPARE_STRING_32 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_32 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with Bool + la $v0, Bool + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_33 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_33 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_33 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with Int + la $v0, Int + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_33 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_33 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_33 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) + # Load pointers and SUB + lw $a0, -48($fp) + lw $a1, -56($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_TRUE_30 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_TRUE_30 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_30 + # GOTO label_FALSE_29 + j label_FALSE_29 + label_COMPARE_BY_VALUE_33: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) + lw $a0, -48($fp) + lw $a1, -56($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_TRUE_30 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_TRUE_30 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_30 + # GOTO label_FALSE_29 + j label_FALSE_29 + label_COMPARE_STRING_32: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -56($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_CONTINUE_34 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_CONTINUE_34 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_34 + # GOTO label_FALSE_29 + j label_FALSE_29 + label_CONTINUE_34: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -56($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_35: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_36 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_35 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_36: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_TRUE_30 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_TRUE_30 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_30 + label_FALSE_29: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_31 +j label_END_31 +label_TRUE_30: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_31: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_27 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_27 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_27 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -60($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = local_cell_at_next_evolution_at_CellularAutomaton_internal_14 +lw $t0, -60($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_28 +j label_ENDIF_28 +label_FALSEIF_27: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -64($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_7 = local_cell_at_next_evolution_at_CellularAutomaton_internal_15 + lw $t0, -64($fp) + sw $t0, -32($fp) + label_ENDIF_28: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_22 = SELF +sw $s1, -92($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_20 = local_cell_at_next_evolution_at_CellularAutomaton_internal_22 +lw $t0, -92($fp) +sw $t0, -84($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 +# PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_21 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 cell_left_neighbor +# Save new self pointer in $s1 +lw $s1, -84($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 56($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -88($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_7 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -96($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_21 GOTO label_FALSE_39 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_21 GOTO label_FALSE_39 +lw $t0, -88($fp) +beq $t0, 0, label_FALSE_39 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_23 GOTO label_FALSE_39 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_23 GOTO label_FALSE_39 +lw $t0, -96($fp) +beq $t0, 0, label_FALSE_39 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) +# Comparing -88($fp) type with String +la $v0, String +lw $a0, -88($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -80($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_COMPARE_STRING_42 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_COMPARE_STRING_42 +lw $t0, -80($fp) +beq $t0, 0, label_COMPARE_STRING_42 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) +# Comparing -88($fp) type with Bool +la $v0, Bool +lw $a0, -88($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -80($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_43 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_43 +lw $t0, -80($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_43 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) +# Comparing -88($fp) type with Int +la $v0, Int +lw $a0, -88($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -80($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_43 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_43 +lw $t0, -80($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_43 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) +# Load pointers and SUB +lw $a0, -88($fp) +lw $a1, -96($fp) +sub $a0, $a0, $a1 +sw $a0, -80($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_TRUE_40 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_TRUE_40 +lw $t0, -80($fp) +beq $t0, 0, label_TRUE_40 +# GOTO label_FALSE_39 +j label_FALSE_39 +label_COMPARE_BY_VALUE_43: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) + lw $a0, -88($fp) + lw $a1, -96($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -80($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_TRUE_40 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_TRUE_40 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_40 + # GOTO label_FALSE_39 + j label_FALSE_39 + label_COMPARE_STRING_42: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) + # Load strings for comparison + lw $v0, -88($fp) + lw $v1, -96($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -80($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_CONTINUE_44 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_CONTINUE_44 + lw $t0, -80($fp) + beq $t0, 0, label_CONTINUE_44 + # GOTO label_FALSE_39 + j label_FALSE_39 + label_CONTINUE_44: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -88($fp) + lw $v1, -96($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_45: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_46 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_45 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_46: + # Store result + sw $a2, -80($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_TRUE_40 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_19 GOTO label_TRUE_40 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_40 + label_FALSE_39: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -76($fp) + # GOTO label_END_41 +j label_END_41 +label_TRUE_40: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -76($fp) + label_END_41: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) +# Obtain value from -76($fp) +lw $v0, -76($fp) +lw $v0, 12($v0) +sw $v0, -68($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_16 GOTO label_FALSEIF_37 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_16 GOTO label_FALSEIF_37 +lw $t0, -68($fp) +beq $t0, 0, label_FALSEIF_37 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -100($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_17 = local_cell_at_next_evolution_at_CellularAutomaton_internal_24 +lw $t0, -100($fp) +sw $t0, -72($fp) +# GOTO label_ENDIF_38 +j label_ENDIF_38 +label_FALSEIF_37: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_25 --> -104($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -104($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_25 --> -104($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_17 = local_cell_at_next_evolution_at_CellularAutomaton_internal_25 + lw $t0, -104($fp) + sw $t0, -72($fp) + label_ENDIF_38: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_5 = local_cell_at_next_evolution_at_CellularAutomaton_internal_7 + local_cell_at_next_evolution_at_CellularAutomaton_internal_17 +lw $t1, -32($fp) +lw $t0, 12($t1) +lw $t1, -72($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -24($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_32 --> -132($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_32 = SELF +sw $s1, -132($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_30 --> -124($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_32 --> -132($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_30 = local_cell_at_next_evolution_at_CellularAutomaton_internal_32 +lw $t0, -132($fp) +sw $t0, -124($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 +# PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_30 --> -124($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_31 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_30 cell_right_neighbor +# Save new self pointer in $s1 +lw $s1, -124($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 64($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -128($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_33 --> -136($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_8 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -136($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_31 GOTO label_FALSE_49 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_31 GOTO label_FALSE_49 +lw $t0, -128($fp) +beq $t0, 0, label_FALSE_49 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_33 GOTO label_FALSE_49 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_33 GOTO label_FALSE_49 +lw $t0, -136($fp) +beq $t0, 0, label_FALSE_49 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) +# Comparing -128($fp) type with String +la $v0, String +lw $a0, -128($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -120($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_COMPARE_STRING_52 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_COMPARE_STRING_52 +lw $t0, -120($fp) +beq $t0, 0, label_COMPARE_STRING_52 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) +# Comparing -128($fp) type with Bool +la $v0, Bool +lw $a0, -128($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -120($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_COMPARE_BY_VALUE_53 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_COMPARE_BY_VALUE_53 +lw $t0, -120($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_53 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) +# Comparing -128($fp) type with Int +la $v0, Int +lw $a0, -128($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -120($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_COMPARE_BY_VALUE_53 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_COMPARE_BY_VALUE_53 +lw $t0, -120($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_53 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_33 --> -136($fp) +# Load pointers and SUB +lw $a0, -128($fp) +lw $a1, -136($fp) +sub $a0, $a0, $a1 +sw $a0, -120($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_TRUE_50 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_TRUE_50 +lw $t0, -120($fp) +beq $t0, 0, label_TRUE_50 +# GOTO label_FALSE_49 +j label_FALSE_49 +label_COMPARE_BY_VALUE_53: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_33 --> -136($fp) + lw $a0, -128($fp) + lw $a1, -136($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -120($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_TRUE_50 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_TRUE_50 + lw $t0, -120($fp) + beq $t0, 0, label_TRUE_50 + # GOTO label_FALSE_49 + j label_FALSE_49 + label_COMPARE_STRING_52: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_33 --> -136($fp) + # Load strings for comparison + lw $v0, -128($fp) + lw $v1, -136($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -120($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_CONTINUE_54 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_CONTINUE_54 + lw $t0, -120($fp) + beq $t0, 0, label_CONTINUE_54 + # GOTO label_FALSE_49 + j label_FALSE_49 + label_CONTINUE_54: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_29 --> -120($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_31 --> -128($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_33 --> -136($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -128($fp) + lw $v1, -136($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_55: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_56 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_55 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_56: + # Store result + sw $a2, -120($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_TRUE_50 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_29 GOTO label_TRUE_50 + lw $t0, -120($fp) + beq $t0, 0, label_TRUE_50 + label_FALSE_49: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_28 --> -116($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -116($fp) + # GOTO label_END_51 +j label_END_51 +label_TRUE_50: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_28 --> -116($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -116($fp) + label_END_51: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_26 --> -108($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_28 --> -116($fp) +# Obtain value from -116($fp) +lw $v0, -116($fp) +lw $v0, 12($v0) +sw $v0, -108($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_26 GOTO label_FALSEIF_47 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_26 GOTO label_FALSEIF_47 +lw $t0, -108($fp) +beq $t0, 0, label_FALSEIF_47 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_34 --> -140($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -140($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_27 --> -112($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_34 --> -140($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_27 = local_cell_at_next_evolution_at_CellularAutomaton_internal_34 +lw $t0, -140($fp) +sw $t0, -112($fp) +# GOTO label_ENDIF_48 +j label_ENDIF_48 +label_FALSEIF_47: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_35 --> -144($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -144($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_27 --> -112($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_35 --> -144($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_27 = local_cell_at_next_evolution_at_CellularAutomaton_internal_35 + lw $t0, -144($fp) + sw $t0, -112($fp) + label_ENDIF_48: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_27 --> -112($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_4 = local_cell_at_next_evolution_at_CellularAutomaton_internal_5 + local_cell_at_next_evolution_at_CellularAutomaton_internal_27 +lw $t1, -24($fp) +lw $t0, 12($t1) +lw $t1, -112($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -20($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_36 --> -148($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -148($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_4 GOTO label_FALSE_57 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_4 GOTO label_FALSE_57 +lw $t0, -20($fp) +beq $t0, 0, label_FALSE_57 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_36 GOTO label_FALSE_57 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_36 GOTO label_FALSE_57 +lw $t0, -148($fp) +beq $t0, 0, label_FALSE_57 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) +# Comparing -20($fp) type with String +la $v0, String +lw $a0, -20($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -16($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_60 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_60 +lw $t0, -16($fp) +beq $t0, 0, label_COMPARE_STRING_60 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) +# Comparing -20($fp) type with Bool +la $v0, Bool +lw $a0, -20($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -16($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_61 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_61 +lw $t0, -16($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_61 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) +# Comparing -20($fp) type with Int +la $v0, Int +lw $a0, -20($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -16($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_61 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_61 +lw $t0, -16($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_61 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_36 --> -148($fp) +# Load pointers and SUB +lw $a0, -20($fp) +lw $a1, -148($fp) +sub $a0, $a0, $a1 +sw $a0, -16($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_58 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_58 +lw $t0, -16($fp) +beq $t0, 0, label_TRUE_58 +# GOTO label_FALSE_57 +j label_FALSE_57 +label_COMPARE_BY_VALUE_61: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_36 --> -148($fp) + lw $a0, -20($fp) + lw $a1, -148($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_58 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_58 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_58 + # GOTO label_FALSE_57 + j label_FALSE_57 + label_COMPARE_STRING_60: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_36 --> -148($fp) + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -148($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_62 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_62 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_62 + # GOTO label_FALSE_57 + j label_FALSE_57 + label_CONTINUE_62: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_36 --> -148($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -148($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_63: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_64 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_63 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_64: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_58 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_58 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_58 + label_FALSE_57: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_59 +j label_END_59 +label_TRUE_58: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_59: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_25 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_25 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_25 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_37 --> -152($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_9 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -152($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_37 --> -152($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = local_cell_at_next_evolution_at_CellularAutomaton_internal_37 +lw $t0, -152($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_26 +j label_ENDIF_26 +label_FALSEIF_25: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_10 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -156($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_38 --> -156($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = local_cell_at_next_evolution_at_CellularAutomaton_internal_38 + lw $t0, -156($fp) + sw $t0, -8($fp) + label_ENDIF_26: +# RETURN local_cell_at_next_evolution_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 164 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_evolve_at_CellularAutomaton implementation. +# @Params: +function_evolve_at_CellularAutomaton: + # Allocate stack frame for function function_evolve_at_CellularAutomaton. + subu $sp, $sp, 72 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 72 + # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) + # local_evolve_at_CellularAutomaton_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) + # local_evolve_at_CellularAutomaton_internal_2 = local_evolve_at_CellularAutomaton_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_evolve_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) + # local_evolve_at_CellularAutomaton_internal_3 = VCALL local_evolve_at_CellularAutomaton_internal_2 num_cells + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 44($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) + # local_evolve_at_CellularAutomaton_num_1 = local_evolve_at_CellularAutomaton_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -24($fp) + label_WHILE_65: + # LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) + # LOCAL local_evolve_at_CellularAutomaton_num_1 --> -8($fp) + lw $a0, -4($fp) + lw $a1, -8($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -32($fp) + # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_7 GOTO label_FALSE_67 + # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_7 GOTO label_FALSE_67 + lw $t0, -32($fp) + bgt $t0, 0, label_FALSE_67 + # IF_ZERO local_evolve_at_CellularAutomaton_internal_7 GOTO label_FALSE_67 + # IF_ZERO local_evolve_at_CellularAutomaton_internal_7 GOTO label_FALSE_67 + lw $t0, -32($fp) + beq $t0, 0, label_FALSE_67 + # LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -32($fp) + # GOTO label_END_68 +j label_END_68 +label_FALSE_67: + # LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -32($fp) + label_END_68: +# LOCAL local_evolve_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) +# Obtain value from -32($fp) +lw $v0, -32($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_66 +# IF_ZERO local_evolve_at_CellularAutomaton_internal_6 GOTO label_WHILE_END_66 +lw $t0, -28($fp) +beq $t0, 0, label_WHILE_END_66 +# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) +# local_evolve_at_CellularAutomaton_internal_8 = local_evolve_at_CellularAutomaton_temp_5 +lw $t0, -24($fp) +sw $t0, -36($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) +# local_evolve_at_CellularAutomaton_internal_12 = SELF +sw $s1, -52($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) +# local_evolve_at_CellularAutomaton_internal_10 = local_evolve_at_CellularAutomaton_internal_12 +lw $t0, -52($fp) +sw $t0, -44($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_evolve_at_CellularAutomaton_position_0 +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +lw $t0, -4($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) +# local_evolve_at_CellularAutomaton_internal_11 = VCALL local_evolve_at_CellularAutomaton_internal_10 cell_at_next_evolution +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 24($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_evolve_at_CellularAutomaton_internal_11 +# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) +lw $t0, -48($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) +# local_evolve_at_CellularAutomaton_internal_9 = VCALL local_evolve_at_CellularAutomaton_internal_8 concat +# Save new self pointer in $s1 +lw $s1, -36($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 4($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -40($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) +# local_evolve_at_CellularAutomaton_temp_5 = local_evolve_at_CellularAutomaton_internal_9 +lw $t0, -40($fp) +sw $t0, -24($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_14 --> -60($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -60($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_14 --> -60($fp) +# local_evolve_at_CellularAutomaton_internal_13 = local_evolve_at_CellularAutomaton_position_0 + local_evolve_at_CellularAutomaton_internal_14 +lw $t1, -4($fp) +lw $t0, 12($t1) +lw $t1, -60($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -56($fp) +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) +# local_evolve_at_CellularAutomaton_position_0 = local_evolve_at_CellularAutomaton_internal_13 +lw $t0, -56($fp) +sw $t0, -4($fp) +# GOTO label_WHILE_65 +j label_WHILE_65 +label_WHILE_END_66: + # + # LOCAL local_evolve_at_CellularAutomaton_temp_5 --> -24($fp) + lw $t0, -24($fp) + sw $t0, 12($s1) + # LOCAL local_evolve_at_CellularAutomaton_internal_15 --> -64($fp) + # local_evolve_at_CellularAutomaton_internal_15 = SELF + sw $s1, -64($fp) + # RETURN local_evolve_at_CellularAutomaton_internal_15 + lw $v0, -64($fp) + # Deallocate stack frame for function function_evolve_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 72 + jr $ra + # Function END + diff --git a/tests/codegen/complex.mips b/tests/codegen/complex.mips new file mode 100644 index 00000000..a019cde9 --- /dev/null +++ b/tests/codegen/complex.mips @@ -0,0 +1,3339 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:06 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +Complex: .asciiz "Complex" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_out_string_at_IO, dummy, function_abort_at_Object, function_type_name_at_Object, function_out_int_at_IO, dummy, dummy, function_in_int_at_IO, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_in_string_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word dummy, dummy, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word dummy, function_concat_at_String, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, function_length_at_String, function_substr_at_String, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word dummy, dummy, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word dummy, dummy, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type Complex **** +Complex_vtable: .word function_out_string_at_IO, dummy, function_abort_at_Object, function_type_name_at_Object, function_out_int_at_IO, function_init_at_Complex, function_reflect_0_at_Complex, function_in_int_at_IO, function_reflect_Y_at_Complex, dummy, function_copy_at_Object, dummy, dummy, function_reflect_X_at_Complex, function_print_at_Complex, function_in_string_at_IO +# Function END +# + + +# **** Type RECORD for type Complex **** +Complex_start: + Complex_vtable_pointer: .word Complex_vtable + # Function END +Complex_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, dummy, function_abort_at_Object, function_type_name_at_Object, function_out_int_at_IO, dummy, dummy, function_in_int_at_IO, dummy, function_main_at_Main, function_copy_at_Object, dummy, dummy, dummy, dummy, function_in_string_at_IO +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, 1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1 +Complex__TDT: .word -1, -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "+" +# + + +data_5: .asciiz "I" +# + + +data_6: .asciiz "=)\n" +# + + +data_7: .asciiz "=(\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + lb $t3, 0($t1) + beqz $t3, end_loop + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + end_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 36($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Complex__attrib__x__init implementation. +# @Params: +__Complex__attrib__x__init: + # Allocate stack frame for function __Complex__attrib__x__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local___attrib__x__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local___attrib__x__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Complex__attrib__x__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Complex__attrib__y__init implementation. +# @Params: +__Complex__attrib__y__init: + # Allocate stack frame for function __Complex__attrib__y__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local___attrib__y__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local___attrib__y__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Complex__attrib__y__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Complex implementation. +# @Params: +# 0($fp) = param_init_at_Complex_a_0 +# 4($fp) = param_init_at_Complex_b_1 +function_init_at_Complex: + # Allocate stack frame for function function_init_at_Complex. + subu $sp, $sp, 36 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 36 + # local_init_at_Complex_internal_2 = GETATTRIBUTE x Complex + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # IF_ZERO local_init_at_Complex_internal_2 GOTO label_FALSE_1 + # IF_ZERO local_init_at_Complex_internal_2 GOTO label_FALSE_1 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_1 + # IF_ZERO param_init_at_Complex_a_0 GOTO label_FALSE_1 + # IF_ZERO param_init_at_Complex_a_0 GOTO label_FALSE_1 + lw $t0, 4($fp) + beq $t0, 0, label_FALSE_1 + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_STRING_4 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_STRING_4 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_STRING_4 + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_5 + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_5 + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, 4($fp) + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_2 + # GOTO label_FALSE_1 + j label_FALSE_1 + label_COMPARE_BY_VALUE_5: + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + lw $a0, -12($fp) + lw $a1, 4($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_2 + # GOTO label_FALSE_1 + j label_FALSE_1 + label_COMPARE_STRING_4: + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, 4($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_CONTINUE_6 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_CONTINUE_6 + lw $t0, -8($fp) + beq $t0, 0, label_CONTINUE_6 + # GOTO label_FALSE_1 + j label_FALSE_1 + label_CONTINUE_6: + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, 4($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_7: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_8 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_7 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_8: + # Store result + sw $a2, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_2 + label_FALSE_1: + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # GOTO label_END_3 +j label_END_3 +label_TRUE_2: + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + label_END_3: +# local_init_at_Complex_internal_5 = GETATTRIBUTE y Complex +# LOCAL local_init_at_Complex_internal_5 --> -24($fp) +lw $t0, 16($s1) +sw $t0, -24($fp) +# IF_ZERO local_init_at_Complex_internal_5 GOTO label_FALSE_9 +# IF_ZERO local_init_at_Complex_internal_5 GOTO label_FALSE_9 +lw $t0, -24($fp) +beq $t0, 0, label_FALSE_9 +# IF_ZERO param_init_at_Complex_b_1 GOTO label_FALSE_9 +# IF_ZERO param_init_at_Complex_b_1 GOTO label_FALSE_9 +lw $t0, 0($fp) +beq $t0, 0, label_FALSE_9 +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# LOCAL local_init_at_Complex_internal_5 --> -24($fp) +# Comparing -24($fp) type with String +la $v0, String +lw $a0, -24($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -20($fp) +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_STRING_12 +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_STRING_12 +lw $t0, -20($fp) +beq $t0, 0, label_COMPARE_STRING_12 +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# LOCAL local_init_at_Complex_internal_5 --> -24($fp) +# Comparing -24($fp) type with Bool +la $v0, Bool +lw $a0, -24($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -20($fp) +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 +lw $t0, -20($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_13 +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# LOCAL local_init_at_Complex_internal_5 --> -24($fp) +# Comparing -24($fp) type with Int +la $v0, Int +lw $a0, -24($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -20($fp) +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 +lw $t0, -20($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_13 +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# LOCAL local_init_at_Complex_internal_5 --> -24($fp) +# PARAM param_init_at_Complex_b_1 --> 0($fp) +# Load pointers and SUB +lw $a0, -24($fp) +lw $a1, 0($fp) +sub $a0, $a0, $a1 +sw $a0, -20($fp) +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 +lw $t0, -20($fp) +beq $t0, 0, label_TRUE_10 +# GOTO label_FALSE_9 +j label_FALSE_9 +label_COMPARE_BY_VALUE_13: + # LOCAL local_init_at_Complex_internal_4 --> -20($fp) + # LOCAL local_init_at_Complex_internal_5 --> -24($fp) + # PARAM param_init_at_Complex_b_1 --> 0($fp) + lw $a0, -24($fp) + lw $a1, 0($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -20($fp) + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 + lw $t0, -20($fp) + beq $t0, 0, label_TRUE_10 + # GOTO label_FALSE_9 + j label_FALSE_9 + label_COMPARE_STRING_12: + # LOCAL local_init_at_Complex_internal_4 --> -20($fp) + # LOCAL local_init_at_Complex_internal_5 --> -24($fp) + # PARAM param_init_at_Complex_b_1 --> 0($fp) + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, 0($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -20($fp) + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_CONTINUE_14 + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_CONTINUE_14 + lw $t0, -20($fp) + beq $t0, 0, label_CONTINUE_14 + # GOTO label_FALSE_9 + j label_FALSE_9 + label_CONTINUE_14: + # LOCAL local_init_at_Complex_internal_4 --> -20($fp) + # LOCAL local_init_at_Complex_internal_5 --> -24($fp) + # PARAM param_init_at_Complex_b_1 --> 0($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, 0($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_15: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_16 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_15 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_16: + # Store result + sw $a2, -20($fp) + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 + lw $t0, -20($fp) + beq $t0, 0, label_TRUE_10 + label_FALSE_9: + # LOCAL local_init_at_Complex_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -16($fp) + # GOTO label_END_11 +j label_END_11 +label_TRUE_10: + # LOCAL local_init_at_Complex_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -16($fp) + label_END_11: +# LOCAL local_init_at_Complex_internal_6 --> -28($fp) +# local_init_at_Complex_internal_6 = SELF +sw $s1, -28($fp) +# RETURN local_init_at_Complex_internal_6 +lw $v0, -28($fp) +# Deallocate stack frame for function function_init_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 36 +# Deallocate function args +addu $sp, $sp, 8 +jr $ra +# Function END + + +# function_print_at_Complex implementation. +# @Params: +function_print_at_Complex: + # Allocate stack frame for function function_print_at_Complex. + subu $sp, $sp, 100 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 100 + # local_print_at_Complex_internal_4 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # LOCAL local_print_at_Complex_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # IF_ZERO local_print_at_Complex_internal_4 GOTO label_FALSE_19 + # IF_ZERO local_print_at_Complex_internal_4 GOTO label_FALSE_19 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_19 + # IF_ZERO local_print_at_Complex_internal_5 GOTO label_FALSE_19 + # IF_ZERO local_print_at_Complex_internal_5 GOTO label_FALSE_19 + lw $t0, -24($fp) + beq $t0, 0, label_FALSE_19 + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # Comparing -20($fp) type with String + la $v0, String + lw $a0, -20($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_STRING_22 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_STRING_22 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_22 + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # Comparing -20($fp) type with Bool + la $v0, Bool + lw $a0, -20($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_23 + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # Comparing -20($fp) type with Int + la $v0, Int + lw $a0, -20($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_23 + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # LOCAL local_print_at_Complex_internal_5 --> -24($fp) + # Load pointers and SUB + lw $a0, -20($fp) + lw $a1, -24($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_20 + # GOTO label_FALSE_19 + j label_FALSE_19 + label_COMPARE_BY_VALUE_23: + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # LOCAL local_print_at_Complex_internal_5 --> -24($fp) + lw $a0, -20($fp) + lw $a1, -24($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_20 + # GOTO label_FALSE_19 + j label_FALSE_19 + label_COMPARE_STRING_22: + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # LOCAL local_print_at_Complex_internal_5 --> -24($fp) + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -24($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_CONTINUE_24 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_CONTINUE_24 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_24 + # GOTO label_FALSE_19 + j label_FALSE_19 + label_CONTINUE_24: + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # LOCAL local_print_at_Complex_internal_5 --> -24($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -24($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_25: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_26 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_25 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_26: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_20 + label_FALSE_19: + # LOCAL local_print_at_Complex_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_21 +j label_END_21 +label_TRUE_20: + # LOCAL local_print_at_Complex_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_21: +# LOCAL local_print_at_Complex_internal_0 --> -4($fp) +# LOCAL local_print_at_Complex_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_print_at_Complex_internal_0 GOTO label_FALSEIF_17 +# IF_ZERO local_print_at_Complex_internal_0 GOTO label_FALSEIF_17 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_17 +# LOCAL local_print_at_Complex_internal_8 --> -36($fp) +# local_print_at_Complex_internal_8 = SELF +sw $s1, -36($fp) +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +# LOCAL local_print_at_Complex_internal_8 --> -36($fp) +# local_print_at_Complex_internal_6 = local_print_at_Complex_internal_8 +lw $t0, -36($fp) +sw $t0, -28($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_print_at_Complex_internal_9 = GETATTRIBUTE x Complex +# LOCAL local_print_at_Complex_internal_9 --> -40($fp) +lw $t0, 12($s1) +sw $t0, -40($fp) +# ARG local_print_at_Complex_internal_9 +# LOCAL local_print_at_Complex_internal_9 --> -40($fp) +lw $t0, -40($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +# LOCAL local_print_at_Complex_internal_7 --> -32($fp) +# local_print_at_Complex_internal_7 = VCALL local_print_at_Complex_internal_6 out_int +# Save new self pointer in $s1 +lw $s1, -28($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -32($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_print_at_Complex_internal_1 --> -8($fp) +# LOCAL local_print_at_Complex_internal_7 --> -32($fp) +# local_print_at_Complex_internal_1 = local_print_at_Complex_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_18 +j label_ENDIF_18 +label_FALSEIF_17: + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + # local_print_at_Complex_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + # local_print_at_Complex_internal_16 = local_print_at_Complex_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Complex_internal_19 = GETATTRIBUTE x Complex + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + lw $t0, 12($s1) + sw $t0, -80($fp) + # ARG local_print_at_Complex_internal_19 + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + # local_print_at_Complex_internal_17 = VCALL local_print_at_Complex_internal_16 out_int + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_14 --> -60($fp) + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + # local_print_at_Complex_internal_14 = local_print_at_Complex_internal_17 + lw $t0, -72($fp) + sw $t0, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Complex_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -84($fp) + # ARG local_print_at_Complex_internal_20 + # LOCAL local_print_at_Complex_internal_20 --> -84($fp) + lw $t0, -84($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Complex_internal_14 --> -60($fp) + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_15 = VCALL local_print_at_Complex_internal_14 out_string + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_12 --> -52($fp) + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_12 = local_print_at_Complex_internal_15 + lw $t0, -64($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Complex_internal_21 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_21 --> -88($fp) + lw $t0, 16($s1) + sw $t0, -88($fp) + # ARG local_print_at_Complex_internal_21 + # LOCAL local_print_at_Complex_internal_21 --> -88($fp) + lw $t0, -88($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Complex_internal_12 --> -52($fp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # local_print_at_Complex_internal_13 = VCALL local_print_at_Complex_internal_12 out_int + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_10 --> -44($fp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # local_print_at_Complex_internal_10 = local_print_at_Complex_internal_13 + lw $t0, -56($fp) + sw $t0, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Complex_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -92($fp) + # ARG local_print_at_Complex_internal_22 + # LOCAL local_print_at_Complex_internal_22 --> -92($fp) + lw $t0, -92($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Complex_internal_10 --> -44($fp) + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # local_print_at_Complex_internal_11 = VCALL local_print_at_Complex_internal_10 out_string + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # local_print_at_Complex_internal_1 = local_print_at_Complex_internal_11 + lw $t0, -48($fp) + sw $t0, -8($fp) + label_ENDIF_18: +# RETURN local_print_at_Complex_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_print_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 100 +jr $ra +# Function END + + +# function_reflect_0_at_Complex implementation. +# @Params: +function_reflect_0_at_Complex: + # Allocate stack frame for function function_reflect_0_at_Complex. + subu $sp, $sp, 52 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 52 + # local_reflect_0_at_Complex_internal_2 = GETATTRIBUTE x Complex + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # local_reflect_0_at_Complex_internal_4 = GETATTRIBUTE x Complex + # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) + lw $t0, 12($s1) + sw $t0, -20($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) + lw $t0, -20($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -16($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -16($fp) + sw $t0, 12($v0) + sw $v0, -16($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_2 GOTO label_FALSE_27 + # IF_ZERO local_reflect_0_at_Complex_internal_2 GOTO label_FALSE_27 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_27 + # IF_ZERO local_reflect_0_at_Complex_internal_3 GOTO label_FALSE_27 + # IF_ZERO local_reflect_0_at_Complex_internal_3 GOTO label_FALSE_27 + lw $t0, -16($fp) + beq $t0, 0, label_FALSE_27 + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_STRING_30 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_STRING_30 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_STRING_30 + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_31 + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_31 + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, -16($fp) + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_28 + # GOTO label_FALSE_27 + j label_FALSE_27 + label_COMPARE_BY_VALUE_31: + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + lw $a0, -12($fp) + lw $a1, -16($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_28 + # GOTO label_FALSE_27 + j label_FALSE_27 + label_COMPARE_STRING_30: + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_CONTINUE_32 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_CONTINUE_32 + lw $t0, -8($fp) + beq $t0, 0, label_CONTINUE_32 + # GOTO label_FALSE_27 + j label_FALSE_27 + label_CONTINUE_32: + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_33: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_34 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_33 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_34: + # Store result + sw $a2, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_28 + label_FALSE_27: + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # GOTO label_END_29 +j label_END_29 +label_TRUE_28: + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + label_END_29: +# local_reflect_0_at_Complex_internal_7 = GETATTRIBUTE y Complex +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +lw $t0, 16($s1) +sw $t0, -32($fp) +# local_reflect_0_at_Complex_internal_9 = GETATTRIBUTE y Complex +# LOCAL local_reflect_0_at_Complex_internal_9 --> -40($fp) +lw $t0, 16($s1) +sw $t0, -40($fp) +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# LOCAL local_reflect_0_at_Complex_internal_9 --> -40($fp) +lw $t0, -40($fp) +lw $t0, 12($t0) +not $t0, $t0 +add $t0, $t0, 1 +sw $t0, -36($fp) +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +lw $t0, -36($fp) +sw $t0, 12($v0) +sw $v0, -36($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_7 GOTO label_FALSE_35 +# IF_ZERO local_reflect_0_at_Complex_internal_7 GOTO label_FALSE_35 +lw $t0, -32($fp) +beq $t0, 0, label_FALSE_35 +# IF_ZERO local_reflect_0_at_Complex_internal_8 GOTO label_FALSE_35 +# IF_ZERO local_reflect_0_at_Complex_internal_8 GOTO label_FALSE_35 +lw $t0, -36($fp) +beq $t0, 0, label_FALSE_35 +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +# Comparing -32($fp) type with String +la $v0, String +lw $a0, -32($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -28($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_STRING_38 +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_STRING_38 +lw $t0, -28($fp) +beq $t0, 0, label_COMPARE_STRING_38 +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +# Comparing -32($fp) type with Bool +la $v0, Bool +lw $a0, -32($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -28($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 +lw $t0, -28($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_39 +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +# Comparing -32($fp) type with Int +la $v0, Int +lw $a0, -32($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -28($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 +lw $t0, -28($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_39 +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# Load pointers and SUB +lw $a0, -32($fp) +lw $a1, -36($fp) +sub $a0, $a0, $a1 +sw $a0, -28($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 +lw $t0, -28($fp) +beq $t0, 0, label_TRUE_36 +# GOTO label_FALSE_35 +j label_FALSE_35 +label_COMPARE_BY_VALUE_39: + # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) + # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) + # LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) + lw $a0, -32($fp) + lw $a1, -36($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -28($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 + lw $t0, -28($fp) + beq $t0, 0, label_TRUE_36 + # GOTO label_FALSE_35 + j label_FALSE_35 + label_COMPARE_STRING_38: + # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) + # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) + # LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) + # Load strings for comparison + lw $v0, -32($fp) + lw $v1, -36($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -28($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_CONTINUE_40 + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_CONTINUE_40 + lw $t0, -28($fp) + beq $t0, 0, label_CONTINUE_40 + # GOTO label_FALSE_35 + j label_FALSE_35 + label_CONTINUE_40: + # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) + # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) + # LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -32($fp) + lw $v1, -36($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_41: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_42 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_41 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_42: + # Store result + sw $a2, -28($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 + lw $t0, -28($fp) + beq $t0, 0, label_TRUE_36 + label_FALSE_35: + # LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # GOTO label_END_37 +j label_END_37 +label_TRUE_36: + # LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -24($fp) + label_END_37: +# LOCAL local_reflect_0_at_Complex_internal_10 --> -44($fp) +# local_reflect_0_at_Complex_internal_10 = SELF +sw $s1, -44($fp) +# RETURN local_reflect_0_at_Complex_internal_10 +lw $v0, -44($fp) +# Deallocate stack frame for function function_reflect_0_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 52 +jr $ra +# Function END + + +# function_reflect_X_at_Complex implementation. +# @Params: +function_reflect_X_at_Complex: + # Allocate stack frame for function function_reflect_X_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_reflect_X_at_Complex_internal_2 = GETATTRIBUTE y Complex + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + lw $t0, 16($s1) + sw $t0, -12($fp) + # local_reflect_X_at_Complex_internal_4 = GETATTRIBUTE y Complex + # LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + # LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) + lw $t0, -20($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -16($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -16($fp) + sw $t0, 12($v0) + sw $v0, -16($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_2 GOTO label_FALSE_43 + # IF_ZERO local_reflect_X_at_Complex_internal_2 GOTO label_FALSE_43 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_43 + # IF_ZERO local_reflect_X_at_Complex_internal_3 GOTO label_FALSE_43 + # IF_ZERO local_reflect_X_at_Complex_internal_3 GOTO label_FALSE_43 + lw $t0, -16($fp) + beq $t0, 0, label_FALSE_43 + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_STRING_46 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_STRING_46 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_STRING_46 + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_47 + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_47 + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, -16($fp) + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_44 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_COMPARE_BY_VALUE_47: + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + lw $a0, -12($fp) + lw $a1, -16($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_44 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_COMPARE_STRING_46: + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_CONTINUE_48 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_CONTINUE_48 + lw $t0, -8($fp) + beq $t0, 0, label_CONTINUE_48 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_CONTINUE_48: + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_49: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_50 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_49 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_50: + # Store result + sw $a2, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_44 + label_FALSE_43: + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # GOTO label_END_45 +j label_END_45 +label_TRUE_44: + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + label_END_45: +# LOCAL local_reflect_X_at_Complex_internal_5 --> -24($fp) +# local_reflect_X_at_Complex_internal_5 = SELF +sw $s1, -24($fp) +# RETURN local_reflect_X_at_Complex_internal_5 +lw $v0, -24($fp) +# Deallocate stack frame for function function_reflect_X_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +jr $ra +# Function END + + +# function_reflect_Y_at_Complex implementation. +# @Params: +function_reflect_Y_at_Complex: + # Allocate stack frame for function function_reflect_Y_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_reflect_Y_at_Complex_internal_2 = GETATTRIBUTE x Complex + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # local_reflect_Y_at_Complex_internal_4 = GETATTRIBUTE x Complex + # LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) + lw $t0, 12($s1) + sw $t0, -20($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + # LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) + lw $t0, -20($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -16($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -16($fp) + sw $t0, 12($v0) + sw $v0, -16($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_2 GOTO label_FALSE_51 + # IF_ZERO local_reflect_Y_at_Complex_internal_2 GOTO label_FALSE_51 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_51 + # IF_ZERO local_reflect_Y_at_Complex_internal_3 GOTO label_FALSE_51 + # IF_ZERO local_reflect_Y_at_Complex_internal_3 GOTO label_FALSE_51 + lw $t0, -16($fp) + beq $t0, 0, label_FALSE_51 + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_STRING_54 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_STRING_54 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_STRING_54 + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_55 + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_55 + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, -16($fp) + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_52 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_COMPARE_BY_VALUE_55: + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + lw $a0, -12($fp) + lw $a1, -16($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_52 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_COMPARE_STRING_54: + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_CONTINUE_56 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_CONTINUE_56 + lw $t0, -8($fp) + beq $t0, 0, label_CONTINUE_56 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_CONTINUE_56: + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_57: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_58 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_57 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_58: + # Store result + sw $a2, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_52 + label_FALSE_51: + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # GOTO label_END_53 +j label_END_53 +label_TRUE_52: + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + label_END_53: +# LOCAL local_reflect_Y_at_Complex_internal_5 --> -24($fp) +# local_reflect_Y_at_Complex_internal_5 = SELF +sw $s1, -24($fp) +# RETURN local_reflect_Y_at_Complex_internal_5 +lw $v0, -24($fp) +# Deallocate stack frame for function function_reflect_Y_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +jr $ra +# Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 104 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 104 + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_c_0 = 0 + li $t0, 0 + sw $t0, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE Complex + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Complex + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Complex_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Complex__attrib__x__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Complex__attrib__y__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -20($fp) + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -24($fp) + # ARG local_main_at_Main_internal_5 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_c_0 = local_main_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_internal_12 = local_main_at_Main_c_0 + lw $t0, -4($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 reflect_X + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 52($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_internal_13 + lw $t0, -56($fp) + sw $t0, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 reflect_Y + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_internal_14 = local_main_at_Main_c_0 + lw $t0, -4($fp) + sw $t0, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 reflect_0 + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 24($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # IF_ZERO local_main_at_Main_internal_11 GOTO label_FALSE_61 + # IF_ZERO local_main_at_Main_internal_11 GOTO label_FALSE_61 + lw $t0, -48($fp) + beq $t0, 0, label_FALSE_61 + # IF_ZERO local_main_at_Main_internal_15 GOTO label_FALSE_61 + # IF_ZERO local_main_at_Main_internal_15 GOTO label_FALSE_61 + lw $t0, -64($fp) + beq $t0, 0, label_FALSE_61 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Comparing -48($fp) type with String + la $v0, String + lw $a0, -48($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_STRING_64 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_STRING_64 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_64 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Comparing -48($fp) type with Bool + la $v0, Bool + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_65 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_65 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_65 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Comparing -48($fp) type with Int + la $v0, Int + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_65 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_65 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_65 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # Load pointers and SUB + lw $a0, -48($fp) + lw $a1, -64($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_62 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_62 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_62 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_COMPARE_BY_VALUE_65: + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + lw $a0, -48($fp) + lw $a1, -64($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_62 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_62 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_62 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_COMPARE_STRING_64: + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -64($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_CONTINUE_66 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_CONTINUE_66 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_66 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_CONTINUE_66: + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -64($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_67: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_68 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_67 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_68: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_62 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_62 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_62 + label_FALSE_61: + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_63 +j label_END_63 +label_TRUE_62: + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_63: +# LOCAL local_main_at_Main_internal_6 --> -28($fp) +# LOCAL local_main_at_Main_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_main_at_Main_internal_6 GOTO label_FALSEIF_59 +# IF_ZERO local_main_at_Main_internal_6 GOTO label_FALSEIF_59 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_59 +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# local_main_at_Main_internal_18 = SELF +sw $s1, -76($fp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# local_main_at_Main_internal_16 = local_main_at_Main_internal_18 +lw $t0, -76($fp) +sw $t0, -68($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_6 +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +sw $v0, -80($fp) +# ARG local_main_at_Main_internal_19 +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +lw $t0, -80($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +# local_main_at_Main_internal_17 = VCALL local_main_at_Main_internal_16 out_string +# Save new self pointer in $s1 +lw $s1, -68($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 0($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -72($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_7 --> -32($fp) +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +# local_main_at_Main_internal_7 = local_main_at_Main_internal_17 +lw $t0, -72($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_60 +j label_ENDIF_60 +label_FALSEIF_59: + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # local_main_at_Main_internal_22 = SELF + sw $s1, -92($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # local_main_at_Main_internal_20 = local_main_at_Main_internal_22 + lw $t0, -92($fp) + sw $t0, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_7 + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + sw $v0, -96($fp) + # ARG local_main_at_Main_internal_23 + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + lw $t0, -96($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_21 = VCALL local_main_at_Main_internal_20 out_string + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_21 + lw $t0, -88($fp) + sw $t0, -32($fp) + label_ENDIF_60: +# RETURN local_main_at_Main_internal_7 +lw $v0, -32($fp) +# Deallocate stack frame for function function_main_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 104 +jr $ra +# Function END + diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips new file mode 100644 index 00000000..20ef2aee --- /dev/null +++ b/tests/codegen/fib.mips @@ -0,0 +1,1568 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:06 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_copy_at_Object, function_in_string_at_IO, function_in_int_at_IO, dummy, function_out_string_at_IO, function_out_int_at_IO, dummy, dummy, dummy, dummy, function_type_name_at_Object +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_concat_at_String, function_substr_at_String, function_length_at_String, function_type_name_at_Object +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_copy_at_Object, function_in_string_at_IO, function_in_int_at_IO, function_fib_at_Main, function_out_string_at_IO, function_out_int_at_IO, function_main_at_Main, dummy, dummy, dummy, function_type_name_at_Object +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "Enter n to find nth fibonacci number!\n" +# + + +data_5: .asciiz "\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + lb $t3, 0($t1) + beqz $t3, end_loop + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + end_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 28($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 76 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 76 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 38 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = SELF + sw $s1, -40($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 + lw $t0, -40($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 + lw $t0, -52($fp) + sw $t0, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 in_int + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_11 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + lw $t0, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 fib + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_8 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + lw $t0, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 out_int + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 24($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -68($fp) + # ARG local_main_at_Main_internal_16 + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + lw $t0, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 out_string + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_14 + lw $v0, -60($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 76 + jr $ra + # Function END + + +# function_fib_at_Main implementation. +# @Params: +# 0($fp) = param_fib_at_Main_i_0 +function_fib_at_Main: + # Allocate stack frame for function function_fib_at_Main. + subu $sp, $sp, 64 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 64 + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_fib_at_Main_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # LOCAL local_fib_at_Main_internal_1 --> -8($fp) + # local_fib_at_Main_a_0 = local_fib_at_Main_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_fib_at_Main_b_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -16($fp) + # LOCAL local_fib_at_Main_b_2 --> -12($fp) + # LOCAL local_fib_at_Main_internal_3 --> -16($fp) + # local_fib_at_Main_b_2 = local_fib_at_Main_internal_3 + lw $t0, -16($fp) + sw $t0, -12($fp) + # LOCAL local_fib_at_Main_c_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # LOCAL local_fib_at_Main_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # LOCAL local_fib_at_Main_c_4 --> -20($fp) + # LOCAL local_fib_at_Main_internal_5 --> -24($fp) + # local_fib_at_Main_c_4 = local_fib_at_Main_internal_5 + lw $t0, -24($fp) + sw $t0, -20($fp) + label_WHILE_1: + # LOCAL local_fib_at_Main_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -40($fp) + # IF_ZERO param_fib_at_Main_i_0 GOTO label_FALSE_3 + # IF_ZERO param_fib_at_Main_i_0 GOTO label_FALSE_3 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_3 + # IF_ZERO local_fib_at_Main_internal_9 GOTO label_FALSE_3 + # IF_ZERO local_fib_at_Main_internal_9 GOTO label_FALSE_3 + lw $t0, -40($fp) + beq $t0, 0, label_FALSE_3 + # LOCAL local_fib_at_Main_internal_8 --> -36($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -36($fp) + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_COMPARE_STRING_6 + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_COMPARE_STRING_6 + lw $t0, -36($fp) + beq $t0, 0, label_COMPARE_STRING_6 + # LOCAL local_fib_at_Main_internal_8 --> -36($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -36($fp) + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_COMPARE_BY_VALUE_7 + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_COMPARE_BY_VALUE_7 + lw $t0, -36($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_7 + # LOCAL local_fib_at_Main_internal_8 --> -36($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -36($fp) + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_COMPARE_BY_VALUE_7 + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_COMPARE_BY_VALUE_7 + lw $t0, -36($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_7 + # LOCAL local_fib_at_Main_internal_8 --> -36($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # LOCAL local_fib_at_Main_internal_9 --> -40($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -40($fp) + sub $a0, $a0, $a1 + sw $a0, -36($fp) + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_TRUE_4 + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_TRUE_4 + lw $t0, -36($fp) + beq $t0, 0, label_TRUE_4 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_COMPARE_BY_VALUE_7: + # LOCAL local_fib_at_Main_internal_8 --> -36($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # LOCAL local_fib_at_Main_internal_9 --> -40($fp) + lw $a0, 0($fp) + lw $a1, -40($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -36($fp) + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_TRUE_4 + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_TRUE_4 + lw $t0, -36($fp) + beq $t0, 0, label_TRUE_4 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_COMPARE_STRING_6: + # LOCAL local_fib_at_Main_internal_8 --> -36($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # LOCAL local_fib_at_Main_internal_9 --> -40($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -40($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -36($fp) + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_CONTINUE_8 + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_CONTINUE_8 + lw $t0, -36($fp) + beq $t0, 0, label_CONTINUE_8 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_CONTINUE_8: + # LOCAL local_fib_at_Main_internal_8 --> -36($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # LOCAL local_fib_at_Main_internal_9 --> -40($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -40($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_9: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_10 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_9 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_10: + # Store result + sw $a2, -36($fp) + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_TRUE_4 + # IF_ZERO local_fib_at_Main_internal_8 GOTO label_TRUE_4 + lw $t0, -36($fp) + beq $t0, 0, label_TRUE_4 + label_FALSE_3: + # LOCAL local_fib_at_Main_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -32($fp) + # GOTO label_END_5 +j label_END_5 +label_TRUE_4: + # LOCAL local_fib_at_Main_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -32($fp) + label_END_5: +# LOCAL local_fib_at_Main_internal_7 --> -32($fp) +# LOCAL local_fib_at_Main_internal_7 --> -32($fp) +# Obtain value from -32($fp) +lw $v0, -32($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_fib_at_Main_internal_7 GOTO label_FALSE_11 +# IF_ZERO local_fib_at_Main_internal_7 GOTO label_FALSE_11 +lw $t0, -32($fp) +beq $t0, 0, label_FALSE_11 +# LOCAL local_fib_at_Main_internal_10 --> -44($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -44($fp) +# GOTO label_NOT_END_12 +j label_NOT_END_12 +label_FALSE_11: + # LOCAL local_fib_at_Main_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + label_NOT_END_12: + # LOCAL local_fib_at_Main_internal_6 --> -28($fp) + # LOCAL local_fib_at_Main_internal_10 --> -44($fp) + # Obtain value from -44($fp) + lw $v0, -44($fp) + lw $v0, 12($v0) + sw $v0, -28($fp) + # IF_ZERO local_fib_at_Main_internal_6 GOTO label_WHILE_END_2 + # IF_ZERO local_fib_at_Main_internal_6 GOTO label_WHILE_END_2 + lw $t0, -28($fp) + beq $t0, 0, label_WHILE_END_2 + # LOCAL local_fib_at_Main_internal_11 --> -48($fp) + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # LOCAL local_fib_at_Main_b_2 --> -12($fp) + # local_fib_at_Main_internal_11 = local_fib_at_Main_a_0 + local_fib_at_Main_b_2 + lw $t1, -4($fp) + lw $t0, 12($t1) + lw $t1, -12($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -48($fp) + # LOCAL local_fib_at_Main_c_4 --> -20($fp) + # LOCAL local_fib_at_Main_internal_11 --> -48($fp) + # local_fib_at_Main_c_4 = local_fib_at_Main_internal_11 + lw $t0, -48($fp) + sw $t0, -20($fp) + # LOCAL local_fib_at_Main_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -56($fp) + # LOCAL local_fib_at_Main_internal_12 --> -52($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # LOCAL local_fib_at_Main_internal_13 --> -56($fp) + # local_fib_at_Main_internal_12 = PARAM param_fib_at_Main_i_0 - local_fib_at_Main_internal_13 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -56($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -52($fp) + # PARAM param_fib_at_Main_i_0 --> 0($fp) + # LOCAL local_fib_at_Main_internal_12 --> -52($fp) + # PARAM param_fib_at_Main_i_0 = local_fib_at_Main_internal_12 + lw $t0, -52($fp) + sw $t0, 0($fp) + # LOCAL local_fib_at_Main_b_2 --> -12($fp) + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # local_fib_at_Main_b_2 = local_fib_at_Main_a_0 + lw $t0, -4($fp) + sw $t0, -12($fp) + # LOCAL local_fib_at_Main_a_0 --> -4($fp) + # LOCAL local_fib_at_Main_c_4 --> -20($fp) + # local_fib_at_Main_a_0 = local_fib_at_Main_c_4 + lw $t0, -20($fp) + sw $t0, -4($fp) + # GOTO label_WHILE_1 + j label_WHILE_1 + label_WHILE_END_2: + # RETURN local_fib_at_Main_c_4 + lw $v0, -20($fp) + # Deallocate stack frame for function function_fib_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 64 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + diff --git a/tests/codegen/graph.mips b/tests/codegen/graph.mips new file mode 100644 index 00000000..1dfec536 --- /dev/null +++ b/tests/codegen/graph.mips @@ -0,0 +1,11753 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:07 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +BoolOp: .asciiz "BoolOp" +# Function END +Graph: .asciiz "Graph" +# Function END +Parse: .asciiz "Parse" +# Function END +Main: .asciiz "Main" +# Function END +VList: .asciiz "VList" +# Function END +VCons: .asciiz "VCons" +# Function END +EList: .asciiz "EList" +# Function END +ECons: .asciiz "ECons" +# Function END +Edge: .asciiz "Edge" +# Function END +Vertice: .asciiz "Vertice" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_out_int_at_IO, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word dummy, dummy, function_length_at_String, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, function_concat_at_String, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type BoolOp **** +BoolOp_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy, function_and_at_BoolOp, dummy, function_or_at_BoolOp, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type BoolOp **** +BoolOp_start: + BoolOp_vtable_pointer: .word BoolOp_vtable + # Function END +BoolOp_end: +# + + +# **** VTABLE for type Graph **** +Graph_vtable: .word dummy, dummy, dummy, dummy, dummy, function_add_vertice_at_Graph, function_print_V_at_Graph, function_copy_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_print_E_at_Graph, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Graph **** +Graph_start: + Graph_vtable_pointer: .word Graph_vtable + # Function END +Graph_end: +# + + +# **** VTABLE for type Parse **** +Parse_vtable: .word dummy, dummy, dummy, function_a2i_at_Parse, function_a2i_aux_at_Parse, dummy, dummy, function_copy_at_Object, function_c2i_at_Parse, dummy, function_abort_at_Object, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, dummy, function_parse_line_at_Parse, dummy, function_in_string_at_IO, dummy, function_out_int_at_IO, dummy, function_read_input_at_Parse, dummy +# Function END +# + + +# **** Type RECORD for type Parse **** +Parse_start: + Parse_vtable_pointer: .word Parse_vtable + # Function END +Parse_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word dummy, dummy, dummy, function_a2i_at_Parse, function_a2i_aux_at_Parse, dummy, dummy, function_copy_at_Object, function_c2i_at_Parse, dummy, function_abort_at_Object, dummy, dummy, dummy, function_in_int_at_IO, dummy, function_main_at_Main, dummy, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, dummy, function_parse_line_at_Parse, dummy, function_in_string_at_IO, dummy, function_out_int_at_IO, dummy, function_read_input_at_Parse, dummy +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +# **** VTABLE for type VList **** +VList_vtable: .word dummy, function_head_at_VList, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, function_isNil_at_VList, dummy, dummy, function_in_int_at_IO, dummy, dummy, function_tail_at_VList, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, function_print_at_VList, dummy, dummy, function_in_string_at_IO, function_cons_at_VList, function_out_int_at_IO, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type VList **** +VList_start: + VList_vtable_pointer: .word VList_vtable + # Function END +VList_end: +# + + +# **** VTABLE for type VCons **** +VCons_vtable: .word dummy, function_head_at_VCons, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, function_isNil_at_VCons, dummy, dummy, function_in_int_at_IO, dummy, dummy, function_tail_at_VCons, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, function_print_at_VCons, dummy, dummy, function_in_string_at_IO, function_cons_at_VList, function_out_int_at_IO, function_init_at_VCons, dummy, dummy +# Function END +# + + +# **** Type RECORD for type VCons **** +VCons_start: + VCons_vtable_pointer: .word VCons_vtable + # Function END +VCons_end: +# + + +# **** VTABLE for type EList **** +EList_vtable: .word dummy, function_head_at_EList, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, function_isNil_at_EList, dummy, dummy, function_in_int_at_IO, dummy, dummy, function_tail_at_EList, function_append_at_EList, function_type_name_at_Object, dummy, function_out_string_at_IO, function_print_at_EList, dummy, dummy, function_in_string_at_IO, function_cons_at_EList, function_out_int_at_IO, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type EList **** +EList_start: + EList_vtable_pointer: .word EList_vtable + # Function END +EList_end: +# + + +# **** VTABLE for type ECons **** +ECons_vtable: .word dummy, function_head_at_ECons, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, function_isNil_at_ECons, dummy, dummy, function_in_int_at_IO, dummy, dummy, function_tail_at_ECons, function_append_at_EList, function_type_name_at_Object, dummy, function_out_string_at_IO, function_print_at_ECons, dummy, dummy, function_in_string_at_IO, function_cons_at_EList, function_out_int_at_IO, function_init_at_ECons, dummy, dummy +# Function END +# + + +# **** Type RECORD for type ECons **** +ECons_start: + ECons_vtable_pointer: .word ECons_vtable + # Function END +ECons_end: +# + + +# **** VTABLE for type Edge **** +Edge_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, function_print_at_Edge, dummy, dummy, function_in_string_at_IO, dummy, function_out_int_at_IO, function_init_at_Edge, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Edge **** +Edge_start: + Edge_vtable_pointer: .word Edge_vtable + # Function END +Edge_end: +# + + +# **** VTABLE for type Vertice **** +Vertice_vtable: .word function_add_out_at_Vertice, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_number_at_Vertice, function_abort_at_Object, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, function_print_at_Vertice, dummy, dummy, function_in_string_at_IO, dummy, function_out_int_at_IO, function_init_at_Vertice, dummy, function_outgoing_at_Vertice +# Function END +# + + +# **** Type RECORD for type Vertice **** +Vertice_start: + Vertice_vtable_pointer: .word Vertice_vtable + # Function END +Vertice_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, -1, -1, 1, 2, 1, 2, 1, 2, 1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 1, 1, 2, 3, 2, 3, 2, 3, 2, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 +BoolOp__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1 +Graph__TDT: .word -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1 +Parse__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, -1, -1, -1, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 +VList__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, -1, -1 +VCons__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1 +EList__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1 +ECons__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 +Edge__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1 +Vertice__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "\n" +# + + +data_5: .asciiz "" +# + + +data_6: .asciiz "0" +# + + +data_7: .asciiz "1" +# + + +data_8: .asciiz "2" +# + + +data_9: .asciiz "3" +# + + +data_10: .asciiz "4" +# + + +data_11: .asciiz "5" +# + + +data_12: .asciiz "6" +# + + +data_13: .asciiz "7" +# + + +data_14: .asciiz "8" +# + + +data_15: .asciiz "9" +# + + +data_16: .asciiz "-" +# + + +data_17: .asciiz " " +# + + +data_18: .asciiz " " +# + + +data_19: .asciiz "," +# + + +data_20: .asciiz "" +# + + +data_21: .asciiz "" +# + + +data_22: .asciiz "\n" +# + + +data_23: .asciiz "\n" +# + + +data_24: .asciiz " (" +# + + +data_25: .asciiz "," +# + + +data_26: .asciiz ")" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + lb $t3, 0($t1) + beqz $t3, end_loop + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + end_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 24 bytes of memory + li $a0, 24 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Parse__attrib__boolop__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Parse__attrib__rest__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__g__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 64($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_and_at_BoolOp implementation. +# @Params: +# 0($fp) = param_and_at_BoolOp_b1_0 +# 4($fp) = param_and_at_BoolOp_b2_1 +function_and_at_BoolOp: + # Allocate stack frame for function function_and_at_BoolOp. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_and_at_BoolOp_internal_0 --> -4($fp) + # PARAM param_and_at_BoolOp_b1_0 --> 4($fp) + # Obtain value from 4($fp) + lw $v0, 4($fp) + lw $v0, 12($v0) + sw $v0, -4($fp) + # IF_ZERO local_and_at_BoolOp_internal_0 GOTO label_FALSEIF_1 + # IF_ZERO local_and_at_BoolOp_internal_0 GOTO label_FALSEIF_1 + lw $t0, -4($fp) + beq $t0, 0, label_FALSEIF_1 + # LOCAL local_and_at_BoolOp_internal_1 --> -8($fp) + # PARAM param_and_at_BoolOp_b2_1 --> 0($fp) + # local_and_at_BoolOp_internal_1 = PARAM param_and_at_BoolOp_b2_1 + lw $t0, 0($fp) + sw $t0, -8($fp) + # GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_and_at_BoolOp_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_and_at_BoolOp_internal_1 --> -8($fp) + # LOCAL local_and_at_BoolOp_internal_2 --> -12($fp) + # local_and_at_BoolOp_internal_1 = local_and_at_BoolOp_internal_2 + lw $t0, -12($fp) + sw $t0, -8($fp) + label_ENDIF_2: +# RETURN local_and_at_BoolOp_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_and_at_BoolOp. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +# Deallocate function args +addu $sp, $sp, 8 +jr $ra +# Function END + + +# function_or_at_BoolOp implementation. +# @Params: +# 0($fp) = param_or_at_BoolOp_b1_0 +# 4($fp) = param_or_at_BoolOp_b2_1 +function_or_at_BoolOp: + # Allocate stack frame for function function_or_at_BoolOp. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_or_at_BoolOp_internal_0 --> -4($fp) + # PARAM param_or_at_BoolOp_b1_0 --> 4($fp) + # Obtain value from 4($fp) + lw $v0, 4($fp) + lw $v0, 12($v0) + sw $v0, -4($fp) + # IF_ZERO local_or_at_BoolOp_internal_0 GOTO label_FALSEIF_3 + # IF_ZERO local_or_at_BoolOp_internal_0 GOTO label_FALSEIF_3 + lw $t0, -4($fp) + beq $t0, 0, label_FALSEIF_3 + # LOCAL local_or_at_BoolOp_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_or_at_BoolOp_internal_1 --> -8($fp) + # LOCAL local_or_at_BoolOp_internal_2 --> -12($fp) + # local_or_at_BoolOp_internal_1 = local_or_at_BoolOp_internal_2 + lw $t0, -12($fp) + sw $t0, -8($fp) + # GOTO label_ENDIF_4 +j label_ENDIF_4 +label_FALSEIF_3: + # LOCAL local_or_at_BoolOp_internal_1 --> -8($fp) + # PARAM param_or_at_BoolOp_b2_1 --> 0($fp) + # local_or_at_BoolOp_internal_1 = PARAM param_or_at_BoolOp_b2_1 + lw $t0, 0($fp) + sw $t0, -8($fp) + label_ENDIF_4: +# RETURN local_or_at_BoolOp_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_or_at_BoolOp. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +# Deallocate function args +addu $sp, $sp, 8 +jr $ra +# Function END + + +# __Graph__attrib__vertices__init implementation. +# @Params: +__Graph__attrib__vertices__init: + # Allocate stack frame for function __Graph__attrib__vertices__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_attrib__vertices__init_internal_1 --> -8($fp) + # local_attrib__vertices__init_internal_1 = ALLOCATE VList + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, VList + sw $t0, 12($v0) + li $t0, 5 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, VList_start + sw $t0, 4($v0) + # Load type offset + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __VList__attrib__car__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # RETURN local_attrib__vertices__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Graph__attrib__vertices__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Graph__attrib__edges__init implementation. +# @Params: +__Graph__attrib__edges__init: + # Allocate stack frame for function __Graph__attrib__edges__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_attrib__edges__init_internal_1 --> -8($fp) + # local_attrib__edges__init_internal_1 = ALLOCATE EList + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, EList + sw $t0, 12($v0) + li $t0, 5 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, EList_start + sw $t0, 4($v0) + # Load type offset + li $t0, 44 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __EList__attrib__car__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # RETURN local_attrib__edges__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Graph__attrib__edges__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_add_vertice_at_Graph implementation. +# @Params: +# 0($fp) = param_add_vertice_at_Graph_v_0 +function_add_vertice_at_Graph: + # Allocate stack frame for function function_add_vertice_at_Graph. + subu $sp, $sp, 40 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 40 + # LOCAL local_add_vertice_at_Graph_internal_2 --> -12($fp) + # PARAM param_add_vertice_at_Graph_v_0 --> 0($fp) + # local_add_vertice_at_Graph_internal_2 = PARAM param_add_vertice_at_Graph_v_0 + lw $t0, 0($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_add_vertice_at_Graph_internal_2 --> -12($fp) + # LOCAL local_add_vertice_at_Graph_internal_3 --> -16($fp) + # local_add_vertice_at_Graph_internal_3 = VCALL local_add_vertice_at_Graph_internal_2 outgoing + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 120($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_add_vertice_at_Graph_internal_0 --> -4($fp) + # LOCAL local_add_vertice_at_Graph_internal_3 --> -16($fp) + # local_add_vertice_at_Graph_internal_0 = local_add_vertice_at_Graph_internal_3 + lw $t0, -16($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_add_vertice_at_Graph_internal_4 = GETATTRIBUTE edges Graph + # LOCAL local_add_vertice_at_Graph_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # ARG local_add_vertice_at_Graph_internal_4 + # LOCAL local_add_vertice_at_Graph_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_add_vertice_at_Graph_internal_0 --> -4($fp) + # LOCAL local_add_vertice_at_Graph_internal_1 --> -8($fp) + # local_add_vertice_at_Graph_internal_1 = VCALL local_add_vertice_at_Graph_internal_0 append + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 72($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_add_vertice_at_Graph_internal_1 --> -8($fp) + lw $t0, -8($fp) + sw $t0, 16($s1) + # local_add_vertice_at_Graph_internal_7 = GETATTRIBUTE vertices Graph + # LOCAL local_add_vertice_at_Graph_internal_7 --> -32($fp) + lw $t0, 12($s1) + sw $t0, -32($fp) + # LOCAL local_add_vertice_at_Graph_internal_5 --> -24($fp) + # LOCAL local_add_vertice_at_Graph_internal_7 --> -32($fp) + # local_add_vertice_at_Graph_internal_5 = local_add_vertice_at_Graph_internal_7 + lw $t0, -32($fp) + sw $t0, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_add_vertice_at_Graph_v_0 + # PARAM param_add_vertice_at_Graph_v_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_add_vertice_at_Graph_internal_5 --> -24($fp) + # LOCAL local_add_vertice_at_Graph_internal_6 --> -28($fp) + # local_add_vertice_at_Graph_internal_6 = VCALL local_add_vertice_at_Graph_internal_5 cons + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_add_vertice_at_Graph_internal_6 --> -28($fp) + lw $t0, -28($fp) + sw $t0, 12($s1) + # RETURN + # Deallocate stack frame for function function_add_vertice_at_Graph. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 40 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_E_at_Graph implementation. +# @Params: +function_print_E_at_Graph: + # Allocate stack frame for function function_print_E_at_Graph. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_print_E_at_Graph_internal_2 = GETATTRIBUTE edges Graph + # LOCAL local_print_E_at_Graph_internal_2 --> -12($fp) + lw $t0, 16($s1) + sw $t0, -12($fp) + # LOCAL local_print_E_at_Graph_internal_0 --> -4($fp) + # LOCAL local_print_E_at_Graph_internal_2 --> -12($fp) + # local_print_E_at_Graph_internal_0 = local_print_E_at_Graph_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_E_at_Graph_internal_0 --> -4($fp) + # LOCAL local_print_E_at_Graph_internal_1 --> -8($fp) + # local_print_E_at_Graph_internal_1 = VCALL local_print_E_at_Graph_internal_0 print + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 88($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_E_at_Graph_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_print_E_at_Graph. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_V_at_Graph implementation. +# @Params: +function_print_V_at_Graph: + # Allocate stack frame for function function_print_V_at_Graph. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_print_V_at_Graph_internal_2 = GETATTRIBUTE vertices Graph + # LOCAL local_print_V_at_Graph_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # LOCAL local_print_V_at_Graph_internal_0 --> -4($fp) + # LOCAL local_print_V_at_Graph_internal_2 --> -12($fp) + # local_print_V_at_Graph_internal_0 = local_print_V_at_Graph_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_V_at_Graph_internal_0 --> -4($fp) + # LOCAL local_print_V_at_Graph_internal_1 --> -8($fp) + # local_print_V_at_Graph_internal_1 = VCALL local_print_V_at_Graph_internal_0 print + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 88($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_V_at_Graph_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_print_V_at_Graph. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Parse__attrib__boolop__init implementation. +# @Params: +__Parse__attrib__boolop__init: + # Allocate stack frame for function __Parse__attrib__boolop__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_attrib__boolop__init_internal_1 --> -8($fp) + # local_attrib__boolop__init_internal_1 = ALLOCATE BoolOp + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, BoolOp + sw $t0, 12($v0) + li $t0, 6 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, BoolOp_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # RETURN local_attrib__boolop__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Parse__attrib__boolop__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Parse__attrib__rest__init implementation. +# @Params: +__Parse__attrib__rest__init: + # Allocate stack frame for function __Parse__attrib__rest__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_attrib__rest__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -4($fp) + # RETURN local_attrib__rest__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Parse__attrib__rest__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_read_input_at_Parse implementation. +# @Params: +function_read_input_at_Parse: + # Allocate stack frame for function function_read_input_at_Parse. + subu $sp, $sp, 112 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 112 + # LOCAL local_read_input_at_Parse_g_0 --> -4($fp) + # local_read_input_at_Parse_g_0 = 0 + li $t0, 0 + sw $t0, -4($fp) + # LOCAL local_read_input_at_Parse_internal_1 --> -8($fp) + # local_read_input_at_Parse_internal_1 = ALLOCATE Graph + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Graph + sw $t0, 12($v0) + li $t0, 5 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Graph_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Graph__attrib__vertices__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Graph__attrib__edges__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # LOCAL local_read_input_at_Parse_g_0 --> -4($fp) + # LOCAL local_read_input_at_Parse_internal_1 --> -8($fp) + # local_read_input_at_Parse_g_0 = local_read_input_at_Parse_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -12($fp) + # LOCAL local_read_input_at_Parse_internal_5 --> -24($fp) + # local_read_input_at_Parse_internal_5 = SELF + sw $s1, -24($fp) + # LOCAL local_read_input_at_Parse_internal_3 --> -16($fp) + # LOCAL local_read_input_at_Parse_internal_5 --> -24($fp) + # local_read_input_at_Parse_internal_3 = local_read_input_at_Parse_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_read_input_at_Parse_internal_3 --> -16($fp) + # LOCAL local_read_input_at_Parse_internal_4 --> -20($fp) + # local_read_input_at_Parse_internal_4 = VCALL local_read_input_at_Parse_internal_3 in_string + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 100($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_4 --> -20($fp) + # local_read_input_at_Parse_line_2 = local_read_input_at_Parse_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + label_WHILE_5: + # local_read_input_at_Parse_internal_9 = GETATTRIBUTE boolop Parse + # LOCAL local_read_input_at_Parse_internal_9 --> -40($fp) + lw $t0, 12($s1) + sw $t0, -40($fp) + # LOCAL local_read_input_at_Parse_internal_7 --> -32($fp) + # LOCAL local_read_input_at_Parse_internal_9 --> -40($fp) + # local_read_input_at_Parse_internal_7 = local_read_input_at_Parse_internal_9 + lw $t0, -40($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -52($fp) + # IF_ZERO local_read_input_at_Parse_line_2 GOTO label_FALSE_7 + # IF_ZERO local_read_input_at_Parse_line_2 GOTO label_FALSE_7 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_7 + # IF_ZERO local_read_input_at_Parse_internal_12 GOTO label_FALSE_7 + # IF_ZERO local_read_input_at_Parse_internal_12 GOTO label_FALSE_7 + lw $t0, -52($fp) + beq $t0, 0, label_FALSE_7 + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_STRING_10 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_STRING_10 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_STRING_10 + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_11 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_11 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_11 + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_11 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_11 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_11 + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, -52($fp) + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_8 + # GOTO label_FALSE_7 + j label_FALSE_7 + label_COMPARE_BY_VALUE_11: + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) + lw $a0, -12($fp) + lw $a1, -52($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_8 + # GOTO label_FALSE_7 + j label_FALSE_7 + label_COMPARE_STRING_10: + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -52($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_CONTINUE_12 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_CONTINUE_12 + lw $t0, -48($fp) + beq $t0, 0, label_CONTINUE_12 + # GOTO label_FALSE_7 + j label_FALSE_7 + label_CONTINUE_12: + # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -52($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_13: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_14 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_13 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_14: + # Store result + sw $a2, -48($fp) + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 + # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_8 + label_FALSE_7: + # LOCAL local_read_input_at_Parse_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -44($fp) + # GOTO label_END_9 +j label_END_9 +label_TRUE_8: + # LOCAL local_read_input_at_Parse_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + label_END_9: +# LOCAL local_read_input_at_Parse_internal_10 --> -44($fp) +# LOCAL local_read_input_at_Parse_internal_10 --> -44($fp) +# Obtain value from -44($fp) +lw $v0, -44($fp) +lw $v0, 12($v0) +sw $v0, -44($fp) +# IF_ZERO local_read_input_at_Parse_internal_10 GOTO label_FALSE_15 +# IF_ZERO local_read_input_at_Parse_internal_10 GOTO label_FALSE_15 +lw $t0, -44($fp) +beq $t0, 0, label_FALSE_15 +# LOCAL local_read_input_at_Parse_internal_13 --> -56($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -56($fp) +# GOTO label_NOT_END_16 +j label_NOT_END_16 +label_FALSE_15: + # LOCAL local_read_input_at_Parse_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -56($fp) + label_NOT_END_16: + # ARG local_read_input_at_Parse_internal_13 + # LOCAL local_read_input_at_Parse_internal_13 --> -56($fp) + lw $t0, -56($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -68($fp) + # IF_ZERO local_read_input_at_Parse_line_2 GOTO label_FALSE_17 + # IF_ZERO local_read_input_at_Parse_line_2 GOTO label_FALSE_17 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_17 + # IF_ZERO local_read_input_at_Parse_internal_16 GOTO label_FALSE_17 + # IF_ZERO local_read_input_at_Parse_internal_16 GOTO label_FALSE_17 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_17 + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_STRING_20 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_STRING_20 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_STRING_20 + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_21 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_21 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_21 + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_21 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_21 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_21 + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_18 + # GOTO label_FALSE_17 + j label_FALSE_17 + label_COMPARE_BY_VALUE_21: + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) + lw $a0, -12($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_18 + # GOTO label_FALSE_17 + j label_FALSE_17 + label_COMPARE_STRING_20: + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_CONTINUE_22 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_CONTINUE_22 + lw $t0, -64($fp) + beq $t0, 0, label_CONTINUE_22 + # GOTO label_FALSE_17 + j label_FALSE_17 + label_CONTINUE_22: + # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_23: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_24 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_23 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_24: + # Store result + sw $a2, -64($fp) + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 + # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_18 + label_FALSE_17: + # LOCAL local_read_input_at_Parse_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # GOTO label_END_19 +j label_END_19 +label_TRUE_18: + # LOCAL local_read_input_at_Parse_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + label_END_19: +# LOCAL local_read_input_at_Parse_internal_14 --> -60($fp) +# LOCAL local_read_input_at_Parse_internal_14 --> -60($fp) +# Obtain value from -60($fp) +lw $v0, -60($fp) +lw $v0, 12($v0) +sw $v0, -60($fp) +# IF_ZERO local_read_input_at_Parse_internal_14 GOTO label_FALSE_25 +# IF_ZERO local_read_input_at_Parse_internal_14 GOTO label_FALSE_25 +lw $t0, -60($fp) +beq $t0, 0, label_FALSE_25 +# LOCAL local_read_input_at_Parse_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -72($fp) +# GOTO label_NOT_END_26 +j label_NOT_END_26 +label_FALSE_25: + # LOCAL local_read_input_at_Parse_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -72($fp) + label_NOT_END_26: + # ARG local_read_input_at_Parse_internal_17 + # LOCAL local_read_input_at_Parse_internal_17 --> -72($fp) + lw $t0, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_read_input_at_Parse_internal_7 --> -32($fp) + # LOCAL local_read_input_at_Parse_internal_8 --> -36($fp) + # local_read_input_at_Parse_internal_8 = VCALL local_read_input_at_Parse_internal_7 and + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 52($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_read_input_at_Parse_internal_6 --> -28($fp) + # LOCAL local_read_input_at_Parse_internal_8 --> -36($fp) + # Obtain value from -36($fp) + lw $v0, -36($fp) + lw $v0, 12($v0) + sw $v0, -28($fp) + # IF_ZERO local_read_input_at_Parse_internal_6 GOTO label_WHILE_END_6 + # IF_ZERO local_read_input_at_Parse_internal_6 GOTO label_WHILE_END_6 + lw $t0, -28($fp) + beq $t0, 0, label_WHILE_END_6 + # LOCAL local_read_input_at_Parse_internal_18 --> -76($fp) + # LOCAL local_read_input_at_Parse_g_0 --> -4($fp) + # local_read_input_at_Parse_internal_18 = local_read_input_at_Parse_g_0 + lw $t0, -4($fp) + sw $t0, -76($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_read_input_at_Parse_internal_22 --> -92($fp) + # local_read_input_at_Parse_internal_22 = SELF + sw $s1, -92($fp) + # LOCAL local_read_input_at_Parse_internal_20 --> -84($fp) + # LOCAL local_read_input_at_Parse_internal_22 --> -92($fp) + # local_read_input_at_Parse_internal_20 = local_read_input_at_Parse_internal_22 + lw $t0, -92($fp) + sw $t0, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_read_input_at_Parse_line_2 + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + lw $t0, -12($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_read_input_at_Parse_internal_20 --> -84($fp) + # LOCAL local_read_input_at_Parse_internal_21 --> -88($fp) + # local_read_input_at_Parse_internal_21 = VCALL local_read_input_at_Parse_internal_20 parse_line + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 92($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_read_input_at_Parse_internal_21 + # LOCAL local_read_input_at_Parse_internal_21 --> -88($fp) + lw $t0, -88($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_read_input_at_Parse_internal_18 --> -76($fp) + # LOCAL local_read_input_at_Parse_internal_19 --> -80($fp) + # local_read_input_at_Parse_internal_19 = VCALL local_read_input_at_Parse_internal_18 add_vertice + # Save new self pointer in $s1 + lw $s1, -76($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -80($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_read_input_at_Parse_internal_25 --> -104($fp) + # local_read_input_at_Parse_internal_25 = SELF + sw $s1, -104($fp) + # LOCAL local_read_input_at_Parse_internal_23 --> -96($fp) + # LOCAL local_read_input_at_Parse_internal_25 --> -104($fp) + # local_read_input_at_Parse_internal_23 = local_read_input_at_Parse_internal_25 + lw $t0, -104($fp) + sw $t0, -96($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_read_input_at_Parse_internal_23 --> -96($fp) + # LOCAL local_read_input_at_Parse_internal_24 --> -100($fp) + # local_read_input_at_Parse_internal_24 = VCALL local_read_input_at_Parse_internal_23 in_string + # Save new self pointer in $s1 + lw $s1, -96($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 100($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -100($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) + # LOCAL local_read_input_at_Parse_internal_24 --> -100($fp) + # local_read_input_at_Parse_line_2 = local_read_input_at_Parse_internal_24 + lw $t0, -100($fp) + sw $t0, -12($fp) + # GOTO label_WHILE_5 + j label_WHILE_5 + label_WHILE_END_6: + # RETURN local_read_input_at_Parse_g_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_read_input_at_Parse. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 112 + jr $ra + # Function END + + +# function_parse_line_at_Parse implementation. +# @Params: +# 0($fp) = param_parse_line_at_Parse_s_0 +function_parse_line_at_Parse: + # Allocate stack frame for function function_parse_line_at_Parse. + subu $sp, $sp, 136 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 136 + # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) + # local_parse_line_at_Parse_v_0 = 0 + li $t0, 0 + sw $t0, -4($fp) + # LOCAL local_parse_line_at_Parse_internal_3 --> -16($fp) + # local_parse_line_at_Parse_internal_3 = ALLOCATE Vertice + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Vertice + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Vertice_start + sw $t0, 4($v0) + # Load type offset + li $t0, 56 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Vertice__attrib__num__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Vertice__attrib__out__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -16($fp) + # LOCAL local_parse_line_at_Parse_internal_1 --> -8($fp) + # LOCAL local_parse_line_at_Parse_internal_3 --> -16($fp) + # local_parse_line_at_Parse_internal_1 = local_parse_line_at_Parse_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_6 --> -28($fp) + # local_parse_line_at_Parse_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_parse_line_at_Parse_internal_4 --> -20($fp) + # LOCAL local_parse_line_at_Parse_internal_6 --> -28($fp) + # local_parse_line_at_Parse_internal_4 = local_parse_line_at_Parse_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_parse_line_at_Parse_s_0 + # PARAM param_parse_line_at_Parse_s_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_4 --> -20($fp) + # LOCAL local_parse_line_at_Parse_internal_5 --> -24($fp) + # local_parse_line_at_Parse_internal_5 = VCALL local_parse_line_at_Parse_internal_4 a2i + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_parse_line_at_Parse_internal_5 + # LOCAL local_parse_line_at_Parse_internal_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_1 --> -8($fp) + # LOCAL local_parse_line_at_Parse_internal_2 --> -12($fp) + # local_parse_line_at_Parse_internal_2 = VCALL local_parse_line_at_Parse_internal_1 init + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 112($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) + # LOCAL local_parse_line_at_Parse_internal_2 --> -12($fp) + # local_parse_line_at_Parse_v_0 = local_parse_line_at_Parse_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + label_WHILE_27: + # local_parse_line_at_Parse_internal_12 = GETATTRIBUTE rest Parse + # LOCAL local_parse_line_at_Parse_internal_12 --> -52($fp) + lw $t0, 16($s1) + sw $t0, -52($fp) + # LOCAL local_parse_line_at_Parse_internal_10 --> -44($fp) + # LOCAL local_parse_line_at_Parse_internal_12 --> -52($fp) + # local_parse_line_at_Parse_internal_10 = local_parse_line_at_Parse_internal_12 + lw $t0, -52($fp) + sw $t0, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_10 --> -44($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # local_parse_line_at_Parse_internal_11 = VCALL local_parse_line_at_Parse_internal_10 length + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 8($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -56($fp) + # IF_ZERO local_parse_line_at_Parse_internal_11 GOTO label_FALSE_29 + # IF_ZERO local_parse_line_at_Parse_internal_11 GOTO label_FALSE_29 + lw $t0, -48($fp) + beq $t0, 0, label_FALSE_29 + # IF_ZERO local_parse_line_at_Parse_internal_13 GOTO label_FALSE_29 + # IF_ZERO local_parse_line_at_Parse_internal_13 GOTO label_FALSE_29 + lw $t0, -56($fp) + beq $t0, 0, label_FALSE_29 + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # Comparing -48($fp) type with String + la $v0, String + lw $a0, -48($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_STRING_32 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_STRING_32 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_32 + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # Comparing -48($fp) type with Bool + la $v0, Bool + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_33 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_33 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_33 + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # Comparing -48($fp) type with Int + la $v0, Int + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_33 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_33 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_33 + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) + # Load pointers and SUB + lw $a0, -48($fp) + lw $a1, -56($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_30 + # GOTO label_FALSE_29 + j label_FALSE_29 + label_COMPARE_BY_VALUE_33: + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) + lw $a0, -48($fp) + lw $a1, -56($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_30 + # GOTO label_FALSE_29 + j label_FALSE_29 + label_COMPARE_STRING_32: + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -56($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_CONTINUE_34 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_CONTINUE_34 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_34 + # GOTO label_FALSE_29 + j label_FALSE_29 + label_CONTINUE_34: + # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) + # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) + # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -56($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_35: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_36 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_35 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_36: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 + # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_30 + label_FALSE_29: + # LOCAL local_parse_line_at_Parse_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_31 +j label_END_31 +label_TRUE_30: + # LOCAL local_parse_line_at_Parse_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_31: +# LOCAL local_parse_line_at_Parse_internal_8 --> -36($fp) +# LOCAL local_parse_line_at_Parse_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -36($fp) +# IF_ZERO local_parse_line_at_Parse_internal_8 GOTO label_FALSE_37 +# IF_ZERO local_parse_line_at_Parse_internal_8 GOTO label_FALSE_37 +lw $t0, -36($fp) +beq $t0, 0, label_FALSE_37 +# LOCAL local_parse_line_at_Parse_internal_14 --> -60($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -60($fp) +# GOTO label_NOT_END_38 +j label_NOT_END_38 +label_FALSE_37: + # LOCAL local_parse_line_at_Parse_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + label_NOT_END_38: + # LOCAL local_parse_line_at_Parse_internal_7 --> -32($fp) + # LOCAL local_parse_line_at_Parse_internal_14 --> -60($fp) + # Obtain value from -60($fp) + lw $v0, -60($fp) + lw $v0, 12($v0) + sw $v0, -32($fp) + # IF_ZERO local_parse_line_at_Parse_internal_7 GOTO label_WHILE_END_28 + # IF_ZERO local_parse_line_at_Parse_internal_7 GOTO label_WHILE_END_28 + lw $t0, -32($fp) + beq $t0, 0, label_WHILE_END_28 + # LOCAL local_parse_line_at_Parse_succ_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -64($fp) + # LOCAL local_parse_line_at_Parse_internal_18 --> -76($fp) + # local_parse_line_at_Parse_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_parse_line_at_Parse_internal_16 --> -68($fp) + # LOCAL local_parse_line_at_Parse_internal_18 --> -76($fp) + # local_parse_line_at_Parse_internal_16 = local_parse_line_at_Parse_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_parse_line_at_Parse_internal_19 = GETATTRIBUTE rest Parse + # LOCAL local_parse_line_at_Parse_internal_19 --> -80($fp) + lw $t0, 16($s1) + sw $t0, -80($fp) + # ARG local_parse_line_at_Parse_internal_19 + # LOCAL local_parse_line_at_Parse_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_16 --> -68($fp) + # LOCAL local_parse_line_at_Parse_internal_17 --> -72($fp) + # local_parse_line_at_Parse_internal_17 = VCALL local_parse_line_at_Parse_internal_16 a2i + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_parse_line_at_Parse_succ_15 --> -64($fp) + # LOCAL local_parse_line_at_Parse_internal_17 --> -72($fp) + # local_parse_line_at_Parse_succ_15 = local_parse_line_at_Parse_internal_17 + lw $t0, -72($fp) + sw $t0, -64($fp) + # LOCAL local_parse_line_at_Parse_weight_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -84($fp) + # LOCAL local_parse_line_at_Parse_internal_23 --> -96($fp) + # local_parse_line_at_Parse_internal_23 = SELF + sw $s1, -96($fp) + # LOCAL local_parse_line_at_Parse_internal_21 --> -88($fp) + # LOCAL local_parse_line_at_Parse_internal_23 --> -96($fp) + # local_parse_line_at_Parse_internal_21 = local_parse_line_at_Parse_internal_23 + lw $t0, -96($fp) + sw $t0, -88($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_parse_line_at_Parse_internal_24 = GETATTRIBUTE rest Parse + # LOCAL local_parse_line_at_Parse_internal_24 --> -100($fp) + lw $t0, 16($s1) + sw $t0, -100($fp) + # ARG local_parse_line_at_Parse_internal_24 + # LOCAL local_parse_line_at_Parse_internal_24 --> -100($fp) + lw $t0, -100($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_21 --> -88($fp) + # LOCAL local_parse_line_at_Parse_internal_22 --> -92($fp) + # local_parse_line_at_Parse_internal_22 = VCALL local_parse_line_at_Parse_internal_21 a2i + # Save new self pointer in $s1 + lw $s1, -88($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -92($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_parse_line_at_Parse_weight_20 --> -84($fp) + # LOCAL local_parse_line_at_Parse_internal_22 --> -92($fp) + # local_parse_line_at_Parse_weight_20 = local_parse_line_at_Parse_internal_22 + lw $t0, -92($fp) + sw $t0, -84($fp) + # LOCAL local_parse_line_at_Parse_internal_25 --> -104($fp) + # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) + # local_parse_line_at_Parse_internal_25 = local_parse_line_at_Parse_v_0 + lw $t0, -4($fp) + sw $t0, -104($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_29 --> -120($fp) + # local_parse_line_at_Parse_internal_29 = ALLOCATE Edge + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Edge + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 24 bytes of memory + li $a0, 24 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Edge_start + sw $t0, 4($v0) + # Load type offset + li $t0, 52 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Edge__attrib__from__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Edge__attrib__to__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Edge__attrib__weight__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -120($fp) + # LOCAL local_parse_line_at_Parse_internal_27 --> -112($fp) + # LOCAL local_parse_line_at_Parse_internal_29 --> -120($fp) + # local_parse_line_at_Parse_internal_27 = local_parse_line_at_Parse_internal_29 + lw $t0, -120($fp) + sw $t0, -112($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_30 --> -124($fp) + # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) + # local_parse_line_at_Parse_internal_30 = local_parse_line_at_Parse_v_0 + lw $t0, -4($fp) + sw $t0, -124($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_30 --> -124($fp) + # LOCAL local_parse_line_at_Parse_internal_31 --> -128($fp) + # local_parse_line_at_Parse_internal_31 = VCALL local_parse_line_at_Parse_internal_30 number + # Save new self pointer in $s1 + lw $s1, -124($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 36($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -128($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_parse_line_at_Parse_internal_31 + # LOCAL local_parse_line_at_Parse_internal_31 --> -128($fp) + lw $t0, -128($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # ARG local_parse_line_at_Parse_succ_15 + # LOCAL local_parse_line_at_Parse_succ_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # ARG local_parse_line_at_Parse_weight_20 + # LOCAL local_parse_line_at_Parse_weight_20 --> -84($fp) + lw $t0, -84($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_27 --> -112($fp) + # LOCAL local_parse_line_at_Parse_internal_28 --> -116($fp) + # local_parse_line_at_Parse_internal_28 = VCALL local_parse_line_at_Parse_internal_27 init + # Save new self pointer in $s1 + lw $s1, -112($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 112($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -116($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_parse_line_at_Parse_internal_28 + # LOCAL local_parse_line_at_Parse_internal_28 --> -116($fp) + lw $t0, -116($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_parse_line_at_Parse_internal_25 --> -104($fp) + # LOCAL local_parse_line_at_Parse_internal_26 --> -108($fp) + # local_parse_line_at_Parse_internal_26 = VCALL local_parse_line_at_Parse_internal_25 add_out + # Save new self pointer in $s1 + lw $s1, -104($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -108($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # GOTO label_WHILE_27 + j label_WHILE_27 + label_WHILE_END_28: + # RETURN local_parse_line_at_Parse_v_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_parse_line_at_Parse. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 136 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_c2i_at_Parse implementation. +# @Params: +# 0($fp) = param_c2i_at_Parse_char_0 +function_c2i_at_Parse: + # Allocate stack frame for function function_c2i_at_Parse. + subu $sp, $sp, 264 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 264 + # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_6 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -20($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_41 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_41 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_41 + # IF_ZERO local_c2i_at_Parse_internal_4 GOTO label_FALSE_41 + # IF_ZERO local_c2i_at_Parse_internal_4 GOTO label_FALSE_41 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_41 + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_STRING_44 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_STRING_44 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_44 + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_45 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_45 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_45 + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_45 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_45 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_45 + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_42 + # GOTO label_FALSE_41 + j label_FALSE_41 + label_COMPARE_BY_VALUE_45: + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_42 + # GOTO label_FALSE_41 + j label_FALSE_41 + label_COMPARE_STRING_44: + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_CONTINUE_46 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_CONTINUE_46 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_46 + # GOTO label_FALSE_41 + j label_FALSE_41 + label_CONTINUE_46: + # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_47: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_48 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_47 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_48: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 + # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_42 + label_FALSE_41: + # LOCAL local_c2i_at_Parse_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_43 +j label_END_43 +label_TRUE_42: + # LOCAL local_c2i_at_Parse_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_43: +# LOCAL local_c2i_at_Parse_internal_0 --> -4($fp) +# LOCAL local_c2i_at_Parse_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_c2i_at_Parse_internal_0 GOTO label_FALSEIF_39 +# IF_ZERO local_c2i_at_Parse_internal_0 GOTO label_FALSEIF_39 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_39 +# LOCAL local_c2i_at_Parse_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -24($fp) +# LOCAL local_c2i_at_Parse_internal_1 --> -8($fp) +# LOCAL local_c2i_at_Parse_internal_5 --> -24($fp) +# local_c2i_at_Parse_internal_1 = local_c2i_at_Parse_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_40 +j label_ENDIF_40 +label_FALSEIF_39: + # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_7 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -44($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_51 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_51 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_51 + # IF_ZERO local_c2i_at_Parse_internal_10 GOTO label_FALSE_51 + # IF_ZERO local_c2i_at_Parse_internal_10 GOTO label_FALSE_51 + lw $t0, -44($fp) + beq $t0, 0, label_FALSE_51 + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_STRING_54 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_STRING_54 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_54 + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_55 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_55 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_55 + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_55 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_55 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_55 + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -44($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_52 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_COMPARE_BY_VALUE_55: + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) + lw $a0, 0($fp) + lw $a1, -44($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_52 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_COMPARE_STRING_54: + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_CONTINUE_56 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_CONTINUE_56 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_56 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_CONTINUE_56: + # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -44($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_57: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_58 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_57 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_58: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 + # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_52 + label_FALSE_51: + # LOCAL local_c2i_at_Parse_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_53 +j label_END_53 +label_TRUE_52: + # LOCAL local_c2i_at_Parse_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_53: +# LOCAL local_c2i_at_Parse_internal_6 --> -28($fp) +# LOCAL local_c2i_at_Parse_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_c2i_at_Parse_internal_6 GOTO label_FALSEIF_49 +# IF_ZERO local_c2i_at_Parse_internal_6 GOTO label_FALSEIF_49 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_49 +# LOCAL local_c2i_at_Parse_internal_11 --> -48($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -48($fp) +# LOCAL local_c2i_at_Parse_internal_7 --> -32($fp) +# LOCAL local_c2i_at_Parse_internal_11 --> -48($fp) +# local_c2i_at_Parse_internal_7 = local_c2i_at_Parse_internal_11 +lw $t0, -48($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_50 +j label_ENDIF_50 +label_FALSEIF_49: + # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_8 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -68($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_61 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_61 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_61 + # IF_ZERO local_c2i_at_Parse_internal_16 GOTO label_FALSE_61 + # IF_ZERO local_c2i_at_Parse_internal_16 GOTO label_FALSE_61 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_61 + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_STRING_64 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_STRING_64 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_STRING_64 + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_65 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_65 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_65 + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_65 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_65 + lw $t0, -64($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_65 + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_62 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_COMPARE_BY_VALUE_65: + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) + lw $a0, 0($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_62 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_COMPARE_STRING_64: + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_CONTINUE_66 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_CONTINUE_66 + lw $t0, -64($fp) + beq $t0, 0, label_CONTINUE_66 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_CONTINUE_66: + # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_67: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_68 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_67 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_68: + # Store result + sw $a2, -64($fp) + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 + # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 + lw $t0, -64($fp) + beq $t0, 0, label_TRUE_62 + label_FALSE_61: + # LOCAL local_c2i_at_Parse_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # GOTO label_END_63 +j label_END_63 +label_TRUE_62: + # LOCAL local_c2i_at_Parse_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + label_END_63: +# LOCAL local_c2i_at_Parse_internal_12 --> -52($fp) +# LOCAL local_c2i_at_Parse_internal_14 --> -60($fp) +# Obtain value from -60($fp) +lw $v0, -60($fp) +lw $v0, 12($v0) +sw $v0, -52($fp) +# IF_ZERO local_c2i_at_Parse_internal_12 GOTO label_FALSEIF_59 +# IF_ZERO local_c2i_at_Parse_internal_12 GOTO label_FALSEIF_59 +lw $t0, -52($fp) +beq $t0, 0, label_FALSEIF_59 +# LOCAL local_c2i_at_Parse_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 2 +sw $t0, 12($v0) +sw $v0, -72($fp) +# LOCAL local_c2i_at_Parse_internal_13 --> -56($fp) +# LOCAL local_c2i_at_Parse_internal_17 --> -72($fp) +# local_c2i_at_Parse_internal_13 = local_c2i_at_Parse_internal_17 +lw $t0, -72($fp) +sw $t0, -56($fp) +# GOTO label_ENDIF_60 +j label_ENDIF_60 +label_FALSEIF_59: + # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_9 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -92($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_71 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_71 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_71 + # IF_ZERO local_c2i_at_Parse_internal_22 GOTO label_FALSE_71 + # IF_ZERO local_c2i_at_Parse_internal_22 GOTO label_FALSE_71 + lw $t0, -92($fp) + beq $t0, 0, label_FALSE_71 + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_STRING_74 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_STRING_74 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_STRING_74 + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_BY_VALUE_75 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_BY_VALUE_75 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_75 + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_BY_VALUE_75 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_BY_VALUE_75 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_75 + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -92($fp) + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_72 + # GOTO label_FALSE_71 + j label_FALSE_71 + label_COMPARE_BY_VALUE_75: + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) + lw $a0, 0($fp) + lw $a1, -92($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_72 + # GOTO label_FALSE_71 + j label_FALSE_71 + label_COMPARE_STRING_74: + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_CONTINUE_76 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_CONTINUE_76 + lw $t0, -88($fp) + beq $t0, 0, label_CONTINUE_76 + # GOTO label_FALSE_71 + j label_FALSE_71 + label_CONTINUE_76: + # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -92($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_77: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_78 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_77 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_78: + # Store result + sw $a2, -88($fp) + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 + # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_72 + label_FALSE_71: + # LOCAL local_c2i_at_Parse_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -84($fp) + # GOTO label_END_73 +j label_END_73 +label_TRUE_72: + # LOCAL local_c2i_at_Parse_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -84($fp) + label_END_73: +# LOCAL local_c2i_at_Parse_internal_18 --> -76($fp) +# LOCAL local_c2i_at_Parse_internal_20 --> -84($fp) +# Obtain value from -84($fp) +lw $v0, -84($fp) +lw $v0, 12($v0) +sw $v0, -76($fp) +# IF_ZERO local_c2i_at_Parse_internal_18 GOTO label_FALSEIF_69 +# IF_ZERO local_c2i_at_Parse_internal_18 GOTO label_FALSEIF_69 +lw $t0, -76($fp) +beq $t0, 0, label_FALSEIF_69 +# LOCAL local_c2i_at_Parse_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 3 +sw $t0, 12($v0) +sw $v0, -96($fp) +# LOCAL local_c2i_at_Parse_internal_19 --> -80($fp) +# LOCAL local_c2i_at_Parse_internal_23 --> -96($fp) +# local_c2i_at_Parse_internal_19 = local_c2i_at_Parse_internal_23 +lw $t0, -96($fp) +sw $t0, -80($fp) +# GOTO label_ENDIF_70 +j label_ENDIF_70 +label_FALSEIF_69: + # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_10 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -116($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_81 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_81 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_81 + # IF_ZERO local_c2i_at_Parse_internal_28 GOTO label_FALSE_81 + # IF_ZERO local_c2i_at_Parse_internal_28 GOTO label_FALSE_81 + lw $t0, -116($fp) + beq $t0, 0, label_FALSE_81 + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_STRING_84 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_STRING_84 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_STRING_84 + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_BY_VALUE_85 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_BY_VALUE_85 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_85 + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_BY_VALUE_85 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_BY_VALUE_85 + lw $t0, -112($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_85 + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -116($fp) + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_82 + # GOTO label_FALSE_81 + j label_FALSE_81 + label_COMPARE_BY_VALUE_85: + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) + lw $a0, 0($fp) + lw $a1, -116($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_82 + # GOTO label_FALSE_81 + j label_FALSE_81 + label_COMPARE_STRING_84: + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_CONTINUE_86 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_CONTINUE_86 + lw $t0, -112($fp) + beq $t0, 0, label_CONTINUE_86 + # GOTO label_FALSE_81 + j label_FALSE_81 + label_CONTINUE_86: + # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -116($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_87: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_88 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_87 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_88: + # Store result + sw $a2, -112($fp) + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 + # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 + lw $t0, -112($fp) + beq $t0, 0, label_TRUE_82 + label_FALSE_81: + # LOCAL local_c2i_at_Parse_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -108($fp) + # GOTO label_END_83 +j label_END_83 +label_TRUE_82: + # LOCAL local_c2i_at_Parse_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -108($fp) + label_END_83: +# LOCAL local_c2i_at_Parse_internal_24 --> -100($fp) +# LOCAL local_c2i_at_Parse_internal_26 --> -108($fp) +# Obtain value from -108($fp) +lw $v0, -108($fp) +lw $v0, 12($v0) +sw $v0, -100($fp) +# IF_ZERO local_c2i_at_Parse_internal_24 GOTO label_FALSEIF_79 +# IF_ZERO local_c2i_at_Parse_internal_24 GOTO label_FALSEIF_79 +lw $t0, -100($fp) +beq $t0, 0, label_FALSEIF_79 +# LOCAL local_c2i_at_Parse_internal_29 --> -120($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 4 +sw $t0, 12($v0) +sw $v0, -120($fp) +# LOCAL local_c2i_at_Parse_internal_25 --> -104($fp) +# LOCAL local_c2i_at_Parse_internal_29 --> -120($fp) +# local_c2i_at_Parse_internal_25 = local_c2i_at_Parse_internal_29 +lw $t0, -120($fp) +sw $t0, -104($fp) +# GOTO label_ENDIF_80 +j label_ENDIF_80 +label_FALSEIF_79: + # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_11 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -140($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_91 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_91 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_91 + # IF_ZERO local_c2i_at_Parse_internal_34 GOTO label_FALSE_91 + # IF_ZERO local_c2i_at_Parse_internal_34 GOTO label_FALSE_91 + lw $t0, -140($fp) + beq $t0, 0, label_FALSE_91 + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_STRING_94 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_STRING_94 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_STRING_94 + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_BY_VALUE_95 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_BY_VALUE_95 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_95 + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_BY_VALUE_95 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_BY_VALUE_95 + lw $t0, -136($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_95 + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -140($fp) + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_92 + # GOTO label_FALSE_91 + j label_FALSE_91 + label_COMPARE_BY_VALUE_95: + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) + lw $a0, 0($fp) + lw $a1, -140($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_92 + # GOTO label_FALSE_91 + j label_FALSE_91 + label_COMPARE_STRING_94: + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_CONTINUE_96 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_CONTINUE_96 + lw $t0, -136($fp) + beq $t0, 0, label_CONTINUE_96 + # GOTO label_FALSE_91 + j label_FALSE_91 + label_CONTINUE_96: + # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -140($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_97: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_98 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_97 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_98: + # Store result + sw $a2, -136($fp) + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 + # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 + lw $t0, -136($fp) + beq $t0, 0, label_TRUE_92 + label_FALSE_91: + # LOCAL local_c2i_at_Parse_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -132($fp) + # GOTO label_END_93 +j label_END_93 +label_TRUE_92: + # LOCAL local_c2i_at_Parse_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -132($fp) + label_END_93: +# LOCAL local_c2i_at_Parse_internal_30 --> -124($fp) +# LOCAL local_c2i_at_Parse_internal_32 --> -132($fp) +# Obtain value from -132($fp) +lw $v0, -132($fp) +lw $v0, 12($v0) +sw $v0, -124($fp) +# IF_ZERO local_c2i_at_Parse_internal_30 GOTO label_FALSEIF_89 +# IF_ZERO local_c2i_at_Parse_internal_30 GOTO label_FALSEIF_89 +lw $t0, -124($fp) +beq $t0, 0, label_FALSEIF_89 +# LOCAL local_c2i_at_Parse_internal_35 --> -144($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 5 +sw $t0, 12($v0) +sw $v0, -144($fp) +# LOCAL local_c2i_at_Parse_internal_31 --> -128($fp) +# LOCAL local_c2i_at_Parse_internal_35 --> -144($fp) +# local_c2i_at_Parse_internal_31 = local_c2i_at_Parse_internal_35 +lw $t0, -144($fp) +sw $t0, -128($fp) +# GOTO label_ENDIF_90 +j label_ENDIF_90 +label_FALSEIF_89: + # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_12 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -164($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_101 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_101 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_101 + # IF_ZERO local_c2i_at_Parse_internal_40 GOTO label_FALSE_101 + # IF_ZERO local_c2i_at_Parse_internal_40 GOTO label_FALSE_101 + lw $t0, -164($fp) + beq $t0, 0, label_FALSE_101 + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_STRING_104 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_STRING_104 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_STRING_104 + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_BY_VALUE_105 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_BY_VALUE_105 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_105 + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_BY_VALUE_105 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_BY_VALUE_105 + lw $t0, -160($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_105 + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -164($fp) + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_102 + # GOTO label_FALSE_101 + j label_FALSE_101 + label_COMPARE_BY_VALUE_105: + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) + lw $a0, 0($fp) + lw $a1, -164($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_102 + # GOTO label_FALSE_101 + j label_FALSE_101 + label_COMPARE_STRING_104: + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_CONTINUE_106 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_CONTINUE_106 + lw $t0, -160($fp) + beq $t0, 0, label_CONTINUE_106 + # GOTO label_FALSE_101 + j label_FALSE_101 + label_CONTINUE_106: + # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -164($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_107: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_108 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_107 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_108: + # Store result + sw $a2, -160($fp) + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 + # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 + lw $t0, -160($fp) + beq $t0, 0, label_TRUE_102 + label_FALSE_101: + # LOCAL local_c2i_at_Parse_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -156($fp) + # GOTO label_END_103 +j label_END_103 +label_TRUE_102: + # LOCAL local_c2i_at_Parse_internal_38 --> -156($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -156($fp) + label_END_103: +# LOCAL local_c2i_at_Parse_internal_36 --> -148($fp) +# LOCAL local_c2i_at_Parse_internal_38 --> -156($fp) +# Obtain value from -156($fp) +lw $v0, -156($fp) +lw $v0, 12($v0) +sw $v0, -148($fp) +# IF_ZERO local_c2i_at_Parse_internal_36 GOTO label_FALSEIF_99 +# IF_ZERO local_c2i_at_Parse_internal_36 GOTO label_FALSEIF_99 +lw $t0, -148($fp) +beq $t0, 0, label_FALSEIF_99 +# LOCAL local_c2i_at_Parse_internal_41 --> -168($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 6 +sw $t0, 12($v0) +sw $v0, -168($fp) +# LOCAL local_c2i_at_Parse_internal_37 --> -152($fp) +# LOCAL local_c2i_at_Parse_internal_41 --> -168($fp) +# local_c2i_at_Parse_internal_37 = local_c2i_at_Parse_internal_41 +lw $t0, -168($fp) +sw $t0, -152($fp) +# GOTO label_ENDIF_100 +j label_ENDIF_100 +label_FALSEIF_99: + # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_13 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -188($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_111 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_111 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_111 + # IF_ZERO local_c2i_at_Parse_internal_46 GOTO label_FALSE_111 + # IF_ZERO local_c2i_at_Parse_internal_46 GOTO label_FALSE_111 + lw $t0, -188($fp) + beq $t0, 0, label_FALSE_111 + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_STRING_114 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_STRING_114 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_STRING_114 + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_BY_VALUE_115 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_BY_VALUE_115 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_115 + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_BY_VALUE_115 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_BY_VALUE_115 + lw $t0, -184($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_115 + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -188($fp) + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_112 + # GOTO label_FALSE_111 + j label_FALSE_111 + label_COMPARE_BY_VALUE_115: + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) + lw $a0, 0($fp) + lw $a1, -188($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_112 + # GOTO label_FALSE_111 + j label_FALSE_111 + label_COMPARE_STRING_114: + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_CONTINUE_116 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_CONTINUE_116 + lw $t0, -184($fp) + beq $t0, 0, label_CONTINUE_116 + # GOTO label_FALSE_111 + j label_FALSE_111 + label_CONTINUE_116: + # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -188($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_117: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_118 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_117 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_118: + # Store result + sw $a2, -184($fp) + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 + # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 + lw $t0, -184($fp) + beq $t0, 0, label_TRUE_112 + label_FALSE_111: + # LOCAL local_c2i_at_Parse_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -180($fp) + # GOTO label_END_113 +j label_END_113 +label_TRUE_112: + # LOCAL local_c2i_at_Parse_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -180($fp) + label_END_113: +# LOCAL local_c2i_at_Parse_internal_42 --> -172($fp) +# LOCAL local_c2i_at_Parse_internal_44 --> -180($fp) +# Obtain value from -180($fp) +lw $v0, -180($fp) +lw $v0, 12($v0) +sw $v0, -172($fp) +# IF_ZERO local_c2i_at_Parse_internal_42 GOTO label_FALSEIF_109 +# IF_ZERO local_c2i_at_Parse_internal_42 GOTO label_FALSEIF_109 +lw $t0, -172($fp) +beq $t0, 0, label_FALSEIF_109 +# LOCAL local_c2i_at_Parse_internal_47 --> -192($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 7 +sw $t0, 12($v0) +sw $v0, -192($fp) +# LOCAL local_c2i_at_Parse_internal_43 --> -176($fp) +# LOCAL local_c2i_at_Parse_internal_47 --> -192($fp) +# local_c2i_at_Parse_internal_43 = local_c2i_at_Parse_internal_47 +lw $t0, -192($fp) +sw $t0, -176($fp) +# GOTO label_ENDIF_110 +j label_ENDIF_110 +label_FALSEIF_109: + # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_14 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -212($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_121 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_121 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_121 + # IF_ZERO local_c2i_at_Parse_internal_52 GOTO label_FALSE_121 + # IF_ZERO local_c2i_at_Parse_internal_52 GOTO label_FALSE_121 + lw $t0, -212($fp) + beq $t0, 0, label_FALSE_121 + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_STRING_124 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_STRING_124 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_STRING_124 + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_BY_VALUE_125 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_BY_VALUE_125 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_125 + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_BY_VALUE_125 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_BY_VALUE_125 + lw $t0, -208($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_125 + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -212($fp) + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_122 + # GOTO label_FALSE_121 + j label_FALSE_121 + label_COMPARE_BY_VALUE_125: + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) + lw $a0, 0($fp) + lw $a1, -212($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_122 + # GOTO label_FALSE_121 + j label_FALSE_121 + label_COMPARE_STRING_124: + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_CONTINUE_126 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_CONTINUE_126 + lw $t0, -208($fp) + beq $t0, 0, label_CONTINUE_126 + # GOTO label_FALSE_121 + j label_FALSE_121 + label_CONTINUE_126: + # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -212($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_127: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_128 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_127 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_128: + # Store result + sw $a2, -208($fp) + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 + # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 + lw $t0, -208($fp) + beq $t0, 0, label_TRUE_122 + label_FALSE_121: + # LOCAL local_c2i_at_Parse_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -204($fp) + # GOTO label_END_123 +j label_END_123 +label_TRUE_122: + # LOCAL local_c2i_at_Parse_internal_50 --> -204($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -204($fp) + label_END_123: +# LOCAL local_c2i_at_Parse_internal_48 --> -196($fp) +# LOCAL local_c2i_at_Parse_internal_50 --> -204($fp) +# Obtain value from -204($fp) +lw $v0, -204($fp) +lw $v0, 12($v0) +sw $v0, -196($fp) +# IF_ZERO local_c2i_at_Parse_internal_48 GOTO label_FALSEIF_119 +# IF_ZERO local_c2i_at_Parse_internal_48 GOTO label_FALSEIF_119 +lw $t0, -196($fp) +beq $t0, 0, label_FALSEIF_119 +# LOCAL local_c2i_at_Parse_internal_53 --> -216($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 8 +sw $t0, 12($v0) +sw $v0, -216($fp) +# LOCAL local_c2i_at_Parse_internal_49 --> -200($fp) +# LOCAL local_c2i_at_Parse_internal_53 --> -216($fp) +# local_c2i_at_Parse_internal_49 = local_c2i_at_Parse_internal_53 +lw $t0, -216($fp) +sw $t0, -200($fp) +# GOTO label_ENDIF_120 +j label_ENDIF_120 +label_FALSEIF_119: + # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_15 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -236($fp) + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_131 + # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_131 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_131 + # IF_ZERO local_c2i_at_Parse_internal_58 GOTO label_FALSE_131 + # IF_ZERO local_c2i_at_Parse_internal_58 GOTO label_FALSE_131 + lw $t0, -236($fp) + beq $t0, 0, label_FALSE_131 + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_STRING_134 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_STRING_134 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_STRING_134 + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_BY_VALUE_135 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_BY_VALUE_135 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_135 + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_BY_VALUE_135 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_BY_VALUE_135 + lw $t0, -232($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_135 + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -236($fp) + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_132 + # GOTO label_FALSE_131 + j label_FALSE_131 + label_COMPARE_BY_VALUE_135: + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) + lw $a0, 0($fp) + lw $a1, -236($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_132 + # GOTO label_FALSE_131 + j label_FALSE_131 + label_COMPARE_STRING_134: + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_CONTINUE_136 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_CONTINUE_136 + lw $t0, -232($fp) + beq $t0, 0, label_CONTINUE_136 + # GOTO label_FALSE_131 + j label_FALSE_131 + label_CONTINUE_136: + # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) + # PARAM param_c2i_at_Parse_char_0 --> 0($fp) + # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -236($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_137: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_138 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_137 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_138: + # Store result + sw $a2, -232($fp) + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 + # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 + lw $t0, -232($fp) + beq $t0, 0, label_TRUE_132 + label_FALSE_131: + # LOCAL local_c2i_at_Parse_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -228($fp) + # GOTO label_END_133 +j label_END_133 +label_TRUE_132: + # LOCAL local_c2i_at_Parse_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -228($fp) + label_END_133: +# LOCAL local_c2i_at_Parse_internal_54 --> -220($fp) +# LOCAL local_c2i_at_Parse_internal_56 --> -228($fp) +# Obtain value from -228($fp) +lw $v0, -228($fp) +lw $v0, 12($v0) +sw $v0, -220($fp) +# IF_ZERO local_c2i_at_Parse_internal_54 GOTO label_FALSEIF_129 +# IF_ZERO local_c2i_at_Parse_internal_54 GOTO label_FALSEIF_129 +lw $t0, -220($fp) +beq $t0, 0, label_FALSEIF_129 +# LOCAL local_c2i_at_Parse_internal_59 --> -240($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 9 +sw $t0, 12($v0) +sw $v0, -240($fp) +# LOCAL local_c2i_at_Parse_internal_55 --> -224($fp) +# LOCAL local_c2i_at_Parse_internal_59 --> -240($fp) +# local_c2i_at_Parse_internal_55 = local_c2i_at_Parse_internal_59 +lw $t0, -240($fp) +sw $t0, -224($fp) +# GOTO label_ENDIF_130 +j label_ENDIF_130 +label_FALSEIF_129: + # LOCAL local_c2i_at_Parse_internal_62 --> -252($fp) + # local_c2i_at_Parse_internal_62 = SELF + sw $s1, -252($fp) + # LOCAL local_c2i_at_Parse_internal_60 --> -244($fp) + # LOCAL local_c2i_at_Parse_internal_62 --> -252($fp) + # local_c2i_at_Parse_internal_60 = local_c2i_at_Parse_internal_62 + lw $t0, -252($fp) + sw $t0, -244($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_c2i_at_Parse_internal_60 --> -244($fp) + # LOCAL local_c2i_at_Parse_internal_61 --> -248($fp) + # local_c2i_at_Parse_internal_61 = VCALL local_c2i_at_Parse_internal_60 abort + # Save new self pointer in $s1 + lw $s1, -244($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -248($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_c2i_at_Parse_internal_63 --> -256($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -256($fp) + # LOCAL local_c2i_at_Parse_internal_55 --> -224($fp) + # LOCAL local_c2i_at_Parse_internal_63 --> -256($fp) + # local_c2i_at_Parse_internal_55 = local_c2i_at_Parse_internal_63 + lw $t0, -256($fp) + sw $t0, -224($fp) + label_ENDIF_130: +# LOCAL local_c2i_at_Parse_internal_49 --> -200($fp) +# LOCAL local_c2i_at_Parse_internal_55 --> -224($fp) +# local_c2i_at_Parse_internal_49 = local_c2i_at_Parse_internal_55 +lw $t0, -224($fp) +sw $t0, -200($fp) +label_ENDIF_120: +# LOCAL local_c2i_at_Parse_internal_43 --> -176($fp) +# LOCAL local_c2i_at_Parse_internal_49 --> -200($fp) +# local_c2i_at_Parse_internal_43 = local_c2i_at_Parse_internal_49 +lw $t0, -200($fp) +sw $t0, -176($fp) +label_ENDIF_110: +# LOCAL local_c2i_at_Parse_internal_37 --> -152($fp) +# LOCAL local_c2i_at_Parse_internal_43 --> -176($fp) +# local_c2i_at_Parse_internal_37 = local_c2i_at_Parse_internal_43 +lw $t0, -176($fp) +sw $t0, -152($fp) +label_ENDIF_100: +# LOCAL local_c2i_at_Parse_internal_31 --> -128($fp) +# LOCAL local_c2i_at_Parse_internal_37 --> -152($fp) +# local_c2i_at_Parse_internal_31 = local_c2i_at_Parse_internal_37 +lw $t0, -152($fp) +sw $t0, -128($fp) +label_ENDIF_90: +# LOCAL local_c2i_at_Parse_internal_25 --> -104($fp) +# LOCAL local_c2i_at_Parse_internal_31 --> -128($fp) +# local_c2i_at_Parse_internal_25 = local_c2i_at_Parse_internal_31 +lw $t0, -128($fp) +sw $t0, -104($fp) +label_ENDIF_80: +# LOCAL local_c2i_at_Parse_internal_19 --> -80($fp) +# LOCAL local_c2i_at_Parse_internal_25 --> -104($fp) +# local_c2i_at_Parse_internal_19 = local_c2i_at_Parse_internal_25 +lw $t0, -104($fp) +sw $t0, -80($fp) +label_ENDIF_70: +# LOCAL local_c2i_at_Parse_internal_13 --> -56($fp) +# LOCAL local_c2i_at_Parse_internal_19 --> -80($fp) +# local_c2i_at_Parse_internal_13 = local_c2i_at_Parse_internal_19 +lw $t0, -80($fp) +sw $t0, -56($fp) +label_ENDIF_60: +# LOCAL local_c2i_at_Parse_internal_7 --> -32($fp) +# LOCAL local_c2i_at_Parse_internal_13 --> -56($fp) +# local_c2i_at_Parse_internal_7 = local_c2i_at_Parse_internal_13 +lw $t0, -56($fp) +sw $t0, -32($fp) +label_ENDIF_50: +# LOCAL local_c2i_at_Parse_internal_1 --> -8($fp) +# LOCAL local_c2i_at_Parse_internal_7 --> -32($fp) +# local_c2i_at_Parse_internal_1 = local_c2i_at_Parse_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +label_ENDIF_40: +# RETURN local_c2i_at_Parse_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_c2i_at_Parse. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 264 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_at_Parse implementation. +# @Params: +# 0($fp) = param_a2i_at_Parse_s_0 +function_a2i_at_Parse: + # Allocate stack frame for function function_a2i_at_Parse. + subu $sp, $sp, 208 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 208 + # LOCAL local_a2i_at_Parse_internal_4 --> -20($fp) + # PARAM param_a2i_at_Parse_s_0 --> 0($fp) + # local_a2i_at_Parse_internal_4 = PARAM param_a2i_at_Parse_s_0 + lw $t0, 0($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_Parse_internal_4 --> -20($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # local_a2i_at_Parse_internal_5 = VCALL local_a2i_at_Parse_internal_4 length + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 8($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # IF_ZERO local_a2i_at_Parse_internal_5 GOTO label_FALSE_141 + # IF_ZERO local_a2i_at_Parse_internal_5 GOTO label_FALSE_141 + lw $t0, -24($fp) + beq $t0, 0, label_FALSE_141 + # IF_ZERO local_a2i_at_Parse_internal_6 GOTO label_FALSE_141 + # IF_ZERO local_a2i_at_Parse_internal_6 GOTO label_FALSE_141 + lw $t0, -28($fp) + beq $t0, 0, label_FALSE_141 + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # Comparing -24($fp) type with String + la $v0, String + lw $a0, -24($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_STRING_144 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_STRING_144 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_144 + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # Comparing -24($fp) type with Bool + la $v0, Bool + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_145 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_145 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_145 + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # Comparing -24($fp) type with Int + la $v0, Int + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_145 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_145 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_145 + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) + # Load pointers and SUB + lw $a0, -24($fp) + lw $a1, -28($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_142 + # GOTO label_FALSE_141 + j label_FALSE_141 + label_COMPARE_BY_VALUE_145: + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) + lw $a0, -24($fp) + lw $a1, -28($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_142 + # GOTO label_FALSE_141 + j label_FALSE_141 + label_COMPARE_STRING_144: + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -28($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_CONTINUE_146 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_CONTINUE_146 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_146 + # GOTO label_FALSE_141 + j label_FALSE_141 + label_CONTINUE_146: + # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) + # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -28($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_147: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_148 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_147 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_148: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 + # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_142 + label_FALSE_141: + # LOCAL local_a2i_at_Parse_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_143 +j label_END_143 +label_TRUE_142: + # LOCAL local_a2i_at_Parse_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_143: +# LOCAL local_a2i_at_Parse_internal_0 --> -4($fp) +# LOCAL local_a2i_at_Parse_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_a2i_at_Parse_internal_0 GOTO label_FALSEIF_139 +# IF_ZERO local_a2i_at_Parse_internal_0 GOTO label_FALSEIF_139 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_139 +# LOCAL local_a2i_at_Parse_internal_7 --> -32($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -32($fp) +# LOCAL local_a2i_at_Parse_internal_1 --> -8($fp) +# LOCAL local_a2i_at_Parse_internal_7 --> -32($fp) +# local_a2i_at_Parse_internal_1 = local_a2i_at_Parse_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_140 +j label_ENDIF_140 +label_FALSEIF_139: + # LOCAL local_a2i_at_Parse_internal_12 --> -52($fp) + # PARAM param_a2i_at_Parse_s_0 --> 0($fp) + # local_a2i_at_Parse_internal_12 = PARAM param_a2i_at_Parse_s_0 + lw $t0, 0($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_Parse_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -60($fp) + # ARG local_a2i_at_Parse_internal_14 + # LOCAL local_a2i_at_Parse_internal_14 --> -60($fp) + lw $t0, -60($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_Parse_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -64($fp) + # ARG local_a2i_at_Parse_internal_15 + # LOCAL local_a2i_at_Parse_internal_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_Parse_internal_12 --> -52($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # local_a2i_at_Parse_internal_13 = VCALL local_a2i_at_Parse_internal_12 substr + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_16 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -68($fp) + # IF_ZERO local_a2i_at_Parse_internal_13 GOTO label_FALSE_151 + # IF_ZERO local_a2i_at_Parse_internal_13 GOTO label_FALSE_151 + lw $t0, -56($fp) + beq $t0, 0, label_FALSE_151 + # IF_ZERO local_a2i_at_Parse_internal_16 GOTO label_FALSE_151 + # IF_ZERO local_a2i_at_Parse_internal_16 GOTO label_FALSE_151 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_151 + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # Comparing -56($fp) type with String + la $v0, String + lw $a0, -56($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_STRING_154 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_STRING_154 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_STRING_154 + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # Comparing -56($fp) type with Bool + la $v0, Bool + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_155 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_155 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_155 + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # Comparing -56($fp) type with Int + la $v0, Int + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_155 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_155 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_155 + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, -56($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_152 + # GOTO label_FALSE_151 + j label_FALSE_151 + label_COMPARE_BY_VALUE_155: + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) + lw $a0, -56($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_152 + # GOTO label_FALSE_151 + j label_FALSE_151 + label_COMPARE_STRING_154: + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_CONTINUE_156 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_CONTINUE_156 + lw $t0, -48($fp) + beq $t0, 0, label_CONTINUE_156 + # GOTO label_FALSE_151 + j label_FALSE_151 + label_CONTINUE_156: + # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) + # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) + # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_157: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_158 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_157 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_158: + # Store result + sw $a2, -48($fp) + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 + # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_152 + label_FALSE_151: + # LOCAL local_a2i_at_Parse_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -44($fp) + # GOTO label_END_153 +j label_END_153 +label_TRUE_152: + # LOCAL local_a2i_at_Parse_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + label_END_153: +# LOCAL local_a2i_at_Parse_internal_8 --> -36($fp) +# LOCAL local_a2i_at_Parse_internal_10 --> -44($fp) +# Obtain value from -44($fp) +lw $v0, -44($fp) +lw $v0, 12($v0) +sw $v0, -36($fp) +# IF_ZERO local_a2i_at_Parse_internal_8 GOTO label_FALSEIF_149 +# IF_ZERO local_a2i_at_Parse_internal_8 GOTO label_FALSEIF_149 +lw $t0, -36($fp) +beq $t0, 0, label_FALSEIF_149 +# LOCAL local_a2i_at_Parse_internal_20 --> -84($fp) +# local_a2i_at_Parse_internal_20 = SELF +sw $s1, -84($fp) +# LOCAL local_a2i_at_Parse_internal_18 --> -76($fp) +# LOCAL local_a2i_at_Parse_internal_20 --> -84($fp) +# local_a2i_at_Parse_internal_18 = local_a2i_at_Parse_internal_20 +lw $t0, -84($fp) +sw $t0, -76($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_Parse_internal_21 --> -88($fp) +# PARAM param_a2i_at_Parse_s_0 --> 0($fp) +# local_a2i_at_Parse_internal_21 = PARAM param_a2i_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -88($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_Parse_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -96($fp) +# ARG local_a2i_at_Parse_internal_23 +# LOCAL local_a2i_at_Parse_internal_23 --> -96($fp) +lw $t0, -96($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_Parse_internal_25 --> -104($fp) +# PARAM param_a2i_at_Parse_s_0 --> 0($fp) +# local_a2i_at_Parse_internal_25 = PARAM param_a2i_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -104($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_Parse_internal_25 --> -104($fp) +# LOCAL local_a2i_at_Parse_internal_26 --> -108($fp) +# local_a2i_at_Parse_internal_26 = VCALL local_a2i_at_Parse_internal_25 length +# Save new self pointer in $s1 +lw $s1, -104($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 8($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -108($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_Parse_internal_27 --> -112($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -112($fp) +# LOCAL local_a2i_at_Parse_internal_24 --> -100($fp) +# LOCAL local_a2i_at_Parse_internal_26 --> -108($fp) +# LOCAL local_a2i_at_Parse_internal_27 --> -112($fp) +# local_a2i_at_Parse_internal_24 = local_a2i_at_Parse_internal_26 - local_a2i_at_Parse_internal_27 +lw $t1, -108($fp) +lw $t0, 12($t1) +lw $t1, -112($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -100($fp) +# ARG local_a2i_at_Parse_internal_24 +# LOCAL local_a2i_at_Parse_internal_24 --> -100($fp) +lw $t0, -100($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_Parse_internal_21 --> -88($fp) +# LOCAL local_a2i_at_Parse_internal_22 --> -92($fp) +# local_a2i_at_Parse_internal_22 = VCALL local_a2i_at_Parse_internal_21 substr +# Save new self pointer in $s1 +lw $s1, -88($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 48($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -92($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_at_Parse_internal_22 +# LOCAL local_a2i_at_Parse_internal_22 --> -92($fp) +lw $t0, -92($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_Parse_internal_18 --> -76($fp) +# LOCAL local_a2i_at_Parse_internal_19 --> -80($fp) +# local_a2i_at_Parse_internal_19 = VCALL local_a2i_at_Parse_internal_18 a2i_aux +# Save new self pointer in $s1 +lw $s1, -76($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -80($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_Parse_internal_17 --> -72($fp) +# LOCAL local_a2i_at_Parse_internal_19 --> -80($fp) +lw $t0, -80($fp) +lw $t0, 12($t0) +not $t0, $t0 +add $t0, $t0, 1 +sw $t0, -72($fp) +# LOCAL local_a2i_at_Parse_internal_17 --> -72($fp) +# LOCAL local_a2i_at_Parse_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +lw $t0, -72($fp) +sw $t0, 12($v0) +sw $v0, -72($fp) +# LOCAL local_a2i_at_Parse_internal_9 --> -40($fp) +# LOCAL local_a2i_at_Parse_internal_17 --> -72($fp) +# local_a2i_at_Parse_internal_9 = local_a2i_at_Parse_internal_17 +lw $t0, -72($fp) +sw $t0, -40($fp) +# GOTO label_ENDIF_150 +j label_ENDIF_150 +label_FALSEIF_149: + # LOCAL local_a2i_at_Parse_internal_32 --> -132($fp) + # PARAM param_a2i_at_Parse_s_0 --> 0($fp) + # local_a2i_at_Parse_internal_32 = PARAM param_a2i_at_Parse_s_0 + lw $t0, 0($fp) + sw $t0, -132($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_at_Parse_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -140($fp) + # ARG local_a2i_at_Parse_internal_34 + # LOCAL local_a2i_at_Parse_internal_34 --> -140($fp) + lw $t0, -140($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_Parse_internal_35 --> -144($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -144($fp) + # ARG local_a2i_at_Parse_internal_35 + # LOCAL local_a2i_at_Parse_internal_35 --> -144($fp) + lw $t0, -144($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_Parse_internal_32 --> -132($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # local_a2i_at_Parse_internal_33 = VCALL local_a2i_at_Parse_internal_32 substr + # Save new self pointer in $s1 + lw $s1, -132($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -136($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_17 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -148($fp) + # IF_ZERO local_a2i_at_Parse_internal_33 GOTO label_FALSE_161 + # IF_ZERO local_a2i_at_Parse_internal_33 GOTO label_FALSE_161 + lw $t0, -136($fp) + beq $t0, 0, label_FALSE_161 + # IF_ZERO local_a2i_at_Parse_internal_36 GOTO label_FALSE_161 + # IF_ZERO local_a2i_at_Parse_internal_36 GOTO label_FALSE_161 + lw $t0, -148($fp) + beq $t0, 0, label_FALSE_161 + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # Comparing -136($fp) type with String + la $v0, String + lw $a0, -136($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_STRING_164 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_STRING_164 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_STRING_164 + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # Comparing -136($fp) type with Bool + la $v0, Bool + lw $a0, -136($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_BY_VALUE_165 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_BY_VALUE_165 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_165 + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # Comparing -136($fp) type with Int + la $v0, Int + lw $a0, -136($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_BY_VALUE_165 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_BY_VALUE_165 + lw $t0, -128($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_165 + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) + # Load pointers and SUB + lw $a0, -136($fp) + lw $a1, -148($fp) + sub $a0, $a0, $a1 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_162 + # GOTO label_FALSE_161 + j label_FALSE_161 + label_COMPARE_BY_VALUE_165: + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) + lw $a0, -136($fp) + lw $a1, -148($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_162 + # GOTO label_FALSE_161 + j label_FALSE_161 + label_COMPARE_STRING_164: + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) + # Load strings for comparison + lw $v0, -136($fp) + lw $v1, -148($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_CONTINUE_166 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_CONTINUE_166 + lw $t0, -128($fp) + beq $t0, 0, label_CONTINUE_166 + # GOTO label_FALSE_161 + j label_FALSE_161 + label_CONTINUE_166: + # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) + # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) + # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -136($fp) + lw $v1, -148($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_167: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_168 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_167 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_168: + # Store result + sw $a2, -128($fp) + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 + # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 + lw $t0, -128($fp) + beq $t0, 0, label_TRUE_162 + label_FALSE_161: + # LOCAL local_a2i_at_Parse_internal_30 --> -124($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -124($fp) + # GOTO label_END_163 +j label_END_163 +label_TRUE_162: + # LOCAL local_a2i_at_Parse_internal_30 --> -124($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -124($fp) + label_END_163: +# LOCAL local_a2i_at_Parse_internal_28 --> -116($fp) +# LOCAL local_a2i_at_Parse_internal_30 --> -124($fp) +# Obtain value from -124($fp) +lw $v0, -124($fp) +lw $v0, 12($v0) +sw $v0, -116($fp) +# IF_ZERO local_a2i_at_Parse_internal_28 GOTO label_FALSEIF_159 +# IF_ZERO local_a2i_at_Parse_internal_28 GOTO label_FALSEIF_159 +lw $t0, -116($fp) +beq $t0, 0, label_FALSEIF_159 +# LOCAL local_a2i_at_Parse_internal_39 --> -160($fp) +# local_a2i_at_Parse_internal_39 = SELF +sw $s1, -160($fp) +# LOCAL local_a2i_at_Parse_internal_37 --> -152($fp) +# LOCAL local_a2i_at_Parse_internal_39 --> -160($fp) +# local_a2i_at_Parse_internal_37 = local_a2i_at_Parse_internal_39 +lw $t0, -160($fp) +sw $t0, -152($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_Parse_internal_40 --> -164($fp) +# PARAM param_a2i_at_Parse_s_0 --> 0($fp) +# local_a2i_at_Parse_internal_40 = PARAM param_a2i_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -164($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_Parse_internal_42 --> -172($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -172($fp) +# ARG local_a2i_at_Parse_internal_42 +# LOCAL local_a2i_at_Parse_internal_42 --> -172($fp) +lw $t0, -172($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_Parse_internal_44 --> -180($fp) +# PARAM param_a2i_at_Parse_s_0 --> 0($fp) +# local_a2i_at_Parse_internal_44 = PARAM param_a2i_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -180($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_at_Parse_internal_44 --> -180($fp) +# LOCAL local_a2i_at_Parse_internal_45 --> -184($fp) +# local_a2i_at_Parse_internal_45 = VCALL local_a2i_at_Parse_internal_44 length +# Save new self pointer in $s1 +lw $s1, -180($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 8($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -184($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_Parse_internal_46 --> -188($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -188($fp) +# LOCAL local_a2i_at_Parse_internal_43 --> -176($fp) +# LOCAL local_a2i_at_Parse_internal_45 --> -184($fp) +# LOCAL local_a2i_at_Parse_internal_46 --> -188($fp) +# local_a2i_at_Parse_internal_43 = local_a2i_at_Parse_internal_45 - local_a2i_at_Parse_internal_46 +lw $t1, -184($fp) +lw $t0, 12($t1) +lw $t1, -188($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -176($fp) +# ARG local_a2i_at_Parse_internal_43 +# LOCAL local_a2i_at_Parse_internal_43 --> -176($fp) +lw $t0, -176($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_Parse_internal_40 --> -164($fp) +# LOCAL local_a2i_at_Parse_internal_41 --> -168($fp) +# local_a2i_at_Parse_internal_41 = VCALL local_a2i_at_Parse_internal_40 substr +# Save new self pointer in $s1 +lw $s1, -164($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 48($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -168($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_a2i_at_Parse_internal_41 +# LOCAL local_a2i_at_Parse_internal_41 --> -168($fp) +lw $t0, -168($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_at_Parse_internal_37 --> -152($fp) +# LOCAL local_a2i_at_Parse_internal_38 --> -156($fp) +# local_a2i_at_Parse_internal_38 = VCALL local_a2i_at_Parse_internal_37 a2i +# Save new self pointer in $s1 +lw $s1, -152($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -156($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_at_Parse_internal_29 --> -120($fp) +# LOCAL local_a2i_at_Parse_internal_38 --> -156($fp) +# local_a2i_at_Parse_internal_29 = local_a2i_at_Parse_internal_38 +lw $t0, -156($fp) +sw $t0, -120($fp) +# GOTO label_ENDIF_160 +j label_ENDIF_160 +label_FALSEIF_159: + # LOCAL local_a2i_at_Parse_internal_49 --> -200($fp) + # local_a2i_at_Parse_internal_49 = SELF + sw $s1, -200($fp) + # LOCAL local_a2i_at_Parse_internal_47 --> -192($fp) + # LOCAL local_a2i_at_Parse_internal_49 --> -200($fp) + # local_a2i_at_Parse_internal_47 = local_a2i_at_Parse_internal_49 + lw $t0, -200($fp) + sw $t0, -192($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_a2i_at_Parse_s_0 + # PARAM param_a2i_at_Parse_s_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_at_Parse_internal_47 --> -192($fp) + # LOCAL local_a2i_at_Parse_internal_48 --> -196($fp) + # local_a2i_at_Parse_internal_48 = VCALL local_a2i_at_Parse_internal_47 a2i_aux + # Save new self pointer in $s1 + lw $s1, -192($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -196($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_at_Parse_internal_29 --> -120($fp) + # LOCAL local_a2i_at_Parse_internal_48 --> -196($fp) + # local_a2i_at_Parse_internal_29 = local_a2i_at_Parse_internal_48 + lw $t0, -196($fp) + sw $t0, -120($fp) + label_ENDIF_160: +# LOCAL local_a2i_at_Parse_internal_9 --> -40($fp) +# LOCAL local_a2i_at_Parse_internal_29 --> -120($fp) +# local_a2i_at_Parse_internal_9 = local_a2i_at_Parse_internal_29 +lw $t0, -120($fp) +sw $t0, -40($fp) +label_ENDIF_150: +# LOCAL local_a2i_at_Parse_internal_1 --> -8($fp) +# LOCAL local_a2i_at_Parse_internal_9 --> -40($fp) +# local_a2i_at_Parse_internal_1 = local_a2i_at_Parse_internal_9 +lw $t0, -40($fp) +sw $t0, -8($fp) +label_ENDIF_140: +# RETURN local_a2i_at_Parse_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_a2i_at_Parse. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 208 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_a2i_aux_at_Parse implementation. +# @Params: +# 0($fp) = param_a2i_aux_at_Parse_s_0 +function_a2i_aux_at_Parse: + # Allocate stack frame for function function_a2i_aux_at_Parse. + subu $sp, $sp, 240 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 240 + # LOCAL local_a2i_aux_at_Parse_int_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_a2i_aux_at_Parse_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_a2i_aux_at_Parse_int_0 --> -4($fp) + # LOCAL local_a2i_aux_at_Parse_internal_1 --> -8($fp) + # local_a2i_aux_at_Parse_int_0 = local_a2i_aux_at_Parse_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_a2i_aux_at_Parse_internal_3 --> -16($fp) + # PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) + # local_a2i_aux_at_Parse_internal_3 = PARAM param_a2i_aux_at_Parse_s_0 + lw $t0, 0($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_aux_at_Parse_internal_3 --> -16($fp) + # LOCAL local_a2i_aux_at_Parse_internal_4 --> -20($fp) + # local_a2i_aux_at_Parse_internal_4 = VCALL local_a2i_aux_at_Parse_internal_3 length + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 8($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + # LOCAL local_a2i_aux_at_Parse_internal_4 --> -20($fp) + # local_a2i_aux_at_Parse_j_2 = local_a2i_aux_at_Parse_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # LOCAL local_a2i_aux_at_Parse_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_internal_6 --> -28($fp) + # local_a2i_aux_at_Parse_i_5 = local_a2i_aux_at_Parse_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + label_WHILE_169: + # LOCAL local_a2i_aux_at_Parse_internal_8 --> -36($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + lw $a0, -24($fp) + lw $a1, -12($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -36($fp) + # IF_GREATER_ZERO local_a2i_aux_at_Parse_internal_8 GOTO label_FALSE_171 + # IF_GREATER_ZERO local_a2i_aux_at_Parse_internal_8 GOTO label_FALSE_171 + lw $t0, -36($fp) + bgt $t0, 0, label_FALSE_171 + # IF_ZERO local_a2i_aux_at_Parse_internal_8 GOTO label_FALSE_171 + # IF_ZERO local_a2i_aux_at_Parse_internal_8 GOTO label_FALSE_171 + lw $t0, -36($fp) + beq $t0, 0, label_FALSE_171 + # LOCAL local_a2i_aux_at_Parse_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_172 +j label_END_172 +label_FALSE_171: + # LOCAL local_a2i_aux_at_Parse_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_172: +# LOCAL local_a2i_aux_at_Parse_internal_7 --> -32($fp) +# LOCAL local_a2i_aux_at_Parse_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_7 GOTO label_WHILE_END_170 +# IF_ZERO local_a2i_aux_at_Parse_internal_7 GOTO label_WHILE_END_170 +lw $t0, -32($fp) +beq $t0, 0, label_WHILE_END_170 +# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_0 +sw $t0, 12($v0) +li $t0, 0 +sw $t0, 16($v0) +sw $v0, -40($fp) +# LOCAL local_a2i_aux_at_Parse_internal_10 --> -44($fp) +# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) +# local_a2i_aux_at_Parse_internal_10 = PARAM param_a2i_aux_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -44($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_a2i_aux_at_Parse_i_5 +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +lw $t0, -24($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_12 --> -52($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -52($fp) +# ARG local_a2i_aux_at_Parse_internal_12 +# LOCAL local_a2i_aux_at_Parse_internal_12 --> -52($fp) +lw $t0, -52($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_10 --> -44($fp) +# LOCAL local_a2i_aux_at_Parse_internal_11 --> -48($fp) +# local_a2i_aux_at_Parse_internal_11 = VCALL local_a2i_aux_at_Parse_internal_10 substr +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 48($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) +# LOCAL local_a2i_aux_at_Parse_internal_11 --> -48($fp) +# local_a2i_aux_at_Parse_c_9 = local_a2i_aux_at_Parse_internal_11 +lw $t0, -48($fp) +sw $t0, -40($fp) +# LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_18 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -72($fp) +# IF_ZERO local_a2i_aux_at_Parse_c_9 GOTO label_FALSE_175 +# IF_ZERO local_a2i_aux_at_Parse_c_9 GOTO label_FALSE_175 +lw $t0, -40($fp) +beq $t0, 0, label_FALSE_175 +# IF_ZERO local_a2i_aux_at_Parse_internal_17 GOTO label_FALSE_175 +# IF_ZERO local_a2i_aux_at_Parse_internal_17 GOTO label_FALSE_175 +lw $t0, -72($fp) +beq $t0, 0, label_FALSE_175 +# LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) +# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) +# Comparing -40($fp) type with String +la $v0, String +lw $a0, -40($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -68($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_STRING_178 +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_STRING_178 +lw $t0, -68($fp) +beq $t0, 0, label_COMPARE_STRING_178 +# LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) +# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) +# Comparing -40($fp) type with Bool +la $v0, Bool +lw $a0, -40($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -68($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_BY_VALUE_179 +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_BY_VALUE_179 +lw $t0, -68($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_179 +# LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) +# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) +# Comparing -40($fp) type with Int +la $v0, Int +lw $a0, -40($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -68($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_BY_VALUE_179 +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_BY_VALUE_179 +lw $t0, -68($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_179 +# LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) +# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) +# LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) +# Load pointers and SUB +lw $a0, -40($fp) +lw $a1, -72($fp) +sub $a0, $a0, $a1 +sw $a0, -68($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 +# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 +lw $t0, -68($fp) +beq $t0, 0, label_TRUE_176 +# GOTO label_FALSE_175 +j label_FALSE_175 +label_COMPARE_BY_VALUE_179: + # LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) + lw $a0, -40($fp) + lw $a1, -72($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -68($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 + # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 + lw $t0, -68($fp) + beq $t0, 0, label_TRUE_176 + # GOTO label_FALSE_175 + j label_FALSE_175 + label_COMPARE_STRING_178: + # LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) + # Load strings for comparison + lw $v0, -40($fp) + lw $v1, -72($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -68($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_CONTINUE_180 + # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_CONTINUE_180 + lw $t0, -68($fp) + beq $t0, 0, label_CONTINUE_180 + # GOTO label_FALSE_175 + j label_FALSE_175 + label_CONTINUE_180: + # LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -40($fp) + lw $v1, -72($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_181: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_182 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_181 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_182: + # Store result + sw $a2, -68($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 + # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 + lw $t0, -68($fp) + beq $t0, 0, label_TRUE_176 + label_FALSE_175: + # LOCAL local_a2i_aux_at_Parse_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -64($fp) + # GOTO label_END_177 +j label_END_177 +label_TRUE_176: + # LOCAL local_a2i_aux_at_Parse_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -64($fp) + label_END_177: +# LOCAL local_a2i_aux_at_Parse_internal_13 --> -56($fp) +# LOCAL local_a2i_aux_at_Parse_internal_15 --> -64($fp) +# Obtain value from -64($fp) +lw $v0, -64($fp) +lw $v0, 12($v0) +sw $v0, -56($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_13 GOTO label_FALSEIF_173 +# IF_ZERO local_a2i_aux_at_Parse_internal_13 GOTO label_FALSEIF_173 +lw $t0, -56($fp) +beq $t0, 0, label_FALSEIF_173 +# LOCAL local_a2i_aux_at_Parse_internal_18 --> -76($fp) +# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) +# local_a2i_aux_at_Parse_internal_18 = PARAM param_a2i_aux_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -76($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_21 --> -88($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -88($fp) +# LOCAL local_a2i_aux_at_Parse_internal_20 --> -84($fp) +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +# LOCAL local_a2i_aux_at_Parse_internal_21 --> -88($fp) +# local_a2i_aux_at_Parse_internal_20 = local_a2i_aux_at_Parse_i_5 + local_a2i_aux_at_Parse_internal_21 +lw $t1, -24($fp) +lw $t0, 12($t1) +lw $t1, -88($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -84($fp) +# ARG local_a2i_aux_at_Parse_internal_20 +# LOCAL local_a2i_aux_at_Parse_internal_20 --> -84($fp) +lw $t0, -84($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_24 --> -100($fp) +# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) +# local_a2i_aux_at_Parse_internal_24 = PARAM param_a2i_aux_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -100($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_24 --> -100($fp) +# LOCAL local_a2i_aux_at_Parse_internal_25 --> -104($fp) +# local_a2i_aux_at_Parse_internal_25 = VCALL local_a2i_aux_at_Parse_internal_24 length +# Save new self pointer in $s1 +lw $s1, -100($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 8($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -104($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_aux_at_Parse_internal_23 --> -96($fp) +# LOCAL local_a2i_aux_at_Parse_internal_25 --> -104($fp) +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +# local_a2i_aux_at_Parse_internal_23 = local_a2i_aux_at_Parse_internal_25 - local_a2i_aux_at_Parse_i_5 +lw $t1, -104($fp) +lw $t0, 12($t1) +lw $t1, -24($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -96($fp) +# LOCAL local_a2i_aux_at_Parse_internal_26 --> -108($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -108($fp) +# LOCAL local_a2i_aux_at_Parse_internal_22 --> -92($fp) +# LOCAL local_a2i_aux_at_Parse_internal_23 --> -96($fp) +# LOCAL local_a2i_aux_at_Parse_internal_26 --> -108($fp) +# local_a2i_aux_at_Parse_internal_22 = local_a2i_aux_at_Parse_internal_23 - local_a2i_aux_at_Parse_internal_26 +lw $t1, -96($fp) +lw $t0, 12($t1) +lw $t1, -108($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -92($fp) +# ARG local_a2i_aux_at_Parse_internal_22 +# LOCAL local_a2i_aux_at_Parse_internal_22 --> -92($fp) +lw $t0, -92($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_18 --> -76($fp) +# LOCAL local_a2i_aux_at_Parse_internal_19 --> -80($fp) +# local_a2i_aux_at_Parse_internal_19 = VCALL local_a2i_aux_at_Parse_internal_18 substr +# Save new self pointer in $s1 +lw $s1, -76($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 48($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -80($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_a2i_aux_at_Parse_internal_19 --> -80($fp) +lw $t0, -80($fp) +sw $t0, 16($s1) +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +# LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) +# local_a2i_aux_at_Parse_i_5 = local_a2i_aux_at_Parse_j_2 +lw $t0, -12($fp) +sw $t0, -24($fp) +# LOCAL local_a2i_aux_at_Parse_internal_14 --> -60($fp) +# local_a2i_aux_at_Parse_internal_14 = +# GOTO label_ENDIF_174 +j label_ENDIF_174 +label_FALSEIF_173: + # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_19 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -128($fp) + # IF_ZERO local_a2i_aux_at_Parse_c_9 GOTO label_FALSE_185 + # IF_ZERO local_a2i_aux_at_Parse_c_9 GOTO label_FALSE_185 + lw $t0, -40($fp) + beq $t0, 0, label_FALSE_185 + # IF_ZERO local_a2i_aux_at_Parse_internal_31 GOTO label_FALSE_185 + # IF_ZERO local_a2i_aux_at_Parse_internal_31 GOTO label_FALSE_185 + lw $t0, -128($fp) + beq $t0, 0, label_FALSE_185 + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # Comparing -40($fp) type with String + la $v0, String + lw $a0, -40($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_STRING_188 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_STRING_188 + lw $t0, -124($fp) + beq $t0, 0, label_COMPARE_STRING_188 + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # Comparing -40($fp) type with Bool + la $v0, Bool + lw $a0, -40($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_BY_VALUE_189 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_BY_VALUE_189 + lw $t0, -124($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_189 + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # Comparing -40($fp) type with Int + la $v0, Int + lw $a0, -40($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_BY_VALUE_189 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_BY_VALUE_189 + lw $t0, -124($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_189 + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) + # Load pointers and SUB + lw $a0, -40($fp) + lw $a1, -128($fp) + sub $a0, $a0, $a1 + sw $a0, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 + lw $t0, -124($fp) + beq $t0, 0, label_TRUE_186 + # GOTO label_FALSE_185 + j label_FALSE_185 + label_COMPARE_BY_VALUE_189: + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) + lw $a0, -40($fp) + lw $a1, -128($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 + lw $t0, -124($fp) + beq $t0, 0, label_TRUE_186 + # GOTO label_FALSE_185 + j label_FALSE_185 + label_COMPARE_STRING_188: + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) + # Load strings for comparison + lw $v0, -40($fp) + lw $v1, -128($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_CONTINUE_190 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_CONTINUE_190 + lw $t0, -124($fp) + beq $t0, 0, label_CONTINUE_190 + # GOTO label_FALSE_185 + j label_FALSE_185 + label_CONTINUE_190: + # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) + # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) + # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -40($fp) + lw $v1, -128($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_191: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_192 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_191 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_192: + # Store result + sw $a2, -124($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 + # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 + lw $t0, -124($fp) + beq $t0, 0, label_TRUE_186 + label_FALSE_185: + # LOCAL local_a2i_aux_at_Parse_internal_29 --> -120($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -120($fp) + # GOTO label_END_187 +j label_END_187 +label_TRUE_186: + # LOCAL local_a2i_aux_at_Parse_internal_29 --> -120($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -120($fp) + label_END_187: +# LOCAL local_a2i_aux_at_Parse_internal_27 --> -112($fp) +# LOCAL local_a2i_aux_at_Parse_internal_29 --> -120($fp) +# Obtain value from -120($fp) +lw $v0, -120($fp) +lw $v0, 12($v0) +sw $v0, -112($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_27 GOTO label_FALSEIF_183 +# IF_ZERO local_a2i_aux_at_Parse_internal_27 GOTO label_FALSEIF_183 +lw $t0, -112($fp) +beq $t0, 0, label_FALSEIF_183 +# LOCAL local_a2i_aux_at_Parse_internal_32 --> -132($fp) +# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) +# local_a2i_aux_at_Parse_internal_32 = PARAM param_a2i_aux_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -132($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_35 --> -144($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -144($fp) +# LOCAL local_a2i_aux_at_Parse_internal_34 --> -140($fp) +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +# LOCAL local_a2i_aux_at_Parse_internal_35 --> -144($fp) +# local_a2i_aux_at_Parse_internal_34 = local_a2i_aux_at_Parse_i_5 + local_a2i_aux_at_Parse_internal_35 +lw $t1, -24($fp) +lw $t0, 12($t1) +lw $t1, -144($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -140($fp) +# ARG local_a2i_aux_at_Parse_internal_34 +# LOCAL local_a2i_aux_at_Parse_internal_34 --> -140($fp) +lw $t0, -140($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_38 --> -156($fp) +# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) +# local_a2i_aux_at_Parse_internal_38 = PARAM param_a2i_aux_at_Parse_s_0 +lw $t0, 0($fp) +sw $t0, -156($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_38 --> -156($fp) +# LOCAL local_a2i_aux_at_Parse_internal_39 --> -160($fp) +# local_a2i_aux_at_Parse_internal_39 = VCALL local_a2i_aux_at_Parse_internal_38 length +# Save new self pointer in $s1 +lw $s1, -156($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 8($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -160($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_a2i_aux_at_Parse_internal_37 --> -152($fp) +# LOCAL local_a2i_aux_at_Parse_internal_39 --> -160($fp) +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +# local_a2i_aux_at_Parse_internal_37 = local_a2i_aux_at_Parse_internal_39 - local_a2i_aux_at_Parse_i_5 +lw $t1, -160($fp) +lw $t0, 12($t1) +lw $t1, -24($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -152($fp) +# LOCAL local_a2i_aux_at_Parse_internal_40 --> -164($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -164($fp) +# LOCAL local_a2i_aux_at_Parse_internal_36 --> -148($fp) +# LOCAL local_a2i_aux_at_Parse_internal_37 --> -152($fp) +# LOCAL local_a2i_aux_at_Parse_internal_40 --> -164($fp) +# local_a2i_aux_at_Parse_internal_36 = local_a2i_aux_at_Parse_internal_37 - local_a2i_aux_at_Parse_internal_40 +lw $t1, -152($fp) +lw $t0, 12($t1) +lw $t1, -164($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -148($fp) +# ARG local_a2i_aux_at_Parse_internal_36 +# LOCAL local_a2i_aux_at_Parse_internal_36 --> -148($fp) +lw $t0, -148($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_a2i_aux_at_Parse_internal_32 --> -132($fp) +# LOCAL local_a2i_aux_at_Parse_internal_33 --> -136($fp) +# local_a2i_aux_at_Parse_internal_33 = VCALL local_a2i_aux_at_Parse_internal_32 substr +# Save new self pointer in $s1 +lw $s1, -132($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 48($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -136($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_a2i_aux_at_Parse_internal_33 --> -136($fp) +lw $t0, -136($fp) +sw $t0, 16($s1) +# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) +# LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) +# local_a2i_aux_at_Parse_i_5 = local_a2i_aux_at_Parse_j_2 +lw $t0, -12($fp) +sw $t0, -24($fp) +# LOCAL local_a2i_aux_at_Parse_internal_28 --> -116($fp) +# local_a2i_aux_at_Parse_internal_28 = +# GOTO label_ENDIF_184 +j label_ENDIF_184 +label_FALSEIF_183: + # LOCAL local_a2i_aux_at_Parse_internal_43 --> -176($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 10 + sw $t0, 12($v0) + sw $v0, -176($fp) + # LOCAL local_a2i_aux_at_Parse_internal_42 --> -172($fp) + # LOCAL local_a2i_aux_at_Parse_int_0 --> -4($fp) + # LOCAL local_a2i_aux_at_Parse_internal_43 --> -176($fp) + # local_a2i_aux_at_Parse_internal_42 = local_a2i_aux_at_Parse_int_0 * local_a2i_aux_at_Parse_internal_43 + lw $t1, -4($fp) + lw $t0, 12($t1) + lw $t1, -176($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -172($fp) + # LOCAL local_a2i_aux_at_Parse_internal_46 --> -188($fp) + # local_a2i_aux_at_Parse_internal_46 = SELF + sw $s1, -188($fp) + # LOCAL local_a2i_aux_at_Parse_internal_44 --> -180($fp) + # LOCAL local_a2i_aux_at_Parse_internal_46 --> -188($fp) + # local_a2i_aux_at_Parse_internal_44 = local_a2i_aux_at_Parse_internal_46 + lw $t0, -188($fp) + sw $t0, -180($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_a2i_aux_at_Parse_internal_47 --> -192($fp) + # PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) + # local_a2i_aux_at_Parse_internal_47 = PARAM param_a2i_aux_at_Parse_s_0 + lw $t0, 0($fp) + sw $t0, -192($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_a2i_aux_at_Parse_i_5 + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_aux_at_Parse_internal_49 --> -200($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -200($fp) + # ARG local_a2i_aux_at_Parse_internal_49 + # LOCAL local_a2i_aux_at_Parse_internal_49 --> -200($fp) + lw $t0, -200($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_aux_at_Parse_internal_47 --> -192($fp) + # LOCAL local_a2i_aux_at_Parse_internal_48 --> -196($fp) + # local_a2i_aux_at_Parse_internal_48 = VCALL local_a2i_aux_at_Parse_internal_47 substr + # Save new self pointer in $s1 + lw $s1, -192($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -196($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_a2i_aux_at_Parse_internal_48 + # LOCAL local_a2i_aux_at_Parse_internal_48 --> -196($fp) + lw $t0, -196($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_a2i_aux_at_Parse_internal_44 --> -180($fp) + # LOCAL local_a2i_aux_at_Parse_internal_45 --> -184($fp) + # local_a2i_aux_at_Parse_internal_45 = VCALL local_a2i_aux_at_Parse_internal_44 c2i + # Save new self pointer in $s1 + lw $s1, -180($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -184($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_a2i_aux_at_Parse_internal_41 --> -168($fp) + # LOCAL local_a2i_aux_at_Parse_internal_42 --> -172($fp) + # LOCAL local_a2i_aux_at_Parse_internal_45 --> -184($fp) + # local_a2i_aux_at_Parse_internal_41 = local_a2i_aux_at_Parse_internal_42 + local_a2i_aux_at_Parse_internal_45 + lw $t1, -172($fp) + lw $t0, 12($t1) + lw $t1, -184($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -168($fp) + # LOCAL local_a2i_aux_at_Parse_int_0 --> -4($fp) + # LOCAL local_a2i_aux_at_Parse_internal_41 --> -168($fp) + # local_a2i_aux_at_Parse_int_0 = local_a2i_aux_at_Parse_internal_41 + lw $t0, -168($fp) + sw $t0, -4($fp) + # LOCAL local_a2i_aux_at_Parse_internal_51 --> -208($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -208($fp) + # LOCAL local_a2i_aux_at_Parse_internal_50 --> -204($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_internal_51 --> -208($fp) + # local_a2i_aux_at_Parse_internal_50 = local_a2i_aux_at_Parse_i_5 + local_a2i_aux_at_Parse_internal_51 + lw $t1, -24($fp) + lw $t0, 12($t1) + lw $t1, -208($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -204($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_internal_50 --> -204($fp) + # local_a2i_aux_at_Parse_i_5 = local_a2i_aux_at_Parse_internal_50 + lw $t0, -204($fp) + sw $t0, -24($fp) + # IF_ZERO local_a2i_aux_at_Parse_i_5 GOTO label_FALSE_195 + # IF_ZERO local_a2i_aux_at_Parse_i_5 GOTO label_FALSE_195 + lw $t0, -24($fp) + beq $t0, 0, label_FALSE_195 + # IF_ZERO local_a2i_aux_at_Parse_j_2 GOTO label_FALSE_195 + # IF_ZERO local_a2i_aux_at_Parse_j_2 GOTO label_FALSE_195 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_195 + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # Comparing -24($fp) type with String + la $v0, String + lw $a0, -24($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_STRING_198 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_STRING_198 + lw $t0, -224($fp) + beq $t0, 0, label_COMPARE_STRING_198 + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # Comparing -24($fp) type with Bool + la $v0, Bool + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_BY_VALUE_199 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_BY_VALUE_199 + lw $t0, -224($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_199 + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # Comparing -24($fp) type with Int + la $v0, Int + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_BY_VALUE_199 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_BY_VALUE_199 + lw $t0, -224($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_199 + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + # Load pointers and SUB + lw $a0, -24($fp) + lw $a1, -12($fp) + sub $a0, $a0, $a1 + sw $a0, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 + lw $t0, -224($fp) + beq $t0, 0, label_TRUE_196 + # GOTO label_FALSE_195 + j label_FALSE_195 + label_COMPARE_BY_VALUE_199: + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + lw $a0, -24($fp) + lw $a1, -12($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 + lw $t0, -224($fp) + beq $t0, 0, label_TRUE_196 + # GOTO label_FALSE_195 + j label_FALSE_195 + label_COMPARE_STRING_198: + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -12($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_CONTINUE_200 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_CONTINUE_200 + lw $t0, -224($fp) + beq $t0, 0, label_CONTINUE_200 + # GOTO label_FALSE_195 + j label_FALSE_195 + label_CONTINUE_200: + # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) + # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) + # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -12($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_201: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_202 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_201 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_202: + # Store result + sw $a2, -224($fp) + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 + # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 + lw $t0, -224($fp) + beq $t0, 0, label_TRUE_196 + label_FALSE_195: + # LOCAL local_a2i_aux_at_Parse_internal_54 --> -220($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -220($fp) + # GOTO label_END_197 +j label_END_197 +label_TRUE_196: + # LOCAL local_a2i_aux_at_Parse_internal_54 --> -220($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -220($fp) + label_END_197: +# LOCAL local_a2i_aux_at_Parse_internal_52 --> -212($fp) +# LOCAL local_a2i_aux_at_Parse_internal_54 --> -220($fp) +# Obtain value from -220($fp) +lw $v0, -220($fp) +lw $v0, 12($v0) +sw $v0, -212($fp) +# IF_ZERO local_a2i_aux_at_Parse_internal_52 GOTO label_FALSEIF_193 +# IF_ZERO local_a2i_aux_at_Parse_internal_52 GOTO label_FALSEIF_193 +lw $t0, -212($fp) +beq $t0, 0, label_FALSEIF_193 +# LOCAL local_a2i_aux_at_Parse_internal_56 --> -228($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_20 +sw $t0, 12($v0) +li $t0, 0 +sw $t0, 16($v0) +sw $v0, -228($fp) +# +# LOCAL local_a2i_aux_at_Parse_internal_56 --> -228($fp) +lw $t0, -228($fp) +sw $t0, 16($s1) +# LOCAL local_a2i_aux_at_Parse_internal_53 --> -216($fp) +# local_a2i_aux_at_Parse_internal_53 = +# GOTO label_ENDIF_194 +j label_ENDIF_194 +label_FALSEIF_193: + # LOCAL local_a2i_aux_at_Parse_internal_57 --> -232($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_21 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -232($fp) + # LOCAL local_a2i_aux_at_Parse_internal_53 --> -216($fp) + # LOCAL local_a2i_aux_at_Parse_internal_57 --> -232($fp) + # local_a2i_aux_at_Parse_internal_53 = local_a2i_aux_at_Parse_internal_57 + lw $t0, -232($fp) + sw $t0, -216($fp) + label_ENDIF_194: +# LOCAL local_a2i_aux_at_Parse_internal_28 --> -116($fp) +# LOCAL local_a2i_aux_at_Parse_internal_53 --> -216($fp) +# local_a2i_aux_at_Parse_internal_28 = local_a2i_aux_at_Parse_internal_53 +lw $t0, -216($fp) +sw $t0, -116($fp) +label_ENDIF_184: +# LOCAL local_a2i_aux_at_Parse_internal_14 --> -60($fp) +# LOCAL local_a2i_aux_at_Parse_internal_28 --> -116($fp) +# local_a2i_aux_at_Parse_internal_14 = local_a2i_aux_at_Parse_internal_28 +lw $t0, -116($fp) +sw $t0, -60($fp) +label_ENDIF_174: +# GOTO label_WHILE_169 +j label_WHILE_169 +label_WHILE_END_170: + # RETURN local_a2i_aux_at_Parse_int_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_a2i_aux_at_Parse. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 240 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# __Main__attrib__g__init implementation. +# @Params: +__Main__attrib__g__init: + # Allocate stack frame for function __Main__attrib__g__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # local_ttrib__g__init_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # local_ttrib__g__init_internal_1 = local_ttrib__g__init_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) + # local_ttrib__g__init_internal_2 = VCALL local_ttrib__g__init_internal_1 read_input + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 116($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_ttrib__g__init_internal_2 + lw $v0, -12($fp) + # Deallocate stack frame for function __Main__attrib__g__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_main_at_Main_internal_2 = GETATTRIBUTE g Main + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + lw $t0, 20($s1) + sw $t0, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 print_V + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 24($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_main_at_Main_internal_5 = GETATTRIBUTE g Main + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t0, 20($s1) + sw $t0, -24($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 print_E + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 80($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_4 + lw $v0, -20($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __VList__attrib__car__init implementation. +# @Params: +__VList__attrib__car__init: + # Allocate stack frame for function __VList__attrib__car__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __VList__attrib__car__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_VList implementation. +# @Params: +function_isNil_at_VList: + # Allocate stack frame for function function_isNil_at_VList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_VList_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_isNil_at_VList_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_VList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_head_at_VList implementation. +# @Params: +function_head_at_VList: + # Allocate stack frame for function function_head_at_VList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_head_at_VList_internal_2 --> -12($fp) + # local_head_at_VList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_head_at_VList_internal_0 --> -4($fp) + # LOCAL local_head_at_VList_internal_2 --> -12($fp) + # local_head_at_VList_internal_0 = local_head_at_VList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_head_at_VList_internal_0 --> -4($fp) + # LOCAL local_head_at_VList_internal_1 --> -8($fp) + # local_head_at_VList_internal_1 = VCALL local_head_at_VList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_head_at_VList_internal_3 = GETATTRIBUTE car VList + # LOCAL local_head_at_VList_internal_3 --> -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) + # RETURN local_head_at_VList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_head_at_VList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_tail_at_VList implementation. +# @Params: +function_tail_at_VList: + # Allocate stack frame for function function_tail_at_VList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_tail_at_VList_internal_2 --> -12($fp) + # local_tail_at_VList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_tail_at_VList_internal_0 --> -4($fp) + # LOCAL local_tail_at_VList_internal_2 --> -12($fp) + # local_tail_at_VList_internal_0 = local_tail_at_VList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_tail_at_VList_internal_0 --> -4($fp) + # LOCAL local_tail_at_VList_internal_1 --> -8($fp) + # local_tail_at_VList_internal_1 = VCALL local_tail_at_VList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_tail_at_VList_internal_3 --> -16($fp) + # local_tail_at_VList_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_tail_at_VList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_tail_at_VList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cons_at_VList implementation. +# @Params: +# 0($fp) = param_cons_at_VList_v_0 +function_cons_at_VList: + # Allocate stack frame for function function_cons_at_VList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cons_at_VList_internal_2 --> -12($fp) + # local_cons_at_VList_internal_2 = ALLOCATE VCons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, VCons + sw $t0, 12($v0) + li $t0, 5 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, VCons_start + sw $t0, 4($v0) + # Load type offset + li $t0, 40 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __VList__attrib__car__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __VCons__attrib__cdr__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -12($fp) + # LOCAL local_cons_at_VList_internal_0 --> -4($fp) + # LOCAL local_cons_at_VList_internal_2 --> -12($fp) + # local_cons_at_VList_internal_0 = local_cons_at_VList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cons_at_VList_v_0 + # PARAM param_cons_at_VList_v_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cons_at_VList_internal_3 --> -16($fp) + # local_cons_at_VList_internal_3 = SELF + sw $s1, -16($fp) + # ARG local_cons_at_VList_internal_3 + # LOCAL local_cons_at_VList_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cons_at_VList_internal_0 --> -4($fp) + # LOCAL local_cons_at_VList_internal_1 --> -8($fp) + # local_cons_at_VList_internal_1 = VCALL local_cons_at_VList_internal_0 init + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 112($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_cons_at_VList_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_cons_at_VList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_at_VList implementation. +# @Params: +function_print_at_VList: + # Allocate stack frame for function function_print_at_VList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_print_at_VList_internal_2 --> -12($fp) + # local_print_at_VList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_at_VList_internal_0 --> -4($fp) + # LOCAL local_print_at_VList_internal_2 --> -12($fp) + # local_print_at_VList_internal_0 = local_print_at_VList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_VList_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_22 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_print_at_VList_internal_3 + # LOCAL local_print_at_VList_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_VList_internal_0 --> -4($fp) + # LOCAL local_print_at_VList_internal_1 --> -8($fp) + # local_print_at_VList_internal_1 = VCALL local_print_at_VList_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 84($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_at_VList_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_print_at_VList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __VCons__attrib__cdr__init implementation. +# @Params: +__VCons__attrib__cdr__init: + # Allocate stack frame for function __VCons__attrib__cdr__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __VCons__attrib__cdr__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_VCons implementation. +# @Params: +function_isNil_at_VCons: + # Allocate stack frame for function function_isNil_at_VCons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_VCons_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_isNil_at_VCons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_VCons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_head_at_VCons implementation. +# @Params: +function_head_at_VCons: + # Allocate stack frame for function function_head_at_VCons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_head_at_VCons_internal_0 = GETATTRIBUTE car VCons + # LOCAL local_head_at_VCons_internal_0 --> -4($fp) + lw $t0, 12($s1) + sw $t0, -4($fp) + # RETURN local_head_at_VCons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_head_at_VCons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_tail_at_VCons implementation. +# @Params: +function_tail_at_VCons: + # Allocate stack frame for function function_tail_at_VCons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_tail_at_VCons_internal_0 = GETATTRIBUTE cdr VCons + # LOCAL local_tail_at_VCons_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_tail_at_VCons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_tail_at_VCons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_VCons implementation. +# @Params: +# 0($fp) = param_init_at_VCons_v_0 +# 4($fp) = param_init_at_VCons_rest_1 +function_init_at_VCons: + # Allocate stack frame for function function_init_at_VCons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_VCons_v_0 --> 4($fp) + lw $t0, 4($fp) + sw $t0, 12($s1) + # + # PARAM param_init_at_VCons_rest_1 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 16($s1) + # LOCAL local_init_at_VCons_internal_0 --> -4($fp) + # local_init_at_VCons_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_VCons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_VCons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_print_at_VCons implementation. +# @Params: +function_print_at_VCons: + # Allocate stack frame for function function_print_at_VCons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_print_at_VCons_internal_2 = GETATTRIBUTE car VCons + # LOCAL local_print_at_VCons_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # LOCAL local_print_at_VCons_internal_0 --> -4($fp) + # LOCAL local_print_at_VCons_internal_2 --> -12($fp) + # local_print_at_VCons_internal_0 = local_print_at_VCons_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_VCons_internal_0 --> -4($fp) + # LOCAL local_print_at_VCons_internal_1 --> -8($fp) + # local_print_at_VCons_internal_1 = VCALL local_print_at_VCons_internal_0 print + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 88($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_print_at_VCons_internal_5 = GETATTRIBUTE cdr VCons + # LOCAL local_print_at_VCons_internal_5 --> -24($fp) + lw $t0, 16($s1) + sw $t0, -24($fp) + # LOCAL local_print_at_VCons_internal_3 --> -16($fp) + # LOCAL local_print_at_VCons_internal_5 --> -24($fp) + # local_print_at_VCons_internal_3 = local_print_at_VCons_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_VCons_internal_3 --> -16($fp) + # LOCAL local_print_at_VCons_internal_4 --> -20($fp) + # local_print_at_VCons_internal_4 = VCALL local_print_at_VCons_internal_3 print + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 88($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_at_VCons_internal_4 + lw $v0, -20($fp) + # Deallocate stack frame for function function_print_at_VCons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __EList__attrib__car__init implementation. +# @Params: +__EList__attrib__car__init: + # Allocate stack frame for function __EList__attrib__car__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __EList__attrib__car__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_EList implementation. +# @Params: +function_isNil_at_EList: + # Allocate stack frame for function function_isNil_at_EList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_EList_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_isNil_at_EList_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_EList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_head_at_EList implementation. +# @Params: +function_head_at_EList: + # Allocate stack frame for function function_head_at_EList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_head_at_EList_internal_2 --> -12($fp) + # local_head_at_EList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_head_at_EList_internal_0 --> -4($fp) + # LOCAL local_head_at_EList_internal_2 --> -12($fp) + # local_head_at_EList_internal_0 = local_head_at_EList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_head_at_EList_internal_0 --> -4($fp) + # LOCAL local_head_at_EList_internal_1 --> -8($fp) + # local_head_at_EList_internal_1 = VCALL local_head_at_EList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_head_at_EList_internal_3 = GETATTRIBUTE car EList + # LOCAL local_head_at_EList_internal_3 --> -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) + # RETURN local_head_at_EList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_head_at_EList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_tail_at_EList implementation. +# @Params: +function_tail_at_EList: + # Allocate stack frame for function function_tail_at_EList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_tail_at_EList_internal_2 --> -12($fp) + # local_tail_at_EList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_tail_at_EList_internal_0 --> -4($fp) + # LOCAL local_tail_at_EList_internal_2 --> -12($fp) + # local_tail_at_EList_internal_0 = local_tail_at_EList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_tail_at_EList_internal_0 --> -4($fp) + # LOCAL local_tail_at_EList_internal_1 --> -8($fp) + # local_tail_at_EList_internal_1 = VCALL local_tail_at_EList_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_tail_at_EList_internal_3 --> -16($fp) + # local_tail_at_EList_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_tail_at_EList_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_tail_at_EList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cons_at_EList implementation. +# @Params: +# 0($fp) = param_cons_at_EList_e_0 +function_cons_at_EList: + # Allocate stack frame for function function_cons_at_EList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cons_at_EList_internal_2 --> -12($fp) + # local_cons_at_EList_internal_2 = ALLOCATE ECons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, ECons + sw $t0, 12($v0) + li $t0, 5 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, ECons_start + sw $t0, 4($v0) + # Load type offset + li $t0, 48 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __EList__attrib__car__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __ECons__attrib__cdr__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -12($fp) + # LOCAL local_cons_at_EList_internal_0 --> -4($fp) + # LOCAL local_cons_at_EList_internal_2 --> -12($fp) + # local_cons_at_EList_internal_0 = local_cons_at_EList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cons_at_EList_e_0 + # PARAM param_cons_at_EList_e_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cons_at_EList_internal_3 --> -16($fp) + # local_cons_at_EList_internal_3 = SELF + sw $s1, -16($fp) + # ARG local_cons_at_EList_internal_3 + # LOCAL local_cons_at_EList_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cons_at_EList_internal_0 --> -4($fp) + # LOCAL local_cons_at_EList_internal_1 --> -8($fp) + # local_cons_at_EList_internal_1 = VCALL local_cons_at_EList_internal_0 init + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 112($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_cons_at_EList_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_cons_at_EList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_append_at_EList implementation. +# @Params: +# 0($fp) = param_append_at_EList_l_0 +function_append_at_EList: +# Allocate stack frame for function function_append_at_EList. +subu $sp, $sp, 68 +sw $ra, 4($sp) +sw $fp, 0($sp) +addu $fp, $sp, 68 +# LOCAL local_append_at_EList_internal_4 --> -20($fp) +# local_append_at_EList_internal_4 = SELF +sw $s1, -20($fp) +# LOCAL local_append_at_EList_internal_2 --> -12($fp) +# LOCAL local_append_at_EList_internal_4 --> -20($fp) +# local_append_at_EList_internal_2 = local_append_at_EList_internal_4 +lw $t0, -20($fp) +sw $t0, -12($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_append_at_EList_internal_2 --> -12($fp) +# LOCAL local_append_at_EList_internal_3 --> -16($fp) +# local_append_at_EList_internal_3 = VCALL local_append_at_EList_internal_2 isNil +# Save new self pointer in $s1 +lw $s1, -12($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 44($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -16($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_append_at_EList_internal_0 --> -4($fp) +# LOCAL local_append_at_EList_internal_3 --> -16($fp) +# Obtain value from -16($fp) +lw $v0, -16($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_append_at_EList_internal_0 GOTO label_FALSEIF_203 +# IF_ZERO local_append_at_EList_internal_0 GOTO label_FALSEIF_203 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_203 +# LOCAL local_append_at_EList_internal_1 --> -8($fp) +# PARAM param_append_at_EList_l_0 --> 0($fp) +# local_append_at_EList_internal_1 = PARAM param_append_at_EList_l_0 +lw $t0, 0($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_204 +j label_ENDIF_204 +label_FALSEIF_203: + # LOCAL local_append_at_EList_internal_11 --> -48($fp) + # local_append_at_EList_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_append_at_EList_internal_9 --> -40($fp) + # LOCAL local_append_at_EList_internal_11 --> -48($fp) + # local_append_at_EList_internal_9 = local_append_at_EList_internal_11 + lw $t0, -48($fp) + sw $t0, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_append_at_EList_internal_9 --> -40($fp) + # LOCAL local_append_at_EList_internal_10 --> -44($fp) + # local_append_at_EList_internal_10 = VCALL local_append_at_EList_internal_9 tail + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 68($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_append_at_EList_internal_7 --> -32($fp) + # LOCAL local_append_at_EList_internal_10 --> -44($fp) + # local_append_at_EList_internal_7 = local_append_at_EList_internal_10 + lw $t0, -44($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_append_at_EList_l_0 + # PARAM param_append_at_EList_l_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_append_at_EList_internal_7 --> -32($fp) + # LOCAL local_append_at_EList_internal_8 --> -36($fp) + # local_append_at_EList_internal_8 = VCALL local_append_at_EList_internal_7 append + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 72($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_append_at_EList_internal_5 --> -24($fp) + # LOCAL local_append_at_EList_internal_8 --> -36($fp) + # local_append_at_EList_internal_5 = local_append_at_EList_internal_8 + lw $t0, -36($fp) + sw $t0, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_append_at_EList_internal_14 --> -60($fp) + # local_append_at_EList_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_append_at_EList_internal_12 --> -52($fp) + # LOCAL local_append_at_EList_internal_14 --> -60($fp) + # local_append_at_EList_internal_12 = local_append_at_EList_internal_14 + lw $t0, -60($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_append_at_EList_internal_12 --> -52($fp) + # LOCAL local_append_at_EList_internal_13 --> -56($fp) + # local_append_at_EList_internal_13 = VCALL local_append_at_EList_internal_12 head + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_append_at_EList_internal_13 + # LOCAL local_append_at_EList_internal_13 --> -56($fp) + lw $t0, -56($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_append_at_EList_internal_5 --> -24($fp) + # LOCAL local_append_at_EList_internal_6 --> -28($fp) + # local_append_at_EList_internal_6 = VCALL local_append_at_EList_internal_5 cons + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_append_at_EList_internal_1 --> -8($fp) + # LOCAL local_append_at_EList_internal_6 --> -28($fp) + # local_append_at_EList_internal_1 = local_append_at_EList_internal_6 + lw $t0, -28($fp) + sw $t0, -8($fp) + label_ENDIF_204: +# RETURN local_append_at_EList_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_append_at_EList. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 68 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_print_at_EList implementation. +# @Params: +function_print_at_EList: + # Allocate stack frame for function function_print_at_EList. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_print_at_EList_internal_2 --> -12($fp) + # local_print_at_EList_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_at_EList_internal_0 --> -4($fp) + # LOCAL local_print_at_EList_internal_2 --> -12($fp) + # local_print_at_EList_internal_0 = local_print_at_EList_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_EList_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_23 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_print_at_EList_internal_3 + # LOCAL local_print_at_EList_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_EList_internal_0 --> -4($fp) + # LOCAL local_print_at_EList_internal_1 --> -8($fp) + # local_print_at_EList_internal_1 = VCALL local_print_at_EList_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 84($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_at_EList_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_print_at_EList. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __ECons__attrib__cdr__init implementation. +# @Params: +__ECons__attrib__cdr__init: + # Allocate stack frame for function __ECons__attrib__cdr__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __ECons__attrib__cdr__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_ECons implementation. +# @Params: +function_isNil_at_ECons: + # Allocate stack frame for function function_isNil_at_ECons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_ECons_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_isNil_at_ECons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_ECons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_head_at_ECons implementation. +# @Params: +function_head_at_ECons: + # Allocate stack frame for function function_head_at_ECons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_head_at_ECons_internal_0 = GETATTRIBUTE car ECons + # LOCAL local_head_at_ECons_internal_0 --> -4($fp) + lw $t0, 12($s1) + sw $t0, -4($fp) + # RETURN local_head_at_ECons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_head_at_ECons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_tail_at_ECons implementation. +# @Params: +function_tail_at_ECons: + # Allocate stack frame for function function_tail_at_ECons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_tail_at_ECons_internal_0 = GETATTRIBUTE cdr ECons + # LOCAL local_tail_at_ECons_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_tail_at_ECons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_tail_at_ECons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_ECons implementation. +# @Params: +# 0($fp) = param_init_at_ECons_e_0 +# 4($fp) = param_init_at_ECons_rest_1 +function_init_at_ECons: + # Allocate stack frame for function function_init_at_ECons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_ECons_e_0 --> 4($fp) + lw $t0, 4($fp) + sw $t0, 12($s1) + # + # PARAM param_init_at_ECons_rest_1 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 16($s1) + # LOCAL local_init_at_ECons_internal_0 --> -4($fp) + # local_init_at_ECons_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_ECons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_ECons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_print_at_ECons implementation. +# @Params: +function_print_at_ECons: + # Allocate stack frame for function function_print_at_ECons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_print_at_ECons_internal_2 = GETATTRIBUTE car ECons + # LOCAL local_print_at_ECons_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # LOCAL local_print_at_ECons_internal_0 --> -4($fp) + # LOCAL local_print_at_ECons_internal_2 --> -12($fp) + # local_print_at_ECons_internal_0 = local_print_at_ECons_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_ECons_internal_0 --> -4($fp) + # LOCAL local_print_at_ECons_internal_1 --> -8($fp) + # local_print_at_ECons_internal_1 = VCALL local_print_at_ECons_internal_0 print + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 88($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_print_at_ECons_internal_5 = GETATTRIBUTE cdr ECons + # LOCAL local_print_at_ECons_internal_5 --> -24($fp) + lw $t0, 16($s1) + sw $t0, -24($fp) + # LOCAL local_print_at_ECons_internal_3 --> -16($fp) + # LOCAL local_print_at_ECons_internal_5 --> -24($fp) + # local_print_at_ECons_internal_3 = local_print_at_ECons_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_ECons_internal_3 --> -16($fp) + # LOCAL local_print_at_ECons_internal_4 --> -20($fp) + # local_print_at_ECons_internal_4 = VCALL local_print_at_ECons_internal_3 print + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 88($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_at_ECons_internal_4 + lw $v0, -20($fp) + # Deallocate stack frame for function function_print_at_ECons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Edge__attrib__from__init implementation. +# @Params: +__Edge__attrib__from__init: + # Allocate stack frame for function __Edge__attrib__from__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__from__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__from__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Edge__attrib__from__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Edge__attrib__to__init implementation. +# @Params: +__Edge__attrib__to__init: + # Allocate stack frame for function __Edge__attrib__to__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__to__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__to__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Edge__attrib__to__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Edge__attrib__weight__init implementation. +# @Params: +__Edge__attrib__weight__init: + # Allocate stack frame for function __Edge__attrib__weight__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__weight__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__weight__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Edge__attrib__weight__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Edge implementation. +# @Params: +# 0($fp) = param_init_at_Edge_f_0 +# 4($fp) = param_init_at_Edge_t_1 +# 8($fp) = param_init_at_Edge_w_2 +function_init_at_Edge: + # Allocate stack frame for function function_init_at_Edge. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_Edge_f_0 --> 8($fp) + lw $t0, 8($fp) + sw $t0, 12($s1) + # + # PARAM param_init_at_Edge_t_1 --> 4($fp) + lw $t0, 4($fp) + sw $t0, 16($s1) + # + # PARAM param_init_at_Edge_w_2 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 20($s1) + # LOCAL local_init_at_Edge_internal_0 --> -4($fp) + # local_init_at_Edge_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_Edge_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_Edge. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 12 + jr $ra + # Function END + + +# function_print_at_Edge implementation. +# @Params: +function_print_at_Edge: + # Allocate stack frame for function function_print_at_Edge. + subu $sp, $sp, 104 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 104 + # LOCAL local_print_at_Edge_internal_2 --> -12($fp) + # local_print_at_Edge_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_at_Edge_internal_0 --> -4($fp) + # LOCAL local_print_at_Edge_internal_2 --> -12($fp) + # local_print_at_Edge_internal_0 = local_print_at_Edge_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Edge_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_24 + sw $t0, 12($v0) + li $t0, 2 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_print_at_Edge_internal_3 + # LOCAL local_print_at_Edge_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Edge_internal_0 --> -4($fp) + # LOCAL local_print_at_Edge_internal_1 --> -8($fp) + # local_print_at_Edge_internal_1 = VCALL local_print_at_Edge_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 84($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Edge_internal_6 --> -28($fp) + # local_print_at_Edge_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_print_at_Edge_internal_4 --> -20($fp) + # LOCAL local_print_at_Edge_internal_6 --> -28($fp) + # local_print_at_Edge_internal_4 = local_print_at_Edge_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Edge_internal_7 = GETATTRIBUTE from Edge + # LOCAL local_print_at_Edge_internal_7 --> -32($fp) + lw $t0, 12($s1) + sw $t0, -32($fp) + # ARG local_print_at_Edge_internal_7 + # LOCAL local_print_at_Edge_internal_7 --> -32($fp) + lw $t0, -32($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Edge_internal_4 --> -20($fp) + # LOCAL local_print_at_Edge_internal_5 --> -24($fp) + # local_print_at_Edge_internal_5 = VCALL local_print_at_Edge_internal_4 out_int + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 108($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Edge_internal_10 --> -44($fp) + # local_print_at_Edge_internal_10 = SELF + sw $s1, -44($fp) + # LOCAL local_print_at_Edge_internal_8 --> -36($fp) + # LOCAL local_print_at_Edge_internal_10 --> -44($fp) + # local_print_at_Edge_internal_8 = local_print_at_Edge_internal_10 + lw $t0, -44($fp) + sw $t0, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Edge_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_25 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -48($fp) + # ARG local_print_at_Edge_internal_11 + # LOCAL local_print_at_Edge_internal_11 --> -48($fp) + lw $t0, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Edge_internal_8 --> -36($fp) + # LOCAL local_print_at_Edge_internal_9 --> -40($fp) + # local_print_at_Edge_internal_9 = VCALL local_print_at_Edge_internal_8 out_string + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 84($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Edge_internal_14 --> -60($fp) + # local_print_at_Edge_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_print_at_Edge_internal_12 --> -52($fp) + # LOCAL local_print_at_Edge_internal_14 --> -60($fp) + # local_print_at_Edge_internal_12 = local_print_at_Edge_internal_14 + lw $t0, -60($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Edge_internal_15 = GETATTRIBUTE to Edge + # LOCAL local_print_at_Edge_internal_15 --> -64($fp) + lw $t0, 16($s1) + sw $t0, -64($fp) + # ARG local_print_at_Edge_internal_15 + # LOCAL local_print_at_Edge_internal_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Edge_internal_12 --> -52($fp) + # LOCAL local_print_at_Edge_internal_13 --> -56($fp) + # local_print_at_Edge_internal_13 = VCALL local_print_at_Edge_internal_12 out_int + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 108($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Edge_internal_18 --> -76($fp) + # local_print_at_Edge_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_print_at_Edge_internal_16 --> -68($fp) + # LOCAL local_print_at_Edge_internal_18 --> -76($fp) + # local_print_at_Edge_internal_16 = local_print_at_Edge_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Edge_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_26 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -80($fp) + # ARG local_print_at_Edge_internal_19 + # LOCAL local_print_at_Edge_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Edge_internal_16 --> -68($fp) + # LOCAL local_print_at_Edge_internal_17 --> -72($fp) + # local_print_at_Edge_internal_17 = VCALL local_print_at_Edge_internal_16 out_string + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 84($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Edge_internal_22 --> -92($fp) + # local_print_at_Edge_internal_22 = SELF + sw $s1, -92($fp) + # LOCAL local_print_at_Edge_internal_20 --> -84($fp) + # LOCAL local_print_at_Edge_internal_22 --> -92($fp) + # local_print_at_Edge_internal_20 = local_print_at_Edge_internal_22 + lw $t0, -92($fp) + sw $t0, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Edge_internal_23 = GETATTRIBUTE weight Edge + # LOCAL local_print_at_Edge_internal_23 --> -96($fp) + lw $t0, 20($s1) + sw $t0, -96($fp) + # ARG local_print_at_Edge_internal_23 + # LOCAL local_print_at_Edge_internal_23 --> -96($fp) + lw $t0, -96($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Edge_internal_20 --> -84($fp) + # LOCAL local_print_at_Edge_internal_21 --> -88($fp) + # local_print_at_Edge_internal_21 = VCALL local_print_at_Edge_internal_20 out_int + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 108($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_at_Edge_internal_21 + lw $v0, -88($fp) + # Deallocate stack frame for function function_print_at_Edge. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 104 + jr $ra + # Function END + + +# __Vertice__attrib__num__init implementation. +# @Params: +__Vertice__attrib__num__init: + # Allocate stack frame for function __Vertice__attrib__num__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local___attrib__num__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local___attrib__num__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Vertice__attrib__num__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Vertice__attrib__out__init implementation. +# @Params: +__Vertice__attrib__out__init: + # Allocate stack frame for function __Vertice__attrib__out__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local___attrib__out__init_internal_1 --> -8($fp) + # local___attrib__out__init_internal_1 = ALLOCATE EList + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, EList + sw $t0, 12($v0) + li $t0, 5 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, EList_start + sw $t0, 4($v0) + # Load type offset + li $t0, 44 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __EList__attrib__car__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # RETURN local___attrib__out__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Vertice__attrib__out__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_outgoing_at_Vertice implementation. +# @Params: +function_outgoing_at_Vertice: + # Allocate stack frame for function function_outgoing_at_Vertice. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_outgoing_at_Vertice_internal_0 = GETATTRIBUTE out Vertice + # LOCAL local_outgoing_at_Vertice_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_outgoing_at_Vertice_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_outgoing_at_Vertice. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_number_at_Vertice implementation. +# @Params: +function_number_at_Vertice: + # Allocate stack frame for function function_number_at_Vertice. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_number_at_Vertice_internal_0 = GETATTRIBUTE num Vertice + # LOCAL local_number_at_Vertice_internal_0 --> -4($fp) + lw $t0, 12($s1) + sw $t0, -4($fp) + # RETURN local_number_at_Vertice_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_number_at_Vertice. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Vertice implementation. +# @Params: +# 0($fp) = param_init_at_Vertice_n_0 +function_init_at_Vertice: + # Allocate stack frame for function function_init_at_Vertice. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_Vertice_n_0 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 12($s1) + # LOCAL local_init_at_Vertice_internal_0 --> -4($fp) + # local_init_at_Vertice_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_Vertice_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_Vertice. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_add_out_at_Vertice implementation. +# @Params: +# 0($fp) = param_add_out_at_Vertice_s_0 +function_add_out_at_Vertice: + # Allocate stack frame for function function_add_out_at_Vertice. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_add_out_at_Vertice_internal_2 = GETATTRIBUTE out Vertice + # LOCAL local_add_out_at_Vertice_internal_2 --> -12($fp) + lw $t0, 16($s1) + sw $t0, -12($fp) + # LOCAL local_add_out_at_Vertice_internal_0 --> -4($fp) + # LOCAL local_add_out_at_Vertice_internal_2 --> -12($fp) + # local_add_out_at_Vertice_internal_0 = local_add_out_at_Vertice_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_add_out_at_Vertice_s_0 + # PARAM param_add_out_at_Vertice_s_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_add_out_at_Vertice_internal_0 --> -4($fp) + # LOCAL local_add_out_at_Vertice_internal_1 --> -8($fp) + # local_add_out_at_Vertice_internal_1 = VCALL local_add_out_at_Vertice_internal_0 cons + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 104($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_add_out_at_Vertice_internal_1 --> -8($fp) + lw $t0, -8($fp) + sw $t0, 16($s1) + # LOCAL local_add_out_at_Vertice_internal_3 --> -16($fp) + # local_add_out_at_Vertice_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_add_out_at_Vertice_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_add_out_at_Vertice. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_at_Vertice implementation. +# @Params: +function_print_at_Vertice: + # Allocate stack frame for function function_print_at_Vertice. + subu $sp, $sp, 36 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 36 + # LOCAL local_print_at_Vertice_internal_2 --> -12($fp) + # local_print_at_Vertice_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_at_Vertice_internal_0 --> -4($fp) + # LOCAL local_print_at_Vertice_internal_2 --> -12($fp) + # local_print_at_Vertice_internal_0 = local_print_at_Vertice_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Vertice_internal_3 = GETATTRIBUTE num Vertice + # LOCAL local_print_at_Vertice_internal_3 --> -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) + # ARG local_print_at_Vertice_internal_3 + # LOCAL local_print_at_Vertice_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Vertice_internal_0 --> -4($fp) + # LOCAL local_print_at_Vertice_internal_1 --> -8($fp) + # local_print_at_Vertice_internal_1 = VCALL local_print_at_Vertice_internal_0 out_int + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 108($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_print_at_Vertice_internal_6 = GETATTRIBUTE out Vertice + # LOCAL local_print_at_Vertice_internal_6 --> -28($fp) + lw $t0, 16($s1) + sw $t0, -28($fp) + # LOCAL local_print_at_Vertice_internal_4 --> -20($fp) + # LOCAL local_print_at_Vertice_internal_6 --> -28($fp) + # local_print_at_Vertice_internal_4 = local_print_at_Vertice_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Vertice_internal_4 --> -20($fp) + # LOCAL local_print_at_Vertice_internal_5 --> -24($fp) + # local_print_at_Vertice_internal_5 = VCALL local_print_at_Vertice_internal_4 print + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 88($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_at_Vertice_internal_5 + lw $v0, -24($fp) + # Deallocate stack frame for function function_print_at_Vertice. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 36 + jr $ra + # Function END + diff --git a/tests/codegen/hairyscary.mips b/tests/codegen/hairyscary.mips new file mode 100644 index 00000000..c2106f7d --- /dev/null +++ b/tests/codegen/hairyscary.mips @@ -0,0 +1,3624 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:05 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +Main: .asciiz "Main" +# Function END +Bazz: .asciiz "Bazz" +# Function END +Foo: .asciiz "Foo" +# Function END +Razz: .asciiz "Razz" +# Function END +Bar: .asciiz "Bar" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, dummy, function_out_string_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, dummy, function_out_int_at_IO, function_copy_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_type_name_at_Object, dummy, function_substr_at_String, function_concat_at_String, dummy, dummy, dummy, dummy, function_abort_at_Object, function_length_at_String, dummy, function_copy_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, function_main_at_Main, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +# **** VTABLE for type Bazz **** +Bazz_vtable: .word function_type_name_at_Object, function_printh_at_Bazz, dummy, dummy, dummy, function_out_string_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, dummy, function_out_int_at_IO, function_copy_at_Object, function_doh_at_Bazz +# Function END +# + + +# **** Type RECORD for type Bazz **** +Bazz_start: + Bazz_vtable_pointer: .word Bazz_vtable + # Function END +Bazz_end: +# + + +# **** VTABLE for type Foo **** +Foo_vtable: .word function_type_name_at_Object, function_printh_at_Bazz, dummy, dummy, dummy, function_out_string_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, dummy, function_out_int_at_IO, function_copy_at_Object, function_doh_at_Foo +# Function END +# + + +# **** Type RECORD for type Foo **** +Foo_start: + Foo_vtable_pointer: .word Foo_vtable + # Function END +Foo_end: +# + + +# **** VTABLE for type Razz **** +Razz_vtable: .word function_type_name_at_Object, function_printh_at_Bazz, dummy, dummy, dummy, function_out_string_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, dummy, function_out_int_at_IO, function_copy_at_Object, function_doh_at_Foo +# Function END +# + + +# **** Type RECORD for type Razz **** +Razz_start: + Razz_vtable_pointer: .word Razz_vtable + # Function END +Razz_end: +# + + +# **** VTABLE for type Bar **** +Bar_vtable: .word function_type_name_at_Object, function_printh_at_Bazz, dummy, dummy, dummy, function_out_string_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, dummy, function_out_int_at_IO, function_copy_at_Object, function_doh_at_Foo +# Function END +# + + +# **** Type RECORD for type Bar **** +Bar_start: + Bar_vtable_pointer: .word Bar_vtable + # Function END +Bar_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, -1, 1, 2, 3, 4 +Object__TDT: .word 1, 0, 1, 1, 1, 1, 2, 3, 4, 5 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1, -1 +Bazz__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 2, 3 +Foo__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, 1, 2 +Razz__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, 1 +Bar__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "do nothing" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + lb $t3, 0($t1) + beqz $t3, end_loop + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + end_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 28 bytes of memory + li $a0, 28 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__a__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__b__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__c__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__d__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 16($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__a__init implementation. +# @Params: +__Main__attrib__a__init: + # Allocate stack frame for function __Main__attrib__a__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__a__init_internal_1 --> -8($fp) + # local_ttrib__a__init_internal_1 = ALLOCATE Bazz + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bazz + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 24 bytes of memory + li $a0, 24 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bazz_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # RETURN local_ttrib__a__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Main__attrib__a__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__b__init implementation. +# @Params: +__Main__attrib__b__init: + # Allocate stack frame for function __Main__attrib__b__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__b__init_internal_1 --> -8($fp) + # local_ttrib__b__init_internal_1 = ALLOCATE Foo + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Foo + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 32 bytes of memory + li $a0, 32 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Foo_start + sw $t0, 4($v0) + # Load type offset + li $t0, 28 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # RETURN local_ttrib__b__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Main__attrib__b__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__c__init implementation. +# @Params: +__Main__attrib__c__init: + # Allocate stack frame for function __Main__attrib__c__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__c__init_internal_1 --> -8($fp) + # local_ttrib__c__init_internal_1 = ALLOCATE Razz + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Razz + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 40 bytes of memory + li $a0, 40 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Razz_start + sw $t0, 4($v0) + # Load type offset + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 32($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 36($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # RETURN local_ttrib__c__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Main__attrib__c__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__d__init implementation. +# @Params: +__Main__attrib__d__init: + # Allocate stack frame for function __Main__attrib__d__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__d__init_internal_1 --> -8($fp) + # local_ttrib__d__init_internal_1 = ALLOCATE Bar + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bar + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 48 bytes of memory + li $a0, 48 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bar_start + sw $t0, 4($v0) + # Load type offset + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 32($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 36($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bar__attrib__c__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 40($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bar__attrib__d__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 44($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # RETURN local_ttrib__d__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Main__attrib__d__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 10 + sw $t0, 16($v0) + sw $v0, -4($fp) + # RETURN local_main_at_Main_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Bazz__attrib__h__init implementation. +# @Params: +__Bazz__attrib__h__init: + # Allocate stack frame for function __Bazz__attrib__h__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__h__init_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_ttrib__h__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Bazz__attrib__h__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Bazz__attrib__g__init implementation. +# @Params: +__Bazz__attrib__g__init: + # Allocate stack frame for function __Bazz__attrib__g__init. + subu $sp, $sp, 64 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 64 + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # local_ttrib__g__init_internal_1 = SELF + sw $s1, -8($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) + # local_ttrib__g__init_internal_2 = TYPEOF local_ttrib__g__init_internal_1 + lw $t0, -8($fp) + # Load pointer to type offset + lw $t1, 8($t0) + sw $t1, -12($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # local_ttrib__g__init_internal_5 = 13 + li $t0, 13 + sw $t0, -24($fp) + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) + # Load TDT pointer to type Bazz + la $t0, Bazz__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_Not_min0_1 + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # local_ttrib__g__init_internal_5 = local_ttrib__g__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + label_Not_min0_1: + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) + # Load TDT pointer to type Razz + la $t0, Razz__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_Not_min1_2 + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # local_ttrib__g__init_internal_5 = local_ttrib__g__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + label_Not_min1_2: + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) + # Load TDT pointer to type Foo + la $t0, Foo__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_Not_min2_3 + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # local_ttrib__g__init_internal_5 = local_ttrib__g__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + label_Not_min2_3: + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) + # Load TDT pointer to type Bar + la $t0, Bar__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_Not_min3_4 + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # local_ttrib__g__init_internal_5 = local_ttrib__g__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + label_Not_min3_4: + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # local_ttrib__g__init_internal_6 = 13 + li $t0, 13 + sw $t0, -28($fp) + # LOCAL local_ttrib__g__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # Load pointers and SUB + lw $a0, -28($fp) + lw $a1, -24($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_ttrib__g__init_internal_3 GOTO label_ERROR_5 + # IF_ZERO local_ttrib__g__init_internal_3 GOTO label_ERROR_5 + lw $t0, -16($fp) + beq $t0, 0, label_ERROR_5 + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) + # Load TDT pointer to type Bazz + la $t0, Bazz__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_NEXT0_7 + # LOCAL local_ttrib__g__init_n_7 --> -32($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # local_ttrib__g__init_n_7 = local_ttrib__g__init_internal_1 + lw $t0, -8($fp) + sw $t0, -32($fp) + # LOCAL local_ttrib__g__init_internal_8 --> -36($fp) + # local_ttrib__g__init_internal_8 = ALLOCATE Foo + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Foo + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 32 bytes of memory + li $a0, 32 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Foo_start + sw $t0, 4($v0) + # Load type offset + li $t0, 28 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -36($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_8 --> -36($fp) + # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_8 + lw $t0, -36($fp) + sw $t0, -20($fp) + # GOTO label_END_6 +j label_END_6 +label_NEXT0_7: + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) + # Load TDT pointer to type Razz + la $t0, Razz__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_NEXT1_8 + # LOCAL local_ttrib__g__init_n_9 --> -40($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # local_ttrib__g__init_n_9 = local_ttrib__g__init_internal_1 + lw $t0, -8($fp) + sw $t0, -40($fp) + # LOCAL local_ttrib__g__init_internal_10 --> -44($fp) + # local_ttrib__g__init_internal_10 = ALLOCATE Bar + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bar + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 48 bytes of memory + li $a0, 48 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bar_start + sw $t0, 4($v0) + # Load type offset + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 32($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 36($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bar__attrib__c__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 40($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bar__attrib__d__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 44($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -44($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_10 --> -44($fp) + # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_10 + lw $t0, -44($fp) + sw $t0, -20($fp) + # GOTO label_END_6 +j label_END_6 +label_NEXT1_8: + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) + # Load TDT pointer to type Foo + la $t0, Foo__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_NEXT2_9 + # LOCAL local_ttrib__g__init_n_11 --> -48($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # local_ttrib__g__init_n_11 = local_ttrib__g__init_internal_1 + lw $t0, -8($fp) + sw $t0, -48($fp) + # LOCAL local_ttrib__g__init_internal_12 --> -52($fp) + # local_ttrib__g__init_internal_12 = ALLOCATE Razz + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Razz + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 40 bytes of memory + li $a0, 40 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Razz_start + sw $t0, 4($v0) + # Load type offset + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 32($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 36($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -52($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_internal_12 --> -52($fp) + # local_ttrib__g__init_internal_4 = local_ttrib__g__init_internal_12 + lw $t0, -52($fp) + sw $t0, -20($fp) + # GOTO label_END_6 +j label_END_6 +label_NEXT2_9: + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) + # Load TDT pointer to type Bar + la $t0, Bar__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__g__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_NEXT3_10 + # LOCAL local_ttrib__g__init_n_13 --> -56($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + # local_ttrib__g__init_n_13 = local_ttrib__g__init_internal_1 + lw $t0, -8($fp) + sw $t0, -56($fp) + # LOCAL local_ttrib__g__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__g__init_n_13 --> -56($fp) + # local_ttrib__g__init_internal_4 = local_ttrib__g__init_n_13 + lw $t0, -56($fp) + sw $t0, -20($fp) + # GOTO label_END_6 +j label_END_6 +label_NEXT3_10: + label_ERROR_5: + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + lw $t0, 0($s1) + sw $t0, -8($fp) + # LOCAL local_ttrib__g__init_internal_1 --> -8($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -8($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + label_END_6: +# RETURN local_ttrib__g__init_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function __Bazz__attrib__g__init. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 64 +jr $ra +# Function END + + +# __Bazz__attrib__i__init implementation. +# @Params: +__Bazz__attrib__i__init: + # Allocate stack frame for function __Bazz__attrib__i__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__i__init_internal_3 --> -16($fp) + # local_ttrib__i__init_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_ttrib__i__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__i__init_internal_3 --> -16($fp) + # local_ttrib__i__init_internal_1 = local_ttrib__i__init_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__i__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__i__init_internal_2 --> -12($fp) + # local_ttrib__i__init_internal_2 = VCALL local_ttrib__i__init_internal_1 printh + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_ttrib__i__init_internal_2 + lw $v0, -12($fp) + # Deallocate stack frame for function __Bazz__attrib__i__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_printh_at_Bazz implementation. +# @Params: +function_printh_at_Bazz: + # Allocate stack frame for function function_printh_at_Bazz. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_printh_at_Bazz_internal_2 --> -12($fp) + # local_printh_at_Bazz_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_printh_at_Bazz_internal_0 --> -4($fp) + # LOCAL local_printh_at_Bazz_internal_2 --> -12($fp) + # local_printh_at_Bazz_internal_0 = local_printh_at_Bazz_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_printh_at_Bazz_internal_3 = GETATTRIBUTE h Bazz + # LOCAL local_printh_at_Bazz_internal_3 --> -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) + # ARG local_printh_at_Bazz_internal_3 + # LOCAL local_printh_at_Bazz_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_printh_at_Bazz_internal_0 --> -4($fp) + # LOCAL local_printh_at_Bazz_internal_1 --> -8($fp) + # local_printh_at_Bazz_internal_1 = VCALL local_printh_at_Bazz_internal_0 out_int + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_printh_at_Bazz_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # RETURN local_printh_at_Bazz_internal_4 + lw $v0, -20($fp) + # Deallocate stack frame for function function_printh_at_Bazz. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_doh_at_Bazz implementation. +# @Params: +function_doh_at_Bazz: + # Allocate stack frame for function function_doh_at_Bazz. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_doh_at_Bazz_i_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # local_doh_at_Bazz_internal_1 = GETATTRIBUTE h Bazz + # LOCAL local_doh_at_Bazz_internal_1 --> -8($fp) + lw $t0, 12($s1) + sw $t0, -8($fp) + # LOCAL local_doh_at_Bazz_i_0 --> -4($fp) + # LOCAL local_doh_at_Bazz_internal_1 --> -8($fp) + # local_doh_at_Bazz_i_0 = local_doh_at_Bazz_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # local_doh_at_Bazz_internal_3 = GETATTRIBUTE h Bazz + # LOCAL local_doh_at_Bazz_internal_3 --> -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) + # LOCAL local_doh_at_Bazz_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -20($fp) + # LOCAL local_doh_at_Bazz_internal_2 --> -12($fp) + # LOCAL local_doh_at_Bazz_internal_3 --> -16($fp) + # LOCAL local_doh_at_Bazz_internal_4 --> -20($fp) + # local_doh_at_Bazz_internal_2 = local_doh_at_Bazz_internal_3 + local_doh_at_Bazz_internal_4 + lw $t1, -16($fp) + lw $t0, 12($t1) + lw $t1, -20($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -12($fp) + # + # LOCAL local_doh_at_Bazz_internal_2 --> -12($fp) + lw $t0, -12($fp) + sw $t0, 12($s1) + # RETURN local_doh_at_Bazz_i_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_doh_at_Bazz. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Foo__attrib__a__init implementation. +# @Params: +__Foo__attrib__a__init: + # Allocate stack frame for function __Foo__attrib__a__init. + subu $sp, $sp, 56 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 56 + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # local_trib__a__init_internal_1 = SELF + sw $s1, -8($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # LOCAL local_trib__a__init_internal_2 --> -12($fp) + # local_trib__a__init_internal_2 = TYPEOF local_trib__a__init_internal_1 + lw $t0, -8($fp) + # Load pointer to type offset + lw $t1, 8($t0) + sw $t1, -12($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) + # local_trib__a__init_internal_5 = 13 + li $t0, 13 + sw $t0, -24($fp) + # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # LOCAL local_trib__a__init_internal_2 --> -12($fp) + # Load TDT pointer to type Razz + la $t0, Razz__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_Not_min0_11 + # LOCAL local_trib__a__init_internal_5 --> -24($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # local_trib__a__init_internal_5 = local_trib__a__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + label_Not_min0_11: + # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # LOCAL local_trib__a__init_internal_2 --> -12($fp) + # Load TDT pointer to type Foo + la $t0, Foo__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_Not_min1_12 + # LOCAL local_trib__a__init_internal_5 --> -24($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # local_trib__a__init_internal_5 = local_trib__a__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + label_Not_min1_12: + # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # LOCAL local_trib__a__init_internal_2 --> -12($fp) + # Load TDT pointer to type Bar + la $t0, Bar__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_Not_min2_13 + # LOCAL local_trib__a__init_internal_5 --> -24($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # local_trib__a__init_internal_5 = local_trib__a__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + label_Not_min2_13: + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # local_trib__a__init_internal_6 = 13 + li $t0, 13 + sw $t0, -28($fp) + # LOCAL local_trib__a__init_internal_3 --> -16($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) + # Load pointers and SUB + lw $a0, -28($fp) + lw $a1, -24($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_trib__a__init_internal_3 GOTO label_ERROR_14 + # IF_ZERO local_trib__a__init_internal_3 GOTO label_ERROR_14 + lw $t0, -16($fp) + beq $t0, 0, label_ERROR_14 + # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # LOCAL local_trib__a__init_internal_2 --> -12($fp) + # Load TDT pointer to type Razz + la $t0, Razz__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_NEXT0_16 + # LOCAL local_trib__a__init_n_7 --> -32($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # local_trib__a__init_n_7 = local_trib__a__init_internal_1 + lw $t0, -8($fp) + sw $t0, -32($fp) + # LOCAL local_trib__a__init_internal_8 --> -36($fp) + # local_trib__a__init_internal_8 = ALLOCATE Bar + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bar + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 48 bytes of memory + li $a0, 48 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bar_start + sw $t0, 4($v0) + # Load type offset + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 32($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 36($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bar__attrib__c__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 40($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bar__attrib__d__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 44($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -36($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_8 --> -36($fp) + # local_trib__a__init_internal_4 = local_trib__a__init_internal_8 + lw $t0, -36($fp) + sw $t0, -20($fp) + # GOTO label_END_15 +j label_END_15 +label_NEXT0_16: + # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # LOCAL local_trib__a__init_internal_2 --> -12($fp) + # Load TDT pointer to type Foo + la $t0, Foo__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_NEXT1_17 + # LOCAL local_trib__a__init_n_9 --> -40($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # local_trib__a__init_n_9 = local_trib__a__init_internal_1 + lw $t0, -8($fp) + sw $t0, -40($fp) + # LOCAL local_trib__a__init_internal_10 --> -44($fp) + # local_trib__a__init_internal_10 = ALLOCATE Razz + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Razz + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 40 bytes of memory + li $a0, 40 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Razz_start + sw $t0, 4($v0) + # Load type offset + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 32($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 36($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -44($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_internal_10 --> -44($fp) + # local_trib__a__init_internal_4 = local_trib__a__init_internal_10 + lw $t0, -44($fp) + sw $t0, -20($fp) + # GOTO label_END_15 +j label_END_15 +label_NEXT1_17: + # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # LOCAL local_trib__a__init_internal_2 --> -12($fp) + # Load TDT pointer to type Bar + la $t0, Bar__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_trib__a__init_internal_6 --> -28($fp) + # LOCAL local_trib__a__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_NEXT2_18 + # LOCAL local_trib__a__init_n_11 --> -48($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + # local_trib__a__init_n_11 = local_trib__a__init_internal_1 + lw $t0, -8($fp) + sw $t0, -48($fp) + # LOCAL local_trib__a__init_internal_4 --> -20($fp) + # LOCAL local_trib__a__init_n_11 --> -48($fp) + # local_trib__a__init_internal_4 = local_trib__a__init_n_11 + lw $t0, -48($fp) + sw $t0, -20($fp) + # GOTO label_END_15 +j label_END_15 +label_NEXT2_18: + label_ERROR_14: + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + lw $t0, 0($s1) + sw $t0, -8($fp) + # LOCAL local_trib__a__init_internal_1 --> -8($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -8($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + label_END_15: +# RETURN local_trib__a__init_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function __Foo__attrib__a__init. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 56 +jr $ra +# Function END + + +# __Foo__attrib__b__init implementation. +# @Params: +__Foo__attrib__b__init: + # Allocate stack frame for function __Foo__attrib__b__init. + subu $sp, $sp, 72 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 72 + # local_trib__b__init_internal_6 = GETATTRIBUTE a Foo + # LOCAL local_trib__b__init_internal_6 --> -28($fp) + lw $t0, 24($s1) + sw $t0, -28($fp) + # LOCAL local_trib__b__init_internal_4 --> -20($fp) + # LOCAL local_trib__b__init_internal_6 --> -28($fp) + # local_trib__b__init_internal_4 = local_trib__b__init_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__b__init_internal_4 --> -20($fp) + # LOCAL local_trib__b__init_internal_5 --> -24($fp) + # local_trib__b__init_internal_5 = VCALL local_trib__b__init_internal_4 doh + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_trib__b__init_internal_9 = GETATTRIBUTE g Foo + # LOCAL local_trib__b__init_internal_9 --> -40($fp) + lw $t0, 16($s1) + sw $t0, -40($fp) + # LOCAL local_trib__b__init_internal_7 --> -32($fp) + # LOCAL local_trib__b__init_internal_9 --> -40($fp) + # local_trib__b__init_internal_7 = local_trib__b__init_internal_9 + lw $t0, -40($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__b__init_internal_7 --> -32($fp) + # LOCAL local_trib__b__init_internal_8 --> -36($fp) + # local_trib__b__init_internal_8 = VCALL local_trib__b__init_internal_7 doh + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_trib__b__init_internal_3 --> -16($fp) + # LOCAL local_trib__b__init_internal_5 --> -24($fp) + # LOCAL local_trib__b__init_internal_8 --> -36($fp) + # local_trib__b__init_internal_3 = local_trib__b__init_internal_5 + local_trib__b__init_internal_8 + lw $t1, -24($fp) + lw $t0, 12($t1) + lw $t1, -36($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -16($fp) + # LOCAL local_trib__b__init_internal_12 --> -52($fp) + # local_trib__b__init_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_trib__b__init_internal_10 --> -44($fp) + # LOCAL local_trib__b__init_internal_12 --> -52($fp) + # local_trib__b__init_internal_10 = local_trib__b__init_internal_12 + lw $t0, -52($fp) + sw $t0, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__b__init_internal_10 --> -44($fp) + # LOCAL local_trib__b__init_internal_11 --> -48($fp) + # local_trib__b__init_internal_11 = VCALL local_trib__b__init_internal_10 doh + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_trib__b__init_internal_2 --> -12($fp) + # LOCAL local_trib__b__init_internal_3 --> -16($fp) + # LOCAL local_trib__b__init_internal_11 --> -48($fp) + # local_trib__b__init_internal_2 = local_trib__b__init_internal_3 + local_trib__b__init_internal_11 + lw $t1, -16($fp) + lw $t0, 12($t1) + lw $t1, -48($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_trib__b__init_internal_15 --> -64($fp) + # local_trib__b__init_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_trib__b__init_internal_13 --> -56($fp) + # LOCAL local_trib__b__init_internal_15 --> -64($fp) + # local_trib__b__init_internal_13 = local_trib__b__init_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__b__init_internal_13 --> -56($fp) + # LOCAL local_trib__b__init_internal_14 --> -60($fp) + # local_trib__b__init_internal_14 = VCALL local_trib__b__init_internal_13 printh + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_trib__b__init_internal_1 --> -8($fp) + # LOCAL local_trib__b__init_internal_2 --> -12($fp) + # LOCAL local_trib__b__init_internal_14 --> -60($fp) + # local_trib__b__init_internal_1 = local_trib__b__init_internal_2 + local_trib__b__init_internal_14 + lw $t1, -12($fp) + lw $t0, 12($t1) + lw $t1, -60($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_trib__b__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Foo__attrib__b__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 72 + jr $ra + # Function END + + +# function_doh_at_Foo implementation. +# @Params: +function_doh_at_Foo: + # Allocate stack frame for function function_doh_at_Foo. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_doh_at_Foo_i_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # local_doh_at_Foo_internal_1 = GETATTRIBUTE h Foo + # LOCAL local_doh_at_Foo_internal_1 --> -8($fp) + lw $t0, 12($s1) + sw $t0, -8($fp) + # LOCAL local_doh_at_Foo_i_0 --> -4($fp) + # LOCAL local_doh_at_Foo_internal_1 --> -8($fp) + # local_doh_at_Foo_i_0 = local_doh_at_Foo_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # local_doh_at_Foo_internal_3 = GETATTRIBUTE h Foo + # LOCAL local_doh_at_Foo_internal_3 --> -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) + # LOCAL local_doh_at_Foo_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 2 + sw $t0, 12($v0) + sw $v0, -20($fp) + # LOCAL local_doh_at_Foo_internal_2 --> -12($fp) + # LOCAL local_doh_at_Foo_internal_3 --> -16($fp) + # LOCAL local_doh_at_Foo_internal_4 --> -20($fp) + # local_doh_at_Foo_internal_2 = local_doh_at_Foo_internal_3 + local_doh_at_Foo_internal_4 + lw $t1, -16($fp) + lw $t0, 12($t1) + lw $t1, -20($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -12($fp) + # + # LOCAL local_doh_at_Foo_internal_2 --> -12($fp) + lw $t0, -12($fp) + sw $t0, 12($s1) + # RETURN local_doh_at_Foo_i_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_doh_at_Foo. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Razz__attrib__e__init implementation. +# @Params: +__Razz__attrib__e__init: + # Allocate stack frame for function __Razz__attrib__e__init. + subu $sp, $sp, 48 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 48 + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # local_ttrib__e__init_internal_1 = SELF + sw $s1, -8($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) + # local_ttrib__e__init_internal_2 = TYPEOF local_ttrib__e__init_internal_1 + lw $t0, -8($fp) + # Load pointer to type offset + lw $t1, 8($t0) + sw $t1, -12($fp) + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) + # local_ttrib__e__init_internal_5 = 13 + li $t0, 13 + sw $t0, -24($fp) + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) + # Load TDT pointer to type Razz + la $t0, Razz__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_Not_min0_19 + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # local_ttrib__e__init_internal_5 = local_ttrib__e__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + label_Not_min0_19: + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) + # Load TDT pointer to type Bar + la $t0, Bar__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_Not_min1_20 + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # local_ttrib__e__init_internal_5 = local_ttrib__e__init_internal_6 + lw $t0, -28($fp) + sw $t0, -24($fp) + label_Not_min1_20: + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # local_ttrib__e__init_internal_6 = 13 + li $t0, 13 + sw $t0, -28($fp) + # LOCAL local_ttrib__e__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) + # Load pointers and SUB + lw $a0, -28($fp) + lw $a1, -24($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_ttrib__e__init_internal_3 GOTO label_ERROR_21 + # IF_ZERO local_ttrib__e__init_internal_3 GOTO label_ERROR_21 + lw $t0, -16($fp) + beq $t0, 0, label_ERROR_21 + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) + # Load TDT pointer to type Razz + la $t0, Razz__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_NEXT0_23 + # LOCAL local_ttrib__e__init_n_7 --> -32($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # local_ttrib__e__init_n_7 = local_ttrib__e__init_internal_1 + lw $t0, -8($fp) + sw $t0, -32($fp) + # LOCAL local_ttrib__e__init_internal_8 --> -36($fp) + # local_ttrib__e__init_internal_8 = ALLOCATE Bar + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bar + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 48 bytes of memory + li $a0, 48 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bar_start + sw $t0, 4($v0) + # Load type offset + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__h__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__g__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bazz__attrib__i__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Foo__attrib__a__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Foo__attrib__b__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Razz__attrib__e__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 32($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Razz__attrib__f__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 36($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bar__attrib__c__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 40($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Bar__attrib__d__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 44($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -36($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_internal_8 --> -36($fp) + # local_ttrib__e__init_internal_4 = local_ttrib__e__init_internal_8 + lw $t0, -36($fp) + sw $t0, -20($fp) + # GOTO label_END_22 +j label_END_22 +label_NEXT0_23: + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) + # Load TDT pointer to type Bar + la $t0, Bar__TDT + lw $t1, -12($fp) + addu $t0, $t0, $t1 + # Save distance + lw $t1, 0($t0) + sw $t1, -28($fp) + # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) + # LOCAL local_ttrib__e__init_internal_5 --> -24($fp) + # Update min if 8 < 9 + lw $t0, -28($fp) + lw $t1, -24($fp) + bgtu $t0, $t1, label_NEXT1_24 + # LOCAL local_ttrib__e__init_n_9 --> -40($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + # local_ttrib__e__init_n_9 = local_ttrib__e__init_internal_1 + lw $t0, -8($fp) + sw $t0, -40($fp) + # LOCAL local_ttrib__e__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__e__init_n_9 --> -40($fp) + # local_ttrib__e__init_internal_4 = local_ttrib__e__init_n_9 + lw $t0, -40($fp) + sw $t0, -20($fp) + # GOTO label_END_22 +j label_END_22 +label_NEXT1_24: + label_ERROR_21: + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + lw $t0, 0($s1) + sw $t0, -8($fp) + # LOCAL local_ttrib__e__init_internal_1 --> -8($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -8($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + label_END_22: +# RETURN local_ttrib__e__init_internal_4 +lw $v0, -20($fp) +# Deallocate stack frame for function __Razz__attrib__e__init. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 48 +jr $ra +# Function END + + +# __Razz__attrib__f__init implementation. +# @Params: +__Razz__attrib__f__init: + # Allocate stack frame for function __Razz__attrib__f__init. + subu $sp, $sp, 84 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 84 + # local_ttrib__f__init_internal_6 = GETATTRIBUTE a Razz + # LOCAL local_ttrib__f__init_internal_6 --> -28($fp) + lw $t0, 24($s1) + sw $t0, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_ttrib__f__init_internal_5 = CALL doh + # LOCAL local_ttrib__f__init_internal_5 --> -24($fp) + # LOCAL local_ttrib__f__init_internal_6 --> -28($fp) + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type's VTABLE + la $t0, Bazz_vtable + # Get pointer to function address + lw $t1, 48($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_ttrib__f__init_internal_9 = GETATTRIBUTE g Razz + # LOCAL local_ttrib__f__init_internal_9 --> -40($fp) + lw $t0, 16($s1) + sw $t0, -40($fp) + # LOCAL local_ttrib__f__init_internal_7 --> -32($fp) + # LOCAL local_ttrib__f__init_internal_9 --> -40($fp) + # local_ttrib__f__init_internal_7 = local_ttrib__f__init_internal_9 + lw $t0, -40($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__f__init_internal_7 --> -32($fp) + # LOCAL local_ttrib__f__init_internal_8 --> -36($fp) + # local_ttrib__f__init_internal_8 = VCALL local_ttrib__f__init_internal_7 doh + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_ttrib__f__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__f__init_internal_5 --> -24($fp) + # LOCAL local_ttrib__f__init_internal_8 --> -36($fp) + # local_ttrib__f__init_internal_4 = local_ttrib__f__init_internal_5 + local_ttrib__f__init_internal_8 + lw $t1, -24($fp) + lw $t0, 12($t1) + lw $t1, -36($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -20($fp) + # local_ttrib__f__init_internal_12 = GETATTRIBUTE e Razz + # LOCAL local_ttrib__f__init_internal_12 --> -52($fp) + lw $t0, 32($s1) + sw $t0, -52($fp) + # LOCAL local_ttrib__f__init_internal_10 --> -44($fp) + # LOCAL local_ttrib__f__init_internal_12 --> -52($fp) + # local_ttrib__f__init_internal_10 = local_ttrib__f__init_internal_12 + lw $t0, -52($fp) + sw $t0, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__f__init_internal_10 --> -44($fp) + # LOCAL local_ttrib__f__init_internal_11 --> -48($fp) + # local_ttrib__f__init_internal_11 = VCALL local_ttrib__f__init_internal_10 doh + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_ttrib__f__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__f__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__f__init_internal_11 --> -48($fp) + # local_ttrib__f__init_internal_3 = local_ttrib__f__init_internal_4 + local_ttrib__f__init_internal_11 + lw $t1, -20($fp) + lw $t0, 12($t1) + lw $t1, -48($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -16($fp) + # LOCAL local_ttrib__f__init_internal_15 --> -64($fp) + # local_ttrib__f__init_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_ttrib__f__init_internal_13 --> -56($fp) + # LOCAL local_ttrib__f__init_internal_15 --> -64($fp) + # local_ttrib__f__init_internal_13 = local_ttrib__f__init_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__f__init_internal_13 --> -56($fp) + # LOCAL local_ttrib__f__init_internal_14 --> -60($fp) + # local_ttrib__f__init_internal_14 = VCALL local_ttrib__f__init_internal_13 doh + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_ttrib__f__init_internal_2 --> -12($fp) + # LOCAL local_ttrib__f__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__f__init_internal_14 --> -60($fp) + # local_ttrib__f__init_internal_2 = local_ttrib__f__init_internal_3 + local_ttrib__f__init_internal_14 + lw $t1, -16($fp) + lw $t0, 12($t1) + lw $t1, -60($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_ttrib__f__init_internal_18 --> -76($fp) + # local_ttrib__f__init_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_ttrib__f__init_internal_16 --> -68($fp) + # LOCAL local_ttrib__f__init_internal_18 --> -76($fp) + # local_ttrib__f__init_internal_16 = local_ttrib__f__init_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__f__init_internal_16 --> -68($fp) + # LOCAL local_ttrib__f__init_internal_17 --> -72($fp) + # local_ttrib__f__init_internal_17 = VCALL local_ttrib__f__init_internal_16 printh + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_ttrib__f__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__f__init_internal_2 --> -12($fp) + # LOCAL local_ttrib__f__init_internal_17 --> -72($fp) + # local_ttrib__f__init_internal_1 = local_ttrib__f__init_internal_2 + local_ttrib__f__init_internal_17 + lw $t1, -12($fp) + lw $t0, 12($t1) + lw $t1, -72($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_ttrib__f__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Razz__attrib__f__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 84 + jr $ra + # Function END + + +# __Bar__attrib__c__init implementation. +# @Params: +__Bar__attrib__c__init: + # Allocate stack frame for function __Bar__attrib__c__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_trib__c__init_internal_3 --> -16($fp) + # local_trib__c__init_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_trib__c__init_internal_1 --> -8($fp) + # LOCAL local_trib__c__init_internal_3 --> -16($fp) + # local_trib__c__init_internal_1 = local_trib__c__init_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__c__init_internal_1 --> -8($fp) + # LOCAL local_trib__c__init_internal_2 --> -12($fp) + # local_trib__c__init_internal_2 = VCALL local_trib__c__init_internal_1 doh + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_trib__c__init_internal_2 + lw $v0, -12($fp) + # Deallocate stack frame for function __Bar__attrib__c__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Bar__attrib__d__init implementation. +# @Params: +__Bar__attrib__d__init: + # Allocate stack frame for function __Bar__attrib__d__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_trib__d__init_internal_3 --> -16($fp) + # local_trib__d__init_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_trib__d__init_internal_1 --> -8($fp) + # LOCAL local_trib__d__init_internal_3 --> -16($fp) + # local_trib__d__init_internal_1 = local_trib__d__init_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_trib__d__init_internal_1 --> -8($fp) + # LOCAL local_trib__d__init_internal_2 --> -12($fp) + # local_trib__d__init_internal_2 = VCALL local_trib__d__init_internal_1 printh + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_trib__d__init_internal_2 + lw $v0, -12($fp) + # Deallocate stack frame for function __Bar__attrib__d__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips new file mode 100644 index 00000000..0f00f282 --- /dev/null +++ b/tests/codegen/hello_world.mips @@ -0,0 +1,748 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:05 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_copy_at_Object, function_abort_at_Object, dummy, function_out_string_at_IO, function_in_int_at_IO, function_in_string_at_IO, dummy, function_type_name_at_Object, dummy, dummy, function_out_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_copy_at_Object, function_abort_at_Object, function_substr_at_String, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_concat_at_String, function_length_at_String, dummy +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_copy_at_Object, function_abort_at_Object, dummy, function_out_string_at_IO, function_in_int_at_IO, function_in_string_at_IO, function_main_at_Main, function_type_name_at_Object, dummy, dummy, function_out_int_at_IO +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "Hello, World.\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + lb $t3, 0($t1) + beqz $t3, end_loop + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + end_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 24($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 14 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips new file mode 100644 index 00000000..8348af76 --- /dev/null +++ b/tests/codegen/io.mips @@ -0,0 +1,1453 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:06 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +A: .asciiz "A" +# Function END +B: .asciiz "B" +# Function END +Main: .asciiz "Main" +# Function END +C: .asciiz "C" +# Function END +D: .asciiz "D" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_in_string_at_IO, function_out_string_at_IO, function_copy_at_Object, function_out_int_at_IO, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word dummy, dummy, function_copy_at_Object, dummy, dummy, function_concat_at_String, dummy, dummy, dummy, function_length_at_String, dummy, function_abort_at_Object, dummy, function_substr_at_String, function_type_name_at_Object +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type A **** +A_vtable: .word dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_out_a_at_A, dummy, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object +# Function END +# + + +# **** Type RECORD for type A **** +A_start: + A_vtable_pointer: .word A_vtable + # Function END +A_end: +# + + +# **** VTABLE for type B **** +B_vtable: .word dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_out_a_at_A, dummy, dummy, function_abort_at_Object, function_out_b_at_B, dummy, function_type_name_at_Object +# Function END +# + + +# **** Type RECORD for type B **** +B_start: + B_vtable_pointer: .word B_vtable + # Function END +B_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_in_string_at_IO, function_out_string_at_IO, function_copy_at_Object, function_out_int_at_IO, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, function_main_at_Main, function_abort_at_Object, dummy, dummy, function_type_name_at_Object +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +# **** VTABLE for type C **** +C_vtable: .word function_in_string_at_IO, function_out_string_at_IO, function_copy_at_Object, function_out_int_at_IO, dummy, dummy, function_in_int_at_IO, function_out_c_at_C, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object +# Function END +# + + +# **** Type RECORD for type C **** +C_start: + C_vtable_pointer: .word C_vtable + # Function END +C_end: +# + + +# **** VTABLE for type D **** +D_vtable: .word function_in_string_at_IO, function_out_string_at_IO, function_copy_at_Object, function_out_int_at_IO, function_out_d_at_D, dummy, function_in_int_at_IO, function_out_c_at_C, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object +# Function END +# + + +# **** Type RECORD for type D **** +D_start: + D_vtable_pointer: .word D_vtable + # Function END +D_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, -1, -1, 1, 1, 2 +Object__TDT: .word 1, 0, 1, 1, 1, 1, 2, 2, 2, 3 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1, -1 +A__TDT: .word -1, -1, -1, -1, -1, 0, 1, -1, -1, -1 +B__TDT: .word -1, -1, -1, -1, -1, -1, 0, -1, -1, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 +C__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, 1 +D__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "A: Hello world\n" +# + + +data_5: .asciiz "B: Hello world\n" +# + + +data_6: .asciiz "Done.\n" +# + + +data_7: .asciiz "C: Hello world\n" +# + + +data_8: .asciiz "D: Hello world\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + lb $t3, 0($t1) + beqz $t3, end_loop + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + end_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 28 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 40($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __A__attrib__io__init implementation. +# @Params: +__A__attrib__io__init: + # Allocate stack frame for function __A__attrib__io__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ib__io__init_internal_1 --> -8($fp) + # local_ib__io__init_internal_1 = ALLOCATE IO + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, IO + sw $t0, 12($v0) + li $t0, 2 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, IO_start + sw $t0, 4($v0) + # Load type offset + li $t0, 0 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # RETURN local_ib__io__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __A__attrib__io__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_a_at_A implementation. +# @Params: +function_out_a_at_A: + # Allocate stack frame for function function_out_a_at_A. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_out_a_at_A_internal_2 = GETATTRIBUTE io A + # LOCAL local_out_a_at_A_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # LOCAL local_out_a_at_A_internal_0 --> -4($fp) + # LOCAL local_out_a_at_A_internal_2 --> -12($fp) + # local_out_a_at_A_internal_0 = local_out_a_at_A_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_out_a_at_A_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 15 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_out_a_at_A_internal_3 + # LOCAL local_out_a_at_A_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_out_a_at_A_internal_0 --> -4($fp) + # LOCAL local_out_a_at_A_internal_1 --> -8($fp) + # local_out_a_at_A_internal_1 = VCALL local_out_a_at_A_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_out_a_at_A_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_a_at_A. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_b_at_B implementation. +# @Params: +function_out_b_at_B: + # Allocate stack frame for function function_out_b_at_B. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_out_b_at_B_internal_2 = GETATTRIBUTE io B + # LOCAL local_out_b_at_B_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # LOCAL local_out_b_at_B_internal_0 --> -4($fp) + # LOCAL local_out_b_at_B_internal_2 --> -12($fp) + # local_out_b_at_B_internal_0 = local_out_b_at_B_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_out_b_at_B_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 15 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_out_b_at_B_internal_3 + # LOCAL local_out_b_at_B_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_out_b_at_B_internal_0 --> -4($fp) + # LOCAL local_out_b_at_B_internal_1 --> -8($fp) + # local_out_b_at_B_internal_1 = VCALL local_out_b_at_B_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_out_b_at_B_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_b_at_B. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 72 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 72 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = ALLOCATE A + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, A + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, A_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__io__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_a + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = ALLOCATE B + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, B + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, B_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __A__attrib__io__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -24($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_3 = local_main_at_Main_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = VCALL local_main_at_Main_internal_3 out_b + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = ALLOCATE C + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, C + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, C_start + sw $t0, 4($v0) + # Load type offset + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -36($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 + lw $t0, -36($fp) + sw $t0, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_c + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = ALLOCATE D + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, D + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, D_start + sw $t0, 4($v0) + # Load type offset + li $t0, 36 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -48($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_9 = local_main_at_Main_internal_11 + lw $t0, -48($fp) + sw $t0, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 out_d + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_12 = local_main_at_Main_internal_14 + lw $t0, -60($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_6 + sw $t0, 12($v0) + li $t0, 6 + sw $t0, 16($v0) + sw $v0, -64($fp) + # ARG local_main_at_Main_internal_15 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_13 + lw $v0, -56($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 72 + jr $ra + # Function END + + +# function_out_c_at_C implementation. +# @Params: +function_out_c_at_C: + # Allocate stack frame for function function_out_c_at_C. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_out_c_at_C_internal_2 --> -12($fp) + # local_out_c_at_C_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_out_c_at_C_internal_0 --> -4($fp) + # LOCAL local_out_c_at_C_internal_2 --> -12($fp) + # local_out_c_at_C_internal_0 = local_out_c_at_C_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_out_c_at_C_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_7 + sw $t0, 12($v0) + li $t0, 15 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_out_c_at_C_internal_3 + # LOCAL local_out_c_at_C_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_out_c_at_C_internal_0 --> -4($fp) + # LOCAL local_out_c_at_C_internal_1 --> -8($fp) + # local_out_c_at_C_internal_1 = VCALL local_out_c_at_C_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_out_c_at_C_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_c_at_C. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_d_at_D implementation. +# @Params: +function_out_d_at_D: + # Allocate stack frame for function function_out_d_at_D. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_out_d_at_D_internal_2 --> -12($fp) + # local_out_d_at_D_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_out_d_at_D_internal_0 --> -4($fp) + # LOCAL local_out_d_at_D_internal_2 --> -12($fp) + # local_out_d_at_D_internal_0 = local_out_d_at_D_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_out_d_at_D_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_8 + sw $t0, 12($v0) + li $t0, 15 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_out_d_at_D_internal_3 + # LOCAL local_out_d_at_D_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_out_d_at_D_internal_0 --> -4($fp) + # LOCAL local_out_d_at_D_internal_1 --> -8($fp) + # local_out_d_at_D_internal_1 = VCALL local_out_d_at_D_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_out_d_at_D_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_out_d_at_D. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/codegen/life.mips b/tests/codegen/life.mips new file mode 100644 index 00000000..cc6fad32 --- /dev/null +++ b/tests/codegen/life.mips @@ -0,0 +1,21981 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:08 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +Board: .asciiz "Board" +# Function END +CellularAutomaton: .asciiz "CellularAutomaton" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, dummy, function_in_int_at_IO, dummy, function_out_string_at_IO, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_substr_at_String, dummy, function_length_at_String, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_concat_at_String, function_type_name_at_Object, dummy, dummy +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type Board **** +Board_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, function_size_of_board_at_Board, function_in_string_at_IO, dummy, dummy, function_board_init_at_Board, function_in_int_at_IO, dummy, function_out_string_at_IO, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Board **** +Board_start: + Board_vtable_pointer: .word Board_vtable + # Function END +Board_end: +# + + +# **** VTABLE for type CellularAutomaton **** +CellularAutomaton_vtable: .word dummy, function_option_at_CellularAutomaton, dummy, function_abort_at_Object, dummy, function_num_cells_at_CellularAutomaton, function_copy_at_Object, function_cell_at_CellularAutomaton, function_evolve_at_CellularAutomaton, function_prompt2_at_CellularAutomaton, function_south_at_CellularAutomaton, function_southwest_at_CellularAutomaton, function_out_int_at_IO, function_east_at_CellularAutomaton, function_neighbors_at_CellularAutomaton, function_southeast_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_size_of_board_at_Board, function_in_string_at_IO, function_north_at_CellularAutomaton, function_print_at_CellularAutomaton, function_board_init_at_Board, function_in_int_at_IO, function_northeast_at_CellularAutomaton, function_out_string_at_IO, function_prompt_at_CellularAutomaton, function_west_at_CellularAutomaton, dummy, function_type_name_at_Object, function_northwest_at_CellularAutomaton, function_init_at_CellularAutomaton +# Function END +# + + +# **** Type RECORD for type CellularAutomaton **** +CellularAutomaton_start: + CellularAutomaton_vtable_pointer: .word CellularAutomaton_vtable + # Function END +CellularAutomaton_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word dummy, function_option_at_CellularAutomaton, dummy, function_abort_at_Object, function_main_at_Main, function_num_cells_at_CellularAutomaton, function_copy_at_Object, function_cell_at_CellularAutomaton, function_evolve_at_CellularAutomaton, function_prompt2_at_CellularAutomaton, function_south_at_CellularAutomaton, function_southwest_at_CellularAutomaton, function_out_int_at_IO, function_east_at_CellularAutomaton, function_neighbors_at_CellularAutomaton, function_southeast_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_size_of_board_at_Board, function_in_string_at_IO, function_north_at_CellularAutomaton, function_print_at_CellularAutomaton, function_board_init_at_Board, function_in_int_at_IO, function_northeast_at_CellularAutomaton, function_out_string_at_IO, function_prompt_at_CellularAutomaton, function_west_at_CellularAutomaton, dummy, function_type_name_at_Object, function_northwest_at_CellularAutomaton, function_init_at_CellularAutomaton +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, 1, 2, 3 +Object__TDT: .word 1, 0, 1, 1, 1, 2, 3, 4 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1 +Board__TDT: .word -1, -1, -1, -1, -1, 0, 1, 2 +CellularAutomaton__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "\n" +# + + +data_5: .asciiz "\n" +# + + +data_6: .asciiz "\n" +# + + +data_7: .asciiz " " +# + + +data_8: .asciiz " " +# + + +data_9: .asciiz " " +# + + +data_10: .asciiz " " +# + + +data_11: .asciiz " " +# + + +data_12: .asciiz " " +# + + +data_13: .asciiz " " +# + + +data_14: .asciiz " " +# + + +data_15: .asciiz " " +# + + +data_16: .asciiz " " +# + + +data_17: .asciiz " " +# + + +data_18: .asciiz " " +# + + +data_19: .asciiz " " +# + + +data_20: .asciiz " " +# + + +data_21: .asciiz "X" +# + + +data_22: .asciiz "X" +# + + +data_23: .asciiz "X" +# + + +data_24: .asciiz "X" +# + + +data_25: .asciiz "X" +# + + +data_26: .asciiz "X" +# + + +data_27: .asciiz "X" +# + + +data_28: .asciiz "X" +# + + +data_29: .asciiz "X" +# + + +data_30: .asciiz "X" +# + + +data_31: .asciiz "X" +# + + +data_32: .asciiz "-" +# + + +data_33: .asciiz "-" +# + + +data_34: .asciiz "\nPlease chose a number:\n" +# + + +data_35: .asciiz "\t1: A cross\n" +# + + +data_36: .asciiz "\t2: A slash from the upper left to lower right\n" +# + + +data_37: .asciiz "\t3: A slash from the upper right to lower left\n" +# + + +data_38: .asciiz "\t4: An X\n" +# + + +data_39: .asciiz "\t5: A greater than sign \n" +# + + +data_40: .asciiz "\t6: A less than sign\n" +# + + +data_41: .asciiz "\t7: Two greater than signs\n" +# + + +data_42: .asciiz "\t8: Two less than signs\n" +# + + +data_43: .asciiz "\t9: A 'V'\n" +# + + +data_44: .asciiz "\t10: An inverse 'V'\n" +# + + +data_45: .asciiz "\t11: Numbers 9 and 10 combined\n" +# + + +data_46: .asciiz "\t12: A full grid\n" +# + + +data_47: .asciiz "\t13: A 'T'\n" +# + + +data_48: .asciiz "\t14: A plus '+'\n" +# + + +data_49: .asciiz "\t15: A 'W'\n" +# + + +data_50: .asciiz "\t16: An 'M'\n" +# + + +data_51: .asciiz "\t17: An 'E'\n" +# + + +data_52: .asciiz "\t18: A '3'\n" +# + + +data_53: .asciiz "\t19: An 'O'\n" +# + + +data_54: .asciiz "\t20: An '8'\n" +# + + +data_55: .asciiz "\t21: An 'S'\n" +# + + +data_56: .asciiz "Your choice => " +# + + +data_57: .asciiz "\n" +# + + +data_58: .asciiz " XX XXXX XXXX XX " +# + + +data_59: .asciiz " X X X X X " +# + + +data_60: .asciiz "X X X X X" +# + + +data_61: .asciiz "X X X X X X X X X" +# + + +data_62: .asciiz "X X X X X " +# + + +data_63: .asciiz " X X X X X" +# + + +data_64: .asciiz "X X X XX X " +# + + +data_65: .asciiz " X XX X X X " +# + + +data_66: .asciiz "X X X X X " +# + + +data_67: .asciiz " X X X X X" +# + + +data_68: .asciiz "X X X X X X X X" +# + + +data_69: .asciiz "XXXXXXXXXXXXXXXXXXXXXXXXX" +# + + +data_70: .asciiz "XXXXX X X X X " +# + + +data_71: .asciiz " X X XXXXX X X " +# + + +data_72: .asciiz "X X X X X X X " +# + + +data_73: .asciiz " X X X X X X X" +# + + +data_74: .asciiz "XXXXX X XXXXX X XXXX" +# + + +data_75: .asciiz "XXX X X X X XXXX " +# + + +data_76: .asciiz " XX X XX X XX " +# + + +data_77: .asciiz " XX X XX X XX X XX X XX " +# + + +data_78: .asciiz " XXXX X XX X XXXX " +# + + +data_79: .asciiz " " +# + + +data_80: .asciiz "Would you like to continue with the next generation? \n" +# + + +data_81: .asciiz "Please use lowercase y or n for your answer [y]: " +# + + +data_82: .asciiz "\n" +# + + +data_83: .asciiz "n" +# + + +data_84: .asciiz "\n\n" +# + + +data_85: .asciiz "Would you like to choose a background pattern? \n" +# + + +data_86: .asciiz "Please use lowercase y or n for your answer [n]: " +# + + +data_87: .asciiz "y" +# + + +data_88: .asciiz "Welcome to the Game of Life.\n" +# + + +data_89: .asciiz "There are many initial states to choose from. \n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + lb $t3, 0($t1) + beqz $t3, end_loop + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + end_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 32 bytes of memory + li $a0, 32 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 28 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Board__attrib__rows__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Board__attrib__columns__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Board__attrib__board_size__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __CellularAutomaton__attrib__population_map__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__cells__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 16($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Board__attrib__rows__init implementation. +# @Params: +__Board__attrib__rows__init: + # Allocate stack frame for function __Board__attrib__rows__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_attrib__rows__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_attrib__rows__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Board__attrib__rows__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Board__attrib__columns__init implementation. +# @Params: +__Board__attrib__columns__init: + # Allocate stack frame for function __Board__attrib__columns__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_attrib__columns__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_attrib__columns__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Board__attrib__columns__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Board__attrib__board_size__init implementation. +# @Params: +__Board__attrib__board_size__init: + # Allocate stack frame for function __Board__attrib__board_size__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_attrib__board_size__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_attrib__board_size__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Board__attrib__board_size__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_size_of_board_at_Board implementation. +# @Params: +# 0($fp) = param_size_of_board_at_Board_initial_0 +function_size_of_board_at_Board: + # Allocate stack frame for function function_size_of_board_at_Board. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_size_of_board_at_Board_internal_0 --> -4($fp) + # PARAM param_size_of_board_at_Board_initial_0 --> 0($fp) + # local_size_of_board_at_Board_internal_0 = PARAM param_size_of_board_at_Board_initial_0 + lw $t0, 0($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_size_of_board_at_Board_internal_0 --> -4($fp) + # LOCAL local_size_of_board_at_Board_internal_1 --> -8($fp) + # local_size_of_board_at_Board_internal_1 = VCALL local_size_of_board_at_Board_internal_0 length + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 8($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_size_of_board_at_Board_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_size_of_board_at_Board. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_board_init_at_Board implementation. +# @Params: +# 0($fp) = param_board_init_at_Board_start_0 +function_board_init_at_Board: + # Allocate stack frame for function function_board_init_at_Board. + subu $sp, $sp, 204 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 204 + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_board_init_at_Board_internal_3 --> -16($fp) + # local_board_init_at_Board_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_board_init_at_Board_internal_1 --> -8($fp) + # LOCAL local_board_init_at_Board_internal_3 --> -16($fp) + # local_board_init_at_Board_internal_1 = local_board_init_at_Board_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_board_init_at_Board_start_0 + # PARAM param_board_init_at_Board_start_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_board_init_at_Board_internal_1 --> -8($fp) + # LOCAL local_board_init_at_Board_internal_2 --> -12($fp) + # local_board_init_at_Board_internal_2 = VCALL local_board_init_at_Board_internal_1 size_of_board + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 68($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_2 --> -12($fp) + # local_board_init_at_Board_size_0 = local_board_init_at_Board_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # LOCAL local_board_init_at_Board_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 15 + sw $t0, 12($v0) + sw $v0, -36($fp) + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_3 + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_3 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_3 + # IF_ZERO local_board_init_at_Board_internal_8 GOTO label_FALSE_3 + # IF_ZERO local_board_init_at_Board_internal_8 GOTO label_FALSE_3 + lw $t0, -36($fp) + beq $t0, 0, label_FALSE_3 + # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -32($fp) + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_COMPARE_STRING_6 + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_COMPARE_STRING_6 + lw $t0, -32($fp) + beq $t0, 0, label_COMPARE_STRING_6 + # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -32($fp) + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_COMPARE_BY_VALUE_7 + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_COMPARE_BY_VALUE_7 + lw $t0, -32($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_7 + # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -32($fp) + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_COMPARE_BY_VALUE_7 + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_COMPARE_BY_VALUE_7 + lw $t0, -32($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_7 + # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_8 --> -36($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -36($fp) + sub $a0, $a0, $a1 + sw $a0, -32($fp) + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_4 + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_4 + lw $t0, -32($fp) + beq $t0, 0, label_TRUE_4 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_COMPARE_BY_VALUE_7: + # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_8 --> -36($fp) + lw $a0, -4($fp) + lw $a1, -36($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -32($fp) + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_4 + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_4 + lw $t0, -32($fp) + beq $t0, 0, label_TRUE_4 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_COMPARE_STRING_6: + # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_8 --> -36($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -36($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -32($fp) + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_CONTINUE_8 + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_CONTINUE_8 + lw $t0, -32($fp) + beq $t0, 0, label_CONTINUE_8 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_CONTINUE_8: + # LOCAL local_board_init_at_Board_internal_7 --> -32($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_8 --> -36($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -36($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_9: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_10 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_9 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_10: + # Store result + sw $a2, -32($fp) + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_4 + # IF_ZERO local_board_init_at_Board_internal_7 GOTO label_TRUE_4 + lw $t0, -32($fp) + beq $t0, 0, label_TRUE_4 + label_FALSE_3: + # LOCAL local_board_init_at_Board_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # GOTO label_END_5 +j label_END_5 +label_TRUE_4: + # LOCAL local_board_init_at_Board_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -28($fp) + label_END_5: +# LOCAL local_board_init_at_Board_internal_4 --> -20($fp) +# LOCAL local_board_init_at_Board_internal_6 --> -28($fp) +# Obtain value from -28($fp) +lw $v0, -28($fp) +lw $v0, 12($v0) +sw $v0, -20($fp) +# IF_ZERO local_board_init_at_Board_internal_4 GOTO label_FALSEIF_1 +# IF_ZERO local_board_init_at_Board_internal_4 GOTO label_FALSEIF_1 +lw $t0, -20($fp) +beq $t0, 0, label_FALSEIF_1 +# LOCAL local_board_init_at_Board_internal_9 --> -40($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 3 +sw $t0, 12($v0) +sw $v0, -40($fp) +# +# LOCAL local_board_init_at_Board_internal_9 --> -40($fp) +lw $t0, -40($fp) +sw $t0, 12($s1) +# LOCAL local_board_init_at_Board_internal_10 --> -44($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 5 +sw $t0, 12($v0) +sw $v0, -44($fp) +# +# LOCAL local_board_init_at_Board_internal_10 --> -44($fp) +lw $t0, -44($fp) +sw $t0, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t0, -4($fp) +sw $t0, 20($s1) +# LOCAL local_board_init_at_Board_internal_5 --> -24($fp) +# local_board_init_at_Board_internal_5 = +# GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 16 + sw $t0, 12($v0) + sw $v0, -64($fp) + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_13 + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_13 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_13 + # IF_ZERO local_board_init_at_Board_internal_15 GOTO label_FALSE_13 + # IF_ZERO local_board_init_at_Board_internal_15 GOTO label_FALSE_13 + lw $t0, -64($fp) + beq $t0, 0, label_FALSE_13 + # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -60($fp) + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_COMPARE_STRING_16 + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_COMPARE_STRING_16 + lw $t0, -60($fp) + beq $t0, 0, label_COMPARE_STRING_16 + # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -60($fp) + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_COMPARE_BY_VALUE_17 + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_COMPARE_BY_VALUE_17 + lw $t0, -60($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_17 + # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -60($fp) + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_COMPARE_BY_VALUE_17 + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_COMPARE_BY_VALUE_17 + lw $t0, -60($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_17 + # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -64($fp) + sub $a0, $a0, $a1 + sw $a0, -60($fp) + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_TRUE_14 + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_TRUE_14 + lw $t0, -60($fp) + beq $t0, 0, label_TRUE_14 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_COMPARE_BY_VALUE_17: + # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) + lw $a0, -4($fp) + lw $a1, -64($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -60($fp) + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_TRUE_14 + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_TRUE_14 + lw $t0, -60($fp) + beq $t0, 0, label_TRUE_14 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_COMPARE_STRING_16: + # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -64($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -60($fp) + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_CONTINUE_18 + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_CONTINUE_18 + lw $t0, -60($fp) + beq $t0, 0, label_CONTINUE_18 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_CONTINUE_18: + # LOCAL local_board_init_at_Board_internal_14 --> -60($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_15 --> -64($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -64($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_19: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_20 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_19 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_20: + # Store result + sw $a2, -60($fp) + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_TRUE_14 + # IF_ZERO local_board_init_at_Board_internal_14 GOTO label_TRUE_14 + lw $t0, -60($fp) + beq $t0, 0, label_TRUE_14 + label_FALSE_13: + # LOCAL local_board_init_at_Board_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -56($fp) + # GOTO label_END_15 +j label_END_15 +label_TRUE_14: + # LOCAL local_board_init_at_Board_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -56($fp) + label_END_15: +# LOCAL local_board_init_at_Board_internal_11 --> -48($fp) +# LOCAL local_board_init_at_Board_internal_13 --> -56($fp) +# Obtain value from -56($fp) +lw $v0, -56($fp) +lw $v0, 12($v0) +sw $v0, -48($fp) +# IF_ZERO local_board_init_at_Board_internal_11 GOTO label_FALSEIF_11 +# IF_ZERO local_board_init_at_Board_internal_11 GOTO label_FALSEIF_11 +lw $t0, -48($fp) +beq $t0, 0, label_FALSEIF_11 +# LOCAL local_board_init_at_Board_internal_16 --> -68($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 4 +sw $t0, 12($v0) +sw $v0, -68($fp) +# +# LOCAL local_board_init_at_Board_internal_16 --> -68($fp) +lw $t0, -68($fp) +sw $t0, 12($s1) +# LOCAL local_board_init_at_Board_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 4 +sw $t0, 12($v0) +sw $v0, -72($fp) +# +# LOCAL local_board_init_at_Board_internal_17 --> -72($fp) +lw $t0, -72($fp) +sw $t0, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t0, -4($fp) +sw $t0, 20($s1) +# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) +# local_board_init_at_Board_internal_12 = +# GOTO label_ENDIF_12 +j label_ENDIF_12 +label_FALSEIF_11: + # LOCAL local_board_init_at_Board_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 20 + sw $t0, 12($v0) + sw $v0, -92($fp) + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_23 + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_23 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_23 + # IF_ZERO local_board_init_at_Board_internal_22 GOTO label_FALSE_23 + # IF_ZERO local_board_init_at_Board_internal_22 GOTO label_FALSE_23 + lw $t0, -92($fp) + beq $t0, 0, label_FALSE_23 + # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_COMPARE_STRING_26 + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_COMPARE_STRING_26 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_STRING_26 + # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_COMPARE_BY_VALUE_27 + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_COMPARE_BY_VALUE_27 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_27 + # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -88($fp) + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_COMPARE_BY_VALUE_27 + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_COMPARE_BY_VALUE_27 + lw $t0, -88($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_27 + # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_22 --> -92($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -92($fp) + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_TRUE_24 + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_TRUE_24 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_24 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_COMPARE_BY_VALUE_27: + # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_22 --> -92($fp) + lw $a0, -4($fp) + lw $a1, -92($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -88($fp) + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_TRUE_24 + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_TRUE_24 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_24 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_COMPARE_STRING_26: + # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_22 --> -92($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -92($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -88($fp) + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_CONTINUE_28 + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_CONTINUE_28 + lw $t0, -88($fp) + beq $t0, 0, label_CONTINUE_28 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_CONTINUE_28: + # LOCAL local_board_init_at_Board_internal_21 --> -88($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_22 --> -92($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -92($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_29: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_30 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_29 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_30: + # Store result + sw $a2, -88($fp) + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_TRUE_24 + # IF_ZERO local_board_init_at_Board_internal_21 GOTO label_TRUE_24 + lw $t0, -88($fp) + beq $t0, 0, label_TRUE_24 + label_FALSE_23: + # LOCAL local_board_init_at_Board_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -84($fp) + # GOTO label_END_25 +j label_END_25 +label_TRUE_24: + # LOCAL local_board_init_at_Board_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -84($fp) + label_END_25: +# LOCAL local_board_init_at_Board_internal_18 --> -76($fp) +# LOCAL local_board_init_at_Board_internal_20 --> -84($fp) +# Obtain value from -84($fp) +lw $v0, -84($fp) +lw $v0, 12($v0) +sw $v0, -76($fp) +# IF_ZERO local_board_init_at_Board_internal_18 GOTO label_FALSEIF_21 +# IF_ZERO local_board_init_at_Board_internal_18 GOTO label_FALSEIF_21 +lw $t0, -76($fp) +beq $t0, 0, label_FALSEIF_21 +# LOCAL local_board_init_at_Board_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 4 +sw $t0, 12($v0) +sw $v0, -96($fp) +# +# LOCAL local_board_init_at_Board_internal_23 --> -96($fp) +lw $t0, -96($fp) +sw $t0, 12($s1) +# LOCAL local_board_init_at_Board_internal_24 --> -100($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 5 +sw $t0, 12($v0) +sw $v0, -100($fp) +# +# LOCAL local_board_init_at_Board_internal_24 --> -100($fp) +lw $t0, -100($fp) +sw $t0, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t0, -4($fp) +sw $t0, 20($s1) +# LOCAL local_board_init_at_Board_internal_19 --> -80($fp) +# local_board_init_at_Board_internal_19 = +# GOTO label_ENDIF_22 +j label_ENDIF_22 +label_FALSEIF_21: + # LOCAL local_board_init_at_Board_internal_29 --> -120($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 21 + sw $t0, 12($v0) + sw $v0, -120($fp) + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_33 + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_33 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_33 + # IF_ZERO local_board_init_at_Board_internal_29 GOTO label_FALSE_33 + # IF_ZERO local_board_init_at_Board_internal_29 GOTO label_FALSE_33 + lw $t0, -120($fp) + beq $t0, 0, label_FALSE_33 + # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -116($fp) + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_COMPARE_STRING_36 + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_COMPARE_STRING_36 + lw $t0, -116($fp) + beq $t0, 0, label_COMPARE_STRING_36 + # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -116($fp) + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_COMPARE_BY_VALUE_37 + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_COMPARE_BY_VALUE_37 + lw $t0, -116($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_37 + # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -116($fp) + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_COMPARE_BY_VALUE_37 + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_COMPARE_BY_VALUE_37 + lw $t0, -116($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_37 + # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_29 --> -120($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -120($fp) + sub $a0, $a0, $a1 + sw $a0, -116($fp) + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_TRUE_34 + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_TRUE_34 + lw $t0, -116($fp) + beq $t0, 0, label_TRUE_34 + # GOTO label_FALSE_33 + j label_FALSE_33 + label_COMPARE_BY_VALUE_37: + # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_29 --> -120($fp) + lw $a0, -4($fp) + lw $a1, -120($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -116($fp) + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_TRUE_34 + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_TRUE_34 + lw $t0, -116($fp) + beq $t0, 0, label_TRUE_34 + # GOTO label_FALSE_33 + j label_FALSE_33 + label_COMPARE_STRING_36: + # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_29 --> -120($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -120($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -116($fp) + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_CONTINUE_38 + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_CONTINUE_38 + lw $t0, -116($fp) + beq $t0, 0, label_CONTINUE_38 + # GOTO label_FALSE_33 + j label_FALSE_33 + label_CONTINUE_38: + # LOCAL local_board_init_at_Board_internal_28 --> -116($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_29 --> -120($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -120($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_39: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_40 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_39 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_40: + # Store result + sw $a2, -116($fp) + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_TRUE_34 + # IF_ZERO local_board_init_at_Board_internal_28 GOTO label_TRUE_34 + lw $t0, -116($fp) + beq $t0, 0, label_TRUE_34 + label_FALSE_33: + # LOCAL local_board_init_at_Board_internal_27 --> -112($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -112($fp) + # GOTO label_END_35 +j label_END_35 +label_TRUE_34: + # LOCAL local_board_init_at_Board_internal_27 --> -112($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -112($fp) + label_END_35: +# LOCAL local_board_init_at_Board_internal_25 --> -104($fp) +# LOCAL local_board_init_at_Board_internal_27 --> -112($fp) +# Obtain value from -112($fp) +lw $v0, -112($fp) +lw $v0, 12($v0) +sw $v0, -104($fp) +# IF_ZERO local_board_init_at_Board_internal_25 GOTO label_FALSEIF_31 +# IF_ZERO local_board_init_at_Board_internal_25 GOTO label_FALSEIF_31 +lw $t0, -104($fp) +beq $t0, 0, label_FALSEIF_31 +# LOCAL local_board_init_at_Board_internal_30 --> -124($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 3 +sw $t0, 12($v0) +sw $v0, -124($fp) +# +# LOCAL local_board_init_at_Board_internal_30 --> -124($fp) +lw $t0, -124($fp) +sw $t0, 12($s1) +# LOCAL local_board_init_at_Board_internal_31 --> -128($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 7 +sw $t0, 12($v0) +sw $v0, -128($fp) +# +# LOCAL local_board_init_at_Board_internal_31 --> -128($fp) +lw $t0, -128($fp) +sw $t0, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t0, -4($fp) +sw $t0, 20($s1) +# LOCAL local_board_init_at_Board_internal_26 --> -108($fp) +# local_board_init_at_Board_internal_26 = +# GOTO label_ENDIF_32 +j label_ENDIF_32 +label_FALSEIF_31: + # LOCAL local_board_init_at_Board_internal_36 --> -148($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 25 + sw $t0, 12($v0) + sw $v0, -148($fp) + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_43 + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_43 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_43 + # IF_ZERO local_board_init_at_Board_internal_36 GOTO label_FALSE_43 + # IF_ZERO local_board_init_at_Board_internal_36 GOTO label_FALSE_43 + lw $t0, -148($fp) + beq $t0, 0, label_FALSE_43 + # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -144($fp) + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_COMPARE_STRING_46 + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_COMPARE_STRING_46 + lw $t0, -144($fp) + beq $t0, 0, label_COMPARE_STRING_46 + # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -144($fp) + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_COMPARE_BY_VALUE_47 + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_COMPARE_BY_VALUE_47 + lw $t0, -144($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_47 + # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -144($fp) + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_COMPARE_BY_VALUE_47 + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_COMPARE_BY_VALUE_47 + lw $t0, -144($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_47 + # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_36 --> -148($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -148($fp) + sub $a0, $a0, $a1 + sw $a0, -144($fp) + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_TRUE_44 + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_TRUE_44 + lw $t0, -144($fp) + beq $t0, 0, label_TRUE_44 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_COMPARE_BY_VALUE_47: + # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_36 --> -148($fp) + lw $a0, -4($fp) + lw $a1, -148($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -144($fp) + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_TRUE_44 + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_TRUE_44 + lw $t0, -144($fp) + beq $t0, 0, label_TRUE_44 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_COMPARE_STRING_46: + # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_36 --> -148($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -148($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -144($fp) + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_CONTINUE_48 + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_CONTINUE_48 + lw $t0, -144($fp) + beq $t0, 0, label_CONTINUE_48 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_CONTINUE_48: + # LOCAL local_board_init_at_Board_internal_35 --> -144($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_36 --> -148($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -148($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_49: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_50 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_49 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_50: + # Store result + sw $a2, -144($fp) + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_TRUE_44 + # IF_ZERO local_board_init_at_Board_internal_35 GOTO label_TRUE_44 + lw $t0, -144($fp) + beq $t0, 0, label_TRUE_44 + label_FALSE_43: + # LOCAL local_board_init_at_Board_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -140($fp) + # GOTO label_END_45 +j label_END_45 +label_TRUE_44: + # LOCAL local_board_init_at_Board_internal_34 --> -140($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -140($fp) + label_END_45: +# LOCAL local_board_init_at_Board_internal_32 --> -132($fp) +# LOCAL local_board_init_at_Board_internal_34 --> -140($fp) +# Obtain value from -140($fp) +lw $v0, -140($fp) +lw $v0, 12($v0) +sw $v0, -132($fp) +# IF_ZERO local_board_init_at_Board_internal_32 GOTO label_FALSEIF_41 +# IF_ZERO local_board_init_at_Board_internal_32 GOTO label_FALSEIF_41 +lw $t0, -132($fp) +beq $t0, 0, label_FALSEIF_41 +# LOCAL local_board_init_at_Board_internal_37 --> -152($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 5 +sw $t0, 12($v0) +sw $v0, -152($fp) +# +# LOCAL local_board_init_at_Board_internal_37 --> -152($fp) +lw $t0, -152($fp) +sw $t0, 12($s1) +# LOCAL local_board_init_at_Board_internal_38 --> -156($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 5 +sw $t0, 12($v0) +sw $v0, -156($fp) +# +# LOCAL local_board_init_at_Board_internal_38 --> -156($fp) +lw $t0, -156($fp) +sw $t0, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t0, -4($fp) +sw $t0, 20($s1) +# LOCAL local_board_init_at_Board_internal_33 --> -136($fp) +# local_board_init_at_Board_internal_33 = +# GOTO label_ENDIF_42 +j label_ENDIF_42 +label_FALSEIF_41: + # LOCAL local_board_init_at_Board_internal_43 --> -176($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 28 + sw $t0, 12($v0) + sw $v0, -176($fp) + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_53 + # IF_ZERO local_board_init_at_Board_size_0 GOTO label_FALSE_53 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_53 + # IF_ZERO local_board_init_at_Board_internal_43 GOTO label_FALSE_53 + # IF_ZERO local_board_init_at_Board_internal_43 GOTO label_FALSE_53 + lw $t0, -176($fp) + beq $t0, 0, label_FALSE_53 + # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -172($fp) + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_COMPARE_STRING_56 + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_COMPARE_STRING_56 + lw $t0, -172($fp) + beq $t0, 0, label_COMPARE_STRING_56 + # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -172($fp) + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_COMPARE_BY_VALUE_57 + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_COMPARE_BY_VALUE_57 + lw $t0, -172($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_57 + # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -172($fp) + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_COMPARE_BY_VALUE_57 + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_COMPARE_BY_VALUE_57 + lw $t0, -172($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_57 + # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_43 --> -176($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -176($fp) + sub $a0, $a0, $a1 + sw $a0, -172($fp) + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_TRUE_54 + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_TRUE_54 + lw $t0, -172($fp) + beq $t0, 0, label_TRUE_54 + # GOTO label_FALSE_53 + j label_FALSE_53 + label_COMPARE_BY_VALUE_57: + # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_43 --> -176($fp) + lw $a0, -4($fp) + lw $a1, -176($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -172($fp) + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_TRUE_54 + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_TRUE_54 + lw $t0, -172($fp) + beq $t0, 0, label_TRUE_54 + # GOTO label_FALSE_53 + j label_FALSE_53 + label_COMPARE_STRING_56: + # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_43 --> -176($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -176($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -172($fp) + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_CONTINUE_58 + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_CONTINUE_58 + lw $t0, -172($fp) + beq $t0, 0, label_CONTINUE_58 + # GOTO label_FALSE_53 + j label_FALSE_53 + label_CONTINUE_58: + # LOCAL local_board_init_at_Board_internal_42 --> -172($fp) + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + # LOCAL local_board_init_at_Board_internal_43 --> -176($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -176($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_59: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_60 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_59 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_60: + # Store result + sw $a2, -172($fp) + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_TRUE_54 + # IF_ZERO local_board_init_at_Board_internal_42 GOTO label_TRUE_54 + lw $t0, -172($fp) + beq $t0, 0, label_TRUE_54 + label_FALSE_53: + # LOCAL local_board_init_at_Board_internal_41 --> -168($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -168($fp) + # GOTO label_END_55 +j label_END_55 +label_TRUE_54: + # LOCAL local_board_init_at_Board_internal_41 --> -168($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -168($fp) + label_END_55: +# LOCAL local_board_init_at_Board_internal_39 --> -160($fp) +# LOCAL local_board_init_at_Board_internal_41 --> -168($fp) +# Obtain value from -168($fp) +lw $v0, -168($fp) +lw $v0, 12($v0) +sw $v0, -160($fp) +# IF_ZERO local_board_init_at_Board_internal_39 GOTO label_FALSEIF_51 +# IF_ZERO local_board_init_at_Board_internal_39 GOTO label_FALSEIF_51 +lw $t0, -160($fp) +beq $t0, 0, label_FALSEIF_51 +# LOCAL local_board_init_at_Board_internal_44 --> -180($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 7 +sw $t0, 12($v0) +sw $v0, -180($fp) +# +# LOCAL local_board_init_at_Board_internal_44 --> -180($fp) +lw $t0, -180($fp) +sw $t0, 12($s1) +# LOCAL local_board_init_at_Board_internal_45 --> -184($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 4 +sw $t0, 12($v0) +sw $v0, -184($fp) +# +# LOCAL local_board_init_at_Board_internal_45 --> -184($fp) +lw $t0, -184($fp) +sw $t0, 16($s1) +# +# LOCAL local_board_init_at_Board_size_0 --> -4($fp) +lw $t0, -4($fp) +sw $t0, 20($s1) +# LOCAL local_board_init_at_Board_internal_40 --> -164($fp) +# local_board_init_at_Board_internal_40 = +# GOTO label_ENDIF_52 +j label_ENDIF_52 +label_FALSEIF_51: + # LOCAL local_board_init_at_Board_internal_46 --> -188($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 5 + sw $t0, 12($v0) + sw $v0, -188($fp) + # + # LOCAL local_board_init_at_Board_internal_46 --> -188($fp) + lw $t0, -188($fp) + sw $t0, 12($s1) + # LOCAL local_board_init_at_Board_internal_47 --> -192($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 5 + sw $t0, 12($v0) + sw $v0, -192($fp) + # + # LOCAL local_board_init_at_Board_internal_47 --> -192($fp) + lw $t0, -192($fp) + sw $t0, 16($s1) + # + # LOCAL local_board_init_at_Board_size_0 --> -4($fp) + lw $t0, -4($fp) + sw $t0, 20($s1) + # LOCAL local_board_init_at_Board_internal_40 --> -164($fp) + # local_board_init_at_Board_internal_40 = + label_ENDIF_52: +# LOCAL local_board_init_at_Board_internal_33 --> -136($fp) +# LOCAL local_board_init_at_Board_internal_40 --> -164($fp) +# local_board_init_at_Board_internal_33 = local_board_init_at_Board_internal_40 +lw $t0, -164($fp) +sw $t0, -136($fp) +label_ENDIF_42: +# LOCAL local_board_init_at_Board_internal_26 --> -108($fp) +# LOCAL local_board_init_at_Board_internal_33 --> -136($fp) +# local_board_init_at_Board_internal_26 = local_board_init_at_Board_internal_33 +lw $t0, -136($fp) +sw $t0, -108($fp) +label_ENDIF_32: +# LOCAL local_board_init_at_Board_internal_19 --> -80($fp) +# LOCAL local_board_init_at_Board_internal_26 --> -108($fp) +# local_board_init_at_Board_internal_19 = local_board_init_at_Board_internal_26 +lw $t0, -108($fp) +sw $t0, -80($fp) +label_ENDIF_22: +# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) +# LOCAL local_board_init_at_Board_internal_19 --> -80($fp) +# local_board_init_at_Board_internal_12 = local_board_init_at_Board_internal_19 +lw $t0, -80($fp) +sw $t0, -52($fp) +label_ENDIF_12: +# LOCAL local_board_init_at_Board_internal_5 --> -24($fp) +# LOCAL local_board_init_at_Board_internal_12 --> -52($fp) +# local_board_init_at_Board_internal_5 = local_board_init_at_Board_internal_12 +lw $t0, -52($fp) +sw $t0, -24($fp) +label_ENDIF_2: +# LOCAL local_board_init_at_Board_internal_48 --> -196($fp) +# local_board_init_at_Board_internal_48 = SELF +sw $s1, -196($fp) +# RETURN local_board_init_at_Board_internal_48 +lw $v0, -196($fp) +# Deallocate stack frame for function function_board_init_at_Board. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 204 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# __CellularAutomaton__attrib__population_map__init implementation. +# @Params: +__CellularAutomaton__attrib__population_map__init: + # Allocate stack frame for function __CellularAutomaton__attrib__population_map__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_rAutomaton__attrib__population_map__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -4($fp) + # RETURN local_rAutomaton__attrib__population_map__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __CellularAutomaton__attrib__population_map__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_init_at_CellularAutomaton_map_0 +function_init_at_CellularAutomaton: + # Allocate stack frame for function function_init_at_CellularAutomaton. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_CellularAutomaton_map_0 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 24($s1) + # LOCAL local_init_at_CellularAutomaton_internal_2 --> -12($fp) + # local_init_at_CellularAutomaton_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_init_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_init_at_CellularAutomaton_internal_2 --> -12($fp) + # local_init_at_CellularAutomaton_internal_0 = local_init_at_CellularAutomaton_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_init_at_CellularAutomaton_map_0 + # PARAM param_init_at_CellularAutomaton_map_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_init_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_init_at_CellularAutomaton_internal_1 --> -8($fp) + # local_init_at_CellularAutomaton_internal_1 = VCALL local_init_at_CellularAutomaton_internal_0 board_init + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 84($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_init_at_CellularAutomaton_internal_3 --> -16($fp) + # local_init_at_CellularAutomaton_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_init_at_CellularAutomaton_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_init_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_at_CellularAutomaton implementation. +# @Params: +function_print_at_CellularAutomaton: + # Allocate stack frame for function function_print_at_CellularAutomaton. + subu $sp, $sp, 120 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 120 + # LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_print_at_CellularAutomaton_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) + # LOCAL local_print_at_CellularAutomaton_internal_1 --> -8($fp) + # local_print_at_CellularAutomaton_i_0 = local_print_at_CellularAutomaton_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_print_at_CellularAutomaton_num_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # local_print_at_CellularAutomaton_internal_3 = GETATTRIBUTE board_size CellularAutomaton + # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) + lw $t0, 20($s1) + sw $t0, -16($fp) + # LOCAL local_print_at_CellularAutomaton_num_2 --> -12($fp) + # LOCAL local_print_at_CellularAutomaton_internal_3 --> -16($fp) + # local_print_at_CellularAutomaton_num_2 = local_print_at_CellularAutomaton_internal_3 + lw $t0, -16($fp) + sw $t0, -12($fp) + # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) + # local_print_at_CellularAutomaton_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_print_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_print_at_CellularAutomaton_internal_6 --> -28($fp) + # local_print_at_CellularAutomaton_internal_4 = local_print_at_CellularAutomaton_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -32($fp) + # ARG local_print_at_CellularAutomaton_internal_7 + # LOCAL local_print_at_CellularAutomaton_internal_7 --> -32($fp) + lw $t0, -32($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_print_at_CellularAutomaton_internal_5 --> -24($fp) + # local_print_at_CellularAutomaton_internal_5 = VCALL local_print_at_CellularAutomaton_internal_4 out_string + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_WHILE_61: + # LOCAL local_print_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) + # LOCAL local_print_at_CellularAutomaton_num_2 --> -12($fp) + lw $a0, -4($fp) + lw $a1, -12($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_GREATER_ZERO local_print_at_CellularAutomaton_internal_9 GOTO label_FALSE_63 + # IF_GREATER_ZERO local_print_at_CellularAutomaton_internal_9 GOTO label_FALSE_63 + lw $t0, -40($fp) + bgt $t0, 0, label_FALSE_63 + # IF_ZERO local_print_at_CellularAutomaton_internal_9 GOTO label_FALSE_63 + # IF_ZERO local_print_at_CellularAutomaton_internal_9 GOTO label_FALSE_63 + lw $t0, -40($fp) + beq $t0, 0, label_FALSE_63 + # LOCAL local_print_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -40($fp) + # GOTO label_END_64 +j label_END_64 +label_FALSE_63: + # LOCAL local_print_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -40($fp) + label_END_64: +# LOCAL local_print_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_print_at_CellularAutomaton_internal_9 --> -40($fp) +# Obtain value from -40($fp) +lw $v0, -40($fp) +lw $v0, 12($v0) +sw $v0, -36($fp) +# IF_ZERO local_print_at_CellularAutomaton_internal_8 GOTO label_WHILE_END_62 +# IF_ZERO local_print_at_CellularAutomaton_internal_8 GOTO label_WHILE_END_62 +lw $t0, -36($fp) +beq $t0, 0, label_WHILE_END_62 +# LOCAL local_print_at_CellularAutomaton_internal_12 --> -52($fp) +# local_print_at_CellularAutomaton_internal_12 = SELF +sw $s1, -52($fp) +# LOCAL local_print_at_CellularAutomaton_internal_10 --> -44($fp) +# LOCAL local_print_at_CellularAutomaton_internal_12 --> -52($fp) +# local_print_at_CellularAutomaton_internal_10 = local_print_at_CellularAutomaton_internal_12 +lw $t0, -52($fp) +sw $t0, -44($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_print_at_CellularAutomaton_internal_15 = GETATTRIBUTE population_map CellularAutomaton +# LOCAL local_print_at_CellularAutomaton_internal_15 --> -64($fp) +lw $t0, 24($s1) +sw $t0, -64($fp) +# LOCAL local_print_at_CellularAutomaton_internal_13 --> -56($fp) +# LOCAL local_print_at_CellularAutomaton_internal_15 --> -64($fp) +# local_print_at_CellularAutomaton_internal_13 = local_print_at_CellularAutomaton_internal_15 +lw $t0, -64($fp) +sw $t0, -56($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_print_at_CellularAutomaton_i_0 +# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) +lw $t0, -4($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# local_print_at_CellularAutomaton_internal_16 = GETATTRIBUTE columns CellularAutomaton +# LOCAL local_print_at_CellularAutomaton_internal_16 --> -68($fp) +lw $t0, 16($s1) +sw $t0, -68($fp) +# ARG local_print_at_CellularAutomaton_internal_16 +# LOCAL local_print_at_CellularAutomaton_internal_16 --> -68($fp) +lw $t0, -68($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_print_at_CellularAutomaton_internal_13 --> -56($fp) +# LOCAL local_print_at_CellularAutomaton_internal_14 --> -60($fp) +# local_print_at_CellularAutomaton_internal_14 = VCALL local_print_at_CellularAutomaton_internal_13 substr +# Save new self pointer in $s1 +lw $s1, -56($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 0($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -60($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_print_at_CellularAutomaton_internal_14 +# LOCAL local_print_at_CellularAutomaton_internal_14 --> -60($fp) +lw $t0, -60($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_print_at_CellularAutomaton_internal_10 --> -44($fp) +# LOCAL local_print_at_CellularAutomaton_internal_11 --> -48($fp) +# local_print_at_CellularAutomaton_internal_11 = VCALL local_print_at_CellularAutomaton_internal_10 out_string +# Save new self pointer in $s1 +lw $s1, -44($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 96($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -48($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_print_at_CellularAutomaton_internal_19 --> -80($fp) +# local_print_at_CellularAutomaton_internal_19 = SELF +sw $s1, -80($fp) +# LOCAL local_print_at_CellularAutomaton_internal_17 --> -72($fp) +# LOCAL local_print_at_CellularAutomaton_internal_19 --> -80($fp) +# local_print_at_CellularAutomaton_internal_17 = local_print_at_CellularAutomaton_internal_19 +lw $t0, -80($fp) +sw $t0, -72($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_print_at_CellularAutomaton_internal_20 --> -84($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_5 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -84($fp) +# ARG local_print_at_CellularAutomaton_internal_20 +# LOCAL local_print_at_CellularAutomaton_internal_20 --> -84($fp) +lw $t0, -84($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_print_at_CellularAutomaton_internal_17 --> -72($fp) +# LOCAL local_print_at_CellularAutomaton_internal_18 --> -76($fp) +# local_print_at_CellularAutomaton_internal_18 = VCALL local_print_at_CellularAutomaton_internal_17 out_string +# Save new self pointer in $s1 +lw $s1, -72($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 96($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -76($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# local_print_at_CellularAutomaton_internal_22 = GETATTRIBUTE columns CellularAutomaton +# LOCAL local_print_at_CellularAutomaton_internal_22 --> -92($fp) +lw $t0, 16($s1) +sw $t0, -92($fp) +# LOCAL local_print_at_CellularAutomaton_internal_21 --> -88($fp) +# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) +# LOCAL local_print_at_CellularAutomaton_internal_22 --> -92($fp) +# local_print_at_CellularAutomaton_internal_21 = local_print_at_CellularAutomaton_i_0 + local_print_at_CellularAutomaton_internal_22 +lw $t1, -4($fp) +lw $t0, 12($t1) +lw $t1, -92($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -88($fp) +# LOCAL local_print_at_CellularAutomaton_i_0 --> -4($fp) +# LOCAL local_print_at_CellularAutomaton_internal_21 --> -88($fp) +# local_print_at_CellularAutomaton_i_0 = local_print_at_CellularAutomaton_internal_21 +lw $t0, -88($fp) +sw $t0, -4($fp) +# GOTO label_WHILE_61 +j label_WHILE_61 +label_WHILE_END_62: + # LOCAL local_print_at_CellularAutomaton_internal_25 --> -104($fp) + # local_print_at_CellularAutomaton_internal_25 = SELF + sw $s1, -104($fp) + # LOCAL local_print_at_CellularAutomaton_internal_23 --> -96($fp) + # LOCAL local_print_at_CellularAutomaton_internal_25 --> -104($fp) + # local_print_at_CellularAutomaton_internal_23 = local_print_at_CellularAutomaton_internal_25 + lw $t0, -104($fp) + sw $t0, -96($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_6 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -108($fp) + # ARG local_print_at_CellularAutomaton_internal_26 + # LOCAL local_print_at_CellularAutomaton_internal_26 --> -108($fp) + lw $t0, -108($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_CellularAutomaton_internal_23 --> -96($fp) + # LOCAL local_print_at_CellularAutomaton_internal_24 --> -100($fp) + # local_print_at_CellularAutomaton_internal_24 = VCALL local_print_at_CellularAutomaton_internal_23 out_string + # Save new self pointer in $s1 + lw $s1, -96($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -100($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_CellularAutomaton_internal_27 --> -112($fp) + # local_print_at_CellularAutomaton_internal_27 = SELF + sw $s1, -112($fp) + # RETURN local_print_at_CellularAutomaton_internal_27 + lw $v0, -112($fp) + # Deallocate stack frame for function function_print_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 120 + jr $ra + # Function END + + +# function_num_cells_at_CellularAutomaton implementation. +# @Params: +function_num_cells_at_CellularAutomaton: + # Allocate stack frame for function function_num_cells_at_CellularAutomaton. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_num_cells_at_CellularAutomaton_internal_2 = GETATTRIBUTE population_map CellularAutomaton + # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) + lw $t0, 24($s1) + sw $t0, -12($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_2 --> -12($fp) + # local_num_cells_at_CellularAutomaton_internal_0 = local_num_cells_at_CellularAutomaton_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_0 --> -4($fp) + # LOCAL local_num_cells_at_CellularAutomaton_internal_1 --> -8($fp) + # local_num_cells_at_CellularAutomaton_internal_1 = VCALL local_num_cells_at_CellularAutomaton_internal_0 length + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 8($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_num_cells_at_CellularAutomaton_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_num_cells_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cell_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_cell_at_CellularAutomaton_position_0 +function_cell_at_CellularAutomaton: + # Allocate stack frame for function function_cell_at_CellularAutomaton. + subu $sp, $sp, 52 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 52 + # local_cell_at_CellularAutomaton_internal_4 = GETATTRIBUTE board_size CellularAutomaton + # LOCAL local_cell_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t0, 20($s1) + sw $t0, -20($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -24($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_5 --> -24($fp) + # local_cell_at_CellularAutomaton_internal_3 = local_cell_at_CellularAutomaton_internal_4 - local_cell_at_CellularAutomaton_internal_5 + lw $t1, -20($fp) + lw $t0, 12($t1) + lw $t1, -24($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -16($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_cell_at_CellularAutomaton_position_0 --> 0($fp) + lw $a0, -16($fp) + lw $a1, 0($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -12($fp) + # IF_GREATER_ZERO local_cell_at_CellularAutomaton_internal_2 GOTO label_FALSE_67 + # IF_GREATER_ZERO local_cell_at_CellularAutomaton_internal_2 GOTO label_FALSE_67 + lw $t0, -12($fp) + bgt $t0, 0, label_FALSE_67 + # IF_ZERO local_cell_at_CellularAutomaton_internal_2 GOTO label_FALSE_67 + # IF_ZERO local_cell_at_CellularAutomaton_internal_2 GOTO label_FALSE_67 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_67 + # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_68 +j label_END_68 +label_FALSE_67: + # LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_68: +# LOCAL local_cell_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_cell_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_cell_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_65 +# IF_ZERO local_cell_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_65 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_65 +# LOCAL local_cell_at_CellularAutomaton_internal_6 --> -28($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_7 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -28($fp) +# LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_cell_at_CellularAutomaton_internal_6 --> -28($fp) +# local_cell_at_CellularAutomaton_internal_1 = local_cell_at_CellularAutomaton_internal_6 +lw $t0, -28($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_66 +j label_ENDIF_66 +label_FALSEIF_65: + # local_cell_at_CellularAutomaton_internal_9 = GETATTRIBUTE population_map CellularAutomaton + # LOCAL local_cell_at_CellularAutomaton_internal_9 --> -40($fp) + lw $t0, 24($s1) + sw $t0, -40($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_9 --> -40($fp) + # local_cell_at_CellularAutomaton_internal_7 = local_cell_at_CellularAutomaton_internal_9 + lw $t0, -40($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cell_at_CellularAutomaton_position_0 + # PARAM param_cell_at_CellularAutomaton_position_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cell_at_CellularAutomaton_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + # ARG local_cell_at_CellularAutomaton_internal_10 + # LOCAL local_cell_at_CellularAutomaton_internal_10 --> -44($fp) + lw $t0, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cell_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_8 --> -36($fp) + # local_cell_at_CellularAutomaton_internal_8 = VCALL local_cell_at_CellularAutomaton_internal_7 substr + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_cell_at_CellularAutomaton_internal_8 --> -36($fp) + # local_cell_at_CellularAutomaton_internal_1 = local_cell_at_CellularAutomaton_internal_8 + lw $t0, -36($fp) + sw $t0, -8($fp) + label_ENDIF_66: +# RETURN local_cell_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_cell_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 52 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_north_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_north_at_CellularAutomaton_position_0 +function_north_at_CellularAutomaton: + # Allocate stack frame for function function_north_at_CellularAutomaton. + subu $sp, $sp, 56 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 56 + # local_north_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_north_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # LOCAL local_north_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_north_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_north_at_CellularAutomaton_internal_4 --> -20($fp) + # local_north_at_CellularAutomaton_internal_3 = PARAM param_north_at_CellularAutomaton_position_0 - local_north_at_CellularAutomaton_internal_4 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -20($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -16($fp) + # LOCAL local_north_at_CellularAutomaton_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # LOCAL local_north_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_north_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_north_at_CellularAutomaton_internal_5 --> -24($fp) + lw $a0, -16($fp) + lw $a1, -24($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -12($fp) + # IF_GREATER_ZERO local_north_at_CellularAutomaton_internal_2 GOTO label_FALSE_71 + # IF_GREATER_ZERO local_north_at_CellularAutomaton_internal_2 GOTO label_FALSE_71 + lw $t0, -12($fp) + bgt $t0, 0, label_FALSE_71 + # IF_ZERO local_north_at_CellularAutomaton_internal_2 GOTO label_FALSE_71 + # IF_ZERO local_north_at_CellularAutomaton_internal_2 GOTO label_FALSE_71 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_71 + # LOCAL local_north_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_72 +j label_END_72 +label_FALSE_71: + # LOCAL local_north_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_72: +# LOCAL local_north_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_north_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_north_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_69 +# IF_ZERO local_north_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_69 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_69 +# LOCAL local_north_at_CellularAutomaton_internal_6 --> -28($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_8 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -28($fp) +# LOCAL local_north_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_north_at_CellularAutomaton_internal_6 --> -28($fp) +# local_north_at_CellularAutomaton_internal_1 = local_north_at_CellularAutomaton_internal_6 +lw $t0, -28($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_70 +j label_ENDIF_70 +label_FALSEIF_69: + # LOCAL local_north_at_CellularAutomaton_internal_9 --> -40($fp) + # local_north_at_CellularAutomaton_internal_9 = SELF + sw $s1, -40($fp) + # LOCAL local_north_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_north_at_CellularAutomaton_internal_9 --> -40($fp) + # local_north_at_CellularAutomaton_internal_7 = local_north_at_CellularAutomaton_internal_9 + lw $t0, -40($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_north_at_CellularAutomaton_internal_11 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_north_at_CellularAutomaton_internal_11 --> -48($fp) + lw $t0, 16($s1) + sw $t0, -48($fp) + # LOCAL local_north_at_CellularAutomaton_internal_10 --> -44($fp) + # PARAM param_north_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_north_at_CellularAutomaton_internal_11 --> -48($fp) + # local_north_at_CellularAutomaton_internal_10 = PARAM param_north_at_CellularAutomaton_position_0 - local_north_at_CellularAutomaton_internal_11 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -48($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -44($fp) + # ARG local_north_at_CellularAutomaton_internal_10 + # LOCAL local_north_at_CellularAutomaton_internal_10 --> -44($fp) + lw $t0, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_north_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_north_at_CellularAutomaton_internal_8 --> -36($fp) + # local_north_at_CellularAutomaton_internal_8 = VCALL local_north_at_CellularAutomaton_internal_7 cell + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_north_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_north_at_CellularAutomaton_internal_8 --> -36($fp) + # local_north_at_CellularAutomaton_internal_1 = local_north_at_CellularAutomaton_internal_8 + lw $t0, -36($fp) + sw $t0, -8($fp) + label_ENDIF_70: +# RETURN local_north_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_north_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 56 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_south_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_south_at_CellularAutomaton_position_0 +function_south_at_CellularAutomaton: + # Allocate stack frame for function function_south_at_CellularAutomaton. + subu $sp, $sp, 56 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 56 + # local_south_at_CellularAutomaton_internal_3 = GETATTRIBUTE board_size CellularAutomaton + # LOCAL local_south_at_CellularAutomaton_internal_3 --> -16($fp) + lw $t0, 20($s1) + sw $t0, -16($fp) + # local_south_at_CellularAutomaton_internal_5 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_south_at_CellularAutomaton_internal_5 --> -24($fp) + lw $t0, 16($s1) + sw $t0, -24($fp) + # LOCAL local_south_at_CellularAutomaton_internal_4 --> -20($fp) + # PARAM param_south_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_south_at_CellularAutomaton_internal_5 --> -24($fp) + # local_south_at_CellularAutomaton_internal_4 = PARAM param_south_at_CellularAutomaton_position_0 + local_south_at_CellularAutomaton_internal_5 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -24($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -20($fp) + # LOCAL local_south_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_south_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_south_at_CellularAutomaton_internal_4 --> -20($fp) + lw $a0, -16($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -12($fp) + # IF_GREATER_ZERO local_south_at_CellularAutomaton_internal_2 GOTO label_FALSE_75 + # IF_GREATER_ZERO local_south_at_CellularAutomaton_internal_2 GOTO label_FALSE_75 + lw $t0, -12($fp) + bgt $t0, 0, label_FALSE_75 + # IF_ZERO local_south_at_CellularAutomaton_internal_2 GOTO label_FALSE_75 + # IF_ZERO local_south_at_CellularAutomaton_internal_2 GOTO label_FALSE_75 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_75 + # LOCAL local_south_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_76 +j label_END_76 +label_FALSE_75: + # LOCAL local_south_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_76: +# LOCAL local_south_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_south_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_south_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_73 +# IF_ZERO local_south_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_73 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_73 +# LOCAL local_south_at_CellularAutomaton_internal_6 --> -28($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_9 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -28($fp) +# LOCAL local_south_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_south_at_CellularAutomaton_internal_6 --> -28($fp) +# local_south_at_CellularAutomaton_internal_1 = local_south_at_CellularAutomaton_internal_6 +lw $t0, -28($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_74 +j label_ENDIF_74 +label_FALSEIF_73: + # LOCAL local_south_at_CellularAutomaton_internal_9 --> -40($fp) + # local_south_at_CellularAutomaton_internal_9 = SELF + sw $s1, -40($fp) + # LOCAL local_south_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_south_at_CellularAutomaton_internal_9 --> -40($fp) + # local_south_at_CellularAutomaton_internal_7 = local_south_at_CellularAutomaton_internal_9 + lw $t0, -40($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_south_at_CellularAutomaton_internal_11 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_south_at_CellularAutomaton_internal_11 --> -48($fp) + lw $t0, 16($s1) + sw $t0, -48($fp) + # LOCAL local_south_at_CellularAutomaton_internal_10 --> -44($fp) + # PARAM param_south_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_south_at_CellularAutomaton_internal_11 --> -48($fp) + # local_south_at_CellularAutomaton_internal_10 = PARAM param_south_at_CellularAutomaton_position_0 + local_south_at_CellularAutomaton_internal_11 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -48($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -44($fp) + # ARG local_south_at_CellularAutomaton_internal_10 + # LOCAL local_south_at_CellularAutomaton_internal_10 --> -44($fp) + lw $t0, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_south_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_south_at_CellularAutomaton_internal_8 --> -36($fp) + # local_south_at_CellularAutomaton_internal_8 = VCALL local_south_at_CellularAutomaton_internal_7 cell + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_south_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_south_at_CellularAutomaton_internal_8 --> -36($fp) + # local_south_at_CellularAutomaton_internal_1 = local_south_at_CellularAutomaton_internal_8 + lw $t0, -36($fp) + sw $t0, -8($fp) + label_ENDIF_74: +# RETURN local_south_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_south_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 56 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_east_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_east_at_CellularAutomaton_position_0 +function_east_at_CellularAutomaton: + # Allocate stack frame for function function_east_at_CellularAutomaton. + subu $sp, $sp, 80 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 80 + # LOCAL local_east_at_CellularAutomaton_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -32($fp) + # LOCAL local_east_at_CellularAutomaton_internal_6 --> -28($fp) + # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_east_at_CellularAutomaton_internal_7 --> -32($fp) + # local_east_at_CellularAutomaton_internal_6 = PARAM param_east_at_CellularAutomaton_position_0 + local_east_at_CellularAutomaton_internal_7 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -32($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -28($fp) + # local_east_at_CellularAutomaton_internal_8 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_east_at_CellularAutomaton_internal_8 --> -36($fp) + lw $t0, 16($s1) + sw $t0, -36($fp) + # LOCAL local_east_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_east_at_CellularAutomaton_internal_6 --> -28($fp) + # LOCAL local_east_at_CellularAutomaton_internal_8 --> -36($fp) + # local_east_at_CellularAutomaton_internal_5 = local_east_at_CellularAutomaton_internal_6 / local_east_at_CellularAutomaton_internal_8 + lw $t1, -28($fp) + lw $t0, 12($t1) + lw $t1, -36($fp) + lw $t2, 12($t1) + div $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -24($fp) + # local_east_at_CellularAutomaton_internal_9 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_east_at_CellularAutomaton_internal_9 --> -40($fp) + lw $t0, 16($s1) + sw $t0, -40($fp) + # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_east_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_east_at_CellularAutomaton_internal_9 --> -40($fp) + # local_east_at_CellularAutomaton_internal_4 = local_east_at_CellularAutomaton_internal_5 * local_east_at_CellularAutomaton_internal_9 + lw $t1, -24($fp) + lw $t0, 12($t1) + lw $t1, -40($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -20($fp) + # LOCAL local_east_at_CellularAutomaton_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -48($fp) + # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) + # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_east_at_CellularAutomaton_internal_11 --> -48($fp) + # local_east_at_CellularAutomaton_internal_10 = PARAM param_east_at_CellularAutomaton_position_0 + local_east_at_CellularAutomaton_internal_11 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -48($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -44($fp) + # IF_ZERO local_east_at_CellularAutomaton_internal_4 GOTO label_FALSE_79 + # IF_ZERO local_east_at_CellularAutomaton_internal_4 GOTO label_FALSE_79 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_79 + # IF_ZERO local_east_at_CellularAutomaton_internal_10 GOTO label_FALSE_79 + # IF_ZERO local_east_at_CellularAutomaton_internal_10 GOTO label_FALSE_79 + lw $t0, -44($fp) + beq $t0, 0, label_FALSE_79 + # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) + # Comparing -20($fp) type with String + la $v0, String + lw $a0, -20($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_82 + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_82 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_82 + # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) + # Comparing -20($fp) type with Bool + la $v0, Bool + lw $a0, -20($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_83 + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_83 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_83 + # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) + # Comparing -20($fp) type with Int + la $v0, Int + lw $a0, -20($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_83 + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_83 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_83 + # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) + # Load pointers and SUB + lw $a0, -20($fp) + lw $a1, -44($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_TRUE_80 + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_TRUE_80 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_80 + # GOTO label_FALSE_79 + j label_FALSE_79 + label_COMPARE_BY_VALUE_83: + # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) + lw $a0, -20($fp) + lw $a1, -44($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_TRUE_80 + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_TRUE_80 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_80 + # GOTO label_FALSE_79 + j label_FALSE_79 + label_COMPARE_STRING_82: + # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -44($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_84 + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_84 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_84 + # GOTO label_FALSE_79 + j label_FALSE_79 + label_CONTINUE_84: + # LOCAL local_east_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_east_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_east_at_CellularAutomaton_internal_10 --> -44($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -44($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_85: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_86 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_85 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_86: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_TRUE_80 + # IF_ZERO local_east_at_CellularAutomaton_internal_3 GOTO label_TRUE_80 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_80 + label_FALSE_79: + # LOCAL local_east_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_81 +j label_END_81 +label_TRUE_80: + # LOCAL local_east_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_81: +# LOCAL local_east_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_east_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_east_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_77 +# IF_ZERO local_east_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_77 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_77 +# LOCAL local_east_at_CellularAutomaton_internal_12 --> -52($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_10 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -52($fp) +# LOCAL local_east_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_east_at_CellularAutomaton_internal_12 --> -52($fp) +# local_east_at_CellularAutomaton_internal_1 = local_east_at_CellularAutomaton_internal_12 +lw $t0, -52($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_78 +j label_ENDIF_78 +label_FALSEIF_77: + # LOCAL local_east_at_CellularAutomaton_internal_15 --> -64($fp) + # local_east_at_CellularAutomaton_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_east_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_east_at_CellularAutomaton_internal_15 --> -64($fp) + # local_east_at_CellularAutomaton_internal_13 = local_east_at_CellularAutomaton_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_east_at_CellularAutomaton_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -72($fp) + # LOCAL local_east_at_CellularAutomaton_internal_16 --> -68($fp) + # PARAM param_east_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_east_at_CellularAutomaton_internal_17 --> -72($fp) + # local_east_at_CellularAutomaton_internal_16 = PARAM param_east_at_CellularAutomaton_position_0 + local_east_at_CellularAutomaton_internal_17 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -72($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -68($fp) + # ARG local_east_at_CellularAutomaton_internal_16 + # LOCAL local_east_at_CellularAutomaton_internal_16 --> -68($fp) + lw $t0, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_east_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_east_at_CellularAutomaton_internal_14 --> -60($fp) + # local_east_at_CellularAutomaton_internal_14 = VCALL local_east_at_CellularAutomaton_internal_13 cell + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_east_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_east_at_CellularAutomaton_internal_14 --> -60($fp) + # local_east_at_CellularAutomaton_internal_1 = local_east_at_CellularAutomaton_internal_14 + lw $t0, -60($fp) + sw $t0, -8($fp) + label_ENDIF_78: +# RETURN local_east_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_east_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 80 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_west_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_west_at_CellularAutomaton_position_0 +function_west_at_CellularAutomaton: + # Allocate stack frame for function function_west_at_CellularAutomaton. + subu $sp, $sp, 88 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 88 + # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + # IF_ZERO param_west_at_CellularAutomaton_position_0 GOTO label_FALSE_89 + # IF_ZERO param_west_at_CellularAutomaton_position_0 GOTO label_FALSE_89 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_89 + # IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_FALSE_89 + # IF_ZERO local_west_at_CellularAutomaton_internal_4 GOTO label_FALSE_89 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_89 + # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # Comparing 0($fp) type with String + la $v0, String + lw $a0, 0($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_92 + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_92 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_92 + # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # Comparing 0($fp) type with Bool + la $v0, Bool + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_93 + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_93 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_93 + # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # Comparing 0($fp) type with Int + la $v0, Int + lw $a0, 0($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_93 + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_93 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_93 + # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) + # Load pointers and SUB + lw $a0, 0($fp) + lw $a1, -20($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_TRUE_90 + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_TRUE_90 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_90 + # GOTO label_FALSE_89 + j label_FALSE_89 + label_COMPARE_BY_VALUE_93: + # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) + lw $a0, 0($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_TRUE_90 + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_TRUE_90 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_90 + # GOTO label_FALSE_89 + j label_FALSE_89 + label_COMPARE_STRING_92: + # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_94 + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_94 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_94 + # GOTO label_FALSE_89 + j label_FALSE_89 + label_CONTINUE_94: + # LOCAL local_west_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_west_at_CellularAutomaton_internal_4 --> -20($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, 0($fp) + lw $v1, -20($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_95: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_96 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_95 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_96: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_TRUE_90 + # IF_ZERO local_west_at_CellularAutomaton_internal_3 GOTO label_TRUE_90 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_90 + label_FALSE_89: + # LOCAL local_west_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_91 +j label_END_91 +label_TRUE_90: + # LOCAL local_west_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_91: +# LOCAL local_west_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_west_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_west_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_87 +# IF_ZERO local_west_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_87 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_87 +# LOCAL local_west_at_CellularAutomaton_internal_5 --> -24($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_11 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -24($fp) +# LOCAL local_west_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_west_at_CellularAutomaton_internal_5 --> -24($fp) +# local_west_at_CellularAutomaton_internal_1 = local_west_at_CellularAutomaton_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_88 +j label_ENDIF_88 +label_FALSEIF_87: + # local_west_at_CellularAutomaton_internal_12 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_west_at_CellularAutomaton_internal_12 --> -52($fp) + lw $t0, 16($s1) + sw $t0, -52($fp) + # LOCAL local_west_at_CellularAutomaton_internal_11 --> -48($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_west_at_CellularAutomaton_internal_12 --> -52($fp) + # local_west_at_CellularAutomaton_internal_11 = PARAM param_west_at_CellularAutomaton_position_0 / local_west_at_CellularAutomaton_internal_12 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -52($fp) + lw $t2, 12($t1) + div $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -48($fp) + # local_west_at_CellularAutomaton_internal_13 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_west_at_CellularAutomaton_internal_13 --> -56($fp) + lw $t0, 16($s1) + sw $t0, -56($fp) + # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_west_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_west_at_CellularAutomaton_internal_13 --> -56($fp) + # local_west_at_CellularAutomaton_internal_10 = local_west_at_CellularAutomaton_internal_11 * local_west_at_CellularAutomaton_internal_13 + lw $t1, -48($fp) + lw $t0, 12($t1) + lw $t1, -56($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -44($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_10 GOTO label_FALSE_99 + # IF_ZERO local_west_at_CellularAutomaton_internal_10 GOTO label_FALSE_99 + lw $t0, -44($fp) + beq $t0, 0, label_FALSE_99 + # IF_ZERO param_west_at_CellularAutomaton_position_0 GOTO label_FALSE_99 + # IF_ZERO param_west_at_CellularAutomaton_position_0 GOTO label_FALSE_99 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_99 + # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) + # Comparing -44($fp) type with String + la $v0, String + lw $a0, -44($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_COMPARE_STRING_102 + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_COMPARE_STRING_102 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_102 + # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) + # Comparing -44($fp) type with Bool + la $v0, Bool + lw $a0, -44($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_103 + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_103 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_103 + # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) + # Comparing -44($fp) type with Int + la $v0, Int + lw $a0, -44($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_103 + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_COMPARE_BY_VALUE_103 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_103 + # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # Load pointers and SUB + lw $a0, -44($fp) + lw $a1, 0($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_TRUE_100 + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_TRUE_100 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_100 + # GOTO label_FALSE_99 + j label_FALSE_99 + label_COMPARE_BY_VALUE_103: + # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + lw $a0, -44($fp) + lw $a1, 0($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_TRUE_100 + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_TRUE_100 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_100 + # GOTO label_FALSE_99 + j label_FALSE_99 + label_COMPARE_STRING_102: + # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # Load strings for comparison + lw $v0, -44($fp) + lw $v1, 0($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_CONTINUE_104 + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_CONTINUE_104 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_104 + # GOTO label_FALSE_99 + j label_FALSE_99 + label_CONTINUE_104: + # LOCAL local_west_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_west_at_CellularAutomaton_internal_10 --> -44($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -44($fp) + lw $v1, 0($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_105: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_106 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_105 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_106: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_TRUE_100 + # IF_ZERO local_west_at_CellularAutomaton_internal_9 GOTO label_TRUE_100 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_100 + label_FALSE_99: + # LOCAL local_west_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_101 +j label_END_101 +label_TRUE_100: + # LOCAL local_west_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_101: +# LOCAL local_west_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_west_at_CellularAutomaton_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_west_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_97 +# IF_ZERO local_west_at_CellularAutomaton_internal_6 GOTO label_FALSEIF_97 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_97 +# LOCAL local_west_at_CellularAutomaton_internal_14 --> -60($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_12 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -60($fp) +# LOCAL local_west_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_west_at_CellularAutomaton_internal_14 --> -60($fp) +# local_west_at_CellularAutomaton_internal_7 = local_west_at_CellularAutomaton_internal_14 +lw $t0, -60($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_98 +j label_ENDIF_98 +label_FALSEIF_97: + # LOCAL local_west_at_CellularAutomaton_internal_17 --> -72($fp) + # local_west_at_CellularAutomaton_internal_17 = SELF + sw $s1, -72($fp) + # LOCAL local_west_at_CellularAutomaton_internal_15 --> -64($fp) + # LOCAL local_west_at_CellularAutomaton_internal_17 --> -72($fp) + # local_west_at_CellularAutomaton_internal_15 = local_west_at_CellularAutomaton_internal_17 + lw $t0, -72($fp) + sw $t0, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_west_at_CellularAutomaton_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -80($fp) + # LOCAL local_west_at_CellularAutomaton_internal_18 --> -76($fp) + # PARAM param_west_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_west_at_CellularAutomaton_internal_19 --> -80($fp) + # local_west_at_CellularAutomaton_internal_18 = PARAM param_west_at_CellularAutomaton_position_0 - local_west_at_CellularAutomaton_internal_19 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -80($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -76($fp) + # ARG local_west_at_CellularAutomaton_internal_18 + # LOCAL local_west_at_CellularAutomaton_internal_18 --> -76($fp) + lw $t0, -76($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_west_at_CellularAutomaton_internal_15 --> -64($fp) + # LOCAL local_west_at_CellularAutomaton_internal_16 --> -68($fp) + # local_west_at_CellularAutomaton_internal_16 = VCALL local_west_at_CellularAutomaton_internal_15 cell + # Save new self pointer in $s1 + lw $s1, -64($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_west_at_CellularAutomaton_internal_7 --> -32($fp) + # LOCAL local_west_at_CellularAutomaton_internal_16 --> -68($fp) + # local_west_at_CellularAutomaton_internal_7 = local_west_at_CellularAutomaton_internal_16 + lw $t0, -68($fp) + sw $t0, -32($fp) + label_ENDIF_98: +# LOCAL local_west_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_west_at_CellularAutomaton_internal_7 --> -32($fp) +# local_west_at_CellularAutomaton_internal_1 = local_west_at_CellularAutomaton_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +label_ENDIF_88: +# RETURN local_west_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_west_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 88 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_northwest_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_northwest_at_CellularAutomaton_position_0 +function_northwest_at_CellularAutomaton: + # Allocate stack frame for function function_northwest_at_CellularAutomaton. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # local_northwest_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northwest_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_4 --> -20($fp) + # local_northwest_at_CellularAutomaton_internal_3 = PARAM param_northwest_at_CellularAutomaton_position_0 - local_northwest_at_CellularAutomaton_internal_4 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -20($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -16($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_5 --> -24($fp) + lw $a0, -16($fp) + lw $a1, -24($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -12($fp) + # IF_GREATER_ZERO local_northwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_109 + # IF_GREATER_ZERO local_northwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_109 + lw $t0, -12($fp) + bgt $t0, 0, label_FALSE_109 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_109 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_109 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_109 + # LOCAL local_northwest_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_110 +j label_END_110 +label_FALSE_109: + # LOCAL local_northwest_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_110: +# LOCAL local_northwest_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_northwest_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_107 +# IF_ZERO local_northwest_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_107 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_107 +# LOCAL local_northwest_at_CellularAutomaton_internal_6 --> -28($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_13 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -28($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_6 --> -28($fp) +# local_northwest_at_CellularAutomaton_internal_1 = local_northwest_at_CellularAutomaton_internal_6 +lw $t0, -28($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_108 +j label_ENDIF_108 +label_FALSEIF_107: + # local_northwest_at_CellularAutomaton_internal_13 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northwest_at_CellularAutomaton_internal_13 --> -56($fp) + lw $t0, 16($s1) + sw $t0, -56($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_12 --> -52($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_13 --> -56($fp) + # local_northwest_at_CellularAutomaton_internal_12 = PARAM param_northwest_at_CellularAutomaton_position_0 / local_northwest_at_CellularAutomaton_internal_13 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -56($fp) + lw $t2, 12($t1) + div $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -52($fp) + # local_northwest_at_CellularAutomaton_internal_14 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northwest_at_CellularAutomaton_internal_14 --> -60($fp) + lw $t0, 16($s1) + sw $t0, -60($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_14 --> -60($fp) + # local_northwest_at_CellularAutomaton_internal_11 = local_northwest_at_CellularAutomaton_internal_12 * local_northwest_at_CellularAutomaton_internal_14 + lw $t1, -52($fp) + lw $t0, 12($t1) + lw $t1, -60($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -48($fp) + # IF_ZERO local_northwest_at_CellularAutomaton_internal_11 GOTO label_FALSE_113 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_11 GOTO label_FALSE_113 + lw $t0, -48($fp) + beq $t0, 0, label_FALSE_113 + # IF_ZERO param_northwest_at_CellularAutomaton_position_0 GOTO label_FALSE_113 + # IF_ZERO param_northwest_at_CellularAutomaton_position_0 GOTO label_FALSE_113 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_113 + # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with String + la $v0, String + lw $a0, -48($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_116 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_116 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_STRING_116 + # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with Bool + la $v0, Bool + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_117 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_117 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_117 + # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with Int + la $v0, Int + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_117 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_117 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_117 + # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + # Load pointers and SUB + lw $a0, -48($fp) + lw $a1, 0($fp) + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_114 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_114 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_114 + # GOTO label_FALSE_113 + j label_FALSE_113 + label_COMPARE_BY_VALUE_117: + # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + lw $a0, -48($fp) + lw $a1, 0($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_114 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_114 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_114 + # GOTO label_FALSE_113 + j label_FALSE_113 + label_COMPARE_STRING_116: + # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, 0($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -44($fp) + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_118 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_118 + lw $t0, -44($fp) + beq $t0, 0, label_CONTINUE_118 + # GOTO label_FALSE_113 + j label_FALSE_113 + label_CONTINUE_118: + # LOCAL local_northwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_11 --> -48($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, 0($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_119: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_120 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_119 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_120: + # Store result + sw $a2, -44($fp) + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_114 + # IF_ZERO local_northwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_114 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_114 + label_FALSE_113: + # LOCAL local_northwest_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -40($fp) + # GOTO label_END_115 +j label_END_115 +label_TRUE_114: + # LOCAL local_northwest_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -40($fp) + label_END_115: +# LOCAL local_northwest_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_9 --> -40($fp) +# Obtain value from -40($fp) +lw $v0, -40($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_northwest_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_111 +# IF_ZERO local_northwest_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_111 +lw $t0, -32($fp) +beq $t0, 0, label_FALSEIF_111 +# LOCAL local_northwest_at_CellularAutomaton_internal_15 --> -64($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_14 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -64($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_15 --> -64($fp) +# local_northwest_at_CellularAutomaton_internal_8 = local_northwest_at_CellularAutomaton_internal_15 +lw $t0, -64($fp) +sw $t0, -36($fp) +# GOTO label_ENDIF_112 +j label_ENDIF_112 +label_FALSEIF_111: + # LOCAL local_northwest_at_CellularAutomaton_internal_18 --> -76($fp) + # local_northwest_at_CellularAutomaton_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_16 --> -68($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_18 --> -76($fp) + # local_northwest_at_CellularAutomaton_internal_16 = local_northwest_at_CellularAutomaton_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_northwest_at_CellularAutomaton_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -84($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_19 --> -80($fp) + # PARAM param_northwest_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_20 --> -84($fp) + # local_northwest_at_CellularAutomaton_internal_19 = PARAM param_northwest_at_CellularAutomaton_position_0 - local_northwest_at_CellularAutomaton_internal_20 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -84($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -80($fp) + # ARG local_northwest_at_CellularAutomaton_internal_19 + # LOCAL local_northwest_at_CellularAutomaton_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_northwest_at_CellularAutomaton_internal_16 --> -68($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_17 --> -72($fp) + # local_northwest_at_CellularAutomaton_internal_17 = VCALL local_northwest_at_CellularAutomaton_internal_16 north + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 76($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_northwest_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_northwest_at_CellularAutomaton_internal_17 --> -72($fp) + # local_northwest_at_CellularAutomaton_internal_8 = local_northwest_at_CellularAutomaton_internal_17 + lw $t0, -72($fp) + sw $t0, -36($fp) + label_ENDIF_112: +# LOCAL local_northwest_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_northwest_at_CellularAutomaton_internal_8 --> -36($fp) +# local_northwest_at_CellularAutomaton_internal_1 = local_northwest_at_CellularAutomaton_internal_8 +lw $t0, -36($fp) +sw $t0, -8($fp) +label_ENDIF_108: +# RETURN local_northwest_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_northwest_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 92 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_northeast_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_northeast_at_CellularAutomaton_position_0 +function_northeast_at_CellularAutomaton: + # Allocate stack frame for function function_northeast_at_CellularAutomaton. + subu $sp, $sp, 108 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 108 + # local_northeast_at_CellularAutomaton_internal_4 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northeast_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_3 --> -16($fp) + # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_4 --> -20($fp) + # local_northeast_at_CellularAutomaton_internal_3 = PARAM param_northeast_at_CellularAutomaton_position_0 - local_northeast_at_CellularAutomaton_internal_4 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -20($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -16($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_5 --> -24($fp) + lw $a0, -16($fp) + lw $a1, -24($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -12($fp) + # IF_GREATER_ZERO local_northeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_123 + # IF_GREATER_ZERO local_northeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_123 + lw $t0, -12($fp) + bgt $t0, 0, label_FALSE_123 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_123 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_123 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_123 + # LOCAL local_northeast_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_124 +j label_END_124 +label_FALSE_123: + # LOCAL local_northeast_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_124: +# LOCAL local_northeast_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_northeast_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_121 +# IF_ZERO local_northeast_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_121 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_121 +# LOCAL local_northeast_at_CellularAutomaton_internal_6 --> -28($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_15 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -28($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_6 --> -28($fp) +# local_northeast_at_CellularAutomaton_internal_1 = local_northeast_at_CellularAutomaton_internal_6 +lw $t0, -28($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_122 +j label_ENDIF_122 +label_FALSEIF_121: + # LOCAL local_northeast_at_CellularAutomaton_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_13 --> -56($fp) + # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_14 --> -60($fp) + # local_northeast_at_CellularAutomaton_internal_13 = PARAM param_northeast_at_CellularAutomaton_position_0 + local_northeast_at_CellularAutomaton_internal_14 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -60($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -56($fp) + # local_northeast_at_CellularAutomaton_internal_15 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northeast_at_CellularAutomaton_internal_15 --> -64($fp) + lw $t0, 16($s1) + sw $t0, -64($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_15 --> -64($fp) + # local_northeast_at_CellularAutomaton_internal_12 = local_northeast_at_CellularAutomaton_internal_13 / local_northeast_at_CellularAutomaton_internal_15 + lw $t1, -56($fp) + lw $t0, 12($t1) + lw $t1, -64($fp) + lw $t2, 12($t1) + div $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -52($fp) + # local_northeast_at_CellularAutomaton_internal_16 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_northeast_at_CellularAutomaton_internal_16 --> -68($fp) + lw $t0, 16($s1) + sw $t0, -68($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_16 --> -68($fp) + # local_northeast_at_CellularAutomaton_internal_11 = local_northeast_at_CellularAutomaton_internal_12 * local_northeast_at_CellularAutomaton_internal_16 + lw $t1, -52($fp) + lw $t0, 12($t1) + lw $t1, -68($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -48($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -76($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) + # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_18 --> -76($fp) + # local_northeast_at_CellularAutomaton_internal_17 = PARAM param_northeast_at_CellularAutomaton_position_0 + local_northeast_at_CellularAutomaton_internal_18 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -76($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -72($fp) + # IF_ZERO local_northeast_at_CellularAutomaton_internal_11 GOTO label_FALSE_127 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_11 GOTO label_FALSE_127 + lw $t0, -48($fp) + beq $t0, 0, label_FALSE_127 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_17 GOTO label_FALSE_127 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_17 GOTO label_FALSE_127 + lw $t0, -72($fp) + beq $t0, 0, label_FALSE_127 + # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with String + la $v0, String + lw $a0, -48($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_130 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_130 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_STRING_130 + # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with Bool + la $v0, Bool + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_131 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_131 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_131 + # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with Int + la $v0, Int + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_131 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_131 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_131 + # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) + # Load pointers and SUB + lw $a0, -48($fp) + lw $a1, -72($fp) + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_128 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_128 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_128 + # GOTO label_FALSE_127 + j label_FALSE_127 + label_COMPARE_BY_VALUE_131: + # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) + lw $a0, -48($fp) + lw $a1, -72($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_128 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_128 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_128 + # GOTO label_FALSE_127 + j label_FALSE_127 + label_COMPARE_STRING_130: + # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -72($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -44($fp) + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_132 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_132 + lw $t0, -44($fp) + beq $t0, 0, label_CONTINUE_132 + # GOTO label_FALSE_127 + j label_FALSE_127 + label_CONTINUE_132: + # LOCAL local_northeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_17 --> -72($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -72($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_133: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_134 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_133 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_134: + # Store result + sw $a2, -44($fp) + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_128 + # IF_ZERO local_northeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_128 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_128 + label_FALSE_127: + # LOCAL local_northeast_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -40($fp) + # GOTO label_END_129 +j label_END_129 +label_TRUE_128: + # LOCAL local_northeast_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -40($fp) + label_END_129: +# LOCAL local_northeast_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_9 --> -40($fp) +# Obtain value from -40($fp) +lw $v0, -40($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_northeast_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_125 +# IF_ZERO local_northeast_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_125 +lw $t0, -32($fp) +beq $t0, 0, label_FALSEIF_125 +# LOCAL local_northeast_at_CellularAutomaton_internal_19 --> -80($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_16 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -80($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_19 --> -80($fp) +# local_northeast_at_CellularAutomaton_internal_8 = local_northeast_at_CellularAutomaton_internal_19 +lw $t0, -80($fp) +sw $t0, -36($fp) +# GOTO label_ENDIF_126 +j label_ENDIF_126 +label_FALSEIF_125: + # LOCAL local_northeast_at_CellularAutomaton_internal_22 --> -92($fp) + # local_northeast_at_CellularAutomaton_internal_22 = SELF + sw $s1, -92($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_22 --> -92($fp) + # local_northeast_at_CellularAutomaton_internal_20 = local_northeast_at_CellularAutomaton_internal_22 + lw $t0, -92($fp) + sw $t0, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_northeast_at_CellularAutomaton_internal_24 --> -100($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -100($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_23 --> -96($fp) + # PARAM param_northeast_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_24 --> -100($fp) + # local_northeast_at_CellularAutomaton_internal_23 = PARAM param_northeast_at_CellularAutomaton_position_0 + local_northeast_at_CellularAutomaton_internal_24 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -100($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -96($fp) + # ARG local_northeast_at_CellularAutomaton_internal_23 + # LOCAL local_northeast_at_CellularAutomaton_internal_23 --> -96($fp) + lw $t0, -96($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_northeast_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_21 --> -88($fp) + # local_northeast_at_CellularAutomaton_internal_21 = VCALL local_northeast_at_CellularAutomaton_internal_20 north + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 76($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_northeast_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_northeast_at_CellularAutomaton_internal_21 --> -88($fp) + # local_northeast_at_CellularAutomaton_internal_8 = local_northeast_at_CellularAutomaton_internal_21 + lw $t0, -88($fp) + sw $t0, -36($fp) + label_ENDIF_126: +# LOCAL local_northeast_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_northeast_at_CellularAutomaton_internal_8 --> -36($fp) +# local_northeast_at_CellularAutomaton_internal_1 = local_northeast_at_CellularAutomaton_internal_8 +lw $t0, -36($fp) +sw $t0, -8($fp) +label_ENDIF_122: +# RETURN local_northeast_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_northeast_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 108 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_southeast_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_southeast_at_CellularAutomaton_position_0 +function_southeast_at_CellularAutomaton: + # Allocate stack frame for function function_southeast_at_CellularAutomaton. + subu $sp, $sp, 108 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 108 + # local_southeast_at_CellularAutomaton_internal_3 = GETATTRIBUTE board_size CellularAutomaton + # LOCAL local_southeast_at_CellularAutomaton_internal_3 --> -16($fp) + lw $t0, 20($s1) + sw $t0, -16($fp) + # local_southeast_at_CellularAutomaton_internal_5 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southeast_at_CellularAutomaton_internal_5 --> -24($fp) + lw $t0, 16($s1) + sw $t0, -24($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_4 --> -20($fp) + # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_5 --> -24($fp) + # local_southeast_at_CellularAutomaton_internal_4 = PARAM param_southeast_at_CellularAutomaton_position_0 + local_southeast_at_CellularAutomaton_internal_5 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -24($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -20($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_4 --> -20($fp) + lw $a0, -16($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -12($fp) + # IF_GREATER_ZERO local_southeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_137 + # IF_GREATER_ZERO local_southeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_137 + lw $t0, -12($fp) + bgt $t0, 0, label_FALSE_137 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_137 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_2 GOTO label_FALSE_137 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_137 + # LOCAL local_southeast_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_138 +j label_END_138 +label_FALSE_137: + # LOCAL local_southeast_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_138: +# LOCAL local_southeast_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_southeast_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_135 +# IF_ZERO local_southeast_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_135 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_135 +# LOCAL local_southeast_at_CellularAutomaton_internal_6 --> -28($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_17 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -28($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_6 --> -28($fp) +# local_southeast_at_CellularAutomaton_internal_1 = local_southeast_at_CellularAutomaton_internal_6 +lw $t0, -28($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_136 +j label_ENDIF_136 +label_FALSEIF_135: + # LOCAL local_southeast_at_CellularAutomaton_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_13 --> -56($fp) + # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_14 --> -60($fp) + # local_southeast_at_CellularAutomaton_internal_13 = PARAM param_southeast_at_CellularAutomaton_position_0 + local_southeast_at_CellularAutomaton_internal_14 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -60($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -56($fp) + # local_southeast_at_CellularAutomaton_internal_15 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southeast_at_CellularAutomaton_internal_15 --> -64($fp) + lw $t0, 16($s1) + sw $t0, -64($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_15 --> -64($fp) + # local_southeast_at_CellularAutomaton_internal_12 = local_southeast_at_CellularAutomaton_internal_13 / local_southeast_at_CellularAutomaton_internal_15 + lw $t1, -56($fp) + lw $t0, 12($t1) + lw $t1, -64($fp) + lw $t2, 12($t1) + div $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -52($fp) + # local_southeast_at_CellularAutomaton_internal_16 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southeast_at_CellularAutomaton_internal_16 --> -68($fp) + lw $t0, 16($s1) + sw $t0, -68($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_16 --> -68($fp) + # local_southeast_at_CellularAutomaton_internal_11 = local_southeast_at_CellularAutomaton_internal_12 * local_southeast_at_CellularAutomaton_internal_16 + lw $t1, -52($fp) + lw $t0, 12($t1) + lw $t1, -68($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -48($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -76($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) + # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_18 --> -76($fp) + # local_southeast_at_CellularAutomaton_internal_17 = PARAM param_southeast_at_CellularAutomaton_position_0 + local_southeast_at_CellularAutomaton_internal_18 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -76($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -72($fp) + # IF_ZERO local_southeast_at_CellularAutomaton_internal_11 GOTO label_FALSE_141 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_11 GOTO label_FALSE_141 + lw $t0, -48($fp) + beq $t0, 0, label_FALSE_141 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_17 GOTO label_FALSE_141 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_17 GOTO label_FALSE_141 + lw $t0, -72($fp) + beq $t0, 0, label_FALSE_141 + # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with String + la $v0, String + lw $a0, -48($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_144 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_144 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_STRING_144 + # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with Bool + la $v0, Bool + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_145 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_145 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_145 + # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with Int + la $v0, Int + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_145 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_145 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_145 + # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) + # Load pointers and SUB + lw $a0, -48($fp) + lw $a1, -72($fp) + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_142 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_142 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_142 + # GOTO label_FALSE_141 + j label_FALSE_141 + label_COMPARE_BY_VALUE_145: + # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) + lw $a0, -48($fp) + lw $a1, -72($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_142 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_142 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_142 + # GOTO label_FALSE_141 + j label_FALSE_141 + label_COMPARE_STRING_144: + # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -72($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -44($fp) + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_146 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_146 + lw $t0, -44($fp) + beq $t0, 0, label_CONTINUE_146 + # GOTO label_FALSE_141 + j label_FALSE_141 + label_CONTINUE_146: + # LOCAL local_southeast_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_17 --> -72($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -72($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_147: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_148 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_147 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_148: + # Store result + sw $a2, -44($fp) + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_142 + # IF_ZERO local_southeast_at_CellularAutomaton_internal_10 GOTO label_TRUE_142 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_142 + label_FALSE_141: + # LOCAL local_southeast_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -40($fp) + # GOTO label_END_143 +j label_END_143 +label_TRUE_142: + # LOCAL local_southeast_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -40($fp) + label_END_143: +# LOCAL local_southeast_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_9 --> -40($fp) +# Obtain value from -40($fp) +lw $v0, -40($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_139 +# IF_ZERO local_southeast_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_139 +lw $t0, -32($fp) +beq $t0, 0, label_FALSEIF_139 +# LOCAL local_southeast_at_CellularAutomaton_internal_19 --> -80($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_18 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -80($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_19 --> -80($fp) +# local_southeast_at_CellularAutomaton_internal_8 = local_southeast_at_CellularAutomaton_internal_19 +lw $t0, -80($fp) +sw $t0, -36($fp) +# GOTO label_ENDIF_140 +j label_ENDIF_140 +label_FALSEIF_139: + # LOCAL local_southeast_at_CellularAutomaton_internal_22 --> -92($fp) + # local_southeast_at_CellularAutomaton_internal_22 = SELF + sw $s1, -92($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_22 --> -92($fp) + # local_southeast_at_CellularAutomaton_internal_20 = local_southeast_at_CellularAutomaton_internal_22 + lw $t0, -92($fp) + sw $t0, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_southeast_at_CellularAutomaton_internal_24 --> -100($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -100($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_23 --> -96($fp) + # PARAM param_southeast_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_24 --> -100($fp) + # local_southeast_at_CellularAutomaton_internal_23 = PARAM param_southeast_at_CellularAutomaton_position_0 + local_southeast_at_CellularAutomaton_internal_24 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -100($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -96($fp) + # ARG local_southeast_at_CellularAutomaton_internal_23 + # LOCAL local_southeast_at_CellularAutomaton_internal_23 --> -96($fp) + lw $t0, -96($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_southeast_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_21 --> -88($fp) + # local_southeast_at_CellularAutomaton_internal_21 = VCALL local_southeast_at_CellularAutomaton_internal_20 south + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_southeast_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_southeast_at_CellularAutomaton_internal_21 --> -88($fp) + # local_southeast_at_CellularAutomaton_internal_8 = local_southeast_at_CellularAutomaton_internal_21 + lw $t0, -88($fp) + sw $t0, -36($fp) + label_ENDIF_140: +# LOCAL local_southeast_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_southeast_at_CellularAutomaton_internal_8 --> -36($fp) +# local_southeast_at_CellularAutomaton_internal_1 = local_southeast_at_CellularAutomaton_internal_8 +lw $t0, -36($fp) +sw $t0, -8($fp) +label_ENDIF_136: +# RETURN local_southeast_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_southeast_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 108 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_southwest_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_southwest_at_CellularAutomaton_position_0 +function_southwest_at_CellularAutomaton: + # Allocate stack frame for function function_southwest_at_CellularAutomaton. + subu $sp, $sp, 92 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 92 + # local_southwest_at_CellularAutomaton_internal_3 = GETATTRIBUTE board_size CellularAutomaton + # LOCAL local_southwest_at_CellularAutomaton_internal_3 --> -16($fp) + lw $t0, 20($s1) + sw $t0, -16($fp) + # local_southwest_at_CellularAutomaton_internal_5 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southwest_at_CellularAutomaton_internal_5 --> -24($fp) + lw $t0, 16($s1) + sw $t0, -24($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_4 --> -20($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_5 --> -24($fp) + # local_southwest_at_CellularAutomaton_internal_4 = PARAM param_southwest_at_CellularAutomaton_position_0 + local_southwest_at_CellularAutomaton_internal_5 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -24($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -20($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_2 --> -12($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_4 --> -20($fp) + lw $a0, -16($fp) + lw $a1, -20($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -12($fp) + # IF_GREATER_ZERO local_southwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_151 + # IF_GREATER_ZERO local_southwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_151 + lw $t0, -12($fp) + bgt $t0, 0, label_FALSE_151 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_151 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_2 GOTO label_FALSE_151 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_151 + # LOCAL local_southwest_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_152 +j label_END_152 +label_FALSE_151: + # LOCAL local_southwest_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_152: +# LOCAL local_southwest_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_southwest_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_149 +# IF_ZERO local_southwest_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_149 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_149 +# LOCAL local_southwest_at_CellularAutomaton_internal_6 --> -28($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_19 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -28($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_6 --> -28($fp) +# local_southwest_at_CellularAutomaton_internal_1 = local_southwest_at_CellularAutomaton_internal_6 +lw $t0, -28($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_150 +j label_ENDIF_150 +label_FALSEIF_149: + # local_southwest_at_CellularAutomaton_internal_13 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southwest_at_CellularAutomaton_internal_13 --> -56($fp) + lw $t0, 16($s1) + sw $t0, -56($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_12 --> -52($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_13 --> -56($fp) + # local_southwest_at_CellularAutomaton_internal_12 = PARAM param_southwest_at_CellularAutomaton_position_0 / local_southwest_at_CellularAutomaton_internal_13 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -56($fp) + lw $t2, 12($t1) + div $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -52($fp) + # local_southwest_at_CellularAutomaton_internal_14 = GETATTRIBUTE columns CellularAutomaton + # LOCAL local_southwest_at_CellularAutomaton_internal_14 --> -60($fp) + lw $t0, 16($s1) + sw $t0, -60($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_14 --> -60($fp) + # local_southwest_at_CellularAutomaton_internal_11 = local_southwest_at_CellularAutomaton_internal_12 * local_southwest_at_CellularAutomaton_internal_14 + lw $t1, -52($fp) + lw $t0, 12($t1) + lw $t1, -60($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -48($fp) + # IF_ZERO local_southwest_at_CellularAutomaton_internal_11 GOTO label_FALSE_155 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_11 GOTO label_FALSE_155 + lw $t0, -48($fp) + beq $t0, 0, label_FALSE_155 + # IF_ZERO param_southwest_at_CellularAutomaton_position_0 GOTO label_FALSE_155 + # IF_ZERO param_southwest_at_CellularAutomaton_position_0 GOTO label_FALSE_155 + lw $t0, 0($fp) + beq $t0, 0, label_FALSE_155 + # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with String + la $v0, String + lw $a0, -48($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_158 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_158 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_STRING_158 + # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with Bool + la $v0, Bool + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_159 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_159 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_159 + # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) + # Comparing -48($fp) type with Int + la $v0, Int + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_159 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_159 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_159 + # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + # Load pointers and SUB + lw $a0, -48($fp) + lw $a1, 0($fp) + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_156 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_156 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_156 + # GOTO label_FALSE_155 + j label_FALSE_155 + label_COMPARE_BY_VALUE_159: + # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + lw $a0, -48($fp) + lw $a1, 0($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_156 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_156 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_156 + # GOTO label_FALSE_155 + j label_FALSE_155 + label_COMPARE_STRING_158: + # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, 0($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -44($fp) + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_160 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_160 + lw $t0, -44($fp) + beq $t0, 0, label_CONTINUE_160 + # GOTO label_FALSE_155 + j label_FALSE_155 + label_CONTINUE_160: + # LOCAL local_southwest_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_11 --> -48($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, 0($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_161: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_162 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_161 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_162: + # Store result + sw $a2, -44($fp) + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_156 + # IF_ZERO local_southwest_at_CellularAutomaton_internal_10 GOTO label_TRUE_156 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_156 + label_FALSE_155: + # LOCAL local_southwest_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -40($fp) + # GOTO label_END_157 +j label_END_157 +label_TRUE_156: + # LOCAL local_southwest_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -40($fp) + label_END_157: +# LOCAL local_southwest_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_9 --> -40($fp) +# Obtain value from -40($fp) +lw $v0, -40($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_153 +# IF_ZERO local_southwest_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_153 +lw $t0, -32($fp) +beq $t0, 0, label_FALSEIF_153 +# LOCAL local_southwest_at_CellularAutomaton_internal_15 --> -64($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_20 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -64($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_15 --> -64($fp) +# local_southwest_at_CellularAutomaton_internal_8 = local_southwest_at_CellularAutomaton_internal_15 +lw $t0, -64($fp) +sw $t0, -36($fp) +# GOTO label_ENDIF_154 +j label_ENDIF_154 +label_FALSEIF_153: + # LOCAL local_southwest_at_CellularAutomaton_internal_18 --> -76($fp) + # local_southwest_at_CellularAutomaton_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_16 --> -68($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_18 --> -76($fp) + # local_southwest_at_CellularAutomaton_internal_16 = local_southwest_at_CellularAutomaton_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_southwest_at_CellularAutomaton_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -84($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_19 --> -80($fp) + # PARAM param_southwest_at_CellularAutomaton_position_0 --> 0($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_20 --> -84($fp) + # local_southwest_at_CellularAutomaton_internal_19 = PARAM param_southwest_at_CellularAutomaton_position_0 - local_southwest_at_CellularAutomaton_internal_20 + lw $t1, 0($fp) + lw $t0, 12($t1) + lw $t1, -84($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -80($fp) + # ARG local_southwest_at_CellularAutomaton_internal_19 + # LOCAL local_southwest_at_CellularAutomaton_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_southwest_at_CellularAutomaton_internal_16 --> -68($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_17 --> -72($fp) + # local_southwest_at_CellularAutomaton_internal_17 = VCALL local_southwest_at_CellularAutomaton_internal_16 south + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_southwest_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_southwest_at_CellularAutomaton_internal_17 --> -72($fp) + # local_southwest_at_CellularAutomaton_internal_8 = local_southwest_at_CellularAutomaton_internal_17 + lw $t0, -72($fp) + sw $t0, -36($fp) + label_ENDIF_154: +# LOCAL local_southwest_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_southwest_at_CellularAutomaton_internal_8 --> -36($fp) +# local_southwest_at_CellularAutomaton_internal_1 = local_southwest_at_CellularAutomaton_internal_8 +lw $t0, -36($fp) +sw $t0, -8($fp) +label_ENDIF_150: +# RETURN local_southwest_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_southwest_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 92 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_neighbors_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_neighbors_at_CellularAutomaton_position_0 +function_neighbors_at_CellularAutomaton: + # Allocate stack frame for function function_neighbors_at_CellularAutomaton. + subu $sp, $sp, 356 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 356 + # LOCAL local_neighbors_at_CellularAutomaton_internal_13 --> -56($fp) + # local_neighbors_at_CellularAutomaton_internal_13 = SELF + sw $s1, -56($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_13 --> -56($fp) + # local_neighbors_at_CellularAutomaton_internal_11 = local_neighbors_at_CellularAutomaton_internal_13 + lw $t0, -56($fp) + sw $t0, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_neighbors_at_CellularAutomaton_position_0 + # PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_11 --> -48($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) + # local_neighbors_at_CellularAutomaton_internal_12 = VCALL local_neighbors_at_CellularAutomaton_internal_11 north + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 76($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_21 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -60($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_12 GOTO label_FALSE_165 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_12 GOTO label_FALSE_165 + lw $t0, -52($fp) + beq $t0, 0, label_FALSE_165 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_FALSE_165 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_14 GOTO label_FALSE_165 + lw $t0, -60($fp) + beq $t0, 0, label_FALSE_165 + # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) + # Comparing -52($fp) type with String + la $v0, String + lw $a0, -52($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_168 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_COMPARE_STRING_168 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_STRING_168 + # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) + # Comparing -52($fp) type with Bool + la $v0, Bool + lw $a0, -52($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_169 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_169 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_169 + # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) + # Comparing -52($fp) type with Int + la $v0, Int + lw $a0, -52($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -44($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_169 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_COMPARE_BY_VALUE_169 + lw $t0, -44($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_169 + # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) + # Load pointers and SUB + lw $a0, -52($fp) + lw $a1, -60($fp) + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_TRUE_166 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_TRUE_166 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_166 + # GOTO label_FALSE_165 + j label_FALSE_165 + label_COMPARE_BY_VALUE_169: + # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) + lw $a0, -52($fp) + lw $a1, -60($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_TRUE_166 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_TRUE_166 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_166 + # GOTO label_FALSE_165 + j label_FALSE_165 + label_COMPARE_STRING_168: + # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) + # Load strings for comparison + lw $v0, -52($fp) + lw $v1, -60($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -44($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_170 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_CONTINUE_170 + lw $t0, -44($fp) + beq $t0, 0, label_CONTINUE_170 + # GOTO label_FALSE_165 + j label_FALSE_165 + label_CONTINUE_170: + # LOCAL local_neighbors_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_14 --> -60($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -52($fp) + lw $v1, -60($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_171: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_172 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_171 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_172: + # Store result + sw $a2, -44($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_TRUE_166 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_10 GOTO label_TRUE_166 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_166 + label_FALSE_165: + # LOCAL local_neighbors_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -40($fp) + # GOTO label_END_167 +j label_END_167 +label_TRUE_166: + # LOCAL local_neighbors_at_CellularAutomaton_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -40($fp) + label_END_167: +# LOCAL local_neighbors_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_9 --> -40($fp) +# Obtain value from -40($fp) +lw $v0, -40($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_163 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_7 GOTO label_FALSEIF_163 +lw $t0, -32($fp) +beq $t0, 0, label_FALSEIF_163 +# LOCAL local_neighbors_at_CellularAutomaton_internal_15 --> -64($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -64($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_15 --> -64($fp) +# local_neighbors_at_CellularAutomaton_internal_8 = local_neighbors_at_CellularAutomaton_internal_15 +lw $t0, -64($fp) +sw $t0, -36($fp) +# GOTO label_ENDIF_164 +j label_ENDIF_164 +label_FALSEIF_163: + # LOCAL local_neighbors_at_CellularAutomaton_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -68($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_16 --> -68($fp) + # local_neighbors_at_CellularAutomaton_internal_8 = local_neighbors_at_CellularAutomaton_internal_16 + lw $t0, -68($fp) + sw $t0, -36($fp) + label_ENDIF_164: +# LOCAL local_neighbors_at_CellularAutomaton_internal_23 --> -96($fp) +# local_neighbors_at_CellularAutomaton_internal_23 = SELF +sw $s1, -96($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_21 --> -88($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_23 --> -96($fp) +# local_neighbors_at_CellularAutomaton_internal_21 = local_neighbors_at_CellularAutomaton_internal_23 +lw $t0, -96($fp) +sw $t0, -88($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_21 --> -88($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) +# local_neighbors_at_CellularAutomaton_internal_22 = VCALL local_neighbors_at_CellularAutomaton_internal_21 south +# Save new self pointer in $s1 +lw $s1, -88($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 40($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -92($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_22 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -100($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_22 GOTO label_FALSE_175 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_22 GOTO label_FALSE_175 +lw $t0, -92($fp) +beq $t0, 0, label_FALSE_175 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_24 GOTO label_FALSE_175 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_24 GOTO label_FALSE_175 +lw $t0, -100($fp) +beq $t0, 0, label_FALSE_175 +# LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) +# Comparing -92($fp) type with String +la $v0, String +lw $a0, -92($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -84($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_COMPARE_STRING_178 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_COMPARE_STRING_178 +lw $t0, -84($fp) +beq $t0, 0, label_COMPARE_STRING_178 +# LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) +# Comparing -92($fp) type with Bool +la $v0, Bool +lw $a0, -92($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -84($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_179 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_179 +lw $t0, -84($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_179 +# LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) +# Comparing -92($fp) type with Int +la $v0, Int +lw $a0, -92($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -84($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_179 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_179 +lw $t0, -84($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_179 +# LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) +# Load pointers and SUB +lw $a0, -92($fp) +lw $a1, -100($fp) +sub $a0, $a0, $a1 +sw $a0, -84($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_176 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_176 +lw $t0, -84($fp) +beq $t0, 0, label_TRUE_176 +# GOTO label_FALSE_175 +j label_FALSE_175 +label_COMPARE_BY_VALUE_179: + # LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) + lw $a0, -92($fp) + lw $a1, -100($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -84($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_176 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_176 + lw $t0, -84($fp) + beq $t0, 0, label_TRUE_176 + # GOTO label_FALSE_175 + j label_FALSE_175 + label_COMPARE_STRING_178: + # LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) + # Load strings for comparison + lw $v0, -92($fp) + lw $v1, -100($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -84($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_CONTINUE_180 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_CONTINUE_180 + lw $t0, -84($fp) + beq $t0, 0, label_CONTINUE_180 + # GOTO label_FALSE_175 + j label_FALSE_175 + label_CONTINUE_180: + # LOCAL local_neighbors_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_22 --> -92($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_24 --> -100($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -92($fp) + lw $v1, -100($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_181: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_182 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_181 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_182: + # Store result + sw $a2, -84($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_176 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_20 GOTO label_TRUE_176 + lw $t0, -84($fp) + beq $t0, 0, label_TRUE_176 + label_FALSE_175: + # LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -80($fp) + # GOTO label_END_177 +j label_END_177 +label_TRUE_176: + # LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -80($fp) + label_END_177: +# LOCAL local_neighbors_at_CellularAutomaton_internal_17 --> -72($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_19 --> -80($fp) +# Obtain value from -80($fp) +lw $v0, -80($fp) +lw $v0, 12($v0) +sw $v0, -72($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_173 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_173 +lw $t0, -72($fp) +beq $t0, 0, label_FALSEIF_173 +# LOCAL local_neighbors_at_CellularAutomaton_internal_25 --> -104($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -104($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_18 --> -76($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_25 --> -104($fp) +# local_neighbors_at_CellularAutomaton_internal_18 = local_neighbors_at_CellularAutomaton_internal_25 +lw $t0, -104($fp) +sw $t0, -76($fp) +# GOTO label_ENDIF_174 +j label_ENDIF_174 +label_FALSEIF_173: + # LOCAL local_neighbors_at_CellularAutomaton_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -108($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_18 --> -76($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_26 --> -108($fp) + # local_neighbors_at_CellularAutomaton_internal_18 = local_neighbors_at_CellularAutomaton_internal_26 + lw $t0, -108($fp) + sw $t0, -76($fp) + label_ENDIF_174: +# LOCAL local_neighbors_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_8 --> -36($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_18 --> -76($fp) +# local_neighbors_at_CellularAutomaton_internal_6 = local_neighbors_at_CellularAutomaton_internal_8 + local_neighbors_at_CellularAutomaton_internal_18 +lw $t1, -36($fp) +lw $t0, 12($t1) +lw $t1, -76($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -28($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_33 --> -136($fp) +# local_neighbors_at_CellularAutomaton_internal_33 = SELF +sw $s1, -136($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_31 --> -128($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_33 --> -136($fp) +# local_neighbors_at_CellularAutomaton_internal_31 = local_neighbors_at_CellularAutomaton_internal_33 +lw $t0, -136($fp) +sw $t0, -128($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_31 --> -128($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) +# local_neighbors_at_CellularAutomaton_internal_32 = VCALL local_neighbors_at_CellularAutomaton_internal_31 east +# Save new self pointer in $s1 +lw $s1, -128($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 52($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -132($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_23 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -140($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_FALSE_185 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_32 GOTO label_FALSE_185 +lw $t0, -132($fp) +beq $t0, 0, label_FALSE_185 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_34 GOTO label_FALSE_185 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_34 GOTO label_FALSE_185 +lw $t0, -140($fp) +beq $t0, 0, label_FALSE_185 +# LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) +# Comparing -132($fp) type with String +la $v0, String +lw $a0, -132($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -124($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_COMPARE_STRING_188 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_COMPARE_STRING_188 +lw $t0, -124($fp) +beq $t0, 0, label_COMPARE_STRING_188 +# LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) +# Comparing -132($fp) type with Bool +la $v0, Bool +lw $a0, -132($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -124($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_COMPARE_BY_VALUE_189 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_COMPARE_BY_VALUE_189 +lw $t0, -124($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_189 +# LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) +# Comparing -132($fp) type with Int +la $v0, Int +lw $a0, -132($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -124($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_COMPARE_BY_VALUE_189 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_COMPARE_BY_VALUE_189 +lw $t0, -124($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_189 +# LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) +# Load pointers and SUB +lw $a0, -132($fp) +lw $a1, -140($fp) +sub $a0, $a0, $a1 +sw $a0, -124($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_TRUE_186 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_TRUE_186 +lw $t0, -124($fp) +beq $t0, 0, label_TRUE_186 +# GOTO label_FALSE_185 +j label_FALSE_185 +label_COMPARE_BY_VALUE_189: + # LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) + lw $a0, -132($fp) + lw $a1, -140($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -124($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_TRUE_186 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_TRUE_186 + lw $t0, -124($fp) + beq $t0, 0, label_TRUE_186 + # GOTO label_FALSE_185 + j label_FALSE_185 + label_COMPARE_STRING_188: + # LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) + # Load strings for comparison + lw $v0, -132($fp) + lw $v1, -140($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -124($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_CONTINUE_190 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_CONTINUE_190 + lw $t0, -124($fp) + beq $t0, 0, label_CONTINUE_190 + # GOTO label_FALSE_185 + j label_FALSE_185 + label_CONTINUE_190: + # LOCAL local_neighbors_at_CellularAutomaton_internal_30 --> -124($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_32 --> -132($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_34 --> -140($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -132($fp) + lw $v1, -140($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_191: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_192 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_191 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_192: + # Store result + sw $a2, -124($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_TRUE_186 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_30 GOTO label_TRUE_186 + lw $t0, -124($fp) + beq $t0, 0, label_TRUE_186 + label_FALSE_185: + # LOCAL local_neighbors_at_CellularAutomaton_internal_29 --> -120($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -120($fp) + # GOTO label_END_187 +j label_END_187 +label_TRUE_186: + # LOCAL local_neighbors_at_CellularAutomaton_internal_29 --> -120($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -120($fp) + label_END_187: +# LOCAL local_neighbors_at_CellularAutomaton_internal_27 --> -112($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_29 --> -120($fp) +# Obtain value from -120($fp) +lw $v0, -120($fp) +lw $v0, 12($v0) +sw $v0, -112($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_27 GOTO label_FALSEIF_183 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_27 GOTO label_FALSEIF_183 +lw $t0, -112($fp) +beq $t0, 0, label_FALSEIF_183 +# LOCAL local_neighbors_at_CellularAutomaton_internal_35 --> -144($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -144($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_28 --> -116($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_35 --> -144($fp) +# local_neighbors_at_CellularAutomaton_internal_28 = local_neighbors_at_CellularAutomaton_internal_35 +lw $t0, -144($fp) +sw $t0, -116($fp) +# GOTO label_ENDIF_184 +j label_ENDIF_184 +label_FALSEIF_183: + # LOCAL local_neighbors_at_CellularAutomaton_internal_36 --> -148($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -148($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_28 --> -116($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_36 --> -148($fp) + # local_neighbors_at_CellularAutomaton_internal_28 = local_neighbors_at_CellularAutomaton_internal_36 + lw $t0, -148($fp) + sw $t0, -116($fp) + label_ENDIF_184: +# LOCAL local_neighbors_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_6 --> -28($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_28 --> -116($fp) +# local_neighbors_at_CellularAutomaton_internal_5 = local_neighbors_at_CellularAutomaton_internal_6 + local_neighbors_at_CellularAutomaton_internal_28 +lw $t1, -28($fp) +lw $t0, 12($t1) +lw $t1, -116($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -24($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_43 --> -176($fp) +# local_neighbors_at_CellularAutomaton_internal_43 = SELF +sw $s1, -176($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_41 --> -168($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_43 --> -176($fp) +# local_neighbors_at_CellularAutomaton_internal_41 = local_neighbors_at_CellularAutomaton_internal_43 +lw $t0, -176($fp) +sw $t0, -168($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_41 --> -168($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) +# local_neighbors_at_CellularAutomaton_internal_42 = VCALL local_neighbors_at_CellularAutomaton_internal_41 west +# Save new self pointer in $s1 +lw $s1, -168($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 104($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -172($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_24 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -180($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_42 GOTO label_FALSE_195 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_42 GOTO label_FALSE_195 +lw $t0, -172($fp) +beq $t0, 0, label_FALSE_195 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_FALSE_195 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_44 GOTO label_FALSE_195 +lw $t0, -180($fp) +beq $t0, 0, label_FALSE_195 +# LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) +# Comparing -172($fp) type with String +la $v0, String +lw $a0, -172($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -164($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_COMPARE_STRING_198 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_COMPARE_STRING_198 +lw $t0, -164($fp) +beq $t0, 0, label_COMPARE_STRING_198 +# LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) +# Comparing -172($fp) type with Bool +la $v0, Bool +lw $a0, -172($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -164($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_COMPARE_BY_VALUE_199 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_COMPARE_BY_VALUE_199 +lw $t0, -164($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_199 +# LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) +# Comparing -172($fp) type with Int +la $v0, Int +lw $a0, -172($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -164($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_COMPARE_BY_VALUE_199 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_COMPARE_BY_VALUE_199 +lw $t0, -164($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_199 +# LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) +# Load pointers and SUB +lw $a0, -172($fp) +lw $a1, -180($fp) +sub $a0, $a0, $a1 +sw $a0, -164($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_TRUE_196 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_TRUE_196 +lw $t0, -164($fp) +beq $t0, 0, label_TRUE_196 +# GOTO label_FALSE_195 +j label_FALSE_195 +label_COMPARE_BY_VALUE_199: + # LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) + lw $a0, -172($fp) + lw $a1, -180($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -164($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_TRUE_196 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_TRUE_196 + lw $t0, -164($fp) + beq $t0, 0, label_TRUE_196 + # GOTO label_FALSE_195 + j label_FALSE_195 + label_COMPARE_STRING_198: + # LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) + # Load strings for comparison + lw $v0, -172($fp) + lw $v1, -180($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -164($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_CONTINUE_200 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_CONTINUE_200 + lw $t0, -164($fp) + beq $t0, 0, label_CONTINUE_200 + # GOTO label_FALSE_195 + j label_FALSE_195 + label_CONTINUE_200: + # LOCAL local_neighbors_at_CellularAutomaton_internal_40 --> -164($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_42 --> -172($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_44 --> -180($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -172($fp) + lw $v1, -180($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_201: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_202 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_201 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_202: + # Store result + sw $a2, -164($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_TRUE_196 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_40 GOTO label_TRUE_196 + lw $t0, -164($fp) + beq $t0, 0, label_TRUE_196 + label_FALSE_195: + # LOCAL local_neighbors_at_CellularAutomaton_internal_39 --> -160($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -160($fp) + # GOTO label_END_197 +j label_END_197 +label_TRUE_196: + # LOCAL local_neighbors_at_CellularAutomaton_internal_39 --> -160($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -160($fp) + label_END_197: +# LOCAL local_neighbors_at_CellularAutomaton_internal_37 --> -152($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_39 --> -160($fp) +# Obtain value from -160($fp) +lw $v0, -160($fp) +lw $v0, 12($v0) +sw $v0, -152($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_37 GOTO label_FALSEIF_193 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_37 GOTO label_FALSEIF_193 +lw $t0, -152($fp) +beq $t0, 0, label_FALSEIF_193 +# LOCAL local_neighbors_at_CellularAutomaton_internal_45 --> -184($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -184($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_45 --> -184($fp) +# local_neighbors_at_CellularAutomaton_internal_38 = local_neighbors_at_CellularAutomaton_internal_45 +lw $t0, -184($fp) +sw $t0, -156($fp) +# GOTO label_ENDIF_194 +j label_ENDIF_194 +label_FALSEIF_193: + # LOCAL local_neighbors_at_CellularAutomaton_internal_46 --> -188($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -188($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_46 --> -188($fp) + # local_neighbors_at_CellularAutomaton_internal_38 = local_neighbors_at_CellularAutomaton_internal_46 + lw $t0, -188($fp) + sw $t0, -156($fp) + label_ENDIF_194: +# LOCAL local_neighbors_at_CellularAutomaton_internal_4 --> -20($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_5 --> -24($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_38 --> -156($fp) +# local_neighbors_at_CellularAutomaton_internal_4 = local_neighbors_at_CellularAutomaton_internal_5 + local_neighbors_at_CellularAutomaton_internal_38 +lw $t1, -24($fp) +lw $t0, 12($t1) +lw $t1, -156($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -20($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_53 --> -216($fp) +# local_neighbors_at_CellularAutomaton_internal_53 = SELF +sw $s1, -216($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_51 --> -208($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_53 --> -216($fp) +# local_neighbors_at_CellularAutomaton_internal_51 = local_neighbors_at_CellularAutomaton_internal_53 +lw $t0, -216($fp) +sw $t0, -208($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_51 --> -208($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) +# local_neighbors_at_CellularAutomaton_internal_52 = VCALL local_neighbors_at_CellularAutomaton_internal_51 northeast +# Save new self pointer in $s1 +lw $s1, -208($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 92($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -212($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_25 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -220($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_52 GOTO label_FALSE_205 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_52 GOTO label_FALSE_205 +lw $t0, -212($fp) +beq $t0, 0, label_FALSE_205 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_54 GOTO label_FALSE_205 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_54 GOTO label_FALSE_205 +lw $t0, -220($fp) +beq $t0, 0, label_FALSE_205 +# LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) +# Comparing -212($fp) type with String +la $v0, String +lw $a0, -212($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -204($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_COMPARE_STRING_208 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_COMPARE_STRING_208 +lw $t0, -204($fp) +beq $t0, 0, label_COMPARE_STRING_208 +# LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) +# Comparing -212($fp) type with Bool +la $v0, Bool +lw $a0, -212($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -204($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_COMPARE_BY_VALUE_209 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_COMPARE_BY_VALUE_209 +lw $t0, -204($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_209 +# LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) +# Comparing -212($fp) type with Int +la $v0, Int +lw $a0, -212($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -204($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_COMPARE_BY_VALUE_209 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_COMPARE_BY_VALUE_209 +lw $t0, -204($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_209 +# LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) +# Load pointers and SUB +lw $a0, -212($fp) +lw $a1, -220($fp) +sub $a0, $a0, $a1 +sw $a0, -204($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_206 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_206 +lw $t0, -204($fp) +beq $t0, 0, label_TRUE_206 +# GOTO label_FALSE_205 +j label_FALSE_205 +label_COMPARE_BY_VALUE_209: + # LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) + lw $a0, -212($fp) + lw $a1, -220($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -204($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_206 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_206 + lw $t0, -204($fp) + beq $t0, 0, label_TRUE_206 + # GOTO label_FALSE_205 + j label_FALSE_205 + label_COMPARE_STRING_208: + # LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) + # Load strings for comparison + lw $v0, -212($fp) + lw $v1, -220($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -204($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_CONTINUE_210 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_CONTINUE_210 + lw $t0, -204($fp) + beq $t0, 0, label_CONTINUE_210 + # GOTO label_FALSE_205 + j label_FALSE_205 + label_CONTINUE_210: + # LOCAL local_neighbors_at_CellularAutomaton_internal_50 --> -204($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_52 --> -212($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_54 --> -220($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -212($fp) + lw $v1, -220($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_211: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_212 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_211 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_212: + # Store result + sw $a2, -204($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_206 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_50 GOTO label_TRUE_206 + lw $t0, -204($fp) + beq $t0, 0, label_TRUE_206 + label_FALSE_205: + # LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -200($fp) + # GOTO label_END_207 +j label_END_207 +label_TRUE_206: + # LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -200($fp) + label_END_207: +# LOCAL local_neighbors_at_CellularAutomaton_internal_47 --> -192($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_49 --> -200($fp) +# Obtain value from -200($fp) +lw $v0, -200($fp) +lw $v0, 12($v0) +sw $v0, -192($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_47 GOTO label_FALSEIF_203 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_47 GOTO label_FALSEIF_203 +lw $t0, -192($fp) +beq $t0, 0, label_FALSEIF_203 +# LOCAL local_neighbors_at_CellularAutomaton_internal_55 --> -224($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -224($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_48 --> -196($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_55 --> -224($fp) +# local_neighbors_at_CellularAutomaton_internal_48 = local_neighbors_at_CellularAutomaton_internal_55 +lw $t0, -224($fp) +sw $t0, -196($fp) +# GOTO label_ENDIF_204 +j label_ENDIF_204 +label_FALSEIF_203: + # LOCAL local_neighbors_at_CellularAutomaton_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -228($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_48 --> -196($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_56 --> -228($fp) + # local_neighbors_at_CellularAutomaton_internal_48 = local_neighbors_at_CellularAutomaton_internal_56 + lw $t0, -228($fp) + sw $t0, -196($fp) + label_ENDIF_204: +# LOCAL local_neighbors_at_CellularAutomaton_internal_3 --> -16($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_4 --> -20($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_48 --> -196($fp) +# local_neighbors_at_CellularAutomaton_internal_3 = local_neighbors_at_CellularAutomaton_internal_4 + local_neighbors_at_CellularAutomaton_internal_48 +lw $t1, -20($fp) +lw $t0, 12($t1) +lw $t1, -196($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -16($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_63 --> -256($fp) +# local_neighbors_at_CellularAutomaton_internal_63 = SELF +sw $s1, -256($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_61 --> -248($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_63 --> -256($fp) +# local_neighbors_at_CellularAutomaton_internal_61 = local_neighbors_at_CellularAutomaton_internal_63 +lw $t0, -256($fp) +sw $t0, -248($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_61 --> -248($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) +# local_neighbors_at_CellularAutomaton_internal_62 = VCALL local_neighbors_at_CellularAutomaton_internal_61 northwest +# Save new self pointer in $s1 +lw $s1, -248($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 116($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -252($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_64 --> -260($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_26 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -260($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_62 GOTO label_FALSE_215 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_62 GOTO label_FALSE_215 +lw $t0, -252($fp) +beq $t0, 0, label_FALSE_215 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_64 GOTO label_FALSE_215 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_64 GOTO label_FALSE_215 +lw $t0, -260($fp) +beq $t0, 0, label_FALSE_215 +# LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) +# Comparing -252($fp) type with String +la $v0, String +lw $a0, -252($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -244($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_COMPARE_STRING_218 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_COMPARE_STRING_218 +lw $t0, -244($fp) +beq $t0, 0, label_COMPARE_STRING_218 +# LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) +# Comparing -252($fp) type with Bool +la $v0, Bool +lw $a0, -252($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -244($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_COMPARE_BY_VALUE_219 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_COMPARE_BY_VALUE_219 +lw $t0, -244($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_219 +# LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) +# Comparing -252($fp) type with Int +la $v0, Int +lw $a0, -252($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -244($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_COMPARE_BY_VALUE_219 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_COMPARE_BY_VALUE_219 +lw $t0, -244($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_219 +# LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_64 --> -260($fp) +# Load pointers and SUB +lw $a0, -252($fp) +lw $a1, -260($fp) +sub $a0, $a0, $a1 +sw $a0, -244($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_TRUE_216 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_TRUE_216 +lw $t0, -244($fp) +beq $t0, 0, label_TRUE_216 +# GOTO label_FALSE_215 +j label_FALSE_215 +label_COMPARE_BY_VALUE_219: + # LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_64 --> -260($fp) + lw $a0, -252($fp) + lw $a1, -260($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -244($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_TRUE_216 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_TRUE_216 + lw $t0, -244($fp) + beq $t0, 0, label_TRUE_216 + # GOTO label_FALSE_215 + j label_FALSE_215 + label_COMPARE_STRING_218: + # LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_64 --> -260($fp) + # Load strings for comparison + lw $v0, -252($fp) + lw $v1, -260($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -244($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_CONTINUE_220 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_CONTINUE_220 + lw $t0, -244($fp) + beq $t0, 0, label_CONTINUE_220 + # GOTO label_FALSE_215 + j label_FALSE_215 + label_CONTINUE_220: + # LOCAL local_neighbors_at_CellularAutomaton_internal_60 --> -244($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_62 --> -252($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_64 --> -260($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -252($fp) + lw $v1, -260($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_221: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_222 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_221 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_222: + # Store result + sw $a2, -244($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_TRUE_216 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_60 GOTO label_TRUE_216 + lw $t0, -244($fp) + beq $t0, 0, label_TRUE_216 + label_FALSE_215: + # LOCAL local_neighbors_at_CellularAutomaton_internal_59 --> -240($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -240($fp) + # GOTO label_END_217 +j label_END_217 +label_TRUE_216: + # LOCAL local_neighbors_at_CellularAutomaton_internal_59 --> -240($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -240($fp) + label_END_217: +# LOCAL local_neighbors_at_CellularAutomaton_internal_57 --> -232($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_59 --> -240($fp) +# Obtain value from -240($fp) +lw $v0, -240($fp) +lw $v0, 12($v0) +sw $v0, -232($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_57 GOTO label_FALSEIF_213 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_57 GOTO label_FALSEIF_213 +lw $t0, -232($fp) +beq $t0, 0, label_FALSEIF_213 +# LOCAL local_neighbors_at_CellularAutomaton_internal_65 --> -264($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -264($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_58 --> -236($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_65 --> -264($fp) +# local_neighbors_at_CellularAutomaton_internal_58 = local_neighbors_at_CellularAutomaton_internal_65 +lw $t0, -264($fp) +sw $t0, -236($fp) +# GOTO label_ENDIF_214 +j label_ENDIF_214 +label_FALSEIF_213: + # LOCAL local_neighbors_at_CellularAutomaton_internal_66 --> -268($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -268($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_58 --> -236($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_66 --> -268($fp) + # local_neighbors_at_CellularAutomaton_internal_58 = local_neighbors_at_CellularAutomaton_internal_66 + lw $t0, -268($fp) + sw $t0, -236($fp) + label_ENDIF_214: +# LOCAL local_neighbors_at_CellularAutomaton_internal_2 --> -12($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_3 --> -16($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_58 --> -236($fp) +# local_neighbors_at_CellularAutomaton_internal_2 = local_neighbors_at_CellularAutomaton_internal_3 + local_neighbors_at_CellularAutomaton_internal_58 +lw $t1, -16($fp) +lw $t0, 12($t1) +lw $t1, -236($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -12($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_73 --> -296($fp) +# local_neighbors_at_CellularAutomaton_internal_73 = SELF +sw $s1, -296($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_71 --> -288($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_73 --> -296($fp) +# local_neighbors_at_CellularAutomaton_internal_71 = local_neighbors_at_CellularAutomaton_internal_73 +lw $t0, -296($fp) +sw $t0, -288($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_71 --> -288($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) +# local_neighbors_at_CellularAutomaton_internal_72 = VCALL local_neighbors_at_CellularAutomaton_internal_71 southeast +# Save new self pointer in $s1 +lw $s1, -288($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 60($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -292($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_74 --> -300($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_27 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -300($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_72 GOTO label_FALSE_225 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_72 GOTO label_FALSE_225 +lw $t0, -292($fp) +beq $t0, 0, label_FALSE_225 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_74 GOTO label_FALSE_225 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_74 GOTO label_FALSE_225 +lw $t0, -300($fp) +beq $t0, 0, label_FALSE_225 +# LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) +# Comparing -292($fp) type with String +la $v0, String +lw $a0, -292($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -284($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_COMPARE_STRING_228 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_COMPARE_STRING_228 +lw $t0, -284($fp) +beq $t0, 0, label_COMPARE_STRING_228 +# LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) +# Comparing -292($fp) type with Bool +la $v0, Bool +lw $a0, -292($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -284($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_COMPARE_BY_VALUE_229 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_COMPARE_BY_VALUE_229 +lw $t0, -284($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_229 +# LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) +# Comparing -292($fp) type with Int +la $v0, Int +lw $a0, -292($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -284($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_COMPARE_BY_VALUE_229 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_COMPARE_BY_VALUE_229 +lw $t0, -284($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_229 +# LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_74 --> -300($fp) +# Load pointers and SUB +lw $a0, -292($fp) +lw $a1, -300($fp) +sub $a0, $a0, $a1 +sw $a0, -284($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_TRUE_226 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_TRUE_226 +lw $t0, -284($fp) +beq $t0, 0, label_TRUE_226 +# GOTO label_FALSE_225 +j label_FALSE_225 +label_COMPARE_BY_VALUE_229: + # LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_74 --> -300($fp) + lw $a0, -292($fp) + lw $a1, -300($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -284($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_TRUE_226 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_TRUE_226 + lw $t0, -284($fp) + beq $t0, 0, label_TRUE_226 + # GOTO label_FALSE_225 + j label_FALSE_225 + label_COMPARE_STRING_228: + # LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_74 --> -300($fp) + # Load strings for comparison + lw $v0, -292($fp) + lw $v1, -300($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -284($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_CONTINUE_230 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_CONTINUE_230 + lw $t0, -284($fp) + beq $t0, 0, label_CONTINUE_230 + # GOTO label_FALSE_225 + j label_FALSE_225 + label_CONTINUE_230: + # LOCAL local_neighbors_at_CellularAutomaton_internal_70 --> -284($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_72 --> -292($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_74 --> -300($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -292($fp) + lw $v1, -300($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_231: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_232 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_231 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_232: + # Store result + sw $a2, -284($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_TRUE_226 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_70 GOTO label_TRUE_226 + lw $t0, -284($fp) + beq $t0, 0, label_TRUE_226 + label_FALSE_225: + # LOCAL local_neighbors_at_CellularAutomaton_internal_69 --> -280($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -280($fp) + # GOTO label_END_227 +j label_END_227 +label_TRUE_226: + # LOCAL local_neighbors_at_CellularAutomaton_internal_69 --> -280($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -280($fp) + label_END_227: +# LOCAL local_neighbors_at_CellularAutomaton_internal_67 --> -272($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_69 --> -280($fp) +# Obtain value from -280($fp) +lw $v0, -280($fp) +lw $v0, 12($v0) +sw $v0, -272($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_67 GOTO label_FALSEIF_223 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_67 GOTO label_FALSEIF_223 +lw $t0, -272($fp) +beq $t0, 0, label_FALSEIF_223 +# LOCAL local_neighbors_at_CellularAutomaton_internal_75 --> -304($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -304($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_68 --> -276($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_75 --> -304($fp) +# local_neighbors_at_CellularAutomaton_internal_68 = local_neighbors_at_CellularAutomaton_internal_75 +lw $t0, -304($fp) +sw $t0, -276($fp) +# GOTO label_ENDIF_224 +j label_ENDIF_224 +label_FALSEIF_223: + # LOCAL local_neighbors_at_CellularAutomaton_internal_76 --> -308($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -308($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_68 --> -276($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_76 --> -308($fp) + # local_neighbors_at_CellularAutomaton_internal_68 = local_neighbors_at_CellularAutomaton_internal_76 + lw $t0, -308($fp) + sw $t0, -276($fp) + label_ENDIF_224: +# LOCAL local_neighbors_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_2 --> -12($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_68 --> -276($fp) +# local_neighbors_at_CellularAutomaton_internal_1 = local_neighbors_at_CellularAutomaton_internal_2 + local_neighbors_at_CellularAutomaton_internal_68 +lw $t1, -12($fp) +lw $t0, 12($t1) +lw $t1, -276($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -8($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_83 --> -336($fp) +# local_neighbors_at_CellularAutomaton_internal_83 = SELF +sw $s1, -336($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_81 --> -328($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_83 --> -336($fp) +# local_neighbors_at_CellularAutomaton_internal_81 = local_neighbors_at_CellularAutomaton_internal_83 +lw $t0, -336($fp) +sw $t0, -328($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_neighbors_at_CellularAutomaton_position_0 +# PARAM param_neighbors_at_CellularAutomaton_position_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_81 --> -328($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) +# local_neighbors_at_CellularAutomaton_internal_82 = VCALL local_neighbors_at_CellularAutomaton_internal_81 southwest +# Save new self pointer in $s1 +lw $s1, -328($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 44($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -332($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_neighbors_at_CellularAutomaton_internal_84 --> -340($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_28 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -340($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_82 GOTO label_FALSE_235 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_82 GOTO label_FALSE_235 +lw $t0, -332($fp) +beq $t0, 0, label_FALSE_235 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_84 GOTO label_FALSE_235 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_84 GOTO label_FALSE_235 +lw $t0, -340($fp) +beq $t0, 0, label_FALSE_235 +# LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) +# Comparing -332($fp) type with String +la $v0, String +lw $a0, -332($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -324($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_COMPARE_STRING_238 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_COMPARE_STRING_238 +lw $t0, -324($fp) +beq $t0, 0, label_COMPARE_STRING_238 +# LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) +# Comparing -332($fp) type with Bool +la $v0, Bool +lw $a0, -332($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -324($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_COMPARE_BY_VALUE_239 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_COMPARE_BY_VALUE_239 +lw $t0, -324($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_239 +# LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) +# Comparing -332($fp) type with Int +la $v0, Int +lw $a0, -332($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -324($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_COMPARE_BY_VALUE_239 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_COMPARE_BY_VALUE_239 +lw $t0, -324($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_239 +# LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_84 --> -340($fp) +# Load pointers and SUB +lw $a0, -332($fp) +lw $a1, -340($fp) +sub $a0, $a0, $a1 +sw $a0, -324($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_TRUE_236 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_TRUE_236 +lw $t0, -324($fp) +beq $t0, 0, label_TRUE_236 +# GOTO label_FALSE_235 +j label_FALSE_235 +label_COMPARE_BY_VALUE_239: + # LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_84 --> -340($fp) + lw $a0, -332($fp) + lw $a1, -340($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -324($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_TRUE_236 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_TRUE_236 + lw $t0, -324($fp) + beq $t0, 0, label_TRUE_236 + # GOTO label_FALSE_235 + j label_FALSE_235 + label_COMPARE_STRING_238: + # LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_84 --> -340($fp) + # Load strings for comparison + lw $v0, -332($fp) + lw $v1, -340($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -324($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_CONTINUE_240 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_CONTINUE_240 + lw $t0, -324($fp) + beq $t0, 0, label_CONTINUE_240 + # GOTO label_FALSE_235 + j label_FALSE_235 + label_CONTINUE_240: + # LOCAL local_neighbors_at_CellularAutomaton_internal_80 --> -324($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_82 --> -332($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_84 --> -340($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -332($fp) + lw $v1, -340($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_241: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_242 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_241 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_242: + # Store result + sw $a2, -324($fp) + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_TRUE_236 + # IF_ZERO local_neighbors_at_CellularAutomaton_internal_80 GOTO label_TRUE_236 + lw $t0, -324($fp) + beq $t0, 0, label_TRUE_236 + label_FALSE_235: + # LOCAL local_neighbors_at_CellularAutomaton_internal_79 --> -320($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -320($fp) + # GOTO label_END_237 +j label_END_237 +label_TRUE_236: + # LOCAL local_neighbors_at_CellularAutomaton_internal_79 --> -320($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -320($fp) + label_END_237: +# LOCAL local_neighbors_at_CellularAutomaton_internal_77 --> -312($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_79 --> -320($fp) +# Obtain value from -320($fp) +lw $v0, -320($fp) +lw $v0, 12($v0) +sw $v0, -312($fp) +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_77 GOTO label_FALSEIF_233 +# IF_ZERO local_neighbors_at_CellularAutomaton_internal_77 GOTO label_FALSEIF_233 +lw $t0, -312($fp) +beq $t0, 0, label_FALSEIF_233 +# LOCAL local_neighbors_at_CellularAutomaton_internal_85 --> -344($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -344($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_78 --> -316($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_85 --> -344($fp) +# local_neighbors_at_CellularAutomaton_internal_78 = local_neighbors_at_CellularAutomaton_internal_85 +lw $t0, -344($fp) +sw $t0, -316($fp) +# GOTO label_ENDIF_234 +j label_ENDIF_234 +label_FALSEIF_233: + # LOCAL local_neighbors_at_CellularAutomaton_internal_86 --> -348($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -348($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_78 --> -316($fp) + # LOCAL local_neighbors_at_CellularAutomaton_internal_86 --> -348($fp) + # local_neighbors_at_CellularAutomaton_internal_78 = local_neighbors_at_CellularAutomaton_internal_86 + lw $t0, -348($fp) + sw $t0, -316($fp) + label_ENDIF_234: +# LOCAL local_neighbors_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_neighbors_at_CellularAutomaton_internal_78 --> -316($fp) +# local_neighbors_at_CellularAutomaton_internal_0 = local_neighbors_at_CellularAutomaton_internal_1 + local_neighbors_at_CellularAutomaton_internal_78 +lw $t1, -8($fp) +lw $t0, 12($t1) +lw $t1, -316($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -4($fp) +# RETURN local_neighbors_at_CellularAutomaton_internal_0 +lw $v0, -4($fp) +# Deallocate stack frame for function function_neighbors_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 356 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_cell_at_next_evolution_at_CellularAutomaton implementation. +# @Params: +# 0($fp) = param_cell_at_next_evolution_at_CellularAutomaton_position_0 +function_cell_at_next_evolution_at_CellularAutomaton: + # Allocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. + subu $sp, $sp, 120 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 120 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_6 --> -28($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_4 = local_cell_at_next_evolution_at_CellularAutomaton_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 + # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 --> -20($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_5 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_4 neighbors + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 56($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 3 + sw $t0, 12($v0) + sw $v0, -32($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_5 GOTO label_FALSE_245 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_5 GOTO label_FALSE_245 + lw $t0, -24($fp) + beq $t0, 0, label_FALSE_245 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_FALSE_245 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_7 GOTO label_FALSE_245 + lw $t0, -32($fp) + beq $t0, 0, label_FALSE_245 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) + # Comparing -24($fp) type with String + la $v0, String + lw $a0, -24($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_248 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_STRING_248 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_248 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) + # Comparing -24($fp) type with Bool + la $v0, Bool + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_249 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_249 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_249 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) + # Comparing -24($fp) type with Int + la $v0, Int + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_249 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_COMPARE_BY_VALUE_249 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_249 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + # Load pointers and SUB + lw $a0, -24($fp) + lw $a1, -32($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_246 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_246 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_246 + # GOTO label_FALSE_245 + j label_FALSE_245 + label_COMPARE_BY_VALUE_249: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + lw $a0, -24($fp) + lw $a1, -32($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_246 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_246 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_246 + # GOTO label_FALSE_245 + j label_FALSE_245 + label_COMPARE_STRING_248: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -32($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_250 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_CONTINUE_250 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_250 + # GOTO label_FALSE_245 + j label_FALSE_245 + label_CONTINUE_250: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_7 --> -32($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -32($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_251: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_252 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_251 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_252: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_246 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_3 GOTO label_TRUE_246 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_246 + label_FALSE_245: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_247 +j label_END_247 +label_TRUE_246: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_247: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_0 --> -4($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_243 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_0 GOTO label_FALSEIF_243 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_243 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_29 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -36($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_8 --> -36($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = local_cell_at_next_evolution_at_CellularAutomaton_internal_8 +lw $t0, -36($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_244 +j label_ENDIF_244 +label_FALSEIF_243: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_15 --> -64($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_13 = local_cell_at_next_evolution_at_CellularAutomaton_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 + # PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_14 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_13 neighbors + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 56($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 2 + sw $t0, 12($v0) + sw $v0, -68($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_14 GOTO label_FALSE_255 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_14 GOTO label_FALSE_255 + lw $t0, -60($fp) + beq $t0, 0, label_FALSE_255 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_16 GOTO label_FALSE_255 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_16 GOTO label_FALSE_255 + lw $t0, -68($fp) + beq $t0, 0, label_FALSE_255 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) + # Comparing -60($fp) type with String + la $v0, String + lw $a0, -60($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -52($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_COMPARE_STRING_258 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_COMPARE_STRING_258 + lw $t0, -52($fp) + beq $t0, 0, label_COMPARE_STRING_258 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) + # Comparing -60($fp) type with Bool + la $v0, Bool + lw $a0, -60($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -52($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_COMPARE_BY_VALUE_259 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_COMPARE_BY_VALUE_259 + lw $t0, -52($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_259 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) + # Comparing -60($fp) type with Int + la $v0, Int + lw $a0, -60($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -52($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_COMPARE_BY_VALUE_259 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_COMPARE_BY_VALUE_259 + lw $t0, -52($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_259 + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) + # Load pointers and SUB + lw $a0, -60($fp) + lw $a1, -68($fp) + sub $a0, $a0, $a1 + sw $a0, -52($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_256 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_256 + lw $t0, -52($fp) + beq $t0, 0, label_TRUE_256 + # GOTO label_FALSE_255 + j label_FALSE_255 + label_COMPARE_BY_VALUE_259: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) + lw $a0, -60($fp) + lw $a1, -68($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -52($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_256 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_256 + lw $t0, -52($fp) + beq $t0, 0, label_TRUE_256 + # GOTO label_FALSE_255 + j label_FALSE_255 + label_COMPARE_STRING_258: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) + # Load strings for comparison + lw $v0, -60($fp) + lw $v1, -68($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -52($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_CONTINUE_260 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_CONTINUE_260 + lw $t0, -52($fp) + beq $t0, 0, label_CONTINUE_260 + # GOTO label_FALSE_255 + j label_FALSE_255 + label_CONTINUE_260: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_14 --> -60($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_16 --> -68($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -60($fp) + lw $v1, -68($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_261: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_262 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_261 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_262: + # Store result + sw $a2, -52($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_256 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_12 GOTO label_TRUE_256 + lw $t0, -52($fp) + beq $t0, 0, label_TRUE_256 + label_FALSE_255: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -48($fp) + # GOTO label_END_257 +j label_END_257 +label_TRUE_256: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -48($fp) + label_END_257: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_9 --> -40($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_11 --> -48($fp) +# Obtain value from -48($fp) +lw $v0, -48($fp) +lw $v0, 12($v0) +sw $v0, -40($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_FALSEIF_253 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_9 GOTO label_FALSEIF_253 +lw $t0, -40($fp) +beq $t0, 0, label_FALSEIF_253 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_23 = SELF +sw $s1, -96($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_23 --> -96($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_21 = local_cell_at_next_evolution_at_CellularAutomaton_internal_23 +lw $t0, -96($fp) +sw $t0, -88($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_cell_at_next_evolution_at_CellularAutomaton_position_0 +# PARAM param_cell_at_next_evolution_at_CellularAutomaton_position_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 --> -88($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_22 = VCALL local_cell_at_next_evolution_at_CellularAutomaton_internal_21 cell +# Save new self pointer in $s1 +lw $s1, -88($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 28($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -92($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_30 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -100($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_22 GOTO label_FALSE_265 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_22 GOTO label_FALSE_265 +lw $t0, -92($fp) +beq $t0, 0, label_FALSE_265 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_24 GOTO label_FALSE_265 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_24 GOTO label_FALSE_265 +lw $t0, -100($fp) +beq $t0, 0, label_FALSE_265 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) +# Comparing -92($fp) type with String +la $v0, String +lw $a0, -92($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -84($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_COMPARE_STRING_268 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_COMPARE_STRING_268 +lw $t0, -84($fp) +beq $t0, 0, label_COMPARE_STRING_268 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) +# Comparing -92($fp) type with Bool +la $v0, Bool +lw $a0, -92($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -84($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_269 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_269 +lw $t0, -84($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_269 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) +# Comparing -92($fp) type with Int +la $v0, Int +lw $a0, -92($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -84($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_269 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_COMPARE_BY_VALUE_269 +lw $t0, -84($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_269 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) +# Load pointers and SUB +lw $a0, -92($fp) +lw $a1, -100($fp) +sub $a0, $a0, $a1 +sw $a0, -84($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_TRUE_266 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_TRUE_266 +lw $t0, -84($fp) +beq $t0, 0, label_TRUE_266 +# GOTO label_FALSE_265 +j label_FALSE_265 +label_COMPARE_BY_VALUE_269: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) + lw $a0, -92($fp) + lw $a1, -100($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -84($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_TRUE_266 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_TRUE_266 + lw $t0, -84($fp) + beq $t0, 0, label_TRUE_266 + # GOTO label_FALSE_265 + j label_FALSE_265 + label_COMPARE_STRING_268: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) + # Load strings for comparison + lw $v0, -92($fp) + lw $v1, -100($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -84($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_CONTINUE_270 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_CONTINUE_270 + lw $t0, -84($fp) + beq $t0, 0, label_CONTINUE_270 + # GOTO label_FALSE_265 + j label_FALSE_265 + label_CONTINUE_270: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_20 --> -84($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_22 --> -92($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_24 --> -100($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -92($fp) + lw $v1, -100($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_271: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_272 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_271 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_272: + # Store result + sw $a2, -84($fp) + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_TRUE_266 + # IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_20 GOTO label_TRUE_266 + lw $t0, -84($fp) + beq $t0, 0, label_TRUE_266 + label_FALSE_265: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -80($fp) + # GOTO label_END_267 +j label_END_267 +label_TRUE_266: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -80($fp) + label_END_267: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_17 --> -72($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_19 --> -80($fp) +# Obtain value from -80($fp) +lw $v0, -80($fp) +lw $v0, 12($v0) +sw $v0, -72($fp) +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_263 +# IF_ZERO local_cell_at_next_evolution_at_CellularAutomaton_internal_17 GOTO label_FALSEIF_263 +lw $t0, -72($fp) +beq $t0, 0, label_FALSEIF_263 +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_25 --> -104($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_31 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -104($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_25 --> -104($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_18 = local_cell_at_next_evolution_at_CellularAutomaton_internal_25 +lw $t0, -104($fp) +sw $t0, -76($fp) +# GOTO label_ENDIF_264 +j label_ENDIF_264 +label_FALSEIF_263: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_26 --> -108($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_32 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -108($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_26 --> -108($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_18 = local_cell_at_next_evolution_at_CellularAutomaton_internal_26 + lw $t0, -108($fp) + sw $t0, -76($fp) + label_ENDIF_264: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_18 --> -76($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_10 = local_cell_at_next_evolution_at_CellularAutomaton_internal_18 +lw $t0, -76($fp) +sw $t0, -44($fp) +# GOTO label_ENDIF_254 +j label_ENDIF_254 +label_FALSEIF_253: + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_27 --> -112($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_33 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -112($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) + # LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_27 --> -112($fp) + # local_cell_at_next_evolution_at_CellularAutomaton_internal_10 = local_cell_at_next_evolution_at_CellularAutomaton_internal_27 + lw $t0, -112($fp) + sw $t0, -44($fp) + label_ENDIF_254: +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_1 --> -8($fp) +# LOCAL local_cell_at_next_evolution_at_CellularAutomaton_internal_10 --> -44($fp) +# local_cell_at_next_evolution_at_CellularAutomaton_internal_1 = local_cell_at_next_evolution_at_CellularAutomaton_internal_10 +lw $t0, -44($fp) +sw $t0, -8($fp) +label_ENDIF_244: +# RETURN local_cell_at_next_evolution_at_CellularAutomaton_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_cell_at_next_evolution_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 120 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_evolve_at_CellularAutomaton implementation. +# @Params: +function_evolve_at_CellularAutomaton: + # Allocate stack frame for function function_evolve_at_CellularAutomaton. + subu $sp, $sp, 76 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 76 + # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_1 --> -8($fp) + # local_evolve_at_CellularAutomaton_position_0 = local_evolve_at_CellularAutomaton_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_evolve_at_CellularAutomaton_num_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_5 --> -24($fp) + # local_evolve_at_CellularAutomaton_internal_5 = SELF + sw $s1, -24($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_5 --> -24($fp) + # local_evolve_at_CellularAutomaton_internal_3 = local_evolve_at_CellularAutomaton_internal_5 + lw $t0, -24($fp) + sw $t0, -16($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_evolve_at_CellularAutomaton_internal_3 --> -16($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) + # local_evolve_at_CellularAutomaton_internal_4 = VCALL local_evolve_at_CellularAutomaton_internal_3 num_cells + # Save new self pointer in $s1 + lw $s1, -16($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -20($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_evolve_at_CellularAutomaton_num_2 --> -12($fp) + # LOCAL local_evolve_at_CellularAutomaton_internal_4 --> -20($fp) + # local_evolve_at_CellularAutomaton_num_2 = local_evolve_at_CellularAutomaton_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # LOCAL local_evolve_at_CellularAutomaton_temp_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -28($fp) + label_WHILE_273: + # LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) + # LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) + # LOCAL local_evolve_at_CellularAutomaton_num_2 --> -12($fp) + lw $a0, -4($fp) + lw $a1, -12($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -36($fp) + # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_8 GOTO label_FALSE_275 + # IF_GREATER_ZERO local_evolve_at_CellularAutomaton_internal_8 GOTO label_FALSE_275 + lw $t0, -36($fp) + bgt $t0, 0, label_FALSE_275 + # IF_ZERO local_evolve_at_CellularAutomaton_internal_8 GOTO label_FALSE_275 + # IF_ZERO local_evolve_at_CellularAutomaton_internal_8 GOTO label_FALSE_275 + lw $t0, -36($fp) + beq $t0, 0, label_FALSE_275 + # LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_276 +j label_END_276 +label_FALSE_275: + # LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_276: +# LOCAL local_evolve_at_CellularAutomaton_internal_7 --> -32($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_evolve_at_CellularAutomaton_internal_7 GOTO label_WHILE_END_274 +# IF_ZERO local_evolve_at_CellularAutomaton_internal_7 GOTO label_WHILE_END_274 +lw $t0, -32($fp) +beq $t0, 0, label_WHILE_END_274 +# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) +# LOCAL local_evolve_at_CellularAutomaton_temp_6 --> -28($fp) +# local_evolve_at_CellularAutomaton_internal_9 = local_evolve_at_CellularAutomaton_temp_6 +lw $t0, -28($fp) +sw $t0, -40($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) +# local_evolve_at_CellularAutomaton_internal_13 = SELF +sw $s1, -56($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_13 --> -56($fp) +# local_evolve_at_CellularAutomaton_internal_11 = local_evolve_at_CellularAutomaton_internal_13 +lw $t0, -56($fp) +sw $t0, -48($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_evolve_at_CellularAutomaton_position_0 +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +lw $t0, -4($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_11 --> -48($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) +# local_evolve_at_CellularAutomaton_internal_12 = VCALL local_evolve_at_CellularAutomaton_internal_11 cell_at_next_evolution +# Save new self pointer in $s1 +lw $s1, -48($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 64($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -52($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_evolve_at_CellularAutomaton_internal_12 +# LOCAL local_evolve_at_CellularAutomaton_internal_12 --> -52($fp) +lw $t0, -52($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_evolve_at_CellularAutomaton_internal_9 --> -40($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) +# local_evolve_at_CellularAutomaton_internal_10 = VCALL local_evolve_at_CellularAutomaton_internal_9 concat +# Save new self pointer in $s1 +lw $s1, -40($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 108($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -44($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_evolve_at_CellularAutomaton_temp_6 --> -28($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_10 --> -44($fp) +# local_evolve_at_CellularAutomaton_temp_6 = local_evolve_at_CellularAutomaton_internal_10 +lw $t0, -44($fp) +sw $t0, -28($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_15 --> -64($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -64($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_14 --> -60($fp) +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_15 --> -64($fp) +# local_evolve_at_CellularAutomaton_internal_14 = local_evolve_at_CellularAutomaton_position_0 + local_evolve_at_CellularAutomaton_internal_15 +lw $t1, -4($fp) +lw $t0, 12($t1) +lw $t1, -64($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -60($fp) +# LOCAL local_evolve_at_CellularAutomaton_position_0 --> -4($fp) +# LOCAL local_evolve_at_CellularAutomaton_internal_14 --> -60($fp) +# local_evolve_at_CellularAutomaton_position_0 = local_evolve_at_CellularAutomaton_internal_14 +lw $t0, -60($fp) +sw $t0, -4($fp) +# GOTO label_WHILE_273 +j label_WHILE_273 +label_WHILE_END_274: + # + # LOCAL local_evolve_at_CellularAutomaton_temp_6 --> -28($fp) + lw $t0, -28($fp) + sw $t0, 24($s1) + # LOCAL local_evolve_at_CellularAutomaton_internal_16 --> -68($fp) + # local_evolve_at_CellularAutomaton_internal_16 = SELF + sw $s1, -68($fp) + # RETURN local_evolve_at_CellularAutomaton_internal_16 + lw $v0, -68($fp) + # Deallocate stack frame for function function_evolve_at_CellularAutomaton. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 76 + jr $ra + # Function END + + +# function_option_at_CellularAutomaton implementation. +# @Params: +function_option_at_CellularAutomaton: + # Allocate stack frame for function function_option_at_CellularAutomaton. + subu $sp, $sp, 916 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 916 + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_3 --> -16($fp) + # local_option_at_CellularAutomaton_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_option_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_option_at_CellularAutomaton_internal_3 --> -16($fp) + # local_option_at_CellularAutomaton_internal_1 = local_option_at_CellularAutomaton_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_34 + sw $t0, 12($v0) + li $t0, 24 + sw $t0, 16($v0) + sw $v0, -20($fp) + # ARG local_option_at_CellularAutomaton_internal_4 + # LOCAL local_option_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_option_at_CellularAutomaton_internal_2 --> -12($fp) + # local_option_at_CellularAutomaton_internal_2 = VCALL local_option_at_CellularAutomaton_internal_1 out_string + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_7 --> -32($fp) + # local_option_at_CellularAutomaton_internal_7 = SELF + sw $s1, -32($fp) + # LOCAL local_option_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_option_at_CellularAutomaton_internal_7 --> -32($fp) + # local_option_at_CellularAutomaton_internal_5 = local_option_at_CellularAutomaton_internal_7 + lw $t0, -32($fp) + sw $t0, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_35 + sw $t0, 12($v0) + li $t0, 13 + sw $t0, 16($v0) + sw $v0, -36($fp) + # ARG local_option_at_CellularAutomaton_internal_8 + # LOCAL local_option_at_CellularAutomaton_internal_8 --> -36($fp) + lw $t0, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_option_at_CellularAutomaton_internal_6 --> -28($fp) + # local_option_at_CellularAutomaton_internal_6 = VCALL local_option_at_CellularAutomaton_internal_5 out_string + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_11 --> -48($fp) + # local_option_at_CellularAutomaton_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_option_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_option_at_CellularAutomaton_internal_11 --> -48($fp) + # local_option_at_CellularAutomaton_internal_9 = local_option_at_CellularAutomaton_internal_11 + lw $t0, -48($fp) + sw $t0, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_36 + sw $t0, 12($v0) + li $t0, 48 + sw $t0, 16($v0) + sw $v0, -52($fp) + # ARG local_option_at_CellularAutomaton_internal_12 + # LOCAL local_option_at_CellularAutomaton_internal_12 --> -52($fp) + lw $t0, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_option_at_CellularAutomaton_internal_10 --> -44($fp) + # local_option_at_CellularAutomaton_internal_10 = VCALL local_option_at_CellularAutomaton_internal_9 out_string + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_15 --> -64($fp) + # local_option_at_CellularAutomaton_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_option_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_option_at_CellularAutomaton_internal_15 --> -64($fp) + # local_option_at_CellularAutomaton_internal_13 = local_option_at_CellularAutomaton_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_37 + sw $t0, 12($v0) + li $t0, 48 + sw $t0, 16($v0) + sw $v0, -68($fp) + # ARG local_option_at_CellularAutomaton_internal_16 + # LOCAL local_option_at_CellularAutomaton_internal_16 --> -68($fp) + lw $t0, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_option_at_CellularAutomaton_internal_14 --> -60($fp) + # local_option_at_CellularAutomaton_internal_14 = VCALL local_option_at_CellularAutomaton_internal_13 out_string + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_19 --> -80($fp) + # local_option_at_CellularAutomaton_internal_19 = SELF + sw $s1, -80($fp) + # LOCAL local_option_at_CellularAutomaton_internal_17 --> -72($fp) + # LOCAL local_option_at_CellularAutomaton_internal_19 --> -80($fp) + # local_option_at_CellularAutomaton_internal_17 = local_option_at_CellularAutomaton_internal_19 + lw $t0, -80($fp) + sw $t0, -72($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_38 + sw $t0, 12($v0) + li $t0, 10 + sw $t0, 16($v0) + sw $v0, -84($fp) + # ARG local_option_at_CellularAutomaton_internal_20 + # LOCAL local_option_at_CellularAutomaton_internal_20 --> -84($fp) + lw $t0, -84($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_17 --> -72($fp) + # LOCAL local_option_at_CellularAutomaton_internal_18 --> -76($fp) + # local_option_at_CellularAutomaton_internal_18 = VCALL local_option_at_CellularAutomaton_internal_17 out_string + # Save new self pointer in $s1 + lw $s1, -72($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -76($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_23 --> -96($fp) + # local_option_at_CellularAutomaton_internal_23 = SELF + sw $s1, -96($fp) + # LOCAL local_option_at_CellularAutomaton_internal_21 --> -88($fp) + # LOCAL local_option_at_CellularAutomaton_internal_23 --> -96($fp) + # local_option_at_CellularAutomaton_internal_21 = local_option_at_CellularAutomaton_internal_23 + lw $t0, -96($fp) + sw $t0, -88($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_24 --> -100($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_39 + sw $t0, 12($v0) + li $t0, 26 + sw $t0, 16($v0) + sw $v0, -100($fp) + # ARG local_option_at_CellularAutomaton_internal_24 + # LOCAL local_option_at_CellularAutomaton_internal_24 --> -100($fp) + lw $t0, -100($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_21 --> -88($fp) + # LOCAL local_option_at_CellularAutomaton_internal_22 --> -92($fp) + # local_option_at_CellularAutomaton_internal_22 = VCALL local_option_at_CellularAutomaton_internal_21 out_string + # Save new self pointer in $s1 + lw $s1, -88($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -92($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_27 --> -112($fp) + # local_option_at_CellularAutomaton_internal_27 = SELF + sw $s1, -112($fp) + # LOCAL local_option_at_CellularAutomaton_internal_25 --> -104($fp) + # LOCAL local_option_at_CellularAutomaton_internal_27 --> -112($fp) + # local_option_at_CellularAutomaton_internal_25 = local_option_at_CellularAutomaton_internal_27 + lw $t0, -112($fp) + sw $t0, -104($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_28 --> -116($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_40 + sw $t0, 12($v0) + li $t0, 22 + sw $t0, 16($v0) + sw $v0, -116($fp) + # ARG local_option_at_CellularAutomaton_internal_28 + # LOCAL local_option_at_CellularAutomaton_internal_28 --> -116($fp) + lw $t0, -116($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_25 --> -104($fp) + # LOCAL local_option_at_CellularAutomaton_internal_26 --> -108($fp) + # local_option_at_CellularAutomaton_internal_26 = VCALL local_option_at_CellularAutomaton_internal_25 out_string + # Save new self pointer in $s1 + lw $s1, -104($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -108($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_31 --> -128($fp) + # local_option_at_CellularAutomaton_internal_31 = SELF + sw $s1, -128($fp) + # LOCAL local_option_at_CellularAutomaton_internal_29 --> -120($fp) + # LOCAL local_option_at_CellularAutomaton_internal_31 --> -128($fp) + # local_option_at_CellularAutomaton_internal_29 = local_option_at_CellularAutomaton_internal_31 + lw $t0, -128($fp) + sw $t0, -120($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_32 --> -132($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_41 + sw $t0, 12($v0) + li $t0, 28 + sw $t0, 16($v0) + sw $v0, -132($fp) + # ARG local_option_at_CellularAutomaton_internal_32 + # LOCAL local_option_at_CellularAutomaton_internal_32 --> -132($fp) + lw $t0, -132($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_29 --> -120($fp) + # LOCAL local_option_at_CellularAutomaton_internal_30 --> -124($fp) + # local_option_at_CellularAutomaton_internal_30 = VCALL local_option_at_CellularAutomaton_internal_29 out_string + # Save new self pointer in $s1 + lw $s1, -120($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -124($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_35 --> -144($fp) + # local_option_at_CellularAutomaton_internal_35 = SELF + sw $s1, -144($fp) + # LOCAL local_option_at_CellularAutomaton_internal_33 --> -136($fp) + # LOCAL local_option_at_CellularAutomaton_internal_35 --> -144($fp) + # local_option_at_CellularAutomaton_internal_33 = local_option_at_CellularAutomaton_internal_35 + lw $t0, -144($fp) + sw $t0, -136($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_36 --> -148($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_42 + sw $t0, 12($v0) + li $t0, 25 + sw $t0, 16($v0) + sw $v0, -148($fp) + # ARG local_option_at_CellularAutomaton_internal_36 + # LOCAL local_option_at_CellularAutomaton_internal_36 --> -148($fp) + lw $t0, -148($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_33 --> -136($fp) + # LOCAL local_option_at_CellularAutomaton_internal_34 --> -140($fp) + # local_option_at_CellularAutomaton_internal_34 = VCALL local_option_at_CellularAutomaton_internal_33 out_string + # Save new self pointer in $s1 + lw $s1, -136($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -140($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_39 --> -160($fp) + # local_option_at_CellularAutomaton_internal_39 = SELF + sw $s1, -160($fp) + # LOCAL local_option_at_CellularAutomaton_internal_37 --> -152($fp) + # LOCAL local_option_at_CellularAutomaton_internal_39 --> -160($fp) + # local_option_at_CellularAutomaton_internal_37 = local_option_at_CellularAutomaton_internal_39 + lw $t0, -160($fp) + sw $t0, -152($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_40 --> -164($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_43 + sw $t0, 12($v0) + li $t0, 11 + sw $t0, 16($v0) + sw $v0, -164($fp) + # ARG local_option_at_CellularAutomaton_internal_40 + # LOCAL local_option_at_CellularAutomaton_internal_40 --> -164($fp) + lw $t0, -164($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_37 --> -152($fp) + # LOCAL local_option_at_CellularAutomaton_internal_38 --> -156($fp) + # local_option_at_CellularAutomaton_internal_38 = VCALL local_option_at_CellularAutomaton_internal_37 out_string + # Save new self pointer in $s1 + lw $s1, -152($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -156($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_43 --> -176($fp) + # local_option_at_CellularAutomaton_internal_43 = SELF + sw $s1, -176($fp) + # LOCAL local_option_at_CellularAutomaton_internal_41 --> -168($fp) + # LOCAL local_option_at_CellularAutomaton_internal_43 --> -176($fp) + # local_option_at_CellularAutomaton_internal_41 = local_option_at_CellularAutomaton_internal_43 + lw $t0, -176($fp) + sw $t0, -168($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_44 --> -180($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_44 + sw $t0, 12($v0) + li $t0, 21 + sw $t0, 16($v0) + sw $v0, -180($fp) + # ARG local_option_at_CellularAutomaton_internal_44 + # LOCAL local_option_at_CellularAutomaton_internal_44 --> -180($fp) + lw $t0, -180($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_41 --> -168($fp) + # LOCAL local_option_at_CellularAutomaton_internal_42 --> -172($fp) + # local_option_at_CellularAutomaton_internal_42 = VCALL local_option_at_CellularAutomaton_internal_41 out_string + # Save new self pointer in $s1 + lw $s1, -168($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -172($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_47 --> -192($fp) + # local_option_at_CellularAutomaton_internal_47 = SELF + sw $s1, -192($fp) + # LOCAL local_option_at_CellularAutomaton_internal_45 --> -184($fp) + # LOCAL local_option_at_CellularAutomaton_internal_47 --> -192($fp) + # local_option_at_CellularAutomaton_internal_45 = local_option_at_CellularAutomaton_internal_47 + lw $t0, -192($fp) + sw $t0, -184($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_48 --> -196($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_45 + sw $t0, 12($v0) + li $t0, 32 + sw $t0, 16($v0) + sw $v0, -196($fp) + # ARG local_option_at_CellularAutomaton_internal_48 + # LOCAL local_option_at_CellularAutomaton_internal_48 --> -196($fp) + lw $t0, -196($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_45 --> -184($fp) + # LOCAL local_option_at_CellularAutomaton_internal_46 --> -188($fp) + # local_option_at_CellularAutomaton_internal_46 = VCALL local_option_at_CellularAutomaton_internal_45 out_string + # Save new self pointer in $s1 + lw $s1, -184($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -188($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_51 --> -208($fp) + # local_option_at_CellularAutomaton_internal_51 = SELF + sw $s1, -208($fp) + # LOCAL local_option_at_CellularAutomaton_internal_49 --> -200($fp) + # LOCAL local_option_at_CellularAutomaton_internal_51 --> -208($fp) + # local_option_at_CellularAutomaton_internal_49 = local_option_at_CellularAutomaton_internal_51 + lw $t0, -208($fp) + sw $t0, -200($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_52 --> -212($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_46 + sw $t0, 12($v0) + li $t0, 18 + sw $t0, 16($v0) + sw $v0, -212($fp) + # ARG local_option_at_CellularAutomaton_internal_52 + # LOCAL local_option_at_CellularAutomaton_internal_52 --> -212($fp) + lw $t0, -212($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_49 --> -200($fp) + # LOCAL local_option_at_CellularAutomaton_internal_50 --> -204($fp) + # local_option_at_CellularAutomaton_internal_50 = VCALL local_option_at_CellularAutomaton_internal_49 out_string + # Save new self pointer in $s1 + lw $s1, -200($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -204($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_55 --> -224($fp) + # local_option_at_CellularAutomaton_internal_55 = SELF + sw $s1, -224($fp) + # LOCAL local_option_at_CellularAutomaton_internal_53 --> -216($fp) + # LOCAL local_option_at_CellularAutomaton_internal_55 --> -224($fp) + # local_option_at_CellularAutomaton_internal_53 = local_option_at_CellularAutomaton_internal_55 + lw $t0, -224($fp) + sw $t0, -216($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_56 --> -228($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_47 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -228($fp) + # ARG local_option_at_CellularAutomaton_internal_56 + # LOCAL local_option_at_CellularAutomaton_internal_56 --> -228($fp) + lw $t0, -228($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_53 --> -216($fp) + # LOCAL local_option_at_CellularAutomaton_internal_54 --> -220($fp) + # local_option_at_CellularAutomaton_internal_54 = VCALL local_option_at_CellularAutomaton_internal_53 out_string + # Save new self pointer in $s1 + lw $s1, -216($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -220($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_59 --> -240($fp) + # local_option_at_CellularAutomaton_internal_59 = SELF + sw $s1, -240($fp) + # LOCAL local_option_at_CellularAutomaton_internal_57 --> -232($fp) + # LOCAL local_option_at_CellularAutomaton_internal_59 --> -240($fp) + # local_option_at_CellularAutomaton_internal_57 = local_option_at_CellularAutomaton_internal_59 + lw $t0, -240($fp) + sw $t0, -232($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_60 --> -244($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_48 + sw $t0, 12($v0) + li $t0, 17 + sw $t0, 16($v0) + sw $v0, -244($fp) + # ARG local_option_at_CellularAutomaton_internal_60 + # LOCAL local_option_at_CellularAutomaton_internal_60 --> -244($fp) + lw $t0, -244($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_57 --> -232($fp) + # LOCAL local_option_at_CellularAutomaton_internal_58 --> -236($fp) + # local_option_at_CellularAutomaton_internal_58 = VCALL local_option_at_CellularAutomaton_internal_57 out_string + # Save new self pointer in $s1 + lw $s1, -232($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -236($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_63 --> -256($fp) + # local_option_at_CellularAutomaton_internal_63 = SELF + sw $s1, -256($fp) + # LOCAL local_option_at_CellularAutomaton_internal_61 --> -248($fp) + # LOCAL local_option_at_CellularAutomaton_internal_63 --> -256($fp) + # local_option_at_CellularAutomaton_internal_61 = local_option_at_CellularAutomaton_internal_63 + lw $t0, -256($fp) + sw $t0, -248($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_64 --> -260($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_49 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -260($fp) + # ARG local_option_at_CellularAutomaton_internal_64 + # LOCAL local_option_at_CellularAutomaton_internal_64 --> -260($fp) + lw $t0, -260($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_61 --> -248($fp) + # LOCAL local_option_at_CellularAutomaton_internal_62 --> -252($fp) + # local_option_at_CellularAutomaton_internal_62 = VCALL local_option_at_CellularAutomaton_internal_61 out_string + # Save new self pointer in $s1 + lw $s1, -248($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -252($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_67 --> -272($fp) + # local_option_at_CellularAutomaton_internal_67 = SELF + sw $s1, -272($fp) + # LOCAL local_option_at_CellularAutomaton_internal_65 --> -264($fp) + # LOCAL local_option_at_CellularAutomaton_internal_67 --> -272($fp) + # local_option_at_CellularAutomaton_internal_65 = local_option_at_CellularAutomaton_internal_67 + lw $t0, -272($fp) + sw $t0, -264($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_68 --> -276($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_50 + sw $t0, 12($v0) + li $t0, 13 + sw $t0, 16($v0) + sw $v0, -276($fp) + # ARG local_option_at_CellularAutomaton_internal_68 + # LOCAL local_option_at_CellularAutomaton_internal_68 --> -276($fp) + lw $t0, -276($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_65 --> -264($fp) + # LOCAL local_option_at_CellularAutomaton_internal_66 --> -268($fp) + # local_option_at_CellularAutomaton_internal_66 = VCALL local_option_at_CellularAutomaton_internal_65 out_string + # Save new self pointer in $s1 + lw $s1, -264($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -268($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_71 --> -288($fp) + # local_option_at_CellularAutomaton_internal_71 = SELF + sw $s1, -288($fp) + # LOCAL local_option_at_CellularAutomaton_internal_69 --> -280($fp) + # LOCAL local_option_at_CellularAutomaton_internal_71 --> -288($fp) + # local_option_at_CellularAutomaton_internal_69 = local_option_at_CellularAutomaton_internal_71 + lw $t0, -288($fp) + sw $t0, -280($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_72 --> -292($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_51 + sw $t0, 12($v0) + li $t0, 13 + sw $t0, 16($v0) + sw $v0, -292($fp) + # ARG local_option_at_CellularAutomaton_internal_72 + # LOCAL local_option_at_CellularAutomaton_internal_72 --> -292($fp) + lw $t0, -292($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_69 --> -280($fp) + # LOCAL local_option_at_CellularAutomaton_internal_70 --> -284($fp) + # local_option_at_CellularAutomaton_internal_70 = VCALL local_option_at_CellularAutomaton_internal_69 out_string + # Save new self pointer in $s1 + lw $s1, -280($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -284($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_75 --> -304($fp) + # local_option_at_CellularAutomaton_internal_75 = SELF + sw $s1, -304($fp) + # LOCAL local_option_at_CellularAutomaton_internal_73 --> -296($fp) + # LOCAL local_option_at_CellularAutomaton_internal_75 --> -304($fp) + # local_option_at_CellularAutomaton_internal_73 = local_option_at_CellularAutomaton_internal_75 + lw $t0, -304($fp) + sw $t0, -296($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_76 --> -308($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_52 + sw $t0, 12($v0) + li $t0, 12 + sw $t0, 16($v0) + sw $v0, -308($fp) + # ARG local_option_at_CellularAutomaton_internal_76 + # LOCAL local_option_at_CellularAutomaton_internal_76 --> -308($fp) + lw $t0, -308($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_73 --> -296($fp) + # LOCAL local_option_at_CellularAutomaton_internal_74 --> -300($fp) + # local_option_at_CellularAutomaton_internal_74 = VCALL local_option_at_CellularAutomaton_internal_73 out_string + # Save new self pointer in $s1 + lw $s1, -296($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -300($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_79 --> -320($fp) + # local_option_at_CellularAutomaton_internal_79 = SELF + sw $s1, -320($fp) + # LOCAL local_option_at_CellularAutomaton_internal_77 --> -312($fp) + # LOCAL local_option_at_CellularAutomaton_internal_79 --> -320($fp) + # local_option_at_CellularAutomaton_internal_77 = local_option_at_CellularAutomaton_internal_79 + lw $t0, -320($fp) + sw $t0, -312($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_80 --> -324($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_53 + sw $t0, 12($v0) + li $t0, 13 + sw $t0, 16($v0) + sw $v0, -324($fp) + # ARG local_option_at_CellularAutomaton_internal_80 + # LOCAL local_option_at_CellularAutomaton_internal_80 --> -324($fp) + lw $t0, -324($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_77 --> -312($fp) + # LOCAL local_option_at_CellularAutomaton_internal_78 --> -316($fp) + # local_option_at_CellularAutomaton_internal_78 = VCALL local_option_at_CellularAutomaton_internal_77 out_string + # Save new self pointer in $s1 + lw $s1, -312($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -316($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_83 --> -336($fp) + # local_option_at_CellularAutomaton_internal_83 = SELF + sw $s1, -336($fp) + # LOCAL local_option_at_CellularAutomaton_internal_81 --> -328($fp) + # LOCAL local_option_at_CellularAutomaton_internal_83 --> -336($fp) + # local_option_at_CellularAutomaton_internal_81 = local_option_at_CellularAutomaton_internal_83 + lw $t0, -336($fp) + sw $t0, -328($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_84 --> -340($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_54 + sw $t0, 12($v0) + li $t0, 13 + sw $t0, 16($v0) + sw $v0, -340($fp) + # ARG local_option_at_CellularAutomaton_internal_84 + # LOCAL local_option_at_CellularAutomaton_internal_84 --> -340($fp) + lw $t0, -340($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_81 --> -328($fp) + # LOCAL local_option_at_CellularAutomaton_internal_82 --> -332($fp) + # local_option_at_CellularAutomaton_internal_82 = VCALL local_option_at_CellularAutomaton_internal_81 out_string + # Save new self pointer in $s1 + lw $s1, -328($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -332($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_87 --> -352($fp) + # local_option_at_CellularAutomaton_internal_87 = SELF + sw $s1, -352($fp) + # LOCAL local_option_at_CellularAutomaton_internal_85 --> -344($fp) + # LOCAL local_option_at_CellularAutomaton_internal_87 --> -352($fp) + # local_option_at_CellularAutomaton_internal_85 = local_option_at_CellularAutomaton_internal_87 + lw $t0, -352($fp) + sw $t0, -344($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_88 --> -356($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_55 + sw $t0, 12($v0) + li $t0, 13 + sw $t0, 16($v0) + sw $v0, -356($fp) + # ARG local_option_at_CellularAutomaton_internal_88 + # LOCAL local_option_at_CellularAutomaton_internal_88 --> -356($fp) + lw $t0, -356($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_85 --> -344($fp) + # LOCAL local_option_at_CellularAutomaton_internal_86 --> -348($fp) + # local_option_at_CellularAutomaton_internal_86 = VCALL local_option_at_CellularAutomaton_internal_85 out_string + # Save new self pointer in $s1 + lw $s1, -344($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -348($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_91 --> -368($fp) + # local_option_at_CellularAutomaton_internal_91 = SELF + sw $s1, -368($fp) + # LOCAL local_option_at_CellularAutomaton_internal_89 --> -360($fp) + # LOCAL local_option_at_CellularAutomaton_internal_91 --> -368($fp) + # local_option_at_CellularAutomaton_internal_89 = local_option_at_CellularAutomaton_internal_91 + lw $t0, -368($fp) + sw $t0, -360($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_92 --> -372($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_56 + sw $t0, 12($v0) + li $t0, 15 + sw $t0, 16($v0) + sw $v0, -372($fp) + # ARG local_option_at_CellularAutomaton_internal_92 + # LOCAL local_option_at_CellularAutomaton_internal_92 --> -372($fp) + lw $t0, -372($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_89 --> -360($fp) + # LOCAL local_option_at_CellularAutomaton_internal_90 --> -364($fp) + # local_option_at_CellularAutomaton_internal_90 = VCALL local_option_at_CellularAutomaton_internal_89 out_string + # Save new self pointer in $s1 + lw $s1, -360($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -364($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_95 --> -384($fp) + # local_option_at_CellularAutomaton_internal_95 = SELF + sw $s1, -384($fp) + # LOCAL local_option_at_CellularAutomaton_internal_93 --> -376($fp) + # LOCAL local_option_at_CellularAutomaton_internal_95 --> -384($fp) + # local_option_at_CellularAutomaton_internal_93 = local_option_at_CellularAutomaton_internal_95 + lw $t0, -384($fp) + sw $t0, -376($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_93 --> -376($fp) + # LOCAL local_option_at_CellularAutomaton_internal_94 --> -380($fp) + # local_option_at_CellularAutomaton_internal_94 = VCALL local_option_at_CellularAutomaton_internal_93 in_int + # Save new self pointer in $s1 + lw $s1, -376($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 88($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -380($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_94 --> -380($fp) + # local_option_at_CellularAutomaton_num_0 = local_option_at_CellularAutomaton_internal_94 + lw $t0, -380($fp) + sw $t0, -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_98 --> -396($fp) + # local_option_at_CellularAutomaton_internal_98 = SELF + sw $s1, -396($fp) + # LOCAL local_option_at_CellularAutomaton_internal_96 --> -388($fp) + # LOCAL local_option_at_CellularAutomaton_internal_98 --> -396($fp) + # local_option_at_CellularAutomaton_internal_96 = local_option_at_CellularAutomaton_internal_98 + lw $t0, -396($fp) + sw $t0, -388($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_99 --> -400($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_57 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -400($fp) + # ARG local_option_at_CellularAutomaton_internal_99 + # LOCAL local_option_at_CellularAutomaton_internal_99 --> -400($fp) + lw $t0, -400($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_option_at_CellularAutomaton_internal_96 --> -388($fp) + # LOCAL local_option_at_CellularAutomaton_internal_97 --> -392($fp) + # local_option_at_CellularAutomaton_internal_97 = VCALL local_option_at_CellularAutomaton_internal_96 out_string + # Save new self pointer in $s1 + lw $s1, -388($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -392($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -420($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_279 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_279 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_279 + # IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_FALSE_279 + # IF_ZERO local_option_at_CellularAutomaton_internal_104 GOTO label_FALSE_279 + lw $t0, -420($fp) + beq $t0, 0, label_FALSE_279 + # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -416($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_COMPARE_STRING_282 + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_COMPARE_STRING_282 + lw $t0, -416($fp) + beq $t0, 0, label_COMPARE_STRING_282 + # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -416($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_COMPARE_BY_VALUE_283 + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_COMPARE_BY_VALUE_283 + lw $t0, -416($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_283 + # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -416($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_COMPARE_BY_VALUE_283 + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_COMPARE_BY_VALUE_283 + lw $t0, -416($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_283 + # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -420($fp) + sub $a0, $a0, $a1 + sw $a0, -416($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_TRUE_280 + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_TRUE_280 + lw $t0, -416($fp) + beq $t0, 0, label_TRUE_280 + # GOTO label_FALSE_279 + j label_FALSE_279 + label_COMPARE_BY_VALUE_283: + # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) + lw $a0, -4($fp) + lw $a1, -420($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -416($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_TRUE_280 + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_TRUE_280 + lw $t0, -416($fp) + beq $t0, 0, label_TRUE_280 + # GOTO label_FALSE_279 + j label_FALSE_279 + label_COMPARE_STRING_282: + # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -420($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -416($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_CONTINUE_284 + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_CONTINUE_284 + lw $t0, -416($fp) + beq $t0, 0, label_CONTINUE_284 + # GOTO label_FALSE_279 + j label_FALSE_279 + label_CONTINUE_284: + # LOCAL local_option_at_CellularAutomaton_internal_103 --> -416($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_104 --> -420($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -420($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_285: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_286 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_285 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_286: + # Store result + sw $a2, -416($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_TRUE_280 + # IF_ZERO local_option_at_CellularAutomaton_internal_103 GOTO label_TRUE_280 + lw $t0, -416($fp) + beq $t0, 0, label_TRUE_280 + label_FALSE_279: + # LOCAL local_option_at_CellularAutomaton_internal_102 --> -412($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -412($fp) + # GOTO label_END_281 +j label_END_281 +label_TRUE_280: + # LOCAL local_option_at_CellularAutomaton_internal_102 --> -412($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -412($fp) + label_END_281: +# LOCAL local_option_at_CellularAutomaton_internal_100 --> -404($fp) +# LOCAL local_option_at_CellularAutomaton_internal_102 --> -412($fp) +# Obtain value from -412($fp) +lw $v0, -412($fp) +lw $v0, 12($v0) +sw $v0, -404($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_100 GOTO label_FALSEIF_277 +# IF_ZERO local_option_at_CellularAutomaton_internal_100 GOTO label_FALSEIF_277 +lw $t0, -404($fp) +beq $t0, 0, label_FALSEIF_277 +# LOCAL local_option_at_CellularAutomaton_internal_105 --> -424($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_58 +sw $t0, 12($v0) +li $t0, 20 +sw $t0, 16($v0) +sw $v0, -424($fp) +# LOCAL local_option_at_CellularAutomaton_internal_101 --> -408($fp) +# LOCAL local_option_at_CellularAutomaton_internal_105 --> -424($fp) +# local_option_at_CellularAutomaton_internal_101 = local_option_at_CellularAutomaton_internal_105 +lw $t0, -424($fp) +sw $t0, -408($fp) +# GOTO label_ENDIF_278 +j label_ENDIF_278 +label_FALSEIF_277: + # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 2 + sw $t0, 12($v0) + sw $v0, -444($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_289 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_289 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_289 + # IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_FALSE_289 + # IF_ZERO local_option_at_CellularAutomaton_internal_110 GOTO label_FALSE_289 + lw $t0, -444($fp) + beq $t0, 0, label_FALSE_289 + # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -440($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_COMPARE_STRING_292 + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_COMPARE_STRING_292 + lw $t0, -440($fp) + beq $t0, 0, label_COMPARE_STRING_292 + # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -440($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_COMPARE_BY_VALUE_293 + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_COMPARE_BY_VALUE_293 + lw $t0, -440($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_293 + # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -440($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_COMPARE_BY_VALUE_293 + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_COMPARE_BY_VALUE_293 + lw $t0, -440($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_293 + # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -444($fp) + sub $a0, $a0, $a1 + sw $a0, -440($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_TRUE_290 + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_TRUE_290 + lw $t0, -440($fp) + beq $t0, 0, label_TRUE_290 + # GOTO label_FALSE_289 + j label_FALSE_289 + label_COMPARE_BY_VALUE_293: + # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) + lw $a0, -4($fp) + lw $a1, -444($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -440($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_TRUE_290 + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_TRUE_290 + lw $t0, -440($fp) + beq $t0, 0, label_TRUE_290 + # GOTO label_FALSE_289 + j label_FALSE_289 + label_COMPARE_STRING_292: + # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -444($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -440($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_CONTINUE_294 + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_CONTINUE_294 + lw $t0, -440($fp) + beq $t0, 0, label_CONTINUE_294 + # GOTO label_FALSE_289 + j label_FALSE_289 + label_CONTINUE_294: + # LOCAL local_option_at_CellularAutomaton_internal_109 --> -440($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_110 --> -444($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -444($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_295: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_296 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_295 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_296: + # Store result + sw $a2, -440($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_TRUE_290 + # IF_ZERO local_option_at_CellularAutomaton_internal_109 GOTO label_TRUE_290 + lw $t0, -440($fp) + beq $t0, 0, label_TRUE_290 + label_FALSE_289: + # LOCAL local_option_at_CellularAutomaton_internal_108 --> -436($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -436($fp) + # GOTO label_END_291 +j label_END_291 +label_TRUE_290: + # LOCAL local_option_at_CellularAutomaton_internal_108 --> -436($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -436($fp) + label_END_291: +# LOCAL local_option_at_CellularAutomaton_internal_106 --> -428($fp) +# LOCAL local_option_at_CellularAutomaton_internal_108 --> -436($fp) +# Obtain value from -436($fp) +lw $v0, -436($fp) +lw $v0, 12($v0) +sw $v0, -428($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_106 GOTO label_FALSEIF_287 +# IF_ZERO local_option_at_CellularAutomaton_internal_106 GOTO label_FALSEIF_287 +lw $t0, -428($fp) +beq $t0, 0, label_FALSEIF_287 +# LOCAL local_option_at_CellularAutomaton_internal_111 --> -448($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_59 +sw $t0, 12($v0) +li $t0, 25 +sw $t0, 16($v0) +sw $v0, -448($fp) +# LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) +# LOCAL local_option_at_CellularAutomaton_internal_111 --> -448($fp) +# local_option_at_CellularAutomaton_internal_107 = local_option_at_CellularAutomaton_internal_111 +lw $t0, -448($fp) +sw $t0, -432($fp) +# GOTO label_ENDIF_288 +j label_ENDIF_288 +label_FALSEIF_287: + # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 3 + sw $t0, 12($v0) + sw $v0, -468($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_299 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_299 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_299 + # IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_FALSE_299 + # IF_ZERO local_option_at_CellularAutomaton_internal_116 GOTO label_FALSE_299 + lw $t0, -468($fp) + beq $t0, 0, label_FALSE_299 + # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -464($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_COMPARE_STRING_302 + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_COMPARE_STRING_302 + lw $t0, -464($fp) + beq $t0, 0, label_COMPARE_STRING_302 + # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -464($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_COMPARE_BY_VALUE_303 + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_COMPARE_BY_VALUE_303 + lw $t0, -464($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_303 + # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -464($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_COMPARE_BY_VALUE_303 + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_COMPARE_BY_VALUE_303 + lw $t0, -464($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_303 + # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -468($fp) + sub $a0, $a0, $a1 + sw $a0, -464($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_TRUE_300 + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_TRUE_300 + lw $t0, -464($fp) + beq $t0, 0, label_TRUE_300 + # GOTO label_FALSE_299 + j label_FALSE_299 + label_COMPARE_BY_VALUE_303: + # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) + lw $a0, -4($fp) + lw $a1, -468($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -464($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_TRUE_300 + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_TRUE_300 + lw $t0, -464($fp) + beq $t0, 0, label_TRUE_300 + # GOTO label_FALSE_299 + j label_FALSE_299 + label_COMPARE_STRING_302: + # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -468($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -464($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_CONTINUE_304 + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_CONTINUE_304 + lw $t0, -464($fp) + beq $t0, 0, label_CONTINUE_304 + # GOTO label_FALSE_299 + j label_FALSE_299 + label_CONTINUE_304: + # LOCAL local_option_at_CellularAutomaton_internal_115 --> -464($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_116 --> -468($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -468($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_305: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_306 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_305 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_306: + # Store result + sw $a2, -464($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_TRUE_300 + # IF_ZERO local_option_at_CellularAutomaton_internal_115 GOTO label_TRUE_300 + lw $t0, -464($fp) + beq $t0, 0, label_TRUE_300 + label_FALSE_299: + # LOCAL local_option_at_CellularAutomaton_internal_114 --> -460($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -460($fp) + # GOTO label_END_301 +j label_END_301 +label_TRUE_300: + # LOCAL local_option_at_CellularAutomaton_internal_114 --> -460($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -460($fp) + label_END_301: +# LOCAL local_option_at_CellularAutomaton_internal_112 --> -452($fp) +# LOCAL local_option_at_CellularAutomaton_internal_114 --> -460($fp) +# Obtain value from -460($fp) +lw $v0, -460($fp) +lw $v0, 12($v0) +sw $v0, -452($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_112 GOTO label_FALSEIF_297 +# IF_ZERO local_option_at_CellularAutomaton_internal_112 GOTO label_FALSEIF_297 +lw $t0, -452($fp) +beq $t0, 0, label_FALSEIF_297 +# LOCAL local_option_at_CellularAutomaton_internal_117 --> -472($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_60 +sw $t0, 12($v0) +li $t0, 25 +sw $t0, 16($v0) +sw $v0, -472($fp) +# LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) +# LOCAL local_option_at_CellularAutomaton_internal_117 --> -472($fp) +# local_option_at_CellularAutomaton_internal_113 = local_option_at_CellularAutomaton_internal_117 +lw $t0, -472($fp) +sw $t0, -456($fp) +# GOTO label_ENDIF_298 +j label_ENDIF_298 +label_FALSEIF_297: + # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 4 + sw $t0, 12($v0) + sw $v0, -492($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_309 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_309 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_309 + # IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_FALSE_309 + # IF_ZERO local_option_at_CellularAutomaton_internal_122 GOTO label_FALSE_309 + lw $t0, -492($fp) + beq $t0, 0, label_FALSE_309 + # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -488($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_COMPARE_STRING_312 + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_COMPARE_STRING_312 + lw $t0, -488($fp) + beq $t0, 0, label_COMPARE_STRING_312 + # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -488($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_COMPARE_BY_VALUE_313 + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_COMPARE_BY_VALUE_313 + lw $t0, -488($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_313 + # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -488($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_COMPARE_BY_VALUE_313 + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_COMPARE_BY_VALUE_313 + lw $t0, -488($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_313 + # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -492($fp) + sub $a0, $a0, $a1 + sw $a0, -488($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_TRUE_310 + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_TRUE_310 + lw $t0, -488($fp) + beq $t0, 0, label_TRUE_310 + # GOTO label_FALSE_309 + j label_FALSE_309 + label_COMPARE_BY_VALUE_313: + # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) + lw $a0, -4($fp) + lw $a1, -492($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -488($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_TRUE_310 + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_TRUE_310 + lw $t0, -488($fp) + beq $t0, 0, label_TRUE_310 + # GOTO label_FALSE_309 + j label_FALSE_309 + label_COMPARE_STRING_312: + # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -492($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -488($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_CONTINUE_314 + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_CONTINUE_314 + lw $t0, -488($fp) + beq $t0, 0, label_CONTINUE_314 + # GOTO label_FALSE_309 + j label_FALSE_309 + label_CONTINUE_314: + # LOCAL local_option_at_CellularAutomaton_internal_121 --> -488($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_122 --> -492($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -492($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_315: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_316 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_315 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_316: + # Store result + sw $a2, -488($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_TRUE_310 + # IF_ZERO local_option_at_CellularAutomaton_internal_121 GOTO label_TRUE_310 + lw $t0, -488($fp) + beq $t0, 0, label_TRUE_310 + label_FALSE_309: + # LOCAL local_option_at_CellularAutomaton_internal_120 --> -484($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -484($fp) + # GOTO label_END_311 +j label_END_311 +label_TRUE_310: + # LOCAL local_option_at_CellularAutomaton_internal_120 --> -484($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -484($fp) + label_END_311: +# LOCAL local_option_at_CellularAutomaton_internal_118 --> -476($fp) +# LOCAL local_option_at_CellularAutomaton_internal_120 --> -484($fp) +# Obtain value from -484($fp) +lw $v0, -484($fp) +lw $v0, 12($v0) +sw $v0, -476($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_118 GOTO label_FALSEIF_307 +# IF_ZERO local_option_at_CellularAutomaton_internal_118 GOTO label_FALSEIF_307 +lw $t0, -476($fp) +beq $t0, 0, label_FALSEIF_307 +# LOCAL local_option_at_CellularAutomaton_internal_123 --> -496($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_61 +sw $t0, 12($v0) +li $t0, 25 +sw $t0, 16($v0) +sw $v0, -496($fp) +# LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) +# LOCAL local_option_at_CellularAutomaton_internal_123 --> -496($fp) +# local_option_at_CellularAutomaton_internal_119 = local_option_at_CellularAutomaton_internal_123 +lw $t0, -496($fp) +sw $t0, -480($fp) +# GOTO label_ENDIF_308 +j label_ENDIF_308 +label_FALSEIF_307: + # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 5 + sw $t0, 12($v0) + sw $v0, -516($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_319 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_319 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_319 + # IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_FALSE_319 + # IF_ZERO local_option_at_CellularAutomaton_internal_128 GOTO label_FALSE_319 + lw $t0, -516($fp) + beq $t0, 0, label_FALSE_319 + # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -512($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_COMPARE_STRING_322 + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_COMPARE_STRING_322 + lw $t0, -512($fp) + beq $t0, 0, label_COMPARE_STRING_322 + # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -512($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_COMPARE_BY_VALUE_323 + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_COMPARE_BY_VALUE_323 + lw $t0, -512($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_323 + # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -512($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_COMPARE_BY_VALUE_323 + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_COMPARE_BY_VALUE_323 + lw $t0, -512($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_323 + # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -516($fp) + sub $a0, $a0, $a1 + sw $a0, -512($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_TRUE_320 + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_TRUE_320 + lw $t0, -512($fp) + beq $t0, 0, label_TRUE_320 + # GOTO label_FALSE_319 + j label_FALSE_319 + label_COMPARE_BY_VALUE_323: + # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) + lw $a0, -4($fp) + lw $a1, -516($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -512($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_TRUE_320 + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_TRUE_320 + lw $t0, -512($fp) + beq $t0, 0, label_TRUE_320 + # GOTO label_FALSE_319 + j label_FALSE_319 + label_COMPARE_STRING_322: + # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -516($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -512($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_CONTINUE_324 + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_CONTINUE_324 + lw $t0, -512($fp) + beq $t0, 0, label_CONTINUE_324 + # GOTO label_FALSE_319 + j label_FALSE_319 + label_CONTINUE_324: + # LOCAL local_option_at_CellularAutomaton_internal_127 --> -512($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_128 --> -516($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -516($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_325: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_326 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_325 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_326: + # Store result + sw $a2, -512($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_TRUE_320 + # IF_ZERO local_option_at_CellularAutomaton_internal_127 GOTO label_TRUE_320 + lw $t0, -512($fp) + beq $t0, 0, label_TRUE_320 + label_FALSE_319: + # LOCAL local_option_at_CellularAutomaton_internal_126 --> -508($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -508($fp) + # GOTO label_END_321 +j label_END_321 +label_TRUE_320: + # LOCAL local_option_at_CellularAutomaton_internal_126 --> -508($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -508($fp) + label_END_321: +# LOCAL local_option_at_CellularAutomaton_internal_124 --> -500($fp) +# LOCAL local_option_at_CellularAutomaton_internal_126 --> -508($fp) +# Obtain value from -508($fp) +lw $v0, -508($fp) +lw $v0, 12($v0) +sw $v0, -500($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_124 GOTO label_FALSEIF_317 +# IF_ZERO local_option_at_CellularAutomaton_internal_124 GOTO label_FALSEIF_317 +lw $t0, -500($fp) +beq $t0, 0, label_FALSEIF_317 +# LOCAL local_option_at_CellularAutomaton_internal_129 --> -520($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_62 +sw $t0, 12($v0) +li $t0, 25 +sw $t0, 16($v0) +sw $v0, -520($fp) +# LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) +# LOCAL local_option_at_CellularAutomaton_internal_129 --> -520($fp) +# local_option_at_CellularAutomaton_internal_125 = local_option_at_CellularAutomaton_internal_129 +lw $t0, -520($fp) +sw $t0, -504($fp) +# GOTO label_ENDIF_318 +j label_ENDIF_318 +label_FALSEIF_317: + # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 6 + sw $t0, 12($v0) + sw $v0, -540($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_329 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_329 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_329 + # IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_FALSE_329 + # IF_ZERO local_option_at_CellularAutomaton_internal_134 GOTO label_FALSE_329 + lw $t0, -540($fp) + beq $t0, 0, label_FALSE_329 + # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -536($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_COMPARE_STRING_332 + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_COMPARE_STRING_332 + lw $t0, -536($fp) + beq $t0, 0, label_COMPARE_STRING_332 + # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -536($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_COMPARE_BY_VALUE_333 + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_COMPARE_BY_VALUE_333 + lw $t0, -536($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_333 + # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -536($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_COMPARE_BY_VALUE_333 + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_COMPARE_BY_VALUE_333 + lw $t0, -536($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_333 + # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -540($fp) + sub $a0, $a0, $a1 + sw $a0, -536($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_TRUE_330 + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_TRUE_330 + lw $t0, -536($fp) + beq $t0, 0, label_TRUE_330 + # GOTO label_FALSE_329 + j label_FALSE_329 + label_COMPARE_BY_VALUE_333: + # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) + lw $a0, -4($fp) + lw $a1, -540($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -536($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_TRUE_330 + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_TRUE_330 + lw $t0, -536($fp) + beq $t0, 0, label_TRUE_330 + # GOTO label_FALSE_329 + j label_FALSE_329 + label_COMPARE_STRING_332: + # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -540($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -536($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_CONTINUE_334 + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_CONTINUE_334 + lw $t0, -536($fp) + beq $t0, 0, label_CONTINUE_334 + # GOTO label_FALSE_329 + j label_FALSE_329 + label_CONTINUE_334: + # LOCAL local_option_at_CellularAutomaton_internal_133 --> -536($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_134 --> -540($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -540($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_335: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_336 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_335 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_336: + # Store result + sw $a2, -536($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_TRUE_330 + # IF_ZERO local_option_at_CellularAutomaton_internal_133 GOTO label_TRUE_330 + lw $t0, -536($fp) + beq $t0, 0, label_TRUE_330 + label_FALSE_329: + # LOCAL local_option_at_CellularAutomaton_internal_132 --> -532($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -532($fp) + # GOTO label_END_331 +j label_END_331 +label_TRUE_330: + # LOCAL local_option_at_CellularAutomaton_internal_132 --> -532($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -532($fp) + label_END_331: +# LOCAL local_option_at_CellularAutomaton_internal_130 --> -524($fp) +# LOCAL local_option_at_CellularAutomaton_internal_132 --> -532($fp) +# Obtain value from -532($fp) +lw $v0, -532($fp) +lw $v0, 12($v0) +sw $v0, -524($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_130 GOTO label_FALSEIF_327 +# IF_ZERO local_option_at_CellularAutomaton_internal_130 GOTO label_FALSEIF_327 +lw $t0, -524($fp) +beq $t0, 0, label_FALSEIF_327 +# LOCAL local_option_at_CellularAutomaton_internal_135 --> -544($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_63 +sw $t0, 12($v0) +li $t0, 25 +sw $t0, 16($v0) +sw $v0, -544($fp) +# LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) +# LOCAL local_option_at_CellularAutomaton_internal_135 --> -544($fp) +# local_option_at_CellularAutomaton_internal_131 = local_option_at_CellularAutomaton_internal_135 +lw $t0, -544($fp) +sw $t0, -528($fp) +# GOTO label_ENDIF_328 +j label_ENDIF_328 +label_FALSEIF_327: + # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 7 + sw $t0, 12($v0) + sw $v0, -564($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_339 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_339 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_339 + # IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_FALSE_339 + # IF_ZERO local_option_at_CellularAutomaton_internal_140 GOTO label_FALSE_339 + lw $t0, -564($fp) + beq $t0, 0, label_FALSE_339 + # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -560($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_COMPARE_STRING_342 + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_COMPARE_STRING_342 + lw $t0, -560($fp) + beq $t0, 0, label_COMPARE_STRING_342 + # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -560($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_COMPARE_BY_VALUE_343 + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_COMPARE_BY_VALUE_343 + lw $t0, -560($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_343 + # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -560($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_COMPARE_BY_VALUE_343 + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_COMPARE_BY_VALUE_343 + lw $t0, -560($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_343 + # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -564($fp) + sub $a0, $a0, $a1 + sw $a0, -560($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_TRUE_340 + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_TRUE_340 + lw $t0, -560($fp) + beq $t0, 0, label_TRUE_340 + # GOTO label_FALSE_339 + j label_FALSE_339 + label_COMPARE_BY_VALUE_343: + # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) + lw $a0, -4($fp) + lw $a1, -564($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -560($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_TRUE_340 + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_TRUE_340 + lw $t0, -560($fp) + beq $t0, 0, label_TRUE_340 + # GOTO label_FALSE_339 + j label_FALSE_339 + label_COMPARE_STRING_342: + # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -564($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -560($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_CONTINUE_344 + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_CONTINUE_344 + lw $t0, -560($fp) + beq $t0, 0, label_CONTINUE_344 + # GOTO label_FALSE_339 + j label_FALSE_339 + label_CONTINUE_344: + # LOCAL local_option_at_CellularAutomaton_internal_139 --> -560($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_140 --> -564($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -564($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_345: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_346 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_345 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_346: + # Store result + sw $a2, -560($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_TRUE_340 + # IF_ZERO local_option_at_CellularAutomaton_internal_139 GOTO label_TRUE_340 + lw $t0, -560($fp) + beq $t0, 0, label_TRUE_340 + label_FALSE_339: + # LOCAL local_option_at_CellularAutomaton_internal_138 --> -556($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -556($fp) + # GOTO label_END_341 +j label_END_341 +label_TRUE_340: + # LOCAL local_option_at_CellularAutomaton_internal_138 --> -556($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -556($fp) + label_END_341: +# LOCAL local_option_at_CellularAutomaton_internal_136 --> -548($fp) +# LOCAL local_option_at_CellularAutomaton_internal_138 --> -556($fp) +# Obtain value from -556($fp) +lw $v0, -556($fp) +lw $v0, 12($v0) +sw $v0, -548($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_136 GOTO label_FALSEIF_337 +# IF_ZERO local_option_at_CellularAutomaton_internal_136 GOTO label_FALSEIF_337 +lw $t0, -548($fp) +beq $t0, 0, label_FALSEIF_337 +# LOCAL local_option_at_CellularAutomaton_internal_141 --> -568($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_64 +sw $t0, 12($v0) +li $t0, 20 +sw $t0, 16($v0) +sw $v0, -568($fp) +# LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) +# LOCAL local_option_at_CellularAutomaton_internal_141 --> -568($fp) +# local_option_at_CellularAutomaton_internal_137 = local_option_at_CellularAutomaton_internal_141 +lw $t0, -568($fp) +sw $t0, -552($fp) +# GOTO label_ENDIF_338 +j label_ENDIF_338 +label_FALSEIF_337: + # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 8 + sw $t0, 12($v0) + sw $v0, -588($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_349 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_349 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_349 + # IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_FALSE_349 + # IF_ZERO local_option_at_CellularAutomaton_internal_146 GOTO label_FALSE_349 + lw $t0, -588($fp) + beq $t0, 0, label_FALSE_349 + # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -584($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_COMPARE_STRING_352 + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_COMPARE_STRING_352 + lw $t0, -584($fp) + beq $t0, 0, label_COMPARE_STRING_352 + # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -584($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_COMPARE_BY_VALUE_353 + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_COMPARE_BY_VALUE_353 + lw $t0, -584($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_353 + # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -584($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_COMPARE_BY_VALUE_353 + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_COMPARE_BY_VALUE_353 + lw $t0, -584($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_353 + # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -588($fp) + sub $a0, $a0, $a1 + sw $a0, -584($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_TRUE_350 + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_TRUE_350 + lw $t0, -584($fp) + beq $t0, 0, label_TRUE_350 + # GOTO label_FALSE_349 + j label_FALSE_349 + label_COMPARE_BY_VALUE_353: + # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) + lw $a0, -4($fp) + lw $a1, -588($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -584($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_TRUE_350 + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_TRUE_350 + lw $t0, -584($fp) + beq $t0, 0, label_TRUE_350 + # GOTO label_FALSE_349 + j label_FALSE_349 + label_COMPARE_STRING_352: + # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -588($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -584($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_CONTINUE_354 + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_CONTINUE_354 + lw $t0, -584($fp) + beq $t0, 0, label_CONTINUE_354 + # GOTO label_FALSE_349 + j label_FALSE_349 + label_CONTINUE_354: + # LOCAL local_option_at_CellularAutomaton_internal_145 --> -584($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_146 --> -588($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -588($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_355: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_356 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_355 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_356: + # Store result + sw $a2, -584($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_TRUE_350 + # IF_ZERO local_option_at_CellularAutomaton_internal_145 GOTO label_TRUE_350 + lw $t0, -584($fp) + beq $t0, 0, label_TRUE_350 + label_FALSE_349: + # LOCAL local_option_at_CellularAutomaton_internal_144 --> -580($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -580($fp) + # GOTO label_END_351 +j label_END_351 +label_TRUE_350: + # LOCAL local_option_at_CellularAutomaton_internal_144 --> -580($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -580($fp) + label_END_351: +# LOCAL local_option_at_CellularAutomaton_internal_142 --> -572($fp) +# LOCAL local_option_at_CellularAutomaton_internal_144 --> -580($fp) +# Obtain value from -580($fp) +lw $v0, -580($fp) +lw $v0, 12($v0) +sw $v0, -572($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_142 GOTO label_FALSEIF_347 +# IF_ZERO local_option_at_CellularAutomaton_internal_142 GOTO label_FALSEIF_347 +lw $t0, -572($fp) +beq $t0, 0, label_FALSEIF_347 +# LOCAL local_option_at_CellularAutomaton_internal_147 --> -592($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_65 +sw $t0, 12($v0) +li $t0, 20 +sw $t0, 16($v0) +sw $v0, -592($fp) +# LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) +# LOCAL local_option_at_CellularAutomaton_internal_147 --> -592($fp) +# local_option_at_CellularAutomaton_internal_143 = local_option_at_CellularAutomaton_internal_147 +lw $t0, -592($fp) +sw $t0, -576($fp) +# GOTO label_ENDIF_348 +j label_ENDIF_348 +label_FALSEIF_347: + # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 9 + sw $t0, 12($v0) + sw $v0, -612($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_359 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_359 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_359 + # IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_FALSE_359 + # IF_ZERO local_option_at_CellularAutomaton_internal_152 GOTO label_FALSE_359 + lw $t0, -612($fp) + beq $t0, 0, label_FALSE_359 + # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -608($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_COMPARE_STRING_362 + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_COMPARE_STRING_362 + lw $t0, -608($fp) + beq $t0, 0, label_COMPARE_STRING_362 + # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -608($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_COMPARE_BY_VALUE_363 + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_COMPARE_BY_VALUE_363 + lw $t0, -608($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_363 + # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -608($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_COMPARE_BY_VALUE_363 + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_COMPARE_BY_VALUE_363 + lw $t0, -608($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_363 + # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -612($fp) + sub $a0, $a0, $a1 + sw $a0, -608($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_TRUE_360 + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_TRUE_360 + lw $t0, -608($fp) + beq $t0, 0, label_TRUE_360 + # GOTO label_FALSE_359 + j label_FALSE_359 + label_COMPARE_BY_VALUE_363: + # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) + lw $a0, -4($fp) + lw $a1, -612($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -608($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_TRUE_360 + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_TRUE_360 + lw $t0, -608($fp) + beq $t0, 0, label_TRUE_360 + # GOTO label_FALSE_359 + j label_FALSE_359 + label_COMPARE_STRING_362: + # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -612($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -608($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_CONTINUE_364 + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_CONTINUE_364 + lw $t0, -608($fp) + beq $t0, 0, label_CONTINUE_364 + # GOTO label_FALSE_359 + j label_FALSE_359 + label_CONTINUE_364: + # LOCAL local_option_at_CellularAutomaton_internal_151 --> -608($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_152 --> -612($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -612($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_365: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_366 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_365 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_366: + # Store result + sw $a2, -608($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_TRUE_360 + # IF_ZERO local_option_at_CellularAutomaton_internal_151 GOTO label_TRUE_360 + lw $t0, -608($fp) + beq $t0, 0, label_TRUE_360 + label_FALSE_359: + # LOCAL local_option_at_CellularAutomaton_internal_150 --> -604($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -604($fp) + # GOTO label_END_361 +j label_END_361 +label_TRUE_360: + # LOCAL local_option_at_CellularAutomaton_internal_150 --> -604($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -604($fp) + label_END_361: +# LOCAL local_option_at_CellularAutomaton_internal_148 --> -596($fp) +# LOCAL local_option_at_CellularAutomaton_internal_150 --> -604($fp) +# Obtain value from -604($fp) +lw $v0, -604($fp) +lw $v0, 12($v0) +sw $v0, -596($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_148 GOTO label_FALSEIF_357 +# IF_ZERO local_option_at_CellularAutomaton_internal_148 GOTO label_FALSEIF_357 +lw $t0, -596($fp) +beq $t0, 0, label_FALSEIF_357 +# LOCAL local_option_at_CellularAutomaton_internal_153 --> -616($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_66 +sw $t0, 12($v0) +li $t0, 15 +sw $t0, 16($v0) +sw $v0, -616($fp) +# LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) +# LOCAL local_option_at_CellularAutomaton_internal_153 --> -616($fp) +# local_option_at_CellularAutomaton_internal_149 = local_option_at_CellularAutomaton_internal_153 +lw $t0, -616($fp) +sw $t0, -600($fp) +# GOTO label_ENDIF_358 +j label_ENDIF_358 +label_FALSEIF_357: + # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 10 + sw $t0, 12($v0) + sw $v0, -636($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_369 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_369 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_369 + # IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_FALSE_369 + # IF_ZERO local_option_at_CellularAutomaton_internal_158 GOTO label_FALSE_369 + lw $t0, -636($fp) + beq $t0, 0, label_FALSE_369 + # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -632($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_COMPARE_STRING_372 + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_COMPARE_STRING_372 + lw $t0, -632($fp) + beq $t0, 0, label_COMPARE_STRING_372 + # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -632($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_COMPARE_BY_VALUE_373 + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_COMPARE_BY_VALUE_373 + lw $t0, -632($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_373 + # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -632($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_COMPARE_BY_VALUE_373 + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_COMPARE_BY_VALUE_373 + lw $t0, -632($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_373 + # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -636($fp) + sub $a0, $a0, $a1 + sw $a0, -632($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_TRUE_370 + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_TRUE_370 + lw $t0, -632($fp) + beq $t0, 0, label_TRUE_370 + # GOTO label_FALSE_369 + j label_FALSE_369 + label_COMPARE_BY_VALUE_373: + # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) + lw $a0, -4($fp) + lw $a1, -636($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -632($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_TRUE_370 + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_TRUE_370 + lw $t0, -632($fp) + beq $t0, 0, label_TRUE_370 + # GOTO label_FALSE_369 + j label_FALSE_369 + label_COMPARE_STRING_372: + # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -636($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -632($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_CONTINUE_374 + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_CONTINUE_374 + lw $t0, -632($fp) + beq $t0, 0, label_CONTINUE_374 + # GOTO label_FALSE_369 + j label_FALSE_369 + label_CONTINUE_374: + # LOCAL local_option_at_CellularAutomaton_internal_157 --> -632($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_158 --> -636($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -636($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_375: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_376 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_375 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_376: + # Store result + sw $a2, -632($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_TRUE_370 + # IF_ZERO local_option_at_CellularAutomaton_internal_157 GOTO label_TRUE_370 + lw $t0, -632($fp) + beq $t0, 0, label_TRUE_370 + label_FALSE_369: + # LOCAL local_option_at_CellularAutomaton_internal_156 --> -628($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -628($fp) + # GOTO label_END_371 +j label_END_371 +label_TRUE_370: + # LOCAL local_option_at_CellularAutomaton_internal_156 --> -628($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -628($fp) + label_END_371: +# LOCAL local_option_at_CellularAutomaton_internal_154 --> -620($fp) +# LOCAL local_option_at_CellularAutomaton_internal_156 --> -628($fp) +# Obtain value from -628($fp) +lw $v0, -628($fp) +lw $v0, 12($v0) +sw $v0, -620($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_154 GOTO label_FALSEIF_367 +# IF_ZERO local_option_at_CellularAutomaton_internal_154 GOTO label_FALSEIF_367 +lw $t0, -620($fp) +beq $t0, 0, label_FALSEIF_367 +# LOCAL local_option_at_CellularAutomaton_internal_159 --> -640($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_67 +sw $t0, 12($v0) +li $t0, 15 +sw $t0, 16($v0) +sw $v0, -640($fp) +# LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) +# LOCAL local_option_at_CellularAutomaton_internal_159 --> -640($fp) +# local_option_at_CellularAutomaton_internal_155 = local_option_at_CellularAutomaton_internal_159 +lw $t0, -640($fp) +sw $t0, -624($fp) +# GOTO label_ENDIF_368 +j label_ENDIF_368 +label_FALSEIF_367: + # LOCAL local_option_at_CellularAutomaton_internal_164 --> -660($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 11 + sw $t0, 12($v0) + sw $v0, -660($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_379 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_379 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_379 + # IF_ZERO local_option_at_CellularAutomaton_internal_164 GOTO label_FALSE_379 + # IF_ZERO local_option_at_CellularAutomaton_internal_164 GOTO label_FALSE_379 + lw $t0, -660($fp) + beq $t0, 0, label_FALSE_379 + # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -656($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_COMPARE_STRING_382 + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_COMPARE_STRING_382 + lw $t0, -656($fp) + beq $t0, 0, label_COMPARE_STRING_382 + # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -656($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_COMPARE_BY_VALUE_383 + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_COMPARE_BY_VALUE_383 + lw $t0, -656($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_383 + # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -656($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_COMPARE_BY_VALUE_383 + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_COMPARE_BY_VALUE_383 + lw $t0, -656($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_383 + # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_164 --> -660($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -660($fp) + sub $a0, $a0, $a1 + sw $a0, -656($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_TRUE_380 + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_TRUE_380 + lw $t0, -656($fp) + beq $t0, 0, label_TRUE_380 + # GOTO label_FALSE_379 + j label_FALSE_379 + label_COMPARE_BY_VALUE_383: + # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_164 --> -660($fp) + lw $a0, -4($fp) + lw $a1, -660($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -656($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_TRUE_380 + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_TRUE_380 + lw $t0, -656($fp) + beq $t0, 0, label_TRUE_380 + # GOTO label_FALSE_379 + j label_FALSE_379 + label_COMPARE_STRING_382: + # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_164 --> -660($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -660($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -656($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_CONTINUE_384 + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_CONTINUE_384 + lw $t0, -656($fp) + beq $t0, 0, label_CONTINUE_384 + # GOTO label_FALSE_379 + j label_FALSE_379 + label_CONTINUE_384: + # LOCAL local_option_at_CellularAutomaton_internal_163 --> -656($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_164 --> -660($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -660($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_385: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_386 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_385 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_386: + # Store result + sw $a2, -656($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_TRUE_380 + # IF_ZERO local_option_at_CellularAutomaton_internal_163 GOTO label_TRUE_380 + lw $t0, -656($fp) + beq $t0, 0, label_TRUE_380 + label_FALSE_379: + # LOCAL local_option_at_CellularAutomaton_internal_162 --> -652($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -652($fp) + # GOTO label_END_381 +j label_END_381 +label_TRUE_380: + # LOCAL local_option_at_CellularAutomaton_internal_162 --> -652($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -652($fp) + label_END_381: +# LOCAL local_option_at_CellularAutomaton_internal_160 --> -644($fp) +# LOCAL local_option_at_CellularAutomaton_internal_162 --> -652($fp) +# Obtain value from -652($fp) +lw $v0, -652($fp) +lw $v0, 12($v0) +sw $v0, -644($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_160 GOTO label_FALSEIF_377 +# IF_ZERO local_option_at_CellularAutomaton_internal_160 GOTO label_FALSEIF_377 +lw $t0, -644($fp) +beq $t0, 0, label_FALSEIF_377 +# LOCAL local_option_at_CellularAutomaton_internal_165 --> -664($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_68 +sw $t0, 12($v0) +li $t0, 15 +sw $t0, 16($v0) +sw $v0, -664($fp) +# LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) +# LOCAL local_option_at_CellularAutomaton_internal_165 --> -664($fp) +# local_option_at_CellularAutomaton_internal_161 = local_option_at_CellularAutomaton_internal_165 +lw $t0, -664($fp) +sw $t0, -648($fp) +# GOTO label_ENDIF_378 +j label_ENDIF_378 +label_FALSEIF_377: + # LOCAL local_option_at_CellularAutomaton_internal_170 --> -684($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 12 + sw $t0, 12($v0) + sw $v0, -684($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_389 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_389 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_389 + # IF_ZERO local_option_at_CellularAutomaton_internal_170 GOTO label_FALSE_389 + # IF_ZERO local_option_at_CellularAutomaton_internal_170 GOTO label_FALSE_389 + lw $t0, -684($fp) + beq $t0, 0, label_FALSE_389 + # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -680($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_COMPARE_STRING_392 + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_COMPARE_STRING_392 + lw $t0, -680($fp) + beq $t0, 0, label_COMPARE_STRING_392 + # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -680($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_COMPARE_BY_VALUE_393 + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_COMPARE_BY_VALUE_393 + lw $t0, -680($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_393 + # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -680($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_COMPARE_BY_VALUE_393 + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_COMPARE_BY_VALUE_393 + lw $t0, -680($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_393 + # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_170 --> -684($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -684($fp) + sub $a0, $a0, $a1 + sw $a0, -680($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_TRUE_390 + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_TRUE_390 + lw $t0, -680($fp) + beq $t0, 0, label_TRUE_390 + # GOTO label_FALSE_389 + j label_FALSE_389 + label_COMPARE_BY_VALUE_393: + # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_170 --> -684($fp) + lw $a0, -4($fp) + lw $a1, -684($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -680($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_TRUE_390 + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_TRUE_390 + lw $t0, -680($fp) + beq $t0, 0, label_TRUE_390 + # GOTO label_FALSE_389 + j label_FALSE_389 + label_COMPARE_STRING_392: + # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_170 --> -684($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -684($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -680($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_CONTINUE_394 + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_CONTINUE_394 + lw $t0, -680($fp) + beq $t0, 0, label_CONTINUE_394 + # GOTO label_FALSE_389 + j label_FALSE_389 + label_CONTINUE_394: + # LOCAL local_option_at_CellularAutomaton_internal_169 --> -680($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_170 --> -684($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -684($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_395: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_396 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_395 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_396: + # Store result + sw $a2, -680($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_TRUE_390 + # IF_ZERO local_option_at_CellularAutomaton_internal_169 GOTO label_TRUE_390 + lw $t0, -680($fp) + beq $t0, 0, label_TRUE_390 + label_FALSE_389: + # LOCAL local_option_at_CellularAutomaton_internal_168 --> -676($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -676($fp) + # GOTO label_END_391 +j label_END_391 +label_TRUE_390: + # LOCAL local_option_at_CellularAutomaton_internal_168 --> -676($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -676($fp) + label_END_391: +# LOCAL local_option_at_CellularAutomaton_internal_166 --> -668($fp) +# LOCAL local_option_at_CellularAutomaton_internal_168 --> -676($fp) +# Obtain value from -676($fp) +lw $v0, -676($fp) +lw $v0, 12($v0) +sw $v0, -668($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_166 GOTO label_FALSEIF_387 +# IF_ZERO local_option_at_CellularAutomaton_internal_166 GOTO label_FALSEIF_387 +lw $t0, -668($fp) +beq $t0, 0, label_FALSEIF_387 +# LOCAL local_option_at_CellularAutomaton_internal_171 --> -688($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_69 +sw $t0, 12($v0) +li $t0, 25 +sw $t0, 16($v0) +sw $v0, -688($fp) +# LOCAL local_option_at_CellularAutomaton_internal_167 --> -672($fp) +# LOCAL local_option_at_CellularAutomaton_internal_171 --> -688($fp) +# local_option_at_CellularAutomaton_internal_167 = local_option_at_CellularAutomaton_internal_171 +lw $t0, -688($fp) +sw $t0, -672($fp) +# GOTO label_ENDIF_388 +j label_ENDIF_388 +label_FALSEIF_387: + # LOCAL local_option_at_CellularAutomaton_internal_176 --> -708($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 13 + sw $t0, 12($v0) + sw $v0, -708($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_399 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_399 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_399 + # IF_ZERO local_option_at_CellularAutomaton_internal_176 GOTO label_FALSE_399 + # IF_ZERO local_option_at_CellularAutomaton_internal_176 GOTO label_FALSE_399 + lw $t0, -708($fp) + beq $t0, 0, label_FALSE_399 + # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -704($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_COMPARE_STRING_402 + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_COMPARE_STRING_402 + lw $t0, -704($fp) + beq $t0, 0, label_COMPARE_STRING_402 + # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -704($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_COMPARE_BY_VALUE_403 + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_COMPARE_BY_VALUE_403 + lw $t0, -704($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_403 + # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -704($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_COMPARE_BY_VALUE_403 + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_COMPARE_BY_VALUE_403 + lw $t0, -704($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_403 + # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_176 --> -708($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -708($fp) + sub $a0, $a0, $a1 + sw $a0, -704($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_TRUE_400 + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_TRUE_400 + lw $t0, -704($fp) + beq $t0, 0, label_TRUE_400 + # GOTO label_FALSE_399 + j label_FALSE_399 + label_COMPARE_BY_VALUE_403: + # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_176 --> -708($fp) + lw $a0, -4($fp) + lw $a1, -708($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -704($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_TRUE_400 + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_TRUE_400 + lw $t0, -704($fp) + beq $t0, 0, label_TRUE_400 + # GOTO label_FALSE_399 + j label_FALSE_399 + label_COMPARE_STRING_402: + # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_176 --> -708($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -708($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -704($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_CONTINUE_404 + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_CONTINUE_404 + lw $t0, -704($fp) + beq $t0, 0, label_CONTINUE_404 + # GOTO label_FALSE_399 + j label_FALSE_399 + label_CONTINUE_404: + # LOCAL local_option_at_CellularAutomaton_internal_175 --> -704($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_176 --> -708($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -708($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_405: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_406 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_405 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_406: + # Store result + sw $a2, -704($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_TRUE_400 + # IF_ZERO local_option_at_CellularAutomaton_internal_175 GOTO label_TRUE_400 + lw $t0, -704($fp) + beq $t0, 0, label_TRUE_400 + label_FALSE_399: + # LOCAL local_option_at_CellularAutomaton_internal_174 --> -700($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -700($fp) + # GOTO label_END_401 +j label_END_401 +label_TRUE_400: + # LOCAL local_option_at_CellularAutomaton_internal_174 --> -700($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -700($fp) + label_END_401: +# LOCAL local_option_at_CellularAutomaton_internal_172 --> -692($fp) +# LOCAL local_option_at_CellularAutomaton_internal_174 --> -700($fp) +# Obtain value from -700($fp) +lw $v0, -700($fp) +lw $v0, 12($v0) +sw $v0, -692($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_172 GOTO label_FALSEIF_397 +# IF_ZERO local_option_at_CellularAutomaton_internal_172 GOTO label_FALSEIF_397 +lw $t0, -692($fp) +beq $t0, 0, label_FALSEIF_397 +# LOCAL local_option_at_CellularAutomaton_internal_177 --> -712($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_70 +sw $t0, 12($v0) +li $t0, 25 +sw $t0, 16($v0) +sw $v0, -712($fp) +# LOCAL local_option_at_CellularAutomaton_internal_173 --> -696($fp) +# LOCAL local_option_at_CellularAutomaton_internal_177 --> -712($fp) +# local_option_at_CellularAutomaton_internal_173 = local_option_at_CellularAutomaton_internal_177 +lw $t0, -712($fp) +sw $t0, -696($fp) +# GOTO label_ENDIF_398 +j label_ENDIF_398 +label_FALSEIF_397: + # LOCAL local_option_at_CellularAutomaton_internal_182 --> -732($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 14 + sw $t0, 12($v0) + sw $v0, -732($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_409 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_409 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_409 + # IF_ZERO local_option_at_CellularAutomaton_internal_182 GOTO label_FALSE_409 + # IF_ZERO local_option_at_CellularAutomaton_internal_182 GOTO label_FALSE_409 + lw $t0, -732($fp) + beq $t0, 0, label_FALSE_409 + # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -728($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_COMPARE_STRING_412 + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_COMPARE_STRING_412 + lw $t0, -728($fp) + beq $t0, 0, label_COMPARE_STRING_412 + # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -728($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_COMPARE_BY_VALUE_413 + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_COMPARE_BY_VALUE_413 + lw $t0, -728($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_413 + # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -728($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_COMPARE_BY_VALUE_413 + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_COMPARE_BY_VALUE_413 + lw $t0, -728($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_413 + # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_182 --> -732($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -732($fp) + sub $a0, $a0, $a1 + sw $a0, -728($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_TRUE_410 + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_TRUE_410 + lw $t0, -728($fp) + beq $t0, 0, label_TRUE_410 + # GOTO label_FALSE_409 + j label_FALSE_409 + label_COMPARE_BY_VALUE_413: + # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_182 --> -732($fp) + lw $a0, -4($fp) + lw $a1, -732($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -728($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_TRUE_410 + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_TRUE_410 + lw $t0, -728($fp) + beq $t0, 0, label_TRUE_410 + # GOTO label_FALSE_409 + j label_FALSE_409 + label_COMPARE_STRING_412: + # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_182 --> -732($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -732($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -728($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_CONTINUE_414 + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_CONTINUE_414 + lw $t0, -728($fp) + beq $t0, 0, label_CONTINUE_414 + # GOTO label_FALSE_409 + j label_FALSE_409 + label_CONTINUE_414: + # LOCAL local_option_at_CellularAutomaton_internal_181 --> -728($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_182 --> -732($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -732($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_415: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_416 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_415 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_416: + # Store result + sw $a2, -728($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_TRUE_410 + # IF_ZERO local_option_at_CellularAutomaton_internal_181 GOTO label_TRUE_410 + lw $t0, -728($fp) + beq $t0, 0, label_TRUE_410 + label_FALSE_409: + # LOCAL local_option_at_CellularAutomaton_internal_180 --> -724($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -724($fp) + # GOTO label_END_411 +j label_END_411 +label_TRUE_410: + # LOCAL local_option_at_CellularAutomaton_internal_180 --> -724($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -724($fp) + label_END_411: +# LOCAL local_option_at_CellularAutomaton_internal_178 --> -716($fp) +# LOCAL local_option_at_CellularAutomaton_internal_180 --> -724($fp) +# Obtain value from -724($fp) +lw $v0, -724($fp) +lw $v0, 12($v0) +sw $v0, -716($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_178 GOTO label_FALSEIF_407 +# IF_ZERO local_option_at_CellularAutomaton_internal_178 GOTO label_FALSEIF_407 +lw $t0, -716($fp) +beq $t0, 0, label_FALSEIF_407 +# LOCAL local_option_at_CellularAutomaton_internal_183 --> -736($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_71 +sw $t0, 12($v0) +li $t0, 25 +sw $t0, 16($v0) +sw $v0, -736($fp) +# LOCAL local_option_at_CellularAutomaton_internal_179 --> -720($fp) +# LOCAL local_option_at_CellularAutomaton_internal_183 --> -736($fp) +# local_option_at_CellularAutomaton_internal_179 = local_option_at_CellularAutomaton_internal_183 +lw $t0, -736($fp) +sw $t0, -720($fp) +# GOTO label_ENDIF_408 +j label_ENDIF_408 +label_FALSEIF_407: + # LOCAL local_option_at_CellularAutomaton_internal_188 --> -756($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 15 + sw $t0, 12($v0) + sw $v0, -756($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_419 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_419 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_419 + # IF_ZERO local_option_at_CellularAutomaton_internal_188 GOTO label_FALSE_419 + # IF_ZERO local_option_at_CellularAutomaton_internal_188 GOTO label_FALSE_419 + lw $t0, -756($fp) + beq $t0, 0, label_FALSE_419 + # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -752($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_COMPARE_STRING_422 + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_COMPARE_STRING_422 + lw $t0, -752($fp) + beq $t0, 0, label_COMPARE_STRING_422 + # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -752($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_COMPARE_BY_VALUE_423 + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_COMPARE_BY_VALUE_423 + lw $t0, -752($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_423 + # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -752($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_COMPARE_BY_VALUE_423 + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_COMPARE_BY_VALUE_423 + lw $t0, -752($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_423 + # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_188 --> -756($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -756($fp) + sub $a0, $a0, $a1 + sw $a0, -752($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_TRUE_420 + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_TRUE_420 + lw $t0, -752($fp) + beq $t0, 0, label_TRUE_420 + # GOTO label_FALSE_419 + j label_FALSE_419 + label_COMPARE_BY_VALUE_423: + # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_188 --> -756($fp) + lw $a0, -4($fp) + lw $a1, -756($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -752($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_TRUE_420 + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_TRUE_420 + lw $t0, -752($fp) + beq $t0, 0, label_TRUE_420 + # GOTO label_FALSE_419 + j label_FALSE_419 + label_COMPARE_STRING_422: + # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_188 --> -756($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -756($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -752($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_CONTINUE_424 + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_CONTINUE_424 + lw $t0, -752($fp) + beq $t0, 0, label_CONTINUE_424 + # GOTO label_FALSE_419 + j label_FALSE_419 + label_CONTINUE_424: + # LOCAL local_option_at_CellularAutomaton_internal_187 --> -752($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_188 --> -756($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -756($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_425: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_426 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_425 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_426: + # Store result + sw $a2, -752($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_TRUE_420 + # IF_ZERO local_option_at_CellularAutomaton_internal_187 GOTO label_TRUE_420 + lw $t0, -752($fp) + beq $t0, 0, label_TRUE_420 + label_FALSE_419: + # LOCAL local_option_at_CellularAutomaton_internal_186 --> -748($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -748($fp) + # GOTO label_END_421 +j label_END_421 +label_TRUE_420: + # LOCAL local_option_at_CellularAutomaton_internal_186 --> -748($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -748($fp) + label_END_421: +# LOCAL local_option_at_CellularAutomaton_internal_184 --> -740($fp) +# LOCAL local_option_at_CellularAutomaton_internal_186 --> -748($fp) +# Obtain value from -748($fp) +lw $v0, -748($fp) +lw $v0, 12($v0) +sw $v0, -740($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_184 GOTO label_FALSEIF_417 +# IF_ZERO local_option_at_CellularAutomaton_internal_184 GOTO label_FALSEIF_417 +lw $t0, -740($fp) +beq $t0, 0, label_FALSEIF_417 +# LOCAL local_option_at_CellularAutomaton_internal_189 --> -760($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_72 +sw $t0, 12($v0) +li $t0, 21 +sw $t0, 16($v0) +sw $v0, -760($fp) +# LOCAL local_option_at_CellularAutomaton_internal_185 --> -744($fp) +# LOCAL local_option_at_CellularAutomaton_internal_189 --> -760($fp) +# local_option_at_CellularAutomaton_internal_185 = local_option_at_CellularAutomaton_internal_189 +lw $t0, -760($fp) +sw $t0, -744($fp) +# GOTO label_ENDIF_418 +j label_ENDIF_418 +label_FALSEIF_417: + # LOCAL local_option_at_CellularAutomaton_internal_194 --> -780($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 16 + sw $t0, 12($v0) + sw $v0, -780($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_429 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_429 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_429 + # IF_ZERO local_option_at_CellularAutomaton_internal_194 GOTO label_FALSE_429 + # IF_ZERO local_option_at_CellularAutomaton_internal_194 GOTO label_FALSE_429 + lw $t0, -780($fp) + beq $t0, 0, label_FALSE_429 + # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -776($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_COMPARE_STRING_432 + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_COMPARE_STRING_432 + lw $t0, -776($fp) + beq $t0, 0, label_COMPARE_STRING_432 + # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -776($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_COMPARE_BY_VALUE_433 + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_COMPARE_BY_VALUE_433 + lw $t0, -776($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_433 + # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -776($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_COMPARE_BY_VALUE_433 + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_COMPARE_BY_VALUE_433 + lw $t0, -776($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_433 + # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_194 --> -780($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -780($fp) + sub $a0, $a0, $a1 + sw $a0, -776($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_TRUE_430 + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_TRUE_430 + lw $t0, -776($fp) + beq $t0, 0, label_TRUE_430 + # GOTO label_FALSE_429 + j label_FALSE_429 + label_COMPARE_BY_VALUE_433: + # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_194 --> -780($fp) + lw $a0, -4($fp) + lw $a1, -780($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -776($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_TRUE_430 + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_TRUE_430 + lw $t0, -776($fp) + beq $t0, 0, label_TRUE_430 + # GOTO label_FALSE_429 + j label_FALSE_429 + label_COMPARE_STRING_432: + # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_194 --> -780($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -780($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -776($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_CONTINUE_434 + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_CONTINUE_434 + lw $t0, -776($fp) + beq $t0, 0, label_CONTINUE_434 + # GOTO label_FALSE_429 + j label_FALSE_429 + label_CONTINUE_434: + # LOCAL local_option_at_CellularAutomaton_internal_193 --> -776($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_194 --> -780($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -780($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_435: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_436 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_435 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_436: + # Store result + sw $a2, -776($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_TRUE_430 + # IF_ZERO local_option_at_CellularAutomaton_internal_193 GOTO label_TRUE_430 + lw $t0, -776($fp) + beq $t0, 0, label_TRUE_430 + label_FALSE_429: + # LOCAL local_option_at_CellularAutomaton_internal_192 --> -772($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -772($fp) + # GOTO label_END_431 +j label_END_431 +label_TRUE_430: + # LOCAL local_option_at_CellularAutomaton_internal_192 --> -772($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -772($fp) + label_END_431: +# LOCAL local_option_at_CellularAutomaton_internal_190 --> -764($fp) +# LOCAL local_option_at_CellularAutomaton_internal_192 --> -772($fp) +# Obtain value from -772($fp) +lw $v0, -772($fp) +lw $v0, 12($v0) +sw $v0, -764($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_190 GOTO label_FALSEIF_427 +# IF_ZERO local_option_at_CellularAutomaton_internal_190 GOTO label_FALSEIF_427 +lw $t0, -764($fp) +beq $t0, 0, label_FALSEIF_427 +# LOCAL local_option_at_CellularAutomaton_internal_195 --> -784($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_73 +sw $t0, 12($v0) +li $t0, 21 +sw $t0, 16($v0) +sw $v0, -784($fp) +# LOCAL local_option_at_CellularAutomaton_internal_191 --> -768($fp) +# LOCAL local_option_at_CellularAutomaton_internal_195 --> -784($fp) +# local_option_at_CellularAutomaton_internal_191 = local_option_at_CellularAutomaton_internal_195 +lw $t0, -784($fp) +sw $t0, -768($fp) +# GOTO label_ENDIF_428 +j label_ENDIF_428 +label_FALSEIF_427: + # LOCAL local_option_at_CellularAutomaton_internal_200 --> -804($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 17 + sw $t0, 12($v0) + sw $v0, -804($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_439 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_439 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_439 + # IF_ZERO local_option_at_CellularAutomaton_internal_200 GOTO label_FALSE_439 + # IF_ZERO local_option_at_CellularAutomaton_internal_200 GOTO label_FALSE_439 + lw $t0, -804($fp) + beq $t0, 0, label_FALSE_439 + # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -800($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_COMPARE_STRING_442 + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_COMPARE_STRING_442 + lw $t0, -800($fp) + beq $t0, 0, label_COMPARE_STRING_442 + # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -800($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_COMPARE_BY_VALUE_443 + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_COMPARE_BY_VALUE_443 + lw $t0, -800($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_443 + # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -800($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_COMPARE_BY_VALUE_443 + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_COMPARE_BY_VALUE_443 + lw $t0, -800($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_443 + # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_200 --> -804($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -804($fp) + sub $a0, $a0, $a1 + sw $a0, -800($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_TRUE_440 + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_TRUE_440 + lw $t0, -800($fp) + beq $t0, 0, label_TRUE_440 + # GOTO label_FALSE_439 + j label_FALSE_439 + label_COMPARE_BY_VALUE_443: + # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_200 --> -804($fp) + lw $a0, -4($fp) + lw $a1, -804($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -800($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_TRUE_440 + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_TRUE_440 + lw $t0, -800($fp) + beq $t0, 0, label_TRUE_440 + # GOTO label_FALSE_439 + j label_FALSE_439 + label_COMPARE_STRING_442: + # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_200 --> -804($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -804($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -800($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_CONTINUE_444 + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_CONTINUE_444 + lw $t0, -800($fp) + beq $t0, 0, label_CONTINUE_444 + # GOTO label_FALSE_439 + j label_FALSE_439 + label_CONTINUE_444: + # LOCAL local_option_at_CellularAutomaton_internal_199 --> -800($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_200 --> -804($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -804($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_445: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_446 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_445 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_446: + # Store result + sw $a2, -800($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_TRUE_440 + # IF_ZERO local_option_at_CellularAutomaton_internal_199 GOTO label_TRUE_440 + lw $t0, -800($fp) + beq $t0, 0, label_TRUE_440 + label_FALSE_439: + # LOCAL local_option_at_CellularAutomaton_internal_198 --> -796($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -796($fp) + # GOTO label_END_441 +j label_END_441 +label_TRUE_440: + # LOCAL local_option_at_CellularAutomaton_internal_198 --> -796($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -796($fp) + label_END_441: +# LOCAL local_option_at_CellularAutomaton_internal_196 --> -788($fp) +# LOCAL local_option_at_CellularAutomaton_internal_198 --> -796($fp) +# Obtain value from -796($fp) +lw $v0, -796($fp) +lw $v0, 12($v0) +sw $v0, -788($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_196 GOTO label_FALSEIF_437 +# IF_ZERO local_option_at_CellularAutomaton_internal_196 GOTO label_FALSEIF_437 +lw $t0, -788($fp) +beq $t0, 0, label_FALSEIF_437 +# LOCAL local_option_at_CellularAutomaton_internal_201 --> -808($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_74 +sw $t0, 12($v0) +li $t0, 28 +sw $t0, 16($v0) +sw $v0, -808($fp) +# LOCAL local_option_at_CellularAutomaton_internal_197 --> -792($fp) +# LOCAL local_option_at_CellularAutomaton_internal_201 --> -808($fp) +# local_option_at_CellularAutomaton_internal_197 = local_option_at_CellularAutomaton_internal_201 +lw $t0, -808($fp) +sw $t0, -792($fp) +# GOTO label_ENDIF_438 +j label_ENDIF_438 +label_FALSEIF_437: + # LOCAL local_option_at_CellularAutomaton_internal_206 --> -828($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 18 + sw $t0, 12($v0) + sw $v0, -828($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_449 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_449 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_449 + # IF_ZERO local_option_at_CellularAutomaton_internal_206 GOTO label_FALSE_449 + # IF_ZERO local_option_at_CellularAutomaton_internal_206 GOTO label_FALSE_449 + lw $t0, -828($fp) + beq $t0, 0, label_FALSE_449 + # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -824($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_COMPARE_STRING_452 + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_COMPARE_STRING_452 + lw $t0, -824($fp) + beq $t0, 0, label_COMPARE_STRING_452 + # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -824($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_COMPARE_BY_VALUE_453 + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_COMPARE_BY_VALUE_453 + lw $t0, -824($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_453 + # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -824($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_COMPARE_BY_VALUE_453 + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_COMPARE_BY_VALUE_453 + lw $t0, -824($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_453 + # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_206 --> -828($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -828($fp) + sub $a0, $a0, $a1 + sw $a0, -824($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_TRUE_450 + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_TRUE_450 + lw $t0, -824($fp) + beq $t0, 0, label_TRUE_450 + # GOTO label_FALSE_449 + j label_FALSE_449 + label_COMPARE_BY_VALUE_453: + # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_206 --> -828($fp) + lw $a0, -4($fp) + lw $a1, -828($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -824($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_TRUE_450 + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_TRUE_450 + lw $t0, -824($fp) + beq $t0, 0, label_TRUE_450 + # GOTO label_FALSE_449 + j label_FALSE_449 + label_COMPARE_STRING_452: + # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_206 --> -828($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -828($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -824($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_CONTINUE_454 + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_CONTINUE_454 + lw $t0, -824($fp) + beq $t0, 0, label_CONTINUE_454 + # GOTO label_FALSE_449 + j label_FALSE_449 + label_CONTINUE_454: + # LOCAL local_option_at_CellularAutomaton_internal_205 --> -824($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_206 --> -828($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -828($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_455: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_456 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_455 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_456: + # Store result + sw $a2, -824($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_TRUE_450 + # IF_ZERO local_option_at_CellularAutomaton_internal_205 GOTO label_TRUE_450 + lw $t0, -824($fp) + beq $t0, 0, label_TRUE_450 + label_FALSE_449: + # LOCAL local_option_at_CellularAutomaton_internal_204 --> -820($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -820($fp) + # GOTO label_END_451 +j label_END_451 +label_TRUE_450: + # LOCAL local_option_at_CellularAutomaton_internal_204 --> -820($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -820($fp) + label_END_451: +# LOCAL local_option_at_CellularAutomaton_internal_202 --> -812($fp) +# LOCAL local_option_at_CellularAutomaton_internal_204 --> -820($fp) +# Obtain value from -820($fp) +lw $v0, -820($fp) +lw $v0, 12($v0) +sw $v0, -812($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_202 GOTO label_FALSEIF_447 +# IF_ZERO local_option_at_CellularAutomaton_internal_202 GOTO label_FALSEIF_447 +lw $t0, -812($fp) +beq $t0, 0, label_FALSEIF_447 +# LOCAL local_option_at_CellularAutomaton_internal_207 --> -832($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_75 +sw $t0, 12($v0) +li $t0, 28 +sw $t0, 16($v0) +sw $v0, -832($fp) +# LOCAL local_option_at_CellularAutomaton_internal_203 --> -816($fp) +# LOCAL local_option_at_CellularAutomaton_internal_207 --> -832($fp) +# local_option_at_CellularAutomaton_internal_203 = local_option_at_CellularAutomaton_internal_207 +lw $t0, -832($fp) +sw $t0, -816($fp) +# GOTO label_ENDIF_448 +j label_ENDIF_448 +label_FALSEIF_447: + # LOCAL local_option_at_CellularAutomaton_internal_212 --> -852($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 19 + sw $t0, 12($v0) + sw $v0, -852($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_459 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_459 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_459 + # IF_ZERO local_option_at_CellularAutomaton_internal_212 GOTO label_FALSE_459 + # IF_ZERO local_option_at_CellularAutomaton_internal_212 GOTO label_FALSE_459 + lw $t0, -852($fp) + beq $t0, 0, label_FALSE_459 + # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -848($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_COMPARE_STRING_462 + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_COMPARE_STRING_462 + lw $t0, -848($fp) + beq $t0, 0, label_COMPARE_STRING_462 + # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -848($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_COMPARE_BY_VALUE_463 + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_COMPARE_BY_VALUE_463 + lw $t0, -848($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_463 + # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -848($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_COMPARE_BY_VALUE_463 + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_COMPARE_BY_VALUE_463 + lw $t0, -848($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_463 + # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_212 --> -852($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -852($fp) + sub $a0, $a0, $a1 + sw $a0, -848($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_TRUE_460 + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_TRUE_460 + lw $t0, -848($fp) + beq $t0, 0, label_TRUE_460 + # GOTO label_FALSE_459 + j label_FALSE_459 + label_COMPARE_BY_VALUE_463: + # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_212 --> -852($fp) + lw $a0, -4($fp) + lw $a1, -852($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -848($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_TRUE_460 + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_TRUE_460 + lw $t0, -848($fp) + beq $t0, 0, label_TRUE_460 + # GOTO label_FALSE_459 + j label_FALSE_459 + label_COMPARE_STRING_462: + # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_212 --> -852($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -852($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -848($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_CONTINUE_464 + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_CONTINUE_464 + lw $t0, -848($fp) + beq $t0, 0, label_CONTINUE_464 + # GOTO label_FALSE_459 + j label_FALSE_459 + label_CONTINUE_464: + # LOCAL local_option_at_CellularAutomaton_internal_211 --> -848($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_212 --> -852($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -852($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_465: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_466 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_465 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_466: + # Store result + sw $a2, -848($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_TRUE_460 + # IF_ZERO local_option_at_CellularAutomaton_internal_211 GOTO label_TRUE_460 + lw $t0, -848($fp) + beq $t0, 0, label_TRUE_460 + label_FALSE_459: + # LOCAL local_option_at_CellularAutomaton_internal_210 --> -844($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -844($fp) + # GOTO label_END_461 +j label_END_461 +label_TRUE_460: + # LOCAL local_option_at_CellularAutomaton_internal_210 --> -844($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -844($fp) + label_END_461: +# LOCAL local_option_at_CellularAutomaton_internal_208 --> -836($fp) +# LOCAL local_option_at_CellularAutomaton_internal_210 --> -844($fp) +# Obtain value from -844($fp) +lw $v0, -844($fp) +lw $v0, 12($v0) +sw $v0, -836($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_208 GOTO label_FALSEIF_457 +# IF_ZERO local_option_at_CellularAutomaton_internal_208 GOTO label_FALSEIF_457 +lw $t0, -836($fp) +beq $t0, 0, label_FALSEIF_457 +# LOCAL local_option_at_CellularAutomaton_internal_213 --> -856($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_76 +sw $t0, 12($v0) +li $t0, 16 +sw $t0, 16($v0) +sw $v0, -856($fp) +# LOCAL local_option_at_CellularAutomaton_internal_209 --> -840($fp) +# LOCAL local_option_at_CellularAutomaton_internal_213 --> -856($fp) +# local_option_at_CellularAutomaton_internal_209 = local_option_at_CellularAutomaton_internal_213 +lw $t0, -856($fp) +sw $t0, -840($fp) +# GOTO label_ENDIF_458 +j label_ENDIF_458 +label_FALSEIF_457: + # LOCAL local_option_at_CellularAutomaton_internal_218 --> -876($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 20 + sw $t0, 12($v0) + sw $v0, -876($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_469 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_469 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_469 + # IF_ZERO local_option_at_CellularAutomaton_internal_218 GOTO label_FALSE_469 + # IF_ZERO local_option_at_CellularAutomaton_internal_218 GOTO label_FALSE_469 + lw $t0, -876($fp) + beq $t0, 0, label_FALSE_469 + # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -872($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_COMPARE_STRING_472 + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_COMPARE_STRING_472 + lw $t0, -872($fp) + beq $t0, 0, label_COMPARE_STRING_472 + # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -872($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_COMPARE_BY_VALUE_473 + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_COMPARE_BY_VALUE_473 + lw $t0, -872($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_473 + # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -872($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_COMPARE_BY_VALUE_473 + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_COMPARE_BY_VALUE_473 + lw $t0, -872($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_473 + # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_218 --> -876($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -876($fp) + sub $a0, $a0, $a1 + sw $a0, -872($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_TRUE_470 + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_TRUE_470 + lw $t0, -872($fp) + beq $t0, 0, label_TRUE_470 + # GOTO label_FALSE_469 + j label_FALSE_469 + label_COMPARE_BY_VALUE_473: + # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_218 --> -876($fp) + lw $a0, -4($fp) + lw $a1, -876($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -872($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_TRUE_470 + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_TRUE_470 + lw $t0, -872($fp) + beq $t0, 0, label_TRUE_470 + # GOTO label_FALSE_469 + j label_FALSE_469 + label_COMPARE_STRING_472: + # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_218 --> -876($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -876($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -872($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_CONTINUE_474 + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_CONTINUE_474 + lw $t0, -872($fp) + beq $t0, 0, label_CONTINUE_474 + # GOTO label_FALSE_469 + j label_FALSE_469 + label_CONTINUE_474: + # LOCAL local_option_at_CellularAutomaton_internal_217 --> -872($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_218 --> -876($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -876($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_475: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_476 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_475 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_476: + # Store result + sw $a2, -872($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_TRUE_470 + # IF_ZERO local_option_at_CellularAutomaton_internal_217 GOTO label_TRUE_470 + lw $t0, -872($fp) + beq $t0, 0, label_TRUE_470 + label_FALSE_469: + # LOCAL local_option_at_CellularAutomaton_internal_216 --> -868($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -868($fp) + # GOTO label_END_471 +j label_END_471 +label_TRUE_470: + # LOCAL local_option_at_CellularAutomaton_internal_216 --> -868($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -868($fp) + label_END_471: +# LOCAL local_option_at_CellularAutomaton_internal_214 --> -860($fp) +# LOCAL local_option_at_CellularAutomaton_internal_216 --> -868($fp) +# Obtain value from -868($fp) +lw $v0, -868($fp) +lw $v0, 12($v0) +sw $v0, -860($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_214 GOTO label_FALSEIF_467 +# IF_ZERO local_option_at_CellularAutomaton_internal_214 GOTO label_FALSEIF_467 +lw $t0, -860($fp) +beq $t0, 0, label_FALSEIF_467 +# LOCAL local_option_at_CellularAutomaton_internal_219 --> -880($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_77 +sw $t0, 12($v0) +li $t0, 28 +sw $t0, 16($v0) +sw $v0, -880($fp) +# LOCAL local_option_at_CellularAutomaton_internal_215 --> -864($fp) +# LOCAL local_option_at_CellularAutomaton_internal_219 --> -880($fp) +# local_option_at_CellularAutomaton_internal_215 = local_option_at_CellularAutomaton_internal_219 +lw $t0, -880($fp) +sw $t0, -864($fp) +# GOTO label_ENDIF_468 +j label_ENDIF_468 +label_FALSEIF_467: + # LOCAL local_option_at_CellularAutomaton_internal_224 --> -900($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 21 + sw $t0, 12($v0) + sw $v0, -900($fp) + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_479 + # IF_ZERO local_option_at_CellularAutomaton_num_0 GOTO label_FALSE_479 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_479 + # IF_ZERO local_option_at_CellularAutomaton_internal_224 GOTO label_FALSE_479 + # IF_ZERO local_option_at_CellularAutomaton_internal_224 GOTO label_FALSE_479 + lw $t0, -900($fp) + beq $t0, 0, label_FALSE_479 + # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -896($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_COMPARE_STRING_482 + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_COMPARE_STRING_482 + lw $t0, -896($fp) + beq $t0, 0, label_COMPARE_STRING_482 + # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -896($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_COMPARE_BY_VALUE_483 + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_COMPARE_BY_VALUE_483 + lw $t0, -896($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_483 + # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -896($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_COMPARE_BY_VALUE_483 + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_COMPARE_BY_VALUE_483 + lw $t0, -896($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_483 + # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_224 --> -900($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -900($fp) + sub $a0, $a0, $a1 + sw $a0, -896($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_TRUE_480 + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_TRUE_480 + lw $t0, -896($fp) + beq $t0, 0, label_TRUE_480 + # GOTO label_FALSE_479 + j label_FALSE_479 + label_COMPARE_BY_VALUE_483: + # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_224 --> -900($fp) + lw $a0, -4($fp) + lw $a1, -900($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -896($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_TRUE_480 + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_TRUE_480 + lw $t0, -896($fp) + beq $t0, 0, label_TRUE_480 + # GOTO label_FALSE_479 + j label_FALSE_479 + label_COMPARE_STRING_482: + # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_224 --> -900($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -900($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -896($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_CONTINUE_484 + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_CONTINUE_484 + lw $t0, -896($fp) + beq $t0, 0, label_CONTINUE_484 + # GOTO label_FALSE_479 + j label_FALSE_479 + label_CONTINUE_484: + # LOCAL local_option_at_CellularAutomaton_internal_223 --> -896($fp) + # LOCAL local_option_at_CellularAutomaton_num_0 --> -4($fp) + # LOCAL local_option_at_CellularAutomaton_internal_224 --> -900($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -900($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_485: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_486 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_485 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_486: + # Store result + sw $a2, -896($fp) + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_TRUE_480 + # IF_ZERO local_option_at_CellularAutomaton_internal_223 GOTO label_TRUE_480 + lw $t0, -896($fp) + beq $t0, 0, label_TRUE_480 + label_FALSE_479: + # LOCAL local_option_at_CellularAutomaton_internal_222 --> -892($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -892($fp) + # GOTO label_END_481 +j label_END_481 +label_TRUE_480: + # LOCAL local_option_at_CellularAutomaton_internal_222 --> -892($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -892($fp) + label_END_481: +# LOCAL local_option_at_CellularAutomaton_internal_220 --> -884($fp) +# LOCAL local_option_at_CellularAutomaton_internal_222 --> -892($fp) +# Obtain value from -892($fp) +lw $v0, -892($fp) +lw $v0, 12($v0) +sw $v0, -884($fp) +# IF_ZERO local_option_at_CellularAutomaton_internal_220 GOTO label_FALSEIF_477 +# IF_ZERO local_option_at_CellularAutomaton_internal_220 GOTO label_FALSEIF_477 +lw $t0, -884($fp) +beq $t0, 0, label_FALSEIF_477 +# LOCAL local_option_at_CellularAutomaton_internal_225 --> -904($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_78 +sw $t0, 12($v0) +li $t0, 28 +sw $t0, 16($v0) +sw $v0, -904($fp) +# LOCAL local_option_at_CellularAutomaton_internal_221 --> -888($fp) +# LOCAL local_option_at_CellularAutomaton_internal_225 --> -904($fp) +# local_option_at_CellularAutomaton_internal_221 = local_option_at_CellularAutomaton_internal_225 +lw $t0, -904($fp) +sw $t0, -888($fp) +# GOTO label_ENDIF_478 +j label_ENDIF_478 +label_FALSEIF_477: + # LOCAL local_option_at_CellularAutomaton_internal_226 --> -908($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_79 + sw $t0, 12($v0) + li $t0, 25 + sw $t0, 16($v0) + sw $v0, -908($fp) + # LOCAL local_option_at_CellularAutomaton_internal_221 --> -888($fp) + # LOCAL local_option_at_CellularAutomaton_internal_226 --> -908($fp) + # local_option_at_CellularAutomaton_internal_221 = local_option_at_CellularAutomaton_internal_226 + lw $t0, -908($fp) + sw $t0, -888($fp) + label_ENDIF_478: +# LOCAL local_option_at_CellularAutomaton_internal_215 --> -864($fp) +# LOCAL local_option_at_CellularAutomaton_internal_221 --> -888($fp) +# local_option_at_CellularAutomaton_internal_215 = local_option_at_CellularAutomaton_internal_221 +lw $t0, -888($fp) +sw $t0, -864($fp) +label_ENDIF_468: +# LOCAL local_option_at_CellularAutomaton_internal_209 --> -840($fp) +# LOCAL local_option_at_CellularAutomaton_internal_215 --> -864($fp) +# local_option_at_CellularAutomaton_internal_209 = local_option_at_CellularAutomaton_internal_215 +lw $t0, -864($fp) +sw $t0, -840($fp) +label_ENDIF_458: +# LOCAL local_option_at_CellularAutomaton_internal_203 --> -816($fp) +# LOCAL local_option_at_CellularAutomaton_internal_209 --> -840($fp) +# local_option_at_CellularAutomaton_internal_203 = local_option_at_CellularAutomaton_internal_209 +lw $t0, -840($fp) +sw $t0, -816($fp) +label_ENDIF_448: +# LOCAL local_option_at_CellularAutomaton_internal_197 --> -792($fp) +# LOCAL local_option_at_CellularAutomaton_internal_203 --> -816($fp) +# local_option_at_CellularAutomaton_internal_197 = local_option_at_CellularAutomaton_internal_203 +lw $t0, -816($fp) +sw $t0, -792($fp) +label_ENDIF_438: +# LOCAL local_option_at_CellularAutomaton_internal_191 --> -768($fp) +# LOCAL local_option_at_CellularAutomaton_internal_197 --> -792($fp) +# local_option_at_CellularAutomaton_internal_191 = local_option_at_CellularAutomaton_internal_197 +lw $t0, -792($fp) +sw $t0, -768($fp) +label_ENDIF_428: +# LOCAL local_option_at_CellularAutomaton_internal_185 --> -744($fp) +# LOCAL local_option_at_CellularAutomaton_internal_191 --> -768($fp) +# local_option_at_CellularAutomaton_internal_185 = local_option_at_CellularAutomaton_internal_191 +lw $t0, -768($fp) +sw $t0, -744($fp) +label_ENDIF_418: +# LOCAL local_option_at_CellularAutomaton_internal_179 --> -720($fp) +# LOCAL local_option_at_CellularAutomaton_internal_185 --> -744($fp) +# local_option_at_CellularAutomaton_internal_179 = local_option_at_CellularAutomaton_internal_185 +lw $t0, -744($fp) +sw $t0, -720($fp) +label_ENDIF_408: +# LOCAL local_option_at_CellularAutomaton_internal_173 --> -696($fp) +# LOCAL local_option_at_CellularAutomaton_internal_179 --> -720($fp) +# local_option_at_CellularAutomaton_internal_173 = local_option_at_CellularAutomaton_internal_179 +lw $t0, -720($fp) +sw $t0, -696($fp) +label_ENDIF_398: +# LOCAL local_option_at_CellularAutomaton_internal_167 --> -672($fp) +# LOCAL local_option_at_CellularAutomaton_internal_173 --> -696($fp) +# local_option_at_CellularAutomaton_internal_167 = local_option_at_CellularAutomaton_internal_173 +lw $t0, -696($fp) +sw $t0, -672($fp) +label_ENDIF_388: +# LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) +# LOCAL local_option_at_CellularAutomaton_internal_167 --> -672($fp) +# local_option_at_CellularAutomaton_internal_161 = local_option_at_CellularAutomaton_internal_167 +lw $t0, -672($fp) +sw $t0, -648($fp) +label_ENDIF_378: +# LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) +# LOCAL local_option_at_CellularAutomaton_internal_161 --> -648($fp) +# local_option_at_CellularAutomaton_internal_155 = local_option_at_CellularAutomaton_internal_161 +lw $t0, -648($fp) +sw $t0, -624($fp) +label_ENDIF_368: +# LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) +# LOCAL local_option_at_CellularAutomaton_internal_155 --> -624($fp) +# local_option_at_CellularAutomaton_internal_149 = local_option_at_CellularAutomaton_internal_155 +lw $t0, -624($fp) +sw $t0, -600($fp) +label_ENDIF_358: +# LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) +# LOCAL local_option_at_CellularAutomaton_internal_149 --> -600($fp) +# local_option_at_CellularAutomaton_internal_143 = local_option_at_CellularAutomaton_internal_149 +lw $t0, -600($fp) +sw $t0, -576($fp) +label_ENDIF_348: +# LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) +# LOCAL local_option_at_CellularAutomaton_internal_143 --> -576($fp) +# local_option_at_CellularAutomaton_internal_137 = local_option_at_CellularAutomaton_internal_143 +lw $t0, -576($fp) +sw $t0, -552($fp) +label_ENDIF_338: +# LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) +# LOCAL local_option_at_CellularAutomaton_internal_137 --> -552($fp) +# local_option_at_CellularAutomaton_internal_131 = local_option_at_CellularAutomaton_internal_137 +lw $t0, -552($fp) +sw $t0, -528($fp) +label_ENDIF_328: +# LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) +# LOCAL local_option_at_CellularAutomaton_internal_131 --> -528($fp) +# local_option_at_CellularAutomaton_internal_125 = local_option_at_CellularAutomaton_internal_131 +lw $t0, -528($fp) +sw $t0, -504($fp) +label_ENDIF_318: +# LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) +# LOCAL local_option_at_CellularAutomaton_internal_125 --> -504($fp) +# local_option_at_CellularAutomaton_internal_119 = local_option_at_CellularAutomaton_internal_125 +lw $t0, -504($fp) +sw $t0, -480($fp) +label_ENDIF_308: +# LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) +# LOCAL local_option_at_CellularAutomaton_internal_119 --> -480($fp) +# local_option_at_CellularAutomaton_internal_113 = local_option_at_CellularAutomaton_internal_119 +lw $t0, -480($fp) +sw $t0, -456($fp) +label_ENDIF_298: +# LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) +# LOCAL local_option_at_CellularAutomaton_internal_113 --> -456($fp) +# local_option_at_CellularAutomaton_internal_107 = local_option_at_CellularAutomaton_internal_113 +lw $t0, -456($fp) +sw $t0, -432($fp) +label_ENDIF_288: +# LOCAL local_option_at_CellularAutomaton_internal_101 --> -408($fp) +# LOCAL local_option_at_CellularAutomaton_internal_107 --> -432($fp) +# local_option_at_CellularAutomaton_internal_101 = local_option_at_CellularAutomaton_internal_107 +lw $t0, -432($fp) +sw $t0, -408($fp) +label_ENDIF_278: +# RETURN local_option_at_CellularAutomaton_internal_101 +lw $v0, -408($fp) +# Deallocate stack frame for function function_option_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 916 +jr $ra +# Function END + + +# function_prompt_at_CellularAutomaton implementation. +# @Params: +function_prompt_at_CellularAutomaton: + # Allocate stack frame for function function_prompt_at_CellularAutomaton. + subu $sp, $sp, 100 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 100 + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_3 --> -16($fp) + # local_prompt_at_CellularAutomaton_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_3 --> -16($fp) + # local_prompt_at_CellularAutomaton_internal_1 = local_prompt_at_CellularAutomaton_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_80 + sw $t0, 12($v0) + li $t0, 54 + sw $t0, 16($v0) + sw $v0, -20($fp) + # ARG local_prompt_at_CellularAutomaton_internal_4 + # LOCAL local_prompt_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_2 --> -12($fp) + # local_prompt_at_CellularAutomaton_internal_2 = VCALL local_prompt_at_CellularAutomaton_internal_1 out_string + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt_at_CellularAutomaton_internal_7 --> -32($fp) + # local_prompt_at_CellularAutomaton_internal_7 = SELF + sw $s1, -32($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_7 --> -32($fp) + # local_prompt_at_CellularAutomaton_internal_5 = local_prompt_at_CellularAutomaton_internal_7 + lw $t0, -32($fp) + sw $t0, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_81 + sw $t0, 12($v0) + li $t0, 49 + sw $t0, 16($v0) + sw $v0, -36($fp) + # ARG local_prompt_at_CellularAutomaton_internal_8 + # LOCAL local_prompt_at_CellularAutomaton_internal_8 --> -36($fp) + lw $t0, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_6 --> -28($fp) + # local_prompt_at_CellularAutomaton_internal_6 = VCALL local_prompt_at_CellularAutomaton_internal_5 out_string + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt_at_CellularAutomaton_internal_11 --> -48($fp) + # local_prompt_at_CellularAutomaton_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_11 --> -48($fp) + # local_prompt_at_CellularAutomaton_internal_9 = local_prompt_at_CellularAutomaton_internal_11 + lw $t0, -48($fp) + sw $t0, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_10 --> -44($fp) + # local_prompt_at_CellularAutomaton_internal_10 = VCALL local_prompt_at_CellularAutomaton_internal_9 in_string + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 72($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_10 --> -44($fp) + # local_prompt_at_CellularAutomaton_ans_0 = local_prompt_at_CellularAutomaton_internal_10 + lw $t0, -44($fp) + sw $t0, -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_14 --> -60($fp) + # local_prompt_at_CellularAutomaton_internal_14 = SELF + sw $s1, -60($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_14 --> -60($fp) + # local_prompt_at_CellularAutomaton_internal_12 = local_prompt_at_CellularAutomaton_internal_14 + lw $t0, -60($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_82 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -64($fp) + # ARG local_prompt_at_CellularAutomaton_internal_15 + # LOCAL local_prompt_at_CellularAutomaton_internal_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_prompt_at_CellularAutomaton_internal_12 --> -52($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_13 --> -56($fp) + # local_prompt_at_CellularAutomaton_internal_13 = VCALL local_prompt_at_CellularAutomaton_internal_12 out_string + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_83 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -84($fp) + # IF_ZERO local_prompt_at_CellularAutomaton_ans_0 GOTO label_FALSE_489 + # IF_ZERO local_prompt_at_CellularAutomaton_ans_0 GOTO label_FALSE_489 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_489 + # IF_ZERO local_prompt_at_CellularAutomaton_internal_20 GOTO label_FALSE_489 + # IF_ZERO local_prompt_at_CellularAutomaton_internal_20 GOTO label_FALSE_489 + lw $t0, -84($fp) + beq $t0, 0, label_FALSE_489 + # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_COMPARE_STRING_492 + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_COMPARE_STRING_492 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_STRING_492 + # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_493 + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_493 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_493 + # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_493 + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_493 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_493 + # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -84($fp) + sub $a0, $a0, $a1 + sw $a0, -80($fp) + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_TRUE_490 + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_TRUE_490 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_490 + # GOTO label_FALSE_489 + j label_FALSE_489 + label_COMPARE_BY_VALUE_493: + # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) + lw $a0, -4($fp) + lw $a1, -84($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -80($fp) + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_TRUE_490 + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_TRUE_490 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_490 + # GOTO label_FALSE_489 + j label_FALSE_489 + label_COMPARE_STRING_492: + # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -84($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -80($fp) + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_CONTINUE_494 + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_CONTINUE_494 + lw $t0, -80($fp) + beq $t0, 0, label_CONTINUE_494 + # GOTO label_FALSE_489 + j label_FALSE_489 + label_CONTINUE_494: + # LOCAL local_prompt_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_20 --> -84($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -84($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_495: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_496 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_495 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_496: + # Store result + sw $a2, -80($fp) + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_TRUE_490 + # IF_ZERO local_prompt_at_CellularAutomaton_internal_19 GOTO label_TRUE_490 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_490 + label_FALSE_489: + # LOCAL local_prompt_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -76($fp) + # GOTO label_END_491 +j label_END_491 +label_TRUE_490: + # LOCAL local_prompt_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -76($fp) + label_END_491: +# LOCAL local_prompt_at_CellularAutomaton_internal_16 --> -68($fp) +# LOCAL local_prompt_at_CellularAutomaton_internal_18 --> -76($fp) +# Obtain value from -76($fp) +lw $v0, -76($fp) +lw $v0, 12($v0) +sw $v0, -68($fp) +# IF_ZERO local_prompt_at_CellularAutomaton_internal_16 GOTO label_FALSEIF_487 +# IF_ZERO local_prompt_at_CellularAutomaton_internal_16 GOTO label_FALSEIF_487 +lw $t0, -68($fp) +beq $t0, 0, label_FALSEIF_487 +# LOCAL local_prompt_at_CellularAutomaton_internal_21 --> -88($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -88($fp) +# LOCAL local_prompt_at_CellularAutomaton_internal_17 --> -72($fp) +# LOCAL local_prompt_at_CellularAutomaton_internal_21 --> -88($fp) +# local_prompt_at_CellularAutomaton_internal_17 = local_prompt_at_CellularAutomaton_internal_21 +lw $t0, -88($fp) +sw $t0, -72($fp) +# GOTO label_ENDIF_488 +j label_ENDIF_488 +label_FALSEIF_487: + # LOCAL local_prompt_at_CellularAutomaton_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -92($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_17 --> -72($fp) + # LOCAL local_prompt_at_CellularAutomaton_internal_22 --> -92($fp) + # local_prompt_at_CellularAutomaton_internal_17 = local_prompt_at_CellularAutomaton_internal_22 + lw $t0, -92($fp) + sw $t0, -72($fp) + label_ENDIF_488: +# RETURN local_prompt_at_CellularAutomaton_internal_17 +lw $v0, -72($fp) +# Deallocate stack frame for function function_prompt_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 100 +jr $ra +# Function END + + +# function_prompt2_at_CellularAutomaton implementation. +# @Params: +function_prompt2_at_CellularAutomaton: + # Allocate stack frame for function function_prompt2_at_CellularAutomaton. + subu $sp, $sp, 100 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 100 + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_3 --> -16($fp) + # local_prompt2_at_CellularAutomaton_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_3 --> -16($fp) + # local_prompt2_at_CellularAutomaton_internal_1 = local_prompt2_at_CellularAutomaton_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_84 + sw $t0, 12($v0) + li $t0, 2 + sw $t0, 16($v0) + sw $v0, -20($fp) + # ARG local_prompt2_at_CellularAutomaton_internal_4 + # LOCAL local_prompt2_at_CellularAutomaton_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_1 --> -8($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_2 --> -12($fp) + # local_prompt2_at_CellularAutomaton_internal_2 = VCALL local_prompt2_at_CellularAutomaton_internal_1 out_string + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt2_at_CellularAutomaton_internal_7 --> -32($fp) + # local_prompt2_at_CellularAutomaton_internal_7 = SELF + sw $s1, -32($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_7 --> -32($fp) + # local_prompt2_at_CellularAutomaton_internal_5 = local_prompt2_at_CellularAutomaton_internal_7 + lw $t0, -32($fp) + sw $t0, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_85 + sw $t0, 12($v0) + li $t0, 48 + sw $t0, 16($v0) + sw $v0, -36($fp) + # ARG local_prompt2_at_CellularAutomaton_internal_8 + # LOCAL local_prompt2_at_CellularAutomaton_internal_8 --> -36($fp) + lw $t0, -36($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_5 --> -24($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_6 --> -28($fp) + # local_prompt2_at_CellularAutomaton_internal_6 = VCALL local_prompt2_at_CellularAutomaton_internal_5 out_string + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt2_at_CellularAutomaton_internal_11 --> -48($fp) + # local_prompt2_at_CellularAutomaton_internal_11 = SELF + sw $s1, -48($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_11 --> -48($fp) + # local_prompt2_at_CellularAutomaton_internal_9 = local_prompt2_at_CellularAutomaton_internal_11 + lw $t0, -48($fp) + sw $t0, -40($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_86 + sw $t0, 12($v0) + li $t0, 49 + sw $t0, 16($v0) + sw $v0, -52($fp) + # ARG local_prompt2_at_CellularAutomaton_internal_12 + # LOCAL local_prompt2_at_CellularAutomaton_internal_12 --> -52($fp) + lw $t0, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_9 --> -40($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_10 --> -44($fp) + # local_prompt2_at_CellularAutomaton_internal_10 = VCALL local_prompt2_at_CellularAutomaton_internal_9 out_string + # Save new self pointer in $s1 + lw $s1, -40($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -44($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt2_at_CellularAutomaton_internal_15 --> -64($fp) + # local_prompt2_at_CellularAutomaton_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_15 --> -64($fp) + # local_prompt2_at_CellularAutomaton_internal_13 = local_prompt2_at_CellularAutomaton_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_13 --> -56($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_14 --> -60($fp) + # local_prompt2_at_CellularAutomaton_internal_14 = VCALL local_prompt2_at_CellularAutomaton_internal_13 in_string + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 72($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_14 --> -60($fp) + # local_prompt2_at_CellularAutomaton_ans_0 = local_prompt2_at_CellularAutomaton_internal_14 + lw $t0, -60($fp) + sw $t0, -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_87 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -84($fp) + # IF_ZERO local_prompt2_at_CellularAutomaton_ans_0 GOTO label_FALSE_499 + # IF_ZERO local_prompt2_at_CellularAutomaton_ans_0 GOTO label_FALSE_499 + lw $t0, -4($fp) + beq $t0, 0, label_FALSE_499 + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_20 GOTO label_FALSE_499 + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_20 GOTO label_FALSE_499 + lw $t0, -84($fp) + beq $t0, 0, label_FALSE_499 + # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # Comparing -4($fp) type with String + la $v0, String + lw $a0, -4($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_COMPARE_STRING_502 + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_COMPARE_STRING_502 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_STRING_502 + # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # Comparing -4($fp) type with Bool + la $v0, Bool + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_503 + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_503 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_503 + # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # Comparing -4($fp) type with Int + la $v0, Int + lw $a0, -4($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_503 + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_COMPARE_BY_VALUE_503 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_503 + # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) + # Load pointers and SUB + lw $a0, -4($fp) + lw $a1, -84($fp) + sub $a0, $a0, $a1 + sw $a0, -80($fp) + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_TRUE_500 + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_TRUE_500 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_500 + # GOTO label_FALSE_499 + j label_FALSE_499 + label_COMPARE_BY_VALUE_503: + # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) + lw $a0, -4($fp) + lw $a1, -84($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -80($fp) + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_TRUE_500 + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_TRUE_500 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_500 + # GOTO label_FALSE_499 + j label_FALSE_499 + label_COMPARE_STRING_502: + # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -84($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -80($fp) + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_CONTINUE_504 + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_CONTINUE_504 + lw $t0, -80($fp) + beq $t0, 0, label_CONTINUE_504 + # GOTO label_FALSE_499 + j label_FALSE_499 + label_CONTINUE_504: + # LOCAL local_prompt2_at_CellularAutomaton_internal_19 --> -80($fp) + # LOCAL local_prompt2_at_CellularAutomaton_ans_0 --> -4($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_20 --> -84($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -4($fp) + lw $v1, -84($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_505: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_506 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_505 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_506: + # Store result + sw $a2, -80($fp) + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_TRUE_500 + # IF_ZERO local_prompt2_at_CellularAutomaton_internal_19 GOTO label_TRUE_500 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_500 + label_FALSE_499: + # LOCAL local_prompt2_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -76($fp) + # GOTO label_END_501 +j label_END_501 +label_TRUE_500: + # LOCAL local_prompt2_at_CellularAutomaton_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -76($fp) + label_END_501: +# LOCAL local_prompt2_at_CellularAutomaton_internal_16 --> -68($fp) +# LOCAL local_prompt2_at_CellularAutomaton_internal_18 --> -76($fp) +# Obtain value from -76($fp) +lw $v0, -76($fp) +lw $v0, 12($v0) +sw $v0, -68($fp) +# IF_ZERO local_prompt2_at_CellularAutomaton_internal_16 GOTO label_FALSEIF_497 +# IF_ZERO local_prompt2_at_CellularAutomaton_internal_16 GOTO label_FALSEIF_497 +lw $t0, -68($fp) +beq $t0, 0, label_FALSEIF_497 +# LOCAL local_prompt2_at_CellularAutomaton_internal_21 --> -88($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -88($fp) +# LOCAL local_prompt2_at_CellularAutomaton_internal_17 --> -72($fp) +# LOCAL local_prompt2_at_CellularAutomaton_internal_21 --> -88($fp) +# local_prompt2_at_CellularAutomaton_internal_17 = local_prompt2_at_CellularAutomaton_internal_21 +lw $t0, -88($fp) +sw $t0, -72($fp) +# GOTO label_ENDIF_498 +j label_ENDIF_498 +label_FALSEIF_497: + # LOCAL local_prompt2_at_CellularAutomaton_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -92($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_17 --> -72($fp) + # LOCAL local_prompt2_at_CellularAutomaton_internal_22 --> -92($fp) + # local_prompt2_at_CellularAutomaton_internal_17 = local_prompt2_at_CellularAutomaton_internal_22 + lw $t0, -92($fp) + sw $t0, -72($fp) + label_ENDIF_498: +# RETURN local_prompt2_at_CellularAutomaton_internal_17 +lw $v0, -72($fp) +# Deallocate stack frame for function function_prompt2_at_CellularAutomaton. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 100 +jr $ra +# Function END + + +# __Main__attrib__cells__init implementation. +# @Params: +__Main__attrib__cells__init: + # Allocate stack frame for function __Main__attrib__cells__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__cells__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 160 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 160 + # LOCAL local_main_at_Main_continue_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # LOCAL local_main_at_Main_choice_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_0 + sw $t0, 12($v0) + li $t0, 0 + sw $t0, 16($v0) + sw $v0, -8($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_88 + sw $t0, 12($v0) + li $t0, 29 + sw $t0, 16($v0) + sw $v0, -24($fp) + # ARG local_main_at_Main_internal_5 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 + lw $t0, -36($fp) + sw $t0, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_89 + sw $t0, 12($v0) + li $t0, 47 + sw $t0, 16($v0) + sw $v0, -40($fp) + # ARG local_main_at_Main_internal_9 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + lw $t0, -40($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_string + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 96($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_WHILE_507: + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = SELF + sw $s1, -56($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_11 = local_main_at_Main_internal_13 + lw $t0, -56($fp) + sw $t0, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = VCALL local_main_at_Main_internal_11 prompt2 + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 36($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # Obtain value from -52($fp) + lw $v0, -52($fp) + lw $v0, 12($v0) + sw $v0, -44($fp) + # IF_ZERO local_main_at_Main_internal_10 GOTO label_WHILE_END_508 + # IF_ZERO local_main_at_Main_internal_10 GOTO label_WHILE_END_508 + lw $t0, -44($fp) + beq $t0, 0, label_WHILE_END_508 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + # LOCAL local_main_at_Main_continue_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_continue_0 = local_main_at_Main_internal_14 + lw $t0, -60($fp) + sw $t0, -4($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = SELF + sw $s1, -72($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_15 = local_main_at_Main_internal_17 + lw $t0, -72($fp) + sw $t0, -64($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = VCALL local_main_at_Main_internal_15 option + # Save new self pointer in $s1 + lw $s1, -64($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -68($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_choice_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_choice_1 = local_main_at_Main_internal_16 + lw $t0, -68($fp) + sw $t0, -8($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_20 = ALLOCATE CellularAutomaton + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, CellularAutomaton + sw $t0, 12($v0) + li $t0, 17 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 28 bytes of memory + li $a0, 28 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, CellularAutomaton_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Board__attrib__rows__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Board__attrib__columns__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Board__attrib__board_size__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __CellularAutomaton__attrib__population_map__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -84($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 + lw $t0, -84($fp) + sw $t0, -76($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG local_main_at_Main_choice_1 + # LOCAL local_main_at_Main_choice_1 --> -8($fp) + lw $t0, -8($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 init + # Save new self pointer in $s1 + lw $s1, -76($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 120($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -80($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + lw $t0, -80($fp) + sw $t0, 28($s1) + # local_main_at_Main_internal_23 = GETATTRIBUTE cells Main + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + lw $t0, 28($s1) + sw $t0, -96($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # local_main_at_Main_internal_21 = local_main_at_Main_internal_23 + lw $t0, -96($fp) + sw $t0, -88($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # local_main_at_Main_internal_22 = VCALL local_main_at_Main_internal_21 print + # Save new self pointer in $s1 + lw $s1, -88($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 80($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -92($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + label_WHILE_509: + # LOCAL local_main_at_Main_internal_24 --> -100($fp) + # LOCAL local_main_at_Main_continue_0 --> -4($fp) + # Obtain value from -4($fp) + lw $v0, -4($fp) + lw $v0, 12($v0) + sw $v0, -100($fp) + # IF_ZERO local_main_at_Main_internal_24 GOTO label_WHILE_END_510 + # IF_ZERO local_main_at_Main_internal_24 GOTO label_WHILE_END_510 + lw $t0, -100($fp) + beq $t0, 0, label_WHILE_END_510 + # LOCAL local_main_at_Main_internal_29 --> -120($fp) + # local_main_at_Main_internal_29 = SELF + sw $s1, -120($fp) + # LOCAL local_main_at_Main_internal_27 --> -112($fp) + # LOCAL local_main_at_Main_internal_29 --> -120($fp) + # local_main_at_Main_internal_27 = local_main_at_Main_internal_29 + lw $t0, -120($fp) + sw $t0, -112($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_27 --> -112($fp) + # LOCAL local_main_at_Main_internal_28 --> -116($fp) + # local_main_at_Main_internal_28 = VCALL local_main_at_Main_internal_27 prompt + # Save new self pointer in $s1 + lw $s1, -112($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 100($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -116($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_25 --> -104($fp) + # LOCAL local_main_at_Main_internal_28 --> -116($fp) + # Obtain value from -116($fp) + lw $v0, -116($fp) + lw $v0, 12($v0) + sw $v0, -104($fp) + # IF_ZERO local_main_at_Main_internal_25 GOTO label_FALSEIF_511 + # IF_ZERO local_main_at_Main_internal_25 GOTO label_FALSEIF_511 + lw $t0, -104($fp) + beq $t0, 0, label_FALSEIF_511 + # local_main_at_Main_internal_32 = GETATTRIBUTE cells Main + # LOCAL local_main_at_Main_internal_32 --> -132($fp) + lw $t0, 28($s1) + sw $t0, -132($fp) + # LOCAL local_main_at_Main_internal_30 --> -124($fp) + # LOCAL local_main_at_Main_internal_32 --> -132($fp) + # local_main_at_Main_internal_30 = local_main_at_Main_internal_32 + lw $t0, -132($fp) + sw $t0, -124($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_30 --> -124($fp) + # LOCAL local_main_at_Main_internal_31 --> -128($fp) + # local_main_at_Main_internal_31 = VCALL local_main_at_Main_internal_30 evolve + # Save new self pointer in $s1 + lw $s1, -124($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -128($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_main_at_Main_internal_35 = GETATTRIBUTE cells Main + # LOCAL local_main_at_Main_internal_35 --> -144($fp) + lw $t0, 28($s1) + sw $t0, -144($fp) + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # LOCAL local_main_at_Main_internal_35 --> -144($fp) + # local_main_at_Main_internal_33 = local_main_at_Main_internal_35 + lw $t0, -144($fp) + sw $t0, -136($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_33 --> -136($fp) + # LOCAL local_main_at_Main_internal_34 --> -140($fp) + # local_main_at_Main_internal_34 = VCALL local_main_at_Main_internal_33 print + # Save new self pointer in $s1 + lw $s1, -136($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 80($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -140($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_26 --> -108($fp) + # LOCAL local_main_at_Main_internal_34 --> -140($fp) + # local_main_at_Main_internal_26 = local_main_at_Main_internal_34 + lw $t0, -140($fp) + sw $t0, -108($fp) + # GOTO label_ENDIF_512 +j label_ENDIF_512 +label_FALSEIF_511: + # LOCAL local_main_at_Main_internal_36 --> -148($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -148($fp) + # LOCAL local_main_at_Main_continue_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_36 --> -148($fp) + # local_main_at_Main_continue_0 = local_main_at_Main_internal_36 + lw $t0, -148($fp) + sw $t0, -4($fp) + # LOCAL local_main_at_Main_internal_26 --> -108($fp) + # local_main_at_Main_internal_26 = + label_ENDIF_512: +# GOTO label_WHILE_509 +j label_WHILE_509 +label_WHILE_END_510: + # GOTO label_WHILE_507 + j label_WHILE_507 + label_WHILE_END_508: + # LOCAL local_main_at_Main_internal_37 --> -152($fp) + # local_main_at_Main_internal_37 = SELF + sw $s1, -152($fp) + # RETURN local_main_at_Main_internal_37 + lw $v0, -152($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 160 + jr $ra + # Function END + diff --git a/tests/codegen/list.mips b/tests/codegen/list.mips new file mode 100644 index 00000000..3202f6bb --- /dev/null +++ b/tests/codegen/list.mips @@ -0,0 +1,2112 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:06 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +List: .asciiz "List" +# Function END +Cons: .asciiz "Cons" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_in_string_at_IO, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_out_string_at_IO, function_copy_at_Object, dummy, dummy, function_in_int_at_IO, function_out_int_at_IO, dummy, dummy +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word dummy, function_abort_at_Object, dummy, dummy, function_substr_at_String, function_type_name_at_Object, function_concat_at_String, dummy, dummy, dummy, function_copy_at_Object, function_length_at_String, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type List **** +List_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_cons_at_List, dummy, function_copy_at_Object, dummy, function_head_at_List, dummy, dummy, function_tail_at_List, function_isNil_at_List +# Function END +# + + +# **** Type RECORD for type List **** +List_start: + List_vtable_pointer: .word List_vtable + # Function END +List_end: +# + + +# **** VTABLE for type Cons **** +Cons_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_init_at_Cons, function_cons_at_List, dummy, function_copy_at_Object, dummy, function_head_at_Cons, dummy, dummy, function_tail_at_Cons, function_isNil_at_Cons +# Function END +# + + +# **** Type RECORD for type Cons **** +Cons_start: + Cons_vtable_pointer: .word Cons_vtable + # Function END +Cons_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_in_string_at_IO, function_abort_at_Object, function_main_at_Main, function_print_list_at_Main, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_out_string_at_IO, function_copy_at_Object, dummy, dummy, function_in_int_at_IO, function_out_int_at_IO, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 1, 2, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1 +List__TDT: .word -1, -1, -1, -1, -1, 0, 1, -1 +Cons__TDT: .word -1, -1, -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "\n" +# + + +data_5: .asciiz " " +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + lb $t3, 0($t1) + beqz $t3, end_loop + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + end_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 28 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__mylist__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 8($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_List implementation. +# @Params: +function_isNil_at_List: + # Allocate stack frame for function function_isNil_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_List_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_isNil_at_List_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_head_at_List implementation. +# @Params: +function_head_at_List: + # Allocate stack frame for function function_head_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_head_at_List_internal_2 --> -12($fp) + # local_head_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_head_at_List_internal_0 --> -4($fp) + # LOCAL local_head_at_List_internal_2 --> -12($fp) + # local_head_at_List_internal_0 = local_head_at_List_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_head_at_List_internal_0 --> -4($fp) + # LOCAL local_head_at_List_internal_1 --> -8($fp) + # local_head_at_List_internal_1 = VCALL local_head_at_List_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_head_at_List_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -16($fp) + # RETURN local_head_at_List_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_head_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_tail_at_List implementation. +# @Params: +function_tail_at_List: + # Allocate stack frame for function function_tail_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_tail_at_List_internal_2 --> -12($fp) + # local_tail_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_tail_at_List_internal_0 --> -4($fp) + # LOCAL local_tail_at_List_internal_2 --> -12($fp) + # local_tail_at_List_internal_0 = local_tail_at_List_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_tail_at_List_internal_0 --> -4($fp) + # LOCAL local_tail_at_List_internal_1 --> -8($fp) + # local_tail_at_List_internal_1 = VCALL local_tail_at_List_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_tail_at_List_internal_3 --> -16($fp) + # local_tail_at_List_internal_3 = SELF + sw $s1, -16($fp) + # RETURN local_tail_at_List_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_tail_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cons_at_List implementation. +# @Params: +# 0($fp) = param_cons_at_List_i_0 +function_cons_at_List: + # Allocate stack frame for function function_cons_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cons_at_List_internal_2 --> -12($fp) + # local_cons_at_List_internal_2 = ALLOCATE Cons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Cons + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Cons_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Cons__attrib__car__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Cons__attrib__cdr__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -12($fp) + # LOCAL local_cons_at_List_internal_0 --> -4($fp) + # LOCAL local_cons_at_List_internal_2 --> -12($fp) + # local_cons_at_List_internal_0 = local_cons_at_List_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cons_at_List_i_0 + # PARAM param_cons_at_List_i_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cons_at_List_internal_3 --> -16($fp) + # local_cons_at_List_internal_3 = SELF + sw $s1, -16($fp) + # ARG local_cons_at_List_internal_3 + # LOCAL local_cons_at_List_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cons_at_List_internal_0 --> -4($fp) + # LOCAL local_cons_at_List_internal_1 --> -8($fp) + # local_cons_at_List_internal_1 = VCALL local_cons_at_List_internal_0 init + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_cons_at_List_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_cons_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# __Cons__attrib__car__init implementation. +# @Params: +__Cons__attrib__car__init: + # Allocate stack frame for function __Cons__attrib__car__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__car__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__car__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Cons__attrib__car__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Cons__attrib__cdr__init implementation. +# @Params: +__Cons__attrib__cdr__init: + # Allocate stack frame for function __Cons__attrib__cdr__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Cons__attrib__cdr__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_Cons implementation. +# @Params: +function_isNil_at_Cons: + # Allocate stack frame for function function_isNil_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_Cons_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_isNil_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_head_at_Cons implementation. +# @Params: +function_head_at_Cons: + # Allocate stack frame for function function_head_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_head_at_Cons_internal_0 = GETATTRIBUTE car Cons + # LOCAL local_head_at_Cons_internal_0 --> -4($fp) + lw $t0, 12($s1) + sw $t0, -4($fp) + # RETURN local_head_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_head_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_tail_at_Cons implementation. +# @Params: +function_tail_at_Cons: + # Allocate stack frame for function function_tail_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_tail_at_Cons_internal_0 = GETATTRIBUTE cdr Cons + # LOCAL local_tail_at_Cons_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_tail_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_tail_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Cons implementation. +# @Params: +# 0($fp) = param_init_at_Cons_i_0 +# 4($fp) = param_init_at_Cons_rest_1 +function_init_at_Cons: + # Allocate stack frame for function function_init_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_Cons_i_0 --> 4($fp) + lw $t0, 4($fp) + sw $t0, 12($s1) + # + # PARAM param_init_at_Cons_rest_1 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 16($s1) + # LOCAL local_init_at_Cons_internal_0 --> -4($fp) + # local_init_at_Cons_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# __Main__attrib__mylist__init implementation. +# @Params: +__Main__attrib__mylist__init: + # Allocate stack frame for function __Main__attrib__mylist__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__mylist__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_print_list_at_Main implementation. +# @Params: +# 0($fp) = param_print_list_at_Main_l_0 +function_print_list_at_Main: + # Allocate stack frame for function function_print_list_at_Main. + subu $sp, $sp, 96 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 96 + # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) + # PARAM param_print_list_at_Main_l_0 --> 0($fp) + # local_print_list_at_Main_internal_2 = PARAM param_print_list_at_Main_l_0 + lw $t0, 0($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_2 --> -12($fp) + # LOCAL local_print_list_at_Main_internal_3 --> -16($fp) + # local_print_list_at_Main_internal_3 = VCALL local_print_list_at_Main_internal_2 isNil + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 64($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Main_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Main_internal_3 --> -16($fp) + # Obtain value from -16($fp) + lw $v0, -16($fp) + lw $v0, 12($v0) + sw $v0, -4($fp) + # IF_ZERO local_print_list_at_Main_internal_0 GOTO label_FALSEIF_1 + # IF_ZERO local_print_list_at_Main_internal_0 GOTO label_FALSEIF_1 + lw $t0, -4($fp) + beq $t0, 0, label_FALSEIF_1 + # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) + # local_print_list_at_Main_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) + # LOCAL local_print_list_at_Main_internal_6 --> -28($fp) + # local_print_list_at_Main_internal_4 = local_print_list_at_Main_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -32($fp) + # ARG local_print_list_at_Main_internal_7 + # LOCAL local_print_list_at_Main_internal_7 --> -32($fp) + lw $t0, -32($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_list_at_Main_internal_4 --> -20($fp) + # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) + # local_print_list_at_Main_internal_5 = VCALL local_print_list_at_Main_internal_4 out_string + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 36($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Main_internal_1 --> -8($fp) + # LOCAL local_print_list_at_Main_internal_5 --> -24($fp) + # local_print_list_at_Main_internal_1 = local_print_list_at_Main_internal_5 + lw $t0, -24($fp) + sw $t0, -8($fp) + # GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) + # local_print_list_at_Main_internal_10 = SELF + sw $s1, -44($fp) + # LOCAL local_print_list_at_Main_internal_8 --> -36($fp) + # LOCAL local_print_list_at_Main_internal_10 --> -44($fp) + # local_print_list_at_Main_internal_8 = local_print_list_at_Main_internal_10 + lw $t0, -44($fp) + sw $t0, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) + # PARAM param_print_list_at_Main_l_0 --> 0($fp) + # local_print_list_at_Main_internal_11 = PARAM param_print_list_at_Main_l_0 + lw $t0, 0($fp) + sw $t0, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_11 --> -48($fp) + # LOCAL local_print_list_at_Main_internal_12 --> -52($fp) + # local_print_list_at_Main_internal_12 = VCALL local_print_list_at_Main_internal_11 head + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 48($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_print_list_at_Main_internal_12 + # LOCAL local_print_list_at_Main_internal_12 --> -52($fp) + lw $t0, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_list_at_Main_internal_8 --> -36($fp) + # LOCAL local_print_list_at_Main_internal_9 --> -40($fp) + # local_print_list_at_Main_internal_9 = VCALL local_print_list_at_Main_internal_8 out_int + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 56($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) + # local_print_list_at_Main_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_print_list_at_Main_internal_13 --> -56($fp) + # LOCAL local_print_list_at_Main_internal_15 --> -64($fp) + # local_print_list_at_Main_internal_13 = local_print_list_at_Main_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -68($fp) + # ARG local_print_list_at_Main_internal_16 + # LOCAL local_print_list_at_Main_internal_16 --> -68($fp) + lw $t0, -68($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_list_at_Main_internal_13 --> -56($fp) + # LOCAL local_print_list_at_Main_internal_14 --> -60($fp) + # local_print_list_at_Main_internal_14 = VCALL local_print_list_at_Main_internal_13 out_string + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 36($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) + # local_print_list_at_Main_internal_19 = SELF + sw $s1, -80($fp) + # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) + # LOCAL local_print_list_at_Main_internal_19 --> -80($fp) + # local_print_list_at_Main_internal_17 = local_print_list_at_Main_internal_19 + lw $t0, -80($fp) + sw $t0, -72($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_20 --> -84($fp) + # PARAM param_print_list_at_Main_l_0 --> 0($fp) + # local_print_list_at_Main_internal_20 = PARAM param_print_list_at_Main_l_0 + lw $t0, 0($fp) + sw $t0, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Main_internal_20 --> -84($fp) + # LOCAL local_print_list_at_Main_internal_21 --> -88($fp) + # local_print_list_at_Main_internal_21 = VCALL local_print_list_at_Main_internal_20 tail + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 60($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_print_list_at_Main_internal_21 + # LOCAL local_print_list_at_Main_internal_21 --> -88($fp) + lw $t0, -88($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_list_at_Main_internal_17 --> -72($fp) + # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) + # local_print_list_at_Main_internal_18 = VCALL local_print_list_at_Main_internal_17 print_list + # Save new self pointer in $s1 + lw $s1, -72($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -76($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Main_internal_1 --> -8($fp) + # LOCAL local_print_list_at_Main_internal_18 --> -76($fp) + # local_print_list_at_Main_internal_1 = local_print_list_at_Main_internal_18 + lw $t0, -76($fp) + sw $t0, -8($fp) + label_ENDIF_2: +# RETURN local_print_list_at_Main_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_print_list_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 96 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 120 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 120 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = ALLOCATE List + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, List + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, List_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -44($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_8 = local_main_at_Main_internal_10 + lw $t0, -44($fp) + sw $t0, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -48($fp) + # ARG local_main_at_Main_internal_11 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + lw $t0, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 cons + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_9 + lw $t0, -40($fp) + sw $t0, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 2 + sw $t0, 12($v0) + sw $v0, -52($fp) + # ARG local_main_at_Main_internal_12 + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + lw $t0, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 cons + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_7 + lw $t0, -32($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 3 + sw $t0, 12($v0) + sw $v0, -56($fp) + # ARG local_main_at_Main_internal_13 + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + lw $t0, -56($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 cons + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_2 = local_main_at_Main_internal_5 + lw $t0, -24($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 4 + sw $t0, 12($v0) + sw $v0, -60($fp) + # ARG local_main_at_Main_internal_14 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + lw $t0, -60($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 cons + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 + lw $t0, -16($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 5 + sw $t0, 12($v0) + sw $v0, -64($fp) + # ARG local_main_at_Main_internal_15 + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + lw $t0, -64($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 cons + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + lw $t0, -8($fp) + sw $t0, 12($s1) + label_WHILE_3: + # local_main_at_Main_internal_19 = GETATTRIBUTE mylist Main + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + lw $t0, 12($s1) + sw $t0, -80($fp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_17 = local_main_at_Main_internal_19 + lw $t0, -80($fp) + sw $t0, -72($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # local_main_at_Main_internal_18 = VCALL local_main_at_Main_internal_17 isNil + # Save new self pointer in $s1 + lw $s1, -72($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 64($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -76($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # Obtain value from -76($fp) + lw $v0, -76($fp) + lw $v0, 12($v0) + sw $v0, -76($fp) + # IF_ZERO local_main_at_Main_internal_18 GOTO label_FALSE_5 + # IF_ZERO local_main_at_Main_internal_18 GOTO label_FALSE_5 + lw $t0, -76($fp) + beq $t0, 0, label_FALSE_5 + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -84($fp) + # GOTO label_NOT_END_6 + j label_NOT_END_6 + label_FALSE_5: + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -84($fp) + label_NOT_END_6: + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # Obtain value from -84($fp) + lw $v0, -84($fp) + lw $v0, 12($v0) + sw $v0, -68($fp) + # IF_ZERO local_main_at_Main_internal_16 GOTO label_WHILE_END_4 + # IF_ZERO local_main_at_Main_internal_16 GOTO label_WHILE_END_4 + lw $t0, -68($fp) + beq $t0, 0, label_WHILE_END_4 + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # local_main_at_Main_internal_23 = SELF + sw $s1, -96($fp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # local_main_at_Main_internal_21 = local_main_at_Main_internal_23 + lw $t0, -96($fp) + sw $t0, -88($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_main_at_Main_internal_24 = GETATTRIBUTE mylist Main + # LOCAL local_main_at_Main_internal_24 --> -100($fp) + lw $t0, 12($s1) + sw $t0, -100($fp) + # ARG local_main_at_Main_internal_24 + # LOCAL local_main_at_Main_internal_24 --> -100($fp) + lw $t0, -100($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # LOCAL local_main_at_Main_internal_22 --> -92($fp) + # local_main_at_Main_internal_22 = VCALL local_main_at_Main_internal_21 print_list + # Save new self pointer in $s1 + lw $s1, -88($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -92($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_main_at_Main_internal_27 = GETATTRIBUTE mylist Main + # LOCAL local_main_at_Main_internal_27 --> -112($fp) + lw $t0, 12($s1) + sw $t0, -112($fp) + # LOCAL local_main_at_Main_internal_25 --> -104($fp) + # LOCAL local_main_at_Main_internal_27 --> -112($fp) + # local_main_at_Main_internal_25 = local_main_at_Main_internal_27 + lw $t0, -112($fp) + sw $t0, -104($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_25 --> -104($fp) + # LOCAL local_main_at_Main_internal_26 --> -108($fp) + # local_main_at_Main_internal_26 = VCALL local_main_at_Main_internal_25 tail + # Save new self pointer in $s1 + lw $s1, -104($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 60($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -108($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # + # LOCAL local_main_at_Main_internal_26 --> -108($fp) + lw $t0, -108($fp) + sw $t0, 12($s1) + # GOTO label_WHILE_3 + j label_WHILE_3 + label_WHILE_END_4: + # RETURN + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 120 + jr $ra + # Function END + diff --git a/tests/codegen/new_complex.mips b/tests/codegen/new_complex.mips new file mode 100644 index 00000000..36fe8fc6 --- /dev/null +++ b/tests/codegen/new_complex.mips @@ -0,0 +1,4219 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:05 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +Complex: .asciiz "Complex" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_abort_at_Object, function_in_int_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_in_string_at_IO, function_out_int_at_IO, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, function_out_string_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_abort_at_Object, dummy, dummy, dummy, function_substr_at_String, dummy, function_concat_at_String, dummy, dummy, dummy, dummy, dummy, function_length_at_String, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type Complex **** +Complex_vtable: .word function_abort_at_Object, function_in_int_at_IO, function_reflect_X_at_Complex, function_reflect_Y_at_Complex, dummy, dummy, dummy, function_x_value_at_Complex, function_reflect_0_at_Complex, function_in_string_at_IO, function_out_int_at_IO, function_equal_at_Complex, dummy, function_type_name_at_Object, function_copy_at_Object, function_print_at_Complex, function_init_at_Complex, function_y_value_at_Complex, function_out_string_at_IO +# Function END +# + + +# **** Type RECORD for type Complex **** +Complex_start: + Complex_vtable_pointer: .word Complex_vtable + # Function END +Complex_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_abort_at_Object, function_in_int_at_IO, dummy, dummy, dummy, function_main_at_Main, dummy, dummy, dummy, function_in_string_at_IO, function_out_int_at_IO, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, function_out_string_at_IO +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, 1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1 +Complex__TDT: .word -1, -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "+" +# + + +data_5: .asciiz "I" +# + + +data_6: .asciiz "=)\n" +# + + +data_7: .asciiz "=(\n" +# + + +data_8: .asciiz "=)\n" +# + + +data_9: .asciiz "=(\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + lb $t3, 0($t1) + beqz $t3, end_loop + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + end_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 20($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Complex__attrib__x__init implementation. +# @Params: +__Complex__attrib__x__init: + # Allocate stack frame for function __Complex__attrib__x__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local___attrib__x__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local___attrib__x__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Complex__attrib__x__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Complex__attrib__y__init implementation. +# @Params: +__Complex__attrib__y__init: + # Allocate stack frame for function __Complex__attrib__y__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local___attrib__y__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local___attrib__y__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Complex__attrib__y__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Complex implementation. +# @Params: +# 0($fp) = param_init_at_Complex_a_0 +# 4($fp) = param_init_at_Complex_b_1 +function_init_at_Complex: + # Allocate stack frame for function function_init_at_Complex. + subu $sp, $sp, 36 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 36 + # local_init_at_Complex_internal_2 = GETATTRIBUTE x Complex + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # IF_ZERO local_init_at_Complex_internal_2 GOTO label_FALSE_1 + # IF_ZERO local_init_at_Complex_internal_2 GOTO label_FALSE_1 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_1 + # IF_ZERO param_init_at_Complex_a_0 GOTO label_FALSE_1 + # IF_ZERO param_init_at_Complex_a_0 GOTO label_FALSE_1 + lw $t0, 4($fp) + beq $t0, 0, label_FALSE_1 + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_STRING_4 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_STRING_4 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_STRING_4 + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_5 + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_5 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_5 + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, 4($fp) + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_2 + # GOTO label_FALSE_1 + j label_FALSE_1 + label_COMPARE_BY_VALUE_5: + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + lw $a0, -12($fp) + lw $a1, 4($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_2 + # GOTO label_FALSE_1 + j label_FALSE_1 + label_COMPARE_STRING_4: + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, 4($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_CONTINUE_6 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_CONTINUE_6 + lw $t0, -8($fp) + beq $t0, 0, label_CONTINUE_6 + # GOTO label_FALSE_1 + j label_FALSE_1 + label_CONTINUE_6: + # LOCAL local_init_at_Complex_internal_1 --> -8($fp) + # LOCAL local_init_at_Complex_internal_2 --> -12($fp) + # PARAM param_init_at_Complex_a_0 --> 4($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, 4($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_7: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_8 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_7 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_8: + # Store result + sw $a2, -8($fp) + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + # IF_ZERO local_init_at_Complex_internal_1 GOTO label_TRUE_2 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_2 + label_FALSE_1: + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # GOTO label_END_3 +j label_END_3 +label_TRUE_2: + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + label_END_3: +# local_init_at_Complex_internal_5 = GETATTRIBUTE y Complex +# LOCAL local_init_at_Complex_internal_5 --> -24($fp) +lw $t0, 16($s1) +sw $t0, -24($fp) +# IF_ZERO local_init_at_Complex_internal_5 GOTO label_FALSE_9 +# IF_ZERO local_init_at_Complex_internal_5 GOTO label_FALSE_9 +lw $t0, -24($fp) +beq $t0, 0, label_FALSE_9 +# IF_ZERO param_init_at_Complex_b_1 GOTO label_FALSE_9 +# IF_ZERO param_init_at_Complex_b_1 GOTO label_FALSE_9 +lw $t0, 0($fp) +beq $t0, 0, label_FALSE_9 +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# LOCAL local_init_at_Complex_internal_5 --> -24($fp) +# Comparing -24($fp) type with String +la $v0, String +lw $a0, -24($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -20($fp) +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_STRING_12 +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_STRING_12 +lw $t0, -20($fp) +beq $t0, 0, label_COMPARE_STRING_12 +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# LOCAL local_init_at_Complex_internal_5 --> -24($fp) +# Comparing -24($fp) type with Bool +la $v0, Bool +lw $a0, -24($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -20($fp) +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 +lw $t0, -20($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_13 +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# LOCAL local_init_at_Complex_internal_5 --> -24($fp) +# Comparing -24($fp) type with Int +la $v0, Int +lw $a0, -24($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -20($fp) +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_COMPARE_BY_VALUE_13 +lw $t0, -20($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_13 +# LOCAL local_init_at_Complex_internal_4 --> -20($fp) +# LOCAL local_init_at_Complex_internal_5 --> -24($fp) +# PARAM param_init_at_Complex_b_1 --> 0($fp) +# Load pointers and SUB +lw $a0, -24($fp) +lw $a1, 0($fp) +sub $a0, $a0, $a1 +sw $a0, -20($fp) +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 +# IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 +lw $t0, -20($fp) +beq $t0, 0, label_TRUE_10 +# GOTO label_FALSE_9 +j label_FALSE_9 +label_COMPARE_BY_VALUE_13: + # LOCAL local_init_at_Complex_internal_4 --> -20($fp) + # LOCAL local_init_at_Complex_internal_5 --> -24($fp) + # PARAM param_init_at_Complex_b_1 --> 0($fp) + lw $a0, -24($fp) + lw $a1, 0($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -20($fp) + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 + lw $t0, -20($fp) + beq $t0, 0, label_TRUE_10 + # GOTO label_FALSE_9 + j label_FALSE_9 + label_COMPARE_STRING_12: + # LOCAL local_init_at_Complex_internal_4 --> -20($fp) + # LOCAL local_init_at_Complex_internal_5 --> -24($fp) + # PARAM param_init_at_Complex_b_1 --> 0($fp) + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, 0($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -20($fp) + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_CONTINUE_14 + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_CONTINUE_14 + lw $t0, -20($fp) + beq $t0, 0, label_CONTINUE_14 + # GOTO label_FALSE_9 + j label_FALSE_9 + label_CONTINUE_14: + # LOCAL local_init_at_Complex_internal_4 --> -20($fp) + # LOCAL local_init_at_Complex_internal_5 --> -24($fp) + # PARAM param_init_at_Complex_b_1 --> 0($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, 0($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_15: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_16 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_15 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_16: + # Store result + sw $a2, -20($fp) + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 + # IF_ZERO local_init_at_Complex_internal_4 GOTO label_TRUE_10 + lw $t0, -20($fp) + beq $t0, 0, label_TRUE_10 + label_FALSE_9: + # LOCAL local_init_at_Complex_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -16($fp) + # GOTO label_END_11 +j label_END_11 +label_TRUE_10: + # LOCAL local_init_at_Complex_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -16($fp) + label_END_11: +# LOCAL local_init_at_Complex_internal_6 --> -28($fp) +# local_init_at_Complex_internal_6 = SELF +sw $s1, -28($fp) +# RETURN local_init_at_Complex_internal_6 +lw $v0, -28($fp) +# Deallocate stack frame for function function_init_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 36 +# Deallocate function args +addu $sp, $sp, 8 +jr $ra +# Function END + + +# function_print_at_Complex implementation. +# @Params: +function_print_at_Complex: + # Allocate stack frame for function function_print_at_Complex. + subu $sp, $sp, 100 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 100 + # local_print_at_Complex_internal_4 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # LOCAL local_print_at_Complex_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # IF_ZERO local_print_at_Complex_internal_4 GOTO label_FALSE_19 + # IF_ZERO local_print_at_Complex_internal_4 GOTO label_FALSE_19 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_19 + # IF_ZERO local_print_at_Complex_internal_5 GOTO label_FALSE_19 + # IF_ZERO local_print_at_Complex_internal_5 GOTO label_FALSE_19 + lw $t0, -24($fp) + beq $t0, 0, label_FALSE_19 + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # Comparing -20($fp) type with String + la $v0, String + lw $a0, -20($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_STRING_22 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_STRING_22 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_22 + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # Comparing -20($fp) type with Bool + la $v0, Bool + lw $a0, -20($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_23 + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # Comparing -20($fp) type with Int + la $v0, Int + lw $a0, -20($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_23 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_23 + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # LOCAL local_print_at_Complex_internal_5 --> -24($fp) + # Load pointers and SUB + lw $a0, -20($fp) + lw $a1, -24($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_20 + # GOTO label_FALSE_19 + j label_FALSE_19 + label_COMPARE_BY_VALUE_23: + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # LOCAL local_print_at_Complex_internal_5 --> -24($fp) + lw $a0, -20($fp) + lw $a1, -24($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_20 + # GOTO label_FALSE_19 + j label_FALSE_19 + label_COMPARE_STRING_22: + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # LOCAL local_print_at_Complex_internal_5 --> -24($fp) + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -24($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_CONTINUE_24 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_CONTINUE_24 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_24 + # GOTO label_FALSE_19 + j label_FALSE_19 + label_CONTINUE_24: + # LOCAL local_print_at_Complex_internal_3 --> -16($fp) + # LOCAL local_print_at_Complex_internal_4 --> -20($fp) + # LOCAL local_print_at_Complex_internal_5 --> -24($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -24($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_25: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_26 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_25 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_26: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + # IF_ZERO local_print_at_Complex_internal_3 GOTO label_TRUE_20 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_20 + label_FALSE_19: + # LOCAL local_print_at_Complex_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_21 +j label_END_21 +label_TRUE_20: + # LOCAL local_print_at_Complex_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_21: +# LOCAL local_print_at_Complex_internal_0 --> -4($fp) +# LOCAL local_print_at_Complex_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_print_at_Complex_internal_0 GOTO label_FALSEIF_17 +# IF_ZERO local_print_at_Complex_internal_0 GOTO label_FALSEIF_17 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_17 +# LOCAL local_print_at_Complex_internal_8 --> -36($fp) +# local_print_at_Complex_internal_8 = SELF +sw $s1, -36($fp) +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +# LOCAL local_print_at_Complex_internal_8 --> -36($fp) +# local_print_at_Complex_internal_6 = local_print_at_Complex_internal_8 +lw $t0, -36($fp) +sw $t0, -28($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_print_at_Complex_internal_9 = GETATTRIBUTE x Complex +# LOCAL local_print_at_Complex_internal_9 --> -40($fp) +lw $t0, 12($s1) +sw $t0, -40($fp) +# ARG local_print_at_Complex_internal_9 +# LOCAL local_print_at_Complex_internal_9 --> -40($fp) +lw $t0, -40($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_print_at_Complex_internal_6 --> -28($fp) +# LOCAL local_print_at_Complex_internal_7 --> -32($fp) +# local_print_at_Complex_internal_7 = VCALL local_print_at_Complex_internal_6 out_int +# Save new self pointer in $s1 +lw $s1, -28($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 40($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -32($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_print_at_Complex_internal_1 --> -8($fp) +# LOCAL local_print_at_Complex_internal_7 --> -32($fp) +# local_print_at_Complex_internal_1 = local_print_at_Complex_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_18 +j label_ENDIF_18 +label_FALSEIF_17: + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + # local_print_at_Complex_internal_18 = SELF + sw $s1, -76($fp) + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + # LOCAL local_print_at_Complex_internal_18 --> -76($fp) + # local_print_at_Complex_internal_16 = local_print_at_Complex_internal_18 + lw $t0, -76($fp) + sw $t0, -68($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Complex_internal_19 = GETATTRIBUTE x Complex + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + lw $t0, 12($s1) + sw $t0, -80($fp) + # ARG local_print_at_Complex_internal_19 + # LOCAL local_print_at_Complex_internal_19 --> -80($fp) + lw $t0, -80($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Complex_internal_16 --> -68($fp) + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + # local_print_at_Complex_internal_17 = VCALL local_print_at_Complex_internal_16 out_int + # Save new self pointer in $s1 + lw $s1, -68($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -72($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_14 --> -60($fp) + # LOCAL local_print_at_Complex_internal_17 --> -72($fp) + # local_print_at_Complex_internal_14 = local_print_at_Complex_internal_17 + lw $t0, -72($fp) + sw $t0, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Complex_internal_20 --> -84($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -84($fp) + # ARG local_print_at_Complex_internal_20 + # LOCAL local_print_at_Complex_internal_20 --> -84($fp) + lw $t0, -84($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Complex_internal_14 --> -60($fp) + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_15 = VCALL local_print_at_Complex_internal_14 out_string + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 72($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_12 --> -52($fp) + # LOCAL local_print_at_Complex_internal_15 --> -64($fp) + # local_print_at_Complex_internal_12 = local_print_at_Complex_internal_15 + lw $t0, -64($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_at_Complex_internal_21 = GETATTRIBUTE y Complex + # LOCAL local_print_at_Complex_internal_21 --> -88($fp) + lw $t0, 16($s1) + sw $t0, -88($fp) + # ARG local_print_at_Complex_internal_21 + # LOCAL local_print_at_Complex_internal_21 --> -88($fp) + lw $t0, -88($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Complex_internal_12 --> -52($fp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # local_print_at_Complex_internal_13 = VCALL local_print_at_Complex_internal_12 out_int + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_10 --> -44($fp) + # LOCAL local_print_at_Complex_internal_13 --> -56($fp) + # local_print_at_Complex_internal_10 = local_print_at_Complex_internal_13 + lw $t0, -56($fp) + sw $t0, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_at_Complex_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -92($fp) + # ARG local_print_at_Complex_internal_22 + # LOCAL local_print_at_Complex_internal_22 --> -92($fp) + lw $t0, -92($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_at_Complex_internal_10 --> -44($fp) + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # local_print_at_Complex_internal_11 = VCALL local_print_at_Complex_internal_10 out_string + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 72($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_at_Complex_internal_1 --> -8($fp) + # LOCAL local_print_at_Complex_internal_11 --> -48($fp) + # local_print_at_Complex_internal_1 = local_print_at_Complex_internal_11 + lw $t0, -48($fp) + sw $t0, -8($fp) + label_ENDIF_18: +# RETURN local_print_at_Complex_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_print_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 100 +jr $ra +# Function END + + +# function_reflect_0_at_Complex implementation. +# @Params: +function_reflect_0_at_Complex: + # Allocate stack frame for function function_reflect_0_at_Complex. + subu $sp, $sp, 52 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 52 + # local_reflect_0_at_Complex_internal_2 = GETATTRIBUTE x Complex + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # local_reflect_0_at_Complex_internal_4 = GETATTRIBUTE x Complex + # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) + lw $t0, 12($s1) + sw $t0, -20($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + # LOCAL local_reflect_0_at_Complex_internal_4 --> -20($fp) + lw $t0, -20($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -16($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -16($fp) + sw $t0, 12($v0) + sw $v0, -16($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_2 GOTO label_FALSE_27 + # IF_ZERO local_reflect_0_at_Complex_internal_2 GOTO label_FALSE_27 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_27 + # IF_ZERO local_reflect_0_at_Complex_internal_3 GOTO label_FALSE_27 + # IF_ZERO local_reflect_0_at_Complex_internal_3 GOTO label_FALSE_27 + lw $t0, -16($fp) + beq $t0, 0, label_FALSE_27 + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_STRING_30 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_STRING_30 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_STRING_30 + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_31 + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_31 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_31 + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, -16($fp) + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_28 + # GOTO label_FALSE_27 + j label_FALSE_27 + label_COMPARE_BY_VALUE_31: + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + lw $a0, -12($fp) + lw $a1, -16($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_28 + # GOTO label_FALSE_27 + j label_FALSE_27 + label_COMPARE_STRING_30: + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_CONTINUE_32 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_CONTINUE_32 + lw $t0, -8($fp) + beq $t0, 0, label_CONTINUE_32 + # GOTO label_FALSE_27 + j label_FALSE_27 + label_CONTINUE_32: + # LOCAL local_reflect_0_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_0_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_0_at_Complex_internal_3 --> -16($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_33: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_34 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_33 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_34: + # Store result + sw $a2, -8($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + # IF_ZERO local_reflect_0_at_Complex_internal_1 GOTO label_TRUE_28 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_28 + label_FALSE_27: + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # GOTO label_END_29 +j label_END_29 +label_TRUE_28: + # LOCAL local_reflect_0_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + label_END_29: +# local_reflect_0_at_Complex_internal_7 = GETATTRIBUTE y Complex +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +lw $t0, 16($s1) +sw $t0, -32($fp) +# local_reflect_0_at_Complex_internal_9 = GETATTRIBUTE y Complex +# LOCAL local_reflect_0_at_Complex_internal_9 --> -40($fp) +lw $t0, 16($s1) +sw $t0, -40($fp) +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# LOCAL local_reflect_0_at_Complex_internal_9 --> -40($fp) +lw $t0, -40($fp) +lw $t0, 12($t0) +not $t0, $t0 +add $t0, $t0, 1 +sw $t0, -36($fp) +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +lw $t0, -36($fp) +sw $t0, 12($v0) +sw $v0, -36($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_7 GOTO label_FALSE_35 +# IF_ZERO local_reflect_0_at_Complex_internal_7 GOTO label_FALSE_35 +lw $t0, -32($fp) +beq $t0, 0, label_FALSE_35 +# IF_ZERO local_reflect_0_at_Complex_internal_8 GOTO label_FALSE_35 +# IF_ZERO local_reflect_0_at_Complex_internal_8 GOTO label_FALSE_35 +lw $t0, -36($fp) +beq $t0, 0, label_FALSE_35 +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +# Comparing -32($fp) type with String +la $v0, String +lw $a0, -32($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -28($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_STRING_38 +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_STRING_38 +lw $t0, -28($fp) +beq $t0, 0, label_COMPARE_STRING_38 +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +# Comparing -32($fp) type with Bool +la $v0, Bool +lw $a0, -32($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -28($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 +lw $t0, -28($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_39 +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +# Comparing -32($fp) type with Int +la $v0, Int +lw $a0, -32($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -28($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_COMPARE_BY_VALUE_39 +lw $t0, -28($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_39 +# LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) +# LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) +# LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) +# Load pointers and SUB +lw $a0, -32($fp) +lw $a1, -36($fp) +sub $a0, $a0, $a1 +sw $a0, -28($fp) +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 +# IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 +lw $t0, -28($fp) +beq $t0, 0, label_TRUE_36 +# GOTO label_FALSE_35 +j label_FALSE_35 +label_COMPARE_BY_VALUE_39: + # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) + # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) + # LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) + lw $a0, -32($fp) + lw $a1, -36($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -28($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 + lw $t0, -28($fp) + beq $t0, 0, label_TRUE_36 + # GOTO label_FALSE_35 + j label_FALSE_35 + label_COMPARE_STRING_38: + # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) + # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) + # LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) + # Load strings for comparison + lw $v0, -32($fp) + lw $v1, -36($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -28($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_CONTINUE_40 + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_CONTINUE_40 + lw $t0, -28($fp) + beq $t0, 0, label_CONTINUE_40 + # GOTO label_FALSE_35 + j label_FALSE_35 + label_CONTINUE_40: + # LOCAL local_reflect_0_at_Complex_internal_6 --> -28($fp) + # LOCAL local_reflect_0_at_Complex_internal_7 --> -32($fp) + # LOCAL local_reflect_0_at_Complex_internal_8 --> -36($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -32($fp) + lw $v1, -36($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_41: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_42 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_41 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_42: + # Store result + sw $a2, -28($fp) + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 + # IF_ZERO local_reflect_0_at_Complex_internal_6 GOTO label_TRUE_36 + lw $t0, -28($fp) + beq $t0, 0, label_TRUE_36 + label_FALSE_35: + # LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -24($fp) + # GOTO label_END_37 +j label_END_37 +label_TRUE_36: + # LOCAL local_reflect_0_at_Complex_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -24($fp) + label_END_37: +# LOCAL local_reflect_0_at_Complex_internal_10 --> -44($fp) +# local_reflect_0_at_Complex_internal_10 = SELF +sw $s1, -44($fp) +# RETURN local_reflect_0_at_Complex_internal_10 +lw $v0, -44($fp) +# Deallocate stack frame for function function_reflect_0_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 52 +jr $ra +# Function END + + +# function_reflect_X_at_Complex implementation. +# @Params: +function_reflect_X_at_Complex: + # Allocate stack frame for function function_reflect_X_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_reflect_X_at_Complex_internal_2 = GETATTRIBUTE y Complex + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + lw $t0, 16($s1) + sw $t0, -12($fp) + # local_reflect_X_at_Complex_internal_4 = GETATTRIBUTE y Complex + # LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + # LOCAL local_reflect_X_at_Complex_internal_4 --> -20($fp) + lw $t0, -20($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -16($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -16($fp) + sw $t0, 12($v0) + sw $v0, -16($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_2 GOTO label_FALSE_43 + # IF_ZERO local_reflect_X_at_Complex_internal_2 GOTO label_FALSE_43 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_43 + # IF_ZERO local_reflect_X_at_Complex_internal_3 GOTO label_FALSE_43 + # IF_ZERO local_reflect_X_at_Complex_internal_3 GOTO label_FALSE_43 + lw $t0, -16($fp) + beq $t0, 0, label_FALSE_43 + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_STRING_46 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_STRING_46 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_STRING_46 + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_47 + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_47 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_47 + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, -16($fp) + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_44 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_COMPARE_BY_VALUE_47: + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + lw $a0, -12($fp) + lw $a1, -16($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_44 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_COMPARE_STRING_46: + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_CONTINUE_48 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_CONTINUE_48 + lw $t0, -8($fp) + beq $t0, 0, label_CONTINUE_48 + # GOTO label_FALSE_43 + j label_FALSE_43 + label_CONTINUE_48: + # LOCAL local_reflect_X_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_X_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_X_at_Complex_internal_3 --> -16($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_49: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_50 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_49 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_50: + # Store result + sw $a2, -8($fp) + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + # IF_ZERO local_reflect_X_at_Complex_internal_1 GOTO label_TRUE_44 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_44 + label_FALSE_43: + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # GOTO label_END_45 +j label_END_45 +label_TRUE_44: + # LOCAL local_reflect_X_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + label_END_45: +# LOCAL local_reflect_X_at_Complex_internal_5 --> -24($fp) +# local_reflect_X_at_Complex_internal_5 = SELF +sw $s1, -24($fp) +# RETURN local_reflect_X_at_Complex_internal_5 +lw $v0, -24($fp) +# Deallocate stack frame for function function_reflect_X_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +jr $ra +# Function END + + +# function_reflect_Y_at_Complex implementation. +# @Params: +function_reflect_Y_at_Complex: + # Allocate stack frame for function function_reflect_Y_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_reflect_Y_at_Complex_internal_2 = GETATTRIBUTE x Complex + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + lw $t0, 12($s1) + sw $t0, -12($fp) + # local_reflect_Y_at_Complex_internal_4 = GETATTRIBUTE x Complex + # LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) + lw $t0, 12($s1) + sw $t0, -20($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + # LOCAL local_reflect_Y_at_Complex_internal_4 --> -20($fp) + lw $t0, -20($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -16($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -16($fp) + sw $t0, 12($v0) + sw $v0, -16($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_2 GOTO label_FALSE_51 + # IF_ZERO local_reflect_Y_at_Complex_internal_2 GOTO label_FALSE_51 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_51 + # IF_ZERO local_reflect_Y_at_Complex_internal_3 GOTO label_FALSE_51 + # IF_ZERO local_reflect_Y_at_Complex_internal_3 GOTO label_FALSE_51 + lw $t0, -16($fp) + beq $t0, 0, label_FALSE_51 + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with String + la $v0, String + lw $a0, -12($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_STRING_54 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_STRING_54 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_STRING_54 + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Bool + la $v0, Bool + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_55 + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # Comparing -12($fp) type with Int + la $v0, Int + lw $a0, -12($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_COMPARE_BY_VALUE_55 + lw $t0, -8($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_55 + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + # Load pointers and SUB + lw $a0, -12($fp) + lw $a1, -16($fp) + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_52 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_COMPARE_BY_VALUE_55: + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + lw $a0, -12($fp) + lw $a1, -16($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_52 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_COMPARE_STRING_54: + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_CONTINUE_56 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_CONTINUE_56 + lw $t0, -8($fp) + beq $t0, 0, label_CONTINUE_56 + # GOTO label_FALSE_51 + j label_FALSE_51 + label_CONTINUE_56: + # LOCAL local_reflect_Y_at_Complex_internal_1 --> -8($fp) + # LOCAL local_reflect_Y_at_Complex_internal_2 --> -12($fp) + # LOCAL local_reflect_Y_at_Complex_internal_3 --> -16($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -12($fp) + lw $v1, -16($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_57: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_58 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_57 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_58: + # Store result + sw $a2, -8($fp) + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + # IF_ZERO local_reflect_Y_at_Complex_internal_1 GOTO label_TRUE_52 + lw $t0, -8($fp) + beq $t0, 0, label_TRUE_52 + label_FALSE_51: + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # GOTO label_END_53 +j label_END_53 +label_TRUE_52: + # LOCAL local_reflect_Y_at_Complex_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + label_END_53: +# LOCAL local_reflect_Y_at_Complex_internal_5 --> -24($fp) +# local_reflect_Y_at_Complex_internal_5 = SELF +sw $s1, -24($fp) +# RETURN local_reflect_Y_at_Complex_internal_5 +lw $v0, -24($fp) +# Deallocate stack frame for function function_reflect_Y_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 32 +jr $ra +# Function END + + +# function_equal_at_Complex implementation. +# @Params: +# 0($fp) = param_equal_at_Complex_d_0 +function_equal_at_Complex: + # Allocate stack frame for function function_equal_at_Complex. + subu $sp, $sp, 76 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 76 + # local_equal_at_Complex_internal_4 = GETATTRIBUTE x Complex + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + lw $t0, 12($s1) + sw $t0, -20($fp) + # LOCAL local_equal_at_Complex_internal_5 --> -24($fp) + # PARAM param_equal_at_Complex_d_0 --> 0($fp) + # local_equal_at_Complex_internal_5 = PARAM param_equal_at_Complex_d_0 + lw $t0, 0($fp) + sw $t0, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_equal_at_Complex_internal_5 --> -24($fp) + # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) + # local_equal_at_Complex_internal_6 = VCALL local_equal_at_Complex_internal_5 x_value + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # IF_ZERO local_equal_at_Complex_internal_4 GOTO label_FALSE_61 + # IF_ZERO local_equal_at_Complex_internal_4 GOTO label_FALSE_61 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_61 + # IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSE_61 + # IF_ZERO local_equal_at_Complex_internal_6 GOTO label_FALSE_61 + lw $t0, -28($fp) + beq $t0, 0, label_FALSE_61 + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # Comparing -20($fp) type with String + la $v0, String + lw $a0, -20($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_COMPARE_STRING_64 + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_COMPARE_STRING_64 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_64 + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # Comparing -20($fp) type with Bool + la $v0, Bool + lw $a0, -20($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_65 + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_65 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_65 + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # Comparing -20($fp) type with Int + la $v0, Int + lw $a0, -20($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_65 + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_COMPARE_BY_VALUE_65 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_65 + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) + # Load pointers and SUB + lw $a0, -20($fp) + lw $a1, -28($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_TRUE_62 + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_TRUE_62 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_62 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_COMPARE_BY_VALUE_65: + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) + lw $a0, -20($fp) + lw $a1, -28($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_TRUE_62 + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_TRUE_62 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_62 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_COMPARE_STRING_64: + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -28($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_CONTINUE_66 + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_CONTINUE_66 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_66 + # GOTO label_FALSE_61 + j label_FALSE_61 + label_CONTINUE_66: + # LOCAL local_equal_at_Complex_internal_3 --> -16($fp) + # LOCAL local_equal_at_Complex_internal_4 --> -20($fp) + # LOCAL local_equal_at_Complex_internal_6 --> -28($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -20($fp) + lw $v1, -28($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_67: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_68 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_67 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_68: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_TRUE_62 + # IF_ZERO local_equal_at_Complex_internal_3 GOTO label_TRUE_62 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_62 + label_FALSE_61: + # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_63 +j label_END_63 +label_TRUE_62: + # LOCAL local_equal_at_Complex_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_63: +# LOCAL local_equal_at_Complex_internal_0 --> -4($fp) +# LOCAL local_equal_at_Complex_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_equal_at_Complex_internal_0 GOTO label_FALSEIF_59 +# IF_ZERO local_equal_at_Complex_internal_0 GOTO label_FALSEIF_59 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_59 +# local_equal_at_Complex_internal_11 = GETATTRIBUTE y Complex +# LOCAL local_equal_at_Complex_internal_11 --> -48($fp) +lw $t0, 16($s1) +sw $t0, -48($fp) +# LOCAL local_equal_at_Complex_internal_12 --> -52($fp) +# PARAM param_equal_at_Complex_d_0 --> 0($fp) +# local_equal_at_Complex_internal_12 = PARAM param_equal_at_Complex_d_0 +lw $t0, 0($fp) +sw $t0, -52($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_equal_at_Complex_internal_12 --> -52($fp) +# LOCAL local_equal_at_Complex_internal_13 --> -56($fp) +# local_equal_at_Complex_internal_13 = VCALL local_equal_at_Complex_internal_12 y_value +# Save new self pointer in $s1 +lw $s1, -52($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 68($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -56($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# IF_ZERO local_equal_at_Complex_internal_11 GOTO label_FALSE_71 +# IF_ZERO local_equal_at_Complex_internal_11 GOTO label_FALSE_71 +lw $t0, -48($fp) +beq $t0, 0, label_FALSE_71 +# IF_ZERO local_equal_at_Complex_internal_13 GOTO label_FALSE_71 +# IF_ZERO local_equal_at_Complex_internal_13 GOTO label_FALSE_71 +lw $t0, -56($fp) +beq $t0, 0, label_FALSE_71 +# LOCAL local_equal_at_Complex_internal_10 --> -44($fp) +# LOCAL local_equal_at_Complex_internal_11 --> -48($fp) +# Comparing -48($fp) type with String +la $v0, String +lw $a0, -48($fp) +lw $a0, 0($a0) +sub $a0, $a0, $v0 +sw $a0, -44($fp) +# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_COMPARE_STRING_74 +# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_COMPARE_STRING_74 +lw $t0, -44($fp) +beq $t0, 0, label_COMPARE_STRING_74 +# LOCAL local_equal_at_Complex_internal_10 --> -44($fp) +# LOCAL local_equal_at_Complex_internal_11 --> -48($fp) +# Comparing -48($fp) type with Bool +la $v0, Bool +lw $a0, -48($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -44($fp) +# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_COMPARE_BY_VALUE_75 +# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_COMPARE_BY_VALUE_75 +lw $t0, -44($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_75 +# LOCAL local_equal_at_Complex_internal_10 --> -44($fp) +# LOCAL local_equal_at_Complex_internal_11 --> -48($fp) +# Comparing -48($fp) type with Int +la $v0, Int +lw $a0, -48($fp) +lw $a0, 0($a0) +lw $a0, 12($a0) +sub $a0, $a0, $v0 +sw $a0, -44($fp) +# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_COMPARE_BY_VALUE_75 +# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_COMPARE_BY_VALUE_75 +lw $t0, -44($fp) +beq $t0, 0, label_COMPARE_BY_VALUE_75 +# LOCAL local_equal_at_Complex_internal_10 --> -44($fp) +# LOCAL local_equal_at_Complex_internal_11 --> -48($fp) +# LOCAL local_equal_at_Complex_internal_13 --> -56($fp) +# Load pointers and SUB +lw $a0, -48($fp) +lw $a1, -56($fp) +sub $a0, $a0, $a1 +sw $a0, -44($fp) +# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_TRUE_72 +# IF_ZERO local_equal_at_Complex_internal_10 GOTO label_TRUE_72 +lw $t0, -44($fp) +beq $t0, 0, label_TRUE_72 +# GOTO label_FALSE_71 +j label_FALSE_71 +label_COMPARE_BY_VALUE_75: + # LOCAL local_equal_at_Complex_internal_10 --> -44($fp) + # LOCAL local_equal_at_Complex_internal_11 --> -48($fp) + # LOCAL local_equal_at_Complex_internal_13 --> -56($fp) + lw $a0, -48($fp) + lw $a1, -56($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_ZERO local_equal_at_Complex_internal_10 GOTO label_TRUE_72 + # IF_ZERO local_equal_at_Complex_internal_10 GOTO label_TRUE_72 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_72 + # GOTO label_FALSE_71 + j label_FALSE_71 + label_COMPARE_STRING_74: + # LOCAL local_equal_at_Complex_internal_10 --> -44($fp) + # LOCAL local_equal_at_Complex_internal_11 --> -48($fp) + # LOCAL local_equal_at_Complex_internal_13 --> -56($fp) + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -56($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -44($fp) + # IF_ZERO local_equal_at_Complex_internal_10 GOTO label_CONTINUE_76 + # IF_ZERO local_equal_at_Complex_internal_10 GOTO label_CONTINUE_76 + lw $t0, -44($fp) + beq $t0, 0, label_CONTINUE_76 + # GOTO label_FALSE_71 + j label_FALSE_71 + label_CONTINUE_76: + # LOCAL local_equal_at_Complex_internal_10 --> -44($fp) + # LOCAL local_equal_at_Complex_internal_11 --> -48($fp) + # LOCAL local_equal_at_Complex_internal_13 --> -56($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -56($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_77: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_78 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_77 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_78: + # Store result + sw $a2, -44($fp) + # IF_ZERO local_equal_at_Complex_internal_10 GOTO label_TRUE_72 + # IF_ZERO local_equal_at_Complex_internal_10 GOTO label_TRUE_72 + lw $t0, -44($fp) + beq $t0, 0, label_TRUE_72 + label_FALSE_71: + # LOCAL local_equal_at_Complex_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -40($fp) + # GOTO label_END_73 +j label_END_73 +label_TRUE_72: + # LOCAL local_equal_at_Complex_internal_9 --> -40($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -40($fp) + label_END_73: +# LOCAL local_equal_at_Complex_internal_7 --> -32($fp) +# LOCAL local_equal_at_Complex_internal_9 --> -40($fp) +# Obtain value from -40($fp) +lw $v0, -40($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_equal_at_Complex_internal_7 GOTO label_FALSEIF_69 +# IF_ZERO local_equal_at_Complex_internal_7 GOTO label_FALSEIF_69 +lw $t0, -32($fp) +beq $t0, 0, label_FALSEIF_69 +# LOCAL local_equal_at_Complex_internal_14 --> -60($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -60($fp) +# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) +# LOCAL local_equal_at_Complex_internal_14 --> -60($fp) +# local_equal_at_Complex_internal_8 = local_equal_at_Complex_internal_14 +lw $t0, -60($fp) +sw $t0, -36($fp) +# GOTO label_ENDIF_70 +j label_ENDIF_70 +label_FALSEIF_69: + # LOCAL local_equal_at_Complex_internal_15 --> -64($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -64($fp) + # LOCAL local_equal_at_Complex_internal_8 --> -36($fp) + # LOCAL local_equal_at_Complex_internal_15 --> -64($fp) + # local_equal_at_Complex_internal_8 = local_equal_at_Complex_internal_15 + lw $t0, -64($fp) + sw $t0, -36($fp) + label_ENDIF_70: +# LOCAL local_equal_at_Complex_internal_1 --> -8($fp) +# LOCAL local_equal_at_Complex_internal_8 --> -36($fp) +# local_equal_at_Complex_internal_1 = local_equal_at_Complex_internal_8 +lw $t0, -36($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_60 +j label_ENDIF_60 +label_FALSEIF_59: + # LOCAL local_equal_at_Complex_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -68($fp) + # LOCAL local_equal_at_Complex_internal_1 --> -8($fp) + # LOCAL local_equal_at_Complex_internal_16 --> -68($fp) + # local_equal_at_Complex_internal_1 = local_equal_at_Complex_internal_16 + lw $t0, -68($fp) + sw $t0, -8($fp) + label_ENDIF_60: +# RETURN local_equal_at_Complex_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_equal_at_Complex. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 76 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_x_value_at_Complex implementation. +# @Params: +function_x_value_at_Complex: + # Allocate stack frame for function function_x_value_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_x_value_at_Complex_internal_0 = GETATTRIBUTE x Complex + # LOCAL local_x_value_at_Complex_internal_0 --> -4($fp) + lw $t0, 12($s1) + sw $t0, -4($fp) + # RETURN local_x_value_at_Complex_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_x_value_at_Complex. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_y_value_at_Complex implementation. +# @Params: +function_y_value_at_Complex: + # Allocate stack frame for function function_y_value_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_y_value_at_Complex_internal_0 = GETATTRIBUTE y Complex + # LOCAL local_y_value_at_Complex_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_y_value_at_Complex_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_y_value_at_Complex. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 168 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 168 + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_c_0 = 0 + li $t0, 0 + sw $t0, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE Complex + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Complex + sw $t0, 12($v0) + li $t0, 7 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Complex_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Complex__attrib__x__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Complex__attrib__y__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -20($fp) + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -24($fp) + # ARG local_main_at_Main_internal_5 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 64($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_c_0 = local_main_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_c_0 + lw $t0, -4($fp) + sw $t0, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 reflect_X + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 8($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_internal_12 = local_main_at_Main_c_0 + lw $t0, -4($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 reflect_0 + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # IF_ZERO local_main_at_Main_internal_11 GOTO label_FALSE_81 + # IF_ZERO local_main_at_Main_internal_11 GOTO label_FALSE_81 + lw $t0, -48($fp) + beq $t0, 0, label_FALSE_81 + # IF_ZERO local_main_at_Main_internal_13 GOTO label_FALSE_81 + # IF_ZERO local_main_at_Main_internal_13 GOTO label_FALSE_81 + lw $t0, -56($fp) + beq $t0, 0, label_FALSE_81 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Comparing -48($fp) type with String + la $v0, String + lw $a0, -48($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_STRING_84 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_STRING_84 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_STRING_84 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Comparing -48($fp) type with Bool + la $v0, Bool + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_85 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_85 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_85 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Comparing -48($fp) type with Int + la $v0, Int + lw $a0, -48($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_85 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_COMPARE_BY_VALUE_85 + lw $t0, -40($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_85 + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # Load pointers and SUB + lw $a0, -48($fp) + lw $a1, -56($fp) + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_82 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_82 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_82 + # GOTO label_FALSE_81 + j label_FALSE_81 + label_COMPARE_BY_VALUE_85: + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + lw $a0, -48($fp) + lw $a1, -56($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_82 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_82 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_82 + # GOTO label_FALSE_81 + j label_FALSE_81 + label_COMPARE_STRING_84: + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -56($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_CONTINUE_86 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_CONTINUE_86 + lw $t0, -40($fp) + beq $t0, 0, label_CONTINUE_86 + # GOTO label_FALSE_81 + j label_FALSE_81 + label_CONTINUE_86: + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -48($fp) + lw $v1, -56($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_87: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_88 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_87 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_88: + # Store result + sw $a2, -40($fp) + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_82 + # IF_ZERO local_main_at_Main_internal_9 GOTO label_TRUE_82 + lw $t0, -40($fp) + beq $t0, 0, label_TRUE_82 + label_FALSE_81: + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -36($fp) + # GOTO label_END_83 +j label_END_83 +label_TRUE_82: + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -36($fp) + label_END_83: +# LOCAL local_main_at_Main_internal_6 --> -28($fp) +# LOCAL local_main_at_Main_internal_8 --> -36($fp) +# Obtain value from -36($fp) +lw $v0, -36($fp) +lw $v0, 12($v0) +sw $v0, -28($fp) +# IF_ZERO local_main_at_Main_internal_6 GOTO label_FALSEIF_79 +# IF_ZERO local_main_at_Main_internal_6 GOTO label_FALSEIF_79 +lw $t0, -28($fp) +beq $t0, 0, label_FALSEIF_79 +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# local_main_at_Main_internal_16 = SELF +sw $s1, -68($fp) +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# local_main_at_Main_internal_14 = local_main_at_Main_internal_16 +lw $t0, -68($fp) +sw $t0, -60($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_6 +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +sw $v0, -72($fp) +# ARG local_main_at_Main_internal_17 +# LOCAL local_main_at_Main_internal_17 --> -72($fp) +lw $t0, -72($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 out_string +# Save new self pointer in $s1 +lw $s1, -60($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 72($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -64($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_7 --> -32($fp) +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# local_main_at_Main_internal_7 = local_main_at_Main_internal_15 +lw $t0, -64($fp) +sw $t0, -32($fp) +# GOTO label_ENDIF_80 +j label_ENDIF_80 +label_FALSEIF_79: + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_20 = SELF + sw $s1, -84($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 + lw $t0, -84($fp) + sw $t0, -76($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_7 + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + sw $v0, -88($fp) + # ARG local_main_at_Main_internal_21 + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + lw $t0, -88($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 out_string + # Save new self pointer in $s1 + lw $s1, -76($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 72($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -80($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_19 + lw $t0, -80($fp) + sw $t0, -32($fp) + label_ENDIF_80: +# LOCAL local_main_at_Main_internal_28 --> -116($fp) +# LOCAL local_main_at_Main_c_0 --> -4($fp) +# local_main_at_Main_internal_28 = local_main_at_Main_c_0 +lw $t0, -4($fp) +sw $t0, -116($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_28 --> -116($fp) +# LOCAL local_main_at_Main_internal_29 --> -120($fp) +# local_main_at_Main_internal_29 = VCALL local_main_at_Main_internal_28 reflect_X +# Save new self pointer in $s1 +lw $s1, -116($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 8($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -120($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_26 --> -108($fp) +# LOCAL local_main_at_Main_internal_29 --> -120($fp) +# local_main_at_Main_internal_26 = local_main_at_Main_internal_29 +lw $t0, -120($fp) +sw $t0, -108($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_26 --> -108($fp) +# LOCAL local_main_at_Main_internal_27 --> -112($fp) +# local_main_at_Main_internal_27 = VCALL local_main_at_Main_internal_26 reflect_Y +# Save new self pointer in $s1 +lw $s1, -108($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -112($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_24 --> -100($fp) +# LOCAL local_main_at_Main_internal_27 --> -112($fp) +# local_main_at_Main_internal_24 = local_main_at_Main_internal_27 +lw $t0, -112($fp) +sw $t0, -100($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_30 --> -124($fp) +# LOCAL local_main_at_Main_c_0 --> -4($fp) +# local_main_at_Main_internal_30 = local_main_at_Main_c_0 +lw $t0, -4($fp) +sw $t0, -124($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_30 --> -124($fp) +# LOCAL local_main_at_Main_internal_31 --> -128($fp) +# local_main_at_Main_internal_31 = VCALL local_main_at_Main_internal_30 reflect_0 +# Save new self pointer in $s1 +lw $s1, -124($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 32($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -128($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_31 +# LOCAL local_main_at_Main_internal_31 --> -128($fp) +lw $t0, -128($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_24 --> -100($fp) +# LOCAL local_main_at_Main_internal_25 --> -104($fp) +# local_main_at_Main_internal_25 = VCALL local_main_at_Main_internal_24 equal +# Save new self pointer in $s1 +lw $s1, -100($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 44($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -104($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_22 --> -92($fp) +# LOCAL local_main_at_Main_internal_25 --> -104($fp) +# Obtain value from -104($fp) +lw $v0, -104($fp) +lw $v0, 12($v0) +sw $v0, -92($fp) +# IF_ZERO local_main_at_Main_internal_22 GOTO label_FALSEIF_89 +# IF_ZERO local_main_at_Main_internal_22 GOTO label_FALSEIF_89 +lw $t0, -92($fp) +beq $t0, 0, label_FALSEIF_89 +# LOCAL local_main_at_Main_internal_34 --> -140($fp) +# local_main_at_Main_internal_34 = SELF +sw $s1, -140($fp) +# LOCAL local_main_at_Main_internal_32 --> -132($fp) +# LOCAL local_main_at_Main_internal_34 --> -140($fp) +# local_main_at_Main_internal_32 = local_main_at_Main_internal_34 +lw $t0, -140($fp) +sw $t0, -132($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_35 --> -144($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_8 +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +sw $v0, -144($fp) +# ARG local_main_at_Main_internal_35 +# LOCAL local_main_at_Main_internal_35 --> -144($fp) +lw $t0, -144($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_32 --> -132($fp) +# LOCAL local_main_at_Main_internal_33 --> -136($fp) +# local_main_at_Main_internal_33 = VCALL local_main_at_Main_internal_32 out_string +# Save new self pointer in $s1 +lw $s1, -132($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 72($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -136($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_23 --> -96($fp) +# LOCAL local_main_at_Main_internal_33 --> -136($fp) +# local_main_at_Main_internal_23 = local_main_at_Main_internal_33 +lw $t0, -136($fp) +sw $t0, -96($fp) +# GOTO label_ENDIF_90 +j label_ENDIF_90 +label_FALSEIF_89: + # LOCAL local_main_at_Main_internal_38 --> -156($fp) + # local_main_at_Main_internal_38 = SELF + sw $s1, -156($fp) + # LOCAL local_main_at_Main_internal_36 --> -148($fp) + # LOCAL local_main_at_Main_internal_38 --> -156($fp) + # local_main_at_Main_internal_36 = local_main_at_Main_internal_38 + lw $t0, -156($fp) + sw $t0, -148($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_39 --> -160($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_9 + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + sw $v0, -160($fp) + # ARG local_main_at_Main_internal_39 + # LOCAL local_main_at_Main_internal_39 --> -160($fp) + lw $t0, -160($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_36 --> -148($fp) + # LOCAL local_main_at_Main_internal_37 --> -152($fp) + # local_main_at_Main_internal_37 = VCALL local_main_at_Main_internal_36 out_string + # Save new self pointer in $s1 + lw $s1, -148($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 72($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -152($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_23 --> -96($fp) + # LOCAL local_main_at_Main_internal_37 --> -152($fp) + # local_main_at_Main_internal_23 = local_main_at_Main_internal_37 + lw $t0, -152($fp) + sw $t0, -96($fp) + label_ENDIF_90: +# RETURN local_main_at_Main_internal_23 +lw $v0, -96($fp) +# Deallocate stack frame for function function_main_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 168 +jr $ra +# Function END + diff --git a/tests/codegen/palindrome.mips b/tests/codegen/palindrome.mips new file mode 100644 index 00000000..febab57d --- /dev/null +++ b/tests/codegen/palindrome.mips @@ -0,0 +1,2423 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:07 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_type_name_at_Object, function_abort_at_Object, function_out_string_at_IO, dummy, function_in_string_at_IO, dummy, function_copy_at_Object, dummy, dummy, dummy, function_out_int_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word function_type_name_at_Object, function_abort_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word function_type_name_at_Object, function_abort_at_Object, dummy, function_length_at_String, dummy, function_concat_at_String, function_copy_at_Object, dummy, dummy, function_substr_at_String, dummy, dummy +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word function_type_name_at_Object, function_abort_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word function_type_name_at_Object, function_abort_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_type_name_at_Object, function_abort_at_Object, function_out_string_at_IO, dummy, function_in_string_at_IO, dummy, function_copy_at_Object, function_pal_at_Main, function_main_at_Main, dummy, function_out_int_at_IO, function_in_int_at_IO +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "enter a string\n" +# + + +data_5: .asciiz "that was a palindrome\n" +# + + +data_6: .asciiz "that was not a palindrome\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + lb $t3, 0($t1) + beqz $t3, end_loop + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + end_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__i__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 32($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__i__init implementation. +# @Params: +__Main__attrib__i__init: + # Allocate stack frame for function __Main__attrib__i__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__i__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__i__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__i__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_pal_at_Main implementation. +# @Params: +# 0($fp) = param_pal_at_Main_s_0 +function_pal_at_Main: + # Allocate stack frame for function function_pal_at_Main. + subu $sp, $sp, 176 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 176 + # LOCAL local_pal_at_Main_internal_4 --> -20($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_4 = PARAM param_pal_at_Main_s_0 + lw $t0, 0($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_4 --> -20($fp) + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # local_pal_at_Main_internal_5 = VCALL local_pal_at_Main_internal_4 length + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -28($fp) + # IF_ZERO local_pal_at_Main_internal_5 GOTO label_FALSE_3 + # IF_ZERO local_pal_at_Main_internal_5 GOTO label_FALSE_3 + lw $t0, -24($fp) + beq $t0, 0, label_FALSE_3 + # IF_ZERO local_pal_at_Main_internal_6 GOTO label_FALSE_3 + # IF_ZERO local_pal_at_Main_internal_6 GOTO label_FALSE_3 + lw $t0, -28($fp) + beq $t0, 0, label_FALSE_3 + # LOCAL local_pal_at_Main_internal_3 --> -16($fp) + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # Comparing -24($fp) type with String + la $v0, String + lw $a0, -24($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_COMPARE_STRING_6 + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_COMPARE_STRING_6 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_STRING_6 + # LOCAL local_pal_at_Main_internal_3 --> -16($fp) + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # Comparing -24($fp) type with Bool + la $v0, Bool + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_COMPARE_BY_VALUE_7 + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_COMPARE_BY_VALUE_7 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_7 + # LOCAL local_pal_at_Main_internal_3 --> -16($fp) + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # Comparing -24($fp) type with Int + la $v0, Int + lw $a0, -24($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -16($fp) + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_COMPARE_BY_VALUE_7 + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_COMPARE_BY_VALUE_7 + lw $t0, -16($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_7 + # LOCAL local_pal_at_Main_internal_3 --> -16($fp) + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + # Load pointers and SUB + lw $a0, -24($fp) + lw $a1, -28($fp) + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_TRUE_4 + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_TRUE_4 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_4 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_COMPARE_BY_VALUE_7: + # LOCAL local_pal_at_Main_internal_3 --> -16($fp) + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + lw $a0, -24($fp) + lw $a1, -28($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -16($fp) + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_TRUE_4 + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_TRUE_4 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_4 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_COMPARE_STRING_6: + # LOCAL local_pal_at_Main_internal_3 --> -16($fp) + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -28($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -16($fp) + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_CONTINUE_8 + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_CONTINUE_8 + lw $t0, -16($fp) + beq $t0, 0, label_CONTINUE_8 + # GOTO label_FALSE_3 + j label_FALSE_3 + label_CONTINUE_8: + # LOCAL local_pal_at_Main_internal_3 --> -16($fp) + # LOCAL local_pal_at_Main_internal_5 --> -24($fp) + # LOCAL local_pal_at_Main_internal_6 --> -28($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -24($fp) + lw $v1, -28($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_9: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_10 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_9 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_10: + # Store result + sw $a2, -16($fp) + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_TRUE_4 + # IF_ZERO local_pal_at_Main_internal_3 GOTO label_TRUE_4 + lw $t0, -16($fp) + beq $t0, 0, label_TRUE_4 + label_FALSE_3: + # LOCAL local_pal_at_Main_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_5 +j label_END_5 +label_TRUE_4: + # LOCAL local_pal_at_Main_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_5: +# LOCAL local_pal_at_Main_internal_0 --> -4($fp) +# LOCAL local_pal_at_Main_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_pal_at_Main_internal_0 GOTO label_FALSEIF_1 +# IF_ZERO local_pal_at_Main_internal_0 GOTO label_FALSEIF_1 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_1 +# LOCAL local_pal_at_Main_internal_7 --> -32($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -32($fp) +# LOCAL local_pal_at_Main_internal_1 --> -8($fp) +# LOCAL local_pal_at_Main_internal_7 --> -32($fp) +# local_pal_at_Main_internal_1 = local_pal_at_Main_internal_7 +lw $t0, -32($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_2 +j label_ENDIF_2 +label_FALSEIF_1: + # LOCAL local_pal_at_Main_internal_12 --> -52($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_12 = PARAM param_pal_at_Main_s_0 + lw $t0, 0($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_12 --> -52($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # local_pal_at_Main_internal_13 = VCALL local_pal_at_Main_internal_12 length + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_14 --> -60($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -60($fp) + # IF_ZERO local_pal_at_Main_internal_13 GOTO label_FALSE_13 + # IF_ZERO local_pal_at_Main_internal_13 GOTO label_FALSE_13 + lw $t0, -56($fp) + beq $t0, 0, label_FALSE_13 + # IF_ZERO local_pal_at_Main_internal_14 GOTO label_FALSE_13 + # IF_ZERO local_pal_at_Main_internal_14 GOTO label_FALSE_13 + lw $t0, -60($fp) + beq $t0, 0, label_FALSE_13 + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # Comparing -56($fp) type with String + la $v0, String + lw $a0, -56($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_COMPARE_STRING_16 + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_COMPARE_STRING_16 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_STRING_16 + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # Comparing -56($fp) type with Bool + la $v0, Bool + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_COMPARE_BY_VALUE_17 + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_COMPARE_BY_VALUE_17 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_17 + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # Comparing -56($fp) type with Int + la $v0, Int + lw $a0, -56($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -48($fp) + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_COMPARE_BY_VALUE_17 + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_COMPARE_BY_VALUE_17 + lw $t0, -48($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_17 + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # LOCAL local_pal_at_Main_internal_14 --> -60($fp) + # Load pointers and SUB + lw $a0, -56($fp) + lw $a1, -60($fp) + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_14 + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_14 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_14 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_COMPARE_BY_VALUE_17: + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # LOCAL local_pal_at_Main_internal_14 --> -60($fp) + lw $a0, -56($fp) + lw $a1, -60($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -48($fp) + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_14 + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_14 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_14 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_COMPARE_STRING_16: + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # LOCAL local_pal_at_Main_internal_14 --> -60($fp) + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -60($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -48($fp) + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_CONTINUE_18 + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_CONTINUE_18 + lw $t0, -48($fp) + beq $t0, 0, label_CONTINUE_18 + # GOTO label_FALSE_13 + j label_FALSE_13 + label_CONTINUE_18: + # LOCAL local_pal_at_Main_internal_11 --> -48($fp) + # LOCAL local_pal_at_Main_internal_13 --> -56($fp) + # LOCAL local_pal_at_Main_internal_14 --> -60($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -56($fp) + lw $v1, -60($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_19: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_20 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_19 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_20: + # Store result + sw $a2, -48($fp) + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_14 + # IF_ZERO local_pal_at_Main_internal_11 GOTO label_TRUE_14 + lw $t0, -48($fp) + beq $t0, 0, label_TRUE_14 + label_FALSE_13: + # LOCAL local_pal_at_Main_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -44($fp) + # GOTO label_END_15 +j label_END_15 +label_TRUE_14: + # LOCAL local_pal_at_Main_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + label_END_15: +# LOCAL local_pal_at_Main_internal_8 --> -36($fp) +# LOCAL local_pal_at_Main_internal_10 --> -44($fp) +# Obtain value from -44($fp) +lw $v0, -44($fp) +lw $v0, 12($v0) +sw $v0, -36($fp) +# IF_ZERO local_pal_at_Main_internal_8 GOTO label_FALSEIF_11 +# IF_ZERO local_pal_at_Main_internal_8 GOTO label_FALSEIF_11 +lw $t0, -36($fp) +beq $t0, 0, label_FALSEIF_11 +# LOCAL local_pal_at_Main_internal_15 --> -64($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -64($fp) +# LOCAL local_pal_at_Main_internal_9 --> -40($fp) +# LOCAL local_pal_at_Main_internal_15 --> -64($fp) +# local_pal_at_Main_internal_9 = local_pal_at_Main_internal_15 +lw $t0, -64($fp) +sw $t0, -40($fp) +# GOTO label_ENDIF_12 +j label_ENDIF_12 +label_FALSEIF_11: + # LOCAL local_pal_at_Main_internal_20 --> -84($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_20 = PARAM param_pal_at_Main_s_0 + lw $t0, 0($fp) + sw $t0, -84($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_22 --> -92($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -92($fp) + # ARG local_pal_at_Main_internal_22 + # LOCAL local_pal_at_Main_internal_22 --> -92($fp) + lw $t0, -92($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_pal_at_Main_internal_23 --> -96($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -96($fp) + # ARG local_pal_at_Main_internal_23 + # LOCAL local_pal_at_Main_internal_23 --> -96($fp) + lw $t0, -96($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_pal_at_Main_internal_20 --> -84($fp) + # LOCAL local_pal_at_Main_internal_21 --> -88($fp) + # local_pal_at_Main_internal_21 = VCALL local_pal_at_Main_internal_20 substr + # Save new self pointer in $s1 + lw $s1, -84($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 36($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -88($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_24 --> -100($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_24 = PARAM param_pal_at_Main_s_0 + lw $t0, 0($fp) + sw $t0, -100($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_27 --> -112($fp) + # PARAM param_pal_at_Main_s_0 --> 0($fp) + # local_pal_at_Main_internal_27 = PARAM param_pal_at_Main_s_0 + lw $t0, 0($fp) + sw $t0, -112($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_pal_at_Main_internal_27 --> -112($fp) + # LOCAL local_pal_at_Main_internal_28 --> -116($fp) + # local_pal_at_Main_internal_28 = VCALL local_pal_at_Main_internal_27 length + # Save new self pointer in $s1 + lw $s1, -112($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -116($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_pal_at_Main_internal_29 --> -120($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -120($fp) + # LOCAL local_pal_at_Main_internal_26 --> -108($fp) + # LOCAL local_pal_at_Main_internal_28 --> -116($fp) + # LOCAL local_pal_at_Main_internal_29 --> -120($fp) + # local_pal_at_Main_internal_26 = local_pal_at_Main_internal_28 - local_pal_at_Main_internal_29 + lw $t1, -116($fp) + lw $t0, 12($t1) + lw $t1, -120($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -108($fp) + # ARG local_pal_at_Main_internal_26 + # LOCAL local_pal_at_Main_internal_26 --> -108($fp) + lw $t0, -108($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_pal_at_Main_internal_30 --> -124($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -124($fp) + # ARG local_pal_at_Main_internal_30 + # LOCAL local_pal_at_Main_internal_30 --> -124($fp) + lw $t0, -124($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_pal_at_Main_internal_24 --> -100($fp) + # LOCAL local_pal_at_Main_internal_25 --> -104($fp) + # local_pal_at_Main_internal_25 = VCALL local_pal_at_Main_internal_24 substr + # Save new self pointer in $s1 + lw $s1, -100($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 36($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -104($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # IF_ZERO local_pal_at_Main_internal_21 GOTO label_FALSE_23 + # IF_ZERO local_pal_at_Main_internal_21 GOTO label_FALSE_23 + lw $t0, -88($fp) + beq $t0, 0, label_FALSE_23 + # IF_ZERO local_pal_at_Main_internal_25 GOTO label_FALSE_23 + # IF_ZERO local_pal_at_Main_internal_25 GOTO label_FALSE_23 + lw $t0, -104($fp) + beq $t0, 0, label_FALSE_23 + # LOCAL local_pal_at_Main_internal_19 --> -80($fp) + # LOCAL local_pal_at_Main_internal_21 --> -88($fp) + # Comparing -88($fp) type with String + la $v0, String + lw $a0, -88($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_COMPARE_STRING_26 + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_COMPARE_STRING_26 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_STRING_26 + # LOCAL local_pal_at_Main_internal_19 --> -80($fp) + # LOCAL local_pal_at_Main_internal_21 --> -88($fp) + # Comparing -88($fp) type with Bool + la $v0, Bool + lw $a0, -88($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_COMPARE_BY_VALUE_27 + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_COMPARE_BY_VALUE_27 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_27 + # LOCAL local_pal_at_Main_internal_19 --> -80($fp) + # LOCAL local_pal_at_Main_internal_21 --> -88($fp) + # Comparing -88($fp) type with Int + la $v0, Int + lw $a0, -88($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_COMPARE_BY_VALUE_27 + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_COMPARE_BY_VALUE_27 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_27 + # LOCAL local_pal_at_Main_internal_19 --> -80($fp) + # LOCAL local_pal_at_Main_internal_21 --> -88($fp) + # LOCAL local_pal_at_Main_internal_25 --> -104($fp) + # Load pointers and SUB + lw $a0, -88($fp) + lw $a1, -104($fp) + sub $a0, $a0, $a1 + sw $a0, -80($fp) + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_TRUE_24 + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_TRUE_24 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_24 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_COMPARE_BY_VALUE_27: + # LOCAL local_pal_at_Main_internal_19 --> -80($fp) + # LOCAL local_pal_at_Main_internal_21 --> -88($fp) + # LOCAL local_pal_at_Main_internal_25 --> -104($fp) + lw $a0, -88($fp) + lw $a1, -104($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -80($fp) + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_TRUE_24 + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_TRUE_24 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_24 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_COMPARE_STRING_26: + # LOCAL local_pal_at_Main_internal_19 --> -80($fp) + # LOCAL local_pal_at_Main_internal_21 --> -88($fp) + # LOCAL local_pal_at_Main_internal_25 --> -104($fp) + # Load strings for comparison + lw $v0, -88($fp) + lw $v1, -104($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -80($fp) + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_CONTINUE_28 + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_CONTINUE_28 + lw $t0, -80($fp) + beq $t0, 0, label_CONTINUE_28 + # GOTO label_FALSE_23 + j label_FALSE_23 + label_CONTINUE_28: + # LOCAL local_pal_at_Main_internal_19 --> -80($fp) + # LOCAL local_pal_at_Main_internal_21 --> -88($fp) + # LOCAL local_pal_at_Main_internal_25 --> -104($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -88($fp) + lw $v1, -104($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_29: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_30 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_29 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_30: + # Store result + sw $a2, -80($fp) + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_TRUE_24 + # IF_ZERO local_pal_at_Main_internal_19 GOTO label_TRUE_24 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_24 + label_FALSE_23: + # LOCAL local_pal_at_Main_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -76($fp) + # GOTO label_END_25 +j label_END_25 +label_TRUE_24: + # LOCAL local_pal_at_Main_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -76($fp) + label_END_25: +# LOCAL local_pal_at_Main_internal_16 --> -68($fp) +# LOCAL local_pal_at_Main_internal_18 --> -76($fp) +# Obtain value from -76($fp) +lw $v0, -76($fp) +lw $v0, 12($v0) +sw $v0, -68($fp) +# IF_ZERO local_pal_at_Main_internal_16 GOTO label_FALSEIF_21 +# IF_ZERO local_pal_at_Main_internal_16 GOTO label_FALSEIF_21 +lw $t0, -68($fp) +beq $t0, 0, label_FALSEIF_21 +# LOCAL local_pal_at_Main_internal_33 --> -136($fp) +# local_pal_at_Main_internal_33 = SELF +sw $s1, -136($fp) +# LOCAL local_pal_at_Main_internal_31 --> -128($fp) +# LOCAL local_pal_at_Main_internal_33 --> -136($fp) +# local_pal_at_Main_internal_31 = local_pal_at_Main_internal_33 +lw $t0, -136($fp) +sw $t0, -128($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_pal_at_Main_internal_34 --> -140($fp) +# PARAM param_pal_at_Main_s_0 --> 0($fp) +# local_pal_at_Main_internal_34 = PARAM param_pal_at_Main_s_0 +lw $t0, 0($fp) +sw $t0, -140($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_pal_at_Main_internal_36 --> -148($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -148($fp) +# ARG local_pal_at_Main_internal_36 +# LOCAL local_pal_at_Main_internal_36 --> -148($fp) +lw $t0, -148($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_pal_at_Main_internal_38 --> -156($fp) +# PARAM param_pal_at_Main_s_0 --> 0($fp) +# local_pal_at_Main_internal_38 = PARAM param_pal_at_Main_s_0 +lw $t0, 0($fp) +sw $t0, -156($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_pal_at_Main_internal_38 --> -156($fp) +# LOCAL local_pal_at_Main_internal_39 --> -160($fp) +# local_pal_at_Main_internal_39 = VCALL local_pal_at_Main_internal_38 length +# Save new self pointer in $s1 +lw $s1, -156($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -160($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_pal_at_Main_internal_40 --> -164($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 2 +sw $t0, 12($v0) +sw $v0, -164($fp) +# LOCAL local_pal_at_Main_internal_37 --> -152($fp) +# LOCAL local_pal_at_Main_internal_39 --> -160($fp) +# LOCAL local_pal_at_Main_internal_40 --> -164($fp) +# local_pal_at_Main_internal_37 = local_pal_at_Main_internal_39 - local_pal_at_Main_internal_40 +lw $t1, -160($fp) +lw $t0, 12($t1) +lw $t1, -164($fp) +lw $t2, 12($t1) +sub $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -152($fp) +# ARG local_pal_at_Main_internal_37 +# LOCAL local_pal_at_Main_internal_37 --> -152($fp) +lw $t0, -152($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_pal_at_Main_internal_34 --> -140($fp) +# LOCAL local_pal_at_Main_internal_35 --> -144($fp) +# local_pal_at_Main_internal_35 = VCALL local_pal_at_Main_internal_34 substr +# Save new self pointer in $s1 +lw $s1, -140($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 36($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -144($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_pal_at_Main_internal_35 +# LOCAL local_pal_at_Main_internal_35 --> -144($fp) +lw $t0, -144($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_pal_at_Main_internal_31 --> -128($fp) +# LOCAL local_pal_at_Main_internal_32 --> -132($fp) +# local_pal_at_Main_internal_32 = VCALL local_pal_at_Main_internal_31 pal +# Save new self pointer in $s1 +lw $s1, -128($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 28($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -132($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_pal_at_Main_internal_17 --> -72($fp) +# LOCAL local_pal_at_Main_internal_32 --> -132($fp) +# local_pal_at_Main_internal_17 = local_pal_at_Main_internal_32 +lw $t0, -132($fp) +sw $t0, -72($fp) +# GOTO label_ENDIF_22 +j label_ENDIF_22 +label_FALSEIF_21: + # LOCAL local_pal_at_Main_internal_41 --> -168($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -168($fp) + # LOCAL local_pal_at_Main_internal_17 --> -72($fp) + # LOCAL local_pal_at_Main_internal_41 --> -168($fp) + # local_pal_at_Main_internal_17 = local_pal_at_Main_internal_41 + lw $t0, -168($fp) + sw $t0, -72($fp) + label_ENDIF_22: +# LOCAL local_pal_at_Main_internal_9 --> -40($fp) +# LOCAL local_pal_at_Main_internal_17 --> -72($fp) +# local_pal_at_Main_internal_9 = local_pal_at_Main_internal_17 +lw $t0, -72($fp) +sw $t0, -40($fp) +label_ENDIF_12: +# LOCAL local_pal_at_Main_internal_1 --> -8($fp) +# LOCAL local_pal_at_Main_internal_9 --> -40($fp) +# local_pal_at_Main_internal_1 = local_pal_at_Main_internal_9 +lw $t0, -40($fp) +sw $t0, -8($fp) +label_ENDIF_2: +# RETURN local_pal_at_Main_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_pal_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 176 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 96 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 96 + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + lw $t0, -8($fp) + lw $t0, 12($t0) + not $t0, $t0 + add $t0, $t0, 1 + sw $t0, -4($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -4($fp) + # + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + lw $t0, -4($fp) + sw $t0, 12($s1) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 15 + sw $t0, 16($v0) + sw $v0, -24($fp) + # ARG local_main_at_Main_internal_5 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 8($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = SELF + sw $s1, -44($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_8 = local_main_at_Main_internal_10 + lw $t0, -44($fp) + sw $t0, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_13 = SELF + sw $s1, -56($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # local_main_at_Main_internal_11 = local_main_at_Main_internal_13 + lw $t0, -56($fp) + sw $t0, -48($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = VCALL local_main_at_Main_internal_11 in_string + # Save new self pointer in $s1 + lw $s1, -48($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -52($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_12 + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + lw $t0, -52($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 pal + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # Obtain value from -40($fp) + lw $v0, -40($fp) + lw $v0, 12($v0) + sw $v0, -28($fp) + # IF_ZERO local_main_at_Main_internal_6 GOTO label_FALSEIF_31 + # IF_ZERO local_main_at_Main_internal_6 GOTO label_FALSEIF_31 + lw $t0, -28($fp) + beq $t0, 0, label_FALSEIF_31 + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_16 = SELF + sw $s1, -68($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # local_main_at_Main_internal_14 = local_main_at_Main_internal_16 + lw $t0, -68($fp) + sw $t0, -60($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 22 + sw $t0, 16($v0) + sw $v0, -72($fp) + # ARG local_main_at_Main_internal_17 + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + lw $t0, -72($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 out_string + # Save new self pointer in $s1 + lw $s1, -60($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 8($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -64($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_15 + lw $t0, -64($fp) + sw $t0, -32($fp) + # GOTO label_ENDIF_32 +j label_ENDIF_32 +label_FALSEIF_31: + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_20 = SELF + sw $s1, -84($fp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_20 --> -84($fp) + # local_main_at_Main_internal_18 = local_main_at_Main_internal_20 + lw $t0, -84($fp) + sw $t0, -76($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_6 + sw $t0, 12($v0) + li $t0, 26 + sw $t0, 16($v0) + sw $v0, -88($fp) + # ARG local_main_at_Main_internal_21 + # LOCAL local_main_at_Main_internal_21 --> -88($fp) + lw $t0, -88($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_18 --> -76($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 out_string + # Save new self pointer in $s1 + lw $s1, -76($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 8($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -80($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_19 --> -80($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_19 + lw $t0, -80($fp) + sw $t0, -32($fp) + label_ENDIF_32: +# RETURN local_main_at_Main_internal_7 +lw $v0, -32($fp) +# Deallocate stack frame for function function_main_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 96 +jr $ra +# Function END + diff --git a/tests/codegen/primes.mips b/tests/codegen/primes.mips new file mode 100644 index 00000000..4aa875b1 --- /dev/null +++ b/tests/codegen/primes.mips @@ -0,0 +1,2374 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:04 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_in_int_at_IO, dummy, dummy, function_abort_at_Object, function_in_string_at_IO, function_copy_at_Object, function_out_int_at_IO, dummy, dummy, function_type_name_at_Object, function_out_string_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word dummy, function_length_at_String, function_substr_at_String, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, function_concat_at_String, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_in_int_at_IO, dummy, dummy, function_abort_at_Object, function_in_string_at_IO, function_copy_at_Object, function_out_int_at_IO, function_main_at_Main, dummy, function_type_name_at_Object, function_out_string_at_IO +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "2 is trivially prime.\n" +# + + +data_5: .asciiz " is prime.\n" +# + + +data_6: .asciiz "halt" +# + + +data_7: .asciiz "continue" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + lb $t3, 0($t1) + beqz $t3, end_loop + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + end_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 32 bytes of memory + li $a0, 32 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__out__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__testee__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__divisor__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 20($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__stop__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 24($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__m__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 28($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 28($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__out__init implementation. +# @Params: +__Main__attrib__out__init: + # Allocate stack frame for function __Main__attrib__out__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__out__init_internal_3 --> -16($fp) + # local_ttrib__out__init_internal_3 = SELF + sw $s1, -16($fp) + # LOCAL local_ttrib__out__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__out__init_internal_3 --> -16($fp) + # local_ttrib__out__init_internal_1 = local_ttrib__out__init_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_ttrib__out__init_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 22 + sw $t0, 16($v0) + sw $v0, -20($fp) + # ARG local_ttrib__out__init_internal_4 + # LOCAL local_ttrib__out__init_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_ttrib__out__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__out__init_internal_2 --> -12($fp) + # local_ttrib__out__init_internal_2 = VCALL local_ttrib__out__init_internal_1 out_string + # Save new self pointer in $s1 + lw $s1, -8($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -12($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_ttrib__out__init_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 2 + sw $t0, 12($v0) + sw $v0, -24($fp) + # RETURN local_ttrib__out__init_internal_5 + lw $v0, -24($fp) + # Deallocate stack frame for function __Main__attrib__out__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__testee__init implementation. +# @Params: +__Main__attrib__testee__init: + # Allocate stack frame for function __Main__attrib__testee__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_ttrib__testee__init_internal_1 = GETATTRIBUTE out Main + # LOCAL local_ttrib__testee__init_internal_1 --> -8($fp) + lw $t0, 12($s1) + sw $t0, -8($fp) + # RETURN local_ttrib__testee__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Main__attrib__testee__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__divisor__init implementation. +# @Params: +__Main__attrib__divisor__init: + # Allocate stack frame for function __Main__attrib__divisor__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__divisor__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__divisor__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Main__attrib__divisor__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__stop__init implementation. +# @Params: +__Main__attrib__stop__init: + # Allocate stack frame for function __Main__attrib__stop__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__stop__init_internal_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 500 + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_ttrib__stop__init_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function __Main__attrib__stop__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__m__init implementation. +# @Params: +__Main__attrib__m__init: + # Allocate stack frame for function __Main__attrib__m__init. + subu $sp, $sp, 244 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 244 + label_WHILE_1: + # LOCAL local_ttrib__m__init_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_ttrib__m__init_internal_1 --> -8($fp) + # LOCAL local_ttrib__m__init_internal_2 --> -12($fp) + # Obtain value from -12($fp) + lw $v0, -12($fp) + lw $v0, 12($v0) + sw $v0, -8($fp) + # IF_ZERO local_ttrib__m__init_internal_1 GOTO label_WHILE_END_2 + # IF_ZERO local_ttrib__m__init_internal_1 GOTO label_WHILE_END_2 + lw $t0, -8($fp) + beq $t0, 0, label_WHILE_END_2 + # local_ttrib__m__init_internal_4 = GETATTRIBUTE testee Main + # LOCAL local_ttrib__m__init_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # LOCAL local_ttrib__m__init_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -24($fp) + # LOCAL local_ttrib__m__init_internal_3 --> -16($fp) + # LOCAL local_ttrib__m__init_internal_4 --> -20($fp) + # LOCAL local_ttrib__m__init_internal_5 --> -24($fp) + # local_ttrib__m__init_internal_3 = local_ttrib__m__init_internal_4 + local_ttrib__m__init_internal_5 + lw $t1, -20($fp) + lw $t0, 12($t1) + lw $t1, -24($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -16($fp) + # + # LOCAL local_ttrib__m__init_internal_3 --> -16($fp) + lw $t0, -16($fp) + sw $t0, 16($s1) + # LOCAL local_ttrib__m__init_internal_6 --> -28($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 2 + sw $t0, 12($v0) + sw $v0, -28($fp) + # + # LOCAL local_ttrib__m__init_internal_6 --> -28($fp) + lw $t0, -28($fp) + sw $t0, 20($s1) + label_WHILE_3: + # local_ttrib__m__init_internal_11 = GETATTRIBUTE testee Main + # LOCAL local_ttrib__m__init_internal_11 --> -48($fp) + lw $t0, 16($s1) + sw $t0, -48($fp) + # local_ttrib__m__init_internal_13 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_13 --> -56($fp) + lw $t0, 20($s1) + sw $t0, -56($fp) + # local_ttrib__m__init_internal_14 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_14 --> -60($fp) + lw $t0, 20($s1) + sw $t0, -60($fp) + # LOCAL local_ttrib__m__init_internal_12 --> -52($fp) + # LOCAL local_ttrib__m__init_internal_13 --> -56($fp) + # LOCAL local_ttrib__m__init_internal_14 --> -60($fp) + # local_ttrib__m__init_internal_12 = local_ttrib__m__init_internal_13 * local_ttrib__m__init_internal_14 + lw $t1, -56($fp) + lw $t0, 12($t1) + lw $t1, -60($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -52($fp) + # LOCAL local_ttrib__m__init_internal_10 --> -44($fp) + # LOCAL local_ttrib__m__init_internal_11 --> -48($fp) + # LOCAL local_ttrib__m__init_internal_12 --> -52($fp) + lw $a0, -48($fp) + lw $a1, -52($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -44($fp) + # IF_GREATER_ZERO local_ttrib__m__init_internal_10 GOTO label_FALSE_7 + # IF_GREATER_ZERO local_ttrib__m__init_internal_10 GOTO label_FALSE_7 + lw $t0, -44($fp) + bgt $t0, 0, label_FALSE_7 + # IF_ZERO local_ttrib__m__init_internal_10 GOTO label_FALSE_7 + # IF_ZERO local_ttrib__m__init_internal_10 GOTO label_FALSE_7 + lw $t0, -44($fp) + beq $t0, 0, label_FALSE_7 + # LOCAL local_ttrib__m__init_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -44($fp) + # GOTO label_END_8 +j label_END_8 +label_FALSE_7: + # LOCAL local_ttrib__m__init_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -44($fp) + label_END_8: +# LOCAL local_ttrib__m__init_internal_8 --> -36($fp) +# LOCAL local_ttrib__m__init_internal_10 --> -44($fp) +# Obtain value from -44($fp) +lw $v0, -44($fp) +lw $v0, 12($v0) +sw $v0, -36($fp) +# IF_ZERO local_ttrib__m__init_internal_8 GOTO label_FALSEIF_5 +# IF_ZERO local_ttrib__m__init_internal_8 GOTO label_FALSEIF_5 +lw $t0, -36($fp) +beq $t0, 0, label_FALSEIF_5 +# LOCAL local_ttrib__m__init_internal_15 --> -64($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -64($fp) +# LOCAL local_ttrib__m__init_internal_9 --> -40($fp) +# LOCAL local_ttrib__m__init_internal_15 --> -64($fp) +# local_ttrib__m__init_internal_9 = local_ttrib__m__init_internal_15 +lw $t0, -64($fp) +sw $t0, -40($fp) +# GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # local_ttrib__m__init_internal_21 = GETATTRIBUTE testee Main + # LOCAL local_ttrib__m__init_internal_21 --> -88($fp) + lw $t0, 16($s1) + sw $t0, -88($fp) + # local_ttrib__m__init_internal_23 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_23 --> -96($fp) + lw $t0, 20($s1) + sw $t0, -96($fp) + # local_ttrib__m__init_internal_25 = GETATTRIBUTE testee Main + # LOCAL local_ttrib__m__init_internal_25 --> -104($fp) + lw $t0, 16($s1) + sw $t0, -104($fp) + # local_ttrib__m__init_internal_26 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_26 --> -108($fp) + lw $t0, 20($s1) + sw $t0, -108($fp) + # LOCAL local_ttrib__m__init_internal_24 --> -100($fp) + # LOCAL local_ttrib__m__init_internal_25 --> -104($fp) + # LOCAL local_ttrib__m__init_internal_26 --> -108($fp) + # local_ttrib__m__init_internal_24 = local_ttrib__m__init_internal_25 / local_ttrib__m__init_internal_26 + lw $t1, -104($fp) + lw $t0, 12($t1) + lw $t1, -108($fp) + lw $t2, 12($t1) + div $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -100($fp) + # LOCAL local_ttrib__m__init_internal_22 --> -92($fp) + # LOCAL local_ttrib__m__init_internal_23 --> -96($fp) + # LOCAL local_ttrib__m__init_internal_24 --> -100($fp) + # local_ttrib__m__init_internal_22 = local_ttrib__m__init_internal_23 * local_ttrib__m__init_internal_24 + lw $t1, -96($fp) + lw $t0, 12($t1) + lw $t1, -100($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -92($fp) + # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) + # LOCAL local_ttrib__m__init_internal_21 --> -88($fp) + # LOCAL local_ttrib__m__init_internal_22 --> -92($fp) + # local_ttrib__m__init_internal_20 = local_ttrib__m__init_internal_21 - local_ttrib__m__init_internal_22 + lw $t1, -88($fp) + lw $t0, 12($t1) + lw $t1, -92($fp) + lw $t2, 12($t1) + sub $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -84($fp) + # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -112($fp) + # IF_ZERO local_ttrib__m__init_internal_20 GOTO label_FALSE_11 + # IF_ZERO local_ttrib__m__init_internal_20 GOTO label_FALSE_11 + lw $t0, -84($fp) + beq $t0, 0, label_FALSE_11 + # IF_ZERO local_ttrib__m__init_internal_27 GOTO label_FALSE_11 + # IF_ZERO local_ttrib__m__init_internal_27 GOTO label_FALSE_11 + lw $t0, -112($fp) + beq $t0, 0, label_FALSE_11 + # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) + # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) + # Comparing -84($fp) type with String + la $v0, String + lw $a0, -84($fp) + lw $a0, 0($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_COMPARE_STRING_14 + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_COMPARE_STRING_14 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_STRING_14 + # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) + # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) + # Comparing -84($fp) type with Bool + la $v0, Bool + lw $a0, -84($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_COMPARE_BY_VALUE_15 + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_COMPARE_BY_VALUE_15 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_15 + # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) + # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) + # Comparing -84($fp) type with Int + la $v0, Int + lw $a0, -84($fp) + lw $a0, 0($a0) + lw $a0, 12($a0) + sub $a0, $a0, $v0 + sw $a0, -80($fp) + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_COMPARE_BY_VALUE_15 + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_COMPARE_BY_VALUE_15 + lw $t0, -80($fp) + beq $t0, 0, label_COMPARE_BY_VALUE_15 + # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) + # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) + # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) + # Load pointers and SUB + lw $a0, -84($fp) + lw $a1, -112($fp) + sub $a0, $a0, $a1 + sw $a0, -80($fp) + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_TRUE_12 + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_TRUE_12 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_12 + # GOTO label_FALSE_11 + j label_FALSE_11 + label_COMPARE_BY_VALUE_15: + # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) + # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) + # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) + lw $a0, -84($fp) + lw $a1, -112($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -80($fp) + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_TRUE_12 + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_TRUE_12 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_12 + # GOTO label_FALSE_11 + j label_FALSE_11 + label_COMPARE_STRING_14: + # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) + # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) + # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) + # Load strings for comparison + lw $v0, -84($fp) + lw $v1, -112($fp) + # Compare lengths + lw $v0, 16($v0) + lw $v1, 16($v1) + sub $v0, $v0, $v1 + sw $v0, -80($fp) + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_CONTINUE_16 + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_CONTINUE_16 + lw $t0, -80($fp) + beq $t0, 0, label_CONTINUE_16 + # GOTO label_FALSE_11 + j label_FALSE_11 + label_CONTINUE_16: + # LOCAL local_ttrib__m__init_internal_19 --> -80($fp) + # LOCAL local_ttrib__m__init_internal_20 --> -84($fp) + # LOCAL local_ttrib__m__init_internal_27 --> -112($fp) + move $a2, $zero + # Load strings for comparison + lw $v0, -84($fp) + lw $v1, -112($fp) + # Load strings pointers + lw $v0, 12($v0) + lw $v1, 12($v1) + # Compare loop, while [v0] != \0 + label_WHILE_STR_COMP_17: + lb $a0, 0($v0) + # If EOS => break + beqz $a0, label_WHILE_STR_COMP_END_18 + lb $a1, 0($v1) + # Move strings pointers + addu $v0, $v0, 1 + addu $v1, $v1, 1 + # Compare chars + sub $a0, $a0, $a1 + beqz $a0, label_WHILE_STR_COMP_17 + # False + li $a2, 1 + label_WHILE_STR_COMP_END_18: + # Store result + sw $a2, -80($fp) + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_TRUE_12 + # IF_ZERO local_ttrib__m__init_internal_19 GOTO label_TRUE_12 + lw $t0, -80($fp) + beq $t0, 0, label_TRUE_12 + label_FALSE_11: + # LOCAL local_ttrib__m__init_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -76($fp) + # GOTO label_END_13 +j label_END_13 +label_TRUE_12: + # LOCAL local_ttrib__m__init_internal_18 --> -76($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -76($fp) + label_END_13: +# LOCAL local_ttrib__m__init_internal_16 --> -68($fp) +# LOCAL local_ttrib__m__init_internal_18 --> -76($fp) +# Obtain value from -76($fp) +lw $v0, -76($fp) +lw $v0, 12($v0) +sw $v0, -68($fp) +# IF_ZERO local_ttrib__m__init_internal_16 GOTO label_FALSEIF_9 +# IF_ZERO local_ttrib__m__init_internal_16 GOTO label_FALSEIF_9 +lw $t0, -68($fp) +beq $t0, 0, label_FALSEIF_9 +# LOCAL local_ttrib__m__init_internal_28 --> -116($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 0 +sw $t0, 12($v0) +sw $v0, -116($fp) +# LOCAL local_ttrib__m__init_internal_17 --> -72($fp) +# LOCAL local_ttrib__m__init_internal_28 --> -116($fp) +# local_ttrib__m__init_internal_17 = local_ttrib__m__init_internal_28 +lw $t0, -116($fp) +sw $t0, -72($fp) +# GOTO label_ENDIF_10 +j label_ENDIF_10 +label_FALSEIF_9: + # LOCAL local_ttrib__m__init_internal_29 --> -120($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -120($fp) + # LOCAL local_ttrib__m__init_internal_17 --> -72($fp) + # LOCAL local_ttrib__m__init_internal_29 --> -120($fp) + # local_ttrib__m__init_internal_17 = local_ttrib__m__init_internal_29 + lw $t0, -120($fp) + sw $t0, -72($fp) + label_ENDIF_10: +# LOCAL local_ttrib__m__init_internal_9 --> -40($fp) +# LOCAL local_ttrib__m__init_internal_17 --> -72($fp) +# local_ttrib__m__init_internal_9 = local_ttrib__m__init_internal_17 +lw $t0, -72($fp) +sw $t0, -40($fp) +label_ENDIF_6: +# LOCAL local_ttrib__m__init_internal_7 --> -32($fp) +# LOCAL local_ttrib__m__init_internal_9 --> -40($fp) +# Obtain value from -40($fp) +lw $v0, -40($fp) +lw $v0, 12($v0) +sw $v0, -32($fp) +# IF_ZERO local_ttrib__m__init_internal_7 GOTO label_WHILE_END_4 +# IF_ZERO local_ttrib__m__init_internal_7 GOTO label_WHILE_END_4 +lw $t0, -32($fp) +beq $t0, 0, label_WHILE_END_4 +# local_ttrib__m__init_internal_31 = GETATTRIBUTE divisor Main +# LOCAL local_ttrib__m__init_internal_31 --> -128($fp) +lw $t0, 20($s1) +sw $t0, -128($fp) +# LOCAL local_ttrib__m__init_internal_32 --> -132($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -132($fp) +# LOCAL local_ttrib__m__init_internal_30 --> -124($fp) +# LOCAL local_ttrib__m__init_internal_31 --> -128($fp) +# LOCAL local_ttrib__m__init_internal_32 --> -132($fp) +# local_ttrib__m__init_internal_30 = local_ttrib__m__init_internal_31 + local_ttrib__m__init_internal_32 +lw $t1, -128($fp) +lw $t0, 12($t1) +lw $t1, -132($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -124($fp) +# +# LOCAL local_ttrib__m__init_internal_30 --> -124($fp) +lw $t0, -124($fp) +sw $t0, 20($s1) +# GOTO label_WHILE_3 +j label_WHILE_3 +label_WHILE_END_4: + # local_ttrib__m__init_internal_36 = GETATTRIBUTE testee Main + # LOCAL local_ttrib__m__init_internal_36 --> -148($fp) + lw $t0, 16($s1) + sw $t0, -148($fp) + # local_ttrib__m__init_internal_38 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_38 --> -156($fp) + lw $t0, 20($s1) + sw $t0, -156($fp) + # local_ttrib__m__init_internal_39 = GETATTRIBUTE divisor Main + # LOCAL local_ttrib__m__init_internal_39 --> -160($fp) + lw $t0, 20($s1) + sw $t0, -160($fp) + # LOCAL local_ttrib__m__init_internal_37 --> -152($fp) + # LOCAL local_ttrib__m__init_internal_38 --> -156($fp) + # LOCAL local_ttrib__m__init_internal_39 --> -160($fp) + # local_ttrib__m__init_internal_37 = local_ttrib__m__init_internal_38 * local_ttrib__m__init_internal_39 + lw $t1, -156($fp) + lw $t0, 12($t1) + lw $t1, -160($fp) + lw $t2, 12($t1) + mul $t0, $t0, $t2 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) + # Load type offset + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -152($fp) + # LOCAL local_ttrib__m__init_internal_35 --> -144($fp) + # LOCAL local_ttrib__m__init_internal_36 --> -148($fp) + # LOCAL local_ttrib__m__init_internal_37 --> -152($fp) + lw $a0, -148($fp) + lw $a1, -152($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -144($fp) + # IF_GREATER_ZERO local_ttrib__m__init_internal_35 GOTO label_FALSE_21 + # IF_GREATER_ZERO local_ttrib__m__init_internal_35 GOTO label_FALSE_21 + lw $t0, -144($fp) + bgt $t0, 0, label_FALSE_21 + # IF_ZERO local_ttrib__m__init_internal_35 GOTO label_FALSE_21 + # IF_ZERO local_ttrib__m__init_internal_35 GOTO label_FALSE_21 + lw $t0, -144($fp) + beq $t0, 0, label_FALSE_21 + # LOCAL local_ttrib__m__init_internal_35 --> -144($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -144($fp) + # GOTO label_END_22 +j label_END_22 +label_FALSE_21: + # LOCAL local_ttrib__m__init_internal_35 --> -144($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -144($fp) + label_END_22: +# LOCAL local_ttrib__m__init_internal_33 --> -136($fp) +# LOCAL local_ttrib__m__init_internal_35 --> -144($fp) +# Obtain value from -144($fp) +lw $v0, -144($fp) +lw $v0, 12($v0) +sw $v0, -136($fp) +# IF_ZERO local_ttrib__m__init_internal_33 GOTO label_FALSEIF_19 +# IF_ZERO local_ttrib__m__init_internal_33 GOTO label_FALSEIF_19 +lw $t0, -136($fp) +beq $t0, 0, label_FALSEIF_19 +# local_ttrib__m__init_internal_40 = GETATTRIBUTE testee Main +# LOCAL local_ttrib__m__init_internal_40 --> -164($fp) +lw $t0, 16($s1) +sw $t0, -164($fp) +# +# LOCAL local_ttrib__m__init_internal_40 --> -164($fp) +lw $t0, -164($fp) +sw $t0, 12($s1) +# LOCAL local_ttrib__m__init_internal_43 --> -176($fp) +# local_ttrib__m__init_internal_43 = SELF +sw $s1, -176($fp) +# LOCAL local_ttrib__m__init_internal_41 --> -168($fp) +# LOCAL local_ttrib__m__init_internal_43 --> -176($fp) +# local_ttrib__m__init_internal_41 = local_ttrib__m__init_internal_43 +lw $t0, -176($fp) +sw $t0, -168($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# local_ttrib__m__init_internal_44 = GETATTRIBUTE out Main +# LOCAL local_ttrib__m__init_internal_44 --> -180($fp) +lw $t0, 12($s1) +sw $t0, -180($fp) +# ARG local_ttrib__m__init_internal_44 +# LOCAL local_ttrib__m__init_internal_44 --> -180($fp) +lw $t0, -180($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_ttrib__m__init_internal_41 --> -168($fp) +# LOCAL local_ttrib__m__init_internal_42 --> -172($fp) +# local_ttrib__m__init_internal_42 = VCALL local_ttrib__m__init_internal_41 out_int +# Save new self pointer in $s1 +lw $s1, -168($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 24($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -172($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_ttrib__m__init_internal_47 --> -192($fp) +# local_ttrib__m__init_internal_47 = SELF +sw $s1, -192($fp) +# LOCAL local_ttrib__m__init_internal_45 --> -184($fp) +# LOCAL local_ttrib__m__init_internal_47 --> -192($fp) +# local_ttrib__m__init_internal_45 = local_ttrib__m__init_internal_47 +lw $t0, -192($fp) +sw $t0, -184($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_ttrib__m__init_internal_48 --> -196($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_5 +sw $t0, 12($v0) +li $t0, 11 +sw $t0, 16($v0) +sw $v0, -196($fp) +# ARG local_ttrib__m__init_internal_48 +# LOCAL local_ttrib__m__init_internal_48 --> -196($fp) +lw $t0, -196($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_ttrib__m__init_internal_45 --> -184($fp) +# LOCAL local_ttrib__m__init_internal_46 --> -188($fp) +# local_ttrib__m__init_internal_46 = VCALL local_ttrib__m__init_internal_45 out_string +# Save new self pointer in $s1 +lw $s1, -184($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 40($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -188($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_ttrib__m__init_internal_34 --> -140($fp) +# LOCAL local_ttrib__m__init_internal_46 --> -188($fp) +# local_ttrib__m__init_internal_34 = local_ttrib__m__init_internal_46 +lw $t0, -188($fp) +sw $t0, -140($fp) +# GOTO label_ENDIF_20 +j label_ENDIF_20 +label_FALSEIF_19: + # LOCAL local_ttrib__m__init_internal_49 --> -200($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -200($fp) + # LOCAL local_ttrib__m__init_internal_34 --> -140($fp) + # LOCAL local_ttrib__m__init_internal_49 --> -200($fp) + # local_ttrib__m__init_internal_34 = local_ttrib__m__init_internal_49 + lw $t0, -200($fp) + sw $t0, -140($fp) + label_ENDIF_20: +# local_ttrib__m__init_internal_53 = GETATTRIBUTE stop Main +# LOCAL local_ttrib__m__init_internal_53 --> -216($fp) +lw $t0, 24($s1) +sw $t0, -216($fp) +# local_ttrib__m__init_internal_54 = GETATTRIBUTE testee Main +# LOCAL local_ttrib__m__init_internal_54 --> -220($fp) +lw $t0, 16($s1) +sw $t0, -220($fp) +# LOCAL local_ttrib__m__init_internal_52 --> -212($fp) +# LOCAL local_ttrib__m__init_internal_53 --> -216($fp) +# LOCAL local_ttrib__m__init_internal_54 --> -220($fp) +lw $a0, -216($fp) +lw $a1, -220($fp) +# Load values +lw $a0, 12($a0) +lw $a1, 12($a1) +# SUB and store +sub $a0, $a0, $a1 +sw $a0, -212($fp) +# IF_GREATER_ZERO local_ttrib__m__init_internal_52 GOTO label_FALSE_25 +# IF_GREATER_ZERO local_ttrib__m__init_internal_52 GOTO label_FALSE_25 +lw $t0, -212($fp) +bgt $t0, 0, label_FALSE_25 +# LOCAL local_ttrib__m__init_internal_52 --> -212($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Bool +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Bool +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Bool_start +sw $t0, 4($v0) +# Load type offset +li $t0, 12 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -212($fp) +# GOTO label_END_26 +j label_END_26 +label_FALSE_25: + # LOCAL local_ttrib__m__init_internal_52 --> -212($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -212($fp) + label_END_26: +# LOCAL local_ttrib__m__init_internal_50 --> -204($fp) +# LOCAL local_ttrib__m__init_internal_52 --> -212($fp) +# Obtain value from -212($fp) +lw $v0, -212($fp) +lw $v0, 12($v0) +sw $v0, -204($fp) +# IF_ZERO local_ttrib__m__init_internal_50 GOTO label_FALSEIF_23 +# IF_ZERO local_ttrib__m__init_internal_50 GOTO label_FALSEIF_23 +lw $t0, -204($fp) +beq $t0, 0, label_FALSEIF_23 +# LOCAL local_ttrib__m__init_internal_57 --> -232($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_6 +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +sw $v0, -232($fp) +# LOCAL local_ttrib__m__init_internal_55 --> -224($fp) +# LOCAL local_ttrib__m__init_internal_57 --> -232($fp) +# local_ttrib__m__init_internal_55 = local_ttrib__m__init_internal_57 +lw $t0, -232($fp) +sw $t0, -224($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_ttrib__m__init_internal_55 --> -224($fp) +# LOCAL local_ttrib__m__init_internal_56 --> -228($fp) +# local_ttrib__m__init_internal_56 = VCALL local_ttrib__m__init_internal_55 abort +# Save new self pointer in $s1 +lw $s1, -224($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -228($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_ttrib__m__init_internal_51 --> -208($fp) +# LOCAL local_ttrib__m__init_internal_56 --> -228($fp) +# local_ttrib__m__init_internal_51 = local_ttrib__m__init_internal_56 +lw $t0, -228($fp) +sw $t0, -208($fp) +# GOTO label_ENDIF_24 +j label_ENDIF_24 +label_FALSEIF_23: + # LOCAL local_ttrib__m__init_internal_58 --> -236($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_7 + sw $t0, 12($v0) + li $t0, 8 + sw $t0, 16($v0) + sw $v0, -236($fp) + # LOCAL local_ttrib__m__init_internal_51 --> -208($fp) + # LOCAL local_ttrib__m__init_internal_58 --> -236($fp) + # local_ttrib__m__init_internal_51 = local_ttrib__m__init_internal_58 + lw $t0, -236($fp) + sw $t0, -208($fp) + label_ENDIF_24: +# GOTO label_WHILE_1 +j label_WHILE_1 +label_WHILE_END_2: + # RETURN + # Deallocate stack frame for function __Main__attrib__m__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 244 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_main_at_Main_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + diff --git a/tests/codegen/print-cool.mips b/tests/codegen/print-cool.mips new file mode 100644 index 00000000..8e3d1d00 --- /dev/null +++ b/tests/codegen/print-cool.mips @@ -0,0 +1,1172 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:05 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +Main: .asciiz "Main" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word function_out_string_at_IO, dummy, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, function_copy_at_Object, function_abort_at_Object, function_in_int_at_IO, dummy, function_out_int_at_IO +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word dummy, dummy, function_concat_at_String, function_type_name_at_Object, dummy, function_substr_at_String, function_copy_at_Object, function_abort_at_Object, dummy, function_length_at_String, dummy +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word function_out_string_at_IO, function_main_at_Main, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, function_copy_at_Object, function_abort_at_Object, function_in_int_at_IO, dummy, function_out_int_at_IO +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + lb $t3, 0($t1) + beqz $t3, end_loop + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + end_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 4($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 104 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 104 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_4 = SELF + sw $s1, -20($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # local_main_at_Main_internal_2 = local_main_at_Main_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = ALLOCATE Object + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Object + sw $t0, 12($v0) + li $t0, 6 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Object_start + sw $t0, 4($v0) + # Load type offset + li $t0, 4 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -40($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_7 = local_main_at_Main_internal_9 + lw $t0, -40($fp) + sw $t0, -32($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = VCALL local_main_at_Main_internal_7 type_name + # Save new self pointer in $s1 + lw $s1, -32($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 12($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -36($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_5 = local_main_at_Main_internal_8 + lw $t0, -36($fp) + sw $t0, -24($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 4 + sw $t0, 12($v0) + sw $v0, -44($fp) + # ARG local_main_at_Main_internal_10 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + lw $t0, -44($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -48($fp) + # ARG local_main_at_Main_internal_11 + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + lw $t0, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # local_main_at_Main_internal_6 = VCALL local_main_at_Main_internal_5 substr + # Save new self pointer in $s1 + lw $s1, -24($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -28($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_6 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + lw $t0, -28($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = VCALL local_main_at_Main_internal_2 out_string + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 0($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_3 + lw $t0, -16($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_17 --> -72($fp) + # local_main_at_Main_internal_17 = SELF + sw $s1, -72($fp) + # IF_ZERO local_main_at_Main_internal_17 GOTO label_TRUE_1 + # IF_ZERO local_main_at_Main_internal_17 GOTO label_TRUE_1 + lw $t0, -72($fp) + beq $t0, 0, label_TRUE_1 + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -68($fp) + # GOTO label_END_2 +j label_END_2 +label_TRUE_1: + # LOCAL local_main_at_Main_internal_16 --> -68($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -68($fp) + label_END_2: +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# LOCAL local_main_at_Main_internal_16 --> -68($fp) +# local_main_at_Main_internal_14 = local_main_at_Main_internal_16 +lw $t0, -68($fp) +sw $t0, -60($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_14 --> -60($fp) +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# local_main_at_Main_internal_15 = VCALL local_main_at_Main_internal_14 type_name +# Save new self pointer in $s1 +lw $s1, -60($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 12($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -64($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_15 --> -64($fp) +# local_main_at_Main_internal_12 = local_main_at_Main_internal_15 +lw $t0, -64($fp) +sw $t0, -52($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -76($fp) +# ARG local_main_at_Main_internal_18 +# LOCAL local_main_at_Main_internal_18 --> -76($fp) +lw $t0, -76($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 3 +sw $t0, 12($v0) +sw $v0, -80($fp) +# ARG local_main_at_Main_internal_19 +# LOCAL local_main_at_Main_internal_19 --> -80($fp) +lw $t0, -80($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_12 --> -52($fp) +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +# local_main_at_Main_internal_13 = VCALL local_main_at_Main_internal_12 substr +# Save new self pointer in $s1 +lw $s1, -52($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 20($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -56($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# ARG local_main_at_Main_internal_13 +# LOCAL local_main_at_Main_internal_13 --> -56($fp) +lw $t0, -56($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_0 --> -4($fp) +# LOCAL local_main_at_Main_internal_1 --> -8($fp) +# local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string +# Save new self pointer in $s1 +lw $s1, -4($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 0($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -8($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_main_at_Main_internal_22 --> -92($fp) +# local_main_at_Main_internal_22 = SELF +sw $s1, -92($fp) +# LOCAL local_main_at_Main_internal_20 --> -84($fp) +# LOCAL local_main_at_Main_internal_22 --> -92($fp) +# local_main_at_Main_internal_20 = local_main_at_Main_internal_22 +lw $t0, -92($fp) +sw $t0, -84($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# LOCAL local_main_at_Main_internal_23 --> -96($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, data_4 +sw $t0, 12($v0) +li $t0, 1 +sw $t0, 16($v0) +sw $v0, -96($fp) +# ARG local_main_at_Main_internal_23 +# LOCAL local_main_at_Main_internal_23 --> -96($fp) +lw $t0, -96($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_main_at_Main_internal_20 --> -84($fp) +# LOCAL local_main_at_Main_internal_21 --> -88($fp) +# local_main_at_Main_internal_21 = VCALL local_main_at_Main_internal_20 out_string +# Save new self pointer in $s1 +lw $s1, -84($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 0($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -88($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# RETURN local_main_at_Main_internal_21 +lw $v0, -88($fp) +# Deallocate stack frame for function function_main_at_Main. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 104 +jr $ra +# Function END + diff --git a/tests/codegen/sort-list.mips b/tests/codegen/sort-list.mips new file mode 100644 index 00000000..a72ae923 --- /dev/null +++ b/tests/codegen/sort-list.mips @@ -0,0 +1,3367 @@ + +# Code generated by PyCoolc. +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:08 2020 +# School of Math and Computer Science, University of Havana +# + +.data +dummy: .word 0 +IO: .asciiz "IO" +# Function END +Object: .asciiz "Object" +# Function END +String: .asciiz "String" +# Function END +Bool: .asciiz "Bool" +# Function END +Int: .asciiz "Int" +# Function END +Main: .asciiz "Main" +# Function END +List: .asciiz "List" +# Function END +Nil: .asciiz "Nil" +# Function END +Cons: .asciiz "Cons" +# Function END +# + + +# **** VTABLE for type IO **** +IO_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, function_in_int_at_IO, dummy, dummy, function_abort_at_Object, dummy, dummy, function_in_string_at_IO, dummy, dummy, dummy, function_out_string_at_IO, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type IO **** +IO_start: + IO_vtable_pointer: .word IO_vtable + # Function END +IO_end: +# + + +# **** VTABLE for type Object **** +Object_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Object **** +Object_start: + Object_vtable_pointer: .word Object_vtable + # Function END +Object_end: +# + + +# **** VTABLE for type String **** +String_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, function_abort_at_Object, function_length_at_String, dummy, dummy, function_concat_at_String, dummy, dummy, dummy, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type String **** +String_start: + String_vtable_pointer: .word String_vtable + # Function END +String_end: +# + + +# **** VTABLE for type Bool **** +Bool_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Bool **** +Bool_start: + Bool_vtable_pointer: .word Bool_vtable + # Function END +Bool_end: +# + + +# **** VTABLE for type Int **** +Int_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Int **** +Int_start: + Int_vtable_pointer: .word Int_vtable + # Function END +Int_end: +# + + +# **** VTABLE for type Main **** +Main_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, function_in_int_at_IO, function_main_at_Main, dummy, function_abort_at_Object, dummy, dummy, function_in_string_at_IO, dummy, function_iota_at_Main, dummy, function_out_string_at_IO, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Main **** +Main_start: + Main_vtable_pointer: .word Main_vtable + # Function END +Main_end: +# + + +# **** VTABLE for type List **** +List_vtable: .word function_isNil_at_List, function_sort_at_List, function_insert_at_List, function_type_name_at_Object, dummy, function_cdr_at_List, function_rcons_at_List, function_out_int_at_IO, function_rev_at_List, dummy, function_in_int_at_IO, dummy, function_car_at_List, function_abort_at_Object, dummy, function_cons_at_List, function_in_string_at_IO, dummy, dummy, function_print_list_at_List, function_out_string_at_IO, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type List **** +List_start: + List_vtable_pointer: .word List_vtable + # Function END +List_end: +# + + +# **** VTABLE for type Nil **** +Nil_vtable: .word function_isNil_at_Nil, function_sort_at_Nil, function_insert_at_Nil, function_type_name_at_Object, dummy, function_cdr_at_List, function_rcons_at_Nil, function_out_int_at_IO, function_rev_at_Nil, dummy, function_in_int_at_IO, dummy, function_car_at_List, function_abort_at_Object, dummy, function_cons_at_List, function_in_string_at_IO, dummy, dummy, function_print_list_at_Nil, function_out_string_at_IO, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Nil **** +Nil_start: + Nil_vtable_pointer: .word Nil_vtable + # Function END +Nil_end: +# + + +# **** VTABLE for type Cons **** +Cons_vtable: .word function_isNil_at_Cons, function_sort_at_Cons, function_insert_at_Cons, function_type_name_at_Object, function_init_at_Cons, function_cdr_at_Cons, function_rcons_at_Cons, function_out_int_at_IO, function_rev_at_Cons, dummy, function_in_int_at_IO, dummy, function_car_at_Cons, function_abort_at_Object, dummy, function_cons_at_List, function_in_string_at_IO, dummy, dummy, function_print_list_at_Cons, function_out_string_at_IO, function_copy_at_Object +# Function END +# + + +# **** Type RECORD for type Cons **** +Cons_start: + Cons_vtable_pointer: .word Cons_vtable + # Function END +Cons_end: +# + + +data_0: .asciiz "" +# + + +data_1: .asciiz "Abort called from class " +# + + +data_2: .asciiz "\n" +# + + +IO__TDT: .word 0, -1, -1, -1, -1, 1, 1, 2, 2 +Object__TDT: .word 1, 0, 1, 1, 1, 2, 2, 3, 3 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1 +Main__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1 +List__TDT: .word -1, -1, -1, -1, -1, -1, 0, 1, 1 +Nil__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, -1 +Cons__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0 +# + + +data_4: .asciiz "How many numbers to sort? " +# + + +data_5: .asciiz "\n" +# + + +.text +main: + jal entry + # syscall code 10 is for exit + li $v0, 10 + syscall + # Function END + +# function_in_string_at_IO implementation. +# @Params: +function_in_string_at_IO: + # Allocate stack frame for function function_in_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_string_at_IO_internal_0 --> -4($fp) + # Allocating 1024 bytes of memory + li $a0, 1024 + li $v0, 9 + syscall + move $t0, $v0 + move $a0, $v0 + li $a1, 1024 + li $v0, 8 + syscall + move $t2, $zero + move $t3, $zero + move $t1, $t0 + lb $t3, 0($t1) + beqz $t3, end_loop + read_length_loop: + lb $t3, 0($t1) + beqz $t3, end_read_length_loop + addu $t1, $t1, 1 + addu $t2, $t2, 1 + j read_length_loop + end_read_length_loop: + subu $t1, $t1, 1 + sb $zero, 0($t1) + subu $t2, $t2, 1 + end_loop: + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) + # Load type offset + li $t1, 8 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $t2, 16($v0) + sw $v0, -4($fp) + # RETURN local_in_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_out_int_at_IO implementation. +# @Params: +# 0($fp) = param_out_int_at_IO_x_0 +function_out_int_at_IO: + # Allocate stack frame for function function_out_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PRINT_INT param_out_int_at_IO_x_0 + # PARAM param_out_int_at_IO_x_0 --> 0($fp) + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 1 + syscall + # LOCAL local_out_int_at_IO_internal_0 --> -4($fp) + # local_out_int_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_out_string_at_IO implementation. +# @Params: +# 0($fp) = param_out_string_at_IO_x_0 +function_out_string_at_IO: + # Allocate stack frame for function function_out_string_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # PARAM param_out_string_at_IO_x_0 --> 0($fp) + # PRINT_STR param_out_string_at_IO_x_0 + lw $v0, 0($fp) + lw $a0, 12($v0) + li $v0, 4 + syscall + # LOCAL local_out_string_at_IO_internal_0 --> -4($fp) + # local_out_string_at_IO_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_out_string_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_out_string_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_in_int_at_IO implementation. +# @Params: +function_in_int_at_IO: + # Allocate stack frame for function function_in_int_at_IO. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_in_int_at_IO_internal_0 --> -4($fp) + # local_in_int_at_IO_internal_0 = READ_INT + li $v0, 5 + syscall + move $a2, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + sw $a2, 12($v0) + sw $v0, -4($fp) + # RETURN local_in_int_at_IO_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_in_int_at_IO. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_abort_at_Object implementation. +# @Params: +function_abort_at_Object: + # Allocate stack frame for function function_abort_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # LOCAL local_abort_at_Object_internal_0 --> -4($fp) + la $a0, data_1 + li $v0, 4 + syscall + lw $a0, -4($fp) + li $v0, 4 + syscall + la $a0, data_2 + li $v0, 4 + syscall + li $v0, 10 + syscall + # Function END + + +# function_copy_at_Object implementation. +# @Params: +function_copy_at_Object: + # Allocate stack frame for function function_copy_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_copy_at_Object_internal_0 --> -4($fp) + # local_copy_at_Object_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_copy_at_Object_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_copy_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_type_name_at_Object implementation. +# @Params: +function_type_name_at_Object: + # Allocate stack frame for function function_type_name_at_Object. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_type_name_at_Object_internal_0 --> -4($fp) + lw $t0, 0($s1) + sw $t0, -4($fp) + # RETURN local_type_name_at_Object_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_type_name_at_Object. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_concat_at_String implementation. +# @Params: +# 0($fp) = param_concat_at_String_s_0 +function_concat_at_String: + # Allocate stack frame for function function_concat_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_concat_at_String_internal_0 = self.CONCAT + # LOCAL local_concat_at_String_internal_0 --> -4($fp) + # PARAM param_concat_at_String_s_0 --> 0($fp) + # Get first string length from self + lw $t0, 16($s1) + # Get second string length from param + lw $v0, 0($fp) + lw $t1, 16($v0) + # Save new string length in a0 for memory allocation + addu $a0, $t0, $t1 + move $t3, $a0 + # Get first string from self + lw $t0, 12($s1) + # Get second string from param + lw $t1, 12($v0) + addu $a0, $a0, 4 + li $v0, 9 + syscall + move $t2, $v0 + move $t4, $zero + concat_loop1: + # Compare t0 with \0 + lb $t4, 0($t0) + beqz $t4, concat_loop1_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t0, $t0, 1 + j concat_loop1 + concat_loop1_end: + # Copy second string + concat_loop2: + # Compare t1 with \0 + lb $t4, 0($t1) + beqz $t4, concat_loop2_end + # Copy 1 byte + sb $t4, 0($t2) + addu $t2, $t2, 1 + addu $t1, $t1, 1 + j concat_loop2 + concat_loop2_end: + sb $zero, 0($t2) + # v0 contains resulting string + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_concat_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_concat_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_substr_at_String implementation. +# @Params: +# 0($fp) = param_substr_at_String_l_0 +# 4($fp) = param_substr_at_String_r_1 +function_substr_at_String: + # Allocate stack frame for function function_substr_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_substr_at_String_internal_0 --> -4($fp) + # PARAM param_substr_at_String_l_0 --> 4($fp) + # PARAM param_substr_at_String_r_1 --> 0($fp) + lw $t0, 12($s1) + lw $t2, 4($fp) + lw $t2, 12($t2) + addu $t0, $t0, $t2 + lw $a0, 0($fp) + lw $a0, 12($a0) + move $t3, $a0 + move $t1, $a0 + addu $a0, $a0, 1 + li $v0, 9 + syscall + move $t2, $v0 + substr_loop: + beqz $t1, substr_end + lb $a0, 0($t0) + sb $a0, 0($t2) + addu $t0, $t0, 1 + addu $t2, $t2, 1 + subu $t1, $t1, 1 + j substr_loop + substr_end: + sb $zero, 0($t2) + move $t1, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + sw $t1, 12($v0) + sw $t3, 16($v0) + sw $v0, -4($fp) + # RETURN local_substr_at_String_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_substr_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_length_at_String implementation. +# @Params: +function_length_at_String: + # Allocate stack frame for function function_length_at_String. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_length_at_String_internal_0 = GETATTRIBUTE length String + # LOCAL local_length_at_String_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # LOCAL local_length_at_String_internal_1 --> -8($fp) + # LOCAL local_length_at_String_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + lw $t0, -4($fp) + sw $t0, 12($v0) + sw $v0, -8($fp) + # RETURN local_length_at_String_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_length_at_String. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# entry implementation. +# @Params: +entry: + # Allocate stack frame for function entry. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local__internal_0 --> -4($fp) + # local__internal_0 = ALLOCATE Main + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Main + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Main_start + sw $t0, 4($v0) + # Load type offset + li $t0, 20 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Main__attrib__l__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # LOCAL local__internal_0 --> -4($fp) + lw $s1, -4($fp) + # local__internal_1 = CALL main + # LOCAL local__internal_1 --> -8($fp) + # LOCAL local__internal_0 --> -4($fp) + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type's VTABLE + la $t0, Main_vtable + # Get pointer to function address + lw $t1, 44($t0) + # Call function. Result is on $v0 + jalr $t1 + sw $v0, -8($fp) + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function entry. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Main__attrib__l__init implementation. +# @Params: +__Main__attrib__l__init: + # Allocate stack frame for function __Main__attrib__l__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Main__attrib__l__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_iota_at_Main implementation. +# @Params: +# 0($fp) = param_iota_at_Main_i_0 +function_iota_at_Main: + # Allocate stack frame for function function_iota_at_Main. + subu $sp, $sp, 56 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 56 + # LOCAL local_iota_at_Main_internal_0 --> -4($fp) + # local_iota_at_Main_internal_0 = ALLOCATE Nil + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Nil + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Nil_start + sw $t0, 4($v0) + # Load type offset + li $t0, 28 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -4($fp) + # + # LOCAL local_iota_at_Main_internal_0 --> -4($fp) + lw $t0, -4($fp) + sw $t0, 12($s1) + # LOCAL local_iota_at_Main_j_1 --> -8($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -8($fp) + # LOCAL local_iota_at_Main_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + # LOCAL local_iota_at_Main_j_1 --> -8($fp) + # LOCAL local_iota_at_Main_internal_2 --> -12($fp) + # local_iota_at_Main_j_1 = local_iota_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -8($fp) + label_WHILE_1: + # LOCAL local_iota_at_Main_internal_4 --> -20($fp) + # LOCAL local_iota_at_Main_j_1 --> -8($fp) + # PARAM param_iota_at_Main_i_0 --> 0($fp) + lw $a0, -8($fp) + lw $a1, 0($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -20($fp) + # IF_GREATER_ZERO local_iota_at_Main_internal_4 GOTO label_FALSE_3 + # IF_GREATER_ZERO local_iota_at_Main_internal_4 GOTO label_FALSE_3 + lw $t0, -20($fp) + bgt $t0, 0, label_FALSE_3 + # IF_ZERO local_iota_at_Main_internal_4 GOTO label_FALSE_3 + # IF_ZERO local_iota_at_Main_internal_4 GOTO label_FALSE_3 + lw $t0, -20($fp) + beq $t0, 0, label_FALSE_3 + # LOCAL local_iota_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -20($fp) + # GOTO label_END_4 +j label_END_4 +label_FALSE_3: + # LOCAL local_iota_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -20($fp) + label_END_4: +# LOCAL local_iota_at_Main_internal_3 --> -16($fp) +# LOCAL local_iota_at_Main_internal_4 --> -20($fp) +# Obtain value from -20($fp) +lw $v0, -20($fp) +lw $v0, 12($v0) +sw $v0, -16($fp) +# IF_ZERO local_iota_at_Main_internal_3 GOTO label_WHILE_END_2 +# IF_ZERO local_iota_at_Main_internal_3 GOTO label_WHILE_END_2 +lw $t0, -16($fp) +beq $t0, 0, label_WHILE_END_2 +# LOCAL local_iota_at_Main_internal_7 --> -32($fp) +# local_iota_at_Main_internal_7 = ALLOCATE Cons +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Cons +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Cons_start +sw $t0, 4($v0) +# Load type offset +li $t0, 32 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __Cons__attrib__xcar__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __Cons__attrib__xcdr__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 16($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -32($fp) +# LOCAL local_iota_at_Main_internal_5 --> -24($fp) +# LOCAL local_iota_at_Main_internal_7 --> -32($fp) +# local_iota_at_Main_internal_5 = local_iota_at_Main_internal_7 +lw $t0, -32($fp) +sw $t0, -24($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG local_iota_at_Main_j_1 +# LOCAL local_iota_at_Main_j_1 --> -8($fp) +lw $t0, -8($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# local_iota_at_Main_internal_8 = GETATTRIBUTE l Main +# LOCAL local_iota_at_Main_internal_8 --> -36($fp) +lw $t0, 12($s1) +sw $t0, -36($fp) +# ARG local_iota_at_Main_internal_8 +# LOCAL local_iota_at_Main_internal_8 --> -36($fp) +lw $t0, -36($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_iota_at_Main_internal_5 --> -24($fp) +# LOCAL local_iota_at_Main_internal_6 --> -28($fp) +# local_iota_at_Main_internal_6 = VCALL local_iota_at_Main_internal_5 init +# Save new self pointer in $s1 +lw $s1, -24($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -28($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# +# LOCAL local_iota_at_Main_internal_6 --> -28($fp) +lw $t0, -28($fp) +sw $t0, 12($s1) +# LOCAL local_iota_at_Main_internal_10 --> -44($fp) +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Int +sw $t0, 12($v0) +li $t0, 3 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Int_start +sw $t0, 4($v0) +# Load type offset +li $t0, 16 +sw $t0, 8($v0) +li $t0, 1 +sw $t0, 12($v0) +sw $v0, -44($fp) +# LOCAL local_iota_at_Main_internal_9 --> -40($fp) +# LOCAL local_iota_at_Main_j_1 --> -8($fp) +# LOCAL local_iota_at_Main_internal_10 --> -44($fp) +# local_iota_at_Main_internal_9 = local_iota_at_Main_j_1 + local_iota_at_Main_internal_10 +lw $t1, -8($fp) +lw $t0, 12($t1) +lw $t1, -44($fp) +lw $t2, 12($t1) +add $t0, $t0, $t2 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type Int +la $t1, String +sw $t1, 0($v0) +la $t1, String_start +sw $t1, 4($v0) +# Load type offset +li $t1, 8 +sw $t1, 8($v0) +la $t1, Int +sw $t1, 12($v0) +li $t1, 3 +sw $t1, 16($v0) +move $t1, $v0 +# Allocating 16 bytes of memory +li $a0, 16 +li $v0, 9 +syscall +sw $t1, 0($v0) +la $t1, Int_start +sw $t1, 4($v0) +# Load type offset +li $t1, 16 +sw $t1, 8($v0) +sw $t0, 12($v0) +sw $v0, -40($fp) +# LOCAL local_iota_at_Main_j_1 --> -8($fp) +# LOCAL local_iota_at_Main_internal_9 --> -40($fp) +# local_iota_at_Main_j_1 = local_iota_at_Main_internal_9 +lw $t0, -40($fp) +sw $t0, -8($fp) +# GOTO label_WHILE_1 +j label_WHILE_1 +label_WHILE_END_2: + # local_iota_at_Main_internal_11 = GETATTRIBUTE l Main + # LOCAL local_iota_at_Main_internal_11 --> -48($fp) + lw $t0, 12($s1) + sw $t0, -48($fp) + # RETURN local_iota_at_Main_internal_11 + lw $v0, -48($fp) + # Deallocate stack frame for function function_iota_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 56 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_main_at_Main implementation. +# @Params: +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 72 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 72 + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_0 = local_main_at_Main_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_4 + sw $t0, 12($v0) + li $t0, 26 + sw $t0, 16($v0) + sw $v0, -16($fp) + # ARG local_main_at_Main_internal_3 + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # local_main_at_Main_internal_1 = VCALL local_main_at_Main_internal_0 out_string + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 80($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_12 = SELF + sw $s1, -52($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_12 --> -52($fp) + # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 + lw $t0, -52($fp) + sw $t0, -44($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_15 = SELF + sw $s1, -64($fp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_15 --> -64($fp) + # local_main_at_Main_internal_13 = local_main_at_Main_internal_15 + lw $t0, -64($fp) + sw $t0, -56($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_13 --> -56($fp) + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + # local_main_at_Main_internal_14 = VCALL local_main_at_Main_internal_13 in_int + # Save new self pointer in $s1 + lw $s1, -56($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 40($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -60($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_main_at_Main_internal_14 + # LOCAL local_main_at_Main_internal_14 --> -60($fp) + lw $t0, -60($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 iota + # Save new self pointer in $s1 + lw $s1, -44($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 72($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -48($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_11 --> -48($fp) + # local_main_at_Main_internal_8 = local_main_at_Main_internal_11 + lw $t0, -48($fp) + sw $t0, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_9 = VCALL local_main_at_Main_internal_8 rev + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_9 + lw $t0, -40($fp) + sw $t0, -28($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 sort + # Save new self pointer in $s1 + lw $s1, -28($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -32($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_4 = local_main_at_Main_internal_7 + lw $t0, -32($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # local_main_at_Main_internal_5 = VCALL local_main_at_Main_internal_4 print_list + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 76($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_main_at_Main_internal_5 + lw $v0, -24($fp) + # Deallocate stack frame for function function_main_at_Main. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 72 + jr $ra + # Function END + + +# function_isNil_at_List implementation. +# @Params: +function_isNil_at_List: + # Allocate stack frame for function function_isNil_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_List_internal_2 --> -12($fp) + # local_isNil_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_isNil_at_List_internal_0 --> -4($fp) + # LOCAL local_isNil_at_List_internal_2 --> -12($fp) + # local_isNil_at_List_internal_0 = local_isNil_at_List_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_isNil_at_List_internal_0 --> -4($fp) + # LOCAL local_isNil_at_List_internal_1 --> -8($fp) + # local_isNil_at_List_internal_1 = VCALL local_isNil_at_List_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 52($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_isNil_at_List_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -16($fp) + # RETURN local_isNil_at_List_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_isNil_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cons_at_List implementation. +# @Params: +# 0($fp) = param_cons_at_List_hd_0 +function_cons_at_List: + # Allocate stack frame for function function_cons_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cons_at_List_new_cell_0 --> -4($fp) + # local_cons_at_List_new_cell_0 = 0 + li $t0, 0 + sw $t0, -4($fp) + # LOCAL local_cons_at_List_internal_1 --> -8($fp) + # local_cons_at_List_internal_1 = ALLOCATE Cons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Cons + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Cons_start + sw $t0, 4($v0) + # Load type offset + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Cons__attrib__xcar__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Cons__attrib__xcdr__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -8($fp) + # LOCAL local_cons_at_List_new_cell_0 --> -4($fp) + # LOCAL local_cons_at_List_internal_1 --> -8($fp) + # local_cons_at_List_new_cell_0 = local_cons_at_List_internal_1 + lw $t0, -8($fp) + sw $t0, -4($fp) + # LOCAL local_cons_at_List_internal_2 --> -12($fp) + # LOCAL local_cons_at_List_new_cell_0 --> -4($fp) + # local_cons_at_List_internal_2 = local_cons_at_List_new_cell_0 + lw $t0, -4($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_cons_at_List_hd_0 + # PARAM param_cons_at_List_hd_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cons_at_List_internal_4 --> -20($fp) + # local_cons_at_List_internal_4 = SELF + sw $s1, -20($fp) + # ARG local_cons_at_List_internal_4 + # LOCAL local_cons_at_List_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_cons_at_List_internal_2 --> -12($fp) + # LOCAL local_cons_at_List_internal_3 --> -16($fp) + # local_cons_at_List_internal_3 = VCALL local_cons_at_List_internal_2 init + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_cons_at_List_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_cons_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_car_at_List implementation. +# @Params: +function_car_at_List: + # Allocate stack frame for function function_car_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_car_at_List_internal_2 --> -12($fp) + # local_car_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_car_at_List_internal_0 --> -4($fp) + # LOCAL local_car_at_List_internal_2 --> -12($fp) + # local_car_at_List_internal_0 = local_car_at_List_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_car_at_List_internal_0 --> -4($fp) + # LOCAL local_car_at_List_internal_1 --> -8($fp) + # local_car_at_List_internal_1 = VCALL local_car_at_List_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 52($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_car_at_List_internal_3 --> -16($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -16($fp) + # RETURN local_car_at_List_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_car_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cdr_at_List implementation. +# @Params: +function_cdr_at_List: + # Allocate stack frame for function function_cdr_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_cdr_at_List_internal_2 --> -12($fp) + # local_cdr_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_cdr_at_List_internal_0 --> -4($fp) + # LOCAL local_cdr_at_List_internal_2 --> -12($fp) + # local_cdr_at_List_internal_0 = local_cdr_at_List_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_cdr_at_List_internal_0 --> -4($fp) + # LOCAL local_cdr_at_List_internal_1 --> -8($fp) + # local_cdr_at_List_internal_1 = VCALL local_cdr_at_List_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 52($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_cdr_at_List_internal_3 --> -16($fp) + # local_cdr_at_List_internal_3 = ALLOCATE List + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, List + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 12 bytes of memory + li $a0, 12 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, List_start + sw $t0, 4($v0) + # Load type offset + li $t0, 24 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -16($fp) + # RETURN local_cdr_at_List_internal_3 + lw $v0, -16($fp) + # Deallocate stack frame for function function_cdr_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_rev_at_List implementation. +# @Params: +function_rev_at_List: + # Allocate stack frame for function function_rev_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_rev_at_List_internal_2 --> -12($fp) + # local_rev_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_rev_at_List_internal_0 --> -4($fp) + # LOCAL local_rev_at_List_internal_2 --> -12($fp) + # local_rev_at_List_internal_0 = local_rev_at_List_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_rev_at_List_internal_0 --> -4($fp) + # LOCAL local_rev_at_List_internal_1 --> -8($fp) + # local_rev_at_List_internal_1 = VCALL local_rev_at_List_internal_0 cdr + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_rev_at_List_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_rev_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_sort_at_List implementation. +# @Params: +function_sort_at_List: + # Allocate stack frame for function function_sort_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_sort_at_List_internal_2 --> -12($fp) + # local_sort_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_sort_at_List_internal_0 --> -4($fp) + # LOCAL local_sort_at_List_internal_2 --> -12($fp) + # local_sort_at_List_internal_0 = local_sort_at_List_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_sort_at_List_internal_0 --> -4($fp) + # LOCAL local_sort_at_List_internal_1 --> -8($fp) + # local_sort_at_List_internal_1 = VCALL local_sort_at_List_internal_0 cdr + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_sort_at_List_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_sort_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_insert_at_List implementation. +# @Params: +# 0($fp) = param_insert_at_List_i_0 +function_insert_at_List: + # Allocate stack frame for function function_insert_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_insert_at_List_internal_2 --> -12($fp) + # local_insert_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_insert_at_List_internal_0 --> -4($fp) + # LOCAL local_insert_at_List_internal_2 --> -12($fp) + # local_insert_at_List_internal_0 = local_insert_at_List_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_insert_at_List_internal_0 --> -4($fp) + # LOCAL local_insert_at_List_internal_1 --> -8($fp) + # local_insert_at_List_internal_1 = VCALL local_insert_at_List_internal_0 cdr + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_insert_at_List_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_insert_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_rcons_at_List implementation. +# @Params: +# 0($fp) = param_rcons_at_List_i_0 +function_rcons_at_List: + # Allocate stack frame for function function_rcons_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_rcons_at_List_internal_2 --> -12($fp) + # local_rcons_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_rcons_at_List_internal_0 --> -4($fp) + # LOCAL local_rcons_at_List_internal_2 --> -12($fp) + # local_rcons_at_List_internal_0 = local_rcons_at_List_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_rcons_at_List_internal_0 --> -4($fp) + # LOCAL local_rcons_at_List_internal_1 --> -8($fp) + # local_rcons_at_List_internal_1 = VCALL local_rcons_at_List_internal_0 cdr + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 20($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_rcons_at_List_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_rcons_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_list_at_List implementation. +# @Params: +function_print_list_at_List: + # Allocate stack frame for function function_print_list_at_List. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_print_list_at_List_internal_2 --> -12($fp) + # local_print_list_at_List_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_list_at_List_internal_0 --> -4($fp) + # LOCAL local_print_list_at_List_internal_2 --> -12($fp) + # local_print_list_at_List_internal_0 = local_print_list_at_List_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_List_internal_0 --> -4($fp) + # LOCAL local_print_list_at_List_internal_1 --> -8($fp) + # local_print_list_at_List_internal_1 = VCALL local_print_list_at_List_internal_0 abort + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 52($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_list_at_List_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_print_list_at_List. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_Nil implementation. +# @Params: +function_isNil_at_Nil: + # Allocate stack frame for function function_isNil_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_Nil_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_isNil_at_Nil_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_rev_at_Nil implementation. +# @Params: +function_rev_at_Nil: + # Allocate stack frame for function function_rev_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_rev_at_Nil_internal_0 --> -4($fp) + # local_rev_at_Nil_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_rev_at_Nil_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_rev_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_sort_at_Nil implementation. +# @Params: +function_sort_at_Nil: + # Allocate stack frame for function function_sort_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_sort_at_Nil_internal_0 --> -4($fp) + # local_sort_at_Nil_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_sort_at_Nil_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_sort_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_insert_at_Nil implementation. +# @Params: +# 0($fp) = param_insert_at_Nil_i_0 +function_insert_at_Nil: + # Allocate stack frame for function function_insert_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_insert_at_Nil_internal_2 --> -12($fp) + # local_insert_at_Nil_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_insert_at_Nil_internal_0 --> -4($fp) + # LOCAL local_insert_at_Nil_internal_2 --> -12($fp) + # local_insert_at_Nil_internal_0 = local_insert_at_Nil_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_insert_at_Nil_i_0 + # PARAM param_insert_at_Nil_i_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_insert_at_Nil_internal_0 --> -4($fp) + # LOCAL local_insert_at_Nil_internal_1 --> -8($fp) + # local_insert_at_Nil_internal_1 = VCALL local_insert_at_Nil_internal_0 rcons + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 24($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_insert_at_Nil_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_insert_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_rcons_at_Nil implementation. +# @Params: +# 0($fp) = param_rcons_at_Nil_i_0 +function_rcons_at_Nil: + # Allocate stack frame for function function_rcons_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_rcons_at_Nil_internal_2 --> -12($fp) + # local_rcons_at_Nil_internal_2 = ALLOCATE Cons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Cons + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Cons_start + sw $t0, 4($v0) + # Load type offset + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Cons__attrib__xcar__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Cons__attrib__xcdr__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -12($fp) + # LOCAL local_rcons_at_Nil_internal_0 --> -4($fp) + # LOCAL local_rcons_at_Nil_internal_2 --> -12($fp) + # local_rcons_at_Nil_internal_0 = local_rcons_at_Nil_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_rcons_at_Nil_i_0 + # PARAM param_rcons_at_Nil_i_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_rcons_at_Nil_internal_3 --> -16($fp) + # local_rcons_at_Nil_internal_3 = SELF + sw $s1, -16($fp) + # ARG local_rcons_at_Nil_internal_3 + # LOCAL local_rcons_at_Nil_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_rcons_at_Nil_internal_0 --> -4($fp) + # LOCAL local_rcons_at_Nil_internal_1 --> -8($fp) + # local_rcons_at_Nil_internal_1 = VCALL local_rcons_at_Nil_internal_0 init + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_rcons_at_Nil_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_rcons_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_list_at_Nil implementation. +# @Params: +function_print_list_at_Nil: + # Allocate stack frame for function function_print_list_at_Nil. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_print_list_at_Nil_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_print_list_at_Nil_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_print_list_at_Nil. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Cons__attrib__xcar__init implementation. +# @Params: +__Cons__attrib__xcar__init: + # Allocate stack frame for function __Cons__attrib__xcar__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_ttrib__xcar__init_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_ttrib__xcar__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Cons__attrib__xcar__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# __Cons__attrib__xcdr__init implementation. +# @Params: +__Cons__attrib__xcdr__init: + # Allocate stack frame for function __Cons__attrib__xcdr__init. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # RETURN 0 + li $v0, 0 + # Deallocate stack frame for function __Cons__attrib__xcdr__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_isNil_at_Cons implementation. +# @Params: +function_isNil_at_Cons: + # Allocate stack frame for function function_isNil_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # LOCAL local_isNil_at_Cons_internal_0 --> -4($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_isNil_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_isNil_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Cons implementation. +# @Params: +# 0($fp) = param_init_at_Cons_hd_0 +# 4($fp) = param_init_at_Cons_tl_1 +function_init_at_Cons: + # Allocate stack frame for function function_init_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_Cons_hd_0 --> 4($fp) + lw $t0, 4($fp) + sw $t0, 12($s1) + # + # PARAM param_init_at_Cons_tl_1 --> 0($fp) + lw $t0, 0($fp) + sw $t0, 16($s1) + # LOCAL local_init_at_Cons_internal_0 --> -4($fp) + # local_init_at_Cons_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END + + +# function_car_at_Cons implementation. +# @Params: +function_car_at_Cons: + # Allocate stack frame for function function_car_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_car_at_Cons_internal_0 = GETATTRIBUTE xcar Cons + # LOCAL local_car_at_Cons_internal_0 --> -4($fp) + lw $t0, 12($s1) + sw $t0, -4($fp) + # RETURN local_car_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_car_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_cdr_at_Cons implementation. +# @Params: +function_cdr_at_Cons: + # Allocate stack frame for function function_cdr_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_cdr_at_Cons_internal_0 = GETATTRIBUTE xcdr Cons + # LOCAL local_cdr_at_Cons_internal_0 --> -4($fp) + lw $t0, 16($s1) + sw $t0, -4($fp) + # RETURN local_cdr_at_Cons_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_cdr_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_rev_at_Cons implementation. +# @Params: +function_rev_at_Cons: + # Allocate stack frame for function function_rev_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_rev_at_Cons_internal_4 = GETATTRIBUTE xcdr Cons + # LOCAL local_rev_at_Cons_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # LOCAL local_rev_at_Cons_internal_2 --> -12($fp) + # LOCAL local_rev_at_Cons_internal_4 --> -20($fp) + # local_rev_at_Cons_internal_2 = local_rev_at_Cons_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_rev_at_Cons_internal_2 --> -12($fp) + # LOCAL local_rev_at_Cons_internal_3 --> -16($fp) + # local_rev_at_Cons_internal_3 = VCALL local_rev_at_Cons_internal_2 rev + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 32($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_rev_at_Cons_internal_0 --> -4($fp) + # LOCAL local_rev_at_Cons_internal_3 --> -16($fp) + # local_rev_at_Cons_internal_0 = local_rev_at_Cons_internal_3 + lw $t0, -16($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_rev_at_Cons_internal_5 = GETATTRIBUTE xcar Cons + # LOCAL local_rev_at_Cons_internal_5 --> -24($fp) + lw $t0, 12($s1) + sw $t0, -24($fp) + # ARG local_rev_at_Cons_internal_5 + # LOCAL local_rev_at_Cons_internal_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_rev_at_Cons_internal_0 --> -4($fp) + # LOCAL local_rev_at_Cons_internal_1 --> -8($fp) + # local_rev_at_Cons_internal_1 = VCALL local_rev_at_Cons_internal_0 rcons + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 24($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_rev_at_Cons_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_rev_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_sort_at_Cons implementation. +# @Params: +function_sort_at_Cons: + # Allocate stack frame for function function_sort_at_Cons. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # local_sort_at_Cons_internal_4 = GETATTRIBUTE xcdr Cons + # LOCAL local_sort_at_Cons_internal_4 --> -20($fp) + lw $t0, 16($s1) + sw $t0, -20($fp) + # LOCAL local_sort_at_Cons_internal_2 --> -12($fp) + # LOCAL local_sort_at_Cons_internal_4 --> -20($fp) + # local_sort_at_Cons_internal_2 = local_sort_at_Cons_internal_4 + lw $t0, -20($fp) + sw $t0, -12($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_sort_at_Cons_internal_2 --> -12($fp) + # LOCAL local_sort_at_Cons_internal_3 --> -16($fp) + # local_sort_at_Cons_internal_3 = VCALL local_sort_at_Cons_internal_2 sort + # Save new self pointer in $s1 + lw $s1, -12($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 4($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -16($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_sort_at_Cons_internal_0 --> -4($fp) + # LOCAL local_sort_at_Cons_internal_3 --> -16($fp) + # local_sort_at_Cons_internal_0 = local_sort_at_Cons_internal_3 + lw $t0, -16($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_sort_at_Cons_internal_5 = GETATTRIBUTE xcar Cons + # LOCAL local_sort_at_Cons_internal_5 --> -24($fp) + lw $t0, 12($s1) + sw $t0, -24($fp) + # ARG local_sort_at_Cons_internal_5 + # LOCAL local_sort_at_Cons_internal_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_sort_at_Cons_internal_0 --> -4($fp) + # LOCAL local_sort_at_Cons_internal_1 --> -8($fp) + # local_sort_at_Cons_internal_1 = VCALL local_sort_at_Cons_internal_0 insert + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 8($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_sort_at_Cons_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_sort_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_insert_at_Cons implementation. +# @Params: +# 0($fp) = param_insert_at_Cons_i_0 +function_insert_at_Cons: + # Allocate stack frame for function function_insert_at_Cons. + subu $sp, $sp, 68 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 68 + # local_insert_at_Cons_internal_3 = GETATTRIBUTE xcar Cons + # LOCAL local_insert_at_Cons_internal_3 --> -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) + # LOCAL local_insert_at_Cons_internal_2 --> -12($fp) + # PARAM param_insert_at_Cons_i_0 --> 0($fp) + # LOCAL local_insert_at_Cons_internal_3 --> -16($fp) + lw $a0, 0($fp) + lw $a1, -16($fp) + # Load values + lw $a0, 12($a0) + lw $a1, 12($a1) + # SUB and store + sub $a0, $a0, $a1 + sw $a0, -12($fp) + # IF_GREATER_ZERO local_insert_at_Cons_internal_2 GOTO label_FALSE_7 + # IF_GREATER_ZERO local_insert_at_Cons_internal_2 GOTO label_FALSE_7 + lw $t0, -12($fp) + bgt $t0, 0, label_FALSE_7 + # IF_ZERO local_insert_at_Cons_internal_2 GOTO label_FALSE_7 + # IF_ZERO local_insert_at_Cons_internal_2 GOTO label_FALSE_7 + lw $t0, -12($fp) + beq $t0, 0, label_FALSE_7 + # LOCAL local_insert_at_Cons_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 1 + sw $t0, 12($v0) + sw $v0, -12($fp) + # GOTO label_END_8 +j label_END_8 +label_FALSE_7: + # LOCAL local_insert_at_Cons_internal_2 --> -12($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Bool + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Bool + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Bool_start + sw $t0, 4($v0) + # Load type offset + li $t0, 12 + sw $t0, 8($v0) + li $t0, 0 + sw $t0, 12($v0) + sw $v0, -12($fp) + label_END_8: +# LOCAL local_insert_at_Cons_internal_0 --> -4($fp) +# LOCAL local_insert_at_Cons_internal_2 --> -12($fp) +# Obtain value from -12($fp) +lw $v0, -12($fp) +lw $v0, 12($v0) +sw $v0, -4($fp) +# IF_ZERO local_insert_at_Cons_internal_0 GOTO label_FALSEIF_5 +# IF_ZERO local_insert_at_Cons_internal_0 GOTO label_FALSEIF_5 +lw $t0, -4($fp) +beq $t0, 0, label_FALSEIF_5 +# LOCAL local_insert_at_Cons_internal_6 --> -28($fp) +# local_insert_at_Cons_internal_6 = ALLOCATE Cons +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +# Allocating string for type name +la $t0, String +sw $t0, 0($v0) +la $t0, String_start +sw $t0, 4($v0) +# Load type offset +li $t0, 8 +sw $t0, 8($v0) +la $t0, Cons +sw $t0, 12($v0) +li $t0, 4 +sw $t0, 16($v0) +move $t0, $v0 +# Allocating 20 bytes of memory +li $a0, 20 +li $v0, 9 +syscall +sw $t0, 0($v0) +la $t0, Cons_start +sw $t0, 4($v0) +# Load type offset +li $t0, 32 +sw $t0, 8($v0) +move $t1, $v0 +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +move $s1, $v0 +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __Cons__attrib__xcar__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 12($t1) +# Push register t1 into stack +subu $sp, $sp, 4 +sw $t1, 0($sp) +jal __Cons__attrib__xcdr__init +# Pop 4 bytes from stack into register t1 +lw $t1, 0($sp) +addu $sp, $sp, 4 +sw $v0, 16($t1) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +sw $t1, -28($fp) +# LOCAL local_insert_at_Cons_internal_4 --> -20($fp) +# LOCAL local_insert_at_Cons_internal_6 --> -28($fp) +# local_insert_at_Cons_internal_4 = local_insert_at_Cons_internal_6 +lw $t0, -28($fp) +sw $t0, -20($fp) +# Push register s1 into stack +subu $sp, $sp, 4 +sw $s1, 0($sp) +# ARG param_insert_at_Cons_i_0 +# PARAM param_insert_at_Cons_i_0 --> 0($fp) +lw $t0, 0($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_insert_at_Cons_internal_7 --> -32($fp) +# local_insert_at_Cons_internal_7 = SELF +sw $s1, -32($fp) +# ARG local_insert_at_Cons_internal_7 +# LOCAL local_insert_at_Cons_internal_7 --> -32($fp) +lw $t0, -32($fp) +# Push arg into stack +subu $sp, $sp, 4 +sw $t0, 0($sp) +# LOCAL local_insert_at_Cons_internal_4 --> -20($fp) +# LOCAL local_insert_at_Cons_internal_5 --> -24($fp) +# local_insert_at_Cons_internal_5 = VCALL local_insert_at_Cons_internal_4 init +# Save new self pointer in $s1 +lw $s1, -20($fp) +# Get pointer to type +lw $t0, 4($s1) +# Get pointer to type's VTABLE +lw $t0, 0($t0) +# Get pointer to function address +lw $t0, 16($t0) +# Call function. Result is on $v0 +jalr $t0 +sw $v0, -24($fp) +# Pop 4 bytes from stack into register s1 +lw $s1, 0($sp) +addu $sp, $sp, 4 +# LOCAL local_insert_at_Cons_internal_1 --> -8($fp) +# LOCAL local_insert_at_Cons_internal_5 --> -24($fp) +# local_insert_at_Cons_internal_1 = local_insert_at_Cons_internal_5 +lw $t0, -24($fp) +sw $t0, -8($fp) +# GOTO label_ENDIF_6 +j label_ENDIF_6 +label_FALSEIF_5: + # LOCAL local_insert_at_Cons_internal_10 --> -44($fp) + # local_insert_at_Cons_internal_10 = ALLOCATE Cons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Cons + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Cons_start + sw $t0, 4($v0) + # Load type offset + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Cons__attrib__xcar__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Cons__attrib__xcdr__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -44($fp) + # LOCAL local_insert_at_Cons_internal_8 --> -36($fp) + # LOCAL local_insert_at_Cons_internal_10 --> -44($fp) + # local_insert_at_Cons_internal_8 = local_insert_at_Cons_internal_10 + lw $t0, -44($fp) + sw $t0, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_insert_at_Cons_internal_11 = GETATTRIBUTE xcar Cons + # LOCAL local_insert_at_Cons_internal_11 --> -48($fp) + lw $t0, 12($s1) + sw $t0, -48($fp) + # ARG local_insert_at_Cons_internal_11 + # LOCAL local_insert_at_Cons_internal_11 --> -48($fp) + lw $t0, -48($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # local_insert_at_Cons_internal_14 = GETATTRIBUTE xcdr Cons + # LOCAL local_insert_at_Cons_internal_14 --> -60($fp) + lw $t0, 16($s1) + sw $t0, -60($fp) + # LOCAL local_insert_at_Cons_internal_12 --> -52($fp) + # LOCAL local_insert_at_Cons_internal_14 --> -60($fp) + # local_insert_at_Cons_internal_12 = local_insert_at_Cons_internal_14 + lw $t0, -60($fp) + sw $t0, -52($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_insert_at_Cons_i_0 + # PARAM param_insert_at_Cons_i_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_insert_at_Cons_internal_12 --> -52($fp) + # LOCAL local_insert_at_Cons_internal_13 --> -56($fp) + # local_insert_at_Cons_internal_13 = VCALL local_insert_at_Cons_internal_12 insert + # Save new self pointer in $s1 + lw $s1, -52($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 8($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -56($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_insert_at_Cons_internal_13 + # LOCAL local_insert_at_Cons_internal_13 --> -56($fp) + lw $t0, -56($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_insert_at_Cons_internal_8 --> -36($fp) + # LOCAL local_insert_at_Cons_internal_9 --> -40($fp) + # local_insert_at_Cons_internal_9 = VCALL local_insert_at_Cons_internal_8 init + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_insert_at_Cons_internal_1 --> -8($fp) + # LOCAL local_insert_at_Cons_internal_9 --> -40($fp) + # local_insert_at_Cons_internal_1 = local_insert_at_Cons_internal_9 + lw $t0, -40($fp) + sw $t0, -8($fp) + label_ENDIF_6: +# RETURN local_insert_at_Cons_internal_1 +lw $v0, -8($fp) +# Deallocate stack frame for function function_insert_at_Cons. +# Restore $ra +lw $ra, 4($sp) +# Restore $fp +lw $fp, 0($sp) +# Restore Stack pointer $sp +addu $sp, $sp, 68 +# Deallocate function args +addu $sp, $sp, 4 +jr $ra +# Function END + + +# function_rcons_at_Cons implementation. +# @Params: +# 0($fp) = param_rcons_at_Cons_i_0 +function_rcons_at_Cons: + # Allocate stack frame for function function_rcons_at_Cons. + subu $sp, $sp, 36 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 36 + # LOCAL local_rcons_at_Cons_internal_2 --> -12($fp) + # local_rcons_at_Cons_internal_2 = ALLOCATE Cons + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type name + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Cons + sw $t0, 12($v0) + li $t0, 4 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Cons_start + sw $t0, 4($v0) + # Load type offset + li $t0, 32 + sw $t0, 8($v0) + move $t1, $v0 + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + move $s1, $v0 + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Cons__attrib__xcar__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Cons__attrib__xcdr__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + sw $t1, -12($fp) + # LOCAL local_rcons_at_Cons_internal_0 --> -4($fp) + # LOCAL local_rcons_at_Cons_internal_2 --> -12($fp) + # local_rcons_at_Cons_internal_0 = local_rcons_at_Cons_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_rcons_at_Cons_internal_3 = GETATTRIBUTE xcar Cons + # LOCAL local_rcons_at_Cons_internal_3 --> -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) + # ARG local_rcons_at_Cons_internal_3 + # LOCAL local_rcons_at_Cons_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # local_rcons_at_Cons_internal_6 = GETATTRIBUTE xcdr Cons + # LOCAL local_rcons_at_Cons_internal_6 --> -28($fp) + lw $t0, 16($s1) + sw $t0, -28($fp) + # LOCAL local_rcons_at_Cons_internal_4 --> -20($fp) + # LOCAL local_rcons_at_Cons_internal_6 --> -28($fp) + # local_rcons_at_Cons_internal_4 = local_rcons_at_Cons_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # ARG param_rcons_at_Cons_i_0 + # PARAM param_rcons_at_Cons_i_0 --> 0($fp) + lw $t0, 0($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_rcons_at_Cons_internal_4 --> -20($fp) + # LOCAL local_rcons_at_Cons_internal_5 --> -24($fp) + # local_rcons_at_Cons_internal_5 = VCALL local_rcons_at_Cons_internal_4 rcons + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 24($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # ARG local_rcons_at_Cons_internal_5 + # LOCAL local_rcons_at_Cons_internal_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_rcons_at_Cons_internal_0 --> -4($fp) + # LOCAL local_rcons_at_Cons_internal_1 --> -8($fp) + # local_rcons_at_Cons_internal_1 = VCALL local_rcons_at_Cons_internal_0 init + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 16($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_rcons_at_Cons_internal_1 + lw $v0, -8($fp) + # Deallocate stack frame for function function_rcons_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 36 + # Deallocate function args + addu $sp, $sp, 4 + jr $ra + # Function END + + +# function_print_list_at_Cons implementation. +# @Params: +function_print_list_at_Cons: + # Allocate stack frame for function function_print_list_at_Cons. + subu $sp, $sp, 52 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 52 + # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) + # local_print_list_at_Cons_internal_2 = SELF + sw $s1, -12($fp) + # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Cons_internal_2 --> -12($fp) + # local_print_list_at_Cons_internal_0 = local_print_list_at_Cons_internal_2 + lw $t0, -12($fp) + sw $t0, -4($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # local_print_list_at_Cons_internal_3 = GETATTRIBUTE xcar Cons + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + lw $t0, 12($s1) + sw $t0, -16($fp) + # ARG local_print_list_at_Cons_internal_3 + # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) + lw $t0, -16($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_list_at_Cons_internal_0 --> -4($fp) + # LOCAL local_print_list_at_Cons_internal_1 --> -8($fp) + # local_print_list_at_Cons_internal_1 = VCALL local_print_list_at_Cons_internal_0 out_int + # Save new self pointer in $s1 + lw $s1, -4($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 28($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -8($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_6 = SELF + sw $s1, -28($fp) + # LOCAL local_print_list_at_Cons_internal_4 --> -20($fp) + # LOCAL local_print_list_at_Cons_internal_6 --> -28($fp) + # local_print_list_at_Cons_internal_4 = local_print_list_at_Cons_internal_6 + lw $t0, -28($fp) + sw $t0, -20($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, data_5 + sw $t0, 12($v0) + li $t0, 1 + sw $t0, 16($v0) + sw $v0, -32($fp) + # ARG local_print_list_at_Cons_internal_7 + # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) + lw $t0, -32($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_print_list_at_Cons_internal_4 --> -20($fp) + # LOCAL local_print_list_at_Cons_internal_5 --> -24($fp) + # local_print_list_at_Cons_internal_5 = VCALL local_print_list_at_Cons_internal_4 out_string + # Save new self pointer in $s1 + lw $s1, -20($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 80($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -24($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # local_print_list_at_Cons_internal_10 = GETATTRIBUTE xcdr Cons + # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) + lw $t0, 16($s1) + sw $t0, -44($fp) + # LOCAL local_print_list_at_Cons_internal_8 --> -36($fp) + # LOCAL local_print_list_at_Cons_internal_10 --> -44($fp) + # local_print_list_at_Cons_internal_8 = local_print_list_at_Cons_internal_10 + lw $t0, -44($fp) + sw $t0, -36($fp) + # Push register s1 into stack + subu $sp, $sp, 4 + sw $s1, 0($sp) + # LOCAL local_print_list_at_Cons_internal_8 --> -36($fp) + # LOCAL local_print_list_at_Cons_internal_9 --> -40($fp) + # local_print_list_at_Cons_internal_9 = VCALL local_print_list_at_Cons_internal_8 print_list + # Save new self pointer in $s1 + lw $s1, -36($fp) + # Get pointer to type + lw $t0, 4($s1) + # Get pointer to type's VTABLE + lw $t0, 0($t0) + # Get pointer to function address + lw $t0, 76($t0) + # Call function. Result is on $v0 + jalr $t0 + sw $v0, -40($fp) + # Pop 4 bytes from stack into register s1 + lw $s1, 0($sp) + addu $sp, $sp, 4 + # RETURN local_print_list_at_Cons_internal_9 + lw $v0, -40($fp) + # Deallocate stack frame for function function_print_list_at_Cons. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 52 + jr $ra + # Function END + From 222e78f6a63b83941cdde4131bec9f5adb168b27 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Tue, 8 Dec 2020 18:23:28 -0500 Subject: [PATCH 161/162] remove unused imports --- src/grammar/grammar.py | 1 - src/mips/baseMipsVisitor.py | 3 - src/tools/follows.py | 18 +- src/travels/ciltomips.py | 1 - tests/codegen/arith.mips | 314 ++++++++++++++++----------------- tests/codegen/atoi.mips | 74 ++++---- tests/codegen/book_list.mips | 86 ++++----- tests/codegen/cells.mips | 58 +++--- tests/codegen/complex.mips | 34 ++-- tests/codegen/fib.mips | 26 +-- tests/codegen/graph.mips | 162 ++++++++--------- tests/codegen/hairyscary.mips | 88 ++++----- tests/codegen/hello_world.mips | 20 +-- tests/codegen/io.mips | 42 ++--- tests/codegen/life.mips | 170 +++++++++--------- tests/codegen/list.mips | 58 +++--- tests/codegen/new_complex.mips | 56 +++--- tests/codegen/palindrome.mips | 36 ++-- tests/codegen/primes.mips | 26 +-- tests/codegen/print-cool.mips | 32 ++-- tests/codegen/sort-list.mips | 84 ++++----- 21 files changed, 692 insertions(+), 697 deletions(-) diff --git a/src/grammar/grammar.py b/src/grammar/grammar.py index 4b1b82cb..a1df17c6 100755 --- a/src/grammar/grammar.py +++ b/src/grammar/grammar.py @@ -1,6 +1,5 @@ from typing import Dict, List, Optional, Type, Union from grammar.symbols import NonTerminal, Production, Symbol, Terminal, Sentence, Epsilon, EOF, AttributeProduction -import json class Grammar(): diff --git a/src/mips/baseMipsVisitor.py b/src/mips/baseMipsVisitor.py index 9d6c187f..fa3efa99 100644 --- a/src/mips/baseMipsVisitor.py +++ b/src/mips/baseMipsVisitor.py @@ -1,6 +1,3 @@ -from json import load - -from typed_ast.ast3 import arg from abstract.semantics import Attribute from abstract.semantics import Type as SemanticType from cil.nodes import TypeNode diff --git a/src/tools/follows.py b/src/tools/follows.py index 69d78989..06605744 100755 --- a/src/tools/follows.py +++ b/src/tools/follows.py @@ -1,9 +1,9 @@ -#%% from tools.firsts import ContainerSet, compute_firsts, compute_local_first from grammar.grammar import Grammar from grammar.symbols import Sentence -#%% -def compute_follows(G: Grammar,firsts): + + +def compute_follows(G: Grammar, firsts): follows = {} change = True @@ -23,17 +23,17 @@ def compute_follows(G: Grammar,firsts): while i < len(alpha): sym = alpha[i] if sym.IsNonTerminal: - if i == len(alpha)-1: + if i == len(alpha) - 1: follows[sym].update(follows[X]) else: try: - local = firsts[alpha[i+1::]] + local = firsts[alpha[i + 1 : :]] except KeyError: - local = compute_local_first(firsts, alpha[i+1::]) - + local = compute_local_first(firsts, alpha[i + 1 : :]) + change |= follows[sym].update(local) if local.contains_epsilon: change |= follows[sym].update(follows[X]) - i+= 1 - + i += 1 + return follows diff --git a/src/travels/ciltomips.py b/src/travels/ciltomips.py index 2772a938..ba925d20 100644 --- a/src/travels/ciltomips.py +++ b/src/travels/ciltomips.py @@ -1,4 +1,3 @@ -from pickle import TRUE from abstract.semantics import Type from cil.nodes import ( diff --git a/tests/codegen/arith.mips b/tests/codegen/arith.mips index 3be4ca38..e7f9dbb9 100644 --- a/tests/codegen/arith.mips +++ b/tests/codegen/arith.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:06 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:19 2020 # School of Math and Computer Science, University of Havana # @@ -34,7 +34,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_out_int_at_IO, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy +IO_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_out_int_at_IO, function_out_string_at_IO, dummy, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -48,7 +48,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy +Object_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -62,7 +62,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_length_at_String, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, function_concat_at_String, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy +String_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, function_length_at_String, function_abort_at_Object, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_concat_at_String, dummy # Function END # @@ -76,7 +76,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy +Bool_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -90,7 +90,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy +Int_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -104,7 +104,7 @@ Int_end: # **** VTABLE for type A2I **** -A2I_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_i2a_at_A2I, dummy, dummy, dummy, function_i2c_at_A2I, function_a2i_aux_at_A2I, dummy, dummy, function_i2a_aux_at_A2I, dummy, dummy, function_c2i_at_A2I, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_a2i_at_A2I +A2I_vtable: .word function_i2a_aux_at_A2I, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, function_i2a_at_A2I, dummy, dummy, dummy, dummy, dummy, function_i2c_at_A2I, dummy, function_a2i_aux_at_A2I, function_a2i_at_A2I, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_c2i_at_A2I, dummy, dummy, dummy, dummy # Function END # @@ -118,7 +118,7 @@ A2I_end: # **** VTABLE for type A **** -A_vtable: .word dummy, dummy, function_method4_at_A, dummy, function_copy_at_Object, function_method1_at_A, function_value_at_A, function_method5_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method3_at_A, dummy, dummy, function_method2_at_A, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_set_var_at_A, function_type_name_at_Object, dummy +A_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_method1_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method5_at_A, function_value_at_A, dummy, dummy, function_method2_at_A, function_set_var_at_A, dummy, dummy, dummy, function_method3_at_A, dummy, dummy, function_method4_at_A # Function END # @@ -132,7 +132,7 @@ A_end: # **** VTABLE for type B **** -B_vtable: .word dummy, dummy, function_method4_at_A, dummy, function_copy_at_Object, function_method1_at_A, function_value_at_A, function_method5_at_B, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method3_at_A, dummy, dummy, function_method2_at_A, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_set_var_at_A, function_type_name_at_Object, dummy +B_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_method1_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method5_at_B, function_value_at_A, dummy, dummy, function_method2_at_A, function_set_var_at_A, dummy, dummy, dummy, function_method3_at_A, dummy, dummy, function_method4_at_A # Function END # @@ -146,7 +146,7 @@ B_end: # **** VTABLE for type D **** -D_vtable: .word dummy, dummy, function_method4_at_A, dummy, function_copy_at_Object, function_method1_at_A, function_value_at_A, function_method5_at_B, dummy, function_method7_at_D, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method3_at_A, dummy, dummy, function_method2_at_A, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_set_var_at_A, function_type_name_at_Object, dummy +D_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_method1_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method7_at_D, function_method5_at_B, function_value_at_A, dummy, dummy, function_method2_at_A, function_set_var_at_A, dummy, dummy, dummy, function_method3_at_A, dummy, dummy, function_method4_at_A # Function END # @@ -160,7 +160,7 @@ D_end: # **** VTABLE for type E **** -E_vtable: .word dummy, dummy, function_method4_at_A, dummy, function_copy_at_Object, function_method1_at_A, function_value_at_A, function_method5_at_B, dummy, function_method7_at_D, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method3_at_A, dummy, dummy, function_method2_at_A, function_abort_at_Object, dummy, dummy, dummy, function_method6_at_E, dummy, dummy, function_set_var_at_A, function_type_name_at_Object, dummy +E_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, function_method6_at_E, function_method1_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method7_at_D, function_method5_at_B, function_value_at_A, dummy, dummy, function_method2_at_A, function_set_var_at_A, dummy, dummy, dummy, function_method3_at_A, dummy, dummy, function_method4_at_A # Function END # @@ -174,7 +174,7 @@ E_end: # **** VTABLE for type C **** -C_vtable: .word dummy, dummy, function_method4_at_A, dummy, function_copy_at_Object, function_method1_at_A, function_value_at_A, function_method5_at_C, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method3_at_A, dummy, dummy, function_method2_at_A, function_abort_at_Object, dummy, dummy, dummy, function_method6_at_C, dummy, dummy, function_set_var_at_A, function_type_name_at_Object, dummy +C_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, function_method6_at_C, function_method1_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method5_at_C, function_value_at_A, dummy, dummy, function_method2_at_A, function_set_var_at_A, dummy, dummy, dummy, function_method3_at_A, dummy, dummy, function_method4_at_A # Function END # @@ -188,7 +188,7 @@ C_end: # **** VTABLE for type Main **** -Main_vtable: .word function_out_int_at_IO, function_is_even_at_Main, dummy, function_main_at_Main, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_print_at_Main, dummy, dummy, function_in_int_at_IO, function_in_string_at_IO, dummy, function_prompt_at_Main, dummy, dummy, function_class_type_at_Main, dummy, function_abort_at_Object, dummy, function_out_string_at_IO, dummy, dummy, function_menu_at_Main, function_get_int_at_Main, dummy, function_type_name_at_Object, dummy +Main_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, function_menu_at_Main, function_class_type_at_Main, dummy, dummy, dummy, dummy, function_main_at_Main, function_out_int_at_IO, function_out_string_at_IO, dummy, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_is_even_at_Main, function_print_at_Main, dummy, dummy, function_in_int_at_IO, function_get_int_at_Main, dummy, dummy, function_prompt_at_Main, dummy, dummy # Function END # @@ -802,7 +802,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -1087,7 +1087,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 12($t0) + lw $t1, 44($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -3754,7 +3754,7 @@ label_FALSEIF_91: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -248($fp) @@ -6517,7 +6517,7 @@ label_FALSEIF_191: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -248($fp) @@ -6644,7 +6644,7 @@ function_a2i_at_A2I: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -7018,7 +7018,7 @@ label_FALSEIF_201: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 100($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -7322,7 +7322,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 40($t0) +lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -108($fp) @@ -7414,7 +7414,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 100($t0) +lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -7437,7 +7437,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 52($t0) +lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -7583,7 +7583,7 @@ label_FALSEIF_211: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 100($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -7887,7 +7887,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 40($t0) +lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -184($fp) @@ -7979,7 +7979,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 100($t0) +lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -168($fp) @@ -8002,7 +8002,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 52($t0) +lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -156($fp) @@ -8044,7 +8044,7 @@ label_FALSEIF_221: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -196($fp) @@ -8209,7 +8209,7 @@ function_a2i_aux_at_A2I: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -8525,7 +8525,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 100($t0) +lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -68($fp) @@ -8548,7 +8548,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 76($t0) +lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -9114,7 +9114,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 64($t0) +lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -9290,7 +9290,7 @@ label_FALSEIF_245: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 64($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -9313,7 +9313,7 @@ label_FALSEIF_245: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 92($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -9750,7 +9750,7 @@ label_FALSEIF_249: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 64($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -52($fp) @@ -9899,7 +9899,7 @@ label_FALSEIF_249: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -9922,7 +9922,7 @@ label_FALSEIF_249: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 92($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -10239,7 +10239,7 @@ function_method2_at_A: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 116($t0) + lw $t0, 96($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -10415,7 +10415,7 @@ function_method3_at_A: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 116($t0) + lw $t0, 96($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -10686,7 +10686,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 116($t0) +lw $t0, 96($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -10845,7 +10845,7 @@ label_FALSEIF_259: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 116($t0) + lw $t0, 96($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -11298,7 +11298,7 @@ label_WHILE_END_264: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 116($t0) + lw $t0, 96($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -11473,7 +11473,7 @@ function_method5_at_B: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 116($t0) + lw $t0, 96($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -11732,7 +11732,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 36($t0) +lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -12668,7 +12668,7 @@ label_FALSEIF_291: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -116($fp) @@ -12898,7 +12898,7 @@ function_method6_at_E: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 116($t0) + lw $t0, 96($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -13074,7 +13074,7 @@ function_method6_at_C: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 116($t0) + lw $t0, 96($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -13287,7 +13287,7 @@ function_method5_at_C: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 116($t0) + lw $t0, 96($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -13495,7 +13495,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -13533,7 +13533,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -13585,7 +13585,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -13637,7 +13637,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -13675,7 +13675,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -13727,7 +13727,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -13779,7 +13779,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -104($fp) @@ -13817,7 +13817,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -120($fp) @@ -13869,7 +13869,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -13921,7 +13921,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -152($fp) @@ -13959,7 +13959,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -168($fp) @@ -14011,7 +14011,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -184($fp) @@ -14063,7 +14063,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -200($fp) @@ -14101,7 +14101,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -216($fp) @@ -14153,7 +14153,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -232($fp) @@ -14205,7 +14205,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -248($fp) @@ -14243,7 +14243,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -264($fp) @@ -14295,7 +14295,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -280($fp) @@ -14347,7 +14347,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -296($fp) @@ -14385,7 +14385,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -312($fp) @@ -14437,7 +14437,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -328($fp) @@ -14489,7 +14489,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -344($fp) @@ -14527,7 +14527,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -360($fp) @@ -14579,7 +14579,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -376($fp) @@ -14631,7 +14631,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -392($fp) @@ -14683,7 +14683,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -408($fp) @@ -14784,7 +14784,7 @@ function_prompt_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -14836,7 +14836,7 @@ function_prompt_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -14978,7 +14978,7 @@ function_get_int_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 68($t0) + lw $t0, 116($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -15014,7 +15014,7 @@ function_get_int_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 124($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -15271,7 +15271,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 4($t0) +lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -15932,7 +15932,7 @@ label_FALSEIF_315: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -15992,7 +15992,7 @@ function_class_type_at_Main: # local_class_type_at_Main_internal_3 = 15 li $t0, 15 sw $t0, -16($fp) - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type A @@ -16014,7 +16014,7 @@ function_class_type_at_Main: lw $t0, -20($fp) sw $t0, -16($fp) label_Not_min0_325: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type B @@ -16036,7 +16036,7 @@ function_class_type_at_Main: lw $t0, -20($fp) sw $t0, -16($fp) label_Not_min1_326: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type C @@ -16058,7 +16058,7 @@ function_class_type_at_Main: lw $t0, -20($fp) sw $t0, -16($fp) label_Not_min2_327: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type D @@ -16080,7 +16080,7 @@ function_class_type_at_Main: lw $t0, -20($fp) sw $t0, -16($fp) label_Not_min3_328: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type E @@ -16102,7 +16102,7 @@ function_class_type_at_Main: lw $t0, -20($fp) sw $t0, -16($fp) label_Not_min4_329: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type Object @@ -16140,7 +16140,7 @@ function_class_type_at_Main: # IF_ZERO local_class_type_at_Main_internal_1 GOTO label_ERROR_331 lw $t0, -8($fp) beq $t0, 0, label_ERROR_331 - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type A @@ -16206,7 +16206,7 @@ function_class_type_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -16221,7 +16221,7 @@ function_class_type_at_Main: # GOTO label_END_332 j label_END_332 label_NEXT0_333: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type B @@ -16287,7 +16287,7 @@ label_NEXT0_333: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -52($fp) @@ -16302,7 +16302,7 @@ label_NEXT0_333: # GOTO label_END_332 j label_END_332 label_NEXT1_334: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type C @@ -16368,7 +16368,7 @@ label_NEXT1_334: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -16383,7 +16383,7 @@ label_NEXT1_334: # GOTO label_END_332 j label_END_332 label_NEXT2_335: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type D @@ -16449,7 +16449,7 @@ label_NEXT2_335: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -16464,7 +16464,7 @@ label_NEXT2_335: # GOTO label_END_332 j label_END_332 label_NEXT3_336: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type E @@ -16530,7 +16530,7 @@ label_NEXT3_336: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -112($fp) @@ -16545,7 +16545,7 @@ label_NEXT3_336: # GOTO label_END_332 j label_END_332 label_NEXT4_337: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type Object @@ -16611,7 +16611,7 @@ label_NEXT4_337: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -132($fp) @@ -16751,7 +16751,7 @@ function_print_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 24($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -16797,7 +16797,7 @@ function_print_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -16849,7 +16849,7 @@ function_print_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -16989,7 +16989,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -17027,7 +17027,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -17067,7 +17067,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 24($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -17090,7 +17090,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -17152,7 +17152,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -84($fp) @@ -17212,7 +17212,7 @@ label_FALSEIF_341: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -100($fp) @@ -17256,7 +17256,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 80($t0) +lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -116($fp) @@ -17284,7 +17284,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 108($t0) +lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -132($fp) @@ -17597,7 +17597,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 112($t0) +lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -180($fp) @@ -17620,7 +17620,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 116($t0) +lw $t0, 96($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -168($fp) @@ -17707,7 +17707,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 24($t0) +lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -204($fp) @@ -17742,7 +17742,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 24($t0) +lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -216($fp) @@ -17765,7 +17765,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 84($t0) +lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -192($fp) @@ -18023,7 +18023,7 @@ sw $t1, -252($fp) # local_main_at_Main_internal_65 = 15 li $t0, 15 sw $t0, -264($fp) -# local_main_at_Main_internal_66 = TYPE_DISTANCE C +# local_main_at_Main_internal_66 = TYPE_DISTANCE C # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) # Load TDT pointer to type C @@ -18045,7 +18045,7 @@ bgtu $t0, $t1, label_Not_min0_363 lw $t0, -268($fp) sw $t0, -264($fp) label_Not_min0_363: - # local_main_at_Main_internal_66 = TYPE_DISTANCE A + # local_main_at_Main_internal_66 = TYPE_DISTANCE A # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) # Load TDT pointer to type A @@ -18067,7 +18067,7 @@ label_Not_min0_363: lw $t0, -268($fp) sw $t0, -264($fp) label_Not_min1_364: - # local_main_at_Main_internal_66 = TYPE_DISTANCE Object + # local_main_at_Main_internal_66 = TYPE_DISTANCE Object # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) # Load TDT pointer to type Object @@ -18105,7 +18105,7 @@ label_Not_min0_363: # IF_ZERO local_main_at_Main_internal_63 GOTO label_ERROR_366 lw $t0, -256($fp) beq $t0, 0, label_ERROR_366 - # local_main_at_Main_internal_66 = TYPE_DISTANCE C + # local_main_at_Main_internal_66 = TYPE_DISTANCE C # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) # Load TDT pointer to type C @@ -18152,7 +18152,7 @@ label_Not_min0_363: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 24($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -288($fp) @@ -18175,7 +18175,7 @@ label_Not_min0_363: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 104($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -280($fp) @@ -18191,7 +18191,7 @@ label_Not_min0_363: # GOTO label_END_367 j label_END_367 label_NEXT0_368: - # local_main_at_Main_internal_66 = TYPE_DISTANCE A + # local_main_at_Main_internal_66 = TYPE_DISTANCE A # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) # Load TDT pointer to type A @@ -18238,7 +18238,7 @@ label_NEXT0_368: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 24($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -308($fp) @@ -18261,7 +18261,7 @@ label_NEXT0_368: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 112($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -300($fp) @@ -18277,7 +18277,7 @@ label_NEXT0_368: # GOTO label_END_367 j label_END_367 label_NEXT1_369: - # local_main_at_Main_internal_66 = TYPE_DISTANCE Object + # local_main_at_Main_internal_66 = TYPE_DISTANCE Object # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) # Load TDT pointer to type Object @@ -18343,7 +18343,7 @@ label_NEXT1_369: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -320($fp) @@ -18371,7 +18371,7 @@ label_NEXT1_369: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -336($fp) @@ -18744,7 +18744,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 112($t0) +lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -388($fp) @@ -18767,7 +18767,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 116($t0) +lw $t0, 96($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -376($fp) @@ -18854,7 +18854,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 24($t0) +lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -412($fp) @@ -18889,7 +18889,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 24($t0) +lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -424($fp) @@ -18912,7 +18912,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 8($t0) +lw $t0, 124($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -400($fp) @@ -19226,7 +19226,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 24($t0) +lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -468($fp) @@ -19247,7 +19247,7 @@ lw $s1, -460($fp) # Get pointer to type's VTABLE la $t0, A_vtable # Get pointer to function address -lw $t1, 28($t0) +lw $t1, 76($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -456($fp) @@ -19561,7 +19561,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 24($t0) +lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -512($fp) @@ -19582,7 +19582,7 @@ lw $s1, -504($fp) # Get pointer to type's VTABLE la $t0, B_vtable # Get pointer to function address -lw $t1, 28($t0) +lw $t1, 76($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -500($fp) @@ -19896,7 +19896,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 24($t0) +lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -556($fp) @@ -19917,7 +19917,7 @@ lw $s1, -548($fp) # Get pointer to type's VTABLE la $t0, C_vtable # Get pointer to function address -lw $t1, 28($t0) +lw $t1, 76($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -544($fp) @@ -20236,7 +20236,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 24($t0) +lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -612($fp) @@ -20259,7 +20259,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 36($t0) +lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -600($fp) @@ -20321,7 +20321,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 96($t0) +lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -624($fp) @@ -20359,7 +20359,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 44($t0) +lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -640($fp) @@ -20411,7 +20411,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 96($t0) +lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -656($fp) @@ -20471,7 +20471,7 @@ label_FALSEIF_421: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -672($fp) @@ -20509,7 +20509,7 @@ label_FALSEIF_421: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -688($fp) @@ -20561,7 +20561,7 @@ label_FALSEIF_421: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -704($fp) @@ -20889,7 +20889,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 24($t0) +lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -760($fp) @@ -20912,7 +20912,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 104($t0) +lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -748($fp) @@ -20977,7 +20977,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 24($t0) +lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -780($fp) @@ -21002,7 +21002,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 24($t0) +lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -796($fp) @@ -21166,7 +21166,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 96($t0) +lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -808($fp) @@ -21204,7 +21204,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 44($t0) +lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -824($fp) @@ -21256,7 +21256,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 96($t0) +lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -840($fp) @@ -21290,7 +21290,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 44($t0) +lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -856($fp) @@ -21342,7 +21342,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 96($t0) +lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -868($fp) @@ -21454,7 +21454,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 96($t0) +lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -892($fp) @@ -21506,7 +21506,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 96($t0) +lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -912($fp) @@ -22147,7 +22147,7 @@ label_FALSEIF_443: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 24($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -996($fp) @@ -22170,7 +22170,7 @@ label_FALSEIF_443: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -984($fp) diff --git a/tests/codegen/atoi.mips b/tests/codegen/atoi.mips index cb161068..6071bb14 100644 --- a/tests/codegen/atoi.mips +++ b/tests/codegen/atoi.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:07 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:21 2020 # School of Math and Computer Science, University of Havana # @@ -24,7 +24,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word dummy, function_out_string_at_IO, function_in_string_at_IO, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, function_abort_at_Object, dummy +IO_vtable: .word dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, dummy, dummy, function_in_int_at_IO, dummy, function_out_int_at_IO, function_out_string_at_IO, dummy, function_abort_at_Object # Function END # @@ -38,7 +38,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy +Object_vtable: .word dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object # Function END # @@ -52,7 +52,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, function_length_at_String, dummy, dummy, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, function_abort_at_Object, function_concat_at_String +String_vtable: .word dummy, function_concat_at_String, dummy, function_copy_at_Object, dummy, function_substr_at_String, function_type_name_at_Object, dummy, dummy, dummy, function_length_at_String, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object # Function END # @@ -66,7 +66,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy +Bool_vtable: .word dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object # Function END # @@ -80,7 +80,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy +Int_vtable: .word dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object # Function END # @@ -94,7 +94,7 @@ Int_end: # **** VTABLE for type A2I **** -A2I_vtable: .word function_c2i_at_A2I, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_i2c_at_A2I, dummy, function_a2i_aux_at_A2I, function_i2a_at_A2I, dummy, function_i2a_aux_at_A2I, dummy, function_a2i_at_A2I, dummy, function_abort_at_Object, dummy +A2I_vtable: .word function_a2i_aux_at_A2I, dummy, dummy, function_copy_at_Object, function_a2i_at_A2I, dummy, function_type_name_at_Object, dummy, function_c2i_at_A2I, function_i2a_aux_at_A2I, dummy, dummy, function_i2a_at_A2I, dummy, dummy, function_i2c_at_A2I, function_abort_at_Object # Function END # @@ -108,7 +108,7 @@ A2I_end: # **** VTABLE for type Main **** -Main_vtable: .word dummy, function_out_string_at_IO, function_in_string_at_IO, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, function_main_at_Main, dummy, function_in_int_at_IO, function_abort_at_Object, dummy +Main_vtable: .word dummy, dummy, function_main_at_Main, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, dummy, dummy, function_in_int_at_IO, dummy, function_out_int_at_IO, function_out_string_at_IO, dummy, function_abort_at_Object # Function END # @@ -533,7 +533,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -786,7 +786,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 48($t0) + lw $t1, 8($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -3453,7 +3453,7 @@ label_FALSEIF_91: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -248($fp) @@ -6216,7 +6216,7 @@ label_FALSEIF_191: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -248($fp) @@ -6343,7 +6343,7 @@ function_a2i_at_A2I: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -6717,7 +6717,7 @@ label_FALSEIF_201: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -7021,7 +7021,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 20($t0) +lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -108($fp) @@ -7113,7 +7113,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 40($t0) +lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -7136,7 +7136,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 32($t0) +lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -7282,7 +7282,7 @@ label_FALSEIF_211: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -7586,7 +7586,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 20($t0) +lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -184($fp) @@ -7678,7 +7678,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 40($t0) +lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -168($fp) @@ -7701,7 +7701,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 32($t0) +lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -156($fp) @@ -7743,7 +7743,7 @@ label_FALSEIF_221: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -196($fp) @@ -7908,7 +7908,7 @@ function_a2i_aux_at_A2I: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -8224,7 +8224,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 40($t0) +lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -68($fp) @@ -8247,7 +8247,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 0($t0) +lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -8813,7 +8813,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 44($t0) +lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -8989,7 +8989,7 @@ label_FALSEIF_245: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -9012,7 +9012,7 @@ label_FALSEIF_245: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 64($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -9449,7 +9449,7 @@ label_FALSEIF_249: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -52($fp) @@ -9598,7 +9598,7 @@ label_FALSEIF_249: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 24($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -9621,7 +9621,7 @@ label_FALSEIF_249: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 64($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -9768,7 +9768,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -9891,7 +9891,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -9930,7 +9930,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -9982,7 +9982,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -10016,7 +10016,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -76($fp) @@ -10068,7 +10068,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) diff --git a/tests/codegen/book_list.mips b/tests/codegen/book_list.mips index 1a017406..1dce3097 100644 --- a/tests/codegen/book_list.mips +++ b/tests/codegen/book_list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:07 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:20 2020 # School of Math and Computer Science, University of Havana # @@ -32,7 +32,7 @@ Article: .asciiz "Article" # **** VTABLE for type IO **** -IO_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, dummy, function_out_int_at_IO, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_in_string_at_IO, function_in_int_at_IO, dummy, dummy, dummy, dummy, function_out_string_at_IO +IO_vtable: .word dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, dummy, dummy, function_out_string_at_IO, dummy, dummy, dummy, function_out_int_at_IO, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, function_in_int_at_IO, function_abort_at_Object, dummy # Function END # @@ -46,7 +46,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy # Function END # @@ -60,7 +60,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, function_type_name_at_Object, dummy, function_concat_at_String, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, function_length_at_String, dummy, dummy +String_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_concat_at_String, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, function_substr_at_String, dummy, dummy, function_abort_at_Object, function_length_at_String # Function END # @@ -74,7 +74,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy # Function END # @@ -88,7 +88,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy # Function END # @@ -102,7 +102,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word dummy, function_type_name_at_Object, function_main_at_Main, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Main_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_main_at_Main, dummy, function_abort_at_Object, dummy # Function END # @@ -116,7 +116,7 @@ Main_end: # **** VTABLE for type BookList **** -BookList_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, function_isNil_at_BookList, function_out_int_at_IO, function_copy_at_Object, function_car_at_BookList, function_print_list_at_BookList, function_cdr_at_BookList, dummy, dummy, function_in_string_at_IO, function_in_int_at_IO, dummy, function_cons_at_BookList, dummy, dummy, function_out_string_at_IO +BookList_vtable: .word function_cdr_at_BookList, function_car_at_BookList, function_isNil_at_BookList, function_in_string_at_IO, dummy, dummy, dummy, dummy, function_out_string_at_IO, function_cons_at_BookList, dummy, function_print_list_at_BookList, function_out_int_at_IO, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, function_in_int_at_IO, function_abort_at_Object, dummy # Function END # @@ -130,7 +130,7 @@ BookList_end: # **** VTABLE for type Nil **** -Nil_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, function_isNil_at_Nil, function_out_int_at_IO, function_copy_at_Object, function_car_at_BookList, function_print_list_at_Nil, function_cdr_at_BookList, dummy, dummy, function_in_string_at_IO, function_in_int_at_IO, dummy, function_cons_at_BookList, dummy, dummy, function_out_string_at_IO +Nil_vtable: .word function_cdr_at_BookList, function_car_at_BookList, function_isNil_at_Nil, function_in_string_at_IO, dummy, dummy, dummy, dummy, function_out_string_at_IO, function_cons_at_BookList, dummy, function_print_list_at_Nil, function_out_int_at_IO, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, function_in_int_at_IO, function_abort_at_Object, dummy # Function END # @@ -144,7 +144,7 @@ Nil_end: # **** VTABLE for type Cons **** -Cons_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, function_isNil_at_Cons, function_out_int_at_IO, function_copy_at_Object, function_car_at_Cons, function_print_list_at_Cons, function_cdr_at_Cons, dummy, dummy, function_in_string_at_IO, function_in_int_at_IO, function_init_at_Cons, function_cons_at_BookList, dummy, dummy, function_out_string_at_IO +Cons_vtable: .word function_cdr_at_Cons, function_car_at_Cons, function_isNil_at_Cons, function_in_string_at_IO, function_init_at_Cons, dummy, dummy, dummy, function_out_string_at_IO, function_cons_at_BookList, dummy, function_print_list_at_Cons, function_out_int_at_IO, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, function_in_int_at_IO, function_abort_at_Object, dummy # Function END # @@ -158,7 +158,7 @@ Cons_end: # **** VTABLE for type Book **** -Book_vtable: .word function_initBook_at_Book, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, dummy, function_out_int_at_IO, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_in_string_at_IO, function_in_int_at_IO, dummy, dummy, dummy, function_print_at_Book, function_out_string_at_IO +Book_vtable: .word dummy, dummy, dummy, function_in_string_at_IO, dummy, function_print_at_Book, dummy, function_initBook_at_Book, function_out_string_at_IO, dummy, dummy, dummy, function_out_int_at_IO, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, function_in_int_at_IO, function_abort_at_Object, dummy # Function END # @@ -172,7 +172,7 @@ Book_end: # **** VTABLE for type Article **** -Article_vtable: .word function_initBook_at_Book, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, dummy, function_out_int_at_IO, function_copy_at_Object, dummy, dummy, dummy, function_initArticle_at_Article, dummy, function_in_string_at_IO, function_in_int_at_IO, dummy, dummy, dummy, function_print_at_Article, function_out_string_at_IO +Article_vtable: .word dummy, dummy, dummy, function_in_string_at_IO, dummy, function_print_at_Article, dummy, function_initBook_at_Book, function_out_string_at_IO, dummy, function_initArticle_at_Article, dummy, function_out_int_at_IO, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, function_in_int_at_IO, function_abort_at_Object, dummy # Function END # @@ -537,7 +537,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -798,7 +798,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 8($t0) + lw $t1, 64($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -968,7 +968,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -1136,7 +1136,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -1210,7 +1210,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 64($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -68($fp) @@ -1241,7 +1241,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 64($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -1274,7 +1274,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -1323,7 +1323,7 @@ function_isNil_at_BookList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1479,7 +1479,7 @@ function_cons_at_BookList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -1530,7 +1530,7 @@ function_car_at_BookList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1633,7 +1633,7 @@ function_cdr_at_BookList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1720,7 +1720,7 @@ function_print_list_at_BookList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2054,7 +2054,7 @@ function_print_list_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2072,7 +2072,7 @@ function_print_list_at_Cons: # local_print_list_at_Cons_internal_6 = 14 li $t0, 14 sw $t0, -28($fp) - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Book @@ -2094,7 +2094,7 @@ function_print_list_at_Cons: lw $t0, -32($fp) sw $t0, -28($fp) label_Not_min0_1: - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Article @@ -2132,7 +2132,7 @@ function_print_list_at_Cons: # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 lw $t0, -20($fp) beq $t0, 0, label_ERROR_3 - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Book @@ -2198,7 +2198,7 @@ function_print_list_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -2213,7 +2213,7 @@ function_print_list_at_Cons: # GOTO label_END_4 j label_END_4 label_NEXT0_5: - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Article @@ -2279,7 +2279,7 @@ label_NEXT0_5: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -2333,7 +2333,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 36($t0) +lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -2520,7 +2520,7 @@ function_print_at_Book: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -2555,7 +2555,7 @@ function_print_at_Book: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -2604,7 +2604,7 @@ function_print_at_Book: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2656,7 +2656,7 @@ function_print_at_Book: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -2691,7 +2691,7 @@ function_print_at_Book: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -2740,7 +2740,7 @@ function_print_at_Book: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -2846,7 +2846,7 @@ function_initArticle_at_Article: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2897,7 +2897,7 @@ function_print_at_Article: # Get pointer to type's VTABLE la $t0, Book_vtable # Get pointer to function address - lw $t1, 72($t0) + lw $t1, 20($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -4($fp) @@ -2949,7 +2949,7 @@ function_print_at_Article: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -2984,7 +2984,7 @@ function_print_at_Article: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -3033,7 +3033,7 @@ function_print_at_Article: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) diff --git a/tests/codegen/cells.mips b/tests/codegen/cells.mips index 2d4b6cda..afea72a5 100644 --- a/tests/codegen/cells.mips +++ b/tests/codegen/cells.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:09 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:23 2020 # School of Math and Computer Science, University of Havana # @@ -24,7 +24,7 @@ CellularAutomaton: .asciiz "CellularAutomaton" # **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, dummy, function_in_int_at_IO, dummy, function_in_string_at_IO, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_out_int_at_IO +IO_vtable: .word function_type_name_at_Object, dummy, function_in_int_at_IO, function_out_int_at_IO, function_copy_at_Object, dummy, function_in_string_at_IO, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy # Function END # @@ -38,7 +38,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Object_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy # Function END # @@ -52,7 +52,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_concat_at_String, dummy, dummy, dummy, function_length_at_String, dummy, dummy, function_copy_at_Object, function_substr_at_String, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +String_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_length_at_String, dummy, function_concat_at_String, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, function_substr_at_String # Function END # @@ -66,7 +66,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Bool_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy # Function END # @@ -80,7 +80,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Int_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy # Function END # @@ -94,7 +94,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, dummy, dummy, function_main_at_Main, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Main_vtable: .word function_type_name_at_Object, function_main_at_Main, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy # Function END # @@ -108,7 +108,7 @@ Main_end: # **** VTABLE for type CellularAutomaton **** -CellularAutomaton_vtable: .word function_abort_at_Object, dummy, function_in_int_at_IO, dummy, function_in_string_at_IO, dummy, function_cell_at_next_evolution_at_CellularAutomaton, function_cell_at_CellularAutomaton, function_copy_at_Object, dummy, function_type_name_at_Object, function_num_cells_at_CellularAutomaton, function_out_string_at_IO, function_init_at_CellularAutomaton, function_cell_left_neighbor_at_CellularAutomaton, function_print_at_CellularAutomaton, function_cell_right_neighbor_at_CellularAutomaton, function_evolve_at_CellularAutomaton, function_out_int_at_IO +CellularAutomaton_vtable: .word function_type_name_at_Object, dummy, function_in_int_at_IO, function_out_int_at_IO, function_copy_at_Object, function_evolve_at_CellularAutomaton, function_in_string_at_IO, function_out_string_at_IO, function_num_cells_at_CellularAutomaton, dummy, function_init_at_CellularAutomaton, dummy, function_cell_right_neighbor_at_CellularAutomaton, function_abort_at_Object, function_cell_left_neighbor_at_CellularAutomaton, function_cell_at_CellularAutomaton, function_print_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, dummy # Function END # @@ -445,7 +445,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -706,7 +706,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 12($t0) + lw $t1, 4($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -840,7 +840,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -873,7 +873,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -1096,7 +1096,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 68($t0) +lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -1125,7 +1125,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 60($t0) +lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -68($fp) @@ -1360,7 +1360,7 @@ function_print_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -1383,7 +1383,7 @@ function_print_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1436,7 +1436,7 @@ function_num_cells_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1530,7 +1530,7 @@ function_cell_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1829,7 +1829,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 44($t0) +lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -1921,7 +1921,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 28($t0) +lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -2032,7 +2032,7 @@ label_FALSEIF_5: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -2090,7 +2090,7 @@ function_cell_right_neighbor_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -2429,7 +2429,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 28($t0) +lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -2540,7 +2540,7 @@ label_FALSEIF_15: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -2604,7 +2604,7 @@ function_cell_at_next_evolution_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -3308,7 +3308,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 64($t0) +lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -128($fp) @@ -4044,7 +4044,7 @@ function_evolve_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -4205,7 +4205,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 24($t0) +lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -4228,7 +4228,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 4($t0) +lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) diff --git a/tests/codegen/complex.mips b/tests/codegen/complex.mips index a019cde9..8c733650 100644 --- a/tests/codegen/complex.mips +++ b/tests/codegen/complex.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:06 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:20 2020 # School of Math and Computer Science, University of Havana # @@ -24,7 +24,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_out_string_at_IO, dummy, function_abort_at_Object, function_type_name_at_Object, function_out_int_at_IO, dummy, dummy, function_in_int_at_IO, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_in_string_at_IO +IO_vtable: .word dummy, function_copy_at_Object, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, function_in_int_at_IO, dummy, function_type_name_at_Object, function_out_string_at_IO, function_in_string_at_IO, function_abort_at_Object, dummy, dummy # Function END # @@ -38,7 +38,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy +Object_vtable: .word dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy # Function END # @@ -52,7 +52,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, function_concat_at_String, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, function_length_at_String, function_substr_at_String, dummy, dummy, dummy +String_vtable: .word dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_substr_at_String, function_length_at_String, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, dummy, function_concat_at_String # Function END # @@ -66,7 +66,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy +Bool_vtable: .word dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy # Function END # @@ -80,7 +80,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy +Int_vtable: .word dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy # Function END # @@ -94,7 +94,7 @@ Int_end: # **** VTABLE for type Complex **** -Complex_vtable: .word function_out_string_at_IO, dummy, function_abort_at_Object, function_type_name_at_Object, function_out_int_at_IO, function_init_at_Complex, function_reflect_0_at_Complex, function_in_int_at_IO, function_reflect_Y_at_Complex, dummy, function_copy_at_Object, dummy, dummy, function_reflect_X_at_Complex, function_print_at_Complex, function_in_string_at_IO +Complex_vtable: .word function_reflect_Y_at_Complex, function_copy_at_Object, function_reflect_0_at_Complex, dummy, function_out_int_at_IO, function_init_at_Complex, dummy, dummy, function_in_int_at_IO, function_reflect_X_at_Complex, function_type_name_at_Object, function_out_string_at_IO, function_in_string_at_IO, function_abort_at_Object, function_print_at_Complex, dummy # Function END # @@ -108,7 +108,7 @@ Complex_end: # **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, dummy, function_abort_at_Object, function_type_name_at_Object, function_out_int_at_IO, dummy, dummy, function_in_int_at_IO, dummy, function_main_at_Main, function_copy_at_Object, dummy, dummy, dummy, dummy, function_in_string_at_IO +Main_vtable: .word dummy, function_copy_at_Object, dummy, function_main_at_Main, function_out_int_at_IO, dummy, dummy, dummy, function_in_int_at_IO, dummy, function_type_name_at_Object, function_out_string_at_IO, function_in_string_at_IO, function_abort_at_Object, dummy, dummy # Function END # @@ -433,7 +433,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -686,7 +686,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 36($t0) + lw $t1, 12($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -1607,7 +1607,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -1691,7 +1691,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -2945,7 +2945,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -2970,7 +2970,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -2995,7 +2995,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 24($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -3252,7 +3252,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 0($t0) +lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -3312,7 +3312,7 @@ label_FALSEIF_59: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips index 20ef2aee..d4af9976 100644 --- a/tests/codegen/fib.mips +++ b/tests/codegen/fib.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:06 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:20 2020 # School of Math and Computer Science, University of Havana # @@ -22,7 +22,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_copy_at_Object, function_in_string_at_IO, function_in_int_at_IO, dummy, function_out_string_at_IO, function_out_int_at_IO, dummy, dummy, dummy, dummy, function_type_name_at_Object +IO_vtable: .word function_copy_at_Object, dummy, function_out_string_at_IO, function_out_int_at_IO, dummy, function_in_int_at_IO, dummy, dummy, function_in_string_at_IO, dummy, function_abort_at_Object, function_type_name_at_Object # Function END # @@ -36,7 +36,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object +Object_vtable: .word function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, function_type_name_at_Object # Function END # @@ -50,7 +50,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_concat_at_String, function_substr_at_String, function_length_at_String, function_type_name_at_Object +String_vtable: .word function_copy_at_Object, function_substr_at_String, dummy, dummy, dummy, dummy, dummy, function_concat_at_String, dummy, function_length_at_String, function_abort_at_Object, function_type_name_at_Object # Function END # @@ -64,7 +64,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object +Bool_vtable: .word function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, function_type_name_at_Object # Function END # @@ -78,7 +78,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object +Int_vtable: .word function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, function_type_name_at_Object # Function END # @@ -92,7 +92,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_copy_at_Object, function_in_string_at_IO, function_in_int_at_IO, function_fib_at_Main, function_out_string_at_IO, function_out_int_at_IO, function_main_at_Main, dummy, dummy, dummy, function_type_name_at_Object +Main_vtable: .word function_copy_at_Object, dummy, function_out_string_at_IO, function_out_int_at_IO, function_fib_at_Main, function_in_int_at_IO, function_main_at_Main, dummy, function_in_string_at_IO, dummy, function_abort_at_Object, function_type_name_at_Object # Function END # @@ -408,7 +408,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -661,7 +661,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 28($t0) + lw $t1, 24($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -731,7 +731,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -781,7 +781,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -827,7 +827,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 24($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -879,7 +879,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) diff --git a/tests/codegen/graph.mips b/tests/codegen/graph.mips index 1dfec536..9ad598a6 100644 --- a/tests/codegen/graph.mips +++ b/tests/codegen/graph.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:07 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:21 2020 # School of Math and Computer Science, University of Havana # @@ -40,7 +40,7 @@ Vertice: .asciiz "Vertice" # **** VTABLE for type IO **** -IO_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_out_int_at_IO, dummy, dummy, dummy +IO_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, function_out_string_at_IO, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_out_int_at_IO # Function END # @@ -54,7 +54,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Object_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -68,7 +68,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, dummy, function_length_at_String, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, function_concat_at_String, dummy, dummy, dummy, dummy, dummy, dummy +String_vtable: .word dummy, dummy, dummy, function_concat_at_String, function_copy_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, function_length_at_String, function_substr_at_String, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -82,7 +82,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Bool_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -96,7 +96,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Int_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -110,7 +110,7 @@ Int_end: # **** VTABLE for type BoolOp **** -BoolOp_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy, function_and_at_BoolOp, dummy, function_or_at_BoolOp, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +BoolOp_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, function_or_at_BoolOp, dummy, dummy, dummy, dummy, function_and_at_BoolOp, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -124,7 +124,7 @@ BoolOp_end: # **** VTABLE for type Graph **** -Graph_vtable: .word dummy, dummy, dummy, dummy, dummy, function_add_vertice_at_Graph, function_print_V_at_Graph, function_copy_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_print_E_at_Graph, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Graph_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, function_print_E_at_Graph, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_add_vertice_at_Graph, dummy, dummy, function_print_V_at_Graph, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -138,7 +138,7 @@ Graph_end: # **** VTABLE for type Parse **** -Parse_vtable: .word dummy, dummy, dummy, function_a2i_at_Parse, function_a2i_aux_at_Parse, dummy, dummy, function_copy_at_Object, function_c2i_at_Parse, dummy, function_abort_at_Object, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, dummy, function_parse_line_at_Parse, dummy, function_in_string_at_IO, dummy, function_out_int_at_IO, dummy, function_read_input_at_Parse, dummy +Parse_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, dummy, function_parse_line_at_Parse, dummy, function_c2i_at_Parse, dummy, function_in_int_at_IO, function_out_string_at_IO, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_a2i_aux_at_Parse, dummy, dummy, dummy, dummy, function_a2i_at_Parse, dummy, function_read_input_at_Parse, function_out_int_at_IO # Function END # @@ -152,7 +152,7 @@ Parse_end: # **** VTABLE for type Main **** -Main_vtable: .word dummy, dummy, dummy, function_a2i_at_Parse, function_a2i_aux_at_Parse, dummy, dummy, function_copy_at_Object, function_c2i_at_Parse, dummy, function_abort_at_Object, dummy, dummy, dummy, function_in_int_at_IO, dummy, function_main_at_Main, dummy, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, dummy, function_parse_line_at_Parse, dummy, function_in_string_at_IO, dummy, function_out_int_at_IO, dummy, function_read_input_at_Parse, dummy +Main_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, dummy, function_parse_line_at_Parse, dummy, function_c2i_at_Parse, dummy, function_in_int_at_IO, function_out_string_at_IO, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_a2i_aux_at_Parse, dummy, dummy, function_main_at_Main, dummy, function_a2i_at_Parse, dummy, function_read_input_at_Parse, function_out_int_at_IO # Function END # @@ -166,7 +166,7 @@ Main_end: # **** VTABLE for type VList **** -VList_vtable: .word dummy, function_head_at_VList, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, function_isNil_at_VList, dummy, dummy, function_in_int_at_IO, dummy, dummy, function_tail_at_VList, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, function_print_at_VList, dummy, dummy, function_in_string_at_IO, function_cons_at_VList, function_out_int_at_IO, dummy, dummy, dummy +VList_vtable: .word dummy, function_head_at_VList, function_tail_at_VList, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, function_out_string_at_IO, dummy, function_cons_at_VList, function_abort_at_Object, dummy, dummy, dummy, dummy, function_isNil_at_VList, dummy, dummy, function_print_at_VList, dummy, dummy, dummy, function_out_int_at_IO # Function END # @@ -180,7 +180,7 @@ VList_end: # **** VTABLE for type VCons **** -VCons_vtable: .word dummy, function_head_at_VCons, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, function_isNil_at_VCons, dummy, dummy, function_in_int_at_IO, dummy, dummy, function_tail_at_VCons, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, function_print_at_VCons, dummy, dummy, function_in_string_at_IO, function_cons_at_VList, function_out_int_at_IO, function_init_at_VCons, dummy, dummy +VCons_vtable: .word dummy, function_head_at_VCons, function_tail_at_VCons, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, dummy, dummy, function_init_at_VCons, dummy, dummy, function_in_int_at_IO, function_out_string_at_IO, dummy, function_cons_at_VList, function_abort_at_Object, dummy, dummy, dummy, dummy, function_isNil_at_VCons, dummy, dummy, function_print_at_VCons, dummy, dummy, dummy, function_out_int_at_IO # Function END # @@ -194,7 +194,7 @@ VCons_end: # **** VTABLE for type EList **** -EList_vtable: .word dummy, function_head_at_EList, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, function_isNil_at_EList, dummy, dummy, function_in_int_at_IO, dummy, dummy, function_tail_at_EList, function_append_at_EList, function_type_name_at_Object, dummy, function_out_string_at_IO, function_print_at_EList, dummy, dummy, function_in_string_at_IO, function_cons_at_EList, function_out_int_at_IO, dummy, dummy, dummy +EList_vtable: .word dummy, function_head_at_EList, function_tail_at_EList, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, function_append_at_EList, dummy, dummy, dummy, dummy, function_in_int_at_IO, function_out_string_at_IO, dummy, function_cons_at_EList, function_abort_at_Object, dummy, dummy, dummy, dummy, function_isNil_at_EList, dummy, dummy, function_print_at_EList, dummy, dummy, dummy, function_out_int_at_IO # Function END # @@ -208,7 +208,7 @@ EList_end: # **** VTABLE for type ECons **** -ECons_vtable: .word dummy, function_head_at_ECons, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, function_isNil_at_ECons, dummy, dummy, function_in_int_at_IO, dummy, dummy, function_tail_at_ECons, function_append_at_EList, function_type_name_at_Object, dummy, function_out_string_at_IO, function_print_at_ECons, dummy, dummy, function_in_string_at_IO, function_cons_at_EList, function_out_int_at_IO, function_init_at_ECons, dummy, dummy +ECons_vtable: .word dummy, function_head_at_ECons, function_tail_at_ECons, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, function_append_at_EList, dummy, function_init_at_ECons, dummy, dummy, function_in_int_at_IO, function_out_string_at_IO, dummy, function_cons_at_EList, function_abort_at_Object, dummy, dummy, dummy, dummy, function_isNil_at_ECons, dummy, dummy, function_print_at_ECons, dummy, dummy, dummy, function_out_int_at_IO # Function END # @@ -222,7 +222,7 @@ ECons_end: # **** VTABLE for type Edge **** -Edge_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, function_print_at_Edge, dummy, dummy, function_in_string_at_IO, dummy, function_out_int_at_IO, function_init_at_Edge, dummy, dummy +Edge_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, dummy, dummy, function_init_at_Edge, dummy, dummy, function_in_int_at_IO, function_out_string_at_IO, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_print_at_Edge, dummy, dummy, dummy, function_out_int_at_IO # Function END # @@ -236,7 +236,7 @@ Edge_end: # **** VTABLE for type Vertice **** -Vertice_vtable: .word function_add_out_at_Vertice, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_number_at_Vertice, function_abort_at_Object, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_out_string_at_IO, function_print_at_Vertice, dummy, dummy, function_in_string_at_IO, dummy, function_out_int_at_IO, function_init_at_Vertice, dummy, function_outgoing_at_Vertice +Vertice_vtable: .word function_add_out_at_Vertice, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, function_in_string_at_IO, function_outgoing_at_Vertice, dummy, dummy, function_init_at_Vertice, dummy, dummy, function_in_int_at_IO, function_out_string_at_IO, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_print_at_Vertice, dummy, function_number_at_Vertice, dummy, function_out_int_at_IO # Function END # @@ -645,7 +645,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -922,7 +922,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 64($t0) + lw $t1, 100($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -1260,7 +1260,7 @@ function_add_vertice_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 120($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -1295,7 +1295,7 @@ function_add_vertice_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1334,7 +1334,7 @@ function_add_vertice_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 104($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -1389,7 +1389,7 @@ function_print_E_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1439,7 +1439,7 @@ function_print_V_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1667,7 +1667,7 @@ function_read_input_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 100($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -2292,7 +2292,7 @@ label_FALSE_25: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 96($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -2344,7 +2344,7 @@ label_FALSE_25: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 92($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -2367,7 +2367,7 @@ label_FALSE_25: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -2395,7 +2395,7 @@ label_FALSE_25: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 100($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -100($fp) @@ -2525,7 +2525,7 @@ function_parse_line_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -2548,7 +2548,7 @@ function_parse_line_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 112($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -2583,7 +2583,7 @@ function_parse_line_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 8($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -2964,7 +2964,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -3038,7 +3038,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -3146,7 +3146,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 112($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -128($fp) @@ -3181,7 +3181,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 112($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -116($fp) @@ -5879,7 +5879,7 @@ label_FALSEIF_129: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -248($fp) @@ -6019,7 +6019,7 @@ function_a2i_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 8($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -6393,7 +6393,7 @@ label_FALSEIF_139: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -6697,7 +6697,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 8($t0) +lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -108($fp) @@ -6789,7 +6789,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 48($t0) +lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -6812,7 +6812,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -6958,7 +6958,7 @@ label_FALSEIF_149: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -7262,7 +7262,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 8($t0) +lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -184($fp) @@ -7354,7 +7354,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 48($t0) +lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -168($fp) @@ -7377,7 +7377,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -156($fp) @@ -7419,7 +7419,7 @@ label_FALSEIF_159: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -196($fp) @@ -7584,7 +7584,7 @@ function_a2i_aux_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 8($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -7838,7 +7838,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 48($t0) +lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -8174,7 +8174,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 8($t0) +lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -104($fp) @@ -8304,7 +8304,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 48($t0) +lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -8649,7 +8649,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 8($t0) +lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -160($fp) @@ -8779,7 +8779,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 48($t0) +lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -8941,7 +8941,7 @@ label_FALSEIF_183: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -196($fp) @@ -8964,7 +8964,7 @@ label_FALSEIF_183: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -184($fp) @@ -9453,7 +9453,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 24($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -9482,7 +9482,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -9604,7 +9604,7 @@ function_head_at_VList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -9657,7 +9657,7 @@ function_tail_at_VList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -9776,7 +9776,7 @@ function_cons_at_VList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 112($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -9851,7 +9851,7 @@ function_print_at_VList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 84($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10060,7 +10060,7 @@ function_print_at_VCons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10089,7 +10089,7 @@ function_print_at_VCons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -10211,7 +10211,7 @@ function_head_at_EList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10264,7 +10264,7 @@ function_tail_at_EList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10383,7 +10383,7 @@ function_cons_at_EList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 112($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10435,7 +10435,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 44($t0) +lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -10481,7 +10481,7 @@ label_FALSEIF_203: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 68($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -10512,7 +10512,7 @@ label_FALSEIF_203: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -10571,7 +10571,7 @@ label_FALSEIF_203: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 104($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -10652,7 +10652,7 @@ function_print_at_EList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 84($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10861,7 +10861,7 @@ function_print_at_ECons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10890,7 +10890,7 @@ function_print_at_ECons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -11160,7 +11160,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 84($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -11198,7 +11198,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 108($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -11250,7 +11250,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 84($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -11288,7 +11288,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 108($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -11340,7 +11340,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 84($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -11378,7 +11378,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 108($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -11635,7 +11635,7 @@ function_add_out_at_Vertice: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 104($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -11703,7 +11703,7 @@ function_print_at_Vertice: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 108($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -11732,7 +11732,7 @@ function_print_at_Vertice: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) diff --git a/tests/codegen/hairyscary.mips b/tests/codegen/hairyscary.mips index c2106f7d..84031bc7 100644 --- a/tests/codegen/hairyscary.mips +++ b/tests/codegen/hairyscary.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:05 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:19 2020 # School of Math and Computer Science, University of Havana # @@ -30,7 +30,7 @@ Bar: .asciiz "Bar" # **** VTABLE for type IO **** -IO_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, dummy, function_out_string_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, dummy, function_out_int_at_IO, function_copy_at_Object, dummy +IO_vtable: .word function_type_name_at_Object, dummy, function_out_string_at_IO, dummy, function_abort_at_Object, dummy, dummy, dummy, function_out_int_at_IO, dummy, function_copy_at_Object, function_in_string_at_IO, function_in_int_at_IO # Function END # @@ -44,7 +44,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy +Object_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy # Function END # @@ -58,7 +58,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_type_name_at_Object, dummy, function_substr_at_String, function_concat_at_String, dummy, dummy, dummy, dummy, function_abort_at_Object, function_length_at_String, dummy, function_copy_at_Object, dummy +String_vtable: .word function_type_name_at_Object, dummy, dummy, function_substr_at_String, function_abort_at_Object, dummy, function_concat_at_String, function_length_at_String, dummy, dummy, function_copy_at_Object, dummy, dummy # Function END # @@ -72,7 +72,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy +Bool_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy # Function END # @@ -86,7 +86,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy +Int_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy # Function END # @@ -100,7 +100,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, function_main_at_Main, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy +Main_vtable: .word function_type_name_at_Object, function_main_at_Main, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy # Function END # @@ -114,7 +114,7 @@ Main_end: # **** VTABLE for type Bazz **** -Bazz_vtable: .word function_type_name_at_Object, function_printh_at_Bazz, dummy, dummy, dummy, function_out_string_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, dummy, function_out_int_at_IO, function_copy_at_Object, function_doh_at_Bazz +Bazz_vtable: .word function_type_name_at_Object, dummy, function_out_string_at_IO, dummy, function_abort_at_Object, function_printh_at_Bazz, dummy, dummy, function_out_int_at_IO, function_doh_at_Bazz, function_copy_at_Object, function_in_string_at_IO, function_in_int_at_IO # Function END # @@ -128,7 +128,7 @@ Bazz_end: # **** VTABLE for type Foo **** -Foo_vtable: .word function_type_name_at_Object, function_printh_at_Bazz, dummy, dummy, dummy, function_out_string_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, dummy, function_out_int_at_IO, function_copy_at_Object, function_doh_at_Foo +Foo_vtable: .word function_type_name_at_Object, dummy, function_out_string_at_IO, dummy, function_abort_at_Object, function_printh_at_Bazz, dummy, dummy, function_out_int_at_IO, function_doh_at_Foo, function_copy_at_Object, function_in_string_at_IO, function_in_int_at_IO # Function END # @@ -142,7 +142,7 @@ Foo_end: # **** VTABLE for type Razz **** -Razz_vtable: .word function_type_name_at_Object, function_printh_at_Bazz, dummy, dummy, dummy, function_out_string_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, dummy, function_out_int_at_IO, function_copy_at_Object, function_doh_at_Foo +Razz_vtable: .word function_type_name_at_Object, dummy, function_out_string_at_IO, dummy, function_abort_at_Object, function_printh_at_Bazz, dummy, dummy, function_out_int_at_IO, function_doh_at_Foo, function_copy_at_Object, function_in_string_at_IO, function_in_int_at_IO # Function END # @@ -156,7 +156,7 @@ Razz_end: # **** VTABLE for type Bar **** -Bar_vtable: .word function_type_name_at_Object, function_printh_at_Bazz, dummy, dummy, dummy, function_out_string_at_IO, function_in_string_at_IO, function_in_int_at_IO, function_abort_at_Object, dummy, function_out_int_at_IO, function_copy_at_Object, function_doh_at_Foo +Bar_vtable: .word function_type_name_at_Object, dummy, function_out_string_at_IO, dummy, function_abort_at_Object, function_printh_at_Bazz, dummy, dummy, function_out_int_at_IO, function_doh_at_Foo, function_copy_at_Object, function_in_string_at_IO, function_in_int_at_IO # Function END # @@ -472,7 +472,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -757,7 +757,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 16($t0) + lw $t1, 4($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -1315,7 +1315,7 @@ __Bazz__attrib__g__init: # local_ttrib__g__init_internal_5 = 13 li $t0, 13 sw $t0, -24($fp) - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Bazz @@ -1337,7 +1337,7 @@ __Bazz__attrib__g__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min0_1: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -1359,7 +1359,7 @@ __Bazz__attrib__g__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min1_2: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Foo @@ -1381,7 +1381,7 @@ __Bazz__attrib__g__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min2_3: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -1419,7 +1419,7 @@ __Bazz__attrib__g__init: # IF_ZERO local_ttrib__g__init_internal_3 GOTO label_ERROR_5 lw $t0, -16($fp) beq $t0, 0, label_ERROR_5 - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Bazz @@ -1526,7 +1526,7 @@ __Bazz__attrib__g__init: # GOTO label_END_6 j label_END_6 label_NEXT0_7: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -1665,7 +1665,7 @@ label_NEXT0_7: # GOTO label_END_6 j label_END_6 label_NEXT1_8: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Foo @@ -1788,7 +1788,7 @@ label_NEXT1_8: # GOTO label_END_6 j label_END_6 label_NEXT2_9: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -1876,7 +1876,7 @@ __Bazz__attrib__i__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -1935,7 +1935,7 @@ function_printh_at_Bazz: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2146,7 +2146,7 @@ __Foo__attrib__a__init: # local_trib__a__init_internal_5 = 13 li $t0, 13 sw $t0, -24($fp) - # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz + # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -2168,7 +2168,7 @@ __Foo__attrib__a__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min0_11: - # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo + # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Foo @@ -2190,7 +2190,7 @@ __Foo__attrib__a__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min1_12: - # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar + # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -2228,7 +2228,7 @@ __Foo__attrib__a__init: # IF_ZERO local_trib__a__init_internal_3 GOTO label_ERROR_14 lw $t0, -16($fp) beq $t0, 0, label_ERROR_14 - # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz + # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -2367,7 +2367,7 @@ __Foo__attrib__a__init: # GOTO label_END_15 j label_END_15 label_NEXT0_16: - # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo + # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Foo @@ -2490,7 +2490,7 @@ label_NEXT0_16: # GOTO label_END_15 j label_END_15 label_NEXT1_17: - # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar + # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -2579,7 +2579,7 @@ __Foo__attrib__b__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -2608,7 +2608,7 @@ __Foo__attrib__b__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -2674,7 +2674,7 @@ __Foo__attrib__b__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -2740,7 +2740,7 @@ __Foo__attrib__b__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -2958,7 +2958,7 @@ __Razz__attrib__e__init: # local_ttrib__e__init_internal_5 = 13 li $t0, 13 sw $t0, -24($fp) - # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -2980,7 +2980,7 @@ __Razz__attrib__e__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min0_19: - # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -3018,7 +3018,7 @@ __Razz__attrib__e__init: # IF_ZERO local_ttrib__e__init_internal_3 GOTO label_ERROR_21 lw $t0, -16($fp) beq $t0, 0, label_ERROR_21 - # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -3157,7 +3157,7 @@ __Razz__attrib__e__init: # GOTO label_END_22 j label_END_22 label_NEXT0_23: - # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -3239,7 +3239,7 @@ __Razz__attrib__f__init: # Get pointer to type's VTABLE la $t0, Bazz_vtable # Get pointer to function address - lw $t1, 48($t0) + lw $t1, 36($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -24($fp) @@ -3268,7 +3268,7 @@ __Razz__attrib__f__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -3335,7 +3335,7 @@ __Razz__attrib__f__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -3401,7 +3401,7 @@ __Razz__attrib__f__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -3467,7 +3467,7 @@ __Razz__attrib__f__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -3554,7 +3554,7 @@ __Bar__attrib__c__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -3603,7 +3603,7 @@ __Bar__attrib__d__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips index 0f00f282..0d0274c4 100644 --- a/tests/codegen/hello_world.mips +++ b/tests/codegen/hello_world.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:05 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:19 2020 # School of Math and Computer Science, University of Havana # @@ -22,7 +22,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_copy_at_Object, function_abort_at_Object, dummy, function_out_string_at_IO, function_in_int_at_IO, function_in_string_at_IO, dummy, function_type_name_at_Object, dummy, dummy, function_out_int_at_IO +IO_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, function_out_string_at_IO, function_abort_at_Object, dummy, function_in_string_at_IO, function_out_int_at_IO, function_in_int_at_IO # Function END # @@ -36,7 +36,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy +Object_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy # Function END # @@ -50,7 +50,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_copy_at_Object, function_abort_at_Object, function_substr_at_String, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_concat_at_String, function_length_at_String, dummy +String_vtable: .word function_concat_at_String, function_type_name_at_Object, function_substr_at_String, dummy, function_copy_at_Object, dummy, function_abort_at_Object, function_length_at_String, dummy, dummy, dummy # Function END # @@ -64,7 +64,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy +Bool_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy # Function END # @@ -78,7 +78,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy +Int_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy # Function END # @@ -92,7 +92,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word function_copy_at_Object, function_abort_at_Object, dummy, function_out_string_at_IO, function_in_int_at_IO, function_in_string_at_IO, function_main_at_Main, function_type_name_at_Object, dummy, dummy, function_out_int_at_IO +Main_vtable: .word dummy, function_type_name_at_Object, dummy, function_main_at_Main, function_copy_at_Object, function_out_string_at_IO, function_abort_at_Object, dummy, function_in_string_at_IO, function_out_int_at_IO, function_in_int_at_IO # Function END # @@ -404,7 +404,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -657,7 +657,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 24($t0) + lw $t1, 12($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -727,7 +727,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips index 8348af76..53e3d2bd 100644 --- a/tests/codegen/io.mips +++ b/tests/codegen/io.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:06 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:20 2020 # School of Math and Computer Science, University of Havana # @@ -30,7 +30,7 @@ D: .asciiz "D" # **** VTABLE for type IO **** -IO_vtable: .word function_in_string_at_IO, function_out_string_at_IO, function_copy_at_Object, function_out_int_at_IO, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object +IO_vtable: .word function_in_string_at_IO, dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, function_in_int_at_IO, dummy, function_out_string_at_IO, dummy, function_out_int_at_IO, dummy, dummy, function_copy_at_Object # Function END # @@ -44,7 +44,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object +Object_vtable: .word dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object # Function END # @@ -58,7 +58,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, dummy, function_copy_at_Object, dummy, dummy, function_concat_at_String, dummy, dummy, dummy, function_length_at_String, dummy, function_abort_at_Object, dummy, function_substr_at_String, function_type_name_at_Object +String_vtable: .word dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_concat_at_String, dummy, function_substr_at_String, dummy, function_length_at_String, dummy, function_copy_at_Object # Function END # @@ -72,7 +72,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object +Bool_vtable: .word dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object # Function END # @@ -86,7 +86,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object +Int_vtable: .word dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object # Function END # @@ -100,7 +100,7 @@ Int_end: # **** VTABLE for type A **** -A_vtable: .word dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_out_a_at_A, dummy, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object +A_vtable: .word dummy, dummy, function_abort_at_Object, function_out_a_at_A, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object # Function END # @@ -114,7 +114,7 @@ A_end: # **** VTABLE for type B **** -B_vtable: .word dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_out_a_at_A, dummy, dummy, function_abort_at_Object, function_out_b_at_B, dummy, function_type_name_at_Object +B_vtable: .word dummy, dummy, function_abort_at_Object, function_out_a_at_A, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_out_b_at_B, function_copy_at_Object # Function END # @@ -128,7 +128,7 @@ B_end: # **** VTABLE for type Main **** -Main_vtable: .word function_in_string_at_IO, function_out_string_at_IO, function_copy_at_Object, function_out_int_at_IO, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, function_main_at_Main, function_abort_at_Object, dummy, dummy, function_type_name_at_Object +Main_vtable: .word function_in_string_at_IO, dummy, function_abort_at_Object, dummy, dummy, function_main_at_Main, function_type_name_at_Object, function_in_int_at_IO, dummy, function_out_string_at_IO, dummy, function_out_int_at_IO, dummy, dummy, function_copy_at_Object # Function END # @@ -142,7 +142,7 @@ Main_end: # **** VTABLE for type C **** -C_vtable: .word function_in_string_at_IO, function_out_string_at_IO, function_copy_at_Object, function_out_int_at_IO, dummy, dummy, function_in_int_at_IO, function_out_c_at_C, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object +C_vtable: .word function_in_string_at_IO, function_out_c_at_C, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, function_in_int_at_IO, dummy, function_out_string_at_IO, dummy, function_out_int_at_IO, dummy, dummy, function_copy_at_Object # Function END # @@ -156,7 +156,7 @@ C_end: # **** VTABLE for type D **** -D_vtable: .word function_in_string_at_IO, function_out_string_at_IO, function_copy_at_Object, function_out_int_at_IO, function_out_d_at_D, dummy, function_in_int_at_IO, function_out_c_at_C, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object +D_vtable: .word function_in_string_at_IO, function_out_c_at_C, function_abort_at_Object, dummy, function_out_d_at_D, dummy, function_type_name_at_Object, function_in_int_at_IO, dummy, function_out_string_at_IO, dummy, function_out_int_at_IO, dummy, dummy, function_copy_at_Object # Function END # @@ -488,7 +488,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -741,7 +741,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 40($t0) + lw $t1, 20($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -871,7 +871,7 @@ function_out_a_at_A: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -945,7 +945,7 @@ function_out_b_at_B: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1037,7 +1037,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1108,7 +1108,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -1171,7 +1171,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -1286,7 +1286,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -1359,7 +1359,7 @@ function_out_c_at_C: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1432,7 +1432,7 @@ function_out_d_at_D: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) diff --git a/tests/codegen/life.mips b/tests/codegen/life.mips index cc6fad32..55afb8b1 100644 --- a/tests/codegen/life.mips +++ b/tests/codegen/life.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:08 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:22 2020 # School of Math and Computer Science, University of Havana # @@ -26,7 +26,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, dummy, function_in_int_at_IO, dummy, function_out_string_at_IO, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy +IO_vtable: .word dummy, dummy, function_out_int_at_IO, dummy, dummy, function_in_string_at_IO, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_out_string_at_IO, dummy, function_copy_at_Object, function_in_int_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -40,7 +40,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy +Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -54,7 +54,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_substr_at_String, dummy, function_length_at_String, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_concat_at_String, function_type_name_at_Object, dummy, dummy +String_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, function_length_at_String, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_substr_at_String, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_concat_at_String, dummy, dummy, dummy, dummy # Function END # @@ -68,7 +68,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy +Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -82,7 +82,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy +Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -96,7 +96,7 @@ Int_end: # **** VTABLE for type Board **** -Board_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, function_size_of_board_at_Board, function_in_string_at_IO, dummy, dummy, function_board_init_at_Board, function_in_int_at_IO, dummy, function_out_string_at_IO, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy +Board_vtable: .word dummy, dummy, function_out_int_at_IO, dummy, dummy, function_in_string_at_IO, function_size_of_board_at_Board, function_abort_at_Object, dummy, dummy, function_type_name_at_Object, function_board_init_at_Board, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_out_string_at_IO, dummy, function_copy_at_Object, function_in_int_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -110,7 +110,7 @@ Board_end: # **** VTABLE for type CellularAutomaton **** -CellularAutomaton_vtable: .word dummy, function_option_at_CellularAutomaton, dummy, function_abort_at_Object, dummy, function_num_cells_at_CellularAutomaton, function_copy_at_Object, function_cell_at_CellularAutomaton, function_evolve_at_CellularAutomaton, function_prompt2_at_CellularAutomaton, function_south_at_CellularAutomaton, function_southwest_at_CellularAutomaton, function_out_int_at_IO, function_east_at_CellularAutomaton, function_neighbors_at_CellularAutomaton, function_southeast_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_size_of_board_at_Board, function_in_string_at_IO, function_north_at_CellularAutomaton, function_print_at_CellularAutomaton, function_board_init_at_Board, function_in_int_at_IO, function_northeast_at_CellularAutomaton, function_out_string_at_IO, function_prompt_at_CellularAutomaton, function_west_at_CellularAutomaton, dummy, function_type_name_at_Object, function_northwest_at_CellularAutomaton, function_init_at_CellularAutomaton +CellularAutomaton_vtable: .word function_cell_at_CellularAutomaton, function_num_cells_at_CellularAutomaton, function_out_int_at_IO, function_print_at_CellularAutomaton, function_neighbors_at_CellularAutomaton, function_in_string_at_IO, function_size_of_board_at_Board, function_abort_at_Object, dummy, function_southwest_at_CellularAutomaton, function_type_name_at_Object, function_board_init_at_Board, function_prompt2_at_CellularAutomaton, function_prompt_at_CellularAutomaton, function_east_at_CellularAutomaton, function_north_at_CellularAutomaton, function_west_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, dummy, dummy, function_out_string_at_IO, function_init_at_CellularAutomaton, function_copy_at_Object, function_in_int_at_IO, function_southeast_at_CellularAutomaton, function_option_at_CellularAutomaton, dummy, function_south_at_CellularAutomaton, function_northwest_at_CellularAutomaton, function_northeast_at_CellularAutomaton, function_evolve_at_CellularAutomaton # Function END # @@ -124,7 +124,7 @@ CellularAutomaton_end: # **** VTABLE for type Main **** -Main_vtable: .word dummy, function_option_at_CellularAutomaton, dummy, function_abort_at_Object, function_main_at_Main, function_num_cells_at_CellularAutomaton, function_copy_at_Object, function_cell_at_CellularAutomaton, function_evolve_at_CellularAutomaton, function_prompt2_at_CellularAutomaton, function_south_at_CellularAutomaton, function_southwest_at_CellularAutomaton, function_out_int_at_IO, function_east_at_CellularAutomaton, function_neighbors_at_CellularAutomaton, function_southeast_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_size_of_board_at_Board, function_in_string_at_IO, function_north_at_CellularAutomaton, function_print_at_CellularAutomaton, function_board_init_at_Board, function_in_int_at_IO, function_northeast_at_CellularAutomaton, function_out_string_at_IO, function_prompt_at_CellularAutomaton, function_west_at_CellularAutomaton, dummy, function_type_name_at_Object, function_northwest_at_CellularAutomaton, function_init_at_CellularAutomaton +Main_vtable: .word function_cell_at_CellularAutomaton, function_num_cells_at_CellularAutomaton, function_out_int_at_IO, function_print_at_CellularAutomaton, function_neighbors_at_CellularAutomaton, function_in_string_at_IO, function_size_of_board_at_Board, function_abort_at_Object, dummy, function_southwest_at_CellularAutomaton, function_type_name_at_Object, function_board_init_at_Board, function_prompt2_at_CellularAutomaton, function_prompt_at_CellularAutomaton, function_east_at_CellularAutomaton, function_north_at_CellularAutomaton, function_west_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_main_at_Main, dummy, function_out_string_at_IO, function_init_at_CellularAutomaton, function_copy_at_Object, function_in_int_at_IO, function_southeast_at_CellularAutomaton, function_option_at_CellularAutomaton, dummy, function_south_at_CellularAutomaton, function_northwest_at_CellularAutomaton, function_northeast_at_CellularAutomaton, function_evolve_at_CellularAutomaton # Function END # @@ -778,7 +778,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -1071,7 +1071,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 16($t0) + lw $t1, 72($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -1271,7 +1271,7 @@ function_size_of_board_at_Board: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 8($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1360,7 +1360,7 @@ function_board_init_at_Board: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 68($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -3466,7 +3466,7 @@ function_init_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 84($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -3651,7 +3651,7 @@ function_print_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -3803,7 +3803,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 0($t0) +lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -3826,7 +3826,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 96($t0) +lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -3878,7 +3878,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 96($t0) +lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -76($fp) @@ -3980,7 +3980,7 @@ label_WHILE_END_62: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -100($fp) @@ -4033,7 +4033,7 @@ function_num_cells_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 8($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -4321,7 +4321,7 @@ label_FALSEIF_65: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -4621,7 +4621,7 @@ label_FALSEIF_69: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -4894,7 +4894,7 @@ label_FALSEIF_73: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -5480,7 +5480,7 @@ label_FALSEIF_77: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -6190,7 +6190,7 @@ label_FALSEIF_97: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -68($fp) @@ -6838,7 +6838,7 @@ label_FALSEIF_111: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -7624,7 +7624,7 @@ label_FALSEIF_125: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -8383,7 +8383,7 @@ label_FALSEIF_139: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -9004,7 +9004,7 @@ label_FALSEIF_153: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -9074,7 +9074,7 @@ function_neighbors_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -52($fp) @@ -9407,7 +9407,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 40($t0) +lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -9778,7 +9778,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 52($t0) +lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -132($fp) @@ -10149,7 +10149,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 104($t0) +lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -172($fp) @@ -10520,7 +10520,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 92($t0) +lw $t0, 116($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -212($fp) @@ -10891,7 +10891,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 116($t0) +lw $t0, 112($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -252($fp) @@ -11262,7 +11262,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 60($t0) +lw $t0, 96($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -292($fp) @@ -11633,7 +11633,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 44($t0) +lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -332($fp) @@ -12028,7 +12028,7 @@ function_cell_at_next_evolution_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 56($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -12324,7 +12324,7 @@ label_FALSEIF_243: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 56($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -12594,7 +12594,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 28($t0) +lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -13054,7 +13054,7 @@ function_evolve_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -13215,7 +13215,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 64($t0) +lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -52($fp) @@ -13238,7 +13238,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 108($t0) +lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -13431,7 +13431,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -13483,7 +13483,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -13535,7 +13535,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -13587,7 +13587,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -13639,7 +13639,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -76($fp) @@ -13691,7 +13691,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -13743,7 +13743,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -108($fp) @@ -13795,7 +13795,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -124($fp) @@ -13847,7 +13847,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -140($fp) @@ -13899,7 +13899,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -156($fp) @@ -13951,7 +13951,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -172($fp) @@ -14003,7 +14003,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -188($fp) @@ -14055,7 +14055,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -204($fp) @@ -14107,7 +14107,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -220($fp) @@ -14159,7 +14159,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -236($fp) @@ -14211,7 +14211,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -252($fp) @@ -14263,7 +14263,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -268($fp) @@ -14315,7 +14315,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -284($fp) @@ -14367,7 +14367,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -300($fp) @@ -14419,7 +14419,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -316($fp) @@ -14471,7 +14471,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -332($fp) @@ -14523,7 +14523,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -348($fp) @@ -14575,7 +14575,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -364($fp) @@ -14603,7 +14603,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -380($fp) @@ -14660,7 +14660,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -392($fp) @@ -20397,7 +20397,7 @@ function_prompt_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -20449,7 +20449,7 @@ function_prompt_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -20477,7 +20477,7 @@ function_prompt_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -20534,7 +20534,7 @@ function_prompt_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -20924,7 +20924,7 @@ function_prompt2_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -20976,7 +20976,7 @@ function_prompt2_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -21028,7 +21028,7 @@ function_prompt2_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -21056,7 +21056,7 @@ function_prompt2_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -21503,7 +21503,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -21555,7 +21555,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -21584,7 +21584,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -52($fp) @@ -21658,7 +21658,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 100($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -68($fp) @@ -21764,7 +21764,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 120($t0) + lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -21797,7 +21797,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -21836,7 +21836,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 100($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -116($fp) @@ -21875,7 +21875,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -128($fp) @@ -21904,7 +21904,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -140($fp) diff --git a/tests/codegen/list.mips b/tests/codegen/list.mips index 3202f6bb..a1ed12bf 100644 --- a/tests/codegen/list.mips +++ b/tests/codegen/list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:06 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:20 2020 # School of Math and Computer Science, University of Havana # @@ -26,7 +26,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_in_string_at_IO, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_out_string_at_IO, function_copy_at_Object, dummy, dummy, function_in_int_at_IO, function_out_int_at_IO, dummy, dummy +IO_vtable: .word function_abort_at_Object, function_in_int_at_IO, function_copy_at_Object, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_out_string_at_IO, dummy, function_type_name_at_Object, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy # Function END # @@ -40,7 +40,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy +Object_vtable: .word function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -54,7 +54,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, function_abort_at_Object, dummy, dummy, function_substr_at_String, function_type_name_at_Object, function_concat_at_String, dummy, dummy, dummy, function_copy_at_Object, function_length_at_String, dummy, dummy, dummy, dummy, dummy +String_vtable: .word function_abort_at_Object, dummy, function_copy_at_Object, function_substr_at_String, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_concat_at_String, dummy, dummy, function_length_at_String, dummy # Function END # @@ -68,7 +68,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy +Bool_vtable: .word function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -82,7 +82,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy +Int_vtable: .word function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -96,7 +96,7 @@ Int_end: # **** VTABLE for type List **** -List_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_cons_at_List, dummy, function_copy_at_Object, dummy, function_head_at_List, dummy, dummy, function_tail_at_List, function_isNil_at_List +List_vtable: .word function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, function_cons_at_List, dummy, function_head_at_List, dummy, dummy, function_type_name_at_Object, function_tail_at_List, dummy, dummy, function_isNil_at_List, dummy, dummy # Function END # @@ -110,7 +110,7 @@ List_end: # **** VTABLE for type Cons **** -Cons_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_init_at_Cons, function_cons_at_List, dummy, function_copy_at_Object, dummy, function_head_at_Cons, dummy, dummy, function_tail_at_Cons, function_isNil_at_Cons +Cons_vtable: .word function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, function_cons_at_List, dummy, function_head_at_Cons, dummy, dummy, function_type_name_at_Object, function_tail_at_Cons, dummy, dummy, function_isNil_at_Cons, dummy, function_init_at_Cons # Function END # @@ -124,7 +124,7 @@ Cons_end: # **** VTABLE for type Main **** -Main_vtable: .word function_in_string_at_IO, function_abort_at_Object, function_main_at_Main, function_print_list_at_Main, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_out_string_at_IO, function_copy_at_Object, dummy, dummy, function_in_int_at_IO, function_out_int_at_IO, dummy, dummy +Main_vtable: .word function_abort_at_Object, function_in_int_at_IO, function_copy_at_Object, dummy, function_print_list_at_Main, dummy, function_in_string_at_IO, dummy, function_out_string_at_IO, function_main_at_Main, function_type_name_at_Object, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy # Function END # @@ -442,7 +442,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -703,7 +703,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 8($t0) + lw $t1, 36($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -801,7 +801,7 @@ function_head_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -881,7 +881,7 @@ function_tail_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1000,7 +1000,7 @@ function_cons_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1281,7 +1281,7 @@ function_print_list_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 64($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -1343,7 +1343,7 @@ function_print_list_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -1387,7 +1387,7 @@ label_FALSEIF_1: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -52($fp) @@ -1410,7 +1410,7 @@ label_FALSEIF_1: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 56($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -1462,7 +1462,7 @@ label_FALSEIF_1: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -1498,7 +1498,7 @@ label_FALSEIF_1: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -1521,7 +1521,7 @@ label_FALSEIF_1: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -76($fp) @@ -1650,7 +1650,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -1712,7 +1712,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -1774,7 +1774,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -1836,7 +1836,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -1898,7 +1898,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1932,7 +1932,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 64($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -76($fp) @@ -2056,7 +2056,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -2085,7 +2085,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -108($fp) diff --git a/tests/codegen/new_complex.mips b/tests/codegen/new_complex.mips index 36fe8fc6..fdf6add9 100644 --- a/tests/codegen/new_complex.mips +++ b/tests/codegen/new_complex.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:05 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:18 2020 # School of Math and Computer Science, University of Havana # @@ -24,7 +24,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_in_int_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_in_string_at_IO, function_out_int_at_IO, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, function_out_string_at_IO +IO_vtable: .word function_type_name_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_out_int_at_IO, dummy, function_in_string_at_IO, dummy, function_abort_at_Object, function_in_int_at_IO, dummy # Function END # @@ -38,7 +38,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy +Object_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy # Function END # @@ -52,7 +52,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, dummy, dummy, dummy, function_substr_at_String, dummy, function_concat_at_String, dummy, dummy, dummy, dummy, dummy, function_length_at_String, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy +String_vtable: .word function_type_name_at_Object, dummy, function_concat_at_String, dummy, function_length_at_String, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, function_substr_at_String # Function END # @@ -66,7 +66,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy +Bool_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy # Function END # @@ -80,7 +80,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, dummy +Int_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy # Function END # @@ -94,7 +94,7 @@ Int_end: # **** VTABLE for type Complex **** -Complex_vtable: .word function_abort_at_Object, function_in_int_at_IO, function_reflect_X_at_Complex, function_reflect_Y_at_Complex, dummy, dummy, dummy, function_x_value_at_Complex, function_reflect_0_at_Complex, function_in_string_at_IO, function_out_int_at_IO, function_equal_at_Complex, dummy, function_type_name_at_Object, function_copy_at_Object, function_print_at_Complex, function_init_at_Complex, function_y_value_at_Complex, function_out_string_at_IO +Complex_vtable: .word function_type_name_at_Object, function_out_string_at_IO, dummy, function_init_at_Complex, dummy, function_reflect_0_at_Complex, function_copy_at_Object, dummy, function_reflect_Y_at_Complex, function_reflect_X_at_Complex, function_equal_at_Complex, function_print_at_Complex, function_out_int_at_IO, function_x_value_at_Complex, function_in_string_at_IO, function_y_value_at_Complex, function_abort_at_Object, function_in_int_at_IO, dummy # Function END # @@ -108,7 +108,7 @@ Complex_end: # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_in_int_at_IO, dummy, dummy, dummy, function_main_at_Main, dummy, dummy, dummy, function_in_string_at_IO, function_out_int_at_IO, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, function_out_string_at_IO +Main_vtable: .word function_type_name_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, function_copy_at_Object, function_main_at_Main, dummy, dummy, dummy, dummy, function_out_int_at_IO, dummy, function_in_string_at_IO, dummy, function_abort_at_Object, function_in_int_at_IO, dummy # Function END # @@ -441,7 +441,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -694,7 +694,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 20($t0) + lw $t1, 28($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -1520,7 +1520,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 40($t0) +lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -1566,7 +1566,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -1615,7 +1615,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -1650,7 +1650,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -1699,7 +1699,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -2796,7 +2796,7 @@ function_equal_at_Complex: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -3030,7 +3030,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 68($t0) +lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -3586,7 +3586,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 64($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -3616,7 +3616,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 8($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -3641,7 +3641,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -3898,7 +3898,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 72($t0) +lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -3958,7 +3958,7 @@ label_FALSEIF_79: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -3989,7 +3989,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 8($t0) +lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -120($fp) @@ -4014,7 +4014,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -112($fp) @@ -4047,7 +4047,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 32($t0) +lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -128($fp) @@ -4070,7 +4070,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 44($t0) +lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -104($fp) @@ -4132,7 +4132,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 72($t0) +lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -4192,7 +4192,7 @@ label_FALSEIF_89: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -152($fp) diff --git a/tests/codegen/palindrome.mips b/tests/codegen/palindrome.mips index febab57d..d2b60c75 100644 --- a/tests/codegen/palindrome.mips +++ b/tests/codegen/palindrome.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:07 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:21 2020 # School of Math and Computer Science, University of Havana # @@ -22,7 +22,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_type_name_at_Object, function_abort_at_Object, function_out_string_at_IO, dummy, function_in_string_at_IO, dummy, function_copy_at_Object, dummy, dummy, dummy, function_out_int_at_IO, function_in_int_at_IO +IO_vtable: .word dummy, dummy, dummy, dummy, dummy, function_out_string_at_IO, function_in_int_at_IO, function_copy_at_Object, function_out_int_at_IO, function_abort_at_Object, function_in_string_at_IO, function_type_name_at_Object # Function END # @@ -36,7 +36,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_type_name_at_Object, function_abort_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy +Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, function_type_name_at_Object # Function END # @@ -50,7 +50,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_type_name_at_Object, function_abort_at_Object, dummy, function_length_at_String, dummy, function_concat_at_String, function_copy_at_Object, dummy, dummy, function_substr_at_String, dummy, dummy +String_vtable: .word dummy, dummy, function_concat_at_String, function_length_at_String, function_substr_at_String, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, function_type_name_at_Object # Function END # @@ -64,7 +64,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_type_name_at_Object, function_abort_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy +Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, function_type_name_at_Object # Function END # @@ -78,7 +78,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_type_name_at_Object, function_abort_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy +Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, function_type_name_at_Object # Function END # @@ -92,7 +92,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word function_type_name_at_Object, function_abort_at_Object, function_out_string_at_IO, dummy, function_in_string_at_IO, dummy, function_copy_at_Object, function_pal_at_Main, function_main_at_Main, dummy, function_out_int_at_IO, function_in_int_at_IO +Main_vtable: .word function_pal_at_Main, function_main_at_Main, dummy, dummy, dummy, function_out_string_at_IO, function_in_int_at_IO, function_copy_at_Object, function_out_int_at_IO, function_abort_at_Object, function_in_string_at_IO, function_type_name_at_Object # Function END # @@ -412,7 +412,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -673,7 +673,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 32($t0) + lw $t1, 4($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -1443,7 +1443,7 @@ label_FALSEIF_11: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -1605,7 +1605,7 @@ label_FALSEIF_11: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -104($fp) @@ -1983,7 +1983,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 36($t0) +lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -144($fp) @@ -2006,7 +2006,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 28($t0) +lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -132($fp) @@ -2212,7 +2212,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 8($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -2251,7 +2251,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -52($fp) @@ -2274,7 +2274,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -2336,7 +2336,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 8($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -2396,7 +2396,7 @@ label_FALSEIF_31: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 8($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) diff --git a/tests/codegen/primes.mips b/tests/codegen/primes.mips index 4aa875b1..b3e9cf68 100644 --- a/tests/codegen/primes.mips +++ b/tests/codegen/primes.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:04 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:18 2020 # School of Math and Computer Science, University of Havana # @@ -22,7 +22,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_in_int_at_IO, dummy, dummy, function_abort_at_Object, function_in_string_at_IO, function_copy_at_Object, function_out_int_at_IO, dummy, dummy, function_type_name_at_Object, function_out_string_at_IO +IO_vtable: .word dummy, function_out_int_at_IO, function_out_string_at_IO, function_in_string_at_IO, dummy, function_copy_at_Object, function_in_int_at_IO, dummy, function_abort_at_Object, function_type_name_at_Object, dummy # Function END # @@ -36,7 +36,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy +Object_vtable: .word dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, function_type_name_at_Object, dummy # Function END # @@ -50,7 +50,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, function_length_at_String, function_substr_at_String, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, function_concat_at_String, function_type_name_at_Object, dummy +String_vtable: .word function_length_at_String, dummy, dummy, dummy, function_concat_at_String, function_copy_at_Object, dummy, function_substr_at_String, function_abort_at_Object, function_type_name_at_Object, dummy # Function END # @@ -64,7 +64,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy +Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, function_type_name_at_Object, dummy # Function END # @@ -78,7 +78,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy +Int_vtable: .word dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, function_type_name_at_Object, dummy # Function END # @@ -92,7 +92,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word function_in_int_at_IO, dummy, dummy, function_abort_at_Object, function_in_string_at_IO, function_copy_at_Object, function_out_int_at_IO, function_main_at_Main, dummy, function_type_name_at_Object, function_out_string_at_IO +Main_vtable: .word dummy, function_out_int_at_IO, function_out_string_at_IO, function_in_string_at_IO, dummy, function_copy_at_Object, function_in_int_at_IO, dummy, function_abort_at_Object, function_type_name_at_Object, function_main_at_Main # Function END # @@ -416,7 +416,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -709,7 +709,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 28($t0) + lw $t1, 40($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -779,7 +779,7 @@ __Main__attrib__out__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -2028,7 +2028,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 24($t0) +lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -172($fp) @@ -2080,7 +2080,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 40($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -188($fp) @@ -2267,7 +2267,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -228($fp) diff --git a/tests/codegen/print-cool.mips b/tests/codegen/print-cool.mips index 8e3d1d00..207d78b6 100644 --- a/tests/codegen/print-cool.mips +++ b/tests/codegen/print-cool.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:05 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:19 2020 # School of Math and Computer Science, University of Havana # @@ -22,7 +22,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_out_string_at_IO, dummy, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, function_copy_at_Object, function_abort_at_Object, function_in_int_at_IO, dummy, function_out_int_at_IO +IO_vtable: .word dummy, function_out_string_at_IO, function_out_int_at_IO, function_copy_at_Object, function_abort_at_Object, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, function_in_int_at_IO, dummy # Function END # @@ -36,7 +36,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy +Object_vtable: .word dummy, dummy, dummy, function_copy_at_Object, function_abort_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy # Function END # @@ -50,7 +50,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, dummy, function_concat_at_String, function_type_name_at_Object, dummy, function_substr_at_String, function_copy_at_Object, function_abort_at_Object, dummy, function_length_at_String, dummy +String_vtable: .word function_length_at_String, dummy, dummy, function_copy_at_Object, function_abort_at_Object, dummy, function_type_name_at_Object, dummy, function_concat_at_String, dummy, function_substr_at_String # Function END # @@ -64,7 +64,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy +Bool_vtable: .word dummy, dummy, dummy, function_copy_at_Object, function_abort_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy # Function END # @@ -78,7 +78,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy +Int_vtable: .word dummy, dummy, dummy, function_copy_at_Object, function_abort_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy # Function END # @@ -92,7 +92,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word function_out_string_at_IO, function_main_at_Main, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, function_copy_at_Object, function_abort_at_Object, function_in_int_at_IO, dummy, function_out_int_at_IO +Main_vtable: .word dummy, function_out_string_at_IO, function_out_int_at_IO, function_copy_at_Object, function_abort_at_Object, function_main_at_Main, function_type_name_at_Object, function_in_string_at_IO, dummy, function_in_int_at_IO, dummy # Function END # @@ -404,7 +404,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -657,7 +657,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 4($t0) + lw $t1, 20($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -749,7 +749,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -848,7 +848,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -871,7 +871,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -977,7 +977,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -1076,7 +1076,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 20($t0) +lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -1099,7 +1099,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 0($t0) +lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1151,7 +1151,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 0($t0) +lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) diff --git a/tests/codegen/sort-list.mips b/tests/codegen/sort-list.mips index a72ae923..6a1fd7ab 100644 --- a/tests/codegen/sort-list.mips +++ b/tests/codegen/sort-list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 17:57:08 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:21 2020 # School of Math and Computer Science, University of Havana # @@ -28,7 +28,7 @@ Cons: .asciiz "Cons" # **** VTABLE for type IO **** -IO_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, function_in_int_at_IO, dummy, dummy, function_abort_at_Object, dummy, dummy, function_in_string_at_IO, dummy, dummy, dummy, function_out_string_at_IO, function_copy_at_Object +IO_vtable: .word dummy, dummy, dummy, dummy, function_abort_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, function_type_name_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, function_out_int_at_IO, dummy, dummy, function_in_string_at_IO # Function END # @@ -42,7 +42,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object +Object_vtable: .word dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy # Function END # @@ -56,7 +56,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, function_abort_at_Object, function_length_at_String, dummy, dummy, function_concat_at_String, dummy, dummy, dummy, function_copy_at_Object +String_vtable: .word dummy, dummy, function_length_at_String, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_concat_at_String, dummy, dummy, function_copy_at_Object, dummy, function_substr_at_String, dummy, dummy # Function END # @@ -70,7 +70,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object +Bool_vtable: .word dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy # Function END # @@ -84,7 +84,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object +Int_vtable: .word dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy # Function END # @@ -98,7 +98,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, function_in_int_at_IO, function_main_at_Main, dummy, function_abort_at_Object, dummy, dummy, function_in_string_at_IO, dummy, function_iota_at_Main, dummy, function_out_string_at_IO, function_copy_at_Object +Main_vtable: .word dummy, dummy, dummy, dummy, function_abort_at_Object, function_out_string_at_IO, dummy, dummy, dummy, function_iota_at_Main, dummy, function_in_int_at_IO, function_type_name_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, function_out_int_at_IO, dummy, function_main_at_Main, function_in_string_at_IO # Function END # @@ -112,7 +112,7 @@ Main_end: # **** VTABLE for type List **** -List_vtable: .word function_isNil_at_List, function_sort_at_List, function_insert_at_List, function_type_name_at_Object, dummy, function_cdr_at_List, function_rcons_at_List, function_out_int_at_IO, function_rev_at_List, dummy, function_in_int_at_IO, dummy, function_car_at_List, function_abort_at_Object, dummy, function_cons_at_List, function_in_string_at_IO, dummy, dummy, function_print_list_at_List, function_out_string_at_IO, function_copy_at_Object +List_vtable: .word function_sort_at_List, dummy, dummy, function_cons_at_List, function_abort_at_Object, function_out_string_at_IO, function_insert_at_List, function_rev_at_List, function_print_list_at_List, dummy, function_isNil_at_List, function_in_int_at_IO, function_type_name_at_Object, function_car_at_List, dummy, function_rcons_at_List, function_cdr_at_List, function_copy_at_Object, function_out_int_at_IO, dummy, dummy, function_in_string_at_IO # Function END # @@ -126,7 +126,7 @@ List_end: # **** VTABLE for type Nil **** -Nil_vtable: .word function_isNil_at_Nil, function_sort_at_Nil, function_insert_at_Nil, function_type_name_at_Object, dummy, function_cdr_at_List, function_rcons_at_Nil, function_out_int_at_IO, function_rev_at_Nil, dummy, function_in_int_at_IO, dummy, function_car_at_List, function_abort_at_Object, dummy, function_cons_at_List, function_in_string_at_IO, dummy, dummy, function_print_list_at_Nil, function_out_string_at_IO, function_copy_at_Object +Nil_vtable: .word function_sort_at_Nil, dummy, dummy, function_cons_at_List, function_abort_at_Object, function_out_string_at_IO, function_insert_at_Nil, function_rev_at_Nil, function_print_list_at_Nil, dummy, function_isNil_at_Nil, function_in_int_at_IO, function_type_name_at_Object, function_car_at_List, dummy, function_rcons_at_Nil, function_cdr_at_List, function_copy_at_Object, function_out_int_at_IO, dummy, dummy, function_in_string_at_IO # Function END # @@ -140,7 +140,7 @@ Nil_end: # **** VTABLE for type Cons **** -Cons_vtable: .word function_isNil_at_Cons, function_sort_at_Cons, function_insert_at_Cons, function_type_name_at_Object, function_init_at_Cons, function_cdr_at_Cons, function_rcons_at_Cons, function_out_int_at_IO, function_rev_at_Cons, dummy, function_in_int_at_IO, dummy, function_car_at_Cons, function_abort_at_Object, dummy, function_cons_at_List, function_in_string_at_IO, dummy, dummy, function_print_list_at_Cons, function_out_string_at_IO, function_copy_at_Object +Cons_vtable: .word function_sort_at_Cons, function_init_at_Cons, dummy, function_cons_at_List, function_abort_at_Object, function_out_string_at_IO, function_insert_at_Cons, function_rev_at_Cons, function_print_list_at_Cons, dummy, function_isNil_at_Cons, function_in_int_at_IO, function_type_name_at_Object, function_car_at_Cons, dummy, function_rcons_at_Cons, function_cdr_at_Cons, function_copy_at_Object, function_out_int_at_IO, dummy, dummy, function_in_string_at_IO # Function END # @@ -459,7 +459,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -720,7 +720,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 44($t0) + lw $t1, 80($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -1060,7 +1060,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -1220,7 +1220,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1259,7 +1259,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -1282,7 +1282,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -1307,7 +1307,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -1332,7 +1332,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -1357,7 +1357,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -1406,7 +1406,7 @@ function_isNil_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1562,7 +1562,7 @@ function_cons_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -1613,7 +1613,7 @@ function_car_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1693,7 +1693,7 @@ function_cdr_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1780,7 +1780,7 @@ function_rev_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1829,7 +1829,7 @@ function_sort_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1879,7 +1879,7 @@ function_insert_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1931,7 +1931,7 @@ function_rcons_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1982,7 +1982,7 @@ function_print_list_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2138,7 +2138,7 @@ function_insert_at_Nil: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 24($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2256,7 +2256,7 @@ function_rcons_at_Nil: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2571,7 +2571,7 @@ function_rev_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -2606,7 +2606,7 @@ function_rev_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 24($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2656,7 +2656,7 @@ function_sort_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -2691,7 +2691,7 @@ function_sort_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 8($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2906,7 +2906,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -3021,7 +3021,7 @@ label_FALSEIF_5: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 8($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -3044,7 +3044,7 @@ label_FALSEIF_5: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -3181,7 +3181,7 @@ function_rcons_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 24($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -3204,7 +3204,7 @@ function_rcons_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -3265,7 +3265,7 @@ function_print_list_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -3317,7 +3317,7 @@ function_print_list_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -3346,7 +3346,7 @@ function_print_list_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) From 65ee19af19973e25b79de70e0dca7721b93c82b6 Mon Sep 17 00:00:00 2001 From: adriangs1996 Date: Mon, 14 Dec 2020 11:09:46 -0500 Subject: [PATCH 162/162] Improve type inference explanation in Report --- doc/informe.pdf | Bin 108251 -> 114946 bytes doc/informe.tex | 83 +- src/testing.mips | 13757 +------------------------------ src/testing.py | 398 +- src/travels/ctcill.py | 3 +- src/travels/inference.py | 4 +- tests/codegen/arith.mips | 322 +- tests/codegen/atoi.mips | 70 +- tests/codegen/book_list.mips | 82 +- tests/codegen/cells.mips | 48 +- tests/codegen/complex.mips | 42 +- tests/codegen/fib.mips | 26 +- tests/codegen/graph.mips | 168 +- tests/codegen/hairyscary.mips | 88 +- tests/codegen/hello_world.mips | 20 +- tests/codegen/io.mips | 44 +- tests/codegen/life.mips | 168 +- tests/codegen/list.mips | 56 +- tests/codegen/new_complex.mips | 56 +- tests/codegen/palindrome.mips | 44 +- tests/codegen/primes.mips | 24 +- tests/codegen/print-cool.mips | 32 +- tests/codegen/sort-list.mips | 78 +- 23 files changed, 1079 insertions(+), 14534 deletions(-) diff --git a/doc/informe.pdf b/doc/informe.pdf index eaea269ed65641f4f5ed81f21a9ff9172c21d7b1..306fda5b5edd0ad283e9eee0ee128bcd4e66c3f0 100644 GIT binary patch delta 89780 zcmZs>Ly#qG(5<`6wr$($ve{+ZwyU~!*|u%lR+rgj+qUob$B8>R=bx;|!8^!^9ORSh zT^rMofq_u*S>$>tG!gA;!6eN)CNpJ6Nyry|VKKFOd+#uM) z)=r2@lwHRcquxKPDKJmW?w2L;$`!tSs)AcRo=-P&*NyB6taKh8dG3u0=cQ|E9a5|$ z9v)lQFQ*o5acnp(E_Gr2^ps1uT$cyGrVABxw0&<8XLFymFwWea!GT}tk;aPd10^>x z7jf!L!<+57-%c+(IpvjN$7Ej>1t^bBkZeB7Rv?b=~I%{ ztbI2T5hzV4&kt*5mYDh=Lmy6vX~kdRWuRlM>r(=Oswjn3apq6dNiy?MQXo^$OE zWv@M4-syw2MMFBeK@a9`bpfH=5OWb$>ixK;zauI}Uz63?O&+Civ|?6XoU|m6GKD0^ zkiy>uEeJ4yS3p^kqJf^^MOcL|n!)w)=E@bHXubYy_WA4AC@6zC{l5cfccjwrdwS^E zaAb$Mgg+6|Nle-E#act9Y)2x#gAIh{fq{H((sUQ?R^!!B)8#M?pAVr2n}eRGzM89DhkfG;VR+Cm%m3 z?-Y#kA5tuIg_rZ!#1TA}npiMl^CCZVNg_jyeS-+P7r6Q99w%`dJj^`E4&K6s*7{6R z!!gdSD)4VOiRzvWf-1Hy;}ecy%|ZAFt~DDzzn=cNEA?_{xS643V3-Zt>cB$}nfm*A z;R0B*TaQTxWJ?LrxtkH;Az71U^wQz9QLc!U8i|z{G3Z}ojEjjN&qesW>>E)JnDECI zxi&77S@zhbQk8#|5S+Gfb)W5nFluZZ3b7gGb-*pFc`F(z3&MbP>;A&D!RUdMP#1kH;4!`+UPGO2$~80AWlAhK z8u;$VnJZ*Ud~!z44Po}~!s$C0tfq(?OOM9Ftv#HjcEHy{jD^o9q8JnAAp0PJ1@8Y< z=GC7-1wMqsy8*3^Rf4cZt=O&T>WM_J(2 zrU;8!7sn<{LL7RR)je=p{NQoSO{t@Y4_rN*wpt!*|MP={m(9hGsdjl_1A=|V?GsQ@3XY;pmfx|7k?&dF~onCxq|-6qrL=2fnq0ErS3DxodoKUikw_l zYTj!|$-Lxo&Z5df&ytG6To%f+v{S4JK#4r!FLRxyi7^J{OI@^oyH*vuC#9OKj`%EL!*V)k;7N5Lb5Fr~D1}8q3_nic=*;aP<@5wSF{2s@S zH`hF$Q}$h5FoE_0_^O9B8HE|jKHYB9TWhI%s8va{NTGN!;)0veX#FA-7c?i`S^!N| z(`FRia9DL&L>)ui3K4^52UC^819no{+r7%1XX3FT6tyf*Z_Ni&dpDOmfk^Ms&|qpO z!$~2C>=T+G7o19b`t^5NGKPjJikdQ7D=Kt5eTN-I$s=tjCj62^x4|@6Wi*e{<$n2T z(`W3r(yx*Qg3jH)RK|cDGUG+Lw3e?ZP*gUh_xJv0t^~Td;zH|kg_Zk@0%e2_cT+*! z45h}P+C7-_JB&U<=8y70{dK<7J{WWa5)hb}c17);X3h12g)z3hj?CPqI(U2U=CUcJ zj@GJH$~MY8tZ=V2)FfWE?-r@ZmW<@$^na)!8pX!W*CWREd=$DjxWo?$8&od_eqBtT z>kP6n7}Rxddj~B^gPgNL0(;ulH5N^XGw|~`Me7o!m(X|MdWfXIK#oe#*O0mD5-SCy z@zSgyne4LXl;wKjHQNdC{|wbDaelhXrg;vXLB+(X$vSg{EzaSH3=(HcJkH>ZC;Oross1 z?Vpco^I-ah1SPv7rGquIH+6A!HZ!vOpUT158kU8fn3?#0ieJBAndHpuEnF>$S-II+ z{%2oP0c*6h;x;)^{buXZC7+D7mxc94dsl;Cc0<7MoGb!HyiqL46|(fDFHh5_xPg8b zh1%9O(cG(Pm|EmfBgO;<4F*Jho_8kM`XL1doEp$VC09KE}#r9?lEkBiN(xn!S<@aD~5^%OlapX{@} zG=HwE>PoQYiCo#bUpHJ(%Odis9_zw=AC5O!7iAuZQ|?Vt?omV(|HO}I zd}t2fkm|o5)GF%poCZ)VkZP&G?zKs~n8Z8S5y~;xZQZstUX8Px*?pwxoWKa#B@mV3 zIK25`ndz^k)pN@9R3u4M32qQ(WmtTe0M{~@%v#|1A6UZob0*;8njz7oQPVkOLD>_* zdo84cx9>K?^b-4XLt`Pne0c9i#ltf4J}EAItBBnC+}^qG;h10FSYM>$J=>@?aJ{{; zW$g>ZHl26$(-5cw_>$i^1Y?H*+~3F>Ie$ia{}cF5BC0o zhQ%K4j`W|Vn-seGTS4O#MgOE=3oH|=<)D?&aD?UF;y@lCSIW&k8Xtx>vJQz7sl&|? zE_bv-R>J*oV*abapFJ_LD!(}X$xgp1w$_xQa)HQL-P+ATr~53?7SPiYF92C^ekc;u z&r}$NC!VE*vO2{G?;Q7tazerxsF3z6^t{+1Xa`!iLWD#hBaDF7KjH;V8;HCab^QI8 z7^Z)-nw}tiy+AmBAb^88BqiEKXuR0yTAm>8qPLBoNl-PO8#OEC6bY{iWmR2j?{gG5_-68P0^UpZQP8k6NPtu&AKzGfYri{w;r z{&+}ziz>xc_;3ns!H*bA5^zJdtj6pcx|LXkCV&6f#A{_Nas6t7(}54sFO3Rik!ol> zNeiVz><9nA>WKVeGS&)%94<&gyLKXH0ZDV2D^pKU2kgFJp_$_@k8*~v z=g5C*-2L5`l<>l_FqnbGCC6Z-qN-R_AyTboMBRXCvGi`VfWQ-_c$!&1k39u~2LkKb zhr%xcuo#GTR%}B)iKmg!k|NA=IT@fv!XRo(Q;o!bHNP2+>3QOjKdeJT!n3^^d@tY&z|wE-oVo`R1%$T zh~bCOrqW#9{`ErFh}4u)!63EQHZeS3d+(`eg)0VS7gZ5#04HESQPNoqj`fAD(aHU# zCbXzRsEXwVgBnK2+iX`?(5&7M?I#9{D*3$$NCm2})d zK#UXxV|(mp*^Wv>m^Ibm*+X&yyP>r+ux>pt((`|Y^UN0{q5L)9Iqb1Voe{)1CfDYa zq?XCS4RshvfT!@TEUg|`?qano$qf0;@@Y)0f^jF#sI6de2VbPC=Kr!7lNofwF=9Ke z_DdtC)xA*Oq)|GKG##%@XyadfM2`~fIBj;&E2G!u+rYwLQTy_h54*_zPE$E**{%H& zJawmvrx>6+Wv-4cZDeY@s9e=x%NBtq6t>>`h$h}(27*hjuV0vvZZ_V74;d3xBW}+8 zt7S3|%VzE*jzABK(T2P|+Re0+E!OgyH;hfn@1)jX%TnQamJM2KL=ke22X5}IinWjK zxXMyPr0^P`?iJ%T3$8n!mqVw=t(``u6weq=5zqyLIwJI0r!&#cU(vVqtE<2iQDqpn z^SQZK0BL{yB867Rh|D^~;?d8C7FRtn-gl-ZQKobJzW+?fAOE!57(1ZeBl)g9zRY?X5IxTUjZ-<@MCh02reAjgOA%q2gp4fLf z0<{Rz#?kT)I1CI1&G`K2?mbh`PcBYC77#e8wfHrd@?*#wpytOn<;m1WV1K2L!NRG1 zWjLU8=|%xqgIp1Ql~B3NYWD)a{9=POy89u0U^|+ot z_LLyMbF)B^@o21Fmcky|_YtBj5E~u!VA{N^KYyz5dd{vb;G#rls94e`+V4qofk*g~ z10jl@uxMDhh9j)MLX^SK)_NvG?!jS)VF%vfQRt09o|28e?y}U99zichr7(TLfkI;R#on7s)<)v8OUU)#%*0w{Y6RwA_=U#S=5L zo|@W=Ltye(rfC*3tMX;B%8uq6z&10{kVfYa=gL&xxc*+kDdvb)r(^(%FC7iu)I4i| z5ZKfS(A-mo&IH^%cpyQaA$)0N7Px`JNPGW~B8hB-Vn*C>Il~Ah-n}=!5}rLe-}+&o zV7VV4a)L`xNw+HMbbLP;?-ynnC}B;nj};JXnQ4(=U}Ex?D$4eF4CCnsoN{9}Je;j% zf{kQ*k*fBI+M;aR_c>)2|%NFc_^yIb613m?zk-*Res)}&V7LPG=n&$ zzmxGdl#P5gGU>jyAe@~HjwA$^=)!y>0iJ=YM+p`>U(w4Wy!Fe+ZR}_4pD7|EUj{<0 zFaj}1UPlf5Mf*|{cAx4N)iIgiI}|_u|138e-SJ#M#q;Lvdu(BWTF#pj==qdm$ZI%~ zMo-VD8XHGe`&3R&Z#&wJjK2%$V**_fmQi#9MbMx%1XD_fFdR=N)<>il@RKb~&uUfSf$5I-0&+q>t{x&IfqW?|+0KX9FbZR4=ne&^#CV)O{Wd7AK6th*p{L^E&-!$&2z4;U(; zZbw})FTiN?#&$>iy2;stZ&?U+cQjBxoO0y8!MWbCH_-cvH@9%YSJz6--nyRIr-l>P z&BYMMF!%4YoAE;skks;69fT(*xuJwmbbUQIgr@hl!r@tmG&JG47P;m)=fm5!cBalSGlukAtAp>Ng)|4pt)`o+m#t9=f$C|A{ZXT4Tfe}e_Mb@&BAKQKbdO(kujuI#l5_(t z&`DDaS=9=E6auKS?XPK-;;;D;WN#Mad_Y(eu`@J6Nz0%{$S|F*knggSJ=6-Sh`m4H1Hu83(akyNfJ13E=+0$jX)$2+mR z(S0DqB@eh&I$-!Z#x5kr8e_udmWb)dqfJp^9E~x#))^Ne?b(n_7gJat$x5}F^>VZG zHvBt^IkHkqa*=g0KvYT03;M_-#VJghV>!#q9OA<247K!cCs#gF6pm%*x;aj~l7GLk z5%eafwQRvTHyzVXlsvxS(&YXw81EKy3XabZmOqf-?b%(~V^qU|kkMB8bXJMpIAlT`s_=UKk&*eTDQp==kyh`V0s?LwF^pzz(k3;HfHkk3 z@*;mi$+}8Ku|q3Wkv&}bojr76pFk}9oO(^nNK++h$h^1%UH>?Z5>Q$t>kD4rXJrq8 zJgkVEKHaO`tbu+c?N;nTrztOm!i4hJ>s27oFbLu=q5FGoIYrKg(c$E87m^^F<`w5C zH@&yW2&q9@g`E7B-)Z!67GE`!GE=|hSXrG(4IPu}OT#B@53H@UOw7A-Z4YQik=uen zPonsl#@9%>HEKE+zj&@vNub$FT}%!6mi{C}8xpPx?V?uNo29Fst>Y8GMwwaUGo1j1 za-nkU2B7&msc9lRev^cP?x+_8C~%ZhM?&XZgID*U@LTNJ(Bq z^m+7b;_Uc}<*-S|R)lXPU(ogYsAcu8#1z!j^!aoB2^u20kr;Ar`Ah0lW+STU%fjv} zfAacEgl@%GvdD&gf&ak2?VRzAkSZ2v>Tl8yT3TL6)wDx8Wb^sP=OOWwkH-Z=Kgtzl zY-C(ct{%`F?G*4^bXcV*M7+q;(7Cp8&fAN*5$Xa{H4==HxNT^#6PgMCR5q3?XuDOe z0YBq5#Vmv=&L#8riiAl`kAFB>EFtuB<3pMkd0N2 zx$fi0!$^G6Q^Z*HI8}VD#bo#;xz8Vr&a@%|5;0R9I==$xz^jIk9Ciw^b)le}MzoUt zTu=h!Io0RRB)RK%(%QVN@A|?>Ztk?LeNKcwFZi-r2~Z9vuTPc$*n@tO`~@NgKy`@x z8-bp2NmG14FI?XKvIH@s_fjsp6wWI;8cFYD>@f$1cy`~>OAyN3Uo*2CXizuqdFclvSR0l1|78(Ymj8=Ip#O9F*jU+k{tt|l;Mllq zw%&CCN8~e+x^W1GpkAGm6fkto$`6LmHLXfbeAtm;a`yHTECh7v`g%V=#3#&jjuxQB+jgGwuM;kmHZM_WxH!GYj=Ei9ub&TupZ5(h?D-Y;A=(OY+QMfGJn&X?uxmhBBun*r-I@__@&c?xk<>a zR&YNR5$oN94vUZA7}x=`ecp#S;b8^bv%^+lJcD25(w8)4^6YU&A$`b?n`MoMEx@@^ zuFMiL2YSv-yW2iOy}}M$LjbiLKRYqgBL6u;`HF4 zDr`&WApOJh$FBb(mQ{~cFt-d*l9-$5w1ySc1n6wxRLYCMiQ$BAmfL{jpu(4h z8W1nKWI>1kb`^#Tdh8Q)W z3QaB#8 zUPj`~>EY&Tr+;5(Q}Rp8=5{xZIF@Ebu2!hggzfv7kPDeFFo`bGil(MA6D%kMW$)Fzw{)y7}QytEpuukA$-;a(d;Uf=u}1Q4(^{R*jJZYp2^&44MI4 zbfG1vV{pJ-c)kO5`b+@?U3-s$m&kz^=!fUV!W>f z;4aB5_&-iW>t28rT!FvtQ{wI-FD&B|22Y#8>q%}FkpbDukJkY35;lLa8SaEI=$~tl z6G>pZ&E3C~t+IJUL*s!&Hs_7C9y_VOzv<+geTFo_u>EdJrdhFtxY{wp_ACzx6eKDv z#=wA~q~X%yNoF?USW6;KiDOKK|Ey-NI6*QA{HD=JLMDvEu8PdUrM4`E-LvOR+=d9D z4Br859Bc;6{eN4-makfmpFgKLJZOb|2R0mR=8Nc`4+=Fq-IHDF(NDwcDR5=vpj)fc z=De`Th3zuGpxOKZfm>v4f!?I&=E&Mb$Q9VJb|!&+xM(60ZOZIn`dvFafVE{ zJQnq}NVv^0Jvqr9Kd+ujU_@T=cs7to=vkzi?+y&%*~G8d+8H-!OQDVFTq3Kd#F%k13@3h|&Pnor-bkB#x{G#J`bU=k!K_W|G-QA3Q) zll^Xeq52CAlbpo+Yk<&H%Q;V|e%S_R(L^{hA7f;M5n5s2Dxhl<8!7f@IDnez7+;9{ z1ZxhZ1r-{P;8qD3!xM+AgUFIPfh%`&fv+n?!CIU^ceVt z7e)7Xrbbr%j?aJ4M*3HCFtLoX>PSm^>PO040;^bbq;jiXn6?_pLDMir30t4B_n%IR z%*Bh$KVtZ@l^2_;)!dp|JP@OwL=^vEi%WxY$|})WeP^eCfrRZK)z<)FAMEbk&XU3Q zv76|myll!!SOx4xJVJlaju-S5cO{{pyvbcyG0Q87Bb6tW&&L;cEk&Hr*ae77xH44x2PeVVCxE;W#Z_LyzJu zjj$UGo``F*wJNlxTgsG^VP8wCK25Wn5}G1y2Th)4LI9Q!52pcx8Kkjs3%Hpy`&kt{ zEY&uM6u**wJ^9(2%3k*PjpRLw)umw`$X_U~97);2jXMy|iX(kno^6Iq0rHE4KmI#w zH7qv24Eqz~8~2I0)hexcyiIuG|8b9rJuRU0q&)>Z@jC>-d&THULNN@ytCO-iECInIBmI_IoX7E^smB^DrjV1}n|HOaOE3&NbZ%4a@&$qSZIGI99 zrt>4~CCQPQ^Cr?+2!}rF23R?ed^KA>uE3HiA8D!@eG7?;(TwL7xM3t%PJp1Fj91B| znEPQK$G*D2YlG7A4d$jO2r@;R-c=qE-dnLL+U>a(d<=G-j&krgx0^{ zS6vN4RQVn`MVuPjpRoZ?*`Vi7r3>c0i(4p3FkjSEM#HIICf zsqXfbQS4Ttvm=cKV=0H8o+`g!gw_i?R8ER6vo+$r$Y++fe{G`q`}Fl=;wK*g??MnZ zOz?pP|5CPvHkpkTu~f1-T|wMA)z7 z_*vtszOz|7Dv(o;K7~~0X6o(CQ4=wY*I^Y9>K7-QXDk_SXBuARg`m$sin3yJgZ4=W zPn0J`mEpv#K@)s04mJ1~)ayO>#Wkn=D9wRCw%%j$7I9kTff{e~__1zun&jZC&q3WT zyDHb`DiXwq>?dkJ?`tBYrw>m!ji^~tZ&vaAzVe+1RMB|NBmB@_r&~EJB7x;{ZI<%L5!}Ks1Bh_!EwBdg!hDXeYdr09tVKi z*S>mcTz~l7OFAm-Oziz*gdF;NhU^>MWws6NyfyAccJ6q^V$;c!Vs=i4k`@CJ;>vEO z9g75QR`2ZW?D6Xow#is)zt>+%@q&Xl60QjP%nqp()r~Y&SS+>k5>iAJu(eVnodual zy)JuQ(1?+RVuP|cT*vijuxuk-`ka(gTxC3J@nEPSqnH|`Z_iQt(ycOjkii$E9C^R& zW6CRh9(>Y1kNOziUVGqtJ<%6^bTGrZL!A{K1i@rsj{cW(hdt>pkpQqoYs=xk00VH= zz=-=LU)){okMaV@iy;-_E~y7grhJsB3V5>^-;`Ae0}a9Xrr-|FjHAZ-SPx~#r06gK zV%X50?`LT5roh{^S!Ujdljf0^b88P@R1z!wWRu9Dk*d1I#_{Dzf8{e{^~aWi+fWyE z+>C?7hf&M;0e$>2Ar#OnzpH>Mk-+q;&Sf`BqtCWaFlvU=3DZ0yeT?;7e?vIqrL!pr z=R){}0M_r}`JTb=iWc$N2G#b9SSRVT1_wjtr<1^M@W%+#-LT^XCGp$%h5GhWl{K>{ zk}6TMD)U9Z`wK^+FJ2!==EP)XgHii^ZKf>8&^2Dk9N~hD69yEix5|6rW7f%pMvmPf zU5%?$5_^Av^`mPlHE1qN=-Ng#x+G^PU>l4$$BpfvG-jxw?0s(!JLZ=IA_Z=XOLtCG zLfhX_t7%ucx8K=))YB#ryQccPpeJx|6gy#K@tl3*CJ%7%RIk->mfP?@iZ#6VF5VP! zR~_Z=;hXiNO#m0#j!Go1Vj3%l2nL)Uh0A)$AXy>lPrZ)vt=N8aSc-6@!?!COTgDgY z+byjipH5A?j-PsTwms#I$bRjO5;+~q{)w_xLv^)JSY(VFcs9JsVeNq^&{Bn{P9!nc zPKNA@jf4(5N7usk!!M6vuQA?Voqwt2;^TRw%2t<7qz2-t#i4RKct-WOrU8CcgAyp< zG_SDpzAi*}sz|uCq?X%cf?p@jvsWyx#1Pjy!Hp0qt2+)&4Px23d&iRtEpvF%%bH{o zFd+0VGN-m!3%Qhb;Dy{MxKG@I9{Gwl5w*ij9qd*fXoa_wDCWHrNRC_f&|zJgoIbxC z2(u@kn*l@Snc=cfu-=5Y-`5OivQHvdV+KjI8uf6yCtLO7SpFfSl*`GWRi4H1;<3QUgd8J`B|@v;r7aw@|G@kh`Y?B*D;)17Vi$eL&H0mZe$bLJFw&v_Ir`{Ywms0yc= zjKm09wJz1+_|d%tP(*W;WdEhjl0c88cOB`EpB5Ap+oM)ph_xM&Npu(d(8@@oi=6GN znSe`uC19>!h_WX&Mz(Y1&*WSvUmEn16L`!1Ne`|oV;SPutk6(6|2b`ftn#pu+_bOL zsnSjC=+aLksa^$F`iLB*H%P_yMO|d>YiF6$x33UUtRL$phM%hb@Cx>iu=b=;Z~zd3 zK*qIxgh#P;He?V_A@B&Iy$O`>Pp2pfEMU_`CN#l=QGhFJT$o8D7$~*qU2ErJJwps$ zt|;_gD;sh|em_{k9rsGi{&Y<>1^0-EwIy~->DrXH7qr!E*6~}Dh3v5`_+ePYn{jts z;vO8iexRk)!u3>s`mRiVmFLXi4FjFpSbetIP%#{2XtgDEI5i?5pgFK z968|kTF`BX?2gq%W{_0;_pRAL0&tcUd~1*D3??WQh6o_diO4dFat0yx2I9(e(wSE+ zNIDwMs&bf>QSN^sn)D_Cs9tK)kHM`kb%lDe{T-2@!IW*Ec$CQMRw_mO=r0l6Ws<+t zNrCGoYacvqhfl2NUX@{lxlJ8g()P(8%Jn5NM4Xi;NDUDxOKZ7qsuOqR3QTJsJAS^v z)vG#67f+MUK}z0+LVX6gc2d4E0$k`Nok45kly><1Zm3i4GEp298=5jq=&={Pm^M5P zz#cGIa`^Y#5gRZc;PA@N@z+(~OYgC$tf-l!G-vA_y*4g~38qYZKf#)K0(s$sOEstv zI*K&o0L?OF-ZBuED!6^18c2rOiv=F5jso(r9gu|)AYodUxkEn7t77Pib`Cm`(>$@5 zURH9G@1AIm+ecy6y|{^Z210AH|69AxxtcpF4oezceLMh-*gO|wfbPuW+Yae(=tFzA zth)?cIldBS-~0paVP2Ox=qiD&u;gXP&!cj&W;3glJ( zik112T&HD`(FS@(g_&Z*XM#t_MV<>GMRv7#_fnVyN~7mIbu&5FN??z4fYykiEVUU~ zp#QBDP9|^gM3lV0I8WfPQRS~ZKtp1F54M#~EOP+Pc>A9f+kbyQc`76Yck#2_sF+GE4i=Do(g5Bj9QWew8EK*KHUH{rk5xZ+Z8 zQ$@r2Oj8uIR(j)XsJ^&uA7w*BfR$QUmE=B@)(2HXv_YS)!X{p&-W&o*vjyG@y(LQt6@}^HCmhIkVm|#a2-}^y zm79978b|;*Jdm_{0(EsExy#?ws*avsxf}_NGj!N7P{*nS*y&I7{M=Js4UD}wkvJNKkRKKbco5#aALiw)@Nqt?A$xUV%nMO2cyUC)CoHL zQ0k!8bHC_#G|8`h3sA-df0gfxHmwFe+jlgRc?yUR0Q0Z`-Mt~v(Io0fdwUgr3%Pne zN$J9b4L&gb`pU93RQWswRsLEV5BY8-HT30dG~9n(OoZu^v5f#&p+~bT&c)4-JsPir zR;QAGf`7;K-mqjQh8I>?U_PPLHjXSC_L!1M9H-f1UA=~(Q_a6~DFVd!)lvFLAwk4qIY z!5J9Hr$P9yZ^Ln?^YNwU@f&=^x{3dVu6X`0Gx>kKWKQNJBN`f@o$`RpFf($`jmBYm zV2%7@^D`|qHEdu{McACV2bfi&{6@&rg*@w7c$Y3W@k%&5(C~ z>#jm8Z0kR!$pwC5M62drOU4HZRb$RFG?*^o9E8y`m3+Q4zv!FUVV3rKxIxG-SOcdA z?jqtw?P^SLpWYvV&-y~|#;E2UAM|vYOL`G+WB(K5RrCShy(w%0>9i7Tw-h^v}P+>T}1# z!ZX4SxOE7-Q4v)5MJTgbZKEt#^)stg7HpFvfIH%5M_mx$*?nHcfSmd`2{kR>F9@#- zo25Kim$4sw^9z`+BBS5! zgplVKq$!`zKSR1=zcGx&&j^kf7~n);G;KgzeNH_DiD#R_|KF*wvHdrdrr$IUAfRmQ zN&U1pNvJ0nXspbftp9(smz9`>jhmS@t-%=t1B`>2JxS?=2Ka8KsJpT34|iZM9K?kv zjO($o%Q%2%xw)kW3ZAyB;0SYleGMWq2N>A8YJ6FU_z=N6sxjH{SIFtH< z1ji!DJoctW2}E@E<4A66f*5Pp1k+pv&}Vnk>vm5~0o2XSbANExdH(arg=;Y>0bZ2; z(K!sOFcC6SGuuP+gHxMt9J4?msAbFFF34(}Q8t6H7`d;9r1alOrcoxqnW7Y^@<$zX1an zx)A3sP}@YL5VSl)hx<#iz}n*c64DtQOdnzybJS3$Oalu`2d$oLmxE78O&c-a5~=ko zu3-}hj}7?2NAwSgINEXi@%+IU8+>-Kh;L}fiQykx9vWPRH?%fFfTWh0VBzWFV*?1a zQUY;+fz>&e`d`Ae#Bet8^Hl>oB|(5h(h0zvP1w)liRq=K(aq)Xp{dcAMqGd2U^ih? za7{#dP7K28@*2!p-TN>D{=jJ6$u-F5iF1wZ)uwIFw`?h9D`hFL#c1CcNwuxT(Gf&8 z>c`}PR^*+54U7+rJ3S+#gWC&W2nAT(TEz#xYJhSe`P}Zvr1lNh@xOYmZLERG8EgPP zG}8kO`r^B@g=!7`n~LC8|6cqa`9Vd6gXf7!s3gHt9 zdvp8L1WW<{e1Da^@ETFNw=NU*P5<;7=TG=(X~}!N1GT?3XlSiZ5O0kS4Z)Zjo$G-B zP0dwLfG++NAnzxp2)yyN4DooUccHb^9gzEz{Nb(e!?5<0hm-$hA$$t>!IK@hc5@y8 ztnUQXPEHNje!hnt{XDe)T;2aTO#DRN|L~svw2?|<*%s2(pU3;H+bgg zVx6oo#JBluL2UfkRKk4Eo=2{0WdT18a+=vr-LS-Lr>lSXCE%!};XLXi5<{9A-hiV= zg3eEUnA7WnnAN5yrgtkv5dC9=Q=dTBx(zeir}tM!@0{^IwcVAYx1D6v)=_s#pdAh! z6cym`6#8Ds*pGlh9TCwVYx06O(|_wH*BB5#zC81`1aZ5bjnw~d2IZ^{4|sG40EmC1 zeucFIgc^2+5de`tl!O4qeS>{tNB{*84Guv4l(h;FI@=kB0Ze?AuE5{-opF@z_YHsH zs+@5(^u|6qc*j({XRU$=wd_1*3LkLwjDFrS-E|*>eaX_-@y6d>9DOhM$wdE9#ID4~ zTvZz|9T>!|@PTB02Gr#Mzn{&G{xDoTDF`VX1Jk=P?cbq#Gt<8U>PmjBKE1y&fx9+z zssG87`hViJ{GVKL_9Yy(Ec|C1{+R+?eTzS9Y^?m3tUq6&y#iJlJgoQG7i|&M^!9G~ zBmVb#FZO>#;XeVK?3}!2ZmeyheDdvFe1hg|U4AD zMJtEODRxgP{)XQ5{BF`|B`fF(ew}z?s1LJxE4gJ|aGG>pH)7_+?vOTWvJO!<5yHM| zX`2o(0kg~ziV_Y{%=#k&B?5aX_`gUTem4hbb$%8JpINyxzHa+`@_oJi)_d`$&4+AX zTnM8r-Hoc#1gT)^46{T9Z~=ijvuJ{2A{!`+crqmweT(?;kKoVsxi==8&wYq0Wh~+N z33Fu4oUBg{$GiRZgJcJ8l?s*sMennY@hKf}s=>;dY2IL*)pMsivTt}SSi+BmV%fkF z-BuEcryfXgp}WsSkh6*Xr^^DFSUs|rg8uL$eU5Akl4PK@3bNP`dOixKOQWp-_fQf2bU}d3 z6c(MZ)L>${6}8r6L!Aw4POc?W53Cl{sIbW7`zN2rAhqJf4*tJZy+AB^8Mpq$d8^cJ z)~#0NqDCYX^y*5lCEf_AuZ%*8bP*Ha(S3Y?`v8Zo+6b|tu(Ky2g0M>Zn%R5|D$9-7 zmh1SGyAFr@Jdh#-QUh5a--aKwF6iXvM`rD8ZvYaMrktP_Nl#j;{S%M3V82oTe(oTY7dM!1t=)=k93oJ3pkof`5M!-mFQS8D))_@ z*qNZw*lMicFZ>?ehxz^Faj+u|T%GXvQ`feQ)wu`ZWl#4YGL1CUmRQJO8_h?lwA z&LILy)XGr9n4A|pc*=8?FETltOf4O_5tfH?eIl;%ZX3!f+In~g|A68-^dqZ7oZ-!F z&Gv55EgWn2OU*wfAYPyK%^h7?gWI;z|p2@n_yF8*!55e>l(g=&hyDsr@!~SR@u7&1kw{q%WzQ2DNhJl<+{kGzQv01 zgouxLd}bEqKsHu4X+Kh^ddG0STCP-~zZGvs(ZqJf6!5&y){79{;yw&PaWlPuSkoMA z3_BUW2mA)Lwq*B(CMb6blxi_9mm-C}7Y|!ZRDpqjC*IQ#&ahlAX=MJv{>JeE?3W6E0%N>HXjUJyfu%L$K#jj7Jq^$SG%mu?Yavqn zH=(cfIi0Q_d_iOEg?MB<{5}jv)&;wAF2a!jaSBb%=NwAaEHTd%w&(%oA~~OZ;zpD^ zF+a`kkXGp_s|YVmXIptwxxDiV+c)fv8KZuJXyXpzM9Q zK*n%0AWp9ej<+6OF^n=P&L`AN8yUa)tL8i$C&;fuM_6ir=v{_=&a+BClZyfu6N;;e zU%--#M&2WfD+P4JAV+Y92g5c$V<^xu6p(6h`ND&p9Mz@DUJ;0)3_cz7efxdO)R z=K-0eL2vLiM0pblDen|X zfuyaQB{}3;6Xd>^p9bL-b^u7uzRc#s3?hY|jD63VizZs8J(v)F>vDu|lTm}cNlm1K zz;aMR{$aPHi|z9JZi8QHvDR6$uIxR@vM%d{YPcM<~o2@VXjU+wu-S1{L=2|m;LG7 z1x0_Qtl8s}nw2%KU<=K9&HJNSlvSSTK*mJ6yUqufuSi`k^w`#QCRab%>-U;GON`~5 z!V++A)nwpwcwx(3CkP%xc0LJdhAZ4g%HzCiL9JGRwKzGJGrcgCoC6jKA?HJkCE8(3 zj2VE&$#PauH%0fI^{zYvb=&dMVarz&Re*n~j_d^ozYcKa?~9Xh=ONO+NxJzBoq#!L zqV>-G>a@F*#!2jlAfvy1Yxv?=B{ZZI3kn`apO8zSVT2~^N18Ooc~cs>a>FL&Q>X@s zze|(0oEu}?MKPo=2o*Dvvp|!>nBD~Azv{mtdE4P8uc#JVCGI4XGOA42Qg`1SM<6JZ{UuhdoT8RhKr_U>lS(K!I#BSU$S?4IvL0S$=Qdwpf zE7c*f9JhKJu?|;$)%0JLr?-)93~qlO7&K)dUjefD=J!?cJzOVqq{NZFeAFI7OKEdd$19RU~<;v(*+*ykcqds8dcU*Fs|bctXuWET+vAGaumupXX} zhm(d~3h^S1@|u7NYf_!HD-?kDN;kSCx`sv@Tl19HjshKY<3h2(F9bI{(fsLlSfc6} z`v*&0l}tGtC0lPr8@5!W0jafxJRtJ78e~{o)Wq&@Sj={c4$2);tdf5Ol0y$aF#@z% z+CrnM+J3y(IjKzhDG7pZQFRrb$+y^RaNC{npm;J#dx7d1Jqg92avE9lP1l76--X}K z>d{7@EF7f?U+M8NUL4@UN%^Q!l7PHXZZ_;tzBO36(44rXV?0%T z_6UHG+)oK!wePKCCBbe^=<|_&w_1lMDmE$TA(W75Zn5P6uaog}k~Q7nj{FfWAjHT!YQeE7zR9&;kkFXDc{px!AxYe2OIFY^~M1IW49!vgZ_+4Pv> zb2C-lxg;C@qZvkFcHwFyb)LM>;`ibqwrp{$A#=kh-E2n}6T!7Jz8i~X5kiBG<8T}# zJ4u7-RAZ|vh4g>9$Xild!@PUfZ#eUGtZ7N#Q{#V9QXHXj-c5TwpCCMz?QT{!=t{a? zsUK<*BX{~+A0tt@!|IsT&0!pcSaSLnVu~Tp;jECy$Lm{Ji`ATXptr105j~UAO;Oo4 zXwFM!C;}m{n=yN|s42r1L@oD8GMXi;b$KzjF^N?bmxK-A$&u zB(=zfgmh-tPEXc=nA5Y_4iC_ng@{{Ld`JlJue@rbGlQ^rZbmw%VuX@WAIQ-$tya_G zngcQsgcyh6Mg}0L!+d18G3Pqrmd|6K+$Tcx{Kdn&HCDS}`E29pdX=tp8BKvI7@vb+ z2^^>VmzFp&yf2aH`y*>>?3feKJ0r0z~m-*uO@X0VRd^&A^%yPF@ z)o14UNG8k^dDXgoR@!th%SW6j5#G;B(JA}s*KzZ4 z$R}GiwhU{Q^0pGD(kM2_#VS(7Rq8Mmbsx~GxO>uW6+-Ze^ItM$F(P;g_4*1#$x8e2 z6omX`a3W52X}*atU0Zc|@hc7Wd=}cK1R8(kZBZGk)CGiY*tU_uybIboPs`=O#^#P7 zT~R=HF;L6gPh)97A*DWk2MaDx(5EhPk@mj23#NZrU@oaAN9IL_j5Wbig+Hw*>*1_a zce_#~m-zPJM?7_Uejp$j)5||Vnu9*ALmuMJj1BQ->j^paO54jTFsk=*m6R#?Ey{lp z_vj!^gEnGa_qYLw%FG1Sx79D!XzQ1(=3LojB;?nl z!C>MKsY}WCrQDfFO{I$pTb{dH{Lp`|X-Y2J>4R6ecpU{h@@7u<#S&=B;3W?32u9GEWVs_r6D=&=2Fg?ARpS$2nf{V7EwoQ|F+t%XGK=vL+?Yzxx zI$d>p%SzEY!s|Uc)yBD+`;CA7{atn8oR#C5uXHekM0BCe<=k1CYejgK5krqontN$r zz{U{9hY;b$lyyfUIlRU$ntM{VQC`DB5iYS9UoCorossS5dx3{s7Xr5A4M~?stg`Am*vZp5x({=;Z7xE>+2PQMaYXVVD zsa>R}p##w*lE)zvt>f5w?5pTzEeRipuNg-nAv<7A%vOV6+1A#|C0LwKa29sO!2$7- z{I#(JY;&oP+R)EGHWh!Ua95S#^xY=j{s@Zf^-8CfsQAR2XC(kY58op^OCu63{@N(* zU6_QF?K{7mUS%p}n&<^otzHR#q6|$@^|H`O)%BG74NP&OiOxYNZd&>5XGFivqOJGk$ z%d=Z(xVlcayvgp-fpSOc^QviGIQ&$-8}E-F6r*U=dcWjb_|o4sa>iXfZtBbT%y>LV znKWO?5fyQg)liYhuG+81F{EwT+IQoU$oXoD(|bFOm}p9IR@Qj1z#Ele!)vj_%1Ra1 zQ1l&hP49oQ%`-aUVqnCvliQ+Bh$PEgEMXGDC2f%6@G<#9#)!+#LyoT41!{kp;>&k4 za=&OhzzrgM4DQhc+9dUibPf=HmRN6NaX!Jt7Q=JZLt=}RpFgG7=e${*yfM$}?;xvF z^^;zgQ)~Ky7kJO=5y)tcfCXPVSH)Bd^HI;J($#;FuYH3f{POE&i)TzMVauN4&y4zJ z8;rK81Ga1jT6#rdR^;N#Pr<3*F6j=^^{^kpoluh_IZ|LC(dp!jtOL^I^>wUqn*7J( zLwZ3!aXVm0;qv=@fIHu{@Zg8t?yR?f;Ck?TvnmqPqy?QosIn+<(bw?0|)BgL0`TE&h>NJ^R;r3xt0lqhP z=6-A}`=cAPr_?ImXynj*-7h=d)1+rbE~I@9*un7H6_g?h0Yx*O_>ST@u?JL_OE20Q zP8}#v<#+cF|mujC5D56TzRNCGfGV_8TNRYAo6^D(3 zGH0G5cyjN_SsLe8veONv^Tk5RdH54W6t896ot0*@C~h#~(XB^4e24XzGUYot-3b=6 zkH36j_mZiE?g*LQyv=rdLkce?*a&~!Q{yfr%uvt}66oxKhqQj#zLmDx7jx@!VR!q4 zcgFI*Avr>b@`L;#Uya>{#lb^1C|lrr0yv2(vuN_JK!;VNJ)`%4Bxc_|>g(XXKp2TrU3ZZVaR0uLZ%zwM7iHdgp^8!JjRmHi8|ey@=eB zcUMJs!WO|s!PIsaNJI#as50O3h{9Wc%+I@0&YP_nWqDAk**1`9Z;)&8xMkqY@De`|rvAh15!IJOU zV1VoEv_5Asr4sjM3pU*-tv*7VG_CK@!(0DL%>Xj(eDu)wtD@F?*cagRcIgvE^|FlJ z{D5Eecsn`qAsqt*1X4nfeWhF{@1Dwf2lUNHZijEA4#$Or)yFs(e0vGY*)_dbW8OxB3kBkt7 z#C6$E(&$G%iB573oTH~1%HgN(NHHLV+EoGVEI(Wk&8_5X0uz6CLzF5fvqyK;X}#64 zuVdUcDk$}=wnw8f5zK0b{Q|NgpE4Smy2!NQS!PiA;h)0HH;q+GR~k!()F?|+ zluv%4Nl6pDK~w1$otufQnP7HM?Qkj{=@v$wxTvpay(a%6#KjjLc#_6M!;JA2*6vfF zYWV()#WS0sJ#(zul)%G!#KZpIe#2~U@J zlES)<Z(@ANz>z2f*HZ!wG z2)04x%Oh#*0!Gyh`sw~UBlDrLDd%AG4t7F4d~$LUYMpMGJ33G~u4j;JBoU-uZZw9@ z42J?+V(v8J9n^u)ABxtTk(ifD%!aqSR6-wyzoUP@E8O3vAWFlq&GE+S0IO%1n53iW zOVGq~&P}o}!(nm}7Vq92eG!#54T?yf!3=glY*ZJk_WfKb`z5#Jvj39Q!LV9@qey*E z0n`m4zOQ5I{xYt@TBCh``ZeOm$+ zjjO_dSkzm7$GX@ho$_xHEl%k3NIB6uQUtU8gta)B(4_L!XcdBZo|lS`4Vh!+*W}`E zItiK3mMVo3nuN|&t{R9x@kKcza_IfpJqlE;B~_PkYf)yq=5wzauv>49mo8@Uk=F7KU;Yb zmxie|HNYg_aY1C^BG`cA-HEL7Hq87;353dsR!X`w7_xZS;~)Eg^WL9#l=atQ(RQPR z8ui=GwhO)S?5IEiI8FjC=JepwBLjaIwwYPiygBv#H;6J=>r@d9OOv0y;f^*WOlcDV z2%}gjlm|9`eT}PDMTF>jC&pa$u*ZW1Dn2-D(6qHNQa_b~(*K5@ z&=xf(a6|ZO@It+;I~=jq)YH@)7P7POV6R-|kYcO-Vg(maz*5VGTdz0)2mPZ+TvDUyxjsdndOh6MDORuUfv8Qo+%o7QNqRM*gzM zfHh=*a5d|rq&qp1#wX`eBPr`*)-Bl?9c+%^lZI*pT|2wy&<#z$x^W7gPpU`mvDZ|{ zt_~>>z@V$2Ot00>1?yN6_uWG`AlqThdlaB(SxwWwI5sU4I>jef< zCz8m~4hl3=cQp@bu{DiMA08gt&osqz;_Kv=%yMg-_O)77UvKbQ_4rH3#eWP1>d@SC z?sRwuOXa4@q+uOJ0$0?iTKgddpVK58wo#MEVFl7E-1780$T5Eys1>#V%Dc*qK9wf! zhJAO|N>NsxI`X~DIv&e|g56x?z23*LYjlPI`M79Ytp~DY_ZJ>72^P&Ip|ruEGnN+( ztn9NEnCdj%1cbI$H2u}nopnt+I^1l?2DZKr-H^L0>jC16?z`U_dv87Au4$*uvktJZ zf`?S#j=@C@Twi}Rf$lD2YL%Zjnc2`1fi*4l*E?e>QIbiKo=NEy4T5qODmScCy|fa_ z%u7G0>w9e`XYnGcqDq6xK!L)*3HXY#H)B#utwhg(c$$^pAy(!PfDw4T-D{ppttuE~ zqk{!yCy}23wT860qb)P=DQJ5(BE8wI)a(9BfBhJq>#W+I=m6g&CNSQUY_h}Ih)=ps zFwblpI_7_Km=aRxc4G|zOjXaPWvWq=S>z2QiW{xu+F#`+1c7l6gEVN5i4s4@zY$k( zcb$kwd2Th`1B3%RT)xfl9_Owhi;AY9jL=(&&qOSU4gP?GA!+pfZbN3K1z3@{#1Tjq z%up(u-t$$@`Dy4XbGgA}Q53~L2InnuuZ*eoWYvHA{FN0`llbbTsKSmP!lyl_iKzd2 zw0lMiv7qkQ0y#WF+GTZwjvO~ew6>kvk9&~A4C@b@r5}mH z+k}7a@=2e;D*EO_{;((8CUtv&^7e^TXtbO9HF>C!s zYY@W>7NHR}oc((kNc|ClB8P9VYfz93uGoLYX@B|&+v$K+=%w>RddAgQ5;KW&-nG zW26uZx~yt6a_8=0nS0%xY`^}ey7A2pU{7koLzG;dly^PwMT)TjUjzN#lMfXN{g>6+ zMn-4aa=7i}L#p^eH@DKnP;?XgHU*mjxv-={2gmrivff6CAw;A_$WQ)0WzXOjj&*cfvNx@=!?nN~TaI!{@Pal##rqs+Z3vzX5Iki@V_j|UUMkcX@ z<52{?oV4F{%@)(Qb(;3W9eS+|~~e zyzy0CnDcYJYBQh}H*Wf3IO~>yw|sA4vO2o4;|s5aHQG=atUlh(+sQT@Xv=S~#0~gT}#E{1zu6;@Q zf~9>1g)W+zvM318*p*TTe%NN4W0LKUta4Ke$FrY1=3%|tO0v69>4s<_+49tqxvP8a0sS(krPJ>9LB_HOTT=5tuZ&95B85Sy1ks=my_N@AznM!sxx zemno^)V=Z6qza;%PA^AeA-l<>V@}P29DkLQwe;7Mi&(Az|Nc>dmwDyXW|FV@c-9%a zFpQ@3D2Ed}0p}LWo8a_O4Mq)`85_kuV-B2?&I1g|rB>)o)`Wfjm{ET%YYZBlG%u@1LVFzN1n_(~n<4}e3 z-=lpKyv}8Am4lhJ%JY9TNQQWN_B7CBG-GL^F*^V54qE7-K2>q!uf=uNe82J)cV-8! zjr`0NLG6YGh7Ye8BH5(3azE?nBRA5-=c+OFZ#B;_Jmk__Z^--#Y~CaZu>WK_jw9(- z^sf9eTr0+Y5%T6eIdc8P9gkm_KagXR28_^ik0aSIdd*@lX%v5;_|(@D-6B->-aYwa zw+gZa2LZ`5G%gV74e82cFzZp8aV&oi`%g#a7{VrglC;(5BOk@0heCnQDKZI5*QmY8 zO~=s1sG>Hq9;AWD3xWQWf~$ z>rA~KJFGyG8ApHawCz*jluQ=*KKDth`^P^4Y228QV0SAfq`s}2r`=A(UB=>K0jV78 zq5-*!_g&!{P=!n1UCtoTospHzSRU@w3V^26Uv?*letC188??u{y^n8p?{#FJKQ1)H zT#a15TBKuLf@XO@>voc#J>j=n#m!w;?O1=q4tUC}li4O+d5M|Tkn0Cv z7Gy$XlH)4j)=uB6Spsqq`mOCP*gqU=t5_f0dzT(ze57-3Wt2cVpc|hrO%GFzm`rMV$h7)Y+0Fs zf(H_T5k7zF6i(-N81$L7&T(_dTxla0$!fUbw%7(}qhCx&i`!=9XXi7Dw-H(oPZjy!AZgA76%k_*yh)=jiDC&FT8UkOPR?8zO_B>1r$8p=dOkDJmKYr^J0I5$JDnOG$q8s#Ruc{>fhTv+Z9>Ov0Aq3-RYs~O$%<-7hjS<;7e>mq1vBae6X8@)v8$8$Iu&r= zo4csy-MWx4xA_RG2h{J{18XhwjXp||@K?~rY{tf4mbYr%yHrY_EcmkUa=Faw6qZJF zHCxB8;3K2ueXW6kZZDnI&{|qFVubTSqRW4@WIhZbhWD*3C42u9Yk_W>T;f>tT_HMI zZj5K7kHqR`B3gy@``ph+ew&K{SmOAK&d61zAESa1zb+SwiHr4ruT!;;`0D+=O!cxZ zBU=HO!&7QvmB82m=k`_Ri1jOU3A?9V(>5@$pe$>{Hu(c6K&A0(aa)Nc>$*)=$j*PP z2W~pMIN@6}DhotR*paD;w?~E{`6R|iLoL^X=YBP~Qow3|+_KM8!5iv5bJj({&!JMx zx|{3{x6pljTc3ZuF$nE;M1NU>1ezArBh6GURF_~oTS%O;BsA`g(I9Jx+wlcNCClrz z3Qx%ShT32ND{L)#J!%Z1LD;bgX!u52=+2?(clHU`PysL-eEd$w?Ad@p8m z^`Fc~DycgIGgznwhX`2+`LWk`(DX@IHwEj_8THp*(1jh|1S^Z0qO03kjH~0TE=Oy^ zd({{eid00#w~L=}7txBB%jabzrp|q`NWMn=7%P9~jG$6y z@sil{Jho;S(c5f_{~nKnEk^YvfX+E6E;UCDg6*85Y7nBbnieJZ%xpP{G2jcHHYi0D zFij%Gh>DngOPDgG;5{dnfqJbR9iWS?*rPyVl8sk3z;6V*m}Ucia(LY;WJR6BI)P&z zP%4iC)2nnazMu;$CVKM?3+x!Cm@l02SllCneRqP8f zC|ZH~kckx*W?l=L-K}U`4K1vfkxaOJqsrxokOl%DN#2!LL=okSP9Y-`a5^rFQVU-N z^u!+U{R1scig7=Zyis7UQMYo-&tz}sAG!uDM7r>@hwUzmP3DLZr zlX{eW!rF!?4yKvYaJ{Q&=weQi>ug(-mo{)lfPtemwU$w)#94g1-Ev~Te0w6jX-)h+ zC{uHM*P$==p#9Z#dAWaCw(Id|1p{nnXa``$!eC0?kcX`t5o|aQ?Kqm1rj7P$@{f4W zoDBA(lzvhvR=>+^JIairlXlY3zOfoPRV&L>O<{}{=%bz#F){ZbANF?{CA;<;yz`Ly zo>LUw%!HU|W+jZu)%($e61D_kEQ%9qN|oTl&7|sbnZj72j|qQ9Ost{=h1|<`c5)d& zt#I39s>dlE?=S+rm{znqWZeZ-C(*~qteiQ#*)A&VP_yU|ul%>+_A>gas?wC8Tr#=c zWwW3?wcfd|_oQs9(apk=CzHNI)DH)EI8F$ThP43O%;+QMxZ9*z>mPXtIaXZlrS+ma zL-dYx7yK<}{vUth$0}T4Ngj?sqNHV0E4oe>|8CzM23Nbb&!)WR4JpZlJsO~v)Yt@*KN8fve3nhg)iyUb#;h$M2 zdiS9fkk5ZT%ZX8ZF2V-+&U)TE%C#*L;dqZmw&o44I&rNQASbYv^G>Gkt8&?K1eNit zJV*QxvW`{Cw%g2P%0Sr#iC|t-kT#$9mQ_{4S3qmX3*@{oaExld+;ZMgA3DJU zpLfEN-&6HcIau-*1Rqsv&}^kO9TUGV`^?B!4~Ks>f!|Ye&L_<>Yj~|=oX|R!aC0J1 zZiQfNN=M`D@k4V0*C2*yLVHB$@pdvfwWLW#8b+P@Cf;-ppD(wAf%`a2`mibKj-=tC zlM{g1Nsch?w7Mw*LlHu&n9G3adHz!Tx$kD{&Okoiu65d>V`dJfuyOX$YNso1jpzer zVV!>rvvgjVW{xfX3utU4#o62tJ_Q!<}=`Ck8> zz{x%FS^TrXFto-6EeYi)*~wwA%u=krIGx$E`;+Qt!cnS+JG#r*8KN=-Kl&3VC6tSm z{s(pN(6j&I0&LaF`J4UtVo<`ne&K&N&B(<3pX6)k&cF#Kq>!V#k9W`YN`^?+_FFCK z0?`|$f>teEuzoVN5!d-VYyZM&b2tA{s2s|ZB0px)4=r3cZR`mQ=@yb+e6mD#S$ zL$xp}z$tIGx6})4b0_8NoYR6ek|l#;VegIbvPC;B66+g=ZH z_z`-U;r8){=7;3SWt_b+M2D#+2$Jh>3{kWbLXZ*^h5Aeld-uy6SLMqdFw6CfQD=JY zbRg}>-e0tFhzEL*4v`i=H-Uczi94S3xYxTla+(m=PsvYiLUw?PW7>4tbUxinS}yO! z5t40GPmzNenRKNwM=RrIU-C_4|h9d^Mk``?BZ|Vp4*8yNA-4T9)xzq zAcPG1o)WPZ7V^i?k!IqPnpCW%%v~k~4dhz344+M9Hxlg2u6ezF85w_rzjobDqwwl9 zFbZKI^Bwwvvo*%p!)9qi6Z@pVQL(Y3Y+_Ia&JA0JC6a~Sg^?$6MXkf`Dt?f$zes;| zemU{xK9biCo4HkmX>g44@PfM&gf~D`Zr8r8KFx5@d(l9H`)mvlMKsUElaP()oi5N>3MN1er$2vVq6F6Goh-SR+bg^&ij8~yyc?(_$aNYm(pAD zbB{<&rbb~5osJF&((tg@-W3cCS@I-a^#dIRoK3aeHJSVVe{*g?QeUdk{hgRx4+;bj1r1|NAT%ip2bZDE{pknE7# zzkB`EZvx<%{%%mp_pnw9ald~RM8;XKW4O94&7QdSKqY$A1@YjF=#+p3 z30a1gNYX0iX-&KV^%H)h^E6IUb~sCO!i43qU_#6Hjbwj=`PcaT?R*yR(7?QMzatvu z4&eDH9Nbg{CN5q8`NU{~Mk;Qut$D6lV6l@1q~>j(ePjHn(h^~^WG~$|&J{?rO=3MT zh3nv>GMf9;;gt6`k_hQF@%Yo5??wuvA8%q3&l1 z!(@kG$Y0ADsdVTK?hv+QwG({BqOFVcwMjYMC>I4KMpIj99H>|=V0wjz(wjXGa-wn^ znxZ(mdxnZ3<^TSN{ntVhapD)hUkTBi?H3PccE_^H($Y7wmtWpz+vaV4Ha^ntD`B!o z`+orSvtY58at{G05;rh03NK7$ZfA68G9WQAF*!Gvv2p&d$Zk&d!NUL!$+P*a80|N2bvM zI=g@zz=Hp>ka7l^L0)9iW`B?uLuCgrK*7}xz`+IJ;1%TH6J%!xaI&)t{KwG2Sr8y? z<_59^D6;|-9Kb*qWEv?4M^9&vwGHGY&wq{pdJ6^shkyVd^B?X2345S3$ifT^P&R|u z0PSBgTA0}ZG#xBJK#1pmg`gLK(Nb;i!0a?=nQzt4$zcW z0;oCy!G9Vn{b|4q`0H{29IPCFhx^O>cOVe>4`(wA3kQ2gGq5KJYz?pi*#QBnvP!HF z4+t~B3~c$^(9F)o;eW;7%*_mBXJ-Cl@JH!p09grjfZ0ojfA!~L;S6$wxUjl_?0)yi z_B+hWHOqi4r5x<-fnbOW^6&bjLC!#nmwWeQ`)j!Gzz*(U@Bbhx5ZKb{cN>ShnEx?iHWgi6ZCy>KzgqrVDJkjT0q|zw;sCI4 z@~{Iq*g1Ite19(o-~W!IW(NAJ4)%Y1<-t}CFCKr^`*KnLsoCu>643v(Aq;^34yNMp zLR}z${vW0rvGcH7ynJ!|KlA+$m;XPS|Bmv1W%~bCB1?Ej;C*)ofFFVBd}3pf8%nYp~I9OREd z{>H$UrTXtWWWW{;|y0f*l|)E`XPw zeF0Vu&VR_i2hGa^V3YVQ`V;X3*rfkPe7pcQrGJnBfKByp#Lo#})A$E*1K70wMgn{Q zHnV@wi=V~c=y%U-mj8kr05;&i;7d86f5DeX@BRf}%Cq|iz7UoT{4e+t%Hdz|r9#Jl z!Iu)9{{>$Xx%>;hvtG=iY}*jrc~d7r?9Q@1Aq;n#ext|9GEroL2?UswDH;6wi_d8{nb)>hY@QSR4e|Otl*vK^guLZdEkuAH|J(C^uSyVnYRb>}` z??)vxqioY_EDTs!b@PC;*!f?u7~L({U;k>8<46cJ^%`-?g)sbP=iq|R$qj;mBI&uiwzaFbps}F;@8Eocn-hakeS(s7g zbdRQRTbQ^LAqvPey8wR4plcsaA};vF)V}J{JW4B3lws>x!`VN@l1~%rwbWXjPZcgS ze!BMIt=X2j!p>$hvQ5%^zig{9ibENNkplGLXx32W)uz`$n9)d|e>2T_aZo5t zTKl|cTgVUvJA-pSRAXDhOq3JAzqQ@FKX7kWNH6YN*kGRy11O#N*3CV&SAuvk0nKP0 z3u`%H4Ur?r{d|A9-G9GoZJjNEc*{96#TkJXtot$9++KNt8HPWLrj|9>GXuwebxN$x zYlcj`gc`F~SWhbPU^(alK%$;n@f zwiupKX9Qb;pk+{gnYg*PNt}D%{gBd0yXauqBI-6%DPAc;IDfAq*mq2ICbaf|6OJ&y zY`GAZp>(s+n~Np@uV^1Ij^r-4NqD679kIRa1L>K}i5xuf2vIfDvRuvu68rke!gyt9NNB~AVTuJt8^jCv_Du1V7i~7-*iX>x}-@OOgT3uas}3t zCnLZ9=8%IeikQ4${guG_9osuZm2RFlYKB|vb{mSLI}V-cIl(yp(H6m=z^EX$&L(>2$0CmJ7|o+UyXCb+_qu<@mj5l2C# z(>4#%Khe(A0?v6Hp+W_PR)-_HCk>V9LS6A8Irqv>>M?#K4}6m3cQXgkU0uy*Pio$t z4aBT+t$)pUa;Eq=TJd8Qx|bdvR6hRSu=;Jg=S6|89LR;OnTK)Q7OmPvb(xno$^(oJ zgI7!08d<$ZDu&{M`JB5l1VnzTlshVgVlFwx{lK0ZQ*4fK? z?>av0+Y~dlYk^e5ZRcl}6Y{=fs{n->HY%|2(|`S-OeY#bE0R_j;xkWhc7DA##_DXj zeNzy;r+T(EFUx&UNz-;w0)Mjx3kMcgNhzuPWzw{igEZ^Cq8l;N$s# zY3R{TiyIclo2^EzizJ&&YjECk^HIS>J1Nad@H-U{^K{5N3=ZCl?{8;hp!P18M6+sp z7Jof&J4B~Yw47nkxzKUn=1?2;6BNhIjttaaH7gvUh4{V-8nH%q+CUK3`C^{E5h?G$ z!2F|5ely4W4oP2}Q z5j{0PfolwjAUkdEn^hOD?+j<2dxWCbHhHhQ^IU>Hp;ETxJ4AO; zJnTMwSwJMk)B{;bkEo`=wNM7|Y88q7EGc`XhoCO5@!8JR99j_;Wq*~Xg#mL?$f`XsFS|~}jg;jZUL<^Lq z(&%d&Q)C|@+_NZwmpHlFdV^=S=mmnDrm0!z%Hy=nbxtHf+el7~+6?vv)?neix$zzn zY8}PTmsO7R2Qs_gpVk?OdEC9i7T6nqyrEb6R*#Vai)p4#hktybN6#8_kc3}lQ`7ZoHa)iwWHJPixH<&(sv8n^&W-buk(8+jz-Oa98)gftJ2K9DI?K(-N%M~K~#{K zhW;={<}+{h=pI#F?D@}q=5sdDBDpzK<6oFO_2KP8Z>QHiF^sUT1@;6JEB1RYPD`lA z##t~Y#AhyJ6RDl|PVeeB#?sR(mM>1Vj|R`DKES(PNt5095Urtw?E zo z9B&Yr`uO^jd(Vt6=Qnf%5#&aoccw+wYFR<4*TXLjmF7Y$o3}WD&_2Y8tDLWYy;2G* zs<={eS0yHJ?`aLmym8c>&JBLsh#eXe%zZ3zRjnU`D4}gD-UD9 zxckULGku|#1lf2>r@@3w{#Cz6zZntT7Mb+LUaOMDR#{tsuH%|-1%}BdiT1f~0e5FP z9~ys42sK30k&ay;hh$wAJ>T#d>szfnzn4oE7X=R@O6+g*$8$*-Ql?tlCV#T=CtR@p zvY1x1IeG0-U>3#?M)SiwDqacU<*T#{2&zduLx8`fX92POFvYZVMiy8b9NJ{r<~_1! zl`&lN2}np9#?}n>Xt!zR>Ck#09`8i##D9O{&YBkfp%&Np8W-2bgW_qbI@064*dwKy z9FA%>l#Gw3SG?k+WX^pmtoku^TCC>$x_8OZMZZ8OEoQ}fM5!pRd~4n>hUa}X+qU1Y)E0GGApi+NJ z7x|WSG;8x3qVf?BE0SAG(K84e(NA8Xh+%ClsEB-fZI*>`dYCD@XYucNM4>t1AvvFw z8}*3?3a1BCkb_BKW(MRtcCIgSVl->X4wDW2==nF_(WbXcGyj6W1(|0B1q6XyL86Fn za~;y1_Lr&4<7g^BU17w8KVc-Gl30Hq@LMd}j&Nkv52l$O!OckV8>QB11LR86YMXm~ z>NvB7Wt}3w0l5S}b68wJZNszi<4t_`H5p*v9V=!i0gEts{*xW@))_Wv0SuQ7%t4?a6x~UWiITH zil(kgalfRRu(lGZ6ahr%cB-W@BMs<3q`r6k=@M6$rkSosUK z+JS5LlG6_zv~NQec{A?@@O^*7qXg7lh=mu7Ka{ncG3A5AFAa_w!Of%EPLMFtmexN;x!iRs^mZQ1_#Ixh!2On663S#N&L2J6gP05f(i9Z!-SQc zSG$h$ArUHUK_(pd5!!zn%@x4?flN>1E&K)B-fRAx!A7RknVH4)(w3ovC1$;5!z zwr+BNqS`56MkaHh^s+zukBA1UW4G^B&qO@u-W^!N8VkB66U19x@R>jz*sBtEGH74C zd2K*+ZwoM!M<&(sTiqi?n?PXKS6xE!ccH2Ej&pttN9jBC8}ENfJt@C!7ta%Ao%sy7 zboUk(S1{`~b#Lh=!x_YUl-=yWw6UY+bHMb0Zt06H3f@vPsV@tPTGTUQlBCN6yAM$M ziVL&&FA#wIm=7wpYhXP>nZlk)>vY! zDAYZ-U`p7(GHriD#sUU&q3+=u2c|J@2@h9ds>$gE?wVdu*CK-Nvp#0)60{p?1)<22__#c4Ge@UQgM z_&W@*_8#cY7Uh+Liy}%k>~~>k@INK*Vp4iaKbcy6e`507Cv7TnB^7DOd)ixhbuH4Z z=Ue$pDZ+m;a(&i2-Mhz0bfE34dgaa(6^(I#;UTlVk;_hwYmk?dFPq0K?_?_VKp_Dc z1|n6r5@iaEsImM9S!@S<}acLrT?H2x#y$s&&yb{J(V zOMEIhtwSr%=#X{4&qNQx=FqtJ2@Jra%<9{63bZ`f&{XjjkkrAu_lDzO?F>}hfqd!= z>{bUCJfEiXs&0L@AxKpB5!*$pscE4IzK&0P0d;$Wir_b_!?Ta75w*JyVQ6k$w?CdV zM^=9cy-6;YSio}(G2LwiDO;%nKA%z-FW$xms%&7FFeRi=rgXY}7J6^6TuQ5klvO27 zp-B=Ho1w}+jXvt!5ATO$$yBi7J3&k^yBg3jpWu|oA1GLH=`hLJq@^jC&Z}g(E}Qri z_pbfxYQ6#$!O59X^cJ+w>g@z$aPx3=zDR#5aOI)IvNtSsPewV1Icv5EpNxPZ;8?)Y z%YD;{dl3fFI)8m0K+Gy&#W*ze7-Zw-D*#7NDCdu-T1nY86~%uCU&ZHmTTphFY7g@; z5mvR&FVwtN>}0UPY55$2+4KsC=+k_Dc_%a&Lv*sAEvF3CJ8_JpT%#ip?i`mVZ}op{ z;+6>1`f8{YAT&5KO39y~W%a=YbfvxpXWqp{BAOS*KsXtu>OPy3Rwo_rQ}2_m za5_blmQFB3Pzd=j-Jp>}0N8xtLoa`4RiSLCl<<=SsB!=cqjO=`rUuD*eneiSxp~U@*iKocernxY&b+#!Y{sP?*rCNY$pYg z`J2phI1-grNbfq*Lt7oBu`v}J8bcMg6yr=1r*C40x|+XgZYc#ZWuBdQ*X^0^@RuxF z+vp<++O6#3QN8z-@Wbygh1*Tf>KK519w9gn4yjvdIug}v%aa^kSY>}AyuQiB&qJw4 zN=>3q54e!Owh5?v$lKrvRG6TLZ1nSg(1f0T}tHW!@xnK4Wq#EGM7K`rDS6#tS=Rf8IP`<5K%?|8m# z@AMV@0#hG0gH7h|&U1c}eH>0f>r0;P=I$Y*!oM>Sjyv>ypXM^eXZo;6e;}L++G~Mm|c>}CW z4r&j&Ce%J#X7=r*`GX#hdRhDo*y?Y#-Bi?@c1|2kp|Vi*TsQtD4WygV&u>&%T))U; zoP-3n*i%rO2_N)N&vD7SZGOgZi60YXVd}1@gkjjTwXs1Z&#rO6j{U4gB0FlRu0hBe z!{y~Zi!Ah6l9_+SzA_wPVyNubMEsO~?zQ!>`bT$vE=bYq4?|YtsEou(%o@S9*M-wU ziqlZ?ijn)HLfdWZd2G02^ts~!wn6Y^VVrr-x|7!B0tfF8mu{_Hrf=+P(Ywm0cW*1L z*o;hDnzr&*TOs51x(EXG`32attjY=<%Y;X1)UOYjpnZR`RB;xap6Tw5nDhtHII!zhV>2M&OzvhcvtlZ%UOTytX_#sH^p8jf# z{q<-^ScJ#25Ml9bv?!|NH{BW<${3uO?Ke!I4!S|Kvv`x`dd}faU$!%xGXrjnQ8rj4 z92ufFa-n~*eUelNHU@gt+V)9?GY`RreweL65@3o7*jH&oNCLsg(OK``8F+1-LBdd~ zb8x;|WqI?Dvf!O)KJ+I`7e201o2Eo6D~tD%x=9@&P&d#kjlbiTV`BFHQ8=b0r$9W$ zz4gm=$kKR-YvtmVLae*Y$0$4Vg;edIMVZuseg1#)o0i>hoFgoOa9!YvGr=@+8=P;q zcVY#N=bzv&FR7!nv@kuZhdXDWzel|PTwJ9@bm5wMFNu=0#%Zuf1}l&eKKp7Q_DZjO zve`|k5(A|g+=n-BR=0`0&woEtkJ)je#>jJegNXVI38+=e*4F~*a%28TXzcPGkzdxq zapiy8+G|ApgZGSDTXB_?f zp6)C^YR3yEmpTX^wPWS&3}NX_ck?r!f_f?JaS9#ehAflzE7()-Ui7>j6x0$N)GSNL zwVXq%3g7Hh#ZQJUyo9+jt+#8}<1;F#;K(Vg8%g@173Vw#L$n=Xfbs^Rt& z@kWdRtS*kKXsYrrN5)8evFbLsK=H*vaEVf81~G70o~=U1mdFD|wle!`;AIAmPba3Q zs3{jaom7n;u6*r9ro)o<{`EhP&VT??Je)cNM819MkCK-P`v?+Aj zv{#MO+5{OILc|x$OBglJ)RW0(+W7}!qonQE@~ht78z$e+BEJq;oe|C@-Vhs~`q}Y) z_#v3#@KZZg#4W}=Eg-8IKa0en&C&QfzTNed~s;z%W?#^m}g+@+O_%Npb753Ro`!pJvDeW!(I0KHoYdD=* z`c?))K>~JeLn_`j(^<4=+t^$5;A8}U#vTP{QI<^IXYrJk9gWUDIYRycjF1Iho3PyM9s-hxZjPv%aB-fCkxmQ)nqS68ZzgiNWiX5!0+5J-HK zF46jh^OMH7i2JC+uH;aPHhg5n^LcCB$UF3)kCWra9S^aK^|+2#Sh?BvUB9nF)#Q5a zoePst>+fHsB1FnZ<&1xmH1k|b=F{mSnLBZ`nHZn6hR_Xiy3W)i7JLEgeS0-*be6tKP)DAE(r2NsjX&nNN`}usp|7?c@g?FNOCJp-PnBFhM6&u zj4BIaQ+qg}=dFJMtP0eBjp;9d-KG^t>9VStwmSM_|EnKn+~auluXGa_LJXAO)0K;zpA`bHDI|&?{j~>+xbqzcdq+>^)y;~5I9@4 zzK)oa-sGQ$ssgfj9e;DbrJTZe5auBBy_6@NvDEF-bnV>3@xe2q`@`{*yPd5}5_UNtjtwzzQdu2T1^{hLg z{;h;(AvAwHQ+(UBZ=C1EZRLR5njgLzE7y18fac;OYC1|E>k#r1ewb$VCSohykzcRR z;iSh}tV>PQQEi{pI)s^Jrl0R|4DscYvV?K%vcj^d;AGi_O0Bc_v!ED|*v|-fPDOM4 zp^MQF`b9B{8@!q zd>MZ)Njw6zt8{d;z5Ah<{pmIZl4pKg1uH^9u3lzgYJpj5Np=1L(xTVZ((&Qcx2Jp$l6-%`jQ9P7_({4KNSQiajNT8^iHtt2_V~(% z*1?ta(-{234R1`VmF~6!0dCN(24xmAu2I*ea%0c!_`5;rb$GJh*kT?ZcE^-8#t>?H z#RNpqBjjWj8?JA2WRnE=e$n}9Vyd5eU_pKb1%qQFaL0EQkWf)NB=v)GJTddDAPs-7 ziSyM+5eq6%jQFg#OMc2O#zT#{h1BXb@jm$XCI@>DVs0MGEKt^KP@MJW1m>4WXwva0 z#KoSO^N%W7f=Q>Buq}=T{2Cqyf@fNla{5#ai!m9rOCSTNx)24M0$r*Q!-m1iL0kCj zMxa0Crw;g1mS+com}()o>M{4e7F~b4aOxV@<#V#xUGxv!oVH1i##gifXpj2i*6z)# zwtP;ZbzX{nxIe`y`{urZ$HfLMp>o-u#~!jj6XL)SLS;hR==0z2)khMuEc-PaNq=L z7^0JRX&>DApd&p2q@MclK8*!v9)fG8&U+jZmWq)2vvqAWE20NcQ3^l5sKN;x?dPs& z)h!gbQiq4b7+JIaM3E~x7Jz;snGyJrezse6;4=`PTHMRl(nTqQm$9#LiEMdR#*n1Z zeCT+oLU_2q7YHw741cpAK#YIuJJ_CUNGo+1D+Eyp$}rv6D4R{BuPZ&=sC`Z|qDND3 zj;ajyjs1j&qf5ILrgAIOXEqyLucK!4`K->sML$Jxb;N;;%Gi}4*)hsr!|>L1U8FtB zI)ag}mbi>HaKtR#`dNB)#D?&vgWyz90W~}<`=>zvl?h^_)?|e9SbTrjR`eas&v0LJ ze9^aRsi4tgWn;HfBAt?-Gh5kJw&g@Ds2zOETkLeNzQal9_1W#uU4MM;&wu#?N=Gpl zTw-M!t^c{es3qvbE0Z)HH>-REY4*HGMdge%2?%c zxObTha=5?j#}?Immu7#2rSXP%Tx@$7Xj^(sY=i0gC7sk&nH@5=-=N&SqpLM}z2jR% zXU>-VI)CH6>NT@7RfVk2bnYt!G+RZbiK;v2 zf}$`S*}hzn>|2i6;#yF7tfVmROi-Rcb(I%sZ-rQr`4t8#fB`N7WtWeN*OZuM8u zg|{UvG?gU>NR}NO;A(HW5AJikh^u3jk5%1>itRf;f&PCRY-_CAVFa{ndYVW#0aK=q zc=xOgEjt2vIX}#`g02v<%qv6E1#I#0)qW*`bVM+XZ$z>)V*tw>DIxB`yeb8V- z2E$t{jWVCiRqzK`7cTQ!(?O>J)5d~Rl(VAm1TSWY@@>|#Q3Q>rEb#_Z`zF#bV>dq2 zOKjX9glT`KJ#fxeG^m>|sUbxh`W{>Katbg7%x zh0NW9r7aQzK@JlHYFmpjp<;ErcGB&sFsJfs!I6KJkL0uN?G)Y6u9Lk={kZ9{BZB^T zX>?y`DN=8zUVlMug{1VEvNM^^qgg1Cg_%B5uG4^L&c!;3ThBT|NZQ8QMh>xisSCG= zH=ppS?gR3>SYAW(pFC?Aec0O-k&x+klCc9O1_^?yKhBcYg*(5zY%Jx==LtW?bk!VAkP9pG+FKT8DUW!{}i z0TqfZp5=)~RPb*GiCj}Wc4(2N)p^Wl1)z%@dwXEqlQrT^4_pg4?vXF3M}un#s49Mh`^@XQJ}Z?{XJ*%Q>tLDdMlO|+Cc%uMp!ZWrowzGqr3lEC=wSCzxnKB$@O4P zm+vTLh2~&kzL(HY;rtx@6vleyECW@Z+LXxIeM9zuY}a;2+b4e)WM zX>xU_P{fa`BOa0JD#&J61y@vy;+i?56L?@J|! zo&LbTT=_BAbIPkOmu{)6fO~@Zpt4FBbJrRRtr%KZ^XPYybDed~Z85pIG%&PB+cR0~ zwVbOFAE5cfrfV!YttXb3I$v6})k8Gn2c!$%*oY%JrG|IcB>@ie=ImYw`Q?A>mlrX} z&FiFe%wBcJ1JGBP3-EHd*h4Cd9{kqv%(^Z2ZzQ@$sw#Fiu;puJ8&2zoi~EKv4Pnx* z*MWCw>gYFn0ICX%j`Yy5pyF?-+f%lr&07xZ zIaDJtekZv`HOE`m*PpR|GSP57^&MpX#M7QxL59H!nA%@+i2?cNt`Rh(Vtc8 z(iB=Aq*^s*;ZIXS65kMgtu6a;byU7aQO-2!n?pxaH=LO55qgnUXe*^U_S)(qftL;8 z{{Yo10S=ecDgh@GGBi0e3NK7$ZfA68G9WQHFf%fjv2pIDup$22LP5e_2}_fRwWpfQbdb#Lmsc!Oh4BU}j|G`j4Tl12;g#z{T7c zAWILBvb6y^!jTEv+POQJo0>U+!u;nefYOKxz{JJHLHn0GK+qcKU~Xh!1CTXvG6PzJ zA{rT30hDcx%z;ks|3g8^W9H;!$IZat>gq~wVC_h6>tM=9MGJ5>e|ItiC;=UT4lY1r z!0&Fa#O=mAL^xOi&SE04ngG@*IsE%jGEGcsfNO|Rl^e+T?a$@E(cs=(XR&ejfK z0xAONZEgYt{e$y#G;jd|oE)5i-k$$f{4auIVgeYO8#w_Cfu`m*aDUiAVxY<27lposf{N8^Du}g%v=@ z%*F)Z;^YKyf3PtEy#JR)!NB~VEExZ|O4^v%0=WK87SyHxB<%9f`BVP08&rV*<&v`n z4J{Br`DeyIGqN!nfj*f2KTrB!F8}`q{5Q-0+l>F;gv6Y!to~9{{-yu_Q5#sBTe<&Z z0Ge56C(!)M+Jd&g=Kq?i1OMJxS)j4Gv-SVgN;(;UfA&Do#?(fs$V0-$4JWc)um&}JD~f^H5+&_w>F0)iIje?yAe7}*;C z-Y{l1c7TC{gMm97BWRGA+1LP{OrTXX2D<$VEe@5&82BANQ1Hd5s2XO)zME)Qy0E6g%5eFlHLF^A=0x*dGK`fxb{DVLdWd0yf z1ld0b6hZC}0!5JjFX9A6Q22wG0Sroi5GaE3AH)h^Q2B#E^{M_rpy+CU5GcC(e-Rf5 z8T=P9fub82fd=7E#UNe-r$6SPWDWlyP|1c4e+EXDK+qdv@-Hiv|H}Vfg#Ri){6_yp zY#=ftTPx5I{71sd`deac{jZEb)4^c;2ZBm5wgp9VbTt2$4JeO)rTiP&JA;<$j{&H2 zCV${>^v9izVFBDm_Vw3wUr6fCC5Ldfl_w_TATmxe}u4sTpU49#2+V6R(~i#S1p5+nFH`&6*K=f zFt;-PBLdwj3{I}L|Kb33(fMBxbO0{@f}liP|HTLL{#SfvP(=5CK~R4^{3Y z4!1IcH8frLL$H3302ZH4Mc}~e#okNJ-x9JFyjzMa*WQ^ENg*Ho-gQ9St$wgqBUHS)86@d8<%e___*hmX)sbOi6I(aznF7jACn(Q>BWh@|3Z;JklE zu@re~Z8JwdEP8BIs4zSB;E>{IeIS6mL7SK*_Y^uxmcm~4EGgP@m`GW~>YUuMPGqt= zqV(98Q@VFJzSJcro93p(`M>~)AsG?5)g}>dT}&Jg&6;)oO=`{60=T&Iz-6~GpU})rk^c@06eFj94WM5-*osn3VZYOu+hfY z21a8G7m~gxL2IYqchk%|SO4P;72?rvZX=Ql7g8Q`p)SX})K(bh*G3t(L){0Hj>gtF zy5LDTCpIU?{he|QmC^;rbYw_L4wP`FVfNtx-ntt^cS@WXmKb^AZysWPgM z+6P_X?n4Jpb}`CS%iaX5D|0zBQ43)uU}B;lnju1VCY`awXLh(nHqk<>oCVb82yCf zt~IJ~!fFt~?6d^|4k05iWxpXt-91u7mE<=GF2LB`$X5K{eMOV~1m z_S6wK-DG${yF9KGOu3H!SGsZ{E(J}I*(jOx;sXuJHXUwSXTJ*Lu{`E8p6IibBNAk< ziKv3tc}ANff4RIU%$xa<@Gwb|$m{JpZWOi;jELQtI@k2?f1Y9)ZdT4?KYR80sLizXJ`I(Od6p#4f!~Q<69rUVk$XS1}nsX*1!T)%4;DFZkV;=00lZ1 z`_76a2Xwvxf9F1hNG8PWM9c++A7_og$!uXVG! zd(CC~&@ne$Sm|u^$L2{ifstKOP;S)-+`R<{-=@zry_F89O^5fne5z-TosO+kA2B_M z%XBD09QdF3sZEHs?!96cZ)YjQ0`|@AJ}d%?Gn#hlyX$>S}xJahZ#HCO3-5i zD3a;6GfL|?(UWGKB;N$xs3!_YcZk245-CA`knmFm!!Q4&)T;(|s=Dp>lb_h?Yn1G2 z#VoTaf4cn9Iz2{^$^b{ghsP$@=>%UY{#M8$;rCm)$!dle9J=2vGqOu>q&`&`A;QV^ zBvM}?u11OD_k1nfUiHd|U+5;Vo5wgB4!j z4Gi;yl`TiLOUm(#df5Huj_U*!uJ_O1sBg|+MlUG8a$Kvk~lKOfr z-dU4D@Tqi8Th{EnKXz~qs?ijXwFz%_o>JE*c+W;{d=nLQUn?9pr*=fmYa_#i{+&SJ;e5_~^gbpS<|u1RbVIom9MTsdgoud|(sE6M#Tp4rSiv}7Q${RF z#YCJdp3P6tDNin5Jg4k13*xJL0!~r(8o`l#JEJjnlGv4GHI#%J*Dgt82OQo^4P4+> z<$~4HYgK;WMC?VV?~{{t5_(Z+f6^bfYpvq0_1H15D3Wo0%&>gZx1?4&BUhW^&n z!b&UGfzZqeFJ_9Lg`2s^Y4u{&og7arjo6jv)}H7L>9nR@j9zvg$@4?$&Zl%iMw>^& z_$q#v0d!5dDH^Giq1|fqL3Z+7(w`Ymu{`kZXeT6g$am8yYVLpb*ray)7Wv&3yff4O=l7C!1?S3dYDp%kLKg?MQZ>kcA!xr!Pro7B$z8f`YW ze#?wvWyNDKtde{CNr9Vo3n{(c$FkpvdU1JN>t8N!HZ3JMoR(hS!KYh{#^sVTAL~wy z2SXug?bI?~#ceD{a+VTMkSH^ccVM98mfKGp^lVJrsRR$6nBg0mf8I!akqhnLy~lNs zi>+KWC}NCmxzdjtZ%A76sCF?NT&C-k%<65%28`R3kPCGfkf@X_qLpukVW-$G!r7Td zwaTw23eJH0@)j&7fAV3C#LWNyR`Sg$-Gml8?>i7e>SXKy1Cl%^r*le7H}p= z?SwPZhkg*C&`eOa$VS61cC0BpsYS%g+vSZ7I~fVWrDK{c+&x=PUHEv=bXP19(+#HVYt zsTRRLgvKbUe>LPpJMw~ojzd*pehUfo1;`WCSI+0K*`R*KGv^dyd!;@Y`jX2d7qbWNwQt#%HM0(ztiwGnb7~T)29sPim(Hb#iwrA?R}stGwx7j?6d$3PHXPZ>_*;Hab1A6_MWS6wOVf3gL0LU4lRRUbs|I1o97P{po6JYY&< zV>}(Ao#2YP_r>3a@{93mbc*eQEzw=EUeM1(TV|wPo{jc0ScuSC{9(jiWC+3#H`!Rp zZe6&}>q>1>V-b}TttFHPgt>l;f#&Ui1amKW`a@AJS3_lpHpf9B7?0SUrSy>o;>L7l zf75e_!lh>n_7ars^+`h*BZpL?*30!cbzCMSU%`)CHX8X87fg-d?W{pIasJW-z4F3z zSaO1;JG@-jrfj^Y>bh=|6O>SH{tW|fYuTc{gf+cuPMp{%-f}tDOOnwdV_y>EQ^UH; z(~F3@iTz_gj6!Te`F+&!25%C>=pO8ee_It*L1!MZRx;;-{o3ciVt~as{9}-q(Bymk z@DWsdxN;`BI;N)@-V#_9^t#>~Vj0r*Kyf2ON}9S6oIm0|Q^E>cj(Z$uJstx>+Y+=| z+irF7^=ffz|D}IG77Delm^UsF2|t1Y-a&MWA071bnNKpVb-$0rd17Y#dodS$f3+b1 zQJD1k3Ox$UX9~^y+o9-dt$^?x^eBR`&?T<}G%j+O%+5iiO%n$Wt*ydkbqTxZv<~mK@@5=QvyrfAL>_;6|Cl9;4_x4{#FKv614|8@(%eP*qKPmLL1% zfY8He}mfWG)x!e{BiAmvu9vZ80c4$DagVvdK*ozgpwnK1il5e@1Fu?G_C3- ze_2A)s!BlG;4sU(8WI*;g=Z7{(s0P8Kao^GyS>A(aIWj{iH#qZYi#8lnNKlOZdqK* z944@0>n=0SG$q)Mf7dg3UJrRBjd4L@l8B9P65FH;oof~KzAW-eOz6W^GE;zB{#OL^5dOXV04X7ppj@1+9|THY zAz;is_asOfSk2%mgTQm~Ob2~B;5fVJmZFzWf;uNL1nw!le}86tcn&+jQpto?ftO9m z{Gw1<8=!w?w-B1A?-A+wN|BKn>V^<@hDnni4>yj@^NYu6Ii5={eYJOD%Suv$Aa}zt ztDpDG5r|wf@qOYQ_N{LrlhjmMDRtCxO?Rn`c3Sg5lq0o~>5agOkF}+VONlV&#@I0W zmtaIhE)_d1e}NcX)WC@$$l@=#<{Wm-<;+b<0g5u^^&EADc0GvASjGZ}R7yI%Z)W^! z+SWmK{3Ji!3Q`zp-?<*}+j`VrW;B0$FZtbBPDlco;wO0hc{KK*ntB;#B(Vnj0x(^p z{ffcY+wtCgGAsR*a^0JYDeSb9v1iY5H8peq`py|Df9&8I`>@7wxIi4yJ@j)Sw(zAC zST2=6`Bsm$Y#15dyWQN0ZkY7X?*zMhXC^K=?1U?F3uKDXill^E8EJy>6JPL`C$na6v@NXvR_Sl|7@wJ>g3Aga?n#di;Ds_`{<)h$^v2^`*%8}6Jy~6c%x%S*}0gzl= zZa^bw9i@3s58+zKkT!mI`8MSxfBFNOZ50yzXZ?>W0Dssa%eYKSX2A@;eRBLj-MWn< z93_ugUK7-?<7BFPQwzb31PZqhLm>rYp6cBq-MMJmd1B=LJeS3N>lJt@;<#FBo~l{~ z<2Tsh*`-vN(kVf_+uX#4>BUC7m51UbJMIn5 zd!#}CagG?HT-@$8sD&27K)TO*Tm?ex7oNDbX45!RU7T6Rk36}u7#JzrC0cE-8v-u@ zy^#lA!@Vs>e@@*B1&4Iy*h*C-JPA}_JsD*;Gwd4T9r~HL;!~F_FPMUjdW|J9Em+<} z#V@5ZN?&z~Wpv(_gN!Ga=_D+U+lI^=2VY!|(e10*9O$ z`KMPKaHTJnF`U5YVs7{&Z!b;j)nV{C(qwWs_p4#vf5-YU0F$eab6Ov8R3VJ%#gfUz z@2!4;KMc}ti?21wwGp0?ye!RX=}Kb^%N>o*SIzhf+ie6GN7>+u6f%C8LK$YaUT*kW zE0aOB%s$YsP7EjTNs4LTct_lAax!OYgB;#UF-1j+LgR7Ta_E-A@O4HlNcjCpIQ-$@ z{R2BBe_8On6#w&x5zgD#t)X374+kY`-}u6UN^6Wi*>X zG|53}_4k)6o!cw{DwW8q4Q8zNcMOR1aL^ItN*=KFOPiKeq=XZQ-=XmGN3Od)aA&em zPbJuJ+C{<9KJrEUf@TJT`~c}hEDxW#u+}(lWTM;IaHkN31Pj5nka9$? zf8J}O08qQIzsl(1vx~Z$omBC=`?M9_y=X0k3{zg28>g+cFQeXy@MkF>KGIB!=><7w z5BCz+kz#)zTJ)4~oOM{`3n@>y%`54eEucRwVOC#sZsIttdh${8y(bs;tsw*--b_hm zpF6)a@Kn%WJ6F=DWQCdBZ0a)Doo;qFf0iqwa!)&8hY>hEZ^Sk+_-CWl2a)x$W2}jufK?=jrdh-JxWPr!y;Q>oW8Z<@ zTgv5&UmN0N)I{%efTqZT7T~V7f6rreSZeNLf%|JWTy1Qu&4UpIkt-?a`cvLt$u4*^ z720S<^n;c&8}li0!!g?Re%X4^DtK4Y`~U|xcL-OcwiGo1>y>_HaEIi_*BXo%>rX)u z;g1f1_3YQ;EcN<%iNrIyzUOTYAOVbtTrFx?x47{`Lslg8pRx^k1eqbQe;I&#vh<`B z3UcHxE;AuyO7csjHBT_HNK#XEy|HXN{6aH(RFb&sW!7ho5W<9!LghPACMOA^sCs*M zo#!h~2mZ^FW$O=t#r}sD> zhw1R%%=p17)F`bdcw!;5f2P;XD11*IB?K;}7WJOqguKnJcF7lrvPgO7Z`bfew!s~F z_LvO=UA@wKklSZ{Yhei9Ga-;pO3v|Ys>hId?{d}KHZ)K45FWWp+m4I4$<@Aj@M&UP z#9n}3q~5<|bP3@%`g%gDi`irhO^6h@q(+A{wa4^J5ObVsPua%-e}fkR4VmF(D)h#f z&Nr|%9~NH=9!KYfq?O`58p(U%0Ur>}EE#4gprreZ_(&ThN^q`J#@{mr9UI4fZ5v-h z0j%x&)?))>j{QgkHans4=?1`4{Vv{jiGw%0u z`3~CgmChhE+#*X|^}20CJm9Uib1_y&<+{GKO^!H(Y}>rilFFU))Qlkn*e>@iT31%D z?Km8p=CCZ3w292MS7w}6LZh@h1(%GmsEZ^9uA)+8L{mB27k}hhsf>{YR#vfhv;96K z0BCc%D(}dfs?~3nT^4QGyRw*%#r4ZQIOA~N@by$mOCfmVG2KGjm%ccv!Ku947{r8M z4$)0)E23awfaT$G$u3^Tfe^PAGuCiVu3ABRgROxy*a8Bh_ERhktS|z%6+&N2&`RT$ zlW*cpBO2vvD1VbLPW{eired$!#3oW+x+8g9KfvjFAR>zS4@P}p)jha`-r}At9f25< zfK*MF>*ge;6U;4UN>$ND9ktiHIf|2MU%hUx7dS}-#2j1N$3Z0!VQsPXJXey!nPBH%kq~ymx!rbBne}9g=C@$ z@)omy`hP3Ig*Vc&L`$i*zkW$`k&xR;&@F-H&%3NrH|hGt27BAZO>`si%2lH|RTxUm zm)RALFzSmd;Va|$L$nMR!}i8FH6uH%mEWKRo7rQW&Z}Pg&P7-9qAVK^8Wt?{yR;O0 zCR7EPV5AL0=6DPQa;jN_?7059!X1T8f(P?Cr$z|DJ zw|~;?JRN3n3k^R$$g^NrSDS4Kqm&vakEZ$JF7Z>|9F9>#3GHn4X*>|%%uYetR*x$+ zwWht|eQhT_a&~vBH2{~xD|-V( zmuwj?JABvr<&?zd)*!s>miWu6(yZsvOMk4iJ#q7kypYd6cH+NwZy9$W3Uw_0bgWu*h ze$Z@k5MiwX&l#VMZ!X~0nws6LlRi3`3Ko6~4p)C?9@i7boKl4`+|IvmxGUWDGBSKz z_oW%%KbJa!W|`d_#!%6SI?8GOO=ZLCz!aJPQ?JNj;aYO>+jO-~!Hj;|$-MJQF{R2b zuNsr(pyhi+9FL?=zvf{oB2$fWb${In{RLB$QdmrlUj+B94_6vE0%{|j(GFs2PSUX6 z$S|?M{K~c+_*0sh>pujzl;F-P+(EOx=q%~>Eky?>l`*$jK2<4qiQmAI%jj!qOgYro zaB;-moDaYHBipq$Na@0z`S{0*GqPnlpfPNy8itjdm!n_c$PqQ}3hL0Ck$;-e742H7 zt99}?vZ!23*5{+=(P41sBCv&=#GEHGCy{!A4av7{uBw03?@$6qOtot9pM4+66UDf+ z(5I=tfdARJNSpRkr2V3Z{Wn+ky#!WzF;7V&_FHYdY8<ezEUNOv?Zi2 z=-0uSI={O+Huy#o2NCx`f#F(Qi2a5BlfYOcap1U+17A(MhJdPB$rO8V1|H(*5yf*g z!XR0L6{T{eEjEh+)`TBr+IGqCtkyx=OSdiC&lc~UjyVs-gu1z@MSo*DM3{SV(d9;z z-S#gMll7vw0H5VES@%NyA@d)DFO2Q+pW?-DC&ae*XOU+rUT@F1bE{*{FnTIEkPkF4 zeoTeD|6FjBp2-qv4B>l2PUxrBhS@st3cHvsUD$SGFiyTg2SWfl7G00!P%$)*Owmm5f>KqJk;c4ld|)(?xVe${nbc~x`{&@ug@iipFwyr;JMg5x@&fxS2J`eiL_HwL z)VYy=O77UTzLCop-)|EOPDTtO*5yze_qz#{fa_@8%!dVMJAb(>*AQW*-SN!SU8F&@ zSv5MW4$S}hlpldL6>C2fKY%r!zYbQQRK>f$Y(F$z^XZ~uHE6#73(?(qN==V_rhk4flC$8xy4yec`SJSIZcD9< zEtvd+eS4dgpFPC@4-axRC3K1w{RM?+D1T@}=H#7_#MxuwW`2GZ>Qwau2ff^RwT@qo z$NsKC6b`+Za_XCH~D|o!__E zdVfa^qY{w&Kp8wK2CyVoyD6;oM`e(;&84=D`bD`;dzhiBLkb;2S&uLV!8y6;BUC<4 z1ckBrvyUu>yNwd56_Qg;k%7yE`LPQ{dy%A&Y~$+Qklwpl2M>DNPJA6-LS zZG9d>GlmA#-XNvx-IE;{bcggR(I_wYVSo7U_HQEHYdzODfaghO<(}pb+U^z*6r7Ff zvh>BGJ^0IYYBGphX|T}!G3as>t;MVO2N- z$h*<)0p|Nz&gq%38wfyV3N&u+bvi=@4i#v;9>I3zVkwN~q`o2m>2?lkk`Qeygw($q zMiS_r?=~-0Vm%$$YZ!~@x|}@opgl!wl0Aj%K5;f5LpNU$UK(W^Tk}ixfumQ9SUhpE z;N8cJS z*i}))S^Xw@P8+Am70e9LWgsnmtrXSZ;po@ed$OfZI$y@Sl#^9wj52M1bXBXr-Xm0t z>n!i7CRqj89UvsS*w2m>F@Jr4&WLB!TK9_5LndEAgtcTt@b%+4yT=IYW$uE9zC6iK zU<n>T1S)m)-=$A2X#}tjoeMcG@LJ%`FpmYDUa;`te zF6gs7+{K`=T4cl9mssWZ4J`)@@&nzTq{G^;tk7oNJ&QZUy8t!Agnul}^g>VXHc~HG z49Xqz63JCFSzqAdB0G&2vd&rG`*$#IO-8ced)Vbe$n+SudsiYpcC-Q;dgn;D1kMCh z@W**Jl^UN7^fHVU1-ZVahMiJ!W99AG5nN}cilQi)31Rpv+TEmik2)=;F!Q#e<`^)* zrTbn#V6lxBkOyvFhkwcKymp5gqyjo{$hE-7SAeUYrSb(n$CEMn5b`VhQA$$Nm}n3Or9Io+nq@d~6n(EGIpz(w z@vrYAQFj;+e#66hYVxY8#{3Ci-Y3wj zF8Ypqo*P6_Kz}ZERqx|>-ztmX*dML*pYCDjmu=G$8I{sV*btsYt~= zdBN^FqSymPQ-$7tt|AT_i1pJXBdWFsCgz9=`v_C}Dt}r7Y)PDllQq=|?ON*_dh)x>@xyuA$sc(XRL_u0y(V$*+T7m>RPa12rwmtQ90a6^Q0jT<2Me5m&3_1i1XeU2^Y)5^veGQd) zl!#^fZbJZrgD)~`N7`cY3HB2ei)o^SeeMV|dA?2aE`!1q#8}`c?|$gcsr5XuB$pgO zS$`)#1wL?0-Slz!hx}6BdhSO;F^-&~d^A_tCKawn+mu+3VmpL&*T7Qml^yI`k7BnR zdhi;y7o#6W(Kak4H)Yk6BwWV*4H?xP-jvdxH{a)=M4XQ0Bf~|xoC4T)s2{&iLRA@M z-s)~5XI+h2IbA>)e|?*)z@aLL4kO$olz-H-kRme$Y>|jR+(V(dG1KB2m+6R=g&Nb?rJp-es(x_1#DQ}Cf%_Urj3Zqv*^Wrcn8!XK>)XWOeAyHdNL z&+SZ)Be^1AgZR-^%W9Pf=9Z*bp?E96nCC?z(s6kmCe=mz-bK90oeCvW-1 zFIfl=5_5W5(XH}07%$m6B!+4;iho5v;o4M@byw46hmN;W8)LRNIDVUt$2E8ZCpIFg zi(13dWmtI)ld(|E{XY3w7#-`ACAG|{>=OnFVIfR8P5s=`>|Cl*d<~8rTOUO=@(c{RL(8rhZBM=twF zIm;^GGoC-jYJdNg)xMwa!&L8lFhAZ!$6cUGe`Kn>tH-E)@e?>YG9%VRqUtcc2EWprUJ{o#$t~J2E^89{ipymk@MKrLfph~h`r8Tw&N#G>gsB3mUTO5NDIOicK1_UJdb4p>-4M0fmj zEe9%;ibYDQL#|+!_!ud0s)diC-NUtF4ze~M@wKFLHY6w_1w=uD<#PALN7Mw(~{JbaH44CX02Rp2!A1+L|cwh^dc3dHcRu3F@5;h z*FQKj0p&1+f?|o=*Hm-H?fX~0D-?7}FvHpTBB26?V%y~ALAqr@YSny{=Vp04?{ksw zXycObT&rlfbONLcgXx!W&_hm)2&cfid~&TCF03hv5jPT)aE%k0VGha-m_v;si6qR_ z_xv-Vuz&fz@O5L!#qHqHlUEXPR_gm92H?e=mx}}M69ine#ls^oP~Qh0l_Ks#)S5sY zhNi(297OxPy?;_6`;pt>-E5rA8Fr+vhq>RuNFW|#vnLDwGE?m?9!JP!YVYS8WcjnT z^22vt$^9%(2F%6DUj%ZE8qywnMPz^&-;9OFb$=pCO>z#H+6%8KaYo(busMl><(jbt zdF$E`z-PRQSBGmTM13~+g)a6S>aPM0ctz<*q_uH+w?@gul`7&IIPTp3yOdCjENuFM z%8pf0yE|so?+VrOOV?#beW-K!_Kq<06xdtGZD<rg`19sSFzXT^s}ho9eT0b*o3!tq-&aJ6{=zw=wc9(27`NiVwBFM5=+)qkqbRVZ z(PWJWYnaquHb(iR6n#8+c4VK~&H=crmVdjrfUT+(Y}sLTe;_W8?ZQFaFQr2y^TB~L zB@T)a?{fxUu$=qVLfE*S6|Wnz+`M(iFPnfR`XLGu{fC-()~e@gdQH$YYtb)W0sHdY zV`}}8jjCIs;yvryj`-+mpvN65KWbLFy&$+o!U4l$A8g3SH=b|OGuW8nAuv zBs^7F4VJ*Hobp#q_vKz<{2BVRfR)q}hy+iStFJPdYp?Us3~;LcME1Xk<`R83YptS` z80Z{lh>Bb+rSV#9Gc>!tWXcvo5I%s{ z`%c>wYh_qGuI%lFkvbi-hAm_(UVkl>L2w!lEFUk)t)>Y$T~D>*HwJt^G5k(bh?akf zswo!H)?--_BZPL6iSGA}+#uD(Nl5Aoy(LXTxv5;^4>4P98#s&N(C4{;yc^1PMY{G8 ztB3NbZZCq<&jEI%-N>AV*mO^vmpHvH_BNNdj4}%Cc+>n!-#za1d&$Y9-+w>zki$nt zLcLCZ0C$wr_%^7jBQf(tw8$(}-R}>#OW?esw`wtwfnM*E%6z$$!i2l#0q^!0R22 zlOf1HGPxic+_(S5d_KHnZ-R-n->M3&ENd;-R$w7r3>$yWJPT=WBsfii_?fEU@|=dJ z^-U65v9$0qFa4LvT1v_R0m_7A>(gZj_GABW+Kb3ZfeRXMmYXq{+=03 zM>^mlb-NZ)3j>LPV^Tr8)OT-Ha**cP@p2J`RH>X+4Qmg)r!?J3DlOU;b>lc%)h;~= zW!IS9Z1n~x!D`mi@WQz@4~s7xl<9^La6wv;F#c;K0ht!cKYwou;n?Hh1t}zUP+DnS zp5opVou+hnoOYFAxQ;1bB1Ki13~x+W_G~scBF%FNvEe?7Po!8NVh#AFITI4Y>@P$= zK>`4uNHpuG;4JR;rBLpg<8xk@+p3Zl;#YeCn`ED@&xKS`#e&fI)e|73{FaZm)w`B*rwYo z>UX!@G-qF#rqmZ9ms3UG!y5)IQAFkiXp|dc#A;t3s}{c_k)W3!2W(>GsjU|B&d{0{ z73NEJpZZ=AzpgLoVLN2mWG?`2ihY=BPo6&iqTOQ`JAgpgHEDI+Nk$j#&eylRm^6C2Ay#J{M+F zcN(+VRev~cD^3RHlSNfe7mSp4p^^#AAsjk|=&(sQe^WD_xIcmoBNFj*{gTB1SX2Zw zL^s~I{>tdGa3@yQCJERHIK${zT#eJy?+jXv5QxiX8m$IT%fwps9Smd^mMR3RPO+xZ z5oxug9;SY1mhvaSBXzNh#Kcy0bX%noKKMp1RDa{Ovk$^F;p1~qgJ#Gyq}Np=4h8*a>I#ECOV=%AKzNd=!$T=p6&ibl6XyAB zhgmXD7|eJ20vH2atVDBp-x|;sOVbt3uvY?JY=#h2&qB-uBBf0~)vu_0a?Eo|9Oz`Y zf^UxfIB_A0si$cUA-TI`5->rSoyli_;2pcA0&PK_4BvMw4Eu7v-T6%%NGODG!GF7b zZ3%2MsPka1A^D-}1xMP}02?o7NOAM})Iq$o^+P&GyKY@^wC(ey$iw01k>uOTxO}ZX z!;Pf4Aw7+x*p#d6Lhk;un?~?Ss$#>NnBpsg<*YKLRYpujh7E$bz1a?q>%On`am!gr zS&n(V)kKiEdOnAk!6AIEG%F^(Nq=%uhz|QsDC(Dv-h(OW{ZROlLRzZ|Di!;DOCqDn z=L1?Ca&YwT0hNqiFhvGu$|I%ZPgOQuVDm)dsj6$p6h4A>+zw)zAx{upz?o9=W;!|3suXL4$RmY6H4b(Bb{&yAWQ-GzIkO2 zE>V20qR5SwjFq|uN$mz=FMovhw6;POh{Si6KD#u1vBG}nNlSO}TWE+dDv<<#ayvyg zCn>W)5e@EGg!OW5@4xtlavRiT*gMF7Hns#i9pGkBA{Yud4&rk zyBvaH^O{m19JAGo>tbX1A*Z7ZlB)z+LN!4*N^XCMIVbi&)=M8Ce1Gt64TxSA!3dm? zp3&d>`c7TI882eT$;8$BSK&$|8a3-pH$&+@yg4Au;XAVde=5Kf(7v;$@gg600G}_b z-WLcw;PPPm<$r)EJ}o(DoW*nA1QOI_`nSf28Of5~WwMB@TqxX)+$oc~q%Q%I`p=vd z5m+Hn%lINgrC~jFD1X8Z+nw7X6$Ul`c;yX(qPnKei9yk@i{uckCh#fWJBk^g%u^Z; zCs)xZK3E-Ib7h0Er0Bg*e-pO6$|AY%57J8DyYrT%-Sv?eEoo1Ab69?+N@WS8Mg+4= zQy=kro%8h;H3QLwWEo0(6Ov#h3ODqJAF|f;La_Yo0}v+pCVwGv`KPaC5Tc@jFdh^$ znOT(%G!*d5M4iecEbJ6NtteK)PoP{U`JCMBb;NAY!hv(PVQRXOEx3H_~aF-w0<~&B$_$~ zr&9QBT8l4IJT}R>1Pcup%2g1&9uqJ56#LB{McA-`SbrCMchWA}y9T!y6y-j&2_CrD zy<`69DEpl;HlYPC*&6ju`5?CKb{v84Lu2=S=Y|*H*pnkW=ns`yuOOod(U8N~?>ogZ zYw9d&NbS&koVKsFSU9j^s-xmFb?42gPW%ehvFEq4f|i=pG&0!F5Hk2H!(Ck~V{9|=DF^;TwwMw(q}etn5rd4{_s?v3J}U3w_o+iICt zDwikHA%^dJ9SIJ%4C9d)M0rW_OA4z5rTPMXu7TDQ-_O zv8a?4Mf9pW+ii_yk+H5RWuxsmcwRU2NulCssE+B{bM_=s{M~|4xVcNw0TgVI4gXVS zfHqDIp$nbTHhx8_hqLEL^V4vzHo>gU{-PvpVYya98NON(TAudq(V6XUuR~E%rSvC?zFe+2ePh}wjMPk{kk7H8 zg^XQ!8}Fy&syb6Pt#dQLL5aQ0XzvJ>L>rvH%xdS6i$LjGwLICc$HtH1<}}HyDy(3A z%IZI$V5IoLM(VE3Lsm$f(Z-4-k{n(frGGt)xSLwYWSsYq9RRvlZ6WZczKdje1B&tD zpvFqkOGN*`?wneuJl+-(pya>1P|xTshM=tBd$9)3w_+Z$Wtg&l_LfILlLMx?(dc(d z%R*a{sXte}Sab#&JnA$V+b#zWVZ&Qlo)QJ(Ei`V{**1^=OhuC~#!n>mF%OMX-+$*| zCcTo)jpUEsHk12qg@t#5 zuEcFXd~4A(US2~lPq^#4Pu8)JT&(UHkKH@`Mr!pq*vWAogEpJvw0m|bOb5Z4$Yv2q zb4;TbV<9@dk3+Km;#!l9T9vrLwu`!|%*J$R_i z%j`n+EtyA{cesfCJwt8K_17#1lg@H_!uCnAjCcuT53;J~#KF>V7p^qs+!SJ^}+|B?8|3(?-1ezrNC9&>|?!Au5t@0i6&- zHW$$PNCW^<1yxKf{+@k7E_c2FSl0T5EH<&88gyP&MXMl{a|RK(Jz$HY>qR3E)deXc zLDmzCCnQ3LadR)dYYT40J%6dteIzM7l-4onqj=SpXHF6>nIB#2U|=-vWn2w;9!R-|B^lVB%XV)ye%RFla_$qP;}dCR<4Ij$fH)A^==AU@ z9Ytac@yi>^Cf%)T&M%tFvb;bY_@HqIukp5djB?)_q~vH-l``Gyb${;Uwwt%w!Np}6 zkvY4*ev@s!Q&UFdf}9{I4m)T_W9C*!QYSoT(cDLp4Dp!w59sB+C;AU$UzVdmJC`h3 zW*4+h7F3c4@%pT%2PMuXH#mHC;DqNW{Xt)T0IY`fTFtHDpZYQi{t*qQGD$U67=P7% z%qS#49){#~HoFD|g?}?!rDGI(#M|k({Y#S(OHKh<{tx|lU~ZUl_oeS?4^o^RuU<=B zo8}s>;zMFuhahW@Lvk-n7Xe3gau+Yt8hKebe!p?MN~d6qYh#32ln0^gIBBGCqn{ew z&JQ9$MB$dSAX!@p!(`JN+mfQVy{0$;ey^zR=526;lZJG??0*_leebU*RjH4}bQSA3 zbS$t|uD#|_j%rOE&c88R%fYn3bLh;^E1Ae(z$0mR(&5Y|Uq~^&3W=TTVzr3B6;j$c zo)kuLl`mZpo?C?-w$^K`Wx$=E$X_y=1dv&v-O62&+87%tK?S}!0}r!+p`GNElX`0Ddqyte9o^0Zb68?HO-!P;c%O*V$~oy zd)vtqEXD^o;kBwhDpyhPb6cAuc4Vxc*5WhrXTDtq9_#sTlVcex>6M zoHvHx)^E!>Mgo&X@{jt@A6qoQ9UAx9mkUM#D6=T%Tqu`{asd^$nGXR?8v->mld&rk zxBDsqA{&=Hr2!3-yekM3F*z|Y3NK7$ZfA68G9WQBF*P}tv2pfAZF8gq4Rs`o1DOrqvsQwu3D$c2fGnUxHS^US2 zNcGXe$r%U+@&7AA+{wbk<;^Bxf8z2Ms0aoDy6$ zESxQz+$_uie^3S}nb=$WO^q3m3ZP*PbpFes4z_f0H*vB6ycz6(W)>jlw-i^9xrGzp zZFPXUtO7vU!2LVG#LNtA?_dJ*1cIypmOwiT zfU=YVvx|odBftb?{zssRf1NYm~pxQB{D+8^gc(Ih#2F9bBB5 zoq=|LaAf(T%-c3gg3QIi_VyMa7iYvj`jY@US(v@;yC=)vhieN0yMw&{gDim{bIU(y zn7cZ#Xo7%_t`@Qqf5*I;5dX1RS-1eWSXo(l+4%q#jsOb}Gi#PVe-_a2bg=l-$@Yi& zjf1bZ1K0sz`9{OS7iekm_Jio{Y~p4CaB*_A@b&(;<9`t%8ymnJXyyViwXgz$5dW$E zX11{W3%{Me6VL;o$NDBeHUR4%pZ`7?yeZ5a46^h5C;ZPNW>Hs_64TLT_?z;7onm5O z4}dol2RDF;or?{?f5yhj0pQ_c1^E7N9TgMc-+i$DlPe3d1Oxc~YWHoQ{?oGC-x{F( zdqC&_|65B5{H9zB0PR0Q*JtHoHGBJF`~NKWKU4nysr-*B|F1&-za2@r+S&c-r~ND7 z|Hp4)547|AJK{~bt}bs=pa_1O1WM;N+w}|tb zH2-v2yv@-6t}6*L1DpRbZ0uaz023!C6Hi3eH$|~?aRI#9-lo#r!sAad16Y_rV3)TP zz#B(jfF;-ofANol<>msgi2h;v3-JJ0#Q#CO02Yb=A|7r4i^4yM55S`QU&PDtrow*^ zCxAuczliUxrpbR1C;J<6e%oZAv+X}2Zws0JgWgJ;{TKbQDJH}I)4}@f^7<#@%?A7ze4}CWFZkA-?Z4n#CwBjWe{ZeW{{z|HTKQMyw|Qm({|mlR zbNHu~w^)a_OBQ5jVd?UZmF;iqU(@kl^IKC6Z+im%hbZS8F$X(W=YQ3I+g7K4!8cz2 zcsbvAINO;xTmLKIt*Fbt;9G?2zu+5Fw|^k}TVtO8f^S^B{)GRdHZxbJx87a;ycXW1 z_#gb|e?4zu;bCEhxHtzk69}=X4{5)v6(w?K`aRChi862zd4-_0ElJ?Es~RLOcz?-J z7_}hUJ+l*azm9pxUiR8-tBuQQYxv72BZ?n)v9TT2(sYZ_XA)EB;m}#Zm3>FPt4r6I z17vQ6d)lJ*!~N>RPdYqC$MfH_+56Ih)GgJwe^u6}@H9<4h~QpZ`km2BEh~7;*PrTC$ ze_l2b-yF~Hq^sd_xDsTWzQ?5TOsbzQ&{ceYaG7Ow22mkDS8ENIk==Z_>AcSv$XHA- zv(yrz#9f}%5pv6-^leRKe$DR3OdNmDx#+9w>S?q6KJB}-t%w8OuCLf;1-Lg7$Lid4 z5T9zKpw4-_^m0NhxC^XMx~5C}-WNz@e+KMEW$N*#!p?TaEW>KpG3Nh96N_;yl3L%6 z#IQ{lhcA?^QlA#FPIrdMs7Ot@58SgJ-(M1VSJ0>-({ZE>|B*9t#rvoIhxa85g>s>k z2ciHtay4Nn34xt0$elfCO@xxEB!A4W2I$vQUyXz2JgHQh4_QXOWa_#|@*ec7*DYNgi2UW5%ex9}BAr-;o4*?nDi>EH~ zVr8+ZZQXpkWqL44qePRz&1(n_e~2MGM){SH7p$=wVpB+dYXq}E*ofp>%Ymz2rdO8x zyN09MP&(SXBc}sFD+<3orX>8{*_vD_>j)-zXd8!2>!j}9wvmiNR`oiJFL%+L=*vlN zgU7l<8NrYavRqqIid-umq%!7XQ8jGS$PMl8A%dnNPJoHL#JodODOQXMf4qz0OsPA$!(D>3MX`+ zr#9hF-0zucSiGy(^sNqsXl&L+CRb$Bj_STjz?n=YvQg!6CQ_4* zP`00d)L61-$uRrz7Da3Pe+YozshPf1TCI?t4W6OF1{jsRCFTb2Xxpu zU3tzANg6;Bvk9;nBod@yO@%cpT2H_k<_{Nj6Xv0=WGt)4weCJbHByKWk{~efK5^ z2Gr#7c+igskSP*>>eg9>#Ni!pb%7$1q{MGdNJG{qE>8G@U?R?D$KtZFts+^{!4QM0 zm_~s-UA?HD^roWK9a($idT)%y89k!$4*y|0$1_2CnSO}-IdaPy962-BS7Vf{N?r`a z-KoIr*Pr-7Lxy$^e*;B0Ymr-Rcw!{K#|)qdJ|Vs{B|!%XHKpMu6vn=u`A2g321m^> z)F6Kd=L%x{t@mt-1L<$_xe?W);|^I^&UUxGs84A@FXV|aCbwb1|iD*@u zQk~_WY`sE7)tLwK;labDGP=ca{cxjM#O}&Jf(s>JGPV{&f4DI)GQ^YK^F|pQG+8m4 z;fpSQC(Z`1i^QEw=eBj)^xTUG1UAZ6;^m7*aLZ^m*NLCqE^kJnLluI&fN|6^pzV4 zN-!`22Xw!M?I-f_=OjbG!BBW~TICXN!d0yr(v}lcO`yHA6EHQ7a}tFu3UPQLql|e!%R@XmTUu{fB!_DHE`DIkAqlG&KH(H3)2Rp zCB{?kt)uH2BK*~0Kq$p}xhd#t4nYk?*UJ3Y#F0~_va3O%ab5x|+iw@@hI_i>L1X3^ z`Sl*{FuMT=vAUO}XXppWNIjp05yXD7fUGhbWxi0d(MZ8iy%%)r2(TZ40@qKtC>oxO z=W&FRfAGsL<{1^+87!La<23rct1iXg4)|WHPSy%0j58;_bF)ecD17qmL2RE}=~^v; z^W!rf9X`mPw;c~Tde?}$^KuyR;d@(NvH)h9W>@VClnonI+(eV0lHW!UR7e460@9Yy z@*^-TZRiDAyDHvqTsNdi51r7C^y{&p+n0iQf0l=2O<6_`9OSHIVn9&u$%L*D9%`@o zV8+b&Tr=x;X2q+RYI6?I^E*z%1Gxol$7S#9{wmf1%XRY7LHGVUV%tIZ?<%n=7NM81 zm-mu*0A7E)4($dD7dz^gy*55NUuO_mAu;NVUysW_<7#g} z5Kdmq8(4wW&fNVHAZ3Su4rT4yoJNQ@qKDjceE~*w37EejSH-C9>pyB<*Dnjnm1bf` z@_qBNbwTEdhMB*D0HH>(C^5L=&}^6ne>+iX%yPo<)G#m4VClzH%d*N@3$M{-ss_*0 z>LnPE*FpbyL|%wTMOlJVEENwXCY#vmPuX1_3roIkI3?9QdUPOr8ov%4M|B+-L29+_ zp7kz=0ga)B?ihC6zh8boL%wevMsLNnqJL&xC|xx;!yeOk018DnyW&EEFwNRdV`Zr{Elzc zzen`rm4jE_<;IXSX0L1jm9Dl~wH)GMl@p1_0M^N)m5$QqCnw8BGk3ymzqG23V6k!$ z1hLO$aMaW;Q^gA)!J*PF1K*++0q+_W37}bm3b%tyV zg6b?1-U6wmN*cx3aYK=yOC8n^W%Pu?%nY0 zvB3&ClPNmf>8@Yzgtql)LM>6gsQKpX7~F*kLMd%_L|GE~Io>3h#y+RCgZb2VD3p)% zVN0j3Xn#3%e*(%coe3!R^bnbRP0w&>-nkJFsEwxG2%X>4NuT+l|L@?Jh@6y#eib_*W7RBAyTgkePSG&H_gpy$|9Om4FPmSn*8dgK>ciG@r!V2C5f zf3QbE!oKU6T@DfuNZf{U-Tz(1%7ooXK-{kC$k8S)LOwWBD~r*PuF`Ikc~Xg_8F^Ip zzW0~b4JcO*2szN{)M-H~#1&UG{X^w^Mu(eqV}MLmSHlKjL$)DMWtO~cpE6GsU<%#Rb;QRS~*8;x`qf3sfI zVKP&Ad1ePa;4078u%DXHYj*1PW z4;wvk0F9BF(M!53J|B#`K0C=wKhM=l)08wPovUV3Q#@65Nc6dOISWqJV?U}jYHitF zA`msDnU%vmd5FPY>WU};pY|ebe>?7#wULg)fVyZpGTR9I(hp2IN5r36Um7reeevI6 zr|T$sWHa`v?z^NL9KaX8Pqq|6Ekxe5_=GNmr*qD7a2w)&vQR-W*nIkP3c>y8Hb5Y@ zIQ9a4kQgT?5Dd?)YA5N;#U7C1u%*}a8QJWV^2ijnJVs@#p+BmKqtp4GfA46GZRXgQ z^1_jPLuEQ*d=EX#G>sI@FdIMiA{8Cy?8fwS>%)OQ=kjZnlD!HYg7$9AO)cTC)q*bn zHhg8OyxhG{D@<_S`AS=7e;2r^)dDW&C=K)`IX#Nm3>?VphFUp&BbZ}w{6rIQ| z$lh?vHewpFBpmg8nz7l3RW7a8UpbPC08>D$zx|}uOj}5Kjd_?;MFC(t4R~^dW&#NY zMtR=B$kM(G{HYi9!G>Y2IKlX5yIBO>h-C%=W-u`20u%;E1>3W>+38n9xZFzE*bCl#JE#ddLKoEzJ5< z_9Dmv5;T~0L(%a=cc-zjLVu;tXPGnCM3T`%YjK`4cMJ39J|vqv%NJITDMj{Lnj^*E zoYUx$ExDN$FkmDSQh(N@P;F0LUQ|&p z-s21rs~(Ekq0zPvb0+;3UgHn84qSDsa(w8ym0cSk>Xx8?;?XKw-sTGQDwQr=x^Vuo zaPIi}8$n;2$IZUb9y*my$uF8U zD{!#qQ+0+$VI0v5$)K0Jp` zOw{iC@#O~|vAfb7Yf{fBFoamYspY`tH~pQ1cwW3TX?3(*j>Mkqs*$+pfQTEVwXf#d zjE&wzoF9UzHGjV_e;H)Mv7^pa>5xZSo~u;#wx6eY`eb$o6I4U6LFMX9=!A#GJ<&>0 zd-)zGuOMhv(+!b%pXozXn^q{v`B=TAxnrvVy;S ZpRH{yn*52*v~bsy3*!vCPV3oJtr}OOYb3#CQ(NBsYlOh)4!pe z>_w6V*Uj2(Qy04B*;6^oqg}pd-S^fohuYe5ab!)`@WXx5>~s}~i1*M2E6s)C~{HC{*Q@IrWYt&GF&|6yX^nW_j5R=|~v3{ zZ$#G1%Rq3P_LbU4(^&Iu|iP;hB6>$l2I0mx%Kbv``SmPQ?Or+*|+MeSgY(5iLCMI=I+j)AW z2acLzQoHX;6V4ihS8sMY{Bq_5xqT}$qGUJBEKVNSdH1`nBc}8$?%77Qy@rmOVvjWE z7lPw!$W1t1SJrpax-F8|klQ9Qzmq-45P!aB!u_MB%$?e5#b9eylUY4Mj_M!7ciQH@5L15$K1=>8WpSe>C3}<;&Aa=RjSlbA=;)iEgWwVfct0A)Ba` zJN~ZXmc_sR8QC_XvRz3lH>c_CJ%5-(V5A%7s{wCk^)4qWTIb|j&Nr<@s%Q!(qqJLM~E9SG9 z+@mCmpE_sAXg<%YrN`FZcVp7P=PtwyE5Cn>8LK^+jD! zx(T6jhlQ%F`M##{f(I!W2IIa|;*5|0gKQiA)KlU)sKLuJi=T2R>Zk}zG}P8=e* zQ!N@7D^qcuESR4+OHQZvyMJtDwKnRes@D&q5@|5Poo*XdR;+}k$?<%>?s+tP>b?aN zVY0G?P=&e_?8j9_K>vD>3xX*K@EP{)_AC63=pum?dsyZw%k3Yr5q(9!i1XQ^M|^}u zR$&&OR1U+~lqN^DHfO zdd@dJ<@vlz{-P)}2-!IJHgAa9!!brY?7cQYP^x13xntLO>HJRAOftexY%N`QQb3x= z-59dufG=_kp}+s9ac}LZIwDtyWF;UzITZzW7u>yu%J-kM)uC*kU&STFzDCk2bP;$F z5vk~cd7hXwn6pi@qkpnwQl>nuVMD|fi9CW?=MTRsBbgVCXZP;&r{icomvlz1E|b@# z9IghVe7+{qFvB|3qq&-N!QJ4?+h2+jCZRUlE?Was7Y5>U=cCW#B$0^A#H<(+u5Xgm zrpNxsZ|9;`*MWsvPvyCF8lJ=#CV5uJ;=DPVY<9R^!Ll?T zghJRu3@s1O1UZ?|!NCee>iyJ~8dK$D@A2nttxrGNmOznw$Mo8RgshG{NW9+2R`P&S zZJ-pnpeuTBP0%}KltN?sc{}dAA?v}@U>!|!uO3hM6MyM_ser0+&Ay}>abA3ck%+(v zs*q)^Pb>BQ1d0R_5X7S|$vrj#q%a+bLlPk>Aw}El@pE=oe_unY;PwR}J}Vp}(44XE zhPEW0w?NXlC*}*dRPrc=%%FPx|Z8Vasc&tk*R5>98^2 z8j5K%ntvZ%p+dqp=6G>?8a5;_X)w$cM`aYNp-C>T+8UA9W{vYI&%##GRrv#JcRK!Q zt;s9@#~pZBzwH@kEKrJmdmlbDk(+%o*velO+t#)|n=5vL)@wY>^s_O1J~{9*7Q<;pi6+1RdB`X088kXT@EcTb~Or@6t) z%SOErJiFmKNSIN|QVHGXBl_a|g0&EnnhxXVR4J1Q^nu!BPQcjh2keR#=*P}23oHjqd^-rT1DdEAH@ljD{+-1RGxR`x>2os zl~ZUQ#*Pt+4vt2B8c}8O9yAO1&S-hk#e~9)(*xUTMZpb}UE5t$1Wlt7*MBS{un9fC zhkuh&d~)=a<@juqF{q^%3Ze?MnB!TA-A17lbzCH?kh zULl;A5&b0qJTtGVWI9S#C=wu>5>-x>}gi;3n=tTP``WH!bMTz{oVxe}=nuH+dOLjEk|nGXq>l4Q{mMa9r5rL0h_fzx;L z!1!LRt6qZ*lm5)~ z+*bBjOr1MlnaxdW-8hdzRENcA%LMK^1!F^iLAf&-qHMz?Xzo}Y{D0~t8j^#2V}tJR zn1hbNUm@Xb(z#lYQYlt>r9>#&J{GX0X^M4VKvQc9n?VX2t)dtXu35R9jI4Kk=7Ba0 zAa2DB+1MXQTI{~6mVZ2Cuezr6epVGx? zj(3hxOv+^Re-|U-{&b6EX$@#@#*(REwW3lE|wlbOk4T8J{w` zYM5!qZ(XQm_kYV;`}kX|pxcnm`Yf=$MFwP}Zg-C}A!{Z)H@V7S3G-nhQ4ltu!R53! zd8@#YkJv`wktF<^_{yiYQ_u`w$+kPaa|Fe^&GWS^Rvro-_bE1EQBg~^_Td(CgC9Zf zK}MrN!(M8)cX;s6LR;v+L|8~f>3y(xKjki|@0|yciGS*7X=ZhLM$<9F6Phju_q@0= z(Td(eC1O(MZK+y#!e1l+CK~Z#$aB4I+^#x(RX- z3>78$lj!u6={ZAzI-B!>ccHL$f{j`M4K2}Vf!24a@e58@ANkhR`G42f`AEDji91>) z^!t=H$T5fK6yqK+V2|RyKYRh+Ce=^))dW`vK2?{M|)l08_PXbvXLlVf+@JW z8)5R}8f|G`66v}bc0Tnwi!6SQJ03op1FBaA4L;$wg?+va;@=|@5;ABCm(t_*tM;bR zAb;a9AD^Hm8TO8r4M8|aBY~I}w&`ESXH>zF*3De~l&S#gfX)BhTs~u@56`(VyLDQQ z6Rs0)B?}}%&5jiOa1xLoO5O0Hc9-{E9|w{dA3LDTnv*d=FGXmiM~2u>{?n%y10Rk) zJl4kMgc82zgfqw4u-c$utsOb?7H|i*eSh5~-^@E#UFi>UR~&LQ<=#qk!t1+bQ#RR5 ztwbO}lG95a`P5Cm>Yyy7ko-t{wnNEZa0B7c#Y)GEyTi!7RPpz2Gph4=0+fk@26@F$ zSeyzGJ-TG8LM&B>-!7p>MIg=1UT8!^GP5ot8llIMe8J7gq&+q0ij4DQHLfF+2!9lU zyYmvm0LJvgQFGS_eQwH9qO!|rw;|_D+7MIUU7a{up*TzlSqGjURD@kQr44MSL+LIF zFdUTa&Tc{^kVEhGoG#J=7gr5X_7cm+!3{p#9riYDTXxRc#BH!gJVJ>noakmsRAW(W zCivEv*%)D1trur8{{EFeDz+odIe#(HV{1b=#>KlIrQLNrAuG_5!xA_mV5&`(#Lhn% zr6^;%M%h5`|F}M8qQr_4whBraDDUqnQ+M3R?TShuMe_}eB(fS};Jo|Q1Vkv^pRVZ@ zB))g3+EwJ3Zyr3OuD`){vXxuo_r^^^Qxf<=`na?h$~WL4DaDhK=ou-KCVzB!6sQ~F z(kf0O3N}jDX5@?ByM{7>P_?rgI()xS8Hs1{HS_s9RvTITPCJ#0%cg1Uhx4Gjn)Cbv z|6*Q8OT=Kn+UrW?+Ew)pj0``yA~?EyxU1l$9a#a_-((VNkOoCsOY^+CZ-}r?{YF%O z7=uoG;0wV^J`3B|#FrqLYkxp=T8-AYQ8ePvxMUDb-j`4Jfwc;0;?m8G;SB4M+(8uS zN*Rw;1PGMT595S1*QY%!8c4s*;smmLiXrNM?5R2Ma6!XU?@hp=R3w_9OG=JAH~fAN zi*KfXD1=mJ?92{SJoTCSY9-IvB1z~o=g2f zHpO>l*`f*Y-RU=24HoHQp`H|&OPVPz#vY6-K_ca5H;S@K&D1z~iSHK|HVQN}ZUZz- zTyVPy8`#Ny=F$uDn=Pu^+P$rK384n*w9R-IGv(>NrZR`^)>MZQ^C4rE{qVw@h^No= z9neq&>g!CN6FEzI*?%RJcA%PyUcbgE8@LhK`Byo5*zH>Mfz|Rm<@WW+1IG98ZMk1N z8{}W|jO?kSus!MO-#;|SAzd^b5`HsYU)6v&2=LT|WlfuCU`0G-{7sW1PhytwHJ=_br=#Uzq$62*ne6N;___r=l#H(Eb7-V zyv{{M5tet{OeNV=|7-Vb@eJXWVNs^x+y_FD#DdRi@5yw~3bodo{qZhH3Ggke&JLOV-cMVKg}{E4t{(&ShTa3AflUI&VNY6(_dt4_0cZyce%x$ngM< z2e1jcf$E&Z?vYVawYvC^WUP(5aX#FC)&9U4#Lk?a*;VeoK-D5YI2k_HT&JDbwF}pP z+3Mw$$A4{~EQ)1NMBS`oZflz?ct^hu`;Psb$E?TTQNLfG`9%@_BphjBE^cvBYD0Bm zxUAc!&ATOnQdI6l37fSNa==qKY_UZoslbW&NM3y8m}0uQSY)8!I(992@1q<>AL{`9 zsvVYjZUaw`1t9#KB3Z`Hic*HGYyVya$AVdwhJOdxdVa4TM3Z*vc`tNcvp^`m4~$or zdBI*pjwY?vpck&npX(um8Xs*IM1}tu*PQcCGqoW%h?|qkXDBByH13eKO6-iA%x}Pn zh68K+;-mY?1)mI)m^k&eu3l)mX%I&!jD9K!B8{%+AGZ1Z zKFexDj%zhB$oV|@CaA5%a5%8K5pPu^8Zo+@D|Y2*vuBQ=+PA0_3Dj_yER2XX9b#jd zN_dn9)2+16(F|Q&Ez}JszKc43#HX#G)qfO1TZVgK5UVriD<3Ow)S-myRwXU!$`;?_ z@qvs2%lYd=B0}%8=^pEEc^J$GPq8jS0Z1!TJ$Y{4`SL9EsQ``8zi6!uz0Wcjzua;# zhTt8J{v_UZJva;xgK=H~0?MLopUPfacps4|q6neU$OntW7(X`5br z8ni}S<5Yxu?`Lur(3Mfyf*u?m zCB@Jvc1Bn~J5=3hver4m)f~X&PJhi!&OZ>Ef_3n`GvkCu*9B*fx!i2(X=^-0yof0n zZtE*dsn2s%CeDBCoL^lkJ~l~x-^qY+s?S*3p(r)`HO9A4&M^Hf>r%a+h5YeEx;!mUNzdsaSTtgt{U1l@?(-z(p1L zqpQN~oF`5s3$=5_JPgfamIGhy^xEd>+GNgzgl37E|12iII-9Crw_o^>ZN&k9shus; z5S*m{XmD3YLQ^BtfPc>%*%nJNj;_J_Xt450e_e!97}X13!*BKHBV^9;(awFXbc1){ z$CLYZX8yyeLg2`bfjF?*%a!PR}C!dos8#-~cnyb`D=cZpg6wM{>n+YRooA=+pSnj!TFh9An?=OlzP8?U&c zO(SQf9la{ikEPxduACMn^3-jRsZS=`<6I6$EhEk#cHBOf(R53m7Lqmqm838rs9)EY zf+2YUA%?SOOBuzAOp*5&r>Pfm#C14d{3eQ}%EZHB%v5iM(5KaQT>@68c49D&Kz>7j zvq5mhu6Z3~Sbq(htAninX)XOw{ziN!pLFx4C=CxMq> zFPb}8TV{#NefcnEe!e7h^Kx_C5^g-Fg`7S~H$HhoyOua%~j@EOMb1< z7xI#gIYcP8UO85WhSJR=RnzwKRT1k zUcc$tCV#N)MXVam2h6hyp5E@}=4evNn=jqc)H&rA=z6~wO)YN95@3KUm><;_M><3gMW{U{NrYucPgo{k)gw4nvNBkU+_&^ zge#HU9^4uv>Smt8MaTvz--%kkR_q*BxqaRoP;7Z!R^<^!y}SK__l#s%VK&rtWN%_>3N@3kD-{woG%^Y=Ol59obZ9alF)=YYF_*D&0Tl!?HZ(Sq@GB^Pwgpra z>J~OksYpvG%_!ZS(%p@8&j3Tr(2aD1G)Ol}Nh96TAtBw}-J#!j&bbHg{r|PTZ?V=e z&#q_h{qFs~L-|@+jZp*$H33ONA&!i!Oe}l=F$HyXRyF_&3p*1F3mXb0r8?Nr8uTAI z3gtVHy#p8u;rqiv%pPRy2$P9_8#}@b6`&A+tdli>l^wv!#mCCc$HD?&V`1U_k0I2a z4w7+ghB~Ww*Wi*tx$uSIl36zg8(prHP{pcae%ovL4Y880E``= zCL<3}vIRl@HkSX}fC2DNa{#PNtpA4l$NP66Fyt?1V^dS8jjb`n4Gb{{n1QW903}Iz zCP!CC27oaH_}kFf+5rlG^EY-j23s4OzzqIM-54M#q5?36RrpVR4yN{CTSo^b2e9?; z8kv8Gfwfrz0u+PV*nl984k*9#69?OaOksU@WB%uGtsqbrh{u1B85jaI`&|am$(C6I z0=9Dk$%y}B0~4V<%FIEI08SPb79MtX0LTsiay7MJ{!O6nW()d%OUe3M46DJ*!xm}_ zFoTr=@&cQIVE<4&9E_bo07rW#keA1wivLC^tgHYa*whhV0x}0fP#&Yh#2~Z3G3@;9 z!L9&Z7TEZ)0$6_k{rgQHHeo<0#M_cNAq~@IP6wJbKDN%%A|?zmtV^=|2fO|1$wJ|Evcs;J;%jLSb_Y z0?<5;xgHBAiz)1b_5XR;|8n{NoAKXK{;y;HzZpq7SzG_5r}^99|D!jy0b9HMV*#66 zCr8*0C_rJG0Qp~2P0-(qs{jImooxPBE8}Pk+XWGbx%Iz)jRZSLf?YvCWw4{E#b2}W zw^-x%o>_w-AZ4fn`1j2MU}R-s`5zr@xlFBKw}%64B>z%@V7v3*j1mx2DDd}^v2k(% zjP31>-B4Iylf=f!3GiTrZ6grm`qvNxn3*6@N0L;s!8(i#;M90JHcb;sr2E{EN6*VAJ=A*a6HkkB9@nEc=LH4Dyc%#-Q+sU<`_n z2*#lFFXDkQC_f@L0JG{Ng7K+6A{d|gBZAeZ@rYpT?;a71UGova__Y5;yfB^dW3{lD z#*U9lSfVEXB33pSzlpuEDaaaR=J!Y*58+ebBw!xr|cLjLP?IavRZ{`c9k!&0yX*~4DXKTNs) zl7XR*C&&Toq^-5nV_~q1oY~F^>Iedw{Bc5mtT5>x&1Hp^^XS3}OWOft1OA`kfhFKz zZR}w2hZ~IlF&o&$!|dn+{X-4&aC#h07{^~f85~TZ_J8&Sb}-I=Kp45pAFBZi>iP$S zHOK8SC77!_$o_B2|GMlomX!fb*X1IA zL@taQ!)zSr-KSya$eQaC1kPJ3eq#JLXY9G*(;{sXo8dRh*n4cBe|@#mddXsCu;iH> z&i8Vry6K6T$r^*_cWi;%JqLLwwoSR#RvjaD2+;iHQJre9%enA4?JEYmlZ_u~J5u~q zbziPZEsma1*X}c+Aq+=`Kf~wYVMjxM2xt~bYyKiyAu>MEB17SDDm;7;MK@_;I^~i%`z!J7Ao0y+Z>3E}F*gyeYt!#>8PzIXa(% z&`kaG>t4Q-(whKZ`?`b5b?K4f61KH5p>uWBeeM7{bKRH?Cd^rRQRFWTtM+VvwaC%R zG)?^4j1nQ=-;0`m8M@3DBG+~h&XV!aYCWMQ9iE)h_)bI1?#1eh!)bM(`ookg1e_at za(1QWy|Ay|Pl8ZouA%9qzDlTgm zs`Rl-$FgX`M-_^?vjw_4=-D{BR1r>STS~eMN6g&G53k~L`vJp+x*&s+amu<<^m_OC zgmc6y$F~0P?dOmWmn!cW1lqp6dwt%@gf>f9Q7^lDj@1%!g!o$iMeS{W`f7QqRvA(7 z2>#r2yWm6%cRL-+e4I?ZDlw-o2uh}ghGy08Q!tL{wy%SEG57W)o02yBu8zLcN>#W=aM?L{?j9kN$@jxM-pg)lgaQgXRhq6t6g`}#jR}a3q=$Fii_2LV>~^h z)cTuRe!MR?AxcTiH{G`1R#ixel4a_RI$WU3%T<| zq4sciaRGVXEyM_aeva5aTzKv5U}T{RM(5P6^VCUItCaUwE(aIq6~_fjoK196gU-A{ zQr@ljD|0HouSx-Mxc&(e70;r0rWo_6hGTMk^w+Tip=xeTiIuJ6%%oys9-eUgDL%qChr*_Ow#iN~-xbShR49Lq6q}^s8N{Dppv|UQRWH-<``I1_2=d)sp zQLbvZl6Q@NV5(f@Th4)_%;{+ILSuc`8yfnNi78fJZ$H1CNz$L{`@Jw#t3lM6v6^UZ zyuvbPA@Qu%h28fz*ybxDUMgcNfj(6E4Pg%=T^sFQf zodF6@m4Y@;a>r5q0n@zV1$|2znPgz;Uhc+8L^M!;t2rVi<~esE)(~J@bd!o$cqLAw zW08u=bk}7fMK&Z`(F)>?Mdxq&5PvpjCLW}=!9|YJbU1~U8(lGz^pX%G&W7y0YrA*P zoM;<3l+T(K>CMqzk9Kx;Da{S%dx_B7c)+Hr1QbUZPq~$gJZ5U^oz0brB85#{qC(+$ zM7>adQs5+R@N|;AjPqOyb0VHID)RN_J3$1ACyDJLRO+&G39Bzd7q71IR% z!IzTp1XXKy`a86=uWP-L)aRtefVq5zeJYJRTN10)Wafhep5{*3uU@z#^v(0y3=Q@h z_)os+3S8+mYMf5sC@4HOyv%cP_8inHwwR88^T>8vp?mI;;94`0lXq$8-Wb0+UROdH zQZ{qkYLReNBV15?^>NM1%iU_7;Yr|FdS;h4WQJnta9*Gy2_N@4)hjX4Jh;Lq?bg>0f zCYXvBZesgqm!WsWFlpYPM&!c6v7g9)Cu7aMJm-ha#=R&ww_M9%A$L@h+G8F6%x$DZ z{a>pc>m9E$m&!E}k??5h;PK!;RY-RwM0D@`962bb&WN95oAu1MiP0$)*bYHUshS@e zvwhvcr!*4wI!I!sY#+35IWakb^?i$C#+PS}0?ilng<2Y`gma@EMf)dwQ$9U^muqjd zV=&Hg(0JNB82Oc03&pI38U9)FTQ$3gk3S+(^9f8n1kPlvJfEBIiG9~;XUBT;r8S7dzLo2E)IBm64`(^7?`Zj`)wmArVu*Wg6qA@Wcy#eraoKVDMd}f1P zkQm($&=4)Y*TvzuL1v4cyW#4qbbDX4qb*0KdR0^Q)nn7GssY6)H4AdFRg%EIpOn13 zM`|skz}sTox5gH;sz&jW_2XQ$pQVJrsAh%9eoTdfm_1cuWo5hpiXH}kC0>mHgdKRB z-sd!l9$JN{uOKjpGkBkuqsoChySl#3NmhaPYxGAj{~>-A(}Bh@c8WT!SX=l{4Y+E% zA>7i2bZF035P$81?TB5gVXrjxdOSi&3_x3AEU*+?*oyP1bxF~na(FtGXI#iy+lKwd ztKwQEnOJSqfUkW{6uY z31ju!2$oVSv8D`DSw6)J*`8+K70Zelo=Nx>-)Q>sYg^S(31YB+9gnPLEEDZECnD}F z^T(6w7EmZX&&J(JO2l296pZckf|8uhPQ56qGuUy>d#n8x^J%;q+Z#F8O2u~b8^E1% zN6*rPOLAC?lu%#dw!Qkn!_TNspDNytq4QnjdbS z=!9kF(h?3zy=WdzPaEbUw*l+Ero79T&Kj|-ll|Ih(38%8NCAfu-J^k2L7~}|H}h<* zL?yYtDOnvRPQ*zgXO3uHBy;-uK1_G~Uw2RAjy=seg1#@@>9i`ng;$#{JKOf%MWr{@ zonJCgybiL1(kA=r6c4T)tj>=UR*W2GC{VrWOHmS6#@GAASb@fP)OB5m=^00ueUAA? zd~n$;R^KFl@f<8iBOli?BwQt6C0jXg}Lkdjo(P^TCfOQgj&3> zif=J@Wl{lAFUul%>OmxWKUo{ZS%`ldB8gwr=A%`kgo9o{YDtqIJ4H{|mfZ0D3<)k$ zN)f(eo8Tg#shXSAd`g3$6VTy;O&}6c;Pm1bDQaMUy%#CqOryu{9?s>a(HHIIGF*7n zC1z)q>$^ZopH}@1ReocTS_R*buk#VLH z>f6S0BJs97pFMy|8-0-&A^p>KdP&x_GFuFP75zX-GPx>vQE-q&47qcJYS!qIrG~*a zw@Ak%!b!2F;rKh=4x$btP_r{cP zaVz?j1TVm7-7a#4RX`;UsJ%|qiLv{UzJ1@4Ji>h&@pvsZQupdSCEU7JRM--~4CH*{ zZE0k)W5varW$f!H?P5_(fhdEg5AWzhRgt)UH4eUT#>C)6Q2GGmDdI5i)8Y;I^8A;c z8$wPXwz}P^87m+^Zlx|#KUE|84lH$l4%VIhu!nSI`i`gIJ#7xsSvFsvzjw*Fd9?X_ zSy`O$fFtLT{{f2NNbk{s05-gP%uI9Bj7!!f34LyW^o7?5+~-fflJhSLG91?j=h?kF zC_nQp`?X{oPgNQD4{o;2saQq$u)VLY`}#B;uemd+jVnY9PE`f+(b(dFf7z;k%g!TP zt>ITpH3DvG#_{=$XS4bIS}do-eM2H67ou5E(L1YnD{Nc}5fNFRI&0rc7ViJ3oql4xznZUE`WB}kd=P125k;TmSTW=?&# z`z=QyTKkoras(18T?C!7Nk`>1;$E4}cjVC8iGH7rN+llf4xr$0$$i6WLgNFC-$6Lg zga%@$llAp2{WFSeb<@#!oIOLkZw4dUWLMW7*jO2dH&e;?tXz%x#kLxK3CForky+lF!Z>X+Z)O!S5)EQIKf^U(#nb%t!-GZZo=;8r^S{ z22+Kpfy1kqZ#6){ZYvko`e9$F$NHqIFR=9^kpxFbf4ySA{xzb6xDI?JEqmEm3?(xRAY&ZF)Gr_*mTs38b@{@=>0DO&>`H;pgW538l{3 z2U+44MZS+HJc&^^b$ARw=AO-|>8}w+))6;4@x_oX%41Z|SNE<`UJ{xPC?6HfRc87J zEY7E7qShc@kVE$O9tx{zNc1*kxZ6<-&Jhf^-#L!GvMo%6iDcpv1`LW5;UR{UuSklF1>``Dgd$+ZZXXmkp zWjxge`gj5@^GxMt`=r}M-^PNZ948&|_INVAP>;X+;$ooG?RTV^ObSUi=geKD%W#6v z z?K|ICJnL$c|B5=mseLe=Y0DX*UGQ2NayScrV8T}8)?MDcZ~R@$wLv{F^1zD3)x&P+ z*e?jvpkJ|1>TK!PREbIq*0IoudL?_wS2mr-IOObq>odTK!uwg335g{5tWQR&-=2*w zhM7PSDUC;%=j2C@P(2bq1F^)J5)}!cARfPrF%R=ibL-UNyk(H+nd=2N;Aai$&J33s z#s1A|8Ce9$P_OB+I?Et&C_2W+ho?Q*-#PNZdq{>>dM}xfxz)#%g6iWs_;RuT`|*hgK1853ZP}$qchb4E(`Ic1p@q zuiw_^qfT>CR9+ArJzLgad{8^%Z*ml9LzMX(mu}GTAL7K&#&>rr~L7M zjodHaElOU`S;?ZpdkOIT=*^`taI~OD2 zK3eeejQA9DA5w08+Di^i&@no{h(zXp7&M=7vUmp~dPz1{2wA}O+E)LV9y+G9q@6OQ z6eG`;i-ZtQo4Gvxjv|-!97i>OSwmi)K`b081NIHYrJwp zCtVP3S4fMCj>8`A=0*c5zq~gc;Arez?`Jq!8R}yRBEK6NbGQ~KE_RdDYY<7wc}?m>bf#W(Q~TG{W<~i zA?CuPhWHXyt=!nSm7X?p#K@5xt5wFJBPNdZ3hZSwYYIr{oY|{=O*J;EtB(k^zS!aP z2&|W{p#%gxv%5fts29=3Im}1b$!Bg7s04lX)ysXxy_B!+k?nPull~efb-PuLq6W3xAHr;*n>) zoGLUS-Sk(|z_die({p|J&V+DBtM^O~S&OMSay1@V(+-OTtH14SReKeU??li=-%UEg zZiVzDYoOYC*fPsg{F*U;L8d#y&Z`ju9@P*k$)+bS?r;=cnQ{WCFbyM$xDk|zi9F~1 z^vH2YP{Vd&G~o}Nd4LX|%s=VS75C(PUeoI(rS;=BeegYoH_jMq2C=0Guj?H!J!XSN*Y3PQvt z5VuLpApE$^UcszI%vFPS*6h{IfSc=}Ssz$aF2-5ck=8doJ!tboYvxPdn-^jRTs`Ed zmOTm>_q#C|Q8D^UyF1Se4Bn1f_oUtzwJz=;@9!W4kuIur^j|YpFqhTIlaNIa-%us0 zZQFTsi7fqi`1Wjn?`tG@YrmYl2HH76V0rgRP~!%Env(rOm)y0k>*t(V?Fe(%aWM8J zVt0}D8k^E(F*M#Klu85@dp!%1;7Yy1Fu=_^V``jw>8Cl`*`Hw$Hc%XklK$|ue&9s? zBfn8hAVU7OoovX>UdNI;eU7s;yuJ|l6QalA-oyGNkF+v>M?q^tPd@MYv25)rh2bcz z+!REf-0MKuCU9>3$7I1`T(Oqs&yhu8OIxESD9N1IKis04Ai}q#3-xl0 zGS^sWv-W{A7JUvC#eIZCQYTZZX-}#QEic z3|_*_N1=s(u{fg00UwL@1{bGvzI#n8227j7bt#GVY$<2oWpm39bwB~_>{pJ1ISCrd#SFKvS7j`S@ls!Ro zsz)_pT<$XbJT$Q_Ck>xyg1>mk9~-_9H>Q&?;>ziN?>6!e*DW97P>}Zcc0{tpILAA- z;qk7RCn6tC(?eJSZeV2G2Hw%&s`*FSAvjuzQ4ZG$`f(9cfS>ncu|)GO|7>9SuG3-p z4EaL^?w$PM$^~mC=t7=kw0EICVV%1~Sd@@D15d)*zVFBP7uTgVzzb{|pSmAMK6<*B zg~~pEpY<4S4_vXTgf9rxD@!CS8k31!!4{zq$&tBfLZr#OQGQU`uQ_#L2$f8$`kY;N zkR7>R2~C1G4Y4KfbRi+}1RPG;0kgt@DREdJRftF#|Ce&vz7C!Ei6sFhtqOh&clYuj z`N70pV8eKy@_av0Q$(y$QTQ-9RkvIvRjmYwi{hX( zj58o-^}OUx0gbnz37KTXR%njF_DEIY1?dja7pxdf@@`^}Xy-3Nw@i_mTZzNw{O!#8 z0xcARdCB2bE0Q`=U1((^)FZ-Gy#?p0_=4^Ua)*lp4fbsY4Nn-~qG4x>(ljbXO`NoU zewMdYCS@lxv$W%H*;9Dsfqs+(K=i>ujc4K1uNim4%6l6{i>IFINj5jny!5HR!?1s> zJ3-F3K!W3XDwmCXEu63g6f(+)^vo%jDLVeAG_!oxS;AByuF(@3Jb?=lD98jYxfz2@ zd|2F75KY^9L|iMTePH-YM+B*J3g3u-NK2==IlB`m{p~pW%4CO9{|{r;L03z)uQps8 zZs-V7UOl0j_9hBnwN*4G6Z*Uh9vC+&V`ug-a>g)Fezuva428GFMJPjQXK5GQYPH*x z8E~Jjo9r9e?7X4plnib=$TYGYbImo8TO)ciV32}^f!t(qj>UTw%sNeYic?E}Cw*yY z7LTt{Q zWx_L?+?|nR^dbP2sPxncEU*+a& zZk~@HINCmkF8F1XOGzX$0ZPnU@nVcMlmd4nv(LQ}^yo*c!Q)@1(5l15RD;%nRi3hC zhj!k{)O>Egx6Ue1<3q*??&rt5rdZ8YMxve0lmb`cMve!@f~ugKzWtG-+M^W-&pq7J zlfeAbu-C_w40QHz{H0g2H`=6{)=e?_gqmaTu1h|MHZ>_7J=xjxK9;HHBRc6G9lRA^ zROsVG^1+e6`5P%HD^6nDAfbC~z6ukH1vjcMU6wNJ;V9G1&*V>{F>eO)SB0+8#A7_A zIl#DrXZqPX%M^OIO;jS5R8LefJk~TOZ{*YBAgKgr<+4A>M5(5dnqO&*;m4QVVp@?K4GKl(Wm@!nR#OCLt*taJWrJHr@pE&j={4W z|84DvcVW&KK6w(K$MWZWqK2^#Qe56XSu)sAv8On5?SLO323A{78V1ioU(0rW^I?_CfgS6B(G7w)17WnsK zp^5BcH!P=254gclRID^zfBb<{_&$Ft-ml^mlWE?p3!YA(-eUqxl*UK!+B4^W4+i_i zhEde`ITzbs_$MS53Z}3|oPEeL^YOS@IKLMjL%emA_QY%Cmebldcju@52wf%2@>5l) zO#!iCfroF^d}U=Xuc_D8sKOx}n@JJ*u4&P`2Vsor-}TCh$K+d#;$CxGp;7$d2?%9sUEFxctWvd51gx=qFC z8*K0=ZToB*50Bgb7J$pyGW(}*t8wd)!p#0po9h5Sb&4X(0A03A{;m0uGpo^r|1L_m z_n!U}zbUaJ;4-$Lmvp0k{?qG}g}If?{7r{1_De3&T=(wW*$oJC?yA~_&tUoTst7ox zf4u`;{)Z|;3o5>#w}ZgB;~$zR-ZFesZ>mY{0;!V4hYe36v^?dTbFGu9O2nTT=&8;I zZg@0GKd2XGRL>c6%BRey@tfM)ZQjX=8m5gp78VUFn)Nvp?8~y_#dwII2B|xn@2oKi zzo7{BXG$rg%4-U1k^tsRZ-Xyhq%K6&xz5B9% z{_KsqIoVt18y-DhR2}Fc*cW-iqt@9So|lc%4#-U8jNRk%PNVU4)HgD7s#>b$9=J+cEJ0 zpjhrqqT-90QEC3LpPdJ@It$qQW({WPa|&0%~rd= z)dWPn(-j=P!yr4=z}q`-MNAAR*~}xZtUZu?MEl^)W2}Ay1K+)(h<7uzEGSlp3nCEy zq0M|giXq^rt+BI&B*TplNdJbptHZV1ajO?t;48~JV)eu|p91cj_*iTz8_t|}az|A0 zCA#`dP?gU6CkH3MTtM_WH~7nzMTD>n)!?1samfc4tvJA_Oy!)~jYjEQW6bTJ(;D)l z`ug%?np5)Y9dI-#u;g}FG%sIuuu$y2sN^YTWnspS)f&tatXRdtI6A>6S@$Ma#pA{3@^sO8Mfdd><09W@_6asm!suh>Cq!Y93) zRS*#i+H!7l#c9X}-R9xo3~Ux{;GE6H)j$ywuy4T!|T( zS^ce(LU}uVaS@uYraML^MB3)=)Tu36x(XjT)beM23Nc3Ubdt(#-_^?&nUQr__Ep2( z`f{#6fUj&I(~Uw!QeN$PdZ&^pE41#Zleokt+zr0*#%X-511(T14%&^?O{7#6K zkaDSuf#Jz*KjSL!pZ!p^s~c+LGK>8C_WT5c$@Ik@w)97jS1h*@tnQ0bV4O73Rdr^bk}`8PJp#x#mXhdcKJM z`7>@UPA{4J356zPyzSQU$Wlt%+L(6Y*B0kl`lm6NDF1c5zJ5FN$RHM;D{Lhx`d2qx z;OVG*VXuR<>Ya%zGH%BPDY6Me zw|vSL0I3y)J`C`-?hC%Jf&O>}9Hyu99e(3x=F_N`8JQOyA62!^KHCKL7tS8AfTOSd zGtwVq{4eMChTG&m-xdW%V!x#Rr-a0@0Q6(atEmNSau<4&vBt+~d^CdND zE6-hQo^Nom>Bu*Hy!Z$3@y~mO_W+r zFW%n;3kGv^j@17q@~?EJC4IuC0NX(`8fb?I2tIt1{*5IqoOJ{J$Z^*J#DjP+e;@ST zCA&0D)U5do7fK}$z6Y;{kh_@#1x!%JdJ->@T`?~^E_7@gB76m*L>i> zFIH_6R!191fez)u8!H9tyVZtE1&ANABvglAH>d#~ES3%WZ~TKz?6-7n*MH4EW@AP5 z)0cWIlNNP3@kaK zReE>{yZN^GTtG<186FZZ%MqVqSsC*Ll^6M8lw}BmX{aFSLDU;x=hb@=pskG!^~9T) zv@3yB_Y5XWzeQ@~zQ3q_MR3}n8$b;Iu@a7koJ&OBU#c|_Vd(q_X06pC%S(HhVrBgZ z%m}yU4-5+NVE#ypB_y^{kJDLF5u6#xKeQOcONm3>(KB_S*PL@9m~qU=K`)XETBE8x zf*vLYS`xGGfcBw>jTRwWeaU}BZ%>L@5Qe^(=i$|2%BJQTqQ!Q6kNHYWnt7u?-)35deqnL0qOSofEt(rFonUAGip%T<*R>=R<$KT*>G|D=O&DPu zNVNQ_;%haK+rJCr04%t1uz0?+qEbj!R&RWordn>~$zh_}rKC9k_BE$5W-Hs)g?)rY z0NSti_6}3{Ws1lI{#JODR13D3;)WK( zuJB|9x!pMe=kTBN>FI1qV~A$1h^T*Q9}!Zdc+1HXv6!p29Ux=2eQImzan42=;Hh`I zZ>zO$Ys19^duqTrC~{L_G7)x@rm;->J$C6Ay*{}7{Ovdx`Iku`MCM9z(k`rJv{Pa< zPh)OSRFowU17dcjDa5cHs2iK~xVi?!;KY72zE<804sm)|Nt&ba1qyKe7DpR2Z zr?b9;nGN-CzRq6IlR)uD*%QpUxYAH?)6IUaFnTuCw?+{*Lk0HYZOT*ZNvL>JNZjIZ ztr=o+d_X7;yfj;7fX#Px`1d?4my)17=6Vk!frkK3_cJVNF}D`$5pqdaorfqo|M(Rv zYWcDS_}FkgnR`#^aFG&2wtd~t*P)i|KllB?-`%jH48zfZ%eRn_+%})j5k~&7Ff3DI z^u*!gW}RqV-P5-?h2mMonl}c7y2hwDgJv@29Zl(E z8|lG*$%|9`#uPPu`G(tQX~yEVAl!r!0qNw~nyU3O`>8vb8#VdJQXmmT??9gp1yTac zwoIxU%UtS~{p-bENv@O8bPmgurA9}`-1D0-{k|%gvvIxDtm~ZFs?tC1@e%%GxWs<# z(WJ1@Wyms&KChg;>1(A!=sL8nr8=-Grx3vB{?UHbld%8Su`RSFU z6wM_7%f1hPw>-v*o=S>a8#D#)$`H!#{P(gZ zqM4#cAbNLA_(-mGRxDgG;r8){JFSuh@kRu94&|7Z{G!7nrec-GE=UV8(m3laY1FC~ z?~1u_!rL7PMYF=jCg)WB&?FnL%cEk;#fr`8kvJ6Ma69SeojV@9+rRB*Lid94xfk4jrx}dELuAx)C0o&#c&MohW34` zs=ASsMwPIid*$Z6tH-i!wLD>5VW1iv(;-rd8B1mAXNmTT)fz_+z@8SH6ZweChYIni zMe5)rh)!XfUQfd|6Fqbtqo#ExV)>gdY*?jgBJj&p4F`uR_$hXB)BZD_QBTe3NGN08 z(GYwWfY?|2`REvJ1b=0s%vHQikZm{j_KK^Lmz9P|W&Px;dswsB+aidOvm(^##~jsc z*Xc2;#l6G|`t|64;vf9n8PIGbWey$?F9^iV%fk!g=40mOW@g3YQgySIweYf`W04i+ z;pX86{r`}RH#tbDNZc8@IY^Y0{|%1FJ9v0{(Y*)p{Xd3;j)#|zhwdLZ!VLan0=Z*&&>(b<8f`}vQ>*1mh~GWhZ0@) zjulhWd3D{k%4I?+vdux`en$Kcgq$(fvF<8F2zMD?#2a}mba8c#D_O;@Rt9OjsXvl} z{aF!aczq?|OYXNY#YA8A;#c6TaRT+$bf}_+1vbk+*=I)pP%-+Do3M596(e~;j3pfe zWPtkNB8=rJ{F;@_L!Ka#-SbWoj+{&JLe)EsoQ|2&1dwL~O-GSYqe1%oqYN+vY9P8e zdjw9e$^gH%l+EYJ)lj?wnIWiOzs}+_zoT?lgUw~ztHYp{=UYRedEk(q9~fd|HCITh zS*le*MrpEPs$b9%f?RfS_bgm}y#@ay5=fVBPAJ>Vrwh7hFr6exXobN-uUI`ZarEA< z^gIy|oqX1~+(In~tP_l6P(+^0PJL6sgfs*llv^l9nq|O1KAZ{S7anEzKyq4JWkB%$ z)l2?SQWMzc-V`P;iVlX^no?u2Hjv<;AT0#js}F7KooCwh&1OGo-opLz-bkMl36RJ+d+cAzr+^N8RLaI@c`l&R0t>hnA-9u1e!FqOLoi%TP_Znt6oYhS-(Y`2^ zJ9v#klwpx{NJa%wN%SQVzl=aS({CGN!rEw{thAVlA?5;Bq2SB0{!DMj5l{lMODL{= zRdl8S-wihs>~|rJ6`hk2T7%eu)RN_!`(?pQtFN?Up9f~(*T0HNr`aamiIZZ91X|hp zq+)Gx?ox;O*rN%E6;Z?)qSF;2a}lzGp`kSC4J>2bSsiULs(z5VSZU;MMs$Wzrj3q-6{9oqAAmM$2?$e?=^o)f5eP`ic6!7SBJ1x%wLu%T}=$%ygJk2)_<;`xcR6iIQ#Dm225Dkg$;D1uYb8) z)K-+RQ4aT>{-#@ZJWf@hU^L=D=N$3$5t=0T_1o4Ewd%p5a-Wo}6&6%bT2_qn`ccx~ zs4Pf;f!*ZlBC+<1ASDeIr4^&xI4IEon9AEShyiZ2p{7kY0zN@p|f$-7v+u?Z|$7WI8mvo?wCN7tVa)( zMQFFmp!BzCSV{vtGlu(=uvbNsn2a-CIXJNg+pqrYx5g&)D z_Ol&I6%z>Q~Akx%R6 z-an(B#ZJ?#z(5IjGWryHr%V}4%jziJWg;b!XRZ2vbN)p!rv})}M?y}>*<8o*~z!dZ#e(f#5&^Jl3ZX72IkgA*Gsqs(TU z0%YDkNIXQU9RPEGlIN;=1}L0e`hzHEYrWJ|jAs6kp!@I#D|u3c??XaJ8Tds6u*Pnl zt6W-k{~hb@^yFk<34`q19h{5AsPLMnHzA*kmiKGWNT{(1P}SbcQfjn=WCgXO3q2<{ ztVzC4T8+j{l0(x2KgCEeIxM*19_I>6OF8!JrB->YMB`9=6 z$O*t)bzt}4pO?_RGykrqG95uBC-8|cdv(p$yyF5ZbF874`>}n53C~6!_31fpmfbJZ z6CBf?bLJ~>4<`(oMYgPkNIq#0!BN?c9Q!Yi0bEtc@DS7S%AhB(Kf(7IZJQ9|LE^Nb z7Ji?&(bj|w2}`V5iL3kSZLJQ73NDV>-|(#%gi~r(8FRckaWGV@Z?bodJ1jieSYoNld-8RAd=lvO zY!|P}wlVDgb8uy?doP)|RB?5rG*V?~*tcvP^4Wx-=<1=HiaT&;z9)xc>@HiqE^G+C z!mbcdG}!6e?Ad*biS64y>28qVJ_~eT$d5pB-V?DM_&)3mmX66+8Gl49@Ii!#u5Gj? zb5danD*w1|<`m~de_^baB?@it@!5qd(bp{{_Y`807~QH%vqOLOgUm=4W)&I*vP-we zY+g>wPJefREVxRok|eSxuK0a#d0Na;+5$h;_bo0PW<}Fd>G^o%;`M!*-!!&=M9O|d zyoM)DpxY0D`SsVhYAyk?E@uB)!l3zOm27wFsZq1O-1WEnd`fL8p!#|o`OA0<%ZS{7Nus@MMY z9C`84(lwp3YRK0o3Fk&V-v41P1Z9YqAkl&Oc}y|6v>gI$==lE)dir$6AiDQ-pnpCs zH#aXjJ|Q}8IxS2tC0AQFI)3i|Ysk_Wi^|Aw%km2H%gGDK%L_{L2+Hvb3Gm4A2uaEE z2=MVp@ru*^?;-!PVE!K_nGPffO0i&N1yfH7;e56rirn-Zze42f`?H}Y=&=((fCo!R zO}dMrQL<%qNHa?jz>Sr?(Z|)mINVp=oOH5C$e+rM3R#Z|*#iJ-W*I&|NnJMqPh2^C z5&C{_>}=onoa2|Yh=l_r5&1VKG0kt{@IXe(06-x?KECL0t?Es)Vob3jhC;ENsl2sZ zV&>_Ipt|#v9_kiv9UDP@jxJ;z``g&gfxRw0DQ*>;|DwVCU})#K)SCVsQo$zihyN_D bri)Z4oI0yhb-KEr zpdje=NvH%0P|oBVd|DtDXFO@W?e?m6h7`JNEC^OeWUhT6lc!uE7G2BT{#?-Lhi43K z(o9g%ID5FSPsgl+Op3J@6WFZP!#m{XK30D%JC*l}*2`Q&~;7ZhCe~wPFvC z%Pa0%?jGSHT@DwAa6w=B5-0x^;sy%L>dTXT(;LsHE+skR-=hHfgId8|pDR35HTPd( zcX!gG;rY{RkME80hLnmjk8qB3w|{6mh|8esN-|lO_XSuYhLNBS0Z@mEhiv0+QFsLE zNirhqgm>y`6(n%iYdZ*I2n^r5;n?%5*lVA%9F@8m`J$&iE9u~bn+J5owJ$43SS3FK^iBBbtVV}_JSJ%ffN>7C6`7w?VcZKq* zPt{?N+~Zc51M~g!c@;uw0BdsUu9E)Mf$)ZS*3;22(&J^Z4|e; zl}g~9ZJxi_>?g)-I&4T_n)RS!*DCRt`UieN{lWIS3q-a<;DI@k$9|5IOrmY#l(~u- zJQ`{ki-MZ*5Ua%6*7Lx@mlHt4A;pPa!3?{IVs7qkk#5_d7CF&mP#3{e@8q6g>jRGp zX)$ZU)dZ|DPM*n%wdt3Yu(0=~lh>4IK(BeYduEXCMd=IZf)N^*hkTm0B%TA$p>%^g zhWkv|!;VuyQ2&gbVoUZ%?R^(R&J*=7InZKI4*c{enOA2zGPytZJ?n4T^CalLyt<;2=8G6n=#G6R- zFIyfH7=Z@!7s#M(d-sZJ-VQ)+P?aQetO68GetMxebnG@F``H57B5m&StsbV+9C3}s zY721p@ph>4I7*IU&GNCyrc`I8Pwgj7>J#wsBDZm;;jz603U!Fj)Z>2j`$Ukd{nm0n z<)YI@IBH=*;Y9YOXizfJZ|$(YHKkb$UW^AP5Qh30gVk88(cBmKl*SxR?DG zV1XkdLNhY1aAOa{7cU{OzsooX+~fy#FI-lt@Px}CGxt_h=&(HX@$n+oXh1H6r@^Pp zSaFzUR;A7=$n)?q;kdK3qfr9i`T;SAU6;ilC(P_SOTtCB_|Ac^C`^ z#Fjx~A_)5)Ucs|6$HW^>DSD<*b)#qZEGc)sx5O9reUIAePBRh7<~rHg$}sO%_#^wh zopDR>ruGjTmAD638dJZJGKJi^Hj-;}Bm@5#Yjl@V6kKA@uZZAatM1g0LjdSyO< z2z8^7^}J(9kpq~IzD(vwR{&K(F~?|K!b%_2O0ni2iI3V^V`7b-0`!2aMnf^AZ<zj+iA^fBSeQsadsfyyFCnz$BA=$@YK+ z5(**~DAXwXfk*N!Nf%auFg!9Bm0)MIY-C|ZLtF2ap(qTa0__G*JD?L>&+KsHd)pg# zqE?~K;!+93z007PHDF`9#^$z>&y7yQU;yIDFG%IHa=?q^=8~Wg42c#rG1w4lA&``n zcxS5{e3EdVIc6ys4#fVF8^6W&Rh~=Vus8i+RQR_WDwKw21lIXkhLf8wb{?-n!k7z- z!*uI3@-f90^LWaYAF$J^BU{m*!L;?o0I6E;>UAk`a6?YLb$PD;Ld~$~?#S%k_=a^8 zH=(G71*(b6;)#w~dQ8-{870BtP*VCsmFN$*cdyY`>I>T36p+VI^TJ*DBqtO5W_DDF6kY$kxh80!=>J#)WvD z=uYH9?I91OkC+e;78!xcC63Vcok{$tL`@nXGBkXUM;r`;o(}3rSQ2Qf!9&enGafgW zwaKJdY@Uy6lW^aiT*=Atc!W_jD_?Nd3QCMlA)@YeV0$J6k^)Ue@d>+YIKfh1_|}=0 zATWF=sxmgR3}lJA?MNSFH4MA$rY8}lp>op&k!Q3pad>7S;9qIcNt{MpbQTBiYGDYv zy@BU50Nf0@4$j=(%*EB&+}Q4al!M7HI94ta7LxxF0s?T%^5*uIu2v*$yqsLgxA-(b zwT_(2MjPti>)M&by-kC2L5e;=^cgedOLy}md_owe8D)U4AD^e6UKg>Tw&hd z@~h#<4h_Lg$LSd*Pv0bkDf>F+C}m2mcM7D&s*gnakN!A!=l-_AZpHqpk)Cls)H8>6 z>?L9a{;iKg-nd2%2BR}-?Z1BSe)*+*@(p{#p$6+uB_1md6E6ho?Qo_%ajQ&#f5>G| zx8HZ*tN(ic`P8G?&uMhxi6%Ex9vXFOq3;iH*Qd5L0q0`zV)nmc2nF%ZZp~VFR|z+B z+?}e>i&j!cBQTbBl;}OvVf=+nv3^al4+`UUmmP(6l|zWkEm!D)D@iO<&O&#eOrycS z%8cxiAYGVqrhMJO-S2x5!z)?=!%A;#=qJ;ZvK*$dfFh`n0a#_m>|O#Vu**pF%j`Xj+f4&XV^~Xu_;#g24$oL$b0?#r@;xHw0l{sg zl3$`Q0vYCgPAtQHmrsu2YcU#@yJ0hb2mpICJNog1b7f8q80vExPeDcC=v^;xhR^^4 zBUEQQ7|Yt~6s-ANdfcZh=n(#rCq6mHg8!z@jmA=A&j)8Eo*U}*-WOHB(ExPNDeSsr zH&(W-%N7)Frk5Y?6P;UnZwYo(J?9Fk-(aoc^y1*Te^a#ohA&ZHLcjYJ3=BuIdn{s+ zep>V*yuJD+LI6Ils+0xT#KDLu-^Ft5w8?--mGFlD71;)xCP@5ig)1$OZ2@ZH(Q z!v(@Yul2Gsm=%GNCWm-&Jb!E=1mkND3iY9@({epa( zUvuG77o1*1VPK%siPfE^((_CWX^z%6>tZt@;Sa(?I63ZH6YY1y$hRc`E;d*3*z?Tc z7aJyrBquEA3H6{;WHggZf2bm;efDo~pARxWF4S z?d!~re%Hky;d;b61}aBc#g2^|L3FKT#gM>M38iTwt~b?16P9UjSTNYCgJ(QWuTE1Q zK?>sw?*>LU14O)nuxbb^gul-Hz%T!*-edmA@PaqHL-7kx2#p*Q^B01&c}P$6)KI4n zahSJH#X#T$`sV3(gebQ0U!ETgwLGv$d3)gD?gU&?NAXR_&%`4;CYZitmI`5qA-1=R zJa^HP*NvD8dy&-kBhGovdD11x)KJ2HSWH&ys~pZ$k{yCRx_|r34^oT-JYo88AoeK* z2_KpDD<_ujliQ&6mphT9pMx*d_-~X8Hwqm-TABg$7jhO;uZixk8JZs;i7Cs9&PqJ& z<49!dh=N^pZ63_qpDpFybQ7k{aK?Ob5b9~aoXjWn=VP#VVE*8-YfITZLPCVZAB}Tl zTuIO}Golxo_K9e<%%fn7(v5@JPZOZW{Ashcbh!bEXcrzv+*i*5SLyd{amC!@j0IiM zw1ELSKz=@4eufeyo;GVh)7Z@)j0-R7Vb|zn zmKb84`Etli8YmOJgOnZfPte}uT>v)QhTFw30B1HS%a$MMX4@E*Qh1-&UN~?RZ}{xB z&y_!rfmTQ~-rl^S*{427t6Z7c5suUoEI$<3W)HOLM?1b|Yw-~Jg{s&t&Xfy5 zvDuNPMWP$%%PyyS``G6Am>m+E(|ZS4uig;wzdM=I#Ix97Fd1VEp;$lZiP(ZEUD9k> zO?f%R!f^8Hpdd?U9x;H_FP zVRO~>dmqN@H0Qr@b_yjm^LGzdAAuo3gi)%~lyGGP<#4@>tM6U~uG+z;b4^1Ci@rz4 z{iM{SAfqIT{kd#tYsu=&^%@ltNO+!oT4wGdnQ##`wLV`5_cW4gebF@G7u+uX*Ig-5 zGbx16cuvqz`D&ArWE6Gcldk{@U4pD43u0eoPv^FnYd>S>^M(#SR-B!~Un5Y-2G6bE z6+(J4bh~&lo|wCnVgc5p3AIB7a{a_Op=ozPw|94%xrst-i5OOnU?5wg;vN=w8!jm! zJegeJ5L}6!N3O`HJd3g8mP`!|I=77$75(3pxZRh;Scqz@&}fhqY&n1qs+w2->bW)A`ifyAO0FaHPw$JT*Jr^vhjOVsi>< zdeD@rYpt=*JVCX(q(GXM>QiJFx8ACQEc6s;H3ci#;3^D)T<6m&3e;@R{qi-&NB)WO z@;#BF?(94Hs}Ac087N@rBCO^Yt@x6V_|${$5$wrwA)#d=mp>&1gdO8+kRVSkNfXG! zM>;~X>s_pJjICpyGo;<4-R3neGWO|w^7#)ZK{%?)FEh4;ZoOQ;!;(?A_a0)E6%?u7 z2C5jL7^;LIdAPMkW%&0ky?LLgRBT>G6_bU;FGEa%H5$ck^dA82JEYmiYP=5L$~}^m z(R1}3NKnEhvVX`EERV1(iO?(O@UMqTQt-+U)iaO!vNFODXm`ZbSHJy~3O@XvGVHzT2ZkPp_mN}b0JT7s=se+if9)ulOP1D z{($=HA`0Itcv6+}^D$_IgcjbABDrs*8atz#8o@Biv{dO~Vnr`EQ?q5m*;|4%>8~S9 zA2T=a*Za9saaNvIX>v`Sb*`?@AY z3={lgfLcou??{^;3dJ!o=7}&a_+9`d8fHjr*pw<625VYx%M;dudMtH{-H&mbAo=rH zDeF};Gb7-@cEr23{dr)rVh_LitEK%3kPSIJlvJ{X< z(Slp|F2`+j&Yb#|Yv!^-kZ(8mmMOmxPR}pt3ArIIp7h+^B}vPcYrg$^XZ%W@bP4a9 zRMf3^1IO5_1p+1WdzC|Qd)g*}nI znP;xO_J3tg-H|4e*SP0Asps?Nzm8# zoEJ}ofYK`9mTjI3o9np!e4C2awPu9&uZ(I zXw!OmH-DB+Y#6@#a?vZdArOs4^vAm%!SDFdjR~bvgxW7Jmq850 zV)PPw0*W+|^woB>DfmU$;Nm0T>D+)XR^F9u>(Z_KCScGj!Q7r`AlgOPxsb+qLc^t2 zAygFsO?nYOX-k?JCcXX-&wCg()iS8*CWG-pt3p11*o+rQrN(`yNy27TtTp1aySH3h z;f4#wep%F#IVgw>IcRn;L;(+YgCDnybIFtGj*rVT?B+srb(8;6ELR0kmJv(gs%&b) zOlEDYM_@7bYyNLWCy4Of216^2%AHCEZ`J|}oXfER={U?jmxp_W8Uih(bNhn|dhmp` zO|D9KsXQSYSPg+5wt6mW87(OW4^H&|NOSSH&Zmq z&1}u1=-akUp3w8LWk8tOxYxt4)lBZB^{&xrt|mQ?j-&OTCbJgzT5Ut*Qs6c zR>i;&_EDOK9@w;G_2})HCzkyd&kMHk2cz}W>?))dlarw~%!2DGxGOfWJB-Wh#@*B4 z3#c8X+*er-e&oTJsMoboIw(gu#NI{j28>T2*VuH&fR^^v<~BC=x)gE{@OG>qugvZS zUOeUxABA=2l(!fGTY7CwPU38RwpvA8P3=cdd+vids#peWuSUtX($+9>A0r9M(|u}r z$o*-K5_@8G=A9u^(#%i4Hf^8kz>7X4kLXD!ZQXR5>qeww;l+>)+k%?#*4z>CO;=X5 zkjvOEU-DMkrP*nFNxWm+_G9^@z*gQ7;6rwT0iKTI${K3GM zel4yf8vsdP=)RV{5rPQ_|P+)pnIiJEKVzZ-s` z^{*zG(o=B4*uIwTiy@NFcbk>;7~)55I9d+J4~$A1Gw@PxVdJCS!LZ9w!xDE!sMQl- zjE<$);|w5x?v6{Jk%j}NHoi4QJ43+iWuYyCIEXp2uY(y#D=eM9jm{^{Oqw2t)t;(V z4$pAOrEVWwZd1)-8o^;UsW%Gmec<9^n@r{$p z!#ohNwSKe-QJD*?BGU(?2eAuH!Dtj58~$h=)%Ys_C4I#SxV9tnqsR=l-@!9bRu6F%QE`bD#lc3HWXF{B~NQe`{5B>&jq(QK`7-abmLc zeyZMBxzCZ}$hYibni%;RLMTXM@<&F1iJpk1D-Pa2aUykd#rm*<&A=kL41tE&Nt zw&QXGcX{G?qu8M;{aYb9{s&TlhI-dN@Sg}~sR`h!F))sp7b*h7dv|D5myYUV8)QH& z8MklSHPbpyH*OyP z8aQuc%w_S23GJi_>k|z6eta%5DZ7TXu~=(j@Y%IBOk}sT3P1 z+dt@%+&_oFAOe#RP}%$we@HggtHB3wAmk{+7)ZnOp+V*9y6JIz^T=gC$0h&+v*#WJ z6wtmoO&QLb?x$Tukq)GvlmF_^`Xb_{Y?lx~Oc2+`J+8O1ot_(^l*Ev*q*2tb^%^y> zh}#t}9N{7a?_M*AII-A_x?6q_ANr#B4O1k5JB*%Kw)Hye{S%W{ zQ+n>h!D6s#n5;NM$i&g*jj96jZEf6Wgf%B?&9hhv4yY~=1vW``6!Ou|Ly(0chor?n z#UXW5rv;)$#D~AnRVbp00>YMrq9DX^QJl&JY}94WO8hMndwPoo3zx$az!=l4s^-FM zL-V4>v`_3Ju=<1d65wyzVHOlhM-G^}E zL@23LFk#|m3(wY~QF2>Js_AD^6@`jiq&j(bFKZ@0KclfP{s7QYSGug6v4oxk%Tr$* zy>RS~34UUP*yA8formiX9|R6T?)OerWv`DAbvSuqtWx4T$kO>b_Ktcah$U2bGThb~ z|A}E&|GS65g94)@J{Rl4IK5*Eha?Jusrjk><300U_MSu7Y!?hJ6`=~U3Aghop9YU6 zI=5{k6NYSY;|3r~n~QeJIQl^Nb3|}0AwH+Sp*MB-pZ8w1Xxj7Gx}~c^jp@Z(Gz~LV zS9o*`=pm=eO`=vAph78cN2*_>xeehpSdDo{U;Yzyo-T|OgzH`C3R!y>y>)dq3&7gb z;_M52(Ir0np)CIJ>9R)oTo;EN%o|@W9aUlo8d2yXhXm*z1%*_GrU>8m75CvsKXHSz zS{9hw^wfEF4KgNc89SC&04EVIjM}e%diErLSXWYqkwa)3S50Y=+^Qf+qgM*b(tS&v1p=dtFc+}{K1xXcbbSk zEF*Dg6i5&@es%|^0H<++Y0hF=#c=M!l(D~}8)j?u-IP(C6;}=P+|u92u4L>+4GF+Q zMcVi?eHvcF|Jn8A`#rM#^^$0+gEE&`lf8A(ISnvKE02oeRO`#vMgciOl|Q!0Z=OEK zpD9dzg_759+rN+KR z4VvMpB+}D+dz|mLpxDTMzX40TCn}M)^FBhb=o(~5HdNxZk5l1wEy;A&CQx)RHn!wB z8lnF}cteNH79`-h6s856nB&%VHSMyy*apt*#6J3R1GN8=g{CE`tnQHgn>KBO8IVc5 ztDnx^bk`vw%PgRYDi|SlGq^PLy_Y($bRtO8p_+PXwKON7^72hPHqW43UHvQcu5@F6 zv3Ny>s*@Mie zr>V^7n3QoUop>HuS+RasXV(Au5n=7t*7;v+-DYbA@mN>Ed;FU7+rUS`IN$Jj`_Io_ z`}-eazr(EQtfR%3N%UyJ&Z&4W8?>S3nUHihJ-}fU3fYWOy-iAFWNzMzB3XV_>Xia4 zz7q?&kFgeeX64l-&IsO+C?mwX1O6M_IL^P zCJmM&JoR+-yj^~Fo&%S){t%`k6k+*{U(EVw#n8<4qd^a~7%yJH>)EAPs01LjN37cC z*G-`jRqC3+2FLXLPF!pF=>t6Kby){rymCbh9@CQKdcdsP9C+zN8N+NLF{wiV(TwkG z)_)35t#5j?U%h3LYQj|PHj906$zEFg*33~6i zhfM)YkB9EXcAUZ*P1XsGO}L+}cG6MVG<5epccD5q$0_KS!k~rc8xUZg__b-b^GOSe zo1J}vnJbY53R8!Pv+b(co`O&W4vrcCEtJXEAt!zFdhf3_04k-W*pf!A8U&F!Jjogw z08;nMU`bmI7fb1tgB&Js{Lv9zG!U9>-@V3WG8(x;m6KlmoY5yoBIY`mCyzp|tB)iF z4i}nv)`Fz{rWcwI3CI>5kH$J3b92fwU4Vj#q)7?L-|rHZzP1Dd3G0NKnE1n~L{bM@ z;6NQM6$xHRs80)T32t=CsUN*2%EG5Q2Q;h9@q%;M+|Kpg;`W-ruYia*zgocK4E7Z+P4zVT8&tF>c#s<%J1<=uM&`u;$4fW?cY~}KJ z-V+>QTii!lNUUIdy)!}`%z~B>7}=zf9>UWgrG@^YScNOiq4Oc4UxA7*A<++^oIoLr55mx-7U$qE7_kxE|G zG@!_l2VlM`zVl>*YC%!(k(lLN7>1jd2L;;sD^3p@fD(RT$g||f(H#y!fkbFCR52q! zifH7XWqObgSp+pkD*4nJmB9}qBwq?0RBkiz96fT$)I*n;G@cKCr|jWdY7T6wxXoL+x|aG~HK#zxZ%m!|yb_5>GnpaD*_+R)Q(&ysv;TwJs0K~x*u}VF z>qsa-mK7Rt>J8Y_)|t4gN_ z@J?7`i%>(GFzyQqt_z=Y4@41O%ST9h=Xh(G%(F#D9S1sz3uwH_cv4+*(B}VTVFt=A zp$_6Q?v2DljD!DW=x;3>9=jG{rV}=%k72TLCp!NnDzumVJ&>}W_ z;1P5Byp_eZm2-IzZc(Am+MQ(pl0ZnIZ5W3D_jpD{{j>kQQfFCeVY`S^h1MDYh} zj##e&Pgz#60Uey;m&&*wAZ0g88~xAGm7meypokJZ_5XiR%Er}*%;5|Q#>Sl-%y|vQ z&YfKEgpSI_!ol_bI0!ZpR(7srr2=dS4jwMvXO_Ys`BiPDnyY}iTZ=#jeLZ9MN-uFnN6^AHNoRMC{jxYlSfrv<{ zRwl&^aJr~Giv^b8(gNk^2+HFL$@>Dax(b?oaRK(t+T?};@dNBP-8?5A3!&Pdawh=2KlkbCIV{({^ns* z^@9V%4Zd!_2jf?Zg<_2eG|G;K5h53;D1qV6Y|;`E=w2K5fUGL8okBvGJ7&{R0G9>) z%Z~>HNi*&{?7j8bFt9hFCnu1Ks)fs4B!VBu1c?P)FBpWl7*jiEBRd0BB;wRCOvFYS zSl0sb;8AQ5Is7?aI$cRbbmbvId@padKY6ow0xq)&bO`&FfX9(1t&C;Uw4e;xm9>=s z62-V5z#=uQJ4j|%ZYTeG5A!md$vNEZ2Xba0X^92UY`E7SkC-z3p z4$TYdxw5+Y>In%#;sY`=IS_PN3vmWqx##ty5&)5gJ~vNIjm_X0-7TPZP`?8WdJ+T( z1DQwyl7rbt*6;sBeN$2(AqCK`48R&8utAF_d`SS9!4qGDwa?ce?%*d4J#oa)0iU(g z0C3u)m{HC+u=W}Mx~(-qRY_7#Thjkpbvn72obpl zJbw?VKm~pOgnlPB)QQMs6xlI6{F^%u$hyBiBg}mJh~j{J~+MM@1K76yie9wa0^)6j~w|M60Tb3>}DmVFU zLXLcME`oj9xDDD>D}2`~E&;GF9q=Y7F6ZAwXh{kGH!oe91tiNbUH24{b3CRZ9tAhf9sj405sq;wo(d z5K<}<5d}~WpYvq}ZG7dLfZ)>)ES)Yw-mGPF_f9Nuplc%Uvj<|AY7-y1E5C9uj2Z({V(C3ptf+p31{#gv3Kn2ZO_0rp4uz26WEIS z_l%8vv+w|-k=nO-t)SIM{<3e@e}ny{-%0;n=nfFMuK~^B)qN)XrWH8~L>~V~0O*}B zSH9K`pCi_1et`pq?_c|qeXqI)=ZK($j9K09E^SVCfE}C5wC~Ds4C&r!3_PpNg_;pxrUwDG?^ zSXVd5zKk2U#4mWgr_+7iNA3-dAfKbpe1B~fYg)b?JpsGPSK^notZ`wayTy%5;uqbj z;q4dUMu)wNotrnPm-o{L?~Cu<9z$-D1pE;QYyY98gP#fJZp!DI9;_x>X_qRyGFf)j z7*JT#Ug2EF&>SxkVPmzRl}Owsk>Hy+a=%p{manl#{s$~szvDOYq3R>c(>=$L ziIy=%%36UtwNnVW6se+IU=~9m&S{7PlrkF~o)(OJDHH!~;c=2ebEy{Fxt)iK;<}Kg z223f3bL!;XI{uK&O>tOJ?3WlJm}-Vi)vlAS5^&p1!TX^zz4s5NJt0DjT{SopDv`@I zPtXHXa=1(Rbf)%^G{{dJh*W);yiLGCPesJL4fL~Vu5t&fy1@He5NV0jFF+xk`m|{& z5Fc?@UW*i1(5M4{4=3d z{4Rc1J^NStwi`MUU=e|D8i|xnD+av+Kxy1-V1Wm|${4r1O2pNNA7J+D4eW{ucM0D&uZgL-#cta zp-4xYErm3KJ%tIqpDMl`VOA_&6j5UH5-=WXI;<0CcYWjYrHe+!&aNK7Wf=_}LYHP7 z-A!K1egeXBR;QM{t!1?qrK{iRZooCAsdE;F#v!)3XqxDj01^?+X(|Z-mTmw#Da*0W zFUC1pVWdX-#kM3M>FUPa{>aXx@_U$=SqKJxoP2op^f2dShUGdh_yqbC%YEcCxpSfd zOy$oCoP1LfIHlTKE^PE`J~%Y7y3gt3OmuLTbiK>=SH_={A3g;w{QYsIIE55HJ21*3 z)gfW-PxU?1eSbzRTJk*rAdu)*|ISO0$k6&$7wVhXYwX=?oUr$lr>U)E&+62v+%$?5 ztrPf+n%X!K}+WEoQ|Qd{z+XiE4Y4ySYp{* z;L$Cn3~{gSzKuTmMbyP_pHVjqCX!yTX1l>()!;yox?^Uv{KTFC919m#!}%6TJ=4^R ze#;6bnbYw=arNcMH2bD`svm5y;T<`ZDMz$pOpvcsj9vrU^bW+gI`4K#v7D7wA=+J7 zVG71nMl=P!%BQg;Ifl+^Okn)2$w4{Vf53WTdkME?$F4!W3j=#8q#Y4_l&nH!BFHHI zee{+7+tCwl3j0wEAX6BTv5MYI$3fj5c##V6_C%(U0jr znEVDcQtXSF4_|0GAWRJ|VH}VHL6nO2eMbdUn z#p}@%Ci@XJ3@P#(oD1}jWatX7wExsG^PcZwbRBey|Iy`a;UU$HG*dp1;wQ%)g&zGp z%NWW|)efN=)RZ3hKygyzV;cQgzaHZhLOWrVq;m87Tib}#Ig`^G-;L8N<7c+$0&FwM z^ObxYATteRosumPcaxZIRJR_5!tXsaWEg;^2n%UM!8=>L?hdumxa0PSAD^U zt4J)R6_!M!Etz42@a&B7TS15|`P#gL?l|v;Ii4;`D|qAhd*dNL>W*{33}KdfvT7du zkIK&0cx*rq(i(E{$_VIz4Ty!^>Yq*A#jE^Tpv&Q3FI!euO)r$yhug2;XDHaD2*`w( zCg7o`Ki!MLHQt->qa>yNf?9^gR~P;p`b#cEtrRxy95Ias+E5@Sa12>Daz;ZGC)qr_ zH3cUn6XoJxe3{~#d3TvS!b08J$%w5-I{tA*42qhIja~n0u*xKbV76J6L`p%S&wI}w z3EVA2hVXd#M3h&9STJp$H5Emg59cDte55tYET-4J1lhYSc=s45)4e!kOFIQ}d?{Te zc}F#8`~o9Bno=*&EoCQ|s4Y?(qvMLrMs?EwFyPJ4lEF=wh3d{U$oa5D7frcS; z>k_@nFGqpM1~L|+-lSf~?b{Rm(1p{95YwMF-ra*gTenYCObT{z@Zvp6nV?JQVf2pJ zWFIiP&}l0$OI)$@BgR)^-hRSj`Fa-^xm!~S4r)?FWkYjj8%4A7*}@Ryj~Iw;q6jZRzhspj)b$`4RhP<7TJU4tBWOpWsS!QWopQ;o#)F~%(?uJ5Mfp_9VwX#jL54Ixv+*2w} zF($F7LVWFXZ*TKhbAKOhqn*)_%vTRr9`!WOZBuEj#zC#|#;Z&Ybt&SKv5-xt0;A{{ zdoU%b@L$97O16a9EygIh0H!}(#HrUr4oNT0t1lg6q2abV?i$t~|2&pRWGI~X9x1L# z`Dd8BOfKFxv2u7S=D@Za7c7+pOix{`)uzg{f=&G(!)qA$BJ2%oOfd`@_&s)`8zk@L1+?O}=lAUJA*NEhqPwG#eR zsfM}dOwSA5FCu`wed(_d`UoKMIU_0wD~5wUl+{8eNhQdw#|l3t6BRjuCsxx-2U{ko z;!c@Xflkx$C0V_I)uK#hDIj4%>BDs!wq%#|6btO{K@I+&(yBp~ozZWqZ6F{2- zrYp|CaJ9UHk71z#FjY+{aQ`iGF`(Ov!zLLtZ@W2GsPMlSwmb+N06hl#fZ5-WYI)Jf zjLV{=>xDkl>qZkK-+!F6KEsFJbq_AxR_|%qKZ*0WrDXxAdfLLTHdqg@^WlCJ8bR=%2+y(^&2J5PfbUvy;Pv znXfv!^Cv^@GQ95K-&K6H&3d{k@j2mu2p)2BT%`Vq4CPAf&RwoV?AH-M(dGwwU^|6P zIBcMMhcLCZl`@(&D&c9!xboZd=hMwRYFmE~_cqhKKt8Vhk~3xaYF6Wdzcvd4Jfqoy zE7~NPw{!J35O;Wof~+{C7n_A}66)M(AI+xca47F_mKArapLubGOzD?^)?~7*HZBu3 zkMZ5Fm*!NAWvIWG9?@yFCfyHewW4`tRz=+xJ3wbzzGSAJMOp?h1(j_=a{*O?LEDji`qv?5wg$$Y}3CnkhF*KnidR@qJLYfY*bX0 z8b=4}NmEtL>TlnK8}#!HKTH@j|N4j#RJF)ctLMk*IP>*g+4VqIxD4gM-c9C}64mUJ zg|MqBc-}B^64pv9(&!0QNij$ZZY&=;d+pS7Ovb4vN~&(!^{j|oY*u|!A0Xr% zpn2{C%&|PO0@)dzSRco+I2T#zu0Pw3uhl|I9XjzbAHC<8mhq%@i$)0jm#BYm*w=L& zHLKwa_oa0SL29FosI|$Z82-i4){#^H(^1IHJe%-AWr}B;lwkS-Qdl44>uS+8w_K93}sQH^SWamSmLXLbB#s zSCQ_QvqPfvUS4pnueF>u$Bd95zcxc$Mf>lh6brfamM=OxxVACy=~e1vXbeJxgND|p zCt9(5OFyF8H+qnMpa?!eKyZiKEHMJ>JZ<`=^oEjZ`BA>3QY=p{omQ(HU3RntswdXK zM`Gy37h@5J(9QcIGtq<7;e85FappbpI?;8ty1lt(;~TL^6qxm?8LW!QMmYvs&_WJW z5cPiXePtV%N**x~ixviZ5{3+kg z+q-dhe>IFIwYZ1S_d&(Ur$^q)^5f#lD5hk^wvBZCcPWaJlE>$f(%)PtM;daH5h-^Ko7Nt(eJ_Jv%(!jIt%*Exbxxmv)N{%HE*p5N2oRCOny$HlH8A!jhoKX`wJ- zK9}WR&|NBmRdlv_cg=NhhJnS3+!;+GWMaOl!tLVD^jMGEy{1*00Z^2Z<@Z2I$lu9> zkrsD~dPX@dMZ8>$;BGn`_;15kO0j$C_5mT{tX-GX5|K=V_lWqcuyPp?t-8cxg_z6u zUGUcQGKA-FHEN^a$GBqrm+|Yzi`7w??BnX+2EEb39zNupavi2MAH zb5!aZyK0(N)~c<7re6MytIp1U0Ut4^sEEEy@iKLcb*YxZICG7 zUJ!F!kq`96gQOr$e9>5i*5t$ZX)i0(+4M}ZgtH&|DYfKP)@^7}ELT3ca6WUijIjl4 zVp?x{po@H|g+7jMtUuc7bZI|)GzBLQdGdL|79@oe!?>z}!4b=?mG=0{&U9oOHQmB& z4JddBkNO!aBDU0FC6GGRr-75!V@r=lF7amUF|R~vO_xG^GADz~pGC)C;=OeUq?*T4;M=h2(DI?`&@pKtY~e|#XuGVG z^{xKzE`9u5A&Poj3x;7pk5{^x?g!jb>!lE`MgKwF)liRKw11y$0Jx&lz)#ObElJFK zrsJV{mmR#eQ7OljQ*)hrO+-@N{7^E}x)>AKXlAuV?(hBhv~{ylFe0Gg_f4_1=y+S? z#EKtfuI1QHk*R$oNTVrgH@ve^H~ro!%GV%^HRuT5WD~Y`p~l78dgBaNNUP+m2u7$y z;>9;8Td2X~jeqVexHLVdY2<-xp!vTMES%Qz>Koi9oXHONw3fvOI->_Orl|^btzK-@ zQ=SU4!W{aHrrsgYmOqBf*Qp~WKq(L_3Dn5=2r~gk+kiQ253?aH^tDJYNF6YPlP?Ye zr5269`gce-@*r&!G|2KkLQ6w#DI3o2Kqabk6%%~^F@MNCb&{@OVL*3z^KaLXFb&-< zMbq8mLzVW_-z#RdVen&hu7b@W$V8;I+A7kV1LAMQ$kQj#ggPM=dp<464%Lb-?92Y$4JUgLk}(42Iv%yy~}eocDrmn#0#W& z3hLHkvq|h8?C2#XrOD2+vqp)CAbH;h1dR; z94_yNH`~slHa`4->%H|R8>M(yg*PlReL}sOi_=cx#ZLoGF`Lpo;5JRgseWY>3yZ!| zaDP9}%xQfrs+NGAd5^x0LN@JlS?w`Y!MNXnQJz5-p9WoqM3`NujK9zAy@f9q$HCD0 z z$f>onX_6Ep%tG|o(g?nkGuEg^`v#LZn}0R? z9S~8(u{j)1ad3OvN^rhWb$j0xb|NHy0?w;TKz7AR{X@2k~qJcnqy-<84bdc*fJb#EO zho#86p-nu;^lQ2c_NmC0cnN$gr`V8+CAxIoSW zB}c>bQdYW=Y@S32rGQX^*vA_=Hz(!EOsZRqFX+}o?mh$htQm?OylzBuSto^s+@5k3 zFzvzP8+Tc*nB?#>A`LLz)owEHnSb-^g9Du0@sZZ9+BVZxe#G24U)tV1Y^0%IOP*nEHJ8kt9@IOedVfYMeY}K?Ry-T|4tcu*k$){8irK7Z zyWp>evo@l?D%D^-lU_?&v8`9u8{QX z4zh{jBhxQreFt8ClJ~@oYJb_4DyZkwrSA-7%ka@MYMv_sgig}qLW-C=`_}O~l$i^( z>ua)bPI(;IsKUd=zC~$i{5a;a19VDht7h{XZldrE98?zDAd#orngt_gthY921N(k? z1RIpacinmHZJZt%KO29cSd)?2L&7%{kznl|pUiXuHw=z4-)T{c5Bsb4Q-?Rkr;U z)DK3=!G&5)!9DNBPv(GBN}z$OUQqF3qL3zC%A!c1dVIkWC;Z~j?4`czG&$-xTk|wC zwv>UHgeYn#R|Dvf`G5B||AbZ(x^Gnt{Z3+9hI9K5UG_{V;Y7AXU&9kKt`)Md5F zPWU6--jI91rHchtLU5p2;)QGvLr^{r{y9OcMlk22rh|f2eY=0CIFz8}7?yprUHVi= z1=!3YNvRZOcz;@ha#2)7V3Lr=;=>?kF*x0B|4VW8VEnd7V1(W0!j-b5Iz4O{`mS;W zjb%RsnMoFS_bDc80U@JV#XU2ofuCJd-wqI%zMp$Zxi7D)*rL~Q7~D+F&ZC`52V;)I zC%$QUJDR87i9Kn~ru4=BqiX?9T7@qf2FHX}kZ}_nRy6-_3(Zs_ElO1KDrhU~_pRm{YqtG_53~H}h>8>86;)1ISDrh+ zfV3qc{5v?uzq2r`qb#{P?oU!V1Lq$ZrRN9WAXTUMEmihoA$loj(=3eNspG4xf>1tj z%8`wbvVTdNPyc`;Jb=F4_}CvihEUTKDnOMyOJb08#1=HkW!SYAGpL!_Kk_vpW660C zX}Yiz6R@jEr%iE27zky4ZRRDV^!7-#34zc+CPz1onyEfn0Kha!Mle?b_F>jHQuoxL zVnurx=8}ve>xKD}`q5VxQ@Y=0)E;G*m361aBY!NVm>KNCMz!4U{M9?<`}B5n>r;XJ z2c8>?!H;OrTH-2@)EvB!W8*AqoWS-xj36tCxZZ3wi>KkDv!SUNw+3IPOCt7?bB0sw za%CZn%*^oQ6I|{N+I{UDpLsgI0t!P|4I5UkmaEr^Ey8SQM_S8?H4HV19RnB{(mIp%hV?yNq zbd16dezzFp92s1Go~=ST=I>ItGsF5v2_(yx623O4b@kCHphBxtx&Gcy4tr?7wp*!;$}E6IT`cX!LSRomrqUF?juDKS z5WS;h$>YD4*vv1;e~3SHQvyWw_*up=DmH=UdK;}pbKBdNv>a~pM$7;5^VUz}4eGI9 z7h}Z5OhA)I_#!s>$PDq_p5x6zvwvwm)KTaPS(q^rRQz}gEF48=W_2*3jfqi>gj$kA zSm;c82ZMS!Iwx}UxJq^We9O{a(V^D4Ptc7^gdq(T8V_6iMU=m^F~8t^_00RWv7x7{ zTXZ)p43wP=MbJl>h_45vs;>NA24|?CBk2%BAT+}$d_E0lD;h!huNt-=7=NBIKl@2& zwj?3inqQ z^cNY8&zo}e*qBn@RmKFxb8yldP$U3lTi)i#z;D82TX~bxsN#-3Wpv}9UsA_^AM!nT zN=K_&JtaEgjpo7}rB?l=m4A+)$v%f_vAv(%o2T$WLH*Vd;>TkR1)vos`yRbOkm@W2 zNdO2YG*esB(BeVf0hrfX-%vxd17p$Bcj&Q=zC}~gr!-G@8iyYV=-bpemsm(pdwwn1 zXd(47V0E3rPb{7Bqj(%>oJpmi%&P_-2-TqnkyXL>dl4*PELa$Foq#yPO_EQpSyXXvOb1O&N zq|VHi9>PKAqzkNI`G2f!GqAvB0E>cXS@Vbv=e@6*5YCsX!x|*zLW=#&eIV;B=9_Kc zJ~v7xsnJtj24Yb?%bzTRoZWF!IAq6oY&^Q7{oW7RUOaK7Pr~!aV~@4`Fxbq3tH+E! zon&-@ad?E*`Cz^ntL8rJ;?V8Imq8GP&AG#$_9Zjj(FYaXQ-7WKyi3rW*3YF)KypN- z74z#wnOJ*w%Hz*f3pmAs4~2x*{?b!o2(~zpc%BFaKZU7v2gp(uT=Ti0AK7?-FUQEz z;ofRSw!^6twL)b~)R&46;+JI|dwj0q(cpY8o3Ny<6Fon;uSkT9Gb^S33 zb%Svo!%20xdVkI-IO3k6{aS1;mv5Xc$H>?Q7huwPk|V4*ga_aK)>+E@;!DU#THOCw zB~Br-Mmv5P!-mr?HF;Ows_gKT<%25Rw=dJ=Ez~v-f!tmikA3J@C?Yh{=Puv?;K>(Intx8-;Fr~}sy(0>{2W(I%1atn&9mTvc**h z=5dB8(XoVn`6V-~ACbgrD#*LV#npfHJJyi{bWwM){X`@(v_anU8%`6j?Gd}9u?+K& zT`=5bF6p*?*vQnXW@!scNnO@Om|Du~W1PextbcE0#%5NLfz^A=vz~||!j@JOi!1c3 zZzZ*isbcv3ID3O9f{Es_1eY!TY*v*76Ng99-V*UG=iZXZvT>XCpw1F5YS0Ut+zpZ> zU6l*Fm2=vI9JXan&D*)J)|b~KKvu~4p1Aae+s{K04s?z#cH`3ip6h7YH`GRl_6T4| ztAEyuaMDBc7~|%@x!3(Xkw33uo@)nQs8_QiagSBsq{z{-kuI*Zwh#EN`6cv?v);x@ zjOj@W%KZ9lG-*oj8a4de)LduQoXLn2Swh;+-+7qD%GhCA(+*?^LcmUxn@|P5iW2_e zr~-!iKSv}Fea4x zfa6pL!|A8b9dlcIedb&qD9}k%mr?a`>d|t=z6WvVO@GN-y(0EP4@EES!3RAvx_{um zXYg4pQ6*d;yTx)8m~zh{0x3_Z{k$Q^3K#VTbIu6qRY5_=-0A31Qg-(>1RxF;LQk1r zLLgp!Ku2DS3-!bLhI83RzmI)RDXTYAT)gK&m7U*PQVu5T$}xF+Sh}PAyT?^I@~L=L z$7TvB1Pf`XPY4u06ImO=VG9uvpnq-woYNFn^x_XQIRXXQ)@`9oO+LeZ7=+pkz(h*Y zma}a6C5zo!3NPE^-biP1L+9q=zEBUB6yCjCjwtEp zs9rqow^*!xd(^XUfeVi0Xs61(%zkU|GT`VO`*$_Hm~^63wBw0$4rRb-uu*9ka5%o8 zC#kn-WCf3kf}SrRp&_LlS{jXi%NgquCfHF6Tq9J6sO}}h%LcA|w||g^+XeG}*(K#d z*mWA6{7dGK&X(z0v89+@)Naq=gJN96r6Z9x4;6|hswuCqxRRo5N%eTl0 z5fC4*4!+AJ;3t_oQHglwL|dAjQK`VC=zAwV!*FQ= zu)0Wp(j!*jViH^@6#DdDTJ5Rw*2?xJq3KzSG?jdIP1y|n!GDf(jvxZZhqzYT%7s+f z?SZdUYm6Ys*(1v)(GQuF54WUX{cL?P6?sfA`1j?B=hY9hmL}#>q!V0mu2|8As-Vuw z;WNU6n1uLZ2E7DC6ND(uqHP7EyZGwV^h{*d;(BIiFXHVWHMF`hq;wpjVrL`Elxd-K6S1m< z&2{WYlz%26<&x(keQq*jP?SA~zEBf>8Sn*mgyVdJXnb!xlO$(uGeggd)-e)WJUM1& z7}c+!ZMv##o#LC$_Z^HYGfT*`g^xA>Ml6t?eXv{3Q?b|S&)@5NT%NW!Ni<9FJ#S2) z^F&%FF2jHB=1nuhZUr+?2}e0K8d7dYi@?=F*?*m8?i<|m=5ON;jomG|erBsu%4oI9ta?MZ0{ljBp8;eKd(u*RrKm7<(1mau>Y|Ir8SfZ#1$&_6gCY^3#y4h zLr~{EwaVL2TbG7|G5w5ysdgZhc_hN%gzXQ*F@o|GJ8_SnW9v*oHQRo&M(PcXyMJ3I zk2LT#vZX?XcCJf>h!amFg(d?nDgh}Av;y&F60SVl#Pu`SYwqygF}RZD14Qu=ZO^(7 z#)N?xly6(>iz@4X3>PU{wK0i;EA6d{-pIe>f)G4;1z#HV=jgq(RbNSr_w?iSZ(=ofBhRABb zeW%BW@`mD1cwU__K~5G~-5P%<;89?yPetNjl|J+hptRZ9LDEoXQtOdjH(tZVOzvLhqyJpBvut%|;hm z)#L`)ukzDF);c_{aVSbkw1;}shL)RWTg4jCZS$TxKF`u`-XEEvq+b)HY z=AyCsOV6^DI`Uv#SP$kY|9|GtdKe~n?6aP4p?ydzE#jrmH<{7=yia_v+JjNju)sSP z7X6_m^3l5cU6{ETz7h|-yjt~Y4ZFR*Q7=?qyXc6)J4uOEmt!JoNC#VGaX1e&^JogK z=;W4OLT`kIk+XJA?Zn++R3^cKd7QHp0PFME%uIwlA7q>D=ZKWKC4b}IrTW>I5 z=@U~~tqavpNoVvXZ|+`xeuN4?JdsBr{l+J6zF6T#CcxNR0?C>75A|{M*Gu=y4Z(}B zo(To}H%Scn!-QoPtMqCV((GuxS-w?Qd%3Hl8}<0`wmb{T2;q=kYS7vsC?TwTP~ssx zE>Sm=24gS=Q@ac01bN;hXx%av?P&TH3SzA37%x~6K!Ol82@pL$2OcL)&CdujU zsYEh2)GjO^ZwtF^rXZG>Rpz>L*OmR;q7y$exjsadXn#@h5P#PZr*UGCNzRZN)>;>+ zj=2R@B-s@vXNI*{v`lt&@ZpJb$lLtJBSv1W0srtW(;O?abV<68ux!ES6)G?4g_Pjv zZ-hDxEb`oYrBN->Pph&Z3-X5wc|ciQA8nI|_b|Z?x0H5E?Hb!fYYr7Q*g{z|E@!=& zk3uSFd6PNAW`FWRzKFRUIZX2?Ax^*jRPBU#Z(2rB`3vzwgos}DYC#>};-?WrlfI!R z4Rviw-`=n9=f34S1;mph*7Q5fBU|+#8k;`T1N59h~h0^0w(+>d>{gLtb*D}^}215 zH-;1jS${>xq^%nN=c?8H>Et{NSOaIf#Q+XtZHh;&TB+f8nL?;ES<(KO5Ec>@dZkA< zIayK0H?dn>REyS&3?Iw=rh|IfRM4V5j2YQ~XAoGEI(|LCn)bL&#bf_D z`+qA-p5l__zw(^M)Lx!2UQ%kCxVH^$7WC# zyPJ{ffjjDFba3`$I@WeA&hXn&;?IVmkpqDY3ch?T0TWWj9b?sa(QixFd% zWzmrlXLoA5xPv@m43insd5N!PvELHY;x930qrMB@jdgqg z;eb%azARx)%jKC3fiNY9HL6@wfN!*Ez|5$V{1y7F1OItxxiYProS-2mRDGPRYW5b$ zN7%knAWEF5+faD4j*{lQFEb4UJ%6k}$fK_>3H>V)r<#KvICRyCaRu%J4tcO}B1eDR zhZ?^IZ&)iREmzy$flGXMd&ArdeSARG;QQS&!{YZI315j9&{wz0uw-|k<5yxkhMg;w ztjGelxA<0#W}P#~EuuFEg4#M6MOCR$Ei^2rl3)es$_Ls8{ZFQ>K@j_{A%FN}|BaY= zClhAb+#WWjZ#puEC6fVEp_|kBpq*EIFYV8Gm3umm_maxNQEdKN4v%S%N$AWNmXSfhC$kxdGNkE1ltM37t~e zTn-q!Kj7`un%Cm9@#5t+V5r6C<*bi&+CqT^?w5oxnv8IIzl125PvM? z6HP1OucLcJXZ6RBm^2x*i=V0*rrXKa@(0yEwgky4QidNCS@K-kMW*PYO1LOYw`-Nf zQk0QR*RQAR-(~99N3g(nQ&z;vBJn!$ZqmSssrz86;4XyZU3@rt2UpqtNUYU|dHFXxIu+}l&2;KiEW#pX zty6bFLGyw8X>(0wAzJQ|VjOHS3;ng19 zZw)2@F|4urW-|v!r^+GLxhr}w3hXJ)`;X0vNY_;SQi-Zo8m4f$XXy-S$F+oAqQ=Y- z8_&eB6zbHCorADL+{@t&<-c)UJrr<7JMP+dPhikhm2j2JMqTN-Rw}|t`0ckIH3Y>2 zHs!rt*ndcF6+c;CafjP*N&L{U%7WO(AMB50U?tWhR;724*9Q~m?20(z?Ir&%SL=>* zx6(AdL3x{peN*P*4ZAm&ec>H7M+H~QO=)=4mjfIs*SvdznLPFE8SGw2M{XZ$;W4i6 z@CH0XE6=GB(nj9hq)R25gmFWh`Cy2&6gR8Jk{h!BAJO021qx+uWOH%RH|Tz73e>5WGZ!#gCp41 zhWB3F0Ce++FMcmZNSXRrxC zju9YjYXfpbrV_Qab8`TjnL}Rl{O1usV@wNR;o;$;|I-~HYz=Y%8v|_sazKbV$oe&- zG0+O2VrvWrLEQc)1Pz}#1Y*a_#N^`Q!U(i>WVCfK6QHFBf4G1l<^W}oBgnxSWCHl3 zWq>@;8uWK-jL1{~RdcZ8UkVjlQ-}-D0R(szSb>c}Hjb|@PBtbW2f%A~fQpnXK*0`V z^Ov#gUk3DmzYhn%!pQR9aDRLM5eRJar!&yl*w)$(XyXR9F$0)_tv~<;30X#nD}){Z zv@!X^5NPFSfBWhWbOwU0fJUzdf0hmeNC+zdfUh0?-Jhee1K1AY$mj^R`lCmtKf=5o zv$&0ksI9d%$Ohtw{6~FaU$$rz{e8KXHnuJ{?*AcEu#Ji7A8nX8*)gfvfbE?? zQeuDGyo!+jk(q%Y01jquE;epX0LUHyay2$*`Xhm=f14fXPbJGA;@2KL-R*4c0H&{P zfIPvbpw}N{cSoQz2mo<#0(rXsTk*ey%)$aN0UJXAMj$h=4e~$HU&SEPzxeh39l)*t z9p=~ZV*xP#@%itQ-s^;!*xFdR{bT;;6*DP{tEf0ZI4wypqo1~wJ|11kqJ zfQ6Zre-ps<`r!G$aTI~zzw2QB$5+b6)b`cmuXOVC*|2+gWe{Tpa;D3Y3+rEx2 z2tf1Cr0X(sFdM&qvHX9Y_di|!|Bd+{QT|^i{r^@Z;bdj?r=I37ga02r&>C#z_P53B z=sH1O*Fetpbs22_uc-#;uicdcnShy{Z?zP?5rUuW|#70~f@5tQ4GWi#>0GL4k!q+5b|H9Wk!2iP6VlDoK zuUResg|BI?{)Ml3t^dK-Jz%o=7ry4TfBhG}wrck;eC^KRU-(*v5DR@5(_;n68aV$@*?)PnX7Xb?%TDbe|2u` z*9@c*`(~s@(X%ht(9?15H$>#K?;D|VG!jKfc#9l*p%jV3&^nO>P0V^#sNQ>gsOg@M zbD_p6mf(^OY?W{CtSU~I#UbKRKiX7=G#L%3?r>bC5Re=-PyF8*nNNR0i>H}&OQ)W@tM=U=H9?naWBqBtsY zIb_Os$OEFe@l7Xqx{nlZG%eCY&Et@N;k|FmP2DRnxAjT7W8>)Z=T6F+CJ#3I>Tbff zBBAWl-ZU3HIEj0+0KY!CZS}TuyoDy6!o$40_}trTNLVGzBDvC7n}Jaye;YK5nbU*u z(Z!hg?M;&;OA?=JW^ev^a(f`J8hCOc?h|F__o{Bf{cYsdw%QY=dEoJvY2DgdWk56# z!^*Nh3E50-N67vw?`RoUiz83`oA`uy+|A=C4<`Kv!MG@Mq|EfUh!c+ZA-B7S=Un#A z5VUt9ZhLFndm8oIljA6+f9u=WZv$(-j6;&V+Q+*`B6WVT#Uy=#a;in8{7e|t9E~Gwum@!M4*$D`s=HkSr7C3*dzZauPMe>a0Ce||9 zAE3|CcuWv+%>7Qj*g7F-v%pg&p}rQ-M0STguG!$eOQvt;QQ>^Kf6C(S*Xqg^i~g-A z&OpqLv>A@KTqYkJnc)HjliHt^!esQ>Fv8RrNS@g~l)!GR??QmcBVO+axDkJ^_G=t* z!8_s`OqD-X`f9q~JszJ)v~AqChPFs)Q! zn=t26sF&c5x8L&;e;)T_3Xv@4$NBXgk47S350cOdm{FVhgfMn-Bs>pHXspKYm1^93 zhTDV9lT6P`DB%--K7kp;u0cU~ZvHcYjnFy8ylZ|LiKA+@y=z&aoS!}N8^pT$$OG=O z=EHy(WIT*QWQ){fQ?6QhIzVg{%0(+GTX$J}WSbPX$~b-4f6{KYwqrYbGOoDlp4@#) zue1VGRLY@q=>DnV-l7;`f`6|R25~{s_$jp7$^!TGTMSaV+RiTq5mbZBOy+|-L|qTd z7Rp0dxK=;Y>!&Ad+}lKOQc2dRNWNGI$X0 zSZ5|!Ls0`XzQ-F`%Z<{*a;H;$V+?Rh!SY$15Ulz#Ln2g2iQdJhDH?mY?0*g*QcBEs zkk@FJ1SW2x;O|Q9BT$a#(}Z>PlV=2B6j#wc6Fe6$e}<$~>B5!1QPnQFh~3)XBFuVd ze@tklUbHo75OAI;6Ds4!pO@$D{!MZEY3&g!%^ZN0{1@ejujKiWaDOc$?kCN)-LC`Vj&pr%z z_Hxl}eWZM8hr_LR9|7XGeL$<%N#ZsPUwWsJH6Od*o;4h)y}fPpSqze)I97wlNv9 zs=^MF;;^n{l{Jmg+DH2r;h>sPw%|BST(RGXL*SxG^GC63)Kf*@GY&hbAl^@_KSSHc ze|6+O1UcbCG9Togl_I=}9=SwF?`ICf+uG_+pB3HRY6ux68|!f-4REnkqlZg1E?iwH zJbb1wdM(=L1wc+L$a#%vzoOWU8`biw(k{&9`aatBUoK@Rr*|F6>j?4Yu-CzSYdWwgMav3^ycAQ3e>{kBnq@3&TDGJfm=}C(Rs}1BSj^8X$7J_p z$b&xBY?fl+CVN8}jMfB|#;wvuryXPM-gxO@v^Ly*&JEaCINhF?U_UIQYC11OxLt#T zw-J(0C@j0tZ75dhHt%mY1}^P8z>%5=X+(h_17AT9S5a|uqd zsUsb#eu%j;*5WqckCFQDab?vkfA;8lB}uzUw<(}?7;^BFNTQFdcW^5a0S*^`X@OIk zyV!f8_7dM^Cczq?!gom;BKT#-ZDdI>7nF5=_&nRdL%w-y_b!;?R(#V<`3tG?To>0G zZXDrNv0DUvJUh-#7m|OU2K&kQBCkb>VyvrnMie8_SnQq1=J%>j>kcGQe@EqBXwNn6 zgWwxu+@hRNbi!4&*5tE?Ss|Q4jFb`t39AjJOY6jUSh6S_ONjLyRNbS6aoBv9>%S}{ z6JKOyWNYr6FPF4DBZg~zDkL7n@keI0v}TYlderGXz@yLGQ-1xbi!9kb1VA-o=Wtyg6k9}h-jmpp6PRhgh6dWVk%Bt1KMMy;S+si*m{sql9T4{StX(B))0nj zT|+DAJl@^FElQ)pf9pErQxXqoMV%i?yo&^p}}{nZ>%#R1)!-+0;OCG@++ zwdOIW9VfwD`1;$CGiv!HdJ%=kKGWe8xI?V<^(yv#QS|$kZBczQ6txvG{Dq#%udg)&QmGU#;lHGM`R5?3=PnwVuU81zIrvB{yehw{sgy0>e^AkG<>l+!*mSeiB z_<$YP;_Q05!A0R&w2aMsD1`aTg~E6XIQb_#R6hv{u4Obxya~{d4HE*B?ivtTlaxae~m-9ITCVTeL(as4<}XHg0A;4 zm^}Lj34@z^#kla7V!{Xak15ZP8&p4Nye`3FY0Bo(~t ztZF9oUfFQ@Ss)ckuf2`e)v*JCfSLJmZFn`u_shtQ^kg!vzYR^UFNU5>h}|#jRJ-Qc zjLq*Kf7|KS`>{+o+QfHvn6r?@IumB+uO4vZGsaXzf82@7JJap|4evU|lD@3lh5F@J zKB@RMDvu}A$w^26%0QTduQE6=z6#E%=dedaQhAURr(L^{Cvz=hhdodDf{|iDSsW0z`WrVcCn~H@p3p+v&f7IKETtXotH3~Eyt?vF3!H@E%V9)QR zo@`X0;b*Lc5uXYm1@#@CI7Oi$w*__A>KTc4ZkWHIver+uv=`2dp?!*~$g}GM`ZFeh ze91W!y&H6n>X7D7hLh`VXu23zJo~({r3YQ-Cxw*5BMj)HLNgbUv6K$`C->Ex!^z2| zf6M15YDfKN6X5mA2O5XIh~q4|$B2d9{Kg{6t;=vx<+Z1U(sD;cM?ER(ltF2_qZd8j z&rOWa>HSkBAKCnB+e}B73<-aAu8I)mghWgHrt)6IoI#eFyL$Q#>|>!7L@pM0-#(aM zMKHafu_AE`W4)9XOFFl1nOtN(UgR}ne;%-6-|v)jkP~)viZ%nh;ppgjmA6Gp{xo)N-;Fv!~NPo0J zhCdWm(MvE7Xq#MRGpH(CPcP~{e~gRdaJj=s5dHFVw%mJ{m(>1QVsS$2;3Fkz_|vl4 zi$z0VfsIU+6k)=Vo<=RGANMM&$d`hMY^Xkojy!JL$I9EBt8zC8_5OrI|Cp=*dPP)i zvI(i&0KSVnmT(^8#N=YM!zG)xv1&2K@zHn0WpJUMChv4k~ZVcDcq0MjizqX zB_aj+0sV-=2Rq!+Y{EL^iDnk@9p*mx3uZlwN%>pjSFX9hU~U^!Z}g*rl|W9eGAm#I z%GlF42zN9LV5SWNbQ1?;f1b7efh~p|&Le9^ah){}-sWQLr zUU+og%M(P6Ub-GyB)}=vn0-V0a-e8&zm)mw1VK4eq>0u~gkqj(e{uW=s_kqDzy8x2 zamE>t1?A*@q2#V#dU83M(uZTzm9Nt1;35-8sfJ`!Gowm^l0jEfqC0efQwS5mHRq?$ zpK7X5p*hxS3=1PPuoG4OPHq;Xf4@Pv0~@9L`}%{OzygSdS+>dc2g{TtQB-9emuL|o&uB3yL}rKF z#)}q%Ea}z#Nd`yoGoswOiB)O<$)coh^<5rStQmX~_Ftz!Y`i~MjL)HV5SldfO5f>M zoE}K|6zxG59}QP8<6IngAl?xI9kGhvT2Fd8c2#ixCWcZle`oLN!pgL|=wO+bscl#t zU_04tD@ExX|BakiTO!cK2OsSEYe9oyF8CJ(RaLpnL16{{w=$%nH{cJ>C#uQ=BJS=# zpo$djHW26JgaR$QQSQ~+&-hNAbFWWe-R_Se;gOj~UuH|*Fj6y+&?PTXy`Prk1k+~! zUZM!hg(3&qf7xnGmItp>$i`^|A(HrAL`t1Aee1h&DLhGSp*9R$fSuBb&uCL?#+Fe5&N_;b)E_is&*>fbC`j8 zVz{C351=43ZM#4~i&%%co-6*{3cGYt%8jfuHij51ggNPFg&vMiqh|rPVqbvXeMInL z<13CQfAljDMv%+2Gj?iEH>&R}0UhdviVh5M>P%RbB-p*0l0ou|uR z2sqB%TQK;P7c}%o3Afu2(m?8PmxV4Q(4IK+e`cEopytrm21D@ra~ zbPwo;?#TRrZAJa+V*jv3OTsW#8!U5ySohNTYagH-o#dcwo`K`vRj6MQ~pNt@!vu;>d_k5eq@df0^= zY_W;@FS{))nHcLY8b=8_`%;s>6d}R|2O{vVy{jRtFno^C98kX4izxQqkB(#kOe4Iv zdNg}UlLMA$oZd@zHx7sih2v|ypyu&?e?y>O*7!)UZoAw0X->QxwJt-Lx9Ht?f|`fLF~=v2OzBsQV6GO0P-~)1Hg+hCIISh^!{zWz6*Uh9IwX zW!jH%i#0X{O7I|~R`Yj~Lq|bUWeNg}mLhkH&gK5&htowVxq$r8!cFTvSSs9(fA~Fg zayPMO1JmheI=2Jjx_l>M{)X)5{S}xi{&r2zvK!e@ldtQu?#b?*_5yuPV@hSa6BJZ> zzB<3?t#uuDGoAdu*n2X$&T@_?QugKHk)R<`w9Aqwu$&Nobu+DyeXsk4Es79~e~^v0 zp*gc^J$cEd6c|;_mSjXWpz}DdfBEt|EBh$kuZ#E?Z%7R)#vQ?^($1BE=40PyGWDBf zUy}y12A@wR?Ac0%i`rB^gC+6&PsUbg#Vbo(@|leTD=+UM>)t;I9{G%*u^(b+K}Ts7 zcO_(~*>FLLLJeTiLrX865gWA>6zskn$`s5-TSpv^y0h|jEv5lTSo;yve|e*UK^{M@ zx<_;_Wpj-@?-a(b)9(tQ-}WAZQJvfFHl9@mSMlA6E|wT<=4d0@n{pGj6ZBv*vHY}@&oQq^=k$8+MBE`Ui)|xnopKQysyVO55;8 zZEOSrom@c4B{#Oc3KhE zcklg{LZ3ROg;M~0fAO&84;ie~>d81AUC$bP$z)-w>H)O=fuuh_^y}LC+88aQcCnVH z86-UuVx&8Gv3hiuQ+g@m2Y<2kB=+MEbRs>6r-$*tL4SOc%Sx_6CwKWq3dMxdeb|LL z8=ZVw#Fu2{4Kxz^Zc#b7i4a=|wft*};+F;Z@f~DkU6xUuf00TjFL5%&U@4j0PFe|f9m?3e^oO=?9=A5QPYpX^`Pp?uz|!;ubN3)m<_?j9c#{^i~GL#ylY8la>RO= z8Aew}96hSwRYmT6=Tq3Kpj~Ng-H_=pjpNy5sU_p>m-x69pg(_qmU&I`{bvGdcl>NS zdnXA6?!7)=)Gtr3B*y_RgU3ahL%slfK!d*w*qkUBtUFja486Y?5XaE{{YvO;P&IaP=Cv`>SSVdT)S+}+&@=DE%^!BUR!iWf zz*S6Hv{O)SS=qDH1xY|vv)%d>)(~%nzkHTwaO#mlI}Y?~uqLAf@*Vb0&ap{3Z~Z`X z8TWVn&VSbMvBRev_K4u!(7~N;=2Ex(0rVG*#u)6S=%QY>pDx!B#_B;48uAvW4aOv? zX5V3;9d7V=h6C^yd-$3kZEhL;!}=IFNv~ojoFM2s_GY#KfF`Xx67Q`zEo$2FUdv3W zOs;ib)<nou^?nPwr0FTh zxJ#&OA8#S3Mlj;eQnnuFwnp)A4KRDX8;@uXHxDofYkhJB6&hho(c?Z*?Z1Mr3G2^2 zH}qr#emI16pon_UUX5?TCGRFB60$IcSM1OB0-P|G>BX{we-abjCh2(d-s1}6EME+WC zfD1Y#2(}^pw~XX(ttC2r4VTl;Q@CWvW--&ONK(nwVy(8FRV1d*p_Qf;ae)}jw>viH$G9eyQ(vxj`rU|%t`hNvE zC3Sd?GRnd|c^4tRyKL@$ z<;TcrFlEtqXjr61x?@N(#OGhSHvRLNBvv4(5Vv3>frMpWV;7piFSVl@R)5l^Z$x}u z1@Wr#3wF~3ZGR(*W)MDycHUQyArkU-e60O+Li+Myea@PQqpxcyQ;>cl7@Z_8%)sM+j_n`_z!R-e^L+rjmQm zz?kkhRUL0?BEy3=8?|F$t-z<9qDk(LOkw6`hf`av+bk879fWH?0R89VUpa}!@%E4* zXb6Hxb{Db(@z)(*&W)k4*5Zcz5$B>V*Y^TEYm(=Ovqs5pN8mAqxPL_nMR0G4^XNW6TES4Ut5}47Gp|hSwp8L&*quJt4S4t(YQYpsapv&JPH)^|D z!HiLl8u<;WXY;4spelhc>-j-Pra>ZXXwQ_t+3?$DZ# z>ZQr>)J7QVEB0vYmVeyUe{F}>w+}G$BnNnGb8GaxZ+sae`}l7 z%-X&;sVWLLCiOGbnlv-;Qt#2Hfu9%b?U&fY%N`#GRK+v~&*iEq`Y{I!8yZCvg4JhA#9O z46Xm146>W8CvD6TovnJmEz8}?TMk{D!LIO8C@Dk~6EeM_j$vnK#o5XQg9Nhdb0JVQ zTgbpF)kr#+{Nfr_S+%($K%ErdnV^fxxb|sKQy*E&*JsQ*A>GNOQ3_k2gx>RNhI&HR zx_imTI0yl77=N$nI3JUYV^vp5Mp;;zrv6}vZCD+A+Fs;Rn!b71+S6hiZdNWzx{y-=k3>-fQeu0g)w@CY4rBMg{Q zu<4U~$VhKZ{Gz9#x7NLU-%}Iu<^e7USn&;G>U&HTfvsE)`FOthbwSNTK{Wg-g{WT2 zJ5E%hD3~SY)Ugxi&wghyw(Xm5NZ(`JbUhk(RDV}Mt%@sGNoMRl`x1js)K<7Vm;F9* zgE^^=hFZk!8umi&qOS|fI=77Z#Uvu^=`U1x1I-dwn=Y#+PvLr`h+*O~?9L@FC-vqG zW%be3@7d^?7?LQZ=Zct(vy;s$W6mV~ZgcV_P&Q2QBj#DP^If7@8M0AD?9=9Q+XNHo zTz_f`D4HQvQzl4ae`%fXP5Il@vDp;tLcws ziUxJGDAyF&Ua=WZ?>UzKn7g>g7A9a`q_`RkXd*Yo1K!n?SA9A0nz(h;a8p|R zW_f#=m;Ez0-T>XV2t4e-kk;wls{}~uRez1BHPy!6Q?`;)hNjxRu>DN%o_zc>UNp>g z4hKsuMA-!zJ_?BB9LCgX%}|-k*Lv+~xsuuVvCui)t~OZHbN#9^T-3v6C*QOkeJuc-*R^PJA2kJ_u(wge`kBFk0 zt|ife(6@;w+f&UAWvNlGYe>JnVg|lRRz@=ZEbk}SaCp;3m7MsFrnyLCbyHksBELKx zwzO9C>*Mz2W*6^I%1jrMho}TxeJG0QvzQ(F{1F}H`lE;MpBg+ItvdDsz6%MD_vbn9 zI^w32Y82+v@kBvtJvCaXK=Xt{eNvtrgD=EZv7uo zNeKCWarGN?XJ6>Y2tzH^x_M2Z_kJhPgU?{D$?UQeovyqy`!ES zyCtnu1I-|Z4EZR{HyCRpsP+N5fZGxOSm_qkTya$#2V+&{fq!r@8MwY|xpuK99x+L; z+oGml7{_AjI!0v~4j5xRKj`q5^TK4qSZ_x1_!v!w;RfE7Q3AF0F+{xEY}5ucpvNSR z+gGY0H!RUj)GD~ISV0kJR>V`owhWKTWoG+W{^ra;$Q+{0j`UqH+f&r@ZZGMiU@4HH zD-^fBm0fd1y??1zkxR}*F?E{=*z|e7o_mBA^p@R)n`Sh{UQz`)Zh$co6-pw3DmWmJ zqkIlUuZgj>2RmYZXuR1mlS)^4XhU^KXxsPZEhXm2`|n8Zo-LRk9{o1IW6KV#B|e`R z_nY1LNw~VG54vUWBLrbREI;gNbFwqdOSqRMYeVvYe1=-hjDWbTzPgbAJTkT#Ho ziu6*QL>x0xg@@dmH#(wB4k!sGZk`wSC0AsDu(B(}`%(|B{q1WUGoi(a>2sE1uH_Yp z8RlAOp_-F!SpD@)pU)1s+!4ad;b}|0uYRv)I)D1yo#ux-MQk}btG+Z%H{<{0rak!t zPbd6DQ_}pdsZN|g-*n(8r_B83!_4DOSSg01O|ZNB&wo_ z=$qRt$E}WZQU$HlJKIQ^H7slQL_5l&1Y;;ZsGRMbhg_gevUEG-fb?>@)NxTwJiFz@ zV1IRz8@IS1%ByRE42la8332m7Cxp>DO@~=WvSeb03z_%^7gKfSrMnm*u^&~>9XP+) z#IhiWS*b)P(>x^%LXT?Rp+0)RGWZ;Ej${GQNp3LBokj=;Z{vVI8W!H#bdd@0o= zFj=7+&yUK+&rWg}(co=r=m@AdY~%~lk_skRK&yNgUNFn`SuTLXjUMPY!=4%$=mN8% zQm&?N1CS}C-97W7#Skdr-KFxHPGn>b|CG{kTO~k0*0hg{u4iZr3EL{!P)#`d?0;TV zII_=>&U^bKbtL4yXrsuc6qD}gR9zCR(EHMgvisZB8sk`r3{eHOpAuKHJU)oBtK?l) z*p+ZX@fBxQ79o=-Fd{I-fxWFGlN^~`IsDO%$wIwzVI);QQAZ+0#M{gSiT#_G=xD>= zY1hjh2%lM+Jwq8YDmZ|2Sm0Lg~+sBq(5{Q8EuwW4mj3h@o@XKr}0cB6gj8o-h+7 zakzPg@Cz^-+rF{!;do%)TCSEsobX5yX}c(P=R@2bF@ZKFjg=?QjeXQ@?*lOCl;rBW!>m*WztHJJxa}c7$E;wi z$h9bTeFH~#N@5_5w>T!d^vJ3LN!fkeuX+M~M!e64r~>f#)(-%k+T~`N#7*0(39+`|z>Jh9I|h*N)K_&!Tbz44RIw;bRi#73uHReu=3%&F4Kv@C~R z^v|wyySevw^WMba?*-w^%Cl4<09RP_Z=3WwE(B6@8|Gu_OdI(PPI)^!owN`gF&F)r)dlkg|chB3Y!d*aF!BG z@7|q^yDwg& z098x?hpl}Ff+NA%>E`!Xm9+VU)~ry}K(qM$*T?Cc0RC5Z&q3L{?0BSp& zG2&aUZWccD-ES(Lvlpgd15&j|b3Qm+bI-FsF~;ZJ0KC56lC+JV6&?|5963VRFSS0ym0be4evv!9K-&(2=s%atN(Izips zGpy_(X6S0t>*|y=;NL3DsXtrX(!v#@h<}&V)}VJAG`J1lMSJuVD@$;*da3pj zPtT_g-s=)^u?MAiK@Li=@!h8mIB`@ZiNb+-Cfhc`8@JhB`+M*2M~}FQ zuu{5c%mpi65{!d$9doe!9|U5$Gy746t++_-J**^K^<0U1^b&eDh_>DO;^I8Ga#z|I zzkmOP8&;nI_@Icp{P^!|{Jnod4pF4@UQrfSg5YhDqCcFw_u z>Di4Dp7`gEdwHF5W7#aJsJe+kltaMwB~&o2WPpDhxK)`*v3FSfOu!$_g6Csu+bj~3 zqyMa_(RB22ur2$L*n@FL8hXL)Norm%AAhzf2%`m0m8GYCSlGkq^BSR$&j+04W?Z62 zrI;t$x=KNh)%pds1%-$BjBlTn(CPypND5UmcUl4aK1_VBgf>S9pVOVPPG!z5KGK@r z4-F2Y@RPcin-s{0on6+>_tksDO0EV-Qs*+nzntqHtstKw#Zpn#YEn^pXV)k9i z`XLE(7tXq>-1LjL%^#If-F?&GNrEW_QlyHCagR}pyL%G~7uK1oZh;S59@j`Ce{43; zcudQ%=@fs@_ZXCs6&wCIiXRkswPXH{X|U%UFsE1Ebohvom4zFvq)&yEK7Vz7H?2O6 z#nsTfHVnLbj9d#WLjKkjWP`dkeSxjGLf5mAodr|NAPF}ssQB=Fy+ky`NqU1M?3>qa zvMVS<==L>M2`Zm^f!|B_j2(D^MMBd}TKBaV%cVC%JDjnQM&xA26R znToK@(9Jsa6h#7Bnf(G>^?yXK{`JV3ICsMuN0k0|Al5i+2xG{PQNV6(nc@6Q7&@;< z#-JIg#MuQ9mI^IG#TdA%r<2sHr#L)myNlG=;gOQ+-D_P}L@?8rr&Xo+^T)Y}7nigI zJ^Jv@@$|JogX9;}fPAd>edi3>Mzav2xaC89d3C~7UA&TElKE5gP=7)@lfl9QMY&cU zPbrKEZDHj1k)<->^5TAQ_*=>l;IcO7%u$4kDOPY4a=Q#88M?RcHU2ef;bS_3P1A7Z znM!8M0P^ZdgrwAFi&3aW!FRkElk|w+>PJ=VPG%{5a3>eTu5`m&&S}%G{o1H#`Z{)p zKBGJxnp86!Zm1Atl0Th7`66(NrH2>@8-!t)+$)=iE2WCMe!wq;!<6hMD7*|&EXn(S z02!Xej|ydOWOHv7!pSu(7QnP{P*6iJqB(i3cDmr_9U(U}9orU}9o{ zBPUlicd`QhTMS384s>udx3%HXA(7*{K6EkoE*?-B|+5n`TtpLod0A>yzW=)}V++237zSTO)Izlly;BQ1O{LIoa_rGP=6DG8kApGT1tp z3Q*GlTz}1-%mB(jN1%fX&=~Mn!2o#!YvA9NF~E@nRL#sC|CX!RnmD-{H~;}4ft9%t z(8dwu;cR0JbO3;Y15~7B0Sb0No4<`^|2Cil{JS>*W(MZ}(EZ!{FCufBe>oc%8QEIf z8Q8d++n54O%&mX`1qoROCpRZLfPsziUxo%&j(@fwe*+f-b1MTwkiow)HvmWoD*+5Z z1^&A{MgzxqJjCpvtat;DrIA03*i1c zSx}e$Ct;U=pFh>VcY_-6-(2#xprHiL zvIN~6j-ZMBmkJ14oc|6fZewI?{MUxDuyX(m92^YX;g~>!#KO)F@MH$9qA}3zUo#9~ zWU#Sy0=WP{<#_{4Y#reKI#CXG0Dq(KU!uPe2Y^xJ58?zcivB@d07kJth#SBt{vX82 z1Ynf-gO~w~l7A2@fKloX0!5JhgFq4F{vc2U`9BC0LE%4$3lu@|4`Kl@D*r*C2r7RN z8-P*u4+7Pv_6LEYtN%fu=oz z7+C^AZ-~i1tXTge|9cVsqX6+6{Rgpw$c${QKtu395;nHKB-Ymd$OtqYjK+T;s1##c zP&7wJ^MBZY@&Nt=g8F3g2mXcrVGPR6#OhBDe`#%<9sc1BGBEuI1f^v5CqYnS&D`zG zfHwcI0LlKD3@Am5e?U-!Er0(3K{Z?b1A-c2{Rc9Giv7dP4sx{t?ZZFxph9i`Bm;7` z{Vz4B7`s1e5Sbn5m9zP;vteWYxAebHh7FXp9q3}R{nKkUP$TTDoE`tc50cpb2ZF9v zMtf&lC!n#R)qj&QGlNwBXel$OLw{)4L1{Yzt~2pt^dLQ`X&Gbx&e*gR+emyc!MnJf;t{*gz;SI z_ow*h$@euMmwE;G?Em5ic z+3Q6wUU_!E9d3CBb7;EomvH?c!AE?0RiOi~S9>pYe@n<#@NQ}HTzh9OB*lER2iE~f zxB9`dwTY0WeWinH4jK5DvN`%_wWzQD#S7$lhFOc)Brs0&1b-iBP%qq&7jEz7QFEr> ziKOFc;k^HVG}^!qE5_Gc#0e)OJn`;EGgP@m`GW~ z?3~=OPGYt?qVm|6SAK9fzS5;2pXQ;$!DfU+mx_$qYWtjET}+$+!Gw~ZX;3)m(m_{VJ^qJG*;*rH%1w@ zL){0Hj>gtFy5Qf)8yf@ok80Y!<%q%4;zeTCXAwBxaeuesLE}b~e#=bHZDnm#gdf(^ zsoVbrPn}VH)IR76_YgLCvWs4(R`xDjU75?3iBkCSGi+?kV>3kP&ZIM@xexlRE+6CXpFsfq|Pg1l7{npU<#ob360UJN^)E_Xve`WsKN zOdAcf*MFG=TtLvfXMZ?gHPo+cNt|vAC;QpH0|HB+(}GDi#qC#eozmbN<(K~BQ{Us@ z@D6hvgi&4`cdb#yTc;MN-Fyg4f%n?wb-P1CW`7m+8gTE}VV>_jn`H*q#!O}dKRkVX z`K)0USzJ#ia+04yFoI3lhkPIdl1I+L;2s0<@qf4_1I+xQe5OyY7pVDIRc5gfgN?h( zA*B1kmat?A?P(%!yUFo_cllf?nR6ZeuXW|cTnd_^vOi@qNDefp*mSsQou3sZV0z4F zJTqjeL?+7J5K)J$@r^b|ow>X!&YSs>@-a)1D(LMyZWOi;j7Z#@I@k2?o?;qqTddJK z!GDB2yeB5)T|6V^SSyxOyHP&v#!|3wcOa`Gh4f!~QbG=VcDU|{`XlYhwDE?H$Z<0I9HQWGf@!gV zd(*k__qti#z2-7~nAlrx%yf2!WAkscfl*!3&~DWTJiP@6>(l3&-pYs5ro;Q(KGieF zPRCYiPZ%D=Wjd6h4ua2uG$uq_4_g=i1@=)!8k1*{O=;;J%;r;xt(C+8a*zC6$c1ag4$~kKHEmvq1 z!%Q7*C1`O0l*#nl8KrexXy0a?q~3+yXeJ8Cc8J$aiIgF+Kl`bG;g|C&_o{=Ps%`uI z79_U%9xb<0G0S3#rf{^zfF7(mz<-&D{nX?-o#;y~*a}%B`e7?KS=|twQ}?H3Mt13~ zG;f6wBAk3r63sQ@O0*?wZeC!$*QgVBc#z1s|DYkM2TXAz*H@>6sez#Ud#-hW8P^gE^o z=@Ar6)Fq@ryT|yh;Cgu~2joX{3^ZhqrHG`&a#~2;V7dh}kC+wbIpvnebk1 zqPOQ3YMb2xzHfdMs%?M!4x8KT72zru;gD#A&b_6GLA967XUWwLTh05ejC1%iV`4!w zTZ;1PXY6+NuF82on5BKSMvNbH68K(|H0yy;L6B$_5e7v2cHv0afq(KU2s7Hm6qV3u zarpa#WWHXD_txYP0;-+UmNh#cjvbtXYcz%AY$BSSr!@4*1#yv;xCm}sC0R`g{N8vw z;Eju5TGp+`Y(Gxowz9k;B&zLP-#Yhj{7e;HiX_J!)KtBtRKAHC#h@2Q9E7vqwtoe-b zQ8?b$lnGNxDGBGAZ<7}$<=MrH@00^}L2_kJ$SKX<-*l6t5tsBL>xsZACi-G5_><=; zXrihr)yeKh=3rM|rq}MJ60iI%EKSVn$O8?e5zaqZFPK1p)_N-&5qE5mpN+C^Fq$d5 zWMEi(6hH{=3!A^n6j168rD(-V9(JqR|25I-VUvo~9Ts9KT2f9nR@fzy0p-RwY08LYVidH&hXtx?|kb@$Z?03d<93Q+p>ItbG^8IuTqz!K1jYSQE z>fSeau-j1VBZ_jAP_F%j9FN+;EJ@oi?w*MS5?!pyM}I%%Plaf1p-GTwWd5`j;!1O-l<8r={0-29T+IP<@OT?zZesDD#L>(W%!1rH_}|@ z!uWUZaep7=VyRROiW#F>F8AXm7?RaIsb3CSh}%UtIPe%*2m5g zVx4M_AL~Lt7@GV_A2ATvPs72c>0=YcWE?Ls3LmmEr5K$DmZVf7A0->I8>7wAD2RV#k3+0gQ#E_S*|2iy=5EK+ zqkjf}T)>$ivlGooANob`iFSgjMK0#!V#liDvwCELf?eL&u#=Ife%oU1Po|8RfjYk` zF7^sdVX8sO2!E%1l(%0q{dzAc$uhowyl+@#TY%2s^-ZGkb z)wGSqO9Hw^o9dAqL#RyRT0>5BBd_RaIDga?=68@lUw{HpedT-(yA8^BJaaA)_BWb? zp`aAEZJSOZqF(W52rQi!nmNE?wfB(3KADa#MU~gyRS|5%~gX^Xf_+?f?&&ZhzU!7XIV>VGX|3?cCk_9{o~X#8BUdnjBDolJebO zUN4x{cFF)CK8ChX7*mXkjq^X$$ryFCskU5)JN$HS=i ze7mF&7l+947i=>6gpIWHfQ}%#mNJ~i$yrCQKfFQ)Rb46PvIToWaDwSoAAd~YI1n|3 zP{r|uc)*m@#&|kZJJA(oFUa49D#&;xCdGEamgv4%FZg$oEep~v-$r}cM~JXm{9(ji zWC+4gH@P^eZe6&}n@VjmV=>het))+o2y^`w1I^n3iRNAk42R;}u7)ZQZH|K?upV(c zOX(vG#Et1JrWX)}OE2ggC4Zl`*Cq{NjT};mTCdjPHE@}ce1%E2Y`)}ATrxL;x3dM? z#QVz-^eTwbW6BGc?(lPCnX>brYUsL6PEbL+`8N!_uV#z;64vytI&oor@|MrJS(1to z8w*NGNDc2UPcI_sCiaiR9);M1_9M~p25*u;?;h-lUlCVDV;QklHh<^)_`T18)c})e z_}3sYp~=sL;Unnw2$f6<4Gd3pyd|(Im^Hn3#4@Dqf#OESlr#+^IDf=_=EP<89QSyx zdOSviwj~(#w%zLDo0a0${wx20tWPw$65hB(q=E>Fcn2{pe)KRe=RV1}*8M&f7fG23 zA0%Ax)rSB?;W8J?41b?szfx-E-wnmwXaz*%phXjehb?&>pmI~dW_AuDZJIc6BJVW$ zDRubRG}8lQ*~67k_fHwMBOp5Qv9%Ke{1lX(fyG!a0{fB!)9^(eU{BQ+isRLE78-~C zNtnv3RnD9Z_K3gRA1th`;6ftOS#yZjFL1aW5`uo=Mw@>;{(q$JJitX<$4-V@Zv<8H zsHT?oqAHAZmeN_BGkotbFUtY{PwZGJ*R#SU8jOyQPex=WnGVDeR#q0 z^%fnC;@1!a{C_bouvU`uM*?(_RPsYqCzFy%FJoK$-N%S$BAl)BjBFsW%1-cLFq#r`1xpV5wnwQMVyhRT;t8BL4LKNBl+x>K8rkWompb8b|mGz7MC@`P*0T~r}R~n zzcy(?A=NU>xyo;2y^7YxTkgA~mHTWue&E?d&%mTG(61y@m{m~xE`~w*Q;rA{_!jiO ze+snGw3?T~RS9jY8Ua~@!z}+wXn0%|o=x0q!y&u=#J2*v?H$I23tb0Zc0pY3vE>V7 z0i{g&ACg+;uz?j@_nGmgDIs?Jo+0yk$RlY?3xA&{1*pawoHaVWM zOn(?vc)66!AjQhs0R3~jg|Iw*k0{SK%8bk~H-zwW4BGSrxN$7LGd`yu3EcAOE4>q2 zR#Kk{ayJ~a`uWctfygxzKPRBD?tBZGrKieDX`+ABbeGC%r!@~mJJJ}L-U==ISX-L7 zl!$U|j18j&g&-nwtJ-M^#pp^VBG!{Cf zR@Ui#Hxpddwhp!vB>nAHkitX<<$54!>rsD|(Y*da>Zh~3$Y*5A-{AEZF<67@8f6$! z#9ufTfazb_uNi&49Ut5$v(itg*1Wly!%sVzdiESwQo{yd?wz5-4{opyYaE9QB!3az z!@d?`iC#&A8^NH@0EqN7znb)@rDxhaEV9u!mIHIWv{I2Q z4;QF&eS96!<6#{m+9N;z*{HUl256eVvB$=$eK|a)){c<-ydPgDN8Vs;hltj$W3H{+ z)Zt3$id3~bu3-vRmJEW5R=ZZ3r}$}e8IGOw8t3RJ{l51pQm z&iA*G?VK=Pd(FuyKQ+_qN8xQ(Bb4%T9LPO+4d(Ql`ds)dsBAk{-eDH} zO>xt##F2lyCN{V9E(Ov0MSuC)-59Udf3ZT375m~$gr1)*3ExU+$RY;;tVG-orvd)> z@vvpCy!OS7t5x_YMchUO_1jlvj69fJ_Z0E@9c2HEKFGAbKs<}-7gcU%>~qD$Vu$Lc zl^Y#ZuYp--rZkUj4Y>%FL;jk$M96C!Jn#+Nz&Xo|$Begu=nue!Xn(q+=z+xtBH@B1 ziL7PI21diLx4TDmE>au!2crR%|3n$mlmJg1}`DOx5>H5L(IR??C ziZxU|7UYUmAuS`L0?2TUk{VXuWc_CaA=0u!_ZlxAzu!S^#FtX^MwmI@f>Cr53WJA` zeToW*ULb#p;WqlJh<`vLNky`WF!;0V@%6SbWal^ZXiqQtx4BPX9>GxfQ8_8JB#C=| zcrECwErDg~KR-vLCETv!G)6N^uIAi-c8mC_iQI9lS~odYJ__y_N8fL!5(QJ5lgW#8&;P(DPpuMKdy7MH=LMtC={EOtL3z!7QNAcSP?Q;g?ys3FD zdHDb_Jc8Z6Lw_POY>cP^FCx?nnL`2gxkv_fDw&-pjClcC*pNV4ws!YLp%RQu=&YC- zk;OA@O`?{Lq}z`b1oZkZC{f?Slj1KYAgyCmDS}OI6fMap;$!Um%CO0adX-# zqfe>G8T1+Mt`MDi65;f*FGqaCvXAZ>Vr`iB%>c+Y9)GiIK;^7$KT?}V>pk>Mg&K&r zl@M&#K34^28u{S|Bug+iqlm1uclCmWUhay|efC^6ETe_fD6E(HQ&(3%d>1or@&g(C zRnlQ-N3et_kUJydzYfgm^kf-oY~>N>%WoFhtza1RpD`tv#CBN4ZrHTX!-vU zYpVXmf4w8(d0uO4+MpM{v^&Sj*MNh=dW?t{3&VNcKdC&gb#M0bUxLNkg(Ll`5B0 zvzKvtKQ8yl@wnRUrnfUf{tI)*wVo&<2dXSa#B(4r7#F2_SnHEkxGWPVSDGva;xJWM zQh%u23Q1XSVoE@ptcChiL$}Rj+H+jJI&_UwSK_0T!-)@7mvUiB=V#*G<|cLwFLt`E zyiZz;>|jK<;j=D!b;mN z(P?|#5_k#ejXd%j?rk}8=~gH@q^rbLs(&HjeMSM+lT&rGd|XAmM?05PdhU|r2UE1s zsIerb1IwGJI8#2S0*0VIO`Ssg`mW25z-01;DPjNySez?wdgdB86MA8y-TwMsZx;GI z4AtisIONnQIK9$w{|f>IO0yvI-z{?Hr}{wSSh1 zAjN_h@O{8SA-Fgmg>d|WnEEVQ#loSFhY(>(krfsdZ9(&v+k#d1H1gt0xoYDihq2|4 zgu?MwaG9}?;Qdmr=IBug{!>)fhZ9>@HFQUD{A7ySQaoX0+HoXjOl5=%c7M$+`o%E3 z{p!Os7x+WugUXP{mIt&Oi=Qm>#DBaIOcitwAG3%TGsh0Tns{+7s>o@|QK|_vuWs@C+B?Hf=woRsvl)!-IsSjwDswwo59w3_V8-Bk! zP_6)ulVFyOoNgu9>fN|R6eHI9Tg0H9wK?Nd&dWkNoClGj}U?d}#4}C|!QxU94bh9E96D z_N^kA;OiUY{e|%z2G(w?flDc+pDen2$;*CJ@T8@`K}0-NWG$_>M=?6FXfU(Yk~?is zSKw=x?k0@bU`}y}TQKc$O&Oms9-F}0W7h+khQnI|;Qnj1oCwc@w!675$I9qrpDShdqk5!tk6qM9`{N6kP zI(L>9MrT2XE8NG&txA_Azgfrwd{ADS-DN(&(tdf_QZm212@r@Z( zSU#cL`C3kwOvL^w9-DV}Um|~K<`nxQRkM#VSV?{h-X`b-@A&PiZPAIO9M$UA(sYr* zsH|DHBu_S{I{Onk!ntoNL$ErpAb{S?a@0RNyZN94Oqwsv+m;nNg2={Df>l^ClO{Zb zS*6>7Aeo69tAFgnJ$3cSm#}r{tS*1lu+#f8&x{W%WB%VtdeGUMF}v;-E=E0CblP?T zMN_xtOn=2N&x8;AR|?Dq*KIxF;7fAT)-6lcHs)jO<|5u7bqBFu6pAD5_032vCZ%p> z#Qe%TPCKcPxVkLZQqKmM3P%u3D6!*Kpg*1(1A5Lcx_>jFa(@cu>&%c5Uthetwd8q* zw^*Kq=+0QrVTF-4ik9YofM2z^KXgG#xwZ!l=_*v(Y~ThX8QTfg4>;vVzjztMKK8m) z6NefJz2nm`iiT-r7?yTVIKA1!$L(RsJ_}u(R&4Pk(Yz2q$`cU;e-ra zHT=5y+kda!BjD1edE0(~8L*$&YG7`2{>4vj|kqHlcDqmN;m%(XLF#$FGH(NB*w zciW~Qq zhT(km4IW`;cd(oL?L`XZ+`L1?Sq{s}{LKhDgnKV;vNI-?LTK$9+bi7mF30x|ESOz0 z4`JR%5XVoU{6+3oh$|g)-_q}*-zy-GGRHemyTW!}7<|K1Z;Ef_WFU;WkqOfb#k-Y$ zeSh}qx+bPTa7$z$?}poJb((dA4qpRyeVgH#-4%-$R@m`ly3YhMskrcH;j)|(F>@!= zJ6<$e_sBgIFrF;mG|7G|m!Zd88|WOZK7cgArdw?1=gQ@NU(;0SJB&L~f{=wC(*G=f z1{s(nGRL}+v)Za~zs^X#;|L7$LE933;D018$6g58ga|L4@Dfg&*Sq#5Kxc>2xi_Uf zL?(h{NoomWtFe|t!uWPJ)DFP<J*< z!*;_okzv0EaIeC+Z->}bO9M8{SD#-+UV}lelL6f;gbt zRtzr!Je;Z_9J-J3Fd2{`4Q-+TYkxj7h9ouGS`dmT=xemdgr!|8TlXfk^8hzcCm}>9 zM(2$Z6wl}8nN{y8N@pDvzQf2_TL?9{q_*4QXC`hHzbb@jn4!VXShKT6l7KZkrpJiS zi>)LRJ5Qb42pOZXBo3|q^doBo+F94}F2lgh8;+Xc`WtV?pbe=7aJ1s=Cv=83*>Q|7upXm%c*t*|h0&&9Asi3UmU*|fiP4W?ayPL!LPY~6DNu)T zyBfYon;!x16+xpk-h%!m(9*GT%%V`Pg_hXf^t7k6seV9Dh(Nz#^Ik?)oKOHB&0=tu~YKGyYdQ9G1}u`7l2*d-qSs zaHN798$AMd$B>*Z;JkHvX}hpK^OovQjvK`mH=La7Id_(hnom5IA`3Lo?5ki^cQRVa zyD+$f(zovV$LbT1IfIML0A4pIyXQvSz_*tlxtS764akT)^hSOzoqy1Po@LRoZ^9o% zVay0K!VF8FHW{;LR+JbIJZC5@paO}xPOijAj-3b1`&g)0X7NOQPt13^>d`Pw6Wm|o zlYR!7jO}4>`Z2$6a304+4M-RY*ds!CG~&`x$k~SsExpSPN054Ls%mg#uhjosF@lbD z{dx5a<+5vDH^+c*Lw}v(5}1m6*iXB{rMtyAZ3FhWrl`ybsn5*{wSqYNA%p&`X9WBJ z?ORh%Fr7lBy^*r?d-uo^NRLZ*$-AH47 ze+f(m+wv$j?8Ni0(Vfp^)Z5%f6+aF`qRO6UwgySvD22>CJb&&dSr%Jq>j#+91>C`8 z@7%|la$i0ru?v=stpCu(Q!Fxuf(U^iP$%8?swv1Ykq=x+5rPF**}6S7U9urwYKE&k zKJ?W7g(Hk$_?^3)d(_&0B9w5?R(@QyHTaXFrIPd@?lNB7d7zUdj^kW`GcM+1|K>aE zxULY?r|RD}Jbz3yO&&o@zaWws-NYP&_J%cB-yN|s#9EJPjUn|PKOMa6{o<>R8D3@R zW`R#pY;nN3XUMO4b9%7fmjl1FCd71W_ak&8R6~E#dIxxv@EX3I(=Fxaz+nUi)8vwx zKfrztd2AFN>B`q|me-2-Il>4tTK0RFVOWb9$nIigHGd#O7fCSDv=f}!mivZKITk`6aM|97Qy@_zenml3z4a4IsxfI7Zo*L5 zM~Nf&4L=*yEXD{ro3zD+?58?QRWb6*XAGr)yDSP5iM3{iC-loY)?^Wsc+dLbdiWnk z9+`D?(#K-05uAS=1|4ln45+LHjjZ=?Pxg&_Gs32K0g31{7%b2ngwEJ{&nHn6Q#X7F zO?jk5ylCtTtIL9Y-0E@UjRrmI)#tvPr&-u~#`i4djJcv;tIH{DJd+2gawsVW! z&gg&Cn)fNWIdrena>&MGCG=^buaz;pT5hrs8<0t9Mg)Jfvm^~4|B7k(rS38p^8zsY z{DZ2hO5hZ$JE_!CCe-95>l1j8*ly)V*rvVkXZFCYyTRcPqS^8%LYN&;CM0n;2d0%A zwk9(`Q$wik$aI+pNnNlA9GH?)z;{cnvXt@G$_4VuMen^FgK=&wRXOuJATH$NmHzkd zm==)519^Y3a^I^XFh-}>5H^cnz}kU`@Ws));?deCSJtXWdL=Cuw(s6N$1!pALY@~$ zKR#5;agNI~&X9;als>97UHSIm+qQihZzGEs=nXQBB8VnsJZy7hYhCx|TJQs!Qxd9a zq|wL!yxQTmnIaTM#uFGo$_xsKfMF~6K*g%y^U8nD)7pQ;u2|oe5#sU?F4TUQhsS_&ZH_Uw<{=0|V^CrscP1iIf2JQiQdrgauZ-gJLZ@;3G zdFpWG>cTZ7(hhsphy1k9FmuhP1_u9SM%!M?%8Ca`tTO>DJIn5#yT>)gbo(yR5k2q$ z!WMtU3Z75c4U9l}sX{*eTpuc76csx;%N{v_^CG%3H>)mxe=b-dDDPsMKAMLwR^RmC z47@nYWf}_^C2bf?Jv$a~hFMks(@1OL!cT%kK|WsBV?S2Kqk#HF7GLtoi03!uG!aU% z(S*+1Chvj3(^FLxMHJ)nP&fox^peoLxcsk`{KS|c zOR>%RHR{#aT^5ONJO=A;^7^)z zB_BD9YbCvhmM$oHvpC zvzO=8KgshSe`Q+tD?nCva=I$tZJ>WbmC&v{z`T>-#%YA)5RHRHf`AO&FX5|5?Ih)^ z+e{DFT4*_x8x2PN!o^rPA9DaQ6&nDU9#bSF0WJ7~p@5+;ddD8GS9!Q}C3C zi*LZDjfz;}2=zm{Ss(Bag{t1KQwtoviKKI(tM!aW^sK8WO6)mY@(^jv9A|%L&M`+H zi>i_c$YZZDLyKztS|8Qx6g>W$qlmZWt`q}yvTaf15Cg7ryz#?s7WenlF-ZhGvr|eU zz1g2k?~N|)Xlko-Bb`?}39F%?M}qeLSGCtLCN$`opv9@N zB;aFFcT2B`pfF=We6~yMp+@zSL4zb!iB<$12cUmB|hsbPMogRNL_hwRB+B&a> z@Mh+gFb9wdaRkUw7&W3F?#vb85Dod?$pz<0<;@rkT|Ffr7-x<%G0MdKCQlYfA;eN& zi~34d2)vvBT`Goo+u^eqr{cTTAw8|hSAs0?k|S%=Q6az`$kkk)+tdy|y#x4m!CAAd zaKrDDt-KMLARzAk^VfgC3sYM${}EANiY)v3Ve!_hU5-Tc0Cv25%@?JyX4M=2&$6HT zcsNeSQdpab!LBXHtI#BIVpZ{$qJ1c((Oe3Y>nVNM7}IcMs?U zp$&aSMWZ00#=s6|{9<}@l}LJ}@7dsm{tW@!HFa~mJ$hR3i}8QX&-y67j}BjMdMB0I zS&!94?b#t00U3jW);oYJ8~!gB!<`3*L6`za(!aJ!Z*7-~QBBBpF%r9U8J(p(#?=rZ zmC?T-VWVbW39_9Dx20ER9GW_}x&TQ-!MV&6&?qJJm2iKjNhAjbzE~(7o5-;63>ehz z>nkKlJM|-Z2}pkmpqdH1NXx3koVS^Vm1t3T>)D>^gl?b)s|(=;lnj|1N0zXJ&Tx$0 z5%llZHdcFgjC9yod+|=@$-c+Avt)cg_^1#5!o|DLlM&O&i|Zh-%d6*_)y`$6IT#|g zw)F1m;*BkaxBx&E;rf(0(3UfGi5{LM_;G(*IP&1#ZR>xCm^Twro0XFi$wg>NgR>Wk zIZ8Vc&HRM5kEkzZ2Em`iIPyWx>#jXl0h_)&^rV2N()N-D$v3nl1A;b^jRn;p>Znjq zNM9Sbh;H*cI*ENu5tiQ5!&BPlE?e^>&i#u~XNlfn(Jt^zS1yL0sjZbY9Y1M5OVq}L z3UdO>!;*h=mglfo(tf`{3-_nT(?m?1N265|6{~;((hlq|nRi>$nPb^hR91;yBxLE| z@cnDe`M<8mu)Ewck;PZqTK87U|HF(cg>rD&}|G*^JWhN+wr|ZPwc7+jCj>l%#bCg zB{_e4yfukYLnQt&EE|R~8)9VaE#Kn6LQ+1P?3AJd7Za|AX7LGv5c=aYYw&H+MgW`{ zZ4cB_@h*;3vd$X+B>r!Hw5Q}#vEP1$il2?1sH_6$a>2??jnyQG5)2TVpzeQnK|FmC zHp(-ylAa0{ica%;39-jLkBUQ&I3dXv=3##)$J^4`%Q*ykTlGKhUvr=vkS+PMj}^us zG2lLBzZd@s$8A3CBp=&?{-*bFhjZrlQK^+X{D+?sfgj=EuKM`>?y%?TC$a+*+TSy( z_HvsKiK@8W?kyfsi#2|MfNB90@UPn#aH#p5vfIk z&i%HZZS?VaR@Fb#7GiUUy*#HN8_j>{1wVbbWV8+tMtC z<2Sr4-Ld--FIgspnIFwvk2HVjXwULP!s#K*^PIJeTKewd$kk`BX0Yh9k*ui_FrOZE z4Si#Nf-$2!K>c0g*Xl8__A?sW*;))_YRhn{A|i#(0X8kzGe*bx?z1~Ju?#7y3%J+i z4>XS1^LgkA9~R+`qiK%M3i(00-wRG6jY2Vn9D|_dj!1cP(>wQmvX6gX60^dBFNRTW z?sdcnzY&GJQ8lYMb{B8T9V}SlZ%Dzzrv8p>ub4WQzPWkjU-pHCaEH3&OH2=jOX7k( z{l*rA+Y_#k>wGoqOSN3yd!0PY24ss3*L&pnZ7;T5qUnUpt?y)1G?N`^>-#wK!^*lGSJgV7q-V(l2(EQUhle}$8o*YQ?&l&`bs5>8C zSf;U4nDm`$BR$rh+$cZR

SQc&AE`l%O~DjVdCCJ@4_XqPTw-c)UL4uI`OyBr?3N z(F=*rCrHQE_#<1iCr@QeZ=wDOK1+2|BMf@LX)XFVX@Hx?_--~#CT7lh1O-b638k13 zCs9}a!u$}XRKZ&?qPik4+NJMI?3{h=I#Ya1ai`PcM%kqE&Ii>4D@mc!E7Irk@X?@8 z7hC{5BY~D6$s2!@AgLW$|3pAVMH08`Z_St1`3POV>8sjJ;{51B%!u*YOm4_g+_l8jii90hZEXwf?dO_n zjv=c@n0B0V%wx%MYBM-6%l*doo#@6(vgzu@F+%}`%roB>Y(%M*r3xq^5;LOfq_Q>R zt&K?3cBFsIxsbLgrn1WMwW$$0x9Ql3WKc;eVx46Ufn2V%Jh%GuuII;j?VsowNA!es zYNZbau#e{R%Vk%+gzTrO+MGm_4_i~3{7!Zknvet9oo*beqYYb;4-A=5 z94#^viY*5xeqZCyk@vwrxNJClR2I3CuZp>L;P8JL$c$T^Iys1X9uNfIB}WPY#yyI)D< z{7#bfi=JQrGI6)G=*n60S?_B3nzT>{TVl6L*R2>8=3*{ zBfI^$XX}d>nfSG#8q@EYVWb6wcjKQQx21o-euawFi}Xe$=qyHczxBXkXZK<9-adCa zi@Of*%P&z-Q#1oG>PRn9gne>QTdgnqzW6hjeQt)CeDHoF$QfP)h#BZB*{nk4fC7UhA!`H*ev^4YONwxS-R2q{BQem z@Q!o?8Fjv^k3PyRj)a7gQe?4Ix1WEaIvm4EY_60xu(eH5!8Pr9m9gW#Vi!m=8Dvs<&B^iokt?9hK>nT<;t z2XGT43C{}_85OdECz&vXwwGwh^|{xh^`ac*Ms*;Mq**Fn=L;;_efEb(lqJ*-pc#5LL6v)MPo_or$ma5fL9hNnSj8FT_ULo7RgSl0`s^Kidr|>=ovfqwZ$g zsqnka8G+3baxd>SzglUiE2)2(20P{v@G@n+hR%3(6nQ9oDYR5@FdN8+64Jfm-4;U{ zHwOoF&0SY+w!F=vnSM`v@NSVYn*fXWksM^qZ)PGn%}}=4h5atEE+(4oSgX587!;q& z!XcUA*s;zhsmCAF`;r0}j#-UO-i z#!)5J)Y=^bk@I&yQB5)!`hpi14mI+OwfH&k=Igmf>KSFlmLC$IX522(bHHN8DA=l%#8NIR`1HV8@IT3mkn zw_hi!MyF`0t#h{d{7_)Qj^GF`Pn%h!Az$?4R}=Qgyf3LG6p%wvSIvOXN_T0iGbJ;1 z`F?I>pZFnH-Z9W9%%bX}E0-**ldx{b$8lC$ZN0Yo*8G1(R^vV_AU4bxvPSh8PJR&_ zHHi5na!I@LWpA#pOK2so1&-nJCZAPO%TjIpn3cQhVyZq~4dON0`RN(|lgLx8o+`%y8E7z`+$o7qbmu~K@bTHPMhG{tdIxVTE zZQv=;Ul1)oEvu#-6&0eFxiB(0=mFnhI=?1vaSMkL0!EZSA)LVI;fsC}fM{t0Ju<~U zG);e)dui*s`Z_j8*W71l*kDfZ`G?&IwJ6Qd2_2IA(dx}*n*I@jq{gthJ)KWybe-v3 za2m`HwjF`#aMjlg4JCdV7{Ox{*cM;r=pMvFa=Fo^S3!toe%M~4i7%^&VV6& z%AkBQ7z#46nDwmC`Xg307bfaefQjf4EzbO3PZ=US#0 z0o?{=>5l|tA)<-&)>kbYR;~Pv6;u5LHty#hIOZm1EW$C%6=8UWHsV5>TeI_Onr78R zt)ZHa$!6C5-qo@f>5knc7K0LPuiFQtDPN~5f|C`zj%D1$M<_M5y`o+FB?$@(`MiH7 zs8E^fxKdYrve%C=Dca)K0!8OzSxbZ6T|{nU1p&YUUW*o%5lds z!DZei9(B1_OOI;n4k^sQcxZYVSfrvvLVV&a9IM*-R!m*}ayd3Mo6I_su$_S6`YbQ# z8XHt6HVS_UObJ#NaQI#f?Dtj7(6@i$(!bz%Q^PG1l_4OtVwHv^GBNwWhnh7H`I6VC z$W2=}k!=@|3aAxn+N>T$jgUNLuh-NFrOti>4rCC+&mO{!|jLTy1D*1<* z*m)^f*7a2~{5Cu*JJjh>5()@l%NNL}mk2iehTpB#Q(?dB6%GJsmoDxQ2nC`q3qPqx z^h9XPE*Ci>BjT$(FydAF}@sln~AzG;8tJV0}e zYIGX!6@ZN^S`L7d=(X<2{Ur=H1Hb3^lp z5#lbyp!XkOEU!(pX#u+5c;#{(ItHA4YX&db_vJ+7oZRpQL&n>LtIsv z@L+|@oD?7H0!(n=|qnpH$7|=U0f6CTJPdiaQ~{HhlzBc~<_>F~veE^F76nwU`MVV+R2wvcS8bXf6QW7!JSQWKz% z4%O04QXq)LCl)$>s491?L^z5a)0}5$RYGVgMx&84#(j4P>&AgP?IeByoHHHQ90E?p z6?UCJW%6mo2vTl^oh`{9rqM**j;EeIY{pliu?G`i`$(>Ai~fHQUOdf1&*^Y%KP^!8 zqO@X;`n35oR)mDYk9#PUgi~t_D#MXjSkNJ5eFb7dO3_#j5W)Z(1TF@Zv)l;1z;=@s z2oYT}`7NV(OIhM`Lkx2~vq_;0hU&nm0SjT(0M?E=#kb$>1;(}5hFAdxg-f|Ojygrr>p_xhBAntU$B!mFAQhu~@;&&nhf z0ob$yNdMvHXeenCPBR&pwFmIzkDL{)woR%JHeLtt3J_YBYHl7mVv+?K$|>Z(q}Gz zyg`|Dm$!dl;(?nW%;aRt>x1g}R2kQo$-*i!_{qgBA;sao6_`8oQT2cHQ-}co$QYin zJud_S;zsrZY_`h!EiL7Z}^gNjU^{7 zDJ*~15qVtYU@%!DenMY2o^B<@D9GstI1>(-bp=puF*1CY?YEG+qHA6~rywFw9d{a_P2KwzPZZTQoq{Mxb?h>0>}H}*XDNjP?ctrHD>9%IKNou+?B zc&^@=n53n(Z6auMM^Wh{aBF~?HNKo{Tyd#UR(ASFRSQe(--TCXiGrl$J>ZL_c;yQZqorrgyndUxY=wVh=IG zx>QlG&k&^n;-(&DXgWwQro>7Wpg`8cu#Fmt4jzsMM2bCkJA(9Y;`igYkvnJhbC{wrrHdIx$a?uRxa`Jy=u<9gA65S#9Ab`K1eRmg+5NdR4qsVuShB+1E1Zo^# z45~7)up7rUTu;_3xTMK8=$a;l754`%CViU5fHK&s{q2quYMN83LzQ-uts?I* zEuzkG#I%f(FsQxq07FR~q~NuT|0dA`f^g@0r!^NOI!=2byL(xsLXm%iq;e` z!n6$OP(MGqgNN+&Qy7jvWgY=1W%QAQZzxwi??tgeD|ANt3Fg%%Fo8ArWB-0;)ebVOe=mgSX-)pw0gf|egs}s_g#GXvb2bZ;>s=?2Bj{M@Ao{kB94uu>m|e?Kd3yNf0v> z5a6us9Q!vQTCuk_dAX3&HG|tlyb%HODBvS~K&Rki?xe`x@i&%58-Ls*pL@Xm>1{(h zdicd)8+tn0MV^1EO>?k2rt!AsD?gCU-vNTce|AY=xH_$^k;zgdDQRevcutWO2;Rxg z8s8?eAIys(tc3AnBn1())Lu?-c1mh8;oT+9i$LSr=!DbQ<{7Ol4wRg2r0*j*Cyg`3 zIqC4}bQBEDqSF@&NG(l^&5rRyLS%6fQf$iE1lT1J{#t*cJBTVM0C{Z;r1p1(bLGIl zbeG00yf`%7`)C7Xd+U-%8{R0F#fYGv+Z1H!DFaN)qI-J=ge2-eIm6+V(|Nj0Bk`!{ zqq^bMq$tVoOzxMCA`m$YREW6Rt0#PniJhdYb*ps6QaaA)0Ts=qV0o?T9VR9Hh}_d? zENNR}MRI>)tTGlWvvQ#Jx3^&;Qqwhns3ts2K0vdh`h*l&0@`x%F{|QYlN8~L{l}~K z%THRlC>qJtJwDtdXdo|cnd#{I^ex436G@RS1_9w3gvRgd0^5eC7 zK{4XUiTr#+2w3b!F`G>b=@eknweH)emis@+FZzFvIEJy7gw9UtsT0PxR!ZX$NxvM< za?Lg0#s4mC$CF=UxOJ0OZ(5Tq!n?;L&Rl>rzwf=(t{M@ULASu4_ zb=&A5!QGh#QO|>_()d+1!HKe!7^{r8l}uC^-fi%fB5W#R3bdg9$-j1cF=<<@h7NW8 zgcW}_;`VAQpO#g8sk=2WVVct$zXRvM;H8hm-u-#$3Pk@WU%H3Be9WQ5w}7YP%t2a+ zb%aj3nJK`H(h+IadjcA3=>>n=@E+K&Qn~*^wCv>ps~Ru=ppwg5n)P{LP^53FZ%F?U zn_Na+#@W6*R+&#ZU+aO`(_x@4Cb?Ub<75Re6ZUvKIHYc;q?p-L8uW=T)Ko0U{fdxb7AbH!(E|FHB`_XLM*XATcm8G&qw{q7?)&GBq=k@Np=AxCKy~>lQAI zyGtn^+}*XfyA-EbfFKDFoI>&9F2yPCF2&v5okF1$D6YlYOShc8&-wqEdnYqVp0%E3 z?^^5qCZVI!&}Nggf>;3MAYfNEE_O~~fV8TPA{RG+laq&?lam{bj!p;U>Hz#(jz;$y z=mG^nz{3AxNV@>dU7uxtGUl$&L{$hFpycKN;Nk&r@e6Ya2y=1*xH&n6{w6|PgaI<< z?jS3GDmy?40tQ0S=%gV|UM?UTTi53}e}4rqS~3B+goFfG|1bwgIs#olmgZo9s=2Ez z(D6B#YgZ3*7a-tS-~h4&f}zhQZeS~*3*b3AKwD7- zpzZ_&|4CN)lfVl2>u>;E>|FnG_m}l=M(&EZ9mK;^+tjyF$@^=O+Vl0a`wvyBEh_&9w(ZJitDGBWn=Y%KCR1R&Gulx?qsA z8&FZ^FV3?F?H`#9&=tVP$;m0mEd&5M1Av~Ewj93$=y*AQ0sl~P{T4sh;OpZAaROLB zmjUzzSp%Ox(0rig?m&R6iyP3_=iiF|Mrd4I04tECE5HJ10|KM{gebz>#+P)@_&?4QV>so4;v3ZfQ_4v z3&6$2$pa97;Nt}N{VEk)Am;nFnOAYco zxj+EpKZ9<}$;WB={KobFJnny({Qph)Z!iDXLI2;38 z7X)yB$ov-lfdqL096J9&LIMB|^Zy`T?q>vjJ{}O%{vXP-xy3(72*6?aAN0E%4y%7b zE&vDcUyu*L0s0qw4rc!^`0Uu>U+~$p<3Et=*)#ZG@YyruU+_6or+@P1e@4$)L;jTt z*K?gN|ANn{K>sm#&IIaU4z>Lk;n|1lzuyMRsZsXthk2?|w^aNU>tt>(;MS|_>g4=)8NRoQ6eVydy#T>kdxI)p}l_hrnrWq(L zdUwf_AGs{qJ--)uw}tneyX051z5WYMd(+Qv(;|gmtTePET3hU}zMaMsyZ;VVapT^9 zQ|{_AG~)qV*}ORYq&4huB{9cD#Oi$hbs_UWUX=b*)orEiDKbOT5jzIlWOO9*OF=;% z47lJ9$;^%_sanao`A$Vz=!L}OaU!|g!Cl(G7&qUS!PPQWSkQJF>ER)!lk!#Oq4629J9)4wf|}Q$qtJ1rj{KT8V%=xXQG%*y zIbSJ+_D~XlM6D$bCnK`A1G~3>53h?-G?VxauaO#w8m~r}D(C^(l2o%omCRX~F+g=z zeUYj8EiDR(A9<-K302gPq<|ZeC*x3CrQ(xz@S*(MJVj!75|m5L`PkD53WM0PKCx_+ z92_C)t=?Hs;Q2Zi<&O@jP2{AHZI2w}ug*Q;5?U1nc@+*^_Th@wC(ko~);;CI+1|mx zM*9+Jzxrtd{GxB$e7j?DIL)BOkj5`)3h|F7ImY}PpA)3B5p0)FeftJsnWO>Tt%m1? zc8O6*_Sb5jDpUC=pN^~!6uroo?a@VHcTihuwTvT#ppjidO1+cXJNpJo8b!_PP@(J< zE7H=F?0U~FrxM~30}Q2qw!~zmRw7t+yoZ7+#HO(u#&6$IbX5uc&6Q=AoSKU9qcxDl z-qKjF>|u4Q?7kL#B37b-TrlAn9$vF|!_exM1v284=og5+Cuxyq6P;Hvg#y?M*Qa-1 z?a;X3fV}ic=3exsYvBuSTr;;iGcKLKlTWG+zR4G^tJR{Ifydg<9pD{R&&&W6sg5&hp38=uX;>U&e&9ADmv zlI!2$;Bw`)G$LyPOU5O_Ws*Rgia!(DtZF-jWSTo#&`pwqwVt-79ozct0j`1O6$v>y z3n{tfjzq9^G#1={*OxI%u-&TN4OT`BRCK^c!sc=Prw}DwB%Fs=bvS`f)n8{=&~|jd0|aCANhEZ^MXiuo1F_wCUy!G zDTabgDx(`jatw_kdpP}ZCLr_I+{?fbQwOKP0>aIRoi-vV@~;ynaK!J?P%X%Dz+z3QFXHoKex1FG z;PVZNoM)-VkO<=oWc_ONWI+h~&irEomS@Kg3~?pJuxdNYMFUJl60+4 z?ue(q_|f4+1HuWxcRK`ruU^khv-ls5ghi!RtO~|o)o7vbxWH8hI6_@ODY3lcFr4~{ zHgQUSJBU*xeoe3szdl4I3E`eqDAa{BmC29u=txfSSc;0+Q*Hx{AE`42&syIRqSa9g zh2}0Gv?1t836%L57`g?EH<}EJCEKnw1vX|8SJQN@FEu8NovM{w4T(((65H6fTxgr_ z8%_pJSmEZ@dA1{b^GAs>yrek8ImAHk`6!NmA~nYWwn=YLD5d3MkVBxO5_RwJcN~L* z)J?gnnx0JN@Pv>HE3V|cDReMdu{a=X@I$RCe!1)4Tcb_c3L%NLqWIx%ljxuS=-Y$V zzPR4CQH10tWHvr}n7d>@8GMA=fVKDYd$>ezTTYS)UaD?a%}+QxF1pyMCQ&uN?LfGH z;5_gYtUZbKYfxzF$WILY$~eDC!{8<(91;hL#$!?U(!3>(`y^dORvto(j3hEZVBg7< zp%@WXpVd&>{N!RYXD_?zRdkgV5BLd{*Yr?nS>Jih=X#)$bI^K=x_HQA;0Kxg5OS|Z zOfoR!GUoD5mPkZ#bN2EjhQGJO9>vjr8gZyrQ%j-bPUYfm2Te{=*|;9w2?@{X_7Sdc zByT%WVhuKmUAQ)346$u%*W`*V1H2C|@4k`8W%015s*_!yFTw5v>VCq{7n7+Z))T5zQS%u(L2_Ez1F?1 zTN6_%PA7;EYVo#r#Sn->Sh|7%V}*05vA7X3Y+D4m(CRGkA_-Kpug&8dM^`CwD%px} zGNo$<&DR*kn^4!n4?kcm$6;ZvBB>Tj2a!=u?F=M;Tbl??x~@N^&^>x^qI{gZ4w%Gp z8yrJ#weMc=DMJ8HV2ACi!86!@ys))}0*ZarNKz7i*gP`-#IJX4&sj1q=6G*M%6sV4 z6wc6H^J0R#^E&5|kdmX&&}VL8-G|SP^LyaPXoVn5sWS z_ThA$VVHs8It#>iz*;G?Z=xOe;mC31j&2RW_26a~IwyfSq>JQr-wwLB-MTW-y9EzP zE`|#n2dw46eKd%FYDHXdJL?L)Yq9L_rDK*<--DS7Za$yD2MNH{X$nwTzrQSV8Tnwp zWOZgusTOy#_`UD8$@msB#+Jgr+od>Kaz&%%VN3}pJ(O|y#rgD}(rWwc;Wm`nkEz_` z)G)RNMkujfCt;v$c~#_Nj!f=W`a57iV31e@jn-fVuU>zD!DZK^c)m)g$z#y!z}02p z6xy_LL}S7Mh0Tv|hqT;jxwOjkay)u#^N_2OFZ4Xk9;eKq)ndErNK1jUC`V=efy#?kzY zA;G(-s~1>VpDPowGu+aHw|E&`yCS;-06TTG&LHa42b=48*(wnd#p$i_rX0q?Up<-I zgOyl<;ZD97VRciZef1qorqnKnC9}t)_cN~AZ}4A#^C%e2ge0+>u$36U8!y^U@0_ ziwHM=^|EExutAe}1`$KGnh*{&Ysdz7Vxf4Z;I;DLSJ)6#yhOV6R?S;~XwvyYFt=$aDx5b$!CJ=tk@lPRx$Bu& ziME~G@*Co5Cs~*;d)`xC>Qg|$Etk%V11w}Y>hoNNT0#ANN7&OB|>uc(K{s-YSKQtlyt z_~&b%fjO}jruWyuev9QyX(>5|z_q&+*0F?lokp=}Ud+{quckKY6J%$z8#&&L7^;11 zvPvwHwWN;BJn$)P-G+1Hfl&gV&Yb3@z+CY~!S>oyxLqHUs1%48`K4JQGEzIKl8{a* zmlP={+u>q|f5?b)yBZsnv{2$NsJv`{7;`^;>B_eG5YB8}-Q;#ne?a$XH(nn{i-a#+ z`Dk;#l=2ty3%?HX?uZ~~sl1p>n5d=7hJqdvMpB+$^`_D5r>Ud(J@$v!`iT0ef;MC4?l>!K*Y<(;`9rp2JB==LxuIq-n0W#Fk$& z&S0$hBQ2Bhf00Hei0zl_LA(rqL%C3Tyu55tN(@{?H%pf6D=r2kPjWus&5cOa+ma3M z^Wt@aR`fZqYVp`GtHJF#EJvBhOIOoOrI8Nl){CSlJ=d@74ts zov9;u&}z`zakxYwZA!H)LwfX-LcBD5r2=}~54Z2QQ`bj74h0!v8z}6e9LV3ZWgU^d zZ~a-1`?>Vp9ye1*!2_3>cUAu-)6n2c@w+7JS6KNNUx4p%#E1;eISy}wJx-R(X@;6l z=Vnkmj&A)$VhUp}aE8c#2(tnp$o!fPvQR#5|1_r^qppt_mZ!8w7Kmlh8WZ&ckp(=R z&^w`{O|JQ4U)l?2>TQkL@X39g42x6>2+Km;#80`XSg1SO+>XSdG4I;1N;O9fCKUZ| z(Kj_DpEvTl-nG5+op^)CYYVZJBgPa;ls3_42y^o1eM>StwtRtqQYLIJB|xJr5HVJV z3*LpjJxr$lE?DnBJjRuiz5jll4ap~0ZRhObMM{;3s}*KFvpIFtsWBNxp)CuXvWPY!7ZMALWNh7cAs$bz&j`vKC$@ z?IFO@-p=2Dub+5@5G-!_9pIs}Tw#U=hSrlL#l{ z|29>BzP?9rIPopVAT>o>w<@`EWwd>dA^ZTV@D|?x*_5e*w7Tx=l#=8 za)c({v$#g&aQ|)P88(es_y9w#+iq4^o}}y%lKA#(Rfxf<&qE+Su7V2|byWW3f^G z;WuiVjaK@s4L+p25<&F3rR=3cT!aqv*%}?n=xd7=nm&$843FM0WUZWAO<-RarP^v$vRhki)W$$;TzEWx zi5=FW9wTq>n`4fgUqA<%w$^FPy$)cL@5?~P%e*MHjvgv9ftBE{wBxLIx{U_t;%}|ondC=s+qy^M`iWXu7bvJ_(khyCu4{joSEGZP z4q>?)G!80M3{%5RP=bcqKhVI5ZsH4nIL6}=bPs7ghRom~gpt@W6|~sj^wG?;dCzkX zi+(C9lTaBSM#(d!wt)ZE2F(eOs; zf!WdNx+`Z)(c9ZZbdvEG{ac;6G2;)_w54XH0aWlz*Grn{oSrdhoa)nHI{fu`dVh{s zxT3K)#ZAmlrUE+cf?B+a`AoEbfwobx`!CuJhJK0M`bMzJ8;GkUBXhA4#h_*4HScTs zT7UU&W+Q8Frh{)!_bsZ9r;a%xGkmK&HeQL)MA3MzSzv}UwxP&eZn3BBDK^~hBUwd4 zVh6p0m-mN&aSJ?pk8koM3npPzUpk#WLwUjOEhTSgxlPjxlLq%tzt(ntL>HgMKG|uu zS2NMm>{DcYMsfZXd=tjhmCmf__m4C?_?h~Sm=r5;HW8muck^h$d=4ZuvO`G zD@E-!$>)$f+1>F&DT|M9qlv~#TXY)|%x5RwyoJr^0jzu%1Q4kBRn9iQmi0XGh-mZ} zXvek(S?3F4+jIweIubK~#`nbb=AempWTA4g_1p2Ke>2! zDLi&_Z&l5OIIfz1g~=BQOl*lbW)=la)U`Z(NO8p_G2@z<@G~Q^zjD-Tbk8rhN{f*F zL?@F9kzz`WF*c&(ehhP}>hURS?%LcMrb;7VLPHi1o`hu2sa!vi1u(JsjjG0FOs<_| zR`_`=WiUD_o%>;b;JLE&Od-L%mrRySi+vxK=v0`h6PZ?jMSy<$g{VjJ71?fdVaxaN zE5wz@7Zd?oiu`gk2g{-B0bNCEiugouzyHI5cOy}yf^pw#^8QHo{qdU>w9z|A$lJ!3 zd-FJBnC>VpcPzVmQAG5uUD7wJ{p5G4=^NyqDwp;?LN!s~3$2MO4gh;Vguj&eumubH znx}QvpCkraLaD;Yf7j^nD+TDF3e`eoE&v&ZSLV`8Ns?Q+dL;D$tTMCu3VG|yp>)pj zd4>Zx%b%#f{1BocO`z>R)|mBQxyEcMKV?KccC^xXWX8XKZG0xG{iTIqPRJFD$bMEw zq^E&P+Zro#^r1i5J^N7C1EJoDbxPZSdi2Gpo^#oKD!%q*oe1rDhDX6-EeA|Dtx+i8X=9$!p=~E4++Q+#YoPm$kIu zdj&Wu?8_XWfB2_3xlr4I^r*AeF3!DQY?-m~w6&@OAj}uh*bg;H+)fynzWi=_eYF*? z?S5<|XDGYCX;x=E4MwVrcU|~8<9$L&Y0KfEp~N=a3A@|0ETug)JLzKAJ}-T1;)-Os zyr;f>GFtl_C0@^hD5)3F7AjeOr69Fai#fP~p=`82f2wn8EWh}{94dPpCBo@ha=+m= zWah1@S62OvWjA_Irz5<;K4B?!7%SmPvGVGd1$x2kZhG|AM#2I@Agr@|RX1)-LCj?s zCJA;X1tFf>NBx}}RI{~yXRin$o>{sd63K;Rn^VAqrVDmt%}#j6S+*2{(yKP+R8qH=U)}9 zo&T0@jMl)2jj_d`Q+pMdTfKM}r@QJh2!-mkQ9!hIhk4V}fzo@O>*{piGW!bfan=?Lchgp>r zO!ePqjB-viBv_|yQmVcaaCm>i*+Sblf9*3HSH}timQ8_i-e{_sACGSl=GCUVK&Ppu z`M`S;H_6XWhLVIjNrSpVOjcs^r8cAHa4%nBc(fPoO<%d#q{ywt(a$v37dzS;BBtDC zVqIl9-{BsG#zA|&h}kAArK5y>wJch$iykkPFaUN<3F3X#hffSZJ5+)ld8*#pe><1V zUrZKCUikBI+K{b6E%U0aiDS9BLo`egp4pL}wMAY`!_M~}+CkH%xonb{h9)zLf+?)r z159}mHxhS*u;NKr7^q-j|AXmpYW?)4kIQDHRMM_hqW$A@8iTetY^N7IA-mQ|n6M!7 z^R3n)ED^VMC!S2Nskp3hMN0gxe@2$(So?kct!_ZHkPI-bT!wIQW)Cw$iT!Q9LGh!O z**EfjCw)u6+y+L!!~s9WQn*T)(o$Q^g%72-;jl@4P&m5)31)JB2|3HS3{MX3L#F6Z z@Tji5s^mglfyi;6@e&?9nj}jLkqa3`DY^{ILSJj@NSm-Bk8}j(NyFQxe-BzhD)|Yl z=Jk>l4BMJ@&Gf@FtO{UW20+HWKjjaS@zMpaju+?dGOmSFc*MPo-b~?Jfo~ANPIY23 z>dDE6QAW6p%n?*wd-~|z`<1Yx9^T*ZK8UdSwc-=f5ZQwym%v&^)`RH zp?KdCpXqYa3!hfJ2&0ym@#wSUQ}4+Dzdy7BDZ&EJbRf>1u-jm-B(sd60m9jZ zX*nIhjYvT2y~8a+e}nQ27iW*X^$sGxT=^@;By8X&C9}B)@bU`@rB-O<59#+pTdWTT zJFqx)drI&>CJD;Ne*jaoZ9}8BP{zmT8DL&WR`+71_n)Bk0fD6-SX5uAr1ps#y+YA` z6Nbg0KKhpVmsI<(LYKL3TmydS(FgpU^$AAYfR@EMBcDcne`i6GL5=m)#m;RvdoqTj z%A$-ml+ne~;ZOFB@jYq`fiU0pO!RYWn<{P@^j7Aul}J5`2T@)VJ7UJ+^mBb#=%B|k zO$_)hfjPw;+?KxXGor&DAJ3^HV0qhHuGc$=H_D;#`g4ZHugeNUx6*o)3@}<#>>ZSD zGYliln*hlje}HXp9|m6`Va0N*KBc}4U$r@n!$`G_t%8mBf|4dO|}4o)%W zv!3O5?}jaVP3L=DxjsIYM;{>V15qwgmS6T%Y&m9ey^;tqBme#_Lx8X{X`r#9y6-6M zBWLRM4B6K8j^GX7yDPz?%tWULYIu0DBpXZc839G>e@@H$`}8b!NSF_gF>=c_>O@B8 z3BRq_j}wDd6(DtW0~tgZS4g0j}az`t^fxQX-$@0|2?0n$aL?He|25a$qRFRynJIBgX5of{?Q?yPLvus zG<>l6;!Gg@#75>OrA$~oF9VlT5Z@_BsAh@$*e%`p|mxojyfSa6I_sj$m90K=VJ~qDvdrHB3xP5z!OMNH^0H!EWpysUnn;1gCfL+AL$$o=6Znk4*AxtN;DS!18uLo+qym&$gt zkfC5031(~OKKNK#c^&3&(_Y6nc8h#*gRwZsysMbQj<``x7n+G0ZjW!7I>V})8hq1N zN0ri@Gv{JIXv?6)k!deBK6P9Qf4hEE^=IeskF@@ZX)q%AgyGdm#QQb9puK1bIb}$$ z%U@}Sna9NThOWJ++y%LOTaFiKpa49O70&=OG!4_i7HxG6x1ra+h21sy6nW-il+NTMLco~k$dSa>lVK%p+>U4YKxf0$JA%#uFZ z$(C@xS#sV?i;icWsr-8~BdN}(vS3mDy_A?xGfIIImZvpCMB+~iBYvk$+GWiu-^$mu zP97$C_XG{r+l9x7#k@;!t%MmDXCG6dgAh_&8`*;V2XHx5ENUi&W8v7_aCfu#k8e;= z>CnD9YX5{oX1Z%sD-7=Ne`L-qs;<8d?;_~eW~qewe%N94N4G`T{xsepu zth|CyJxDywkdzmYaM37p^4eD5Wo?hdxHaP}ivl);M%>vhan;{!<9K7M^^v1v6okr6 zzIu~jt##11*aPo5jGKX&=u>ln(TOyR=eDQM-r6j4Cfu(p@=*dp_KBGajR2~8MD zz0m|J+ZEAC4MXP*Tq)wg>W#Bt3j3glL>wZVdVeBy=xe%E(@9?B%a7e37owxT3$|U* z0GpWYJ!A7s_uw>{f0Zh+U^Sa32S=d1upzZ>wf1Nq$+;u%B*jC`KC2H0)Yi$Kr7Fv( zHUd-pCxaD8h)Oy?csHYmab|JGI>}jdb}sb0b_K2IeV(glRP82W?s@A=9)&&^BJ`MO zgQrGGULEa=+My++$bsfP1LT7zXdSXwq?fO`82Ejej`e*iUEot?#^MoSPn?^Qy9_kXC1O3 zlw~s=6NTX&m^FiqtX_(jiE)eapek&g+1%IJTn);Sox)*!a3_mnG(}L1F^y&({n4Cv zWQ;;vPKMpef85Ig*Zr;&*e-}Nfugg8p&TEjJoqfm#EvZ zi`iblZPu+Se>UJI*744YPkQ*80*;F_QO=9Yzr8FCe;IcTt%Wq$@gyDoBlma94bs3R)+yQ)rq*)3>tj&rzQ`d9L+>MBjY=H#lE zmO@{7x9Go<8a7hkCMJ>^uuTiwG$X%XS*>jcfaP)FWCIj z!H%;k*Bb3tj$;7uYWgVHbccuj`sm=WyXqxX)Vy z%5@l(eCjYpK~6fVS1_CsK!QERwwG>>2C}tqO2yJ$W(^>FlF@RT)O5c<)m>%kumT~& zZs%n}S?RmZR^n>3wX;;ZGaeD+TalNcEw+SO8~4W6-L7mXKc>(cF9MK-SN{*)PqKKI zu}uLJmn# zcS(#6fzcu%-Q6JqV+@$UHb$4UpdckkgCH&44T2y@mvl==NFyM^H+=)&-~WHk_nn=y z?YjHApZk6uHYOc?URfKsHAD#xbLAD_;}-|WYZ@2`2m<)|h4}dS1##Kf44|%#kbmU3 zY(@~I3lt6$|HDEa34Z~(qGSpnSCpY990pKxa|8$o0R%+F1@4RU^8*C=`5*ja2uF$o z6hQ7!8-OMsKn)IqxZtwM!x3IcsGYqlD$hTE0i0kifWU(X_j!K117w{bNGKQt189O= z?IBL6j9`!>Kpzf%QC9hL1Dk0L0~Z42?2t6L1A_PTc{%hpsl3A=j!Ro z0|3Enei?!sU4P&xe~>!}>Ikw%8T>9C1W=OI1%OZt|K{fcMnVy;E_^Of$6p+Qzrvu} ztO&D_hdVhzV6HB>zv@$fA|YT@-@Sl;AFcxo?g8`p2iZblHnzWL*tj8phA^nJ8$?y% zZyS^d_eN$1aRrF*^Ye=d2>~F^0Ej2p9{4MPffoYuTYo9=ON`>+=YxPF0JbO^5I?9b z1oeaK;{tMr09=u75I>(k75_!J0s;UVDA*NX4Y7m5aBrfc#1PxRFzWn~P*1=ke$@C0 z0Qi4>{{8nDHDNYzn4{N?`R^kJ8fwey8|&WtoASR(IXSo|z=u}=z$+*u3=k0%28cco z0r>qlihm9W`gaxlH=e36TR7msU&W%j^iRR=e@_7C-|N8z_-`yNIBISo0M45+H|H1O z2cy0O{-1~ax6A+EjQ@)Ae;xDxtw_nu(ebyQ^Dl${j~?U%b@ck%0yVd8uBaW*grhbA z_P?gakiQmJ6Ji5(bNXMcsw)V!3$idf$A23Mb$?NUdO~b;psry1-?Qhh*UbXp72xOpA02ABzz(R}!v!^xzf};_?)*2SA`A?-`L$$%BBB5g5()Cc-M*y{rHW1I>Lks}&!Qiea7XXT#AHWul#Qk-oq9OpG>@U$@NE85+yFm{CK*fL2 zeSdxcQ0WE<0f4GE2<4}7gTw$pts8`jqWv!tLq*ZKL4p9F-VH*<)W1Q(0HDDQLe*(_ zgHZX5ZqR)I(D(+S@|pgN9-wrf8%C&@AlDlus!;12B!EIl5ZD2NdJJs;uoC)L{?|1B zt3YJ}|BFOW!N71w)It6u5f=U>adNuJ|9|U*fj0j_AruW8xT7No`G*Cn3dl`Rlm+BJ zNkxC@o!wBIa^r&PqV0{#F9dh{GbD%k88hZU-1_)S+(Ay6;kA8J&=h#NI3Bm(s)!Txgw!UBIw|9^V| z!l?EjP`3#Drl-OvvIs{vmz%0kbe-Mct`HmRKZppRq<^$X09Crn9}pGyCJSo!fUX|! zKh&rmx!sHb%J=uH=>mo$|Kx>go%>B)DC7-6{uSjvD-3o+qKLWvzGYGS{SW^AXhI;K z5HRlaXE<0Q8tcJ7C8+dYb1 z<0G2Uki#i$TtN!f;>751Hh)W+@+yW8Kb5m99XQREW-)b^2GMpM#tg zkj&gk+8$DomXa^Z^vDH1;Hm6;bS%jwBN1EZ%;}05RRQanDBdd zjO??VuYYDyJjPaELeStnmvD?(<=Xx!V)G6x>QwhBk5qe?5z}!SAN~w&MT6SbF>!17 z9ww6pN$o}YN_nbD*?--zA?n#X&S9_Zy`9aTl{Z1bt|uMh3jk6%l_k3d(D(g@tZjFc3P>m^4w&3_8Rk*?r%Pu)09{jBGZ^7OmM z?#Xe*e%_);Gq-ZT`vYlZ|2FF7S=~UY5&#-`aDrk5cC^?eZw~ulY<9roFT-H3R|f*U zZ6zT=5gZ1Gh8b=XYYcZKW6+2Rc23fq9s9V@be7*lQ#TKmagU~*J}TiVC>&EV?!Pst z#?DbbB!86|vANd2H4_bUk}i8t-55E%$ntnIT}kV>sx2;Fkt$eADvQQ+O1pa8pNZ^A znHFv@8?8Fvq|5fuJC2lmh@e2bLtn!Dje>>>QAeG5P(7K4xQK3_hAK_kMb1D; zQzc3v3$ugL)Vv=7%V5HCJ(v`(=DW|2ieC}%z|q-L@aO1%2vF zet#kH0AN#Yoi*pg8hY-F5m~=}Ywp5)VcDpkHJUQxc6{;+?|Ou(z4it!!NytsT-2o; zk?;1_@urIAR&gn$p!Q?(1Bwf47g|GqJv~~+mg>T}w*iq#3lKJ3<%0IT@!~N#6541b>k^|6J&&y(a}2vXv(N3}@!qzL)W466?c z)HWa3oSUJErhooOd-Bb(21+H~996&SjvpXzIi`-$I3?Ul}XQ}fN|e}g3*jG!ebw5TNC<)W?5J2dVghg z%RnRMrG+U!fdx9crRc+rgGaVX^@$;igb>N%w?d!ZTH7r5uobB8=VoYcvutG$0cc^1 zN`qXs5)l7OSEg(R_VwF$?j#F-zyC#ynkjA@@p8aKuY>D=87;ze=8k{(5m4hhkf$%; z&hSI|^?XyhQk&L~rI-kq-W{wGuYYtcbpDy47oD4x?{?SJWgI>xL$R%HW$zO=ROu1bn;)$nf<5NQ3VHmZT{=Q;8-+xXBXlcN62ZjzDR71;R18JTJr&#a)AoDB$8Vnb%Xg~$s zXH4*%g}BiC1ZV43F7`zN`T%V)2#IqO&u_7JCvCS|lipK3BGCP8qsjXI1d8zU$fH=* zmpi+!Z8<4v>(tPJ*T%HKbF^{GSx_T!x!i>QodD}#%sj^wpMG!LK!08dxq!CmNnR9L z#*r)5dp8k`ajix2I1%Zyun=#n!{}ibTLqiUi#PorE2pX1Y%izL-M@N~azIKMBbebs zy$j!8+@`BgMVKwR-1{^QJ7J5vup#B0S4kYpnNwY|LpKQ>j{JTtYLe15mSkPuS^48k z7sp-1bJ0kdVC$&&lYjY)Y{+L{m1jZwFNJAcN~}G_qWE6ueO$9Lx6)x@crpt6?h8KT zs$$aJDN->wZXW(*;#>UAinnqVksoNwtb=tT@WOG29 zRl5DVGMoqY564VH4M0wjSC{o%)r9qjQ^mC*=iOX-M*eEO=zqCYexICD*=7e7y_8-Q zD>3?Tjlc$Q+u1+fTGcr#*HZ|2Cw+KiZRC}5&~~{4-)hcm>Fh*Iu;5rO7xO)i*%LsycWa_)l-$#vR8n1Vbv5=oS2%;54Dhme-j8w)46Eto1 zThUXgj}(eWWa5!CrGXeyXJ}^ed-DJbp)9)n<1tV9oPVQ;%?50&PiXKo5r%EOqHyE<&&}f}^-AH9V2;oNkE_bx=NFa`{@+VoCPV-J|b0?&G3}Z?rC# zb|$-wdhF|@U!FdWTr|<1rJ-lQLgH=+Zrx5+Axi%sY<$J zc$t3ocj16@Ra!`{vajZs@pvB5HZ+3HULj|emw=3WUxdu38Uf-$Js|-rSF6zsu;hCb zlW`|Ps*@5UI|sB|5JoF`I?Wv9ltpQ3!~&ia*MIe4U*|2qxHBOJ{A&`YIc3(XPj4Rp z^QKb^+(^X0+)}%ngUnRV@KT#vX@!p$x6?o z&2Wonus?NhdDFccl7`DRcN#js9P1!#e1Cefy*O6A`)0|p{~hll`yDUf)!o*rT#joF zd=JNn=3&!x1LRNqitgLJUV5x_d6WJ+v^Gf}?so>orIcJz(~%V~MOD+_Oyw0=<*L9n zcx6p2i&iPu-MRs-d_<&*q$>d{G1>0lHPSs=fBH{lD#o)Ny$E2(UR4qa*4}oZRDXN! zvr!i>(EXhvaF(y%XlQPl+qmc4YPaUso!$1D{@H+q5aqEenzeN~e z)K|oDkm>n^plozc6VlvlwnEiuTZ#{K4(-mAjPxfw z`sdGSzG)xCY!ZeEemh&Fjjj};B!7-apHcg9K1`NpTk6XDh8FwjOW>{ZpJ1npa^@28 zng&O6S|YUsGxy7h0#RKq;5238>Gj-smy#)!gVQHbbQgo}AL0nxybR1}Qurcz@77Gr;f1 zdbV(YPUrpv@Mza!1GklL)l@93GdC!KKcS?SKmc2Hm-7cN$@SZ}ZZ4x*pp-|qo?B;L zxx)-Jfa^GS%(sNuhz>geGiYJ&o@sBhR7%;CRjQ$hlI%WUV{Xv(@7X?thVnYKF%m==XP; zyp8&Vq$VsCZ{tkZt1{6{dnSXv(9@Wt^wCKy7|Px$9E^Fius-e>_quYXwooTX+rl*y zQUuJf27FnR$!V?DR~S9zJnbf-E1-S1G93`~i0g4+iR1Za!zifxz(n{_=U!PU_Mt=2 z3b01Dac%2-DK(qlCx6HTQMk1a_T}|rWqeHi+3E*vm0ipJZb)ygi+=CyvWi!&_V)^% zx=fI6*68c;A6&T7BH+mR`oI#4loQ-Kgy8s?l78qx*Q2yl0!#oY7m|>rrMLLGQp+mN z@YP|UCW%MG?7rJxF@E4(G$v-XX?1*LQ@)h5bcv#zKGHPS*sZZ1hqr+d@v2^} zpt#G_AR#nt?o!t9!Iqk%PGL#cKnCZK@2^wDa7QbcY-QfRe!MXLfbV$Aqe_e^|Ud>Ci^&IVS8-EV*cia{X zWlZ3u!8Gz=(AH!$@S)Qtwu`-ucz3P#k}GM}eai!nEzX6IB25V#b94W!ZK=#ElA3iN zg~{3vpBv0u9bSFF7+hs=3B>7>Sz;c3$*Ey4j1y7kSbw0DtGKllW_?=yl{k}oQ_#Y~ z1LB5n2Gb45GbQAmN)K{-a;l(I?Zh+L)KzosH5N%-1D*!aXMVMMr$xV3+Vm2f+;U0IYhD%cs)=?E7o%_79KZuAlFLXXR5Z}f;KhEH52+is- zc(8yd^GGf8oiV?I6xFN65bEStcvqi8+-)#5vFRJ=?f)P$;H}EXv|N{?BcH5?P49{x zVXG@Ag&j}c9X5NBm7O4RP~H&SH(C67W-kp)vVTxn$T}y?+?Ut37%HFCm{eBU`}1Cr z5M#y&^PTq;Qp01$3rNh#AOvry(37vcYm`+S5g7%uyA*3UpM*Rl*&wtWu{#9Zr#07`#`iH`w>7djDEW?z#NsPmo1~V#5KRP;2RML;C;H@eR1usTr@5*0Y z9)Ce)dLZKJPei1AKB_SkVkhcR^N;RHYR4L@8+kShe5#B-KOvWKUZvH#`|5k_<_Zo~ z?Zo_3%D{f9e%SzqHz!Z^MxL_We+g=-*8A}RvgtL;B^JFpAgYF(c47Ha7^@S$b}cdV zaYugDW4*hOzhXf!-DviaBY1#0(}P`gZ-3HpEA?9T+&HBw%)wPb+jhM!&_7^h^vjzq z1&dFBM9eAES|!nn&}%Bv(cQp-@_jv$w3ppgmg=!%oj{PHcjFzG5QkR>{0`#>3+;r*E?UarB4?jg7{bF~E{co^oSkB{Hyl7BbO zCj_f6ONnLLos!ug)QBHl%^%qhHa-c75n(ovtts22Chrx0A^h@PGlguV>jvj`Ja|Q} zD(o?W^UYeJa=%af>bU}t(bhuYb<;w*26shXB??b>#-Up?G5;;)E!FsIl-wt>@W-uBd}{ zexaQ99?3{gQH>iQ?7U;a(x;2+yEV(}WhOa^-TIaphBaaKK;|&=ykMQ&8V%`mOG4}O zw}7=ET@X#0WeAXC1+V*OelboRa*~s0E%n&#T%|PoGzGjgT9x$DCV%ddujZK=+lA>` zN6+5(Z~5^O^=?I$&wJ$HJBlxPxUIG*pD&o(V&+HwG~mnJv7E7`zq8PEwcK}|Z*TG3 znE(UKu=cV#kT4(NR;8kE5*4~tN&Jxbl!l8Y+gOo6i*LHaUQl0cA-KN2y_C#ol1O#6 zDEBcYJwSQ^{ozq^G=EFXagS)^ld=ZvDlcShTvG>E>{!|;NJ7rreq#odF;b-k#gl%CI8e{O1tllBCVxnwda{h)1p96mrtd< z_#;)&YrGJgHhejdx8wfRo* zdR16IQ61fe@B%>MJTfrsA6VsC>>d4Cj-yOy!6m~?tAEMpz=pcWWS(sbYm}=i{KV(g z)2GIs#`;&>tFuxmU*E5?0Lk0N-s$#G?#$Qir@L{G^yF&L-rxL=>+$qC@R1MgH&u?= zHUb9itUg^r%eC#K-F*R(-n;kEafq--w9YxQ_d5&Rlf`7~_4bFDW;oyOb4&M#!TEz) zGPi~!9Dk*(r)h-bl-rqkR4H2(qDC=_dK%;hGyc&|IPej88275j9{+BPh)TETq($5EPb zXatjKdFlH_Z*mLW42M7L#ZMa!N`G^C&pzY`6j1(g8Abb0q|ETFO3uE`zLeP=Gr{2&f*98N)^)* z8J)pwSlG@X9)XbhyO@!<+O2az`OVbc- zmilmG6?F#!h34<4WmsQfB^9wO<6-ad1vAs+;B&chST&qRk~!-xg=({;sjmA=8diGC zPYnB`s2p%}4wj@n+w*;P8PqP^UrI9a#WF_eR7p)9rcCsF z?LA2{x{U~Q%W3bOm@yYF-xgFD_h;%~W8%UrlCRxRa0<(P&rlW@A<#U~Z*+I<&b>vk zP%aQ~7N0*#H;n}ETX5&ar@f4&x%}4BS==C1!frJ@GmNepMP)5 z?R+=Q#DY#9$Cf9V4GQNv^zVriNK=qtNW^Dhr{Q&CNMdQ?S*)+K*)$-yu!`9BRBf0i z=3_J58p|9jt` z!_gozHi`}0sH-6AkFWeg#V{ix!9NX72@0HRlfThxdh%|ltHpW~i&x)|T!<=oEUa@u zd_UEie=b!i_c-x9DB`07$L7hxwsB-88S_GX zYoWa&dw8mq{j2J)ADik#f`4mz%`WlA`yVg*RdLLD>j-8l+@G2x| zuqFiO{p$c9n`<&Z$7IRR`D?zkdT+DmtfsrN_XsD7J_6@<96Urx#YC2b)vUrHEUG^mUELK`*7?QmIvZgL?M0}y{dYO0}BO~CImtC z)!v5K5i@BW+vbgadVlhov8zPg#lrSZB8(?Xp-{KbkX7ieGp>!4O?b9t$DZdkwwl;| zRhr)RgDB#-@rJnNKs|DE??~5Fbvm?K1>0OQCDwwODSdk4GzYq(Zzp62T{c);l$ck# zG)@guAN?8amF{(Al4Bz)EWADq#OrrX1(;V`QYbdjI;M5>Sbs=u1dhtY((kAEh(3c{ zRN?GOO&7@datpuHT5PJCn?1jM;J(tR)f|dRLJ?mLR*x$1eT+`y^h|6JaxA7A=;ot657T>1e2+PXB`C2NG)w=4z! zdH15&4&wYmDs^I-d$V3b5eGT9)2Fp= za_n$j1%LZ5c00p8_d@(wMLcmpnwq!HrcR!3t)>{OBu4Zm)DnHn@te|ofB)l$$qSrL+>g$9|X ze!^N3>55w#&Ceq!H^Fa|V^^nr`C=7MigJFGX@3S_HSN3V(&E=$|FGZvlS{qqir`pA zkGZF+fW5#^hK$({Sn)ptjJ`XIr;Gh+<@=teFP~Da!WdB48jCv9y4EfQuVc;faacyK4z5>$2_gWu$sK6e*Lpu`WbLvv&-b%l z3Kjq+hu>*cQ2Td+-tBG{*$jmYt#r~LyPQtcKbHhE=k-d9W1J2CWF6(&#_l2&J$up+ zPlojR$Y7XbUZTtAC>MN~)PFCjP~-M^8awjUz1CyIadD_Q=I}iZd;$aRF9CmJo$iXJ9#cNH$@iWqQdcI!mW@qa#ZXI#P)J2f46 zS{kUnxY)Wl1FEnPV)Xaz$l2bA#Ii-Ks7AQ@c@z4mDZH=}#jA9#^TbSCKDDIRk|~R{ zLF3=(&s60Ubm2%9To@Z4d67sTRxaD#;yv(|FPfP?=Q?fVGM7=c0UH`KI0`RDX>xOPATl^J3NK7$ZfA68ATl#GG?VcgD1Yr) z-BTMm5`Xt!p~t(r!utNIN^Mnuu%Q+bE)YVN;$g4{n2WKAXMCIFufJ|-J~U&T#VjvZ zcjdCCM{0HJ*WK!tY(W^|#9P8O5yBI$h!l=+N0fk0OSCXVaAG7p7_k!A6mc5fG;v0a zILsGP5S*k8Cn&>MkOKWyIwCndjejS|A{-}D;uGE#5eAfkKq;6dAYVGcMleMw3k@U6 z!n%|onrRK4L~GzvhG?r{&=Ku54idu+gLM+4U}=UJ2Qn=&-mno6%)w-01@lBm000Yc z#3~TUIkDPW;)%6P5DudbKx=$@HhT4HM9;oI^g~`Q zR?A6Vf&oLvaXu}w-NiR@$)E#PHx||qr})_Us}V?9!gN%F+`s%16dZt1^6C|#2ViG~ zBS^v`Y7$m!8qxr&n)HAnl1jt+Ytj(T8rmZ~q(KoqSuQ50c||S(%l-kOXZg2^Ts3QW z6eKrmDAh~AOc$AeOCWbkPk%5!7lmI#VPC{qk9z2F2lPDGy6c&Mgct%6?1cd(5%qZV z^`Lc;h&x(70o$dPd@Qfv$snP?{*~~Q^;2*0mB|<7H2p|hVa6U(fg8i#$3BUaF%sKA zTW!X+=93m%&1LB4I5W^L^hX|)8s`W3VO%4{8f~%l>72L<)?t%_wSOb6bo@57WZiqi zhwlQu4(B9T!(1-LkmHaOlCp*`_L^F%vSI8hi79mZh@P<MH1Qazx){_jw577#GJ` zwJb22#*8zDdmla>eHFQOL&QPs>=;bZpzA6PPK>Q#BplvDNbi!X5GDu3vaI&*vLzIN z5k1Q47mjbAifMIMVt-``0sdw_Sxk%hEtZ(jft)D3#9~uN^`&xStK(w->pu}o>bb@S zBf4MQ+~lyO(aM+7&i^sS#TF8= zwRY_A2`StviHVCbNGT4FL_&=nq)Z8|wE~kOhxAR9#5Ad)ynhJduud2Qlvj3)$0s$0 zvlWCd^aCHzR)ah^bzu(^z^N_jF$NNrWgy#w9+WL`UBBPP*~OsrsMV2DUUQJZi_NqNZZafI`$XD@9lEz%vA3hyf6NF=n>rnNo2ttBQa3ka~J*DbzBtQPFz8k{g&)@9f- zi%|o%MsAP(frA<%biu<0q6N+v%vdy2U~o!dSQ-}$iGQ?{9)kp`9h}-Rbc_moKG@KR znvAV+wp}&qNv)A0(kc{e5&aaNQ0OHf#mI^L*xTR_y&mH%_C&9Qc`a`oR~px$RG>Sq zFcvKo>AJ-zK?xX7c=b`ZH%#~n3s)&0qTdDEZD?^fE2&$)XmtxQ+;BLDy1Yj(#{MAN zHZxFLM}Ku3>29oLcVlqmQHhMd(l)EXZ@q4Vu8wW&L6pYJHmWRSAXjH2BV)+Oz=iu3 z?~5|bgi*+2V0#~C$wpqBS<4m-cb;lxBNu$(3}o6D?OhLWpX%OFOms&_rEbLD&b1oS znG5e|`Y@yAierrvOq(RTvAEnw$2JXwI(2r2hJPSa9#dg#F>(946)GapA%q>y*wCUA zKmtSe*FCU*!A{(_bDgxINMOQ^{k8niMjk9Oyho>;Qe*0jZOxO8GTyHF=c|26o31Uk zH5M5YF1E2JVmBHST8$d)02UAq1C0d~0t-~+lmdB_<+TLx8{XCM)E>rbsbO|aJ1odL zlz+RZq1G8%ud!^UJy_~^&l2l&+7l&5@1=C=`Pko!2uR_!u}$z*JvWsZcpASU)<~zL z5mBT=JG`yz=jCKsJXDKiymrL9%Hh%e`Rm{Rv3I5%j5zpsWJpTrac9m%N(gH-A+_FHv+GUz5fCeFhesE`X^l3ozvky(#F;jNZT% zJp|p|_lLWD-ZSvLfY56L5PvxeDgqT1)KU2`Ta^%+UssDNpI*=67`mp+?~AyEviR18 zZ84j6!TSeYb$)Q5_1#9`+v3k(&p2mmrLu-9QN%DYf%Ne^LxLvsI3y~$M<`upZXvdxj(j+~Nh`@DX2 zPFvfy1TMDM}{|miyTA^Jp&ppuZ)A|SX3}=*fCxM!2^3&t@ zGm6%mn#FSI2WM8LDwvva>4z&s8!8wp7y`wD^7Bg+OpO%`6oR<)J@eA?6--T_92bRX z8xvO}OBV}gXCq@{Q%4skR~I*PS4R_56GKC1a|2^zCp!hgN`SU-`=sWjmt-gynwcno z8+Wp2t;G%oh_pW3>&)Tgv8S^_EQxESC|eT4u?0aZmxj%5Jm+A-fLE>%@me>W}wCk$&$ diff --git a/doc/informe.tex b/doc/informe.tex index 5a775f7d..c0f0f5b8 100644 --- a/doc/informe.tex +++ b/doc/informe.tex @@ -24,7 +24,7 @@ \maketitle \section{Introducción} -$COOL (Classroom Object-Oriented Language)$ es un lenguaje pequeño, prácticamente de expresiones; pero que aun así, +\textit{COOL (Classroom Object-Oriented Language)} es un lenguaje pequeño, prácticamente de expresiones; pero que aun así, mantiene muchas de las características de los lenguajes de programación modernos, incluyendo orientación a objetos, tipado estático y manejo automático de memoria. La gramatica de Cool utilizada es libre del contexto y es definida en nuestro proyecto como @@ -76,7 +76,7 @@ \subsection*{Fases en las que se divide el compilador:} \item \textbf{Parser:} El generador del parser fue hecho por el equipo y la implementación puede encontrarse en los archivos cuyo nombre corresponden con esta fase. Este devuelve un parser $LALR$, que produce una derivaci\'on extrema derecha sobre una cadena de tokens y luego -esta se evalúa en una función llamada $evaluate$ que devuelve al $AST de Cool$.\\ +esta se evalúa en una función llamada $evaluate$ que devuelve al \textit{AST de Cool}.\\ \item \textbf{Chequeo Sem\'antico:} En esta fase implementan varios recorridos sobre el AST de COOL, siguiendo el patr\'on $visitor$. @@ -96,14 +96,75 @@ \subsection*{Fases en las que se divide el compilador:} en la definici\'on formal. Este recorrido visualiza el codigo de COOL como una gran expresi\'on y realiza un an\'alisi Bottom-Up, partiendo de tipos bien definidos de las expresiones en las hojas como enteros, strings, etc. Como paso extra, para inferir los tipos nos basamos en las mismas reglas - semanticas de tipos, pero agregamos recorridos para resolver los problemas de dependencia que puedan surgir - entre los elementos a inferir. Por ejemplo es posible que para inferir el valor de retorno de un m\'etodo, primero - haya que inferir el valor de retorno de sus par\'ametros. Para esto se agrega un par\'ametro \textbf{deep} al visitor - que determina la cantidad de veces que se recorre el AST, y por tanto, determina la profundidad de las dependencias - que podemos resolver. Para marcar un atributo, par\'ametro, variable o m\'etodo para que el sistema de - inferencia intente inferir su tipo, basta con marcar su tipo como \textbf{AUTO\_TYPE}. En caso de que no se - pueda inferir alg\'un tipo, entonces se lanza un error sem\'antico. - + sem\'anticas de tipos, pero agregamos recorridos para resolver los problemas de dependencia que puedan surgir + entre los elementos a inferir. Tomemos como ejemplo el siguiente fragmento de c\'odigo, tomado en parte del + test \textbf{Complex.cl}: + + \begin{verbatim} +class Main inherits IO { + main() : AUTO_TYPE { + (let c : AUTO_TYPE <- (new Complex).init(4, 5) in + out_int(c.sum()) + ) + }; +}; + +class Complex inherits IO { + x : AUTO_TYPE; + y : AUTO_TYPE; + + init(a : AUTO_TYPE, b : AUTO_TYPE) : Complex { + { + x <- a; + y <- b; + self; + } + }; + + sum() : AUTO_TYPE { + x + y + }; +}; + \end{verbatim} + +\begin{verbatim} + $ python testing.py > testing.mips + $ spim -file testing.mips + SPIM Version 8.0 of January 8, 2010 + Copyright 1990-2010, James R. Larus. + All Rights Reserved. + See the file README for a full copyright notice. + Loaded: /usr/lib/spim/exceptions.s + 9% +\end{verbatim} +\paragraph{} +El compilador es perfectamente capaz de inferir los tipos de cada argumento y de cada +atributo en este caso, pero, c\'omo ??? +\paragraph{} +Es f\'acil resolver los tipos en este ejemplo a vista, ya que miramos primeramente el m\'etodo \textbf{sum} +en el cual los atributos son usados en una suma, y como en \textit{COOL} solo se pueden sumar enteros, +entonces los atributos deben ser enteros. Por otro lado, luego verificamos los argumentos de la funci\'on \textbf{init} +y vemos que est\'an siendo utilizados como asignaci\'on para los atributos, por lo que deben ser enteros tambi\'en. +La inferencia de los tipos de retorno de los m\'etodos \textbf{sum y main} es trivial, como lo es inferir el tipo de +la variable \textit{c}. Pero para el compilador, esta forma de "elegir" por donde comenzar a mirar, no es para nada trivial, ya que +las dependencias de los tipos de retorno forman un grafo que debe ser recorrido en orden topol\'ogico (de no existir dicho orden, o sea, no ser un DAG, +evidentemente existir\'ia una dependencia c\'iclica que no es posible resolver), pero definir este recorrido se ve complicado +por el scoping de los m\'etodos, y nuestra forma de tratar la inicializaci\'on de atributos, que terminan siendo m\'etodos "an\'onimos". +Dicho esto, nuestro enfoque es definir una relaci\'on de dependencia en profundidad, o sea, $d(x) = p$ si para +poder inferir el tipo de "$x$", es necesario inferir, como m\'aximo, $p$ elementos antes. Luego se hacen $p$ recorridos, sobre el AST +de COOL, en cada paso actualizando el contexto en el que existe cada elemento para poder utilizarlo en pasadas posteriores. As\'i +pudi\'eramos inferir en una primera pasada los tipos de retornos de los atributos, y luego en una segunda pasada, los argumentos. +En la pr\'actica, el \textbf{inferer} revisa primero los m\'etodos de inicializaci\'on de cada atributo, y luego +los m\'etodos en orden de definici\'on en el c\'odigo fuente, por lo que en este caso, se infieren primero los argumentos del m\'etodo, +pues son usados constantes enteras en su llamada a \textbf{init}, y de ah\'i se deduce el tipo de los atributos al ser asignados en la función. +Es f\'acil entonces ver que esta forma de inferencia est\'a limitada a la profundidad configurada por el compilador, la cual, por defecto + es $5$, ya que en la pr\'actica, un nivel de anidaci\'on de dependencias mayor es dificil de conseguir, aunque se puede modificar + pas\'andole como argumento la profundidad al compilador, de la siguiente manera: + + \begin{verbatim} + $ python pycoolc.py --deep=10 [] + \end{verbatim} + \end{itemize} \item \textbf{Generación de código:} En esta fase se pasa de Cool a CIL y luego de CIL a MIPS. El conjunto de instrucciones de MIPS que se utiliza son del emulador de SPIM, o sea, utilizamos el conjunto @@ -179,7 +240,7 @@ \subsection*{Fases en las que se divide el compilador:} \item Dispatch din\'amico en $O(1)$. \end{itemize} -El mencionado puntero a la VTABLE, no es m\'as que el inicio de un array (Idea sacada de $C++$) que en cada +El mencionado puntero a la VTABLE, no es m\'as que el inicio de un array (Idea sacada de \textit{C++}) que en cada tipo contiene los nombres manglados de sus funciones, y recordemos que anteriormente dijimos que en CIL, garantiz\'abamos que el ind\'ice de cada m\'etodo es el mismo en cada tipo que lo herede, de ah\'i que acceder a una funci\'on determinada sobre una instancia es tan f\'acil como cargar el puntero a la VTABLE diff --git a/src/testing.mips b/src/testing.mips index 5159c748..d09521d0 100644 --- a/src/testing.mips +++ b/src/testing.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 01:50:00 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 14 10:20:50 2020 # School of Math and Computer Science, University of Havana # @@ -16,31 +16,15 @@ Bool: .asciiz "Bool" # Function END Int: .asciiz "Int" # Function END -BoolOp: .asciiz "BoolOp" -# Function END -Graph: .asciiz "Graph" -# Function END -Parse: .asciiz "Parse" +Complex: .asciiz "Complex" # Function END Main: .asciiz "Main" # Function END -VList: .asciiz "VList" -# Function END -VCons: .asciiz "VCons" -# Function END -EList: .asciiz "EList" -# Function END -ECons: .asciiz "ECons" -# Function END -Edge: .asciiz "Edge" -# Function END -Vertice: .asciiz "Vertice" -# Function END # # **** VTABLE for type IO **** -IO_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy +IO_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, function_out_int_at_IO, dummy, function_in_string_at_IO, dummy, function_copy_at_Object, function_in_int_at_IO, function_out_string_at_IO # Function END # @@ -54,7 +38,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy +Object_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy # Function END # @@ -68,7 +52,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, function_length_at_String, dummy, dummy, dummy, dummy, function_concat_at_String, dummy, dummy, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy +String_vtable: .word dummy, function_substr_at_String, function_length_at_String, function_type_name_at_Object, dummy, function_abort_at_Object, dummy, function_concat_at_String, dummy, dummy, function_copy_at_Object, dummy, dummy # Function END # @@ -82,7 +66,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy +Bool_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy # Function END # @@ -96,7 +80,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy +Int_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy # Function END # @@ -109,50 +93,22 @@ Int_end: # -# **** VTABLE for type BoolOp **** -BoolOp_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_or_at_BoolOp, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_and_at_BoolOp, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type BoolOp **** -BoolOp_start: - BoolOp_vtable_pointer: .word BoolOp_vtable - # Function END -BoolOp_end: -# - - -# **** VTABLE for type Graph **** -Graph_vtable: .word dummy, function_abort_at_Object, dummy, dummy, function_add_vertice_at_Graph, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_print_E_at_Graph, function_print_V_at_Graph, dummy, function_type_name_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy +# **** VTABLE for type Complex **** +Complex_vtable: .word dummy, dummy, dummy, function_type_name_at_Object, function_init_at_Complex, function_abort_at_Object, function_out_int_at_IO, dummy, function_in_string_at_IO, function_sum_at_Complex, function_copy_at_Object, function_in_int_at_IO, function_out_string_at_IO # Function END # -# **** Type RECORD for type Graph **** -Graph_start: - Graph_vtable_pointer: .word Graph_vtable +# **** Type RECORD for type Complex **** +Complex_start: + Complex_vtable_pointer: .word Complex_vtable # Function END -Graph_end: -# - - -# **** VTABLE for type Parse **** -Parse_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, function_a2i_aux_at_Parse, function_out_int_at_IO, function_parse_line_at_Parse, function_a2i_at_Parse, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, dummy, dummy, dummy, function_c2i_at_Parse, function_read_input_at_Parse -# Function END -# - - -# **** Type RECORD for type Parse **** -Parse_start: - Parse_vtable_pointer: .word Parse_vtable - # Function END -Parse_end: +Complex_end: # # **** VTABLE for type Main **** -Main_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, function_a2i_aux_at_Parse, function_out_int_at_IO, function_parse_line_at_Parse, function_a2i_at_Parse, dummy, dummy, dummy, dummy, dummy, dummy, function_main_at_Main, function_type_name_at_Object, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, dummy, dummy, dummy, function_c2i_at_Parse, function_read_input_at_Parse +Main_vtable: .word function_main_at_Main, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, function_out_int_at_IO, dummy, function_in_string_at_IO, dummy, function_copy_at_Object, function_in_int_at_IO, function_out_string_at_IO # Function END # @@ -165,90 +121,6 @@ Main_end: # -# **** VTABLE for type VList **** -VList_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, function_head_at_VList, function_print_at_VList, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, function_isNil_at_VList, function_cons_at_VList, function_tail_at_VList, dummy, dummy -# Function END -# - - -# **** Type RECORD for type VList **** -VList_start: - VList_vtable_pointer: .word VList_vtable - # Function END -VList_end: -# - - -# **** VTABLE for type VCons **** -VCons_vtable: .word dummy, function_abort_at_Object, function_init_at_VCons, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, function_head_at_VCons, function_print_at_VCons, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, function_isNil_at_VCons, function_cons_at_VList, function_tail_at_VCons, dummy, dummy -# Function END -# - - -# **** Type RECORD for type VCons **** -VCons_start: - VCons_vtable_pointer: .word VCons_vtable - # Function END -VCons_end: -# - - -# **** VTABLE for type EList **** -EList_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, function_append_at_EList, dummy, function_in_int_at_IO, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, function_head_at_EList, function_print_at_EList, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, function_isNil_at_EList, function_cons_at_EList, function_tail_at_EList, dummy, dummy -# Function END -# - - -# **** Type RECORD for type EList **** -EList_start: - EList_vtable_pointer: .word EList_vtable - # Function END -EList_end: -# - - -# **** VTABLE for type ECons **** -ECons_vtable: .word dummy, function_abort_at_Object, function_init_at_ECons, dummy, dummy, dummy, function_append_at_EList, dummy, function_in_int_at_IO, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, function_head_at_ECons, function_print_at_ECons, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, function_isNil_at_ECons, function_cons_at_EList, function_tail_at_ECons, dummy, dummy -# Function END -# - - -# **** Type RECORD for type ECons **** -ECons_start: - ECons_vtable_pointer: .word ECons_vtable - # Function END -ECons_end: -# - - -# **** VTABLE for type Edge **** -Edge_vtable: .word dummy, function_abort_at_Object, function_init_at_Edge, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, function_print_at_Edge, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Edge **** -Edge_start: - Edge_vtable_pointer: .word Edge_vtable - # Function END -Edge_end: -# - - -# **** VTABLE for type Vertice **** -Vertice_vtable: .word function_add_out_at_Vertice, function_abort_at_Object, function_init_at_Vertice, function_outgoing_at_Vertice, dummy, dummy, dummy, function_number_at_Vertice, function_in_int_at_IO, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, function_print_at_Vertice, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_out_string_at_IO, function_copy_at_Object, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy -# Function END -# - - -# **** Type RECORD for type Vertice **** -Vertice_start: - Vertice_vtable_pointer: .word Vertice_vtable - # Function END -Vertice_end: -# - - data_0: .asciiz "" # @@ -261,201 +133,13 @@ data_2: .asciiz "\n" # -IO__TDT: .word 0, -1, -1, -1, -1, -1, -1, 1, 2, 1, 2, 1, 2, 1, 1 -Object__TDT: .word 1, 0, 1, 1, 1, 1, 1, 2, 3, 2, 3, 2, 3, 2, 2 -String__TDT: .word -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -Int__TDT: .word -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -BoolOp__TDT: .word -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1 -Graph__TDT: .word -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1 -Parse__TDT: .word -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, -1, -1, -1, -1 -Main__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1 -VList__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, -1, -1 -VCons__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1 -EList__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1 -ECons__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1 -Edge__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1 -Vertice__TDT: .word -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 -# - - -data_4: .asciiz "\n" -# - - -data_5: .asciiz "" -# - - -data_6: .asciiz "0" -# - - -data_7: .asciiz "1" -# - - -data_8: .asciiz "2" -# - - -data_9: .asciiz "3" -# - - -data_10: .asciiz "4" -# - - -data_11: .asciiz "5" -# - - -data_12: .asciiz "6" -# - - -data_13: .asciiz "7" -# - - -data_14: .asciiz "8" -# - - -data_15: .asciiz "9" -# - - -data_16: .asciiz "-" -# - - -data_17: .asciiz " " -# - - -data_18: .asciiz " " -# - - -data_19: .asciiz "," -# - - -data_20: .asciiz "" -# - - -data_21: .asciiz "" -# - - -data_22: .asciiz "" -# - - -data_23: .asciiz "" -# - - -data_24: .asciiz "True \n" -# - - -data_25: .asciiz "False\n" -# - - -data_26: .asciiz "" -# - - -data_27: .asciiz "True \n" -# - - -data_28: .asciiz "False\n" -# - - -data_29: .asciiz "" -# - - -data_30: .asciiz "True \n" -# - - -data_31: .asciiz "False\n" -# - - -data_32: .asciiz "" -# - - -data_33: .asciiz "True \n" -# - - -data_34: .asciiz "False\n" -# - - -data_35: .asciiz "" -# - - -data_36: .asciiz "True \n" -# - - -data_37: .asciiz "False\n" -# - - -data_38: .asciiz "" -# - - -data_39: .asciiz "True \n" -# - - -data_40: .asciiz "False\n" -# - - -data_41: .asciiz "" -# - - -data_42: .asciiz "True \n" -# - - -data_43: .asciiz "False\n" -# - - -data_44: .asciiz "\n" -# - - -data_45: .asciiz "\n" -# - - -data_46: .asciiz " (" -# - - -data_47: .asciiz "," -# - - -data_48: .asciiz ")" +IO__TDT: .word 0, -1, -1, -1, -1, 1, 1 +Object__TDT: .word 1, 0, 1, 1, 1, 2, 2 +String__TDT: .word -1, -1, 0, -1, -1, -1, -1 +Bool__TDT: .word -1, -1, -1, 0, -1, -1, -1 +Int__TDT: .word -1, -1, -1, -1, 0, -1, -1 +Complex__TDT: .word -1, -1, -1, -1, -1, 0, -1 +Main__TDT: .word -1, -1, -1, -1, -1, -1, 0 # @@ -488,6 +172,8 @@ function_in_string_at_IO: move $t2, $zero move $t3, $zero move $t1, $t0 + lb $t3, 0($t1) + beqz $t3, end_loop read_length_loop: lb $t3, 0($t1) beqz $t3, end_read_length_loop @@ -498,6 +184,7 @@ function_in_string_at_IO: subu $t1, $t1, 1 sb $zero, 0($t1) subu $t2, $t2, 1 + end_loop: # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -730,7 +417,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -954,37 +641,21 @@ entry: li $t0, 4 sw $t0, 16($v0) move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 + # Allocating 12 bytes of memory + li $a0, 12 li $v0, 9 syscall sw $t0, 0($v0) la $t0, Main_start sw $t0, 4($v0) # Load type offset - li $t0, 32 + li $t0, 24 sw $t0, 8($v0) move $t1, $v0 # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Parse__attrib__boolop__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Parse__attrib__rest__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 @@ -999,7 +670,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 84($t0) + lw $t1, 0($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -1016,40 +687,20 @@ entry: # Function END -# function_and_at_BoolOp implementation. +# __Complex__attrib__x__init implementation. # @Params: -# 0($fp) = param_and_at_BoolOp_b1_0 -# 4($fp) = param_and_at_BoolOp_b2_1 -function_and_at_BoolOp: - # Allocate stack frame for function function_and_at_BoolOp. +__Complex__attrib__x__init: + # Allocate stack frame for function __Complex__attrib__x__init. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_and_at_BoolOp_internal_0 --> -4($fp) - # PARAM param_and_at_BoolOp_b1_0 --> 4($fp) - # Obtain value from 4($fp) - lw $v0, 4($fp) - lw $v0, 12($v0) - sw $v0, -4($fp) - # IF_ZERO local_and_at_BoolOp_internal_0 GOTO label_FALSEIF_1 - # IF_ZERO local_and_at_BoolOp_internal_0 GOTO label_FALSEIF_1 - lw $t0, -4($fp) - beq $t0, 0, label_FALSEIF_1 - # LOCAL local_and_at_BoolOp_internal_1 --> -8($fp) - # PARAM param_and_at_BoolOp_b2_1 --> 0($fp) - # local_and_at_BoolOp_internal_1 = PARAM param_and_at_BoolOp_b2_1 - lw $t0, 0($fp) - sw $t0, -8($fp) - # GOTO label_ENDIF_2 -j label_ENDIF_2 -label_FALSEIF_1: - # LOCAL local_and_at_BoolOp_internal_2 --> -12($fp) + # LOCAL local___attrib__x__init_internal_0 --> -4($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type Bool + # Allocating string for type Int la $t0, String sw $t0, 0($v0) la $t0, String_start @@ -1057,9 +708,9 @@ label_FALSEIF_1: # Load type offset li $t0, 8 sw $t0, 8($v0) - la $t0, Bool + la $t0, Int sw $t0, 12($v0) - li $t0, 4 + li $t0, 3 sw $t0, 16($v0) move $t0, $v0 # Allocating 16 bytes of memory @@ -1067,61 +718,41 @@ label_FALSEIF_1: li $v0, 9 syscall sw $t0, 0($v0) - la $t0, Bool_start + la $t0, Int_start sw $t0, 4($v0) # Load type offset - li $t0, 12 + li $t0, 16 sw $t0, 8($v0) li $t0, 0 sw $t0, 12($v0) - sw $v0, -12($fp) - # LOCAL local_and_at_BoolOp_internal_1 --> -8($fp) - # LOCAL local_and_at_BoolOp_internal_2 --> -12($fp) - # local_and_at_BoolOp_internal_1 = local_and_at_BoolOp_internal_2 - lw $t0, -12($fp) - sw $t0, -8($fp) - label_ENDIF_2: -# RETURN local_and_at_BoolOp_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_and_at_BoolOp. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 32 -# Deallocate function args -addu $sp, $sp, 8 -jr $ra -# Function END + sw $v0, -4($fp) + # RETURN local___attrib__x__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Complex__attrib__x__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END -# function_or_at_BoolOp implementation. +# __Complex__attrib__y__init implementation. # @Params: -# 0($fp) = param_or_at_BoolOp_b1_0 -# 4($fp) = param_or_at_BoolOp_b2_1 -function_or_at_BoolOp: - # Allocate stack frame for function function_or_at_BoolOp. +__Complex__attrib__y__init: + # Allocate stack frame for function __Complex__attrib__y__init. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_or_at_BoolOp_internal_0 --> -4($fp) - # PARAM param_or_at_BoolOp_b1_0 --> 4($fp) - # Obtain value from 4($fp) - lw $v0, 4($fp) - lw $v0, 12($v0) - sw $v0, -4($fp) - # IF_ZERO local_or_at_BoolOp_internal_0 GOTO label_FALSEIF_3 - # IF_ZERO local_or_at_BoolOp_internal_0 GOTO label_FALSEIF_3 - lw $t0, -4($fp) - beq $t0, 0, label_FALSEIF_3 - # LOCAL local_or_at_BoolOp_internal_2 --> -12($fp) + # LOCAL local___attrib__y__init_internal_0 --> -4($fp) # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type Bool + # Allocating string for type Int la $t0, String sw $t0, 0($v0) la $t0, String_start @@ -1129,9 +760,9 @@ function_or_at_BoolOp: # Load type offset li $t0, 8 sw $t0, 8($v0) - la $t0, Bool + la $t0, Int sw $t0, 12($v0) - li $t0, 4 + li $t0, 3 sw $t0, 16($v0) move $t0, $v0 # Allocating 16 bytes of memory @@ -1139,100 +770,120 @@ function_or_at_BoolOp: li $v0, 9 syscall sw $t0, 0($v0) - la $t0, Bool_start + la $t0, Int_start sw $t0, 4($v0) # Load type offset - li $t0, 12 + li $t0, 16 sw $t0, 8($v0) - li $t0, 1 + li $t0, 0 sw $t0, 12($v0) - sw $v0, -12($fp) - # LOCAL local_or_at_BoolOp_internal_1 --> -8($fp) - # LOCAL local_or_at_BoolOp_internal_2 --> -12($fp) - # local_or_at_BoolOp_internal_1 = local_or_at_BoolOp_internal_2 - lw $t0, -12($fp) - sw $t0, -8($fp) - # GOTO label_ENDIF_4 -j label_ENDIF_4 -label_FALSEIF_3: - # LOCAL local_or_at_BoolOp_internal_1 --> -8($fp) - # PARAM param_or_at_BoolOp_b2_1 --> 0($fp) - # local_or_at_BoolOp_internal_1 = PARAM param_or_at_BoolOp_b2_1 + sw $v0, -4($fp) + # RETURN local___attrib__y__init_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function __Complex__attrib__y__init. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + jr $ra + # Function END + + +# function_init_at_Complex implementation. +# @Params: +# 0($fp) = param_init_at_Complex_a_0 +# 4($fp) = param_init_at_Complex_b_1 +function_init_at_Complex: + # Allocate stack frame for function function_init_at_Complex. + subu $sp, $sp, 32 + sw $ra, 4($sp) + sw $fp, 0($sp) + addu $fp, $sp, 32 + # + # PARAM param_init_at_Complex_a_0 --> 4($fp) + lw $t0, 4($fp) + sw $t0, 12($s1) + # + # PARAM param_init_at_Complex_b_1 --> 0($fp) lw $t0, 0($fp) - sw $t0, -8($fp) - label_ENDIF_4: -# RETURN local_or_at_BoolOp_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_or_at_BoolOp. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 32 -# Deallocate function args -addu $sp, $sp, 8 -jr $ra -# Function END + sw $t0, 16($s1) + # LOCAL local_init_at_Complex_internal_0 --> -4($fp) + # local_init_at_Complex_internal_0 = SELF + sw $s1, -4($fp) + # RETURN local_init_at_Complex_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_init_at_Complex. + # Restore $ra + lw $ra, 4($sp) + # Restore $fp + lw $fp, 0($sp) + # Restore Stack pointer $sp + addu $sp, $sp, 32 + # Deallocate function args + addu $sp, $sp, 8 + jr $ra + # Function END -# __Graph__attrib__vertices__init implementation. +# function_sum_at_Complex implementation. # @Params: -__Graph__attrib__vertices__init: - # Allocate stack frame for function __Graph__attrib__vertices__init. +function_sum_at_Complex: + # Allocate stack frame for function function_sum_at_Complex. subu $sp, $sp, 32 sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # LOCAL local_attrib__vertices__init_internal_1 --> -8($fp) - # local_attrib__vertices__init_internal_1 = ALLOCATE VList + # local_sum_at_Complex_internal_1 = GETATTRIBUTE x Complex + # LOCAL local_sum_at_Complex_internal_1 --> -8($fp) + lw $t0, 12($s1) + sw $t0, -8($fp) + # local_sum_at_Complex_internal_2 = GETATTRIBUTE y Complex + # LOCAL local_sum_at_Complex_internal_2 --> -12($fp) + lw $t0, 16($s1) + sw $t0, -12($fp) + # LOCAL local_sum_at_Complex_internal_0 --> -4($fp) + # LOCAL local_sum_at_Complex_internal_1 --> -8($fp) + # LOCAL local_sum_at_Complex_internal_2 --> -12($fp) + # local_sum_at_Complex_internal_0 = local_sum_at_Complex_internal_1 + local_sum_at_Complex_internal_2 + lw $t1, -8($fp) + lw $t0, 12($t1) + lw $t1, -12($fp) + lw $t2, 12($t1) + add $t0, $t0, $t2 # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) + # Allocating string for type Int + la $t1, String + sw $t1, 0($v0) + la $t1, String_start + sw $t1, 4($v0) # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, VList - sw $t0, 12($v0) - li $t0, 5 - sw $t0, 16($v0) - move $t0, $v0 + li $t1, 8 + sw $t1, 8($v0) + la $t1, Int + sw $t1, 12($v0) + li $t1, 3 + sw $t1, 16($v0) + move $t1, $v0 # Allocating 16 bytes of memory li $a0, 16 li $v0, 9 syscall - sw $t0, 0($v0) - la $t0, VList_start - sw $t0, 4($v0) + sw $t1, 0($v0) + la $t1, Int_start + sw $t1, 4($v0) # Load type offset - li $t0, 36 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __VList__attrib__car__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -8($fp) - # RETURN local_attrib__vertices__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Graph__attrib__vertices__init. + li $t1, 16 + sw $t1, 8($v0) + sw $t0, 12($v0) + sw $v0, -4($fp) + # RETURN local_sum_at_Complex_internal_0 + lw $v0, -4($fp) + # Deallocate stack frame for function function_sum_at_Complex. # Restore $ra lw $ra, 4($sp) # Restore $fp @@ -1243,16 +894,20 @@ __Graph__attrib__vertices__init: # Function END -# __Graph__attrib__edges__init implementation. +# function_main_at_Main implementation. # @Params: -__Graph__attrib__edges__init: - # Allocate stack frame for function __Graph__attrib__edges__init. - subu $sp, $sp, 32 +function_main_at_Main: + # Allocate stack frame for function function_main_at_Main. + subu $sp, $sp, 52 sw $ra, 4($sp) sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_attrib__edges__init_internal_1 --> -8($fp) - # local_attrib__edges__init_internal_1 = ALLOCATE EList + addu $fp, $sp, 52 + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_c_0 = 0 + li $t0, 0 + sw $t0, -4($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_3 = ALLOCATE Complex # Allocating 20 bytes of memory li $a0, 20 li $v0, 9 @@ -1265,20 +920,20 @@ __Graph__attrib__edges__init: # Load type offset li $t0, 8 sw $t0, 8($v0) - la $t0, EList + la $t0, Complex sw $t0, 12($v0) - li $t0, 5 + li $t0, 7 sw $t0, 16($v0) move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 + # Allocating 20 bytes of memory + li $a0, 20 li $v0, 9 syscall sw $t0, 0($v0) - la $t0, EList_start + la $t0, Complex_start sw $t0, 4($v0) # Load type offset - li $t0, 44 + li $t0, 20 sw $t0, 8($v0) move $t1, $v0 # Push register s1 into stack @@ -1288,13009 +943,195 @@ __Graph__attrib__edges__init: # Push register t1 into stack subu $sp, $sp, 4 sw $t1, 0($sp) - jal __EList__attrib__car__init + jal __Complex__attrib__x__init # Pop 4 bytes from stack into register t1 lw $t1, 0($sp) addu $sp, $sp, 4 sw $v0, 12($t1) + # Push register t1 into stack + subu $sp, $sp, 4 + sw $t1, 0($sp) + jal __Complex__attrib__y__init + # Pop 4 bytes from stack into register t1 + lw $t1, 0($sp) + addu $sp, $sp, 4 + sw $v0, 16($t1) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - sw $t1, -8($fp) - # RETURN local_attrib__edges__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Graph__attrib__edges__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_add_vertice_at_Graph implementation. -# @Params: -# 0($fp) = param_add_vertice_at_Graph_v_0 -function_add_vertice_at_Graph: - # Allocate stack frame for function function_add_vertice_at_Graph. - subu $sp, $sp, 40 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 40 - # LOCAL local_add_vertice_at_Graph_internal_2 --> -12($fp) - # PARAM param_add_vertice_at_Graph_v_0 --> 0($fp) - # local_add_vertice_at_Graph_internal_2 = PARAM param_add_vertice_at_Graph_v_0 - lw $t0, 0($fp) - sw $t0, -12($fp) + sw $t1, -16($fp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_3 --> -16($fp) + # local_main_at_Main_internal_1 = local_main_at_Main_internal_3 + lw $t0, -16($fp) + sw $t0, -8($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # LOCAL local_add_vertice_at_Graph_internal_2 --> -12($fp) - # LOCAL local_add_vertice_at_Graph_internal_3 --> -16($fp) - # local_add_vertice_at_Graph_internal_3 = VCALL local_add_vertice_at_Graph_internal_2 outgoing + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 4 + sw $t0, 12($v0) + sw $v0, -20($fp) + # ARG local_main_at_Main_internal_4 + # LOCAL local_main_at_Main_internal_4 --> -20($fp) + lw $t0, -20($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + # Allocating 20 bytes of memory + li $a0, 20 + li $v0, 9 + syscall + # Allocating string for type Int + la $t0, String + sw $t0, 0($v0) + la $t0, String_start + sw $t0, 4($v0) + # Load type offset + li $t0, 8 + sw $t0, 8($v0) + la $t0, Int + sw $t0, 12($v0) + li $t0, 3 + sw $t0, 16($v0) + move $t0, $v0 + # Allocating 16 bytes of memory + li $a0, 16 + li $v0, 9 + syscall + sw $t0, 0($v0) + la $t0, Int_start + sw $t0, 4($v0) + # Load type offset + li $t0, 16 + sw $t0, 8($v0) + li $t0, 5 + sw $t0, 12($v0) + sw $v0, -24($fp) + # ARG local_main_at_Main_internal_5 + # LOCAL local_main_at_Main_internal_5 --> -24($fp) + lw $t0, -24($fp) + # Push arg into stack + subu $sp, $sp, 4 + sw $t0, 0($sp) + # LOCAL local_main_at_Main_internal_1 --> -8($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_internal_2 = VCALL local_main_at_Main_internal_1 init # Save new self pointer in $s1 - lw $s1, -12($fp) + lw $s1, -8($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 - sw $v0, -16($fp) + sw $v0, -12($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # LOCAL local_add_vertice_at_Graph_internal_0 --> -4($fp) - # LOCAL local_add_vertice_at_Graph_internal_3 --> -16($fp) - # local_add_vertice_at_Graph_internal_0 = local_add_vertice_at_Graph_internal_3 - lw $t0, -16($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # LOCAL local_main_at_Main_internal_2 --> -12($fp) + # local_main_at_Main_c_0 = local_main_at_Main_internal_2 + lw $t0, -12($fp) sw $t0, -4($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_8 = SELF + sw $s1, -36($fp) + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_8 --> -36($fp) + # local_main_at_Main_internal_6 = local_main_at_Main_internal_8 + lw $t0, -36($fp) + sw $t0, -28($fp) # Push register s1 into stack subu $sp, $sp, 4 sw $s1, 0($sp) - # local_add_vertice_at_Graph_internal_4 = GETATTRIBUTE edges Graph - # LOCAL local_add_vertice_at_Graph_internal_4 --> -20($fp) - lw $t0, 16($s1) - sw $t0, -20($fp) - # ARG local_add_vertice_at_Graph_internal_4 - # LOCAL local_add_vertice_at_Graph_internal_4 --> -20($fp) - lw $t0, -20($fp) - # Push arg into stack + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_c_0 --> -4($fp) + # local_main_at_Main_internal_9 = local_main_at_Main_c_0 + lw $t0, -4($fp) + sw $t0, -40($fp) + # Push register s1 into stack subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_add_vertice_at_Graph_internal_0 --> -4($fp) - # LOCAL local_add_vertice_at_Graph_internal_1 --> -8($fp) - # local_add_vertice_at_Graph_internal_1 = VCALL local_add_vertice_at_Graph_internal_0 append + sw $s1, 0($sp) + # LOCAL local_main_at_Main_internal_9 --> -40($fp) + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + # local_main_at_Main_internal_10 = VCALL local_main_at_Main_internal_9 sum # Save new self pointer in $s1 - lw $s1, -4($fp) + lw $s1, -40($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 24($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 - sw $v0, -8($fp) + sw $v0, -44($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # - # LOCAL local_add_vertice_at_Graph_internal_1 --> -8($fp) - lw $t0, -8($fp) - sw $t0, 16($s1) - # local_add_vertice_at_Graph_internal_7 = GETATTRIBUTE vertices Graph - # LOCAL local_add_vertice_at_Graph_internal_7 --> -32($fp) - lw $t0, 12($s1) - sw $t0, -32($fp) - # LOCAL local_add_vertice_at_Graph_internal_5 --> -24($fp) - # LOCAL local_add_vertice_at_Graph_internal_7 --> -32($fp) - # local_add_vertice_at_Graph_internal_5 = local_add_vertice_at_Graph_internal_7 - lw $t0, -32($fp) - sw $t0, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_add_vertice_at_Graph_v_0 - # PARAM param_add_vertice_at_Graph_v_0 --> 0($fp) - lw $t0, 0($fp) + # ARG local_main_at_Main_internal_10 + # LOCAL local_main_at_Main_internal_10 --> -44($fp) + lw $t0, -44($fp) # Push arg into stack subu $sp, $sp, 4 sw $t0, 0($sp) - # LOCAL local_add_vertice_at_Graph_internal_5 --> -24($fp) - # LOCAL local_add_vertice_at_Graph_internal_6 --> -28($fp) - # local_add_vertice_at_Graph_internal_6 = VCALL local_add_vertice_at_Graph_internal_5 cons + # LOCAL local_main_at_Main_internal_6 --> -28($fp) + # LOCAL local_main_at_Main_internal_7 --> -32($fp) + # local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_int # Save new self pointer in $s1 - lw $s1, -24($fp) + lw $s1, -28($fp) # Get pointer to type lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 108($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_add_vertice_at_Graph_internal_6 --> -28($fp) - lw $t0, -28($fp) - sw $t0, 12($s1) - # RETURN - # Deallocate stack frame for function function_add_vertice_at_Graph. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 40 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_print_E_at_Graph implementation. -# @Params: -function_print_E_at_Graph: - # Allocate stack frame for function function_print_E_at_Graph. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_print_E_at_Graph_internal_2 = GETATTRIBUTE edges Graph - # LOCAL local_print_E_at_Graph_internal_2 --> -12($fp) - lw $t0, 16($s1) - sw $t0, -12($fp) - # LOCAL local_print_E_at_Graph_internal_0 --> -4($fp) - # LOCAL local_print_E_at_Graph_internal_2 --> -12($fp) - # local_print_E_at_Graph_internal_0 = local_print_E_at_Graph_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_E_at_Graph_internal_0 --> -4($fp) - # LOCAL local_print_E_at_Graph_internal_1 --> -8($fp) - # local_print_E_at_Graph_internal_1 = VCALL local_print_E_at_Graph_internal_0 print - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_E_at_Graph_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_print_E_at_Graph. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_print_V_at_Graph implementation. -# @Params: -function_print_V_at_Graph: - # Allocate stack frame for function function_print_V_at_Graph. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_print_V_at_Graph_internal_2 = GETATTRIBUTE vertices Graph - # LOCAL local_print_V_at_Graph_internal_2 --> -12($fp) - lw $t0, 12($s1) - sw $t0, -12($fp) - # LOCAL local_print_V_at_Graph_internal_0 --> -4($fp) - # LOCAL local_print_V_at_Graph_internal_2 --> -12($fp) - # local_print_V_at_Graph_internal_0 = local_print_V_at_Graph_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_V_at_Graph_internal_0 --> -4($fp) - # LOCAL local_print_V_at_Graph_internal_1 --> -8($fp) - # local_print_V_at_Graph_internal_1 = VCALL local_print_V_at_Graph_internal_0 print - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_V_at_Graph_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_print_V_at_Graph. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Parse__attrib__boolop__init implementation. -# @Params: -__Parse__attrib__boolop__init: - # Allocate stack frame for function __Parse__attrib__boolop__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_attrib__boolop__init_internal_1 --> -8($fp) - # local_attrib__boolop__init_internal_1 = ALLOCATE BoolOp - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, BoolOp - sw $t0, 12($v0) - li $t0, 6 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 12 bytes of memory - li $a0, 12 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, BoolOp_start - sw $t0, 4($v0) - # Load type offset - li $t0, 20 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -8($fp) - # RETURN local_attrib__boolop__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Parse__attrib__boolop__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Parse__attrib__rest__init implementation. -# @Params: -__Parse__attrib__rest__init: - # Allocate stack frame for function __Parse__attrib__rest__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_attrib__rest__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_0 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -4($fp) - # RETURN local_attrib__rest__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Parse__attrib__rest__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_read_input_at_Parse implementation. -# @Params: -function_read_input_at_Parse: - # Allocate stack frame for function function_read_input_at_Parse. - subu $sp, $sp, 112 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 112 - # LOCAL local_read_input_at_Parse_g_0 --> -4($fp) - # local_read_input_at_Parse_g_0 = 0 - li $t0, 0 - sw $t0, -4($fp) - # LOCAL local_read_input_at_Parse_internal_1 --> -8($fp) - # local_read_input_at_Parse_internal_1 = ALLOCATE Graph - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Graph - sw $t0, 12($v0) - li $t0, 5 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Graph_start - sw $t0, 4($v0) - # Load type offset - li $t0, 24 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Graph__attrib__vertices__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Graph__attrib__edges__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -8($fp) - # LOCAL local_read_input_at_Parse_g_0 --> -4($fp) - # LOCAL local_read_input_at_Parse_internal_1 --> -8($fp) - # local_read_input_at_Parse_g_0 = local_read_input_at_Parse_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_0 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -12($fp) - # LOCAL local_read_input_at_Parse_internal_5 --> -24($fp) - # local_read_input_at_Parse_internal_5 = SELF - sw $s1, -24($fp) - # LOCAL local_read_input_at_Parse_internal_3 --> -16($fp) - # LOCAL local_read_input_at_Parse_internal_5 --> -24($fp) - # local_read_input_at_Parse_internal_3 = local_read_input_at_Parse_internal_5 - lw $t0, -24($fp) - sw $t0, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_read_input_at_Parse_internal_3 --> -16($fp) - # LOCAL local_read_input_at_Parse_internal_4 --> -20($fp) - # local_read_input_at_Parse_internal_4 = VCALL local_read_input_at_Parse_internal_3 in_string - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 100($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # LOCAL local_read_input_at_Parse_internal_4 --> -20($fp) - # local_read_input_at_Parse_line_2 = local_read_input_at_Parse_internal_4 - lw $t0, -20($fp) - sw $t0, -12($fp) - label_WHILE_5: - # local_read_input_at_Parse_internal_9 = GETATTRIBUTE boolop Parse - # LOCAL local_read_input_at_Parse_internal_9 --> -40($fp) - lw $t0, 12($s1) - sw $t0, -40($fp) - # LOCAL local_read_input_at_Parse_internal_7 --> -32($fp) - # LOCAL local_read_input_at_Parse_internal_9 --> -40($fp) - # local_read_input_at_Parse_internal_7 = local_read_input_at_Parse_internal_9 - lw $t0, -40($fp) - sw $t0, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_4 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -52($fp) - # IF_ZERO local_read_input_at_Parse_line_2 GOTO label_FALSE_7 - # IF_ZERO local_read_input_at_Parse_line_2 GOTO label_FALSE_7 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_7 - # IF_ZERO local_read_input_at_Parse_internal_12 GOTO label_FALSE_7 - # IF_ZERO local_read_input_at_Parse_internal_12 GOTO label_FALSE_7 - lw $t0, -52($fp) - beq $t0, 0, label_FALSE_7 - # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # Comparing -12($fp) type with String - la $v0, String - lw $a0, -12($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_STRING_10 - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_STRING_10 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_STRING_10 - # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # Comparing -12($fp) type with Bool - la $v0, Bool - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_11 - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_11 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_11 - # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # Comparing -12($fp) type with Int - la $v0, Int - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_11 - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_11 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_11 - # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) - # Load pointers and SUB - lw $a0, -12($fp) - lw $a1, -52($fp) - sub $a0, $a0, $a1 - sw $a0, -48($fp) - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_8 - # GOTO label_FALSE_7 - j label_FALSE_7 - label_COMPARE_BY_VALUE_11: - # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) - lw $a0, -12($fp) - lw $a1, -52($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -48($fp) - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_8 - # GOTO label_FALSE_7 - j label_FALSE_7 - label_COMPARE_STRING_10: - # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, -52($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -48($fp) - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_CONTINUE_12 - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_CONTINUE_12 - lw $t0, -48($fp) - beq $t0, 0, label_CONTINUE_12 - # GOTO label_FALSE_7 - j label_FALSE_7 - label_CONTINUE_12: - # LOCAL local_read_input_at_Parse_internal_11 --> -48($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # LOCAL local_read_input_at_Parse_internal_12 --> -52($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, -52($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_13: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_14 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_13 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_14: - # Store result - sw $a2, -48($fp) - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 - # IF_ZERO local_read_input_at_Parse_internal_11 GOTO label_TRUE_8 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_8 - label_FALSE_7: - # LOCAL local_read_input_at_Parse_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -44($fp) - # GOTO label_END_9 -j label_END_9 -label_TRUE_8: - # LOCAL local_read_input_at_Parse_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -44($fp) - label_END_9: -# LOCAL local_read_input_at_Parse_internal_10 --> -44($fp) -# LOCAL local_read_input_at_Parse_internal_10 --> -44($fp) -# Obtain value from -44($fp) -lw $v0, -44($fp) -lw $v0, 12($v0) -sw $v0, -44($fp) -# IF_ZERO local_read_input_at_Parse_internal_10 GOTO label_FALSE_15 -# IF_ZERO local_read_input_at_Parse_internal_10 GOTO label_FALSE_15 -lw $t0, -44($fp) -beq $t0, 0, label_FALSE_15 -# LOCAL local_read_input_at_Parse_internal_13 --> -56($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -56($fp) -# GOTO label_NOT_END_16 -j label_NOT_END_16 -label_FALSE_15: - # LOCAL local_read_input_at_Parse_internal_13 --> -56($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -56($fp) - label_NOT_END_16: - # ARG local_read_input_at_Parse_internal_13 - # LOCAL local_read_input_at_Parse_internal_13 --> -56($fp) - lw $t0, -56($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_5 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -68($fp) - # IF_ZERO local_read_input_at_Parse_line_2 GOTO label_FALSE_17 - # IF_ZERO local_read_input_at_Parse_line_2 GOTO label_FALSE_17 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_17 - # IF_ZERO local_read_input_at_Parse_internal_16 GOTO label_FALSE_17 - # IF_ZERO local_read_input_at_Parse_internal_16 GOTO label_FALSE_17 - lw $t0, -68($fp) - beq $t0, 0, label_FALSE_17 - # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # Comparing -12($fp) type with String - la $v0, String - lw $a0, -12($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_STRING_20 - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_STRING_20 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_STRING_20 - # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # Comparing -12($fp) type with Bool - la $v0, Bool - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_21 - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_21 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_21 - # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # Comparing -12($fp) type with Int - la $v0, Int - lw $a0, -12($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_21 - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_21 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_21 - # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) - # Load pointers and SUB - lw $a0, -12($fp) - lw $a1, -68($fp) - sub $a0, $a0, $a1 - sw $a0, -64($fp) - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_18 - # GOTO label_FALSE_17 - j label_FALSE_17 - label_COMPARE_BY_VALUE_21: - # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) - lw $a0, -12($fp) - lw $a1, -68($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -64($fp) - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_18 - # GOTO label_FALSE_17 - j label_FALSE_17 - label_COMPARE_STRING_20: - # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, -68($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -64($fp) - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_CONTINUE_22 - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_CONTINUE_22 - lw $t0, -64($fp) - beq $t0, 0, label_CONTINUE_22 - # GOTO label_FALSE_17 - j label_FALSE_17 - label_CONTINUE_22: - # LOCAL local_read_input_at_Parse_internal_15 --> -64($fp) - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # LOCAL local_read_input_at_Parse_internal_16 --> -68($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -12($fp) - lw $v1, -68($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_23: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_24 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_23 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_24: - # Store result - sw $a2, -64($fp) - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 - # IF_ZERO local_read_input_at_Parse_internal_15 GOTO label_TRUE_18 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_18 - label_FALSE_17: - # LOCAL local_read_input_at_Parse_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -60($fp) - # GOTO label_END_19 -j label_END_19 -label_TRUE_18: - # LOCAL local_read_input_at_Parse_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -60($fp) - label_END_19: -# LOCAL local_read_input_at_Parse_internal_14 --> -60($fp) -# LOCAL local_read_input_at_Parse_internal_14 --> -60($fp) -# Obtain value from -60($fp) -lw $v0, -60($fp) -lw $v0, 12($v0) -sw $v0, -60($fp) -# IF_ZERO local_read_input_at_Parse_internal_14 GOTO label_FALSE_25 -# IF_ZERO local_read_input_at_Parse_internal_14 GOTO label_FALSE_25 -lw $t0, -60($fp) -beq $t0, 0, label_FALSE_25 -# LOCAL local_read_input_at_Parse_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -72($fp) -# GOTO label_NOT_END_26 -j label_NOT_END_26 -label_FALSE_25: - # LOCAL local_read_input_at_Parse_internal_17 --> -72($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -72($fp) - label_NOT_END_26: - # ARG local_read_input_at_Parse_internal_17 - # LOCAL local_read_input_at_Parse_internal_17 --> -72($fp) - lw $t0, -72($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_read_input_at_Parse_internal_7 --> -32($fp) - # LOCAL local_read_input_at_Parse_internal_8 --> -36($fp) - # local_read_input_at_Parse_internal_8 = VCALL local_read_input_at_Parse_internal_7 and - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 72($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_read_input_at_Parse_internal_6 --> -28($fp) - # LOCAL local_read_input_at_Parse_internal_8 --> -36($fp) - # Obtain value from -36($fp) - lw $v0, -36($fp) - lw $v0, 12($v0) - sw $v0, -28($fp) - # IF_ZERO local_read_input_at_Parse_internal_6 GOTO label_WHILE_END_6 - # IF_ZERO local_read_input_at_Parse_internal_6 GOTO label_WHILE_END_6 - lw $t0, -28($fp) - beq $t0, 0, label_WHILE_END_6 - # LOCAL local_read_input_at_Parse_internal_18 --> -76($fp) - # LOCAL local_read_input_at_Parse_g_0 --> -4($fp) - # local_read_input_at_Parse_internal_18 = local_read_input_at_Parse_g_0 - lw $t0, -4($fp) - sw $t0, -76($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_read_input_at_Parse_internal_22 --> -92($fp) - # local_read_input_at_Parse_internal_22 = SELF - sw $s1, -92($fp) - # LOCAL local_read_input_at_Parse_internal_20 --> -84($fp) - # LOCAL local_read_input_at_Parse_internal_22 --> -92($fp) - # local_read_input_at_Parse_internal_20 = local_read_input_at_Parse_internal_22 - lw $t0, -92($fp) - sw $t0, -84($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_read_input_at_Parse_line_2 - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - lw $t0, -12($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_read_input_at_Parse_internal_20 --> -84($fp) - # LOCAL local_read_input_at_Parse_internal_21 --> -88($fp) - # local_read_input_at_Parse_internal_21 = VCALL local_read_input_at_Parse_internal_20 parse_line - # Save new self pointer in $s1 - lw $s1, -84($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 52($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -88($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_read_input_at_Parse_internal_21 - # LOCAL local_read_input_at_Parse_internal_21 --> -88($fp) - lw $t0, -88($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_read_input_at_Parse_internal_18 --> -76($fp) - # LOCAL local_read_input_at_Parse_internal_19 --> -80($fp) - # local_read_input_at_Parse_internal_19 = VCALL local_read_input_at_Parse_internal_18 add_vertice - # Save new self pointer in $s1 - lw $s1, -76($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 16($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -80($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_read_input_at_Parse_internal_25 --> -104($fp) - # local_read_input_at_Parse_internal_25 = SELF - sw $s1, -104($fp) - # LOCAL local_read_input_at_Parse_internal_23 --> -96($fp) - # LOCAL local_read_input_at_Parse_internal_25 --> -104($fp) - # local_read_input_at_Parse_internal_23 = local_read_input_at_Parse_internal_25 - lw $t0, -104($fp) - sw $t0, -96($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_read_input_at_Parse_internal_23 --> -96($fp) - # LOCAL local_read_input_at_Parse_internal_24 --> -100($fp) - # local_read_input_at_Parse_internal_24 = VCALL local_read_input_at_Parse_internal_23 in_string - # Save new self pointer in $s1 - lw $s1, -96($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 100($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -100($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_read_input_at_Parse_line_2 --> -12($fp) - # LOCAL local_read_input_at_Parse_internal_24 --> -100($fp) - # local_read_input_at_Parse_line_2 = local_read_input_at_Parse_internal_24 - lw $t0, -100($fp) - sw $t0, -12($fp) - # GOTO label_WHILE_5 - j label_WHILE_5 - label_WHILE_END_6: - # RETURN local_read_input_at_Parse_g_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_read_input_at_Parse. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 112 - jr $ra - # Function END - - -# function_parse_line_at_Parse implementation. -# @Params: -# 0($fp) = param_parse_line_at_Parse_s_0 -function_parse_line_at_Parse: - # Allocate stack frame for function function_parse_line_at_Parse. - subu $sp, $sp, 136 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 136 - # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) - # local_parse_line_at_Parse_v_0 = 0 - li $t0, 0 - sw $t0, -4($fp) - # LOCAL local_parse_line_at_Parse_internal_3 --> -16($fp) - # local_parse_line_at_Parse_internal_3 = ALLOCATE Vertice - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Vertice - sw $t0, 12($v0) - li $t0, 7 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Vertice_start - sw $t0, 4($v0) - # Load type offset - li $t0, 56 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Vertice__attrib__num__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Vertice__attrib__out__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -16($fp) - # LOCAL local_parse_line_at_Parse_internal_1 --> -8($fp) - # LOCAL local_parse_line_at_Parse_internal_3 --> -16($fp) - # local_parse_line_at_Parse_internal_1 = local_parse_line_at_Parse_internal_3 - lw $t0, -16($fp) - sw $t0, -8($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_6 --> -28($fp) - # local_parse_line_at_Parse_internal_6 = SELF - sw $s1, -28($fp) - # LOCAL local_parse_line_at_Parse_internal_4 --> -20($fp) - # LOCAL local_parse_line_at_Parse_internal_6 --> -28($fp) - # local_parse_line_at_Parse_internal_4 = local_parse_line_at_Parse_internal_6 - lw $t0, -28($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_parse_line_at_Parse_s_0 - # PARAM param_parse_line_at_Parse_s_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_4 --> -20($fp) - # LOCAL local_parse_line_at_Parse_internal_5 --> -24($fp) - # local_parse_line_at_Parse_internal_5 = VCALL local_parse_line_at_Parse_internal_4 a2i - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 56($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_parse_line_at_Parse_internal_5 - # LOCAL local_parse_line_at_Parse_internal_5 --> -24($fp) - lw $t0, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_1 --> -8($fp) - # LOCAL local_parse_line_at_Parse_internal_2 --> -12($fp) - # local_parse_line_at_Parse_internal_2 = VCALL local_parse_line_at_Parse_internal_1 init - # Save new self pointer in $s1 - lw $s1, -8($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 8($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -12($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) - # LOCAL local_parse_line_at_Parse_internal_2 --> -12($fp) - # local_parse_line_at_Parse_v_0 = local_parse_line_at_Parse_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - label_WHILE_27: - # local_parse_line_at_Parse_internal_12 = GETATTRIBUTE rest Parse - # LOCAL local_parse_line_at_Parse_internal_12 --> -52($fp) - lw $t0, 16($s1) - sw $t0, -52($fp) - # LOCAL local_parse_line_at_Parse_internal_10 --> -44($fp) - # LOCAL local_parse_line_at_Parse_internal_12 --> -52($fp) - # local_parse_line_at_Parse_internal_10 = local_parse_line_at_Parse_internal_12 - lw $t0, -52($fp) - sw $t0, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_10 --> -44($fp) - # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) - # local_parse_line_at_Parse_internal_11 = VCALL local_parse_line_at_Parse_internal_10 length - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 20($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -56($fp) - # IF_ZERO local_parse_line_at_Parse_internal_11 GOTO label_FALSE_29 - # IF_ZERO local_parse_line_at_Parse_internal_11 GOTO label_FALSE_29 - lw $t0, -48($fp) - beq $t0, 0, label_FALSE_29 - # IF_ZERO local_parse_line_at_Parse_internal_13 GOTO label_FALSE_29 - # IF_ZERO local_parse_line_at_Parse_internal_13 GOTO label_FALSE_29 - lw $t0, -56($fp) - beq $t0, 0, label_FALSE_29 - # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) - # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) - # Comparing -48($fp) type with String - la $v0, String - lw $a0, -48($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_STRING_32 - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_STRING_32 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_STRING_32 - # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) - # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) - # Comparing -48($fp) type with Bool - la $v0, Bool - lw $a0, -48($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_33 - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_33 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_33 - # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) - # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) - # Comparing -48($fp) type with Int - la $v0, Int - lw $a0, -48($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_33 - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_33 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_33 - # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) - # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) - # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) - # Load pointers and SUB - lw $a0, -48($fp) - lw $a1, -56($fp) - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_30 - # GOTO label_FALSE_29 - j label_FALSE_29 - label_COMPARE_BY_VALUE_33: - # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) - # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) - # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) - lw $a0, -48($fp) - lw $a1, -56($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_30 - # GOTO label_FALSE_29 - j label_FALSE_29 - label_COMPARE_STRING_32: - # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) - # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) - # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) - # Load strings for comparison - lw $v0, -48($fp) - lw $v1, -56($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -40($fp) - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_CONTINUE_34 - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_CONTINUE_34 - lw $t0, -40($fp) - beq $t0, 0, label_CONTINUE_34 - # GOTO label_FALSE_29 - j label_FALSE_29 - label_CONTINUE_34: - # LOCAL local_parse_line_at_Parse_internal_9 --> -40($fp) - # LOCAL local_parse_line_at_Parse_internal_11 --> -48($fp) - # LOCAL local_parse_line_at_Parse_internal_13 --> -56($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -48($fp) - lw $v1, -56($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_35: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_36 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_35 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_36: - # Store result - sw $a2, -40($fp) - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 - # IF_ZERO local_parse_line_at_Parse_internal_9 GOTO label_TRUE_30 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_30 - label_FALSE_29: - # LOCAL local_parse_line_at_Parse_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -36($fp) - # GOTO label_END_31 -j label_END_31 -label_TRUE_30: - # LOCAL local_parse_line_at_Parse_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -36($fp) - label_END_31: -# LOCAL local_parse_line_at_Parse_internal_8 --> -36($fp) -# LOCAL local_parse_line_at_Parse_internal_8 --> -36($fp) -# Obtain value from -36($fp) -lw $v0, -36($fp) -lw $v0, 12($v0) -sw $v0, -36($fp) -# IF_ZERO local_parse_line_at_Parse_internal_8 GOTO label_FALSE_37 -# IF_ZERO local_parse_line_at_Parse_internal_8 GOTO label_FALSE_37 -lw $t0, -36($fp) -beq $t0, 0, label_FALSE_37 -# LOCAL local_parse_line_at_Parse_internal_14 --> -60($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Bool -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Bool -sw $t0, 12($v0) -li $t0, 4 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Bool_start -sw $t0, 4($v0) -# Load type offset -li $t0, 12 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -60($fp) -# GOTO label_NOT_END_38 -j label_NOT_END_38 -label_FALSE_37: - # LOCAL local_parse_line_at_Parse_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -60($fp) - label_NOT_END_38: - # LOCAL local_parse_line_at_Parse_internal_7 --> -32($fp) - # LOCAL local_parse_line_at_Parse_internal_14 --> -60($fp) - # Obtain value from -60($fp) - lw $v0, -60($fp) - lw $v0, 12($v0) - sw $v0, -32($fp) - # IF_ZERO local_parse_line_at_Parse_internal_7 GOTO label_WHILE_END_28 - # IF_ZERO local_parse_line_at_Parse_internal_7 GOTO label_WHILE_END_28 - lw $t0, -32($fp) - beq $t0, 0, label_WHILE_END_28 - # LOCAL local_parse_line_at_Parse_succ_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -64($fp) - # LOCAL local_parse_line_at_Parse_internal_18 --> -76($fp) - # local_parse_line_at_Parse_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_parse_line_at_Parse_internal_16 --> -68($fp) - # LOCAL local_parse_line_at_Parse_internal_18 --> -76($fp) - # local_parse_line_at_Parse_internal_16 = local_parse_line_at_Parse_internal_18 - lw $t0, -76($fp) - sw $t0, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_parse_line_at_Parse_internal_19 = GETATTRIBUTE rest Parse - # LOCAL local_parse_line_at_Parse_internal_19 --> -80($fp) - lw $t0, 16($s1) - sw $t0, -80($fp) - # ARG local_parse_line_at_Parse_internal_19 - # LOCAL local_parse_line_at_Parse_internal_19 --> -80($fp) - lw $t0, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_16 --> -68($fp) - # LOCAL local_parse_line_at_Parse_internal_17 --> -72($fp) - # local_parse_line_at_Parse_internal_17 = VCALL local_parse_line_at_Parse_internal_16 a2i - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 56($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_parse_line_at_Parse_succ_15 --> -64($fp) - # LOCAL local_parse_line_at_Parse_internal_17 --> -72($fp) - # local_parse_line_at_Parse_succ_15 = local_parse_line_at_Parse_internal_17 - lw $t0, -72($fp) - sw $t0, -64($fp) - # LOCAL local_parse_line_at_Parse_weight_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -84($fp) - # LOCAL local_parse_line_at_Parse_internal_23 --> -96($fp) - # local_parse_line_at_Parse_internal_23 = SELF - sw $s1, -96($fp) - # LOCAL local_parse_line_at_Parse_internal_21 --> -88($fp) - # LOCAL local_parse_line_at_Parse_internal_23 --> -96($fp) - # local_parse_line_at_Parse_internal_21 = local_parse_line_at_Parse_internal_23 - lw $t0, -96($fp) - sw $t0, -88($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_parse_line_at_Parse_internal_24 = GETATTRIBUTE rest Parse - # LOCAL local_parse_line_at_Parse_internal_24 --> -100($fp) - lw $t0, 16($s1) - sw $t0, -100($fp) - # ARG local_parse_line_at_Parse_internal_24 - # LOCAL local_parse_line_at_Parse_internal_24 --> -100($fp) - lw $t0, -100($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_21 --> -88($fp) - # LOCAL local_parse_line_at_Parse_internal_22 --> -92($fp) - # local_parse_line_at_Parse_internal_22 = VCALL local_parse_line_at_Parse_internal_21 a2i - # Save new self pointer in $s1 - lw $s1, -88($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 56($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -92($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_parse_line_at_Parse_weight_20 --> -84($fp) - # LOCAL local_parse_line_at_Parse_internal_22 --> -92($fp) - # local_parse_line_at_Parse_weight_20 = local_parse_line_at_Parse_internal_22 - lw $t0, -92($fp) - sw $t0, -84($fp) - # LOCAL local_parse_line_at_Parse_internal_25 --> -104($fp) - # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) - # local_parse_line_at_Parse_internal_25 = local_parse_line_at_Parse_v_0 - lw $t0, -4($fp) - sw $t0, -104($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_29 --> -120($fp) - # local_parse_line_at_Parse_internal_29 = ALLOCATE Edge - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Edge - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 24 bytes of memory - li $a0, 24 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Edge_start - sw $t0, 4($v0) - # Load type offset - li $t0, 52 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Edge__attrib__from__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Edge__attrib__to__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __Edge__attrib__weight__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 20($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -120($fp) - # LOCAL local_parse_line_at_Parse_internal_27 --> -112($fp) - # LOCAL local_parse_line_at_Parse_internal_29 --> -120($fp) - # local_parse_line_at_Parse_internal_27 = local_parse_line_at_Parse_internal_29 - lw $t0, -120($fp) - sw $t0, -112($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_30 --> -124($fp) - # LOCAL local_parse_line_at_Parse_v_0 --> -4($fp) - # local_parse_line_at_Parse_internal_30 = local_parse_line_at_Parse_v_0 - lw $t0, -4($fp) - sw $t0, -124($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_30 --> -124($fp) - # LOCAL local_parse_line_at_Parse_internal_31 --> -128($fp) - # local_parse_line_at_Parse_internal_31 = VCALL local_parse_line_at_Parse_internal_30 number - # Save new self pointer in $s1 - lw $s1, -124($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 28($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -128($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_parse_line_at_Parse_internal_31 - # LOCAL local_parse_line_at_Parse_internal_31 --> -128($fp) - lw $t0, -128($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # ARG local_parse_line_at_Parse_succ_15 - # LOCAL local_parse_line_at_Parse_succ_15 --> -64($fp) - lw $t0, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # ARG local_parse_line_at_Parse_weight_20 - # LOCAL local_parse_line_at_Parse_weight_20 --> -84($fp) - lw $t0, -84($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_27 --> -112($fp) - # LOCAL local_parse_line_at_Parse_internal_28 --> -116($fp) - # local_parse_line_at_Parse_internal_28 = VCALL local_parse_line_at_Parse_internal_27 init - # Save new self pointer in $s1 - lw $s1, -112($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 8($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -116($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_parse_line_at_Parse_internal_28 - # LOCAL local_parse_line_at_Parse_internal_28 --> -116($fp) - lw $t0, -116($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_parse_line_at_Parse_internal_25 --> -104($fp) - # LOCAL local_parse_line_at_Parse_internal_26 --> -108($fp) - # local_parse_line_at_Parse_internal_26 = VCALL local_parse_line_at_Parse_internal_25 add_out - # Save new self pointer in $s1 - lw $s1, -104($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 0($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -108($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # GOTO label_WHILE_27 - j label_WHILE_27 - label_WHILE_END_28: - # RETURN local_parse_line_at_Parse_v_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_parse_line_at_Parse. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 136 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_c2i_at_Parse implementation. -# @Params: -# 0($fp) = param_c2i_at_Parse_char_0 -function_c2i_at_Parse: - # Allocate stack frame for function function_c2i_at_Parse. - subu $sp, $sp, 264 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 264 - # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_6 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -20($fp) - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_41 - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_41 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_41 - # IF_ZERO local_c2i_at_Parse_internal_4 GOTO label_FALSE_41 - # IF_ZERO local_c2i_at_Parse_internal_4 GOTO label_FALSE_41 - lw $t0, -20($fp) - beq $t0, 0, label_FALSE_41 - # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_STRING_44 - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_STRING_44 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_44 - # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_45 - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_45 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_45 - # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_45 - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_45 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_45 - # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -20($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_42 - # GOTO label_FALSE_41 - j label_FALSE_41 - label_COMPARE_BY_VALUE_45: - # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) - lw $a0, 0($fp) - lw $a1, -20($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_42 - # GOTO label_FALSE_41 - j label_FALSE_41 - label_COMPARE_STRING_44: - # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_CONTINUE_46 - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_CONTINUE_46 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_46 - # GOTO label_FALSE_41 - j label_FALSE_41 - label_CONTINUE_46: - # LOCAL local_c2i_at_Parse_internal_3 --> -16($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_4 --> -20($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -20($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_47: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_48 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_47 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_48: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 - # IF_ZERO local_c2i_at_Parse_internal_3 GOTO label_TRUE_42 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_42 - label_FALSE_41: - # LOCAL local_c2i_at_Parse_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_43 -j label_END_43 -label_TRUE_42: - # LOCAL local_c2i_at_Parse_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_43: -# LOCAL local_c2i_at_Parse_internal_0 --> -4($fp) -# LOCAL local_c2i_at_Parse_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_c2i_at_Parse_internal_0 GOTO label_FALSEIF_39 -# IF_ZERO local_c2i_at_Parse_internal_0 GOTO label_FALSEIF_39 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_39 -# LOCAL local_c2i_at_Parse_internal_5 --> -24($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -24($fp) -# LOCAL local_c2i_at_Parse_internal_1 --> -8($fp) -# LOCAL local_c2i_at_Parse_internal_5 --> -24($fp) -# local_c2i_at_Parse_internal_1 = local_c2i_at_Parse_internal_5 -lw $t0, -24($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_40 -j label_ENDIF_40 -label_FALSEIF_39: - # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_7 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -44($fp) - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_51 - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_51 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_51 - # IF_ZERO local_c2i_at_Parse_internal_10 GOTO label_FALSE_51 - # IF_ZERO local_c2i_at_Parse_internal_10 GOTO label_FALSE_51 - lw $t0, -44($fp) - beq $t0, 0, label_FALSE_51 - # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_STRING_54 - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_STRING_54 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_STRING_54 - # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_55 - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_55 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_55 - # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -40($fp) - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_55 - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_COMPARE_BY_VALUE_55 - lw $t0, -40($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_55 - # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -44($fp) - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_52 - # GOTO label_FALSE_51 - j label_FALSE_51 - label_COMPARE_BY_VALUE_55: - # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) - lw $a0, 0($fp) - lw $a1, -44($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -40($fp) - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_52 - # GOTO label_FALSE_51 - j label_FALSE_51 - label_COMPARE_STRING_54: - # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -44($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -40($fp) - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_CONTINUE_56 - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_CONTINUE_56 - lw $t0, -40($fp) - beq $t0, 0, label_CONTINUE_56 - # GOTO label_FALSE_51 - j label_FALSE_51 - label_CONTINUE_56: - # LOCAL local_c2i_at_Parse_internal_9 --> -40($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_10 --> -44($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -44($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_57: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_58 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_57 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_58: - # Store result - sw $a2, -40($fp) - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 - # IF_ZERO local_c2i_at_Parse_internal_9 GOTO label_TRUE_52 - lw $t0, -40($fp) - beq $t0, 0, label_TRUE_52 - label_FALSE_51: - # LOCAL local_c2i_at_Parse_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -36($fp) - # GOTO label_END_53 -j label_END_53 -label_TRUE_52: - # LOCAL local_c2i_at_Parse_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -36($fp) - label_END_53: -# LOCAL local_c2i_at_Parse_internal_6 --> -28($fp) -# LOCAL local_c2i_at_Parse_internal_8 --> -36($fp) -# Obtain value from -36($fp) -lw $v0, -36($fp) -lw $v0, 12($v0) -sw $v0, -28($fp) -# IF_ZERO local_c2i_at_Parse_internal_6 GOTO label_FALSEIF_49 -# IF_ZERO local_c2i_at_Parse_internal_6 GOTO label_FALSEIF_49 -lw $t0, -28($fp) -beq $t0, 0, label_FALSEIF_49 -# LOCAL local_c2i_at_Parse_internal_11 --> -48($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -48($fp) -# LOCAL local_c2i_at_Parse_internal_7 --> -32($fp) -# LOCAL local_c2i_at_Parse_internal_11 --> -48($fp) -# local_c2i_at_Parse_internal_7 = local_c2i_at_Parse_internal_11 -lw $t0, -48($fp) -sw $t0, -32($fp) -# GOTO label_ENDIF_50 -j label_ENDIF_50 -label_FALSEIF_49: - # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_8 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -68($fp) - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_61 - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_61 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_61 - # IF_ZERO local_c2i_at_Parse_internal_16 GOTO label_FALSE_61 - # IF_ZERO local_c2i_at_Parse_internal_16 GOTO label_FALSE_61 - lw $t0, -68($fp) - beq $t0, 0, label_FALSE_61 - # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_STRING_64 - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_STRING_64 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_STRING_64 - # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_65 - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_65 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_65 - # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -64($fp) - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_65 - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_COMPARE_BY_VALUE_65 - lw $t0, -64($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_65 - # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -68($fp) - sub $a0, $a0, $a1 - sw $a0, -64($fp) - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_62 - # GOTO label_FALSE_61 - j label_FALSE_61 - label_COMPARE_BY_VALUE_65: - # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) - lw $a0, 0($fp) - lw $a1, -68($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -64($fp) - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_62 - # GOTO label_FALSE_61 - j label_FALSE_61 - label_COMPARE_STRING_64: - # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -68($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -64($fp) - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_CONTINUE_66 - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_CONTINUE_66 - lw $t0, -64($fp) - beq $t0, 0, label_CONTINUE_66 - # GOTO label_FALSE_61 - j label_FALSE_61 - label_CONTINUE_66: - # LOCAL local_c2i_at_Parse_internal_15 --> -64($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_16 --> -68($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -68($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_67: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_68 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_67 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_68: - # Store result - sw $a2, -64($fp) - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 - # IF_ZERO local_c2i_at_Parse_internal_15 GOTO label_TRUE_62 - lw $t0, -64($fp) - beq $t0, 0, label_TRUE_62 - label_FALSE_61: - # LOCAL local_c2i_at_Parse_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -60($fp) - # GOTO label_END_63 -j label_END_63 -label_TRUE_62: - # LOCAL local_c2i_at_Parse_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -60($fp) - label_END_63: -# LOCAL local_c2i_at_Parse_internal_12 --> -52($fp) -# LOCAL local_c2i_at_Parse_internal_14 --> -60($fp) -# Obtain value from -60($fp) -lw $v0, -60($fp) -lw $v0, 12($v0) -sw $v0, -52($fp) -# IF_ZERO local_c2i_at_Parse_internal_12 GOTO label_FALSEIF_59 -# IF_ZERO local_c2i_at_Parse_internal_12 GOTO label_FALSEIF_59 -lw $t0, -52($fp) -beq $t0, 0, label_FALSEIF_59 -# LOCAL local_c2i_at_Parse_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 2 -sw $t0, 12($v0) -sw $v0, -72($fp) -# LOCAL local_c2i_at_Parse_internal_13 --> -56($fp) -# LOCAL local_c2i_at_Parse_internal_17 --> -72($fp) -# local_c2i_at_Parse_internal_13 = local_c2i_at_Parse_internal_17 -lw $t0, -72($fp) -sw $t0, -56($fp) -# GOTO label_ENDIF_60 -j label_ENDIF_60 -label_FALSEIF_59: - # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_9 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -92($fp) - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_71 - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_71 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_71 - # IF_ZERO local_c2i_at_Parse_internal_22 GOTO label_FALSE_71 - # IF_ZERO local_c2i_at_Parse_internal_22 GOTO label_FALSE_71 - lw $t0, -92($fp) - beq $t0, 0, label_FALSE_71 - # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_STRING_74 - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_STRING_74 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_STRING_74 - # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_BY_VALUE_75 - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_BY_VALUE_75 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_75 - # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -88($fp) - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_BY_VALUE_75 - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_COMPARE_BY_VALUE_75 - lw $t0, -88($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_75 - # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -92($fp) - sub $a0, $a0, $a1 - sw $a0, -88($fp) - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_72 - # GOTO label_FALSE_71 - j label_FALSE_71 - label_COMPARE_BY_VALUE_75: - # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) - lw $a0, 0($fp) - lw $a1, -92($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -88($fp) - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_72 - # GOTO label_FALSE_71 - j label_FALSE_71 - label_COMPARE_STRING_74: - # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -92($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -88($fp) - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_CONTINUE_76 - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_CONTINUE_76 - lw $t0, -88($fp) - beq $t0, 0, label_CONTINUE_76 - # GOTO label_FALSE_71 - j label_FALSE_71 - label_CONTINUE_76: - # LOCAL local_c2i_at_Parse_internal_21 --> -88($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_22 --> -92($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -92($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_77: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_78 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_77 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_78: - # Store result - sw $a2, -88($fp) - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 - # IF_ZERO local_c2i_at_Parse_internal_21 GOTO label_TRUE_72 - lw $t0, -88($fp) - beq $t0, 0, label_TRUE_72 - label_FALSE_71: - # LOCAL local_c2i_at_Parse_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -84($fp) - # GOTO label_END_73 -j label_END_73 -label_TRUE_72: - # LOCAL local_c2i_at_Parse_internal_20 --> -84($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -84($fp) - label_END_73: -# LOCAL local_c2i_at_Parse_internal_18 --> -76($fp) -# LOCAL local_c2i_at_Parse_internal_20 --> -84($fp) -# Obtain value from -84($fp) -lw $v0, -84($fp) -lw $v0, 12($v0) -sw $v0, -76($fp) -# IF_ZERO local_c2i_at_Parse_internal_18 GOTO label_FALSEIF_69 -# IF_ZERO local_c2i_at_Parse_internal_18 GOTO label_FALSEIF_69 -lw $t0, -76($fp) -beq $t0, 0, label_FALSEIF_69 -# LOCAL local_c2i_at_Parse_internal_23 --> -96($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 3 -sw $t0, 12($v0) -sw $v0, -96($fp) -# LOCAL local_c2i_at_Parse_internal_19 --> -80($fp) -# LOCAL local_c2i_at_Parse_internal_23 --> -96($fp) -# local_c2i_at_Parse_internal_19 = local_c2i_at_Parse_internal_23 -lw $t0, -96($fp) -sw $t0, -80($fp) -# GOTO label_ENDIF_70 -j label_ENDIF_70 -label_FALSEIF_69: - # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_10 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -116($fp) - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_81 - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_81 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_81 - # IF_ZERO local_c2i_at_Parse_internal_28 GOTO label_FALSE_81 - # IF_ZERO local_c2i_at_Parse_internal_28 GOTO label_FALSE_81 - lw $t0, -116($fp) - beq $t0, 0, label_FALSE_81 - # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -112($fp) - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_STRING_84 - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_STRING_84 - lw $t0, -112($fp) - beq $t0, 0, label_COMPARE_STRING_84 - # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -112($fp) - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_BY_VALUE_85 - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_BY_VALUE_85 - lw $t0, -112($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_85 - # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -112($fp) - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_BY_VALUE_85 - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_COMPARE_BY_VALUE_85 - lw $t0, -112($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_85 - # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -116($fp) - sub $a0, $a0, $a1 - sw $a0, -112($fp) - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 - lw $t0, -112($fp) - beq $t0, 0, label_TRUE_82 - # GOTO label_FALSE_81 - j label_FALSE_81 - label_COMPARE_BY_VALUE_85: - # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) - lw $a0, 0($fp) - lw $a1, -116($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -112($fp) - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 - lw $t0, -112($fp) - beq $t0, 0, label_TRUE_82 - # GOTO label_FALSE_81 - j label_FALSE_81 - label_COMPARE_STRING_84: - # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -116($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -112($fp) - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_CONTINUE_86 - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_CONTINUE_86 - lw $t0, -112($fp) - beq $t0, 0, label_CONTINUE_86 - # GOTO label_FALSE_81 - j label_FALSE_81 - label_CONTINUE_86: - # LOCAL local_c2i_at_Parse_internal_27 --> -112($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_28 --> -116($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -116($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_87: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_88 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_87 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_88: - # Store result - sw $a2, -112($fp) - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 - # IF_ZERO local_c2i_at_Parse_internal_27 GOTO label_TRUE_82 - lw $t0, -112($fp) - beq $t0, 0, label_TRUE_82 - label_FALSE_81: - # LOCAL local_c2i_at_Parse_internal_26 --> -108($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -108($fp) - # GOTO label_END_83 -j label_END_83 -label_TRUE_82: - # LOCAL local_c2i_at_Parse_internal_26 --> -108($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -108($fp) - label_END_83: -# LOCAL local_c2i_at_Parse_internal_24 --> -100($fp) -# LOCAL local_c2i_at_Parse_internal_26 --> -108($fp) -# Obtain value from -108($fp) -lw $v0, -108($fp) -lw $v0, 12($v0) -sw $v0, -100($fp) -# IF_ZERO local_c2i_at_Parse_internal_24 GOTO label_FALSEIF_79 -# IF_ZERO local_c2i_at_Parse_internal_24 GOTO label_FALSEIF_79 -lw $t0, -100($fp) -beq $t0, 0, label_FALSEIF_79 -# LOCAL local_c2i_at_Parse_internal_29 --> -120($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 4 -sw $t0, 12($v0) -sw $v0, -120($fp) -# LOCAL local_c2i_at_Parse_internal_25 --> -104($fp) -# LOCAL local_c2i_at_Parse_internal_29 --> -120($fp) -# local_c2i_at_Parse_internal_25 = local_c2i_at_Parse_internal_29 -lw $t0, -120($fp) -sw $t0, -104($fp) -# GOTO label_ENDIF_80 -j label_ENDIF_80 -label_FALSEIF_79: - # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_11 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -140($fp) - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_91 - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_91 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_91 - # IF_ZERO local_c2i_at_Parse_internal_34 GOTO label_FALSE_91 - # IF_ZERO local_c2i_at_Parse_internal_34 GOTO label_FALSE_91 - lw $t0, -140($fp) - beq $t0, 0, label_FALSE_91 - # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -136($fp) - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_STRING_94 - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_STRING_94 - lw $t0, -136($fp) - beq $t0, 0, label_COMPARE_STRING_94 - # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -136($fp) - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_BY_VALUE_95 - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_BY_VALUE_95 - lw $t0, -136($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_95 - # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -136($fp) - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_BY_VALUE_95 - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_COMPARE_BY_VALUE_95 - lw $t0, -136($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_95 - # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -140($fp) - sub $a0, $a0, $a1 - sw $a0, -136($fp) - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 - lw $t0, -136($fp) - beq $t0, 0, label_TRUE_92 - # GOTO label_FALSE_91 - j label_FALSE_91 - label_COMPARE_BY_VALUE_95: - # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) - lw $a0, 0($fp) - lw $a1, -140($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -136($fp) - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 - lw $t0, -136($fp) - beq $t0, 0, label_TRUE_92 - # GOTO label_FALSE_91 - j label_FALSE_91 - label_COMPARE_STRING_94: - # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -140($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -136($fp) - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_CONTINUE_96 - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_CONTINUE_96 - lw $t0, -136($fp) - beq $t0, 0, label_CONTINUE_96 - # GOTO label_FALSE_91 - j label_FALSE_91 - label_CONTINUE_96: - # LOCAL local_c2i_at_Parse_internal_33 --> -136($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_34 --> -140($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -140($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_97: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_98 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_97 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_98: - # Store result - sw $a2, -136($fp) - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 - # IF_ZERO local_c2i_at_Parse_internal_33 GOTO label_TRUE_92 - lw $t0, -136($fp) - beq $t0, 0, label_TRUE_92 - label_FALSE_91: - # LOCAL local_c2i_at_Parse_internal_32 --> -132($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -132($fp) - # GOTO label_END_93 -j label_END_93 -label_TRUE_92: - # LOCAL local_c2i_at_Parse_internal_32 --> -132($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -132($fp) - label_END_93: -# LOCAL local_c2i_at_Parse_internal_30 --> -124($fp) -# LOCAL local_c2i_at_Parse_internal_32 --> -132($fp) -# Obtain value from -132($fp) -lw $v0, -132($fp) -lw $v0, 12($v0) -sw $v0, -124($fp) -# IF_ZERO local_c2i_at_Parse_internal_30 GOTO label_FALSEIF_89 -# IF_ZERO local_c2i_at_Parse_internal_30 GOTO label_FALSEIF_89 -lw $t0, -124($fp) -beq $t0, 0, label_FALSEIF_89 -# LOCAL local_c2i_at_Parse_internal_35 --> -144($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 5 -sw $t0, 12($v0) -sw $v0, -144($fp) -# LOCAL local_c2i_at_Parse_internal_31 --> -128($fp) -# LOCAL local_c2i_at_Parse_internal_35 --> -144($fp) -# local_c2i_at_Parse_internal_31 = local_c2i_at_Parse_internal_35 -lw $t0, -144($fp) -sw $t0, -128($fp) -# GOTO label_ENDIF_90 -j label_ENDIF_90 -label_FALSEIF_89: - # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_12 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -164($fp) - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_101 - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_101 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_101 - # IF_ZERO local_c2i_at_Parse_internal_40 GOTO label_FALSE_101 - # IF_ZERO local_c2i_at_Parse_internal_40 GOTO label_FALSE_101 - lw $t0, -164($fp) - beq $t0, 0, label_FALSE_101 - # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -160($fp) - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_STRING_104 - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_STRING_104 - lw $t0, -160($fp) - beq $t0, 0, label_COMPARE_STRING_104 - # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -160($fp) - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_BY_VALUE_105 - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_BY_VALUE_105 - lw $t0, -160($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_105 - # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -160($fp) - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_BY_VALUE_105 - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_COMPARE_BY_VALUE_105 - lw $t0, -160($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_105 - # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -164($fp) - sub $a0, $a0, $a1 - sw $a0, -160($fp) - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 - lw $t0, -160($fp) - beq $t0, 0, label_TRUE_102 - # GOTO label_FALSE_101 - j label_FALSE_101 - label_COMPARE_BY_VALUE_105: - # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) - lw $a0, 0($fp) - lw $a1, -164($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -160($fp) - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 - lw $t0, -160($fp) - beq $t0, 0, label_TRUE_102 - # GOTO label_FALSE_101 - j label_FALSE_101 - label_COMPARE_STRING_104: - # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -164($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -160($fp) - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_CONTINUE_106 - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_CONTINUE_106 - lw $t0, -160($fp) - beq $t0, 0, label_CONTINUE_106 - # GOTO label_FALSE_101 - j label_FALSE_101 - label_CONTINUE_106: - # LOCAL local_c2i_at_Parse_internal_39 --> -160($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_40 --> -164($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -164($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_107: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_108 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_107 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_108: - # Store result - sw $a2, -160($fp) - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 - # IF_ZERO local_c2i_at_Parse_internal_39 GOTO label_TRUE_102 - lw $t0, -160($fp) - beq $t0, 0, label_TRUE_102 - label_FALSE_101: - # LOCAL local_c2i_at_Parse_internal_38 --> -156($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -156($fp) - # GOTO label_END_103 -j label_END_103 -label_TRUE_102: - # LOCAL local_c2i_at_Parse_internal_38 --> -156($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -156($fp) - label_END_103: -# LOCAL local_c2i_at_Parse_internal_36 --> -148($fp) -# LOCAL local_c2i_at_Parse_internal_38 --> -156($fp) -# Obtain value from -156($fp) -lw $v0, -156($fp) -lw $v0, 12($v0) -sw $v0, -148($fp) -# IF_ZERO local_c2i_at_Parse_internal_36 GOTO label_FALSEIF_99 -# IF_ZERO local_c2i_at_Parse_internal_36 GOTO label_FALSEIF_99 -lw $t0, -148($fp) -beq $t0, 0, label_FALSEIF_99 -# LOCAL local_c2i_at_Parse_internal_41 --> -168($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 6 -sw $t0, 12($v0) -sw $v0, -168($fp) -# LOCAL local_c2i_at_Parse_internal_37 --> -152($fp) -# LOCAL local_c2i_at_Parse_internal_41 --> -168($fp) -# local_c2i_at_Parse_internal_37 = local_c2i_at_Parse_internal_41 -lw $t0, -168($fp) -sw $t0, -152($fp) -# GOTO label_ENDIF_100 -j label_ENDIF_100 -label_FALSEIF_99: - # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_13 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -188($fp) - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_111 - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_111 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_111 - # IF_ZERO local_c2i_at_Parse_internal_46 GOTO label_FALSE_111 - # IF_ZERO local_c2i_at_Parse_internal_46 GOTO label_FALSE_111 - lw $t0, -188($fp) - beq $t0, 0, label_FALSE_111 - # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -184($fp) - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_STRING_114 - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_STRING_114 - lw $t0, -184($fp) - beq $t0, 0, label_COMPARE_STRING_114 - # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -184($fp) - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_BY_VALUE_115 - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_BY_VALUE_115 - lw $t0, -184($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_115 - # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -184($fp) - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_BY_VALUE_115 - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_COMPARE_BY_VALUE_115 - lw $t0, -184($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_115 - # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -188($fp) - sub $a0, $a0, $a1 - sw $a0, -184($fp) - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 - lw $t0, -184($fp) - beq $t0, 0, label_TRUE_112 - # GOTO label_FALSE_111 - j label_FALSE_111 - label_COMPARE_BY_VALUE_115: - # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) - lw $a0, 0($fp) - lw $a1, -188($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -184($fp) - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 - lw $t0, -184($fp) - beq $t0, 0, label_TRUE_112 - # GOTO label_FALSE_111 - j label_FALSE_111 - label_COMPARE_STRING_114: - # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -188($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -184($fp) - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_CONTINUE_116 - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_CONTINUE_116 - lw $t0, -184($fp) - beq $t0, 0, label_CONTINUE_116 - # GOTO label_FALSE_111 - j label_FALSE_111 - label_CONTINUE_116: - # LOCAL local_c2i_at_Parse_internal_45 --> -184($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_46 --> -188($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -188($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_117: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_118 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_117 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_118: - # Store result - sw $a2, -184($fp) - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 - # IF_ZERO local_c2i_at_Parse_internal_45 GOTO label_TRUE_112 - lw $t0, -184($fp) - beq $t0, 0, label_TRUE_112 - label_FALSE_111: - # LOCAL local_c2i_at_Parse_internal_44 --> -180($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -180($fp) - # GOTO label_END_113 -j label_END_113 -label_TRUE_112: - # LOCAL local_c2i_at_Parse_internal_44 --> -180($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -180($fp) - label_END_113: -# LOCAL local_c2i_at_Parse_internal_42 --> -172($fp) -# LOCAL local_c2i_at_Parse_internal_44 --> -180($fp) -# Obtain value from -180($fp) -lw $v0, -180($fp) -lw $v0, 12($v0) -sw $v0, -172($fp) -# IF_ZERO local_c2i_at_Parse_internal_42 GOTO label_FALSEIF_109 -# IF_ZERO local_c2i_at_Parse_internal_42 GOTO label_FALSEIF_109 -lw $t0, -172($fp) -beq $t0, 0, label_FALSEIF_109 -# LOCAL local_c2i_at_Parse_internal_47 --> -192($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 7 -sw $t0, 12($v0) -sw $v0, -192($fp) -# LOCAL local_c2i_at_Parse_internal_43 --> -176($fp) -# LOCAL local_c2i_at_Parse_internal_47 --> -192($fp) -# local_c2i_at_Parse_internal_43 = local_c2i_at_Parse_internal_47 -lw $t0, -192($fp) -sw $t0, -176($fp) -# GOTO label_ENDIF_110 -j label_ENDIF_110 -label_FALSEIF_109: - # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_14 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -212($fp) - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_121 - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_121 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_121 - # IF_ZERO local_c2i_at_Parse_internal_52 GOTO label_FALSE_121 - # IF_ZERO local_c2i_at_Parse_internal_52 GOTO label_FALSE_121 - lw $t0, -212($fp) - beq $t0, 0, label_FALSE_121 - # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -208($fp) - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_STRING_124 - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_STRING_124 - lw $t0, -208($fp) - beq $t0, 0, label_COMPARE_STRING_124 - # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -208($fp) - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_BY_VALUE_125 - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_BY_VALUE_125 - lw $t0, -208($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_125 - # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -208($fp) - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_BY_VALUE_125 - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_COMPARE_BY_VALUE_125 - lw $t0, -208($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_125 - # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -212($fp) - sub $a0, $a0, $a1 - sw $a0, -208($fp) - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 - lw $t0, -208($fp) - beq $t0, 0, label_TRUE_122 - # GOTO label_FALSE_121 - j label_FALSE_121 - label_COMPARE_BY_VALUE_125: - # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) - lw $a0, 0($fp) - lw $a1, -212($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -208($fp) - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 - lw $t0, -208($fp) - beq $t0, 0, label_TRUE_122 - # GOTO label_FALSE_121 - j label_FALSE_121 - label_COMPARE_STRING_124: - # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -212($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -208($fp) - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_CONTINUE_126 - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_CONTINUE_126 - lw $t0, -208($fp) - beq $t0, 0, label_CONTINUE_126 - # GOTO label_FALSE_121 - j label_FALSE_121 - label_CONTINUE_126: - # LOCAL local_c2i_at_Parse_internal_51 --> -208($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_52 --> -212($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -212($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_127: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_128 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_127 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_128: - # Store result - sw $a2, -208($fp) - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 - # IF_ZERO local_c2i_at_Parse_internal_51 GOTO label_TRUE_122 - lw $t0, -208($fp) - beq $t0, 0, label_TRUE_122 - label_FALSE_121: - # LOCAL local_c2i_at_Parse_internal_50 --> -204($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -204($fp) - # GOTO label_END_123 -j label_END_123 -label_TRUE_122: - # LOCAL local_c2i_at_Parse_internal_50 --> -204($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -204($fp) - label_END_123: -# LOCAL local_c2i_at_Parse_internal_48 --> -196($fp) -# LOCAL local_c2i_at_Parse_internal_50 --> -204($fp) -# Obtain value from -204($fp) -lw $v0, -204($fp) -lw $v0, 12($v0) -sw $v0, -196($fp) -# IF_ZERO local_c2i_at_Parse_internal_48 GOTO label_FALSEIF_119 -# IF_ZERO local_c2i_at_Parse_internal_48 GOTO label_FALSEIF_119 -lw $t0, -196($fp) -beq $t0, 0, label_FALSEIF_119 -# LOCAL local_c2i_at_Parse_internal_53 --> -216($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 8 -sw $t0, 12($v0) -sw $v0, -216($fp) -# LOCAL local_c2i_at_Parse_internal_49 --> -200($fp) -# LOCAL local_c2i_at_Parse_internal_53 --> -216($fp) -# local_c2i_at_Parse_internal_49 = local_c2i_at_Parse_internal_53 -lw $t0, -216($fp) -sw $t0, -200($fp) -# GOTO label_ENDIF_120 -j label_ENDIF_120 -label_FALSEIF_119: - # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_15 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -236($fp) - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_131 - # IF_ZERO param_c2i_at_Parse_char_0 GOTO label_FALSE_131 - lw $t0, 0($fp) - beq $t0, 0, label_FALSE_131 - # IF_ZERO local_c2i_at_Parse_internal_58 GOTO label_FALSE_131 - # IF_ZERO local_c2i_at_Parse_internal_58 GOTO label_FALSE_131 - lw $t0, -236($fp) - beq $t0, 0, label_FALSE_131 - # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with String - la $v0, String - lw $a0, 0($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -232($fp) - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_STRING_134 - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_STRING_134 - lw $t0, -232($fp) - beq $t0, 0, label_COMPARE_STRING_134 - # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Bool - la $v0, Bool - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -232($fp) - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_BY_VALUE_135 - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_BY_VALUE_135 - lw $t0, -232($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_135 - # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # Comparing 0($fp) type with Int - la $v0, Int - lw $a0, 0($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -232($fp) - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_BY_VALUE_135 - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_COMPARE_BY_VALUE_135 - lw $t0, -232($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_135 - # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) - # Load pointers and SUB - lw $a0, 0($fp) - lw $a1, -236($fp) - sub $a0, $a0, $a1 - sw $a0, -232($fp) - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 - lw $t0, -232($fp) - beq $t0, 0, label_TRUE_132 - # GOTO label_FALSE_131 - j label_FALSE_131 - label_COMPARE_BY_VALUE_135: - # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) - lw $a0, 0($fp) - lw $a1, -236($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -232($fp) - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 - lw $t0, -232($fp) - beq $t0, 0, label_TRUE_132 - # GOTO label_FALSE_131 - j label_FALSE_131 - label_COMPARE_STRING_134: - # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -236($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -232($fp) - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_CONTINUE_136 - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_CONTINUE_136 - lw $t0, -232($fp) - beq $t0, 0, label_CONTINUE_136 - # GOTO label_FALSE_131 - j label_FALSE_131 - label_CONTINUE_136: - # LOCAL local_c2i_at_Parse_internal_57 --> -232($fp) - # PARAM param_c2i_at_Parse_char_0 --> 0($fp) - # LOCAL local_c2i_at_Parse_internal_58 --> -236($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, 0($fp) - lw $v1, -236($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_137: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_138 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_137 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_138: - # Store result - sw $a2, -232($fp) - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 - # IF_ZERO local_c2i_at_Parse_internal_57 GOTO label_TRUE_132 - lw $t0, -232($fp) - beq $t0, 0, label_TRUE_132 - label_FALSE_131: - # LOCAL local_c2i_at_Parse_internal_56 --> -228($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -228($fp) - # GOTO label_END_133 -j label_END_133 -label_TRUE_132: - # LOCAL local_c2i_at_Parse_internal_56 --> -228($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -228($fp) - label_END_133: -# LOCAL local_c2i_at_Parse_internal_54 --> -220($fp) -# LOCAL local_c2i_at_Parse_internal_56 --> -228($fp) -# Obtain value from -228($fp) -lw $v0, -228($fp) -lw $v0, 12($v0) -sw $v0, -220($fp) -# IF_ZERO local_c2i_at_Parse_internal_54 GOTO label_FALSEIF_129 -# IF_ZERO local_c2i_at_Parse_internal_54 GOTO label_FALSEIF_129 -lw $t0, -220($fp) -beq $t0, 0, label_FALSEIF_129 -# LOCAL local_c2i_at_Parse_internal_59 --> -240($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 9 -sw $t0, 12($v0) -sw $v0, -240($fp) -# LOCAL local_c2i_at_Parse_internal_55 --> -224($fp) -# LOCAL local_c2i_at_Parse_internal_59 --> -240($fp) -# local_c2i_at_Parse_internal_55 = local_c2i_at_Parse_internal_59 -lw $t0, -240($fp) -sw $t0, -224($fp) -# GOTO label_ENDIF_130 -j label_ENDIF_130 -label_FALSEIF_129: - # LOCAL local_c2i_at_Parse_internal_62 --> -252($fp) - # local_c2i_at_Parse_internal_62 = SELF - sw $s1, -252($fp) - # LOCAL local_c2i_at_Parse_internal_60 --> -244($fp) - # LOCAL local_c2i_at_Parse_internal_62 --> -252($fp) - # local_c2i_at_Parse_internal_60 = local_c2i_at_Parse_internal_62 - lw $t0, -252($fp) - sw $t0, -244($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_c2i_at_Parse_internal_60 --> -244($fp) - # LOCAL local_c2i_at_Parse_internal_61 --> -248($fp) - # local_c2i_at_Parse_internal_61 = VCALL local_c2i_at_Parse_internal_60 abort - # Save new self pointer in $s1 - lw $s1, -244($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -248($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_c2i_at_Parse_internal_63 --> -256($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -256($fp) - # LOCAL local_c2i_at_Parse_internal_55 --> -224($fp) - # LOCAL local_c2i_at_Parse_internal_63 --> -256($fp) - # local_c2i_at_Parse_internal_55 = local_c2i_at_Parse_internal_63 - lw $t0, -256($fp) - sw $t0, -224($fp) - label_ENDIF_130: -# LOCAL local_c2i_at_Parse_internal_49 --> -200($fp) -# LOCAL local_c2i_at_Parse_internal_55 --> -224($fp) -# local_c2i_at_Parse_internal_49 = local_c2i_at_Parse_internal_55 -lw $t0, -224($fp) -sw $t0, -200($fp) -label_ENDIF_120: -# LOCAL local_c2i_at_Parse_internal_43 --> -176($fp) -# LOCAL local_c2i_at_Parse_internal_49 --> -200($fp) -# local_c2i_at_Parse_internal_43 = local_c2i_at_Parse_internal_49 -lw $t0, -200($fp) -sw $t0, -176($fp) -label_ENDIF_110: -# LOCAL local_c2i_at_Parse_internal_37 --> -152($fp) -# LOCAL local_c2i_at_Parse_internal_43 --> -176($fp) -# local_c2i_at_Parse_internal_37 = local_c2i_at_Parse_internal_43 -lw $t0, -176($fp) -sw $t0, -152($fp) -label_ENDIF_100: -# LOCAL local_c2i_at_Parse_internal_31 --> -128($fp) -# LOCAL local_c2i_at_Parse_internal_37 --> -152($fp) -# local_c2i_at_Parse_internal_31 = local_c2i_at_Parse_internal_37 -lw $t0, -152($fp) -sw $t0, -128($fp) -label_ENDIF_90: -# LOCAL local_c2i_at_Parse_internal_25 --> -104($fp) -# LOCAL local_c2i_at_Parse_internal_31 --> -128($fp) -# local_c2i_at_Parse_internal_25 = local_c2i_at_Parse_internal_31 -lw $t0, -128($fp) -sw $t0, -104($fp) -label_ENDIF_80: -# LOCAL local_c2i_at_Parse_internal_19 --> -80($fp) -# LOCAL local_c2i_at_Parse_internal_25 --> -104($fp) -# local_c2i_at_Parse_internal_19 = local_c2i_at_Parse_internal_25 -lw $t0, -104($fp) -sw $t0, -80($fp) -label_ENDIF_70: -# LOCAL local_c2i_at_Parse_internal_13 --> -56($fp) -# LOCAL local_c2i_at_Parse_internal_19 --> -80($fp) -# local_c2i_at_Parse_internal_13 = local_c2i_at_Parse_internal_19 -lw $t0, -80($fp) -sw $t0, -56($fp) -label_ENDIF_60: -# LOCAL local_c2i_at_Parse_internal_7 --> -32($fp) -# LOCAL local_c2i_at_Parse_internal_13 --> -56($fp) -# local_c2i_at_Parse_internal_7 = local_c2i_at_Parse_internal_13 -lw $t0, -56($fp) -sw $t0, -32($fp) -label_ENDIF_50: -# LOCAL local_c2i_at_Parse_internal_1 --> -8($fp) -# LOCAL local_c2i_at_Parse_internal_7 --> -32($fp) -# local_c2i_at_Parse_internal_1 = local_c2i_at_Parse_internal_7 -lw $t0, -32($fp) -sw $t0, -8($fp) -label_ENDIF_40: -# RETURN local_c2i_at_Parse_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_c2i_at_Parse. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 264 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_a2i_at_Parse implementation. -# @Params: -# 0($fp) = param_a2i_at_Parse_s_0 -function_a2i_at_Parse: - # Allocate stack frame for function function_a2i_at_Parse. - subu $sp, $sp, 208 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 208 - # LOCAL local_a2i_at_Parse_internal_4 --> -20($fp) - # PARAM param_a2i_at_Parse_s_0 --> 0($fp) - # local_a2i_at_Parse_internal_4 = PARAM param_a2i_at_Parse_s_0 - lw $t0, 0($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_at_Parse_internal_4 --> -20($fp) - # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) - # local_a2i_at_Parse_internal_5 = VCALL local_a2i_at_Parse_internal_4 length - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 20($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -28($fp) - # IF_ZERO local_a2i_at_Parse_internal_5 GOTO label_FALSE_141 - # IF_ZERO local_a2i_at_Parse_internal_5 GOTO label_FALSE_141 - lw $t0, -24($fp) - beq $t0, 0, label_FALSE_141 - # IF_ZERO local_a2i_at_Parse_internal_6 GOTO label_FALSE_141 - # IF_ZERO local_a2i_at_Parse_internal_6 GOTO label_FALSE_141 - lw $t0, -28($fp) - beq $t0, 0, label_FALSE_141 - # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) - # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) - # Comparing -24($fp) type with String - la $v0, String - lw $a0, -24($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_STRING_144 - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_STRING_144 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_144 - # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) - # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) - # Comparing -24($fp) type with Bool - la $v0, Bool - lw $a0, -24($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_145 - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_145 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_145 - # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) - # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) - # Comparing -24($fp) type with Int - la $v0, Int - lw $a0, -24($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_145 - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_COMPARE_BY_VALUE_145 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_145 - # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) - # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) - # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) - # Load pointers and SUB - lw $a0, -24($fp) - lw $a1, -28($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_142 - # GOTO label_FALSE_141 - j label_FALSE_141 - label_COMPARE_BY_VALUE_145: - # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) - # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) - # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) - lw $a0, -24($fp) - lw $a1, -28($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_142 - # GOTO label_FALSE_141 - j label_FALSE_141 - label_COMPARE_STRING_144: - # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) - # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) - # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) - # Load strings for comparison - lw $v0, -24($fp) - lw $v1, -28($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_CONTINUE_146 - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_CONTINUE_146 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_146 - # GOTO label_FALSE_141 - j label_FALSE_141 - label_CONTINUE_146: - # LOCAL local_a2i_at_Parse_internal_3 --> -16($fp) - # LOCAL local_a2i_at_Parse_internal_5 --> -24($fp) - # LOCAL local_a2i_at_Parse_internal_6 --> -28($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -24($fp) - lw $v1, -28($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_147: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_148 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_147 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_148: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 - # IF_ZERO local_a2i_at_Parse_internal_3 GOTO label_TRUE_142 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_142 - label_FALSE_141: - # LOCAL local_a2i_at_Parse_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_143 -j label_END_143 -label_TRUE_142: - # LOCAL local_a2i_at_Parse_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_143: -# LOCAL local_a2i_at_Parse_internal_0 --> -4($fp) -# LOCAL local_a2i_at_Parse_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_a2i_at_Parse_internal_0 GOTO label_FALSEIF_139 -# IF_ZERO local_a2i_at_Parse_internal_0 GOTO label_FALSEIF_139 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_139 -# LOCAL local_a2i_at_Parse_internal_7 --> -32($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 0 -sw $t0, 12($v0) -sw $v0, -32($fp) -# LOCAL local_a2i_at_Parse_internal_1 --> -8($fp) -# LOCAL local_a2i_at_Parse_internal_7 --> -32($fp) -# local_a2i_at_Parse_internal_1 = local_a2i_at_Parse_internal_7 -lw $t0, -32($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_140 -j label_ENDIF_140 -label_FALSEIF_139: - # LOCAL local_a2i_at_Parse_internal_12 --> -52($fp) - # PARAM param_a2i_at_Parse_s_0 --> 0($fp) - # local_a2i_at_Parse_internal_12 = PARAM param_a2i_at_Parse_s_0 - lw $t0, 0($fp) - sw $t0, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_at_Parse_internal_14 --> -60($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -60($fp) - # ARG local_a2i_at_Parse_internal_14 - # LOCAL local_a2i_at_Parse_internal_14 --> -60($fp) - lw $t0, -60($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_at_Parse_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -64($fp) - # ARG local_a2i_at_Parse_internal_15 - # LOCAL local_a2i_at_Parse_internal_15 --> -64($fp) - lw $t0, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_at_Parse_internal_12 --> -52($fp) - # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) - # local_a2i_at_Parse_internal_13 = VCALL local_a2i_at_Parse_internal_12 substr - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 60($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_16 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -68($fp) - # IF_ZERO local_a2i_at_Parse_internal_13 GOTO label_FALSE_151 - # IF_ZERO local_a2i_at_Parse_internal_13 GOTO label_FALSE_151 - lw $t0, -56($fp) - beq $t0, 0, label_FALSE_151 - # IF_ZERO local_a2i_at_Parse_internal_16 GOTO label_FALSE_151 - # IF_ZERO local_a2i_at_Parse_internal_16 GOTO label_FALSE_151 - lw $t0, -68($fp) - beq $t0, 0, label_FALSE_151 - # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) - # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) - # Comparing -56($fp) type with String - la $v0, String - lw $a0, -56($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_STRING_154 - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_STRING_154 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_STRING_154 - # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) - # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) - # Comparing -56($fp) type with Bool - la $v0, Bool - lw $a0, -56($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_155 - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_155 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_155 - # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) - # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) - # Comparing -56($fp) type with Int - la $v0, Int - lw $a0, -56($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -48($fp) - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_155 - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_COMPARE_BY_VALUE_155 - lw $t0, -48($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_155 - # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) - # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) - # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) - # Load pointers and SUB - lw $a0, -56($fp) - lw $a1, -68($fp) - sub $a0, $a0, $a1 - sw $a0, -48($fp) - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_152 - # GOTO label_FALSE_151 - j label_FALSE_151 - label_COMPARE_BY_VALUE_155: - # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) - # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) - # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) - lw $a0, -56($fp) - lw $a1, -68($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -48($fp) - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_152 - # GOTO label_FALSE_151 - j label_FALSE_151 - label_COMPARE_STRING_154: - # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) - # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) - # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) - # Load strings for comparison - lw $v0, -56($fp) - lw $v1, -68($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -48($fp) - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_CONTINUE_156 - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_CONTINUE_156 - lw $t0, -48($fp) - beq $t0, 0, label_CONTINUE_156 - # GOTO label_FALSE_151 - j label_FALSE_151 - label_CONTINUE_156: - # LOCAL local_a2i_at_Parse_internal_11 --> -48($fp) - # LOCAL local_a2i_at_Parse_internal_13 --> -56($fp) - # LOCAL local_a2i_at_Parse_internal_16 --> -68($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -56($fp) - lw $v1, -68($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_157: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_158 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_157 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_158: - # Store result - sw $a2, -48($fp) - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 - # IF_ZERO local_a2i_at_Parse_internal_11 GOTO label_TRUE_152 - lw $t0, -48($fp) - beq $t0, 0, label_TRUE_152 - label_FALSE_151: - # LOCAL local_a2i_at_Parse_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -44($fp) - # GOTO label_END_153 -j label_END_153 -label_TRUE_152: - # LOCAL local_a2i_at_Parse_internal_10 --> -44($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -44($fp) - label_END_153: -# LOCAL local_a2i_at_Parse_internal_8 --> -36($fp) -# LOCAL local_a2i_at_Parse_internal_10 --> -44($fp) -# Obtain value from -44($fp) -lw $v0, -44($fp) -lw $v0, 12($v0) -sw $v0, -36($fp) -# IF_ZERO local_a2i_at_Parse_internal_8 GOTO label_FALSEIF_149 -# IF_ZERO local_a2i_at_Parse_internal_8 GOTO label_FALSEIF_149 -lw $t0, -36($fp) -beq $t0, 0, label_FALSEIF_149 -# LOCAL local_a2i_at_Parse_internal_20 --> -84($fp) -# local_a2i_at_Parse_internal_20 = SELF -sw $s1, -84($fp) -# LOCAL local_a2i_at_Parse_internal_18 --> -76($fp) -# LOCAL local_a2i_at_Parse_internal_20 --> -84($fp) -# local_a2i_at_Parse_internal_18 = local_a2i_at_Parse_internal_20 -lw $t0, -84($fp) -sw $t0, -76($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_Parse_internal_21 --> -88($fp) -# PARAM param_a2i_at_Parse_s_0 --> 0($fp) -# local_a2i_at_Parse_internal_21 = PARAM param_a2i_at_Parse_s_0 -lw $t0, 0($fp) -sw $t0, -88($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_Parse_internal_23 --> -96($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -96($fp) -# ARG local_a2i_at_Parse_internal_23 -# LOCAL local_a2i_at_Parse_internal_23 --> -96($fp) -lw $t0, -96($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_Parse_internal_25 --> -104($fp) -# PARAM param_a2i_at_Parse_s_0 --> 0($fp) -# local_a2i_at_Parse_internal_25 = PARAM param_a2i_at_Parse_s_0 -lw $t0, 0($fp) -sw $t0, -104($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_Parse_internal_25 --> -104($fp) -# LOCAL local_a2i_at_Parse_internal_26 --> -108($fp) -# local_a2i_at_Parse_internal_26 = VCALL local_a2i_at_Parse_internal_25 length -# Save new self pointer in $s1 -lw $s1, -104($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 20($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -108($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_Parse_internal_27 --> -112($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -112($fp) -# LOCAL local_a2i_at_Parse_internal_24 --> -100($fp) -# LOCAL local_a2i_at_Parse_internal_26 --> -108($fp) -# LOCAL local_a2i_at_Parse_internal_27 --> -112($fp) -# local_a2i_at_Parse_internal_24 = local_a2i_at_Parse_internal_26 - local_a2i_at_Parse_internal_27 -lw $t1, -108($fp) -lw $t0, 12($t1) -lw $t1, -112($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -100($fp) -# ARG local_a2i_at_Parse_internal_24 -# LOCAL local_a2i_at_Parse_internal_24 --> -100($fp) -lw $t0, -100($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_Parse_internal_21 --> -88($fp) -# LOCAL local_a2i_at_Parse_internal_22 --> -92($fp) -# local_a2i_at_Parse_internal_22 = VCALL local_a2i_at_Parse_internal_21 substr -# Save new self pointer in $s1 -lw $s1, -88($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 60($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -92($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_a2i_at_Parse_internal_22 -# LOCAL local_a2i_at_Parse_internal_22 --> -92($fp) -lw $t0, -92($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_Parse_internal_18 --> -76($fp) -# LOCAL local_a2i_at_Parse_internal_19 --> -80($fp) -# local_a2i_at_Parse_internal_19 = VCALL local_a2i_at_Parse_internal_18 a2i_aux -# Save new self pointer in $s1 -lw $s1, -76($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 44($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -80($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_Parse_internal_17 --> -72($fp) -# LOCAL local_a2i_at_Parse_internal_19 --> -80($fp) -lw $t0, -80($fp) -lw $t0, 12($t0) -not $t0, $t0 -add $t0, $t0, 1 -sw $t0, -72($fp) -# LOCAL local_a2i_at_Parse_internal_17 --> -72($fp) -# LOCAL local_a2i_at_Parse_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -lw $t0, -72($fp) -sw $t0, 12($v0) -sw $v0, -72($fp) -# LOCAL local_a2i_at_Parse_internal_9 --> -40($fp) -# LOCAL local_a2i_at_Parse_internal_17 --> -72($fp) -# local_a2i_at_Parse_internal_9 = local_a2i_at_Parse_internal_17 -lw $t0, -72($fp) -sw $t0, -40($fp) -# GOTO label_ENDIF_150 -j label_ENDIF_150 -label_FALSEIF_149: - # LOCAL local_a2i_at_Parse_internal_32 --> -132($fp) - # PARAM param_a2i_at_Parse_s_0 --> 0($fp) - # local_a2i_at_Parse_internal_32 = PARAM param_a2i_at_Parse_s_0 - lw $t0, 0($fp) - sw $t0, -132($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_at_Parse_internal_34 --> -140($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -140($fp) - # ARG local_a2i_at_Parse_internal_34 - # LOCAL local_a2i_at_Parse_internal_34 --> -140($fp) - lw $t0, -140($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_at_Parse_internal_35 --> -144($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -144($fp) - # ARG local_a2i_at_Parse_internal_35 - # LOCAL local_a2i_at_Parse_internal_35 --> -144($fp) - lw $t0, -144($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_at_Parse_internal_32 --> -132($fp) - # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) - # local_a2i_at_Parse_internal_33 = VCALL local_a2i_at_Parse_internal_32 substr - # Save new self pointer in $s1 - lw $s1, -132($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 60($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -136($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_17 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -148($fp) - # IF_ZERO local_a2i_at_Parse_internal_33 GOTO label_FALSE_161 - # IF_ZERO local_a2i_at_Parse_internal_33 GOTO label_FALSE_161 - lw $t0, -136($fp) - beq $t0, 0, label_FALSE_161 - # IF_ZERO local_a2i_at_Parse_internal_36 GOTO label_FALSE_161 - # IF_ZERO local_a2i_at_Parse_internal_36 GOTO label_FALSE_161 - lw $t0, -148($fp) - beq $t0, 0, label_FALSE_161 - # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) - # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) - # Comparing -136($fp) type with String - la $v0, String - lw $a0, -136($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -128($fp) - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_STRING_164 - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_STRING_164 - lw $t0, -128($fp) - beq $t0, 0, label_COMPARE_STRING_164 - # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) - # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) - # Comparing -136($fp) type with Bool - la $v0, Bool - lw $a0, -136($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -128($fp) - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_BY_VALUE_165 - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_BY_VALUE_165 - lw $t0, -128($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_165 - # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) - # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) - # Comparing -136($fp) type with Int - la $v0, Int - lw $a0, -136($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -128($fp) - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_BY_VALUE_165 - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_COMPARE_BY_VALUE_165 - lw $t0, -128($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_165 - # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) - # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) - # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) - # Load pointers and SUB - lw $a0, -136($fp) - lw $a1, -148($fp) - sub $a0, $a0, $a1 - sw $a0, -128($fp) - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 - lw $t0, -128($fp) - beq $t0, 0, label_TRUE_162 - # GOTO label_FALSE_161 - j label_FALSE_161 - label_COMPARE_BY_VALUE_165: - # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) - # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) - # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) - lw $a0, -136($fp) - lw $a1, -148($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -128($fp) - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 - lw $t0, -128($fp) - beq $t0, 0, label_TRUE_162 - # GOTO label_FALSE_161 - j label_FALSE_161 - label_COMPARE_STRING_164: - # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) - # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) - # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) - # Load strings for comparison - lw $v0, -136($fp) - lw $v1, -148($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -128($fp) - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_CONTINUE_166 - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_CONTINUE_166 - lw $t0, -128($fp) - beq $t0, 0, label_CONTINUE_166 - # GOTO label_FALSE_161 - j label_FALSE_161 - label_CONTINUE_166: - # LOCAL local_a2i_at_Parse_internal_31 --> -128($fp) - # LOCAL local_a2i_at_Parse_internal_33 --> -136($fp) - # LOCAL local_a2i_at_Parse_internal_36 --> -148($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -136($fp) - lw $v1, -148($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_167: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_168 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_167 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_168: - # Store result - sw $a2, -128($fp) - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 - # IF_ZERO local_a2i_at_Parse_internal_31 GOTO label_TRUE_162 - lw $t0, -128($fp) - beq $t0, 0, label_TRUE_162 - label_FALSE_161: - # LOCAL local_a2i_at_Parse_internal_30 --> -124($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -124($fp) - # GOTO label_END_163 -j label_END_163 -label_TRUE_162: - # LOCAL local_a2i_at_Parse_internal_30 --> -124($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -124($fp) - label_END_163: -# LOCAL local_a2i_at_Parse_internal_28 --> -116($fp) -# LOCAL local_a2i_at_Parse_internal_30 --> -124($fp) -# Obtain value from -124($fp) -lw $v0, -124($fp) -lw $v0, 12($v0) -sw $v0, -116($fp) -# IF_ZERO local_a2i_at_Parse_internal_28 GOTO label_FALSEIF_159 -# IF_ZERO local_a2i_at_Parse_internal_28 GOTO label_FALSEIF_159 -lw $t0, -116($fp) -beq $t0, 0, label_FALSEIF_159 -# LOCAL local_a2i_at_Parse_internal_39 --> -160($fp) -# local_a2i_at_Parse_internal_39 = SELF -sw $s1, -160($fp) -# LOCAL local_a2i_at_Parse_internal_37 --> -152($fp) -# LOCAL local_a2i_at_Parse_internal_39 --> -160($fp) -# local_a2i_at_Parse_internal_37 = local_a2i_at_Parse_internal_39 -lw $t0, -160($fp) -sw $t0, -152($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_Parse_internal_40 --> -164($fp) -# PARAM param_a2i_at_Parse_s_0 --> 0($fp) -# local_a2i_at_Parse_internal_40 = PARAM param_a2i_at_Parse_s_0 -lw $t0, 0($fp) -sw $t0, -164($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_Parse_internal_42 --> -172($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -172($fp) -# ARG local_a2i_at_Parse_internal_42 -# LOCAL local_a2i_at_Parse_internal_42 --> -172($fp) -lw $t0, -172($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_Parse_internal_44 --> -180($fp) -# PARAM param_a2i_at_Parse_s_0 --> 0($fp) -# local_a2i_at_Parse_internal_44 = PARAM param_a2i_at_Parse_s_0 -lw $t0, 0($fp) -sw $t0, -180($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_at_Parse_internal_44 --> -180($fp) -# LOCAL local_a2i_at_Parse_internal_45 --> -184($fp) -# local_a2i_at_Parse_internal_45 = VCALL local_a2i_at_Parse_internal_44 length -# Save new self pointer in $s1 -lw $s1, -180($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 20($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -184($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_Parse_internal_46 --> -188($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -188($fp) -# LOCAL local_a2i_at_Parse_internal_43 --> -176($fp) -# LOCAL local_a2i_at_Parse_internal_45 --> -184($fp) -# LOCAL local_a2i_at_Parse_internal_46 --> -188($fp) -# local_a2i_at_Parse_internal_43 = local_a2i_at_Parse_internal_45 - local_a2i_at_Parse_internal_46 -lw $t1, -184($fp) -lw $t0, 12($t1) -lw $t1, -188($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -176($fp) -# ARG local_a2i_at_Parse_internal_43 -# LOCAL local_a2i_at_Parse_internal_43 --> -176($fp) -lw $t0, -176($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_Parse_internal_40 --> -164($fp) -# LOCAL local_a2i_at_Parse_internal_41 --> -168($fp) -# local_a2i_at_Parse_internal_41 = VCALL local_a2i_at_Parse_internal_40 substr -# Save new self pointer in $s1 -lw $s1, -164($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 60($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -168($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# ARG local_a2i_at_Parse_internal_41 -# LOCAL local_a2i_at_Parse_internal_41 --> -168($fp) -lw $t0, -168($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_at_Parse_internal_37 --> -152($fp) -# LOCAL local_a2i_at_Parse_internal_38 --> -156($fp) -# local_a2i_at_Parse_internal_38 = VCALL local_a2i_at_Parse_internal_37 a2i -# Save new self pointer in $s1 -lw $s1, -152($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 56($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -156($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_at_Parse_internal_29 --> -120($fp) -# LOCAL local_a2i_at_Parse_internal_38 --> -156($fp) -# local_a2i_at_Parse_internal_29 = local_a2i_at_Parse_internal_38 -lw $t0, -156($fp) -sw $t0, -120($fp) -# GOTO label_ENDIF_160 -j label_ENDIF_160 -label_FALSEIF_159: - # LOCAL local_a2i_at_Parse_internal_49 --> -200($fp) - # local_a2i_at_Parse_internal_49 = SELF - sw $s1, -200($fp) - # LOCAL local_a2i_at_Parse_internal_47 --> -192($fp) - # LOCAL local_a2i_at_Parse_internal_49 --> -200($fp) - # local_a2i_at_Parse_internal_47 = local_a2i_at_Parse_internal_49 - lw $t0, -200($fp) - sw $t0, -192($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_a2i_at_Parse_s_0 - # PARAM param_a2i_at_Parse_s_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_at_Parse_internal_47 --> -192($fp) - # LOCAL local_a2i_at_Parse_internal_48 --> -196($fp) - # local_a2i_at_Parse_internal_48 = VCALL local_a2i_at_Parse_internal_47 a2i_aux - # Save new self pointer in $s1 - lw $s1, -192($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 44($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -196($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_at_Parse_internal_29 --> -120($fp) - # LOCAL local_a2i_at_Parse_internal_48 --> -196($fp) - # local_a2i_at_Parse_internal_29 = local_a2i_at_Parse_internal_48 - lw $t0, -196($fp) - sw $t0, -120($fp) - label_ENDIF_160: -# LOCAL local_a2i_at_Parse_internal_9 --> -40($fp) -# LOCAL local_a2i_at_Parse_internal_29 --> -120($fp) -# local_a2i_at_Parse_internal_9 = local_a2i_at_Parse_internal_29 -lw $t0, -120($fp) -sw $t0, -40($fp) -label_ENDIF_150: -# LOCAL local_a2i_at_Parse_internal_1 --> -8($fp) -# LOCAL local_a2i_at_Parse_internal_9 --> -40($fp) -# local_a2i_at_Parse_internal_1 = local_a2i_at_Parse_internal_9 -lw $t0, -40($fp) -sw $t0, -8($fp) -label_ENDIF_140: -# RETURN local_a2i_at_Parse_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_a2i_at_Parse. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 208 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_a2i_aux_at_Parse implementation. -# @Params: -# 0($fp) = param_a2i_aux_at_Parse_s_0 -function_a2i_aux_at_Parse: - # Allocate stack frame for function function_a2i_aux_at_Parse. - subu $sp, $sp, 240 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 240 - # LOCAL local_a2i_aux_at_Parse_int_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # LOCAL local_a2i_aux_at_Parse_internal_1 --> -8($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -8($fp) - # LOCAL local_a2i_aux_at_Parse_int_0 --> -4($fp) - # LOCAL local_a2i_aux_at_Parse_internal_1 --> -8($fp) - # local_a2i_aux_at_Parse_int_0 = local_a2i_aux_at_Parse_internal_1 - lw $t0, -8($fp) - sw $t0, -4($fp) - # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # LOCAL local_a2i_aux_at_Parse_internal_3 --> -16($fp) - # PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) - # local_a2i_aux_at_Parse_internal_3 = PARAM param_a2i_aux_at_Parse_s_0 - lw $t0, 0($fp) - sw $t0, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_aux_at_Parse_internal_3 --> -16($fp) - # LOCAL local_a2i_aux_at_Parse_internal_4 --> -20($fp) - # local_a2i_aux_at_Parse_internal_4 = VCALL local_a2i_aux_at_Parse_internal_3 length - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 20($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) - # LOCAL local_a2i_aux_at_Parse_internal_4 --> -20($fp) - # local_a2i_aux_at_Parse_j_2 = local_a2i_aux_at_Parse_internal_4 - lw $t0, -20($fp) - sw $t0, -12($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -24($fp) - # LOCAL local_a2i_aux_at_Parse_internal_6 --> -28($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -28($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # LOCAL local_a2i_aux_at_Parse_internal_6 --> -28($fp) - # local_a2i_aux_at_Parse_i_5 = local_a2i_aux_at_Parse_internal_6 - lw $t0, -28($fp) - sw $t0, -24($fp) - label_WHILE_169: - # LOCAL local_a2i_aux_at_Parse_internal_8 --> -36($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) - lw $a0, -24($fp) - lw $a1, -12($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -36($fp) - # IF_GREATER_ZERO local_a2i_aux_at_Parse_internal_8 GOTO label_FALSE_171 - # IF_GREATER_ZERO local_a2i_aux_at_Parse_internal_8 GOTO label_FALSE_171 - lw $t0, -36($fp) - bgt $t0, 0, label_FALSE_171 - # IF_ZERO local_a2i_aux_at_Parse_internal_8 GOTO label_FALSE_171 - # IF_ZERO local_a2i_aux_at_Parse_internal_8 GOTO label_FALSE_171 - lw $t0, -36($fp) - beq $t0, 0, label_FALSE_171 - # LOCAL local_a2i_aux_at_Parse_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -36($fp) - # GOTO label_END_172 -j label_END_172 -label_FALSE_171: - # LOCAL local_a2i_aux_at_Parse_internal_8 --> -36($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -36($fp) - label_END_172: -# LOCAL local_a2i_aux_at_Parse_internal_7 --> -32($fp) -# LOCAL local_a2i_aux_at_Parse_internal_8 --> -36($fp) -# Obtain value from -36($fp) -lw $v0, -36($fp) -lw $v0, 12($v0) -sw $v0, -32($fp) -# IF_ZERO local_a2i_aux_at_Parse_internal_7 GOTO label_WHILE_END_170 -# IF_ZERO local_a2i_aux_at_Parse_internal_7 GOTO label_WHILE_END_170 -lw $t0, -32($fp) -beq $t0, 0, label_WHILE_END_170 -# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_0 -sw $t0, 12($v0) -li $t0, 0 -sw $t0, 16($v0) -sw $v0, -40($fp) -# LOCAL local_a2i_aux_at_Parse_internal_10 --> -44($fp) -# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) -# local_a2i_aux_at_Parse_internal_10 = PARAM param_a2i_aux_at_Parse_s_0 -lw $t0, 0($fp) -sw $t0, -44($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# ARG local_a2i_aux_at_Parse_i_5 -# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) -lw $t0, -24($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_aux_at_Parse_internal_12 --> -52($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -52($fp) -# ARG local_a2i_aux_at_Parse_internal_12 -# LOCAL local_a2i_aux_at_Parse_internal_12 --> -52($fp) -lw $t0, -52($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_aux_at_Parse_internal_10 --> -44($fp) -# LOCAL local_a2i_aux_at_Parse_internal_11 --> -48($fp) -# local_a2i_aux_at_Parse_internal_11 = VCALL local_a2i_aux_at_Parse_internal_10 substr -# Save new self pointer in $s1 -lw $s1, -44($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 60($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -48($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) -# LOCAL local_a2i_aux_at_Parse_internal_11 --> -48($fp) -# local_a2i_aux_at_Parse_c_9 = local_a2i_aux_at_Parse_internal_11 -lw $t0, -48($fp) -sw $t0, -40($fp) -# LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_18 -sw $t0, 12($v0) -li $t0, 1 -sw $t0, 16($v0) -sw $v0, -72($fp) -# IF_ZERO local_a2i_aux_at_Parse_c_9 GOTO label_FALSE_175 -# IF_ZERO local_a2i_aux_at_Parse_c_9 GOTO label_FALSE_175 -lw $t0, -40($fp) -beq $t0, 0, label_FALSE_175 -# IF_ZERO local_a2i_aux_at_Parse_internal_17 GOTO label_FALSE_175 -# IF_ZERO local_a2i_aux_at_Parse_internal_17 GOTO label_FALSE_175 -lw $t0, -72($fp) -beq $t0, 0, label_FALSE_175 -# LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) -# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) -# Comparing -40($fp) type with String -la $v0, String -lw $a0, -40($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -68($fp) -# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_STRING_178 -# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_STRING_178 -lw $t0, -68($fp) -beq $t0, 0, label_COMPARE_STRING_178 -# LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) -# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) -# Comparing -40($fp) type with Bool -la $v0, Bool -lw $a0, -40($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -68($fp) -# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_BY_VALUE_179 -# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_BY_VALUE_179 -lw $t0, -68($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_179 -# LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) -# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) -# Comparing -40($fp) type with Int -la $v0, Int -lw $a0, -40($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -68($fp) -# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_BY_VALUE_179 -# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_COMPARE_BY_VALUE_179 -lw $t0, -68($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_179 -# LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) -# LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) -# LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) -# Load pointers and SUB -lw $a0, -40($fp) -lw $a1, -72($fp) -sub $a0, $a0, $a1 -sw $a0, -68($fp) -# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 -# IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 -lw $t0, -68($fp) -beq $t0, 0, label_TRUE_176 -# GOTO label_FALSE_175 -j label_FALSE_175 -label_COMPARE_BY_VALUE_179: - # LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) - # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) - # LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) - lw $a0, -40($fp) - lw $a1, -72($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -68($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 - # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 - lw $t0, -68($fp) - beq $t0, 0, label_TRUE_176 - # GOTO label_FALSE_175 - j label_FALSE_175 - label_COMPARE_STRING_178: - # LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) - # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) - # LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) - # Load strings for comparison - lw $v0, -40($fp) - lw $v1, -72($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -68($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_CONTINUE_180 - # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_CONTINUE_180 - lw $t0, -68($fp) - beq $t0, 0, label_CONTINUE_180 - # GOTO label_FALSE_175 - j label_FALSE_175 - label_CONTINUE_180: - # LOCAL local_a2i_aux_at_Parse_internal_16 --> -68($fp) - # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) - # LOCAL local_a2i_aux_at_Parse_internal_17 --> -72($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -40($fp) - lw $v1, -72($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_181: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_182 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_181 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_182: - # Store result - sw $a2, -68($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 - # IF_ZERO local_a2i_aux_at_Parse_internal_16 GOTO label_TRUE_176 - lw $t0, -68($fp) - beq $t0, 0, label_TRUE_176 - label_FALSE_175: - # LOCAL local_a2i_aux_at_Parse_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -64($fp) - # GOTO label_END_177 -j label_END_177 -label_TRUE_176: - # LOCAL local_a2i_aux_at_Parse_internal_15 --> -64($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -64($fp) - label_END_177: -# LOCAL local_a2i_aux_at_Parse_internal_13 --> -56($fp) -# LOCAL local_a2i_aux_at_Parse_internal_15 --> -64($fp) -# Obtain value from -64($fp) -lw $v0, -64($fp) -lw $v0, 12($v0) -sw $v0, -56($fp) -# IF_ZERO local_a2i_aux_at_Parse_internal_13 GOTO label_FALSEIF_173 -# IF_ZERO local_a2i_aux_at_Parse_internal_13 GOTO label_FALSEIF_173 -lw $t0, -56($fp) -beq $t0, 0, label_FALSEIF_173 -# LOCAL local_a2i_aux_at_Parse_internal_18 --> -76($fp) -# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) -# local_a2i_aux_at_Parse_internal_18 = PARAM param_a2i_aux_at_Parse_s_0 -lw $t0, 0($fp) -sw $t0, -76($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_aux_at_Parse_internal_21 --> -88($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -88($fp) -# LOCAL local_a2i_aux_at_Parse_internal_20 --> -84($fp) -# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) -# LOCAL local_a2i_aux_at_Parse_internal_21 --> -88($fp) -# local_a2i_aux_at_Parse_internal_20 = local_a2i_aux_at_Parse_i_5 + local_a2i_aux_at_Parse_internal_21 -lw $t1, -24($fp) -lw $t0, 12($t1) -lw $t1, -88($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -84($fp) -# ARG local_a2i_aux_at_Parse_internal_20 -# LOCAL local_a2i_aux_at_Parse_internal_20 --> -84($fp) -lw $t0, -84($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_aux_at_Parse_internal_24 --> -100($fp) -# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) -# local_a2i_aux_at_Parse_internal_24 = PARAM param_a2i_aux_at_Parse_s_0 -lw $t0, 0($fp) -sw $t0, -100($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_aux_at_Parse_internal_24 --> -100($fp) -# LOCAL local_a2i_aux_at_Parse_internal_25 --> -104($fp) -# local_a2i_aux_at_Parse_internal_25 = VCALL local_a2i_aux_at_Parse_internal_24 length -# Save new self pointer in $s1 -lw $s1, -100($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 20($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -104($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_aux_at_Parse_internal_23 --> -96($fp) -# LOCAL local_a2i_aux_at_Parse_internal_25 --> -104($fp) -# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) -# local_a2i_aux_at_Parse_internal_23 = local_a2i_aux_at_Parse_internal_25 - local_a2i_aux_at_Parse_i_5 -lw $t1, -104($fp) -lw $t0, 12($t1) -lw $t1, -24($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -96($fp) -# LOCAL local_a2i_aux_at_Parse_internal_26 --> -108($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -108($fp) -# LOCAL local_a2i_aux_at_Parse_internal_22 --> -92($fp) -# LOCAL local_a2i_aux_at_Parse_internal_23 --> -96($fp) -# LOCAL local_a2i_aux_at_Parse_internal_26 --> -108($fp) -# local_a2i_aux_at_Parse_internal_22 = local_a2i_aux_at_Parse_internal_23 - local_a2i_aux_at_Parse_internal_26 -lw $t1, -96($fp) -lw $t0, 12($t1) -lw $t1, -108($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -92($fp) -# ARG local_a2i_aux_at_Parse_internal_22 -# LOCAL local_a2i_aux_at_Parse_internal_22 --> -92($fp) -lw $t0, -92($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_aux_at_Parse_internal_18 --> -76($fp) -# LOCAL local_a2i_aux_at_Parse_internal_19 --> -80($fp) -# local_a2i_aux_at_Parse_internal_19 = VCALL local_a2i_aux_at_Parse_internal_18 substr -# Save new self pointer in $s1 -lw $s1, -76($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 60($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -80($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# -# LOCAL local_a2i_aux_at_Parse_internal_19 --> -80($fp) -lw $t0, -80($fp) -sw $t0, 16($s1) -# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) -# LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) -# local_a2i_aux_at_Parse_i_5 = local_a2i_aux_at_Parse_j_2 -lw $t0, -12($fp) -sw $t0, -24($fp) -# LOCAL local_a2i_aux_at_Parse_internal_14 --> -60($fp) -# local_a2i_aux_at_Parse_internal_14 = -# GOTO label_ENDIF_174 -j label_ENDIF_174 -label_FALSEIF_173: - # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_19 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -128($fp) - # IF_ZERO local_a2i_aux_at_Parse_c_9 GOTO label_FALSE_185 - # IF_ZERO local_a2i_aux_at_Parse_c_9 GOTO label_FALSE_185 - lw $t0, -40($fp) - beq $t0, 0, label_FALSE_185 - # IF_ZERO local_a2i_aux_at_Parse_internal_31 GOTO label_FALSE_185 - # IF_ZERO local_a2i_aux_at_Parse_internal_31 GOTO label_FALSE_185 - lw $t0, -128($fp) - beq $t0, 0, label_FALSE_185 - # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) - # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) - # Comparing -40($fp) type with String - la $v0, String - lw $a0, -40($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -124($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_STRING_188 - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_STRING_188 - lw $t0, -124($fp) - beq $t0, 0, label_COMPARE_STRING_188 - # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) - # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) - # Comparing -40($fp) type with Bool - la $v0, Bool - lw $a0, -40($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -124($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_BY_VALUE_189 - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_BY_VALUE_189 - lw $t0, -124($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_189 - # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) - # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) - # Comparing -40($fp) type with Int - la $v0, Int - lw $a0, -40($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -124($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_BY_VALUE_189 - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_COMPARE_BY_VALUE_189 - lw $t0, -124($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_189 - # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) - # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) - # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) - # Load pointers and SUB - lw $a0, -40($fp) - lw $a1, -128($fp) - sub $a0, $a0, $a1 - sw $a0, -124($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 - lw $t0, -124($fp) - beq $t0, 0, label_TRUE_186 - # GOTO label_FALSE_185 - j label_FALSE_185 - label_COMPARE_BY_VALUE_189: - # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) - # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) - # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) - lw $a0, -40($fp) - lw $a1, -128($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -124($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 - lw $t0, -124($fp) - beq $t0, 0, label_TRUE_186 - # GOTO label_FALSE_185 - j label_FALSE_185 - label_COMPARE_STRING_188: - # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) - # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) - # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) - # Load strings for comparison - lw $v0, -40($fp) - lw $v1, -128($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -124($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_CONTINUE_190 - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_CONTINUE_190 - lw $t0, -124($fp) - beq $t0, 0, label_CONTINUE_190 - # GOTO label_FALSE_185 - j label_FALSE_185 - label_CONTINUE_190: - # LOCAL local_a2i_aux_at_Parse_internal_30 --> -124($fp) - # LOCAL local_a2i_aux_at_Parse_c_9 --> -40($fp) - # LOCAL local_a2i_aux_at_Parse_internal_31 --> -128($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -40($fp) - lw $v1, -128($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_191: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_192 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_191 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_192: - # Store result - sw $a2, -124($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 - # IF_ZERO local_a2i_aux_at_Parse_internal_30 GOTO label_TRUE_186 - lw $t0, -124($fp) - beq $t0, 0, label_TRUE_186 - label_FALSE_185: - # LOCAL local_a2i_aux_at_Parse_internal_29 --> -120($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -120($fp) - # GOTO label_END_187 -j label_END_187 -label_TRUE_186: - # LOCAL local_a2i_aux_at_Parse_internal_29 --> -120($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -120($fp) - label_END_187: -# LOCAL local_a2i_aux_at_Parse_internal_27 --> -112($fp) -# LOCAL local_a2i_aux_at_Parse_internal_29 --> -120($fp) -# Obtain value from -120($fp) -lw $v0, -120($fp) -lw $v0, 12($v0) -sw $v0, -112($fp) -# IF_ZERO local_a2i_aux_at_Parse_internal_27 GOTO label_FALSEIF_183 -# IF_ZERO local_a2i_aux_at_Parse_internal_27 GOTO label_FALSEIF_183 -lw $t0, -112($fp) -beq $t0, 0, label_FALSEIF_183 -# LOCAL local_a2i_aux_at_Parse_internal_32 --> -132($fp) -# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) -# local_a2i_aux_at_Parse_internal_32 = PARAM param_a2i_aux_at_Parse_s_0 -lw $t0, 0($fp) -sw $t0, -132($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_aux_at_Parse_internal_35 --> -144($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -144($fp) -# LOCAL local_a2i_aux_at_Parse_internal_34 --> -140($fp) -# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) -# LOCAL local_a2i_aux_at_Parse_internal_35 --> -144($fp) -# local_a2i_aux_at_Parse_internal_34 = local_a2i_aux_at_Parse_i_5 + local_a2i_aux_at_Parse_internal_35 -lw $t1, -24($fp) -lw $t0, 12($t1) -lw $t1, -144($fp) -lw $t2, 12($t1) -add $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -140($fp) -# ARG local_a2i_aux_at_Parse_internal_34 -# LOCAL local_a2i_aux_at_Parse_internal_34 --> -140($fp) -lw $t0, -140($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_aux_at_Parse_internal_38 --> -156($fp) -# PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) -# local_a2i_aux_at_Parse_internal_38 = PARAM param_a2i_aux_at_Parse_s_0 -lw $t0, 0($fp) -sw $t0, -156($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_a2i_aux_at_Parse_internal_38 --> -156($fp) -# LOCAL local_a2i_aux_at_Parse_internal_39 --> -160($fp) -# local_a2i_aux_at_Parse_internal_39 = VCALL local_a2i_aux_at_Parse_internal_38 length -# Save new self pointer in $s1 -lw $s1, -156($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 20($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -160($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_a2i_aux_at_Parse_internal_37 --> -152($fp) -# LOCAL local_a2i_aux_at_Parse_internal_39 --> -160($fp) -# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) -# local_a2i_aux_at_Parse_internal_37 = local_a2i_aux_at_Parse_internal_39 - local_a2i_aux_at_Parse_i_5 -lw $t1, -160($fp) -lw $t0, 12($t1) -lw $t1, -24($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -152($fp) -# LOCAL local_a2i_aux_at_Parse_internal_40 --> -164($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, Int -sw $t0, 12($v0) -li $t0, 3 -sw $t0, 16($v0) -move $t0, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t0, 0($v0) -la $t0, Int_start -sw $t0, 4($v0) -# Load type offset -li $t0, 16 -sw $t0, 8($v0) -li $t0, 1 -sw $t0, 12($v0) -sw $v0, -164($fp) -# LOCAL local_a2i_aux_at_Parse_internal_36 --> -148($fp) -# LOCAL local_a2i_aux_at_Parse_internal_37 --> -152($fp) -# LOCAL local_a2i_aux_at_Parse_internal_40 --> -164($fp) -# local_a2i_aux_at_Parse_internal_36 = local_a2i_aux_at_Parse_internal_37 - local_a2i_aux_at_Parse_internal_40 -lw $t1, -152($fp) -lw $t0, 12($t1) -lw $t1, -164($fp) -lw $t2, 12($t1) -sub $t0, $t0, $t2 -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string for type Int -la $t1, String -sw $t1, 0($v0) -la $t1, String_start -sw $t1, 4($v0) -# Load type offset -li $t1, 8 -sw $t1, 8($v0) -la $t1, Int -sw $t1, 12($v0) -li $t1, 3 -sw $t1, 16($v0) -move $t1, $v0 -# Allocating 16 bytes of memory -li $a0, 16 -li $v0, 9 -syscall -sw $t1, 0($v0) -la $t1, Int_start -sw $t1, 4($v0) -# Load type offset -li $t1, 16 -sw $t1, 8($v0) -sw $t0, 12($v0) -sw $v0, -148($fp) -# ARG local_a2i_aux_at_Parse_internal_36 -# LOCAL local_a2i_aux_at_Parse_internal_36 --> -148($fp) -lw $t0, -148($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_a2i_aux_at_Parse_internal_32 --> -132($fp) -# LOCAL local_a2i_aux_at_Parse_internal_33 --> -136($fp) -# local_a2i_aux_at_Parse_internal_33 = VCALL local_a2i_aux_at_Parse_internal_32 substr -# Save new self pointer in $s1 -lw $s1, -132($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 60($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -136($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# -# LOCAL local_a2i_aux_at_Parse_internal_33 --> -136($fp) -lw $t0, -136($fp) -sw $t0, 16($s1) -# LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) -# LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) -# local_a2i_aux_at_Parse_i_5 = local_a2i_aux_at_Parse_j_2 -lw $t0, -12($fp) -sw $t0, -24($fp) -# LOCAL local_a2i_aux_at_Parse_internal_28 --> -116($fp) -# local_a2i_aux_at_Parse_internal_28 = -# GOTO label_ENDIF_184 -j label_ENDIF_184 -label_FALSEIF_183: - # LOCAL local_a2i_aux_at_Parse_internal_43 --> -176($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 10 - sw $t0, 12($v0) - sw $v0, -176($fp) - # LOCAL local_a2i_aux_at_Parse_internal_42 --> -172($fp) - # LOCAL local_a2i_aux_at_Parse_int_0 --> -4($fp) - # LOCAL local_a2i_aux_at_Parse_internal_43 --> -176($fp) - # local_a2i_aux_at_Parse_internal_42 = local_a2i_aux_at_Parse_int_0 * local_a2i_aux_at_Parse_internal_43 - lw $t1, -4($fp) - lw $t0, 12($t1) - lw $t1, -176($fp) - lw $t2, 12($t1) - mul $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -172($fp) - # LOCAL local_a2i_aux_at_Parse_internal_46 --> -188($fp) - # local_a2i_aux_at_Parse_internal_46 = SELF - sw $s1, -188($fp) - # LOCAL local_a2i_aux_at_Parse_internal_44 --> -180($fp) - # LOCAL local_a2i_aux_at_Parse_internal_46 --> -188($fp) - # local_a2i_aux_at_Parse_internal_44 = local_a2i_aux_at_Parse_internal_46 - lw $t0, -188($fp) - sw $t0, -180($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_a2i_aux_at_Parse_internal_47 --> -192($fp) - # PARAM param_a2i_aux_at_Parse_s_0 --> 0($fp) - # local_a2i_aux_at_Parse_internal_47 = PARAM param_a2i_aux_at_Parse_s_0 - lw $t0, 0($fp) - sw $t0, -192($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG local_a2i_aux_at_Parse_i_5 - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - lw $t0, -24($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_aux_at_Parse_internal_49 --> -200($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -200($fp) - # ARG local_a2i_aux_at_Parse_internal_49 - # LOCAL local_a2i_aux_at_Parse_internal_49 --> -200($fp) - lw $t0, -200($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_aux_at_Parse_internal_47 --> -192($fp) - # LOCAL local_a2i_aux_at_Parse_internal_48 --> -196($fp) - # local_a2i_aux_at_Parse_internal_48 = VCALL local_a2i_aux_at_Parse_internal_47 substr - # Save new self pointer in $s1 - lw $s1, -192($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 60($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -196($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_a2i_aux_at_Parse_internal_48 - # LOCAL local_a2i_aux_at_Parse_internal_48 --> -196($fp) - lw $t0, -196($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_a2i_aux_at_Parse_internal_44 --> -180($fp) - # LOCAL local_a2i_aux_at_Parse_internal_45 --> -184($fp) - # local_a2i_aux_at_Parse_internal_45 = VCALL local_a2i_aux_at_Parse_internal_44 c2i - # Save new self pointer in $s1 - lw $s1, -180($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 116($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -184($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_a2i_aux_at_Parse_internal_41 --> -168($fp) - # LOCAL local_a2i_aux_at_Parse_internal_42 --> -172($fp) - # LOCAL local_a2i_aux_at_Parse_internal_45 --> -184($fp) - # local_a2i_aux_at_Parse_internal_41 = local_a2i_aux_at_Parse_internal_42 + local_a2i_aux_at_Parse_internal_45 - lw $t1, -172($fp) - lw $t0, 12($t1) - lw $t1, -184($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -168($fp) - # LOCAL local_a2i_aux_at_Parse_int_0 --> -4($fp) - # LOCAL local_a2i_aux_at_Parse_internal_41 --> -168($fp) - # local_a2i_aux_at_Parse_int_0 = local_a2i_aux_at_Parse_internal_41 - lw $t0, -168($fp) - sw $t0, -4($fp) - # LOCAL local_a2i_aux_at_Parse_internal_51 --> -208($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -208($fp) - # LOCAL local_a2i_aux_at_Parse_internal_50 --> -204($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # LOCAL local_a2i_aux_at_Parse_internal_51 --> -208($fp) - # local_a2i_aux_at_Parse_internal_50 = local_a2i_aux_at_Parse_i_5 + local_a2i_aux_at_Parse_internal_51 - lw $t1, -24($fp) - lw $t0, 12($t1) - lw $t1, -208($fp) - lw $t2, 12($t1) - add $t0, $t0, $t2 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t1, String - sw $t1, 0($v0) - la $t1, String_start - sw $t1, 4($v0) - # Load type offset - li $t1, 8 - sw $t1, 8($v0) - la $t1, Int - sw $t1, 12($v0) - li $t1, 3 - sw $t1, 16($v0) - move $t1, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t1, 0($v0) - la $t1, Int_start - sw $t1, 4($v0) - # Load type offset - li $t1, 16 - sw $t1, 8($v0) - sw $t0, 12($v0) - sw $v0, -204($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # LOCAL local_a2i_aux_at_Parse_internal_50 --> -204($fp) - # local_a2i_aux_at_Parse_i_5 = local_a2i_aux_at_Parse_internal_50 - lw $t0, -204($fp) - sw $t0, -24($fp) - # IF_ZERO local_a2i_aux_at_Parse_i_5 GOTO label_FALSE_195 - # IF_ZERO local_a2i_aux_at_Parse_i_5 GOTO label_FALSE_195 - lw $t0, -24($fp) - beq $t0, 0, label_FALSE_195 - # IF_ZERO local_a2i_aux_at_Parse_j_2 GOTO label_FALSE_195 - # IF_ZERO local_a2i_aux_at_Parse_j_2 GOTO label_FALSE_195 - lw $t0, -12($fp) - beq $t0, 0, label_FALSE_195 - # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # Comparing -24($fp) type with String - la $v0, String - lw $a0, -24($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -224($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_STRING_198 - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_STRING_198 - lw $t0, -224($fp) - beq $t0, 0, label_COMPARE_STRING_198 - # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # Comparing -24($fp) type with Bool - la $v0, Bool - lw $a0, -24($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -224($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_BY_VALUE_199 - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_BY_VALUE_199 - lw $t0, -224($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_199 - # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # Comparing -24($fp) type with Int - la $v0, Int - lw $a0, -24($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -224($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_BY_VALUE_199 - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_COMPARE_BY_VALUE_199 - lw $t0, -224($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_199 - # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) - # Load pointers and SUB - lw $a0, -24($fp) - lw $a1, -12($fp) - sub $a0, $a0, $a1 - sw $a0, -224($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 - lw $t0, -224($fp) - beq $t0, 0, label_TRUE_196 - # GOTO label_FALSE_195 - j label_FALSE_195 - label_COMPARE_BY_VALUE_199: - # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) - lw $a0, -24($fp) - lw $a1, -12($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -224($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 - lw $t0, -224($fp) - beq $t0, 0, label_TRUE_196 - # GOTO label_FALSE_195 - j label_FALSE_195 - label_COMPARE_STRING_198: - # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) - # Load strings for comparison - lw $v0, -24($fp) - lw $v1, -12($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -224($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_CONTINUE_200 - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_CONTINUE_200 - lw $t0, -224($fp) - beq $t0, 0, label_CONTINUE_200 - # GOTO label_FALSE_195 - j label_FALSE_195 - label_CONTINUE_200: - # LOCAL local_a2i_aux_at_Parse_internal_55 --> -224($fp) - # LOCAL local_a2i_aux_at_Parse_i_5 --> -24($fp) - # LOCAL local_a2i_aux_at_Parse_j_2 --> -12($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -24($fp) - lw $v1, -12($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_201: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_202 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_201 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_202: - # Store result - sw $a2, -224($fp) - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 - # IF_ZERO local_a2i_aux_at_Parse_internal_55 GOTO label_TRUE_196 - lw $t0, -224($fp) - beq $t0, 0, label_TRUE_196 - label_FALSE_195: - # LOCAL local_a2i_aux_at_Parse_internal_54 --> -220($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -220($fp) - # GOTO label_END_197 -j label_END_197 -label_TRUE_196: - # LOCAL local_a2i_aux_at_Parse_internal_54 --> -220($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -220($fp) - label_END_197: -# LOCAL local_a2i_aux_at_Parse_internal_52 --> -212($fp) -# LOCAL local_a2i_aux_at_Parse_internal_54 --> -220($fp) -# Obtain value from -220($fp) -lw $v0, -220($fp) -lw $v0, 12($v0) -sw $v0, -212($fp) -# IF_ZERO local_a2i_aux_at_Parse_internal_52 GOTO label_FALSEIF_193 -# IF_ZERO local_a2i_aux_at_Parse_internal_52 GOTO label_FALSEIF_193 -lw $t0, -212($fp) -beq $t0, 0, label_FALSEIF_193 -# LOCAL local_a2i_aux_at_Parse_internal_56 --> -228($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_20 -sw $t0, 12($v0) -li $t0, 0 -sw $t0, 16($v0) -sw $v0, -228($fp) -# -# LOCAL local_a2i_aux_at_Parse_internal_56 --> -228($fp) -lw $t0, -228($fp) -sw $t0, 16($s1) -# LOCAL local_a2i_aux_at_Parse_internal_53 --> -216($fp) -# local_a2i_aux_at_Parse_internal_53 = -# GOTO label_ENDIF_194 -j label_ENDIF_194 -label_FALSEIF_193: - # LOCAL local_a2i_aux_at_Parse_internal_57 --> -232($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_21 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -232($fp) - # LOCAL local_a2i_aux_at_Parse_internal_53 --> -216($fp) - # LOCAL local_a2i_aux_at_Parse_internal_57 --> -232($fp) - # local_a2i_aux_at_Parse_internal_53 = local_a2i_aux_at_Parse_internal_57 - lw $t0, -232($fp) - sw $t0, -216($fp) - label_ENDIF_194: -# LOCAL local_a2i_aux_at_Parse_internal_28 --> -116($fp) -# LOCAL local_a2i_aux_at_Parse_internal_53 --> -216($fp) -# local_a2i_aux_at_Parse_internal_28 = local_a2i_aux_at_Parse_internal_53 -lw $t0, -216($fp) -sw $t0, -116($fp) -label_ENDIF_184: -# LOCAL local_a2i_aux_at_Parse_internal_14 --> -60($fp) -# LOCAL local_a2i_aux_at_Parse_internal_28 --> -116($fp) -# local_a2i_aux_at_Parse_internal_14 = local_a2i_aux_at_Parse_internal_28 -lw $t0, -116($fp) -sw $t0, -60($fp) -label_ENDIF_174: -# GOTO label_WHILE_169 -j label_WHILE_169 -label_WHILE_END_170: - # RETURN local_a2i_aux_at_Parse_int_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_a2i_aux_at_Parse. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 240 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_main_at_Main implementation. -# @Params: -function_main_at_Main: - # Allocate stack frame for function function_main_at_Main. - subu $sp, $sp, 448 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 448 - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_22 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -20($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_23 - sw $t0, 12($v0) - li $t0, 0 - sw $t0, 16($v0) - sw $v0, -24($fp) - # IF_ZERO local_main_at_Main_internal_4 GOTO label_FALSE_205 - # IF_ZERO local_main_at_Main_internal_4 GOTO label_FALSE_205 - lw $t0, -20($fp) - beq $t0, 0, label_FALSE_205 - # IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSE_205 - # IF_ZERO local_main_at_Main_internal_5 GOTO label_FALSE_205 - lw $t0, -24($fp) - beq $t0, 0, label_FALSE_205 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # Comparing -20($fp) type with String - la $v0, String - lw $a0, -20($fp) - lw $a0, 0($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_main_at_Main_internal_3 GOTO label_COMPARE_STRING_208 - # IF_ZERO local_main_at_Main_internal_3 GOTO label_COMPARE_STRING_208 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_STRING_208 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # Comparing -20($fp) type with Bool - la $v0, Bool - lw $a0, -20($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_main_at_Main_internal_3 GOTO label_COMPARE_BY_VALUE_209 - # IF_ZERO local_main_at_Main_internal_3 GOTO label_COMPARE_BY_VALUE_209 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_209 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # Comparing -20($fp) type with Int - la $v0, Int - lw $a0, -20($fp) - lw $a0, 0($a0) - lw $a0, 12($a0) - sub $a0, $a0, $v0 - sw $a0, -16($fp) - # IF_ZERO local_main_at_Main_internal_3 GOTO label_COMPARE_BY_VALUE_209 - # IF_ZERO local_main_at_Main_internal_3 GOTO label_COMPARE_BY_VALUE_209 - lw $t0, -16($fp) - beq $t0, 0, label_COMPARE_BY_VALUE_209 - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # Load pointers and SUB - lw $a0, -20($fp) - lw $a1, -24($fp) - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_main_at_Main_internal_3 GOTO label_TRUE_206 - # IF_ZERO local_main_at_Main_internal_3 GOTO label_TRUE_206 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_206 - # GOTO label_FALSE_205 - j label_FALSE_205 - label_COMPARE_BY_VALUE_209: - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - lw $a0, -20($fp) - lw $a1, -24($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -16($fp) - # IF_ZERO local_main_at_Main_internal_3 GOTO label_TRUE_206 - # IF_ZERO local_main_at_Main_internal_3 GOTO label_TRUE_206 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_206 - # GOTO label_FALSE_205 - j label_FALSE_205 - label_COMPARE_STRING_208: - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - # Load strings for comparison - lw $v0, -20($fp) - lw $v1, -24($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -16($fp) - # IF_ZERO local_main_at_Main_internal_3 GOTO label_CONTINUE_210 - # IF_ZERO local_main_at_Main_internal_3 GOTO label_CONTINUE_210 - lw $t0, -16($fp) - beq $t0, 0, label_CONTINUE_210 - # GOTO label_FALSE_205 - j label_FALSE_205 - label_CONTINUE_210: - # LOCAL local_main_at_Main_internal_3 --> -16($fp) - # LOCAL local_main_at_Main_internal_4 --> -20($fp) - # LOCAL local_main_at_Main_internal_5 --> -24($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -20($fp) - lw $v1, -24($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_211: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_212 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_211 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_212: - # Store result - sw $a2, -16($fp) - # IF_ZERO local_main_at_Main_internal_3 GOTO label_TRUE_206 - # IF_ZERO local_main_at_Main_internal_3 GOTO label_TRUE_206 - lw $t0, -16($fp) - beq $t0, 0, label_TRUE_206 - label_FALSE_205: - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -12($fp) - # GOTO label_END_207 -j label_END_207 -label_TRUE_206: - # LOCAL local_main_at_Main_internal_2 --> -12($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -12($fp) - label_END_207: -# LOCAL local_main_at_Main_internal_0 --> -4($fp) -# LOCAL local_main_at_Main_internal_2 --> -12($fp) -# Obtain value from -12($fp) -lw $v0, -12($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_main_at_Main_internal_0 GOTO label_FALSEIF_203 -# IF_ZERO local_main_at_Main_internal_0 GOTO label_FALSEIF_203 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_203 -# LOCAL local_main_at_Main_internal_8 --> -36($fp) -# local_main_at_Main_internal_8 = SELF -sw $s1, -36($fp) -# LOCAL local_main_at_Main_internal_6 --> -28($fp) -# LOCAL local_main_at_Main_internal_8 --> -36($fp) -# local_main_at_Main_internal_6 = local_main_at_Main_internal_8 -lw $t0, -36($fp) -sw $t0, -28($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_9 --> -40($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_24 -sw $t0, 12($v0) -li $t0, 6 -sw $t0, 16($v0) -sw $v0, -40($fp) -# ARG local_main_at_Main_internal_9 -# LOCAL local_main_at_Main_internal_9 --> -40($fp) -lw $t0, -40($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_6 --> -28($fp) -# LOCAL local_main_at_Main_internal_7 --> -32($fp) -# local_main_at_Main_internal_7 = VCALL local_main_at_Main_internal_6 out_string -# Save new self pointer in $s1 -lw $s1, -28($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 92($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -32($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_1 --> -8($fp) -# LOCAL local_main_at_Main_internal_7 --> -32($fp) -# local_main_at_Main_internal_1 = local_main_at_Main_internal_7 -lw $t0, -32($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_204 -j label_ENDIF_204 -label_FALSEIF_203: - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_12 = SELF - sw $s1, -52($fp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_12 --> -52($fp) - # local_main_at_Main_internal_10 = local_main_at_Main_internal_12 - lw $t0, -52($fp) - sw $t0, -44($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_25 - sw $t0, 12($v0) - li $t0, 6 - sw $t0, 16($v0) - sw $v0, -56($fp) - # ARG local_main_at_Main_internal_13 - # LOCAL local_main_at_Main_internal_13 --> -56($fp) - lw $t0, -56($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_10 --> -44($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_11 = VCALL local_main_at_Main_internal_10 out_string - # Save new self pointer in $s1 - lw $s1, -44($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -48($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_1 --> -8($fp) - # LOCAL local_main_at_Main_internal_11 --> -48($fp) - # local_main_at_Main_internal_1 = local_main_at_Main_internal_11 - lw $t0, -48($fp) - sw $t0, -8($fp) - label_ENDIF_204: -# LOCAL local_main_at_Main_internal_20 --> -84($fp) -# local_main_at_Main_internal_20 = SELF -sw $s1, -84($fp) -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# LOCAL local_main_at_Main_internal_20 --> -84($fp) -# local_main_at_Main_internal_18 = local_main_at_Main_internal_20 -lw $t0, -84($fp) -sw $t0, -76($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_18 --> -76($fp) -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# local_main_at_Main_internal_19 = VCALL local_main_at_Main_internal_18 in_string -# Save new self pointer in $s1 -lw $s1, -76($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 100($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -80($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_21 --> -88($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_26 -sw $t0, 12($v0) -li $t0, 0 -sw $t0, 16($v0) -sw $v0, -88($fp) -# IF_ZERO local_main_at_Main_internal_19 GOTO label_FALSE_215 -# IF_ZERO local_main_at_Main_internal_19 GOTO label_FALSE_215 -lw $t0, -80($fp) -beq $t0, 0, label_FALSE_215 -# IF_ZERO local_main_at_Main_internal_21 GOTO label_FALSE_215 -# IF_ZERO local_main_at_Main_internal_21 GOTO label_FALSE_215 -lw $t0, -88($fp) -beq $t0, 0, label_FALSE_215 -# LOCAL local_main_at_Main_internal_17 --> -72($fp) -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# Comparing -80($fp) type with String -la $v0, String -lw $a0, -80($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -72($fp) -# IF_ZERO local_main_at_Main_internal_17 GOTO label_COMPARE_STRING_218 -# IF_ZERO local_main_at_Main_internal_17 GOTO label_COMPARE_STRING_218 -lw $t0, -72($fp) -beq $t0, 0, label_COMPARE_STRING_218 -# LOCAL local_main_at_Main_internal_17 --> -72($fp) -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# Comparing -80($fp) type with Bool -la $v0, Bool -lw $a0, -80($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -72($fp) -# IF_ZERO local_main_at_Main_internal_17 GOTO label_COMPARE_BY_VALUE_219 -# IF_ZERO local_main_at_Main_internal_17 GOTO label_COMPARE_BY_VALUE_219 -lw $t0, -72($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_219 -# LOCAL local_main_at_Main_internal_17 --> -72($fp) -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# Comparing -80($fp) type with Int -la $v0, Int -lw $a0, -80($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -72($fp) -# IF_ZERO local_main_at_Main_internal_17 GOTO label_COMPARE_BY_VALUE_219 -# IF_ZERO local_main_at_Main_internal_17 GOTO label_COMPARE_BY_VALUE_219 -lw $t0, -72($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_219 -# LOCAL local_main_at_Main_internal_17 --> -72($fp) -# LOCAL local_main_at_Main_internal_19 --> -80($fp) -# LOCAL local_main_at_Main_internal_21 --> -88($fp) -# Load pointers and SUB -lw $a0, -80($fp) -lw $a1, -88($fp) -sub $a0, $a0, $a1 -sw $a0, -72($fp) -# IF_ZERO local_main_at_Main_internal_17 GOTO label_TRUE_216 -# IF_ZERO local_main_at_Main_internal_17 GOTO label_TRUE_216 -lw $t0, -72($fp) -beq $t0, 0, label_TRUE_216 -# GOTO label_FALSE_215 -j label_FALSE_215 -label_COMPARE_BY_VALUE_219: - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - lw $a0, -80($fp) - lw $a1, -88($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -72($fp) - # IF_ZERO local_main_at_Main_internal_17 GOTO label_TRUE_216 - # IF_ZERO local_main_at_Main_internal_17 GOTO label_TRUE_216 - lw $t0, -72($fp) - beq $t0, 0, label_TRUE_216 - # GOTO label_FALSE_215 - j label_FALSE_215 - label_COMPARE_STRING_218: - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - # Load strings for comparison - lw $v0, -80($fp) - lw $v1, -88($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -72($fp) - # IF_ZERO local_main_at_Main_internal_17 GOTO label_CONTINUE_220 - # IF_ZERO local_main_at_Main_internal_17 GOTO label_CONTINUE_220 - lw $t0, -72($fp) - beq $t0, 0, label_CONTINUE_220 - # GOTO label_FALSE_215 - j label_FALSE_215 - label_CONTINUE_220: - # LOCAL local_main_at_Main_internal_17 --> -72($fp) - # LOCAL local_main_at_Main_internal_19 --> -80($fp) - # LOCAL local_main_at_Main_internal_21 --> -88($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -80($fp) - lw $v1, -88($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_221: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_222 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_221 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_222: - # Store result - sw $a2, -72($fp) - # IF_ZERO local_main_at_Main_internal_17 GOTO label_TRUE_216 - # IF_ZERO local_main_at_Main_internal_17 GOTO label_TRUE_216 - lw $t0, -72($fp) - beq $t0, 0, label_TRUE_216 - label_FALSE_215: - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -68($fp) - # GOTO label_END_217 -j label_END_217 -label_TRUE_216: - # LOCAL local_main_at_Main_internal_16 --> -68($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -68($fp) - label_END_217: -# LOCAL local_main_at_Main_internal_14 --> -60($fp) -# LOCAL local_main_at_Main_internal_16 --> -68($fp) -# Obtain value from -68($fp) -lw $v0, -68($fp) -lw $v0, 12($v0) -sw $v0, -60($fp) -# IF_ZERO local_main_at_Main_internal_14 GOTO label_FALSEIF_213 -# IF_ZERO local_main_at_Main_internal_14 GOTO label_FALSEIF_213 -lw $t0, -60($fp) -beq $t0, 0, label_FALSEIF_213 -# LOCAL local_main_at_Main_internal_24 --> -100($fp) -# local_main_at_Main_internal_24 = SELF -sw $s1, -100($fp) -# LOCAL local_main_at_Main_internal_22 --> -92($fp) -# LOCAL local_main_at_Main_internal_24 --> -100($fp) -# local_main_at_Main_internal_22 = local_main_at_Main_internal_24 -lw $t0, -100($fp) -sw $t0, -92($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_25 --> -104($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_27 -sw $t0, 12($v0) -li $t0, 6 -sw $t0, 16($v0) -sw $v0, -104($fp) -# ARG local_main_at_Main_internal_25 -# LOCAL local_main_at_Main_internal_25 --> -104($fp) -lw $t0, -104($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_22 --> -92($fp) -# LOCAL local_main_at_Main_internal_23 --> -96($fp) -# local_main_at_Main_internal_23 = VCALL local_main_at_Main_internal_22 out_string -# Save new self pointer in $s1 -lw $s1, -92($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 92($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -96($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_15 --> -64($fp) -# LOCAL local_main_at_Main_internal_23 --> -96($fp) -# local_main_at_Main_internal_15 = local_main_at_Main_internal_23 -lw $t0, -96($fp) -sw $t0, -64($fp) -# GOTO label_ENDIF_214 -j label_ENDIF_214 -label_FALSEIF_213: - # LOCAL local_main_at_Main_internal_28 --> -116($fp) - # local_main_at_Main_internal_28 = SELF - sw $s1, -116($fp) - # LOCAL local_main_at_Main_internal_26 --> -108($fp) - # LOCAL local_main_at_Main_internal_28 --> -116($fp) - # local_main_at_Main_internal_26 = local_main_at_Main_internal_28 - lw $t0, -116($fp) - sw $t0, -108($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_29 --> -120($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_28 - sw $t0, 12($v0) - li $t0, 6 - sw $t0, 16($v0) - sw $v0, -120($fp) - # ARG local_main_at_Main_internal_29 - # LOCAL local_main_at_Main_internal_29 --> -120($fp) - lw $t0, -120($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_26 --> -108($fp) - # LOCAL local_main_at_Main_internal_27 --> -112($fp) - # local_main_at_Main_internal_27 = VCALL local_main_at_Main_internal_26 out_string - # Save new self pointer in $s1 - lw $s1, -108($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -112($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_15 --> -64($fp) - # LOCAL local_main_at_Main_internal_27 --> -112($fp) - # local_main_at_Main_internal_15 = local_main_at_Main_internal_27 - lw $t0, -112($fp) - sw $t0, -64($fp) - label_ENDIF_214: -# LOCAL local_main_at_Main_internal_36 --> -148($fp) -# local_main_at_Main_internal_36 = SELF -sw $s1, -148($fp) -# LOCAL local_main_at_Main_internal_34 --> -140($fp) -# LOCAL local_main_at_Main_internal_36 --> -148($fp) -# local_main_at_Main_internal_34 = local_main_at_Main_internal_36 -lw $t0, -148($fp) -sw $t0, -140($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_34 --> -140($fp) -# LOCAL local_main_at_Main_internal_35 --> -144($fp) -# local_main_at_Main_internal_35 = VCALL local_main_at_Main_internal_34 in_string -# Save new self pointer in $s1 -lw $s1, -140($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 100($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -144($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_37 --> -152($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_29 -sw $t0, 12($v0) -li $t0, 0 -sw $t0, 16($v0) -sw $v0, -152($fp) -# IF_ZERO local_main_at_Main_internal_35 GOTO label_FALSE_225 -# IF_ZERO local_main_at_Main_internal_35 GOTO label_FALSE_225 -lw $t0, -144($fp) -beq $t0, 0, label_FALSE_225 -# IF_ZERO local_main_at_Main_internal_37 GOTO label_FALSE_225 -# IF_ZERO local_main_at_Main_internal_37 GOTO label_FALSE_225 -lw $t0, -152($fp) -beq $t0, 0, label_FALSE_225 -# LOCAL local_main_at_Main_internal_33 --> -136($fp) -# LOCAL local_main_at_Main_internal_35 --> -144($fp) -# Comparing -144($fp) type with String -la $v0, String -lw $a0, -144($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -136($fp) -# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_STRING_228 -# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_STRING_228 -lw $t0, -136($fp) -beq $t0, 0, label_COMPARE_STRING_228 -# LOCAL local_main_at_Main_internal_33 --> -136($fp) -# LOCAL local_main_at_Main_internal_35 --> -144($fp) -# Comparing -144($fp) type with Bool -la $v0, Bool -lw $a0, -144($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -136($fp) -# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_BY_VALUE_229 -# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_BY_VALUE_229 -lw $t0, -136($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_229 -# LOCAL local_main_at_Main_internal_33 --> -136($fp) -# LOCAL local_main_at_Main_internal_35 --> -144($fp) -# Comparing -144($fp) type with Int -la $v0, Int -lw $a0, -144($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -136($fp) -# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_BY_VALUE_229 -# IF_ZERO local_main_at_Main_internal_33 GOTO label_COMPARE_BY_VALUE_229 -lw $t0, -136($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_229 -# LOCAL local_main_at_Main_internal_33 --> -136($fp) -# LOCAL local_main_at_Main_internal_35 --> -144($fp) -# LOCAL local_main_at_Main_internal_37 --> -152($fp) -# Load pointers and SUB -lw $a0, -144($fp) -lw $a1, -152($fp) -sub $a0, $a0, $a1 -sw $a0, -136($fp) -# IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_226 -# IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_226 -lw $t0, -136($fp) -beq $t0, 0, label_TRUE_226 -# GOTO label_FALSE_225 -j label_FALSE_225 -label_COMPARE_BY_VALUE_229: - # LOCAL local_main_at_Main_internal_33 --> -136($fp) - # LOCAL local_main_at_Main_internal_35 --> -144($fp) - # LOCAL local_main_at_Main_internal_37 --> -152($fp) - lw $a0, -144($fp) - lw $a1, -152($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -136($fp) - # IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_226 - # IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_226 - lw $t0, -136($fp) - beq $t0, 0, label_TRUE_226 - # GOTO label_FALSE_225 - j label_FALSE_225 - label_COMPARE_STRING_228: - # LOCAL local_main_at_Main_internal_33 --> -136($fp) - # LOCAL local_main_at_Main_internal_35 --> -144($fp) - # LOCAL local_main_at_Main_internal_37 --> -152($fp) - # Load strings for comparison - lw $v0, -144($fp) - lw $v1, -152($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -136($fp) - # IF_ZERO local_main_at_Main_internal_33 GOTO label_CONTINUE_230 - # IF_ZERO local_main_at_Main_internal_33 GOTO label_CONTINUE_230 - lw $t0, -136($fp) - beq $t0, 0, label_CONTINUE_230 - # GOTO label_FALSE_225 - j label_FALSE_225 - label_CONTINUE_230: - # LOCAL local_main_at_Main_internal_33 --> -136($fp) - # LOCAL local_main_at_Main_internal_35 --> -144($fp) - # LOCAL local_main_at_Main_internal_37 --> -152($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -144($fp) - lw $v1, -152($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_231: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_232 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_231 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_232: - # Store result - sw $a2, -136($fp) - # IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_226 - # IF_ZERO local_main_at_Main_internal_33 GOTO label_TRUE_226 - lw $t0, -136($fp) - beq $t0, 0, label_TRUE_226 - label_FALSE_225: - # LOCAL local_main_at_Main_internal_32 --> -132($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -132($fp) - # GOTO label_END_227 -j label_END_227 -label_TRUE_226: - # LOCAL local_main_at_Main_internal_32 --> -132($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -132($fp) - label_END_227: -# LOCAL local_main_at_Main_internal_30 --> -124($fp) -# LOCAL local_main_at_Main_internal_32 --> -132($fp) -# Obtain value from -132($fp) -lw $v0, -132($fp) -lw $v0, 12($v0) -sw $v0, -124($fp) -# IF_ZERO local_main_at_Main_internal_30 GOTO label_FALSEIF_223 -# IF_ZERO local_main_at_Main_internal_30 GOTO label_FALSEIF_223 -lw $t0, -124($fp) -beq $t0, 0, label_FALSEIF_223 -# LOCAL local_main_at_Main_internal_40 --> -164($fp) -# local_main_at_Main_internal_40 = SELF -sw $s1, -164($fp) -# LOCAL local_main_at_Main_internal_38 --> -156($fp) -# LOCAL local_main_at_Main_internal_40 --> -164($fp) -# local_main_at_Main_internal_38 = local_main_at_Main_internal_40 -lw $t0, -164($fp) -sw $t0, -156($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_41 --> -168($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_30 -sw $t0, 12($v0) -li $t0, 6 -sw $t0, 16($v0) -sw $v0, -168($fp) -# ARG local_main_at_Main_internal_41 -# LOCAL local_main_at_Main_internal_41 --> -168($fp) -lw $t0, -168($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_38 --> -156($fp) -# LOCAL local_main_at_Main_internal_39 --> -160($fp) -# local_main_at_Main_internal_39 = VCALL local_main_at_Main_internal_38 out_string -# Save new self pointer in $s1 -lw $s1, -156($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 92($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -160($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_31 --> -128($fp) -# LOCAL local_main_at_Main_internal_39 --> -160($fp) -# local_main_at_Main_internal_31 = local_main_at_Main_internal_39 -lw $t0, -160($fp) -sw $t0, -128($fp) -# GOTO label_ENDIF_224 -j label_ENDIF_224 -label_FALSEIF_223: - # LOCAL local_main_at_Main_internal_44 --> -180($fp) - # local_main_at_Main_internal_44 = SELF - sw $s1, -180($fp) - # LOCAL local_main_at_Main_internal_42 --> -172($fp) - # LOCAL local_main_at_Main_internal_44 --> -180($fp) - # local_main_at_Main_internal_42 = local_main_at_Main_internal_44 - lw $t0, -180($fp) - sw $t0, -172($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_45 --> -184($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_31 - sw $t0, 12($v0) - li $t0, 6 - sw $t0, 16($v0) - sw $v0, -184($fp) - # ARG local_main_at_Main_internal_45 - # LOCAL local_main_at_Main_internal_45 --> -184($fp) - lw $t0, -184($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_42 --> -172($fp) - # LOCAL local_main_at_Main_internal_43 --> -176($fp) - # local_main_at_Main_internal_43 = VCALL local_main_at_Main_internal_42 out_string - # Save new self pointer in $s1 - lw $s1, -172($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -176($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_31 --> -128($fp) - # LOCAL local_main_at_Main_internal_43 --> -176($fp) - # local_main_at_Main_internal_31 = local_main_at_Main_internal_43 - lw $t0, -176($fp) - sw $t0, -128($fp) - label_ENDIF_224: -# LOCAL local_main_at_Main_internal_52 --> -212($fp) -# local_main_at_Main_internal_52 = SELF -sw $s1, -212($fp) -# LOCAL local_main_at_Main_internal_50 --> -204($fp) -# LOCAL local_main_at_Main_internal_52 --> -212($fp) -# local_main_at_Main_internal_50 = local_main_at_Main_internal_52 -lw $t0, -212($fp) -sw $t0, -204($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_50 --> -204($fp) -# LOCAL local_main_at_Main_internal_51 --> -208($fp) -# local_main_at_Main_internal_51 = VCALL local_main_at_Main_internal_50 in_string -# Save new self pointer in $s1 -lw $s1, -204($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 100($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -208($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_53 --> -216($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_32 -sw $t0, 12($v0) -li $t0, 0 -sw $t0, 16($v0) -sw $v0, -216($fp) -# IF_ZERO local_main_at_Main_internal_51 GOTO label_FALSE_235 -# IF_ZERO local_main_at_Main_internal_51 GOTO label_FALSE_235 -lw $t0, -208($fp) -beq $t0, 0, label_FALSE_235 -# IF_ZERO local_main_at_Main_internal_53 GOTO label_FALSE_235 -# IF_ZERO local_main_at_Main_internal_53 GOTO label_FALSE_235 -lw $t0, -216($fp) -beq $t0, 0, label_FALSE_235 -# LOCAL local_main_at_Main_internal_49 --> -200($fp) -# LOCAL local_main_at_Main_internal_51 --> -208($fp) -# Comparing -208($fp) type with String -la $v0, String -lw $a0, -208($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -200($fp) -# IF_ZERO local_main_at_Main_internal_49 GOTO label_COMPARE_STRING_238 -# IF_ZERO local_main_at_Main_internal_49 GOTO label_COMPARE_STRING_238 -lw $t0, -200($fp) -beq $t0, 0, label_COMPARE_STRING_238 -# LOCAL local_main_at_Main_internal_49 --> -200($fp) -# LOCAL local_main_at_Main_internal_51 --> -208($fp) -# Comparing -208($fp) type with Bool -la $v0, Bool -lw $a0, -208($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -200($fp) -# IF_ZERO local_main_at_Main_internal_49 GOTO label_COMPARE_BY_VALUE_239 -# IF_ZERO local_main_at_Main_internal_49 GOTO label_COMPARE_BY_VALUE_239 -lw $t0, -200($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_239 -# LOCAL local_main_at_Main_internal_49 --> -200($fp) -# LOCAL local_main_at_Main_internal_51 --> -208($fp) -# Comparing -208($fp) type with Int -la $v0, Int -lw $a0, -208($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -200($fp) -# IF_ZERO local_main_at_Main_internal_49 GOTO label_COMPARE_BY_VALUE_239 -# IF_ZERO local_main_at_Main_internal_49 GOTO label_COMPARE_BY_VALUE_239 -lw $t0, -200($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_239 -# LOCAL local_main_at_Main_internal_49 --> -200($fp) -# LOCAL local_main_at_Main_internal_51 --> -208($fp) -# LOCAL local_main_at_Main_internal_53 --> -216($fp) -# Load pointers and SUB -lw $a0, -208($fp) -lw $a1, -216($fp) -sub $a0, $a0, $a1 -sw $a0, -200($fp) -# IF_ZERO local_main_at_Main_internal_49 GOTO label_TRUE_236 -# IF_ZERO local_main_at_Main_internal_49 GOTO label_TRUE_236 -lw $t0, -200($fp) -beq $t0, 0, label_TRUE_236 -# GOTO label_FALSE_235 -j label_FALSE_235 -label_COMPARE_BY_VALUE_239: - # LOCAL local_main_at_Main_internal_49 --> -200($fp) - # LOCAL local_main_at_Main_internal_51 --> -208($fp) - # LOCAL local_main_at_Main_internal_53 --> -216($fp) - lw $a0, -208($fp) - lw $a1, -216($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -200($fp) - # IF_ZERO local_main_at_Main_internal_49 GOTO label_TRUE_236 - # IF_ZERO local_main_at_Main_internal_49 GOTO label_TRUE_236 - lw $t0, -200($fp) - beq $t0, 0, label_TRUE_236 - # GOTO label_FALSE_235 - j label_FALSE_235 - label_COMPARE_STRING_238: - # LOCAL local_main_at_Main_internal_49 --> -200($fp) - # LOCAL local_main_at_Main_internal_51 --> -208($fp) - # LOCAL local_main_at_Main_internal_53 --> -216($fp) - # Load strings for comparison - lw $v0, -208($fp) - lw $v1, -216($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -200($fp) - # IF_ZERO local_main_at_Main_internal_49 GOTO label_CONTINUE_240 - # IF_ZERO local_main_at_Main_internal_49 GOTO label_CONTINUE_240 - lw $t0, -200($fp) - beq $t0, 0, label_CONTINUE_240 - # GOTO label_FALSE_235 - j label_FALSE_235 - label_CONTINUE_240: - # LOCAL local_main_at_Main_internal_49 --> -200($fp) - # LOCAL local_main_at_Main_internal_51 --> -208($fp) - # LOCAL local_main_at_Main_internal_53 --> -216($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -208($fp) - lw $v1, -216($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_241: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_242 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_241 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_242: - # Store result - sw $a2, -200($fp) - # IF_ZERO local_main_at_Main_internal_49 GOTO label_TRUE_236 - # IF_ZERO local_main_at_Main_internal_49 GOTO label_TRUE_236 - lw $t0, -200($fp) - beq $t0, 0, label_TRUE_236 - label_FALSE_235: - # LOCAL local_main_at_Main_internal_48 --> -196($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -196($fp) - # GOTO label_END_237 -j label_END_237 -label_TRUE_236: - # LOCAL local_main_at_Main_internal_48 --> -196($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -196($fp) - label_END_237: -# LOCAL local_main_at_Main_internal_46 --> -188($fp) -# LOCAL local_main_at_Main_internal_48 --> -196($fp) -# Obtain value from -196($fp) -lw $v0, -196($fp) -lw $v0, 12($v0) -sw $v0, -188($fp) -# IF_ZERO local_main_at_Main_internal_46 GOTO label_FALSEIF_233 -# IF_ZERO local_main_at_Main_internal_46 GOTO label_FALSEIF_233 -lw $t0, -188($fp) -beq $t0, 0, label_FALSEIF_233 -# LOCAL local_main_at_Main_internal_56 --> -228($fp) -# local_main_at_Main_internal_56 = SELF -sw $s1, -228($fp) -# LOCAL local_main_at_Main_internal_54 --> -220($fp) -# LOCAL local_main_at_Main_internal_56 --> -228($fp) -# local_main_at_Main_internal_54 = local_main_at_Main_internal_56 -lw $t0, -228($fp) -sw $t0, -220($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_57 --> -232($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_33 -sw $t0, 12($v0) -li $t0, 6 -sw $t0, 16($v0) -sw $v0, -232($fp) -# ARG local_main_at_Main_internal_57 -# LOCAL local_main_at_Main_internal_57 --> -232($fp) -lw $t0, -232($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_54 --> -220($fp) -# LOCAL local_main_at_Main_internal_55 --> -224($fp) -# local_main_at_Main_internal_55 = VCALL local_main_at_Main_internal_54 out_string -# Save new self pointer in $s1 -lw $s1, -220($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 92($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -224($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_47 --> -192($fp) -# LOCAL local_main_at_Main_internal_55 --> -224($fp) -# local_main_at_Main_internal_47 = local_main_at_Main_internal_55 -lw $t0, -224($fp) -sw $t0, -192($fp) -# GOTO label_ENDIF_234 -j label_ENDIF_234 -label_FALSEIF_233: - # LOCAL local_main_at_Main_internal_60 --> -244($fp) - # local_main_at_Main_internal_60 = SELF - sw $s1, -244($fp) - # LOCAL local_main_at_Main_internal_58 --> -236($fp) - # LOCAL local_main_at_Main_internal_60 --> -244($fp) - # local_main_at_Main_internal_58 = local_main_at_Main_internal_60 - lw $t0, -244($fp) - sw $t0, -236($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_61 --> -248($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_34 - sw $t0, 12($v0) - li $t0, 6 - sw $t0, 16($v0) - sw $v0, -248($fp) - # ARG local_main_at_Main_internal_61 - # LOCAL local_main_at_Main_internal_61 --> -248($fp) - lw $t0, -248($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_58 --> -236($fp) - # LOCAL local_main_at_Main_internal_59 --> -240($fp) - # local_main_at_Main_internal_59 = VCALL local_main_at_Main_internal_58 out_string - # Save new self pointer in $s1 - lw $s1, -236($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -240($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_47 --> -192($fp) - # LOCAL local_main_at_Main_internal_59 --> -240($fp) - # local_main_at_Main_internal_47 = local_main_at_Main_internal_59 - lw $t0, -240($fp) - sw $t0, -192($fp) - label_ENDIF_234: -# LOCAL local_main_at_Main_internal_68 --> -276($fp) -# local_main_at_Main_internal_68 = SELF -sw $s1, -276($fp) -# LOCAL local_main_at_Main_internal_66 --> -268($fp) -# LOCAL local_main_at_Main_internal_68 --> -276($fp) -# local_main_at_Main_internal_66 = local_main_at_Main_internal_68 -lw $t0, -276($fp) -sw $t0, -268($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_66 --> -268($fp) -# LOCAL local_main_at_Main_internal_67 --> -272($fp) -# local_main_at_Main_internal_67 = VCALL local_main_at_Main_internal_66 in_string -# Save new self pointer in $s1 -lw $s1, -268($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 100($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -272($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_69 --> -280($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_35 -sw $t0, 12($v0) -li $t0, 0 -sw $t0, 16($v0) -sw $v0, -280($fp) -# IF_ZERO local_main_at_Main_internal_67 GOTO label_FALSE_245 -# IF_ZERO local_main_at_Main_internal_67 GOTO label_FALSE_245 -lw $t0, -272($fp) -beq $t0, 0, label_FALSE_245 -# IF_ZERO local_main_at_Main_internal_69 GOTO label_FALSE_245 -# IF_ZERO local_main_at_Main_internal_69 GOTO label_FALSE_245 -lw $t0, -280($fp) -beq $t0, 0, label_FALSE_245 -# LOCAL local_main_at_Main_internal_65 --> -264($fp) -# LOCAL local_main_at_Main_internal_67 --> -272($fp) -# Comparing -272($fp) type with String -la $v0, String -lw $a0, -272($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -264($fp) -# IF_ZERO local_main_at_Main_internal_65 GOTO label_COMPARE_STRING_248 -# IF_ZERO local_main_at_Main_internal_65 GOTO label_COMPARE_STRING_248 -lw $t0, -264($fp) -beq $t0, 0, label_COMPARE_STRING_248 -# LOCAL local_main_at_Main_internal_65 --> -264($fp) -# LOCAL local_main_at_Main_internal_67 --> -272($fp) -# Comparing -272($fp) type with Bool -la $v0, Bool -lw $a0, -272($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -264($fp) -# IF_ZERO local_main_at_Main_internal_65 GOTO label_COMPARE_BY_VALUE_249 -# IF_ZERO local_main_at_Main_internal_65 GOTO label_COMPARE_BY_VALUE_249 -lw $t0, -264($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_249 -# LOCAL local_main_at_Main_internal_65 --> -264($fp) -# LOCAL local_main_at_Main_internal_67 --> -272($fp) -# Comparing -272($fp) type with Int -la $v0, Int -lw $a0, -272($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -264($fp) -# IF_ZERO local_main_at_Main_internal_65 GOTO label_COMPARE_BY_VALUE_249 -# IF_ZERO local_main_at_Main_internal_65 GOTO label_COMPARE_BY_VALUE_249 -lw $t0, -264($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_249 -# LOCAL local_main_at_Main_internal_65 --> -264($fp) -# LOCAL local_main_at_Main_internal_67 --> -272($fp) -# LOCAL local_main_at_Main_internal_69 --> -280($fp) -# Load pointers and SUB -lw $a0, -272($fp) -lw $a1, -280($fp) -sub $a0, $a0, $a1 -sw $a0, -264($fp) -# IF_ZERO local_main_at_Main_internal_65 GOTO label_TRUE_246 -# IF_ZERO local_main_at_Main_internal_65 GOTO label_TRUE_246 -lw $t0, -264($fp) -beq $t0, 0, label_TRUE_246 -# GOTO label_FALSE_245 -j label_FALSE_245 -label_COMPARE_BY_VALUE_249: - # LOCAL local_main_at_Main_internal_65 --> -264($fp) - # LOCAL local_main_at_Main_internal_67 --> -272($fp) - # LOCAL local_main_at_Main_internal_69 --> -280($fp) - lw $a0, -272($fp) - lw $a1, -280($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -264($fp) - # IF_ZERO local_main_at_Main_internal_65 GOTO label_TRUE_246 - # IF_ZERO local_main_at_Main_internal_65 GOTO label_TRUE_246 - lw $t0, -264($fp) - beq $t0, 0, label_TRUE_246 - # GOTO label_FALSE_245 - j label_FALSE_245 - label_COMPARE_STRING_248: - # LOCAL local_main_at_Main_internal_65 --> -264($fp) - # LOCAL local_main_at_Main_internal_67 --> -272($fp) - # LOCAL local_main_at_Main_internal_69 --> -280($fp) - # Load strings for comparison - lw $v0, -272($fp) - lw $v1, -280($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -264($fp) - # IF_ZERO local_main_at_Main_internal_65 GOTO label_CONTINUE_250 - # IF_ZERO local_main_at_Main_internal_65 GOTO label_CONTINUE_250 - lw $t0, -264($fp) - beq $t0, 0, label_CONTINUE_250 - # GOTO label_FALSE_245 - j label_FALSE_245 - label_CONTINUE_250: - # LOCAL local_main_at_Main_internal_65 --> -264($fp) - # LOCAL local_main_at_Main_internal_67 --> -272($fp) - # LOCAL local_main_at_Main_internal_69 --> -280($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -272($fp) - lw $v1, -280($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_251: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_252 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_251 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_252: - # Store result - sw $a2, -264($fp) - # IF_ZERO local_main_at_Main_internal_65 GOTO label_TRUE_246 - # IF_ZERO local_main_at_Main_internal_65 GOTO label_TRUE_246 - lw $t0, -264($fp) - beq $t0, 0, label_TRUE_246 - label_FALSE_245: - # LOCAL local_main_at_Main_internal_64 --> -260($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -260($fp) - # GOTO label_END_247 -j label_END_247 -label_TRUE_246: - # LOCAL local_main_at_Main_internal_64 --> -260($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -260($fp) - label_END_247: -# LOCAL local_main_at_Main_internal_62 --> -252($fp) -# LOCAL local_main_at_Main_internal_64 --> -260($fp) -# Obtain value from -260($fp) -lw $v0, -260($fp) -lw $v0, 12($v0) -sw $v0, -252($fp) -# IF_ZERO local_main_at_Main_internal_62 GOTO label_FALSEIF_243 -# IF_ZERO local_main_at_Main_internal_62 GOTO label_FALSEIF_243 -lw $t0, -252($fp) -beq $t0, 0, label_FALSEIF_243 -# LOCAL local_main_at_Main_internal_72 --> -292($fp) -# local_main_at_Main_internal_72 = SELF -sw $s1, -292($fp) -# LOCAL local_main_at_Main_internal_70 --> -284($fp) -# LOCAL local_main_at_Main_internal_72 --> -292($fp) -# local_main_at_Main_internal_70 = local_main_at_Main_internal_72 -lw $t0, -292($fp) -sw $t0, -284($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_73 --> -296($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_36 -sw $t0, 12($v0) -li $t0, 6 -sw $t0, 16($v0) -sw $v0, -296($fp) -# ARG local_main_at_Main_internal_73 -# LOCAL local_main_at_Main_internal_73 --> -296($fp) -lw $t0, -296($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_70 --> -284($fp) -# LOCAL local_main_at_Main_internal_71 --> -288($fp) -# local_main_at_Main_internal_71 = VCALL local_main_at_Main_internal_70 out_string -# Save new self pointer in $s1 -lw $s1, -284($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 92($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -288($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_63 --> -256($fp) -# LOCAL local_main_at_Main_internal_71 --> -288($fp) -# local_main_at_Main_internal_63 = local_main_at_Main_internal_71 -lw $t0, -288($fp) -sw $t0, -256($fp) -# GOTO label_ENDIF_244 -j label_ENDIF_244 -label_FALSEIF_243: - # LOCAL local_main_at_Main_internal_76 --> -308($fp) - # local_main_at_Main_internal_76 = SELF - sw $s1, -308($fp) - # LOCAL local_main_at_Main_internal_74 --> -300($fp) - # LOCAL local_main_at_Main_internal_76 --> -308($fp) - # local_main_at_Main_internal_74 = local_main_at_Main_internal_76 - lw $t0, -308($fp) - sw $t0, -300($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_77 --> -312($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_37 - sw $t0, 12($v0) - li $t0, 6 - sw $t0, 16($v0) - sw $v0, -312($fp) - # ARG local_main_at_Main_internal_77 - # LOCAL local_main_at_Main_internal_77 --> -312($fp) - lw $t0, -312($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_74 --> -300($fp) - # LOCAL local_main_at_Main_internal_75 --> -304($fp) - # local_main_at_Main_internal_75 = VCALL local_main_at_Main_internal_74 out_string - # Save new self pointer in $s1 - lw $s1, -300($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -304($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_63 --> -256($fp) - # LOCAL local_main_at_Main_internal_75 --> -304($fp) - # local_main_at_Main_internal_63 = local_main_at_Main_internal_75 - lw $t0, -304($fp) - sw $t0, -256($fp) - label_ENDIF_244: -# LOCAL local_main_at_Main_internal_84 --> -340($fp) -# local_main_at_Main_internal_84 = SELF -sw $s1, -340($fp) -# LOCAL local_main_at_Main_internal_82 --> -332($fp) -# LOCAL local_main_at_Main_internal_84 --> -340($fp) -# local_main_at_Main_internal_82 = local_main_at_Main_internal_84 -lw $t0, -340($fp) -sw $t0, -332($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_82 --> -332($fp) -# LOCAL local_main_at_Main_internal_83 --> -336($fp) -# local_main_at_Main_internal_83 = VCALL local_main_at_Main_internal_82 in_string -# Save new self pointer in $s1 -lw $s1, -332($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 100($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -336($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_85 --> -344($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_38 -sw $t0, 12($v0) -li $t0, 0 -sw $t0, 16($v0) -sw $v0, -344($fp) -# IF_ZERO local_main_at_Main_internal_83 GOTO label_FALSE_255 -# IF_ZERO local_main_at_Main_internal_83 GOTO label_FALSE_255 -lw $t0, -336($fp) -beq $t0, 0, label_FALSE_255 -# IF_ZERO local_main_at_Main_internal_85 GOTO label_FALSE_255 -# IF_ZERO local_main_at_Main_internal_85 GOTO label_FALSE_255 -lw $t0, -344($fp) -beq $t0, 0, label_FALSE_255 -# LOCAL local_main_at_Main_internal_81 --> -328($fp) -# LOCAL local_main_at_Main_internal_83 --> -336($fp) -# Comparing -336($fp) type with String -la $v0, String -lw $a0, -336($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -328($fp) -# IF_ZERO local_main_at_Main_internal_81 GOTO label_COMPARE_STRING_258 -# IF_ZERO local_main_at_Main_internal_81 GOTO label_COMPARE_STRING_258 -lw $t0, -328($fp) -beq $t0, 0, label_COMPARE_STRING_258 -# LOCAL local_main_at_Main_internal_81 --> -328($fp) -# LOCAL local_main_at_Main_internal_83 --> -336($fp) -# Comparing -336($fp) type with Bool -la $v0, Bool -lw $a0, -336($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -328($fp) -# IF_ZERO local_main_at_Main_internal_81 GOTO label_COMPARE_BY_VALUE_259 -# IF_ZERO local_main_at_Main_internal_81 GOTO label_COMPARE_BY_VALUE_259 -lw $t0, -328($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_259 -# LOCAL local_main_at_Main_internal_81 --> -328($fp) -# LOCAL local_main_at_Main_internal_83 --> -336($fp) -# Comparing -336($fp) type with Int -la $v0, Int -lw $a0, -336($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -328($fp) -# IF_ZERO local_main_at_Main_internal_81 GOTO label_COMPARE_BY_VALUE_259 -# IF_ZERO local_main_at_Main_internal_81 GOTO label_COMPARE_BY_VALUE_259 -lw $t0, -328($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_259 -# LOCAL local_main_at_Main_internal_81 --> -328($fp) -# LOCAL local_main_at_Main_internal_83 --> -336($fp) -# LOCAL local_main_at_Main_internal_85 --> -344($fp) -# Load pointers and SUB -lw $a0, -336($fp) -lw $a1, -344($fp) -sub $a0, $a0, $a1 -sw $a0, -328($fp) -# IF_ZERO local_main_at_Main_internal_81 GOTO label_TRUE_256 -# IF_ZERO local_main_at_Main_internal_81 GOTO label_TRUE_256 -lw $t0, -328($fp) -beq $t0, 0, label_TRUE_256 -# GOTO label_FALSE_255 -j label_FALSE_255 -label_COMPARE_BY_VALUE_259: - # LOCAL local_main_at_Main_internal_81 --> -328($fp) - # LOCAL local_main_at_Main_internal_83 --> -336($fp) - # LOCAL local_main_at_Main_internal_85 --> -344($fp) - lw $a0, -336($fp) - lw $a1, -344($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -328($fp) - # IF_ZERO local_main_at_Main_internal_81 GOTO label_TRUE_256 - # IF_ZERO local_main_at_Main_internal_81 GOTO label_TRUE_256 - lw $t0, -328($fp) - beq $t0, 0, label_TRUE_256 - # GOTO label_FALSE_255 - j label_FALSE_255 - label_COMPARE_STRING_258: - # LOCAL local_main_at_Main_internal_81 --> -328($fp) - # LOCAL local_main_at_Main_internal_83 --> -336($fp) - # LOCAL local_main_at_Main_internal_85 --> -344($fp) - # Load strings for comparison - lw $v0, -336($fp) - lw $v1, -344($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -328($fp) - # IF_ZERO local_main_at_Main_internal_81 GOTO label_CONTINUE_260 - # IF_ZERO local_main_at_Main_internal_81 GOTO label_CONTINUE_260 - lw $t0, -328($fp) - beq $t0, 0, label_CONTINUE_260 - # GOTO label_FALSE_255 - j label_FALSE_255 - label_CONTINUE_260: - # LOCAL local_main_at_Main_internal_81 --> -328($fp) - # LOCAL local_main_at_Main_internal_83 --> -336($fp) - # LOCAL local_main_at_Main_internal_85 --> -344($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -336($fp) - lw $v1, -344($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_261: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_262 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_261 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_262: - # Store result - sw $a2, -328($fp) - # IF_ZERO local_main_at_Main_internal_81 GOTO label_TRUE_256 - # IF_ZERO local_main_at_Main_internal_81 GOTO label_TRUE_256 - lw $t0, -328($fp) - beq $t0, 0, label_TRUE_256 - label_FALSE_255: - # LOCAL local_main_at_Main_internal_80 --> -324($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -324($fp) - # GOTO label_END_257 -j label_END_257 -label_TRUE_256: - # LOCAL local_main_at_Main_internal_80 --> -324($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -324($fp) - label_END_257: -# LOCAL local_main_at_Main_internal_78 --> -316($fp) -# LOCAL local_main_at_Main_internal_80 --> -324($fp) -# Obtain value from -324($fp) -lw $v0, -324($fp) -lw $v0, 12($v0) -sw $v0, -316($fp) -# IF_ZERO local_main_at_Main_internal_78 GOTO label_FALSEIF_253 -# IF_ZERO local_main_at_Main_internal_78 GOTO label_FALSEIF_253 -lw $t0, -316($fp) -beq $t0, 0, label_FALSEIF_253 -# LOCAL local_main_at_Main_internal_88 --> -356($fp) -# local_main_at_Main_internal_88 = SELF -sw $s1, -356($fp) -# LOCAL local_main_at_Main_internal_86 --> -348($fp) -# LOCAL local_main_at_Main_internal_88 --> -356($fp) -# local_main_at_Main_internal_86 = local_main_at_Main_internal_88 -lw $t0, -356($fp) -sw $t0, -348($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_89 --> -360($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_39 -sw $t0, 12($v0) -li $t0, 6 -sw $t0, 16($v0) -sw $v0, -360($fp) -# ARG local_main_at_Main_internal_89 -# LOCAL local_main_at_Main_internal_89 --> -360($fp) -lw $t0, -360($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_86 --> -348($fp) -# LOCAL local_main_at_Main_internal_87 --> -352($fp) -# local_main_at_Main_internal_87 = VCALL local_main_at_Main_internal_86 out_string -# Save new self pointer in $s1 -lw $s1, -348($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 92($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -352($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_79 --> -320($fp) -# LOCAL local_main_at_Main_internal_87 --> -352($fp) -# local_main_at_Main_internal_79 = local_main_at_Main_internal_87 -lw $t0, -352($fp) -sw $t0, -320($fp) -# GOTO label_ENDIF_254 -j label_ENDIF_254 -label_FALSEIF_253: - # LOCAL local_main_at_Main_internal_92 --> -372($fp) - # local_main_at_Main_internal_92 = SELF - sw $s1, -372($fp) - # LOCAL local_main_at_Main_internal_90 --> -364($fp) - # LOCAL local_main_at_Main_internal_92 --> -372($fp) - # local_main_at_Main_internal_90 = local_main_at_Main_internal_92 - lw $t0, -372($fp) - sw $t0, -364($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_93 --> -376($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_40 - sw $t0, 12($v0) - li $t0, 6 - sw $t0, 16($v0) - sw $v0, -376($fp) - # ARG local_main_at_Main_internal_93 - # LOCAL local_main_at_Main_internal_93 --> -376($fp) - lw $t0, -376($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_90 --> -364($fp) - # LOCAL local_main_at_Main_internal_91 --> -368($fp) - # local_main_at_Main_internal_91 = VCALL local_main_at_Main_internal_90 out_string - # Save new self pointer in $s1 - lw $s1, -364($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -368($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_79 --> -320($fp) - # LOCAL local_main_at_Main_internal_91 --> -368($fp) - # local_main_at_Main_internal_79 = local_main_at_Main_internal_91 - lw $t0, -368($fp) - sw $t0, -320($fp) - label_ENDIF_254: -# LOCAL local_main_at_Main_internal_100 --> -404($fp) -# local_main_at_Main_internal_100 = SELF -sw $s1, -404($fp) -# LOCAL local_main_at_Main_internal_98 --> -396($fp) -# LOCAL local_main_at_Main_internal_100 --> -404($fp) -# local_main_at_Main_internal_98 = local_main_at_Main_internal_100 -lw $t0, -404($fp) -sw $t0, -396($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_98 --> -396($fp) -# LOCAL local_main_at_Main_internal_99 --> -400($fp) -# local_main_at_Main_internal_99 = VCALL local_main_at_Main_internal_98 in_string -# Save new self pointer in $s1 -lw $s1, -396($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 100($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -400($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_101 --> -408($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_41 -sw $t0, 12($v0) -li $t0, 0 -sw $t0, 16($v0) -sw $v0, -408($fp) -# IF_ZERO local_main_at_Main_internal_99 GOTO label_FALSE_265 -# IF_ZERO local_main_at_Main_internal_99 GOTO label_FALSE_265 -lw $t0, -400($fp) -beq $t0, 0, label_FALSE_265 -# IF_ZERO local_main_at_Main_internal_101 GOTO label_FALSE_265 -# IF_ZERO local_main_at_Main_internal_101 GOTO label_FALSE_265 -lw $t0, -408($fp) -beq $t0, 0, label_FALSE_265 -# LOCAL local_main_at_Main_internal_97 --> -392($fp) -# LOCAL local_main_at_Main_internal_99 --> -400($fp) -# Comparing -400($fp) type with String -la $v0, String -lw $a0, -400($fp) -lw $a0, 0($a0) -sub $a0, $a0, $v0 -sw $a0, -392($fp) -# IF_ZERO local_main_at_Main_internal_97 GOTO label_COMPARE_STRING_268 -# IF_ZERO local_main_at_Main_internal_97 GOTO label_COMPARE_STRING_268 -lw $t0, -392($fp) -beq $t0, 0, label_COMPARE_STRING_268 -# LOCAL local_main_at_Main_internal_97 --> -392($fp) -# LOCAL local_main_at_Main_internal_99 --> -400($fp) -# Comparing -400($fp) type with Bool -la $v0, Bool -lw $a0, -400($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -392($fp) -# IF_ZERO local_main_at_Main_internal_97 GOTO label_COMPARE_BY_VALUE_269 -# IF_ZERO local_main_at_Main_internal_97 GOTO label_COMPARE_BY_VALUE_269 -lw $t0, -392($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_269 -# LOCAL local_main_at_Main_internal_97 --> -392($fp) -# LOCAL local_main_at_Main_internal_99 --> -400($fp) -# Comparing -400($fp) type with Int -la $v0, Int -lw $a0, -400($fp) -lw $a0, 0($a0) -lw $a0, 12($a0) -sub $a0, $a0, $v0 -sw $a0, -392($fp) -# IF_ZERO local_main_at_Main_internal_97 GOTO label_COMPARE_BY_VALUE_269 -# IF_ZERO local_main_at_Main_internal_97 GOTO label_COMPARE_BY_VALUE_269 -lw $t0, -392($fp) -beq $t0, 0, label_COMPARE_BY_VALUE_269 -# LOCAL local_main_at_Main_internal_97 --> -392($fp) -# LOCAL local_main_at_Main_internal_99 --> -400($fp) -# LOCAL local_main_at_Main_internal_101 --> -408($fp) -# Load pointers and SUB -lw $a0, -400($fp) -lw $a1, -408($fp) -sub $a0, $a0, $a1 -sw $a0, -392($fp) -# IF_ZERO local_main_at_Main_internal_97 GOTO label_TRUE_266 -# IF_ZERO local_main_at_Main_internal_97 GOTO label_TRUE_266 -lw $t0, -392($fp) -beq $t0, 0, label_TRUE_266 -# GOTO label_FALSE_265 -j label_FALSE_265 -label_COMPARE_BY_VALUE_269: - # LOCAL local_main_at_Main_internal_97 --> -392($fp) - # LOCAL local_main_at_Main_internal_99 --> -400($fp) - # LOCAL local_main_at_Main_internal_101 --> -408($fp) - lw $a0, -400($fp) - lw $a1, -408($fp) - # Load values - lw $a0, 12($a0) - lw $a1, 12($a1) - # SUB and store - sub $a0, $a0, $a1 - sw $a0, -392($fp) - # IF_ZERO local_main_at_Main_internal_97 GOTO label_TRUE_266 - # IF_ZERO local_main_at_Main_internal_97 GOTO label_TRUE_266 - lw $t0, -392($fp) - beq $t0, 0, label_TRUE_266 - # GOTO label_FALSE_265 - j label_FALSE_265 - label_COMPARE_STRING_268: - # LOCAL local_main_at_Main_internal_97 --> -392($fp) - # LOCAL local_main_at_Main_internal_99 --> -400($fp) - # LOCAL local_main_at_Main_internal_101 --> -408($fp) - # Load strings for comparison - lw $v0, -400($fp) - lw $v1, -408($fp) - # Compare lengths - lw $v0, 16($v0) - lw $v1, 16($v1) - sub $v0, $v0, $v1 - sw $v0, -392($fp) - # IF_ZERO local_main_at_Main_internal_97 GOTO label_CONTINUE_270 - # IF_ZERO local_main_at_Main_internal_97 GOTO label_CONTINUE_270 - lw $t0, -392($fp) - beq $t0, 0, label_CONTINUE_270 - # GOTO label_FALSE_265 - j label_FALSE_265 - label_CONTINUE_270: - # LOCAL local_main_at_Main_internal_97 --> -392($fp) - # LOCAL local_main_at_Main_internal_99 --> -400($fp) - # LOCAL local_main_at_Main_internal_101 --> -408($fp) - move $a2, $zero - # Load strings for comparison - lw $v0, -400($fp) - lw $v1, -408($fp) - # Load strings pointers - lw $v0, 12($v0) - lw $v1, 12($v1) - # Compare loop, while [v0] != \0 - label_WHILE_STR_COMP_271: - lb $a0, 0($v0) - # If EOS => break - beqz $a0, label_WHILE_STR_COMP_END_272 - lb $a1, 0($v1) - # Move strings pointers - addu $v0, $v0, 1 - addu $v1, $v1, 1 - # Compare chars - sub $a0, $a0, $a1 - beqz $a0, label_WHILE_STR_COMP_271 - # False - li $a2, 1 - label_WHILE_STR_COMP_END_272: - # Store result - sw $a2, -392($fp) - # IF_ZERO local_main_at_Main_internal_97 GOTO label_TRUE_266 - # IF_ZERO local_main_at_Main_internal_97 GOTO label_TRUE_266 - lw $t0, -392($fp) - beq $t0, 0, label_TRUE_266 - label_FALSE_265: - # LOCAL local_main_at_Main_internal_96 --> -388($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -388($fp) - # GOTO label_END_267 -j label_END_267 -label_TRUE_266: - # LOCAL local_main_at_Main_internal_96 --> -388($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -388($fp) - label_END_267: -# LOCAL local_main_at_Main_internal_94 --> -380($fp) -# LOCAL local_main_at_Main_internal_96 --> -388($fp) -# Obtain value from -388($fp) -lw $v0, -388($fp) -lw $v0, 12($v0) -sw $v0, -380($fp) -# IF_ZERO local_main_at_Main_internal_94 GOTO label_FALSEIF_263 -# IF_ZERO local_main_at_Main_internal_94 GOTO label_FALSEIF_263 -lw $t0, -380($fp) -beq $t0, 0, label_FALSEIF_263 -# LOCAL local_main_at_Main_internal_104 --> -420($fp) -# local_main_at_Main_internal_104 = SELF -sw $s1, -420($fp) -# LOCAL local_main_at_Main_internal_102 --> -412($fp) -# LOCAL local_main_at_Main_internal_104 --> -420($fp) -# local_main_at_Main_internal_102 = local_main_at_Main_internal_104 -lw $t0, -420($fp) -sw $t0, -412($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_main_at_Main_internal_105 --> -424($fp) -# Allocating 20 bytes of memory -li $a0, 20 -li $v0, 9 -syscall -# Allocating string -la $t0, String -sw $t0, 0($v0) -la $t0, String_start -sw $t0, 4($v0) -# Load type offset -li $t0, 8 -sw $t0, 8($v0) -la $t0, data_42 -sw $t0, 12($v0) -li $t0, 6 -sw $t0, 16($v0) -sw $v0, -424($fp) -# ARG local_main_at_Main_internal_105 -# LOCAL local_main_at_Main_internal_105 --> -424($fp) -lw $t0, -424($fp) -# Push arg into stack -subu $sp, $sp, 4 -sw $t0, 0($sp) -# LOCAL local_main_at_Main_internal_102 --> -412($fp) -# LOCAL local_main_at_Main_internal_103 --> -416($fp) -# local_main_at_Main_internal_103 = VCALL local_main_at_Main_internal_102 out_string -# Save new self pointer in $s1 -lw $s1, -412($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 92($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -416($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_main_at_Main_internal_95 --> -384($fp) -# LOCAL local_main_at_Main_internal_103 --> -416($fp) -# local_main_at_Main_internal_95 = local_main_at_Main_internal_103 -lw $t0, -416($fp) -sw $t0, -384($fp) -# GOTO label_ENDIF_264 -j label_ENDIF_264 -label_FALSEIF_263: - # LOCAL local_main_at_Main_internal_108 --> -436($fp) - # local_main_at_Main_internal_108 = SELF - sw $s1, -436($fp) - # LOCAL local_main_at_Main_internal_106 --> -428($fp) - # LOCAL local_main_at_Main_internal_108 --> -436($fp) - # local_main_at_Main_internal_106 = local_main_at_Main_internal_108 - lw $t0, -436($fp) - sw $t0, -428($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_main_at_Main_internal_109 --> -440($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_43 - sw $t0, 12($v0) - li $t0, 6 - sw $t0, 16($v0) - sw $v0, -440($fp) - # ARG local_main_at_Main_internal_109 - # LOCAL local_main_at_Main_internal_109 --> -440($fp) - lw $t0, -440($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_main_at_Main_internal_106 --> -428($fp) - # LOCAL local_main_at_Main_internal_107 --> -432($fp) - # local_main_at_Main_internal_107 = VCALL local_main_at_Main_internal_106 out_string - # Save new self pointer in $s1 - lw $s1, -428($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -432($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_main_at_Main_internal_95 --> -384($fp) - # LOCAL local_main_at_Main_internal_107 --> -432($fp) - # local_main_at_Main_internal_95 = local_main_at_Main_internal_107 - lw $t0, -432($fp) - sw $t0, -384($fp) - label_ENDIF_264: -# RETURN local_main_at_Main_internal_95 -lw $v0, -384($fp) -# Deallocate stack frame for function function_main_at_Main. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 448 -jr $ra -# Function END - - -# __VList__attrib__car__init implementation. -# @Params: -__VList__attrib__car__init: - # Allocate stack frame for function __VList__attrib__car__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __VList__attrib__car__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_VList implementation. -# @Params: -function_isNil_at_VList: - # Allocate stack frame for function function_isNil_at_VList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_VList_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_isNil_at_VList_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_isNil_at_VList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_head_at_VList implementation. -# @Params: -function_head_at_VList: - # Allocate stack frame for function function_head_at_VList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_head_at_VList_internal_2 --> -12($fp) - # local_head_at_VList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_head_at_VList_internal_0 --> -4($fp) - # LOCAL local_head_at_VList_internal_2 --> -12($fp) - # local_head_at_VList_internal_0 = local_head_at_VList_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_head_at_VList_internal_0 --> -4($fp) - # LOCAL local_head_at_VList_internal_1 --> -8($fp) - # local_head_at_VList_internal_1 = VCALL local_head_at_VList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_head_at_VList_internal_3 = GETATTRIBUTE car VList - # LOCAL local_head_at_VList_internal_3 --> -16($fp) - lw $t0, 12($s1) - sw $t0, -16($fp) - # RETURN local_head_at_VList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_head_at_VList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_tail_at_VList implementation. -# @Params: -function_tail_at_VList: - # Allocate stack frame for function function_tail_at_VList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_tail_at_VList_internal_2 --> -12($fp) - # local_tail_at_VList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_tail_at_VList_internal_0 --> -4($fp) - # LOCAL local_tail_at_VList_internal_2 --> -12($fp) - # local_tail_at_VList_internal_0 = local_tail_at_VList_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_tail_at_VList_internal_0 --> -4($fp) - # LOCAL local_tail_at_VList_internal_1 --> -8($fp) - # local_tail_at_VList_internal_1 = VCALL local_tail_at_VList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_tail_at_VList_internal_3 --> -16($fp) - # local_tail_at_VList_internal_3 = SELF - sw $s1, -16($fp) - # RETURN local_tail_at_VList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_tail_at_VList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cons_at_VList implementation. -# @Params: -# 0($fp) = param_cons_at_VList_v_0 -function_cons_at_VList: - # Allocate stack frame for function function_cons_at_VList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_cons_at_VList_internal_2 --> -12($fp) - # local_cons_at_VList_internal_2 = ALLOCATE VCons - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, VCons - sw $t0, 12($v0) - li $t0, 5 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, VCons_start - sw $t0, 4($v0) - # Load type offset - li $t0, 40 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __VList__attrib__car__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __VCons__attrib__cdr__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -12($fp) - # LOCAL local_cons_at_VList_internal_0 --> -4($fp) - # LOCAL local_cons_at_VList_internal_2 --> -12($fp) - # local_cons_at_VList_internal_0 = local_cons_at_VList_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cons_at_VList_v_0 - # PARAM param_cons_at_VList_v_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cons_at_VList_internal_3 --> -16($fp) - # local_cons_at_VList_internal_3 = SELF - sw $s1, -16($fp) - # ARG local_cons_at_VList_internal_3 - # LOCAL local_cons_at_VList_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cons_at_VList_internal_0 --> -4($fp) - # LOCAL local_cons_at_VList_internal_1 --> -8($fp) - # local_cons_at_VList_internal_1 = VCALL local_cons_at_VList_internal_0 init - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 8($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_cons_at_VList_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_cons_at_VList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_print_at_VList implementation. -# @Params: -function_print_at_VList: - # Allocate stack frame for function function_print_at_VList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_print_at_VList_internal_2 --> -12($fp) - # local_print_at_VList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_print_at_VList_internal_0 --> -4($fp) - # LOCAL local_print_at_VList_internal_2 --> -12($fp) - # local_print_at_VList_internal_0 = local_print_at_VList_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_VList_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_44 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -16($fp) - # ARG local_print_at_VList_internal_3 - # LOCAL local_print_at_VList_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_VList_internal_0 --> -4($fp) - # LOCAL local_print_at_VList_internal_1 --> -8($fp) - # local_print_at_VList_internal_1 = VCALL local_print_at_VList_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_at_VList_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_print_at_VList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __VCons__attrib__cdr__init implementation. -# @Params: -__VCons__attrib__cdr__init: - # Allocate stack frame for function __VCons__attrib__cdr__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __VCons__attrib__cdr__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_VCons implementation. -# @Params: -function_isNil_at_VCons: - # Allocate stack frame for function function_isNil_at_VCons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_VCons_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_isNil_at_VCons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_isNil_at_VCons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_head_at_VCons implementation. -# @Params: -function_head_at_VCons: - # Allocate stack frame for function function_head_at_VCons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_head_at_VCons_internal_0 = GETATTRIBUTE car VCons - # LOCAL local_head_at_VCons_internal_0 --> -4($fp) - lw $t0, 12($s1) - sw $t0, -4($fp) - # RETURN local_head_at_VCons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_head_at_VCons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_tail_at_VCons implementation. -# @Params: -function_tail_at_VCons: - # Allocate stack frame for function function_tail_at_VCons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_tail_at_VCons_internal_0 = GETATTRIBUTE cdr VCons - # LOCAL local_tail_at_VCons_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_tail_at_VCons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_tail_at_VCons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_VCons implementation. -# @Params: -# 0($fp) = param_init_at_VCons_v_0 -# 4($fp) = param_init_at_VCons_rest_1 -function_init_at_VCons: - # Allocate stack frame for function function_init_at_VCons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_VCons_v_0 --> 4($fp) - lw $t0, 4($fp) - sw $t0, 12($s1) - # - # PARAM param_init_at_VCons_rest_1 --> 0($fp) - lw $t0, 0($fp) - sw $t0, 16($s1) - # LOCAL local_init_at_VCons_internal_0 --> -4($fp) - # local_init_at_VCons_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_init_at_VCons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_init_at_VCons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_print_at_VCons implementation. -# @Params: -function_print_at_VCons: - # Allocate stack frame for function function_print_at_VCons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_print_at_VCons_internal_2 = GETATTRIBUTE car VCons - # LOCAL local_print_at_VCons_internal_2 --> -12($fp) - lw $t0, 12($s1) - sw $t0, -12($fp) - # LOCAL local_print_at_VCons_internal_0 --> -4($fp) - # LOCAL local_print_at_VCons_internal_2 --> -12($fp) - # local_print_at_VCons_internal_0 = local_print_at_VCons_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_VCons_internal_0 --> -4($fp) - # LOCAL local_print_at_VCons_internal_1 --> -8($fp) - # local_print_at_VCons_internal_1 = VCALL local_print_at_VCons_internal_0 print - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_print_at_VCons_internal_5 = GETATTRIBUTE cdr VCons - # LOCAL local_print_at_VCons_internal_5 --> -24($fp) - lw $t0, 16($s1) - sw $t0, -24($fp) - # LOCAL local_print_at_VCons_internal_3 --> -16($fp) - # LOCAL local_print_at_VCons_internal_5 --> -24($fp) - # local_print_at_VCons_internal_3 = local_print_at_VCons_internal_5 - lw $t0, -24($fp) - sw $t0, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_VCons_internal_3 --> -16($fp) - # LOCAL local_print_at_VCons_internal_4 --> -20($fp) - # local_print_at_VCons_internal_4 = VCALL local_print_at_VCons_internal_3 print - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_at_VCons_internal_4 - lw $v0, -20($fp) - # Deallocate stack frame for function function_print_at_VCons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __EList__attrib__car__init implementation. -# @Params: -__EList__attrib__car__init: - # Allocate stack frame for function __EList__attrib__car__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __EList__attrib__car__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_EList implementation. -# @Params: -function_isNil_at_EList: - # Allocate stack frame for function function_isNil_at_EList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_EList_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 1 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_isNil_at_EList_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_isNil_at_EList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_head_at_EList implementation. -# @Params: -function_head_at_EList: - # Allocate stack frame for function function_head_at_EList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_head_at_EList_internal_2 --> -12($fp) - # local_head_at_EList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_head_at_EList_internal_0 --> -4($fp) - # LOCAL local_head_at_EList_internal_2 --> -12($fp) - # local_head_at_EList_internal_0 = local_head_at_EList_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_head_at_EList_internal_0 --> -4($fp) - # LOCAL local_head_at_EList_internal_1 --> -8($fp) - # local_head_at_EList_internal_1 = VCALL local_head_at_EList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_head_at_EList_internal_3 = GETATTRIBUTE car EList - # LOCAL local_head_at_EList_internal_3 --> -16($fp) - lw $t0, 12($s1) - sw $t0, -16($fp) - # RETURN local_head_at_EList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_head_at_EList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_tail_at_EList implementation. -# @Params: -function_tail_at_EList: - # Allocate stack frame for function function_tail_at_EList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_tail_at_EList_internal_2 --> -12($fp) - # local_tail_at_EList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_tail_at_EList_internal_0 --> -4($fp) - # LOCAL local_tail_at_EList_internal_2 --> -12($fp) - # local_tail_at_EList_internal_0 = local_tail_at_EList_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_tail_at_EList_internal_0 --> -4($fp) - # LOCAL local_tail_at_EList_internal_1 --> -8($fp) - # local_tail_at_EList_internal_1 = VCALL local_tail_at_EList_internal_0 abort - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 4($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_tail_at_EList_internal_3 --> -16($fp) - # local_tail_at_EList_internal_3 = SELF - sw $s1, -16($fp) - # RETURN local_tail_at_EList_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_tail_at_EList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_cons_at_EList implementation. -# @Params: -# 0($fp) = param_cons_at_EList_e_0 -function_cons_at_EList: - # Allocate stack frame for function function_cons_at_EList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_cons_at_EList_internal_2 --> -12($fp) - # local_cons_at_EList_internal_2 = ALLOCATE ECons - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, ECons - sw $t0, 12($v0) - li $t0, 5 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, ECons_start - sw $t0, 4($v0) - # Load type offset - li $t0, 48 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __EList__attrib__car__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __ECons__attrib__cdr__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 16($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -12($fp) - # LOCAL local_cons_at_EList_internal_0 --> -4($fp) - # LOCAL local_cons_at_EList_internal_2 --> -12($fp) - # local_cons_at_EList_internal_0 = local_cons_at_EList_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_cons_at_EList_e_0 - # PARAM param_cons_at_EList_e_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cons_at_EList_internal_3 --> -16($fp) - # local_cons_at_EList_internal_3 = SELF - sw $s1, -16($fp) - # ARG local_cons_at_EList_internal_3 - # LOCAL local_cons_at_EList_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_cons_at_EList_internal_0 --> -4($fp) - # LOCAL local_cons_at_EList_internal_1 --> -8($fp) - # local_cons_at_EList_internal_1 = VCALL local_cons_at_EList_internal_0 init - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 8($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_cons_at_EList_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_cons_at_EList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_append_at_EList implementation. -# @Params: -# 0($fp) = param_append_at_EList_l_0 -function_append_at_EList: -# Allocate stack frame for function function_append_at_EList. -subu $sp, $sp, 68 -sw $ra, 4($sp) -sw $fp, 0($sp) -addu $fp, $sp, 68 -# LOCAL local_append_at_EList_internal_4 --> -20($fp) -# local_append_at_EList_internal_4 = SELF -sw $s1, -20($fp) -# LOCAL local_append_at_EList_internal_2 --> -12($fp) -# LOCAL local_append_at_EList_internal_4 --> -20($fp) -# local_append_at_EList_internal_2 = local_append_at_EList_internal_4 -lw $t0, -20($fp) -sw $t0, -12($fp) -# Push register s1 into stack -subu $sp, $sp, 4 -sw $s1, 0($sp) -# LOCAL local_append_at_EList_internal_2 --> -12($fp) -# LOCAL local_append_at_EList_internal_3 --> -16($fp) -# local_append_at_EList_internal_3 = VCALL local_append_at_EList_internal_2 isNil -# Save new self pointer in $s1 -lw $s1, -12($fp) -# Get pointer to type -lw $t0, 4($s1) -# Get pointer to type's VTABLE -lw $t0, 0($t0) -# Get pointer to function address -lw $t0, 104($t0) -# Call function. Result is on $v0 -jalr $t0 -sw $v0, -16($fp) -# Pop 4 bytes from stack into register s1 -lw $s1, 0($sp) -addu $sp, $sp, 4 -# LOCAL local_append_at_EList_internal_0 --> -4($fp) -# LOCAL local_append_at_EList_internal_3 --> -16($fp) -# Obtain value from -16($fp) -lw $v0, -16($fp) -lw $v0, 12($v0) -sw $v0, -4($fp) -# IF_ZERO local_append_at_EList_internal_0 GOTO label_FALSEIF_273 -# IF_ZERO local_append_at_EList_internal_0 GOTO label_FALSEIF_273 -lw $t0, -4($fp) -beq $t0, 0, label_FALSEIF_273 -# LOCAL local_append_at_EList_internal_1 --> -8($fp) -# PARAM param_append_at_EList_l_0 --> 0($fp) -# local_append_at_EList_internal_1 = PARAM param_append_at_EList_l_0 -lw $t0, 0($fp) -sw $t0, -8($fp) -# GOTO label_ENDIF_274 -j label_ENDIF_274 -label_FALSEIF_273: - # LOCAL local_append_at_EList_internal_11 --> -48($fp) - # local_append_at_EList_internal_11 = SELF - sw $s1, -48($fp) - # LOCAL local_append_at_EList_internal_9 --> -40($fp) - # LOCAL local_append_at_EList_internal_11 --> -48($fp) - # local_append_at_EList_internal_9 = local_append_at_EList_internal_11 - lw $t0, -48($fp) - sw $t0, -40($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_append_at_EList_internal_9 --> -40($fp) - # LOCAL local_append_at_EList_internal_10 --> -44($fp) - # local_append_at_EList_internal_10 = VCALL local_append_at_EList_internal_9 tail - # Save new self pointer in $s1 - lw $s1, -40($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 112($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -44($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_append_at_EList_internal_7 --> -32($fp) - # LOCAL local_append_at_EList_internal_10 --> -44($fp) - # local_append_at_EList_internal_7 = local_append_at_EList_internal_10 - lw $t0, -44($fp) - sw $t0, -32($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_append_at_EList_l_0 - # PARAM param_append_at_EList_l_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_append_at_EList_internal_7 --> -32($fp) - # LOCAL local_append_at_EList_internal_8 --> -36($fp) - # local_append_at_EList_internal_8 = VCALL local_append_at_EList_internal_7 append - # Save new self pointer in $s1 - lw $s1, -32($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 24($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -36($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_append_at_EList_internal_5 --> -24($fp) - # LOCAL local_append_at_EList_internal_8 --> -36($fp) - # local_append_at_EList_internal_5 = local_append_at_EList_internal_8 - lw $t0, -36($fp) - sw $t0, -24($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_append_at_EList_internal_14 --> -60($fp) - # local_append_at_EList_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_append_at_EList_internal_12 --> -52($fp) - # LOCAL local_append_at_EList_internal_14 --> -60($fp) - # local_append_at_EList_internal_12 = local_append_at_EList_internal_14 - lw $t0, -60($fp) - sw $t0, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_append_at_EList_internal_12 --> -52($fp) - # LOCAL local_append_at_EList_internal_13 --> -56($fp) - # local_append_at_EList_internal_13 = VCALL local_append_at_EList_internal_12 head - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 64($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # ARG local_append_at_EList_internal_13 - # LOCAL local_append_at_EList_internal_13 --> -56($fp) - lw $t0, -56($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_append_at_EList_internal_5 --> -24($fp) - # LOCAL local_append_at_EList_internal_6 --> -28($fp) - # local_append_at_EList_internal_6 = VCALL local_append_at_EList_internal_5 cons - # Save new self pointer in $s1 - lw $s1, -24($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 108($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -28($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_append_at_EList_internal_1 --> -8($fp) - # LOCAL local_append_at_EList_internal_6 --> -28($fp) - # local_append_at_EList_internal_1 = local_append_at_EList_internal_6 - lw $t0, -28($fp) - sw $t0, -8($fp) - label_ENDIF_274: -# RETURN local_append_at_EList_internal_1 -lw $v0, -8($fp) -# Deallocate stack frame for function function_append_at_EList. -# Restore $ra -lw $ra, 4($sp) -# Restore $fp -lw $fp, 0($sp) -# Restore Stack pointer $sp -addu $sp, $sp, 68 -# Deallocate function args -addu $sp, $sp, 4 -jr $ra -# Function END - - -# function_print_at_EList implementation. -# @Params: -function_print_at_EList: - # Allocate stack frame for function function_print_at_EList. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_print_at_EList_internal_2 --> -12($fp) - # local_print_at_EList_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_print_at_EList_internal_0 --> -4($fp) - # LOCAL local_print_at_EList_internal_2 --> -12($fp) - # local_print_at_EList_internal_0 = local_print_at_EList_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_EList_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_45 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -16($fp) - # ARG local_print_at_EList_internal_3 - # LOCAL local_print_at_EList_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_EList_internal_0 --> -4($fp) - # LOCAL local_print_at_EList_internal_1 --> -8($fp) - # local_print_at_EList_internal_1 = VCALL local_print_at_EList_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_at_EList_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function function_print_at_EList. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __ECons__attrib__cdr__init implementation. -# @Params: -__ECons__attrib__cdr__init: - # Allocate stack frame for function __ECons__attrib__cdr__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # RETURN 0 - li $v0, 0 - # Deallocate stack frame for function __ECons__attrib__cdr__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_isNil_at_ECons implementation. -# @Params: -function_isNil_at_ECons: - # Allocate stack frame for function function_isNil_at_ECons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_isNil_at_ECons_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Bool - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Bool - sw $t0, 12($v0) - li $t0, 4 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Bool_start - sw $t0, 4($v0) - # Load type offset - li $t0, 12 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_isNil_at_ECons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_isNil_at_ECons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_head_at_ECons implementation. -# @Params: -function_head_at_ECons: - # Allocate stack frame for function function_head_at_ECons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_head_at_ECons_internal_0 = GETATTRIBUTE car ECons - # LOCAL local_head_at_ECons_internal_0 --> -4($fp) - lw $t0, 12($s1) - sw $t0, -4($fp) - # RETURN local_head_at_ECons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_head_at_ECons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_tail_at_ECons implementation. -# @Params: -function_tail_at_ECons: - # Allocate stack frame for function function_tail_at_ECons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_tail_at_ECons_internal_0 = GETATTRIBUTE cdr ECons - # LOCAL local_tail_at_ECons_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_tail_at_ECons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_tail_at_ECons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_ECons implementation. -# @Params: -# 0($fp) = param_init_at_ECons_e_0 -# 4($fp) = param_init_at_ECons_rest_1 -function_init_at_ECons: - # Allocate stack frame for function function_init_at_ECons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_ECons_e_0 --> 4($fp) - lw $t0, 4($fp) - sw $t0, 12($s1) - # - # PARAM param_init_at_ECons_rest_1 --> 0($fp) - lw $t0, 0($fp) - sw $t0, 16($s1) - # LOCAL local_init_at_ECons_internal_0 --> -4($fp) - # local_init_at_ECons_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_init_at_ECons_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_init_at_ECons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 8 - jr $ra - # Function END - - -# function_print_at_ECons implementation. -# @Params: -function_print_at_ECons: - # Allocate stack frame for function function_print_at_ECons. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_print_at_ECons_internal_2 = GETATTRIBUTE car ECons - # LOCAL local_print_at_ECons_internal_2 --> -12($fp) - lw $t0, 12($s1) - sw $t0, -12($fp) - # LOCAL local_print_at_ECons_internal_0 --> -4($fp) - # LOCAL local_print_at_ECons_internal_2 --> -12($fp) - # local_print_at_ECons_internal_0 = local_print_at_ECons_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_ECons_internal_0 --> -4($fp) - # LOCAL local_print_at_ECons_internal_1 --> -8($fp) - # local_print_at_ECons_internal_1 = VCALL local_print_at_ECons_internal_0 print - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_print_at_ECons_internal_5 = GETATTRIBUTE cdr ECons - # LOCAL local_print_at_ECons_internal_5 --> -24($fp) - lw $t0, 16($s1) - sw $t0, -24($fp) - # LOCAL local_print_at_ECons_internal_3 --> -16($fp) - # LOCAL local_print_at_ECons_internal_5 --> -24($fp) - # local_print_at_ECons_internal_3 = local_print_at_ECons_internal_5 - lw $t0, -24($fp) - sw $t0, -16($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_ECons_internal_3 --> -16($fp) - # LOCAL local_print_at_ECons_internal_4 --> -20($fp) - # local_print_at_ECons_internal_4 = VCALL local_print_at_ECons_internal_3 print - # Save new self pointer in $s1 - lw $s1, -16($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -20($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_at_ECons_internal_4 - lw $v0, -20($fp) - # Deallocate stack frame for function function_print_at_ECons. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Edge__attrib__from__init implementation. -# @Params: -__Edge__attrib__from__init: - # Allocate stack frame for function __Edge__attrib__from__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__from__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__from__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Edge__attrib__from__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Edge__attrib__to__init implementation. -# @Params: -__Edge__attrib__to__init: - # Allocate stack frame for function __Edge__attrib__to__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__to__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__to__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Edge__attrib__to__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Edge__attrib__weight__init implementation. -# @Params: -__Edge__attrib__weight__init: - # Allocate stack frame for function __Edge__attrib__weight__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local_ttrib__weight__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local_ttrib__weight__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Edge__attrib__weight__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_Edge implementation. -# @Params: -# 0($fp) = param_init_at_Edge_f_0 -# 4($fp) = param_init_at_Edge_t_1 -# 8($fp) = param_init_at_Edge_w_2 -function_init_at_Edge: - # Allocate stack frame for function function_init_at_Edge. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_Edge_f_0 --> 8($fp) - lw $t0, 8($fp) - sw $t0, 12($s1) - # - # PARAM param_init_at_Edge_t_1 --> 4($fp) - lw $t0, 4($fp) - sw $t0, 16($s1) - # - # PARAM param_init_at_Edge_w_2 --> 0($fp) - lw $t0, 0($fp) - sw $t0, 20($s1) - # LOCAL local_init_at_Edge_internal_0 --> -4($fp) - # local_init_at_Edge_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_init_at_Edge_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_init_at_Edge. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 12 - jr $ra - # Function END - - -# function_print_at_Edge implementation. -# @Params: -function_print_at_Edge: - # Allocate stack frame for function function_print_at_Edge. - subu $sp, $sp, 104 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 104 - # LOCAL local_print_at_Edge_internal_2 --> -12($fp) - # local_print_at_Edge_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_print_at_Edge_internal_0 --> -4($fp) - # LOCAL local_print_at_Edge_internal_2 --> -12($fp) - # local_print_at_Edge_internal_0 = local_print_at_Edge_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Edge_internal_3 --> -16($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_46 - sw $t0, 12($v0) - li $t0, 2 - sw $t0, 16($v0) - sw $v0, -16($fp) - # ARG local_print_at_Edge_internal_3 - # LOCAL local_print_at_Edge_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Edge_internal_0 --> -4($fp) - # LOCAL local_print_at_Edge_internal_1 --> -8($fp) - # local_print_at_Edge_internal_1 = VCALL local_print_at_Edge_internal_0 out_string - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Edge_internal_6 --> -28($fp) - # local_print_at_Edge_internal_6 = SELF - sw $s1, -28($fp) - # LOCAL local_print_at_Edge_internal_4 --> -20($fp) - # LOCAL local_print_at_Edge_internal_6 --> -28($fp) - # local_print_at_Edge_internal_4 = local_print_at_Edge_internal_6 - lw $t0, -28($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Edge_internal_7 = GETATTRIBUTE from Edge - # LOCAL local_print_at_Edge_internal_7 --> -32($fp) - lw $t0, 12($s1) - sw $t0, -32($fp) - # ARG local_print_at_Edge_internal_7 - # LOCAL local_print_at_Edge_internal_7 --> -32($fp) - lw $t0, -32($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Edge_internal_4 --> -20($fp) - # LOCAL local_print_at_Edge_internal_5 --> -24($fp) - # local_print_at_Edge_internal_5 = VCALL local_print_at_Edge_internal_4 out_int - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 48($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Edge_internal_10 --> -44($fp) - # local_print_at_Edge_internal_10 = SELF - sw $s1, -44($fp) - # LOCAL local_print_at_Edge_internal_8 --> -36($fp) - # LOCAL local_print_at_Edge_internal_10 --> -44($fp) - # local_print_at_Edge_internal_8 = local_print_at_Edge_internal_10 - lw $t0, -44($fp) - sw $t0, -36($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Edge_internal_11 --> -48($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_47 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -48($fp) - # ARG local_print_at_Edge_internal_11 - # LOCAL local_print_at_Edge_internal_11 --> -48($fp) - lw $t0, -48($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Edge_internal_8 --> -36($fp) - # LOCAL local_print_at_Edge_internal_9 --> -40($fp) - # local_print_at_Edge_internal_9 = VCALL local_print_at_Edge_internal_8 out_string - # Save new self pointer in $s1 - lw $s1, -36($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -40($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Edge_internal_14 --> -60($fp) - # local_print_at_Edge_internal_14 = SELF - sw $s1, -60($fp) - # LOCAL local_print_at_Edge_internal_12 --> -52($fp) - # LOCAL local_print_at_Edge_internal_14 --> -60($fp) - # local_print_at_Edge_internal_12 = local_print_at_Edge_internal_14 - lw $t0, -60($fp) - sw $t0, -52($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Edge_internal_15 = GETATTRIBUTE to Edge - # LOCAL local_print_at_Edge_internal_15 --> -64($fp) - lw $t0, 16($s1) - sw $t0, -64($fp) - # ARG local_print_at_Edge_internal_15 - # LOCAL local_print_at_Edge_internal_15 --> -64($fp) - lw $t0, -64($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Edge_internal_12 --> -52($fp) - # LOCAL local_print_at_Edge_internal_13 --> -56($fp) - # local_print_at_Edge_internal_13 = VCALL local_print_at_Edge_internal_12 out_int - # Save new self pointer in $s1 - lw $s1, -52($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 48($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -56($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Edge_internal_18 --> -76($fp) - # local_print_at_Edge_internal_18 = SELF - sw $s1, -76($fp) - # LOCAL local_print_at_Edge_internal_16 --> -68($fp) - # LOCAL local_print_at_Edge_internal_18 --> -76($fp) - # local_print_at_Edge_internal_16 = local_print_at_Edge_internal_18 - lw $t0, -76($fp) - sw $t0, -68($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Edge_internal_19 --> -80($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, data_48 - sw $t0, 12($v0) - li $t0, 1 - sw $t0, 16($v0) - sw $v0, -80($fp) - # ARG local_print_at_Edge_internal_19 - # LOCAL local_print_at_Edge_internal_19 --> -80($fp) - lw $t0, -80($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Edge_internal_16 --> -68($fp) - # LOCAL local_print_at_Edge_internal_17 --> -72($fp) - # local_print_at_Edge_internal_17 = VCALL local_print_at_Edge_internal_16 out_string - # Save new self pointer in $s1 - lw $s1, -68($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 92($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -72($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # LOCAL local_print_at_Edge_internal_22 --> -92($fp) - # local_print_at_Edge_internal_22 = SELF - sw $s1, -92($fp) - # LOCAL local_print_at_Edge_internal_20 --> -84($fp) - # LOCAL local_print_at_Edge_internal_22 --> -92($fp) - # local_print_at_Edge_internal_20 = local_print_at_Edge_internal_22 - lw $t0, -92($fp) - sw $t0, -84($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Edge_internal_23 = GETATTRIBUTE weight Edge - # LOCAL local_print_at_Edge_internal_23 --> -96($fp) - lw $t0, 20($s1) - sw $t0, -96($fp) - # ARG local_print_at_Edge_internal_23 - # LOCAL local_print_at_Edge_internal_23 --> -96($fp) - lw $t0, -96($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Edge_internal_20 --> -84($fp) - # LOCAL local_print_at_Edge_internal_21 --> -88($fp) - # local_print_at_Edge_internal_21 = VCALL local_print_at_Edge_internal_20 out_int - # Save new self pointer in $s1 - lw $s1, -84($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 48($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -88($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # RETURN local_print_at_Edge_internal_21 - lw $v0, -88($fp) - # Deallocate stack frame for function function_print_at_Edge. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 104 - jr $ra - # Function END - - -# __Vertice__attrib__num__init implementation. -# @Params: -__Vertice__attrib__num__init: - # Allocate stack frame for function __Vertice__attrib__num__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local___attrib__num__init_internal_0 --> -4($fp) - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type Int - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, Int - sw $t0, 12($v0) - li $t0, 3 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, Int_start - sw $t0, 4($v0) - # Load type offset - li $t0, 16 - sw $t0, 8($v0) - li $t0, 0 - sw $t0, 12($v0) - sw $v0, -4($fp) - # RETURN local___attrib__num__init_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function __Vertice__attrib__num__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# __Vertice__attrib__out__init implementation. -# @Params: -__Vertice__attrib__out__init: - # Allocate stack frame for function __Vertice__attrib__out__init. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # LOCAL local___attrib__out__init_internal_1 --> -8($fp) - # local___attrib__out__init_internal_1 = ALLOCATE EList - # Allocating 20 bytes of memory - li $a0, 20 - li $v0, 9 - syscall - # Allocating string for type name - la $t0, String - sw $t0, 0($v0) - la $t0, String_start - sw $t0, 4($v0) - # Load type offset - li $t0, 8 - sw $t0, 8($v0) - la $t0, EList - sw $t0, 12($v0) - li $t0, 5 - sw $t0, 16($v0) - move $t0, $v0 - # Allocating 16 bytes of memory - li $a0, 16 - li $v0, 9 - syscall - sw $t0, 0($v0) - la $t0, EList_start - sw $t0, 4($v0) - # Load type offset - li $t0, 44 - sw $t0, 8($v0) - move $t1, $v0 - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - move $s1, $v0 - # Push register t1 into stack - subu $sp, $sp, 4 - sw $t1, 0($sp) - jal __EList__attrib__car__init - # Pop 4 bytes from stack into register t1 - lw $t1, 0($sp) - addu $sp, $sp, 4 - sw $v0, 12($t1) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - sw $t1, -8($fp) - # RETURN local___attrib__out__init_internal_1 - lw $v0, -8($fp) - # Deallocate stack frame for function __Vertice__attrib__out__init. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_outgoing_at_Vertice implementation. -# @Params: -function_outgoing_at_Vertice: - # Allocate stack frame for function function_outgoing_at_Vertice. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_outgoing_at_Vertice_internal_0 = GETATTRIBUTE out Vertice - # LOCAL local_outgoing_at_Vertice_internal_0 --> -4($fp) - lw $t0, 16($s1) - sw $t0, -4($fp) - # RETURN local_outgoing_at_Vertice_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_outgoing_at_Vertice. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_number_at_Vertice implementation. -# @Params: -function_number_at_Vertice: - # Allocate stack frame for function function_number_at_Vertice. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_number_at_Vertice_internal_0 = GETATTRIBUTE num Vertice - # LOCAL local_number_at_Vertice_internal_0 --> -4($fp) - lw $t0, 12($s1) - sw $t0, -4($fp) - # RETURN local_number_at_Vertice_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_number_at_Vertice. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - jr $ra - # Function END - - -# function_init_at_Vertice implementation. -# @Params: -# 0($fp) = param_init_at_Vertice_n_0 -function_init_at_Vertice: - # Allocate stack frame for function function_init_at_Vertice. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # - # PARAM param_init_at_Vertice_n_0 --> 0($fp) - lw $t0, 0($fp) - sw $t0, 12($s1) - # LOCAL local_init_at_Vertice_internal_0 --> -4($fp) - # local_init_at_Vertice_internal_0 = SELF - sw $s1, -4($fp) - # RETURN local_init_at_Vertice_internal_0 - lw $v0, -4($fp) - # Deallocate stack frame for function function_init_at_Vertice. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_add_out_at_Vertice implementation. -# @Params: -# 0($fp) = param_add_out_at_Vertice_s_0 -function_add_out_at_Vertice: - # Allocate stack frame for function function_add_out_at_Vertice. - subu $sp, $sp, 32 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 32 - # local_add_out_at_Vertice_internal_2 = GETATTRIBUTE out Vertice - # LOCAL local_add_out_at_Vertice_internal_2 --> -12($fp) - lw $t0, 16($s1) - sw $t0, -12($fp) - # LOCAL local_add_out_at_Vertice_internal_0 --> -4($fp) - # LOCAL local_add_out_at_Vertice_internal_2 --> -12($fp) - # local_add_out_at_Vertice_internal_0 = local_add_out_at_Vertice_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # ARG param_add_out_at_Vertice_s_0 - # PARAM param_add_out_at_Vertice_s_0 --> 0($fp) - lw $t0, 0($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_add_out_at_Vertice_internal_0 --> -4($fp) - # LOCAL local_add_out_at_Vertice_internal_1 --> -8($fp) - # local_add_out_at_Vertice_internal_1 = VCALL local_add_out_at_Vertice_internal_0 cons - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 108($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # - # LOCAL local_add_out_at_Vertice_internal_1 --> -8($fp) - lw $t0, -8($fp) - sw $t0, 16($s1) - # LOCAL local_add_out_at_Vertice_internal_3 --> -16($fp) - # local_add_out_at_Vertice_internal_3 = SELF - sw $s1, -16($fp) - # RETURN local_add_out_at_Vertice_internal_3 - lw $v0, -16($fp) - # Deallocate stack frame for function function_add_out_at_Vertice. - # Restore $ra - lw $ra, 4($sp) - # Restore $fp - lw $fp, 0($sp) - # Restore Stack pointer $sp - addu $sp, $sp, 32 - # Deallocate function args - addu $sp, $sp, 4 - jr $ra - # Function END - - -# function_print_at_Vertice implementation. -# @Params: -function_print_at_Vertice: - # Allocate stack frame for function function_print_at_Vertice. - subu $sp, $sp, 36 - sw $ra, 4($sp) - sw $fp, 0($sp) - addu $fp, $sp, 36 - # LOCAL local_print_at_Vertice_internal_2 --> -12($fp) - # local_print_at_Vertice_internal_2 = SELF - sw $s1, -12($fp) - # LOCAL local_print_at_Vertice_internal_0 --> -4($fp) - # LOCAL local_print_at_Vertice_internal_2 --> -12($fp) - # local_print_at_Vertice_internal_0 = local_print_at_Vertice_internal_2 - lw $t0, -12($fp) - sw $t0, -4($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # local_print_at_Vertice_internal_3 = GETATTRIBUTE num Vertice - # LOCAL local_print_at_Vertice_internal_3 --> -16($fp) - lw $t0, 12($s1) - sw $t0, -16($fp) - # ARG local_print_at_Vertice_internal_3 - # LOCAL local_print_at_Vertice_internal_3 --> -16($fp) - lw $t0, -16($fp) - # Push arg into stack - subu $sp, $sp, 4 - sw $t0, 0($sp) - # LOCAL local_print_at_Vertice_internal_0 --> -4($fp) - # LOCAL local_print_at_Vertice_internal_1 --> -8($fp) - # local_print_at_Vertice_internal_1 = VCALL local_print_at_Vertice_internal_0 out_int - # Save new self pointer in $s1 - lw $s1, -4($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 48($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -8($fp) - # Pop 4 bytes from stack into register s1 - lw $s1, 0($sp) - addu $sp, $sp, 4 - # local_print_at_Vertice_internal_6 = GETATTRIBUTE out Vertice - # LOCAL local_print_at_Vertice_internal_6 --> -28($fp) - lw $t0, 16($s1) - sw $t0, -28($fp) - # LOCAL local_print_at_Vertice_internal_4 --> -20($fp) - # LOCAL local_print_at_Vertice_internal_6 --> -28($fp) - # local_print_at_Vertice_internal_4 = local_print_at_Vertice_internal_6 - lw $t0, -28($fp) - sw $t0, -20($fp) - # Push register s1 into stack - subu $sp, $sp, 4 - sw $s1, 0($sp) - # LOCAL local_print_at_Vertice_internal_4 --> -20($fp) - # LOCAL local_print_at_Vertice_internal_5 --> -24($fp) - # local_print_at_Vertice_internal_5 = VCALL local_print_at_Vertice_internal_4 print - # Save new self pointer in $s1 - lw $s1, -20($fp) - # Get pointer to type - lw $t0, 4($s1) - # Get pointer to type's VTABLE - lw $t0, 0($t0) - # Get pointer to function address - lw $t0, 68($t0) - # Call function. Result is on $v0 - jalr $t0 - sw $v0, -24($fp) + sw $v0, -32($fp) # Pop 4 bytes from stack into register s1 lw $s1, 0($sp) addu $sp, $sp, 4 - # RETURN local_print_at_Vertice_internal_5 - lw $v0, -24($fp) - # Deallocate stack frame for function function_print_at_Vertice. + # RETURN local_main_at_Main_internal_7 + lw $v0, -32($fp) + # Deallocate stack frame for function function_main_at_Main. # Restore $ra lw $ra, 4($sp) # Restore $fp lw $fp, 0($sp) # Restore Stack pointer $sp - addu $sp, $sp, 36 + addu $sp, $sp, 52 jr $ra # Function END diff --git a/src/testing.py b/src/testing.py index f6685632..c3023c6f 100755 --- a/src/testing.py +++ b/src/testing.py @@ -60,390 +60,30 @@ def pipeline(program: str, deep: int) -> None: print(source) -text = r"""(* - * Cool program reading descriptions of weighted directed graphs - * from stdin. It builds up a graph objects with a list of vertices - * and a list of edges. Every vertice has a list of outgoing edges. - * - * INPUT FORMAT - * Every line has the form vertice successor* - * Where vertice is an int, and successor is vertice,weight - * - * An empty line or EOF terminates the input. - * - * The list of vertices and the edge list is printed out by the Main - * class. - * - * TEST - * Once compiled, the file g1.graph can be fed to the program. - * The output should look like this: - -nautilus.CS.Berkeley.EDU 53# spim -file graph.s None: # Si no tiene expresion de inicializacion entonces devolvemos # 0 en caso de que sea Int, Bool u otro tipo excepto String # (0 = false y 0 = void) - attribute_type = self.context.get_type(node.typex) + # attribute_type = self.context.get_type(node.typex) + attribute_type = scope.find_variable(node.idx).type if attribute_type.name == "String": self.register_instruction(AllocateStringNode(local, self.null, 0)) self.register_instruction(ReturnNode(local)) diff --git a/src/travels/inference.py b/src/travels/inference.py index 75ca85c1..ba6c6d89 100755 --- a/src/travels/inference.py +++ b/src/travels/inference.py @@ -511,7 +511,9 @@ def _( node.args, method.param_types, method.param_names ): type_expr_i = self.visit(expr_i, scope, infered_type, deep) - if not type_expr_i.conforms_to(type_i): + if type_i == self.AUTO_TYPE: + update_scope_variable(param_name, type_expr_i, scope) + elif not type_expr_i.conforms_to(type_i): raise semantic.SemanticError( f"{expr_i.line, expr_i.column} - TypeError: Expression corresponding to param {param_name} in call to {node.id} must conform to {type_i.name}" ) diff --git a/tests/codegen/arith.mips b/tests/codegen/arith.mips index e7f9dbb9..ca9e1767 100644 --- a/tests/codegen/arith.mips +++ b/tests/codegen/arith.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:19 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 14 11:08:38 2020 # School of Math and Computer Science, University of Havana # @@ -34,7 +34,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_out_int_at_IO, function_out_string_at_IO, dummy, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, dummy, dummy, dummy, dummy, dummy, dummy +IO_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, function_in_int_at_IO, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_abort_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy # Function END # @@ -48,7 +48,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -62,7 +62,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, function_length_at_String, function_abort_at_Object, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_concat_at_String, dummy +String_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_concat_at_String, dummy, dummy, dummy, function_length_at_String, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, dummy # Function END # @@ -76,7 +76,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -90,7 +90,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -104,7 +104,7 @@ Int_end: # **** VTABLE for type A2I **** -A2I_vtable: .word function_i2a_aux_at_A2I, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, function_i2a_at_A2I, dummy, dummy, dummy, dummy, dummy, function_i2c_at_A2I, dummy, function_a2i_aux_at_A2I, function_a2i_at_A2I, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_c2i_at_A2I, dummy, dummy, dummy, dummy +A2I_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_i2a_aux_at_A2I, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy, function_c2i_at_A2I, function_a2i_aux_at_A2I, function_i2a_at_A2I, function_i2c_at_A2I, dummy, dummy, dummy, dummy, function_a2i_at_A2I # Function END # @@ -118,7 +118,7 @@ A2I_end: # **** VTABLE for type A **** -A_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_method1_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method5_at_A, function_value_at_A, dummy, dummy, function_method2_at_A, function_set_var_at_A, dummy, dummy, dummy, function_method3_at_A, dummy, dummy, function_method4_at_A +A_vtable: .word dummy, function_method4_at_A, function_value_at_A, dummy, dummy, dummy, dummy, dummy, dummy, function_method2_at_A, dummy, function_method3_at_A, function_method1_at_A, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_method5_at_A, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_set_var_at_A, dummy # Function END # @@ -132,7 +132,7 @@ A_end: # **** VTABLE for type B **** -B_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_method1_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method5_at_B, function_value_at_A, dummy, dummy, function_method2_at_A, function_set_var_at_A, dummy, dummy, dummy, function_method3_at_A, dummy, dummy, function_method4_at_A +B_vtable: .word dummy, function_method4_at_A, function_value_at_A, dummy, dummy, dummy, dummy, dummy, dummy, function_method2_at_A, dummy, function_method3_at_A, function_method1_at_A, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_method5_at_B, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_set_var_at_A, dummy # Function END # @@ -146,7 +146,7 @@ B_end: # **** VTABLE for type D **** -D_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_method1_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method7_at_D, function_method5_at_B, function_value_at_A, dummy, dummy, function_method2_at_A, function_set_var_at_A, dummy, dummy, dummy, function_method3_at_A, dummy, dummy, function_method4_at_A +D_vtable: .word function_method7_at_D, function_method4_at_A, function_value_at_A, dummy, dummy, dummy, dummy, dummy, dummy, function_method2_at_A, dummy, function_method3_at_A, function_method1_at_A, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_method5_at_B, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_set_var_at_A, dummy # Function END # @@ -160,7 +160,7 @@ D_end: # **** VTABLE for type E **** -E_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, function_method6_at_E, function_method1_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method7_at_D, function_method5_at_B, function_value_at_A, dummy, dummy, function_method2_at_A, function_set_var_at_A, dummy, dummy, dummy, function_method3_at_A, dummy, dummy, function_method4_at_A +E_vtable: .word function_method7_at_D, function_method4_at_A, function_value_at_A, dummy, dummy, function_method6_at_E, dummy, dummy, dummy, function_method2_at_A, dummy, function_method3_at_A, function_method1_at_A, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_method5_at_B, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_set_var_at_A, dummy # Function END # @@ -174,7 +174,7 @@ E_end: # **** VTABLE for type C **** -C_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, function_method6_at_C, function_method1_at_A, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_method5_at_C, function_value_at_A, dummy, dummy, function_method2_at_A, function_set_var_at_A, dummy, dummy, dummy, function_method3_at_A, dummy, dummy, function_method4_at_A +C_vtable: .word dummy, function_method4_at_A, function_value_at_A, dummy, dummy, function_method6_at_C, dummy, dummy, dummy, function_method2_at_A, dummy, function_method3_at_A, function_method1_at_A, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_method5_at_C, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_set_var_at_A, dummy # Function END # @@ -188,7 +188,7 @@ C_end: # **** VTABLE for type Main **** -Main_vtable: .word dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_abort_at_Object, function_menu_at_Main, function_class_type_at_Main, dummy, dummy, dummy, dummy, function_main_at_Main, function_out_int_at_IO, function_out_string_at_IO, dummy, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_is_even_at_Main, function_print_at_Main, dummy, dummy, function_in_int_at_IO, function_get_int_at_Main, dummy, dummy, function_prompt_at_Main, dummy, dummy +Main_vtable: .word dummy, dummy, dummy, function_menu_at_Main, function_get_int_at_Main, dummy, dummy, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_class_type_at_Main, function_copy_at_Object, function_in_int_at_IO, function_prompt_at_Main, function_type_name_at_Object, function_print_at_Main, function_is_even_at_Main, dummy, function_abort_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_main_at_Main, function_out_int_at_IO, dummy, dummy # Function END # @@ -802,7 +802,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -1087,7 +1087,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 44($t0) + lw $t1, 112($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -3754,7 +3754,7 @@ label_FALSEIF_91: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -248($fp) @@ -6517,7 +6517,7 @@ label_FALSEIF_191: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -248($fp) @@ -6644,7 +6644,7 @@ function_a2i_at_A2I: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -7018,7 +7018,7 @@ label_FALSEIF_201: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -7322,7 +7322,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -108($fp) @@ -7414,7 +7414,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 28($t0) +lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -7437,7 +7437,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 64($t0) +lw $t0, 96($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -7583,7 +7583,7 @@ label_FALSEIF_211: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -7887,7 +7887,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -184($fp) @@ -7979,7 +7979,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 28($t0) +lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -168($fp) @@ -8002,7 +8002,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 64($t0) +lw $t0, 96($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -156($fp) @@ -8044,7 +8044,7 @@ label_FALSEIF_221: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 64($t0) + lw $t0, 96($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -196($fp) @@ -8209,7 +8209,7 @@ function_a2i_aux_at_A2I: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -8525,7 +8525,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 28($t0) +lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -68($fp) @@ -8548,7 +8548,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 108($t0) +lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -9114,7 +9114,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 0($t0) +lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -9290,7 +9290,7 @@ label_FALSEIF_245: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -9313,7 +9313,7 @@ label_FALSEIF_245: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 120($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -9750,7 +9750,7 @@ label_FALSEIF_249: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -52($fp) @@ -9899,7 +9899,7 @@ label_FALSEIF_249: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 56($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -9922,7 +9922,7 @@ label_FALSEIF_249: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 120($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -10239,7 +10239,7 @@ function_method2_at_A: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -10415,7 +10415,7 @@ function_method3_at_A: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -10686,7 +10686,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 96($t0) +lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -10845,7 +10845,7 @@ label_FALSEIF_259: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -11298,7 +11298,7 @@ label_WHILE_END_264: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -11473,7 +11473,7 @@ function_method5_at_B: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -11732,7 +11732,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 72($t0) +lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -12668,7 +12668,7 @@ label_FALSEIF_291: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -116($fp) @@ -12898,7 +12898,7 @@ function_method6_at_E: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -13074,7 +13074,7 @@ function_method6_at_C: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -13287,7 +13287,7 @@ function_method5_at_C: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -13495,7 +13495,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -13533,7 +13533,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -13585,7 +13585,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -13637,7 +13637,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -13675,7 +13675,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -13727,7 +13727,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -13779,7 +13779,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -104($fp) @@ -13817,7 +13817,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -120($fp) @@ -13869,7 +13869,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -13921,7 +13921,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -152($fp) @@ -13959,7 +13959,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -168($fp) @@ -14011,7 +14011,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -184($fp) @@ -14063,7 +14063,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -200($fp) @@ -14101,7 +14101,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -216($fp) @@ -14153,7 +14153,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -232($fp) @@ -14205,7 +14205,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -248($fp) @@ -14243,7 +14243,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -264($fp) @@ -14295,7 +14295,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -280($fp) @@ -14347,7 +14347,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -296($fp) @@ -14385,7 +14385,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -312($fp) @@ -14437,7 +14437,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -328($fp) @@ -14489,7 +14489,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -344($fp) @@ -14527,7 +14527,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -360($fp) @@ -14579,7 +14579,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -376($fp) @@ -14631,7 +14631,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -392($fp) @@ -14683,7 +14683,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -408($fp) @@ -14711,7 +14711,7 @@ function_menu_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -424($fp) @@ -14784,7 +14784,7 @@ function_prompt_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -14836,7 +14836,7 @@ function_prompt_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -14864,7 +14864,7 @@ function_prompt_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -14978,7 +14978,7 @@ function_get_int_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 116($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -15014,7 +15014,7 @@ function_get_int_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 68($t0) + lw $t0, 124($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -15271,7 +15271,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 84($t0) +lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -15932,7 +15932,7 @@ label_FALSEIF_315: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 84($t0) + lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -15992,7 +15992,7 @@ function_class_type_at_Main: # local_class_type_at_Main_internal_3 = 15 li $t0, 15 sw $t0, -16($fp) - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type A @@ -16014,7 +16014,7 @@ function_class_type_at_Main: lw $t0, -20($fp) sw $t0, -16($fp) label_Not_min0_325: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type B @@ -16036,7 +16036,7 @@ function_class_type_at_Main: lw $t0, -20($fp) sw $t0, -16($fp) label_Not_min1_326: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type C @@ -16058,7 +16058,7 @@ function_class_type_at_Main: lw $t0, -20($fp) sw $t0, -16($fp) label_Not_min2_327: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type D @@ -16080,7 +16080,7 @@ function_class_type_at_Main: lw $t0, -20($fp) sw $t0, -16($fp) label_Not_min3_328: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type E @@ -16102,7 +16102,7 @@ function_class_type_at_Main: lw $t0, -20($fp) sw $t0, -16($fp) label_Not_min4_329: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type Object @@ -16140,7 +16140,7 @@ function_class_type_at_Main: # IF_ZERO local_class_type_at_Main_internal_1 GOTO label_ERROR_331 lw $t0, -8($fp) beq $t0, 0, label_ERROR_331 - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE A # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type A @@ -16206,7 +16206,7 @@ function_class_type_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -16221,7 +16221,7 @@ function_class_type_at_Main: # GOTO label_END_332 j label_END_332 label_NEXT0_333: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE B # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type B @@ -16287,7 +16287,7 @@ label_NEXT0_333: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -52($fp) @@ -16302,7 +16302,7 @@ label_NEXT0_333: # GOTO label_END_332 j label_END_332 label_NEXT1_334: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE C # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type C @@ -16368,7 +16368,7 @@ label_NEXT1_334: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -16383,7 +16383,7 @@ label_NEXT1_334: # GOTO label_END_332 j label_END_332 label_NEXT2_335: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE D # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type D @@ -16449,7 +16449,7 @@ label_NEXT2_335: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -16464,7 +16464,7 @@ label_NEXT2_335: # GOTO label_END_332 j label_END_332 label_NEXT3_336: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE E # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type E @@ -16530,7 +16530,7 @@ label_NEXT3_336: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -112($fp) @@ -16545,7 +16545,7 @@ label_NEXT3_336: # GOTO label_END_332 j label_END_332 label_NEXT4_337: - # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object + # local_class_type_at_Main_internal_4 = TYPE_DISTANCE Object # LOCAL local_class_type_at_Main_internal_4 --> -20($fp) # LOCAL local_class_type_at_Main_internal_0 --> -4($fp) # Load TDT pointer to type Object @@ -16611,7 +16611,7 @@ label_NEXT4_337: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -132($fp) @@ -16751,7 +16751,7 @@ function_print_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -16774,7 +16774,7 @@ function_print_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 100($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -16797,7 +16797,7 @@ function_print_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -16849,7 +16849,7 @@ function_print_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -16989,7 +16989,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -17027,7 +17027,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -17067,7 +17067,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -17090,7 +17090,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 84($t0) + lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -17152,7 +17152,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -84($fp) @@ -17212,7 +17212,7 @@ label_FALSEIF_341: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -100($fp) @@ -17256,7 +17256,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 24($t0) +lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -116($fp) @@ -17284,7 +17284,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 20($t0) +lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -132($fp) @@ -17597,7 +17597,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 104($t0) +lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -180($fp) @@ -17620,7 +17620,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 96($t0) +lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -168($fp) @@ -17707,7 +17707,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 80($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -204($fp) @@ -17742,7 +17742,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 80($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -216($fp) @@ -17765,7 +17765,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 92($t0) +lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -192($fp) @@ -18023,7 +18023,7 @@ sw $t1, -252($fp) # local_main_at_Main_internal_65 = 15 li $t0, 15 sw $t0, -264($fp) -# local_main_at_Main_internal_66 = TYPE_DISTANCE C +# local_main_at_Main_internal_66 = TYPE_DISTANCE C # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) # Load TDT pointer to type C @@ -18045,7 +18045,7 @@ bgtu $t0, $t1, label_Not_min0_363 lw $t0, -268($fp) sw $t0, -264($fp) label_Not_min0_363: - # local_main_at_Main_internal_66 = TYPE_DISTANCE A + # local_main_at_Main_internal_66 = TYPE_DISTANCE A # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) # Load TDT pointer to type A @@ -18067,7 +18067,7 @@ label_Not_min0_363: lw $t0, -268($fp) sw $t0, -264($fp) label_Not_min1_364: - # local_main_at_Main_internal_66 = TYPE_DISTANCE Object + # local_main_at_Main_internal_66 = TYPE_DISTANCE Object # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) # Load TDT pointer to type Object @@ -18105,7 +18105,7 @@ label_Not_min0_363: # IF_ZERO local_main_at_Main_internal_63 GOTO label_ERROR_366 lw $t0, -256($fp) beq $t0, 0, label_ERROR_366 - # local_main_at_Main_internal_66 = TYPE_DISTANCE C + # local_main_at_Main_internal_66 = TYPE_DISTANCE C # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) # Load TDT pointer to type C @@ -18152,7 +18152,7 @@ label_Not_min0_363: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -288($fp) @@ -18175,7 +18175,7 @@ label_Not_min0_363: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -280($fp) @@ -18191,7 +18191,7 @@ label_Not_min0_363: # GOTO label_END_367 j label_END_367 label_NEXT0_368: - # local_main_at_Main_internal_66 = TYPE_DISTANCE A + # local_main_at_Main_internal_66 = TYPE_DISTANCE A # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) # Load TDT pointer to type A @@ -18238,7 +18238,7 @@ label_NEXT0_368: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -308($fp) @@ -18261,7 +18261,7 @@ label_NEXT0_368: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 112($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -300($fp) @@ -18277,7 +18277,7 @@ label_NEXT0_368: # GOTO label_END_367 j label_END_367 label_NEXT1_369: - # local_main_at_Main_internal_66 = TYPE_DISTANCE Object + # local_main_at_Main_internal_66 = TYPE_DISTANCE Object # LOCAL local_main_at_Main_internal_66 --> -268($fp) # LOCAL local_main_at_Main_internal_62 --> -252($fp) # Load TDT pointer to type Object @@ -18343,7 +18343,7 @@ label_NEXT1_369: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -320($fp) @@ -18371,7 +18371,7 @@ label_NEXT1_369: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -336($fp) @@ -18744,7 +18744,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 104($t0) +lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -388($fp) @@ -18767,7 +18767,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 96($t0) +lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -376($fp) @@ -18854,7 +18854,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 80($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -412($fp) @@ -18889,7 +18889,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 80($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -424($fp) @@ -18912,7 +18912,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 124($t0) +lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -400($fp) @@ -19226,7 +19226,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 80($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -468($fp) @@ -19247,7 +19247,7 @@ lw $s1, -460($fp) # Get pointer to type's VTABLE la $t0, A_vtable # Get pointer to function address -lw $t1, 76($t0) +lw $t1, 80($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -456($fp) @@ -19561,7 +19561,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 80($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -512($fp) @@ -19582,7 +19582,7 @@ lw $s1, -504($fp) # Get pointer to type's VTABLE la $t0, B_vtable # Get pointer to function address -lw $t1, 76($t0) +lw $t1, 80($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -500($fp) @@ -19896,7 +19896,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 80($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -556($fp) @@ -19917,7 +19917,7 @@ lw $s1, -548($fp) # Get pointer to type's VTABLE la $t0, C_vtable # Get pointer to function address -lw $t1, 76($t0) +lw $t1, 80($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -544($fp) @@ -20236,7 +20236,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 80($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -612($fp) @@ -20259,7 +20259,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 72($t0) +lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -600($fp) @@ -20321,7 +20321,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 52($t0) +lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -624($fp) @@ -20359,7 +20359,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 88($t0) +lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -640($fp) @@ -20411,7 +20411,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 52($t0) +lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -656($fp) @@ -20471,7 +20471,7 @@ label_FALSEIF_421: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -672($fp) @@ -20509,7 +20509,7 @@ label_FALSEIF_421: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -688($fp) @@ -20561,7 +20561,7 @@ label_FALSEIF_421: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -704($fp) @@ -20889,7 +20889,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 80($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -760($fp) @@ -20912,7 +20912,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 36($t0) +lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -748($fp) @@ -20977,7 +20977,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 80($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -780($fp) @@ -21002,7 +21002,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 80($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -796($fp) @@ -21166,7 +21166,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 52($t0) +lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -808($fp) @@ -21204,7 +21204,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 88($t0) +lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -824($fp) @@ -21256,7 +21256,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 52($t0) +lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -840($fp) @@ -21290,7 +21290,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 88($t0) +lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -856($fp) @@ -21342,7 +21342,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 52($t0) +lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -868($fp) @@ -21431,7 +21431,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 32($t0) +lw $t0, 100($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -904($fp) @@ -21454,7 +21454,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 52($t0) +lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -892($fp) @@ -21506,7 +21506,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 52($t0) +lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -912($fp) @@ -22147,7 +22147,7 @@ label_FALSEIF_443: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -996($fp) @@ -22170,7 +22170,7 @@ label_FALSEIF_443: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -984($fp) diff --git a/tests/codegen/atoi.mips b/tests/codegen/atoi.mips index 6071bb14..60af7ab2 100644 --- a/tests/codegen/atoi.mips +++ b/tests/codegen/atoi.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:21 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 14 11:08:40 2020 # School of Math and Computer Science, University of Havana # @@ -24,7 +24,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, dummy, dummy, function_in_int_at_IO, dummy, function_out_int_at_IO, function_out_string_at_IO, dummy, function_abort_at_Object +IO_vtable: .word dummy, function_out_string_at_IO, dummy, dummy, dummy, function_copy_at_Object, function_out_int_at_IO, function_abort_at_Object, dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, function_type_name_at_Object, dummy, function_in_int_at_IO # Function END # @@ -38,7 +38,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object +Object_vtable: .word dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy # Function END # @@ -52,7 +52,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, function_concat_at_String, dummy, function_copy_at_Object, dummy, function_substr_at_String, function_type_name_at_Object, dummy, dummy, dummy, function_length_at_String, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object +String_vtable: .word function_length_at_String, dummy, function_substr_at_String, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, function_concat_at_String, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy # Function END # @@ -66,7 +66,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object +Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy # Function END # @@ -80,7 +80,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object +Int_vtable: .word dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy # Function END # @@ -94,7 +94,7 @@ Int_end: # **** VTABLE for type A2I **** -A2I_vtable: .word function_a2i_aux_at_A2I, dummy, dummy, function_copy_at_Object, function_a2i_at_A2I, dummy, function_type_name_at_Object, dummy, function_c2i_at_A2I, function_i2a_aux_at_A2I, dummy, dummy, function_i2a_at_A2I, dummy, dummy, function_i2c_at_A2I, function_abort_at_Object +A2I_vtable: .word dummy, dummy, dummy, function_c2i_at_A2I, dummy, function_copy_at_Object, dummy, function_abort_at_Object, function_a2i_aux_at_A2I, dummy, function_i2a_aux_at_A2I, dummy, function_i2a_at_A2I, function_a2i_at_A2I, function_type_name_at_Object, function_i2c_at_A2I, dummy # Function END # @@ -108,7 +108,7 @@ A2I_end: # **** VTABLE for type Main **** -Main_vtable: .word dummy, dummy, function_main_at_Main, function_copy_at_Object, dummy, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, dummy, dummy, function_in_int_at_IO, dummy, function_out_int_at_IO, function_out_string_at_IO, dummy, function_abort_at_Object +Main_vtable: .word dummy, function_out_string_at_IO, dummy, dummy, function_main_at_Main, function_copy_at_Object, function_out_int_at_IO, function_abort_at_Object, dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, function_type_name_at_Object, dummy, function_in_int_at_IO # Function END # @@ -533,7 +533,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -786,7 +786,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 8($t0) + lw $t1, 16($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -3453,7 +3453,7 @@ label_FALSEIF_91: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 64($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -248($fp) @@ -6216,7 +6216,7 @@ label_FALSEIF_191: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 64($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -248($fp) @@ -6343,7 +6343,7 @@ function_a2i_at_A2I: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -6717,7 +6717,7 @@ label_FALSEIF_201: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -7021,7 +7021,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 40($t0) +lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -108($fp) @@ -7113,7 +7113,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 20($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -7136,7 +7136,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 0($t0) +lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -7282,7 +7282,7 @@ label_FALSEIF_211: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -7586,7 +7586,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 40($t0) +lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -184($fp) @@ -7678,7 +7678,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 20($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -168($fp) @@ -7701,7 +7701,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 0($t0) +lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -156($fp) @@ -7743,7 +7743,7 @@ label_FALSEIF_221: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -196($fp) @@ -7908,7 +7908,7 @@ function_a2i_aux_at_A2I: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -8224,7 +8224,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 20($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -68($fp) @@ -8247,7 +8247,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 32($t0) +lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -8813,7 +8813,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 36($t0) +lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -8989,7 +8989,7 @@ label_FALSEIF_245: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -9012,7 +9012,7 @@ label_FALSEIF_245: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -9449,7 +9449,7 @@ label_FALSEIF_249: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -52($fp) @@ -9621,7 +9621,7 @@ label_FALSEIF_249: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -9768,7 +9768,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -9930,7 +9930,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -9982,7 +9982,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 56($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -10016,7 +10016,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 56($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -76($fp) @@ -10068,7 +10068,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 56($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) diff --git a/tests/codegen/book_list.mips b/tests/codegen/book_list.mips index 1dce3097..2292ca7e 100644 --- a/tests/codegen/book_list.mips +++ b/tests/codegen/book_list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:20 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 14 11:08:39 2020 # School of Math and Computer Science, University of Havana # @@ -32,7 +32,7 @@ Article: .asciiz "Article" # **** VTABLE for type IO **** -IO_vtable: .word dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, dummy, dummy, function_out_string_at_IO, dummy, dummy, dummy, function_out_int_at_IO, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, function_in_int_at_IO, function_abort_at_Object, dummy +IO_vtable: .word dummy, function_abort_at_Object, function_in_int_at_IO, dummy, dummy, function_out_string_at_IO, function_out_int_at_IO, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_type_name_at_Object, dummy, dummy, dummy # Function END # @@ -46,7 +46,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy +Object_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy # Function END # @@ -60,7 +60,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_concat_at_String, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, function_substr_at_String, dummy, dummy, function_abort_at_Object, function_length_at_String +String_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_concat_at_String, dummy, dummy, dummy, function_length_at_String, function_type_name_at_Object, dummy, dummy, function_substr_at_String # Function END # @@ -74,7 +74,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy +Bool_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy # Function END # @@ -88,7 +88,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy +Int_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy # Function END # @@ -102,7 +102,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object, dummy, function_main_at_Main, dummy, function_abort_at_Object, dummy +Main_vtable: .word dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_main_at_Main, dummy # Function END # @@ -116,7 +116,7 @@ Main_end: # **** VTABLE for type BookList **** -BookList_vtable: .word function_cdr_at_BookList, function_car_at_BookList, function_isNil_at_BookList, function_in_string_at_IO, dummy, dummy, dummy, dummy, function_out_string_at_IO, function_cons_at_BookList, dummy, function_print_list_at_BookList, function_out_int_at_IO, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, function_in_int_at_IO, function_abort_at_Object, dummy +BookList_vtable: .word function_isNil_at_BookList, function_abort_at_Object, function_in_int_at_IO, function_car_at_BookList, function_cdr_at_BookList, function_out_string_at_IO, function_out_int_at_IO, dummy, function_cons_at_BookList, function_copy_at_Object, dummy, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_type_name_at_Object, function_print_list_at_BookList, dummy, dummy # Function END # @@ -130,7 +130,7 @@ BookList_end: # **** VTABLE for type Nil **** -Nil_vtable: .word function_cdr_at_BookList, function_car_at_BookList, function_isNil_at_Nil, function_in_string_at_IO, dummy, dummy, dummy, dummy, function_out_string_at_IO, function_cons_at_BookList, dummy, function_print_list_at_Nil, function_out_int_at_IO, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, function_in_int_at_IO, function_abort_at_Object, dummy +Nil_vtable: .word function_isNil_at_Nil, function_abort_at_Object, function_in_int_at_IO, function_car_at_BookList, function_cdr_at_BookList, function_out_string_at_IO, function_out_int_at_IO, dummy, function_cons_at_BookList, function_copy_at_Object, dummy, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_type_name_at_Object, function_print_list_at_Nil, dummy, dummy # Function END # @@ -144,7 +144,7 @@ Nil_end: # **** VTABLE for type Cons **** -Cons_vtable: .word function_cdr_at_Cons, function_car_at_Cons, function_isNil_at_Cons, function_in_string_at_IO, function_init_at_Cons, dummy, dummy, dummy, function_out_string_at_IO, function_cons_at_BookList, dummy, function_print_list_at_Cons, function_out_int_at_IO, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, function_in_int_at_IO, function_abort_at_Object, dummy +Cons_vtable: .word function_isNil_at_Cons, function_abort_at_Object, function_in_int_at_IO, function_car_at_Cons, function_cdr_at_Cons, function_out_string_at_IO, function_out_int_at_IO, dummy, function_cons_at_BookList, function_copy_at_Object, dummy, dummy, dummy, function_init_at_Cons, function_in_string_at_IO, dummy, function_type_name_at_Object, function_print_list_at_Cons, dummy, dummy # Function END # @@ -158,7 +158,7 @@ Cons_end: # **** VTABLE for type Book **** -Book_vtable: .word dummy, dummy, dummy, function_in_string_at_IO, dummy, function_print_at_Book, dummy, function_initBook_at_Book, function_out_string_at_IO, dummy, dummy, dummy, function_out_int_at_IO, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, function_in_int_at_IO, function_abort_at_Object, dummy +Book_vtable: .word dummy, function_abort_at_Object, function_in_int_at_IO, dummy, dummy, function_out_string_at_IO, function_out_int_at_IO, function_initBook_at_Book, dummy, function_copy_at_Object, function_print_at_Book, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_type_name_at_Object, dummy, dummy, dummy # Function END # @@ -172,7 +172,7 @@ Book_end: # **** VTABLE for type Article **** -Article_vtable: .word dummy, dummy, dummy, function_in_string_at_IO, dummy, function_print_at_Article, dummy, function_initBook_at_Book, function_out_string_at_IO, dummy, function_initArticle_at_Article, dummy, function_out_int_at_IO, function_type_name_at_Object, function_copy_at_Object, dummy, dummy, function_in_int_at_IO, function_abort_at_Object, dummy +Article_vtable: .word dummy, function_abort_at_Object, function_in_int_at_IO, dummy, dummy, function_out_string_at_IO, function_out_int_at_IO, function_initBook_at_Book, dummy, function_copy_at_Object, function_print_at_Article, dummy, function_initArticle_at_Article, dummy, function_in_string_at_IO, dummy, function_type_name_at_Object, dummy, dummy, dummy # Function END # @@ -537,7 +537,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -798,7 +798,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 64($t0) + lw $t1, 72($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -1136,7 +1136,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -1210,7 +1210,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -68($fp) @@ -1241,7 +1241,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -1274,7 +1274,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -1323,7 +1323,7 @@ function_isNil_at_BookList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1479,7 +1479,7 @@ function_cons_at_BookList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -1530,7 +1530,7 @@ function_car_at_BookList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1633,7 +1633,7 @@ function_cdr_at_BookList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1720,7 +1720,7 @@ function_print_list_at_BookList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2054,7 +2054,7 @@ function_print_list_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2072,7 +2072,7 @@ function_print_list_at_Cons: # local_print_list_at_Cons_internal_6 = 14 li $t0, 14 sw $t0, -28($fp) - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Book @@ -2094,7 +2094,7 @@ function_print_list_at_Cons: lw $t0, -32($fp) sw $t0, -28($fp) label_Not_min0_1: - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Article @@ -2132,7 +2132,7 @@ function_print_list_at_Cons: # IF_ZERO local_print_list_at_Cons_internal_4 GOTO label_ERROR_3 lw $t0, -20($fp) beq $t0, 0, label_ERROR_3 - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Book # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Book @@ -2198,7 +2198,7 @@ function_print_list_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -2213,7 +2213,7 @@ function_print_list_at_Cons: # GOTO label_END_4 j label_END_4 label_NEXT0_5: - # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article + # local_print_list_at_Cons_internal_7 = TYPE_DISTANCE Article # LOCAL local_print_list_at_Cons_internal_7 --> -32($fp) # LOCAL local_print_list_at_Cons_internal_3 --> -16($fp) # Load TDT pointer to type Article @@ -2279,7 +2279,7 @@ label_NEXT0_5: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -2333,7 +2333,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 44($t0) +lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -2520,7 +2520,7 @@ function_print_at_Book: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -2555,7 +2555,7 @@ function_print_at_Book: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -2604,7 +2604,7 @@ function_print_at_Book: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2656,7 +2656,7 @@ function_print_at_Book: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -2691,7 +2691,7 @@ function_print_at_Book: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -2740,7 +2740,7 @@ function_print_at_Book: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -2897,7 +2897,7 @@ function_print_at_Article: # Get pointer to type's VTABLE la $t0, Book_vtable # Get pointer to function address - lw $t1, 20($t0) + lw $t1, 40($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -4($fp) @@ -2949,7 +2949,7 @@ function_print_at_Article: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -2984,7 +2984,7 @@ function_print_at_Article: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -3033,7 +3033,7 @@ function_print_at_Article: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) diff --git a/tests/codegen/cells.mips b/tests/codegen/cells.mips index afea72a5..1829ea80 100644 --- a/tests/codegen/cells.mips +++ b/tests/codegen/cells.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:23 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 14 11:08:41 2020 # School of Math and Computer Science, University of Havana # @@ -24,7 +24,7 @@ CellularAutomaton: .asciiz "CellularAutomaton" # **** VTABLE for type IO **** -IO_vtable: .word function_type_name_at_Object, dummy, function_in_int_at_IO, function_out_int_at_IO, function_copy_at_Object, dummy, function_in_string_at_IO, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy +IO_vtable: .word dummy, dummy, function_in_int_at_IO, function_out_string_at_IO, function_in_string_at_IO, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object # Function END # @@ -38,7 +38,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy +Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object # Function END # @@ -52,7 +52,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_length_at_String, dummy, function_concat_at_String, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, function_substr_at_String +String_vtable: .word function_substr_at_String, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_concat_at_String, dummy, function_length_at_String, function_type_name_at_Object, function_copy_at_Object # Function END # @@ -66,7 +66,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy +Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object # Function END # @@ -80,7 +80,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy +Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object # Function END # @@ -94,7 +94,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word function_type_name_at_Object, function_main_at_Main, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy +Main_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, function_main_at_Main, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_copy_at_Object # Function END # @@ -108,7 +108,7 @@ Main_end: # **** VTABLE for type CellularAutomaton **** -CellularAutomaton_vtable: .word function_type_name_at_Object, dummy, function_in_int_at_IO, function_out_int_at_IO, function_copy_at_Object, function_evolve_at_CellularAutomaton, function_in_string_at_IO, function_out_string_at_IO, function_num_cells_at_CellularAutomaton, dummy, function_init_at_CellularAutomaton, dummy, function_cell_right_neighbor_at_CellularAutomaton, function_abort_at_Object, function_cell_left_neighbor_at_CellularAutomaton, function_cell_at_CellularAutomaton, function_print_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, dummy +CellularAutomaton_vtable: .word dummy, function_num_cells_at_CellularAutomaton, function_in_int_at_IO, function_out_string_at_IO, function_in_string_at_IO, function_print_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_init_at_CellularAutomaton, function_abort_at_Object, function_evolve_at_CellularAutomaton, dummy, function_cell_left_neighbor_at_CellularAutomaton, function_cell_right_neighbor_at_CellularAutomaton, function_out_int_at_IO, dummy, function_cell_at_CellularAutomaton, dummy, function_type_name_at_Object, function_copy_at_Object # Function END # @@ -445,7 +445,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -706,7 +706,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 4($t0) + lw $t1, 40($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -840,7 +840,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -873,7 +873,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 64($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -1096,7 +1096,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 20($t0) +lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -1125,7 +1125,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 64($t0) +lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -68($fp) @@ -1360,7 +1360,7 @@ function_print_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -1383,7 +1383,7 @@ function_print_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1436,7 +1436,7 @@ function_num_cells_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1530,7 +1530,7 @@ function_cell_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1829,7 +1829,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 32($t0) +lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -2090,7 +2090,7 @@ function_cell_right_neighbor_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -2937,7 +2937,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 56($t0) +lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -4044,7 +4044,7 @@ function_evolve_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -4205,7 +4205,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 68($t0) +lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -4228,7 +4228,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 44($t0) +lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) diff --git a/tests/codegen/complex.mips b/tests/codegen/complex.mips index 8c733650..52e67683 100644 --- a/tests/codegen/complex.mips +++ b/tests/codegen/complex.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:20 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 14 11:08:38 2020 # School of Math and Computer Science, University of Havana # @@ -24,7 +24,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word dummy, function_copy_at_Object, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, function_in_int_at_IO, dummy, function_type_name_at_Object, function_out_string_at_IO, function_in_string_at_IO, function_abort_at_Object, dummy, dummy +IO_vtable: .word function_type_name_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, function_in_string_at_IO, function_in_int_at_IO, dummy, function_out_int_at_IO, dummy # Function END # @@ -38,7 +38,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy +Object_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy # Function END # @@ -52,7 +52,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_substr_at_String, function_length_at_String, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, dummy, function_concat_at_String +String_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, function_length_at_String, function_substr_at_String, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, function_concat_at_String, dummy, dummy # Function END # @@ -66,7 +66,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy +Bool_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy # Function END # @@ -80,7 +80,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, function_abort_at_Object, dummy, dummy +Int_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy # Function END # @@ -94,7 +94,7 @@ Int_end: # **** VTABLE for type Complex **** -Complex_vtable: .word function_reflect_Y_at_Complex, function_copy_at_Object, function_reflect_0_at_Complex, dummy, function_out_int_at_IO, function_init_at_Complex, dummy, dummy, function_in_int_at_IO, function_reflect_X_at_Complex, function_type_name_at_Object, function_out_string_at_IO, function_in_string_at_IO, function_abort_at_Object, function_print_at_Complex, dummy +Complex_vtable: .word function_type_name_at_Object, function_out_string_at_IO, function_print_at_Complex, function_reflect_0_at_Complex, dummy, function_reflect_X_at_Complex, dummy, dummy, function_copy_at_Object, function_init_at_Complex, function_abort_at_Object, function_in_string_at_IO, function_in_int_at_IO, dummy, function_out_int_at_IO, function_reflect_Y_at_Complex # Function END # @@ -108,7 +108,7 @@ Complex_end: # **** VTABLE for type Main **** -Main_vtable: .word dummy, function_copy_at_Object, dummy, function_main_at_Main, function_out_int_at_IO, dummy, dummy, dummy, function_in_int_at_IO, dummy, function_type_name_at_Object, function_out_string_at_IO, function_in_string_at_IO, function_abort_at_Object, dummy, dummy +Main_vtable: .word function_type_name_at_Object, function_out_string_at_IO, dummy, dummy, function_main_at_Main, dummy, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, function_in_string_at_IO, function_in_int_at_IO, dummy, function_out_int_at_IO, dummy # Function END # @@ -433,7 +433,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -686,7 +686,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 12($t0) + lw $t1, 16($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -1512,7 +1512,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -1558,7 +1558,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -1607,7 +1607,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -1642,7 +1642,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -1691,7 +1691,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -2915,7 +2915,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -2945,7 +2945,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -2970,7 +2970,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -2995,7 +2995,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 8($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -3252,7 +3252,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 44($t0) +lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -3312,7 +3312,7 @@ label_FALSEIF_59: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) diff --git a/tests/codegen/fib.mips b/tests/codegen/fib.mips index d4af9976..d7f71110 100644 --- a/tests/codegen/fib.mips +++ b/tests/codegen/fib.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:20 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 14 11:08:38 2020 # School of Math and Computer Science, University of Havana # @@ -22,7 +22,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_copy_at_Object, dummy, function_out_string_at_IO, function_out_int_at_IO, dummy, function_in_int_at_IO, dummy, dummy, function_in_string_at_IO, dummy, function_abort_at_Object, function_type_name_at_Object +IO_vtable: .word dummy, function_out_string_at_IO, dummy, function_out_int_at_IO, function_abort_at_Object, dummy, dummy, function_in_string_at_IO, function_copy_at_Object, dummy, function_type_name_at_Object, function_in_int_at_IO # Function END # @@ -36,7 +36,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, function_type_name_at_Object +Object_vtable: .word dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy # Function END # @@ -50,7 +50,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_copy_at_Object, function_substr_at_String, dummy, dummy, dummy, dummy, dummy, function_concat_at_String, dummy, function_length_at_String, function_abort_at_Object, function_type_name_at_Object +String_vtable: .word dummy, dummy, function_substr_at_String, dummy, function_abort_at_Object, dummy, function_length_at_String, dummy, function_copy_at_Object, function_concat_at_String, function_type_name_at_Object, dummy # Function END # @@ -64,7 +64,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, function_type_name_at_Object +Bool_vtable: .word dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy # Function END # @@ -78,7 +78,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, function_type_name_at_Object +Int_vtable: .word dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy # Function END # @@ -92,7 +92,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word function_copy_at_Object, dummy, function_out_string_at_IO, function_out_int_at_IO, function_fib_at_Main, function_in_int_at_IO, function_main_at_Main, dummy, function_in_string_at_IO, dummy, function_abort_at_Object, function_type_name_at_Object +Main_vtable: .word function_fib_at_Main, function_out_string_at_IO, dummy, function_out_int_at_IO, function_abort_at_Object, function_main_at_Main, dummy, function_in_string_at_IO, function_copy_at_Object, dummy, function_type_name_at_Object, function_in_int_at_IO # Function END # @@ -408,7 +408,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -661,7 +661,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 24($t0) + lw $t1, 20($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -731,7 +731,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 8($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -781,7 +781,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -804,7 +804,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -879,7 +879,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 8($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) diff --git a/tests/codegen/graph.mips b/tests/codegen/graph.mips index 9ad598a6..2a08740f 100644 --- a/tests/codegen/graph.mips +++ b/tests/codegen/graph.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:21 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 14 11:08:39 2020 # School of Math and Computer Science, University of Havana # @@ -40,7 +40,7 @@ Vertice: .asciiz "Vertice" # **** VTABLE for type IO **** -IO_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, function_out_string_at_IO, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_out_int_at_IO +IO_vtable: .word function_type_name_at_Object, function_in_int_at_IO, dummy, function_copy_at_Object, function_abort_at_Object, function_out_int_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_out_string_at_IO, dummy, dummy, dummy, dummy # Function END # @@ -54,7 +54,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Object_vtable: .word function_type_name_at_Object, dummy, dummy, function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -68,7 +68,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, dummy, dummy, function_concat_at_String, function_copy_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, function_length_at_String, function_substr_at_String, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +String_vtable: .word function_type_name_at_Object, dummy, dummy, function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy, dummy, function_length_at_String, dummy, dummy, dummy, dummy, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, dummy, function_concat_at_String, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -82,7 +82,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Bool_vtable: .word function_type_name_at_Object, dummy, dummy, function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -96,7 +96,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Int_vtable: .word function_type_name_at_Object, dummy, dummy, function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy # Function END # @@ -110,7 +110,7 @@ Int_end: # **** VTABLE for type BoolOp **** -BoolOp_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, function_or_at_BoolOp, dummy, dummy, dummy, dummy, function_and_at_BoolOp, dummy, dummy, dummy, dummy, dummy, dummy +BoolOp_vtable: .word function_type_name_at_Object, dummy, dummy, function_copy_at_Object, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_and_at_BoolOp, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_or_at_BoolOp, dummy, dummy, dummy # Function END # @@ -124,7 +124,7 @@ BoolOp_end: # **** VTABLE for type Graph **** -Graph_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, function_print_E_at_Graph, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_add_vertice_at_Graph, dummy, dummy, function_print_V_at_Graph, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Graph_vtable: .word function_type_name_at_Object, dummy, dummy, function_copy_at_Object, function_abort_at_Object, dummy, dummy, function_print_V_at_Graph, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_print_E_at_Graph, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_add_vertice_at_Graph # Function END # @@ -138,7 +138,7 @@ Graph_end: # **** VTABLE for type Parse **** -Parse_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, dummy, function_parse_line_at_Parse, dummy, function_c2i_at_Parse, dummy, function_in_int_at_IO, function_out_string_at_IO, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_a2i_aux_at_Parse, dummy, dummy, dummy, dummy, function_a2i_at_Parse, dummy, function_read_input_at_Parse, function_out_int_at_IO +Parse_vtable: .word function_type_name_at_Object, function_in_int_at_IO, dummy, function_copy_at_Object, function_abort_at_Object, function_out_int_at_IO, dummy, dummy, function_parse_line_at_Parse, dummy, dummy, function_a2i_at_Parse, dummy, dummy, dummy, dummy, dummy, function_read_input_at_Parse, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, function_a2i_aux_at_Parse, function_out_string_at_IO, dummy, dummy, function_c2i_at_Parse, dummy # Function END # @@ -152,7 +152,7 @@ Parse_end: # **** VTABLE for type Main **** -Main_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, dummy, function_parse_line_at_Parse, dummy, function_c2i_at_Parse, dummy, function_in_int_at_IO, function_out_string_at_IO, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_a2i_aux_at_Parse, dummy, dummy, function_main_at_Main, dummy, function_a2i_at_Parse, dummy, function_read_input_at_Parse, function_out_int_at_IO +Main_vtable: .word function_type_name_at_Object, function_in_int_at_IO, dummy, function_copy_at_Object, function_abort_at_Object, function_out_int_at_IO, dummy, dummy, function_parse_line_at_Parse, dummy, dummy, function_a2i_at_Parse, dummy, dummy, function_main_at_Main, dummy, dummy, function_read_input_at_Parse, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, function_a2i_aux_at_Parse, function_out_string_at_IO, dummy, dummy, function_c2i_at_Parse, dummy # Function END # @@ -166,7 +166,7 @@ Main_end: # **** VTABLE for type VList **** -VList_vtable: .word dummy, function_head_at_VList, function_tail_at_VList, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, function_out_string_at_IO, dummy, function_cons_at_VList, function_abort_at_Object, dummy, dummy, dummy, dummy, function_isNil_at_VList, dummy, dummy, function_print_at_VList, dummy, dummy, dummy, function_out_int_at_IO +VList_vtable: .word function_type_name_at_Object, function_in_int_at_IO, dummy, function_copy_at_Object, function_abort_at_Object, function_out_int_at_IO, function_head_at_VList, dummy, dummy, dummy, dummy, dummy, function_cons_at_VList, dummy, dummy, dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, function_tail_at_VList, dummy, function_print_at_VList, function_isNil_at_VList, dummy, function_out_string_at_IO, dummy, dummy, dummy, dummy # Function END # @@ -180,7 +180,7 @@ VList_end: # **** VTABLE for type VCons **** -VCons_vtable: .word dummy, function_head_at_VCons, function_tail_at_VCons, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, dummy, dummy, function_init_at_VCons, dummy, dummy, function_in_int_at_IO, function_out_string_at_IO, dummy, function_cons_at_VList, function_abort_at_Object, dummy, dummy, dummy, dummy, function_isNil_at_VCons, dummy, dummy, function_print_at_VCons, dummy, dummy, dummy, function_out_int_at_IO +VCons_vtable: .word function_type_name_at_Object, function_in_int_at_IO, function_init_at_VCons, function_copy_at_Object, function_abort_at_Object, function_out_int_at_IO, function_head_at_VCons, dummy, dummy, dummy, dummy, dummy, function_cons_at_VList, dummy, dummy, dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, function_tail_at_VCons, dummy, function_print_at_VCons, function_isNil_at_VCons, dummy, function_out_string_at_IO, dummy, dummy, dummy, dummy # Function END # @@ -194,7 +194,7 @@ VCons_end: # **** VTABLE for type EList **** -EList_vtable: .word dummy, function_head_at_EList, function_tail_at_EList, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, function_append_at_EList, dummy, dummy, dummy, dummy, function_in_int_at_IO, function_out_string_at_IO, dummy, function_cons_at_EList, function_abort_at_Object, dummy, dummy, dummy, dummy, function_isNil_at_EList, dummy, dummy, function_print_at_EList, dummy, dummy, dummy, function_out_int_at_IO +EList_vtable: .word function_type_name_at_Object, function_in_int_at_IO, dummy, function_copy_at_Object, function_abort_at_Object, function_out_int_at_IO, function_head_at_EList, dummy, dummy, dummy, function_append_at_EList, dummy, function_cons_at_EList, dummy, dummy, dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, function_tail_at_EList, dummy, function_print_at_EList, function_isNil_at_EList, dummy, function_out_string_at_IO, dummy, dummy, dummy, dummy # Function END # @@ -208,7 +208,7 @@ EList_end: # **** VTABLE for type ECons **** -ECons_vtable: .word dummy, function_head_at_ECons, function_tail_at_ECons, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, function_append_at_EList, dummy, function_init_at_ECons, dummy, dummy, function_in_int_at_IO, function_out_string_at_IO, dummy, function_cons_at_EList, function_abort_at_Object, dummy, dummy, dummy, dummy, function_isNil_at_ECons, dummy, dummy, function_print_at_ECons, dummy, dummy, dummy, function_out_int_at_IO +ECons_vtable: .word function_type_name_at_Object, function_in_int_at_IO, function_init_at_ECons, function_copy_at_Object, function_abort_at_Object, function_out_int_at_IO, function_head_at_ECons, dummy, dummy, dummy, function_append_at_EList, dummy, function_cons_at_EList, dummy, dummy, dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, function_tail_at_ECons, dummy, function_print_at_ECons, function_isNil_at_ECons, dummy, function_out_string_at_IO, dummy, dummy, dummy, dummy # Function END # @@ -222,7 +222,7 @@ ECons_end: # **** VTABLE for type Edge **** -Edge_vtable: .word dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, dummy, dummy, function_init_at_Edge, dummy, dummy, function_in_int_at_IO, function_out_string_at_IO, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_print_at_Edge, dummy, dummy, dummy, function_out_int_at_IO +Edge_vtable: .word function_type_name_at_Object, function_in_int_at_IO, function_init_at_Edge, function_copy_at_Object, function_abort_at_Object, function_out_int_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, dummy, dummy, function_print_at_Edge, dummy, dummy, function_out_string_at_IO, dummy, dummy, dummy, dummy # Function END # @@ -236,7 +236,7 @@ Edge_end: # **** VTABLE for type Vertice **** -Vertice_vtable: .word function_add_out_at_Vertice, dummy, dummy, dummy, function_copy_at_Object, dummy, function_type_name_at_Object, function_in_string_at_IO, function_outgoing_at_Vertice, dummy, dummy, function_init_at_Vertice, dummy, dummy, function_in_int_at_IO, function_out_string_at_IO, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_print_at_Vertice, dummy, function_number_at_Vertice, dummy, function_out_int_at_IO +Vertice_vtable: .word function_type_name_at_Object, function_in_int_at_IO, function_init_at_Vertice, function_copy_at_Object, function_abort_at_Object, function_out_int_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_number_at_Vertice, dummy, function_outgoing_at_Vertice, dummy, dummy, function_in_string_at_IO, dummy, dummy, dummy, dummy, function_print_at_Vertice, dummy, dummy, function_out_string_at_IO, dummy, function_add_out_at_Vertice, dummy, dummy # Function END # @@ -645,7 +645,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -922,7 +922,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 100($t0) + lw $t1, 56($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -1260,7 +1260,7 @@ function_add_vertice_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -1295,7 +1295,7 @@ function_add_vertice_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1334,7 +1334,7 @@ function_add_vertice_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 68($t0) + lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -1389,7 +1389,7 @@ function_print_E_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 104($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1439,7 +1439,7 @@ function_print_V_at_Graph: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 104($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1667,7 +1667,7 @@ function_read_input_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -2292,7 +2292,7 @@ label_FALSE_25: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 96($t0) + lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -2344,7 +2344,7 @@ label_FALSE_25: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -2367,7 +2367,7 @@ label_FALSE_25: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 120($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -2395,7 +2395,7 @@ label_FALSE_25: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -100($fp) @@ -2525,7 +2525,7 @@ function_parse_line_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 108($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -2548,7 +2548,7 @@ function_parse_line_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -2583,7 +2583,7 @@ function_parse_line_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -2964,7 +2964,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 108($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -3038,7 +3038,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 108($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -3146,7 +3146,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 112($t0) + lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -128($fp) @@ -3181,7 +3181,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -116($fp) @@ -3204,7 +3204,7 @@ label_FALSE_37: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 112($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -108($fp) @@ -5879,7 +5879,7 @@ label_FALSEIF_129: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -248($fp) @@ -6019,7 +6019,7 @@ function_a2i_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -6393,7 +6393,7 @@ label_FALSEIF_139: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 84($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -6697,7 +6697,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 80($t0) +lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -108($fp) @@ -6789,7 +6789,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 84($t0) +lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -6812,7 +6812,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 88($t0) +lw $t0, 100($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -6958,7 +6958,7 @@ label_FALSEIF_149: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 84($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -7262,7 +7262,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 80($t0) +lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -184($fp) @@ -7354,7 +7354,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 84($t0) +lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -168($fp) @@ -7377,7 +7377,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 108($t0) +lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -156($fp) @@ -7419,7 +7419,7 @@ label_FALSEIF_159: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 88($t0) + lw $t0, 100($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -196($fp) @@ -7584,7 +7584,7 @@ function_a2i_aux_at_Parse: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -7838,7 +7838,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 84($t0) +lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -8174,7 +8174,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 80($t0) +lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -104($fp) @@ -8304,7 +8304,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 84($t0) +lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -8649,7 +8649,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 80($t0) +lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -160($fp) @@ -8779,7 +8779,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 84($t0) +lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -8941,7 +8941,7 @@ label_FALSEIF_183: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 84($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -196($fp) @@ -8964,7 +8964,7 @@ label_FALSEIF_183: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 116($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -184($fp) @@ -9403,7 +9403,7 @@ __Main__attrib__g__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 116($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -9453,7 +9453,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 64($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -9482,7 +9482,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -9604,7 +9604,7 @@ function_head_at_VList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -9657,7 +9657,7 @@ function_tail_at_VList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -9776,7 +9776,7 @@ function_cons_at_VList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -9851,7 +9851,7 @@ function_print_at_VList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10060,7 +10060,7 @@ function_print_at_VCons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 104($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10089,7 +10089,7 @@ function_print_at_VCons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 104($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -10211,7 +10211,7 @@ function_head_at_EList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10264,7 +10264,7 @@ function_tail_at_EList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10383,7 +10383,7 @@ function_cons_at_EList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10435,7 +10435,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 92($t0) +lw $t0, 96($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -10481,7 +10481,7 @@ label_FALSEIF_203: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 8($t0) + lw $t0, 84($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -10512,7 +10512,7 @@ label_FALSEIF_203: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -10548,7 +10548,7 @@ label_FALSEIF_203: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -10571,7 +10571,7 @@ label_FALSEIF_203: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 68($t0) + lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -10652,7 +10652,7 @@ function_print_at_EList: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10861,7 +10861,7 @@ function_print_at_ECons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 104($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -10890,7 +10890,7 @@ function_print_at_ECons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 104($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -11160,7 +11160,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -11198,7 +11198,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 120($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -11250,7 +11250,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -11288,7 +11288,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 120($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -11340,7 +11340,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -11378,7 +11378,7 @@ function_print_at_Edge: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 120($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -11635,7 +11635,7 @@ function_add_out_at_Vertice: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 68($t0) + lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -11703,7 +11703,7 @@ function_print_at_Vertice: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 120($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -11732,7 +11732,7 @@ function_print_at_Vertice: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 104($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) diff --git a/tests/codegen/hairyscary.mips b/tests/codegen/hairyscary.mips index 84031bc7..6a9dfe3e 100644 --- a/tests/codegen/hairyscary.mips +++ b/tests/codegen/hairyscary.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:19 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 14 11:08:37 2020 # School of Math and Computer Science, University of Havana # @@ -30,7 +30,7 @@ Bar: .asciiz "Bar" # **** VTABLE for type IO **** -IO_vtable: .word function_type_name_at_Object, dummy, function_out_string_at_IO, dummy, function_abort_at_Object, dummy, dummy, dummy, function_out_int_at_IO, dummy, function_copy_at_Object, function_in_string_at_IO, function_in_int_at_IO +IO_vtable: .word function_abort_at_Object, function_out_int_at_IO, dummy, function_copy_at_Object, function_in_int_at_IO, function_out_string_at_IO, dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, function_type_name_at_Object # Function END # @@ -44,7 +44,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy +Object_vtable: .word function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object # Function END # @@ -58,7 +58,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_type_name_at_Object, dummy, dummy, function_substr_at_String, function_abort_at_Object, dummy, function_concat_at_String, function_length_at_String, dummy, dummy, function_copy_at_Object, dummy, dummy +String_vtable: .word function_abort_at_Object, dummy, function_length_at_String, function_copy_at_Object, dummy, dummy, function_concat_at_String, dummy, dummy, dummy, function_substr_at_String, dummy, function_type_name_at_Object # Function END # @@ -72,7 +72,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy +Bool_vtable: .word function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object # Function END # @@ -86,7 +86,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy +Int_vtable: .word function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object # Function END # @@ -100,7 +100,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word function_type_name_at_Object, function_main_at_Main, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy +Main_vtable: .word function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, function_main_at_Main, dummy, dummy, dummy, function_type_name_at_Object # Function END # @@ -114,7 +114,7 @@ Main_end: # **** VTABLE for type Bazz **** -Bazz_vtable: .word function_type_name_at_Object, dummy, function_out_string_at_IO, dummy, function_abort_at_Object, function_printh_at_Bazz, dummy, dummy, function_out_int_at_IO, function_doh_at_Bazz, function_copy_at_Object, function_in_string_at_IO, function_in_int_at_IO +Bazz_vtable: .word function_abort_at_Object, function_out_int_at_IO, dummy, function_copy_at_Object, function_in_int_at_IO, function_out_string_at_IO, dummy, function_printh_at_Bazz, dummy, function_in_string_at_IO, dummy, function_doh_at_Bazz, function_type_name_at_Object # Function END # @@ -128,7 +128,7 @@ Bazz_end: # **** VTABLE for type Foo **** -Foo_vtable: .word function_type_name_at_Object, dummy, function_out_string_at_IO, dummy, function_abort_at_Object, function_printh_at_Bazz, dummy, dummy, function_out_int_at_IO, function_doh_at_Foo, function_copy_at_Object, function_in_string_at_IO, function_in_int_at_IO +Foo_vtable: .word function_abort_at_Object, function_out_int_at_IO, dummy, function_copy_at_Object, function_in_int_at_IO, function_out_string_at_IO, dummy, function_printh_at_Bazz, dummy, function_in_string_at_IO, dummy, function_doh_at_Foo, function_type_name_at_Object # Function END # @@ -142,7 +142,7 @@ Foo_end: # **** VTABLE for type Razz **** -Razz_vtable: .word function_type_name_at_Object, dummy, function_out_string_at_IO, dummy, function_abort_at_Object, function_printh_at_Bazz, dummy, dummy, function_out_int_at_IO, function_doh_at_Foo, function_copy_at_Object, function_in_string_at_IO, function_in_int_at_IO +Razz_vtable: .word function_abort_at_Object, function_out_int_at_IO, dummy, function_copy_at_Object, function_in_int_at_IO, function_out_string_at_IO, dummy, function_printh_at_Bazz, dummy, function_in_string_at_IO, dummy, function_doh_at_Foo, function_type_name_at_Object # Function END # @@ -156,7 +156,7 @@ Razz_end: # **** VTABLE for type Bar **** -Bar_vtable: .word function_type_name_at_Object, dummy, function_out_string_at_IO, dummy, function_abort_at_Object, function_printh_at_Bazz, dummy, dummy, function_out_int_at_IO, function_doh_at_Foo, function_copy_at_Object, function_in_string_at_IO, function_in_int_at_IO +Bar_vtable: .word function_abort_at_Object, function_out_int_at_IO, dummy, function_copy_at_Object, function_in_int_at_IO, function_out_string_at_IO, dummy, function_printh_at_Bazz, dummy, function_in_string_at_IO, dummy, function_doh_at_Foo, function_type_name_at_Object # Function END # @@ -472,7 +472,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -757,7 +757,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 4($t0) + lw $t1, 32($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -1315,7 +1315,7 @@ __Bazz__attrib__g__init: # local_ttrib__g__init_internal_5 = 13 li $t0, 13 sw $t0, -24($fp) - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Bazz @@ -1337,7 +1337,7 @@ __Bazz__attrib__g__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min0_1: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -1359,7 +1359,7 @@ __Bazz__attrib__g__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min1_2: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Foo @@ -1381,7 +1381,7 @@ __Bazz__attrib__g__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min2_3: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -1419,7 +1419,7 @@ __Bazz__attrib__g__init: # IF_ZERO local_ttrib__g__init_internal_3 GOTO label_ERROR_5 lw $t0, -16($fp) beq $t0, 0, label_ERROR_5 - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bazz # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Bazz @@ -1526,7 +1526,7 @@ __Bazz__attrib__g__init: # GOTO label_END_6 j label_END_6 label_NEXT0_7: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -1665,7 +1665,7 @@ label_NEXT0_7: # GOTO label_END_6 j label_END_6 label_NEXT1_8: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Foo # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Foo @@ -1788,7 +1788,7 @@ label_NEXT1_8: # GOTO label_END_6 j label_END_6 label_NEXT2_9: - # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar + # local_ttrib__g__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_ttrib__g__init_internal_6 --> -28($fp) # LOCAL local_ttrib__g__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -1876,7 +1876,7 @@ __Bazz__attrib__i__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -1935,7 +1935,7 @@ function_printh_at_Bazz: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2146,7 +2146,7 @@ __Foo__attrib__a__init: # local_trib__a__init_internal_5 = 13 li $t0, 13 sw $t0, -24($fp) - # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz + # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -2168,7 +2168,7 @@ __Foo__attrib__a__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min0_11: - # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo + # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Foo @@ -2190,7 +2190,7 @@ __Foo__attrib__a__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min1_12: - # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar + # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -2228,7 +2228,7 @@ __Foo__attrib__a__init: # IF_ZERO local_trib__a__init_internal_3 GOTO label_ERROR_14 lw $t0, -16($fp) beq $t0, 0, label_ERROR_14 - # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz + # local_trib__a__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -2367,7 +2367,7 @@ __Foo__attrib__a__init: # GOTO label_END_15 j label_END_15 label_NEXT0_16: - # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo + # local_trib__a__init_internal_6 = TYPE_DISTANCE Foo # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Foo @@ -2490,7 +2490,7 @@ label_NEXT0_16: # GOTO label_END_15 j label_END_15 label_NEXT1_17: - # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar + # local_trib__a__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_trib__a__init_internal_6 --> -28($fp) # LOCAL local_trib__a__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -2579,7 +2579,7 @@ __Foo__attrib__b__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -2608,7 +2608,7 @@ __Foo__attrib__b__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -2674,7 +2674,7 @@ __Foo__attrib__b__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -2740,7 +2740,7 @@ __Foo__attrib__b__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -2958,7 +2958,7 @@ __Razz__attrib__e__init: # local_ttrib__e__init_internal_5 = 13 li $t0, 13 sw $t0, -24($fp) - # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -2980,7 +2980,7 @@ __Razz__attrib__e__init: lw $t0, -28($fp) sw $t0, -24($fp) label_Not_min0_19: - # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -3018,7 +3018,7 @@ __Razz__attrib__e__init: # IF_ZERO local_ttrib__e__init_internal_3 GOTO label_ERROR_21 lw $t0, -16($fp) beq $t0, 0, label_ERROR_21 - # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Razz # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) # Load TDT pointer to type Razz @@ -3157,7 +3157,7 @@ __Razz__attrib__e__init: # GOTO label_END_22 j label_END_22 label_NEXT0_23: - # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar + # local_ttrib__e__init_internal_6 = TYPE_DISTANCE Bar # LOCAL local_ttrib__e__init_internal_6 --> -28($fp) # LOCAL local_ttrib__e__init_internal_2 --> -12($fp) # Load TDT pointer to type Bar @@ -3239,7 +3239,7 @@ __Razz__attrib__f__init: # Get pointer to type's VTABLE la $t0, Bazz_vtable # Get pointer to function address - lw $t1, 36($t0) + lw $t1, 44($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -24($fp) @@ -3268,7 +3268,7 @@ __Razz__attrib__f__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -3335,7 +3335,7 @@ __Razz__attrib__f__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -3401,7 +3401,7 @@ __Razz__attrib__f__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -3467,7 +3467,7 @@ __Razz__attrib__f__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -3554,7 +3554,7 @@ __Bar__attrib__c__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -3603,7 +3603,7 @@ __Bar__attrib__d__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) diff --git a/tests/codegen/hello_world.mips b/tests/codegen/hello_world.mips index 0d0274c4..245ffb19 100644 --- a/tests/codegen/hello_world.mips +++ b/tests/codegen/hello_world.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:19 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 14 11:08:37 2020 # School of Math and Computer Science, University of Havana # @@ -22,7 +22,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, function_out_string_at_IO, function_abort_at_Object, dummy, function_in_string_at_IO, function_out_int_at_IO, function_in_int_at_IO +IO_vtable: .word function_in_string_at_IO, dummy, dummy, function_abort_at_Object, function_out_int_at_IO, function_copy_at_Object, function_type_name_at_Object, dummy, dummy, function_out_string_at_IO, function_in_int_at_IO # Function END # @@ -36,7 +36,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy +Object_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, function_copy_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy # Function END # @@ -50,7 +50,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_concat_at_String, function_type_name_at_Object, function_substr_at_String, dummy, function_copy_at_Object, dummy, function_abort_at_Object, function_length_at_String, dummy, dummy, dummy +String_vtable: .word dummy, function_length_at_String, dummy, function_abort_at_Object, dummy, function_copy_at_Object, function_type_name_at_Object, function_concat_at_String, function_substr_at_String, dummy, dummy # Function END # @@ -64,7 +64,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy +Bool_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, function_copy_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy # Function END # @@ -78,7 +78,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, function_type_name_at_Object, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy +Int_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, function_copy_at_Object, function_type_name_at_Object, dummy, dummy, dummy, dummy # Function END # @@ -92,7 +92,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word dummy, function_type_name_at_Object, dummy, function_main_at_Main, function_copy_at_Object, function_out_string_at_IO, function_abort_at_Object, dummy, function_in_string_at_IO, function_out_int_at_IO, function_in_int_at_IO +Main_vtable: .word function_in_string_at_IO, dummy, function_main_at_Main, function_abort_at_Object, function_out_int_at_IO, function_copy_at_Object, function_type_name_at_Object, dummy, dummy, function_out_string_at_IO, function_in_int_at_IO # Function END # @@ -404,7 +404,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -657,7 +657,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 12($t0) + lw $t1, 8($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -727,7 +727,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) diff --git a/tests/codegen/io.mips b/tests/codegen/io.mips index 53e3d2bd..576fa886 100644 --- a/tests/codegen/io.mips +++ b/tests/codegen/io.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:20 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 14 11:08:38 2020 # School of Math and Computer Science, University of Havana # @@ -30,7 +30,7 @@ D: .asciiz "D" # **** VTABLE for type IO **** -IO_vtable: .word function_in_string_at_IO, dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, function_in_int_at_IO, dummy, function_out_string_at_IO, dummy, function_out_int_at_IO, dummy, dummy, function_copy_at_Object +IO_vtable: .word function_out_string_at_IO, dummy, dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, function_in_int_at_IO, function_copy_at_Object, function_out_int_at_IO, dummy # Function END # @@ -44,7 +44,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object +Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy # Function END # @@ -58,7 +58,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_concat_at_String, dummy, function_substr_at_String, dummy, function_length_at_String, dummy, function_copy_at_Object +String_vtable: .word dummy, function_length_at_String, dummy, dummy, dummy, dummy, function_concat_at_String, function_substr_at_String, function_type_name_at_Object, dummy, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy # Function END # @@ -72,7 +72,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object +Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy # Function END # @@ -86,7 +86,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object +Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy # Function END # @@ -100,7 +100,7 @@ Int_end: # **** VTABLE for type A **** -A_vtable: .word dummy, dummy, function_abort_at_Object, function_out_a_at_A, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object +A_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, dummy, function_copy_at_Object, dummy, function_out_a_at_A # Function END # @@ -114,7 +114,7 @@ A_end: # **** VTABLE for type B **** -B_vtable: .word dummy, dummy, function_abort_at_Object, function_out_a_at_A, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_out_b_at_B, function_copy_at_Object +B_vtable: .word dummy, dummy, dummy, dummy, function_out_b_at_B, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, dummy, function_copy_at_Object, dummy, function_out_a_at_A # Function END # @@ -128,7 +128,7 @@ B_end: # **** VTABLE for type Main **** -Main_vtable: .word function_in_string_at_IO, dummy, function_abort_at_Object, dummy, dummy, function_main_at_Main, function_type_name_at_Object, function_in_int_at_IO, dummy, function_out_string_at_IO, dummy, function_out_int_at_IO, dummy, dummy, function_copy_at_Object +Main_vtable: .word function_out_string_at_IO, dummy, function_main_at_Main, dummy, dummy, function_in_string_at_IO, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, function_in_int_at_IO, function_copy_at_Object, function_out_int_at_IO, dummy # Function END # @@ -142,7 +142,7 @@ Main_end: # **** VTABLE for type C **** -C_vtable: .word function_in_string_at_IO, function_out_c_at_C, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, function_in_int_at_IO, dummy, function_out_string_at_IO, dummy, function_out_int_at_IO, dummy, dummy, function_copy_at_Object +C_vtable: .word function_out_string_at_IO, dummy, dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, function_type_name_at_Object, function_out_c_at_C, function_abort_at_Object, function_in_int_at_IO, function_copy_at_Object, function_out_int_at_IO, dummy # Function END # @@ -156,7 +156,7 @@ C_end: # **** VTABLE for type D **** -D_vtable: .word function_in_string_at_IO, function_out_c_at_C, function_abort_at_Object, dummy, function_out_d_at_D, dummy, function_type_name_at_Object, function_in_int_at_IO, dummy, function_out_string_at_IO, dummy, function_out_int_at_IO, dummy, dummy, function_copy_at_Object +D_vtable: .word function_out_string_at_IO, dummy, dummy, function_out_d_at_D, dummy, function_in_string_at_IO, dummy, dummy, function_type_name_at_Object, function_out_c_at_C, function_abort_at_Object, function_in_int_at_IO, function_copy_at_Object, function_out_int_at_IO, dummy # Function END # @@ -488,7 +488,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -741,7 +741,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 20($t0) + lw $t1, 8($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -871,7 +871,7 @@ function_out_a_at_A: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -945,7 +945,7 @@ function_out_b_at_B: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1037,7 +1037,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1108,7 +1108,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -1171,7 +1171,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -1234,7 +1234,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -1286,7 +1286,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -1359,7 +1359,7 @@ function_out_c_at_C: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1432,7 +1432,7 @@ function_out_d_at_D: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) diff --git a/tests/codegen/life.mips b/tests/codegen/life.mips index 55afb8b1..1e2df77b 100644 --- a/tests/codegen/life.mips +++ b/tests/codegen/life.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:22 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 14 11:08:40 2020 # School of Math and Computer Science, University of Havana # @@ -26,7 +26,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word dummy, dummy, function_out_int_at_IO, dummy, dummy, function_in_string_at_IO, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_out_string_at_IO, dummy, function_copy_at_Object, function_in_int_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, dummy +IO_vtable: .word function_in_int_at_IO, dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy # Function END # @@ -40,7 +40,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy # Function END # @@ -54,7 +54,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, function_length_at_String, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_substr_at_String, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_concat_at_String, dummy, dummy, dummy, dummy +String_vtable: .word dummy, dummy, dummy, dummy, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, function_length_at_String, function_concat_at_String, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy # Function END # @@ -68,7 +68,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy # Function END # @@ -82,7 +82,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy # Function END # @@ -96,7 +96,7 @@ Int_end: # **** VTABLE for type Board **** -Board_vtable: .word dummy, dummy, function_out_int_at_IO, dummy, dummy, function_in_string_at_IO, function_size_of_board_at_Board, function_abort_at_Object, dummy, dummy, function_type_name_at_Object, function_board_init_at_Board, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_out_string_at_IO, dummy, function_copy_at_Object, function_in_int_at_IO, dummy, dummy, dummy, dummy, dummy, dummy, dummy +Board_vtable: .word function_in_int_at_IO, function_board_init_at_Board, dummy, dummy, function_in_string_at_IO, dummy, dummy, function_size_of_board_at_Board, dummy, function_out_int_at_IO, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy # Function END # @@ -110,7 +110,7 @@ Board_end: # **** VTABLE for type CellularAutomaton **** -CellularAutomaton_vtable: .word function_cell_at_CellularAutomaton, function_num_cells_at_CellularAutomaton, function_out_int_at_IO, function_print_at_CellularAutomaton, function_neighbors_at_CellularAutomaton, function_in_string_at_IO, function_size_of_board_at_Board, function_abort_at_Object, dummy, function_southwest_at_CellularAutomaton, function_type_name_at_Object, function_board_init_at_Board, function_prompt2_at_CellularAutomaton, function_prompt_at_CellularAutomaton, function_east_at_CellularAutomaton, function_north_at_CellularAutomaton, function_west_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, dummy, dummy, function_out_string_at_IO, function_init_at_CellularAutomaton, function_copy_at_Object, function_in_int_at_IO, function_southeast_at_CellularAutomaton, function_option_at_CellularAutomaton, dummy, function_south_at_CellularAutomaton, function_northwest_at_CellularAutomaton, function_northeast_at_CellularAutomaton, function_evolve_at_CellularAutomaton +CellularAutomaton_vtable: .word function_in_int_at_IO, function_board_init_at_Board, function_southwest_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_in_string_at_IO, dummy, function_prompt_at_CellularAutomaton, function_size_of_board_at_Board, function_west_at_CellularAutomaton, function_out_int_at_IO, dummy, dummy, function_southeast_at_CellularAutomaton, function_northeast_at_CellularAutomaton, function_copy_at_Object, function_num_cells_at_CellularAutomaton, function_northwest_at_CellularAutomaton, function_init_at_CellularAutomaton, function_south_at_CellularAutomaton, function_east_at_CellularAutomaton, function_print_at_CellularAutomaton, function_abort_at_Object, function_north_at_CellularAutomaton, function_out_string_at_IO, function_option_at_CellularAutomaton, function_cell_at_CellularAutomaton, function_neighbors_at_CellularAutomaton, function_prompt2_at_CellularAutomaton, dummy, function_type_name_at_Object, function_evolve_at_CellularAutomaton # Function END # @@ -124,7 +124,7 @@ CellularAutomaton_end: # **** VTABLE for type Main **** -Main_vtable: .word function_cell_at_CellularAutomaton, function_num_cells_at_CellularAutomaton, function_out_int_at_IO, function_print_at_CellularAutomaton, function_neighbors_at_CellularAutomaton, function_in_string_at_IO, function_size_of_board_at_Board, function_abort_at_Object, dummy, function_southwest_at_CellularAutomaton, function_type_name_at_Object, function_board_init_at_Board, function_prompt2_at_CellularAutomaton, function_prompt_at_CellularAutomaton, function_east_at_CellularAutomaton, function_north_at_CellularAutomaton, function_west_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_main_at_Main, dummy, function_out_string_at_IO, function_init_at_CellularAutomaton, function_copy_at_Object, function_in_int_at_IO, function_southeast_at_CellularAutomaton, function_option_at_CellularAutomaton, dummy, function_south_at_CellularAutomaton, function_northwest_at_CellularAutomaton, function_northeast_at_CellularAutomaton, function_evolve_at_CellularAutomaton +Main_vtable: .word function_in_int_at_IO, function_board_init_at_Board, function_southwest_at_CellularAutomaton, function_cell_at_next_evolution_at_CellularAutomaton, function_in_string_at_IO, dummy, function_prompt_at_CellularAutomaton, function_size_of_board_at_Board, function_west_at_CellularAutomaton, function_out_int_at_IO, dummy, dummy, function_southeast_at_CellularAutomaton, function_northeast_at_CellularAutomaton, function_copy_at_Object, function_num_cells_at_CellularAutomaton, function_northwest_at_CellularAutomaton, function_init_at_CellularAutomaton, function_south_at_CellularAutomaton, function_east_at_CellularAutomaton, function_print_at_CellularAutomaton, function_abort_at_Object, function_north_at_CellularAutomaton, function_out_string_at_IO, function_option_at_CellularAutomaton, function_cell_at_CellularAutomaton, function_neighbors_at_CellularAutomaton, function_prompt2_at_CellularAutomaton, function_main_at_Main, function_type_name_at_Object, function_evolve_at_CellularAutomaton # Function END # @@ -778,7 +778,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -1071,7 +1071,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 72($t0) + lw $t1, 112($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -1271,7 +1271,7 @@ function_size_of_board_at_Board: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1360,7 +1360,7 @@ function_board_init_at_Board: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 24($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -3466,7 +3466,7 @@ function_init_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -3651,7 +3651,7 @@ function_print_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -3803,7 +3803,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 76($t0) +lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -3826,7 +3826,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 80($t0) +lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -3878,7 +3878,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 80($t0) +lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -76($fp) @@ -3980,7 +3980,7 @@ label_WHILE_END_62: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -100($fp) @@ -4033,7 +4033,7 @@ function_num_cells_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 40($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -4321,7 +4321,7 @@ label_FALSEIF_65: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 76($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -4621,7 +4621,7 @@ label_FALSEIF_69: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 100($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -4894,7 +4894,7 @@ label_FALSEIF_73: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 100($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -5480,7 +5480,7 @@ label_FALSEIF_77: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 100($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -6190,7 +6190,7 @@ label_FALSEIF_97: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 100($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -68($fp) @@ -6838,7 +6838,7 @@ label_FALSEIF_111: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -7624,7 +7624,7 @@ label_FALSEIF_125: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -8383,7 +8383,7 @@ label_FALSEIF_139: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 108($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -9004,7 +9004,7 @@ label_FALSEIF_153: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 108($t0) + lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -9074,7 +9074,7 @@ function_neighbors_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 88($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -52($fp) @@ -9407,7 +9407,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 108($t0) +lw $t0, 72($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -9778,7 +9778,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 56($t0) +lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -132($fp) @@ -10149,7 +10149,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 64($t0) +lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -172($fp) @@ -10520,7 +10520,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 116($t0) +lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -212($fp) @@ -10891,7 +10891,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 112($t0) +lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -252($fp) @@ -11262,7 +11262,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 96($t0) +lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -292($fp) @@ -11633,7 +11633,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 36($t0) +lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -332($fp) @@ -12028,7 +12028,7 @@ function_cell_at_next_evolution_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -12324,7 +12324,7 @@ label_FALSEIF_243: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 104($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -12594,7 +12594,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 0($t0) +lw $t0, 100($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -13054,7 +13054,7 @@ function_evolve_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -20($fp) @@ -13215,7 +13215,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 68($t0) +lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -52($fp) @@ -13238,7 +13238,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 104($t0) +lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -13431,7 +13431,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -13483,7 +13483,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -13535,7 +13535,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -13587,7 +13587,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -13639,7 +13639,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -76($fp) @@ -13691,7 +13691,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -13743,7 +13743,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -108($fp) @@ -13795,7 +13795,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -124($fp) @@ -13847,7 +13847,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -140($fp) @@ -13899,7 +13899,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -156($fp) @@ -13951,7 +13951,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -172($fp) @@ -14003,7 +14003,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -188($fp) @@ -14055,7 +14055,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -204($fp) @@ -14107,7 +14107,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -220($fp) @@ -14159,7 +14159,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -236($fp) @@ -14211,7 +14211,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -252($fp) @@ -14263,7 +14263,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -268($fp) @@ -14315,7 +14315,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -284($fp) @@ -14367,7 +14367,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -300($fp) @@ -14419,7 +14419,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -316($fp) @@ -14471,7 +14471,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -332($fp) @@ -14523,7 +14523,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -348($fp) @@ -14575,7 +14575,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -364($fp) @@ -14603,7 +14603,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 92($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -380($fp) @@ -14660,7 +14660,7 @@ function_option_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -392($fp) @@ -20397,7 +20397,7 @@ function_prompt_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -20449,7 +20449,7 @@ function_prompt_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -20477,7 +20477,7 @@ function_prompt_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -20534,7 +20534,7 @@ function_prompt_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -20924,7 +20924,7 @@ function_prompt2_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -20976,7 +20976,7 @@ function_prompt2_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -21028,7 +21028,7 @@ function_prompt2_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -44($fp) @@ -21056,7 +21056,7 @@ function_prompt2_at_CellularAutomaton: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -21503,7 +21503,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -21555,7 +21555,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 80($t0) + lw $t0, 92($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -21584,7 +21584,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 108($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -52($fp) @@ -21658,7 +21658,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 100($t0) + lw $t0, 96($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -68($fp) @@ -21764,7 +21764,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 84($t0) + lw $t0, 68($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -21797,7 +21797,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -21836,7 +21836,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -116($fp) @@ -21904,7 +21904,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 80($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -140($fp) diff --git a/tests/codegen/list.mips b/tests/codegen/list.mips index a1ed12bf..f82b2078 100644 --- a/tests/codegen/list.mips +++ b/tests/codegen/list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:20 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 14 11:08:39 2020 # School of Math and Computer Science, University of Havana # @@ -26,7 +26,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_abort_at_Object, function_in_int_at_IO, function_copy_at_Object, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_out_string_at_IO, dummy, function_type_name_at_Object, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy +IO_vtable: .word dummy, function_copy_at_Object, function_out_int_at_IO, function_in_int_at_IO, dummy, dummy, dummy, function_in_string_at_IO, dummy, dummy, dummy, function_out_string_at_IO, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, dummy # Function END # @@ -40,7 +40,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy +Object_vtable: .word dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, dummy # Function END # @@ -54,7 +54,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_abort_at_Object, dummy, function_copy_at_Object, function_substr_at_String, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_concat_at_String, dummy, dummy, function_length_at_String, dummy +String_vtable: .word function_substr_at_String, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, function_type_name_at_Object, function_concat_at_String, function_length_at_String, dummy # Function END # @@ -68,7 +68,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy +Bool_vtable: .word dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, dummy # Function END # @@ -82,7 +82,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy +Int_vtable: .word dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, dummy # Function END # @@ -96,7 +96,7 @@ Int_end: # **** VTABLE for type List **** -List_vtable: .word function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, function_cons_at_List, dummy, function_head_at_List, dummy, dummy, function_type_name_at_Object, function_tail_at_List, dummy, dummy, function_isNil_at_List, dummy, dummy +List_vtable: .word dummy, function_copy_at_Object, dummy, dummy, function_isNil_at_List, function_head_at_List, function_cons_at_List, dummy, dummy, function_tail_at_List, dummy, dummy, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, dummy # Function END # @@ -110,7 +110,7 @@ List_end: # **** VTABLE for type Cons **** -Cons_vtable: .word function_abort_at_Object, dummy, function_copy_at_Object, dummy, dummy, function_cons_at_List, dummy, function_head_at_Cons, dummy, dummy, function_type_name_at_Object, function_tail_at_Cons, dummy, dummy, function_isNil_at_Cons, dummy, function_init_at_Cons +Cons_vtable: .word dummy, function_copy_at_Object, dummy, dummy, function_isNil_at_Cons, function_head_at_Cons, function_cons_at_List, dummy, dummy, function_tail_at_Cons, dummy, dummy, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, function_init_at_Cons # Function END # @@ -124,7 +124,7 @@ Cons_end: # **** VTABLE for type Main **** -Main_vtable: .word function_abort_at_Object, function_in_int_at_IO, function_copy_at_Object, dummy, function_print_list_at_Main, dummy, function_in_string_at_IO, dummy, function_out_string_at_IO, function_main_at_Main, function_type_name_at_Object, dummy, dummy, function_out_int_at_IO, dummy, dummy, dummy +Main_vtable: .word dummy, function_copy_at_Object, function_out_int_at_IO, function_in_int_at_IO, dummy, dummy, dummy, function_in_string_at_IO, function_print_list_at_Main, dummy, function_main_at_Main, function_out_string_at_IO, function_abort_at_Object, function_type_name_at_Object, dummy, dummy, dummy # Function END # @@ -442,7 +442,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -703,7 +703,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 36($t0) + lw $t1, 40($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -801,7 +801,7 @@ function_head_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -881,7 +881,7 @@ function_tail_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 48($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1281,7 +1281,7 @@ function_print_list_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 56($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -1343,7 +1343,7 @@ function_print_list_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -1387,7 +1387,7 @@ label_FALSEIF_1: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -52($fp) @@ -1410,7 +1410,7 @@ label_FALSEIF_1: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 8($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -1462,7 +1462,7 @@ label_FALSEIF_1: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -1498,7 +1498,7 @@ label_FALSEIF_1: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -1521,7 +1521,7 @@ label_FALSEIF_1: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -76($fp) @@ -1650,7 +1650,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -1712,7 +1712,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -1774,7 +1774,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -1836,7 +1836,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -1898,7 +1898,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1932,7 +1932,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 56($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -76($fp) @@ -2056,7 +2056,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -92($fp) @@ -2085,7 +2085,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -108($fp) diff --git a/tests/codegen/new_complex.mips b/tests/codegen/new_complex.mips index fdf6add9..db9a488e 100644 --- a/tests/codegen/new_complex.mips +++ b/tests/codegen/new_complex.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:18 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 14 11:08:37 2020 # School of Math and Computer Science, University of Havana # @@ -24,7 +24,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word function_type_name_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_out_int_at_IO, dummy, function_in_string_at_IO, dummy, function_abort_at_Object, function_in_int_at_IO, dummy +IO_vtable: .word dummy, function_out_int_at_IO, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, function_type_name_at_Object, dummy, function_in_string_at_IO, dummy, function_out_string_at_IO, dummy, dummy, function_copy_at_Object, dummy # Function END # @@ -38,7 +38,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy +Object_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy # Function END # @@ -52,7 +52,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_type_name_at_Object, dummy, function_concat_at_String, dummy, function_length_at_String, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, function_substr_at_String +String_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, function_concat_at_String, dummy, dummy, dummy, function_length_at_String, dummy, function_copy_at_Object, function_substr_at_String # Function END # @@ -66,7 +66,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy +Bool_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy # Function END # @@ -80,7 +80,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy +Int_vtable: .word dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy # Function END # @@ -94,7 +94,7 @@ Int_end: # **** VTABLE for type Complex **** -Complex_vtable: .word function_type_name_at_Object, function_out_string_at_IO, dummy, function_init_at_Complex, dummy, function_reflect_0_at_Complex, function_copy_at_Object, dummy, function_reflect_Y_at_Complex, function_reflect_X_at_Complex, function_equal_at_Complex, function_print_at_Complex, function_out_int_at_IO, function_x_value_at_Complex, function_in_string_at_IO, function_y_value_at_Complex, function_abort_at_Object, function_in_int_at_IO, dummy +Complex_vtable: .word function_reflect_Y_at_Complex, function_out_int_at_IO, function_print_at_Complex, function_abort_at_Object, function_reflect_0_at_Complex, function_y_value_at_Complex, dummy, function_init_at_Complex, function_x_value_at_Complex, function_in_int_at_IO, function_type_name_at_Object, dummy, function_in_string_at_IO, function_equal_at_Complex, function_out_string_at_IO, dummy, function_reflect_X_at_Complex, function_copy_at_Object, dummy # Function END # @@ -108,7 +108,7 @@ Complex_end: # **** VTABLE for type Main **** -Main_vtable: .word function_type_name_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, function_copy_at_Object, function_main_at_Main, dummy, dummy, dummy, dummy, function_out_int_at_IO, dummy, function_in_string_at_IO, dummy, function_abort_at_Object, function_in_int_at_IO, dummy +Main_vtable: .word dummy, function_out_int_at_IO, dummy, function_abort_at_Object, dummy, dummy, function_main_at_Main, dummy, dummy, function_in_int_at_IO, function_type_name_at_Object, dummy, function_in_string_at_IO, dummy, function_out_string_at_IO, dummy, dummy, function_copy_at_Object, dummy # Function END # @@ -441,7 +441,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -694,7 +694,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 28($t0) + lw $t1, 24($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -1520,7 +1520,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 48($t0) +lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -32($fp) @@ -1566,7 +1566,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -72($fp) @@ -1615,7 +1615,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -1650,7 +1650,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 48($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -1699,7 +1699,7 @@ label_FALSEIF_17: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -2796,7 +2796,7 @@ function_equal_at_Complex: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 52($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -3030,7 +3030,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 60($t0) +lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -3586,7 +3586,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -3616,7 +3616,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -3641,7 +3641,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -3898,7 +3898,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 4($t0) +lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -3958,7 +3958,7 @@ label_FALSEIF_79: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) @@ -3989,7 +3989,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 36($t0) +lw $t0, 64($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -120($fp) @@ -4014,7 +4014,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 32($t0) +lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -112($fp) @@ -4047,7 +4047,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 20($t0) +lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -128($fp) @@ -4070,7 +4070,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 40($t0) +lw $t0, 52($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -104($fp) @@ -4132,7 +4132,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 4($t0) +lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -136($fp) @@ -4192,7 +4192,7 @@ label_FALSEIF_89: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -152($fp) diff --git a/tests/codegen/palindrome.mips b/tests/codegen/palindrome.mips index d2b60c75..209e283d 100644 --- a/tests/codegen/palindrome.mips +++ b/tests/codegen/palindrome.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:21 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 14 11:08:40 2020 # School of Math and Computer Science, University of Havana # @@ -22,7 +22,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word dummy, dummy, dummy, dummy, dummy, function_out_string_at_IO, function_in_int_at_IO, function_copy_at_Object, function_out_int_at_IO, function_abort_at_Object, function_in_string_at_IO, function_type_name_at_Object +IO_vtable: .word function_out_string_at_IO, function_copy_at_Object, function_in_int_at_IO, function_abort_at_Object, dummy, dummy, function_in_string_at_IO, function_type_name_at_Object, dummy, dummy, function_out_int_at_IO, dummy # Function END # @@ -36,7 +36,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, function_type_name_at_Object +Object_vtable: .word dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy # Function END # @@ -50,7 +50,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, dummy, function_concat_at_String, function_length_at_String, function_substr_at_String, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, function_type_name_at_Object +String_vtable: .word dummy, function_copy_at_Object, dummy, function_abort_at_Object, function_length_at_String, dummy, dummy, function_type_name_at_Object, function_concat_at_String, dummy, dummy, function_substr_at_String # Function END # @@ -64,7 +64,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, function_type_name_at_Object +Bool_vtable: .word dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy # Function END # @@ -78,7 +78,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, function_type_name_at_Object +Int_vtable: .word dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy # Function END # @@ -92,7 +92,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word function_pal_at_Main, function_main_at_Main, dummy, dummy, dummy, function_out_string_at_IO, function_in_int_at_IO, function_copy_at_Object, function_out_int_at_IO, function_abort_at_Object, function_in_string_at_IO, function_type_name_at_Object +Main_vtable: .word function_out_string_at_IO, function_copy_at_Object, function_in_int_at_IO, function_abort_at_Object, dummy, function_pal_at_Main, function_in_string_at_IO, function_type_name_at_Object, dummy, function_main_at_Main, function_out_int_at_IO, dummy # Function END # @@ -412,7 +412,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -673,7 +673,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 4($t0) + lw $t1, 36($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -769,7 +769,7 @@ function_pal_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -1069,7 +1069,7 @@ label_FALSEIF_1: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -1443,7 +1443,7 @@ label_FALSEIF_11: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) @@ -1476,7 +1476,7 @@ label_FALSEIF_11: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 12($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -116($fp) @@ -1605,7 +1605,7 @@ label_FALSEIF_11: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -104($fp) @@ -1891,7 +1891,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 12($t0) +lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -160($fp) @@ -1983,7 +1983,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 16($t0) +lw $t0, 44($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -144($fp) @@ -2006,7 +2006,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 0($t0) +lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -132($fp) @@ -2212,7 +2212,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -2251,7 +2251,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -52($fp) @@ -2274,7 +2274,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 0($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -2336,7 +2336,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -2396,7 +2396,7 @@ label_FALSEIF_31: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 0($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -80($fp) diff --git a/tests/codegen/primes.mips b/tests/codegen/primes.mips index b3e9cf68..43bded22 100644 --- a/tests/codegen/primes.mips +++ b/tests/codegen/primes.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:18 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 14 11:08:36 2020 # School of Math and Computer Science, University of Havana # @@ -22,7 +22,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word dummy, function_out_int_at_IO, function_out_string_at_IO, function_in_string_at_IO, dummy, function_copy_at_Object, function_in_int_at_IO, dummy, function_abort_at_Object, function_type_name_at_Object, dummy +IO_vtable: .word dummy, function_out_string_at_IO, function_in_string_at_IO, function_in_int_at_IO, dummy, function_out_int_at_IO, function_copy_at_Object, dummy, function_abort_at_Object, dummy, function_type_name_at_Object # Function END # @@ -36,7 +36,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, function_type_name_at_Object, dummy +Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, function_type_name_at_Object # Function END # @@ -50,7 +50,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_length_at_String, dummy, dummy, dummy, function_concat_at_String, function_copy_at_Object, dummy, function_substr_at_String, function_abort_at_Object, function_type_name_at_Object, dummy +String_vtable: .word function_concat_at_String, dummy, dummy, dummy, function_substr_at_String, dummy, function_copy_at_Object, function_length_at_String, function_abort_at_Object, dummy, function_type_name_at_Object # Function END # @@ -64,7 +64,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, function_type_name_at_Object, dummy +Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, function_type_name_at_Object # Function END # @@ -78,7 +78,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, function_abort_at_Object, function_type_name_at_Object, dummy +Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, function_abort_at_Object, dummy, function_type_name_at_Object # Function END # @@ -92,7 +92,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word dummy, function_out_int_at_IO, function_out_string_at_IO, function_in_string_at_IO, dummy, function_copy_at_Object, function_in_int_at_IO, dummy, function_abort_at_Object, function_type_name_at_Object, function_main_at_Main +Main_vtable: .word dummy, function_out_string_at_IO, function_in_string_at_IO, function_in_int_at_IO, dummy, function_out_int_at_IO, function_copy_at_Object, dummy, function_abort_at_Object, function_main_at_Main, function_type_name_at_Object # Function END # @@ -416,7 +416,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -709,7 +709,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 40($t0) + lw $t1, 36($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -779,7 +779,7 @@ __Main__attrib__out__init: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 8($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -12($fp) @@ -2028,7 +2028,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 4($t0) +lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -172($fp) @@ -2080,7 +2080,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 8($t0) +lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -188($fp) diff --git a/tests/codegen/print-cool.mips b/tests/codegen/print-cool.mips index 207d78b6..182766cf 100644 --- a/tests/codegen/print-cool.mips +++ b/tests/codegen/print-cool.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:19 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 14 11:08:37 2020 # School of Math and Computer Science, University of Havana # @@ -22,7 +22,7 @@ Main: .asciiz "Main" # **** VTABLE for type IO **** -IO_vtable: .word dummy, function_out_string_at_IO, function_out_int_at_IO, function_copy_at_Object, function_abort_at_Object, dummy, function_type_name_at_Object, function_in_string_at_IO, dummy, function_in_int_at_IO, dummy +IO_vtable: .word function_copy_at_Object, dummy, function_out_int_at_IO, function_in_string_at_IO, dummy, dummy, function_out_string_at_IO, function_type_name_at_Object, dummy, function_abort_at_Object, function_in_int_at_IO # Function END # @@ -36,7 +36,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, function_copy_at_Object, function_abort_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy +Object_vtable: .word function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, dummy # Function END # @@ -50,7 +50,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word function_length_at_String, dummy, dummy, function_copy_at_Object, function_abort_at_Object, dummy, function_type_name_at_Object, dummy, function_concat_at_String, dummy, function_substr_at_String +String_vtable: .word function_copy_at_Object, dummy, dummy, dummy, function_length_at_String, function_concat_at_String, dummy, function_type_name_at_Object, function_substr_at_String, function_abort_at_Object, dummy # Function END # @@ -64,7 +64,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, function_copy_at_Object, function_abort_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy +Bool_vtable: .word function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, dummy # Function END # @@ -78,7 +78,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, function_copy_at_Object, function_abort_at_Object, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy +Int_vtable: .word function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_abort_at_Object, dummy # Function END # @@ -92,7 +92,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word dummy, function_out_string_at_IO, function_out_int_at_IO, function_copy_at_Object, function_abort_at_Object, function_main_at_Main, function_type_name_at_Object, function_in_string_at_IO, dummy, function_in_int_at_IO, dummy +Main_vtable: .word function_copy_at_Object, function_main_at_Main, function_out_int_at_IO, function_in_string_at_IO, dummy, dummy, function_out_string_at_IO, function_type_name_at_Object, dummy, function_abort_at_Object, function_in_int_at_IO # Function END # @@ -404,7 +404,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -657,7 +657,7 @@ entry: # Get pointer to type's VTABLE la $t0, Main_vtable # Get pointer to function address - lw $t1, 20($t0) + lw $t1, 4($t0) # Call function. Result is on $v0 jalr $t1 sw $v0, -8($fp) @@ -749,7 +749,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 24($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -36($fp) @@ -848,7 +848,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 40($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -871,7 +871,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -977,7 +977,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 24($t0) +lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -64($fp) @@ -1076,7 +1076,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 40($t0) +lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -1099,7 +1099,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 4($t0) +lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1151,7 +1151,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 4($t0) +lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -88($fp) diff --git a/tests/codegen/sort-list.mips b/tests/codegen/sort-list.mips index 6a1fd7ab..055615a8 100644 --- a/tests/codegen/sort-list.mips +++ b/tests/codegen/sort-list.mips @@ -1,6 +1,6 @@ # Code generated by PyCoolc. -# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Tue Dec 8 18:21:21 2020 +# Eliane Puerta, Liset Alfaro, Adrian Gonzalez --- Mon Dec 14 11:08:40 2020 # School of Math and Computer Science, University of Havana # @@ -28,7 +28,7 @@ Cons: .asciiz "Cons" # **** VTABLE for type IO **** -IO_vtable: .word dummy, dummy, dummy, dummy, function_abort_at_Object, function_out_string_at_IO, dummy, dummy, dummy, dummy, dummy, function_in_int_at_IO, function_type_name_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, function_out_int_at_IO, dummy, dummy, function_in_string_at_IO +IO_vtable: .word dummy, function_out_string_at_IO, dummy, function_in_int_at_IO, dummy, dummy, dummy, dummy, function_out_int_at_IO, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_type_name_at_Object, dummy, dummy, dummy # Function END # @@ -42,7 +42,7 @@ IO_end: # **** VTABLE for type Object **** -Object_vtable: .word dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy +Object_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy # Function END # @@ -56,7 +56,7 @@ Object_end: # **** VTABLE for type String **** -String_vtable: .word dummy, dummy, function_length_at_String, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, function_concat_at_String, dummy, dummy, function_copy_at_Object, dummy, function_substr_at_String, dummy, dummy +String_vtable: .word dummy, dummy, function_substr_at_String, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, function_length_at_String, function_copy_at_Object, dummy, dummy, dummy, dummy, function_concat_at_String, function_type_name_at_Object, dummy, dummy, dummy # Function END # @@ -70,7 +70,7 @@ String_end: # **** VTABLE for type Bool **** -Bool_vtable: .word dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy +Bool_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy # Function END # @@ -84,7 +84,7 @@ Bool_end: # **** VTABLE for type Int **** -Int_vtable: .word dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy +Int_vtable: .word dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, dummy, dummy, function_type_name_at_Object, dummy, dummy, dummy # Function END # @@ -98,7 +98,7 @@ Int_end: # **** VTABLE for type Main **** -Main_vtable: .word dummy, dummy, dummy, dummy, function_abort_at_Object, function_out_string_at_IO, dummy, dummy, dummy, function_iota_at_Main, dummy, function_in_int_at_IO, function_type_name_at_Object, dummy, dummy, dummy, dummy, function_copy_at_Object, function_out_int_at_IO, dummy, function_main_at_Main, function_in_string_at_IO +Main_vtable: .word dummy, function_out_string_at_IO, dummy, function_in_int_at_IO, dummy, dummy, dummy, function_iota_at_Main, function_out_int_at_IO, function_abort_at_Object, dummy, dummy, function_copy_at_Object, dummy, dummy, dummy, function_in_string_at_IO, dummy, function_type_name_at_Object, dummy, function_main_at_Main, dummy # Function END # @@ -112,7 +112,7 @@ Main_end: # **** VTABLE for type List **** -List_vtable: .word function_sort_at_List, dummy, dummy, function_cons_at_List, function_abort_at_Object, function_out_string_at_IO, function_insert_at_List, function_rev_at_List, function_print_list_at_List, dummy, function_isNil_at_List, function_in_int_at_IO, function_type_name_at_Object, function_car_at_List, dummy, function_rcons_at_List, function_cdr_at_List, function_copy_at_Object, function_out_int_at_IO, dummy, dummy, function_in_string_at_IO +List_vtable: .word function_sort_at_List, function_out_string_at_IO, dummy, function_in_int_at_IO, function_rev_at_List, dummy, function_rcons_at_List, dummy, function_out_int_at_IO, function_abort_at_Object, function_isNil_at_List, dummy, function_copy_at_Object, function_car_at_List, function_insert_at_List, function_print_list_at_List, function_in_string_at_IO, dummy, function_type_name_at_Object, function_cdr_at_List, dummy, function_cons_at_List # Function END # @@ -126,7 +126,7 @@ List_end: # **** VTABLE for type Nil **** -Nil_vtable: .word function_sort_at_Nil, dummy, dummy, function_cons_at_List, function_abort_at_Object, function_out_string_at_IO, function_insert_at_Nil, function_rev_at_Nil, function_print_list_at_Nil, dummy, function_isNil_at_Nil, function_in_int_at_IO, function_type_name_at_Object, function_car_at_List, dummy, function_rcons_at_Nil, function_cdr_at_List, function_copy_at_Object, function_out_int_at_IO, dummy, dummy, function_in_string_at_IO +Nil_vtable: .word function_sort_at_Nil, function_out_string_at_IO, dummy, function_in_int_at_IO, function_rev_at_Nil, dummy, function_rcons_at_Nil, dummy, function_out_int_at_IO, function_abort_at_Object, function_isNil_at_Nil, dummy, function_copy_at_Object, function_car_at_List, function_insert_at_Nil, function_print_list_at_Nil, function_in_string_at_IO, dummy, function_type_name_at_Object, function_cdr_at_List, dummy, function_cons_at_List # Function END # @@ -140,7 +140,7 @@ Nil_end: # **** VTABLE for type Cons **** -Cons_vtable: .word function_sort_at_Cons, function_init_at_Cons, dummy, function_cons_at_List, function_abort_at_Object, function_out_string_at_IO, function_insert_at_Cons, function_rev_at_Cons, function_print_list_at_Cons, dummy, function_isNil_at_Cons, function_in_int_at_IO, function_type_name_at_Object, function_car_at_Cons, dummy, function_rcons_at_Cons, function_cdr_at_Cons, function_copy_at_Object, function_out_int_at_IO, dummy, dummy, function_in_string_at_IO +Cons_vtable: .word function_sort_at_Cons, function_out_string_at_IO, dummy, function_in_int_at_IO, function_rev_at_Cons, function_init_at_Cons, function_rcons_at_Cons, dummy, function_out_int_at_IO, function_abort_at_Object, function_isNil_at_Cons, dummy, function_copy_at_Object, function_car_at_Cons, function_insert_at_Cons, function_print_list_at_Cons, function_in_string_at_IO, dummy, function_type_name_at_Object, function_cdr_at_Cons, dummy, function_cons_at_List # Function END # @@ -459,7 +459,7 @@ function_concat_at_String: sw $ra, 4($sp) sw $fp, 0($sp) addu $fp, $sp, 32 - # local_concat_at_String_internal_0 = self.CONCAT + # local_concat_at_String_internal_0 = self.CONCAT # LOCAL local_concat_at_String_internal_0 --> -4($fp) # PARAM param_concat_at_String_s_0 --> 0($fp) # Get first string length from self @@ -1060,7 +1060,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 4($t0) +lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -28($fp) @@ -1220,7 +1220,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1259,7 +1259,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 44($t0) + lw $t0, 12($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -60($fp) @@ -1282,7 +1282,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 36($t0) + lw $t0, 28($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -48($fp) @@ -1307,7 +1307,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -1357,7 +1357,7 @@ function_main_at_Main: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -1406,7 +1406,7 @@ function_isNil_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1562,7 +1562,7 @@ function_cons_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -1613,7 +1613,7 @@ function_car_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1693,7 +1693,7 @@ function_cdr_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1780,7 +1780,7 @@ function_rev_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 64($t0) + lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1829,7 +1829,7 @@ function_sort_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 64($t0) + lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1879,7 +1879,7 @@ function_insert_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 64($t0) + lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1931,7 +1931,7 @@ function_rcons_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 64($t0) + lw $t0, 76($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -1982,7 +1982,7 @@ function_print_list_at_List: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 16($t0) + lw $t0, 36($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2138,7 +2138,7 @@ function_insert_at_Nil: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2256,7 +2256,7 @@ function_rcons_at_Nil: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2571,7 +2571,7 @@ function_rev_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 28($t0) + lw $t0, 16($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -16($fp) @@ -2606,7 +2606,7 @@ function_rev_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2691,7 +2691,7 @@ function_sort_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 24($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -2906,7 +2906,7 @@ lw $t0, 4($s1) # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address -lw $t0, 4($t0) +lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -3021,7 +3021,7 @@ label_FALSEIF_5: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 24($t0) + lw $t0, 56($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -56($fp) @@ -3044,7 +3044,7 @@ label_FALSEIF_5: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp) @@ -3181,7 +3181,7 @@ function_rcons_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 60($t0) + lw $t0, 24($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -3204,7 +3204,7 @@ function_rcons_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 4($t0) + lw $t0, 20($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -3265,7 +3265,7 @@ function_print_list_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 72($t0) + lw $t0, 32($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -8($fp) @@ -3317,7 +3317,7 @@ function_print_list_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 20($t0) + lw $t0, 4($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -24($fp) @@ -3346,7 +3346,7 @@ function_print_list_at_Cons: # Get pointer to type's VTABLE lw $t0, 0($t0) # Get pointer to function address - lw $t0, 32($t0) + lw $t0, 60($t0) # Call function. Result is on $v0 jalr $t0 sw $v0, -40($fp)

!RB6R+=i@^nFXcjOmnvd_R(&hrjA3v!DD=BHy_ zBn%Vfq%T>%io(!2K+_ssC3T#HW?d~@s&@v{}K)21c~5wPcaP(lLv&J8uMFo@`5>-bd_Ze9(?xa!&KG1D(r( zYY7tSZW6bjJEANb%`4Rt$*rT}Di+y0J)*&AUvt;VG;7<>`P6<*7tsgzear zoimV#QtoXB!z2LRR*!oAc_L{Xs?8({U@MJwpoA^Cp-L11nZwC)F};l;7R-D@wi?H6 z6muu4>_>B*$l1Kwo1u-V9T_x=C(&5Pq~$ltLAB|suVB&kRgmtTQf`%dfjS62b#w6< z#iOAa0MzHWnE0&WucTo7m?5$aiy}dMzc|-CBNY(UZQA;`f1H@dYjnRnHXdPCiP^E4 zdJsOuem%je9Z9bTNUg(2NU~;6=|YLf*FF^-r0tniJ`i=df-lzt&BGP-@E?&QxTYcL z7AC!!o5W}9Dm;-9%0Oy;UlUd5w1FX9Q-)OADuD#|N zoP7nxC0IN|_KU~$F1+nojet0yZ{j3O-led4}>jp zwQEOFgG79Bf4FMZV@i>{0H`9n`bH@`1YXLU_|P{Gu`>NEkCH0vwGTN#ru%gOyvT_* z^(sK7ep6DN(98~}^AL1=w(KAq`dw#QPEB7iu;2${6$dSkKoA|_8HPZsdoFen?@lTU z?VKTq;!rIW&-L{#m14^M9QB^^kP2=in;T%t+}XveuPo8Q%oZ=XhyKjL`rguXsm(*^ z>)o1HJu!hD(6lu<#V@JT+%I?MH zrzan#n&T(&U(|F=GM~9u6X;jJk#lh0i0@P7Wa$LxD!V$ak9D9Zo3Cb!k}BTG`a1-R z<5V6kmIfzL8y5ex1X#QPGp(OM!{~Pur~oxQkDC0_R)~6?aqv=&orq&59@?CVyoRgZ39Z{?< z38x`7r}?RFF-lv}V${Gg8Qhw<6ZClApxt(Mnvc`X+r?l`A%i{W{3TLgHx+@qEZinh6zT1UrxCBK%;&R+=w()-0IV#HaA_B>^4TlWz zbwmIUtIfm;lX@g5`Z?aulI$$#08!!KdH6010)SBMxq7f^m?#{mbC7Uv7j0ui0|3%a z#9YkyB#v+m^i*`3F0{y|;6hPshqc=sO&DFnE@r0@+1y-CK+&D_LUH=?)v{w%CWCU7 zZ52w$7XSHxD30lvJZ850?#;tq(lg>>R|xC0rBAIVz8gL}Et9paQ|G37_r|Zf^Uul5 zjjg;gEh{H?BTik!-~$x$Goh_nAt>FKDfc>3MGbGuG^F|zbPj`eP%=MNr?}R?XwBl3 za}5TyPZ@rfF6v%KktrkVU)LIXMwI#9>)qAcSS^^nTwgx{w>ULU2zAQIxW~scPbHu}fXj7jsyLD(7!x4ZbL+qpOWsh^h$?7L7*LUop=S@JIcxdXdYNXMyld%@3;h^EOW5&a@`q#_S_Thzi1x#SqP_Qfei-^QS5 zag~ueD}XeRNk|e7B2GUg6oT3|1qZ{M8N8c8AqN|A4pTPt3wFK3WDljQE zaJIvQ1rvW#)B!W(;m2A_wV^Vw&<8)4NcayfjQho#-apmW# zXb%|%Z(}&k55~SY3aHcHB~Z|b;H>v91EV{m&i<8} z4UGSXye7dvQwD!aMf^*yf#vU+n1528S^mtv{HI()wfaU34lBYZ)%nUOc8IITW#bEl zK!IOdFpLPqHNpTGnN@?a3-Zv)4K+^Zd5+D)Fs%qtHCg7hy^dUV#SQm;QnwM1FL$~6 zB`UXGy_hC``Kky*#zJwrDsVA)R!pp|^9hL#?> z9u)nGuQ{^7_4clZ=Cznky;<(GS;eJhvzv9o#mz&uYyC>qrQK|aPbV?9Uz9qadaI0O zTyV3{o)YGd*->*%w(YHfQ&qjl_Ad-^zkjJ(Q=p+hskt&DC2Z|Y8b+d)x229pl4!i) zlr0`z@lDN>7E!C%FG+2<^BkLgyJW;)K~6=FmznK$SZFytbv@5cR(@m{swX7#mu}&= z(jX)c-qymKfH8!2{){0yEX$Vgvh4ltJ4*-0P=e)X)&aXR8@aJ8zVI;0r3EDIy~1w^ z(1nf=k^}TaZa_d)nwNB7lmcSRzrX?wUCqHlNIXx0ObFz=k%>JeRLc1@6Z~KuJ*K%? zPc{~DmJ9e|Ycr$w;l7*k?hnjSk3PG2n=v@PauE(FhE*$Lq@{>3!=dG4fET)y6~S*K zBC&#)C>iukc#{uwyLpH zH(0h`3c?Ca>XfQ&=r|VZ`OJgFW>UQDV(WEkQ+A<@hL!N=2$)7B;*GkI*dkQ?Z5-p;z?4k(UKkLDaC)x1;4Y+e}PVy+$D?|OgMC8GPP!>%9h z_Q1-~Q@4D4?lov6%3%Lm;mS}U_lux9Tcsw|aPpExi~uhO&h}VN&>VN83r>DI9iYLK zn<{L?`IV1B-N{s!)TA4UTH=wKJdAgQVnm3xfv=fo9Eg@7yhC6+%#Bwdnu?&}PQ*OW zQ1*zAK!+qNKro;o4(`oN<~#WtT+7PEDazOJtRl{F^b!;^+m2#96b6X-9NzRnTgj^g zu^@1YeG#}D90m=s@|XQSD{V0PdeCAT;&8vlFV zwAR{I58_6>K*{=imS4Q(jZI%s*&9~>5~53_WJymXZ~>*94gz+ z*lo!EmA0Tr)YYRKaxOiF6l3c4I^kDYQOd<;Gk}QTSfg29P+GK4`=``1tXs`5PM zg_P;qacy76tkXj?Bu@f`en1-brwk#_S3YBhJEYa)r1)7GA=bAQTFpSGHMjj_s4)%7 z*A4AqM|9P6ECVY?EO`rk_kS)2Aw1`m(>9b>k19LTB-~NHcm;aB)7#|N)Bm?8`|lI! z5ApyT)8G7^S^lmK{Xak1|E!4n+sXdNIru*#60rQeI_Uo+k%004rJV2&BEdh)3IFws z{$0@b*I$YMI-~z8O8igdNZEhz0Y%+eBbZCZ+y)toq1#N>TY`IUoXkNwC(Nv*rV?0aD8a??fQ7Xf86VI^>uf5yu6Hk zn6IIS7?j>@dOulMIu z*+vzyJX-1x8KZUcFC*jc_nxymZ`ar47{PifgSUFU_M2y}U!Du`H~GCctw<=;rU<;O zL(4JOhilz7EMBfV9}uFsPOXg2SGk2D^*nLYJ8?rxS}TYbntYCZ%e-;w(_47Gw5xw! z^WR)&PEc1-Y=+i$x|oA)pz_7^y+2KFZQ@_XLHc@oc{sjI8MflH8LpkNBW%;KU}PQC z#cUtaXLdU@vWyhhOL$P1ov7(iC0>#7JooY(b7WZUY`|`BE#7VEtKhy{*2cWsXf3E$ zKA$t__fF|#$;p)dsA%E}T=|tqJLmDL^#3sTPSKsj>$+~o9otFANyi=AcJhyH+qP}n zwr$(Ct&Vjv=U(%ix%OFm?6vRqUDZX6s!?@ORlo0f-=}OHhIaGM&5P4bw(>lJmV%kd zvHhWt6NH4!^$WK1r+#9+7PGN<1mClE#sg1iIxhk?+G|U|`=N4w1JZ=3#(PlsvEaJQ z^AUowX7j$~1H|)?A`<*GK-DIGP)Cde>|;syd|4;v=5sJ;(!bPck{)J@=wsOoxTrhb z6qsodbVvs%y1F+2Hyx8u6FMDSTbZy;HAHZ+)8kk$VhoAgiB0@t#i0`OF5wrp&xq&7 z-$}iFD?*~#tX?n9eVMX#GUnj02bnKe9&r^(6l#^MLl-OT`PEwdo`@`a59GQCCQYyP zloLasy?v?nh9*%lCW0Y2s}4{~+BIj>_0E=Zy8G!hC-|YpCKe$hNX3$IhL=u;hi=x) zkHwD{KfYUg55`$lX|bZ~G}~YP3QkH<9*Jl5+N0~k^*iL?dC=$C<*6ewpSJPh2FhBb z8B@QSFsSLxlwj^#uf7+$u-D__EUoB7V?~A3Px6jm%61$^|Zri)U3l$Sl}P?sW7Dr3)sp?tV6lPtNvek^WHb zqrhsLYHzb2J^Ykmm+B1+lLky|OR}J+b-doVS+8Bi=Dv;)r1HiRjAe5i(VCF+kVft7 z1yzQ0z?(~Lib>D4CYZ#kw}c#;Q;1YWocJuiH+K|%{Rwyp=D!j`-|EXqV`q(F=C)ry zD{9TH6BzNj+#LGtLb!2gKjLaKWcb7T9#n@L+6C~g@q;r={jOb+k>fGvGnl1ihGc}{ zFBQ9(S6Bv;zoyxn_`*2k5`h9OT$=Kk0My+)?;NcPFJ1fIw4&k~U(-kEx-Zkw2cD-oiLN;{~|2FZ!0$!rjN)+R|=!?pRpaTjmH6D>| zEY_v2Rhu-FKcVGycy6RDi%EFTPqB z(O<-{0Yd4>q$adt5sPVW?ptMTz2}|-DG}-k{gpr?QDfV^(JJVRnmMKxX|@aDJNSBp z^hc_zO*8!%bAAd8Zj+(n7^fzff>HP_$cfG@h3eH+5ru)Bq8bzzwM!r@4tz#;y`noU zBAc7zhp!VcXp)@@<*r#vC7&9!g_Hbe2X31}dOYwbe^{bkh#^L4Z`S@U!f{oGgr1e~ zUh4sKOwC1O~r88Z}(T>Y!Oz=&eK>SoN&M1!(q zsXBb1*Sulu!t>QhP>~KciF{C;ZWvy3Z|B7Fc%ZFHz+$NcTy@Gtzqm?+4Ve!_<$50) zy~spVK`@oYt?LKP7Z#lZ>_S=u3_RKEQuDG;kvUQcln+*x0JgQ#hgF1Vh zJ#&^@86hqv8D}`*%&!i-YPrT7_~)OTq70%^gR70-ReG3fjt!uA8R<6xIxzZ5?Qp`k~1z`0O``FzI}6G!9q z6I61vT0c11-{Nu3l1j<5b`D~UyoeE@L8J5(eYH-4RibVtUCIbAonI~udmLD;HEfcEey1dlTuMts^PKPUvackK zBB}&l#G7^-%$r&T6Ok50N-d@Kp&yb;KOEe$3s*wzf6O4MVG2`J1D;gl zGA(<=uuTT-1&%;YC;}bxr=RWn_1~zD-GaO`#9)b1GwJjLs{=s<0(4Q(tZCGC%f`YS zAQetxR4eJJb(ny!0<9J=a)K~q4W``v<|;){r5{r8*@#Zk-OUj-R~s@a5+S)8d`pR_ zmD%%_d_peyUt_lK_PNqGlGdXtCU)+%OT(HQnAD*b2v@If3#eB!fYhYB(akD*G#K|& zpaaB`*AODSiN@81(7)^Y2!H6za#fl++JuxX- zl$HF=YWeTJj>Pvi@E)DOyTcRVFqO*QUH;I?YNdFu=-E=9`ams4>P)@~2yJE&S&K-{={|Pu|qe)RwN~6~tX4^H>6S0w7 z0GPWyM#izvt@zf*BxR}iinU(su5sHDQMXH^Ju0PL`0_G-hRkf;Dpp~!Je>akqa`R` zyGvIQf`mnJDAdTk6%|x-hx-K!w=bs(fAw=NGckip23+xD4Yf$Sg^nCxiCO$Pq?!0L z7~*v3Ot(bfYM$!PkuoR6!unQVUeSIKm@ycJW9$lP5&7RTwl_tsDzeAU!p?fpK3R=R zH@)rg)M?T6T1ksY2M2JcP)|KVlAV~^m{8){hCY9e#1E2_ohZD{OVQ(>30g^JkQBB| z4zM-1G@)MYd@&WOZ3OjEr#|=@C+cRKDThX4*##MzRx#=TE@gxhlB1aOH*p-KdWDu-nAIdnj+8jcT*13@i2;W>$iN%Y?+%mpnrnVRcqWCnX zwl0~S_Rj~JR7NO_V>0{$%qpi*R<~T(2}D_ZgkC~$z3ydA!B)Rq4NncV-Y#JK-~tYF zN-hD*%N|@`-lLzn$*5GBp(M9WMC92ehIQ~#CjN|PMC?PGE^Lk|)XbR~6zPHXzG6{W zcX^=4%zt)i=L6>RJ6nOLC>cj*H^3~%bQO=wB&PYlleVU9cF2+TuUdd=PE_W-1lM>g z=fQHS`)S<8K1k{-WoQ6LPZy6cm__vZS9#Tj!t(5>?k(cl23Iq_lWKB@k4@SoQcg?7 zZ?p?Y!P(OIQNbQIU#}e)b`kubzt`Iv7|M@fpZ1z$xTM`Jx?#2Qkhp;C}y4S=yymNpTg67Nrr*@n_R9mLbCM*8ADhYzau|iZaO7>UJ7p z87m;S$0Cv^>c%!qagF0M=W6{6{ZD)-D`T_TV(ilPEqLwp(?ShnJLWmoJoQ} zQAa6MMx}mA&y_K63?*t7h$ZI~%; z>T$RDN2V?=MUuDbB4NSO8LlHjVKh~b@OFiqpKq@hLTV%)E~>H3jJSlRdwRkXxh=J{ znt`}^cZuy79UnadeUM^{0U{yir5J?R8doj{ia~YX+eG&Le=;nW^iOF}#}$?AKwOS` z4h+&?jr_5)hsmSGpn_kI?;SJjMD!rKG#cjz+e4LzDLe=7sU&7~eh9y^Ztwc;>!01yg94&%;MusSCkvN3&<%n1|- za#4(F3<97y3`lU%v3^?vR&3F};5Hz*DUFwKS!PJ5XzUDH9ug%bDOjz_^PoMPBHAWE zxUPGSr|f<$pCMe8jQGr9jQZ5IGvE(ihBWet6bc5L0}|2&+mZA^C+2U61gaVEqCg36 zhCL4Yhl-Wk5wogB;26?OpN3E$>o^+3ua%?V5s6fWqxv-1Rc50GrW9kAD^mT+lL3gprHK_D!3I%0_pYx0l z9Y_TByISRt%%T-Gd$Yq|6lR`I-g%b7g=v&- z?;sB?RP5k$R~E^qv5YYr3P1RtC_?KI54F>I6i`W~hg5f0Xy#jmLlw7_;zls@UjzqdT5;!x569bmwSXddIGMk05B={}8@Sl)re zY@Di!!vy>y4B0{ZgHV2DE)E>&ct>I*xG^h)w@IKfLUu zP1UWG6w+UGRJQKao%J1@3~dQcOgjsv%z>|{1Y<-}GzBOT*J`c=%W$scHu`+z>L;pl zw<0Y1c_yvyx2M3(S4-gY2|@&2AnP}Y;G$rFWVAg}W zG_GokrbtuOF5Q0qMFG5N%T~rW)hI|f+4fYV05w%W*f01`83&D#T5){kUKjlj$$0{n7;EGT+p8C)>>w7TNz^5?&*ARbsp zqlc7ebMxxyB1c-l54iCmyLRELiq0KWZv5xpoo~CG)L;_%A~<+*P37sTLLcwF!^ zDX@KZq+>*|B;n}oGc+muLD6Sq{qR9V$gM%jI?!%w()Xj)TZJ8ew#^(ajQ7_=&D(+v zr-&FJ6k)KFHAZ~(@NL?Cyn_ak*6J#LSgLJOWLc*0($7UwL0b@&S&7&G-e3%F+^}|o(lTw{IYOV1}+_q5@Igr z9DZV@iO;G@#F>Ap+zeVK7DSoUbTAnZu}6yu!>0=ARB-pl_QOG*#NJ|SM{~k)BSL@3 zI3mKk9h~KE+((}vI=5O%Yya%JVT_)`c_4n`T%^~|I^7v<4Csk1?)G*ZV+H*nXwcM2 zd)-xt+2l9wf4~d(gJ~L8ZQI!4i&NuKj3_oPh}5!AZ8UQohy+M4x!!VFT>YNOMixIL zr>AsDL&qKR+bUWt39`AcW_lR|4(o4lH7P z`vKeiG+yE8KrYnhl!C)ZGmtu96wTV$h9u}Vwm*zasXqSy&lAdM;q z3wFwE>h+;MS+Wz6N+u@a?i>X8C7+5pth)FIjyqj1^|wK$;}@=0cMNIEct5p}BiB~9 z@il0mxZX0u^1^6(t1lgl8QG}9WrA;`53jP1{mLT$_o~lHo>{3gml&tm5~ctY=as0{ z`DVs89j$~W`RJh;?JA0hYS}g5*P1=%rnog3Qz6O~*YB%J7iGjez7QiLaEhDub-Kq& z@MlxYH9(`$DID^zB}1aNXEQ0U(8-~qy2Uj2!!@RE<5E>%6&=$n(rxOxDe>ZCxdx+M&hHhxHaWQOIaVz+Ya1Z(>!BHH_61Mw_NP32O)q( zXi!tRGCrwsAmX1*R@U7n6ODjY1AjrIxNtuX-28D@ zS1+SJlG?<|#l?nd*E;l-IR9GoGy{5|$;$1QnsqwLO_qRXyFc<$GH__#=FHoYL2#66 zl1PNOWWMr|fKh8~5wNAjX=DZ`ri`M*n5_0Bf}{W_#CYwAOGRS9i_L;2)0Gj{x)hQY zI?lqn%v87Es~a3d#f4@S=X_uUNnyNCet}@@sUZB9GoF888qD-;|3+^x{wqWJkKpEi zf5!74sK&p~c>bdp@xMcF{CfoRe?Q~-U-v>X{v+r4PnzN%O_2Wy(fBtggI4(4hKm0` zuK0f%{xJP}tLFbZ{9*c!UdI0|ppmJbj61C8vprqSdgEY3?J)NQ&B-RtkMhTss@5gM z#Ri82CL-U3ekkB8zI)JmcfHYB(b-Yiu@Pn}?1=E;%ClQJ)4IC5&C9*=d0Uoc+19FR z8n5ch?xX)<__}Jbv+Qi_!`bucp|R@Pew*bA@9o++>-^1qS##Ud{$+ML$lbBB`r6C6 z^P#{0VYB<*+V!UR8Z^yYaO<$!dhL~)2BC`Qb(I)_hWGj5;qi5MP1Bmk`^Uj0!_zT3 z{PLrl`?1%T{L@D={IYjv*IQucKIqWo#^#&RU+d0}x1sLE-ObJEoz105&x>KN@Yg{^ z__MIQJh(hc6s}Wq<_25~j5p4fY1~R{B~BM?ATB;o6AQhNvQRs3Uy0%ylStcFW| zb~|SP@+V)L-ir*Ja*d$VScD3IoY`U1rMk`P&kXkLkJoHmRz+yAGTJv1Ys#9I^y0S# zX-BlCyfSgH3*Z)2RxQPQN0YTT*574(Z+s8##re^+Uq`Z^&o-W5L|yhg9fC93ki@#& zU%FJuDEenjollh`Q=PEt0>=I8R@*KtZiY_IH}A z%k(Re%+NibnTVPxFg!h(rL=Lu8Vyo-Be&l@MZ>qSRQCs6WoM*q6E%v~c2o&>SPj0F zy=-0N4Mt0FR;Pb*!*XI|X{+{tJ*MXRD*4(v2Jb2`G#${b@&fem6ho>Jl)XC_%^>Q% zQvX6<0V32?Z&(J=1wK4aD8BY0mpq{$rRFz>O$T0Bksf2bAdD~q#I8?6t)Vnbcc8w8 z2k7x9vvoCM-rwjuYTK9R6M~-Nk+1 zgh@R?0{zfFCywp6EgszToRfkz(Z0AbwY9!(uaf%&tVnN%yBVHKWoUiq1!pF1e9HXw z@olsb^z^F`&1J8%tNDVz%bT5ZR40$gbN5VDIz33s)3kDz#&^#`n>EmJmOtafOhdv` zimj%6-flkn3vtZOs#@Va6^(s*OpcXkQ$3XQFE|VF;3;&2$o1Mcvc}eAqvt!T+i;3& zCiN>qP(3ByCF$99NW%0f;`66p{x~o|i@~m*xT9Fxvh7o^eQrhf$AFzHyy;ab;nIu% zpmr*t)wW=0<}O{(0ge?o@P7qCDfsv&)4eR3Rlr4MjC^~=XxOqpV58){n*XpXV>G%H z73E>c$6ji7q`lYMuI+HIn==Ne;zO@g7_^UV*d=NzHxgsGn=!?=dV;A;)XQ#%hM%V4 zUc(BLpEx5O5A|a2XF(#Z1Z4XP>eGbXYM>Y|%RIH3Gf;JLAqjdyCH`gE?72s!aWhs- z0;eH|d`?&_&;LU*y!}$0qa}ww3)m~g**Ckb+lN`HCH&g{b9=<4CXIL=bkUeaC-wA9 zF@l*$3d|(_aevz&wg^JH2stTsAbTu;xX@2!*y8Qszj4VU5iO7OL~Ot@M+M6_-?=~h|S^2O6bL3ZSA^Id1xmf3rZplU{U&wtBG)FlS|43A)! z*Q|4hM>58<=r&!=c&UJ^AVi027J{=zrWj$(>>ZDY6W8*L*bwoMwYd?VS`?jeM}XK0Z*@;9 zPOX|VgtrvJMVS0FRS?%21+69lUA7eP!vKQXhm0&d3RfPKpQ2HRB6 zBccm3y9Nuzy^M?(LbJQqVM87{fbdJsAu<426`D-=T+K6_&W&)YNNG0O)GkV+W?x^?y1Ez7T*#v^OiuatB@HDpRWuI%4e-|ect2ft>XrPMl zL8fi{=Imn@_{u!FyxwdISrrl%SH@tfZb>#p2eaJ$3n7PgT#V8Il|^N#P;jO$Li>eD zdNp*e4v%sZd&x+yd6)AufK2x#oP@3)vYzs`4YNCvL#bEWN45+a#=jxJil4t)rFkM2 z)1FwOPrwU$jXxVF>@wX3?&X-M^S=UE1^eB>)x=)5{EkOS&3}T5#OCzQg$*};E60ku z0jPp3(BfMFm5B?^16eB8e5V)_3`QDJmHYX^s!@Pw)#hIa01`V5OPzGYIN`&%srC#V z_BF{0IM|v(hmnf0ogC(}NLdF^;zW{yycaM1SPE9`%!Z{i*oZM$Y|LElWIp$*A-(?33l$XWz%Is6st7f(?dyo(0E<23Xaz0r%@XF>`WEV_t!JKDRj9%yLRW?cJ|+WyEQ z7~l+&MuR_=egAVFRhU z#J?K8ppNjbru?%j7|kuyJED$jG0cWG3$~hw!==UL=eieif7`4g@hnV8R*^*?E2NfO z;$Y&AUpd;`$mUMe-4Y?G6v-C*m;xi|qzbL$+5sjmC6FA=vUzO9;->-Uf@f0eJ>MgL za0@!>3J6n7y5^M`EH_#4gU};+uGm%06L-TyyOxUQ)_(KB6BndK?E`_5!szzbTod{q!YQWjfLOg~NR6 z-(?b|z8V5F7Yi$XTQ1gQukHMz$5^NAI9F=%r33>mcwkjn=wv(bI;(3K6-U5anaW%) z<`PMwDSz}G{mI+(LjkxKzy1s-E$h{8CvMUovN#j$q15+$BBfUU7uN`P>K>j(e03V5 zzdBf$Jn!iIn;HeCHCB0`P)itTMhJI=h6twKA?sV-OC8OqJ z#x|i5Lw9=&bdbvB3lQQ63Nk3UD>B4&hBO z@G%bReN^hLUm?Ee4ymJriNEGQ8fZZ9ZK#Ft)I6$Hgr!V<7mUw}JU_A9abdZqb49R; zu$K?Ta1+`xR+a7!Ez&d9;^+R#SYUoWuJ6j&-iji1YvJU(vp??gf5G3;(hHZlnNqoy zU^}0`VA@lWWTy#ePvV1_fh)9TvCbnF@&Lk13tWDpbGJ&GtF2HB57;5dq(??Lgw(OU z#8Kd!Irld)MGX?wA=R{+Nn9BA$ks64zRn#!`l$rgk4t5SlFrl~k*QzRA@d%^`5Xbh zE4#NRGSo9yqoi^jJ{s3E;xWV4Ognzs01qnx3k>Fl7r-DNxq_3P8ZSc7SY_U|I^{w$ z!mKtqK*(Ud$UYQ|fq)x=5i~atroOniuj7Z12V^!O6;u)OI)g;9=_`x_(hcs0B`m=z zI3PQTiX-f==OSJQYGLnB!>322JTtZj2S?37#I!QrljKX(hL(sbsXe`>jqMRg$B@Zs zI-RAHn@D^RRCJ7_6njCPNBHY>3rIv)3s?KhvHt2ODTd=fEQP5TX*<=V`8r7K2?==1L^f;q190*p@a zHyn;iIkC*m*(Cb;qKM~foInZ(5mY_-itKXx266+bIECz4`e}U+aef`=aXz@~6GZ1Q zYNVAgN-yleddF*~{#ZrByHyqQ8UU$CNV#$TEw^(#MwxGYAVv+2NP(dpgb1BoW9H0ofgU*gR*;(uWV$r4 zX;pao(a)9QNrT)gW?&3YDK#q1VkF? z{eHg?DPLLLA%K^Z`=jTX9`Z_WKe>dY`c|c$maZXDMY<(WiN^dCGo>Bf3aK+56C}8` z@UT{BO(i4;9-H(6xF)B=o!z9)JVbNi?;=HQ5o+RS$;g=Lc9E~RhI&KwPg4WFmVLkE z0Kp`$!~MG3NVuwo=hf{i*V&1NUU8Wh#G9YwVJ zWnZR#(z7~m_)B4y+wHv7OG?UMFA7V35Anv+FV23vB}z)GcjOyJ6AMva8YgzDE|yv) zGM~k(9hmWZh#78gfBzz!b=DIUMw{}(y>Ji{Yn^V%K?3Ej8B_#o;U;|T5Y0OY&Z>6< z?_!Q-^jjB7Y*d+sjSr`X4clZGOf%RMMj{E+l^!((+DA2|3?Q<4eaS zh+I3BFjn0g)fNRiGnm!F8im0iekNAL5((NWdN9CL5wT7s@AOx}SAS%**dfZAR8q#Yj)@zIsh|XRD%iW~96|8Hu8qU~5VvYY zvQrb-c=jK>6JO~q&MIey*HInSW%fK8s#(LWH_RN0@3{S=@+Xd@y&jzJg*DT{W?qxc zujC4BP?a95d!j0WIy`I(r%=;>&A0)g0v^QPzaLNdJr$xx4o6Hl3dklJA^j|tRf*wy z$v(clEWqBF-I$6;0p!y)SZV~ttGab5lsk6=nQl2lcKU~Z!~O#?rV+g4fc+1AsW(hQ z{vakJlxUgSjVWT22FCQz-Xsynd@p1BhEPZXGFGmHNUGkahQ!f8F=Qp%ALi<`7kzSl ztD|=>GqoufavKOxVcdiGdnlZ~l$nS#KsALHDwwHB`ebzkZ4)RY4y<7-S&ji|pT?GflqMzWL59apSE-u&bu=>4b^SU()-)Un$OP67irp4i+8_$j1@ZtY}f zYwK~M1usy5LK*B$PBUUF9tLegf;o~`5LlIU;&v452R;h6!gAvrkYL)UOpSvr-Yx!g7-{b=w z`ym){HgZgUcE^3Vk)pZOQqmAQ7XEj+ROeg1<&hbH0;h0vx^Zom4J<+M=PzRcXO{Y7 zriS8i4cKxO=m@xbSw#_thYx&QBpiVlz=QyN8BQ$p>?;WFPKHVgssM zuz_ToJ-y;o!xS88);wB$_DGE`6y9-ML7a8=-Vu>Q{H9x|gV6PNOefF{nJt|@345u( zNgHj1{Ge`rkZKA>Pe(DsSM}g-P8fQLP^z+YJE7*T?k)Hh#Vw-lx8q zvr5S%iY0S=e}CA%>75(Mp3nomH;45vh>_QIt8qSx3zApv5pmc|N6c_SVJR+8Fg}OF zCGf^&jT&aThVTH{qAa#V164GPp&huWpE3aoV+;hvYo2}LkYfvy->A{P>BE|?PX$c+0?2`W8sHZxbVuds~cYK_u%1588|9E>zruu)_1gP#7<|vgkEeo4dXa~*Zy23 z(3S|BojdxJ05_8hOJNyFcHOI>)`GC#NG+p@py6B*=vGZabj}I z5iQ=G%6Zg@pzX9`iP8K%8Y7~I%Xik_7!f#K#H_8O1863`m!)^qZKC3?$}8FNidX$r zC#WgAg>?K&KzJR;8A@QQOtBUi#)MEJ+DJ4X)AH0cJO`)K=?EAeHfah6_t4s4&xssj zLYs4*%q!8scH~q%0Mu+t7`gryh%sXT;@&HkjWBG@yS+ia%x{0wdXqpXvV+$&># zSs=E>9!lkoJsQJy-?-Cq8!ji7RhRGNfZghTaPe3Kut@+-P5)J&mWTPsw_kBM!QX#r zO%8L>mLnC1t9esTABEzIYbo0V7m6JYqZ~#>?m<85^@UKpO4&b-%W;gvl3GON)`dDa zNsHYO!!aqJ+Hvuy$w%p@)> z-lrL(IthtuwS16YHg|$Xd7g$_ZMOGF3C~-PsbT_&t@^IJDyp-KC~wJq5iD$zL2K8oU!hW;%$0 zCRd$NTv6qKX*rC?9|`s?{`=U4Nw*O{`9q12z`z~xVU1*X5`spSxubhNciINDKZnl`rDim6?B-tHxRq!pCrI&rYMi#e?AKU|yo}(-M1`=8=h$I& zuC4p>pZy7@rouqKfk`ww0)`p%Sc-*eqWxC&Z;34;y6AIcHZ1yY5u~~Da)LB;l2bcr z;&C-B`(qVeEivZMc>lO#i&@cpiP?sE_PZ;_qZ;`j#zlh=qSMT}4Tj?4?*qVQwYh`x zaNrK-oSn>Ncc?}Lnw8M^81(ac3Ro@!8G&4rCSj+hy@18RpTB+dpx>-~!yJH|Taa6(&hAXcBoKY2bEX z)i<%JP{X_bh%R&W5X`;Xu#8eY_#kpc6S81~Xs&ka+;+>K@k2KHxqyr0vaF2lzHCkc zu#nKmzBx*b&*1Luzh7V*OOg5=U&+2(TSg zwF$g)z!|EPV*-pc&x%4}KER^)CMOW~eo)a(%h8S`x!Z3o&V+$|hccNC)c>$ z-SyK6xxWevlfXVo&B!qcD6K{Qde>>S-EUlsAJsNgj3-B(4SI;=UUaCp61c={8K=P; zPFff)>&F3mmn-XP*_yClpnPf0a;tjuQne2BbQ@HwXJ5Res61$_y8W1&t3kGxZMDqX z>sNsHNzIu6RgjhgLy|!NVETE;>XPAAWgYi%+rK9r#JHSE*U}9Ue!of?J@(cnq;_b~R%(70Z%I_S)MO1{*WJp}ypSERrhaK%u^I1ToyQ$3zK`FZK^pi*Oz>juK7vio zPdFWZu~6okY8);xvYo{ZEnN|-SZcU15+!J!hp!98{}#bBjQ8@$fu$xnO47HBp*x$D zxUG9tsUT*&nzRHbRmV2zY7Ui&a_1MrH-U}3Z9pIaLA(5}q*Q9B3qE1tAq+(QlEGic zw`f4Nmx1JvGcJrd+`*veSZ>)#(xN@dC04^R1CF4lDMN9_iL;K&E%E43LegBhTPn?+ zG}(CJ(<+gh@e1v#Qb}+NEvQNK7%;dZ32S(?kb-+J15HdkQ=<7C;~T6rD<$xYP^~3T zjTe>Awz~v?d+b?V5+kUo`Qr%Ku+mf!{hW)yy#O6$#gzaqh}M7yFsB>Nl7)Cc;zba= zmLu^?h)WjivpZe*5vRJmX<15egphljEZG@Cb}jAqkEq^2f(H3X)`V3rJEomA@!)5o zSITN)rdfCsZ%>?&rBgxT?bG;fUV0Vy)+qFB>7}_fd`T34STFq48rG!=O`z(K!ucUn zhwNi66>X@^Of>nIq`08_lINTnsf+I~cZ4Xlt%&`FtL0mka>NEHsJMKs6 zx6CumRJ0~aI;|w~y6ac1O+MAYLjc?hN-R}D2&|DQVq2VVo?m*9U6@dX_lSt_&Zr$> z4c7dY>C}Xl&NXw?DtdhQWhAjSg+7LK%c=xAEmB$bHJ-m#XhgKmD2WW!)UhsRNqbqi z&+FnBu+7ai;J*So{z)nPBe=@S@aNC}SI5Ehk0$GXF%HK(Dk(Z!r|#pnbOBW=Q_dB27fpS1}N>2HViqU+R7qP=JbThr`xw@ z$cvlwX9;2-{@ouCC$R-TrN0BRp&FkWF}$AZ?|Cmxr_Wz=@RM!ullQ?#+i5&ZUpG~! zZ%*0Az3-K8uE%&&_8d}^?bT^`9~S2AMb=v%T`v!Z>|Bi2uSaW9kITVFER*ftX56mH z`HN5H98qsb@*Teik6y2GQ`63QxNpMF$qeo0=c4Y@$evaO7?_u3U|YSJc)F>PHJ_X= zhbHe_LX|c(yi3aixlFz?wtH&3fcI`H&1brgwto?}vc`tpY)NQyuOvNfDLSUk1@5o5X)`&qme*)#&yu=SgT5EJ zgbA}os?*O2j>a3+Ci)kmHvLi<1h;uK23oSZZ_KCE7F(L{eSD8ZJzso$HSx5$F%tO@ z20J~h6CNhAak0e5YPKJp*3m??VEbslUY|2ZZla!ptW1)tWJ0b9trj#AbDzwVWMsw; zufsfG_viLfrTyr%XWFNi0%+mx-Qw10iU=$;v%6@x;D1+aI%p-iZsiErGeNg$sD_-} zio8Pi#cg+D;NC#x@7)2M5qH_uwH!-7HI<2-oJ)zYRGee3hIlK$D=sK4EH8k1xDA_< z7Ltc5>Y9QM8;cLSN^kaTGuJG)GRpL%ykE)cKmE|7TW(pUd3#rPQQU>poefzXxkT;W zT87DChFB{SNz8amabrAeUuoVp7^^S2AB+Rtv-^#?yV>=~OxYD+>1@=Nop4|2^f}1{ zs%3{7dWUJ~CPwI*2A`;K_|OvQob}hAwDO@!F&f|ll)_9NCuc(7QF+Jo7)j?YFY#+% z@A9)<;rVp%j$J&P8{b&-Aq1GUEJkl%f5qS_;Y`~Kf$J`q{5iT0_M3eOaXAP7L+bSz zL5CW(j!fL<1rK_lQd=-!OZ$TFyZ@;v2hGLWNX^xR7(&Uojvg3X2LdBnwcf-fF`C8$ z?w8K>VI142d*)+4nn+*4ML~WcsPUlMpC6eRUEF*t1GU8JL>v)L%#@m}%BDg|hL!L$ z%ClXn#U^NrJm9-iqSe(b*pRfq_(XLmq2d!gQx}9H3kp(nt|nsYj%Z{EuiMSU#)71b zhl7{$+>Y?hSzwEq>It=Vl9Bduf!g@%^S3{0g67cdi*f`CUSQnYwUiGPw?b$wm#@KA=&-kW#3uEsik)G^=9;ehvOgt+1v8OrqW=Edm!<#lw31#6=@53OolHIg`xRFJ3n@vjBiko{`j zcw3ZUTJchLtcd$1n)ReZl^hVhFFs@ka$DlxCwScF*K74iOHL<13h^$h*-T`suFy8^ zu|DOwvTCDFGAdKJV{HtK|}QPh|I?ZiB931Mhv*5M05 zzVr_H?sma^uRvp|e=tOqy(CZ)%zicqs(9O2JLHCyEu!!y*~Dj z_ZMcQm#vLR9Rm^FmYgDc21L-ANPQFCv)sV6>#=(zB2sP;$sE*aVG$k0unUNkFx`k4 zn%?AkSX+EZL+F#tH zsbvVmx;bkZ6|9|u?s6G^(RtddH^Z(bZ=TI}krPPJB{FkEjmcR8ZlSVutiTeyO+i0C zURDQpS#-uWG`i_-Ot7`LIW_oQBv)=2r!M)m&{abqfU(nr@RKnt|&WTyv-{Z zw|x`4UYJ*cJ3X<4Fh;j8H~xaKeNwf?Xoil%Tke)W-fZ@RDJZv-7x!@ubvg*79VH%! z??qG<_XWQhF46N0?mlz^C><2sPVX+bY)Na!D47!VM+WBj*ENtdE<#n(2#NwcLHeFdj*&-*dOsU!_`f(`KY7!Y9|W?#88dqoVQ$sCP^Ig~jODFNKGo z&S^km49bCj`fi{uD1Ta)a;cI5bg12rMCmzwL)qMlwF0pmTI~fuO_v>I-pC||NE~W^ z>1pZ$>iPGlM4ECMq#F-&3jn_;t&7>8cIoPlLy=iwiQ`!Izf9<*RCLd47xs8?Vq7 z`_1<;v>V*;lkBO!>Q0r$VUr=BK5$G2>LhKy2}m04xnXhFeOk4wg1QEi)oZ!Dy3ypsN@jyb)=}e-b)!DJ3K_NcVRn z4vA?2S7(N4(QF#Z;sc1IN@}q$Gn+e+FS$_B4SIY!xkAV}*jaf@=jW&X&O!v>%Q3Ego;r zP#JM>{MC{_Nh}Xwc)D22-*L`Q-(>YgIAcDj9V-Qu!o%csP*$ra1lnOLv%ENxyvBfT-U`DYh*X; z3Bi>)wXzuG1PLrS>(?!8oU4aUTJRBhJ=4?S_0XqfO{wdh9}Bfy3c0}2`X!S%Jnwo= zmI@sK?OTQ%!eKrhQcRA9SM+``%h(+E;}szWX={XYl5`)Q#k%>!RM}fpxs*Fq?PhNh zF){}T67VE}J~?_-um?4ex#FVX^q3uw6&F{~cP#nQG5h~8_m%-wbYa`JNQZQbgh-0O z4!Wfg5DDp)l8_E1q(SL!5D5`U2?-ID?h9IP~qA=J^4~oh>BP~*X(}u z$4VjSZUB*-&d5lcnf*(4HSJp0XMN_{Avr!rF<*=75$WgmU zDWi=dG6wA_DV(%VDxkpB;gScDVj2boiX5e~bTg2E2x`b+I6`7x0 z7?vXxn6PE@+>+~IW`x$I>*~U_@8u7-J6s9W*Md{$%{OGq+s%FqzWJeexuVD_eZjcf zay!skb%Bu+)yv}h0B-TjRMMSJyH=&$CwKF=b$yo|d16GzwH&71A{9kD)|%@uclE%X z2gL4zsh&?Xv3b_X-=NFZ8=UB2l@Q-sHWZ>goD)^>bdS0?w(3tt;h1j4ES6x`6J9gK zS>N6e7`aQfC~`xDM;KL{Z@Bw{O1j7Guy;z#Z-r8;^}pnb-brKKm0@Fz2^e)&GuC!1 z6G`HePPTfJJ-{$WniYRJ>c=s~dK!82%$^^w^ChPoQd{DM7PXqWfxh*4=P&g^eWTUy z2L;RuL`2FX$nSQirc<`$*IQkqGi=Y+?8xp@-A-WNbS@*|6~!T%p2)tKLp$b>lT@Mk zn3&k*2Qw?j81eXq^I|W(qUS&yAic${E#xkN%-DH*2`+k?kjY{SO4}LCfRRd z$q9IhhA~I?4D65mBsN}me3}=OeAi!8voO}YHN&<`QENWfx-JwHJB0f#(-2isM7&mf1e#rD&X2LSp{@?`kGR2B9`+Hrv%4Y%P|TL@37mxJI9M zZ*}9EN(oFup`t@S*=%QDAGJr+4M!%M>G+!3ORE~;h~x;fT?a9sA~rA6Y(-LBO9P#%tNKzK<#-QXYtwo~ z@^-$lu)D>vUAB`vUE#jpbC*nSp74W(e8aVU;S(;i?5~$59%!Kv6p;{g>=0Nbd0DPf ze^<#1y`Z8jJ_%l_6|h|-DXuoB4wrk}D#wZw#CD)&%A%A^T4Qp#EO^bJ_v6Z3%C*aO zHfblnI=Htjk99fKA9nsKn%E@y5Rtz`w#^lAugLQPSwjAXbhTWBc%Br;ghYDI8}_-U zu?{|(t>vG@+SM%X)@NP1PGR+NAeQ5nPHSDQ!7i)nPSlRCoko9;T}!Kc#5I9M*!cvmT-=(Z+nU*ZZi)Q zlder}&R*B5oVB*NRd;JKewsg<>A{|1sDoT@s`l>fFp<$W*`bw-&RkW=O_>6>I)E4Q z%MOm%j|<$|n~O@cu9rIp5%E`4-XnF{7+0g|2{*hEk5r1Et&k89*h zB`0>)4^f%c+u;&WsZljkS}9+f2_-pJ#Swr}ffK zi}Iw8=Vw_ipt;+cW%MvaV0Y`AUd9;sOE2dtYx+Cv@4Ht+aGpKq#2!h#7tR*x+mXq^ zwARSps*{;Fl))aHhUgE8rI0WhdL|EgDPaL~eL z8zU#>gz;CEjCjGq!ve1f#}Z zb*nkH&sgq#(dZw5)9NoJ-DoncIYV>MPbmJVQ_4)#Cv$ShmqRJ>KxxH_#y#D#Ha}rX zPj>HTHC}3Mm{|Lq$W3Y7Vywh-<_ueeEGY+h zDT5%CgND&|}^voJ>5(pyOlm26giDN-$<*dOW?WDteR9ajYK%ob=1CoPO>@;mtV#zcw) z^Zh>;lkdOtYf;1-DQ7g|Ar!SUiF+i>#{)99zwU4L?D5VS&B zu7i{3mWIFymyv zbtvjbRN{3>_~;s8OcGQTNwn&ZA&yVju? zN?fYZuKDw1@dXdK3N@^~U`JS>dc$b#`O-FXI(HDdZ#)(L3GZidjIbP~OwXqe2o|z` zHrw*$p%g?0huA&D#vl0JM-o0NAZP^&+7V)T!F+tfO+4)mr}y#h8y((j{a6;i_M3Zr zlMmKz-b5RAk>_?BlN0+C6i~^D&HTVlmns6=gBNvNNSJuVY z1)C+pJ9y#z81=l_?X%nTL`?Fw{eu_ zyv8DaJ&$)G@Tx37l@WpF%P39s8pet7F4hn_IrgA#p{QHH*EjcvwY`jz;K^v)8ZT2h z@HIE1ufGJl!=p+$FIm)USN)_}9LfFc=rcC3YMQVZP!qVAV#J9GS+vZy7NJ}?DkFB% zFXUp5X`Q^tCtJuR@zwEYZcWFFosz5P`A1FM+L$;dN~>Z?k>w|kD5=ZbyzrKHQMXv- zZC^Z*rFCW;u%UHUGrG5}n>P_te&Ok{_R`?GFb2!Ykv&G;MlSPXo1a}*n617fzPnTC z+vBGlv7HmBi6&TVoBXD3p?SXWu`+KPRRRvhK6O^?cP>YU<+n?QsLnaAg>lXDb6*WH zorw;InG!2*=RN;W`;jTp@%DU~M1&wsKl*W6A%2rU%}w0v5sqDAo=%;a;J|0M=i@Mg z*>Zvtf>SQjDPFCf-Zsv1?9Y3APl4pm zjMFjaXzcW>=Y3wz-;fy7;xfJ%`;vxjd=RfIBw^;x?WTC>K<$<9a_nh8#&OQ|5S6#-*n}B<8QXLZBLPqCjIK6ITB3@26qEU14rcLGtcE0rL<+NKt z4i>)>Ff}L2M1JAysSUNE-S!-n>B|y%)9J^M5E%61(Oar9N3nOK1WIpt!d>~+jWOSU z%}onKAK;~p-6>XdoUT@U$t~y*D|*F4VXRnUTzT9tv{Fv(n9N+sv2(OD>iN#Y!ie~* zmtH^J#}L2&U=TmNy{5v5JNm24C+I+va66eJBTWZg^*GDoj}wjEi&GEiws9| zn_{jlC9bb~4(4ftnUBjnSFffOamz4nYwonKLm$$Q?9~`G3UKZ<=oFgy$a;j_V6DBv z_1f;i8zRQnZkfaH!#{&BMeB*|y4}C}eF3fDYQ~9k^T#wQzbBJLG5H6klJYG1Ki=&o zpk6WTKN)FzQ0%;@HT2B(GR8N80Q@i!P{f>uYh3n@2eDfUuOrFh90g`C3S=nyMs?PVU${;9g5&IoCFrq)?W2K}j3aG^}{TzR!*y7-XdqnyX*Kk?Z z+hf2*Y>lfst(}gzM4EE<+YW8{)3it&DMnGEpqS?O^H?7`K@YpavTNj~7Fitgty)TH z>`R>}=0=T{;a0w*k?w7A&E+<;hSl#R5X^AkU>w241C`+7NZFD)aBQx#2=s}1zdyY^KZ*!6X5tnzjrvn={F`Qps=rNfw;+V9X%nl;RF59k&a*%}T|-JOU( zm>dn*ksn^a%ymhks$ZHssNK-G{@xwMC6Hax^Efv>M>~nnv$XBv6%xuZg|`>xq(vs= z2U08L>PFIM5-$~7eR20xO-XWmOW`!uRFCVIyK^yD;rq>N_Zhl1wLIpZsDIzcO5Ui+ zK~wFvVC%T?K^weeWh}y%F`7XRXG15KLPiktF`LyFr8gc^pyuR=DwO zUePrn2E{~HYz5G&^BhA42%3_*fM`RIB)zG|CK)3 z-KZH3N!ELzAQ5Z)hLh-m9Wy8Qs0X3Dp5{23!hBOkONGHt$;&NYryXufQ`Q(kl{R({ ztv`#RHPt(OjneR|N&Q~(s`Nc}PyE7B&`Fw=j>ktPnYVh!W;o>#BGdb-@wCb+Dw#P} z=21|SHZ@hJ(v`!mx&3aP&Syz3{aq)FPh5Q;XY)3LF+lBn0u+K#19Q_)MIoP5SKQRB z=(krS5UlV45d4>BRCA&4NNvcsi4p5~+&2Qj&2!4O>na*9e|W zxZ(##>Wo>-VcLOr$GZnF6M__%ODF8-9PdgvR3Bo<&6X zJgr--_I|W7HLDFHv-IPTqFmA1@g4pV3iq3VnVn22dY&tzVP^UsM+9Ydw7D@tPdlH~ zqD43oJmiy(Jcvv#)8gEYGoUhOdN-@HjoZPYERk{TorA60(Uo3~8@zey7maghWQ?_c zvCsqH4X>k6(2wj z&5KpzsNt${l2vF|8?A6tEb*;L8OA1}MTjjG|Ri&FO^C?kU0wvtX z8)wVR$}y2NU-1nVRF-=uPxAq0JIfcIL&~wqav?U+>TW9X;a=??&cNOC=ng!|s|(^N>Qd<{-4d9mp3S?N~$ZD|op=RpYN$4~B=Ki)7IAAJu_a2bvG!gWmd z4RssmuUYlqHVJ$X=zp{7y#G&G^*?PAV7b-*%dGnUYLoE)Kda7nnpOYDsX^v{Hdf#{ zHCFh?$NPWIu>YS-7ygno=L6G&z~IvZ3GmC?Liu=sW%yL&IH$|}0>CowKNE2S%Rs^z z1QPfs>kKUOo^H?mpX~vSVDLY={?qMGmtmges<8H;e8Bd=PJZtXs8Rrd_|Mt{$^?M@ zovjCo2!LgHQvXyB@98r4KlT#9GT-Sk_-s93odL9ewhRSmd+T#QGz~D1JV1g20 z{n_tVr}5%D z+du!Q9^gL#y|DHKfc=C26A$30K>W{s4_Lng+n?4ggyP%fbSBEW>5M}U9KAR>T(_iCiP7U04V5MbY5e;@#_(#VMb z6LuZ}{>g}l00trJ(-|fV0pZ`V3I8pE2mc;qfOJpif5$KU=Z*yXF#jV8$Xdq_{!1M{ zyf5KT1SEYrgMshiKb{Nc>`BjF^N{p%1_NDAe;~kmVE%{#FS1_FFk$B}XLu(QA_55Z z90$67knM7Y3pxl#xhJXO;ef$Ff=om!Kr!!30 zc?5WeDIx+G=o>~#1h_B+1Xv&M9|$01MSuxAj{xtMMnnJsJ-A321-P*D2=JbCLzm2(SW!KM;N!Rv_CQ2?P^%9synxfrtPG z${~>QM1l)LK!BBT{DHuYq}Ku%CJX@qR(bLV0vK7J3ov2l5#Yr#hzKBL{dR^6LqLGl z_xynXl+qyOwE%(%LqLF)B>jN^R1YC10!-L>1b7t{A_Dk#VI#8LRN=x95MYI0e;{xp z>4^k}2}3}D)vEo00F)&n<%tA_2}3}DmDl}&@ViJC=}x47otggAg8{1uL_`1~>(d!7 z3?T}zB1S|6FbG*+Fkr$E5MXtee;^?1w=)^uVa-+tC}1q|@w?*F|sIag;Q zX0nRNYe{o6T8*r!Io;h^Pqn4Mk$5b2+kXL5Tc;y7rheppycFI1Nq18?nw-(&JL~LL zW>15|zYgVdH3x6)|1?h9D#^AP4hko5n~R)#Fqhdkr?{Bh`!#dx@P1AlC0p`A*OrC< zQqHxTVM}`-H2X-CWd$>4!eaH5=k^VM*12!4jAggTuGf9(3scMH3)m{Ocq&c#cyox~ z%Za*$|7ZcNeZ_ijO-z}QF8}qxx7$;FGnuWKZQl()2nlkS%Mf-rd#>4g)6J}|ljpSA zDN_xocD-Hk7ZO(7V}3YfY-wU5{BRY6a~9*qn*B`8Ywy&bv%z>3bCY_vZc-JcA3O@; z-=op*r-IIU3JHGsnr(g*{QS}NlSP}r_>gor8Ct+IDWLxz`Azg?eaj0+w=tKjK1&>R z9Y<92=y7!4ByZ?vuj2a{i!*wOU(ot$)RpHZX_gC0xhA{{_|+@V!;b=+oI(bXE{@D;Ln$tM@7%QWNuNC#DSEUZ z=j}tC`55xfj5lHQCWZ3PZi!|0arMWI32lkAs~0)wy=|_7>t!Tk*d;E|klqModsiGD zb_cxXZg883P#A0e>B`Vkwa6JtzJ&Wk7F-oR3a{8}Lb0Xaq>L>x-^Q_MHJYl3xi~oP zDl`q<$w0F&lTro8O@UwH<5{GN3bggVjEo9@TYAMSrI>A>Tv2wb}st zyF#Qi*IxxbMMi`LH_V@b=MZ(Z}ra)0tyT((f44Hj=D25U)Z;i_&q6kzAy z%IT)|SMhyyvu-I^!L65!Qqfk#nR80y9TQGF?p0kJ0&5n73JXv`F9-895m!DpyTY9) zh5m~vYy;x)O6j!UZhz3w#BLx&H;m70yTj+mi_dngv+@Q$S*8aDdZ>pFb$$6{Le_hg z31S+9FV>sRGaqksYG>=}{a}lfnWnrp5}!tgrV*whB=?i3;B^G!bPh25*w`J@x&NI_ z{`Ao6Yb=85{(dp4>>3hlg?ctJEbK2PGkt7Bg-cEzQ7`D|c`9usfA2jxag{fYiB85= zE8G1t=WRAAlfLNp`t7r|=Je9Ts%O*^O)u#m8qviyp!iaSw`Z$O4X~Czj4vDq`%Z+- z6}mZ6k9X{BSd~6+S(u^fm~Rg+c6{+Jqq*^WB^*n<%=Oo^B0mm2a5 zmgI6{RhNv+oZ^TKy-wTGcEjmA%O`%G!)^;3L4L{dZ`iXvxZbX-6KfW|>(RDmoF?NK zxsT|bMZa0zI8-GlX;zrfGhAhoDBNh(e}8`+OO5|E=VODJE2It0d{4kl=0SsC!?dVvsvo5WtpTt`5la1p|e!Z2FO>Ob)l42UR_@)@y_4g{qIM|Wj z0$OT!@4wh+BQ5^arkVF@YRbO^%XrT8daiz9Ab22^_HMxDRVx#emo{$?NYM5ZQ0&;Y zx40|zvIIYC^|Ps~7!DMVGjQLb_SeFoH1w~+f069LS~z-=)7M6hWvIY=w5lvp?XC}8 z%m;(q8m>&4O%yDOQ5`F)rC~N+D=Z9Z0!AZ@Zp`!zocq`o-yfQ57E&0KdgZ?-|6yOM z!uE|=pN)l~!qC*#5LIr_p7o-={IDOo2l|D;!l;lB8=)b5Sw_z~IYd8xlA_5IqgEwS zAkmq{Gwu@3bidtK`H`^lfZWEq@It`|lf16A{fm;_{)8tI55_pHo;KujTJdzMVK`Y2 znnaSKxL&Pyy;5yfG|nM-aXP8;zJv!(+k~%|_Q>k>$JO_WuDI}4TXf7MR*vE^UntNT z7n%Jr-exm0PIT`zJ&L_G1*Qrk)JaY zj2^py-e3^+$kkqRJDE$A@yL23^GrZyh+6#paJkft(P$Gs71Rp@7s?L2`4tK0WyE?| z?TlHu-d zKK^p`sT{MYd=n=srEUhIhihm&a1?rPj-mY&NpQT#LyU$hE~NY`3cDZFAyFV*FGTyI;Oc z*V@D8s#LF73)&pgKS04U?)Wlp*U0oa#<%aXxGG6Q4r-ehIy6bPF-x=vEKBiZkyO*D zlYFduCTKbWuN?C2s(|Gk(a$@BB!!=?%&qg@)4sqn)m%zyz486i!XG z#~e;`k5BKJLd?4aSw$CwoAR4Bb8Cu@2{H9}%j3&zEJmmkTFE0iUu@J0UVO#=MjH05uD#QyEc14DU0 z|N3WxVFMU{zr4ab090VZ*i?)iVI$K(@FA=8T&iYH4_q8g&76Q?biX?Q&-}CDuaH1_ z-2XlyI(+Nj`~0hawm$IE`M}PZ{`7TJh94N6`+MB$|8aCKFxr>?cc<8S`|JN{=r6*! zzkhQw=U;>W8PoW`jnJ#qpNLtgasgh0xgX?rkxO5k-2jCyJkeX=ubNoEoFEwK)><77 zYfZ7z?)|i=S-a<>Ux7H`4-ZRG& zPC|H7f)O`Q00-z6t_ah7^@GD_N85?FK2=K|99Hk%?okq{G{oB|ays$8e=;a~^73f4 zCV&UeiDf}>AtYSF=0V@>qWcd{wgNOK8^(jx)L7bT@b=d7?^acp@J#xwWcs`#5G}nYty;taJe^MZUf~j!np$>A;i)*mcrY=h1L~Q2!(qqu zwSzauM6HamF=F;t@wZ@ulOfS}#>qxBo3{!T23Xo~svW%UXP#WP@o(E$DO7&h;TUt| zpk`H3TIR-OJ=@q5VCzQ*n%vhD zjypEjpL(|y9)A})WU1fvpFVU;LHkazbE{{g=WACWWv!WZTV3FOqR)}Y+vhc2yp0JV zbUjbEE)qZA?A_hHqxOvM{)0?Z6tM~gjtaMH?+ka+b-K$2MmUYMxkvlCdM?YYexe($ zt$6p-vU%zx&zn#Pi>*!ab#|~iUudoiLD3?^3)K2XCmFTbFykn#M?yaySI7$1>c2Z$ z{3c+iE}@J&92N61OIc%Je6sHY*ySm`M}Hhu&}Q6G!Q0PSWh>6a{0HyuM}P31TdMxm zcW>x}jO+vpX`J@Ay*|5NqkG;bG&ex{CUH~zq$3#R-V)vYTC3t{SmlSt^5|-Qb~YTx z7#xzqw#P%VQQvZ?aWaIq9JFeq89eMg%X{>_X0ZEMO}Qr3*6TRj!q>)c#F}=LC8pM) z4sm~JvMTG8aPg0RHj$YLz3%m6lD{=>g8dd`5$#zRibY?F&(Y#{wb<2HArrSA+S89T z(_t^KLPs|?>iWd`1R5}0$fkt%>^6cleeWk8Q?d9YsSZf8^gJz%TTFV8rOMcS@f|;T zb+DyI^Jt;W8d;iD%WBBn$2W_*<`ls3NXFzLmG^gKh(4CV0{%-=kx9zRvYu#gOdG`eDj@F=#)fpgK7?~jvD&!y6p%Yw?&U{ ze6A8~xFfQ&hV$GcLU?IbP4!t2Hjc_&1?kU?@kz$p>MylRlUu_X_RwR{`CibgD`PL+ z@Yol$Wh(ZF>D5Nr#~dMM?=%gIAC5UPGYv=IH)IRb z{7*iqZ{n>Cn&sN!HA<`qXpE!vQ=37e*fnr>nnhSAONLUMuc0T1j}Li6(guFs+$m+W z59C>t)Y6q(uZeP95SYIlEobD*^R}VyrP7 zhtB$wiM245XU&s13M(bw)9lNLO(2Pc&maiD5{+CNWC z{$1ByXn~IIz6VqRfzb=7$}Kb%5(lnj;yK8?GRpNyIj?F$wq9h zes={_*1!v)^Ui2;y5Vr{;XOhIOlD_H&vx=l5OxX?Hd>6>O6jy1$}Fq{ ztH-1e);Oh{IMteC33)1k$bQiJoQmr4mRxQe4GK!4Q&KyT(LjTe$8K*IC~Q{W`vdkg zU%7*s?~seKY|g}NJQZ46c~XvNbRuPRWN9Ou2K+bP6aYiOEESUh{kB&1N&b;j_Gw*Da|^FNSlw$bOai z{gk_&pKA^`?qwCDra^4^(EH6-jeSQ+I<-n075nREP0_t*w;V>5Nemyn3c+)`?Gdo! z@J+RzPhMj5Tl>A&n5ZpvR|QlrUbVweyZkyZV2*b3i8M!CqY1XP-Db+y1wTf`JD=@2 zI(3~6B)XD2n8zo-tl{<&*Qlt}NwO%qu$YrN;HB4CU(~dTP5%gWR*30K;fi&9`mnAl zQ&z_;X5MkWZw(Bocqt&3`neMS%7UVj0GE!w4RBvC#N{S=Lcy4JET8-l)aQx^EJw)5GpaI3-8kibBOTLK4)I<0V-( z6!*40w~}U~a%ZZ+@!BoYGz#n+qNeAiD4Mh0m$hhIhADoJC{&j^Y*K57VL(gLV?Rs#h)* z*cqqtKHhmOsDnm1-%{tX^u((DIZNDquG?#u5-&tZm%X>>$2Jm>Otx}#LiOpj$Px~s zzLG1j7$__g2|i@RMmO9QEa~7B?dm6^?0pmvH0SxnS|p`S{Lb>RjeI^`r|HhTh4iZ> zmu~;T#-myH7E1^FtoS9h`t0wGmho&f*17)jp+@o(4_TfT{h5-m8}uZRyZdKKcT|DHM}sVKb8E6uZ5oENAy~{Q7Lz*!&&zS5Eg*2usElRh;EeKDd;3 zZP^tQ6jjx7vQw&j`mEBUyjgOenZ20}g(Y0fuVO2gzNVI#&tsY!mu0{5<%(g%eIw_L zaMCY1`3@cZtWl6>+!|UIo%eHH-jiJ+Gi$l}UfFUsOzl>U?1vfNy%$lpF5hH9RqkG( zt+7X~RezRCa00e{9=U00+9;Li-EBQgR{tvADiS}Pl4o<9%uMiC%Tn=@08`*=1LmDh zY6Yim+)h#f58CfE={br6(t3@;i#eGyF!Samd48l;p2^b&aD7kiQ=bM94ommSK9B93L2_dxFlE)D4821 z2IwiScP4i7R+$>~$nB3EDw=p2eCsqH-qy47O_08+B;8*l`KTh(E~7y2agRB7WPA_z z-h1C=+CwGpVU5?J>lY;bIj`>@I#%4u-T0*O+QCo3bf7#&+LtKpX)zwln^!d89bM6| z;uMA{!gpg3&Os_@@$jS~`N`25?!&|AG_OcMm1_(GIJYid?MNKD_(C&jVo$9~%j5!< z*Ua-=k+xSnXso7Kj?vjgZ5Wh7rBf7*s{)lO!S>B*^4I(A*zi^`)w|Uk)9ROr@FGf{ z)J1?vgTyE~Kdy9#l_(tZ|7hlX!DS(IPb56^+i>C?-JswwjGMa-HrxuvaYy;8TCW8P zWSQ?tP-;k($Lqfg5Mnop3Emt-D2&Tuz85lr)yR z)DkZkJORKCCZptBaO`n?=S#PmKh zmLfaxBo1an5E`HAU0wW34&@oLJo)=kXl{6v*G>-HW~OUe;)F`yE|gh$}rGAU7>>WOgzQGI_&km_%hoQuiT8PD;g}ac#{e}Ziz)vctfa9Tx%`} z51WP!-$f(x5(@OVMqw1R>|!o7=s~B1M)KpT^t$Sk2QIWJt&-|!)V;nPl62GrpYL30 zBfOKR#+6+`3bOK&onxS3PSt&ZlG`CjO|X?EueglGl(LGQD+LV?rc`9~GrmQ@oDB&o zqskZ5&4XZBR(^jf>844KW}#b@WF>q}CN#aa=p}8wvI|vYtE9r?Hd07m2*GKt`+ z!QfE>bYH^ZU29%OiV(G%c~csW@s;D93~Sw(X)N>o-vsKIw+qJfC4vEF=GZfxWDN2=I zRybeqLK}`GD68D%(uh!7c|TPMedn#d*Wt;igqO0sFa*Nj8Qgr4Kib1LxS5okw9!I2 z#(*De{W2*S5}+3fTGol8TqtLIZY`nkI9M^cfjlR`xjSw^Lxw2_k{70TjrJQTFKm$& z&)eJ~3YxvF5NyRA<>72bqVSV!x;uW-fEq_{SWjzs*VBxMWbvLjM6>?3#7n+~60A@o zWyKI;_in{wh1CpZX6~}~2lhYEud$ODcK(1m3(V%#<`)`RYBgKgiKV|GV;YbYcd22` zsj6WucwrE(@d2H;;rSKn3F_(|`hpNS$PTg99slGQj7-6PAcLsFda-pY`BhU7>-XY}Av^IuVBMwcpP7TKIDE`Ixcjb$wQBLI;CM=gyKmkl7`jy!bo0c#bFrRKH$k_4 z(P;F(@+vs{>D6o^R7S^$S5RC^zDItIi1wq8<>uc*t!FxLT* z?%v3WN@QmkTbVaStt9JU4mI#KqZgvv{S_KKT<+$OIlLsgXipmvo-@0@wIRngX8xUvZpPefu_R5eMsiDf(&rwDRyI{Kuv7o2yEU3Ppa!>g-Weq;)Zs~XT`7I z3fuhk@so~3?aS9^jpA68 zrU+~imd)S0qt)%Ntk7!HmahxSu;N{>NHnPvF^!}5WRY}V-Q_?TIbbWEcpY$0@@HWL z&aVkJxv+?#l1z|Hnn%vv+uae3Hr7#!T_5@lHq{?GZ{u#O^Z&vUOc5M);+$n5I6^aR zHjYl6E8?$KU|Mt&O7N;ap;D=^2vFY_33`y;#86eP=@C@bK7~Jm_IQ zkNMX_LkGuYb1(9pw4~@r$@C$Pd31{4T0gCBr+YC^CB1;L4vGrc>HB5guJ|7mQE&BviRkWGcxzc}*6B+voP{1vR`pZDoQBnK8^CBU!ONr=~%~Oq`qrlxA&i>3@K4H9O8x*Zf$M9&yX7jT=@jlK5S3f6Nc(0LJ+Af#N;FvWO z?LOVIOqYy>sLxGy0(|nBR^0$+!@HppB+}8pe=mBX29-%gsR6XGOtxeNHphv+w!aqX?OU&-7L;Qir*xC?)n{U38~1D;(}T!=KR-U|g2_@_#}S0if;s~t}yi8KDz<1D90 zLyDb??7*Y}Zt+^O(97aN^k2Nchld;#SN8lQP})#$+B^2pIAn?96z8h3#+6OQ%%|M_ zBBnP-(jYoVvq<-@X1GXZCYKZ~4YD0iANBQ?xkUPXesi4;%*LfB?(Mh|^j?YEzV~7< z#bED_jFeoa$v&B`KBsEUxw`?MJQ+MMI_uEGq*AXY$F*wbNq`w zs^Jz@bfAWAxxH9Vw0hpL_od>*Cr!o0(G55Kr*q#^OVi@m%SibIU>Hh-cHmeC>_V+M z++T3wm*ez6UPSs=xv)%`k`L3{nHPm-^bdqDnw-4cH2%Twc6aBo%~!=Q6Cd4Xau1gl z6_tnvWp5KLqo%Wyf3)h2RVMTIm@070igbPnHMe_;f7%-s;nSS%$x;3076m~wE6^84 zqT{nAj=iZB9>qz^%5cYge$lbX+C zHI|=)O1Nzn`dU6dkjZk+uClS*Mk%nvMTb6HXfW1d`&tU|7+6ew^b7_l>0wP zCzwm+?*!2QebVWlqOkuYoqmt*`M*gz{jS_P&F%a(=>)fFy!nq^qvSt-%hUhQ$*6Po zvLFzUe){e2`Tt-xdulIxZaUZhOyK&by(|xq5d%Sf=jP;Xc~0#%p>Vs_Q~Ob#Q#(`W zncXJOsXZ*@%s!L{7!?nK!0k^@NqK+)3_yGT+JEu@i8K)8zwH6`o6s{mS{}d&6aWYE&|JsG} z02SZ>&)NQfDp+9u|JsZ4oZ8(&&+JiofU%9h`hV?Bc~0$Ap=b88Jb*DF2m-g)g&i-z z$O2gZuRSZzshuqpZdVFh4~*Uhc+U2JY6lC2pI$ItpdJ)x?@Z6BohjtZE|mue6|nwn zdtl%q2m-g`g~$6e{%7{GJiw^}@Sf=h+)jbi@7eJ?wbzB5*}w7thYrwxwjMZDfc9W| z;PE}RYdy0E<^iMt?VtS~7y}K0!tIOUdQSDj?Q>zvfDHl=KbU?P@2OobG^uf z_n+-g?T8`&Y5&v?7xEvTQ~Oyc{CL6I0}R1{?az3DqHG|3XYl|+1?c_H@jc}`vn%E~ zwGW2E?Py``o!Z|*|8u;7Qw3=MtUbUt3g9_g1}-(Ay|d#196BI=u=Q}>Q~oo1Tb@%p zT*#T7FwdzSFXYUAmW`10R!rR z?a$Vq+9^ZN?4fx8$5ue^+5S%LqM`q}e*n%7Kzz^E10Hg~`S_pZQ+@FJ2}~bQ91OJg zpW|_=2W|&Ue?CnQzw7;eeEjxdfFP^4EnL{C+_O;(@EbKE0u))@^Wee|5dJ!%2YAdQ zXXQ3r*m(r_;}9_l5M&*=4Ht%h@K^uVe%L)+zjI37GaAD^W;2(pC2$0{O{Kz&~6)x;N z0{r_G5dn&<-nMXI=Mmta+=vJeWHrx+3pBpaAD^W;GJ}TMgd7jJwsvB z2AxNM_bVbIfRWYD6E5sL0=z2}5dng%4#RL^=Mmt&w}=Q(WVINA3pg&`pP)eQrR ztZo=^VdoLx`5we5K#=vh02g*10iL2lL^z#n4=KN$;lj=%z_V(I2oPj-hJg!1K=`Xm z5(HUYlHkG+5Ma5qKcj%89)^&=co@Rdt$!dO>%1_Kzsw5*&k+BCfUJG0kiXdT!jsyF z2w-HjB!vq*m3x*hgy-QA5g^Fwk^~oqfB-8U_yYl1%`hP_VdoLx)eeXVP-N}FfD1d1 z058x$M1Uac(-|)8JOaF?1Q7v@tW%!Bg&`pP)shs9td^v3VdoLxl{<)0fFkRJq;O&9 z5#Yr}hzJm5ok#*M3;_XFAN2J7*5l(B%{)hsyzUD#x;ye#8Peeq3BI}1ITo^(W{%Vp8K~|Gw zxG)3+SP>{<6dH5hPV=MmtgwulH2*rb`r7=^#g<_WJ3 zMnr%jtIsoB*!d{H3!48xK-P&QpnvOx`Rkmj5ZKhE$ao^bgq@E9ylfmX3J_%NoQDfT zK=|wY!VqMgUl=Y70pYK+^FWYwb{@De1cblZwnLEBwjC}E5#e-*!s-A0*P{=DtaInV zg&`uGj;i<*0ZCINkblj=|I;D)*Qqce$T}4!To^(WU}Izchyt?qBSB!o&LhBw^B^KX zk+lW`F6=x4d;}6A0t8v#k>J7*5dNBXh9GO+87>R~0XEL-k0>B(wJ-!G>^uT|Xc{5{ z6j^I9;KI%$z(>;|B0!LJA_=&#^9b+(fQSfCWF5-`7lwfF*B%Tgvi4xWg`G!$53@v! z0t8uy=D~#_BK-9=4_SvJL14lV5MYB@|A+!GZX78qVIVMJ2nc_jFARdL^M%2MokxKF z_46P4`}6;Q_w?57y9U@;XBrMX4l`)mbu9L;4FIiYvF)4FjeSdYSZ85SZQt9alozRftQ!CMWtK;V$GoHtj z71dQ6I(t4n-`Dci?7Fxq_Y&taDZ(xX>CW)=%@}(BSlb%m)&G8I>vUxze{sL$XC39w z1<11&hMl6H7N&I*%~(Ap-XbLL(Xmd(^iCEER#Mj3Gr_>y5Cdl{cBwG6 z#QUWp!`zq5-uSpU9Vsl&&fLu+`(8CcweLN8#>BUxw-8LRB|} zh=^3w&_MEWNdsM02$%OJNBl9fZH8tN+9;NPUIvCswMSYizvZrfqtH+B?6O>o!b;0X8FZv!o6wG(df0whvv~oMP%P2pkfSWJm2RhXUCOJ$7dX>^h zdUiZCa-5bgKE56GeggYGKTxUe(>woUvTX^rtNEdoS2}-Zz9!t&@l$P(nd5W+XOD^4 zUs-F(fO~e>oHT{HM)4pRNu|NRbc4rYG!K7uBo8L`C0ZtpBsVz4revoZM|725M7xDi zANj!Bv-Xv(n%1KZD>v>Q2S1G5xUQlf(`&yH`RII-bv-Y!=LzH6rqxwzWXaqq+dg2@ z$M`umh9>XS{b`Cw;!=p|*Dvc%-I22MP@~lryxf|1yoEIs>w51=Ga5+9M(M8g#Zl`%=#v9&ZT$a7-B(6M^}XSOG$?Hm(kUS@ zGjvFI3P_6xNJvW~-QA%eNJ$IQDWH^eBi#)mC4Fa@Kk5%y>)wxZ*YbmhGv}P=+3(&b z_I{t|J+{E4N#K=eH3Ieyx08JPXz6LrH(Dua3V=_o>!Q z&h?SsQk6Em1p_j@>*?w@xjK(~Yj918hd|##P&>1Ubg%4BB;<`J>~tiRj@knZy$#{E zr2wJ_7=`HHq~D*8a#EKoJ5{{-O%nUE+8e=BC*5`NMy2Hb*U{gCx;GmV3B=e4t$rJA zV!aJ9Xi#^+z##-2-2d^MNj+W84~+tkeBlJJ=3(t*tM^Xk3Dj z9mFMVSqSE2u_Dz*>{}Ych?0J&Ar&UgBQA0!$ zovfr+>=$FTRXijmNRFsP^<)|t^`kN+qsDM`=aRS_(-o5&wU^To?+(zBt@15K9e2w4 zODmi427UgHqu2Jeq9g;i?TybtI1}9mG~b=^w*>|KNX#_GLAQJSq~6FENVDd*tbY42 zM5;K`CnHY#A^E0*-%6qot0(=er5&K-V+@a^@GsHr=lz_UJ0kIxj8!h-s{Lqk{lOSB zZDjaw5Q#`{VXPGs;ImeES|NbeqHs>^OSgzyhHe2_UIOTJC7^%Tg!YQ5#D9qC+(jxg^_qE zX^*gPTW1osGISDIQOJh%B?%{^z6tE~lC1l|^vsaFiH*7c2rotEL2YBYUl*Rl27Ll& zK?JUbZ2 zdTPUqM}ast#{yv2Ih18=5R3WP=SHt)VnM}X=11ef7@vn5O~e>UQu4igw#saX2EYv; zS!wSowDi&jQ3^ZH?dH9d4N*9ByX_6<1adc$C9@~}LJXa)0Raw!;~$fK5%uj-pKsW( z$A7!!I~I&LS6qcd3;xeNl7sXLvmVAwX2G{S&c0PR?-YFcjEObvk9^TXbu&yy*An=tXvaMe^_@;j z(Au62iryb6qbG$^lw{oRxGgWFv;4H_bZj3-G4z2WnKPTw(t&U=V2?LyYP#0YIH5;(;!oTA7gnF~M)Zgf#yi{Fn*j>!KpdXC%|IaHmPD z3iGF3-GpOU@_cQ-PiZ4^=L1QYHjq6B=?EM>kKh?spKn|4XPC~3l%+XN;oK;#rP8y-vE6ufRg=a}MRF`V$cT7ZA8%S;BY1X}nK74XW1;+Qh#ce*Fe8j(ED}HO9 zF+}l@1LR%Sy}}(v5e|}{0Wtf%n#ne>vL;Z{9`NQ*dI#X!*wnAK%SE7v6Z5j=;=pP_ z%x>bJeB)SkSoV0zj=|!w{v8uzQAF9e@-nM~SJL;UNNyyYO@W9<9`Me6LPCnH_(<91 z_8nuX%Q-9X`z~Hai?;0aV{Wpk4a-bjz1z%|x1|Kz*+Q^;Y{D!e6qkDaV^f~N)Ak<8 zM5qZYt=XD6$;Y-x{Pmd1_nU{OJb`h3 z&#Lb4Vi2?CAm273q*3OLSZMDRTF*(S7@`c)jtWpJs{NK1!h%E}=ifAzzU=!2sWi?C z^O&yXq+<)&^0^t-VVLp?x%Fz?etZ?je#;owQsK<=7iPrP%+^l$n+k;~N}aZ(Ogjd+ zO1U8gBu0entYybf{A)z&eQcJL(@WEb{GCvNyxAOKCvqQq8W;c{t*lxk;-di(-o zmr$dhJp``TF&RBR{x}-KX%P2}cdLxCIt`zp^Oqt?k>T6VOa&q@MQBv$?&Y+Z7-6UP zru2Iph}orV!L9tdLnXD{U`1TR#G-avV=A8^^_^oBD9jp!poT1$NGA82KvSTf zCA5kFqfaS4R}M$LGI3Mj!L*^(Q9`eKoPkbf7bzLu`_L-i2Z_muWEJ;~pHH;CPkg)F zt(^u>&8$>e{#e_f>6TPV4`l~EZ#ORjXFMO1c(1;wkiCHg~pYN@u zY%d1H+gW%tu`OXJ{xoWQJCE1)2e;mYhHcNGvwio?Dp391O^8UWj~_CR#)iQbI-i-3 zFP!#)Y(t!e=leE&CUK5fowu=WE-T7WfP$CN>eD2Cl7ltM?+@K}8M+8$de?LvPHl^X zwPL9p{TR9g6hhb-x?W1;>cuS53p_ixJ@q)o@TT!A0i&~n(eKK8W<&PGZSeAVY8d#R zFh%5$jYaE$(_cd}C;i3PVx zGrvfuGGL~jk}1p(-1gG$&Tg940#wb-0!iN*xR6DZQGSj1NQyi#^TlB<_qJB!>M=w5 zZeB|yq)m8G?Ya;ur>G&(fk{K#+O_-3>Vk)$aV;*!J01N9$w z-5Qju54O%W0C2aZB>Le1GYY5=<>d(Kw(%mp4|3upjdW7^Rp;+B7<*!V8+9#un#f%0 zvA+9bWZe<{wZQjHnwZwqb>q`S3o22O+?mOAj>-_%WqqO7$~G<&Xyuj~PTpV+L9Sab z=FvCO&?>Xh%}hR8kN2r~4pkzcqBxO}^Y*H+rFt@IoVX1h!m&TV!DrwcU}crsD+!X) zeG+7~yvvrsWSYmgV!WjpY}ZdW`ZP9Yzb5qMeL3u*BlbnVz{hd~x3*)DE8do(&XMIt zGmhH&e<{4<%J-_{U2%5TA(0WCoB!vH#9hwL=fTuQ^iqf+MZZVQf|upj@9D9~N6kL- z|AKP|+$}JD6j5E5Y~x4C9wjgowh>n?Fl*gSPJI{?VEbw+wo)a+)VW{5nzvVib%syr z9kvw>GQv=6gT8wS?vVbTPHa!vlJ0yUQViSS3PNcGOS$rGS)Y2<$KjLCcJB(P?Kx2r z^!b~Enzjallpfx;!qN%01s8c`Ici;T%KfCBmA0%*Lh+(1alY5ORdA?P9&>vjs5t=m zg{!s!!B;Rl_ub$4{cQ;iP(Q3JR z-+h|GabOY49V?uoXM6Tu#tcyv*|+!jQ~k?>#4cVhPm^SE@$DSqNf$06GR`KPk7nbc zL%=wzC+*|!X61WDIUjRX93D_fcc>~Fb%clfe)D6IbM;B4ZOCiDS7GjbNfV5o5Uxu4 zlI`l*Cc{njAm|D{(&H0 z{NcgL*Qz;++V`cyoWFXoS6ju1YdoFDe*1=+9}$XxHrE*cBfL-Z z?g46f<65LzQC(i`H@=T#vpax7Iq`1WBCH2A0<|%|e4Da9d^dLIdfARX##N0pr|@{W zuoU<$QD;8uX*_=v0Tq<_39r$6t8w zQaRJjkJZhp8T=3I^R_3BS4Ne2aY8a@1c>T5>@^evyV>2sv?{6^`>DF+jJ`sePaf-#evwI=Jp3S5 zZ^5gqDV?V#&E?oEx0hG%nSZ*6_om;f#vLGLu$&o5Q*HX8#kWkj*E}4p^~pUR+egJ5 zxhl_=1{n6OJY2oLoo#!bF|wUi8T`)tQt*lExM<>)n!3>Y?W1=?^C)Md&ReM1tGQ@n z8qNj++$H!N>uoCzeO1E0ac+vZ?96gLRp7ZdZFpEG*D>|x<&*X&w{I4vvXmzkpzjR| zIhME_x}ntkgdcn9b5N~Lr{I}U!(W~@nXEyKpAF#Ht}H{|9Pl=ax@Z&(6Z{|K^%;Y!k=vGHpLkt4C!T3 z4G8$OxNRu3V|kc7PTq&V0+aQJK3Cwf8-cztQa;(m(yj!2|Hddd=;yDv_MKWO_>tyz z7={*p)Tf1zkxkx%Xc6X-8y5RsHumXA;yr<3zKkgF(xqMA59tIm;6$H^%B1Vi-=0WA zX8ZPteqrKKll$-SBr{5&lR4#mVbr|M4b{LaTu$*{TGb z-5C9^O6qR+w!|HVtvaJkDGd^4S=KYNWh9P(JtFjD;`Lu0esz8@4zQ=x{G~ONh$DwQ zQ(zUzEeXshfD(Xx9ckUiHB(u6D^oz5wqKThC)Df zVsMSoG;}^6GV>35#K!Tbx+&n?zxHAY<~pNkz=ekHpX#Q73m4kIM$^z$g#V}NrqH7= zuKE9)(KOhDnhk7Y{XgHO&_RR&!67J>JJ9iLeM7g@cK^F0Ee@4}i1az4oQE|T~m`@uH55HIWVH8jY6 z@bSR&3?*=Mz}pbpU*Lsq0djs2It$<;M-Q?Mwv`23EU82AL2P?3l71ljAvU)cI%&v$ zh|TYX=NS0>k2t{iF3c&w+Ynn{hA>;%U#b~oKjeHD1_KcO5WW|7K;ZpAHgpz9(Ejj)#P4DO5OO?(|G(D<9}j8di}*ln zje!>`Pw?+qAbc+}SHauhj9nIp*Y=;^LyrIF`VbpyhX~{vV;2{;Gg~n zu|)@7=o!K1huC66ytV(}2OkgkdprnYvkm;GKXQWG5Ae7BAiKcr`?tLyHpq~mT;PG& zP6ICz>ml&~Uk~t4d$Mza&-XW8Ac(Cr@FIU2!XMHfF0xc0cp=+=`ws|WqYi1Li|erh z!0mS-Edu`@VlxfA$h(8Y57OWMX>W+FGVpJI27!kz`1gO?lZ6!$kAL`puMYur(OzH& za`5^7><5A!r@?&w#tUL24ZLu`g5Uu{@clU+1hK^i{S!Zktvv7|Lk;|Ui0wOM&|UBY zr;32_{&Rjvf4-2|LfRLM5AgT?0)p6<1OAS85SR)${(svGd}(m|{=pAo1K$rIUilZ- zgV>S-{>Bdkv6%;6Xgwf&Ab2j4Kfv1%+iu|h?pJ(#=-_|)W-lOjd+=2us4s5(7q-;E z3rlQRQ?fyULE!#P>xACOuTZ#f6^A(rf3i^jp>WZX+ll(Udz>B&VFh}7W*d+>o6g~f;aPg4=a}>^jU83+u0`MOS7u7gmj>0*x zOBBxE5g>p24~2_@F)&Br9N2#;KtE$HQvh7le1SCzP+*rST=$LyxG2K|dlVq`XD(4V ze_6c}g^NllFh}7}YX3hk80X&uS14Q*_klSIf2@Q4p>Y0*d4i$N3o(&0!x{xBuuBxKeMbVo z>N^q?*ncTNXT&Z?0aD}Z{5u`iq5uVUiNg6L-W3YaifFLck$~sG{!0Nm?|7L409v#U z_9#Gs{g(oCs`N4i;JNoa466O1z%EhvW5f8LH`R+$aWFR){wVwZeL7$Jns-s%5!NUG z&VgNu!k?ll|B1py0X|rx06YhFnF3^*^U7F&)p;by)biz*ZRkqH6$%$+9bqmC=fEyS z;e0XRDuw@5I)pt65MckM09_BdOaX9FtP$2IK!N?20(1%MG6m2@y-rx800s763eZ)z z%M<_?B}rk80us@1m|Y%yp!5V3#`5c{an9DEzN@gnu=@EA{8Od#F9m33&t(b#SRD&cV3#`5c{0*v3XnW9 z*nGjbZt48mZ)X6kemg^f{Wl8Gl&{NC0Kn>pCluI!DL}K-E>i%V7Yv8NsW2$8|5AV^ z)?J}+UU?oCDVziQF9m2W;AIMcbH8mEqyPnWiNduLk^oqpkc0yJF9m4E<>e>P;1J4(z`aphA?(6o9NS`gDc@yF}q! zJ9CA?xr-qTjs@T!d&R#`XQEs1EE(6ks)57zv4r2tjiU8VqlRYesP*d+?r zCjSFqHTfS3?7tMCn#Rjf0J6dAqwO5nB?{*<%qtXNbwUz&4(t+zbLHq23a~1{0RAZh z{`ct&6}w)c0IPGVz-#7Iq59k_6u?qw*u1Hp1H06b&LzcHD1hAzV3Wc*uuBxK6-WYM zRUiok_FoF1YwM>%JRQ!X@P9Q2Pt=N>FSYd9>?)WNVd{KR1b~0D*jbnsprt_69NFd_ zjUl4VnMz=k*VAJ8Yjqn?iyH9-zH_Z9{|B*AY=>y-(Rvx-t(E2lJFq!;^BGP0TZe&; z??(%hZ%Gnd?M^#A>b`tXXZ~jETd!@f@q@Zorxq2MSRLF0ni^+E zLfa%Av*rn1B-TYy38S?-nWp`;kG-Ov8g6fS^swO87F`PP@;ZjqEM`&$6b)x7I4Z=v7y?8s`7E*q^vsc znL2OBdO5?y9mA5m?0dHZNx5-{O0+V$w(AzQ-lpLN1=JN|IxR=qd9S8DNNC=)AbilZ zd0JGuS{Y)^wp^<}6r|r=ic!U1Y;dwsHgOs`vAj~Fcsz8Li~Oxum1Z!XsIXH8>|dVy z_Vl=WY2mPjW#c`23O~p*;fFqp>{-5v?>BY9;`vEj%JN351LVcC-Tl6Dz(5JUuPc?`Mz2}r*NN=bWaS8B3URj! z=`i+>+8QoOl;xt+JW5EsbuwW(iLubstwShu_AKaBY6;bi`d5sgH1BfHO26mVW}Pbd zYM!AC+?vgCB^u@X+!29r%63muSVT5S2p`Clx6#Tc(K@u>^DsS87{=iz0tT{KC7oZ#o#h3;?9P|o>iEJm8OQlbtGWr=!z1xrdvUcOj+6Fy~N6z z$LzCIdAdU#uQwTjCjnyIe(RFa`IPf(H1Mfk&cX8t9VT??>>YDVZoztFd|lXo zCRI$qX0s7|b*c2CeSfRT zZf}Hyv*R3@h!@u{p!pnG$gdj*1Z0kUUx~L5H%uZUC7&88E|79_GWq&--f+03B3}E1 zEyNjjH9}vWK`#lrALZ!db9uRK@&ZN?n^flL3M*}D@@zl1v!>V|2N2Y!~a$%gOlezOxyAIA0c!Ork6P0w3+MdusbNjkIocDU$e>Bv_Jy2XZI+RD-bz zIdjLeWQ?8ghVV~+D7l7^?}V-KdDP;v8HJ;?DN5Q5YP+M}oEN5{8Z$`7UPTVpr&b7hSiNTT}zpO5zRrUCT;b@}0$osGg+u7fAi2{B(tiaWb0}cCC4pghnphcqE zI0+{a3i?+L@9Mix0ud$xo^W~G&#~}KWQtL(rHf}uC{;i~O+=Cu{V4bFQ?OY$`VNCQ z*KvOSffw5CmN=Cxi8*gE@dD{A`RRP_c(xY>hXY-xD^<(Ij}Ai8yEOEu$g~ zX88FvcFqrmb_7M)0Ny-9%o?gDV`nP%zmsK6;b2E2mi1f#{R^AojmK5&+z;Hi0d{70 z1K%kKzf!=w=jBlVcEjl z-l`<}D2vB5-{Z(Sclc46zv623K0=9<>?Nzi%e<*l{yHylrmievNta@%cbiW-ypC%TvW|2+Tk78U z-^a{lqVi^H9`0L|-5lLz#u<=yP?|KUH0xfT-G-l?~9L$@b2YsT1wSwx+hZe~ov@~-NO5y7uT7^)=dq~qLD z%3Y}@syC;!?Z5P{`t~V2Z9@%ch(u_P#1Rx$ckw=1Y?~!eR{g2OT2#^@F_5jUU>EqV z6#JnQ0*Z2CNLLs4P?o&h?4;u^$UfEfMA{DCqRU7%(QcQ+60@^VRW`yxW8`MpM9pj( zNR2r={Qy^u$?Tnd(}L7|5l>``Pf`mTx8!IQTZH>kd)biCBu}t5Y9w>qr~1O*tD=ol%!*gkYMRAl%(_tQ7Ta zW-OMR^z;;Tx*?B)R!Sn27#p*{R4Ly6_2$j5J8Z?AbT6#S`1!CaBPb7)9bdfA zHvt@(XaL5=ZBqlbO!$wcQkAI`+ z;6V6$G9ab@h$(|4!<-~&f9DS8FsV<6BY9Zla_Q>+Q%VAX7GP@@snLcbH;ES;Bj~8;q~oP+Q{tOep;?eZL#xb34@Df5 z^wd~Ranveglel-4ZxrAR(mBnZ0_BY#lm)VfRspsi2Vi}7l!#f&Ol!A4X!RCH;zf@v zdblMduniK9mSj~g#3Pz|XT$P2phG#VqYF+=hBST20L5jkE4(jBJ@BVBeSyLUt(&Do zuPhCN(r+o-6y9sFq>22UH1f8+>e#2Pp){X)%Ed$o$C&QbBMD6Mz)8;|B zF3#b5?UtQi>sU9|;cmOq*V9#CHiiWR>vsOqjK~QSwzFJDu2VpfP;KRQ*HOl%l)a}e z`&2@Z?pywAMy~1EXN2xWleVhmKN@`ql?ZK87qr`!PiE2DV#l&eD4u#RP?FHJdp_YRP6t^dd2w*W2Bm4W&%Jg#K(z1UZ#=E1(3*W1>Fl?g)JN;1B%}L2V0R2Z zCh8Y;c^(|bIAYl-$;Tfu7<8XGM47NcM^DJsT~G}>JkIQspIF-ooYiA0P0xuY>ug4$ z5f800W0>?r-6i7q-HdhAp^lq)Qwm>)SSSlsfq*mT`A_bN0-0}$Bw~%Ms4c_8r@G5~ z+(3qbk8~i(e3QIQyv-R0F-N$;^sI@K4Qq|tn@jN}B*dG;ic-=09goD0>@6ll9VT>7 zf?Y8YD-~E&9< zJ(5|T_Z|9vX01PdgmH7oDO%&L)>@X9+1A$*9AOf?3!Zl@Gs}0?K-V~ILm*~6+DWpP zk|#5fJBiAgz+KlaF{h0|RZ$D!;={wvQ*S)>~<&0VFKJoPTc+6&j z>{4^TM#>FQeR>jW&_`!2Dbsq5y21t7t>XyHclPY*2>0>7A!vM7n)vN6?Bwulm}O6> z#o}10zQ&1Kw0vtSJZ#(j#{Nbo%h-tc{OsC0mzL&mw`UY%BkA2|EGPF5?KWu*O5=~z zu|2F4)H z_mxuNYNjAUQSC0kN zyHK?+`U1ZofO7(PFk;W9FE zB&_+s8nZlcgjCHN)B5YHRhsRW-n7kXU<@}V^SVZEw(e|>UOYp_uJ!<9jFfaBBCY3_ zX75V%vF>I<`EeoVD*x4D6mF69nIyghviXls+RJ75zY}FVGkO6w=8w7Kr+&X{U;l97 zV8M~*nW7LzxgC!%+&p?(P{s}UlYT+BB7H|D6El5BN>WqT-qw&}QZyR)WY*{WHv=!VZlv_l^1W~B=$-atbYJ$0e+ zLN*b(6_|H}`7tfqVpVK2?I&R3D9itd|t=flS5yfut*f{k}<$5p4S40q+- zW8Xb>EV*f|K%Q3oSo`Cbz=#(UZsU?tKY(93B{7D!tcQ>-tO>jntJ3f>YMJh~{Q~X? z#3byH2{%5lim|Gi=IWj`oQlOATe7g3xp$xl$I@~#quscWN)=c3mZ0*92bN;~OS<~h z=CYUj-@c?rnP6exH`^ZPL5l9-!tBtz#b-DAy0%|3Yjyrvd@5I@X`?Rn>1P)$LHX_z zydhnTsg+u$`aPOC$xMHL+4xdKJx;LgGsdrOdA4SWMhEr~nh0ExpSNOX!h9AGQ~OaY zQxdA30wizYVmdEViStM+j001>fVLEQ%NQ=jWyn4}Wvah|umV_GaEbvw3NiNh z-O)~`6zJ;!(9cGTNuFwEQcVLb=8rx(skHv0lI&G4lmA5Y01N4R*}GQ?B^o65jCVJS zpO=T`W~P1le!IEWVX&$F7Rd+rs>s8Z=}=dmF`FY-cqYQ90>9D_ zOH^3A%qtAs|LO98&34mAjuMY0X@-4qYP97ug?49X(s&#$DYkOzu_nru|z;r!uDkZ4r}W%wQUgk%~c|GWESw^u3sD4dUdrueC*t!5+c zc;LOUjmKTWuYL6`&ylZI&}4|-HO%#7yKB#WkfcLDSwU)JhwDMvUTZ*0pAc^^V&6`G z1aj0W59^TCtV4x@r zyf{d#og9jUh5e)TYjjzsu5Z|T8rj!szEckl@|D-%6b7@TxQIwuQI}rx*u!zfR0C=k zBjWlA;}91bY-O7(+i8bJ>aip09|#Mc)&@@9wtbbH$S*UcX*$U9daOfEtoD7G4Zf{} zza_o2W7apFB%g^2gLkSlub-P{y$xb8(@=fNs+=kP;gi&_0MGYr$KN|hRjld-E$hkC zr%okx=#l8@3OE+zcsdBaXq^3`l!L2{M~x76Ee)~MKC|g9HqNNlI_dNEcIAO<8Q)c~ z9>s~`#W+jXed{a5B7srJ>u7+Az=F7xQeH7ie7g(|&`z2cZA~D>u~y*!5bh3w9hIP! z)0{E3nB{LD1>StqfFVw44?Ssiqw1r4tC#WWMDakL@AMP1VWDZ3t0+7iO!e*a6FbZm zEMJKc#4B7uJF=jc={_up%&`Vzy7%rd3FpNaHHI+ver+J8)0_2pew#-@)}EW-^f4~n zEM;pMB93x04zCEW9ez-zFA*-sgWC+f^q2#bda{b>PSy^|kxlPp>g3K$BnN98=woPU zs6AJLhfr>v5a@>7HhE#?2H#T?J@HBOaNjuv@2ezZuQo1A`{z$55%`bCquvc?M(T2k zTT5D|Q)YSI+UUFGJ!XXU-UA^iZdeYTyD@SL(TMx04c+#~@OnP3>F`vPvS-7tdU3b4 zNs(}Xwvwt@J~MP{H+5}C?vX@y3ja)-LK(Dobt#wE=3*#`_Iy>uGs-`yY9-Ol?yCi0 z?r`cHX>84xAbHXBCc4w@rE^TwSPF6Rkc}(;I7Tfqf;9C+#LH94A?cT4ivr<^uUEm0hBdOqKlMN2p43g|Wl*^){aMO&DBP@P5*nU^|KJFxQFGtwV3T`&S+t|d~ z^3M!e!R4f81tQK`?89bMrk0JYzj)>(P)1-lXOJ$lA2Ra$daQbU-Th7FY*>}ukTSFQ zkc0_&kD2t~$LP9(L3RY44*JvIpOz+`G2vAge7BWXnd&<@)Glc23jNZ>h&!CC(u7di z(cX)Snvpm>4S(oaU~k3ZBwz78IytCZ4gnqE1YRG#%&Rv#`3p8xzelJa6?<;K3&HQH z7USVjGQP1Bdc32ZAY(n(FlLgs34DxQuhsP4*PXmNkRNvk>~y+VGk&RmdtlExHUII& za{SVwEPDYr4T2NHR8fCtX3|4-?e=e2(zyod8V~t#%3p{L$vJ$84gB8r5QFcb4#GW7 zF3CV)`Q8~mC#`5%ud%T=izMJwd?;XzW#Y-?Rwy+Z7e$toCDz_2#_5UgoJ06AMvs)X z6lCMQJ$w@#$;~MPeoY>9C!lw=@op~HNQZ}hv8YCHZ$+!dVb4mGCjwx0*A(+`+SH=y z8ZUT-#T2PIuZQv2ZcsB`ny=Hg z!o{(4Z&!yaw}~_1DRE|y;a2BULd@?D*k@0MdG6OIh}Du>ce8)>9au~EP{03zl*5lGRx~)>6_Vr z{Z%jgVE-}M23=Tk{59Ez&c=h2Tx9fL80iX{+oNkh@+}~LX6IzpBK^l}6?*i=HUEDz z*}leB8@y1*0`dMmUv~i8%!2bkSs>oZ;B9n>tu@3J8uX8iGuYgR1@w>2GFXMf0{Ux% z%MM;O18@Jey@l8kgP=CY(DOlTe*durhS>Uo{;@>{ui~&kymT+{fE{^Rz+TmVw;|_) z+E$;R51jM~-v0Z0uq6=~-#@*Q_xIqRg7KXH{``DksV4aMe{Fif zS}$;W{M`l%alq~I_js`42)zIAHpCVi1hol<;)9(39~)nAYBw0~UwjaoXV72UW)OIt z7rg(kjWD?B!R_-m9^kbvaQpnl19q4OpZ_mEu+|Cu`@iQ0E6Kt9{+6UYgiLLLV-cx{#_D> z4zw#2U^OEibWKJ)^xklV0<3zyfUfa+f!@xpP=Hlu1<*OLOC9OjJR=aS<{3eOU8VrJ ziCm5X-Axr-s|7|o(lzD~ z(3g1#t$$U6AXv3-f&#k~h4b%^D->YWWE4{B=(2(q`pI;K0<78+fUfbwgMQ^*p#ZB% z{h(`-`k^1DS17=0{wbtJ(3OsKZBYV9wJq3uI$u+i0Q&iVB?_=AxdUBOlmI$oafJe` z`W``wt6k|x*Vfws!Kyk03JlWX|9<{M<~goJ0akOdAtmpwMB&=nQ;=d+usNL1fnAEi zwLYnki7D8ma1QJeh4Tr+D;)_|H9DYcG&;~Z&MOpP)$0XP9`DLnIG>iiLIGC2At4nt zuTZ#F1PrN_2b*KzIuY=-YH|>)s>z|iE)D1N`T8pz30CbbLD$$@LYEk>P=HmJ5y-OF zm9cQXDsqJatZMo}=fEy?q-$M9K(OjE0tI%N!nHFPuqyTfT~iGYx?FapBf+W^8&Zk% z>R7lo3b1NR0J_GO0JszT0aqx%s?{s#nldTuf1J(#o!Mr;sJZ=r z7XeFrCTg~9-rS~J;9wRs-K`~h6?yYJnMTZSB0fJpc}m*H$Y?l$bVq$hu_bnPDs~+_ z@ZhhIM|KVQ`ULAy1hR%I?Si_{;X|MfBJ5hUm_vmKlDf-=`P9&_s??FDD2HtYFihTDreag%4$%ZEBci>{WFw8NHF zI|JRar#Z2UB*&^9wMW@6Cbjxh`X1dH&C_Y09;qDvFwR9NQ@RwIRFtx++X$FzJ;~u* zHOGD6TtcpHv0+A#o$<!?Zu9Bztcr@~8`A3p2cL+cAhXZ)_L8^7qW5IeD?R zV!hX=Ikqs2aCD$@y5wlh?eePhmg)gB$!}(Rk|Qzm5tn|P*Uds~%Be-O6RRzS1|=n& z1*#GC1&Vd^z(5fp;sHyZ7o8r(pB6f^aJYVOY@X~!_M|c=F>BLR=@C7W`PbYh3ssxg zE=8(e6ximILt%wQ2ieW}01Ueqy=T z;IeDuu4bMsPM4}tZ;3cwG{t(i!p$)^;VTluW3pTLQNvr##4(Q_btPk{ti>HH$mvY- zaSeqb+9G`bW$<9uP*ejeW8`tOAtqDtmfAHT z?{v(h?G^u$lTh@xyNjDD=*bcZYAMsKmQ!nNP)B*x1m5XIb};C zOwbc?SZ`d!Ga7kl0*f;EsH6uOUb@i8>IPa8KaW;*Gl#XCifApMmx$&Qb>fQrrsa